From cb49d6b256db1738d5adb78efd5fd09fdf669d61 Mon Sep 17 00:00:00 2001 From: gwl Date: Thu, 27 Feb 2014 17:12:06 +0800 Subject: [PATCH] wifi: remove unused wifi drivers and patch we add before. --- drivers/net/wireless/ar6003/Kconfig | 9 - drivers/net/wireless/ar6003/Makefile | 77 - drivers/net/wireless/ar6003/clean.sh | 5 - drivers/net/wireless/ar6003/host/Makefile | 174 - .../ar6003/host/bmi/include/bmi_internal.h | 40 - .../net/wireless/ar6003/host/bmi/src/bmi.c | 774 -- .../net/wireless/ar6003/host/bmi/src/makefile | 26 - drivers/net/wireless/ar6003/host/dfs/dfs.c | 228 - drivers/net/wireless/ar6003/host/dfs/dfs_ar.c | 262 - .../wireless/ar6003/host/dfs/dfs_bindetects.c | 340 - .../net/wireless/ar6003/host/dfs/dfs_debug.c | 71 - .../wireless/ar6003/host/dfs/dfs_fcc_bin5.c | 189 - .../ar6003/host/dfs/dfs_host_project.c | 45 - .../net/wireless/ar6003/host/dfs/dfs_init.c | 375 - .../net/wireless/ar6003/host/dfs/dfs_misc.c | 120 - .../ar6003/host/dfs/dfs_process_phyerr.c | 99 - .../ar6003/host/dfs/dfs_process_radarevent.c | 316 - .../wireless/ar6003/host/dfs/dfs_staggered.c | 202 - .../wireless/ar6003/host/dfs/dfs_target_api.h | 31 - drivers/net/wireless/ar6003/host/dfs/makefile | 26 - .../host/hif/common/hif_bmi_reg_access.c | 379 - .../host/hif/common/hif_diag_reg_access.c | 266 - .../ar6003/host/hif/common/hif_sdio_common.h | 102 - .../wireless/ar6003/host/hif/common/makefile | 12 - .../wireless/ar6003/host/hif/sdio/Makefile | 90 - .../sdio/linux_sdio/include/hif_internal.h | 137 - .../ar6003/host/hif/sdio/linux_sdio/src/hif.c | 1504 --- .../hif/sdio/linux_sdio/src/hif_scatter.c | 393 - .../wireless/ar6003/host/htc2/AR6000/ar6k.c | 1463 -- .../wireless/ar6003/host/htc2/AR6000/ar6k.h | 399 - .../ar6003/host/htc2/AR6000/ar6k_events.c | 767 -- .../ar6003/host/htc2/AR6000/ar6k_gmbox.c | 757 -- .../host/htc2/AR6000/ar6k_gmbox_hciuart.c | 1289 -- .../wireless/ar6003/host/htc2/AR6000/makefile | 26 - drivers/net/wireless/ar6003/host/htc2/htc.c | 578 - .../net/wireless/ar6003/host/htc2/htc_debug.h | 38 - .../wireless/ar6003/host/htc2/htc_internal.h | 217 - .../net/wireless/ar6003/host/htc2/htc_recv.c | 1572 --- .../net/wireless/ar6003/host/htc2/htc_send.c | 1024 -- .../wireless/ar6003/host/htc2/htc_services.c | 449 - .../wireless/ar6003/host/include/a_config.h | 57 - .../wireless/ar6003/host/include/a_debug.h | 219 - .../net/wireless/ar6003/host/include/a_drv.h | 50 - .../wireless/ar6003/host/include/a_drv_api.h | 333 - .../wireless/ar6003/host/include/a_osapi.h | 58 - .../wireless/ar6003/host/include/a_types.h | 54 - .../ar6003/host/include/aggr_recv_api.h | 156 - .../wireless/ar6003/host/include/ar3kconfig.h | 65 - .../wireless/ar6003/host/include/ar6000_api.h | 54 - .../ar6003/host/include/ar6000_diag.h | 48 - .../ar6003/host/include/ar6kap_common.h | 46 - .../ar6003/host/include/athbtfilter.h | 135 - .../wireless/ar6003/host/include/athendpack.h | 52 - .../ar6003/host/include/athstartpack.h | 69 - .../net/wireless/ar6003/host/include/bmi.h | 140 - .../wireless/ar6003/host/include/common_drv.h | 107 - .../wireless/ar6003/host/include/dbglog_api.h | 58 - .../wireless/ar6003/host/include/dfs_host.h | 387 - .../ar6003/host/include/dfs_host_project.h | 57 - .../wireless/ar6003/host/include/dl_list.h | 153 - .../wireless/ar6003/host/include/dset_api.h | 65 - .../wireless/ar6003/host/include/gpio_api.h | 59 - .../ar6003/host/include/hci_transport_api.h | 259 - .../net/wireless/ar6003/host/include/hif.h | 517 - .../ar6003/host/include/host_reg_table.h | 226 - .../ar6003/host/include/host_version.h | 52 - .../wireless/ar6003/host/include/htc_api.h | 575 - .../wireless/ar6003/host/include/htc_packet.h | 227 - .../wireless/ar6003/host/include/p2p_api.h | 116 - .../wireless/ar6003/host/include/project.h | 36 - .../ar6003/host/include/target_reg_table.h | 349 - .../wireless/ar6003/host/include/utils_api.h | 103 - .../wireless/ar6003/host/include/wlan_api.h | 137 - .../wireless/ar6003/host/include/wmi_api.h | 565 - .../net/wireless/ar6003/host/lib/wac/Makefile | 46 - .../net/wireless/ar6003/host/lib/wac/wac.c | 1446 -- .../ar6003/host/lib/wac/wac_lib_api.h | 92 - .../wireless/ar6003/host/localmake.linux.inc | 40 - .../host/miscdrv/ar3k/30000/PS_ASIC.pst | 59 - .../host/miscdrv/ar3k/30000/RamPatch.txt | 2 - .../host/miscdrv/ar3k/30000coex/PS_ASIC.pst | 68 - .../ar3k/30000coex/PS_ASIC_aclHighPri.pst | 68 - .../ar3k/30000coex/PS_ASIC_aclLowPri.pst | 68 - .../host/miscdrv/ar3k/30000coex/RamPatch.txt | 2 - .../host/miscdrv/ar3k/30101/PS_ASIC.pst | 65 - .../host/miscdrv/ar3k/30101/RamPatch.txt | 2 - .../ar6003/host/miscdrv/ar3k/30101/Readme.txt | 22 - .../host/miscdrv/ar3k/30101coex/PS_ASIC.pst | 93 - .../ar3k/30101coex/PS_ASIC_aclHighPri.pst | 93 - .../ar3k/30101coex/PS_ASIC_aclLowPri.pst | 93 - .../host/miscdrv/ar3k/30101coex/RamPatch.txt | 2 - .../wireless/ar6003/host/miscdrv/ar3kconfig.c | 569 - .../ar6003/host/miscdrv/ar3kps/ar3kpsconfig.c | 694 - .../ar6003/host/miscdrv/ar3kps/ar3kpsconfig.h | 79 - .../ar6003/host/miscdrv/ar3kps/ar3kpsparser.c | 989 -- .../ar6003/host/miscdrv/ar3kps/ar3kpsparser.h | 127 - .../wireless/ar6003/host/miscdrv/common_drv.c | 882 -- .../ar6003/host/miscdrv/credit_dist.c | 417 - .../net/wireless/ar6003/host/miscdrv/makefile | 26 - .../wireless/ar6003/host/miscdrv/miscdrv.h | 38 - .../wireless/ar6003/host/os/linux/Makefile | 338 - .../ar6003/host/os/linux/ar6000_android.c | 965 -- .../ar6003/host/os/linux/ar6000_drv.c | 8934 ------------- .../wireless/ar6003/host/os/linux/ar6000_pm.c | 1115 -- .../ar6003/host/os/linux/ar6000_raw_if.c | 465 - .../ar6003/host/os/linux/ar6k_mem_debug.c | 246 - .../wireless/ar6003/host/os/linux/ar6k_pal.c | 471 - .../wireless/ar6003/host/os/linux/cfg80211.c | 1638 --- .../wireless/ar6003/host/os/linux/eeprom.c | 569 - .../host/os/linux/export_hci_transport.c | 122 - .../ar6003/host/os/linux/hci_bridge.c | 1174 -- .../ar6003/host/os/linux/include/ar6000_drv.h | 919 -- .../ar6003/host/os/linux/include/ar6k_pal.h | 47 - .../host/os/linux/include/ar6xapi_linux.h | 244 - .../host/os/linux/include/athdrv_linux.h | 1470 --- .../host/os/linux/include/athtypes_linux.h | 53 - .../ar6003/host/os/linux/include/cfg80211.h | 50 - .../host/os/linux/include/config_linux.h | 70 - .../host/os/linux/include/debug_linux.h | 50 - .../os/linux/include/export_hci_transport.h | 76 - .../host/os/linux/include/ieee80211_ioctl.h | 181 - .../host/os/linux/include/osapi_linux.h | 432 - .../host/os/linux/include/wlan_config.h | 146 - .../host/os/linux/include/wmi_filter_linux.h | 346 - .../net/wireless/ar6003/host/os/linux/ioctl.c | 5611 -------- .../wireless/ar6003/host/os/linux/netbuf.c | 272 - .../ar6003/host/os/linux/wireless_ext.c | 2945 ----- drivers/net/wireless/ar6003/host/p2p/makefile | 26 - .../wireless/ar6003/host/p2p/p2p_internal.h | 93 - .../net/wireless/ar6003/host/p2p/p2p_main.c | 2676 ---- .../wireless/ar6003/host/regtable/AR6002def.c | 65 - .../wireless/ar6003/host/regtable/AR6003def.c | 52 - .../ar6003/host/regtable/MCKINLEYdef.c | 50 - .../wireless/ar6003/host/regtable/hostdef.h | 37 - .../wireless/ar6003/host/regtable/makefile | 26 - .../wireless/ar6003/host/regtable/regtable.c | 73 - .../wireless/ar6003/host/regtable/targetdef.h | 37 - .../ar6003/host/reorder/aggr_rx_internal.h | 125 - .../net/wireless/ar6003/host/reorder/makefile | 26 - .../wireless/ar6003/host/reorder/rcv_aggr.c | 749 -- .../ar6003/host/wlan/include/ieee80211.h | 401 - .../ar6003/host/wlan/include/ieee80211_node.h | 84 - .../wireless/ar6003/host/wlan/src/makefile | 26 - .../wireless/ar6003/host/wlan/src/wlan_node.c | 644 - .../ar6003/host/wlan/src/wlan_recv_beacon.c | 206 - .../ar6003/host/wlan/src/wlan_utils.c | 62 - drivers/net/wireless/ar6003/host/wmi/makefile | 26 - drivers/net/wireless/ar6003/host/wmi/wmi.c | 9173 ------------- .../net/wireless/ar6003/host/wmi/wmi_host.h | 95 - .../ar6003/include/AR6002/AR6002_regdump.h | 60 - .../ar6003/include/AR6002/AR6K_version.h | 52 - .../wireless/ar6003/include/AR6002/addrs.h | 123 - .../ar6003/include/AR6002/hw/LegacyRegsEnv.vr | 58 - .../include/AR6002/hw/LegacyRegsEnvConfig.vr | 42 - .../ar6003/include/AR6002/hw/LegacyRegsTop.vr | 39 - .../include/AR6002/hw/LegacyRegsTopConfig.vr | 46 - .../ar6003/include/AR6002/hw/Makefile.child | 10 - .../ar6003/include/AR6002/hw/Makefile.reg | 28 - .../wireless/ar6003/include/AR6002/hw/addac.h | 86 - .../ar6003/include/AR6002/hw/addac.vrh | 123 - .../include/AR6002/hw/analog_intf_reg.h | 64 - .../include/AR6002/hw/analog_intf_reg.vrh | 82 - .../ar6003/include/AR6002/hw/analog_reg.h | 1932 --- .../ar6003/include/AR6002/hw/analog_reg.vrh | 3084 ----- .../ar6003/include/AR6002/hw/apb_map.h | 13 - .../ar6003/include/AR6002/hw/apb_map.vrh | 21 - .../ar6003/include/AR6002/hw/bias_reg.h | 293 - .../ar6003/include/AR6002/hw/bias_reg.vrh | 450 - .../ar6003/include/AR6002/hw/gpio_reg.h | 977 -- .../ar6003/include/AR6002/hw/gpio_reg.vrh | 1471 --- .../ar6003/include/AR6002/hw/mac_pcu.h | 980 -- .../ar6003/include/AR6002/hw/mac_pcu.vrh | 979 -- .../ar6003/include/AR6002/hw/mbox_host_reg.h | 386 - .../include/AR6002/hw/mbox_host_reg.vrh | 563 - .../ar6003/include/AR6002/hw/mbox_reg.h | 481 - .../ar6003/include/AR6002/hw/mbox_reg.vrh | 746 -- .../ar6003/include/AR6002/hw/rf2G_reg.h | 160 - .../ar6003/include/AR6002/hw/rf2G_reg.vrh | 240 - .../ar6003/include/AR6002/hw/rf5G_reg.h | 195 - .../ar6003/include/AR6002/hw/rf5G_reg.vrh | 296 - .../ar6003/include/AR6002/hw/rtc_reg.h | 1163 -- .../ar6003/include/AR6002/hw/rtc_reg.vrh | 1758 --- .../ar6003/include/AR6002/hw/rxtxbb_reg.h | 278 - .../ar6003/include/AR6002/hw/rxtxbb_reg.vrh | 433 - .../ar6003/include/AR6002/hw/si_reg.h | 186 - .../ar6003/include/AR6002/hw/si_reg.vrh | 278 - .../ar6003/include/AR6002/hw/synth_reg.h | 599 - .../ar6003/include/AR6002/hw/synth_reg.vrh | 939 -- .../ar6003/include/AR6002/hw/top_reg.h | 235 - .../ar6003/include/AR6002/hw/top_reg.vrh | 388 - .../ar6003/include/AR6002/hw/txpc_reg.h | 170 - .../ar6003/include/AR6002/hw/txpc_reg.vrh | 257 - .../ar6003/include/AR6002/hw/uart_reg.h | 327 - .../ar6003/include/AR6002/hw/uart_reg.vrh | 488 - .../ar6003/include/AR6002/hw/vmc_reg.h | 76 - .../ar6003/include/AR6002/hw/vmc_reg.vrh | 100 - .../include/AR6002/hw2.0/hw/LegacyRegsEnv.vr | 58 - .../AR6002/hw2.0/hw/LegacyRegsEnvConfig.vr | 42 - .../include/AR6002/hw2.0/hw/LegacyRegsTop.vr | 39 - .../AR6002/hw2.0/hw/LegacyRegsTopConfig.vr | 46 - .../include/AR6002/hw2.0/hw/Makefile.child | 10 - .../include/AR6002/hw2.0/hw/Makefile.reg | 28 - .../ar6003/include/AR6002/hw2.0/hw/addac.h | 86 - .../ar6003/include/AR6002/hw2.0/hw/addac.vrh | 123 - .../include/AR6002/hw2.0/hw/analog_intf_reg.h | 64 - .../AR6002/hw2.0/hw/analog_intf_reg.vrh | 82 - .../include/AR6002/hw2.0/hw/analog_reg.h | 1932 --- .../include/AR6002/hw2.0/hw/analog_reg.vrh | 3084 ----- .../ar6003/include/AR6002/hw2.0/hw/apb_map.h | 13 - .../include/AR6002/hw2.0/hw/apb_map.vrh | 21 - .../ar6003/include/AR6002/hw2.0/hw/bias_reg.h | 293 - .../include/AR6002/hw2.0/hw/bias_reg.vrh | 450 - .../ar6003/include/AR6002/hw2.0/hw/gpio_reg.h | 977 -- .../include/AR6002/hw2.0/hw/gpio_reg.vrh | 1471 --- .../ar6003/include/AR6002/hw2.0/hw/mac_pcu.h | 980 -- .../include/AR6002/hw2.0/hw/mac_pcu.vrh | 979 -- .../include/AR6002/hw2.0/hw/mbox_host_reg.h | 386 - .../include/AR6002/hw2.0/hw/mbox_host_reg.vrh | 563 - .../ar6003/include/AR6002/hw2.0/hw/mbox_reg.h | 481 - .../include/AR6002/hw2.0/hw/mbox_reg.vrh | 746 -- .../ar6003/include/AR6002/hw2.0/hw/rf2G_reg.h | 160 - .../include/AR6002/hw2.0/hw/rf2G_reg.vrh | 240 - .../ar6003/include/AR6002/hw2.0/hw/rf5G_reg.h | 195 - .../include/AR6002/hw2.0/hw/rf5G_reg.vrh | 296 - .../ar6003/include/AR6002/hw2.0/hw/rtc_reg.h | 1163 -- .../include/AR6002/hw2.0/hw/rtc_reg.vrh | 1758 --- .../include/AR6002/hw2.0/hw/rxtxbb_reg.h | 278 - .../include/AR6002/hw2.0/hw/rxtxbb_reg.vrh | 433 - .../ar6003/include/AR6002/hw2.0/hw/si_reg.h | 186 - .../ar6003/include/AR6002/hw2.0/hw/si_reg.vrh | 278 - .../include/AR6002/hw2.0/hw/synth_reg.h | 599 - .../include/AR6002/hw2.0/hw/synth_reg.vrh | 939 -- .../ar6003/include/AR6002/hw2.0/hw/top_reg.h | 235 - .../include/AR6002/hw2.0/hw/top_reg.vrh | 388 - .../ar6003/include/AR6002/hw2.0/hw/txpc_reg.h | 170 - .../include/AR6002/hw2.0/hw/txpc_reg.vrh | 257 - .../ar6003/include/AR6002/hw2.0/hw/uart_reg.h | 327 - .../include/AR6002/hw2.0/hw/uart_reg.vrh | 488 - .../ar6003/include/AR6002/hw2.0/hw/vmc_reg.h | 76 - .../include/AR6002/hw2.0/hw/vmc_reg.vrh | 100 - .../AR6002/hw4.0/hw/analog_intf_ares_reg.h | 3291 ----- .../hw4.0/hw/analog_intf_athr_wlan_reg.h | 3674 ------ .../include/AR6002/hw4.0/hw/analog_intf_reg.h | 37 - .../AR6002/hw4.0/hw/apb_athr_wlan_map.h | 40 - .../ar6003/include/AR6002/hw4.0/hw/apb_map.h | 48 - .../include/AR6002/hw4.0/hw/bb_lc_reg.h | 7076 ---------- .../include/AR6002/hw4.0/hw/efuse_reg.h | 108 - .../AR6002/hw4.0/hw/gpio_athr_wlan_reg.h | 1253 -- .../ar6003/include/AR6002/hw4.0/hw/gpio_reg.h | 1094 -- .../include/AR6002/hw4.0/hw/mac_dma_reg.h | 601 - .../include/AR6002/hw4.0/hw/mac_pcu_reg.h | 3065 ----- .../include/AR6002/hw4.0/hw/mbox_host_reg.h | 37 - .../ar6003/include/AR6002/hw4.0/hw/mbox_reg.h | 560 - .../AR6002/hw4.0/hw/mbox_wlan_host_reg.h | 522 - .../include/AR6002/hw4.0/hw/mbox_wlan_reg.h | 638 - .../ar6003/include/AR6002/hw4.0/hw/rdma_reg.h | 564 - .../ar6003/include/AR6002/hw4.0/hw/rtc_reg.h | 975 -- .../include/AR6002/hw4.0/hw/rtc_wlan_reg.h | 2065 --- .../ar6003/include/AR6002/hw4.0/hw/si_reg.h | 209 - .../ar6003/include/AR6002/hw4.0/hw/uart_reg.h | 260 - .../include/AR6002/hw4.0/hw/umbox_reg.h | 37 - .../include/AR6002/hw4.0/hw/umbox_wlan_reg.h | 322 - .../ar6003/include/AR6002/hw4.0/hw/vmc_reg.h | 167 - .../include/AR6002/hw4.0/hw/vmc_wlan_reg.h | 195 - .../hw6.0/hw/analog_intf_athr_wlan_reg.h | 3729 ------ .../include/AR6002/hw6.0/hw/analog_intf_reg.h | 37 - .../AR6002/hw6.0/hw/apb_athr_wlan_map.h | 72 - .../ar6003/include/AR6002/hw6.0/hw/apb_map.h | 47 - .../AR6002/hw6.0/hw/athrI2cSlaveApbCsr.h | 474 - .../ar6003/include/AR6002/hw6.0/hw/bb_reg.h | 8970 ------------- .../hw6.0/hw/bridge_chain_gmac_0_rx_reg.h | 122 - .../hw6.0/hw/bridge_chain_gmac_0_tx_reg.h | 118 - .../AR6002/hw6.0/hw/bridge_chain_rx_reg.h | 122 - .../AR6002/hw6.0/hw/bridge_chain_tx_reg.h | 118 - .../include/AR6002/hw6.0/hw/bridge_intr_reg.h | 363 - .../hw6.0/hw/bridge_intr_reg_gmac_1_1.h | 83 - .../include/AR6002/hw6.0/hw/bt_coex_reg.h | 618 - .../AR6002/hw6.0/hw/chk_sum_seg_acc_reg.h | 407 - .../include/AR6002/hw6.0/hw/efuse_reg.h | 44 - .../include/AR6002/hw6.0/hw/efuse_wlan_reg.h | 153 - .../ar6003/include/AR6002/hw6.0/hw/fpga_reg.h | 137 - .../AR6002/hw6.0/hw/gpio_athr_wlan_reg.h | 2638 ---- .../ar6003/include/AR6002/hw6.0/hw/gpio_reg.h | 2411 ---- .../include/AR6002/hw6.0/hw/mac_dma_reg.h | 347 - .../include/AR6002/hw6.0/hw/mac_pcu_reg.h | 40 - .../include/AR6002/hw6.0/hw/map_rf_reg.h | 199 - .../include/AR6002/hw6.0/hw/mbox_host_reg.h | 37 - .../include/AR6002/hw6.0/hw/mbox_i2s_reg.h | 299 - .../ar6003/include/AR6002/hw6.0/hw/mbox_reg.h | 580 - .../AR6002/hw6.0/hw/mbox_wlan_host_reg.h | 522 - .../include/AR6002/hw6.0/hw/mbox_wlan_reg.h | 692 - .../ar6003/include/AR6002/hw6.0/hw/mdio_reg.h | 67 - .../ar6003/include/AR6002/hw6.0/hw/mii_reg.h | 83 - .../ar6003/include/AR6002/hw6.0/hw/mmac_reg.h | 375 - .../ar6003/include/AR6002/hw6.0/hw/odin_reg.h | 397 - .../ar6003/include/AR6002/hw6.0/hw/rdma_reg.h | 948 -- .../ar6003/include/AR6002/hw6.0/hw/rtc_reg.h | 1189 -- .../include/AR6002/hw6.0/hw/rtc_soc_reg.h | 1856 --- .../include/AR6002/hw6.0/hw/rtc_sync_reg.h | 221 - .../include/AR6002/hw6.0/hw/rtc_wlan_reg.h | 677 - .../ar6003/include/AR6002/hw6.0/hw/si_reg.h | 308 - .../include/AR6002/hw6.0/hw/stereo_reg.h | 204 - .../ar6003/include/AR6002/hw6.0/hw/uart_reg.h | 260 - .../include/AR6002/hw6.0/hw/umbox_reg.h | 37 - .../include/AR6002/hw6.0/hw/umbox_wlan_reg.h | 322 - .../include/AR6002/hw6.0/hw/usb_cast_reg.h | 1387 -- .../include/AR6002/hw6.0/hw/wlan_coex_reg.h | 839 -- .../include/AR6002/hw6.0/hw/wmac_dcu_reg.h | 772 -- .../include/AR6002/hw6.0/hw/wmac_dma_reg.h | 1000 -- .../include/AR6002/hw6.0/hw/wmac_pcu_reg.h | 4492 ------- .../include/AR6002/hw6.0/hw/wmac_qcu_reg.h | 251 - drivers/net/wireless/ar6003/include/a_hci.h | 668 - drivers/net/wireless/ar6003/include/athdefs.h | 84 - drivers/net/wireless/ar6003/include/bmi_msg.h | 334 - .../net/wireless/ar6003/include/btcoexGpio.h | 86 - drivers/net/wireless/ar6003/include/cnxmgmt.h | 36 - drivers/net/wireless/ar6003/include/dbglog.h | 134 - .../net/wireless/ar6003/include/dbglog_id.h | 593 - .../net/wireless/ar6003/include/dfs_common.h | 84 - .../net/wireless/ar6003/include/discovery.h | 77 - .../wireless/ar6003/include/dset_internal.h | 63 - drivers/net/wireless/ar6003/include/dsetid.h | 134 - .../net/wireless/ar6003/include/epping_test.h | 120 - drivers/net/wireless/ar6003/include/gmboxif.h | 83 - drivers/net/wireless/ar6003/include/gpio.h | 51 - .../ar6003/include/host_proxy_iface.h | 45 - drivers/net/wireless/ar6003/include/htc.h | 238 - .../wireless/ar6003/include/htc_services.h | 52 - .../net/wireless/ar6003/include/ini_dset.h | 83 - .../wireless/ar6003/include/iot_flashotp.h | 55 - drivers/net/wireless/ar6003/include/p2p.h | 429 - drivers/net/wireless/ar6003/include/pkt_log.h | 45 - drivers/net/wireless/ar6003/include/queue.h | 564 - drivers/net/wireless/ar6003/include/regdump.h | 59 - drivers/net/wireless/ar6003/include/roaming.h | 41 - .../net/wireless/ar6003/include/targaddrs.h | 398 - drivers/net/wireless/ar6003/include/testcmd.h | 247 - drivers/net/wireless/ar6003/include/tlpm.h | 38 - .../net/wireless/ar6003/include/wac_defs.h | 56 - .../net/wireless/ar6003/include/wlan_defs.h | 85 - .../net/wireless/ar6003/include/wlan_dset.h | 33 - drivers/net/wireless/ar6003/include/wmi.h | 3834 ------ .../net/wireless/ar6003/include/wmi_thin.h | 371 - drivers/net/wireless/ar6003/include/wmix.h | 280 - drivers/net/wireless/esp8089/Kconfig | 22 - drivers/net/wireless/mt5931/Kconfig | 19 - drivers/net/wireless/mt5931/Makefile | 150 - drivers/net/wireless/mt5931/Makefile.module | 152 - drivers/net/wireless/mt5931/common/dump.c | 539 - drivers/net/wireless/mt5931/common/wlan_bow.c | 3898 ------ drivers/net/wireless/mt5931/common/wlan_lib.c | 5536 -------- drivers/net/wireless/mt5931/common/wlan_oid.c | 10979 ---------------- drivers/net/wireless/mt5931/common/wlan_p2p.c | 1811 --- .../mt5931/firmware_5931/WIFI_RAM_CODE | Bin 139776 -> 0 bytes .../wireless/mt5931/include/CFG_Wifi_File.h | 251 - drivers/net/wireless/mt5931/include/config.h | 1525 --- drivers/net/wireless/mt5931/include/debug.h | 517 - drivers/net/wireless/mt5931/include/link.h | 414 - .../net/wireless/mt5931/include/mgmt/aa_fsm.h | 251 - .../wireless/mt5931/include/mgmt/ais_fsm.h | 680 - .../net/wireless/mt5931/include/mgmt/assoc.h | 147 - .../net/wireless/mt5931/include/mgmt/auth.h | 175 - .../wireless/mt5931/include/mgmt/bow_fsm.h | 190 - .../net/wireless/mt5931/include/mgmt/bss.h | 353 - .../net/wireless/mt5931/include/mgmt/cnm.h | 323 - .../wireless/mt5931/include/mgmt/cnm_mem.h | 1159 -- .../wireless/mt5931/include/mgmt/cnm_scan.h | 206 - .../wireless/mt5931/include/mgmt/cnm_timer.h | 274 - .../wireless/mt5931/include/mgmt/hem_mbox.h | 441 - .../net/wireless/mt5931/include/mgmt/mib.h | 157 - .../wireless/mt5931/include/mgmt/p2p_assoc.h | 64 - .../wireless/mt5931/include/mgmt/p2p_bss.h | 65 - .../wireless/mt5931/include/mgmt/p2p_fsm.h | 2740 ---- .../wireless/mt5931/include/mgmt/p2p_func.h | 324 - .../net/wireless/mt5931/include/mgmt/p2p_ie.h | 23 - .../wireless/mt5931/include/mgmt/p2p_rlm.h | 109 - .../mt5931/include/mgmt/p2p_rlm_obss.h | 93 - .../wireless/mt5931/include/mgmt/p2p_scan.h | 127 - .../wireless/mt5931/include/mgmt/p2p_state.h | 89 - .../wireless/mt5931/include/mgmt/privacy.h | 288 - .../net/wireless/mt5931/include/mgmt/rate.h | 111 - .../net/wireless/mt5931/include/mgmt/rlm.h | 451 - .../wireless/mt5931/include/mgmt/rlm_domain.h | 358 - .../wireless/mt5931/include/mgmt/rlm_obss.h | 164 - .../mt5931/include/mgmt/rlm_protection.h | 126 - .../mt5931/include/mgmt/roaming_fsm.h | 209 - .../net/wireless/mt5931/include/mgmt/rsn.h | 380 - .../net/wireless/mt5931/include/mgmt/scan.h | 847 -- .../wireless/mt5931/include/mgmt/sec_fsm.h | 284 - .../net/wireless/mt5931/include/mgmt/swcr.h | 180 - .../net/wireless/mt5931/include/mgmt/wapi.h | 120 - .../mt5931/include/mgmt/wlan_typedef.h | 84 - .../net/wireless/mt5931/include/mgmt/wnm.h | 100 - .../net/wireless/mt5931/include/nic/adapter.h | 1404 -- drivers/net/wireless/mt5931/include/nic/bow.h | 323 - .../net/wireless/mt5931/include/nic/cmd_buf.h | 176 - drivers/net/wireless/mt5931/include/nic/hal.h | 609 - .../net/wireless/mt5931/include/nic/hif_rx.h | 227 - .../net/wireless/mt5931/include/nic/hif_tx.h | 225 - drivers/net/wireless/mt5931/include/nic/mac.h | 2183 --- .../wireless/mt5931/include/nic/mt5931_reg.h | 336 - .../wireless/mt5931/include/nic/mt6620_reg.h | 286 - drivers/net/wireless/mt5931/include/nic/nic.h | 724 - .../net/wireless/mt5931/include/nic/nic_rx.h | 529 - .../net/wireless/mt5931/include/nic/nic_tx.h | 646 - drivers/net/wireless/mt5931/include/nic/p2p.h | 195 - .../wireless/mt5931/include/nic/p2p_cmd_buf.h | 93 - .../net/wireless/mt5931/include/nic/p2p_mac.h | 223 - .../net/wireless/mt5931/include/nic/p2p_nic.h | 74 - .../mt5931/include/nic/p2p_nic_cmd_event.h | 73 - .../net/wireless/mt5931/include/nic/que_mgt.h | 1150 -- .../wireless/mt5931/include/nic/wlan_def.h | 1012 -- .../wireless/mt5931/include/nic_cmd_event.h | 1888 --- .../mt5931/include/nic_init_cmd_event.h | 180 - .../net/wireless/mt5931/include/p2p_precomp.h | 225 - .../net/wireless/mt5931/include/p2p_typedef.h | 278 - drivers/net/wireless/mt5931/include/precomp.h | 380 - drivers/net/wireless/mt5931/include/pwr_mgt.h | 147 - drivers/net/wireless/mt5931/include/queue.h | 189 - drivers/net/wireless/mt5931/include/rftest.h | 317 - drivers/net/wireless/mt5931/include/typedef.h | 236 - .../net/wireless/mt5931/include/wlan_bow.h | 547 - .../net/wireless/mt5931/include/wlan_lib.h | 1042 -- .../net/wireless/mt5931/include/wlan_oid.h | 2073 --- .../net/wireless/mt5931/include/wlan_p2p.h | 424 - drivers/net/wireless/mt5931/mgmt/aaa_fsm.c | 1490 --- drivers/net/wireless/mt5931/mgmt/ais_fsm.c | 4599 ------- drivers/net/wireless/mt5931/mgmt/assoc.c | 2044 --- drivers/net/wireless/mt5931/mgmt/auth.c | 1350 -- drivers/net/wireless/mt5931/mgmt/bss.c | 2776 ---- drivers/net/wireless/mt5931/mgmt/cnm.c | 775 -- drivers/net/wireless/mt5931/mgmt/cnm_mem.c | 1292 -- drivers/net/wireless/mt5931/mgmt/cnm_timer.c | 531 - drivers/net/wireless/mt5931/mgmt/hem_mbox.c | 827 -- drivers/net/wireless/mt5931/mgmt/mib.c | 102 - drivers/net/wireless/mt5931/mgmt/p2p_assoc.c | 99 - drivers/net/wireless/mt5931/mgmt/p2p_bss.c | 66 - drivers/net/wireless/mt5931/mgmt/p2p_fsm.c | 3379 ----- drivers/net/wireless/mt5931/mgmt/p2p_func.c | 3378 ----- drivers/net/wireless/mt5931/mgmt/p2p_ie.c | 72 - drivers/net/wireless/mt5931/mgmt/p2p_rlm.c | 1014 -- .../net/wireless/mt5931/mgmt/p2p_rlm_obss.c | 374 - drivers/net/wireless/mt5931/mgmt/p2p_scan.c | 831 -- drivers/net/wireless/mt5931/mgmt/p2p_state.c | 575 - drivers/net/wireless/mt5931/mgmt/privacy.c | 1024 -- drivers/net/wireless/mt5931/mgmt/rate.c | 547 - drivers/net/wireless/mt5931/mgmt/rlm.c | 1723 --- drivers/net/wireless/mt5931/mgmt/rlm_domain.c | 681 - drivers/net/wireless/mt5931/mgmt/rlm_obss.c | 461 - .../net/wireless/mt5931/mgmt/rlm_protection.c | 108 - .../net/wireless/mt5931/mgmt/roaming_fsm.c | 583 - drivers/net/wireless/mt5931/mgmt/rsn.c | 2617 ---- drivers/net/wireless/mt5931/mgmt/saa_fsm.c | 2022 --- drivers/net/wireless/mt5931/mgmt/scan.c | 3025 ----- drivers/net/wireless/mt5931/mgmt/scan_fsm.c | 1113 -- drivers/net/wireless/mt5931/mgmt/sec_fsm.c | 1255 -- drivers/net/wireless/mt5931/mgmt/swcr.c | 1268 -- drivers/net/wireless/mt5931/mgmt/wapi.c | 514 - drivers/net/wireless/mt5931/mgmt/wnm.c | 349 - drivers/net/wireless/mt5931/nic/cmd_buf.c | 218 - drivers/net/wireless/mt5931/nic/nic.c | 4421 ------- .../net/wireless/mt5931/nic/nic_cmd_event.c | 1651 --- drivers/net/wireless/mt5931/nic/nic_pwr_mgt.c | 801 -- drivers/net/wireless/mt5931/nic/nic_rx.c | 3529 ----- drivers/net/wireless/mt5931/nic/nic_tx.c | 1981 --- drivers/net/wireless/mt5931/nic/p2p_nic.c | 203 - drivers/net/wireless/mt5931/nic/que_mgt.c | 4802 ------- drivers/net/wireless/mt5931/os/linux/gl_bow.c | 1369 -- .../wireless/mt5931/os/linux/gl_cfg80211.c | 1661 --- .../net/wireless/mt5931/os/linux/gl_init.c | 3399 ----- drivers/net/wireless/mt5931/os/linux/gl_kal.c | 3916 ------ drivers/net/wireless/mt5931/os/linux/gl_p2p.c | 5498 -------- .../mt5931/os/linux/gl_p2p_cfg80211.c | 2226 ---- .../wireless/mt5931/os/linux/gl_p2p_init.c | 518 - .../net/wireless/mt5931/os/linux/gl_p2p_kal.c | 1629 --- .../net/wireless/mt5931/os/linux/gl_proc.c | 811 -- drivers/net/wireless/mt5931/os/linux/gl_rst.c | 473 - .../net/wireless/mt5931/os/linux/gl_wext.c | 4527 ------- .../wireless/mt5931/os/linux/gl_wext_priv.c | 2238 ---- .../wireless/mt5931/os/linux/hif/sdio/arm.c | 33 - .../mt5931/os/linux/hif/sdio/include/hif.h | 225 - .../os/linux/hif/sdio/include/hif_sdio.h | 286 - .../os/linux/hif/sdio/include/mtk_porting.h | 52 - .../wireless/mt5931/os/linux/hif/sdio/sdio.c | 1353 -- .../wireless/mt5931/os/linux/hif/sdio/x86.c | 33 - .../mt5931/os/linux/include/gl_cfg80211.h | 319 - .../wireless/mt5931/os/linux/include/gl_kal.h | 2250 ---- .../wireless/mt5931/os/linux/include/gl_os.h | 1139 -- .../mt5931/os/linux/include/gl_p2p_ioctl.h | 1088 -- .../mt5931/os/linux/include/gl_p2p_kal.h | 395 - .../mt5931/os/linux/include/gl_p2p_os.h | 194 - .../wireless/mt5931/os/linux/include/gl_rst.h | 131 - .../wireless/mt5931/os/linux/include/gl_sec.h | 24 - .../mt5931/os/linux/include/gl_typedef.h | 279 - .../mt5931/os/linux/include/gl_wext.h | 376 - .../mt5931/os/linux/include/gl_wext_priv.h | 396 - .../net/wireless/mt5931/os/linux/platform.c | 620 - drivers/net/wireless/mt5931/os/version.h | 200 - drivers/net/wireless/mt5931/os/wifi_version.h | 13 - drivers/net/wireless/mv8686/11d.c | 698 - drivers/net/wireless/mv8686/11d.h | 104 - drivers/net/wireless/mv8686/ChangeLog.txt | 716 - drivers/net/wireless/mv8686/Makefile | 10 - drivers/net/wireless/mv8686/Makefile.kernel | 10 - drivers/net/wireless/mv8686/Makefile.module | 37 - drivers/net/wireless/mv8686/Makefile.mv8686 | 8 - drivers/net/wireless/mv8686/ReleaseNotes.txt | 8 - drivers/net/wireless/mv8686/assoc.c | 1976 --- drivers/net/wireless/mv8686/assoc.h | 31 - drivers/net/wireless/mv8686/cmd.c | 2158 --- drivers/net/wireless/mv8686/cmd.h | 89 - drivers/net/wireless/mv8686/cmdresp.c | 718 - drivers/net/wireless/mv8686/debugfs.c | 969 -- drivers/net/wireless/mv8686/debugfs.h | 10 - drivers/net/wireless/mv8686/decl.h | 80 - drivers/net/wireless/mv8686/defs.h | 442 - drivers/net/wireless/mv8686/dev.h | 430 - drivers/net/wireless/mv8686/host.h | 303 - drivers/net/wireless/mv8686/hostcmd.h | 775 -- drivers/net/wireless/mv8686/if_sdio.c | 1392 -- drivers/net/wireless/mv8686/if_sdio.h | 64 - drivers/net/wireless/mv8686/iwpriv.h | 18 - drivers/net/wireless/mv8686/lib80211.h | 129 - drivers/net/wireless/mv8686/main.c | 2056 --- drivers/net/wireless/mv8686/mkclean.sh | 10 - drivers/net/wireless/mv8686/mkpkg.sh | 17 - drivers/net/wireless/mv8686/mv8686_cis.c | 188 - drivers/net/wireless/mv8686/radiotap.h | 46 - drivers/net/wireless/mv8686/rx.c | 470 - drivers/net/wireless/mv8686/scan.c | 1458 -- drivers/net/wireless/mv8686/scan.h | 33 - drivers/net/wireless/mv8686/tx.c | 179 - drivers/net/wireless/mv8686/types.h | 284 - drivers/net/wireless/mv8686/wext.c | 2263 ---- drivers/net/wireless/mv8686/wext.h | 10 - drivers/net/wireless/mv8686/wifi_power.h | 1 - drivers/net/wireless/mv8686/wifi_version.h | 1 - drivers/net/wireless/rda5990/Makefile | 5 - .../net/wireless/rda5990/drv_fm_rda/Makefile | 49 - .../rda5990/drv_fm_rda/RDA5990_FM_drv.c | 2142 --- .../rda5990/drv_fm_rda/RDA5990_FM_drv_gpio.c | 1784 --- .../rda5990/rda_5990_power_ctrl/Makefile | 3 - .../rda_5990_power_ctrl/rda_5990_power_ctrl.c | 1897 --- .../rda_5990_power_ctrl_by_gpio.c | 1462 -- .../wireless/rda5990/rda_gpio_i2c/Makefile | 39 - .../rda5990/rda_gpio_i2c/rda_gpio_i2c.c | 460 - .../net/wireless/rda5990/rda_wlan/Makefile | 20 - .../wireless/rda5990/rda_wlan/Makefile_gwl | 23 - .../rda5990/rda_wlan/rda5890_debugfs.c | 593 - .../rda5990/rda_wlan/rda5890_debugfs.h | 13 - .../wireless/rda5990/rda_wlan/rda5890_defs.h | 71 - .../wireless/rda5990/rda_wlan/rda5890_dev.c | 633 - .../wireless/rda5990/rda_wlan/rda5890_dev.h | 272 - .../rda5990/rda_wlan/rda5890_if_sdio.c | 795 -- .../rda5990/rda_wlan/rda5890_if_sdio.h | 49 - .../wireless/rda5990/rda_wlan/rda5890_ioctl.h | 17 - .../wireless/rda5990/rda_wlan/rda5890_nvram.c | 108 - .../wireless/rda5990/rda_wlan/rda5890_scan.c | 369 - .../rda5990/rda_wlan/rda5890_sdio_patch.c | 1406 -- .../wireless/rda5990/rda_wlan/rda5890_txrx.c | 139 - .../wireless/rda5990/rda_wlan/rda5890_txrx.h | 13 - .../wireless/rda5990/rda_wlan/rda5890_wext.c | 2562 ---- .../wireless/rda5990/rda_wlan/rda5890_wext.h | 37 - .../wireless/rda5990/rda_wlan/rda5890_wid.c | 1957 --- .../wireless/rda5990/rda_wlan/rda5890_wid.h | 288 - drivers/net/wireless/rkwifi/Kconfig | 23 - drivers/net/wireless/rkwifi/Makefile | 9 - .../wireless/rkwifi/firmware/nvram_4330.txt | 40 - .../wireless/rkwifi/firmware/nvram_RK901.txt | 52 - .../wireless/rkwifi/firmware/nvram_RK903.cal | 102 - drivers/net/wireless/rkwifi/rk_wifi_config.c | 99 - drivers/net/wireless/wifi_launcher/Makefile | 11 - drivers/net/wireless/wifi_launcher/wlan.c | 64 - .../net/wireless/wifi_launcher/wlan_param.h | 13 - .../wifi_power/vendor/wp_aigo_e1000.c | 76 - .../wireless/wifi_power/vendor/wp_aigo_e700.c | 76 - .../wifi_power/vendor/wp_aigo_nx7007.c | 75 - .../wifi_power/vendor/wp_anjieda_inch10.c | 77 - .../wifi_power/vendor/wp_foxcom_tp2.c | 77 - .../wifi_power/vendor/wp_jinghua_m80.c | 76 - .../wifi_power/vendor/wp_malata_mp0100.c | 78 - .../wireless/wifi_power/vendor/wp_meitu_770.c | 85 - .../wifi_power/vendor/wp_rk2808_child.c | 76 - .../wifi_power/vendor/wp_rk2818sdk_usb.c | 192 - .../wifi_power/vendor/wp_rk28_meizhu_m70.c | 77 - .../wifi_power/vendor/wp_rk29_yifang_a10.c | 188 - .../wifi_power/vendor/wp_tchip_tr802d.c | 77 - .../wifi_power/vendor/wp_tchip_tr806d.c | 77 - .../wifi_power/vendor/wp_yifang_a7_2818.c | 76 - .../wifi_power/vendor/wp_yuxing_mid7001.c | 76 - .../wifi_power/vendor/wp_yuxing_mid704.c | 76 - .../wifi_power/vendor/wp_yuxing_umpc1001.c | 76 - drivers/net/wireless/wifi_power/wifi_config.c | 62 - drivers/net/wireless/wifi_power/wifi_power.c | 92 - drivers/net/wireless/wifi_power/wifi_power.h | 85 - .../net/wireless/wifi_power/wifi_power_ops.c | 230 - .../net/wireless/wifi_power/wifi_power_save.c | 469 - .../net/wireless/wifi_power/wifi_power_usb.c | 118 - .../net/wireless/wifi_power/wifi_version.h | 43 - .../net/wireless/wifi_sys/rkwifi_sys_iface.c | 439 - 600 files changed, 381934 deletions(-) delete mode 100644 drivers/net/wireless/ar6003/Kconfig delete mode 100644 drivers/net/wireless/ar6003/Makefile delete mode 100644 drivers/net/wireless/ar6003/clean.sh delete mode 100644 drivers/net/wireless/ar6003/host/Makefile delete mode 100644 drivers/net/wireless/ar6003/host/bmi/include/bmi_internal.h delete mode 100644 drivers/net/wireless/ar6003/host/bmi/src/bmi.c delete mode 100644 drivers/net/wireless/ar6003/host/bmi/src/makefile delete mode 100644 drivers/net/wireless/ar6003/host/dfs/dfs.c delete mode 100644 drivers/net/wireless/ar6003/host/dfs/dfs_ar.c delete mode 100644 drivers/net/wireless/ar6003/host/dfs/dfs_bindetects.c delete mode 100644 drivers/net/wireless/ar6003/host/dfs/dfs_debug.c delete mode 100644 drivers/net/wireless/ar6003/host/dfs/dfs_fcc_bin5.c delete mode 100644 drivers/net/wireless/ar6003/host/dfs/dfs_host_project.c delete mode 100644 drivers/net/wireless/ar6003/host/dfs/dfs_init.c delete mode 100644 drivers/net/wireless/ar6003/host/dfs/dfs_misc.c delete mode 100644 drivers/net/wireless/ar6003/host/dfs/dfs_process_phyerr.c delete mode 100644 drivers/net/wireless/ar6003/host/dfs/dfs_process_radarevent.c delete mode 100644 drivers/net/wireless/ar6003/host/dfs/dfs_staggered.c delete mode 100644 drivers/net/wireless/ar6003/host/dfs/dfs_target_api.h delete mode 100644 drivers/net/wireless/ar6003/host/dfs/makefile delete mode 100644 drivers/net/wireless/ar6003/host/hif/common/hif_bmi_reg_access.c delete mode 100644 drivers/net/wireless/ar6003/host/hif/common/hif_diag_reg_access.c delete mode 100644 drivers/net/wireless/ar6003/host/hif/common/hif_sdio_common.h delete mode 100644 drivers/net/wireless/ar6003/host/hif/common/makefile delete mode 100644 drivers/net/wireless/ar6003/host/hif/sdio/Makefile delete mode 100644 drivers/net/wireless/ar6003/host/hif/sdio/linux_sdio/include/hif_internal.h delete mode 100644 drivers/net/wireless/ar6003/host/hif/sdio/linux_sdio/src/hif.c delete mode 100644 drivers/net/wireless/ar6003/host/hif/sdio/linux_sdio/src/hif_scatter.c delete mode 100644 drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k.c delete mode 100644 drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k.h delete mode 100644 drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k_events.c delete mode 100644 drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k_gmbox.c delete mode 100644 drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k_gmbox_hciuart.c delete mode 100644 drivers/net/wireless/ar6003/host/htc2/AR6000/makefile delete mode 100644 drivers/net/wireless/ar6003/host/htc2/htc.c delete mode 100644 drivers/net/wireless/ar6003/host/htc2/htc_debug.h delete mode 100644 drivers/net/wireless/ar6003/host/htc2/htc_internal.h delete mode 100644 drivers/net/wireless/ar6003/host/htc2/htc_recv.c delete mode 100644 drivers/net/wireless/ar6003/host/htc2/htc_send.c delete mode 100644 drivers/net/wireless/ar6003/host/htc2/htc_services.c delete mode 100644 drivers/net/wireless/ar6003/host/include/a_config.h delete mode 100644 drivers/net/wireless/ar6003/host/include/a_debug.h delete mode 100644 drivers/net/wireless/ar6003/host/include/a_drv.h delete mode 100644 drivers/net/wireless/ar6003/host/include/a_drv_api.h delete mode 100644 drivers/net/wireless/ar6003/host/include/a_osapi.h delete mode 100644 drivers/net/wireless/ar6003/host/include/a_types.h delete mode 100644 drivers/net/wireless/ar6003/host/include/aggr_recv_api.h delete mode 100644 drivers/net/wireless/ar6003/host/include/ar3kconfig.h delete mode 100644 drivers/net/wireless/ar6003/host/include/ar6000_api.h delete mode 100644 drivers/net/wireless/ar6003/host/include/ar6000_diag.h delete mode 100644 drivers/net/wireless/ar6003/host/include/ar6kap_common.h delete mode 100644 drivers/net/wireless/ar6003/host/include/athbtfilter.h delete mode 100644 drivers/net/wireless/ar6003/host/include/athendpack.h delete mode 100644 drivers/net/wireless/ar6003/host/include/athstartpack.h delete mode 100644 drivers/net/wireless/ar6003/host/include/bmi.h delete mode 100644 drivers/net/wireless/ar6003/host/include/common_drv.h delete mode 100644 drivers/net/wireless/ar6003/host/include/dbglog_api.h delete mode 100644 drivers/net/wireless/ar6003/host/include/dfs_host.h delete mode 100644 drivers/net/wireless/ar6003/host/include/dfs_host_project.h delete mode 100644 drivers/net/wireless/ar6003/host/include/dl_list.h delete mode 100644 drivers/net/wireless/ar6003/host/include/dset_api.h delete mode 100644 drivers/net/wireless/ar6003/host/include/gpio_api.h delete mode 100644 drivers/net/wireless/ar6003/host/include/hci_transport_api.h delete mode 100644 drivers/net/wireless/ar6003/host/include/hif.h delete mode 100644 drivers/net/wireless/ar6003/host/include/host_reg_table.h delete mode 100644 drivers/net/wireless/ar6003/host/include/host_version.h delete mode 100644 drivers/net/wireless/ar6003/host/include/htc_api.h delete mode 100644 drivers/net/wireless/ar6003/host/include/htc_packet.h delete mode 100644 drivers/net/wireless/ar6003/host/include/p2p_api.h delete mode 100644 drivers/net/wireless/ar6003/host/include/project.h delete mode 100644 drivers/net/wireless/ar6003/host/include/target_reg_table.h delete mode 100644 drivers/net/wireless/ar6003/host/include/utils_api.h delete mode 100644 drivers/net/wireless/ar6003/host/include/wlan_api.h delete mode 100644 drivers/net/wireless/ar6003/host/include/wmi_api.h delete mode 100644 drivers/net/wireless/ar6003/host/lib/wac/Makefile delete mode 100644 drivers/net/wireless/ar6003/host/lib/wac/wac.c delete mode 100644 drivers/net/wireless/ar6003/host/lib/wac/wac_lib_api.h delete mode 100644 drivers/net/wireless/ar6003/host/localmake.linux.inc delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000/PS_ASIC.pst delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000/RamPatch.txt delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/PS_ASIC.pst delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/PS_ASIC_aclHighPri.pst delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/PS_ASIC_aclLowPri.pst delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/RamPatch.txt delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101/PS_ASIC.pst delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101/RamPatch.txt delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101/Readme.txt delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/PS_ASIC.pst delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/PS_ASIC_aclHighPri.pst delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/PS_ASIC_aclLowPri.pst delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/RamPatch.txt delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3kconfig.c delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3kps/ar3kpsconfig.c delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3kps/ar3kpsconfig.h delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3kps/ar3kpsparser.c delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/ar3kps/ar3kpsparser.h delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/common_drv.c delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/credit_dist.c delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/makefile delete mode 100644 drivers/net/wireless/ar6003/host/miscdrv/miscdrv.h delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/Makefile delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/ar6000_android.c delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/ar6000_drv.c delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/ar6000_pm.c delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/ar6000_raw_if.c delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/ar6k_mem_debug.c delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/ar6k_pal.c delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/cfg80211.c delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/eeprom.c delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/export_hci_transport.c delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/hci_bridge.c delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/include/ar6000_drv.h delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/include/ar6k_pal.h delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/include/ar6xapi_linux.h delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/include/athdrv_linux.h delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/include/athtypes_linux.h delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/include/cfg80211.h delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/include/config_linux.h delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/include/debug_linux.h delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/include/export_hci_transport.h delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/include/ieee80211_ioctl.h delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/include/osapi_linux.h delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/include/wlan_config.h delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/include/wmi_filter_linux.h delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/ioctl.c delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/netbuf.c delete mode 100644 drivers/net/wireless/ar6003/host/os/linux/wireless_ext.c delete mode 100644 drivers/net/wireless/ar6003/host/p2p/makefile delete mode 100644 drivers/net/wireless/ar6003/host/p2p/p2p_internal.h delete mode 100644 drivers/net/wireless/ar6003/host/p2p/p2p_main.c delete mode 100644 drivers/net/wireless/ar6003/host/regtable/AR6002def.c delete mode 100644 drivers/net/wireless/ar6003/host/regtable/AR6003def.c delete mode 100644 drivers/net/wireless/ar6003/host/regtable/MCKINLEYdef.c delete mode 100644 drivers/net/wireless/ar6003/host/regtable/hostdef.h delete mode 100644 drivers/net/wireless/ar6003/host/regtable/makefile delete mode 100644 drivers/net/wireless/ar6003/host/regtable/regtable.c delete mode 100644 drivers/net/wireless/ar6003/host/regtable/targetdef.h delete mode 100644 drivers/net/wireless/ar6003/host/reorder/aggr_rx_internal.h delete mode 100644 drivers/net/wireless/ar6003/host/reorder/makefile delete mode 100644 drivers/net/wireless/ar6003/host/reorder/rcv_aggr.c delete mode 100644 drivers/net/wireless/ar6003/host/wlan/include/ieee80211.h delete mode 100644 drivers/net/wireless/ar6003/host/wlan/include/ieee80211_node.h delete mode 100644 drivers/net/wireless/ar6003/host/wlan/src/makefile delete mode 100644 drivers/net/wireless/ar6003/host/wlan/src/wlan_node.c delete mode 100644 drivers/net/wireless/ar6003/host/wlan/src/wlan_recv_beacon.c delete mode 100644 drivers/net/wireless/ar6003/host/wlan/src/wlan_utils.c delete mode 100644 drivers/net/wireless/ar6003/host/wmi/makefile delete mode 100644 drivers/net/wireless/ar6003/host/wmi/wmi.c delete mode 100644 drivers/net/wireless/ar6003/host/wmi/wmi_host.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/AR6002_regdump.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/AR6K_version.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/addrs.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsEnv.vr delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsEnvConfig.vr delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsTop.vr delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsTopConfig.vr delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/Makefile.child delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/Makefile.reg delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/addac.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/addac.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/analog_intf_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/analog_intf_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/analog_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/analog_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/apb_map.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/apb_map.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/bias_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/bias_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/gpio_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/gpio_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/mac_pcu.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/mac_pcu.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/mbox_host_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/mbox_host_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/mbox_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/mbox_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/rf2G_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/rf2G_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/rf5G_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/rf5G_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/rtc_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/rtc_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/rxtxbb_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/rxtxbb_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/si_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/si_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/synth_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/synth_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/top_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/top_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/txpc_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/txpc_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/uart_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/uart_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/vmc_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw/vmc_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsEnv.vr delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsEnvConfig.vr delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsTop.vr delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsTopConfig.vr delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/Makefile.child delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/Makefile.reg delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/addac.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/addac.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_intf_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_intf_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/apb_map.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/apb_map.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/bias_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/bias_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/gpio_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/gpio_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mac_pcu.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mac_pcu.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_host_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_host_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf2G_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf2G_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf5G_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf5G_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rtc_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rtc_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rxtxbb_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rxtxbb_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/si_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/si_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/synth_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/synth_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/top_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/top_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/txpc_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/txpc_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/uart_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/uart_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/vmc_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/vmc_reg.vrh delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/analog_intf_ares_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/analog_intf_athr_wlan_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/analog_intf_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/apb_athr_wlan_map.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/apb_map.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/bb_lc_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/efuse_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/gpio_athr_wlan_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/gpio_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mac_dma_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mac_pcu_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_host_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_wlan_host_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_wlan_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/rdma_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/rtc_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/rtc_wlan_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/si_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/uart_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/umbox_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/umbox_wlan_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/vmc_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/vmc_wlan_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/analog_intf_athr_wlan_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/analog_intf_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/apb_athr_wlan_map.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/apb_map.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/athrI2cSlaveApbCsr.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bb_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_gmac_0_rx_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_gmac_0_tx_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_rx_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_tx_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_intr_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_intr_reg_gmac_1_1.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bt_coex_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/chk_sum_seg_acc_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/efuse_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/efuse_wlan_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/fpga_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/gpio_athr_wlan_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/gpio_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mac_dma_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mac_pcu_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/map_rf_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_host_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_i2s_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_wlan_host_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_wlan_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mdio_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mii_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mmac_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/odin_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rdma_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_soc_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_sync_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_wlan_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/si_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/stereo_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/uart_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/umbox_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/umbox_wlan_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/usb_cast_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wlan_coex_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_dcu_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_dma_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_pcu_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_qcu_reg.h delete mode 100644 drivers/net/wireless/ar6003/include/a_hci.h delete mode 100644 drivers/net/wireless/ar6003/include/athdefs.h delete mode 100644 drivers/net/wireless/ar6003/include/bmi_msg.h delete mode 100644 drivers/net/wireless/ar6003/include/btcoexGpio.h delete mode 100644 drivers/net/wireless/ar6003/include/cnxmgmt.h delete mode 100644 drivers/net/wireless/ar6003/include/dbglog.h delete mode 100644 drivers/net/wireless/ar6003/include/dbglog_id.h delete mode 100644 drivers/net/wireless/ar6003/include/dfs_common.h delete mode 100644 drivers/net/wireless/ar6003/include/discovery.h delete mode 100644 drivers/net/wireless/ar6003/include/dset_internal.h delete mode 100644 drivers/net/wireless/ar6003/include/dsetid.h delete mode 100644 drivers/net/wireless/ar6003/include/epping_test.h delete mode 100644 drivers/net/wireless/ar6003/include/gmboxif.h delete mode 100644 drivers/net/wireless/ar6003/include/gpio.h delete mode 100644 drivers/net/wireless/ar6003/include/host_proxy_iface.h delete mode 100644 drivers/net/wireless/ar6003/include/htc.h delete mode 100644 drivers/net/wireless/ar6003/include/htc_services.h delete mode 100644 drivers/net/wireless/ar6003/include/ini_dset.h delete mode 100644 drivers/net/wireless/ar6003/include/iot_flashotp.h delete mode 100644 drivers/net/wireless/ar6003/include/p2p.h delete mode 100644 drivers/net/wireless/ar6003/include/pkt_log.h delete mode 100644 drivers/net/wireless/ar6003/include/queue.h delete mode 100644 drivers/net/wireless/ar6003/include/regdump.h delete mode 100644 drivers/net/wireless/ar6003/include/roaming.h delete mode 100644 drivers/net/wireless/ar6003/include/targaddrs.h delete mode 100644 drivers/net/wireless/ar6003/include/testcmd.h delete mode 100644 drivers/net/wireless/ar6003/include/tlpm.h delete mode 100644 drivers/net/wireless/ar6003/include/wac_defs.h delete mode 100644 drivers/net/wireless/ar6003/include/wlan_defs.h delete mode 100644 drivers/net/wireless/ar6003/include/wlan_dset.h delete mode 100644 drivers/net/wireless/ar6003/include/wmi.h delete mode 100644 drivers/net/wireless/ar6003/include/wmi_thin.h delete mode 100644 drivers/net/wireless/ar6003/include/wmix.h delete mode 100755 drivers/net/wireless/esp8089/Kconfig delete mode 100755 drivers/net/wireless/mt5931/Kconfig delete mode 100755 drivers/net/wireless/mt5931/Makefile delete mode 100755 drivers/net/wireless/mt5931/Makefile.module delete mode 100755 drivers/net/wireless/mt5931/common/dump.c delete mode 100755 drivers/net/wireless/mt5931/common/wlan_bow.c delete mode 100755 drivers/net/wireless/mt5931/common/wlan_lib.c delete mode 100755 drivers/net/wireless/mt5931/common/wlan_oid.c delete mode 100755 drivers/net/wireless/mt5931/common/wlan_p2p.c delete mode 100755 drivers/net/wireless/mt5931/firmware_5931/WIFI_RAM_CODE delete mode 100755 drivers/net/wireless/mt5931/include/CFG_Wifi_File.h delete mode 100755 drivers/net/wireless/mt5931/include/config.h delete mode 100755 drivers/net/wireless/mt5931/include/debug.h delete mode 100755 drivers/net/wireless/mt5931/include/link.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/aa_fsm.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/ais_fsm.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/assoc.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/auth.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/bow_fsm.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/bss.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/cnm.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/cnm_mem.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/cnm_scan.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/cnm_timer.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/hem_mbox.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/mib.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/p2p_assoc.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/p2p_bss.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/p2p_fsm.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/p2p_func.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/p2p_ie.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/p2p_rlm.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/p2p_rlm_obss.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/p2p_scan.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/p2p_state.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/privacy.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/rate.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/rlm.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/rlm_domain.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/rlm_obss.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/rlm_protection.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/roaming_fsm.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/rsn.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/scan.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/sec_fsm.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/swcr.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/wapi.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/wlan_typedef.h delete mode 100755 drivers/net/wireless/mt5931/include/mgmt/wnm.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/adapter.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/bow.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/cmd_buf.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/hal.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/hif_rx.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/hif_tx.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/mac.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/mt5931_reg.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/mt6620_reg.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/nic.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/nic_rx.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/nic_tx.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/p2p.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/p2p_cmd_buf.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/p2p_mac.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/p2p_nic.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/p2p_nic_cmd_event.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/que_mgt.h delete mode 100755 drivers/net/wireless/mt5931/include/nic/wlan_def.h delete mode 100755 drivers/net/wireless/mt5931/include/nic_cmd_event.h delete mode 100755 drivers/net/wireless/mt5931/include/nic_init_cmd_event.h delete mode 100755 drivers/net/wireless/mt5931/include/p2p_precomp.h delete mode 100755 drivers/net/wireless/mt5931/include/p2p_typedef.h delete mode 100755 drivers/net/wireless/mt5931/include/precomp.h delete mode 100755 drivers/net/wireless/mt5931/include/pwr_mgt.h delete mode 100755 drivers/net/wireless/mt5931/include/queue.h delete mode 100755 drivers/net/wireless/mt5931/include/rftest.h delete mode 100755 drivers/net/wireless/mt5931/include/typedef.h delete mode 100755 drivers/net/wireless/mt5931/include/wlan_bow.h delete mode 100755 drivers/net/wireless/mt5931/include/wlan_lib.h delete mode 100755 drivers/net/wireless/mt5931/include/wlan_oid.h delete mode 100755 drivers/net/wireless/mt5931/include/wlan_p2p.h delete mode 100755 drivers/net/wireless/mt5931/mgmt/aaa_fsm.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/ais_fsm.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/assoc.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/auth.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/bss.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/cnm.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/cnm_mem.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/cnm_timer.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/hem_mbox.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/mib.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/p2p_assoc.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/p2p_bss.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/p2p_fsm.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/p2p_func.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/p2p_ie.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/p2p_rlm.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/p2p_rlm_obss.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/p2p_scan.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/p2p_state.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/privacy.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/rate.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/rlm.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/rlm_domain.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/rlm_obss.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/rlm_protection.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/roaming_fsm.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/rsn.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/saa_fsm.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/scan.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/scan_fsm.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/sec_fsm.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/swcr.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/wapi.c delete mode 100755 drivers/net/wireless/mt5931/mgmt/wnm.c delete mode 100755 drivers/net/wireless/mt5931/nic/cmd_buf.c delete mode 100755 drivers/net/wireless/mt5931/nic/nic.c delete mode 100755 drivers/net/wireless/mt5931/nic/nic_cmd_event.c delete mode 100755 drivers/net/wireless/mt5931/nic/nic_pwr_mgt.c delete mode 100755 drivers/net/wireless/mt5931/nic/nic_rx.c delete mode 100755 drivers/net/wireless/mt5931/nic/nic_tx.c delete mode 100755 drivers/net/wireless/mt5931/nic/p2p_nic.c delete mode 100755 drivers/net/wireless/mt5931/nic/que_mgt.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/gl_bow.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/gl_cfg80211.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/gl_init.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/gl_kal.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/gl_p2p.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/gl_p2p_cfg80211.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/gl_p2p_init.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/gl_p2p_kal.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/gl_proc.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/gl_rst.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/gl_wext.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/gl_wext_priv.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/hif/sdio/arm.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/hif/sdio/include/hif.h delete mode 100755 drivers/net/wireless/mt5931/os/linux/hif/sdio/include/hif_sdio.h delete mode 100755 drivers/net/wireless/mt5931/os/linux/hif/sdio/include/mtk_porting.h delete mode 100755 drivers/net/wireless/mt5931/os/linux/hif/sdio/sdio.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/hif/sdio/x86.c delete mode 100755 drivers/net/wireless/mt5931/os/linux/include/gl_cfg80211.h delete mode 100755 drivers/net/wireless/mt5931/os/linux/include/gl_kal.h delete mode 100755 drivers/net/wireless/mt5931/os/linux/include/gl_os.h delete mode 100755 drivers/net/wireless/mt5931/os/linux/include/gl_p2p_ioctl.h delete mode 100755 drivers/net/wireless/mt5931/os/linux/include/gl_p2p_kal.h delete mode 100755 drivers/net/wireless/mt5931/os/linux/include/gl_p2p_os.h delete mode 100755 drivers/net/wireless/mt5931/os/linux/include/gl_rst.h delete mode 100755 drivers/net/wireless/mt5931/os/linux/include/gl_sec.h delete mode 100755 drivers/net/wireless/mt5931/os/linux/include/gl_typedef.h delete mode 100755 drivers/net/wireless/mt5931/os/linux/include/gl_wext.h delete mode 100755 drivers/net/wireless/mt5931/os/linux/include/gl_wext_priv.h delete mode 100755 drivers/net/wireless/mt5931/os/linux/platform.c delete mode 100755 drivers/net/wireless/mt5931/os/version.h delete mode 100755 drivers/net/wireless/mt5931/os/wifi_version.h delete mode 100755 drivers/net/wireless/mv8686/11d.c delete mode 100755 drivers/net/wireless/mv8686/11d.h delete mode 100755 drivers/net/wireless/mv8686/ChangeLog.txt delete mode 100755 drivers/net/wireless/mv8686/Makefile delete mode 100755 drivers/net/wireless/mv8686/Makefile.kernel delete mode 100755 drivers/net/wireless/mv8686/Makefile.module delete mode 100755 drivers/net/wireless/mv8686/Makefile.mv8686 delete mode 100755 drivers/net/wireless/mv8686/ReleaseNotes.txt delete mode 100755 drivers/net/wireless/mv8686/assoc.c delete mode 100755 drivers/net/wireless/mv8686/assoc.h delete mode 100755 drivers/net/wireless/mv8686/cmd.c delete mode 100755 drivers/net/wireless/mv8686/cmd.h delete mode 100755 drivers/net/wireless/mv8686/cmdresp.c delete mode 100755 drivers/net/wireless/mv8686/debugfs.c delete mode 100755 drivers/net/wireless/mv8686/debugfs.h delete mode 100755 drivers/net/wireless/mv8686/decl.h delete mode 100755 drivers/net/wireless/mv8686/defs.h delete mode 100755 drivers/net/wireless/mv8686/dev.h delete mode 100755 drivers/net/wireless/mv8686/host.h delete mode 100755 drivers/net/wireless/mv8686/hostcmd.h delete mode 100755 drivers/net/wireless/mv8686/if_sdio.c delete mode 100755 drivers/net/wireless/mv8686/if_sdio.h delete mode 100755 drivers/net/wireless/mv8686/iwpriv.h delete mode 100755 drivers/net/wireless/mv8686/lib80211.h delete mode 100755 drivers/net/wireless/mv8686/main.c delete mode 100755 drivers/net/wireless/mv8686/mkclean.sh delete mode 100755 drivers/net/wireless/mv8686/mkpkg.sh delete mode 100755 drivers/net/wireless/mv8686/mv8686_cis.c delete mode 100755 drivers/net/wireless/mv8686/radiotap.h delete mode 100755 drivers/net/wireless/mv8686/rx.c delete mode 100755 drivers/net/wireless/mv8686/scan.c delete mode 100755 drivers/net/wireless/mv8686/scan.h delete mode 100755 drivers/net/wireless/mv8686/tx.c delete mode 100755 drivers/net/wireless/mv8686/types.h delete mode 100755 drivers/net/wireless/mv8686/wext.c delete mode 100755 drivers/net/wireless/mv8686/wext.h delete mode 120000 drivers/net/wireless/mv8686/wifi_power.h delete mode 120000 drivers/net/wireless/mv8686/wifi_version.h delete mode 100755 drivers/net/wireless/rda5990/Makefile delete mode 100755 drivers/net/wireless/rda5990/drv_fm_rda/Makefile delete mode 100755 drivers/net/wireless/rda5990/drv_fm_rda/RDA5990_FM_drv.c delete mode 100755 drivers/net/wireless/rda5990/drv_fm_rda/RDA5990_FM_drv_gpio.c delete mode 100755 drivers/net/wireless/rda5990/rda_5990_power_ctrl/Makefile delete mode 100755 drivers/net/wireless/rda5990/rda_5990_power_ctrl/rda_5990_power_ctrl.c delete mode 100755 drivers/net/wireless/rda5990/rda_5990_power_ctrl/rda_5990_power_ctrl_by_gpio.c delete mode 100755 drivers/net/wireless/rda5990/rda_gpio_i2c/Makefile delete mode 100755 drivers/net/wireless/rda5990/rda_gpio_i2c/rda_gpio_i2c.c delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/Makefile delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/Makefile_gwl delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_debugfs.c delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_debugfs.h delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_defs.h delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_dev.c delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_dev.h delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_if_sdio.c delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_if_sdio.h delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_ioctl.h delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_nvram.c delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_scan.c delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_sdio_patch.c delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_txrx.c delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_txrx.h delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_wext.c delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_wext.h delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_wid.c delete mode 100755 drivers/net/wireless/rda5990/rda_wlan/rda5890_wid.h delete mode 100644 drivers/net/wireless/rkwifi/Kconfig delete mode 100644 drivers/net/wireless/rkwifi/Makefile delete mode 100644 drivers/net/wireless/rkwifi/firmware/nvram_4330.txt delete mode 100644 drivers/net/wireless/rkwifi/firmware/nvram_RK901.txt delete mode 100644 drivers/net/wireless/rkwifi/firmware/nvram_RK903.cal delete mode 100644 drivers/net/wireless/rkwifi/rk_wifi_config.c delete mode 100644 drivers/net/wireless/wifi_launcher/Makefile delete mode 100644 drivers/net/wireless/wifi_launcher/wlan.c delete mode 100755 drivers/net/wireless/wifi_launcher/wlan_param.h delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_aigo_e1000.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_aigo_e700.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_aigo_nx7007.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_anjieda_inch10.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_foxcom_tp2.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_jinghua_m80.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_malata_mp0100.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_meitu_770.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_rk2808_child.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_rk2818sdk_usb.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_rk28_meizhu_m70.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_rk29_yifang_a10.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_tchip_tr802d.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_tchip_tr806d.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_yifang_a7_2818.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_yuxing_mid7001.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_yuxing_mid704.c delete mode 100755 drivers/net/wireless/wifi_power/vendor/wp_yuxing_umpc1001.c delete mode 100644 drivers/net/wireless/wifi_power/wifi_config.c delete mode 100755 drivers/net/wireless/wifi_power/wifi_power.c delete mode 100755 drivers/net/wireless/wifi_power/wifi_power.h delete mode 100755 drivers/net/wireless/wifi_power/wifi_power_ops.c delete mode 100755 drivers/net/wireless/wifi_power/wifi_power_save.c delete mode 100755 drivers/net/wireless/wifi_power/wifi_power_usb.c delete mode 100644 drivers/net/wireless/wifi_power/wifi_version.h delete mode 100755 drivers/net/wireless/wifi_sys/rkwifi_sys_iface.c diff --git a/drivers/net/wireless/ar6003/Kconfig b/drivers/net/wireless/ar6003/Kconfig deleted file mode 100644 index 09841df4af7f..000000000000 --- a/drivers/net/wireless/ar6003/Kconfig +++ /dev/null @@ -1,9 +0,0 @@ - config AR6003 - depends on WLAN_80211 && MMC - select WIRELESS_EXT - select IEEE80211 - select FW_LOADER - bool "Atheros AR6003/AR6302 SDIO" - ---help--- - Atheros ROC AR6003/AR6302. - diff --git a/drivers/net/wireless/ar6003/Makefile b/drivers/net/wireless/ar6003/Makefile deleted file mode 100644 index 380ec1259a06..000000000000 --- a/drivers/net/wireless/ar6003/Makefile +++ /dev/null @@ -1,77 +0,0 @@ -AR6003_SRC_PATH := drivers/net/wireless/ar6003 - -EXTRA_CFLAGS += -I${AR6003_SRC_PATH}/host/include -EXTRA_CFLAGS += -I${AR6003_SRC_PATH}/include -EXTRA_CFLAGS += -I${AR6003_SRC_PATH}/host/wlan/include -EXTRA_CFLAGS += -I${AR6003_SRC_PATH}/host/os/linux/include -EXTRA_CFLAGS += -I${AR6003_SRC_PATH}/host/os/ -EXTRA_CFLAGS += -I${AR6003_SRC_PATH}/host/bmi/include -EXTRA_CFLAGS += -I${AR6003_SRC_PATH}/include/AR6002 -EXTRA_CFLAGS += -I${AR6003_SRC_PATH}/host/hif/sdio/linux_sdio/include -EXTRA_CFLAGS += -Idrivers/net/wireless - -EXTRA_CFLAGS += -DLINUX -D__KERNEL__ -DTCMD -DSEND_EVENT_TO_APP -DUSER_KEYS -DNO_SYNC_FLUSH -DHTC_EP_STAT_PROFILING -DWLAN_HEADERS -DATH_AR6K_11N_SUPPORT -DATH_SUPPORT_DFS -DANDROID_ENV -D__linux__ -DINIT_MODE_DRV_ENABLED -DBMIENABLE_SET -DAR600x_SD31_XXX -DATH6KL_SKIP_ABI_VERSION_CHECK -DATH6KL_CONFIG_HIF_VIRTUAL_SCATTER -DCONFIG_HOST_TCMD_SUPPORT -DCONFIG_AP_VIRTUAL_ADAPTER_SUPPORT -DSOFTMAC_FILE_USED -DDEBUG -DATH_DEBUG_MODULE -DAR6002_HEADERS_DEF -DAR6003_HEADERS_DEF -DMCKINLEY_HEADERS_DEF -DKERNEL_2_6 - -ifeq ($(CONFIG_BT),y) -EXTRA_CFLAGS += -DATH_AR6K_ENABLE_GMBOX -EXTRA_CFLAGS += -DHCI_TRANSPORT_SDIO -EXTRA_CFLAGS += -DSETUPHCI_ENABLED -EXTRA_CFLAGS += -DSETUPBTDEV_ENABLED -endif - -EXTRA_CFLAGS += -DRK29 -EXTRA_CFLAGS += -DTCHIP - -olca3-objs := host/hif/sdio/linux_sdio/src/hif.o \ - host/hif/sdio/linux_sdio/src/hif_scatter.o \ - host/hif/common/hif_bmi_reg_access.o \ - host/hif/common/hif_diag_reg_access.o \ - host/wmi/wmi.o \ - host/reorder/rcv_aggr.o \ - host/htc2/AR6000/ar6k.o \ - host/htc2/AR6000/ar6k_events.o \ - host/htc2/htc_services.o \ - host/htc2/htc.o \ - host/htc2/htc_send.o \ - host/htc2/htc_recv.o \ - host/wlan/src/wlan_recv_beacon.o \ - host/wlan/src/wlan_utils.o \ - host/wlan/src/wlan_node.o \ - host/bmi/src/bmi.o \ - host/miscdrv/credit_dist.o \ - host/miscdrv/common_drv.o \ - host/os/linux/hci_bridge.o \ - host/os/linux/netbuf.o \ - host/os/linux/ar6000_android.o \ - host/os/linux/ioctl.o \ - host/os/linux/wireless_ext.o \ - host/os/linux/ar6000_pm.o \ - host/os/linux/ar6000_raw_if.o \ - host/os/linux/ar6000_drv.o \ - host/os/linux/ar6k_pal.o \ - host/regtable/regtable.o \ - host/regtable/AR6002def.o \ - host/regtable/MCKINLEYdef.o \ - host/regtable/AR6003def.o \ - host/dfs/dfs_debug.o \ - host/dfs/dfs_process_phyerr.o \ - host/dfs/dfs.o \ - host/dfs/dfs_misc.o \ - host/dfs/dfs_bindetects.o \ - host/dfs/dfs_init.o \ - host/dfs/dfs_host_project.o \ - host/dfs/dfs_staggered.o \ - host/dfs/dfs_ar.o \ - host/dfs/dfs_process_radarevent.o \ - host/dfs/dfs_fcc_bin5.o - -ifeq ($(CONFIG_BT),y) -olca3-objs += host/htc2/AR6000/ar6k_gmbox.o \ - host/htc2/AR6000/ar6k_gmbox_hciuart.o \ - host/miscdrv/ar3kconfig.o \ - host/miscdrv/ar3kps/ar3kpsconfig.o \ - host/miscdrv/ar3kps/ar3kpsparser.o -endif - -obj-$(CONFIG_AR6003) += olca3.o - diff --git a/drivers/net/wireless/ar6003/clean.sh b/drivers/net/wireless/ar6003/clean.sh deleted file mode 100644 index be346d1ea5f9..000000000000 --- a/drivers/net/wireless/ar6003/clean.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -find . \( -not -path "*.output*" -a -name '*.[oas]' -o -name core -o -name '.*.flags' -o -name '.ko' -o -name '.*.cmd' -o -name 'Module.symvers' -o -name 'modules.order' \) -type f -print \ - | grep -v lxdialog/ | xargs rm -f -find . \( -name '.tmp_versions' \) -type d -print | grep -v lxdialog/ | xargs rm -rf - diff --git a/drivers/net/wireless/ar6003/host/Makefile b/drivers/net/wireless/ar6003/host/Makefile deleted file mode 100644 index ee62e661ab19..000000000000 --- a/drivers/net/wireless/ar6003/host/Makefile +++ /dev/null @@ -1,174 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2005-2010 Atheros Corporation. All rights reserved. -# -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# -#------------------------------------------------------------------------------ -#============================================================================== -# Author(s): ="Atheros" -#============================================================================== -# AR6K Host driver makefile -# -# Minimal build invocation: -# -# make (all | clean | clobber) -# -# Extended Make invocation: -# -# make ATH_BUILD_TYPE= ATH_SDIO_STACK_BASE= (all | clean | clobber) -# -# Notes: -# 1. This makefile must be invoked from the host/ directory -# 2. The must match an entry in localmake.linux.inc. -# 3. The localmake.linux.inc can be overridden using an include file outside the build tree. -# This file (name and path) can be set via the ATH_MAKE_INCLUDE_OVERRIDE variable. -# ** If ATH_MAKE_INCLUDE_OVERRIDE is used, you can define all build variables in that file -# instead of using command line arguments **. This feature is provided for developers -# that may want to customize the build using a single include file. -# -# For example : -# -# " make ATH_MAKE_INCLUDE_OVERRIDE=$HOME/mymake.inc " -# -# could be used, as long as "mymake.inc" defines all the required variables (see below) -# -# Required Variables: -# -# ATH_OS_SUB_TYPE - on linux, this must be "linux_2_4" for 2.4 kernels or left blank for 2.6 kernels. -# ATH_LINUXPATH - linux kernel source path -# ATH_CROSS_COMPILE_TYPE - optional cross compiler path , leave blank for local gcc compilation -# ATH_ARCH_CPU_TYPE - CPU architecture type, leave blank for local gcc compilation -# ATH_SDIO_STACK_BASE - SDIO Stack installation path to compile the SDIO HIF layer against an externally supplied -# SDIO stack source. -# -# Override variables: -# -# ATH_MAKE_INCLUDE_OVERRIDE - full path to include file which overrides the default (localmake.linux.inc) -# this file can contain other overrides specific to a developers -# workspace environment. -# ATH_BUILD_OUTPUT_OVERRIDE - output path override for compiled executable and -# database image -# - -# Include local variables -ifdef ATH_MAKE_INCLUDE_OVERRIDE -_LOCALMAKE_INCLUDE = $(ATH_MAKE_INCLUDE_OVERRIDE) -else -_LOCALMAKE_INCLUDE = localmake.linux.inc -endif - --include $(_LOCALMAKE_INCLUDE) - -export ATH_SRC_BASE -export ATH_BUILD_TYPE -export ATH_OS_SUB_TYPE -export ATH_LINUXPATH -export ATH_CROSS_COMPILE_TYPE -export ATH_ARCH_CPU_TYPE -export ATH_SDIO_STACK_BASE -export ATH_BUS_TYPE -export ATH_BUS_SUBTYPE -export ATH_HC_DRIVERS -export ATH_HTC_RAW_INT_ENV -export ATH_ANDROID_ENV -export ATH_SOFTMAC_FILE_USED -export ATH_CFG80211_ENV -export ATH_DEBUG_DRIVER -export ATH_AR6K_HCI_PAL -export ATH_AR6K_DEBUG_ALLOC -#export ATH_BUILD_P2P - -ATH_SRC_BASE :=$(shell pwd) -MAKE :=make -CC :=$(ATH_CROSS_COMPILE_TYPE)gcc -LD :=$(ATH_CROSS_COMPILE_TYPE)ld -STRIP :=$(ATH_CROSS_COMPILE_TYPE)strip -ATH_HIF_TYPE :=`echo $(ATH_BUS_TYPE) | tr [:upper:] [:lower:]` - -export STRIP - -#export compiler variables for 3rd party applications (like the WPA supplicant) -export CC -export LD -export STRIP - -# Set cross compile type (if any) -ifdef ATH_CROSS_COMPILE_TYPE -_CROSS_COMPILE_LINE := ARCH=$(ATH_ARCH_CPU_TYPE) CROSS_COMPILE=$(ATH_CROSS_COMPILE_TYPE) -endif - -# Figure out module extension -ifneq ($(ATH_OS_SUB_TYPE),linux_2_4) -KMOD_EXTENSION :=ko -endif -ifeq ($(ATH_OS_SUB_TYPE),linux_2_4) -KMOD_EXTENSION :=o -endif - -# Set up object output areas -ifdef ATH_BUILD_OUTPUT_OVERRIDE -_COMPILED_OBJECTS_PATH :=$(ATH_BUILD_OUTPUT_OVERRIDE) -COMPILED_BIN_OBJECTS_PATH :=$(ATH_BUILD_OUTPUT_OVERRIDE) -COMPILED_IMAGE_OBJECTS_PATH :=$(ATH_BUILD_OUTPUT_OVERRIDE) -_MAKE_IMAGE_OUTPUT_DIR := -_MAKE_BIN_OUTPUT_DIR := -_CLEAN_IMAGE_OUTPUT_DIR := -_CLEAN_BIN_OUTPUT_DIR := -else -_COMPILED_OBJECTS_PATH := $(ATH_SRC_BASE)/.output/$(ATH_BUILD_TYPE)-$(ATH_BUS_TYPE) -COMPILED_BIN_OBJECTS_PATH := $(ATH_SRC_BASE)/.output/bin -COMPILED_IMAGE_OBJECTS_PATH :=$(_COMPILED_OBJECTS_PATH)/$(COMPILED_OBJECTS_PREFIX)image -_MAKE_IMAGE_OUTPUT_DIR := mkdir --parents $(COMPILED_IMAGE_OBJECTS_PATH) -_MAKE_BIN_OUTPUT_DIR := mkdir --parents $(COMPILED_BIN_OBJECTS_PATH) -_CLEAN_IMAGE_OUTPUT_DIR := rm -R -f $(COMPILED_IMAGE_OBJECTS_PATH) -_CLEAN_BIN_OUTPUT_DIR := rm -R -f $(COMPILED_BIN_OBJECTS_PATH) -endif - -# Export the required variables to other Makefiles in the system -export COMPILED_IMAGE_OBJECTS_PATH -export COMPILED_BIN_OBJECTS_PATH - -all: modules - -modules: -ifndef ATH_BUILD_TYPE - @echo "Please edit the $(_LOCALMAKE_INCLUDE) file" - exit 1 -endif - $(_MAKE_IMAGE_OUTPUT_DIR) - $(_MAKE_BIN_OUTPUT_DIR) - $(MAKE) $(_CROSS_COMPILE_LINE) -C $(ATH_LINUXPATH) ATH_HIF_TYPE=$(ATH_HIF_TYPE) SUBDIRS=$(ATH_SRC_BASE)/os/linux modules - $(MAKE) -C hif/$(ATH_HIF_TYPE) -# $(MAKE) -C tools/wmiconfig/ -# $(MAKE) -C tools/recEvent/ - cp -f $(ATH_SRC_BASE)/os/linux/ar6000.$(KMOD_EXTENSION) $(COMPILED_IMAGE_OBJECTS_PATH) - $(STRIP) -g -S -d $(COMPILED_IMAGE_OBJECTS_PATH)/ar6000.$(KMOD_EXTENSION) -# cp -f tools/wmiconfig/wmiconfig $(COMPILED_IMAGE_OBJECTS_PATH) -# cp -f tools/recEvent/recEvent $(COMPILED_IMAGE_OBJECTS_PATH) -# cp -f tools/recEvent/restore.sh $(COMPILED_IMAGE_OBJECTS_PATH) - -clean: - rm -f os/linux/ar6000.mod.c os/linux/*.o os/linux/*.ko wmi/*.o htc/AR6000/src/*.o htc/*.o \ - bmi/src/*.o wlan/src/*.o driver/* tools/wmiconfig/wmiconfig \ - tools/recEvent/recEvent - -# The kernel module build process leaves some intermediate files, this will clean up all these files - find $(ATH_SRC_BASE) \( -not -path "*.output*" -a -name '*.[oas]' -o -name core -o -name '.*.flags' -o -name '.ko' -o -name '.*.cmd' \) -type f -print \ - | grep -v lxdialog/ | xargs rm -f - $(MAKE) -C hif/$(ATH_HIF_TYPE) clean - -clobber:clean - rm -rf .output diff --git a/drivers/net/wireless/ar6003/host/bmi/include/bmi_internal.h b/drivers/net/wireless/ar6003/host/bmi/include/bmi_internal.h deleted file mode 100644 index bb155909e65b..000000000000 --- a/drivers/net/wireless/ar6003/host/bmi/include/bmi_internal.h +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2008 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef BMI_INTERNAL_H -#define BMI_INTERNAL_H - -#include "a_config.h" -#include "athdefs.h" -#include "a_types.h" -#include "a_osapi.h" -#define ATH_MODULE_NAME bmi -#include "a_debug.h" -#include "bmi_msg.h" - -#define ATH_DEBUG_BMI ATH_DEBUG_MAKE_MODULE_MASK(0) - -/* ------ Global Variable Declarations ------- */ -A_BOOL bmiDone; - -#endif diff --git a/drivers/net/wireless/ar6003/host/bmi/src/bmi.c b/drivers/net/wireless/ar6003/host/bmi/src/bmi.c deleted file mode 100644 index 59a8b92a9a44..000000000000 --- a/drivers/net/wireless/ar6003/host/bmi/src/bmi.c +++ /dev/null @@ -1,774 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// -// Author(s): ="Atheros" -//============================================================================== - - -#include "hif.h" -#include "bmi.h" -#include "bmi_internal.h" - -#ifdef DEBUG -static ATH_DEBUG_MASK_DESCRIPTION bmi_debug_desc[] = { - { ATH_DEBUG_BMI , "BMI Tracing"}, -}; - -ATH_DEBUG_INSTANTIATE_MODULE_VAR(bmi, - "bmi", - "Boot Manager Interface", - ATH_DEBUG_MASK_DEFAULTS, - ATH_DEBUG_DESCRIPTION_COUNT(bmi_debug_desc), - bmi_debug_desc); - -#endif - -/* -Although we had envisioned BMI to run on top of HTC, this is not how the -final implementation ended up. On the Target side, BMI is a part of the BSP -and does not use the HTC protocol nor even DMA -- it is intentionally kept -very simple. -*/ - -static A_UCHAR *pBMICmdBuf; -#define MAX_BMI_CMDBUF_SZ (BMI_DATASZ_MAX + \ - sizeof(A_UINT32) /* cmd */ + \ - sizeof(A_UINT32) /* addr */ + \ - sizeof(A_UINT32))/* length */ -#define BMI_COMMAND_FITS(sz) ((sz) <= MAX_BMI_CMDBUF_SZ) -#define BMI_EXCHANGE_TIMEOUT_MS 1000 - -/* APIs visible to the driver */ -void -BMIInit(void) -{ - bmiDone = FALSE; - - - /* - * On some platforms, it's not possible to DMA to a static variable - * in a device driver (e.g. Linux loadable driver module). - * So we need to A_MALLOC space for "command credits" and for commands. - * - * Note: implicitly relies on A_MALLOC to provide a buffer that is - * suitable for DMA (or PIO). This buffer will be passed down the - * bus stack. - */ - - if (!pBMICmdBuf) { - pBMICmdBuf = (A_UCHAR *)A_MALLOC_NOWAIT(MAX_BMI_CMDBUF_SZ); - A_ASSERT(pBMICmdBuf); - } - - A_REGISTER_MODULE_DEBUG_INFO(bmi); -} - -void -BMICleanup(void) -{ -#if 0 - if (pBMICmdCredits) { - A_FREE(pBMICmdCredits); - pBMICmdCredits = NULL; - } -#endif - - if (pBMICmdBuf) { - A_FREE(pBMICmdBuf); - pBMICmdBuf = NULL; - } -} - -A_STATUS -BMIDone(HIF_DEVICE *device) -{ - A_STATUS status; - A_UINT32 cid; - - if (bmiDone) { - AR_DEBUG_PRINTF (ATH_DEBUG_BMI, ("BMIDone skipped\n")); - return A_OK; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Done: Enter (device: 0x%p)\n", device)); - bmiDone = TRUE; - cid = BMI_DONE; - A_MEMCPY(pBMICmdBuf,&cid,sizeof(cid)); - - status = HIFExchangeBMIMsg(device, pBMICmdBuf, sizeof(cid), NULL, NULL, 0); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); - return A_ERROR; - } - - if (pBMICmdBuf) { - A_FREE(pBMICmdBuf); - pBMICmdBuf = NULL; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Done: Exit\n")); - - return A_OK; -} - -#ifndef HIF_MESSAGE_BASED -extern A_STATUS HIFRegBasedGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info); -#endif - -A_STATUS -BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info) -{ - if (bmiDone) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI Get Target Info Command disallowed\n")); - return A_ERROR; - } - -#ifndef HIF_MESSAGE_BASED - /* getting the target ID requires special handling because of the variable length - * message */ - return HIFRegBasedGetTargetInfo(device,targ_info); -#else - /* TODO */ - return A_ERROR; -#endif -} - -A_STATUS -BMIReadMemory(HIF_DEVICE *device, - A_UINT32 address, - A_UCHAR *buffer, - A_UINT32 length) -{ - A_UINT32 cid; - A_STATUS status; - A_UINT32 offset; - A_UINT32 remaining, rxlen; - - A_ASSERT(BMI_COMMAND_FITS(BMI_DATASZ_MAX + sizeof(cid) + sizeof(address) + sizeof(length))); - memset (pBMICmdBuf, 0, BMI_DATASZ_MAX + sizeof(cid) + sizeof(address) + sizeof(length)); - - if (bmiDone) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, - ("BMI Read Memory: Enter (device: 0x%p, address: 0x%x, length: %d)\n", - device, address, length)); - - cid = BMI_READ_MEMORY; - - remaining = length; - - while (remaining) - { - rxlen = (remaining < BMI_DATASZ_MAX) ? remaining : BMI_DATASZ_MAX; - offset = 0; - A_MEMCPY(&(pBMICmdBuf[offset]), &cid, sizeof(cid)); - offset += sizeof(cid); - A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address)); - offset += sizeof(address); - A_MEMCPY(&(pBMICmdBuf[offset]), &rxlen, sizeof(rxlen)); - offset += sizeof(length); - - status = HIFExchangeBMIMsg(device, - pBMICmdBuf, - offset, - pBMICmdBuf, /* note we reuse the same buffer to receive on */ - &rxlen, - BMI_EXCHANGE_TIMEOUT_MS); - - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n")); - return A_ERROR; - } - A_MEMCPY(&buffer[length - remaining], pBMICmdBuf, rxlen); - remaining -= rxlen; address += rxlen; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Read Memory: Exit\n")); - return A_OK; -} - -A_STATUS -BMIWriteMemory(HIF_DEVICE *device, - A_UINT32 address, - A_UCHAR *buffer, - A_UINT32 length) -{ - A_UINT32 cid; - A_STATUS status; - A_UINT32 offset; - A_UINT32 remaining, txlen; - const A_UINT32 header = sizeof(cid) + sizeof(address) + sizeof(length); - A_UCHAR alignedBuffer[BMI_DATASZ_MAX]; - A_UCHAR *src; - - A_ASSERT(BMI_COMMAND_FITS(BMI_DATASZ_MAX + header)); - memset (pBMICmdBuf, 0, BMI_DATASZ_MAX + header); - - if (bmiDone) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, - ("BMI Write Memory: Enter (device: 0x%p, address: 0x%x, length: %d)\n", - device, address, length)); - - cid = BMI_WRITE_MEMORY; - - remaining = length; - while (remaining) - { - src = &buffer[length - remaining]; - if (remaining < (BMI_DATASZ_MAX - header)) { - if (remaining & 3) { - /* align it with 4 bytes */ - remaining = remaining + (4 - (remaining & 3)); - memcpy(alignedBuffer, src, remaining); - src = alignedBuffer; - } - txlen = remaining; - } else { - txlen = (BMI_DATASZ_MAX - header); - } - offset = 0; - A_MEMCPY(&(pBMICmdBuf[offset]), &cid, sizeof(cid)); - offset += sizeof(cid); - A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address)); - offset += sizeof(address); - A_MEMCPY(&(pBMICmdBuf[offset]), &txlen, sizeof(txlen)); - offset += sizeof(txlen); - A_MEMCPY(&(pBMICmdBuf[offset]), src, txlen); - offset += txlen; - status = HIFExchangeBMIMsg(device, pBMICmdBuf, offset, NULL, NULL, BMI_EXCHANGE_TIMEOUT_MS); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); - return A_ERROR; - } - remaining -= txlen; address += txlen; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Write Memory: Exit\n")); - - return A_OK; -} - -A_STATUS -BMIExecute(HIF_DEVICE *device, - A_UINT32 address, - A_UINT32 *param) -{ - A_UINT32 cid; - A_STATUS status; - A_UINT32 offset; - A_UINT32 paramLen; - - A_ASSERT(BMI_COMMAND_FITS(sizeof(cid) + sizeof(address) + sizeof(param))); - memset (pBMICmdBuf, 0, sizeof(cid) + sizeof(address) + sizeof(param)); - - if (bmiDone) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, - ("BMI Execute: Enter (device: 0x%p, address: 0x%x, param: %d)\n", - device, address, *param)); - - cid = BMI_EXECUTE; - - offset = 0; - A_MEMCPY(&(pBMICmdBuf[offset]), &cid, sizeof(cid)); - offset += sizeof(cid); - A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address)); - offset += sizeof(address); - A_MEMCPY(&(pBMICmdBuf[offset]), param, sizeof(*param)); - offset += sizeof(*param); - paramLen = sizeof(*param); - status = HIFExchangeBMIMsg(device, pBMICmdBuf, offset, pBMICmdBuf, ¶mLen, 0); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n")); - return A_ERROR; - } - - A_MEMCPY(param, pBMICmdBuf, sizeof(*param)); - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Execute: Exit (param: %d)\n", *param)); - return A_OK; -} - -A_STATUS -BMISetAppStart(HIF_DEVICE *device, - A_UINT32 address) -{ - A_UINT32 cid; - A_STATUS status; - A_UINT32 offset; - - A_ASSERT(BMI_COMMAND_FITS(sizeof(cid) + sizeof(address))); - memset (pBMICmdBuf, 0, sizeof(cid) + sizeof(address)); - - if (bmiDone) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, - ("BMI Set App Start: Enter (device: 0x%p, address: 0x%x)\n", - device, address)); - - cid = BMI_SET_APP_START; - - offset = 0; - A_MEMCPY(&(pBMICmdBuf[offset]), &cid, sizeof(cid)); - offset += sizeof(cid); - A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address)); - offset += sizeof(address); - - status = HIFExchangeBMIMsg(device, pBMICmdBuf, offset, NULL, NULL, 0); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Set App Start: Exit\n")); - return A_OK; -} - -A_STATUS -BMIReadSOCRegister(HIF_DEVICE *device, - A_UINT32 address, - A_UINT32 *param) -{ - A_UINT32 cid; - A_STATUS status; - A_UINT32 offset,paramLen; - - A_ASSERT(BMI_COMMAND_FITS(sizeof(cid) + sizeof(address))); - memset (pBMICmdBuf, 0, sizeof(cid) + sizeof(address)); - - if (bmiDone) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, - ("BMI Read SOC Register: Enter (device: 0x%p, address: 0x%x)\n", - device, address)); - - cid = BMI_READ_SOC_REGISTER; - - offset = 0; - A_MEMCPY(&(pBMICmdBuf[offset]), &cid, sizeof(cid)); - offset += sizeof(cid); - A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address)); - offset += sizeof(address); - paramLen = sizeof(*param); - status = HIFExchangeBMIMsg(device, pBMICmdBuf, offset, pBMICmdBuf, ¶mLen, BMI_EXCHANGE_TIMEOUT_MS); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n")); - return A_ERROR; - } - A_MEMCPY(param, pBMICmdBuf, sizeof(*param)); - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Read SOC Register: Exit (value: %d)\n", *param)); - return A_OK; -} - -A_STATUS -BMIWriteSOCRegister(HIF_DEVICE *device, - A_UINT32 address, - A_UINT32 param) -{ - A_UINT32 cid; - A_STATUS status; - A_UINT32 offset; - - A_ASSERT(BMI_COMMAND_FITS(sizeof(cid) + sizeof(address) + sizeof(param))); - memset (pBMICmdBuf, 0, sizeof(cid) + sizeof(address) + sizeof(param)); - - if (bmiDone) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, - ("BMI Write SOC Register: Enter (device: 0x%p, address: 0x%x, param: %d)\n", - device, address, param)); - - cid = BMI_WRITE_SOC_REGISTER; - - offset = 0; - A_MEMCPY(&(pBMICmdBuf[offset]), &cid, sizeof(cid)); - offset += sizeof(cid); - A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address)); - offset += sizeof(address); - A_MEMCPY(&(pBMICmdBuf[offset]), ¶m, sizeof(param)); - offset += sizeof(param); - status = HIFExchangeBMIMsg(device, pBMICmdBuf, offset, NULL, NULL, 0); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Read SOC Register: Exit\n")); - return A_OK; -} - -A_STATUS -BMIrompatchInstall(HIF_DEVICE *device, - A_UINT32 ROM_addr, - A_UINT32 RAM_addr, - A_UINT32 nbytes, - A_UINT32 do_activate, - A_UINT32 *rompatch_id) -{ - A_UINT32 cid; - A_STATUS status; - A_UINT32 offset,responseLen; - - A_ASSERT(BMI_COMMAND_FITS(sizeof(cid) + sizeof(ROM_addr) + sizeof(RAM_addr) + - sizeof(nbytes) + sizeof(do_activate))); - memset(pBMICmdBuf, 0, sizeof(cid) + sizeof(ROM_addr) + sizeof(RAM_addr) + - sizeof(nbytes) + sizeof(do_activate)); - - if (bmiDone) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, - ("BMI rompatch Install: Enter (device: 0x%p, ROMaddr: 0x%x, RAMaddr: 0x%x length: %d activate: %d)\n", - device, ROM_addr, RAM_addr, nbytes, do_activate)); - - cid = BMI_ROMPATCH_INSTALL; - - offset = 0; - A_MEMCPY(&(pBMICmdBuf[offset]), &cid, sizeof(cid)); - offset += sizeof(cid); - A_MEMCPY(&(pBMICmdBuf[offset]), &ROM_addr, sizeof(ROM_addr)); - offset += sizeof(ROM_addr); - A_MEMCPY(&(pBMICmdBuf[offset]), &RAM_addr, sizeof(RAM_addr)); - offset += sizeof(RAM_addr); - A_MEMCPY(&(pBMICmdBuf[offset]), &nbytes, sizeof(nbytes)); - offset += sizeof(nbytes); - A_MEMCPY(&(pBMICmdBuf[offset]), &do_activate, sizeof(do_activate)); - offset += sizeof(do_activate); - responseLen = sizeof(*rompatch_id); - status = HIFExchangeBMIMsg(device, pBMICmdBuf, offset, pBMICmdBuf, &responseLen, BMI_EXCHANGE_TIMEOUT_MS); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to install ROM patch\n")); - return A_ERROR; - } - - A_MEMCPY(rompatch_id, pBMICmdBuf, sizeof(*rompatch_id)); - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI rompatch Install: (rompatch_id=%d)\n", *rompatch_id)); - return A_OK; -} - -A_STATUS -BMIrompatchUninstall(HIF_DEVICE *device, - A_UINT32 rompatch_id) -{ - A_UINT32 cid; - A_STATUS status; - A_UINT32 offset; - - A_ASSERT(BMI_COMMAND_FITS(sizeof(cid) + sizeof(rompatch_id))); - memset (pBMICmdBuf, 0, sizeof(cid) + sizeof(rompatch_id)); - - if (bmiDone) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, - ("BMI rompatch Uninstall: Enter (device: 0x%p, rompatch_id: %d)\n", - device, rompatch_id)); - - cid = BMI_ROMPATCH_UNINSTALL; - - offset = 0; - A_MEMCPY(&(pBMICmdBuf[offset]), &cid, sizeof(cid)); - offset += sizeof(cid); - A_MEMCPY(&(pBMICmdBuf[offset]), &rompatch_id, sizeof(rompatch_id)); - offset += sizeof(rompatch_id); - status = HIFExchangeBMIMsg(device, pBMICmdBuf, offset, NULL, NULL, 0); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI rompatch UNinstall: (rompatch_id=0x%x)\n", rompatch_id)); - return A_OK; -} - -static A_STATUS -_BMIrompatchChangeActivation(HIF_DEVICE *device, - A_UINT32 rompatch_count, - A_UINT32 *rompatch_list, - A_UINT32 do_activate) -{ - A_UINT32 cid; - A_STATUS status; - A_UINT32 offset; - A_UINT32 length; - - A_ASSERT(BMI_COMMAND_FITS(BMI_DATASZ_MAX + sizeof(cid) + sizeof(rompatch_count))); - memset(pBMICmdBuf, 0, BMI_DATASZ_MAX + sizeof(cid) + sizeof(rompatch_count)); - - if (bmiDone) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, - ("BMI Change rompatch Activation: Enter (device: 0x%p, count: %d)\n", - device, rompatch_count)); - - cid = do_activate ? BMI_ROMPATCH_ACTIVATE : BMI_ROMPATCH_DEACTIVATE; - - offset = 0; - A_MEMCPY(&(pBMICmdBuf[offset]), &cid, sizeof(cid)); - offset += sizeof(cid); - A_MEMCPY(&(pBMICmdBuf[offset]), &rompatch_count, sizeof(rompatch_count)); - offset += sizeof(rompatch_count); - length = rompatch_count * sizeof(*rompatch_list); - A_MEMCPY(&(pBMICmdBuf[offset]), rompatch_list, length); - offset += length; - status = HIFExchangeBMIMsg(device, pBMICmdBuf, offset, NULL, NULL, 0); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Change rompatch Activation: Exit\n")); - - return A_OK; -} - -A_STATUS -BMIrompatchActivate(HIF_DEVICE *device, - A_UINT32 rompatch_count, - A_UINT32 *rompatch_list) -{ - return _BMIrompatchChangeActivation(device, rompatch_count, rompatch_list, 1); -} - -A_STATUS -BMIrompatchDeactivate(HIF_DEVICE *device, - A_UINT32 rompatch_count, - A_UINT32 *rompatch_list) -{ - return _BMIrompatchChangeActivation(device, rompatch_count, rompatch_list, 0); -} - -A_STATUS -BMILZData(HIF_DEVICE *device, - A_UCHAR *buffer, - A_UINT32 length) -{ - A_UINT32 cid; - A_STATUS status; - A_UINT32 offset; - A_UINT32 remaining, txlen; - const A_UINT32 header = sizeof(cid) + sizeof(length); - - A_ASSERT(BMI_COMMAND_FITS(BMI_DATASZ_MAX+header)); - memset (pBMICmdBuf, 0, BMI_DATASZ_MAX+header); - - if (bmiDone) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, - ("BMI Send LZ Data: Enter (device: 0x%p, length: %d)\n", - device, length)); - - cid = BMI_LZ_DATA; - - remaining = length; - while (remaining) - { - txlen = (remaining < (BMI_DATASZ_MAX - header)) ? - remaining : (BMI_DATASZ_MAX - header); - offset = 0; - A_MEMCPY(&(pBMICmdBuf[offset]), &cid, sizeof(cid)); - offset += sizeof(cid); - A_MEMCPY(&(pBMICmdBuf[offset]), &txlen, sizeof(txlen)); - offset += sizeof(txlen); - A_MEMCPY(&(pBMICmdBuf[offset]), &buffer[length - remaining], txlen); - offset += txlen; - status = HIFExchangeBMIMsg(device, pBMICmdBuf, offset, NULL, NULL, 0); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); - return A_ERROR; - } - remaining -= txlen; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI LZ Data: Exit\n")); - - return A_OK; -} - -A_STATUS -BMILZStreamStart(HIF_DEVICE *device, - A_UINT32 address) -{ - A_UINT32 cid; - A_STATUS status; - A_UINT32 offset; - - A_ASSERT(BMI_COMMAND_FITS(sizeof(cid) + sizeof(address))); - memset (pBMICmdBuf, 0, sizeof(cid) + sizeof(address)); - - if (bmiDone) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, - ("BMI LZ Stream Start: Enter (device: 0x%p, address: 0x%x)\n", - device, address)); - - cid = BMI_LZ_STREAM_START; - offset = 0; - A_MEMCPY(&(pBMICmdBuf[offset]), &cid, sizeof(cid)); - offset += sizeof(cid); - A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address)); - offset += sizeof(address); - status = HIFExchangeBMIMsg(device, pBMICmdBuf, offset, NULL, NULL, 0); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to Start LZ Stream to the device\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI LZ Stream Start: Exit\n")); - - return A_OK; -} - -A_STATUS -BMIFastDownload(HIF_DEVICE *device, A_UINT32 address, A_UCHAR *buffer, A_UINT32 length) -{ - A_STATUS status = A_ERROR; - A_UINT32 lastWord = 0; - A_UINT32 lastWordOffset = length & ~0x3; - A_UINT32 unalignedBytes = length & 0x3; - - status = BMILZStreamStart (device, address); - if (A_FAILED(status)) { - return A_ERROR; - } - - if (unalignedBytes) { - /* copy the last word into a zero padded buffer */ - A_MEMCPY(&lastWord, &buffer[lastWordOffset], unalignedBytes); - } - - status = BMILZData(device, buffer, lastWordOffset); - - if (A_FAILED(status)) { - return A_ERROR; - } - - if (unalignedBytes) { - status = BMILZData(device, (A_UINT8 *)&lastWord, 4); - } - - if (A_SUCCESS(status)) { - // - // Close compressed stream and open a new (fake) one. This serves mainly to flush Target caches. - // - status = BMILZStreamStart (device, 0x00); - if (A_FAILED(status)) { - return A_ERROR; - } - } - return status; -} - -A_STATUS -BMInvramProcess(HIF_DEVICE *device, A_UCHAR *seg_name, A_UINT32 *retval) -{ - A_UINT32 cid; - A_STATUS status; - A_UINT32 offset; - A_UINT32 retvalLen; - - A_ASSERT(BMI_COMMAND_FITS(sizeof(cid) + BMI_NVRAM_SEG_NAME_SZ)); - - if (bmiDone) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n")); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, - ("BMI NVRAM Process: Enter (device: 0x%p, name: %s)\n", - device, seg_name)); - - cid = BMI_NVRAM_PROCESS; - offset = 0; - A_MEMCPY(&(pBMICmdBuf[offset]), &cid, sizeof(cid)); - offset += sizeof(cid); - A_MEMCPY(&(pBMICmdBuf[offset]), seg_name, BMI_NVRAM_SEG_NAME_SZ); - offset += BMI_NVRAM_SEG_NAME_SZ; - retvalLen = sizeof(*retval); - status = HIFExchangeBMIMsg(device, pBMICmdBuf, offset, pBMICmdBuf, &retvalLen, 0); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to access the device\n")); - return A_ERROR; - } - - A_MEMCPY(retval, pBMICmdBuf, sizeof(*retval)); - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI NVRAM Process: Exit\n")); - - return A_OK; -} - -#ifdef HIF_MESSAGE_BASED - -/* TODO.. stubs.. for message-based HIFs, the RAW access APIs need to be changed - */ - -A_STATUS -BMIRawWrite(HIF_DEVICE *device, A_UCHAR *buffer, A_UINT32 length) -{ - /* TODO */ - return A_ERROR; -} - -A_STATUS -BMIRawRead(HIF_DEVICE *device, A_UCHAR *buffer, A_UINT32 length, A_BOOL want_timeout) -{ - /* TODO */ - return A_ERROR; -} - -#endif - - diff --git a/drivers/net/wireless/ar6003/host/bmi/src/makefile b/drivers/net/wireless/ar6003/host/bmi/src/makefile deleted file mode 100644 index 1ba034c4900e..000000000000 --- a/drivers/net/wireless/ar6003/host/bmi/src/makefile +++ /dev/null @@ -1,26 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2005-2007 Atheros Corporation. All rights reserved. -# -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# -#------------------------------------------------------------------------------ -#============================================================================== -# Author(s): ="Atheros" -#============================================================================== -!INCLUDE $(_MAKEENVROOT)\makefile.def - - - diff --git a/drivers/net/wireless/ar6003/host/dfs/dfs.c b/drivers/net/wireless/ar6003/host/dfs/dfs.c deleted file mode 100644 index 0b87ab42d7c8..000000000000 --- a/drivers/net/wireless/ar6003/host/dfs/dfs.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (c) 2002-2006, Atheros Communications Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef ATH_SUPPORT_DFS -#include "dfs_host.h" -#include "dfs_common.h" - -struct ath_dfs_host *dfs_attach_host(DEV_HDL dev, OS_HDL os, ATH_DFS_CAPINFO *cap_info) -{ - int i,n; - struct ath_dfs_host *dfs; - - dfs = (struct ath_dfs_host *)DFS_MALLOC(os, sizeof(struct ath_dfs_host)); - - if (dfs == NULL) { - A_PRINTF("%s: ath_dfs allocation failed\n", __func__); - return dfs; - } - - OS_MEMZERO(dfs, sizeof (struct ath_dfs_host)); - - dfs->dev_hdl = dev; - dfs->os_hdl = os; - - dfs->dfs_debug_level=ATH_DEBUG_DFS; - - ATH_DFSQ_LOCK_INIT(dfs); - STAILQ_INIT(&dfs->dfs_radarq); - ATH_ARQ_LOCK_INIT(dfs); - STAILQ_INIT(&dfs->dfs_arq); - STAILQ_INIT(&(dfs->dfs_eventq)); - ATH_DFSEVENTQ_LOCK_INIT(dfs); - - OS_INIT_TIMER(&dfs->dfs_radar_task_timer, dfs_radar_task, dfs); - - dfs->events = (struct dfs_event *)DFS_MALLOC(os, - sizeof(struct dfs_event)*DFS_MAX_EVENTS); - - if (dfs->events == NULL) { - OS_FREE(dfs); - dfs = NULL; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS, - "%s: events allocation failed\n", __func__); - return dfs; - } - for (i=0; i< DFS_MAX_EVENTS; i++) { - STAILQ_INSERT_TAIL(&(dfs->dfs_eventq), &dfs->events[i], re_list); - } - - dfs->pulses = (struct dfs_pulseline *)DFS_MALLOC(os, sizeof(struct dfs_pulseline)); - - if (dfs->pulses == NULL) { - OS_FREE(dfs->events); - dfs->events = NULL; - OS_FREE(dfs); - dfs = NULL; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS, - "%s: pulse buffer allocation failed\n", __func__); - return dfs; - } - - dfs->pulses->pl_lastelem = DFS_MAX_PULSE_BUFFER_MASK; - -#ifdef ATH_ENABLE_AR - if(cap_info->enable_ar){ - dfs_reset_ar(dfs); - dfs_reset_arq(dfs); - dfs->dfs_proc_phyerr |= DFS_AR_EN; - } -#endif /* ATH_ENABLE_AR */ - - if(cap_info->enable_radar) { - /* Allocate memory for radar filters */ - for (n=0; ndfs_radarf[n] = (struct dfs_filtertype *)DFS_MALLOC(os, sizeof(struct dfs_filtertype)); - if (dfs->dfs_radarf[n] == NULL) { - DFS_DPRINTK(dfs,ATH_DEBUG_DFS, - "%s: cannot allocate memory for radar filter types\n", - __func__); - goto bad1; - } - } - /* Allocate memory for radar table */ - dfs->dfs_radartable = (int8_t **)DFS_MALLOC(os, 256*sizeof(int8_t *)); - if (dfs->dfs_radartable == NULL) { - DFS_DPRINTK(dfs, ATH_DEBUG_DFS, "%s: cannot allocate memory for radar table\n", - __func__); - goto bad1; - } - for (n=0; n<256; n++) { - dfs->dfs_radartable[n] = DFS_MALLOC(os, DFS_MAX_RADAR_OVERLAP*sizeof(int8_t)); - if (dfs->dfs_radartable[n] == NULL) { - DFS_DPRINTK(dfs, ATH_DEBUG_DFS, - "%s: cannot allocate memory for radar table entry\n", - __func__); - goto bad2; - } - } - - /* Init the Bin5 chirping related data */ - dfs->dfs_rinfo.dfs_bin5_chirp_ts = cap_info->ext_chan_busy_ts; - dfs->dfs_rinfo.dfs_last_bin5_dur = MAX_BIN5_DUR; - - dfs->dfs_b5radars = NULL; - } - - return dfs; - -bad2: - OS_FREE(dfs->dfs_radartable); - dfs->dfs_radartable = NULL; -bad1: - for (n=0; ndfs_radarf[n] != NULL) { - OS_FREE(dfs->dfs_radarf[n]); - dfs->dfs_radarf[n] = NULL; - } - } - if (dfs->pulses) { - OS_FREE(dfs->pulses); - dfs->pulses = NULL; - } - if (dfs->events) { - OS_FREE(dfs->events); - dfs->events = NULL; - } - - return dfs; - -} - -void -dfs_detach_host(struct ath_dfs_host *dfs) -{ - int n, empty; - - if (dfs == NULL) { - A_PRINTF("%s: sc_dfs is NULL\n", __func__); - return; - } - - OS_CANCEL_TIMER(&dfs->dfs_radar_task_timer); - - /* Return radar events to free q*/ - dfs_reset_radarq(dfs); - dfs_reset_alldelaylines(dfs); - - /* Free up pulse log*/ - if (dfs->pulses != NULL) { - OS_FREE(dfs->pulses); - dfs->pulses = NULL; - } - - for (n=0; ndfs_radarf[n] != NULL) { - OS_FREE(dfs->dfs_radarf[n]); - dfs->dfs_radarf[n] = NULL; - } - } - - - if (dfs->dfs_radartable != NULL) { - for (n=0; n<256; n++) { - if (dfs->dfs_radartable[n] != NULL) { - OS_FREE(dfs->dfs_radartable[n]); - dfs->dfs_radartable[n] = NULL; - } - } - OS_FREE(dfs->dfs_radartable); - dfs->dfs_radartable = NULL; - } - - if (dfs->dfs_b5radars != NULL) { - OS_FREE(dfs->dfs_b5radars); - dfs->dfs_b5radars=NULL; - } - - dfs_reset_ar(dfs); - - ATH_ARQ_LOCK(dfs); - empty = STAILQ_EMPTY(&(dfs->dfs_arq)); - ATH_ARQ_UNLOCK(dfs); - if (!empty) { - dfs_reset_arq(dfs); - } - if (dfs->events != NULL) { - OS_FREE(dfs->events); - dfs->events = NULL; - } - OS_FREE(dfs); - dfs = NULL; -} - - -void dfs_bangradar_enable(struct ath_dfs_host *dfs, u_int8_t enable) -{ - dfs->dfs_bangradar = enable; -} - -void dfs_set_dur_multiplier(struct ath_dfs_host *dfs, u_int32_t dur_multiplier) -{ - dfs->dur_multiplier = dur_multiplier; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS3, - "%s: duration multiplier is %d\n", __func__, dfs->dur_multiplier); -} - -void dfs_set_debug_level_host(struct ath_dfs_host *dfs, u_int32_t level) -{ - dfs->dfs_debug_level = level; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS3, - "%s: debug level is %d\n", __func__, dfs->dfs_debug_level); - -} - -#endif /* ATH_UPPORT_DFS */ diff --git a/drivers/net/wireless/ar6003/host/dfs/dfs_ar.c b/drivers/net/wireless/ar6003/host/dfs/dfs_ar.c deleted file mode 100644 index 143606519326..000000000000 --- a/drivers/net/wireless/ar6003/host/dfs/dfs_ar.c +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (c) 2002-2010, Atheros Communications Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef ATH_SUPPORT_DFS -#include "dfs_host.h" - -#define UPDATE_TOP_THREE_PEAKS(_histo, _peakPtrList, _currWidth) { \ - if ((_histo)[(_peakPtrList)[0]] < (_histo)[(_currWidth)]) { \ - (_peakPtrList)[2] = (_currWidth != (_peakPtrList)[1]) ? \ - (_peakPtrList)[1] : (_peakPtrList)[2]; \ - (_peakPtrList)[1] = (_peakPtrList)[0]; \ - (_peakPtrList)[0] = (_currWidth); \ - } else if ((_currWidth != (_peakPtrList)[0]) \ - && ((_histo)[(_peakPtrList)[1]] < (_histo)[(_currWidth)])) { \ - (_peakPtrList)[2] = (_peakPtrList)[1]; \ - (_peakPtrList)[1] = (_currWidth); \ - } else if ((_currWidth != (_peakPtrList)[1]) \ - && (_currWidth != (_peakPtrList)[0]) \ - && ((_histo)[(_peakPtrList)[2]] < (_histo)[(_currWidth)])) { \ - (_peakPtrList)[2] = (_currWidth); \ - } \ -} - - - -u_int32_t dfs_process_ar_event(struct ath_dfs_host *dfs) -{ - struct dfs_ar_state *ar; - struct dfs_event *re=NULL; - u_int32_t sumpeak=0,numpeaks,rssi,width,origregionsum=0, i; - u_int16_t thistimestamp; - int empty; - u_int32_t result = 0; - - if (dfs == NULL) { - A_PRINTF("%s: sc_dfs is NULL\n", __func__); - return result; - } - ar = (struct dfs_ar_state *) &(dfs->dfs_ar_state); - ATH_ARQ_LOCK(dfs); - empty = STAILQ_EMPTY(&(dfs->dfs_arq)); - ATH_ARQ_UNLOCK(dfs); - while (!empty) { - ATH_ARQ_LOCK(dfs); - re = STAILQ_FIRST(&(dfs->dfs_arq)); - if (re != NULL) - STAILQ_REMOVE_HEAD(&(dfs->dfs_arq), re_list); - ATH_ARQ_UNLOCK(dfs); - if (re == NULL) - return result; - - thistimestamp = re->re_ts; - rssi = re->re_rssi; - width = re->re_dur; - - /* Return the dfs event to the free event list */ - OS_MEMZERO(re, sizeof(struct dfs_event)); - ATH_DFSEVENTQ_LOCK(dfs); - STAILQ_INSERT_TAIL(&(dfs->dfs_eventq), re, re_list); - ATH_DFSEVENTQ_UNLOCK(dfs); - - /* determine if current radar is an extension of previous radar */ - if (ar->ar_prevwidth == 255) { - /* tag on previous width for consideraion of low data rate ACKs */ - ar->ar_prevwidth += width; - width = (width == 255) ? 255 : ar->ar_prevwidth; - } else if ((width == 255) && - (ar->ar_prevwidth == 510 || - ar->ar_prevwidth == 765 || - ar->ar_prevwidth == 1020)) { - /* Aggregate up to 5 consecuate max radar widths - * to consider 11Mbps long preamble 1500-byte pkts - */ - ar->ar_prevwidth += width; - } else if (ar->ar_prevwidth == 1275 && width != 255) { - /* Found 5th consecute maxed out radar, reset history */ - width += ar->ar_prevwidth; - ar->ar_prevwidth = 0; - } else if (ar->ar_prevwidth > 255) { - /* Ignore if there are less than 5 consecutive maxed out radars */ - ar->ar_prevwidth = width; - width = 255; - } else { - ar->ar_prevwidth = width; - } - /* For ignoring noises with radar duration in ranges of 3-30: AP4x */ - if ((width >= 257 && width <= 278) || /* Region 7 - 5.5Mbps (long pre) ACK = 270 = 216 us */ - (width >= 295 && width <= 325) || /* Region 8 - 2Mbps (long pre) ACKC = 320 = 256us */ - (width >= 1280 && width <= 1300)) { - u_int16_t wraparoundadj=0; - u_int16_t base = (width >= 1280) ? 1275 : 255; - if (thistimestamp < ar->ar_prevtimestamp) { - wraparoundadj = 32768; - } - if ((thistimestamp + wraparoundadj - ar->ar_prevtimestamp) != - (width - base)) { - width = 1; - } - } - if (width <= 10) { - ATH_ARQ_LOCK(dfs); - empty = STAILQ_EMPTY(&(dfs->dfs_arq)); - ATH_ARQ_UNLOCK(dfs); - continue; - } - /* - * Overloading the width=2 in: Store a count of radars w/max duration - * and high RSSI (not noise) - */ - if ((width == 255) && (rssi > DFS_AR_RSSI_THRESH_STRONG_PKTS)) - width = 2; - /* - * Overloading the width=3 bin: - * Double and store a count of rdars of durtaion that matches 11Mbps (long preamble) - * TCP ACKs or 1500-byte data packets - */ - if ((width >= 1280 && width <= 1300) || - (width >= 318 && width <= 325)) { - width = 3; - ar->ar_phyerrcount[3] += 2; - ar->ar_acksum += 2; - } - /* build histogram of radar duration */ - if (width > 0 && width <= 510) - ar->ar_phyerrcount[width]++; - else { - /* invalid radar width, throw it away */ - ATH_ARQ_LOCK(dfs); - empty = STAILQ_EMPTY(&(dfs->dfs_arq)); - ATH_ARQ_UNLOCK(dfs); - continue; - } - /* Received radar of interest (i.e., signature match), proceed to check if - * there is enough neighboring traffic to drop out of Turbo - */ - if ((width >= 33 && width <= 38) || /* Region 0: 24Mbps ACK = 35 = 28us */ - (width >= 39 && width <= 44) || /* Region 1: 12Mbps ACK = 40 = 32us */ - (width >= 53 && width <= 58) || /* Region 2: 6Mbps ACK = 55 = 44us */ - (width >= 126 && width <= 140) || /* Region 3: 11Mbps ACK = 135 = 108us */ - (width >= 141 && width <= 160) || /* Region 4: 5.5Mbps ACK = 150 = 120us */ - (width >= 189 && width <= 210) || /* Region 5: 2Mbps ACK = 200 = 160us */ - (width >= 360 && width <= 380) || /* Region 6 1Mbps ACK = 400 = 320us */ - (width >= 257 && width <= 270) || /* Region 7 5.5Mbps (Long Pre) ACK = 270 = 216us */ - (width >= 295 && width <= 302) || /* Region 8 2Mbps (Long Pre) ACK = 320 = 256us */ - /* Ignoring Region 9 due to overlap with 255 which is same as board noise */ - /* Region 9 11Mbps (Long Pre) ACK = 255 = 204us */ - (width == 3)) { - ar->ar_acksum++; - /* double the count for strong radars that match one of the ACK signatures */ - if (rssi > DFS_AR_RSSI_DOUBLE_THRESHOLD) { - ar->ar_phyerrcount[width]++; - ar->ar_acksum++; - } - UPDATE_TOP_THREE_PEAKS(ar->ar_phyerrcount, - ar->ar_peaklist, width); - /* sum the counts of these peaks */ - numpeaks = DFS_AR_MAX_NUM_PEAKS; - origregionsum = ar->ar_acksum; - for (i=0; i<= DFS_AR_MAX_NUM_PEAKS; i++) { - if (ar->ar_peaklist[i] > 0) { - if ((i==0) && - (ar->ar_peaklist[i] == 3) && - (ar->ar_phyerrcount[3] < - ar->ar_phyerrcount[2]) && - (ar->ar_phyerrcount[3] > 6)) { - /* - * If the top peak is one that - * maches the 11Mbps long - * preamble TCP Ack/1500-byte - * data, include the count for - * radars that hav emax - * duration and high rssi - * (width = 2) to boost the - * sum for the PAR test that - * follows */ - sumpeak += (ar->ar_phyerrcount[2] - + ar->ar_phyerrcount[3]); - ar->ar_acksum += (ar->ar_phyerrcount[2] - + ar->ar_phyerrcount[3]); - } else { - sumpeak += ar->ar_phyerrcount[ar->ar_peaklist[i]]; - } - } else - numpeaks--; - } - /* - * If sum of patterns matches exceeds packet threshold, - * perform comparison between peak-to-avg ratio against parThreshold - */ - if ((ar->ar_acksum > ar->ar_packetthreshold) && - ((sumpeak * DFS_AR_REGION_WIDTH) > (ar->ar_parthreshold * numpeaks * - ar->ar_acksum))) { - /* neighboring traffic detected, get out of Turbo */ - result = TRAFFIC_DETECTED; - OS_MEMZERO(ar->ar_peaklist, sizeof(ar->ar_peaklist)); - ar->ar_acksum = 0; - OS_MEMZERO(ar->ar_phyerrcount, sizeof(ar->ar_phyerrcount)); - } else { - /* - * reset sum of matches to discount the count of - * strong radars with max duration - */ - ar->ar_acksum = origregionsum; - } - } - ar->ar_prevtimestamp = thistimestamp; - ATH_ARQ_LOCK(dfs); - empty = STAILQ_EMPTY(&(dfs->dfs_arq)); - ATH_ARQ_UNLOCK(dfs); - } - return result; -} - -void dfs_reset_ar(struct ath_dfs_host *dfs) -{ - - if (dfs == NULL) { - A_PRINTF("%s: sc_dfs is NULL\n", __func__); - return; - } - OS_MEMZERO(&dfs->dfs_ar_state, sizeof(dfs->dfs_ar_state)); - dfs->dfs_ar_state.ar_packetthreshold = DFS_AR_PKT_COUNT_THRESH; - dfs->dfs_ar_state.ar_parthreshold = DFS_AR_ACK_DETECT_PAR_THRESH; - dfs->dfs_ar_state.ar_radarrssi = DFS_AR_RADAR_RSSI_THR; - -} - -void dfs_reset_arq(struct ath_dfs_host *dfs) -{ - struct dfs_event *event; - - if (dfs == NULL) { - A_PRINTF("%s: sc_dfs is NULL\n", __func__); - return; - } - ATH_ARQ_LOCK(dfs); - ATH_DFSEVENTQ_LOCK(dfs); - while (!STAILQ_EMPTY(&(dfs->dfs_arq))) { - event = STAILQ_FIRST(&(dfs->dfs_arq)); - STAILQ_REMOVE_HEAD(&(dfs->dfs_arq), re_list); - OS_MEMZERO(event, sizeof(struct dfs_event)); - STAILQ_INSERT_TAIL(&(dfs->dfs_eventq), event, re_list); - } - ATH_DFSEVENTQ_UNLOCK(dfs); - ATH_ARQ_UNLOCK(dfs); -} - - -#endif /* ATH_SUPPORT_DFS */ diff --git a/drivers/net/wireless/ar6003/host/dfs/dfs_bindetects.c b/drivers/net/wireless/ar6003/host/dfs/dfs_bindetects.c deleted file mode 100644 index d2582f9c3efd..000000000000 --- a/drivers/net/wireless/ar6003/host/dfs/dfs_bindetects.c +++ /dev/null @@ -1,340 +0,0 @@ -/* - * Copyright (c) 2002-2010, Atheros Communications Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef ATH_SUPPORT_DFS -#include "dfs_host.h" - -int dfs_bin_fixedpattern_check(struct ath_dfs_host *dfs, struct dfs_filter *rf, u_int32_t dur, int ext_chan_flag, u_int32_t ext_chan_busy) -{ - struct dfs_pulseline *pl = dfs->pulses; - int i, n, refpri, primargin, numpulses=0; - u_int64_t start_ts, end_ts, event_ts, prev_event_ts, next_event_ts, window_start, window_end; - u_int32_t index, next_index, deltadur; - - /* For fixed pattern types, rf->rf_patterntype=1*/ - primargin = dfs_get_pri_margin(ext_chan_flag, (rf->rf_patterntype==1),dfs->dfs_rinfo.rn_lastfull_ts, ext_chan_busy); - - refpri = (rf->rf_minpri + rf->rf_maxpri)/2; - index = pl->pl_lastelem; - end_ts = pl->pl_elems[index].p_time; - start_ts = end_ts - (refpri*rf->rf_numpulses); - - DFS_DPRINTK(dfs, ATH_DEBUG_DFS3, "lastelem ts=%llu start_ts=%llu, end_ts=%llu\n", (unsigned long long)pl->pl_elems[index].p_time, (unsigned long long)start_ts, (unsigned long long)end_ts); - /* find the index of first element in our window of interest */ - for(i=0;ipl_numelems;i++) { - index = (index-1) & DFS_MAX_PULSE_BUFFER_MASK; - if(pl->pl_elems[index].p_time >= start_ts ) - continue; - else { - index = (index) & DFS_MAX_PULSE_BUFFER_MASK; - break; - } - } - for (n=0;n<=rf->rf_numpulses; n++) { - window_start = (start_ts + (refpri*n))-(primargin+n); - window_end = window_start + 2*(primargin+n); - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, - "window_start %u window_end %u \n", - (u_int32_t)window_start, (u_int32_t)window_end); - for(i=0;ipl_numelems;i++) { - prev_event_ts = pl->pl_elems[index].p_time; - index = (index+1) & DFS_MAX_PULSE_BUFFER_MASK; - event_ts = pl->pl_elems[index].p_time; - next_index = (index+1) & DFS_MAX_PULSE_BUFFER_MASK; - next_event_ts = pl->pl_elems[next_index].p_time; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, - "ts %u \n", (u_int32_t)event_ts); - if( (event_ts <= window_end) && (event_ts >= window_start)){ - deltadur = DFS_DIFF(pl->pl_elems[index].p_dur, dur); - if( (pl->pl_elems[index].p_dur == 1) || - ((dur != 1) && (deltadur <= 2))) { - numpulses++; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, - "numpulses %u \n", numpulses); - break; - } - } - else if( event_ts > window_end) { - index = (index-1) & DFS_MAX_PULSE_BUFFER_MASK; - break; - } - else if( event_ts == prev_event_ts) { - if( ((next_event_ts - event_ts) > refpri) || - ((next_event_ts - event_ts) == 0)) { - deltadur = DFS_DIFF(pl->pl_elems[index].p_dur, dur); - if( (pl->pl_elems[index].p_dur == 1) || - ((pl->pl_elems[index].p_dur != 1) && (deltadur <= 2))) { - numpulses++; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, - "zero PRI: numpulses %u \n", numpulses); - break; - } - } - } - } - } - if (numpulses >= dfs_get_filter_threshold(rf, ext_chan_flag, dfs->dfs_rinfo.rn_lastfull_ts, ext_chan_busy)) { - DFS_DPRINTK(dfs, ATH_DEBUG_DFS1, "%s FOUND filterID=%u numpulses=%d unadj thresh=%d\n", __func__, rf->rf_pulseid, numpulses, rf->rf_threshold); - return 1; - } - else - return 0; -} - -void -dfs_add_pulse(struct ath_dfs_host *dfs, struct dfs_filter *rf, struct dfs_event *re, - u_int32_t deltaT) -{ - u_int32_t index,n, window, pri; - struct dfs_delayline *dl; - - dl = &rf->rf_dl; - /* Circular buffer of size 2^n */ - index = (dl->dl_lastelem + 1) & DFS_MAX_DL_MASK; - //if ((dl->dl_numelems+1) == DFS_MAX_DL_SIZE) - if ((dl->dl_numelems) == DFS_MAX_DL_SIZE) - dl->dl_firstelem = (dl->dl_firstelem + 1) & DFS_MAX_DL_MASK; - else - dl->dl_numelems++; - dl->dl_lastelem = index; - dl->dl_elems[index].de_time = deltaT; - window = deltaT; - dl->dl_elems[index].de_dur = re->re_dur; - dl->dl_elems[index].de_rssi = re->re_rssi; - - for (n=0;ndl_numelems-1; n++) { - index = (index-1) & DFS_MAX_DL_MASK; - pri = dl->dl_elems[index].de_time; - window += pri; - if (window > rf->rf_filterlen) { - dl->dl_firstelem = (index+1) & DFS_MAX_DL_MASK; - dl->dl_numelems = n+1; - } - } - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, - "dl firstElem = %d lastElem = %d\n",dl->dl_firstelem, - dl->dl_lastelem); -} - - -int dfs_bin_check(struct ath_dfs_host *dfs, struct dfs_filter *rf, - u_int32_t deltaT, u_int32_t width, int ext_chan_flag, u_int32_t ext_chan_busy) -{ - u_int32_t refpri, refdur, searchpri, deltapri, averagerefpri; - u_int32_t n, i, primargin, durmargin, highscore, highscoreindex; - int score[DFS_MAX_DL_SIZE], delayindex, dindex, found=0; - struct dfs_delayline *dl; - u_int32_t scoreindex, lowpriindex= 0, lowpri = 0xffff; - int numpulses=0; - - dl = &rf->rf_dl; - if( dl->dl_numelems < (rf->rf_threshold-1)) { - return 0; - } - if( deltaT > rf->rf_filterlen) - return 0; - - primargin = dfs_get_pri_margin(ext_chan_flag, (rf->rf_patterntype==1), - dfs->dfs_rinfo.rn_lastfull_ts, ext_chan_busy); - - - if(rf->rf_maxdur < 10) { - durmargin = 4; - } - else { - durmargin = 6; - } - - if( rf->rf_patterntype == 1 ){ - found = dfs_bin_fixedpattern_check(dfs, rf, width, ext_chan_flag, ext_chan_busy); - if(found) { - dl->dl_numelems = 0; - } - return found; - } - - OS_MEMZERO(score, sizeof(int)*DFS_MAX_DL_SIZE); - /* find out the lowest pri */ - for (n=0;ndl_numelems; n++) { - delayindex = (dl->dl_firstelem + n) & DFS_MAX_DL_MASK; - refpri = dl->dl_elems[delayindex].de_time; - if( refpri == 0) - continue; - else if(refpri < lowpri) { - lowpri = dl->dl_elems[delayindex].de_time; - lowpriindex = n; - } - } - /* find out the each delay element's pri score */ - for (n=0;ndl_numelems; n++) { - delayindex = (dl->dl_firstelem + n) & DFS_MAX_DL_MASK; - refpri = dl->dl_elems[delayindex].de_time; - if( refpri == 0) - continue; - for (i=0;idl_numelems; i++) { - dindex = (dl->dl_firstelem + i) & DFS_MAX_DL_MASK; - searchpri = dl->dl_elems[dindex].de_time; - deltapri = DFS_DIFF(searchpri, refpri); - if( deltapri < primargin) - score[n]++; - } - if( score[n] > rf->rf_threshold) { - /* we got the most possible candidate, - * no need to continue further */ - break; - } - } - /* find out the high scorer */ - highscore = 0; - highscoreindex = 0; - for (n=0;ndl_numelems; n++) { - if( score[n] > highscore) { - highscore = score[n]; - highscoreindex = n; - } - else if( score[n] == highscore ) { - /*more than one pri has highscore take the least pri */ - delayindex = (dl->dl_firstelem + highscoreindex) & DFS_MAX_DL_MASK; - dindex = (dl->dl_firstelem + n) & DFS_MAX_DL_MASK; - if( dl->dl_elems[dindex].de_time <= - dl->dl_elems[delayindex].de_time ) { - highscoreindex = n; - } - } - } - /* find the average pri of pulses around the pri of highscore or - * the pulses around the lowest pri */ - if( highscore < 3) { - scoreindex = lowpriindex; - } - else { - scoreindex = highscoreindex; - } - /* We got the possible pri, save its parameters as reference */ - delayindex = (dl->dl_firstelem + scoreindex) & DFS_MAX_DL_MASK; - refdur = dl->dl_elems[delayindex].de_dur; - refpri = dl->dl_elems[delayindex].de_time; - averagerefpri = 0; - - numpulses = dfs_bin_pri_check(dfs, rf, dl, score[scoreindex], refpri, refdur, ext_chan_flag, ext_chan_busy); - if (numpulses >= dfs_get_filter_threshold(rf, ext_chan_flag, dfs->dfs_rinfo.rn_lastfull_ts, ext_chan_busy)) { - found = 1; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS1, "ext_flag=%d MATCH filter=%u numpulses=%u thresh=%u refpri=%d primargin=%d\n", ext_chan_flag, rf->rf_pulseid, numpulses,rf->rf_threshold, refpri, primargin); - dfs_print_delayline(dfs, &rf->rf_dl); - dfs_print_filter(dfs, rf); - } - return found; -} - -int dfs_bin_pri_check(struct ath_dfs_host *dfs, struct dfs_filter *rf, - struct dfs_delayline *dl, u_int32_t score, - u_int32_t refpri, u_int32_t refdur, int ext_chan_flag, u_int32_t ext_chan_busy) -{ - u_int32_t searchpri, searchdur, searchrssi, deltapri, deltadur, averagerefpri=0; - int primultiples[6]; - int delayindex, dindex; - u_int32_t i, j, primargin, durmargin, highscore=score, highscoreindex=0; - int numpulses=1; //first pulse in the burst is most likely being filtered out based on maxfilterlen - - //Use the adjusted PRI margin to reduce false alarms - /* For non fixed pattern types, rf->rf_patterntype=0*/ - primargin = dfs_get_pri_margin(ext_chan_flag, (rf->rf_patterntype==1), - dfs->dfs_rinfo.rn_lastfull_ts, ext_chan_busy); - - - if(rf->rf_maxdur < 10) { - durmargin = 4; - } - else { - durmargin = 6; - } - if( score > 1) { - for (i=0;idl_numelems; i++) { - dindex = (dl->dl_firstelem + i) & DFS_MAX_DL_MASK; - searchpri = dl->dl_elems[dindex].de_time; - deltapri = DFS_DIFF(searchpri, refpri); - if( deltapri < primargin) - averagerefpri += searchpri; - } - refpri = (averagerefpri/score); //average - } - /* Note: Following primultiple calculation should be done once per filter - * during initialization stage (dfs_attach) and stored in its array - * atleast for fixed frequency types like FCC Bin1 to save some CPU cycles. - * multiplication, devide operators in the following code are left as it is - * for readability hoping the complier will use left/right shifts wherever possible - */ - if( refpri > rf->rf_maxpri) { - primultiples[0] = (refpri - refdur)/2; - primultiples[1] = refpri; - primultiples[2] = refpri + primultiples[0]; - primultiples[3] = (refpri - refdur)*2; - primultiples[4] = primultiples[3] + primultiples[0]; - primultiples[5] = primultiples[3] + refpri; - } - else { - primultiples[0] = refpri; - primultiples[1] = refpri + primultiples[0]; - primultiples[2] = refpri + primultiples[1]; - primultiples[3] = refpri + primultiples[2]; - primultiples[4] = refpri + primultiples[3]; - primultiples[5] = refpri + primultiples[4]; - } - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, - "pri0 = %d pri1 = %d pri2 = %d pri3 = %d pri4 = %d pri5 = %d\n", - primultiples[0], primultiples[1], primultiples[2], - primultiples[3], primultiples[4], primultiples[5]); - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, - "refpri = %d high score = %d index = %d numpulses = %d\n", - refpri, highscore, highscoreindex, numpulses); - /* Count the other delay elements that have pri and dur with in the - * acceptable range from the reference one */ - for (i=0; idl_numelems; i++) { - delayindex = (dl->dl_firstelem + i) & DFS_MAX_DL_MASK; - searchpri = dl->dl_elems[delayindex].de_time; - if( searchpri == 0) { - /* This events PRI is zero, take it as a - * valid pulse but decrement next event's PRI by refpri - */ - dindex = (delayindex+1)& DFS_MAX_DL_MASK; - dl->dl_elems[dindex].de_time -= refpri; - searchpri = refpri; - } - searchdur = dl->dl_elems[delayindex].de_dur; - searchrssi = dl->dl_elems[delayindex].de_rssi; - deltadur = DFS_DIFF(searchdur, refdur); - for(j=0; j<6; j++) { - deltapri = DFS_DIFF(searchpri, primultiples[j]); - /* May need to revisit this as this increases the primargin by 5*/ - /* if( deltapri < (primargin+j)) { */ - if( deltapri < (primargin)) { - if( deltadur < durmargin) { - if( (refdur < 8) || ((refdur >=8)&& - (searchrssi < 250))) { - - numpulses++; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, - "rf->minpri=%d rf->maxpri=%d searchpri = %d index = %d numpulses = %d deltapri=%d j=%d\n", - rf->rf_minpri, rf->rf_maxpri, searchpri, i, numpulses, deltapri, j); - } - } - break; - } - } - } - return numpulses; -} -#endif /* ATH_SUPPORT_DFS */ diff --git a/drivers/net/wireless/ar6003/host/dfs/dfs_debug.c b/drivers/net/wireless/ar6003/host/dfs/dfs_debug.c deleted file mode 100644 index 40eb11a53505..000000000000 --- a/drivers/net/wireless/ar6003/host/dfs/dfs_debug.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2002-2010, Atheros Communications Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef ATH_SUPPORT_DFS -#include "dfs_host.h" - -void -dfs_print_delayline(struct ath_dfs_host *dfs, struct dfs_delayline *dl) -{ - int i=0,index; - struct dfs_delayelem *de; - - index = dl->dl_lastelem; - for (i=0; idl_numelems; i++) { - de = &dl->dl_elems[index]; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, - "Elem %d: ts = %u (0x%x) dur=%u\n",i, - de->de_time, de->de_time, de->de_dur); - index = (index - 1)& DFS_MAX_DL_MASK; - } -} - - -void -dfs_print_filter(struct ath_dfs_host *dfs, struct dfs_filter *rf) -{ - DFS_DPRINTK(dfs, ATH_DEBUG_DFS1, "filterID[%d] rf_numpulses=%u; rf->rf_minpri=%u; rf->rf_maxpri=%u; rf->rf_threshold=%u; rf->rf_filterlen=%u; rf->rf_mindur=%u; rf->rf_maxdur=%u\n", rf->rf_pulseid, rf->rf_numpulses, rf->rf_minpri, rf->rf_maxpri, rf->rf_threshold, rf->rf_filterlen, rf->rf_mindur, rf->rf_maxdur); -} - - -void -dfs_print_filters(struct ath_dfs_host *dfs) -{ - struct dfs_filtertype *ft = NULL; - struct dfs_filter *rf; - int i,j; - - if (dfs == NULL) { - A_PRINTF("%s: sc_dfs is NULL\n", __func__); - return; - } - for (i=0; idfs_radarf[i] != NULL) { - ft = dfs->dfs_radarf[i]; - if((ft->ft_numfilters > DFS_MAX_NUM_RADAR_FILTERS) || (!ft->ft_numfilters)) - continue; - printk("===========ft->ft_numfilters=%u===========\n", ft->ft_numfilters); - for (j=0; jft_numfilters; j++) { - rf = &(ft->ft_filters[j]); - printk("filter[%d] filterID = %d rf_numpulses=%u; rf->rf_minpri=%u; rf->rf_maxpri=%u; rf->rf_threshold=%u; rf->rf_filterlen=%u; rf->rf_mindur=%u; rf->rf_maxdur=%u\n",j, rf->rf_pulseid, - rf->rf_numpulses, rf->rf_minpri, rf->rf_maxpri, rf->rf_threshold, rf->rf_filterlen, rf->rf_mindur, rf->rf_maxdur); - } - } - } -} - - -#endif /* ATH_SUPPORT_DFS */ diff --git a/drivers/net/wireless/ar6003/host/dfs/dfs_fcc_bin5.c b/drivers/net/wireless/ar6003/host/dfs/dfs_fcc_bin5.c deleted file mode 100644 index 07d42367a6fc..000000000000 --- a/drivers/net/wireless/ar6003/host/dfs/dfs_fcc_bin5.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2002-2010, Atheros Communications Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef ATH_SUPPORT_DFS -#include "dfs_host.h" - - -int dfs_bin5_addpulse(struct ath_dfs_host *dfs, struct dfs_bin5radars *br, - struct dfs_event *re, u_int64_t thists) -{ - u_int32_t index,stop; - u_int64_t tsDelta; - - /* Check if this pulse is a valid pulse in terms of repetition, - * if not, return without adding it to the queue. - * PRI : Pulse Repitetion Interval - * BRI : Burst Repitetion Interval */ - if( br->br_numelems != 0){ - index = br->br_lastelem; - tsDelta = thists - br->br_elems[index].be_ts; - if( (tsDelta < DFS_BIN5_PRI_LOWER_LIMIT) || - ( (tsDelta > DFS_BIN5_PRI_HIGHER_LIMIT) && - (tsDelta < DFS_BIN5_BRI_LOWER_LIMIT))) { - return 0; - } - } - /* Circular buffer of size 2^n */ - index = (br->br_lastelem +1) & DFS_MAX_B5_MASK; - br->br_lastelem = index; - if (br->br_numelems == DFS_MAX_B5_SIZE) - br->br_firstelem = (br->br_firstelem+1)&DFS_MAX_B5_MASK; - else - br->br_numelems++; - br->br_elems[index].be_ts = thists; - br->br_elems[index].be_rssi = re->re_rssi; - br->br_elems[index].be_dur = re->re_dur; - stop = 0; - index = br->br_firstelem; - while ((!stop) && (br->br_numelems-1) > 0) { - if ((thists - br->br_elems[index].be_ts) > - ((u_int64_t) br->br_pulse.b5_timewindow)) { - br->br_numelems--; - br->br_firstelem = (br->br_firstelem +1) & DFS_MAX_B5_MASK; - index = br->br_firstelem; - } else - stop = 1; - } - return 1; -} - -/* - * If the dfs structure is NULL (which should be illegal if everyting is working - * properly, then signify that a bin5 radar was found - */ - -int dfs_bin5_check(struct ath_dfs_host *dfs) -{ - struct dfs_bin5radars *br; - int index[DFS_MAX_B5_SIZE]; - u_int32_t n, i, this, prev, rssi_diff, width_diff, bursts= 0; - u_int32_t total_diff=0, average_diff, total_width=0, average_width, numevents=0; - u_int64_t pri; - - if (dfs == NULL) { - A_PRINTF("%s: sc_dfs is NULL\n", __func__); - return 1; - } - for (n=0;ndfs_rinfo.rn_numbin5radars; n++) { - br = &(dfs->dfs_b5radars[n]); - DFS_DPRINTK(dfs, ATH_DEBUG_DFS1, - "Num elems = %d\n", br->br_numelems); - prev = br->br_firstelem; - for(i=0;ibr_numelems;i++){ - this = ((br->br_firstelem +i) & DFS_MAX_B5_MASK); - /* Rule 1: 1000 <= PRI <= 2000 + some margin */ - if( br->br_elems[this].be_ts >= br->br_elems[prev].be_ts ) { - pri = br->br_elems[this].be_ts - br->br_elems[prev].be_ts; - } - else {//roll over case - //pri = (0xffffffffffffffff - br->br_elems[prev].be_ts) + br->br_elems[this].be_ts; - pri = br->br_elems[this].be_ts; - } - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2," pri=%llu this.ts=%llu prev.ts=%llu\n", pri, br->br_elems[this].be_ts, br->br_elems[prev].be_ts); - if(( (pri >= DFS_BIN5_PRI_LOWER_LIMIT) && (pri <= DFS_BIN5_PRI_HIGHER_LIMIT))) { //pri: pulse repitition interval in us - /* Rule 2: pulse width of the pulses in the burst should be same (+/- margin) */ - if( br->br_elems[this].be_dur >= br->br_elems[prev].be_dur) { - width_diff = br->br_elems[this].be_dur - br->br_elems[prev].be_dur; - } - else { - width_diff = br->br_elems[prev].be_dur - br->br_elems[this].be_dur; - } - if( width_diff <= DFS_BIN5_WIDTH_MARGIN ) { - /* Rule 3: RSSI of the pulses in the burst should be same (+/- margin) */ - if( br->br_elems[this].be_rssi >= br->br_elems[prev].be_rssi) { - rssi_diff = br->br_elems[this].be_rssi - br->br_elems[prev].be_rssi; - } - else { - rssi_diff = br->br_elems[prev].be_rssi - br->br_elems[this].be_rssi; - } - if( rssi_diff <= DFS_BIN5_RSSI_MARGIN ) { - bursts++; - /* Save the indexes of this pair for later width variance check */ - if( numevents >= 2 ) { - /* make sure the event is not duplicated, - * possible in a 3 pulse burst */ - if( index[numevents-1] != prev) { - index[numevents++] = prev; - } - } - else { - index[numevents++] = prev; } - index[numevents++] = this; - } else { - DFS_DPRINTK(dfs,ATH_DEBUG_DFS2,"%s %d Bin5 rssi_diff=%d\n", __func__, __LINE__, rssi_diff); - } - } else { - DFS_DPRINTK(dfs,ATH_DEBUG_DFS2,"%s %d Bin5 width_diff=%d\n", __func__, __LINE__, width_diff); - } - } else { - DFS_DPRINTK(dfs,ATH_DEBUG_DFS2,"%s %d Bin5 PRI check fail pri=%llu\n", __func__, __LINE__,pri); - } - prev = this; - } - - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, "bursts=%u numevents=%u\n", bursts, numevents); - if ( bursts >= br->br_pulse.b5_threshold) { - if( (br->br_elems[br->br_lastelem].be_ts - br->br_elems[br->br_firstelem].be_ts) < 3000000 ) { - return 0; - } - else { - for (i=0; ibr_elems[index[i]].be_dur; - } - average_width = total_width/numevents; - for (i=0; ibr_elems[index[i]].be_dur, average_width); - } - average_diff = total_diff/numevents; - if( average_diff > DFS_BIN5_WIDTH_MARGIN ) { - return 1; - } else { - - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, "bursts=%u numevents=%u total_width=%d average_width=%d total_diff=%d average_diff=%d\n", bursts, numevents, total_width, average_width, total_diff, average_diff); - - } - - } - } - } - - return 0; -} - - -u_int8_t dfs_retain_bin5_burst_pattern(struct ath_dfs_host *dfs, u_int32_t diff_ts, u_int8_t old_dur) -{ - - // Pulses may get split into 2 during chirping, this print is only to show that it happened, we do not handle this condition if we cannot detect the chirping - // SPLIT pulses will have a time stamp difference of < 50 - if (diff_ts < 50) { - DFS_DPRINTK(dfs,ATH_DEBUG_DFS1,"%s SPLIT pulse diffTs=%u dur=%d (old_dur=%d)\n", __func__, diff_ts, dfs->dfs_rinfo.dfs_last_bin5_dur, old_dur); - } - // Check if this is the 2nd or 3rd pulse in the same burst, PRI will be between 1000 and 2000 us - if(((diff_ts >= DFS_BIN5_PRI_LOWER_LIMIT) && (diff_ts <= DFS_BIN5_PRI_HIGHER_LIMIT))) { - - //This pulse belongs to the same burst as the pulse before, so return the same random duration for it - DFS_DPRINTK(dfs,ATH_DEBUG_DFS1,"%s this pulse belongs to the same burst as before, give it same dur=%d (old_dur=%d)\n", __func__, dfs->dfs_rinfo.dfs_last_bin5_dur, old_dur); - - return (dfs->dfs_rinfo.dfs_last_bin5_dur); - } - // This pulse does not belong to this burst, return unchanged duration - return old_dur; -} - - -#endif /* ATH_SUPPORT_DFS */ diff --git a/drivers/net/wireless/ar6003/host/dfs/dfs_host_project.c b/drivers/net/wireless/ar6003/host/dfs/dfs_host_project.c deleted file mode 100644 index 40dd5d31d337..000000000000 --- a/drivers/net/wireless/ar6003/host/dfs/dfs_host_project.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2002-2010, Atheros Communications Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef ATH_SUPPORT_DFS -#include "dfs_host.h" -#include "dfs_target_api.h" - -void dfs_radar_task (unsigned long arg) -{ - struct ath_dfs_host *dfs = (struct ath_dfs_host *)arg; - A_INT16 chan_index; - A_UINT8 bangradar; - - //printk("\n%s\n",__func__); - - if(dfs_process_radarevent_host(dfs, &chan_index, &bangradar)){ - if(!bangradar){ - DFS_DPRINTK(dfs, ATH_DEBUG_DFS, "%s: Radar detected on channel idx %d\n", - __func__, chan_index); - } - - /* TODO: The radar detected event is sent from host in timer - * context which could potentially cause issues with sleepable - * WMI. Change this to process context later. */ - DFS_RADAR_DETECTED(dfs->dev_hdl, chan_index, bangradar); - } - -} - -#endif /* ATH_SUPPORT_DFS */ - - diff --git a/drivers/net/wireless/ar6003/host/dfs/dfs_init.c b/drivers/net/wireless/ar6003/host/dfs/dfs_init.c deleted file mode 100644 index bddae9fbfbd8..000000000000 --- a/drivers/net/wireless/ar6003/host/dfs/dfs_init.c +++ /dev/null @@ -1,375 +0,0 @@ -/* - * Copyright (c) 2002-2010, Atheros Communications Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef ATH_SUPPORT_DFS -#include "dfs_host.h" -#include "dfs_target_api.h" - - -struct dfs_pulse ar6000_etsi_radars[] = { - /* TYPE 1 */ - {15, 2, 750, 750, 0, 24, 7, 0, 2, 21, 0, -10, 0}, - /* TYPE 2 */ - {10, 5, 200, 200, 0, 24, 5, 1, 9, 21, 0, 3, 1}, - {10, 5, 300, 300, 0, 24, 8, 1, 9, 21, 0, 3, 2}, - {10, 5, 500, 500, 0, 24, 8, 1, 9, 21, 1, 3, 3}, - {10, 5, 800, 800, 0, 24, 8, 1, 9, 21, 1, 3, 4}, - {10, 5, 1001, 1001, 0, 30, 8, 1, 9, 21, 0, 3, 5}, - /* TYPE 3 */ - {15, 16, 200, 200, 0, 24, 6, 10, 19, 22, 0, 3, 6}, - {15, 16, 300, 300, 0, 24, 6, 10, 19, 22, 0, 3, 7}, - {15, 16, 503, 503, 0, 24, 7, 10, 19, 22, 0, 3, 8}, - {15, 16, 809, 809, 0, 24, 7, 10, 19, 22, 0, 3, 9}, - {15, 16, 1014, 1014, 0, 30, 7, 10, 19, 22, 0, 3, 10}, - /* TYPE 4 */ - {15, 5, 1200, 1200, 0, 24, 7, 1, 9, 21, 0, 3, 11}, - {15, 5, 1500, 1500, 0, 30, 7, 1, 9, 21, 0, 3, 12}, - {15, 5, 1600, 1600, 0, 24, 7, 1, 9, 21, 0, 3, 13}, - {15, 16, 1200, 1200, 0, 30, 7, 10, 19, 22, 0, 3, 14}, - {15, 16, 1500, 1500, 0, 24, 7, 10, 19, 22, 0, 3, 15}, - {15, 16, 1600, 1600, 0, 24, 7, 10, 19, 22, 0, 3, 16}, - /* TYPE 5 */ - {25, 5, 2305, 2305, 0, 24, 12, 1, 9, 21, 0, 3, 17}, - {25, 5, 3009, 3009, 0, 24, 12, 1, 9, 21, 0, 3, 18}, - {25, 5, 3500, 3500, 0, 24, 12, 1, 9, 21, 0, 3, 19}, - {25, 5, 4000, 4000, 0, 24, 12, 1, 9, 21, 0, 3, 20}, - {25, 16, 2300, 2300, 0, 24, 12, 10, 20, 22, 0, 3, 21}, - {25, 16, 3000, 3000, 0, 24, 12, 10, 20, 22, 0, 3, 22}, - {25, 16, 3500, 3500, 0, 24, 12, 10, 20, 22, 0, 3, 23}, - {25, 16, 3850, 3850, 0, 24, 12, 10, 20, 22, 0, 3, 24}, - /* TYPE 6 */ - {20, 25, 2000, 2000, 0, 24, 10, 20, 26, 22, 0, 3, 25}, - {20, 25, 3000, 3000, 0, 24, 10, 20, 26, 22, 0, 3, 26}, - {20, 25, 4000, 4000, 0, 24, 10, 20, 26, 22, 0, 3, 27}, - {20, 37, 2000, 2000, 0, 24, 10, 30, 36, 22, 0, 3, 28}, - {20, 37, 3000, 3000, 0, 24, 10, 30, 36, 22, 0, 3, 29}, - {20, 37, 4000, 4000, 0, 24, 10, 30, 36, 22, 0, 3, 30}, - - /* TYPE staggered pulse */ - {20, 2, 300, 400, 2, 30, 10, 0, 2, 22, 0, 3, 31}, //0.8-2us, 2-3 bursts,300-400 PRF, 10 pulses each - {30, 2, 400, 1200, 2, 30, 15, 0, 2, 22, 0, 3, 32}, //0.8-2us, 2-3 bursts, 400-1200 PRF, 15 pulses each - - /* constant PRF based */ - {10, 5, 200, 1000, 0, 24, 6, 0, 8, 21, 0, -10, 33}, /*0.8-5us , 200-1000 PRF, 10 pulses */ - {15, 15, 200, 1600, 0, 24, 7, 0, 18, 21, 0, -10, 34}, /*0.8-15us , 200-1600 PRF, 15 pulses */ - {25, 15, 2300, 4000, 0, 24, 12, 0, 18, 21, 0, -10, 35}, /* 0.8-15 us, 2300-4000 PRF, 25 pulses*/ - {20, 30, 2000, 4000, 0, 24, 10, 19, 33, 21, 0, -10, 36}, /* 20-30us, 2000-4000 PRF, 20 pulses*/ - -}; - -/* The following are for FCC Bin 1-4 pulses */ -struct dfs_pulse ar6000_fcc_radars[] = { - /* following two filters are specific to Japan/MKK4 */ - {18, 1, 720, 720, 1, 6, 6, 0, 1, 18, 0, 3, 17}, // 1389 +/- 6 us - {18, 4, 250, 250, 1, 10, 5, 1, 6, 18, 0, 3, 18}, // 4000 +/- 6 us - {18, 5, 260, 260, 1, 10, 6, 1, 6, 18, 0, 3, 19}, // 3846 +/- 7 us - /* following filters are common to both FCC and JAPAN */ - {18, 1, 325, 1930, 0, 6, 7, 0, 1, 18, 0, 3, 0}, // 1428 +/- 7 us - {9, 1, 3003, 3003, 1, 7, 5, 0, 1, 18, 0, 0, 1}, // 333 +/- 7 us - - {23, 5, 6250, 6250, 0, 15, 11, 0, 7, 22, 0, 3, 2}, // 160 +/- 15 us - {23, 5, 5263, 5263, 0, 18, 11, 0, 7, 22, 0, 3, 3}, // 190 +/- 15 us - {23, 5, 4545, 4545, 0, 18, 11, 0, 7, 22, 0, 3, 4}, // 220 +/- 15 us - - {18, 10, 4444, 4444, 0, 35, 6, 7, 13, 22, 0, 3, 5}, // 225 +/- 30 us - {18, 10, 3636, 3636, 0, 25, 6, 7, 13, 22, 0, 3, 6}, // 275 +/- 25 us - {18, 10, 3076, 3076, 0, 25, 8, 7, 13, 22, 0, 3, 7}, // 325 +/- 25 us - {18, 10, 2666, 2666, 0, 25, 8, 7, 13, 22, 0, 3, 8}, // 375 +/- 25 us - {18, 10, 2352, 2352, 0, 25, 8, 7, 13, 22, 0, 3, 9}, // 425 +/- 25 us - {18, 10, 2105, 2105, 0, 30, 8, 7, 13, 22, 0, 3, 10}, // 475 +/- 30 us - - {14, 15, 4444, 4444, 0, 35, 5, 13, 21, 22, 0, 3, 11}, // 225 +/- 30 us - {14, 15, 3636, 3636, 0, 25, 5, 13, 24, 22, 0, 3, 12}, // 275 +/- 25 us - {14, 15, 3076, 3076, 0, 25, 7, 13, 23, 22, 0, 3, 13}, // 325 +/- 25 us - {14, 15, 2666, 2666, 0, 25, 7, 13, 23, 22, 0, 3, 14}, // 375 +/- 25 us - {14, 15, 2352, 2352, 0, 25, 7, 13, 21, 22, 0, 3, 15}, // 425 +/- 25 us - {12, 15, 2105, 2105, 0, 30, 7, 13, 21, 22, 0, 3, 16}, // 475 +/- 30 us -}; - -struct dfs_bin5pulse ar6000_bin5pulses[] = { - {4, 28, 105, 12, 22, 5}, -}; - -/* - * Clear all delay lines for all filter types - */ -void dfs_reset_alldelaylines(struct ath_dfs_host *dfs) -{ - struct dfs_filtertype *ft = NULL; - struct dfs_filter *rf; - struct dfs_delayline *dl; - struct dfs_pulseline *pl; - int i,j; - - if (dfs == NULL) { - A_PRINTF("%s: sc_dfs is NULL\n", __func__); - return; - } - - pl = dfs->pulses; - /* reset the pulse log */ - pl->pl_firstelem = pl->pl_numelems = 0; - pl->pl_lastelem = DFS_MAX_PULSE_BUFFER_MASK; - - for (i=0; idfs_radarf[i] != NULL) { - ft = dfs->dfs_radarf[i]; - for (j=0; jft_numfilters; j++) { - rf = &(ft->ft_filters[j]); - dl = &(rf->rf_dl); - if(dl != NULL) { - OS_MEMZERO(dl, sizeof(struct dfs_delayline)); - dl->dl_lastelem = (0xFFFFFFFF) & DFS_MAX_DL_MASK; - } - } - } - } - for (i=0; idfs_rinfo.rn_numbin5radars; i++) { - OS_MEMZERO(&(dfs->dfs_b5radars[i].br_elems[0]), sizeof(struct dfs_bin5elem)*DFS_MAX_B5_SIZE); - dfs->dfs_b5radars[i].br_firstelem = 0; - dfs->dfs_b5radars[i].br_numelems = 0; - dfs->dfs_b5radars[i].br_lastelem = (0xFFFFFFFF)&DFS_MAX_B5_MASK; - } -} -/* - * Clear only a single delay line - */ - -void dfs_reset_delayline(struct dfs_delayline *dl) -{ - OS_MEMZERO(&(dl->dl_elems[0]), sizeof(dl->dl_elems)); - dl->dl_lastelem = (0xFFFFFFFF)&DFS_MAX_DL_MASK; -} - -void dfs_reset_filter_delaylines(struct dfs_filtertype *dft) -{ - int i; - struct dfs_filter *df; - for (i=0; i< DFS_MAX_NUM_RADAR_FILTERS; i++) { - df = &dft->ft_filters[i]; - dfs_reset_delayline(&(df->rf_dl)); - } -} - -void -dfs_reset_radarq(struct ath_dfs_host *dfs) -{ - struct dfs_event *event; - if (dfs == NULL) { - A_PRINTF("%s: sc_dfs is NULL\n", __func__); - return; - } - ATH_DFSQ_LOCK(dfs); - ATH_DFSEVENTQ_LOCK(dfs); - while (!STAILQ_EMPTY(&(dfs->dfs_radarq))) { - event = STAILQ_FIRST(&(dfs->dfs_radarq)); - STAILQ_REMOVE_HEAD(&(dfs->dfs_radarq), re_list); - OS_MEMZERO(event, sizeof(struct dfs_event)); - STAILQ_INSERT_TAIL(&(dfs->dfs_eventq), event, re_list); - } - ATH_DFSEVENTQ_UNLOCK(dfs); - ATH_DFSQ_UNLOCK(dfs); -} - -struct dfs_pulse *dfs_get_radars(u_int32_t dfsdomain, u_int32_t *numradars, struct dfs_bin5pulse **bin5pulses, u_int32_t *numb5radars) -{ -#define N(a) (sizeof(a)/sizeof(a[0])) - struct dfs_pulse *dfs_radars = NULL; - switch (dfsdomain) { - case DFS_FCC_DOMAIN: - dfs_radars = &ar6000_fcc_radars[3]; - *numradars= N(ar6000_fcc_radars)-3; - *bin5pulses = &ar6000_bin5pulses[0]; - *numb5radars = N(ar6000_bin5pulses); - break; - case DFS_ETSI_DOMAIN: - dfs_radars = &ar6000_etsi_radars[0]; - *numradars = N(ar6000_etsi_radars); - *bin5pulses = &ar6000_bin5pulses[0]; - *numb5radars = N(ar6000_bin5pulses); - break; - case DFS_MKK4_DOMAIN: - dfs_radars = &ar6000_fcc_radars[0]; - *numradars = N(ar6000_fcc_radars); - *bin5pulses = &ar6000_bin5pulses[0]; - *numb5radars = N(ar6000_bin5pulses); - break; - default: - return NULL; - } - - return dfs_radars; - -#undef N - -} - -int dfs_init_radar_filters_host( struct ath_dfs_host *dfs, struct ath_dfs_info *dfs_info) -{ - u_int32_t T, Tmax; - int numpulses,p,n, i; - struct dfs_filtertype *ft = NULL; - struct dfs_filter *rf=NULL; - struct dfs_pulse *dfs_radars; - struct dfs_bin5pulse *b5pulses; - int32_t min_rssithresh=DFS_MAX_RSSI_VALUE; - u_int32_t max_pulsedur=0; - u_int32_t numb5radars; - u_int32_t numradars; - - dfs_radars = dfs_get_radars(dfs_info->dfs_domain, &numradars, &b5pulses, &numb5radars); - /* If DFS not enabled return immediately.*/ - if (!dfs_radars) { - return 0; - } - - dfs->dfs_rinfo.rn_numradars = 0; - - /* Clear filter type table */ - for (n=0; n<256; n++) { - for (i=0;idfs_radartable[n])[i] = -1; - } - - /* Now, initialize the radar filters */ - for (p=0; p < numradars; p++) { - ft = NULL; - for (n=0; ndfs_rinfo.rn_numradars; n++) { - if ((dfs_radars[p].rp_pulsedur == dfs->dfs_radarf[n]->ft_filterdur) && - (dfs_radars[p].rp_numpulses == dfs->dfs_radarf[n]->ft_numpulses) && - (dfs_radars[p].rp_mindur == dfs->dfs_radarf[n]->ft_mindur) && - (dfs_radars[p].rp_maxdur == dfs->dfs_radarf[n]->ft_maxdur)) { - ft = dfs->dfs_radarf[n]; - break; - } - } - if (ft == NULL) { - /* No filter of the appropriate dur was found */ - if ((dfs->dfs_rinfo.rn_numradars+1) >DFS_MAX_RADAR_TYPES) { - DFS_DPRINTK(dfs, ATH_DEBUG_DFS, "%s: Too many filter types\n", - __func__); - goto bad4; - } - - ft = dfs->dfs_radarf[dfs->dfs_rinfo.rn_numradars]; - ft->ft_numfilters = 0; - ft->ft_numpulses = dfs_radars[p].rp_numpulses; - ft->ft_patterntype = dfs_radars[p].rp_patterntype; - ft->ft_mindur = dfs_radars[p].rp_mindur; - ft->ft_maxdur = dfs_radars[p].rp_maxdur; - ft->ft_filterdur = dfs_radars[p].rp_pulsedur; - ft->ft_rssithresh = dfs_radars[p].rp_rssithresh; - ft->ft_rssimargin = dfs_radars[p].rp_rssimargin; - ft->ft_minpri = 1000000; - - if (ft->ft_rssithresh < min_rssithresh) - min_rssithresh = ft->ft_rssithresh; - if (ft->ft_maxdur > max_pulsedur) - max_pulsedur = ft->ft_maxdur; - for (i=ft->ft_mindur; i<=ft->ft_maxdur; i++) { - u_int32_t stop=0,tableindex=0; - while ((tableindex < DFS_MAX_RADAR_OVERLAP) && (!stop)) { - if ((dfs->dfs_radartable[i])[tableindex] == -1) - stop = 1; - else - tableindex++; - } - if (stop) { - (dfs->dfs_radartable[i])[tableindex] = - (int8_t) (dfs->dfs_rinfo.rn_numradars); - } else { - DFS_DPRINTK(dfs, ATH_DEBUG_DFS, - "%s: Too many overlapping radar filters\n", - __func__); - goto bad4; - } - } - dfs->dfs_rinfo.rn_numradars++; - } - rf = &(ft->ft_filters[ft->ft_numfilters++]); - dfs_reset_delayline(&rf->rf_dl); - numpulses = dfs_radars[p].rp_numpulses; - - rf->rf_numpulses = numpulses; - rf->rf_patterntype = dfs_radars[p].rp_patterntype; - rf->rf_pulseid = dfs_radars[p].rp_pulseid; - rf->rf_mindur = dfs_radars[p].rp_mindur; - rf->rf_maxdur = dfs_radars[p].rp_maxdur; - rf->rf_numpulses = dfs_radars[p].rp_numpulses; - - T = (100000000/dfs_radars[p].rp_max_pulsefreq) - - 100*(dfs_radars[p].rp_meanoffset); - rf->rf_minpri = - dfs_round((int32_t)T - (100*(dfs_radars[p].rp_pulsevar))); - Tmax = (100000000/dfs_radars[p].rp_pulsefreq) - - 100*(dfs_radars[p].rp_meanoffset); - rf->rf_maxpri = - dfs_round((int32_t)Tmax + (100*(dfs_radars[p].rp_pulsevar))); - - if( rf->rf_minpri < ft->ft_minpri ) - ft->ft_minpri = rf->rf_minpri; - - rf->rf_threshold = dfs_radars[p].rp_threshold; - rf->rf_filterlen = rf->rf_maxpri * rf->rf_numpulses; - - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, "minprf = %d maxprf = %d pulsevar = %d thresh=%d\n", - dfs_radars[p].rp_pulsefreq, dfs_radars[p].rp_max_pulsefreq, dfs_radars[p].rp_pulsevar, rf->rf_threshold); - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, - "minpri = %d maxpri = %d filterlen = %d filterID = %d\n", - rf->rf_minpri, rf->rf_maxpri, rf->rf_filterlen, rf->rf_pulseid); - } - -#ifdef DFS_DEBUG - dfs_print_filters(dfs); -#endif - - dfs->dfs_rinfo.rn_numbin5radars = numb5radars; - if ( dfs->dfs_b5radars == NULL ) { - dfs->dfs_b5radars = (struct dfs_bin5radars *)DFS_MALLOC(dfs->os_hdl, numb5radars * sizeof(struct dfs_bin5radars)); - if (dfs->dfs_b5radars == NULL) { - DFS_DPRINTK(dfs, ATH_DEBUG_DFS, - "%s: cannot allocate memory for bin5 radars\n", - __func__); - goto bad4; - } - } - for (n=0; ndfs_b5radars[n].br_pulse = b5pulses[n]; - dfs->dfs_b5radars[n].br_pulse.b5_timewindow *= 1000000; - if (dfs->dfs_b5radars[n].br_pulse.b5_rssithresh < min_rssithresh) - min_rssithresh = dfs->dfs_b5radars[n].br_pulse.b5_rssithresh; - if (dfs->dfs_b5radars[n].br_pulse.b5_maxdur > max_pulsedur ) - max_pulsedur = dfs->dfs_b5radars[n].br_pulse.b5_maxdur; - } - dfs_reset_alldelaylines(dfs); - dfs_reset_radarq(dfs); - - DFS_SET_MINRSSITHRESH(dfs->dev_hdl, min_rssithresh); - DFS_SET_MAXPULSEDUR(dfs->dev_hdl, dfs_round((int32_t)((max_pulsedur*100/80)*100))); - - - return 0; - -bad4: - for (n=0; nft_numfilters; n++) { - rf = &(ft->ft_filters[n]); - } - return 1; -} - - - -#endif /* ATH_SUPPORT_DFS */ diff --git a/drivers/net/wireless/ar6003/host/dfs/dfs_misc.c b/drivers/net/wireless/ar6003/host/dfs/dfs_misc.c deleted file mode 100644 index f0036c55dd7f..000000000000 --- a/drivers/net/wireless/ar6003/host/dfs/dfs_misc.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2002-2010, Atheros Communications Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef ATH_SUPPORT_DFS -#include "dfs_host.h" - -int adjust_pri_per_chan_busy(int ext_chan_busy, int pri_margin) -{ - int adjust_pri=0; - - if(ext_chan_busy > DFS_EXT_CHAN_LOADING_THRESH) { - - adjust_pri = (ext_chan_busy - DFS_EXT_CHAN_LOADING_THRESH) * (pri_margin); - adjust_pri /= 100; - - } - return adjust_pri; -} - -int adjust_thresh_per_chan_busy(int ext_chan_busy, int thresh) -{ - int adjust_thresh=0; - - if(ext_chan_busy > DFS_EXT_CHAN_LOADING_THRESH) { - - adjust_thresh = (ext_chan_busy - DFS_EXT_CHAN_LOADING_THRESH) * thresh; - adjust_thresh /= 100; - - } - return adjust_thresh; -} -/* For the extension channel, if legacy traffic is present, we see a lot of false alarms, -so make the PRI margin narrower depending on the busy % for the extension channel.*/ - -int dfs_get_pri_margin(int is_extchan_detect, int is_fixed_pattern, u_int64_t lastfull_ts, u_int32_t ext_chan_busy) -{ - - int adjust_pri=0; - int pri_margin; - // struct ath_dfs_target *dfs = sc->sc_dfs_tgt; - - if (is_fixed_pattern) - pri_margin = DFS_DEFAULT_FIXEDPATTERN_PRI_MARGIN; - else - pri_margin = DFS_DEFAULT_PRI_MARGIN; - - - /*XXX: Does cached value make sense here? */ -#if 0 - if(ext_chan_busy) { - dfs->dfs_rinfo.ext_chan_busy_ts = ath_hal_gettsf64(sc->sc_ah); - dfs->dfs_rinfo.dfs_ext_chan_busy = ext_chan_busy; - } else { - // Check to see if the cached value of ext_chan_busy can be used - if (dfs->dfs_rinfo.dfs_ext_chan_busy) { - if (lastfull_ts < dfs->dfs_rinfo.ext_chan_busy_ts) { - ext_chan_busy = dfs->dfs_rinfo.dfs_ext_chan_busy; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2," PRI Use cached copy of ext_chan_busy extchanbusy=%d \n", ext_chan_busy); - } - } - } -#endif - adjust_pri = adjust_pri_per_chan_busy(ext_chan_busy, pri_margin); - - pri_margin -= adjust_pri; - return pri_margin; -} - -/* For the extension channel, if legacy traffic is present, we see a lot of false alarms, -so make the thresholds higher depending on the busy % for the extension channel.*/ - -int dfs_get_filter_threshold(struct dfs_filter *rf, int is_extchan_detect, u_int64_t lastfull_ts, u_int32_t ext_chan_busy) -{ - int thresh, adjust_thresh=0; - // struct ath_dfs_target *dfs = sc->sc_dfs_tgt; - - thresh = rf->rf_threshold; - - /*XXX: Does cached value make sense here? */ -#if 0 - if(ext_chan_busy) { - dfs->dfs_rinfo.ext_chan_busy_ts = ath_hal_gettsf64(sc->sc_ah); - dfs->dfs_rinfo.dfs_ext_chan_busy = ext_chan_busy; - } else { - // Check to see if the cached value of ext_chan_busy can be used - if (dfs->dfs_rinfo.dfs_ext_chan_busy) { - if (lastfull_ts < dfs->dfs_rinfo.ext_chan_busy_ts) { - ext_chan_busy = dfs->dfs_rinfo.dfs_ext_chan_busy; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2," THRESH Use cached copy of ext_chan_busy extchanbusy=%d lastfull_ts=%llu ext_chan_busy_ts=%llu\n", ext_chan_busy ,lastfull_ts, dfs->dfs_rinfo.ext_chan_busy_ts); - } - } - } -#endif - adjust_thresh = adjust_thresh_per_chan_busy(ext_chan_busy, thresh); - - //DFS_DPRINTK(dfs, ATH_DEBUG_DFS2," filterID=%d extchanbusy=%d adjust_thresh=%d\n", rf->rf_pulseid, ext_chan_busy, adjust_thresh); - - thresh += adjust_thresh; - return thresh; -} - - - - - - -#endif /* ATH_SUPPORT_DFS */ diff --git a/drivers/net/wireless/ar6003/host/dfs/dfs_process_phyerr.c b/drivers/net/wireless/ar6003/host/dfs/dfs_process_phyerr.c deleted file mode 100644 index 1968731391be..000000000000 --- a/drivers/net/wireless/ar6003/host/dfs/dfs_process_phyerr.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2002-2010, Atheros Communications Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef ATH_SUPPORT_DFS -#include "dfs_host.h" -void -dfs_queue_phyerr(struct ath_dfs_host *dfs, struct dfs_event_info *ev_info); - - -void -dfs_process_phyerr_host(struct ath_dfs_host *dfs, WMI_DFS_PHYERR_EVENT *ev) -{ - int i; - for(i=0; inum_events; i++) - dfs_queue_phyerr(dfs, &ev->ev_info[i]); -} - -void -dfs_queue_phyerr(struct ath_dfs_host *dfs, struct dfs_event_info *ev_info) -{ - struct dfs_event *event; - int empty; - - ATH_DFSEVENTQ_LOCK(dfs); - empty = STAILQ_EMPTY(&(dfs->dfs_eventq)); - ATH_DFSEVENTQ_UNLOCK(dfs); - if (empty) { - return; - } - - /* XXX: Lot of common code. Optimize */ - - if((ev_info->flags & EVENT_TYPE_MASK) == AR_EVENT){ - ATH_DFSEVENTQ_LOCK(dfs); - event = STAILQ_FIRST(&(dfs->dfs_eventq)); - if (event == NULL) { - ATH_DFSEVENTQ_UNLOCK(dfs); - DFS_DPRINTK(dfs, ATH_DEBUG_DFS, "%s: no more events space left\n", - __func__); - return; - } - STAILQ_REMOVE_HEAD(&(dfs->dfs_eventq), re_list); - ATH_DFSEVENTQ_UNLOCK(dfs); - event->re_rssi = ev_info->rssi; - event->re_dur = ev_info->dur; - event->re_full_ts = ev_info->full_ts; - event->re_ts = ev_info->ts; - event->re_chanindex = ev_info->chanindex; - event->re_chanindextype = ev_info->flags & CH_TYPE_MASK; - ATH_ARQ_LOCK(dfs); - STAILQ_INSERT_TAIL(&(dfs->dfs_arq), event, re_list); - ATH_ARQ_UNLOCK(dfs); - } - else { /* DFS event */ - ATH_DFSEVENTQ_LOCK(dfs); - event = STAILQ_FIRST(&(dfs->dfs_eventq)); - if (event == NULL) { - ATH_DFSEVENTQ_UNLOCK(dfs); - DFS_DPRINTK(dfs, ATH_DEBUG_DFS, "%s: no more events space left\n", - __func__); - return; - } - STAILQ_REMOVE_HEAD(&(dfs->dfs_eventq), re_list); - ATH_DFSEVENTQ_UNLOCK(dfs); - event->re_rssi = ev_info->rssi; - event->re_dur = ev_info->dur; - event->re_full_ts = ev_info->full_ts; - event->re_ts = ev_info->ts; - event->re_chanindex = ev_info->chanindex; - event->re_chanindextype = ev_info->flags & CH_TYPE_MASK; - event->re_ext_chan_busy = ev_info->ext_chan_busy; - - ATH_DFSQ_LOCK(dfs); - STAILQ_INSERT_TAIL(&(dfs->dfs_radarq), event, re_list); - ATH_DFSQ_UNLOCK(dfs); - } - - /* TODO: The radar detected event is sent from host in timer - * context which could potentially cause issues with sleepable - * WMI. Change this to process context later. */ - - A_TIMEOUT_MS(&dfs->dfs_radar_task_timer, 0, 0); - -} - -#endif /* ATH_SUPPORT_DFS */ diff --git a/drivers/net/wireless/ar6003/host/dfs/dfs_process_radarevent.c b/drivers/net/wireless/ar6003/host/dfs/dfs_process_radarevent.c deleted file mode 100644 index 9ebe19bb33a1..000000000000 --- a/drivers/net/wireless/ar6003/host/dfs/dfs_process_radarevent.c +++ /dev/null @@ -1,316 +0,0 @@ -/* - * Copyright (c) 2002-2010, Atheros Communications Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef ATH_SUPPORT_DFS -#include "dfs_host.h" - -static char debug_dup[33]; -static int debug_dup_cnt; - -u_int32_t dfs_round(int32_t val) -{ - u_int32_t ival,rem; - - if (val < 0) - return 0; - ival = val/100; - rem = val-(ival*100); - if (rem <50) - return ival; - else - return(ival+1); -} - - -static inline u_int8_t -dfs_process_pulse_dur(struct ath_dfs_host *dfs, u_int8_t re_dur) -{ - if (re_dur == 0) { - return 1; - } else { - /* Convert 0.8us durations to TSF ticks (usecs) */ - return (u_int8_t)dfs_round((int32_t)((dfs->dur_multiplier)*re_dur)); - } -} - -int -dfs_process_radarevent_host(struct ath_dfs_host *dfs, int16_t *chan_index, u_int8_t *bangradar) -{ - struct dfs_event re,*event; - struct dfs_filtertype *ft; - struct dfs_filter *rf; - int found, retval=0,p, empty; - int events_processed=0; - u_int32_t tabledepth, index; - u_int64_t deltafull_ts = 0,this_ts, deltaT; - struct dfs_pulseline *pl; - static u_int32_t test_ts = 0; - static u_int32_t diff_ts = 0; - - int ext_chan_event_flag=0; - - if (dfs == NULL) { - A_PRINTF("%s: sc_sfs is NULL\n", __func__); - return 0; - } - pl = dfs->pulses; - /* TEST : Simulate radar bang, make sure we add the channel to NOL (bug 29968) */ - if (dfs->dfs_bangradar) { - /* bangradar will always simulate radar found on the primary channel */ - *bangradar = 1; - dfs->dfs_bangradar = 0; /* reset */ - DFS_DPRINTK(dfs, ATH_DEBUG_DFS, "%s: bangradar\n", __func__); - retval = 1; - } - else - *bangradar = 0; - - ATH_DFSQ_LOCK(dfs); - empty = STAILQ_EMPTY(&(dfs->dfs_radarq)); - ATH_DFSQ_UNLOCK(dfs); - - while ((!empty) && (!retval) && (events_processed < MAX_EVENTS)) { - ATH_DFSQ_LOCK(dfs); - event = STAILQ_FIRST(&(dfs->dfs_radarq)); - if (event != NULL) - STAILQ_REMOVE_HEAD(&(dfs->dfs_radarq), re_list); - ATH_DFSQ_UNLOCK(dfs); - - if (event == NULL) { - empty = 1; - break; - } - events_processed++; - re = *event; - - OS_MEMZERO(event, sizeof(struct dfs_event)); - ATH_DFSEVENTQ_LOCK(dfs); - STAILQ_INSERT_TAIL(&(dfs->dfs_eventq), event, re_list); - ATH_DFSEVENTQ_UNLOCK(dfs); - - found = 0; - if (re.re_chanindex < DFS_NUM_RADAR_STATES) - *chan_index = re.re_chanindex; - else { - ATH_DFSQ_LOCK(dfs); - empty = STAILQ_EMPTY(&(dfs->dfs_radarq)); - ATH_DFSQ_UNLOCK(dfs); - continue; - } - - if (dfs->dfs_rinfo.rn_lastfull_ts == 0) { - /* - * Either not started, or 64-bit rollover exactly to zero - * Just prepend zeros to the 15-bit ts - */ - dfs->dfs_rinfo.rn_ts_prefix = 0; - this_ts = (u_int64_t) re.re_ts; - } else { - /* WAR 23031- patch duplicate ts on very short pulses */ - /* This pacth has two problems in linux environment. - * 1)The time stamp created and hence PRI depends entirely on the latency. - * If the latency is high, it possibly can split two consecutive - * pulses in the same burst so far away (the same amount of latency) - * that make them look like they are from differenct bursts. It is - * observed to happen too often. It sure makes the detection fail. - * 2)Even if the latency is not that bad, it simply shifts the duplicate - * timestamps to a new duplicate timestamp based on how they are processed. - * This is not worse but not good either. - * - * Take this pulse as a good one and create a probable PRI later - */ - if (re.re_dur == 0 && re.re_ts == dfs->dfs_rinfo.rn_last_unique_ts) { - debug_dup[debug_dup_cnt++] = '1'; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS1, "\n %s deltaT is 0 \n", __func__); - } else { - dfs->dfs_rinfo.rn_last_unique_ts = re.re_ts; - debug_dup[debug_dup_cnt++] = '0'; - } - if (debug_dup_cnt >= 32){ - debug_dup_cnt = 0; - } - - - if (re.re_ts <= dfs->dfs_rinfo.rn_last_ts) { - dfs->dfs_rinfo.rn_ts_prefix += - (((u_int64_t) 1) << DFS_TSSHIFT); - /* Now, see if it's been more than 1 wrap */ - deltafull_ts = re.re_full_ts - dfs->dfs_rinfo.rn_lastfull_ts; - if (deltafull_ts > - ((u_int64_t)((DFS_TSMASK - dfs->dfs_rinfo.rn_last_ts) + 1 + re.re_ts))) - deltafull_ts -= (DFS_TSMASK - dfs->dfs_rinfo.rn_last_ts) + 1 + re.re_ts; - deltafull_ts = deltafull_ts >> DFS_TSSHIFT; - if (deltafull_ts > 1) { - dfs->dfs_rinfo.rn_ts_prefix += - ((deltafull_ts - 1) << DFS_TSSHIFT); - } - } else { - deltafull_ts = re.re_full_ts - dfs->dfs_rinfo.rn_lastfull_ts; - if (deltafull_ts > (u_int64_t) DFS_TSMASK) { - deltafull_ts = deltafull_ts >> DFS_TSSHIFT; - dfs->dfs_rinfo.rn_ts_prefix += - ((deltafull_ts - 1) << DFS_TSSHIFT); - } - } - this_ts = dfs->dfs_rinfo.rn_ts_prefix | ((u_int64_t) re.re_ts); - } - dfs->dfs_rinfo.rn_lastfull_ts = re.re_full_ts; - dfs->dfs_rinfo.rn_last_ts = re.re_ts; - - re.re_dur = dfs_process_pulse_dur(dfs, re.re_dur); - if (re.re_dur != 1) { - this_ts -= re.re_dur; - } - - /* Save the pulse parameters in the pulse buffer(pulse line) */ - index = (pl->pl_lastelem + 1) & DFS_MAX_PULSE_BUFFER_MASK; - if (pl->pl_numelems == DFS_MAX_PULSE_BUFFER_SIZE) - pl->pl_firstelem = (pl->pl_firstelem+1) & DFS_MAX_PULSE_BUFFER_MASK; - else - pl->pl_numelems++; - pl->pl_lastelem = index; - pl->pl_elems[index].p_time = this_ts; - pl->pl_elems[index].p_dur = re.re_dur; - pl->pl_elems[index].p_rssi = re.re_rssi; - diff_ts = (u_int32_t)this_ts - test_ts; - test_ts = (u_int32_t)this_ts; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS1,"ts%u %u %u diff %u pl->pl_lastelem.p_time=%llu\n",(u_int32_t)this_ts, re.re_dur, re.re_rssi, diff_ts, (unsigned long long)pl->pl_elems[index].p_time); - - found = 0; - for (p=0; (pdfs_rinfo.rn_numbin5radars)&&(!found); p++) { - struct dfs_bin5radars *br; - u_int32_t b5_rssithresh; - br = &(dfs->dfs_b5radars[p]); - b5_rssithresh = br->br_pulse.b5_rssithresh; - - /* Adjust the filter threshold for rssi in non TURBO mode*/ - //XXX: If turbo mode, ar events would be used? - //if( ! (sc->sc_curchan.channelFlags & CHANNEL_TURBO) ) { - b5_rssithresh += br->br_pulse.b5_rssimargin; - //} - - if ((re.re_dur >= br->br_pulse.b5_mindur) && - (re.re_dur <= br->br_pulse.b5_maxdur) && - (re.re_rssi >= b5_rssithresh)) { - - // This is a valid Bin5 pulse, check if it belongs to a burst - re.re_dur = dfs_retain_bin5_burst_pattern(dfs, diff_ts, re.re_dur); - // Remember our computed duration for the next pulse in the burst (if needed) - dfs->dfs_rinfo.dfs_bin5_chirp_ts = this_ts; - dfs->dfs_rinfo.dfs_last_bin5_dur = re.re_dur; - - - if( dfs_bin5_addpulse(dfs, br, &re, this_ts) ) { - found |= dfs_bin5_check(dfs); - } - } else - DFS_DPRINTK(dfs, ATH_DEBUG_DFS3, "%s too low to be Bin5 pulse (%d)\n", __func__, re.re_dur); - } - if (found) { - DFS_DPRINTK(dfs, ATH_DEBUG_DFS, "%s: Found bin5 radar\n", __func__); - retval |= found; - goto dfsfound; - } - tabledepth = 0; - rf = NULL; - - while ((tabledepth < DFS_MAX_RADAR_OVERLAP) && - ((dfs->dfs_radartable[re.re_dur])[tabledepth] != -1) && - (!retval)) { - ft = dfs->dfs_radarf[((dfs->dfs_radartable[re.re_dur])[tabledepth])]; - - if (re.re_rssi < ft->ft_rssithresh && re.re_dur > 4) { - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2,"%s : Rejecting on rssi rssi=%u thresh=%u\n", __func__, re.re_rssi, ft->ft_rssithresh); - tabledepth++; - ATH_DFSQ_LOCK(dfs); - empty = STAILQ_EMPTY(&(dfs->dfs_radarq)); - ATH_DFSQ_UNLOCK(dfs); - continue; - } - deltaT = this_ts - ft->ft_last_ts; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2,"deltaT = %lld (ts: 0x%llx) (last ts: 0x%llx)\n",(unsigned long long)deltaT, (unsigned long long)this_ts, (unsigned long long)ft->ft_last_ts); - if ((deltaT < ft->ft_minpri) && (deltaT !=0)){ - /* This check is for the whole filter type. Individual filters - will check this again. This is first line of filtering.*/ - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, "%s: Rejecting on pri pri=%lld minpri=%u\n", __func__, (unsigned long long)deltaT, ft->ft_minpri); - tabledepth++; - continue; - } - for (p=0, found = 0; (pft_numfilters) && (!found); p++) { - rf = &(ft->ft_filters[p]); - if ((re.re_dur >= rf->rf_mindur) && (re.re_dur <= rf->rf_maxdur)) { - /* The above check is probably not necessary */ - deltaT = this_ts - rf->rf_dl.dl_last_ts; - if (deltaT < 0) - deltaT = (int64_t) ((DFS_TSF_WRAP - rf->rf_dl.dl_last_ts) + this_ts +1); - if ((deltaT < rf->rf_minpri) && (deltaT != 0)) { - /* Second line of PRI filtering. */ - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, - "filterID %d : Rejecting on individual filter min PRI deltaT=%lld rf->rf_minpri=%u\n", - rf->rf_pulseid, (unsigned long long)deltaT, rf->rf_minpri); - continue; - } - - if ((rf->rf_patterntype==2) && (deltaT > rf->rf_maxpri) ) { - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, - "filterID %d : Staggered - Rejecting on individual filter max PRI deltaT=%lld rf->rf_maxpri=%u\n", - rf->rf_pulseid, (unsigned long long)deltaT, rf->rf_maxpri); - /* But update the last time stamp */ - rf->rf_dl.dl_last_ts = this_ts; - continue; - } - - if ((rf->rf_patterntype!= 2) && (deltaT > rf->rf_maxpri) && (deltaT < (2*rf->rf_minpri))) { - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, - "filterID %d : Rejecting on individual filter max PRI deltaT=%lld rf->rf_minpri=%u\n", - rf->rf_pulseid, (unsigned long long)deltaT, rf->rf_minpri); - /* But update the last time stamp */ - rf->rf_dl.dl_last_ts = this_ts; - continue; - } - dfs_add_pulse(dfs, rf, &re, deltaT); - /* If this is an extension channel event, flag it for false alarm reduction */ - if (re.re_chanindextype == EXT_CH) - ext_chan_event_flag = 1; - - if (rf->rf_patterntype == 2) - found = dfs_staggered_check(dfs, rf, (u_int32_t) deltaT, re.re_dur, re.re_ext_chan_busy); - else - found = dfs_bin_check(dfs, rf, (u_int32_t) deltaT, re.re_dur, ext_chan_event_flag, re.re_ext_chan_busy); - - dfs_print_delayline(dfs, &rf->rf_dl); - rf->rf_dl.dl_last_ts = this_ts; - } - } - ft->ft_last_ts = this_ts; - retval |= found; - if (found) { - DFS_DPRINTK(dfs, ATH_DEBUG_DFS, - "Found on channel minDur = %d, filterId = %d\n",ft->ft_mindur, - rf != NULL ? rf->rf_pulseid : -1); - } - tabledepth++; - } - ATH_DFSQ_LOCK(dfs); - empty = STAILQ_EMPTY(&(dfs->dfs_radarq)); - ATH_DFSQ_UNLOCK(dfs); - } -dfsfound: - - return retval; -} - -#endif /* ATH_SUPPORT_DFS */ diff --git a/drivers/net/wireless/ar6003/host/dfs/dfs_staggered.c b/drivers/net/wireless/ar6003/host/dfs/dfs_staggered.c deleted file mode 100644 index 44091c363876..000000000000 --- a/drivers/net/wireless/ar6003/host/dfs/dfs_staggered.c +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) 2002-2010, Atheros Communications Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef ATH_SUPPORT_DFS -#include "dfs_host.h" - -int is_pri_multiple(u_int32_t sample_pri, u_int32_t refpri) -{ -#define MAX_ALLOWED_MISSED 3 - int i; - - if (sample_pri < refpri || (!refpri)) - return 0; - - for (i=1; i<= MAX_ALLOWED_MISSED; i++) { - if((sample_pri%(i*refpri) <= 5)) { - //printk("sample_pri=%d is a multiple of refpri=%d\n", sample_pri, refpri); - return 1; - } - } - return 0; -#undef MAX_ALLOWED_MISSED -} - -int is_unique_pri(u_int32_t highestpri , u_int32_t midpri, - u_int32_t lowestpri , u_int32_t refpri ) -{ -#define DFS_STAGGERED_PRI_MARGIN_MIN 20 -#define DFS_STAGGERED_PRI_MARGIN_MAX 400 - if ((DFS_DIFF(lowestpri, refpri) >= DFS_STAGGERED_PRI_MARGIN_MIN) && - (DFS_DIFF(midpri, refpri) >= DFS_STAGGERED_PRI_MARGIN_MIN) && - (DFS_DIFF(highestpri, refpri) >= DFS_STAGGERED_PRI_MARGIN_MIN)) { - return 1; - } else { - if ((is_pri_multiple(refpri, highestpri)) || (is_pri_multiple(refpri, lowestpri)) || - (is_pri_multiple(refpri, midpri))) - return 0; - } - return 0; -#undef DFS_STAGGERED_PRI_MARGIN_MIN -#undef DFS_STAGGERED_PRI_MARGIN_MAX -} - - -int dfs_staggered_check(struct ath_dfs_host *dfs, struct dfs_filter *rf, - u_int32_t deltaT, u_int32_t width, u_int32_t ext_chan_busy) -{ - - u_int32_t refpri, refdur, searchpri=0, deltapri;//, averagerefpri; - u_int32_t n, i, primargin, durmargin; - int score[DFS_MAX_DL_SIZE], delayindex, dindex, found=0; - struct dfs_delayline *dl; - u_int32_t scoreindex, lowpriindex= 0, lowpri = 0xffff; - int numpulses=0, higherthan, lowerthan, numscores; - u_int32_t lowestscore=0, lowestscoreindex=0, lowestpri=0; - u_int32_t midscore=0, midscoreindex=0, midpri=0; - u_int32_t highestscore=0, highestscoreindex=0, highestpri=0; - - dl = &rf->rf_dl; - if( dl->dl_numelems < (rf->rf_threshold-1)) { - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, "numelems %d < threshold for filter %d\n", dl->dl_numelems, rf->rf_pulseid); - return 0; - } - if( deltaT > rf->rf_filterlen) { - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, "numelems %d < threshold for filter %d\n", dl->dl_numelems, rf->rf_pulseid); - return 0; - } - primargin = 10; - if(rf->rf_maxdur < 10) { - durmargin = 4; - } - else { - durmargin = 6; - } - - OS_MEMZERO(score, sizeof(int)*DFS_MAX_DL_SIZE); - /* find out the lowest pri */ - for (n=0;ndl_numelems; n++) { - delayindex = (dl->dl_firstelem + n) & DFS_MAX_DL_MASK; - refpri = dl->dl_elems[delayindex].de_time; - if( refpri == 0) - continue; - else if(refpri < lowpri) { - lowpri = dl->dl_elems[delayindex].de_time; - lowpriindex = n; - } - } - /* find out the each delay element's pri score */ - for (n=0;ndl_numelems; n++) { - delayindex = (dl->dl_firstelem + n) & DFS_MAX_DL_MASK; - refpri = dl->dl_elems[delayindex].de_time; - if( refpri == 0) - continue; - for (i=0;idl_numelems; i++) { - dindex = (dl->dl_firstelem + i) & DFS_MAX_DL_MASK; - searchpri = dl->dl_elems[dindex].de_time; - deltapri = DFS_DIFF(searchpri, refpri); - if( deltapri < primargin) - score[n]++; - } - if( score[n] > rf->rf_threshold) { - /* we got the most possible candidate, - * no need to continue further */ - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, "THRESH score[%d]=%d pri=%d\n", n, score[n], searchpri); - break; - } - } - for (n=0;ndl_numelems; n++) { - delayindex = (dl->dl_firstelem + n) & DFS_MAX_DL_MASK; - refdur = dl->dl_elems[delayindex].de_time; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, "score[%d]=%d pri=%d\n", n, score[n], refdur); - } - - /* find out the 2 or 3 highest scorers */ - scoreindex = 0; - highestscore=0; - highestscoreindex=0; - highestpri=0; numscores=0; lowestscore=0; - - for (n=0;ndl_numelems; n++) { - higherthan=0; - lowerthan=0; - delayindex = (dl->dl_firstelem + n) & DFS_MAX_DL_MASK; - refpri = dl->dl_elems[delayindex].de_time; - - if ((score[n] >= highestscore) && - (is_unique_pri(highestpri, midpri, lowestpri, refpri))) { - lowestscore = midscore; - lowestpri = midpri; - lowestscoreindex = midscoreindex; - midscore = highestscore; - midpri = highestpri; - midscoreindex = highestscoreindex; - highestscore = score[n]; - highestpri = refpri; - highestscoreindex = n; - } else { - if ((score[n] >= midscore) && - (is_unique_pri(highestpri, midpri, lowestpri, refpri))) { - lowestscore = midscore; - lowestpri = midpri; - lowestscoreindex = midscoreindex; - midscore = score[n]; - midpri = refpri; - midscoreindex = n; - } else if ((score[n] >= lowestscore) && - (is_unique_pri(highestpri, midpri, lowestpri, refpri))) { - lowestscore = score[n]; - lowestpri = refpri; - lowestscoreindex = n; - } - } - - } - - DFS_DPRINTK(dfs, ATH_DEBUG_DFS1, "FINAL highestscore=%d highestscoreindex=%d highestpri=%d\n", highestscore, highestscoreindex, highestpri); - DFS_DPRINTK(dfs, ATH_DEBUG_DFS1, "FINAL lowestscore=%d lowestscoreindex=%d lowpri=%d\n", lowestscore, lowestscoreindex, lowestpri); - DFS_DPRINTK(dfs, ATH_DEBUG_DFS1, "FINAL midscore=%d midscoreindex=%d midpri=%d\n", midscore, midscoreindex, midpri); - - delayindex = (dl->dl_firstelem + highestscoreindex) & DFS_MAX_DL_MASK; - refdur = dl->dl_elems[delayindex].de_dur; - refpri = dl->dl_elems[delayindex].de_time; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS1, "highscoreindex=%d refdur=%d refpri=%d\n", highestscoreindex, refdur, refpri); - - numpulses += dfs_bin_pri_check(dfs, rf, dl, highestscore, refpri, refdur, 0, ext_chan_busy); - - ; delayindex = (dl->dl_firstelem + midscoreindex) & DFS_MAX_DL_MASK; - refdur = dl->dl_elems[delayindex].de_dur; - refpri = dl->dl_elems[delayindex].de_time; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS1, "midscoreindex=%d refdur=%d refpri=%d\n", midscoreindex, refdur, refpri); - - numpulses += dfs_bin_pri_check(dfs, rf, dl, midscore, refpri, refdur, 0, ext_chan_busy); - ; - delayindex = (dl->dl_firstelem + lowestscoreindex) & DFS_MAX_DL_MASK; - refdur = dl->dl_elems[delayindex].de_dur; - refpri = dl->dl_elems[delayindex].de_time; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS1, "lowestscoreindex=%d refdur=%d refpri=%d\n", lowestscoreindex, refdur, refpri); - - numpulses += dfs_bin_pri_check(dfs, rf, dl, lowestscore, refpri, refdur, 0, ext_chan_busy); - DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, "numpulses=%d\n",numpulses); - - if (numpulses >= rf->rf_threshold) { - found = 1; - DFS_DPRINTK(dfs, ATH_DEBUG_DFS, "MATCH filter=%u numpulses=%u thresh=%u\n", rf->rf_pulseid, numpulses,rf->rf_threshold); - } - return found; -} - -#endif /* ATH_SUPPORT_DFS */ diff --git a/drivers/net/wireless/ar6003/host/dfs/dfs_target_api.h b/drivers/net/wireless/ar6003/host/dfs/dfs_target_api.h deleted file mode 100644 index 1cc2bdc6b5fe..000000000000 --- a/drivers/net/wireless/ar6003/host/dfs/dfs_target_api.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2005-2006 Atheros Communications, Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -#ifndef _DFS_TARGET_API_H_ -#define _DFS_TARGET_API_H_ - -#ifdef ATH_SUPPORT_DFS - -#include "ar6000_api.h" - -#define DFS_SET_MINRSSITHRESH(dev_hdl, value) ar6000_dfs_set_minrssithresh_cmd((dev_hdl),(value)) -#define DFS_SET_MAXPULSEDUR(dev_hdl, value) ar6000_dfs_set_maxpulsedur_cmd((dev_hdl),(value)) -#define DFS_RADAR_DETECTED(dev_hdl, ch_idx, bangradar) ar6000_dfs_radar_detected_cmd((dev_hdl),(ch_idx),(bangradar)) - -#endif /* ATH_SUPPORT_DFS */ - -#endif /* _DFS_TARGET_API_ */ diff --git a/drivers/net/wireless/ar6003/host/dfs/makefile b/drivers/net/wireless/ar6003/host/dfs/makefile deleted file mode 100644 index 1ba034c4900e..000000000000 --- a/drivers/net/wireless/ar6003/host/dfs/makefile +++ /dev/null @@ -1,26 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2005-2007 Atheros Corporation. All rights reserved. -# -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# -#------------------------------------------------------------------------------ -#============================================================================== -# Author(s): ="Atheros" -#============================================================================== -!INCLUDE $(_MAKEENVROOT)\makefile.def - - - diff --git a/drivers/net/wireless/ar6003/host/hif/common/hif_bmi_reg_access.c b/drivers/net/wireless/ar6003/host/hif/common/hif_bmi_reg_access.c deleted file mode 100644 index 87af33cf811c..000000000000 --- a/drivers/net/wireless/ar6003/host/hif/common/hif_bmi_reg_access.c +++ /dev/null @@ -1,379 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// common BMI access handling for register-based HIFs -// This module implements BMI message exchanges on behalf of the BMI module for -// HIFs that are based on a register access model -// -// Author(s): ="Atheros" -//============================================================================== - -#include "a_config.h" -#include "athdefs.h" -#include "a_types.h" -#include "a_osapi.h" -#define ATH_MODULE_NAME bmi -#include "a_debug.h" -#define ATH_DEBUG_BMI ATH_DEBUG_MAKE_MODULE_MASK(0) -#include "hif.h" -#include "bmi.h" -#include "htc_api.h" -#include "target_reg_table.h" -#include "host_reg_table.h" - -#define BMI_COMMUNICATION_TIMEOUT 100000 - -static A_BOOL pendingEventsFuncCheck = FALSE; -static A_UINT32 commandCredits = 0; -static A_UINT32 *pBMICmdCredits = &commandCredits; - -/* BMI Access routines */ -static A_STATUS -bmiBufferSend(HIF_DEVICE *device, - A_UCHAR *buffer, - A_UINT32 length) -{ - A_STATUS status; - A_UINT32 timeout; - A_UINT32 address; - A_UINT32 mboxAddress[HTC_MAILBOX_NUM_MAX]; - - HIFConfigureDevice(device, HIF_DEVICE_GET_MBOX_ADDR, - &mboxAddress[0], sizeof(mboxAddress)); - - *pBMICmdCredits = 0; - timeout = BMI_COMMUNICATION_TIMEOUT; - - while(timeout-- && !(*pBMICmdCredits)) { - /* Read the counter register to get the command credits */ - address = COUNT_DEC_ADDRESS + (HTC_MAILBOX_NUM_MAX + ENDPOINT1) * 4; - /* hit the credit counter with a 4-byte access, the first byte read will hit the counter and cause - * a decrement, while the remaining 3 bytes has no effect. The rationale behind this is to - * make all HIF accesses 4-byte aligned */ - status = HIFReadWrite(device, address, (A_UINT8 *)pBMICmdCredits, 4, - HIF_RD_SYNC_BYTE_INC, NULL); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to decrement the command credit count register\n")); - return A_ERROR; - } - /* the counter is only 8=bits, ignore anything in the upper 3 bytes */ - (*pBMICmdCredits) &= 0xFF; - } - - if (*pBMICmdCredits) { - address = mboxAddress[ENDPOINT1]; - status = HIFReadWrite(device, address, buffer, length, - HIF_WR_SYNC_BYTE_INC, NULL); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to send the BMI data to the device\n")); - return A_ERROR; - } - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI Communication timeout - bmiBufferSend\n")); - return A_ERROR; - } - - return status; -} - -static A_STATUS -bmiBufferReceive(HIF_DEVICE *device, - A_UCHAR *buffer, - A_UINT32 length, - A_BOOL want_timeout) -{ - A_STATUS status; - A_UINT32 address; - A_UINT32 mboxAddress[HTC_MAILBOX_NUM_MAX]; - HIF_PENDING_EVENTS_INFO hifPendingEvents; - static HIF_PENDING_EVENTS_FUNC getPendingEventsFunc = NULL; - - if (!pendingEventsFuncCheck) { - /* see if the HIF layer implements an alternative function to get pending events - * do this only once! */ - HIFConfigureDevice(device, - HIF_DEVICE_GET_PENDING_EVENTS_FUNC, - &getPendingEventsFunc, - sizeof(HIF_PENDING_EVENTS_FUNC)); - pendingEventsFuncCheck = TRUE; - } - - HIFConfigureDevice(device, HIF_DEVICE_GET_MBOX_ADDR, - &mboxAddress[0], sizeof(mboxAddress)); - - /* - * During normal bootup, small reads may be required. - * Rather than issue an HIF Read and then wait as the Target - * adds successive bytes to the FIFO, we wait here until - * we know that response data is available. - * - * This allows us to cleanly timeout on an unexpected - * Target failure rather than risk problems at the HIF level. In - * particular, this avoids SDIO timeouts and possibly garbage - * data on some host controllers. And on an interconnect - * such as Compact Flash (as well as some SDIO masters) which - * does not provide any indication on data timeout, it avoids - * a potential hang or garbage response. - * - * Synchronization is more difficult for reads larger than the - * size of the MBOX FIFO (128B), because the Target is unable - * to push the 129th byte of data until AFTER the Host posts an - * HIF Read and removes some FIFO data. So for large reads the - * Host proceeds to post an HIF Read BEFORE all the data is - * actually available to read. Fortunately, large BMI reads do - * not occur in practice -- they're supported for debug/development. - * - * So Host/Target BMI synchronization is divided into these cases: - * CASE 1: length < 4 - * Should not happen - * - * CASE 2: 4 <= length <= 128 - * Wait for first 4 bytes to be in FIFO - * If CONSERVATIVE_BMI_READ is enabled, also wait for - * a BMI command credit, which indicates that the ENTIRE - * response is available in the the FIFO - * - * CASE 3: length > 128 - * Wait for the first 4 bytes to be in FIFO - * - * For most uses, a small timeout should be sufficient and we will - * usually see a response quickly; but there may be some unusual - * (debug) cases of BMI_EXECUTE where we want an larger timeout. - * For now, we use an unbounded busy loop while waiting for - * BMI_EXECUTE. - * - * If BMI_EXECUTE ever needs to support longer-latency execution, - * especially in production, this code needs to be enhanced to sleep - * and yield. Also note that BMI_COMMUNICATION_TIMEOUT is currently - * a function of Host processor speed. - */ - if (length >= 4) { /* NB: Currently, always true */ - /* - * NB: word_available is declared static for esoteric reasons - * having to do with protection on some OSes. - */ - static A_UINT32 word_available; - A_UINT32 timeout; - - word_available = 0; - timeout = BMI_COMMUNICATION_TIMEOUT; - while((!want_timeout || timeout--) && !word_available) { - - if (getPendingEventsFunc != NULL) { - status = getPendingEventsFunc(device, - &hifPendingEvents, - NULL); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMI: Failed to get pending events \n")); - break; - } - - if (hifPendingEvents.AvailableRecvBytes >= sizeof(A_UINT32)) { - word_available = 1; - } - continue; - } - - status = HIFReadWrite(device, RX_LOOKAHEAD_VALID_ADDRESS, (A_UINT8 *)&word_available, - sizeof(word_available), HIF_RD_SYNC_BYTE_INC, NULL); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read RX_LOOKAHEAD_VALID register\n")); - return A_ERROR; - } - /* We did a 4-byte read to the same register; all we really want is one bit */ - word_available &= (1 << ENDPOINT1); - } - - if (!word_available) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI Communication timeout - bmiBufferReceive FIFO empty\n")); - return A_ERROR; - } - } - -#define CONSERVATIVE_BMI_READ 0 -#if CONSERVATIVE_BMI_READ - /* - * This is an extra-conservative CREDIT check. It guarantees - * that ALL data is available in the FIFO before we start to - * read from the interconnect. - * - * This credit check is useless when firmware chooses to - * allow multiple outstanding BMI Command Credits, since the next - * credit will already be present. To restrict the Target to one - * BMI Command Credit, see HI_OPTION_BMI_CRED_LIMIT. - * - * And for large reads (when HI_OPTION_BMI_CRED_LIMIT is set) - * we cannot wait for the next credit because the Target's FIFO - * will not hold the entire response. So we need the Host to - * start to empty the FIFO sooner. (And again, large reads are - * not used in practice; they are for debug/development only.) - * - * For a more conservative Host implementation (which would be - * safer for a Compact Flash interconnect): - * Set CONSERVATIVE_BMI_READ (above) to 1 - * Set HI_OPTION_BMI_CRED_LIMIT and - * reduce BMI_DATASZ_MAX to 32 or 64 - */ - if ((length > 4) && (length < 128)) { /* check against MBOX FIFO size */ - A_UINT32 timeout; - - *pBMICmdCredits = 0; - timeout = BMI_COMMUNICATION_TIMEOUT; - while((!want_timeout || timeout--) && !(*pBMICmdCredits) { - /* Read the counter register to get the command credits */ - address = COUNT_ADDRESS + (HTC_MAILBOX_NUM_MAX + ENDPOINT1) * 1; - /* read the counter using a 4-byte read. Since the counter is NOT auto-decrementing, - * we can read this counter multiple times using a non-incrementing address mode. - * The rationale here is to make all HIF accesses a multiple of 4 bytes */ - status = HIFReadWrite(device, address, (A_UINT8 *)pBMICmdCredits, sizeof(*pBMICmdCredits), - HIF_RD_SYNC_BYTE_FIX, NULL); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read the command credit count register\n")); - return A_ERROR; - } - /* we did a 4-byte read to the same count register so mask off upper bytes */ - (*pBMICmdCredits) &= 0xFF; - } - - if (!(*pBMICmdCredits)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI Communication timeout- bmiBufferReceive no credit\n")); - return A_ERROR; - } - } -#endif - - address = mboxAddress[ENDPOINT1]; - status = HIFReadWrite(device, address, buffer, length, HIF_RD_SYNC_BYTE_INC, NULL); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read the BMI data from the device\n")); - return A_ERROR; - } - - return A_OK; -} - - -A_STATUS HIFRegBasedGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info) -{ - A_STATUS status; - A_UINT32 cid; - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Get Target Info: Enter (device: 0x%p)\n", device)); - cid = BMI_GET_TARGET_INFO; - - status = bmiBufferSend(device, (A_UCHAR *)&cid, sizeof(cid)); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); - return A_ERROR; - } - - status = bmiBufferReceive(device, (A_UCHAR *)&targ_info->target_ver, - sizeof(targ_info->target_ver), TRUE); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Version from the device\n")); - return A_ERROR; - } - - if (targ_info->target_ver == TARGET_VERSION_SENTINAL) { - /* Determine how many bytes are in the Target's targ_info */ - status = bmiBufferReceive(device, (A_UCHAR *)&targ_info->target_info_byte_count, - sizeof(targ_info->target_info_byte_count), TRUE); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Info Byte Count from the device\n")); - return A_ERROR; - } - - /* - * The Target's targ_info doesn't match the Host's targ_info. - * We need to do some backwards compatibility work to make this OK. - */ - A_ASSERT(targ_info->target_info_byte_count == sizeof(*targ_info)); - - /* Read the remainder of the targ_info */ - status = bmiBufferReceive(device, - ((A_UCHAR *)targ_info)+sizeof(targ_info->target_info_byte_count), - sizeof(*targ_info)-sizeof(targ_info->target_info_byte_count), TRUE); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Info (%d bytes) from the device\n", - targ_info->target_info_byte_count)); - return A_ERROR; - } - } else { - /* - * Target must be an AR6001 whose firmware does not - * support BMI_GET_TARGET_INFO. Construct the data - * that it would have sent. - */ - targ_info->target_info_byte_count=sizeof(*targ_info); - targ_info->target_type=TARGET_TYPE_AR6001; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Get Target Info: Exit (ver: 0x%x type: 0x%x)\n", - targ_info->target_ver, targ_info->target_type)); - - return A_OK; -} - -A_STATUS HIFExchangeBMIMsg(HIF_DEVICE *device, - A_UINT8 *pSendMessage, - A_UINT32 Length, - A_UINT8 *pResponseMessage, - A_UINT32 *pResponseLength, - A_UINT32 TimeoutMS) -{ - A_STATUS status = A_OK; - - do { - - status = bmiBufferSend(device, pSendMessage, Length); - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI : Unable to Send Message to device \n")); - break; - } - - if (pResponseMessage != NULL) { - status = bmiBufferReceive(device, pResponseMessage, *pResponseLength, TimeoutMS ? TRUE : FALSE); - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI : Unable to read response from device \n")); - break; - } - } - - } while (FALSE); - - return status; -} - -/* TODO .. the following APIs are a relic of the old register based interface */ - -A_STATUS -BMIRawWrite(HIF_DEVICE *device, A_UCHAR *buffer, A_UINT32 length) -{ - return bmiBufferSend(device, buffer, length); -} - -A_STATUS -BMIRawRead(HIF_DEVICE *device, A_UCHAR *buffer, A_UINT32 length, A_BOOL want_timeout) -{ - return bmiBufferReceive(device, buffer, length, want_timeout); -} - - - diff --git a/drivers/net/wireless/ar6003/host/hif/common/hif_diag_reg_access.c b/drivers/net/wireless/ar6003/host/hif/common/hif_diag_reg_access.c deleted file mode 100644 index 559de163f766..000000000000 --- a/drivers/net/wireless/ar6003/host/hif/common/hif_diag_reg_access.c +++ /dev/null @@ -1,266 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// common Diagnostic access handling for register-based HIFs -// This module implements diagnostic accesses on behalf of the diagnostic window module for -// HIFs that are based on a register access model -// -// -// Author(s): ="Atheros" -//============================================================================== - - -#include "a_config.h" -#include "athdefs.h" -#include "a_types.h" -#include "a_osapi.h" -#define ATH_MODULE_NAME misc -#include "a_debug.h" - -#include "targaddrs.h" -#include "hif.h" -#include "host_reg_table.h" - -#define CPU_DBG_SEL_ADDRESS 0x00000483 -#define CPU_DBG_ADDRESS 0x00000484 - -#ifdef USE_4BYTE_REGISTER_ACCESS -/* set the window address register (using 4-byte register access ). - * This mitigates host interconnect issues with non-4byte aligned bus requests, some - * interconnects use bus adapters that impose strict limitations. - * Since diag window access is not intended for performance critical operations, the 4byte mode should - * be satisfactory even though it generates 4X the bus activity. */ -static A_STATUS ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, A_UINT32 RegisterAddr, A_UINT32 Address) -{ - A_STATUS status; - static A_UINT8 addrValue[4]; - A_INT32 i; - static A_UINT32 address; - - address = Address; - - - /* write bytes 1,2,3 of the register to set the upper address bytes, the LSB is written - * last to initiate the access cycle */ - - for (i = 1; i <= 3; i++) { - /* fill the buffer with the address byte value we want to hit 4 times*/ - addrValue[0] = ((A_UINT8 *)&Address)[i]; - addrValue[1] = addrValue[0]; - addrValue[2] = addrValue[0]; - addrValue[3] = addrValue[0]; - - /* hit each byte of the register address with a 4-byte write operation to the same address, - * this is a harmless operation */ - status = HIFReadWrite(hifDevice, - RegisterAddr+i, - addrValue, - 4, - HIF_WR_SYNC_BYTE_FIX, - NULL); - if (status != A_OK) { - break; - } - } - - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write initial bytes of 0x%x to window reg: 0x%X \n", - Address, RegisterAddr)); - return status; - } - - /* write the address register again, this time write the whole 4-byte value. - * The effect here is that the LSB write causes the cycle to start, the extra - * 3 byte write to bytes 1,2,3 has no effect since we are writing the same values again */ - status = HIFReadWrite(hifDevice, - RegisterAddr, - (A_UCHAR *)(&address), - 4, - HIF_WR_SYNC_BYTE_INC, - NULL); - - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to window reg: 0x%X \n", - Address, RegisterAddr)); - return status; - } - - return A_OK; -} -#else - -/* set the window address register */ -A_STATUS ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, A_UINT32 RegisterAddr, A_UINT32 Address) -{ - A_STATUS status; - - /* write bytes 1,2,3 of the register to set the upper address bytes, the LSB is written - * last to initiate the access cycle */ - status = HIFReadWrite(hifDevice, - RegisterAddr+1, /* write upper 3 bytes */ - ((A_UCHAR *)(&Address))+1, - sizeof(A_UINT32)-1, - HIF_WR_SYNC_BYTE_INC, - NULL); - - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write initial bytes of 0x%x to window reg: 0x%X \n", - RegisterAddr, Address)); - return status; - } - - /* write the LSB of the register, this initiates the operation */ - status = HIFReadWrite(hifDevice, - RegisterAddr, - (A_UCHAR *)(&Address), - sizeof(A_UINT8), - HIF_WR_SYNC_BYTE_INC, - NULL); - - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to window reg: 0x%X \n", - RegisterAddr, Address)); - return status; - } - - return A_OK; -} -#endif //USE_4BYTE_REGISTER_ACCESS - -/* - * Read from the AR6000 through its diagnostic window. - * No cooperation from the Target is required for this. - */ -A_STATUS -HIFDiagReadAccess(HIF_DEVICE *hifDevice, A_UINT32 address, A_UINT32 *data) -{ - A_STATUS status; - static A_UINT32 readvalue; - - /* set window register to start read cycle */ - status = ar6000_SetAddressWindowRegister(hifDevice, - WINDOW_READ_ADDR_ADDRESS, - address); - - if (status != A_OK) { - return status; - } - - /* read the data */ - status = HIFReadWrite(hifDevice, - WINDOW_DATA_ADDRESS, - (A_UCHAR *)&readvalue, - sizeof(A_UINT32), - HIF_RD_SYNC_BYTE_INC, - NULL); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot read from WINDOW_DATA_ADDRESS\n")); - return status; - } - - *data = readvalue; - - return status; -} - - -/* - * Write to the AR6000 through its diagnostic window. - * No cooperation from the Target is required for this. - */ -A_STATUS HIFDiagWriteAccess(HIF_DEVICE *hifDevice, A_UINT32 address, A_UINT32 data) -{ - A_STATUS status; - static A_UINT32 writeValue; - - writeValue = data; - - /* set write data */ - status = HIFReadWrite(hifDevice, - WINDOW_DATA_ADDRESS, - (A_UCHAR *)&writeValue, - sizeof(A_UINT32), - HIF_WR_SYNC_BYTE_INC, - NULL); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to WINDOW_DATA_ADDRESS\n", data)); - return status; - } - - /* set window register, which starts the write cycle */ - return ar6000_SetAddressWindowRegister(hifDevice, - WINDOW_WRITE_ADDR_ADDRESS, - address); -} - - -/* TODO .. the following APIs are only available on register-based HIFs where the CPU_DBG_SEL_ADDRESS - * register is available */ - -A_STATUS -ar6k_ReadTargetRegister(HIF_DEVICE *hifDevice, int regsel, A_UINT32 *regval) -{ - A_STATUS status; - A_UCHAR vals[4]; - A_UCHAR register_selection[4]; - - register_selection[0] = register_selection[1] = register_selection[2] = register_selection[3] = (regsel & 0xff); - status = HIFReadWrite(hifDevice, - CPU_DBG_SEL_ADDRESS, - register_selection, - 4, - HIF_WR_SYNC_BYTE_FIX, - NULL); - - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write CPU_DBG_SEL (%d)\n", regsel)); - return status; - } - - status = HIFReadWrite(hifDevice, - CPU_DBG_ADDRESS, - (A_UCHAR *)vals, - sizeof(vals), - HIF_RD_SYNC_BYTE_INC, - NULL); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot read from CPU_DBG_ADDRESS\n")); - return status; - } - - *regval = vals[0]<<0 | vals[1]<<8 | vals[2]<<16 | vals[3]<<24; - - return status; -} - -void -ar6k_FetchTargetRegs(HIF_DEVICE *hifDevice, A_UINT32 *targregs) -{ - int i; - A_UINT32 val; - - for (i=0; iMboxProp[0].ExtendedAddress = HIF_MBOX0_EXTENDED_BASE_ADDR; - //pInfo->MboxProp[0].ExtendedSize = HIF_MBOX0_EXTENDED_WIDTH_AR6002; - - pInfo->MboxProp[0].ExtendedAddress = HIF_MBOX0_EXTENDED_BASE_ADDR_AR6003_V1; - pInfo->MboxProp[0].ExtendedSize = HIF_MBOX0_EXTENDED_WIDTH_AR6003_V1; - - break; - case MANUFACTURER_ID_AR6003_BASE : - /* MBOX 0 has an extended range */ - pInfo->MboxProp[0].ExtendedAddress = HIF_MBOX0_EXTENDED_BASE_ADDR_AR6003_V1; - pInfo->MboxProp[0].ExtendedSize = HIF_MBOX0_EXTENDED_WIDTH_AR6003_V1; - pInfo->GMboxAddress = HIF_GMBOX_BASE_ADDR; - pInfo->GMboxSize = HIF_GMBOX_WIDTH; - break; - case MANUFACTURER_ID_MCKINLEY_BASE : - pInfo->MboxProp[0].ExtendedAddress = HIF_MBOX0_EXTENDED_BASE_ADDR_AR6003_V1; /* TBDXXX */ - pInfo->MboxProp[0].ExtendedSize = HIF_MBOX0_EXTENDED_WIDTH_AR6003_V1; - break; - default: - A_ASSERT(FALSE); - break; - } -} - -/* special CCCR (func 0) registers */ - -#define CCCR_SDIO_IRQ_MODE_REG 0xF0 /* interrupt mode register */ -#define SDIO_IRQ_MODE_ASYNC_4BIT_IRQ (1 << 0) /* mode to enable special 4-bit interrupt assertion without clock*/ - -#endif /*HIF_SDIO_COMMON_H_*/ diff --git a/drivers/net/wireless/ar6003/host/hif/common/makefile b/drivers/net/wireless/ar6003/host/hif/common/makefile deleted file mode 100644 index 4cab10f2397a..000000000000 --- a/drivers/net/wireless/ar6003/host/hif/common/makefile +++ /dev/null @@ -1,12 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2005-2007 Atheros Corporation. All rights reserved. -# -# -# -#------------------------------------------------------------------------------ -#============================================================================== -# Author(s): ="Atheros" -#============================================================================== -!INCLUDE $(_MAKEENVROOT)\makefile.def - diff --git a/drivers/net/wireless/ar6003/host/hif/sdio/Makefile b/drivers/net/wireless/ar6003/host/hif/sdio/Makefile deleted file mode 100644 index 17c3d8c594da..000000000000 --- a/drivers/net/wireless/ar6003/host/hif/sdio/Makefile +++ /dev/null @@ -1,90 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2005-2008 Atheros Corporation. All rights reserved. -# -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# -#------------------------------------------------------------------------------ -#============================================================================== -# Author(s): ="Atheros" -#============================================================================== - -# -#SDIO HIF makefile for atheros SDIO stack -# - -# Check for SDIO stack -ifdef ATH_SDIO_STACK_BASE -# Someone already set it on entry, the stack resides outside this tree, we will try to build it -_SDIO_STACK = YES -else -# Check for SDIO stack within this tree -_SDIO_STACK = $(shell if [ -f $(ATH_SRC_BASE)/sdiostack/src/Makefile ]; then echo "YES"; else echo "NO"; fi) - -ifeq ($(_SDIO_STACK), YES) - # SDIO stack is part of the kit and will need to be compiled -ATH_SDIO_STACK_BASE := $(ATH_SRC_BASE)/sdiostack -endif -endif - - -ifeq ($(ATH_BUS_SUBTYPE),linux_sdio) -_HIF_SUB_TYPE = linux_sdio -_SDIO_STACK = NO -else -_HIF_SUB_TYPE = linux_athsdio -endif - - -ifeq ($(_SDIO_STACK), YES) - # Pass and translate build variables to the SDIO stack makefile -_SDIO_STACK_MAKE_PARAMS := CT_BUILD_TYPE=$(ATH_BUILD_TYPE) \ - CT_OS_TYPE=linux \ - CT_OS_SUB_TYPE=$(ATH_OS_SUB_TYPE) \ - CT_LINUXPATH=$(ATH_LINUXPATH) \ - CT_BUILD_TYPE=$(ATH_BUILD_TYPE) \ - CT_CROSS_COMPILE_TYPE=$(ATH_CROSS_COMPILE_TYPE) \ - CT_ARCH_CPU_TYPE=$(ATH_ARCH_CPU_TYPE) \ - CT_HC_DRIVERS=$(ATH_HC_DRIVERS) \ - CT_MAKE_INCLUDE_OVERRIDE=$(_LOCALMAKE_INCLUDE) \ - CT_BUILD_OUTPUT_OVERRIDE=$(COMPILED_IMAGE_OBJECTS_PATH) \ - BUS_BUILD=1 -endif -EXTRA_CFLAGS += -I$(ATH_SRC_BASE)/hif/sdio/$(_HIF_SUB_TYPE)/include -EXTRA_CFLAGS += -DSDIO -EXTRA_CFLAGS += -I$(ATH_SDIO_STACK_BASE)/src/include - -ifeq ($(ATH_OS_SUB_TYPE),linux_2_4) -obj-y += ../../hif/sdio/linux_athsdio/src/hif.o -obj-y += ../../hif/sdio/linux_athsdio/src/hif_scatter.o -endif - -ifneq ($(ATH_OS_SUB_TYPE),linux_2_4) -ar6000-objs := ../../hif/sdio/$(_HIF_SUB_TYPE)/src/hif.o \ - ../../hif/sdio/$(_HIF_SUB_TYPE)/src/hif_scatter.o - - -endif - -all: -ifeq ($(_SDIO_STACK),YES) - $(MAKE) $(_SDIO_STACK_MAKE_PARAMS) -C $(ATH_SDIO_STACK_BASE)/src default - -cp -f $(ATH_SDIO_STACK_BASE)/src/Module.symvers $(COMPILED_IMAGE_OBJECTS_PATH) -endif - -clean: -ifeq ($(_SDIO_STACK),YES) - $(MAKE) $(_SDIO_STACK_MAKE_PARAMS) -C $(ATH_SDIO_STACK_BASE)/src clean -endif diff --git a/drivers/net/wireless/ar6003/host/hif/sdio/linux_sdio/include/hif_internal.h b/drivers/net/wireless/ar6003/host/hif/sdio/linux_sdio/include/hif_internal.h deleted file mode 100644 index df6ab6aeb56c..000000000000 --- a/drivers/net/wireless/ar6003/host/hif/sdio/linux_sdio/include/hif_internal.h +++ /dev/null @@ -1,137 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// internal header file for hif layer -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _HIF_INTERNAL_H_ -#define _HIF_INTERNAL_H_ - -#include "a_config.h" -#include "athdefs.h" -#include "a_types.h" -#include "a_osapi.h" -#include "hif.h" -#include "../../../common/hif_sdio_common.h" -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) -#include -//#define HIF_LINUX_MMC_SCATTER_SUPPORT -#endif - -#define BUS_REQUEST_MAX_NUM 64 - -#define SDIO_CLOCK_FREQUENCY_DEFAULT 25000000 -#define SDWLAN_ENABLE_DISABLE_TIMEOUT 20 -#define FLAGS_CARD_ENAB 0x02 -#define FLAGS_CARD_IRQ_UNMSK 0x04 - -#define HIF_MBOX_BLOCK_SIZE HIF_DEFAULT_IO_BLOCK_SIZE -#define HIF_MBOX0_BLOCK_SIZE 1 -#define HIF_MBOX1_BLOCK_SIZE HIF_MBOX_BLOCK_SIZE -#define HIF_MBOX2_BLOCK_SIZE HIF_MBOX_BLOCK_SIZE -#define HIF_MBOX3_BLOCK_SIZE HIF_MBOX_BLOCK_SIZE - -struct _HIF_SCATTER_REQ_PRIV; - -typedef struct bus_request { - struct bus_request *next; /* link list of available requests */ - struct bus_request *inusenext; /* link list of in use requests */ - struct semaphore sem_req; - A_UINT32 address; /* request data */ - A_UCHAR *buffer; - A_UINT32 length; - A_UINT32 request; - void *context; - A_STATUS status; - struct _HIF_SCATTER_REQ_PRIV *pScatterReq; /* this request is a scatter request */ -} BUS_REQUEST; - -struct hif_device { - struct sdio_func *func; - spinlock_t asynclock; - struct task_struct* async_task; /* task to handle async commands */ - struct semaphore sem_async; /* wake up for async task */ - int async_shutdown; /* stop the async task */ - struct completion async_completion; /* thread completion */ - BUS_REQUEST *asyncreq; /* request for async tasklet */ - BUS_REQUEST *taskreq; /* async tasklet data */ - spinlock_t lock; - BUS_REQUEST *s_busRequestFreeQueue; /* free list */ - BUS_REQUEST busRequest[BUS_REQUEST_MAX_NUM]; /* available bus requests */ - void *claimedContext; - HTC_CALLBACKS htcCallbacks; - A_UINT8 *dma_buffer; - DL_LIST ScatterReqHead; /* scatter request list head */ - A_BOOL scatter_enabled; /* scatter enabled flag */ - A_BOOL is_suspend; - A_BOOL is_disabled; - atomic_t irqHandling; - HIF_DEVICE_POWER_CHANGE_TYPE powerConfig; - const struct sdio_device_id *id; - struct mmc_host *host; -}; - -#define HIF_DMA_BUFFER_SIZE (32 * 1024) -#define CMD53_FIXED_ADDRESS 1 -#define CMD53_INCR_ADDRESS 2 - -BUS_REQUEST *hifAllocateBusRequest(HIF_DEVICE *device); -void hifFreeBusRequest(HIF_DEVICE *device, BUS_REQUEST *busrequest); -void AddToAsyncList(HIF_DEVICE *device, BUS_REQUEST *busrequest); - -#ifdef HIF_LINUX_MMC_SCATTER_SUPPORT - -#define MAX_SCATTER_REQUESTS 4 -#define MAX_SCATTER_ENTRIES_PER_REQ 16 -#define MAX_SCATTER_REQ_TRANSFER_SIZE 32*1024 - -typedef struct _HIF_SCATTER_REQ_PRIV { - HIF_SCATTER_REQ *pHifScatterReq; /* HIF scatter request with allocated entries */ - HIF_DEVICE *device; /* this device */ - BUS_REQUEST *busrequest; /* request associated with request */ - /* scatter list for linux */ - struct scatterlist sgentries[MAX_SCATTER_ENTRIES_PER_REQ]; -} HIF_SCATTER_REQ_PRIV; - -#define ATH_DEBUG_SCATTER ATH_DEBUG_MAKE_MODULE_MASK(0) - -A_STATUS SetupHIFScatterSupport(HIF_DEVICE *device, HIF_DEVICE_SCATTER_SUPPORT_INFO *pInfo); -void CleanupHIFScatterResources(HIF_DEVICE *device); -A_STATUS DoHifReadWriteScatter(HIF_DEVICE *device, BUS_REQUEST *busrequest); - -#else // HIF_LINUX_MMC_SCATTER_SUPPORT - -static inline A_STATUS SetupHIFScatterSupport(HIF_DEVICE *device, HIF_DEVICE_SCATTER_SUPPORT_INFO *pInfo) -{ - return A_ENOTSUP; -} - -static inline A_STATUS DoHifReadWriteScatter(HIF_DEVICE *device, BUS_REQUEST *busrequest) -{ - return A_ENOTSUP; -} - -#define CleanupHIFScatterResources(d) { } - -#endif // HIF_LINUX_MMC_SCATTER_SUPPORT - -#endif // _HIF_INTERNAL_H_ - diff --git a/drivers/net/wireless/ar6003/host/hif/sdio/linux_sdio/src/hif.c b/drivers/net/wireless/ar6003/host/hif/sdio/linux_sdio/src/hif.c deleted file mode 100644 index dfca63fd4f9e..000000000000 --- a/drivers/net/wireless/ar6003/host/hif/sdio/linux_sdio/src/hif.c +++ /dev/null @@ -1,1504 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// HIF layer reference implementation for Linux Native MMC stack -// -// Author(s): ="Atheros" -//============================================================================== -#include -#include -#include -#include -#include -#include -#include -#include -#include "common_drv.h" -#include "host_reg_table.h" - -/* by default setup a bounce buffer for the data packets, if the underlying host controller driver - does not use DMA you may be able to skip this step and save the memory allocation and transfer time */ -#define HIF_USE_DMA_BOUNCE_BUFFER 1 -#include "hif_internal.h" -#define ATH_MODULE_NAME hif -#include "a_debug.h" - -#if HIF_USE_DMA_BOUNCE_BUFFER -/* macro to check if DMA buffer is WORD-aligned and DMA-able. Most host controllers assume the - * buffer is DMA'able and will bug-check otherwise (i.e. buffers on the stack). - * virt_addr_valid check fails on stack memory. - */ -#define BUFFER_NEEDS_BOUNCE(buffer) (((unsigned long)(buffer) & 0x3) || !virt_addr_valid((buffer))) -#else -#define BUFFER_NEEDS_BOUNCE(buffer) (FALSE) -#endif - -#define MAX_HIF_DEVICES 2 - -/* ATHENV */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) && defined(CONFIG_PM) -#define dev_to_sdio_func(d) container_of(d, struct sdio_func, dev) -#define to_sdio_driver(d) container_of(d, struct sdio_driver, drv) -static int hifDeviceSuspend(struct device *dev); -static int hifDeviceResume(struct device *dev); -#endif /* CONFIG_PM */ -static int hifDeviceInserted(struct sdio_func *func, const struct sdio_device_id *id); -static void hifDeviceRemoved(struct sdio_func *func); -static HIF_DEVICE *addHifDevice(struct sdio_func *func); -static HIF_DEVICE *getHifDevice(struct sdio_func *func); -static void delHifDevice(HIF_DEVICE * device); -static int Func0_CMD52WriteByte(struct mmc_card *card, unsigned int address, unsigned char byte); -static int Func0_CMD52ReadByte(struct mmc_card *card, unsigned int address, unsigned char *byte); -void hif_register_tbl_attach(A_UINT32 hif_type); - -int reset_sdio_on_unload = 0; -module_param(reset_sdio_on_unload, int, 0644); - -extern A_UINT32 nohifscattersupport; - - -/* ------ Static Variables ------ */ -static const struct sdio_device_id ar6k_id_table[] = { -#ifdef AR6003_HEADERS_DEF - { SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6003_BASE | 0x0)) }, - { SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6003_BASE | 0x1)) }, -#endif - { /* null */ }, -}; -MODULE_DEVICE_TABLE(sdio, ar6k_id_table); - -static struct sdio_driver ar6k_driver = { - .name = "ar6k_wlan", - .id_table = ar6k_id_table, - .probe = hifDeviceInserted, - .remove = hifDeviceRemoved, -}; - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) && defined(CONFIG_PM) -/* New suspend/resume based on linux-2.6.32 - * Need to patch linux-2.6.32 with mmc2.6.32_suspend.patch - * Need to patch with msmsdcc2.6.29_suspend.patch for msm_sdcc host - */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29) -static struct dev_pm_ops ar6k_device_pm_ops = { -#else -static struct pm_ops ar6k_device_pm_ops = { -#endif - .suspend = hifDeviceSuspend, - .resume = hifDeviceResume, -}; -#endif /* CONFIG_PM */ - -/* make sure we only unregister when registered. */ -static int registered = 0; - -OSDRV_CALLBACKS osdrvCallbacks; -extern A_UINT32 onebitmode; -extern A_UINT32 busspeedlow; -extern A_UINT32 debughif; - -static HIF_DEVICE *hif_devices[MAX_HIF_DEVICES]; - -static void ResetAllCards(void); -static A_STATUS hifDisableFunc(HIF_DEVICE *device, struct sdio_func *func); -static A_STATUS hifEnableFunc(HIF_DEVICE *device, struct sdio_func *func); - -#ifdef DEBUG - -ATH_DEBUG_INSTANTIATE_MODULE_VAR(hif, - "hif", - "(Linux MMC) Host Interconnect Framework", - ATH_DEBUG_MASK_DEFAULTS, - 0, - NULL); - -#endif - - -/* ------ Functions ------ */ -A_STATUS HIFInit(OSDRV_CALLBACKS *callbacks) -{ - int status; - AR_DEBUG_ASSERT(callbacks != NULL); - - A_REGISTER_MODULE_DEBUG_INFO(hif); - - /* store the callback handlers */ - osdrvCallbacks = *callbacks; - - /* Register with bus driver core */ - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: HIFInit registering\n")); - registered = 1; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) && defined(CONFIG_PM) - if (callbacks->deviceSuspendHandler && callbacks->deviceResumeHandler) { - ar6k_driver.drv.pm = &ar6k_device_pm_ops; - } -#endif /* CONFIG_PM */ - status = sdio_register_driver(&ar6k_driver); - AR_DEBUG_ASSERT(status==0); - - if (status != 0) { - return A_ERROR; - } - - return A_OK; - -} - -static A_STATUS -__HIFReadWrite(HIF_DEVICE *device, - A_UINT32 address, - A_UCHAR *buffer, - A_UINT32 length, - A_UINT32 request, - void *context) -{ - A_UINT8 opcode; - A_STATUS status = A_OK; - int ret; - A_UINT8 *tbuffer; - A_BOOL bounced = FALSE; - - AR_DEBUG_ASSERT(device != NULL); - AR_DEBUG_ASSERT(device->func != NULL); - - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: Device: 0x%p, buffer:0x%p (addr:0x%X)\n", - device, buffer, address)); - - do { - if (request & HIF_EXTENDED_IO) { - //AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: Command type: CMD53\n")); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, - ("AR6000: Invalid command type: 0x%08x\n", request)); - status = A_EINVAL; - break; - } - - if (request & HIF_BLOCK_BASIS) { - /* round to whole block length size */ - length = (length / HIF_MBOX_BLOCK_SIZE) * HIF_MBOX_BLOCK_SIZE; - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, - ("AR6000: Block mode (BlockLen: %d)\n", - length)); - } else if (request & HIF_BYTE_BASIS) { - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, - ("AR6000: Byte mode (BlockLen: %d)\n", - length)); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, - ("AR6000: Invalid data mode: 0x%08x\n", request)); - status = A_EINVAL; - break; - } - -#if 0 - /* useful for checking register accesses */ - if (length & 0x3) { - A_PRINTF(KERN_ALERT"AR6000: HIF (%s) is not a multiple of 4 bytes, addr:0x%X, len:%d\n", - request & HIF_WRITE ? "write":"read", address, length); - } -#endif - - if (request & HIF_WRITE) { - if ((address >= HIF_MBOX_START_ADDR(0)) && - (address <= HIF_MBOX_END_ADDR(3))) - { - - AR_DEBUG_ASSERT(length <= HIF_MBOX_WIDTH); - - /* - * Mailbox write. Adjust the address so that the last byte - * falls on the EOM address. - */ - address += (HIF_MBOX_WIDTH - length); - } - } - - if (request & HIF_FIXED_ADDRESS) { - opcode = CMD53_FIXED_ADDRESS; - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: Address mode: Fixed 0x%X\n", address)); - } else if (request & HIF_INCREMENTAL_ADDRESS) { - opcode = CMD53_INCR_ADDRESS; - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: Address mode: Incremental 0x%X\n", address)); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, - ("AR6000: Invalid address mode: 0x%08x\n", request)); - status = A_EINVAL; - break; - } - - if (request & HIF_WRITE) { -#if HIF_USE_DMA_BOUNCE_BUFFER - if (BUFFER_NEEDS_BOUNCE(buffer)) { - AR_DEBUG_ASSERT(device->dma_buffer != NULL); - tbuffer = device->dma_buffer; - /* copy the write data to the dma buffer */ - AR_DEBUG_ASSERT(length <= HIF_DMA_BUFFER_SIZE); - memcpy(tbuffer, buffer, length); - bounced = TRUE; - } else { - tbuffer = buffer; - } -#else - tbuffer = buffer; -#endif - if (opcode == CMD53_FIXED_ADDRESS) { - ret = sdio_writesb(device->func, address, tbuffer, length); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: writesb ret=%d address: 0x%X, len: %d, 0x%X\n", - ret, address, length, *(int *)tbuffer)); - } else { - ret = sdio_memcpy_toio(device->func, address, tbuffer, length); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: writeio ret=%d address: 0x%X, len: %d, 0x%X\n", - ret, address, length, *(int *)tbuffer)); - } - } else if (request & HIF_READ) { -#if HIF_USE_DMA_BOUNCE_BUFFER - if (BUFFER_NEEDS_BOUNCE(buffer)) { - AR_DEBUG_ASSERT(device->dma_buffer != NULL); - AR_DEBUG_ASSERT(length <= HIF_DMA_BUFFER_SIZE); - tbuffer = device->dma_buffer; - bounced = TRUE; - } else { - tbuffer = buffer; - } -#else - tbuffer = buffer; -#endif - if (opcode == CMD53_FIXED_ADDRESS) { - ret = sdio_readsb(device->func, tbuffer, address, length); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: readsb ret=%d address: 0x%X, len: %d, 0x%X\n", - ret, address, length, *(int *)tbuffer)); - } else { - ret = sdio_memcpy_fromio(device->func, tbuffer, address, length); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: readio ret=%d address: 0x%X, len: %d, 0x%X\n", - ret, address, length, *(int *)tbuffer)); - } -#if HIF_USE_DMA_BOUNCE_BUFFER - if (bounced) { - /* copy the read data from the dma buffer */ - memcpy(buffer, tbuffer, length); - } -#endif - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, - ("AR6000: Invalid direction: 0x%08x\n", request)); - status = A_EINVAL; - break; - } - - if (ret) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, - ("AR6000: SDIO bus operation failed! MMC stack returned : %d \n", ret)); - status = A_ERROR; - } - } while (FALSE); - - return status; -} - -void AddToAsyncList(HIF_DEVICE *device, BUS_REQUEST *busrequest) -{ - unsigned long flags; - BUS_REQUEST *async; - BUS_REQUEST *active; - - spin_lock_irqsave(&device->asynclock, flags); - active = device->asyncreq; - if (active == NULL) { - device->asyncreq = busrequest; - device->asyncreq->inusenext = NULL; - } else { - for (async = device->asyncreq; - async != NULL; - async = async->inusenext) { - active = async; - } - active->inusenext = busrequest; - busrequest->inusenext = NULL; - } - spin_unlock_irqrestore(&device->asynclock, flags); -} - - -/* queue a read/write request */ -A_STATUS -HIFReadWrite(HIF_DEVICE *device, - A_UINT32 address, - A_UCHAR *buffer, - A_UINT32 length, - A_UINT32 request, - void *context) -{ - A_STATUS status = A_OK; - BUS_REQUEST *busrequest; - - - AR_DEBUG_ASSERT(device != NULL); - AR_DEBUG_ASSERT(device->func != NULL); - - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: Device: %p addr:0x%X\n", device,address)); - - do { - if ((request & HIF_ASYNCHRONOUS) || (request & HIF_SYNCHRONOUS)){ - /* serialize all requests through the async thread */ - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: Execution mode: %s\n", - (request & HIF_ASYNCHRONOUS)?"Async":"Synch")); - busrequest = hifAllocateBusRequest(device); - if (busrequest == NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, - ("AR6000: no async bus requests available (%s, addr:0x%X, len:%d) \n", - request & HIF_READ ? "READ":"WRITE", address, length)); - return A_ERROR; - } - busrequest->address = address; - busrequest->buffer = buffer; - busrequest->length = length; - busrequest->request = request; - busrequest->context = context; - - AddToAsyncList(device, busrequest); - - if (request & HIF_SYNCHRONOUS) { - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: queued sync req: 0x%lX\n", (unsigned long)busrequest)); - - /* wait for completion */ - up(&device->sem_async); - if (down_interruptible(&busrequest->sem_req) != 0) { - /* interrupted, exit */ - return A_ERROR; - } else { - A_STATUS status = busrequest->status; - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: sync return freeing 0x%lX: 0x%X\n", - (unsigned long)busrequest, busrequest->status)); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: freeing req: 0x%X\n", (unsigned int)request)); - hifFreeBusRequest(device, busrequest); - return status; - } - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: queued async req: 0x%lX\n", (unsigned long)busrequest)); - up(&device->sem_async); - return A_PENDING; - } - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, - ("AR6000: Invalid execution mode: 0x%08x\n", (unsigned int)request)); - status = A_EINVAL; - break; - } - } while(0); - - return status; -} -/* thread to serialize all requests, both sync and async */ -static int async_task(void *param) - { - HIF_DEVICE *device; - BUS_REQUEST *request; - A_STATUS status; - unsigned long flags; - - device = (HIF_DEVICE *)param; - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: async task\n")); - set_current_state(TASK_INTERRUPTIBLE); - while(!device->async_shutdown) { - /* wait for work */ - if (down_interruptible(&device->sem_async) != 0) { - /* interrupted, exit */ - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: async task interrupted\n")); - break; - } - if (device->async_shutdown) { - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: async task stopping\n")); - break; - } - /* we want to hold the host over multiple cmds if possible, but holding the host blocks card interrupts */ - sdio_claim_host(device->func); - spin_lock_irqsave(&device->asynclock, flags); - /* pull the request to work on */ - while (device->asyncreq != NULL) { - request = device->asyncreq; - if (request->inusenext != NULL) { - device->asyncreq = request->inusenext; - } else { - device->asyncreq = NULL; - } - spin_unlock_irqrestore(&device->asynclock, flags); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: async_task processing req: 0x%lX\n", (unsigned long)request)); - - if (request->pScatterReq != NULL) { - A_ASSERT(device->scatter_enabled); - /* this is a queued scatter request, pass the request to scatter routine which - * executes it synchronously, note, no need to free the request since scatter requests - * are maintained on a separate list */ - status = DoHifReadWriteScatter(device,request); - } else { - /* call HIFReadWrite in sync mode to do the work */ - status = __HIFReadWrite(device, request->address, request->buffer, - request->length, request->request & ~HIF_SYNCHRONOUS, NULL); - if (request->request & HIF_ASYNCHRONOUS) { - void *context = request->context; - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: async_task freeing req: 0x%lX\n", (unsigned long)request)); - hifFreeBusRequest(device, request); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: async_task completion routine req: 0x%lX\n", (unsigned long)request)); - device->htcCallbacks.rwCompletionHandler(context, status); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: async_task upping req: 0x%lX\n", (unsigned long)request)); - request->status = status; - up(&request->sem_req); - } - } - spin_lock_irqsave(&device->asynclock, flags); - } - spin_unlock_irqrestore(&device->asynclock, flags); - sdio_release_host(device->func); - } - - complete_and_exit(&device->async_completion, 0); - return 0; -} - -static A_INT32 IssueSDCommand(HIF_DEVICE *device, A_UINT32 opcode, A_UINT32 arg, A_UINT32 flags, A_UINT32 *resp) -{ - struct mmc_command cmd; - A_INT32 err; - struct mmc_host *host; - struct sdio_func *func; - - func = device->func; - host = func->card->host; - - memset(&cmd, 0, sizeof(struct mmc_command)); - cmd.opcode = opcode; - cmd.arg = arg; - cmd.flags = flags; - err = mmc_wait_for_cmd(host, &cmd, 3); - - if ((!err) && (resp)) { - *resp = cmd.resp[0]; - } - - return err; -} -A_STATUS ReinitSDIO(HIF_DEVICE *device) -{ - A_INT32 err = 0; - struct mmc_host *host; - struct mmc_card *card; - struct sdio_func *func; - A_UINT8 cmd52_resp; - A_UINT32 clock; - - func = device->func; - card = func->card; - host = card->host; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +ReinitSDIO \n")); - sdio_claim_host(func); - - do { - /* 2.6.32 kernel does part of the SDIO initalization upon resume */ - A_BOOL lt_2_6_32 = (LINUX_VERSION_CODEocr_avail) - 1; - /* emulate the mmc_power_up(...) */ - host->ios.vdd = bit; - host->ios.chip_select = MMC_CS_DONTCARE; - host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN; - host->ios.power_mode = MMC_POWER_UP; - host->ios.bus_width = MMC_BUS_WIDTH_1; - host->ios.timing = MMC_TIMING_LEGACY; - host->ops->set_ios(host, &host->ios); - /* - * This delay should be sufficient to allow the power supply - * to reach the minimum voltage. - */ - msleep(2); - - host->ios.clock = host->f_min; - host->ios.power_mode = MMC_POWER_ON; - host->ops->set_ios(host, &host->ios); - - /* - * This delay must be at least 74 clock sizes, or 1 ms, or the - * time required to reach a stable voltage. - */ - msleep(2); - - /* Issue CMD0. Goto idle state */ - host->ios.chip_select = MMC_CS_HIGH; - host->ops->set_ios(host, &host->ios); - msleep(1); - err = IssueSDCommand(device, MMC_GO_IDLE_STATE, 0, (MMC_RSP_NONE | MMC_CMD_BC), NULL); - host->ios.chip_select = MMC_CS_DONTCARE; - host->ops->set_ios(host, &host->ios); - msleep(1); - host->use_spi_crc = 0; - - if (err) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD0 failed : %d \n",err)); - break; - } - - if (!host->ocr) { - /* Issue CMD5, arg = 0 */ - err = IssueSDCommand(device, SD_IO_SEND_OP_COND, 0, (MMC_RSP_R4 | MMC_CMD_BCR), &resp); - if (err) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD5 failed : %d \n",err)); - break; - } - host->ocr = resp; - } - - /* Issue CMD5, arg = ocr. Wait till card is ready */ - for (i=0;i<100;i++) { - err = IssueSDCommand(device, SD_IO_SEND_OP_COND, host->ocr, (MMC_RSP_R4 | MMC_CMD_BCR), &resp); - if (err) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD5 failed : %d \n",err)); - break; - } - if (resp & MMC_CARD_BUSY) { - break; - } - msleep(10); - } - - if ((i == 100) || (err)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: card in not ready : %d %d \n",i,err)); - break; - } - - /* Issue CMD3, get RCA */ - err = IssueSDCommand(device, SD_SEND_RELATIVE_ADDR, 0, MMC_RSP_R6 | MMC_CMD_BCR, &resp); - if (err) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD3 failed : %d \n",err)); - break; - } - rca = resp >> 16; - host->ios.bus_mode = MMC_BUSMODE_PUSHPULL; - host->ops->set_ios(host, &host->ios); - - /* Issue CMD7, select card */ - err = IssueSDCommand(device, MMC_SELECT_CARD, (rca << 16), MMC_RSP_R1 | MMC_CMD_AC, NULL); - if (err) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD7 failed : %d \n",err)); - break; - } - } - - /* Enable high speed */ - if (card->host->caps & MMC_CAP_SD_HIGHSPEED) { - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("ReinitSDIO: Set high speed mode\n")); - err = Func0_CMD52ReadByte(card, SDIO_CCCR_SPEED, &cmd52_resp); - if (err) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD52 read to CCCR speed register failed : %d \n",err)); - card->state &= ~MMC_STATE_HIGHSPEED; - /* no need to break */ - } else { - err = Func0_CMD52WriteByte(card, SDIO_CCCR_SPEED, (cmd52_resp | SDIO_SPEED_EHS)); - if (err) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD52 write to CCCR speed register failed : %d \n",err)); - break; - } - mmc_card_set_highspeed(card); - host->ios.timing = MMC_TIMING_SD_HS; - host->ops->set_ios(host, &host->ios); - } - } - - /* Set clock */ - if (mmc_card_highspeed(card)) { - clock = 50000000; - } else { - clock = card->cis.max_dtr; - } - - if (clock > host->f_max) { - clock = host->f_max; - } - host->ios.clock = clock; - host->ops->set_ios(host, &host->ios); - - - if (card->host->caps & MMC_CAP_4_BIT_DATA) { - /* CMD52: Set bus width & disable card detect resistor */ - err = Func0_CMD52WriteByte(card, SDIO_CCCR_IF, SDIO_BUS_CD_DISABLE | SDIO_BUS_WIDTH_4BIT); - if (err) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD52 to set bus mode failed : %d \n",err)); - break; - } - host->ios.bus_width = MMC_BUS_WIDTH_4; - host->ops->set_ios(host, &host->ios); - } - } while (0); - - sdio_release_host(func); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -ReinitSDIO \n")); - - return (err) ? A_ERROR : A_OK; -} - -#if defined(CONFIG_PM) -/* - * Setup IRQ mode for deep sleep and WoW - * Switch back to 1 bits mode when we suspend for WoW in order to - * detect SDIO irq without clock. - * Re-enable async 4-bit irq mode for some host controllers after resume - */ -static int SdioEnable4bits(HIF_DEVICE *device, int enable) -{ - int ret = 0; - struct sdio_func *func = device->func; - struct mmc_card *card = func->card; - struct mmc_host *host = card->host; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) - unsigned char ctrl = 0; - unsigned int width; -#ifdef SDIO_BUS_WIDTH_8BIT - unsigned char wide_mask = (SDIO_BUS_WIDTH_4BIT|SDIO_BUS_WIDTH_8BIT); -#else - unsigned char wide_mask = (SDIO_BUS_WIDTH_4BIT); -#endif -#endif - - if (!(host->caps & (MMC_CAP_4_BIT_DATA))) - return 0; - - if (card->cccr.low_speed && !card->cccr.wide_bus) - return 0; - - sdio_claim_host(func); - do { - /* 2.6.34 will setup 1bits automatically. No need to setup */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) - ret = Func0_CMD52ReadByte(card, SDIO_CCCR_IF, &ctrl); - if (ret) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Fail to read CCCR_IF : %d \n", __func__, ret)); - break; - } - if (enable) { - width = MMC_BUS_WIDTH_4; - ctrl &= ~(SDIO_BUS_WIDTH_1BIT|wide_mask); - ctrl |= SDIO_BUS_WIDTH_4BIT; - } else { - width = MMC_BUS_WIDTH_1; - ctrl &= ~(wide_mask); - } - - ret = Func0_CMD52WriteByte(card, SDIO_CCCR_IF, ctrl); - if (ret) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Fail to write CCCR_IF : %d \n", __func__, ret)); - break; - } - host->ios.bus_width = width; - host->ops->set_ios(host, &host->ios); -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) */ - - if ((device->id->device & MANUFACTURER_ID_AR6K_BASE_MASK) >= MANUFACTURER_ID_AR6003_BASE) { - /* Re-enable 4-bit ASYNC interrupt on AR6003x after system resume for some host controller */ - ret = Func0_CMD52WriteByte(func->card, CCCR_SDIO_IRQ_MODE_REG, enable ? SDIO_IRQ_MODE_ASYNC_4BIT_IRQ : 0); - if (ret) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("AR6000: failed to setup 4-bit ASYNC IRQ mode into %d err %d \n", enable, ret)); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("AR6000: Setup 4-bit ASYNC IRQ mode into %d successfully\n", enable)); - } - } - } while (0); - sdio_release_host(func); - return ret; -} -#endif -A_STATUS -PowerStateChangeNotify(HIF_DEVICE *device, HIF_DEVICE_POWER_CHANGE_TYPE config) -{ - A_STATUS status = A_OK; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) && defined(CONFIG_PM) - struct sdio_func *func = device->func; - int old_reset_val; - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +PowerStateChangeNotify %d\n", config)); - switch (config) { - case HIF_DEVICE_POWER_DOWN: - /* Disable 4bits in order to let SDIO bus detect DAT1 as interrupt source */ - SdioEnable4bits(device, 0); - break; - case HIF_DEVICE_POWER_CUT: - old_reset_val = reset_sdio_on_unload; - reset_sdio_on_unload = 1; - status = hifDisableFunc(device, func); - reset_sdio_on_unload = old_reset_val; - if (!device->is_suspend) { - device->powerConfig = config; - mmc_detect_change(device->host, HZ/3); - } - break; - case HIF_DEVICE_POWER_UP: - if (device->powerConfig == HIF_DEVICE_POWER_CUT) { - if (device->is_suspend) { - status = ReinitSDIO(device); - if (status == A_OK) { - status = hifEnableFunc(device, func); - } - } else { - /* device->func is bad pointer at this time */ - mmc_detect_change(device->host, 0); - return A_PENDING; /* Don't change powerConfig status */ - } - } else if (device->powerConfig == HIF_DEVICE_POWER_DOWN) { - int ret = SdioEnable4bits(device, 1); - status = (ret==0) ? A_OK : A_ERROR; - } - break; - } - device->powerConfig = config; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -PowerStateChangeNotify\n")); -#endif - return status; -} - -A_STATUS -HIFConfigureDevice(HIF_DEVICE *device, HIF_DEVICE_CONFIG_OPCODE opcode, - void *config, A_UINT32 configLen) -{ - A_UINT32 count; - A_STATUS status = A_OK; - - switch(opcode) { - case HIF_DEVICE_GET_MBOX_BLOCK_SIZE: - ((A_UINT32 *)config)[0] = HIF_MBOX0_BLOCK_SIZE; - ((A_UINT32 *)config)[1] = HIF_MBOX1_BLOCK_SIZE; - ((A_UINT32 *)config)[2] = HIF_MBOX2_BLOCK_SIZE; - ((A_UINT32 *)config)[3] = HIF_MBOX3_BLOCK_SIZE; - break; - - case HIF_DEVICE_GET_MBOX_ADDR: - for (count = 0; count < 4; count ++) { - ((A_UINT32 *)config)[count] = HIF_MBOX_START_ADDR(count); - } - - if (configLen >= sizeof(HIF_DEVICE_MBOX_INFO)) { - SetExtendedMboxWindowInfo((A_UINT16)device->func->device, - (HIF_DEVICE_MBOX_INFO *)config); - } - - break; - case HIF_DEVICE_GET_PENDING_EVENTS_FUNC: - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("AR6000: configuration opcode %d is not used for Linux SDIO stack", opcode)); - status = A_ERROR; - break; - case HIF_DEVICE_GET_IRQ_PROC_MODE: - *((HIF_DEVICE_IRQ_PROCESSING_MODE *)config) = HIF_DEVICE_IRQ_SYNC_ONLY; - break; - case HIF_DEVICE_GET_RECV_EVENT_MASK_UNMASK_FUNC: - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("AR6000: configuration opcode %d is not used for Linux SDIO stack", opcode)); - status = A_ERROR; - break; - case HIF_CONFIGURE_QUERY_SCATTER_REQUEST_SUPPORT: - if (!device->scatter_enabled) { - return A_ENOTSUP; - } - status = SetupHIFScatterSupport(device, (HIF_DEVICE_SCATTER_SUPPORT_INFO *)config); - if (A_FAILED(status)) { - device->scatter_enabled = FALSE; - } - break; - case HIF_DEVICE_GET_OS_DEVICE: - /* pass back a pointer to the SDIO function's "dev" struct */ - if (device->func) { - ((HIF_DEVICE_OS_DEVICE_INFO *)config)->pOSDevice = &device->func->dev; - } else { - ((HIF_DEVICE_OS_DEVICE_INFO *)config)->pOSDevice = NULL; - status = A_DEVICE_NOT_FOUND; - } - break; - case HIF_DEVICE_POWER_STATE_CHANGE: - status = PowerStateChangeNotify(device, *(HIF_DEVICE_POWER_CHANGE_TYPE *)config); - break; - case HIF_DEVICE_GET_IRQ_YIELD_PARAMS: - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, - ("AR6000: configuration opcode %d is only used for RTOS systems, not Linux systems", opcode)); - status = A_ERROR; - break; - default: - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, - ("AR6000: Unsupported configuration opcode: %d\n", opcode)); - status = A_ERROR; - } - - return status; -} - -void -HIFShutDownDevice(HIF_DEVICE *device) -{ - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +HIFShutDownDevice\n")); - if (device != NULL) { - AR_DEBUG_ASSERT(device->powerConfig==HIF_DEVICE_POWER_CUT || device->func != NULL); - } else { - int i; - /* since we are unloading the driver anyways, reset all cards in case the SDIO card - * is externally powered and we are unloading the SDIO stack. This avoids the problem when - * the SDIO stack is reloaded and attempts are made to re-enumerate a card that is already - * enumerated */ - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: HIFShutDownDevice, resetting\n")); - ResetAllCards(); - - /* Unregister with bus driver core */ - if (registered) { - registered = 0; - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, - ("AR6000: Unregistering with the bus driver\n")); - sdio_unregister_driver(&ar6k_driver); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, - ("AR6000: Unregistered\n")); - } - - for (i=0; ifunc == NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, - ("AR6000: Remove pending hif_device %p\n", hif_devices[i])); - delHifDevice(hif_devices[i]); - hif_devices[i] = NULL; - } - } - } - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -HIFShutDownDevice\n")); -} - -static void -hifIRQHandler(struct sdio_func *func) -{ - A_STATUS status; - HIF_DEVICE *device; - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifIRQHandler\n")); - - device = getHifDevice(func); - atomic_set(&device->irqHandling, 1); - /* release the host during ints so we can pick it back up when we process cmds */ - sdio_release_host(device->func); - status = device->htcCallbacks.dsrHandler(device->htcCallbacks.context); - sdio_claim_host(device->func); - atomic_set(&device->irqHandling, 0); - AR_DEBUG_ASSERT(status == A_OK || status == A_ECANCELED); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifIRQHandler\n")); -} - -/* handle HTC startup via thread*/ -static int startup_task(void *param) -{ - HIF_DEVICE *device; - - device = (HIF_DEVICE *)param; - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: call HTC from startup_task\n")); - /* start up inform DRV layer */ - if ((osdrvCallbacks.deviceInsertedHandler(osdrvCallbacks.context,device)) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: Device rejected\n")); - } - return 0; -} - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) && defined(CONFIG_PM) -static int enable_task(void *param) -{ - HIF_DEVICE *device; - device = (HIF_DEVICE *)param; - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: call from resume_task\n")); - - /* start up inform DRV layer */ - if (device && - device->claimedContext && - osdrvCallbacks.devicePowerChangeHandler && - osdrvCallbacks.devicePowerChangeHandler(device->claimedContext, HIF_DEVICE_POWER_UP) != A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: Device rejected\n")); - } - - return 0; -} -#endif - -static void hifAssignTargetHeaders(A_UINT16 SDIO_ID) -{ - switch (SDIO_ID) { - case MANUFACTURER_ID_AR6003_BASE: - hif_register_tbl_attach(HIF_TYPE_AR6003); - break; - - case MANUFACTURER_ID_MCKINLEY_BASE: - hif_register_tbl_attach(HIF_TYPE_MCKINLEY); - break; - default: - hif_register_tbl_attach(HIF_TYPE_AR6003); - break; - } -} - -static int hifDeviceInserted(struct sdio_func *func, const struct sdio_device_id *id) -{ - int i; - int ret; - HIF_DEVICE * device = NULL; - int count; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, - ("AR6000: hifDeviceInserted, Function: 0x%X, Vendor ID: 0x%X, Device ID: 0x%X, block size: 0x%X/0x%X\n", - func->num, func->vendor, func->device, func->max_blksize, func->cur_blksize)); - - for (i=0; ipowerConfig == HIF_DEVICE_POWER_CUT && - hifdevice->host == func->card->host) { - hifdevice->func = func; - hifdevice->powerConfig = HIF_DEVICE_POWER_UP; - sdio_set_drvdata(func, hifdevice); - device = getHifDevice(func); - ret = 0; - break; - } - } - - if (device==NULL) { - addHifDevice(func); - device = getHifDevice(func); - hifAssignTargetHeaders(id->device); - - for (i=0; iid = id; - device->host = func->card->host; - device->is_disabled = TRUE; - - spin_lock_init(&device->lock); - - spin_lock_init(&device->asynclock); - - DL_LIST_INIT(&device->ScatterReqHead); - - if (!nohifscattersupport) { - /* try to allow scatter operation on all instances, - * unless globally overridden */ - device->scatter_enabled = TRUE; - } - - /* Initialize the bus requests to be used later */ - A_MEMZERO(device->busRequest, sizeof(device->busRequest)); - for (count = 0; count < BUS_REQUEST_MAX_NUM; count ++) { - sema_init(&device->busRequest[count].sem_req, 0); - hifFreeBusRequest(device, &device->busRequest[count]); - } - sema_init(&device->sem_async, 0); - } - - ret = hifEnableFunc(device, func); - return (ret == A_OK || ret == A_PENDING) ? 0 : -1; -} - - -void -HIFAckInterrupt(HIF_DEVICE *device) -{ - AR_DEBUG_ASSERT(device != NULL); - - /* Acknowledge our function IRQ */ -} - -void -HIFUnMaskInterrupt(HIF_DEVICE *device) -{ - int ret;; - - AR_DEBUG_ASSERT(device != NULL); - AR_DEBUG_ASSERT(device->func != NULL); - - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: HIFUnMaskInterrupt\n")); - - /* Register the IRQ Handler */ - sdio_claim_host(device->func); - ret = sdio_claim_irq(device->func, hifIRQHandler); - sdio_release_host(device->func); - AR_DEBUG_ASSERT(ret == 0); -} - -void HIFMaskInterrupt(HIF_DEVICE *device) -{ - int ret; - AR_DEBUG_ASSERT(device != NULL); - AR_DEBUG_ASSERT(device->func != NULL); - - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: HIFMaskInterrupt\n")); - - /* Mask our function IRQ */ - sdio_claim_host(device->func); - while (atomic_read(&device->irqHandling)) { - sdio_release_host(device->func); - schedule_timeout_interruptible(HZ/10); - sdio_claim_host(device->func); - } - ret = sdio_release_irq(device->func); - sdio_release_host(device->func); - if (ret) { - if (ret == -ETIMEDOUT) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, - ("AR6000: Timeout to mask interrupt. Card removed?\n")); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, - ("AR6000: Unable to mask interrupt %d\n", ret)); - AR_DEBUG_ASSERT(ret == 0); - } - } -} - -BUS_REQUEST *hifAllocateBusRequest(HIF_DEVICE *device) -{ - BUS_REQUEST *busrequest; - unsigned long flag; - - /* Acquire lock */ - spin_lock_irqsave(&device->lock, flag); - - /* Remove first in list */ - if((busrequest = device->s_busRequestFreeQueue) != NULL) - { - device->s_busRequestFreeQueue = busrequest->next; - } - /* Release lock */ - spin_unlock_irqrestore(&device->lock, flag); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: hifAllocateBusRequest: 0x%p\n", busrequest)); - return busrequest; -} - -void -hifFreeBusRequest(HIF_DEVICE *device, BUS_REQUEST *busrequest) -{ - unsigned long flag; - - AR_DEBUG_ASSERT(busrequest != NULL); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: hifFreeBusRequest: 0x%p\n", busrequest)); - /* Acquire lock */ - spin_lock_irqsave(&device->lock, flag); - - - /* Insert first in list */ - busrequest->next = device->s_busRequestFreeQueue; - busrequest->inusenext = NULL; - device->s_busRequestFreeQueue = busrequest; - - /* Release lock */ - spin_unlock_irqrestore(&device->lock, flag); -} - -static A_STATUS hifDisableFunc(HIF_DEVICE *device, struct sdio_func *func) -{ - int ret; - A_STATUS status = A_OK; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDisableFunc\n")); - device = getHifDevice(func); - if (!IS_ERR(device->async_task)) { - init_completion(&device->async_completion); - device->async_shutdown = 1; - up(&device->sem_async); - wait_for_completion(&device->async_completion); - device->async_task = NULL; - sema_init(&device->sem_async, 0); - } - /* Disable the card */ - sdio_claim_host(device->func); - ret = sdio_disable_func(device->func); - if (ret) { - status = A_ERROR; - } - - if (reset_sdio_on_unload && status == A_OK) { - /* reset the SDIO interface. This is useful in automated testing where the card - * does not need to be removed at the end of the test. It is expected that the user will - * also unload/reload the host controller driver to force the bus driver to re-enumerate the slot */ - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("AR6000: reseting SDIO card back to uninitialized state \n")); - - /* NOTE : sdio_f0_writeb() cannot be used here, that API only allows access - * to undefined registers in the range of: 0xF0-0xFF */ - - ret = Func0_CMD52WriteByte(device->func->card, SDIO_CCCR_ABORT, (1 << 3)); - if (ret) { - status = A_ERROR; - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("AR6000: reset failed : %d \n",ret)); - } - } - - sdio_release_host(device->func); - - if (status == A_OK) { - device->is_disabled = TRUE; - } - CleanupHIFScatterResources(device); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifDisableFunc\n")); - - return status; -} - -static A_STATUS hifEnableFunc(HIF_DEVICE *device, struct sdio_func *func) -{ - struct task_struct* pTask; - const char *taskName = NULL; - int (*taskFunc)(void *) = NULL; - int ret = A_OK; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifEnableFunc\n")); - device = getHifDevice(func); - - if (device->is_disabled) { - /* enable the SDIO function */ - sdio_claim_host(func); - - if ((device->id->device & MANUFACTURER_ID_AR6K_BASE_MASK) >= MANUFACTURER_ID_AR6003_BASE) { - /* enable 4-bit ASYNC interrupt on AR6003 or later devices */ - ret = Func0_CMD52WriteByte(func->card, CCCR_SDIO_IRQ_MODE_REG, SDIO_IRQ_MODE_ASYNC_4BIT_IRQ); - if (ret) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("AR6000: failed to enable 4-bit ASYNC IRQ mode %d \n",ret)); - sdio_release_host(func); - return A_ERROR; - } - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: 4-bit ASYNC IRQ mode enabled\n")); - } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - /* give us some time to enable, in ms */ - func->enable_timeout = 100; -#endif - ret = sdio_enable_func(func); - if (ret) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("AR6000: %s(), Unable to enable AR6K: 0x%X\n", - __FUNCTION__, ret)); - sdio_release_host(func); - return A_ERROR; - } - ret = sdio_set_block_size(func, HIF_MBOX_BLOCK_SIZE); - sdio_release_host(func); - if (ret) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("AR6000: %s(), Unable to set block size 0x%x AR6K: 0x%X\n", - __FUNCTION__, HIF_MBOX_BLOCK_SIZE, ret)); - return A_ERROR; - } - device->is_disabled = FALSE; - /* create async I/O thread */ - if (!device->async_task) { - device->async_shutdown = 0; - device->async_task = kthread_create(async_task, - (void *)device, - "AR6K Async"); - if (IS_ERR(device->async_task)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("AR6000: %s(), to create async task\n", __FUNCTION__)); - return A_ERROR; - } - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: start async task\n")); - wake_up_process(device->async_task ); - } - } - - if (!device->claimedContext) { - taskFunc = startup_task; - taskName = "AR6K startup"; - ret = A_OK; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) && defined(CONFIG_PM) - } else { - taskFunc = enable_task; - taskName = "AR6K enable"; - ret = A_PENDING; -#endif /* CONFIG_PM */ - } - /* create resume thread */ - pTask = kthread_create(taskFunc, (void *)device, taskName); - if (IS_ERR(pTask)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("AR6000: %s(), to create enabel task\n", __FUNCTION__)); - return A_ERROR; - } - wake_up_process(pTask); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifEnableFunc\n")); - - /* task will call the enable func, indicate pending */ - return ret; -} - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) && defined(CONFIG_PM) -static int hifDeviceSuspend(struct device *dev) -{ - struct sdio_func *func=dev_to_sdio_func(dev); - A_STATUS status = A_OK; - HIF_DEVICE *device = getHifDevice(func); - -#if defined(MMC_PM_KEEP_POWER) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - struct mmc_host *host = NULL; - if (device && device->func) { - host = device->func->card->host; - } -#endif - - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceSuspend\n")); - if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) { - device->is_suspend = TRUE; /* set true first for PowerStateChangeNotify(..) */ - status = osdrvCallbacks.deviceSuspendHandler(device->claimedContext); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifDeviceSuspend\n")); - - switch (status) { - case A_OK: -#if defined(MMC_PM_KEEP_POWER) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - if (host) { - host->pm_flags &= ~(MMC_PM_KEEP_POWER|MMC_PM_WAKE_SDIO_IRQ); - } -#endif - return 0; - case A_EBUSY: -#if defined(MMC_PM_KEEP_POWER) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) - if (host) { - /* Some controller need to WAKE_SDIO_IRQ in order to wake up by DAT1 */ - host->pm_flags |= (MMC_PM_KEEP_POWER|MMC_PM_WAKE_SDIO_IRQ); - //host->pm_flags &= host->pm_caps; - } - return 0; -#else - return -EBUSY; /* Hack for kernel to support deep sleep and wow */ -#endif - default: - device->is_suspend = FALSE; - return -1; - } -} - -static int hifDeviceResume(struct device *dev) -{ - struct sdio_func *func=dev_to_sdio_func(dev); - A_STATUS status = A_OK; - HIF_DEVICE *device; - - device = getHifDevice(func); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceResume\n")); - if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) { - status = osdrvCallbacks.deviceResumeHandler(device->claimedContext); - device->is_suspend = FALSE; - } - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifDeviceResume\n")); - - return A_SUCCESS(status) ? 0 : status; -} -#endif /* CONFIG_PM */ - -static void hifDeviceRemoved(struct sdio_func *func) -{ - A_STATUS status = A_OK; - HIF_DEVICE *device; - AR_DEBUG_ASSERT(func != NULL); - - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceRemoved\n")); - device = getHifDevice(func); - - if (device->powerConfig == HIF_DEVICE_POWER_CUT) { - device->func = NULL; /* func will be free by mmc stack */ - return; /* Just return for cut-off mode */ - } else { - int i; - for (i=0; iclaimedContext != NULL) { - status = osdrvCallbacks.deviceRemovedHandler(device->claimedContext, device); - } - - if (device->is_disabled) { - device->is_disabled = FALSE; - } else { - status = hifDisableFunc(device, func); - } - - delHifDevice(device); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, - ("AR6000: Unable to disable sdio func. Card removed?\n")); - } - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifDeviceRemoved\n")); -} - -/* - * This should be moved to AR6K HTC layer. - */ -A_STATUS hifWaitForPendingRecv(HIF_DEVICE *device) -{ - A_INT32 cnt = 10; - A_UINT8 host_int_status; - A_STATUS status = A_OK; - - do { - while (atomic_read(&device->irqHandling)) { - /* wait until irq handler finished all the jobs */ - schedule_timeout(HZ/10); - } - /* check if there is any pending irq due to force done */ - host_int_status = 0; - status = HIFReadWrite(device, HOST_INT_STATUS_ADDRESS, - (A_UINT8 *)&host_int_status, sizeof(host_int_status), - HIF_RD_SYNC_BYTE_INC, NULL); - host_int_status = A_SUCCESS(status) ? (host_int_status & (1 << 0)) : 0; - if (host_int_status) { - schedule(); /* schedule for next dsrHandler */ - } - } while (host_int_status && --cnt > 0); - - if (host_int_status && cnt == 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, - ("AR6000: %s(), Unable clear up pending IRQ before the system suspended\n", __FUNCTION__)); - } - - return A_OK; -} - - -static HIF_DEVICE * -addHifDevice(struct sdio_func *func) -{ - HIF_DEVICE *hifdevice; - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: addHifDevice\n")); - AR_DEBUG_ASSERT(func != NULL); - hifdevice = (HIF_DEVICE *)A_MALLOC(sizeof(HIF_DEVICE)); - AR_DEBUG_ASSERT(hifdevice != NULL); - A_MEMZERO(hifdevice, sizeof(*hifdevice)); -#if HIF_USE_DMA_BOUNCE_BUFFER - hifdevice->dma_buffer = A_MALLOC(HIF_DMA_BUFFER_SIZE); - AR_DEBUG_ASSERT(hifdevice->dma_buffer != NULL); -#endif - hifdevice->func = func; - hifdevice->powerConfig = HIF_DEVICE_POWER_UP; - sdio_set_drvdata(func, hifdevice); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: addHifDevice; 0x%p\n", hifdevice)); - return hifdevice; -} - -static HIF_DEVICE * -getHifDevice(struct sdio_func *func) -{ - AR_DEBUG_ASSERT(func != NULL); - return (HIF_DEVICE *)sdio_get_drvdata(func); -} - -static void -delHifDevice(HIF_DEVICE * device) -{ - AR_DEBUG_ASSERT(device!= NULL); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: delHifDevice; 0x%p\n", device)); - if (device->dma_buffer != NULL) { - A_FREE(device->dma_buffer); - } - A_FREE(device); -} - -static void ResetAllCards(void) -{ -} - -void HIFClaimDevice(HIF_DEVICE *device, void *context) -{ - device->claimedContext = context; -} - -void HIFReleaseDevice(HIF_DEVICE *device) -{ - device->claimedContext = NULL; -} - -A_STATUS HIFAttachHTC(HIF_DEVICE *device, HTC_CALLBACKS *callbacks) -{ - if (device->htcCallbacks.context != NULL) { - /* already in use! */ - return A_ERROR; - } - device->htcCallbacks = *callbacks; - return A_OK; -} - -void HIFDetachHTC(HIF_DEVICE *device) -{ - A_MEMZERO(&device->htcCallbacks,sizeof(device->htcCallbacks)); -} - -#define SDIO_SET_CMD52_ARG(arg,rw,func,raw,address,writedata) \ - (arg) = (((rw) & 1) << 31) | \ - (((func) & 0x7) << 28) | \ - (((raw) & 1) << 27) | \ - (1 << 26) | \ - (((address) & 0x1FFFF) << 9) | \ - (1 << 8) | \ - ((writedata) & 0xFF) - -#define SDIO_SET_CMD52_READ_ARG(arg,func,address) \ - SDIO_SET_CMD52_ARG(arg,0,(func),0,address,0x00) -#define SDIO_SET_CMD52_WRITE_ARG(arg,func,address,value) \ - SDIO_SET_CMD52_ARG(arg,1,(func),0,address,value) - -static int Func0_CMD52WriteByte(struct mmc_card *card, unsigned int address, unsigned char byte) -{ - struct mmc_command ioCmd; - unsigned long arg; - - memset(&ioCmd,0,sizeof(ioCmd)); - SDIO_SET_CMD52_WRITE_ARG(arg,0,address,byte); - ioCmd.opcode = SD_IO_RW_DIRECT; - ioCmd.arg = arg; - ioCmd.flags = MMC_RSP_R5 | MMC_CMD_AC; - - return mmc_wait_for_cmd(card->host, &ioCmd, 0); -} - -static int Func0_CMD52ReadByte(struct mmc_card *card, unsigned int address, unsigned char *byte) -{ - struct mmc_command ioCmd; - unsigned long arg; - A_INT32 err; - - memset(&ioCmd,0,sizeof(ioCmd)); - SDIO_SET_CMD52_READ_ARG(arg,0,address); - ioCmd.opcode = SD_IO_RW_DIRECT; - ioCmd.arg = arg; - ioCmd.flags = MMC_RSP_R5 | MMC_CMD_AC; - - err = mmc_wait_for_cmd(card->host, &ioCmd, 0); - - if ((!err) && (byte)) { - *byte = ioCmd.resp[0] & 0xFF; - } - - return err; -} diff --git a/drivers/net/wireless/ar6003/host/hif/sdio/linux_sdio/src/hif_scatter.c b/drivers/net/wireless/ar6003/host/hif/sdio/linux_sdio/src/hif_scatter.c deleted file mode 100644 index 8e755231a35b..000000000000 --- a/drivers/net/wireless/ar6003/host/hif/sdio/linux_sdio/src/hif_scatter.c +++ /dev/null @@ -1,393 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2009-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// HIF scatter implementation -// -// Author(s): ="Atheros" -//============================================================================== - -#include -#include -#include -#include -#include -#include -#include "hif_internal.h" -#define ATH_MODULE_NAME hif -#include "a_debug.h" - -#ifdef HIF_LINUX_MMC_SCATTER_SUPPORT - -#define _CMD53_ARG_READ 0 -#define _CMD53_ARG_WRITE 1 -#define _CMD53_ARG_BLOCK_BASIS 1 -#define _CMD53_ARG_FIXED_ADDRESS 0 -#define _CMD53_ARG_INCR_ADDRESS 1 - -#define SDIO_SET_CMD53_ARG(arg,rw,func,mode,opcode,address,bytes_blocks) \ - (arg) = (((rw) & 1) << 31) | \ - (((func) & 0x7) << 28) | \ - (((mode) & 1) << 27) | \ - (((opcode) & 1) << 26) | \ - (((address) & 0x1FFFF) << 9) | \ - ((bytes_blocks) & 0x1FF) - -static void FreeScatterReq(HIF_DEVICE *device, HIF_SCATTER_REQ *pReq) -{ - unsigned long flag; - - spin_lock_irqsave(&device->lock, flag); - - DL_ListInsertTail(&device->ScatterReqHead, &pReq->ListLink); - - spin_unlock_irqrestore(&device->lock, flag); - -} - -static HIF_SCATTER_REQ *AllocScatterReq(HIF_DEVICE *device) -{ - DL_LIST *pItem; - unsigned long flag; - - spin_lock_irqsave(&device->lock, flag); - - pItem = DL_ListRemoveItemFromHead(&device->ScatterReqHead); - - spin_unlock_irqrestore(&device->lock, flag); - - if (pItem != NULL) { - return A_CONTAINING_STRUCT(pItem, HIF_SCATTER_REQ, ListLink); - } - - return NULL; -} - - /* called by async task to perform the operation synchronously using direct MMC APIs */ -A_STATUS DoHifReadWriteScatter(HIF_DEVICE *device, BUS_REQUEST *busrequest) -{ - int i; - A_UINT8 rw; - A_UINT8 opcode; - struct mmc_request mmcreq; - struct mmc_command cmd; - struct mmc_data data; - HIF_SCATTER_REQ_PRIV *pReqPriv; - HIF_SCATTER_REQ *pReq; - A_STATUS status = A_OK; - struct scatterlist *pSg; - - pReqPriv = busrequest->pScatterReq; - - A_ASSERT(pReqPriv != NULL); - - pReq = pReqPriv->pHifScatterReq; - - memset(&mmcreq, 0, sizeof(struct mmc_request)); - memset(&cmd, 0, sizeof(struct mmc_command)); - memset(&data, 0, sizeof(struct mmc_data)); - - data.blksz = HIF_MBOX_BLOCK_SIZE; - data.blocks = pReq->TotalLength / HIF_MBOX_BLOCK_SIZE; - - AR_DEBUG_PRINTF(ATH_DEBUG_SCATTER, ("HIF-SCATTER: (%s) Address: 0x%X, (BlockLen: %d, BlockCount: %d) , (tot:%d,sg:%d)\n", - (pReq->Request & HIF_WRITE) ? "WRITE":"READ", pReq->Address, data.blksz, data.blocks, - pReq->TotalLength,pReq->ValidScatterEntries)); - - if (pReq->Request & HIF_WRITE) { - rw = _CMD53_ARG_WRITE; - data.flags = MMC_DATA_WRITE; - } else { - rw = _CMD53_ARG_READ; - data.flags = MMC_DATA_READ; - } - - if (pReq->Request & HIF_FIXED_ADDRESS) { - opcode = _CMD53_ARG_FIXED_ADDRESS; - } else { - opcode = _CMD53_ARG_INCR_ADDRESS; - } - - /* fill SG entries */ - pSg = pReqPriv->sgentries; - sg_init_table(pSg, pReq->ValidScatterEntries); - - /* assemble SG list */ - for (i = 0 ; i < pReq->ValidScatterEntries ; i++, pSg++) { - /* setup each sg entry */ - if ((unsigned long)pReq->ScatterList[i].pBuffer & 0x3) { - /* note some scatter engines can handle unaligned buffers, print this - * as informational only */ - AR_DEBUG_PRINTF(ATH_DEBUG_SCATTER, - ("HIF: (%s) Scatter Buffer is unaligned 0x%lx\n", - pReq->Request & HIF_WRITE ? "WRITE":"READ", - (unsigned long)pReq->ScatterList[i].pBuffer)); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_SCATTER, (" %d: Addr:0x%lX, Len:%d \n", - i,(unsigned long)pReq->ScatterList[i].pBuffer,pReq->ScatterList[i].Length)); - - sg_set_buf(pSg, pReq->ScatterList[i].pBuffer, pReq->ScatterList[i].Length); - } - /* set scatter-gather table for request */ - data.sg = pReqPriv->sgentries; - data.sg_len = pReq->ValidScatterEntries; - /* set command argument */ - SDIO_SET_CMD53_ARG(cmd.arg, - rw, - device->func->num, - _CMD53_ARG_BLOCK_BASIS, - opcode, - pReq->Address, - data.blocks); - - cmd.opcode = SD_IO_RW_EXTENDED; - cmd.flags = MMC_RSP_SPI_R5 | MMC_RSP_R5 | MMC_CMD_ADTC; - - mmcreq.cmd = &cmd; - mmcreq.data = &data; - - mmc_set_data_timeout(&data, device->func->card); - /* synchronous call to process request */ - mmc_wait_for_req(device->func->card->host, &mmcreq); - - if (cmd.error) { - status = A_ERROR; - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("HIF-SCATTER: cmd error: %d \n",cmd.error)); - } - - if (data.error) { - status = A_ERROR; - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("HIF-SCATTER: data error: %d \n",data.error)); - } - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("HIF-SCATTER: FAILED!!! (%s) Address: 0x%X, Block mode (BlockLen: %d, BlockCount: %d)\n", - (pReq->Request & HIF_WRITE) ? "WRITE":"READ",pReq->Address, data.blksz, data.blocks)); - } - - /* set completion status, fail or success */ - pReq->CompletionStatus = status; - - if (pReq->Request & HIF_ASYNCHRONOUS) { - AR_DEBUG_PRINTF(ATH_DEBUG_SCATTER, ("HIF-SCATTER: async_task completion routine req: 0x%lX (%d)\n",(unsigned long)busrequest, status)); - /* complete the request */ - A_ASSERT(pReq->CompletionRoutine != NULL); - pReq->CompletionRoutine(pReq); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_SCATTER, ("HIF-SCATTER async_task upping busrequest : 0x%lX (%d)\n", (unsigned long)busrequest,status)); - /* signal wait */ - up(&busrequest->sem_req); - } - - return status; -} - - /* callback to issue a read-write scatter request */ -static A_STATUS HifReadWriteScatter(HIF_DEVICE *device, HIF_SCATTER_REQ *pReq) -{ - A_STATUS status = A_EINVAL; - A_UINT32 request = pReq->Request; - HIF_SCATTER_REQ_PRIV *pReqPriv = (HIF_SCATTER_REQ_PRIV *)pReq->HIFPrivate[0]; - - do { - - A_ASSERT(pReqPriv != NULL); - - AR_DEBUG_PRINTF(ATH_DEBUG_SCATTER, ("HIF-SCATTER: total len: %d Scatter Entries: %d\n", - pReq->TotalLength, pReq->ValidScatterEntries)); - - if (!(request & HIF_EXTENDED_IO)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, - ("HIF-SCATTER: Invalid command type: 0x%08x\n", request)); - break; - } - - if (!(request & (HIF_SYNCHRONOUS | HIF_ASYNCHRONOUS))) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, - ("HIF-SCATTER: Invalid execution mode: 0x%08x\n", request)); - break; - } - - if (!(request & HIF_BLOCK_BASIS)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, - ("HIF-SCATTER: Invalid data mode: 0x%08x\n", request)); - break; - } - - if (pReq->TotalLength > MAX_SCATTER_REQ_TRANSFER_SIZE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, - ("HIF-SCATTER: Invalid length: %d \n", pReq->TotalLength)); - break; - } - - if (pReq->TotalLength == 0) { - A_ASSERT(FALSE); - break; - } - - /* add bus request to the async list for the async I/O thread to process */ - AddToAsyncList(device, pReqPriv->busrequest); - - if (request & HIF_SYNCHRONOUS) { - AR_DEBUG_PRINTF(ATH_DEBUG_SCATTER, ("HIF-SCATTER: queued sync req: 0x%lX\n", (unsigned long)pReqPriv->busrequest)); - /* signal thread and wait */ - up(&device->sem_async); - if (down_interruptible(&pReqPriv->busrequest->sem_req) != 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR,("HIF-SCATTER: interrupted! \n")); - /* interrupted, exit */ - status = A_ERROR; - break; - } else { - status = pReq->CompletionStatus; - } - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_SCATTER, ("HIF-SCATTER: queued async req: 0x%lX\n", (unsigned long)pReqPriv->busrequest)); - /* wake thread, it will process and then take care of the async callback */ - up(&device->sem_async); - status = A_OK; - } - - } while (FALSE); - - if (A_FAILED(status) && (request & HIF_ASYNCHRONOUS)) { - pReq->CompletionStatus = status; - pReq->CompletionRoutine(pReq); - status = A_OK; - } - - return status; -} - - /* setup of HIF scatter resources */ -A_STATUS SetupHIFScatterSupport(HIF_DEVICE *device, HIF_DEVICE_SCATTER_SUPPORT_INFO *pInfo) -{ - A_STATUS status = A_ERROR; - int i; - HIF_SCATTER_REQ_PRIV *pReqPriv; - BUS_REQUEST *busrequest; - - do { - - /* check if host supports scatter requests and it meets our requirements */ - if (device->func->card->host->max_hw_segs < MAX_SCATTER_ENTRIES_PER_REQ) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("HIF-SCATTER : host only supports scatter of : %d entries, need: %d \n", - device->func->card->host->max_hw_segs, MAX_SCATTER_ENTRIES_PER_REQ)); - status = A_ENOTSUP; - break; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("HIF-SCATTER Enabled: max scatter req : %d entries: %d \n", - MAX_SCATTER_REQUESTS, MAX_SCATTER_ENTRIES_PER_REQ)); - - for (i = 0; i < MAX_SCATTER_REQUESTS; i++) { - /* allocate the private request blob */ - pReqPriv = (HIF_SCATTER_REQ_PRIV *)A_MALLOC(sizeof(HIF_SCATTER_REQ_PRIV)); - if (NULL == pReqPriv) { - break; - } - A_MEMZERO(pReqPriv, sizeof(HIF_SCATTER_REQ_PRIV)); - /* save the device instance*/ - pReqPriv->device = device; - /* allocate the scatter request */ - pReqPriv->pHifScatterReq = (HIF_SCATTER_REQ *)A_MALLOC(sizeof(HIF_SCATTER_REQ) + - (MAX_SCATTER_ENTRIES_PER_REQ - 1) * (sizeof(HIF_SCATTER_ITEM))); - - if (NULL == pReqPriv->pHifScatterReq) { - A_FREE(pReqPriv); - break; - } - /* just zero the main part of the scatter request */ - A_MEMZERO(pReqPriv->pHifScatterReq, sizeof(HIF_SCATTER_REQ)); - /* back pointer to the private struct */ - pReqPriv->pHifScatterReq->HIFPrivate[0] = pReqPriv; - /* allocate a bus request for this scatter request */ - busrequest = hifAllocateBusRequest(device); - if (NULL == busrequest) { - A_FREE(pReqPriv->pHifScatterReq); - A_FREE(pReqPriv); - break; - } - /* assign the scatter request to this bus request */ - busrequest->pScatterReq = pReqPriv; - /* point back to the request */ - pReqPriv->busrequest = busrequest; - /* add it to the scatter pool */ - FreeScatterReq(device,pReqPriv->pHifScatterReq); - } - - if (i != MAX_SCATTER_REQUESTS) { - status = A_NO_MEMORY; - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("HIF-SCATTER : failed to alloc scatter resources !\n")); - break; - } - - /* set scatter function pointers */ - pInfo->pAllocateReqFunc = AllocScatterReq; - pInfo->pFreeReqFunc = FreeScatterReq; - pInfo->pReadWriteScatterFunc = HifReadWriteScatter; - pInfo->MaxScatterEntries = MAX_SCATTER_ENTRIES_PER_REQ; - pInfo->MaxTransferSizePerScatterReq = MAX_SCATTER_REQ_TRANSFER_SIZE; - - status = A_OK; - - } while (FALSE); - - if (A_FAILED(status)) { - CleanupHIFScatterResources(device); - } - - return status; -} - - /* clean up scatter support */ -void CleanupHIFScatterResources(HIF_DEVICE *device) -{ - HIF_SCATTER_REQ_PRIV *pReqPriv; - HIF_SCATTER_REQ *pReq; - - /* empty the free list */ - - while (1) { - - pReq = AllocScatterReq(device); - - if (NULL == pReq) { - break; - } - - pReqPriv = (HIF_SCATTER_REQ_PRIV *)pReq->HIFPrivate[0]; - A_ASSERT(pReqPriv != NULL); - - if (pReqPriv->busrequest != NULL) { - pReqPriv->busrequest->pScatterReq = NULL; - /* free bus request */ - hifFreeBusRequest(device, pReqPriv->busrequest); - pReqPriv->busrequest = NULL; - } - - if (pReqPriv->pHifScatterReq != NULL) { - A_FREE(pReqPriv->pHifScatterReq); - pReqPriv->pHifScatterReq = NULL; - } - - A_FREE(pReqPriv); - } -} - -#endif // HIF_LINUX_MMC_SCATTER_SUPPORT diff --git a/drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k.c b/drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k.c deleted file mode 100644 index bbddef7a3a53..000000000000 --- a/drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k.c +++ /dev/null @@ -1,1463 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// AR6K device layer that handles register level I/O -// -// Author(s): ="Atheros" -//============================================================================== - -#include "a_config.h" -#include "athdefs.h" -#include "a_types.h" -#include "a_osapi.h" -#include "../htc_debug.h" -#include "hif.h" -#include "htc_packet.h" -#include "ar6k.h" -#include "target_reg_table.h" -#include "host_reg_table.h" - -#define MAILBOX_FOR_BLOCK_SIZE 1 - -A_STATUS DevEnableInterrupts(AR6K_DEVICE *pDev); -A_STATUS DevDisableInterrupts(AR6K_DEVICE *pDev); - -static void DevCleanupVirtualScatterSupport(AR6K_DEVICE *pDev); - -void AR6KFreeIOPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket) -{ - LOCK_AR6K(pDev); - HTC_PACKET_ENQUEUE(&pDev->RegisterIOList,pPacket); - UNLOCK_AR6K(pDev); -} - -HTC_PACKET *AR6KAllocIOPacket(AR6K_DEVICE *pDev) -{ - HTC_PACKET *pPacket; - - LOCK_AR6K(pDev); - pPacket = HTC_PACKET_DEQUEUE(&pDev->RegisterIOList); - UNLOCK_AR6K(pDev); - - return pPacket; -} - -void DevCleanup(AR6K_DEVICE *pDev) -{ - if (pDev->HifAttached) { - HIFDetachHTC(pDev->HIFDevice); - pDev->HifAttached = FALSE; - } - - DevCleanupVirtualScatterSupport(pDev); - - if (A_IS_MUTEX_VALID(&pDev->Lock)) { - A_MUTEX_DELETE(&pDev->Lock); - } -} - -A_STATUS DevSetup(AR6K_DEVICE *pDev) -{ - A_UINT32 blocksizes[AR6K_MAILBOXES]; - A_STATUS status = A_OK; - int i; - HTC_CALLBACKS htcCallbacks; - - do { - - DL_LIST_INIT(&pDev->ScatterReqHead); - /* initialize our free list of IO packets */ - INIT_HTC_PACKET_QUEUE(&pDev->RegisterIOList); - A_MUTEX_INIT(&pDev->Lock); - - A_MEMZERO(&htcCallbacks, sizeof(HTC_CALLBACKS)); - /* the device layer handles these */ - htcCallbacks.rwCompletionHandler = DevRWCompletionHandler; - htcCallbacks.dsrHandler = DevDsrHandler; - htcCallbacks.context = pDev; - - status = HIFAttachHTC(pDev->HIFDevice, &htcCallbacks); - - if (A_FAILED(status)) { - break; - } - - pDev->HifAttached = TRUE; - - /* get the addresses for all 4 mailboxes */ - status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_ADDR, - &pDev->MailBoxInfo, sizeof(pDev->MailBoxInfo)); - - if (status != A_OK) { - A_ASSERT(FALSE); - break; - } - - /* carve up register I/O packets (these are for ASYNC register I/O ) */ - for (i = 0; i < AR6K_MAX_REG_IO_BUFFERS; i++) { - HTC_PACKET *pIOPacket; - pIOPacket = &pDev->RegIOBuffers[i].HtcPacket; - SET_HTC_PACKET_INFO_RX_REFILL(pIOPacket, - pDev, - pDev->RegIOBuffers[i].Buffer, - AR6K_REG_IO_BUFFER_SIZE, - 0); /* don't care */ - AR6KFreeIOPacket(pDev,pIOPacket); - } - - /* get the block sizes */ - status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_BLOCK_SIZE, - blocksizes, sizeof(blocksizes)); - - if (status != A_OK) { - A_ASSERT(FALSE); - break; - } - - /* note: we actually get the block size of a mailbox other than 0, for SDIO the block - * size on mailbox 0 is artificially set to 1. So we use the block size that is set - * for the other 3 mailboxes */ - pDev->BlockSize = blocksizes[MAILBOX_FOR_BLOCK_SIZE]; - /* must be a power of 2 */ - A_ASSERT((pDev->BlockSize & (pDev->BlockSize - 1)) == 0); - - /* assemble mask, used for padding to a block */ - pDev->BlockMask = pDev->BlockSize - 1; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("BlockSize: %d, MailboxAddress:0x%X \n", - pDev->BlockSize, pDev->MailBoxInfo.MboxAddresses[HTC_MAILBOX])); - - pDev->GetPendingEventsFunc = NULL; - /* see if the HIF layer implements the get pending events function */ - HIFConfigureDevice(pDev->HIFDevice, - HIF_DEVICE_GET_PENDING_EVENTS_FUNC, - &pDev->GetPendingEventsFunc, - sizeof(pDev->GetPendingEventsFunc)); - - /* assume we can process HIF interrupt events asynchronously */ - pDev->HifIRQProcessingMode = HIF_DEVICE_IRQ_ASYNC_SYNC; - - /* see if the HIF layer overrides this assumption */ - HIFConfigureDevice(pDev->HIFDevice, - HIF_DEVICE_GET_IRQ_PROC_MODE, - &pDev->HifIRQProcessingMode, - sizeof(pDev->HifIRQProcessingMode)); - - switch (pDev->HifIRQProcessingMode) { - case HIF_DEVICE_IRQ_SYNC_ONLY: - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("HIF Interrupt processing is SYNC ONLY\n")); - /* see if HIF layer wants HTC to yield */ - HIFConfigureDevice(pDev->HIFDevice, - HIF_DEVICE_GET_IRQ_YIELD_PARAMS, - &pDev->HifIRQYieldParams, - sizeof(pDev->HifIRQYieldParams)); - - if (pDev->HifIRQYieldParams.RecvPacketYieldCount > 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, - ("HIF requests that DSR yield per %d RECV packets \n", - pDev->HifIRQYieldParams.RecvPacketYieldCount)); - pDev->DSRCanYield = TRUE; - } - break; - case HIF_DEVICE_IRQ_ASYNC_SYNC: - AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("HIF Interrupt processing is ASYNC and SYNC\n")); - break; - default: - A_ASSERT(FALSE); - } - - pDev->HifMaskUmaskRecvEvent = NULL; - - /* see if the HIF layer implements the mask/unmask recv events function */ - HIFConfigureDevice(pDev->HIFDevice, - HIF_DEVICE_GET_RECV_EVENT_MASK_UNMASK_FUNC, - &pDev->HifMaskUmaskRecvEvent, - sizeof(pDev->HifMaskUmaskRecvEvent)); - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("HIF special overrides : 0x%lX , 0x%lX\n", - (unsigned long)pDev->GetPendingEventsFunc, (unsigned long)pDev->HifMaskUmaskRecvEvent)); - - status = DevDisableInterrupts(pDev); - - if (A_FAILED(status)) { - break; - } - - } while (FALSE); - - if (A_FAILED(status)) { - if (pDev->HifAttached) { - HIFDetachHTC(pDev->HIFDevice); - pDev->HifAttached = FALSE; - } - } - - return status; - -} - -A_STATUS DevEnableInterrupts(AR6K_DEVICE *pDev) -{ - A_STATUS status; - AR6K_IRQ_ENABLE_REGISTERS regs; - - LOCK_AR6K(pDev); - - /* Enable all the interrupts except for the internal AR6000 CPU interrupt */ - pDev->IrqEnableRegisters.int_status_enable = INT_STATUS_ENABLE_ERROR_SET(0x01) | - INT_STATUS_ENABLE_CPU_SET(0x01) | - INT_STATUS_ENABLE_COUNTER_SET(0x01); - - if (NULL == pDev->GetPendingEventsFunc) { - pDev->IrqEnableRegisters.int_status_enable |= INT_STATUS_ENABLE_MBOX_DATA_SET(0x01); - } else { - /* The HIF layer provided us with a pending events function which means that - * the detection of pending mbox messages is handled in the HIF layer. - * This is the case for the SPI2 interface. - * In the normal case we enable MBOX interrupts, for the case - * with HIFs that offer this mechanism, we keep these interrupts - * masked */ - pDev->IrqEnableRegisters.int_status_enable &= ~INT_STATUS_ENABLE_MBOX_DATA_SET(0x01); - } - - - /* Set up the CPU Interrupt Status Register */ - pDev->IrqEnableRegisters.cpu_int_status_enable = CPU_INT_STATUS_ENABLE_BIT_SET(0x00); - - /* Set up the Error Interrupt Status Register */ - pDev->IrqEnableRegisters.error_status_enable = - ERROR_STATUS_ENABLE_RX_UNDERFLOW_SET(0x01) | - ERROR_STATUS_ENABLE_TX_OVERFLOW_SET(0x01); - - /* Set up the Counter Interrupt Status Register (only for debug interrupt to catch fatal errors) */ - pDev->IrqEnableRegisters.counter_int_status_enable = - COUNTER_INT_STATUS_ENABLE_BIT_SET(AR6K_TARGET_DEBUG_INTR_MASK); - - /* copy into our temp area */ - A_MEMCPY(®s,&pDev->IrqEnableRegisters,AR6K_IRQ_ENABLE_REGS_SIZE); - - UNLOCK_AR6K(pDev); - - /* always synchronous */ - status = HIFReadWrite(pDev->HIFDevice, - INT_STATUS_ENABLE_ADDRESS, - ®s.int_status_enable, - AR6K_IRQ_ENABLE_REGS_SIZE, - HIF_WR_SYNC_BYTE_INC, - NULL); - - if (status != A_OK) { - /* Can't write it for some reason */ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("Failed to update interrupt control registers err: %d\n", status)); - - } - - return status; -} - -A_STATUS DevDisableInterrupts(AR6K_DEVICE *pDev) -{ - AR6K_IRQ_ENABLE_REGISTERS regs; - - LOCK_AR6K(pDev); - /* Disable all interrupts */ - pDev->IrqEnableRegisters.int_status_enable = 0; - pDev->IrqEnableRegisters.cpu_int_status_enable = 0; - pDev->IrqEnableRegisters.error_status_enable = 0; - pDev->IrqEnableRegisters.counter_int_status_enable = 0; - /* copy into our temp area */ - A_MEMCPY(®s,&pDev->IrqEnableRegisters,AR6K_IRQ_ENABLE_REGS_SIZE); - - UNLOCK_AR6K(pDev); - - /* always synchronous */ - return HIFReadWrite(pDev->HIFDevice, - INT_STATUS_ENABLE_ADDRESS, - ®s.int_status_enable, - AR6K_IRQ_ENABLE_REGS_SIZE, - HIF_WR_SYNC_BYTE_INC, - NULL); -} - -/* enable device interrupts */ -A_STATUS DevUnmaskInterrupts(AR6K_DEVICE *pDev) -{ - /* for good measure, make sure interrupt are disabled before unmasking at the HIF - * layer. - * The rationale here is that between device insertion (where we clear the interrupts the first time) - * and when HTC is finally ready to handle interrupts, other software can perform target "soft" resets. - * The AR6K interrupt enables reset back to an "enabled" state when this happens. - * */ - DevDisableInterrupts(pDev); - - /* Unmask the host controller interrupts */ - HIFUnMaskInterrupt(pDev->HIFDevice); - - return DevEnableInterrupts(pDev); -} - -/* disable all device interrupts */ -A_STATUS DevMaskInterrupts(AR6K_DEVICE *pDev) -{ - /* mask the interrupt at the HIF layer, we don't want a stray interrupt taken while - * we zero out our shadow registers in DevDisableInterrupts()*/ - HIFMaskInterrupt(pDev->HIFDevice); - - return DevDisableInterrupts(pDev); -} - -/* callback when our fetch to enable/disable completes */ -static void DevDoEnableDisableRecvAsyncHandler(void *Context, HTC_PACKET *pPacket) -{ - AR6K_DEVICE *pDev = (AR6K_DEVICE *)Context; - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevDoEnableDisableRecvAsyncHandler: (dev: 0x%lX)\n", (unsigned long)pDev)); - - if (A_FAILED(pPacket->Status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - (" Failed to disable receiver, status:%d \n", pPacket->Status)); - } - /* free this IO packet */ - AR6KFreeIOPacket(pDev,pPacket); - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevDoEnableDisableRecvAsyncHandler \n")); -} - -/* disable packet reception (used in case the host runs out of buffers) - * this is the "override" method when the HIF reports another methods to - * disable recv events */ -static A_STATUS DevDoEnableDisableRecvOverride(AR6K_DEVICE *pDev, A_BOOL EnableRecv, A_BOOL AsyncMode) -{ - A_STATUS status = A_OK; - HTC_PACKET *pIOPacket = NULL; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("DevDoEnableDisableRecvOverride: Enable:%d Mode:%d\n", - EnableRecv,AsyncMode)); - - do { - - if (AsyncMode) { - - pIOPacket = AR6KAllocIOPacket(pDev); - - if (NULL == pIOPacket) { - status = A_NO_MEMORY; - A_ASSERT(FALSE); - break; - } - - /* stick in our completion routine when the I/O operation completes */ - pIOPacket->Completion = DevDoEnableDisableRecvAsyncHandler; - pIOPacket->pContext = pDev; - - /* call the HIF layer override and do this asynchronously */ - status = pDev->HifMaskUmaskRecvEvent(pDev->HIFDevice, - EnableRecv ? HIF_UNMASK_RECV : HIF_MASK_RECV, - pIOPacket); - break; - } - - /* if we get here we are doing it synchronously */ - status = pDev->HifMaskUmaskRecvEvent(pDev->HIFDevice, - EnableRecv ? HIF_UNMASK_RECV : HIF_MASK_RECV, - NULL); - - } while (FALSE); - - if (A_FAILED(status) && (pIOPacket != NULL)) { - AR6KFreeIOPacket(pDev,pIOPacket); - } - - return status; -} - -/* disable packet reception (used in case the host runs out of buffers) - * this is the "normal" method using the interrupt enable registers through - * the host I/F */ -static A_STATUS DevDoEnableDisableRecvNormal(AR6K_DEVICE *pDev, A_BOOL EnableRecv, A_BOOL AsyncMode) -{ - A_STATUS status = A_OK; - HTC_PACKET *pIOPacket = NULL; - AR6K_IRQ_ENABLE_REGISTERS regs; - - /* take the lock to protect interrupt enable shadows */ - LOCK_AR6K(pDev); - - if (EnableRecv) { - pDev->IrqEnableRegisters.int_status_enable |= INT_STATUS_ENABLE_MBOX_DATA_SET(0x01); - } else { - pDev->IrqEnableRegisters.int_status_enable &= ~INT_STATUS_ENABLE_MBOX_DATA_SET(0x01); - } - - /* copy into our temp area */ - A_MEMCPY(®s,&pDev->IrqEnableRegisters,AR6K_IRQ_ENABLE_REGS_SIZE); - UNLOCK_AR6K(pDev); - - do { - - if (AsyncMode) { - - pIOPacket = AR6KAllocIOPacket(pDev); - - if (NULL == pIOPacket) { - status = A_NO_MEMORY; - A_ASSERT(FALSE); - break; - } - - /* copy values to write to our async I/O buffer */ - A_MEMCPY(pIOPacket->pBuffer,®s,AR6K_IRQ_ENABLE_REGS_SIZE); - - /* stick in our completion routine when the I/O operation completes */ - pIOPacket->Completion = DevDoEnableDisableRecvAsyncHandler; - pIOPacket->pContext = pDev; - - /* write it out asynchronously */ - status = HIFReadWrite(pDev->HIFDevice, - INT_STATUS_ENABLE_ADDRESS, - pIOPacket->pBuffer, - AR6K_IRQ_ENABLE_REGS_SIZE, - HIF_WR_ASYNC_BYTE_INC, - pIOPacket); - break; - } - - /* if we get here we are doing it synchronously */ - - status = HIFReadWrite(pDev->HIFDevice, - INT_STATUS_ENABLE_ADDRESS, - ®s.int_status_enable, - AR6K_IRQ_ENABLE_REGS_SIZE, - HIF_WR_SYNC_BYTE_INC, - NULL); - - } while (FALSE); - - if (A_FAILED(status) && (pIOPacket != NULL)) { - AR6KFreeIOPacket(pDev,pIOPacket); - } - - return status; -} - - -A_STATUS DevStopRecv(AR6K_DEVICE *pDev, A_BOOL AsyncMode) -{ - if (NULL == pDev->HifMaskUmaskRecvEvent) { - return DevDoEnableDisableRecvNormal(pDev,FALSE,AsyncMode); - } else { - return DevDoEnableDisableRecvOverride(pDev,FALSE,AsyncMode); - } -} - -A_STATUS DevEnableRecv(AR6K_DEVICE *pDev, A_BOOL AsyncMode) -{ - if (NULL == pDev->HifMaskUmaskRecvEvent) { - return DevDoEnableDisableRecvNormal(pDev,TRUE,AsyncMode); - } else { - return DevDoEnableDisableRecvOverride(pDev,TRUE,AsyncMode); - } -} - -A_STATUS DevWaitForPendingRecv(AR6K_DEVICE *pDev,A_UINT32 TimeoutInMs,A_BOOL *pbIsRecvPending) -{ - A_STATUS status = A_OK; - A_UCHAR host_int_status = 0x0; - A_UINT32 counter = 0x0; - - if(TimeoutInMs < 100) - { - TimeoutInMs = 100; - } - - counter = TimeoutInMs / 100; - - do - { - //Read the Host Interrupt Status Register - status = HIFReadWrite(pDev->HIFDevice, - HOST_INT_STATUS_ADDRESS, - &host_int_status, - sizeof(A_UCHAR), - HIF_RD_SYNC_BYTE_INC, - NULL); - if(A_FAILED(status)) - { - AR_DEBUG_PRINTF(ATH_LOG_ERR,("DevWaitForPendingRecv:Read HOST_INT_STATUS_ADDRESS Failed 0x%X\n",status)); - break; - } - - host_int_status = A_SUCCESS(status) ? (host_int_status & (1 << 0)):0; - if(!host_int_status) - { - status = A_OK; - *pbIsRecvPending = FALSE; - break; - } - else - { - *pbIsRecvPending = TRUE; - } - - A_MDELAY(100); - - counter--; - - }while(counter); - return status; -} - -void DevDumpRegisters(AR6K_DEVICE *pDev, - AR6K_IRQ_PROC_REGISTERS *pIrqProcRegs, - AR6K_IRQ_ENABLE_REGISTERS *pIrqEnableRegs) -{ - - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, ("\n<------- Register Table -------->\n")); - - if (pIrqProcRegs != NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("Host Int Status: 0x%x\n",pIrqProcRegs->host_int_status)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("CPU Int Status: 0x%x\n",pIrqProcRegs->cpu_int_status)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("Error Int Status: 0x%x\n",pIrqProcRegs->error_int_status)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("Counter Int Status: 0x%x\n",pIrqProcRegs->counter_int_status)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("Mbox Frame: 0x%x\n",pIrqProcRegs->mbox_frame)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("Rx Lookahead Valid: 0x%x\n",pIrqProcRegs->rx_lookahead_valid)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("Rx Lookahead 0: 0x%x\n",pIrqProcRegs->rx_lookahead[0])); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("Rx Lookahead 1: 0x%x\n",pIrqProcRegs->rx_lookahead[1])); - - if (pDev->MailBoxInfo.GMboxAddress != 0) { - /* if the target supports GMBOX hardware, dump some additional state */ - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("GMBOX Host Int Status 2: 0x%x\n",pIrqProcRegs->host_int_status2)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("GMBOX RX Avail: 0x%x\n",pIrqProcRegs->gmbox_rx_avail)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("GMBOX lookahead alias 0: 0x%x\n",pIrqProcRegs->rx_gmbox_lookahead_alias[0])); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("GMBOX lookahead alias 1: 0x%x\n",pIrqProcRegs->rx_gmbox_lookahead_alias[1])); - } - - } - - if (pIrqEnableRegs != NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("Int Status Enable: 0x%x\n",pIrqEnableRegs->int_status_enable)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("Counter Int Status Enable: 0x%x\n",pIrqEnableRegs->counter_int_status_enable)); - } - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, ("<------------------------------->\n")); -} - - -#define DEV_GET_VIRT_DMA_INFO(p) ((DEV_SCATTER_DMA_VIRTUAL_INFO *)((p)->HIFPrivate[0])) - -static HIF_SCATTER_REQ *DevAllocScatterReq(HIF_DEVICE *Context) -{ - DL_LIST *pItem; - AR6K_DEVICE *pDev = (AR6K_DEVICE *)Context; - LOCK_AR6K(pDev); - pItem = DL_ListRemoveItemFromHead(&pDev->ScatterReqHead); - UNLOCK_AR6K(pDev); - if (pItem != NULL) { - return A_CONTAINING_STRUCT(pItem, HIF_SCATTER_REQ, ListLink); - } - return NULL; -} - -static void DevFreeScatterReq(HIF_DEVICE *Context, HIF_SCATTER_REQ *pReq) -{ - AR6K_DEVICE *pDev = (AR6K_DEVICE *)Context; - LOCK_AR6K(pDev); - DL_ListInsertTail(&pDev->ScatterReqHead, &pReq->ListLink); - UNLOCK_AR6K(pDev); -} - -A_STATUS DevCopyScatterListToFromDMABuffer(HIF_SCATTER_REQ *pReq, A_BOOL FromDMA) -{ - A_UINT8 *pDMABuffer = NULL; - int i, remaining; - A_UINT32 length; - - pDMABuffer = pReq->pScatterBounceBuffer; - - if (pDMABuffer == NULL) { - A_ASSERT(FALSE); - return A_EINVAL; - } - - remaining = (int)pReq->TotalLength; - - for (i = 0; i < pReq->ValidScatterEntries; i++) { - - length = min((int)pReq->ScatterList[i].Length, remaining); - - if (length != (int)pReq->ScatterList[i].Length) { - A_ASSERT(FALSE); - /* there is a problem with the scatter list */ - return A_EINVAL; - } - - if (FromDMA) { - /* from DMA buffer */ - A_MEMCPY(pReq->ScatterList[i].pBuffer, pDMABuffer , length); - } else { - /* to DMA buffer */ - A_MEMCPY(pDMABuffer, pReq->ScatterList[i].pBuffer, length); - } - - pDMABuffer += length; - remaining -= length; - } - - return A_OK; -} - -static void DevReadWriteScatterAsyncHandler(void *Context, HTC_PACKET *pPacket) -{ - AR6K_DEVICE *pDev = (AR6K_DEVICE *)Context; - HIF_SCATTER_REQ *pReq = (HIF_SCATTER_REQ *)pPacket->pPktContext; - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+DevReadWriteScatterAsyncHandler: (dev: 0x%lX)\n", (unsigned long)pDev)); - - pReq->CompletionStatus = pPacket->Status; - - AR6KFreeIOPacket(pDev,pPacket); - - pReq->CompletionRoutine(pReq); - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("-DevReadWriteScatterAsyncHandler \n")); -} - -static A_STATUS DevReadWriteScatter(HIF_DEVICE *Context, HIF_SCATTER_REQ *pReq) -{ - AR6K_DEVICE *pDev = (AR6K_DEVICE *)Context; - A_STATUS status = A_OK; - HTC_PACKET *pIOPacket = NULL; - A_UINT32 request = pReq->Request; - - do { - - if (pReq->TotalLength > AR6K_MAX_TRANSFER_SIZE_PER_SCATTER) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("Invalid length: %d \n", pReq->TotalLength)); - break; - } - - if (pReq->TotalLength == 0) { - A_ASSERT(FALSE); - break; - } - - if (request & HIF_ASYNCHRONOUS) { - /* use an I/O packet to carry this request */ - pIOPacket = AR6KAllocIOPacket(pDev); - if (NULL == pIOPacket) { - status = A_NO_MEMORY; - break; - } - - /* save the request */ - pIOPacket->pPktContext = pReq; - /* stick in our completion routine when the I/O operation completes */ - pIOPacket->Completion = DevReadWriteScatterAsyncHandler; - pIOPacket->pContext = pDev; - } - - if (request & HIF_WRITE) { - /* in virtual DMA, we are issuing the requests through the legacy HIFReadWrite API - * this API will adjust the address automatically for the last byte to fall on the mailbox - * EOM. */ - - /* if the address is an extended address, we can adjust the address here since the extended - * address will bypass the normal checks in legacy HIF layers */ - if (pReq->Address == pDev->MailBoxInfo.MboxProp[HTC_MAILBOX].ExtendedAddress) { - pReq->Address += pDev->MailBoxInfo.MboxProp[HTC_MAILBOX].ExtendedSize - pReq->TotalLength; - } - } - - /* use legacy readwrite */ - status = HIFReadWrite(pDev->HIFDevice, - pReq->Address, - DEV_GET_VIRT_DMA_INFO(pReq)->pVirtDmaBuffer, - pReq->TotalLength, - request, - (request & HIF_ASYNCHRONOUS) ? pIOPacket : NULL); - - } while (FALSE); - - if ((status != A_PENDING) && A_FAILED(status) && (request & HIF_ASYNCHRONOUS)) { - if (pIOPacket != NULL) { - AR6KFreeIOPacket(pDev,pIOPacket); - } - pReq->CompletionStatus = status; - pReq->CompletionRoutine(pReq); - status = A_OK; - } - - return status; -} - - -static void DevCleanupVirtualScatterSupport(AR6K_DEVICE *pDev) -{ - HIF_SCATTER_REQ *pReq; - - while (1) { - pReq = DevAllocScatterReq((HIF_DEVICE *)pDev); - if (NULL == pReq) { - break; - } - A_FREE(pReq); - } - -} - - /* function to set up virtual scatter support if HIF layer has not implemented the interface */ -static A_STATUS DevSetupVirtualScatterSupport(AR6K_DEVICE *pDev) -{ - A_STATUS status = A_OK; - int bufferSize, sgreqSize; - int i; - DEV_SCATTER_DMA_VIRTUAL_INFO *pVirtualInfo; - HIF_SCATTER_REQ *pReq; - - bufferSize = sizeof(DEV_SCATTER_DMA_VIRTUAL_INFO) + - 2 * (A_GET_CACHE_LINE_BYTES()) + AR6K_MAX_TRANSFER_SIZE_PER_SCATTER; - - sgreqSize = sizeof(HIF_SCATTER_REQ) + - (AR6K_SCATTER_ENTRIES_PER_REQ - 1) * (sizeof(HIF_SCATTER_ITEM)); - - for (i = 0; i < AR6K_SCATTER_REQS; i++) { - /* allocate the scatter request, buffer info and the actual virtual buffer itself */ - pReq = (HIF_SCATTER_REQ *)A_MALLOC_NOWAIT(sgreqSize + bufferSize); - - if (NULL == pReq) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Alloc HIF_SCATTER_REQ fail with NOWAIT func. Try wait version\n", __FUNCTION__)); - pReq = (HIF_SCATTER_REQ *)A_MALLOC(sgreqSize + bufferSize); - } - if (NULL == pReq) { - status = A_NO_MEMORY; - break; - } - - A_MEMZERO(pReq, sgreqSize); - - /* the virtual DMA starts after the scatter request struct */ - pVirtualInfo = (DEV_SCATTER_DMA_VIRTUAL_INFO *)((A_UINT8 *)pReq + sgreqSize); - A_MEMZERO(pVirtualInfo, sizeof(DEV_SCATTER_DMA_VIRTUAL_INFO)); - - pVirtualInfo->pVirtDmaBuffer = &pVirtualInfo->DataArea[0]; - /* align buffer to cache line in case host controller can actually DMA this */ - pVirtualInfo->pVirtDmaBuffer = A_ALIGN_TO_CACHE_LINE(pVirtualInfo->pVirtDmaBuffer); - /* store the structure in the private area */ - pReq->HIFPrivate[0] = pVirtualInfo; - /* we emulate a DMA bounce interface */ - pReq->ScatterMethod = HIF_SCATTER_DMA_BOUNCE; - pReq->pScatterBounceBuffer = pVirtualInfo->pVirtDmaBuffer; - /* free request to the list */ - DevFreeScatterReq((HIF_DEVICE *)pDev,pReq); - } - - if (A_FAILED(status)) { - DevCleanupVirtualScatterSupport(pDev); - } else { - pDev->HifScatterInfo.pAllocateReqFunc = DevAllocScatterReq; - pDev->HifScatterInfo.pFreeReqFunc = DevFreeScatterReq; - pDev->HifScatterInfo.pReadWriteScatterFunc = DevReadWriteScatter; - pDev->HifScatterInfo.MaxScatterEntries = AR6K_SCATTER_ENTRIES_PER_REQ; - pDev->HifScatterInfo.MaxTransferSizePerScatterReq = AR6K_MAX_TRANSFER_SIZE_PER_SCATTER; - pDev->ScatterIsVirtual = TRUE; - } - - return status; -} - -A_STATUS DevCleanupMsgBundling(AR6K_DEVICE *pDev) -{ - A_STATUS status = A_OK; - - if(NULL != pDev) - { - DevCleanupVirtualScatterSupport(pDev); - } - - return status; -} - -A_STATUS DevSetupMsgBundling(AR6K_DEVICE *pDev, int MaxMsgsPerTransfer) -{ - A_STATUS status; - - if (pDev->MailBoxInfo.Flags & HIF_MBOX_FLAG_NO_BUNDLING) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, ("HIF requires bundling disabled\n")); - return A_ENOTSUP; - } - - status = HIFConfigureDevice(pDev->HIFDevice, - HIF_CONFIGURE_QUERY_SCATTER_REQUEST_SUPPORT, - &pDev->HifScatterInfo, - sizeof(pDev->HifScatterInfo)); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, - ("AR6K: ** HIF layer does not support scatter requests (%d) \n",status)); - - /* we can try to use a virtual DMA scatter mechanism using legacy HIFReadWrite() */ - status = DevSetupVirtualScatterSupport(pDev); - - if (A_SUCCESS(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("AR6K: virtual scatter transfers enabled (max scatter items:%d: maxlen:%d) \n", - DEV_GET_MAX_MSG_PER_BUNDLE(pDev), DEV_GET_MAX_BUNDLE_LENGTH(pDev))); - } - - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("AR6K: HIF layer supports scatter requests (max scatter items:%d: maxlen:%d) \n", - DEV_GET_MAX_MSG_PER_BUNDLE(pDev), DEV_GET_MAX_BUNDLE_LENGTH(pDev))); - } - - if (A_SUCCESS(status)) { - /* for the recv path, the maximum number of bytes per recv bundle is just limited - * by the maximum transfer size at the HIF layer */ - pDev->MaxRecvBundleSize = pDev->HifScatterInfo.MaxTransferSizePerScatterReq; - - /* for the send path, the max transfer size is limited by the existence and size of - * the extended mailbox address range */ - if (pDev->MailBoxInfo.MboxProp[0].ExtendedAddress != 0) { - pDev->MaxSendBundleSize = pDev->MailBoxInfo.MboxProp[0].ExtendedSize; - } else { - /* legacy */ - pDev->MaxSendBundleSize = AR6K_LEGACY_MAX_WRITE_LENGTH; - } - - if (pDev->MaxSendBundleSize > pDev->HifScatterInfo.MaxTransferSizePerScatterReq) { - /* limit send bundle size to what the HIF can support for scatter requests */ - pDev->MaxSendBundleSize = pDev->HifScatterInfo.MaxTransferSizePerScatterReq; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("AR6K: max recv: %d max send: %d \n", - DEV_GET_MAX_BUNDLE_RECV_LENGTH(pDev), DEV_GET_MAX_BUNDLE_SEND_LENGTH(pDev))); - - } - return status; -} - -A_STATUS DevSubmitScatterRequest(AR6K_DEVICE *pDev, HIF_SCATTER_REQ *pScatterReq, A_BOOL Read, A_BOOL Async) -{ - A_STATUS status; - - if (Read) { - /* read operation */ - pScatterReq->Request = (Async) ? HIF_RD_ASYNC_BLOCK_FIX : HIF_RD_SYNC_BLOCK_FIX; - pScatterReq->Address = pDev->MailBoxInfo.MboxAddresses[HTC_MAILBOX]; - A_ASSERT(pScatterReq->TotalLength <= (A_UINT32)DEV_GET_MAX_BUNDLE_RECV_LENGTH(pDev)); - } else { - A_UINT32 mailboxWidth; - - /* write operation */ - pScatterReq->Request = (Async) ? HIF_WR_ASYNC_BLOCK_INC : HIF_WR_SYNC_BLOCK_INC; - A_ASSERT(pScatterReq->TotalLength <= (A_UINT32)DEV_GET_MAX_BUNDLE_SEND_LENGTH(pDev)); - if (pScatterReq->TotalLength > AR6K_LEGACY_MAX_WRITE_LENGTH) { - /* for large writes use the extended address */ - pScatterReq->Address = pDev->MailBoxInfo.MboxProp[HTC_MAILBOX].ExtendedAddress; - mailboxWidth = pDev->MailBoxInfo.MboxProp[HTC_MAILBOX].ExtendedSize; - } else { - pScatterReq->Address = pDev->MailBoxInfo.MboxAddresses[HTC_MAILBOX]; - mailboxWidth = AR6K_LEGACY_MAX_WRITE_LENGTH; - } - - if (!pDev->ScatterIsVirtual) { - /* we are passing this scatter list down to the HIF layer' scatter request handler, fixup the address - * so that the last byte falls on the EOM, we do this for those HIFs that support the - * scatter API */ - pScatterReq->Address += (mailboxWidth - pScatterReq->TotalLength); - } - - } - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV | ATH_DEBUG_SEND, - ("DevSubmitScatterRequest, Entries: %d, Total Length: %d Mbox:0x%X (mode: %s : %s)\n", - pScatterReq->ValidScatterEntries, - pScatterReq->TotalLength, - pScatterReq->Address, - Async ? "ASYNC" : "SYNC", - (Read) ? "RD" : "WR")); - - status = DEV_PREPARE_SCATTER_OPERATION(pScatterReq); - - if (A_FAILED(status)) { - if (Async) { - pScatterReq->CompletionStatus = status; - pScatterReq->CompletionRoutine(pScatterReq); - return A_OK; - } - return status; - } - - status = pDev->HifScatterInfo.pReadWriteScatterFunc(pDev->ScatterIsVirtual ? pDev : pDev->HIFDevice, - pScatterReq); - if (!Async) { - /* in sync mode, we can touch the scatter request */ - pScatterReq->CompletionStatus = status; - DEV_FINISH_SCATTER_OPERATION(pScatterReq); - } else { - if (status == A_PENDING) { - status = A_OK; - } - } - - return status; -} - - -#ifdef MBOXHW_UNIT_TEST - - -/* This is a mailbox hardware unit test that must be called in a schedulable context - * This test is very simple, it will send a list of buffers with a counting pattern - * and the target will invert the data and send the message back - * - * the unit test has the following constraints: - * - * The target has at least 8 buffers of 256 bytes each. The host will send - * the following pattern of buffers in rapid succession : - * - * 1 buffer - 128 bytes - * 1 buffer - 256 bytes - * 1 buffer - 512 bytes - * 1 buffer - 1024 bytes - * - * The host will send the buffers to one mailbox and wait for buffers to be reflected - * back from the same mailbox. The target sends the buffers FIFO order. - * Once the final buffer has been received for a mailbox, the next mailbox is tested. - * - * - * Note: To simplifythe test , we assume that the chosen buffer sizes - * will fall on a nice block pad - * - * It is expected that higher-order tests will be written to stress the mailboxes using - * a message-based protocol (with some performance timming) that can create more - * randomness in the packets sent over mailboxes. - * - * */ - -#define A_ROUND_UP_PWR2(x, align) (((int) (x) + ((align)-1)) & ~((align)-1)) - -#define BUFFER_BLOCK_PAD 128 - -#if 0 -#define BUFFER1 128 -#define BUFFER2 256 -#define BUFFER3 512 -#define BUFFER4 1024 -#endif - -#if 1 -#define BUFFER1 80 -#define BUFFER2 200 -#define BUFFER3 444 -#define BUFFER4 800 -#endif - -#define TOTAL_BYTES (A_ROUND_UP_PWR2(BUFFER1,BUFFER_BLOCK_PAD) + \ - A_ROUND_UP_PWR2(BUFFER2,BUFFER_BLOCK_PAD) + \ - A_ROUND_UP_PWR2(BUFFER3,BUFFER_BLOCK_PAD) + \ - A_ROUND_UP_PWR2(BUFFER4,BUFFER_BLOCK_PAD) ) - -#define TEST_BYTES (BUFFER1 + BUFFER2 + BUFFER3 + BUFFER4) - -#define TEST_CREDITS_RECV_TIMEOUT 100 - -static A_UINT8 g_Buffer[TOTAL_BYTES]; -static A_UINT32 g_MailboxAddrs[AR6K_MAILBOXES]; -static A_UINT32 g_BlockSizes[AR6K_MAILBOXES]; - -#define BUFFER_PROC_LIST_DEPTH 4 - -typedef struct _BUFFER_PROC_LIST{ - A_UINT8 *pBuffer; - A_UINT32 length; -}BUFFER_PROC_LIST; - - -#define PUSH_BUFF_PROC_ENTRY(pList,len,pCurrpos) \ -{ \ - (pList)->pBuffer = (pCurrpos); \ - (pList)->length = (len); \ - (pCurrpos) += (len); \ - (pList)++; \ -} - -/* a simple and crude way to send different "message" sizes */ -static void AssembleBufferList(BUFFER_PROC_LIST *pList) -{ - A_UINT8 *pBuffer = g_Buffer; - -#if BUFFER_PROC_LIST_DEPTH < 4 -#error "Buffer processing list depth is not deep enough!!" -#endif - - PUSH_BUFF_PROC_ENTRY(pList,BUFFER1,pBuffer); - PUSH_BUFF_PROC_ENTRY(pList,BUFFER2,pBuffer); - PUSH_BUFF_PROC_ENTRY(pList,BUFFER3,pBuffer); - PUSH_BUFF_PROC_ENTRY(pList,BUFFER4,pBuffer); - -} - -#define FILL_ZERO TRUE -#define FILL_COUNTING FALSE -static void InitBuffers(A_BOOL Zero) -{ - A_UINT16 *pBuffer16 = (A_UINT16 *)g_Buffer; - int i; - - /* fill buffer with 16 bit counting pattern or zeros */ - for (i = 0; i < (TOTAL_BYTES / 2) ; i++) { - if (!Zero) { - pBuffer16[i] = (A_UINT16)i; - } else { - pBuffer16[i] = 0; - } - } -} - - -static A_BOOL CheckOneBuffer(A_UINT16 *pBuffer16, int Length) -{ - int i; - A_UINT16 startCount; - A_BOOL success = TRUE; - - /* get the starting count */ - startCount = pBuffer16[0]; - /* invert it, this is the expected value */ - startCount = ~startCount; - /* scan the buffer and verify */ - for (i = 0; i < (Length / 2) ; i++,startCount++) { - /* target will invert all the data */ - if ((A_UINT16)pBuffer16[i] != (A_UINT16)~startCount) { - success = FALSE; - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Invalid Data Got:0x%X, Expecting:0x%X (offset:%d, total:%d) \n", - pBuffer16[i], ((A_UINT16)~startCount), i, Length)); - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("0x%X 0x%X 0x%X 0x%X \n", - pBuffer16[i], pBuffer16[i + 1], pBuffer16[i + 2],pBuffer16[i+3])); - break; - } - } - - return success; -} - -static A_BOOL CheckBuffers(void) -{ - int i; - A_BOOL success = TRUE; - BUFFER_PROC_LIST checkList[BUFFER_PROC_LIST_DEPTH]; - - /* assemble the list */ - AssembleBufferList(checkList); - - /* scan the buffers and verify */ - for (i = 0; i < BUFFER_PROC_LIST_DEPTH ; i++) { - success = CheckOneBuffer((A_UINT16 *)checkList[i].pBuffer, checkList[i].length); - if (!success) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Buffer : 0x%X, Length:%d failed verify \n", - (A_UINT32)checkList[i].pBuffer, checkList[i].length)); - break; - } - } - - return success; -} - - /* find the end marker for the last buffer we will be sending */ -static A_UINT16 GetEndMarker(void) -{ - A_UINT8 *pBuffer; - BUFFER_PROC_LIST checkList[BUFFER_PROC_LIST_DEPTH]; - - /* fill up buffers with the normal counting pattern */ - InitBuffers(FILL_COUNTING); - - /* assemble the list we will be sending down */ - AssembleBufferList(checkList); - /* point to the last 2 bytes of the last buffer */ - pBuffer = &(checkList[BUFFER_PROC_LIST_DEPTH - 1].pBuffer[(checkList[BUFFER_PROC_LIST_DEPTH - 1].length) - 2]); - - /* the last count in the last buffer is the marker */ - return (A_UINT16)pBuffer[0] | ((A_UINT16)pBuffer[1] << 8); -} - -#define ATH_PRINT_OUT_ZONE ATH_DEBUG_ERR - -/* send the ordered buffers to the target */ -static A_STATUS SendBuffers(AR6K_DEVICE *pDev, int mbox) -{ - A_STATUS status = A_OK; - A_UINT32 request = HIF_WR_SYNC_BLOCK_INC; - BUFFER_PROC_LIST sendList[BUFFER_PROC_LIST_DEPTH]; - int i; - int totalBytes = 0; - int paddedLength; - int totalwPadding = 0; - - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Sending buffers on mailbox : %d \n",mbox)); - - /* fill buffer with counting pattern */ - InitBuffers(FILL_COUNTING); - - /* assemble the order in which we send */ - AssembleBufferList(sendList); - - for (i = 0; i < BUFFER_PROC_LIST_DEPTH; i++) { - - /* we are doing block transfers, so we need to pad everything to a block size */ - paddedLength = (sendList[i].length + (g_BlockSizes[mbox] - 1)) & - (~(g_BlockSizes[mbox] - 1)); - - /* send each buffer synchronously */ - status = HIFReadWrite(pDev->HIFDevice, - g_MailboxAddrs[mbox], - sendList[i].pBuffer, - paddedLength, - request, - NULL); - if (status != A_OK) { - break; - } - totalBytes += sendList[i].length; - totalwPadding += paddedLength; - } - - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Sent %d bytes (%d padded bytes) to mailbox : %d \n",totalBytes,totalwPadding,mbox)); - - return status; -} - -/* poll the mailbox credit counter until we get a credit or timeout */ -static A_STATUS GetCredits(AR6K_DEVICE *pDev, int mbox, int *pCredits) -{ - A_STATUS status = A_OK; - int timeout = TEST_CREDITS_RECV_TIMEOUT; - A_UINT8 credits = 0; - A_UINT32 address; - - while (TRUE) { - - /* Read the counter register to get credits, this auto-decrements */ - address = COUNT_DEC_ADDRESS + (AR6K_MAILBOXES + mbox) * 4; - status = HIFReadWrite(pDev->HIFDevice, address, &credits, sizeof(credits), - HIF_RD_SYNC_BYTE_FIX, NULL); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("Unable to decrement the command credit count register (mbox=%d)\n",mbox)); - status = A_ERROR; - break; - } - - if (credits) { - break; - } - - timeout--; - - if (timeout <= 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - (" Timeout reading credit registers (mbox=%d, address:0x%X) \n",mbox,address)); - status = A_ERROR; - break; - } - - /* delay a little, target may not be ready */ - A_MDELAY(1000); - - } - - if (status == A_OK) { - *pCredits = credits; - } - - return status; -} - - -/* wait for the buffers to come back */ -static A_STATUS RecvBuffers(AR6K_DEVICE *pDev, int mbox) -{ - A_STATUS status = A_OK; - A_UINT32 request = HIF_RD_SYNC_BLOCK_INC; - BUFFER_PROC_LIST recvList[BUFFER_PROC_LIST_DEPTH]; - int curBuffer; - int credits; - int i; - int totalBytes = 0; - int paddedLength; - int totalwPadding = 0; - - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Waiting for buffers on mailbox : %d \n",mbox)); - - /* zero the buffers */ - InitBuffers(FILL_ZERO); - - /* assemble the order in which we should receive */ - AssembleBufferList(recvList); - - curBuffer = 0; - - while (curBuffer < BUFFER_PROC_LIST_DEPTH) { - - /* get number of buffers that have been completed, this blocks - * until we get at least 1 credit or it times out */ - status = GetCredits(pDev, mbox, &credits); - - if (status != A_OK) { - break; - } - - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Got %d messages on mailbox : %d \n",credits, mbox)); - - /* get all the buffers that are sitting on the queue */ - for (i = 0; i < credits; i++) { - A_ASSERT(curBuffer < BUFFER_PROC_LIST_DEPTH); - /* recv the current buffer synchronously, the buffers should come back in - * order... with padding applied by the target */ - paddedLength = (recvList[curBuffer].length + (g_BlockSizes[mbox] - 1)) & - (~(g_BlockSizes[mbox] - 1)); - - status = HIFReadWrite(pDev->HIFDevice, - g_MailboxAddrs[mbox], - recvList[curBuffer].pBuffer, - paddedLength, - request, - NULL); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to read %d bytes on mailbox:%d : address:0x%X \n", - recvList[curBuffer].length, mbox, g_MailboxAddrs[mbox])); - break; - } - - totalwPadding += paddedLength; - totalBytes += recvList[curBuffer].length; - curBuffer++; - } - - if (status != A_OK) { - break; - } - /* go back and get some more */ - credits = 0; - } - - if (totalBytes != TEST_BYTES) { - A_ASSERT(FALSE); - } else { - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Got all buffers on mbox:%d total recv :%d (w/Padding : %d) \n", - mbox, totalBytes, totalwPadding)); - } - - return status; - - -} - -static A_STATUS DoOneMboxHWTest(AR6K_DEVICE *pDev, int mbox) -{ - A_STATUS status; - - do { - /* send out buffers */ - status = SendBuffers(pDev,mbox); - - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Sending buffers Failed : %d mbox:%d\n",status,mbox)); - break; - } - - /* go get them, this will block */ - status = RecvBuffers(pDev, mbox); - - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Recv buffers Failed : %d mbox:%d\n",status,mbox)); - break; - } - - /* check the returned data patterns */ - if (!CheckBuffers()) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Buffer Verify Failed : mbox:%d\n",mbox)); - status = A_ERROR; - break; - } - - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, (" Send/Recv success! mailbox : %d \n",mbox)); - - } while (FALSE); - - return status; -} - -/* here is where the test starts */ -A_STATUS DoMboxHWTest(AR6K_DEVICE *pDev) -{ - int i; - A_STATUS status; - int credits = 0; - A_UINT8 params[4]; - int numBufs; - int bufferSize; - A_UINT16 temp; - - - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, (" DoMboxHWTest START - \n")); - - do { - /* get the addresses for all 4 mailboxes */ - status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_ADDR, - g_MailboxAddrs, sizeof(g_MailboxAddrs)); - - if (status != A_OK) { - A_ASSERT(FALSE); - break; - } - - /* get the block sizes */ - status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_BLOCK_SIZE, - g_BlockSizes, sizeof(g_BlockSizes)); - - if (status != A_OK) { - A_ASSERT(FALSE); - break; - } - - /* note, the HIF layer usually reports mbox 0 to have a block size of - * 1, but our test wants to run in block-mode for all mailboxes, so we treat all mailboxes - * the same. */ - g_BlockSizes[0] = g_BlockSizes[1]; - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Block Size to use: %d \n",g_BlockSizes[0])); - - if (g_BlockSizes[1] > BUFFER_BLOCK_PAD) { - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("%d Block size is too large for buffer pad %d\n", - g_BlockSizes[1], BUFFER_BLOCK_PAD)); - break; - } - - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Waiting for target.... \n")); - - /* the target lets us know it is ready by giving us 1 credit on - * mailbox 0 */ - status = GetCredits(pDev, 0, &credits); - - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to wait for target ready \n")); - break; - } - - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Target is ready ...\n")); - - /* read the first 4 scratch registers */ - status = HIFReadWrite(pDev->HIFDevice, - SCRATCH_ADDRESS, - params, - 4, - HIF_RD_SYNC_BYTE_INC, - NULL); - - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to wait get parameters \n")); - break; - } - - numBufs = params[0]; - bufferSize = (int)(((A_UINT16)params[2] << 8) | (A_UINT16)params[1]); - - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, - ("Target parameters: bufs per mailbox:%d, buffer size:%d bytes (total space: %d, minimum required space (w/padding): %d) \n", - numBufs, bufferSize, (numBufs * bufferSize), TOTAL_BYTES)); - - if ((numBufs * bufferSize) < TOTAL_BYTES) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Not Enough buffer space to run test! need:%d, got:%d \n", - TOTAL_BYTES, (numBufs*bufferSize))); - status = A_ERROR; - break; - } - - temp = GetEndMarker(); - - status = HIFReadWrite(pDev->HIFDevice, - SCRATCH_ADDRESS + 4, - (A_UINT8 *)&temp, - 2, - HIF_WR_SYNC_BYTE_INC, - NULL); - - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to write end marker \n")); - break; - } - - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("End Marker: 0x%X \n",temp)); - - temp = (A_UINT16)g_BlockSizes[1]; - /* convert to a mask */ - temp = temp - 1; - status = HIFReadWrite(pDev->HIFDevice, - SCRATCH_ADDRESS + 6, - (A_UINT8 *)&temp, - 2, - HIF_WR_SYNC_BYTE_INC, - NULL); - - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to write block mask \n")); - break; - } - - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Set Block Mask: 0x%X \n",temp)); - - /* execute the test on each mailbox */ - for (i = 0; i < AR6K_MAILBOXES; i++) { - status = DoOneMboxHWTest(pDev, i); - if (status != A_OK) { - break; - } - } - - } while (FALSE); - - if (status == A_OK) { - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, (" DoMboxHWTest DONE - SUCCESS! - \n")); - } else { - AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, (" DoMboxHWTest DONE - FAILED! - \n")); - } - /* don't let HTC_Start continue, the target is actually not running any HTC code */ - return A_ERROR; -} -#endif - - - diff --git a/drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k.h b/drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k.h deleted file mode 100644 index a5a3c984554e..000000000000 --- a/drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k.h +++ /dev/null @@ -1,399 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// AR6K device layer that handles register level I/O -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef AR6K_H_ -#define AR6K_H_ - -#include "hci_transport_api.h" -#include "../htc_debug.h" - -#define AR6K_MAILBOXES 4 - -/* HTC runs over mailbox 0 */ -#define HTC_MAILBOX 0 - -#define AR6K_TARGET_DEBUG_INTR_MASK 0x01 - -#define OTHER_INTS_ENABLED (INT_STATUS_ENABLE_ERROR_MASK | \ - INT_STATUS_ENABLE_CPU_MASK | \ - INT_STATUS_ENABLE_COUNTER_MASK) - - -//#define MBOXHW_UNIT_TEST 1 - -#include "athstartpack.h" -typedef PREPACK struct _AR6K_IRQ_PROC_REGISTERS { - A_UINT8 host_int_status; - A_UINT8 cpu_int_status; - A_UINT8 error_int_status; - A_UINT8 counter_int_status; - A_UINT8 mbox_frame; - A_UINT8 rx_lookahead_valid; - A_UINT8 host_int_status2; - A_UINT8 gmbox_rx_avail; - A_UINT32 rx_lookahead[2]; - A_UINT32 rx_gmbox_lookahead_alias[2]; -} POSTPACK AR6K_IRQ_PROC_REGISTERS; - -#define AR6K_IRQ_PROC_REGS_SIZE sizeof(AR6K_IRQ_PROC_REGISTERS) - -typedef PREPACK struct _AR6K_IRQ_ENABLE_REGISTERS { - A_UINT8 int_status_enable; - A_UINT8 cpu_int_status_enable; - A_UINT8 error_status_enable; - A_UINT8 counter_int_status_enable; -} POSTPACK AR6K_IRQ_ENABLE_REGISTERS; - -typedef PREPACK struct _AR6K_GMBOX_CTRL_REGISTERS { - A_UINT8 int_status_enable; -} POSTPACK AR6K_GMBOX_CTRL_REGISTERS; - -#include "athendpack.h" - -#define AR6K_IRQ_ENABLE_REGS_SIZE sizeof(AR6K_IRQ_ENABLE_REGISTERS) - -#define AR6K_REG_IO_BUFFER_SIZE 32 -#define AR6K_MAX_REG_IO_BUFFERS 8 -#define FROM_DMA_BUFFER TRUE -#define TO_DMA_BUFFER FALSE -#define AR6K_SCATTER_ENTRIES_PER_REQ 16 -#define AR6K_MAX_TRANSFER_SIZE_PER_SCATTER 16*1024 -#define AR6K_SCATTER_REQS 4 -#define AR6K_LEGACY_MAX_WRITE_LENGTH 2048 - -#ifndef A_CACHE_LINE_PAD -#define A_CACHE_LINE_PAD 128 -#endif - -/* buffers for ASYNC I/O */ -typedef struct AR6K_ASYNC_REG_IO_BUFFER { - HTC_PACKET HtcPacket; /* we use an HTC packet as a wrapper for our async register-based I/O */ - A_UINT8 _Pad1[A_CACHE_LINE_PAD]; - A_UINT8 Buffer[AR6K_REG_IO_BUFFER_SIZE]; /* cache-line safe with pads around */ - A_UINT8 _Pad2[A_CACHE_LINE_PAD]; -} AR6K_ASYNC_REG_IO_BUFFER; - -typedef struct _AR6K_GMBOX_INFO { - void *pProtocolContext; - A_STATUS (*pMessagePendingCallBack)(void *pContext, A_UINT8 LookAheadBytes[], int ValidBytes); - A_STATUS (*pCreditsPendingCallback)(void *pContext, int NumCredits, A_BOOL CreditIRQEnabled); - void (*pTargetFailureCallback)(void *pContext, A_STATUS Status); - void (*pStateDumpCallback)(void *pContext); - A_BOOL CreditCountIRQEnabled; -} AR6K_GMBOX_INFO; - -typedef struct _AR6K_DEVICE { - A_MUTEX_T Lock; - A_UINT8 _Pad1[A_CACHE_LINE_PAD]; - AR6K_IRQ_PROC_REGISTERS IrqProcRegisters; /* cache-line safe with pads around */ - A_UINT8 _Pad2[A_CACHE_LINE_PAD]; - AR6K_IRQ_ENABLE_REGISTERS IrqEnableRegisters; /* cache-line safe with pads around */ - A_UINT8 _Pad3[A_CACHE_LINE_PAD]; - void *HIFDevice; - A_UINT32 BlockSize; - A_UINT32 BlockMask; - HIF_DEVICE_MBOX_INFO MailBoxInfo; - HIF_PENDING_EVENTS_FUNC GetPendingEventsFunc; - void *HTCContext; - HTC_PACKET_QUEUE RegisterIOList; - AR6K_ASYNC_REG_IO_BUFFER RegIOBuffers[AR6K_MAX_REG_IO_BUFFERS]; - void (*TargetFailureCallback)(void *Context); - A_STATUS (*MessagePendingCallback)(void *Context, - A_UINT32 LookAheads[], - int NumLookAheads, - A_BOOL *pAsyncProc, - int *pNumPktsFetched); - HIF_DEVICE_IRQ_PROCESSING_MODE HifIRQProcessingMode; - HIF_MASK_UNMASK_RECV_EVENT HifMaskUmaskRecvEvent; - A_BOOL HifAttached; - HIF_DEVICE_IRQ_YIELD_PARAMS HifIRQYieldParams; - A_BOOL DSRCanYield; - int CurrentDSRRecvCount; - HIF_DEVICE_SCATTER_SUPPORT_INFO HifScatterInfo; - DL_LIST ScatterReqHead; - A_BOOL ScatterIsVirtual; - int MaxRecvBundleSize; - int MaxSendBundleSize; - AR6K_GMBOX_INFO GMboxInfo; - A_BOOL GMboxEnabled; - AR6K_GMBOX_CTRL_REGISTERS GMboxControlRegisters; - int RecheckIRQStatusCnt; -} AR6K_DEVICE; - -#define LOCK_AR6K(p) A_MUTEX_LOCK(&(p)->Lock); -#define UNLOCK_AR6K(p) A_MUTEX_UNLOCK(&(p)->Lock); -#define REF_IRQ_STATUS_RECHECK(p) (p)->RecheckIRQStatusCnt = 1 /* note: no need to lock this, it only gets set */ - -A_STATUS DevSetup(AR6K_DEVICE *pDev); -void DevCleanup(AR6K_DEVICE *pDev); -A_STATUS DevUnmaskInterrupts(AR6K_DEVICE *pDev); -A_STATUS DevMaskInterrupts(AR6K_DEVICE *pDev); -A_STATUS DevPollMboxMsgRecv(AR6K_DEVICE *pDev, - A_UINT32 *pLookAhead, - int TimeoutMS); -A_STATUS DevRWCompletionHandler(void *context, A_STATUS status); -A_STATUS DevDsrHandler(void *context); -A_STATUS DevCheckPendingRecvMsgsAsync(void *context); -void DevAsyncIrqProcessComplete(AR6K_DEVICE *pDev); -void DevDumpRegisters(AR6K_DEVICE *pDev, - AR6K_IRQ_PROC_REGISTERS *pIrqProcRegs, - AR6K_IRQ_ENABLE_REGISTERS *pIrqEnableRegs); - -#define DEV_STOP_RECV_ASYNC TRUE -#define DEV_STOP_RECV_SYNC FALSE -#define DEV_ENABLE_RECV_ASYNC TRUE -#define DEV_ENABLE_RECV_SYNC FALSE -A_STATUS DevStopRecv(AR6K_DEVICE *pDev, A_BOOL ASyncMode); -A_STATUS DevEnableRecv(AR6K_DEVICE *pDev, A_BOOL ASyncMode); -A_STATUS DevEnableInterrupts(AR6K_DEVICE *pDev); -A_STATUS DevDisableInterrupts(AR6K_DEVICE *pDev); -A_STATUS DevWaitForPendingRecv(AR6K_DEVICE *pDev,A_UINT32 TimeoutInMs,A_BOOL *pbIsRecvPending); - -#define DEV_CALC_RECV_PADDED_LEN(pDev, length) (((length) + (pDev)->BlockMask) & (~((pDev)->BlockMask))) -#define DEV_CALC_SEND_PADDED_LEN(pDev, length) DEV_CALC_RECV_PADDED_LEN(pDev,length) -#define DEV_IS_LEN_BLOCK_ALIGNED(pDev, length) (((length) % (pDev)->BlockSize) == 0) - -static INLINE A_STATUS DevSendPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 SendLength) { - A_UINT32 paddedLength; - A_BOOL sync = (pPacket->Completion == NULL) ? TRUE : FALSE; - A_STATUS status; - - /* adjust the length to be a multiple of block size if appropriate */ - paddedLength = DEV_CALC_SEND_PADDED_LEN(pDev, SendLength); - -#if 0 - if (paddedLength > pPacket->BufferLength) { - A_ASSERT(FALSE); - if (pPacket->Completion != NULL) { - COMPLETE_HTC_PACKET(pPacket,A_EINVAL); - return A_OK; - } - return A_EINVAL; - } -#endif - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, - ("DevSendPacket, Padded Length: %d Mbox:0x%X (mode:%s)\n", - paddedLength, - pDev->MailBoxInfo.MboxAddresses[HTC_MAILBOX], - sync ? "SYNC" : "ASYNC")); - - status = HIFReadWrite(pDev->HIFDevice, - pDev->MailBoxInfo.MboxAddresses[HTC_MAILBOX], - pPacket->pBuffer, - paddedLength, /* the padded length */ - sync ? HIF_WR_SYNC_BLOCK_INC : HIF_WR_ASYNC_BLOCK_INC, - sync ? NULL : pPacket); /* pass the packet as the context to the HIF request */ - - if (sync) { - pPacket->Status = status; - } else { - if (status == A_PENDING) { - status = A_OK; - } - } - - return status; -} - -static INLINE A_STATUS DevRecvPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 RecvLength) { - A_UINT32 paddedLength; - A_STATUS status; - A_BOOL sync = (pPacket->Completion == NULL) ? TRUE : FALSE; - - /* adjust the length to be a multiple of block size if appropriate */ - paddedLength = DEV_CALC_RECV_PADDED_LEN(pDev, RecvLength); - - if (paddedLength > pPacket->BufferLength) { - A_ASSERT(FALSE); - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("DevRecvPacket, Not enough space for padlen:%d recvlen:%d bufferlen:%d \n", - paddedLength,RecvLength,pPacket->BufferLength)); - if (pPacket->Completion != NULL) { - COMPLETE_HTC_PACKET(pPacket,A_EINVAL); - return A_OK; - } - return A_EINVAL; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, - ("DevRecvPacket (0x%lX : hdr:0x%X) Padded Length: %d Mbox:0x%X (mode:%s)\n", - (unsigned long)pPacket, pPacket->PktInfo.AsRx.ExpectedHdr, - paddedLength, - pDev->MailBoxInfo.MboxAddresses[HTC_MAILBOX], - sync ? "SYNC" : "ASYNC")); - - status = HIFReadWrite(pDev->HIFDevice, - pDev->MailBoxInfo.MboxAddresses[HTC_MAILBOX], - pPacket->pBuffer, - paddedLength, - sync ? HIF_RD_SYNC_BLOCK_FIX : HIF_RD_ASYNC_BLOCK_FIX, - sync ? NULL : pPacket); /* pass the packet as the context to the HIF request */ - - if (sync) { - pPacket->Status = status; - } - - return status; -} - -#define DEV_CHECK_RECV_YIELD(pDev) \ - ((pDev)->CurrentDSRRecvCount >= (pDev)->HifIRQYieldParams.RecvPacketYieldCount) - -#define IS_DEV_IRQ_PROC_SYNC_MODE(pDev) (HIF_DEVICE_IRQ_SYNC_ONLY == (pDev)->HifIRQProcessingMode) -#define IS_DEV_IRQ_PROCESSING_ASYNC_ALLOWED(pDev) ((pDev)->HifIRQProcessingMode != HIF_DEVICE_IRQ_SYNC_ONLY) - -/**************************************************/ -/****** Scatter Function and Definitions - * - * - */ - -A_STATUS DevCopyScatterListToFromDMABuffer(HIF_SCATTER_REQ *pReq, A_BOOL FromDMA); - - /* copy any READ data back into scatter list */ -#define DEV_FINISH_SCATTER_OPERATION(pR) \ - if (A_SUCCESS((pR)->CompletionStatus) && \ - !((pR)->Request & HIF_WRITE) && \ - ((pR)->ScatterMethod == HIF_SCATTER_DMA_BOUNCE)) { \ - (pR)->CompletionStatus = DevCopyScatterListToFromDMABuffer((pR),FROM_DMA_BUFFER); \ - } - - /* copy any WRITE data to bounce buffer */ -static INLINE A_STATUS DEV_PREPARE_SCATTER_OPERATION(HIF_SCATTER_REQ *pReq) { - if ((pReq->Request & HIF_WRITE) && (pReq->ScatterMethod == HIF_SCATTER_DMA_BOUNCE)) { - return DevCopyScatterListToFromDMABuffer(pReq,TO_DMA_BUFFER); - } else { - return A_OK; - } -} - - -A_STATUS DevSetupMsgBundling(AR6K_DEVICE *pDev, int MaxMsgsPerTransfer); - -A_STATUS DevCleanupMsgBundling(AR6K_DEVICE *pDev); - - -#define DEV_GET_MAX_MSG_PER_BUNDLE(pDev) (pDev)->HifScatterInfo.MaxScatterEntries -#define DEV_GET_MAX_BUNDLE_LENGTH(pDev) (pDev)->HifScatterInfo.MaxTransferSizePerScatterReq -#define DEV_ALLOC_SCATTER_REQ(pDev) \ - (pDev)->HifScatterInfo.pAllocateReqFunc((pDev)->ScatterIsVirtual ? (pDev) : (pDev)->HIFDevice) - -#define DEV_FREE_SCATTER_REQ(pDev,pR) \ - (pDev)->HifScatterInfo.pFreeReqFunc((pDev)->ScatterIsVirtual ? (pDev) : (pDev)->HIFDevice,(pR)) - -#define DEV_GET_MAX_BUNDLE_RECV_LENGTH(pDev) (pDev)->MaxRecvBundleSize -#define DEV_GET_MAX_BUNDLE_SEND_LENGTH(pDev) (pDev)->MaxSendBundleSize - -#define DEV_SCATTER_READ TRUE -#define DEV_SCATTER_WRITE FALSE -#define DEV_SCATTER_ASYNC TRUE -#define DEV_SCATTER_SYNC FALSE -A_STATUS DevSubmitScatterRequest(AR6K_DEVICE *pDev, HIF_SCATTER_REQ *pScatterReq, A_BOOL Read, A_BOOL Async); - -#ifdef MBOXHW_UNIT_TEST -A_STATUS DoMboxHWTest(AR6K_DEVICE *pDev); -#endif - - /* completely virtual */ -typedef struct _DEV_SCATTER_DMA_VIRTUAL_INFO { - A_UINT8 *pVirtDmaBuffer; /* dma-able buffer - CPU accessible address */ - A_UINT8 DataArea[1]; /* start of data area */ -} DEV_SCATTER_DMA_VIRTUAL_INFO; - - - -void DumpAR6KDevState(AR6K_DEVICE *pDev); - -/**************************************************/ -/****** GMBOX functions and definitions - * - * - */ - -#ifdef ATH_AR6K_ENABLE_GMBOX - -void DevCleanupGMbox(AR6K_DEVICE *pDev); -A_STATUS DevSetupGMbox(AR6K_DEVICE *pDev); -A_STATUS DevCheckGMboxInterrupts(AR6K_DEVICE *pDev); -void DevNotifyGMboxTargetFailure(AR6K_DEVICE *pDev); - -#else - - /* compiled out */ -#define DevCleanupGMbox(p) -#define DevCheckGMboxInterrupts(p) A_OK -#define DevNotifyGMboxTargetFailure(p) - -static INLINE A_STATUS DevSetupGMbox(AR6K_DEVICE *pDev) { - pDev->GMboxEnabled = FALSE; - return A_OK; -} - -#endif - -#ifdef ATH_AR6K_ENABLE_GMBOX - - /* GMBOX protocol modules must expose each of these internal APIs */ -HCI_TRANSPORT_HANDLE GMboxAttachProtocol(AR6K_DEVICE *pDev, HCI_TRANSPORT_CONFIG_INFO *pInfo); -A_STATUS GMboxProtocolInstall(AR6K_DEVICE *pDev); -void GMboxProtocolUninstall(AR6K_DEVICE *pDev); - - /* API used by GMBOX protocol modules */ -AR6K_DEVICE *HTCGetAR6KDevice(void *HTCHandle); -#define DEV_GMBOX_SET_PROTOCOL(pDev,recv_callback,credits_pending,failure,statedump,context) \ -{ \ - (pDev)->GMboxInfo.pProtocolContext = (context); \ - (pDev)->GMboxInfo.pMessagePendingCallBack = (recv_callback); \ - (pDev)->GMboxInfo.pCreditsPendingCallback = (credits_pending); \ - (pDev)->GMboxInfo.pTargetFailureCallback = (failure); \ - (pDev)->GMboxInfo.pStateDumpCallback = (statedump); \ -} - -#define DEV_GMBOX_GET_PROTOCOL(pDev) (pDev)->GMboxInfo.pProtocolContext - -A_STATUS DevGMboxWrite(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 WriteLength); -A_STATUS DevGMboxRead(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 ReadLength); - -#define PROC_IO_ASYNC TRUE -#define PROC_IO_SYNC FALSE -typedef enum GMBOX_IRQ_ACTION_TYPE { - GMBOX_ACTION_NONE = 0, - GMBOX_DISABLE_ALL, - GMBOX_ERRORS_IRQ_ENABLE, - GMBOX_RECV_IRQ_ENABLE, - GMBOX_RECV_IRQ_DISABLE, - GMBOX_CREDIT_IRQ_ENABLE, - GMBOX_CREDIT_IRQ_DISABLE, -} GMBOX_IRQ_ACTION_TYPE; - -A_STATUS DevGMboxIRQAction(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION_TYPE, A_BOOL AsyncMode); -A_STATUS DevGMboxReadCreditCounter(AR6K_DEVICE *pDev, A_BOOL AsyncMode, int *pCredits); -A_STATUS DevGMboxReadCreditSize(AR6K_DEVICE *pDev, int *pCreditSize); -A_STATUS DevGMboxRecvLookAheadPeek(AR6K_DEVICE *pDev, A_UINT8 *pLookAheadBuffer, int *pLookAheadBytes); -A_STATUS DevGMboxSetTargetInterrupt(AR6K_DEVICE *pDev, int SignalNumber, int AckTimeoutMS); - -#endif - -#endif /*AR6K_H_*/ diff --git a/drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k_events.c b/drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k_events.c deleted file mode 100644 index 18b733e9e9f2..000000000000 --- a/drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k_events.c +++ /dev/null @@ -1,767 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// AR6K Driver layer event handling (i.e. interrupts, message polling) -// -// Author(s): ="Atheros" -//============================================================================== - -#include "a_config.h" -#include "athdefs.h" -#include "a_types.h" -#include "a_osapi.h" -#include "../htc_debug.h" -#include "hif.h" -#include "htc_packet.h" -#include "ar6k.h" -#include "target_reg_table.h" -#include "host_reg_table.h" - -extern void AR6KFreeIOPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket); -extern HTC_PACKET *AR6KAllocIOPacket(AR6K_DEVICE *pDev); - -static A_STATUS DevServiceDebugInterrupt(AR6K_DEVICE *pDev); - -#define DELAY_PER_INTERVAL_MS 10 /* 10 MS delay per polling interval */ - -/* completion routine for ALL HIF layer async I/O */ -A_STATUS DevRWCompletionHandler(void *context, A_STATUS status) -{ - HTC_PACKET *pPacket = (HTC_PACKET *)context; - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, - ("+DevRWCompletionHandler (Pkt:0x%lX) , Status: %d \n", - (unsigned long)pPacket, - status)); - - COMPLETE_HTC_PACKET(pPacket,status); - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, - ("-DevRWCompletionHandler\n")); - - return A_OK; -} - -/* mailbox recv message polling */ -A_STATUS DevPollMboxMsgRecv(AR6K_DEVICE *pDev, - A_UINT32 *pLookAhead, - int TimeoutMS) -{ - A_STATUS status = A_OK; - int timeout = TimeoutMS/DELAY_PER_INTERVAL_MS; - - A_ASSERT(timeout > 0); - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+DevPollMboxMsgRecv \n")); - - while (TRUE) { - - if (pDev->GetPendingEventsFunc != NULL) { - - HIF_PENDING_EVENTS_INFO events; - - /* the HIF layer uses a special mechanism to get events, do this - * synchronously */ - status = pDev->GetPendingEventsFunc(pDev->HIFDevice, - &events, - NULL); - if (A_FAILED(status)) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Failed to get pending events \n")); - break; - } - - if (events.Events & HIF_RECV_MSG_AVAIL) - { - /* there is a message available, the lookahead should be valid now */ - *pLookAhead = events.LookAhead; - - break; - } - } else { - - /* this is the standard HIF way.... */ - /* load the register table */ - status = HIFReadWrite(pDev->HIFDevice, - HOST_INT_STATUS_ADDRESS, - (A_UINT8 *)&pDev->IrqProcRegisters, - AR6K_IRQ_PROC_REGS_SIZE, - HIF_RD_SYNC_BYTE_INC, - NULL); - - if (A_FAILED(status)){ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Failed to read register table \n")); - break; - } - - /* check for MBOX data and valid lookahead */ - if (pDev->IrqProcRegisters.host_int_status & (1 << HTC_MAILBOX)) { - if (pDev->IrqProcRegisters.rx_lookahead_valid & (1 << HTC_MAILBOX)) - { - /* mailbox has a message and the look ahead is valid */ - *pLookAhead = pDev->IrqProcRegisters.rx_lookahead[HTC_MAILBOX]; - break; - } - } - - } - - timeout--; - - if (timeout <= 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, (" Timeout waiting for recv message \n")); - status = A_ERROR; - - /* check if the target asserted */ - if ( pDev->IrqProcRegisters.counter_int_status & AR6K_TARGET_DEBUG_INTR_MASK) { - /* target signaled an assert, process this pending interrupt - * this will call the target failure handler */ - DevServiceDebugInterrupt(pDev); - } - - break; - } - - /* delay a little */ - A_MDELAY(DELAY_PER_INTERVAL_MS); - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,(" Retry Mbox Poll : %d \n",timeout)); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("-DevPollMboxMsgRecv \n")); - - return status; -} - -static A_STATUS DevServiceCPUInterrupt(AR6K_DEVICE *pDev) -{ - A_STATUS status; - A_UINT8 cpu_int_status; - A_UINT8 regBuffer[4]; - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("CPU Interrupt\n")); - cpu_int_status = pDev->IrqProcRegisters.cpu_int_status & - pDev->IrqEnableRegisters.cpu_int_status_enable; - A_ASSERT(cpu_int_status); - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, - ("Valid interrupt source(s) in CPU_INT_STATUS: 0x%x\n", - cpu_int_status)); - - /* Clear the interrupt */ - pDev->IrqProcRegisters.cpu_int_status &= ~cpu_int_status; /* W1C */ - - /* set up the register transfer buffer to hit the register 4 times , this is done - * to make the access 4-byte aligned to mitigate issues with host bus interconnects that - * restrict bus transfer lengths to be a multiple of 4-bytes */ - - /* set W1C value to clear the interrupt, this hits the register first */ - regBuffer[0] = cpu_int_status; - /* the remaining 4 values are set to zero which have no-effect */ - regBuffer[1] = 0; - regBuffer[2] = 0; - regBuffer[3] = 0; - - status = HIFReadWrite(pDev->HIFDevice, - CPU_INT_STATUS_ADDRESS, - regBuffer, - 4, - HIF_WR_SYNC_BYTE_FIX, - NULL); - - A_ASSERT(status == A_OK); - return status; -} - - -static A_STATUS DevServiceErrorInterrupt(AR6K_DEVICE *pDev) -{ - A_STATUS status; - A_UINT8 error_int_status; - A_UINT8 regBuffer[4]; - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("Error Interrupt\n")); - error_int_status = pDev->IrqProcRegisters.error_int_status & 0x0F; - A_ASSERT(error_int_status); - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, - ("Valid interrupt source(s) in ERROR_INT_STATUS: 0x%x\n", - error_int_status)); - - if (ERROR_INT_STATUS_WAKEUP_GET(error_int_status)) { - /* Wakeup */ - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("Error : Wakeup\n")); - } - - if (ERROR_INT_STATUS_RX_UNDERFLOW_GET(error_int_status)) { - /* Rx Underflow */ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Error : Rx Underflow\n")); - } - - if (ERROR_INT_STATUS_TX_OVERFLOW_GET(error_int_status)) { - /* Tx Overflow */ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Error : Tx Overflow\n")); - } - - /* Clear the interrupt */ - pDev->IrqProcRegisters.error_int_status &= ~error_int_status; /* W1C */ - - /* set up the register transfer buffer to hit the register 4 times , this is done - * to make the access 4-byte aligned to mitigate issues with host bus interconnects that - * restrict bus transfer lengths to be a multiple of 4-bytes */ - - /* set W1C value to clear the interrupt, this hits the register first */ - regBuffer[0] = error_int_status; - /* the remaining 4 values are set to zero which have no-effect */ - regBuffer[1] = 0; - regBuffer[2] = 0; - regBuffer[3] = 0; - - status = HIFReadWrite(pDev->HIFDevice, - ERROR_INT_STATUS_ADDRESS, - regBuffer, - 4, - HIF_WR_SYNC_BYTE_FIX, - NULL); - - A_ASSERT(status == A_OK); - return status; -} - -static A_STATUS DevServiceDebugInterrupt(AR6K_DEVICE *pDev) -{ - A_UINT32 dummy; - A_STATUS status; - - /* Send a target failure event to the application */ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Target debug interrupt\n")); - - if (pDev->TargetFailureCallback != NULL) { - pDev->TargetFailureCallback(pDev->HTCContext); - } - - if (pDev->GMboxEnabled) { - DevNotifyGMboxTargetFailure(pDev); - } - - /* clear the interrupt , the debug error interrupt is - * counter 0 */ - /* read counter to clear interrupt */ - status = HIFReadWrite(pDev->HIFDevice, - COUNT_DEC_ADDRESS, - (A_UINT8 *)&dummy, - 4, - HIF_RD_SYNC_BYTE_INC, - NULL); - - A_ASSERT(status == A_OK); - return status; -} - -static A_STATUS DevServiceCounterInterrupt(AR6K_DEVICE *pDev) -{ - A_UINT8 counter_int_status; - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("Counter Interrupt\n")); - - counter_int_status = pDev->IrqProcRegisters.counter_int_status & - pDev->IrqEnableRegisters.counter_int_status_enable; - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, - ("Valid interrupt source(s) in COUNTER_INT_STATUS: 0x%x\n", - counter_int_status)); - - /* Check if the debug interrupt is pending - * NOTE: other modules like GMBOX may use the counter interrupt for - * credit flow control on other counters, we only need to check for the debug assertion - * counter interrupt */ - if (counter_int_status & AR6K_TARGET_DEBUG_INTR_MASK) { - return DevServiceDebugInterrupt(pDev); - } - - return A_OK; -} - -/* callback when our fetch to get interrupt status registers completes */ -static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket) -{ - AR6K_DEVICE *pDev = (AR6K_DEVICE *)Context; - A_UINT32 lookAhead = 0; - A_BOOL otherInts = FALSE; - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevGetEventAsyncHandler: (dev: 0x%lX)\n", (unsigned long)pDev)); - - do { - - if (A_FAILED(pPacket->Status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - (" GetEvents I/O request failed, status:%d \n", pPacket->Status)); - /* bail out, don't unmask HIF interrupt */ - break; - } - - if (pDev->GetPendingEventsFunc != NULL) { - /* the HIF layer collected the information for us */ - HIF_PENDING_EVENTS_INFO *pEvents = (HIF_PENDING_EVENTS_INFO *)pPacket->pBuffer; - if (pEvents->Events & HIF_RECV_MSG_AVAIL) { - lookAhead = pEvents->LookAhead; - if (0 == lookAhead) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" DevGetEventAsyncHandler1, lookAhead is zero! \n")); - } - } - if (pEvents->Events & HIF_OTHER_EVENTS) { - otherInts = TRUE; - } - } else { - /* standard interrupt table handling.... */ - AR6K_IRQ_PROC_REGISTERS *pReg = (AR6K_IRQ_PROC_REGISTERS *)pPacket->pBuffer; - A_UINT8 host_int_status; - - host_int_status = pReg->host_int_status & pDev->IrqEnableRegisters.int_status_enable; - - if (host_int_status & (1 << HTC_MAILBOX)) { - host_int_status &= ~(1 << HTC_MAILBOX); - if (pReg->rx_lookahead_valid & (1 << HTC_MAILBOX)) { - /* mailbox has a message and the look ahead is valid */ - lookAhead = pReg->rx_lookahead[HTC_MAILBOX]; - if (0 == lookAhead) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" DevGetEventAsyncHandler2, lookAhead is zero! \n")); - } - } - } - - if (host_int_status) { - /* there are other interrupts to handle */ - otherInts = TRUE; - } - } - - if (otherInts || (lookAhead == 0)) { - /* if there are other interrupts to process, we cannot do this in the async handler so - * ack the interrupt which will cause our sync handler to run again - * if however there are no more messages, we can now ack the interrupt */ - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, - (" Acking interrupt from DevGetEventAsyncHandler (otherints:%d, lookahead:0x%X)\n", - otherInts, lookAhead)); - HIFAckInterrupt(pDev->HIFDevice); - } else { - int fetched = 0; - A_STATUS status; - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, - (" DevGetEventAsyncHandler : detected another message, lookahead :0x%X \n", - lookAhead)); - /* lookahead is non-zero and there are no other interrupts to service, - * go get the next message */ - status = pDev->MessagePendingCallback(pDev->HTCContext, &lookAhead, 1, NULL, &fetched); - - if (A_SUCCESS(status) && !fetched) { - /* HTC layer could not pull out messages due to lack of resources, stop IRQ processing */ - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("MessagePendingCallback did not pull any messages, force-ack \n")); - DevAsyncIrqProcessComplete(pDev); - } - } - - } while (FALSE); - - /* free this IO packet */ - AR6KFreeIOPacket(pDev,pPacket); - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevGetEventAsyncHandler \n")); -} - -/* called by the HTC layer when it wants us to check if the device has any more pending - * recv messages, this starts off a series of async requests to read interrupt registers */ -A_STATUS DevCheckPendingRecvMsgsAsync(void *context) -{ - AR6K_DEVICE *pDev = (AR6K_DEVICE *)context; - A_STATUS status = A_OK; - HTC_PACKET *pIOPacket; - - /* this is called in an ASYNC only context, we may NOT block, sleep or call any apis that can - * cause us to switch contexts */ - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevCheckPendingRecvMsgsAsync: (dev: 0x%lX)\n", (unsigned long)pDev)); - - do { - - if (HIF_DEVICE_IRQ_SYNC_ONLY == pDev->HifIRQProcessingMode) { - /* break the async processing chain right here, no need to continue. - * The DevDsrHandler() will handle things in a loop when things are driven - * synchronously */ - break; - } - - /* an optimization to bypass reading the IRQ status registers unecessarily which can re-wake - * the target, if upper layers determine that we are in a low-throughput mode, we can - * rely on taking another interrupt rather than re-checking the status registers which can - * re-wake the target */ - if (pDev->RecheckIRQStatusCnt == 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("Bypassing IRQ Status re-check, re-acking HIF interrupts\n")); - /* ack interrupt */ - HIFAckInterrupt(pDev->HIFDevice); - break; - } - - /* first allocate one of our HTC packets we created for async I/O - * we reuse HTC packet definitions so that we can use the completion mechanism - * in DevRWCompletionHandler() */ - pIOPacket = AR6KAllocIOPacket(pDev); - - if (NULL == pIOPacket) { - /* there should be only 1 asynchronous request out at a time to read these registers - * so this should actually never happen */ - status = A_NO_MEMORY; - A_ASSERT(FALSE); - break; - } - - /* stick in our completion routine when the I/O operation completes */ - pIOPacket->Completion = DevGetEventAsyncHandler; - pIOPacket->pContext = pDev; - - if (pDev->GetPendingEventsFunc) { - /* HIF layer has it's own mechanism, pass the IO to it.. */ - status = pDev->GetPendingEventsFunc(pDev->HIFDevice, - (HIF_PENDING_EVENTS_INFO *)pIOPacket->pBuffer, - pIOPacket); - - } else { - /* standard way, read the interrupt register table asynchronously again */ - status = HIFReadWrite(pDev->HIFDevice, - HOST_INT_STATUS_ADDRESS, - pIOPacket->pBuffer, - AR6K_IRQ_PROC_REGS_SIZE, - HIF_RD_ASYNC_BYTE_INC, - pIOPacket); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,(" Async IO issued to get interrupt status...\n")); - } while (FALSE); - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevCheckPendingRecvMsgsAsync \n")); - - return status; -} - -void DevAsyncIrqProcessComplete(AR6K_DEVICE *pDev) -{ - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("DevAsyncIrqProcessComplete - forcing HIF IRQ ACK \n")); - HIFAckInterrupt(pDev->HIFDevice); -} - -/* process pending interrupts synchronously */ -static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pASyncProcessing) -{ - A_STATUS status = A_OK; - A_UINT8 host_int_status = 0; - A_UINT32 lookAhead = 0; - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+ProcessPendingIRQs: (dev: 0x%lX)\n", (unsigned long)pDev)); - - /*** NOTE: the HIF implementation guarantees that the context of this call allows - * us to perform SYNCHRONOUS I/O, that is we can block, sleep or call any API that - * can block or switch thread/task ontexts. - * This is a fully schedulable context. - * */ - do { - - if (pDev->IrqEnableRegisters.int_status_enable == 0) { - /* interrupt enables have been cleared, do not try to process any pending interrupts that - * may result in more bus transactions. The target may be unresponsive at this - * point. */ - break; - } - - if (pDev->GetPendingEventsFunc != NULL) { - HIF_PENDING_EVENTS_INFO events; - - /* the HIF layer uses a special mechanism to get events - * get this synchronously */ - status = pDev->GetPendingEventsFunc(pDev->HIFDevice, - &events, - NULL); - - if (A_FAILED(status)) { - break; - } - - if (events.Events & HIF_RECV_MSG_AVAIL) { - lookAhead = events.LookAhead; - if (0 == lookAhead) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" ProcessPendingIRQs1 lookAhead is zero! \n")); - } - } - - if (!(events.Events & HIF_OTHER_EVENTS) || - !(pDev->IrqEnableRegisters.int_status_enable & OTHER_INTS_ENABLED)) { - /* no need to read the register table, no other interesting interrupts. - * Some interfaces (like SPI) can shadow interrupt sources without - * requiring the host to do a full table read */ - break; - } - - /* otherwise fall through and read the register table */ - } - - /* - * Read the first 28 bytes of the HTC register table. This will yield us - * the value of different int status registers and the lookahead - * registers. - * length = sizeof(int_status) + sizeof(cpu_int_status) + - * sizeof(error_int_status) + sizeof(counter_int_status) + - * sizeof(mbox_frame) + sizeof(rx_lookahead_valid) + - * sizeof(hole) + sizeof(rx_lookahead) + - * sizeof(int_status_enable) + sizeof(cpu_int_status_enable) + - * sizeof(error_status_enable) + - * sizeof(counter_int_status_enable); - * - */ - status = HIFReadWrite(pDev->HIFDevice, - HOST_INT_STATUS_ADDRESS, - (A_UINT8 *)&pDev->IrqProcRegisters, - AR6K_IRQ_PROC_REGS_SIZE, - HIF_RD_SYNC_BYTE_INC, - NULL); - - if (A_FAILED(status)) { - break; - } - - if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_IRQ)) { - DevDumpRegisters(pDev, - &pDev->IrqProcRegisters, - &pDev->IrqEnableRegisters); - } - - /* Update only those registers that are enabled */ - host_int_status = pDev->IrqProcRegisters.host_int_status & - pDev->IrqEnableRegisters.int_status_enable; - - if (NULL == pDev->GetPendingEventsFunc) { - /* only look at mailbox status if the HIF layer did not provide this function, - * on some HIF interfaces reading the RX lookahead is not valid to do */ - if (host_int_status & (1 << HTC_MAILBOX)) { - /* mask out pending mailbox value, we use "lookAhead" as the real flag for - * mailbox processing below */ - host_int_status &= ~(1 << HTC_MAILBOX); - if (pDev->IrqProcRegisters.rx_lookahead_valid & (1 << HTC_MAILBOX)) { - /* mailbox has a message and the look ahead is valid */ - lookAhead = pDev->IrqProcRegisters.rx_lookahead[HTC_MAILBOX]; - if (0 == lookAhead) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" ProcessPendingIRQs2, lookAhead is zero! \n")); - } - } - } - } else { - /* not valid to check if the HIF has another mechanism for reading mailbox pending status*/ - host_int_status &= ~(1 << HTC_MAILBOX); - } - - if (pDev->GMboxEnabled) { - /*call GMBOX layer to process any interrupts of interest */ - status = DevCheckGMboxInterrupts(pDev); - } - - } while (FALSE); - - - do { - - /* did the interrupt status fetches succeed? */ - if (A_FAILED(status)) { - break; - } - - if ((0 == host_int_status) && (0 == lookAhead)) { - /* nothing to process, the caller can use this to break out of a loop */ - *pDone = TRUE; - break; - } - - if (lookAhead != 0) { - int fetched = 0; - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("Pending mailbox message, LookAhead: 0x%X\n",lookAhead)); - /* Mailbox Interrupt, the HTC layer may issue async requests to empty the - * mailbox... - * When emptying the recv mailbox we use the async handler above called from the - * completion routine of the callers read request. This can improve performance - * by reducing context switching when we rapidly pull packets */ - status = pDev->MessagePendingCallback(pDev->HTCContext, &lookAhead, 1, pASyncProcessing, &fetched); - if (A_FAILED(status)) { - break; - } - - if (!fetched) { - /* HTC could not pull any messages out due to lack of resources */ - /* force DSR handler to ack the interrupt */ - *pASyncProcessing = FALSE; - pDev->RecheckIRQStatusCnt = 0; - } - } - - /* now handle the rest of them */ - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, - (" Valid interrupt source(s) for OTHER interrupts: 0x%x\n", - host_int_status)); - - if (HOST_INT_STATUS_CPU_GET(host_int_status)) { - /* CPU Interrupt */ - status = DevServiceCPUInterrupt(pDev); - if (A_FAILED(status)){ - break; - } - } - - if (HOST_INT_STATUS_ERROR_GET(host_int_status)) { - /* Error Interrupt */ - status = DevServiceErrorInterrupt(pDev); - if (A_FAILED(status)){ - break; - } - } - - if (HOST_INT_STATUS_COUNTER_GET(host_int_status)) { - /* Counter Interrupt */ - status = DevServiceCounterInterrupt(pDev); - if (A_FAILED(status)){ - break; - } - } - - } while (FALSE); - - /* an optimization to bypass reading the IRQ status registers unecessarily which can re-wake - * the target, if upper layers determine that we are in a low-throughput mode, we can - * rely on taking another interrupt rather than re-checking the status registers which can - * re-wake the target. - * - * NOTE : for host interfaces that use the special GetPendingEventsFunc, this optimization cannot - * be used due to possible side-effects. For example, SPI requires the host to drain all - * messages from the mailbox before exiting the ISR routine. */ - if (!(*pASyncProcessing) && (pDev->RecheckIRQStatusCnt == 0) && (pDev->GetPendingEventsFunc == NULL)) { - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("Bypassing IRQ Status re-check, forcing done \n")); - *pDone = TRUE; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-ProcessPendingIRQs: (done:%d, async:%d) status=%d \n", - *pDone, *pASyncProcessing, status)); - - return status; -} - - -/* Synchronousinterrupt handler, this handler kicks off all interrupt processing.*/ -A_STATUS DevDsrHandler(void *context) -{ - AR6K_DEVICE *pDev = (AR6K_DEVICE *)context; - A_STATUS status = A_OK; - A_BOOL done = FALSE; - A_BOOL asyncProc = FALSE; - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevDsrHandler: (dev: 0x%lX)\n", (unsigned long)pDev)); - - /* reset the recv counter that tracks when we need to yield from the DSR */ - pDev->CurrentDSRRecvCount = 0; - /* reset counter used to flag a re-scan of IRQ status registers on the target */ - pDev->RecheckIRQStatusCnt = 0; - - while (!done) { - status = ProcessPendingIRQs(pDev, &done, &asyncProc); - if (A_FAILED(status)) { - break; - } - - if (HIF_DEVICE_IRQ_SYNC_ONLY == pDev->HifIRQProcessingMode) { - /* the HIF layer does not allow async IRQ processing, override the asyncProc flag */ - asyncProc = FALSE; - /* this will cause us to re-enter ProcessPendingIRQ() and re-read interrupt status registers. - * this has a nice side effect of blocking us until all async read requests are completed. - * This behavior is required on some HIF implementations that do not allow ASYNC - * processing in interrupt handlers (like Windows CE) */ - - if (pDev->DSRCanYield && DEV_CHECK_RECV_YIELD(pDev)) { - /* ProcessPendingIRQs() pulled enough recv messages to satisfy the yield count, stop - * checking for more messages and return */ - break; - } - } - - if (asyncProc) { - /* the function performed some async I/O for performance, we - need to exit the ISR immediately, the check below will prevent the interrupt from being - Ack'd while we handle it asynchronously */ - break; - } - - } - - if (A_SUCCESS(status) && !asyncProc) { - /* Ack the interrupt only if : - * 1. we did not get any errors in processing interrupts - * 2. there are no outstanding async processing requests */ - if (pDev->DSRCanYield) { - /* if the DSR can yield do not ACK the interrupt, there could be more pending messages. - * The HIF layer must ACK the interrupt on behalf of HTC */ - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,(" Yield in effect (cur RX count: %d) \n", pDev->CurrentDSRRecvCount)); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,(" Acking interrupt from DevDsrHandler \n")); - HIFAckInterrupt(pDev->HIFDevice); - } - } - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevDsrHandler \n")); - return status; -} - -void DumpAR6KDevState(AR6K_DEVICE *pDev) -{ - A_STATUS status; - AR6K_IRQ_ENABLE_REGISTERS regs; - AR6K_IRQ_PROC_REGISTERS procRegs; - - LOCK_AR6K(pDev); - /* copy into our temp area */ - A_MEMCPY(®s,&pDev->IrqEnableRegisters,AR6K_IRQ_ENABLE_REGS_SIZE); - UNLOCK_AR6K(pDev); - - /* load the register table from the device */ - status = HIFReadWrite(pDev->HIFDevice, - HOST_INT_STATUS_ADDRESS, - (A_UINT8 *)&procRegs, - AR6K_IRQ_PROC_REGS_SIZE, - HIF_RD_SYNC_BYTE_INC, - NULL); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("DumpAR6KDevState : Failed to read register table (%d) \n",status)); - return; - } - - DevDumpRegisters(pDev,&procRegs,®s); - - if (pDev->GMboxInfo.pStateDumpCallback != NULL) { - pDev->GMboxInfo.pStateDumpCallback(pDev->GMboxInfo.pProtocolContext); - } - - /* dump any bus state at the HIF layer */ - HIFConfigureDevice(pDev->HIFDevice,HIF_DEVICE_DEBUG_BUS_STATE,NULL,0); - -} - - diff --git a/drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k_gmbox.c b/drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k_gmbox.c deleted file mode 100644 index 4aacbea60fb8..000000000000 --- a/drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k_gmbox.c +++ /dev/null @@ -1,757 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Generic MBOX API implementation -// -// Author(s): ="Atheros" -//============================================================================== - -#include "a_config.h" -#include "athdefs.h" -#include "a_types.h" -#include "a_osapi.h" -#include "../htc_debug.h" -#include "hif.h" -#include "htc_packet.h" -#include "ar6k.h" -#include "hw/mbox_host_reg.h" -#include "gmboxif.h" - -/* - * This file provides management functions and a toolbox for GMBOX protocol modules. - * Only one protocol module can be installed at a time. The determination of which protocol - * module is installed is determined at compile time. - * - */ -#ifdef ATH_AR6K_ENABLE_GMBOX - /* GMBOX definitions */ -#define GMBOX_INT_STATUS_ENABLE_REG 0x488 -#define GMBOX_INT_STATUS_RX_DATA (1 << 0) -#define GMBOX_INT_STATUS_TX_OVERFLOW (1 << 1) -#define GMBOX_INT_STATUS_RX_OVERFLOW (1 << 2) - -#define GMBOX_LOOKAHEAD_MUX_REG 0x498 -#define GMBOX_LA_MUX_OVERRIDE_2_3 (1 << 0) - -#define AR6K_GMBOX_CREDIT_DEC_ADDRESS (COUNT_DEC_ADDRESS + 4 * AR6K_GMBOX_CREDIT_COUNTER) -#define AR6K_GMBOX_CREDIT_SIZE_ADDRESS (COUNT_ADDRESS + AR6K_GMBOX_CREDIT_SIZE_COUNTER) - - - /* external APIs for allocating and freeing internal I/O packets to handle ASYNC I/O */ -extern void AR6KFreeIOPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket); -extern HTC_PACKET *AR6KAllocIOPacket(AR6K_DEVICE *pDev); - - -/* callback when our fetch to enable/disable completes */ -static void DevGMboxIRQActionAsyncHandler(void *Context, HTC_PACKET *pPacket) -{ - AR6K_DEVICE *pDev = (AR6K_DEVICE *)Context; - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevGMboxIRQActionAsyncHandler: (dev: 0x%lX)\n", (unsigned long)pDev)); - - if (A_FAILED(pPacket->Status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("IRQAction Operation (%d) failed! status:%d \n", pPacket->PktInfo.AsRx.HTCRxFlags,pPacket->Status)); - } - /* free this IO packet */ - AR6KFreeIOPacket(pDev,pPacket); - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevGMboxIRQActionAsyncHandler \n")); -} - -static A_STATUS DevGMboxCounterEnableDisable(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION_TYPE IrqAction, A_BOOL AsyncMode) -{ - A_STATUS status = A_OK; - AR6K_IRQ_ENABLE_REGISTERS regs; - HTC_PACKET *pIOPacket = NULL; - - LOCK_AR6K(pDev); - - if (GMBOX_CREDIT_IRQ_ENABLE == IrqAction) { - pDev->GMboxInfo.CreditCountIRQEnabled = TRUE; - pDev->IrqEnableRegisters.counter_int_status_enable |= - COUNTER_INT_STATUS_ENABLE_BIT_SET(1 << AR6K_GMBOX_CREDIT_COUNTER); - pDev->IrqEnableRegisters.int_status_enable |= INT_STATUS_ENABLE_COUNTER_SET(0x01); - } else { - pDev->GMboxInfo.CreditCountIRQEnabled = FALSE; - pDev->IrqEnableRegisters.counter_int_status_enable &= - ~(COUNTER_INT_STATUS_ENABLE_BIT_SET(1 << AR6K_GMBOX_CREDIT_COUNTER)); - } - /* copy into our temp area */ - A_MEMCPY(®s,&pDev->IrqEnableRegisters,AR6K_IRQ_ENABLE_REGS_SIZE); - - UNLOCK_AR6K(pDev); - - do { - - if (AsyncMode) { - - pIOPacket = AR6KAllocIOPacket(pDev); - - if (NULL == pIOPacket) { - status = A_NO_MEMORY; - A_ASSERT(FALSE); - break; - } - - /* copy values to write to our async I/O buffer */ - A_MEMCPY(pIOPacket->pBuffer,&pDev->IrqEnableRegisters,AR6K_IRQ_ENABLE_REGS_SIZE); - - /* stick in our completion routine when the I/O operation completes */ - pIOPacket->Completion = DevGMboxIRQActionAsyncHandler; - pIOPacket->pContext = pDev; - pIOPacket->PktInfo.AsRx.HTCRxFlags = IrqAction; - /* write it out asynchronously */ - HIFReadWrite(pDev->HIFDevice, - INT_STATUS_ENABLE_ADDRESS, - pIOPacket->pBuffer, - AR6K_IRQ_ENABLE_REGS_SIZE, - HIF_WR_ASYNC_BYTE_INC, - pIOPacket); - - pIOPacket = NULL; - break; - } - - /* if we get here we are doing it synchronously */ - status = HIFReadWrite(pDev->HIFDevice, - INT_STATUS_ENABLE_ADDRESS, - ®s.int_status_enable, - AR6K_IRQ_ENABLE_REGS_SIZE, - HIF_WR_SYNC_BYTE_INC, - NULL); - } while (FALSE); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - (" IRQAction Operation (%d) failed! status:%d \n", IrqAction, status)); - } else { - if (!AsyncMode) { - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, - (" IRQAction Operation (%d) success \n", IrqAction)); - } - } - - if (pIOPacket != NULL) { - AR6KFreeIOPacket(pDev,pIOPacket); - } - - return status; -} - - -A_STATUS DevGMboxIRQAction(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION_TYPE IrqAction, A_BOOL AsyncMode) -{ - A_STATUS status = A_OK; - HTC_PACKET *pIOPacket = NULL; - A_UINT8 GMboxIntControl[4]; - - if (GMBOX_CREDIT_IRQ_ENABLE == IrqAction) { - return DevGMboxCounterEnableDisable(pDev, GMBOX_CREDIT_IRQ_ENABLE, AsyncMode); - } else if(GMBOX_CREDIT_IRQ_DISABLE == IrqAction) { - return DevGMboxCounterEnableDisable(pDev, GMBOX_CREDIT_IRQ_DISABLE, AsyncMode); - } - - if (GMBOX_DISABLE_ALL == IrqAction) { - /* disable credit IRQ, those are on a different set of registers */ - DevGMboxCounterEnableDisable(pDev, GMBOX_CREDIT_IRQ_DISABLE, AsyncMode); - } - - /* take the lock to protect interrupt enable shadows */ - LOCK_AR6K(pDev); - - switch (IrqAction) { - - case GMBOX_DISABLE_ALL: - pDev->GMboxControlRegisters.int_status_enable = 0; - break; - case GMBOX_ERRORS_IRQ_ENABLE: - pDev->GMboxControlRegisters.int_status_enable |= GMBOX_INT_STATUS_TX_OVERFLOW | - GMBOX_INT_STATUS_RX_OVERFLOW; - break; - case GMBOX_RECV_IRQ_ENABLE: - pDev->GMboxControlRegisters.int_status_enable |= GMBOX_INT_STATUS_RX_DATA; - break; - case GMBOX_RECV_IRQ_DISABLE: - pDev->GMboxControlRegisters.int_status_enable &= ~GMBOX_INT_STATUS_RX_DATA; - break; - case GMBOX_ACTION_NONE: - default: - A_ASSERT(FALSE); - break; - } - - GMboxIntControl[0] = pDev->GMboxControlRegisters.int_status_enable; - GMboxIntControl[1] = GMboxIntControl[0]; - GMboxIntControl[2] = GMboxIntControl[0]; - GMboxIntControl[3] = GMboxIntControl[0]; - - UNLOCK_AR6K(pDev); - - do { - - if (AsyncMode) { - - pIOPacket = AR6KAllocIOPacket(pDev); - - if (NULL == pIOPacket) { - status = A_NO_MEMORY; - A_ASSERT(FALSE); - break; - } - - /* copy values to write to our async I/O buffer */ - A_MEMCPY(pIOPacket->pBuffer,GMboxIntControl,sizeof(GMboxIntControl)); - - /* stick in our completion routine when the I/O operation completes */ - pIOPacket->Completion = DevGMboxIRQActionAsyncHandler; - pIOPacket->pContext = pDev; - pIOPacket->PktInfo.AsRx.HTCRxFlags = IrqAction; - /* write it out asynchronously */ - HIFReadWrite(pDev->HIFDevice, - GMBOX_INT_STATUS_ENABLE_REG, - pIOPacket->pBuffer, - sizeof(GMboxIntControl), - HIF_WR_ASYNC_BYTE_FIX, - pIOPacket); - pIOPacket = NULL; - break; - } - - /* if we get here we are doing it synchronously */ - - status = HIFReadWrite(pDev->HIFDevice, - GMBOX_INT_STATUS_ENABLE_REG, - GMboxIntControl, - sizeof(GMboxIntControl), - HIF_WR_SYNC_BYTE_FIX, - NULL); - - } while (FALSE); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - (" IRQAction Operation (%d) failed! status:%d \n", IrqAction, status)); - } else { - if (!AsyncMode) { - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, - (" IRQAction Operation (%d) success \n", IrqAction)); - } - } - - if (pIOPacket != NULL) { - AR6KFreeIOPacket(pDev,pIOPacket); - } - - return status; -} - -void DevCleanupGMbox(AR6K_DEVICE *pDev) -{ - if (pDev->GMboxEnabled) { - pDev->GMboxEnabled = FALSE; - GMboxProtocolUninstall(pDev); - } -} - -A_STATUS DevSetupGMbox(AR6K_DEVICE *pDev) -{ - A_STATUS status = A_OK; - A_UINT8 muxControl[4]; - - do { - - if (0 == pDev->MailBoxInfo.GMboxAddress) { - break; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,(" GMBOX Advertised: Address:0x%X , size:%d \n", - pDev->MailBoxInfo.GMboxAddress, pDev->MailBoxInfo.GMboxSize)); - - status = DevGMboxIRQAction(pDev, GMBOX_DISABLE_ALL, PROC_IO_SYNC); - - if (A_FAILED(status)) { - break; - } - - /* write to mailbox look ahead mux control register, we want the - * GMBOX lookaheads to appear on lookaheads 2 and 3 - * the register is 1-byte wide so we need to hit it 4 times to align the operation - * to 4-bytes */ - muxControl[0] = GMBOX_LA_MUX_OVERRIDE_2_3; - muxControl[1] = GMBOX_LA_MUX_OVERRIDE_2_3; - muxControl[2] = GMBOX_LA_MUX_OVERRIDE_2_3; - muxControl[3] = GMBOX_LA_MUX_OVERRIDE_2_3; - - status = HIFReadWrite(pDev->HIFDevice, - GMBOX_LOOKAHEAD_MUX_REG, - muxControl, - sizeof(muxControl), - HIF_WR_SYNC_BYTE_FIX, /* hit this register 4 times */ - NULL); - - if (A_FAILED(status)) { - break; - } - - status = GMboxProtocolInstall(pDev); - - if (A_FAILED(status)) { - break; - } - - pDev->GMboxEnabled = TRUE; - - } while (FALSE); - - return status; -} - -A_STATUS DevCheckGMboxInterrupts(AR6K_DEVICE *pDev) -{ - A_STATUS status = A_OK; - A_UINT8 counter_int_status; - int credits; - A_UINT8 host_int_status2; - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("+DevCheckGMboxInterrupts \n")); - - /* the caller guarantees that this is a context that allows for blocking I/O */ - - do { - - host_int_status2 = pDev->IrqProcRegisters.host_int_status2 & - pDev->GMboxControlRegisters.int_status_enable; - - if (host_int_status2 & GMBOX_INT_STATUS_TX_OVERFLOW) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("GMBOX : TX Overflow \n")); - status = A_ECOMM; - } - - if (host_int_status2 & GMBOX_INT_STATUS_RX_OVERFLOW) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("GMBOX : RX Overflow \n")); - status = A_ECOMM; - } - - if (A_FAILED(status)) { - if (pDev->GMboxInfo.pTargetFailureCallback != NULL) { - pDev->GMboxInfo.pTargetFailureCallback(pDev->GMboxInfo.pProtocolContext, status); - } - break; - } - - if (host_int_status2 & GMBOX_INT_STATUS_RX_DATA) { - if (pDev->IrqProcRegisters.gmbox_rx_avail > 0) { - A_ASSERT(pDev->GMboxInfo.pMessagePendingCallBack != NULL); - status = pDev->GMboxInfo.pMessagePendingCallBack( - pDev->GMboxInfo.pProtocolContext, - (A_UINT8 *)&pDev->IrqProcRegisters.rx_gmbox_lookahead_alias[0], - pDev->IrqProcRegisters.gmbox_rx_avail); - } - } - - if (A_FAILED(status)) { - break; - } - - counter_int_status = pDev->IrqProcRegisters.counter_int_status & - pDev->IrqEnableRegisters.counter_int_status_enable; - - /* check if credit interrupt is pending */ - if (counter_int_status & (COUNTER_INT_STATUS_ENABLE_BIT_SET(1 << AR6K_GMBOX_CREDIT_COUNTER))) { - - /* do synchronous read */ - status = DevGMboxReadCreditCounter(pDev, PROC_IO_SYNC, &credits); - - if (A_FAILED(status)) { - break; - } - - A_ASSERT(pDev->GMboxInfo.pCreditsPendingCallback != NULL); - status = pDev->GMboxInfo.pCreditsPendingCallback(pDev->GMboxInfo.pProtocolContext, - credits, - pDev->GMboxInfo.CreditCountIRQEnabled); - } - - } while (FALSE); - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("-DevCheckGMboxInterrupts (%d) \n",status)); - - return status; -} - - -A_STATUS DevGMboxWrite(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 WriteLength) -{ - A_UINT32 paddedLength; - A_BOOL sync = (pPacket->Completion == NULL) ? TRUE : FALSE; - A_STATUS status; - A_UINT32 address; - - /* adjust the length to be a multiple of block size if appropriate */ - paddedLength = DEV_CALC_SEND_PADDED_LEN(pDev, WriteLength); - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, - ("DevGMboxWrite, Padded Length: %d Mbox:0x%X (mode:%s)\n", - WriteLength, - pDev->MailBoxInfo.GMboxAddress, - sync ? "SYNC" : "ASYNC")); - - /* last byte of packet has to hit the EOM marker */ - address = pDev->MailBoxInfo.GMboxAddress + pDev->MailBoxInfo.GMboxSize - paddedLength; - - status = HIFReadWrite(pDev->HIFDevice, - address, - pPacket->pBuffer, - paddedLength, /* the padded length */ - sync ? HIF_WR_SYNC_BLOCK_INC : HIF_WR_ASYNC_BLOCK_INC, - sync ? NULL : pPacket); /* pass the packet as the context to the HIF request */ - - if (sync) { - pPacket->Status = status; - } else { - if (status == A_PENDING) { - status = A_OK; - } - } - - return status; -} - -A_STATUS DevGMboxRead(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 ReadLength) -{ - - A_UINT32 paddedLength; - A_STATUS status; - A_BOOL sync = (pPacket->Completion == NULL) ? TRUE : FALSE; - - /* adjust the length to be a multiple of block size if appropriate */ - paddedLength = DEV_CALC_RECV_PADDED_LEN(pDev, ReadLength); - - if (paddedLength > pPacket->BufferLength) { - A_ASSERT(FALSE); - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("DevGMboxRead, Not enough space for padlen:%d recvlen:%d bufferlen:%d \n", - paddedLength,ReadLength,pPacket->BufferLength)); - if (pPacket->Completion != NULL) { - COMPLETE_HTC_PACKET(pPacket,A_EINVAL); - return A_OK; - } - return A_EINVAL; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, - ("DevGMboxRead (0x%lX : hdr:0x%X) Padded Length: %d Mbox:0x%X (mode:%s)\n", - (unsigned long)pPacket, pPacket->PktInfo.AsRx.ExpectedHdr, - paddedLength, - pDev->MailBoxInfo.GMboxAddress, - sync ? "SYNC" : "ASYNC")); - - status = HIFReadWrite(pDev->HIFDevice, - pDev->MailBoxInfo.GMboxAddress, - pPacket->pBuffer, - paddedLength, - sync ? HIF_RD_SYNC_BLOCK_FIX : HIF_RD_ASYNC_BLOCK_FIX, - sync ? NULL : pPacket); /* pass the packet as the context to the HIF request */ - - if (sync) { - pPacket->Status = status; - } - - return status; -} - - -static int ProcessCreditCounterReadBuffer(A_UINT8 *pBuffer, int Length) -{ - int credits = 0; - - /* theory of how this works: - * We read the credit decrement register multiple times on a byte-wide basis. - * The number of times (32) aligns the I/O operation to be a multiple of 4 bytes and provides a - * reasonable chance to acquire "all" pending credits in a single I/O operation. - * - * Once we obtain the filled buffer, we can walk through it looking for credit decrement transitions. - * Each non-zero byte represents a single credit decrement (which is a credit given back to the host) - * For example if the target provides 3 credits and added 4 more during the 32-byte read operation the following - * pattern "could" appear: - * - * 0x3 0x2 0x1 0x0 0x0 0x0 0x0 0x0 0x1 0x0 0x1 0x0 0x1 0x0 0x1 0x0 ......rest zeros - * <---------> <-----------------------------> - * \_ credits aleady there \_ target adding 4 more credits - * - * The total available credits would be 7, since there are 7 non-zero bytes in the buffer. - * - * */ - - if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_RECV)) { - DebugDumpBytes(pBuffer, Length, "GMBOX Credit read buffer"); - } - - while (Length) { - if (*pBuffer != 0) { - credits++; - } - Length--; - pBuffer++; - } - - return credits; -} - - -/* callback when our fetch to enable/disable completes */ -static void DevGMboxReadCreditsAsyncHandler(void *Context, HTC_PACKET *pPacket) -{ - AR6K_DEVICE *pDev = (AR6K_DEVICE *)Context; - - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevGMboxReadCreditsAsyncHandler: (dev: 0x%lX)\n", (unsigned long)pDev)); - - if (A_FAILED(pPacket->Status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("Read Credit Operation failed! status:%d \n", pPacket->Status)); - } else { - int credits = 0; - credits = ProcessCreditCounterReadBuffer(pPacket->pBuffer, AR6K_REG_IO_BUFFER_SIZE); - pDev->GMboxInfo.pCreditsPendingCallback(pDev->GMboxInfo.pProtocolContext, - credits, - pDev->GMboxInfo.CreditCountIRQEnabled); - - - } - /* free this IO packet */ - AR6KFreeIOPacket(pDev,pPacket); - AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevGMboxReadCreditsAsyncHandler \n")); -} - -A_STATUS DevGMboxReadCreditCounter(AR6K_DEVICE *pDev, A_BOOL AsyncMode, int *pCredits) -{ - A_STATUS status = A_OK; - HTC_PACKET *pIOPacket = NULL; - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("+DevGMboxReadCreditCounter (%s) \n", AsyncMode ? "ASYNC" : "SYNC")); - - do { - - pIOPacket = AR6KAllocIOPacket(pDev); - - if (NULL == pIOPacket) { - status = A_NO_MEMORY; - A_ASSERT(FALSE); - break; - } - - A_MEMZERO(pIOPacket->pBuffer,AR6K_REG_IO_BUFFER_SIZE); - - if (AsyncMode) { - /* stick in our completion routine when the I/O operation completes */ - pIOPacket->Completion = DevGMboxReadCreditsAsyncHandler; - pIOPacket->pContext = pDev; - /* read registers asynchronously */ - HIFReadWrite(pDev->HIFDevice, - AR6K_GMBOX_CREDIT_DEC_ADDRESS, - pIOPacket->pBuffer, - AR6K_REG_IO_BUFFER_SIZE, /* hit the register multiple times */ - HIF_RD_ASYNC_BYTE_FIX, - pIOPacket); - pIOPacket = NULL; - break; - } - - pIOPacket->Completion = NULL; - /* if we get here we are doing it synchronously */ - status = HIFReadWrite(pDev->HIFDevice, - AR6K_GMBOX_CREDIT_DEC_ADDRESS, - pIOPacket->pBuffer, - AR6K_REG_IO_BUFFER_SIZE, - HIF_RD_SYNC_BYTE_FIX, - NULL); - } while (FALSE); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - (" DevGMboxReadCreditCounter failed! status:%d \n", status)); - } - - if (pIOPacket != NULL) { - if (A_SUCCESS(status)) { - /* sync mode processing */ - *pCredits = ProcessCreditCounterReadBuffer(pIOPacket->pBuffer, AR6K_REG_IO_BUFFER_SIZE); - } - AR6KFreeIOPacket(pDev,pIOPacket); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("-DevGMboxReadCreditCounter (%s) (%d) \n", - AsyncMode ? "ASYNC" : "SYNC", status)); - - return status; -} - -A_STATUS DevGMboxReadCreditSize(AR6K_DEVICE *pDev, int *pCreditSize) -{ - A_STATUS status; - A_UINT8 buffer[4]; - - status = HIFReadWrite(pDev->HIFDevice, - AR6K_GMBOX_CREDIT_SIZE_ADDRESS, - buffer, - sizeof(buffer), - HIF_RD_SYNC_BYTE_FIX, /* hit the register 4 times to align the I/O */ - NULL); - - if (A_SUCCESS(status)) { - if (buffer[0] == 0) { - *pCreditSize = 256; - } else { - *pCreditSize = buffer[0]; - } - - } - - return status; -} - -void DevNotifyGMboxTargetFailure(AR6K_DEVICE *pDev) -{ - /* Target ASSERTED!!! */ - if (pDev->GMboxInfo.pTargetFailureCallback != NULL) { - pDev->GMboxInfo.pTargetFailureCallback(pDev->GMboxInfo.pProtocolContext, A_HARDWARE); - } -} - -A_STATUS DevGMboxRecvLookAheadPeek(AR6K_DEVICE *pDev, A_UINT8 *pLookAheadBuffer, int *pLookAheadBytes) -{ - - A_STATUS status = A_OK; - AR6K_IRQ_PROC_REGISTERS procRegs; - int maxCopy; - - do { - /* on entry the caller provides the length of the lookahead buffer */ - if (*pLookAheadBytes > sizeof(procRegs.rx_gmbox_lookahead_alias)) { - A_ASSERT(FALSE); - status = A_EINVAL; - break; - } - - maxCopy = *pLookAheadBytes; - *pLookAheadBytes = 0; - /* load the register table from the device */ - status = HIFReadWrite(pDev->HIFDevice, - HOST_INT_STATUS_ADDRESS, - (A_UINT8 *)&procRegs, - AR6K_IRQ_PROC_REGS_SIZE, - HIF_RD_SYNC_BYTE_INC, - NULL); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("DevGMboxRecvLookAheadPeek : Failed to read register table (%d) \n",status)); - break; - } - - if (procRegs.gmbox_rx_avail > 0) { - int bytes = procRegs.gmbox_rx_avail > maxCopy ? maxCopy : procRegs.gmbox_rx_avail; - A_MEMCPY(pLookAheadBuffer,&procRegs.rx_gmbox_lookahead_alias[0],bytes); - *pLookAheadBytes = bytes; - } - - } while (FALSE); - - return status; -} - -A_STATUS DevGMboxSetTargetInterrupt(AR6K_DEVICE *pDev, int Signal, int AckTimeoutMS) -{ - A_STATUS status = A_OK; - int i; - A_UINT8 buffer[4]; - - A_MEMZERO(buffer, sizeof(buffer)); - - do { - - if (Signal >= MBOX_SIG_HCI_BRIDGE_MAX) { - status = A_EINVAL; - break; - } - - /* set the last buffer to do the actual signal trigger */ - buffer[3] = (1 << Signal); - - status = HIFReadWrite(pDev->HIFDevice, - INT_WLAN_ADDRESS, - buffer, - sizeof(buffer), - HIF_WR_SYNC_BYTE_FIX, /* hit the register 4 times to align the I/O */ - NULL); - - if (A_FAILED(status)) { - break; - } - - } while (FALSE); - - - if (A_SUCCESS(status)) { - /* now read back the register to see if the bit cleared */ - while (AckTimeoutMS) { - status = HIFReadWrite(pDev->HIFDevice, - INT_WLAN_ADDRESS, - buffer, - sizeof(buffer), - HIF_RD_SYNC_BYTE_FIX, - NULL); - - if (A_FAILED(status)) { - break; - } - - for (i = 0; i < sizeof(buffer); i++) { - if (buffer[i] & (1 << Signal)) { - /* bit is still set */ - break; - } - } - - if (i >= sizeof(buffer)) { - /* done */ - break; - } - - AckTimeoutMS--; - A_MDELAY(1); - } - - if (0 == AckTimeoutMS) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("DevGMboxSetTargetInterrupt : Ack Timed-out (sig:%d) \n",Signal)); - status = A_ERROR; - } - } - - return status; - -} - -#endif //ATH_AR6K_ENABLE_GMBOX - - - - diff --git a/drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k_gmbox_hciuart.c b/drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k_gmbox_hciuart.c deleted file mode 100644 index c840fef07612..000000000000 --- a/drivers/net/wireless/ar6003/host/htc2/AR6000/ar6k_gmbox_hciuart.c +++ /dev/null @@ -1,1289 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Protocol module for use in bridging HCI-UART packets over the GMBOX interface -// -// Author(s): ="Atheros" -//============================================================================== - -#include "a_config.h" -#include "athdefs.h" -#include "a_types.h" -#include "a_osapi.h" -#include "../htc_debug.h" -#include "hif.h" -#include "htc_packet.h" -#include "ar6k.h" -#include "hci_transport_api.h" -#include "gmboxif.h" -#include "ar6000_diag.h" -#include "hw/apb_map.h" -#include "hw/mbox_reg.h" - -#ifdef ATH_AR6K_ENABLE_GMBOX -#define HCI_UART_COMMAND_PKT 0x01 -#define HCI_UART_ACL_PKT 0x02 -#define HCI_UART_SCO_PKT 0x03 -#define HCI_UART_EVENT_PKT 0x04 - -#define HCI_RECV_WAIT_BUFFERS (1 << 0) - -#define HCI_SEND_WAIT_CREDITS (1 << 0) - -#define HCI_UART_BRIDGE_CREDIT_SIZE 128 - -#define CREDIT_POLL_COUNT 256 - -#define HCI_DELAY_PER_INTERVAL_MS 10 -#define BTON_TIMEOUT_MS 500 -#define BTOFF_TIMEOUT_MS 500 -#define BAUD_TIMEOUT_MS 1 -#define BTPWRSAV_TIMEOUT_MS 1 - -typedef struct { - HCI_TRANSPORT_CONFIG_INFO HCIConfig; - A_BOOL HCIAttached; - A_BOOL HCIStopped; - A_UINT32 RecvStateFlags; - A_UINT32 SendStateFlags; - HCI_TRANSPORT_PACKET_TYPE WaitBufferType; - HTC_PACKET_QUEUE SendQueue; /* write queue holding HCI Command and ACL packets */ - HTC_PACKET_QUEUE HCIACLRecvBuffers; /* recv queue holding buffers for incomming ACL packets */ - HTC_PACKET_QUEUE HCIEventBuffers; /* recv queue holding buffers for incomming event packets */ - AR6K_DEVICE *pDev; - A_MUTEX_T HCIRxLock; - A_MUTEX_T HCITxLock; - int CreditsMax; - int CreditsConsumed; - int CreditsAvailable; - int CreditSize; - int CreditsCurrentSeek; - int SendProcessCount; -} GMBOX_PROTO_HCI_UART; - -#define LOCK_HCI_RX(t) A_MUTEX_LOCK(&(t)->HCIRxLock); -#define UNLOCK_HCI_RX(t) A_MUTEX_UNLOCK(&(t)->HCIRxLock); -#define LOCK_HCI_TX(t) A_MUTEX_LOCK(&(t)->HCITxLock); -#define UNLOCK_HCI_TX(t) A_MUTEX_UNLOCK(&(t)->HCITxLock); - -#define DO_HCI_RECV_INDICATION(p,pt) \ -{ AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("HCI: Indicate Recv on packet:0x%lX status:%d len:%d type:%d \n", \ - (unsigned long)(pt),(pt)->Status, A_SUCCESS((pt)->Status) ? (pt)->ActualLength : 0, HCI_GET_PACKET_TYPE(pt))); \ - (p)->HCIConfig.pHCIPktRecv((p)->HCIConfig.pContext, (pt)); \ -} - -#define DO_HCI_SEND_INDICATION(p,pt) \ -{ AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("HCI: Indicate Send on packet:0x%lX status:%d type:%d \n", \ - (unsigned long)(pt),(pt)->Status,HCI_GET_PACKET_TYPE(pt))); \ - (p)->HCIConfig.pHCISendComplete((p)->HCIConfig.pContext, (pt)); \ -} - -static A_STATUS HCITrySend(GMBOX_PROTO_HCI_UART *pProt, HTC_PACKET *pPacket, A_BOOL Synchronous); - -static void HCIUartCleanup(GMBOX_PROTO_HCI_UART *pProtocol) -{ - A_ASSERT(pProtocol != NULL); - - A_MUTEX_DELETE(&pProtocol->HCIRxLock); - A_MUTEX_DELETE(&pProtocol->HCITxLock); - - A_FREE(pProtocol); -} - -static A_STATUS InitTxCreditState(GMBOX_PROTO_HCI_UART *pProt) -{ - A_STATUS status; - int credits; - int creditPollCount = CREDIT_POLL_COUNT; - A_BOOL gotCredits = FALSE; - - pProt->CreditsConsumed = 0; - - do { - - if (pProt->CreditsMax != 0) { - /* we can only call this only once per target reset */ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("HCI: InitTxCreditState - already called! \n")); - A_ASSERT(FALSE); - status = A_EINVAL; - break; - } - - /* read the credit counter. At startup the target will set the credit counter - * to the max available, we read this in a loop because it may take - * multiple credit counter reads to get all credits */ - - while (creditPollCount) { - - credits = 0; - - status = DevGMboxReadCreditCounter(pProt->pDev, PROC_IO_SYNC, &credits); - - if (A_FAILED(status)) { - break; - } - - if (!gotCredits && (0 == credits)) { - creditPollCount--; - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("HCI: credit is 0, retrying (%d) \n",creditPollCount)); - A_MDELAY(HCI_DELAY_PER_INTERVAL_MS); - continue; - } else { - gotCredits = TRUE; - } - - if (0 == credits) { - break; - } - - pProt->CreditsMax += credits; - } - - if (A_FAILED(status)) { - break; - } - - if (0 == creditPollCount) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("** HCI : Failed to get credits! GMBOX Target was not available \n")); - status = A_ERROR; - break; - } - - /* now get the size */ - status = DevGMboxReadCreditSize(pProt->pDev, &pProt->CreditSize); - - if (A_FAILED(status)) { - break; - } - - } while (FALSE); - - if (A_SUCCESS(status)) { - pProt->CreditsAvailable = pProt->CreditsMax; - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("HCI : InitTxCreditState - credits avail: %d, size: %d \n", - pProt->CreditsAvailable, pProt->CreditSize)); - } - - return status; -} - -static A_STATUS CreditsAvailableCallback(void *pContext, int Credits, A_BOOL CreditIRQEnabled) -{ - GMBOX_PROTO_HCI_UART *pProt = (GMBOX_PROTO_HCI_UART *)pContext; - A_BOOL enableCreditIrq = FALSE; - A_BOOL disableCreditIrq = FALSE; - A_BOOL doPendingSends = FALSE; - A_STATUS status = A_OK; - - /** this callback is called under 2 conditions: - * 1. The credit IRQ interrupt was enabled and signaled. - * 2. A credit counter read completed. - * - * The function must not assume that the calling context can block ! - */ - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+CreditsAvailableCallback (Credits:%d, IRQ:%s) \n", - Credits, CreditIRQEnabled ? "ON" : "OFF")); - - LOCK_HCI_TX(pProt); - - do { - - if (0 == Credits) { - if (!CreditIRQEnabled) { - /* enable credit IRQ */ - enableCreditIrq = TRUE; - } - break; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("HCI: current credit state, consumed:%d available:%d max:%d seek:%d\n", - pProt->CreditsConsumed, - pProt->CreditsAvailable, - pProt->CreditsMax, - pProt->CreditsCurrentSeek)); - - pProt->CreditsAvailable += Credits; - A_ASSERT(pProt->CreditsAvailable <= pProt->CreditsMax); - pProt->CreditsConsumed -= Credits; - A_ASSERT(pProt->CreditsConsumed >= 0); - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("HCI: new credit state, consumed:%d available:%d max:%d seek:%d\n", - pProt->CreditsConsumed, - pProt->CreditsAvailable, - pProt->CreditsMax, - pProt->CreditsCurrentSeek)); - - if (pProt->CreditsAvailable >= pProt->CreditsCurrentSeek) { - /* we have enough credits to fullfill at least 1 packet waiting in the queue */ - pProt->CreditsCurrentSeek = 0; - pProt->SendStateFlags &= ~HCI_SEND_WAIT_CREDITS; - doPendingSends = TRUE; - if (CreditIRQEnabled) { - /* credit IRQ was enabled, we shouldn't need it anymore */ - disableCreditIrq = TRUE; - } - } else { - /* not enough credits yet, enable credit IRQ if we haven't already */ - if (!CreditIRQEnabled) { - enableCreditIrq = TRUE; - } - } - - } while (FALSE); - - UNLOCK_HCI_TX(pProt); - - if (enableCreditIrq) { - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,(" Enabling credit count IRQ...\n")); - /* must use async only */ - status = DevGMboxIRQAction(pProt->pDev, GMBOX_CREDIT_IRQ_ENABLE, PROC_IO_ASYNC); - } else if (disableCreditIrq) { - /* must use async only */ - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,(" Disabling credit count IRQ...\n")); - status = DevGMboxIRQAction(pProt->pDev, GMBOX_CREDIT_IRQ_DISABLE, PROC_IO_ASYNC); - } - - if (doPendingSends) { - HCITrySend(pProt, NULL, FALSE); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+CreditsAvailableCallback \n")); - return status; -} - -static INLINE void NotifyTransportFailure(GMBOX_PROTO_HCI_UART *pProt, A_STATUS status) -{ - if (pProt->HCIConfig.TransportFailure != NULL) { - pProt->HCIConfig.TransportFailure(pProt->HCIConfig.pContext, status); - } -} - -static void FailureCallback(void *pContext, A_STATUS Status) -{ - GMBOX_PROTO_HCI_UART *pProt = (GMBOX_PROTO_HCI_UART *)pContext; - - /* target assertion occured */ - NotifyTransportFailure(pProt, Status); -} - -static void StateDumpCallback(void *pContext) -{ - GMBOX_PROTO_HCI_UART *pProt = (GMBOX_PROTO_HCI_UART *)pContext; - - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("============ HCIUart State ======================\n")); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("RecvStateFlags : 0x%X \n",pProt->RecvStateFlags)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("SendStateFlags : 0x%X \n",pProt->SendStateFlags)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("WaitBufferType : %d \n",pProt->WaitBufferType)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("SendQueue Depth : %d \n",HTC_PACKET_QUEUE_DEPTH(&pProt->SendQueue))); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("CreditsMax : %d \n",pProt->CreditsMax)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("CreditsConsumed : %d \n",pProt->CreditsConsumed)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("CreditsAvailable : %d \n",pProt->CreditsAvailable)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("==================================================\n")); -} - -static A_STATUS HCIUartMessagePending(void *pContext, A_UINT8 LookAheadBytes[], int ValidBytes) -{ - GMBOX_PROTO_HCI_UART *pProt = (GMBOX_PROTO_HCI_UART *)pContext; - A_STATUS status = A_OK; - int totalRecvLength = 0; - HCI_TRANSPORT_PACKET_TYPE pktType = HCI_PACKET_INVALID; - A_BOOL recvRefillCalled = FALSE; - A_BOOL blockRecv = FALSE; - HTC_PACKET *pPacket = NULL; - - /** caller guarantees that this is a fully block-able context (synch I/O is allowed) */ - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+HCIUartMessagePending Lookahead Bytes:%d \n",ValidBytes)); - - LOCK_HCI_RX(pProt); - - do { - - if (ValidBytes < 3) { - /* not enough for ACL or event header */ - break; - } - - if ((LookAheadBytes[0] == HCI_UART_ACL_PKT) && (ValidBytes < 5)) { - /* not enough for ACL data header */ - break; - } - - switch (LookAheadBytes[0]) { - case HCI_UART_EVENT_PKT: - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("HCI Event: %d param length: %d \n", - LookAheadBytes[1], LookAheadBytes[2])); - totalRecvLength = LookAheadBytes[2]; - totalRecvLength += 3; /* add type + event code + length field */ - pktType = HCI_EVENT_TYPE; - break; - case HCI_UART_ACL_PKT: - totalRecvLength = (LookAheadBytes[4] << 8) | LookAheadBytes[3]; - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("HCI ACL: conn:0x%X length: %d \n", - ((LookAheadBytes[2] & 0xF0) << 8) | LookAheadBytes[1], totalRecvLength)); - totalRecvLength += 5; /* add type + connection handle + length field */ - pktType = HCI_ACL_TYPE; - break; - default: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("**Invalid HCI packet type: %d \n",LookAheadBytes[0])); - status = A_EPROTO; - break; - } - - if (A_FAILED(status)) { - break; - } - - if (pProt->HCIConfig.pHCIPktRecvAlloc != NULL) { - UNLOCK_HCI_RX(pProt); - /* user is using a per-packet allocation callback */ - pPacket = pProt->HCIConfig.pHCIPktRecvAlloc(pProt->HCIConfig.pContext, - pktType, - totalRecvLength); - LOCK_HCI_RX(pProt); - - } else { - HTC_PACKET_QUEUE *pQueue; - /* user is using a refill handler that can refill multiple HTC buffers */ - - /* select buffer queue */ - if (pktType == HCI_ACL_TYPE) { - pQueue = &pProt->HCIACLRecvBuffers; - } else { - pQueue = &pProt->HCIEventBuffers; - } - - if (HTC_QUEUE_EMPTY(pQueue)) { - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, - ("** HCI pkt type: %d has no buffers available calling allocation handler \n", - pktType)); - /* check for refill handler */ - if (pProt->HCIConfig.pHCIPktRecvRefill != NULL) { - recvRefillCalled = TRUE; - UNLOCK_HCI_RX(pProt); - /* call the re-fill handler */ - pProt->HCIConfig.pHCIPktRecvRefill(pProt->HCIConfig.pContext, - pktType, - 0); - LOCK_HCI_RX(pProt); - /* check if we have more buffers */ - pPacket = HTC_PACKET_DEQUEUE(pQueue); - /* fall through */ - } - } else { - pPacket = HTC_PACKET_DEQUEUE(pQueue); - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, - ("HCI pkt type: %d now has %d recv buffers left \n", - pktType, HTC_PACKET_QUEUE_DEPTH(pQueue))); - } - } - - if (NULL == pPacket) { - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, - ("** HCI pkt type: %d has no buffers available stopping recv...\n", pktType)); - /* this is not an error, we simply need to mark that we are waiting for buffers.*/ - pProt->RecvStateFlags |= HCI_RECV_WAIT_BUFFERS; - pProt->WaitBufferType = pktType; - blockRecv = TRUE; - break; - } - - if (totalRecvLength > (int)pPacket->BufferLength) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("** HCI-UART pkt: %d requires %d bytes (%d buffer bytes avail) ! \n", - LookAheadBytes[0], totalRecvLength, pPacket->BufferLength)); - status = A_EINVAL; - break; - } - - } while (FALSE); - - UNLOCK_HCI_RX(pProt); - - /* locks are released, we can go fetch the packet */ - - do { - - if (A_FAILED(status) || (NULL == pPacket)) { - break; - } - - /* do this synchronously, we don't need to be fast here */ - pPacket->Completion = NULL; - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("HCI : getting recv packet len:%d hci-uart-type: %s \n", - totalRecvLength, (LookAheadBytes[0] == HCI_UART_EVENT_PKT) ? "EVENT" : "ACL")); - - status = DevGMboxRead(pProt->pDev, pPacket, totalRecvLength); - - if (A_FAILED(status)) { - break; - } - - if (pPacket->pBuffer[0] != LookAheadBytes[0]) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("** HCI buffer does not contain expected packet type: %d ! \n", - pPacket->pBuffer[0])); - status = A_EPROTO; - break; - } - - if (pPacket->pBuffer[0] == HCI_UART_EVENT_PKT) { - /* validate event header fields */ - if ((pPacket->pBuffer[1] != LookAheadBytes[1]) || - (pPacket->pBuffer[2] != LookAheadBytes[2])) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("** HCI buffer does not match lookahead! \n")); - DebugDumpBytes(LookAheadBytes, 3, "Expected HCI-UART Header"); - DebugDumpBytes(pPacket->pBuffer, 3, "** Bad HCI-UART Header"); - status = A_EPROTO; - break; - } - } else if (pPacket->pBuffer[0] == HCI_UART_ACL_PKT) { - /* validate acl header fields */ - if ((pPacket->pBuffer[1] != LookAheadBytes[1]) || - (pPacket->pBuffer[2] != LookAheadBytes[2]) || - (pPacket->pBuffer[3] != LookAheadBytes[3]) || - (pPacket->pBuffer[4] != LookAheadBytes[4])) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("** HCI buffer does not match lookahead! \n")); - DebugDumpBytes(LookAheadBytes, 5, "Expected HCI-UART Header"); - DebugDumpBytes(pPacket->pBuffer, 5, "** Bad HCI-UART Header"); - status = A_EPROTO; - break; - } - } - - /* adjust buffer to move past packet ID */ - pPacket->pBuffer++; - pPacket->ActualLength = totalRecvLength - 1; - pPacket->Status = A_OK; - /* indicate packet */ - DO_HCI_RECV_INDICATION(pProt,pPacket); - pPacket = NULL; - - /* check if we need to refill recv buffers */ - if ((pProt->HCIConfig.pHCIPktRecvRefill != NULL) && !recvRefillCalled) { - HTC_PACKET_QUEUE *pQueue; - int watermark; - - if (pktType == HCI_ACL_TYPE) { - watermark = pProt->HCIConfig.ACLRecvBufferWaterMark; - pQueue = &pProt->HCIACLRecvBuffers; - } else { - watermark = pProt->HCIConfig.EventRecvBufferWaterMark; - pQueue = &pProt->HCIEventBuffers; - } - - if (HTC_PACKET_QUEUE_DEPTH(pQueue) < watermark) { - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, - ("** HCI pkt type: %d watermark hit (%d) current:%d \n", - pktType, watermark, HTC_PACKET_QUEUE_DEPTH(pQueue))); - /* call the re-fill handler */ - pProt->HCIConfig.pHCIPktRecvRefill(pProt->HCIConfig.pContext, - pktType, - HTC_PACKET_QUEUE_DEPTH(pQueue)); - } - } - - } while (FALSE); - - /* check if we need to disable the reciever */ - if (A_FAILED(status) || blockRecv) { - DevGMboxIRQAction(pProt->pDev, GMBOX_RECV_IRQ_DISABLE, PROC_IO_SYNC); - } - - /* see if we need to recycle the recv buffer */ - if (A_FAILED(status) && (pPacket != NULL)) { - HTC_PACKET_QUEUE queue = { {0} }; - - if (A_EPROTO == status) { - DebugDumpBytes(pPacket->pBuffer, totalRecvLength, "Bad HCI-UART Recv packet"); - } - /* recycle packet */ - HTC_PACKET_RESET_RX(pPacket); - INIT_HTC_PACKET_QUEUE_AND_ADD(&queue,pPacket); - HCI_TransportAddReceivePkts(pProt,&queue); - NotifyTransportFailure(pProt,status); - } - - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("-HCIUartMessagePending \n")); - - return status; -} - -static void HCISendPacketCompletion(void *Context, HTC_PACKET *pPacket) -{ - GMBOX_PROTO_HCI_UART *pProt = (GMBOX_PROTO_HCI_UART *)Context; - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("+HCISendPacketCompletion (pPacket:0x%lX) \n",(unsigned long)pPacket)); - - if (A_FAILED(pPacket->Status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" Send Packet (0x%lX) failed: %d , len:%d \n", - (unsigned long)pPacket, pPacket->Status, pPacket->ActualLength)); - } - - DO_HCI_SEND_INDICATION(pProt,pPacket); - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("+HCISendPacketCompletion \n")); -} - -static A_STATUS SeekCreditsSynch(GMBOX_PROTO_HCI_UART *pProt) -{ - A_STATUS status = A_OK; - int credits; - int retry = 100; - - while (TRUE) { - credits = 0; - status = DevGMboxReadCreditCounter(pProt->pDev, PROC_IO_SYNC, &credits); - if (A_FAILED(status)) { - break; - } - LOCK_HCI_TX(pProt); - pProt->CreditsAvailable += credits; - pProt->CreditsConsumed -= credits; - if (pProt->CreditsAvailable >= pProt->CreditsCurrentSeek) { - pProt->CreditsCurrentSeek = 0; - UNLOCK_HCI_TX(pProt); - break; - } - UNLOCK_HCI_TX(pProt); - retry--; - if (0 == retry) { - status = A_EBUSY; - break; - } - A_MDELAY(20); - } - - return status; -} - -static A_STATUS HCITrySend(GMBOX_PROTO_HCI_UART *pProt, HTC_PACKET *pPacket, A_BOOL Synchronous) -{ - A_STATUS status = A_OK; - int transferLength; - int creditsRequired, remainder; - A_UINT8 hciUartType; - A_BOOL synchSendComplete = FALSE; - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("+HCITrySend (pPacket:0x%lX) %s \n",(unsigned long)pPacket, - Synchronous ? "SYNC" :"ASYNC")); - - LOCK_HCI_TX(pProt); - - /* increment write processing count on entry */ - pProt->SendProcessCount++; - - do { - - if (pProt->HCIStopped) { - status = A_ECANCELED; - break; - } - - if (pPacket != NULL) { - /* packet was supplied */ - if (Synchronous) { - /* in synchronous mode, the send queue can only hold 1 packet */ - if (!HTC_QUEUE_EMPTY(&pProt->SendQueue)) { - status = A_EBUSY; - A_ASSERT(FALSE); - break; - } - - if (pProt->SendProcessCount > 1) { - /* another thread or task is draining the TX queues */ - status = A_EBUSY; - A_ASSERT(FALSE); - break; - } - - HTC_PACKET_ENQUEUE(&pProt->SendQueue,pPacket); - - } else { - /* see if adding this packet hits the max depth (asynchronous mode only) */ - if ((pProt->HCIConfig.MaxSendQueueDepth > 0) && - ((HTC_PACKET_QUEUE_DEPTH(&pProt->SendQueue) + 1) >= pProt->HCIConfig.MaxSendQueueDepth)) { - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("HCI Send queue is full, Depth:%d, Max:%d \n", - HTC_PACKET_QUEUE_DEPTH(&pProt->SendQueue), - pProt->HCIConfig.MaxSendQueueDepth)); - /* queue will be full, invoke any callbacks to determine what action to take */ - if (pProt->HCIConfig.pHCISendFull != NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, - ("HCI : Calling driver's send full callback.... \n")); - if (pProt->HCIConfig.pHCISendFull(pProt->HCIConfig.pContext, - pPacket) == HCI_SEND_FULL_DROP) { - /* drop it */ - status = A_NO_RESOURCE; - break; - } - } - } - - HTC_PACKET_ENQUEUE(&pProt->SendQueue,pPacket); - } - - } - - if (pProt->SendStateFlags & HCI_SEND_WAIT_CREDITS) { - break; - } - - if (pProt->SendProcessCount > 1) { - /* another thread or task is draining the TX queues */ - break; - } - - /***** beyond this point only 1 thread may enter ******/ - - /* now drain the send queue for transmission as long as we have enough - * credits */ - while (!HTC_QUEUE_EMPTY(&pProt->SendQueue)) { - - pPacket = HTC_PACKET_DEQUEUE(&pProt->SendQueue); - - switch (HCI_GET_PACKET_TYPE(pPacket)) { - case HCI_COMMAND_TYPE: - hciUartType = HCI_UART_COMMAND_PKT; - break; - case HCI_ACL_TYPE: - hciUartType = HCI_UART_ACL_PKT; - break; - default: - status = A_EINVAL; - A_ASSERT(FALSE); - break; - } - - if (A_FAILED(status)) { - break; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("HCI: Got head packet:0x%lX , Type:%d Length: %d Remaining Queue Depth: %d\n", - (unsigned long)pPacket, HCI_GET_PACKET_TYPE(pPacket), pPacket->ActualLength, - HTC_PACKET_QUEUE_DEPTH(&pProt->SendQueue))); - - transferLength = 1; /* UART type header is 1 byte */ - transferLength += pPacket->ActualLength; - transferLength = DEV_CALC_SEND_PADDED_LEN(pProt->pDev, transferLength); - - /* figure out how many credits this message requires */ - creditsRequired = transferLength / pProt->CreditSize; - remainder = transferLength % pProt->CreditSize; - - if (remainder) { - creditsRequired++; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("HCI: Creds Required:%d Got:%d\n", - creditsRequired, pProt->CreditsAvailable)); - - if (creditsRequired > pProt->CreditsAvailable) { - if (Synchronous) { - /* in synchronous mode we need to seek credits in synchronously */ - pProt->CreditsCurrentSeek = creditsRequired; - UNLOCK_HCI_TX(pProt); - status = SeekCreditsSynch(pProt); - LOCK_HCI_TX(pProt); - if (A_FAILED(status)) { - break; - } - /* fall through and continue processing this send op */ - } else { - /* not enough credits, queue back to the head */ - HTC_PACKET_ENQUEUE_TO_HEAD(&pProt->SendQueue,pPacket); - /* waiting for credits */ - pProt->SendStateFlags |= HCI_SEND_WAIT_CREDITS; - /* provide a hint to reduce attempts to re-send if credits are dribbling back - * this hint is the short fall of credits */ - pProt->CreditsCurrentSeek = creditsRequired; - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("HCI: packet:0x%lX placed back in queue. head packet needs: %d credits \n", - (unsigned long)pPacket, pProt->CreditsCurrentSeek)); - pPacket = NULL; - UNLOCK_HCI_TX(pProt); - - /* schedule a credit counter read, our CreditsAvailableCallback callback will be called - * with the result */ - DevGMboxReadCreditCounter(pProt->pDev, PROC_IO_ASYNC, NULL); - - LOCK_HCI_TX(pProt); - break; - } - } - - /* caller guarantees some head room */ - pPacket->pBuffer--; - pPacket->pBuffer[0] = hciUartType; - - pProt->CreditsAvailable -= creditsRequired; - pProt->CreditsConsumed += creditsRequired; - A_ASSERT(pProt->CreditsConsumed <= pProt->CreditsMax); - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("HCI: new credit state: consumed:%d available:%d max:%d\n", - pProt->CreditsConsumed, pProt->CreditsAvailable, pProt->CreditsMax)); - - UNLOCK_HCI_TX(pProt); - - /* write it out */ - if (Synchronous) { - pPacket->Completion = NULL; - pPacket->pContext = NULL; - } else { - pPacket->Completion = HCISendPacketCompletion; - pPacket->pContext = pProt; - } - - status = DevGMboxWrite(pProt->pDev,pPacket,transferLength); - if (Synchronous) { - synchSendComplete = TRUE; - } else { - pPacket = NULL; - } - - LOCK_HCI_TX(pProt); - - } - - } while (FALSE); - - pProt->SendProcessCount--; - A_ASSERT(pProt->SendProcessCount >= 0); - UNLOCK_HCI_TX(pProt); - - if (Synchronous) { - A_ASSERT(pPacket != NULL); - if (A_SUCCESS(status) && (!synchSendComplete)) { - status = A_EBUSY; - A_ASSERT(FALSE); - LOCK_HCI_TX(pProt); - - if (pPacket) - { - if (pPacket->ListLink.pNext != NULL) { - /* remove from the queue */ - HTC_PACKET_REMOVE(&pProt->SendQueue,pPacket); - } - } - UNLOCK_HCI_TX(pProt); - } - } else { - if (A_FAILED(status) && (pPacket != NULL)) { - pPacket->Status = status; - DO_HCI_SEND_INDICATION(pProt,pPacket); - } - } - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("-HCITrySend: \n")); - return status; -} - -static void FlushSendQueue(GMBOX_PROTO_HCI_UART *pProt) -{ - HTC_PACKET *pPacket; - HTC_PACKET_QUEUE discardQueue = { {0} }; - - INIT_HTC_PACKET_QUEUE(&discardQueue); - - LOCK_HCI_TX(pProt); - - if (!HTC_QUEUE_EMPTY(&pProt->SendQueue)) { - HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(&discardQueue,&pProt->SendQueue); - } - - UNLOCK_HCI_TX(pProt); - - /* discard packets */ - while (!HTC_QUEUE_EMPTY(&discardQueue)) { - pPacket = HTC_PACKET_DEQUEUE(&discardQueue); - pPacket->Status = A_ECANCELED; - DO_HCI_SEND_INDICATION(pProt,pPacket); - } - -} - -static void FlushRecvBuffers(GMBOX_PROTO_HCI_UART *pProt) -{ - HTC_PACKET_QUEUE discardQueue = { {0} }; - HTC_PACKET *pPacket; - - INIT_HTC_PACKET_QUEUE(&discardQueue); - - LOCK_HCI_RX(pProt); - /*transfer list items from ACL and event buffer queues to the discard queue */ - if (!HTC_QUEUE_EMPTY(&pProt->HCIACLRecvBuffers)) { - HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(&discardQueue,&pProt->HCIACLRecvBuffers); - } - if (!HTC_QUEUE_EMPTY(&pProt->HCIEventBuffers)) { - HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(&discardQueue,&pProt->HCIEventBuffers); - } - UNLOCK_HCI_RX(pProt); - - /* now empty the discard queue */ - while (!HTC_QUEUE_EMPTY(&discardQueue)) { - pPacket = HTC_PACKET_DEQUEUE(&discardQueue); - pPacket->Status = A_ECANCELED; - DO_HCI_RECV_INDICATION(pProt,pPacket); - } - -} - -/*** protocol module install entry point ***/ - -A_STATUS GMboxProtocolInstall(AR6K_DEVICE *pDev) -{ - A_STATUS status = A_OK; - GMBOX_PROTO_HCI_UART *pProtocol = NULL; - - do { - - pProtocol = A_MALLOC(sizeof(GMBOX_PROTO_HCI_UART)); - - if (NULL == pProtocol) { - status = A_NO_MEMORY; - break; - } - - A_MEMZERO(pProtocol, sizeof(*pProtocol)); - pProtocol->pDev = pDev; - INIT_HTC_PACKET_QUEUE(&pProtocol->SendQueue); - INIT_HTC_PACKET_QUEUE(&pProtocol->HCIACLRecvBuffers); - INIT_HTC_PACKET_QUEUE(&pProtocol->HCIEventBuffers); - A_MUTEX_INIT(&pProtocol->HCIRxLock); - A_MUTEX_INIT(&pProtocol->HCITxLock); - - } while (FALSE); - - if (A_SUCCESS(status)) { - LOCK_AR6K(pDev); - DEV_GMBOX_SET_PROTOCOL(pDev, - HCIUartMessagePending, - CreditsAvailableCallback, - FailureCallback, - StateDumpCallback, - pProtocol); - UNLOCK_AR6K(pDev); - } else { - if (pProtocol != NULL) { - HCIUartCleanup(pProtocol); - } - } - - return status; -} - -/*** protocol module uninstall entry point ***/ -void GMboxProtocolUninstall(AR6K_DEVICE *pDev) -{ - GMBOX_PROTO_HCI_UART *pProtocol = (GMBOX_PROTO_HCI_UART *)DEV_GMBOX_GET_PROTOCOL(pDev); - - if (pProtocol != NULL) { - - /* notify anyone attached */ - if (pProtocol->HCIAttached) { - A_ASSERT(pProtocol->HCIConfig.TransportRemoved != NULL); - pProtocol->HCIConfig.TransportRemoved(pProtocol->HCIConfig.pContext); - pProtocol->HCIAttached = FALSE; - } - - HCIUartCleanup(pProtocol); - DEV_GMBOX_SET_PROTOCOL(pDev,NULL,NULL,NULL,NULL,NULL); - } - -} - -static A_STATUS NotifyTransportReady(GMBOX_PROTO_HCI_UART *pProt) -{ - HCI_TRANSPORT_PROPERTIES props; - A_STATUS status = A_OK; - - do { - - A_MEMZERO(&props,sizeof(props)); - - /* HCI UART only needs one extra byte at the head to indicate the packet TYPE */ - props.HeadRoom = 1; - props.TailRoom = 0; - props.IOBlockPad = pProt->pDev->BlockSize; - if (pProt->HCIAttached) { - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("HCI: notifying attached client to transport... \n")); - A_ASSERT(pProt->HCIConfig.TransportReady != NULL); - status = pProt->HCIConfig.TransportReady(pProt, - &props, - pProt->HCIConfig.pContext); - } - - } while (FALSE); - - return status; -} - -/*********** HCI UART protocol implementation ************************************************/ - -HCI_TRANSPORT_HANDLE HCI_TransportAttach(void *HTCHandle, HCI_TRANSPORT_CONFIG_INFO *pInfo) -{ - GMBOX_PROTO_HCI_UART *pProtocol = NULL; - AR6K_DEVICE *pDev; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("+HCI_TransportAttach \n")); - - pDev = HTCGetAR6KDevice(HTCHandle); - - LOCK_AR6K(pDev); - - do { - - pProtocol = (GMBOX_PROTO_HCI_UART *)DEV_GMBOX_GET_PROTOCOL(pDev); - - if (NULL == pProtocol) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("GMBOX protocol not installed! \n")); - break; - } - - if (pProtocol->HCIAttached) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("GMBOX protocol already attached! \n")); - break; - } - - A_MEMCPY(&pProtocol->HCIConfig, pInfo, sizeof(HCI_TRANSPORT_CONFIG_INFO)); - - A_ASSERT(pProtocol->HCIConfig.pHCIPktRecv != NULL); - A_ASSERT(pProtocol->HCIConfig.pHCISendComplete != NULL); - - pProtocol->HCIAttached = TRUE; - - } while (FALSE); - - UNLOCK_AR6K(pDev); - - if (pProtocol != NULL) { - /* TODO ... should we use a worker? */ - NotifyTransportReady(pProtocol); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("-HCI_TransportAttach (0x%lX) \n",(unsigned long)pProtocol)); - return (HCI_TRANSPORT_HANDLE)pProtocol; -} - -void HCI_TransportDetach(HCI_TRANSPORT_HANDLE HciTrans) -{ - GMBOX_PROTO_HCI_UART *pProtocol = (GMBOX_PROTO_HCI_UART *)HciTrans; - AR6K_DEVICE *pDev = pProtocol->pDev; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("+HCI_TransportDetach \n")); - - LOCK_AR6K(pDev); - if (!pProtocol->HCIAttached) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("GMBOX protocol not attached! \n")); - UNLOCK_AR6K(pDev); - return; - } - pProtocol->HCIAttached = FALSE; - UNLOCK_AR6K(pDev); - - HCI_TransportStop(HciTrans); - AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("-HCI_TransportAttach \n")); -} - -A_STATUS HCI_TransportAddReceivePkts(HCI_TRANSPORT_HANDLE HciTrans, HTC_PACKET_QUEUE *pQueue) -{ - GMBOX_PROTO_HCI_UART *pProt = (GMBOX_PROTO_HCI_UART *)HciTrans; - A_STATUS status = A_OK; - A_BOOL unblockRecv = FALSE; - HTC_PACKET *pPacket; - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+HCI_TransportAddReceivePkt \n")); - - LOCK_HCI_RX(pProt); - - do { - - if (pProt->HCIStopped) { - status = A_ECANCELED; - break; - } - - pPacket = HTC_GET_PKT_AT_HEAD(pQueue); - - if (NULL == pPacket) { - status = A_EINVAL; - break; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,(" HCI recv packet added, type :%d, len:%d num:%d \n", - HCI_GET_PACKET_TYPE(pPacket), pPacket->BufferLength, HTC_PACKET_QUEUE_DEPTH(pQueue))); - - if (HCI_GET_PACKET_TYPE(pPacket) == HCI_EVENT_TYPE) { - HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(&pProt->HCIEventBuffers, pQueue); - } else if (HCI_GET_PACKET_TYPE(pPacket) == HCI_ACL_TYPE) { - HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(&pProt->HCIACLRecvBuffers, pQueue); - } else { - status = A_EINVAL; - break; - } - - if (pProt->RecvStateFlags & HCI_RECV_WAIT_BUFFERS) { - if (pProt->WaitBufferType == HCI_GET_PACKET_TYPE(pPacket)) { - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,(" HCI recv was blocked on packet type :%d, unblocking.. \n", - pProt->WaitBufferType)); - pProt->RecvStateFlags &= ~HCI_RECV_WAIT_BUFFERS; - pProt->WaitBufferType = HCI_PACKET_INVALID; - unblockRecv = TRUE; - } - } - - } while (FALSE); - - UNLOCK_HCI_RX(pProt); - - if (A_FAILED(status)) { - while (!HTC_QUEUE_EMPTY(pQueue)) { - pPacket = HTC_PACKET_DEQUEUE(pQueue); - pPacket->Status = A_ECANCELED; - DO_HCI_RECV_INDICATION(pProt,pPacket); - } - } - - if (unblockRecv) { - DevGMboxIRQAction(pProt->pDev, GMBOX_RECV_IRQ_ENABLE, PROC_IO_ASYNC); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("-HCI_TransportAddReceivePkt \n")); - - return A_OK; -} - -A_STATUS HCI_TransportSendPkt(HCI_TRANSPORT_HANDLE HciTrans, HTC_PACKET *pPacket, A_BOOL Synchronous) -{ - GMBOX_PROTO_HCI_UART *pProt = (GMBOX_PROTO_HCI_UART *)HciTrans; - - return HCITrySend(pProt,pPacket,Synchronous); -} - -void HCI_TransportStop(HCI_TRANSPORT_HANDLE HciTrans) -{ - GMBOX_PROTO_HCI_UART *pProt = (GMBOX_PROTO_HCI_UART *)HciTrans; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("+HCI_TransportStop \n")); - - LOCK_AR6K(pProt->pDev); - if (pProt->HCIStopped) { - UNLOCK_AR6K(pProt->pDev); - AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("-HCI_TransportStop \n")); - return; - } - pProt->CreditsAvailable = 0; - pProt->CreditsMax = 0; - pProt->HCIStopped = TRUE; - UNLOCK_AR6K(pProt->pDev); - - /* disable interrupts */ - DevGMboxIRQAction(pProt->pDev, GMBOX_DISABLE_ALL, PROC_IO_SYNC); - FlushSendQueue(pProt); - FlushRecvBuffers(pProt); - - /* signal bridge side to power down BT */ - DevGMboxSetTargetInterrupt(pProt->pDev, MBOX_SIG_HCI_BRIDGE_BT_OFF, BTOFF_TIMEOUT_MS); - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("-HCI_TransportStop \n")); -} - -A_STATUS HCI_TransportStart(HCI_TRANSPORT_HANDLE HciTrans) -{ - A_STATUS status; - GMBOX_PROTO_HCI_UART *pProt = (GMBOX_PROTO_HCI_UART *)HciTrans; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("+HCI_TransportStart \n")); - - /* set stopped in case we have a problem in starting */ - pProt->HCIStopped = TRUE; - - do { - - status = InitTxCreditState(pProt); - - if (A_FAILED(status)) { - break; - } - - status = DevGMboxIRQAction(pProt->pDev, GMBOX_ERRORS_IRQ_ENABLE, PROC_IO_SYNC); - - if (A_FAILED(status)) { - break; - } - /* enable recv */ - status = DevGMboxIRQAction(pProt->pDev, GMBOX_RECV_IRQ_ENABLE, PROC_IO_SYNC); - - if (A_FAILED(status)) { - break; - } - /* signal bridge side to power up BT */ - status = DevGMboxSetTargetInterrupt(pProt->pDev, MBOX_SIG_HCI_BRIDGE_BT_ON, BTON_TIMEOUT_MS); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("HCI_TransportStart : Failed to trigger BT ON \n")); - break; - } - - /* we made it */ - pProt->HCIStopped = FALSE; - - } while (FALSE); - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("-HCI_TransportStart \n")); - - return status; -} - -A_STATUS HCI_TransportEnableDisableAsyncRecv(HCI_TRANSPORT_HANDLE HciTrans, A_BOOL Enable) -{ - GMBOX_PROTO_HCI_UART *pProt = (GMBOX_PROTO_HCI_UART *)HciTrans; - return DevGMboxIRQAction(pProt->pDev, - Enable ? GMBOX_RECV_IRQ_ENABLE : GMBOX_RECV_IRQ_DISABLE, - PROC_IO_SYNC); - -} - -A_STATUS HCI_TransportRecvHCIEventSync(HCI_TRANSPORT_HANDLE HciTrans, - HTC_PACKET *pPacket, - int MaxPollMS) -{ - GMBOX_PROTO_HCI_UART *pProt = (GMBOX_PROTO_HCI_UART *)HciTrans; - A_STATUS status = A_OK; - A_UINT8 lookAhead[8]; - int bytes; - int totalRecvLength; - - MaxPollMS = MaxPollMS / 16; - - if (MaxPollMS < 2) { - MaxPollMS = 2; - } - - while (MaxPollMS) { - - bytes = sizeof(lookAhead); - status = DevGMboxRecvLookAheadPeek(pProt->pDev,lookAhead,&bytes); - if (A_FAILED(status)) { - break; - } - - if (bytes < 3) { - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("HCI recv poll got bytes: %d, retry : %d \n", - bytes, MaxPollMS)); - A_MDELAY(16); - MaxPollMS--; - continue; - } - - totalRecvLength = 0; - switch (lookAhead[0]) { - case HCI_UART_EVENT_PKT: - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("HCI Event: %d param length: %d \n", - lookAhead[1], lookAhead[2])); - totalRecvLength = lookAhead[2]; - totalRecvLength += 3; /* add type + event code + length field */ - break; - default: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("**Invalid HCI packet type: %d \n",lookAhead[0])); - status = A_EPROTO; - break; - } - - if (A_FAILED(status)) { - break; - } - - pPacket->Completion = NULL; - status = DevGMboxRead(pProt->pDev,pPacket,totalRecvLength); - if (A_FAILED(status)) { - break; - } - - pPacket->pBuffer++; - pPacket->ActualLength = totalRecvLength - 1; - pPacket->Status = A_OK; - break; - } - - if (MaxPollMS == 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("HCI recv poll timeout! \n")); - status = A_ERROR; - } - - return status; -} - -A_STATUS HCI_TransportSetBaudRate(HCI_TRANSPORT_HANDLE HciTrans, A_UINT32 Baud) -{ - GMBOX_PROTO_HCI_UART *pProt = (GMBOX_PROTO_HCI_UART *)HciTrans; - HIF_DEVICE *pHIFDevice = (HIF_DEVICE *)(pProt->pDev->HIFDevice); - A_UINT32 scaledBaud, scratchAddr; - A_STATUS status = A_OK; - - /* Divide the desired baud rate by 100 - * Store the LSB in the local scratch register 4 and the MSB in the local - * scratch register 5 for the target to read - */ - scratchAddr = MBOX_BASE_ADDRESS | (LOCAL_SCRATCH_ADDRESS + 4 * LSB_SCRATCH_IDX); - scaledBaud = (Baud / 100) & LOCAL_SCRATCH_VALUE_MASK; - status = ar6000_WriteRegDiag(pHIFDevice, &scratchAddr, &scaledBaud); - scratchAddr = MBOX_BASE_ADDRESS | (LOCAL_SCRATCH_ADDRESS + 4 * MSB_SCRATCH_IDX); - scaledBaud = ((Baud / 100) >> (LOCAL_SCRATCH_VALUE_MSB+1)) & LOCAL_SCRATCH_VALUE_MASK; - status |= ar6000_WriteRegDiag(pHIFDevice, &scratchAddr, &scaledBaud); - if (A_OK != status) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to set up baud rate in scratch register!")); - return status; - } - - /* Now interrupt the target to tell it about the baud rate */ - status = DevGMboxSetTargetInterrupt(pProt->pDev, MBOX_SIG_HCI_BRIDGE_BAUD_SET, BAUD_TIMEOUT_MS); - if (A_OK != status) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to tell target to change baud rate!")); - } - - return status; -} - -A_STATUS HCI_TransportEnablePowerMgmt(HCI_TRANSPORT_HANDLE HciTrans, A_BOOL Enable) -{ - A_STATUS status; - GMBOX_PROTO_HCI_UART *pProt = (GMBOX_PROTO_HCI_UART *)HciTrans; - - if (Enable) { - status = DevGMboxSetTargetInterrupt(pProt->pDev, MBOX_SIG_HCI_BRIDGE_PWR_SAV_ON, BTPWRSAV_TIMEOUT_MS); - } else { - status = DevGMboxSetTargetInterrupt(pProt->pDev, MBOX_SIG_HCI_BRIDGE_PWR_SAV_OFF, BTPWRSAV_TIMEOUT_MS); - } - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Failed to enable/disable HCI power management!\n")); - } else { - if (Enable) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("HCI power management ENABLED!\n")); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("HCI power management DISABLED!\n")); - } - } - - return status; -} - -#endif //ATH_AR6K_ENABLE_GMBOX - diff --git a/drivers/net/wireless/ar6003/host/htc2/AR6000/makefile b/drivers/net/wireless/ar6003/host/htc2/AR6000/makefile deleted file mode 100644 index 1ba034c4900e..000000000000 --- a/drivers/net/wireless/ar6003/host/htc2/AR6000/makefile +++ /dev/null @@ -1,26 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2005-2007 Atheros Corporation. All rights reserved. -# -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# -#------------------------------------------------------------------------------ -#============================================================================== -# Author(s): ="Atheros" -#============================================================================== -!INCLUDE $(_MAKEENVROOT)\makefile.def - - - diff --git a/drivers/net/wireless/ar6003/host/htc2/htc.c b/drivers/net/wireless/ar6003/host/htc2/htc.c deleted file mode 100644 index 813b4ccbdad1..000000000000 --- a/drivers/net/wireless/ar6003/host/htc2/htc.c +++ /dev/null @@ -1,578 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#include "htc_internal.h" - -#ifdef DEBUG -static ATH_DEBUG_MASK_DESCRIPTION g_HTCDebugDescription[] = { - { ATH_DEBUG_SEND , "Send"}, - { ATH_DEBUG_RECV , "Recv"}, - { ATH_DEBUG_SYNC , "Sync"}, - { ATH_DEBUG_DUMP , "Dump Data (RX or TX)"}, - { ATH_DEBUG_IRQ , "Interrupt Processing"} -}; - -ATH_DEBUG_INSTANTIATE_MODULE_VAR(htc, - "htc", - "Host Target Communications", - ATH_DEBUG_MASK_DEFAULTS, - ATH_DEBUG_DESCRIPTION_COUNT(g_HTCDebugDescription), - g_HTCDebugDescription); - -#endif - -static void HTCReportFailure(void *Context); -static void ResetEndpointStates(HTC_TARGET *target); - -void HTCFreeControlBuffer(HTC_TARGET *target, HTC_PACKET *pPacket, HTC_PACKET_QUEUE *pList) -{ - LOCK_HTC(target); - HTC_PACKET_ENQUEUE(pList,pPacket); - UNLOCK_HTC(target); -} - -HTC_PACKET *HTCAllocControlBuffer(HTC_TARGET *target, HTC_PACKET_QUEUE *pList) -{ - HTC_PACKET *pPacket; - - LOCK_HTC(target); - pPacket = HTC_PACKET_DEQUEUE(pList); - UNLOCK_HTC(target); - - return pPacket; -} - -/* cleanup the HTC instance */ -static void HTCCleanup(HTC_TARGET *target) -{ - A_INT32 i; - - DevCleanup(&target->Device); - - for (i = 0;i < NUM_CONTROL_BUFFERS;i++) { - if (target->HTCControlBuffers[i].Buffer) { - A_FREE(target->HTCControlBuffers[i].Buffer); - } - } - - if (A_IS_MUTEX_VALID(&target->HTCLock)) { - A_MUTEX_DELETE(&target->HTCLock); - } - - if (A_IS_MUTEX_VALID(&target->HTCRxLock)) { - A_MUTEX_DELETE(&target->HTCRxLock); - } - - if (A_IS_MUTEX_VALID(&target->HTCTxLock)) { - A_MUTEX_DELETE(&target->HTCTxLock); - } - /* free our instance */ - A_FREE(target); -} - -/* registered target arrival callback from the HIF layer */ -HTC_HANDLE HTCCreate(void *hif_handle, HTC_INIT_INFO *pInfo) -{ - HTC_TARGET *target = NULL; - A_STATUS status = A_OK; - int i; - A_UINT32 ctrl_bufsz; - A_UINT32 blocksizes[HTC_MAILBOX_NUM_MAX]; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HTCCreate - Enter\n")); - - A_REGISTER_MODULE_DEBUG_INFO(htc); - - do { - - /* allocate target memory */ - if ((target = (HTC_TARGET *)A_MALLOC(sizeof(HTC_TARGET))) == NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to allocate memory\n")); - status = A_ERROR; - break; - } - - A_MEMZERO(target, sizeof(HTC_TARGET)); - A_MUTEX_INIT(&target->HTCLock); - A_MUTEX_INIT(&target->HTCRxLock); - A_MUTEX_INIT(&target->HTCTxLock); - INIT_HTC_PACKET_QUEUE(&target->ControlBufferTXFreeList); - INIT_HTC_PACKET_QUEUE(&target->ControlBufferRXFreeList); - - /* give device layer the hif device handle */ - target->Device.HIFDevice = hif_handle; - /* give the device layer our context (for event processing) - * the device layer will register it's own context with HIF - * so we need to set this so we can fetch it in the target remove handler */ - target->Device.HTCContext = target; - /* set device layer target failure callback */ - target->Device.TargetFailureCallback = HTCReportFailure; - /* set device layer recv message pending callback */ - target->Device.MessagePendingCallback = HTCRecvMessagePendingHandler; - target->EpWaitingForBuffers = ENDPOINT_MAX; - - A_MEMCPY(&target->HTCInitInfo,pInfo,sizeof(HTC_INIT_INFO)); - - ResetEndpointStates(target); - - /* setup device layer */ - status = DevSetup(&target->Device); - - if (A_FAILED(status)) { - break; - } - - - /* get the block sizes */ - status = HIFConfigureDevice(hif_handle, HIF_DEVICE_GET_MBOX_BLOCK_SIZE, - blocksizes, sizeof(blocksizes)); - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Failed to get block size info from HIF layer...\n")); - break; - } - - /* Set the control buffer size based on the block size */ - if (blocksizes[1] > HTC_MAX_CONTROL_MESSAGE_LENGTH) { - ctrl_bufsz = blocksizes[1] + HTC_HDR_LENGTH; - } else { - ctrl_bufsz = HTC_MAX_CONTROL_MESSAGE_LENGTH + HTC_HDR_LENGTH; - } - for (i = 0;i < NUM_CONTROL_BUFFERS;i++) { - target->HTCControlBuffers[i].Buffer = A_MALLOC(ctrl_bufsz); - if (target->HTCControlBuffers[i].Buffer == NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to allocate memory\n")); - status = A_ERROR; - break; - } - } - - if (A_FAILED(status)) { - break; - } - - /* carve up buffers/packets for control messages */ - for (i = 0; i < NUM_CONTROL_RX_BUFFERS; i++) { - HTC_PACKET *pControlPacket; - pControlPacket = &target->HTCControlBuffers[i].HtcPacket; - SET_HTC_PACKET_INFO_RX_REFILL(pControlPacket, - target, - target->HTCControlBuffers[i].Buffer, - ctrl_bufsz, - ENDPOINT_0); - HTC_FREE_CONTROL_RX(target,pControlPacket); - } - - for (;i < NUM_CONTROL_BUFFERS;i++) { - HTC_PACKET *pControlPacket; - pControlPacket = &target->HTCControlBuffers[i].HtcPacket; - INIT_HTC_PACKET_INFO(pControlPacket, - target->HTCControlBuffers[i].Buffer, - ctrl_bufsz); - HTC_FREE_CONTROL_TX(target,pControlPacket); - } - - } while (FALSE); - - if (A_FAILED(status)) { - if (target != NULL) { - HTCCleanup(target); - target = NULL; - } - } - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HTCCreate - Exit\n")); - - return target; -} - -void HTCDestroy(HTC_HANDLE HTCHandle) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+HTCDestroy .. Destroying :0x%lX \n",(unsigned long)target)); - HTCCleanup(target); - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("-HTCDestroy \n")); -} - -/* get the low level HIF device for the caller , the caller may wish to do low level - * HIF requests */ -void *HTCGetHifDevice(HTC_HANDLE HTCHandle) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - return target->Device.HIFDevice; -} - -/* wait for the target to arrive (sends HTC Ready message) - * this operation is fully synchronous and the message is polled for */ -A_STATUS HTCWaitTarget(HTC_HANDLE HTCHandle) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - A_STATUS status; - HTC_PACKET *pPacket = NULL; - HTC_READY_EX_MSG *pRdyMsg; - HTC_SERVICE_CONNECT_REQ connect; - HTC_SERVICE_CONNECT_RESP resp; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HTCWaitTarget - Enter (target:0x%lX) \n", (unsigned long)target)); - - do { - -#ifdef MBOXHW_UNIT_TEST - - status = DoMboxHWTest(&target->Device); - - if (status != A_OK) { - break; - } - -#endif - - /* we should be getting 1 control message that the target is ready */ - status = HTCWaitforControlMessage(target, &pPacket); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, (" Target Not Available!!\n")); - break; - } - - /* we controlled the buffer creation so it has to be properly aligned */ - pRdyMsg = (HTC_READY_EX_MSG *)pPacket->pBuffer; - - if ((pRdyMsg->Version2_0_Info.MessageID != HTC_MSG_READY_ID) || - (pPacket->ActualLength < sizeof(HTC_READY_MSG))) { - /* this message is not valid */ - AR_DEBUG_ASSERT(FALSE); - status = A_EPROTO; - break; - } - - - if (pRdyMsg->Version2_0_Info.CreditCount == 0 || pRdyMsg->Version2_0_Info.CreditSize == 0) { - /* this message is not valid */ - AR_DEBUG_ASSERT(FALSE); - status = A_EPROTO; - break; - } - - target->TargetCredits = pRdyMsg->Version2_0_Info.CreditCount; - target->TargetCreditSize = pRdyMsg->Version2_0_Info.CreditSize; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, (" Target Ready: credits: %d credit size: %d\n", - target->TargetCredits, target->TargetCreditSize)); - - /* check if this is an extended ready message */ - if (pPacket->ActualLength >= sizeof(HTC_READY_EX_MSG)) { - /* this is an extended message */ - target->HTCTargetVersion = pRdyMsg->HTCVersion; - target->MaxMsgPerBundle = pRdyMsg->MaxMsgsPerHTCBundle; - } else { - /* legacy */ - target->HTCTargetVersion = HTC_VERSION_2P0; - target->MaxMsgPerBundle = 0; - } - -#ifdef HTC_FORCE_LEGACY_2P0 - /* for testing and comparison...*/ - target->HTCTargetVersion = HTC_VERSION_2P0; - target->MaxMsgPerBundle = 0; -#endif - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, - ("Using HTC Protocol Version : %s (%d)\n ", - (target->HTCTargetVersion == HTC_VERSION_2P0) ? "2.0" : ">= 2.1", - target->HTCTargetVersion)); - - if (target->MaxMsgPerBundle > 0) { - /* limit what HTC can handle */ - target->MaxMsgPerBundle = min(HTC_HOST_MAX_MSG_PER_BUNDLE, target->MaxMsgPerBundle); - /* target supports message bundling, setup device layer */ - if (A_FAILED(DevSetupMsgBundling(&target->Device,target->MaxMsgPerBundle))) { - /* device layer can't handle bundling */ - target->MaxMsgPerBundle = 0; - } else { - /* limit bundle what the device layer can handle */ - target->MaxMsgPerBundle = min(DEV_GET_MAX_MSG_PER_BUNDLE(&target->Device), - target->MaxMsgPerBundle); - } - } - - if (target->MaxMsgPerBundle > 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, - (" HTC bundling allowed. Max Msg Per HTC Bundle: %d\n", target->MaxMsgPerBundle)); - target->SendBundlingEnabled = TRUE; - target->RecvBundlingEnabled = TRUE; - if (!DEV_IS_LEN_BLOCK_ALIGNED(&target->Device,target->TargetCreditSize)) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, ("*** Credit size: %d is not block aligned! Disabling send bundling \n", - target->TargetCreditSize)); - /* disallow send bundling since the credit size is not aligned to a block size - * the I/O block padding will spill into the next credit buffer which is fatal */ - target->SendBundlingEnabled = FALSE; - } - } - - status = DevSetupGMbox(&target->Device); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, (" GMbox set up Failed!!\n")); - break; - } - - /* setup our pseudo HTC control endpoint connection */ - A_MEMZERO(&connect,sizeof(connect)); - A_MEMZERO(&resp,sizeof(resp)); - connect.EpCallbacks.pContext = target; - connect.EpCallbacks.EpTxComplete = HTCControlTxComplete; - connect.EpCallbacks.EpRecv = HTCControlRecv; - connect.EpCallbacks.EpRecvRefill = NULL; /* not needed */ - connect.EpCallbacks.EpSendFull = NULL; /* not nedded */ - connect.MaxSendQueueDepth = NUM_CONTROL_BUFFERS; - connect.ServiceID = HTC_CTRL_RSVD_SVC; - - /* connect fake service */ - status = HTCConnectService((HTC_HANDLE)target, - &connect, - &resp); - - if (!A_FAILED(status)) { - break; - } - - } while (FALSE); - - if (pPacket != NULL) { - HTC_FREE_CONTROL_RX(target,pPacket); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HTCWaitTarget - Exit\n")); - - return status; -} - - - -/* Start HTC, enable interrupts and let the target know host has finished setup */ -A_STATUS HTCStart(HTC_HANDLE HTCHandle) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - HTC_PACKET *pPacket; - A_STATUS status; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HTCStart Enter\n")); - - /* make sure interrupts are disabled at the chip level, - * this function can be called again from a reboot of the target without shutting down HTC */ - DevDisableInterrupts(&target->Device); - /* make sure state is cleared again */ - target->OpStateFlags = 0; - target->RecvStateFlags = 0; - - /* now that we are starting, push control receive buffers into the - * HTC control endpoint */ - - while (1) { - pPacket = HTC_ALLOC_CONTROL_RX(target); - if (NULL == pPacket) { - break; - } - HTCAddReceivePkt((HTC_HANDLE)target,pPacket); - } - - do { - - AR_DEBUG_ASSERT(target->InitCredits != NULL); - AR_DEBUG_ASSERT(target->EpCreditDistributionListHead != NULL); - AR_DEBUG_ASSERT(target->EpCreditDistributionListHead->pNext != NULL); - - /* call init credits callback to do the distribution , - * NOTE: the first entry in the distribution list is ENDPOINT_0, so - * we pass the start of the list after this one. */ - target->InitCredits(target->pCredDistContext, - target->EpCreditDistributionListHead->pNext, - target->TargetCredits); - - if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_TRC)) { - DumpCreditDistStates(target); - } - - /* the caller is done connecting to services, so we can indicate to the - * target that the setup phase is complete */ - status = HTCSendSetupComplete(target); - - if (A_FAILED(status)) { - break; - } - - /* unmask interrupts */ - status = DevUnmaskInterrupts(&target->Device); - - if (A_FAILED(status)) { - HTCStop(target); - } - - } while (FALSE); - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HTCStart Exit\n")); - return status; -} - -static void ResetEndpointStates(HTC_TARGET *target) -{ - HTC_ENDPOINT *pEndpoint; - int i; - - for (i = ENDPOINT_0; i < ENDPOINT_MAX; i++) { - pEndpoint = &target->EndPoint[i]; - - A_MEMZERO(&pEndpoint->CreditDist, sizeof(pEndpoint->CreditDist)); - pEndpoint->ServiceID = 0; - pEndpoint->MaxMsgLength = 0; - pEndpoint->MaxTxQueueDepth = 0; -#ifdef HTC_EP_STAT_PROFILING - A_MEMZERO(&pEndpoint->EndPointStats,sizeof(pEndpoint->EndPointStats)); -#endif - INIT_HTC_PACKET_QUEUE(&pEndpoint->RxBuffers); - INIT_HTC_PACKET_QUEUE(&pEndpoint->TxQueue); - INIT_HTC_PACKET_QUEUE(&pEndpoint->RecvIndicationQueue); - pEndpoint->target = target; - } - /* reset distribution list */ - target->EpCreditDistributionListHead = NULL; -} - -/* stop HTC communications, i.e. stop interrupt reception, and flush all queued buffers */ -void HTCStop(HTC_HANDLE HTCHandle) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+HTCStop \n")); - - LOCK_HTC(target); - - /* mark that we are shutting down .. */ - target->OpStateFlags |= HTC_OP_STATE_STOPPING; - UNLOCK_HTC(target); - - /* Masking interrupts is a synchronous operation, when this function returns - * all pending HIF I/O has completed, we can safely flush the queues */ - DevMaskInterrupts (&target->Device); - - - /* flush all send packets */ - HTCFlushSendPkts(target); - /* flush all recv buffers */ - HTCFlushRecvBuffers(target); - - DevCleanupMsgBundling(&target->Device); - - DevCleanupGMbox(&target->Device); - - ResetEndpointStates(target); - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("-HTCStop \n")); -} - -void HTCDumpCreditStates(HTC_HANDLE HTCHandle) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - - LOCK_HTC_TX(target); - - DumpCreditDistStates(target); - - UNLOCK_HTC_TX(target); - - DumpAR6KDevState(&target->Device); -} - -/* report a target failure from the device, this is a callback from the device layer - * which uses a mechanism to report errors from the target (i.e. special interrupts) */ -static void HTCReportFailure(void *Context) -{ - HTC_TARGET *target = (HTC_TARGET *)Context; - - target->TargetFailure = TRUE; - - if (target->HTCInitInfo.TargetFailure != NULL) { - /* let upper layer know, it needs to call HTCStop() */ - target->HTCInitInfo.TargetFailure(target->HTCInitInfo.pContext, A_ERROR); - } -} - -A_BOOL HTCGetEndpointStatistics(HTC_HANDLE HTCHandle, - HTC_ENDPOINT_ID Endpoint, - HTC_ENDPOINT_STAT_ACTION Action, - HTC_ENDPOINT_STATS *pStats) -{ - -#ifdef HTC_EP_STAT_PROFILING - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - A_BOOL clearStats = FALSE; - A_BOOL sample = FALSE; - - switch (Action) { - case HTC_EP_STAT_SAMPLE : - sample = TRUE; - break; - case HTC_EP_STAT_SAMPLE_AND_CLEAR : - sample = TRUE; - clearStats = TRUE; - break; - case HTC_EP_STAT_CLEAR : - clearStats = TRUE; - break; - default: - break; - } - - A_ASSERT(Endpoint < ENDPOINT_MAX); - if (!(Endpoint < ENDPOINT_MAX)) { - return FALSE; /* in case panic_on_assert==0 */ - } - /* lock out TX and RX while we sample and/or clear */ - LOCK_HTC_TX(target); - LOCK_HTC_RX(target); - - if (sample) { - A_ASSERT(pStats != NULL); - /* return the stats to the caller */ - A_MEMCPY(pStats, &target->EndPoint[Endpoint].EndPointStats, sizeof(HTC_ENDPOINT_STATS)); - } - - if (clearStats) { - /* reset stats */ - A_MEMZERO(&target->EndPoint[Endpoint].EndPointStats, sizeof(HTC_ENDPOINT_STATS)); - } - - UNLOCK_HTC_RX(target); - UNLOCK_HTC_TX(target); - - return TRUE; -#else - return FALSE; -#endif -} - -AR6K_DEVICE *HTCGetAR6KDevice(void *HTCHandle) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - return &target->Device; -} - diff --git a/drivers/net/wireless/ar6003/host/htc2/htc_debug.h b/drivers/net/wireless/ar6003/host/htc2/htc_debug.h deleted file mode 100644 index 8455703e221c..000000000000 --- a/drivers/net/wireless/ar6003/host/htc2/htc_debug.h +++ /dev/null @@ -1,38 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== -#ifndef HTC_DEBUG_H_ -#define HTC_DEBUG_H_ - -#define ATH_MODULE_NAME htc -#include "a_debug.h" - -/* ------- Debug related stuff ------- */ - -#define ATH_DEBUG_SEND ATH_DEBUG_MAKE_MODULE_MASK(0) -#define ATH_DEBUG_RECV ATH_DEBUG_MAKE_MODULE_MASK(1) -#define ATH_DEBUG_SYNC ATH_DEBUG_MAKE_MODULE_MASK(2) -#define ATH_DEBUG_DUMP ATH_DEBUG_MAKE_MODULE_MASK(3) -#define ATH_DEBUG_IRQ ATH_DEBUG_MAKE_MODULE_MASK(4) - - -#endif /*HTC_DEBUG_H_*/ diff --git a/drivers/net/wireless/ar6003/host/htc2/htc_internal.h b/drivers/net/wireless/ar6003/host/htc2/htc_internal.h deleted file mode 100644 index ca0ba3825fa6..000000000000 --- a/drivers/net/wireless/ar6003/host/htc2/htc_internal.h +++ /dev/null @@ -1,217 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== -#ifndef _HTC_INTERNAL_H_ -#define _HTC_INTERNAL_H_ - -/* for debugging, uncomment this to capture the last frame header, on frame header - * processing errors, the last frame header is dump for comparison */ -//#define HTC_CAPTURE_LAST_FRAME - -//#define HTC_EP_STAT_PROFILING - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Header files */ - -#include "a_config.h" -#include "athdefs.h" -#include "a_types.h" -#include "a_osapi.h" -#include "htc_debug.h" -#include "htc.h" -#include "htc_api.h" -#include "bmi_msg.h" -#include "hif.h" -#include "AR6000/ar6k.h" - -/* HTC operational parameters */ -#define HTC_TARGET_RESPONSE_TIMEOUT 2000 /* in ms */ -#define HTC_TARGET_DEBUG_INTR_MASK 0x01 -#define HTC_TARGET_CREDIT_INTR_MASK 0xF0 - -#define HTC_HOST_MAX_MSG_PER_BUNDLE 8 -#define HTC_MIN_HTC_MSGS_TO_BUNDLE 2 - -/* packet flags */ - -#define HTC_RX_PKT_IGNORE_LOOKAHEAD (1 << 0) -#define HTC_RX_PKT_REFRESH_HDR (1 << 1) -#define HTC_RX_PKT_PART_OF_BUNDLE (1 << 2) -#define HTC_RX_PKT_NO_RECYCLE (1 << 3) - -/* scatter request flags */ - -#define HTC_SCATTER_REQ_FLAGS_PARTIAL_BUNDLE (1 << 0) - -typedef struct _HTC_ENDPOINT { - HTC_ENDPOINT_ID Id; - HTC_SERVICE_ID ServiceID; /* service ID this endpoint is bound to - non-zero value means this endpoint is in use */ - HTC_PACKET_QUEUE TxQueue; /* HTC frame buffer TX queue */ - HTC_PACKET_QUEUE RxBuffers; /* HTC frame buffer RX list */ - HTC_ENDPOINT_CREDIT_DIST CreditDist; /* credit distribution structure (exposed to driver layer) */ - HTC_EP_CALLBACKS EpCallBacks; /* callbacks associated with this endpoint */ - int MaxTxQueueDepth; /* max depth of the TX queue before we need to - call driver's full handler */ - int MaxMsgLength; /* max length of endpoint message */ - int TxProcessCount; /* reference count to continue tx processing */ - HTC_PACKET_QUEUE RecvIndicationQueue; /* recv packets ready to be indicated */ - int RxProcessCount; /* reference count to allow single processing context */ - struct _HTC_TARGET *target; /* back pointer to target */ - A_UINT8 SeqNo; /* TX seq no (helpful) for debugging */ - A_UINT32 LocalConnectionFlags; /* local connection flags */ -#ifdef HTC_EP_STAT_PROFILING - HTC_ENDPOINT_STATS EndPointStats; /* endpoint statistics */ -#endif -} HTC_ENDPOINT; - -#ifdef HTC_EP_STAT_PROFILING -#define INC_HTC_EP_STAT(p,stat,count) (p)->EndPointStats.stat += (count); -#else -#define INC_HTC_EP_STAT(p,stat,count) -#endif - -#define HTC_SERVICE_TX_PACKET_TAG HTC_TX_PACKET_TAG_INTERNAL - -#define NUM_CONTROL_BUFFERS 8 -#define NUM_CONTROL_TX_BUFFERS 2 -#define NUM_CONTROL_RX_BUFFERS (NUM_CONTROL_BUFFERS - NUM_CONTROL_TX_BUFFERS) - -typedef struct HTC_CONTROL_BUFFER { - HTC_PACKET HtcPacket; - A_UINT8 *Buffer; -} HTC_CONTROL_BUFFER; - -#define HTC_RECV_WAIT_BUFFERS (1 << 0) -#define HTC_OP_STATE_STOPPING (1 << 0) - -/* our HTC target state */ -typedef struct _HTC_TARGET { - HTC_ENDPOINT EndPoint[ENDPOINT_MAX]; - HTC_CONTROL_BUFFER HTCControlBuffers[NUM_CONTROL_BUFFERS]; - HTC_ENDPOINT_CREDIT_DIST *EpCreditDistributionListHead; - HTC_PACKET_QUEUE ControlBufferTXFreeList; - HTC_PACKET_QUEUE ControlBufferRXFreeList; - HTC_CREDIT_DIST_CALLBACK DistributeCredits; - HTC_CREDIT_INIT_CALLBACK InitCredits; - void *pCredDistContext; - int TargetCredits; - unsigned int TargetCreditSize; - A_MUTEX_T HTCLock; - A_MUTEX_T HTCRxLock; - A_MUTEX_T HTCTxLock; - AR6K_DEVICE Device; /* AR6K - specific state */ - A_UINT32 OpStateFlags; - A_UINT32 RecvStateFlags; - HTC_ENDPOINT_ID EpWaitingForBuffers; - A_BOOL TargetFailure; -#ifdef HTC_CAPTURE_LAST_FRAME - HTC_FRAME_HDR LastFrameHdr; /* useful for debugging */ - A_UINT8 LastTrailer[256]; - A_UINT8 LastTrailerLength; -#endif - HTC_INIT_INFO HTCInitInfo; - A_UINT8 HTCTargetVersion; - int MaxMsgPerBundle; /* max messages per bundle for HTC */ - A_BOOL SendBundlingEnabled; /* run time enable for send bundling (dynamic) */ - int RecvBundlingEnabled; /* run time enable for recv bundling (dynamic) */ -} HTC_TARGET; - -#define HTC_STOPPING(t) ((t)->OpStateFlags & HTC_OP_STATE_STOPPING) -#define LOCK_HTC(t) A_MUTEX_LOCK(&(t)->HTCLock); -#define UNLOCK_HTC(t) A_MUTEX_UNLOCK(&(t)->HTCLock); -#define LOCK_HTC_RX(t) A_MUTEX_LOCK(&(t)->HTCRxLock); -#define UNLOCK_HTC_RX(t) A_MUTEX_UNLOCK(&(t)->HTCRxLock); -#define LOCK_HTC_TX(t) A_MUTEX_LOCK(&(t)->HTCTxLock); -#define UNLOCK_HTC_TX(t) A_MUTEX_UNLOCK(&(t)->HTCTxLock); - -#define GET_HTC_TARGET_FROM_HANDLE(hnd) ((HTC_TARGET *)(hnd)) -#define HTC_RECYCLE_RX_PKT(target,p,e) \ -{ \ - if ((p)->PktInfo.AsRx.HTCRxFlags & HTC_RX_PKT_NO_RECYCLE) { \ - HTC_PACKET_RESET_RX(pPacket); \ - pPacket->Status = A_ECANCELED; \ - (e)->EpCallBacks.EpRecv((e)->EpCallBacks.pContext, \ - (p)); \ - } else { \ - HTC_PACKET_RESET_RX(pPacket); \ - HTCAddReceivePkt((HTC_HANDLE)(target),(p)); \ - } \ -} - -/* internal HTC functions */ -void HTCControlTxComplete(void *Context, HTC_PACKET *pPacket); -void HTCControlRecv(void *Context, HTC_PACKET *pPacket); -A_STATUS HTCWaitforControlMessage(HTC_TARGET *target, HTC_PACKET **ppControlPacket); -HTC_PACKET *HTCAllocControlBuffer(HTC_TARGET *target, HTC_PACKET_QUEUE *pList); -void HTCFreeControlBuffer(HTC_TARGET *target, HTC_PACKET *pPacket, HTC_PACKET_QUEUE *pList); -A_STATUS HTCIssueSend(HTC_TARGET *target, HTC_PACKET *pPacket); -void HTCRecvCompleteHandler(void *Context, HTC_PACKET *pPacket); -A_STATUS HTCRecvMessagePendingHandler(void *Context, A_UINT32 MsgLookAheads[], int NumLookAheads, A_BOOL *pAsyncProc, int *pNumPktsFetched); -void HTCProcessCreditRpt(HTC_TARGET *target, HTC_CREDIT_REPORT *pRpt, int NumEntries, HTC_ENDPOINT_ID FromEndpoint); -A_STATUS HTCSendSetupComplete(HTC_TARGET *target); -void HTCFlushRecvBuffers(HTC_TARGET *target); -void HTCFlushSendPkts(HTC_TARGET *target); -void DumpCreditDist(HTC_ENDPOINT_CREDIT_DIST *pEPDist); -void DumpCreditDistStates(HTC_TARGET *target); -void DebugDumpBytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription); - -static INLINE HTC_PACKET *HTC_ALLOC_CONTROL_TX(HTC_TARGET *target) { - HTC_PACKET *pPacket = HTCAllocControlBuffer(target,&target->ControlBufferTXFreeList); - if (pPacket != NULL) { - /* set payload pointer area with some headroom */ - pPacket->pBuffer = pPacket->pBufferStart + HTC_HDR_LENGTH; - } - return pPacket; -} - -#define HTC_FREE_CONTROL_TX(t,p) HTCFreeControlBuffer((t),(p),&(t)->ControlBufferTXFreeList) -#define HTC_ALLOC_CONTROL_RX(t) HTCAllocControlBuffer((t),&(t)->ControlBufferRXFreeList) -#define HTC_FREE_CONTROL_RX(t,p) \ -{ \ - HTC_PACKET_RESET_RX(p); \ - HTCFreeControlBuffer((t),(p),&(t)->ControlBufferRXFreeList); \ -} - -#define HTC_PREPARE_SEND_PKT(pP,sendflags,ctrl0,ctrl1) \ -{ \ - A_UINT8 *pHdrBuf; \ - (pP)->pBuffer -= HTC_HDR_LENGTH; \ - pHdrBuf = (pP)->pBuffer; \ - A_SET_UINT16_FIELD(pHdrBuf,HTC_FRAME_HDR,PayloadLen,(A_UINT16)(pP)->ActualLength); \ - A_SET_UINT8_FIELD(pHdrBuf,HTC_FRAME_HDR,Flags,(sendflags)); \ - A_SET_UINT8_FIELD(pHdrBuf,HTC_FRAME_HDR,EndpointID, (A_UINT8)(pP)->Endpoint); \ - A_SET_UINT8_FIELD(pHdrBuf,HTC_FRAME_HDR,ControlBytes[0], (A_UINT8)(ctrl0)); \ - A_SET_UINT8_FIELD(pHdrBuf,HTC_FRAME_HDR,ControlBytes[1], (A_UINT8)(ctrl1)); \ -} - -#define HTC_UNPREPARE_SEND_PKT(pP) \ - (pP)->pBuffer += HTC_HDR_LENGTH; \ - -#ifdef __cplusplus -} -#endif - -#endif /* _HTC_INTERNAL_H_ */ diff --git a/drivers/net/wireless/ar6003/host/htc2/htc_recv.c b/drivers/net/wireless/ar6003/host/htc2/htc_recv.c deleted file mode 100644 index d483f701713e..000000000000 --- a/drivers/net/wireless/ar6003/host/htc2/htc_recv.c +++ /dev/null @@ -1,1572 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#include "htc_internal.h" - -#define HTCIssueRecv(t, p) \ - DevRecvPacket(&(t)->Device, \ - (p), \ - (p)->ActualLength) - -#define DO_RCV_COMPLETION(e,q) DoRecvCompletion(e,q) - -#define DUMP_RECV_PKT_INFO(pP) \ - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, (" HTC RECV packet 0x%lX (%d bytes) (hdr:0x%X) on ep : %d \n", \ - (unsigned long)(pP), \ - (pP)->ActualLength, \ - (pP)->PktInfo.AsRx.ExpectedHdr, \ - (pP)->Endpoint)) - -#ifdef HTC_EP_STAT_PROFILING -#define HTC_RX_STAT_PROFILE(t,ep,numLookAheads) \ -{ \ - INC_HTC_EP_STAT((ep), RxReceived, 1); \ - if ((numLookAheads) == 1) { \ - INC_HTC_EP_STAT((ep), RxLookAheads, 1); \ - } else if ((numLookAheads) > 1) { \ - INC_HTC_EP_STAT((ep), RxBundleLookAheads, 1); \ - } \ -} -#else -#define HTC_RX_STAT_PROFILE(t,ep,lookAhead) -#endif - -static void DoRecvCompletion(HTC_ENDPOINT *pEndpoint, - HTC_PACKET_QUEUE *pQueueToIndicate) -{ - - do { - - if (HTC_QUEUE_EMPTY(pQueueToIndicate)) { - /* nothing to indicate */ - break; - } - - if (pEndpoint->EpCallBacks.EpRecvPktMultiple != NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, (" HTC calling ep %d, recv multiple callback (%d pkts) \n", - pEndpoint->Id, HTC_PACKET_QUEUE_DEPTH(pQueueToIndicate))); - /* a recv multiple handler is being used, pass the queue to the handler */ - pEndpoint->EpCallBacks.EpRecvPktMultiple(pEndpoint->EpCallBacks.pContext, - pQueueToIndicate); - INIT_HTC_PACKET_QUEUE(pQueueToIndicate); - } else { - HTC_PACKET *pPacket; - /* using legacy EpRecv */ - do { - pPacket = HTC_PACKET_DEQUEUE(pQueueToIndicate); - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, (" HTC calling ep %d recv callback on packet 0x%lX \n", \ - pEndpoint->Id, (unsigned long)(pPacket))); - pEndpoint->EpCallBacks.EpRecv(pEndpoint->EpCallBacks.pContext, pPacket); - } while (!HTC_QUEUE_EMPTY(pQueueToIndicate)); - } - - } while (FALSE); - -} - -static INLINE A_STATUS HTCProcessTrailer(HTC_TARGET *target, - A_UINT8 *pBuffer, - int Length, - A_UINT32 *pNextLookAheads, - int *pNumLookAheads, - HTC_ENDPOINT_ID FromEndpoint) -{ - HTC_RECORD_HDR *pRecord; - A_UINT8 *pRecordBuf; - HTC_LOOKAHEAD_REPORT *pLookAhead; - A_UINT8 *pOrigBuffer; - int origLength; - A_STATUS status; - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("+HTCProcessTrailer (length:%d) \n", Length)); - - if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_RECV)) { - AR_DEBUG_PRINTBUF(pBuffer,Length,"Recv Trailer"); - } - - pOrigBuffer = pBuffer; - origLength = Length; - status = A_OK; - - while (Length > 0) { - - if (Length < sizeof(HTC_RECORD_HDR)) { - status = A_EPROTO; - break; - } - /* these are byte aligned structs */ - pRecord = (HTC_RECORD_HDR *)pBuffer; - Length -= sizeof(HTC_RECORD_HDR); - pBuffer += sizeof(HTC_RECORD_HDR); - - if (pRecord->Length > Length) { - /* no room left in buffer for record */ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - (" invalid record length: %d (id:%d) buffer has: %d bytes left \n", - pRecord->Length, pRecord->RecordID, Length)); - status = A_EPROTO; - break; - } - /* start of record follows the header */ - pRecordBuf = pBuffer; - - switch (pRecord->RecordID) { - case HTC_RECORD_CREDITS: - AR_DEBUG_ASSERT(pRecord->Length >= sizeof(HTC_CREDIT_REPORT)); - HTCProcessCreditRpt(target, - (HTC_CREDIT_REPORT *)pRecordBuf, - pRecord->Length / (sizeof(HTC_CREDIT_REPORT)), - FromEndpoint); - break; - case HTC_RECORD_LOOKAHEAD: - AR_DEBUG_ASSERT(pRecord->Length >= sizeof(HTC_LOOKAHEAD_REPORT)); - pLookAhead = (HTC_LOOKAHEAD_REPORT *)pRecordBuf; - if ((pLookAhead->PreValid == ((~pLookAhead->PostValid) & 0xFF)) && - (pNextLookAheads != NULL)) { - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, - (" LookAhead Report Found (pre valid:0x%X, post valid:0x%X) \n", - pLookAhead->PreValid, - pLookAhead->PostValid)); - - /* look ahead bytes are valid, copy them over */ - ((A_UINT8 *)(&pNextLookAheads[0]))[0] = pLookAhead->LookAhead[0]; - ((A_UINT8 *)(&pNextLookAheads[0]))[1] = pLookAhead->LookAhead[1]; - ((A_UINT8 *)(&pNextLookAheads[0]))[2] = pLookAhead->LookAhead[2]; - ((A_UINT8 *)(&pNextLookAheads[0]))[3] = pLookAhead->LookAhead[3]; - - if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_RECV)) { - DebugDumpBytes((A_UINT8 *)pNextLookAheads,4,"Next Look Ahead"); - } - /* just one normal lookahead */ - if (pNumLookAheads != NULL) { - *pNumLookAheads = 1; - } - } - break; - case HTC_RECORD_LOOKAHEAD_BUNDLE: - AR_DEBUG_ASSERT(pRecord->Length >= sizeof(HTC_BUNDLED_LOOKAHEAD_REPORT)); - if (pRecord->Length >= sizeof(HTC_BUNDLED_LOOKAHEAD_REPORT) && - (pNextLookAheads != NULL)) { - HTC_BUNDLED_LOOKAHEAD_REPORT *pBundledLookAheadRpt; - int i; - - pBundledLookAheadRpt = (HTC_BUNDLED_LOOKAHEAD_REPORT *)pRecordBuf; - - if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_RECV)) { - DebugDumpBytes(pRecordBuf,pRecord->Length,"Bundle LookAhead"); - } - - if ((pRecord->Length / (sizeof(HTC_BUNDLED_LOOKAHEAD_REPORT))) > - HTC_HOST_MAX_MSG_PER_BUNDLE) { - /* this should never happen, the target restricts the number - * of messages per bundle configured by the host */ - A_ASSERT(FALSE); - status = A_EPROTO; - break; - } - - for (i = 0; i < (int)(pRecord->Length / (sizeof(HTC_BUNDLED_LOOKAHEAD_REPORT))); i++) { - ((A_UINT8 *)(&pNextLookAheads[i]))[0] = pBundledLookAheadRpt->LookAhead[0]; - ((A_UINT8 *)(&pNextLookAheads[i]))[1] = pBundledLookAheadRpt->LookAhead[1]; - ((A_UINT8 *)(&pNextLookAheads[i]))[2] = pBundledLookAheadRpt->LookAhead[2]; - ((A_UINT8 *)(&pNextLookAheads[i]))[3] = pBundledLookAheadRpt->LookAhead[3]; - pBundledLookAheadRpt++; - } - - *pNumLookAheads = i; - } - break; - default: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, (" unhandled record: id:%d length:%d \n", - pRecord->RecordID, pRecord->Length)); - break; - } - - if (A_FAILED(status)) { - break; - } - - /* advance buffer past this record for next time around */ - pBuffer += pRecord->Length; - Length -= pRecord->Length; - } - - if (A_FAILED(status)) { - DebugDumpBytes(pOrigBuffer,origLength,"BAD Recv Trailer"); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("-HTCProcessTrailer \n")); - return status; - -} - -/* process a received message (i.e. strip off header, process any trailer data) - * note : locks must be released when this function is called */ -static A_STATUS HTCProcessRecvHeader(HTC_TARGET *target, - HTC_PACKET *pPacket, - A_UINT32 *pNextLookAheads, - int *pNumLookAheads) -{ - A_UINT8 temp; - A_UINT8 *pBuf; - A_STATUS status = A_OK; - A_UINT16 payloadLen; - A_UINT32 lookAhead; - - pBuf = pPacket->pBuffer; - - if (pNumLookAheads != NULL) { - *pNumLookAheads = 0; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("+HTCProcessRecvHeader \n")); - - if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_RECV)) { - AR_DEBUG_PRINTBUF(pBuf,pPacket->ActualLength,"HTC Recv PKT"); - } - - do { - /* note, we cannot assume the alignment of pBuffer, so we use the safe macros to - * retrieve 16 bit fields */ - payloadLen = A_GET_UINT16_FIELD(pBuf, HTC_FRAME_HDR, PayloadLen); - - ((A_UINT8 *)&lookAhead)[0] = pBuf[0]; - ((A_UINT8 *)&lookAhead)[1] = pBuf[1]; - ((A_UINT8 *)&lookAhead)[2] = pBuf[2]; - ((A_UINT8 *)&lookAhead)[3] = pBuf[3]; - - if (pPacket->PktInfo.AsRx.HTCRxFlags & HTC_RX_PKT_REFRESH_HDR) { - /* refresh expected hdr, since this was unknown at the time we grabbed the packets - * as part of a bundle */ - pPacket->PktInfo.AsRx.ExpectedHdr = lookAhead; - /* refresh actual length since we now have the real header */ - pPacket->ActualLength = payloadLen + HTC_HDR_LENGTH; - - /* validate the actual header that was refreshed */ - if (pPacket->ActualLength > pPacket->BufferLength) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("Refreshed HDR payload length (%d) in bundled RECV is invalid (hdr: 0x%X) \n", - payloadLen, lookAhead)); - /* limit this to max buffer just to print out some of the buffer */ - pPacket->ActualLength = min(pPacket->ActualLength, pPacket->BufferLength); - status = A_EPROTO; - break; - } - - if (pPacket->Endpoint != A_GET_UINT8_FIELD(pBuf, HTC_FRAME_HDR, EndpointID)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("Refreshed HDR endpoint (%d) does not match expected endpoint (%d) \n", - A_GET_UINT8_FIELD(pBuf, HTC_FRAME_HDR, EndpointID), pPacket->Endpoint)); - status = A_EPROTO; - break; - } - } - - if (lookAhead != pPacket->PktInfo.AsRx.ExpectedHdr) { - /* somehow the lookahead that gave us the full read length did not - * reflect the actual header in the pending message */ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("HTCProcessRecvHeader, lookahead mismatch! (pPkt:0x%lX flags:0x%X) \n", - (unsigned long)pPacket, pPacket->PktInfo.AsRx.HTCRxFlags)); -#ifdef ATH_DEBUG_MODULE - DebugDumpBytes((A_UINT8 *)&pPacket->PktInfo.AsRx.ExpectedHdr,4,"Expected Message LookAhead"); - DebugDumpBytes(pBuf,sizeof(HTC_FRAME_HDR),"Current Frame Header"); -#ifdef HTC_CAPTURE_LAST_FRAME - DebugDumpBytes((A_UINT8 *)&target->LastFrameHdr,sizeof(HTC_FRAME_HDR),"Last Frame Header"); - if (target->LastTrailerLength != 0) { - DebugDumpBytes(target->LastTrailer, - target->LastTrailerLength, - "Last trailer"); - } -#endif -#endif - status = A_EPROTO; - break; - } - - /* get flags */ - temp = A_GET_UINT8_FIELD(pBuf, HTC_FRAME_HDR, Flags); - - if (temp & HTC_FLAGS_RECV_TRAILER) { - /* this packet has a trailer */ - - /* extract the trailer length in control byte 0 */ - temp = A_GET_UINT8_FIELD(pBuf, HTC_FRAME_HDR, ControlBytes[0]); - - if ((temp < sizeof(HTC_RECORD_HDR)) || (temp > payloadLen)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("HTCProcessRecvHeader, invalid header (payloadlength should be :%d, CB[0] is:%d) \n", - payloadLen, temp)); - status = A_EPROTO; - break; - } - - if (pPacket->PktInfo.AsRx.HTCRxFlags & HTC_RX_PKT_IGNORE_LOOKAHEAD) { - /* this packet was fetched as part of an HTC bundle, the embedded lookahead is - * not valid since the next packet may have already been fetched as part of the - * bundle */ - pNextLookAheads = NULL; - pNumLookAheads = NULL; - } - - /* process trailer data that follows HDR + application payload */ - status = HTCProcessTrailer(target, - (pBuf + HTC_HDR_LENGTH + payloadLen - temp), - temp, - pNextLookAheads, - pNumLookAheads, - pPacket->Endpoint); - - if (A_FAILED(status)) { - break; - } - -#ifdef HTC_CAPTURE_LAST_FRAME - A_MEMCPY(target->LastTrailer, (pBuf + HTC_HDR_LENGTH + payloadLen - temp), temp); - target->LastTrailerLength = temp; -#endif - /* trim length by trailer bytes */ - pPacket->ActualLength -= temp; - } -#ifdef HTC_CAPTURE_LAST_FRAME - else { - target->LastTrailerLength = 0; - } -#endif - - /* if we get to this point, the packet is good */ - /* remove header and adjust length */ - pPacket->pBuffer += HTC_HDR_LENGTH; - pPacket->ActualLength -= HTC_HDR_LENGTH; - - } while (FALSE); - - if (A_FAILED(status)) { - /* dump the whole packet */ - DebugDumpBytes(pBuf,pPacket->ActualLength < 256 ? pPacket->ActualLength : 256 ,"BAD HTC Recv PKT"); - } else { -#ifdef HTC_CAPTURE_LAST_FRAME - A_MEMCPY(&target->LastFrameHdr,pBuf,sizeof(HTC_FRAME_HDR)); -#endif - if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_RECV)) { - if (pPacket->ActualLength > 0) { - AR_DEBUG_PRINTBUF(pPacket->pBuffer,pPacket->ActualLength,"HTC - Application Msg"); - } - } - } - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("-HTCProcessRecvHeader \n")); - return status; -} - -static INLINE void HTCAsyncRecvCheckMorePackets(HTC_TARGET *target, - A_UINT32 NextLookAheads[], - int NumLookAheads, - A_BOOL CheckMoreMsgs) -{ - /* was there a lookahead for the next packet? */ - if (NumLookAheads > 0) { - A_STATUS nextStatus; - int fetched = 0; - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, - ("HTCAsyncRecvCheckMorePackets - num lookaheads were non-zero : %d \n", - NumLookAheads)); - /* force status re-check */ - REF_IRQ_STATUS_RECHECK(&target->Device); - /* we have more packets, get the next packet fetch started */ - nextStatus = HTCRecvMessagePendingHandler(target, NextLookAheads, NumLookAheads, NULL, &fetched); - if (A_EPROTO == nextStatus) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("Next look ahead from recv header was INVALID\n")); - DebugDumpBytes((A_UINT8 *)NextLookAheads, - NumLookAheads * (sizeof(A_UINT32)), - "BAD lookaheads from lookahead report"); - } - if (A_SUCCESS(nextStatus) && !fetched) { - /* we could not fetch any more packets due to resources */ - DevAsyncIrqProcessComplete(&target->Device); - } - } else { - if (CheckMoreMsgs) { - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, - ("HTCAsyncRecvCheckMorePackets - rechecking for more messages...\n")); - /* if we did not get anything on the look-ahead, - * call device layer to asynchronously re-check for messages. If we can keep the async - * processing going we get better performance. If there is a pending message we will keep processing - * messages asynchronously which should pipeline things nicely */ - DevCheckPendingRecvMsgsAsync(&target->Device); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("HTCAsyncRecvCheckMorePackets - no check \n")); - } - } - - -} - - /* unload the recv completion queue */ -static INLINE void DrainRecvIndicationQueue(HTC_TARGET *target, HTC_ENDPOINT *pEndpoint) -{ - HTC_PACKET_QUEUE recvCompletions = { {0} }; - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("+DrainRecvIndicationQueue \n")); - - INIT_HTC_PACKET_QUEUE(&recvCompletions); - - LOCK_HTC_RX(target); - - /* increment rx processing count on entry */ - pEndpoint->RxProcessCount++; - if (pEndpoint->RxProcessCount > 1) { - pEndpoint->RxProcessCount--; - /* another thread or task is draining the RX completion queue on this endpoint - * that thread will reset the rx processing count when the queue is drained */ - UNLOCK_HTC_RX(target); - return; - } - - /******* at this point only 1 thread may enter ******/ - - while (TRUE) { - - /* transfer items from main recv queue to the local one so we can release the lock */ - HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(&recvCompletions, &pEndpoint->RecvIndicationQueue); - - if (HTC_QUEUE_EMPTY(&recvCompletions)) { - /* all drained */ - break; - } - - /* release lock while we do the recv completions - * other threads can now queue more recv completions */ - UNLOCK_HTC_RX(target); - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, - ("DrainRecvIndicationQueue : completing %d RECV packets \n", - HTC_PACKET_QUEUE_DEPTH(&recvCompletions))); - /* do completion */ - DO_RCV_COMPLETION(pEndpoint,&recvCompletions); - - /* re-acquire lock to grab some more completions */ - LOCK_HTC_RX(target); - } - - /* reset count */ - pEndpoint->RxProcessCount = 0; - UNLOCK_HTC_RX(target); - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("-DrainRecvIndicationQueue \n")); - -} - - /* optimization for recv packets, we can indicate a "hint" that there are more - * single-packets to fetch on this endpoint */ -#define SET_MORE_RX_PACKET_INDICATION_FLAG(L,N,E,P) \ - if ((N) > 0) { SetRxPacketIndicationFlags((L)[0],(E),(P)); } - - /* for bundled frames, we can force the flag to indicate there are more packets */ -#define FORCE_MORE_RX_PACKET_INDICATION_FLAG(P) \ - (P)->PktInfo.AsRx.IndicationFlags |= HTC_RX_FLAGS_INDICATE_MORE_PKTS; - - /* note: this function can be called with the RX lock held */ -static INLINE void SetRxPacketIndicationFlags(A_UINT32 LookAhead, - HTC_ENDPOINT *pEndpoint, - HTC_PACKET *pPacket) -{ - HTC_FRAME_HDR *pHdr = (HTC_FRAME_HDR *)&LookAhead; - /* check to see if the "next" packet is from the same endpoint of the - completing packet */ - if (pHdr->EndpointID == pPacket->Endpoint) { - /* check that there is a buffer available to actually fetch it */ - if (!HTC_QUEUE_EMPTY(&pEndpoint->RxBuffers)) { - /* provide a hint that there are more RX packets to fetch */ - FORCE_MORE_RX_PACKET_INDICATION_FLAG(pPacket); - } - } -} - - -/* asynchronous completion handler for recv packet fetching, when the device layer - * completes a read request, it will call this completion handler */ -void HTCRecvCompleteHandler(void *Context, HTC_PACKET *pPacket) -{ - HTC_TARGET *target = (HTC_TARGET *)Context; - HTC_ENDPOINT *pEndpoint; - A_UINT32 nextLookAheads[HTC_HOST_MAX_MSG_PER_BUNDLE]; - int numLookAheads = 0; - A_STATUS status; - A_BOOL checkMorePkts = TRUE; - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("+HTCRecvCompleteHandler (pkt:0x%lX, status:%d, ep:%d) \n", - (unsigned long)pPacket, pPacket->Status, pPacket->Endpoint)); - - A_ASSERT(!IS_DEV_IRQ_PROC_SYNC_MODE(&target->Device)); - AR_DEBUG_ASSERT(pPacket->Endpoint < ENDPOINT_MAX); - pEndpoint = &target->EndPoint[pPacket->Endpoint]; - pPacket->Completion = NULL; - - /* get completion status */ - status = pPacket->Status; - - do { - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("HTCRecvCompleteHandler: request failed (status:%d, ep:%d) \n", - pPacket->Status, pPacket->Endpoint)); - break; - } - /* process the header for any trailer data */ - status = HTCProcessRecvHeader(target,pPacket,nextLookAheads,&numLookAheads); - - if (A_FAILED(status)) { - break; - } - - if (pPacket->PktInfo.AsRx.HTCRxFlags & HTC_RX_PKT_IGNORE_LOOKAHEAD) { - /* this packet was part of a bundle that had to be broken up. - * It was fetched one message at a time. There may be other asynchronous reads queued behind this one. - * Do no issue another check for more packets since the last one in the series of requests - * will handle it */ - checkMorePkts = FALSE; - } - - DUMP_RECV_PKT_INFO(pPacket); - LOCK_HTC_RX(target); - SET_MORE_RX_PACKET_INDICATION_FLAG(nextLookAheads,numLookAheads,pEndpoint,pPacket); - /* we have a good packet, queue it to the completion queue */ - HTC_PACKET_ENQUEUE(&pEndpoint->RecvIndicationQueue,pPacket); - HTC_RX_STAT_PROFILE(target,pEndpoint,numLookAheads); - UNLOCK_HTC_RX(target); - - /* check for more recv packets before indicating */ - HTCAsyncRecvCheckMorePackets(target,nextLookAheads,numLookAheads,checkMorePkts); - - } while (FALSE); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("HTCRecvCompleteHandler , message fetch failed (status = %d) \n", - status)); - /* recycle this packet */ - HTC_RECYCLE_RX_PKT(target, pPacket, pEndpoint); - } else { - /* a good packet was queued, drain the queue */ - DrainRecvIndicationQueue(target,pEndpoint); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("-HTCRecvCompleteHandler\n")); -} - -/* synchronously wait for a control message from the target, - * This function is used at initialization time ONLY. At init messages - * on ENDPOINT 0 are expected. */ -A_STATUS HTCWaitforControlMessage(HTC_TARGET *target, HTC_PACKET **ppControlPacket) -{ - A_STATUS status; - A_UINT32 lookAhead; - HTC_PACKET *pPacket = NULL; - HTC_FRAME_HDR *pHdr; - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+HTCWaitforControlMessage \n")); - - do { - - *ppControlPacket = NULL; - - /* call the polling function to see if we have a message */ - status = DevPollMboxMsgRecv(&target->Device, - &lookAhead, - HTC_TARGET_RESPONSE_TIMEOUT); - - if (A_FAILED(status)) { - break; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, - ("HTCWaitforControlMessage : lookAhead : 0x%X \n", lookAhead)); - - /* check the lookahead */ - pHdr = (HTC_FRAME_HDR *)&lookAhead; - - if (pHdr->EndpointID != ENDPOINT_0) { - /* unexpected endpoint number, should be zero */ - AR_DEBUG_ASSERT(FALSE); - status = A_EPROTO; - break; - } - - if (A_FAILED(status)) { - /* bad message */ - AR_DEBUG_ASSERT(FALSE); - status = A_EPROTO; - break; - } - - pPacket = HTC_ALLOC_CONTROL_RX(target); - - if (pPacket == NULL) { - AR_DEBUG_ASSERT(FALSE); - status = A_NO_MEMORY; - break; - } - - pPacket->PktInfo.AsRx.HTCRxFlags = 0; - pPacket->PktInfo.AsRx.ExpectedHdr = lookAhead; - pPacket->ActualLength = pHdr->PayloadLen + HTC_HDR_LENGTH; - - if (pPacket->ActualLength > pPacket->BufferLength) { - AR_DEBUG_ASSERT(FALSE); - status = A_EPROTO; - break; - } - - /* we want synchronous operation */ - pPacket->Completion = NULL; - - /* get the message from the device, this will block */ - status = HTCIssueRecv(target, pPacket); - - if (A_FAILED(status)) { - break; - } - - /* process receive header */ - status = HTCProcessRecvHeader(target,pPacket,NULL,NULL); - - pPacket->Status = status; - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("HTCWaitforControlMessage, HTCProcessRecvHeader failed (status = %d) \n", - status)); - break; - } - - /* give the caller this control message packet, they are responsible to free */ - *ppControlPacket = pPacket; - - } while (FALSE); - - if (A_FAILED(status)) { - if (pPacket != NULL) { - /* cleanup buffer on error */ - HTC_FREE_CONTROL_RX(target,pPacket); - } - } - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("-HTCWaitforControlMessage \n")); - - return status; -} - -static A_STATUS AllocAndPrepareRxPackets(HTC_TARGET *target, - A_UINT32 LookAheads[], - int Messages, - HTC_ENDPOINT *pEndpoint, - HTC_PACKET_QUEUE *pQueue) -{ - A_STATUS status = A_OK; - HTC_PACKET *pPacket; - HTC_FRAME_HDR *pHdr; - int i,j; - int numMessages; - int fullLength; - A_BOOL noRecycle; - - /* lock RX while we assemble the packet buffers */ - LOCK_HTC_RX(target); - - for (i = 0; i < Messages; i++) { - - pHdr = (HTC_FRAME_HDR *)&LookAheads[i]; - - if (pHdr->EndpointID >= ENDPOINT_MAX) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Invalid Endpoint in look-ahead: %d \n",pHdr->EndpointID)); - /* invalid endpoint */ - status = A_EPROTO; - break; - } - - if (pHdr->EndpointID != pEndpoint->Id) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Invalid Endpoint in look-ahead: %d should be : %d (index:%d)\n", - pHdr->EndpointID, pEndpoint->Id, i)); - /* invalid endpoint */ - status = A_EPROTO; - break; - } - - if (pHdr->PayloadLen > HTC_MAX_PAYLOAD_LENGTH) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Payload length %d exceeds max HTC : %d !\n", - pHdr->PayloadLen, (A_UINT32)HTC_MAX_PAYLOAD_LENGTH)); - status = A_EPROTO; - break; - } - - if (0 == pEndpoint->ServiceID) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Endpoint %d is not connected !\n",pHdr->EndpointID)); - /* endpoint isn't even connected */ - status = A_EPROTO; - break; - } - - if ((pHdr->Flags & HTC_FLAGS_RECV_BUNDLE_CNT_MASK) == 0) { - /* HTC header only indicates 1 message to fetch */ - numMessages = 1; - } else { - /* HTC header indicates that every packet to follow has the same padded length so that it can - * be optimally fetched as a full bundle */ - numMessages = (pHdr->Flags & HTC_FLAGS_RECV_BUNDLE_CNT_MASK) >> HTC_FLAGS_RECV_BUNDLE_CNT_SHIFT; - /* the count doesn't include the starter frame, just a count of frames to follow */ - numMessages++; - A_ASSERT(numMessages <= target->MaxMsgPerBundle); - INC_HTC_EP_STAT(pEndpoint, RxBundleIndFromHdr, 1); - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, - ("HTC header indicates :%d messages can be fetched as a bundle \n",numMessages)); - } - - fullLength = DEV_CALC_RECV_PADDED_LEN(&target->Device,pHdr->PayloadLen + sizeof(HTC_FRAME_HDR)); - - /* get packet buffers for each message, if there was a bundle detected in the header, - * use pHdr as a template to fetch all packets in the bundle */ - for (j = 0; j < numMessages; j++) { - - /* reset flag, any packets allocated using the RecvAlloc() API cannot be recycled on cleanup, - * they must be explicitly returned */ - noRecycle = FALSE; - - if (pEndpoint->EpCallBacks.EpRecvAlloc != NULL) { - UNLOCK_HTC_RX(target); - noRecycle = TRUE; - /* user is using a per-packet allocation callback */ - pPacket = pEndpoint->EpCallBacks.EpRecvAlloc(pEndpoint->EpCallBacks.pContext, - pEndpoint->Id, - fullLength); - LOCK_HTC_RX(target); - - } else if ((pEndpoint->EpCallBacks.EpRecvAllocThresh != NULL) && - (fullLength > pEndpoint->EpCallBacks.RecvAllocThreshold)) { - INC_HTC_EP_STAT(pEndpoint,RxAllocThreshHit,1); - INC_HTC_EP_STAT(pEndpoint,RxAllocThreshBytes,pHdr->PayloadLen); - /* threshold was hit, call the special recv allocation callback */ - UNLOCK_HTC_RX(target); - noRecycle = TRUE; - /* user wants to allocate packets above a certain threshold */ - pPacket = pEndpoint->EpCallBacks.EpRecvAllocThresh(pEndpoint->EpCallBacks.pContext, - pEndpoint->Id, - fullLength); - LOCK_HTC_RX(target); - - } else { - /* user is using a refill handler that can refill multiple HTC buffers */ - - /* get a packet from the endpoint recv queue */ - pPacket = HTC_PACKET_DEQUEUE(&pEndpoint->RxBuffers); - - if (NULL == pPacket) { - /* check for refill handler */ - if (pEndpoint->EpCallBacks.EpRecvRefill != NULL) { - UNLOCK_HTC_RX(target); - /* call the re-fill handler */ - pEndpoint->EpCallBacks.EpRecvRefill(pEndpoint->EpCallBacks.pContext, - pEndpoint->Id); - LOCK_HTC_RX(target); - /* check if we have more buffers */ - pPacket = HTC_PACKET_DEQUEUE(&pEndpoint->RxBuffers); - /* fall through */ - } - } - } - - if (NULL == pPacket) { - /* this is not an error, we simply need to mark that we are waiting for buffers.*/ - target->RecvStateFlags |= HTC_RECV_WAIT_BUFFERS; - target->EpWaitingForBuffers = pEndpoint->Id; - status = A_NO_RESOURCE; - break; - } - - AR_DEBUG_ASSERT(pPacket->Endpoint == pEndpoint->Id); - /* clear flags */ - pPacket->PktInfo.AsRx.HTCRxFlags = 0; - pPacket->PktInfo.AsRx.IndicationFlags = 0; - pPacket->Status = A_OK; - - if (noRecycle) { - /* flag that these packets cannot be recycled, they have to be returned to the - * user */ - pPacket->PktInfo.AsRx.HTCRxFlags |= HTC_RX_PKT_NO_RECYCLE; - } - /* add packet to queue (also incase we need to cleanup down below) */ - HTC_PACKET_ENQUEUE(pQueue,pPacket); - - if (HTC_STOPPING(target)) { - status = A_ECANCELED; - break; - } - - /* make sure this message can fit in the endpoint buffer */ - if ((A_UINT32)fullLength > pPacket->BufferLength) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("Payload Length Error : header reports payload of: %d (%d) endpoint buffer size: %d \n", - pHdr->PayloadLen, fullLength, pPacket->BufferLength)); - status = A_EPROTO; - break; - } - - if (j > 0) { - /* for messages fetched in a bundle the expected lookahead is unknown since we - * are only using the lookahead of the first packet as a template of what to - * expect for lengths */ - /* flag that once we get the real HTC header we need to refesh the information */ - pPacket->PktInfo.AsRx.HTCRxFlags |= HTC_RX_PKT_REFRESH_HDR; - /* set it to something invalid */ - pPacket->PktInfo.AsRx.ExpectedHdr = 0xFFFFFFFF; - } else { - - pPacket->PktInfo.AsRx.ExpectedHdr = LookAheads[i]; /* set expected look ahead */ - } - /* set the amount of data to fetch */ - pPacket->ActualLength = pHdr->PayloadLen + HTC_HDR_LENGTH; - } - - if (A_FAILED(status)) { - if (A_NO_RESOURCE == status) { - /* this is actually okay */ - status = A_OK; - } - break; - } - - } - - UNLOCK_HTC_RX(target); - - if (A_FAILED(status)) { - while (!HTC_QUEUE_EMPTY(pQueue)) { - pPacket = HTC_PACKET_DEQUEUE(pQueue); - /* recycle all allocated packets */ - HTC_RECYCLE_RX_PKT(target,pPacket,&target->EndPoint[pPacket->Endpoint]); - } - } - - return status; -} - -static void HTCAsyncRecvScatterCompletion(HIF_SCATTER_REQ *pScatterReq) -{ - int i; - HTC_PACKET *pPacket; - HTC_ENDPOINT *pEndpoint; - A_UINT32 lookAheads[HTC_HOST_MAX_MSG_PER_BUNDLE]; - int numLookAheads = 0; - HTC_TARGET *target = (HTC_TARGET *)pScatterReq->Context; - A_STATUS status; - A_BOOL partialBundle = FALSE; - HTC_PACKET_QUEUE localRecvQueue = { {0} }; - A_BOOL procError = FALSE; - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+HTCAsyncRecvScatterCompletion TotLen: %d Entries: %d\n", - pScatterReq->TotalLength, pScatterReq->ValidScatterEntries)); - - A_ASSERT(!IS_DEV_IRQ_PROC_SYNC_MODE(&target->Device)); - - if (A_FAILED(pScatterReq->CompletionStatus)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("** Recv Scatter Request Failed: %d \n",pScatterReq->CompletionStatus)); - } - - if (pScatterReq->CallerFlags & HTC_SCATTER_REQ_FLAGS_PARTIAL_BUNDLE) { - partialBundle = TRUE; - } - - DEV_FINISH_SCATTER_OPERATION(pScatterReq); - - INIT_HTC_PACKET_QUEUE(&localRecvQueue); - - pPacket = (HTC_PACKET *)pScatterReq->ScatterList[0].pCallerContexts[0]; - /* note: all packets in a scatter req are for the same endpoint ! */ - pEndpoint = &target->EndPoint[pPacket->Endpoint]; - - /* walk through the scatter list and process */ - /* **** NOTE: DO NOT HOLD ANY LOCKS here, HTCProcessRecvHeader can take the TX lock - * as it processes credit reports */ - for (i = 0; i < pScatterReq->ValidScatterEntries; i++) { - pPacket = (HTC_PACKET *)pScatterReq->ScatterList[i].pCallerContexts[0]; - A_ASSERT(pPacket != NULL); - /* reset count, we are only interested in the look ahead in the last packet when we - * break out of this loop */ - numLookAheads = 0; - - if (A_SUCCESS(pScatterReq->CompletionStatus)) { - /* process header for each of the recv packets */ - status = HTCProcessRecvHeader(target,pPacket,lookAheads,&numLookAheads); - } else { - status = A_ERROR; - } - - if (A_SUCCESS(status)) { -#ifdef HTC_EP_STAT_PROFILING - LOCK_HTC_RX(target); - HTC_RX_STAT_PROFILE(target,pEndpoint,numLookAheads); - INC_HTC_EP_STAT(pEndpoint, RxPacketsBundled, 1); - UNLOCK_HTC_RX(target); -#endif - if (i == (pScatterReq->ValidScatterEntries - 1)) { - /* last packet's more packets flag is set based on the lookahead */ - SET_MORE_RX_PACKET_INDICATION_FLAG(lookAheads,numLookAheads,pEndpoint,pPacket); - } else { - /* packets in a bundle automatically have this flag set */ - FORCE_MORE_RX_PACKET_INDICATION_FLAG(pPacket); - } - - DUMP_RECV_PKT_INFO(pPacket); - /* since we can't hold a lock in this loop, we insert into our local recv queue for - * storage until we can transfer them to the recv completion queue */ - HTC_PACKET_ENQUEUE(&localRecvQueue,pPacket); - - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" Recv packet scatter entry %d failed (out of %d) \n", - i, pScatterReq->ValidScatterEntries)); - /* recycle failed recv */ - HTC_RECYCLE_RX_PKT(target, pPacket, pEndpoint); - /* set flag and continue processing the remaining scatter entries */ - procError = TRUE; - } - - } - - /* free scatter request */ - DEV_FREE_SCATTER_REQ(&target->Device,pScatterReq); - - LOCK_HTC_RX(target); - /* transfer the packets in the local recv queue to the recv completion queue */ - HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(&pEndpoint->RecvIndicationQueue, &localRecvQueue); - - UNLOCK_HTC_RX(target); - - if (!procError) { - /* pipeline the next check (asynchronously) for more packets */ - HTCAsyncRecvCheckMorePackets(target, - lookAheads, - numLookAheads, - partialBundle ? FALSE : TRUE); - } - - /* now drain the indication queue */ - DrainRecvIndicationQueue(target,pEndpoint); - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("-HTCAsyncRecvScatterCompletion \n")); -} - -static A_STATUS HTCIssueRecvPacketBundle(HTC_TARGET *target, - HTC_PACKET_QUEUE *pRecvPktQueue, - HTC_PACKET_QUEUE *pSyncCompletionQueue, - int *pNumPacketsFetched, - A_BOOL PartialBundle) -{ - A_STATUS status = A_OK; - HIF_SCATTER_REQ *pScatterReq; - int i, totalLength; - int pktsToScatter; - HTC_PACKET *pPacket; - A_BOOL asyncMode = (pSyncCompletionQueue == NULL) ? TRUE : FALSE; - int scatterSpaceRemaining = DEV_GET_MAX_BUNDLE_RECV_LENGTH(&target->Device); - - pktsToScatter = HTC_PACKET_QUEUE_DEPTH(pRecvPktQueue); - pktsToScatter = min(pktsToScatter, target->MaxMsgPerBundle); - - if ((HTC_PACKET_QUEUE_DEPTH(pRecvPktQueue) - pktsToScatter) > 0) { - /* we were forced to split this bundle receive operation - * all packets in this partial bundle must have their lookaheads ignored */ - PartialBundle = TRUE; - /* this would only happen if the target ignored our max bundle limit */ - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, - ("HTCIssueRecvPacketBundle : partial bundle detected num:%d , %d \n", - HTC_PACKET_QUEUE_DEPTH(pRecvPktQueue), pktsToScatter)); - } - - totalLength = 0; - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+HTCIssueRecvPacketBundle (Numpackets: %d , actual : %d) \n", - HTC_PACKET_QUEUE_DEPTH(pRecvPktQueue), pktsToScatter)); - - do { - - pScatterReq = DEV_ALLOC_SCATTER_REQ(&target->Device); - - if (pScatterReq == NULL) { - /* no scatter resources left, just let caller handle it the legacy way */ - break; - } - - pScatterReq->CallerFlags = 0; - - if (PartialBundle) { - /* mark that this is a partial bundle, this has special ramifications to the - * scatter completion routine */ - pScatterReq->CallerFlags |= HTC_SCATTER_REQ_FLAGS_PARTIAL_BUNDLE; - } - - /* convert HTC packets to scatter list */ - for (i = 0; i < pktsToScatter; i++) { - int paddedLength; - - pPacket = HTC_PACKET_DEQUEUE(pRecvPktQueue); - A_ASSERT(pPacket != NULL); - - paddedLength = DEV_CALC_RECV_PADDED_LEN(&target->Device, pPacket->ActualLength); - - if ((scatterSpaceRemaining - paddedLength) < 0) { - /* exceeds what we can transfer, put the packet back */ - HTC_PACKET_ENQUEUE_TO_HEAD(pRecvPktQueue,pPacket); - break; - } - - scatterSpaceRemaining -= paddedLength; - - if (PartialBundle || (i < (pktsToScatter - 1))) { - /* packet 0..n-1 cannot be checked for look-aheads since we are fetching a bundle - * the last packet however can have it's lookahead used */ - pPacket->PktInfo.AsRx.HTCRxFlags |= HTC_RX_PKT_IGNORE_LOOKAHEAD; - } - - /* note: 1 HTC packet per scatter entry */ - /* setup packet into */ - pScatterReq->ScatterList[i].pBuffer = pPacket->pBuffer; - pScatterReq->ScatterList[i].Length = paddedLength; - - pPacket->PktInfo.AsRx.HTCRxFlags |= HTC_RX_PKT_PART_OF_BUNDLE; - - if (asyncMode) { - /* save HTC packet for async completion routine */ - pScatterReq->ScatterList[i].pCallerContexts[0] = pPacket; - } else { - /* queue to caller's sync completion queue, caller will unload this when we return */ - HTC_PACKET_ENQUEUE(pSyncCompletionQueue,pPacket); - } - - A_ASSERT(pScatterReq->ScatterList[i].Length); - totalLength += pScatterReq->ScatterList[i].Length; - } - - pScatterReq->TotalLength = totalLength; - pScatterReq->ValidScatterEntries = i; - - if (asyncMode) { - pScatterReq->CompletionRoutine = HTCAsyncRecvScatterCompletion; - pScatterReq->Context = target; - } - - status = DevSubmitScatterRequest(&target->Device, pScatterReq, DEV_SCATTER_READ, asyncMode); - - if (A_SUCCESS(status)) { - *pNumPacketsFetched = i; - } - - if (!asyncMode) { - /* free scatter request */ - DEV_FREE_SCATTER_REQ(&target->Device, pScatterReq); - } - - } while (FALSE); - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("-HTCIssueRecvPacketBundle (status:%d) (fetched:%d) \n", - status,*pNumPacketsFetched)); - - return status; -} - -static INLINE void CheckRecvWaterMark(HTC_ENDPOINT *pEndpoint) -{ - /* see if endpoint is using a refill watermark - * ** no need to use a lock here, since we are only inspecting... - * caller may must not hold locks when calling this function */ - if (pEndpoint->EpCallBacks.RecvRefillWaterMark > 0) { - if (HTC_PACKET_QUEUE_DEPTH(&pEndpoint->RxBuffers) < pEndpoint->EpCallBacks.RecvRefillWaterMark) { - /* call the re-fill handler before we continue */ - pEndpoint->EpCallBacks.EpRecvRefill(pEndpoint->EpCallBacks.pContext, - pEndpoint->Id); - } - } -} - -/* callback when device layer or lookahead report parsing detects a pending message */ -A_STATUS HTCRecvMessagePendingHandler(void *Context, A_UINT32 MsgLookAheads[], int NumLookAheads, A_BOOL *pAsyncProc, int *pNumPktsFetched) -{ - HTC_TARGET *target = (HTC_TARGET *)Context; - A_STATUS status = A_OK; - HTC_PACKET *pPacket; - HTC_ENDPOINT *pEndpoint; - A_BOOL asyncProc = FALSE; - A_UINT32 lookAheads[HTC_HOST_MAX_MSG_PER_BUNDLE]; - int pktsFetched; - HTC_PACKET_QUEUE recvPktQueue = { {0} }; - HTC_PACKET_QUEUE syncCompletedPktsQueue = { {0} }; - A_BOOL partialBundle; - HTC_ENDPOINT_ID id; - int totalFetched = 0; - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+HTCRecvMessagePendingHandler NumLookAheads: %d \n",NumLookAheads)); - - if (pNumPktsFetched != NULL) { - *pNumPktsFetched = 0; - } - - if (IS_DEV_IRQ_PROCESSING_ASYNC_ALLOWED(&target->Device)) { - /* We use async mode to get the packets if the device layer supports it. - * The device layer interfaces with HIF in which HIF may have restrictions on - * how interrupts are processed */ - asyncProc = TRUE; - } - - if (pAsyncProc != NULL) { - /* indicate to caller how we decided to process this */ - *pAsyncProc = asyncProc; - } - - if (NumLookAheads > HTC_HOST_MAX_MSG_PER_BUNDLE) { - A_ASSERT(FALSE); - return A_EPROTO; - } - - /* on first entry copy the lookaheads into our temp array for processing */ - A_MEMCPY(lookAheads, MsgLookAheads, (sizeof(A_UINT32)) * NumLookAheads); - - while (TRUE) { - - /* reset packets queues */ - INIT_HTC_PACKET_QUEUE(&recvPktQueue); - INIT_HTC_PACKET_QUEUE(&syncCompletedPktsQueue); - - if (NumLookAheads > HTC_HOST_MAX_MSG_PER_BUNDLE) { - status = A_EPROTO; - A_ASSERT(FALSE); - break; - } - - /* first lookahead sets the expected endpoint IDs for all packets in a bundle */ - id = ((HTC_FRAME_HDR *)&lookAheads[0])->EndpointID; - pEndpoint = &target->EndPoint[id]; - - if (id >= ENDPOINT_MAX) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("MsgPend, Invalid Endpoint in look-ahead: %d \n",id)); - status = A_EPROTO; - break; - } - - /* try to allocate as many HTC RX packets indicated by the lookaheads - * these packets are stored in the recvPkt queue */ - status = AllocAndPrepareRxPackets(target, - lookAheads, - NumLookAheads, - pEndpoint, - &recvPktQueue); - if (A_FAILED(status)) { - break; - } - - if (HTC_PACKET_QUEUE_DEPTH(&recvPktQueue) >= 2) { - /* a recv bundle was detected, force IRQ status re-check again */ - REF_IRQ_STATUS_RECHECK(&target->Device); - } - - totalFetched += HTC_PACKET_QUEUE_DEPTH(&recvPktQueue); - - /* we've got packet buffers for all we can currently fetch, - * this count is not valid anymore */ - NumLookAheads = 0; - partialBundle = FALSE; - - /* now go fetch the list of HTC packets */ - while (!HTC_QUEUE_EMPTY(&recvPktQueue)) { - - pktsFetched = 0; - - if (target->RecvBundlingEnabled && (HTC_PACKET_QUEUE_DEPTH(&recvPktQueue) > 1)) { - /* there are enough packets to attempt a bundle transfer and recv bundling is allowed */ - status = HTCIssueRecvPacketBundle(target, - &recvPktQueue, - asyncProc ? NULL : &syncCompletedPktsQueue, - &pktsFetched, - partialBundle); - if (A_FAILED(status)) { - break; - } - - if (HTC_PACKET_QUEUE_DEPTH(&recvPktQueue) != 0) { - /* we couldn't fetch all packets at one time, this creates a broken - * bundle */ - partialBundle = TRUE; - } - } - - /* see if the previous operation fetched any packets using bundling */ - if (0 == pktsFetched) { - /* dequeue one packet */ - pPacket = HTC_PACKET_DEQUEUE(&recvPktQueue); - A_ASSERT(pPacket != NULL); - - if (asyncProc) { - /* we use async mode to get the packet if the device layer supports it - * set our callback and context */ - pPacket->Completion = HTCRecvCompleteHandler; - pPacket->pContext = target; - } else { - /* fully synchronous */ - pPacket->Completion = NULL; - } - - if (HTC_PACKET_QUEUE_DEPTH(&recvPktQueue) > 0) { - /* lookaheads in all packets except the last one in the bundle must be ignored */ - pPacket->PktInfo.AsRx.HTCRxFlags |= HTC_RX_PKT_IGNORE_LOOKAHEAD; - } - - /* go fetch the packet */ - status = HTCIssueRecv(target, pPacket); - if (A_FAILED(status)) { - break; - } - - if (!asyncProc) { - /* sent synchronously, queue this packet for synchronous completion */ - HTC_PACKET_ENQUEUE(&syncCompletedPktsQueue,pPacket); - } - - } - - } - - if (A_SUCCESS(status)) { - CheckRecvWaterMark(pEndpoint); - } - - if (asyncProc) { - /* we did this asynchronously so we can get out of the loop, the asynch processing - * creates a chain of requests to continue processing pending messages in the - * context of callbacks */ - break; - } - - /* synchronous handling */ - if (target->Device.DSRCanYield) { - /* for the SYNC case, increment count that tracks when the DSR should yield */ - target->Device.CurrentDSRRecvCount++; - } - - /* in the sync case, all packet buffers are now filled, - * we can process each packet, check lookaheads and then repeat */ - - /* unload sync completion queue */ - while (!HTC_QUEUE_EMPTY(&syncCompletedPktsQueue)) { - HTC_PACKET_QUEUE container; - - pPacket = HTC_PACKET_DEQUEUE(&syncCompletedPktsQueue); - A_ASSERT(pPacket != NULL); - - pEndpoint = &target->EndPoint[pPacket->Endpoint]; - /* reset count on each iteration, we are only interested in the last packet's lookahead - * information when we break out of this loop */ - NumLookAheads = 0; - /* process header for each of the recv packets - * note: the lookahead of the last packet is useful for us to continue in this loop */ - status = HTCProcessRecvHeader(target,pPacket,lookAheads,&NumLookAheads); - if (A_FAILED(status)) { - break; - } - - if (HTC_QUEUE_EMPTY(&syncCompletedPktsQueue)) { - /* last packet's more packets flag is set based on the lookahead */ - SET_MORE_RX_PACKET_INDICATION_FLAG(lookAheads,NumLookAheads,pEndpoint,pPacket); - } else { - /* packets in a bundle automatically have this flag set */ - FORCE_MORE_RX_PACKET_INDICATION_FLAG(pPacket); - } - /* good packet, indicate it */ - HTC_RX_STAT_PROFILE(target,pEndpoint,NumLookAheads); - - if (pPacket->PktInfo.AsRx.HTCRxFlags & HTC_RX_PKT_PART_OF_BUNDLE) { - INC_HTC_EP_STAT(pEndpoint, RxPacketsBundled, 1); - } - - INIT_HTC_PACKET_QUEUE_AND_ADD(&container,pPacket); - DO_RCV_COMPLETION(pEndpoint,&container); - } - - if (A_FAILED(status)) { - break; - } - - if (NumLookAheads == 0) { - /* no more look aheads */ - break; - } - - /* when we process recv synchronously we need to check if we should yield and stop - * fetching more packets indicated by the embedded lookaheads */ - if (target->Device.DSRCanYield) { - if (DEV_CHECK_RECV_YIELD(&target->Device)) { - /* break out, don't fetch any more packets */ - break; - } - } - - - /* check whether other OS contexts have queued any WMI command/data for WLAN. - * This check is needed only if WLAN Tx and Rx happens in same thread context */ - A_CHECK_DRV_TX(); - - /* for SYNCH processing, if we get here, we are running through the loop again due to a detected lookahead. - * Set flag that we should re-check IRQ status registers again before leaving IRQ processing, - * this can net better performance in high throughput situations */ - REF_IRQ_STATUS_RECHECK(&target->Device); - } - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("Failed to get pending recv messages (%d) \n",status)); - /* cleanup any packets we allocated but didn't use to actually fetch any packets */ - while (!HTC_QUEUE_EMPTY(&recvPktQueue)) { - pPacket = HTC_PACKET_DEQUEUE(&recvPktQueue); - /* clean up packets */ - HTC_RECYCLE_RX_PKT(target, pPacket, &target->EndPoint[pPacket->Endpoint]); - } - /* cleanup any packets in sync completion queue */ - while (!HTC_QUEUE_EMPTY(&syncCompletedPktsQueue)) { - pPacket = HTC_PACKET_DEQUEUE(&syncCompletedPktsQueue); - /* clean up packets */ - HTC_RECYCLE_RX_PKT(target, pPacket, &target->EndPoint[pPacket->Endpoint]); - } - if (HTC_STOPPING(target)) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, - (" Host is going to stop. blocking receiver for HTCStop.. \n")); - DevStopRecv(&target->Device, asyncProc ? DEV_STOP_RECV_ASYNC : DEV_STOP_RECV_SYNC); - } - } - /* before leaving, check to see if host ran out of buffers and needs to stop the - * receiver */ - if (target->RecvStateFlags & HTC_RECV_WAIT_BUFFERS) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, - (" Host has no RX buffers, blocking receiver to prevent overrun.. \n")); - /* try to stop receive at the device layer */ - DevStopRecv(&target->Device, asyncProc ? DEV_STOP_RECV_ASYNC : DEV_STOP_RECV_SYNC); - } - - if (pNumPktsFetched != NULL) { - *pNumPktsFetched = totalFetched; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("-HTCRecvMessagePendingHandler \n")); - - return status; -} - -A_STATUS HTCAddReceivePktMultiple(HTC_HANDLE HTCHandle, HTC_PACKET_QUEUE *pPktQueue) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - HTC_ENDPOINT *pEndpoint; - A_BOOL unblockRecv = FALSE; - A_STATUS status = A_OK; - HTC_PACKET *pFirstPacket; - - pFirstPacket = HTC_GET_PKT_AT_HEAD(pPktQueue); - - if (NULL == pFirstPacket) { - A_ASSERT(FALSE); - return A_EINVAL; - } - - AR_DEBUG_ASSERT(pFirstPacket->Endpoint < ENDPOINT_MAX); - - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, - ("+- HTCAddReceivePktMultiple : endPointId: %d, cnt:%d, length: %d\n", - pFirstPacket->Endpoint, - HTC_PACKET_QUEUE_DEPTH(pPktQueue), - pFirstPacket->BufferLength)); - - do { - - pEndpoint = &target->EndPoint[pFirstPacket->Endpoint]; - - LOCK_HTC_RX(target); - - if (HTC_STOPPING(target)) { - HTC_PACKET *pPacket; - - UNLOCK_HTC_RX(target); - - /* walk through queue and mark each one canceled */ - HTC_PACKET_QUEUE_ITERATE_ALLOW_REMOVE(pPktQueue,pPacket) { - pPacket->Status = A_ECANCELED; - } HTC_PACKET_QUEUE_ITERATE_END; - - DO_RCV_COMPLETION(pEndpoint,pPktQueue); - break; - } - - /* store receive packets */ - HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(&pEndpoint->RxBuffers, pPktQueue); - - /* check if we are blocked waiting for a new buffer */ - if (target->RecvStateFlags & HTC_RECV_WAIT_BUFFERS) { - if (target->EpWaitingForBuffers == pFirstPacket->Endpoint) { - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,(" receiver was blocked on ep:%d, unblocking.. \n", - target->EpWaitingForBuffers)); - target->RecvStateFlags &= ~HTC_RECV_WAIT_BUFFERS; - target->EpWaitingForBuffers = ENDPOINT_MAX; - unblockRecv = TRUE; - } - } - - UNLOCK_HTC_RX(target); - - if (unblockRecv && !HTC_STOPPING(target)) { - /* TODO : implement a buffer threshold count? */ - DevEnableRecv(&target->Device,DEV_ENABLE_RECV_SYNC); - } - - } while (FALSE); - - return status; -} - -/* Makes a buffer available to the HTC module */ -A_STATUS HTCAddReceivePkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket) -{ - HTC_PACKET_QUEUE queue = { {0} }; - INIT_HTC_PACKET_QUEUE_AND_ADD(&queue,pPacket); - return HTCAddReceivePktMultiple(HTCHandle, &queue); -} - -void HTCUnblockRecv(HTC_HANDLE HTCHandle) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - A_BOOL unblockRecv = FALSE; - - LOCK_HTC_RX(target); - - /* check if we are blocked waiting for a new buffer */ - if (target->RecvStateFlags & HTC_RECV_WAIT_BUFFERS) { - AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("HTCUnblockRx : receiver was blocked on ep:%d, unblocking.. \n", - target->EpWaitingForBuffers)); - target->RecvStateFlags &= ~HTC_RECV_WAIT_BUFFERS; - target->EpWaitingForBuffers = ENDPOINT_MAX; - unblockRecv = TRUE; - } - - UNLOCK_HTC_RX(target); - - if (unblockRecv && !HTC_STOPPING(target)) { - /* re-enable */ - DevEnableRecv(&target->Device,DEV_ENABLE_RECV_ASYNC); - } -} - -static void HTCFlushRxQueue(HTC_TARGET *target, HTC_ENDPOINT *pEndpoint, HTC_PACKET_QUEUE *pQueue) -{ - HTC_PACKET *pPacket; - HTC_PACKET_QUEUE container = { {0} }; - - LOCK_HTC_RX(target); - - while (1) { - pPacket = HTC_PACKET_DEQUEUE(pQueue); - if (NULL == pPacket) { - break; - } - UNLOCK_HTC_RX(target); - pPacket->Status = A_ECANCELED; - pPacket->ActualLength = 0; - AR_DEBUG_PRINTF(ATH_DEBUG_RECV, (" Flushing RX packet:0x%lX, length:%d, ep:%d \n", - (unsigned long)pPacket, pPacket->BufferLength, pPacket->Endpoint)); - INIT_HTC_PACKET_QUEUE_AND_ADD(&container,pPacket); - /* give the packet back */ - DO_RCV_COMPLETION(pEndpoint,&container); - LOCK_HTC_RX(target); - } - - UNLOCK_HTC_RX(target); -} - -static void HTCFlushEndpointRX(HTC_TARGET *target, HTC_ENDPOINT *pEndpoint) -{ - /* flush any recv indications not already made */ - HTCFlushRxQueue(target,pEndpoint,&pEndpoint->RecvIndicationQueue); - /* flush any rx buffers */ - HTCFlushRxQueue(target,pEndpoint,&pEndpoint->RxBuffers); -} - -void HTCFlushRecvBuffers(HTC_TARGET *target) -{ - HTC_ENDPOINT *pEndpoint; - int i; - - for (i = ENDPOINT_0; i < ENDPOINT_MAX; i++) { - pEndpoint = &target->EndPoint[i]; - if (pEndpoint->ServiceID == 0) { - /* not in use.. */ - continue; - } - HTCFlushEndpointRX(target,pEndpoint); - } -} - - -void HTCEnableRecv(HTC_HANDLE HTCHandle) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - - if (!HTC_STOPPING(target)) { - /* re-enable */ - DevEnableRecv(&target->Device,DEV_ENABLE_RECV_SYNC); - } -} - -void HTCDisableRecv(HTC_HANDLE HTCHandle) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - - if (!HTC_STOPPING(target)) { - /* disable */ - DevStopRecv(&target->Device,DEV_ENABLE_RECV_SYNC); - } -} - -int HTCGetNumRecvBuffers(HTC_HANDLE HTCHandle, - HTC_ENDPOINT_ID Endpoint) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - return HTC_PACKET_QUEUE_DEPTH(&(target->EndPoint[Endpoint].RxBuffers)); -} - -A_STATUS HTCWaitForPendingRecv(HTC_HANDLE HTCHandle, - A_UINT32 TimeoutInMs, - A_BOOL *pbIsRecvPending) -{ - A_STATUS status = A_OK; - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - - status = DevWaitForPendingRecv(&target->Device, - TimeoutInMs, - pbIsRecvPending); - - return status; -} diff --git a/drivers/net/wireless/ar6003/host/htc2/htc_send.c b/drivers/net/wireless/ar6003/host/htc2/htc_send.c deleted file mode 100644 index cdc393485a56..000000000000 --- a/drivers/net/wireless/ar6003/host/htc2/htc_send.c +++ /dev/null @@ -1,1024 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#include "htc_internal.h" - -typedef enum _HTC_SEND_QUEUE_RESULT { - HTC_SEND_QUEUE_OK = 0, /* packet was queued */ - HTC_SEND_QUEUE_DROP = 1, /* this packet should be dropped */ -} HTC_SEND_QUEUE_RESULT; - -#define DO_EP_TX_COMPLETION(ep,q) DoSendCompletion(ep,q) - -/* call the distribute credits callback with the distribution */ -#define DO_DISTRIBUTION(t,reason,description,pList) \ -{ \ - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, \ - (" calling distribute function (%s) (dfn:0x%lX, ctxt:0x%lX, dist:0x%lX) \n", \ - (description), \ - (unsigned long)(t)->DistributeCredits, \ - (unsigned long)(t)->pCredDistContext, \ - (unsigned long)pList)); \ - (t)->DistributeCredits((t)->pCredDistContext, \ - (pList), \ - (reason)); \ -} - -static void DoSendCompletion(HTC_ENDPOINT *pEndpoint, - HTC_PACKET_QUEUE *pQueueToIndicate) -{ - do { - - if (HTC_QUEUE_EMPTY(pQueueToIndicate)) { - /* nothing to indicate */ - break; - } - - if (pEndpoint->EpCallBacks.EpTxCompleteMultiple != NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, (" HTC calling ep %d, send complete multiple callback (%d pkts) \n", - pEndpoint->Id, HTC_PACKET_QUEUE_DEPTH(pQueueToIndicate))); - /* a multiple send complete handler is being used, pass the queue to the handler */ - pEndpoint->EpCallBacks.EpTxCompleteMultiple(pEndpoint->EpCallBacks.pContext, - pQueueToIndicate); - /* all packets are now owned by the callback, reset queue to be safe */ - INIT_HTC_PACKET_QUEUE(pQueueToIndicate); - } else { - HTC_PACKET *pPacket; - /* using legacy EpTxComplete */ - do { - pPacket = HTC_PACKET_DEQUEUE(pQueueToIndicate); - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, (" HTC calling ep %d send complete callback on packet 0x%lX \n", \ - pEndpoint->Id, (unsigned long)(pPacket))); - pEndpoint->EpCallBacks.EpTxComplete(pEndpoint->EpCallBacks.pContext, pPacket); - } while (!HTC_QUEUE_EMPTY(pQueueToIndicate)); - } - - } while (FALSE); - -} - -/* do final completion on sent packet */ -static INLINE void CompleteSentPacket(HTC_TARGET *target, HTC_ENDPOINT *pEndpoint, HTC_PACKET *pPacket) -{ - pPacket->Completion = NULL; - - if (A_FAILED(pPacket->Status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("CompleteSentPacket: request failed (status:%d, ep:%d, length:%d creds:%d) \n", - pPacket->Status, pPacket->Endpoint, pPacket->ActualLength, pPacket->PktInfo.AsTx.CreditsUsed)); - /* on failure to submit, reclaim credits for this packet */ - LOCK_HTC_TX(target); - pEndpoint->CreditDist.TxCreditsToDist += pPacket->PktInfo.AsTx.CreditsUsed; - pEndpoint->CreditDist.TxQueueDepth = HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue); - DO_DISTRIBUTION(target, - HTC_CREDIT_DIST_SEND_COMPLETE, - "Send Complete", - target->EpCreditDistributionListHead->pNext); - UNLOCK_HTC_TX(target); - } - /* first, fixup the head room we allocated */ - pPacket->pBuffer += HTC_HDR_LENGTH; -} - -/* our internal send packet completion handler when packets are submited to the AR6K device - * layer */ -static void HTCSendPktCompletionHandler(void *Context, HTC_PACKET *pPacket) -{ - HTC_TARGET *target = (HTC_TARGET *)Context; - HTC_ENDPOINT *pEndpoint = &target->EndPoint[pPacket->Endpoint]; - HTC_PACKET_QUEUE container = { {0} }; - - CompleteSentPacket(target,pEndpoint,pPacket); - INIT_HTC_PACKET_QUEUE_AND_ADD(&container,pPacket); - /* do completion */ - DO_EP_TX_COMPLETION(pEndpoint,&container); -} - -A_STATUS HTCIssueSend(HTC_TARGET *target, HTC_PACKET *pPacket) -{ - A_STATUS status; - A_BOOL sync = FALSE; - - if (pPacket->Completion == NULL) { - /* mark that this request was synchronously issued */ - sync = TRUE; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, - ("+-HTCIssueSend: transmit length : %d (%s) \n", - pPacket->ActualLength + (A_UINT32)HTC_HDR_LENGTH, - sync ? "SYNC" : "ASYNC" )); - - /* send message to device */ - status = DevSendPacket(&target->Device, - pPacket, - pPacket->ActualLength + HTC_HDR_LENGTH); - - if (sync) { - /* use local sync variable. If this was issued asynchronously, pPacket is no longer - * safe to access. */ - pPacket->pBuffer += HTC_HDR_LENGTH; - } - - /* if this request was asynchronous, the packet completion routine will be invoked by - * the device layer when the HIF layer completes the request */ - - return status; -} - - /* get HTC send packets from the TX queue on an endpoint */ -static INLINE void GetHTCSendPackets(HTC_TARGET *target, - HTC_ENDPOINT *pEndpoint, - HTC_PACKET_QUEUE *pQueue) -{ - int creditsRequired; - int remainder; - A_UINT8 sendFlags; - HTC_PACKET *pPacket; - unsigned int transferLength; - - /****** NOTE : the TX lock is held when this function is called *****************/ - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("+GetHTCSendPackets \n")); - - /* loop until we can grab as many packets out of the queue as we can */ - while (TRUE) { - - sendFlags = 0; - /* get packet at head, but don't remove it */ - pPacket = HTC_GET_PKT_AT_HEAD(&pEndpoint->TxQueue); - if (pPacket == NULL) { - break; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,(" Got head packet:0x%lX , Queue Depth: %d\n", - (unsigned long)pPacket, HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue))); - - transferLength = DEV_CALC_SEND_PADDED_LEN(&target->Device, pPacket->ActualLength + HTC_HDR_LENGTH); - - if (transferLength <= target->TargetCreditSize) { - creditsRequired = 1; - } else { - /* figure out how many credits this message requires */ - creditsRequired = transferLength / target->TargetCreditSize; - remainder = transferLength % target->TargetCreditSize; - - if (remainder) { - creditsRequired++; - } - } - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,(" Creds Required:%d Got:%d\n", - creditsRequired, pEndpoint->CreditDist.TxCredits)); - - if (pEndpoint->CreditDist.TxCredits < creditsRequired) { - - /* not enough credits */ - if (pPacket->Endpoint == ENDPOINT_0) { - /* leave it in the queue */ - break; - } - /* invoke the registered distribution function only if this is not - * endpoint 0, we let the driver layer provide more credits if it can. - * We pass the credit distribution list starting at the endpoint in question - * */ - - /* set how many credits we need */ - pEndpoint->CreditDist.TxCreditsSeek = - creditsRequired - pEndpoint->CreditDist.TxCredits; - DO_DISTRIBUTION(target, - HTC_CREDIT_DIST_SEEK_CREDITS, - "Seek Credits", - &pEndpoint->CreditDist); - pEndpoint->CreditDist.TxCreditsSeek = 0; - - if (pEndpoint->CreditDist.TxCredits < creditsRequired) { - /* still not enough credits to send, leave packet in the queue */ - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, - (" Not enough credits for ep %d leaving packet in queue..\n", - pPacket->Endpoint)); - break; - } - - } - - pEndpoint->CreditDist.TxCredits -= creditsRequired; - INC_HTC_EP_STAT(pEndpoint, TxCreditsConsummed, creditsRequired); - - /* check if we need credits back from the target */ - if (pEndpoint->CreditDist.TxCredits < pEndpoint->CreditDist.TxCreditsPerMaxMsg) { - /* we are getting low on credits, see if we can ask for more from the distribution function */ - pEndpoint->CreditDist.TxCreditsSeek = - pEndpoint->CreditDist.TxCreditsPerMaxMsg - pEndpoint->CreditDist.TxCredits; - - DO_DISTRIBUTION(target, - HTC_CREDIT_DIST_SEEK_CREDITS, - "Seek Credits", - &pEndpoint->CreditDist); - - pEndpoint->CreditDist.TxCreditsSeek = 0; - /* see if we were successful in getting more */ - if (pEndpoint->CreditDist.TxCredits < pEndpoint->CreditDist.TxCreditsPerMaxMsg) { - /* tell the target we need credits ASAP! */ - sendFlags |= HTC_FLAGS_NEED_CREDIT_UPDATE; - INC_HTC_EP_STAT(pEndpoint, TxCreditLowIndications, 1); - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,(" Host Needs Credits \n")); - } - } - - /* now we can fully dequeue */ - pPacket = HTC_PACKET_DEQUEUE(&pEndpoint->TxQueue); - /* save the number of credits this packet consumed */ - pPacket->PktInfo.AsTx.CreditsUsed = creditsRequired; - /* all TX packets are handled asynchronously */ - pPacket->Completion = HTCSendPktCompletionHandler; - pPacket->pContext = target; - INC_HTC_EP_STAT(pEndpoint, TxIssued, 1); - /* save send flags */ - pPacket->PktInfo.AsTx.SendFlags = sendFlags; - pPacket->PktInfo.AsTx.SeqNo = pEndpoint->SeqNo; - pEndpoint->SeqNo++; - /* queue this packet into the caller's queue */ - HTC_PACKET_ENQUEUE(pQueue,pPacket); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("-GetHTCSendPackets \n")); - -} - -static void HTCAsyncSendScatterCompletion(HIF_SCATTER_REQ *pScatterReq) -{ - int i; - HTC_PACKET *pPacket; - HTC_ENDPOINT *pEndpoint = (HTC_ENDPOINT *)pScatterReq->Context; - HTC_TARGET *target = (HTC_TARGET *)pEndpoint->target; - A_STATUS status = A_OK; - HTC_PACKET_QUEUE sendCompletes = { {0} }; - - INIT_HTC_PACKET_QUEUE(&sendCompletes); - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("+HTCAsyncSendScatterCompletion TotLen: %d Entries: %d\n", - pScatterReq->TotalLength, pScatterReq->ValidScatterEntries)); - - DEV_FINISH_SCATTER_OPERATION(pScatterReq); - - if (A_FAILED(pScatterReq->CompletionStatus)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("** Send Scatter Request Failed: %d \n",pScatterReq->CompletionStatus)); - status = A_ERROR; - } - - /* walk through the scatter list and process */ - for (i = 0; i < pScatterReq->ValidScatterEntries; i++) { - pPacket = (HTC_PACKET *)(pScatterReq->ScatterList[i].pCallerContexts[0]); - A_ASSERT(pPacket != NULL); - pPacket->Status = status; - CompleteSentPacket(target,pEndpoint,pPacket); - /* add it to the completion queue */ - HTC_PACKET_ENQUEUE(&sendCompletes, pPacket); - } - - /* free scatter request */ - DEV_FREE_SCATTER_REQ(&target->Device,pScatterReq); - /* complete all packets */ - DO_EP_TX_COMPLETION(pEndpoint,&sendCompletes); - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("-HTCAsyncSendScatterCompletion \n")); -} - - /* drain a queue and send as bundles - * this function may return without fully draining the queue under the following conditions : - * - scatter resources are exhausted - * - a message that will consume a partial credit will stop the bundling process early - * - we drop below the minimum number of messages for a bundle - * */ -static void HTCIssueSendBundle(HTC_ENDPOINT *pEndpoint, - HTC_PACKET_QUEUE *pQueue, - int *pBundlesSent, - int *pTotalBundlesPkts) -{ - int pktsToScatter; - unsigned int scatterSpaceRemaining; - HIF_SCATTER_REQ *pScatterReq = NULL; - int i, packetsInScatterReq; - unsigned int transferLength; - HTC_PACKET *pPacket; - A_BOOL done = FALSE; - int bundlesSent = 0; - int totalPktsInBundle = 0; - HTC_TARGET *target = pEndpoint->target; - int creditRemainder = 0; - int creditPad; - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("+HTCIssueSendBundle \n")); - - while (!done) { - - pktsToScatter = HTC_PACKET_QUEUE_DEPTH(pQueue); - pktsToScatter = min(pktsToScatter, target->MaxMsgPerBundle); - - if (pktsToScatter < HTC_MIN_HTC_MSGS_TO_BUNDLE) { - /* not enough to bundle */ - break; - } - - pScatterReq = DEV_ALLOC_SCATTER_REQ(&target->Device); - - if (pScatterReq == NULL) { - /* no scatter resources */ - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,(" No more scatter resources \n")); - break; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,(" pkts to scatter: %d \n", pktsToScatter)); - - pScatterReq->TotalLength = 0; - pScatterReq->ValidScatterEntries = 0; - - packetsInScatterReq = 0; - scatterSpaceRemaining = DEV_GET_MAX_BUNDLE_SEND_LENGTH(&target->Device); - - for (i = 0; i < pktsToScatter; i++) { - - pScatterReq->ScatterList[i].pCallerContexts[0] = NULL; - - pPacket = HTC_GET_PKT_AT_HEAD(pQueue); - if (pPacket == NULL) { - A_ASSERT(FALSE); - break; - } - - creditPad = 0; - transferLength = DEV_CALC_SEND_PADDED_LEN(&target->Device, - pPacket->ActualLength + HTC_HDR_LENGTH); - /* see if the padded transfer length falls on a credit boundary */ - creditRemainder = transferLength % target->TargetCreditSize; - - if (creditRemainder != 0) { - /* the transfer consumes a "partial" credit, this packet cannot be bundled unless - * we add additional "dummy" padding (max 255 bytes) to consume the entire credit - *** NOTE: only allow the send padding if the endpoint is allowed to */ - if (pEndpoint->LocalConnectionFlags & HTC_LOCAL_CONN_FLAGS_ENABLE_SEND_BUNDLE_PADDING) { - if (transferLength < target->TargetCreditSize) { - /* special case where the transfer is less than a credit */ - creditPad = target->TargetCreditSize - transferLength; - } else { - creditPad = creditRemainder; - } - - /* now check to see if we can indicate padding in the HTC header */ - if ((creditPad > 0) && (creditPad <= 255)) { - /* adjust the transferlength of this packet with the new credit padding */ - transferLength += creditPad; - } else { - /* the amount to pad is too large, bail on this packet, we have to - * send it using the non-bundled method */ - pPacket = NULL; - } - } else { - /* bail on this packet, user does not want padding applied */ - pPacket = NULL; - } - } - - if (NULL == pPacket) { - /* can't bundle */ - done = TRUE; - break; - } - - if (scatterSpaceRemaining < transferLength) { - /* exceeds what we can transfer */ - break; - } - - scatterSpaceRemaining -= transferLength; - /* now remove it from the queue */ - pPacket = HTC_PACKET_DEQUEUE(pQueue); - /* save it in the scatter list */ - pScatterReq->ScatterList[i].pCallerContexts[0] = pPacket; - /* prepare packet and flag message as part of a send bundle */ - HTC_PREPARE_SEND_PKT(pPacket, - pPacket->PktInfo.AsTx.SendFlags | HTC_FLAGS_SEND_BUNDLE, - creditPad, - pPacket->PktInfo.AsTx.SeqNo); - pScatterReq->ScatterList[i].pBuffer = pPacket->pBuffer; - pScatterReq->ScatterList[i].Length = transferLength; - A_ASSERT(transferLength); - pScatterReq->TotalLength += transferLength; - pScatterReq->ValidScatterEntries++; - packetsInScatterReq++; - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,(" %d, Adding packet : 0x%lX, len:%d (remaining space:%d) \n", - i, (unsigned long)pPacket,transferLength,scatterSpaceRemaining)); - } - - if (packetsInScatterReq >= HTC_MIN_HTC_MSGS_TO_BUNDLE) { - /* send path is always asynchronous */ - pScatterReq->CompletionRoutine = HTCAsyncSendScatterCompletion; - pScatterReq->Context = pEndpoint; - bundlesSent++; - totalPktsInBundle += packetsInScatterReq; - packetsInScatterReq = 0; - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,(" Send Scatter total bytes: %d , entries: %d\n", - pScatterReq->TotalLength,pScatterReq->ValidScatterEntries)); - DevSubmitScatterRequest(&target->Device, pScatterReq, DEV_SCATTER_WRITE, DEV_SCATTER_ASYNC); - /* we don't own this anymore */ - pScatterReq = NULL; - /* try to send some more */ - continue; - } - - /* not enough packets to use the scatter request, cleanup */ - if (pScatterReq != NULL) { - if (packetsInScatterReq > 0) { - /* work backwards to requeue requests */ - for (i = (packetsInScatterReq - 1); i >= 0; i--) { - pPacket = (HTC_PACKET *)(pScatterReq->ScatterList[i].pCallerContexts[0]); - if (pPacket != NULL) { - /* undo any prep */ - HTC_UNPREPARE_SEND_PKT(pPacket); - /* queue back to the head */ - HTC_PACKET_ENQUEUE_TO_HEAD(pQueue,pPacket); - } - } - } - DEV_FREE_SCATTER_REQ(&target->Device,pScatterReq); - } - - /* if we get here, we sent all that we could, get out */ - break; - - } - - *pBundlesSent = bundlesSent; - *pTotalBundlesPkts = totalPktsInBundle; - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("-HTCIssueSendBundle (sent:%d) \n",bundlesSent)); - - return; -} - -/* - * if there are no credits, the packet(s) remains in the queue. - * this function returns the result of the attempt to send a queue of HTC packets */ -static HTC_SEND_QUEUE_RESULT HTCTrySend(HTC_TARGET *target, - HTC_ENDPOINT *pEndpoint, - HTC_PACKET_QUEUE *pCallersSendQueue) -{ - HTC_PACKET_QUEUE sendQueue = { {0} }; /* temp queue to hold packets at various stages */ - HTC_PACKET *pPacket; - int bundlesSent; - int pktsInBundles; - int overflow; - HTC_SEND_QUEUE_RESULT result = HTC_SEND_QUEUE_OK; - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("+HTCTrySend (Queue:0x%lX Depth:%d)\n", - (unsigned long)pCallersSendQueue, - (pCallersSendQueue == NULL) ? 0 : HTC_PACKET_QUEUE_DEPTH(pCallersSendQueue))); - - /* init the local send queue */ - INIT_HTC_PACKET_QUEUE(&sendQueue); - - do { - - if (NULL == pCallersSendQueue) { - /* caller didn't provide a queue, just wants us to check queues and send */ - break; - } - - if (HTC_QUEUE_EMPTY(pCallersSendQueue)) { - /* empty queue */ - result = HTC_SEND_QUEUE_DROP; - break; - } - - if (HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue) >= pEndpoint->MaxTxQueueDepth) { - /* we've already overflowed */ - overflow = HTC_PACKET_QUEUE_DEPTH(pCallersSendQueue); - } else { - /* figure out how much we will overflow by */ - overflow = HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue); - overflow += HTC_PACKET_QUEUE_DEPTH(pCallersSendQueue); - /* figure out how much we will overflow the TX queue by */ - overflow -= pEndpoint->MaxTxQueueDepth; - } - - /* if overflow is negative or zero, we are okay */ - if (overflow > 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, - (" Endpoint %d, TX queue will overflow :%d , Tx Depth:%d, Max:%d \n", - pEndpoint->Id, overflow, HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue), pEndpoint->MaxTxQueueDepth)); - } - if ((overflow <= 0) || (pEndpoint->EpCallBacks.EpSendFull == NULL)) { - /* all packets will fit or caller did not provide send full indication handler - * -- just move all of them to the local sendQueue object */ - HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(&sendQueue, pCallersSendQueue); - } else { - int i; - int goodPkts = HTC_PACKET_QUEUE_DEPTH(pCallersSendQueue) - overflow; - - A_ASSERT(goodPkts >= 0); - /* we have overflowed, and a callback is provided */ - /* dequeue all non-overflow packets into the sendqueue */ - for (i = 0; i < goodPkts; i++) { - /* pop off caller's queue*/ - pPacket = HTC_PACKET_DEQUEUE(pCallersSendQueue); - A_ASSERT(pPacket != NULL); - /* insert into local queue */ - HTC_PACKET_ENQUEUE(&sendQueue,pPacket); - } - - /* the caller's queue has all the packets that won't fit*/ - /* walk through the caller's queue and indicate each one to the send full handler */ - ITERATE_OVER_LIST_ALLOW_REMOVE(&pCallersSendQueue->QueueHead, pPacket, HTC_PACKET, ListLink) { - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, (" Indicating overflowed TX packet: 0x%lX \n", - (unsigned long)pPacket)); - if (pEndpoint->EpCallBacks.EpSendFull(pEndpoint->EpCallBacks.pContext, - pPacket) == HTC_SEND_FULL_DROP) { - /* callback wants the packet dropped */ - INC_HTC_EP_STAT(pEndpoint, TxDropped, 1); - /* leave this one in the caller's queue for cleanup */ - } else { - /* callback wants to keep this packet, remove from caller's queue */ - HTC_PACKET_REMOVE(pCallersSendQueue, pPacket); - /* put it in the send queue */ - HTC_PACKET_ENQUEUE(&sendQueue,pPacket); - } - - } ITERATE_END; - - if (HTC_QUEUE_EMPTY(&sendQueue)) { - /* no packets made it in, caller will cleanup */ - result = HTC_SEND_QUEUE_DROP; - break; - } - } - - } while (FALSE); - - if (result != HTC_SEND_QUEUE_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("-HTCTrySend: \n")); - return result; - } - - LOCK_HTC_TX(target); - - if (!HTC_QUEUE_EMPTY(&sendQueue)) { - /* transfer packets */ - HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(&pEndpoint->TxQueue,&sendQueue); - A_ASSERT(HTC_QUEUE_EMPTY(&sendQueue)); - INIT_HTC_PACKET_QUEUE(&sendQueue); - } - - /* increment tx processing count on entry */ - pEndpoint->TxProcessCount++; - if (pEndpoint->TxProcessCount > 1) { - /* another thread or task is draining the TX queues on this endpoint - * that thread will reset the tx processing count when the queue is drained */ - pEndpoint->TxProcessCount--; - UNLOCK_HTC_TX(target); - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("-HTCTrySend (busy) \n")); - return HTC_SEND_QUEUE_OK; - } - - /***** beyond this point only 1 thread may enter ******/ - - /* now drain the endpoint TX queue for transmission as long as we have enough - * credits */ - while (TRUE) { - - if (HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue) == 0) { - break; - } - - /* get all the packets for this endpoint that we can for this pass */ - GetHTCSendPackets(target, pEndpoint, &sendQueue); - - if (HTC_PACKET_QUEUE_DEPTH(&sendQueue) == 0) { - /* didn't get any packets due to a lack of credits */ - break; - } - - UNLOCK_HTC_TX(target); - - /* any packets to send are now in our local send queue */ - - bundlesSent = 0; - pktsInBundles = 0; - - while (TRUE) { - - /* try to send a bundle on each pass */ - if ((target->SendBundlingEnabled) && - (HTC_PACKET_QUEUE_DEPTH(&sendQueue) >= HTC_MIN_HTC_MSGS_TO_BUNDLE)) { - int temp1,temp2; - /* bundling is enabled and there is at least a minimum number of packets in the send queue - * send what we can in this pass */ - HTCIssueSendBundle(pEndpoint, &sendQueue, &temp1, &temp2); - bundlesSent += temp1; - pktsInBundles += temp2; - } - - /* if not bundling or there was a packet that could not be placed in a bundle, pull it out - * and send it the normal way */ - pPacket = HTC_PACKET_DEQUEUE(&sendQueue); - if (NULL == pPacket) { - /* local queue is fully drained */ - break; - } - HTC_PREPARE_SEND_PKT(pPacket, - pPacket->PktInfo.AsTx.SendFlags, - 0, - pPacket->PktInfo.AsTx.SeqNo); - HTCIssueSend(target, pPacket); - - /* go back and see if we can bundle some more */ - } - - LOCK_HTC_TX(target); - - INC_HTC_EP_STAT(pEndpoint, TxBundles, bundlesSent); - INC_HTC_EP_STAT(pEndpoint, TxPacketsBundled, pktsInBundles); - - } - - /* done with this endpoint, we can clear the count */ - pEndpoint->TxProcessCount = 0; - UNLOCK_HTC_TX(target); - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("-HTCTrySend: \n")); - - return HTC_SEND_QUEUE_OK; -} - -A_STATUS HTCSendPktsMultiple(HTC_HANDLE HTCHandle, HTC_PACKET_QUEUE *pPktQueue) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - HTC_ENDPOINT *pEndpoint; - HTC_PACKET *pPacket; - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("+HTCSendPktsMultiple: Queue: 0x%lX, Pkts %d \n", - (unsigned long)pPktQueue, HTC_PACKET_QUEUE_DEPTH(pPktQueue))); - - /* get packet at head to figure out which endpoint these packets will go into */ - pPacket = HTC_GET_PKT_AT_HEAD(pPktQueue); - if (NULL == pPacket) { - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("-HTCSendPktsMultiple \n")); - return A_EINVAL; - } - - AR_DEBUG_ASSERT(pPacket->Endpoint < ENDPOINT_MAX); - pEndpoint = &target->EndPoint[pPacket->Endpoint]; - - HTCTrySend(target, pEndpoint, pPktQueue); - - /* do completion on any packets that couldn't get in */ - if (!HTC_QUEUE_EMPTY(pPktQueue)) { - - HTC_PACKET_QUEUE_ITERATE_ALLOW_REMOVE(pPktQueue,pPacket) { - if (HTC_STOPPING(target)) { - pPacket->Status = A_ECANCELED; - } else { - pPacket->Status = A_NO_RESOURCE; - } - } HTC_PACKET_QUEUE_ITERATE_END; - - DO_EP_TX_COMPLETION(pEndpoint,pPktQueue); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("-HTCSendPktsMultiple \n")); - - return A_OK; -} - -/* HTC API - HTCSendPkt */ -A_STATUS HTCSendPkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket) -{ - HTC_PACKET_QUEUE queue = { {0} }; - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, - ("+-HTCSendPkt: Enter endPointId: %d, buffer: 0x%lX, length: %d \n", - pPacket->Endpoint, (unsigned long)pPacket->pBuffer, pPacket->ActualLength)); - INIT_HTC_PACKET_QUEUE_AND_ADD(&queue,pPacket); - return HTCSendPktsMultiple(HTCHandle, &queue); -} - -/* check TX queues to drain because of credit distribution update */ -static INLINE void HTCCheckEndpointTxQueues(HTC_TARGET *target) -{ - HTC_ENDPOINT *pEndpoint; - HTC_ENDPOINT_CREDIT_DIST *pDistItem; - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("+HTCCheckEndpointTxQueues \n")); - pDistItem = target->EpCreditDistributionListHead; - - /* run through the credit distribution list to see - * if there are packets queued - * NOTE: no locks need to be taken since the distribution list - * is not dynamic (cannot be re-ordered) and we are not modifying any state */ - while (pDistItem != NULL) { - pEndpoint = (HTC_ENDPOINT *)pDistItem->pHTCReserved; - - if (HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue) > 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, (" Ep %d has %d credits and %d Packets in TX Queue \n", - pDistItem->Endpoint, pEndpoint->CreditDist.TxCredits, HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue))); - /* try to start the stalled queue, this list is ordered by priority. - * Highest priority queue get's processed first, if there are credits available the - * highest priority queue will get a chance to reclaim credits from lower priority - * ones */ - HTCTrySend(target, pEndpoint, NULL); - } - - pDistItem = pDistItem->pNext; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("-HTCCheckEndpointTxQueues \n")); -} - -/* process credit reports and call distribution function */ -void HTCProcessCreditRpt(HTC_TARGET *target, HTC_CREDIT_REPORT *pRpt, int NumEntries, HTC_ENDPOINT_ID FromEndpoint) -{ - int i; - HTC_ENDPOINT *pEndpoint; - int totalCredits = 0; - A_BOOL doDist = FALSE; - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("+HTCProcessCreditRpt, Credit Report Entries:%d \n", NumEntries)); - - /* lock out TX while we update credits */ - LOCK_HTC_TX(target); - - for (i = 0; i < NumEntries; i++, pRpt++) { - if (pRpt->EndpointID >= ENDPOINT_MAX) { - AR_DEBUG_ASSERT(FALSE); - break; - } - - pEndpoint = &target->EndPoint[pRpt->EndpointID]; - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, (" Endpoint %d got %d credits \n", - pRpt->EndpointID, pRpt->Credits)); - - -#ifdef HTC_EP_STAT_PROFILING - - INC_HTC_EP_STAT(pEndpoint, TxCreditRpts, 1); - INC_HTC_EP_STAT(pEndpoint, TxCreditsReturned, pRpt->Credits); - - if (FromEndpoint == pRpt->EndpointID) { - /* this credit report arrived on the same endpoint indicating it arrived in an RX - * packet */ - INC_HTC_EP_STAT(pEndpoint, TxCreditsFromRx, pRpt->Credits); - INC_HTC_EP_STAT(pEndpoint, TxCreditRptsFromRx, 1); - } else if (FromEndpoint == ENDPOINT_0) { - /* this credit arrived on endpoint 0 as a NULL message */ - INC_HTC_EP_STAT(pEndpoint, TxCreditsFromEp0, pRpt->Credits); - INC_HTC_EP_STAT(pEndpoint, TxCreditRptsFromEp0, 1); - } else { - /* arrived on another endpoint */ - INC_HTC_EP_STAT(pEndpoint, TxCreditsFromOther, pRpt->Credits); - INC_HTC_EP_STAT(pEndpoint, TxCreditRptsFromOther, 1); - } - -#endif - - if (ENDPOINT_0 == pRpt->EndpointID) { - /* always give endpoint 0 credits back */ - pEndpoint->CreditDist.TxCredits += pRpt->Credits; - } else { - /* for all other endpoints, update credits to distribute, the distribution function - * will handle giving out credits back to the endpoints */ - pEndpoint->CreditDist.TxCreditsToDist += pRpt->Credits; - /* flag that we have to do the distribution */ - doDist = TRUE; - } - - /* refresh tx depth for distribution function that will recover these credits - * NOTE: this is only valid when there are credits to recover! */ - pEndpoint->CreditDist.TxQueueDepth = HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue); - - totalCredits += pRpt->Credits; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, (" Report indicated %d credits to distribute \n", totalCredits)); - - if (doDist) { - /* this was a credit return based on a completed send operations - * note, this is done with the lock held */ - DO_DISTRIBUTION(target, - HTC_CREDIT_DIST_SEND_COMPLETE, - "Send Complete", - target->EpCreditDistributionListHead->pNext); - } - - UNLOCK_HTC_TX(target); - - if (totalCredits) { - HTCCheckEndpointTxQueues(target); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("-HTCProcessCreditRpt \n")); -} - -/* flush endpoint TX queue */ -static void HTCFlushEndpointTX(HTC_TARGET *target, HTC_ENDPOINT *pEndpoint, HTC_TX_TAG Tag) -{ - HTC_PACKET *pPacket; - HTC_PACKET_QUEUE discardQueue = { {0} }; - HTC_PACKET_QUEUE container = { {0} }; - - /* initialize the discard queue */ - INIT_HTC_PACKET_QUEUE(&discardQueue); - - LOCK_HTC_TX(target); - - /* interate from the front of the TX queue and flush out packets */ - ITERATE_OVER_LIST_ALLOW_REMOVE(&pEndpoint->TxQueue.QueueHead, pPacket, HTC_PACKET, ListLink) { - - /* check for removal */ - if ((HTC_TX_PACKET_TAG_ALL == Tag) || (Tag == pPacket->PktInfo.AsTx.Tag)) { - /* remove from queue */ - HTC_PACKET_REMOVE(&pEndpoint->TxQueue, pPacket); - /* add it to the discard pile */ - HTC_PACKET_ENQUEUE(&discardQueue, pPacket); - } - - } ITERATE_END; - - UNLOCK_HTC_TX(target); - - /* empty the discard queue */ - while (1) { - pPacket = HTC_PACKET_DEQUEUE(&discardQueue); - if (NULL == pPacket) { - break; - } - pPacket->Status = A_ECANCELED; - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, (" Flushing TX packet:0x%lX, length:%d, ep:%d tag:0x%X \n", - (unsigned long)pPacket, pPacket->ActualLength, pPacket->Endpoint, pPacket->PktInfo.AsTx.Tag)); - INIT_HTC_PACKET_QUEUE_AND_ADD(&container,pPacket); - DO_EP_TX_COMPLETION(pEndpoint,&container); - } - -} - -void DumpCreditDist(HTC_ENDPOINT_CREDIT_DIST *pEPDist) -{ - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, ("--- EP : %d ServiceID: 0x%X --------------\n", - pEPDist->Endpoint, pEPDist->ServiceID)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" this:0x%lX next:0x%lX prev:0x%lX\n", - (unsigned long)pEPDist, (unsigned long)pEPDist->pNext, (unsigned long)pEPDist->pPrev)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" DistFlags : 0x%X \n", pEPDist->DistFlags)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCreditsNorm : %d \n", pEPDist->TxCreditsNorm)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCreditsMin : %d \n", pEPDist->TxCreditsMin)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCredits : %d \n", pEPDist->TxCredits)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCreditsAssigned : %d \n", pEPDist->TxCreditsAssigned)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCreditsSeek : %d \n", pEPDist->TxCreditsSeek)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCreditSize : %d \n", pEPDist->TxCreditSize)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCreditsPerMaxMsg : %d \n", pEPDist->TxCreditsPerMaxMsg)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCreditsToDist : %d \n", pEPDist->TxCreditsToDist)); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxQueueDepth : %d \n", - HTC_PACKET_QUEUE_DEPTH(&((HTC_ENDPOINT *)pEPDist->pHTCReserved)->TxQueue))); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, ("----------------------------------------------------\n")); -} - -void DumpCreditDistStates(HTC_TARGET *target) -{ - HTC_ENDPOINT_CREDIT_DIST *pEPList = target->EpCreditDistributionListHead; - - while (pEPList != NULL) { - DumpCreditDist(pEPList); - pEPList = pEPList->pNext; - } - - if (target->DistributeCredits != NULL) { - DO_DISTRIBUTION(target, - HTC_DUMP_CREDIT_STATE, - "Dump State", - NULL); - } -} - -/* flush all send packets from all endpoint queues */ -void HTCFlushSendPkts(HTC_TARGET *target) -{ - HTC_ENDPOINT *pEndpoint; - int i; - - if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_TRC)) { - DumpCreditDistStates(target); - } - - for (i = ENDPOINT_0; i < ENDPOINT_MAX; i++) { - pEndpoint = &target->EndPoint[i]; - if (pEndpoint->ServiceID == 0) { - /* not in use.. */ - continue; - } - HTCFlushEndpointTX(target,pEndpoint,HTC_TX_PACKET_TAG_ALL); - } - - -} - -/* HTC API to flush an endpoint's TX queue*/ -void HTCFlushEndpoint(HTC_HANDLE HTCHandle, HTC_ENDPOINT_ID Endpoint, HTC_TX_TAG Tag) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - HTC_ENDPOINT *pEndpoint = &target->EndPoint[Endpoint]; - - if (pEndpoint->ServiceID == 0) { - AR_DEBUG_ASSERT(FALSE); - /* not in use.. */ - return; - } - - HTCFlushEndpointTX(target, pEndpoint, Tag); -} - -/* HTC API to indicate activity to the credit distribution function */ -void HTCIndicateActivityChange(HTC_HANDLE HTCHandle, - HTC_ENDPOINT_ID Endpoint, - A_BOOL Active) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - HTC_ENDPOINT *pEndpoint = &target->EndPoint[Endpoint]; - A_BOOL doDist = FALSE; - - if (pEndpoint->ServiceID == 0) { - AR_DEBUG_ASSERT(FALSE); - /* not in use.. */ - return; - } - - LOCK_HTC_TX(target); - - if (Active) { - if (!(pEndpoint->CreditDist.DistFlags & HTC_EP_ACTIVE)) { - /* mark active now */ - pEndpoint->CreditDist.DistFlags |= HTC_EP_ACTIVE; - doDist = TRUE; - } - } else { - if (pEndpoint->CreditDist.DistFlags & HTC_EP_ACTIVE) { - /* mark inactive now */ - pEndpoint->CreditDist.DistFlags &= ~HTC_EP_ACTIVE; - doDist = TRUE; - } - } - - if (doDist) { - /* indicate current Tx Queue depth to the credit distribution function */ - pEndpoint->CreditDist.TxQueueDepth = HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue); - /* do distribution again based on activity change - * note, this is done with the lock held */ - DO_DISTRIBUTION(target, - HTC_CREDIT_DIST_ACTIVITY_CHANGE, - "Activity Change", - target->EpCreditDistributionListHead->pNext); - } - - UNLOCK_HTC_TX(target); - - if (doDist && !Active) { - /* if a stream went inactive and this resulted in a credit distribution change, - * some credits may now be available for HTC packets that are stuck in - * HTC queues */ - HTCCheckEndpointTxQueues(target); - } -} - -A_BOOL HTCIsEndpointActive(HTC_HANDLE HTCHandle, - HTC_ENDPOINT_ID Endpoint) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - HTC_ENDPOINT *pEndpoint = &target->EndPoint[Endpoint]; - - if (pEndpoint->ServiceID == 0) { - return FALSE; - } - - if (pEndpoint->CreditDist.DistFlags & HTC_EP_ACTIVE) { - return TRUE; - } - - return FALSE; -} diff --git a/drivers/net/wireless/ar6003/host/htc2/htc_services.c b/drivers/net/wireless/ar6003/host/htc2/htc_services.c deleted file mode 100644 index 3488208cd4cf..000000000000 --- a/drivers/net/wireless/ar6003/host/htc2/htc_services.c +++ /dev/null @@ -1,449 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== -#include "htc_internal.h" - -void HTCControlTxComplete(void *Context, HTC_PACKET *pPacket) -{ - /* not implemented - * we do not send control TX frames during normal runtime, only during setup */ - AR_DEBUG_ASSERT(FALSE); -} - - /* callback when a control message arrives on this endpoint */ -void HTCControlRecv(void *Context, HTC_PACKET *pPacket) -{ - AR_DEBUG_ASSERT(pPacket->Endpoint == ENDPOINT_0); - - if (pPacket->Status == A_ECANCELED) { - /* this is a flush operation, return the control packet back to the pool */ - HTC_FREE_CONTROL_RX((HTC_TARGET*)Context,pPacket); - return; - } - - /* the only control messages we are expecting are NULL messages (credit resports) */ - if (pPacket->ActualLength > 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("HTCControlRecv, got message with length:%d \n", - pPacket->ActualLength + (A_UINT32)HTC_HDR_LENGTH)); - - /* dump header and message */ - DebugDumpBytes(pPacket->pBuffer - HTC_HDR_LENGTH, - pPacket->ActualLength + HTC_HDR_LENGTH, - "Unexpected ENDPOINT 0 Message"); - } - - HTC_RECYCLE_RX_PKT((HTC_TARGET*)Context,pPacket,&((HTC_TARGET*)Context)->EndPoint[0]); -} - -A_STATUS HTCSendSetupComplete(HTC_TARGET *target) -{ - HTC_PACKET *pSendPacket = NULL; - A_STATUS status; - - do { - /* allocate a packet to send to the target */ - pSendPacket = HTC_ALLOC_CONTROL_TX(target); - - if (NULL == pSendPacket) { - status = A_NO_MEMORY; - break; - } - - if (target->HTCTargetVersion >= HTC_VERSION_2P1) { - HTC_SETUP_COMPLETE_EX_MSG *pSetupCompleteEx; - A_UINT32 setupFlags = 0; - - pSetupCompleteEx = (HTC_SETUP_COMPLETE_EX_MSG *)pSendPacket->pBuffer; - A_MEMZERO(pSetupCompleteEx, sizeof(HTC_SETUP_COMPLETE_EX_MSG)); - pSetupCompleteEx->MessageID = HTC_MSG_SETUP_COMPLETE_EX_ID; - if (target->MaxMsgPerBundle > 0) { - /* host can do HTC bundling, indicate this to the target */ - setupFlags |= HTC_SETUP_COMPLETE_FLAGS_ENABLE_BUNDLE_RECV; - pSetupCompleteEx->MaxMsgsPerBundledRecv = target->MaxMsgPerBundle; - } - A_MEMCPY(&pSetupCompleteEx->SetupFlags, &setupFlags, sizeof(pSetupCompleteEx->SetupFlags)); - SET_HTC_PACKET_INFO_TX(pSendPacket, - NULL, - (A_UINT8 *)pSetupCompleteEx, - sizeof(HTC_SETUP_COMPLETE_EX_MSG), - ENDPOINT_0, - HTC_SERVICE_TX_PACKET_TAG); - - } else { - HTC_SETUP_COMPLETE_MSG *pSetupComplete; - /* assemble setup complete message */ - pSetupComplete = (HTC_SETUP_COMPLETE_MSG *)pSendPacket->pBuffer; - A_MEMZERO(pSetupComplete, sizeof(HTC_SETUP_COMPLETE_MSG)); - pSetupComplete->MessageID = HTC_MSG_SETUP_COMPLETE_ID; - SET_HTC_PACKET_INFO_TX(pSendPacket, - NULL, - (A_UINT8 *)pSetupComplete, - sizeof(HTC_SETUP_COMPLETE_MSG), - ENDPOINT_0, - HTC_SERVICE_TX_PACKET_TAG); - } - - /* we want synchronous operation */ - pSendPacket->Completion = NULL; - HTC_PREPARE_SEND_PKT(pSendPacket,0,0,0); - /* send the message */ - status = HTCIssueSend(target,pSendPacket); - - } while (FALSE); - - if (pSendPacket != NULL) { - HTC_FREE_CONTROL_TX(target,pSendPacket); - } - - return status; -} - - -A_STATUS HTCConnectService(HTC_HANDLE HTCHandle, - HTC_SERVICE_CONNECT_REQ *pConnectReq, - HTC_SERVICE_CONNECT_RESP *pConnectResp) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - A_STATUS status = A_OK; - HTC_PACKET *pRecvPacket = NULL; - HTC_PACKET *pSendPacket = NULL; - HTC_CONNECT_SERVICE_RESPONSE_MSG *pResponseMsg; - HTC_CONNECT_SERVICE_MSG *pConnectMsg; - HTC_ENDPOINT_ID assignedEndpoint = ENDPOINT_MAX; - HTC_ENDPOINT *pEndpoint; - unsigned int maxMsgSize = 0; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+HTCConnectService, target:0x%lX SvcID:0x%X \n", - (unsigned long)target, pConnectReq->ServiceID)); - - do { - - AR_DEBUG_ASSERT(pConnectReq->ServiceID != 0); - - if (HTC_CTRL_RSVD_SVC == pConnectReq->ServiceID) { - /* special case for pseudo control service */ - assignedEndpoint = ENDPOINT_0; - maxMsgSize = HTC_MAX_CONTROL_MESSAGE_LENGTH; - } else { - /* allocate a packet to send to the target */ - pSendPacket = HTC_ALLOC_CONTROL_TX(target); - - if (NULL == pSendPacket) { - AR_DEBUG_ASSERT(FALSE); - status = A_NO_MEMORY; - break; - } - /* assemble connect service message */ - pConnectMsg = (HTC_CONNECT_SERVICE_MSG *)pSendPacket->pBuffer; - AR_DEBUG_ASSERT(pConnectMsg != NULL); - A_MEMZERO(pConnectMsg,sizeof(HTC_CONNECT_SERVICE_MSG)); - pConnectMsg->MessageID = HTC_MSG_CONNECT_SERVICE_ID; - pConnectMsg->ServiceID = pConnectReq->ServiceID; - pConnectMsg->ConnectionFlags = pConnectReq->ConnectionFlags; - /* check caller if it wants to transfer meta data */ - if ((pConnectReq->pMetaData != NULL) && - (pConnectReq->MetaDataLength <= HTC_SERVICE_META_DATA_MAX_LENGTH)) { - /* copy meta data into message buffer (after header ) */ - A_MEMCPY((A_UINT8 *)pConnectMsg + sizeof(HTC_CONNECT_SERVICE_MSG), - pConnectReq->pMetaData, - pConnectReq->MetaDataLength); - pConnectMsg->ServiceMetaLength = pConnectReq->MetaDataLength; - } - - SET_HTC_PACKET_INFO_TX(pSendPacket, - NULL, - (A_UINT8 *)pConnectMsg, - sizeof(HTC_CONNECT_SERVICE_MSG) + pConnectMsg->ServiceMetaLength, - ENDPOINT_0, - HTC_SERVICE_TX_PACKET_TAG); - - /* we want synchronous operation */ - pSendPacket->Completion = NULL; - HTC_PREPARE_SEND_PKT(pSendPacket,0,0,0); - status = HTCIssueSend(target,pSendPacket); - - if (A_FAILED(status)) { - break; - } - - /* wait for response */ - status = HTCWaitforControlMessage(target, &pRecvPacket); - - if (A_FAILED(status)) { - break; - } - /* we controlled the buffer creation so it has to be properly aligned */ - pResponseMsg = (HTC_CONNECT_SERVICE_RESPONSE_MSG *)pRecvPacket->pBuffer; - - if ((pResponseMsg->MessageID != HTC_MSG_CONNECT_SERVICE_RESPONSE_ID) || - (pRecvPacket->ActualLength < sizeof(HTC_CONNECT_SERVICE_RESPONSE_MSG))) { - /* this message is not valid */ - AR_DEBUG_ASSERT(FALSE); - status = A_EPROTO; - break; - } - - pConnectResp->ConnectRespCode = pResponseMsg->Status; - /* check response status */ - if (pResponseMsg->Status != HTC_SERVICE_SUCCESS) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - (" Target failed service 0x%X connect request (status:%d)\n", - pResponseMsg->ServiceID, pResponseMsg->Status)); - status = A_EPROTO; - break; - } - - assignedEndpoint = (HTC_ENDPOINT_ID) pResponseMsg->EndpointID; - maxMsgSize = pResponseMsg->MaxMsgSize; - - if ((pConnectResp->pMetaData != NULL) && - (pResponseMsg->ServiceMetaLength > 0) && - (pResponseMsg->ServiceMetaLength <= HTC_SERVICE_META_DATA_MAX_LENGTH)) { - /* caller supplied a buffer and the target responded with data */ - int copyLength = min((int)pConnectResp->BufferLength, (int)pResponseMsg->ServiceMetaLength); - /* copy the meta data */ - A_MEMCPY(pConnectResp->pMetaData, - ((A_UINT8 *)pResponseMsg) + sizeof(HTC_CONNECT_SERVICE_RESPONSE_MSG), - copyLength); - pConnectResp->ActualLength = copyLength; - } - - } - - /* the rest of these are parameter checks so set the error status */ - status = A_EPROTO; - - if (assignedEndpoint >= ENDPOINT_MAX) { - AR_DEBUG_ASSERT(FALSE); - break; - } - - if (0 == maxMsgSize) { - AR_DEBUG_ASSERT(FALSE); - break; - } - - pEndpoint = &target->EndPoint[assignedEndpoint]; - pEndpoint->Id = assignedEndpoint; - if (pEndpoint->ServiceID != 0) { - /* endpoint already in use! */ - AR_DEBUG_ASSERT(FALSE); - break; - } - - /* return assigned endpoint to caller */ - pConnectResp->Endpoint = assignedEndpoint; - pConnectResp->MaxMsgLength = maxMsgSize; - - /* setup the endpoint */ - pEndpoint->ServiceID = pConnectReq->ServiceID; /* this marks the endpoint in use */ - pEndpoint->MaxTxQueueDepth = pConnectReq->MaxSendQueueDepth; - pEndpoint->MaxMsgLength = maxMsgSize; - /* copy all the callbacks */ - pEndpoint->EpCallBacks = pConnectReq->EpCallbacks; - /* set the credit distribution info for this endpoint, this information is - * passed back to the credit distribution callback function */ - pEndpoint->CreditDist.ServiceID = pConnectReq->ServiceID; - pEndpoint->CreditDist.pHTCReserved = pEndpoint; - pEndpoint->CreditDist.Endpoint = assignedEndpoint; - pEndpoint->CreditDist.TxCreditSize = target->TargetCreditSize; - - if (pConnectReq->MaxSendMsgSize != 0) { - /* override TxCreditsPerMaxMsg calculation, this optimizes the credit-low indications - * since the host will actually issue smaller messages in the Send path */ - if (pConnectReq->MaxSendMsgSize > maxMsgSize) { - /* can't be larger than the maximum the target can support */ - AR_DEBUG_ASSERT(FALSE); - break; - } - pEndpoint->CreditDist.TxCreditsPerMaxMsg = pConnectReq->MaxSendMsgSize / target->TargetCreditSize; - } else { - pEndpoint->CreditDist.TxCreditsPerMaxMsg = maxMsgSize / target->TargetCreditSize; - } - - if (0 == pEndpoint->CreditDist.TxCreditsPerMaxMsg) { - pEndpoint->CreditDist.TxCreditsPerMaxMsg = 1; - } - - /* save local connection flags */ - pEndpoint->LocalConnectionFlags = pConnectReq->LocalConnectionFlags; - - status = A_OK; - - } while (FALSE); - - if (pSendPacket != NULL) { - HTC_FREE_CONTROL_TX(target,pSendPacket); - } - - if (pRecvPacket != NULL) { - HTC_FREE_CONTROL_RX(target,pRecvPacket); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("-HTCConnectService \n")); - - return status; -} - -static void AddToEndpointDistList(HTC_TARGET *target, HTC_ENDPOINT_CREDIT_DIST *pEpDist) -{ - HTC_ENDPOINT_CREDIT_DIST *pCurEntry = NULL; - HTC_ENDPOINT_CREDIT_DIST *pLastEntry = NULL; - - if (NULL == target->EpCreditDistributionListHead) { - target->EpCreditDistributionListHead = pEpDist; - pEpDist->pNext = NULL; - pEpDist->pPrev = NULL; - return; - } - - /* queue to the end of the list, this does not have to be very - * fast since this list is built at startup time */ - pCurEntry = target->EpCreditDistributionListHead; - - while (pCurEntry) { - pLastEntry = pCurEntry; - pCurEntry = pCurEntry->pNext; - } - - pLastEntry->pNext = pEpDist; - pEpDist->pPrev = pLastEntry; - pEpDist->pNext = NULL; -} - - - -/* default credit init callback */ -static void HTCDefaultCreditInit(void *Context, - HTC_ENDPOINT_CREDIT_DIST *pEPList, - int TotalCredits) -{ - HTC_ENDPOINT_CREDIT_DIST *pCurEpDist; - int totalEps = 0; - int creditsPerEndpoint; - - pCurEpDist = pEPList; - /* first run through the list and figure out how many endpoints we are dealing with */ - while (pCurEpDist != NULL) { - pCurEpDist = pCurEpDist->pNext; - totalEps++; - } - - /* even distribution */ - creditsPerEndpoint = TotalCredits/totalEps; - - pCurEpDist = pEPList; - /* run through the list and set minimum and normal credits and - * provide the endpoint with some credits to start */ - while (pCurEpDist != NULL) { - - if (creditsPerEndpoint < pCurEpDist->TxCreditsPerMaxMsg) { - /* too many endpoints and not enough credits */ - AR_DEBUG_ASSERT(FALSE); - break; - } - /* our minimum is set for at least 1 max message */ - pCurEpDist->TxCreditsMin = pCurEpDist->TxCreditsPerMaxMsg; - /* this value is ignored by our credit alg, since we do - * not dynamically adjust credits, this is the policy of - * the "default" credit distribution, something simple and easy */ - pCurEpDist->TxCreditsNorm = 0xFFFF; - /* give the endpoint minimum credits */ - pCurEpDist->TxCredits = creditsPerEndpoint; - pCurEpDist->TxCreditsAssigned = creditsPerEndpoint; - pCurEpDist = pCurEpDist->pNext; - } - -} - -/* default credit distribution callback, NOTE, this callback holds the TX lock */ -void HTCDefaultCreditDist(void *Context, - HTC_ENDPOINT_CREDIT_DIST *pEPDistList, - HTC_CREDIT_DIST_REASON Reason) -{ - HTC_ENDPOINT_CREDIT_DIST *pCurEpDist; - - if (Reason == HTC_CREDIT_DIST_SEND_COMPLETE) { - pCurEpDist = pEPDistList; - /* simple distribution */ - while (pCurEpDist != NULL) { - if (pCurEpDist->TxCreditsToDist > 0) { - /* just give the endpoint back the credits */ - pCurEpDist->TxCredits += pCurEpDist->TxCreditsToDist; - pCurEpDist->TxCreditsToDist = 0; - } - pCurEpDist = pCurEpDist->pNext; - } - } - - /* note we do not need to handle the other reason codes as this is a very - * simple distribution scheme, no need to seek for more credits or handle inactivity */ -} - -void HTCSetCreditDistribution(HTC_HANDLE HTCHandle, - void *pCreditDistContext, - HTC_CREDIT_DIST_CALLBACK CreditDistFunc, - HTC_CREDIT_INIT_CALLBACK CreditInitFunc, - HTC_SERVICE_ID ServicePriorityOrder[], - int ListLength) -{ - HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); - int i; - int ep; - - if (CreditInitFunc != NULL) { - /* caller has supplied their own distribution functions */ - target->InitCredits = CreditInitFunc; - AR_DEBUG_ASSERT(CreditDistFunc != NULL); - target->DistributeCredits = CreditDistFunc; - target->pCredDistContext = pCreditDistContext; - } else { - /* caller wants HTC to do distribution */ - /* if caller wants service to handle distributions then - * it must set both of these to NULL! */ - AR_DEBUG_ASSERT(CreditDistFunc == NULL); - target->InitCredits = HTCDefaultCreditInit; - target->DistributeCredits = HTCDefaultCreditDist; - target->pCredDistContext = target; - } - - /* always add HTC control endpoint first, we only expose the list after the - * first one, this is added for TX queue checking */ - AddToEndpointDistList(target, &target->EndPoint[ENDPOINT_0].CreditDist); - - /* build the list of credit distribution structures in priority order - * supplied by the caller, these will follow endpoint 0 */ - for (i = 0; i < ListLength; i++) { - /* match services with endpoints and add the endpoints to the distribution list - * in FIFO order */ - for (ep = ENDPOINT_1; ep < ENDPOINT_MAX; ep++) { - if (target->EndPoint[ep].ServiceID == ServicePriorityOrder[i]) { - /* queue this one to the list */ - AddToEndpointDistList(target, &target->EndPoint[ep].CreditDist); - break; - } - } - AR_DEBUG_ASSERT(ep < ENDPOINT_MAX); - } - -} diff --git a/drivers/net/wireless/ar6003/host/include/a_config.h b/drivers/net/wireless/ar6003/host/include/a_config.h deleted file mode 100644 index 5f789917b39b..000000000000 --- a/drivers/net/wireless/ar6003/host/include/a_config.h +++ /dev/null @@ -1,57 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This file contains software configuration options that enables -// specific software "features" -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _A_CONFIG_H_ -#define _A_CONFIG_H_ - -#ifdef ATHR_WM_NWF -#include "../os/windows/include/config.h" -#endif - -#ifdef ATHR_CE_LEGACY -#include "../os/windows/include/config.h" -#endif - -#if defined(__linux__) && !defined(LINUX_EMULATION) -#include "../os/linux/include/config_linux.h" -#endif - -#ifdef REXOS -#include "../os/rexos/include/common/config_rexos.h" -#endif - -#ifdef ATHR_WIN_NWF -#include "../os/windows/include/config.h" -#pragma warning( disable:4242) -#pragma warning( disable:4100) -#pragma warning( disable:4189) -#pragma warning( disable:4244) -#pragma warning( disable:4701) -#pragma warning( disable:4389) -#pragma warning( disable:4057) -#pragma warning( disable:28193) -#endif - -#endif diff --git a/drivers/net/wireless/ar6003/host/include/a_debug.h b/drivers/net/wireless/ar6003/host/include/a_debug.h deleted file mode 100644 index bde27e6bea3e..000000000000 --- a/drivers/net/wireless/ar6003/host/include/a_debug.h +++ /dev/null @@ -1,219 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== -#ifndef _A_DEBUG_H_ -#define _A_DEBUG_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include - - /* standard debug print masks bits 0..7 */ -#define ATH_DEBUG_ERR (1 << 0) /* errors */ -#define ATH_DEBUG_WARN (1 << 1) /* warnings */ -#define ATH_DEBUG_INFO (1 << 2) /* informational (module startup info) */ -#define ATH_DEBUG_TRC (1 << 3) /* generic function call tracing */ -#define ATH_DEBUG_RSVD1 (1 << 4) -#define ATH_DEBUG_RSVD2 (1 << 5) -#define ATH_DEBUG_RSVD3 (1 << 6) -#define ATH_DEBUG_RSVD4 (1 << 7) - -#define ATH_DEBUG_MASK_DEFAULTS (ATH_DEBUG_ERR | ATH_DEBUG_WARN) -#define ATH_DEBUG_ANY 0xFFFF - - /* other aliases used throughout */ -#define ATH_DEBUG_ERROR ATH_DEBUG_ERR -#define ATH_LOG_ERR ATH_DEBUG_ERR -#define ATH_LOG_INF ATH_DEBUG_INFO -#define ATH_LOG_TRC ATH_DEBUG_TRC -#define ATH_DEBUG_TRACE ATH_DEBUG_TRC -#define ATH_DEBUG_INIT ATH_DEBUG_INFO - - /* bits 8..31 are module-specific masks */ -#define ATH_DEBUG_MODULE_MASK_SHIFT 8 - - /* macro to make a module-specific masks */ -#define ATH_DEBUG_MAKE_MODULE_MASK(index) (1 << (ATH_DEBUG_MODULE_MASK_SHIFT + (index))) - -void DebugDumpBytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription); - -/* Debug support on a per-module basis - * - * Usage: - * - * Each module can utilize it's own debug mask variable. A set of commonly used - * masks are provided (ERRORS, WARNINGS, TRACE etc..). It is up to each module - * to define module-specific masks using the macros above. - * - * Each module defines a single debug mask variable debug_XXX where the "name" of the module is - * common to all C-files within that module. This requires every C-file that includes a_debug.h - * to define the module name in that file. - * - * Example: - * - * #define ATH_MODULE_NAME htc - * #include "a_debug.h" - * - * This will define a debug mask structure called debug_htc and all debug macros will reference this - * variable. - * - * A module can define module-specific bit masks using the ATH_DEBUG_MAKE_MODULE_MASK() macro: - * - * #define ATH_DEBUG_MY_MASK1 ATH_DEBUG_MAKE_MODULE_MASK(0) - * #define ATH_DEBUG_MY_MASK2 ATH_DEBUG_MAKE_MODULE_MASK(1) - * - * The instantiation of the debug structure should be made by the module. When a module is - * instantiated, the module can set a description string, a default mask and an array of description - * entries containing information on each module-defined debug mask. - * NOTE: The instantiation is statically allocated, only one instance can exist per module. - * - * Example: - * - * - * #define ATH_DEBUG_BMI ATH_DEBUG_MAKE_MODULE_MASK(0) - * - * #ifdef DEBUG - * static ATH_DEBUG_MASK_DESCRIPTION bmi_debug_desc[] = { - * { ATH_DEBUG_BMI , "BMI Tracing"}, <== description of the module specific mask - * }; - * - * ATH_DEBUG_INSTANTIATE_MODULE_VAR(bmi, - * "bmi" <== module name - * "Boot Manager Interface", <== description of module - * ATH_DEBUG_MASK_DEFAULTS, <== defaults - * ATH_DEBUG_DESCRIPTION_COUNT(bmi_debug_desc), - * bmi_debug_desc); - * - * #endif - * - * A module can optionally register it's debug module information in order for other tools to change the - * bit mask at runtime. A module can call A_REGISTER_MODULE_DEBUG_INFO() in it's module - * init code. This macro can be called multiple times without consequence. The debug info maintains - * state to indicate whether the information was previously registered. - * - * */ - -#define ATH_DEBUG_MAX_MASK_DESC_LENGTH 32 -#define ATH_DEBUG_MAX_MOD_DESC_LENGTH 64 - -typedef struct { - A_UINT32 Mask; - A_CHAR Description[ATH_DEBUG_MAX_MASK_DESC_LENGTH]; -} ATH_DEBUG_MASK_DESCRIPTION; - -#define ATH_DEBUG_INFO_FLAGS_REGISTERED (1 << 0) - -typedef struct _ATH_DEBUG_MODULE_DBG_INFO{ - struct _ATH_DEBUG_MODULE_DBG_INFO *pNext; - A_CHAR ModuleName[16]; - A_CHAR ModuleDescription[ATH_DEBUG_MAX_MOD_DESC_LENGTH]; - A_UINT32 Flags; - A_UINT32 CurrentMask; - int MaxDescriptions; - ATH_DEBUG_MASK_DESCRIPTION *pMaskDescriptions; /* pointer to array of descriptions */ -} ATH_DEBUG_MODULE_DBG_INFO; - -#define ATH_DEBUG_DESCRIPTION_COUNT(d) (int)((sizeof((d))) / (sizeof(ATH_DEBUG_MASK_DESCRIPTION))) - -#define GET_ATH_MODULE_DEBUG_VAR_NAME(s) _XGET_ATH_MODULE_NAME_DEBUG_(s) -#define GET_ATH_MODULE_DEBUG_VAR_MASK(s) _XGET_ATH_MODULE_NAME_DEBUG_(s).CurrentMask -#define _XGET_ATH_MODULE_NAME_DEBUG_(s) debug_ ## s - -#ifdef DEBUG - - /* for source files that will instantiate the debug variables */ -#define ATH_DEBUG_INSTANTIATE_MODULE_VAR(s,name,moddesc,initmask,count,descriptions) \ -ATH_DEBUG_MODULE_DBG_INFO GET_ATH_MODULE_DEBUG_VAR_NAME(s) = \ - {NULL,(name),(moddesc),0,(initmask),count,(descriptions)} - -#ifdef ATH_MODULE_NAME -extern ATH_DEBUG_MODULE_DBG_INFO GET_ATH_MODULE_DEBUG_VAR_NAME(ATH_MODULE_NAME); -#define AR_DEBUG_LVL_CHECK(lvl) (GET_ATH_MODULE_DEBUG_VAR_MASK(ATH_MODULE_NAME) & (lvl)) -#endif /* ATH_MODULE_NAME */ - -#define ATH_DEBUG_SET_DEBUG_MASK(s,lvl) GET_ATH_MODULE_DEBUG_VAR_MASK(s) = (lvl) - -#define ATH_DEBUG_DECLARE_EXTERN(s) \ - extern ATH_DEBUG_MODULE_DBG_INFO GET_ATH_MODULE_DEBUG_VAR_NAME(s) - -#define AR_DEBUG_PRINTBUF(buffer, length, desc) DebugDumpBytes(buffer,length,desc) - - -#define AR_DEBUG_ASSERT A_ASSERT - -void a_dump_module_debug_info(ATH_DEBUG_MODULE_DBG_INFO *pInfo); -void a_register_module_debug_info(ATH_DEBUG_MODULE_DBG_INFO *pInfo); -#define A_DUMP_MODULE_DEBUG_INFO(s) a_dump_module_debug_info(&(GET_ATH_MODULE_DEBUG_VAR_NAME(s))) -#define A_REGISTER_MODULE_DEBUG_INFO(s) a_register_module_debug_info(&(GET_ATH_MODULE_DEBUG_VAR_NAME(s))) - -#else /* !DEBUG */ - /* NON DEBUG */ -#define ATH_DEBUG_INSTANTIATE_MODULE_VAR(s,name,moddesc,initmask,count,descriptions) -#define AR_DEBUG_LVL_CHECK(lvl) 0 -#define AR_DEBUG_PRINTBUF(buffer, length, desc) -#define AR_DEBUG_ASSERT(test) -#define ATH_DEBUG_DECLARE_EXTERN(s) -#define ATH_DEBUG_SET_DEBUG_MASK(s,lvl) -#define A_DUMP_MODULE_DEBUG_INFO(s) -#define A_REGISTER_MODULE_DEBUG_INFO(s) - -#endif - -A_STATUS a_get_module_mask(A_CHAR *module_name, A_UINT32 *pMask); -A_STATUS a_set_module_mask(A_CHAR *module_name, A_UINT32 Mask); -void a_dump_module_debug_info_by_name(A_CHAR *module_name); -void a_module_debug_support_init(void); -void a_module_debug_support_cleanup(void); - -#ifdef ATHR_WM_NWF -#include "../os/windows/include/debug.h" -#endif - -#ifdef ATHR_CE_LEGACY -#include "../os/windows/include/debug.h" -#endif - -#if defined(__linux__) && !defined(LINUX_EMULATION) -#include "../os/linux/include/debug_linux.h" -#endif - -#ifdef REXOS -#include "../os/rexos/include/common/debug_rexos.h" -#endif - -#if defined ART_WIN -#include "../os/win_art/include/debug_win.h" -#endif - -#ifdef ATHR_WIN_NWF -#include "../os/windows/include/win/debug_win.h" -#endif - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif diff --git a/drivers/net/wireless/ar6003/host/include/a_drv.h b/drivers/net/wireless/ar6003/host/include/a_drv.h deleted file mode 100644 index e86f2e584ff1..000000000000 --- a/drivers/net/wireless/ar6003/host/include/a_drv.h +++ /dev/null @@ -1,50 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This file contains the definitions of the basic atheros data types. -// It is used to map the data types in atheros files to a platform specific -// type. -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _A_DRV_H_ -#define _A_DRV_H_ - -#if defined(__linux__) && !defined(LINUX_EMULATION) -#include "../os/linux/include/athdrv_linux.h" -#endif - -#ifdef ATHR_WM_NWF -#include "../os/windows/include/athdrv.h" -#endif - -#ifdef ATHR_CE_LEGACY -#include "../os/windows/include/athdrv.h" -#endif - -#ifdef REXOS -#include "../os/rexos/include/common/athdrv_rexos.h" -#endif - -#ifdef ATHR_WIN_NWF -#include "../os/windows/include/athdrv.h" -#endif - -#endif /* _ADRV_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/a_drv_api.h b/drivers/net/wireless/ar6003/host/include/a_drv_api.h deleted file mode 100644 index 71bc3fd20032..000000000000 --- a/drivers/net/wireless/ar6003/host/include/a_drv_api.h +++ /dev/null @@ -1,333 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== -#ifndef _A_DRV_API_H_ -#define _A_DRV_API_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/****************************************************************************/ -/****************************************************************************/ -/** **/ -/** WMI related hooks **/ -/** **/ -/****************************************************************************/ -/****************************************************************************/ - -#include - -#define A_WMI_CHANNELLIST_RX(devt, numChan, chanList) \ - ar6000_channelList_rx((devt), (numChan), (chanList)) - -#define A_WMI_SET_NUMDATAENDPTS(devt, num) \ - ar6000_set_numdataendpts((devt), (num)) - -#define A_WMI_CONTROL_TX(devt, osbuf, streamID) \ - ar6000_control_tx((devt), (osbuf), (streamID)) - -#define A_WMI_TARGETSTATS_EVENT(devt, pStats, len) \ - ar6000_targetStats_event((devt), (pStats), (len)) - -#define A_WMI_SCANCOMPLETE_EVENT(devt, status) \ - ar6000_scanComplete_event((devt), (status)) - -#ifdef CONFIG_HOST_DSET_SUPPORT - -#define A_WMI_DSET_DATA_REQ(devt, access_cookie, offset, length, targ_buf, targ_reply_fn, targ_reply_arg) \ - ar6000_dset_data_req((devt), (access_cookie), (offset), (length), (targ_buf), (targ_reply_fn), (targ_reply_arg)) - -#define A_WMI_DSET_CLOSE(devt, access_cookie) \ - ar6000_dset_close((devt), (access_cookie)) - -#endif - -#define A_WMI_DSET_OPEN_REQ(devt, id, targ_handle, targ_reply_fn, targ_reply_arg) \ - ar6000_dset_open_req((devt), (id), (targ_handle), (targ_reply_fn), (targ_reply_arg)) - -#define A_WMI_CONNECT_EVENT(devt, pEvt) \ - ar6000_connect_event((devt), (pEvt)) - -#define A_WMI_PSPOLL_EVENT(devt, aid)\ - ar6000_pspoll_event((devt),(aid)) - -#define A_WMI_DTIMEXPIRY_EVENT(devt)\ - ar6000_dtimexpiry_event((devt)) - -#ifdef WAPI_ENABLE -#define A_WMI_WAPI_REKEY_EVENT(devt, type, mac)\ - ap_wapi_rekey_event((devt),(type),(mac)) -#endif - -#ifdef P2P -#define A_WMI_P2PGONEG_EVENT(devt, res, len)\ - p2p_go_neg_event((devt),(res), (len)) - -#define A_WMI_P2PGONEG_REQ_EVENT(devt, sa, dev_passwd_id)\ - p2p_go_neg_req_event((devt), (sa), (dev_passwd_id)) - -#define A_WMI_P2P_INVITE_SENT_RESULT_EVENT(devt, res, len)\ - p2p_invite_sent_result_event((devt), (res), (len)) - -#define A_WMI_P2P_INVITE_RCVD_RESULT_EVENT(devt, res, len)\ - p2p_invite_rcvd_result_event((devt), (res), (len)) - -#define A_WMI_P2PDEV_EVENT(devt, addr, dev_addr, \ - pri_dev_type, dev_name, dev_name_len, config_methods,\ - dev_capab, grp_capab)\ - ar6000_p2pdev_event((devt), (addr), (dev_addr),\ - (pri_dev_type), (dev_name), (dev_name_len), (config_methods),\ - (dev_capab), (grp_capab)) - -#define A_WMI_P2P_PROV_DISC_REQ_EVENT(devt, peer, config_methods, dev_addr, \ - pri_dev_type, dev_name, dev_name_len, supp_config_methods,\ - dev_capab, group_capab) \ - ar6000_p2p_prov_disc_req_event((devt), (peer), (config_methods), \ - (dev_addr), (pri_dev_type), (dev_name), (dev_name_len),\ - (supp_config_methods), (dev_capab), (group_capab)) - -#define A_WMI_P2P_PROV_DISC_RESP_EVENT(devt, peer, config_methods) \ - ar6000_p2p_prov_disc_resp_event((devt), (peer), (config_methods)) - -#define A_WMI_GET_P2P_CTX(devt) \ - get_p2p_ctx((devt)) - -#define A_WMI_GET_WMI_CTX(devt) \ - get_wmi_ctx((devt)) - -#define A_WMI_GET_DEV_NETWORK_SUBTYPE(devt) \ - get_network_subtype((devt)) - -#define A_WMI_P2P_SD_RX_EVENT(devt, ev) \ - ar6000_p2p_sd_rx_event((devt), (ev)) -#endif /* P2P */ - -#ifdef CONFIG_WLAN_RFKILL -#define A_WMI_RFKILL_STATE_CHANGE_EVENT(devt,radiostate) \ - ar6000_rfkill_state_change_event((devt),(radiostate)) - -#define A_WMI_RFKILL_GET_MODE_CMD_EVENT(devt,datap,len) \ - ar6000_rfkill_get_mode_cmd_event_rx((devt),(datap)); - -#endif - -#define A_WMI_REGDOMAIN_EVENT(devt, regCode) \ - ar6000_regDomain_event((devt), (regCode)) - -#define A_WMI_NEIGHBORREPORT_EVENT(devt, numAps, info) \ - ar6000_neighborReport_event((devt), (numAps), (info)) - -#define A_WMI_DISCONNECT_EVENT(devt, reason, bssid, assocRespLen, assocInfo, protocolReasonStatus) \ - ar6000_disconnect_event((devt), (reason), (bssid), (assocRespLen), (assocInfo), (protocolReasonStatus)) - -#ifdef ATH_SUPPORT_DFS - -#define A_WMI_DFS_ATTACH_EVENT(devt, capinfo) \ - ar6000_dfs_attach_event((devt),(capinfo)) - -#define A_WMI_DFS_INIT_EVENT(devt, capinfo) \ - ar6000_dfs_init_event((devt),(capinfo)) - -#define A_WMI_DFS_PHYERR_EVENT(devt, info) \ - ar6000_dfs_phyerr_event((devt),(info)) - -#define A_WMI_DFS_RESET_DELAYLINES_EVENT(devt) \ - ar6000_dfs_reset_delaylines_event((devt)) - -#define A_WMI_DFS_RESET_RADARQ_EVENT(devt) \ - ar6000_dfs_reset_radarq_event((devt)) - -#define A_WMI_DFS_RESET_AR_EVENT(devt) \ - ar6000_dfs_reset_ar_event((devt)) - -#define A_WMI_DFS_RESET_ARQ_EVENT(devt) \ - ar6000_dfs_reset_arq_event((devt)) - -#define A_WMI_DFS_SET_DUR_MULTIPLIER_EVENT(devt, value) \ - ar6000_dfs_set_dur_multiplier_event((devt), (value)) - -#define A_WMI_DFS_SET_BANGRADAR_EVENT(devt, value) \ - ar6000_dfs_set_bangradar_event((devt), (value)) - -#define A_WMI_DFS_SET_DEBUGLEVEL_EVENT(devt, value) \ - ar6000_dfs_set_debuglevel_event((devt), (value)) - -#endif /* ATH_SUPPORT_DFS */ - -#define A_WMI_TKIP_MICERR_EVENT(devt, keyid, ismcast) \ - ar6000_tkip_micerr_event((devt), (keyid), (ismcast)) - -#define A_WMI_BITRATE_RX(devt, rateKbps) \ - ar6000_bitrate_rx((devt), (rateKbps)) - -#define A_WMI_TXPWR_RX(devt, txPwr) \ - ar6000_txPwr_rx((devt), (txPwr)) - -#define A_WMI_READY_EVENT(devt, datap, phyCap, sw_ver, abi_ver) \ - ar6000_ready_event((devt), (datap), (phyCap), (sw_ver), (abi_ver)) - -#define A_WMI_DBGLOG_INIT_DONE(devt) \ - ar6000_dbglog_init_done(devt); - -#define A_WMI_RSSI_THRESHOLD_EVENT(devt, newThreshold, rssi) \ - ar6000_rssiThreshold_event((devt), (newThreshold), (rssi)) - -#define A_WMI_REPORT_ERROR_EVENT(devt, errorVal) \ - ar6000_reportError_event((devt), (errorVal)) - -#define A_WMI_ROAM_TABLE_EVENT(devt, pTbl) \ - ar6000_roam_tbl_event((devt), (pTbl)) - -#define A_WMI_ROAM_DATA_EVENT(devt, p) \ - ar6000_roam_data_event((devt), (p)) - -#define A_WMI_WOW_LIST_EVENT(devt, num_filters, wow_filters) \ - ar6000_wow_list_event((devt), (num_filters), (wow_filters)) - -#define A_WMI_CAC_EVENT(devt, ac, cac_indication, statusCode, tspecSuggestion) \ - ar6000_cac_event((devt), (ac), (cac_indication), (statusCode), (tspecSuggestion)) - -#define A_WMI_CHANNEL_CHANGE_EVENT(devt, oldChannel, newChannel) \ - ar6000_channel_change_event((devt), (oldChannel), (newChannel)) - -#define A_WMI_PMKID_LIST_EVENT(devt, num_pmkid, pmkid_list, bssid_list) \ - ar6000_pmkid_list_event((devt), (num_pmkid), (pmkid_list), (bssid_list)) - -#define A_WMI_PEER_EVENT(devt, eventCode, bssid) \ - ar6000_peer_event ((devt), (eventCode), (bssid)) - -#define A_WMI_WACINFO_EVENT(devt, pStats, len) \ - ar6000_wacinfo_event((devt), (pStats), (len)) - -#ifdef CONFIG_HOST_GPIO_SUPPORT - -#define A_WMI_GPIO_INTR_RX(devt, intr_mask, input_values) \ - ar6000_gpio_intr_rx((devt), (intr_mask), (input_values)) - -#define A_WMI_GPIO_DATA_RX(devt, reg_id, value) \ - ar6000_gpio_data_rx((devt), (reg_id), (value)) - -#define A_WMI_GPIO_ACK_RX(devt) \ - ar6000_gpio_ack_rx((devt)) - -#endif - -#ifdef SEND_EVENT_TO_APP - -#define A_WMI_SEND_EVENT_TO_APP(ar, eventId, datap, len) \ - ar6000_send_event_to_app((ar), (eventId), (datap), (len)) - -#define A_WMI_SEND_GENERIC_EVENT_TO_APP(ar, eventId, datap, len) \ - ar6000_send_generic_event_to_app((ar), (eventId), (datap), (len)) - -#else - -#define A_WMI_SEND_EVENT_TO_APP(ar, eventId, datap, len) -#define A_WMI_SEND_GENERIC_EVENT_TO_APP(ar, eventId, datap, len) - -#endif - -#ifdef CONFIG_HOST_TCMD_SUPPORT -#define A_WMI_TCMD_RX_REPORT_EVENT(devt, results, len) \ - ar6000_tcmd_rx_report_event((devt), (results), (len)) -#endif - -#define A_WMI_HBCHALLENGERESP_EVENT(devt, cookie, source) \ - ar6000_hbChallengeResp_event((devt), (cookie), (source)) - -#define A_WMI_TX_RETRY_ERR_EVENT(devt) \ - ar6000_tx_retry_err_event((devt)) - -#define A_WMI_SNR_THRESHOLD_EVENT_RX(devt, newThreshold, snr) \ - ar6000_snrThresholdEvent_rx((devt), (newThreshold), (snr)) - -#define A_WMI_LQ_THRESHOLD_EVENT_RX(devt, range, lqVal) \ - ar6000_lqThresholdEvent_rx((devt), (range), (lqVal)) - -#define A_WMI_RATEMASK_RX(devt, ratemask) \ - ar6000_ratemask_rx((devt), (ratemask)) - -#define A_WMI_KEEPALIVE_RX(devt, configured) \ - ar6000_keepalive_rx((devt), (configured)) - -#define A_WMI_BSSINFO_EVENT_RX(ar, datp, len) \ - ar6000_bssInfo_event_rx((ar), (datap), (len)) - -#define A_WMI_DBGLOG_EVENT(ar, dropped, buffer, length) \ - ar6000_dbglog_event((ar), (dropped), (buffer), (length)); - -#define A_WMI_STREAM_TX_ACTIVE(devt,trafficClass) \ - ar6000_indicate_tx_activity((devt),(trafficClass), TRUE) - -#define A_WMI_STREAM_TX_INACTIVE(devt,trafficClass) \ - ar6000_indicate_tx_activity((devt),(trafficClass), FALSE) -#define A_WMI_Ac2EndpointID(devht, ac)\ - ar6000_ac2_endpoint_id((devht), (ac)) - -#define A_WMI_AGGR_RECV_ADDBA_REQ_EVT(devt, cmd)\ - ar6000_aggr_rcv_addba_req_evt((devt), (cmd)) -#define A_WMI_AGGR_RECV_ADDBA_RESP_EVT(devt, cmd)\ - ar6000_aggr_rcv_addba_resp_evt((devt), (cmd)) -#define A_WMI_AGGR_RECV_DELBA_REQ_EVT(devt, cmd)\ - ar6000_aggr_rcv_delba_req_evt((devt), (cmd)) -#define A_WMI_HCI_EVENT_EVT(devt, cmd)\ - ar6000_hci_event_rcv_evt((devt), (cmd)) - -#define A_WMI_Endpoint2Ac(devt, ep) \ - ar6000_endpoint_id2_ac((devt), (ep)) - -#define A_WMI_BTCOEX_CONFIG_EVENT(devt, evt, len)\ - ar6000_btcoex_config_event((devt), (evt), (len)) - -#define A_WMI_BTCOEX_STATS_EVENT(devt, datap, len)\ - ar6000_btcoex_stats_event((devt), (datap), (len)) - -#define A_WMI_PROBERESP_RECV_EVENT(devt, datap, len, bssid)\ - ar6000_indicate_proberesp((devt), (datap), (len), (bssid)) - -#define A_WMI_BEACON_RECV_EVENT(devt, datap, len, bssid)\ - ar6000_indicate_beacon((devt), (datap), (len), (bssid)) - -#define A_WMI_ASSOC_REQ_REPORT_EVENT(devt, status, rspType, datap, len)\ - ar6000_assoc_req_report_event((devt),(status),(rspType),(datap),(len)) - -#define A_WMI_GET_DEVICE_ADDR(devt, addr) \ - ar6000_get_device_addr((devt), (addr)) - -/****************************************************************************/ -/****************************************************************************/ -/** **/ -/** HTC related hooks **/ -/** **/ -/****************************************************************************/ -/****************************************************************************/ - -#if defined(CONFIG_TARGET_PROFILE_SUPPORT) -#define A_WMI_PROF_COUNT_RX(addr, count) prof_count_rx((addr), (count)) -#endif /* CONFIG_TARGET_PROFILE_SUPPORT */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/drivers/net/wireless/ar6003/host/include/a_osapi.h b/drivers/net/wireless/ar6003/host/include/a_osapi.h deleted file mode 100644 index 47b088a33c2d..000000000000 --- a/drivers/net/wireless/ar6003/host/include/a_osapi.h +++ /dev/null @@ -1,58 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This file contains the definitions of the basic atheros data types. -// It is used to map the data types in atheros files to a platform specific -// type. -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _A_OSAPI_H_ -#define _A_OSAPI_H_ - -#if defined(__linux__) && !defined(LINUX_EMULATION) -#include "../os/linux/include/osapi_linux.h" -#endif - -#ifdef ATHR_WM_NWF -#include "../os/windows/include/osapi.h" -#include "../os/windows/include/netbuf.h" -#endif - -#ifdef ATHR_CE_LEGACY -#include "../os/windows/include/osapi.h" -#include "../os/windows/include/netbuf.h" -#endif - -#ifdef REXOS -#include "../os/rexos/include/common/osapi_rexos.h" -#endif - -#if defined ART_WIN -#include "../os/win_art/include/osapi_win.h" -#include "../os/win_art/include/netbuf.h" -#endif - -#ifdef ATHR_WIN_NWF -#include "../os/windows/include/win/osapi_win.h" -#include "../os/windows/include/netbuf.h" -#endif - -#endif /* _OSAPI_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/a_types.h b/drivers/net/wireless/ar6003/host/include/a_types.h deleted file mode 100644 index d80a78264342..000000000000 --- a/drivers/net/wireless/ar6003/host/include/a_types.h +++ /dev/null @@ -1,54 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This file contains the definitions of the basic atheros data types. -// It is used to map the data types in atheros files to a platform specific -// type. -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _A_TYPES_H_ -#define _A_TYPES_H_ - -#if defined(__linux__) && !defined(LINUX_EMULATION) -#include "../os/linux/include/athtypes_linux.h" -#endif - -#ifdef ATHR_WM_NWF -#include "../os/windows/include/athtypes.h" -#endif - -#ifdef ATHR_CE_LEGACY -#include "../os/windows/include/athtypes.h" -#endif - -#ifdef REXOS -#include "../os/rexos/include/common/athtypes_rexos.h" -#endif - -#if defined ART_WIN -#include "../os/win_art/include/athtypes_win.h" -#endif - -#ifdef ATHR_WIN_NWF -#include -#endif - -#endif /* _ATHTYPES_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/aggr_recv_api.h b/drivers/net/wireless/ar6003/host/include/aggr_recv_api.h deleted file mode 100644 index e61ec6767b18..000000000000 --- a/drivers/net/wireless/ar6003/host/include/aggr_recv_api.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * - * Copyright (c) 2004-2010 Atheros Communications Inc. - * All rights reserved. - * - * -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// - * - */ - -#ifndef __AGGR_RECV_API_H__ -#define __AGGR_RECV_API_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (* RX_CALLBACK)(void * dev, void *osbuf); - -typedef void (* ALLOC_NETBUFS)(A_NETBUF_QUEUE_T *q, A_UINT16 num); - -/* - * aggr_init: - * Initialises the data structures, allocates data queues and - * os buffers. Netbuf allocator is the input param, used by the - * aggr module for allocation of NETBUFs from driver context. - * These NETBUFs are used for AMSDU processing. - * - * Also registers OS call back function to deliver the - * frames to OS. This is generally the topmost layer of - * the driver context, after which the frames go to - * IP stack via the call back function. - * This dispatcher is active only when aggregation is ON. - * Returns A_OK if init success, else returns A_ERROR - */ -A_UINT8 -aggr_init(ALLOC_NETBUFS netbuf_allocator, RX_CALLBACK fn); - -/* - * aggr_init_conn: - * Initialises the data structures, allocates data queues and - * os buffers. Returns the context for a single conn aggr. - * For each supported conn, this API should be called. - */ -void * -aggr_init_conn(void); - -/* - * aggr_process_bar: - * When target receives BAR, it communicates to host driver - * for modifying window parameters. Target indicates this via the - * event: WMI_ADDBA_REQ_EVENTID. Host will dequeue all frames - * up to the indicated sequence number. - */ -void -aggr_process_bar(void *cntxt, A_UINT8 tid, A_UINT16 seq_no); - - -/* - * aggr_recv_addba_req_evt: - * This event is to initiate/modify the receive side window. - * Target will send WMI_ADDBA_REQ_EVENTID event to host - to setup - * recv re-ordering queues. Target will negotiate ADDBA with peer, - * and indicate via this event after succesfully completing the - * negotiation. This happens in two situations: - * 1. Initial setup of aggregation - * 2. Renegotiation of current recv window. - * Window size for re-ordering is limited by target buffer - * space, which is reflected in win_sz. - * (Re)Start the periodic timer to deliver long standing frames, - * in hold_q to OS. - */ -void -aggr_recv_addba_req_evt(void * cntxt, A_UINT8 tid, A_UINT16 seq_no, A_UINT8 win_sz); - - -/* - * aggr_recv_delba_req_evt: - * Target indicates deletion of a BA window for a tid via the - * WMI_DELBA_EVENTID. Host would deliver all the frames in the - * hold_q, reset tid config and disable the periodic timer, if - * aggr is not enabled on any tid. - */ -void -aggr_recv_delba_req_evt(void * cntxt, A_UINT8 tid); - - - -/* - * aggr_process_recv_frm: - * Called only for data frames. When aggr is ON for a tid, the buffer - * is always consumed, and osbuf would be NULL. For a non-aggr case, - * osbuf is not modified. - * AMSDU frames are consumed and are later freed. They are sliced and - * diced to individual frames and dispatched to stack. - * After consuming a osbuf(when aggr is ON), a previously registered - * callback may be called to deliver frames in order. - */ -void -aggr_process_recv_frm(void *cntxt, A_UINT8 tid, A_UINT16 seq_no, A_BOOL is_amsdu, void **osbuf); - - -/* - * aggr_module_destroy: - * Frees up all the queues and frames in them. - */ -void -aggr_module_destroy(void); - -/* - * * aggr_module_destroy_timers: - * * Disarm the timers. - * */ -void -aggr_module_destroy_timers(void *cntxt); - -/* - * aggr_module_destroy_conn: - * Frees up all the queues and frames in them. Releases the cntxt to OS. - */ -void -aggr_module_destroy_conn(void *cntxt); - -/* - * Dumps the aggregation stats - */ -void -aggr_dump_stats(void *cntxt, PACKET_LOG **log_buf); - -/* - * aggr_reset_state -- Called when it is deemed necessary to clear the aggregate - * hold Q state. Examples include when a Connect event or disconnect event is - * received. - */ -void -aggr_reset_state(void *cntxt, void *dev); - - -#ifdef __cplusplus -} -#endif - -#endif /*__AGGR_RECV_API_H__ */ diff --git a/drivers/net/wireless/ar6003/host/include/ar3kconfig.h b/drivers/net/wireless/ar6003/host/include/ar3kconfig.h deleted file mode 100644 index 3a5584e4bf02..000000000000 --- a/drivers/net/wireless/ar6003/host/include/ar3kconfig.h +++ /dev/null @@ -1,65 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2009-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -/* AR3K module configuration APIs for HCI-bridge operation */ - -#ifndef AR3KCONFIG_H_ -#define AR3KCONFIG_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define AR3K_CONFIG_FLAG_FORCE_MINBOOT_EXIT (1 << 0) -#define AR3K_CONFIG_FLAG_SET_AR3K_BAUD (1 << 1) -#define AR3K_CONFIG_FLAG_AR3K_BAUD_CHANGE_DELAY (1 << 2) -#define AR3K_CONFIG_FLAG_SET_AR6K_SCALE_STEP (1 << 3) - - -typedef struct { - A_UINT32 Flags; /* config flags */ - void *pHCIDev; /* HCI bridge device */ - HCI_TRANSPORT_PROPERTIES *pHCIProps; /* HCI bridge props */ - HIF_DEVICE *pHIFDevice; /* HIF layer device */ - - A_UINT32 AR3KBaudRate; /* AR3K operational baud rate */ - A_UINT16 AR6KScale; /* AR6K UART scale value */ - A_UINT16 AR6KStep; /* AR6K UART step value */ - struct hci_dev *pBtStackHCIDev; /* BT Stack HCI dev */ - A_UINT32 PwrMgmtEnabled; /* TLPM enabled? */ - A_UINT32 IdleTimeout; /* TLPM idle timeout */ - A_UINT16 WakeupTimeout; /* TLPM wakeup timeout */ - A_UINT8 bdaddr[6]; /* Bluetooth device address */ -} AR3K_CONFIG_INFO; - -A_STATUS AR3KConfigure(AR3K_CONFIG_INFO *pConfigInfo); - -A_STATUS AR3KConfigureExit(void *config); - -#ifdef __cplusplus -} -#endif - -#endif /*AR3KCONFIG_H_*/ diff --git a/drivers/net/wireless/ar6003/host/include/ar6000_api.h b/drivers/net/wireless/ar6003/host/include/ar6000_api.h deleted file mode 100644 index 62f7766aedf3..000000000000 --- a/drivers/net/wireless/ar6003/host/include/ar6000_api.h +++ /dev/null @@ -1,54 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This file contains the API to access the OS dependent atheros host driver -// by the WMI or WLAN generic modules. -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _AR6000_API_H_ -#define _AR6000_API_H_ - -#if defined(__linux__) && !defined(LINUX_EMULATION) -#include "../os/linux/include/ar6xapi_linux.h" -#endif - -#ifdef ATHR_WM_NWF -#include "../os/windows/include/ar6xapi.h" -#endif - -#ifdef ATHR_CE_LEGACY -#include "../os/windows/include/ar6xapi.h" -#endif - -#ifdef REXOS -#include "../os/rexos/include/common/ar6xapi_rexos.h" -#endif - -#if defined ART_WIN -#include "../os/win_art/include/ar6xapi_win.h" -#endif - -#ifdef ATHR_WIN_NWF -#include "../os/windows/include/ar6xapi.h" -#endif - -#endif /* _AR6000_API_H */ - diff --git a/drivers/net/wireless/ar6003/host/include/ar6000_diag.h b/drivers/net/wireless/ar6003/host/include/ar6000_diag.h deleted file mode 100644 index b53512e23d32..000000000000 --- a/drivers/net/wireless/ar6003/host/include/ar6000_diag.h +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef AR6000_DIAG_H_ -#define AR6000_DIAG_H_ - - -A_STATUS -ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data); - -A_STATUS -ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data); - -A_STATUS -ar6000_ReadDataDiag(HIF_DEVICE *hifDevice, A_UINT32 address, - A_UCHAR *data, A_UINT32 length); - -A_STATUS -ar6000_WriteDataDiag(HIF_DEVICE *hifDevice, A_UINT32 address, - A_UCHAR *data, A_UINT32 length); - -A_STATUS -ar6k_ReadTargetRegister(HIF_DEVICE *hifDevice, int regsel, A_UINT32 *regval); - -void -ar6k_FetchTargetRegs(HIF_DEVICE *hifDevice, A_UINT32 *targregs); - -#endif /*AR6000_DIAG_H_*/ diff --git a/drivers/net/wireless/ar6003/host/include/ar6kap_common.h b/drivers/net/wireless/ar6003/host/include/ar6kap_common.h deleted file mode 100644 index 9ab85314741d..000000000000 --- a/drivers/net/wireless/ar6003/host/include/ar6kap_common.h +++ /dev/null @@ -1,46 +0,0 @@ -//------------------------------------------------------------------------------ - -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ - -//============================================================================== - -// This file contains the definitions of common AP mode data structures. -// -// Author(s): ="Atheros" -//============================================================================== - -#ifndef _AR6KAP_COMMON_H_ -#define _AR6KAP_COMMON_H_ -/* - * Used with AR6000_XIOCTL_AP_GET_STA_LIST - */ -typedef struct { - A_UINT8 mac[ATH_MAC_LEN]; - A_UINT8 aid; - A_UINT8 keymgmt; - A_UINT8 ucipher; - A_UINT8 auth; - A_UINT8 wmode; -} station_t; - -typedef struct { - station_t sta[AP_MAX_NUM_STA]; -} ap_get_sta_t; -#endif /* _AR6KAP_COMMON_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/athbtfilter.h b/drivers/net/wireless/ar6003/host/include/athbtfilter.h deleted file mode 100644 index b7ba661f03d6..000000000000 --- a/drivers/net/wireless/ar6003/host/include/athbtfilter.h +++ /dev/null @@ -1,135 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Public Bluetooth filter APIs -// Author(s): ="Atheros" -//============================================================================== -#ifndef ATHBTFILTER_H_ -#define ATHBTFILTER_H_ - -#define ATH_DEBUG_INFO (1 << 2) -#define ATH_DEBUG_INF ATH_DEBUG_INFO - -typedef enum _ATHBT_HCI_CTRL_TYPE { - ATHBT_HCI_COMMAND = 0, - ATHBT_HCI_EVENT = 1, -} ATHBT_HCI_CTRL_TYPE; - -typedef enum _ATHBT_STATE_INDICATION { - ATH_BT_NOOP = 0, - ATH_BT_INQUIRY = 1, - ATH_BT_CONNECT = 2, - ATH_BT_SCO = 3, - ATH_BT_ACL = 4, - ATH_BT_A2DP = 5, - ATH_BT_ESCO = 6, - /* new states go here.. */ - - ATH_BT_MAX_STATE_INDICATION -} ATHBT_STATE_INDICATION; - - /* filter function for OUTGOING commands and INCOMMING events */ -typedef void (*ATHBT_FILTER_CMD_EVENTS_FN)(void *pContext, ATHBT_HCI_CTRL_TYPE Type, unsigned char *pBuffer, int Length); - - /* filter function for OUTGOING data HCI packets */ -typedef void (*ATHBT_FILTER_DATA_FN)(void *pContext, unsigned char *pBuffer, int Length); - -typedef enum _ATHBT_STATE { - STATE_OFF = 0, - STATE_ON = 1, - STATE_MAX -} ATHBT_STATE; - - /* BT state indication (when filter functions are not used) */ - -typedef void (*ATHBT_INDICATE_STATE_FN)(void *pContext, ATHBT_STATE_INDICATION Indication, ATHBT_STATE State, unsigned char LMPVersion); - -typedef struct _ATHBT_FILTER_INSTANCE { -#ifdef UNDER_CE - WCHAR *pWlanAdapterName; /* filled in by user */ -#else - A_CHAR *pWlanAdapterName; /* filled in by user */ -#endif /* UNDER_CE */ - int FilterEnabled; /* filtering is enabled */ - int Attached; /* filter library is attached */ - void *pContext; /* private context for filter library */ - ATHBT_FILTER_CMD_EVENTS_FN pFilterCmdEvents; /* function ptr to filter a command or event */ - ATHBT_FILTER_DATA_FN pFilterAclDataOut; /* function ptr to filter ACL data out (to radio) */ - ATHBT_FILTER_DATA_FN pFilterAclDataIn; /* function ptr to filter ACL data in (from radio) */ - ATHBT_INDICATE_STATE_FN pIndicateState; /* function ptr to indicate a state */ -} ATH_BT_FILTER_INSTANCE; - - -/* API MACROS */ - -#define AthBtFilterHciCommand(instance,packet,length) \ - if ((instance)->FilterEnabled) { \ - (instance)->pFilterCmdEvents((instance)->pContext, \ - ATHBT_HCI_COMMAND, \ - (unsigned char *)(packet), \ - (length)); \ - } - -#define AthBtFilterHciEvent(instance,packet,length) \ - if ((instance)->FilterEnabled) { \ - (instance)->pFilterCmdEvents((instance)->pContext, \ - ATHBT_HCI_EVENT, \ - (unsigned char *)(packet), \ - (length)); \ - } - -#define AthBtFilterHciAclDataOut(instance,packet,length) \ - if ((instance)->FilterEnabled) { \ - (instance)->pFilterAclDataOut((instance)->pContext, \ - (unsigned char *)(packet), \ - (length)); \ - } - -#define AthBtFilterHciAclDataIn(instance,packet,length) \ - if ((instance)->FilterEnabled) { \ - (instance)->pFilterAclDataIn((instance)->pContext, \ - (unsigned char *)(packet), \ - (length)); \ - } - -/* if filtering is not desired, the application can indicate the state directly using this - * macro: - */ -#define AthBtIndicateState(instance,indication,state) \ - if ((instance)->FilterEnabled) { \ - (instance)->pIndicateState((instance)->pContext, \ - (indication), \ - (state), \ - 0); \ - } - -#ifdef __cplusplus -extern "C" { -#endif - -/* API prototypes */ -int AthBtFilter_Attach(ATH_BT_FILTER_INSTANCE *pInstance, A_UINT32 flags); -void AthBtFilter_Detach(ATH_BT_FILTER_INSTANCE *pInstance); - -#ifdef __cplusplus -} -#endif - -#endif /*ATHBTFILTER_H_*/ diff --git a/drivers/net/wireless/ar6003/host/include/athendpack.h b/drivers/net/wireless/ar6003/host/include/athendpack.h deleted file mode 100644 index 96445d790752..000000000000 --- a/drivers/net/wireless/ar6003/host/include/athendpack.h +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// end compiler-specific structure packing -// -// Author(s): ="Atheros" -//============================================================================== -#ifdef VXWORKS -#endif /* VXWORKS */ - -#if defined(LINUX) || defined(__linux__) -#endif /* LINUX */ - -#ifdef QNX -#endif /* QNX */ - -#ifdef INTEGRITY -#include "integrity/athendpack_integrity.h" -#endif /* INTEGRITY */ - -#ifdef NUCLEUS -#endif /* NUCLEUS */ - - -#ifdef ATHR_WM_NWF -#include "../os/windows/include/athendpack.h" -#endif - -#ifdef ATHR_CE_LEGACY -#include "../os/windows/include/athendpack.h" -#endif /* WINCE */ - -#ifdef ATHR_WIN_NWF -#include -#endif diff --git a/drivers/net/wireless/ar6003/host/include/athstartpack.h b/drivers/net/wireless/ar6003/host/include/athstartpack.h deleted file mode 100644 index c81435b2405c..000000000000 --- a/drivers/net/wireless/ar6003/host/include/athstartpack.h +++ /dev/null @@ -1,69 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// start compiler-specific structure packing -// -// Author(s): ="Atheros" -//============================================================================== -#ifdef VXWORKS -#endif /* VXWORKS */ - -#if defined(LINUX) || defined(__linux__) -#endif /* LINUX */ - -#ifdef QNX -#endif /* QNX */ - -#ifdef INTEGRITY -#include "integrity/athstartpack_integrity.h" -#endif /* INTEGRITY */ - -#ifdef NUCLEUS -#endif /* NUCLEUS */ - -#ifdef ATHR_WM_NWF -#include "../os/windows/include/athstartpack.h" -#define PREPACK -#endif - -#ifdef ATHR_CE_LEGACY -#include "../os/windows/include/athstartpack.h" -#endif /* WINCE */ - -#ifdef ATHR_WIN_NWF - -#ifndef PREPACK -#define PREPACK __declspec(align(1)) -#endif - -#include -#define __ATTRIB_PACK POSTPACK - -#endif - -#if __LONG_MAX__ == __INT_MAX__ -/* 32-bit compilation */ -#define PREPACK64 -#define POSTPACK64 -#else -/* 64-bit compilation */ -#define PREPACK64 PREPACK -#define POSTPACK64 POSTPACK -#endif diff --git a/drivers/net/wireless/ar6003/host/include/bmi.h b/drivers/net/wireless/ar6003/host/include/bmi.h deleted file mode 100644 index 960294e228a8..000000000000 --- a/drivers/net/wireless/ar6003/host/include/bmi.h +++ /dev/null @@ -1,140 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// BMI declarations and prototypes -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _BMI_H_ -#define _BMI_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Header files */ -#include "a_config.h" -#include "athdefs.h" -#include "a_types.h" -#include "hif.h" -#include "a_osapi.h" -#include "bmi_msg.h" - -void -BMIInit(void); - -void -BMICleanup(void); - -A_STATUS -BMIDone(HIF_DEVICE *device); - -A_STATUS -BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info); - -A_STATUS -BMIReadMemory(HIF_DEVICE *device, - A_UINT32 address, - A_UCHAR *buffer, - A_UINT32 length); - -A_STATUS -BMIWriteMemory(HIF_DEVICE *device, - A_UINT32 address, - A_UCHAR *buffer, - A_UINT32 length); - -A_STATUS -BMIExecute(HIF_DEVICE *device, - A_UINT32 address, - A_UINT32 *param); - -A_STATUS -BMISetAppStart(HIF_DEVICE *device, - A_UINT32 address); - -A_STATUS -BMIReadSOCRegister(HIF_DEVICE *device, - A_UINT32 address, - A_UINT32 *param); - -A_STATUS -BMIWriteSOCRegister(HIF_DEVICE *device, - A_UINT32 address, - A_UINT32 param); - -A_STATUS -BMIrompatchInstall(HIF_DEVICE *device, - A_UINT32 ROM_addr, - A_UINT32 RAM_addr, - A_UINT32 nbytes, - A_UINT32 do_activate, - A_UINT32 *patch_id); - -A_STATUS -BMIrompatchUninstall(HIF_DEVICE *device, - A_UINT32 rompatch_id); - -A_STATUS -BMIrompatchActivate(HIF_DEVICE *device, - A_UINT32 rompatch_count, - A_UINT32 *rompatch_list); - -A_STATUS -BMIrompatchDeactivate(HIF_DEVICE *device, - A_UINT32 rompatch_count, - A_UINT32 *rompatch_list); - -A_STATUS -BMILZStreamStart(HIF_DEVICE *device, - A_UINT32 address); - -A_STATUS -BMILZData(HIF_DEVICE *device, - A_UCHAR *buffer, - A_UINT32 length); - -A_STATUS -BMIFastDownload(HIF_DEVICE *device, - A_UINT32 address, - A_UCHAR *buffer, - A_UINT32 length); - -A_STATUS -BMInvramProcess(HIF_DEVICE *device, - A_UCHAR *seg_name, - A_UINT32 *retval); - -A_STATUS -BMIRawWrite(HIF_DEVICE *device, - A_UCHAR *buffer, - A_UINT32 length); - -A_STATUS -BMIRawRead(HIF_DEVICE *device, - A_UCHAR *buffer, - A_UINT32 length, - A_BOOL want_timeout); - -#ifdef __cplusplus -} -#endif - -#endif /* _BMI_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/common_drv.h b/drivers/net/wireless/ar6003/host/include/common_drv.h deleted file mode 100644 index 43dc19954078..000000000000 --- a/drivers/net/wireless/ar6003/host/include/common_drv.h +++ /dev/null @@ -1,107 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== -#ifndef COMMON_DRV_H_ -#define COMMON_DRV_H_ - -#include "hif.h" -#include "htc_packet.h" -#include "htc_api.h" - -/* structure that is the state information for the default credit distribution callback - * drivers should instantiate (zero-init as well) this structure in their driver instance - * and pass it as a context to the HTC credit distribution functions */ -typedef struct _COMMON_CREDIT_STATE_INFO { - int TotalAvailableCredits; /* total credits in the system at startup */ - int CurrentFreeCredits; /* credits available in the pool that have not been - given out to endpoints */ - HTC_ENDPOINT_CREDIT_DIST *pLowestPriEpDist; /* pointer to the lowest priority endpoint dist struct */ -} COMMON_CREDIT_STATE_INFO; - -typedef struct { - A_INT32 (*setupTransport)(void *ar); - void (*cleanupTransport)(void *ar); -} HCI_TRANSPORT_CALLBACKS; - -typedef struct { - void *netDevice; - void *hifDevice; - void *htcHandle; -} HCI_TRANSPORT_MISC_HANDLES; - -/* HTC TX packet tagging definitions */ -#define AR6K_CONTROL_PKT_TAG HTC_TX_PACKET_TAG_USER_DEFINED -#define AR6K_DATA_PKT_TAG (AR6K_CONTROL_PKT_TAG + 1) - -#define AR6002_VERSION_REV2 0x20000188 -#define AR6003_VERSION_REV2 0x30000384 - -#define AR6002_CUST_DATA_SIZE 112 -#define AR6003_CUST_DATA_SIZE 16 -#define MCKINLEY_CUST_DATA_SIZE 16 - -#ifdef __cplusplus -extern "C" { -#endif - -/* OS-independent APIs */ -A_STATUS ar6000_setup_credit_dist(HTC_HANDLE HTCHandle, COMMON_CREDIT_STATE_INFO *pCredInfo); - -A_STATUS ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data); - -A_STATUS ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data); - -A_STATUS ar6000_ReadDataDiag(HIF_DEVICE *hifDevice, A_UINT32 address, A_UCHAR *data, A_UINT32 length); - -A_STATUS ar6000_reset_device(HIF_DEVICE *hifDevice, A_UINT32 TargetType, A_BOOL waitForCompletion, A_BOOL coldReset); - -void ar6000_dump_target_assert_info(HIF_DEVICE *hifDevice, A_UINT32 TargetType); - -A_STATUS ar6000_set_htc_params(HIF_DEVICE *hifDevice, - A_UINT32 TargetType, - A_UINT32 MboxIsrYieldValue, - A_UINT8 HtcControlBuffers); - -A_STATUS ar6000_prepare_target(HIF_DEVICE *hifDevice, - A_UINT32 TargetType, - A_UINT32 TargetVersion); - -A_STATUS ar6000_set_hci_bridge_flags(HIF_DEVICE *hifDevice, - A_UINT32 TargetType, - A_UINT32 Flags); - -void ar6000_copy_cust_data_from_target(HIF_DEVICE *hifDevice, A_UINT32 TargetType); - -A_UINT8 *ar6000_get_cust_data_buffer(A_UINT32 TargetType); - -A_STATUS ar6000_setBTState(void *context, A_UINT8 *pInBuf, A_UINT32 InBufSize); - -A_STATUS ar6000_setDevicePowerState(void *context, A_UINT8 *pInBuf, A_UINT32 InBufSize); - -A_STATUS ar6000_setWowMode(void *context, A_UINT8 *pInBuf, A_UINT32 InBufSize); - -A_STATUS ar6000_setHostMode(void *context, A_UINT8 *pInBuf, A_UINT32 InBufSize); - -#ifdef __cplusplus -} -#endif - -#endif /*COMMON_DRV_H_*/ diff --git a/drivers/net/wireless/ar6003/host/include/dbglog_api.h b/drivers/net/wireless/ar6003/host/include/dbglog_api.h deleted file mode 100644 index 7aba883c8888..000000000000 --- a/drivers/net/wireless/ar6003/host/include/dbglog_api.h +++ /dev/null @@ -1,58 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This file contains host side debug primitives. -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _DBGLOG_API_H_ -#define _DBGLOG_API_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "dbglog.h" - -#define DBGLOG_HOST_LOG_BUFFER_SIZE DBGLOG_LOG_BUFFER_SIZE - -#define DBGLOG_GET_DBGID(arg) \ - ((arg & DBGLOG_DBGID_MASK) >> DBGLOG_DBGID_OFFSET) - -#define DBGLOG_GET_MODULEID(arg) \ - ((arg & DBGLOG_MODULEID_MASK) >> DBGLOG_MODULEID_OFFSET) - -#define DBGLOG_GET_NUMARGS(arg) \ - ((arg & DBGLOG_NUM_ARGS_MASK) >> DBGLOG_NUM_ARGS_OFFSET) - -#define DBGLOG_GET_TIMESTAMP(arg) \ - ((arg & DBGLOG_TIMESTAMP_MASK) >> DBGLOG_TIMESTAMP_OFFSET) - -/** - @param lv 0->RAW info, 1->Breif translated info, 2->Full info - @param logbuf dbglog buffer - */ -int dbg_formater(int lv, char *output, size_t len, A_UINT32 ts, A_INT32 *logbuf); - -#ifdef __cplusplus -} -#endif - -#endif /* _DBGLOG_API_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/dfs_host.h b/drivers/net/wireless/ar6003/host/include/dfs_host.h deleted file mode 100644 index fc54ec5cbd07..000000000000 --- a/drivers/net/wireless/ar6003/host/include/dfs_host.h +++ /dev/null @@ -1,387 +0,0 @@ -/* - * Copyright (c) 2005-2006 Atheros Communications, Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -#ifndef _DFS_HOST_H_ -#define _DFS_HOST_H_ - -#ifdef ATH_SUPPORT_DFS - -#include "dfs_host_project.h" - -#define DFS_MIN(a,b) ((a)<(b)?(a):(b)) -#define DFS_MAX(a,b) ((a)>(b)?(a):(b)) -#define DFS_DIFF(a,b) (DFS_MAX(a,b) - DFS_MIN(a,b)) -/* - * Maximum number of radar events to be processed in a single iteration. - * Allows soft watchdog to run. - */ -#define MAX_EVENTS 100 - - -#define DFS_MARGIN_EQUAL(a, b, margin) ((DFS_DIFF(a,b)) <= margin) -#define DFS_MAX_STAGGERED_BURSTS 3 - -/* All filter thresholds in the radar filter tables are effective at a 50% channel loading */ -#define DFS_CHAN_LOADING_THRESH 50 -#define DFS_EXT_CHAN_LOADING_THRESH 30 -#define DFS_DEFAULT_PRI_MARGIN 10 -#define DFS_DEFAULT_FIXEDPATTERN_PRI_MARGIN 6 - - -#define ATH_DFSQ_LOCK(_dfs) spin_lock(&(_dfs)->dfs_radarqlock) -#define ATH_DFSQ_UNLOCK(_dfs) spin_unlock(&(_dfs)->dfs_radarqlock) -#define ATH_DFSQ_LOCK_INIT(_dfs) spin_lock_init(&(_dfs)->dfs_radarqlock) - -#define ATH_ARQ_LOCK(_dfs) spin_lock(&(_dfs)->dfs_arqlock) -#define ATH_ARQ_UNLOCK(_dfs) spin_unlock(&(_dfs)->dfs_arqlock) -#define ATH_ARQ_LOCK_INIT(_dfs) spin_lock_init(&(_dfs)->dfs_arqlock) - -#define ATH_DFSEVENTQ_LOCK(_dfs) spin_lock(&(_dfs)->dfs_eventqlock) -#define ATH_DFSEVENTQ_UNLOCK(_dfs) spin_unlock(&(_dfs)->dfs_eventqlock) -#define ATH_DFSEVENTQ_LOCK_INIT(_dfs) spin_lock_init(&(_dfs)->dfs_eventqlock) - - -#define DFS_TSMASK 0xFFFFFFFF /* Mask for time stamp from descriptor */ -#define DFS_TSSHIFT 32 /* Shift for time stamp from descriptor */ -#define DFS_TSF_WRAP 0xFFFFFFFFFFFFFFFFULL /* 64 bit TSF wrap value */ -#define DFS_64BIT_TSFMASK 0x0000000000007FFFULL /* TS mask for 64 bit value */ - - -#define DFS_AR_RADAR_RSSI_THR 5 /* in dB */ -#define DFS_AR_RADAR_RESET_INT 1 /* in secs */ -#define DFS_AR_RADAR_MAX_HISTORY 500 -#define DFS_AR_REGION_WIDTH 128 -#define DFS_AR_RSSI_THRESH_STRONG_PKTS 17 /* in dB */ -#define DFS_AR_RSSI_DOUBLE_THRESHOLD 15 /* in dB */ -#define DFS_AR_MAX_NUM_ACK_REGIONS 9 -#define DFS_AR_ACK_DETECT_PAR_THRESH 20 -#define DFS_AR_PKT_COUNT_THRESH 20 - -#define DFS_MAX_DL_MASK 0x3F - -#define DFS_NOL_TIME 30*60*1000000 /* 30 minutes in usecs */ - -#define DFS_WAIT_TIME 60*1000000 /* 1 minute in usecs */ - -#define DFS_DISABLE_TIME 3*60*1000000 /* 3 minutes in usecs */ - -#define DFS_MAX_B5_SIZE 128 -#define DFS_MAX_B5_MASK 0x0000007F /* 128 */ - -#define DFS_MAX_RADAR_OVERLAP 16 /* Max number of overlapping filters */ - -#define DFS_MAX_EVENTS 1024 /* Max number of dfs events which can be q'd */ - -#define DFS_RADAR_EN 0x80000000 /* Radar detect is capable */ -#define DFS_AR_EN 0x40000000 /* AR detect is capable */ -#define DFS_MAX_RSSI_VALUE 0x7fffffff /* Max rssi value */ - -#define DFS_BIN_MAX_PULSES 60 /* max num of pulses in a burst */ -#define DFS_BIN5_PRI_LOWER_LIMIT 990 /* us */ -#define DFS_BIN5_PRI_HIGHER_LIMIT 2010 /* us */ -#define DFS_BIN5_WIDTH_MARGIN 4 /* us */ -#define DFS_BIN5_RSSI_MARGIN 5 /* dBm */ -/*Following threshold is not specified but should be okay statistically*/ -#define DFS_BIN5_BRI_LOWER_LIMIT 300000 /* us */ - -#define DFS_MAX_PULSE_BUFFER_SIZE 1024 /* Max number of pulses kept in buffer */ -#define DFS_MAX_PULSE_BUFFER_MASK 0x3ff - -#define DFS_FAST_CLOCK_MULTIPLIER (800/11) -#define DFS_NO_FAST_CLOCK_MULTIPLIER (80) - -typedef spinlock_t dfsq_lock_t; - -struct dfs_pulse { - A_UINT32 rp_numpulses; /* Num of pulses in radar burst */ - A_UINT32 rp_pulsedur; /* Duration of each pulse in usecs */ - A_UINT32 rp_pulsefreq; /* Frequency of pulses in burst */ - A_UINT32 rp_max_pulsefreq; /* Frequency of pulses in burst */ - A_UINT32 rp_patterntype; /*fixed or variable pattern type*/ - A_UINT32 rp_pulsevar; /* Time variation of pulse duration for - matched filter (single-sided) in usecs */ - A_UINT32 rp_threshold; /* Thershold for MF output to indicate - radar match */ - A_UINT32 rp_mindur; /* Min pulse duration to be considered for - this pulse type */ - A_UINT32 rp_maxdur; /* Max pusle duration to be considered for - this pulse type */ - A_UINT32 rp_rssithresh; /* Minimum rssi to be considered a radar pulse */ - A_UINT32 rp_meanoffset; /* Offset for timing adjustment */ - A_INT32 rp_rssimargin; /* rssi threshold margin. In Turbo Mode HW reports rssi 3dBm - * lower than in non TURBO mode. This will be used to offset - * that diff.*/ - A_UINT32 rp_pulseid; /* Unique ID for identifying filter */ - -}; - -struct dfs_bin5pulse { - A_UINT32 b5_threshold; /* Number of bin5 pulses to indicate detection */ - A_UINT32 b5_mindur; /* Min duration for a bin5 pulse */ - A_UINT32 b5_maxdur; /* Max duration for a bin5 pulse */ - A_UINT32 b5_timewindow; /* Window over which to count bin5 pulses */ - A_UINT32 b5_rssithresh; /* Min rssi to be considered a pulse */ - A_UINT32 b5_rssimargin; /* rssi threshold margin. In Turbo Mode HW reports rssi 3dB */ -}; - - -#define DFS_MAX_DL_SIZE 64 -#include "athstartpack.h" -PREPACK struct dfs_delayelem { - u_int32_t de_time; /* Current "filter" time for start of pulse in usecs*/ - u_int8_t de_dur; /* Duration of pulse in usecs*/ - u_int8_t de_rssi; /* rssi of pulse in dB*/ -} POSTPACK adf_os_packed; - -/* NB: The first element in the circular buffer is the oldest element */ - -PREPACK struct dfs_delayline { - struct dfs_delayelem dl_elems[DFS_MAX_DL_SIZE]; /* Array of pulses in delay line */ - u_int64_t dl_last_ts; /* Last timestamp the delay line was used (in usecs) */ - u_int32_t dl_firstelem; /* Index of the first element */ - u_int32_t dl_lastelem; /* Index of the last element */ - u_int32_t dl_numelems; /* Number of elements in the delay line */ -} POSTPACK adf_os_packed; - - -PREPACK struct dfs_filter { - struct dfs_delayline rf_dl; /* Delay line of pulses for this filter */ - u_int32_t rf_numpulses; /* Number of pulses in the filter */ - u_int32_t rf_minpri; /* min pri to be considered for this filter*/ - u_int32_t rf_maxpri; /* max pri to be considered for this filter*/ - u_int32_t rf_threshold; /* match filter output threshold for radar detect */ - u_int32_t rf_filterlen; /* Length (in usecs) of the filter */ - u_int32_t rf_patterntype; /* fixed or variable pattern type */ - u_int32_t rf_mindur; /* Min duration for this radar filter */ - u_int32_t rf_maxdur; /* Max duration for this radar filter */ - u_int32_t rf_pulseid; /* Unique ID corresponding to the original filter ID */ -} POSTPACK adf_os_packed; - - - -PREPACK struct dfs_pulseparams { - u_int64_t p_time; /* time for start of pulse in usecs*/ - u_int8_t p_dur; /* Duration of pulse in usecs*/ - u_int8_t p_rssi; /* Duration of pulse in usecs*/ -} POSTPACK adf_os_packed; - -PREPACK struct dfs_pulseline { - /* pl_elems - array of pulses in delay line */ - struct dfs_pulseparams pl_elems[DFS_MAX_PULSE_BUFFER_SIZE]; - u_int32_t pl_firstelem; /* Index of the first element */ - u_int32_t pl_lastelem; /* Index of the last element */ - u_int32_t pl_numelems; /* Number of elements in the delay line */ -} POSTPACK adf_os_packed; - -PREPACK struct dfs_event { - u_int64_t re_full_ts; /* 64-bit full timestamp from interrupt time */ - u_int32_t re_ts; /* Original 15 bit recv timestamp */ - u_int32_t re_ext_chan_busy; /* Ext channel busy % */ - u_int8_t re_rssi; /* rssi of radar event */ - u_int8_t re_dur; /* duration of radar pulse */ - u_int8_t re_chanindex; /* Channel of event */ - u_int8_t re_chanindextype; /* Primary channel or extension channel */ - STAILQ_ENTRY(dfs_event) re_list; /* List of radar events */ -} POSTPACK adf_os_packed; -#include "athendpack.h" - -#define DFS_AR_MAX_ACK_RADAR_DUR 511 -#define DFS_AR_MAX_NUM_PEAKS 3 -#define DFS_AR_ARQ_SIZE 2048 /* 8K AR events for buffer size */ -#define DFS_AR_ARQ_SEQSIZE 2049 /* Sequence counter wrap for AR */ - -#define DFS_RADARQ_SIZE 512 /* 1K radar events for buffer size */ -#define DFS_RADARQ_SEQSIZE 513 /* Sequence counter wrap for radar */ -#define DFS_NUM_RADAR_STATES 64 /* Number of radar channels we keep state for */ -#define DFS_MAX_NUM_RADAR_FILTERS 10 /* Max number radar filters for each type */ -#define DFS_MAX_RADAR_TYPES 32 /* Number of different radar types */ - -struct dfs_ar_state { - u_int32_t ar_prevwidth; - u_int32_t ar_phyerrcount[DFS_AR_MAX_ACK_RADAR_DUR]; - u_int32_t ar_acksum; - u_int32_t ar_packetthreshold; /* Thresh to determine traffic load */ - u_int32_t ar_parthreshold; /* Thresh to determine peak */ - u_int32_t ar_radarrssi; /* Rssi threshold for AR event */ - u_int16_t ar_prevtimestamp; - u_int16_t ar_peaklist[DFS_AR_MAX_NUM_PEAKS]; -}; - -struct dfs_filtertype { - struct dfs_filter ft_filters[DFS_MAX_NUM_RADAR_FILTERS]; - u_int32_t ft_filterdur; /* Duration of pulse which specifies filter type*/ - u_int32_t ft_numfilters; /* Num filters of this type */ - u_int64_t ft_last_ts; /* Last timestamp this filtertype was used - * (in usecs) */ - u_int32_t ft_mindur; /* min pulse duration to be considered - * for this filter type */ - u_int32_t ft_maxdur; /* max pulse duration to be considered - * for this filter type */ - u_int32_t ft_rssithresh; /* min rssi to be considered - * for this filter type */ - u_int32_t ft_numpulses; /* Num pulses in each filter of this type */ - u_int32_t ft_patterntype; /* fixed or variable pattern type */ - u_int32_t ft_minpri; /* min pri to be considered for this type */ - u_int32_t ft_rssimargin; /* rssi threshold margin. In Turbo Mode HW - * reports rssi 3dB lower than in non TURBO - * mode. This will offset that diff. */ -}; - - -#define DFS_NOL_TIMEOUT_S (30*60) /* 30 minutes in seconds */ -#define DFS_NOL_TIMEOUT_MS (DFS_NOL_TIMEOUT_S * 1000) -#define DFS_NOL_TIMEOUT_US (DFS_NOL_TIMEOUT_MS * 1000) - -#include "athstartpack.h" -PREPACK struct dfs_info_host { - u_int32_t rn_numradars; /* Number of different types of radars */ - u_int64_t rn_lastfull_ts; /* Last 64 bit timstamp from recv interrupt */ - u_int16_t rn_last_ts; /* last 15 bit ts from recv descriptor */ - u_int32_t rn_last_unique_ts; /* last unique 32 bit ts from recv descriptor */ - u_int64_t rn_ts_prefix; /* Prefix to prepend to 15 bit recv ts */ - u_int32_t rn_numbin5radars; /* Number of bin5 radar pulses to search for */ - u_int64_t dfs_bin5_chirp_ts; - u_int8_t dfs_last_bin5_dur; -} POSTPACK adf_os_packed; -#include "athendpack.h" - -struct dfs_bin5elem { - u_int64_t be_ts; /* Timestamp for the bin5 element */ - u_int32_t be_rssi; /* Rssi for the bin5 element */ - u_int32_t be_dur; /* Duration of bin5 element */ -}; - -struct dfs_bin5radars { - struct dfs_bin5elem br_elems[DFS_MAX_B5_SIZE]; /* List of bin5 elems that fall - * within the time window */ - u_int32_t br_firstelem; /* Index of the first element */ - u_int32_t br_lastelem; /* Index of the last element */ - u_int32_t br_numelems; /* Number of elements in the delay line */ - struct dfs_bin5pulse br_pulse; /* Original info about bin5 pulse */ -}; - - -#define ATH_DFS_RESET_TIME_S 7 -#define ATH_DFS_WAIT (60 + ATH_DFS_RESET_TIME_S) /* 60 seconds */ -#define ATH_DFS_WAIT_MS ((ATH_DFS_WAIT) * 1000) /*in MS*/ - -#define ATH_DFS_WEATHER_CHANNEL_WAIT_MIN 10 /*10 minutes*/ -#define ATH_DFS_WEATHER_CHANNEL_WAIT_S (ATH_DFS_WEATHER_CHANNEL_WAIT_MIN * 60) -#define ATH_DFS_WEATHER_CHANNEL_WAIT_MS ((ATH_DFS_WEATHER_CHANNEL_WAIT_S) * 1000) /*in MS*/ - -#define ATH_DFS_WAIT_POLL_PERIOD 2 /* 2 seconds */ -#define ATH_DFS_WAIT_POLL_PERIOD_MS ((ATH_DFS_WAIT_POLL_PERIOD) * 1000) /*in MS*/ -#define ATH_DFS_TEST_RETURN_PERIOD 2 /* 2 seconds */ -#define ATH_DFS_TEST_RETURN_PERIOD_MS ((ATH_DFS_TEST_RETURN_PERIOD) * 1000)/* n MS*/ - -#define IS_CHANNEL_WEATHER_RADAR(chan) ((chan->channel >= 5600) && (chan->channel <= 5650)) - -#define DFS_DEBUG_TIMEOUT_S 30 // debug timeout is 30 seconds -#define DFS_DEBUG_TIMEOUT_MS (DFS_DEBUG_TIMEOUT_S * 1000) -struct ath_dfs_host { - DEV_HDL dev_hdl; - u_int32_t dfs_debug_level; - OS_HDL os_hdl; - STAILQ_HEAD(,dfs_event) dfs_eventq; /* Q of free dfs event objects */ - dfsq_lock_t dfs_eventqlock; /* Lock for free dfs event list */ - STAILQ_HEAD(,dfs_event) dfs_radarq; /* Q of radar events */ - dfsq_lock_t dfs_radarqlock; /* Lock for dfs q */ - STAILQ_HEAD(,dfs_event) dfs_arq; /* Q of AR events */ - dfsq_lock_t dfs_arqlock; /* Lock for AR q */ - - struct dfs_pulseline *pulses; /* pulse history */ - struct dfs_event *events; /* Events structure */ - /* dfs_radarf - One filter for each radar pulse type */ - struct dfs_filtertype *dfs_radarf[DFS_MAX_RADAR_TYPES]; - - int8_t **dfs_radartable; /* map of radar durs to filter types */ - struct dfs_bin5radars *dfs_b5radars;/* array of bin5 radar events */ - struct dfs_ar_state dfs_ar_state; /* AR state */ - struct dfs_info_host dfs_rinfo; /* State vars for radar processing */ - u_int8_t dfs_bangradar; - u_int32_t dur_multiplier; - A_TIMER dfs_radar_task_timer; -}; - - -#define HAL_CAP_RADAR 0 -#define HAL_CAP_AR 1 -#define HAL_CAP_STRONG_DIV 2 - - -/* Attach, detach, handle ioctl prototypes */ -struct ath_dfs_host *dfs_attach_host(DEV_HDL dev, OS_HDL os, ATH_DFS_CAPINFO *cap_info); -void dfs_detach_host(struct ath_dfs_host *sc); - - -/* PHY error and radar event handling */ -void dfs_process_phyerr_host(struct ath_dfs_host *dfs, WMI_DFS_PHYERR_EVENT *ev); -int dfs_process_radarevent_host(struct ath_dfs_host *dfs, int16_t *chan_index, u_int8_t *bangradar); - - -/* FCC Bin5 detection prototypes */ -int dfs_bin5_addpulse(struct ath_dfs_host *sc, struct dfs_bin5radars *br, - struct dfs_event *re, u_int64_t thists); -int dfs_bin5_check(struct ath_dfs_host *dfs); -u_int8_t dfs_retain_bin5_burst_pattern(struct ath_dfs_host *dfs, u_int32_t diff_ts, u_int8_t old_dur); - -/* Debug prototypes */ -void dfs_print_delayline(struct ath_dfs_host *dfs, struct dfs_delayline *dl); -void dfs_print_filters(struct ath_dfs_host *dfs); -void dfs_print_filter(struct ath_dfs_host *dfs, struct dfs_filter *rf); - -/* Misc prototypes */ -u_int32_t dfs_round(int32_t val); - -/* Reset and init data structures */ - -int dfs_init_radar_filters_host(struct ath_dfs_host *dfs, struct ath_dfs_info *dfs_info); -void dfs_reset_alldelaylines(struct ath_dfs_host *dfs); -void dfs_reset_delayline(struct dfs_delayline *dl); -void dfs_reset_filter_delaylines(struct dfs_filtertype *dft); -void dfs_reset_radarq(struct ath_dfs_host *dfs); - -/* Detection algorithm prototypes */ -void dfs_add_pulse(struct ath_dfs_host *dfs, struct dfs_filter *rf, - struct dfs_event *re, u_int32_t deltaT); - -int dfs_bin_fixedpattern_check(struct ath_dfs_host *dfs, struct dfs_filter *rf, u_int32_t dur, int ext_chan_flag, u_int32_t ext_chan_busy); -int dfs_bin_check(struct ath_dfs_host *dfs, struct dfs_filter *rf, - u_int32_t deltaT, u_int32_t dur, int ext_chan_flag, u_int32_t ext_chan_busy); - - -int dfs_bin_pri_check(struct ath_dfs_host *dfs, struct dfs_filter *rf, - struct dfs_delayline *dl, u_int32_t score, - u_int32_t refpri, u_int32_t refdur, int ext_chan_flag, u_int32_t ext_chan_busy); -int dfs_staggered_check(struct ath_dfs_host *dfs, struct dfs_filter *rf, - u_int32_t deltaT, u_int32_t width, u_int32_t ext_chan_busy); - -/* AR related prototypes */ -u_int32_t dfs_process_ar_event(struct ath_dfs_host *dfs); -void dfs_reset_ar(struct ath_dfs_host *dfs); -void dfs_reset_arq(struct ath_dfs_host *dfs); - -void dfs_bangradar_enable(struct ath_dfs_host *dfs, u_int8_t enable); -void dfs_set_dur_multiplier(struct ath_dfs_host *dfs, u_int32_t dur_multiplier); -void dfs_set_debug_level_host(struct ath_dfs_host *dfs, u_int32_t level); - -/* False detection reduction */ -int dfs_get_pri_margin(int is_extchan_detect, int is_fixed_pattern, u_int64_t lastfull_ts, u_int32_t ext_chan_busy); -int dfs_get_filter_threshold(struct dfs_filter *rf, int is_extchan_detect, u_int64_t lastfull_ts, u_int32_t ext_chan_busy); - -#endif /* ATH_SUPPORT_DFS */ -#endif /* _DFS_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/dfs_host_project.h b/drivers/net/wireless/ar6003/host/include/dfs_host_project.h deleted file mode 100644 index 9f1ce2f2d717..000000000000 --- a/drivers/net/wireless/ar6003/host/include/dfs_host_project.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2005-2006 Atheros Communications, Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -#ifndef _DFS_PROJECT_H_ -#define _DFS_PROJECT_H_ - -#ifdef ATH_SUPPORT_DFS - -#include -#include -#include -#include -#include -#include /* XXX: This is in target dir */ -#include "dfs_common.h" -#include "ar6000_drv.h" -#include "project.h" - -#define ATH_DFS_CAPINFO WMI_DFS_HOST_ATTACH_EVENT - -#define OS_HDL void * -#define DEV_HDL void * - -#define DFS_MALLOC(os_hdl, nbytes) A_MALLOC(nbytes) - -#define DFS_DPRINTK(pDfs, _m, _fmt, ...) do { \ - if ((_m) <= pDfs->dfs_debug_level) { \ - A_PRINTF(_fmt, __VA_ARGS__); \ - } \ -} while (0) - - -void dfs_radar_task (unsigned long arg); - -#define adf_os_packed - -typedef enum { - AH_FALSE = 0, /* NB: lots of code assumes false is zero */ - AH_TRUE = 1, -} HAL_BOOL; -#endif /* ATH_SUPPORT_DFS */ - -#endif /* _DFS_PROJECT_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/dl_list.h b/drivers/net/wireless/ar6003/host/include/dl_list.h deleted file mode 100644 index 662ee1a0708f..000000000000 --- a/drivers/net/wireless/ar6003/host/include/dl_list.h +++ /dev/null @@ -1,153 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Double-link list definitions (adapted from Atheros SDIO stack) -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef __DL_LIST_H___ -#define __DL_LIST_H___ - -#include "a_osapi.h" - -#define A_CONTAINING_STRUCT(address, struct_type, field_name)\ - ((struct_type *)((unsigned long)(address) - (unsigned long)(&((struct_type *)0)->field_name))) - -/* list functions */ -/* pointers for the list */ -typedef struct _DL_LIST { - struct _DL_LIST *pPrev; - struct _DL_LIST *pNext; -}DL_LIST, *PDL_LIST; -/* - * DL_LIST_INIT , initialize doubly linked list -*/ -#define DL_LIST_INIT(pList)\ - {(pList)->pPrev = pList; (pList)->pNext = pList;} - -/* faster macro to init list and add a single item */ -#define DL_LIST_INIT_AND_ADD(pList,pItem) \ -{ (pList)->pPrev = (pItem); \ - (pList)->pNext = (pItem); \ - (pItem)->pNext = (pList); \ - (pItem)->pPrev = (pList); \ -} - -#define DL_LIST_IS_EMPTY(pList) (((pList)->pPrev == (pList)) && ((pList)->pNext == (pList))) -#define DL_LIST_GET_ITEM_AT_HEAD(pList) (pList)->pNext -#define DL_LIST_GET_ITEM_AT_TAIL(pList) (pList)->pPrev -/* - * ITERATE_OVER_LIST pStart is the list, pTemp is a temp list member - * NOT: do not use this function if the items in the list are deleted inside the - * iteration loop -*/ -#define ITERATE_OVER_LIST(pStart, pTemp) \ - for((pTemp) =(pStart)->pNext; pTemp != (pStart); (pTemp) = (pTemp)->pNext) - - -/* safe iterate macro that allows the item to be removed from the list - * the iteration continues to the next item in the list - */ -#define ITERATE_OVER_LIST_ALLOW_REMOVE(pStart,pItem,st,offset) \ -{ \ - PDL_LIST pTemp; \ - pTemp = (pStart)->pNext; \ - while (pTemp != (pStart)) { \ - (pItem) = A_CONTAINING_STRUCT(pTemp,st,offset); \ - pTemp = pTemp->pNext; \ - -#define ITERATE_END }} - -/* - * DL_ListInsertTail - insert pAdd to the end of the list -*/ -static INLINE PDL_LIST DL_ListInsertTail(PDL_LIST pList, PDL_LIST pAdd) { - /* insert at tail */ - pAdd->pPrev = pList->pPrev; - pAdd->pNext = pList; - pList->pPrev->pNext = pAdd; - pList->pPrev = pAdd; - return pAdd; -} - -/* - * DL_ListInsertHead - insert pAdd into the head of the list -*/ -static INLINE PDL_LIST DL_ListInsertHead(PDL_LIST pList, PDL_LIST pAdd) { - /* insert at head */ - pAdd->pPrev = pList; - pAdd->pNext = pList->pNext; - pList->pNext->pPrev = pAdd; - pList->pNext = pAdd; - return pAdd; -} - -#define DL_ListAdd(pList,pItem) DL_ListInsertHead((pList),(pItem)) -/* - * DL_ListRemove - remove pDel from list -*/ -static INLINE PDL_LIST DL_ListRemove(PDL_LIST pDel) { - pDel->pNext->pPrev = pDel->pPrev; - pDel->pPrev->pNext = pDel->pNext; - /* point back to itself just to be safe, incase remove is called again */ - pDel->pNext = pDel; - pDel->pPrev = pDel; - return pDel; -} - -/* - * DL_ListRemoveItemFromHead - get a list item from the head -*/ -static INLINE PDL_LIST DL_ListRemoveItemFromHead(PDL_LIST pList) { - PDL_LIST pItem = NULL; - if (pList->pNext != pList) { - pItem = pList->pNext; - /* remove the first item from head */ - DL_ListRemove(pItem); - } - return pItem; -} - -static INLINE PDL_LIST DL_ListRemoveItemFromTail(PDL_LIST pList) { - PDL_LIST pItem = NULL; - if (pList->pPrev != pList) { - pItem = pList->pPrev; - /* remove the item from tail */ - DL_ListRemove(pItem); - } - return pItem; -} - -/* transfer src list items to the tail of the destination list */ -static INLINE void DL_ListTransferItemsToTail(PDL_LIST pDest, PDL_LIST pSrc) { - /* only concatenate if src is not empty */ - if (!DL_LIST_IS_EMPTY(pSrc)) { - /* cut out circular list in src and re-attach to end of dest */ - pSrc->pPrev->pNext = pDest; - pSrc->pNext->pPrev = pDest->pPrev; - pDest->pPrev->pNext = pSrc->pNext; - pDest->pPrev = pSrc->pPrev; - /* terminate src list, it is now empty */ - pSrc->pPrev = pSrc; - pSrc->pNext = pSrc; - } -} - -#endif /* __DL_LIST_H___ */ diff --git a/drivers/net/wireless/ar6003/host/include/dset_api.h b/drivers/net/wireless/ar6003/host/include/dset_api.h deleted file mode 100644 index 0cc121fd25a0..000000000000 --- a/drivers/net/wireless/ar6003/host/include/dset_api.h +++ /dev/null @@ -1,65 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Host-side DataSet API. -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _DSET_API_H_ -#define _DSET_API_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* - * Host-side DataSet support is optional, and is not - * currently required for correct operation. To disable - * Host-side DataSet support, set this to 0. - */ -#ifndef CONFIG_HOST_DSET_SUPPORT -#define CONFIG_HOST_DSET_SUPPORT 1 -#endif - -/* Called to send a DataSet Open Reply back to the Target. */ -A_STATUS wmi_dset_open_reply(struct wmi_t *wmip, - A_UINT32 status, - A_UINT32 access_cookie, - A_UINT32 size, - A_UINT32 version, - A_UINT32 targ_handle, - A_UINT32 targ_reply_fn, - A_UINT32 targ_reply_arg); - -/* Called to send a DataSet Data Reply back to the Target. */ -A_STATUS wmi_dset_data_reply(struct wmi_t *wmip, - A_UINT32 status, - A_UINT8 *host_buf, - A_UINT32 length, - A_UINT32 targ_buf, - A_UINT32 targ_reply_fn, - A_UINT32 targ_reply_arg); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#endif /* _DSET_API_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/gpio_api.h b/drivers/net/wireless/ar6003/host/include/gpio_api.h deleted file mode 100644 index 96a150383358..000000000000 --- a/drivers/net/wireless/ar6003/host/include/gpio_api.h +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Host-side General Purpose I/O API. -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _GPIO_API_H_ -#define _GPIO_API_H_ - -/* - * Send a command to the Target in order to change output on GPIO pins. - */ -A_STATUS wmi_gpio_output_set(struct wmi_t *wmip, - A_UINT32 set_mask, - A_UINT32 clear_mask, - A_UINT32 enable_mask, - A_UINT32 disable_mask); - -/* - * Send a command to the Target requesting input state of GPIO pins. - */ -A_STATUS wmi_gpio_input_get(struct wmi_t *wmip); - -/* - * Send a command to the Target to change the value of a GPIO register. - */ -A_STATUS wmi_gpio_register_set(struct wmi_t *wmip, - A_UINT32 gpioreg_id, - A_UINT32 value); - -/* - * Send a command to the Target to fetch the value of a GPIO register. - */ -A_STATUS wmi_gpio_register_get(struct wmi_t *wmip, A_UINT32 gpioreg_id); - -/* - * Send a command to the Target, acknowledging some GPIO interrupts. - */ -A_STATUS wmi_gpio_intr_ack(struct wmi_t *wmip, A_UINT32 ack_mask); - -#endif /* _GPIO_API_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/hci_transport_api.h b/drivers/net/wireless/ar6003/host/include/hci_transport_api.h deleted file mode 100644 index b5157ea5d9e9..000000000000 --- a/drivers/net/wireless/ar6003/host/include/hci_transport_api.h +++ /dev/null @@ -1,259 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2009-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== -#ifndef _HCI_TRANSPORT_API_H_ -#define _HCI_TRANSPORT_API_H_ - - /* Bluetooth HCI packets are stored in HTC packet containers */ -#include "htc_packet.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef void *HCI_TRANSPORT_HANDLE; - -typedef HTC_ENDPOINT_ID HCI_TRANSPORT_PACKET_TYPE; - - /* we map each HCI packet class to a static Endpoint ID */ -#define HCI_COMMAND_TYPE ENDPOINT_1 -#define HCI_EVENT_TYPE ENDPOINT_2 -#define HCI_ACL_TYPE ENDPOINT_3 -#define HCI_PACKET_INVALID ENDPOINT_MAX - -#define HCI_GET_PACKET_TYPE(pP) (pP)->Endpoint -#define HCI_SET_PACKET_TYPE(pP,s) (pP)->Endpoint = (s) - -/* callback when an HCI packet was completely sent */ -typedef void (*HCI_TRANSPORT_SEND_PKT_COMPLETE)(void *, HTC_PACKET *); -/* callback when an HCI packet is received */ -typedef void (*HCI_TRANSPORT_RECV_PKT)(void *, HTC_PACKET *); -/* Optional receive buffer re-fill callback, - * On some OSes (like Linux) packets are allocated from a global pool and indicated up - * to the network stack. The driver never gets the packets back from the OS. For these OSes - * a refill callback can be used to allocate and re-queue buffers into HTC. - * A refill callback is used for the reception of ACL and EVENT packets. The caller must - * set the watermark trigger point to cause a refill. - */ -typedef void (*HCI_TRANSPORT_RECV_REFILL)(void *, HCI_TRANSPORT_PACKET_TYPE Type, int BuffersAvailable); -/* Optional receive packet refill - * On some systems packet buffers are an extremely limited resource. Rather than - * queue largest-possible-sized buffers to the HCI bridge, some systems would rather - * allocate a specific size as the packet is received. The trade off is - * slightly more processing (callback invoked for each RX packet) - * for the benefit of committing fewer buffer resources into the bridge. - * - * The callback is provided the length of the pending packet to fetch. This includes the - * full transport header, HCI header, plus the length of payload. The callback can return a pointer to - * the allocated HTC packet for immediate use. - * - * NOTE*** This callback is mutually exclusive with the the refill callback above. - * - * */ -typedef HTC_PACKET *(*HCI_TRANSPORT_RECV_ALLOC)(void *, HCI_TRANSPORT_PACKET_TYPE Type, int Length); - -typedef enum _HCI_SEND_FULL_ACTION { - HCI_SEND_FULL_KEEP = 0, /* packet that overflowed should be kept in the queue */ - HCI_SEND_FULL_DROP = 1, /* packet that overflowed should be dropped */ -} HCI_SEND_FULL_ACTION; - -/* callback when an HCI send queue exceeds the caller's MaxSendQueueDepth threshold, - * the callback must return the send full action to take (either DROP or KEEP) */ -typedef HCI_SEND_FULL_ACTION (*HCI_TRANSPORT_SEND_FULL)(void *, HTC_PACKET *); - -typedef struct { - int HeadRoom; /* number of bytes in front of HCI packet for header space */ - int TailRoom; /* number of bytes at the end of the HCI packet for tail space */ - int IOBlockPad; /* I/O block padding required (always a power of 2) */ -} HCI_TRANSPORT_PROPERTIES; - -typedef struct _HCI_TRANSPORT_CONFIG_INFO { - int ACLRecvBufferWaterMark; /* low watermark to trigger recv refill */ - int EventRecvBufferWaterMark; /* low watermark to trigger recv refill */ - int MaxSendQueueDepth; /* max number of packets in the single send queue */ - void *pContext; /* context for all callbacks */ - void (*TransportFailure)(void *pContext, A_STATUS Status); /* transport failure callback */ - A_STATUS (*TransportReady)(HCI_TRANSPORT_HANDLE, HCI_TRANSPORT_PROPERTIES *,void *pContext); /* transport is ready */ - void (*TransportRemoved)(void *pContext); /* transport was removed */ - /* packet processing callbacks */ - HCI_TRANSPORT_SEND_PKT_COMPLETE pHCISendComplete; - HCI_TRANSPORT_RECV_PKT pHCIPktRecv; - HCI_TRANSPORT_RECV_REFILL pHCIPktRecvRefill; - HCI_TRANSPORT_RECV_ALLOC pHCIPktRecvAlloc; - HCI_TRANSPORT_SEND_FULL pHCISendFull; -} HCI_TRANSPORT_CONFIG_INFO; - -/* ------ Function Prototypes ------ */ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Attach to the HCI transport module - @function name: HCI_TransportAttach - @input: HTCHandle - HTC handle (see HTC apis) - pInfo - initialization information - @output: - @return: HCI_TRANSPORT_HANDLE on success, NULL on failure - @notes: The HTC module provides HCI transport services. - @example: - @see also: HCI_TransportDetach -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -HCI_TRANSPORT_HANDLE HCI_TransportAttach(void *HTCHandle, HCI_TRANSPORT_CONFIG_INFO *pInfo); - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Detach from the HCI transport module - @function name: HCI_TransportDetach - @input: HciTrans - HCI transport handle - pInfo - initialization information - @output: - @return: - @notes: - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -void HCI_TransportDetach(HCI_TRANSPORT_HANDLE HciTrans); - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Add receive packets to the HCI transport - @function name: HCI_TransportAddReceivePkts - @input: HciTrans - HCI transport handle - pQueue - a queue holding one or more packets - @output: - @return: A_OK on success - @notes: user must supply HTC packets for capturing incomming HCI packets. The caller - must initialize each HTC packet using the SET_HTC_PACKET_INFO_RX_REFILL() - macro. Each packet in the queue must be of the same type and length - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_STATUS HCI_TransportAddReceivePkts(HCI_TRANSPORT_HANDLE HciTrans, HTC_PACKET_QUEUE *pQueue); - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Send an HCI packet packet - @function name: HCI_TransportSendPkt - @input: HciTrans - HCI transport handle - pPacket - packet to send - Synchronous - send the packet synchronously (blocking) - @output: - @return: A_OK - @notes: Caller must initialize packet using SET_HTC_PACKET_INFO_TX() and - HCI_SET_PACKET_TYPE() macros to prepare the packet. - If Synchronous is set to FALSE the call is fully asynchronous. On error or completion, - the registered send complete callback will be called. - If Synchronous is set to TRUE, the call will block until the packet is sent, if the - interface cannot send the packet within a 2 second timeout, the function will return - the failure code : A_EBUSY. - - Synchronous Mode should only be used at start-up to initialize the HCI device using - custom HCI commands. It should NOT be mixed with Asynchronous operations. Mixed synchronous - and asynchronous operation behavior is undefined. - - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_STATUS HCI_TransportSendPkt(HCI_TRANSPORT_HANDLE HciTrans, HTC_PACKET *pPacket, A_BOOL Synchronous); - - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Stop HCI transport - @function name: HCI_TransportStop - @input: HciTrans - hci transport handle - @output: - @return: - @notes: HCI transport communication will be halted. All receive and pending TX packets will - be flushed. - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -void HCI_TransportStop(HCI_TRANSPORT_HANDLE HciTrans); - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Start the HCI transport - @function name: HCI_TransportStart - @input: HciTrans - hci transport handle - @output: - @return: A_OK on success - @notes: HCI transport communication will begin, the caller can expect the arrival - of HCI recv packets as soon as this call returns. - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_STATUS HCI_TransportStart(HCI_TRANSPORT_HANDLE HciTrans); - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Enable or Disable Asynchronous Recv - @function name: HCI_TransportEnableDisableAsyncRecv - @input: HciTrans - hci transport handle - Enable - enable or disable asynchronous recv - @output: - @return: A_OK on success - @notes: This API must be called when HCI recv is handled synchronously - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_STATUS HCI_TransportEnableDisableAsyncRecv(HCI_TRANSPORT_HANDLE HciTrans, A_BOOL Enable); - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Receive an event packet from the HCI transport synchronously using polling - @function name: HCI_TransportRecvHCIEventSync - @input: HciTrans - hci transport handle - pPacket - HTC packet to hold the recv data - MaxPollMS - maximum polling duration in Milliseconds; - @output: - @return: A_OK on success - @notes: This API should be used only during HCI device initialization, the caller must call - HCI_TransportEnableDisableAsyncRecv with Enable=FALSE prior to using this API. - This API will only capture HCI Event packets. - @example: - @see also: HCI_TransportEnableDisableAsyncRecv -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_STATUS HCI_TransportRecvHCIEventSync(HCI_TRANSPORT_HANDLE HciTrans, - HTC_PACKET *pPacket, - int MaxPollMS); - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Set the desired baud rate for the underlying transport layer - @function name: HCI_TransportSetBaudRate - @input: HciTrans - hci transport handle - Baud - baud rate in bps - @output: - @return: A_OK on success - @notes: This API should be used only after HCI device initialization - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_STATUS HCI_TransportSetBaudRate(HCI_TRANSPORT_HANDLE HciTrans, A_UINT32 Baud); - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Enable/Disable HCI Transport Power Management - @function name: HCI_TransportEnablePowerMgmt - @input: HciTrans - hci transport handle - Enable - 1 = Enable, 0 = Disable - @output: - @return: A_OK on success - @notes: - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_STATUS HCI_TransportEnablePowerMgmt(HCI_TRANSPORT_HANDLE HciTrans, A_BOOL Enable); - -#ifdef __cplusplus -} -#endif - -#endif /* _HCI_TRANSPORT_API_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/hif.h b/drivers/net/wireless/ar6003/host/include/hif.h deleted file mode 100644 index df0d28f12ecb..000000000000 --- a/drivers/net/wireless/ar6003/host/include/hif.h +++ /dev/null @@ -1,517 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// HIF specific declarations and prototypes -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _HIF_H_ -#define _HIF_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Header files */ -#include "a_config.h" -#include "athdefs.h" -#include "a_types.h" -#include "a_osapi.h" -#include "dl_list.h" - - -typedef struct htc_callbacks HTC_CALLBACKS; -typedef struct hif_device HIF_DEVICE; - -#define HIF_TYPE_AR6002 2 -#define HIF_TYPE_AR6003 3 -#define HIF_TYPE_MCKINLEY 5 - -/* - * direction - Direction of transfer (HIF_READ/HIF_WRITE). - */ -#define HIF_READ 0x00000001 -#define HIF_WRITE 0x00000002 -#define HIF_DIR_MASK (HIF_READ | HIF_WRITE) - -/* - * type - An interface may support different kind of read/write commands. - * For example: SDIO supports CMD52/CMD53s. In case of MSIO it - * translates to using different kinds of TPCs. The command type - * is thus divided into a basic and an extended command and can - * be specified using HIF_BASIC_IO/HIF_EXTENDED_IO. - */ -#define HIF_BASIC_IO 0x00000004 -#define HIF_EXTENDED_IO 0x00000008 -#define HIF_TYPE_MASK (HIF_BASIC_IO | HIF_EXTENDED_IO) - -/* - * emode - This indicates the whether the command is to be executed in a - * blocking or non-blocking fashion (HIF_SYNCHRONOUS/ - * HIF_ASYNCHRONOUS). The read/write data paths in HTC have been - * implemented using the asynchronous mode allowing the the bus - * driver to indicate the completion of operation through the - * registered callback routine. The requirement primarily comes - * from the contexts these operations get called from (a driver's - * transmit context or the ISR context in case of receive). - * Support for both of these modes is essential. - */ -#define HIF_SYNCHRONOUS 0x00000010 -#define HIF_ASYNCHRONOUS 0x00000020 -#define HIF_EMODE_MASK (HIF_SYNCHRONOUS | HIF_ASYNCHRONOUS) - -/* - * dmode - An interface may support different kinds of commands based on - * the tradeoff between the amount of data it can carry and the - * setup time. Byte and Block modes are supported (HIF_BYTE_BASIS/ - * HIF_BLOCK_BASIS). In case of latter, the data is rounded off - * to the nearest block size by padding. The size of the block is - * configurable at compile time using the HIF_BLOCK_SIZE and is - * negotiated with the target during initialization after the - * AR6000 interrupts are enabled. - */ -#define HIF_BYTE_BASIS 0x00000040 -#define HIF_BLOCK_BASIS 0x00000080 -#define HIF_DMODE_MASK (HIF_BYTE_BASIS | HIF_BLOCK_BASIS) - -/* - * amode - This indicates if the address has to be incremented on AR6000 - * after every read/write operation (HIF?FIXED_ADDRESS/ - * HIF_INCREMENTAL_ADDRESS). - */ -#define HIF_FIXED_ADDRESS 0x00000100 -#define HIF_INCREMENTAL_ADDRESS 0x00000200 -#define HIF_AMODE_MASK (HIF_FIXED_ADDRESS | HIF_INCREMENTAL_ADDRESS) - -#define HIF_WR_ASYNC_BYTE_FIX \ - (HIF_WRITE | HIF_ASYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_FIXED_ADDRESS) -#define HIF_WR_ASYNC_BYTE_INC \ - (HIF_WRITE | HIF_ASYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_INCREMENTAL_ADDRESS) -#define HIF_WR_ASYNC_BLOCK_INC \ - (HIF_WRITE | HIF_ASYNCHRONOUS | HIF_EXTENDED_IO | HIF_BLOCK_BASIS | HIF_INCREMENTAL_ADDRESS) -#define HIF_WR_SYNC_BYTE_FIX \ - (HIF_WRITE | HIF_SYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_FIXED_ADDRESS) -#define HIF_WR_SYNC_BYTE_INC \ - (HIF_WRITE | HIF_SYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_INCREMENTAL_ADDRESS) -#define HIF_WR_SYNC_BLOCK_INC \ - (HIF_WRITE | HIF_SYNCHRONOUS | HIF_EXTENDED_IO | HIF_BLOCK_BASIS | HIF_INCREMENTAL_ADDRESS) -#define HIF_WR_ASYNC_BLOCK_FIX \ - (HIF_WRITE | HIF_ASYNCHRONOUS | HIF_EXTENDED_IO | HIF_BLOCK_BASIS | HIF_FIXED_ADDRESS) -#define HIF_WR_SYNC_BLOCK_FIX \ - (HIF_WRITE | HIF_SYNCHRONOUS | HIF_EXTENDED_IO | HIF_BLOCK_BASIS | HIF_FIXED_ADDRESS) -#define HIF_RD_SYNC_BYTE_INC \ - (HIF_READ | HIF_SYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_INCREMENTAL_ADDRESS) -#define HIF_RD_SYNC_BYTE_FIX \ - (HIF_READ | HIF_SYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_FIXED_ADDRESS) -#define HIF_RD_ASYNC_BYTE_FIX \ - (HIF_READ | HIF_ASYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_FIXED_ADDRESS) -#define HIF_RD_ASYNC_BLOCK_FIX \ - (HIF_READ | HIF_ASYNCHRONOUS | HIF_EXTENDED_IO | HIF_BLOCK_BASIS | HIF_FIXED_ADDRESS) -#define HIF_RD_ASYNC_BYTE_INC \ - (HIF_READ | HIF_ASYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_INCREMENTAL_ADDRESS) -#define HIF_RD_ASYNC_BLOCK_INC \ - (HIF_READ | HIF_ASYNCHRONOUS | HIF_EXTENDED_IO | HIF_BLOCK_BASIS | HIF_INCREMENTAL_ADDRESS) -#define HIF_RD_SYNC_BLOCK_INC \ - (HIF_READ | HIF_SYNCHRONOUS | HIF_EXTENDED_IO | HIF_BLOCK_BASIS | HIF_INCREMENTAL_ADDRESS) -#define HIF_RD_SYNC_BLOCK_FIX \ - (HIF_READ | HIF_SYNCHRONOUS | HIF_EXTENDED_IO | HIF_BLOCK_BASIS | HIF_FIXED_ADDRESS) - -typedef enum { - HIF_DEVICE_POWER_STATE = 0, - HIF_DEVICE_GET_MBOX_BLOCK_SIZE, - HIF_DEVICE_GET_MBOX_ADDR, - HIF_DEVICE_GET_PENDING_EVENTS_FUNC, - HIF_DEVICE_GET_IRQ_PROC_MODE, - HIF_DEVICE_GET_RECV_EVENT_MASK_UNMASK_FUNC, - HIF_DEVICE_POWER_STATE_CHANGE, - HIF_DEVICE_GET_IRQ_YIELD_PARAMS, - HIF_CONFIGURE_QUERY_SCATTER_REQUEST_SUPPORT, - HIF_DEVICE_GET_OS_DEVICE, - HIF_DEVICE_DEBUG_BUS_STATE, -} HIF_DEVICE_CONFIG_OPCODE; - -/* - * HIF CONFIGURE definitions: - * - * HIF_DEVICE_GET_MBOX_BLOCK_SIZE - * input : none - * output : array of 4 A_UINT32s - * notes: block size is returned for each mailbox (4) - * - * HIF_DEVICE_GET_MBOX_ADDR - * input : none - * output : HIF_DEVICE_MBOX_INFO - * notes: - * - * HIF_DEVICE_GET_PENDING_EVENTS_FUNC - * input : none - * output: HIF_PENDING_EVENTS_FUNC function pointer - * notes: this is optional for the HIF layer, if the request is - * not handled then it indicates that the upper layer can use - * the standard device methods to get pending events (IRQs, mailbox messages etc..) - * otherwise it can call the function pointer to check pending events. - * - * HIF_DEVICE_GET_IRQ_PROC_MODE - * input : none - * output : HIF_DEVICE_IRQ_PROCESSING_MODE (interrupt processing mode) - * note: the hif layer interfaces with the underlying OS-specific bus driver. The HIF - * layer can report whether IRQ processing is requires synchronous behavior or - * can be processed using asynchronous bus requests (typically faster). - * - * HIF_DEVICE_GET_RECV_EVENT_MASK_UNMASK_FUNC - * input : - * output : HIF_MASK_UNMASK_RECV_EVENT function pointer - * notes: this is optional for the HIF layer. The HIF layer may require a special mechanism - * to mask receive message events. The upper layer can call this pointer when it needs - * to mask/unmask receive events (in case it runs out of buffers). - * - * HIF_DEVICE_POWER_STATE_CHANGE - * - * input : HIF_DEVICE_POWER_CHANGE_TYPE - * output : none - * note: this is optional for the HIF layer. The HIF layer can handle power on/off state change - * requests in an interconnect specific way. This is highly OS and bus driver dependent. - * The caller must guarantee that no HIF read/write requests will be made after the device - * is powered down. - * - * HIF_DEVICE_GET_IRQ_YIELD_PARAMS - * - * input : none - * output : HIF_DEVICE_IRQ_YIELD_PARAMS - * note: This query checks if the HIF layer wishes to impose a processing yield count for the DSR handler. - * The DSR callback handler will exit after a fixed number of RX packets or events are processed. - * This query is only made if the device reports an IRQ processing mode of HIF_DEVICE_IRQ_SYNC_ONLY. - * The HIF implementation can ignore this command if it does not desire the DSR callback to yield. - * The HIF layer can indicate the maximum number of IRQ processing units (RX packets) before the - * DSR handler callback must yield and return control back to the HIF layer. When a yield limit is - * used the DSR callback will not call HIFAckInterrupts() as it would normally do before returning. - * The HIF implementation that requires a yield count must call HIFAckInterrupt() when it is prepared - * to process interrupts again. - * - * HIF_CONFIGURE_QUERY_SCATTER_REQUEST_SUPPORT - * input : none - * output : HIF_DEVICE_SCATTER_SUPPORT_INFO - * note: This query checks if the HIF layer implements the SCATTER request interface. Scatter requests - * allows upper layers to submit mailbox I/O operations using a list of buffers. This is useful for - * multi-message transfers that can better utilize the bus interconnect. - * - * - * HIF_DEVICE_GET_OS_DEVICE - * intput : none - * output : HIF_DEVICE_OS_DEVICE_INFO; - * note: On some operating systems, the HIF layer has a parent device object for the bus. This object - * may be required to register certain types of logical devices. - * - * HIF_DEVICE_DEBUG_BUS_STATE - * input : none - * output : none - * note: This configure option triggers the HIF interface to dump as much bus interface state. This - * configuration request is optional (No-OP on some HIF implementations) - * - */ - -typedef struct { - A_UINT32 ExtendedAddress; /* extended address for larger writes */ - A_UINT32 ExtendedSize; -} HIF_MBOX_PROPERTIES; - -#define HIF_MBOX_FLAG_NO_BUNDLING (1 << 0) /* do not allow bundling over the mailbox */ - -typedef struct { - A_UINT32 MboxAddresses[4]; /* must be first element for legacy HIFs that return the address in - and ARRAY of 32-bit words */ - - /* the following describe extended mailbox properties */ - HIF_MBOX_PROPERTIES MboxProp[4]; - /* if the HIF supports the GMbox extended address region it can report it - * here, some interfaces cannot support the GMBOX address range and not set this */ - A_UINT32 GMboxAddress; - A_UINT32 GMboxSize; - A_UINT32 Flags; /* flags to describe mbox behavior or usage */ -} HIF_DEVICE_MBOX_INFO; - -typedef enum { - HIF_DEVICE_IRQ_SYNC_ONLY, /* for HIF implementations that require the DSR to process all - interrupts before returning */ - HIF_DEVICE_IRQ_ASYNC_SYNC, /* for HIF implementations that allow DSR to process interrupts - using ASYNC I/O (that is HIFAckInterrupt can be called at a - later time */ -} HIF_DEVICE_IRQ_PROCESSING_MODE; - -typedef enum { - HIF_DEVICE_POWER_UP, /* HIF layer should power up interface and/or module */ - HIF_DEVICE_POWER_DOWN, /* HIF layer should initiate bus-specific measures to minimize power */ - HIF_DEVICE_POWER_CUT /* HIF layer should initiate bus-specific AND/OR platform-specific measures - to completely power-off the module and associated hardware (i.e. cut power supplies) - */ -} HIF_DEVICE_POWER_CHANGE_TYPE; - -typedef struct { - int RecvPacketYieldCount; /* max number of packets to force DSR to return */ -} HIF_DEVICE_IRQ_YIELD_PARAMS; - - -typedef struct _HIF_SCATTER_ITEM { - A_UINT8 *pBuffer; /* CPU accessible address of buffer */ - int Length; /* length of transfer to/from this buffer */ - void *pCallerContexts[2]; /* space for caller to insert a context associated with this item */ -} HIF_SCATTER_ITEM; - -struct _HIF_SCATTER_REQ; - -typedef void ( *HIF_SCATTER_COMP_CB)(struct _HIF_SCATTER_REQ *); - -typedef enum _HIF_SCATTER_METHOD { - HIF_SCATTER_NONE = 0, - HIF_SCATTER_DMA_REAL, /* Real SG support no restrictions */ - HIF_SCATTER_DMA_BOUNCE, /* Uses SG DMA but HIF layer uses an internal bounce buffer */ -} HIF_SCATTER_METHOD; - -typedef struct _HIF_SCATTER_REQ { - DL_LIST ListLink; /* link management */ - A_UINT32 Address; /* address for the read/write operation */ - A_UINT32 Request; /* request flags */ - A_UINT32 TotalLength; /* total length of entire transfer */ - A_UINT32 CallerFlags; /* caller specific flags can be stored here */ - HIF_SCATTER_COMP_CB CompletionRoutine; /* completion routine set by caller */ - A_STATUS CompletionStatus; /* status of completion */ - void *Context; /* caller context for this request */ - int ValidScatterEntries; /* number of valid entries set by caller */ - HIF_SCATTER_METHOD ScatterMethod; /* scatter method handled by HIF */ - void *HIFPrivate[4]; /* HIF private area */ - A_UINT8 *pScatterBounceBuffer; /* bounce buffer for upper layers to copy to/from */ - HIF_SCATTER_ITEM ScatterList[1]; /* start of scatter list */ -} HIF_SCATTER_REQ; - -typedef HIF_SCATTER_REQ * ( *HIF_ALLOCATE_SCATTER_REQUEST)(HIF_DEVICE *device); -typedef void ( *HIF_FREE_SCATTER_REQUEST)(HIF_DEVICE *device, HIF_SCATTER_REQ *request); -typedef A_STATUS ( *HIF_READWRITE_SCATTER)(HIF_DEVICE *device, HIF_SCATTER_REQ *request); - -typedef struct _HIF_DEVICE_SCATTER_SUPPORT_INFO { - /* information returned from HIF layer */ - HIF_ALLOCATE_SCATTER_REQUEST pAllocateReqFunc; - HIF_FREE_SCATTER_REQUEST pFreeReqFunc; - HIF_READWRITE_SCATTER pReadWriteScatterFunc; - int MaxScatterEntries; - int MaxTransferSizePerScatterReq; -} HIF_DEVICE_SCATTER_SUPPORT_INFO; - -typedef struct { - void *pOSDevice; -} HIF_DEVICE_OS_DEVICE_INFO; - -#define HIF_MAX_DEVICES 1 - -struct htc_callbacks { - void *context; /* context to pass to the dsrhandler - note : rwCompletionHandler is provided the context passed to HIFReadWrite */ - A_STATUS (* rwCompletionHandler)(void *rwContext, A_STATUS status); - A_STATUS (* dsrHandler)(void *context); -}; - -typedef struct osdrv_callbacks { - void *context; /* context to pass for all callbacks except deviceRemovedHandler - the deviceRemovedHandler is only called if the device is claimed */ - A_STATUS (* deviceInsertedHandler)(void *context, void *hif_handle); - A_STATUS (* deviceRemovedHandler)(void *claimedContext, void *hif_handle); - A_STATUS (* deviceSuspendHandler)(void *context); - A_STATUS (* deviceResumeHandler)(void *context); - A_STATUS (* deviceWakeupHandler)(void *context); - A_STATUS (* devicePowerChangeHandler)(void *context, HIF_DEVICE_POWER_CHANGE_TYPE config); -} OSDRV_CALLBACKS; - -#define HIF_OTHER_EVENTS (1 << 0) /* other interrupts (non-Recv) are pending, host - needs to read the register table to figure out what */ -#define HIF_RECV_MSG_AVAIL (1 << 1) /* pending recv packet */ - -typedef struct _HIF_PENDING_EVENTS_INFO { - A_UINT32 Events; - A_UINT32 LookAhead; - A_UINT32 AvailableRecvBytes; -} HIF_PENDING_EVENTS_INFO; - - /* function to get pending events , some HIF modules use special mechanisms - * to detect packet available and other interrupts */ -typedef A_STATUS ( *HIF_PENDING_EVENTS_FUNC)(HIF_DEVICE *device, - HIF_PENDING_EVENTS_INFO *pEvents, - void *AsyncContext); - -#define HIF_MASK_RECV TRUE -#define HIF_UNMASK_RECV FALSE - /* function to mask recv events */ -typedef A_STATUS ( *HIF_MASK_UNMASK_RECV_EVENT)(HIF_DEVICE *device, - A_BOOL Mask, - void *AsyncContext); - - -/* - * This API is used to perform any global initialization of the HIF layer - * and to set OS driver callbacks (i.e. insertion/removal) to the HIF layer - * - */ -A_STATUS HIFInit(OSDRV_CALLBACKS *callbacks); - -/* This API claims the HIF device and provides a context for handling removal. - * The device removal callback is only called when the OSDRV layer claims - * a device. The claimed context must be non-NULL */ -void HIFClaimDevice(HIF_DEVICE *device, void *claimedContext); -/* release the claimed device */ -void HIFReleaseDevice(HIF_DEVICE *device); - -/* This API allows the HTC layer to attach to the HIF device */ -A_STATUS HIFAttachHTC(HIF_DEVICE *device, HTC_CALLBACKS *callbacks); -/* This API detaches the HTC layer from the HIF device */ -void HIFDetachHTC(HIF_DEVICE *device); - -/* - * This API is used to provide the read/write interface over the specific bus - * interface. - * address - Starting address in the AR6000's address space. For mailbox - * writes, it refers to the start of the mbox boundary. It should - * be ensured that the last byte falls on the mailbox's EOM. For - * mailbox reads, it refers to the end of the mbox boundary. - * buffer - Pointer to the buffer containg the data to be transmitted or - * received. - * length - Amount of data to be transmitted or received. - * request - Characterizes the attributes of the command. - */ -A_STATUS -HIFReadWrite(HIF_DEVICE *device, - A_UINT32 address, - A_UCHAR *buffer, - A_UINT32 length, - A_UINT32 request, - void *context); - -/* - * This can be initiated from the unload driver context when the OSDRV layer has no more use for - * the device. - */ -void HIFShutDownDevice(HIF_DEVICE *device); - -/* - * This should translate to an acknowledgment to the bus driver indicating that - * the previous interrupt request has been serviced and the all the relevant - * sources have been cleared. HTC is ready to process more interrupts. - * This should prevent the bus driver from raising an interrupt unless the - * previous one has been serviced and acknowledged using the previous API. - */ -void HIFAckInterrupt(HIF_DEVICE *device); - -void HIFMaskInterrupt(HIF_DEVICE *device); - -void HIFUnMaskInterrupt(HIF_DEVICE *device); - -A_STATUS -HIFConfigureDevice(HIF_DEVICE *device, HIF_DEVICE_CONFIG_OPCODE opcode, - void *config, A_UINT32 configLen); - -/* - * This API wait for the remaining MBOX messages to be drained - * This should be moved to HTC AR6K layer - */ -A_STATUS hifWaitForPendingRecv(HIF_DEVICE *device); - -/****************************************************************/ -/* message based HIF interfaces */ -/****************************************************************/ - -#define HIF_BMI_EXCHANGE_NO_TIMEOUT ((A_UINT32)(0)) - -struct _HIF_MSG_OBJ; - -typedef void (* HIF_MSG_RECV_CALLBACK)(void *, struct _HIF_MSG_OBJ *); -typedef void (* HIF_MSG_REQ_COMPLETION)(void *,struct _HIF_MSG_OBJ *); - -typedef enum { - HIF_MSG_SIMPLE_BUFFER = 0, /* a simple buffer ptr and length */ - HIF_MSG_NET_BUFFER = 1 /* advanced OS-specific network buffer */ -} HIF_MSG_BUFFER_TYPE; - - /* object to pass HIF message requests from upper layers */ -typedef struct _HIF_MSG_OBJ { - DL_LIST ListLink; /* for list management */ - A_INT32 PipeId; /* pipe number to send on or recv'd from*/ - HIF_MSG_BUFFER_TYPE BufferType; - union { - struct HIF_MSG_NET_BUFFER { - void *pAppNetBuf; /* OS-specific net buf */ - } AsNetBuffer; - struct HIF_MSG_SIMPLE_BUFFER { - void *pBuffer; /* for future use.... */ - A_UINT32 Length; - } AsSimpleBuffer; - } BufferInfo; - void *pContext; /* caller context of message */ - HIF_MSG_REQ_COMPLETION CompletionRoutine; /* completion routine */ - A_STATUS Status; /* completion status */ - A_UINT32 Flags; /* request flags */ - void *HIFPriv[4]; /* private contexts for HIF layer to use */ - -} HIF_MSG_OBJ; - - /* API to handle HIF-specific BMI message exchanges, this API is synchronous - * and only allowed to be called from a context that can block (sleep) */ -A_STATUS HIFExchangeBMIMsg(HIF_DEVICE *device, - A_UINT8 *pSendMessage, - A_UINT32 Length, - A_UINT8 *pResponseMessage, - A_UINT32 *pResponseLength, - A_UINT32 TimeoutMS); - - /* API to handle HIF specific diagnostic window read accesses, this API is synchronous - * and only allowed to be called from a context that can block (sleep) */ -A_STATUS HIFDiagReadAccess(HIF_DEVICE *hifDevice, A_UINT32 address, A_UINT32 *data); - - /* API to handle HIF specific diagnostic window write accesses, this API is synchronous - * and only allowed to be called from a context that can block (sleep) */ -A_STATUS HIFDiagWriteAccess(HIF_DEVICE *hifDevice, A_UINT32 address, A_UINT32 data); - - /* get the Pipe ID associated with the service ID */ -A_STATUS HIFGetPipeId(HIF_DEVICE *hifDevice, A_UINT16 ServiceId, A_INT32 *pId); - - /* API to let HIF layer know that pipe communications should be enabled - * caller will start to exchange messages on service pipes */ -A_STATUS HIFEnablePipes(HIF_DEVICE *hifDevice); - - /* set the message recv handler for all incomming messages */ -void HIFSetMsgRecvHandler(HIF_DEVICE *hifDevice, - HIF_MSG_RECV_CALLBACK Callback, - void *pContext); - - /* upper layers should return the HIF_MSG_OBJ back to HIF as it may be associated - * with some recv resource. The objects could be returned in a chain (batch mode) - * Note, upper layers can take ownership of the buffer (free it) if it is of the type - * HIF_MSG_NET_BUFFER, in this case upper layers will set - * BufferInfo.AsNetBuffer.pAppNetBuf to NULL */ -void HIFReturnRecvMsgObjects(HIF_DEVICE *hifDevice, HIF_MSG_OBJ *pMessageObj); - - /* API for upper layers to send one or more messages. Note, HIF may - * take ownership of the buffer (it will free it) if it is of the type - * HIF_MSG_NET_BUFFER, in this case the HIF layer will set - * BufferInfo.AsNetBuffer.pAppNetBuf to NULL */ -A_STATUS HIFSendMessages(HIF_DEVICE *hifDevice, HIF_MSG_OBJ *pMessages); - - -#ifdef __cplusplus -} -#endif - -#endif /* _HIF_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/host_reg_table.h b/drivers/net/wireless/ar6003/host/include/host_reg_table.h deleted file mode 100644 index a664cd826f31..000000000000 --- a/drivers/net/wireless/ar6003/host/include/host_reg_table.h +++ /dev/null @@ -1,226 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2008 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Target register table macros and structure definitions -// -// Author(s): ="Atheros" -//============================================================================== - -#ifndef HOST_REG_TABLE_H_ -#define HOST_REG_TABLE_H_ - -#include "targaddrs.h" -/*** WARNING : Add to the end of the TABLE! do not change the order ****/ -typedef struct hostdef_s { - A_UINT32 d_INT_STATUS_ENABLE_ERROR_LSB; - A_UINT32 d_INT_STATUS_ENABLE_ERROR_MASK; - A_UINT32 d_INT_STATUS_ENABLE_CPU_LSB; - A_UINT32 d_INT_STATUS_ENABLE_CPU_MASK; - A_UINT32 d_INT_STATUS_ENABLE_COUNTER_LSB; - A_UINT32 d_INT_STATUS_ENABLE_COUNTER_MASK; - A_UINT32 d_INT_STATUS_ENABLE_MBOX_DATA_LSB; - A_UINT32 d_INT_STATUS_ENABLE_MBOX_DATA_MASK; - A_UINT32 d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB; - A_UINT32 d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK; - A_UINT32 d_ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB; - A_UINT32 d_ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK; - A_UINT32 d_COUNTER_INT_STATUS_ENABLE_BIT_LSB; - A_UINT32 d_COUNTER_INT_STATUS_ENABLE_BIT_MASK; - A_UINT32 d_INT_STATUS_ENABLE_ADDRESS; - A_UINT32 d_CPU_INT_STATUS_ENABLE_BIT_LSB; - A_UINT32 d_CPU_INT_STATUS_ENABLE_BIT_MASK; - A_UINT32 d_HOST_INT_STATUS_ADDRESS; - A_UINT32 d_CPU_INT_STATUS_ADDRESS; - A_UINT32 d_ERROR_INT_STATUS_ADDRESS; - A_UINT32 d_ERROR_INT_STATUS_WAKEUP_MASK; - A_UINT32 d_ERROR_INT_STATUS_WAKEUP_LSB; - A_UINT32 d_ERROR_INT_STATUS_RX_UNDERFLOW_MASK; - A_UINT32 d_ERROR_INT_STATUS_RX_UNDERFLOW_LSB; - A_UINT32 d_ERROR_INT_STATUS_TX_OVERFLOW_MASK; - A_UINT32 d_ERROR_INT_STATUS_TX_OVERFLOW_LSB; - A_UINT32 d_COUNT_DEC_ADDRESS; - A_UINT32 d_HOST_INT_STATUS_CPU_MASK; - A_UINT32 d_HOST_INT_STATUS_CPU_LSB; - A_UINT32 d_HOST_INT_STATUS_ERROR_MASK; - A_UINT32 d_HOST_INT_STATUS_ERROR_LSB; - A_UINT32 d_HOST_INT_STATUS_COUNTER_MASK; - A_UINT32 d_HOST_INT_STATUS_COUNTER_LSB; - A_UINT32 d_RX_LOOKAHEAD_VALID_ADDRESS; - A_UINT32 d_WINDOW_DATA_ADDRESS; - A_UINT32 d_WINDOW_READ_ADDR_ADDRESS; - A_UINT32 d_WINDOW_WRITE_ADDR_ADDRESS; -} HOST_REGISTER_TABLE; - -#if defined(MY_HOST_DEF) /* { */ -#if defined(ATHR_WIN_DEF) -#define ATH_REG_TABLE_DIRECT_ASSIGN -#endif -#ifdef ATH_REG_TABLE_DIRECT_ASSIGN - -static struct hostdef_s my_host_def = { - INT_STATUS_ENABLE_ERROR_LSB, - INT_STATUS_ENABLE_ERROR_MASK, - INT_STATUS_ENABLE_CPU_LSB, - INT_STATUS_ENABLE_CPU_MASK, - INT_STATUS_ENABLE_COUNTER_LSB, - INT_STATUS_ENABLE_COUNTER_MASK, - INT_STATUS_ENABLE_MBOX_DATA_LSB, - INT_STATUS_ENABLE_MBOX_DATA_MASK, - ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB, - ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK, - ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB, - ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK, - COUNTER_INT_STATUS_ENABLE_BIT_LSB, - COUNTER_INT_STATUS_ENABLE_BIT_MASK, - INT_STATUS_ENABLE_ADDRESS, - CPU_INT_STATUS_ENABLE_BIT_LSB, - CPU_INT_STATUS_ENABLE_BIT_MASK, - HOST_INT_STATUS_ADDRESS, - CPU_INT_STATUS_ADDRESS, - ERROR_INT_STATUS_ADDRESS, - ERROR_INT_STATUS_WAKEUP_MASK, - ERROR_INT_STATUS_WAKEUP_LSB, - ERROR_INT_STATUS_RX_UNDERFLOW_MASK, - ERROR_INT_STATUS_RX_UNDERFLOW_LSB, - ERROR_INT_STATUS_TX_OVERFLOW_MASK, - ERROR_INT_STATUS_TX_OVERFLOW_LSB, - COUNT_DEC_ADDRESS, - HOST_INT_STATUS_CPU_MASK, - HOST_INT_STATUS_CPU_LSB, - HOST_INT_STATUS_ERROR_MASK, - HOST_INT_STATUS_ERROR_LSB, - HOST_INT_STATUS_COUNTER_MASK, - HOST_INT_STATUS_COUNTER_LSB, - RX_LOOKAHEAD_VALID_ADDRESS, - WINDOW_DATA_ADDRESS, - WINDOW_READ_ADDR_ADDRESS, - WINDOW_WRITE_ADDR_ADDRESS, -}; - -#else - -static struct hostdef_s my_host_def = { - .d_INT_STATUS_ENABLE_ERROR_LSB = INT_STATUS_ENABLE_ERROR_LSB, - .d_INT_STATUS_ENABLE_ERROR_MASK = INT_STATUS_ENABLE_ERROR_MASK, - .d_INT_STATUS_ENABLE_CPU_LSB = INT_STATUS_ENABLE_CPU_LSB, - .d_INT_STATUS_ENABLE_CPU_MASK = INT_STATUS_ENABLE_CPU_MASK, - .d_INT_STATUS_ENABLE_COUNTER_LSB = INT_STATUS_ENABLE_COUNTER_LSB, - .d_INT_STATUS_ENABLE_COUNTER_MASK = INT_STATUS_ENABLE_COUNTER_MASK, - .d_INT_STATUS_ENABLE_MBOX_DATA_LSB = INT_STATUS_ENABLE_MBOX_DATA_LSB, - .d_INT_STATUS_ENABLE_MBOX_DATA_MASK = INT_STATUS_ENABLE_MBOX_DATA_MASK, - .d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB = ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB, - .d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK = ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK, - .d_ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB = ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB, - .d_ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK = ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK, - .d_COUNTER_INT_STATUS_ENABLE_BIT_LSB = COUNTER_INT_STATUS_ENABLE_BIT_LSB, - .d_COUNTER_INT_STATUS_ENABLE_BIT_MASK = COUNTER_INT_STATUS_ENABLE_BIT_MASK, - .d_INT_STATUS_ENABLE_ADDRESS = INT_STATUS_ENABLE_ADDRESS, - .d_CPU_INT_STATUS_ENABLE_BIT_LSB = CPU_INT_STATUS_ENABLE_BIT_LSB, - .d_CPU_INT_STATUS_ENABLE_BIT_MASK = CPU_INT_STATUS_ENABLE_BIT_MASK, - .d_HOST_INT_STATUS_ADDRESS = HOST_INT_STATUS_ADDRESS, - .d_CPU_INT_STATUS_ADDRESS = CPU_INT_STATUS_ADDRESS, - .d_ERROR_INT_STATUS_ADDRESS = ERROR_INT_STATUS_ADDRESS, - .d_ERROR_INT_STATUS_WAKEUP_MASK = ERROR_INT_STATUS_WAKEUP_MASK, - .d_ERROR_INT_STATUS_WAKEUP_LSB = ERROR_INT_STATUS_WAKEUP_LSB, - .d_ERROR_INT_STATUS_RX_UNDERFLOW_MASK = ERROR_INT_STATUS_RX_UNDERFLOW_MASK, - .d_ERROR_INT_STATUS_RX_UNDERFLOW_LSB = ERROR_INT_STATUS_RX_UNDERFLOW_LSB, - .d_ERROR_INT_STATUS_TX_OVERFLOW_MASK = ERROR_INT_STATUS_TX_OVERFLOW_MASK, - .d_ERROR_INT_STATUS_TX_OVERFLOW_LSB = ERROR_INT_STATUS_TX_OVERFLOW_LSB, - .d_COUNT_DEC_ADDRESS = COUNT_DEC_ADDRESS, - .d_HOST_INT_STATUS_CPU_MASK = HOST_INT_STATUS_CPU_MASK, - .d_HOST_INT_STATUS_CPU_LSB = HOST_INT_STATUS_CPU_LSB, - .d_HOST_INT_STATUS_ERROR_MASK = HOST_INT_STATUS_ERROR_MASK, - .d_HOST_INT_STATUS_ERROR_LSB = HOST_INT_STATUS_ERROR_LSB, - .d_HOST_INT_STATUS_COUNTER_MASK = HOST_INT_STATUS_COUNTER_MASK, - .d_HOST_INT_STATUS_COUNTER_LSB = HOST_INT_STATUS_COUNTER_LSB, - .d_RX_LOOKAHEAD_VALID_ADDRESS = RX_LOOKAHEAD_VALID_ADDRESS, - .d_WINDOW_DATA_ADDRESS = WINDOW_DATA_ADDRESS, - .d_WINDOW_READ_ADDR_ADDRESS = WINDOW_READ_ADDR_ADDRESS, - .d_WINDOW_WRITE_ADDR_ADDRESS = WINDOW_WRITE_ADDR_ADDRESS, -}; - -#endif - -struct hostdef_s *MY_HOST_DEF = &my_host_def; - -#else /* } { */ - -#define INT_STATUS_ENABLE_ERROR_LSB (hostdef->d_INT_STATUS_ENABLE_ERROR_LSB) -#define INT_STATUS_ENABLE_ERROR_MASK (hostdef->d_INT_STATUS_ENABLE_ERROR_MASK) -#define INT_STATUS_ENABLE_CPU_LSB (hostdef->d_INT_STATUS_ENABLE_CPU_LSB) -#define INT_STATUS_ENABLE_CPU_MASK (hostdef->d_INT_STATUS_ENABLE_CPU_MASK) -#define INT_STATUS_ENABLE_COUNTER_LSB (hostdef->d_INT_STATUS_ENABLE_COUNTER_LSB) -#define INT_STATUS_ENABLE_COUNTER_MASK (hostdef->d_INT_STATUS_ENABLE_COUNTER_MASK) -#define INT_STATUS_ENABLE_MBOX_DATA_LSB (hostdef->d_INT_STATUS_ENABLE_MBOX_DATA_LSB) -#define INT_STATUS_ENABLE_MBOX_DATA_MASK (hostdef->d_INT_STATUS_ENABLE_MBOX_DATA_MASK) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB (hostdef->d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK (hostdef->d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB (hostdef->d_ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK (hostdef->d_ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) -#define COUNTER_INT_STATUS_ENABLE_BIT_LSB (hostdef->d_COUNTER_INT_STATUS_ENABLE_BIT_LSB) -#define COUNTER_INT_STATUS_ENABLE_BIT_MASK (hostdef->d_COUNTER_INT_STATUS_ENABLE_BIT_MASK) -#define INT_STATUS_ENABLE_ADDRESS (hostdef->d_INT_STATUS_ENABLE_ADDRESS) -#define CPU_INT_STATUS_ENABLE_BIT_LSB (hostdef->d_CPU_INT_STATUS_ENABLE_BIT_LSB) -#define CPU_INT_STATUS_ENABLE_BIT_MASK (hostdef->d_CPU_INT_STATUS_ENABLE_BIT_MASK) -#define HOST_INT_STATUS_ADDRESS (hostdef->d_HOST_INT_STATUS_ADDRESS) -#define CPU_INT_STATUS_ADDRESS (hostdef->d_CPU_INT_STATUS_ADDRESS) -#define ERROR_INT_STATUS_ADDRESS (hostdef->d_ERROR_INT_STATUS_ADDRESS) -#define ERROR_INT_STATUS_WAKEUP_MASK (hostdef->d_ERROR_INT_STATUS_WAKEUP_MASK) -#define ERROR_INT_STATUS_WAKEUP_LSB (hostdef->d_ERROR_INT_STATUS_WAKEUP_LSB) -#define ERROR_INT_STATUS_RX_UNDERFLOW_MASK (hostdef->d_ERROR_INT_STATUS_RX_UNDERFLOW_MASK) -#define ERROR_INT_STATUS_RX_UNDERFLOW_LSB (hostdef->d_ERROR_INT_STATUS_RX_UNDERFLOW_LSB) -#define ERROR_INT_STATUS_TX_OVERFLOW_MASK (hostdef->d_ERROR_INT_STATUS_TX_OVERFLOW_MASK) -#define ERROR_INT_STATUS_TX_OVERFLOW_LSB (hostdef->d_ERROR_INT_STATUS_TX_OVERFLOW_LSB) -#define COUNT_DEC_ADDRESS (hostdef->d_COUNT_DEC_ADDRESS) -#define HOST_INT_STATUS_CPU_MASK (hostdef->d_HOST_INT_STATUS_CPU_MASK) -#define HOST_INT_STATUS_CPU_LSB (hostdef->d_HOST_INT_STATUS_CPU_LSB) -#define HOST_INT_STATUS_ERROR_MASK (hostdef->d_HOST_INT_STATUS_ERROR_MASK) -#define HOST_INT_STATUS_ERROR_LSB (hostdef->d_HOST_INT_STATUS_ERROR_LSB) -#define HOST_INT_STATUS_COUNTER_MASK (hostdef->d_HOST_INT_STATUS_COUNTER_MASK) -#define HOST_INT_STATUS_COUNTER_LSB (hostdef->d_HOST_INT_STATUS_COUNTER_LSB) -#define RX_LOOKAHEAD_VALID_ADDRESS (hostdef->d_RX_LOOKAHEAD_VALID_ADDRESS) -#define WINDOW_DATA_ADDRESS (hostdef->d_WINDOW_DATA_ADDRESS) -#define WINDOW_READ_ADDR_ADDRESS (hostdef->d_WINDOW_READ_ADDR_ADDRESS) -#define WINDOW_WRITE_ADDR_ADDRESS (hostdef->d_WINDOW_WRITE_ADDR_ADDRESS) - -/* SET macros */ -#define INT_STATUS_ENABLE_ERROR_SET(x) (((x) << INT_STATUS_ENABLE_ERROR_LSB) & INT_STATUS_ENABLE_ERROR_MASK) -#define INT_STATUS_ENABLE_CPU_SET(x) (((x) << INT_STATUS_ENABLE_CPU_LSB) & INT_STATUS_ENABLE_CPU_MASK) -#define INT_STATUS_ENABLE_COUNTER_SET(x) (((x) << INT_STATUS_ENABLE_COUNTER_LSB) & INT_STATUS_ENABLE_COUNTER_MASK) -#define INT_STATUS_ENABLE_MBOX_DATA_SET(x) (((x) << INT_STATUS_ENABLE_MBOX_DATA_LSB) & INT_STATUS_ENABLE_MBOX_DATA_MASK) -#define CPU_INT_STATUS_ENABLE_BIT_SET(x) (((x) << CPU_INT_STATUS_ENABLE_BIT_LSB) & CPU_INT_STATUS_ENABLE_BIT_MASK) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) -#define COUNTER_INT_STATUS_ENABLE_BIT_SET(x) (((x) << COUNTER_INT_STATUS_ENABLE_BIT_LSB) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) -#define ERROR_INT_STATUS_WAKEUP_GET(x) (((x) & ERROR_INT_STATUS_WAKEUP_MASK) >> ERROR_INT_STATUS_WAKEUP_LSB) -#define ERROR_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) >> ERROR_INT_STATUS_RX_UNDERFLOW_LSB) -#define ERROR_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) >> ERROR_INT_STATUS_TX_OVERFLOW_LSB) -#define HOST_INT_STATUS_CPU_GET(x) (((x) & HOST_INT_STATUS_CPU_MASK) >> HOST_INT_STATUS_CPU_LSB) -#define HOST_INT_STATUS_ERROR_GET(x) (((x) & HOST_INT_STATUS_ERROR_MASK) >> HOST_INT_STATUS_ERROR_LSB) -#define HOST_INT_STATUS_COUNTER_GET(x) (((x) & HOST_INT_STATUS_COUNTER_MASK) >> HOST_INT_STATUS_COUNTER_LSB) - - -extern struct hostdef_s *hostdef; - -#endif /* } */ - -#endif /*HOST_REG_TABLE_H_*/ - - diff --git a/drivers/net/wireless/ar6003/host/include/host_version.h b/drivers/net/wireless/ar6003/host/include/host_version.h deleted file mode 100644 index 74f1982c681b..000000000000 --- a/drivers/net/wireless/ar6003/host/include/host_version.h +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This file contains version information for the sample host driver for the -// AR6000 chip -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _HOST_VERSION_H_ -#define _HOST_VERSION_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/* - * The version number is made up of major, minor, patch and build - * numbers. These are 16 bit numbers. The build and release script will - * set the build number using a Perforce counter. Here the build number is - * set to 9999 so that builds done without the build-release script are easily - * identifiable. - */ - -#define ATH_SW_VER_MAJOR __VER_MAJOR_ -#define ATH_SW_VER_MINOR __VER_MINOR_ -#define ATH_SW_VER_PATCH __VER_PATCH_ -#define ATH_SW_VER_BUILD __BUILD_NUMBER_ - -#ifdef __cplusplus -} -#endif - -#endif /* _HOST_VERSION_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/htc_api.h b/drivers/net/wireless/ar6003/host/include/htc_api.h deleted file mode 100644 index b007051e0551..000000000000 --- a/drivers/net/wireless/ar6003/host/include/htc_api.h +++ /dev/null @@ -1,575 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== -#ifndef _HTC_API_H_ -#define _HTC_API_H_ - -#include "htc_packet.h" -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* TODO.. for BMI */ -#define ENDPOINT1 0 -// TODO -remove me, but we have to fix BMI first -#define HTC_MAILBOX_NUM_MAX 4 - -/* this is the amount of header room required by users of HTC */ -#define HTC_HEADER_LEN HTC_HDR_LENGTH - -typedef void *HTC_HANDLE; - -typedef A_UINT16 HTC_SERVICE_ID; - -typedef struct _HTC_INIT_INFO { - void *pContext; /* context for target failure notification */ - void (*TargetFailure)(void *Instance, A_STATUS Status); -} HTC_INIT_INFO; - -/* per service connection send completion */ -typedef void (*HTC_EP_SEND_PKT_COMPLETE)(void *,HTC_PACKET *); -/* per service connection callback when a plurality of packets have been sent - * The HTC_PACKET_QUEUE is a temporary queue object (e.g. freed on return from the callback) - * to hold a list of completed send packets. - * If the handler cannot fully traverse the packet queue before returning, it should - * transfer the items of the queue into the caller's private queue using: - * HTC_PACKET_ENQUEUE() */ -typedef void (*HTC_EP_SEND_PKT_COMP_MULTIPLE)(void *,HTC_PACKET_QUEUE *); -/* per service connection pkt received */ -typedef void (*HTC_EP_RECV_PKT)(void *,HTC_PACKET *); -/* per service connection callback when a plurality of packets are received - * The HTC_PACKET_QUEUE is a temporary queue object (e.g. freed on return from the callback) - * to hold a list of recv packets. - * If the handler cannot fully traverse the packet queue before returning, it should - * transfer the items of the queue into the caller's private queue using: - * HTC_PACKET_ENQUEUE() */ -typedef void (*HTC_EP_RECV_PKT_MULTIPLE)(void *,HTC_PACKET_QUEUE *); - -/* Optional per service connection receive buffer re-fill callback, - * On some OSes (like Linux) packets are allocated from a global pool and indicated up - * to the network stack. The driver never gets the packets back from the OS. For these OSes - * a refill callback can be used to allocate and re-queue buffers into HTC. - * - * On other OSes, the network stack can call into the driver's OS-specifc "return_packet" handler and - * the driver can re-queue these buffers into HTC. In this regard a refill callback is - * unnecessary */ -typedef void (*HTC_EP_RECV_REFILL)(void *, HTC_ENDPOINT_ID Endpoint); - -/* Optional per service connection receive buffer allocation callback. - * On some systems packet buffers are an extremely limited resource. Rather than - * queue largest-possible-sized buffers to HTC, some systems would rather - * allocate a specific size as the packet is received. The trade off is - * slightly more processing (callback invoked for each RX packet) - * for the benefit of committing fewer buffer resources into HTC. - * - * The callback is provided the length of the pending packet to fetch. This includes the - * HTC header length plus the length of payload. The callback can return a pointer to - * the allocated HTC packet for immediate use. - * - * Alternatively a variant of this handler can be used to allocate large receive packets as needed. - * For example an application can use the refill mechanism for normal packets and the recv-alloc mechanism to - * handle the case where a large packet buffer is required. This can significantly reduce the - * amount of "committed" memory used to receive packets. - * - * */ -typedef HTC_PACKET *(*HTC_EP_RECV_ALLOC)(void *, HTC_ENDPOINT_ID Endpoint, int Length); - -typedef enum _HTC_SEND_FULL_ACTION { - HTC_SEND_FULL_KEEP = 0, /* packet that overflowed should be kept in the queue */ - HTC_SEND_FULL_DROP = 1, /* packet that overflowed should be dropped */ -} HTC_SEND_FULL_ACTION; - -/* Optional per service connection callback when a send queue is full. This can occur if the - * host continues queueing up TX packets faster than credits can arrive - * To prevent the host (on some Oses like Linux) from continuously queueing packets - * and consuming resources, this callback is provided so that that the host - * can disable TX in the subsystem (i.e. network stack). - * This callback is invoked for each packet that "overflows" the HTC queue. The callback can - * determine whether the new packet that overflowed the queue can be kept (HTC_SEND_FULL_KEEP) or - * dropped (HTC_SEND_FULL_DROP). If a packet is dropped, the EpTxComplete handler will be called - * and the packet's status field will be set to A_NO_RESOURCE. - * Other OSes require a "per-packet" indication for each completed TX packet, this - * closed loop mechanism will prevent the network stack from overunning the NIC - * The packet to keep or drop is passed for inspection to the registered handler the handler - * must ONLY inspect the packet, it may not free or reclaim the packet. */ -typedef HTC_SEND_FULL_ACTION (*HTC_EP_SEND_QUEUE_FULL)(void *, HTC_PACKET *pPacket); - -typedef struct _HTC_EP_CALLBACKS { - void *pContext; /* context for each callback */ - HTC_EP_SEND_PKT_COMPLETE EpTxComplete; /* tx completion callback for connected endpoint */ - HTC_EP_RECV_PKT EpRecv; /* receive callback for connected endpoint */ - HTC_EP_RECV_REFILL EpRecvRefill; /* OPTIONAL receive re-fill callback for connected endpoint */ - HTC_EP_SEND_QUEUE_FULL EpSendFull; /* OPTIONAL send full callback */ - HTC_EP_RECV_ALLOC EpRecvAlloc; /* OPTIONAL recv allocation callback */ - HTC_EP_RECV_ALLOC EpRecvAllocThresh; /* OPTIONAL recv allocation callback based on a threshold */ - HTC_EP_SEND_PKT_COMP_MULTIPLE EpTxCompleteMultiple; /* OPTIONAL completion handler for multiple complete - indications (EpTxComplete must be NULL) */ - HTC_EP_RECV_PKT_MULTIPLE EpRecvPktMultiple; /* OPTIONAL completion handler for multiple - recv packet indications (EpRecv must be NULL) */ - int RecvAllocThreshold; /* if EpRecvAllocThresh is non-NULL, HTC will compare the - threshold value to the current recv packet length and invoke - the EpRecvAllocThresh callback to acquire a packet buffer */ - int RecvRefillWaterMark; /* if a EpRecvRefill handler is provided, this value - can be used to set a trigger refill callback - when the recv queue drops below this value - if set to 0, the refill is only called when packets - are empty */ -} HTC_EP_CALLBACKS; - -/* service connection information */ -typedef struct _HTC_SERVICE_CONNECT_REQ { - HTC_SERVICE_ID ServiceID; /* service ID to connect to */ - A_UINT16 ConnectionFlags; /* connection flags, see htc protocol definition */ - A_UINT8 *pMetaData; /* ptr to optional service-specific meta-data */ - A_UINT8 MetaDataLength; /* optional meta data length */ - HTC_EP_CALLBACKS EpCallbacks; /* endpoint callbacks */ - int MaxSendQueueDepth; /* maximum depth of any send queue */ - A_UINT32 LocalConnectionFlags; /* HTC flags for the host-side (local) connection */ - unsigned int MaxSendMsgSize; /* override max message size in send direction */ -} HTC_SERVICE_CONNECT_REQ; - -#define HTC_LOCAL_CONN_FLAGS_ENABLE_SEND_BUNDLE_PADDING (1 << 0) /* enable send bundle padding for this endpoint */ - -/* service connection response information */ -typedef struct _HTC_SERVICE_CONNECT_RESP { - A_UINT8 *pMetaData; /* caller supplied buffer to optional meta-data */ - A_UINT8 BufferLength; /* length of caller supplied buffer */ - A_UINT8 ActualLength; /* actual length of meta data */ - HTC_ENDPOINT_ID Endpoint; /* endpoint to communicate over */ - unsigned int MaxMsgLength; /* max length of all messages over this endpoint */ - A_UINT8 ConnectRespCode; /* connect response code from target */ -} HTC_SERVICE_CONNECT_RESP; - -/* endpoint distribution structure */ -typedef struct _HTC_ENDPOINT_CREDIT_DIST { - struct _HTC_ENDPOINT_CREDIT_DIST *pNext; - struct _HTC_ENDPOINT_CREDIT_DIST *pPrev; - HTC_SERVICE_ID ServiceID; /* Service ID (set by HTC) */ - HTC_ENDPOINT_ID Endpoint; /* endpoint for this distribution struct (set by HTC) */ - A_UINT32 DistFlags; /* distribution flags, distribution function can - set default activity using SET_EP_ACTIVE() macro */ - int TxCreditsNorm; /* credits for normal operation, anything above this - indicates the endpoint is over-subscribed, this field - is only relevant to the credit distribution function */ - int TxCreditsMin; /* floor for credit distribution, this field is - only relevant to the credit distribution function */ - int TxCreditsAssigned; /* number of credits assigned to this EP, this field - is only relevant to the credit dist function */ - int TxCredits; /* current credits available, this field is used by - HTC to determine whether a message can be sent or - must be queued */ - int TxCreditsToDist; /* pending credits to distribute on this endpoint, this - is set by HTC when credit reports arrive. - The credit distribution functions sets this to zero - when it distributes the credits */ - int TxCreditsSeek; /* this is the number of credits that the current pending TX - packet needs to transmit. This is set by HTC when - and endpoint needs credits in order to transmit */ - int TxCreditSize; /* size in bytes of each credit (set by HTC) */ - int TxCreditsPerMaxMsg; /* credits required for a maximum sized messages (set by HTC) */ - void *pHTCReserved; /* reserved for HTC use */ - int TxQueueDepth; /* current depth of TX queue , i.e. messages waiting for credits - This field is valid only when HTC_CREDIT_DIST_ACTIVITY_CHANGE - or HTC_CREDIT_DIST_SEND_COMPLETE is indicated on an endpoint - that has non-zero credits to recover - */ -} HTC_ENDPOINT_CREDIT_DIST; - -#define HTC_EP_ACTIVE ((A_UINT32) (1u << 31)) - -/* macro to check if an endpoint has gone active, useful for credit - * distributions */ -#define IS_EP_ACTIVE(epDist) ((epDist)->DistFlags & HTC_EP_ACTIVE) -#define SET_EP_ACTIVE(epDist) (epDist)->DistFlags |= HTC_EP_ACTIVE - - /* credit distibution code that is passed into the distrbution function, - * there are mandatory and optional codes that must be handled */ -typedef enum _HTC_CREDIT_DIST_REASON { - HTC_CREDIT_DIST_SEND_COMPLETE = 0, /* credits available as a result of completed - send operations (MANDATORY) resulting in credit reports */ - HTC_CREDIT_DIST_ACTIVITY_CHANGE = 1, /* a change in endpoint activity occured (OPTIONAL) */ - HTC_CREDIT_DIST_SEEK_CREDITS, /* an endpoint needs to "seek" credits (OPTIONAL) */ - HTC_DUMP_CREDIT_STATE /* for debugging, dump any state information that is kept by - the distribution function */ -} HTC_CREDIT_DIST_REASON; - -typedef void (*HTC_CREDIT_DIST_CALLBACK)(void *Context, - HTC_ENDPOINT_CREDIT_DIST *pEPList, - HTC_CREDIT_DIST_REASON Reason); - -typedef void (*HTC_CREDIT_INIT_CALLBACK)(void *Context, - HTC_ENDPOINT_CREDIT_DIST *pEPList, - int TotalCredits); - - /* endpoint statistics action */ -typedef enum _HTC_ENDPOINT_STAT_ACTION { - HTC_EP_STAT_SAMPLE = 0, /* only read statistics */ - HTC_EP_STAT_SAMPLE_AND_CLEAR = 1, /* sample and immediately clear statistics */ - HTC_EP_STAT_CLEAR /* clear only */ -} HTC_ENDPOINT_STAT_ACTION; - - /* endpoint statistics */ -typedef struct _HTC_ENDPOINT_STATS { - A_UINT32 TxCreditLowIndications; /* number of times the host set the credit-low flag in a send message on - this endpoint */ - A_UINT32 TxIssued; /* running count of total TX packets issued */ - A_UINT32 TxPacketsBundled; /* running count of TX packets that were issued in bundles */ - A_UINT32 TxBundles; /* running count of TX bundles that were issued */ - A_UINT32 TxDropped; /* tx packets that were dropped */ - A_UINT32 TxCreditRpts; /* running count of total credit reports received for this endpoint */ - A_UINT32 TxCreditRptsFromRx; /* credit reports received from this endpoint's RX packets */ - A_UINT32 TxCreditRptsFromOther; /* credit reports received from RX packets of other endpoints */ - A_UINT32 TxCreditRptsFromEp0; /* credit reports received from endpoint 0 RX packets */ - A_UINT32 TxCreditsFromRx; /* count of credits received via Rx packets on this endpoint */ - A_UINT32 TxCreditsFromOther; /* count of credits received via another endpoint */ - A_UINT32 TxCreditsFromEp0; /* count of credits received via another endpoint */ - A_UINT32 TxCreditsConsummed; /* count of consummed credits */ - A_UINT32 TxCreditsReturned; /* count of credits returned */ - A_UINT32 RxReceived; /* count of RX packets received */ - A_UINT32 RxLookAheads; /* count of lookahead records - found in messages received on this endpoint */ - A_UINT32 RxPacketsBundled; /* count of recv packets received in a bundle */ - A_UINT32 RxBundleLookAheads; /* count of number of bundled lookaheads */ - A_UINT32 RxBundleIndFromHdr; /* count of the number of bundle indications from the HTC header */ - A_UINT32 RxAllocThreshHit; /* count of the number of times the recv allocation threshhold was hit */ - A_UINT32 RxAllocThreshBytes; /* total number of bytes */ -} HTC_ENDPOINT_STATS; - -/* ------ Function Prototypes ------ */ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Create an instance of HTC over the underlying HIF device - @function name: HTCCreate - @input: HifDevice - hif device handle, - pInfo - initialization information - @output: - @return: HTC_HANDLE on success, NULL on failure - @notes: - @example: - @see also: HTCDestroy -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -HTC_HANDLE HTCCreate(void *HifDevice, HTC_INIT_INFO *pInfo); -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Get the underlying HIF device handle - @function name: HTCGetHifDevice - @input: HTCHandle - handle passed into the AddInstance callback - @output: - @return: opaque HIF device handle usable in HIF API calls. - @notes: - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -void *HTCGetHifDevice(HTC_HANDLE HTCHandle); -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Set credit distribution parameters - @function name: HTCSetCreditDistribution - @input: HTCHandle - HTC handle - pCreditDistCont - caller supplied context to pass into distribution functions - CreditDistFunc - Distribution function callback - CreditDistInit - Credit Distribution initialization callback - ServicePriorityOrder - Array containing list of service IDs, lowest index is highest - priority - ListLength - number of elements in ServicePriorityOrder - @output: - @return: - @notes: The user can set a custom credit distribution function to handle special requirements - for each endpoint. A default credit distribution routine can be used by setting - CreditInitFunc to NULL. The default credit distribution is only provided for simple - "fair" credit distribution without regard to any prioritization. - - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -void HTCSetCreditDistribution(HTC_HANDLE HTCHandle, - void *pCreditDistContext, - HTC_CREDIT_DIST_CALLBACK CreditDistFunc, - HTC_CREDIT_INIT_CALLBACK CreditInitFunc, - HTC_SERVICE_ID ServicePriorityOrder[], - int ListLength); -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Wait for the target to indicate the HTC layer is ready - @function name: HTCWaitTarget - @input: HTCHandle - HTC handle - @output: - @return: - @notes: This API blocks until the target responds with an HTC ready message. - The caller should not connect services until the target has indicated it is - ready. - @example: - @see also: HTCConnectService -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_STATUS HTCWaitTarget(HTC_HANDLE HTCHandle); -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Start target service communications - @function name: HTCStart - @input: HTCHandle - HTC handle - @output: - @return: - @notes: This API indicates to the target that the service connection phase is complete - and the target can freely start all connected services. This API should only be - called AFTER all service connections have been made. TCStart will issue a - SETUP_COMPLETE message to the target to indicate that all service connections - have been made and the target can start communicating over the endpoints. - @example: - @see also: HTCConnectService -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_STATUS HTCStart(HTC_HANDLE HTCHandle); -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Add receive packet to HTC - @function name: HTCAddReceivePkt - @input: HTCHandle - HTC handle - pPacket - HTC receive packet to add - @output: - @return: A_OK on success - @notes: user must supply HTC packets for capturing incomming HTC frames. The caller - must initialize each HTC packet using the SET_HTC_PACKET_INFO_RX_REFILL() - macro. - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_STATUS HTCAddReceivePkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket); -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Connect to an HTC service - @function name: HTCConnectService - @input: HTCHandle - HTC handle - pReq - connection details - @output: pResp - connection response - @return: - @notes: Service connections must be performed before HTCStart. User provides callback handlers - for various endpoint events. - @example: - @see also: HTCStart -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_STATUS HTCConnectService(HTC_HANDLE HTCHandle, - HTC_SERVICE_CONNECT_REQ *pReq, - HTC_SERVICE_CONNECT_RESP *pResp); -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Send an HTC packet - @function name: HTCSendPkt - @input: HTCHandle - HTC handle - pPacket - packet to send - @output: - @return: A_OK - @notes: Caller must initialize packet using SET_HTC_PACKET_INFO_TX() macro. - This interface is fully asynchronous. On error, HTC SendPkt will - call the registered Endpoint callback to cleanup the packet. - @example: - @see also: HTCFlushEndpoint -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_STATUS HTCSendPkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket); -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Stop HTC service communications - @function name: HTCStop - @input: HTCHandle - HTC handle - @output: - @return: - @notes: HTC communications is halted. All receive and pending TX packets will - be flushed. - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -void HTCStop(HTC_HANDLE HTCHandle); -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Destory HTC service - @function name: HTCDestroy - @input: HTCHandle - @output: - @return: - @notes: This cleans up all resources allocated by HTCCreate(). - @example: - @see also: HTCCreate -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -void HTCDestroy(HTC_HANDLE HTCHandle); -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Flush pending TX packets - @function name: HTCFlushEndpoint - @input: HTCHandle - HTC handle - Endpoint - Endpoint to flush - Tag - flush tag - @output: - @return: - @notes: The Tag parameter is used to selectively flush packets with matching tags. - The value of 0 forces all packets to be flush regardless of tag. - @example: - @see also: HTCSendPkt -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -void HTCFlushEndpoint(HTC_HANDLE HTCHandle, HTC_ENDPOINT_ID Endpoint, HTC_TX_TAG Tag); -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Dump credit distribution state - @function name: HTCDumpCreditStates - @input: HTCHandle - HTC handle - @output: - @return: - @notes: This dumps all credit distribution information to the debugger - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -void HTCDumpCreditStates(HTC_HANDLE HTCHandle); -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Indicate a traffic activity change on an endpoint - @function name: HTCIndicateActivityChange - @input: HTCHandle - HTC handle - Endpoint - endpoint in which activity has changed - Active - TRUE if active, FALSE if it has become inactive - @output: - @return: - @notes: This triggers the registered credit distribution function to - re-adjust credits for active/inactive endpoints. - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -void HTCIndicateActivityChange(HTC_HANDLE HTCHandle, - HTC_ENDPOINT_ID Endpoint, - A_BOOL Active); - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Get endpoint statistics - @function name: HTCGetEndpointStatistics - @input: HTCHandle - HTC handle - Endpoint - Endpoint identifier - Action - action to take with statistics - @output: - pStats - statistics that were sampled (can be NULL if Action is HTC_EP_STAT_CLEAR) - - @return: TRUE if statistics profiling is enabled, otherwise FALSE. - - @notes: Statistics is a compile-time option and this function may return FALSE - if HTC is not compiled with profiling. - - The caller can specify the statistic "action" to take when sampling - the statistics. This includes: - - HTC_EP_STAT_SAMPLE: The pStats structure is filled with the current values. - HTC_EP_STAT_SAMPLE_AND_CLEAR: The structure is filled and the current statistics - are cleared. - HTC_EP_STAT_CLEA : the statistics are cleared, the called can pass a NULL value for - pStats - - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_BOOL HTCGetEndpointStatistics(HTC_HANDLE HTCHandle, - HTC_ENDPOINT_ID Endpoint, - HTC_ENDPOINT_STAT_ACTION Action, - HTC_ENDPOINT_STATS *pStats); - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Unblock HTC message reception - @function name: HTCUnblockRecv - @input: HTCHandle - HTC handle - @output: - @return: - @notes: - HTC will block the receiver if the EpRecvAlloc callback fails to provide a packet. - The caller can use this API to indicate to HTC when resources (buffers) are available - such that the receiver can be unblocked and HTC may re-attempt fetching the pending message. - - This API is not required if the user uses the EpRecvRefill callback or uses the HTCAddReceivePacket() - API to recycle or provide receive packets to HTC. - - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -void HTCUnblockRecv(HTC_HANDLE HTCHandle); - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: send a series of HTC packets - @function name: HTCSendPktsMultiple - @input: HTCHandle - HTC handle - pPktQueue - local queue holding packets to send - @output: - @return: A_OK - @notes: Caller must initialize each packet using SET_HTC_PACKET_INFO_TX() macro. - The queue must only contain packets directed at the same endpoint. - Caller supplies a pointer to an HTC_PACKET_QUEUE structure holding the TX packets in FIFO order. - This API will remove the packets from the pkt queue and place them into the HTC Tx Queue - and bundle messages where possible. - The caller may allocate the pkt queue on the stack to hold the packets. - This interface is fully asynchronous. On error, HTCSendPkts will - call the registered Endpoint callback to cleanup the packet. - @example: - @see also: HTCFlushEndpoint -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_STATUS HTCSendPktsMultiple(HTC_HANDLE HTCHandle, HTC_PACKET_QUEUE *pPktQueue); - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Add multiple receive packets to HTC - @function name: HTCAddReceivePktMultiple - @input: HTCHandle - HTC handle - pPktQueue - HTC receive packet queue holding packets to add - @output: - @return: A_OK on success - @notes: user must supply HTC packets for capturing incomming HTC frames. The caller - must initialize each HTC packet using the SET_HTC_PACKET_INFO_RX_REFILL() - macro. The queue must only contain recv packets for the same endpoint. - Caller supplies a pointer to an HTC_PACKET_QUEUE structure holding the recv packet. - This API will remove the packets from the pkt queue and place them into internal - recv packet list. - The caller may allocate the pkt queue on the stack to hold the packets. - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_STATUS HTCAddReceivePktMultiple(HTC_HANDLE HTCHandle, HTC_PACKET_QUEUE *pPktQueue); - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Check if an endpoint is marked active - @function name: HTCIsEndpointActive - @input: HTCHandle - HTC handle - Endpoint - endpoint to check for active state - @output: - @return: returns TRUE if Endpoint is Active - @notes: - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -A_BOOL HTCIsEndpointActive(HTC_HANDLE HTCHandle, - HTC_ENDPOINT_ID Endpoint); - - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - @desc: Get the number of recv buffers currently queued into an HTC endpoint - @function name: HTCGetNumRecvBuffers - @input: HTCHandle - HTC handle - Endpoint - endpoint to check - @output: - @return: returns number of buffers in queue - @notes: - @example: - @see also: -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -int HTCGetNumRecvBuffers(HTC_HANDLE HTCHandle, - HTC_ENDPOINT_ID Endpoint); - -/* internally used functions for testing... */ -void HTCEnableRecv(HTC_HANDLE HTCHandle); -void HTCDisableRecv(HTC_HANDLE HTCHandle); -A_STATUS HTCWaitForPendingRecv(HTC_HANDLE HTCHandle, - A_UINT32 TimeoutInMs, - A_BOOL *pbIsRecvPending); - -#ifdef __cplusplus -} -#endif - -#endif /* _HTC_API_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/htc_packet.h b/drivers/net/wireless/ar6003/host/include/htc_packet.h deleted file mode 100644 index 15175cff2f28..000000000000 --- a/drivers/net/wireless/ar6003/host/include/htc_packet.h +++ /dev/null @@ -1,227 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== -#ifndef HTC_PACKET_H_ -#define HTC_PACKET_H_ - - -#include "dl_list.h" - -/* ------ Endpoint IDS ------ */ -typedef enum -{ - ENDPOINT_UNUSED = -1, - ENDPOINT_0 = 0, - ENDPOINT_1 = 1, - ENDPOINT_2 = 2, - ENDPOINT_3, - ENDPOINT_4, - ENDPOINT_5, - ENDPOINT_6, - ENDPOINT_7, - ENDPOINT_8, - ENDPOINT_MAX, -} HTC_ENDPOINT_ID; - -struct _HTC_PACKET; - -typedef void (* HTC_PACKET_COMPLETION)(void *,struct _HTC_PACKET *); - -typedef A_UINT16 HTC_TX_TAG; - -typedef struct _HTC_TX_PACKET_INFO { - HTC_TX_TAG Tag; /* tag used to selective flush packets */ - int CreditsUsed; /* number of credits used for this TX packet (HTC internal) */ - A_UINT8 SendFlags; /* send flags (HTC internal) */ - int SeqNo; /* internal seq no for debugging (HTC internal) */ -} HTC_TX_PACKET_INFO; - -#define HTC_TX_PACKET_TAG_ALL 0 /* a tag of zero is reserved and used to flush ALL packets */ -#define HTC_TX_PACKET_TAG_INTERNAL 1 /* internal tags start here */ -#define HTC_TX_PACKET_TAG_USER_DEFINED (HTC_TX_PACKET_TAG_INTERNAL + 9) /* user-defined tags start here */ - -typedef struct _HTC_RX_PACKET_INFO { - A_UINT32 ExpectedHdr; /* HTC internal use */ - A_UINT32 HTCRxFlags; /* HTC internal use */ - A_UINT32 IndicationFlags; /* indication flags set on each RX packet indication */ -} HTC_RX_PACKET_INFO; - -#define HTC_RX_FLAGS_INDICATE_MORE_PKTS (1 << 0) /* more packets on this endpoint are being fetched */ - -/* wrapper around endpoint-specific packets */ -typedef struct _HTC_PACKET { - DL_LIST ListLink; /* double link */ - void *pPktContext; /* caller's per packet specific context */ - - A_UINT8 *pBufferStart; /* the true buffer start , the caller can - store the real buffer start here. In - receive callbacks, the HTC layer sets pBuffer - to the start of the payload past the header. This - field allows the caller to reset pBuffer when it - recycles receive packets back to HTC */ - /* - * Pointer to the start of the buffer. In the transmit - * direction this points to the start of the payload. In the - * receive direction, however, the buffer when queued up - * points to the start of the HTC header but when returned - * to the caller points to the start of the payload - */ - A_UINT8 *pBuffer; /* payload start (RX/TX) */ - A_UINT32 BufferLength; /* length of buffer */ - A_UINT32 ActualLength; /* actual length of payload */ - HTC_ENDPOINT_ID Endpoint; /* endpoint that this packet was sent/recv'd from */ - A_STATUS Status; /* completion status */ - union { - HTC_TX_PACKET_INFO AsTx; /* Tx Packet specific info */ - HTC_RX_PACKET_INFO AsRx; /* Rx Packet specific info */ - } PktInfo; - - /* the following fields are for internal HTC use */ - HTC_PACKET_COMPLETION Completion; /* completion */ - void *pContext; /* HTC private completion context */ -} HTC_PACKET; - - - -#define COMPLETE_HTC_PACKET(p,status) \ -{ \ - (p)->Status = (status); \ - (p)->Completion((p)->pContext,(p)); \ -} - -#define INIT_HTC_PACKET_INFO(p,b,len) \ -{ \ - (p)->pBufferStart = (b); \ - (p)->BufferLength = (len); \ -} - -/* macro to set an initial RX packet for refilling HTC */ -#define SET_HTC_PACKET_INFO_RX_REFILL(p,c,b,len,ep) \ -{ \ - (p)->pPktContext = (c); \ - (p)->pBuffer = (b); \ - (p)->pBufferStart = (b); \ - (p)->BufferLength = (len); \ - (p)->Endpoint = (ep); \ -} - -/* fast macro to recycle an RX packet that will be re-queued to HTC */ -#define HTC_PACKET_RESET_RX(p) \ - { (p)->pBuffer = (p)->pBufferStart; (p)->ActualLength = 0; } - -/* macro to set packet parameters for TX */ -#define SET_HTC_PACKET_INFO_TX(p,c,b,len,ep,tag) \ -{ \ - (p)->pPktContext = (c); \ - (p)->pBuffer = (b); \ - (p)->ActualLength = (len); \ - (p)->Endpoint = (ep); \ - (p)->PktInfo.AsTx.Tag = (tag); \ -} - -/* HTC Packet Queueing Macros */ -typedef struct _HTC_PACKET_QUEUE { - DL_LIST QueueHead; - int Depth; -} HTC_PACKET_QUEUE; - -/* initialize queue */ -#define INIT_HTC_PACKET_QUEUE(pQ) \ -{ \ - DL_LIST_INIT(&(pQ)->QueueHead); \ - (pQ)->Depth = 0; \ -} - -/* enqueue HTC packet to the tail of the queue */ -#define HTC_PACKET_ENQUEUE(pQ,p) \ -{ DL_ListInsertTail(&(pQ)->QueueHead,&(p)->ListLink); \ - (pQ)->Depth++; \ -} - -/* enqueue HTC packet to the tail of the queue */ -#define HTC_PACKET_ENQUEUE_TO_HEAD(pQ,p) \ -{ DL_ListInsertHead(&(pQ)->QueueHead,&(p)->ListLink); \ - (pQ)->Depth++; \ -} -/* test if a queue is empty */ -#define HTC_QUEUE_EMPTY(pQ) ((pQ)->Depth == 0) -/* get packet at head without removing it */ -static INLINE HTC_PACKET *HTC_GET_PKT_AT_HEAD(HTC_PACKET_QUEUE *queue) { - if (queue->Depth == 0) { - return NULL; - } - return A_CONTAINING_STRUCT((DL_LIST_GET_ITEM_AT_HEAD(&queue->QueueHead)),HTC_PACKET,ListLink); -} -/* remove a packet from a queue, where-ever it is in the queue */ -#define HTC_PACKET_REMOVE(pQ,p) \ -{ \ - DL_ListRemove(&(p)->ListLink); \ - (pQ)->Depth--; \ -} - -/* dequeue an HTC packet from the head of the queue */ -static INLINE HTC_PACKET *HTC_PACKET_DEQUEUE(HTC_PACKET_QUEUE *queue) { - DL_LIST *pItem = DL_ListRemoveItemFromHead(&queue->QueueHead); - if (pItem != NULL) { - queue->Depth--; - return A_CONTAINING_STRUCT(pItem, HTC_PACKET, ListLink); - } - return NULL; -} - -/* dequeue an HTC packet from the tail of the queue */ -static INLINE HTC_PACKET *HTC_PACKET_DEQUEUE_TAIL(HTC_PACKET_QUEUE *queue) { - DL_LIST *pItem = DL_ListRemoveItemFromTail(&queue->QueueHead); - if (pItem != NULL) { - queue->Depth--; - return A_CONTAINING_STRUCT(pItem, HTC_PACKET, ListLink); - } - return NULL; -} - -#define HTC_PACKET_QUEUE_DEPTH(pQ) (pQ)->Depth - - -#define HTC_GET_ENDPOINT_FROM_PKT(p) (p)->Endpoint -#define HTC_GET_TAG_FROM_PKT(p) (p)->PktInfo.AsTx.Tag - - /* transfer the packets from one queue to the tail of another queue */ -#define HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(pQDest,pQSrc) \ -{ \ - DL_ListTransferItemsToTail(&(pQDest)->QueueHead,&(pQSrc)->QueueHead); \ - (pQDest)->Depth += (pQSrc)->Depth; \ - (pQSrc)->Depth = 0; \ -} - - /* fast version to init and add a single packet to a queue */ -#define INIT_HTC_PACKET_QUEUE_AND_ADD(pQ,pP) \ -{ \ - DL_LIST_INIT_AND_ADD(&(pQ)->QueueHead,&(pP)->ListLink) \ - (pQ)->Depth = 1; \ -} - -#define HTC_PACKET_QUEUE_ITERATE_ALLOW_REMOVE(pQ, pPTemp) \ - ITERATE_OVER_LIST_ALLOW_REMOVE(&(pQ)->QueueHead,(pPTemp), HTC_PACKET, ListLink) - -#define HTC_PACKET_QUEUE_ITERATE_END ITERATE_END - -#endif /*HTC_PACKET_H_*/ diff --git a/drivers/net/wireless/ar6003/host/include/p2p_api.h b/drivers/net/wireless/ar6003/host/include/p2p_api.h deleted file mode 100644 index 5b8837023d71..000000000000 --- a/drivers/net/wireless/ar6003/host/include/p2p_api.h +++ /dev/null @@ -1,116 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This file contains definitions exported by the P2P host module. -// -// Author(s): ="Atheros" -//============================================================================== - -#ifndef _HOST_P2P_API_H_ -#define _HOST_P2P_API_H_ - -#include "utils_api.h" -#include "wmi.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define P2P_OUI 0x99a6f50 - -static int __inline -isp2poui(const A_UINT8 *frm) -{ - return frm[1] > 3 && LE_READ_4(frm+2) == (P2P_OUI); -} - -/* API function declarations */ - -void *p2p_init(void *dev); - -struct host_p2p_dev *p2p_get_device(void *p2p_dev_ctx, const A_UINT8 *addr); - -void *p2p_bssinfo_rx(void *p2p_dev_ctx, WMI_BI_FTYPE fType, A_UINT8 *addr, A_UINT16 channel, const A_UINT8 *data, A_UINT32 len); - -void p2p_go_neg_req_rx(void *p2p_dev_ctx, const A_UINT8 *datap, A_UINT8 len); - -void p2p_invite_req_rx(void *p2p_dev_ctx, const A_UINT8 *datap, A_UINT8 len); - -void p2p_prov_disc_req_rx(void *p2p_dev_ctx, const A_UINT8 *datap, A_UINT8 len); -void p2p_prov_disc_resp_rx(void *p2p_dev_ctx, - const A_UINT8 *datap, A_UINT8 len); -void p2p_start_sdpd_event_rx(void *p2p_dev_ctx); -void p2p_sdpd_rx_event_rx(void *p2p_dev_ctx, - const A_UINT8 *datap, A_UINT8 len); -void p2p_free_all_devices(void *ctx); -void p2p_device_free(void *peer_dev); - -A_STATUS p2p_auth_go_neg(void *ctx, - WMI_P2P_GO_NEG_START_CMD *auth_go_neg_param); - -A_STATUS p2p_auth_invite(void *ctx, A_UINT8 *auth_peer); - -A_STATUS p2p_peer_reject(void *ctx, A_UINT8 *peer_addr); - -A_STATUS p2p_go_neg_start(void *ctx, WMI_P2P_GO_NEG_START_CMD *go_neg_param); - -A_STATUS p2p_invite_cmd(void *ctx, WMI_P2P_INVITE_CMD *invite_param); - -A_STATUS p2p_prov_disc_req(void *ctx, A_UINT8 *peer, A_UINT16 wps_method); - -A_STATUS p2p_peer(void *ctx, A_UINT8 *peer, A_UINT8 next); - -A_STATUS p2p_get_device_p2p_buf(void *ctx, A_UINT8 *peer, A_UINT8 **p2p_buf, A_UINT8 *p2p_buf_len); - -A_STATUS wmi_p2p_get_go_params(void *ctx, A_UINT8 *go_dev_addr, - A_UINT16 *oper_freq, A_UINT8 *ssid, A_UINT8 *ssid_len); - -A_STATUS p2p_get_devaddr (void *ctx, A_UINT8 *intf_addr); - -A_STATUS p2p_get_ifaddr (void *ctx, A_UINT8 *dev_addr); - -struct host_p2p_dev *p2p_get_device_intf_addrs(void *ctx, const A_UINT8 *intfaddr); - -void p2p_increment_dev_ref_count(struct host_p2p_dev *dev); - -void p2p_free_all_sd_queries(void *ctx); - -A_STATUS p2p_sd_request(void *ctx, A_UINT8 *peer_addr, A_UINT8 *tlvbuf, - A_UINT8 tlv_buflen, A_UINT32 *qid); - -A_STATUS p2p_sdpd_tx_cmd(void *ctx, WMI_P2P_SDPD_TX_CMD *sdpd_tx_cmd, A_UINT32 *qid); - -A_STATUS p2p_sd_cancel_request(void *ctx, A_UINT32 qid); - -void p2p_go_neg_complete_rx(void *ctx, const A_UINT8 *datap, A_UINT8 len); - -int p2p_get_peer_info(void *ctx, A_UINT8 *peer_addr, A_UINT8 *buf, A_UINT32 buflen); - -int p2p_get_next_addr(void *ctx, A_UINT8 *addr, A_UINT8 *buf, A_UINT32 buflen, int first_element); - -void p2p_clear_peers_reported_flag(void *ctx); - -void p2p_clear_peers_authorized_flag(void *ctx, const A_UINT8 *addr); - -#ifdef __cplusplus -} -#endif - -#endif /* _HOST_P2P_API_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/project.h b/drivers/net/wireless/ar6003/host/include/project.h deleted file mode 100644 index 43378ded9e53..000000000000 --- a/drivers/net/wireless/ar6003/host/include/project.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2008 Atheros Communications Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#ifndef _PROJECT_H_ -#define _PROJECT_H_ -#include "queue.h" - -#define OS_TIMER_FUNC(fn) void fn(A_HANDLE hdl, void *context) -#define OS_TIMER_FUNC_PTR(fn) void (* fn)(A_HANDLE hdl, void *context) -#define OS_CANCEL_TIMER(timer_hdl) A_UNTIMEOUT(timer_hdl) -#define OS_SET_TIMER(timer_hdl, period, repeat) A_TIMEOUT_MS(timer_hdl, period, repeat) -#define OS_INIT_TIMER(timer_hdl, fn, arg) A_INIT_TIMER(timer_hdl, fn, arg) - -typedef A_TIMER os_timer_t; - -/* Memory related */ -#define OS_MEMZERO(ptr, size) A_MEMZERO(ptr, size) -#define OS_MEMCPY(dst, src, len) A_MEMCPY(dst, src, len) -#define OS_MALLOC(nbytes) A_MALLOC(nbytes) -#define OS_FREE(ptr) A_FREE(ptr) - -#endif - - diff --git a/drivers/net/wireless/ar6003/host/include/target_reg_table.h b/drivers/net/wireless/ar6003/host/include/target_reg_table.h deleted file mode 100644 index 55caa43b84f4..000000000000 --- a/drivers/net/wireless/ar6003/host/include/target_reg_table.h +++ /dev/null @@ -1,349 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Target register table macros and structure definitions -// -// Author(s): ="Atheros" -//============================================================================== - -#ifndef TARGET_REG_TABLE_H_ -#define TARGET_REG_TABLE_H_ - -#include "targaddrs.h" -/*** WARNING : Add to the end of the TABLE! do not change the order ****/ -typedef struct targetdef_s { - A_UINT32 d_RTC_SOC_BASE_ADDRESS; - A_UINT32 d_RTC_WMAC_BASE_ADDRESS; - A_UINT32 d_SYSTEM_SLEEP_OFFSET; - A_UINT32 d_WLAN_SYSTEM_SLEEP_OFFSET; - A_UINT32 d_WLAN_SYSTEM_SLEEP_DISABLE_LSB; - A_UINT32 d_WLAN_SYSTEM_SLEEP_DISABLE_MASK; - A_UINT32 d_CLOCK_CONTROL_OFFSET; - A_UINT32 d_CLOCK_CONTROL_SI0_CLK_MASK; - A_UINT32 d_RESET_CONTROL_OFFSET; - A_UINT32 d_RESET_CONTROL_MBOX_RST_MASK; - A_UINT32 d_RESET_CONTROL_SI0_RST_MASK; - A_UINT32 d_WLAN_RESET_CONTROL_OFFSET; - A_UINT32 d_WLAN_RESET_CONTROL_COLD_RST_MASK; - A_UINT32 d_WLAN_RESET_CONTROL_WARM_RST_MASK; - A_UINT32 d_GPIO_BASE_ADDRESS; - A_UINT32 d_GPIO_PIN0_OFFSET; - A_UINT32 d_GPIO_PIN1_OFFSET; - A_UINT32 d_GPIO_PIN0_CONFIG_MASK; - A_UINT32 d_GPIO_PIN1_CONFIG_MASK; - A_UINT32 d_SI_CONFIG_BIDIR_OD_DATA_LSB; - A_UINT32 d_SI_CONFIG_BIDIR_OD_DATA_MASK; - A_UINT32 d_SI_CONFIG_I2C_LSB; - A_UINT32 d_SI_CONFIG_I2C_MASK; - A_UINT32 d_SI_CONFIG_POS_SAMPLE_LSB; - A_UINT32 d_SI_CONFIG_POS_SAMPLE_MASK; - A_UINT32 d_SI_CONFIG_INACTIVE_CLK_LSB; - A_UINT32 d_SI_CONFIG_INACTIVE_CLK_MASK; - A_UINT32 d_SI_CONFIG_INACTIVE_DATA_LSB; - A_UINT32 d_SI_CONFIG_INACTIVE_DATA_MASK; - A_UINT32 d_SI_CONFIG_DIVIDER_LSB; - A_UINT32 d_SI_CONFIG_DIVIDER_MASK; - A_UINT32 d_SI_BASE_ADDRESS; - A_UINT32 d_SI_CONFIG_OFFSET; - A_UINT32 d_SI_TX_DATA0_OFFSET; - A_UINT32 d_SI_TX_DATA1_OFFSET; - A_UINT32 d_SI_RX_DATA0_OFFSET; - A_UINT32 d_SI_RX_DATA1_OFFSET; - A_UINT32 d_SI_CS_OFFSET; - A_UINT32 d_SI_CS_DONE_ERR_MASK; - A_UINT32 d_SI_CS_DONE_INT_MASK; - A_UINT32 d_SI_CS_START_LSB; - A_UINT32 d_SI_CS_START_MASK; - A_UINT32 d_SI_CS_RX_CNT_LSB; - A_UINT32 d_SI_CS_RX_CNT_MASK; - A_UINT32 d_SI_CS_TX_CNT_LSB; - A_UINT32 d_SI_CS_TX_CNT_MASK; - A_UINT32 d_BOARD_DATA_SZ; - A_UINT32 d_BOARD_EXT_DATA_SZ; - A_UINT32 d_MBOX_BASE_ADDRESS; - A_UINT32 d_LOCAL_SCRATCH_OFFSET; - A_UINT32 d_CPU_CLOCK_OFFSET; - A_UINT32 d_LPO_CAL_OFFSET; - A_UINT32 d_GPIO_PIN10_OFFSET; - A_UINT32 d_GPIO_PIN11_OFFSET; - A_UINT32 d_GPIO_PIN12_OFFSET; - A_UINT32 d_GPIO_PIN13_OFFSET; - A_UINT32 d_CLOCK_GPIO_OFFSET; - A_UINT32 d_CPU_CLOCK_STANDARD_LSB; - A_UINT32 d_CPU_CLOCK_STANDARD_MASK; - A_UINT32 d_LPO_CAL_ENABLE_LSB; - A_UINT32 d_LPO_CAL_ENABLE_MASK; - A_UINT32 d_CLOCK_GPIO_BT_CLK_OUT_EN_LSB; - A_UINT32 d_CLOCK_GPIO_BT_CLK_OUT_EN_MASK; - A_UINT32 d_ANALOG_INTF_BASE_ADDRESS; -} TARGET_REGISTER_TABLE; - -#define ATH_UNSUPPORTED_REG_OFFSET 0xffffffff -#define ATH_SUPPORTED_BY_TARGET(reg_offset) ((reg_offset) != ATH_UNSUPPORTED_REG_OFFSET) - -#define BOARD_DATA_SZ_MAX 2048 - -#if defined(MY_TARGET_DEF) /* { */ -#if defined(ATHR_WIN_DEF) -#define ATH_REG_TABLE_DIRECT_ASSIGN -#endif - -/* Cross-platform compatibility */ -#if !defined(SOC_RESET_CONTROL_OFFSET) && defined(RESET_CONTROL_OFFSET) -#define SOC_RESET_CONTROL_OFFSET RESET_CONTROL_OFFSET -#endif -#if !defined(CLOCK_GPIO_OFFSET) -#define CLOCK_GPIO_OFFSET ATH_UNSUPPORTED_REG_OFFSET -#define CLOCK_GPIO_BT_CLK_OUT_EN_LSB 0 -#define CLOCK_GPIO_BT_CLK_OUT_EN_MASK 0 -#endif - -#ifdef ATH_REG_TABLE_DIRECT_ASSIGN - -static struct targetdef_s my_target_def = { - RTC_SOC_BASE_ADDRESS, - RTC_WMAC_BASE_ADDRESS, - SYSTEM_SLEEP_OFFSET, - WLAN_SYSTEM_SLEEP_OFFSET, - WLAN_SYSTEM_SLEEP_DISABLE_LSB, - WLAN_SYSTEM_SLEEP_DISABLE_MASK, - CLOCK_CONTROL_OFFSET, - CLOCK_CONTROL_SI0_CLK_MASK, - SOC_RESET_CONTROL_OFFSET, - RESET_CONTROL_MBOX_RST_MASK, - RESET_CONTROL_SI0_RST_MASK, - WLAN_RESET_CONTROL_OFFSET, - WLAN_RESET_CONTROL_COLD_RST_MASK, - WLAN_RESET_CONTROL_WARM_RST_MASK, - GPIO_BASE_ADDRESS, - GPIO_PIN0_OFFSET, - GPIO_PIN1_OFFSET, - GPIO_PIN0_CONFIG_MASK, - GPIO_PIN1_CONFIG_MASK, - SI_CONFIG_BIDIR_OD_DATA_LSB, - SI_CONFIG_BIDIR_OD_DATA_MASK, - SI_CONFIG_I2C_LSB, - SI_CONFIG_I2C_MASK, - SI_CONFIG_POS_SAMPLE_LSB, - SI_CONFIG_POS_SAMPLE_MASK, - SI_CONFIG_INACTIVE_CLK_LSB, - SI_CONFIG_INACTIVE_CLK_MASK, - SI_CONFIG_INACTIVE_DATA_LSB, - SI_CONFIG_INACTIVE_DATA_MASK, - SI_CONFIG_DIVIDER_LSB, - SI_CONFIG_DIVIDER_MASK, - SI_BASE_ADDRESS, - SI_CONFIG_OFFSET, - SI_TX_DATA0_OFFSET, - SI_TX_DATA1_OFFSET, - SI_RX_DATA0_OFFSET, - SI_RX_DATA1_OFFSET, - SI_CS_OFFSET, - SI_CS_DONE_ERR_MASK, - SI_CS_DONE_INT_MASK, - SI_CS_START_LSB, - SI_CS_START_MASK, - SI_CS_RX_CNT_LSB, - SI_CS_RX_CNT_MASK, - SI_CS_TX_CNT_LSB, - SI_CS_TX_CNT_MASK, - MY_TARGET_BOARD_DATA_SZ, - MY_TARGET_BOARD_EXT_DATA_SZ, - MBOX_BASE_ADDRESS, - LOCAL_SCRATCH_OFFSET, - CPU_CLOCK_OFFSET, - LPO_CAL_OFFSET, - GPIO_PIN10_OFFSET, - GPIO_PIN11_OFFSET, - GPIO_PIN12_OFFSET, - GPIO_PIN13_OFFSET, - CLOCK_GPIO_OFFSET, - CPU_CLOCK_STANDARD_LSB, - CPU_CLOCK_STANDARD_MASK, - LPO_CAL_ENABLE_LSB, - LPO_CAL_ENABLE_MASK, - CLOCK_GPIO_BT_CLK_OUT_EN_LSB, - CLOCK_GPIO_BT_CLK_OUT_EN_MASK, - ANALOG_INTF_BASE_ADDRESS, -}; - -#else - -static struct targetdef_s my_target_def = { - .d_RTC_SOC_BASE_ADDRESS = RTC_SOC_BASE_ADDRESS, - .d_RTC_WMAC_BASE_ADDRESS = RTC_WMAC_BASE_ADDRESS, - .d_SYSTEM_SLEEP_OFFSET = WLAN_SYSTEM_SLEEP_OFFSET, - .d_WLAN_SYSTEM_SLEEP_OFFSET = WLAN_SYSTEM_SLEEP_OFFSET, - .d_WLAN_SYSTEM_SLEEP_DISABLE_LSB = WLAN_SYSTEM_SLEEP_DISABLE_LSB, - .d_WLAN_SYSTEM_SLEEP_DISABLE_MASK = WLAN_SYSTEM_SLEEP_DISABLE_MASK, - .d_CLOCK_CONTROL_OFFSET = CLOCK_CONTROL_OFFSET, - .d_CLOCK_CONTROL_SI0_CLK_MASK = CLOCK_CONTROL_SI0_CLK_MASK, - .d_RESET_CONTROL_OFFSET = SOC_RESET_CONTROL_OFFSET, - .d_RESET_CONTROL_MBOX_RST_MASK = RESET_CONTROL_MBOX_RST_MASK, - .d_RESET_CONTROL_SI0_RST_MASK = RESET_CONTROL_SI0_RST_MASK, - .d_WLAN_RESET_CONTROL_OFFSET = WLAN_RESET_CONTROL_OFFSET, - .d_WLAN_RESET_CONTROL_COLD_RST_MASK = WLAN_RESET_CONTROL_COLD_RST_MASK, - .d_WLAN_RESET_CONTROL_WARM_RST_MASK = WLAN_RESET_CONTROL_WARM_RST_MASK, - .d_GPIO_BASE_ADDRESS = GPIO_BASE_ADDRESS, - .d_GPIO_PIN0_OFFSET = GPIO_PIN0_OFFSET, - .d_GPIO_PIN1_OFFSET = GPIO_PIN1_OFFSET, - .d_GPIO_PIN0_CONFIG_MASK = GPIO_PIN0_CONFIG_MASK, - .d_GPIO_PIN1_CONFIG_MASK = GPIO_PIN1_CONFIG_MASK, - .d_SI_CONFIG_BIDIR_OD_DATA_LSB = SI_CONFIG_BIDIR_OD_DATA_LSB, - .d_SI_CONFIG_BIDIR_OD_DATA_MASK = SI_CONFIG_BIDIR_OD_DATA_MASK, - .d_SI_CONFIG_I2C_LSB = SI_CONFIG_I2C_LSB, - .d_SI_CONFIG_I2C_MASK = SI_CONFIG_I2C_MASK, - .d_SI_CONFIG_POS_SAMPLE_LSB = SI_CONFIG_POS_SAMPLE_LSB, - .d_SI_CONFIG_POS_SAMPLE_MASK = SI_CONFIG_POS_SAMPLE_MASK, - .d_SI_CONFIG_INACTIVE_CLK_LSB = SI_CONFIG_INACTIVE_CLK_LSB, - .d_SI_CONFIG_INACTIVE_CLK_MASK = SI_CONFIG_INACTIVE_CLK_MASK, - .d_SI_CONFIG_INACTIVE_DATA_LSB = SI_CONFIG_INACTIVE_DATA_LSB, - .d_SI_CONFIG_INACTIVE_DATA_MASK = SI_CONFIG_INACTIVE_DATA_MASK, - .d_SI_CONFIG_DIVIDER_LSB = SI_CONFIG_DIVIDER_LSB, - .d_SI_CONFIG_DIVIDER_MASK = SI_CONFIG_DIVIDER_MASK, - .d_SI_BASE_ADDRESS = SI_BASE_ADDRESS, - .d_SI_CONFIG_OFFSET = SI_CONFIG_OFFSET, - .d_SI_TX_DATA0_OFFSET = SI_TX_DATA0_OFFSET, - .d_SI_TX_DATA1_OFFSET = SI_TX_DATA1_OFFSET, - .d_SI_RX_DATA0_OFFSET = SI_RX_DATA0_OFFSET, - .d_SI_RX_DATA1_OFFSET = SI_RX_DATA1_OFFSET, - .d_SI_CS_OFFSET = SI_CS_OFFSET, - .d_SI_CS_DONE_ERR_MASK = SI_CS_DONE_ERR_MASK, - .d_SI_CS_DONE_INT_MASK = SI_CS_DONE_INT_MASK, - .d_SI_CS_START_LSB = SI_CS_START_LSB, - .d_SI_CS_START_MASK = SI_CS_START_MASK, - .d_SI_CS_RX_CNT_LSB = SI_CS_RX_CNT_LSB, - .d_SI_CS_RX_CNT_MASK = SI_CS_RX_CNT_MASK, - .d_SI_CS_TX_CNT_LSB = SI_CS_TX_CNT_LSB, - .d_SI_CS_TX_CNT_MASK = SI_CS_TX_CNT_MASK, - .d_BOARD_DATA_SZ = MY_TARGET_BOARD_DATA_SZ, - .d_BOARD_EXT_DATA_SZ = MY_TARGET_BOARD_EXT_DATA_SZ, - .d_MBOX_BASE_ADDRESS = MBOX_BASE_ADDRESS, - .d_LOCAL_SCRATCH_OFFSET = LOCAL_SCRATCH_OFFSET, - .d_CPU_CLOCK_OFFSET = CPU_CLOCK_OFFSET, - .d_LPO_CAL_OFFSET = LPO_CAL_OFFSET, - .d_GPIO_PIN10_OFFSET = GPIO_PIN10_OFFSET, - .d_GPIO_PIN11_OFFSET = GPIO_PIN11_OFFSET, - .d_GPIO_PIN12_OFFSET = GPIO_PIN12_OFFSET, - .d_GPIO_PIN13_OFFSET = GPIO_PIN13_OFFSET, - .d_CLOCK_GPIO_OFFSET = CLOCK_GPIO_OFFSET, - .d_CPU_CLOCK_STANDARD_LSB = CPU_CLOCK_STANDARD_LSB, - .d_CPU_CLOCK_STANDARD_MASK = CPU_CLOCK_STANDARD_MASK, - .d_LPO_CAL_ENABLE_LSB = LPO_CAL_ENABLE_LSB, - .d_LPO_CAL_ENABLE_MASK = LPO_CAL_ENABLE_MASK, - .d_CLOCK_GPIO_BT_CLK_OUT_EN_LSB = CLOCK_GPIO_BT_CLK_OUT_EN_LSB, - .d_CLOCK_GPIO_BT_CLK_OUT_EN_MASK = CLOCK_GPIO_BT_CLK_OUT_EN_MASK, - .d_ANALOG_INTF_BASE_ADDRESS = ANALOG_INTF_BASE_ADDRESS, -}; - -#endif - -#if MY_TARGET_BOARD_DATA_SZ > BOARD_DATA_SZ_MAX -#error "BOARD_DATA_SZ_MAX is too small" -#endif - -struct targetdef_s *MY_TARGET_DEF = &my_target_def; - -#else /* } { */ - -#define RTC_SOC_BASE_ADDRESS (targetdef->d_RTC_SOC_BASE_ADDRESS) -#define RTC_WMAC_BASE_ADDRESS (targetdef->d_RTC_WMAC_BASE_ADDRESS) -#define SYSTEM_SLEEP_OFFSET (targetdef->d_SYSTEM_SLEEP_OFFSET) -#define WLAN_SYSTEM_SLEEP_OFFSET (targetdef->d_WLAN_SYSTEM_SLEEP_OFFSET) -#define WLAN_SYSTEM_SLEEP_DISABLE_LSB (targetdef->d_WLAN_SYSTEM_SLEEP_DISABLE_LSB) -#define WLAN_SYSTEM_SLEEP_DISABLE_MASK (targetdef->d_WLAN_SYSTEM_SLEEP_DISABLE_MASK) -#define CLOCK_CONTROL_OFFSET (targetdef->d_CLOCK_CONTROL_OFFSET) -#define CLOCK_CONTROL_SI0_CLK_MASK (targetdef->d_CLOCK_CONTROL_SI0_CLK_MASK) -#define RESET_CONTROL_OFFSET (targetdef->d_RESET_CONTROL_OFFSET) -#define RESET_CONTROL_MBOX_RST_MASK (targetdef->d_RESET_CONTROL_MBOX_RST_MASK) -#define RESET_CONTROL_SI0_RST_MASK (targetdef->d_RESET_CONTROL_SI0_RST_MASK) -#define WLAN_RESET_CONTROL_OFFSET (targetdef->d_WLAN_RESET_CONTROL_OFFSET) -#define WLAN_RESET_CONTROL_COLD_RST_MASK (targetdef->d_WLAN_RESET_CONTROL_COLD_RST_MASK) -#define WLAN_RESET_CONTROL_WARM_RST_MASK (targetdef->d_WLAN_RESET_CONTROL_WARM_RST_MASK) -#define GPIO_BASE_ADDRESS (targetdef->d_GPIO_BASE_ADDRESS) -#define GPIO_PIN0_OFFSET (targetdef->d_GPIO_PIN0_OFFSET) -#define GPIO_PIN1_OFFSET (targetdef->d_GPIO_PIN1_OFFSET) -#define GPIO_PIN0_CONFIG_MASK (targetdef->d_GPIO_PIN0_CONFIG_MASK) -#define GPIO_PIN1_CONFIG_MASK (targetdef->d_GPIO_PIN1_CONFIG_MASK) -#define SI_CONFIG_BIDIR_OD_DATA_LSB (targetdef->d_SI_CONFIG_BIDIR_OD_DATA_LSB) -#define SI_CONFIG_BIDIR_OD_DATA_MASK (targetdef->d_SI_CONFIG_BIDIR_OD_DATA_MASK) -#define SI_CONFIG_I2C_LSB (targetdef->d_SI_CONFIG_I2C_LSB) -#define SI_CONFIG_I2C_MASK (targetdef->d_SI_CONFIG_I2C_MASK) -#define SI_CONFIG_POS_SAMPLE_LSB (targetdef->d_SI_CONFIG_POS_SAMPLE_LSB) -#define SI_CONFIG_POS_SAMPLE_MASK (targetdef->d_SI_CONFIG_POS_SAMPLE_MASK) -#define SI_CONFIG_INACTIVE_CLK_LSB (targetdef->d_SI_CONFIG_INACTIVE_CLK_LSB) -#define SI_CONFIG_INACTIVE_CLK_MASK (targetdef->d_SI_CONFIG_INACTIVE_CLK_MASK) -#define SI_CONFIG_INACTIVE_DATA_LSB (targetdef->d_SI_CONFIG_INACTIVE_DATA_LSB) -#define SI_CONFIG_INACTIVE_DATA_MASK (targetdef->d_SI_CONFIG_INACTIVE_DATA_MASK) -#define SI_CONFIG_DIVIDER_LSB (targetdef->d_SI_CONFIG_DIVIDER_LSB) -#define SI_CONFIG_DIVIDER_MASK (targetdef->d_SI_CONFIG_DIVIDER_MASK) -#define SI_BASE_ADDRESS (targetdef->d_SI_BASE_ADDRESS) -#define SI_CONFIG_OFFSET (targetdef->d_SI_CONFIG_OFFSET) -#define SI_TX_DATA0_OFFSET (targetdef->d_SI_TX_DATA0_OFFSET) -#define SI_TX_DATA1_OFFSET (targetdef->d_SI_TX_DATA1_OFFSET) -#define SI_RX_DATA0_OFFSET (targetdef->d_SI_RX_DATA0_OFFSET) -#define SI_RX_DATA1_OFFSET (targetdef->d_SI_RX_DATA1_OFFSET) -#define SI_CS_OFFSET (targetdef->d_SI_CS_OFFSET) -#define SI_CS_DONE_ERR_MASK (targetdef->d_SI_CS_DONE_ERR_MASK) -#define SI_CS_DONE_INT_MASK (targetdef->d_SI_CS_DONE_INT_MASK) -#define SI_CS_START_LSB (targetdef->d_SI_CS_START_LSB) -#define SI_CS_START_MASK (targetdef->d_SI_CS_START_MASK) -#define SI_CS_RX_CNT_LSB (targetdef->d_SI_CS_RX_CNT_LSB) -#define SI_CS_RX_CNT_MASK (targetdef->d_SI_CS_RX_CNT_MASK) -#define SI_CS_TX_CNT_LSB (targetdef->d_SI_CS_TX_CNT_LSB) -#define SI_CS_TX_CNT_MASK (targetdef->d_SI_CS_TX_CNT_MASK) -#define EEPROM_SZ (targetdef->d_BOARD_DATA_SZ) -#define EEPROM_EXT_SZ (targetdef->d_BOARD_EXT_DATA_SZ) -#define MBOX_BASE_ADDRESS (targetdef->d_MBOX_BASE_ADDRESS) -#define LOCAL_SCRATCH_OFFSET (targetdef->d_LOCAL_SCRATCH_OFFSET) -#define CPU_CLOCK_OFFSET (targetdef->d_CPU_CLOCK_OFFSET) -#define LPO_CAL_OFFSET (targetdef->d_LPO_CAL_OFFSET) -#define GPIO_PIN10_OFFSET (targetdef->d_GPIO_PIN10_OFFSET) -#define GPIO_PIN11_OFFSET (targetdef->d_GPIO_PIN11_OFFSET) -#define GPIO_PIN12_OFFSET (targetdef->d_GPIO_PIN12_OFFSET) -#define GPIO_PIN13_OFFSET (targetdef->d_GPIO_PIN13_OFFSET) -#define CLOCK_GPIO_OFFSET (targetdef->d_CLOCK_GPIO_OFFSET) -#define CPU_CLOCK_STANDARD_LSB (targetdef->d_CPU_CLOCK_STANDARD_LSB) -#define CPU_CLOCK_STANDARD_MASK (targetdef->d_CPU_CLOCK_STANDARD_MASK) -#define LPO_CAL_ENABLE_LSB (targetdef->d_LPO_CAL_ENABLE_LSB) -#define LPO_CAL_ENABLE_MASK (targetdef->d_LPO_CAL_ENABLE_MASK) -#define CLOCK_GPIO_BT_CLK_OUT_EN_LSB (targetdef->d_CLOCK_GPIO_BT_CLK_OUT_EN_LSB) -#define CLOCK_GPIO_BT_CLK_OUT_EN_MASK (targetdef->d_CLOCK_GPIO_BT_CLK_OUT_EN_MASK) -#define ANALOG_INTF_BASE_ADDRESS (targetdef->d_ANALOG_INTF_BASE_ADDRESS) - -/* SET macros */ -#define WLAN_SYSTEM_SLEEP_DISABLE_SET(x) (((x) << WLAN_SYSTEM_SLEEP_DISABLE_LSB) & WLAN_SYSTEM_SLEEP_DISABLE_MASK) -#define SI_CONFIG_BIDIR_OD_DATA_SET(x) (((x) << SI_CONFIG_BIDIR_OD_DATA_LSB) & SI_CONFIG_BIDIR_OD_DATA_MASK) -#define SI_CONFIG_I2C_SET(x) (((x) << SI_CONFIG_I2C_LSB) & SI_CONFIG_I2C_MASK) -#define SI_CONFIG_POS_SAMPLE_SET(x) (((x) << SI_CONFIG_POS_SAMPLE_LSB) & SI_CONFIG_POS_SAMPLE_MASK) -#define SI_CONFIG_INACTIVE_CLK_SET(x) (((x) << SI_CONFIG_INACTIVE_CLK_LSB) & SI_CONFIG_INACTIVE_CLK_MASK) -#define SI_CONFIG_INACTIVE_DATA_SET(x) (((x) << SI_CONFIG_INACTIVE_DATA_LSB) & SI_CONFIG_INACTIVE_DATA_MASK) -#define SI_CONFIG_DIVIDER_SET(x) (((x) << SI_CONFIG_DIVIDER_LSB) & SI_CONFIG_DIVIDER_MASK) -#define SI_CS_START_SET(x) (((x) << SI_CS_START_LSB) & SI_CS_START_MASK) -#define SI_CS_RX_CNT_SET(x) (((x) << SI_CS_RX_CNT_LSB) & SI_CS_RX_CNT_MASK) -#define SI_CS_TX_CNT_SET(x) (((x) << SI_CS_TX_CNT_LSB) & SI_CS_TX_CNT_MASK) -#define LPO_CAL_ENABLE_SET(x) (((x) << LPO_CAL_ENABLE_LSB) & LPO_CAL_ENABLE_MASK) -#define CPU_CLOCK_STANDARD_SET(x) (((x) << CPU_CLOCK_STANDARD_LSB) & CPU_CLOCK_STANDARD_MASK) -#define CLOCK_GPIO_BT_CLK_OUT_EN_SET(x) (((x) << CLOCK_GPIO_BT_CLK_OUT_EN_LSB) & CLOCK_GPIO_BT_CLK_OUT_EN_MASK) -extern struct targetdef_s *targetdef; - -#endif /* } */ - -#endif /*TARGET_REG_TABLE_H_*/ diff --git a/drivers/net/wireless/ar6003/host/include/utils_api.h b/drivers/net/wireless/ar6003/host/include/utils_api.h deleted file mode 100644 index d3aad4ea9e64..000000000000 --- a/drivers/net/wireless/ar6003/host/include/utils_api.h +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Utility Macros & Functions common across OS. -// Author(s): ="Atheros" -//============================================================================== -#ifndef _HOST_UTILS_API_H_ -#define _HOST_UTILS_API_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* unaligned little endian access */ -#define LE_READ_2(p) \ - ((A_UINT16) \ - ((((A_UINT8 *)(p))[0] ) | (((A_UINT8 *)(p))[1] << 8))) - -#define LE_READ_4(p) \ - ((A_UINT32) \ - ((((A_UINT8 *)(p))[0] ) | (((A_UINT8 *)(p))[1] << 8) | \ - (((A_UINT8 *)(p))[2] << 16) | (((A_UINT8 *)(p))[3] << 24))) - -#define WPA_GET_BE16(a) ((A_UINT16) (((a)[0] << 8) | (a)[1])) -#define WPA_PUT_BE16(a, val) \ - do { \ - (a)[0] = ((A_UINT16) (val)) >> 8; \ - (a)[1] = ((A_UINT16) (val)) & 0xff; \ - } while (0) - -#define WPA_GET_LE16(a) ((A_UINT16) (((a)[1] << 8) | (a)[0])) -#define WPA_PUT_LE16(a, val) \ - do { \ - (a)[1] = ((A_UINT16) (val)) >> 8; \ - (a)[0] = ((A_UINT16) (val)) & 0xff; \ - } while (0) - -#define WPA_GET_BE24(a) ((((A_UINT32) (a)[0]) << 16) | (((A_UINT32) (a)[1]) << 8) | \ - ((A_UINT32) (a)[2])) -#define WPA_PUT_BE24(a, val) \ - do { \ - (a)[0] = (A_UINT8) ((((A_UINT32) (val)) >> 16) & 0xff); \ - (a)[1] = (A_UINT8) ((((A_UINT32) (val)) >> 8) & 0xff); \ - (a)[2] = (A_UINT8) (((A_UINT32) (val)) & 0xff); \ - } while (0) - -#define WPA_GET_BE32(a) ((((A_UINT32) (a)[0]) << 24) | (((A_UINT32) (a)[1]) << 16) | \ - (((A_UINT32) (a)[2]) << 8) | ((A_UINT32) (a)[3])) -#define WPA_PUT_BE32(a, val) \ - do { \ - (a)[0] = (A_UINT8) ((((A_UINT32) (val)) >> 24) & 0xff); \ - (a)[1] = (A_UINT8) ((((A_UINT32) (val)) >> 16) & 0xff); \ - (a)[2] = (A_UINT8) ((((A_UINT32) (val)) >> 8) & 0xff); \ - (a)[3] = (A_UINT8) (((A_UINT32) (val)) & 0xff); \ - } while (0) - -#define WPA_GET_LE32(a) ((((A_UINT32) (a)[3]) << 24) | (((A_UINT32) (a)[2]) << 16) | \ - (((A_UINT32) (a)[1]) << 8) | ((A_UINT32) (a)[0])) -#define WPA_PUT_LE32(a, val) \ - do { \ - (a)[3] = (A_UINT8) ((((A_UINT32) (val)) >> 24) & 0xff); \ - (a)[2] = (A_UINT8) ((((A_UINT32) (val)) >> 16) & 0xff); \ - (a)[1] = (A_UINT8) ((((A_UINT32) (val)) >> 8) & 0xff); \ - (a)[0] = (A_UINT8) (((A_UINT32) (val)) & 0xff); \ - } while (0) - - -#define WPA_OUI 0xf25000 - -static int __inline -iswscoui(const A_UINT8 *frm) -{ - return frm[1] > 3 && LE_READ_4(frm+2) == ((0x04<<24)|WPA_OUI); -} - -static inline int is_zero_mac_addr(const A_UINT8 *addr) -{ - return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]); -} - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _HOST_UTILS_API_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/wlan_api.h b/drivers/net/wireless/ar6003/host/include/wlan_api.h deleted file mode 100644 index 5a53d18da5ff..000000000000 --- a/drivers/net/wireless/ar6003/host/include/wlan_api.h +++ /dev/null @@ -1,137 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This file contains the API for the host wlan module -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _HOST_WLAN_API_H_ -#define _HOST_WLAN_API_H_ - - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -struct ieee80211_node_table; -struct ieee80211_frame; - -struct ieee80211_common_ie { - A_UINT16 ie_chan; - A_UINT8 *ie_tstamp; - A_UINT8 *ie_ssid; - A_UINT8 *ie_rates; - A_UINT8 *ie_xrates; - A_UINT8 *ie_country; - A_UINT8 *ie_wpa; - A_UINT8 *ie_rsn; - A_UINT8 *ie_wmm; - A_UINT8 *ie_ath; - A_UINT16 ie_capInfo; - A_UINT16 ie_beaconInt; - A_UINT8 *ie_tim; - A_UINT8 *ie_chswitch; - A_UINT8 ie_erp; - A_UINT8 *ie_wsc; - A_UINT8 *ie_htcap; - A_UINT8 *ie_htop; -#ifdef WAPI_ENABLE - A_UINT8 *ie_wapi; -#endif - - -}; - -typedef struct bss { - A_UINT8 ni_macaddr[6]; - A_UINT8 ni_snr; - A_INT16 ni_rssi; - struct bss *ni_list_next; - struct bss *ni_list_prev; - struct bss *ni_hash_next; - struct bss *ni_hash_prev; - struct ieee80211_common_ie ni_cie; -#ifdef P2P - void *p2p_dev; -#endif /* P2P */ - A_UINT8 *ni_buf; - A_UINT16 ni_framelen; - A_UINT8 ni_frametype; /* frame type in ni_buf */ - struct ieee80211_node_table *ni_table; - A_UINT32 ni_refcnt; - int ni_scangen; - - A_UINT32 ni_tstamp; - A_UINT32 ni_actcnt; -#ifdef OS_ROAM_MANAGEMENT - A_UINT32 ni_si_gen; -#endif -} bss_t; - -typedef void wlan_node_iter_func(void *arg, bss_t *); - -bss_t *wlan_node_alloc(struct ieee80211_node_table *nt, int wh_size); -void wlan_node_free(bss_t *ni); -void wlan_setup_node(struct ieee80211_node_table *nt, bss_t *ni, - const A_UINT8 *macaddr); -bss_t *wlan_find_node(struct ieee80211_node_table *nt, const A_UINT8 *macaddr); -void wlan_node_reclaim(struct ieee80211_node_table *nt, bss_t *ni); -A_STATUS wlan_node_buf_update(struct ieee80211_node_table *nt, bss_t *ni, A_UINT32 len); -void wlan_free_allnodes(struct ieee80211_node_table *nt); -void wlan_iterate_nodes(struct ieee80211_node_table *nt, wlan_node_iter_func *f, - void *arg); - -void wlan_node_table_init(void *wmip, struct ieee80211_node_table *nt); -void wlan_node_table_reset(struct ieee80211_node_table *nt); -void wlan_node_table_cleanup(struct ieee80211_node_table *nt); - -A_STATUS wlan_parse_beacon(A_UINT8 *buf, int framelen, - struct ieee80211_common_ie *cie); - -A_UINT16 wlan_ieee2freq(int chan); -A_UINT32 wlan_freq2ieee(A_UINT16 freq); - -void wlan_set_nodeage(struct ieee80211_node_table *nt, A_UINT32 nodeAge); - -void -wlan_refresh_inactive_nodes (struct ieee80211_node_table *nt); - -bss_t * -wlan_find_Ssidnode (struct ieee80211_node_table *nt, A_UCHAR *pSsid, - A_UINT32 ssidLength, A_BOOL bIsWPA2, A_BOOL bMatchSSID); - -void -wlan_node_return (struct ieee80211_node_table *nt, bss_t *ni); - -bss_t *wlan_node_remove(struct ieee80211_node_table *nt, A_UINT8 *bssid); - -bss_t * -wlan_find_matching_Ssidnode (struct ieee80211_node_table *nt, A_UCHAR *pSsid, - A_UINT32 ssidLength, A_UINT32 dot11AuthMode, A_UINT32 authMode, - A_UINT32 pairwiseCryptoType, A_UINT32 grpwiseCryptoTyp); - -void wlan_node_update_timestamp(struct ieee80211_node_table *nt, bss_t *ni); - -#ifdef __cplusplus -} -#endif - -#endif /* _HOST_WLAN_API_H_ */ diff --git a/drivers/net/wireless/ar6003/host/include/wmi_api.h b/drivers/net/wireless/ar6003/host/include/wmi_api.h deleted file mode 100644 index c992fd4fa1b7..000000000000 --- a/drivers/net/wireless/ar6003/host/include/wmi_api.h +++ /dev/null @@ -1,565 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This file contains the definitions for the Wireless Module Interface (WMI). -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _WMI_API_H_ -#define _WMI_API_H_ - -#ifdef __cplusplus -extern "C" { -#endif - - /* WMI converts a dix frame with an ethernet payload (up to 1500 bytes) - * to an 802.3 frame (adds SNAP header) and adds on a WMI data header */ -#define WMI_MAX_TX_DATA_FRAME_LENGTH (1500 + sizeof(WMI_DATA_HDR) + sizeof(ATH_MAC_HDR) + sizeof(ATH_LLC_SNAP_HDR)) - - /* A normal WMI data frame */ -#define WMI_MAX_NORMAL_RX_DATA_FRAME_LENGTH (1500 + sizeof(WMI_DATA_HDR) + sizeof(ATH_MAC_HDR) + sizeof(ATH_LLC_SNAP_HDR)) - - /* An AMSDU frame */ /* The MAX AMSDU length of AR6003 is 3839 */ -#define WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH (3840 + sizeof(WMI_DATA_HDR) + sizeof(ATH_MAC_HDR) + sizeof(ATH_LLC_SNAP_HDR)) - -/* - * IP QoS Field definitions according to 802.1p - */ -#define BEST_EFFORT_PRI 0 -#define BACKGROUND_PRI 1 -#define EXCELLENT_EFFORT_PRI 3 -#define CONTROLLED_LOAD_PRI 4 -#define VIDEO_PRI 5 -#define VOICE_PRI 6 -#define NETWORK_CONTROL_PRI 7 -#define MAX_NUM_PRI 8 - -#define UNDEFINED_PRI (0xff) - -#define WMI_IMPLICIT_PSTREAM_INACTIVITY_INT 5000 /* 5 seconds */ - -#define A_ROUND_UP(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) - -typedef enum { - ATHEROS_COMPLIANCE = 0x1, -}TSPEC_PARAM_COMPLIANCE; - -struct wmi_t; - -void *wmi_init(void *devt, int devid); - -void wmi_qos_state_init(struct wmi_t *wmip); -void wmi_shutdown(struct wmi_t *wmip); -HTC_ENDPOINT_ID wmi_get_control_ep(struct wmi_t * wmip); -void wmi_set_control_ep(struct wmi_t * wmip, HTC_ENDPOINT_ID eid); -A_UINT16 wmi_get_mapped_qos_queue(struct wmi_t *, A_UINT8); -A_STATUS wmi_dix_2_dot3(struct wmi_t *wmip, void *osbuf); -A_STATUS wmi_data_hdr_add(struct wmi_t *wmip, void *osbuf, A_UINT8 msgType, A_UINT32 flags , WMI_DATA_HDR_DATA_TYPE data_type,A_UINT8 metaVersion, void *pTxMetaS); -A_STATUS wmi_dot3_2_dix(void *osbuf); - -A_STATUS wmi_dot11_hdr_remove (struct wmi_t *wmip, void *osbuf); -A_STATUS wmi_dot11_hdr_add(struct wmi_t *wmip, void *osbuf, NETWORK_TYPE mode); - -A_STATUS wmi_data_hdr_remove(struct wmi_t *wmip, void *osbuf); -A_STATUS wmi_syncpoint(struct wmi_t *wmip); -A_STATUS wmi_syncpoint_reset(struct wmi_t *wmip); -A_UINT8 wmi_implicit_create_pstream(struct wmi_t *wmip, void *osbuf, A_UINT32 layer2Priority, A_BOOL wmmEnabled); - -A_UINT8 wmi_determine_userPriority (A_UINT8 *pkt, A_UINT32 layer2Pri); - -A_STATUS wmi_control_rx(struct wmi_t *wmip, void *osbuf); -void wmi_iterate_nodes(struct wmi_t *wmip, wlan_node_iter_func *f, void *arg); -void wmi_free_allnodes(struct wmi_t *wmip); -bss_t *wmi_find_node(struct wmi_t *wmip, const A_UINT8 *macaddr); -void wmi_free_node(struct wmi_t *wmip, const A_UINT8 *macaddr); - - -typedef enum { - NO_SYNC_WMIFLAG = 0, - SYNC_BEFORE_WMIFLAG, /* transmit all queued data before cmd */ - SYNC_AFTER_WMIFLAG, /* any new data waits until cmd execs */ - SYNC_BOTH_WMIFLAG, - END_WMIFLAG /* end marker */ -} WMI_SYNC_FLAG; - -A_STATUS wmi_cmd_send(struct wmi_t *wmip, void *osbuf, WMI_COMMAND_ID cmdId, - WMI_SYNC_FLAG flag); - -A_STATUS wmi_connect_cmd(struct wmi_t *wmip, - NETWORK_TYPE netType, - DOT11_AUTH_MODE dot11AuthMode, - AUTH_MODE authMode, - CRYPTO_TYPE pairwiseCrypto, - A_UINT8 pairwiseCryptoLen, - CRYPTO_TYPE groupCrypto, - A_UINT8 groupCryptoLen, - int ssidLength, - A_UCHAR *ssid, - A_UINT8 *bssid, - A_UINT16 channel, - A_UINT32 ctrl_flags); - -A_STATUS wmi_set_div_param_cmd(struct wmi_t *wmip, A_UINT32 divIdleTime, - A_UINT8 antRssiThresh, A_UINT8 divEnable, A_UINT16 active_treshold_rate); - - -A_STATUS wmi_reconnect_cmd(struct wmi_t *wmip, - A_UINT8 *bssid, - A_UINT16 channel); -A_STATUS wmi_disconnect_cmd(struct wmi_t *wmip); -A_STATUS wmi_getrev_cmd(struct wmi_t *wmip); -A_STATUS wmi_startscan_cmd(struct wmi_t *wmip, WMI_SCAN_TYPE scanType, - A_BOOL forceFgScan, A_BOOL isLegacy, - A_UINT32 homeDwellTime, A_UINT32 forceScanInterval, - A_INT8 numChan, A_UINT16 *channelList); -A_STATUS wmi_scanparams_cmd(struct wmi_t *wmip, A_UINT16 fg_start_sec, - A_UINT16 fg_end_sec, A_UINT16 bg_sec, - A_UINT16 minact_chdw_msec, - A_UINT16 maxact_chdw_msec, A_UINT16 pas_chdw_msec, - A_UINT8 shScanRatio, A_UINT8 scanCtrlFlags, - A_UINT32 max_dfsch_act_time, - A_UINT16 maxact_scan_per_ssid); -A_STATUS wmi_bssfilter_cmd(struct wmi_t *wmip, A_UINT8 filter, A_UINT32 ieMask); -A_STATUS wmi_probedSsid_cmd(struct wmi_t *wmip, A_UINT8 index, A_UINT8 flag, - A_UINT8 ssidLength, A_UCHAR *ssid); -A_STATUS wmi_listeninterval_cmd(struct wmi_t *wmip, A_UINT16 listenInterval, A_UINT16 listenBeacons); -A_STATUS wmi_bmisstime_cmd(struct wmi_t *wmip, A_UINT16 bmisstime, A_UINT16 bmissbeacons); -A_STATUS wmi_associnfo_cmd(struct wmi_t *wmip, A_UINT8 ieType, - A_UINT8 ieLen, A_UINT8 *ieInfo); -A_STATUS wmi_powermode_cmd(struct wmi_t *wmip, A_UINT8 powerMode); -A_STATUS wmi_ibsspmcaps_cmd(struct wmi_t *wmip, A_UINT8 pmEnable, A_UINT8 ttl, - A_UINT16 atim_windows, A_UINT16 timeout_value); -A_STATUS wmi_apps_cmd(struct wmi_t *wmip, A_UINT8 psType, A_UINT32 idle_time, - A_UINT32 ps_period, A_UINT8 sleep_period); -A_STATUS wmi_pmparams_cmd(struct wmi_t *wmip, A_UINT16 idlePeriod, - A_UINT16 psPollNum, A_UINT16 dtimPolicy, - A_UINT16 wakup_tx_policy, A_UINT16 num_tx_to_wakeup, - A_UINT16 ps_fail_event_policy); -A_STATUS wmi_disctimeout_cmd(struct wmi_t *wmip, A_UINT8 timeout); -A_STATUS wmi_sync_cmd(struct wmi_t *wmip, A_UINT8 syncNumber); -A_STATUS wmi_create_pstream_cmd(struct wmi_t *wmip, WMI_CREATE_PSTREAM_CMD *pstream); -A_STATUS wmi_delete_pstream_cmd(struct wmi_t *wmip, A_UINT8 trafficClass, A_UINT8 streamID); -A_STATUS wmi_set_framerate_cmd(struct wmi_t *wmip, A_UINT8 bEnable, A_UINT8 type, A_UINT8 subType, A_UINT16 rateMask); -A_STATUS wmi_set_bitrate_cmd(struct wmi_t *wmip, A_INT32 dataRate, A_INT32 mgmtRate, A_INT32 ctlRate); -A_STATUS wmi_get_bitrate_cmd(struct wmi_t *wmip); -A_INT8 wmi_validate_bitrate(struct wmi_t *wmip, A_INT32 rate, A_INT8 *rate_idx); -A_STATUS wmi_get_regDomain_cmd(struct wmi_t *wmip); -A_STATUS wmi_get_channelList_cmd(struct wmi_t *wmip); -A_STATUS wmi_set_channelParams_cmd(struct wmi_t *wmip, A_UINT8 scanParam, - WMI_PHY_MODE mode, A_INT8 numChan, - A_UINT16 *channelList); - -A_STATUS wmi_set_snr_threshold_params(struct wmi_t *wmip, - WMI_SNR_THRESHOLD_PARAMS_CMD *snrCmd); -A_STATUS wmi_set_rssi_threshold_params(struct wmi_t *wmip, - WMI_RSSI_THRESHOLD_PARAMS_CMD *rssiCmd); -A_STATUS wmi_clr_rssi_snr(struct wmi_t *wmip); -A_STATUS wmi_set_lq_threshold_params(struct wmi_t *wmip, - WMI_LQ_THRESHOLD_PARAMS_CMD *lqCmd); -A_STATUS wmi_set_rts_cmd(struct wmi_t *wmip, A_UINT16 threshold); -A_STATUS wmi_set_lpreamble_cmd(struct wmi_t *wmip, A_UINT8 status, A_UINT8 preamblePolicy); - -A_STATUS wmi_set_error_report_bitmask(struct wmi_t *wmip, A_UINT32 bitmask); - -A_STATUS wmi_get_challenge_resp_cmd(struct wmi_t *wmip, A_UINT32 cookie, - A_UINT32 source); - -A_STATUS wmi_config_debug_module_cmd(struct wmi_t *wmip, A_UINT16 mmask, - A_UINT16 tsr, A_BOOL rep, A_UINT16 size, - A_UINT32 valid); - -A_STATUS wmi_get_stats_cmd(struct wmi_t *wmip); - -A_STATUS wmi_addKey_cmd(struct wmi_t *wmip, A_UINT8 keyIndex, - CRYPTO_TYPE keyType, A_UINT8 keyUsage, - A_UINT8 keyLength,A_UINT8 *keyRSC, - A_UINT8 *keyMaterial, A_UINT8 key_op_ctrl, A_UINT8 *mac, - WMI_SYNC_FLAG sync_flag); -A_STATUS wmi_add_krk_cmd(struct wmi_t *wmip, A_UINT8 *krk); -A_STATUS wmi_delete_krk_cmd(struct wmi_t *wmip); -A_STATUS wmi_deleteKey_cmd(struct wmi_t *wmip, A_UINT8 keyIndex); -A_STATUS wmi_set_akmp_params_cmd(struct wmi_t *wmip, - WMI_SET_AKMP_PARAMS_CMD *akmpParams); -A_STATUS wmi_get_pmkid_list_cmd(struct wmi_t *wmip); -A_STATUS wmi_set_pmkid_list_cmd(struct wmi_t *wmip, - WMI_SET_PMKID_LIST_CMD *pmkInfo); -A_STATUS wmi_abort_scan_cmd(struct wmi_t *wmip); -A_STATUS wmi_set_txPwr_cmd(struct wmi_t *wmip, A_UINT8 dbM); -A_STATUS wmi_get_txPwr_cmd(struct wmi_t *wmip); -A_STATUS wmi_addBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex, A_UINT8 *bssid); -A_STATUS wmi_deleteBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex); -A_STATUS wmi_set_tkip_countermeasures_cmd(struct wmi_t *wmip, A_BOOL en); -A_STATUS wmi_setPmkid_cmd(struct wmi_t *wmip, A_UINT8 *bssid, A_UINT8 *pmkId, - A_BOOL set); -A_STATUS wmi_set_access_params_cmd(struct wmi_t *wmip, A_UINT8 ac, A_UINT16 txop, - A_UINT8 eCWmin, A_UINT8 eCWmax, - A_UINT8 aifsn); -A_STATUS wmi_set_retry_limits_cmd(struct wmi_t *wmip, A_UINT8 frameType, - A_UINT8 trafficClass, A_UINT8 maxRetries, - A_UINT8 enableNotify); - -void wmi_get_current_bssid(struct wmi_t *wmip, A_UINT8 *bssid); - -A_STATUS wmi_get_roam_tbl_cmd(struct wmi_t *wmip); -A_STATUS wmi_get_roam_data_cmd(struct wmi_t *wmip, A_UINT8 roamDataType); -A_STATUS wmi_set_roam_ctrl_cmd(struct wmi_t *wmip, WMI_SET_ROAM_CTRL_CMD *p, - A_UINT8 size); -A_STATUS wmi_set_powersave_timers_cmd(struct wmi_t *wmip, - WMI_POWERSAVE_TIMERS_POLICY_CMD *pCmd, - A_UINT8 size); - -A_STATUS wmi_set_opt_mode_cmd(struct wmi_t *wmip, A_UINT8 optMode); -A_STATUS wmi_opt_tx_frame_cmd(struct wmi_t *wmip, - A_UINT8 frmType, - A_UINT8 *dstMacAddr, - A_UINT8 *bssid, - A_UINT16 optIEDataLen, - A_UINT8 *optIEData); - -A_STATUS wmi_set_adhoc_bconIntvl_cmd(struct wmi_t *wmip, A_UINT16 intvl); -A_STATUS wmi_set_voice_pkt_size_cmd(struct wmi_t *wmip, A_UINT16 voicePktSize); -A_STATUS wmi_set_max_sp_len_cmd(struct wmi_t *wmip, A_UINT8 maxSpLen); -A_UINT8 convert_userPriority_to_trafficClass(A_UINT8 userPriority); -A_UINT8 wmi_get_power_mode_cmd(struct wmi_t *wmip); -A_STATUS wmi_verify_tspec_params(WMI_CREATE_PSTREAM_CMD *pCmd, A_BOOL tspecCompliance); - -#ifdef CONFIG_HOST_TCMD_SUPPORT -A_STATUS wmi_test_cmd(struct wmi_t *wmip, A_UINT8 *buf, A_UINT32 len); -#endif - -A_STATUS wmi_set_bt_status_cmd(struct wmi_t *wmip, A_UINT8 streamType, A_UINT8 status); -A_STATUS wmi_set_bt_params_cmd(struct wmi_t *wmip, WMI_SET_BT_PARAMS_CMD* cmd); - -A_STATUS wmi_set_btcoex_fe_ant_cmd(struct wmi_t *wmip, WMI_SET_BTCOEX_FE_ANT_CMD * cmd); - -A_STATUS wmi_set_btcoex_colocated_bt_dev_cmd(struct wmi_t *wmip, - WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD * cmd); - -A_STATUS wmi_set_btcoex_btinquiry_page_config_cmd(struct wmi_t *wmip, - WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMD *cmd); - -A_STATUS wmi_set_btcoex_sco_config_cmd(struct wmi_t *wmip, - WMI_SET_BTCOEX_SCO_CONFIG_CMD * cmd); - -A_STATUS wmi_set_btcoex_a2dp_config_cmd(struct wmi_t *wmip, - WMI_SET_BTCOEX_A2DP_CONFIG_CMD* cmd); - - -A_STATUS wmi_set_btcoex_aclcoex_config_cmd(struct wmi_t *wmip, WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD* cmd); - -A_STATUS wmi_set_btcoex_debug_cmd(struct wmi_t *wmip, WMI_SET_BTCOEX_DEBUG_CMD * cmd); - -A_STATUS wmi_set_btcoex_bt_operating_status_cmd(struct wmi_t * wmip, - WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMD * cmd); - -A_STATUS wmi_get_btcoex_config_cmd(struct wmi_t * wmip, WMI_GET_BTCOEX_CONFIG_CMD * cmd); - -A_STATUS wmi_get_btcoex_stats_cmd(struct wmi_t * wmip); - -A_STATUS wmi_SGI_cmd(struct wmi_t *wmip, A_UINT32 *sgiMask, A_UINT8 sgiPERThreshold); - -/* - * This function is used to configure the fix rates mask to the target. - */ -A_STATUS wmi_set_fixrates_cmd(struct wmi_t *wmip, A_UINT32 *fixRatesMask); -A_STATUS wmi_get_ratemask_cmd(struct wmi_t *wmip); - -A_STATUS wmi_set_authmode_cmd(struct wmi_t *wmip, A_UINT8 mode); - -A_STATUS wmi_set_reassocmode_cmd(struct wmi_t *wmip, A_UINT8 mode); - -A_STATUS wmi_set_qos_supp_cmd(struct wmi_t *wmip,A_UINT8 status); -A_STATUS wmi_set_wmm_cmd(struct wmi_t *wmip, WMI_WMM_STATUS status); -A_STATUS wmi_set_wmm_txop(struct wmi_t *wmip, WMI_TXOP_CFG txEnable); -A_STATUS wmi_set_country(struct wmi_t *wmip, A_UCHAR *countryCode); - -A_STATUS wmi_get_keepalive_configured(struct wmi_t *wmip); -A_UINT8 wmi_get_keepalive_cmd(struct wmi_t *wmip); -A_STATUS wmi_set_keepalive_cmd(struct wmi_t *wmip, A_UINT8 keepaliveInterval); - -A_STATUS wmi_set_appie_cmd(struct wmi_t *wmip, A_UINT8 mgmtFrmType, - A_UINT8 ieLen,A_UINT8 *ieInfo); - -A_STATUS wmi_set_halparam_cmd(struct wmi_t *wmip, A_UINT8 *cmd, A_UINT16 dataLen); - -A_INT32 wmi_get_rate(A_INT8 rateindex); - -A_STATUS wmi_set_ip_cmd(struct wmi_t *wmip, WMI_SET_IP_CMD *cmd); - -/*Wake on Wireless WMI commands*/ -A_STATUS wmi_set_host_sleep_mode_cmd(struct wmi_t *wmip, WMI_SET_HOST_SLEEP_MODE_CMD *cmd); -A_STATUS wmi_set_wow_mode_cmd(struct wmi_t *wmip, WMI_SET_WOW_MODE_CMD *cmd); -A_STATUS wmi_get_wow_list_cmd(struct wmi_t *wmip, WMI_GET_WOW_LIST_CMD *cmd); -A_STATUS wmi_add_wow_pattern_cmd(struct wmi_t *wmip, - WMI_ADD_WOW_PATTERN_CMD *cmd, A_UINT8* pattern, A_UINT8* mask, A_UINT8 pattern_size); -A_STATUS wmi_del_wow_pattern_cmd(struct wmi_t *wmip, - WMI_DEL_WOW_PATTERN_CMD *cmd); -A_STATUS wmi_set_wsc_status_cmd(struct wmi_t *wmip, A_UINT32 status); - -A_STATUS -wmi_set_params_cmd(struct wmi_t *wmip, A_UINT32 opcode, A_UINT32 length, A_CHAR* buffer); - -A_STATUS -wmi_set_mcast_filter_cmd(struct wmi_t *wmip, A_UINT8 *filter); - -A_STATUS -wmi_del_mcast_filter_cmd(struct wmi_t *wmip, A_UINT8 *filter); - -A_STATUS -wmi_mcast_filter_cmd(struct wmi_t *wmip, A_UINT8 enable); - -bss_t * -wmi_find_Ssidnode (struct wmi_t *wmip, A_UCHAR *pSsid, - A_UINT32 ssidLength, A_BOOL bIsWPA2, A_BOOL bMatchSSID); - - -void -wmi_node_return (struct wmi_t *wmip, bss_t *bss); - -void -wmi_node_update_timestamp(struct wmi_t *wmip, bss_t *bss); - -void wmi_setup_node(struct wmi_t *wmip, bss_t *bss, const A_UINT8 *bssid); - -bss_t *wmi_node_alloc(struct wmi_t *wmip, A_UINT8 len); - -void -wmi_set_nodeage(struct wmi_t *wmip, A_UINT32 nodeAge); - -#if defined(CONFIG_TARGET_PROFILE_SUPPORT) -A_STATUS wmi_prof_cfg_cmd(struct wmi_t *wmip, A_UINT32 period, A_UINT32 nbins); -A_STATUS wmi_prof_addr_set_cmd(struct wmi_t *wmip, A_UINT32 addr); -A_STATUS wmi_prof_start_cmd(struct wmi_t *wmip); -A_STATUS wmi_prof_stop_cmd(struct wmi_t *wmip); -A_STATUS wmi_prof_count_get_cmd(struct wmi_t *wmip); -#endif /* CONFIG_TARGET_PROFILE_SUPPORT */ -#ifdef OS_ROAM_MANAGEMENT -void wmi_scan_indication (struct wmi_t *wmip); -#endif - -A_STATUS -wmi_set_target_event_report_cmd(struct wmi_t *wmip, WMI_SET_TARGET_EVENT_REPORT_CMD* cmd); - -bss_t *wmi_rm_current_bss (struct wmi_t *wmip, A_UINT8 *id); -A_STATUS wmi_add_current_bss (struct wmi_t *wmip, A_UINT8 *id, bss_t *bss); - - -/* - * AP mode - */ -A_STATUS -wmi_ap_profile_commit(struct wmi_t *wmip, WMI_CONNECT_CMD *p); - -A_STATUS -wmi_ap_set_hidden_ssid(struct wmi_t *wmip, A_UINT8 hidden_ssid); - -A_STATUS -wmi_ap_set_num_sta(struct wmi_t *wmip, A_UINT8 num_sta); - -A_STATUS -wmi_ap_set_dfs(struct wmi_t *wmip, A_UINT8 enable); - -A_STATUS -wmi_ap_set_acl_policy(struct wmi_t *wmip, A_UINT8 policy); - -A_STATUS -wmi_ap_acl_mac_list(struct wmi_t *wmip, WMI_AP_ACL_MAC_CMD *a); - -A_UINT8 -acl_add_del_mac(WMI_AP_ACL *a, WMI_AP_ACL_MAC_CMD *acl); - -A_STATUS -wmi_ap_set_mlme(struct wmi_t *wmip, A_UINT8 cmd, A_UINT8 *mac, A_UINT16 reason); - -A_STATUS -wmi_set_pvb_cmd(struct wmi_t *wmip, A_UINT16 aid, A_BOOL flag); - -A_STATUS -wmi_ap_conn_inact_time(struct wmi_t *wmip, A_UINT32 period); - -A_STATUS -wmi_ap_bgscan_time(struct wmi_t *wmip, A_UINT32 period, A_UINT32 dwell); - -A_STATUS -wmi_ap_set_dtim(struct wmi_t *wmip, A_UINT8 dtim); - -A_STATUS -wmi_ap_set_rateset(struct wmi_t *wmip, A_UINT8 rateset); - -A_STATUS -wmi_set_ht_cap_cmd(struct wmi_t *wmip, WMI_SET_HT_CAP_CMD *cmd); - -A_STATUS -wmi_get_ht_cap_cmd(struct wmi_t *wmip, WMI_SET_HT_CAP_CMD *cmd); - -A_STATUS -wmi_set_ht_op_cmd(struct wmi_t *wmip, A_UINT8 sta_chan_width); - -A_STATUS -wmi_send_hci_cmd(struct wmi_t *wmip, A_UINT8 *buf, A_UINT16 sz); - -A_STATUS -wmi_set_tx_select_rates_cmd(struct wmi_t *wmip, A_UINT32 *pMaskArray); - -A_STATUS -wmi_setup_aggr_cmd(struct wmi_t *wmip, A_UINT8 tid); - -A_STATUS -wmi_delete_aggr_cmd(struct wmi_t *wmip, A_UINT8 tid, A_BOOL uplink); - -A_STATUS -wmi_allow_aggr_cmd(struct wmi_t *wmip, A_UINT16 tx_tidmask, A_UINT16 rx_tidmask); - -A_STATUS -wmi_set_rx_frame_format_cmd(struct wmi_t *wmip, A_UINT8 rxMetaVersion, A_BOOL rxDot11Hdr, A_BOOL defragOnHost); - -A_STATUS -wmi_set_thin_mode_cmd(struct wmi_t *wmip, A_BOOL bThinMode); - -A_STATUS -wmi_set_wlan_conn_precedence_cmd(struct wmi_t *wmip, BT_WLAN_CONN_PRECEDENCE precedence); - -A_STATUS -wmi_set_pmk_cmd(struct wmi_t *wmip, A_UINT8 *pmk); - -A_STATUS -wmi_set_passphrase_cmd(struct wmi_t *wmip, WMI_SET_PASSPHRASE_CMD *cmd); - -A_STATUS -wmi_set_excess_tx_retry_thres_cmd(struct wmi_t *wmip, WMI_SET_EXCESS_TX_RETRY_THRES_CMD *cmd); - -A_STATUS -wmi_assoc_req_enable_cmd(struct wmi_t *wmip, A_UINT8 enable); - -A_STATUS -wmi_assoc_req_report_cmd (struct wmi_t *wmip, A_UINT8 host_accept, A_UINT8 host_reaspncode, A_UINT8 target_status, A_UINT8 *sta_mac_addr, A_UINT8 rspType); - -#ifdef P2P -A_STATUS -wmi_p2p_discover(struct wmi_t *wmip, WMI_P2P_FIND_CMD *find_param); - -A_STATUS -wmi_p2p_stop_find(struct wmi_t *wmip); - -A_STATUS -wmi_p2p_cancel(struct wmi_t *wmip); - -A_STATUS -wmi_p2p_listen(struct wmi_t *wmip, A_UINT32 timeout); - -A_STATUS -wmi_p2p_go_neg_start(struct wmi_t *wmip, WMI_P2P_GO_NEG_START_CMD *go_param); - -A_STATUS wmi_p2p_sdpd_tx_cmd(struct wmi_t *wmip, WMI_P2P_SDPD_TX_CMD *buf); - -A_STATUS wmi_p2p_stop_sdpd(struct wmi_t *wmip); - -A_STATUS wmi_p2p_go_neg_rsp_cmd(struct wmi_t *wmip, A_UINT8 status, - A_UINT8 go_intent, A_UINT32 wps_method, A_UINT16 listen_freq, - A_UINT8 *wpsbuf, A_UINT32 wpslen, A_UINT8 *p2pbuf, A_UINT32 p2plen, - A_UINT8 dialog_token, A_UINT8 persistent_grp); - -A_STATUS -wmi_p2p_set_config(struct wmi_t *wmip, WMI_P2P_SET_CONFIG_CMD *config); - -A_STATUS -wmi_wps_set_config(struct wmi_t *wmip, WMI_WPS_SET_CONFIG_CMD *wps_config); - -A_STATUS wmi_p2p_grp_init_cmd(struct wmi_t *wmip, WMI_P2P_GRP_INIT_CMD *buf); - -A_STATUS wmi_p2p_grp_done_cmd(struct wmi_t *wmip, - WMI_P2P_GRP_FORMATION_DONE_CMD *buf); - -A_STATUS wmi_p2p_invite_cmd(struct wmi_t *wmip, WMI_P2P_INVITE_CMD *buf); - -A_STATUS wmi_p2p_invite_req_rsp_cmd(struct wmi_t *wmip, A_UINT8 status, - A_INT8 is_go, A_UINT8 *grp_bssid, A_UINT8 *p2pbuf, - A_UINT8 p2plen, A_UINT8 dialog_token); - -A_STATUS wmi_p2p_prov_disc_cmd(struct wmi_t *wmip, - WMI_P2P_PROV_DISC_REQ_CMD *buf); - -A_STATUS wmi_p2p_set_cmd(struct wmi_t *wmip, WMI_P2P_SET_CMD *buf); - -#endif /* P2P */ - -A_UINT16 -wmi_ieee2freq (int chan); - -A_UINT32 -wmi_freq2ieee (A_UINT16 freq); - -bss_t * -wmi_find_matching_Ssidnode (struct wmi_t *wmip, A_UCHAR *pSsid, - A_UINT32 ssidLength, - A_UINT32 dot11AuthMode, A_UINT32 authMode, - A_UINT32 pairwiseCryptoType, A_UINT32 grpwiseCryptoTyp); - -A_STATUS -wmi_radarDetected_cmd(struct wmi_t *wmip, A_INT16 chan_index, A_INT8 bang_radar); - -A_STATUS -wmi_set_dfs_maxpulsedur_cmd(struct wmi_t *wmip, A_UINT32 value); - -A_STATUS -wmi_set_dfs_minrssithresh_cmd(struct wmi_t *wmip, A_INT32 rssi); - -A_STATUS -wmi_beacon2bssnode (struct wmi_t *wmip, A_UINT8 *datap, int len, A_UINT8 *bssid, A_UINT16 channel); - -A_STATUS -wmi_set_tx_mac_rules_cmd (struct wmi_t *wmip, A_UINT32 rules); - -A_STATUS -wmi_set_promiscuous_mode_cmd (struct wmi_t *wmip, A_BOOL bMode); - -//WAC -A_STATUS wmi_wac_enable_cmd(struct wmi_t *wmip, WMI_WAC_ENABLE_CMD *param); - -A_STATUS -wmi_wac_scan_reply_cmd(struct wmi_t *wmip, WAC_SUBCMD param); - -A_STATUS -wmi_wac_ctrl_req_cmd(struct wmi_t *wmip, WMI_WAC_CTRL_REQ_CMD *param); - -#ifdef CONFIG_WLAN_RFKILL -A_STATUS -wmi_get_rfkill_mode_cmd(struct wmi_t *wmip); - -A_STATUS -wmi_set_rfkill_mode_cmd(struct wmi_t *wmip,WMI_RFKILL_MODE_CMD *pCmd); - -#endif - -A_STATUS -wmi_force_target_assert(struct wmi_t *wmip); - -A_STATUS -wmi_ap_set_apsd(struct wmi_t *wmip, A_UINT8 enable); - -A_STATUS -wmi_set_apsd_buffered_traffic_cmd(struct wmi_t *wmip, A_UINT16 aid, A_UINT16 bitmap, A_UINT32 flags); - - -#ifdef __cplusplus -} -#endif - -#endif /* _WMI_API_H_ */ diff --git a/drivers/net/wireless/ar6003/host/lib/wac/Makefile b/drivers/net/wireless/ar6003/host/lib/wac/Makefile deleted file mode 100644 index 22979973c956..000000000000 --- a/drivers/net/wireless/ar6003/host/lib/wac/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2005-2007 Atheros Corporation. All rights reserved. -# -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# -#------------------------------------------------------------------------------ -#============================================================================== -# Author(s): ="Atheros" -#============================================================================== -CC := $(ATH_CROSS_COMPILE_TYPE)gcc -KERNEL_SRC :=$(ATH_LINUXPATH) - -ifndef CFLAGS -#CFLAGS = -MMD -O2 -Wall -g -CFLAGS = -Wall -endif - -CFLAGS += -DCONFIG_CTRL_IFACE_UNIX -DCONFIG_CTRL_IFACE -DWAPI_ENABLE - -all: - $(CC) $(CFLAGS) -I./ -I$(KERNEL_SRC)/include -I../../include -I../../../include -I../../wlan/include \ - -I../../os/linux/include -I../../3rdparty/supplicant/opensrc_0_6_9/src/common \ - -I../../os/linux/include -I../../3rdparty/supplicant/opensrc_0_6_9/src/utils wac.c -o wac - -#wpa_ctrl.o: os_internal.o -# $(CC) $(CFLAGS) -I./ -I$(KERNEL_SRC)/include -I../../include -I../../../include -I../../wlan/include \ -# -I../../os/linux/include -I../../3rdparty/supplicant/opensrc_0_6_9/src/utils \ -# -c ../../3rdparty/supplicant/opensrc_0_6_9/src/common/wpa_ctrl.c -# -#os_internal.o: -# $(CC) $(CFLAGS) -I./ -I$(KERNEL_SRC)/include -I../../include -I../../../include -I../../wlan/include \ -# -I../../os/linux/include -I../../3rdparty/supplicant/opensrc_0_6_9/src/utils \ -# -c ../../3rdparty/supplicant/opensrc_0_6_9/src/utils/os_internal.c diff --git a/drivers/net/wireless/ar6003/host/lib/wac/wac.c b/drivers/net/wireless/ar6003/host/lib/wac/wac.c deleted file mode 100644 index f39e63ceb4c9..000000000000 --- a/drivers/net/wireless/ar6003/host/lib/wac/wac.c +++ /dev/null @@ -1,1446 +0,0 @@ -/* - * Copyright (c) 2006 Atheros Communications Inc. - * All rights reserved. - * - * - * -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef ANDROID -#include "wireless_copy.h" -#else -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "wac_defs.h" -//#include "wpa_ctrl.h" -//#include "os.h" - -#undef DEBUG -#undef DBGLOG_DEBUG - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) -/* ---------- CONSTANTS --------------- */ -#define ATH_WE_HEADER_TYPE_NULL 0 /* Not available */ -#define ATH_WE_HEADER_TYPE_CHAR 2 /* char [IFNAMSIZ] */ -#define ATH_WE_HEADER_TYPE_UINT 4 /* __u32 */ -#define ATH_WE_HEADER_TYPE_FREQ 5 /* struct iw_freq */ -#define ATH_WE_HEADER_TYPE_ADDR 6 /* struct sockaddr */ -#define ATH_WE_HEADER_TYPE_POINT 8 /* struct iw_point */ -#define ATH_WE_HEADER_TYPE_PARAM 9 /* struct iw_param */ -#define ATH_WE_HEADER_TYPE_QUAL 10 /* struct iw_quality */ - -#define ATH_WE_DESCR_FLAG_DUMP 0x0001 /* Not part of the dump command */ -#define ATH_WE_DESCR_FLAG_EVENT 0x0002 /* Generate an event on SET */ -#define ATH_WE_DESCR_FLAG_RESTRICT 0x0004 /* GET : request is ROOT only */ -#define ATH_WE_DESCR_FLAG_NOMAX 0x0008 /* GET : no limit on request size */ - -#define ATH_SIOCSIWMODUL 0x8b2f -#define ATH_SIOCGIWMODUL 0x8b2f -#define ATH_WE_VERSION (A_INT16)22 -/* ---------------------------- TYPES ---------------------------- */ - -/* - * standard IOCTL looks like. - */ -struct ath_ioctl_description -{ - A_UINT8 header_type; /* NULL, iw_point or other */ - A_UINT8 token_type; /* Future */ - A_UINT16 token_size; /* Granularity of payload */ - A_UINT16 min_tokens; /* Min acceptable token number */ - A_UINT16 max_tokens; /* Max acceptable token number */ - A_UINT32 flags; /* Special handling of the request */ -}; - - -/* -------------------------- VARIABLES -------------------------- */ - -/* - * Meta-data about all the standard Wireless Extension request we - * know about. - */ -static const struct ath_ioctl_description standard_ioctl_descr[] = { - [SIOCSIWCOMMIT - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_NULL, - }, - [SIOCGIWNAME - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_CHAR, - .flags = ATH_WE_DESCR_FLAG_DUMP, - }, - [SIOCSIWNWID - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - .flags = ATH_WE_DESCR_FLAG_EVENT, - }, - [SIOCGIWNWID - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - .flags = ATH_WE_DESCR_FLAG_DUMP, - }, - [SIOCSIWFREQ - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_FREQ, - .flags = ATH_WE_DESCR_FLAG_EVENT, - }, - [SIOCGIWFREQ - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_FREQ, - .flags = ATH_WE_DESCR_FLAG_DUMP, - }, - [SIOCSIWMODE - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_UINT, - .flags = ATH_WE_DESCR_FLAG_EVENT, - }, - [SIOCGIWMODE - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_UINT, - .flags = ATH_WE_DESCR_FLAG_DUMP, - }, - [SIOCSIWSENS - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCGIWSENS - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCSIWRANGE - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_NULL, - }, - [SIOCGIWRANGE - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = sizeof(struct iw_range), - .flags = ATH_WE_DESCR_FLAG_DUMP, - }, - [SIOCSIWPRIV - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_NULL, - }, - [SIOCGIWPRIV - SIOCIWFIRST] = { /* (handled directly by us) */ - .header_type = ATH_WE_HEADER_TYPE_NULL, - }, - [SIOCSIWSTATS - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_NULL, - }, - [SIOCGIWSTATS - SIOCIWFIRST] = { /* (handled directly by us) */ - .header_type = ATH_WE_HEADER_TYPE_NULL, - .flags = ATH_WE_DESCR_FLAG_DUMP, - }, - [SIOCSIWSPY - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = sizeof(struct sockaddr), - .max_tokens = IW_MAX_SPY, - }, - [SIOCGIWSPY - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = sizeof(struct sockaddr) + - sizeof(struct iw_quality), - .max_tokens = IW_MAX_SPY, - }, - [SIOCSIWTHRSPY - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = sizeof(struct iw_thrspy), - .min_tokens = 1, - .max_tokens = 1, - }, - [SIOCGIWTHRSPY - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = sizeof(struct iw_thrspy), - .min_tokens = 1, - .max_tokens = 1, - }, - [SIOCSIWAP - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_ADDR, - }, - [SIOCGIWAP - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_ADDR, - .flags = ATH_WE_DESCR_FLAG_DUMP, - }, - [SIOCSIWMLME - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .min_tokens = sizeof(struct iw_mlme), - .max_tokens = sizeof(struct iw_mlme), - }, - [SIOCGIWAPLIST - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = sizeof(struct sockaddr) + - sizeof(struct iw_quality), - .max_tokens = IW_MAX_AP, - .flags = ATH_WE_DESCR_FLAG_NOMAX, - }, - [SIOCSIWSCAN - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .min_tokens = 0, - .max_tokens = sizeof(struct iw_scan_req), - }, - [SIOCGIWSCAN - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = IW_SCAN_MAX_DATA, - .flags = ATH_WE_DESCR_FLAG_NOMAX, - }, - [SIOCSIWESSID - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = IW_ESSID_MAX_SIZE + 1, - .flags = ATH_WE_DESCR_FLAG_EVENT, - }, - [SIOCGIWESSID - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = IW_ESSID_MAX_SIZE + 1, - .flags = ATH_WE_DESCR_FLAG_DUMP, - }, - [SIOCSIWNICKN - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = IW_ESSID_MAX_SIZE + 1, - }, - [SIOCGIWNICKN - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = IW_ESSID_MAX_SIZE + 1, - }, - [SIOCSIWRATE - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCGIWRATE - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCSIWRTS - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCGIWRTS - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCSIWFRAG - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCGIWFRAG - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCSIWTXPOW - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCGIWTXPOW - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCSIWRETRY - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCGIWRETRY - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCSIWENCODE - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = IW_ENCODING_TOKEN_MAX, - .flags = ATH_WE_DESCR_FLAG_EVENT | ATH_WE_DESCR_FLAG_RESTRICT, - }, - [SIOCGIWENCODE - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = IW_ENCODING_TOKEN_MAX, - .flags = ATH_WE_DESCR_FLAG_DUMP | ATH_WE_DESCR_FLAG_RESTRICT, - }, - [SIOCSIWPOWER - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCGIWPOWER - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [ATH_SIOCSIWMODUL - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [ATH_SIOCGIWMODUL - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCSIWGENIE - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = IW_GENERIC_IE_MAX, - }, - [SIOCGIWGENIE - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = IW_GENERIC_IE_MAX, - }, - [SIOCSIWAUTH - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCGIWAUTH - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_PARAM, - }, - [SIOCSIWENCODEEXT - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .min_tokens = sizeof(struct iw_encode_ext), - .max_tokens = sizeof(struct iw_encode_ext) + - IW_ENCODING_TOKEN_MAX, - }, - [SIOCGIWENCODEEXT - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .min_tokens = sizeof(struct iw_encode_ext), - .max_tokens = sizeof(struct iw_encode_ext) + - IW_ENCODING_TOKEN_MAX, - }, - [SIOCSIWPMKSA - SIOCIWFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .min_tokens = sizeof(struct iw_pmksa), - .max_tokens = sizeof(struct iw_pmksa), - }, -}; -static const unsigned int standard_ioctl_num = (sizeof(standard_ioctl_descr) / - sizeof(struct ath_ioctl_description)); - -/* - * Meta-data about all the additional standard Wireless Extension events - */ -static const struct ath_ioctl_description standard_event_descr[] = { - [IWEVTXDROP - IWEVFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_ADDR, - }, - [IWEVQUAL - IWEVFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_QUAL, - }, - [IWEVCUSTOM - IWEVFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = IW_CUSTOM_MAX, - }, - [IWEVREGISTERED - IWEVFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_ADDR, - }, - [IWEVEXPIRED - IWEVFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_ADDR, - }, - [IWEVGENIE - IWEVFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = IW_GENERIC_IE_MAX, - }, - [IWEVMICHAELMICFAILURE - IWEVFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = sizeof(struct iw_michaelmicfailure), - }, - [IWEVASSOCREQIE - IWEVFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = IW_GENERIC_IE_MAX, - }, - [IWEVASSOCRESPIE - IWEVFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = IW_GENERIC_IE_MAX, - }, - [IWEVPMKIDCAND - IWEVFIRST] = { - .header_type = ATH_WE_HEADER_TYPE_POINT, - .token_size = 1, - .max_tokens = sizeof(struct iw_pmkid_cand), - }, -}; -static const unsigned int standard_event_num = (sizeof(standard_event_descr) / - sizeof(struct ath_ioctl_description)); - -/* Size (in bytes) of various events */ -static const int event_type_size[] = { - IW_EV_LCP_PK_LEN, /* ATH_WE_HEADER_TYPE_NULL */ - 0, - IW_EV_CHAR_PK_LEN, /* ATH_WE_HEADER_TYPE_CHAR */ - 0, - IW_EV_UINT_PK_LEN, /* ATH_WE_HEADER_TYPE_UINT */ - IW_EV_FREQ_PK_LEN, /* ATH_WE_HEADER_TYPE_FREQ */ - IW_EV_ADDR_PK_LEN, /* ATH_WE_HEADER_TYPE_ADDR */ - 0, - IW_EV_POINT_PK_LEN, /* Without variable payload */ - IW_EV_PARAM_PK_LEN, /* ATH_WE_HEADER_TYPE_PARAM */ - IW_EV_QUAL_PK_LEN, /* ATH_WE_HEADER_TYPE_QUAL */ -}; - -//static const char *ctrl_iface_dir = "/var/run/wpa_supplicant"; -//static struct wpa_ctrl *ctrl_conn; -//static char *ctrl_ifname = NULL; - -/* Structure used for parsing event list, such as Wireless Events - * and scan results */ -typedef struct event_list -{ - A_INT8 * end; /* End of the list */ - A_INT8 * current; /* Current event in list of events */ - A_INT8 * value; /* Current value in event */ -} event_list; - -#endif /*#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) */ - - - - -#define MAX_WAC_BSS 10 -WMI_BSS_INFO_HDR2 myBssInfo[MAX_WAC_BSS]; -int myBssCnt = 0; -int wps_pending = 0; -char exec_path[128]; -char wps_pin[9]; - -//DBG -int fakeId = 0; - -// utilities functions -typedef long os_time_t; - -struct os_time { - os_time_t sec; - os_time_t usec; -}; - -static int os_get_random(unsigned char *buf, size_t len) -{ - FILE *f; - size_t rc; - - f = fopen("/dev/urandom", "rb"); - if (f == NULL) { - printf("Could not open /dev/urandom.\n"); - return -1; - } - - rc = fread(buf, 1, len, f); - fclose(f); - - return rc != len ? -1 : 0; -} - -static int os_get_time(struct os_time *t) -{ - int res; - struct timeval tv; - res = gettimeofday(&tv, NULL); - t->sec = tv.tv_sec; - t->usec = tv.tv_usec; - return res; -} - -static unsigned long os_random(void) -{ - return random(); -} - -/** - * wps_pin_checksum - Compute PIN checksum - * @pin: Seven digit PIN (i.e., eight digit PIN without the checksum digit) - * Returns: Checksum digit - */ -unsigned int wps_pin_checksum(unsigned int pin) -{ - unsigned int accum = 0; - while (pin) { - accum += 3 * (pin % 10); - pin /= 10; - accum += pin % 10; - pin /= 10; - } - - return (10 - accum % 10) % 10; -} - -/** - * wps_generate_pin - Generate a random PIN - * Returns: Eight digit PIN (i.e., including the checksum digit) - */ -unsigned int wps_generate_pin(void) -{ - unsigned int val; - - /* Generate seven random digits for the PIN */ - if (os_get_random((unsigned char *) &val, sizeof(val)) < 0) { - struct os_time now; - os_get_time(&now); - val = os_random() ^ now.sec ^ now.usec; - } - val %= 10000000; - - /* Append checksum digit */ - return val * 10 + wps_pin_checksum(val); -} - -static void str2hex(A_UINT8 *hex, char *str); -// -//////////////////////////////////////////////////////////////////////////////// -// Library APIs -int wac_enable(int s, int enable, unsigned int period, unsigned int scan_thres, int rssi_thres) -{ - char ifname[IFNAMSIZ]; - struct ifreq ifr; - char *ethIf; - char *cmd_buf = malloc(256); - WMI_WAC_ENABLE_CMD *cmd = (WMI_WAC_ENABLE_CMD *)(cmd_buf+4); - unsigned int pin = wps_generate_pin(); - - memset(cmd_buf, 0, sizeof(cmd_buf)); - memset(ifname, '\0', IFNAMSIZ); - cmd->enable = enable; - cmd->period = period; - cmd->threshold = scan_thres; - cmd->rssi = rssi_thres; - snprintf(wps_pin, 9, "%d", pin); - memcpy(cmd->wps_pin, wps_pin, 8); - - if ((ethIf = getenv("NETIF")) == NULL) { - ethIf = "eth1"; - } - strcpy(ifname, ethIf); - strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); - - ((int *)cmd_buf)[0] = AR6000_XIOCTL_WMI_ENABLE_WAC_PARAM; - ifr.ifr_data = cmd_buf; - if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) - { - err(1, "%s", ifr.ifr_name); - free(cmd_buf); - return -1; - } - printf("cmd = Wac Enable: %x, %x %x, %x\n", enable, period, scan_thres, rssi_thres); - printf("random PIN = %s\n", wps_pin); - free(cmd_buf); - - return 0; -} - -void wac_control_request( int s, - WAC_REQUEST_TYPE req, - WAC_COMMAND cmd, - WAC_FRAME_TYPE frm, - char *ie, - int *ret_val, - WAC_STATUS *status ) -{ - char ifname[IFNAMSIZ]; - struct ifreq ifr; - char *ethIf; - char *cmd_buf = malloc(256); - WMI_WAC_CTRL_REQ_CMD *ctrl_cmd = (WMI_WAC_CTRL_REQ_CMD *)(cmd_buf+4); - - memset(cmd_buf, 0, 256); - memset(ifname, '\0', IFNAMSIZ); - - if ((ethIf = getenv("NETIF")) == NULL) { - ethIf = "eth1"; - } - strcpy(ifname, ethIf); - strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); - - *ret_val = 0; - - if ( WAC_SET == req ) { - if ( PRBREQ == frm ) { - switch (cmd) { - case WAC_ADD: - { - if (0 != strncmp(ie, "0x", 2)) { - printf("expect \'ie\' in hex format with 0x\n"); - *ret_val = -1; - goto done_ctrl_req; - } - - if (0 != (strlen(ie) % 2)) { - printf("expect \'ie\' to be even length\n"); - *ret_val = -1; - goto done_ctrl_req; - } - - ctrl_cmd->req = WAC_SET; - ctrl_cmd->cmd = WAC_ADD; - ctrl_cmd->frame = PRBREQ; - str2hex(ctrl_cmd->ie, ie); - - ((int *)cmd_buf)[0] = AR6000_XIOCTL_WMI_WAC_CTRL_REQ; - ifr.ifr_data = cmd_buf; - if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) - { - err(1, "%s", ifr.ifr_name); - *ret_val = -1; - } - break; - } - - case WAC_DEL: - { - ctrl_cmd->req = WAC_SET; - ctrl_cmd->cmd = WAC_DEL; - ctrl_cmd->frame = PRBREQ; - - ((int *)cmd_buf)[0] = AR6000_XIOCTL_WMI_WAC_CTRL_REQ; - ifr.ifr_data = cmd_buf; - if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) - { - err(1, "%s", ifr.ifr_name); - *ret_val = -1; - } - break; - } - - default: - printf("unknown command %d\n", cmd); - *ret_val = -1; - break; - } - } - else { - printf("unknown set frame type %d\n", frm); - *ret_val = -1; - } - } - else if ( WAC_GET == req ) { - if ( WAC_GET_STATUS == cmd ) { // GET STATUS - ctrl_cmd->req = WAC_GET; - ctrl_cmd->cmd = WAC_GET_STATUS; - - ((int *)cmd_buf)[0] = AR6000_XIOCTL_WMI_WAC_CTRL_REQ; - ifr.ifr_data = cmd_buf; - if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) - { - err(1, "%s", ifr.ifr_name); - *ret_val = -1; - goto done_ctrl_req; - } - A_MEMCPY(status, ifr.ifr_data, sizeof(WAC_STATUS)); - } - else if ( PRBREQ == frm ) { // GET IE - ctrl_cmd->req = WAC_GET; - ctrl_cmd->cmd = WAC_GET_IE; - - ((int *)cmd_buf)[0] = AR6000_XIOCTL_WMI_WAC_CTRL_REQ; - ifr.ifr_data = cmd_buf; - if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) - { - err(1, "%s", ifr.ifr_name); - *ret_val = -1; - goto done_ctrl_req; - } - A_MEMCPY(ie, ifr.ifr_data, sizeof(WMI_GET_WAC_INFO)); - } - else { - printf("unknown get request\n"); - *ret_val = -1; - } - } - else - { - printf("unkown request type %d\n", req); - *ret_val = -1; - } - -done_ctrl_req: - free(cmd_buf); -} - -//////////////////////////////////////////////////////////////////////////////// - -static int htoi(char c) -{ - if (c >= 'a' && c <= 'f') { - return (c - 'a' + 10); - } - - if (c >= 'A' && c <= 'F') { - return (c - 'A' + 10); - } - - if (c >= '0' && c <= '9') { - return (c - '0'); - } - - return 0; -} - -static void str2hex(A_UINT8 *hex, char *str) -{ - int i; - int len = strlen(str); - - for (i = 2; i < len; i+=2) { - hex[(i-2)/2] = htoi(str[i]) * 16 + htoi(str[i+1]); - } -} - -static void getBssid(char *bssid) -{ - WMI_BSS_INFO_HDR2 *p = &myBssInfo[0]; - char tmp[3]; - - if (fakeId == (MAX_WAC_BSS+1)) { - strcpy(bssid, "1c:af:f7:1b:81:82"); - return; - } - - sprintf(tmp, "%02x", p->bssid[0]); - strcpy(bssid, tmp); - strcat(bssid, ":"); - sprintf(tmp, "%02x", p->bssid[1]); - strcat(bssid, tmp); - strcat(bssid, ":"); - sprintf(tmp, "%02x", p->bssid[2]); - strcat(bssid, tmp); - strcat(bssid, ":"); - sprintf(tmp, "%02x", p->bssid[3]); - strcat(bssid, tmp); - strcat(bssid, ":"); - sprintf(tmp, "%02x", p->bssid[4]); - strcat(bssid, tmp); - strcat(bssid, ":"); - sprintf(tmp, "%02x", p->bssid[5]); - strcat(bssid, tmp); - - printf("bssid = %s\n", bssid); -} - -static int check_stored_profile(A_UINT8 *bssid) -{ - FILE *fp; - char buffer[128]; - char full_cmd[256]; -// char *cmd = "../../.output/LOCAL_i686-SDIO/image/wpa_cli list_networks | grep -o \'\\w\\w:\\w\\w:\\w\\w:\\w\\w:\\w\\w:\\w\\w\'"; - - memset(full_cmd, '\0', 256); - strcpy(full_cmd, exec_path); - strcat(full_cmd, "../../.output/LOCAL_i686-SDIO/image/wpa_cli list_networks | grep -o \'\\w\\w:\\w\\w:\\w\\w:\\w\\w:\\w\\w:\\w\\w\'"); - - memset(buffer, '\0', 128); - fp = popen(full_cmd, "r"); - fgets(buffer, 128, fp); - pclose(fp); - - if (buffer[0] == '\0') { - printf("no stored profile\n"); - return 1; - } - - printf("profile bssid = %s\n", buffer); - - bssid[0] = htoi(buffer[0]) * 16 + htoi(buffer[1]); - bssid[1] = htoi(buffer[3]) * 16 + htoi(buffer[4]); - bssid[2] = htoi(buffer[6]) * 16 + htoi(buffer[7]); - bssid[3] = htoi(buffer[9]) * 16 + htoi(buffer[10]); - bssid[4] = htoi(buffer[12]) * 16 + htoi(buffer[13]); - bssid[5] = htoi(buffer[15]) * 16 + htoi(buffer[16]); - - printf("bssid in decimal: %d:%d:%d:%d:%d:%d\n", - bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]); - - return 0; -} - -static int match_stored_profile(A_UINT8 *myBssid) -{ - int i; - - for (i = 0; i < MAX_WAC_BSS; i++) { - if (0 == A_MEMCMP(myBssInfo[i].bssid, myBssid, 6)) { - break; - } - } - - if (i < MAX_WAC_BSS) { - printf("matched profile: %d\n", i); - return i; - } - else { - printf("no matched profile: %d\n", i); - return -1; - } -} - -static int select_best_bss() -{ - return 0; -} - -static void wpa_profile_reconnect(void) -{ - char full_cmd[128]; - - memset(full_cmd, '\0', 128); - strcpy(full_cmd, exec_path); - system(strcat(full_cmd, "../../.output/LOCAL_i686-SDIO/image/wpa_cli ap_scan 1")); - - memset(full_cmd, '\0', 128); - strcpy(full_cmd, exec_path); - system(strcat(full_cmd, "../../.output/LOCAL_i686-SDIO/image/wpa_cli save_config")); - - memset(full_cmd, '\0', 128); - strcpy(full_cmd, exec_path); - system(strcat(full_cmd, "../../.output/LOCAL_i686-SDIO/image/wpa_cli reconfigure")); - - // wpa_cli ap_scan 1 - // wpa_cli save_config - // wpa_cli reconfigure - // wpa_cli ap_scan 0 - // wpa_cli save_config -} - -static int wps_start(void) -{ - char full_cmd[128]; - char which_bssid[32]; - int ret = 0; - - memset(full_cmd, '\0', 128); - strcpy(full_cmd, exec_path); - system(strcat(full_cmd, "../../.output/LOCAL_i686-SDIO/image/wpa_cli ap_scan 1")); - - memset(full_cmd, '\0', 128); - strcpy(full_cmd, exec_path); - system(strcat(full_cmd, "../../.output/LOCAL_i686-SDIO/image/wpa_cli save_config")); - - memset(full_cmd, '\0', 128); - strcpy(full_cmd, exec_path); - system(strcat(full_cmd, "../../.output/LOCAL_i686-SDIO/image/wpa_cli reconfigure")); - - memset(which_bssid, '\0', 32); - getBssid(which_bssid); - - memset(full_cmd, '\0', 128); - strcpy(full_cmd, exec_path); - strcat(full_cmd, "../../.output/LOCAL_i686-SDIO/image/wpa_cli wps_pin "); - strcat(full_cmd, which_bssid); - strcat(full_cmd, " "); - strcat(full_cmd, wps_pin); - - wps_pending = 1; - printf("wps_start: %s\n", full_cmd); - - ret = system(full_cmd); - - return ret; -} - - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) -int app_extract_events(struct event_list* list, - struct iw_event * iwe); -#endif -static void -event_rtm_newlink(struct nlmsghdr *h, int len); - -static void -event_wireless(A_INT8 *data, int len); - -int -string_search(FILE *fp, char *string) -{ - char str[DBGLOG_DBGID_DEFINITION_LEN_MAX]; - - rewind(fp); - memset(str, 0, DBGLOG_DBGID_DEFINITION_LEN_MAX); - while (!feof(fp)) { - fscanf(fp, "%s", str); - if (strstr(str, string)) return 1; - } - - return 0; -} - -#define RECEVENT_DEBUG_PRINTF(args...) - -int s; //socket -int main(int argc, char** argv) -{ -// int s, c, ret; -// int s; - struct sockaddr_nl local; - struct sockaddr_nl from; - socklen_t fromlen; - struct nlmsghdr *h; - char buf[16384]; - int left; - FILE *fp; - char *cmd = "pwd"; - int len; - - //DBG - if (argc == 2) { - fakeId = atoi(argv[1]); - } - - // determine execution path - memset(exec_path, '\0', 128); - fp = popen(cmd, "r"); - fgets(exec_path, 128, fp); - pclose(fp); - - len = strlen(exec_path); - if ( '\n' == exec_path[len-1] ) { - exec_path[len-1] = '/'; - } - else { - exec_path[len] = '/'; - } - - printf("exec_path = %s\n", exec_path); - - s = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); - if (s < 0) { - perror("socket(PF_NETLINK,SOCK_RAW,NETLINK_ROUTE)"); - return -1; - } - - memset(&local, 0, sizeof(local)); - local.nl_family = AF_NETLINK; - local.nl_groups = RTMGRP_LINK; - if (bind(s, (struct sockaddr *) &local, sizeof(local)) < 0) { - perror("bind(netlink)"); - close(s); - return -1; - } - - while (1) { - fromlen = sizeof(from); - left = recvfrom(s, buf, sizeof(buf), 0, - (struct sockaddr *) &from, &fromlen); - if (left < 0) { - if (errno != EINTR && errno != EAGAIN) - perror("recvfrom(netlink)"); - break; - } - - h = (struct nlmsghdr *) buf; - - while (left >= sizeof(*h)) { - int len, plen; - - len = h->nlmsg_len; - plen = len - sizeof(*h); - if (len > left || plen < 0) { - perror("Malformed netlink message: "); - break; - } - - switch (h->nlmsg_type) { - case RTM_NEWLINK: - event_rtm_newlink(h, plen); - break; - case RTM_DELLINK: - RECEVENT_DEBUG_PRINTF("DELLINK\n"); - break; - default: - RECEVENT_DEBUG_PRINTF("OTHERS\n"); - } - - len = NLMSG_ALIGN(len); - left -= len; - h = (struct nlmsghdr *) ((char *) h + len); - } - } - - close(s); - return 0; -} - -static void -event_rtm_newlink(struct nlmsghdr *h, int len) -{ - struct ifinfomsg *ifi; - int attrlen, nlmsg_len, rta_len; - struct rtattr * attr; - - if (len < sizeof(*ifi)) { - perror("too short\n"); - return; - } - - ifi = NLMSG_DATA(h); - - nlmsg_len = NLMSG_ALIGN(sizeof(struct ifinfomsg)); - - attrlen = h->nlmsg_len - nlmsg_len; - if (attrlen < 0) { - perror("bad attren\n"); - return; - } - - attr = (struct rtattr *) (((char *) ifi) + nlmsg_len); - - rta_len = RTA_ALIGN(sizeof(struct rtattr)); - while (RTA_OK(attr, attrlen)) { - if (attr->rta_type == IFLA_WIRELESS) { - event_wireless( ((A_INT8*)attr) + rta_len, attr->rta_len - rta_len); - } else if (attr->rta_type == IFLA_IFNAME) { - - } - attr = RTA_NEXT(attr, attrlen); - } -} - -#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) -/*------------------------------------------------------------------*/ -/* - * Extract the next event from the event list. - */ -int -app_extract_events(struct event_list* list, /* list of events */ - struct iw_event * iwe /* Extracted event */ - ) -{ - const struct ath_ioctl_description * descr = NULL; - int event_type = 0; - unsigned int event_len = 1; /* Invalid */ - A_INT8 * pointer; - A_INT16 we_version = ATH_WE_VERSION; - unsigned cmd_index; - - /* Check for end of list */ - if((list->current + IW_EV_LCP_PK_LEN) > list->end) - return(0); - - /* Extract the event header (to get the event id). - * Note : the event may be unaligned, therefore copy... */ - memcpy((char *) iwe, list->current, IW_EV_LCP_PK_LEN); - - /* Check invalid events */ - if(iwe->len <= IW_EV_LCP_PK_LEN) - return(-1); - - /* Get the type and length of that event */ - if(iwe->cmd <= SIOCIWLAST) - { - cmd_index = iwe->cmd - SIOCIWFIRST; - if(cmd_index < standard_ioctl_num) - descr = &(standard_ioctl_descr[cmd_index]); - } - else - { - cmd_index = iwe->cmd - IWEVFIRST; - if(cmd_index < standard_event_num) - descr = &(standard_event_descr[cmd_index]); - } - if(descr != NULL) - event_type = descr->header_type; - /* Unknown events -> event_type=0 => IW_EV_LCP_PK_LEN */ - event_len = event_type_size[event_type]; - /* Fixup for earlier version of WE */ - if((we_version <= 18) && (event_type == ATH_WE_HEADER_TYPE_POINT)) - event_len += IW_EV_POINT_OFF; - - /* Check if we know about this event */ - if(event_len <= IW_EV_LCP_PK_LEN) - { - /* Skip to next event */ - list->current += iwe->len; - return(2); - } - event_len -= IW_EV_LCP_PK_LEN; - - /* Set pointer on data */ - if(list->value != NULL) - pointer = list->value; /* Next value in event */ - else - pointer = list->current + IW_EV_LCP_PK_LEN; /* First value in event */ - - /* Copy the rest of the event (at least, fixed part) */ - if((pointer + event_len) > list->end) - { - /* Go to next event */ - list->current += iwe->len; - return(-2); - } - /* Fixup for WE-19 and later : pointer no longer in the list */ - /* Beware of alignement. Dest has local alignement, not packed */ - if((we_version > 18) && (event_type == ATH_WE_HEADER_TYPE_POINT)) - memcpy((char *) iwe + IW_EV_LCP_LEN + IW_EV_POINT_OFF, - pointer, event_len); - else - memcpy((char *) iwe + IW_EV_LCP_LEN, pointer, event_len); - - /* Skip event in the stream */ - pointer += event_len; - - /* Special processing for iw_point events */ - if(event_type == ATH_WE_HEADER_TYPE_POINT) - { - /* Check the length of the payload */ - unsigned int extra_len = iwe->len - (event_len + IW_EV_LCP_PK_LEN); - if(extra_len > 0) - { - /* Set pointer on variable part (warning : non aligned) */ - iwe->u.data.pointer = pointer; - - /* Check that we have a descriptor for the command */ - if(descr == NULL) - /* Can't check payload -> unsafe... */ - iwe->u.data.pointer = NULL; /* Discard paylod */ - else - { - /* Those checks are actually pretty hard to trigger, - * because of the checks done in the kernel... */ - - unsigned int token_len = iwe->u.data.length * descr->token_size; - - /* Ugly fixup for alignement issues. - * If the kernel is 64 bits and userspace 32 bits, - * we have an extra 4+4 bytes. - * Fixing that in the kernel would break 64 bits userspace. */ - if((token_len != extra_len) && (extra_len >= 4)) - { - A_UINT16 alt_dlen = *((A_UINT16 *) pointer); - unsigned int alt_token_len = alt_dlen * descr->token_size; - if((alt_token_len + 8) == extra_len) - { - /* Ok, let's redo everything */ - pointer -= event_len; - pointer += 4; - /* Dest has local alignement, not packed */ - memcpy((char*) iwe + IW_EV_LCP_LEN + IW_EV_POINT_OFF, - pointer, event_len); - pointer += event_len + 4; - iwe->u.data.pointer = pointer; - token_len = alt_token_len; - } - } - - /* Discard bogus events which advertise more tokens than - * what they carry... */ - if(token_len > extra_len) - iwe->u.data.pointer = NULL; /* Discard paylod */ - /* Check that the advertised token size is not going to - * produce buffer overflow to our caller... */ - if((iwe->u.data.length > descr->max_tokens) - && !(descr->flags & ATH_WE_DESCR_FLAG_NOMAX)) - iwe->u.data.pointer = NULL; /* Discard paylod */ - /* Same for underflows... */ - if(iwe->u.data.length < descr->min_tokens) - iwe->u.data.pointer = NULL; /* Discard paylod */ - } - } - else - /* No data */ - iwe->u.data.pointer = NULL; - - /* Go to next event */ - list->current += iwe->len; - } - else - { - /* Ugly fixup for alignement issues. - * If the kernel is 64 bits and userspace 32 bits, - * we have an extra 4 bytes. - * Fixing that in the kernel would break 64 bits userspace. */ - if((list->value == NULL) - && ((((iwe->len - IW_EV_LCP_PK_LEN) % event_len) == 4) - || ((iwe->len == 12) && ((event_type == ATH_WE_HEADER_TYPE_UINT) || - (event_type == ATH_WE_HEADER_TYPE_QUAL))) )) - { - pointer -= event_len; - pointer += 4; - /* Beware of alignement. Dest has local alignement, not packed */ - memcpy((char *) iwe + IW_EV_LCP_LEN, pointer, event_len); - pointer += event_len; - } - - /* Is there more value in the event ? */ - if((pointer + event_len) <= (list->current + iwe->len)) - /* Go to next value */ - list->value = pointer; - else - { - /* Go to next event */ - list->value = NULL; - list->current += iwe->len; - } - } - return(1); -} -#endif /*#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) */ - -static void -event_wireless(A_INT8 *data, int len) -{ - A_INT8 *pos, *end, *custom, *buf; - A_UINT16 eventid; -// int status; -// static int wps = 0; -// A_STATUS status; - - pos = data; - end = data + len; - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) - struct iw_event iwe; - struct event_list list; - int ret; - - /* Cleanup */ - memset((char *) &list, '\0', sizeof(struct event_list)); - - /* Set things up */ - list.current = data; - list.end = data + len; - - do - { - /* Extract an event and print it */ - ret = app_extract_events(&list, &iwe); - if(ret != 0) - { - RECEVENT_DEBUG_PRINTF("\n cmd = %x, length = %d, ",iwe.cmd,iwe.u.data.length); - - switch (iwe.cmd) { - case IWEVCUSTOM: - custom = pos + IW_EV_POINT_LEN; - if (custom + iwe.u.data.length > end) - return; - buf = malloc(iwe.u.data.length + 1); - if (buf == NULL) return; - memcpy(buf, custom, iwe.u.data.length); - eventid = *((A_UINT16*)buf); - RECEVENT_DEBUG_PRINTF("\n eventid = %x",eventid); - - switch (eventid) { - case (WMI_READY_EVENTID): - printf("event = Wmi Ready, len = %d\n", iwe.u.data.length); -// status = app_wmiready_event_rx((A_UINT8 *)(buf + ID_LEN), iwe.u.data.length - ID_LEN); - break; - case (WMI_DISCONNECT_EVENTID): - printf("event = Wmi Disconnect, len = %d\n", iwe.u.data.length); - if (wps_pending) { - char full_cmd[128]; - - memset(full_cmd, '\0', 128); - strcpy(full_cmd, exec_path); - system(strcat(full_cmd, "../../.output/LOCAL_i686-SDIO/image/wpa_cli ap_scan 1")); - - memset(full_cmd, '\0', 128); - strcpy(full_cmd, exec_path); - system(strcat(full_cmd, "../../.output/LOCAL_i686-SDIO/image/wpa_cli save_config")); - - wps_pending = 0; - } -// status = app_disconnect_event_rx((A_UINT8 *)(buf + ID_LEN), iwe.u.data.length - ID_LEN); - break; - case (WMI_SCAN_COMPLETE_EVENTID): - printf("event = Wmi Scan Complete, len = %d\n", iwe.u.data.length); -// status = app_scan_complete_event_rx((A_UINT8 *)(buf + ID_LEN), iwe.u.data.length - ID_LEN); - break; - case (WMI_WAC_SCAN_DONE_EVENTID): - { - char ifname[IFNAMSIZ]; - struct ifreq ifr; - char *ethIf; - char *buf = malloc(256); - WMI_WAC_SCAN_REPLY_CMD *cmd = (WMI_WAC_SCAN_REPLY_CMD *)(buf+4); - int matched = 0, has_profile = 0; - - memset(buf, 0, sizeof(buf)); - memset(ifname, '\0', IFNAMSIZ); - - if ((ethIf = getenv("NETIF")) == NULL) { - ethIf = "eth1"; - } - strcpy(ifname, ethIf); - strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); - - printf("event = WAC scan done, len = %d\n", iwe.u.data.length); - - if (myBssCnt == 0) { - cmd->cmdid = -1; //no BSS, continue WAC scan - } - else { - A_UINT8 myBssid[6]; - // TODO: choose best BSS to connect - // OR match stored profile - if (check_stored_profile(myBssid)) { - // no stored profile, select best BSS to connect - has_profile = 0; - } - else { - has_profile = 1; - // has stored profile, match BSS with stored profile - if ( match_stored_profile(myBssid) >= 0 ) { - matched = 1; - } - } - - if (!matched || !has_profile) { - cmd->cmdid = select_best_bss(); - } - else { - // either has profile or found matched profile - // stop WAC scan - cmd->cmdid = -2; - } - } - - //DBG - if (fakeId != 0) { - cmd->cmdid = fakeId; //fake BSS info - } - printf("Sending WAC scan reply %d\n", cmd->cmdid); - - ((int *)buf)[0] = AR6000_XIOCTL_WAC_SCAN_REPLY; - ifr.ifr_data = buf; - if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) - { - err(1, "%s", ifr.ifr_name); - } - - if ( -2 == cmd->cmdid ) { - // stop WAC scan -> reconnect - wpa_profile_reconnect(); - } - - break; - } - case WMI_WAC_REPORT_BSS_EVENTID: - { - A_INT8 *rxB = buf+2; - WMI_BSS_INFO_HDR2 *p; - if (myBssCnt >= MAX_WAC_BSS) { - printf("Too many bss reported, quitting\n"); - break; - } - -// printf("event = WAC report bss, len = %d\n", iwe.u.data.length); - - p = &myBssInfo[myBssCnt++]; - memcpy((A_UINT8 *)p, rxB, sizeof(WMI_BSS_INFO_HDR2)); - - p = (WMI_BSS_INFO_HDR2 *) rxB; - printf("event = WAC report bss: %x:%x:%x:%x:%x:%x\n", - p->bssid[0], - p->bssid[1], - p->bssid[2], - p->bssid[3], - p->bssid[4], - p->bssid[5]); - break; - } - case WMI_WAC_START_WPS_EVENTID: -// printf("wps start\n"); - if (wps_start()) { - printf("wps start failed\n"); - } - break; - - default: - RECEVENT_DEBUG_PRINTF("Host received other event with id 0x%x\n", - eventid); - break; - } - free(buf); - break; - case IWEVGENIE: - custom = pos + IW_EV_POINT_LEN; - if (custom + iwe.u.data.length > end) - return; - buf = malloc(iwe.u.data.length + 1); - if (buf == NULL) return; - memcpy(buf, custom, iwe.u.data.length); - eventid = *((A_UINT16*)buf); - - switch (eventid) { - case (WMI_CONNECT_EVENTID): - { - char ifname[IFNAMSIZ]; - struct ifreq ifr; - char *ethIf; - char *buf = malloc(256); - WMI_WAC_ENABLE_CMD *cmd = (WMI_WAC_ENABLE_CMD *)(buf+4); - - memset(buf, 0, sizeof(buf)); - memset(ifname, '\0', IFNAMSIZ); - - if ((ethIf = getenv("NETIF")) == NULL) { - ethIf = "eth1"; - } - strcpy(ifname, ethIf); - strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); - - ((int *)buf)[0] = AR6000_XIOCTL_WMI_ENABLE_WAC_PARAM; - cmd->enable = 0; - ifr.ifr_data = buf; - if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) - { - err(1, "%s", ifr.ifr_name); - } - printf("event = Wmi Connect, len = %d\n", iwe.u.data.length); - printf("disabling WAC\n"); - if (!wps_pending) { - char full_cmd[128]; - - memset(full_cmd, '\0', 128); - strcpy(full_cmd, exec_path); - system(strcat(full_cmd, "../../.output/LOCAL_i686-SDIO/image/wpa_cli ap_scan 0")); - - memset(full_cmd, '\0', 128); - strcpy(full_cmd, exec_path); - system(strcat(full_cmd, "../../.output/LOCAL_i686-SDIO/image/wpa_cli save_config")); - } - -// status = app_connect_event_rx((A_UINT8 *)(buf + ID_LEN), iwe.u.data.length - ID_LEN); - break; - } - case WMI_ENABLE_WAC_CMDID: - { - WMI_WAC_ENABLE_CMD *cmd = (WMI_WAC_ENABLE_CMD *)(buf+2); - - wac_enable(s, cmd->enable, cmd->period, cmd->threshold, cmd->rssi); - break; - } - default: - break; - } - free(buf); - break; - - default: - RECEVENT_DEBUG_PRINTF("event = Others\n"); - break; - } - } - } - while(ret > 0); - -#endif -} - diff --git a/drivers/net/wireless/ar6003/host/lib/wac/wac_lib_api.h b/drivers/net/wireless/ar6003/host/lib/wac/wac_lib_api.h deleted file mode 100644 index 72b1a22adb04..000000000000 --- a/drivers/net/wireless/ar6003/host/lib/wac/wac_lib_api.h +++ /dev/null @@ -1,92 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef __WAC_LIB_API_H__ -#define __WAC_LIB_API_H__ - -#include "wac_defs.h" - -/* - * Function to enable or disable the WAC feature. This is the entry point to WAC when the - * user pushed a button on the remote - * Input arguments: - * s - open file descriptor of socket - * enable - flag to enable/disable WAC. 1 = enable; 0 = disable - * for disablethe remaining arguments are don't cares - * period - time in milliseconds between consecutive scans when WAC is enabled - * scan_thres - number of scan retries before the STA gave up on looking for WAC AP - * rssi_thres - RSSI threshold the STA will check in beacon or probe response frames - * to qualify a WAC AP. This is absolute value of the signal strength in dBm - * Return value: - * 0 = success; -1 = failure - * - * Examples: - * To enable WAC: wac_enable(s, 1, 2000, 3, 25) - * - WAC enabled with 2-second interval between scans for up to 3 tries. RSSI threshold is -25dBm - * To disable WAC: wac_enable(s, 0, 0, 0, 0) - * - When the flag is disable, the rest of arguments are don't cares - */ -int wac_enable(int s, int enable, unsigned int period, unsigned int scan_thres, int rssi_thres); - -/* - * Function for I/O Control Request for Samsung IE as specified version 1.2 protocol - * Input arguments: - * s - open file descriptor for socket - * req - request type takes the possible values: - * WAC_SET - * WAC_GET - * cmd - command takes the possible values: - * WAC_ADD - * WAC_DEL - * WAC_GET_STATUS - * frm - frame type takes the possible values: - * PRBREQ (for STA) - * PRBRSP (for AP) - * BEACON (for AP) - * ie - pointer to char string that contains the IE to set or get - * ret_val - indicates whether the control request is successful - * 0 = success; -1 = failure - * status - status code returned by STA that takes possible values: - * WAC_FAILED_NO_WAC_AP - * WAC_FAILED_LOW_RSSI - * WAC_FAILED_INVALID_PARAM - * WAC_FAILED_REJECTED - * WAC_SUCCESS - * WAC_PROCEED_FIRST_PHASE - * WAC_PROCEED_SECOND_PHASE - * WAC_DISABLED - * Examples: - * To insert an IE into the probe request frame: - * wac_control_request(WAC_SET, WAC_ADD, PRBREQ, - * "0x0012fb0100010101083132333435363730" val, status) - * To query the WAC status from STA: - * wac_control_request(WAC_GET, WAC_GET_STATUS, NULL, NULL, val, status) - */ -void wac_control_request( int s, - WAC_REQUEST_TYPE req, - WAC_COMMAND cmd, - WAC_FRAME_TYPE frm, - char *ie, - int *ret_val, - WAC_STATUS *status ); - -#endif diff --git a/drivers/net/wireless/ar6003/host/localmake.linux.inc b/drivers/net/wireless/ar6003/host/localmake.linux.inc deleted file mode 100644 index 9b48f3fc1010..000000000000 --- a/drivers/net/wireless/ar6003/host/localmake.linux.inc +++ /dev/null @@ -1,40 +0,0 @@ -# -# Local Makefile includes for tool and kernel source paths -# -# Copyright 2004-2010 Atheros Communications, Inc. -# -# When creating a new build type, use the following template: -# ifeq ($(ATH_BUILD_TYPE),) -# ATH_ARCH_CPU_TYPE := < cpu architecture > -# ATH_CROSS_COMPILE_TYPE := < cross compiler path > -# ATH_LINUXPATH := < kernel source path > - -ATH_BUILD_TYPE := LOCAL_ARM_RK29 -ATH_BUS_TYPE := SDIO -ATH_LINUXPATH := /home/ko/work/customer/yifang/trunk_exp -ATH_CROSS_COMPILE_TYPE := /home/ko/work/customer/yifang/kernel_rk29_v0.1/toolchain/arm-eabi-4.4.0/bin/arm-eabi- -ATH_ARCH_CPU_TYPE := arm - - - $(info *************************) - $(info PLATFORM: $(ATH_BUILD_TYPE)) - $(info BSP: $(ATH_BSP_TYPE)) - $(info *************************) - # Some environment settings - ATH_BUILD_TYPE=$(ATH_BSP_TYPE)_ARM_NATIVEMMC - ATH_ANDROID_ENV := yes - ATH_SOFTMAC_FILE_USED := no - ATH_DEBUG_DRIVER := yes - ATH_HTC_RAW_INT_ENV :=yes - ATH_AR6K_OTA_TEST_MODE := no - - # Some common variable - ATH_BUS_TYPE := SDIO - ATH_OS_SUB_TYPE := linux_2_6 - ATH_BUS_SUBTYPE := linux_sdio - ATH_BUILD_3RDPARTY := no - ATH_CFG80211_ENV := no - ATH_BUILD_SYSTEM_TOOLS := no - ATH_AR6K_HCI_PAL := no - ATH_AR6K_DEBUG_ALLOC := no - ATH_BUILD_P2P :=no diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000/PS_ASIC.pst b/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000/PS_ASIC.pst deleted file mode 100644 index c9c7539bd273..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000/PS_ASIC.pst +++ /dev/null @@ -1,59 +0,0 @@ -// based on 1, change DVDD=0.85V, LPO measure time to 8ms, 1300ms reCal interval -// Radio table TAG -# -[H:S]012C -[H:S]0042 -[H:A]B1 B1 12 00 02 00 01 30 06 00 02 00 00 20 02 00 - 04 00 0C 40 01 00 48 00 00 48 54 9A 02 00 00 08 - 02 00 48 00 89 EE 70 E6 38 00 D8 70 EF 52 02 00 - 00 40 00 00 08 00 31 00 00 00 04 00 10 00 00 00 - B2 B2 -// System config TAG -# -[H:S]0013 -[H:S]009C -[H:A]C1 C1 17 02 02 00 01 30 48 00 0E CC 33 06 01 08 - 64 96 14 05 FF FF 05 80 00 00 FF CC 00 CC 01 00 - 20 80 FF CC 02 CC 04 00 DF EC 43 F8 00 21 00 E0 - FF CC 03 CC 06 00 80 F0 08 28 80 F4 0C 20 80 F8 - 0E 18 80 FC 14 10 80 00 18 08 80 04 16 00 FF CC - 04 CC 01 00 1A 12 40 96 01 C0 28 00 00 00 C0 01 - 40 06 00 01 00 00 C8 00 00 F0 00 00 FF CC 0C CC - 08 00 01 03 00 7E 08 08 00 7E 01 01 00 7E 01 03 - 00 7E 03 03 00 7E 61 63 00 7E 63 65 00 7E 6A 6C - 00 7E FF CC 09 CC 00 C9 FF CC C2 C2 -//Extern 32k + 24Mhz CPU -//# -//[H:S]0021 -//[H:S]0004 -//[H:A]09 00 00 00 -//Bdaddr -//# -//[H:S]0001 -//[H:S]0006 -//[H:A]89 60 41 7f 03 00 -//Audio -# -[H:S]0002 -[H:S]0004 -[H:A]23 08 01 33 -//Audio -# -[H:S]0003 -[H:S]0004 -[H:A]dd e5 2e 00 -//Audio -# -[H:S]0015 -[H:S]0004 -[H:A]12 00 00 00 -//Audio -# -[H:S]0016 -[H:S]0004 -[H:A]00 00 a7 02 -# -//PLC -[H:S]001F -[H:S]0008 -[H:A]01 1A 06 14 50 B4 32 96 diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000/RamPatch.txt b/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000/RamPatch.txt deleted file mode 100644 index badcc110d8e2..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000/RamPatch.txt +++ /dev/null @@ -1,2 +0,0 @@ -0569 -000000000e20000050800000000158000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d0915300d4915300d8915300dc91530098b0530064ce5300f8d2530008e7530008d253000cd2530098d95300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ff051001010101ffffff50500101010180019800c8019800f4029800d0039800380498001404980024059800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000366100ad0581c206bd01e00800bd0a17641c0c0abd05815d080c0ce00800bd02dd03ed05815c080c0ce00800c60400ad05c1f802922b11819903c09920926b11e008000c021df0003681001c0e516d030c0720d074d241107911d0cd90b805a0cc11cabbb90160e6030c2a609034972a026062003801e2c1102203068d07cc8260e613102000fd061df072631122011072434fc805204290a044114acc882c0c1980a00407e805820c4b07e8079c7aa20c4b07ea12a2c3340c0b0cfc0c198191029911e008000c1972434ec805e8114acca82cd20c4ba0a00416aa0590fd20f24c4bcc4e820349f65878a1b1039805a20a034a9992990980aa01a0a831909821809901909831a7294a0c5a81bc04bd02e00800cd0aad0281be04e805c0b0744ace920c4b0c4dd09920924c4be008009c7a72434a860400ad020c4b81bf0492a0fe909d10924c4be0080060e613102000ad061df00c1a81bd04bd02e00800cd0a46ecff0c5a81bd04bd02e00800cd0a86e8ff0000368100305074bd0120407481c206ad04e00800922a11216d0390920516890ba18804b16e03c0200040349091f204a03311822992c02000b08810a08820a8028269923aaab20a49d2ca48579b08c20a4bc0c204161c08b24a4ae1d104524d01eae5f20e7fe20e803c29f7be4a1c0b424110d9111c0c1c0f1c0552c110fd05cd0580e6030c2e80d034d72e02806200bd05b20500c20500a802c0bb90a0bb11baaa924a3480e613102000420500d811403490520d01a03311ad04b20d0081c204cd05e00800a802b2a0fb3aaa920a4b0c12b09910924a4b1df00c021df0364100811e0621c0098808921207ece8ecc9e1b103b21206a21ef1b73a210c0a817c03d21ef0c1d603f16c03c80ce20f44a0bd11e0bd93d1d209e00800a252071df00000364100817f04916c03880892092880801466180acc79810d04a2a064e008001df0000000364100c02000c16c03e1940391d9032178030c0dd2628bf20902c02000f0ed83e2628cc02000d2628dc02000d2628e820c43b20c28d19d0210bb01d0bb10cc580cba0c53c600000c0a0c83c020000c1dd2628fc02000a2628ac02000b26289a209020c088cfa661a040c1ac60300662a05a2190026ca040c0a8607000c0af0ba01e1da03a2090ce0bb100c1ea0ae93e1f40230aa11e0aa10b0aa20b1fd03c02000a26bc1f209020c18f62f040c098604009209070c1a909a930c2af09911a09910d09920c02000d17f04926bc6d80de20c28d0d014661d0acc7e810d04a2a064e00800c020003262881df00036410081c305c1900920b074e19605d16e09e80ec02000d22d82b94ed92ec02000b90c30e6030c2a309034972a02306200e00800c02000fd0391250382a10082698000710030e6131020001df0 \ No newline at end of file diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/PS_ASIC.pst b/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/PS_ASIC.pst deleted file mode 100644 index dbfb680e6883..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/PS_ASIC.pst +++ /dev/null @@ -1,68 +0,0 @@ - -// Coex Configuration -# -[H:S]0017 -[H:S]0022 -[H:A]d1 d1 20 00 02 01 02 09 0c 00 24 0f 04 00 00 01 - 00 01 00 01 01 01 01 01 01 00 00 00 01 00 00 00 - d2 d2 -// Radio table TAG -# -[H:S]012C -[H:S]0042 -[H:A]B1 B1 12 00 06 00 01 30 06 00 02 00 00 20 02 00 - 04 00 0C 40 01 00 48 00 00 48 54 9A 02 00 00 08 - 02 00 48 00 89 EE 70 E6 38 00 D8 70 EF 52 02 00 - 00 40 00 00 08 00 31 00 00 00 04 00 10 00 00 00 - B2 B2 -// System config TAG -# -[H:S]0013 -[H:S]00B6 -[H:A]C1 C1 17 02 06 00 01 30 55 00 0E CC 33 06 01 08 - 64 96 14 05 FF FF 05 80 00 00 FF CC 00 CC 01 00 - 20 80 FF CC 02 CC 04 00 DF EC 43 F8 00 21 00 E0 - FF CC 03 CC 06 00 80 F0 08 28 80 F4 0C 20 80 F8 - 0E 18 80 FC 14 10 80 00 18 08 80 04 16 00 FF CC - 04 CC 01 00 1A 12 40 96 01 C0 28 00 00 00 C0 01 - 40 06 00 01 00 00 C8 00 00 F0 00 00 FF CC 0C CC - 08 00 01 03 00 7E 08 08 00 7E 01 01 00 7E 01 03 - 00 7E 03 03 00 7E 61 63 00 7E 63 65 00 7E 6A 6C - 00 7E FF CC 09 CC 00 C9 FF CC 0B CC 0A 17 07 B2 - 5E 01 52 0A 60 09 05 06 14 4B 00 00 58 02 D0 07 - 00 41 FF CC C2 C2 -//Extern 32k + 24Mhz CPU -//# -//[H:S]0021 -//[H:S]0004 -//[H:A]09 00 00 00 -//Bdaddr -//# -//[H:S]0001 -//[H:S]0006 -//[H:A]89 60 41 7f 03 00 -//Audio -# -[H:S]0002 -[H:S]0004 -[H:A]23 08 01 33 -//Audio -# -[H:S]0003 -[H:S]0004 -[H:A]dd e5 2e 00 -//Audio -# -[H:S]0015 -[H:S]0004 -[H:A]12 00 00 00 -//Audio -# -[H:S]0016 -[H:S]0004 -[H:A]00 00 a7 02 -# -//PLC -[H:S]001F -[H:S]0008 -[H:A]01 1A 06 14 50 B4 32 96 diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/PS_ASIC_aclHighPri.pst b/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/PS_ASIC_aclHighPri.pst deleted file mode 100644 index dbfb680e6883..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/PS_ASIC_aclHighPri.pst +++ /dev/null @@ -1,68 +0,0 @@ - -// Coex Configuration -# -[H:S]0017 -[H:S]0022 -[H:A]d1 d1 20 00 02 01 02 09 0c 00 24 0f 04 00 00 01 - 00 01 00 01 01 01 01 01 01 00 00 00 01 00 00 00 - d2 d2 -// Radio table TAG -# -[H:S]012C -[H:S]0042 -[H:A]B1 B1 12 00 06 00 01 30 06 00 02 00 00 20 02 00 - 04 00 0C 40 01 00 48 00 00 48 54 9A 02 00 00 08 - 02 00 48 00 89 EE 70 E6 38 00 D8 70 EF 52 02 00 - 00 40 00 00 08 00 31 00 00 00 04 00 10 00 00 00 - B2 B2 -// System config TAG -# -[H:S]0013 -[H:S]00B6 -[H:A]C1 C1 17 02 06 00 01 30 55 00 0E CC 33 06 01 08 - 64 96 14 05 FF FF 05 80 00 00 FF CC 00 CC 01 00 - 20 80 FF CC 02 CC 04 00 DF EC 43 F8 00 21 00 E0 - FF CC 03 CC 06 00 80 F0 08 28 80 F4 0C 20 80 F8 - 0E 18 80 FC 14 10 80 00 18 08 80 04 16 00 FF CC - 04 CC 01 00 1A 12 40 96 01 C0 28 00 00 00 C0 01 - 40 06 00 01 00 00 C8 00 00 F0 00 00 FF CC 0C CC - 08 00 01 03 00 7E 08 08 00 7E 01 01 00 7E 01 03 - 00 7E 03 03 00 7E 61 63 00 7E 63 65 00 7E 6A 6C - 00 7E FF CC 09 CC 00 C9 FF CC 0B CC 0A 17 07 B2 - 5E 01 52 0A 60 09 05 06 14 4B 00 00 58 02 D0 07 - 00 41 FF CC C2 C2 -//Extern 32k + 24Mhz CPU -//# -//[H:S]0021 -//[H:S]0004 -//[H:A]09 00 00 00 -//Bdaddr -//# -//[H:S]0001 -//[H:S]0006 -//[H:A]89 60 41 7f 03 00 -//Audio -# -[H:S]0002 -[H:S]0004 -[H:A]23 08 01 33 -//Audio -# -[H:S]0003 -[H:S]0004 -[H:A]dd e5 2e 00 -//Audio -# -[H:S]0015 -[H:S]0004 -[H:A]12 00 00 00 -//Audio -# -[H:S]0016 -[H:S]0004 -[H:A]00 00 a7 02 -# -//PLC -[H:S]001F -[H:S]0008 -[H:A]01 1A 06 14 50 B4 32 96 diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/PS_ASIC_aclLowPri.pst b/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/PS_ASIC_aclLowPri.pst deleted file mode 100644 index b2b9e3bc4b5b..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/PS_ASIC_aclLowPri.pst +++ /dev/null @@ -1,68 +0,0 @@ - -// Coex Configuration -# -[H:S]0017 -[H:S]0022 -[H:A]d1 d1 20 00 02 01 02 09 0c 00 24 0f 04 00 00 01 - 00 01 00 00 01 01 01 01 01 00 00 00 01 00 00 00 - d2 d2 -// Radio table TAG -# -[H:S]012C -[H:S]0042 -[H:A]B1 B1 12 00 06 00 01 30 06 00 02 00 00 20 02 00 - 04 00 0C 40 01 00 48 00 00 48 54 9A 02 00 00 08 - 02 00 48 00 89 EE 70 E6 38 00 D8 70 EF 52 02 00 - 00 40 00 00 08 00 31 00 00 00 04 00 10 00 00 00 - B2 B2 -// System config TAG -# -[H:S]0013 -[H:S]00B6 -[H:A]C1 C1 17 02 06 00 01 30 55 00 0E CC 33 06 01 08 - 64 96 14 05 FF FF 05 80 00 00 FF CC 00 CC 01 00 - 20 80 FF CC 02 CC 04 00 DF EC 43 F8 00 21 00 E0 - FF CC 03 CC 06 00 80 F0 08 28 80 F4 0C 20 80 F8 - 0E 18 80 FC 14 10 80 00 18 08 80 04 16 00 FF CC - 04 CC 01 00 1A 12 40 96 01 C0 28 00 00 00 C0 01 - 40 06 00 01 00 00 C8 00 00 F0 00 00 FF CC 0C CC - 08 00 01 03 00 7E 08 08 00 7E 01 01 00 7E 01 03 - 00 7E 03 03 00 7E 61 63 00 7E 63 65 00 7E 6A 6C - 00 7E FF CC 09 CC 00 C9 FF CC 0B CC 0A 17 07 B2 - 5E 01 52 0A 60 09 05 06 14 4B 00 00 58 02 D0 07 - 00 41 FF CC C2 C2 -//Extern 32k + 24Mhz CPU -//# -//[H:S]0021 -//[H:S]0004 -//[H:A]09 00 00 00 -//Bdaddr -//# -//[H:S]0001 -//[H:S]0006 -//[H:A]89 60 41 7f 03 00 -//Audio -# -[H:S]0002 -[H:S]0004 -[H:A]23 08 01 33 -//Audio -# -[H:S]0003 -[H:S]0004 -[H:A]dd e5 2e 00 -//Audio -# -[H:S]0015 -[H:S]0004 -[H:A]12 00 00 00 -//Audio -# -[H:S]0016 -[H:S]0004 -[H:A]00 00 a7 02 -# -//PLC -[H:S]001F -[H:S]0008 -[H:A]01 1A 06 14 50 B4 32 96 diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/RamPatch.txt b/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/RamPatch.txt deleted file mode 100644 index badcc110d8e2..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30000coex/RamPatch.txt +++ /dev/null @@ -1,2 +0,0 @@ -0569 -000000000e20000050800000000158000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d0915300d4915300d8915300dc91530098b0530064ce5300f8d2530008e7530008d253000cd2530098d95300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ff051001010101ffffff50500101010180019800c8019800f4029800d0039800380498001404980024059800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000366100ad0581c206bd01e00800bd0a17641c0c0abd05815d080c0ce00800bd02dd03ed05815c080c0ce00800c60400ad05c1f802922b11819903c09920926b11e008000c021df0003681001c0e516d030c0720d074d241107911d0cd90b805a0cc11cabbb90160e6030c2a609034972a026062003801e2c1102203068d07cc8260e613102000fd061df072631122011072434fc805204290a044114acc882c0c1980a00407e805820c4b07e8079c7aa20c4b07ea12a2c3340c0b0cfc0c198191029911e008000c1972434ec805e8114acca82cd20c4ba0a00416aa0590fd20f24c4bcc4e820349f65878a1b1039805a20a034a9992990980aa01a0a831909821809901909831a7294a0c5a81bc04bd02e00800cd0aad0281be04e805c0b0744ace920c4b0c4dd09920924c4be008009c7a72434a860400ad020c4b81bf0492a0fe909d10924c4be0080060e613102000ad061df00c1a81bd04bd02e00800cd0a46ecff0c5a81bd04bd02e00800cd0a86e8ff0000368100305074bd0120407481c206ad04e00800922a11216d0390920516890ba18804b16e03c0200040349091f204a03311822992c02000b08810a08820a8028269923aaab20a49d2ca48579b08c20a4bc0c204161c08b24a4ae1d104524d01eae5f20e7fe20e803c29f7be4a1c0b424110d9111c0c1c0f1c0552c110fd05cd0580e6030c2e80d034d72e02806200bd05b20500c20500a802c0bb90a0bb11baaa924a3480e613102000420500d811403490520d01a03311ad04b20d0081c204cd05e00800a802b2a0fb3aaa920a4b0c12b09910924a4b1df00c021df0364100811e0621c0098808921207ece8ecc9e1b103b21206a21ef1b73a210c0a817c03d21ef0c1d603f16c03c80ce20f44a0bd11e0bd93d1d209e00800a252071df00000364100817f04916c03880892092880801466180acc79810d04a2a064e008001df0000000364100c02000c16c03e1940391d9032178030c0dd2628bf20902c02000f0ed83e2628cc02000d2628dc02000d2628e820c43b20c28d19d0210bb01d0bb10cc580cba0c53c600000c0a0c83c020000c1dd2628fc02000a2628ac02000b26289a209020c088cfa661a040c1ac60300662a05a2190026ca040c0a8607000c0af0ba01e1da03a2090ce0bb100c1ea0ae93e1f40230aa11e0aa10b0aa20b1fd03c02000a26bc1f209020c18f62f040c098604009209070c1a909a930c2af09911a09910d09920c02000d17f04926bc6d80de20c28d0d014661d0acc7e810d04a2a064e00800c020003262881df00036410081c305c1900920b074e19605d16e09e80ec02000d22d82b94ed92ec02000b90c30e6030c2a309034972a02306200e00800c02000fd0391250382a10082698000710030e6131020001df0 \ No newline at end of file diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101/PS_ASIC.pst b/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101/PS_ASIC.pst deleted file mode 100644 index 812e6505df26..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101/PS_ASIC.pst +++ /dev/null @@ -1,65 +0,0 @@ - -// Radio table TAG -# -[H:S]012C -[H:S]0042 -[H:A]B1 B1 12 00 08 00 01 30 06 00 02 00 00 20 02 00 - 04 00 0C 40 01 00 48 00 00 48 54 9A 02 00 00 08 - 02 00 48 00 89 EE 70 E6 38 00 D8 70 EF 52 02 00 - 00 40 00 00 08 00 31 00 00 00 04 00 10 00 00 00 - B2 B2 -// System config TAG -# -[H:S]0013 -[H:S]009C -[H:A]C1 C1 17 02 08 00 01 30 48 00 0E CC 33 26 01 08 - 64 96 14 05 FF FF 05 80 00 00 FF CC 00 CC 01 00 - 20 80 FF CC 02 CC 04 00 DF EC 43 F8 00 21 00 E0 - FF CC 03 CC 06 00 80 F0 08 28 80 F4 0C 20 80 F8 - 0E 18 80 FC 14 10 80 00 18 08 80 04 16 00 FF CC - 04 CC 01 00 1A 12 40 96 01 C0 28 00 00 00 C0 01 - 40 06 00 01 00 00 C8 00 00 F0 00 00 FF CC 0C CC - 08 00 01 03 00 7E 08 08 00 7E 01 01 00 7E 01 03 - 00 7E 03 03 00 7E 61 63 00 7E 63 65 00 7E 6A 6C - 00 7E FF CC 09 CC 00 C9 FF CC C2 C2 -//Extern 32k + 24Mhz CPU -//# -//[H:S]0021 -//[H:S]0004 -//[H:A]09 00 00 00 -//Bdaddr -//# -//[H:S]0001 -//[H:S]0006 -//[H:A]89 60 41 7f 03 00 -//Audio -# -[H:S]0002 -[H:S]0004 -[H:A]23 08 01 33 -//Audio -# -[H:S]0003 -[H:S]0004 -[H:A]dd e5 2e 00 -//Audio -# -[H:S]0015 -[H:S]0004 -[H:A]12 00 00 00 -//Audio -# -[H:S]0016 -[H:S]0004 -[H:A]00 00 a7 02 -# -//PLC -[H:S]001F -[H:S]0008 -[H:A]01 1A 06 14 50 B4 32 96 -//Sniff Recovery -# -[H:S]003D -[H:S]0018 -[H:A]A0 0F 00 00 00 08 00 00 0F 00 7D 04 E8 03 01 00 - 01 00 01 05 00 02 1F 01 diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101/RamPatch.txt b/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101/RamPatch.txt deleted file mode 100644 index 107fd0ff80c5..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101/RamPatch.txt +++ /dev/null @@ -1,2 +0,0 @@ -21c7 -000000000e20000050800000000158000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d8d5530024e7530030e1530060e15300ece1530070e353008ce4530054e1530088e1530040af530088e353008ce35300d4e25300d8e25300fce253003ce3530024e3530054e3530030dd530024b0530078d553000000000000000000000000000000000030d553002ca05300000000000000000000000000000000000000000080019800d80198006c029800ec049800fc0698005c0898009c08980020099800cc099800340a9800340b9800b00b9800700c9800e40c9800580d9800c40d9800300e9800600e9800380f9800d00f9800541198000000000000000000000000000000000084189800501b98000000000000000000000000000000000000000000364100813a03416f0382085148041618040c13bc040c07613b030c02680676942252a1085052821b225a564205062020742654052634026644079205bf1769011b773df04600000c077048c00c024023831df00c021df000364100569208c0200021ce0991f3020c04426992c0200042699398128d04ed0916c9063d09a802c859b809b912a90999028c9ca21e06b82ee00c00860300a21e088bce5c0b81d6020c8de0080098120c4bbcb9c1f302d819c02000ed0cd26c90dd0cc02000426c93c02000a812b26c92a81ac02000b22c910c0cb0bac0a61b04e813a79e0ac0200081f3020c1ff268931df0000036a100a2a0dcbd01810c030c1ce00800a2a0d24bb10c4c421202521201612d0782010092a0d49088827202008a26220280810c030c16e00800313d030c09a203005981076a1690b9a030bba0b21b0407eb0c1b9990907416b9fe4600000c196619040c09c600006d090c19cc290c121df00c2c7951810c03513b03b2a108b0b282b961a8050c02225104baaaa20a1db2a0cdbaaa8bb1e00800721104810c032931a80560d6a0303da0b2030ec2a108c0bb820c4cbaaaa20a1db2a0c8baaacbb1e008008bb10c2c810c03225104a805f831d2030ee2a108e0dd82f971daaaa20a1dd2a0cddaaae00800621104cbb10c4c810c03d861a8052931daaaa20a1dd2a0c8daaae00800e851c831e0e104161e12bd04a13c0381ef02a0ac10e00800d20315b871e881a0f4c0a811faeee040f4b0aac0b20310a020f4d09bc0c2c9feac7df13a03168c0f662c1ff20f539c9f52030e82a108805582813b0388085a88820879513b030b8816880da0f0f4e0a0f4f79a2f0c121df00c0277b60c6097c097bb062bbab794010c12d805e2030ef2a108f0ee82eaddd20d79cc4d82ccfe16d8081df0b941f991d9a1c9b1ba9af7a91a40a2c081b503b841e00800c8b1b841d8a1b08a82f8918a444040f4b941d9a1c9b1ba9f47a91820a4c081b503b841e00800b841c8b1b08a82d8a18a222020f447b204ba222020f4b7b209ba22ba444040f42020f4b092c09084c01658f620a4c016faf59aada0b4c0167bf5b66c404bcac7b40206d3ffd2c2fc47bd02c6d0ff0c021df0ad0c81ef02bd04e0080086b7fff20f53cd09d2cdfed0d07416bff1f66d0246c5ff2bc9d2cdfed0d07486c2ff1c4b673702c6c3ff70e6c0e73b0286c1fff2c2fef0f4c056dfef0c1286beff000000368100815308324114e008003d0a815208ad02e00800d1540837aa070c0aa25202860000a21202c20114daccc20c00921203a0cc827ce4b2cc1fc0bcb3b0b5211bbb40bb10b252019c69815308e008008ceab21203a21201baaa1baa40aa10a25201a13d03720114c20a000c09076c169089a0a088a082180407e80c1b9990907416b9fe4600000c19313b03513a03d2a0c86619070c0b9201004600000c1b9069a0a066a0bcfb0c4c81e905b803d2060ee2a108e0dd82a2a0c8dabbb20b1dd911aaab50bba0e008000c2cd811b80381e905dabbb20b1da2a0cdaaab50bb90b2cb10e00800d2a0c8812d0792a0d4907782b8037a7872078082a1088077820c4c7abbb20b1d81e905daab50bba0e008000c2cb80381e9057abbb20b1da2a0cdaaab50bb90b2cb10e008004bb6a2a0d281e9050c4ce00800a2a0dc0c1c81e905b2c114e00800312e03815508ad02e00800309ac056a909c21201a21202e20114b154080b9e1bdeba8e820800e0d993d0d074a08882dabbf20b00e2c81fa0ff8280e8b3e0e5211beed2cf1ff0dfb340ee10e0e0f4d0d5211bdd40dd10d0d0f4e7bd2582ccfe8080f4825201920b00a09982f2c91f90f9b3f0f5211bff40ff10f0f0f4873f830609002b9c9090f4925201e20b00a0ee82d2ce1fe0deb3d0d5211bdd40dd10d0d0f4d7b902c6d6ff0c0aa25202815308e00800dc1a91b706920907809901909831cc390c0aa252011df00000366100814d08ad02e008000c0541a50862a0d4606382a212016a44b2048a6d0a8cdb261b0b262b52212e031df02d0b1df0b21202821484921483b73837973b34c2cbfea72c1b81ef02e008009c2a815308e00800ccaa81ac07e00800cc2a0c021df0bd03815808ad02e00800b2120292120156bb0d52448a06ebffa13d0352448a920a0072a0cd0769189d0590b9a0a0bba0b21b0407eb0c1b9990907416b9fe4600000c19313b03d2a0c8513a036619070c0b9201004600000c1b9069a0a066a0bceb0c4cb80372060e82a108807782a2a0c87abbb20b1d81e905aaab50bba0e008000c2cb80381e9057abbb20b1da2a0cdaaab50bb90b2cb10e00800d2a0c872a0cdb80342047482a1088044820c4c4abbb20b1d81e905daab50bba0e00800b8030c2c4abbb20b1d81e9057aab50bb90b2cb10e008004bb6a2a0d281e9050c4ce00800815508ad02e00800a020f41df06099c05659ed52448a06c0ff00000036c1002241003241014911592169317941a2a0de0c1cb2c12022412081e90592211ad20164e22118e951d241189971e00800810609ad01e008002d0a1df00000366100a2a0debd01810c030c1ce008004202030c0761590782a0d48087828a66a2067f920100664a1ef6791b817e03c2166aa21669b20202caaab0aac0bd04e00800cc2a1cb21df0520206820202ac45b6352292166962166a0c239a668066c030a6c0817e03bd04e00800165afd2b333030745733e91b777070746697960c021df000003661000c03ad02a901b15907c2a0d4c0c382cabbc20b7f664c22c801d801721b6ab21b69d21d02c21c015d0dd7b7015d077795392d0b6d0c7d0d060d001b333030746693c30c0351cf0642a0ff30b3a050bba0820b00471809814c08a801e00800fc1a1b333030741613fec60d002d0c6d0b0c14bd0540a78281ef02aaa620aac0e00800dc3aa2a06481b503bd04e008001ce9a7b904212e031df01b444040746694d086e5ff0c021df00000364100ad03bd048159080c0ce00800ad058105070c29d21314f10905e8d30c4c0c0bb24316c24301f0ee10e9d3d25501c2132bc25503b24500924504e00800d22311877d17e203c4076e11bd04a2a4300c2cd2030081e3060c3ee00800815008ad03e008001df0003661004081040c0aa25100165808d172085c5ec20301b2030080cc11cabbb0b0f4a0ca90d0cca0f21c021baab79f5bd21c01d25100e2a410e0ebc0166e09f2a411f0fbc016df0882a42c808bc016480892a42d909bc016b907a2a3fda0abc0162a07c2a418c0cbc0166c050c1abd058175080c1ce00800a0a074bd02ed050c1c817408dd01e00800860c00a0a074e79a8f06e8ffad0581da062bb1e00800167a04c20a11b20300376c413c99979b3c81a50592a0f7909c10924a11e008000c021df0bd02ed050c0a0c1c817408dd01e0080006faff60a074bd02ed050c1c817408dd01e0080006f5ffb20300ad02cd03dd05ed06818908fd04e0080086efff00366100612d0782a0d48082828a66f6721481bd05a206a8e00800816108e00800a24301a2440c81a3080c19f20300f24100e20301e24101d203020be5e0e993d24102d20680c20303c241030c2cb20307b24104bd01a20304a24105a2a410e00800b1b70291b302822631a2262d908820b0aa20a2662d8266311df000368100612d0782a0d48082828a66f6722281bd05a206a8e00800816108e00800bd0aa24301921402a13503b2440ca09920925402220300224100f20305f24101e20301e24102d20302d24103d1b702c20303c24104c2262db20306b24105b1b302a20307d0cc20dd01a24106a226319203089241070c19b0aa20821305824108721305b2a42c70784172410942130642410a22130681740820284122410bf20304f2410ce2030ea26631c2662de2410de206801c0c0ba5a0a993e008001df0003661002060f481a408ad06e008002d0a26e61192a06d97160ba2a081a71605b2a06eb7960262a410624100424102bd010c2c0c190be582a0d460a841a24101808382e0e993312d07a2a3eb8a33811b07d20380e00800c1c203b2232dd223317cfee0e230e0dd10d26331c0bb10b2632d1df000003661002060f481a408ad06e008002d0a26e61192a06d97160ba2a081a71605b2a06eb7960262a42c624100424102bd010c2c0c190be582a0d460a841a24101808382e0e993312d07a2a4288a33816e07d20380e00800c1c203b2232dd223317cfee0e230e0dd10d26331c0bb10b2632d1df000003661002060f481a408ad06e0080082a0d480838231a5082d0a8a3326e60592a06d97960262a4108c959203850c1aa09920924385625100a2a3eabd010c2cd203740c190be4811d07e0e993e00800b1c203a2232ac2232e7cfdd0d230d0cc10c2632eb0aa10a2632a1df000003661002060f481a408ad06e0080082a0d480838231a5082d0a8a3326e60592a06d97960262a42c8c959203850c1aa09920924385625100a2a427bd010c2cd203740c190be4811d07e0e993e00800b1c203a2232ac2232e7cfdd0d230d0cc10c2632eb0aa10a2632a1df0000036410081610341b70691b40852a0d45052825a4451c2036224893224859066105033108066106264893264851df0000036410081a408ad02e0080091b706b2a0d4b0b382ba99922989a70909f6733756d5060c021df0f6734b5655ffc21402c0d014c0c20416dc08ad02bd0381b5082c3ce00800c60200ad02bd0381b6082c3ce008000c121df05675fc92140290d014909204160905ad02bd0381b5082c3ce0080006ebff1695fa92140290d014276926ad02bd0381b5082c3ce0080086f0ff92140290d0142769adad02bd0381b5082c3ce0080086eaffad02bd0381b6082c3ce00800c6e6ffad02bd0381b6082c3ce00800c6d6ffad02bd0381b6082c3ce0080046dfff0000003661000c0351a707cd02c91181c606e00800b2a0d4b0b3825a4b921450a099c016590672048581a80721b70662a1e02a2b6a62ad06e00800ad06b2145181aa072901e008009204852d0a771916a2a412d204780c3e81a907b801c2a1edcabb0c2ce00800d811e20484d7161c271e19224484d20478a2a4130c3e81ab07b801c2a1eccabb0c2ce008001b33303074d2c3f6567df71df0000036a100ad05bd0181da06225108e008007d0ac8da21bc03d19b02f13704e1c103176431b21108d70c02c63500922a11d0ac20a9d7f099209267118201000c1fb678028626000c0f20c920e0da20d9d7c26711862200d78c28922a11d0ac20a9d7f09920926711820100cd0af67802062900e0ca2020b920b267110c02c9d7460200e0fc100c1d0c02f02d838207014109056638420c7a812507bd07e00800bc3a8126070c7ae00800ac9aa21301b21302512e03a7bb6481ef02e00800817b08a25301b20100ad03e0080050aac00c19a09583861400c8d71ca240bc10b9d71df0ad0fdd03ed058174080c1ce00800860300bd07cd03dd02817d08a20100e008000c021df060a074dd03ed058174080c1ce0080046faff0c12c6dbffad03817b08b20100e008009d0afcf9ed02a2a3ea0c2cd20700b2c110811d07f207110c2990ff20f24711e00800cd03bd07817c08a21302a2572b92130192572aa20100e00800b8d740bb10b9d706e5ff50c9c056fcf7ad0798d781500840991099d7e008002c021df0364100c16d044c49a2a108813b03a0a2828808718403aa88820824a13d038088a0a088a08208137827908882b1c1048a778817216c039858a848904b457054a058656838ac4560d4b0d81d576d1de2050620d9105a5e8b55270910b0f510f71d0a204510c039104033203958a04b457054a058656084b0ac558818576821881762050678485a568b55206710270710b0951097160a20b510c0a710b0aa20a9481df0000036610056720e0c0b5c8c213a0381ad02ad02e0080082a0faa2a0f092a1e02c8b0c1c4c6d2c0e0caff24254e24243d24244c24224c24226c24242c24245c24246c2424ab25217b24248b2424b925219a2521882521a81e905a2a1040c099901a252265c0a1c4bb24249bd010c2cc242470c4ce00800813e03a2a0ffe00800818c0320e6030c2a209034972a02206200e00800818d03e00800818e03e00800818f03e00800819003e00800819103e00800819203e00800819303e00800819403e00800819503e00800819603e00800819703e00800819803e0080020e6131020008199039d02e00800819a03e008001df0364100cc3322a0641df00c0c0c0a769306a752011bcc1baabd03a2a06481ee02a0ac82e00800a020741df000368100c1a502613b0342a108404282680632a0a84a663a369206bf52262c67e913a21c2582a0808089201baaa25c258246bfc60400921660b206c20c1a001b4000aaa1a09920925660a2130c0cab92031a8178051b9992431ae00800a2431ba2031a0c07b69a0572431a72530c724316724338817905ad02e00800ad02817a05bd03e00800a2165482263bd13c03913b03c16c039809e13a034a99b2091d92292ce0bba0b80b780eb099c0c099109a77707141d077108077c0d07710f07711a7b7017d0aad02bd07cd010c0d81b8035941e00800d13a03b13b035d0ae80bc135034aee920e79f18103ec090c09b62a0582cafd56d80ea21d1ae20d29aacaa2ca14e0ac83a0a0f4a25100463600262a05264a02665a46ad02b21100817b05c13a03920e1dd22e2cc0e9a0e80ef2263be0ddc0e16c03c80ce0dd10daccd13c03c0c141d0cc10f0ccc0d0cc10f0cc11e00800b13b03c13503d13a03f18103880b1c0e4a888208bfa81f27e825f1a502921f261b99925f26c78a32a20d2c47ea2ce09a20817903924d2ce00800b13b03860600c78a17a20d2c476a1181790392a0ef909a10924d2ce00800b13b038841e80bf1c1024aeec20ebfd2a0fbd0cc10d82ec24ebfc2a0bfa80bf0dd204aaa920abfd92ec09910924abf28230c1a8022c0202a931df0a21100881f9911f7e80fc2165477bc09e20d29cc3ef2a4e2f911bd074bc18bd181d703cbe1e0080066550b8ba1cbb181d6034bc1e00800a8214c4cd831b81181c703dabbe00800b13b03c13503d13a03f18103a24316c6c7ff00000036a1000c067cf849612971dd03d981213b0342a0ff8991890191b703a802520904b2a10840e5c016ee0bb0b58272a0a8baaaf20a797a7a661f19c20ae09c3c818405ad05e0080098a70ba9167a1cb2c9fe161b1c817c03ad05e008004bc1dd01bd0a3d0a817d03ad05e008006d0a0b9a169907166a07a2cafd16ba1fb2c6fe163b19264602665654818505ad05e00800461200a2970a817e03b20712e00800cc3a0c0aa2570ac802d2a108d0d5821c0edaccd20cbfb62602c69a00e0dd200c9a0c0bd24cbf714d0381ae0352474be00800a1b7030c19924a050c0bb991c2c6fc165cf3d2c6fb16fdf228911df0b20716d802c2a108c0c582e13a03caddd20d1da827e0dda0d80df16c03d0eac0f0ee10e73b02c63f00c931b09ac056a617e20738e0e9c0ad050cbbd0cec0d16c03815705d0cc10e00800ed0ae951167a0db14d03a20b5a818605b0aab0a941a20a03e00800c2cafed851c901d73c02862d00913a03e871d831524e00c8028851daccf20c1da088c090ffa0f80f2ba88aff816c032bff80ff108881e13d03f908fd0ae20e00f991e0e004562e06f841f20f01661f5af65a57814d0382087c56e804d20cbfb2a080b0bd10f63a10c2a080c78d55d2071bed09e20e44e73d4aa9a1accb5c0a8bb1810c030c4ce00800b2010892071ba8a1b7b916d831c802daccc82c677c0bf13a03e21700f20f43f7be18b63a0246b6ff984192090126590a26390756b9ec4600000c36a861c871b881524c00390b564aebd8a7d2cdfe561d07e802f2a108f0f582faeef13a03e20e1df0eea0e80e0c2ff991f16c032beef0ee10f881e90f06a2ff817c03ad05e008000c0cdd01bd0a3d0a817d03a2073be008006d0a261a11262a0e263a0b92073b471995663692c6f3ff82a10852073b78028085828a7782a0a88a7786f7ffed0946a1ff920713a2970a16e9dfe61a02067effb20712e802b79a2df2a108f0f582faeed20ebf57ed1f0c2ab2a20e0c1c817f032c09909d20924ebfe008008c7a818003524a08e00800921708a837b16c03a0a3c0b0aa10a7b917c802d2a108d0d582daccd20cbf0c8e576d05e0ed20e24cbf816905ad05e0080056bad7818505ad05e008000c49a06993466cffb2a0efb0dd104663ff368100513a03713b0362a0ff41a803bd03a204050c13671a41820401d13c0380e00407e8109824c215179092c0d09910f09911c72924c807f2a108f0fa82faccc20c17b94180cc01c0c831e61c02066f00817b030c4be00800b8412204040c0d6092c01629219807e2a108e0e2820012409aeec20e79a2ce10ec4cf20e1780ff01f0f831e61f0b820e16808801808831a6180df805e22a37f0f141f0eec0169e21661c05821a741608210c0c00f3a1e21407a2a108a0a282a901f0ee20e254079aaa920a17e805809901909831a6195d9911821a80e0e1e480eec0e0e0e497eb3582054697282fb20551f63b29820a79661823b20545921a7cb7391ae921822a3fc93166981081b003ad02e00800c8310c0de82106140092040c3cba168904e73a45b21408f0bb20b25408460e00820545e21a7c873e2eb21408f0bb20b25408920a7966191fe20a1680ee01e0e831e61e13f22a3fc931669f0b81b003ad02e00800c8310c0d0c0e567c05a2040d9c3a92054797ba0eb801a807baaaa22a3f269a02668a38a805f20548a0a1e4f73e0ee2140ab20549e0eac0e0e0e4e7bb6122040467120f82a10880828228078a222202f5224404a2540ad2440c4611000ce9971ac1a2040c56bafba2040d2204048c3a1baaa2440d60b2c0ed0ac0ec93e2440d164b091c9c6712220caa0c0b914d0381ae03224953c24952e008003244001df02204040c0aa2440d86f0ff1df0b20407679b04a24407bd0adcee81af03e00800b20407c20401a09014a13c039092c030cc20c24401a0991099242d0b671bcb81ae03a14d035c09924a52b24a530c0b0caae00800b807c2a108c0c282cabbb20bf5324400b24407679ba0d20401e2a0fee0dd10d244011df0d2440cd2440df21407821408a805220402224404a0a1e4a2540af08810879f0ad25408a254095c0c060400c21409b2a078c0cac0c0c0e4c73be81c9cd2540786caffcc6ce20af31beee24af398070c1cc677ff366101a2a0dfb2c1100c4c42513c81e9050c1dd941d951e00800a2a0dfb2c11481e9050c4ce00800a2a0dfb2c110810c030c4ce00800a2a0dfb2c114810c030c4ce008000c0ad1b706f2c178c2a3f242113c816007e851984190ee01a099019941e951b2231190ee2080ee20e0bb10b26311c7247747ac02464600ad0381610720b074e00800d22311a1b706d0910416a93da21a04a0a004561a3dbd05a2c1201c0c91be0281d402909d10926311e00800811107e00800b2c120d2c140cd0a811207a2c36ce00800a2c37cb2c14481d4020ccce00800d20300ed07a2a3f3b2c1408113070c2ce008000c021df092a0d297a402063300d2a0d247ad02065800b0e00416be08bd040c02811a06ad02e00800224306ad030c1b810f072c0ce0080046f1ff92a08f9094c0564906a906920507e67205168947a672040ba9160a470c14c1c106b21d4c0c1dc2dcff40bb20b25c4ca672010c0dad03bd020c1c8124077cfee00800dcba0c5a812507bd03e00800166a438126070c5ae0080016ba420c1956f93ab2113c1c1a811a06a906e0080028061df0c2a3fac72471b2611947ac02062300cd05dd040cce0c1fa1b702816207a09b20926311ad03bd02e008002d0a1df0c2a076c7a40286420047ac0206d4ff076bbb42a0a4ad0391b902816307909b20926311e00800bd024ae30c2a1c6c810007d1db05e008000c0a811a061c6cc24303b2113ce00800c6b6ffa2a3f8a7a402c6410047aa02065100ad02bd03cd04dd05ed06816407fd07e00800c6adffb2a433b7a402463f0047ab020652000c1420b074816107ad03e00800424306ad03c20303810f070c0be0080006a2ffc2a3efc7a402865e0047ac02067100ad0381610720b074e008000c2abd03c1e202922311811007c09920926311e00800bd0581d4021c0ce008000c2abd020c8cd1db05e2a0a4810007eae3e008001c6a0c89815c06924303e00800d2a088dad316ca2dad02bd03ed06fd07816507c2a072e008004684ffb2a075b7a40246470047ab0286aaff42a400920305b20503b24306b099c0569918b2113c0c0a811a06a906e00800bd03c203060c0a922311810b07409920926311e008008672ffa2a3f6a0a4c0569ae6ad02bd03cd04816607dd05e00800066cff92a4329094c056f9e420b074816107ad03e00800ad03c203030c0b0c09810f07924306e00800c661ffa2a3f9a0a4c0566ae2bd0fed07a2a3ea0c2c811d07d20300e00800ad03816707bd06e00800c657ff92a43490a4c056eadfb21d04b0b004164b163c3a812507bd03e00800167a158126073c3ae0080016ca143c4a812507bd03e0080016fa138126073c4ae00800164a13ad0320b074ed070c0cdd06f2113c8168075901e00800066bff82a3ee8084c05638da0c0acd02dd0381f4061c3be00800863aff92c48c56c9d80c0a811a06bd04e00800815c061c7ae0080042a0884a43160a1aad02bd03dd04ed06fd07816907c2a070e00800062dff92a3f09094c05639d5d16a07c13704d0bb20c0bb20b26311a67208e1bc03e0eb20e26311ad02bd03cd04dd05ed06816b07fd07e00800c61effad05bd03cd02dd06ed078114070c4fe008008619ff0c2a812507bd03e00800164a098126070c2ae00800169a08b2113c0c0a0c0c811a06c906e00800ad03816c07b20306e008000b9a16f9c2ad030c4b922311812807409920926311e00800a2a3f66bb30c2cd20300816d070c3ee00800e2a0a4920306eae316290abd020c2a3c1c810007d1db05e008003c1992430306fafeed07a2a428b2c1600c2c816e0792a4343c72225131925130d20300e0080029063c721df0b2113c2c5a811a06a906e008000617ff811a06a1bb029223110c0cc24313b2113ca09920926311a806e00800ad038128070c2be008009203051699102caa812507bd03e0080016ba0b8126072caae00800160a0bad030c1b0cac0c09810f07924306e008000601ffbd020c2a1cac810007d1db05e008001ca946d6ff816f07ad0de0080046cffe0c0906f4febd042c1a811a06a906e0080046f4feb11f070c6c814e03922311a2a200a09920926311ad04e00800ecaab1b706b21b0407eb227ba5b1200781d4021c0ce00800ad02bd03dd05ed06fd07816907c2a06fe0080086b8fead04812107bd03e00800bd020c2a1c4cd1db05e2a0a4810007eae3e008001c4906b4ffad03812807b2a104e00800424313ed07a2a3f66bb30c2cd203000c09816d07924306e00800bd020c2a1cbcd1db05e2a0a4810007eae3e008001cbff2430386c9fead0320b074cd05d2113c8170070caee0080046c4fe \ No newline at end of file diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101/Readme.txt b/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101/Readme.txt deleted file mode 100644 index 9adbc9fa07b7..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101/Readme.txt +++ /dev/null @@ -1,22 +0,0 @@ --"PS_ASIC.pst" - This file contains radio, system, and firwmare configurabilities. - Details on how the ".pst" format and definitions can be found in the documents folder. - --"RamPatch.txt" - This file contains firmware fixes for known defects. Atheros will release patch files as needed. - -Both files are required for the system to be operational. - -- "ar3kbdaddr.pst" -This file contains the user configurable Bluetooth Address - -Linux: - -The files have to be copied to "\lib\firmware\" folder. - - -Windows CE. - -The files have to be copied to "platform\\Files" folder. - -Please refer the corresponding documents for the exacts steps to be followed. diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/PS_ASIC.pst b/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/PS_ASIC.pst deleted file mode 100644 index 87d25d40b923..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/PS_ASIC.pst +++ /dev/null @@ -1,93 +0,0 @@ - -// Coex Configuration -# -[H:S]0017 -[H:S]0022 -[H:A]d1 d1 20 00 02 01 02 09 0c 00 24 0f 04 00 00 01 - 00 01 00 01 01 01 01 01 01 00 00 00 01 00 00 00 - d2 d2 -// Radio table TAG -# -[H:S]012C -[H:S]0042 -[H:A]B1 B1 12 00 08 00 01 30 06 00 02 00 00 20 02 00 - 04 00 0C 40 01 00 48 00 00 48 54 9A 02 00 00 08 - 02 00 48 00 89 EE 70 E6 38 00 D8 70 EF 52 02 00 - 00 40 00 00 08 00 31 00 00 00 04 00 10 00 00 00 - B2 B2 -// System config TAG -# -[H:S]0013 -[H:S]00B6 -[H:A]C1 C1 17 02 06 00 01 30 55 00 0E CC 33 06 01 08 - 64 96 14 05 FF FF 05 80 00 00 FF CC 00 CC 01 00 - 20 80 FF CC 02 CC 04 00 DF EC 43 F8 00 21 00 E0 - FF CC 03 CC 06 00 80 F0 08 28 80 F4 0C 20 80 F8 - 0E 18 80 FC 14 10 80 00 18 08 80 04 16 00 FF CC - 04 CC 01 00 1A 12 40 96 01 C0 28 00 00 00 C0 01 - 40 06 00 01 00 00 C8 00 00 F0 00 00 FF CC 0C CC - 08 00 01 03 00 7E 08 08 00 7E 01 01 00 7E 01 03 - 00 7E 03 03 00 7E 61 63 00 7E 63 65 00 7E 6A 6C - 00 7E FF CC 09 CC 00 C9 FF CC 0B CC 0A 17 07 B2 - 5E 01 52 0A 60 09 05 06 14 4B 00 00 58 02 D0 07 - 00 41 FF CC C2 C2 -//Extern 32k + 24Mhz CPU -//bit 7: sleep disable/enable, default to enable -//e.g. to disable sleep, clear bit 7: -//[H:A]08 00 00 00 -# -[H:S]0021 -[H:S]0004 -[H:A]88 00 00 00 -//Bdaddr -//# -//[H:S]0001 -//[H:S]0006 -//[H:A]89 60 41 7f 03 00 -//Audio -# -[H:S]0002 -[H:S]0004 -[H:A]23 08 01 33 -//Audio -# -[H:S]0003 -[H:S]0004 -[H:A]dd e5 2e 00 -//Audio -# -[H:S]0015 -[H:S]0004 -[H:A]12 00 00 00 -//Audio -# -[H:S]0016 -[H:S]0004 -[H:A]00 00 a7 02 -# -//PLC -[H:S]001F -[H:S]0008 -[H:A]01 1A 06 14 50 B4 32 96 -//Sniff Recovery -# -[H:S]003D -[H:S]0018 -[H:A]A0 0F 00 00 00 08 00 00 0F 00 7D 04 E8 03 01 00 - 01 00 01 05 00 02 1F 01 -//BRM Config -# -[H:S]0026 -[H:S]000C -[H:A]01 20 46 01 0F 02 28 14 01 28 68 01 -//TLPM -//[79:64] - TLPM wakeup timeout in ms, default 10 -//[127:96] - TLPM idle timeout in ms, default 1000 -//e.g. to change the wakeup timeout to 5 and idle timeout to 2000 -//[H:A]03 00 03 00 00 00 00 00 05 00 0A 00 D0 07 00 00 -// E8 03 00 00 E8 03 00 00 -# -[H:S]0023 -[H:S]0018 -[H:A]03 00 03 00 00 00 00 00 0A 00 0A 00 E8 03 00 00 - E8 03 00 00 E8 03 00 00 diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/PS_ASIC_aclHighPri.pst b/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/PS_ASIC_aclHighPri.pst deleted file mode 100644 index 87d25d40b923..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/PS_ASIC_aclHighPri.pst +++ /dev/null @@ -1,93 +0,0 @@ - -// Coex Configuration -# -[H:S]0017 -[H:S]0022 -[H:A]d1 d1 20 00 02 01 02 09 0c 00 24 0f 04 00 00 01 - 00 01 00 01 01 01 01 01 01 00 00 00 01 00 00 00 - d2 d2 -// Radio table TAG -# -[H:S]012C -[H:S]0042 -[H:A]B1 B1 12 00 08 00 01 30 06 00 02 00 00 20 02 00 - 04 00 0C 40 01 00 48 00 00 48 54 9A 02 00 00 08 - 02 00 48 00 89 EE 70 E6 38 00 D8 70 EF 52 02 00 - 00 40 00 00 08 00 31 00 00 00 04 00 10 00 00 00 - B2 B2 -// System config TAG -# -[H:S]0013 -[H:S]00B6 -[H:A]C1 C1 17 02 06 00 01 30 55 00 0E CC 33 06 01 08 - 64 96 14 05 FF FF 05 80 00 00 FF CC 00 CC 01 00 - 20 80 FF CC 02 CC 04 00 DF EC 43 F8 00 21 00 E0 - FF CC 03 CC 06 00 80 F0 08 28 80 F4 0C 20 80 F8 - 0E 18 80 FC 14 10 80 00 18 08 80 04 16 00 FF CC - 04 CC 01 00 1A 12 40 96 01 C0 28 00 00 00 C0 01 - 40 06 00 01 00 00 C8 00 00 F0 00 00 FF CC 0C CC - 08 00 01 03 00 7E 08 08 00 7E 01 01 00 7E 01 03 - 00 7E 03 03 00 7E 61 63 00 7E 63 65 00 7E 6A 6C - 00 7E FF CC 09 CC 00 C9 FF CC 0B CC 0A 17 07 B2 - 5E 01 52 0A 60 09 05 06 14 4B 00 00 58 02 D0 07 - 00 41 FF CC C2 C2 -//Extern 32k + 24Mhz CPU -//bit 7: sleep disable/enable, default to enable -//e.g. to disable sleep, clear bit 7: -//[H:A]08 00 00 00 -# -[H:S]0021 -[H:S]0004 -[H:A]88 00 00 00 -//Bdaddr -//# -//[H:S]0001 -//[H:S]0006 -//[H:A]89 60 41 7f 03 00 -//Audio -# -[H:S]0002 -[H:S]0004 -[H:A]23 08 01 33 -//Audio -# -[H:S]0003 -[H:S]0004 -[H:A]dd e5 2e 00 -//Audio -# -[H:S]0015 -[H:S]0004 -[H:A]12 00 00 00 -//Audio -# -[H:S]0016 -[H:S]0004 -[H:A]00 00 a7 02 -# -//PLC -[H:S]001F -[H:S]0008 -[H:A]01 1A 06 14 50 B4 32 96 -//Sniff Recovery -# -[H:S]003D -[H:S]0018 -[H:A]A0 0F 00 00 00 08 00 00 0F 00 7D 04 E8 03 01 00 - 01 00 01 05 00 02 1F 01 -//BRM Config -# -[H:S]0026 -[H:S]000C -[H:A]01 20 46 01 0F 02 28 14 01 28 68 01 -//TLPM -//[79:64] - TLPM wakeup timeout in ms, default 10 -//[127:96] - TLPM idle timeout in ms, default 1000 -//e.g. to change the wakeup timeout to 5 and idle timeout to 2000 -//[H:A]03 00 03 00 00 00 00 00 05 00 0A 00 D0 07 00 00 -// E8 03 00 00 E8 03 00 00 -# -[H:S]0023 -[H:S]0018 -[H:A]03 00 03 00 00 00 00 00 0A 00 0A 00 E8 03 00 00 - E8 03 00 00 E8 03 00 00 diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/PS_ASIC_aclLowPri.pst b/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/PS_ASIC_aclLowPri.pst deleted file mode 100644 index 8f5f8992c2ff..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/PS_ASIC_aclLowPri.pst +++ /dev/null @@ -1,93 +0,0 @@ - -// Coex Configuration -# -[H:S]0017 -[H:S]0022 -[H:A]d1 d1 20 00 02 01 02 09 0c 00 24 0f 04 00 00 01 - 00 01 00 00 01 01 01 01 01 00 00 00 01 00 00 00 - d2 d2 -// Radio table TAG -# -[H:S]012C -[H:S]0042 -[H:A]B1 B1 12 00 08 00 01 30 06 00 02 00 00 20 02 00 - 04 00 0C 40 01 00 48 00 00 48 54 9A 02 00 00 08 - 02 00 48 00 89 EE 70 E6 38 00 D8 70 EF 52 02 00 - 00 40 00 00 08 00 31 00 00 00 04 00 10 00 00 00 - B2 B2 -// System config TAG -# -[H:S]0013 -[H:S]00B6 -[H:A]C1 C1 17 02 06 00 01 30 55 00 0E CC 33 06 01 08 - 64 96 14 05 FF FF 05 80 00 00 FF CC 00 CC 01 00 - 20 80 FF CC 02 CC 04 00 DF EC 43 F8 00 21 00 E0 - FF CC 03 CC 06 00 80 F0 08 28 80 F4 0C 20 80 F8 - 0E 18 80 FC 14 10 80 00 18 08 80 04 16 00 FF CC - 04 CC 01 00 1A 12 40 96 01 C0 28 00 00 00 C0 01 - 40 06 00 01 00 00 C8 00 00 F0 00 00 FF CC 0C CC - 08 00 01 03 00 7E 08 08 00 7E 01 01 00 7E 01 03 - 00 7E 03 03 00 7E 61 63 00 7E 63 65 00 7E 6A 6C - 00 7E FF CC 09 CC 00 C9 FF CC 0B CC 0A 17 07 B2 - 5E 01 52 0A 60 09 05 06 14 4B 00 00 58 02 D0 07 - 00 41 FF CC C2 C2 -//Extern 32k + 24Mhz CPU -//bit 7: sleep disable/enable, default to enable -//e.g. to disable sleep, clear bit 7: -//[H:A]08 00 00 00 -# -[H:S]0021 -[H:S]0004 -[H:A]88 00 00 00 -//Bdaddr -//# -//[H:S]0001 -//[H:S]0006 -//[H:A]89 60 41 7f 03 00 -//Audio -# -[H:S]0002 -[H:S]0004 -[H:A]23 08 01 33 -//Audio -# -[H:S]0003 -[H:S]0004 -[H:A]dd e5 2e 00 -//Audio -# -[H:S]0015 -[H:S]0004 -[H:A]12 00 00 00 -//Audio -# -[H:S]0016 -[H:S]0004 -[H:A]00 00 a7 02 -# -//PLC -[H:S]001F -[H:S]0008 -[H:A]01 1A 06 14 50 B4 32 96 -//Sniff Recovery -# -[H:S]003D -[H:S]0018 -[H:A]A0 0F 00 00 00 08 00 00 0F 00 7D 04 E8 03 01 00 - 01 00 01 05 00 02 1F 01 -//BRM Config -# -[H:S]0026 -[H:S]000C -[H:A]01 20 46 01 0F 02 28 14 01 28 68 01 -//TLPM -//[79:64] - TLPM wakeup timeout in ms, default 10 -//[127:96] - TLPM idle timeout in ms, default 1000 -//e.g. to change the wakeup timeout to 5 and idle timeout to 2000 -//[H:A]03 00 03 00 00 00 00 00 05 00 0A 00 D0 07 00 00 -// E8 03 00 00 E8 03 00 00 -# -[H:S]0023 -[H:S]0018 -[H:A]03 00 03 00 00 00 00 00 0A 00 0A 00 E8 03 00 00 - E8 03 00 00 E8 03 00 00 diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/RamPatch.txt b/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/RamPatch.txt deleted file mode 100644 index 107fd0ff80c5..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3k/30101coex/RamPatch.txt +++ /dev/null @@ -1,2 +0,0 @@ -21c7 -000000000e20000050800000000158000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d8d5530024e7530030e1530060e15300ece1530070e353008ce4530054e1530088e1530040af530088e353008ce35300d4e25300d8e25300fce253003ce3530024e3530054e3530030dd530024b0530078d553000000000000000000000000000000000030d553002ca05300000000000000000000000000000000000000000080019800d80198006c029800ec049800fc0698005c0898009c08980020099800cc099800340a9800340b9800b00b9800700c9800e40c9800580d9800c40d9800300e9800600e9800380f9800d00f9800541198000000000000000000000000000000000084189800501b98000000000000000000000000000000000000000000364100813a03416f0382085148041618040c13bc040c07613b030c02680676942252a1085052821b225a564205062020742654052634026644079205bf1769011b773df04600000c077048c00c024023831df00c021df000364100569208c0200021ce0991f3020c04426992c0200042699398128d04ed0916c9063d09a802c859b809b912a90999028c9ca21e06b82ee00c00860300a21e088bce5c0b81d6020c8de0080098120c4bbcb9c1f302d819c02000ed0cd26c90dd0cc02000426c93c02000a812b26c92a81ac02000b22c910c0cb0bac0a61b04e813a79e0ac0200081f3020c1ff268931df0000036a100a2a0dcbd01810c030c1ce00800a2a0d24bb10c4c421202521201612d0782010092a0d49088827202008a26220280810c030c16e00800313d030c09a203005981076a1690b9a030bba0b21b0407eb0c1b9990907416b9fe4600000c196619040c09c600006d090c19cc290c121df00c2c7951810c03513b03b2a108b0b282b961a8050c02225104baaaa20a1db2a0cdbaaa8bb1e00800721104810c032931a80560d6a0303da0b2030ec2a108c0bb820c4cbaaaa20a1db2a0c8baaacbb1e008008bb10c2c810c03225104a805f831d2030ee2a108e0dd82f971daaaa20a1dd2a0cddaaae00800621104cbb10c4c810c03d861a8052931daaaa20a1dd2a0c8daaae00800e851c831e0e104161e12bd04a13c0381ef02a0ac10e00800d20315b871e881a0f4c0a811faeee040f4b0aac0b20310a020f4d09bc0c2c9feac7df13a03168c0f662c1ff20f539c9f52030e82a108805582813b0388085a88820879513b030b8816880da0f0f4e0a0f4f79a2f0c121df00c0277b60c6097c097bb062bbab794010c12d805e2030ef2a108f0ee82eaddd20d79cc4d82ccfe16d8081df0b941f991d9a1c9b1ba9af7a91a40a2c081b503b841e00800c8b1b841d8a1b08a82f8918a444040f4b941d9a1c9b1ba9f47a91820a4c081b503b841e00800b841c8b1b08a82d8a18a222020f447b204ba222020f4b7b209ba22ba444040f42020f4b092c09084c01658f620a4c016faf59aada0b4c0167bf5b66c404bcac7b40206d3ffd2c2fc47bd02c6d0ff0c021df0ad0c81ef02bd04e0080086b7fff20f53cd09d2cdfed0d07416bff1f66d0246c5ff2bc9d2cdfed0d07486c2ff1c4b673702c6c3ff70e6c0e73b0286c1fff2c2fef0f4c056dfef0c1286beff000000368100815308324114e008003d0a815208ad02e00800d1540837aa070c0aa25202860000a21202c20114daccc20c00921203a0cc827ce4b2cc1fc0bcb3b0b5211bbb40bb10b252019c69815308e008008ceab21203a21201baaa1baa40aa10a25201a13d03720114c20a000c09076c169089a0a088a082180407e80c1b9990907416b9fe4600000c19313b03513a03d2a0c86619070c0b9201004600000c1b9069a0a066a0bcfb0c4c81e905b803d2060ee2a108e0dd82a2a0c8dabbb20b1dd911aaab50bba0e008000c2cd811b80381e905dabbb20b1da2a0cdaaab50bb90b2cb10e00800d2a0c8812d0792a0d4907782b8037a7872078082a1088077820c4c7abbb20b1d81e905daab50bba0e008000c2cb80381e9057abbb20b1da2a0cdaaab50bb90b2cb10e008004bb6a2a0d281e9050c4ce00800a2a0dc0c1c81e905b2c114e00800312e03815508ad02e00800309ac056a909c21201a21202e20114b154080b9e1bdeba8e820800e0d993d0d074a08882dabbf20b00e2c81fa0ff8280e8b3e0e5211beed2cf1ff0dfb340ee10e0e0f4d0d5211bdd40dd10d0d0f4e7bd2582ccfe8080f4825201920b00a09982f2c91f90f9b3f0f5211bff40ff10f0f0f4873f830609002b9c9090f4925201e20b00a0ee82d2ce1fe0deb3d0d5211bdd40dd10d0d0f4d7b902c6d6ff0c0aa25202815308e00800dc1a91b706920907809901909831cc390c0aa252011df00000366100814d08ad02e008000c0541a50862a0d4606382a212016a44b2048a6d0a8cdb261b0b262b52212e031df02d0b1df0b21202821484921483b73837973b34c2cbfea72c1b81ef02e008009c2a815308e00800ccaa81ac07e00800cc2a0c021df0bd03815808ad02e00800b2120292120156bb0d52448a06ebffa13d0352448a920a0072a0cd0769189d0590b9a0a0bba0b21b0407eb0c1b9990907416b9fe4600000c19313b03d2a0c8513a036619070c0b9201004600000c1b9069a0a066a0bceb0c4cb80372060e82a108807782a2a0c87abbb20b1d81e905aaab50bba0e008000c2cb80381e9057abbb20b1da2a0cdaaab50bb90b2cb10e00800d2a0c872a0cdb80342047482a1088044820c4c4abbb20b1d81e905daab50bba0e00800b8030c2c4abbb20b1d81e9057aab50bb90b2cb10e008004bb6a2a0d281e9050c4ce00800815508ad02e00800a020f41df06099c05659ed52448a06c0ff00000036c1002241003241014911592169317941a2a0de0c1cb2c12022412081e90592211ad20164e22118e951d241189971e00800810609ad01e008002d0a1df00000366100a2a0debd01810c030c1ce008004202030c0761590782a0d48087828a66a2067f920100664a1ef6791b817e03c2166aa21669b20202caaab0aac0bd04e00800cc2a1cb21df0520206820202ac45b6352292166962166a0c239a668066c030a6c0817e03bd04e00800165afd2b333030745733e91b777070746697960c021df000003661000c03ad02a901b15907c2a0d4c0c382cabbc20b7f664c22c801d801721b6ab21b69d21d02c21c015d0dd7b7015d077795392d0b6d0c7d0d060d001b333030746693c30c0351cf0642a0ff30b3a050bba0820b00471809814c08a801e00800fc1a1b333030741613fec60d002d0c6d0b0c14bd0540a78281ef02aaa620aac0e00800dc3aa2a06481b503bd04e008001ce9a7b904212e031df01b444040746694d086e5ff0c021df00000364100ad03bd048159080c0ce00800ad058105070c29d21314f10905e8d30c4c0c0bb24316c24301f0ee10e9d3d25501c2132bc25503b24500924504e00800d22311877d17e203c4076e11bd04a2a4300c2cd2030081e3060c3ee00800815008ad03e008001df0003661004081040c0aa25100165808d172085c5ec20301b2030080cc11cabbb0b0f4a0ca90d0cca0f21c021baab79f5bd21c01d25100e2a410e0ebc0166e09f2a411f0fbc016df0882a42c808bc016480892a42d909bc016b907a2a3fda0abc0162a07c2a418c0cbc0166c050c1abd058175080c1ce00800a0a074bd02ed050c1c817408dd01e00800860c00a0a074e79a8f06e8ffad0581da062bb1e00800167a04c20a11b20300376c413c99979b3c81a50592a0f7909c10924a11e008000c021df0bd02ed050c0a0c1c817408dd01e0080006faff60a074bd02ed050c1c817408dd01e0080006f5ffb20300ad02cd03dd05ed06818908fd04e0080086efff00366100612d0782a0d48082828a66f6721481bd05a206a8e00800816108e00800a24301a2440c81a3080c19f20300f24100e20301e24101d203020be5e0e993d24102d20680c20303c241030c2cb20307b24104bd01a20304a24105a2a410e00800b1b70291b302822631a2262d908820b0aa20a2662d8266311df000368100612d0782a0d48082828a66f6722281bd05a206a8e00800816108e00800bd0aa24301921402a13503b2440ca09920925402220300224100f20305f24101e20301e24102d20302d24103d1b702c20303c24104c2262db20306b24105b1b302a20307d0cc20dd01a24106a226319203089241070c19b0aa20821305824108721305b2a42c70784172410942130642410a22130681740820284122410bf20304f2410ce2030ea26631c2662de2410de206801c0c0ba5a0a993e008001df0003661002060f481a408ad06e008002d0a26e61192a06d97160ba2a081a71605b2a06eb7960262a410624100424102bd010c2c0c190be582a0d460a841a24101808382e0e993312d07a2a3eb8a33811b07d20380e00800c1c203b2232dd223317cfee0e230e0dd10d26331c0bb10b2632d1df000003661002060f481a408ad06e008002d0a26e61192a06d97160ba2a081a71605b2a06eb7960262a42c624100424102bd010c2c0c190be582a0d460a841a24101808382e0e993312d07a2a4288a33816e07d20380e00800c1c203b2232dd223317cfee0e230e0dd10d26331c0bb10b2632d1df000003661002060f481a408ad06e0080082a0d480838231a5082d0a8a3326e60592a06d97960262a4108c959203850c1aa09920924385625100a2a3eabd010c2cd203740c190be4811d07e0e993e00800b1c203a2232ac2232e7cfdd0d230d0cc10c2632eb0aa10a2632a1df000003661002060f481a408ad06e0080082a0d480838231a5082d0a8a3326e60592a06d97960262a42c8c959203850c1aa09920924385625100a2a427bd010c2cd203740c190be4811d07e0e993e00800b1c203a2232ac2232e7cfdd0d230d0cc10c2632eb0aa10a2632a1df0000036410081610341b70691b40852a0d45052825a4451c2036224893224859066105033108066106264893264851df0000036410081a408ad02e0080091b706b2a0d4b0b382ba99922989a70909f6733756d5060c021df0f6734b5655ffc21402c0d014c0c20416dc08ad02bd0381b5082c3ce00800c60200ad02bd0381b6082c3ce008000c121df05675fc92140290d014909204160905ad02bd0381b5082c3ce0080006ebff1695fa92140290d014276926ad02bd0381b5082c3ce0080086f0ff92140290d0142769adad02bd0381b5082c3ce0080086eaffad02bd0381b6082c3ce00800c6e6ffad02bd0381b6082c3ce00800c6d6ffad02bd0381b6082c3ce0080046dfff0000003661000c0351a707cd02c91181c606e00800b2a0d4b0b3825a4b921450a099c016590672048581a80721b70662a1e02a2b6a62ad06e00800ad06b2145181aa072901e008009204852d0a771916a2a412d204780c3e81a907b801c2a1edcabb0c2ce00800d811e20484d7161c271e19224484d20478a2a4130c3e81ab07b801c2a1eccabb0c2ce008001b33303074d2c3f6567df71df0000036a100ad05bd0181da06225108e008007d0ac8da21bc03d19b02f13704e1c103176431b21108d70c02c63500922a11d0ac20a9d7f099209267118201000c1fb678028626000c0f20c920e0da20d9d7c26711862200d78c28922a11d0ac20a9d7f09920926711820100cd0af67802062900e0ca2020b920b267110c02c9d7460200e0fc100c1d0c02f02d838207014109056638420c7a812507bd07e00800bc3a8126070c7ae00800ac9aa21301b21302512e03a7bb6481ef02e00800817b08a25301b20100ad03e0080050aac00c19a09583861400c8d71ca240bc10b9d71df0ad0fdd03ed058174080c1ce00800860300bd07cd03dd02817d08a20100e008000c021df060a074dd03ed058174080c1ce0080046faff0c12c6dbffad03817b08b20100e008009d0afcf9ed02a2a3ea0c2cd20700b2c110811d07f207110c2990ff20f24711e00800cd03bd07817c08a21302a2572b92130192572aa20100e00800b8d740bb10b9d706e5ff50c9c056fcf7ad0798d781500840991099d7e008002c021df0364100c16d044c49a2a108813b03a0a2828808718403aa88820824a13d038088a0a088a08208137827908882b1c1048a778817216c039858a848904b457054a058656838ac4560d4b0d81d576d1de2050620d9105a5e8b55270910b0f510f71d0a204510c039104033203958a04b457054a058656084b0ac558818576821881762050678485a568b55206710270710b0951097160a20b510c0a710b0aa20a9481df0000036610056720e0c0b5c8c213a0381ad02ad02e0080082a0faa2a0f092a1e02c8b0c1c4c6d2c0e0caff24254e24243d24244c24224c24226c24242c24245c24246c2424ab25217b24248b2424b925219a2521882521a81e905a2a1040c099901a252265c0a1c4bb24249bd010c2cc242470c4ce00800813e03a2a0ffe00800818c0320e6030c2a209034972a02206200e00800818d03e00800818e03e00800818f03e00800819003e00800819103e00800819203e00800819303e00800819403e00800819503e00800819603e00800819703e00800819803e0080020e6131020008199039d02e00800819a03e008001df0364100cc3322a0641df00c0c0c0a769306a752011bcc1baabd03a2a06481ee02a0ac82e00800a020741df000368100c1a502613b0342a108404282680632a0a84a663a369206bf52262c67e913a21c2582a0808089201baaa25c258246bfc60400921660b206c20c1a001b4000aaa1a09920925660a2130c0cab92031a8178051b9992431ae00800a2431ba2031a0c07b69a0572431a72530c724316724338817905ad02e00800ad02817a05bd03e00800a2165482263bd13c03913b03c16c039809e13a034a99b2091d92292ce0bba0b80b780eb099c0c099109a77707141d077108077c0d07710f07711a7b7017d0aad02bd07cd010c0d81b8035941e00800d13a03b13b035d0ae80bc135034aee920e79f18103ec090c09b62a0582cafd56d80ea21d1ae20d29aacaa2ca14e0ac83a0a0f4a25100463600262a05264a02665a46ad02b21100817b05c13a03920e1dd22e2cc0e9a0e80ef2263be0ddc0e16c03c80ce0dd10daccd13c03c0c141d0cc10f0ccc0d0cc10f0cc11e00800b13b03c13503d13a03f18103880b1c0e4a888208bfa81f27e825f1a502921f261b99925f26c78a32a20d2c47ea2ce09a20817903924d2ce00800b13b03860600c78a17a20d2c476a1181790392a0ef909a10924d2ce00800b13b038841e80bf1c1024aeec20ebfd2a0fbd0cc10d82ec24ebfc2a0bfa80bf0dd204aaa920abfd92ec09910924abf28230c1a8022c0202a931df0a21100881f9911f7e80fc2165477bc09e20d29cc3ef2a4e2f911bd074bc18bd181d703cbe1e0080066550b8ba1cbb181d6034bc1e00800a8214c4cd831b81181c703dabbe00800b13b03c13503d13a03f18103a24316c6c7ff00000036a1000c067cf849612971dd03d981213b0342a0ff8991890191b703a802520904b2a10840e5c016ee0bb0b58272a0a8baaaf20a797a7a661f19c20ae09c3c818405ad05e0080098a70ba9167a1cb2c9fe161b1c817c03ad05e008004bc1dd01bd0a3d0a817d03ad05e008006d0a0b9a169907166a07a2cafd16ba1fb2c6fe163b19264602665654818505ad05e00800461200a2970a817e03b20712e00800cc3a0c0aa2570ac802d2a108d0d5821c0edaccd20cbfb62602c69a00e0dd200c9a0c0bd24cbf714d0381ae0352474be00800a1b7030c19924a050c0bb991c2c6fc165cf3d2c6fb16fdf228911df0b20716d802c2a108c0c582e13a03caddd20d1da827e0dda0d80df16c03d0eac0f0ee10e73b02c63f00c931b09ac056a617e20738e0e9c0ad050cbbd0cec0d16c03815705d0cc10e00800ed0ae951167a0db14d03a20b5a818605b0aab0a941a20a03e00800c2cafed851c901d73c02862d00913a03e871d831524e00c8028851daccf20c1da088c090ffa0f80f2ba88aff816c032bff80ff108881e13d03f908fd0ae20e00f991e0e004562e06f841f20f01661f5af65a57814d0382087c56e804d20cbfb2a080b0bd10f63a10c2a080c78d55d2071bed09e20e44e73d4aa9a1accb5c0a8bb1810c030c4ce00800b2010892071ba8a1b7b916d831c802daccc82c677c0bf13a03e21700f20f43f7be18b63a0246b6ff984192090126590a26390756b9ec4600000c36a861c871b881524c00390b564aebd8a7d2cdfe561d07e802f2a108f0f582faeef13a03e20e1df0eea0e80e0c2ff991f16c032beef0ee10f881e90f06a2ff817c03ad05e008000c0cdd01bd0a3d0a817d03a2073be008006d0a261a11262a0e263a0b92073b471995663692c6f3ff82a10852073b78028085828a7782a0a88a7786f7ffed0946a1ff920713a2970a16e9dfe61a02067effb20712e802b79a2df2a108f0f582faeed20ebf57ed1f0c2ab2a20e0c1c817f032c09909d20924ebfe008008c7a818003524a08e00800921708a837b16c03a0a3c0b0aa10a7b917c802d2a108d0d582daccd20cbf0c8e576d05e0ed20e24cbf816905ad05e0080056bad7818505ad05e008000c49a06993466cffb2a0efb0dd104663ff368100513a03713b0362a0ff41a803bd03a204050c13671a41820401d13c0380e00407e8109824c215179092c0d09910f09911c72924c807f2a108f0fa82faccc20c17b94180cc01c0c831e61c02066f00817b030c4be00800b8412204040c0d6092c01629219807e2a108e0e2820012409aeec20e79a2ce10ec4cf20e1780ff01f0f831e61f0b820e16808801808831a6180df805e22a37f0f141f0eec0169e21661c05821a741608210c0c00f3a1e21407a2a108a0a282a901f0ee20e254079aaa920a17e805809901909831a6195d9911821a80e0e1e480eec0e0e0e497eb3582054697282fb20551f63b29820a79661823b20545921a7cb7391ae921822a3fc93166981081b003ad02e00800c8310c0de82106140092040c3cba168904e73a45b21408f0bb20b25408460e00820545e21a7c873e2eb21408f0bb20b25408920a7966191fe20a1680ee01e0e831e61e13f22a3fc931669f0b81b003ad02e00800c8310c0d0c0e567c05a2040d9c3a92054797ba0eb801a807baaaa22a3f269a02668a38a805f20548a0a1e4f73e0ee2140ab20549e0eac0e0e0e4e7bb6122040467120f82a10880828228078a222202f5224404a2540ad2440c4611000ce9971ac1a2040c56bafba2040d2204048c3a1baaa2440d60b2c0ed0ac0ec93e2440d164b091c9c6712220caa0c0b914d0381ae03224953c24952e008003244001df02204040c0aa2440d86f0ff1df0b20407679b04a24407bd0adcee81af03e00800b20407c20401a09014a13c039092c030cc20c24401a0991099242d0b671bcb81ae03a14d035c09924a52b24a530c0b0caae00800b807c2a108c0c282cabbb20bf5324400b24407679ba0d20401e2a0fee0dd10d244011df0d2440cd2440df21407821408a805220402224404a0a1e4a2540af08810879f0ad25408a254095c0c060400c21409b2a078c0cac0c0c0e4c73be81c9cd2540786caffcc6ce20af31beee24af398070c1cc677ff366101a2a0dfb2c1100c4c42513c81e9050c1dd941d951e00800a2a0dfb2c11481e9050c4ce00800a2a0dfb2c110810c030c4ce00800a2a0dfb2c114810c030c4ce008000c0ad1b706f2c178c2a3f242113c816007e851984190ee01a099019941e951b2231190ee2080ee20e0bb10b26311c7247747ac02464600ad0381610720b074e00800d22311a1b706d0910416a93da21a04a0a004561a3dbd05a2c1201c0c91be0281d402909d10926311e00800811107e00800b2c120d2c140cd0a811207a2c36ce00800a2c37cb2c14481d4020ccce00800d20300ed07a2a3f3b2c1408113070c2ce008000c021df092a0d297a402063300d2a0d247ad02065800b0e00416be08bd040c02811a06ad02e00800224306ad030c1b810f072c0ce0080046f1ff92a08f9094c0564906a906920507e67205168947a672040ba9160a470c14c1c106b21d4c0c1dc2dcff40bb20b25c4ca672010c0dad03bd020c1c8124077cfee00800dcba0c5a812507bd03e00800166a438126070c5ae0080016ba420c1956f93ab2113c1c1a811a06a906e0080028061df0c2a3fac72471b2611947ac02062300cd05dd040cce0c1fa1b702816207a09b20926311ad03bd02e008002d0a1df0c2a076c7a40286420047ac0206d4ff076bbb42a0a4ad0391b902816307909b20926311e00800bd024ae30c2a1c6c810007d1db05e008000c0a811a061c6cc24303b2113ce00800c6b6ffa2a3f8a7a402c6410047aa02065100ad02bd03cd04dd05ed06816407fd07e00800c6adffb2a433b7a402463f0047ab020652000c1420b074816107ad03e00800424306ad03c20303810f070c0be0080006a2ffc2a3efc7a402865e0047ac02067100ad0381610720b074e008000c2abd03c1e202922311811007c09920926311e00800bd0581d4021c0ce008000c2abd020c8cd1db05e2a0a4810007eae3e008001c6a0c89815c06924303e00800d2a088dad316ca2dad02bd03ed06fd07816507c2a072e008004684ffb2a075b7a40246470047ab0286aaff42a400920305b20503b24306b099c0569918b2113c0c0a811a06a906e00800bd03c203060c0a922311810b07409920926311e008008672ffa2a3f6a0a4c0569ae6ad02bd03cd04816607dd05e00800066cff92a4329094c056f9e420b074816107ad03e00800ad03c203030c0b0c09810f07924306e00800c661ffa2a3f9a0a4c0566ae2bd0fed07a2a3ea0c2c811d07d20300e00800ad03816707bd06e00800c657ff92a43490a4c056eadfb21d04b0b004164b163c3a812507bd03e00800167a158126073c3ae0080016ca143c4a812507bd03e0080016fa138126073c4ae00800164a13ad0320b074ed070c0cdd06f2113c8168075901e00800066bff82a3ee8084c05638da0c0acd02dd0381f4061c3be00800863aff92c48c56c9d80c0a811a06bd04e00800815c061c7ae0080042a0884a43160a1aad02bd03dd04ed06fd07816907c2a070e00800062dff92a3f09094c05639d5d16a07c13704d0bb20c0bb20b26311a67208e1bc03e0eb20e26311ad02bd03cd04dd05ed06816b07fd07e00800c61effad05bd03cd02dd06ed078114070c4fe008008619ff0c2a812507bd03e00800164a098126070c2ae00800169a08b2113c0c0a0c0c811a06c906e00800ad03816c07b20306e008000b9a16f9c2ad030c4b922311812807409920926311e00800a2a3f66bb30c2cd20300816d070c3ee00800e2a0a4920306eae316290abd020c2a3c1c810007d1db05e008003c1992430306fafeed07a2a428b2c1600c2c816e0792a4343c72225131925130d20300e0080029063c721df0b2113c2c5a811a06a906e008000617ff811a06a1bb029223110c0cc24313b2113ca09920926311a806e00800ad038128070c2be008009203051699102caa812507bd03e0080016ba0b8126072caae00800160a0bad030c1b0cac0c09810f07924306e008000601ffbd020c2a1cac810007d1db05e008001ca946d6ff816f07ad0de0080046cffe0c0906f4febd042c1a811a06a906e0080046f4feb11f070c6c814e03922311a2a200a09920926311ad04e00800ecaab1b706b21b0407eb227ba5b1200781d4021c0ce00800ad02bd03dd05ed06fd07816907c2a06fe0080086b8fead04812107bd03e00800bd020c2a1c4cd1db05e2a0a4810007eae3e008001c4906b4ffad03812807b2a104e00800424313ed07a2a3f66bb30c2cd203000c09816d07924306e00800bd020c2a1cbcd1db05e2a0a4810007eae3e008001cbff2430386c9fead0320b074cd05d2113c8170070caee0080046c4fe \ No newline at end of file diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3kconfig.c b/drivers/net/wireless/ar6003/host/miscdrv/ar3kconfig.c deleted file mode 100644 index 5965b3fcc517..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3kconfig.c +++ /dev/null @@ -1,569 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2009-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// AR3K configuration implementation -// -// Author(s): ="Atheros" -//============================================================================== - -#include "a_config.h" -#include "athdefs.h" -#include "a_types.h" -#include "a_osapi.h" -#define ATH_MODULE_NAME misc -#include "a_debug.h" -#include "common_drv.h" -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -#include "export_hci_transport.h" -#else -#include "hci_transport_api.h" -#endif -#include "ar3kconfig.h" -#include "tlpm.h" - -#define BAUD_CHANGE_COMMAND_STATUS_OFFSET 5 -#define HCI_EVENT_RESP_TIMEOUTMS 3000 -#define HCI_CMD_OPCODE_BYTE_LOW_OFFSET 0 -#define HCI_CMD_OPCODE_BYTE_HI_OFFSET 1 -#define HCI_EVENT_OPCODE_BYTE_LOW 3 -#define HCI_EVENT_OPCODE_BYTE_HI 4 -#define HCI_CMD_COMPLETE_EVENT_CODE 0xE -#define HCI_MAX_EVT_RECV_LENGTH 257 -#define EXIT_MIN_BOOT_COMMAND_STATUS_OFFSET 5 - -A_STATUS AthPSInitialize(AR3K_CONFIG_INFO *hdev); - -static A_STATUS SendHCICommand(AR3K_CONFIG_INFO *pConfig, - A_UINT8 *pBuffer, - int Length) -{ - HTC_PACKET *pPacket = NULL; - A_STATUS status = A_OK; - - do { - - pPacket = (HTC_PACKET *)A_MALLOC(sizeof(HTC_PACKET)); - if (NULL == pPacket) { - status = A_NO_MEMORY; - break; - } - - A_MEMZERO(pPacket,sizeof(HTC_PACKET)); - SET_HTC_PACKET_INFO_TX(pPacket, - NULL, - pBuffer, - Length, - HCI_COMMAND_TYPE, - AR6K_CONTROL_PKT_TAG); - - /* issue synchronously */ - status = HCI_TransportSendPkt(pConfig->pHCIDev,pPacket,TRUE); - - } while (FALSE); - - if (pPacket != NULL) { - A_FREE(pPacket); - } - - return status; -} - -static A_STATUS RecvHCIEvent(AR3K_CONFIG_INFO *pConfig, - A_UINT8 *pBuffer, - int *pLength) -{ - A_STATUS status = A_OK; - HTC_PACKET *pRecvPacket = NULL; - - do { - - pRecvPacket = (HTC_PACKET *)A_MALLOC(sizeof(HTC_PACKET)); - if (NULL == pRecvPacket) { - status = A_NO_MEMORY; - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Failed to alloc HTC struct \n")); - break; - } - - A_MEMZERO(pRecvPacket,sizeof(HTC_PACKET)); - - SET_HTC_PACKET_INFO_RX_REFILL(pRecvPacket,NULL,pBuffer,*pLength,HCI_EVENT_TYPE); - - status = HCI_TransportRecvHCIEventSync(pConfig->pHCIDev, - pRecvPacket, - HCI_EVENT_RESP_TIMEOUTMS); - if (A_FAILED(status)) { - break; - } - - *pLength = pRecvPacket->ActualLength; - - } while (FALSE); - - if (pRecvPacket != NULL) { - A_FREE(pRecvPacket); - } - - return status; -} - -A_STATUS SendHCICommandWaitCommandComplete(AR3K_CONFIG_INFO *pConfig, - A_UINT8 *pHCICommand, - int CmdLength, - A_UINT8 **ppEventBuffer, - A_UINT8 **ppBufferToFree) -{ - A_STATUS status = A_OK; - A_UINT8 *pBuffer = NULL; - A_UINT8 *pTemp; - int length; - A_BOOL commandComplete = FALSE; - A_UINT8 opCodeBytes[2]; - - do { - - length = max(HCI_MAX_EVT_RECV_LENGTH,CmdLength); - length += pConfig->pHCIProps->HeadRoom + pConfig->pHCIProps->TailRoom; - length += pConfig->pHCIProps->IOBlockPad; - - pBuffer = (A_UINT8 *)A_MALLOC(length); - if (NULL == pBuffer) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR3K Config: Failed to allocate bt buffer \n")); - status = A_NO_MEMORY; - break; - } - - /* get the opcodes to check the command complete event */ - opCodeBytes[0] = pHCICommand[HCI_CMD_OPCODE_BYTE_LOW_OFFSET]; - opCodeBytes[1] = pHCICommand[HCI_CMD_OPCODE_BYTE_HI_OFFSET]; - - /* copy HCI command */ - A_MEMCPY(pBuffer + pConfig->pHCIProps->HeadRoom,pHCICommand,CmdLength); - /* send command */ - status = SendHCICommand(pConfig, - pBuffer + pConfig->pHCIProps->HeadRoom, - CmdLength); - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR3K Config: Failed to send HCI Command (%d) \n", status)); - AR_DEBUG_PRINTBUF(pHCICommand,CmdLength,"HCI Bridge Failed HCI Command"); - break; - } - - /* reuse buffer to capture command complete event */ - A_MEMZERO(pBuffer,length); - status = RecvHCIEvent(pConfig,pBuffer,&length); - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR3K Config: HCI event recv failed \n")); - AR_DEBUG_PRINTBUF(pHCICommand,CmdLength,"HCI Bridge Failed HCI Command"); - break; - } - - pTemp = pBuffer + pConfig->pHCIProps->HeadRoom; - if (pTemp[0] == HCI_CMD_COMPLETE_EVENT_CODE) { - if ((pTemp[HCI_EVENT_OPCODE_BYTE_LOW] == opCodeBytes[0]) && - (pTemp[HCI_EVENT_OPCODE_BYTE_HI] == opCodeBytes[1])) { - commandComplete = TRUE; - } - } - - if (!commandComplete) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR3K Config: Unexpected HCI event : %d \n",pTemp[0])); - AR_DEBUG_PRINTBUF(pTemp,pTemp[1],"Unexpected HCI event"); - status = A_ECOMM; - break; - } - - if (ppEventBuffer != NULL) { - /* caller wants to look at the event */ - *ppEventBuffer = pTemp; - if (ppBufferToFree == NULL) { - status = A_EINVAL; - break; - } - /* caller must free the buffer */ - *ppBufferToFree = pBuffer; - pBuffer = NULL; - } - - } while (FALSE); - - if (pBuffer != NULL) { - A_FREE(pBuffer); - } - - return status; -} - -static A_STATUS AR3KConfigureHCIBaud(AR3K_CONFIG_INFO *pConfig) -{ - A_STATUS status = A_OK; - A_UINT8 hciBaudChangeCommand[] = {0x0c,0xfc,0x2,0,0}; - A_UINT16 baudVal; - A_UINT8 *pEvent = NULL; - A_UINT8 *pBufferToFree = NULL; - - do { - - if (pConfig->Flags & AR3K_CONFIG_FLAG_SET_AR3K_BAUD) { - baudVal = (A_UINT16)(pConfig->AR3KBaudRate / 100); - hciBaudChangeCommand[3] = (A_UINT8)baudVal; - hciBaudChangeCommand[4] = (A_UINT8)(baudVal >> 8); - - status = SendHCICommandWaitCommandComplete(pConfig, - hciBaudChangeCommand, - sizeof(hciBaudChangeCommand), - &pEvent, - &pBufferToFree); - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR3K Config: Baud rate change failed! \n")); - break; - } - - if (pEvent[BAUD_CHANGE_COMMAND_STATUS_OFFSET] != 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("AR3K Config: Baud change command event status failed: %d \n", - pEvent[BAUD_CHANGE_COMMAND_STATUS_OFFSET])); - status = A_ECOMM; - break; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("AR3K Config: Baud Changed to %d \n",pConfig->AR3KBaudRate)); - } - - if (pConfig->Flags & AR3K_CONFIG_FLAG_AR3K_BAUD_CHANGE_DELAY) { - /* some versions of AR3K do not switch baud immediately, up to 300MS */ - A_MDELAY(325); - } - - if (pConfig->Flags & AR3K_CONFIG_FLAG_SET_AR6K_SCALE_STEP) { - /* Tell target to change UART baud rate for AR6K */ - status = HCI_TransportSetBaudRate(pConfig->pHCIDev, pConfig->AR3KBaudRate); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("AR3K Config: failed to set scale and step values: %d \n", status)); - break; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_ANY, - ("AR3K Config: Baud changed to %d for AR6K\n", pConfig->AR3KBaudRate)); - } - - } while (FALSE); - - if (pBufferToFree != NULL) { - A_FREE(pBufferToFree); - } - - return status; -} - -static A_STATUS AR3KExitMinBoot(AR3K_CONFIG_INFO *pConfig) -{ - A_STATUS status; - A_CHAR exitMinBootCmd[] = {0x25,0xFC,0x0c,0x03,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00}; - A_UINT8 *pEvent = NULL; - A_UINT8 *pBufferToFree = NULL; - - status = SendHCICommandWaitCommandComplete(pConfig, - exitMinBootCmd, - sizeof(exitMinBootCmd), - &pEvent, - &pBufferToFree); - - if (A_SUCCESS(status)) { - if (pEvent[EXIT_MIN_BOOT_COMMAND_STATUS_OFFSET] != 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("AR3K Config: MinBoot exit command event status failed: %d \n", - pEvent[EXIT_MIN_BOOT_COMMAND_STATUS_OFFSET])); - status = A_ECOMM; - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("AR3K Config: MinBoot Exit Command Complete (Success) \n")); - A_MDELAY(1); - } - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR3K Config: MinBoot Exit Failed! \n")); - } - - if (pBufferToFree != NULL) { - A_FREE(pBufferToFree); - } - - return status; -} - -static A_STATUS AR3KConfigureSendHCIReset(AR3K_CONFIG_INFO *pConfig) -{ - A_STATUS status = A_OK; - A_UINT8 hciResetCommand[] = {0x03,0x0c,0x0}; - A_UINT8 *pEvent = NULL; - A_UINT8 *pBufferToFree = NULL; - - status = SendHCICommandWaitCommandComplete( pConfig, - hciResetCommand, - sizeof(hciResetCommand), - &pEvent, - &pBufferToFree ); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR3K Config: HCI reset failed! \n")); - } - - if (pBufferToFree != NULL) { - A_FREE(pBufferToFree); - } - - return status; -} - -static A_STATUS AR3KEnableTLPM(AR3K_CONFIG_INFO *pConfig) -{ - A_STATUS status; - /* AR3K vendor specific command for Host Wakeup Config */ - A_CHAR hostWakeupConfig[] = {0x31,0xFC,0x18, - 0x02,0x00,0x00,0x00, - 0x01,0x00,0x00,0x00, - TLPM_DEFAULT_IDLE_TIMEOUT_LSB,TLPM_DEFAULT_IDLE_TIMEOUT_MSB,0x00,0x00, //idle timeout in ms - 0x00,0x00,0x00,0x00, - TLPM_DEFAULT_WAKEUP_TIMEOUT_MS,0x00,0x00,0x00, //wakeup timeout in ms - 0x00,0x00,0x00,0x00}; - /* AR3K vendor specific command for Target Wakeup Config */ - A_CHAR targetWakeupConfig[] = {0x31,0xFC,0x18, - 0x04,0x00,0x00,0x00, - 0x01,0x00,0x00,0x00, - TLPM_DEFAULT_IDLE_TIMEOUT_LSB,TLPM_DEFAULT_IDLE_TIMEOUT_MSB,0x00,0x00, //idle timeout in ms - 0x00,0x00,0x00,0x00, - TLPM_DEFAULT_WAKEUP_TIMEOUT_MS,0x00,0x00,0x00, //wakeup timeout in ms - 0x00,0x00,0x00,0x00}; - /* AR3K vendor specific command for Host Wakeup Enable */ - A_CHAR hostWakeupEnable[] = {0x31,0xFC,0x4, - 0x01,0x00,0x00,0x00}; - /* AR3K vendor specific command for Target Wakeup Enable */ - A_CHAR targetWakeupEnable[] = {0x31,0xFC,0x4, - 0x06,0x00,0x00,0x00}; - /* AR3K vendor specific command for Sleep Enable */ - A_CHAR sleepEnable[] = {0x4,0xFC,0x1, - 0x1}; - A_UINT8 *pEvent = NULL; - A_UINT8 *pBufferToFree = NULL; - - if (0 != pConfig->IdleTimeout) { - A_UINT8 idle_lsb = pConfig->IdleTimeout & 0xFF; - A_UINT8 idle_msb = (pConfig->IdleTimeout & 0xFF00) >> 8; - hostWakeupConfig[11] = targetWakeupConfig[11] = idle_lsb; - hostWakeupConfig[12] = targetWakeupConfig[12] = idle_msb; - } - - if (0 != pConfig->WakeupTimeout) { - hostWakeupConfig[19] = targetWakeupConfig[19] = (pConfig->WakeupTimeout & 0xFF); - } - - status = SendHCICommandWaitCommandComplete(pConfig, - hostWakeupConfig, - sizeof(hostWakeupConfig), - &pEvent, - &pBufferToFree); - if (pBufferToFree != NULL) { - A_FREE(pBufferToFree); - } - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("HostWakeup Config Failed! \n")); - return status; - } - - pEvent = NULL; - pBufferToFree = NULL; - status = SendHCICommandWaitCommandComplete(pConfig, - targetWakeupConfig, - sizeof(targetWakeupConfig), - &pEvent, - &pBufferToFree); - if (pBufferToFree != NULL) { - A_FREE(pBufferToFree); - } - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Target Wakeup Config Failed! \n")); - return status; - } - - pEvent = NULL; - pBufferToFree = NULL; - status = SendHCICommandWaitCommandComplete(pConfig, - hostWakeupEnable, - sizeof(hostWakeupEnable), - &pEvent, - &pBufferToFree); - if (pBufferToFree != NULL) { - A_FREE(pBufferToFree); - } - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("HostWakeup Enable Failed! \n")); - return status; - } - - pEvent = NULL; - pBufferToFree = NULL; - status = SendHCICommandWaitCommandComplete(pConfig, - targetWakeupEnable, - sizeof(targetWakeupEnable), - &pEvent, - &pBufferToFree); - if (pBufferToFree != NULL) { - A_FREE(pBufferToFree); - } - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Target Wakeup Enable Failed! \n")); - return status; - } - - pEvent = NULL; - pBufferToFree = NULL; - status = SendHCICommandWaitCommandComplete(pConfig, - sleepEnable, - sizeof(sleepEnable), - &pEvent, - &pBufferToFree); - if (pBufferToFree != NULL) { - A_FREE(pBufferToFree); - } - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Sleep Enable Failed! \n")); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR3K Config: Enable TLPM Completed (status = %d) \n",status)); - - return status; -} - -A_STATUS AR3KConfigure(AR3K_CONFIG_INFO *pConfig) -{ - A_STATUS status = A_OK; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AR3K Config: Configuring AR3K ...\n")); - - do { - - if ((pConfig->pHCIDev == NULL) || (pConfig->pHCIProps == NULL) || (pConfig->pHIFDevice == NULL)) { - status = A_EINVAL; - break; - } - - /* disable asynchronous recv while we issue commands and receive events synchronously */ - status = HCI_TransportEnableDisableAsyncRecv(pConfig->pHCIDev,FALSE); - if (A_FAILED(status)) { - break; - } - - if (pConfig->Flags & AR3K_CONFIG_FLAG_FORCE_MINBOOT_EXIT) { - status = AR3KExitMinBoot(pConfig); - if (A_FAILED(status)) { - break; - } - } - - - /* Load patching and PST file if available*/ - if (A_OK != AthPSInitialize(pConfig)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Patch Download Failed!\n")); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("TLPM - PwrMgmtEnabled=%d, IdleTimeout=%d, WakeupTimeout=%d\n", - pConfig->PwrMgmtEnabled, - pConfig->IdleTimeout, - pConfig->WakeupTimeout)); - - /* Send HCI reset to make PS tags take effect*/ - AR3KConfigureSendHCIReset(pConfig); - - if (pConfig->PwrMgmtEnabled) { - /* the delay is required after the previous HCI reset before further - * HCI commands can be issued - */ - A_MDELAY(200); - AR3KEnableTLPM(pConfig); - } - - if (pConfig->Flags & - (AR3K_CONFIG_FLAG_SET_AR3K_BAUD | AR3K_CONFIG_FLAG_SET_AR6K_SCALE_STEP)) { - status = AR3KConfigureHCIBaud(pConfig); - if (A_FAILED(status)) { - break; - } - } - - /* re-enable asynchronous recv */ - status = HCI_TransportEnableDisableAsyncRecv(pConfig->pHCIDev,TRUE); - if (A_FAILED(status)) { - break; - } - - - } while (FALSE); - - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AR3K Config: Configuration Complete (status = %d) \n",status)); - - return status; -} - -A_STATUS AR3KConfigureExit(void *config) -{ - A_STATUS status = A_OK; - AR3K_CONFIG_INFO *pConfig = (AR3K_CONFIG_INFO *)config; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AR3K Config: Cleaning up AR3K ...\n")); - - do { - - if ((pConfig->pHCIDev == NULL) || (pConfig->pHCIProps == NULL) || (pConfig->pHIFDevice == NULL)) { - status = A_EINVAL; - break; - } - - /* disable asynchronous recv while we issue commands and receive events synchronously */ - status = HCI_TransportEnableDisableAsyncRecv(pConfig->pHCIDev,FALSE); - if (A_FAILED(status)) { - break; - } - - if (pConfig->Flags & - (AR3K_CONFIG_FLAG_SET_AR3K_BAUD | AR3K_CONFIG_FLAG_SET_AR6K_SCALE_STEP)) { - status = AR3KConfigureHCIBaud(pConfig); - if (A_FAILED(status)) { - break; - } - } - - /* re-enable asynchronous recv */ - status = HCI_TransportEnableDisableAsyncRecv(pConfig->pHCIDev,TRUE); - if (A_FAILED(status)) { - break; - } - - - } while (FALSE); - - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AR3K Config: Cleanup Complete (status = %d) \n",status)); - - return status; -} - diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3kps/ar3kpsconfig.c b/drivers/net/wireless/ar6003/host/miscdrv/ar3kps/ar3kpsconfig.c deleted file mode 100644 index df4cf8c16b97..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3kps/ar3kpsconfig.c +++ /dev/null @@ -1,694 +0,0 @@ -/* - * Copyright (c) 2004-2010 Atheros Communications Inc. - * All rights reserved. - * - * This file implements the Atheros PS and patch downloaded for HCI UART Transport driver. - * This file can be used for HCI SDIO transport implementation for AR6002 with HCI_TRANSPORT_SDIO - * defined. - * - * - * ar3kcpsconfig.c - * - * - * - * The software source and binaries included in this development package are - * licensed, not sold. You, or your company, received the package under one - * or more license agreements. The rights granted to you are specifically - * listed in these license agreement(s). All other rights remain with Atheros - * Communications, Inc., its subsidiaries, or the respective owner including - * those listed on the included copyright notices.. Distribution of any - * portion of this package must be in strict compliance with the license - * agreement(s) terms. - * - * - * - */ - - - -#include "ar3kpsconfig.h" -#ifndef HCI_TRANSPORT_SDIO -#include "hci_ath.h" -#include "hci_uart.h" -#endif /* #ifndef HCI_TRANSPORT_SDIO */ - -#define MAX_FW_PATH_LEN 50 -#define MAX_BDADDR_FORMAT_LENGTH 30 - -/* - * Structure used to send HCI packet, hci packet length and device info - * together as parameter to PSThread. - */ -typedef struct { - - PSCmdPacket *HciCmdList; - A_UINT32 num_packets; - AR3K_CONFIG_INFO *dev; -}HciCommandListParam; - -A_STATUS SendHCICommandWaitCommandComplete(AR3K_CONFIG_INFO *pConfig, - A_UINT8 *pHCICommand, - int CmdLength, - A_UINT8 **ppEventBuffer, - A_UINT8 **ppBufferToFree); - -void LoadHeader(A_UCHAR *HCI_PS_Command,A_UCHAR opcode,int length,int index); -A_UINT32 Rom_Version; -A_UINT32 Build_Version; -extern A_BOOL BDADDR; -extern A_UINT32 Patch_Count; - -A_STATUS getDeviceType(AR3K_CONFIG_INFO *pConfig, A_UINT32 * code); -A_STATUS ReadVersionInfo(AR3K_CONFIG_INFO *pConfig); -A_STATUS set_patch_ram(AR3K_CONFIG_INFO *pConfig,A_UCHAR *patch_loc,A_UINT8 len); -#ifndef HCI_TRANSPORT_SDIO - -DECLARE_WAIT_QUEUE_HEAD(PsCompleteEvent); -DECLARE_WAIT_QUEUE_HEAD(HciEvent); -A_UCHAR *HciEventpacket; -rwlock_t syncLock; -wait_queue_t Eventwait; - -int PSHciWritepacket(struct hci_dev*,A_UCHAR* Data, A_UINT32 len); -extern char *bdaddr; -#endif /* HCI_TRANSPORT_SDIO */ - -A_STATUS write_bdaddr(AR3K_CONFIG_INFO *pConfig,A_UCHAR *bdaddr,int type); - -int PSSendOps(void *arg); - -#ifdef BT_PS_DEBUG -void Hci_log(A_UCHAR * log_string,A_UCHAR *data,A_UINT32 len) -{ - int i; - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s : ",log_string)); - for (i = 0; i < len; i++) { - printk("0x%02x ", data[i]); - } - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("\n...................................\n")); -} -#else -#define Hci_log(string,data,len) -#endif /* BT_PS_DEBUG */ - - - - -A_STATUS AthPSInitialize(AR3K_CONFIG_INFO *hdev) -{ - A_STATUS status = A_OK; - if(hdev == NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Invalid Device handle received\n")); - return A_ERROR; - } - -#ifndef HCI_TRANSPORT_SDIO - DECLARE_WAITQUEUE(wait, current); -#endif /* HCI_TRANSPORT_SDIO */ - - -#ifdef HCI_TRANSPORT_SDIO - status = PSSendOps((void*)hdev); -#else - if(InitPSState(hdev) == -1) { - return A_ERROR; - } - allow_signal(SIGKILL); - add_wait_queue(&PsCompleteEvent,&wait); - set_current_state(TASK_INTERRUPTIBLE); - if(!kernel_thread(PSSendOps,(void*)hdev,CLONE_FS|CLONE_FILES|CLONE_SIGHAND|SIGCHLD)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Kthread Failed\n")); - remove_wait_queue(&PsCompleteEvent,&wait); - return A_ERROR; - } - wait_event_interruptible(PsCompleteEvent,(PSTagMode == FALSE)); - set_current_state(TASK_RUNNING); - remove_wait_queue(&PsCompleteEvent,&wait); - -#endif /* HCI_TRANSPORT_SDIO */ - - - return status; - -} - -int PSSendOps(void *arg) -{ - int i; - int ps_index; - int status = 0; - PSCmdPacket *HciCmdList; /* List storing the commands */ - const struct firmware* firmware; - A_UINT32 numCmds; - A_UINT8 *event; - A_UINT8 *bufferToFree; - struct hci_dev *device; - A_UCHAR *buffer; - A_UINT32 len; - A_UINT32 DevType; - A_UCHAR *PsFileName; - A_UCHAR *patchFileName; - A_UCHAR patch_loc[40]; - A_UCHAR *path = NULL; - A_UCHAR *config_path = NULL; - A_UCHAR config_bdaddr[MAX_BDADDR_FORMAT_LENGTH]; - AR3K_CONFIG_INFO *hdev = (AR3K_CONFIG_INFO*)arg; - struct device *firmwareDev = NULL; - A_UINT8 cFlags = 0; - A_UINT8 bit7 = 0; - - status = 0; - HciCmdList = NULL; -#ifdef HCI_TRANSPORT_SDIO - device = hdev->pBtStackHCIDev; - firmwareDev = device->parent; -#else - device = hdev; - firmwareDev = &device->dev; - AthEnableSyncCommandOp(TRUE); -#endif /* HCI_TRANSPORT_SDIO */ - /* First verify if the controller is an FPGA or ASIC, so depending on the device type the PS file to be written will be different. - */ - - path =(A_UCHAR *)A_MALLOC(MAX_FW_PATH_LEN); - if(path == NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Malloc failed to allocate %d bytes for path\n", MAX_FW_PATH_LEN)); - goto complete; - } - config_path = (A_UCHAR *) A_MALLOC(MAX_FW_PATH_LEN); - if(config_path == NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Malloc failed to allocate %d bytes for config_path\n", MAX_FW_PATH_LEN)); - goto complete; - } - - if(A_ERROR == getDeviceType(hdev,&DevType)) { - status = 1; - goto complete; - } - if(A_ERROR == ReadVersionInfo(hdev)) { - status = 1; - goto complete; - } - - patchFileName = PATCH_FILE; - snprintf(path, MAX_FW_PATH_LEN, "%s/%xcoex/",CONFIG_PATH,Rom_Version); - if(DevType){ - if(DevType == 0xdeadc0de){ - PsFileName = PS_ASIC_FILE; - } else{ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" FPGA Test Image : %x %x \n",Rom_Version,Build_Version)); - if((Rom_Version == 0x99999999) && (Build_Version == 1)){ - - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("FPGA Test Image : Skipping Patch File load\n")); - patchFileName = NULL; - } - PsFileName = PS_FPGA_FILE; - } - } - else{ - PsFileName = PS_ASIC_FILE; - } - - snprintf(config_path, MAX_FW_PATH_LEN, "%s%s",path,PsFileName); - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%x: FPGA/ASIC PS File Name %s\n", DevType,config_path)); - /* Read the PS file to a dynamically allocated buffer */ - if(A_REQUEST_FIRMWARE(&firmware,config_path,firmwareDev) < 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: firmware file open error\n", __FUNCTION__ )); - status = 1; - goto complete; - - } - if(NULL == firmware || firmware->size == 0) { - status = 1; - goto complete; - } - buffer = (A_UCHAR *)A_MALLOC(firmware->size); - if(buffer != NULL) { - /* Copy the read file to a local Dynamic buffer */ - memcpy(buffer,firmware->data,firmware->size); - len = firmware->size; - A_RELEASE_FIRMWARE(firmware); - /* Parse the PS buffer to a global variable */ - status = AthDoParsePS(buffer,len); - A_FREE(buffer); - } else { - A_RELEASE_FIRMWARE(firmware); - } - - - /* Read the patch file to a dynamically allocated buffer */ - if(patchFileName != NULL) - snprintf(config_path, - MAX_FW_PATH_LEN, "%s%s",path,patchFileName); - else { - status = 0; - } - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Patch File Name %s\n", config_path)); - if((patchFileName == NULL) || (A_REQUEST_FIRMWARE(&firmware,config_path,firmwareDev) < 0)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: firmware file open error\n", __FUNCTION__ )); - /* - * It is not necessary that Patch file be available, continue with PS Operations if. - * failed. - */ - status = 0; - - } else { - if(NULL == firmware || firmware->size == 0) { - status = 0; - } else { - buffer = (A_UCHAR *)A_MALLOC(firmware->size); - if(buffer != NULL) { - /* Copy the read file to a local Dynamic buffer */ - memcpy(buffer,firmware->data,firmware->size); - len = firmware->size; - A_RELEASE_FIRMWARE(firmware); - /* parse and store the Patch file contents to a global variables */ - patch_loc[0] = '\0'; - status = AthDoParsePatch(buffer,len, patch_loc); - - A_FREE(buffer); - } else { - A_RELEASE_FIRMWARE(firmware); - } - } - } - - /* Create an HCI command list from the parsed PS and patch information */ - AthCreateCommandList(&HciCmdList,&numCmds); -#define CONFIG_PLATFORM 0x21 -#define CONFIG_TLPM 0x23 -#define PLATFORM_CONFIG_BIT 0x01 -#define TLPM_CONFIG_BIT 0x02 -#define IDLE_TIMEOUT_OFFSET 12 -#define WAKEUP_TIMEOUT_OFFSET 8 -#define IDLE_TIMEOUT_DEFAULT_VAL 1000 -#define WAKEUP_TIMEOUT_DEFAULT_VAL 10 - - hdev->IdleTimeout = IDLE_TIMEOUT_DEFAULT_VAL; - hdev->WakeupTimeout = WAKEUP_TIMEOUT_DEFAULT_VAL; - hdev->PwrMgmtEnabled = 0; - - ps_index = 2; /* CRC + PS Reset */ - if (Patch_Count) - ps_index += Patch_Count + 1; /* Patches + Enable patch Cmd */ - - for(i = ps_index; i PwrMgmtEnabled = 1; - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("CONFIG PLATFORM present and Pwr Manage %x\n", hdev->PwrMgmtEnabled)); - } - } - else if((HciCmdList[i].Hcipacket[4] == CONFIG_TLPM) && - (HciCmdList[i].Hcipacket[5] == 0)) { - cFlags |= TLPM_CONFIG_BIT; - hdev->IdleTimeout = *((A_UINT32 *)&HciCmdList[i].Hcipacket[IDLE_TIMEOUT_OFFSET + 7]); - hdev->WakeupTimeout = *((A_UINT16 *)&HciCmdList[i].Hcipacket[WAKEUP_TIMEOUT_OFFSET + 7]); - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("hdev->idletimeout %d hdev->WakeupTimeout %d",hdev->IdleTimeout, hdev->WakeupTimeout)); - } - } - - - /* Form the parameter for PSSendOps() API */ - - - /* - * First Send the CRC packet, - * We have to continue with the PS operations only if the CRC packet has been replied with - * a Command complete event with status Error. - */ - - if(SendHCICommandWaitCommandComplete - (hdev, - HciCmdList[0].Hcipacket, - HciCmdList[0].packetLen, - &event, - &bufferToFree) == A_OK) { - if(ReadPSEvent(event) == A_OK) { /* Exit if the status is success */ - if(bufferToFree != NULL) { - A_FREE(bufferToFree); - } -#ifndef HCI_TRANSPORT_SDIO - if(bdaddr && bdaddr[0] !='\0') { - write_bdaddr(hdev,bdaddr,BDADDR_TYPE_STRING); - } -#endif - status = 1; - goto complete; - } - if(bufferToFree != NULL) { - A_FREE(bufferToFree); - } - } else { - status = 0; - goto complete; - } - /* Set Patch location */ - if(patch_loc[0] != '\0') { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Setting Patch Location %s\n", patch_loc)); - set_patch_ram(hdev,patch_loc,sizeof(patch_loc)); - } - for(i = 1; i ",HciCmdList[i].Hcipacket,HciCmdList[i].packetLen); - if(SendHCICommandWaitCommandComplete - (hdev, - HciCmdList[i].Hcipacket, - HciCmdList[i].packetLen, - &event, - &bufferToFree) == A_OK) { - if(ReadPSEvent(event) != A_OK) { /* Exit if the status is success */ - if(bufferToFree != NULL) { - A_FREE(bufferToFree); - } - status = 1; - goto complete; - } - if(bufferToFree != NULL) { - A_FREE(bufferToFree); - } - } else { - status = 0; - goto complete; - } - } -#ifdef HCI_TRANSPORT_SDIO - if(BDADDR == FALSE) - if(hdev->bdaddr[0] !=0x00 || - hdev->bdaddr[1] !=0x00 || - hdev->bdaddr[2] !=0x00 || - hdev->bdaddr[3] !=0x00 || - hdev->bdaddr[4] !=0x00 || - hdev->bdaddr[5] !=0x00) - write_bdaddr(hdev,hdev->bdaddr,BDADDR_TYPE_HEX); - - - /* if Platform config is present and TLPM is not available - * write HCI command for TLPM with default timeout values */ - if(bit7 && !(cFlags & TLPM_CONFIG_BIT)) { - A_UCHAR TLPMHciCmd[] = {0x0b, 0xfc, 0x1c, 0x01, 0x23, 0x00, 0x18, - 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0a, 0x00, 0x0a, 0x00, 0xe8, 0x03, - 0x00, 0x00, 0xe8, 0x03, 0x00, 0x00, 0xe8, - 0x03, 0x00, 0x00 }; - int CmdLen = sizeof(TLPMHciCmd); - - *((A_UINT32 *)&TLPMHciCmd[IDLE_TIMEOUT_OFFSET + 7]) = hdev->IdleTimeout; - *((A_UINT16 *)&TLPMHciCmd[WAKEUP_TIMEOUT_OFFSET + 7]) = hdev->WakeupTimeout; - - if(SendHCICommandWaitCommandComplete - (hdev, - TLPMHciCmd, - CmdLen, - &event, - &bufferToFree) == A_OK) { - if(ReadPSEvent(event) != A_OK) { /* Exit if the status is success */ - if(bufferToFree != NULL) { - A_FREE(bufferToFree); - } - status = 1; - goto complete; - } - if(bufferToFree != NULL) { - A_FREE(bufferToFree); - } - } else { - status = 0; - goto complete; - } - } - -#ifndef HCI_TRANSPORT_SDIO - - if(bdaddr && bdaddr[0] != '\0') { - write_bdaddr(hdev,bdaddr,BDADDR_TYPE_STRING); - } else -#endif /* HCI_TRANSPORT_SDIO */ - /* Write BDADDR Read from OTP here */ - - - -#endif - - { - /* Read Contents of BDADDR file if user has not provided any option */ - snprintf(config_path,MAX_FW_PATH_LEN, "%s%s",path,BDADDR_FILE); - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BDADDR File Name %s\n", config_path)); - if(A_REQUEST_FIRMWARE(&firmware,config_path,firmwareDev) < 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: firmware file open error\n", __FUNCTION__ )); - goto complete; - } - if(NULL == firmware || firmware->size == 0) { - goto complete; - } - len = (firmware->size > MAX_BDADDR_FORMAT_LENGTH)? MAX_BDADDR_FORMAT_LENGTH: firmware->size; - memcpy(config_bdaddr, firmware->data,len); - config_bdaddr[len] = '\0'; - write_bdaddr(hdev,config_bdaddr,BDADDR_TYPE_STRING); - A_RELEASE_FIRMWARE(firmware); - } -complete: -#ifndef HCI_TRANSPORT_SDIO - AthEnableSyncCommandOp(FALSE); - PSTagMode = FALSE; - wake_up_interruptible(&PsCompleteEvent); -#endif /* HCI_TRANSPORT_SDIO */ - if(NULL != HciCmdList) { - AthFreeCommandList(&HciCmdList,numCmds); - } - if(path) { - A_FREE(path); - } - if(config_path) { - A_FREE(config_path); - } - return status; -} -#ifndef HCI_TRANSPORT_SDIO -/* - * This API is used to send the HCI command to controller and return - * with a HCI Command Complete event. - * For HCI SDIO transport, this will be internally defined. - */ -A_STATUS SendHCICommandWaitCommandComplete(AR3K_CONFIG_INFO *pConfig, - A_UINT8 *pHCICommand, - int CmdLength, - A_UINT8 **ppEventBuffer, - A_UINT8 **ppBufferToFree) -{ - if(CmdLength == 0) { - return A_ERROR; - } - Hci_log("COM Write -->",pHCICommand,CmdLength); - PSAcked = FALSE; - if(PSHciWritepacket(pConfig,pHCICommand,CmdLength) == 0) { - /* If the controller is not available, return Error */ - return A_ERROR; - } - //add_timer(&psCmdTimer); - wait_event_interruptible(HciEvent,(PSAcked == TRUE)); - if(NULL != HciEventpacket) { - *ppEventBuffer = HciEventpacket; - *ppBufferToFree = HciEventpacket; - } else { - /* Did not get an event from controller. return error */ - *ppBufferToFree = NULL; - return A_ERROR; - } - - return A_OK; -} -#endif /* HCI_TRANSPORT_SDIO */ - -A_STATUS ReadPSEvent(A_UCHAR* Data){ - - if(Data[4] == 0xFC && Data[5] == 0x00) - { - switch(Data[3]){ - case 0x0B: - return A_OK; - break; - case 0x0C: - /* Change Baudrate */ - return A_OK; - break; - case 0x04: - return A_OK; - break; - case 0x1E: - Rom_Version = Data[9]; - Rom_Version = ((Rom_Version << 8) |Data[8]); - Rom_Version = ((Rom_Version << 8) |Data[7]); - Rom_Version = ((Rom_Version << 8) |Data[6]); - - Build_Version = Data[13]; - Build_Version = ((Build_Version << 8) |Data[12]); - Build_Version = ((Build_Version << 8) |Data[11]); - Build_Version = ((Build_Version << 8) |Data[10]); - return A_OK; - break; - - - } - } - - return A_ERROR; -} -int str2ba(unsigned char *str_bdaddr,unsigned char *bdaddr) -{ - unsigned char bdbyte[3]; - unsigned char *str_byte = str_bdaddr; - int i,j; - unsigned char colon_present = 0; - - if(NULL != strstr(str_bdaddr,":")) { - colon_present = 1; - } - - - bdbyte[2] = '\0'; - - for( i = 0,j = 5; i < 6; i++, j--) { - bdbyte[0] = str_byte[0]; - bdbyte[1] = str_byte[1]; - bdaddr[j] = A_STRTOL(bdbyte,NULL,16); - if(colon_present == 1) { - str_byte+=3; - } else { - str_byte+=2; - } - } - return 0; -} -A_STATUS set_patch_ram(AR3K_CONFIG_INFO *pConfig,A_UCHAR *patch_loc,A_UINT8 len) -{ - A_UCHAR cmd[] = { 0x0B, 0xFC, 0x07, 0x0D, 0x00, 0x00, 0x00, /* Loc */0x00, 0x00, 0x00, 0x00 }; - A_UCHAR i,j; - unsigned char loc_byte[3]; - A_UINT8 *event; - A_UINT8 *bufferToFree = NULL; - A_STATUS result = A_ERROR; - A_UCHAR *loc_ptr = &cmd[7]; - - if(!patch_loc) - return result; - - loc_byte[2] = '\0'; - - LoadHeader(cmd, 0x0D, 4, 0); - for( i = 0,j = 3; i < 4; i++, j--) { - loc_byte[0] = patch_loc[0]; - loc_byte[1] = patch_loc[1]; - loc_ptr[j] = A_STRTOL(loc_byte,NULL,16); - patch_loc+=2; - } - Hci_log("Patch Ram Write -->",cmd, sizeof(cmd)); - if(A_OK == SendHCICommandWaitCommandComplete(pConfig,cmd, - sizeof(cmd), - &event,&bufferToFree)) { - - result = ReadPSEvent(event); - - } - if(bufferToFree != NULL) { - A_FREE(bufferToFree); - } - return result; - -} -A_STATUS write_bdaddr(AR3K_CONFIG_INFO *pConfig,A_UCHAR *bdaddr,int type) -{ - A_UCHAR bdaddr_cmd[] = { 0x0B, 0xFC, 0x0A, 0x01, 0x01, - 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - A_UINT8 *event; - A_UINT8 *bufferToFree = NULL; - A_STATUS result = A_ERROR; - int inc,outc; - - if (type == BDADDR_TYPE_STRING) - str2ba(bdaddr,&bdaddr_cmd[7]); - else { - /* Bdaddr has to be sent as LAP first */ - for(inc = 5 ,outc = 7; inc >=0; inc--, outc++) - bdaddr_cmd[outc] = bdaddr[inc]; - } - - Hci_log("BDADDR Write -->",bdaddr_cmd,sizeof(bdaddr_cmd)); - if(A_OK == SendHCICommandWaitCommandComplete(pConfig,bdaddr_cmd, - sizeof(bdaddr_cmd), - &event,&bufferToFree)) { - - if(event[4] == 0xFC && event[5] == 0x00){ - if(event[3] == 0x0B){ - result = A_OK; - } - } - - } - if(bufferToFree != NULL) { - A_FREE(bufferToFree); - } - return result; - -} -A_STATUS ReadVersionInfo(AR3K_CONFIG_INFO *pConfig) -{ - A_UINT8 hciCommand[] = {0x1E,0xfc,0x00}; - A_UINT8 *event; - A_UINT8 *bufferToFree = NULL; - A_STATUS result = A_ERROR; - Hci_log("Read Version -->",hciCommand,sizeof(hciCommand)); - if(A_OK == SendHCICommandWaitCommandComplete(pConfig,hciCommand,sizeof(hciCommand),&event,&bufferToFree)) { - result = ReadPSEvent(event); - - } - if(bufferToFree != NULL) { - A_FREE(bufferToFree); - } - return result; -} -A_STATUS getDeviceType(AR3K_CONFIG_INFO *pConfig, A_UINT32 * code) -{ - A_UINT8 hciCommand[] = {0x05,0xfc,0x05,0x00,0x00,0x00,0x00,0x04}; - A_UINT8 *event; - A_UINT8 *bufferToFree = NULL; - A_UINT32 reg; - A_STATUS result = A_ERROR; - *code = 0; - hciCommand[3] = (A_UINT8)(FPGA_REGISTER & 0xFF); - hciCommand[4] = (A_UINT8)((FPGA_REGISTER >> 8) & 0xFF); - hciCommand[5] = (A_UINT8)((FPGA_REGISTER >> 16) & 0xFF); - hciCommand[6] = (A_UINT8)((FPGA_REGISTER >> 24) & 0xFF); - if(A_OK == SendHCICommandWaitCommandComplete(pConfig,hciCommand,sizeof(hciCommand),&event,&bufferToFree)) { - - if(event[4] == 0xFC && event[5] == 0x00){ - switch(event[3]){ - case 0x05: - reg = event[9]; - reg = ((reg << 8) |event[8]); - reg = ((reg << 8) |event[7]); - reg = ((reg << 8) |event[6]); - *code = reg; - result = A_OK; - - break; - case 0x06: - //Sleep(500); - break; - } - } - - } - if(bufferToFree != NULL) { - A_FREE(bufferToFree); - } - return result; -} - - diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3kps/ar3kpsconfig.h b/drivers/net/wireless/ar6003/host/miscdrv/ar3kps/ar3kpsconfig.h deleted file mode 100644 index 4358834f6d71..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3kps/ar3kpsconfig.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2004-2010 Atheros Communications Inc. - * All rights reserved. - * - * This file defines the symbols exported by Atheros PS and patch download module. - * define the constant HCI_TRANSPORT_SDIO if the module is being used for HCI SDIO transport. - * defined. - * - * - * ar3kcpsconfig.h - * - * - * - * The software source and binaries included in this development package are - * licensed, not sold. You, or your company, received the package under one - * or more license agreements. The rights granted to you are specifically - * listed in these license agreement(s). All other rights remain with Atheros - * Communications, Inc., its subsidiaries, or the respective owner including - * those listed on the included copyright notices.. Distribution of any - * portion of this package must be in strict compliance with the license - * agreement(s) terms. - * - * - * - */ - - - -#ifndef __AR3KPSCONFIG_H -#define __AR3KPSCONFIG_H - -/* - * Define the flag HCI_TRANSPORT_SDIO and undefine HCI_TRANSPORT_UART if the transport being used is SDIO. - */ -#undef HCI_TRANSPORT_UART - -#include -#include -#include -#include -#include - - -#include -#include -#include -#include - - -#include -#include - -#include "ar3kpsparser.h" - -#define FPGA_REGISTER 0x4FFC -#define BDADDR_TYPE_STRING 0 -#define BDADDR_TYPE_HEX 1 -#define CONFIG_PATH "ar3k" - -#define PS_ASIC_FILE "PS_ASIC.pst" -#define PS_FPGA_FILE "PS_FPGA.pst" - -#define PATCH_FILE "RamPatch.txt" -#define BDADDR_FILE "ar3kbdaddr.pst" - -#define ROM_VER_AR3001_3_1_0 30000 -#define ROM_VER_AR3001_3_1_1 30101 - - -#ifndef HCI_TRANSPORT_SDIO -#define AR3K_CONFIG_INFO struct hci_dev -extern wait_queue_head_t HciEvent; -extern wait_queue_t Eventwait; -extern A_UCHAR *HciEventpacket; -#endif /* #ifndef HCI_TRANSPORT_SDIO */ - -A_STATUS AthPSInitialize(AR3K_CONFIG_INFO *hdev); -A_STATUS ReadPSEvent(A_UCHAR* Data); -#endif /* __AR3KPSCONFIG_H */ diff --git a/drivers/net/wireless/ar6003/host/miscdrv/ar3kps/ar3kpsparser.c b/drivers/net/wireless/ar6003/host/miscdrv/ar3kps/ar3kpsparser.c deleted file mode 100644 index d59ba438a428..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/ar3kps/ar3kpsparser.c +++ /dev/null @@ -1,989 +0,0 @@ -/* - * Copyright (c) 2004-2010 Atheros Communications Inc. - * All rights reserved. - * - * This file implements the Atheros PS and patch parser. - * It implements APIs to parse data buffer with patch and PS information and convert it to HCI commands. - * - * - * - * ar3kpsparser.c - * - * - * - * The software source and binaries included in this development package are - * licensed, not sold. You, or your company, received the package under one - * or more license agreements. The rights granted to you are specifically - * listed in these license agreement(s). All other rights remain with Atheros - * Communications, Inc., its subsidiaries, or the respective owner including - * those listed on the included copyright notices.. Distribution of any - * portion of this package must be in strict compliance with the license - * agreement(s) terms. - * - * - * - */ - - -#include "ar3kpsparser.h" - -#define BD_ADDR_SIZE 6 -#define WRITE_PATCH 8 -#define ENABLE_PATCH 11 -#define PS_RESET 2 -#define PS_WRITE 1 -#define PS_VERIFY_CRC 9 -#define CHANGE_BDADDR 15 - -#define HCI_COMMAND_HEADER 7 - -#define HCI_EVENT_SIZE 7 - -#define WRITE_PATCH_COMMAND_STATUS_OFFSET 5 - -#define PS_RAM_SIZE 2048 - -#define RAM_PS_REGION (1<<0) -#define RAM_PATCH_REGION (1<<1) -#define RAMPS_MAX_PS_DATA_PER_TAG 20000 -#define MAX_RADIO_CFG_TABLE_SIZE 244 -#define RAMPS_MAX_PS_TAGS_PER_FILE 50 - -#define PS_MAX_LEN 500 -#define LINE_SIZE_MAX (PS_MAX_LEN *2) - -/* Constant values used by parser */ -#define BYTES_OF_PS_DATA_PER_LINE 16 -#define RAMPS_MAX_PS_DATA_PER_TAG 20000 - - -/* Number pf PS/Patch entries in an HCI packet */ -#define MAX_BYTE_LENGTH 244 - -#define SKIP_BLANKS(str) while (*str == ' ') str++ -#define MIN(x, y) (((x) <= (y))? (x):(y)) -#define MAX(x, y) (((x) >= (y))? (x):(y)) - -#define UNUSED(x) (x=x) - -#define IS_BETWEEN(x, lower, upper) (((lower) <= (x)) && ((x) <= (upper))) -#define IS_DIGIT(c) (IS_BETWEEN((c), '0', '9')) -#define IS_HEX(c) (IS_BETWEEN((c), '0', '9') || IS_BETWEEN((c), 'a', 'f') || IS_BETWEEN((c), 'A', 'F')) -#define TO_LOWER(c) (IS_BETWEEN((c), 'A', 'Z') ? ((c) - 'A' + 'a') : (c)) -#define IS_BLANK(c) ((c) == ' ') -#define CONV_DEC_DIGIT_TO_VALUE(c) ((c) - '0') -#define CONV_HEX_DIGIT_TO_VALUE(c) (IS_DIGIT(c) ? ((c) - '0') : (IS_BETWEEN((c), 'A', 'Z') ? ((c) - 'A' + 10) : ((c) - 'a' + 10))) -#define CONV_VALUE_TO_HEX(v) ((A_UINT8)( ((v & 0x0F) <= 9) ? ((v & 0x0F) + '0') : ((v & 0x0F) - 10 + 'A') ) ) - - -enum MinBootFileFormatE -{ - MB_FILEFORMAT_RADIOTBL, - MB_FILEFORMAT_PATCH, - MB_FILEFORMAT_COEXCONFIG -}; - -enum RamPsSection -{ - RAM_PS_SECTION, - RAM_PATCH_SECTION, - RAM_DYN_MEM_SECTION -}; - -enum eType { - eHex, - edecimal -}; - - -typedef struct tPsTagEntry -{ - A_UINT32 TagId; - A_UINT32 TagLen; - A_UINT8 *TagData; -} tPsTagEntry, *tpPsTagEntry; - -typedef struct tRamPatch -{ - A_UINT16 Len; - A_UINT8 * Data; -} tRamPatch, *ptRamPatch; - - - -typedef struct ST_PS_DATA_FORMAT { - enum eType eDataType; - A_BOOL bIsArray; -}ST_PS_DATA_FORMAT; - -typedef struct ST_READ_STATUS { - unsigned uTagID; - unsigned uSection; - unsigned uLineCount; - unsigned uCharCount; - unsigned uByteCount; -}ST_READ_STATUS; - - -/* Stores the number of PS Tags */ -static A_UINT32 Tag_Count = 0; - -/* Stores the number of patch commands */ -A_UINT32 Patch_Count = 0; -static A_UINT32 Total_tag_lenght = 0; -A_BOOL BDADDR = FALSE; -A_UINT32 StartTagId; - -tPsTagEntry PsTagEntry[RAMPS_MAX_PS_TAGS_PER_FILE]; -tRamPatch RamPatch[MAX_NUM_PATCH_ENTRY]; - - -A_STATUS AthParseFilesUnified(A_UCHAR *srcbuffer,A_UINT32 srclen, int FileFormat); -char AthReadChar(A_UCHAR *buffer, A_UINT32 len,A_UINT32 *pos); -char * AthGetLine(char * buffer, int maxlen, A_UCHAR *srcbuffer,A_UINT32 len,A_UINT32 *pos); -static A_STATUS AthPSCreateHCICommand(A_UCHAR Opcode, A_UINT32 Param1,PSCmdPacket *PSPatchPacket,A_UINT32 *index); - -/* Function to reads the next character from the input buffer */ -char AthReadChar(A_UCHAR *buffer, A_UINT32 len,A_UINT32 *pos) -{ - char Ch; - if(buffer == NULL || *pos >=len ) - { - return '\0'; - } else { - Ch = buffer[*pos]; - (*pos)++; - return Ch; - } -} -/* PS parser helper function */ -unsigned int uGetInputDataFormat(char* pCharLine, ST_PS_DATA_FORMAT *pstFormat) -{ - if(pCharLine[0] != '[') { - pstFormat->eDataType = eHex; - pstFormat->bIsArray = true; - return 0; - } - switch(pCharLine[1]) { - case 'H': - case 'h': - if(pCharLine[2]==':') { - if((pCharLine[3]== 'a') || (pCharLine[3]== 'A')) { - if(pCharLine[4] == ']') { - pstFormat->eDataType = eHex; - pstFormat->bIsArray = true; - pCharLine += 5; - return 0; - } - else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Illegal Data format\n")); //[H:A - return 1; - } - } - if((pCharLine[3]== 'S') || (pCharLine[3]== 's')) { - if(pCharLine[4] == ']') { - pstFormat->eDataType = eHex; - pstFormat->bIsArray = false; - pCharLine += 5; - return 0; - } - else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Illegal Data format\n")); //[H:A - return 1; - } - } - else if(pCharLine[3] == ']') { //[H:] - pstFormat->eDataType = eHex; - pstFormat->bIsArray = true; - pCharLine += 4; - return 0; - } - else { //[H: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Illegal Data format\n")); - return 1; - } - } - else if(pCharLine[2]==']') { //[H] - pstFormat->eDataType = eHex; - pstFormat->bIsArray = true; - pCharLine += 3; - return 0; - } - else { //[H - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Illegal Data format\n")); - return 1; - } - break; - - case 'A': - case 'a': - if(pCharLine[2]==':') { - if((pCharLine[3]== 'h') || (pCharLine[3]== 'H')) { - if(pCharLine[4] == ']') { - pstFormat->eDataType = eHex; - pstFormat->bIsArray = true; - pCharLine += 5; - return 0; - } - else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Illegal Data format 1\n")); //[A:H - return 1; - } - } - else if(pCharLine[3]== ']') { //[A:] - pstFormat->eDataType = eHex; - pstFormat->bIsArray = true; - pCharLine += 4; - return 0; - } - else { //[A: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Illegal Data format 2\n")); - return 1; - } - } - else if(pCharLine[2]==']') { //[H] - pstFormat->eDataType = eHex; - pstFormat->bIsArray = true; - pCharLine += 3; - return 0; - } - else { //[H - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Illegal Data format 3\n")); - return 1; - } - break; - - case 'S': - case 's': - if(pCharLine[2]==':') { - if((pCharLine[3]== 'h') || (pCharLine[3]== 'H')) { - if(pCharLine[4] == ']') { - pstFormat->eDataType = eHex; - pstFormat->bIsArray = true; - pCharLine += 5; - return 0; - } - else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Illegal Data format 5\n")); //[A:H - return 1; - } - } - else if(pCharLine[3]== ']') { //[A:] - pstFormat->eDataType = eHex; - pstFormat->bIsArray = true; - pCharLine += 4; - return 0; - } - else { //[A: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Illegal Data format 6\n")); - return 1; - } - } - else if(pCharLine[2]==']') { //[H] - pstFormat->eDataType = eHex; - pstFormat->bIsArray = true; - pCharLine += 3; - return 0; - } - else { //[H - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Illegal Data format 7\n")); - return 1; - } - break; - - default: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Illegal Data format 8\n")); - return 1; - } -} - -unsigned int uReadDataInSection(char *pCharLine, ST_PS_DATA_FORMAT stPS_DataFormat) -{ - char *pTokenPtr = pCharLine; - - if(pTokenPtr[0] == '[') { - while(pTokenPtr[0] != ']' && pTokenPtr[0] != '\0') { - pTokenPtr++; - } - if(pTokenPtr[0] == '\0') { - return (0x0FFF); - } - pTokenPtr++; - - - } - if(stPS_DataFormat.eDataType == eHex) { - if(stPS_DataFormat.bIsArray == true) { - //Not implemented - return (0x0FFF); - } - else { - return (A_STRTOL(pTokenPtr, NULL, 16)); - } - } - else { - //Not implemented - return (0x0FFF); - } -} -A_STATUS AthParseFilesUnified(A_UCHAR *srcbuffer,A_UINT32 srclen, int FileFormat) -{ - char *Buffer; - char *pCharLine; - A_UINT8 TagCount; - A_UINT16 ByteCount; - A_UINT8 ParseSection=RAM_PS_SECTION; - A_UINT32 pos; - - - - int uReadCount; - ST_PS_DATA_FORMAT stPS_DataFormat; - ST_READ_STATUS stReadStatus = {0, 0, 0,0}; - pos = 0; - Buffer = NULL; - - if (srcbuffer == NULL || srclen == 0) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Could not open .\n")); - return A_ERROR; - } - TagCount = 0; - ByteCount = 0; - Buffer = A_MALLOC(LINE_SIZE_MAX + 1); - if(NULL == Buffer) { - return A_ERROR; - } - if (FileFormat == MB_FILEFORMAT_PATCH) - { - int LineRead = 0; - while((pCharLine = AthGetLine(Buffer, LINE_SIZE_MAX, srcbuffer,srclen,&pos)) != NULL) - { - - SKIP_BLANKS(pCharLine); - - // Comment line or empty line - if ((pCharLine[0] == '/') && (pCharLine[1] == '/')) - { - continue; - } - - if ((pCharLine[0] == '#')) { - if (stReadStatus.uSection != 0) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("error\n")); - if(Buffer != NULL) { - A_FREE(Buffer); - } - return A_ERROR; - } - else { - stReadStatus.uSection = 1; - continue; - } - } - if ((pCharLine[0] == '/') && (pCharLine[1] == '*')) - { - pCharLine+=2; - SKIP_BLANKS(pCharLine); - - if(!strncmp(pCharLine,"PA",2)||!strncmp(pCharLine,"Pa",2)||!strncmp(pCharLine,"pa",2)) - ParseSection=RAM_PATCH_SECTION; - - if(!strncmp(pCharLine,"DY",2)||!strncmp(pCharLine,"Dy",2)||!strncmp(pCharLine,"dy",2)) - ParseSection=RAM_DYN_MEM_SECTION; - - if(!strncmp(pCharLine,"PS",2)||!strncmp(pCharLine,"Ps",2)||!strncmp(pCharLine,"ps",2)) - ParseSection=RAM_PS_SECTION; - - LineRead = 0; - stReadStatus.uSection = 0; - - continue; - } - - switch(ParseSection) - { - case RAM_PS_SECTION: - { - if (stReadStatus.uSection == 1) //TagID - { - SKIP_BLANKS(pCharLine); - if(uGetInputDataFormat(pCharLine, &stPS_DataFormat)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("uGetInputDataFormat fail\n")); - if(Buffer != NULL) { - A_FREE(Buffer); - } - return A_ERROR; - } - //pCharLine +=5; - PsTagEntry[TagCount].TagId = uReadDataInSection(pCharLine, stPS_DataFormat); - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" TAG ID %d \n",PsTagEntry[TagCount].TagId)); - - //AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("tag # %x\n", PsTagEntry[TagCount].TagId); - if (TagCount == 0) - { - StartTagId = PsTagEntry[TagCount].TagId; - } - stReadStatus.uSection = 2; - } - else if (stReadStatus.uSection == 2) //TagLength - { - - if(uGetInputDataFormat(pCharLine, &stPS_DataFormat)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("uGetInputDataFormat fail \n")); - if(Buffer != NULL) { - A_FREE(Buffer); - } - return A_ERROR; - } - //pCharLine +=5; - ByteCount = uReadDataInSection(pCharLine, stPS_DataFormat); - - //AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("tag length %x\n", ByteCount)); - if (ByteCount > LINE_SIZE_MAX/2) - { - if(Buffer != NULL) { - A_FREE(Buffer); - } - return A_ERROR; - } - PsTagEntry[TagCount].TagLen = ByteCount; - PsTagEntry[TagCount].TagData = (A_UINT8*)A_MALLOC(ByteCount); - stReadStatus.uSection = 3; - stReadStatus.uLineCount = 0; - } - else if( stReadStatus.uSection == 3) { //Data - - if(stReadStatus.uLineCount == 0) { - if(uGetInputDataFormat(pCharLine,&stPS_DataFormat)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("uGetInputDataFormat Fail\n")); - if(Buffer != NULL) { - A_FREE(Buffer); - } - return A_ERROR; - } - //pCharLine +=5; - } - SKIP_BLANKS(pCharLine); - stReadStatus.uCharCount = 0; - if(pCharLine[stReadStatus.uCharCount] == '[') { - while(pCharLine[stReadStatus.uCharCount] != ']' && pCharLine[stReadStatus.uCharCount] != '\0' ) { - stReadStatus.uCharCount++; - } - if(pCharLine[stReadStatus.uCharCount] == ']' ) { - stReadStatus.uCharCount++; - } else { - stReadStatus.uCharCount = 0; - } - } - uReadCount = (ByteCount > BYTES_OF_PS_DATA_PER_LINE)? BYTES_OF_PS_DATA_PER_LINE: ByteCount; - //AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" ")); - if((stPS_DataFormat.eDataType == eHex) && stPS_DataFormat.bIsArray == true) { - while(uReadCount > 0) { - PsTagEntry[TagCount].TagData[stReadStatus.uByteCount] = - (A_UINT8)(CONV_HEX_DIGIT_TO_VALUE(pCharLine[stReadStatus.uCharCount]) << 4) - | (A_UINT8)(CONV_HEX_DIGIT_TO_VALUE(pCharLine[stReadStatus.uCharCount + 1])); - - PsTagEntry[TagCount].TagData[stReadStatus.uByteCount+1] = - (A_UINT8)(CONV_HEX_DIGIT_TO_VALUE(pCharLine[stReadStatus.uCharCount + 3]) << 4) - | (A_UINT8)(CONV_HEX_DIGIT_TO_VALUE(pCharLine[stReadStatus.uCharCount + 4])); - - stReadStatus.uCharCount += 6; // read two bytes, plus a space; - stReadStatus.uByteCount += 2; - uReadCount -= 2; - } - if(ByteCount > BYTES_OF_PS_DATA_PER_LINE) { - ByteCount -= BYTES_OF_PS_DATA_PER_LINE; - } - else { - ByteCount = 0; - } - } - else { - //to be implemented - } - - stReadStatus.uLineCount++; - - if(ByteCount == 0) { - stReadStatus.uSection = 0; - stReadStatus.uCharCount = 0; - stReadStatus.uLineCount = 0; - stReadStatus.uByteCount = 0; - } - else { - stReadStatus.uCharCount = 0; - } - - if((stReadStatus.uSection == 0)&&(++TagCount == RAMPS_MAX_PS_TAGS_PER_FILE)) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("\n Buffer over flow PS File too big!!!")); - if(Buffer != NULL) { - A_FREE(Buffer); - } - return A_ERROR; - //Sleep (3000); - //exit(1); - } - - } - } - - break; - default: - { - if(Buffer != NULL) { - A_FREE(Buffer); - } - return A_ERROR; - } - break; - } - LineRead++; - } - Tag_Count = TagCount; - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Number of Tags %d\n", Tag_Count)); - } - - - if (TagCount > RAMPS_MAX_PS_TAGS_PER_FILE) - { - - if(Buffer != NULL) { - A_FREE(Buffer); - } - return A_ERROR; - } - - if(Buffer != NULL) { - A_FREE(Buffer); - } - return A_OK; - -} - - - -/********************/ - - -A_STATUS GetNextTwoChar(A_UCHAR *srcbuffer,A_UINT32 len, A_UINT32 *pos, char * buffer) -{ - unsigned char ch; - - ch = AthReadChar(srcbuffer,len,pos); - if(ch != '\0' && IS_HEX(ch)) { - buffer[0] = ch; - } else - { - return A_ERROR; - } - ch = AthReadChar(srcbuffer,len,pos); - if(ch != '\0' && IS_HEX(ch)) { - buffer[1] = ch; - } else - { - return A_ERROR; - } - return A_OK; -} -#define PATCH_LOC_KEY "DA:" -#define PATCH_LOC_STRING_LEN 8 -A_STATUS AthDoParsePatch(A_UCHAR *patchbuffer, A_UINT32 patchlen, A_UCHAR *patch_loc) -{ - - char Byte[3]; - char Line[MAX_BYTE_LENGTH + 1]; - int ByteCount,ByteCount_Org; - int count; - int i,j,k; - int data; - A_UINT32 filepos; - Byte[2] = '\0'; - j = 0; - filepos = 0; - Patch_Count = 0; - - if(!patch_loc) - return A_ERROR; - - while(NULL != AthGetLine(Line,MAX_BYTE_LENGTH,patchbuffer,patchlen,&filepos)) { - if(strlen(Line) <= 1) { - continue; - } else if (strstr(Line, PATCH_LOC_KEY) == Line) { - strncpy(patch_loc, &Line[sizeof(PATCH_LOC_KEY) -1],PATCH_LOC_STRING_LEN); - patch_loc[PATCH_LOC_STRING_LEN] = '\0'; - continue; - } else if(IS_HEX(Line[0])){ - break; - } else { - return A_ERROR; - } - } - ByteCount = A_STRTOL(Line, NULL, 16); - ByteCount_Org = ByteCount; - - if(!ByteCount) - return A_ERROR; - - while(ByteCount > MAX_BYTE_LENGTH){ - - /* Handle case when the number of patch buffer is more than the 20K */ - if(MAX_NUM_PATCH_ENTRY == Patch_Count) { - for(i = 0; i < Patch_Count; i++) { - A_FREE(RamPatch[i].Data); - } - return A_ERROR; - } - RamPatch[Patch_Count].Len= MAX_BYTE_LENGTH; - RamPatch[Patch_Count].Data = (A_UINT8*)A_MALLOC(MAX_BYTE_LENGTH); - Patch_Count ++; - - - ByteCount= ByteCount - MAX_BYTE_LENGTH; - } - - RamPatch[Patch_Count].Len= (ByteCount & 0xFF); - if(ByteCount != 0) { - RamPatch[Patch_Count].Data = (A_UINT8*)A_MALLOC(ByteCount); - Patch_Count ++; - } - count = 0; - while(ByteCount_Org > MAX_BYTE_LENGTH){ - for (i = 0,k=0; i < MAX_BYTE_LENGTH*2; i += 2,k++,count +=2) { - if(GetNextTwoChar(patchbuffer,patchlen,&filepos,Byte) == A_ERROR) { - return A_ERROR; - } - data = A_STRTOUL(&Byte[0], NULL, 16); - RamPatch[j].Data[k] = (data & 0xFF); - - - } - j++; - ByteCount_Org = ByteCount_Org - MAX_BYTE_LENGTH; - } - if(j == 0){ - j++; - } - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" Index [%d]\n",j)); - for (k=0; k < ByteCount_Org; i += 2,k++,count+=2) { - if(GetNextTwoChar(patchbuffer,patchlen,&filepos,Byte) == A_ERROR) { - return A_ERROR; - } - data = A_STRTOUL(Byte, NULL, 16); - RamPatch[j].Data[k] = (data & 0xFF); - - - } - return A_OK; -} - - -/********************/ -A_STATUS AthDoParsePS(A_UCHAR *srcbuffer, A_UINT32 srclen) -{ - A_STATUS status; - int i; - A_BOOL BDADDR_Present = A_ERROR; - - Tag_Count = 0; - - Total_tag_lenght = 0; - BDADDR = FALSE; - - - status = A_ERROR; - - if(NULL != srcbuffer && srclen != 0) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("File Open Operation Successful\n")); - - status = AthParseFilesUnified(srcbuffer,srclen,MB_FILEFORMAT_PATCH); - } - - - - if(Tag_Count == 0){ - Total_tag_lenght = 10; - - } - else{ - for(i=0; i 0 && !BDADDR_Present){ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BD ADDR is not present adding 10 extra bytes \r\n")); - Total_tag_lenght=Total_tag_lenght + 10; - } - Total_tag_lenght = Total_tag_lenght+ 10 + (Tag_Count*4); - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("** Total Length %d\n",Total_tag_lenght)); - - - return status; -} -char * AthGetLine(char * buffer, int maxlen, A_UCHAR *srcbuffer,A_UINT32 len,A_UINT32 *pos) -{ - - int count; - static short flag; - char CharRead; - count = 0; - flag = A_ERROR; - - do - { - CharRead = AthReadChar(srcbuffer,len,pos); - if( CharRead == '\0' ) { - buffer[count+1] = '\0'; - if(count == 0) { - return NULL; - } - else { - return buffer; - } - } - - if(CharRead == 13) { - } else if(CharRead == 10) { - buffer[count] ='\0'; - flag = A_ERROR; - return buffer; - }else { - buffer[count++] = CharRead; - } - - } - while(count < maxlen-1 && CharRead != '\0'); - buffer[count] = '\0'; - - return buffer; -} - -void LoadHeader(A_UCHAR *HCI_PS_Command,A_UCHAR opcode,int length,int index){ - - HCI_PS_Command[0]= 0x0B; - HCI_PS_Command[1]= 0xFC; - HCI_PS_Command[2]= length + 4; - HCI_PS_Command[3]= opcode; - HCI_PS_Command[4]= (index & 0xFF); - HCI_PS_Command[5]= ((index>>8) & 0xFF); - HCI_PS_Command[6]= length; -} - -///////////////////////// -// -int AthCreateCommandList(PSCmdPacket **HciPacketList, A_UINT32 *numPackets) -{ - - A_UINT8 count; - A_UINT32 NumcmdEntry = 0; - - A_UINT32 Crc = 0; - *numPackets = 0; - - - if(Patch_Count > 0) - Crc |= RAM_PATCH_REGION; - if(Tag_Count > 0) - Crc |= RAM_PS_REGION; - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("PS Thread Started CRC %x Patch Count %d Tag Count %d \n",Crc,Patch_Count,Tag_Count)); - - if(Patch_Count || Tag_Count ){ - NumcmdEntry+=(2 + Patch_Count + Tag_Count); /* CRC Packet + PS Reset Packet + Patch List + PS List*/ - if(Patch_Count > 0) { - NumcmdEntry++; /* Patch Enable Command */ - } - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Num Cmd Entries %d Size %d \r\n",NumcmdEntry,(A_UINT32)sizeof(PSCmdPacket) * NumcmdEntry)); - (*HciPacketList) = A_MALLOC(sizeof(PSCmdPacket) * NumcmdEntry); - if(NULL == *HciPacketList) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("memory allocation failed \r\n")); - } - AthPSCreateHCICommand(PS_VERIFY_CRC,Crc,*HciPacketList,numPackets); - if(Patch_Count > 0){ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("*** Write Patch**** \r\n")); - AthPSCreateHCICommand(WRITE_PATCH,Patch_Count,*HciPacketList,numPackets); - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("*** Enable Patch**** \r\n")); - AthPSCreateHCICommand(ENABLE_PATCH,0,*HciPacketList,numPackets); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("*** PS Reset**** %d[0x%x] \r\n",PS_RAM_SIZE,PS_RAM_SIZE)); - AthPSCreateHCICommand(PS_RESET,PS_RAM_SIZE,*HciPacketList,numPackets); - if(Tag_Count > 0){ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("*** PS Write**** \r\n")); - AthPSCreateHCICommand(PS_WRITE,Tag_Count,*HciPacketList,numPackets); - } - } - if(!BDADDR){ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BD ADDR not present \r\n")); - - } - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("PS Count %d Patch Count %d",Tag_Count, Patch_Count)); - for(count = 0; count < Patch_Count; count++) { - - A_FREE(RamPatch[Patch_Count].Data); - } - - for(count = 0; count < Tag_Count; count++) { - - A_FREE(PsTagEntry[count].TagData); - } - -/* - * SDIO Transport uses synchronous mode of data transfer - * So, AthPSOperations() call returns only after receiving the - * command complete event. - */ - return *numPackets; -} - - -//////////////////////// - -///////////// -static A_STATUS AthPSCreateHCICommand(A_UCHAR Opcode, A_UINT32 Param1,PSCmdPacket *PSPatchPacket,A_UINT32 *index) -{ - A_UCHAR *HCI_PS_Command; - A_UINT32 Length; - int i,j; - - switch(Opcode) - { - case WRITE_PATCH: - - - for(i=0;i< Param1;i++){ - - HCI_PS_Command = (A_UCHAR *) A_MALLOC(RamPatch[i].Len+HCI_COMMAND_HEADER); - if(HCI_PS_Command == NULL){ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("MALLOC Failed\r\n")); - return A_ERROR; - } - memset (HCI_PS_Command, 0, RamPatch[i].Len+HCI_COMMAND_HEADER); - LoadHeader(HCI_PS_Command,Opcode,RamPatch[i].Len,i); - for(j=0;j> 8) & 0xFF); - PSPatchPacket[*index].Hcipacket = HCI_PS_Command; - PSPatchPacket[*index].packetLen = Length+HCI_COMMAND_HEADER; - (*index)++; - - break; - - case PS_WRITE: - for(i=0;i< Param1;i++){ - if(PsTagEntry[i].TagId ==1) - BDADDR = TRUE; - - HCI_PS_Command = (A_UCHAR *) A_MALLOC(PsTagEntry[i].TagLen+HCI_COMMAND_HEADER); - if(HCI_PS_Command == NULL){ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("MALLOC Failed\r\n")); - return A_ERROR; - } - - memset (HCI_PS_Command, 0, PsTagEntry[i].TagLen+HCI_COMMAND_HEADER); - LoadHeader(HCI_PS_Command,Opcode,PsTagEntry[i].TagLen,PsTagEntry[i].TagId); - - for(j=0;j -#include -#include "athdefs.h" -#ifdef HCI_TRANSPORT_SDIO -#include "a_config.h" -#include "a_types.h" -#include "a_osapi.h" -#define ATH_MODULE_NAME misc -#include "a_debug.h" -#include "common_drv.h" -#include "hci_transport_api.h" -#include "ar3kconfig.h" -#else -#ifndef A_PRINTF -#define A_PRINTF(args...) printk(KERN_ALERT args) -#endif /* A_PRINTF */ -#include "debug_linux.h" - -/* Helper data type declaration */ - -#ifndef A_UINT32 -#define A_UCHAR unsigned char -#define A_UINT32 unsigned long -#define A_UINT16 unsigned short -#define A_UINT8 unsigned char -#define A_BOOL unsigned char -#endif /* A_UINT32 */ - -#define ATH_DEBUG_ERR (1 << 0) -#define ATH_DEBUG_WARN (1 << 1) -#define ATH_DEBUG_INFO (1 << 2) - - - -#define FALSE 0 -#define TRUE 1 - -#ifndef A_MALLOC -#define A_MALLOC(size) kmalloc((size),GFP_KERNEL) -#endif /* A_MALLOC */ - - -#ifndef A_FREE -#define A_FREE(addr) kfree((addr)) -#endif /* A_MALLOC */ -#endif /* HCI_TRANSPORT_UART */ - -/* String manipulation APIs */ -#ifndef A_STRTOUL -#define A_STRTOUL simple_strtoul -#endif /* A_STRTOL */ - -#ifndef A_STRTOL -#define A_STRTOL simple_strtol -#endif /* A_STRTOL */ - - -/* The maximum number of bytes possible in a patch entry */ -#define MAX_PATCH_SIZE 30000 - -/* Maximum HCI packets that will be formed from the Patch file */ -#define MAX_NUM_PATCH_ENTRY (MAX_PATCH_SIZE/MAX_BYTE_LENGTH) + 1 - - - - - - - -typedef struct PSCmdPacket -{ - A_UCHAR *Hcipacket; - int packetLen; -} PSCmdPacket; - -/* Parses a Patch information buffer and store it in global structure */ -A_STATUS AthDoParsePatch(A_UCHAR *, A_UINT32, A_UCHAR*); - -/* parses a PS information buffer and stores it in a global structure */ -A_STATUS AthDoParsePS(A_UCHAR *, A_UINT32); - -/* - * Uses the output of Both AthDoParsePS and AthDoParsePatch APIs to form HCI command array with - * all the PS and patch commands. - * The list will have the below mentioned commands in order. - * CRC command packet - * Download patch command(s) - * Enable patch Command - * PS Reset Command - * PS Tag Command(s) - * - */ -int AthCreateCommandList(PSCmdPacket **, A_UINT32 *); - -/* Cleanup the dynamically allicated HCI command list */ -A_STATUS AthFreeCommandList(PSCmdPacket **HciPacketList, A_UINT32 numPackets); -#endif /* __AR3KPSPARSER_H */ diff --git a/drivers/net/wireless/ar6003/host/miscdrv/common_drv.c b/drivers/net/wireless/ar6003/host/miscdrv/common_drv.c deleted file mode 100644 index d3039178a177..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/common_drv.c +++ /dev/null @@ -1,882 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#include "a_config.h" -#include "athdefs.h" -#include "a_types.h" - -#include "a_osapi.h" -#include "targaddrs.h" -#include "hif.h" -#include "htc_api.h" -#include "wmi.h" -#include "bmi.h" -#include "bmi_msg.h" -#include "common_drv.h" -#define ATH_MODULE_NAME misc -#include "a_debug.h" -#include "ar6000_diag.h" -#include "target_reg_table.h" -#include "host_reg_table.h" - -static ATH_DEBUG_MODULE_DBG_INFO *g_pModuleInfoHead = NULL; -static A_MUTEX_T g_ModuleListLock; -static A_BOOL g_ModuleDebugInit = FALSE; - -#ifdef DEBUG - -ATH_DEBUG_INSTANTIATE_MODULE_VAR(misc, - "misc", - "Common and misc APIs", - ATH_DEBUG_MASK_DEFAULTS, - 0, - NULL); - -#endif - -#define AR6001_LOCAL_COUNT_ADDRESS 0x0c014080 -#define AR6002_LOCAL_COUNT_ADDRESS 0x00018080 -#define AR6003_LOCAL_COUNT_ADDRESS 0x00018080 - -static A_UINT8 custDataAR6002[AR6002_CUST_DATA_SIZE]; -static A_UINT8 custDataAR6003[AR6003_CUST_DATA_SIZE]; -static A_UINT8 custDataMCKINLEY[MCKINLEY_CUST_DATA_SIZE]; - - -/* - * Read from the AR6000 through its diagnostic window. - * No cooperation from the Target is required for this. - */ -A_STATUS -ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data) -{ - return HIFDiagReadAccess(hifDevice, *address, data); -} - - -/* - * Write to the AR6000 through its diagnostic window. - * No cooperation from the Target is required for this. - */ -A_STATUS -ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data) -{ - return HIFDiagWriteAccess(hifDevice, *address, *data); -} - -A_STATUS -ar6000_ReadDataDiag(HIF_DEVICE *hifDevice, A_UINT32 address, - A_UCHAR *data, A_UINT32 length) -{ - A_UINT32 count; - A_STATUS status = A_OK; - - for (count = 0; count < length; count += 4, address += 4) { - if ((status = HIFDiagReadAccess(hifDevice, address, - (A_UINT32 *)&data[count])) != A_OK) - { - break; - } - } - - return status; -} - -A_STATUS -ar6000_WriteDataDiag(HIF_DEVICE *hifDevice, A_UINT32 address, - A_UCHAR *data, A_UINT32 length) -{ - A_UINT32 count; - A_STATUS status = A_OK; - - for (count = 0; count < length; count += 4, address += 4) { - if ((status = HIFDiagWriteAccess(hifDevice, address, - *((A_UINT32 *)&data[count]))) != A_OK) - { - break; - } - } - - return status; -} - -#ifdef HIF_MESSAGE_BASED - -/* TODO : for message based interfaces there are no HOST registers. These are just - * stub functions for now */ - -A_STATUS -ar6k_ReadTargetRegister(HIF_DEVICE *hifDevice, int regsel, A_UINT32 *regval) -{ - - /* TODO */ - return A_ERROR; -} - -void -ar6k_FetchTargetRegs(HIF_DEVICE *hifDevice, A_UINT32 *targregs) -{ - int i; - for (i=0; i REGISTER_DUMP_LEN_MAX -#error "REG_DUMP_COUNT_AR6001 too large" -#endif -#if REG_DUMP_COUNT_AR6002 > REGISTER_DUMP_LEN_MAX -#error "REG_DUMP_COUNT_AR6002 too large" -#endif -#if REG_DUMP_COUNT_AR6003 > REGISTER_DUMP_LEN_MAX -#error "REG_DUMP_COUNT_AR6003 too large" -#endif -#if REG_DUMP_COUNT_MCKINLEY > REGISTER_DUMP_LEN_MAX -#error "REG_DUMP_COUNT_MCKINLEY too large" -#endif - - -void ar6000_dump_target_assert_info(HIF_DEVICE *hifDevice, A_UINT32 TargetType) -{ - A_UINT32 address; - A_UINT32 regDumpArea = 0; - A_STATUS status; - A_UINT32 regDumpValues[REGISTER_DUMP_LEN_MAX]; - A_UINT32 regDumpCount = 0; - A_UINT32 i; - - do { - - /* the reg dump pointer is copied to the host interest area */ - address = HOST_INTEREST_ITEM_ADDRESS(TargetType, hi_failure_state); - address = TARG_VTOP(TargetType, address); - - if (TargetType == TARGET_TYPE_AR6002) { - regDumpCount = REG_DUMP_COUNT_AR6002; - } else if (TargetType == TARGET_TYPE_AR6003) { - regDumpCount = REG_DUMP_COUNT_AR6003; - } else if (TargetType == TARGET_TYPE_MCKINLEY) { - regDumpCount = REG_DUMP_COUNT_MCKINLEY; - } else { - A_ASSERT(0); - } - - /* read RAM location through diagnostic window */ - status = ar6000_ReadRegDiag(hifDevice, &address, ®DumpArea); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR6K: Failed to get ptr to register dump area \n")); - break; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR6K: Location of register dump data: 0x%X \n",regDumpArea)); - - if (regDumpArea == 0) { - /* no reg dump */ - break; - } - - regDumpArea = TARG_VTOP(TargetType, regDumpArea); - - /* fetch register dump data */ - status = ar6000_ReadDataDiag(hifDevice, - regDumpArea, - (A_UCHAR *)®DumpValues[0], - regDumpCount * (sizeof(A_UINT32))); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR6K: Failed to get register dump \n")); - break; - } - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR6K: Register Dump: \n")); - - for (i = 0; i < regDumpCount; i++) - { - AR_DEBUG_PRINTF (ATH_DEBUG_ERR,(" %d : 0x%8.8X \n",i, regDumpValues[i])); -#ifdef UNDER_CE - /* - * For Every logPrintf() Open the File so that in case of Crashes - * We will have until the Last Message Flushed on to the File - * So use logPrintf Sparingly..!! - */ - tgtassertPrintf (ATH_DEBUG_TRC," %d: 0x%8.8X \n",i, regDumpValues[i]); -#endif - } - - } while (FALSE); - -} - -/* set HTC/Mbox operational parameters, this can only be called when the target is in the - * BMI phase */ -A_STATUS ar6000_set_htc_params(HIF_DEVICE *hifDevice, - A_UINT32 TargetType, - A_UINT32 MboxIsrYieldValue, - A_UINT8 HtcControlBuffers) -{ - A_STATUS status; - A_UINT32 blocksizes[HTC_MAILBOX_NUM_MAX]; - - do { - /* get the block sizes */ - status = HIFConfigureDevice(hifDevice, HIF_DEVICE_GET_MBOX_BLOCK_SIZE, - blocksizes, sizeof(blocksizes)); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_LOG_ERR,("Failed to get block size info from HIF layer...\n")); - break; - } - /* note: we actually get the block size for mailbox 1, for SDIO the block - * size on mailbox 0 is artificially set to 1 */ - /* must be a power of 2 */ - A_ASSERT((blocksizes[1] & (blocksizes[1] - 1)) == 0); - - if (HtcControlBuffers != 0) { - /* set override for number of control buffers to use */ - blocksizes[1] |= ((A_UINT32)HtcControlBuffers) << 16; - } - - /* set the host interest area for the block size */ - status = BMIWriteMemory(hifDevice, - HOST_INTEREST_ITEM_ADDRESS(TargetType, hi_mbox_io_block_sz), - (A_UCHAR *)&blocksizes[1], - 4); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_LOG_ERR,("BMIWriteMemory for IO block size failed \n")); - break; - } - - AR_DEBUG_PRINTF(ATH_LOG_INF,("Block Size Set: %d (target address:0x%X)\n", - blocksizes[1], HOST_INTEREST_ITEM_ADDRESS(TargetType, hi_mbox_io_block_sz))); - - if (MboxIsrYieldValue != 0) { - /* set the host interest area for the mbox ISR yield limit */ - status = BMIWriteMemory(hifDevice, - HOST_INTEREST_ITEM_ADDRESS(TargetType, hi_mbox_isr_yield_limit), - (A_UCHAR *)&MboxIsrYieldValue, - 4); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_LOG_ERR,("BMIWriteMemory for yield limit failed \n")); - break; - } - } - - } while (FALSE); - - return status; -} - - -static A_STATUS prepare_ar6002(HIF_DEVICE *hifDevice, A_UINT32 TargetVersion) -{ - A_STATUS status = A_OK; - - /* placeholder */ - - return status; -} - -static A_STATUS prepare_ar6003(HIF_DEVICE *hifDevice, A_UINT32 TargetVersion) -{ - A_STATUS status = A_OK; - - /* placeholder */ - - return status; -} - -static A_STATUS prepare_MCKINLEY(HIF_DEVICE *hifDevice, A_UINT32 TargetVersion) -{ - A_STATUS status = A_OK; - A_UINT32 value = 0; - - /* force the setting to disable sleep for Bringup FIXME_MK */ - value |= WLAN_SYSTEM_SLEEP_DISABLE_MASK; - - status = BMIWriteMemory(hifDevice, - HOST_INTEREST_ITEM_ADDRESS(TARGET_TYPE_AR6002, hi_system_sleep_setting), - (A_UCHAR *)&value, - 4); - - return status; -} - -/* this function assumes the caller has already initialized the BMI APIs */ -A_STATUS ar6000_prepare_target(HIF_DEVICE *hifDevice, - A_UINT32 TargetType, - A_UINT32 TargetVersion) -{ - if (TargetType == TARGET_TYPE_AR6002) { - /* do any preparations for AR6002 devices */ - return prepare_ar6002(hifDevice,TargetVersion); - } else if (TargetType == TARGET_TYPE_AR6003) { - return prepare_ar6003(hifDevice,TargetVersion); - } else if (TargetType == TARGET_TYPE_MCKINLEY) { - return prepare_MCKINLEY(hifDevice,TargetVersion); - } - - return A_OK; -} - -#if defined(CONFIG_AR6002_REV1_FORCE_HOST) -/* - * Call this function just before the call to BMIInit - * in order to force* AR6002 rev 1.x firmware to detect a Host. - * THIS IS FOR USE ONLY WITH AR6002 REV 1.x. - * TBDXXX: Remove this function when REV 1.x is desupported. - */ -A_STATUS -ar6002_REV1_reset_force_host (HIF_DEVICE *hifDevice) -{ - A_INT32 i; - struct forceROM_s { - A_UINT32 addr; - A_UINT32 data; - }; - struct forceROM_s *ForceROM; - A_INT32 szForceROM; - A_STATUS status = A_OK; - A_UINT32 address; - A_UINT32 data; - - /* Force AR6002 REV1.x to recognize Host presence. - * - * Note: Use RAM at 0x52df80..0x52dfa0 with ROM Remap entry 0 - * so that this workaround functions with AR6002.war1.sh. We - * could fold that entire workaround into this one, but it's not - * worth the effort at this point. This workaround cannot be - * merged into the other workaround because this must be done - * before BMI. - */ - - static struct forceROM_s ForceROM_NEW[] = { - {0x52df80, 0x20f31c07}, - {0x52df84, 0x92374420}, - {0x52df88, 0x1d120c03}, - {0x52df8c, 0xff8216f0}, - {0x52df90, 0xf01d120c}, - {0x52df94, 0x81004136}, - {0x52df98, 0xbc9100bd}, - {0x52df9c, 0x00bba100}, - - {0x00008000|MC_TCAM_TARGET_ADDRESS, 0x0012dfe0}, /* Use remap entry 0 */ - {0x00008000|MC_TCAM_COMPARE_ADDRESS, 0x000e2380}, - {0x00008000|MC_TCAM_MASK_ADDRESS, 0x00000000}, - {0x00008000|MC_TCAM_VALID_ADDRESS, 0x00000001}, - - {0x00018000|(LOCAL_COUNT_ADDRESS+0x10), 0}, /* clear BMI credit counter */ - - {0x00004000|AR6002_RESET_CONTROL_ADDRESS, RESET_CONTROL_WARM_RST_MASK}, - }; - - address = 0x004ed4b0; /* REV1 target software ID is stored here */ - status = ar6000_ReadRegDiag(hifDevice, &address, &data); - if (A_FAILED(status) || (data != AR6002_VERSION_REV1)) { - return A_ERROR; /* Not AR6002 REV1 */ - } - - ForceROM = ForceROM_NEW; - szForceROM = sizeof(ForceROM_NEW)/sizeof(*ForceROM); - - ATH_DEBUG_PRINTF (DBG_MISC_DRV, ATH_DEBUG_TRC, ("Force Target to recognize Host....\n")); - for (i = 0; i < szForceROM; i++) - { - if (ar6000_WriteRegDiag(hifDevice, - &ForceROM[i].addr, - &ForceROM[i].data) != A_OK) - { - ATH_DEBUG_PRINTF (DBG_MISC_DRV, ATH_DEBUG_TRC, ("Cannot force Target to recognize Host!\n")); - return A_ERROR; - } - } - - A_MDELAY(1000); - - return A_OK; -} - -#endif /* CONFIG_AR6002_REV1_FORCE_HOST */ - -void DebugDumpBytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription) -{ - A_CHAR stream[60]; - A_CHAR byteOffsetStr[10]; - A_UINT32 i; - A_UINT16 offset, count, byteOffset; - - A_PRINTF("<---------Dumping %d Bytes : %s ------>\n", length, pDescription); - - count = 0; - offset = 0; - byteOffset = 0; - for(i = 0; i < length; i++) { - A_SPRINTF(stream + offset, "%2.2X ", buffer[i]); - count ++; - offset += 3; - - if(count == 16) { - count = 0; - offset = 0; - A_SPRINTF(byteOffsetStr,"%4.4X",byteOffset); - A_PRINTF("[%s]: %s\n", byteOffsetStr, stream); - A_MEMZERO(stream, 60); - byteOffset += 16; - } - } - - if(offset != 0) { - A_SPRINTF(byteOffsetStr,"%4.4X",byteOffset); - A_PRINTF("[%s]: %s\n", byteOffsetStr, stream); - } - - A_PRINTF("<------------------------------------------------->\n"); -} - -void a_dump_module_debug_info(ATH_DEBUG_MODULE_DBG_INFO *pInfo) -{ - int i; - ATH_DEBUG_MASK_DESCRIPTION *pDesc; - - if (pInfo == NULL) { - return; - } - - pDesc = pInfo->pMaskDescriptions; - - A_PRINTF("========================================================\n\n"); - A_PRINTF("Module Debug Info => Name : %s \n", pInfo->ModuleName); - A_PRINTF(" => Descr. : %s \n", pInfo->ModuleDescription); - A_PRINTF("\n Current mask => 0x%8.8X \n", pInfo->CurrentMask); - A_PRINTF("\n Avail. Debug Masks :\n\n"); - - for (i = 0; i < pInfo->MaxDescriptions; i++,pDesc++) { - A_PRINTF(" => 0x%8.8X -- %s \n", pDesc->Mask, pDesc->Description); - } - - if (0 == i) { - A_PRINTF(" => * none defined * \n"); - } - - A_PRINTF("\n Standard Debug Masks :\n\n"); - /* print standard masks */ - A_PRINTF(" => 0x%8.8X -- Errors \n", ATH_DEBUG_ERR); - A_PRINTF(" => 0x%8.8X -- Warnings \n", ATH_DEBUG_WARN); - A_PRINTF(" => 0x%8.8X -- Informational \n", ATH_DEBUG_INFO); - A_PRINTF(" => 0x%8.8X -- Tracing \n", ATH_DEBUG_TRC); - A_PRINTF("\n========================================================\n"); - -} - - -static ATH_DEBUG_MODULE_DBG_INFO *FindModule(A_CHAR *module_name) -{ - ATH_DEBUG_MODULE_DBG_INFO *pInfo = g_pModuleInfoHead; - - if (!g_ModuleDebugInit) { - return NULL; - } - - while (pInfo != NULL) { - /* TODO: need to use something other than strlen */ - if (A_MEMCMP(pInfo->ModuleName,module_name,strlen(module_name)) == 0) { - break; - } - pInfo = pInfo->pNext; - } - - return pInfo; -} - - -void a_register_module_debug_info(ATH_DEBUG_MODULE_DBG_INFO *pInfo) -{ - if (!g_ModuleDebugInit) { - return; - } - - A_MUTEX_LOCK(&g_ModuleListLock); - - if (!(pInfo->Flags & ATH_DEBUG_INFO_FLAGS_REGISTERED)) { - if (g_pModuleInfoHead == NULL) { - g_pModuleInfoHead = pInfo; - } else { - pInfo->pNext = g_pModuleInfoHead; - g_pModuleInfoHead = pInfo; - } - pInfo->Flags |= ATH_DEBUG_INFO_FLAGS_REGISTERED; - } - - A_MUTEX_UNLOCK(&g_ModuleListLock); -} - -void a_dump_module_debug_info_by_name(A_CHAR *module_name) -{ - ATH_DEBUG_MODULE_DBG_INFO *pInfo = g_pModuleInfoHead; - - if (!g_ModuleDebugInit) { - return; - } - - if (A_MEMCMP(module_name,"all",3) == 0) { - /* dump all */ - while (pInfo != NULL) { - a_dump_module_debug_info(pInfo); - pInfo = pInfo->pNext; - } - return; - } - - pInfo = FindModule(module_name); - - if (pInfo != NULL) { - a_dump_module_debug_info(pInfo); - } - -} - -A_STATUS a_get_module_mask(A_CHAR *module_name, A_UINT32 *pMask) -{ - ATH_DEBUG_MODULE_DBG_INFO *pInfo = FindModule(module_name); - - if (NULL == pInfo) { - return A_ERROR; - } - - *pMask = pInfo->CurrentMask; - return A_OK; -} - -A_STATUS a_set_module_mask(A_CHAR *module_name, A_UINT32 Mask) -{ - ATH_DEBUG_MODULE_DBG_INFO *pInfo = FindModule(module_name); - - if (NULL == pInfo) { - return A_ERROR; - } - - pInfo->CurrentMask = Mask; - A_PRINTF("Module %s, new mask: 0x%8.8X \n",module_name,pInfo->CurrentMask); - return A_OK; -} - - -void a_module_debug_support_init(void) -{ - if (g_ModuleDebugInit) { - return; - } - A_MUTEX_INIT(&g_ModuleListLock); - g_pModuleInfoHead = NULL; - g_ModuleDebugInit = TRUE; - A_REGISTER_MODULE_DEBUG_INFO(misc); -} - -void a_module_debug_support_cleanup(void) -{ - ATH_DEBUG_MODULE_DBG_INFO *pInfo = g_pModuleInfoHead; - ATH_DEBUG_MODULE_DBG_INFO *pCur; - - if (!g_ModuleDebugInit) { - return; - } - - g_ModuleDebugInit = FALSE; - - A_MUTEX_LOCK(&g_ModuleListLock); - - while (pInfo != NULL) { - pCur = pInfo; - pInfo = pInfo->pNext; - pCur->pNext = NULL; - /* clear registered flag */ - pCur->Flags &= ~ATH_DEBUG_INFO_FLAGS_REGISTERED; - } - - A_MUTEX_UNLOCK(&g_ModuleListLock); - - A_MUTEX_DELETE(&g_ModuleListLock); - g_pModuleInfoHead = NULL; -} - - /* can only be called during bmi init stage */ -A_STATUS ar6000_set_hci_bridge_flags(HIF_DEVICE *hifDevice, - A_UINT32 TargetType, - A_UINT32 Flags) -{ - A_STATUS status = A_OK; - - do { - - if ((TargetType != TARGET_TYPE_AR6003) && (TargetType != TARGET_TYPE_MCKINLEY)) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, ("Target Type:%d, does not support HCI bridging! \n", - TargetType)); - break; - } - - /* set hci bridge flags */ - status = BMIWriteMemory(hifDevice, - HOST_INTEREST_ITEM_ADDRESS(TargetType, hi_hci_bridge_flags), - (A_UCHAR *)&Flags, - 4); - - - } while (FALSE); - - return status; -} - diff --git a/drivers/net/wireless/ar6003/host/miscdrv/credit_dist.c b/drivers/net/wireless/ar6003/host/miscdrv/credit_dist.c deleted file mode 100644 index f2f76d31d5fd..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/credit_dist.c +++ /dev/null @@ -1,417 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#include "a_config.h" -#include "athdefs.h" -#include "a_types.h" -#include "a_osapi.h" -#define ATH_MODULE_NAME misc -#include "a_debug.h" -#include "htc_api.h" -#include "common_drv.h" - -/********* CREDIT DISTRIBUTION FUNCTIONS ******************************************/ - -#define NO_VO_SERVICE 1 /* currently WMI only uses 3 data streams, so we leave VO service inactive */ -#define CONFIG_GIVE_LOW_PRIORITY_STREAMS_MIN_CREDITS 1 - -#ifdef NO_VO_SERVICE -#define DATA_SVCS_USED 3 -#else -#define DATA_SVCS_USED 4 -#endif - -static void RedistributeCredits(COMMON_CREDIT_STATE_INFO *pCredInfo, - HTC_ENDPOINT_CREDIT_DIST *pEPDistList); - -static void SeekCredits(COMMON_CREDIT_STATE_INFO *pCredInfo, - HTC_ENDPOINT_CREDIT_DIST *pEPDistList); - -/* reduce an ep's credits back to a set limit */ -static INLINE void ReduceCredits(COMMON_CREDIT_STATE_INFO *pCredInfo, - HTC_ENDPOINT_CREDIT_DIST *pEpDist, - int Limit) -{ - int credits; - - /* set the new limit */ - pEpDist->TxCreditsAssigned = Limit; - - if (pEpDist->TxCredits <= Limit) { - return; - } - - /* figure out how much to take away */ - credits = pEpDist->TxCredits - Limit; - /* take them away */ - pEpDist->TxCredits -= credits; - pCredInfo->CurrentFreeCredits += credits; -} - -/* give an endpoint some credits from the free credit pool */ -#define GiveCredits(pCredInfo,pEpDist,credits) \ -{ \ - (pEpDist)->TxCredits += (credits); \ - (pEpDist)->TxCreditsAssigned += (credits); \ - (pCredInfo)->CurrentFreeCredits -= (credits); \ -} - - -/* default credit init callback. - * This function is called in the context of HTCStart() to setup initial (application-specific) - * credit distributions */ -static void ar6000_credit_init(void *Context, - HTC_ENDPOINT_CREDIT_DIST *pEPList, - int TotalCredits) -{ - HTC_ENDPOINT_CREDIT_DIST *pCurEpDist; - int count; - COMMON_CREDIT_STATE_INFO *pCredInfo = (COMMON_CREDIT_STATE_INFO *)Context; - - pCredInfo->CurrentFreeCredits = TotalCredits; - pCredInfo->TotalAvailableCredits = TotalCredits; - - pCurEpDist = pEPList; - - /* run through the list and initialize */ - while (pCurEpDist != NULL) { - - /* set minimums for each endpoint */ - pCurEpDist->TxCreditsMin = pCurEpDist->TxCreditsPerMaxMsg; - -#ifdef CONFIG_GIVE_LOW_PRIORITY_STREAMS_MIN_CREDITS - if (TotalCredits > 4) - { - if ((pCurEpDist->ServiceID == WMI_DATA_BK_SVC) || (pCurEpDist->ServiceID == WMI_DATA_BE_SVC)){ - /* assign at least min credits to lower than VO priority services */ - GiveCredits(pCredInfo,pCurEpDist,pCurEpDist->TxCreditsMin); - /* force active */ - SET_EP_ACTIVE(pCurEpDist); - } - } - -#endif - - if (pCurEpDist->ServiceID == WMI_CONTROL_SVC) { - /* give control service some credits */ - GiveCredits(pCredInfo,pCurEpDist,pCurEpDist->TxCreditsMin); - /* control service is always marked active, it never goes inactive EVER */ - SET_EP_ACTIVE(pCurEpDist); - } else if (pCurEpDist->ServiceID == WMI_DATA_BK_SVC) { - /* this is the lowest priority data endpoint, save this off for easy access */ - pCredInfo->pLowestPriEpDist = pCurEpDist; - } - - /* Streams have to be created (explicit | implicit)for all kinds - * of traffic. BE endpoints are also inactive in the beginning. - * When BE traffic starts it creates implicit streams that - * redistributes credits. - */ - - /* note, all other endpoints have minimums set but are initially given NO credits. - * Credits will be distributed as traffic activity demands */ - pCurEpDist = pCurEpDist->pNext; - } - - if (pCredInfo->CurrentFreeCredits <= 0) { - AR_DEBUG_PRINTF(ATH_LOG_INF, ("Not enough credits (%d) to do credit distributions \n", TotalCredits)); - A_ASSERT(FALSE); - return; - } - - /* reset list */ - pCurEpDist = pEPList; - /* now run through the list and set max operating credit limits for everyone */ - while (pCurEpDist != NULL) { - if (pCurEpDist->ServiceID == WMI_CONTROL_SVC) { - /* control service max is just 1 max message */ - pCurEpDist->TxCreditsNorm = pCurEpDist->TxCreditsPerMaxMsg; - } else { - /* for the remaining data endpoints, we assume that each TxCreditsPerMaxMsg are - * the same. - * We use a simple calculation here, we take the remaining credits and - * determine how many max messages this can cover and then set each endpoint's - * normal value equal to 3/4 this amount. - * */ - count = (pCredInfo->CurrentFreeCredits/pCurEpDist->TxCreditsPerMaxMsg) * pCurEpDist->TxCreditsPerMaxMsg; - count = (count * 3) >> 2; - count = max(count,pCurEpDist->TxCreditsPerMaxMsg); - /* set normal */ - pCurEpDist->TxCreditsNorm = count; - - } - pCurEpDist = pCurEpDist->pNext; - } - -} - - -/* default credit distribution callback - * This callback is invoked whenever endpoints require credit distributions. - * A lock is held while this function is invoked, this function shall NOT block. - * The pEPDistList is a list of distribution structures in prioritized order as - * defined by the call to the HTCSetCreditDistribution() api. - * - */ -static void ar6000_credit_distribute(void *Context, - HTC_ENDPOINT_CREDIT_DIST *pEPDistList, - HTC_CREDIT_DIST_REASON Reason) -{ - HTC_ENDPOINT_CREDIT_DIST *pCurEpDist; - COMMON_CREDIT_STATE_INFO *pCredInfo = (COMMON_CREDIT_STATE_INFO *)Context; - - switch (Reason) { - case HTC_CREDIT_DIST_SEND_COMPLETE : - pCurEpDist = pEPDistList; - /* we are given the start of the endpoint distribution list. - * There may be one or more endpoints to service. - * Run through the list and distribute credits */ - while (pCurEpDist != NULL) { - - if (pCurEpDist->TxCreditsToDist > 0) { - /* return the credits back to the endpoint */ - pCurEpDist->TxCredits += pCurEpDist->TxCreditsToDist; - /* always zero out when we are done */ - pCurEpDist->TxCreditsToDist = 0; - - if (pCurEpDist->TxCredits > pCurEpDist->TxCreditsAssigned) { - /* reduce to the assigned limit, previous credit reductions - * could have caused the limit to change */ - ReduceCredits(pCredInfo, pCurEpDist, pCurEpDist->TxCreditsAssigned); - } - - if (pCurEpDist->TxCredits > pCurEpDist->TxCreditsNorm) { - /* oversubscribed endpoints need to reduce back to normal */ - ReduceCredits(pCredInfo, pCurEpDist, pCurEpDist->TxCreditsNorm); - } - - if (!IS_EP_ACTIVE(pCurEpDist)) { - /* endpoint is inactive, now check for messages waiting for credits */ - if (pCurEpDist->TxQueueDepth == 0) { - /* EP is inactive and there are no pending messages, - * reduce credits back to zero to recover credits */ - ReduceCredits(pCredInfo, pCurEpDist, 0); - } - } - } - - pCurEpDist = pCurEpDist->pNext; - } - - break; - - case HTC_CREDIT_DIST_ACTIVITY_CHANGE : - RedistributeCredits(pCredInfo,pEPDistList); - break; - case HTC_CREDIT_DIST_SEEK_CREDITS : - SeekCredits(pCredInfo,pEPDistList); - break; - case HTC_DUMP_CREDIT_STATE : - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Credit Distribution, total : %d, free : %d\n", - pCredInfo->TotalAvailableCredits, pCredInfo->CurrentFreeCredits)); - break; - default: - break; - - } - - /* sanity checks done after each distribution action */ - A_ASSERT(pCredInfo->CurrentFreeCredits <= pCredInfo->TotalAvailableCredits); - A_ASSERT(pCredInfo->CurrentFreeCredits >= 0); - -} - -/* redistribute credits based on activity change */ -static void RedistributeCredits(COMMON_CREDIT_STATE_INFO *pCredInfo, - HTC_ENDPOINT_CREDIT_DIST *pEPDistList) -{ - HTC_ENDPOINT_CREDIT_DIST *pCurEpDist = pEPDistList; - - /* walk through the list and remove credits from inactive endpoints */ - while (pCurEpDist != NULL) { - -#ifdef CONFIG_GIVE_LOW_PRIORITY_STREAMS_MIN_CREDITS - - if ((pCurEpDist->ServiceID == WMI_DATA_BK_SVC) || (pCurEpDist->ServiceID == WMI_DATA_BE_SVC)) { - /* force low priority streams to always be active to retain their minimum credit distribution */ - SET_EP_ACTIVE(pCurEpDist); - } -#endif - - if (pCurEpDist->ServiceID != WMI_CONTROL_SVC) { - if (!IS_EP_ACTIVE(pCurEpDist)) { - if (pCurEpDist->TxQueueDepth == 0) { - /* EP is inactive and there are no pending messages, reduce credits back to zero */ - ReduceCredits(pCredInfo, pCurEpDist, 0); - } else { - /* we cannot zero the credits assigned to this EP, but to keep - * the credits available for these leftover packets, reduce to - * a minimum */ - ReduceCredits(pCredInfo, pCurEpDist, pCurEpDist->TxCreditsMin); - } - } - } - - /* NOTE in the active case, we do not need to do anything further, - * when an EP goes active and needs credits, HTC will call into - * our distribution function using a reason code of HTC_CREDIT_DIST_SEEK_CREDITS */ - - pCurEpDist = pCurEpDist->pNext; - } - -} - -/* HTC has an endpoint that needs credits, pEPDist is the endpoint in question */ -static void SeekCredits(COMMON_CREDIT_STATE_INFO *pCredInfo, - HTC_ENDPOINT_CREDIT_DIST *pEPDist) -{ - HTC_ENDPOINT_CREDIT_DIST *pCurEpDist; - int credits = 0; - int need; - - do { - - if (pEPDist->ServiceID == WMI_CONTROL_SVC) { - /* we never oversubscribe on the control service, this is not - * a high performance path and the target never holds onto control - * credits for too long */ - break; - } - -#ifdef CONFIG_GIVE_LOW_PRIORITY_STREAMS_MIN_CREDITS - if (pEPDist->ServiceID == WMI_DATA_VI_SVC) { - if ((pEPDist->TxCreditsAssigned >= pEPDist->TxCreditsNorm)) { - /* limit VI service from oversubscribing */ - break; - } - } - - if (pEPDist->ServiceID == WMI_DATA_VO_SVC) { - if ((pEPDist->TxCreditsAssigned >= pEPDist->TxCreditsNorm)) { - /* limit VO service from oversubscribing */ - break; - } - } -#else - if (pEPDist->ServiceID == WMI_DATA_VI_SVC) { - if ((pEPDist->TxCreditsAssigned >= pEPDist->TxCreditsNorm) || - (pCredInfo->CurrentFreeCredits <= pEPDist->TxCreditsPerMaxMsg)) { - /* limit VI service from oversubscribing */ - /* at least one free credit will not be used by VI */ - break; - } - } - - if (pEPDist->ServiceID == WMI_DATA_VO_SVC) { - if ((pEPDist->TxCreditsAssigned >= pEPDist->TxCreditsNorm) || - (pCredInfo->CurrentFreeCredits <= pEPDist->TxCreditsPerMaxMsg)) { - /* limit VO service from oversubscribing */ - /* at least one free credit will not be used by VO */ - break; - } - } -#endif - - /* for all other services, we follow a simple algorithm of - * 1. checking the free pool for credits - * 2. checking lower priority endpoints for credits to take */ - - /* give what we can */ - credits = min(pCredInfo->CurrentFreeCredits,pEPDist->TxCreditsSeek); - - if (credits >= pEPDist->TxCreditsSeek) { - /* we found some to fullfill the seek request */ - break; - } - - /* we don't have enough in the free pool, try taking away from lower priority services - * - * The rule for taking away credits: - * 1. Only take from lower priority endpoints - * 2. Only take what is allocated above the minimum (never starve an endpoint completely) - * 3. Only take what you need. - * - * */ - - /* starting at the lowest priority */ - pCurEpDist = pCredInfo->pLowestPriEpDist; - - /* work backwards until we hit the endpoint again */ - while (pCurEpDist != pEPDist) { - /* calculate how many we need so far */ - need = pEPDist->TxCreditsSeek - pCredInfo->CurrentFreeCredits; - - if ((pCurEpDist->TxCreditsAssigned - need) >= pCurEpDist->TxCreditsMin) { - /* the current one has been allocated more than it's minimum and it - * has enough credits assigned above it's minimum to fullfill our need - * try to take away just enough to fullfill our need */ - ReduceCredits(pCredInfo, - pCurEpDist, - pCurEpDist->TxCreditsAssigned - need); - - if (pCredInfo->CurrentFreeCredits >= pEPDist->TxCreditsSeek) { - /* we have enough */ - break; - } - } - - pCurEpDist = pCurEpDist->pPrev; - } - - /* return what we can get */ - credits = min(pCredInfo->CurrentFreeCredits,pEPDist->TxCreditsSeek); - - } while (FALSE); - - /* did we find some credits? */ - if (credits) { - /* give what we can */ - GiveCredits(pCredInfo, pEPDist, credits); - } - -} - -/* initialize and setup credit distribution */ -A_STATUS ar6000_setup_credit_dist(HTC_HANDLE HTCHandle, COMMON_CREDIT_STATE_INFO *pCredInfo) -{ - HTC_SERVICE_ID servicepriority[5]; - - A_MEMZERO(pCredInfo,sizeof(COMMON_CREDIT_STATE_INFO)); - - servicepriority[0] = WMI_CONTROL_SVC; /* highest */ - servicepriority[1] = WMI_DATA_VO_SVC; - servicepriority[2] = WMI_DATA_VI_SVC; - servicepriority[3] = WMI_DATA_BE_SVC; - servicepriority[4] = WMI_DATA_BK_SVC; /* lowest */ - - /* set callbacks and priority list */ - HTCSetCreditDistribution(HTCHandle, - pCredInfo, - ar6000_credit_distribute, - ar6000_credit_init, - servicepriority, - 5); - - return A_OK; -} - diff --git a/drivers/net/wireless/ar6003/host/miscdrv/makefile b/drivers/net/wireless/ar6003/host/miscdrv/makefile deleted file mode 100644 index 1ba034c4900e..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/makefile +++ /dev/null @@ -1,26 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2005-2007 Atheros Corporation. All rights reserved. -# -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# -#------------------------------------------------------------------------------ -#============================================================================== -# Author(s): ="Atheros" -#============================================================================== -!INCLUDE $(_MAKEENVROOT)\makefile.def - - - diff --git a/drivers/net/wireless/ar6003/host/miscdrv/miscdrv.h b/drivers/net/wireless/ar6003/host/miscdrv/miscdrv.h deleted file mode 100644 index 5defe9c636f4..000000000000 --- a/drivers/net/wireless/ar6003/host/miscdrv/miscdrv.h +++ /dev/null @@ -1,38 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== -#ifndef _MISCDRV_H -#define _MISCDRV_H - -A_UINT32 ar6kRev2Array[][128] = { - {0xFFFF, 0xFFFF}, // No Patches - }; - -#define CFG_REV2_ITEMS 0 // no patches so far -#define AR6K_RESET_ADDR 0x4000 -#define AR6K_RESET_VAL 0x100 - -#define EEPROM_SZ 768 -#define EEPROM_WAIT_LIMIT 4 - -#endif - diff --git a/drivers/net/wireless/ar6003/host/os/linux/Makefile b/drivers/net/wireless/ar6003/host/os/linux/Makefile deleted file mode 100644 index e4df8b1ef04d..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/Makefile +++ /dev/null @@ -1,338 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2005-2010 Atheros Corporation. All rights reserved. -# -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# -#------------------------------------------------------------------------------ -#============================================================================== -# Author(s): ="Atheros" -#============================================================================== -####################################################################################### -# AR6K Kernel Module makefile. -# -# This makefile is invoked by the master makefile in the linux kernel, the linux kernel -# source must be initially compiled. The top level make will invoke the main linux kernel -# makefile which will subsequently pick up this makefile. -# -####################################################################################### - - -REV ?= 2 - -EXTRA_CFLAGS += -I$(ATH_SRC_BASE)/include -EXTRA_CFLAGS += -I$(ATH_SRC_BASE)/../include -EXTRA_CFLAGS += -I$(ATH_SRC_BASE)/wlan/include -EXTRA_CFLAGS += -I$(ATH_SRC_BASE)/os/linux/include -EXTRA_CFLAGS += -I$(ATH_SRC_BASE)/os/ -EXTRA_CFLAGS += -I$(ATH_SRC_BASE)/bmi/include -EXTRA_CFLAGS += -I$(ATH_SRC_BASE)/../include/AR6002 - -EXTRA_CFLAGS += -DLINUX -D__KERNEL__ \ - -DTCMD -DSEND_EVENT_TO_APP -DUSER_KEYS \ - -DNO_SYNC_FLUSH -DHTC_EP_STAT_PROFILING -DWLAN_HEADERS\ - -DATH_AR6K_11N_SUPPORT \ - -DATH_SUPPORT_DFS \ - -DWAPI_ENABLE #\ - -DMULTIPLE_FRAMES_PER_INTERRUPT -DAR6000REV$(REV) \ - -DBLOCK_TX_PATH_FLAG -DCHECKSUM_OFFLOAD \ - - -ifeq ($(ATH_CFG80211_ENV),yes) - EXTRA_CFLAGS += -DATH6K_CONFIG_CFG80211 - # EXTRA_CFLAGS += -DCFG80211_WAPI_ENABLE -endif - -ifeq ($(ATH_INIT_MODE_DRV_ENABLED), yes) -ifeq ($(ATH_AR600x_WB31_XXX),yes) -EXTRA_CFLAGS += -DAR600x_WB31_XXX -else -ifeq ($(ATH_AR600x_SD32_XXX),yes) -EXTRA_CFLAGS += -DAR600x_SD32_XXX -else -EXTRA_CFLAGS += -DAR600x_SD31_XXX -endif -endif -EXTRA_CFLAGS += -DINIT_MODE_DRV_ENABLED -DBMIENABLE_SET -endif - -ifeq ($(ATH_ANDROID_ENV),yes) - EXTRA_CFLAGS += -DANDROID_ENV -D__linux__ $(ATH_ANDROID_BUILD_FLAGS) - EXTRA_CFLAGS += -DINIT_MODE_DRV_ENABLED -DBMIENABLE_SET -DAR600x_SD31_XXX \ - -DATH6KL_CONFIG_HIF_VIRTUAL_SCATTER \ - -DCONFIG_AP_VIRTUAL_ADAPTER_SUPPORT -ifeq ($(ATH_AR6K_HCI_BRIDGE),yes) - EXTRA_CFLAGS += -DSETUPHCI_ENABLED -DSETUPBTDEV_ENABLED \ - -DATH6KL_CONFIG_GPIO_BT_RESET -DAR600x_BT_AR3001 -endif -endif - -EXTRA_CFLAGS += -DCONFIG_BT -ifeq ($(ATH_AR6K_HCI_PAL),yes) - EXTRA_CFLAGS += -DSETUPHCIPAL_ENABLED -ifeq ($(ATH_AR6K_DEBUG_HCI_PAL),yes) - EXTRA_CFLAGS += -DHCIPAL_DEBUG -endif -endif - -ifeq ($(ATH_SOFTMAC_FILE_USED),yes) - EXTRA_CFLAGS += -DSOFTMAC_FILE_USED -endif - -ifeq ($(ATH_AR6K_OTA_TEST_MODE),yes) - EXTRA_CFLAGS += -DATH6K_CONFIG_OTA_MODE -endif - -ifeq ($(ATH_AR6K_HCI_BRIDGE),yes) -EXTRA_CFLAGS += -I$(ATH_SRC_BASE)/miscdrv/ar3kps -EXTRA_CFLAGS += -I$(ATH_SRC_BASE)/../include/AR6002/hw4.0 - -EXTRA_CFLAGS += -DATH_AR6K_ENABLE_GMBOX \ - -DHCI_TRANSPORT_SDIO - -ifeq ($(ATH_AR6K_BUILTIN_HCI_TRANSPORT),no) -EXTRA_CFLAGS += -DEXPORT_HCI_BRIDGE_INTERFACE -endif -endif - - -ifeq ($(ATH_HTC_RAW_INT_ENV),yes) - EXTRA_CFLAGS += -DHTC_RAW_INTERFACE -endif - -ifeq ($(ATH_DEBUG_DRIVER),yes) - EXTRA_CFLAGS += -DDEBUG -DATH_DEBUG_MODULE -endif - -ifeq ($(ATH_BUILD_P2P),yes) - EXTRA_CFLAGS += -DP2P -endif - -ifeq ($(AR6002_REV),4) - EXTRA_CFLAGS += -DAR6002_REV4 -endif - -ifneq ("$(wildcard $(ATH_SRC_BASE)/../include/AR6002/hw2.0)","") - EXTRA_CFLAGS += -DAR6002_HEADERS_DEF -endif - -ifneq ("$(wildcard $(ATH_SRC_BASE)/../include/AR6002/hw4.0)","") - EXTRA_CFLAGS += -DAR6003_HEADERS_DEF -endif - -ifneq ("$(wildcard $(ATH_SRC_BASE)/../include/AR6002/hw6.0)","") - EXTRA_CFLAGS += -DMCKINLEY_HEADERS_DEF -endif - -ifneq ($(ATH_OS_SUB_TYPE),linux_2_4) -# linux 2.6 and higher kernel module build settings -EXTRA_CFLAGS += -DKERNEL_2_6 -obj-m += ar6000.o -ifeq ($(ATH_AR6K_BUILTIN_HCI_TRANSPORT),no) -obj-m += bt_hci_sdio.o -endif --include $(ATH_SRC_BASE)/hif/$(ATH_HIF_TYPE)/Makefile - -ifneq ($(ATH_HIF_MESSAGE_BASED),yes) -ar6000-objs += ../../htc2/AR6000/ar6k.o \ - ../../htc2/AR6000/ar6k_events.o \ - ../../htc2/htc_send.o \ - ../../htc2/htc_recv.o \ - ../../htc2/htc_services.o \ - ../../htc2/htc.o -endif - -ifeq ($(ATH_HIF_MESSAGE_BASED),yes) -ar6000-objs += ../../htc_thin/htc_send.o \ - ../../htc_thin/htc_recv.o \ - ../../htc_thin/htc_services.o \ - ../../htc_thin/htc.o -endif - - -ar6000-objs += ../../bmi/src/bmi.o \ - ar6000_drv.o \ - ar6000_pm.o \ - ar6000_raw_if.o \ - netbuf.o \ - wireless_ext.o \ - ioctl.o \ - ../../miscdrv/common_drv.o \ - ../../miscdrv/credit_dist.o \ - ../../wmi/wmi.o \ - ../../reorder/rcv_aggr.o \ - ../../dfs/dfs_ar.o \ - ../../dfs/dfs_bindetects.o \ - ../../dfs/dfs.o \ - ../../dfs/dfs_debug.o \ - ../../dfs/dfs_fcc_bin5.o \ - ../../dfs/dfs_init.o \ - ../../dfs/dfs_misc.o \ - ../../dfs/dfs_process_phyerr.o \ - ../../dfs/dfs_process_radarevent.o \ - ../../dfs/dfs_staggered.o \ - ../../dfs/dfs_host_project.o \ - ../../wlan/src/wlan_node.o \ - ../../wlan/src/wlan_recv_beacon.o \ - ../../wlan/src/wlan_utils.o \ - ../../regtable/regtable.o \ - ../../regtable/AR6002def.o \ - ../../regtable/AR6003def.o \ - ../../regtable/MCKINLEYdef.o - -ifeq ($(ATH_BUILD_P2P),yes) -ar6000-objs += ../../p2p/p2p_main.o -endif - -ifeq ($(ATH_HIF_TYPE),sdio) -ar6000-objs += ../../hif/common/hif_bmi_reg_access.o \ - ../../hif/common/hif_diag_reg_access.o - -endif - -ifeq ($(ATH_CFG80211_ENV),yes) -ar6000-objs += cfg80211.o -endif - -ifneq ($(ATH_AR6K_BUILTIN_HCI_TRANSPORT),no) -ar6000-objs += hci_bridge.o -endif - -ifneq ($(ATH_AR6K_BUILTIN_HCI_PAL),no) -ar6000-objs += ar6k_pal.o -else -obj-m += ar6k_pal.o -endif - -ifeq ($(ATH_AR6K_HCI_BRIDGE),yes) -ar6000-objs += ../../htc2/AR6000/ar6k_gmbox.o \ - ../../htc2/AR6000/ar6k_gmbox_hciuart.o -ifneq ($(ATH_AR6K_BUILTIN_HCI_TRANSPORT),no) -ar6000-objs += ../../miscdrv/ar3kconfig.o \ - ../../miscdrv/ar3kps/ar3kpsconfig.o \ - ../../miscdrv/ar3kps/ar3kpsparser.o -else -ar6000-objs += export_hci_transport.o -endif - -ifeq ($(ATH_AR6K_BUILTIN_HCI_TRANSPORT),no) -bt_hci_sdio-objs += hci_bridge.o \ - ../../miscdrv/ar3kconfig.o \ - ../../miscdrv/ar3kps/ar3kpsconfig.o \ - ../../miscdrv/ar3kps/ar3kpsparser.o -endif -endif - -ifeq ($(ATH_ANDROID_ENV),yes) - ar6000-objs += ar6000_android.o -endif - -ifeq ($(ATH_AR6K_DEBUG_ALLOC),yes) - EXTRA_CFLAGS += -DAR6K_ALLOC_DEBUG - ar6000-objs += ar6k_mem_debug.o -endif - -endif - -ifeq ($(ATH_OS_SUB_TYPE),linux_2_4) -# linux 2.4 kernel module build settings -EXTRA_CFLAGS += -DKERNEL_2_4 - -O_TARGET := ar6000.o -# need export line for module export -export-objs := ar6000_drv.o --include $(ATH_SRC_BASE)/hif/$(ATH_HIF_TYPE)/Makefile -obj-y += $(ATH_SRC_BASE)/htc2/htc.o \ - $(ATH_SRC_BASE)/htc2/htc_send.o \ - $(ATH_SRC_BASE)/htc2/htc_recv.o \ - $(ATH_SRC_BASE)/htc2/htc_services.o \ - $(ATH_SRC_BASE)/htc2/AR6000/ar6k.o \ - $(ATH_SRC_BASE)/htc2/AR6000/ar6k_events.o \ - $(ATH_SRC_BASE)/bmi/src/bmi.o \ - $(ATH_SRC_BASE)/wmi/wmi.o \ - $(ATH_SRC_BASE)/reorder/rcv_aggr.o \ - $(ATH_SRC_BASE)/dfs/dfs_ar.o \ - $(ATH_SRC_BASE)/dfs/dfs_bindetects.o \ - $(ATH_SRC_BASE)/dfs/dfs.o \ - $(ATH_SRC_BASE)/dfs/dfs_debug.o \ - $(ATH_SRC_BASE)/dfs/dfs_fcc_bin5.o \ - $(ATH_SRC_BASE)/dfs/dfs_init.o \ - $(ATH_SRC_BASE)/dfs/dfs_misc.o \ - $(ATH_SRC_BASE)/dfs/dfs_process_phyerr.o \ - $(ATH_SRC_BASE)/dfs/dfs_process_radarevent.o \ - $(ATH_SRC_BASE)/dfs/dfs_staggered.o \ - $(ATH_SRC_BASE)/dfs/dfs_host_project.o \ - $(ATH_SRC_BASE)/wlan/src/wlan_node.o \ - $(ATH_SRC_BASE)/wlan/src/wlan_recv_beacon.o \ - $(ATH_SRC_BASE)/wlan/src/wlan_utils.o \ - $(ATH_SRC_BASE)/os/linux/ar6000_drv.o \ - $(ATH_SRC_BASE)/os/linux/ar6000_raw_if.o \ - $(ATH_SRC_BASE)/os/linux/wireless_ext.o \ - $(ATH_SRC_BASE)/os/linux/ioctl.o \ - $(ATH_SRC_BASE)/os/linux/netbuf.o \ - $(ATH_SRC_BASE)/os/linux/hci_bridge.o \ - $(ATH_SRC_BASE)/miscdrv/common_drv.o \ - $(ATH_SRC_BASE)/miscdrv/credit_dist.o - -ifeq ($(ATH_HIF_TYPE),SPI2) -obj-y += $(ATH_SRC_BASE)/hif/common/hif_bmi_reg_access.o \ - $(ATH_SRC_BASE)/hif/common/hif_diag_reg_access.o - -endif - -obj-m += htc.o \ - htc_send.o \ - htc_recv.o \ - htc_services.o \ - ar6k_events.o \ - ar6k.o \ - ar6k_gmbox.o \ - ar6k_gmbox_hciuart.o \ - hif.o \ - bmi.o \ - wmi.o \ - dfs_ar.o \ - dfs_bindetects.o \ - dfs.o \ - dfs_debug.o \ - dfs_fcc_bin5.o \ - dfs_init.o \ - dfs_misc.o \ - dfs_process_phyerr.o \ - dfs_process_radarevent.o \ - dfs_staggered.o \ - dfs_host_project.o \ - wlan_node.o \ - wlan_recv_beacon.o \ - wlan_utils.o \ - ar6000_drv.o \ - ar6000_raw_if.o \ - common_drv.o \ - credit_dist.o \ - netbuf.o \ - wireless_ext.o \ - rcv_aggr.o \ - ioctl.o \ - hci_bridge.o \ - ar6000.o - -ifeq ($(ATH_HIF_TYPE),SPI2) -obj-m += hif_bmi_reg_access.o \ - hif_diag_reg_access.o - -endif - -include $(ATH_LINUXPATH)/Rules.make -endif diff --git a/drivers/net/wireless/ar6003/host/os/linux/ar6000_android.c b/drivers/net/wireless/ar6003/host/os/linux/ar6000_android.c deleted file mode 100644 index 3100618e3ef7..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/ar6000_android.c +++ /dev/null @@ -1,965 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ -#include "ar6000_drv.h" -#include "htc.h" -#include -#include - -#ifdef CONFIG_HAS_WAKELOCK -#include -#endif -#ifdef CONFIG_HAS_EARLYSUSPEND -#include -#endif - -#ifdef CONFIG_MMC_MSM -A_BOOL enable_mmc_host_detect_change = 1; -#else -A_BOOL enable_mmc_host_detect_change = 0; -#endif -static void ar6000_enable_mmchost_detect_change(int enable); - - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) -#ifdef RK29 -#ifdef TCHIP -char softmac_path[256] = "/data/misc/wifi/ar6302"; -#endif -char fwpath[256] = "/system/etc/firmware"; -//char fwpath[256] = "/data/ar6302"; -#else -char fwpath[256] = "/system/wifi"; -#endif -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) */ -int wowledon; -unsigned int enablelogcat; - -extern int bmienable; -extern struct net_device *ar6000_devices[]; -extern char ifname[]; - -#ifdef CONFIG_HAS_WAKELOCK -extern struct wake_lock ar6k_wow_wake_lock; -struct wake_lock ar6k_init_wake_lock; -#endif -extern int num_device; - -const char def_ifname[] = "wlan0"; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) -module_param_string(fwpath, fwpath, sizeof(fwpath), 0644); -module_param(enablelogcat, uint, 0644); -module_param(wowledon, int, 0644); -#else -#define __user -/* for linux 2.4 and lower */ -MODULE_PARAM(wowledon,"i"); -#endif - -#ifdef CONFIG_HAS_EARLYSUSPEND -static int screen_is_off; -static struct early_suspend ar6k_early_suspend; -#endif - -static A_STATUS (*ar6000_avail_ev_p)(void *, void *); - -#if defined(CONFIG_ANDROID_LOGGER) && (!defined(CONFIG_MMC_MSM) || LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) -int logger_write(const enum logidx index, - const unsigned char prio, - const char __kernel * const tag, - const char __kernel * const fmt, - ...) -{ - int ret = 0; - va_list vargs; - struct file *filp = (struct file *)-ENOENT; - mm_segment_t oldfs; - struct iovec vec[3]; - int tag_bytes = strlen(tag) + 1, msg_bytes; - char *msg; - va_start(vargs, fmt); - msg = kvasprintf(GFP_ATOMIC, fmt, vargs); - va_end(vargs); - if (!msg) - return -ENOMEM; - if (in_interrupt()) { - /* we have no choice since aio_write may be blocked */ - printk(KERN_ALERT "%s", msg); - goto out_free_message; - } - msg_bytes = strlen(msg) + 1; - if (msg_bytes <= 1) /* empty message? */ - goto out_free_message; /* don't bother, then */ - if ((msg_bytes + tag_bytes + 1) > 2048) { - ret = -E2BIG; - goto out_free_message; - } - - vec[0].iov_base = (unsigned char *) &prio; - vec[0].iov_len = 1; - vec[1].iov_base = (void *) tag; - vec[1].iov_len = strlen(tag) + 1; - vec[2].iov_base = (void *) msg; - vec[2].iov_len = strlen(msg) + 1; - - oldfs = get_fs(); - set_fs(KERNEL_DS); - do { - filp = filp_open("/dev/log/main", O_WRONLY, S_IRUSR); - if (IS_ERR(filp) || !filp->f_op) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: filp_open /dev/log/main error\n", __FUNCTION__)); - ret = -ENOENT; - break; - } - - if (filp->f_op->aio_write) { - int nr_segs = sizeof(vec) / sizeof(vec[0]); - int len = vec[0].iov_len + vec[1].iov_len + vec[2].iov_len; - struct kiocb kiocb; - init_sync_kiocb(&kiocb, filp); - kiocb.ki_pos = 0; - kiocb.ki_left = len; - kiocb.ki_nbytes = len; - ret = filp->f_op->aio_write(&kiocb, vec, nr_segs, kiocb.ki_pos); - } - - } while (0); - - if (!IS_ERR(filp)) { - filp_close(filp, NULL); - } - set_fs(oldfs); -out_free_message: - if (msg) { - kfree(msg); - } - return ret; -} -#endif - -int android_logger_lv(void *module, int mask) -{ - switch (mask) { - case ATH_DEBUG_ERR: - return 6; - case ATH_DEBUG_INFO: - return 4; - case ATH_DEBUG_WARN: - return 5; - case ATH_DEBUG_TRC: - return 3; - default: -#ifdef DEBUG - if (!module) { - return 3; - } else if (module == &GET_ATH_MODULE_DEBUG_VAR_NAME(driver)) { - return (mask <=ATH_DEBUG_MAKE_MODULE_MASK(3)) ? 3 : 2; - } else if (module == &GET_ATH_MODULE_DEBUG_VAR_NAME(htc)) { - return 2; - } else { - return 3; - } -#else - return 3; /* DEBUG */ -#endif - } -} - -#ifdef RK29 -int -#else -static int -#endif -android_readwrite_file(const A_CHAR *filename, A_CHAR *rbuf, const A_CHAR *wbuf, size_t length) -{ - int ret = 0; - struct file *filp = (struct file *)-ENOENT; - mm_segment_t oldfs; - oldfs = get_fs(); - set_fs(KERNEL_DS); - do { - int mode = (wbuf) ? O_RDWR : O_RDONLY; -#ifdef TCHIP - if (strstr(filename, "softmac") && wbuf) { - mode = O_CREAT | O_RDWR; - } -#endif - filp = filp_open(filename, mode, S_IRUSR); - if (IS_ERR(filp) || !filp->f_op) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: file %s filp_open error\n", __FUNCTION__, filename)); - ret = -ENOENT; - break; - } - - if (length==0) { - /* Read the length of the file only */ - struct inode *inode; - - inode = GET_INODE_FROM_FILEP(filp); - if (!inode) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Get inode from %s failed\n", __FUNCTION__, filename)); - ret = -ENOENT; - break; - } - ret = i_size_read(inode->i_mapping->host); - break; - } - - if (wbuf) { - if ( (ret=filp->f_op->write(filp, wbuf, length, &filp->f_pos)) < 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Write %u bytes to file %s error %d\n", __FUNCTION__, - length, filename, ret)); - break; - } - } else { - if ( (ret=filp->f_op->read(filp, rbuf, length, &filp->f_pos)) < 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Read %u bytes from file %s error %d\n", __FUNCTION__, - length, filename, ret)); - break; - } - } - } while (0); - - if (!IS_ERR(filp)) { - filp_close(filp, NULL); - } - set_fs(oldfs); - - return ret; -} - -#ifdef TCHIP -void android_wifi_softmac_update(char *mac_buff, int len) -{ - char filename[256]; - sprintf(filename, "%s/%s", softmac_path, "softmac"); - - android_readwrite_file(filename, NULL, mac_buff, len); -} -#endif - -int android_request_firmware(const struct firmware **firmware_p, const char *name, - struct device *device) -{ - int ret = 0; - struct firmware *firmware; - char filename[256]; - const char *raw_filename = name; -#ifdef TCHIP - int sm = 0; - char mac[] = "00:00:00:00:00:00"; -#endif - - *firmware_p = firmware = A_MALLOC(sizeof(*firmware)); - if (!firmware) - return -ENOMEM; - A_MEMZERO(firmware, sizeof(*firmware)); - -#ifdef TCHIP - if(!strcmp(name,"softmac")) { - sprintf(filename, "%s/%s", softmac_path, raw_filename); - sm = 1; - } - else -#endif - sprintf(filename, "%s/%s", fwpath, raw_filename); - do { - size_t length, bufsize, bmisize; - - if ( (ret=android_readwrite_file(filename, NULL, NULL, 0)) < 0) { -#ifdef TCHIP - if (sm) { - android_wifi_softmac_update(mac, sizeof(mac)); - length = sizeof(mac); - } - else -#endif - break; - } else { - length = ret; - } - - bufsize = ALIGN(length, PAGE_SIZE); - bmisize = A_ROUND_UP(length, 4); - bufsize = max(bmisize, bufsize); - firmware->data = vmalloc(bufsize); - firmware->size = length; - if (!firmware->data) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: Cannot allocate buffer for firmware\n", __FUNCTION__)); - ret = -ENOMEM; - break; - } - - if ( (ret=android_readwrite_file(filename, (char*)firmware->data, NULL, length)) != length) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: file read error, ret %d request %d\n", __FUNCTION__, ret, length)); - ret = -1; - break; - } - - } while (0); - - if (ret<0) { - if (firmware) { - if (firmware->data) - vfree(firmware->data); - A_FREE(firmware); - } - *firmware_p = NULL; - } else { - ret = 0; - } - return ret; -} - -void android_release_firmware(const struct firmware *firmware) -{ - if (firmware) { - if (firmware->data) - vfree(firmware->data); - A_FREE((struct firmware *)firmware); - } -} - -static A_STATUS ar6000_android_avail_ev(void *context, void *hif_handle) -{ - A_STATUS ret; -#ifdef CONFIG_HAS_WAKELOCK - wake_lock(&ar6k_init_wake_lock); -#endif - ar6000_enable_mmchost_detect_change(0); - ret = ar6000_avail_ev_p(context, hif_handle); -#ifdef CONFIG_HAS_WAKELOCK - wake_unlock(&ar6k_init_wake_lock); -#endif - return ret; -} - -static int android_do_ioctl_direct(struct net_device *dev, int cmd, struct ifreq *ifr, void *data) -{ - int ret = -EIO; - int (*do_ioctl)(struct net_device *, struct ifreq *, int); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) - do_ioctl = dev->do_ioctl; -#else - do_ioctl = dev->netdev_ops->ndo_do_ioctl; -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) */ - - ifr->ifr_ifru.ifru_data = (__force void __user *)data; - - if (do_ioctl) { - mm_segment_t oldfs = get_fs(); - set_fs(KERNEL_DS); - ret = do_ioctl(dev, ifr, cmd); - set_fs(oldfs); - } - return ret; -} - -int android_ioctl_siwpriv(struct net_device *dev, - struct iw_request_info *__info, - struct iw_point *data, char *__extra) -{ - char cmd[384]; /* assume that android command will not excess 384 */ - char buf[512]; - int len = sizeof(cmd)-1; - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - - if (!data->pointer) { - return -EOPNOTSUPP; - } - if (data->length < len) { - len = data->length; - } - if (copy_from_user(cmd, data->pointer, len)) { - return -EIO; - } - cmd[len] = 0; - - if (strcasecmp(cmd, "RSSI")==0 || strcasecmp(cmd, "RSSI-APPROX") == 0) { - int rssi = -200; - struct iw_statistics *iwStats; - struct iw_statistics* (*get_iwstats)(struct net_device *); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) - get_iwstats = dev->get_wireless_stats; -#else - get_iwstats = dev->wireless_handlers->get_wireless_stats; -#endif - if (get_iwstats && arPriv->arConnected) { - iwStats = get_iwstats(dev); - if (iwStats) { - rssi = iwStats->qual.qual; - if (rssi == 255) - rssi = -200; - else - rssi += (161 - 256); - } - } - len = snprintf(buf, data->length, "SSID rssi %d\n", rssi) + 1; - return (copy_to_user(data->pointer, buf, len)==0) ? len : -1; - } else if (strcasecmp(cmd, "LINKSPEED")==0) { - /* We skip to use SIOCGIWRATE since Android always asked LINKSPEED just after RSSI*/ - unsigned int speed_mbps; - if (arPriv->arConnected) { - speed_mbps = arPriv->arTargetStats.tx_unicast_rate / 1000; - } else { - speed_mbps = 1; - } - len = snprintf(buf, data->length, "LinkSpeed %u\n", speed_mbps) + 1; - return (copy_to_user(data->pointer, buf, len)==0) ? len : -1; - } else if (memcmp(cmd, "CSCAN S\x01\x00\x00S\x00", 12)==0) { - int iocmd = SIOCSIWSCAN - SIOCSIWCOMMIT; - const iw_handler setScan = dev->wireless_handlers->standard[iocmd]; - A_INT32 home_dwell=0, pas_dwell=0, act_dwell=0; - A_UCHAR ssid[IW_ESSID_MAX_SIZE+1] = { 0 }; - A_INT32 ssid_len = 0, ie_len; - A_UINT8 index = 1; /* reserve index 0 for wext */ - A_INT32 ch = 0; - A_CHAR nprobe, scantype; - struct iw_freq chList[IW_MAX_FREQUENCIES]; - A_UCHAR *scanBuf = (A_UCHAR*)(cmd + 12); - A_UCHAR *scanEnd = (A_UCHAR*)(cmd + len); - A_BOOL broadcastSsid = FALSE; - - while ( scanBuf < scanEnd ) { - A_UCHAR *sp = scanBuf; - switch (*scanBuf) { - case 'S': /* SSID section */ - if (ssid_len > 0 && index < MAX_PROBED_SSID_INDEX) { - /* setup the last parsed ssid, reserve index 0 for wext */ - if (wmi_probedSsid_cmd(arPriv->arWmi, index, - SPECIFIC_SSID_FLAG, ssid_len, ssid) == A_OK) { - ++index; - if (arSta->scanSpecificSsidscanSpecificSsid = index; - } - } - } - ie_len = ((scanBuf + 1) < scanEnd) ? ((A_INT32)*(scanBuf+1) + 1) : 0; - if ((scanBuf+ie_len) < scanEnd ) { - ssid_len = *(scanBuf+1); - if (ssid_len == 0) { - broadcastSsid = TRUE; - } else { - A_MEMCPY(ssid, scanBuf+2, ssid_len); - ssid[ssid_len] = '\0'; - } - } - scanBuf += 1 + ie_len; - break; - case 'C': /* Channel section */ - if (scanBuf+1 < scanEnd) { - int value = *(scanBuf+1); - if (value == 0) { - ch = 0; /* scan for all channels */ - } else if (ch < IW_MAX_FREQUENCIES) { - if (value>1000) { - chList[ch].e = 1; - chList[ch].m = value * 100000; - } else { - chList[ch].e = 0; - chList[ch].m = value; - } - ++ch; - } - } - scanBuf += 2; - break; - case 'P': /* Passive dwell section */ - if (scanBuf+2 < scanEnd) { - pas_dwell = *(scanBuf+1) + (*(scanBuf+2) << 8); - } - scanBuf += 3; - break; - case 'H': /* Home dwell section */ - if (scanBuf+2 < scanEnd) { - home_dwell = *(scanBuf+1) + (*(scanBuf+2) << 8); - } - scanBuf += 3; - break; - case 'N': /* Number of probe section */ - if (scanBuf+1 < scanEnd) { - nprobe = *(scanBuf+1); - } - scanBuf += 2; - break; - case 'A': /* Active dwell section */ - if (scanBuf+2 < scanEnd) { - act_dwell = *(scanBuf+1) + (*(scanBuf+2) << 8); - } - scanBuf += 3; - break; - case 'T': /* Scan active type section */ - if (scanBuf+1 < scanEnd) { - scantype = *(scanBuf+1); - } - scanBuf += 2; - break; - default: - break; - } - if (sp == scanBuf) { - return -1; /* parsing error */ - } - } - - if (ssid_len>0) { - A_UINT8 idx; /* Clean up the last specific scan items */ - for (idx=index; idxscanSpecificSsid; ++idx) { - wmi_probedSsid_cmd(arPriv->arWmi, idx, DISABLE_SSID_FLAG, 0, NULL); - } - arSta->scanSpecificSsid = index; - /* - * There is no way to know when we need to send broadcast probe in current Android wpa_supplicant_6 - * combo scan implemenation. Always force to sent it here uniti future Android version will set - * the broadcast flags for combo scan. - */ -#if 0 - if (broadcastSsid) -#endif - { - /* setup the last index as broadcast SSID for combo scan */ - ++arSta->scanSpecificSsid; - wmi_probedSsid_cmd(arPriv->arWmi, index, ANY_SSID_FLAG, 0, NULL); - } - } - - if (pas_dwell>0) { - /* TODO: Should we change our passive dwell? There may be some impact for bt-coex */ - } - - if (home_dwell>0) { - /* TODO: Should we adjust home_dwell? How to pass it to wext handler? */ - } - - if (setScan) { - union iwreq_data miwr; - struct iw_request_info minfo; - struct iw_scan_req scanreq, *pScanReq = NULL; - A_MEMZERO(&minfo, sizeof(minfo)); - A_MEMZERO(&miwr, sizeof(miwr)); - A_MEMZERO(&scanreq, sizeof(scanreq)); - if (ssid_len > 0) { - pScanReq = &scanreq; - memcpy(scanreq.essid, ssid, ssid_len); - scanreq.essid_len = ssid_len; - miwr.data.flags |= IW_SCAN_THIS_ESSID; - } - if (ch > 0) { - pScanReq = &scanreq; - scanreq.num_channels = ch; - memcpy(scanreq.channel_list, chList, ch * sizeof(chList[0])); - miwr.data.flags |= IW_SCAN_THIS_FREQ; - } - if (pScanReq) { - miwr.data.pointer = (__force void __user *)&scanreq; - miwr.data.length = sizeof(scanreq); - } - minfo.cmd = SIOCSIWSCAN; - return setScan(dev, &minfo, &miwr, (char*)pScanReq); - } - return -1; - } else if (strcasecmp(cmd, "MACADDR")==0) { - /* reply comes back in the form "Macaddr = XX:XX:XX:XX:XX:XX" where XX */ - A_UCHAR *mac = dev->dev_addr; - len = snprintf(buf, data->length, "Macaddr = %02X:%02X:%02X:%02X:%02X:%02X\n", - mac[0], mac[1], mac[2], - mac[3], mac[4], mac[5]) + 1; - return (copy_to_user(data->pointer, buf, len)==0) ? len : -1; - } else if (strcasecmp(cmd, "SCAN-ACTIVE")==0) { - return 0; /* unsupport function. Suppress the error */ - } else if (strcasecmp(cmd, "SCAN-PASSIVE")==0) { - return 0; /* unsupport function. Suppress the error */ - } else if (strcasecmp(cmd, "START")==0 || strcasecmp(cmd, "STOP")==0) { - struct ifreq ifr; - char userBuf[16]; - int ex_arg = (strcasecmp(cmd, "START")==0) ? WLAN_ENABLED : WLAN_DISABLED; - int ret; - A_MEMZERO(userBuf, sizeof(userBuf)); - ((int *)userBuf)[0] = AR6000_XIOCTRL_WMI_SET_WLAN_STATE; - ((int *)userBuf)[1] = ex_arg; - ret = android_do_ioctl_direct(dev, AR6000_IOCTL_EXTENDED, &ifr, userBuf); - if (ret==0) { - /* Send wireless event which need by android supplicant */ - union iwreq_data wrqu; - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = strlen(cmd); - wireless_send_event(dev, IWEVCUSTOM, &wrqu, cmd); - } - return ret; - } else if (strncasecmp(cmd, "POWERMODE ", 10)==0) { - int mode; - if (sscanf(cmd, "%*s %d", &mode) == 1) { - int iocmd = SIOCSIWPOWER - SIOCSIWCOMMIT; - iw_handler setPower = dev->wireless_handlers->standard[iocmd]; - if (setPower) { - union iwreq_data miwr; - struct iw_request_info minfo; - A_MEMZERO(&minfo, sizeof(minfo)); - A_MEMZERO(&miwr, sizeof(miwr)); - minfo.cmd = SIOCSIWPOWER; - if (mode == 0 /* auto */) - miwr.power.disabled = 0; - else if (mode == 1 /* active */) - miwr.power.disabled = 1; - else - return -1; - return setPower(dev, &minfo, &miwr, NULL); - } - } - return -1; - } else if (strcasecmp(cmd, "GETPOWER")==0) { - struct ifreq ifr; - int userBuf[2]; - A_MEMZERO(userBuf, sizeof(userBuf)); - ((int *)userBuf)[0] = AR6000_XIOCTRL_WMI_GET_POWER_MODE; - if (android_do_ioctl_direct(dev, AR6000_IOCTL_EXTENDED, &ifr, userBuf)>=0) { - WMI_POWER_MODE_CMD *getPowerMode = (WMI_POWER_MODE_CMD *)userBuf; - len = snprintf(buf, data->length, "powermode = %u\n", - (getPowerMode->powerMode==MAX_PERF_POWER) ? 1/*active*/ : 0/*auto*/) + 1; - return (copy_to_user(data->pointer, buf, len)==0) ? len : -1; - } - return -1; - } else if (strncasecmp(cmd, "SETSUSPENDOPT ", 14)==0) { - int enable; - if (sscanf(cmd, "%*s %d", &enable)==1) { - /* - * We set our suspend mode by wlan_config.h now. - * Should we follow Android command?? TODO - */ - return 0; - } - return -1; - } else if (strcasecmp(cmd, "SCAN-CHANNELS")==0) { - // reply comes back in the form "Scan-Channels = X" where X is the number of channels - int iocmd = SIOCGIWRANGE - SIOCSIWCOMMIT; - iw_handler getRange = dev->wireless_handlers->standard[iocmd]; - if (getRange) { - union iwreq_data miwr; - struct iw_request_info minfo; - struct iw_range range; - A_MEMZERO(&minfo, sizeof(minfo)); - A_MEMZERO(&miwr, sizeof(miwr)); - A_MEMZERO(&range, sizeof(range)); - minfo.cmd = SIOCGIWRANGE; - miwr.data.pointer = (__force void __user *) ⦥ - miwr.data.length = sizeof(range); - getRange(dev, &minfo, &miwr, (char*)&range); - } - if (arSta->arNumChannels!=-1) { - len = snprintf(buf, data->length, "Scan-Channels = %d\n", arSta->arNumChannels) + 1; - return (copy_to_user(data->pointer, buf, len)==0) ? len : -1; - } - return -1; - } else if (strncasecmp(cmd, "SCAN-CHANNELS ", 14)==0 || - strncasecmp(cmd, "COUNTRY ", 8)==0) { - /* - * Set the available channels with WMI_SET_CHANNELPARAMS cmd - * However, the channels will be limited by the eeprom regulator domain - * Try to use a regulator domain which will not limited the channels range. - */ - int i; - int chan = 0; - A_UINT16 *clist; - struct ifreq ifr; - char ioBuf[256]; - WMI_CHANNEL_PARAMS_CMD *chParamCmd = (WMI_CHANNEL_PARAMS_CMD *)ioBuf; - if (strncasecmp(cmd, "COUNTRY ", 8)==0) { - char *country = cmd + 8; - if (strcasecmp(country, "US")==0) { - chan = 11; - } else if (strcasecmp(country, "JP")==0) { - chan = 14; - } else if (strcasecmp(country, "EU")==0) { - chan = 13; - } - } else if (sscanf(cmd, "%*s %d", &chan) != 1) { - return -1; - } - if ( (chan != 11) && (chan != 13) && (chan != 14)) { - return -1; - } - if (arPriv->arNextMode == AP_NETWORK) { - return -1; - } - A_MEMZERO(&ifr, sizeof(ifr)); - A_MEMZERO(ioBuf, sizeof(ioBuf)); - - chParamCmd->phyMode = WMI_11G_MODE; - clist = chParamCmd->channelList; - chParamCmd->numChannels = chan; - chParamCmd->scanParam = 1; - for (i = 0; i < chan; i++) { - clist[i] = wlan_ieee2freq(i + 1); - } - - return android_do_ioctl_direct(dev, AR6000_IOCTL_WMI_SET_CHANNELPARAMS, &ifr, ioBuf); - } else if (strncasecmp(cmd, "BTCOEXMODE ", 11)==0) { - int mode; - if (sscanf(cmd, "%*s %d", &mode)==1) { - /* - * Android disable BT-COEX when obtaining dhcp packet except there is headset is connected - * It enable the BT-COEX after dhcp process is finished - * We ignore since we have our way to do bt-coex during dhcp obtaining. - */ - switch (mode) { - case 1: /* Disable*/ - break; - case 0: /* Enable */ - /* fall through */ - case 2: /* Sense*/ - /* fall through */ - default: - break; - } - return 0; /* ignore it */ - } - return -1; - } else if (strcasecmp(cmd, "BTCOEXSCAN-START")==0) { - /* Android enable or disable Bluetooth coexistence scan mode. When this mode is on, - * some of the low-level scan parameters used by the driver are changed to - * reduce interference with A2DP streaming. - */ - return 0; /* ignore it since we have btfilter */ - } else if (strcasecmp(cmd, "BTCOEXSCAN-STOP")==0) { - return 0; /* ignore it since we have btfilter */ - } else if (strncasecmp(cmd, "RXFILTER-ADD ", 13)==0) { - return 0; /* ignore it */ - } else if (strncasecmp(cmd, "RXFILTER-REMOVE ", 16)==0) { - return 0; /* ignoret it */ - } else if (strcasecmp(cmd, "RXFILTER-START")==0 || strcasecmp(cmd, "RXFILTER-STOP")==0) { - unsigned int flags = dev->flags; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) - int mc_count = dev->mc_count; -#else - int mc_count = netdev_mc_count(dev); -#endif - if (strcasecmp(cmd, "RXFILTER-START")==0) { - if (mc_count > 0 || (flags & IFF_MULTICAST) ) { - flags &= ~IFF_MULTICAST; - } - } else { - flags |= IFF_MULTICAST; - } - if (flags != dev->flags) { - dev_change_flags(dev, flags); - } - return 0; - } - - return -EOPNOTSUPP; -} - -/* Useful for qualcom platform to detect our wlan card for mmc stack */ -static void ar6000_enable_mmchost_detect_change(int enable) -{ -#ifdef CONFIG_MMC_MSM -#define MMC_MSM_DEV "msm_sdcc.1" - char buf[3]; - int length; - - if (!enable_mmc_host_detect_change) { - return; - } - length = snprintf(buf, sizeof(buf), "%d\n", enable ? 1 : 0); - if (android_readwrite_file("/sys/devices/platform/" MMC_MSM_DEV "/detect_change", - NULL, buf, length) < 0) { - /* fall back to polling */ - android_readwrite_file("/sys/devices/platform/" MMC_MSM_DEV "/polling", NULL, buf, length); - A_MDELAY(50); - } -#endif -} - -#ifdef CONFIG_HAS_EARLYSUSPEND -static void android_early_suspend(struct early_suspend *h) -{ - screen_is_off = 1; -} - -static void android_late_resume(struct early_suspend *h) -{ - screen_is_off = 0; -} -#endif - -void android_module_init(OSDRV_CALLBACKS *osdrvCallbacks) -{ - bmienable = 1; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - if (ifname[0] == '\0') - strcpy(ifname, def_ifname); -#endif -#ifdef CONFIG_HAS_WAKELOCK - wake_lock_init(&ar6k_init_wake_lock, WAKE_LOCK_SUSPEND, "ar6k_init"); -#endif -#ifdef CONFIG_HAS_EARLYSUSPEND - ar6k_early_suspend.suspend = android_early_suspend; - ar6k_early_suspend.resume = android_late_resume; - ar6k_early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN; - register_early_suspend(&ar6k_early_suspend); -#endif - - ar6000_avail_ev_p = osdrvCallbacks->deviceInsertedHandler; - osdrvCallbacks->deviceInsertedHandler = ar6000_android_avail_ev; - - ar6000_enable_mmchost_detect_change(1); -} - -void android_module_exit(void) -{ -#ifdef CONFIG_HAS_EARLYSUSPEND - unregister_early_suspend(&ar6k_early_suspend); -#endif -#ifdef CONFIG_HAS_WAKELOCK - wake_lock_destroy(&ar6k_init_wake_lock); -#endif - ar6000_enable_mmchost_detect_change(1); - /* disable polling again after we remove our wlan card */ - ar6000_enable_mmchost_detect_change(0); -} - -#ifdef CONFIG_PM -void android_ar6k_check_wow_status(AR_SOFTC_T *ar, struct sk_buff *skb, A_BOOL isEvent) -{ -#ifdef CONFIG_HAS_WAKELOCK - unsigned long wake_timeout = HZ; /* 1 second for normal window's ping test */ -#endif - AR_SOFTC_DEV_T *arPriv; - A_UINT8 i; - A_BOOL needWake = FALSE; - for(i = 0; i < num_device; i++) - { - arPriv = ar->arDev[i]; - if ( -#ifdef CONFIG_HAS_EARLYSUSPEND - screen_is_off && -#endif - skb && arPriv->arConnected) { - if (isEvent) { - if (A_NETBUF_LEN(skb) >= sizeof(A_UINT16)) { - A_UINT16 cmd = *(const A_UINT16 *)A_NETBUF_DATA(skb); - switch (cmd) { - case WMI_CONNECT_EVENTID: -#ifdef CONFIG_HAS_WAKELOCK - wake_timeout = 3*HZ; -#endif - needWake = TRUE; - break; - default: - /* dont wake lock the system for other event */ - break; - } - } - } else if (A_NETBUF_LEN(skb) >= sizeof(ATH_MAC_HDR)) { - ATH_MAC_HDR *datap = (ATH_MAC_HDR *)A_NETBUF_DATA(skb); - if (!IEEE80211_IS_MULTICAST(datap->dstMac)) { - switch (A_BE2CPU16(datap->typeOrLen)) { - case 0x0800: /* IP */ - if (A_NETBUF_LEN(skb)>=24 && - *((A_UCHAR*)A_NETBUF_DATA(skb)+23)==0x11) { - A_UCHAR *udpPkt = (A_UCHAR*)A_NETBUF_DATA(skb)+14; - A_UINT8 ihl = (*udpPkt & 0x0f) * sizeof(A_UINT32); - const A_UCHAR ipsec_keepalive[] = { - 0x11, 0x94, 0x11, 0x94, 0x00, 0x09, 0x00, 0x00, 0xff - }; - udpPkt += ihl; - if (A_NETBUF_LEN(skb)>=14+ihl+sizeof(ipsec_keepalive) && - !memcmp(udpPkt, ipsec_keepalive, sizeof(ipsec_keepalive)-3) && - udpPkt[8]==0xff) { - /* - * RFC 3948 UDP Encapsulation of IPsec ESP Packets - * Source and Destination port must be 4500 - * Receivers MUST NOT depend upon the UDP checksum being zero - * Sender must use 1 byte payload with 0xff - * Receiver SHOULD ignore a received NAT-keepalive packet - * - * IPSec over UDP NAT keepalive packet. Just ignore - */ - break; - } - } - case 0x888e: /* EAPOL */ - case 0x88c7: /* RSN_PREAUTH */ - case 0x88b4: /* WAPI */ - needWake = TRUE; - break; - case 0x0806: /* ARP is not important to hold wake lock */ - needWake = (arPriv->arNetworkType==AP_NETWORK); - break; - default: - break; - } - } else if ( !IEEE80211_IS_BROADCAST(datap->dstMac) ) { - if (A_NETBUF_LEN(skb)>=14+20 ) { - /* check if it is mDNS packets */ - A_UINT8 *dstIpAddr = (A_UINT8*)(A_NETBUF_DATA(skb)+14+20-4); - struct net_device *ndev = arPriv->arNetDev; - needWake = ((dstIpAddr[3] & 0xf8) == 0xf8) && - (arPriv->arNetworkType==AP_NETWORK || - (ndev->flags & IFF_ALLMULTI || ndev->flags & IFF_MULTICAST)); - } - }else if (arPriv->arNetworkType==AP_NETWORK) { - switch (A_BE2CPU16(datap->typeOrLen)) { - case 0x0800: /* IP */ - if (A_NETBUF_LEN(skb)>=14+20+2) { - A_UINT16 dstPort = *(A_UINT16*)(A_NETBUF_DATA(skb)+14+20); - dstPort = A_BE2CPU16(dstPort); - needWake = (dstPort == 0x43); /* dhcp request */ - } - break; - case 0x0806: - needWake = TRUE; - default: - break; - } - } - } - } - } - if (needWake) { -#ifdef CONFIG_HAS_WAKELOCK - /* keep host wake up if there is any event and packate comming in*/ - wake_lock_timeout(&ar6k_wow_wake_lock, wake_timeout); -#endif - if (wowledon) { - char buf[32]; - int len = sprintf(buf, "on"); - android_readwrite_file("/sys/power/state", NULL, buf, len); - - len = sprintf(buf, "%d", 127); - android_readwrite_file("/sys/class/leds/lcd-backlight/brightness", - NULL, buf,len); - } - } -} -#endif /* CONFIG_PM */ - -void android_send_reload_event(AR_SOFTC_DEV_T *arPriv) -{ - struct net_device *ndev = arPriv->arNetDev; - union iwreq_data wrqu; - const char reloadEvt[] = "HANG"; - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = strlen(reloadEvt); - wireless_send_event(ndev, IWEVCUSTOM, &wrqu, reloadEvt); -} diff --git a/drivers/net/wireless/ar6003/host/os/linux/ar6000_drv.c b/drivers/net/wireless/ar6003/host/os/linux/ar6000_drv.c deleted file mode 100644 index e5d7952376ce..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/ar6000_drv.c +++ /dev/null @@ -1,8934 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -/* - * This driver is a pseudo ethernet driver to access the Atheros AR6000 - * WLAN Device - */ - -#ifdef ATH_AR6K_11N_SUPPORT -#define SUPPORT_11N -#include "wlan_defs.h" -#endif - -#include "ar6000_drv.h" -#ifdef ATH6K_CONFIG_CFG80211 -#include "cfg80211.h" -#endif /* ATH6K_CONFIG_CFG80211 */ -#include "htc.h" -#include "wmi_filter_linux.h" -#include "epping_test.h" -#include "wlan_config.h" -#include "ar3kconfig.h" -#include "dfs_host.h" -#include "ar6k_pal.h" -#include "AR6002/addrs.h" -#include "target_reg_table.h" -#include "p2p_api.h" - -/* LINUX_HACK_FUDGE_FACTOR -- this is used to provide a workaround for linux behavior. When - * the meta data was added to the header it was found that linux did not correctly provide - * enough headroom. However when more headroom was requested beyond what was truly needed - * Linux gave the requested headroom. Therefore to get the necessary headroom from Linux - * the driver requests more than is needed by the amount = LINUX_HACK_FUDGE_FACTOR */ -#define LINUX_HACK_FUDGE_FACTOR 16 -#define BDATA_BDADDR_OFFSET 28 - -A_UINT8 bcast_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; -A_UINT8 null_mac[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; - -#ifdef DEBUG - -#define ATH_DEBUG_DBG_LOG ATH_DEBUG_MAKE_MODULE_MASK(0) -#define ATH_DEBUG_WLAN_CONNECT ATH_DEBUG_MAKE_MODULE_MASK(1) -#define ATH_DEBUG_WLAN_SCAN ATH_DEBUG_MAKE_MODULE_MASK(2) -#define ATH_DEBUG_WLAN_TX ATH_DEBUG_MAKE_MODULE_MASK(3) -#define ATH_DEBUG_WLAN_RX ATH_DEBUG_MAKE_MODULE_MASK(4) -#define ATH_DEBUG_HTC_RAW ATH_DEBUG_MAKE_MODULE_MASK(5) -#define ATH_DEBUG_HCI_BRIDGE ATH_DEBUG_MAKE_MODULE_MASK(6) - -static ATH_DEBUG_MASK_DESCRIPTION driver_debug_desc[] = { - { ATH_DEBUG_DBG_LOG , "Target Debug Logs"}, - { ATH_DEBUG_WLAN_CONNECT , "WLAN connect"}, - { ATH_DEBUG_WLAN_SCAN , "WLAN scan"}, - { ATH_DEBUG_WLAN_TX , "WLAN Tx"}, - { ATH_DEBUG_WLAN_RX , "WLAN Rx"}, - { ATH_DEBUG_HTC_RAW , "HTC Raw IF tracing"}, - { ATH_DEBUG_HCI_BRIDGE , "HCI Bridge Setup"}, - { ATH_DEBUG_HCI_RECV , "HCI Recv tracing"}, - { ATH_DEBUG_HCI_DUMP , "HCI Packet dumps"}, -}; - -ATH_DEBUG_INSTANTIATE_MODULE_VAR(driver, - "driver", - "Linux Driver Interface", - ATH_DEBUG_MASK_DEFAULTS | ATH_DEBUG_WLAN_SCAN | - ATH_DEBUG_HCI_BRIDGE, - ATH_DEBUG_DESCRIPTION_COUNT(driver_debug_desc), - driver_debug_desc); - -#endif - - -#define IS_MAC_NULL(mac) (mac[0]==0 && mac[1]==0 && mac[2]==0 && mac[3]==0 && mac[4]==0 && mac[5]==0) -#define IS_MAC_BCAST(mac) (*mac==0xff) - -#define DESCRIPTION "Driver to access the Atheros AR600x Device, version " __stringify(__VER_MAJOR_) "." __stringify(__VER_MINOR_) "." __stringify(__VER_PATCH_) "." __stringify(__BUILD_NUMBER_) - -MODULE_AUTHOR("Atheros Communications, Inc."); -MODULE_DESCRIPTION(DESCRIPTION); -MODULE_LICENSE("GPL and additional rights"); - -#ifndef REORG_APTC_HEURISTICS -#undef ADAPTIVE_POWER_THROUGHPUT_CONTROL -#endif /* REORG_APTC_HEURISTICS */ - -#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL -A_TIMER aptcTimer[NUM_DEV]; -#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */ - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -// callbacks registered by HCI transport driver -HCI_TRANSPORT_CALLBACKS ar6kHciTransCallbacks = { NULL }; -#endif - -unsigned int processDot11Hdr = 0; -char targetconf[10]={0,}; -int bmienable = BMIENABLE_DEFAULT; - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) -char ifname[IFNAMSIZ] = {0,}; -char devmode[32] ={0,}; -char submode[32] ={0,}; -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) */ - -int regcode = 0x60; -int wlaninitmode = WLAN_INIT_MODE_DEFAULT; -unsigned int bypasswmi = 0; -unsigned int debuglevel = 0; -int tspecCompliance = ATHEROS_COMPLIANCE; -unsigned int busspeedlow = 0; -unsigned int onebitmode = 0; -unsigned int skipflash = 0; -unsigned int wmitimeout = 2; -unsigned int wlanNodeCaching = 1; -unsigned int enableuartprint = ENABLEUARTPRINT_DEFAULT; -unsigned int logWmiRawMsgs = 0; -unsigned int enabletimerwar = 0; -unsigned int fwmode = 1; -unsigned int fwsubmode = 0; -unsigned int mbox_yield_limit = 99; -unsigned int enablerssicompensation = 0; -int reduce_credit_dribble = 1 + HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_HALF; -int allow_trace_signal = 0; -#ifdef CONFIG_HOST_TCMD_SUPPORT -unsigned int testmode =0; -#endif -unsigned int firmware_bridge = 0; - -unsigned int irqprocmode = HIF_DEVICE_IRQ_SYNC_ONLY;//HIF_DEVICE_IRQ_ASYNC_SYNC; -unsigned int panic_on_assert = 1; -unsigned int nohifscattersupport = NOHIFSCATTERSUPPORT_DEFAULT; - -unsigned int setuphci = SETUPHCI_DEFAULT; -unsigned int setuphcipal = SETUPHCIPAL_DEFAULT; -unsigned int loghci = 0; -unsigned int setupbtdev = SETUPBTDEV_DEFAULT; -#ifndef EXPORT_HCI_BRIDGE_INTERFACE -unsigned int ar3khcibaud = AR3KHCIBAUD_DEFAULT; -unsigned int hciuartscale = HCIUARTSCALE_DEFAULT; -unsigned int hciuartstep = HCIUARTSTEP_DEFAULT; -#endif -#ifdef CONFIG_CHECKSUM_OFFLOAD -unsigned int csumOffload=0; -unsigned int csumOffloadTest=0; -#endif -unsigned int eppingtest=0; -unsigned int regscanmode=0; -unsigned int num_device=1; -unsigned char ar6k_init=FALSE; -unsigned int rtc_reset_only_on_exit=0; -unsigned int mac_addr_method=0; -A_BOOL avail_ev_called=FALSE; - - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) -module_param_string(ifname, ifname, sizeof(ifname), 0644); -module_param(regcode, int, 0644); -module_param(wlaninitmode, int, 0644); -module_param(bmienable, int, 0644); -module_param(bypasswmi, uint, 0644); -module_param(debuglevel, uint, 0644); -module_param(tspecCompliance, int, 0644); -module_param(onebitmode, uint, 0644); -module_param(busspeedlow, uint, 0644); -module_param(skipflash, uint, 0644); -module_param(wmitimeout, uint, 0644); -module_param(wlanNodeCaching, uint, 0644); -module_param(logWmiRawMsgs, uint, 0644); -module_param(enableuartprint, uint, 0644); -module_param(enabletimerwar, uint, 0644); -module_param(mbox_yield_limit, uint, 0644); -module_param(reduce_credit_dribble, int, 0644); -module_param(allow_trace_signal, int, 0644); -module_param(enablerssicompensation, uint, 0644); -module_param(processDot11Hdr, uint, 0644); -#ifdef CONFIG_CHECKSUM_OFFLOAD -module_param(csumOffload, uint, 0644); -#endif -#ifdef CONFIG_HOST_TCMD_SUPPORT -module_param(testmode, uint, 0644); -#endif -module_param(firmware_bridge, uint, 0644); -module_param(irqprocmode, uint, 0644); -module_param(nohifscattersupport, uint, 0644); -module_param(panic_on_assert, uint, 0644); -module_param(setuphci, uint, 0644); -module_param(setuphcipal, uint, 0644); -module_param(loghci, uint, 0644); -module_param(setupbtdev, uint, 0644); -#ifndef EXPORT_HCI_BRIDGE_INTERFACE -module_param(ar3khcibaud, uint, 0644); -module_param(hciuartscale, uint, 0644); -module_param(hciuartstep, uint, 0644); -#endif -module_param(eppingtest, uint, 0644); -module_param(regscanmode, uint, 0644); -module_param_string(devmode, devmode, sizeof(devmode), 0644); -module_param_string(submode, submode, sizeof(submode), 0644); -module_param_string(targetconf, targetconf, sizeof(targetconf), 0644); -module_param(rtc_reset_only_on_exit, uint, 0644); -module_param(mac_addr_method, uint, 0644); -#else - -#define __user -/* for linux 2.4 and lower */ -MODULE_PARM(bmienable,"i"); -MODULE_PARM(wlaninitmode,"i"); -MODULE_PARM(bypasswmi,"i"); -MODULE_PARM(debuglevel, "i"); -MODULE_PARM(onebitmode,"i"); -MODULE_PARM(busspeedlow, "i"); -MODULE_PARM(skipflash, "i"); -MODULE_PARM(wmitimeout, "i"); -MODULE_PARM(wlanNodeCaching, "i"); -MODULE_PARM(enableuartprint,"i"); -MODULE_PARM(logWmiRawMsgs, "i"); -MODULE_PARM(enabletimerwar,"i"); -MODULE_PARM(mbox_yield_limit,"i"); -MODULE_PARM(reduce_credit_dribble,"i"); -MODULE_PARM(allow_trace_signal,"i"); -MODULE_PARM(enablerssicompensation,"i"); -MODULE_PARM(processDot11Hdr,"i"); -#ifdef CONFIG_CHECKSUM_OFFLOAD -MODULE_PARM(csumOffload,"i"); -#endif -#ifdef CONFIG_HOST_TCMD_SUPPORT -MODULE_PARM(testmode, "i"); -#endif -MODULE_PARM(irqprocmode, "i"); -MODULE_PARM(nohifscattersupport, "i"); -MODULE_PARM(panic_on_assert, "i"); -MODULE_PARM(setuphci, "i"); -MODULE_PARM(setuphcipal, "i"); -MODULE_PARM(loghci, "i"); -MODULE_PARM(regscanmode, "i"); -MODULE_PARM(rtc_reset_only_on_exit, "i"); -MODULE_PARM(mac_addr_method, "i"); -#endif - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10) -/* in 2.6.10 and later this is now a pointer to a uint */ -unsigned int _mboxnum = HTC_MAILBOX_NUM_MAX; -#define mboxnum &_mboxnum -#else -unsigned int mboxnum = HTC_MAILBOX_NUM_MAX; -#endif - -#ifdef DEBUG -A_UINT32 g_dbg_flags = DBG_DEFAULTS; -unsigned int debugflags = 0; -int debugdriver = 0; -unsigned int debughtc = 0; -unsigned int debugbmi = 0; -unsigned int debughif = 0; -unsigned int txcreditsavailable[HTC_MAILBOX_NUM_MAX] = {0}; -unsigned int txcreditsconsumed[HTC_MAILBOX_NUM_MAX] = {0}; -unsigned int txcreditintrenable[HTC_MAILBOX_NUM_MAX] = {0}; -unsigned int txcreditintrenableaggregate[HTC_MAILBOX_NUM_MAX] = {0}; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) -module_param(debugflags, uint, 0644); -module_param(debugdriver, int, 0644); -module_param(debughtc, uint, 0644); -module_param(debugbmi, uint, 0644); -module_param(debughif, uint, 0644); -module_param_array(txcreditsavailable, uint, mboxnum, 0644); -module_param_array(txcreditsconsumed, uint, mboxnum, 0644); -module_param_array(txcreditintrenable, uint, mboxnum, 0644); -module_param_array(txcreditintrenableaggregate, uint, mboxnum, 0644); -#else -/* linux 2.4 and lower */ -MODULE_PARM(debugflags,"i"); -MODULE_PARM(debugdriver, "i"); -MODULE_PARM(debughtc, "i"); -MODULE_PARM(debugbmi, "i"); -MODULE_PARM(debughif, "i"); -MODULE_PARM(txcreditsavailable, "0-3i"); -MODULE_PARM(txcreditsconsumed, "0-3i"); -MODULE_PARM(txcreditintrenable, "0-3i"); -MODULE_PARM(txcreditintrenableaggregate, "0-3i"); -#endif - -#endif /* DEBUG */ - -#ifdef RK29 -unsigned int resetok = 0; -#else -unsigned int resetok = 1; -#endif -unsigned int tx_attempt[HTC_MAILBOX_NUM_MAX] = {0}; -unsigned int tx_post[HTC_MAILBOX_NUM_MAX] = {0}; -unsigned int tx_complete[HTC_MAILBOX_NUM_MAX] = {0}; -unsigned int hifBusRequestNumMax = 40; -unsigned int war23838_disabled = 0; -#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL -unsigned int enableAPTCHeuristics = 1; -#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) -module_param_array(tx_attempt, uint, mboxnum, 0644); -module_param_array(tx_post, uint, mboxnum, 0644); -module_param_array(tx_complete, uint, mboxnum, 0644); -module_param(hifBusRequestNumMax, uint, 0644); -module_param(war23838_disabled, uint, 0644); -module_param(resetok, uint, 0644); -#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL -module_param(enableAPTCHeuristics, uint, 0644); -#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */ -#else -MODULE_PARM(tx_attempt, "0-3i"); -MODULE_PARM(tx_post, "0-3i"); -MODULE_PARM(tx_complete, "0-3i"); -MODULE_PARM(hifBusRequestNumMax, "i"); -MODULE_PARM(war23838_disabled, "i"); -MODULE_PARM(resetok, "i"); -#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL -MODULE_PARM(enableAPTCHeuristics, "i"); -#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */ -#endif - -#ifdef BLOCK_TX_PATH_FLAG -int blocktx = 0; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) -module_param(blocktx, int, 0644); -#else -MODULE_PARM(blocktx, "i"); -#endif -#endif /* BLOCK_TX_PATH_FLAG */ - -static A_INT16 rssi_compensation_table[NUM_DEV][96]; - -int reconnect_flag = 0; -static ar6k_pal_config_t ar6k_pal_config_g; - -/* Function declarations */ -static int ar6000_init_module(void); -static void ar6000_cleanup_module(void); - -int ar6000_init(struct net_device *dev); -static int ar6000_open(struct net_device *dev); -static int ar6000_close(struct net_device *dev); -static int ar6000_init_control_info(AR_SOFTC_DEV_T *arPriv); -static int ar6000_data_tx(struct sk_buff *skb, struct net_device *dev); - -void ar6000_destroy(struct net_device *dev, unsigned int unregister); -void ar6000_cleanup(AR_SOFTC_T *ar); -static void ar6000_detect_error(unsigned long ptr); -static void ar6000_set_multicast_list(struct net_device *dev); -static struct net_device_stats *ar6000_get_stats(struct net_device *dev); -static struct iw_statistics *ar6000_get_iwstats(struct net_device * dev); - -static void disconnect_timer_handler(unsigned long ptr); -static void ap_acs_handler(unsigned long ptr); - -void read_rssi_compensation_param(AR_SOFTC_T *ar); -void target_register_tbl_attach(A_UINT32 target_type); -static void ar6000_uapsd_trigger_frame_rx(AR_SOFTC_DEV_T *arPriv, conn_t *conn); - - /* for android builds we call external APIs that handle firmware download and configuration */ -#ifdef ANDROID_ENV -/* !!!! Interim android support to make it easier to patch the default driver for - * android use. You must define an external source file ar6000_android.c that handles the following - * APIs */ -extern void android_module_init(OSDRV_CALLBACKS *osdrvCallbacks); -extern void android_module_exit(void); -extern void android_send_reload_event(AR_SOFTC_DEV_T *arPriv); -#define ANDROID_RELOAD_THRESHOLD_FOR_EP_FULL 5 -static int android_epfull_cnt; -#endif -/* - * HTC service connection handlers - */ -static A_STATUS ar6000_avail_ev(void *context, void *hif_handle); - -static A_STATUS ar6000_unavail_ev(void *context, void *hif_handle); - -A_STATUS ar6000_configure_target(AR_SOFTC_T *ar); - -static void ar6000_target_failure(void *Instance, A_STATUS Status); - -static void ar6000_rx(void *Context, HTC_PACKET *pPacket); - -static void ar6000_rx_refill(void *Context,HTC_ENDPOINT_ID Endpoint); - -static void ar6000_tx_complete(void *Context, HTC_PACKET_QUEUE *pPackets); - -static HTC_SEND_FULL_ACTION ar6000_tx_queue_full(void *Context, HTC_PACKET *pPacket); - -#ifdef ATH_AR6K_11N_SUPPORT -static void ar6000_alloc_netbufs(A_NETBUF_QUEUE_T *q, A_UINT16 num); -#endif -static void ar6000_deliver_frames_to_nw_stack(void * dev, void *osbuf); -//static void ar6000_deliver_frames_to_bt_stack(void * dev, void *osbuf); - -static HTC_PACKET *ar6000_alloc_amsdu_rxbuf(void *Context, HTC_ENDPOINT_ID Endpoint, int Length); - -static void ar6000_refill_amsdu_rxbufs(AR_SOFTC_T *ar, int Count); - -static void ar6000_cleanup_amsdu_rxbufs(AR_SOFTC_T *ar); - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) -static ssize_t -ar6000_sysfs_bmi_read(struct kobject *kobj, struct bin_attribute *bin_attr, - char *buf, loff_t pos, size_t count); - -static ssize_t -ar6000_sysfs_bmi_write(struct kobject *kobj, struct bin_attribute *bin_attr, - char *buf, loff_t pos, size_t count); -#else -static ssize_t -ar6000_sysfs_bmi_read(struct file *fp, struct kobject *kobj, - struct bin_attribute *bin_attr, - char *buf, loff_t pos, size_t count); - -static ssize_t -ar6000_sysfs_bmi_write(struct file *fp, struct kobject *kobj, - struct bin_attribute *bin_attr, - char *buf, loff_t pos, size_t count); -#endif - -static A_STATUS -ar6000_sysfs_bmi_init(AR_SOFTC_T *ar); - -/* HCI PAL callback function declarations */ -A_STATUS ar6k_setup_hci_pal(AR_SOFTC_DEV_T *ar); -void ar6k_cleanup_hci_pal(AR_SOFTC_DEV_T *ar); - -static void -ar6000_sysfs_bmi_deinit(AR_SOFTC_T *ar); - -A_STATUS -ar6000_sysfs_bmi_get_config(AR_SOFTC_T *ar, A_UINT32 mode); - -/* - * Static variables - */ - -struct net_device *ar6000_devices[NUM_DEV]; -extern struct iw_handler_def ath_iw_handler_def; -static void ar6000_cookie_init(AR_SOFTC_T *ar); -static void ar6000_cookie_cleanup(AR_SOFTC_T *ar); -static void ar6000_free_cookie(AR_SOFTC_T *ar, struct ar_cookie * cookie); -static struct ar_cookie *ar6000_alloc_cookie(AR_SOFTC_T *ar); - -#ifdef USER_KEYS -static A_STATUS ar6000_reinstall_keys(AR_SOFTC_DEV_T *arPriv,A_UINT8 key_op_ctrl); -#endif - - -static struct ar_cookie s_ar_cookie_mem[MAX_COOKIE_NUM]; - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29) -static struct net_device_ops ar6000_netdev_ops = { - .ndo_init = NULL, - .ndo_open = ar6000_open, - .ndo_stop = ar6000_close, - .ndo_get_stats = ar6000_get_stats, - .ndo_do_ioctl = ar6000_ioctl, - .ndo_start_xmit = ar6000_data_tx, - .ndo_set_multicast_list = ar6000_set_multicast_list, - .ndo_change_mtu = eth_change_mtu, -}; -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29) */ - -/* Debug log support */ - -/* - * Flag to govern whether the debug logs should be parsed in the kernel - * or reported to the application. - */ -#define REPORT_DEBUG_LOGS_TO_APP - -A_STATUS -ar6000_set_host_app_area(AR_SOFTC_T *ar) -{ - A_UINT32 address, data; - struct host_app_area_s host_app_area; - - /* Fetch the address of the host_app_area_s instance in the host interest area */ - address = TARG_VTOP(ar->arTargetType, HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_app_host_interest)); - if (ar6000_ReadRegDiag(ar->arHifDevice, &address, &data) != A_OK) { - return A_ERROR; - } - address = TARG_VTOP(ar->arTargetType, data); - host_app_area.wmi_protocol_ver = WMI_PROTOCOL_VERSION; - if (ar6000_WriteDataDiag(ar->arHifDevice, address, - (A_UCHAR *)&host_app_area, - sizeof(struct host_app_area_s)) != A_OK) - { - return A_ERROR; - } - - return A_OK; -} - -A_UINT32 -dbglog_get_debug_hdr_ptr(AR_SOFTC_T *ar) -{ - A_UINT32 param; - A_UINT32 address; - A_STATUS status; - - address = TARG_VTOP(ar->arTargetType, HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_dbglog_hdr)); - if ((status = ar6000_ReadDataDiag(ar->arHifDevice, address, - (A_UCHAR *)¶m, 4)) != A_OK) - { - param = 0; - } - - return param; -} - -/* - * The dbglog module has been initialized. Its ok to access the relevant - * data stuctures over the diagnostic window. - */ -void -ar6000_dbglog_init_done(AR_SOFTC_DEV_T *arPriv) -{ - AR_SOFTC_T *ar = arPriv->arSoftc; - ar->dbglog_init_done = TRUE; -} - -A_UINT32 -dbglog_get_debug_fragment(A_INT8 *datap, A_UINT32 len, A_UINT32 limit) -{ - A_INT32 *buffer; - A_UINT32 count; - A_UINT32 numargs; - A_UINT32 length; - A_UINT32 fraglen; - - count = fraglen = 0; - buffer = (A_INT32 *)datap; - length = (limit >> 2); - - if (len <= limit) { - fraglen = len; - } else { - while (count < length) { - numargs = DBGLOG_GET_NUMARGS(buffer[count]); - fraglen = (count << 2); - count += numargs + 1; - } - } - - return fraglen; -} - -void -dbglog_parse_debug_logs(A_INT8 *datap, A_UINT32 len) -{ - A_INT32 *buffer; - A_UINT32 count; - A_UINT32 timestamp; - A_UINT32 debugid; - A_UINT32 moduleid; - A_UINT32 numargs; - A_UINT32 length; - - count = 0; - buffer = (A_INT32 *)datap; - length = (len >> 2); - while (count < length) { - debugid = DBGLOG_GET_DBGID(buffer[count]); - moduleid = DBGLOG_GET_MODULEID(buffer[count]); - numargs = DBGLOG_GET_NUMARGS(buffer[count]); - timestamp = DBGLOG_GET_TIMESTAMP(buffer[count]); - switch (numargs) { - case 0: - AR_DEBUG_PRINTF(ATH_DEBUG_DBG_LOG,("%d %d (%d)\n", moduleid, debugid, timestamp)); - break; - - case 1: - AR_DEBUG_PRINTF(ATH_DEBUG_DBG_LOG,("%d %d (%d): 0x%x\n", moduleid, debugid, - timestamp, buffer[count+1])); - break; - - case 2: - AR_DEBUG_PRINTF(ATH_DEBUG_DBG_LOG,("%d %d (%d): 0x%x, 0x%x\n", moduleid, debugid, - timestamp, buffer[count+1], buffer[count+2])); - break; - - default: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Invalid args: %d\n", numargs)); - } - count += numargs + 1; - } -} - -int -ar6000_dbglog_get_debug_logs(AR_SOFTC_T *ar) -{ - struct dbglog_hdr_s debug_hdr; - struct dbglog_buf_s debug_buf; - A_UINT32 address; - A_UINT32 length; - A_UINT32 dropped; - A_UINT32 firstbuf; - A_UINT32 debug_hdr_ptr; - - if (!ar->dbglog_init_done) return A_ERROR; - - - AR6000_SPIN_LOCK(&ar->arLock, 0); - - if (ar->dbgLogFetchInProgress) { - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - return A_EBUSY; - } - - /* block out others */ - ar->dbgLogFetchInProgress = TRUE; - - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - - debug_hdr_ptr = dbglog_get_debug_hdr_ptr(ar); - printk("debug_hdr_ptr: 0x%x\n", debug_hdr_ptr); - - /* Get the contents of the ring buffer */ - if (debug_hdr_ptr) { - address = TARG_VTOP(ar->arTargetType, debug_hdr_ptr); - length = sizeof(struct dbglog_hdr_s); - ar6000_ReadDataDiag(ar->arHifDevice, address, - (A_UCHAR *)&debug_hdr, length); - address = TARG_VTOP(ar->arTargetType, (A_UINT32)debug_hdr.dbuf); - firstbuf = address; - dropped = debug_hdr.dropped; - length = sizeof(struct dbglog_buf_s); - ar6000_ReadDataDiag(ar->arHifDevice, address, - (A_UCHAR *)&debug_buf, length); - - do { - address = TARG_VTOP(ar->arTargetType, (A_UINT32)debug_buf.buffer); - length = debug_buf.length; - if ((length) && (debug_buf.length <= debug_buf.bufsize)) { - /* Rewind the index if it is about to overrun the buffer */ - if (ar->log_cnt > (DBGLOG_HOST_LOG_BUFFER_SIZE - length)) { - ar->log_cnt = 0; - } - if(A_OK != ar6000_ReadDataDiag(ar->arHifDevice, address, - (A_UCHAR *)&ar->log_buffer[ar->log_cnt], length)) - { - break; - } - ar6000_dbglog_event(ar->arDev[0], dropped, (A_INT8*)&ar->log_buffer[ar->log_cnt], length); - ar->log_cnt += length; - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_DBG_LOG,("Length: %d (Total size: %d)\n", - debug_buf.length, debug_buf.bufsize)); - } - - address = TARG_VTOP(ar->arTargetType, (A_UINT32)debug_buf.next); - length = sizeof(struct dbglog_buf_s); - if(A_OK != ar6000_ReadDataDiag(ar->arHifDevice, address, - (A_UCHAR *)&debug_buf, length)) - { - break; - } - - } while (address != firstbuf); - } - - ar->dbgLogFetchInProgress = FALSE; - - return A_OK; -} - -void -ar6000_dbglog_event(AR_SOFTC_DEV_T *arPriv, A_UINT32 dropped, - A_INT8 *buffer, A_UINT32 length) -{ -#ifdef REPORT_DEBUG_LOGS_TO_APP - #define MAX_WIRELESS_EVENT_SIZE 252 - /* - * Break it up into chunks of MAX_WIRELESS_EVENT_SIZE bytes of messages. - * There seems to be a limitation on the length of message that could be - * transmitted to the user app via this mechanism. - */ - A_UINT32 send, sent; - - sent = 0; - send = dbglog_get_debug_fragment(&buffer[sent], length - sent, - MAX_WIRELESS_EVENT_SIZE); - while (send) { - ar6000_send_event_to_app(arPriv, WMIX_DBGLOG_EVENTID, (A_UINT8*)&buffer[sent], send); - sent += send; - send = dbglog_get_debug_fragment(&buffer[sent], length - sent, - MAX_WIRELESS_EVENT_SIZE); - } -#else - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Dropped logs: 0x%x\nDebug info length: %d\n", - dropped, length)); - - /* Interpret the debug logs */ - dbglog_parse_debug_logs((A_INT8*)buffer, length); -#endif /* REPORT_DEBUG_LOGS_TO_APP */ -} - -void -ar6000_parse_dev_mode(A_CHAR *mode) -{ - A_UINT8 i, match = FALSE, mode_len; - A_UINT8 val_mode, val_submode; - A_UINT8 num_submode; - - char *valid_modes[] = { "sta", - "ap", - "ibss", - "bt30amp", - "sta,ap", - "ap,sta", - "ap,ap", - "sta,sta", - "sta,bt30amp", - "sta,ap,ap" - }; - char *valid_submodes[] = { "none", - "p2pdev", - /*"p2pclient",*/ //persistent p2p support - /*"p2pgo", */ // persistent p2p support - "none,none", - "none,none,none", - "none,p2pdev", - "p2pdev,none", - /*"none,p2pclient",*/ //persistent p2p support - /*"none,p2pgo"*/ // persistent p2p support - }; - - A_CHAR *dev_mode; - A_CHAR *str; - A_UINT32 host_int = 0; - - dev_mode = mode; - str = mode; - num_device = 0; - fwmode = 0; - - mode_len = strlen(dev_mode); - for (i=0; i <= 9; i++) { - if ((mode_len == strlen(valid_modes[i])) && (strcmp(dev_mode,valid_modes[i]))==0) { - match = TRUE; - break; - } - } - - if(!match) { - num_device = fwmode = 1; - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ERROR: Wrong mode. using default (single device STA mode).\n")); - return; - } - - do - { - str++; - if(*str == ',' || *str == '\0') { - num_device++; - if(strncmp(dev_mode,"ap",2) == 0) { - host_int = HI_OPTION_FW_MODE_AP; - } - else if(strncmp(dev_mode,"sta",3) == 0) { - host_int = HI_OPTION_FW_MODE_BSS_STA; - } - else if(strncmp(dev_mode,"ibss",4) == 0 ) { - host_int = HI_OPTION_FW_MODE_IBSS; - } else if(strncmp(dev_mode,"bt30amp",7) == 0) { - host_int = HI_OPTION_FW_MODE_BT30AMP; - } - - fwmode |= (host_int << ((num_device -1) * HI_OPTION_FW_MODE_BITS)); - dev_mode = ++str; - } - }while(*dev_mode != '\0'); - - /* Validate submode if present */ - if (!submode[0]) { - /* default "none" submode for all devices */ - fwsubmode = 0; - return; - } - - dev_mode = submode; - str = submode; - num_submode = 0; - fwsubmode = 0; - match = FALSE; - - mode_len = strlen(dev_mode); - for (i=0; i<6; i++) { - if ((mode_len == strlen(valid_submodes[i])) && (strcmp(dev_mode,valid_submodes[i]))==0) { - match = TRUE; - break; - } - } - - if (!match) { - fwsubmode = 0; - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ERROR: Wrong submode. using default (none for all devs).\n")); - return; - } - - do - { - str++; - if(*str == ',' || *str == '\0') { - num_submode++; - if(strncmp(dev_mode,"none",4) == 0) { - host_int = HI_OPTION_FW_SUBMODE_NONE; - } - else if(strncmp(dev_mode,"p2pdev",6) == 0) { - host_int = HI_OPTION_FW_SUBMODE_P2PDEV; - } - else if(strncmp(dev_mode,"p2pclient",9) == 0 ) { - host_int = HI_OPTION_FW_SUBMODE_P2PCLIENT; - } else if(strncmp(dev_mode,"p2pgo",5) == 0 ) { - host_int = HI_OPTION_FW_SUBMODE_P2PGO; - } - fwsubmode |= (host_int << ((num_submode -1) * HI_OPTION_FW_SUBMODE_BITS)); - dev_mode = ++str; - } - }while(*dev_mode != '\0'); - - /* Validate if the subopmode is specified for all the devs. - */ - if (num_device != num_submode) { - /* default to "none" submode for all devices */ - fwsubmode = 0; - return; - } - - /* Validate if the submode specified is appropriate for the device modes - * specified for each device. The following is the validation recipe. - * fwmode fwsubmode - * ----------------------- - * IBSS none - * STA none,p2pdev,p2pclient - * AP none,p2pgo - */ - for (i=0; i> (i * HI_OPTION_FW_MODE_BITS)) & - HI_OPTION_FW_MODE_MASK; - val_submode = (fwsubmode >> (i * HI_OPTION_FW_SUBMODE_BITS)) & - HI_OPTION_FW_SUBMODE_MASK; - switch (val_mode) { - case HI_OPTION_FW_MODE_IBSS: - if (val_submode != HI_OPTION_FW_SUBMODE_NONE) { - /* set submode to none */ - fwsubmode &= ~(HI_OPTION_FW_SUBMODE_MASK << (i*HI_OPTION_FW_SUBMODE_BITS)); - fwsubmode |= (HI_OPTION_FW_SUBMODE_NONE << (i * HI_OPTION_FW_SUBMODE_BITS)); - } - break; - - case HI_OPTION_FW_MODE_BSS_STA: - if (val_submode == HI_OPTION_FW_SUBMODE_P2PGO) { - /* set submode to none */ - fwsubmode &= ~(HI_OPTION_FW_SUBMODE_MASK << (i*HI_OPTION_FW_SUBMODE_BITS)); - fwsubmode |= (HI_OPTION_FW_SUBMODE_NONE << (i * HI_OPTION_FW_SUBMODE_BITS)); - } - - break; - case HI_OPTION_FW_MODE_AP: - if (val_submode == HI_OPTION_FW_SUBMODE_P2PDEV || - val_submode == HI_OPTION_FW_SUBMODE_P2PCLIENT) { - /* set submode to none */ - fwsubmode &= ~(HI_OPTION_FW_SUBMODE_MASK << (i*HI_OPTION_FW_SUBMODE_BITS)); - fwsubmode |= (HI_OPTION_FW_SUBMODE_NONE << (i * HI_OPTION_FW_SUBMODE_BITS)); - } - break; - - default: - break; - } - } - - return; -} - -#ifdef RK29 -static int -#else -static int __init -#endif -ar6000_init_module(void) -{ -#ifndef RK29 - static int probed = 0; -#endif - A_STATUS status; - OSDRV_CALLBACKS osdrvCallbacks; - - a_module_debug_support_init(); - -#ifdef DEBUG - /* check for debug mask overrides */ - if (debughtc != 0) { - ATH_DEBUG_SET_DEBUG_MASK(htc,debughtc); - } - if (debugbmi != 0) { - ATH_DEBUG_SET_DEBUG_MASK(bmi,debugbmi); - } - if (debughif != 0) { - ATH_DEBUG_SET_DEBUG_MASK(hif,debughif); - } - if (debugdriver != 0) { - ATH_DEBUG_SET_DEBUG_MASK(driver,debugdriver); - } - -#endif - - A_REGISTER_MODULE_DEBUG_INFO(driver); - ar6k_init = FALSE; - A_MEMZERO(&osdrvCallbacks,sizeof(osdrvCallbacks)); - osdrvCallbacks.deviceInsertedHandler = ar6000_avail_ev; - osdrvCallbacks.deviceRemovedHandler = ar6000_unavail_ev; - -#ifdef CONFIG_PM - osdrvCallbacks.deviceSuspendHandler = ar6000_suspend_ev; - osdrvCallbacks.deviceResumeHandler = ar6000_resume_ev; - osdrvCallbacks.devicePowerChangeHandler = ar6000_power_change_ev; -#endif - -#ifndef RK29 - ar6000_pm_init(); -#endif - - if(devmode[0]) - ar6000_parse_dev_mode(devmode); - -#ifdef ANDROID_ENV - android_module_init(&osdrvCallbacks); -#endif - -#ifdef DEBUG - /* Set the debug flags if specified at load time */ - if(debugflags != 0) - { - g_dbg_flags = debugflags; - } -#endif - -#ifndef RK29 - if (probed) { - return -ENODEV; - } - probed++; -#endif - -#ifdef CONFIG_HOST_GPIO_SUPPORT - ar6000_gpio_init(); -#endif /* CONFIG_HOST_GPIO_SUPPORT */ - - status = HIFInit(&osdrvCallbacks); - if(status != A_OK) - return -ENODEV; - - return 0; -} - -#ifdef RK29 -static void -#else -static void __exit -#endif -ar6000_cleanup_module(void) -{ - int i = 0; - struct net_device *ar6000_netdev; - AR_SOFTC_T *ar; - AR_SOFTC_DEV_T *arPriv = NULL; - - if(ar6000_devices[0] != NULL) { - arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(ar6000_devices[0]); - ar = arPriv->arSoftc; - ar6000_cleanup(ar); - } - for (i=0; i < num_device; i++) { -#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL - /* Delete the Adaptive Power Control timer */ - if (timer_pending(&aptcTimer[i])) { - del_timer_sync(&aptcTimer[i]); - } -#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */ - if (ar6000_devices[i] != NULL) { - ar6000_netdev = ar6000_devices[i]; - ar6000_devices[i] = NULL; - ar6000_destroy(ar6000_netdev, 1); - if (arPriv) - A_UNTIMEOUT(&arPriv->arSta.disconnect_timer); - } - } - - HIFShutDownDevice(NULL); - - a_module_debug_support_cleanup(); - -#ifndef RK29 - ar6000_pm_exit(); -#endif - -#ifdef ANDROID_ENV - android_module_exit(); -#endif - a_meminfo_report(TRUE); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("ar6000_cleanup: success\n")); -} - -#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL -void -aptcTimerHandler(unsigned long arg) -{ - A_UINT32 numbytes; - A_UINT32 throughput; - AR_SOFTC_T *ar; - A_STATUS status; - APTC_TRAFFIC_RECORD *aptcTR; - A_UNIT8 i; - - ar = (AR_SOFTC_T *)arg; - A_ASSERT(ar != NULL); - - for(i = 0; i < num_device; i++) { - aptcTR = ar->arDev[i].aptcTR; - A_ASSERT(!timer_pending(&aptcTimer[i])); - AR6000_SPIN_LOCK(&ar->arLock, 0); - - /* Get the number of bytes transferred */ - numbytes = aptcTR->bytesTransmitted + aptcTR->bytesReceived; - aptcTR->bytesTransmitted = aptcTR->bytesReceived = 0; - - /* Calculate and decide based on throughput thresholds */ - throughput = ((numbytes * 8)/APTC_TRAFFIC_SAMPLING_INTERVAL); /* Kbps */ - if (throughput < APTC_LOWER_THROUGHPUT_THRESHOLD) { - /* Enable Sleep and delete the timer */ - A_ASSERT(ar->arWmiReady == TRUE); - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - status = wmi_powermode_cmd(ar->arWmi, REC_POWER); - AR6000_SPIN_LOCK(&ar->arLock, 0); - A_ASSERT(status == A_OK); - aptcTR->timerScheduled = FALSE; - } else { - A_TIMEOUT_MS(&aptcTimer[i], APTC_TRAFFIC_SAMPLING_INTERVAL, 0); - } - - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - } -} -#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */ - -#ifdef ATH_AR6K_11N_SUPPORT -static void -ar6000_alloc_netbufs(A_NETBUF_QUEUE_T *q, A_UINT16 num) -{ - void * osbuf; - - while(num) { - if((osbuf = A_NETBUF_ALLOC(AR6000_BUFFER_SIZE))) { - A_NETBUF_ENQUEUE(q, osbuf); - } else { - break; - } - num--; - } - - if(num) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s(), allocation of netbuf failed", __func__)); - } -} -#endif - -static struct bin_attribute bmi_attr = { - .attr = {.name = "bmi", .mode = 0600}, - .read = ar6000_sysfs_bmi_read, - .write = ar6000_sysfs_bmi_write, -}; - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) -static ssize_t -ar6000_sysfs_bmi_read(struct kobject *kobj, struct bin_attribute *bin_attr, - char *buf, loff_t pos, size_t count) -#else -static ssize_t -ar6000_sysfs_bmi_read(struct file *fp, struct kobject *kobj, - struct bin_attribute *bin_attr, - char *buf, loff_t pos, size_t count) -#endif -{ - int index; - AR_SOFTC_DEV_T *arPriv; - AR_SOFTC_T *ar = NULL; - HIF_DEVICE_OS_DEVICE_INFO *osDevInfo; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("BMI: Read %d bytes\n", count)); - for (index=0; index < num_device; index++) { - arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(ar6000_devices[index]); - ar = arPriv->arSoftc; - osDevInfo = &ar->osDevInfo; - if (kobj == (&(((struct device *)osDevInfo->pOSDevice)->kobj))) { - break; - } - } - - if (ar == NULL) return 0; - if (index == num_device) return 0; - - if ((BMIRawRead(ar->arHifDevice, (A_UCHAR*)buf, count, TRUE)) != A_OK) { - return 0; - } - - return count; -} - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) -static ssize_t -ar6000_sysfs_bmi_write(struct kobject *kobj, struct bin_attribute *bin_attr, - char *buf, loff_t pos, size_t count) -#else -static ssize_t -ar6000_sysfs_bmi_write(struct file *fp, struct kobject *kobj, - struct bin_attribute *bin_attr, - char *buf, loff_t pos, size_t count) -#endif -{ - int index; - AR_SOFTC_DEV_T *arPriv; - AR_SOFTC_T *ar = NULL; - HIF_DEVICE_OS_DEVICE_INFO *osDevInfo; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("BMI: Write %d bytes\n", count)); - for (index=0; index < num_device; index++) { - arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(ar6000_devices[index]); - ar = arPriv->arSoftc; - osDevInfo = &ar->osDevInfo; - if (kobj == (&(((struct device *)osDevInfo->pOSDevice)->kobj))) { - break; - } - } - - if (ar == NULL) return 0; - if (index == num_device) return 0; - - if ((BMIRawWrite(ar->arHifDevice, (A_UCHAR*)buf, count)) != A_OK) { - return 0; - } - - return count; -} - -static A_STATUS -ar6000_sysfs_bmi_init(AR_SOFTC_T *ar) -{ - A_STATUS status; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("BMI: Creating sysfs entry\n")); - A_MEMZERO(&ar->osDevInfo, sizeof(HIF_DEVICE_OS_DEVICE_INFO)); - - /* Get the underlying OS device */ - status = HIFConfigureDevice(ar->arHifDevice, - HIF_DEVICE_GET_OS_DEVICE, - &ar->osDevInfo, - sizeof(HIF_DEVICE_OS_DEVICE_INFO)); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI: Failed to get OS device info from HIF\n")); - return A_ERROR; - } - - /* Create a bmi entry in the sysfs filesystem */ - if ((sysfs_create_bin_file(&(((struct device *)ar->osDevInfo.pOSDevice)->kobj), &bmi_attr)) < 0) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMI: Failed to create entry for bmi in sysfs filesystem\n")); - return A_ERROR; - } - - return A_OK; -} - -static void -ar6000_sysfs_bmi_deinit(AR_SOFTC_T *ar) -{ - if (ar->osDevInfo.pOSDevice) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("BMI: Deleting sysfs entry\n")); - sysfs_remove_bin_file(&(((struct device *)ar->osDevInfo.pOSDevice)->kobj), &bmi_attr); - ar->osDevInfo.pOSDevice = NULL; - } -} - -#define bmifn(fn) do { \ - if ((fn) < A_OK) { \ - A_PRINTF("BMI operation failed: %d\n", __LINE__); \ - return A_ERROR; \ - } \ -} while(0) - -#ifdef INIT_MODE_DRV_ENABLED - -#define MCKINLEY_MAC_ADDRESS_OFFSET 0x16 -static -void calculate_crc(A_UINT32 TargetType, A_UCHAR *eeprom_data, size_t eeprom_size) -{ - A_UINT16 *ptr_crc; - A_UINT16 *ptr16_eeprom; - A_UINT16 checksum; - A_UINT32 i; - - if (TargetType == TARGET_TYPE_AR6001) - { - ptr_crc = (A_UINT16 *)eeprom_data; - } - else if (TargetType == TARGET_TYPE_AR6003) - { - ptr_crc = (A_UINT16 *)((A_UCHAR *)eeprom_data + 0x04); - } - else if (TargetType == TARGET_TYPE_MCKINLEY) - { - eeprom_size = 1024; - ptr_crc = (A_UINT16 *)((A_UCHAR *)eeprom_data + 0x04); - } - else - { - ptr_crc = (A_UINT16 *)((A_UCHAR *)eeprom_data + 0x04); - } - - - // Clear the crc - *ptr_crc = 0; - - // Recalculate new CRC - checksum = 0; - ptr16_eeprom = (A_UINT16 *)eeprom_data; - for (i = 0;i < eeprom_size; i += 2) - { - checksum = checksum ^ (*ptr16_eeprom); - ptr16_eeprom++; - } - checksum = 0xFFFF ^ checksum; - *ptr_crc = checksum; -} - -#ifdef SOFTMAC_FILE_USED -#define AR6002_MAC_ADDRESS_OFFSET 0x0A -#define AR6003_MAC_ADDRESS_OFFSET 0x16 -static void -ar6000_softmac_update(AR_SOFTC_T *ar, A_UCHAR *eeprom_data, size_t eeprom_size) -{ - /* We need to store the MAC, which comes either from the softmac file or is - * randomly generated, because we do not want to load a new MAC address - * if the chip goes into suspend and then is resumed later on. We ONLY - * want to load a new MAC if the driver is unloaded and then reloaded - */ - static A_UCHAR random_mac[6]; - const char *source = "random generated"; - const struct firmware *softmac_entry; - A_UCHAR *ptr_mac; - switch (ar->arTargetType) { - case TARGET_TYPE_AR6002: - ptr_mac = (A_UINT8 *)((A_UCHAR *)eeprom_data + AR6002_MAC_ADDRESS_OFFSET); - break; - case TARGET_TYPE_AR6003: - ptr_mac = (A_UINT8 *)((A_UCHAR *)eeprom_data + AR6003_MAC_ADDRESS_OFFSET); - break; - case TARGET_TYPE_MCKINLEY: - ptr_mac = (A_UINT8 *)((A_UCHAR *)eeprom_data + MCKINLEY_MAC_ADDRESS_OFFSET); - break; - default: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Invalid Target Type \n")); - return; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, - ("MAC from EEPROM %02X:%02X:%02X:%02X:%02X:%02X\n", - ptr_mac[0], ptr_mac[1], ptr_mac[2], - ptr_mac[3], ptr_mac[4], ptr_mac[5])); - - if (memcmp(random_mac, "\0\0\0\0\0\0", 6)!=0) { - memcpy(ptr_mac, random_mac, 6); - } else { - /* create a random MAC in case we cannot read file from system */ - ptr_mac[0] = random_mac[0] = 2; /* locally administered */ - ptr_mac[1] = random_mac[1] = 0x03; - ptr_mac[2] = random_mac[2] = 0x7F; - ptr_mac[3] = random_mac[3] = random32() & 0xff; - ptr_mac[4] = random_mac[4] = random32() & 0xff; - ptr_mac[5] = random_mac[5] = random32() & 0xff; - } - - if ((A_REQUEST_FIRMWARE(&softmac_entry, "softmac", ((struct device *)ar->osDevInfo.pOSDevice))) == 0) - { - A_CHAR *macbuf = A_MALLOC_NOWAIT(softmac_entry->size+1); - if (macbuf) { - unsigned int softmac[6]; - memcpy(macbuf, softmac_entry->data, softmac_entry->size); - macbuf[softmac_entry->size] = '\0'; - if (sscanf(macbuf, "%02x:%02x:%02x:%02x:%02x:%02x", - &softmac[0], &softmac[1], &softmac[2], - &softmac[3], &softmac[4], &softmac[5])==6) { - int i; - -#ifdef TCHIP - if(IS_MAC_NULL(softmac)) { - softmac[0]= 0x20; - softmac[1]= 0x59; - softmac[2]= 0xa0; - softmac[3]= (random32() & 0x0f) + 0x30; - softmac[4]= random32() & 0xff; - softmac[5]= random32() & 0xff; - - //write to the file. - sprintf(macbuf, - "%02x:%02x:%02x:%02x:%02x:%02x", - softmac[0], softmac[1], softmac[2], - softmac[3], softmac[4], softmac[5]); - { - extern void android_wifi_softmac_update(char *mac_buff, int len); - android_wifi_softmac_update(macbuf, softmac_entry->size); - } - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("MAC random %02X:%02X:%02X:%02X:%02X:%02X\n", - softmac[0], softmac[1], softmac[2], - softmac[3], softmac[4], softmac[5])); - - } -#endif - - for (i=0; i<6; ++i) { - ptr_mac[i] = softmac[i] & 0xff; - } - source = "softmac file"; - A_MEMZERO(random_mac, sizeof(random_mac)); - } - A_FREE(macbuf); - } - A_RELEASE_FIRMWARE(softmac_entry); - } - - if (memcmp(random_mac, "\0\0\0\0\0\0", 6)!=0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Warning! Random MAC address is just for testing purpose\n")); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, - ("MAC from %s %02X:%02X:%02X:%02X:%02X:%02X\n", source, - ptr_mac[0], ptr_mac[1], ptr_mac[2], - ptr_mac[3], ptr_mac[4], ptr_mac[5])); - calculate_crc(ar->arTargetType, eeprom_data, eeprom_size); -} -#endif /* SOFTMAC_FILE_USED */ - -static void -ar6000_reg_update(AR_SOFTC_T *ar, A_UCHAR *eeprom_data, size_t eeprom_size, int regCode) -{ - A_UCHAR *ptr_reg; - switch (ar->arTargetType) { - case TARGET_TYPE_AR6002: - ptr_reg = (A_UINT8 *)((A_UCHAR *)eeprom_data + 8); - break; - case TARGET_TYPE_AR6003: - ptr_reg = (A_UINT8 *)((A_UCHAR *)eeprom_data + 12); - break; - default: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Invalid Target Type \n")); - return; - } - - ptr_reg[0] = (A_UCHAR)(regCode&0xFF); - ptr_reg[1] = (A_UCHAR)((regCode>>8)&0xFF); - calculate_crc(ar->arTargetType, eeprom_data, eeprom_size); -} - -static A_STATUS -ar6000_transfer_bin_file(AR_SOFTC_T *ar, AR6K_BIN_FILE file, A_UINT32 address, A_BOOL compressed) -{ - A_STATUS status; - const char *filename; - const struct firmware *fw_entry; - A_UINT32 fw_entry_size; - A_UCHAR *tempEeprom; - A_UINT32 board_data_size; - - switch (file) { - case AR6K_OTP_FILE: - if (ar->arVersion.target_ver == AR6003_REV2_VERSION) { - filename = AR6003_REV2_OTP_FILE; - } else if (ar->arVersion.target_ver == AR6003_REV3_VERSION) { - filename = AR6003_REV3_OTP_FILE; - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unknown firmware revision: %d\n", ar->arVersion.target_ver)); - return A_ERROR; - } - break; - - case AR6K_FIRMWARE_FILE: - if (ar->arVersion.target_ver == AR6003_REV2_VERSION) { - filename = AR6003_REV2_FIRMWARE_FILE; - } else if (ar->arVersion.target_ver == AR6003_REV3_VERSION) { - if(ar->arVersion.targetconf_ver == AR6003_SUBVER_ROUTER) - filename = AR6003_REV3_ROUTER_FIRMWARE_FILE; - else if (ar->arVersion.targetconf_ver == AR6003_SUBVER_MOBILE) - filename = AR6003_REV3_MOBILE_FIRMWARE_FILE; - else if (ar->arVersion.targetconf_ver == AR6003_SUBVER_TABLET) - filename = AR6003_REV3_TABLET_FIRMWARE_FILE; - else - filename = AR6003_REV3_DEFAULT_FIRMWARE_FILE; - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unknown firmware revision: %d\n", ar->arVersion.target_ver)); - return A_ERROR; - } - - if (eppingtest) { - bypasswmi = TRUE; - if (ar->arVersion.target_ver == AR6003_REV2_VERSION) { - filename = AR6003_REV2_EPPING_FIRMWARE_FILE; - } else if (ar->arVersion.target_ver == AR6003_REV3_VERSION) { - filename = AR6003_REV3_EPPING_FIRMWARE_FILE; - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("eppingtest : unsupported firmware revision: %d\n", - ar->arVersion.target_ver)); - return A_ERROR; - } - compressed = 0; - } - -#ifdef CONFIG_HOST_TCMD_SUPPORT - if(testmode == 1) { - if (ar->arVersion.target_ver == AR6003_REV2_VERSION) { - filename = AR6003_REV2_TCMD_FIRMWARE_FILE; - } else if (ar->arVersion.target_ver == AR6003_REV3_VERSION) { - filename = AR6003_REV3_TCMD_FIRMWARE_FILE; - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unknown firmware revision: %d\n", ar->arVersion.target_ver)); - return A_ERROR; - } - compressed = 0; - } -#endif -#ifdef HTC_RAW_INTERFACE - if (!eppingtest && bypasswmi) { - if (ar->arVersion.target_ver == AR6003_REV2_VERSION) { - filename = AR6003_REV2_ART_FIRMWARE_FILE; - } else if (ar->arVersion.target_ver == AR6003_REV3_VERSION) { - filename = AR6003_REV3_ART_FIRMWARE_FILE; - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unknown firmware revision: %d\n", ar->arVersion.target_ver)); - return A_ERROR; - } - compressed = 0; - } -#endif - break; - - case AR6K_PATCH_FILE: - if (ar->arVersion.target_ver == AR6003_REV2_VERSION) { - filename = AR6003_REV2_PATCH_FILE; - } else if (ar->arVersion.target_ver == AR6003_REV3_VERSION) { - filename = AR6003_REV3_PATCH_FILE; - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unknown firmware revision: %d\n", ar->arVersion.target_ver)); - return A_ERROR; - } - break; - - case AR6K_BOARD_DATA_FILE: - if (ar->arVersion.target_ver == AR6003_REV2_VERSION) { - filename = AR6003_REV2_BOARD_DATA_FILE; - } else if (ar->arVersion.target_ver == AR6003_REV3_VERSION) { - filename = AR6003_REV3_BOARD_DATA_FILE; - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unknown firmware revision: %d\n", ar->arVersion.target_ver)); - return A_ERROR; - } - break; - - default: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unknown file type: %d\n", file)); - return A_ERROR; - } - if ((A_REQUEST_FIRMWARE(&fw_entry, filename, ((struct device *)ar->osDevInfo.pOSDevice))) != 0) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to get %s\n", filename)); - return A_ENOENT; - } - - fw_entry_size = fw_entry->size; - tempEeprom = NULL; - - /* Load extended board data for AR6003 */ - if ((file==AR6K_BOARD_DATA_FILE) && (fw_entry->data)) { - A_UINT32 board_ext_address; - A_INT32 board_ext_data_size; - - tempEeprom = A_MALLOC_NOWAIT(fw_entry->size); - if (!tempEeprom) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Memory allocation failed\n")); - A_RELEASE_FIRMWARE(fw_entry); - return A_ERROR; - } - - board_data_size = (((ar)->arTargetType == TARGET_TYPE_AR6002) ? AR6002_BOARD_DATA_SZ : \ - (((ar)->arTargetType == TARGET_TYPE_AR6003) ? AR6003_BOARD_DATA_SZ : 0)); - - board_ext_data_size = 0; - if (ar->arTargetType == TARGET_TYPE_AR6002) { - board_ext_data_size = AR6002_BOARD_EXT_DATA_SZ; - } else if (ar->arTargetType == TARGET_TYPE_AR6003) { - if (ar->arVersion.target_ver == AR6003_REV2_VERSION) { - board_ext_data_size = AR6003_VER2_BOARD_EXT_DATA_SZ; - } else { - board_ext_data_size = AR6003_BOARD_EXT_DATA_SZ; - } - } - - /* AR6003 2.1.1 support 1792 bytes and 2048 bytes board file */ - if ((board_ext_data_size) && - (fw_entry->size < (board_data_size + board_ext_data_size))) - { - board_ext_data_size = fw_entry->size - board_data_size; - if (board_ext_data_size < 0) { - board_ext_data_size = 0; - } - } - - A_MEMCPY(tempEeprom, (A_UCHAR *)fw_entry->data, fw_entry->size); - -#ifdef SOFTMAC_FILE_USED - ar6000_softmac_update(ar, tempEeprom, board_data_size); -#endif - if (regcode!=0) { - ar6000_reg_update(ar, tempEeprom, board_data_size, regcode); - } - - /* Determine where in Target RAM to write Board Data */ - bmifn(BMIReadMemory(ar->arHifDevice, HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_board_ext_data), (A_UCHAR *)&board_ext_address, 4)); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("Board extended Data download address: 0x%x\n", board_ext_address)); - - /* check whether the target has allocated memory for extended board data and file contains extended board data */ - if ((board_ext_address) && (fw_entry->size == (board_data_size + board_ext_data_size))) { - A_UINT32 param; - - status = BMIWriteMemory(ar->arHifDevice, board_ext_address, (A_UCHAR *)(((A_UINT32)tempEeprom) + board_data_size), board_ext_data_size); - - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI operation failed: %d\n", __LINE__)); - A_RELEASE_FIRMWARE(fw_entry); - return A_ERROR; - } - - /* Record the fact that extended board Data IS initialized */ - param = (board_ext_data_size << 16) | 1; - bmifn(BMIWriteMemory(ar->arHifDevice, HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_board_ext_data_config), (A_UCHAR *)¶m, 4)); - } - fw_entry_size = board_data_size; - } - - if (compressed) { - status = BMIFastDownload(ar->arHifDevice, address, (A_UCHAR *)fw_entry->data, fw_entry_size); - } else { - if (file==AR6K_BOARD_DATA_FILE && fw_entry->data) - { - status = BMIWriteMemory(ar->arHifDevice, address, (A_UCHAR *)tempEeprom, fw_entry_size); - } - else - { - status = BMIWriteMemory(ar->arHifDevice, address, (A_UCHAR *)fw_entry->data, fw_entry_size); - } - } - - if (tempEeprom) { - A_FREE(tempEeprom); - } - - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI operation failed: %d\n", __LINE__)); - A_RELEASE_FIRMWARE(fw_entry); - return A_ERROR; - } - A_RELEASE_FIRMWARE(fw_entry); - return A_OK; -} -#endif /* INIT_MODE_DRV_ENABLED */ - -A_STATUS -ar6000_update_bdaddr(AR_SOFTC_T *ar) -{ - - if (setupbtdev != 0) { - A_UINT32 address; - - if (BMIReadMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_board_data), (A_UCHAR *)&address, 4) != A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIReadMemory for hi_board_data failed\n")); - return A_ERROR; - } - - if (BMIReadMemory(ar->arHifDevice, address + BDATA_BDADDR_OFFSET, (A_UCHAR *)ar->bdaddr, 6) != A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIReadMemory for BD address failed\n")); - return A_ERROR; - } - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BDADDR 0x%x:0x%x:0x%x:0x%x:0x%x:0x%x\n", ar->bdaddr[0], - ar->bdaddr[1], ar->bdaddr[2], ar->bdaddr[3], - ar->bdaddr[4], ar->bdaddr[5])); - } - -return A_OK; -} - -A_STATUS -ar6000_sysfs_bmi_get_config(AR_SOFTC_T *ar, A_UINT32 mode) -{ -#if defined(INIT_MODE_DRV_ENABLED) && defined(CONFIG_HOST_TCMD_SUPPORT) - const char *filename; - const struct firmware *fw_entry; -#endif - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("BMI: Requesting device specific configuration\n")); - - if (mode == WLAN_INIT_MODE_UDEV) { - A_CHAR version[16]; - const struct firmware *fw_entry; - - /* Get config using udev through a script in user space */ - sprintf(version, "%2.2x", ar->arVersion.target_ver); - if ((A_REQUEST_FIRMWARE(&fw_entry, version, ((struct device *)ar->osDevInfo.pOSDevice))) != 0) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI: Failure to get configuration for target version: %s\n", version)); - return A_ERROR; - } - - A_RELEASE_FIRMWARE(fw_entry); -#ifdef INIT_MODE_DRV_ENABLED - } else { - /* The config is contained within the driver itself */ - A_STATUS status; - A_UINT32 param, options, sleep, address; - - /* Temporarily disable system sleep */ - address = MBOX_BASE_ADDRESS + LOCAL_SCRATCH_OFFSET; - bmifn(BMIReadSOCRegister(ar->arHifDevice, address, ¶m)); - options = param; - param |= AR6K_OPTION_SLEEP_DISABLE; - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, param)); - - address = RTC_WMAC_BASE_ADDRESS + WLAN_SYSTEM_SLEEP_OFFSET; - bmifn(BMIReadSOCRegister(ar->arHifDevice, address, ¶m)); - sleep = param; - param |= WLAN_SYSTEM_SLEEP_DISABLE_SET(1); - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, param)); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("old options: %d, old sleep: %d\n", options, sleep)); - - if (ar->arTargetType == TARGET_TYPE_MCKINLEY) { - /* Run at 40/44MHz by default */ - param = CPU_CLOCK_STANDARD_SET(0); - } else if (ar->arTargetType == TARGET_TYPE_AR6003) { - /* Program analog PLL register */ - bmifn(BMIWriteSOCRegister(ar->arHifDevice, ANALOG_INTF_BASE_ADDRESS + 0x284, 0xF9104001)); - /* Run at 80/88MHz by default */ - param = CPU_CLOCK_STANDARD_SET(1); - } else { - /* Run at 40/44MHz by default */ - param = CPU_CLOCK_STANDARD_SET(0); - } - address = RTC_SOC_BASE_ADDRESS + CPU_CLOCK_OFFSET; - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, param)); - - param = 0; - if (ar->arTargetType == TARGET_TYPE_AR6002) { - bmifn(BMIReadMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_ext_clk_detected), - (A_UCHAR *)¶m, 4)); - } - - /* LPO_CAL.ENABLE = 1 if no external clk is detected */ - if (param != 1) { - address = RTC_SOC_BASE_ADDRESS + LPO_CAL_OFFSET; - param = LPO_CAL_ENABLE_SET(1); - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, param)); - } - - /* Venus2.0: Lower SDIO pad drive strength */ - if ((ar->arVersion.target_ver == AR6003_REV2_VERSION) || - (ar->arVersion.target_ver == AR6003_REV3_VERSION)) - { - param = 0x20; - address = GPIO_BASE_ADDRESS + GPIO_PIN10_OFFSET; - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, param)); - - address = GPIO_BASE_ADDRESS + GPIO_PIN11_OFFSET; - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, param)); - - address = GPIO_BASE_ADDRESS + GPIO_PIN12_OFFSET; - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, param)); - - address = GPIO_BASE_ADDRESS + GPIO_PIN13_OFFSET; - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, param)); - } - -#ifdef FORCE_INTERNAL_CLOCK - /* Ignore external clock, if any, and force use of internal clock */ - if (ar->arTargetType == TARGET_TYPE_AR6003 || ar->arTargetType == TARGET_TYPE_MCKINLEY) { - /* hi_ext_clk_detected = 0 */ - param = 0; - bmifn(BMIWriteMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_ext_clk_detected), - (A_UCHAR *)¶m, 4)); - - /* CLOCK_CONTROL &= ~LF_CLK32 */ - address = RTC_BASE_ADDRESS + CLOCK_CONTROL_ADDRESS; - bmifn(BMIReadSOCRegister(ar->arHifDevice, address, ¶m)); - param &= (~CLOCK_CONTROL_LF_CLK32_SET(1)); - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, param)); - } -#endif /* FORCE_INTERNAL_CLOCK */ - - /* Transfer Board Data from Target EEPROM to Target RAM */ - if (ar->arTargetType == TARGET_TYPE_AR6003 || ar->arTargetType == TARGET_TYPE_MCKINLEY) { - /* Determine where in Target RAM to write Board Data */ - bmifn(BMIReadMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_board_data), - (A_UCHAR *)&address, 4)); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("Board Data download address: 0x%x\n", address)); - - /* Write EEPROM data to Target RAM */ - if ((status=ar6000_transfer_bin_file(ar, AR6K_BOARD_DATA_FILE, address, FALSE)) != A_OK) { - return A_ERROR; - } - - /* Record the fact that Board Data IS initialized */ - param = 1; - bmifn(BMIWriteMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_board_data_initialized), - (A_UCHAR *)¶m, 4)); - - /* Transfer One time Programmable data */ - AR6K_APP_LOAD_ADDRESS(address, ar->arVersion.target_ver); - if (ar->arVersion.target_ver == AR6003_REV3_VERSION) { - address = BMI_SEGMENTED_WRITE_ADDR; - } - status = ar6000_transfer_bin_file(ar, AR6K_OTP_FILE, address, TRUE); - if (status == A_OK) { - /* Execute the OTP code */ -#ifdef SOFTMAC_FILE_USED - param = 1; -#else - param = 0; -#endif - if (regcode != 0) - param |= 0x2; - AR6K_APP_START_OVERRIDE_ADDRESS(address, ar->arVersion.target_ver); - bmifn(BMIExecute(ar->arHifDevice, address, ¶m)); - } else if (status != A_ENOENT) { - return A_ERROR; - } - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Programming of board data for chip %d not supported\n", ar->arTargetType)); - return A_ERROR; - } - - /* Download Target firmware */ - AR6K_APP_LOAD_ADDRESS(address, ar->arVersion.target_ver); - if (ar->arVersion.target_ver == AR6003_REV3_VERSION) { - address = BMI_SEGMENTED_WRITE_ADDR; - } - if ((ar6000_transfer_bin_file(ar, AR6K_FIRMWARE_FILE, address, TRUE)) != A_OK) { - return A_ERROR; - } - - if (ar->arVersion.target_ver == AR6003_REV2_VERSION) - { - /* Set starting address for firmware */ - AR6K_APP_START_OVERRIDE_ADDRESS(address, ar->arVersion.target_ver); - bmifn(BMISetAppStart(ar->arHifDevice, address)); - } - - /* Apply the patches */ - if (ar->arTargetType == TARGET_TYPE_AR6003) { - AR6K_DATASET_PATCH_ADDRESS(address, ar->arVersion.target_ver); - if ((ar6000_transfer_bin_file(ar, AR6K_PATCH_FILE, address, FALSE)) != A_OK) { - return A_ERROR; - } - param = address; - bmifn(BMIWriteMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_dset_list_head), - (A_UCHAR *)¶m, 4)); - } - - /* Restore system sleep */ - address = RTC_WMAC_BASE_ADDRESS + WLAN_SYSTEM_SLEEP_OFFSET; - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, sleep)); - - address = MBOX_BASE_ADDRESS + LOCAL_SCRATCH_OFFSET; - param = options | 0x20; - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, param)); - - if (ar->arTargetType == TARGET_TYPE_AR6003 || ar->arTargetType == TARGET_TYPE_MCKINLEY) { - /* Configure GPIO AR6003 UART */ -#ifndef CONFIG_AR600x_DEBUG_UART_TX_PIN -#define CONFIG_AR600x_DEBUG_UART_TX_PIN 8 -#endif - param = CONFIG_AR600x_DEBUG_UART_TX_PIN; - bmifn(BMIWriteMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_dbg_uart_txpin), - (A_UCHAR *)¶m, 4)); - -#if (CONFIG_AR600x_DEBUG_UART_TX_PIN == 23) - if (ATH_REGISTER_SUPPORTED_BY_TARGET(CLOCK_GPIO_OFFSET)) { - address = GPIO_BASE_ADDRESS + CLOCK_GPIO_OFFSET; - bmifn(BMIReadSOCRegister(ar->arHifDevice, address, ¶m)); - param |= CLOCK_GPIO_BT_CLK_OUT_EN_SET(1); - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, param)); - } else { - /* AR6004 has no need for a CLOCK_GPIO register */ - } -#endif - - /* Configure GPIO for BT Reset */ -#ifdef ATH6KL_CONFIG_GPIO_BT_RESET -#define CONFIG_AR600x_BT_RESET_PIN 0x16 - param = CONFIG_AR600x_BT_RESET_PIN; - bmifn(BMIWriteMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_hci_uart_support_pins), - (A_UCHAR *)¶m, 4)); -#endif /* ATH6KL_CONFIG_GPIO_BT_RESET */ - - /* Configure UART flow control polarity */ -#ifndef CONFIG_ATH6KL_BT_UART_FC_POLARITY -#define CONFIG_ATH6KL_BT_UART_FC_POLARITY 0 -#endif - -#if (CONFIG_ATH6KL_BT_UART_FC_POLARITY == 1) - if ((ar->arVersion.target_ver == AR6003_REV2_VERSION) || - (ar->arVersion.target_ver == AR6003_REV3_VERSION)) - { - param = ((CONFIG_ATH6KL_BT_UART_FC_POLARITY << 1) & 0x2); - bmifn(BMIWriteMemory(ar->arHifDevice, HOST_INTEREST_ITEM_ADDRESS(ar, hi_hci_uart_pwr_mgmt_params), (A_UCHAR *)¶m, 4)); - } -#endif /* CONFIG_ATH6KL_BT_UART_FC_POLARITY */ - } -#ifdef HTC_RAW_INTERFACE - if (!eppingtest && bypasswmi) { - /* Don't run BMIDone for ART mode and force resetok=0 */ - resetok = 0; - msleep(1000); - param = 1; - status = BMIWriteMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_board_data_initialized), - (A_UCHAR *)¶m, 4); - } -#endif /* HTC_RAW_INTERFACE */ - -#ifdef CONFIG_HOST_TCMD_SUPPORT - if (testmode == 2) { - if (ar->arVersion.target_ver == AR6003_REV2_VERSION) { - filename = AR6003_REV2_UTF_FIRMWARE_FILE; - if ((A_REQUEST_FIRMWARE(&fw_entry, filename, ((struct device *)ar->osDevInfo.pOSDevice))) != 0) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to get %s\n", filename)); - return A_ENOENT; - } - /* Download Target firmware */ - AR6K_APP_LOAD_ADDRESS(address, ar->arVersion.target_ver); - status = BMIWriteMemory(ar->arHifDevice, address, (A_UCHAR *)fw_entry->data, fw_entry->size); - - address = HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_end_RAM_reserve_sz); - param = 11008; - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, param)); - - address = 0x57D884; - filename = AR6003_REV2_TESTSCRIPT_FILE; - if ((A_REQUEST_FIRMWARE(&fw_entry, filename, ((struct device *)ar->osDevInfo.pOSDevice))) != 0) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to get %s\n", filename)); - return A_ENOENT; - } - status = BMIWriteMemory(ar->arHifDevice, address, (A_UCHAR *)fw_entry->data, fw_entry->size); - - param = 0x57D884; - address = HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_ota_testscript); - bmifn(BMIWriteMemory(ar->arHifDevice, address, (A_UCHAR *)¶m, 4)); - - address = HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_test_apps_related); - bmifn(BMIReadSOCRegister(ar->arHifDevice, address, ¶m)); - param |= 1; - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, param)); - - A_RELEASE_FIRMWARE(fw_entry); - } - else if (ar->arVersion.target_ver == AR6003_REV3_VERSION) { - filename = AR6003_REV3_UTF_FIRMWARE_FILE; - if ((A_REQUEST_FIRMWARE(&fw_entry, filename, ((struct device *)ar->osDevInfo.pOSDevice))) != 0) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to get %s\n", filename)); - return A_ENOENT; - } - /* Download Target firmware */ - address = BMI_SEGMENTED_WRITE_ADDR; - status = BMIWriteMemory(ar->arHifDevice, address, (A_UCHAR *)fw_entry->data, fw_entry->size); - - address = HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_end_RAM_reserve_sz); - param = 4096; - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, param)); - - address = 0x57EF74; - filename = AR6003_REV3_TESTSCRIPT_FILE; - if ((A_REQUEST_FIRMWARE(&fw_entry, filename, ((struct device *)ar->osDevInfo.pOSDevice))) != 0) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to get %s\n", filename)); - return A_ENOENT; - } - status = BMIWriteMemory(ar->arHifDevice, address, (A_UCHAR *)fw_entry->data, fw_entry->size); - - param = 0x57EF74; - address = HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_ota_testscript); - bmifn(BMIWriteMemory(ar->arHifDevice, address, (A_UCHAR *)¶m, 4)); - - address = HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_test_apps_related); - bmifn(BMIReadSOCRegister(ar->arHifDevice, address, ¶m)); - param |= 1; - bmifn(BMIWriteSOCRegister(ar->arHifDevice, address, param)); - - A_RELEASE_FIRMWARE(fw_entry); - } - } -#endif -#endif /* INIT_MODE_DRV_ENABLED */ - } - - return A_OK; -} - -A_STATUS -ar6000_configure_target(AR_SOFTC_T *ar) -{ - A_UINT32 param; - if (enableuartprint) { - param = 1; - if (BMIWriteMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_serial_enable), - (A_UCHAR *)¶m, - 4)!= A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIWriteMemory for enableuartprint failed \n")); - return A_ERROR; - } - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Serial console prints enabled\n")); - } - - /* Tell target which HTC version it is used*/ - param = HTC_PROTOCOL_VERSION; - if (BMIWriteMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_app_host_interest), - (A_UCHAR *)¶m, - 4)!= A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIWriteMemory for htc version failed \n")); - return A_ERROR; - } - - if (enabletimerwar) { - A_UINT32 param; - - if (BMIReadMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_option_flag), - (A_UCHAR *)¶m, - 4)!= A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIReadMemory for enabletimerwar failed \n")); - return A_ERROR; - } - - param |= HI_OPTION_TIMER_WAR; - - if (BMIWriteMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_option_flag), - (A_UCHAR *)¶m, - 4) != A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIWriteMemory for enabletimerwar failed \n")); - return A_ERROR; - } - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Timer WAR enabled\n")); - } - - /* set the firmware mode to STA/IBSS/AP */ - { - A_UINT32 param; - - if (BMIReadMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_option_flag), - (A_UCHAR *)¶m, - 4)!= A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIReadMemory for setting fwmode failed \n")); - return A_ERROR; - } - - param |= (num_device << HI_OPTION_NUM_DEV_SHIFT); - param |= (fwmode << HI_OPTION_FW_MODE_SHIFT); - param |= (mac_addr_method << HI_OPTION_MAC_ADDR_METHOD_SHIFT); - param |= (firmware_bridge << HI_OPTION_FW_BRIDGE_SHIFT); - param |= (fwsubmode << HI_OPTION_FW_SUBMODE_SHIFT); - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("NUM_DEV=%d FWMODE=0x%x FWSUBMODE=0x%x FWBR_BUF %d\n", - num_device, fwmode, fwsubmode, firmware_bridge)); - - if (BMIWriteMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_option_flag), - (A_UCHAR *)¶m, - 4) != A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIWriteMemory for setting fwmode failed \n")); - return A_ERROR; - } - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Firmware mode set\n")); - } -#ifdef ATH6KL_DISABLE_TARGET_DBGLOGS - { - A_UINT32 param; - - if (BMIReadMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_option_flag), - (A_UCHAR *)¶m, - 4)!= A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIReadMemory for disabling debug logs failed\n")); - return A_ERROR; - } - - param |= HI_OPTION_DISABLE_DBGLOG; - - if (BMIWriteMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_option_flag), - (A_UCHAR *)¶m, - 4) != A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIWriteMemory for HI_OPTION_DISABLE_DBGLOG\n")); - return A_ERROR; - } - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Firmware mode set\n")); - } -#endif /* ATH6KL_DISABLE_TARGET_DBGLOGS */ - - if (regscanmode) { - A_UINT32 param; - - if (BMIReadMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_option_flag), - (A_UCHAR *)¶m, - 4)!= A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIReadMemory for setting regscanmode failed\n")); - return A_ERROR; - } - - if (regscanmode == 1) { - param |= HI_OPTION_SKIP_REG_SCAN; - } else if (regscanmode == 2) { - param |= HI_OPTION_INIT_REG_SCAN; - } - - if (BMIWriteMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_option_flag), - (A_UCHAR *)¶m, - 4) != A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIWriteMemory for setting regscanmode failed\n")); - return A_ERROR; - } - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Regulatory scan mode set\n")); - } - - /* - * Hardcode the address use for the extended board data - * Ideally this should be pre-allocate by the OS at boot time - * But since it is a new feature and board data is loaded - * at init time, we have to workaround this from host. - * It is difficult to patch the firmware boot code, - * but possible in theory. - */ - if (ar->arTargetType == TARGET_TYPE_AR6003) { - A_UINT32 ramReservedSz; - if (ar->arVersion.target_ver == AR6003_REV2_VERSION) { - param = AR6003_REV2_BOARD_EXT_DATA_ADDRESS; - ramReservedSz = AR6003_REV2_RAM_RESERVE_SIZE; - } else { - param = AR6003_REV3_BOARD_EXT_DATA_ADDRESS; - ramReservedSz = AR6003_REV3_RAM_RESERVE_SIZE; - } - if (BMIWriteMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_board_ext_data), - (A_UCHAR *)¶m, - 4) != A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIWriteMemory for hi_board_ext_data failed \n")); - return A_ERROR; - } - if (BMIWriteMemory(ar->arHifDevice, - HOST_INTEREST_ITEM_ADDRESS(ar->arTargetType, hi_end_RAM_reserve_sz), - (A_UCHAR *)&ramReservedSz, 4) != A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMIWriteMemory for hi_end_RAM_reserve_sz failed \n")); - return A_ERROR; - } - } - - - /* since BMIInit is called in the driver layer, we have to set the block - * size here for the target */ - - if (A_FAILED(ar6000_set_htc_params(ar->arHifDevice, - ar->arTargetType, - mbox_yield_limit, - 0 /* use default number of control buffers */ - ))) { - return A_ERROR; - } - - if (setupbtdev != 0) { - if (A_FAILED(ar6000_set_hci_bridge_flags(ar->arHifDevice, - ar->arTargetType, - setupbtdev))) { - return A_ERROR; - } - } - - return A_OK; -} - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) -static void ar6000_ethtool_get_drvinfo(struct net_device *dev, - struct ethtool_drvinfo *info) -{ - A_STATUS status; - HIF_DEVICE_OS_DEVICE_INFO osDevInfo; - AR_SOFTC_T *ar; - AR_SOFTC_DEV_T *arPriv; - struct ar6000_version *revinfo; - if((dev == NULL) || ((arPriv = ar6k_priv(dev)) == NULL)) { - return; - } - ar = arPriv->arSoftc; - revinfo = &ar->arVersion; - strcpy(info->driver, "AR6000"); - snprintf(info->version, sizeof(info->version), "%u.%u.%u.%u", - ((revinfo->host_ver)&0xf0000000)>>28, - ((revinfo->host_ver)&0x0f000000)>>24, - ((revinfo->host_ver)&0x00ff0000)>>16, - ((revinfo->host_ver)&0x0000ffff)); - snprintf(info->fw_version, sizeof(info->fw_version), "%u.%u.%u.%u", - ((revinfo->wlan_ver)&0xf0000000)>>28, - ((revinfo->wlan_ver)&0x0f000000)>>24, - ((revinfo->wlan_ver)&0x00ff0000)>>16, - ((revinfo->wlan_ver)&0x0000ffff)); - - status = HIFConfigureDevice(ar->arHifDevice, - HIF_DEVICE_GET_OS_DEVICE, - &osDevInfo, - sizeof(HIF_DEVICE_OS_DEVICE_INFO)); - if (A_SUCCESS(status) && osDevInfo.pOSDevice) { - struct device *dev = (struct device*)osDevInfo.pOSDevice; - if (dev->bus && dev->bus->name) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) - const char *dinfo = dev_name(dev); -#else - const char *dinfo = kobject_name(&dev->kobj); -#endif - snprintf(info->bus_info, sizeof(info->bus_info), dinfo); - } - } -} - -static u32 ar6000_ethtool_get_link(struct net_device *dev) -{ - AR_SOFTC_DEV_T *arPriv; - return ((arPriv = ar6k_priv(dev))!=NULL) ? arPriv->arConnected : 0; -} - -#ifdef CONFIG_CHECKSUM_OFFLOAD -static u32 ar6000_ethtool_get_rx_csum(struct net_device *dev) -{ - AR_SOFTC_DEV_T *arPriv; - if((dev == NULL) || ((arPriv = ar6k_priv(dev)) == NULL)) { - return 0; - } - return (arPriv->arSoftc->rxMetaVersion==WMI_META_VERSION_2); -} - -static int ar6000_ethtool_set_rx_csum(struct net_device *dev, u32 enable) -{ - AR_SOFTC_T *ar; - AR_SOFTC_DEV_T *arPriv; - A_UINT8 metaVersion; - if((dev == NULL) || ((arPriv = ar6k_priv(dev)) == NULL)) { - return -EIO; - } - ar = arPriv->arSoftc; - if (ar->arWmiReady == FALSE || ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - metaVersion = (enable) ? WMI_META_VERSION_2 : 0; - if ((wmi_set_rx_frame_format_cmd(arPriv->arWmi, metaVersion, processDot11Hdr, processDot11Hdr)) != A_OK) { - return -EFAULT; - } - ar->rxMetaVersion = metaVersion; - return 0; -} - -static u32 ar6000_ethtool_get_tx_csum(struct net_device *dev) -{ - return csumOffload; -} - -static int ar6000_ethtool_set_tx_csum(struct net_device *dev, u32 enable) -{ - csumOffload = enable; - if(enable){ - dev->features |= NETIF_F_IP_CSUM; - } else { - dev->features &= ~NETIF_F_IP_CSUM; - } - return 0; -} -#endif /* CONFIG_CHECKSUM_OFFLOAD */ - -static const struct ethtool_ops ar6000_ethtool_ops = { - .get_drvinfo = ar6000_ethtool_get_drvinfo, - .get_link = ar6000_ethtool_get_link, -#ifdef CONFIG_CHECKSUM_OFFLOAD - .get_rx_csum = ar6000_ethtool_get_rx_csum, - .set_rx_csum = ar6000_ethtool_set_rx_csum, - .get_tx_csum = ar6000_ethtool_get_tx_csum, - .set_tx_csum = ar6000_ethtool_set_tx_csum, -#endif /* CONFIG_CHECKSUM_OFFLOAD */ -}; -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) */ - -/* - * HTC Event handlers - */ -static A_STATUS -ar6000_avail_ev(void *context, void *hif_handle) -{ - int i; - struct net_device *dev; - void *ar_netif; - AR_SOFTC_T *ar=NULL; - AR_SOFTC_DEV_T *arPriv; - int device_index = 0; - HTC_INIT_INFO htcInfo; -#ifdef ATH6K_CONFIG_CFG80211 - struct wireless_dev *wdev; -#endif /* ATH6K_CONFIG_CFG80211 */ - A_STATUS init_status = A_OK; - unsigned char devnum = 0; - unsigned char cnt = 0; - - /* - * If ar6000_avail_ev is called more than once, this means that - * multiple AR600x devices have been inserted into the system. - * We do not support more than one AR600x device at this time. - */ -#ifndef RK29 - if (avail_ev_called) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ERROR: More than one AR600x device not supported by driver\n")); - return A_ERROR; - } - - avail_ev_called = TRUE; -#endif - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("ar6000_available\n")); - - - - ar = A_MALLOC(sizeof(AR_SOFTC_T)); - - if (ar == NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR_SOFTC: can not allocate\n")); - return A_ERROR; - } - A_MEMZERO(ar, sizeof(AR_SOFTC_T)); - -#ifdef ATH_AR6K_11N_SUPPORT - if(aggr_init(ar6000_alloc_netbufs, ar6000_deliver_frames_to_nw_stack) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s() Failed to initialize aggr.\n", __func__)); - init_status = A_ERROR; - goto avail_ev_failed; - } -#endif - - A_MEMZERO((A_UINT8 *)ar->connTbl, NUM_CONN * sizeof(conn_t)); - /* Init the PS queues */ - for (i=0; i < NUM_CONN ; i++) { -#ifdef ATH_AR6K_11N_SUPPORT - if((ar->connTbl[i].conn_aggr = aggr_init_conn()) == NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("%s() Failed to initialize aggr.\n", __func__)); - A_FREE(ar); - return A_ERROR; - } -#endif - A_MUTEX_INIT(&ar->connTbl[i].psqLock); - A_NETBUF_QUEUE_INIT(&ar->connTbl[i].psq); - A_NETBUF_QUEUE_INIT(&ar->connTbl[i].apsdq); - } - -#if 0//LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - if(ifname[0]) { - for(i = 0; i < strlen(ifname); i++) { - if(ifname[i] >= '0' && ifname[i] <= '9' ) { - devnum = (devnum * 10) + (ifname[i] - '0'); - } - else { - cnt++; - } - } - ifname[cnt]='\0'; - } -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) */ - ar->arConfNumDev = num_device; - for (i=0; i < num_device; i++) { - - if (ar6000_devices[i] != NULL) { - break; - } - - /* Save this. It gives a bit better readability especially since */ - /* we use another local "i" variable below. */ - device_index = i; -#ifdef ATH6K_CONFIG_CFG80211 - wdev = ar6k_cfg80211_init(NULL); - if (IS_ERR(wdev)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: ar6k_cfg80211_init failed\n", __func__)); - return A_ERROR; - } - ar_netif = wdev_priv(wdev); -#else - dev = alloc_etherdev(sizeof(AR_SOFTC_DEV_T)); - if (dev == NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_available: can't alloc etherdev\n")); - A_FREE(ar); - return A_ERROR; - } - ether_setup(dev); - ar_netif = ar6k_priv(dev); -#endif /* ATH6K_CONFIG_CFG80211 */ - - if (ar_netif == NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Can't allocate ar6k priv memory\n", __func__)); - A_FREE(ar); - return A_ERROR; - } - - A_MEMZERO(ar_netif, sizeof(AR_SOFTC_DEV_T)); - arPriv = (AR_SOFTC_DEV_T *)ar_netif; - -#ifdef ATH6K_CONFIG_CFG80211 - arPriv->wdev = wdev; - wdev->iftype = NL80211_IFTYPE_STATION; - - dev = alloc_netdev_mq(0, "wlan%d", ether_setup, NUM_SUBQUEUE); - if (!dev) { - printk(KERN_CRIT "AR6K: no memory for network device instance\n"); - ar6k_cfg80211_deinit(arPriv); - A_FREE(ar); - return A_ERROR; - } - - dev->ieee80211_ptr = wdev; - SET_NETDEV_DEV(dev, wiphy_dev(wdev->wiphy)); - wdev->netdev = dev; - arPriv->arNetworkType = INFRA_NETWORK; -#endif /* ATH6K_CONFIG_CFG80211 */ - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - if (ifname[0]) - { - //sprintf(dev->name, "%s%d", ifname,(devnum + device_index)); - sprintf(dev->name, "%s", ifname); - } -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) */ - -#ifdef SET_MODULE_OWNER - SET_MODULE_OWNER(dev); -#endif - -#ifdef SET_NETDEV_DEV -#if 0 - if (ar_netif) { - HIF_DEVICE_OS_DEVICE_INFO osDevInfo; - A_MEMZERO(&osDevInfo, sizeof(osDevInfo)); - if ( A_SUCCESS( HIFConfigureDevice(hif_handle, HIF_DEVICE_GET_OS_DEVICE, - &osDevInfo, sizeof(osDevInfo))) ) { - SET_NETDEV_DEV(dev, osDevInfo.pOSDevice); - } - } -#endif -#endif - - arPriv->arNetDev = dev; - ar6000_devices[device_index] = dev; - arPriv->arSoftc = ar; - ar->arDev[device_index] = arPriv; - ar->arWlanState = WLAN_ENABLED; - arPriv->arDeviceIndex = device_index; - - ar->arWlanPowerState = WLAN_POWER_STATE_ON; - - if(ar6000_init_control_info(arPriv) != A_OK) { - init_status = A_ERROR; - goto avail_ev_failed; - } - init_waitqueue_head(&arPriv->arEvent); - -#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL - A_INIT_TIMER(&aptcTimer[i], aptcTimerHandler, ar); -#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */ - - spin_lock_init(&arPriv->arPrivLock); - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) - dev->open = &ar6000_open; - dev->stop = &ar6000_close; - dev->hard_start_xmit = &ar6000_data_tx; - dev->get_stats = &ar6000_get_stats; - - /* dev->tx_timeout = ar6000_tx_timeout; */ - dev->do_ioctl = &ar6000_ioctl; - dev->set_multicast_list = &ar6000_set_multicast_list; -#else - dev->netdev_ops = &ar6000_netdev_ops; -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) - dev->ethtool_ops = &ar6000_ethtool_ops; -#endif - dev->watchdog_timeo = AR6000_TX_TIMEOUT; - dev->wireless_handlers = &ath_iw_handler_def; - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) - dev->get_wireless_stats = ar6000_get_iwstats; /*Displayed via proc fs */ -#else - ath_iw_handler_def.get_wireless_stats = ar6000_get_iwstats; /*Displayed via proc fs */ -#endif -#ifdef CONFIG_CHECKSUM_OFFLOAD - if(csumOffload){ - - dev->features |= NETIF_F_IP_CSUM;/*advertise kernel capability - to do TCP/UDP CSUM offload for IPV4*/ - } -#endif - if (processDot11Hdr) { - dev->hard_header_len = sizeof(struct ieee80211_qosframe) + sizeof(ATH_LLC_SNAP_HDR) + sizeof(WMI_DATA_HDR) + HTC_HEADER_LEN + WMI_MAX_TX_META_SZ + LINUX_HACK_FUDGE_FACTOR; - } else { - /* - * We need the OS to provide us with more headroom in order to - * perform dix to 802.3, WMI header encap, and the HTC header - */ - dev->hard_header_len = ETH_HLEN + sizeof(ATH_LLC_SNAP_HDR) + - sizeof(WMI_DATA_HDR) + HTC_HEADER_LEN + WMI_MAX_TX_META_SZ + LINUX_HACK_FUDGE_FACTOR; - } - - if (!bypasswmi) - { - /* Indicate that WMI is enabled (although not ready yet) */ - arPriv->arWmiEnabled = TRUE; - if ((arPriv->arWmi = wmi_init((void *) arPriv,arPriv->arDeviceIndex)) == NULL) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s() Failed to initialize WMI.\n", __func__)); - init_status = A_ERROR; - goto avail_ev_failed; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("%s() Got WMI @ 0x%08x.\n", __func__, - (unsigned int) arPriv->arWmi)); - } -#ifdef P2P - /* Allocate P2P module context if this dev is in any of the P2P modes. - * For non-P2P devices, this may be allocated just in time when the - * device assumes a P2P submode. This may be needed when we do - * mode switch between none and P2P submodes. For later enhancement. - */ - if (arPriv->arNetworkSubType == SUBTYPE_P2PDEV || - arPriv->arNetworkSubType == SUBTYPE_P2PCLIENT || - arPriv->arNetworkSubType == SUBTYPE_P2PGO) { - arPriv->p2p_ctx = p2p_init(arPriv); - } -#endif /* P2P */ - } - -#ifdef CONFIG_HOST_TCMD_SUPPORT - if(testmode) { - ar->arTargetMode = AR6000_TCMD_MODE; - }else { - ar->arTargetMode = AR6000_WLAN_MODE; - } -#endif - ar->arWlanOff = FALSE; /* We are in ON state */ -#ifdef CONFIG_PM - ar->arWowState = WLAN_WOW_STATE_NONE; - ar->arBTOff = TRUE; /* BT chip assumed to be OFF */ - ar->arBTSharing = WLAN_CONFIG_BT_SHARING; - ar->arWlanOffConfig = WLAN_CONFIG_WLAN_OFF; - ar->arSuspendConfig = WLAN_CONFIG_PM_SUSPEND; - ar->arWow2Config = WLAN_CONFIG_PM_WOW2; -#endif /* CONFIG_PM */ - - A_INIT_TIMER(&ar->arHBChallengeResp.timer, ar6000_detect_error, ar); - ar->arHBChallengeResp.seqNum = 0; - ar->arHBChallengeResp.outstanding = FALSE; - ar->arHBChallengeResp.missCnt = 0; - ar->arHBChallengeResp.frequency = AR6000_HB_CHALLENGE_RESP_FREQ_DEFAULT; - ar->arHBChallengeResp.missThres = AR6000_HB_CHALLENGE_RESP_MISS_THRES_DEFAULT; - ar->arHifDevice = hif_handle; - sema_init(&ar->arSem, 1); - ar->bIsDestroyProgress = FALSE; - - INIT_HTC_PACKET_QUEUE(&ar->amsdu_rx_buffer_queue); - /* - * If requested, perform some magic which requires no cooperation from - * the Target. It causes the Target to ignore flash and execute to the - * OS from ROM. - * - * This is intended to support recovery from a corrupted flash on Targets - * that support flash. - */ - if (skipflash) - { - //ar6000_reset_device_skipflash(ar->arHifDevice); - } - - BMIInit(); - - if (bmienable) { - ar6000_sysfs_bmi_init(ar); - } - - { - struct bmi_target_info targ_info; - A_MEMZERO(&targ_info, sizeof(targ_info)); - if (BMIGetTargetInfo(ar->arHifDevice, &targ_info) != A_OK) { - init_status = A_ERROR; - goto avail_ev_failed; - } - - ar->arVersion.target_ver = targ_info.target_ver; - ar->arTargetType = targ_info.target_type; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("%s() TARGET TYPE: %d\n", __func__,ar->arTargetType)); - target_register_tbl_attach(ar->arTargetType); - - /* do any target-specific preparation that can be done through BMI */ - if (ar6000_prepare_target(ar->arHifDevice, - targ_info.target_type, - targ_info.target_ver) != A_OK) { - init_status = A_ERROR; - goto avail_ev_failed; - } - - } - if (ar6000_configure_target(ar) != A_OK) { - init_status = A_ERROR; - goto avail_ev_failed; - } - - A_MEMZERO(&htcInfo,sizeof(htcInfo)); - htcInfo.pContext = ar; - htcInfo.TargetFailure = ar6000_target_failure; - - ar->arHtcTarget = HTCCreate(ar->arHifDevice,&htcInfo); - - if (ar->arHtcTarget == NULL) { - init_status = A_ERROR; - goto avail_ev_failed; - } - - spin_lock_init(&ar->arLock); - -#ifdef CONFIG_CHECKSUM_OFFLOAD - if(csumOffload){ - - ar->rxMetaVersion=WMI_META_VERSION_2;/*if external frame work is also needed, change and use an extended rxMetaVerion*/ - } -#endif - - HIFClaimDevice(ar->arHifDevice, ar); - - if (bmienable) - { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("BMI enabled: %d\n", wlaninitmode)); - if ((wlaninitmode == WLAN_INIT_MODE_UDEV) || - (wlaninitmode == WLAN_INIT_MODE_DRV)) - { - A_STATUS status = A_OK; - do { - if ((status = ar6000_sysfs_bmi_get_config(ar, wlaninitmode)) != A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_avail: ar6000_sysfs_bmi_get_config failed\n")); - break; - } - }while (FALSE); - } - } - - if(bmienable) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("BMI enabled: %d\n", wlaninitmode)); - if ((wlaninitmode == WLAN_INIT_MODE_UDEV) || - (wlaninitmode == WLAN_INIT_MODE_DRV)) - { - A_STATUS status = A_OK; - dev = ar6000_devices[0]; - do { -#ifdef HTC_RAW_INTERFACE - if (!eppingtest && bypasswmi) { - break; /* Don't call ar6000_init for ART */ - } -#endif - rtnl_lock(); - status = (ar6000_init(dev)==0) ? A_OK : A_ERROR; - rtnl_unlock(); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_avail: ar6000_init\n")); - } - } while (FALSE); - - if (status != A_OK) { - init_status = status; - goto avail_ev_failed; - } - } - } - - for (i=0; i < num_device; i++) - { - dev = ar6000_devices[i]; - arPriv = ar6k_priv(dev); - ar = arPriv->arSoftc; - /* Don't install the init function if BMI is requested */ - if (!bmienable) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) - dev->init = ar6000_init; -#else - ar6000_netdev_ops.ndo_init = ar6000_init; -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) */ - } - - /* This runs the init function if registered */ - if (register_netdev(dev)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_avail: register_netdev failed\n")); - ar6000_cleanup(ar); - ar6000_devices[i]=NULL; - ar6000_destroy(dev, 0); - return A_ERROR; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("ar6000_avail: name=%s hifdevice=0x%lx, dev=0x%lx (%d), ar=0x%lx\n", - dev->name, (unsigned long)ar->arHifDevice, (unsigned long)dev, device_index, - (unsigned long)ar)); - - } - -avail_ev_failed : - if (A_FAILED(init_status)) { - if (bmienable) { - ar6000_sysfs_bmi_deinit(ar); - } - for (i=0; i < num_device; i++) - { - dev = ar6000_devices[i]; - arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - if(arPriv->arWmiEnabled == TRUE) - { - wmi_shutdown(arPriv->arWmi); - arPriv->arWmiEnabled = FALSE; - } - ar6000_devices[i] = NULL; - } - A_FREE(ar); - } - - return init_status; -} - -static void ar6000_target_failure(void *Instance, A_STATUS Status) -{ - AR_SOFTC_T *ar = (AR_SOFTC_T *)Instance; - WMI_TARGET_ERROR_REPORT_EVENT errEvent; - static A_BOOL sip = FALSE; - A_UINT8 i; - - if (Status != A_OK) { - - printk(KERN_ERR "ar6000_target_failure: target asserted \n"); - - if (timer_pending(&ar->arHBChallengeResp.timer)) { - A_UNTIMEOUT(&ar->arHBChallengeResp.timer); - } - - /* try dumping target assertion information (if any) */ - ar6000_dump_target_assert_info(ar->arHifDevice,ar->arTargetType); - - /* - * Fetch the logs from the target via the diagnostic - * window. - */ - ar6000_dbglog_get_debug_logs(ar); - - /* Report the error only once */ - if (!sip) { - sip = TRUE; - errEvent.errorVal = WMI_TARGET_COM_ERR | - WMI_TARGET_FATAL_ERR; - for(i = 0; i < num_device; i++) - { - - ar6000_send_event_to_app(ar->arDev[i], WMI_ERROR_REPORT_EVENTID, - (A_UINT8 *)&errEvent, - sizeof(WMI_TARGET_ERROR_REPORT_EVENT)); - - } - } - } -} - -static A_STATUS -ar6000_unavail_ev(void *context, void *hif_handle) -{ - unsigned int old_reset_ok = resetok; - A_UINT8 i; - struct net_device *ar6000_netdev; - AR_SOFTC_T *ar = (AR_SOFTC_T*)context; - resetok = 0; /* card is remove, don't reset */ - ar6000_cleanup(ar); - resetok = old_reset_ok; - /* NULL out it's entry in the global list */ - for(i = 0; i < num_device; i++) { - ar6000_netdev = ar6000_devices[i]; - ar6000_devices[i] = NULL; - ar6000_destroy(ar6000_netdev, 1); - } - - return A_OK; -} - - -void -ar6000_restart_endpoint(AR_SOFTC_T *ar) -{ - - A_STATUS status = A_OK; - AR_SOFTC_DEV_T *arPriv; - struct net_device *dev; - A_UINT8 i = 0; - - /* - * Call wmi_init for each device. This must be done BEFORE ar6000_init() is - * called, or we will get a null pointer exception in the wmi code. We must - * also set the arWmiEnabled flag for each device. - */ - for(i = 0; i < num_device; i++) { - arPriv = ar->arDev[i]; - arPriv->arWmiEnabled = TRUE; - if ((arPriv->arWmi = wmi_init((void *) arPriv,arPriv->arDeviceIndex)) == NULL) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s() Failed to initialize WMI.\n", __func__)); - status = A_ERROR; - goto exit; - } - } - - - BMIInit(); - if (bmienable) { - ar6000_sysfs_bmi_init(ar); - } - do { - if ( (status=ar6000_configure_target(ar))!=A_OK) - break; - if ( (status=ar6000_sysfs_bmi_get_config(ar, wlaninitmode)) != A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_avail: ar6000_sysfs_bmi_get_config failed\n")); - break; - } - } while(0); - - dev = ar6000_devices[0]; - rtnl_lock(); - status = (ar6000_init(dev)==0) ? A_OK : A_ERROR; - rtnl_unlock(); - - if (status!=A_OK) { - goto exit; - } - - - for(i = 0; i < num_device; i++) { - arPriv = ar->arDev[i]; - if (arPriv->arDoConnectOnResume && - arPriv->arSsidLen && - ar->arWlanState == WLAN_ENABLED) - { - ar6000_connect_to_ap(arPriv); - } - } - - if (status==A_OK) { - return; - } - -exit: - for(i = 0; i < num_device; i++) { - arPriv = ar->arDev[i]; - ar6000_devices[i] = NULL; - ar6000_destroy(arPriv->arNetDev, 1); - } - -} - -void -ar6000_stop_endpoint(AR_SOFTC_T *ar, A_BOOL keepprofile, A_BOOL getdbglogs) -{ - - AR_SOFTC_DEV_T *arPriv ; - A_UINT8 i; - A_UINT8 ctr; - AR_SOFTC_STA_T *arSta; - - for(i = 0; i < num_device; i++) - { - arPriv = ar->arDev[i]; - arSta = &arPriv->arSta; - /* Stop the transmit queues */ - netif_stop_queue(arPriv->arNetDev); - - /* Disable the target and the interrupts associated with it */ - if (ar->arWmiReady == TRUE) - { - if (!bypasswmi) { - A_BOOL disconnectIssued; - - arPriv->arDoConnectOnResume = arPriv->arConnected; - - A_UNTIMEOUT(&arPriv->arSta.disconnect_timer); - A_UNTIMEOUT(&ar->ap_reconnect_timer); - A_UNTIMEOUT(&arPriv->ap_acs_timer); -#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL - /* Delete the Adaptive Power Control timer */ - if (timer_pending(&aptcTimer[i])) { - del_timer_sync(&aptcTimer[i]); - } -#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */ -#ifdef ATH_AR6K_11N_SUPPORT - for (ctr=0; ctr < NUM_CONN ; ctr++) { - aggr_module_destroy_timers(ar->connTbl[ctr].conn_aggr); - } -#endif - - disconnectIssued = (arPriv->arConnected) || (arPriv->arSta.arConnectPending); - ar6000_disconnect(arPriv); - if (!keepprofile) { - ar6000_init_profile_info(arPriv); - } - if (getdbglogs) { - ar6000_dbglog_get_debug_logs(ar); - } - ar->arWmiReady = FALSE; - arPriv->arWmiEnabled = FALSE; - wmi_shutdown(arPriv->arWmi); - arPriv->arWmi = NULL; - /* - * After wmi_shudown all WMI events will be dropped. - * We need to cleanup the buffers allocated in AP mode - * and give disconnect notification to stack, which usually - * happens in the disconnect_event. - * Simulate the disconnect_event by calling the function directly. - * Sometimes disconnect_event will be received when the debug logs - * are collected. - */ - if (disconnectIssued) { - if(arPriv->arNetworkType & AP_NETWORK) { - ar6000_disconnect_event(arPriv, DISCONNECT_CMD, bcast_mac, 0, NULL, 0); - } else { - ar6000_disconnect_event(arPriv, DISCONNECT_CMD, arPriv->arBssid, 0, NULL, 0); - } - } -#ifdef USER_KEYS - arPriv->arSta.user_savedkeys_stat = USER_SAVEDKEYS_STAT_INIT; - arPriv->arSta.user_key_ctrl = 0; -#endif - } - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("%s(): WMI stopped\n", __func__)); - } - else - { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("%s(): WMI not ready 0x%lx 0x%lx\n", - __func__, (unsigned long) ar, (unsigned long) arPriv->arWmi)); - /* Shut down WMI if we have started it */ - if(arPriv->arWmiEnabled == TRUE) - { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("%s(): Shut down WMI\n", __func__)); - arPriv->arWmiEnabled = FALSE; - wmi_shutdown(arPriv->arWmi); - arPriv->arWmi = NULL; - } - } - /* cleanup hci pal driver data structures */ - if (setuphcipal && (arPriv->isBt30amp == TRUE)) { - ar6k_cleanup_hci_pal(arPriv); - } - } - - if (ar->arHtcTarget != NULL) { -#ifdef EXPORT_HCI_BRIDGE_INTERFACE - if (NULL != ar6kHciTransCallbacks.cleanupTransport) { - ar6kHciTransCallbacks.cleanupTransport(NULL); - } -#else - // FIXME: workaround to reset BT's UART baud rate to default - if (NULL != ar->exitCallback) { - AR3K_CONFIG_INFO ar3kconfig; - A_STATUS status; - - A_MEMZERO(&ar3kconfig,sizeof(ar3kconfig)); - ar6000_set_default_ar3kconfig(ar, (void *)&ar3kconfig); - status = ar->exitCallback(&ar3kconfig); - if (A_OK != status) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Failed to reset AR3K baud rate! \n")); - } - } - // END workaround - if (setuphci) - ar6000_cleanup_hci(ar); -#endif - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,(" Shutting down HTC .... \n")); - /* stop HTC */ - HTCStop(ar->arHtcTarget); - ar6k_init = FALSE; - } - - if (resetok) { - /* try to reset the device if we can - * The driver may have been configure NOT to reset the target during - * a debug session */ - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,(" Attempting to reset target on instance destroy.... \n")); - if (ar->arHifDevice != NULL) { -#if defined(CONFIG_MMC_MSM) || defined(CONFIG_MMC_SDHCI_S3C) - A_BOOL coldReset = ((ar->arTargetType == TARGET_TYPE_AR6003)|| (ar->arTargetType == TARGET_TYPE_MCKINLEY)) ? TRUE: FALSE; -#else - A_BOOL coldReset = (ar->arTargetType == TARGET_TYPE_MCKINLEY) ? TRUE: FALSE; -#endif - ar6000_reset_device(ar->arHifDevice, ar->arTargetType, TRUE, coldReset); - } - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,(" Host does not want target reset. \n")); - } - /* Done with cookies */ - ar6000_cookie_cleanup(ar); - - /* cleanup any allocated AMSDU buffers */ - ar6000_cleanup_amsdu_rxbufs(ar); - - if (bmienable) { - ar6000_sysfs_bmi_deinit(ar); - } -} - -void ar6000_cleanup(AR_SOFTC_T *ar) -{ - A_UINT8 ctr; - ar->bIsDestroyProgress = TRUE; - - if (down_interruptible(&ar->arSem)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s(): down_interruptible failed \n", __func__)); - return; - } - - if (ar->arWlanPowerState != WLAN_POWER_STATE_CUT_PWR) { - /* only stop endpoint if we are not stop it in suspend_ev */ - ar6000_stop_endpoint(ar, FALSE, TRUE); - } else { - /* clear up the platform power state before rmmod */ - plat_setup_power(ar, 1, 0); - ar->arPlatPowerOff = FALSE; - } - -#ifdef ATH_AR6K_11N_SUPPORT - for (ctr=0; ctr < NUM_CONN ; ctr++) { - aggr_module_destroy_conn(ar->connTbl[ctr].conn_aggr); - } - aggr_module_destroy(); -#endif - - ar->arWlanState = WLAN_DISABLED; - if (ar->arHtcTarget != NULL) { - /* destroy HTC */ - HTCDestroy(ar->arHtcTarget); - } - if (ar->arHifDevice != NULL) { - /*release the device so we do not get called back on remove incase we - * we're explicity destroyed by module unload */ - HIFReleaseDevice(ar->arHifDevice); - HIFShutDownDevice(ar->arHifDevice); - } - /* Done with cookies */ - ar6000_cookie_cleanup(ar); - - /* cleanup any allocated AMSDU buffers */ - ar6000_cleanup_amsdu_rxbufs(ar); - - if (bmienable) { - ar6000_sysfs_bmi_deinit(ar); - } - - /* Cleanup BMI */ - BMICleanup(); - - /* Clear the tx counters */ - memset(tx_attempt, 0, sizeof(tx_attempt)); - memset(tx_post, 0, sizeof(tx_post)); - memset(tx_complete, 0, sizeof(tx_complete)); - -#ifdef HTC_RAW_INTERFACE - if (ar->arRawHtc) { - A_FREE(ar->arRawHtc); - ar->arRawHtc = NULL; - } -#endif - A_UNTIMEOUT(&ar->ap_reconnect_timer); - A_UNTIMEOUT(&ar->arHBChallengeResp.timer); - A_FREE(ar); - -} -/* - * We need to differentiate between the surprise and planned removal of the - * device because of the following consideration: - * - In case of surprise removal, the hcd already frees up the pending - * for the device and hence there is no need to unregister the function - * driver inorder to get these requests. For planned removal, the function - * driver has to explictly unregister itself to have the hcd return all the - * pending requests before the data structures for the devices are freed up. - * Note that as per the current implementation, the function driver will - * end up releasing all the devices since there is no API to selectively - * release a particular device. - * - Certain commands issued to the target can be skipped for surprise - * removal since they will anyway not go through. - */ -void -ar6000_destroy(struct net_device *dev, unsigned int unregister) -{ - AR_SOFTC_DEV_T *arPriv; - AR_SOFTC_AP_T *arAp; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("+ar6000_destroy \n")); - - if((dev == NULL) || ((arPriv = ar6k_priv(dev)) == NULL)) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s(): Failed to get device structure.\n", __func__)); - return; - } - - A_UNTIMEOUT(&arPriv->ap_acs_timer); - aggr_module_destroy_conn(arPriv->conn_aggr); - - if(arPriv->arNetworkType == AP_NETWORK) - { - arAp = &arPriv->arAp; - -#ifdef ATH_SUPPORT_DFS - dfs_detach_host(arAp->pDfs); -#endif - } - ar6k_init = FALSE; - /* Free up the device data structure */ - if (unregister) { - unregister_netdev(dev); - } -#define free_netdev_support -#ifndef free_netdev_support - kfree(dev); -#else - free_netdev(dev); -#endif - -#ifdef ATH6K_CONFIG_CFG80211 - ar6k_cfg80211_deinit(arPriv); -#endif /* ATH6K_CONFIG_CFG80211 */ - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("-ar6000_destroy \n")); -} - -static void ap_reconnect_timer_handler(unsigned long ptr) -{ - AR_SOFTC_T *ar= (AR_SOFTC_T *)ptr; - AR_SOFTC_DEV_T *arTempPriv = NULL; - A_UINT8 i=0; - A_UNTIMEOUT(&ar->ap_reconnect_timer); - - if(ar->arHoldConnection){ - ar->arHoldConnection = FALSE; - for(i=0;iarConfNumDev;i++){ - arTempPriv = ar->arDev[i]; - if((AP_NETWORK == arTempPriv->arNetworkType) && - (arTempPriv->arHoldConnection)){ - arTempPriv->arHoldConnection = FALSE; - ar6000_ap_mode_profile_commit(arTempPriv); - } - } - } -} -static void disconnect_timer_handler(unsigned long ptr) -{ - struct net_device *dev = (struct net_device *)ptr; - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - - A_UNTIMEOUT(&arPriv->arSta.disconnect_timer); - - ar6000_init_profile_info(arPriv); - ar6000_disconnect(arPriv); -} - -static void ar6000_detect_error(unsigned long ptr) -{ - AR_SOFTC_T *ar = (AR_SOFTC_T *)ptr; - A_UINT8 i; - WMI_TARGET_ERROR_REPORT_EVENT errEvent; - - AR6000_SPIN_LOCK(&ar->arLock, 0); - - if (ar->arHBChallengeResp.outstanding) { - ar->arHBChallengeResp.missCnt++; - } else { - ar->arHBChallengeResp.missCnt = 0; - } - - if (ar->arHBChallengeResp.missCnt > ar->arHBChallengeResp.missThres) { - /* Send Error Detect event to the application layer and do not reschedule the error detection module timer */ - ar->arHBChallengeResp.missCnt = 0; - ar->arHBChallengeResp.seqNum = 0; - errEvent.errorVal = WMI_TARGET_COM_ERR | WMI_TARGET_FATAL_ERR; - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - for(i = 0; i < num_device; i++) - { - ar6000_send_event_to_app(ar->arDev[i], WMI_ERROR_REPORT_EVENTID, - (A_UINT8 *)&errEvent, - sizeof(WMI_TARGET_ERROR_REPORT_EVENT)); - } - return; - } - - /* Generate the sequence number for the next challenge */ - ar->arHBChallengeResp.seqNum++; - ar->arHBChallengeResp.outstanding = TRUE; - - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - - /* Send the challenge on the control channel */ - if (wmi_get_challenge_resp_cmd(ar->arDev[0]->arWmi, ar->arHBChallengeResp.seqNum, DRV_HB_CHALLENGE) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to send heart beat challenge\n")); - } - - - /* Reschedule the timer for the next challenge */ - A_TIMEOUT_MS(&ar->arHBChallengeResp.timer, ar->arHBChallengeResp.frequency * 1000, 0); -} - -void ar6000_init_profile_info(AR_SOFTC_DEV_T *arPriv) -{ - A_UINT8 mode = 0; - A_UINT8 submode = 0; - mode = ((fwmode >> (arPriv->arDeviceIndex * HI_OPTION_FW_MODE_BITS)) & (HI_OPTION_FW_MODE_MASK )); - - switch(mode) { - case HI_OPTION_FW_MODE_IBSS: - arPriv->arNetworkType = arPriv->arNextMode = ADHOC_NETWORK; - break; - case HI_OPTION_FW_MODE_BSS_STA: - arPriv->arNetworkType = arPriv->arNextMode = INFRA_NETWORK; - break; - case HI_OPTION_FW_MODE_AP: - arPriv->arNetworkType = arPriv->arNextMode = AP_NETWORK; - break; - case HI_OPTION_FW_MODE_BT30AMP: - arPriv->arNetworkType = arPriv->arNextMode = INFRA_NETWORK; - arPriv->isBt30amp = TRUE; - break; - } - /* Initialize firware sub mode - */ - submode = ((fwsubmode>>(arPriv->arDeviceIndex * HI_OPTION_FW_SUBMODE_BITS)) - & (HI_OPTION_FW_SUBMODE_MASK)); - - switch(submode) { - case HI_OPTION_FW_SUBMODE_NONE: - arPriv->arNetworkSubType = SUBTYPE_NONE; - break; - case HI_OPTION_FW_SUBMODE_P2PDEV: - arPriv->arNetworkSubType = SUBTYPE_P2PDEV; - break; - case HI_OPTION_FW_SUBMODE_P2PCLIENT: - arPriv->arNetworkSubType = SUBTYPE_P2PCLIENT; - break; - case HI_OPTION_FW_SUBMODE_P2PGO: - arPriv->arNetworkSubType = SUBTYPE_P2PGO; - break; - } - - ar6000_init_mode_info(arPriv); -} - -static int -ar6000_init_control_info(AR_SOFTC_DEV_T *arPriv) -{ - AR_SOFTC_T *ar = arPriv->arSoftc; - - arPriv->arWmiEnabled = FALSE; - ar->arVersion.host_ver = AR6K_SW_VERSION; - - if(!(strcmp(targetconf,"mobile"))) - ar->arVersion.targetconf_ver = AR6003_SUBVER_MOBILE; - else if(!(strcmp(targetconf,"tablet"))) - ar->arVersion.targetconf_ver = AR6003_SUBVER_TABLET; - else if(!(strcmp(targetconf,"router"))) - ar->arVersion.targetconf_ver = AR6003_SUBVER_ROUTER; - else if(!(strcmp(targetconf,"default"))) - ar->arVersion.targetconf_ver = AR6003_SUBVER_DEFAULT; - else - ar->arVersion.targetconf_ver = AR6003_SUBVER_MOBILE; - - - ar6000_init_profile_info(arPriv); - - if((arPriv->conn_aggr = aggr_init_conn()) == NULL) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("%s() Failed to initialize aggr.\n", __func__)); - return A_ERROR; - } - return A_OK; -} - -static int -ar6000_open(struct net_device *dev) -{ - unsigned long flags; - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - - spin_lock_irqsave(&arPriv->arPrivLock, flags); - -#ifdef ATH6K_CONFIG_CFG80211 - if(arPriv->arSoftc->arWlanState == WLAN_DISABLED) { - arPriv->arSoftc->arWlanState = WLAN_ENABLED; - } -#endif /* ATH6K_CONFIG_CFG80211 */ - - if( arPriv->arConnected || bypasswmi) { - netif_carrier_on(dev); - /* Wake up the queues */ - netif_wake_queue(dev); - } - else - netif_carrier_off(dev); - - spin_unlock_irqrestore(&arPriv->arPrivLock, flags); - return 0; -} - -static int -ar6000_close(struct net_device *dev) -{ -#ifdef ATH6K_CONFIG_CFG80211 - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); -#endif /* ATH6K_CONFIG_CFG80211 */ - netif_stop_queue(dev); - -#ifdef ATH6K_CONFIG_CFG80211 - ar6000_disconnect(arPriv); - - if(arPriv->arSoftc->arWmiReady == TRUE) { - if (wmi_scanparams_cmd(arPriv->arWmi, 0xFFFF, 0, - 0, 0, 0, 0, 0, 0, 0, 0) != A_OK) { - return -EIO; - } - arPriv->arSoftc->arWlanState = WLAN_DISABLED; - } -#endif /* ATH6K_CONFIG_CFG80211 */ - - return 0; -} - -/* connect to a service */ -static A_STATUS ar6000_connectservice(AR_SOFTC_DEV_T *arPriv, - HTC_SERVICE_CONNECT_REQ *pConnect, - char *pDesc) -{ - A_STATUS status; - HTC_SERVICE_CONNECT_RESP response; - AR_SOFTC_T *ar = arPriv->arSoftc; - - do { - - A_MEMZERO(&response,sizeof(response)); - - status = HTCConnectService(ar->arHtcTarget, - pConnect, - &response); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" Failed to connect to %s service status:%d \n", - pDesc, status)); - break; - } - switch (pConnect->ServiceID) { - case WMI_CONTROL_SVC : - if(!bypasswmi) - { - /* set control endpoint for WMI use */ - wmi_set_control_ep(arPriv->arWmi, response.Endpoint); - /* save EP for fast lookup */ - ar->arControlEp = response.Endpoint; - } - break; - case WMI_DATA_BE_SVC : - arSetAc2EndpointIDMap(ar, WMM_AC_BE, response.Endpoint); - break; - case WMI_DATA_BK_SVC : - arSetAc2EndpointIDMap(ar, WMM_AC_BK, response.Endpoint); - break; - case WMI_DATA_VI_SVC : - arSetAc2EndpointIDMap(ar, WMM_AC_VI, response.Endpoint); - break; - case WMI_DATA_VO_SVC : - arSetAc2EndpointIDMap(ar, WMM_AC_VO, response.Endpoint); - break; - default: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ServiceID not mapped %d\n", pConnect->ServiceID)); - status = A_EINVAL; - break; - } - - } while (FALSE); - - return status; -} - -void ar6000_TxDataCleanup(AR_SOFTC_T *ar) -{ - /* flush all the data (non-control) streams - * we only flush packets that are tagged as data, we leave any control packets that - * were in the TX queues alone */ - HTCFlushEndpoint(ar->arHtcTarget, - arAc2EndpointID(ar, WMM_AC_BE), - AR6K_DATA_PKT_TAG); - HTCFlushEndpoint(ar->arHtcTarget, - arAc2EndpointID(ar, WMM_AC_BK), - AR6K_DATA_PKT_TAG); - HTCFlushEndpoint(ar->arHtcTarget, - arAc2EndpointID(ar, WMM_AC_VI), - AR6K_DATA_PKT_TAG); - HTCFlushEndpoint(ar->arHtcTarget, - arAc2EndpointID(ar, WMM_AC_VO), - AR6K_DATA_PKT_TAG); -} - -HTC_ENDPOINT_ID -ar6000_ac2_endpoint_id ( void * devt, A_UINT8 ac) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *) devt; - AR_SOFTC_T *ar = arPriv->arSoftc; - return(arAc2EndpointID(ar, ac)); -} - -A_UINT8 -ar6000_endpoint_id2_ac(void * devt, HTC_ENDPOINT_ID ep ) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *) devt; - AR_SOFTC_T *ar = arPriv->arSoftc; - return(arEndpoint2Ac(ar, ep )); -} - - -/* This function does one time initialization for the lifetime of the device */ -int ar6000_init(struct net_device *dev) -{ - AR_SOFTC_DEV_T *arPriv; - AR_SOFTC_T *ar; - int ret = 0; - int i = 0; - int j = 0; - A_STATUS status; - A_INT32 timeleft; -#if defined(INIT_MODE_DRV_ENABLED) && defined(ENABLE_COEXISTENCE) - WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD sbcb_cmd; - WMI_SET_BTCOEX_FE_ANT_CMD sbfa_cmd; -#endif /* INIT_MODE_DRV_ENABLED && ENABLE_COEXISTENCE */ - - dev_hold(dev); - rtnl_unlock(); - - if(ar6k_init) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR6000 Initialised\n")); - goto ar6000_init_done; - } - - ar6k_init = TRUE; - if((arPriv = ar6k_priv(dev)) == NULL) - { - ret = -EIO; - goto ar6000_init_done; - } - - ar = arPriv->arSoftc; - - if (wlaninitmode == WLAN_INIT_MODE_USR || wlaninitmode == WLAN_INIT_MODE_DRV) { - - ar6000_update_bdaddr(ar); - } - - if (enablerssicompensation) { - ar6000_copy_cust_data_from_target(ar->arHifDevice, ar->arTargetType); - read_rssi_compensation_param(ar); - for(j=0; jarDev[j],i); - } - } - } - - /* Do we need to finish the BMI phase */ - - if ((wlaninitmode==WLAN_INIT_MODE_USR || wlaninitmode==WLAN_INIT_MODE_DRV) && - (BMIDone(ar->arHifDevice) != A_OK)) - { - ret = -EIO; - goto ar6000_init_done; - } - - do { - HTC_SERVICE_CONNECT_REQ connect; - - /* the reason we have to wait for the target here is that the driver layer - * has to init BMI in order to set the host block size, - */ - status = HTCWaitTarget(ar->arHtcTarget); - - if (A_FAILED(status)) { - break; - } - - A_MEMZERO(&connect,sizeof(connect)); - /* meta data is unused for now */ - connect.pMetaData = NULL; - connect.MetaDataLength = 0; - /* these fields are the same for all service endpoints */ - connect.EpCallbacks.pContext = ar; - connect.EpCallbacks.EpTxCompleteMultiple = ar6000_tx_complete; - connect.EpCallbacks.EpRecv = ar6000_rx; - connect.EpCallbacks.EpRecvRefill = ar6000_rx_refill; - connect.EpCallbacks.EpSendFull = ar6000_tx_queue_full; - /* set the max queue depth so that our ar6000_tx_queue_full handler gets called. - * Linux has the peculiarity of not providing flow control between the - * NIC and the network stack. There is no API to indicate that a TX packet - * was sent which could provide some back pressure to the network stack. - * Under linux you would have to wait till the network stack consumed all sk_buffs - * before any back-flow kicked in. Which isn't very friendly. - * So we have to manage this ourselves */ - connect.MaxSendQueueDepth = MAX_DEFAULT_SEND_QUEUE_DEPTH; - connect.EpCallbacks.RecvRefillWaterMark = AR6000_MAX_RX_BUFFERS / 4; /* set to 25 % */ - if (0 == connect.EpCallbacks.RecvRefillWaterMark) { - connect.EpCallbacks.RecvRefillWaterMark++; - } - /* connect to control service */ - connect.ServiceID = WMI_CONTROL_SVC; - status = ar6000_connectservice(arPriv, - &connect, - "WMI CONTROL"); - if (A_FAILED(status)) { - break; - } - - connect.LocalConnectionFlags |= HTC_LOCAL_CONN_FLAGS_ENABLE_SEND_BUNDLE_PADDING; - /* limit the HTC message size on the send path, although we can receive A-MSDU frames of - * 4K, we will only send ethernet-sized (802.3) frames on the send path. */ - connect.MaxSendMsgSize = WMI_MAX_TX_DATA_FRAME_LENGTH; - - /* to reduce the amount of committed memory for larger A_MSDU frames, use the recv-alloc threshold - * mechanism for larger packets */ - connect.EpCallbacks.RecvAllocThreshold = AR6000_BUFFER_SIZE; - connect.EpCallbacks.EpRecvAllocThresh = ar6000_alloc_amsdu_rxbuf; - - /* for the remaining data services set the connection flag to reduce dribbling, - * if configured to do so */ - if (reduce_credit_dribble) { - connect.ConnectionFlags |= HTC_CONNECT_FLAGS_REDUCE_CREDIT_DRIBBLE; - /* the credit dribble trigger threshold is (reduce_credit_dribble - 1) for a value - * of 0-3 */ - connect.ConnectionFlags &= ~HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_MASK; - connect.ConnectionFlags |= - ((A_UINT16)reduce_credit_dribble - 1) & HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_MASK; - } - /* connect to best-effort service */ - connect.ServiceID = WMI_DATA_BE_SVC; - - status = ar6000_connectservice(arPriv, - &connect, - "WMI DATA BE"); - if (A_FAILED(status)) { - break; - } - - /* connect to back-ground - * map this to WMI LOW_PRI */ - connect.ServiceID = WMI_DATA_BK_SVC; - status = ar6000_connectservice(arPriv, - &connect, - "WMI DATA BK"); - if (A_FAILED(status)) { - break; - } - - /* connect to Video service, map this to - * to HI PRI */ - connect.ServiceID = WMI_DATA_VI_SVC; - status = ar6000_connectservice(arPriv, - &connect, - "WMI DATA VI"); - if (A_FAILED(status)) { - break; - } - - /* connect to VO service, this is currently not - * mapped to a WMI priority stream due to historical reasons. - * WMI originally defined 3 priorities over 3 mailboxes - * We can change this when WMI is reworked so that priorities are not - * dependent on mailboxes */ - connect.ServiceID = WMI_DATA_VO_SVC; - status = ar6000_connectservice(arPriv, - &connect, - "WMI DATA VO"); - if (A_FAILED(status)) { - break; - } - - A_ASSERT(arAc2EndpointID(ar,WMM_AC_BE) != 0); - A_ASSERT(arAc2EndpointID(ar,WMM_AC_BK) != 0); - A_ASSERT(arAc2EndpointID(ar,WMM_AC_VI) != 0); - A_ASSERT(arAc2EndpointID(ar,WMM_AC_VO) != 0); - - /* setup access class priority mappings */ - ar->arAcStreamPriMap[WMM_AC_BK] = 0; /* lowest */ - ar->arAcStreamPriMap[WMM_AC_BE] = 1; /* */ - ar->arAcStreamPriMap[WMM_AC_VI] = 2; /* */ - ar->arAcStreamPriMap[WMM_AC_VO] = 3; /* highest */ - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE - if (setuphci && (NULL != ar6kHciTransCallbacks.setupTransport)) { - HCI_TRANSPORT_MISC_HANDLES hciHandles; - - hciHandles.netDevice = ar->arNetDev; - hciHandles.hifDevice = ar->arHifDevice; - hciHandles.htcHandle = ar->arHtcTarget; - status = (A_STATUS)(ar6kHciTransCallbacks.setupTransport(&hciHandles)); - } -#else - if (setuphci) { - /* setup HCI */ - status = ar6000_setup_hci(ar); - } -#endif - - } while (FALSE); - - if (A_FAILED(status)) { - ret = -EIO; - goto ar6000_init_done; - } - - /* - * give our connected endpoints some buffers - */ - - ar6000_rx_refill(ar, ar->arControlEp); - ar6000_rx_refill(ar, arAc2EndpointID(ar,WMM_AC_BE)); - - /* - * We will post the receive buffers only for SPE or endpoint ping testing so we are - * making it conditional on the 'bypasswmi' flag. - */ - if (bypasswmi) { - ar6000_rx_refill(ar,arAc2EndpointID(ar,WMM_AC_BK)); - ar6000_rx_refill(ar,arAc2EndpointID(ar,WMM_AC_VI)); - ar6000_rx_refill(ar,arAc2EndpointID(ar,WMM_AC_VO)); - } - - /* allocate some buffers that handle larger AMSDU frames */ - ar6000_refill_amsdu_rxbufs(ar,AR6000_MAX_AMSDU_RX_BUFFERS); - - /* setup credit distribution */ - ar6000_setup_credit_dist(ar->arHtcTarget, &ar->arCreditStateInfo); - - /* Since cookies are used for HTC transports, they should be */ - /* initialized prior to enabling HTC. */ - ar6000_cookie_init(ar); - - /* start HTC */ - status = HTCStart(ar->arHtcTarget); - if (status != A_OK) { - for(i = 0; i < num_device; i++) - { - if (ar->arDev[i]->arWmiEnabled == TRUE) { - wmi_shutdown(ar->arDev[i]->arWmi); - ar->arDev[i]->arWmiEnabled = FALSE; - ar->arDev[i]->arWmi = NULL; - } - } - ar6000_cookie_cleanup(ar); - ret = -EIO; - goto ar6000_init_done; - } - - if (!bypasswmi) { - /* Wait for Wmi event to be ready */ - timeleft = wait_event_interruptible_timeout(ar->arDev[0]->arEvent, - (ar->arWmiReady == TRUE), wmitimeout * HZ); - - if (ar->arVersion.abi_ver != AR6K_ABI_VERSION) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ABI Version mismatch: Host(0x%x), Target(0x%x)\n", AR6K_ABI_VERSION, ar->arVersion.abi_ver)); -#ifndef ATH6KL_SKIP_ABI_VERSION_CHECK - ret = -EIO; - goto ar6000_init_done; -#endif /* ATH6KL_SKIP_ABI_VERSION_CHECK */ - } - - if(!timeleft || signal_pending(current)) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("WMI is not ready or wait was interrupted\n")); - ret = -EIO; - goto ar6000_init_done; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("%s() WMI is ready\n", __func__)); - - /* init PAL driver after WMI is ready */ - - if(setuphcipal) { - A_BOOL bt30ampDevFound = FALSE; - for (i=0; i < num_device; i++) { - if ( ar->arDev[i]->isBt30amp == TRUE ) { - status = ar6k_setup_hci_pal(ar->arDev[i]); - bt30ampDevFound = TRUE; - } - - } - } - - /* Communicate the wmi protocol verision to the target */ - if ((ar6000_set_host_app_area(ar)) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set the host app area\n")); - } - - /* configure the device for rx dot11 header rules 0,0 are the default values - * therefore this command can be skipped if the inputs are 0,FALSE,FALSE.Required - if checksum offload is needed. Set RxMetaVersion to 2*/ - if ((wmi_set_rx_frame_format_cmd(arPriv->arWmi,ar->rxMetaVersion, processDot11Hdr, processDot11Hdr)) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set the rx frame format.\n")); - } - -#if defined(INIT_MODE_DRV_ENABLED) && defined(ENABLE_COEXISTENCE) - /* Configure the type of BT collocated with WLAN */ - A_MEMZERO(&sbcb_cmd, sizeof(WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD)); -#ifdef CONFIG_AR600x_BT_QCOM - sbcb_cmd.btcoexCoLocatedBTdev = 1; -#elif defined(CONFIG_AR600x_BT_CSR) - sbcb_cmd.btcoexCoLocatedBTdev = 2; -#elif defined(CONFIG_AR600x_BT_AR3001) - sbcb_cmd.btcoexCoLocatedBTdev = 3; -#else -#error Unsupported Bluetooth Type -#endif /* Collocated Bluetooth Type */ - - if ((wmi_set_btcoex_colocated_bt_dev_cmd(arPriv->arWmi, &sbcb_cmd)) != A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set collocated BT type\n")); - } - - /* Configure the type of BT collocated with WLAN */ - A_MEMZERO(&sbfa_cmd, sizeof(WMI_SET_BTCOEX_FE_ANT_CMD)); -#ifdef CONFIG_AR600x_DUAL_ANTENNA - sbfa_cmd.btcoexFeAntType = 2; -#elif defined(CONFIG_AR600x_SINGLE_ANTENNA) - sbfa_cmd.btcoexFeAntType = 1; -#else -#error Unsupported Front-End Antenna Configuration -#endif /* AR600x Front-End Antenna Configuration */ - - if ((wmi_set_btcoex_fe_ant_cmd(arPriv->arWmi, &sbfa_cmd)) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set fornt end antenna configuration\n")); - } -#endif /* INIT_MODE_DRV_ENABLED && ENABLE_COEXISTENCE */ - } - - ar->arNumDataEndPts = 1; - - if (bypasswmi) { - /* for tests like endpoint ping, the MAC address needs to be non-zero otherwise - * the data path through a raw socket is disabled */ - dev->dev_addr[0] = 0x00; - dev->dev_addr[1] = 0x01; - dev->dev_addr[2] = 0x02; - dev->dev_addr[3] = 0xAA; - dev->dev_addr[4] = 0xBB; - dev->dev_addr[5] = 0xCC; - } - - -ar6000_init_done: - rtnl_lock(); - dev_put(dev); - - return ret; - -} - - -void -ar6000_bitrate_rx(void *devt, A_INT32 rateKbps) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)devt; - - arPriv->arBitRate = rateKbps; - wake_up(&arPriv->arEvent); -} - -void -ar6000_ratemask_rx(void *devt, A_UINT32 *ratemask) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)devt; - - arPriv->arRateMask[0] = ratemask[0]; - arPriv->arRateMask[1] = ratemask[1]; - wake_up(&arPriv->arEvent); -} - -void -ar6000_txPwr_rx(void *devt, A_UINT8 txPwr) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)devt; - - arPriv->arTxPwr = txPwr; - wake_up(&arPriv->arEvent); -} - - -void -ar6000_channelList_rx(void *devt, A_INT8 numChan, A_UINT16 *chanList) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)devt; - - A_MEMCPY(arPriv->arSta.arChannelList, chanList, numChan * sizeof (A_UINT16)); - arPriv->arSta.arNumChannels = numChan; - - wake_up(&arPriv->arEvent); -} - -A_UINT8 -ar6000_ibss_map_epid(struct sk_buff *skb, struct net_device *dev, A_UINT32 * mapNo) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - AR_SOFTC_T *ar = arPriv->arSoftc; - A_UINT8 *datap; - ATH_MAC_HDR *macHdr; - A_UINT32 i, eptMap; - - (*mapNo) = 0; - datap = A_NETBUF_DATA(skb); - macHdr = (ATH_MAC_HDR *)(datap + sizeof(WMI_DATA_HDR)); - if (IEEE80211_IS_MULTICAST(macHdr->dstMac)) { - return ENDPOINT_2; - } - - eptMap = -1; - for (i = 0; i < arSta->arNodeNum; i ++) { - if (IEEE80211_ADDR_EQ(macHdr->dstMac, arSta->arNodeMap[i].macAddress)) { - (*mapNo) = i + 1; - arSta->arNodeMap[i].txPending ++; - return arSta->arNodeMap[i].epId; - } - - if ((eptMap == -1) && !arSta->arNodeMap[i].txPending) { - eptMap = i; - } - } - - if (eptMap == -1) { - eptMap = arSta->arNodeNum; - arSta->arNodeNum ++; - A_ASSERT(arSta->arNodeNum <= MAX_NODE_NUM); - } - - A_MEMCPY(arSta->arNodeMap[eptMap].macAddress, macHdr->dstMac, IEEE80211_ADDR_LEN); - - for (i = ENDPOINT_2; i <= ENDPOINT_5; i ++) { - if (!ar->arTxPending[i]) { - arSta->arNodeMap[eptMap].epId = i; - break; - } - // No free endpoint is available, start redistribution on the inuse endpoints. - if (i == ENDPOINT_5) { - arSta->arNodeMap[eptMap].epId = arSta->arNexEpId; - arSta->arNexEpId ++; - if (arSta->arNexEpId > ENDPOINT_5) { - arSta->arNexEpId = ENDPOINT_2; - } - } - } - - (*mapNo) = eptMap + 1; - arSta->arNodeMap[eptMap].txPending ++; - - return arSta->arNodeMap[eptMap].epId; -} - -#ifdef DEBUG -static void ar6000_dump_skb(struct sk_buff *skb) -{ - u_char *ch; - for (ch = A_NETBUF_DATA(skb); - (A_UINT32)ch < ((A_UINT32)A_NETBUF_DATA(skb) + - A_NETBUF_LEN(skb)); ch++) - { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN,("%2.2x ", *ch)); - } - AR_DEBUG_PRINTF(ATH_DEBUG_WARN,("\n")); -} -#endif - -#ifdef HTC_TEST_SEND_PKTS -static void DoHTCSendPktsTest(AR_SOFTC_T *ar, int MapNo, HTC_ENDPOINT_ID eid, struct sk_buff *skb); -#endif - -void -check_addba_state(AR_SOFTC_DEV_T *arPriv, struct sk_buff *skb, conn_t *conn) -{ - A_UINT8 *datap; - A_UINT8 tid = 0; - WMI_DATA_HDR *dtHdr; - - /* Perform ADDBA if required */ - if(conn && (conn->wmode == MODE_11NG_HT20)) { - datap = A_NETBUF_DATA(skb); - dtHdr = (WMI_DATA_HDR *)datap; - tid = WMI_DATA_HDR_GET_UP(dtHdr); - - if(conn->ba_state[tid] < 3) { - wmi_setup_aggr_cmd(arPriv->arWmi, tid | (conn->aid << 4)); - conn->ba_state[tid]++; - } - } -} - -static int -ar6000_data_tx(struct sk_buff *skb, struct net_device *dev) -{ -#define AC_NOT_MAPPED 99 - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - AR_SOFTC_AP_T *arAp = &arPriv->arAp; - A_UINT8 ac = AC_NOT_MAPPED; - HTC_ENDPOINT_ID eid = ENDPOINT_UNUSED; - A_UINT32 mapNo = 0; - int len; - struct ar_cookie *cookie; - A_BOOL checkAdHocPsMapping = FALSE; - HTC_TX_TAG htc_tag = AR6K_DATA_PKT_TAG; - A_UINT8 dot11Hdr = processDot11Hdr; - A_UINT8 check_addba = 0; - conn_t *conn = NULL; - A_UINT32 wmiDataFlags = 0; - -#ifdef AR6K_ALLOC_DEBUG - A_NETBUF_CHECK(skb); -#endif - -#ifdef CONFIG_PM - if ((ar->arWowState != WLAN_WOW_STATE_NONE) || (ar->arWlanState == WLAN_DISABLED)) { - A_NETBUF_FREE(skb); - return 0; - } -#endif /* CONFIG_PM */ -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,13) - skb->list = NULL; -#endif - - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_TX,("ar6000_data_tx start - skb=0x%x, data=0x%x, len=0x%x\n", - (A_UINT32)skb, (A_UINT32)A_NETBUF_DATA(skb), - A_NETBUF_LEN(skb))); - - /* If target is not associated */ - if( (!arPriv->arConnected && !bypasswmi) -#ifdef CONFIG_HOST_TCMD_SUPPORT - /* TCMD doesnt support any data, free the buf and return */ - || (ar->arTargetMode == AR6000_TCMD_MODE) -#endif - ) { - A_NETBUF_FREE(skb); - return 0; - } - - do { - - if (ar->arWmiReady == FALSE && bypasswmi == 0) { - break; - } - -#ifdef BLOCK_TX_PATH_FLAG - if (blocktx) { - break; - } -#endif /* BLOCK_TX_PATH_FLAG */ - - /* AP mode Power save processing */ - /* If the dst STA is in sleep state, queue the pkt in its PS queue */ - - if (arPriv->arNetworkType == AP_NETWORK) { - ATH_MAC_HDR *datap = (ATH_MAC_HDR *)A_NETBUF_DATA(skb); - - /* If the dstMac is a Multicast address & atleast one of the - * associated STA is in PS mode, then queue the pkt to the - * mcastq - */ - if (IEEE80211_IS_MULTICAST(datap->dstMac)) { - A_UINT8 ctr=0; - A_BOOL qMcast=FALSE; - - for (ctr=0; ctrconnTbl[ctr].arPriv == arPriv) { - if (STA_IS_PWR_SLEEP((&ar->connTbl[ctr]))) { - qMcast = TRUE; - } - } - } - if(qMcast) { - /* If this transmit is not because of a Dtim Expiry q it */ - if (arAp->DTIMExpired == FALSE) { - A_BOOL isMcastqEmpty = FALSE; - - A_MUTEX_LOCK(&arAp->mcastpsqLock); - isMcastqEmpty = A_NETBUF_QUEUE_EMPTY(&arAp->mcastpsq); - A_NETBUF_ENQUEUE(&arAp->mcastpsq, skb); - A_MUTEX_UNLOCK(&arAp->mcastpsqLock); - - /* If this is the first Mcast pkt getting queued - * indicate to the target to set the BitmapControl LSB - * of the TIM IE. - */ - if (isMcastqEmpty) { - wmi_set_pvb_cmd(arPriv->arWmi, MCAST_AID, 1); - } - return 0; - } else { - /* This transmit is because of Dtim expiry. Determine if - * MoreData bit has to be set. - */ - A_MUTEX_LOCK(&arAp->mcastpsqLock); - if(!A_NETBUF_QUEUE_EMPTY(&arAp->mcastpsq)) { - wmiDataFlags |= WMI_DATA_HDR_FLAGS_MORE; - } - A_MUTEX_UNLOCK(&arAp->mcastpsqLock); - } - } - } else { - conn = ieee80211_find_conn(arPriv, datap->dstMac); - if (conn) { - if (STA_IS_PWR_SLEEP(conn)) { - /* If this transmit is not because of a PsPoll q it*/ - if (!(STA_IS_PS_POLLED(conn) || STA_IS_APSD_TRIGGER(conn))) { - A_BOOL trigger = FALSE; - - if (conn->apsd_info) { - A_UINT8 up = 0; - A_UINT8 trafficClass; - - if (arPriv->arWmmEnabled) { - A_UINT16 ipType = IP_ETHERTYPE; - A_UINT16 etherType; - A_UINT8 *ipHdr; - - etherType = datap->typeOrLen; - if (IS_ETHERTYPE(A_BE2CPU16(etherType))) { - /* packet is in DIX format */ - ipHdr = (A_UINT8 *)(datap + 1); - } else { - /* packet is in 802.3 format */ - ATH_LLC_SNAP_HDR *llcHdr; - - llcHdr = (ATH_LLC_SNAP_HDR *)(datap + 1); - etherType = llcHdr->etherType; - ipHdr = (A_UINT8 *)(llcHdr + 1); - } - - if (etherType == A_CPU2BE16(ipType)) { - up = wmi_determine_userPriority (ipHdr, 0); - } - } - trafficClass = convert_userPriority_to_trafficClass(up); - if (conn->apsd_info & (1 << trafficClass)) { - trigger = TRUE; - } - } - - if (trigger) { - A_BOOL isApsdqEmpty; - /* Queue the frames if the STA is sleeping */ - A_MUTEX_LOCK(&conn->psqLock); - isApsdqEmpty = A_NETBUF_QUEUE_EMPTY(&conn->apsdq); - A_NETBUF_ENQUEUE(&conn->apsdq, skb); - A_MUTEX_UNLOCK(&conn->psqLock); - - /* If this is the first pkt getting queued - * for this STA, update the PVB for this STA - */ - if (isApsdqEmpty) { - wmi_set_apsd_buffered_traffic_cmd(arPriv->arWmi, conn->aid, 1, 0); - } - } else { - A_BOOL isPsqEmpty = FALSE; - /* Queue the frames if the STA is sleeping */ - A_MUTEX_LOCK(&conn->psqLock); - isPsqEmpty = A_NETBUF_QUEUE_EMPTY(&conn->psq); - A_NETBUF_ENQUEUE(&conn->psq, skb); - A_MUTEX_UNLOCK(&conn->psqLock); - - /* If this is the first pkt getting queued - * for this STA, update the PVB for this STA - */ - if (isPsqEmpty) { - wmi_set_pvb_cmd(arPriv->arWmi, conn->aid, 1); - } - } - - return 0; - } else { - /* - * This tx is because of a PsPoll or trigger. Determine if - * MoreData bit has to be set - */ - A_MUTEX_LOCK(&conn->psqLock); - if (STA_IS_PS_POLLED(conn)) { - if (!A_NETBUF_QUEUE_EMPTY(&conn->psq)) { - wmiDataFlags |= WMI_DATA_HDR_FLAGS_MORE; - } - } else { - /* - * This tx is because of a uAPSD trigger, determine - * more and EOSP bit. Set EOSP is queue is empty - * or sufficient frames is delivered for this trigger - */ - if (!A_NETBUF_QUEUE_EMPTY(&conn->apsdq)) { - wmiDataFlags |= WMI_DATA_HDR_FLAGS_MORE; - } - if (STA_IS_APSD_EOSP(conn)) { - wmiDataFlags |= WMI_DATA_HDR_FLAGS_EOSP; - } - } - A_MUTEX_UNLOCK(&conn->psqLock); - } - } - check_addba = 1; - } else { - - /* non existent STA. drop the frame */ - A_NETBUF_FREE(skb); - return 0; - } - } - } - - if (arPriv->arWmiEnabled) { -#ifdef CONFIG_CHECKSUM_OFFLOAD - A_UINT8 csumStart=0; - A_UINT8 csumDest=0; - A_UINT8 csum=skb->ip_summed; - if(csumOffload && (csum==CHECKSUM_PARTIAL)){ - csumStart=skb->csum_start-(skb->network_header-skb->head)+sizeof(ATH_LLC_SNAP_HDR); - csumDest=skb->csum_offset+csumStart; - } -#endif - if (A_NETBUF_HEADROOM(skb) < dev->hard_header_len - LINUX_HACK_FUDGE_FACTOR) { - struct sk_buff *newbuf; - - /* - * We really should have gotten enough headroom but sometimes - * we still get packets with not enough headroom. Copy the packet. - */ - len = A_NETBUF_LEN(skb); - newbuf = A_NETBUF_ALLOC(len); - if (newbuf == NULL) { - break; - } - A_NETBUF_PUT(newbuf, len); - A_MEMCPY(A_NETBUF_DATA(newbuf), A_NETBUF_DATA(skb), len); - A_NETBUF_FREE(skb); - skb = newbuf; - /* fall through and assemble header */ - } - - if (dot11Hdr) { - if (wmi_dot11_hdr_add(arPriv->arWmi,skb,arPriv->arNetworkType) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_data_tx-wmi_dot11_hdr_add failed\n")); - break; - } - } else { - if (wmi_dix_2_dot3(arPriv->arWmi, skb) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_data_tx - wmi_dix_2_dot3 failed\n")); - break; - } - } -#ifdef CONFIG_CHECKSUM_OFFLOAD - if(csumOffload && (csum ==CHECKSUM_PARTIAL)){ - WMI_TX_META_V2 metaV2; - metaV2.csumStart =csumStart; - metaV2.csumDest = csumDest; - metaV2.csumFlags = 0x1;/*instruct target to calculate checksum*/ - if (wmi_data_hdr_add(arPriv->arWmi, skb, DATA_MSGTYPE, wmiDataFlags, dot11Hdr, - WMI_META_VERSION_2,&metaV2) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_data_tx - wmi_data_hdr_add failed\n")); - break; - } - - } - else -#endif - { - if (wmi_data_hdr_add(arPriv->arWmi, skb, DATA_MSGTYPE, wmiDataFlags, dot11Hdr,0,NULL) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_data_tx - wmi_data_hdr_add failed\n")); - break; - } - } - - - if ((arPriv->arNetworkType == ADHOC_NETWORK) && - arSta->arIbssPsEnable && arPriv->arConnected) { - /* flag to check adhoc mapping once we take the lock below: */ - checkAdHocPsMapping = TRUE; - - } else { - /* get the stream mapping */ - ac = wmi_implicit_create_pstream(arPriv->arWmi, skb, 0, arPriv->arWmmEnabled); - if(check_addba && conn) { - check_addba_state(arPriv, skb, conn); - } - } - - } else { - EPPING_HEADER *eppingHdr; - - eppingHdr = A_NETBUF_DATA(skb); - - if (IS_EPPING_PACKET(eppingHdr)) { - /* the stream ID is mapped to an access class */ - ac = eppingHdr->StreamNo_h; - /* some EPPING packets cannot be dropped no matter what access class it was - * sent on. We can change the packet tag to guarantee it will not get dropped */ - if (IS_EPING_PACKET_NO_DROP(eppingHdr)) { - htc_tag = AR6K_CONTROL_PKT_TAG; - } - - if (ac == HCI_TRANSPORT_STREAM_NUM) { - /* pass this to HCI */ -#ifndef EXPORT_HCI_BRIDGE_INTERFACE - if (A_SUCCESS(hci_test_send(ar,skb))) { - return 0; - } -#endif - /* set AC to discard this skb */ - ac = AC_NOT_MAPPED; - } else { - /* a quirk of linux, the payload of the frame is 32-bit aligned and thus the addition - * of the HTC header will mis-align the start of the HTC frame, so we add some - * padding which will be stripped off in the target */ - if (EPPING_ALIGNMENT_PAD > 0) { - A_NETBUF_PUSH(skb, EPPING_ALIGNMENT_PAD); - } - } - - } else { - /* not a ping packet, drop it */ - ac = AC_NOT_MAPPED; - } - } - - } while (FALSE); - - /* did we succeed ? */ - if ((ac == AC_NOT_MAPPED) && !checkAdHocPsMapping) { - /* cleanup and exit */ - A_NETBUF_FREE(skb); - AR6000_STAT_INC(arPriv, tx_dropped); - AR6000_STAT_INC(arPriv, tx_aborted_errors); - return 0; - } - - cookie = NULL; - - /* take the lock to protect driver data */ - AR6000_SPIN_LOCK(&ar->arLock, 0); - - do { - - if (checkAdHocPsMapping) { - eid = ar6000_ibss_map_epid(skb, dev, &mapNo); - }else { - eid = arAc2EndpointID (ar, ac); - } - /* validate that the endpoint is connected */ - if (eid == 0 || eid == ENDPOINT_UNUSED ) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" eid %d is NOT mapped!\n", eid)); - break; - } - /* allocate resource for this packet */ - cookie = ar6000_alloc_cookie(ar); - - if (cookie != NULL) { - /* update counts while the lock is held */ - ar->arTxPending[eid]++; - ar->arTotalTxDataPending++; - } - - } while (FALSE); - - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - - if (cookie != NULL) { - cookie->arc_bp[0] = (A_UINT32)skb; - cookie->arc_bp[1] = mapNo; - SET_HTC_PACKET_INFO_TX(&cookie->HtcPkt, - cookie, - A_NETBUF_DATA(skb), - A_NETBUF_LEN(skb), - eid, - htc_tag); - -#ifdef DEBUG - if (debugdriver >= 3) { - ar6000_dump_skb(skb); - } -#endif -#ifdef HTC_TEST_SEND_PKTS - DoHTCSendPktsTest(ar,mapNo,eid,skb); -#endif - /* HTC interface is asynchronous, if this fails, cleanup will happen in - * the ar6000_tx_complete callback */ - HTCSendPkt(ar->arHtcTarget, &cookie->HtcPkt); - } else { - /* no packet to send, cleanup */ - A_NETBUF_FREE(skb); - AR6000_STAT_INC(arPriv, tx_dropped); - AR6000_STAT_INC(arPriv, tx_aborted_errors); - } - - return 0; -} - -int -ar6000_acl_data_tx(struct sk_buff *skb, AR_SOFTC_DEV_T *arPriv) -{ - struct ar_cookie *cookie; - AR_SOFTC_T *ar = arPriv->arSoftc; - HTC_ENDPOINT_ID eid = ENDPOINT_UNUSED; - - cookie = NULL; - AR6000_SPIN_LOCK(&ar->arLock, 0); - - /* For now we send ACL on BE endpoint: We can also have a dedicated EP */ - eid = arAc2EndpointID (ar, 0); - /* allocate resource for this packet */ - cookie = ar6000_alloc_cookie(ar); - - if (cookie != NULL) { - /* update counts while the lock is held */ - ar->arTxPending[eid]++; - ar->arTotalTxDataPending++; - } - - - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - - if (cookie != NULL) { - cookie->arc_bp[0] = (A_UINT32)skb; - cookie->arc_bp[1] = 0; - SET_HTC_PACKET_INFO_TX(&cookie->HtcPkt, - cookie, - A_NETBUF_DATA(skb), - A_NETBUF_LEN(skb), - eid, - AR6K_DATA_PKT_TAG); - - /* HTC interface is asynchronous, if this fails, cleanup will happen in - * the ar6000_tx_complete callback */ - HTCSendPkt(ar->arHtcTarget, &cookie->HtcPkt); - } else { - /* no packet to send, cleanup */ - A_NETBUF_FREE(skb); - AR6000_STAT_INC(arPriv, tx_dropped); - AR6000_STAT_INC(arPriv, tx_aborted_errors); - } - return 0; -} - - -#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL -static void -tvsub(register struct timeval *out, register struct timeval *in) -{ - if((out->tv_usec -= in->tv_usec) < 0) { - out->tv_sec--; - out->tv_usec += 1000000; - } - out->tv_sec -= in->tv_sec; -} - -void -applyAPTCHeuristics(AR_SOFTC_DEV_T *arPriv) -{ - A_UINT32 duration; - A_UINT32 numbytes; - A_UINT32 throughput; - struct timeval ts; - A_STATUS status; - APTC_TRAFFIC_RECORD *aptcTR; - AR_SOFTC_T *ar = arPriv->arSoftc; - - aptcTR = arPriv->aptcTR; - - AR6000_SPIN_LOCK(&arPriv->arPrivLock, 0); - - if ((enableAPTCHeuristics) && (!aptcTR->timerScheduled)) { - do_gettimeofday(&ts); - tvsub(&ts, &aptcTR->samplingTS); - duration = ts.tv_sec * 1000 + ts.tv_usec / 1000; /* ms */ - numbytes = aptcTR->bytesTransmitted + aptcTR->bytesReceived; - - if (duration > APTC_TRAFFIC_SAMPLING_INTERVAL) { - /* Initialize the time stamp and byte count */ - aptcTR->bytesTransmitted = aptcTR->bytesReceived = 0; - do_gettimeofday(&aptcTR->samplingTS); - - /* Calculate and decide based on throughput thresholds */ - throughput = ((numbytes * 8) / duration); - if (throughput > APTC_UPPER_THROUGHPUT_THRESHOLD) { - /* Disable Sleep and schedule a timer */ - A_ASSERT(ar->arWmiReady == TRUE); - AR6000_SPIN_UNLOCK(&arPriv->ariPrivLock, 0); - status = wmi_powermode_cmd(arPriv->arWmi, MAX_PERF_POWER); - AR6000_SPIN_LOCK(&arPriv->arPrivLock, 0); - A_TIMEOUT_MS(&aptcTimer[arPriv->arDeviceIndex], APTC_TRAFFIC_SAMPLING_INTERVAL, 0); - aptcTR->timerScheduled = TRUE; - } - } - } - - AR6000_SPIN_UNLOCK(&arPriv->arLock, 0); -} -#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */ - -static HTC_SEND_FULL_ACTION ar6000_tx_queue_full(void *Context, HTC_PACKET *pPacket) -{ - AR_SOFTC_T *ar = (AR_SOFTC_T *)Context; - HTC_SEND_FULL_ACTION action = HTC_SEND_FULL_KEEP; - A_BOOL stopNet = FALSE; - HTC_ENDPOINT_ID Endpoint = HTC_GET_ENDPOINT_FROM_PKT(pPacket); - A_UINT8 i; - AR_SOFTC_DEV_T *arPriv; - - do { - - if (bypasswmi) { - int accessClass; - - if (HTC_GET_TAG_FROM_PKT(pPacket) == AR6K_CONTROL_PKT_TAG) { - /* don't drop special control packets */ - break; - } - - accessClass = arEndpoint2Ac(ar,Endpoint); - /* for endpoint ping testing drop Best Effort and Background */ - if ((accessClass == WMM_AC_BE) || (accessClass == WMM_AC_BK)) { - action = HTC_SEND_FULL_DROP; - stopNet = FALSE; - } else { - /* keep but stop the netqueues */ - stopNet = TRUE; - } - break; - } - - if (Endpoint == ar->arControlEp) { - /* under normal WMI if this is getting full, then something is running rampant - * the host should not be exhausting the WMI queue with too many commands - * the only exception to this is during testing using endpointping */ - AR6000_SPIN_LOCK(&ar->arLock, 0); - /* set flag to handle subsequent messages */ - ar->arWMIControlEpFull = TRUE; - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("WMI Control Endpoint is FULL!!! \n")); - /* no need to stop the network */ - stopNet = FALSE; - break; - } - - /* if we get here, we are dealing with data endpoints getting full */ - - if (HTC_GET_TAG_FROM_PKT(pPacket) == AR6K_CONTROL_PKT_TAG) { - /* don't drop control packets issued on ANY data endpoint */ - break; - } - - /* the last MAX_HI_COOKIE_NUM "batch" of cookies are reserved for the highest - * active stream */ - if (ar->arAcStreamPriMap[arEndpoint2Ac(ar,Endpoint)] < ar->arHiAcStreamActivePri && - ar->arCookieCount <= MAX_HI_COOKIE_NUM) { - /* this stream's priority is less than the highest active priority, we - * give preference to the highest priority stream by directing - * HTC to drop the packet that overflowed */ - action = HTC_SEND_FULL_DROP; - /* since we are dropping packets, no need to stop the network */ - stopNet = FALSE; - break; - } - - } while (FALSE); - - if (stopNet) { - for(i = 0; i < num_device; i++) - { - arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(ar6000_devices[i]); - AR6000_SPIN_LOCK(&arPriv->arPrivLock, 0); - arPriv->arNetQueueStopped = TRUE; - AR6000_SPIN_UNLOCK(&arPriv->arPrivLock, 0); - /* one of the data endpoints queues is getting full..need to stop network stack - * the queue will resume in ar6000_tx_complete() */ - netif_stop_queue(ar6000_devices[i]); - } - } - else - { - /* in adhoc mode, we cannot differentiate traffic priorities so there is no need to - * continue, however we should stop the network */ - for(i = 0; i < num_device; i++) - { - arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(ar6000_devices[i]); - if(arPriv->arNetworkType == ADHOC_NETWORK) { - AR6000_SPIN_LOCK(&arPriv->arPrivLock, 0); - arPriv->arNetQueueStopped = TRUE; - AR6000_SPIN_UNLOCK(&arPriv->arPrivLock, 0); - /* one of the data endpoints queues is getting full..need to stop network stack - * the queue will resume in ar6000_tx_complete() */ - netif_stop_queue(ar6000_devices[i]); - } - } - } - return action; -} - - -static void -ar6000_tx_complete(void *Context, HTC_PACKET_QUEUE *pPacketQueue) -{ - AR_SOFTC_T *ar = (AR_SOFTC_T *)Context; - A_UINT32 mapNo = 0; - A_STATUS status; - struct ar_cookie * ar_cookie; - HTC_ENDPOINT_ID eid; - A_BOOL wakeEvent = FALSE; - struct sk_buff_head skb_queue; - HTC_PACKET *pPacket; - struct sk_buff *pktSkb; - A_BOOL flushing[NUM_DEV]; - A_INT8 devid = -1; - AR_SOFTC_DEV_T *arPriv = NULL; - AR_SOFTC_STA_T *arSta; - A_UINT8 i; - - skb_queue_head_init(&skb_queue); - - /* lock the driver as we update internal state */ - AR6000_SPIN_LOCK(&ar->arLock, 0); - - /* reap completed packets */ - while (!HTC_QUEUE_EMPTY(pPacketQueue)) { - - pPacket = HTC_PACKET_DEQUEUE(pPacketQueue); - - ar_cookie = (struct ar_cookie *)pPacket->pPktContext; - A_ASSERT(ar_cookie); - - status = pPacket->Status; - pktSkb = (struct sk_buff *)ar_cookie->arc_bp[0]; - eid = pPacket->Endpoint; - mapNo = ar_cookie->arc_bp[1]; - - A_ASSERT(pktSkb); - A_ASSERT(pPacket->pBuffer == A_NETBUF_DATA(pktSkb)); - - /* add this to the list, use faster non-lock API */ - __skb_queue_tail(&skb_queue,pktSkb); - - if (A_SUCCESS(status)) { - A_ASSERT(pPacket->ActualLength == A_NETBUF_LEN(pktSkb)); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_TX,("ar6000_tx_complete skb=0x%x data=0x%x len=0x%x eid=%d ", - (A_UINT32)pktSkb, (A_UINT32)pPacket->pBuffer, - pPacket->ActualLength, - eid)); - - ar->arTxPending[eid]--; - - if(!bypasswmi) - { - - if (eid != ar->arControlEp) { - WMI_DATA_HDR *dhdr = (WMI_DATA_HDR *)A_NETBUF_DATA(pktSkb); - ar->arTotalTxDataPending--; - devid = WMI_DATA_HDR_GET_DEVID(dhdr); - arPriv = ar->arDev[devid]; - } - - if (eid == ar->arControlEp) - { - WMI_CMD_HDR *cmhdr = (WMI_CMD_HDR*)A_NETBUF_DATA(pktSkb); - if (ar->arWMIControlEpFull) { - /* since this packet completed, the WMI EP is no longer full */ - ar->arWMIControlEpFull = FALSE; -#ifdef ANDROID_ENV - android_epfull_cnt = 0; -#endif - } - - if (ar->arTxPending[eid] == 0) { - wakeEvent = TRUE; - } - devid = WMI_CMD_HDR_GET_DEVID(cmhdr); - arPriv = ar->arDev[devid]; - } - } - else - { - devid = 0; - arPriv = ar->arDev[devid]; - } - - - if (A_FAILED(status)) { - if (status == A_ECANCELED) { - /* a packet was flushed */ - flushing[devid] = TRUE; - } - AR6000_STAT_INC(arPriv, tx_errors); - if (status != A_NO_RESOURCE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s() -TX ERROR, status: 0x%x\n", __func__, - status)); - } - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_TX,("OK\n")); - flushing[devid] = FALSE; - AR6000_STAT_INC(arPriv, tx_packets); - arPriv->arNetStats.tx_bytes += A_NETBUF_LEN(pktSkb); -#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL - arPriv->aptcTR.bytesTransmitted += a_netbuf_to_len(pktSkb); - applyAPTCHeuristics(arPriv); -#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */ - } - - // TODO this needs to be looked at - if (arPriv->arNetworkType == ADHOC_NETWORK) - { - arSta = &arPriv->arSta; - if((arSta->arIbssPsEnable && (eid != ar->arControlEp) && mapNo)) - { - mapNo --; - arSta->arNodeMap[mapNo].txPending --; - - if (!arSta->arNodeMap[mapNo].txPending && (mapNo == (arSta->arNodeNum - 1))) { - A_UINT32 i; - for (i = arSta->arNodeNum; i > 0; i --) { - if (!arSta->arNodeMap[i - 1].txPending) { - A_MEMZERO(&arSta->arNodeMap[i - 1], sizeof(struct ar_node_mapping)); - arSta->arNodeNum --; - } else { - break; - } - } - } - } - } - - ar6000_free_cookie(ar, ar_cookie); - - if (arPriv->arNetQueueStopped) { - arPriv->arNetQueueStopped = FALSE; - } - } - - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - - /* lock is released, we can freely call other kernel APIs */ - - /* free all skbs in our local list */ - while (!skb_queue_empty(&skb_queue)) { - /* use non-lock version */ - pktSkb = __skb_dequeue(&skb_queue); - A_NETBUF_FREE(pktSkb); - } - for(i = 0; i < num_device; i++) { - arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(ar6000_devices[i]); - if (((arPriv->arNetworkType == INFRA_NETWORK ) && (arPriv->arConnected == TRUE)) - || (bypasswmi)) { - if (!flushing[i]) { - /* don't wake the queue if we are flushing, other wise it will just - * keep queueing packets, which will keep failing */ - - netif_wake_queue(arPriv->arNetDev); - } - } - - if (wakeEvent) { - wake_up(&arPriv->arEvent); - } - } - -} - -conn_t * -ieee80211_find_conn(AR_SOFTC_DEV_T *arPriv, A_UINT8 *node_addr) -{ - conn_t *conn = NULL; - A_UINT8 i; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (IS_MAC_NULL(node_addr)) { - return NULL; - } - - for (i = 0; i < NUM_CONN; i++) { - if (IEEE80211_ADDR_EQ(node_addr, ar->connTbl[i].mac)) { - conn = &ar->connTbl[i]; - break; - } - } - - return conn; -} - -conn_t *ieee80211_find_conn_for_aid(AR_SOFTC_DEV_T *arPriv, A_UINT8 aid) -{ - conn_t *conn = NULL; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (arPriv->arNetworkType != AP_NETWORK) { - conn = NULL; - } else if( (aid > 0) && (aid < NUM_CONN) ) { - if (ar->connTbl[aid-1].aid == aid) { - conn = &ar->connTbl[aid-1]; - } - } - return conn; -} - -void *get_aggr_ctx(AR_SOFTC_DEV_T *arPriv, conn_t *conn) -{ - if (arPriv->arNetworkType != AP_NETWORK) { - return (arPriv->conn_aggr); - } else { - return (conn->conn_aggr); - } -} - -/* - * Receive event handler. This is called by HTC when a packet is received - */ -int pktcount; -static void -ar6000_rx(void *Context, HTC_PACKET *pPacket) -{ - AR_SOFTC_T *ar = (AR_SOFTC_T *)Context; - struct sk_buff *skb = (struct sk_buff *)pPacket->pPktContext; - int minHdrLen; - A_UINT8 containsDot11Hdr = 0; - A_STATUS status = pPacket->Status; - HTC_ENDPOINT_ID ept = pPacket->Endpoint; - conn_t *conn = NULL; - AR_SOFTC_DEV_T *arPriv = NULL; - A_UINT8 devid ; - ATH_MAC_HDR *multicastcheck_datap = NULL; - - A_ASSERT((status != A_OK) || - (pPacket->pBuffer == (A_NETBUF_DATA(skb) + HTC_HEADER_LEN))); - - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_RX,("ar6000_rx ar=0x%x eid=%d, skb=0x%x, data=0x%x, len=0x%x status:%d", - (A_UINT32)ar, ept, (A_UINT32)skb, (A_UINT32)pPacket->pBuffer, - pPacket->ActualLength, status)); - - if (status != A_OK) { - if (status != A_ECANCELED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("RX ERR (%d) \n",status)); - } - A_NETBUF_FREE(skb); - goto rx_done; - } - - /* take lock to protect buffer counts - * and adaptive power throughput state */ - AR6000_SPIN_LOCK(&ar->arLock, 0); - A_NETBUF_PUT(skb, pPacket->ActualLength + HTC_HEADER_LEN); - A_NETBUF_PULL(skb, HTC_HEADER_LEN); - - if(!bypasswmi) - { - if(ept == ar->arControlEp) { - WMI_CMD_HDR *cmhdr = (WMI_CMD_HDR*)A_NETBUF_DATA(skb); - devid = WMI_CMD_HDR_GET_DEVID(cmhdr); - arPriv = ar->arDev[devid]; - } - else { - WMI_DATA_HDR *dhdr = (WMI_DATA_HDR *)A_NETBUF_DATA(skb); - devid = WMI_DATA_HDR_GET_DEVID(dhdr); - arPriv = ar->arDev[devid]; - } - } - else - { - devid = 0; - arPriv = ar->arDev[devid]; - } - - if (A_SUCCESS(status)) { - AR6000_STAT_INC(arPriv, rx_packets); - arPriv->arNetStats.rx_bytes += pPacket->ActualLength; -#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL - arPriv->aptcTR.bytesReceived += pPacket->ActualLength; - applyAPTCHeuristics(arPriv); -#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */ - - -#ifdef DEBUG - if (debugdriver >= 2) { - ar6000_dump_skb(skb); - } -#endif /* DEBUG */ - } - - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - - skb->dev = arPriv->arNetDev; - if (status != A_OK) { - AR6000_STAT_INC(arPriv, rx_errors); - A_NETBUF_FREE(skb); - } else if (arPriv->arWmiEnabled == TRUE) { - if (ept == ar->arControlEp) { - /* - * this is a wmi control msg - */ -#ifdef CONFIG_PM - ar6000_check_wow_status(ar, skb, TRUE); -#endif /* CONFIG_PM */ - wmi_control_rx(arPriv->arWmi, skb); - } else { - WMI_DATA_HDR *dhdr = (WMI_DATA_HDR *)A_NETBUF_DATA(skb); - A_UINT8 is_amsdu, tid, is_acl_data_frame; - is_acl_data_frame = WMI_DATA_HDR_GET_DATA_TYPE(dhdr) == WMI_DATA_HDR_DATA_TYPE_ACL; -#ifdef CONFIG_PM - ar6000_check_wow_status(ar, NULL, FALSE); -#endif /* CONFIG_PM */ - /* - * this is a wmi data packet - */ - // NWF - - if (processDot11Hdr) { - minHdrLen = sizeof(WMI_DATA_HDR) + sizeof(struct ieee80211_frame) + sizeof(ATH_LLC_SNAP_HDR); - } else { - minHdrLen = sizeof (WMI_DATA_HDR) + sizeof(ATH_MAC_HDR) + - sizeof(ATH_LLC_SNAP_HDR); - } - - /* In the case of AP mode we may receive NULL data frames - * that do not have LLC hdr. They are 16 bytes in size. - * Allow these frames in the AP mode. - * ACL data frames don't follow ethernet frame bounds for - * min length - */ - if (arPriv->arNetworkType != AP_NETWORK && !is_acl_data_frame && - ((pPacket->ActualLength < minHdrLen) || - (pPacket->ActualLength > AR6000_MAX_RX_MESSAGE_SIZE))) - { - /* - * packet is too short or too long - */ - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("TOO SHORT or TOO LONG\n")); - AR6000_STAT_INC(arPriv, rx_errors); - AR6000_STAT_INC(arPriv, rx_length_errors); - A_NETBUF_FREE(skb); - } else { - A_UINT16 seq_no; - A_UINT8 meta_type; - -#if 0 - /* Access RSSI values here */ - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("RSSI %d\n", - ((WMI_DATA_HDR *) A_NETBUF_DATA(skb))->rssi)); -#endif - /* Get the Power save state of the STA */ - if (arPriv->arNetworkType == AP_NETWORK) { - A_UINT8 psState=0,prevPsState; - ATH_MAC_HDR *datap=NULL; - A_UINT16 offset; - A_UINT8 triggerState; - - meta_type = WMI_DATA_HDR_GET_META(dhdr); - - psState = (((WMI_DATA_HDR *)A_NETBUF_DATA(skb))->info - >> WMI_DATA_HDR_PS_SHIFT) & WMI_DATA_HDR_PS_MASK; - triggerState = WMI_DATA_HDR_IS_TRIGGER(dhdr); - - - offset = sizeof(WMI_DATA_HDR); - - switch (meta_type) { - case 0: - break; - case WMI_META_VERSION_1: - offset += sizeof(WMI_RX_META_V1); - break; -#ifdef CONFIG_CHECKSUM_OFFLOAD - case WMI_META_VERSION_2: - offset += sizeof(WMI_RX_META_V2); - break; -#endif - default: - break; - } -#ifdef DIX_RX_OFFLOAD -#define SKIP_LLC_LEN 8 - /*DIX to ETHERNET hdr conversion is offloaded to firmware */ - /*Empty LLC header is moved to get ethernet header*/ - A_UINT32 datalen = (A_UINT32)A_NETBUF_LEN(skb)-offset; - - is_amsdu = WMI_DATA_HDR_IS_AMSDU(dhdr); - containsDot11Hdr = WMI_DATA_HDR_GET_DOT11(dhdr); - if(!containsDot11Hdr && !is_amsdu && !is_acl_data_frame - && datalen >= (sizeof(ATH_MAC_HDR) + sizeof(ATH_LLC_SNAP_HDR))) { - datap = (ATH_MAC_HDR *)((A_INT8*)A_NETBUF_DATA(skb)+offset+SKIP_LLC_LEN); - } - else { - datap = (ATH_MAC_HDR *)((A_INT8*)A_NETBUF_DATA(skb)+offset); - } - -#else - datap = (ATH_MAC_HDR *)(A_NETBUF_DATA(skb)+offset); -#endif - conn = ieee80211_find_conn(arPriv, datap->srcMac); - - if (conn) { - /* if there is a change in PS state of the STA, - * take appropriate steps. - * 1. If Sleep-->Awake, flush the psq for the STA - * Clear the PVB for the STA. - * 2. If Awake-->Sleep, Starting queueing frames - * the STA. - */ - prevPsState = STA_IS_PWR_SLEEP(conn); - if (psState) { - STA_SET_PWR_SLEEP(conn); - } else { - STA_CLR_PWR_SLEEP(conn); - } - - if (STA_IS_PWR_SLEEP(conn)) { - /* Accept trigger only when the station is in sleep */ - if (triggerState) { - ar6000_uapsd_trigger_frame_rx(arPriv, conn); - } - } - - if (prevPsState ^ STA_IS_PWR_SLEEP(conn)) { - A_BOOL isApsdqEmptyAtStart; - - if (!STA_IS_PWR_SLEEP(conn)) { - - A_MUTEX_LOCK(&conn->psqLock); - - while (!A_NETBUF_QUEUE_EMPTY(&conn->psq)) { - struct sk_buff *skb=NULL; - - skb = A_NETBUF_DEQUEUE(&conn->psq); - A_MUTEX_UNLOCK(&conn->psqLock); - ar6000_data_tx(skb,arPriv->arNetDev); - A_MUTEX_LOCK(&conn->psqLock); - } - - isApsdqEmptyAtStart = A_NETBUF_QUEUE_EMPTY(&conn->apsdq); - - while (!A_NETBUF_QUEUE_EMPTY(&conn->apsdq)) { - struct sk_buff *skb=NULL; - - skb = A_NETBUF_DEQUEUE(&conn->apsdq); - A_MUTEX_UNLOCK(&conn->psqLock); - ar6000_data_tx(skb,arPriv->arNetDev); - A_MUTEX_LOCK(&conn->psqLock); - } - - A_MUTEX_UNLOCK(&conn->psqLock); - - /* Clear the APSD buffered bitmap for this STA */ - if (!isApsdqEmptyAtStart) { - wmi_set_apsd_buffered_traffic_cmd(arPriv->arWmi, conn->aid, 0, 0); - } - - /* Clear the PVB for this STA */ - wmi_set_pvb_cmd(arPriv->arWmi, conn->aid, 0); - } - } - - } else { - /* This frame is from a STA that is not associated*/ - A_NETBUF_FREE(skb); - goto rx_done; - } - - /* Drop NULL data frames here */ - if((pPacket->ActualLength < minHdrLen) || - (pPacket->ActualLength > AR6000_MAX_RX_MESSAGE_SIZE)) { - A_NETBUF_FREE(skb); - goto rx_done; - } - } - - is_amsdu = WMI_DATA_HDR_IS_AMSDU(dhdr); - tid = WMI_DATA_HDR_GET_UP(dhdr); - seq_no = WMI_DATA_HDR_GET_SEQNO(dhdr); - meta_type = WMI_DATA_HDR_GET_META(dhdr); - containsDot11Hdr = WMI_DATA_HDR_GET_DOT11(dhdr); - - wmi_data_hdr_remove(arPriv->arWmi, skb); - - switch (meta_type) { - case WMI_META_VERSION_1: - { - WMI_RX_META_V1 *pMeta = (WMI_RX_META_V1 *)A_NETBUF_DATA(skb); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("META %d %d %d %d %x\n", pMeta->status, pMeta->rix, pMeta->rssi, pMeta->channel, pMeta->flags)); - A_NETBUF_PULL((void*)skb, sizeof(WMI_RX_META_V1)); - break; - } -#ifdef CONFIG_CHECKSUM_OFFLOAD - case WMI_META_VERSION_2: - { - WMI_RX_META_V2 *pMeta = (WMI_RX_META_V2 *)A_NETBUF_DATA(skb); - if(pMeta->csumFlags & 0x1){ - skb->ip_summed=CHECKSUM_COMPLETE; - skb->csum=(pMeta->csum); - } - A_NETBUF_PULL((void*)skb, sizeof(WMI_RX_META_V2)); - break; - } -#endif - default: - break; - } - - A_ASSERT(status == A_OK); - - /* NWF: print the 802.11 hdr bytes */ - if(containsDot11Hdr) { - status = wmi_dot11_hdr_remove(arPriv->arWmi,skb); - } else if(!is_amsdu && !is_acl_data_frame) { -#ifdef DIX_RX_OFFLOAD - /*Skip the conversion its offloaded to firmware*/ - if(A_NETBUF_PULL(skb, sizeof(ATH_LLC_SNAP_HDR)) != A_OK) { - status = A_NO_MEMORY; - } - else { - status = A_OK; - } -#else - status = wmi_dot3_2_dix(skb); -#endif - } - - if (status != A_OK) { - /* Drop frames that could not be processed (lack of memory, etc.) */ - A_NETBUF_FREE(skb); - goto rx_done; - } - - if (is_acl_data_frame) { - A_NETBUF_PUSH(skb, sizeof(int)); - *((short *)A_NETBUF_DATA(skb)) = WMI_ACL_DATA_EVENTID; - /* send the data packet to PAL driver */ - if(ar6k_pal_config_g.fpar6k_pal_recv_pkt) { - if((*ar6k_pal_config_g.fpar6k_pal_recv_pkt)(arPriv->hcipal_info, skb) == TRUE) - goto rx_done; - } - } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) - /* - * extra push and memcpy, for eth_type_trans() of 2.4 kernel - * will pull out hard_header_len bytes of the skb. - */ - A_NETBUF_PUSH(skb, sizeof(WMI_DATA_HDR) + sizeof(ATH_LLC_SNAP_HDR) + HTC_HEADER_LEN); - A_MEMCPY(A_NETBUF_DATA(skb), A_NETBUF_DATA(skb) + sizeof(WMI_DATA_HDR) + - sizeof(ATH_LLC_SNAP_HDR) + HTC_HEADER_LEN, sizeof(ATH_MAC_HDR)); -#endif - -#ifdef ATH_AR6K_11N_SUPPORT - multicastcheck_datap = (ATH_MAC_HDR *)A_NETBUF_DATA(skb); - - if ((!(IEEE80211_IS_MULTICAST(multicastcheck_datap->dstMac))) && (arPriv->arNetworkType != AP_NETWORK)){ - aggr_process_recv_frm(get_aggr_ctx(arPriv, conn), tid, seq_no, is_amsdu, (void **)&skb); - } -#endif - ar6000_deliver_frames_to_nw_stack((void *) arPriv->arNetDev, (void *)skb); - } - } - } else { - if (EPPING_ALIGNMENT_PAD > 0) { - A_NETBUF_PULL(skb, EPPING_ALIGNMENT_PAD); - } - ar6000_deliver_frames_to_nw_stack((void *)arPriv->arNetDev, (void *)skb); - } - -rx_done: - - return; -} - -static void -ar6000_deliver_frames_to_nw_stack(void *dev, void *osbuf) -{ - struct sk_buff *skb = (struct sk_buff *)osbuf; - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - if(skb) { - skb->dev = dev; - if ((skb->dev->flags & IFF_UP) == IFF_UP) { - - if (arPriv->arNetworkType == AP_NETWORK) { - - struct sk_buff *skb1 = NULL; - ATH_MAC_HDR *datap; - struct net_device *net_dev = arPriv->arNetDev; - -#ifdef CONFIG_PM - ar6000_check_wow_status(ar, skb, FALSE); -#endif /* CONFIG_PM */ - - - datap = (ATH_MAC_HDR *)A_NETBUF_DATA(skb); - - if (IEEE80211_IS_MULTICAST(datap->dstMac)) { - - /* Bcast/Mcast frames should be sent to the OS - * stack as well as on the air. - */ - skb1 = skb_copy(skb,GFP_ATOMIC); - } else { - - /* Search for a connected STA with dstMac as - * the Mac address. If found send the frame to - * it on the air else send the frame up the stack - */ - - AR_SOFTC_DEV_T *to_arPriv = NULL; - A_UINT8 is_forward = 0; - conn_t *to_conn = NULL; - - to_conn = ieee80211_find_conn(arPriv, datap->dstMac); - - if (to_conn) { - to_arPriv = (AR_SOFTC_DEV_T *)to_conn->arPriv; - /* Forward data within BSS */ - if(arPriv == to_arPriv) { - is_forward = arPriv->arAp.intra_bss; - } else { - /* Forward data within mBSS */ - is_forward = ar->inter_bss; - net_dev = to_arPriv->arNetDev; - } - if(is_forward && net_dev) { - skb1 = skb; - skb = NULL; - } else { - A_NETBUF_FREE(skb); - skb = NULL; - return; - } - } - - } - - if (skb1) { - ar6000_data_tx(skb1, net_dev); - if (!skb) - return; - } - } - -#ifdef CONFIG_PM - ar6000_check_wow_status(ar, skb, FALSE); -#endif /* CONFIG_PM */ - skb->protocol = eth_type_trans(skb, skb->dev); - /* - * If this routine is called on a ISR (Hard IRQ) or DSR (Soft IRQ) - * or tasklet use the netif_rx to deliver the packet to the stack - * netif_rx will queue the packet onto the receive queue and mark - * the softirq thread has a pending action to complete. Kernel will - * schedule the softIrq kernel thread after processing the DSR. - * - * If this routine is called on a process context, use netif_rx_ni - * which will schedle the softIrq kernel thread after queuing the packet. - */ - if (in_interrupt()) { - A_NETIF_RX(skb); - } else { - A_NETIF_RX_NI(skb); - } - } else { - A_NETBUF_FREE(skb); - } - } -} - -#if 0 -static void -ar6000_deliver_frames_to_bt_stack(void *dev, void *osbuf) -{ - struct sk_buff *skb = (struct sk_buff *)osbuf; - - if(skb) { - skb->dev = dev; - if ((skb->dev->flags & IFF_UP) == IFF_UP) { - skb->protocol = htons(ETH_P_CONTROL); - netif_rx(skb); - } else { - A_NETBUF_FREE(skb); - } - } -} -#endif - -static void -ar6000_rx_refill(void *Context, HTC_ENDPOINT_ID Endpoint) -{ - AR_SOFTC_T *ar = (AR_SOFTC_T *)Context; - void *osBuf; - int RxBuffers; - int buffersToRefill; - HTC_PACKET *pPacket; - HTC_PACKET_QUEUE queue; - - buffersToRefill = (int)AR6000_MAX_RX_BUFFERS - - HTCGetNumRecvBuffers(ar->arHtcTarget, Endpoint); - - if (buffersToRefill <= 0) { - /* fast return, nothing to fill */ - return; - } - - INIT_HTC_PACKET_QUEUE(&queue); - - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_RX,("ar6000_rx_refill: providing htc with %d buffers at eid=%d\n", - buffersToRefill, Endpoint)); - - for (RxBuffers = 0; RxBuffers < buffersToRefill; RxBuffers++) { - osBuf = A_NETBUF_ALLOC(AR6000_BUFFER_SIZE); - if (NULL == osBuf) { - break; - } - /* the HTC packet wrapper is at the head of the reserved area - * in the skb */ - pPacket = (HTC_PACKET *)(A_NETBUF_HEAD(osBuf)); - /* set re-fill info */ - SET_HTC_PACKET_INFO_RX_REFILL(pPacket,osBuf,A_NETBUF_DATA(osBuf),AR6000_BUFFER_SIZE,Endpoint); - /* add to queue */ - HTC_PACKET_ENQUEUE(&queue,pPacket); - } - - if (!HTC_QUEUE_EMPTY(&queue)) { - /* add packets */ - HTCAddReceivePktMultiple(ar->arHtcTarget, &queue); - } - -} - - /* clean up our amsdu buffer list */ -static void ar6000_cleanup_amsdu_rxbufs(AR_SOFTC_T *ar) -{ - HTC_PACKET *pPacket; - void *osBuf; - - /* empty AMSDU buffer queue and free OS bufs */ - while (TRUE) { - - AR6000_SPIN_LOCK(&ar->arLock, 0); - pPacket = HTC_PACKET_DEQUEUE(&ar->amsdu_rx_buffer_queue); - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - - if (NULL == pPacket) { - break; - } - - osBuf = pPacket->pPktContext; - if (NULL == osBuf) { - A_ASSERT(FALSE); - break; - } - - A_NETBUF_FREE(osBuf); - } - -} - - - /* refill the amsdu buffer list */ -static void ar6000_refill_amsdu_rxbufs(AR_SOFTC_T *ar, int Count) -{ - HTC_PACKET *pPacket; - void *osBuf; - - while (Count > 0) { - osBuf = A_NETBUF_ALLOC(AR6000_AMSDU_BUFFER_SIZE); - if (NULL == osBuf) { - break; - } - /* the HTC packet wrapper is at the head of the reserved area - * in the skb */ - pPacket = (HTC_PACKET *)(A_NETBUF_HEAD(osBuf)); - /* set re-fill info */ - SET_HTC_PACKET_INFO_RX_REFILL(pPacket,osBuf,A_NETBUF_DATA(osBuf),AR6000_AMSDU_BUFFER_SIZE,0); - - AR6000_SPIN_LOCK(&ar->arLock, 0); - /* put it in the list */ - HTC_PACKET_ENQUEUE(&ar->amsdu_rx_buffer_queue,pPacket); - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - Count--; - } - -} - - /* callback to allocate a large receive buffer for a pending packet. This function is called when - * an HTC packet arrives whose length exceeds a threshold value - * - * We use a pre-allocated list of buffers of maximum AMSDU size (4K). Under linux it is more optimal to - * keep the allocation size the same to optimize cached-slab allocations. - * - * */ -static HTC_PACKET *ar6000_alloc_amsdu_rxbuf(void *Context, HTC_ENDPOINT_ID Endpoint, int Length) -{ - HTC_PACKET *pPacket = NULL; - AR_SOFTC_T *ar = (AR_SOFTC_T *)Context; - int refillCount = 0; - - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_RX,("ar6000_alloc_amsdu_rxbuf: eid=%d, Length:%d\n",Endpoint,Length)); - - do { - - if (Length <= AR6000_BUFFER_SIZE) { - /* shouldn't be getting called on normal sized packets */ - A_ASSERT(FALSE); - break; - } - - if (Length > AR6000_AMSDU_BUFFER_SIZE) { - A_ASSERT(FALSE); - break; - } - - AR6000_SPIN_LOCK(&ar->arLock, 0); - /* allocate a packet from the list */ - pPacket = HTC_PACKET_DEQUEUE(&ar->amsdu_rx_buffer_queue); - /* see if we need to refill again */ - refillCount = AR6000_MAX_AMSDU_RX_BUFFERS - HTC_PACKET_QUEUE_DEPTH(&ar->amsdu_rx_buffer_queue); - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - - if (NULL == pPacket) { - break; - } - /* set actual endpoint ID */ - pPacket->Endpoint = Endpoint; - - } while (FALSE); - - if (refillCount >= AR6000_AMSDU_REFILL_THRESHOLD) { - ar6000_refill_amsdu_rxbufs(ar,refillCount); - } - - return pPacket; -} - -static void -ar6000_set_multicast_list(struct net_device *dev) -{ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) - int mc_count = dev->mc_count; - struct dev_mc_list *mc; - int j; -#else - int mc_count = netdev_mc_count(dev); - struct netdev_hw_addr *ha; -#endif - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - int i; - A_BOOL enableAll, disableAll; - enum { - IGNORE = 0, - MATCH = 1, - ADD = 2, - DELETE = 3 - } action[MAC_MAX_FILTERS_PER_LIST]; - A_BOOL mcValid; - A_UINT8 *mac; - A_UINT8 *filter; - A_BOOL filterValid; - - if (ar->arWmiReady == FALSE || ar->arWlanState == WLAN_DISABLED) - return; - - enableAll = FALSE; - disableAll = FALSE; - - /* - * Enable receive all multicast, if - * 1. promiscous mode, - * 2. Allow all multicast - * 3. H/W supported filters is less than application requested filter - */ - if ((dev->flags & IFF_PROMISC) || - (dev->flags & IFF_ALLMULTI) || - (mc_count > MAC_MAX_FILTERS_PER_LIST)) - { - enableAll = TRUE; - } else { - /* Disable all multicast if interface has multicast disable or list is empty */ - if ((!(dev->flags & IFF_MULTICAST)) || (!mc_count)) { - disableAll = TRUE; - } - } - - /* - * Firmware behaviour - * enableAll - set filter to enable and delete valid filters - * disableAll - set filter to disable and delete valid filers - * filter - set valid filters - */ - - /* - * Pass 1: Mark all the valid filters to delete - */ - for (i=0; imcast_filters[i]; - filterValid = (filter[1] || filter[2]); - if (filterValid) { - action[i] = DELETE; - } else { - action[i] = IGNORE; - } - } - - if ((!enableAll) && (!disableAll)) { - /* - * Pass 2: Mark all filters which match the previous ones - */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) - for (j = 0, mc = dev->mc_list; mc && (j < dev->mc_count); - j++, mc = mc->next) { - mac = mc->dmi_addr; -#else - netdev_for_each_mc_addr(ha, dev) { - mac = ha->addr; -#endif - - mcValid = (mac[2] || mac[3] || mac[4] || mac[5]); - if (mcValid) { - for (i=0; imcast_filters[i]; - if ((A_MEMCMP(filter, &mac[0], AR_MCAST_FILTER_MAC_ADDR_SIZE)) == 0) { - action[i] = MATCH; - break; - } - } - } - } - - /* - * Delete old entries and free-up space for new additions - */ - for (i = 0; i < MAC_MAX_FILTERS_PER_LIST; i++) { - filter = arPriv->mcast_filters[i]; - if (action[i] == DELETE) { - A_PRINTF ("Delete Filter %d = %02x:%02x:%02x:%02x:%02x:%02x\n", - i, filter[0], filter[1], filter[2], filter[3], filter[4], filter[5]); - wmi_del_mcast_filter_cmd(arPriv->arWmi, filter); - A_MEMZERO(filter, AR_MCAST_FILTER_MAC_ADDR_SIZE); - /* Make this available for further additions */ - action[i] = IGNORE; - } - } - - /* - * Pass 3: Add new filters to empty slots - */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) - for (j = 0, mc = dev->mc_list; mc && (j < dev->mc_count); - j++, mc = mc->next) { -#else - netdev_for_each_mc_addr(ha, dev) { - -#endif - A_BOOL match; - A_INT32 free; - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) - mac = mc->dmi_addr; -#else - mac = ha->addr; -#endif - mcValid = (mac[2] || mac[3] || mac[4] || mac[5]); - if (mcValid) { - match = FALSE; - free = -1; - for (i=0; imcast_filters[i]; - if ((A_MEMCMP(filter, &mac[0], AR_MCAST_FILTER_MAC_ADDR_SIZE)) == 0) { - match = TRUE; - break; - } else if (action[i] != MATCH && action[i] != ADD) { - if (free == -1) { - free = i; // Mark the first free index - } - } - } - if ((!match) && (free != -1)) { - filter = arPriv->mcast_filters[free]; - A_MEMCPY(filter, &mac[0], AR_MCAST_FILTER_MAC_ADDR_SIZE); - action[free] = ADD; - } - } - } - } - - - for (i=0; imcast_filters[i]; - if (action[i] == DELETE) { - A_PRINTF ("Delete Filter %d = %02x:%02x:%02x:%02x:%02x:%02x\n", - i, filter[0], filter[1], filter[2], filter[3], filter[4], filter[5]); - wmi_del_mcast_filter_cmd(arPriv->arWmi, filter); - A_MEMZERO(filter, AR_MCAST_FILTER_MAC_ADDR_SIZE); - } else if (action[i] == ADD) { - A_PRINTF ("Add Filter %d = %02x:%02x:%02x:%02x:%02x:%02x\n", - i, filter[0], filter[1], filter[2], filter[3],filter[4],filter[5]); - wmi_set_mcast_filter_cmd(arPriv->arWmi, filter); - } else if (action[i] == MATCH) { - A_PRINTF ("Keep Filter %d = %02x:%02x:%02x:%02x:%02x:%02x\n", - i, filter[0], filter[1], filter[2], filter[3],filter[4],filter[5]); - } - } - - if (enableAll) { - /* target allow all multicast packets if fitler enable and fitler list is zero */ - wmi_mcast_filter_cmd(arPriv->arWmi, TRUE); - } else if (disableAll) { - /* target drop multicast packets if fitler disable and fitler list is zero */ - wmi_mcast_filter_cmd(arPriv->arWmi, FALSE); - } -} - -static struct net_device_stats * -ar6000_get_stats(struct net_device *dev) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - return &arPriv->arNetStats; -} - -static struct iw_statistics * -ar6000_get_iwstats(struct net_device * dev) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - TARGET_STATS *pStats = &arPriv->arTargetStats; - struct iw_statistics * pIwStats = &arPriv->arIwStats; - int rtnllocked; - -#ifdef CONFIG_HOST_TCMD_SUPPORT - if (ar->bIsDestroyProgress || ar->arWmiReady == FALSE || ar->arWlanState == WLAN_DISABLED || testmode) -#else - if (ar->bIsDestroyProgress || ar->arWmiReady == FALSE || ar->arWlanState == WLAN_DISABLED) -#endif - { - pIwStats->status = 0; - pIwStats->qual.qual = 0; - pIwStats->qual.level =0; - pIwStats->qual.noise = 0; - pIwStats->discard.code =0; - pIwStats->discard.retries=0; - pIwStats->miss.beacon =0; - return pIwStats; - } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - /* - * The in_atomic function is used to determine if the scheduling is - * allowed in the current context or not. This was introduced in 2.6 - * From what I have read on the differences between 2.4 and 2.6, the - * 2.4 kernel did not support preemption and so this check might not - * be required for 2.4 kernels. - */ - if (in_atomic()) - { - if (wmi_get_stats_cmd(arPriv->arWmi) == A_OK) { - } - - pIwStats->status = 1 ; - pIwStats->qual.qual = pStats->cs_aveBeacon_rssi - 161; - pIwStats->qual.level =pStats->cs_aveBeacon_rssi; /* noise is -95 dBm */ - pIwStats->qual.noise = pStats->noise_floor_calibation; - pIwStats->discard.code = pStats->rx_decrypt_err; - pIwStats->discard.retries = pStats->tx_retry_cnt; - pIwStats->miss.beacon = pStats->cs_bmiss_cnt; - return pIwStats; - } -#endif /* LINUX_VERSION_CODE */ - dev_hold(dev); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - rtnllocked = rtnl_is_locked(); -#else - rtnllocked = TRUE; -#endif - if (rtnllocked) { - rtnl_unlock(); - } - pIwStats->status = 0; - - if (down_interruptible(&ar->arSem)) { - goto err_exit; - } - - do { - - if (ar->bIsDestroyProgress || ar->arWlanState == WLAN_DISABLED) { - break; - } - - arPriv->statsUpdatePending = TRUE; - - if(wmi_get_stats_cmd(arPriv->arWmi) != A_OK) { - break; - } - - wait_event_interruptible_timeout(arPriv->arEvent, arPriv->statsUpdatePending == FALSE, wmitimeout * HZ); - if (signal_pending(current)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000 : WMI get stats timeout \n")); - break; - } - pIwStats->status = 1 ; - pIwStats->qual.qual = pStats->cs_aveBeacon_rssi - 161; - pIwStats->qual.level =pStats->cs_aveBeacon_rssi; /* noise is -95 dBm */ - pIwStats->qual.noise = pStats->noise_floor_calibation; - pIwStats->discard.code = pStats->rx_decrypt_err; - pIwStats->discard.retries = pStats->tx_retry_cnt; - pIwStats->miss.beacon = pStats->cs_bmiss_cnt; - } while (0); - up(&ar->arSem); - -err_exit: - if (rtnllocked) { - rtnl_lock(); - } - dev_put(dev); - return pIwStats; -} - -void -ar6000_ready_event(void *devt, A_UINT8 *datap, A_UINT8 phyCap, A_UINT32 sw_ver, A_UINT32 abi_ver) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)devt; - struct net_device *dev; - AR_SOFTC_T *ar = arPriv->arSoftc; - A_UINT8 i, j, k; - - ar->arWmiReady = TRUE; - ar->arVersion.wlan_ver = sw_ver; - ar->arVersion.abi_ver = abi_ver; - wake_up(&arPriv->arEvent); - - for(i = 0; i < num_device ; i++) { - dev = ar6000_devices[i]; - arPriv = ar->arDev[i]; - arPriv->arPhyCapability = phyCap; - if (arPriv->arPhyCapability == WMI_11NAG_CAPABILITY){ - arPriv->phymode = DEF_AP_WMODE_AG; - } else { - arPriv->phymode = DEF_AP_WMODE_G; - } - A_MEMCPY(dev->dev_addr, datap, AR6000_ETH_ADDR_LEN); - - if (i > 0) { - if(mac_addr_method) { - k = dev->dev_addr[5]; - dev->dev_addr[5] += i; - for(j=5; j>3; j--) { - if(dev->dev_addr[j] > k) { - break; - } - k = dev->dev_addr[j-1]; - dev->dev_addr[j-1]++; - } - } else { - dev->dev_addr[0] = (((dev->dev_addr[0]) ^ (1 << i))) | 0x02; - } - } - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("DEV%d mac address = %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", - i, dev->dev_addr[0], dev->dev_addr[1], - dev->dev_addr[2], dev->dev_addr[3], - dev->dev_addr[4], dev->dev_addr[5])); - -#ifdef AR6K_ENABLE_HCI_PAL - ar6k_hci_pal_info_t *pHciPalInfo = (ar6k_hci_pal_info_t *)ar->hcipal_info; - pHciPalInfo->hdev->bdaddr.b[0]=dev->dev_addr[5]; - pHciPalInfo->hdev->bdaddr.b[1]=dev->dev_addr[4]; - pHciPalInfo->hdev->bdaddr.b[2]=dev->dev_addr[3]; - pHciPalInfo->hdev->bdaddr.b[3]=dev->dev_addr[2]; - pHciPalInfo->hdev->bdaddr.b[4]=dev->dev_addr[1]; - pHciPalInfo->hdev->bdaddr.b[5]=dev->dev_addr[0]; - -#endif - -#if WLAN_CONFIG_IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN - wmi_pmparams_cmd(arPriv->arWmi, 0, 1, 0, 0, 1, IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN); -#endif -#if WLAN_CONFIG_DONOT_IGNORE_BARKER_IN_ERP - wmi_set_lpreamble_cmd(arPriv->arWmi, 0, WMI_DONOT_IGNORE_BARKER_IN_ERP); -#endif - - wmi_set_keepalive_cmd(arPriv->arWmi, WLAN_CONFIG_KEEP_ALIVE_INTERVAL); - -#if WLAN_CONFIG_DISABLE_11N - { - WMI_SET_HT_CAP_CMD htCap; - - A_MEMZERO(&htCap, sizeof(WMI_SET_HT_CAP_CMD)); - htCap.band = 0; - wmi_set_ht_cap_cmd(arPriv->arWmi, &htCap); - - htCap.band = 1; - wmi_set_ht_cap_cmd(arPriv->arWmi, &htCap); - } -#endif /* WLAN_CONFIG_DISABLE_11N */ - -#ifdef ATH6K_CONFIG_OTA_MODE - wmi_powermode_cmd(arPriv->arWmi, MAX_PERF_POWER); -#endif - wmi_disctimeout_cmd(arPriv->arWmi, WLAN_CONFIG_DISCONNECT_TIMEOUT); - } -} - -void -add_new_sta(AR_SOFTC_DEV_T *arPriv, A_UINT8 *mac, A_UINT16 aid, A_UINT8 *wpaie, - A_UINT8 ielen, A_UINT8 keymgmt, A_UINT8 ucipher, A_UINT8 auth, A_UINT8 wmode, A_UINT8 apsd_info) -{ - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_AP_T *arAp = &arPriv->arAp; - A_UINT8 free_slot=aid-1; - - A_MEMCPY(ar->connTbl[free_slot].mac, mac, ATH_MAC_LEN); - A_MEMCPY(ar->connTbl[free_slot].wpa_ie, wpaie, ielen); - ar->connTbl[free_slot].arPriv = arPriv; - ar->connTbl[free_slot].aid = aid; - ar->connTbl[free_slot].keymgmt = keymgmt; - ar->connTbl[free_slot].ucipher = ucipher; - ar->connTbl[free_slot].auth = auth; - ar->connTbl[free_slot].wmode = wmode; - ar->connTbl[free_slot].apsd_info= apsd_info; - ar->arAPStats[free_slot].aid = aid; - A_MEMZERO(ar->connTbl[free_slot].ba_state, 8); - arAp->sta_list_index = arAp->sta_list_index | (1 << free_slot); - aggr_reset_state(ar->connTbl[free_slot].conn_aggr, (void *) arPriv->arNetDev); -} - -void -ar6000_connect_event(AR_SOFTC_DEV_T *arPriv, WMI_CONNECT_EVENT *pEvt) -{ - union iwreq_data wrqu; - int i, beacon_ie_pos, assoc_resp_ie_pos, assoc_req_ie_pos; - static const char *tag1 = "ASSOCINFO(ReqIEs="; - static const char *tag2 = "ASSOCRESPIE="; - static const char *beaconIetag = "BEACONIE="; - char buf[WMI_CONTROL_MSG_MAX_LEN * 2 + strlen(tag1) + 1]; - char *pos; - A_UINT8 key_op_ctrl; - unsigned long flags; - struct ieee80211req_key *ik; - CRYPTO_TYPE keyType = NONE_CRYPT; - AR_SOFTC_STA_T *arSta; - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_DEV_T *arTempPriv = NULL; - struct ieee80211_frame *wh; - A_UINT8 *frm, *efrm, *ssid, *rates, *xrates, *wpaie, wpaLen=0; - A_UINT16 subtype; - A_UINT8 beaconIeLen; - A_UINT8 assocReqLen; - A_UINT8 assocRespLen; - A_UINT8 *assocInfo; - A_UINT8 *bssid; - - beaconIeLen = pEvt->beaconIeLen; - assocReqLen = pEvt->assocReqLen; - assocRespLen = pEvt->assocRespLen; - assocInfo = pEvt->assocInfo; - - /* BSSID and MAC_ADDR is in the same location for all modes */ - bssid = pEvt->u.infra_ibss_bss.bssid; - - if(arPriv->arNetworkType & AP_NETWORK) { - struct net_device *dev = arPriv->arNetDev; - AR_SOFTC_AP_T *arAp = &arPriv->arAp; - A_UINT8 aid, wmode, keymgmt, auth_alg; - - if(A_MEMCMP(dev->dev_addr, bssid, ATH_MAC_LEN)==0) { - arPriv->arBssChannel = pEvt->u.ap_bss.channel; - ik = &arAp->ap_mode_bkey; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AP%d: [UP] SSID %s MAC %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", - arPriv->arDeviceIndex, arPriv->arSsid, - bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5])); -#ifdef P2P - if(arPriv->arNetworkSubType == SUBTYPE_P2PDEV) - arPriv->arNetworkSubType = SUBTYPE_P2PGO; -#endif - - switch(arPriv->arAuthMode) { - case WMI_NONE_AUTH: -#ifdef WAPI_ENABLE - if(arPriv->arPairwiseCrypto == WAPI_CRYPT) { - ap_set_wapi_key(arPriv, ik); - } -#endif - break; - case WMI_WPA_PSK_AUTH: - case WMI_WPA2_PSK_AUTH: - case (WMI_WPA_PSK_AUTH|WMI_WPA2_PSK_AUTH): - switch (ik->ik_type) { - case IEEE80211_CIPHER_TKIP: - keyType = TKIP_CRYPT; - break; - case IEEE80211_CIPHER_AES_CCM: - keyType = AES_CRYPT; - break; - default: - goto skip_key; - } - - wmi_addKey_cmd(arPriv->arWmi, ik->ik_keyix, keyType, GROUP_USAGE, - ik->ik_keylen, (A_UINT8 *)&ik->ik_keyrsc, - ik->ik_keydata, KEY_OP_INIT_VAL, ik->ik_macaddr, - SYNC_BOTH_WMIFLAG); - - break; - } -skip_key: - wmi_bssfilter_cmd(arPriv->arWmi, NONE_BSS_FILTER, 0); - - arPriv->arConnected = TRUE; - return; - } - - wh = (struct ieee80211_frame *) (assocInfo + beaconIeLen); - subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; - frm = (A_UINT8 *)&wh[1]; - efrm = assocInfo + beaconIeLen + assocReqLen; - - /* capability information */ - frm += 2; - - /* listen int */ - frm += 2; - - /* Reassoc will have current AP addr field */ - if(subtype == IEEE80211_FC0_SUBTYPE_REASSOC_REQ) { - frm += 6; - } - - ssid = rates = xrates = wpaie = NULL; - while (frm < efrm) { - switch (*frm) { -/* currently unused */ -/* - case IEEE80211_ELEMID_SSID: - ssid = frm; - break; - case IEEE80211_ELEMID_RATES: - rates = frm; - break; - case IEEE80211_ELEMID_XRATES: - xrates = frm; - break; -*/ - case IEEE80211_ELEMID_VENDOR: - if( (frm[1] > 3) && (frm[2] == 0x00) && (frm[3] == 0x50) && - (frm[4] == 0xF2) && ((frm[5] == 0x01) || (frm[5] == 0x04)) ) - { - wpaie = frm; - wpaLen = wpaie[1]+2; - } - break; - case IEEE80211_ELEMID_RSN: - wpaie = frm; - wpaLen = wpaie[1]+2; - break; - } - frm += frm[1] + 2; - } - - aid = pEvt->u.ap_sta.aid; - wmode = pEvt->u.ap_sta.phymode; - keymgmt = pEvt->u.ap_sta.keymgmt; - auth_alg = pEvt->u.ap_sta.auth; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("NEW STA %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x \n " - " AID=%d AUTH=%d WMODE=%d KEYMGMT=%d CIPHER=%d APSD=%x\n", - pEvt->u.ap_sta.mac_addr[0], pEvt->u.ap_sta.mac_addr[1], pEvt->u.ap_sta.mac_addr[2], - pEvt->u.ap_sta.mac_addr[3], pEvt->u.ap_sta.mac_addr[4], pEvt->u.ap_sta.mac_addr[5], - aid, auth_alg, wmode, keymgmt, pEvt->u.ap_sta.cipher, pEvt->u.ap_sta.apsd_info)); - - add_new_sta(arPriv, pEvt->u.ap_sta.mac_addr, aid, wpaie, wpaLen, keymgmt, - pEvt->u.ap_sta.cipher, auth_alg, wmode, pEvt->u.ap_sta.apsd_info); - - /* Send event to application */ - A_MEMZERO(&wrqu, sizeof(wrqu)); - A_MEMCPY(wrqu.addr.sa_data, pEvt->u.ap_sta.mac_addr, ATH_MAC_LEN); - wireless_send_event(arPriv->arNetDev, IWEVREGISTERED, &wrqu, NULL); - /* In case the queue is stopped when we switch modes, this will - * wake it up - */ - netif_wake_queue(arPriv->arNetDev); - return; - } - arSta = &arPriv->arSta; -#ifdef ATH6K_CONFIG_CFG80211 - ar6k_cfg80211_connect_event(arPriv, pEvt->u.infra_ibss_bss.channel, bssid, - pEvt->u.infra_ibss_bss.listenInterval, pEvt->u.infra_ibss_bss.beaconInterval, - pEvt->u.infra_ibss_bss.networkType, beaconIeLen, - assocReqLen, assocRespLen, - assocInfo); -#endif /* ATH6K_CONFIG_CFG80211 */ - - A_MEMCPY(arPriv->arBssid, bssid, sizeof(arPriv->arBssid)); - arPriv->arBssChannel = pEvt->u.infra_ibss_bss.channel; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AR6000 connected event on freq %d ", pEvt->u.infra_ibss_bss.channel)); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("with bssid %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x " - " listenInterval=%d, beaconInterval = %d, beaconIeLen = %d assocReqLen=%d" - " assocRespLen =%d\n", - bssid[0], bssid[1], bssid[2], - bssid[3], bssid[4], bssid[5], - pEvt->u.infra_ibss_bss.listenInterval, pEvt->u.infra_ibss_bss.beaconInterval, - beaconIeLen, assocReqLen, assocRespLen)); - if (pEvt->u.infra_ibss_bss.networkType & ADHOC_NETWORK) { - /* Disable BG Scan for ADHOC NETWORK */ - wmi_scanparams_cmd(arPriv->arWmi, 0, 0, - 0xFFFF, 0, 0, 0, WMI_SHORTSCANRATIO_DEFAULT,DEFAULT_SCAN_CTRL_FLAGS, 0, 0); - if (pEvt->u.infra_ibss_bss.networkType & ADHOC_CREATOR) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Network: Adhoc (Creator)\n")); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Network: Adhoc (Joiner)\n")); - } - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Network: Infrastructure\n")); - } - - if ((arPriv->arNetworkType == INFRA_NETWORK)) { - if (arSta->arConnectPending) { - wmi_listeninterval_cmd(arPriv->arWmi, arSta->arListenIntervalT, arSta->arListenIntervalB); - } - } -#ifdef P2P - if(arPriv->arNetworkSubType == SUBTYPE_P2PDEV) - arPriv->arNetworkSubType = SUBTYPE_P2PCLIENT; -#endif - - if (beaconIeLen && (sizeof(buf) > (9 + beaconIeLen * 2))) { - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("\nBeaconIEs= ")); - - beacon_ie_pos = 0; - A_MEMZERO(buf, sizeof(buf)); - sprintf(buf, "%s", beaconIetag); - pos = buf + 9; - for (i = beacon_ie_pos; i < beacon_ie_pos + beaconIeLen; i++) { - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("%2.2x ", assocInfo[i])); - sprintf(pos, "%2.2x", assocInfo[i]); - pos += 2; - } - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("\n")); - - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = strlen(buf); - if (wrqu.data.length <= IW_CUSTOM_MAX) { - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, buf); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Fail to send BeaconIEs to upper layer\n")); - } - } - - if (assocRespLen && (sizeof(buf) > (12 + (assocRespLen * 2)))) - { - assoc_resp_ie_pos = beaconIeLen + assocReqLen + - sizeof(A_UINT16) + /* capinfo*/ - sizeof(A_UINT16) + /* status Code */ - sizeof(A_UINT16) ; /* associd */ - A_MEMZERO(buf, sizeof(buf)); - sprintf(buf, "%s", tag2); - pos = buf + 12; - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("\nAssocRespIEs= ")); - /* - * The Association Response Frame w.o. the WLAN header is delivered to - * the host, so skip over to the IEs - */ - for (i = assoc_resp_ie_pos; i < assoc_resp_ie_pos + assocRespLen - 6; i++) - { - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("%2.2x ", assocInfo[i])); - sprintf(pos, "%2.2x", assocInfo[i]); - pos += 2; - } - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("\n")); - - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = strlen(buf); - if (wrqu.data.length <= IW_CUSTOM_MAX) { - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, buf); - } else { -#if (WIRELESS_EXT >= 18) - wrqu.data.length = (assocRespLen - 6); - wireless_send_event(arPriv->arNetDev, IWEVASSOCRESPIE, &wrqu, &assocInfo[assoc_resp_ie_pos]); -#else - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Fail to send Association Response to upper layer\n")); -#endif - } - } - - if (assocReqLen && (sizeof(buf) > (17 + (assocReqLen * 2)))) { - /* - * assoc Request includes capability and listen interval. Skip these. - */ - assoc_req_ie_pos = beaconIeLen + - sizeof(A_UINT16) + /* capinfo*/ - sizeof(A_UINT16); /* listen interval */ - - A_MEMZERO(buf, sizeof(buf)); - sprintf(buf, "%s", tag1); - pos = buf + 17; - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("AssocReqIEs= ")); - for (i = assoc_req_ie_pos; i < assoc_req_ie_pos + assocReqLen - 4; i++) { - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("%2.2x ", assocInfo[i])); - sprintf(pos, "%2.2x", assocInfo[i]); - pos += 2;; - } - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("\n")); - - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = strlen(buf); - if (wrqu.data.length <= IW_CUSTOM_MAX) { - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, buf); - } else { -#if (WIRELESS_EXT >= 18) - wrqu.data.length = (assocReqLen - 4); - wireless_send_event(arPriv->arNetDev, IWEVASSOCREQIE, &wrqu, &assocInfo[assoc_req_ie_pos]); -#else - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Fail to send Association Request to upper layer\n")); -#endif - } - } - -#ifdef USER_KEYS - if (arSta->user_savedkeys_stat == USER_SAVEDKEYS_STAT_RUN && - arSta->user_saved_keys.keyOk == TRUE) - { - key_op_ctrl = KEY_OP_VALID_MASK & ~KEY_OP_INIT_TSC; - - if (arSta->user_key_ctrl & AR6000_USER_SETKEYS_RSC_UNCHANGED) { - key_op_ctrl &= ~KEY_OP_INIT_RSC; - } else { - key_op_ctrl |= KEY_OP_INIT_RSC; - } - ar6000_reinstall_keys(arPriv, key_op_ctrl); - } -#endif /* USER_KEYS */ - - netif_wake_queue(arPriv->arNetDev); - - /* For CFG80211 the key configuration and the default key comes in after connect so no point in plumbing invalid keys */ -#ifndef ATH6K_CONFIG_CFG80211 - if ((pEvt->u.infra_ibss_bss.networkType & ADHOC_NETWORK) && - (OPEN_AUTH == arPriv->arDot11AuthMode) && - (WMI_NONE_AUTH == arPriv->arAuthMode) && - (WEP_CRYPT == arPriv->arPairwiseCrypto)) - { - if (!arPriv->arConnected) { - wmi_addKey_cmd(arPriv->arWmi, - arPriv->arDefTxKeyIndex, - WEP_CRYPT, - GROUP_USAGE | TX_USAGE, - arPriv->arWepKeyList[arPriv->arDefTxKeyIndex].arKeyLen, - NULL, - arPriv->arWepKeyList[arPriv->arDefTxKeyIndex].arKey, KEY_OP_INIT_VAL, NULL, - NO_SYNC_WMIFLAG); - } - } -#endif /* ATH6K_CONFIG_CFG80211 */ - - /* Update connect & link status atomically */ - spin_lock_irqsave(&arPriv->arPrivLock, flags); - arPriv->arConnected = TRUE; - arSta->arConnectPending = FALSE; - netif_carrier_on(arPriv->arNetDev); - spin_unlock_irqrestore(&arPriv->arPrivLock, flags); - /* reset the rx aggr state */ - aggr_reset_state(arPriv->conn_aggr, (void *) arPriv->arNetDev); - reconnect_flag = 0; - - A_MEMZERO(&wrqu, sizeof(wrqu)); - A_MEMCPY(wrqu.addr.sa_data, bssid, IEEE80211_ADDR_LEN); - wrqu.addr.sa_family = ARPHRD_ETHER; - wireless_send_event(arPriv->arNetDev, SIOCGIWAP, &wrqu, NULL); - if ((arPriv->arNetworkType == ADHOC_NETWORK) && arSta->arIbssPsEnable) { - A_MEMZERO(arSta->arNodeMap, sizeof(arSta->arNodeMap)); - arSta->arNodeNum = 0; - arSta->arNexEpId = ENDPOINT_2; - } - if (!arSta->arUserBssFilter) { - wmi_bssfilter_cmd(arPriv->arWmi, NONE_BSS_FILTER, 0); - } - /* AP-STA Concurrency */ - if(ar->arHoldConnection){ - for(i=0;i < ar->arConfNumDev;i++) { - arTempPriv = ar->arDev[i]; - if((AP_NETWORK == arTempPriv->arNetworkType)){ - arTempPriv->arBssChannel = arTempPriv->arChannelHint = 0; - } - } - A_TIMEOUT_MS(&ar->ap_reconnect_timer, 1*1000, 0); - } -} - -void ar6000_set_numdataendpts(AR_SOFTC_DEV_T *arPriv, A_UINT32 num) -{ - AR_SOFTC_T *ar = arPriv->arSoftc; - A_ASSERT(num <= (HTC_MAILBOX_NUM_MAX - 1)); - ar->arNumDataEndPts = num; -} - -void -sta_cleanup(AR_SOFTC_DEV_T *arPriv, A_UINT8 i) -{ - struct sk_buff *skb; - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_AP_T *arAp = &arPriv->arAp; - - /* empty the queued pkts in the PS queue if any */ - A_MUTEX_LOCK(&ar->connTbl[i].psqLock); - while (!A_NETBUF_QUEUE_EMPTY(&ar->connTbl[i].psq)) { - skb = A_NETBUF_DEQUEUE(&ar->connTbl[i].psq); - A_NETBUF_FREE(skb); - } - while (!A_NETBUF_QUEUE_EMPTY(&ar->connTbl[i].apsdq)) { - skb = A_NETBUF_DEQUEUE(&ar->connTbl[i].apsdq); - A_NETBUF_FREE(skb); - } - A_MUTEX_UNLOCK(&ar->connTbl[i].psqLock); - - /* Zero out the state fields */ - A_MEMZERO(&ar->arAPStats[i], sizeof(WMI_PER_STA_STAT)); - A_MEMZERO(&ar->connTbl[i].mac, ATH_MAC_LEN); - A_MEMZERO(&ar->connTbl[i].wpa_ie, IEEE80211_MAX_IE); - ar->connTbl[i].aid = 0; - ar->connTbl[i].flags = 0; - ar->connTbl[i].arPriv = NULL; - - arAp->sta_list_index =arAp->sta_list_index & ~(1 << i); - aggr_reset_state(ar->connTbl[i].conn_aggr, NULL); -} - -void -ar6000_ap_cleanup(AR_SOFTC_DEV_T *arPriv) -{ - A_UINT8 ctr; - struct sk_buff *skb; - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_AP_T *arAp = &arPriv->arAp; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("DEL ALL STA\n")); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AP%d: [DOWN] SSID %s\n", arPriv->arDeviceIndex, arPriv->arSsid)); - - for (ctr=0; ctr < NUM_CONN; ctr++) { - if(ar->connTbl[ctr].arPriv == arPriv) { - remove_sta(arPriv, ar->connTbl[ctr].mac, 0); - } - } - A_MUTEX_LOCK(&arAp->mcastpsqLock); - while (!A_NETBUF_QUEUE_EMPTY(&arAp->mcastpsq)) { - skb = A_NETBUF_DEQUEUE(&arAp->mcastpsq); - A_NETBUF_FREE(skb); - } - A_MUTEX_UNLOCK(&arAp->mcastpsqLock); - arPriv->arConnected = FALSE; -} - -A_UINT8 -remove_sta(AR_SOFTC_DEV_T *arPriv, A_UINT8 *mac, A_UINT16 reason) -{ - A_UINT8 i, removed=0; - AR_SOFTC_T *ar = arPriv->arSoftc; - union iwreq_data wrqu; - struct sk_buff *skb; - - if(IS_MAC_NULL(mac)) { - return removed; - } - - if(reason == AP_DISCONNECT_MAX_STA) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("MAX STA %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", mac[0], - mac[1], mac[2], mac[3], mac[4], mac[5])); - return removed; - } else if(reason == AP_DISCONNECT_ACL) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("ACL STA %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", mac[0], - mac[1], mac[2], mac[3], mac[4], mac[5])); - return removed; - } - - for(i=0; i < NUM_CONN; i++) { - if(A_MEMCMP(ar->connTbl[i].mac, mac, ATH_MAC_LEN)==0) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("DEL STA %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x " - " aid=%d REASON=%d\n", mac[0], mac[1], mac[2], - mac[3], mac[4], mac[5], ar->connTbl[i].aid, reason)); - - sta_cleanup(arPriv, i); - removed = 1; - - /* Send event to application */ - A_MEMZERO(&wrqu, sizeof(wrqu)); - A_MEMCPY(wrqu.addr.sa_data, mac, ATH_MAC_LEN); - wireless_send_event(arPriv->arNetDev, IWEVEXPIRED, &wrqu, NULL); - - break; - } - } - - /* If there are no more associated STAs, empty the mcast PS q */ - if (arPriv->arAp.sta_list_index == 0) { - A_MUTEX_LOCK(&arPriv->arAp.mcastpsqLock); - while (!A_NETBUF_QUEUE_EMPTY(&arPriv->arAp.mcastpsq)) { - skb = A_NETBUF_DEQUEUE(&arPriv->arAp.mcastpsq); - A_NETBUF_FREE(skb); - } - A_MUTEX_UNLOCK(&arPriv->arAp.mcastpsqLock); - - /* Clear the LSB of the BitMapCtl field of the TIM IE */ - if (ar->arWmiReady) { - wmi_set_pvb_cmd(arPriv->arWmi, MCAST_AID, 0); - } - } - - return removed; -} - -void -ar6000_disconnect_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 reason, A_UINT8 *bssid, - A_UINT8 assocRespLen, A_UINT8 *assocInfo, A_UINT16 protocolReasonStatus) -{ - A_UINT8 i; - unsigned long flags; - union iwreq_data wrqu; - AR_SOFTC_T *ar = arPriv->arSoftc; - A_BOOL bt30Devfound = FALSE; -#ifdef P2P - if((arPriv->arNetworkSubType == SUBTYPE_P2PCLIENT) || (arPriv->arNetworkSubType == SUBTYPE_P2PGO) - || (arPriv->arNetworkSubType == SUBTYPE_P2PDEV)){ - if(!(IS_MAC_BCAST(bssid))) - p2p_clear_peers_authorized_flag(arPriv->p2p_ctx, bssid); - } -#endif - - if(arPriv->arNetworkType & AP_NETWORK) { - if(IS_MAC_BCAST(bssid)) { - ar6000_ap_cleanup(arPriv); -#ifdef P2P - if(arPriv->arNetworkSubType == SUBTYPE_P2PGO) { - arPriv->arNextMode = INFRA_NETWORK; - ar6000_init_mode_info(arPriv); - arPriv->arNetworkType = INFRA_NETWORK; - arPriv->arNetworkSubType = SUBTYPE_P2PDEV; - } -#endif - } else { - remove_sta(arPriv, bssid, protocolReasonStatus); - } - return; - } - -#ifdef ATH6K_CONFIG_CFG80211 - ar6k_cfg80211_disconnect_event(arPriv, reason, bssid, - assocRespLen, assocInfo, - protocolReasonStatus); -#endif /* ATH6K_CONFIG_CFG80211 */ - - /* Send disconnect event to supplicant */ - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.addr.sa_family = ARPHRD_ETHER; - wireless_send_event(arPriv->arNetDev, SIOCGIWAP, &wrqu, NULL); - - /* it is necessary to clear the host-side rx aggregation state */ - aggr_reset_state(arPriv->conn_aggr, NULL); - - A_UNTIMEOUT(&arPriv->arSta.disconnect_timer); - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AR6000 disconnected")); - if (bssid[0] || bssid[1] || bssid[2] || bssid[3] || bssid[4] || bssid[5]) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,(" from %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x ", - bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5])); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Disconnect Reason is %d, Status Code is %d", reason, protocolReasonStatus)); - - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("\nDisconnect Reason is %d", reason)); - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("\nProtocol Reason/Status Code is %d", protocolReasonStatus)); - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("\nAssocResp Frame = %s", - assocRespLen ? " " : "NULL")); - for (i = 0; i < assocRespLen; i++) { - if (!(i % 0x10)) { - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("\n")); - } - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("%2.2x ", assocInfo[i])); - } - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("\n")); - /* - * If the event is due to disconnect cmd from the host, only they the target - * would stop trying to connect. Under any other condition, target would - * keep trying to connect. - * - */ - if( reason == DISCONNECT_CMD) - { - if ((!arPriv->arSta.arUserBssFilter) && (ar->arWmiReady)) { - wmi_bssfilter_cmd(arPriv->arWmi, NONE_BSS_FILTER, 0); - } - } else { - arPriv->arSta.arConnectPending = TRUE; - if (((reason == ASSOC_FAILED) && (protocolReasonStatus == 0x11)) || - ((reason == ASSOC_FAILED) && (protocolReasonStatus == 0x0) && (reconnect_flag == 1))) { - arPriv->arConnected = TRUE; - return; - } - } - - if ((reason == NO_NETWORK_AVAIL) && (ar->arWmiReady)) - { - bss_t *pWmiSsidnode = NULL; - - /* remove the current associated bssid node */ - wmi_free_node (arPriv->arWmi, bssid); - - /* - * In case any other same SSID nodes are present - * remove it, since those nodes also not available now - */ - do - { - /* - * Find the nodes based on SSID and remove it - * NOTE :: This case will not work out for Hidden-SSID - */ - pWmiSsidnode = wmi_find_Ssidnode (arPriv->arWmi, arPriv->arSsid, arPriv->arSsidLen, FALSE, TRUE); - - if (pWmiSsidnode) - { - wmi_free_node (arPriv->arWmi, pWmiSsidnode->ni_macaddr); - } - - }while (pWmiSsidnode); - } - - /* Update connect & link status atomically */ - spin_lock_irqsave(&arPriv->arPrivLock, flags); - - arPriv->arConnected = FALSE; - netif_carrier_off(arPriv->arNetDev); - spin_unlock_irqrestore(&arPriv->arPrivLock, flags); -#ifdef P2P - if(arPriv->arNetworkSubType == SUBTYPE_P2PCLIENT) { - arPriv->arNextMode = INFRA_NETWORK; - ar6000_init_mode_info(arPriv); - arPriv->arNetworkType = INFRA_NETWORK; - arPriv->arNetworkSubType = SUBTYPE_P2PDEV; - } -#endif - - if( (reason != CSERV_DISCONNECT) || (reconnect_flag != 1) ) { - reconnect_flag = 0; - } - -#ifdef USER_KEYS - if (reason != CSERV_DISCONNECT) - { - arPriv->arSta.user_savedkeys_stat = USER_SAVEDKEYS_STAT_INIT; - arPriv->arSta.user_key_ctrl = 0; - } -#endif /* USER_KEYS */ - - netif_stop_queue(arPriv->arNetDev); - A_MEMZERO(arPriv->arBssid, sizeof(arPriv->arBssid)); - arPriv->arBssChannel = 0; - arPriv->arSta.arBeaconInterval = 0; - - for (i=0; i < num_device; i++) { - AR_SOFTC_DEV_T *temparPriv; - temparPriv = ar->arDev[i]; - if (temparPriv->isBt30amp == TRUE) { - bt30Devfound = TRUE; - } - } - if (bt30Devfound == FALSE) { - ar6000_TxDataCleanup(ar); - } - /* AP-STA Concurrency */ - if(ar->arHoldConnection){ - A_TIMEOUT_MS(&ar->ap_reconnect_timer, 2*1000, 0); - } - - if (arPriv->arNetworkType == ADHOC_NETWORK){ - /* Reset Scan params to default */ - wmi_scanparams_cmd(arPriv->arWmi, 0, 0, - 60, 0, 0, 0, WMI_SHORTSCANRATIO_DEFAULT,DEFAULT_SCAN_CTRL_FLAGS, 0, 0); - } -} - -void -ar6000_regDomain_event(AR_SOFTC_DEV_T *arPriv, A_UINT32 regCode) -{ - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AR6000 Reg Code = 0x%x\n", regCode)); - arPriv->arRegCode = regCode; -} - -#ifdef ATH_AR6K_11N_SUPPORT -#define BA_EVT_GET_CONNID(a) ((a)>>4) -#define BA_EVT_GET_TID(b) ((b)&0xF) - -void -ar6000_aggr_rcv_addba_req_evt(AR_SOFTC_DEV_T *arPriv, WMI_ADDBA_REQ_EVENT *evt) -{ - A_UINT8 connid = BA_EVT_GET_CONNID(evt->tid); - A_UINT8 tid = BA_EVT_GET_TID(evt->tid); - conn_t *conn = ieee80211_find_conn_for_aid(arPriv, connid); - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("ADDBA REQ: tid=%d, connid=%d, status=%d, win_sz=%d\n", tid, connid, evt->status, evt->win_sz)); - if(((arPriv->arNetworkType == INFRA_NETWORK) || (conn != NULL)) && evt->status == 0) { - aggr_recv_addba_req_evt(get_aggr_ctx(arPriv, conn), tid, evt->st_seq_no, evt->win_sz); - } -} - -void -ar6000_aggr_rcv_addba_resp_evt(AR_SOFTC_DEV_T *arPriv, WMI_ADDBA_RESP_EVENT *evt) -{ - A_UINT8 connid = BA_EVT_GET_CONNID(evt->tid); - A_UINT8 tid = BA_EVT_GET_TID(evt->tid); - conn_t *conn = ieee80211_find_conn_for_aid(arPriv, connid); - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("ADDBA RSP: tid=%d, connid=%d, status=%d, sz=%d\n", tid, connid, evt->status, evt->amsdu_sz)); - if(conn) { - conn->ba_state[tid] = 0x80; - } - if(evt->status == 0) { - } -} - -void -ar6000_aggr_rcv_delba_req_evt(AR_SOFTC_DEV_T *arPriv, WMI_DELBA_EVENT *evt) -{ - A_UINT8 connid = BA_EVT_GET_CONNID(evt->tid); - A_UINT8 tid = BA_EVT_GET_TID(evt->tid); - conn_t *conn = ieee80211_find_conn_for_aid(arPriv, connid); - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("DELBA REQ: tid=%d, connid=%d\n", tid, connid)); - if((arPriv->arNetworkType == INFRA_NETWORK) || (conn != NULL)) { - aggr_recv_delba_req_evt(get_aggr_ctx(arPriv, conn), tid); - } -} -#endif - -void register_pal_cb(ar6k_pal_config_t *palConfig_p) -{ - ar6k_pal_config_g = *palConfig_p; -} - -void -ar6000_hci_event_rcv_evt(AR_SOFTC_DEV_T *arPriv, WMI_HCI_EVENT *cmd) -{ - void *osbuf = NULL; - A_INT8 i; - A_UINT8 size, *buf; - A_STATUS ret = A_OK; - - size = cmd->evt_buf_sz + 4; - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - ret = A_NO_MEMORY; - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Error in allocating netbuf \n")); - return; - } - - A_NETBUF_PUT(osbuf, size); - buf = (A_UINT8 *)A_NETBUF_DATA(osbuf); - /* First 2-bytes carry HCI event/ACL data type - * the next 2 are free - */ - *((short *)buf) = WMI_HCI_EVENT_EVENTID; - buf += sizeof(int); - A_MEMCPY(buf, cmd->buf, cmd->evt_buf_sz); - - if(ar6k_pal_config_g.fpar6k_pal_recv_pkt) - { - /* pass the cmd packet to PAL driver */ - if((*ar6k_pal_config_g.fpar6k_pal_recv_pkt)(arPriv->hcipal_info, osbuf) == TRUE) - return; - } - ar6000_deliver_frames_to_nw_stack(arPriv->arNetDev, osbuf); - if(loghci) { - A_PRINTF_LOG("HCI Event From PAL <-- \n"); - for(i = 0; i < cmd->evt_buf_sz; i++) { - A_PRINTF_LOG("0x%02x ", cmd->buf[i]); - if((i % 10) == 0) { - A_PRINTF_LOG("\n"); - } - } - A_PRINTF_LOG("\n"); - A_PRINTF_LOG("==================================\n"); - } -} - -void -ar6000_neighborReport_event(AR_SOFTC_DEV_T *arPriv, int numAps, WMI_NEIGHBOR_INFO *info) -{ -#if WIRELESS_EXT >= 18 - struct iw_pmkid_cand *pmkcand; -#else /* WIRELESS_EXT >= 18 */ - static const char *tag = "PRE-AUTH"; - char buf[128]; -#endif /* WIRELESS_EXT >= 18 */ - - union iwreq_data wrqu; - int i; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AR6000 Neighbor Report Event\n")); - for (i=0; i < numAps; info++, i++) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("bssid %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x ", - info->bssid[0], info->bssid[1], info->bssid[2], - info->bssid[3], info->bssid[4], info->bssid[5])); - if (info->bssFlags & WMI_PREAUTH_CAPABLE_BSS) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("preauth-cap")); - } - if (info->bssFlags & WMI_PMKID_VALID_BSS) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,(" pmkid-valid\n")); - continue; /* we skip bss if the pmkid is already valid */ - } - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("\n")); - A_MEMZERO(&wrqu, sizeof(wrqu)); -#if WIRELESS_EXT >= 18 - pmkcand = A_MALLOC_NOWAIT(sizeof(struct iw_pmkid_cand)); - A_MEMZERO(pmkcand, sizeof(struct iw_pmkid_cand)); - pmkcand->index = i; - pmkcand->flags = info->bssFlags; - A_MEMCPY(pmkcand->bssid.sa_data, info->bssid, ATH_MAC_LEN); - wrqu.data.length = sizeof(struct iw_pmkid_cand); - wireless_send_event(arPriv->arNetDev, IWEVPMKIDCAND, &wrqu, (char *)pmkcand); - A_FREE(pmkcand); -#else /* WIRELESS_EXT >= 18 */ - snprintf(buf, sizeof(buf), "%s%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x", - tag, - info->bssid[0], info->bssid[1], info->bssid[2], - info->bssid[3], info->bssid[4], info->bssid[5], - i, info->bssFlags); - wrqu.data.length = strlen(buf); - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, buf); -#endif /* WIRELESS_EXT >= 18 */ - } -} - -void -ar6000_indicate_proberesp(AR_SOFTC_DEV_T *arPriv , A_UINT8* pData , A_UINT16 len ,A_UINT8* bssid) -{ -} - -void -ar6000_indicate_beacon(AR_SOFTC_DEV_T *arPriv, A_UINT8* pData , A_UINT16 len ,A_UINT8* bssid) -{ -} - -void -ar6000_assoc_req_report_event (void *context, A_UINT8 status, A_UINT8 rspType, A_UINT8* pData, int len) -{ -} - -#ifdef ATH_SUPPORT_DFS - -void ar6000_dfs_attach_event(AR_SOFTC_DEV_T *arPriv, WMI_DFS_HOST_ATTACH_EVENT *capinfo) -{ - AR_SOFTC_AP_T *arAp=&arPriv->arAp; - arAp->pDfs = dfs_attach_host(arPriv, NULL, capinfo); - if(arAp->pDfs) - { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("\nDFS host attached\n")); - } - else - { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("\nDFS host ptr NULL\n")); - } -} - -void ar6000_dfs_init_event(AR_SOFTC_DEV_T *arPriv, WMI_DFS_HOST_INIT_EVENT *info) -{ - AR_SOFTC_AP_T *arAp=&arPriv->arAp; - dfs_init_radar_filters_host(arAp->pDfs, info); -} - -void ar6000_dfs_phyerr_event(AR_SOFTC_DEV_T *arPriv, WMI_DFS_PHYERR_EVENT *info) -{ - AR_SOFTC_AP_T *arAp=&arPriv->arAp; - dfs_process_phyerr_host(arAp->pDfs, info); -} - -void ar6000_dfs_reset_delaylines_event(AR_SOFTC_DEV_T *arPriv) -{ - AR_SOFTC_AP_T *arAp=&arPriv->arAp; - dfs_reset_alldelaylines(arAp->pDfs); -} - -void ar6000_dfs_reset_radarq_event(AR_SOFTC_DEV_T *arPriv) -{ - AR_SOFTC_AP_T *arAp=&arPriv->arAp; - dfs_reset_radarq(arAp->pDfs); -} - -void ar6000_dfs_reset_ar_event(AR_SOFTC_DEV_T *arPriv) -{ - AR_SOFTC_AP_T *arAp=&arPriv->arAp; - dfs_reset_ar(arAp->pDfs); -} - -void ar6000_dfs_reset_arq_event(AR_SOFTC_DEV_T *arPriv) -{ - AR_SOFTC_AP_T *arAp=&arPriv->arAp; - dfs_reset_arq(arAp->pDfs); -} - -void ar6000_dfs_set_dur_multiplier_event(AR_SOFTC_DEV_T *arPriv, A_UINT32 value) -{ - AR_SOFTC_AP_T *arAp=&arPriv->arAp; - dfs_set_dur_multiplier(arAp->pDfs, value); -} - -void ar6000_dfs_set_bangradar_event(AR_SOFTC_DEV_T *arPriv, A_UINT32 value) -{ - AR_SOFTC_AP_T *arAp=&arPriv->arAp; - dfs_bangradar_enable(arAp->pDfs, value); -} - -void ar6000_dfs_set_debuglevel_event(AR_SOFTC_DEV_T *arPriv, A_UINT32 value) -{ - AR_SOFTC_AP_T *arAp=&arPriv->arAp; - dfs_set_debug_level_host(arAp->pDfs, value); -} - -A_STATUS ar6000_dfs_set_maxpulsedur_cmd(AR_SOFTC_DEV_T *arPriv, A_UINT32 value) -{ - return wmi_set_dfs_maxpulsedur_cmd(arPriv->arWmi, value); -} - -A_STATUS ar6000_dfs_radar_detected_cmd(AR_SOFTC_DEV_T *arPriv, A_INT16 chan_index, A_INT8 bang_radar) -{ - return wmi_radarDetected_cmd(arPriv->arWmi, chan_index, bang_radar); -} - -A_STATUS ar6000_dfs_set_minrssithresh_cmd(AR_SOFTC_DEV_T *arPriv, A_INT32 rssi) -{ - return wmi_set_dfs_minrssithresh_cmd(arPriv->arWmi, rssi); -} - -#endif /* ATH_SUPPORT_DFS */ - -void -ar6000_tkip_micerr_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 keyid, A_BOOL ismcast) -{ - static const char *tag = "MLME-MICHAELMICFAILURE.indication"; - char buf[128]; - union iwreq_data wrqu; - - /* - * For AP case, keyid will have aid of STA which sent pkt with - * MIC error. Use this aid to get MAC & send it to hostapd. - */ - if (arPriv->arNetworkType == AP_NETWORK) { - conn_t *s = ieee80211_find_conn_for_aid(arPriv, (keyid >> 2)); - if(!s){ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AP TKIP MIC error received from Invalid aid / STA not found =%d\n", keyid)); - return; - } - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AP TKIP MIC error received from aid=%d\n", keyid)); - snprintf(buf,sizeof(buf), "%s addr=%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x", - tag, s->mac[0],s->mac[1],s->mac[2],s->mac[3],s->mac[4],s->mac[5]); - } else { - -#ifdef ATH6K_CONFIG_CFG80211 - ar6k_cfg80211_tkip_micerr_event(arPriv, keyid, ismcast); -#endif /* ATH6K_CONFIG_CFG80211 */ - - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR6000 TKIP MIC error received for keyid %d %scast\n", - keyid & 0x3, ismcast ? "multi": "uni")); - snprintf(buf, sizeof(buf), "%s(keyid=%d %sicast)", tag, keyid & 0x3, - ismcast ? "mult" : "un"); - } - - memset(&wrqu, 0, sizeof(wrqu)); - wrqu.data.length = strlen(buf); - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, buf); -} - -void -ar6000_scanComplete_event(AR_SOFTC_DEV_T *arPriv, A_STATUS status) -{ - -#ifdef ATH6K_CONFIG_CFG80211 - ar6k_cfg80211_scanComplete_event(arPriv, status); -#endif /* ATH6K_CONFIG_CFG80211 */ - - if (arPriv->arSoftc->arWmiReady && arPriv->arSoftc->arWlanState==WLAN_ENABLED) { - if (!arPriv->arSta.arUserBssFilter) { - wmi_bssfilter_cmd(arPriv->arWmi, NONE_BSS_FILTER, 0); - } - } - if (arPriv->arSta.scan_triggered) { - union iwreq_data wrqu; - A_MEMZERO(&wrqu, sizeof(wrqu)); - wireless_send_event(arPriv->arNetDev, SIOCGIWSCAN, &wrqu, NULL); - arPriv->arSta.scan_triggered = 0; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,( "AR6000 scan complete: %d\n", status)); -} - -void -ar6000_targetStats_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 *ptr, A_UINT32 len) -{ - A_UINT8 ac, i; - - if(arPriv->arNetworkType == AP_NETWORK) { - WMI_AP_MODE_STAT *p = (WMI_AP_MODE_STAT *)ptr; - WMI_PER_STA_STAT *ap = arPriv->arSoftc->arAPStats; - - if (len < sizeof(*p)) { - return; - } - - for(ac=0;acsta[ac].aid == 0) { - continue; - } - i = p->sta[ac].aid-1; - - ap[i].tx_bytes += p->sta[ac].tx_bytes; - ap[i].tx_pkts += p->sta[ac].tx_pkts; - ap[i].tx_error += p->sta[ac].tx_error; - ap[i].tx_discard += p->sta[ac].tx_discard; - ap[i].rx_bytes += p->sta[ac].rx_bytes; - ap[i].rx_pkts += p->sta[ac].rx_pkts; - ap[i].rx_error += p->sta[ac].rx_error; - ap[i].rx_discard += p->sta[ac].rx_discard; - } - } else { - WMI_TARGET_STATS *pTarget = (WMI_TARGET_STATS *)ptr; - TARGET_STATS *pStats = &arPriv->arTargetStats; - - if (len < sizeof(*pTarget)) { - return; - } - - // Update the RSSI of the connected bss. - if (arPriv->arConnected) { - bss_t *pConnBss = NULL; - - pConnBss = wmi_find_node(arPriv->arWmi,arPriv->arBssid); - if (pConnBss) - { - pConnBss->ni_rssi = pTarget->cservStats.cs_aveBeacon_rssi; - pConnBss->ni_snr = pTarget->cservStats.cs_aveBeacon_snr; - wmi_node_return(arPriv->arWmi, pConnBss); - } - } - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AR6000 updating target stats\n")); - pStats->tx_packets += pTarget->txrxStats.tx_stats.tx_packets; - pStats->tx_bytes += pTarget->txrxStats.tx_stats.tx_bytes; - pStats->tx_unicast_pkts += pTarget->txrxStats.tx_stats.tx_unicast_pkts; - pStats->tx_unicast_bytes += pTarget->txrxStats.tx_stats.tx_unicast_bytes; - pStats->tx_multicast_pkts += pTarget->txrxStats.tx_stats.tx_multicast_pkts; - pStats->tx_multicast_bytes += pTarget->txrxStats.tx_stats.tx_multicast_bytes; - pStats->tx_broadcast_pkts += pTarget->txrxStats.tx_stats.tx_broadcast_pkts; - pStats->tx_broadcast_bytes += pTarget->txrxStats.tx_stats.tx_broadcast_bytes; - pStats->tx_rts_success_cnt += pTarget->txrxStats.tx_stats.tx_rts_success_cnt; - for(ac = 0; ac < WMM_NUM_AC; ac++) - pStats->tx_packet_per_ac[ac] += pTarget->txrxStats.tx_stats.tx_packet_per_ac[ac]; - pStats->tx_errors += pTarget->txrxStats.tx_stats.tx_errors; - pStats->tx_failed_cnt += pTarget->txrxStats.tx_stats.tx_failed_cnt; - pStats->tx_retry_cnt += pTarget->txrxStats.tx_stats.tx_retry_cnt; - pStats->tx_mult_retry_cnt += pTarget->txrxStats.tx_stats.tx_mult_retry_cnt; - pStats->tx_rts_fail_cnt += pTarget->txrxStats.tx_stats.tx_rts_fail_cnt; - pStats->tx_unicast_rate = wmi_get_rate(pTarget->txrxStats.tx_stats.tx_unicast_rate); - - pStats->rx_packets += pTarget->txrxStats.rx_stats.rx_packets; - pStats->rx_bytes += pTarget->txrxStats.rx_stats.rx_bytes; - pStats->rx_unicast_pkts += pTarget->txrxStats.rx_stats.rx_unicast_pkts; - pStats->rx_unicast_bytes += pTarget->txrxStats.rx_stats.rx_unicast_bytes; - pStats->rx_multicast_pkts += pTarget->txrxStats.rx_stats.rx_multicast_pkts; - pStats->rx_multicast_bytes += pTarget->txrxStats.rx_stats.rx_multicast_bytes; - pStats->rx_broadcast_pkts += pTarget->txrxStats.rx_stats.rx_broadcast_pkts; - pStats->rx_broadcast_bytes += pTarget->txrxStats.rx_stats.rx_broadcast_bytes; - pStats->rx_fragment_pkt += pTarget->txrxStats.rx_stats.rx_fragment_pkt; - pStats->rx_errors += pTarget->txrxStats.rx_stats.rx_errors; - pStats->rx_crcerr += pTarget->txrxStats.rx_stats.rx_crcerr; - pStats->rx_key_cache_miss += pTarget->txrxStats.rx_stats.rx_key_cache_miss; - pStats->rx_decrypt_err += pTarget->txrxStats.rx_stats.rx_decrypt_err; - pStats->rx_duplicate_frames += pTarget->txrxStats.rx_stats.rx_duplicate_frames; - pStats->rx_unicast_rate = wmi_get_rate(pTarget->txrxStats.rx_stats.rx_unicast_rate); - - - pStats->tkip_local_mic_failure - += pTarget->txrxStats.tkipCcmpStats.tkip_local_mic_failure; - pStats->tkip_counter_measures_invoked - += pTarget->txrxStats.tkipCcmpStats.tkip_counter_measures_invoked; - pStats->tkip_replays += pTarget->txrxStats.tkipCcmpStats.tkip_replays; - pStats->tkip_format_errors += pTarget->txrxStats.tkipCcmpStats.tkip_format_errors; - pStats->ccmp_format_errors += pTarget->txrxStats.tkipCcmpStats.ccmp_format_errors; - pStats->ccmp_replays += pTarget->txrxStats.tkipCcmpStats.ccmp_replays; - - pStats->power_save_failure_cnt += pTarget->pmStats.power_save_failure_cnt; - pStats->noise_floor_calibation = pTarget->noise_floor_calibation; - - pStats->cs_bmiss_cnt += pTarget->cservStats.cs_bmiss_cnt; - pStats->cs_lowRssi_cnt += pTarget->cservStats.cs_lowRssi_cnt; - pStats->cs_connect_cnt += pTarget->cservStats.cs_connect_cnt; - pStats->cs_disconnect_cnt += pTarget->cservStats.cs_disconnect_cnt; - pStats->cs_aveBeacon_snr = pTarget->cservStats.cs_aveBeacon_snr; - pStats->cs_aveBeacon_rssi = pTarget->cservStats.cs_aveBeacon_rssi; - - if (enablerssicompensation) { - pStats->cs_aveBeacon_rssi = - rssi_compensation_calc(arPriv, pStats->cs_aveBeacon_rssi); - } - pStats->cs_lastRoam_msec = pTarget->cservStats.cs_lastRoam_msec; - pStats->cs_snr = pTarget->cservStats.cs_snr; - pStats->cs_rssi = pTarget->cservStats.cs_rssi; - - pStats->lq_val = pTarget->lqVal; - - pStats->wow_num_pkts_dropped += pTarget->wowStats.wow_num_pkts_dropped; - pStats->wow_num_host_pkt_wakeups += pTarget->wowStats.wow_num_host_pkt_wakeups; - pStats->wow_num_host_event_wakeups += pTarget->wowStats.wow_num_host_event_wakeups; - pStats->wow_num_events_discarded += pTarget->wowStats.wow_num_events_discarded; - pStats->arp_received += pTarget->arpStats.arp_received; - pStats->arp_matched += pTarget->arpStats.arp_matched; - pStats->arp_replied += pTarget->arpStats.arp_replied; - - if (arPriv->statsUpdatePending) { - arPriv->statsUpdatePending = FALSE; - wake_up(&arPriv->arEvent); - } - } -} - -void -ar6000_rssiThreshold_event(AR_SOFTC_DEV_T *arPriv, WMI_RSSI_THRESHOLD_VAL newThreshold, A_INT16 rssi) -{ - USER_RSSI_THOLD userRssiThold; - - rssi = rssi + SIGNAL_QUALITY_NOISE_FLOOR; - - if (enablerssicompensation) { - rssi = rssi_compensation_calc(arPriv, rssi); - } - - /* Send an event to the app */ - userRssiThold.tag = arPriv->arSta.rssi_map[newThreshold].tag; - userRssiThold.rssi = rssi; - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("rssi Threshold range = %d tag = %d rssi = %d\n", newThreshold, - userRssiThold.tag, userRssiThold.rssi)); - - ar6000_send_event_to_app(arPriv, WMI_RSSI_THRESHOLD_EVENTID,(A_UINT8 *)&userRssiThold, sizeof(USER_RSSI_THOLD)); -} - - -void -ar6000_hbChallengeResp_event(AR_SOFTC_DEV_T *arPriv, A_UINT32 cookie, A_UINT32 source) -{ - AR_SOFTC_T *ar = arPriv->arSoftc; - if (source == APP_HB_CHALLENGE) { - /* Report it to the app in case it wants a positive acknowledgement */ - ar6000_send_event_to_app(arPriv, WMIX_HB_CHALLENGE_RESP_EVENTID, - (A_UINT8 *)&cookie, sizeof(cookie)); - } else { - /* This would ignore the replys that come in after their due time */ - if (cookie == ar->arHBChallengeResp.seqNum) { - ar->arHBChallengeResp.outstanding = FALSE; - } - } -} - - -void -ar6000_reportError_event(AR_SOFTC_DEV_T *arPriv, WMI_TARGET_ERROR_VAL errorVal) -{ - char *errString[] = { - [WMI_TARGET_PM_ERR_FAIL] "WMI_TARGET_PM_ERR_FAIL", - [WMI_TARGET_KEY_NOT_FOUND] "WMI_TARGET_KEY_NOT_FOUND", - [WMI_TARGET_DECRYPTION_ERR] "WMI_TARGET_DECRYPTION_ERR", - [WMI_TARGET_BMISS] "WMI_TARGET_BMISS", - [WMI_PSDISABLE_NODE_JOIN] "WMI_PSDISABLE_NODE_JOIN" - }; - - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR6000 Error on Target. Error = 0x%x\n", errorVal)); - - /* One error is reported at a time, and errorval is a bitmask */ - if(errorVal & (errorVal - 1)) - return; - - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR6000 Error type = ")); - switch(errorVal) - { - case WMI_TARGET_PM_ERR_FAIL: - case WMI_TARGET_KEY_NOT_FOUND: - case WMI_TARGET_DECRYPTION_ERR: - case WMI_TARGET_BMISS: - case WMI_PSDISABLE_NODE_JOIN: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s\n", errString[errorVal])); - break; - default: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("INVALID\n")); - break; - } - -} - - -void -ar6000_cac_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 ac, A_UINT8 cacIndication, - A_UINT8 statusCode, A_UINT8 *tspecSuggestion) -{ - WMM_TSPEC_IE *tspecIe; - - /* - * This is the TSPEC IE suggestion from AP. - * Suggestion provided by AP under some error - * cases, could be helpful for the host app. - * Check documentation. - */ - tspecIe = (WMM_TSPEC_IE *)tspecSuggestion; - - /* - * What do we do, if we get TSPEC rejection? One thought - * that comes to mind is implictly delete the pstream... - */ - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AR6000 CAC notification. " - "AC = %d, cacIndication = 0x%x, statusCode = 0x%x\n", - ac, cacIndication, statusCode)); -} - -void -ar6000_channel_change_event(AR_SOFTC_DEV_T *arPriv, A_UINT16 oldChannel, - A_UINT16 newChannel) -{ - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Channel Change notification\nOld Channel: %d, New Channel: %d\n", - oldChannel, newChannel)); -} - -#define AR6000_PRINT_BSSID(_pBss) do { \ - A_PRINTF("%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x ",\ - (_pBss)[0],(_pBss)[1],(_pBss)[2],(_pBss)[3],\ - (_pBss)[4],(_pBss)[5]); \ -} while(0) - -void -ar6000_roam_tbl_event(AR_SOFTC_DEV_T *arPriv, WMI_TARGET_ROAM_TBL *pTbl) -{ - A_UINT8 i; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("ROAM TABLE NO OF ENTRIES is %d ROAM MODE is %d\n", - pTbl->numEntries, pTbl->roamMode)); - for (i= 0; i < pTbl->numEntries; i++) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("[%d]bssid %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x ", i, - pTbl->bssRoamInfo[i].bssid[0], pTbl->bssRoamInfo[i].bssid[1], - pTbl->bssRoamInfo[i].bssid[2], - pTbl->bssRoamInfo[i].bssid[3], - pTbl->bssRoamInfo[i].bssid[4], - pTbl->bssRoamInfo[i].bssid[5])); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("RSSI %d RSSIDT %d LAST RSSI %d UTIL %d ROAM_UTIL %d" - " BIAS %d\n", - pTbl->bssRoamInfo[i].rssi, - pTbl->bssRoamInfo[i].rssidt, - pTbl->bssRoamInfo[i].last_rssi, - pTbl->bssRoamInfo[i].util, - pTbl->bssRoamInfo[i].roam_util, - pTbl->bssRoamInfo[i].bias)); - } -} - -void -ar6000_wow_list_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 num_filters, WMI_GET_WOW_LIST_REPLY *wow_reply) -{ - A_UINT8 i,j; - - /*Each event now contains exactly one filter, see bug 26613*/ - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("WOW pattern %d of %d patterns\n", wow_reply->this_filter_num, wow_reply->num_filters)); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("wow mode = %s host mode = %s\n", - (wow_reply->wow_mode == 0? "disabled":"enabled"), - (wow_reply->host_mode == 1 ? "awake":"asleep"))); - - - /*If there are no patterns, the reply will only contain generic - WoW information. Pattern information will exist only if there are - patterns present. Bug 26716*/ - - /* If this event contains pattern information, display it*/ - if (wow_reply->this_filter_num) { - i=0; - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("id=%d size=%d offset=%d\n", - wow_reply->wow_filters[i].wow_filter_id, - wow_reply->wow_filters[i].wow_filter_size, - wow_reply->wow_filters[i].wow_filter_offset)); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("wow pattern = ")); - for (j=0; j< wow_reply->wow_filters[i].wow_filter_size; j++) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("%2.2x",wow_reply->wow_filters[i].wow_filter_pattern[j])); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("\nwow mask = ")); - for (j=0; j< wow_reply->wow_filters[i].wow_filter_size; j++) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("%2.2x",wow_reply->wow_filters[i].wow_filter_mask[j])); - } - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("\n")); - } -} - -/* - * Report the Roaming related data collected on the target - */ -void -ar6000_display_roam_time(WMI_TARGET_ROAM_TIME *p) -{ - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Disconnect Data : BSSID: ")); - AR6000_PRINT_BSSID(p->disassoc_bssid); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,(" RSSI %d DISASSOC Time %d NO_TXRX_TIME %d\n", - p->disassoc_bss_rssi,p->disassoc_time, - p->no_txrx_time)); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Connect Data: BSSID: ")); - AR6000_PRINT_BSSID(p->assoc_bssid); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,(" RSSI %d ASSOC Time %d TXRX_TIME %d\n", - p->assoc_bss_rssi,p->assoc_time, - p->allow_txrx_time)); -} - -void -ar6000_roam_data_event(AR_SOFTC_DEV_T *arPriv, WMI_TARGET_ROAM_DATA *p) -{ - switch (p->roamDataType) { - case ROAM_DATA_TIME: - ar6000_display_roam_time(&p->u.roamTime); - break; - default: - break; - } -} - -void -ar6000_bssInfo_event_rx(AR_SOFTC_DEV_T *arPriv, A_UINT8 *datap, int len) -{ - struct sk_buff *skb; - WMI_BSS_INFO_HDR *bih = (WMI_BSS_INFO_HDR *)datap; - - - if (!arPriv->arSta.arMgmtFilter) { - return; - } - if (((arPriv->arSta.arMgmtFilter & IEEE80211_FILTER_TYPE_BEACON) && - (bih->frameType != BEACON_FTYPE)) || - ((arPriv->arSta.arMgmtFilter & IEEE80211_FILTER_TYPE_PROBE_RESP) && - (bih->frameType != PROBERESP_FTYPE))) - { - return; - } - - if ((skb = A_NETBUF_ALLOC_RAW(len)) != NULL) { - - A_NETBUF_PUT(skb, len); - A_MEMCPY(A_NETBUF_DATA(skb), datap, len); - skb->dev = arPriv->arNetDev; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) - A_MEMCPY(skb_mac_header(skb), A_NETBUF_DATA(skb), 6); -#else - skb->mac.raw = A_NETBUF_DATA(skb); -#endif - skb->ip_summed = CHECKSUM_NONE; - skb->pkt_type = PACKET_OTHERHOST; - skb->protocol = __constant_htons(0x0019); - A_NETIF_RX(skb); - } -} - -A_UINT32 wmiSendCmdNum; - -A_STATUS -ar6000_control_tx(void *devt, void *osbuf, HTC_ENDPOINT_ID eid) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)devt; - AR_SOFTC_T *ar = arPriv->arSoftc; - A_STATUS status = A_OK; - struct ar_cookie *cookie = NULL; - int i; - -#ifdef CONFIG_PM - if (ar->arWowState == WLAN_WOW_STATE_SUSPENDED) { - return A_EACCES; - } -#endif /* CONFIG_PM */ - /* take lock to protect ar6000_alloc_cookie() */ - AR6000_SPIN_LOCK(&ar->arLock, 0); - - do { - - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_TX,("ar_contrstatus = ol_tx: skb=0x%x, len=0x%x eid =%d\n", - (A_UINT32)osbuf, A_NETBUF_LEN(osbuf), eid)); - - if (ar->arWMIControlEpFull && (eid == ar->arControlEp)) { - /* control endpoint is full, don't allocate resources, we - * are just going to drop this packet */ - cookie = NULL; - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" WMI Control EP full, dropping packet : 0x%X, len:%d \n", - (A_UINT32)osbuf, A_NETBUF_LEN(osbuf))); -#ifdef ANDROID_ENV - if (++android_epfull_cnt > ANDROID_RELOAD_THRESHOLD_FOR_EP_FULL) { - android_send_reload_event(arPriv); - android_epfull_cnt = 0; - } -#endif - } else { - cookie = ar6000_alloc_cookie(ar); - } - - if (cookie == NULL) { - status = A_NO_MEMORY; - break; - } - - if(logWmiRawMsgs) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("WMI cmd send, msgNo %d :", wmiSendCmdNum)); - for(i = 0; i < a_netbuf_to_len(osbuf); i++) - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("%x ", ((A_UINT8 *)a_netbuf_to_data(osbuf))[i])); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("\n")); - } - - wmiSendCmdNum++; - - } while (FALSE); - - if (cookie != NULL) { - /* got a structure to send it out on */ - ar->arTxPending[eid]++; - - if (eid != ar->arControlEp) { - ar->arTotalTxDataPending++; - } - } - - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - - if (cookie != NULL) { - cookie->arc_bp[0] = (A_UINT32)osbuf; - cookie->arc_bp[1] = 0; - SET_HTC_PACKET_INFO_TX(&cookie->HtcPkt, - cookie, - A_NETBUF_DATA(osbuf), - A_NETBUF_LEN(osbuf), - eid, - AR6K_CONTROL_PKT_TAG); - /* this interface is asynchronous, if there is an error, cleanup will happen in the - * TX completion callback */ - HTCSendPkt(ar->arHtcTarget, &cookie->HtcPkt); - status = A_OK; - } - - return status; -} - -/* indicate tx activity or inactivity on a WMI stream */ -void ar6000_indicate_tx_activity(void *devt, A_UINT8 TrafficClass, A_BOOL Active) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)devt; - AR_SOFTC_T *ar = arPriv->arSoftc; - HTC_ENDPOINT_ID eid ; - int i; - - if (ar->arWmiReady) { - eid = arAc2EndpointID(ar, TrafficClass); - - AR6000_SPIN_LOCK(&ar->arLock, 0); - - ar->arAcStreamActive[TrafficClass] = Active; - - if (Active) { - /* when a stream goes active, keep track of the active stream with the highest priority */ - - if (ar->arAcStreamPriMap[TrafficClass] > ar->arHiAcStreamActivePri) { - /* set the new highest active priority */ - ar->arHiAcStreamActivePri = ar->arAcStreamPriMap[TrafficClass]; - } - - } else { - /* when a stream goes inactive, we may have to search for the next active stream - * that is the highest priority */ - - if (ar->arHiAcStreamActivePri == ar->arAcStreamPriMap[TrafficClass]) { - - /* the highest priority stream just went inactive */ - - /* reset and search for the "next" highest "active" priority stream */ - ar->arHiAcStreamActivePri = 0; - for (i = 0; i < WMM_NUM_AC; i++) { - if (ar->arAcStreamActive[i]) { - if (ar->arAcStreamPriMap[i] > ar->arHiAcStreamActivePri) { - /* set the new highest active priority */ - ar->arHiAcStreamActivePri = ar->arAcStreamPriMap[i]; - } - } - } - } - } - - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - - } else { - /* for mbox ping testing, the traffic class is mapped directly as a stream ID, - * see handling of AR6000_XIOCTL_TRAFFIC_ACTIVITY_CHANGE in ioctl.c - * convert the stream ID to a endpoint */ - eid = arAc2EndpointID(ar, TrafficClass); - } - - /* notify HTC, this may cause credit distribution changes */ - - HTCIndicateActivityChange(ar->arHtcTarget, - eid, - Active); - -} - -void -ar6000_btcoex_config_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 *ptr, A_UINT32 len) -{ - - WMI_BTCOEX_CONFIG_EVENT *pBtcoexConfig = (WMI_BTCOEX_CONFIG_EVENT *)ptr; - WMI_BTCOEX_CONFIG_EVENT *pArbtcoexConfig =&arPriv->arBtcoexConfig; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AR6000 BTCOEX CONFIG EVENT \n")); - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("received config event\n")); - pArbtcoexConfig->btProfileType = pBtcoexConfig->btProfileType; - pArbtcoexConfig->linkId = pBtcoexConfig->linkId; - - switch (pBtcoexConfig->btProfileType) { - case WMI_BTCOEX_BT_PROFILE_SCO: - A_MEMCPY(&pArbtcoexConfig->info.scoConfigCmd, &pBtcoexConfig->info.scoConfigCmd, - sizeof(WMI_SET_BTCOEX_SCO_CONFIG_CMD)); - break; - case WMI_BTCOEX_BT_PROFILE_A2DP: - A_MEMCPY(&pArbtcoexConfig->info.a2dpConfigCmd, &pBtcoexConfig->info.a2dpConfigCmd, - sizeof(WMI_SET_BTCOEX_A2DP_CONFIG_CMD)); - break; - case WMI_BTCOEX_BT_PROFILE_ACLCOEX: - A_MEMCPY(&pArbtcoexConfig->info.aclcoexConfig, &pBtcoexConfig->info.aclcoexConfig, - sizeof(WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD)); - break; - case WMI_BTCOEX_BT_PROFILE_INQUIRY_PAGE: - A_MEMCPY(&pArbtcoexConfig->info.btinquiryPageConfigCmd, &pBtcoexConfig->info.btinquiryPageConfigCmd, - sizeof(WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMD)); - break; - } - if (arPriv->statsUpdatePending) { - arPriv->statsUpdatePending = FALSE; - wake_up(&arPriv->arEvent); - } -} - -void -ar6000_btcoex_stats_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 *ptr, A_UINT32 len) -{ - WMI_BTCOEX_STATS_EVENT *pBtcoexStats = (WMI_BTCOEX_STATS_EVENT *)ptr; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AR6000 BTCOEX CONFIG EVENT \n")); - - A_MEMCPY(&arPriv->arBtcoexStats, pBtcoexStats, sizeof(WMI_BTCOEX_STATS_EVENT)); - - if (arPriv->statsUpdatePending) { - arPriv->statsUpdatePending = FALSE; - wake_up(&arPriv->arEvent); - } - -} - -void -ar6000_wacinfo_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 *ptr, A_UINT32 len) -{ - WMI_GET_WAC_INFO *pWacInfo = (WMI_GET_WAC_INFO *)ptr; - - A_MEMCPY(&arPriv->wacInfo, pWacInfo, sizeof(WMI_GET_WAC_INFO)); - - if (arPriv->statsUpdatePending) { - arPriv->statsUpdatePending = FALSE; - wake_up(&arPriv->arEvent); - } -} - -#ifndef RK29 -module_init(ar6000_init_module); -module_exit(ar6000_cleanup_module); -#endif - -/* Init cookie queue */ -static void -ar6000_cookie_init(AR_SOFTC_T *ar) -{ - A_UINT32 i; - - ar->arCookieList = NULL; - ar->arCookieCount = 0; - - A_MEMZERO(s_ar_cookie_mem, sizeof(s_ar_cookie_mem)); - - for (i = 0; i < MAX_COOKIE_NUM; i++) { - ar6000_free_cookie(ar, &s_ar_cookie_mem[i]); - } -} - -/* cleanup cookie queue */ -static void -ar6000_cookie_cleanup(AR_SOFTC_T *ar) -{ - /* It is gone .... */ - ar->arCookieList = NULL; - ar->arCookieCount = 0; -} - -/* Init cookie queue */ -static void -ar6000_free_cookie(AR_SOFTC_T *ar, struct ar_cookie * cookie) -{ - /* Insert first */ - A_ASSERT(ar != NULL); - A_ASSERT(cookie != NULL); - - cookie->arc_list_next = ar->arCookieList; - ar->arCookieList = cookie; - ar->arCookieCount++; -} - -/* cleanup cookie queue */ -static struct ar_cookie * -ar6000_alloc_cookie(AR_SOFTC_T *ar) -{ - struct ar_cookie *cookie; - - cookie = ar->arCookieList; - if(cookie != NULL) - { - ar->arCookieList = cookie->arc_list_next; - ar->arCookieCount--; - } - - return cookie; -} - -#ifdef SEND_EVENT_TO_APP -/* - * This function is used to send event which come from taget to - * the application. The buf which send to application is include - * the event ID and event content. - */ -#define EVENT_ID_LEN 2 -void ar6000_send_event_to_app(AR_SOFTC_DEV_T *arPriv, A_UINT16 eventId, - A_UINT8 *datap, int len) -{ - -#if (WIRELESS_EXT >= 15) - -/* note: IWEVCUSTOM only exists in wireless extensions after version 15 */ - - char *buf; - A_UINT16 size; - union iwreq_data wrqu; - - size = len + EVENT_ID_LEN; - - if (size > IW_CUSTOM_MAX) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("WMI event ID : 0x%4.4X, len = %d too big for IWEVCUSTOM (max=%d) \n", - eventId, size, IW_CUSTOM_MAX)); - return; - } - - buf = A_MALLOC_NOWAIT(size); - if (NULL == buf){ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: failed to allocate %d bytes\n", __func__, size)); - return; - } - - A_MEMZERO(buf, size); - A_MEMCPY(buf, &eventId, EVENT_ID_LEN); - A_MEMCPY(buf+EVENT_ID_LEN, datap, len); - - //AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("event ID = %d,len = %d\n",*(A_UINT16*)buf, size)); - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = size; - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, buf); - A_FREE(buf); - -#ifdef ANDROID_ENV - if (eventId == WMI_ERROR_REPORT_EVENTID) { - android_send_reload_event(arPriv); - } -#endif /* ANDROID_ENV */ - -#endif - - -} - -/* - * This function is used to send events larger than 256 bytes - * to the application. The buf which is sent to application - * includes the event ID and event content. - */ -void ar6000_send_generic_event_to_app(AR_SOFTC_DEV_T *arPriv, A_UINT16 eventId, - A_UINT8 *datap, int len) -{ - -#if (WIRELESS_EXT >= 18) - -/* IWEVGENIE exists in wireless extensions version 18 onwards */ - - char *buf; - A_UINT16 size; - union iwreq_data wrqu; - - size = len + EVENT_ID_LEN; - - if (size > IW_GENERIC_IE_MAX) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("WMI event ID : 0x%4.4X, len = %d too big for IWEVGENIE (max=%d) \n", - eventId, size, IW_GENERIC_IE_MAX)); - return; - } - - buf = A_MALLOC_NOWAIT(size); - if (NULL == buf){ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: failed to allocate %d bytes\n", __func__, size)); - return; - } - - A_MEMZERO(buf, size); - A_MEMCPY(buf, &eventId, EVENT_ID_LEN); - A_MEMCPY(buf+EVENT_ID_LEN, datap, len); - - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = size; - wireless_send_event(arPriv->arNetDev, IWEVGENIE, &wrqu, buf); - - A_FREE(buf); - -#endif /* (WIRELESS_EXT >= 18) */ - -} -#endif /* SEND_EVENT_TO_APP */ - - -void -ar6000_tx_retry_err_event(void *devt) -{ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Tx retries reach maximum!\n")); -} - -void -ar6000_snrThresholdEvent_rx(void *devt, WMI_SNR_THRESHOLD_VAL newThreshold, A_UINT8 snr) -{ - WMI_SNR_THRESHOLD_EVENT event; - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)devt; - - event.range = newThreshold; - event.snr = snr; - - ar6000_send_event_to_app(arPriv, WMI_SNR_THRESHOLD_EVENTID, (A_UINT8 *)&event, - sizeof(WMI_SNR_THRESHOLD_EVENT)); -} - -void -ar6000_lqThresholdEvent_rx(void *devt, WMI_LQ_THRESHOLD_VAL newThreshold, A_UINT8 lq) -{ - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("lq threshold range %d, lq %d\n", newThreshold, lq)); -} - - - -A_UINT32 -a_copy_to_user(void *to, const void *from, A_UINT32 n) -{ - return(copy_to_user(to, from, n)); -} - -A_UINT32 -a_copy_from_user(void *to, const void *from, A_UINT32 n) -{ - return(copy_from_user(to, from, n)); -} - - -A_STATUS -ar6000_get_driver_cfg(struct net_device *dev, - A_UINT16 cfgParam, - void *result) -{ - A_STATUS ret = A_OK; - - switch(cfgParam) - { - case AR6000_DRIVER_CFG_GET_WLANNODECACHING: - *((A_UINT32 *)result) = wlanNodeCaching; - break; - case AR6000_DRIVER_CFG_LOG_RAW_WMI_MSGS: - *((A_UINT32 *)result) = logWmiRawMsgs; - break; - default: - ret = A_EINVAL; - break; - } - - return ret; -} - -void -ar6000_keepalive_rx(void *devt, A_UINT8 configured) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)devt; - - arPriv->arSta.arKeepaliveConfigured = configured; - wake_up(&arPriv->arEvent); -} - -void -ar6000_pmkid_list_event(void *devt, A_UINT8 numPMKID, WMI_PMKID *pmkidList, - A_UINT8 *bssidList) -{ - A_UINT8 i, j; - - A_PRINTF("Number of Cached PMKIDs is %d\n", numPMKID); - - for (i = 0; i < numPMKID; i++) { - A_PRINTF("\nBSSID %d ", i); - for (j = 0; j < ATH_MAC_LEN; j++) { - A_PRINTF("%2.2x", bssidList[j]); - } - bssidList += (ATH_MAC_LEN + WMI_PMKID_LEN); - A_PRINTF("\nPMKID %d ", i); - for (j = 0; j < WMI_PMKID_LEN; j++) { - A_PRINTF("%2.2x", pmkidList->pmkid[j]); - } - pmkidList = (WMI_PMKID *)((A_UINT8 *)pmkidList + ATH_MAC_LEN + - WMI_PMKID_LEN); - } -} - -void ar6000_pspoll_event(AR_SOFTC_DEV_T *arPriv,A_UINT8 aid) -{ - conn_t *conn=NULL; - A_BOOL isPsqEmpty = FALSE; - - conn = ieee80211_find_conn_for_aid(arPriv, aid); - - if(!conn) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("PS-POLL from invalid STA\n")); - return; - } - - /* If the PS q for this STA is not empty, dequeue and send a pkt from - * the head of the q. Also update the More data bit in the WMI_DATA_HDR - * if there are more pkts for this STA in the PS q. If there are no more - * pkts for this STA, update the PVB for this STA. - */ - A_MUTEX_LOCK(&conn->psqLock); - isPsqEmpty = A_NETBUF_QUEUE_EMPTY(&conn->psq); - A_MUTEX_UNLOCK(&conn->psqLock); - - if (isPsqEmpty) { - /* TODO:No buffered pkts for this STA. Send out a NULL data frame */ - } else { - struct sk_buff *skb = NULL; - - A_MUTEX_LOCK(&conn->psqLock); - skb = A_NETBUF_DEQUEUE(&conn->psq); - A_MUTEX_UNLOCK(&conn->psqLock); - /* Set the STA flag to PSPolled, so that the frame will go out */ - STA_SET_PS_POLLED(conn); - ar6000_data_tx(skb, arPriv->arNetDev); - STA_CLR_PS_POLLED(conn); - - A_MUTEX_LOCK(&conn->psqLock); - isPsqEmpty = A_NETBUF_QUEUE_EMPTY(&conn->psq); - A_MUTEX_UNLOCK(&conn->psqLock); - - } - - /* Clear the PVB for this STA if the queue has become empty */ - if (isPsqEmpty) { - wmi_set_pvb_cmd(arPriv->arWmi, conn->aid, 0); - } -} - -void ar6000_dtimexpiry_event(AR_SOFTC_DEV_T *arPriv) -{ - A_BOOL isMcastQueued = FALSE; - struct sk_buff *skb = NULL; - AR_SOFTC_AP_T *arAp = &arPriv->arAp; - - /* If there are no associated STAs, ignore the DTIM expiry event. - * There can be potential race conditions where the last associated - * STA may disconnect & before the host could clear the 'Indicate DTIM' - * request to the firmware, the firmware would have just indicated a DTIM - * expiry event. The race is between 'clear DTIM expiry cmd' going - * from the host to the firmware & the DTIM expiry event happening from - * the firmware to the host. - */ - if (arAp->sta_list_index == 0) { - return; - } - - A_MUTEX_LOCK(&arAp->mcastpsqLock); - isMcastQueued = A_NETBUF_QUEUE_EMPTY(&arAp->mcastpsq); - A_MUTEX_UNLOCK(&arAp->mcastpsqLock); - - if(isMcastQueued == TRUE) { - return; - } - - /* Flush the mcast psq to the target */ - /* Set the STA flag to DTIMExpired, so that the frame will go out */ - arAp->DTIMExpired = TRUE; - - A_MUTEX_LOCK(&arAp->mcastpsqLock); - while (!A_NETBUF_QUEUE_EMPTY(&arAp->mcastpsq)) { - skb = A_NETBUF_DEQUEUE(&arAp->mcastpsq); - A_MUTEX_UNLOCK(&arAp->mcastpsqLock); - - ar6000_data_tx(skb, arPriv->arNetDev); - - A_MUTEX_LOCK(&arAp->mcastpsqLock); - } - A_MUTEX_UNLOCK(&arAp->mcastpsqLock); - - /* Reset the DTIMExpired flag back to 0 */ - arAp->DTIMExpired = FALSE; - - /* Clear the LSB of the BitMapCtl field of the TIM IE */ - wmi_set_pvb_cmd(arPriv->arWmi, MCAST_AID, 0); -} - -static void ar6000_uapsd_trigger_frame_rx(AR_SOFTC_DEV_T *arPriv, conn_t *conn) -{ - A_BOOL isApsdqEmpty; - A_BOOL isApsdqEmptyAtStart; - A_UINT32 numFramesToDeliver; - - /* If the APSD q for this STA is not empty, dequeue and send a pkt from - * the head of the q. Also update the More data bit in the WMI_DATA_HDR - * if there are more pkts for this STA in the APSD q. If there are no more - * pkts for this STA, update the APSD bitmap for this STA. - */ - - numFramesToDeliver = (conn->apsd_info >> 4) & 0xF; - - /* Number of frames to send in a service period is indicated by the station - * in the QOS_INFO of the association request - * If it is zero, send all frames - */ - if (!numFramesToDeliver) { - numFramesToDeliver = 0xFFFF; - } - - A_MUTEX_LOCK(&conn->psqLock); - isApsdqEmpty = A_NETBUF_QUEUE_EMPTY(&conn->apsdq); - A_MUTEX_UNLOCK(&conn->psqLock); - isApsdqEmptyAtStart = isApsdqEmpty; - - while ((!isApsdqEmpty) && (numFramesToDeliver)) { - struct sk_buff *skb = NULL; - - A_MUTEX_LOCK(&conn->psqLock); - skb = A_NETBUF_DEQUEUE(&conn->apsdq); - isApsdqEmpty = A_NETBUF_QUEUE_EMPTY(&conn->apsdq); - A_MUTEX_UNLOCK(&conn->psqLock); - - /* Set the STA flag to Trigger delivery, so that the frame will go out */ - STA_SET_APSD_TRIGGER(conn); - numFramesToDeliver--; - - /* Last frame in the service period, set EOSP or queue empty */ - if ((isApsdqEmpty) || (!numFramesToDeliver)) { - STA_SET_APSD_EOSP(conn); - } - ar6000_data_tx(skb, arPriv->arNetDev); - STA_CLR_APSD_TRIGGER(conn); - STA_CLR_APSD_EOSP(conn); - } - - if (isApsdqEmpty) { - if (isApsdqEmptyAtStart) { - wmi_set_apsd_buffered_traffic_cmd(arPriv->arWmi, conn->aid, 0, - WMI_AP_APSD_NO_DELIVERY_FRAMES_FOR_THIS_TRIGGER); - } else { - wmi_set_apsd_buffered_traffic_cmd(arPriv->arWmi, conn->aid, 0, 0); - } - } - - return; -} - -void -read_rssi_compensation_param(AR_SOFTC_T *ar) -{ - A_UINT8 *cust_data_ptr; - USER_RSSI_CPENSATION *rssi_compensation_param; -//#define RSSICOMPENSATION_PRINT -#ifdef RSSICOMPENSATION_PRINT - A_INT16 i; - cust_data_ptr = ar6000_get_cust_data_buffer(ar->arTargetType); - for (i=0; i<16; i++) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("cust_data_%d = %x \n", i, *(A_UINT8 *)cust_data_ptr)); - cust_data_ptr += 1; - } -#endif - rssi_compensation_param = &ar->rssi_compensation_param; - cust_data_ptr = ar6000_get_cust_data_buffer(ar->arTargetType); - - rssi_compensation_param->customerID = *(A_UINT16 *)cust_data_ptr & 0xffff; - rssi_compensation_param->enable = *(A_UINT16 *)(cust_data_ptr+2) & 0xffff; - rssi_compensation_param->bg_param_a = *(A_UINT16 *)(cust_data_ptr+4) & 0xffff; - rssi_compensation_param->bg_param_b = *(A_UINT16 *)(cust_data_ptr+6) & 0xffff; - rssi_compensation_param->a_param_a = *(A_UINT16 *)(cust_data_ptr+8) & 0xffff; - rssi_compensation_param->a_param_b = *(A_UINT16 *)(cust_data_ptr+10) &0xffff; - rssi_compensation_param->reserved = *(A_UINT32 *)(cust_data_ptr+12); - -#ifdef RSSICOMPENSATION_PRINT - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("customerID = 0x%x \n", rssi_compensation_param->customerID)); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("enable = 0x%x \n", rssi_compensation_param->enable)); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("bg_param_a = 0x%x and %d \n", rssi_compensation_param->bg_param_a, rssi_compensation_param->bg_param_a)); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("bg_param_b = 0x%x and %d \n", rssi_compensation_param->bg_param_b, rssi_compensation_param->bg_param_b)); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("a_param_a = 0x%x and %d \n", rssi_compensation_param->a_param_a, rssi_compensation_param->a_param_a)); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("a_param_b = 0x%x and %d \n", rssi_compensation_param->a_param_b, rssi_compensation_param->a_param_b)); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Last 4 bytes = 0x%x \n", rssi_compensation_param->reserved)); -#endif - - if (rssi_compensation_param->enable != 0x1) { - rssi_compensation_param->enable = 0; - } - - return; -} - -A_INT32 -rssi_compensation_calc_tcmd(AR_SOFTC_T *ar, A_UINT32 freq, A_INT32 rssi, A_UINT32 totalPkt) -{ - USER_RSSI_CPENSATION *rssi_compensation_param; - - rssi_compensation_param = &ar->rssi_compensation_param; - - if (freq > 5000) - { - if (rssi_compensation_param->enable) - { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, (">>> 11a\n")); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("rssi before compensation = %d, totalPkt = %d\n", rssi,totalPkt)); - rssi = rssi * rssi_compensation_param->a_param_a + totalPkt * rssi_compensation_param->a_param_b; - rssi = (rssi-50) /100; - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("rssi after compensation = %d\n", rssi)); - } - } - else - { - if (rssi_compensation_param->enable) - { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, (">>> 11bg\n")); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("rssi before compensation = %d, totalPkt = %d\n", rssi,totalPkt)); - rssi = rssi * rssi_compensation_param->bg_param_a + totalPkt * rssi_compensation_param->bg_param_b; - rssi = (rssi-50) /100; - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("rssi after compensation = %d\n", rssi)); - } - } - - return rssi; -} - -A_INT16 -rssi_compensation_calc(AR_SOFTC_DEV_T *arPriv, A_INT16 rssi) -{ - USER_RSSI_CPENSATION *rssi_compensation_param; - AR_SOFTC_T *ar = arPriv->arSoftc; - - rssi_compensation_param = &ar->rssi_compensation_param; - - if (arPriv->arBssChannel > 5000) - { - if (rssi_compensation_param->enable) - { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, (">>> 11a\n")); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("rssi before compensation = %d\n", rssi)); - rssi = rssi * rssi_compensation_param->a_param_a + rssi_compensation_param->a_param_b; - rssi = (rssi-50) /100; - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("rssi after compensation = %d\n", rssi)); - } - } - else - { - if (rssi_compensation_param->enable) - { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, (">>> 11bg\n")); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("rssi before compensation = %d\n", rssi)); - rssi = rssi * rssi_compensation_param->bg_param_a + rssi_compensation_param->bg_param_b; - rssi = (rssi-50) /100; - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("rssi after compensation = %d\n", rssi)); - } - } - - return rssi; -} - -A_INT16 -rssi_compensation_reverse_calc(AR_SOFTC_DEV_T *arPriv, A_INT16 rssi, A_BOOL Above) -{ - A_INT16 i; - - USER_RSSI_CPENSATION *rssi_compensation_param; - AR_SOFTC_T *ar = arPriv->arSoftc; - - rssi_compensation_param = &ar->rssi_compensation_param; - - if (arPriv->arBssChannel > 5000) - { - if (rssi_compensation_param->enable) - { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, (">>> 11a\n")); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("rssi before rev compensation = %d\n", rssi)); - rssi = rssi * 100; - rssi = (rssi - rssi_compensation_param->a_param_b) / rssi_compensation_param->a_param_a; - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("rssi after rev compensation = %d\n", rssi)); - } - } - else - { - if (rssi_compensation_param->enable) - { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, (">>> 11bg\n")); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("rssi before rev compensation = %d\n", rssi)); - - if (Above) { - for (i=95; i>=0; i--) { - if (rssi <= rssi_compensation_table[arPriv->arDeviceIndex][i]) { - rssi = 0 - i; - break; - } - } - } else { - for (i=0; i<=95; i++) { - if (rssi >= rssi_compensation_table[arPriv->arDeviceIndex][i]) { - rssi = 0 - i; - break; - } - } - } - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("rssi after rev compensation = %d\n", rssi)); - } - } - - return rssi; -} - -#ifdef WAPI_ENABLE -void ap_wapi_rekey_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 type, A_UINT8 *mac) -{ - union iwreq_data wrqu; - A_CHAR buf[20]; - - A_MEMZERO(buf, sizeof(buf)); - - strcpy(buf, "WAPI_REKEY"); - buf[10] = type; - A_MEMCPY(&buf[11], mac, ATH_MAC_LEN); - - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = 10+1+ATH_MAC_LEN; - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, buf); - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("WAPI REKEY - %d - %02x:%02x\n", type, mac[4], mac[5])); -} -#endif - -#ifdef P2P -void *get_p2p_ctx(AR_SOFTC_DEV_T *arPriv) -{ - return (arPriv->p2p_ctx); -} - -void *get_wmi_ctx(AR_SOFTC_DEV_T *arPriv) -{ - return (arPriv->arWmi); -} - -NETWORK_SUBTYPE get_network_subtype(AR_SOFTC_DEV_T *arPriv) -{ - return (arPriv->arNetworkSubType); -} - -#endif /* P2P */ - -#ifdef USER_KEYS -static A_STATUS - -ar6000_reinstall_keys(AR_SOFTC_DEV_T *arPriv, A_UINT8 key_op_ctrl) -{ - A_STATUS status = A_OK; - struct ieee80211req_key *uik = &arPriv->arSta.user_saved_keys.ucast_ik; - struct ieee80211req_key *bik = &arPriv->arSta.user_saved_keys.bcast_ik; - CRYPTO_TYPE keyType = arPriv->arSta.user_saved_keys.keyType; - - if (IEEE80211_CIPHER_CCKM_KRK != uik->ik_type) { - if (NONE_CRYPT == keyType) { - goto _reinstall_keys_out; - } - - if (uik->ik_keylen) { - status = wmi_addKey_cmd(arPriv->arWmi, uik->ik_keyix, - keyType, PAIRWISE_USAGE, - uik->ik_keylen, (A_UINT8 *)&uik->ik_keyrsc, - uik->ik_keydata, key_op_ctrl, uik->ik_macaddr, SYNC_BEFORE_WMIFLAG); - } - - } else { - status = wmi_add_krk_cmd(arPriv->arWmi, uik->ik_keydata); - } - - if (IEEE80211_CIPHER_CCKM_KRK != bik->ik_type) { - if (NONE_CRYPT == keyType) { - goto _reinstall_keys_out; - } - - if (bik->ik_keylen) { - status = wmi_addKey_cmd(arPriv->arWmi, bik->ik_keyix, - keyType, GROUP_USAGE, - bik->ik_keylen, (A_UINT8 *)&bik->ik_keyrsc, - bik->ik_keydata, key_op_ctrl, bik->ik_macaddr, NO_SYNC_WMIFLAG); - } - } else { - status = wmi_add_krk_cmd(arPriv->arWmi, bik->ik_keydata); - } - -_reinstall_keys_out: - arPriv->arSta.user_savedkeys_stat = USER_SAVEDKEYS_STAT_INIT; - arPriv->arSta.user_key_ctrl = 0; - - return status; -} -#endif /* USER_KEYS */ - - -void -ar6000_dset_open_req( - void *context, - A_UINT32 id, - A_UINT32 targHandle, - A_UINT32 targReplyFn, - A_UINT32 targReplyArg) -{ -} - -void -ar6000_dset_close( - void *context, - A_UINT32 access_cookie) -{ - return; -} - -void -ar6000_dset_data_req( - void *context, - A_UINT32 accessCookie, - A_UINT32 offset, - A_UINT32 length, - A_UINT32 targBuf, - A_UINT32 targReplyFn, - A_UINT32 targReplyArg) -{ -} -void -ar6000_init_mode_info(AR_SOFTC_DEV_T *arPriv) -{ - AR_SOFTC_T *ar = arPriv->arSoftc; - - arPriv->arDot11AuthMode = OPEN_AUTH; - arPriv->arAuthMode = WMI_NONE_AUTH; - arPriv->arPairwiseCrypto = NONE_CRYPT; - arPriv->arPairwiseCryptoLen = 0; - arPriv->arGroupCrypto = NONE_CRYPT; - arPriv->arGroupCryptoLen = 0; - arPriv->arChannelHint = 0; - arPriv->arDefTxKeyIndex = 0; - A_MEMZERO(arPriv->arBssid, sizeof(arPriv->arBssid)); - A_MEMZERO(arPriv->arSsid, sizeof(arPriv->arSsid)); - A_MEMZERO(arPriv->arWepKeyList, sizeof(arPriv->arWepKeyList)); - arPriv->arSsidLen = 0; - arPriv->arTxPwr = 0; - arPriv->arTxPwrSet = FALSE; - arPriv->arBitRate = -1; - arPriv->arMaxRetries = 0; - arPriv->arWmmEnabled = TRUE; - arPriv->ap_profile_flag = 0; - arPriv->num_sta = 0xFF; - ar->gNumSta = AP_MAX_NUM_STA; - - if(arPriv->arNextMode == AP_NETWORK) { - AR_SOFTC_AP_T *arAp; - if(arPriv->arNetworkType != AP_NETWORK) { - A_MEMZERO(&arPriv->arSta,sizeof(AR_SOFTC_STA_T)); - } - arAp = &arPriv->arAp; - arAp->intra_bss = 1; - ar->inter_bss = 1; - - /* init the Mutexes */ - A_NETBUF_QUEUE_INIT(&arAp->mcastpsq); - A_MUTEX_INIT(&arAp->mcastpsqLock); - A_MEMCPY(arAp->ap_country_code, DEF_AP_COUNTRY_CODE, 3); - if (arPriv->arPhyCapability == WMI_11NAG_CAPABILITY){ - arPriv->phymode = DEF_AP_WMODE_AG; - } else { - arPriv->phymode = DEF_AP_WMODE_G; - } - arAp->ap_dtim_period = DEF_AP_DTIM; - arAp->ap_beacon_interval = DEF_BEACON_INTERVAL; - A_INIT_TIMER(&arPriv->ap_acs_timer,ap_acs_handler, arPriv); - A_INIT_TIMER(&ar->ap_reconnect_timer,ap_reconnect_timer_handler, ar); - } else { - /*Station Mode intialisation*/ - AR_SOFTC_STA_T *arSta; - if(arPriv->arNetworkType == AP_NETWORK) { - A_MEMZERO(&arPriv->arAp,sizeof(AR_SOFTC_AP_T)); - } - arSta = &arPriv->arSta; - arSta->arListenIntervalT = A_DEFAULT_LISTEN_INTERVAL; - arSta->arListenIntervalB = 0; - arSta->arBmissTimeT = A_DEFAULT_BMISS_TIME; - arSta->arBmissTimeB = 0; - arSta->arRssi = 0; - arSta->arSkipScan = 0; - arSta->arBeaconInterval = 0; - arSta->scan_triggered = 0; - A_MEMZERO(&arSta->scParams, sizeof(arSta->scParams)); - arSta->scParams.shortScanRatio = WMI_SHORTSCANRATIO_DEFAULT; - arSta->scParams.scanCtrlFlags = DEFAULT_SCAN_CTRL_FLAGS; - A_MEMZERO(arSta->arReqBssid, sizeof(arSta->arReqBssid)); - if (!arSta->disconnect_timer_inited) { - A_INIT_TIMER(&arSta->disconnect_timer, disconnect_timer_handler, arPriv->arNetDev); - arSta->disconnect_timer_inited = 1; - } - else - { - A_UNTIMEOUT(&arSta->disconnect_timer); - } - } -} - -int -ar6000_ap_set_num_sta(AR_SOFTC_T *ar, AR_SOFTC_DEV_T *arPriv, A_UINT8 num_sta) -{ - int ret = A_OK; - A_UINT8 i, total_num_sta; - AR_SOFTC_DEV_T *tpriv = NULL; - - if(num_sta & 0x80) { - total_num_sta = (num_sta & (~0x80)); - for(i=0; inum_sta = 0xFF; - } - } else { - total_num_sta = num_sta; - arPriv->num_sta = num_sta; - ar->gNumSta = 0xFF; - for(i=0; inum_sta !=0xFF) && - (tpriv->arNetworkType == AP_NETWORK)) { - total_num_sta += tpriv->num_sta; - } - } - } - - if(total_num_sta > AP_MAX_NUM_STA) { - ret = -EINVAL; - } else { - if(num_sta & 0x80) { - ar->gNumSta = (num_sta & (~0x80)); - } else { - arPriv->num_sta = num_sta; - } - wmi_ap_set_num_sta(arPriv->arWmi, num_sta); - } - - return ret; -} - -int -check_channel(AR_SOFTC_DEV_T *arPriv) -{ - A_UINT8 i; - AR_SOFTC_DEV_T *temp_priv = NULL; - - for(i=0; iarNextMode == AP_NETWORK) && temp_priv->arConnected) { - if(!(temp_priv->arBssChannel || temp_priv->arChannelHint)) { - /* ACS inprogress */ - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("AP%d: ACS in progress\n",temp_priv->arDeviceIndex)); - A_TIMEOUT_MS(&arPriv->ap_acs_timer, 1000, 0); - return 0; - } - } - } - - for(i=0; iarConnected) { - /* User has set the channel for this interface */ - if(arPriv->arChannelHint) { - if(temp_priv->arBssChannel != arPriv->arChannelHint) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Error: Channel should be %d MHz\n", temp_priv->arBssChannel)); - return 0; - } - } else { - /* ACS is enabled for this interface */ - if(temp_priv->arBssChannel) { - arPriv->arChannelHint = temp_priv->arBssChannel; - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Selected Channel %d\n", temp_priv->arBssChannel)); - return 1; - } - } - } - } - return 1; -} - -static void ap_acs_handler(unsigned long ptr) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ptr; - A_UNTIMEOUT(&arPriv->ap_acs_timer); - - if(check_channel(arPriv)) { - ar6000_ap_mode_profile_commit(arPriv); - } else { - A_TIMEOUT_MS(&arPriv->ap_acs_timer, 1000, 0); - } -} - -int -ar6000_ap_mode_profile_commit(AR_SOFTC_DEV_T *arPriv) -{ - AR_SOFTC_T *ar = arPriv->arSoftc; - WMI_CONNECT_CMD p; - unsigned long flags; - - /* No change in AP's profile configuration */ - if(arPriv->ap_profile_flag==0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("COMMIT: No change in profile!!!\n")); - return -ENODATA; - } - - if(!check_channel(arPriv)) { - return -EOPNOTSUPP; - } - - if(!arPriv->arSsidLen) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("SSID not set!!!\n")); - return -ECHRNG; - } - - switch(arPriv->arAuthMode) { - case WMI_NONE_AUTH: - if((arPriv->arPairwiseCrypto != NONE_CRYPT) && -#ifdef WAPI_ENABLE - (arPriv->arPairwiseCrypto != WAPI_CRYPT) && -#endif - (arPriv->arPairwiseCrypto != WEP_CRYPT)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Cipher not supported in AP mode Open auth\n")); - return -EOPNOTSUPP; - } - break; - case WMI_WPA_PSK_AUTH: - case WMI_WPA2_PSK_AUTH: - case (WMI_WPA_PSK_AUTH|WMI_WPA2_PSK_AUTH): - break; - default: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("This key mgmt type not supported in AP mode\n")); - return -EOPNOTSUPP; - } - - if ((arPriv->arAuthMode == WMI_NONE_AUTH) && - (arPriv->arPairwiseCrypto == WEP_CRYPT)) - { - ar6000_install_static_wep_keys(arPriv); - } - - /* Update the arNetworkType */ - arPriv->arNetworkType = arPriv->arNextMode; - arPriv->arBssChannel = 0; - - A_MEMZERO(&p,sizeof(p)); - p.ssidLength = arPriv->arSsidLen; - A_MEMCPY(p.ssid,arPriv->arSsid,p.ssidLength); - - /* - * p.channel == 0 [Do ACS and choose 1, 6, or 11] - * p.channel == 1 [Do ACS and choose 1, or 6] - * p.channel == xxxx [No ACS, use xxxx freq] - */ - if (((arPriv->phymode != WMI_11AG_MODE) && (arPriv->phymode != WMI_11A_MODE)) && (arPriv->arChannelHint >=5180 && arPriv->arChannelHint<= 5825)) { - arPriv->arChannelHint = 0; - } - if ((arPriv->arChannelHint == 0) && (ar->arAcsDisableHiChannel)) { - p.channel = 1; - } else { - p.channel = arPriv->arChannelHint; - if ((arPriv->arChannelHint >=5180) && (arPriv->arChannelHint<= 5825)) { - if (! (wmi_set_channelParams_cmd(arPriv->arWmi, 0, WMI_11A_MODE, 0, NULL))){ - arPriv->phymode= WMI_11A_MODE; - } - } else if ((arPriv->phymode == WMI_11A_MODE) || (arPriv->phymode == WMI_11AG_MODE)){ - if (! (wmi_set_channelParams_cmd(arPriv->arWmi, 0, WMI_11G_MODE, 0, NULL))){ - arPriv->phymode= WMI_11G_MODE; - } - } - } - - p.networkType = arPriv->arNetworkType; - p.dot11AuthMode = arPriv->arDot11AuthMode; - p.authMode = arPriv->arAuthMode; - p.pairwiseCryptoType = arPriv->arPairwiseCrypto; - p.pairwiseCryptoLen = arPriv->arPairwiseCryptoLen; - p.groupCryptoType = arPriv->arGroupCrypto; - p.groupCryptoLen = arPriv->arGroupCryptoLen; - p.ctrl_flags = arPriv->arSta.arConnectCtrlFlags; - -#if WLAN_CONFIG_NO_DISASSOC_UPON_DEAUTH - p.ctrl_flags |= AP_NO_DISASSOC_UPON_DEAUTH; -#endif - wmi_ap_profile_commit(arPriv->arWmi, &p); - spin_lock_irqsave(&arPriv->arPrivLock, flags); - arPriv->arConnected = TRUE; - netif_carrier_on(arPriv->arNetDev); - spin_unlock_irqrestore(&arPriv->arPrivLock, flags); - arPriv->ap_profile_flag = 0; - - return 0; -} - -A_STATUS -ar6000_connect_to_ap(AR_SOFTC_DEV_T *arPriv) -{ - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - - /* The ssid length check prevents second "essid off" from the user, - to be treated as a connect cmd. The second "essid off" is ignored. - */ - if((ar->arWmiReady == TRUE) && (arPriv->arSsidLen > 0) && arPriv->arNetworkType!=AP_NETWORK) - { - A_STATUS status; - if((ADHOC_NETWORK != arPriv->arNetworkType) && - (WMI_NONE_AUTH==arPriv->arAuthMode) && - (WEP_CRYPT==arPriv->arPairwiseCrypto)) { - ar6000_install_static_wep_keys(arPriv); - } - - if (!arSta->arUserBssFilter) { - if (wmi_bssfilter_cmd(arPriv->arWmi, ALL_BSS_FILTER, 0) != A_OK) { - return -EIO; - } - } - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("Connect called with authmode %d dot11 auth %d"\ - " PW crypto %d PW crypto Len %d GRP crypto %d"\ - " GRP crypto Len %d\n", - arPriv->arAuthMode, arPriv->arDot11AuthMode, - arPriv->arPairwiseCrypto, arPriv->arPairwiseCryptoLen, - arPriv->arGroupCrypto, arPriv->arGroupCryptoLen)); - reconnect_flag = 0; - /* Set the listen interval into 1000TUs or more. This value will be indicated to Ap in the conn. - later set it back locally at the STA to 100/1000 TUs depending on the power mode */ - if ((arPriv->arNetworkType == INFRA_NETWORK)) { - wmi_listeninterval_cmd(arPriv->arWmi, max(arSta->arListenIntervalT, (A_UINT16)A_MAX_WOW_LISTEN_INTERVAL), 0); - } - status = wmi_connect_cmd(arPriv->arWmi, arPriv->arNetworkType, - arPriv->arDot11AuthMode, arPriv->arAuthMode, - arPriv->arPairwiseCrypto, arPriv->arPairwiseCryptoLen, - arPriv->arGroupCrypto,arPriv->arGroupCryptoLen, - arPriv->arSsidLen, arPriv->arSsid, - arSta->arReqBssid, arPriv->arChannelHint, - arSta->arConnectCtrlFlags); - if (status != A_OK) { - wmi_listeninterval_cmd(arPriv->arWmi, arSta->arListenIntervalT, arSta->arListenIntervalB); - if (!arSta->arUserBssFilter) { - wmi_bssfilter_cmd(arPriv->arWmi, NONE_BSS_FILTER, 0); - } - return status; - } - - if ((!(arSta->arConnectCtrlFlags & CONNECT_DO_WPA_OFFLOAD)) && - ((WMI_WPA_PSK_AUTH == arPriv->arAuthMode) || (WMI_WPA2_PSK_AUTH == arPriv->arAuthMode))) - { - A_TIMEOUT_MS(&arSta->disconnect_timer, A_DISCONNECT_TIMER_INTERVAL, 0); - } - - arSta->arConnectCtrlFlags &= ~CONNECT_DO_WPA_OFFLOAD; - - arSta->arConnectPending = TRUE; - return status; - } - return A_ERROR; -} - -A_STATUS -ar6000_disconnect(AR_SOFTC_DEV_T *arPriv) -{ - if ((arPriv->arConnected == TRUE) || (arPriv->arSta.arConnectPending == TRUE)) { - wmi_disconnect_cmd(arPriv->arWmi); -#ifdef P2P - if(arPriv->arNetworkSubType == SUBTYPE_P2PCLIENT) { - wait_event_interruptible_timeout(arPriv->arEvent, arPriv->arConnected == FALSE, wmitimeout * HZ); - - if (signal_pending(current)) { - return -EINTR; - } - } -#endif - /* - * Disconnect cmd is issued, clear connectPending. - * arConnected will be cleard in disconnect_event notification. - */ - arPriv->arSta.arConnectPending = FALSE; - } - - return A_OK; -} - -A_STATUS -ar6000_ap_mode_get_wpa_ie(AR_SOFTC_DEV_T *arPriv, struct ieee80211req_wpaie *wpaie) -{ - conn_t *conn = NULL; - conn = ieee80211_find_conn(arPriv, wpaie->wpa_macaddr); - - A_MEMZERO(wpaie->wpa_ie, IEEE80211_MAX_IE); - A_MEMZERO(wpaie->rsn_ie, IEEE80211_MAX_IE); - - if(conn) { - A_MEMCPY(wpaie->wpa_ie, conn->wpa_ie, IEEE80211_MAX_IE); - } - - return 0; -} - -A_STATUS -is_iwioctl_allowed(A_UINT8 mode, A_UINT16 cmd) -{ - if(cmd >= SIOCSIWCOMMIT && cmd <= SIOCGIWPOWER) { - cmd -= SIOCSIWCOMMIT; - if(sioctl_filter[cmd] == 0xFF) return A_OK; - if(sioctl_filter[cmd] & mode) return A_OK; - } else if(cmd >= SIOCIWFIRSTPRIV && cmd <= (SIOCIWFIRSTPRIV+30)) { - cmd -= SIOCIWFIRSTPRIV; - if(pioctl_filter[cmd] == 0xFF) return A_OK; - if(pioctl_filter[cmd] & mode) return A_OK; - } else { - return A_ERROR; - } - return A_ENOTSUP; -} - -A_STATUS -is_xioctl_allowed(A_UINT8 mode, A_UINT8 submode, int cmd) -{ - A_UINT8 mode_bits, submode_bits; - A_BOOL is_valid_mode=FALSE, is_valid_submode=FALSE; - - if(sizeof(xioctl_filter)-1 < cmd) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Filter for this cmd=%d not defined\n",cmd)); - return A_OK; - } - - /* Valid for all modes/submodes */ - if(xioctl_filter[cmd] == 0xFF) return A_OK; - - /* Check if this cmd is valid for the set mode of this device. - */ -#define XIOCTL_FILTER_MODE_MASK 0x1F -#define XIOCTL_FILTER_MODE_BIT_OFFSET 0x0 - mode_bits = xioctl_filter[cmd] & XIOCTL_FILTER_MODE_MASK; - - if (mode_bits & (mode << XIOCTL_FILTER_MODE_BIT_OFFSET)) { - /* Valid cmd for this mode */ - is_valid_mode = TRUE; - } - - /* Check if this cmd is valid for the set submode of this device. - */ -#define XIOCTL_FILTER_SUBMODE_MASK 0xE0 -#define XIOCTL_FILTER_SUBMODE_BIT_OFFSET 0x0 - submode_bits = (xioctl_filter[cmd] & XIOCTL_FILTER_SUBMODE_MASK)>>XIOCTL_FILTER_SUBMODE_BIT_OFFSET; - - if (submode == SUBTYPE_P2PDEV || submode == SUBTYPE_P2PCLIENT || - submode == SUBTYPE_P2PGO) { - /* P2P Submode */ - if (submode_bits & XIOCTL_FILTER_P2P_SUBMODE) { - is_valid_submode = TRUE; - } - } else { - /* Non P2P Sub mode */ - if ((submode_bits & XIOCTL_FILTER_NONP2P_SUBMODE)) { - is_valid_submode = TRUE; - } - } - - if (is_valid_mode && is_valid_submode) { - return A_OK; - } - - return A_ERROR; -} - -#ifdef WAPI_ENABLE -int -ap_set_wapi_key(AR_SOFTC_DEV_T *arPriv, void *ikey) -{ - struct ieee80211req_key *ik = (struct ieee80211req_key *)ikey; - KEY_USAGE keyUsage = 0; - A_STATUS status; - - if (A_MEMCMP(ik->ik_macaddr, bcast_mac, IEEE80211_ADDR_LEN) == 0) { - keyUsage = GROUP_USAGE; - } else { - keyUsage = PAIRWISE_USAGE; - } - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("WAPI_KEY: Type:%d ix:%d mac:%02x:%02x len:%d\n", - keyUsage, ik->ik_keyix, ik->ik_macaddr[4], ik->ik_macaddr[5], - ik->ik_keylen)); - - status = wmi_addKey_cmd(arPriv->arWmi, ik->ik_keyix, WAPI_CRYPT, keyUsage, - ik->ik_keylen, (A_UINT8 *)&ik->ik_keyrsc, - ik->ik_keydata, KEY_OP_INIT_VAL, ik->ik_macaddr, - SYNC_BOTH_WMIFLAG); - - if (A_OK != status) { - return -EIO; - } - return 0; -} -#endif - -#ifdef P2P - -void ar6000_p2p_prov_disc_req_event(AR_SOFTC_DEV_T *arPriv, - const A_UINT8 *peer, A_UINT16 wps_config_method, - const A_UINT8 *dev_addr, const A_UINT8 *pri_dev_type, - const A_UINT8 *dev_name, A_UINT8 dev_name_len, - A_UINT16 supp_config_methods, A_UINT8 dev_capab, A_UINT8 group_capab) -{ - union iwreq_data wrqu; - A_UINT8 buf[100]; - A_UINT8 *pos=buf; - - A_MEMZERO(pos, sizeof(buf)); - A_MEMCPY(pos, "P2PPROVDISCREQ", 14); - pos += 14; - - A_MEMCPY(pos, peer, IEEE80211_ADDR_LEN); - pos += IEEE80211_ADDR_LEN; - - A_MEMCPY(pos, dev_addr, IEEE80211_ADDR_LEN); - pos += IEEE80211_ADDR_LEN; - - A_MEMCPY(pos, pri_dev_type, 8); - pos += 8; - - A_MEMCPY(pos, dev_name, dev_name_len); - pos += dev_name_len; - *pos++ = '\0'; - - A_MEMCPY(pos, (A_UINT8 *)&supp_config_methods, 2); - pos += 2; - - A_MEMCPY(pos, (A_UINT8 *)&wps_config_method, 2); - pos += 2; - - A_MEMCPY(pos, &dev_capab, 1); - pos++; - - A_MEMCPY(pos, &group_capab, 1); - pos++; - - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = (pos-buf); - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, buf); -} - -void ar6000_p2p_prov_disc_resp_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 *peer, - A_UINT16 config_methods) -{ - union iwreq_data wrqu; - A_UINT8 buf[100]; - A_UINT8 *pos=buf; - - A_MEMZERO(pos, sizeof(buf)); - A_MEMCPY(pos, "P2PPROVDISCRESP", 15); - pos += 15; - - A_MEMCPY(pos, peer, IEEE80211_ADDR_LEN); - pos += IEEE80211_ADDR_LEN; - - A_MEMCPY(pos, (A_UINT8 *)&config_methods, 2); - pos += 2; - - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = (pos-buf); - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, buf); -} - -void ar6000_p2pdev_event(AR_SOFTC_DEV_T *arPriv, const A_UINT8 *addr, - const A_UINT8 *dev_addr, - const A_UINT8 *pri_dev_type, const A_UINT8 *dev_name, - A_UINT8 dev_name_len, A_UINT16 config_methods, A_UINT8 dev_capab, - A_UINT8 grp_capab) -{ - union iwreq_data wrqu; - A_UINT8 buf[100]; - A_UINT8 *pos=buf; - - A_MEMZERO(pos, sizeof(buf)); - A_MEMCPY(pos, "P2PDEVFOUND", 11); - pos += 11; - - A_MEMCPY(pos, addr, IEEE80211_ADDR_LEN); - pos += IEEE80211_ADDR_LEN; - - A_MEMCPY(pos, dev_addr, IEEE80211_ADDR_LEN); - pos += IEEE80211_ADDR_LEN; - - /* Size of P2P Attributes hardcoded here. Can this be changed ? - */ - A_MEMCPY(pos, pri_dev_type, 8); - pos += 8; - - A_MEMCPY(pos, dev_name, dev_name_len); - pos += dev_name_len; - *pos++ = '\0'; - - A_MEMCPY(pos, (A_UINT8 *)&config_methods, 2); - pos += 2; - - A_MEMCPY(pos, &dev_capab, 1); - pos++; - - A_MEMCPY(pos, &grp_capab, 1); - pos++; - - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = (pos-buf); - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, buf); - - return; -} - -void ar6000_p2p_sd_rx_event(AR_SOFTC_DEV_T *arPriv, WMI_P2P_SDPD_RX_EVENT *ev) -{ - union iwreq_data wrqu; - A_UINT8 *event_ptr; - A_UINT8 *pos; - A_UINT16 size; - -#define P2P_SD_REQ_RESP_STR_LEN 12 - size = P2P_SD_REQ_RESP_STR_LEN - + sizeof(WMI_P2P_SDPD_RX_EVENT) - + ev->tlv_length; - event_ptr = A_MALLOC_NOWAIT(size); - pos = event_ptr; - A_MEMZERO(pos, size); - A_MEMCPY(pos, "P2PSDREQRESP", P2P_SD_REQ_RESP_STR_LEN); - pos += P2P_SD_REQ_RESP_STR_LEN; -#undef P2P_SD_REQ_RESP_STR_LEN - - /* Copy the event followed by TLV, parsing will be dobe in supplicant */ - A_MEMCPY(pos, ev, sizeof(WMI_P2P_SDPD_RX_EVENT) + ev->tlv_length); - - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = size; - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, event_ptr); - - A_FREE(event_ptr); - return; -} - -void p2p_go_neg_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 *res, A_UINT8 len) -{ - union iwreq_data wrqu; - A_UINT8 buf[100]; - - A_MEMZERO(&buf, sizeof(buf)); - A_MEMCPY(buf, "P2PNEGCOMPLETE",14); - A_MEMCPY(&buf[14], res, len); - - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = 14+len; - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, buf); -} - -void p2p_go_neg_req_event(AR_SOFTC_DEV_T *arPriv, const A_UINT8 *sa, A_UINT16 dev_passwd_id) -{ - union iwreq_data wrqu; - A_UINT8 buf[100]; - A_UINT8 *pos=buf; - - A_MEMZERO(pos, sizeof(buf)); - A_MEMCPY(pos, "P2PNEGREQEV", 11); - pos += 11; - - A_MEMCPY(pos, sa, IEEE80211_ADDR_LEN); - pos += IEEE80211_ADDR_LEN; - - A_MEMCPY(pos, (A_UINT8 *)&dev_passwd_id, 2); - pos += 2; - - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = (pos-buf); - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, buf); -} - - -void p2p_invite_sent_result_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 *res, - A_UINT8 len) -{ - union iwreq_data wrqu; - A_UINT8 buf[100]; - - A_MEMZERO(&buf, sizeof(buf)); - A_MEMCPY(buf, "P2PINVITESENTRESULT", 19); - A_MEMCPY(&buf[19], res, len); - - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = 19 + len; - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, buf); -} - -void p2p_invite_rcvd_result_event(AR_SOFTC_DEV_T *arPriv, - A_UINT8 *res, A_UINT8 len) -{ - union iwreq_data wrqu; - A_UINT8 buf[100]; - - A_MEMZERO(&buf, sizeof(buf)); - A_MEMCPY(buf, "P2PINVITERCVDRESULT", 19); - A_MEMCPY(&buf[19], res, len); - - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = 19 + len; - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, buf); -} - -#endif /* P2P */ - -void ar6000_peer_event( - void *context, - A_UINT8 eventCode, - A_UINT8 *macAddr) -{ - A_UINT8 pos; - - for (pos=0;pos<6;pos++) - printk("%02x: ",*(macAddr+pos)); - printk("\n"); -} - -void ar6000_get_device_addr(AR_SOFTC_DEV_T *arPriv, A_UINT8 *addr) -{ - A_MEMCPY(addr, arPriv->arNetDev->dev_addr, IEEE80211_ADDR_LEN); - return; -} - -#ifdef HTC_TEST_SEND_PKTS -#define HTC_TEST_DUPLICATE 8 -static void DoHTCSendPktsTest(AR_SOFTC_T *ar, int MapNo, HTC_ENDPOINT_ID eid, struct sk_buff *dupskb) -{ - struct ar_cookie *cookie; - struct ar_cookie *cookieArray[HTC_TEST_DUPLICATE]; - struct sk_buff *new_skb; - int i; - int pkts = 0; - HTC_PACKET_QUEUE pktQueue; - EPPING_HEADER *eppingHdr; - - eppingHdr = A_NETBUF_DATA(dupskb); - - if (eppingHdr->Cmd_h == EPPING_CMD_NO_ECHO) { - /* skip test if this is already a tx perf test */ - return; - } - - for (i = 0; i < HTC_TEST_DUPLICATE; i++,pkts++) { - AR6000_SPIN_LOCK(&ar->arLock, 0); - cookie = ar6000_alloc_cookie(ar); - if (cookie != NULL) { - ar->arTxPending[eid]++; - ar->arTotalTxDataPending++; - } - - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - - if (NULL == cookie) { - break; - } - - new_skb = A_NETBUF_ALLOC(A_NETBUF_LEN(dupskb)); - - if (new_skb == NULL) { - AR6000_SPIN_LOCK(&ar->arLock, 0); - ar6000_free_cookie(ar,cookie); - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - break; - } - - A_NETBUF_PUT_DATA(new_skb, A_NETBUF_DATA(dupskb), A_NETBUF_LEN(dupskb)); - cookie->arc_bp[0] = (A_UINT32)new_skb; - cookie->arc_bp[1] = MapNo; - SET_HTC_PACKET_INFO_TX(&cookie->HtcPkt, - cookie, - A_NETBUF_DATA(new_skb), - A_NETBUF_LEN(new_skb), - eid, - AR6K_DATA_PKT_TAG); - - cookieArray[i] = cookie; - - { - EPPING_HEADER *pHdr = (EPPING_HEADER *)A_NETBUF_DATA(new_skb); - pHdr->Cmd_h = EPPING_CMD_NO_ECHO; /* do not echo the packet */ - } - } - - if (pkts == 0) { - return; - } - - INIT_HTC_PACKET_QUEUE(&pktQueue); - - for (i = 0; i < pkts; i++) { - HTC_PACKET_ENQUEUE(&pktQueue,&cookieArray[i]->HtcPkt); - } - - HTCSendPktsMultiple(ar->arHtcTarget, &pktQueue); - -} - -#endif - -#ifdef RK29 - -#include - -static struct wifi_platform_data *wifi_control_data = NULL; -struct semaphore wifi_control_sem; - -int wifi_set_carddetect(int on) -{ - if (wifi_control_data && wifi_control_data->set_carddetect) { - wifi_control_data->set_carddetect(on); - } - return 0; -} - -int wifi_set_power(int on, unsigned long msec) -{ - if (wifi_control_data && wifi_control_data->set_power) { - wifi_control_data->set_power(on); - } - if (msec) - mdelay(msec); - return 0; -} - -int wifi_set_reset(int on, unsigned long msec) -{ - if (wifi_control_data && wifi_control_data->set_reset) { - wifi_control_data->set_reset(on); - } - if (msec) - mdelay(msec); - return 0; -} - -static int wifi_probe(struct platform_device *pdev) -{ - struct wifi_platform_data *wifi_ctrl = - (struct wifi_platform_data *)(pdev->dev.platform_data); - - wifi_control_data = wifi_ctrl; - - /* make sure power-off */ - wifi_set_reset(0, 5); - wifi_set_power(0, 5); - - wifi_set_power(1, 50); /* Power On */ - wifi_set_reset(1, 150); /* Reset */ - wifi_set_carddetect(1); /* CardDetect (0->1) */ - - up(&wifi_control_sem); - return 0; -} - -static int wifi_remove(struct platform_device *pdev) -{ - struct wifi_platform_data *wifi_ctrl = - (struct wifi_platform_data *)(pdev->dev.platform_data); - - wifi_control_data = wifi_ctrl; - - wifi_set_reset(0, 5); /* Reset */ - wifi_set_power(0, 5); /* Power Off */ - wifi_set_carddetect(0); /* CardDetect (1->0) */ - - up(&wifi_control_sem); - return 0; -} - -static int wifi_suspend(struct platform_device *pdev, pm_message_t state) -{ - return 0; -} -static int wifi_resume(struct platform_device *pdev) -{ - return 0; -} - -static struct platform_driver wifi_device = { - .probe = wifi_probe, - .remove = wifi_remove, - .suspend = wifi_suspend, - .resume = wifi_resume, - .driver = { - .name = "bcm4329_wlan", - } -}; - -int wifi_add_dev(void) -{ - return platform_driver_register(&wifi_device); -} - -void wifi_del_dev(void) -{ - platform_driver_unregister(&wifi_device); -} - -static inline int _down_timeout(struct semaphore *sem, long jiffies) { - int i = 0, ret = 0; - static const int quantum_ms = 1000 / HZ; - - ret = down_trylock(sem); - for (i = jiffies; (i > 0 && ret != 0); i -= quantum_ms) { - schedule_timeout_interruptible(1); - ret = down_trylock(sem); - } - - return ret; -} - -int rockchip_wifi_init_module(void) -{ - int error; -#if 0//def TCHIP - extern char softmac_path[]; - char filename[256]; - extern int android_readwrite_file(const A_CHAR *filename, A_CHAR *rbuf, const A_CHAR *wbuf, size_t length); - - sprintf(filename, "%s/%s", softmac_path, "tcmd"); - if (android_readwrite_file(filename, NULL, NULL, 0) < 0) { - printk("%s :: normal mode\n", __func__); - testmode = 0; - } else { - printk("%s :: test mode\n", __func__); - testmode = 1; - } -#endif - printk("ar6003 diver rkversion: [v1.10]\n"); - - sema_init(&wifi_control_sem, 0); - error = wifi_add_dev(); - if (error) { - printk("%s: platform_driver_register failed\n", __FUNCTION__); - return -1; - } - - /* Waiting callback after platform_driver_register is done or exit with error */ - if (_down_timeout(&wifi_control_sem, msecs_to_jiffies(5000)) != 0) { - error = -EINVAL; - printk("%s: platform_driver_register timeout\n", __FUNCTION__); - wifi_del_dev(); - return -1; - } - - ifname[0] = 0; - devmode[0] = 0; - printk("ifname = %s, devmode = %s.\n", ifname, devmode); - - ar6000_init_module(); - ar6000_pm_init(); - - return 0; -} -#include "wifi_launcher/wlan_param.h" -int rockchip_wifi_init_module_param(wlan_param *param) -{ - int error; -#if 0//def TCHIP - extern char softmac_path[]; - char filename[256]; - extern int android_readwrite_file(const A_CHAR *filename, A_CHAR *rbuf, const A_CHAR *wbuf, size_t length); - - sprintf(filename, "%s/%s", softmac_path, "tcmd"); - if (android_readwrite_file(filename, NULL, NULL, 0) < 0) { - printk("%s :: normal mode\n", __func__); - testmode = 0; - } else { - printk("%s :: test mode\n", __func__); - testmode = 1; - } -#endif - - sema_init(&wifi_control_sem, 0); - error = wifi_add_dev(); - if (error) { - printk("%s: platform_driver_register failed\n", __FUNCTION__); - return -1; - } - - /* Waiting callback after platform_driver_register is done or exit with error */ - if (_down_timeout(&wifi_control_sem, msecs_to_jiffies(5000)) != 0) { - error = -EINVAL; - printk("%s: platform_driver_register timeout\n", __FUNCTION__); - wifi_del_dev(); - return -1; - } - - strcpy(ifname, param->ifname); - strcpy(devmode, param->devmode); - - printk("ifname = %s, devmode = %s.\n", ifname, devmode); - - ar6000_init_module(); - ar6000_pm_init(); - - return 0; -} -void rockchip_wifi_exit_module(void) -{ - ar6000_cleanup_module(); - ar6000_pm_exit(); - wifi_del_dev(); -} -EXPORT_SYMBOL(rockchip_wifi_init_module); -EXPORT_SYMBOL(rockchip_wifi_init_module_param); -EXPORT_SYMBOL(rockchip_wifi_exit_module); -//module_init(rockchip_wifi_init_module); -//module_exit(rockchip_wifi_exit_module); -#endif - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -EXPORT_SYMBOL(setupbtdev); -#endif diff --git a/drivers/net/wireless/ar6003/host/os/linux/ar6000_pm.c b/drivers/net/wireless/ar6003/host/os/linux/ar6000_pm.c deleted file mode 100644 index 9aecfe9bd5db..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/ar6000_pm.c +++ /dev/null @@ -1,1115 +0,0 @@ -// -// -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// -// -// - -/* - * Implementation of system power management - */ - -#include "ar6000_drv.h" -#include - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) -#include -#endif -#include "wlan_config.h" - -#ifdef CONFIG_HAS_WAKELOCK -#include -#endif - -#define WOW_ENABLE_MAX_INTERVAL 1 -#define WOW_SET_SCAN_PARAMS 1 - -extern unsigned int wmitimeout; -extern unsigned int num_device; - -#ifdef CONFIG_PM - -#if PLAT_WOW_GPIO_PIN || PLAT_WLAN_CHIP_PWD_PIN -#include -#endif - -#if PLAT_WOW_GPIO_PIN -static int wow_irq; -#endif /* PLAT_WOW_GPIO_PIN */ - -#ifdef CONFIG_HAS_WAKELOCK -struct wake_lock ar6k_suspend_wake_lock; -struct wake_lock ar6k_wow_wake_lock; -#endif -#endif /* CONFIG_PM */ - -#ifdef ANDROID_ENV -extern void android_ar6k_check_wow_status(AR_SOFTC_T *ar, struct sk_buff *skb, A_BOOL isEvent); -#endif -#undef ATH_MODULE_NAME -#define ATH_MODULE_NAME pm -#define ATH_DEBUG_PM ATH_DEBUG_MAKE_MODULE_MASK(0) - -#ifdef DEBUG -static ATH_DEBUG_MASK_DESCRIPTION pm_debug_desc[] = { - { ATH_DEBUG_PM , "System power management"}, -}; - -ATH_DEBUG_INSTANTIATE_MODULE_VAR(pm, - "pm", - "System Power Management", - ATH_DEBUG_MASK_DEFAULTS | ATH_DEBUG_PM, - ATH_DEBUG_DESCRIPTION_COUNT(pm_debug_desc), - pm_debug_desc); - -#endif /* DEBUG */ - -A_STATUS ar6000_exit_cut_power_state(AR_SOFTC_T *ar); - -#ifdef CONFIG_PM -static void ar6k_send_asleep_event_to_app(AR_SOFTC_DEV_T *arPriv, A_BOOL asleep) -{ - char buf[128]; - union iwreq_data wrqu; - - snprintf(buf, sizeof(buf), "HOST_ASLEEP=%s", asleep ? "asleep" : "awake"); - A_MEMZERO(&wrqu, sizeof(wrqu)); - wrqu.data.length = strlen(buf); - wireless_send_event(arPriv->arNetDev, IWEVCUSTOM, &wrqu, buf); -} - -static void ar6000_wow_resume(AR_SOFTC_T *ar) -{ - HIF_DEVICE_POWER_CHANGE_TYPE config; - AR_SOFTC_DEV_T *arPriv; - AR_SOFTC_STA_T *arSta; - A_UINT8 i; - - if (ar->arWowState!= WLAN_WOW_STATE_NONE) { - config = HIF_DEVICE_POWER_UP; - HIFConfigureDevice(ar->arHifDevice, - HIF_DEVICE_POWER_STATE_CHANGE, - &config, - sizeof(HIF_DEVICE_POWER_CHANGE_TYPE)); - } - - for(i = 0; i < num_device; i++) { - arPriv = ar->arDev[i]; - arSta = &arPriv->arSta; - - /* - * Free all wlan_nodes (scanned APs that we detected previously) - * because during the time we were suspended, the device may have - * been moved to a new location and these APs scanned for before - * suspend may not be valid - */ - wmi_free_allnodes(arPriv->arWmi); - - if (ar->arWowState!= WLAN_WOW_STATE_NONE) { - A_UINT16 fg_start_period = (arSta->scParams.fg_start_period==0) ? 1 : arSta->scParams.fg_start_period; - A_UINT16 bg_period = (arSta->scParams.bg_period==0) ? 60 : arSta->scParams.bg_period; - WMI_SET_HOST_SLEEP_MODE_CMD hostSleepMode = {TRUE, FALSE}; - ar->arWowState = WLAN_WOW_STATE_NONE; -#ifdef CONFIG_HAS_WAKELOCK - wake_lock_timeout(&ar6k_wow_wake_lock, 3*HZ); -#endif - if (wmi_set_host_sleep_mode_cmd(arPriv->arWmi, &hostSleepMode)!=A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to setup restore host awake\n")); - } - - if (arPriv->arNetworkType!=AP_NETWORK) { -#if WOW_SET_SCAN_PARAMS - wmi_scanparams_cmd(arPriv->arWmi, fg_start_period, - arSta->scParams.fg_end_period, - bg_period, - arSta->scParams.minact_chdwell_time, - arSta->scParams.maxact_chdwell_time, - arSta->scParams.pas_chdwell_time, - arSta->scParams.shortScanRatio, - arSta->scParams.scanCtrlFlags, - arSta->scParams.max_dfsch_act_time, - arSta->scParams.maxact_scan_per_ssid); -#else - (void)fg_start_period; - (void)bg_period; -#endif - - -#if WOW_ENABLE_MAX_INTERVAL /* we don't do it if the power consumption is already good enough. */ - if (wmi_listeninterval_cmd(arPriv->arWmi, arSta->arListenIntervalT, arSta->arListenIntervalB) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to restore WoW listen interval %d\n", arSta->arListenIntervalT)); - } else { - if (wmi_bmisstime_cmd(arPriv->arWmi, arSta->arBmissTimeT, arSta->arBmissTimeB) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to restore WoW bmiss %d\n", arSta->arBmissTimeT)); - } - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("WoW does not invoked. skip resume")); - } -#endif - } - ar6k_send_asleep_event_to_app(arPriv, FALSE); - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("Resume WoW successfully\n")); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("WoW does not invoked. skip resume")); - } - } - - ar->arWlanPowerState = WLAN_POWER_STATE_ON; -} - -static void ar6000_wow_suspend(AR_SOFTC_T *ar) -{ - struct net_device *ndev; - AR_SOFTC_DEV_T *arPriv; - AR_SOFTC_STA_T *arSta; - A_INT32 i, j; - A_STATUS status; -#define WOW_LIST_ID 1 - /* Setup WoW for unicast & Arp request for our own IP - * disable background scan. Set listen interval into 1000 TUs - * Enable keepliave for 110 seconds - */ - struct in_ifaddr **ifap = NULL; - struct in_ifaddr *ifa = NULL; - HIF_DEVICE_POWER_CHANGE_TYPE config; - struct in_device *in_dev; - WMI_ADD_WOW_PATTERN_CMD addWowCmd = { .filter = { 0 } }; - WMI_DEL_WOW_PATTERN_CMD delWowCmd; - WMI_SET_HOST_SLEEP_MODE_CMD hostSleepMode = {FALSE, TRUE}; - WMI_SET_WOW_MODE_CMD wowMode = { .enable_wow = TRUE, - .hostReqDelay = 500 };/*500 ms delay*/ - - if (ar->arWowState!= WLAN_WOW_STATE_NONE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("System already go into wow mode!\n")); - return; - } - - ar6000_TxDataCleanup(ar); /* IMPORTANT, otherwise there will be 11mA after listen interval as 1000*/ - - for(j = 0; j< num_device; j++) - { - arPriv = ar->arDev[j]; - arSta = &arPriv->arSta; - ndev = arPriv->arNetDev; - /* clear up our WoW pattern first */ - for (i=0; iarWmi, &delWowCmd); - } - - if (arPriv->arNetworkType == AP_NETWORK) { - /* setup all unicast IP packet pattern for WoW */ -#if WLAN_CONFIG_SIMPLE_WOW_AP_MODE - /* IP packets except boradcast */ - A_UINT8 allData[] = { 0x08 }; /* Either IP 0x0800, ARP 0x0806 or EAPOL-like 0x8800 */ - A_UINT8 allMask[] = { 0x7f }; - A_MEMZERO(&addWowCmd, sizeof(addWowCmd)); - addWowCmd.filter_list_id = WOW_LIST_ID; - addWowCmd.filter_size = sizeof(allMask); - addWowCmd.filter_offset = 20; - status = wmi_add_wow_pattern_cmd(ar->arWmi, &addWowCmd, allData, allMask, addWowCmd.filter_size); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to add WoW simple pattern for AP mode\n")); - } -#else - /* Unicast IP, EAPOL-like and ARP packets */ - A_UINT8 unicastData[] = { - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x08, }; - A_UINT8 unicastMask[] = { - 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f }; - A_UINT8 discoverData[] = { 0xe0, 0x00, 0x00, 0xf8 }; - A_UINT8 discoverMask[] = { 0xf0, 0x00, 0x00, 0xf8 }; - A_UINT8 arpData[] = { 0x08, 0x06 }; - A_UINT8 arpMask[] = { 0xff, 0xff }; - A_UINT8 dhcpData[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x08, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x43 /* port 67 */ - }; - A_UINT8 dhcpMask[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xff /* port 67 */ - }; - A_MEMZERO(&addWowCmd, sizeof(addWowCmd)); - addWowCmd.filter_list_id = WOW_LIST_ID; - addWowCmd.filter_size = sizeof(unicastMask); - addWowCmd.filter_offset = 0; - status = wmi_add_wow_pattern_cmd(arPriv->arWmi, &addWowCmd, unicastData, unicastMask, addWowCmd.filter_size); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to add WoW unicast IP pattern for AP mode\n")); - } - /* setup all ARP packet pattern for WoW */ - A_MEMZERO(&addWowCmd, sizeof(addWowCmd)); - addWowCmd.filter_list_id = WOW_LIST_ID; - addWowCmd.filter_size = sizeof(arpMask); - addWowCmd.filter_offset = 20; - status = wmi_add_wow_pattern_cmd(arPriv->arWmi, &addWowCmd, arpData, arpMask, addWowCmd.filter_size); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to add WoW ARP pattern for AP mode\n")); - } - /* Setup multicast pattern for mDNS 224.0.0.251, SSDP 239.255.255.250 and LLMNR 224.0.0.252*/ - A_MEMZERO(&addWowCmd, sizeof(addWowCmd)); - addWowCmd.filter_list_id = WOW_LIST_ID; - addWowCmd.filter_size = sizeof(discoverMask); - addWowCmd.filter_offset = 38; - status = wmi_add_wow_pattern_cmd(arPriv->arWmi, &addWowCmd, discoverData, discoverMask, addWowCmd.filter_size); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to add mDNS/SSDP/LLMNR pattern for AP mode WoW\n")); - } - /* setup all DHCP broadcast packet pattern for WoW */ - A_MEMZERO(&addWowCmd, sizeof(addWowCmd)); - addWowCmd.filter_list_id = WOW_LIST_ID; - addWowCmd.filter_size = sizeof(dhcpMask); - addWowCmd.filter_offset = 0; - status = wmi_add_wow_pattern_cmd(arPriv->arWmi, &addWowCmd, dhcpData, dhcpMask, addWowCmd.filter_size); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to add WoW DHCP broadcast pattern for AP mode\n")); - } -#endif /* WLAN_CONFIG_SIMPLE_WOW_AP_MODE */ - } else { - /* station mode */ - A_UINT8 macMask[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; - A_UINT16 wow_listen_interval = A_MAX_WOW_LISTEN_INTERVAL; -#if WOW_ENABLE_MAX_INTERVAL /* we don't do it if the power consumption is already good enough. */ - if (wmi_listeninterval_cmd(arPriv->arWmi, wow_listen_interval, 0) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to setup WoW listen interval %d\n", wow_listen_interval)); - } else { - /* - * The default bmiss is 1500ms when listen interval is 100ms - * We set listen interval x 15 times as bmiss time here - */ - A_UINT16 bmissTime = wow_listen_interval*15; - if (bmissTime > MAX_BMISS_TIME) { - bmissTime = MAX_BMISS_TIME; - } - if (wmi_bmisstime_cmd(arPriv->arWmi, bmissTime, 0) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to setup WoW bmiss %d\n", bmissTime)); - } - } -#else - (void)wow_listen_interval; -#endif - -#if WOW_SET_SCAN_PARAMS - status = wmi_scanparams_cmd(arPriv->arWmi, 0xFFFF, 0, 0xFFFF, 0, 0, 0, 0, 0, 0, 0); -#endif - /* setup unicast packet pattern for WoW */ - if (ndev->dev_addr[1]) { - A_MEMZERO(&addWowCmd, sizeof(addWowCmd)); - addWowCmd.filter_list_id = WOW_LIST_ID; - addWowCmd.filter_size = 6; /* MAC address */ - addWowCmd.filter_offset = 0; - status = wmi_add_wow_pattern_cmd(arPriv->arWmi, &addWowCmd, ndev->dev_addr, macMask, addWowCmd.filter_size); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to add WoW pattern\n")); - } - } - - /* Setup multicast pattern for mDNS 224.0.0.251, SSDP 239.255.255.250 and LLMNR 224.0.0.252*/ - if ( ndev->flags & IFF_ALLMULTI || -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) - (ndev->flags & IFF_MULTICAST && ndev->mc_count>0) ) -#else - (ndev->flags & IFF_MULTICAST && netdev_mc_count(ndev)>0) ) -#endif - { - A_UINT8 discoverData[] = { 0xe0, 0x00, 0x00, 0xf8 }; - A_UINT8 discoverMask[] = { 0xf0, 0x00, 0x00, 0xf8 }; - A_MEMZERO(&addWowCmd, sizeof(addWowCmd)); - addWowCmd.filter_list_id = WOW_LIST_ID; - addWowCmd.filter_size = sizeof(discoverMask); - addWowCmd.filter_offset = 38; - status = wmi_add_wow_pattern_cmd(arPriv->arWmi, &addWowCmd, discoverData, discoverMask, addWowCmd.filter_size); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to add mDNS/SSDP/LLMNR pattern for WoW\n")); - } - } - - ar6k_send_asleep_event_to_app(arPriv, TRUE); - } - - ar->arWowState = WLAN_WOW_STATE_SUSPENDING; - - /* setup ARP request for our own IP */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) - if ((in_dev = __in_dev_get_rtnl(ndev)) != NULL) { - for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL; ifap = &ifa->ifa_next) { - if (!strcmp(ndev->name, ifa->ifa_label)) { - break; /* found */ - } - } - } -#endif - - if (ifa && ifa->ifa_local) { - WMI_SET_IP_CMD ipCmd; - memset(&ipCmd, 0, sizeof(ipCmd)); - ipCmd.ips[0] = ifa->ifa_local; - status = wmi_set_ip_cmd(arPriv->arWmi, &ipCmd); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to setup IP for ARP agent\n")); - } - } - -#ifndef ATH6K_CONFIG_OTA_MODE - wmi_powermode_cmd(arPriv->arWmi, REC_POWER); -#endif - - status = wmi_set_wow_mode_cmd(arPriv->arWmi, &wowMode); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to enable wow mode\n")); - } - - status = wmi_set_host_sleep_mode_cmd(arPriv->arWmi, &hostSleepMode); - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to set host asleep\n")); - } - - if (ar->arTxPending[ar->arControlEp]) { - A_UINT32 timeleft = wait_event_interruptible_timeout(arPriv->arEvent, - ar->arTxPending[ar->arControlEp] == 0, wmitimeout * HZ); - if (!timeleft || signal_pending(current)) { - /* what can I do? wow resume at once */ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to setup WoW. Pending wmi control data %d\n", ar->arTxPending[ar->arControlEp])); - } - } - } - - status = hifWaitForPendingRecv(ar->arHifDevice); - - config = HIF_DEVICE_POWER_DOWN; - status = HIFConfigureDevice(ar->arHifDevice, - HIF_DEVICE_POWER_STATE_CHANGE, - &config, - sizeof(HIF_DEVICE_POWER_CHANGE_TYPE)); - - ar->arWowState = WLAN_WOW_STATE_SUSPENDED; - ar->arWlanPowerState = WLAN_POWER_STATE_WOW; - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("Setup WoW successfully\n")); -} - -A_STATUS ar6000_suspend_ev(void *context) -{ - A_STATUS status = A_OK; - AR_SOFTC_T *ar = (AR_SOFTC_T *)context; - A_INT16 pmmode = ar->arSuspendConfig; - A_INT32 i; - A_BOOL needWow = FALSE; -wow_not_connected: - switch (pmmode) { - case WLAN_SUSPEND_WOW: - for(i = 0; i< num_device; i++) { - if (ar->arDev[i]->arConnected) { - needWow = TRUE; - break; - } - } - if (ar->arWmiReady && ar->arWlanState==WLAN_ENABLED && needWow) { - ar6000_wow_suspend(ar); - status = A_EBUSY; - AR_DEBUG_PRINTF(ATH_DEBUG_PM,("%s:Suspend for wow mode %d\n", __func__, ar->arWlanPowerState)); - } else { - pmmode = ar->arWow2Config; - goto wow_not_connected; - } - break; - case WLAN_SUSPEND_CUT_PWR: - /* fall through */ - case WLAN_SUSPEND_CUT_PWR_IF_BT_OFF: - /* fall through */ - case WLAN_SUSPEND_DEEP_SLEEP: - /* fall through */ - default: - status = ar6000_update_wlan_pwr_state(ar, WLAN_DISABLED, TRUE); - if (ar->arWlanPowerState==WLAN_POWER_STATE_ON || - ar->arWlanPowerState==WLAN_POWER_STATE_WOW) { - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("Strange suspend state for not wow mode %d", ar->arWlanPowerState)); - } - AR_DEBUG_PRINTF(ATH_DEBUG_PM,("%s:Suspend for %d mode pwr %d status %d\n", __func__, pmmode, ar->arWlanPowerState, status)); - if (ar->arWlanPowerState==WLAN_POWER_STATE_CUT_PWR) { - status = A_OK; - } else { - status = A_EBUSY; /* don't let mmc call sdio_init after resume */ - } - break; - } - - for(i = 0; i < num_device; i++) { - AR_SOFTC_DEV_T *arPriv = ar->arDev[i]; - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - if (arSta->scan_triggered) { - ar6000_scanComplete_event(arPriv, A_OK); - } - } - return status; -} - -A_STATUS ar6000_resume_ev(void *context) -{ - AR_SOFTC_T *ar = (AR_SOFTC_T *)context; - A_UINT16 powerState = ar->arWlanPowerState; - -#ifdef CONFIG_HAS_WAKELOCK - wake_lock(&ar6k_suspend_wake_lock); -#endif - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("%s: enter previous state %d wowState %d\n", __func__, powerState, ar->arWowState)); - switch (powerState) { - case WLAN_POWER_STATE_WOW: - ar6000_wow_resume(ar); - break; - case WLAN_POWER_STATE_CUT_PWR: - /* fall through */ - case WLAN_POWER_STATE_DEEP_SLEEP: - ar6000_update_wlan_pwr_state(ar, WLAN_ENABLED, TRUE); - AR_DEBUG_PRINTF(ATH_DEBUG_PM,("%s:Resume for %d mode pwr %d\n", __func__, powerState, ar->arWlanPowerState)); - break; - case WLAN_POWER_STATE_ON: - break; - default: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Strange SDIO bus power mode!!\n")); - break; - } -#ifdef CONFIG_HAS_WAKELOCK - wake_unlock(&ar6k_suspend_wake_lock); -#endif - return A_OK; -} - -void ar6000_check_wow_status(AR_SOFTC_T *ar, struct sk_buff *skb, A_BOOL isEvent) -{ - if (ar->arWowState!=WLAN_WOW_STATE_NONE) { - if (ar->arWowState==WLAN_WOW_STATE_SUSPENDING) { - AR_DEBUG_PRINTF(ATH_DEBUG_PM,("\n%s: Received IRQ while we are wow suspending!!!\n\n", __func__)); - return; - } - /* Wow resume from irq interrupt */ - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("%s: WoW resume from irq thread status %d\n", __func__, ar->arWlanPowerState)); - ar6000_wow_resume(ar); - } else { -#ifdef ANDROID_ENV - android_ar6k_check_wow_status(ar, skb, isEvent); -#endif - } -} - -A_STATUS ar6000_power_change_ev(void *context, A_UINT32 config) -{ - AR_SOFTC_T *ar = (AR_SOFTC_T *)context; - A_STATUS status = A_OK; - - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("%s: power change event callback %d \n", __func__, config)); - switch (config) { - case HIF_DEVICE_POWER_UP: - ar6000_restart_endpoint(ar); -#ifdef ANDROID_ENV - ar->arResumeDone = TRUE; - wake_up(&(ar->arDev[0]->arEvent)); -#endif /* ANDROID_ENV */ - status = A_OK; - break; - case HIF_DEVICE_POWER_DOWN: - case HIF_DEVICE_POWER_CUT: - status = A_OK; - break; - } - return status; -} - -#if PLAT_WOW_GPIO_PIN -static irqreturn_t -ar6000_wow_irq(int irq, void *dev_id) -{ - gpio_clear_detect_status(wow_irq); -#ifdef CONFIG_HAS_WAKELOCK - wake_lock_timeout(&ar6k_wow_wake_lock, 3*HZ); -#else - /* TODO: What should I do if there is no wake lock?? */ -#endif - return IRQ_HANDLED; -} -#endif /* PLAT_WOW_GPIO_PIN */ - -#if PLAT_WLAN_CHIP_PWD_PIN -void plat_setup_power_stub(AR_SOFTC_T *ar, int on, int detect) -{ -#if 0//def RK29 -extern int wifi_turn_on_card(void); -extern int wifi_turn_off_card(void); -extern int rk29sdk_wifi_set_carddetect(int val); -extern int wifi_power_up_wifi(void); -extern int wifi_power_down_wifi(void); - - printk("%s :: on %d, detect %d\n", __func__, on, detect); - if (on) { - wifi_turn_on_card(); - wifi_power_up_wifi(); - } else { - wifi_turn_off_card(); - wifi_power_down_wifi(); - } - /* rk29sdk_wifi_set_carddetect(detect ? 1 : 0); */ - -#else - A_BOOL chip_pwd_low_val; - - if (on) { - chip_pwd_low_val = 1; - } else { - chip_pwd_low_val = 0; - } - - if (gpio_request(PLAT_WLAN_CHIP_PWD_PIN, "wlan_chip_pwd_l")!=0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Cannot request CHIP_PWD GPIO")); - } else { - gpio_direction_output(PLAT_WLAN_CHIP_PWD_PIN, 0);/* WLAN_CHIP_PWD */ - gpio_set_value(PLAT_WLAN_CHIP_PWD_PIN, chip_pwd_low_val); - A_MDELAY(100); - gpio_free(PLAT_WLAN_CHIP_PWD_PIN); - } -#endif -} -#endif /* PLAT_WLAN_CHIP_PWD_PIN */ - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) -static int ar6000_pm_probe(struct platform_device *pdev) -{ - plat_setup_power(NULL, 1, 1); - return 0; -} - -static int ar6000_pm_remove(struct platform_device *pdev) -{ -#ifdef RK29 - plat_setup_power(NULL, 0, 0); -#else - plat_setup_power(NULL, 0, 1); -#endif - return 0; -} - -static int ar6000_pm_suspend(struct platform_device *pdev, pm_message_t state) -{ - return 0; -} - -static int ar6000_pm_resume(struct platform_device *pdev) -{ - int i; - extern struct net_device *ar6000_devices[MAX_AR6000]; - for (i=0; ar6000_devices[i]; ++i) { - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(ar6000_devices[i]); - AR_SOFTC_T *ar = (AR_SOFTC_T *)arPriv->arSoftc; - if (ar && ar->arPlatPowerOff) { - A_BOOL wlanOff = ar->arWlanOff; - A_UINT16 powerState = ar->arWlanPowerState; - A_BOOL btOff = ar->arBTOff; - - if (!wlanOff) { - if (powerState == WLAN_POWER_STATE_CUT_PWR) { - plat_setup_power(ar, 1, 0); - ar->arPlatPowerOff = FALSE; - } - } -#ifdef CONFIG_PM - else if (wlanOff) { - A_BOOL allowCutPwr = ((!ar->arBTSharing) || btOff); - if ((powerState==WLAN_POWER_STATE_CUT_PWR) && (!allowCutPwr)) { - plat_setup_power(ar, 1, 0); - ar->arPlatPowerOff = FALSE; - } - } -#endif /* CONFIG_PM */ - } - } - return 0; -} - -static struct platform_driver ar6000_pm_device = { - .probe = ar6000_pm_probe, - .remove = ar6000_pm_remove, - .suspend = ar6000_pm_suspend, - .resume = ar6000_pm_resume, - .driver = { - .name = "wlan_ar6000_pm_dev", - }, -}; -#endif -#endif /* CONFIG_PM */ - -A_STATUS -ar6000_setup_cut_power_state(struct ar6_softc *ar, AR6000_WLAN_STATE state) -{ - A_STATUS status = A_OK; - HIF_DEVICE_POWER_CHANGE_TYPE config; - - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("%s: Cut power %d %d \n", __func__,state, ar->arWlanPowerState)); -#ifdef CONFIG_PM - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("Wlan OFF %d BT OFf %d \n", ar->arWlanOff, ar->arBTOff)); -#endif - do { - if (state == WLAN_ENABLED) { - /* Not in cut power state.. exit */ - if (ar->arWlanPowerState != WLAN_POWER_STATE_CUT_PWR) { - break; - } - - if (ar->arPlatPowerOff) { - plat_setup_power(ar, 1, 0); - ar->arPlatPowerOff = FALSE; - } - - /* Change the state to ON */ - ar->arWlanPowerState = WLAN_POWER_STATE_ON; - -#ifdef ANDROID_ENV - ar->arResumeDone = FALSE; -#endif /* ANDROID_ENV */ - - /* Indicate POWER_UP to HIF */ - config = HIF_DEVICE_POWER_UP; - status = HIFConfigureDevice(ar->arHifDevice, - HIF_DEVICE_POWER_STATE_CHANGE, - &config, - sizeof(HIF_DEVICE_POWER_CHANGE_TYPE)); - - if (status == A_PENDING) { -#ifdef ANDROID_ENV - /* Wait for resume done event */ - A_UINT32 timeleft = wait_event_interruptible_timeout(ar->arDev[0]->arEvent, - (ar->arResumeDone == TRUE), wmitimeout * HZ); - if (!timeleft || signal_pending(current)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000 : Failed to get resume done event \n")); - status = A_ERROR; - break; - } -#endif - status = A_OK; - } else if (status == A_OK) { - ar6000_restart_endpoint(ar); -#ifdef ANDROID_ENV - ar->arResumeDone = TRUE; -#endif /* ANDROID_ENV */ - status = A_OK; - } - } else if (state == WLAN_DISABLED) { - - - /* Already in cut power state.. exit */ - if (ar->arWlanPowerState == WLAN_POWER_STATE_CUT_PWR) { - break; - } - ar6000_stop_endpoint(ar, TRUE, FALSE); - - config = HIF_DEVICE_POWER_CUT; - status = HIFConfigureDevice(ar->arHifDevice, - HIF_DEVICE_POWER_STATE_CHANGE, - &config, - sizeof(HIF_DEVICE_POWER_CHANGE_TYPE)); - - plat_setup_power(ar, 0, 0); - ar->arPlatPowerOff = TRUE; - - ar->arWlanPowerState = WLAN_POWER_STATE_CUT_PWR; - } - } while (0); - - return status; -} - -A_STATUS -ar6000_setup_deep_sleep_state(struct ar6_softc *ar, AR6000_WLAN_STATE state) -{ - A_STATUS status = A_OK; - - HIF_DEVICE_POWER_CHANGE_TYPE config; - AR_SOFTC_DEV_T *arPriv; - AR_SOFTC_STA_T *arSta; - A_UINT8 i; - - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("%s: Deep sleep %d %d \n", __func__,state, ar->arWlanPowerState)); -#ifdef CONFIG_PM - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("Wlan OFF %d BT OFf %d \n", ar->arWlanOff, ar->arBTOff)); -#endif - do { - WMI_SET_HOST_SLEEP_MODE_CMD hostSleepMode; - - if (state == WLAN_ENABLED) { - A_UINT16 fg_start_period; - - /* Not in deep sleep state.. exit */ - if (ar->arWlanPowerState != WLAN_POWER_STATE_DEEP_SLEEP) { - if (ar->arWlanPowerState != WLAN_POWER_STATE_ON) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Strange state when we resume from deep sleep %d\n", ar->arWlanPowerState)); - } - break; - } - - /* Indicate POWER_UP to HIF */ - config = HIF_DEVICE_POWER_UP; - status = HIFConfigureDevice(ar->arHifDevice, - HIF_DEVICE_POWER_STATE_CHANGE, - &config, - sizeof(HIF_DEVICE_POWER_CHANGE_TYPE)); - - for(i = 0; i < num_device; i++) - { - arPriv = ar->arDev[i]; - arSta = &arPriv->arSta; - - /* - * Free all wlan_nodes (scanned APs that we detected previously) - * because during the time we were suspended, the device may have - * been moved to a new location and these APs scanned for before - * suspend may not be valid - */ - wmi_free_allnodes(arPriv->arWmi); - - fg_start_period = (arSta->scParams.fg_start_period==0) ? 1 : arSta->scParams.fg_start_period; - hostSleepMode.awake = TRUE; - hostSleepMode.asleep = FALSE; - - if ((status=wmi_set_host_sleep_mode_cmd(arPriv->arWmi, &hostSleepMode)) != A_OK) { - break; - } - - /* Change the state to ON */ - ar->arWlanPowerState = WLAN_POWER_STATE_ON; - - /* Enable foreground scanning */ - if ((status=wmi_scanparams_cmd(arPriv->arWmi, fg_start_period, - arSta->scParams.fg_end_period, - arSta->scParams.bg_period, - arSta->scParams.minact_chdwell_time, - arSta->scParams.maxact_chdwell_time, - arSta->scParams.pas_chdwell_time, - arSta->scParams.shortScanRatio, - arSta->scParams.scanCtrlFlags, - arSta->scParams.max_dfsch_act_time, - arSta->scParams.maxact_scan_per_ssid)) != A_OK) - { - break; - } - - if (arPriv->arSsidLen) { - if (ar6000_connect_to_ap(arPriv) != A_OK) { - /* no need to report error if connection failed */ - break; - } - } - } - } else if (state == WLAN_DISABLED){ - WMI_SET_WOW_MODE_CMD wowMode = { .enable_wow = FALSE }; - - /* Already in deep sleep state.. exit */ - if (ar->arWlanPowerState != WLAN_POWER_STATE_ON) { - if (ar->arWlanPowerState != WLAN_POWER_STATE_DEEP_SLEEP) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Strange state when we suspend for deep sleep %d\n", ar->arWlanPowerState)); - } - break; - } - - for(i = 0; i < num_device; i++) - { - arPriv = ar->arDev[i]; - arSta = &arPriv->arSta; - /* make sure we disable wow for deep sleep */ - if ((status=wmi_set_wow_mode_cmd(arPriv->arWmi, &wowMode))!=A_OK) { - break; - } - - /* Disconnect from the AP and disable foreground scanning */ - AR6000_SPIN_LOCK(&arPriv->arPrivLock, 0); - if (arPriv->arConnected == TRUE || arSta->arConnectPending == TRUE) { - AR6000_SPIN_UNLOCK(&arPriv->arPrivLock, 0); - ar6000_disconnect(arPriv); - } else { - AR6000_SPIN_UNLOCK(&arPriv->arPrivLock, 0); - } - - if ((status=wmi_scanparams_cmd(arPriv->arWmi, 0xFFFF, 0, 0, 0, 0, 0, 0, 0, 0, 0)) != A_OK) { - break; - } - ar6000_TxDataCleanup(ar); -#ifndef ATH6K_CONFIG_OTA_MODE - wmi_powermode_cmd(arPriv->arWmi, REC_POWER); -#endif - - hostSleepMode.awake = FALSE; - hostSleepMode.asleep = TRUE; - if ((status=wmi_set_host_sleep_mode_cmd(arPriv->arWmi, &hostSleepMode))!=A_OK) { - break; - } - if (ar->arTxPending[ar->arControlEp]) { - A_UINT32 timeleft = wait_event_interruptible_timeout(arPriv->arEvent, - ar->arTxPending[ar->arControlEp] == 0, wmitimeout * HZ); - if (!timeleft || signal_pending(current)) { - status = A_ERROR; - break; - } - } - } - status = hifWaitForPendingRecv(ar->arHifDevice); - - config = HIF_DEVICE_POWER_DOWN; - status = HIFConfigureDevice(ar->arHifDevice, - HIF_DEVICE_POWER_STATE_CHANGE, - &config, - sizeof(HIF_DEVICE_POWER_CHANGE_TYPE)); - - ar->arWlanPowerState = WLAN_POWER_STATE_DEEP_SLEEP; - } - } while (0); - - if (status!=A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to enter/exit deep sleep %d\n", state)); - } - - return status; -} - -A_STATUS -ar6000_update_wlan_pwr_state(struct ar6_softc *ar, AR6000_WLAN_STATE state, A_BOOL pmEvent) -{ - A_STATUS status = A_OK; - A_UINT16 powerState, oldPowerState; - AR6000_WLAN_STATE oldstate = ar->arWlanState; - A_BOOL wlanOff = ar->arWlanOff; -#ifdef CONFIG_PM - A_BOOL btOff = ar->arBTOff; -#endif /* CONFIG_PM */ - A_UINT8 i; - AR_SOFTC_DEV_T *arPriv; - - if ((state!=WLAN_DISABLED && state!=WLAN_ENABLED)) { - return A_ERROR; - } - - if (ar->bIsDestroyProgress) { - return A_EBUSY; - } - - if (down_interruptible(&ar->arSem)) { - return A_ERROR; - } - - if (ar->bIsDestroyProgress) { - up(&ar->arSem); - return A_EBUSY; - } - - ar->arWlanState = wlanOff ? WLAN_DISABLED : state; - oldPowerState = ar->arWlanPowerState; - if (state == WLAN_ENABLED) { - powerState = ar->arWlanPowerState; - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("WLAN PWR set to ENABLE^^\n")); - if (!wlanOff) { - if (powerState == WLAN_POWER_STATE_DEEP_SLEEP) { - status = ar6000_setup_deep_sleep_state(ar, WLAN_ENABLED); - } else if (powerState == WLAN_POWER_STATE_CUT_PWR) { - status = ar6000_setup_cut_power_state(ar, WLAN_ENABLED); - } - } -#ifdef CONFIG_PM - else if (pmEvent && wlanOff) { - A_BOOL allowCutPwr = ((!ar->arBTSharing) || btOff); - if ((powerState==WLAN_POWER_STATE_CUT_PWR) && (!allowCutPwr)) { - /* Come out of cut power */ - ar6000_setup_cut_power_state(ar, WLAN_ENABLED); - status = ar6000_setup_deep_sleep_state(ar, WLAN_DISABLED); - } - } -#endif /* CONFIG_PM */ - } else if (state == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("WLAN PWR set to DISABLED~\n")); - powerState = WLAN_POWER_STATE_DEEP_SLEEP; -#ifdef CONFIG_PM - if (pmEvent) { /* disable due to suspend */ - A_BOOL suspendCutPwr = (ar->arSuspendConfig == WLAN_SUSPEND_CUT_PWR || - (ar->arSuspendConfig == WLAN_SUSPEND_WOW && - ar->arWow2Config==WLAN_SUSPEND_CUT_PWR)); - A_BOOL suspendCutIfBtOff = ((ar->arSuspendConfig == - WLAN_SUSPEND_CUT_PWR_IF_BT_OFF || - (ar->arSuspendConfig == WLAN_SUSPEND_WOW && - ar->arWow2Config==WLAN_SUSPEND_CUT_PWR_IF_BT_OFF)) && - (!ar->arBTSharing || btOff)); - if ((suspendCutPwr) || - (suspendCutIfBtOff) || - (ar->arWlanPowerState==WLAN_POWER_STATE_CUT_PWR)) - { - if (!wlanOff || ar->arWlanPowerState!=WLAN_POWER_STATE_DEEP_SLEEP) { - powerState = WLAN_POWER_STATE_CUT_PWR; - } - } - } else { - if ((wlanOff) && - (ar->arWlanOffConfig == WLAN_OFF_CUT_PWR) && - (!ar->arBTSharing || btOff)) - { - /* For BT clock sharing designs, CUT_POWER depend on BT state */ - powerState = WLAN_POWER_STATE_CUT_PWR; - } - } -#endif /* CONFIG_PM */ - - if (powerState == WLAN_POWER_STATE_DEEP_SLEEP) { - if (ar->arWlanPowerState == WLAN_POWER_STATE_CUT_PWR) { - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("Load firmware before set to deep sleep\n")); - ar6000_setup_cut_power_state(ar, WLAN_ENABLED); - } - status = ar6000_setup_deep_sleep_state(ar, WLAN_DISABLED); - } else if (powerState == WLAN_POWER_STATE_CUT_PWR) { - status = ar6000_setup_cut_power_state(ar, WLAN_DISABLED); - } - - } - - if (status!=A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to setup WLAN state %d\n", ar->arWlanState)); - ar->arWlanState = oldstate; - } else if (status == A_OK) { - WMI_REPORT_SLEEP_STATE_EVENT wmiSleepEvent, *pSleepEvent = NULL; - if ((ar->arWlanPowerState == WLAN_POWER_STATE_ON) && (oldPowerState != WLAN_POWER_STATE_ON)) { - wmiSleepEvent.sleepState = WMI_REPORT_SLEEP_STATUS_IS_AWAKE; - pSleepEvent = &wmiSleepEvent; - } else if ((ar->arWlanPowerState != WLAN_POWER_STATE_ON) && (oldPowerState == WLAN_POWER_STATE_ON)) { - wmiSleepEvent.sleepState = WMI_REPORT_SLEEP_STATUS_IS_DEEP_SLEEP; - pSleepEvent = &wmiSleepEvent; - } - if (pSleepEvent) { - AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("SENT WLAN Sleep Event %d\n", wmiSleepEvent.sleepState)); - for(i = 0; i < num_device; i++) - { - arPriv = ar->arDev[i]; - ar6000_send_event_to_app(arPriv, WMI_REPORT_SLEEP_STATE_EVENTID, (A_UINT8*)pSleepEvent, - sizeof(WMI_REPORT_SLEEP_STATE_EVENTID)); - } - } - } - up(&ar->arSem); - return status; -} - -A_STATUS -ar6000_set_bt_hw_state(struct ar6_softc *ar, A_UINT32 enable) -{ -#ifdef CONFIG_PM - A_BOOL off = (enable == 0); - A_STATUS status; - if (ar->arBTOff == off) { - return A_OK; - } - ar->arBTOff = off; - status = ar6000_update_wlan_pwr_state(ar, ar->arWlanOff ? WLAN_DISABLED : WLAN_ENABLED, FALSE); - return status; -#else - return A_OK; -#endif -} - -A_STATUS -ar6000_set_wlan_state(struct ar6_softc *ar, AR6000_WLAN_STATE state) -{ - A_INT32 i; - A_STATUS status; - A_BOOL off = (state == WLAN_DISABLED); - if (ar->arWlanOff == off) { - return A_OK; - } - ar->arWlanOff = off; - status = ar6000_update_wlan_pwr_state(ar, state, FALSE); - for(i = 0; i < num_device; i++) { - AR_SOFTC_DEV_T *arPriv = ar->arDev[i]; - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - if (arSta->scan_triggered) { - ar6000_scanComplete_event(arPriv, A_OK); - } - } - return status; -} - -void ar6000_pm_init() -{ - A_REGISTER_MODULE_DEBUG_INFO(pm); -#ifdef CONFIG_PM -#ifdef CONFIG_HAS_WAKELOCK - wake_lock_init(&ar6k_suspend_wake_lock, WAKE_LOCK_SUSPEND, "ar6k_suspend"); - wake_lock_init(&ar6k_wow_wake_lock, WAKE_LOCK_SUSPEND, "ar6k_wow"); -#endif - /* - * Register ar6000_pm_device into system. - * We should also add platform_device into the first item of array - * of devices[] in file arch/xxx/mach-xxx/board-xxxx.c - */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) - if (platform_driver_register(&ar6000_pm_device)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000: fail to register the power control driver.\n")); - } -#endif - -#if PLAT_WOW_GPIO_PIN - wow_irq = gpio_to_irq(PLAT_WOW_GPIO_PIN); - if (wow_irq) { - int ret; - ret = request_irq(wow_irq, ar6000_wow_irq, - IRQF_SHARED | IRQF_TRIGGER_RISING, - "ar6000" "sdiowakeup", &wow_irq); - if (!ret) { - ret = enable_irq_wake(wow_irq); - if (ret < 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Couldn't enable WoW IRQ as wakeup interrupt")); - } - } - } -#endif /* PLAT_WOW_GPIO_PIN */ -#endif /* CONFIG_PM */ -} - -void ar6000_pm_exit() -{ -#ifdef CONFIG_PM -#if PLAT_WOW_GPIO_PIN - if (wow_irq) { - if (disable_irq_wake(wow_irq)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Couldn't disable hostwake IRQ wakeup mode\n")); - } - free_irq(wow_irq, &wow_irq); - wow_irq = 0; - } -#endif /* PLAT_WOW_GPIO_PIN */ - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) - platform_driver_unregister(&ar6000_pm_device); -#endif -#ifdef CONFIG_HAS_WAKELOCK - wake_lock_destroy(&ar6k_suspend_wake_lock); - wake_lock_destroy(&ar6k_wow_wake_lock); -#endif -#endif /* CONFIG_PM */ -} - diff --git a/drivers/net/wireless/ar6003/host/os/linux/ar6000_raw_if.c b/drivers/net/wireless/ar6003/host/os/linux/ar6000_raw_if.c deleted file mode 100644 index 39e5823794a8..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/ar6000_raw_if.c +++ /dev/null @@ -1,465 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -#include "ar6000_drv.h" - -#ifdef HTC_RAW_INTERFACE - -static void -ar6000_htc_raw_read_cb(void *Context, HTC_PACKET *pPacket) -{ - AR_SOFTC_T *ar = (AR_SOFTC_T *)Context; - raw_htc_buffer *busy; - HTC_RAW_STREAM_ID streamID; - AR_RAW_HTC_T *arRaw = ar->arRawHtc; - - busy = (raw_htc_buffer *)pPacket->pPktContext; - A_ASSERT(busy != NULL); - - if (pPacket->Status == A_ECANCELED) { - /* - * HTC provides A_ECANCELED status when it doesn't want to be refilled - * (probably due to a shutdown) - */ - return; - } - - streamID = arEndpoint2RawStreamID(ar,pPacket->Endpoint); - A_ASSERT(streamID != HTC_RAW_STREAM_NOT_MAPPED); - if(streamID == HTC_RAW_STREAM_NOT_MAPPED) { - return; /* in case panic_on_assert==0 */ - } - -#ifdef CF - if (down_trylock(&arRaw->raw_htc_read_sem[streamID])) { -#else - if (down_interruptible(&arRaw->raw_htc_read_sem[streamID])) { -#endif /* CF */ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to down the semaphore\n")); - } - - A_ASSERT((pPacket->Status != A_OK) || - (pPacket->pBuffer == (busy->data + HTC_HEADER_LEN))); - - busy->length = pPacket->ActualLength + HTC_HEADER_LEN; - busy->currPtr = HTC_HEADER_LEN; - arRaw->read_buffer_available[streamID] = TRUE; - //AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("raw read cb: 0x%X 0x%X \n", busy->currPtr,busy->length); - up(&arRaw->raw_htc_read_sem[streamID]); - - /* Signal the waiting process */ - AR_DEBUG_PRINTF(ATH_DEBUG_HTC_RAW,("Waking up the StreamID(%d) read process\n", streamID)); - wake_up_interruptible(&arRaw->raw_htc_read_queue[streamID]); -} - -static void -ar6000_htc_raw_write_cb(void *Context, HTC_PACKET *pPacket) -{ - AR_SOFTC_T *ar = (AR_SOFTC_T *)Context; - raw_htc_buffer *free; - HTC_RAW_STREAM_ID streamID; - AR_RAW_HTC_T *arRaw = ar->arRawHtc; - - free = (raw_htc_buffer *)pPacket->pPktContext; - A_ASSERT(free != NULL); - - if (pPacket->Status == A_ECANCELED) { - /* - * HTC provides A_ECANCELED status when it doesn't want to be refilled - * (probably due to a shutdown) - */ - return; - } - - streamID = arEndpoint2RawStreamID(ar,pPacket->Endpoint); - A_ASSERT(streamID != HTC_RAW_STREAM_NOT_MAPPED); - if(streamID == HTC_RAW_STREAM_NOT_MAPPED) { - return; /* in case panic_on_assert==0 */ - } -#ifdef CF - if (down_trylock(&arRaw->raw_htc_write_sem[streamID])) { -#else - if (down_interruptible(&arRaw->raw_htc_write_sem[streamID])) { -#endif - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to down the semaphore\n")); - } - - A_ASSERT(pPacket->pBuffer == (free->data + HTC_HEADER_LEN)); - - free->length = 0; - arRaw->write_buffer_available[streamID] = TRUE; - up(&arRaw->raw_htc_write_sem[streamID]); - - /* Signal the waiting process */ - AR_DEBUG_PRINTF(ATH_DEBUG_HTC_RAW,("Waking up the StreamID(%d) write process\n", streamID)); - wake_up_interruptible(&arRaw->raw_htc_write_queue[streamID]); -} - -/* connect to a service */ -static A_STATUS ar6000_connect_raw_service(AR_SOFTC_T *ar, - HTC_RAW_STREAM_ID StreamID) -{ - A_STATUS status; - HTC_SERVICE_CONNECT_RESP response; - A_UINT8 streamNo; - HTC_SERVICE_CONNECT_REQ connect; - - do { - - A_MEMZERO(&connect,sizeof(connect)); - /* pass the stream ID as meta data to the RAW streams service */ - streamNo = (A_UINT8)StreamID; - connect.pMetaData = &streamNo; - connect.MetaDataLength = sizeof(A_UINT8); - /* these fields are the same for all endpoints */ - connect.EpCallbacks.pContext = ar; - connect.EpCallbacks.EpTxComplete = ar6000_htc_raw_write_cb; - connect.EpCallbacks.EpRecv = ar6000_htc_raw_read_cb; - /* simple interface, we don't need these optional callbacks */ - connect.EpCallbacks.EpRecvRefill = NULL; - connect.EpCallbacks.EpSendFull = NULL; - connect.MaxSendQueueDepth = RAW_HTC_WRITE_BUFFERS_NUM; - - /* connect to the raw streams service, we may be able to get 1 or more - * connections, depending on WHAT is running on the target */ - connect.ServiceID = HTC_RAW_STREAMS_SVC; - - A_MEMZERO(&response,sizeof(response)); - - /* try to connect to the raw stream, it is okay if this fails with - * status HTC_SERVICE_NO_MORE_EP */ - status = HTCConnectService(ar->arHtcTarget, - &connect, - &response); - - if (A_FAILED(status)) { - if (response.ConnectRespCode == HTC_SERVICE_NO_MORE_EP) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("HTC RAW , No more streams allowed \n")); - status = A_OK; - } - break; - } - - /* set endpoint mapping for the RAW HTC streams */ - arSetRawStream2EndpointIDMap(ar,StreamID,response.Endpoint); - - AR_DEBUG_PRINTF(ATH_DEBUG_HTC_RAW,("HTC RAW : stream ID: %d, endpoint: %d\n", - StreamID, arRawStream2EndpointID(ar,StreamID))); - - } while (FALSE); - - return status; -} - -int ar6000_htc_raw_open(AR_SOFTC_T *ar) -{ - A_STATUS status; - int streamID, endPt, count2; - raw_htc_buffer *buffer; - HTC_SERVICE_ID servicepriority; - AR_RAW_HTC_T *arRaw = ar->arRawHtc; - if (!arRaw) { - arRaw = ar->arRawHtc = A_MALLOC(sizeof(AR_RAW_HTC_T)); - if (arRaw) { - A_MEMZERO(arRaw, sizeof(AR_RAW_HTC_T)); - } - } - A_ASSERT(ar->arHtcTarget != NULL); - if (!arRaw) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Faile to allocate memory for HTC RAW interface\n")); - return -ENOMEM; - } - /* wait for target */ - status = HTCWaitTarget(ar->arHtcTarget); - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("HTCWaitTarget failed (%d)\n", status)); - return -ENODEV; - } - - for (endPt = 0; endPt < ENDPOINT_MAX; endPt++) { - arRaw->arEp2RawMapping[endPt] = HTC_RAW_STREAM_NOT_MAPPED; - } - - for (streamID = HTC_RAW_STREAM_0; streamID < HTC_RAW_STREAM_NUM_MAX; streamID++) { - /* Initialize the data structures */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) - sema_init(&arRaw->raw_htc_read_sem[streamID], 1); - sema_init(&arRaw->raw_htc_write_sem[streamID], 1); -#else - init_MUTEX(&arRaw->raw_htc_read_sem[streamID]); - init_MUTEX(&arRaw->raw_htc_write_sem[streamID]); -#endif - init_waitqueue_head(&arRaw->raw_htc_read_queue[streamID]); - init_waitqueue_head(&arRaw->raw_htc_write_queue[streamID]); - - /* try to connect to the raw service */ - status = ar6000_connect_raw_service(ar,streamID); - - if (A_FAILED(status)) { - break; - } - - if (arRawStream2EndpointID(ar,streamID) == 0) { - break; - } - - for (count2 = 0; count2 < RAW_HTC_READ_BUFFERS_NUM; count2 ++) { - /* Initialize the receive buffers */ - buffer = &arRaw->raw_htc_write_buffer[streamID][count2]; - memset(buffer, 0, sizeof(raw_htc_buffer)); - buffer = &arRaw->raw_htc_read_buffer[streamID][count2]; - memset(buffer, 0, sizeof(raw_htc_buffer)); - - SET_HTC_PACKET_INFO_RX_REFILL(&buffer->HTCPacket, - buffer, - buffer->data, - HTC_RAW_BUFFER_SIZE, - arRawStream2EndpointID(ar,streamID)); - - /* Queue buffers to HTC for receive */ - if ((status = HTCAddReceivePkt(ar->arHtcTarget, &buffer->HTCPacket)) != A_OK) - { - BMIInit(); - return -EIO; - } - } - - for (count2 = 0; count2 < RAW_HTC_WRITE_BUFFERS_NUM; count2 ++) { - /* Initialize the receive buffers */ - buffer = &arRaw->raw_htc_write_buffer[streamID][count2]; - memset(buffer, 0, sizeof(raw_htc_buffer)); - } - - arRaw->read_buffer_available[streamID] = FALSE; - arRaw->write_buffer_available[streamID] = TRUE; - } - - if (A_FAILED(status)) { - return -EIO; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("HTC RAW, number of streams the target supports: %d \n", streamID)); - - servicepriority = HTC_RAW_STREAMS_SVC; /* only 1 */ - - /* set callbacks and priority list */ - HTCSetCreditDistribution(ar->arHtcTarget, - ar, - NULL, /* use default */ - NULL, /* use default */ - &servicepriority, - 1); - - /* Start the HTC component */ - if ((status = HTCStart(ar->arHtcTarget)) != A_OK) { - BMIInit(); - return -EIO; - } - - (ar)->arRawIfInit = TRUE; - - return 0; -} - -int ar6000_htc_raw_close(AR_SOFTC_T *ar) -{ - A_PRINTF("ar6000_htc_raw_close called \n"); - HTCStop(ar->arHtcTarget); - - /* reset the device */ - ar6000_reset_device(ar->arHifDevice, ar->arTargetType, TRUE, FALSE); - /* Initialize the BMI component */ - BMIInit(); - - return 0; -} - -raw_htc_buffer * -get_filled_buffer(AR_SOFTC_T *ar, HTC_RAW_STREAM_ID StreamID) -{ - int count; - raw_htc_buffer *busy; - AR_RAW_HTC_T *arRaw = ar->arRawHtc; - - /* Check for data */ - for (count = 0; count < RAW_HTC_READ_BUFFERS_NUM; count ++) { - busy = &arRaw->raw_htc_read_buffer[StreamID][count]; - if (busy->length) { - break; - } - } - if (busy->length) { - arRaw->read_buffer_available[StreamID] = TRUE; - } else { - arRaw->read_buffer_available[StreamID] = FALSE; - } - - return busy; -} - -ssize_t ar6000_htc_raw_read(AR_SOFTC_T *ar, HTC_RAW_STREAM_ID StreamID, - char __user *buffer, size_t length) -{ - int readPtr; - raw_htc_buffer *busy; - AR_RAW_HTC_T *arRaw = ar->arRawHtc; - - if (arRawStream2EndpointID(ar,StreamID) == 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("StreamID(%d) not connected! \n", StreamID)); - return -EFAULT; - } - - if (down_interruptible(&arRaw->raw_htc_read_sem[StreamID])) { - return -ERESTARTSYS; - } - - busy = get_filled_buffer(ar,StreamID); - while (!arRaw->read_buffer_available[StreamID]) { - up(&arRaw->raw_htc_read_sem[StreamID]); - - /* Wait for the data */ - AR_DEBUG_PRINTF(ATH_DEBUG_HTC_RAW,("Sleeping StreamID(%d) read process\n", StreamID)); - if (wait_event_interruptible(arRaw->raw_htc_read_queue[StreamID], - arRaw->read_buffer_available[StreamID])) - { - return -EINTR; - } - if (down_interruptible(&arRaw->raw_htc_read_sem[StreamID])) { - return -ERESTARTSYS; - } - busy = get_filled_buffer(ar,StreamID); - } - - /* Read the data */ - readPtr = busy->currPtr; - if (length > busy->length - HTC_HEADER_LEN) { - length = busy->length - HTC_HEADER_LEN; - } - if (copy_to_user(buffer, &busy->data[readPtr], length)) { - up(&arRaw->raw_htc_read_sem[StreamID]); - return -EFAULT; - } - - busy->currPtr += length; - - if (busy->currPtr == busy->length) - { - busy->currPtr = 0; - busy->length = 0; - HTC_PACKET_RESET_RX(&busy->HTCPacket); - //AR_DEBUG_PRINTF(ATH_DEBUG_HTC_RAW,("raw read ioctl: ep for packet:%d \n", busy->HTCPacket.Endpoint)); - HTCAddReceivePkt(ar->arHtcTarget, &busy->HTCPacket); - } - arRaw->read_buffer_available[StreamID] = FALSE; - up(&arRaw->raw_htc_read_sem[StreamID]); - - return length; -} - -static raw_htc_buffer * -get_free_buffer(AR_SOFTC_T *ar, HTC_ENDPOINT_ID StreamID) -{ - int count; - raw_htc_buffer *free; - AR_RAW_HTC_T *arRaw = ar->arRawHtc; - - free = NULL; - for (count = 0; count < RAW_HTC_WRITE_BUFFERS_NUM; count ++) { - free = &arRaw->raw_htc_write_buffer[StreamID][count]; - if (free->length == 0) { - break; - } - } - if (!free->length) { - arRaw->write_buffer_available[StreamID] = TRUE; - } else { - arRaw->write_buffer_available[StreamID] = FALSE; - } - - return free; -} - -ssize_t ar6000_htc_raw_write(AR_SOFTC_T *ar, HTC_RAW_STREAM_ID StreamID, - char __user *buffer, size_t length) -{ - int writePtr; - raw_htc_buffer *free; - AR_RAW_HTC_T *arRaw = ar->arRawHtc; - if (arRawStream2EndpointID(ar,StreamID) == 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("StreamID(%d) not connected! \n", StreamID)); - return -EFAULT; - } - - if (down_interruptible(&arRaw->raw_htc_write_sem[StreamID])) { - return -ERESTARTSYS; - } - - /* Search for a free buffer */ - free = get_free_buffer(ar,StreamID); - - /* Check if there is space to write else wait */ - while (!arRaw->write_buffer_available[StreamID]) { - up(&arRaw->raw_htc_write_sem[StreamID]); - - /* Wait for buffer to become free */ - AR_DEBUG_PRINTF(ATH_DEBUG_HTC_RAW,("Sleeping StreamID(%d) write process\n", StreamID)); - if (wait_event_interruptible(arRaw->raw_htc_write_queue[StreamID], - arRaw->write_buffer_available[StreamID])) - { - return -EINTR; - } - if (down_interruptible(&arRaw->raw_htc_write_sem[StreamID])) { - return -ERESTARTSYS; - } - free = get_free_buffer(ar,StreamID); - } - - /* Send the data */ - writePtr = HTC_HEADER_LEN; - if (length > (HTC_RAW_BUFFER_SIZE - HTC_HEADER_LEN)) { - length = HTC_RAW_BUFFER_SIZE - HTC_HEADER_LEN; - } - - if (copy_from_user(&free->data[writePtr], buffer, length)) { - up(&arRaw->raw_htc_read_sem[StreamID]); - return -EFAULT; - } - - free->length = length; - - SET_HTC_PACKET_INFO_TX(&free->HTCPacket, - free, - &free->data[writePtr], - length, - arRawStream2EndpointID(ar,StreamID), - AR6K_DATA_PKT_TAG); - - HTCSendPkt(ar->arHtcTarget,&free->HTCPacket); - - arRaw->write_buffer_available[StreamID] = FALSE; - up(&arRaw->raw_htc_write_sem[StreamID]); - - return length; -} -#endif /* HTC_RAW_INTERFACE */ diff --git a/drivers/net/wireless/ar6003/host/os/linux/ar6k_mem_debug.c b/drivers/net/wireless/ar6003/host/os/linux/ar6k_mem_debug.c deleted file mode 100644 index cb7cd3084ba4..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/ar6k_mem_debug.c +++ /dev/null @@ -1,246 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ -// -#include "ar6000_drv.h" - -#define malloc(size) kmalloc((size), GFP_ATOMIC) -#define free(ptr) kfree((ptr)) - -typedef struct MemInfo { - void *ptr; - const char *caller; - int lineno; - size_t size; -} MemInfo; - - - -typedef unsigned long hash_key; - -typedef struct HashItem { - hash_key Key; - struct HashItem * Next; -} HashItem; - -typedef struct a_hash { - HashItem **Buckets; - size_t len; - int (*cmpKeyFunc)(const hash_key a, const hash_key b); - unsigned long (*hashFunc)(const hash_key key); - HashItem* (*mkNodeFunc)(hash_key key); -} a_hash; - -static a_hash* gMem; - -static int cmpMemInfo(const hash_key a, const hash_key b) -{ - return((const MemInfo*)a)->ptr - ((const MemInfo*)b)->ptr; -} - -static unsigned long hashMemInfo(const hash_key key) -{ - return(unsigned long)((const MemInfo*)key)->ptr; -} - -static HashItem* mkMemInfoItem(hash_key key) -{ - HashItem* item; - item = malloc(sizeof(HashItem)+ sizeof(MemInfo)); - item->Key = (hash_key)(item+1); - memcpy((void*)item->Key, (void*)key, sizeof(MemInfo)); - return item; -} - -static void rmItem(HashItem* item, void* data) -{ /* private function, don't use !! */ - free(item); -} - -HashItem* a_hash_add(a_hash *hash, const hash_key Key) -{ - int hashIndex = hash->hashFunc(Key) % hash->len; - HashItem* item = hash->mkNodeFunc(Key); - item->Next = hash->Buckets[hashIndex]; - hash->Buckets[hashIndex] = item; - return item; -} - -void a_hash_iterate(a_hash* hash, void (*func)(HashItem*, void*), void* data) -{ - size_t i; - HashItem *p, *next; - for (i=0; ilen; ++i) { - p = hash->Buckets[i]; - while (p) { - next = p->Next; - func(p, data); - p = next; - } - } -} - -void a_hash_clear(a_hash* hash) -{ - a_hash_iterate(hash, rmItem, NULL); - memset(hash->Buckets, 0, hash->len * sizeof(HashItem*)); -} - -void a_hash_destroy(a_hash* hash) -{ - a_hash_clear(hash); - free(hash); -} - -static HashItem** __a_hash_find(a_hash* hash, const hash_key Key) -{ - int hashIndex = hash->hashFunc(Key) % hash->len; - HashItem** result = &hash->Buckets[hashIndex]; - while (*result) { - if (hash->cmpKeyFunc((*result)->Key, Key)==0) - return result; - else - result = &(*result)->Next; - } - return result; -} - -HashItem* a_hash_find(a_hash* hash, const hash_key Key) -{ - return *__a_hash_find(hash, Key); -} - -HashItem* a_hash_findNext(a_hash* hash, HashItem* item) -{ - hash_key Key = (item) ? item->Key : 0; - if (item) - item = item->Next; - while (item) { - if (hash->cmpKeyFunc(item->Key, Key) == 0) - return item; - else - item = item->Next; - } - return item; -} - -void a_hash_erase(a_hash* hash, const hash_key Key) -{ - HashItem* p; - HashItem** prev = __a_hash_find(hash, Key); - p = *prev; - if (p) { - *prev = p->Next; - rmItem(p, NULL); - } -} - -void __a_meminfo_add(void *ptr, size_t msize, const char *func, int lineno) -{ - MemInfo info; - info.ptr = ptr; - info.lineno = lineno; - info.caller = func; - info.size = msize; - if (!gMem) { - int len = 512; - size_t size = sizeof(HashItem*) * len; - gMem = (a_hash*)malloc(sizeof(a_hash)+size); - memset(gMem, 0, sizeof(a_hash)+size); - gMem->Buckets = (HashItem**)(gMem+1); - gMem->len = len; - - gMem->mkNodeFunc = mkMemInfoItem; - gMem->cmpKeyFunc = cmpMemInfo; - gMem->hashFunc = hashMemInfo; - } - - a_hash_add(gMem, (hash_key)&info); -} - -void a_meminfo_del(void *ptr) -{ - MemInfo info; - info.ptr = ptr; - if (gMem) { - HashItem* p; - HashItem** prev = __a_hash_find(gMem, (unsigned long)&info); - p = *prev; - if (p) { - *prev = p->Next; - rmItem(p, NULL); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Warning! memory ptr %p not found!", __func__, ptr)); - } - } -} - -void* a_mem_alloc(size_t msize, int type, const char *func, int lineno) -{ - void *ptr = kmalloc(msize, type); - __a_meminfo_add(ptr, msize, func, lineno); - return ptr; -} - -void a_mem_free(void *ptr) -{ - a_meminfo_del(ptr); - kfree(ptr); -} - -static void printMemInfo(HashItem *item, void*arg) -{ - MemInfo *info = (MemInfo*)item->Key; - int *total = (int*)arg; - *total += info->size; - A_PRINTF("%s line %d size %d ptr %p\n", info->caller, info->lineno, info->size, info->ptr); -} - -void a_meminfo_report(int clear) -{ - int total = 0; - A_PRINTF("AR6K Memory Report\n"); - if (gMem) { - a_hash_iterate(gMem, printMemInfo, &total); - if (clear) { - a_hash_destroy(gMem); - } - } - A_PRINTF("Total %d bytes\n", total); -} - -A_BOOL a_meminfo_find(void *ptr) -{ - MemInfo info; - info.ptr = ptr; - if (gMem) { - HashItem* p; - HashItem** prev = __a_hash_find(gMem, (unsigned long)&info); - p = *prev; - if (p) { - return TRUE; - } else { - return FALSE; - } - } -} diff --git a/drivers/net/wireless/ar6003/host/os/linux/ar6k_pal.c b/drivers/net/wireless/ar6003/host/os/linux/ar6k_pal.c deleted file mode 100644 index 179a2f05688b..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/ar6k_pal.c +++ /dev/null @@ -1,471 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -/* PAL Transport driver for AR6003 */ - -#include "ar6000_drv.h" -#include -#include -#include - -extern unsigned int setupbtdev; -extern unsigned int loghci; - -#define bt_check_bit(val, bit) (val & bit) -#define bt_set_bit(val, bit) (val |= bit) -#define bt_clear_bit(val, bit) (val &= ~bit) - -/* export ATH_AR6K_DEBUG_HCI_PAL=yes in host/localmake.linux.inc - * to enable debug information */ -#ifdef HCIPAL_DEBUG -#define PRIN_LOG(format, args...) printk(KERN_ALERT "%s:%d - %s Msg:" format "\n",__FUNCTION__, __LINE__, __FILE__, ## args) -#else -#define PRIN_LOG(format, args...) -#endif - - -/*** BT Stack Entrypoints *******/ -/*************************************** - * bt_open - open a handle to the device - ***************************************/ -static int bt_open(struct hci_dev *hdev) -{ - PRIN_LOG("HCI PAL: bt_open - enter - x\n"); - set_bit(HCI_RUNNING, &hdev->flags); - set_bit(HCI_UP, &hdev->flags); - set_bit(HCI_INIT, &hdev->flags); - return 0; -} - -/*************************************** - * bt_close - close handle to the device - ***************************************/ -static int bt_close(struct hci_dev *hdev) -{ - PRIN_LOG("HCI PAL: bt_close - enter\n"); - clear_bit(HCI_RUNNING, &hdev->flags); - return 0; -} - -/***************************** - * bt_ioctl - ioctl processing - *****************************/ -static int bt_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg) -{ - PRIN_LOG("HCI PAL: bt_ioctl - enter\n"); - return -ENOIOCTLCMD; -} - -/************************************** - * bt_flush - flush outstanding packets - **************************************/ -static int bt_flush(struct hci_dev *hdev) -{ - PRIN_LOG("HCI PAL: bt_flush - enter\n"); - return 0; -} - -/*************** - * bt_destruct - ***************/ -static void bt_destruct(struct hci_dev *hdev) -{ - PRIN_LOG("HCI PAL: bt_destruct - enter\n"); - /* nothing to do here */ -} - -/**************************************************** - * Invoked from bluetooth stack via hdev->send() - * to send the packet out via ar6k to PAL firmware. - * - * For HCI command packet wmi_send_hci_cmd() is invoked. - * wmi_send_hci_cmd adds WMI_CMD_HDR and sends the packet - * to PAL firmware. - * - * For HCI ACL data packet wmi_data_hdr_add is invoked - * to add WMI_DATA_HDR to the packet. ar6000_acl_data_tx - * is then invoked to send the packet to PAL firmware. - ******************************************************/ -static int btpal_send_frame(struct sk_buff *skb) -{ - struct hci_dev *hdev = (struct hci_dev *)skb->dev; - HCI_TRANSPORT_PACKET_TYPE type; - ar6k_hci_pal_info_t *pHciPalInfo; - A_STATUS status = A_OK; - struct sk_buff *txSkb = NULL; - AR_SOFTC_DEV_T *ar; - - if (!hdev) { - PRIN_LOG("HCI PAL: btpal_send_frame - no device\n"); - return -ENODEV; - } - - if (!test_bit(HCI_RUNNING, &hdev->flags)) { - PRIN_LOG("HCI PAL: btpal_send_frame - not open\n"); - return -EBUSY; - } - - pHciPalInfo = (ar6k_hci_pal_info_t *)hdev->driver_data; - A_ASSERT(pHciPalInfo != NULL); - ar = pHciPalInfo->ar; - - PRIN_LOG("+btpal_send_frame type: %d \n",bt_cb(skb)->pkt_type); - type = HCI_COMMAND_TYPE; - - switch (bt_cb(skb)->pkt_type) { - case HCI_COMMAND_PKT: - type = HCI_COMMAND_TYPE; - hdev->stat.cmd_tx++; - break; - - case HCI_ACLDATA_PKT: - type = HCI_ACL_TYPE; - hdev->stat.acl_tx++; - break; - - case HCI_SCODATA_PKT: - /* we don't support SCO over the pal */ - kfree_skb(skb); - return 0; - default: - A_ASSERT(FALSE); - kfree_skb(skb); - return 0; - } - - if(loghci) { - A_PRINTF(">>> Send HCI %s packet len: %d\n", - (type == HCI_COMMAND_TYPE) ? "COMMAND" : "ACL", - skb->len); - if (type == HCI_COMMAND_TYPE) { - A_PRINTF("HCI Command: OGF:0x%X OCF:0x%X \r\n", - (HCI_GET_OP_CODE(skb->data)) >> 10, - (HCI_GET_OP_CODE(skb->data)) & 0x3FF); - } - DebugDumpBytes(skb->data,skb->len,"BT HCI SEND Packet Dump"); - } - - do { - if(type == HCI_COMMAND_TYPE) - { - PRIN_LOG("HCI command"); - - if (ar->arSoftc->arWmiReady == FALSE) - { - PRIN_LOG("WMI not ready "); - break; - } - - if (wmi_send_hci_cmd(ar->arWmi, skb->data, skb->len) != A_OK) - { - PRIN_LOG("send hci cmd error"); - break; - } - } - else if(type == HCI_ACL_TYPE) - { - void *osbuf; - - PRIN_LOG("ACL data"); - if (ar->arSoftc->arWmiReady == FALSE) - { - PRIN_LOG("WMI not ready"); - break; - } - - /* need to add WMI header so allocate a skb with more space */ - txSkb = bt_skb_alloc(TX_PACKET_RSV_OFFSET + WMI_MAX_TX_META_SZ + - sizeof(WMI_DATA_HDR) + skb->len, - GFP_ATOMIC); - - if (txSkb == NULL) { - status = A_NO_MEMORY; - PRIN_LOG("No memory"); - break; - } - - bt_cb(txSkb)->pkt_type = bt_cb(skb)->pkt_type; - txSkb->dev = (void *)pHciPalInfo->hdev; - skb_reserve(txSkb, TX_PACKET_RSV_OFFSET + WMI_MAX_TX_META_SZ + sizeof(WMI_DATA_HDR)); - A_MEMCPY(txSkb->data, skb->data, skb->len); - skb_put(txSkb,skb->len); - /* Add WMI packet type */ - osbuf = (void *)txSkb; - - PRIN_LOG("\nAdd WMI header"); - if (wmi_data_hdr_add(ar->arWmi, osbuf, DATA_MSGTYPE, 0, WMI_DATA_HDR_DATA_TYPE_ACL,0,NULL) != A_OK) { - PRIN_LOG("XIOCTL_ACL_DATA - wmi_data_hdr_add failed\n"); - } else { - /* Send data buffer over HTC */ - PRIN_LOG("acl data tx"); - ar6000_acl_data_tx(osbuf, ar); - } - txSkb = NULL; - } - } while (FALSE); - - if (txSkb != NULL) { - PRIN_LOG("Free skb"); - kfree_skb(txSkb); - } - kfree_skb(skb); - return 0; -} - - -/*********************************************** - * Unregister HCI device and free HCI device info - ***********************************************/ -static void bt_cleanup_hci_pal(ar6k_hci_pal_info_t *pHciPalInfo) -{ - int err; - - if (bt_check_bit(pHciPalInfo->ulFlags, HCI_REGISTERED)) { - bt_clear_bit(pHciPalInfo->ulFlags, HCI_REGISTERED); - clear_bit(HCI_RUNNING, &pHciPalInfo->hdev->flags); - clear_bit(HCI_UP, &pHciPalInfo->hdev->flags); - clear_bit(HCI_INIT, &pHciPalInfo->hdev->flags); - A_ASSERT(pHciPalInfo->hdev != NULL); -#ifdef CONFIG_BT - /* unregister */ - PRIN_LOG("Unregister PAL device"); - if ((err = hci_unregister_dev(pHciPalInfo->hdev)) < 0) { - PRIN_LOG("HCI PAL: failed to unregister with bluetooth %d\n",err); - } -#else - (void)&err; -#endif - } - - if (pHciPalInfo->hdev != NULL) { - kfree(pHciPalInfo->hdev); - pHciPalInfo->hdev = NULL; - } -} - -/********************************************************* - * Allocate HCI device and store in PAL private info structure. - *********************************************************/ -static A_STATUS bt_setup_hci_pal(ar6k_hci_pal_info_t *pHciPalInfo) -{ -#ifdef CONFIG_BT - A_STATUS status = A_OK; - struct hci_dev *pHciDev = NULL; - -#if 0 //This condition is not required for PAL - if (!setupbtdev) { - return A_OK; - } -#endif - do { - /* allocate a BT HCI struct for this device */ - pHciDev = hci_alloc_dev(); - if (NULL == pHciDev) { - PRIN_LOG("HCI PAL driver - failed to allocate BT HCI struct \n"); - status = A_NO_MEMORY; - break; - } - - /* save the device, we'll register this later */ - pHciPalInfo->hdev = pHciDev; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) - SET_HCI_BUS_TYPE(pHciDev, HCI_VIRTUAL, HCI_80211); -#else - SET_HCI_BUS_TYPE(pHciDev, HCI_VIRTUAL, HCI_AMP); -#endif - pHciDev->driver_data = pHciPalInfo; - pHciDev->open = bt_open; - pHciDev->close = bt_close; - pHciDev->send = btpal_send_frame; - pHciDev->ioctl = bt_ioctl; - pHciDev->flush = bt_flush; - pHciDev->destruct = bt_destruct; - pHciDev->owner = THIS_MODULE; - /* driver is running in normal BT mode */ - PRIN_LOG("Normal mode enabled"); - bt_set_bit(pHciPalInfo->ulFlags, HCI_NORMAL_MODE); - - } while (FALSE); - - if (A_FAILED(status)) { - bt_cleanup_hci_pal(pHciPalInfo); - } - return status; -#else - (void)&bt_open; - (void)&bt_close; - (void)&btpal_send_frame; - (void)&bt_ioctl; - (void)&bt_flush; - (void)&bt_destruct; - bt_cleanup_hci_pal(pHciPalInfo); - return A_ENOTSUP; -#endif -} - -/********************************************** - * Cleanup HCI device and free HCI PAL private info - *********************************************/ -void ar6k_cleanup_hci_pal(void *ar_p) -{ - AR_SOFTC_DEV_T *ar = (AR_SOFTC_DEV_T *)ar_p; - ar6k_hci_pal_info_t *pHciPalInfo = (ar6k_hci_pal_info_t *)ar->hcipal_info; - - if (pHciPalInfo != NULL) { - bt_cleanup_hci_pal(pHciPalInfo); - A_FREE(pHciPalInfo); - ar->hcipal_info = NULL; - } -} - -/**************************** - * Register HCI device - ****************************/ -static A_BOOL ar6k_pal_transport_ready(void *pHciPal) -{ -#ifdef CONFIG_BT - ar6k_hci_pal_info_t *pHciPalInfo = (ar6k_hci_pal_info_t *)pHciPal; - - PRIN_LOG("HCI device transport ready"); - if(pHciPalInfo == NULL) - return FALSE; - - if (hci_register_dev(pHciPalInfo->hdev) < 0) { - PRIN_LOG("Can't register HCI device"); - hci_free_dev(pHciPalInfo->hdev); - return FALSE; - } - PRIN_LOG("HCI device registered"); - pHciPalInfo->ulFlags |= HCI_REGISTERED; - return TRUE; -#else - return FALSE; -#endif -} - -/************************************************** - * Called from ar6k driver when command or ACL data - * packet is received. Pass the packet to bluetooth - * stack via hci_recv_frame. - **************************************************/ -A_BOOL ar6k_pal_recv_pkt(void *pHciPal, void *osbuf) -{ - struct sk_buff *skb = (struct sk_buff *)osbuf; - ar6k_hci_pal_info_t *pHciPalInfo; - A_BOOL success = FALSE; - A_UINT8 btType = 0; - pHciPalInfo = (ar6k_hci_pal_info_t *)pHciPal; - - do { - - /* if normal mode is not enabled pass on to the stack - * by returning failure */ - if(!(pHciPalInfo->ulFlags & HCI_NORMAL_MODE)) - { - PRIN_LOG("Normal mode not enabled"); - break; - } - - if (!test_bit(HCI_RUNNING, &pHciPalInfo->hdev->flags)) { - PRIN_LOG("HCI PAL: HCI - not running\n"); - break; - } - - if(*((short *)A_NETBUF_DATA(skb)) == WMI_ACL_DATA_EVENTID) - btType = HCI_ACLDATA_PKT; - else - btType = HCI_EVENT_PKT; - /* pull 4 bytes which contains WMI packet type */ - A_NETBUF_PULL(skb, sizeof(int)); - bt_cb(skb)->pkt_type = btType; - skb->dev = (void *)pHciPalInfo->hdev; - - if(loghci) { - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("<<< Recv HCI %s packet len:%d \n", - (btType == HCI_EVENT_TYPE) ? "EVENT" : "ACL", - skb->len)); - DebugDumpBytes(skb->data, skb->len,"BT HCI RECV Packet Dump"); - } - /* pass the received event packet up the stack */ -#ifdef CONFIG_BT - if (hci_recv_frame(skb) != 0) { -#else - if (1) { -#endif - PRIN_LOG("HCI PAL: hci_recv_frame failed \n"); - break; - } else { - PRIN_LOG("HCI PAL: Indicated RCV of type:%d, Length:%d \n",HCI_EVENT_PKT, skb->len); - } - PRIN_LOG("hci recv success"); - success = TRUE; - }while(FALSE); - return success; -} - -/********************************************************** - * HCI PAL init function called from ar6k when it is loaded.. - * Allocates PAL private info, stores the same in ar6k private info. - * Registers a HCI device. - * Registers packet receive callback function with ar6k - **********************************************************/ -A_STATUS ar6k_setup_hci_pal(void *ar_p) -{ - A_STATUS status = A_OK; - ar6k_hci_pal_info_t *pHciPalInfo; - ar6k_pal_config_t ar6k_pal_config; - AR_SOFTC_DEV_T *ar = (AR_SOFTC_DEV_T *)ar_p; - - do { - - pHciPalInfo = (ar6k_hci_pal_info_t *)A_MALLOC(sizeof(ar6k_hci_pal_info_t)); - - if (NULL == pHciPalInfo) { - status = A_NO_MEMORY; - break; - } - - A_MEMZERO(pHciPalInfo, sizeof(ar6k_hci_pal_info_t)); - ar->hcipal_info = pHciPalInfo; - pHciPalInfo->ar = ar; - - status = bt_setup_hci_pal(pHciPalInfo); - if (A_FAILED(status)) { - break; - } - - if(bt_check_bit(pHciPalInfo->ulFlags, HCI_NORMAL_MODE)) - PRIN_LOG("HCI PAL: running in normal mode... \n"); - else - PRIN_LOG("HCI PAL: running in test mode... \n"); - - ar6k_pal_config.fpar6k_pal_recv_pkt = ar6k_pal_recv_pkt; - register_pal_cb(&ar6k_pal_config); - ar6k_pal_transport_ready(ar->hcipal_info); - } while (FALSE); - - if (A_FAILED(status)) { - ar6k_cleanup_hci_pal(ar); - } - return status; -} diff --git a/drivers/net/wireless/ar6003/host/os/linux/cfg80211.c b/drivers/net/wireless/ar6003/host/os/linux/cfg80211.c deleted file mode 100644 index 97f6979028dd..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/cfg80211.c +++ /dev/null @@ -1,1638 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -#include -#include -#include -#include -#include - -#include "ar6000_drv.h" - - -extern unsigned int wmitimeout; -extern int reconnect_flag; - - -#define RATETAB_ENT(_rate, _rateid, _flags) { \ - .bitrate = (_rate), \ - .flags = (_flags), \ - .hw_value = (_rateid), \ -} - -#define CHAN2G(_channel, _freq, _flags) { \ - .band = IEEE80211_BAND_2GHZ, \ - .hw_value = (_channel), \ - .center_freq = (_freq), \ - .flags = (_flags), \ - .max_antenna_gain = 0, \ - .max_power = 30, \ -} - -#define CHAN5G(_channel, _flags) { \ - .band = IEEE80211_BAND_5GHZ, \ - .hw_value = (_channel), \ - .center_freq = 5000 + (5 * (_channel)), \ - .flags = (_flags), \ - .max_antenna_gain = 0, \ - .max_power = 30, \ -} - -static struct -ieee80211_rate ar6k_rates[] = { - RATETAB_ENT(10, 0x1, 0), - RATETAB_ENT(20, 0x2, 0), - RATETAB_ENT(55, 0x4, 0), - RATETAB_ENT(110, 0x8, 0), - RATETAB_ENT(60, 0x10, 0), - RATETAB_ENT(90, 0x20, 0), - RATETAB_ENT(120, 0x40, 0), - RATETAB_ENT(180, 0x80, 0), - RATETAB_ENT(240, 0x100, 0), - RATETAB_ENT(360, 0x200, 0), - RATETAB_ENT(480, 0x400, 0), - RATETAB_ENT(540, 0x800, 0), -}; - -#define ar6k_a_rates (ar6k_rates + 4) -#define ar6k_a_rates_size 8 -#define ar6k_g_rates (ar6k_rates + 0) -#define ar6k_g_rates_size 12 - -static struct -ieee80211_channel ar6k_2ghz_channels[] = { - CHAN2G(1, 2412, 0), - CHAN2G(2, 2417, 0), - CHAN2G(3, 2422, 0), - CHAN2G(4, 2427, 0), - CHAN2G(5, 2432, 0), - CHAN2G(6, 2437, 0), - CHAN2G(7, 2442, 0), - CHAN2G(8, 2447, 0), - CHAN2G(9, 2452, 0), - CHAN2G(10, 2457, 0), - CHAN2G(11, 2462, 0), - CHAN2G(12, 2467, 0), - CHAN2G(13, 2472, 0), - CHAN2G(14, 2484, 0), -}; - -static struct -ieee80211_channel ar6k_5ghz_a_channels[] = { - CHAN5G(34, 0), CHAN5G(36, 0), - CHAN5G(38, 0), CHAN5G(40, 0), - CHAN5G(42, 0), CHAN5G(44, 0), - CHAN5G(46, 0), CHAN5G(48, 0), - CHAN5G(52, 0), CHAN5G(56, 0), - CHAN5G(60, 0), CHAN5G(64, 0), - CHAN5G(100, 0), CHAN5G(104, 0), - CHAN5G(108, 0), CHAN5G(112, 0), - CHAN5G(116, 0), CHAN5G(120, 0), - CHAN5G(124, 0), CHAN5G(128, 0), - CHAN5G(132, 0), CHAN5G(136, 0), - CHAN5G(140, 0), CHAN5G(149, 0), - CHAN5G(153, 0), CHAN5G(157, 0), - CHAN5G(161, 0), CHAN5G(165, 0), - CHAN5G(184, 0), CHAN5G(188, 0), - CHAN5G(192, 0), CHAN5G(196, 0), - CHAN5G(200, 0), CHAN5G(204, 0), - CHAN5G(208, 0), CHAN5G(212, 0), - CHAN5G(216, 0), -}; - -static struct -ieee80211_supported_band ar6k_band_2ghz = { - .n_channels = ARRAY_SIZE(ar6k_2ghz_channels), - .channels = ar6k_2ghz_channels, - .n_bitrates = ar6k_g_rates_size, - .bitrates = ar6k_g_rates, -}; - -static struct -ieee80211_supported_band ar6k_band_5ghz = { - .n_channels = ARRAY_SIZE(ar6k_5ghz_a_channels), - .channels = ar6k_5ghz_a_channels, - .n_bitrates = ar6k_a_rates_size, - .bitrates = ar6k_a_rates, -}; - -static int -ar6k_set_wpa_version(AR_SOFTC_DEV_T *arPriv, enum nl80211_wpa_versions wpa_version) -{ - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: %u\n", __func__, wpa_version)); - - if (!wpa_version) { - arPriv->arAuthMode = WMI_NONE_AUTH; - } else if (wpa_version & NL80211_WPA_VERSION_1) { - arPriv->arAuthMode = WMI_WPA_AUTH; - } else if (wpa_version & NL80211_WPA_VERSION_2) { - arPriv->arAuthMode = WMI_WPA2_AUTH; - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("%s: %u not spported\n", __func__, wpa_version)); - return -ENOTSUPP; - } - - return A_OK; -} - -static int -ar6k_set_auth_type(AR_SOFTC_DEV_T *arPriv, enum nl80211_auth_type auth_type) -{ - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: 0x%x\n", __func__, auth_type)); - - switch (auth_type) { - case NL80211_AUTHTYPE_OPEN_SYSTEM: - arPriv->arDot11AuthMode = OPEN_AUTH; - break; - case NL80211_AUTHTYPE_SHARED_KEY: - arPriv->arDot11AuthMode = SHARED_AUTH; - break; - case NL80211_AUTHTYPE_NETWORK_EAP: - arPriv->arDot11AuthMode = LEAP_AUTH; - break; - default: - arPriv->arDot11AuthMode = OPEN_AUTH; - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("%s: 0x%x not spported\n", __func__, auth_type)); - return -ENOTSUPP; - } - - return A_OK; -} - -static int -ar6k_set_cipher(AR_SOFTC_DEV_T *arPriv, A_UINT32 cipher, A_BOOL ucast) -{ - A_UINT8 *ar_cipher = ucast ? &arPriv->arPairwiseCrypto : - &arPriv->arGroupCrypto; - A_UINT8 *ar_cipher_len = ucast ? &arPriv->arPairwiseCryptoLen : - &arPriv->arGroupCryptoLen; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("%s: cipher 0x%x, ucast %u\n", __func__, cipher, ucast)); - - switch (cipher) { - case 0: - case IW_AUTH_CIPHER_NONE: - *ar_cipher = NONE_CRYPT; - *ar_cipher_len = 0; - break; - case WLAN_CIPHER_SUITE_WEP40: - *ar_cipher = WEP_CRYPT; - *ar_cipher_len = 5; - break; - case WLAN_CIPHER_SUITE_WEP104: - *ar_cipher = WEP_CRYPT; - *ar_cipher_len = 13; - break; - case WLAN_CIPHER_SUITE_TKIP: -#ifdef CFG80211_WAPI_ENABLE - *ar_cipher = WAPI_CRYPT; -#else - *ar_cipher = TKIP_CRYPT; -#endif - *ar_cipher_len = 0; - break; - case WLAN_CIPHER_SUITE_CCMP: - *ar_cipher = AES_CRYPT; - *ar_cipher_len = 0; - break; - default: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("%s: cipher 0x%x not supported\n", __func__, cipher)); - return -ENOTSUPP; - } - - return A_OK; -} - -static void -ar6k_set_key_mgmt(AR_SOFTC_DEV_T *arPriv, A_UINT32 key_mgmt) -{ - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: 0x%x\n", __func__, key_mgmt)); - - if (WLAN_AKM_SUITE_PSK == key_mgmt) { - if (WMI_WPA_AUTH == arPriv->arAuthMode) { - arPriv->arAuthMode = WMI_WPA_PSK_AUTH; - } else if (WMI_WPA2_AUTH == arPriv->arAuthMode) { - arPriv->arAuthMode = WMI_WPA2_PSK_AUTH; - } - } else if (WLAN_AKM_SUITE_8021X != key_mgmt) { - arPriv->arAuthMode = WMI_NONE_AUTH; - } -} - -static int -ar6k_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, - struct cfg80211_connect_params *sme) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - A_STATUS status; -#ifdef CFG80211_WAPI_ENABLE - const unsigned char wps_oui[] = { 0x00, 0x50, 0xf2, 0x04 }; - const unsigned char wpa_oui[] = { 0x00, 0x50, 0xf2, 0x01 }; - unsigned char *ie = sme->ie; -#endif - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: \n", __func__)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready yet\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - if(ar->bIsDestroyProgress) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: destroy in progress\n", __func__)); - return -EBUSY; - } - - if(!sme->ssid_len || IEEE80211_MAX_SSID_LEN < sme->ssid_len) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: ssid invalid\n", __func__)); - return -EINVAL; - } - - if(arSta->arSkipScan == TRUE && - ((sme->channel && sme->channel->center_freq == 0) || - (sme->bssid && !sme->bssid[0] && !sme->bssid[1] && !sme->bssid[2] && - !sme->bssid[3] && !sme->bssid[4] && !sme->bssid[5]))) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s:SkipScan: channel or bssid invalid\n", __func__)); - return -EINVAL; - } - - if(down_interruptible(&ar->arSem)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: busy, couldn't get access\n", __func__)); - return -ERESTARTSYS; - } - - if(ar->bIsDestroyProgress) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: busy, destroy in progress\n", __func__)); - up(&ar->arSem); - return -EBUSY; - } - - if(ar->arTxPending[wmi_get_control_ep(arPriv->arWmi)]) { - /* - * sleep until the command queue drains - */ - wait_event_interruptible_timeout(arPriv->arEvent, - ar->arTxPending[wmi_get_control_ep(arPriv->arWmi)] == 0, wmitimeout * HZ); - if (signal_pending(current)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: cmd queue drain timeout\n", __func__)); - up(&ar->arSem); - return -EINTR; - } - } - up(&ar->arSem); - - if(down_interruptible(&ar->arSem)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: busy, couldn't get access\n", __func__)); - return -ERESTARTSYS; - } - - if(arPriv->arConnected == TRUE && - arPriv->arSsidLen == sme->ssid_len && - !A_MEMCMP(arPriv->arSsid, sme->ssid, arPriv->arSsidLen)) { - reconnect_flag = TRUE; - status = wmi_reconnect_cmd(arPriv->arWmi, - arSta->arReqBssid, - arPriv->arChannelHint); - - if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: wmi_reconnect_cmd failed\n", __func__)); - return -EIO; - } - return 0; - } else if(arPriv->arSsidLen == sme->ssid_len && - !A_MEMCMP(arPriv->arSsid, sme->ssid, arPriv->arSsidLen)) { - ar6000_disconnect(arPriv); - } - - A_MEMZERO(arPriv->arSsid, sizeof(arPriv->arSsid)); - arPriv->arSsidLen = sme->ssid_len; - A_MEMCPY(arPriv->arSsid, sme->ssid, sme->ssid_len); - - if(sme->channel){ - arPriv->arChannelHint = sme->channel->center_freq; - } - - A_MEMZERO(arSta->arReqBssid, sizeof(arSta->arReqBssid)); - if(sme->bssid){ - if(A_MEMCMP(&sme->bssid, bcast_mac, AR6000_ETH_ADDR_LEN)) { - A_MEMCPY(arSta->arReqBssid, sme->bssid, sizeof(arSta->arReqBssid)); - } - } - - ar6k_set_wpa_version(arPriv, sme->crypto.wpa_versions); - ar6k_set_auth_type(arPriv, sme->auth_type); - - if(sme->crypto.n_ciphers_pairwise) { - ar6k_set_cipher(arPriv, sme->crypto.ciphers_pairwise[0], true); - } else { - ar6k_set_cipher(arPriv, IW_AUTH_CIPHER_NONE, true); - } - ar6k_set_cipher(arPriv, sme->crypto.cipher_group, false); - - if(sme->crypto.n_akm_suites) { - ar6k_set_key_mgmt(arPriv, sme->crypto.akm_suites[0]); - } - - if((sme->key_len) && - (WMI_NONE_AUTH == arPriv->arAuthMode) && - (WEP_CRYPT == arPriv->arPairwiseCrypto)) { - struct ar_key *key = NULL; - - if(sme->key_idx < WMI_MIN_KEY_INDEX || sme->key_idx > WMI_MAX_KEY_INDEX) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("%s: key index %d out of bounds\n", __func__, sme->key_idx)); - up(&ar->arSem); - return -ENOENT; - } - - key = &arPriv->keys[sme->key_idx]; - key->key_len = sme->key_len; - A_MEMCPY(key->key, sme->key, key->key_len); - key->cipher = arPriv->arPairwiseCrypto; - arPriv->arDefTxKeyIndex = sme->key_idx; - - wmi_addKey_cmd(arPriv->arWmi, sme->key_idx, - arPriv->arPairwiseCrypto, - GROUP_USAGE | TX_USAGE, - key->key_len, - NULL, - key->key, KEY_OP_INIT_VAL, NULL, - NO_SYNC_WMIFLAG); - } - - if (!arSta->arUserBssFilter) { - if (wmi_bssfilter_cmd(arPriv->arWmi, ALL_BSS_FILTER, 0) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Couldn't set bss filtering\n", __func__)); - up(&ar->arSem); - return -EIO; - } - } - - arPriv->arNetworkType = arPriv->arNextMode; - -#ifdef CFG80211_WAPI_ENABLE -/*the following codes for wps and wapi, but ONLY test wapi*/ - if (ie[0] == WLAN_EID_VENDOR_SPECIFIC && - memcmp(ie + 2, wps_oui, sizeof(wps_oui)) == 0) { - /* WPS IE detected, notify target */ - A_PRINTF("WPS IE detected -- setting WPS flag\n"); - arPriv->arSta.arConnectCtrlFlags |= CONNECT_WPS_FLAG; - arPriv->arAuthMode = 0; - } else { - if ((ie[0]==IEEE80211_ELEMID_RSN) || - (ie[0]==IEEE80211_ELEMID_VENDOR && - memcmp(&ie[2], wpa_oui, sizeof(wpa_oui))==0)) { - sme->ie_len = 0; /* Firmware will set for us. Clear the previous one */ - } - /* for WAPI */ - else if (ie[0]==IEEE80211_ELEMID_WAPI) - { - } - /************/ - arPriv->arSta.arConnectCtrlFlags &= ~CONNECT_WPS_FLAG; - } - wmi_set_appie_cmd(arPriv->arWmi, WMI_FRAME_ASSOC_REQ, sme->ie_len, ie); -/*********************************************************/ -#endif - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: Connect called with authmode %d dot11 auth %d"\ - " PW crypto %d PW crypto Len %d GRP crypto %d"\ - " GRP crypto Len %d channel hint %u\n", - __func__, arPriv->arAuthMode, arPriv->arDot11AuthMode, - arPriv->arPairwiseCrypto, arPriv->arPairwiseCryptoLen, - arPriv->arGroupCrypto, arPriv->arGroupCryptoLen, arPriv->arChannelHint)); - reconnect_flag = 0; - status = wmi_connect_cmd(arPriv->arWmi, arPriv->arNetworkType, - arPriv->arDot11AuthMode, arPriv->arAuthMode, - arPriv->arPairwiseCrypto, arPriv->arPairwiseCryptoLen, - arPriv->arGroupCrypto,arPriv->arGroupCryptoLen, - arPriv->arSsidLen, arPriv->arSsid, - arSta->arReqBssid, arPriv->arChannelHint, - arSta->arConnectCtrlFlags); - - up(&ar->arSem); - - if (A_EINVAL == status) { - A_MEMZERO(arPriv->arSsid, sizeof(arPriv->arSsid)); - arPriv->arSsidLen = 0; - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Invalid request\n", __func__)); - return -ENOENT; - } else if (status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: wmi_connect_cmd failed\n", __func__)); - return -EIO; - } - - if ((!(arSta->arConnectCtrlFlags & CONNECT_DO_WPA_OFFLOAD)) && - ((WMI_WPA_PSK_AUTH == arPriv->arAuthMode) || (WMI_WPA2_PSK_AUTH == arPriv->arAuthMode))) - { - A_TIMEOUT_MS(&arSta->disconnect_timer, A_DISCONNECT_TIMER_INTERVAL, 0); - } - - arSta->arConnectCtrlFlags &= ~CONNECT_DO_WPA_OFFLOAD; - arSta->arConnectPending = TRUE; - - return 0; -} - -void -ar6k_cfg80211_connect_event(AR_SOFTC_DEV_T *arPriv, A_UINT16 channel, - A_UINT8 *bssid, A_UINT16 listenInterval, - A_UINT16 beaconInterval,NETWORK_TYPE networkType, - A_UINT8 beaconIeLen, A_UINT8 assocReqLen, - A_UINT8 assocRespLen, A_UINT8 *assocInfo) -{ - A_UINT16 size = 0; - A_UINT16 capability = 0; - struct cfg80211_bss *bss = NULL; - struct ieee80211_mgmt *mgmt = NULL; - struct ieee80211_channel *ibss_channel = NULL; - s32 signal = 50 * 100; - A_UINT8 ie_buf_len = 0; - unsigned char ie_buf[256]; - unsigned char *ptr_ie_buf = ie_buf; - unsigned char *ieeemgmtbuf = NULL; - A_UINT8 source_mac[ATH_MAC_LEN]; - - A_UINT8 assocReqIeOffset = sizeof(A_UINT16) + /* capinfo*/ - sizeof(A_UINT16); /* listen interval */ - A_UINT8 assocRespIeOffset = sizeof(A_UINT16) + /* capinfo*/ - sizeof(A_UINT16) + /* status Code */ - sizeof(A_UINT16); /* associd */ - A_UINT8 *assocReqIe = assocInfo + beaconIeLen + assocReqIeOffset; - A_UINT8 *assocRespIe = assocInfo + beaconIeLen + assocReqLen + assocRespIeOffset; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: \n", __func__)); - - assocReqLen -= assocReqIeOffset; - assocRespLen -= assocRespIeOffset; - - if((ADHOC_NETWORK & networkType)) { - if(NL80211_IFTYPE_ADHOC != arPriv->wdev->iftype) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("%s: ath6k not in ibss mode\n", __func__)); - return; - } - } - - if((INFRA_NETWORK & networkType)) { - if(NL80211_IFTYPE_STATION != arPriv->wdev->iftype) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("%s: ath6k not in station mode\n", __func__)); - return; - } - } - - /* Before informing the join/connect event, make sure that - * bss entry is present in scan list, if it not present - * construct and insert into scan list, otherwise that - * event will be dropped on the way by cfg80211, due to - * this keys will not be plumbed in case of WEP and - * application will not be aware of join/connect status. */ - bss = cfg80211_get_bss(arPriv->wdev->wiphy, NULL, bssid, - arPriv->wdev->ssid, arPriv->wdev->ssid_len, - ((ADHOC_NETWORK & networkType) ? WLAN_CAPABILITY_IBSS : WLAN_CAPABILITY_ESS), - ((ADHOC_NETWORK & networkType) ? WLAN_CAPABILITY_IBSS : WLAN_CAPABILITY_ESS)); - - if(!bss) { - if (ADHOC_NETWORK & networkType) { - /* construct 802.11 mgmt beacon */ - if(ptr_ie_buf) { - *ptr_ie_buf++ = WLAN_EID_SSID; - *ptr_ie_buf++ = arPriv->arSsidLen; - A_MEMCPY(ptr_ie_buf, arPriv->arSsid, arPriv->arSsidLen); - ptr_ie_buf +=arPriv->arSsidLen; - - *ptr_ie_buf++ = WLAN_EID_IBSS_PARAMS; - *ptr_ie_buf++ = 2; /* length */ - *ptr_ie_buf++ = 0; /* ATIM window */ - *ptr_ie_buf++ = 0; /* ATIM window */ - - /* TODO: update ibss params and include supported rates, - * DS param set, extened support rates, wmm. */ - - ie_buf_len = ptr_ie_buf - ie_buf; - } - - capability |= IEEE80211_CAPINFO_IBSS; - if(WEP_CRYPT == arPriv->arPairwiseCrypto) { - capability |= IEEE80211_CAPINFO_PRIVACY; - } - A_MEMCPY(source_mac, arPriv->arNetDev->dev_addr, ATH_MAC_LEN); - ptr_ie_buf = ie_buf; - } else { - capability = *(A_UINT16 *)(&assocInfo[beaconIeLen]); - A_MEMCPY(source_mac, bssid, ATH_MAC_LEN); - ptr_ie_buf = assocReqIe; - ie_buf_len = assocReqLen; - } - - size = offsetof(struct ieee80211_mgmt, u) - + sizeof(mgmt->u.beacon) - + ie_buf_len; - - ieeemgmtbuf = A_MALLOC_NOWAIT(size); - if(!ieeemgmtbuf) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("%s: ieeeMgmtbuf alloc error\n", __func__)); - return; - } - - A_MEMZERO(ieeemgmtbuf, size); - mgmt = (struct ieee80211_mgmt *)ieeemgmtbuf; - mgmt->frame_control = (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON); - A_MEMCPY(mgmt->da, bcast_mac, ATH_MAC_LEN); - A_MEMCPY(mgmt->sa, source_mac, ATH_MAC_LEN); - A_MEMCPY(mgmt->bssid, bssid, ATH_MAC_LEN); - mgmt->u.beacon.beacon_int = beaconInterval; - mgmt->u.beacon.capab_info = capability; - A_MEMCPY(mgmt->u.beacon.variable, ptr_ie_buf, ie_buf_len); - - ibss_channel = ieee80211_get_channel(arPriv->wdev->wiphy, (int)channel); - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("%s: inform bss with bssid %02x:%02x:%02x:%02x:%02x:%02x "\ - "channel %d beaconInterval %d capability 0x%x\n", - __func__, - mgmt->bssid[0], mgmt->bssid[1], mgmt->bssid[2], - mgmt->bssid[3], mgmt->bssid[4], mgmt->bssid[5], - ibss_channel->hw_value, beaconInterval, capability)); - - bss = cfg80211_inform_bss_frame(arPriv->wdev->wiphy, - ibss_channel, mgmt, - le16_to_cpu(size), - signal, GFP_ATOMIC); - A_FREE(ieeemgmtbuf); - cfg80211_put_bss(bss); - } - - if((ADHOC_NETWORK & networkType)) { - cfg80211_ibss_joined(arPriv->arNetDev, bssid, GFP_ATOMIC); - return; - } - - if (FALSE == arPriv->arConnected) { - /* inform connect result to cfg80211 */ - cfg80211_connect_result(arPriv->arNetDev, bssid, - assocReqIe, assocReqLen, - assocRespIe, assocRespLen, - WLAN_STATUS_SUCCESS, GFP_ATOMIC); - } else { - /* inform roam event to cfg80211 */ - cfg80211_roamed(arPriv->arNetDev, bssid, - assocReqIe, assocReqLen, - assocRespIe, assocRespLen, - GFP_ATOMIC); - } -} - -static int -ar6k_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev, - A_UINT16 reason_code) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: reason=%u\n", __func__, reason_code)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - if(ar->bIsDestroyProgress) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: busy, destroy in progress\n", __func__)); - return -EBUSY; - } - - if(down_interruptible(&ar->arSem)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: busy, couldn't get access\n", __func__)); - return -ERESTARTSYS; - } - - reconnect_flag = 0; - ar6000_disconnect(arPriv); - A_MEMZERO(arPriv->arSsid, sizeof(arPriv->arSsid)); - arPriv->arSsidLen = 0; - - if (arPriv->arSta.arSkipScan == FALSE) { - A_MEMZERO(arPriv->arSta.arReqBssid, sizeof(arPriv->arSta.arReqBssid)); - } - - up(&ar->arSem); - - return 0; -} - -void -ar6k_cfg80211_disconnect_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 reason, - A_UINT8 *bssid, A_UINT8 assocRespLen, - A_UINT8 *assocInfo, A_UINT16 protocolReasonStatus) -{ - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: reason=%u\n", __func__, reason)); - - if((ADHOC_NETWORK & arPriv->arNetworkType)) { - if(NL80211_IFTYPE_ADHOC != arPriv->wdev->iftype) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("%s: ath6k not in ibss mode\n", __func__)); - return; - } - A_MEMZERO(bssid, ETH_ALEN); - cfg80211_ibss_joined(arPriv->arNetDev, bssid, GFP_ATOMIC); - return; - } - - if((INFRA_NETWORK & arPriv->arNetworkType)) { - if(NL80211_IFTYPE_STATION != arPriv->wdev->iftype) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("%s: ath6k not in station mode\n", __func__)); - return; - } - } - - if(FALSE == arPriv->arConnected) { - if(NO_NETWORK_AVAIL == reason) { - /* connect cmd failed */ - cfg80211_connect_result(arPriv->arNetDev, bssid, - NULL, 0, - NULL, 0, - WLAN_STATUS_UNSPECIFIED_FAILURE, - GFP_ATOMIC); - } - } else { - /* connection loss due to disconnect cmd or low rssi */ - cfg80211_disconnected(arPriv->arNetDev, reason, NULL, 0, GFP_ATOMIC); - } -} - -void -ar6k_cfg80211_scan_node(void *arg, bss_t *ni) -{ - struct wiphy *wiphy = (struct wiphy *)arg; - A_UINT16 size; - unsigned char *ieeemgmtbuf = NULL; - struct ieee80211_mgmt *mgmt; - struct ieee80211_channel *channel; - struct ieee80211_supported_band *band; - struct ieee80211_common_ie *cie; - s32 signal; - int freq; - - cie = &ni->ni_cie; - -#define CHAN_IS_11A(x) (!((x >= 2412) && (x <= 2484))) - if(CHAN_IS_11A(cie->ie_chan)) { - /* 11a */ - band = wiphy->bands[IEEE80211_BAND_5GHZ]; - } else if((cie->ie_erp) || (cie->ie_xrates)) { - /* 11g */ - band = wiphy->bands[IEEE80211_BAND_2GHZ]; - } else { - /* 11b */ - band = wiphy->bands[IEEE80211_BAND_2GHZ]; - } - - size = ni->ni_framelen + offsetof(struct ieee80211_mgmt, u); - ieeemgmtbuf = A_MALLOC_NOWAIT(size); - if(!ieeemgmtbuf) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: ieeeMgmtbuf alloc error\n", __func__)); - return; - } - - /* Note: - TODO: Update target to include 802.11 mac header while sending bss info. - Target removes 802.11 mac header while sending the bss info to host, - cfg80211 needs it, for time being just filling the da, sa and bssid fields alone. - */ - mgmt = (struct ieee80211_mgmt *)ieeemgmtbuf; - A_MEMCPY(mgmt->da, bcast_mac, ATH_MAC_LEN); - A_MEMCPY(mgmt->sa, ni->ni_macaddr, ATH_MAC_LEN); - A_MEMCPY(mgmt->bssid, ni->ni_macaddr, ATH_MAC_LEN); - A_MEMCPY(ieeemgmtbuf + offsetof(struct ieee80211_mgmt, u), - ni->ni_buf, ni->ni_framelen); - - freq = cie->ie_chan; - channel = ieee80211_get_channel(wiphy, freq); - signal = ni->ni_snr * 100; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("%s: bssid %02x:%02x:%02x:%02x:%02x:%02x channel %d freq %d size %d\n", - __func__, - mgmt->bssid[0], mgmt->bssid[1], mgmt->bssid[2], - mgmt->bssid[3], mgmt->bssid[4], mgmt->bssid[5], - channel->hw_value, freq, size)); - cfg80211_inform_bss_frame(wiphy, channel, mgmt, - le16_to_cpu(size), - signal, GFP_ATOMIC); - - A_FREE (ieeemgmtbuf); -} - -static int -ar6k_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, - struct cfg80211_scan_request *request) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(ndev); - AR_SOFTC_T *ar = arPriv->arSoftc; - int ret = 0; - A_BOOL forceFgScan = FALSE; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: \n", __func__)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - if (!arPriv->arSta.arUserBssFilter) { - if (wmi_bssfilter_cmd(arPriv->arWmi, - (arPriv->arConnected ? ALL_BUT_BSS_FILTER : ALL_BSS_FILTER), - 0) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Couldn't set bss filtering\n", __func__)); - return -EIO; - } - } - - if(request->n_ssids && - request->ssids[0].ssid_len) { - A_UINT8 i; - - if(request->n_ssids > MAX_PROBED_SSID_INDEX) { - request->n_ssids = MAX_PROBED_SSID_INDEX; - } - - for (i = 0; i < request->n_ssids; i++) { - wmi_probedSsid_cmd(arPriv->arWmi, i, SPECIFIC_SSID_FLAG, - request->ssids[i].ssid_len, - request->ssids[i].ssid); - } - } - - if(arPriv->arConnected) { - forceFgScan = TRUE; - } - - if(wmi_startscan_cmd(arPriv->arWmi, WMI_LONG_SCAN, forceFgScan, FALSE, \ - 0, 0, 0, NULL) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: wmi_startscan_cmd failed\n", __func__)); - ret = -EIO; - } - - arPriv->scan_request = request; - - return ret; -} - -void -ar6k_cfg80211_scanComplete_event(AR_SOFTC_DEV_T *arPriv, A_STATUS status) -{ - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: status %d\n", __func__, status)); - - if(arPriv->scan_request) - { - /* Translate data to cfg80211 mgmt format */ - wmi_iterate_nodes(arPriv->arWmi, ar6k_cfg80211_scan_node, arPriv->wdev->wiphy); - - cfg80211_scan_done(arPriv->scan_request, - (status & A_ECANCELED) ? true : false); - - if(arPriv->scan_request->n_ssids && - arPriv->scan_request->ssids[0].ssid_len) { - A_UINT8 i; - - for (i = 0; i < arPriv->scan_request->n_ssids; i++) { - wmi_probedSsid_cmd(arPriv->arWmi, i, DISABLE_SSID_FLAG, - 0, NULL); - } - } - arPriv->scan_request = NULL; - } -} - -static int -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) -ar6k_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, - A_UINT8 key_index, bool pairwise, const A_UINT8 *mac_addr, - struct key_params *params) -#else -ar6k_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, - A_UINT8 key_index, const A_UINT8 *mac_addr, - struct key_params *params) -#endif -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(ndev); - AR_SOFTC_T *ar = arPriv->arSoftc; - struct ar_key *key = NULL; - A_UINT8 key_usage; - A_UINT8 key_type; - A_STATUS status = 0; -#ifdef CFG80211_WAPI_ENABLE - A_UINT32 *PN; - A_INT32 i; - A_UINT8 wapiKeyRsc[16] = {0}; - #define PN_INIT 0x5c365c36 -#endif - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s:\n", __func__)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - if(key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("%s: key index %d out of bounds\n", __func__, key_index)); - return -ENOENT; - } - - key = &arPriv->keys[key_index]; - A_MEMZERO(key, sizeof(struct ar_key)); - - if(!mac_addr || is_broadcast_ether_addr(mac_addr)) { - key_usage = GROUP_USAGE; - } else { - key_usage = PAIRWISE_USAGE; - } - - if(params) { - if(params->key_len > WLAN_MAX_KEY_LEN || - params->seq_len > IW_ENCODE_SEQ_MAX_SIZE) - return -EINVAL; - - key->key_len = params->key_len; - A_MEMCPY(key->key, params->key, key->key_len); - key->seq_len = params->seq_len; - A_MEMCPY(key->seq, params->seq, key->seq_len); - key->cipher = params->cipher; - } - - switch (key->cipher) { - case WLAN_CIPHER_SUITE_WEP40: - case WLAN_CIPHER_SUITE_WEP104: - key_type = WEP_CRYPT; - break; - - case WLAN_CIPHER_SUITE_TKIP: - key_type = TKIP_CRYPT; - break; - - case WLAN_CIPHER_SUITE_CCMP: - key_type = AES_CRYPT; - break; - - default: - return -ENOTSUPP; - } - - if (((WMI_WPA_PSK_AUTH == arPriv->arAuthMode) || (WMI_WPA2_PSK_AUTH == arPriv->arAuthMode)) && - (GROUP_USAGE & key_usage)) - { - A_UNTIMEOUT(&arPriv->arSta.disconnect_timer); - } - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("%s: index %d, key_len %d, key_type 0x%x,"\ - " key_usage 0x%x, seq_len %d\n", - __func__, key_index, key->key_len, key_type, - key_usage, key->seq_len)); - arPriv->arDefTxKeyIndex = key_index; - -#ifdef CFG80211_WAPI_ENABLE - key_type = WAPI_CRYPT; - key_usage = 0; - if (is_broadcast_ether_addr(mac_addr)) { - key_usage |= GROUP_USAGE; - PN = (A_UINT32 *)wapiKeyRsc; - for (i = 0; i < 4; i++) { - PN[i] = PN_INIT; - } - } else { - key_usage |= PAIRWISE_USAGE; - } - status = wmi_addKey_cmd(arPriv->arWmi, arPriv->arDefTxKeyIndex, key_type, key_usage, - key->key_len, wapiKeyRsc, key->key, KEY_OP_INIT_VAL, - (A_UINT8*)mac_addr, SYNC_BOTH_WMIFLAG); -#else - status = wmi_addKey_cmd(arPriv->arWmi, arPriv->arDefTxKeyIndex, key_type, key_usage, - key->key_len, key->seq, key->key, KEY_OP_INIT_VAL, - (A_UINT8*)mac_addr, SYNC_BOTH_WMIFLAG); -#endif - - - if(status != A_OK) { - return -EIO; - } - - return 0; -} - -static int -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) -ar6k_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev, - A_UINT8 key_index, bool pairwise, const A_UINT8 *mac_addr) -#else -ar6k_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev, - A_UINT8 key_index, const A_UINT8 *mac_addr) -#endif -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(ndev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: index %d\n", __func__, key_index)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - if(key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("%s: key index %d out of bounds\n", __func__, key_index)); - return -ENOENT; - } - - if(!arPriv->keys[key_index].key_len) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: index %d is empty\n", __func__, key_index)); - return 0; - } - - arPriv->keys[key_index].key_len = 0; - - return wmi_deleteKey_cmd(arPriv->arWmi, key_index); -} - - -static int -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) -ar6k_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, - A_UINT8 key_index, bool pairwise, const A_UINT8 *mac_addr, - void *cookie, - void (*callback)(void *cookie, struct key_params*)) -#else -ar6k_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, - A_UINT8 key_index, const A_UINT8 *mac_addr, void *cookie, - void (*callback)(void *cookie, struct key_params*)) -#endif -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(ndev); - AR_SOFTC_T *ar = arPriv->arSoftc; - struct ar_key *key = NULL; - struct key_params params; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: index %d\n", __func__, key_index)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - if(key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("%s: key index %d out of bounds\n", __func__, key_index)); - return -ENOENT; - } - - key = &arPriv->keys[key_index]; - A_MEMZERO(¶ms, sizeof(params)); - params.cipher = key->cipher; - params.key_len = key->key_len; - params.seq_len = key->seq_len; - params.seq = key->seq; - params.key = key->key; - - callback(cookie, ¶ms); - - return key->key_len ? 0 : -ENOENT; -} - - -static int -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) -ar6k_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *ndev, - A_UINT8 key_index,bool unicast, bool multicast) -#else -ar6k_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *ndev, - A_UINT8 key_index) -#endif -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(ndev); - AR_SOFTC_T *ar = arPriv->arSoftc; - struct ar_key *key = NULL; - A_STATUS status = A_OK; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: index %d\n", __func__, key_index)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - if(key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("%s: key index %d out of bounds\n", - __func__, key_index)); - return -ENOENT; - } - - if(!arPriv->keys[key_index].key_len) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: invalid key index %d\n", - __func__, key_index)); - return -EINVAL; - } - - arPriv->arDefTxKeyIndex = key_index; - key = &arPriv->keys[arPriv->arDefTxKeyIndex]; -#ifdef CFG80211_WAPI_ENABLE - /*if WAPI enable, we donot need to set it*/ -#else - status = wmi_addKey_cmd(arPriv->arWmi, arPriv->arDefTxKeyIndex, - arPriv->arPairwiseCrypto, GROUP_USAGE | TX_USAGE, - key->key_len, key->seq, key->key, KEY_OP_INIT_VAL, - NULL, SYNC_BOTH_WMIFLAG); - if (status != A_OK) { - return -EIO; - } -#endif - return 0; -} - -static int -ar6k_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, struct net_device *ndev, - A_UINT8 key_index) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(ndev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: index %d\n", __func__, key_index)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: not supported\n", __func__)); - return -ENOTSUPP; -} - -void -ar6k_cfg80211_tkip_micerr_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 keyid, A_BOOL ismcast) -{ - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, - ("%s: keyid %d, ismcast %d\n", __func__, keyid, ismcast)); - - cfg80211_michael_mic_failure(arPriv->arNetDev, arPriv->arBssid, - (ismcast ? NL80211_KEYTYPE_GROUP : NL80211_KEYTYPE_PAIRWISE), - keyid, NULL, GFP_KERNEL); -} - -static int -ar6k_cfg80211_set_wiphy_params(struct wiphy *wiphy, A_UINT32 changed) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)wiphy_priv(wiphy); - AR_SOFTC_T *ar = arPriv->arSoftc; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: changed 0x%x\n", __func__, changed)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - if (changed & WIPHY_PARAM_RTS_THRESHOLD) { - if (wmi_set_rts_cmd(arPriv->arWmi,wiphy->rts_threshold) != A_OK){ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: wmi_set_rts_cmd failed\n", __func__)); - return -EIO; - } - } - - return 0; -} - -static int -ar6k_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev, - const A_UINT8 *peer, - const struct cfg80211_bitrate_mask *mask) -{ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - A_STATUS status; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: mask 0x%x\n", __func__, mask->fixed)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - status = wmi_set_fixrates_cmd(arPriv->arWmi, mask->fixed); - - if(status == A_EINVAL) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: invalid params\n", __func__)); - return -EINVAL; - } else if(status != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: wmi_set_fixrates_cmd failed\n", __func__)); - return -EIO; - } - - return 0; -#else - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Setting rates: Not supported\n")); - return -EIO; -#endif -} - -/* The type nl80211_tx_power_setting replaces the following data type from 2.6.36 onwards */ -static int -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) -ar6k_cfg80211_set_txpower(struct wiphy *wiphy, enum nl80211_tx_power_setting type, int dbm) -#else -ar6k_cfg80211_set_txpower(struct wiphy *wiphy, enum tx_power_setting type, int dbm) -#endif -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)wiphy_priv(wiphy); - AR_SOFTC_T *ar = arPriv->arSoftc; - A_UINT8 ar_dbm; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: type 0x%x, dbm %d\n", __func__, type, dbm)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - arPriv->arTxPwrSet = FALSE; - switch(type) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) - case NL80211_TX_POWER_AUTOMATIC: -#else - case TX_POWER_AUTOMATIC: -#endif - return 0; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) - case NL80211_TX_POWER_LIMITED: -#else - case TX_POWER_LIMITED: -#endif - arPriv->arTxPwr = ar_dbm = dbm; - arPriv->arTxPwrSet = TRUE; - break; - default: - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: type 0x%x not supported\n", __func__, type)); - return -EOPNOTSUPP; - } - - wmi_set_txPwr_cmd(arPriv->arWmi, ar_dbm); - - return 0; -} - -static int -ar6k_cfg80211_get_txpower(struct wiphy *wiphy, int *dbm) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)wiphy_priv(wiphy); - AR_SOFTC_T *ar = arPriv->arSoftc; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: \n", __func__)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - if((arPriv->arConnected == TRUE)) { - arPriv->arTxPwr = 0; - - if(wmi_get_txPwr_cmd(arPriv->arWmi) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: wmi_get_txPwr_cmd failed\n", __func__)); - return -EIO; - } - - wait_event_interruptible_timeout(arPriv->arEvent, arPriv->arTxPwr != 0, 5 * HZ); - - if(signal_pending(current)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Target did not respond\n", __func__)); - return -EINTR; - } - } - - *dbm = arPriv->arTxPwr; - return 0; -} - -static int -ar6k_cfg80211_set_power_mgmt(struct wiphy *wiphy, - struct net_device *dev, - bool pmgmt, int timeout) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - WMI_POWER_MODE_CMD pwrMode; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: pmgmt %d, timeout %d\n", __func__, pmgmt, timeout)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - if(!pmgmt) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: Max Perf\n", __func__)); - pwrMode.powerMode = MAX_PERF_POWER; - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: Rec Power\n", __func__)); - pwrMode.powerMode = REC_POWER; - } - - if(wmi_powermode_cmd(arPriv->arWmi, pwrMode.powerMode) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: wmi_powermode_cmd failed\n", __func__)); - return -EIO; - } - - return 0; -} - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) -struct net_device * -ar6k_cfg80211_add_virtual_intf(struct wiphy *wiphy, char *name, - enum nl80211_iftype type, u32 *flags, - struct vif_params *params) -#else -static int -ar6k_cfg80211_add_virtual_intf(struct wiphy *wiphy, char *name, - enum nl80211_iftype type, u32 *flags, - struct vif_params *params) -#endif -{ - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: not supported\n", __func__)); - - /* Multiple virtual interface is not supported. - * The default interface supports STA and IBSS type - */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) - return NULL; -#else - return -EOPNOTSUPP; -#endif -} - -static int -ar6k_cfg80211_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev) -{ - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: not supported\n", __func__)); - - /* Multiple virtual interface is not supported. - * The default interface supports STA and IBSS type - */ - return -EOPNOTSUPP; -} - -static int -ar6k_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, - enum nl80211_iftype type, u32 *flags, - struct vif_params *params) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(ndev); - AR_SOFTC_T *ar = arPriv->arSoftc; - struct wireless_dev *wdev = arPriv->wdev; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: type %u\n", __func__, type)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - switch (type) { - case NL80211_IFTYPE_STATION: - arPriv->arNextMode = INFRA_NETWORK; - break; - case NL80211_IFTYPE_ADHOC: - arPriv->arNextMode = ADHOC_NETWORK; - break; - default: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: type %u\n", __func__, type)); - return -EOPNOTSUPP; - } - - wdev->iftype = type; - - return 0; -} - -static int -ar6k_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev, - struct cfg80211_ibss_params *ibss_param) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_STA_T *arSta; - A_STATUS status; - - arSta = &arPriv->arSta; - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: \n", __func__)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - if(!ibss_param->ssid_len || IEEE80211_MAX_SSID_LEN < ibss_param->ssid_len) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: ssid invalid\n", __func__)); - return -EINVAL; - } - - arPriv->arSsidLen = ibss_param->ssid_len; - A_MEMCPY(arPriv->arSsid, ibss_param->ssid, arPriv->arSsidLen); - - if(ibss_param->channel) { - arPriv->arChannelHint = ibss_param->channel->center_freq; - } - - if(ibss_param->channel_fixed) { - /* TODO: channel_fixed: The channel should be fixed, do not search for - * IBSSs to join on other channels. Target firmware does not support this - * feature, needs to be updated.*/ - } - - A_MEMZERO(arSta->arReqBssid, sizeof(arSta->arReqBssid)); - if(ibss_param->bssid) { - if(A_MEMCMP(&ibss_param->bssid, bcast_mac, AR6000_ETH_ADDR_LEN)) { - A_MEMCPY(arSta->arReqBssid, ibss_param->bssid, sizeof(arSta->arReqBssid)); - } - } - - ar6k_set_wpa_version(arPriv, 0); - ar6k_set_auth_type(arPriv, NL80211_AUTHTYPE_OPEN_SYSTEM); - - if(ibss_param->privacy) { - ar6k_set_cipher(arPriv, WLAN_CIPHER_SUITE_WEP40, true); - ar6k_set_cipher(arPriv, WLAN_CIPHER_SUITE_WEP40, false); - } else { - ar6k_set_cipher(arPriv, IW_AUTH_CIPHER_NONE, true); - ar6k_set_cipher(arPriv, IW_AUTH_CIPHER_NONE, false); - } - - arPriv->arNetworkType = arPriv->arNextMode; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: Connect called with authmode %d dot11 auth %d"\ - " PW crypto %d PW crypto Len %d GRP crypto %d"\ - " GRP crypto Len %d channel hint %u\n", - __func__, arPriv->arAuthMode, arPriv->arDot11AuthMode, - arPriv->arPairwiseCrypto, arPriv->arPairwiseCryptoLen, - arPriv->arGroupCrypto, arPriv->arGroupCryptoLen, arPriv->arChannelHint)); - - status = wmi_connect_cmd(arPriv->arWmi, arPriv->arNetworkType, - arPriv->arDot11AuthMode, arPriv->arAuthMode, - arPriv->arPairwiseCrypto, arPriv->arPairwiseCryptoLen, - arPriv->arGroupCrypto,arPriv->arGroupCryptoLen, - arPriv->arSsidLen, arPriv->arSsid, - arSta->arReqBssid, arPriv->arChannelHint, - arSta->arConnectCtrlFlags); - arSta->arConnectPending = TRUE; - - return 0; -} - -static int -ar6k_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev) -{ - - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: \n", __func__)); - - if(ar->arWmiReady == FALSE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__)); - return -EIO; - } - - if(ar->arWlanState == WLAN_DISABLED) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__)); - return -EIO; - } - - ar6000_disconnect(arPriv); - A_MEMZERO(arPriv->arSsid, sizeof(arPriv->arSsid)); - arPriv->arSsidLen = 0; - - return 0; -} - - -static const -A_UINT32 cipher_suites[] = { - WLAN_CIPHER_SUITE_WEP40, - WLAN_CIPHER_SUITE_WEP104, - WLAN_CIPHER_SUITE_TKIP, - WLAN_CIPHER_SUITE_CCMP, -}; - -static struct -cfg80211_ops ar6k_cfg80211_ops = { - .change_virtual_intf = ar6k_cfg80211_change_iface, - .add_virtual_intf = ar6k_cfg80211_add_virtual_intf, - .del_virtual_intf = ar6k_cfg80211_del_virtual_intf, - .scan = ar6k_cfg80211_scan, - .connect = ar6k_cfg80211_connect, - .disconnect = ar6k_cfg80211_disconnect, - .add_key = ar6k_cfg80211_add_key, - .get_key = ar6k_cfg80211_get_key, - .del_key = ar6k_cfg80211_del_key, - .set_default_key = ar6k_cfg80211_set_default_key, - .set_default_mgmt_key = ar6k_cfg80211_set_default_mgmt_key, - .set_wiphy_params = ar6k_cfg80211_set_wiphy_params, - .set_bitrate_mask = ar6k_cfg80211_set_bitrate_mask, - .set_tx_power = ar6k_cfg80211_set_txpower, - .get_tx_power = ar6k_cfg80211_get_txpower, - .set_power_mgmt = ar6k_cfg80211_set_power_mgmt, - .join_ibss = ar6k_cfg80211_join_ibss, - .leave_ibss = ar6k_cfg80211_leave_ibss, -}; - -struct wireless_dev * -ar6k_cfg80211_init(struct device *dev) -{ - int ret = 0; - struct wireless_dev *wdev; - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: \n", __func__)); - - wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); - if(!wdev) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("%s: Couldn't allocate wireless device\n", __func__)); - return ERR_PTR(-ENOMEM); - } - - /* create a new wiphy for use with cfg80211 */ - wdev->wiphy = wiphy_new(&ar6k_cfg80211_ops, sizeof(AR_SOFTC_T)); - if(!wdev->wiphy) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("%s: Couldn't allocate wiphy device\n", __func__)); - kfree(wdev); - return ERR_PTR(-ENOMEM); - } - - /* set device pointer for wiphy */ - set_wiphy_dev(wdev->wiphy, dev); - - wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | - BIT(NL80211_IFTYPE_ADHOC); - /* max num of ssids that can be probed during scanning */ - wdev->wiphy->max_scan_ssids = MAX_PROBED_SSID_INDEX; - wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &ar6k_band_2ghz; - wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &ar6k_band_5ghz; - wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; - - wdev->wiphy->cipher_suites = cipher_suites; - wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); - - ret = wiphy_register(wdev->wiphy); - if(ret < 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("%s: Couldn't register wiphy device\n", __func__)); - wiphy_free(wdev->wiphy); - return ERR_PTR(ret); - } - - return wdev; -} - -void -ar6k_cfg80211_deinit(AR_SOFTC_DEV_T *arPriv) -{ - struct wireless_dev *wdev = arPriv->wdev; - - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: \n", __func__)); - - if(arPriv->scan_request) { - cfg80211_scan_done(arPriv->scan_request, true); - arPriv->scan_request = NULL; - } - - if(!wdev) - return; - - wiphy_unregister(wdev->wiphy); - wiphy_free(wdev->wiphy); - kfree(wdev); -} - - - - - - - diff --git a/drivers/net/wireless/ar6003/host/os/linux/eeprom.c b/drivers/net/wireless/ar6003/host/os/linux/eeprom.c deleted file mode 100644 index 5f6a14766aa2..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/eeprom.c +++ /dev/null @@ -1,569 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - - -#include "ar6000_drv.h" -#include "htc.h" -#include - -#include "target_reg_table.h" -#include "host_reg_table.h -// -// defines -// - -#define MAX_FILENAME 1023 -#define EEPROM_WAIT_LIMIT 16 - -#define EEPROM_SZ 768 - -/* soft mac */ -#define ATH_MAC_LEN 6 -#define ATH_SOFT_MAC_TMP_BUF_LEN 64 -unsigned char mac_addr[ATH_MAC_LEN]; -unsigned char soft_mac_tmp_buf[ATH_SOFT_MAC_TMP_BUF_LEN]; -char *p_mac = NULL; -/* soft mac */ - -// -// static variables -// - -static A_UCHAR eeprom_data[EEPROM_SZ]; -static A_UINT32 sys_sleep_reg; -static HIF_DEVICE *p_bmi_device; - -// -// Functions -// - -/* soft mac */ -static int -wmic_ether_aton(const char *orig, A_UINT8 *eth) -{ - const char *bufp; - int i; - - i = 0; - for(bufp = orig; *bufp != '\0'; ++bufp) { - unsigned int val; - unsigned char c = *bufp++; - if (c >= '0' && c <= '9') val = c - '0'; - else if (c >= 'a' && c <= 'f') val = c - 'a' + 10; - else if (c >= 'A' && c <= 'F') val = c - 'A' + 10; - else { - printk("%s: MAC value is invalid\n", __FUNCTION__); - break; - } - - val <<= 4; - c = *bufp++; - if (c >= '0' && c <= '9') val |= c - '0'; - else if (c >= 'a' && c <= 'f') val |= c - 'a' + 10; - else if (c >= 'A' && c <= 'F') val |= c - 'A' + 10; - else { - printk("%s: MAC value is invalid\n", __FUNCTION__); - break; - } - - eth[i] = (unsigned char) (val & 0377); - if(++i == ATH_MAC_LEN) { - /* That's it. Any trailing junk? */ - if (*bufp != '\0') { - return 0; - } - return 1; - } - if (*bufp != ':') - break; - } - return 0; -} - -static void -update_mac(unsigned char* eeprom, int size, unsigned char* macaddr) -{ - int i; - A_UINT16* ptr = (A_UINT16*)(eeprom+4); - A_UINT16 checksum = 0; - - memcpy(eeprom+10,macaddr,6); - - *ptr = 0; - ptr = (A_UINT16*)eeprom; - - for (i=0; i>7)); - - BMI_write_reg(SI_BASE_ADDRESS+SI_TX_DATA0_OFFSET, regval); - - regval = SI_CS_START_SET(1) | - SI_CS_RX_CNT_SET(8) | - SI_CS_TX_CNT_SET(3); - BMI_write_reg(SI_BASE_ADDRESS+SI_CS_OFFSET, regval); -} - -/* - * Tell the Target to start a 4-byte write to EEPROM, - * writing values from Target TX_DATA registers. - */ -static void -request_4byte_write(int offset, A_UINT32 data) -{ - A_UINT32 regval; - - printk("%s: request_4byte_write (0x%x) to offset 0x%x\n", __FUNCTION__, data, offset); - - /* SI_TX_DATA0 = write data to offset */ - regval = ((data & 0xffff) <<16) | - ((offset & 0xff)<<8) | - (0xa0 | ((offset & 0xff00)>>7)); - BMI_write_reg(SI_BASE_ADDRESS+SI_TX_DATA0_OFFSET, regval); - - regval = data >> 16; - BMI_write_reg(SI_BASE_ADDRESS+SI_TX_DATA1_OFFSET, regval); - - regval = SI_CS_START_SET(1) | - SI_CS_RX_CNT_SET(0) | - SI_CS_TX_CNT_SET(6); - BMI_write_reg(SI_BASE_ADDRESS+SI_CS_OFFSET, regval); -} - -/* - * Check whether or not an EEPROM request that was started - * earlier has completed yet. - */ -static A_BOOL -request_in_progress(void) -{ - A_UINT32 regval; - - /* Wait for DONE_INT in SI_CS */ - BMI_read_reg(SI_BASE_ADDRESS+SI_CS_OFFSET, ®val); - -// printk("%s: request in progress SI_CS=0x%x\n", __FUNCTION__, regval); - if (regval & SI_CS_DONE_ERR_MASK) { - printk("%s: EEPROM signaled ERROR (0x%x)\n", __FUNCTION__, regval); - } - - return (!(regval & SI_CS_DONE_INT_MASK)); -} - -/* - * try to detect the type of EEPROM,16bit address or 8bit address - */ - -static void eeprom_type_detect(void) -{ - A_UINT32 regval; - A_UINT8 i = 0; - - request_8byte_read(0x100); - /* Wait for DONE_INT in SI_CS */ - do{ - BMI_read_reg(SI_BASE_ADDRESS+SI_CS_OFFSET, ®val); - if (regval & SI_CS_DONE_ERR_MASK) { - printk("%s: ERROR : address type was wrongly set\n", __FUNCTION__); - break; - } - if (i++ == EEPROM_WAIT_LIMIT) { - printk("%s: EEPROM not responding\n", __FUNCTION__); - } - } while(!(regval & SI_CS_DONE_INT_MASK)); -} - -/* - * Extract the results of a completed EEPROM Read request - * and return them to the caller. - */ -inline void -read_8byte_results(A_UINT32 *data) -{ - /* Read SI_RX_DATA0 and SI_RX_DATA1 */ - BMI_read_reg(SI_BASE_ADDRESS+SI_RX_DATA0_OFFSET, &data[0]); - BMI_read_reg(SI_BASE_ADDRESS+SI_RX_DATA1_OFFSET, &data[1]); -} - - -/* - * Wait for a previously started command to complete. - * Timeout if the command is takes "too long". - */ -static void -wait_for_eeprom_completion(void) -{ - int i=0; - - while (request_in_progress()) { - if (i++ == EEPROM_WAIT_LIMIT) { - printk("%s: EEPROM not responding\n", __FUNCTION__); - } - } -} - -/* - * High-level function which starts an 8-byte read, - * waits for it to complete, and returns the result. - */ -static void -fetch_8bytes(int offset, A_UINT32 *data) -{ - request_8byte_read(offset); - wait_for_eeprom_completion(); - read_8byte_results(data); - - /* Clear any pending intr */ - BMI_write_reg(SI_BASE_ADDRESS+SI_CS_OFFSET, SI_CS_DONE_INT_MASK); -} - -/* - * High-level function which starts a 4-byte write, - * and waits for it to complete. - */ -inline void -commit_4bytes(int offset, A_UINT32 data) -{ - request_4byte_write(offset, data); - wait_for_eeprom_completion(); -} -/* ATHENV */ -#ifdef ANDROID_ENV -void eeprom_ar6000_transfer(HIF_DEVICE *device, char *fake_file, char *p_mac) -{ - A_UINT32 first_word; - A_UINT32 board_data_addr; - int i; - - printk("%s: Enter\n", __FUNCTION__); - - enable_SI(device); - eeprom_type_detect(); - - if (fake_file) { - /* - * Transfer from file to Target RAM. - * Fetch source data from file. - */ - mm_segment_t oldfs; - struct file *filp; - struct inode *inode = NULL; - int length; - - /* open file */ - oldfs = get_fs(); - set_fs(KERNEL_DS); - filp = filp_open(fake_file, O_RDONLY, S_IRUSR); - - if (IS_ERR(filp)) { - printk("%s: file %s filp_open error\n", __FUNCTION__, fake_file); - set_fs(oldfs); - return; - } - - if (!filp->f_op) { - printk("%s: File Operation Method Error\n", __FUNCTION__); - filp_close(filp, NULL); - set_fs(oldfs); - return; - } - - inode = GET_INODE_FROM_FILEP(filep); - if (!inode) { - printk("%s: Get inode from filp failed\n", __FUNCTION__); - filp_close(filp, NULL); - set_fs(oldfs); - return; - } - - printk("%s file offset opsition: %xh\n", __FUNCTION__, (unsigned)filp->f_pos); - - /* file's size */ - length = i_size_read(inode->i_mapping->host); - printk("%s: length=%d\n", __FUNCTION__, length); - if (length != EEPROM_SZ) { - printk("%s: The file's size is not as expected\n", __FUNCTION__); - filp_close(filp, NULL); - set_fs(oldfs); - return; - } - - /* read data */ - if (filp->f_op->read(filp, eeprom_data, length, &filp->f_pos) != length) { - printk("%s: file read error\n", __FUNCTION__); - filp_close(filp, NULL); - set_fs(oldfs); - return; - } - - /* read data out successfully */ - filp_close(filp, NULL); - set_fs(oldfs); - } else { - /* - * Read from EEPROM to file OR transfer from EEPROM to Target RAM. - * Fetch EEPROM_SZ Bytes of Board Data, 8 bytes at a time. - */ - - fetch_8bytes(0, (A_UINT32 *)(&eeprom_data[0])); - - /* Check the first word of EEPROM for validity */ - first_word = *((A_UINT32 *)eeprom_data); - - if ((first_word == 0) || (first_word == 0xffffffff)) { - printk("Did not find EEPROM with valid Board Data.\n"); - } - - for (i=8; if_op) { - printk("%s: File Operation Method Error\n", __FUNCTION__); - filp_close(filp, NULL); - set_fs(oldfs); - return; - } - - inode = GET_INODE_FROM_FILEP(filep); - if (!inode) { - printk("%s: Get inode from filp failed\n", __FUNCTION__); - filp_close(filp, NULL); - set_fs(oldfs); - return; - } - - printk("%s file offset opsition: %xh\n", __FUNCTION__, (unsigned)filp->f_pos); - - /* file's size */ - length = i_size_read(inode->i_mapping->host); - printk("%s: length=%d\n", __FUNCTION__, length); - if (length > ATH_SOFT_MAC_TMP_BUF_LEN) { - printk("%s: MAC file's size is not as expected\n", __FUNCTION__); - filp_close(filp, NULL); - set_fs(oldfs); - return; - } - - /* read data */ - if (filp->f_op->read(filp, soft_mac_tmp_buf, length, &filp->f_pos) != length) { - printk("%s: file read error\n", __FUNCTION__); - filp_close(filp, NULL); - set_fs(oldfs); - return; - } - -#if 0 - /* the data we just read */ - printk("%s: mac address from the file:\n", __FUNCTION__); - for (i = 0; i < length; i++) - printk("[%c(0x%x)],", soft_mac_tmp_buf[i], soft_mac_tmp_buf[i]); - printk("\n"); -#endif - - /* read data out successfully */ - filp_close(filp, NULL); - set_fs(oldfs); - - /* convert mac address */ - if (!wmic_ether_aton(soft_mac_tmp_buf, mac_addr)) { - printk("%s: convert mac value fail\n", __FUNCTION__); - return; - } - -#if 0 - /* the converted mac address */ - printk("%s: the converted mac value\n", __FUNCTION__); - for (i = 0; i < ATH_MAC_LEN; i++) - printk("[0x%x],", mac_addr[i]); - printk("\n"); -#endif - } - /* soft mac */ - - /* Determine where in Target RAM to write Board Data */ - BMI_read_mem( AR6002_HOST_INTEREST_ITEM_ADDRESS(hi_board_data), &board_data_addr); - if (board_data_addr == 0) { - printk("hi_board_data is zero\n"); - } - - /* soft mac */ -#if 1 - /* Update MAC address in RAM */ - if (p_mac) { - update_mac(eeprom_data, EEPROM_SZ, mac_addr); - } -#endif -#if 0 - /* mac address in eeprom array */ - printk("%s: mac values in eeprom array\n", __FUNCTION__); - for (i = 10; i < 10 + 6; i++) - printk("[0x%x],", eeprom_data[i]); - printk("\n"); -#endif - /* soft mac */ - - /* Write EEPROM data to Target RAM */ - BMI_write_mem(board_data_addr, ((A_UINT8 *)eeprom_data), EEPROM_SZ); - - /* Record the fact that Board Data IS initialized */ - { - A_UINT32 one = 1; - BMI_write_mem(AR6002_HOST_INTEREST_ITEM_ADDRESS(hi_board_data_initialized), - (A_UINT8 *)&one, sizeof(A_UINT32)); - } - - disable_SI(); -} diff --git a/drivers/net/wireless/ar6003/host/os/linux/export_hci_transport.c b/drivers/net/wireless/ar6003/host/os/linux/export_hci_transport.c deleted file mode 100644 index c44311b79665..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/export_hci_transport.c +++ /dev/null @@ -1,122 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2009-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// HCI bridge implementation -// -// Author(s): ="Atheros" -//============================================================================== -#include -#include -#include "a_types.h" -#include "a_osapi.h" -#include "htc_api.h" -#include "a_drv.h" -#include "hif.h" -#include "common_drv.h" -#include "a_debug.h" -#include "hci_transport_api.h" - - -HCI_TRANSPORT_HANDLE (*_HCI_TransportAttach)(void *HTCHandle, HCI_TRANSPORT_CONFIG_INFO *pInfo); -void (*_HCI_TransportDetach)(HCI_TRANSPORT_HANDLE HciTrans); -A_STATUS (*_HCI_TransportAddReceivePkts)(HCI_TRANSPORT_HANDLE HciTrans, HTC_PACKET_QUEUE *pQueue); -A_STATUS (*_HCI_TransportSendPkt)(HCI_TRANSPORT_HANDLE HciTrans, HTC_PACKET *pPacket, A_BOOL Synchronous); -void (*_HCI_TransportStop)(HCI_TRANSPORT_HANDLE HciTrans); -A_STATUS (*_HCI_TransportStart)(HCI_TRANSPORT_HANDLE HciTrans); -A_STATUS (*_HCI_TransportEnableDisableAsyncRecv)(HCI_TRANSPORT_HANDLE HciTrans, A_BOOL Enable); -A_STATUS (*_HCI_TransportRecvHCIEventSync)(HCI_TRANSPORT_HANDLE HciTrans, - HTC_PACKET *pPacket, - int MaxPollMS); -A_STATUS (*_HCI_TransportSetBaudRate)(HCI_TRANSPORT_HANDLE HciTrans, A_UINT32 Baud); -A_STATUS (*_HCI_TransportEnablePowerMgmt)(HCI_TRANSPORT_HANDLE HciTrans, A_BOOL Enable); - -extern HCI_TRANSPORT_CALLBACKS ar6kHciTransCallbacks; - -A_STATUS ar6000_register_hci_transport(HCI_TRANSPORT_CALLBACKS *hciTransCallbacks) -{ - ar6kHciTransCallbacks = *hciTransCallbacks; - - _HCI_TransportAttach = HCI_TransportAttach; - _HCI_TransportDetach = HCI_TransportDetach; - _HCI_TransportAddReceivePkts = HCI_TransportAddReceivePkts; - _HCI_TransportSendPkt = HCI_TransportSendPkt; - _HCI_TransportStop = HCI_TransportStop; - _HCI_TransportStart = HCI_TransportStart; - _HCI_TransportEnableDisableAsyncRecv = HCI_TransportEnableDisableAsyncRecv; - _HCI_TransportRecvHCIEventSync = HCI_TransportRecvHCIEventSync; - _HCI_TransportSetBaudRate = HCI_TransportSetBaudRate; - _HCI_TransportEnablePowerMgmt = HCI_TransportEnablePowerMgmt; - - return A_OK; -} - -A_STATUS -ar6000_get_hif_dev(HIF_DEVICE *device, void *config) -{ - A_STATUS status; - - status = HIFConfigureDevice(device, - HIF_DEVICE_GET_OS_DEVICE, - (HIF_DEVICE_OS_DEVICE_INFO *)config, - sizeof(HIF_DEVICE_OS_DEVICE_INFO)); - return status; -} - -A_STATUS ar6000_set_uart_config(HIF_DEVICE *hifDevice, - A_UINT32 scale, - A_UINT32 step) -{ - A_UINT32 regAddress; - A_UINT32 regVal; - A_STATUS status; - - regAddress = WLAN_UART_BASE_ADDRESS | UART_CLKDIV_ADDRESS; - regVal = ((A_UINT32)scale << 16) | step; - /* change the HCI UART scale/step values through the diagnostic window */ - status = ar6000_WriteRegDiag(hifDevice, ®Address, ®Val); - - return status; -} - -A_STATUS ar6000_get_core_clock_config(HIF_DEVICE *hifDevice, A_UINT32 *data) -{ - A_UINT32 regAddress; - A_STATUS status; - - regAddress = WLAN_RTC_BASE_ADDRESS | WLAN_CPU_CLOCK_ADDRESS; - /* read CPU clock settings*/ - status = ar6000_ReadRegDiag(hifDevice, ®Address, data); - - return status; -} - -EXPORT_SYMBOL(ar6000_register_hci_transport); -EXPORT_SYMBOL(ar6000_get_hif_dev); -EXPORT_SYMBOL(ar6000_set_uart_config); -EXPORT_SYMBOL(ar6000_get_core_clock_config); -EXPORT_SYMBOL(_HCI_TransportAttach); -EXPORT_SYMBOL(_HCI_TransportDetach); -EXPORT_SYMBOL(_HCI_TransportAddReceivePkts); -EXPORT_SYMBOL(_HCI_TransportSendPkt); -EXPORT_SYMBOL(_HCI_TransportStop); -EXPORT_SYMBOL(_HCI_TransportStart); -EXPORT_SYMBOL(_HCI_TransportEnableDisableAsyncRecv); -EXPORT_SYMBOL(_HCI_TransportRecvHCIEventSync); -EXPORT_SYMBOL(_HCI_TransportSetBaudRate); -EXPORT_SYMBOL(_HCI_TransportEnablePowerMgmt); diff --git a/drivers/net/wireless/ar6003/host/os/linux/hci_bridge.c b/drivers/net/wireless/ar6003/host/os/linux/hci_bridge.c deleted file mode 100644 index 1c6642082652..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/hci_bridge.c +++ /dev/null @@ -1,1174 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2009-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// HCI bridge implementation -// -// Author(s): ="Atheros" -//============================================================================== - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -#include -#include -#include -#include "a_types.h" -#include "a_osapi.h" -#include "htc_api.h" -#include "wmi.h" -#include "a_drv.h" -#include "hif.h" -#include "common_drv.h" -#include "a_debug.h" -#define ATH_DEBUG_HCI_BRIDGE ATH_DEBUG_MAKE_MODULE_MASK(6) -#define ATH_DEBUG_HCI_RECV ATH_DEBUG_MAKE_MODULE_MASK(7) -#define ATH_DEBUG_HCI_SEND ATH_DEBUG_MAKE_MODULE_MASK(8) -#define ATH_DEBUG_HCI_DUMP ATH_DEBUG_MAKE_MODULE_MASK(9) -#else -#include "ar6000_drv.h" -#endif /* EXPORT_HCI_BRIDGE_INTERFACE */ - -#ifdef ATH_AR6K_ENABLE_GMBOX -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -#include "export_hci_transport.h" -#else -#include "hci_transport_api.h" -#endif -#include "epping_test.h" -#include "gmboxif.h" -#include "ar3kconfig.h" -#include -#include - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) - /* only build on newer kernels which have BT configured */ -#if defined(CONFIG_BT_MODULE) || defined(CONFIG_BT) -#define CONFIG_BLUEZ_HCI_BRIDGE -#endif -#endif - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -unsigned int ar3khcibaud = 0; -unsigned int hciuartscale = 0; -unsigned int hciuartstep = 0; - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) -module_param(ar3khcibaud, int, 0644); -module_param(hciuartscale, int, 0644); -module_param(hciuartstep, int, 0644); -#else - -#define __user -/* for linux 2.4 and lower */ -MODULE_PARM(ar3khcibaud, "i"); -MODULE_PARM(hciuartscale, "i"); -MODULE_PARM(hciuartstep, "i"); -#endif -#else -extern unsigned int ar3khcibaud; -extern unsigned int hciuartscale; -extern unsigned int hciuartstep; -#endif /* EXPORT_HCI_BRIDGE_INTERFACE */ - -typedef struct { - void *pHCIDev; /* HCI bridge device */ - HCI_TRANSPORT_PROPERTIES HCIProps; /* HCI bridge props */ - struct hci_dev *pBtStackHCIDev; /* BT Stack HCI dev */ - A_BOOL HciNormalMode; /* Actual HCI mode enabled (non-TEST)*/ - A_BOOL HciRegistered; /* HCI device registered with stack */ - HTC_PACKET_QUEUE HTCPacketStructHead; - A_UINT8 *pHTCStructAlloc; - spinlock_t BridgeLock; -#ifdef EXPORT_HCI_BRIDGE_INTERFACE - HCI_TRANSPORT_MISC_HANDLES HCITransHdl; -#else - AR_SOFTC_T *ar; -#endif /* EXPORT_HCI_BRIDGE_INTERFACE */ -} AR6K_HCI_BRIDGE_INFO; - -#define MAX_ACL_RECV_BUFS 16 -#define MAX_EVT_RECV_BUFS 8 -#define MAX_HCI_WRITE_QUEUE_DEPTH 32 -#define MAX_ACL_RECV_LENGTH 1200 -#define MAX_EVT_RECV_LENGTH 257 -#define TX_PACKET_RSV_OFFSET 32 -#define NUM_HTC_PACKET_STRUCTS ((MAX_ACL_RECV_BUFS + MAX_EVT_RECV_BUFS + MAX_HCI_WRITE_QUEUE_DEPTH) * 2) - -#define HCI_GET_OP_CODE(p) (((A_UINT16)((p)[1])) << 8) | ((A_UINT16)((p)[0])) - -extern unsigned int setupbtdev; -AR3K_CONFIG_INFO ar3kconfig; - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -AR6K_HCI_BRIDGE_INFO *g_pHcidevInfo; -#endif - -static A_STATUS bt_setup_hci(AR6K_HCI_BRIDGE_INFO *pHcidevInfo); -static void bt_cleanup_hci(AR6K_HCI_BRIDGE_INFO *pHcidevInfo); -static A_STATUS bt_register_hci(AR6K_HCI_BRIDGE_INFO *pHcidevInfo); -static A_BOOL bt_indicate_recv(AR6K_HCI_BRIDGE_INFO *pHcidevInfo, - HCI_TRANSPORT_PACKET_TYPE Type, - struct sk_buff *skb); -static struct sk_buff *bt_alloc_buffer(AR6K_HCI_BRIDGE_INFO *pHcidevInfo, int Length); -static void bt_free_buffer(AR6K_HCI_BRIDGE_INFO *pHcidevInfo, struct sk_buff *skb); - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -A_STATUS ar6000_setup_hci(void *ar); -void ar6000_cleanup_hci(void *ar); -A_STATUS hci_test_send(void *ar, struct sk_buff *skb); -#else -A_STATUS ar6000_setup_hci(AR_SOFTC_T *ar); -void ar6000_cleanup_hci(AR_SOFTC_T *ar); -/* HCI bridge testing */ -A_STATUS hci_test_send(AR_SOFTC_T *ar, struct sk_buff *skb); -#endif /* EXPORT_HCI_BRIDGE_INTERFACE */ - -#define LOCK_BRIDGE(dev) spin_lock_bh(&(dev)->BridgeLock) -#define UNLOCK_BRIDGE(dev) spin_unlock_bh(&(dev)->BridgeLock) - -static inline void FreeBtOsBuf(AR6K_HCI_BRIDGE_INFO *pHcidevInfo, void *osbuf) -{ - if (pHcidevInfo->HciNormalMode) { - bt_free_buffer(pHcidevInfo, (struct sk_buff *)osbuf); - } else { - /* in test mode, these are just ordinary netbuf allocations */ - A_NETBUF_FREE(osbuf); - } -} - -static void FreeHTCStruct(AR6K_HCI_BRIDGE_INFO *pHcidevInfo, HTC_PACKET *pPacket) -{ - LOCK_BRIDGE(pHcidevInfo); - HTC_PACKET_ENQUEUE(&pHcidevInfo->HTCPacketStructHead,pPacket); - UNLOCK_BRIDGE(pHcidevInfo); -} - -static HTC_PACKET * AllocHTCStruct(AR6K_HCI_BRIDGE_INFO *pHcidevInfo) -{ - HTC_PACKET *pPacket = NULL; - LOCK_BRIDGE(pHcidevInfo); - pPacket = HTC_PACKET_DEQUEUE(&pHcidevInfo->HTCPacketStructHead); - UNLOCK_BRIDGE(pHcidevInfo); - return pPacket; -} - -#define BLOCK_ROUND_UP_PWR2(x, align) (((int) (x) + ((align)-1)) & ~((align)-1)) - -static void RefillRecvBuffers(AR6K_HCI_BRIDGE_INFO *pHcidevInfo, - HCI_TRANSPORT_PACKET_TYPE Type, - int NumBuffers) -{ - int length, i; - void *osBuf = NULL; - HTC_PACKET_QUEUE queue; - HTC_PACKET *pPacket; - - INIT_HTC_PACKET_QUEUE(&queue); - - if (Type == HCI_ACL_TYPE) { - if (pHcidevInfo->HciNormalMode) { - length = HCI_MAX_FRAME_SIZE; - } else { - length = MAX_ACL_RECV_LENGTH; - } - } else { - length = MAX_EVT_RECV_LENGTH; - } - - /* add on transport head and tail room */ - length += pHcidevInfo->HCIProps.HeadRoom + pHcidevInfo->HCIProps.TailRoom; - /* round up to the required I/O padding */ - length = BLOCK_ROUND_UP_PWR2(length,pHcidevInfo->HCIProps.IOBlockPad); - - for (i = 0; i < NumBuffers; i++) { - - if (pHcidevInfo->HciNormalMode) { - osBuf = bt_alloc_buffer(pHcidevInfo,length); - } else { - osBuf = A_NETBUF_ALLOC(length); - } - - if (NULL == osBuf) { - break; - } - - pPacket = AllocHTCStruct(pHcidevInfo); - if (NULL == pPacket) { - FreeBtOsBuf(pHcidevInfo,osBuf); - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Failed to alloc HTC struct \n")); - break; - } - - SET_HTC_PACKET_INFO_RX_REFILL(pPacket,osBuf,A_NETBUF_DATA(osBuf),length,Type); - /* add to queue */ - HTC_PACKET_ENQUEUE(&queue,pPacket); - } - - if (i > 0) { - HCI_TransportAddReceivePkts(pHcidevInfo->pHCIDev, &queue); - } -} - -static A_STATUS ar6000_hci_transport_ready(HCI_TRANSPORT_HANDLE HCIHandle, - HCI_TRANSPORT_PROPERTIES *pProps, - void *pContext) -{ - AR6K_HCI_BRIDGE_INFO *pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)pContext; - A_STATUS status; - AR_SOFTC_DEV_T *arDev = pHcidevInfo->ar->arDev[0]; - - - pHcidevInfo->pHCIDev = HCIHandle; - - A_MEMCPY(&pHcidevInfo->HCIProps,pProps,sizeof(*pProps)); - - AR_DEBUG_PRINTF(ATH_DEBUG_HCI_BRIDGE,("HCI ready (hci:0x%lX, headroom:%d, tailroom:%d blockpad:%d) \n", - (unsigned long)HCIHandle, - pHcidevInfo->HCIProps.HeadRoom, - pHcidevInfo->HCIProps.TailRoom, - pHcidevInfo->HCIProps.IOBlockPad)); - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE - A_ASSERT((pProps->HeadRoom + pProps->TailRoom) <= (struct net_device *)(pHcidevInfo->HCITransHdl.netDevice)->hard_header_len); -#else - A_ASSERT((pProps->HeadRoom + pProps->TailRoom) <= arDev->arNetDev->hard_header_len); -#endif - - /* provide buffers */ - RefillRecvBuffers(pHcidevInfo, HCI_ACL_TYPE, MAX_ACL_RECV_BUFS); - RefillRecvBuffers(pHcidevInfo, HCI_EVENT_TYPE, MAX_EVT_RECV_BUFS); - - do { - /* start transport */ - status = HCI_TransportStart(pHcidevInfo->pHCIDev); - - if (A_FAILED(status)) { - break; - } - - if (!pHcidevInfo->HciNormalMode) { - /* in test mode, no need to go any further */ - break; - } - - // The delay is required when AR6K is driving the BT reset line - // where time is needed after the BT chip is out of reset (HCI_TransportStart) - // and before the first HCI command is issued (AR3KConfigure) - // FIXME - // The delay should be configurable and be only applied when AR6K driving the BT - // reset line. This could be done by some module parameter or based on some HW config - // info. For now apply 100ms delay blindly - A_MDELAY(100); - - A_MEMZERO(&ar3kconfig,sizeof(ar3kconfig)); - ar3kconfig.pHCIDev = pHcidevInfo->pHCIDev; - ar3kconfig.pHCIProps = &pHcidevInfo->HCIProps; -#ifdef EXPORT_HCI_BRIDGE_INTERFACE - ar3kconfig.pHIFDevice = (HIF_DEVICE *)(pHcidevInfo->HCITransHdl.hifDevice); -#else - ar3kconfig.pHIFDevice = pHcidevInfo->ar->arHifDevice; -#endif - ar3kconfig.pBtStackHCIDev = pHcidevInfo->pBtStackHCIDev; - - if (ar3khcibaud != 0) { - /* user wants ar3k baud rate change */ - ar3kconfig.Flags |= AR3K_CONFIG_FLAG_SET_AR3K_BAUD; - ar3kconfig.Flags |= AR3K_CONFIG_FLAG_AR3K_BAUD_CHANGE_DELAY; - ar3kconfig.AR3KBaudRate = ar3khcibaud; - } - - if ((hciuartscale != 0) || (hciuartstep != 0)) { - /* user wants to tune HCI bridge UART scale/step values */ - ar3kconfig.AR6KScale = (A_UINT16)hciuartscale; - ar3kconfig.AR6KStep = (A_UINT16)hciuartstep; - ar3kconfig.Flags |= AR3K_CONFIG_FLAG_SET_AR6K_SCALE_STEP; - } - - /* configure the AR3K device */ - memcpy(ar3kconfig.bdaddr,pHcidevInfo->ar->bdaddr,6); - status = AR3KConfigure(&ar3kconfig); - if (A_FAILED(status)) { - extern unsigned int setuphci; - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("HCI Bridge: Fail to configure AR3K. No device? Cleanup HCI\n")); - pHcidevInfo->ar->exitCallback = NULL; - ar6000_cleanup_hci(pHcidevInfo->ar); - setuphci = 0; - pHcidevInfo->ar->arBTSharing = 0; - break; - } - - /* Make sure both AR6K and AR3K have power management enabled */ - if (ar3kconfig.PwrMgmtEnabled) { - A_UINT32 address, hci_uart_pwr_mgmt_params; - /* Fetch the address of the hi_hci_uart_pwr_mgmt_params instance in the host interest area */ - address = TARG_VTOP(pHcidevInfo->ar->arTargetType, - HOST_INTEREST_ITEM_ADDRESS(pHcidevInfo->ar->arTargetType, hi_hci_uart_pwr_mgmt_params)); - status = ar6000_ReadRegDiag(pHcidevInfo->ar->arHifDevice, &address, &hci_uart_pwr_mgmt_params); - hci_uart_pwr_mgmt_params &= 0xFFFF; - /* wakeup timeout is [31:16] */ - hci_uart_pwr_mgmt_params |= (ar3kconfig.WakeupTimeout << 16); - status |= ar6000_WriteRegDiag(pHcidevInfo->ar->arHifDevice, &address, &hci_uart_pwr_mgmt_params); - if (A_OK != status) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("HCI Bridge: failed to write hci_uart_pwr_mgmt_params!\n")); - } - - /* Fetch the address of the hi_hci_uart_pwr_mgmt_params_ext instance in the host interest area */ - address = TARG_VTOP(pHcidevInfo->ar->arTargetType, - HOST_INTEREST_ITEM_ADDRESS(pHcidevInfo->ar->arTargetType, hi_hci_uart_pwr_mgmt_params_ext)); - status = ar6000_WriteRegDiag(pHcidevInfo->ar->arHifDevice, &address, &ar3kconfig.IdleTimeout); - if (A_OK != status) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("HCI Bridge: failed to write hci_uart_pwr_mgmt_params_ext!\n")); - } - - status = HCI_TransportEnablePowerMgmt(pHcidevInfo->pHCIDev, TRUE); - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("HCI Bridge: failed to enable TLPM for AR6K! \n")); - } - } - - status = bt_register_hci(pHcidevInfo); - - } while (FALSE); - - return status; -} - -static void ar6000_hci_transport_failure(void *pContext, A_STATUS Status) -{ - AR6K_HCI_BRIDGE_INFO *pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)pContext; - - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("HCI Bridge: transport failure! \n")); - - if (pHcidevInfo->HciNormalMode) { - /* TODO .. */ - } -} - -static void ar6000_hci_transport_removed(void *pContext) -{ - AR6K_HCI_BRIDGE_INFO *pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)pContext; - - AR_DEBUG_PRINTF(ATH_DEBUG_HCI_BRIDGE, ("HCI Bridge: transport removed. \n")); - - A_ASSERT(pHcidevInfo->pHCIDev != NULL); - - HCI_TransportDetach(pHcidevInfo->pHCIDev); - bt_cleanup_hci(pHcidevInfo); - pHcidevInfo->pHCIDev = NULL; -} - -static void ar6000_hci_send_complete(void *pContext, HTC_PACKET *pPacket) -{ - AR6K_HCI_BRIDGE_INFO *pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)pContext; - void *osbuf = pPacket->pPktContext; - A_ASSERT(osbuf != NULL); - A_ASSERT(pHcidevInfo != NULL); - - if (A_FAILED(pPacket->Status)) { - if ((pPacket->Status != A_ECANCELED) && (pPacket->Status != A_NO_RESOURCE)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("HCI Bridge: Send Packet Failed: %d \n",pPacket->Status)); - } - } - - FreeHTCStruct(pHcidevInfo,pPacket); - FreeBtOsBuf(pHcidevInfo,osbuf); - -} - -static void ar6000_hci_pkt_recv(void *pContext, HTC_PACKET *pPacket) -{ - AR6K_HCI_BRIDGE_INFO *pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)pContext; - struct sk_buff *skb; - AR_SOFTC_DEV_T *arDev = pHcidevInfo->ar->arDev[0]; - - A_ASSERT(pHcidevInfo != NULL); - skb = (struct sk_buff *)pPacket->pPktContext; - A_ASSERT(skb != NULL); - - do { - - if (A_FAILED(pPacket->Status)) { - break; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_HCI_RECV, - ("HCI Bridge, packet received type : %d len:%d \n", - HCI_GET_PACKET_TYPE(pPacket),pPacket->ActualLength)); - - /* set the actual buffer position in the os buffer, HTC recv buffers posted to HCI are set - * to fill the front of the buffer */ - A_NETBUF_PUT(skb,pPacket->ActualLength + pHcidevInfo->HCIProps.HeadRoom); - A_NETBUF_PULL(skb,pHcidevInfo->HCIProps.HeadRoom); - - if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_HCI_DUMP)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("<<< Recv HCI %s packet len:%d \n", - (HCI_GET_PACKET_TYPE(pPacket) == HCI_EVENT_TYPE) ? "EVENT" : "ACL", - skb->len)); - AR_DEBUG_PRINTBUF(skb->data, skb->len,"BT HCI RECV Packet Dump"); - } - - if (pHcidevInfo->HciNormalMode) { - /* indicate the packet */ - if (bt_indicate_recv(pHcidevInfo,HCI_GET_PACKET_TYPE(pPacket),skb)) { - /* bt stack accepted the packet */ - skb = NULL; - } - break; - } - - /* for testing, indicate packet to the network stack */ -#ifdef EXPORT_HCI_BRIDGE_INTERFACE - skb->dev = (struct net_device *)(pHcidevInfo->HCITransHdl.netDevice); - if ((((struct net_device *)pHcidevInfo->HCITransHdl.netDevice)->flags & IFF_UP) == IFF_UP) { - skb->protocol = eth_type_trans(skb, (struct net_device *)(pHcidevInfo->HCITransHdl.netDevice)); -#else - skb->dev = arDev->arNetDev; - if ((arDev->arNetDev->flags & IFF_UP) == IFF_UP) { - skb->protocol = eth_type_trans(skb, arDev->arNetDev); -#endif - A_NETIF_RX(skb); - skb = NULL; - } - - } while (FALSE); - - FreeHTCStruct(pHcidevInfo,pPacket); - - if (skb != NULL) { - /* packet was not accepted, free it */ - FreeBtOsBuf(pHcidevInfo,skb); - } - -} - -static void ar6000_hci_pkt_refill(void *pContext, HCI_TRANSPORT_PACKET_TYPE Type, int BuffersAvailable) -{ - AR6K_HCI_BRIDGE_INFO *pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)pContext; - int refillCount; - - if (Type == HCI_ACL_TYPE) { - refillCount = MAX_ACL_RECV_BUFS - BuffersAvailable; - } else { - refillCount = MAX_EVT_RECV_BUFS - BuffersAvailable; - } - - if (refillCount > 0) { - RefillRecvBuffers(pHcidevInfo,Type,refillCount); - } - -} - -static HCI_SEND_FULL_ACTION ar6000_hci_pkt_send_full(void *pContext, HTC_PACKET *pPacket) -{ - AR6K_HCI_BRIDGE_INFO *pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)pContext; - HCI_SEND_FULL_ACTION action = HCI_SEND_FULL_KEEP; - - if (!pHcidevInfo->HciNormalMode) { - /* for epping testing, check packet tag, some epping packets are - * special and cannot be dropped */ - if (HTC_GET_TAG_FROM_PKT(pPacket) == AR6K_DATA_PKT_TAG) { - action = HCI_SEND_FULL_DROP; - } - } - - return action; -} - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -A_STATUS ar6000_setup_hci(void *ar) -#else -A_STATUS ar6000_setup_hci(AR_SOFTC_T *ar) -#endif -{ - HCI_TRANSPORT_CONFIG_INFO config; - A_STATUS status = A_OK; - int i; - HTC_PACKET *pPacket; - AR6K_HCI_BRIDGE_INFO *pHcidevInfo; - - - do { - - pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)A_MALLOC(sizeof(AR6K_HCI_BRIDGE_INFO)); - - if (NULL == pHcidevInfo) { - status = A_NO_MEMORY; - break; - } - - A_MEMZERO(pHcidevInfo, sizeof(AR6K_HCI_BRIDGE_INFO)); -#ifdef EXPORT_HCI_BRIDGE_INTERFACE - g_pHcidevInfo = pHcidevInfo; - pHcidevInfo->HCITransHdl = *(HCI_TRANSPORT_MISC_HANDLES *)ar; -#else - ar->hcidev_info = pHcidevInfo; - pHcidevInfo->ar = ar; -#endif - spin_lock_init(&pHcidevInfo->BridgeLock); - INIT_HTC_PACKET_QUEUE(&pHcidevInfo->HTCPacketStructHead); - - ar->exitCallback = AR3KConfigureExit; - - status = bt_setup_hci(pHcidevInfo); - if (A_FAILED(status)) { - break; - } - - if (pHcidevInfo->HciNormalMode) { - AR_DEBUG_PRINTF(ATH_DEBUG_HCI_BRIDGE, ("HCI Bridge: running in normal mode... \n")); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_HCI_BRIDGE, ("HCI Bridge: running in test mode... \n")); - } - - pHcidevInfo->pHTCStructAlloc = (A_UINT8 *)A_MALLOC((sizeof(HTC_PACKET)) * NUM_HTC_PACKET_STRUCTS); - - if (NULL == pHcidevInfo->pHTCStructAlloc) { - status = A_NO_MEMORY; - break; - } - - pPacket = (HTC_PACKET *)pHcidevInfo->pHTCStructAlloc; - for (i = 0; i < NUM_HTC_PACKET_STRUCTS; i++,pPacket++) { - FreeHTCStruct(pHcidevInfo,pPacket); - } - - A_MEMZERO(&config,sizeof(HCI_TRANSPORT_CONFIG_INFO)); - config.ACLRecvBufferWaterMark = MAX_ACL_RECV_BUFS / 2; - config.EventRecvBufferWaterMark = MAX_EVT_RECV_BUFS / 2; - config.MaxSendQueueDepth = MAX_HCI_WRITE_QUEUE_DEPTH; - config.pContext = pHcidevInfo; - config.TransportFailure = ar6000_hci_transport_failure; - config.TransportReady = ar6000_hci_transport_ready; - config.TransportRemoved = ar6000_hci_transport_removed; - config.pHCISendComplete = ar6000_hci_send_complete; - config.pHCIPktRecv = ar6000_hci_pkt_recv; - config.pHCIPktRecvRefill = ar6000_hci_pkt_refill; - config.pHCISendFull = ar6000_hci_pkt_send_full; - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE - pHcidevInfo->pHCIDev = HCI_TransportAttach(pHcidevInfo->HCITransHdl.htcHandle, &config); -#else - pHcidevInfo->pHCIDev = HCI_TransportAttach(ar->arHtcTarget, &config); -#endif - - if (NULL == pHcidevInfo->pHCIDev) { - status = A_ERROR; - } - - } while (FALSE); - - if (A_FAILED(status)) { - if (pHcidevInfo != NULL) { - if (NULL == pHcidevInfo->pHCIDev) { - /* GMBOX may not be present in older chips */ - /* just return success */ - status = A_OK; - } - } - ar6000_cleanup_hci(ar); - } - - return status; -} - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -void ar6000_cleanup_hci(void *ar) -#else -void ar6000_cleanup_hci(AR_SOFTC_T *ar) -#endif -{ -#ifdef EXPORT_HCI_BRIDGE_INTERFACE - AR6K_HCI_BRIDGE_INFO *pHcidevInfo = g_pHcidevInfo; -#else - AR6K_HCI_BRIDGE_INFO *pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)ar->hcidev_info; -#endif - - if (pHcidevInfo != NULL) { - bt_cleanup_hci(pHcidevInfo); - - if (pHcidevInfo->pHCIDev != NULL) { - HCI_TransportStop(pHcidevInfo->pHCIDev); - HCI_TransportDetach(pHcidevInfo->pHCIDev); - pHcidevInfo->pHCIDev = NULL; - } - - if (pHcidevInfo->pHTCStructAlloc != NULL) { - A_FREE(pHcidevInfo->pHTCStructAlloc); - pHcidevInfo->pHTCStructAlloc = NULL; - } - - A_FREE(pHcidevInfo); -#ifndef EXPORT_HCI_BRIDGE_INTERFACE - ar->hcidev_info = NULL; - ar->exitCallback = NULL; -#endif - } - - -} - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -A_STATUS hci_test_send(void *ar, struct sk_buff *skb) -#else -A_STATUS hci_test_send(AR_SOFTC_T *ar, struct sk_buff *skb) -#endif -{ - int status = A_OK; - int length; - EPPING_HEADER *pHeader; - HTC_PACKET *pPacket; - HTC_TX_TAG htc_tag = AR6K_DATA_PKT_TAG; -#ifdef EXPORT_HCI_BRIDGE_INTERFACE - AR6K_HCI_BRIDGE_INFO *pHcidevInfo = g_pHcidevInfo; -#else - AR6K_HCI_BRIDGE_INFO *pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)ar->hcidev_info; -#endif - - do { - - if (NULL == pHcidevInfo) { - status = A_ERROR; - break; - } - - if (NULL == pHcidevInfo->pHCIDev) { - status = A_ERROR; - break; - } - - if (pHcidevInfo->HciNormalMode) { - /* this interface cannot run when normal WMI is running */ - status = A_ERROR; - break; - } - - pHeader = (EPPING_HEADER *)A_NETBUF_DATA(skb); - - if (!IS_EPPING_PACKET(pHeader)) { - status = A_EINVAL; - break; - } - - if (IS_EPING_PACKET_NO_DROP(pHeader)) { - htc_tag = AR6K_CONTROL_PKT_TAG; - } - - length = sizeof(EPPING_HEADER) + pHeader->DataLength; - - pPacket = AllocHTCStruct(pHcidevInfo); - if (NULL == pPacket) { - status = A_NO_MEMORY; - break; - } - - SET_HTC_PACKET_INFO_TX(pPacket, - skb, - A_NETBUF_DATA(skb), - length, - HCI_ACL_TYPE, /* send every thing out as ACL */ - htc_tag); - - HCI_TransportSendPkt(pHcidevInfo->pHCIDev,pPacket,FALSE); - pPacket = NULL; - - } while (FALSE); - - return status; -} - -void ar6000_set_default_ar3kconfig(AR_SOFTC_T *ar, void *ar3kconfig) -{ - AR6K_HCI_BRIDGE_INFO *pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)ar->hcidev_info; - AR3K_CONFIG_INFO *config = (AR3K_CONFIG_INFO *)ar3kconfig; - - config->pHCIDev = pHcidevInfo->pHCIDev; - config->pHCIProps = &pHcidevInfo->HCIProps; - config->pHIFDevice = ar->arHifDevice; - config->pBtStackHCIDev = pHcidevInfo->pBtStackHCIDev; - config->Flags |= AR3K_CONFIG_FLAG_SET_AR3K_BAUD; - config->AR3KBaudRate = 115200; -} - -#ifdef CONFIG_BLUEZ_HCI_BRIDGE -/*** BT Stack Entrypoints *******/ - -/* - * bt_open - open a handle to the device -*/ -static int bt_open(struct hci_dev *hdev) -{ - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HCI Bridge: bt_open - enter - x\n")); - set_bit(HCI_RUNNING, &hdev->flags); - set_bit(HCI_UP, &hdev->flags); - set_bit(HCI_INIT, &hdev->flags); - return 0; -} - -/* - * bt_close - close handle to the device -*/ -static int bt_close(struct hci_dev *hdev) -{ - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HCI Bridge: bt_close - enter\n")); - clear_bit(HCI_RUNNING, &hdev->flags); - return 0; -} - -/* - * bt_send_frame - send data frames -*/ -static int bt_send_frame(struct sk_buff *skb) -{ - struct hci_dev *hdev = (struct hci_dev *)skb->dev; - HCI_TRANSPORT_PACKET_TYPE type; - AR6K_HCI_BRIDGE_INFO *pHcidevInfo; - HTC_PACKET *pPacket; - A_STATUS status = A_OK; - struct sk_buff *txSkb = NULL; - - if (!hdev) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, ("HCI Bridge: bt_send_frame - no device\n")); - return -ENODEV; - } - - if (!test_bit(HCI_RUNNING, &hdev->flags)) { - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HCI Bridge: bt_send_frame - not open\n")); - return -EBUSY; - } - - pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)hdev->driver_data; - A_ASSERT(pHcidevInfo != NULL); - - AR_DEBUG_PRINTF(ATH_DEBUG_HCI_SEND, ("+bt_send_frame type: %d \n",bt_cb(skb)->pkt_type)); - type = HCI_COMMAND_TYPE; - - switch (bt_cb(skb)->pkt_type) { - case HCI_COMMAND_PKT: - type = HCI_COMMAND_TYPE; - hdev->stat.cmd_tx++; - break; - - case HCI_ACLDATA_PKT: - type = HCI_ACL_TYPE; - hdev->stat.acl_tx++; - break; - - case HCI_SCODATA_PKT: - /* we don't support SCO over the bridge */ - kfree_skb(skb); - return 0; - default: - A_ASSERT(FALSE); - kfree_skb(skb); - return 0; - } - - if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_HCI_DUMP)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,(">>> Send HCI %s packet len: %d\n", - (type == HCI_COMMAND_TYPE) ? "COMMAND" : "ACL", - skb->len)); - if (type == HCI_COMMAND_TYPE) { - A_UINT16 opcode = HCI_GET_OP_CODE(skb->data); - AR_DEBUG_PRINTF(ATH_DEBUG_ANY,(" HCI Command: OGF:0x%X OCF:0x%X \r\n", - opcode >> 10, opcode & 0x3FF)); - } - AR_DEBUG_PRINTBUF(skb->data,skb->len,"BT HCI SEND Packet Dump"); - } - - do { - - txSkb = bt_skb_alloc(TX_PACKET_RSV_OFFSET + pHcidevInfo->HCIProps.HeadRoom + - pHcidevInfo->HCIProps.TailRoom + skb->len, - GFP_ATOMIC); - - if (txSkb == NULL) { - status = A_NO_MEMORY; - break; - } - - bt_cb(txSkb)->pkt_type = bt_cb(skb)->pkt_type; - txSkb->dev = (void *)pHcidevInfo->pBtStackHCIDev; - skb_reserve(txSkb, TX_PACKET_RSV_OFFSET + pHcidevInfo->HCIProps.HeadRoom); - A_MEMCPY(txSkb->data, skb->data, skb->len); - skb_put(txSkb,skb->len); - - pPacket = AllocHTCStruct(pHcidevInfo); - if (NULL == pPacket) { - status = A_NO_MEMORY; - break; - } - - /* HCI packet length here doesn't include the 1-byte transport header which - * will be handled by the HCI transport layer. Enough headroom has already - * been reserved above for the transport header - */ - SET_HTC_PACKET_INFO_TX(pPacket, - txSkb, - txSkb->data, - txSkb->len, - type, - AR6K_CONTROL_PKT_TAG); /* HCI packets cannot be dropped */ - - AR_DEBUG_PRINTF(ATH_DEBUG_HCI_SEND, ("HCI Bridge: bt_send_frame skb:0x%lX \n",(unsigned long)txSkb)); - AR_DEBUG_PRINTF(ATH_DEBUG_HCI_SEND, ("HCI Bridge: type:%d, Total Length:%d Bytes \n", - type, txSkb->len)); - - status = HCI_TransportSendPkt(pHcidevInfo->pHCIDev,pPacket,FALSE); - pPacket = NULL; - txSkb = NULL; - - } while (FALSE); - - if (txSkb != NULL) { - kfree_skb(txSkb); - } - - kfree_skb(skb); - - AR_DEBUG_PRINTF(ATH_DEBUG_HCI_SEND, ("-bt_send_frame \n")); - return 0; -} - -/* - * bt_ioctl - ioctl processing -*/ -static int bt_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg) -{ - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HCI Bridge: bt_ioctl - enter\n")); - return -ENOIOCTLCMD; -} - -/* - * bt_flush - flush outstandingbpackets -*/ -static int bt_flush(struct hci_dev *hdev) -{ - AR6K_HCI_BRIDGE_INFO *pHcidevInfo; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HCI Bridge: bt_flush - enter\n")); - - pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)hdev->driver_data; - - /* TODO??? */ - - return 0; -} - - -/* - * bt_destruct - -*/ -static void bt_destruct(struct hci_dev *hdev) -{ - AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HCI Bridge: bt_destruct - enter\n")); - /* nothing to do here */ -} - -static A_STATUS bt_setup_hci(AR6K_HCI_BRIDGE_INFO *pHcidevInfo) -{ - A_STATUS status = A_OK; - struct hci_dev *pHciDev = NULL; - HIF_DEVICE_OS_DEVICE_INFO osDevInfo; - - if (!setupbtdev) { - return A_OK; - } - - do { - - A_MEMZERO(&osDevInfo,sizeof(osDevInfo)); - /* get the underlying OS device */ -#ifdef EXPORT_HCI_BRIDGE_INTERFACE - status = ar6000_get_hif_dev((HIF_DEVICE *)(pHcidevInfo->HCITransHdl.hifDevice), - &osDevInfo); -#else - status = HIFConfigureDevice(pHcidevInfo->ar->arHifDevice, - HIF_DEVICE_GET_OS_DEVICE, - &osDevInfo, - sizeof(osDevInfo)); -#endif - - if (A_FAILED(status)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Failed to OS device info from HIF\n")); - break; - } - - /* allocate a BT HCI struct for this device */ - pHciDev = hci_alloc_dev(); - if (NULL == pHciDev) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("HCI Bridge - failed to allocate bt struct \n")); - status = A_NO_MEMORY; - break; - } - /* save the device, we'll register this later */ - pHcidevInfo->pBtStackHCIDev = pHciDev; - SET_HCIDEV_DEV(pHciDev,osDevInfo.pOSDevice); - SET_HCI_BUS_TYPE(pHciDev, HCI_VIRTUAL, HCI_BREDR); - pHciDev->driver_data = pHcidevInfo; - pHciDev->open = bt_open; - pHciDev->close = bt_close; - pHciDev->send = bt_send_frame; - pHciDev->ioctl = bt_ioctl; - pHciDev->flush = bt_flush; - pHciDev->destruct = bt_destruct; - pHciDev->owner = THIS_MODULE; - /* driver is running in normal BT mode */ - pHcidevInfo->HciNormalMode = TRUE; - - } while (FALSE); - - if (A_FAILED(status)) { - bt_cleanup_hci(pHcidevInfo); - } - - return status; -} - -static void bt_cleanup_hci(AR6K_HCI_BRIDGE_INFO *pHcidevInfo) -{ - int err; - - if (pHcidevInfo->HciRegistered) { - pHcidevInfo->HciRegistered = FALSE; - clear_bit(HCI_RUNNING, &pHcidevInfo->pBtStackHCIDev->flags); - clear_bit(HCI_UP, &pHcidevInfo->pBtStackHCIDev->flags); - clear_bit(HCI_INIT, &pHcidevInfo->pBtStackHCIDev->flags); - A_ASSERT(pHcidevInfo->pBtStackHCIDev != NULL); - /* unregister */ - if ((err = hci_unregister_dev(pHcidevInfo->pBtStackHCIDev)) < 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("HCI Bridge: failed to unregister with bluetooth %d\n",err)); - } - } - - if (pHcidevInfo->pBtStackHCIDev != NULL) { - kfree(pHcidevInfo->pBtStackHCIDev); - pHcidevInfo->pBtStackHCIDev = NULL; - } -} - -static A_STATUS bt_register_hci(AR6K_HCI_BRIDGE_INFO *pHcidevInfo) -{ - int err; - A_STATUS status = A_OK; - - do { - AR_DEBUG_PRINTF(ATH_DEBUG_HCI_BRIDGE, ("HCI Bridge: registering HCI... \n")); - A_ASSERT(pHcidevInfo->pBtStackHCIDev != NULL); - /* mark that we are registered */ - pHcidevInfo->HciRegistered = TRUE; - if ((err = hci_register_dev(pHcidevInfo->pBtStackHCIDev)) < 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("HCI Bridge: failed to register with bluetooth %d\n",err)); - pHcidevInfo->HciRegistered = FALSE; - status = A_ERROR; - break; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_HCI_BRIDGE, ("HCI Bridge: HCI registered \n")); - - } while (FALSE); - - return status; -} - -static A_BOOL bt_indicate_recv(AR6K_HCI_BRIDGE_INFO *pHcidevInfo, - HCI_TRANSPORT_PACKET_TYPE Type, - struct sk_buff *skb) -{ - A_UINT8 btType; - int len; - A_BOOL success = FALSE; - BT_HCI_EVENT_HEADER *pEvent; - - do { - - if (!test_bit(HCI_RUNNING, &pHcidevInfo->pBtStackHCIDev->flags)) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, ("HCI Bridge: bt_indicate_recv - not running\n")); - break; - } - - switch (Type) { - case HCI_ACL_TYPE: - btType = HCI_ACLDATA_PKT; - break; - case HCI_EVENT_TYPE: - btType = HCI_EVENT_PKT; - break; - default: - btType = 0; - A_ASSERT(FALSE); - break; - } - - if (0 == btType) { - break; - } - - /* set the final type */ - bt_cb(skb)->pkt_type = btType; - /* set dev */ - skb->dev = (void *)pHcidevInfo->pBtStackHCIDev; - len = skb->len; - - if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_HCI_RECV)) { - if (bt_cb(skb)->pkt_type == HCI_EVENT_PKT) { - pEvent = (BT_HCI_EVENT_HEADER *)skb->data; - AR_DEBUG_PRINTF(ATH_DEBUG_HCI_RECV, ("BT HCI EventCode: %d, len:%d \n", - pEvent->EventCode, pEvent->ParamLength)); - } - } - - /* pass receive packet up the stack */ -#ifdef CONFIG_BT - if (hci_recv_frame(skb) != 0) { -#else - if (1) { -#endif - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("HCI Bridge: hci_recv_frame failed \n")); - break; - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_HCI_RECV, - ("HCI Bridge: Indicated RCV of type:%d, Length:%d \n",btType,len)); - } - - success = TRUE; - - } while (FALSE); - - return success; -} - -static struct sk_buff* bt_alloc_buffer(AR6K_HCI_BRIDGE_INFO *pHcidevInfo, int Length) -{ - struct sk_buff *skb; - /* in normal HCI mode we need to alloc from the bt core APIs */ - skb = bt_skb_alloc(Length, GFP_ATOMIC); - if (NULL == skb) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Failed to alloc bt sk_buff \n")); - } - return skb; -} - -static void bt_free_buffer(AR6K_HCI_BRIDGE_INFO *pHcidevInfo, struct sk_buff *skb) -{ - kfree_skb(skb); -} - -#else // { CONFIG_BLUEZ_HCI_BRIDGE - - /* stubs when we only want to test the HCI bridging Interface without the HT stack */ -static A_STATUS bt_setup_hci(AR6K_HCI_BRIDGE_INFO *pHcidevInfo) -{ - return A_OK; -} -static void bt_cleanup_hci(AR6K_HCI_BRIDGE_INFO *pHcidevInfo) -{ - -} -static A_STATUS bt_register_hci(AR6K_HCI_BRIDGE_INFO *pHcidevInfo) -{ - A_ASSERT(FALSE); - return A_ERROR; -} - -static A_BOOL bt_indicate_recv(AR6K_HCI_BRIDGE_INFO *pHcidevInfo, - HCI_TRANSPORT_PACKET_TYPE Type, - struct sk_buff *skb) -{ - A_ASSERT(FALSE); - return FALSE; -} - -static struct sk_buff* bt_alloc_buffer(AR6K_HCI_BRIDGE_INFO *pHcidevInfo, int Length) -{ - A_ASSERT(FALSE); - return NULL; -} -static void bt_free_buffer(AR6K_HCI_BRIDGE_INFO *pHcidevInfo, struct sk_buff *skb) -{ - A_ASSERT(FALSE); -} - -#endif // } CONFIG_BLUEZ_HCI_BRIDGE - -#else // { ATH_AR6K_ENABLE_GMBOX - - /* stubs when GMBOX support is not needed */ - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -A_STATUS ar6000_setup_hci(void *ar) -#else -A_STATUS ar6000_setup_hci(AR_SOFTC_T *ar) -#endif -{ - return A_OK; -} - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -void ar6000_cleanup_hci(void *ar) -#else -void ar6000_cleanup_hci(AR_SOFTC_T *ar) -#endif -{ - return; -} - -#ifndef EXPORT_HCI_BRIDGE_INTERFACE -void ar6000_set_default_ar3kconfig(AR_SOFTC_T *ar, void *ar3kconfig) -{ - return; -} -#endif - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -int hci_test_send(void *ar, struct sk_buff *skb) -#else -int hci_test_send(AR_SOFTC_T *ar, struct sk_buff *skb) -#endif -{ - return -EOPNOTSUPP; -} - -#endif // } ATH_AR6K_ENABLE_GMBOX - - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -static int __init -hcibridge_init_module(void) -{ - A_STATUS status; - HCI_TRANSPORT_CALLBACKS hciTransCallbacks; - - hciTransCallbacks.setupTransport = ar6000_setup_hci; - hciTransCallbacks.cleanupTransport = ar6000_cleanup_hci; - - status = ar6000_register_hci_transport(&hciTransCallbacks); - if(status != A_OK) - return -ENODEV; - - return 0; -} - -static void __exit -hcibridge_cleanup_module(void) -{ -} - -module_init(hcibridge_init_module); -module_exit(hcibridge_cleanup_module); -MODULE_LICENSE("GPL and additional rights"); -#endif diff --git a/drivers/net/wireless/ar6003/host/os/linux/include/ar6000_drv.h b/drivers/net/wireless/ar6003/host/os/linux/include/ar6000_drv.h deleted file mode 100644 index 762ff5fc7836..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/include/ar6000_drv.h +++ /dev/null @@ -1,919 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -#ifndef _AR6000_H_ -#define _AR6000_H_ - -#include - - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) -#include -#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) -#include -#else -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26) -#include -#else -#include -#endif -#include -#ifdef ATH6K_CONFIG_CFG80211 -#include -#endif /* ATH6K_CONFIG_CFG80211 */ -#include -#include - -#include -#include -#include "a_types.h" -#include "a_osapi.h" -#include "htc_api.h" -#include "wmi.h" -#include "a_drv.h" -#include "bmi.h" -#include -#include -#include -#include -#include "gpio_api.h" -#include "gpio.h" -#include "pkt_log.h" -#include "aggr_recv_api.h" -#include -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) -#include -#else -#include -#include -#endif -#include "ar6000_api.h" -#ifdef CONFIG_HOST_TCMD_SUPPORT -#include -#endif -#include - -#include "targaddrs.h" -#include "dbglog_api.h" -#include "ar6000_diag.h" -#include "common_drv.h" -#include "roaming.h" -#include "hci_transport_api.h" -#define ATH_MODULE_NAME driver -#include "a_debug.h" - -#define ATH_DEBUG_DBG_LOG ATH_DEBUG_MAKE_MODULE_MASK(0) -#define ATH_DEBUG_WLAN_CONNECT ATH_DEBUG_MAKE_MODULE_MASK(1) -#define ATH_DEBUG_WLAN_SCAN ATH_DEBUG_MAKE_MODULE_MASK(2) -#define ATH_DEBUG_WLAN_TX ATH_DEBUG_MAKE_MODULE_MASK(3) -#define ATH_DEBUG_WLAN_RX ATH_DEBUG_MAKE_MODULE_MASK(4) -#define ATH_DEBUG_HTC_RAW ATH_DEBUG_MAKE_MODULE_MASK(5) -#define ATH_DEBUG_HCI_BRIDGE ATH_DEBUG_MAKE_MODULE_MASK(6) -#define ATH_DEBUG_HCI_RECV ATH_DEBUG_MAKE_MODULE_MASK(7) -#define ATH_DEBUG_HCI_SEND ATH_DEBUG_MAKE_MODULE_MASK(8) -#define ATH_DEBUG_HCI_DUMP ATH_DEBUG_MAKE_MODULE_MASK(9) - -#ifndef __dev_put -#define __dev_put(dev) dev_put(dev) -#endif - - - -#ifdef ATH6K_CONFIG_CFG80211 -#define NUM_SUBQUEUE 1 -#endif - -#ifdef USER_KEYS - -#define USER_SAVEDKEYS_STAT_INIT 0 -#define USER_SAVEDKEYS_STAT_RUN 1 - -// TODO this needs to move into the AR_SOFTC struct -struct USER_SAVEDKEYS { - struct ieee80211req_key ucast_ik; - struct ieee80211req_key bcast_ik; - CRYPTO_TYPE keyType; - A_BOOL keyOk; -}; -#endif - -#define DBG_INFO 0x00000001 -#define DBG_ERROR 0x00000002 -#define DBG_WARNING 0x00000004 -#define DBG_SDIO 0x00000008 -#define DBG_HIF 0x00000010 -#define DBG_HTC 0x00000020 -#define DBG_WMI 0x00000040 -#define DBG_WMI2 0x00000080 -#define DBG_DRIVER 0x00000100 - -#define DBG_DEFAULTS (DBG_ERROR|DBG_WARNING) - - -A_STATUS ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data); -A_STATUS ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data); - -#ifdef __cplusplus -extern "C" { -#endif - -#define MAX_AR6000 1 -#define AR6000_MAX_RX_BUFFERS 16 -#define AR6000_BUFFER_SIZE 1664 -#define AR6000_MAX_AMSDU_RX_BUFFERS 4 -#define AR6000_AMSDU_REFILL_THRESHOLD 3 -#define AR6000_AMSDU_BUFFER_SIZE (WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH + 128) -#define AR6000_MAX_RX_MESSAGE_SIZE (max(WMI_MAX_NORMAL_RX_DATA_FRAME_LENGTH,WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH)) - -#define AR6000_TX_TIMEOUT 10 -#define AR6000_ETH_ADDR_LEN 6 -#define AR6000_MAX_ENDPOINTS 4 -#define MAX_NODE_NUM 15 -/* MAX_HI_COOKIE_NUM are reserved for high priority traffic */ -#define MAX_DEF_COOKIE_NUM 150 -#define MAX_HI_COOKIE_NUM 15 /* 10% of MAX_COOKIE_NUM */ -#define MAX_COOKIE_NUM (MAX_DEF_COOKIE_NUM + MAX_HI_COOKIE_NUM) - -/* MAX_DEFAULT_SEND_QUEUE_DEPTH is used to set the default queue depth for the - * WMM send queues. If a queue exceeds this depth htc will query back to the - * OS specific layer by calling EpSendFull(). This gives the OS layer the - * opportunity to drop the packet if desired. Therefore changing - * MAX_DEFAULT_SEND_QUEUE_DEPTH does not affect resource utilization but - * does impact the threshold used to identify if a packet should be - * dropped. */ -// #define MAX_DEFAULT_SEND_QUEUE_DEPTH (MAX_DEF_COOKIE_NUM / WMM_NUM_AC) - -// Host Queue depth has been increased during performace chariot endpoint runs. Host may not pump -// as fast as host application expected, due to that panic/packet loss / chariot error happens -// adjusting queue depth size resolve this issue -#define MAX_DEFAULT_SEND_QUEUE_DEPTH 64 - -#define AR6000_HB_CHALLENGE_RESP_FREQ_DEFAULT 1 -#define AR6000_HB_CHALLENGE_RESP_MISS_THRES_DEFAULT 1 -#define A_DISCONNECT_TIMER_INTERVAL 10 * 1000 -#define A_DEFAULT_LISTEN_INTERVAL 100 -#define A_DEFAULT_BMISS_TIME 1500 -#define A_MAX_WOW_LISTEN_INTERVAL 300 -#define A_MAX_WOW_BMISS_TIME 4500 - -enum { - DRV_HB_CHALLENGE = 0, - APP_HB_CHALLENGE -}; - -enum { - WLAN_INIT_MODE_NONE = 0, - WLAN_INIT_MODE_USR, - WLAN_INIT_MODE_UDEV, - WLAN_INIT_MODE_DRV -}; - -/* Suspend - configuration */ -enum { - WLAN_SUSPEND_CUT_PWR = 0, - WLAN_SUSPEND_DEEP_SLEEP, - WLAN_SUSPEND_WOW, - WLAN_SUSPEND_CUT_PWR_IF_BT_OFF -}; - -/* WiFi OFF - configuration */ -enum { - WLAN_OFF_CUT_PWR = 0, - WLAN_OFF_DEEP_SLEEP, -}; - -/* WLAN low power state */ -enum { - WLAN_POWER_STATE_ON = 0, - WLAN_POWER_STATE_CUT_PWR = 1, - WLAN_POWER_STATE_DEEP_SLEEP, - WLAN_POWER_STATE_WOW -}; - -/* WLAN WoW State */ -enum { - WLAN_WOW_STATE_NONE = 0, - WLAN_WOW_STATE_SUSPENDING, - WLAN_WOW_STATE_SUSPENDED -}; - - -typedef enum _AR6K_BIN_FILE { - AR6K_OTP_FILE, - AR6K_FIRMWARE_FILE, - AR6K_PATCH_FILE, - AR6K_BOARD_DATA_FILE, -} AR6K_BIN_FILE; - -#ifdef SETUPHCI_ENABLED -#define SETUPHCI_DEFAULT 1 -#else -#define SETUPHCI_DEFAULT 0 -#endif /* SETUPHCI_ENABLED */ - -#ifdef SETUPHCIPAL_ENABLED -#define SETUPHCIPAL_DEFAULT 1 -#else -#define SETUPHCIPAL_DEFAULT 0 -#endif /* SETUPHCIPAL_ENABLED */ - -#ifdef SETUPBTDEV_ENABLED -#define SETUPBTDEV_DEFAULT 1 -#else -#define SETUPBTDEV_DEFAULT 0 -#endif /* SETUPBTDEV_ENABLED */ - -#ifdef BMIENABLE_SET -#define BMIENABLE_DEFAULT 1 -#else -#define BMIENABLE_DEFAULT 0 -#endif /* BMIENABLE_SET */ - -#ifdef ENABLEUARTPRINT_SET -#define ENABLEUARTPRINT_DEFAULT 1 -#else -#define ENABLEUARTPRINT_DEFAULT 0 -#endif /* ENABLEARTPRINT_SET */ - -#ifdef ATH6KL_CONFIG_HIF_VIRTUAL_SCATTER -#define NOHIFSCATTERSUPPORT_DEFAULT 1 -#else /* ATH6KL_CONFIG_HIF_VIRTUAL_SCATTER */ -#define NOHIFSCATTERSUPPORT_DEFAULT 0 -#endif /* ATH6KL_CONFIG_HIF_VIRTUAL_SCATTER */ - -#ifdef AR600x_BT_AR3001 -#define AR3KHCIBAUD_DEFAULT 3000000 -#define HCIUARTSCALE_DEFAULT 1 -#define HCIUARTSTEP_DEFAULT 8937 -#else -#define AR3KHCIBAUD_DEFAULT 0 -#define HCIUARTSCALE_DEFAULT 0 -#define HCIUARTSTEP_DEFAULT 0 -#endif /* AR600x_BT_AR3001 */ - -#ifdef INIT_MODE_DRV_ENABLED -#define WLAN_INIT_MODE_DEFAULT WLAN_INIT_MODE_DRV -#else -#define WLAN_INIT_MODE_DEFAULT WLAN_INIT_MODE_USR -#endif /* INIT_MODE_DRV_ENABLED */ - -#define AR6K_DATASET_PATCH_ADDRESS(_param, _ver) do { \ - if ((_ver) == AR6003_REV2_VERSION) { \ - (_param) = AR6003_REV2_DATASET_PATCH_ADDRESS; \ - } else if ((_ver) == AR6003_REV3_VERSION) { \ - (_param) = AR6003_REV3_DATASET_PATCH_ADDRESS; \ - } else { \ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unknown Version: %d\n", _ver)); \ - A_ASSERT(0); \ - } \ -} while (0) - -#define AR6K_APP_LOAD_ADDRESS(_param, _ver) do { \ - if ((_ver) == AR6003_REV2_VERSION) { \ - (_param) = AR6003_REV2_APP_LOAD_ADDRESS; \ - } else if ((_ver) == AR6003_REV3_VERSION) { \ - (_param) = AR6003_REV3_APP_LOAD_ADDRESS; \ - } else { \ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unknown Version: %d\n", _ver)); \ - A_ASSERT(0); \ - } \ -} while (0) - -#define AR6K_APP_START_OVERRIDE_ADDRESS(_param, _ver) do { \ - if ((_ver) == AR6003_REV2_VERSION) { \ - (_param) = AR6003_REV2_APP_START_OVERRIDE; \ - } else if ((_ver) == AR6003_REV3_VERSION) { \ - (_param) = AR6003_REV3_APP_START_OVERRIDE; \ - } else { \ - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unknown Version: %d\n", _ver)); \ - A_ASSERT(0); \ - } \ -} while (0) - -#define AR6003_SUBVER_DEFAULT 1 -#define AR6003_SUBVER_ROUTER 2 -#define AR6003_SUBVER_MOBILE 3 -#define AR6003_SUBVER_TABLET 4 - -/* AR6003 2.0 definitions */ -#define AR6003_REV2_VERSION 0x30000384 -#define AR6003_REV2_OTP_FILE "otp.bin.z77" -#define AR6003_REV2_FIRMWARE_FILE "athwlan.bin.z77" -#define AR6003_REV2_TCMD_FIRMWARE_FILE "athtcmd_ram.bin" -#define AR6003_REV2_TESTSCRIPT_FILE "testflow.bin" -#define AR6003_REV2_UTF_FIRMWARE_FILE "utf.bin" -#define AR6003_REV2_ART_FIRMWARE_FILE "device.bin" -#define AR6003_REV2_PATCH_FILE "data.patch.hw2_0.bin" -#define AR6003_REV2_EPPING_FIRMWARE_FILE "endpointping.bin" -#ifdef AR600x_SD31_XXX -#define AR6003_REV2_BOARD_DATA_FILE "bdata.SD31.bin" -#elif defined(AR600x_SD32_XXX) -#define AR6003_REV2_BOARD_DATA_FILE "bdata.SD32.bin" -#elif defined(AR600x_WB31_XXX) -#define AR6003_REV2_BOARD_DATA_FILE "bdata.WB31.bin" -#else -#define AR6003_REV2_BOARD_DATA_FILE "bdata.CUSTOM.bin" -#endif /* Board Data File */ - -/* AR6003 3.0 definitions */ -#define AR6003_REV3_VERSION 0x30000582 -#define AR6003_REV3_OTP_FILE "ath6k/AR6003/hw2.1.1/otp.bin" -#define AR6003_REV3_DEFAULT_FIRMWARE_FILE "ath6k/AR6003/hw2.1.1/athwlan.bin" -#define AR6003_REV3_ROUTER_FIRMWARE_FILE "ath6k/AR6003/hw2.1.1/athwlan_router.bin" -#define AR6003_REV3_MOBILE_FIRMWARE_FILE "ath6k/AR6003/hw2.1.1/athwlan_mobile.bin" -#define AR6003_REV3_TABLET_FIRMWARE_FILE "ath6k/AR6003/hw2.1.1/athwlan_tablet.bin" -#define AR6003_REV3_TCMD_FIRMWARE_FILE "ath6k/AR6003/hw2.1.1/athtcmd_ram.bin" -#define AR6003_REV3_TESTSCRIPT_FILE "ath6k/AR6003/hw2.1.1/testflow.bin" -#define AR6003_REV3_UTF_FIRMWARE_FILE "ath6k/AR6003/hw2.1.1/utf.bin" -#define AR6003_REV3_ART_FIRMWARE_FILE "ath6k/AR6003/hw2.1.1/device.bin" -#define AR6003_REV3_PATCH_FILE "ath6k/AR6003/hw2.1.1/data.patch.hw3_0.bin" -#define AR6003_REV3_EPPING_FIRMWARE_FILE "ath6k/AR6003/hw2.1.1/endpointping.bin" -#ifdef AR600x_SD31_XXX -#define AR6003_REV3_BOARD_DATA_FILE "ath6k/AR6003/hw2.1.1/bdata.SD31.bin" -#elif defined(AR600x_SD32_XXX) -#define AR6003_REV3_BOARD_DATA_FILE "ath6k/AR6003/hw2.1.1/bdata.SD32.bin" -#elif defined(AR600x_WB31_XXX) -#define AR6003_REV3_BOARD_DATA_FILE "ath6k/AR6003/hw2.1.1/bdata.WB31.bin" -#else -#define AR6003_REV3_BOARD_DATA_FILE "ath6k/AR6003/hw2.1.1/bdata.CUSTOM.bin" -#endif /* Board Data File */ - -/* AP-STA Concurrency */ -#define GET_CONN_AP_PRIV(_ar,_priv) do { \ - int i; \ - AR_SOFTC_DEV_T *tDev =NULL; \ - for(i=0;i<_ar->arConfNumDev;i++) { \ - tDev = _ar->arDev[i]; \ - if((tDev->arNetworkType == AP_NETWORK) && \ - (tDev->arConnected)) { \ - _priv = tDev; \ - break; \ - } \ - } \ -}while(0); - -/* Power states */ -enum { - WLAN_PWR_CTRL_UP = 0, - WLAN_PWR_CTRL_CUT_PWR, - WLAN_PWR_CTRL_DEEP_SLEEP, - WLAN_PWR_CTRL_WOW, - WLAN_PWR_CTRL_DEEP_SLEEP_DISABLED -}; - -/* HTC RAW streams */ -typedef enum _HTC_RAW_STREAM_ID { - HTC_RAW_STREAM_NOT_MAPPED = -1, - HTC_RAW_STREAM_0 = 0, - HTC_RAW_STREAM_1 = 1, - HTC_RAW_STREAM_2 = 2, - HTC_RAW_STREAM_3 = 3, - HTC_RAW_STREAM_NUM_MAX -} HTC_RAW_STREAM_ID; - -#define RAW_HTC_READ_BUFFERS_NUM 4 -#define RAW_HTC_WRITE_BUFFERS_NUM 4 - -#define HTC_RAW_BUFFER_SIZE 1664 - -typedef struct { - int currPtr; - int length; - A_UINT8 _Pad1[A_CACHE_LINE_PAD]; - unsigned char data[HTC_RAW_BUFFER_SIZE]; - A_UINT8 _Pad2[A_CACHE_LINE_PAD]; - HTC_PACKET HTCPacket; -} raw_htc_buffer; - -#ifdef CONFIG_HOST_TCMD_SUPPORT -/* - * add TCMD_MODE besides wmi and bypasswmi - * in TCMD_MODE, only few TCMD releated wmi commands - * counld be hanlder - */ -enum { - AR6000_WMI_MODE = 0, - AR6000_BYPASS_MODE, - AR6000_TCMD_MODE, - AR6000_WLAN_MODE -}; -#endif /* CONFIG_HOST_TCMD_SUPPORT */ - -struct ar_wep_key { - A_UINT8 arKeyIndex; - A_UINT8 arKeyLen; - A_UINT8 arKey[64]; -} ; - -#ifdef ATH6K_CONFIG_CFG80211 -struct ar_key { - A_UINT8 key[WLAN_MAX_KEY_LEN]; - A_UINT8 key_len; - A_UINT8 seq[IW_ENCODE_SEQ_MAX_SIZE]; - A_UINT8 seq_len; - A_UINT32 cipher; -}; -#endif /* ATH6K_CONFIG_CFG80211 */ - - -struct ar_node_mapping { - A_UINT8 macAddress[6]; - A_UINT8 epId; - A_UINT8 txPending; -}; - -struct ar_cookie { - unsigned long arc_bp[2]; /* Must be first field */ - HTC_PACKET HtcPkt; /* HTC packet wrapper */ - struct ar_cookie *arc_list_next; -}; - -struct ar_hb_chlng_resp { - A_TIMER timer; - A_UINT32 frequency; - A_UINT32 seqNum; - A_BOOL outstanding; - A_UINT8 missCnt; - A_UINT8 missThres; -}; - -/* Per STA data, used in AP mode */ -/*TODO: All this should move to OS independent dir */ - -#define STA_PWR_MGMT_MASK 0x1 -#define STA_PWR_MGMT_SHIFT 0x0 -#define STA_PWR_MGMT_AWAKE 0x0 -#define STA_PWR_MGMT_SLEEP 0x1 - -#define STA_SET_PWR_SLEEP(sta) (sta->flags |= (STA_PWR_MGMT_MASK << STA_PWR_MGMT_SHIFT)) -#define STA_CLR_PWR_SLEEP(sta) (sta->flags &= ~(STA_PWR_MGMT_MASK << STA_PWR_MGMT_SHIFT)) -#define STA_IS_PWR_SLEEP(sta) ((sta->flags >> STA_PWR_MGMT_SHIFT) & STA_PWR_MGMT_MASK) - -#define STA_PS_POLLED_MASK 0x1 -#define STA_PS_POLLED_SHIFT 0x1 - -#define STA_SET_PS_POLLED(sta) (sta->flags |= (STA_PS_POLLED_MASK << STA_PS_POLLED_SHIFT)) -#define STA_CLR_PS_POLLED(sta) (sta->flags &= ~(STA_PS_POLLED_MASK << STA_PS_POLLED_SHIFT)) -#define STA_IS_PS_POLLED(sta) (sta->flags & (STA_PS_POLLED_MASK << STA_PS_POLLED_SHIFT)) - -#define STA_APSD_TRIGGER_MASK 0x1 -#define STA_APSD_TRIGGER_SHIFT 0x2 -#define STA_APSD_EOSP_MASK 0x1 -#define STA_APSD_EOSP_SHIFT 0x3 - -#define STA_SET_APSD_TRIGGER(sta) (sta->flags |= (STA_APSD_TRIGGER_MASK << STA_APSD_TRIGGER_SHIFT)) -#define STA_CLR_APSD_TRIGGER(sta) (sta->flags &= ~(STA_APSD_TRIGGER_MASK << STA_APSD_TRIGGER_SHIFT)) -#define STA_IS_APSD_TRIGGER(sta) (sta->flags & (STA_APSD_TRIGGER_MASK << STA_APSD_TRIGGER_SHIFT)) - -#define STA_SET_APSD_EOSP(sta) (sta->flags |= (STA_APSD_EOSP_MASK << STA_APSD_EOSP_SHIFT)) -#define STA_CLR_APSD_EOSP(sta) (sta->flags &= ~(STA_APSD_EOSP_MASK << STA_APSD_EOSP_SHIFT)) -#define STA_IS_APSD_EOSP(sta) (sta->flags & (STA_APSD_EOSP_MASK << STA_APSD_EOSP_SHIFT)) - -#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL -#define APTC_TRAFFIC_SAMPLING_INTERVAL 100 /* msec */ -#define APTC_UPPER_THROUGHPUT_THRESHOLD 3000 /* Kbps */ -#define APTC_LOWER_THROUGHPUT_THRESHOLD 2000 /* Kbps */ - - -typedef struct aptc_traffic_record { - A_BOOL timerScheduled; - struct timeval samplingTS; - unsigned long bytesReceived; - unsigned long bytesTransmitted; -} APTC_TRAFFIC_RECORD; - -#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */ - -typedef struct user_rssi_compensation_t { - A_UINT16 customerID; - union { - A_UINT16 a_enable; - A_UINT16 bg_enable; - A_UINT16 enable; - }; - A_INT16 bg_param_a; - A_INT16 bg_param_b; - A_INT16 a_param_a; - A_INT16 a_param_b; - A_UINT32 reserved; -} USER_RSSI_CPENSATION; - - - -typedef struct { - A_UINT16 flags; - A_UINT8 mac[ATH_MAC_LEN]; - A_UINT8 aid; - A_UINT8 keymgmt; - A_UINT8 ucipher; - A_UINT8 auth; - A_UINT8 wmode; - A_UINT8 wpa_ie[IEEE80211_MAX_IE]; - A_UINT8 apsd_info; - A_NETBUF_QUEUE_T psq; /* power save q */ - A_NETBUF_QUEUE_T apsdq; /* APSD delivery enabled q */ - A_MUTEX_T psqLock; - A_UINT8 ba_state[8]; - void *conn_aggr; - void *arPriv; -} conn_t; - -typedef struct ar6_raw_htc { - HTC_ENDPOINT_ID arRaw2EpMapping[HTC_RAW_STREAM_NUM_MAX]; - HTC_RAW_STREAM_ID arEp2RawMapping[ENDPOINT_MAX]; - struct semaphore raw_htc_read_sem[HTC_RAW_STREAM_NUM_MAX]; - struct semaphore raw_htc_write_sem[HTC_RAW_STREAM_NUM_MAX]; - wait_queue_head_t raw_htc_read_queue[HTC_RAW_STREAM_NUM_MAX]; - wait_queue_head_t raw_htc_write_queue[HTC_RAW_STREAM_NUM_MAX]; - raw_htc_buffer raw_htc_read_buffer[HTC_RAW_STREAM_NUM_MAX][RAW_HTC_READ_BUFFERS_NUM]; - raw_htc_buffer raw_htc_write_buffer[HTC_RAW_STREAM_NUM_MAX][RAW_HTC_WRITE_BUFFERS_NUM]; - A_BOOL write_buffer_available[HTC_RAW_STREAM_NUM_MAX]; - A_BOOL read_buffer_available[HTC_RAW_STREAM_NUM_MAX]; -} AR_RAW_HTC_T; - -#ifdef CONFIG_HOST_TCMD_SUPPORT -typedef struct { - A_UINT16 len; - A_UINT8 ver; - A_UINT8 reserved; - A_UINT8 buf[TC_CMDS_SIZE_MAX]; -} AR_TCMD_RESP; -#endif /* CONFIG_HOST_TCMD_SUPPORT */ - -typedef struct ar6_softc { - spinlock_t arLock; - struct semaphore arSem; - A_BOOL arWmiReady; - int arTxPending[ENDPOINT_MAX]; - int arTotalTxDataPending; - A_UINT8 arNumDataEndPts; - HTC_HANDLE arHtcTarget; - void *arHifDevice; - struct ar6000_version arVersion; - A_UINT32 arTargetType; - AR6000_WLAN_STATE arWlanState; - struct ar_cookie *arCookieList; - A_UINT32 arCookieCount; - struct ar_hb_chlng_resp arHBChallengeResp; - HTC_ENDPOINT_ID arAc2EpMapping[WMM_NUM_AC]; - A_BOOL arAcStreamActive[WMM_NUM_AC]; - A_UINT8 arAcStreamPriMap[WMM_NUM_AC]; - A_UINT8 arHiAcStreamActivePri; - A_UINT8 arEp2AcMapping[ENDPOINT_MAX]; - HTC_ENDPOINT_ID arControlEp; -#ifdef HTC_RAW_INTERFACE - AR_RAW_HTC_T *arRawHtc; -#endif - A_BOOL arRawIfInit; - COMMON_CREDIT_STATE_INFO arCreditStateInfo; - A_BOOL arWMIControlEpFull; - A_BOOL dbgLogFetchInProgress; - A_UCHAR log_buffer[DBGLOG_HOST_LOG_BUFFER_SIZE]; - A_UINT32 log_cnt; - A_UINT32 dbglog_init_done; - HTC_PACKET_QUEUE amsdu_rx_buffer_queue; - A_BOOL bIsDestroyProgress; /* flag to indicate ar6k destroy is in progress */ - A_UINT8 rxMetaVersion; - A_INT32 (*exitCallback)(void *config); /* generic callback at AR6K exit */ - HIF_DEVICE_OS_DEVICE_INFO osDevInfo; - A_UINT16 arWlanPowerState; - A_BOOL arPlatPowerOff; - USER_RSSI_CPENSATION rssi_compensation_param; -#ifdef CONFIG_HOST_TCMD_SUPPORT - A_UINT8 tcmdRxReport; - A_UINT32 tcmdRxTotalPkt; - A_INT32 tcmdRxRssi; - A_UINT32 tcmdPm; - A_UINT32 arTargetMode; - A_UINT32 tcmdRxcrcErrPkt; - A_UINT32 tcmdRxsecErrPkt; - A_UINT16 tcmdRateCnt[TCMD_MAX_RATES]; - A_UINT16 tcmdRateCntShortGuard[TCMD_MAX_RATES]; - AR_TCMD_RESP tcmdResp; -#endif - A_BOOL arWlanOff; -#if CONFIG_PM - A_UINT16 arWowState; - A_BOOL arBTOff; - A_BOOL arBTSharing; - A_UINT16 arSuspendCutPwrConfig; - A_UINT16 arSuspendConfig; - A_UINT16 arWlanOffConfig; - A_UINT16 arWow2Config; -#endif -#ifndef EXPORT_HCI_BRIDGE_INTERFACE - void *hcidev_info; -#endif - conn_t connTbl[NUM_CONN]; /* AP mode */ - WMI_PER_STA_STAT arAPStats[NUM_CONN]; /* AP mode */ - A_UINT8 inter_bss; /* enable/disable inter bss data forward */ - A_UINT8 arAcsDisableHiChannel; - /* AP-STA Concurrency */ - A_UINT8 arConfNumDev; - A_UINT8 arHoldConnection; - A_TIMER ap_reconnect_timer; - A_UINT8 gNumSta; - /* AP-STA Concurrency */ - struct ar6_softc_dev *arDev[NUM_DEV]; - A_BOOL arResumeDone; - /* Bluetooth Address to be read from OTP */ - A_UINT8 bdaddr[6]; -} AR_SOFTC_T; - -typedef struct ar6_softc_ap { - WMI_AP_ACL g_acl; /* AP mode */ - A_UINT8 sta_list_index; /* AP mode */ - struct ieee80211req_key ap_mode_bkey; /* AP mode */ - A_NETBUF_QUEUE_T mcastpsq; /* power save q for Mcast frames */ - A_MUTEX_T mcastpsqLock; - A_BOOL DTIMExpired; /* flag to indicate DTIM expired */ - A_UINT8 intra_bss; /* enable/disable intra bss data forward */ - A_UINT8 ap_hidden_ssid; - A_UINT8 ap_country_code[3]; - A_UINT8 ap_dtim_period; - A_UINT16 ap_beacon_interval; - A_UINT16 arRTS; - void *pDfs; /* Pointer to DFS state structure */ - A_BOOL deKeySet; -}AR_SOFTC_AP_T; - -typedef struct ar6_softc_sta { - A_BOOL arConnectPending; - A_UINT8 arReqBssid[ATH_MAC_LEN]; - A_UINT16 arListenIntervalB; - A_UINT16 arListenIntervalT; - A_UINT16 arBmissTimeB; - A_UINT16 arBmissTimeT; - A_INT8 arRssi; - A_UINT8 arSkipScan; - A_UINT16 arBeaconInterval; - A_UINT8 arKeepaliveConfigured; - A_UINT8 arIbssPsEnable; - A_UINT32 arMgmtFilter; - struct ar_node_mapping arNodeMap[MAX_NODE_NUM]; - A_UINT8 arNodeNum; - A_UINT8 arNexEpId; - A_UINT32 arConnectCtrlFlags; -#ifdef USER_KEYS - A_INT32 user_savedkeys_stat; - A_UINT32 user_key_ctrl; - struct USER_SAVEDKEYS user_saved_keys; -#endif - USER_RSSI_THOLD rssi_map[12]; - A_TIMER disconnect_timer; - A_UINT8 arUserBssFilter; - A_INT8 arNumChannels; - A_UINT16 arChannelList[WMI_MAX_CHANNELS]; - A_UINT8 scan_triggered; - WMI_SCAN_PARAMS_CMD scParams; - A_UINT8 scanSpecificSsid; - A_BOOL wpaOffloadEnabled; - A_BOOL disconnect_timer_inited; -}AR_SOFTC_STA_T; - -typedef struct ar6_softc_dev { - struct net_device *arNetDev; /* net_device pointer */ - void *arWmi; - A_BOOL arWmiEnabled; - wait_queue_head_t arEvent; - spinlock_t arPrivLock; - A_INT8 arMaxRetries; - A_BOOL statsUpdatePending; - A_UINT8 arPhyCapability; - A_UINT16 arChannelHint; - A_UINT16 arBssChannel; - A_BOOL arConnected; - int arSsidLen; - u_char arSsid[WMI_MAX_SSID_LEN]; - A_UINT8 arNextMode; - A_UINT8 arNetworkType; - A_UINT8 arNetworkSubType; - A_UINT8 arDot11AuthMode; - A_UINT8 arAuthMode; - A_UINT8 arPairwiseCrypto; - A_UINT8 arPairwiseCryptoLen; - A_UINT8 arGroupCrypto; - A_UINT8 arGroupCryptoLen; - A_UINT8 arDefTxKeyIndex; - struct ar_wep_key arWepKeyList[WMI_MAX_KEY_INDEX + 1]; - A_UINT8 arBssid[ATH_MAC_LEN]; - A_UINT8 arTxPwr; - A_BOOL arTxPwrSet; - A_INT32 arBitRate; - struct net_device_stats arNetStats; - struct iw_statistics arIwStats; - A_UINT32 arRateMask[WMI_MAX_RATE_MASK]; - A_BOOL arNetQueueStopped; - A_UINT8 arDeviceIndex; - A_BOOL arWmmEnabled; - A_UINT32 arRegCode; - A_UINT16 ap_profile_flag; /* AP mode */ - WMI_BTCOEX_CONFIG_EVENT arBtcoexConfig; - WMI_BTCOEX_STATS_EVENT arBtcoexStats; - WMI_GET_WAC_INFO wacInfo; -#define AR_MCAST_FILTER_MAC_ADDR_SIZE 6 - A_UINT8 mcast_filters[MAC_MAX_FILTERS_PER_LIST][AR_MCAST_FILTER_MAC_ADDR_SIZE]; - A_UINT8 bdaddr[ATH_MAC_LEN]; -#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL - APTC_TRAFFIC_RECORD aptcTR; -#endif -#ifdef ATH6K_CONFIG_CFG80211 - struct wireless_dev *wdev; - struct cfg80211_scan_request *scan_request; - struct ar_key keys[WMI_MAX_KEY_INDEX + 1]; -#endif /* ATH6K_CONFIG_CFG80211 */ - A_TIMER ap_acs_timer; - TARGET_STATS arTargetStats; - void *conn_aggr; - void *p2p_ctx; - AR_SOFTC_AP_T arAp; - AR_SOFTC_STA_T arSta; - AR_SOFTC_T *arSoftc; - A_UINT8 arHoldConnection; - A_BOOL arDoConnectOnResume; - A_UINT8 num_sta; - void *hcipal_info; - A_BOOL isBt30amp; - A_UINT8 phymode; -}AR_SOFTC_DEV_T; - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) -/* Looks like we need this for 2.4 kernels */ -static inline void *ar6k_priv(struct net_device *dev) -{ - return(dev->priv); -} -#else -#ifdef ATH6K_CONFIG_CFG80211 -static inline void *ar6k_priv(struct net_device *dev) -{ - return (wdev_priv(dev->ieee80211_ptr)); -} -#else -#define ar6k_priv netdev_priv -#endif /* ATH6K_CONFIG_CFG80211 */ -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) */ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) -#define SET_HCI_BUS_TYPE(pHciDev, __bus, __type) do { \ - (pHciDev)->type = (__bus); \ -} while(0) -#else -#define SET_HCI_BUS_TYPE(pHciDev, __bus, __type) do { \ - (pHciDev)->bus = (__bus); \ - (pHciDev)->dev_type = (__type); \ -} while(0) -#endif - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) -#define GET_INODE_FROM_FILEP(filp) \ - (filp)->f_path.dentry->d_inode -#else -#define GET_INODE_FROM_FILEP(filp) \ - (filp)->f_dentry->d_inode -#endif - -#define arAc2EndpointID(ar,ac) (ar)->arAc2EpMapping[(ac)] -#define arSetAc2EndpointIDMap(ar,ac,ep) \ -{ (ar)->arAc2EpMapping[(ac)] = (ep); \ - (ar)->arEp2AcMapping[(ep)] = (ac); } -#define arEndpoint2Ac(ar,ep) (ar)->arEp2AcMapping[(ep)] - -#define arRawIfEnabled(ar) (ar)->arRawIfInit -#define arRawStream2EndpointID(ar,raw) (ar)->arRawHtc->arRaw2EpMapping[(raw)] -#define arSetRawStream2EndpointIDMap(ar,raw,ep) \ -{ (ar)->arRawHtc->arRaw2EpMapping[(raw)] = (ep); \ - (ar)->arRawHtc->arEp2RawMapping[(ep)] = (raw); } -#define arEndpoint2RawStreamID(ar,ep) (ar)->arRawHtc->arEp2RawMapping[(ep)] - -struct ar_giwscan_param { - char *current_ev; - char *end_buf; - A_UINT32 bytes_needed; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - struct iw_request_info *info; -#endif -}; - -#define AR6000_STAT_INC(ar, stat) (ar->arNetStats.stat++) - -#define AR6000_SPIN_LOCK(lock, param) do { \ - if (irqs_disabled()) { \ - AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("IRQs disabled:AR6000_LOCK\n")); \ - } \ - spin_lock_bh(lock); \ -} while (0) - -#define AR6000_SPIN_UNLOCK(lock, param) do { \ - if (irqs_disabled()) { \ - AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("IRQs disabled: AR6000_UNLOCK\n")); \ - } \ - spin_unlock_bh(lock); \ -} while (0) - -int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); -int ar6000_ioctl_dispatcher(struct net_device *dev, struct ifreq *rq, int cmd); -void ar6000_gpio_init(void); -void ar6000_init_profile_info(AR_SOFTC_DEV_T *arPriv); -void ar6000_install_static_wep_keys(AR_SOFTC_DEV_T *arPriv); -int ar6000_init(struct net_device *dev); -int ar6000_dbglog_get_debug_logs(AR_SOFTC_T *ar); -void ar6000_TxDataCleanup(AR_SOFTC_T *ar); -int ar6000_acl_data_tx(struct sk_buff *skb, AR_SOFTC_DEV_T *arPriv); -void ar6000_restart_endpoint(AR_SOFTC_T *ar); -void ar6000_stop_endpoint(AR_SOFTC_T *ar, A_BOOL keepprofile, A_BOOL getdbglogs); - -#ifdef HTC_RAW_INTERFACE - -#ifndef __user -#define __user -#endif - -int ar6000_htc_raw_open(AR_SOFTC_T *ar); -int ar6000_htc_raw_close(AR_SOFTC_T *ar); -ssize_t ar6000_htc_raw_read(AR_SOFTC_T *ar, - HTC_RAW_STREAM_ID StreamID, - char __user *buffer, size_t count); -ssize_t ar6000_htc_raw_write(AR_SOFTC_T *ar, - HTC_RAW_STREAM_ID StreamID, - char __user *buffer, size_t count); - -#endif /* HTC_RAW_INTERFACE */ - -/* AP mode */ -/*TODO: These routines should be moved to a file that is common across OS */ -conn_t * -ieee80211_find_conn(AR_SOFTC_DEV_T *arPriv, A_UINT8 *node_addr); - -conn_t * -ieee80211_find_conn_for_aid(AR_SOFTC_DEV_T *arPriv, A_UINT8 aid); - -A_UINT8 -remove_sta(AR_SOFTC_DEV_T *arPriv, A_UINT8 *mac, A_UINT16 reason); - -void -ar6000_ap_cleanup(AR_SOFTC_DEV_T *arPriv); - -int -ar6000_ap_set_num_sta(AR_SOFTC_T *ar, AR_SOFTC_DEV_T *arPriv, A_UINT8 num_sta); - -/* HCI support */ - -#ifndef EXPORT_HCI_BRIDGE_INTERFACE -A_STATUS ar6000_setup_hci(AR_SOFTC_T *ar); -void ar6000_cleanup_hci(AR_SOFTC_T *ar); -void ar6000_set_default_ar3kconfig(AR_SOFTC_T *ar, void *ar3kconfig); - -/* HCI bridge testing */ -A_STATUS hci_test_send(AR_SOFTC_T *ar, struct sk_buff *skb); -#endif -void ar6000_init_mode_info(AR_SOFTC_DEV_T *arPriv); -ATH_DEBUG_DECLARE_EXTERN(htc); -ATH_DEBUG_DECLARE_EXTERN(wmi); -ATH_DEBUG_DECLARE_EXTERN(bmi); -ATH_DEBUG_DECLARE_EXTERN(hif); -ATH_DEBUG_DECLARE_EXTERN(wlan); -ATH_DEBUG_DECLARE_EXTERN(misc); - -extern A_UINT8 bcast_mac[]; -extern A_UINT8 null_mac[]; - -#ifdef __cplusplus -} -#endif - -#endif /* _AR6000_H_ */ diff --git a/drivers/net/wireless/ar6003/host/os/linux/include/ar6k_pal.h b/drivers/net/wireless/ar6003/host/os/linux/include/ar6k_pal.h deleted file mode 100644 index 98eb1db224be..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/include/ar6k_pal.h +++ /dev/null @@ -1,47 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2009-2010 Atheros Corporation. All rights reserved. -// -// The software source and binaries included in this development package are -// licensed, not sold. You, or your company, received the package under one -// or more license agreements. The rights granted to you are specifically -// listed in these license agreement(s). All other rights remain with Atheros -// Communications, Inc., its subsidiaries, or the respective owner including -// those listed on the included copyright notices. Distribution of any -// portion of this package must be in strict compliance with the license -// agreement(s) terms. -// -// -// -// PAL driver for AR6003 -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== -#ifndef _HCI_PAL_H_ -#define _HCI_PAL_H_ -#define HCI_GET_OP_CODE(p) (((A_UINT16)((p)[1])) << 8) | ((A_UINT16)((p)[0])) -#define TX_PACKET_RSV_OFFSET 32 -/* pal specific config structure */ -typedef A_BOOL (*ar6k_pal_recv_pkt_t)(void *pHciPalInfo, void *skb); -typedef struct ar6k_pal_config_s -{ - ar6k_pal_recv_pkt_t fpar6k_pal_recv_pkt; -}ar6k_pal_config_t; - -/********************************** - * HCI PAL private info structure - *********************************/ -typedef struct ar6k_hci_pal_info_s{ - - unsigned long ulFlags; -#define HCI_NORMAL_MODE (1) -#define HCI_REGISTERED (1<<1) - struct hci_dev *hdev; /* BT Stack HCI dev */ - AR_SOFTC_DEV_T *ar; - -}ar6k_hci_pal_info_t; - -void register_pal_cb(ar6k_pal_config_t *palConfig_p); -#endif /* _HCI_PAL_H_ */ diff --git a/drivers/net/wireless/ar6003/host/os/linux/include/ar6xapi_linux.h b/drivers/net/wireless/ar6003/host/os/linux/include/ar6xapi_linux.h deleted file mode 100644 index c682f3ca7456..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/include/ar6xapi_linux.h +++ /dev/null @@ -1,244 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -#ifndef _AR6XAPI_LINUX_H -#define _AR6XAPI_LINUX_H - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct ar6_softc; -struct ar6_softc_dev; - -void ar6000_dfs_attach_event(struct ar6_softc_dev *arPriv, WMI_DFS_HOST_ATTACH_EVENT *capinfo); -void ar6000_dfs_init_event(struct ar6_softc_dev *arPriv, WMI_DFS_HOST_INIT_EVENT *info); -void ar6000_dfs_reset_delaylines_event(struct ar6_softc_dev *arPriv); -void ar6000_dfs_reset_radarq_event(struct ar6_softc_dev *arPriv); -void ar6000_dfs_reset_ar_event(struct ar6_softc_dev *arPriv); -void ar6000_dfs_reset_arq_event(struct ar6_softc_dev *arPriv); -void ar6000_dfs_set_dur_multiplier_event(struct ar6_softc_dev *arPriv, A_UINT32 value); -void ar6000_dfs_set_debuglevel_event(struct ar6_softc_dev *arPriv, A_UINT32 value); -void ar6000_dfs_set_bangradar_event(struct ar6_softc_dev *arPriv, A_UINT32 value); -A_STATUS ar6000_dfs_set_maxpulsedur_cmd(struct ar6_softc_dev *arPriv, A_UINT32 value); -A_STATUS ar6000_dfs_radar_detected_cmd(struct ar6_softc_dev *arPriv, A_INT16 chan_index, A_INT8 bang_radar); -A_STATUS ar6000_dfs_set_minrssithresh_cmd(struct ar6_softc_dev *arPriv, A_INT32 rssi); -void ar6000_dfs_phyerr_event(struct ar6_softc_dev *arPriv, WMI_DFS_PHYERR_EVENT *info); - -void ar6000_ready_event(void *devt, A_UINT8 *datap, A_UINT8 phyCap, - A_UINT32 sw_ver, A_UINT32 abi_ver); -A_STATUS ar6000_control_tx(void *devt, void *osbuf, HTC_ENDPOINT_ID eid); -void ar6000_connect_event(struct ar6_softc_dev *arPriv, WMI_CONNECT_EVENT *pEvt); -void ar6000_disconnect_event(struct ar6_softc_dev *arPriv, A_UINT8 reason, - A_UINT8 *bssid, A_UINT8 assocRespLen, - A_UINT8 *assocInfo, A_UINT16 protocolReasonStatus); -void ar6000_tkip_micerr_event(struct ar6_softc_dev *arPriv, A_UINT8 keyid, - A_BOOL ismcast); -void ar6000_bitrate_rx(void *devt, A_INT32 rateKbps); -void ar6000_channelList_rx(void *devt, A_INT8 numChan, A_UINT16 *chanList); -void ar6000_regDomain_event(struct ar6_softc_dev *arPriv, A_UINT32 regCode); -void ar6000_txPwr_rx(void *devt, A_UINT8 txPwr); -void ar6000_keepalive_rx(void *devt, A_UINT8 configured); -void ar6000_neighborReport_event(struct ar6_softc_dev *arPriv, int numAps, - WMI_NEIGHBOR_INFO *info); -void ar6000_set_numdataendpts(struct ar6_softc_dev *arPriv, A_UINT32 num); -void ar6000_scanComplete_event(struct ar6_softc_dev *arPriv, A_STATUS status); -void ar6000_targetStats_event(struct ar6_softc_dev *arPriv, A_UINT8 *ptr, A_UINT32 len); -void ar6000_rssiThreshold_event(struct ar6_softc_dev *arPriv, - WMI_RSSI_THRESHOLD_VAL newThreshold, - A_INT16 rssi); -void ar6000_reportError_event(struct ar6_softc_dev *, WMI_TARGET_ERROR_VAL errorVal); -void ar6000_cac_event(struct ar6_softc_dev *arPriv, A_UINT8 ac, A_UINT8 cac_indication, - A_UINT8 statusCode, A_UINT8 *tspecSuggestion); -void ar6000_channel_change_event(struct ar6_softc_dev *arPriv, A_UINT16 oldChannel, A_UINT16 newChannel); -void ar6000_hbChallengeResp_event(struct ar6_softc_dev *arPriv, A_UINT32 cookie, A_UINT32 source); -void -ar6000_roam_tbl_event(struct ar6_softc_dev *arPriv, WMI_TARGET_ROAM_TBL *pTbl); - -void -ar6000_roam_data_event(struct ar6_softc_dev *arPriv, WMI_TARGET_ROAM_DATA *p); - -void -ar6000_wow_list_event(struct ar6_softc_dev *ar, A_UINT8 num_filters, - WMI_GET_WOW_LIST_REPLY *wow_reply); - -void ar6000_pmkid_list_event(void *devt, A_UINT8 numPMKID, - WMI_PMKID *pmkidList, A_UINT8 *bssidList); - -void ar6000_gpio_intr_rx(struct ar6_softc_dev *arPriv, A_UINT32 intr_mask, A_UINT32 input_values); -void ar6000_gpio_data_rx(struct ar6_softc_dev *arPriv, A_UINT32 reg_id, A_UINT32 value); -void ar6000_gpio_ack_rx(struct ar6_softc_dev *arPriv); - -A_INT32 rssi_compensation_calc_tcmd(struct ar6_softc *ar, A_UINT32 freq, A_INT32 rssi, A_UINT32 totalPkt); -A_INT16 rssi_compensation_calc(struct ar6_softc_dev *arPriv, A_INT16 rssi); -A_INT16 rssi_compensation_reverse_calc(struct ar6_softc_dev *arPriv, A_INT16 rssi, A_BOOL Above); - -void ar6000_dbglog_init_done(struct ar6_softc_dev *arPriv); - -void ar6000_wacinfo_event(struct ar6_softc_dev *ar, A_UINT8 *ptr, A_UINT32 len); - -#ifdef SEND_EVENT_TO_APP -void ar6000_send_event_to_app(struct ar6_softc_dev *arPriv, A_UINT16 eventId, A_UINT8 *datap, int len); -void ar6000_send_generic_event_to_app(struct ar6_softc_dev *arPriv, A_UINT16 eventId, A_UINT8 *datap, int len); -#endif - -#ifdef CONFIG_HOST_TCMD_SUPPORT -void ar6000_tcmd_rx_report_event(struct ar6_softc_dev *arPriv, A_UINT8 * results, int len); -#endif - -void ar6000_tx_retry_err_event(void *devt); - -void ar6000_snrThresholdEvent_rx(void *devt, - WMI_SNR_THRESHOLD_VAL newThreshold, - A_UINT8 snr); - -void ar6000_lqThresholdEvent_rx(void *devt, WMI_LQ_THRESHOLD_VAL range, A_UINT8 lqVal); - - -void ar6000_ratemask_rx(void *devt, A_UINT32 *ratemask); - -A_STATUS ar6000_get_driver_cfg(struct net_device *dev, - A_UINT16 cfgParam, - void *result); -void ar6000_bssInfo_event_rx(struct ar6_softc_dev *arPriv, A_UINT8 *data, int len); - -void ar6000_dbglog_event(struct ar6_softc_dev *arPriv, A_UINT32 dropped, - A_INT8 *buffer, A_UINT32 length); - -int ar6000_dbglog_get_debug_logs(struct ar6_softc *ar); - -void ar6000_peer_event(void *devt, A_UINT8 eventCode, A_UINT8 *bssid); - -void ar6000_indicate_tx_activity(void *devt, A_UINT8 trafficClass, A_BOOL Active); -HTC_ENDPOINT_ID ar6000_ac2_endpoint_id ( void * devt, A_UINT8 ac); -A_UINT8 ar6000_endpoint_id2_ac (void * devt, HTC_ENDPOINT_ID ep ); - -void ar6000_btcoex_config_event(struct ar6_softc_dev *arPriv, A_UINT8 *ptr, A_UINT32 len); - -void ar6000_btcoex_stats_event(struct ar6_softc_dev *arPriv, A_UINT8 *ptr, A_UINT32 len) ; - -void ar6000_dset_open_req(void *devt, - A_UINT32 id, - A_UINT32 targ_handle, - A_UINT32 targ_reply_fn, - A_UINT32 targ_reply_arg); -void ar6000_dset_close(void *devt, A_UINT32 access_cookie); -void ar6000_dset_data_req(void *devt, - A_UINT32 access_cookie, - A_UINT32 offset, - A_UINT32 length, - A_UINT32 targ_buf, - A_UINT32 targ_reply_fn, - A_UINT32 targ_reply_arg); - - -#if defined(CONFIG_TARGET_PROFILE_SUPPORT) -void prof_count_rx(unsigned int addr, unsigned int count); -#endif - -A_UINT32 ar6000_getnodeAge (void); - -A_UINT32 ar6000_getclkfreq (void); - -int ar6000_ap_mode_profile_commit(struct ar6_softc_dev *arPriv); - -struct ieee80211req_wpaie; -A_STATUS -ar6000_ap_mode_get_wpa_ie(struct ar6_softc_dev *arPriv, struct ieee80211req_wpaie *wpaie); - -A_STATUS is_iwioctl_allowed(A_UINT8 mode, A_UINT16 cmd); - -A_STATUS is_xioctl_allowed(A_UINT8 mode, A_UINT8 submode, int cmd); - -void ar6000_pspoll_event(struct ar6_softc_dev *arPriv,A_UINT8 aid); - -void ar6000_dtimexpiry_event(struct ar6_softc_dev *arPriv); - -void ar6000_aggr_rcv_addba_req_evt(struct ar6_softc_dev *arPriv, WMI_ADDBA_REQ_EVENT *cmd); -void ar6000_aggr_rcv_addba_resp_evt(struct ar6_softc_dev *arPriv, WMI_ADDBA_RESP_EVENT *cmd); -void ar6000_aggr_rcv_delba_req_evt(struct ar6_softc_dev *arPriv, WMI_DELBA_EVENT *cmd); -void ar6000_hci_event_rcv_evt(struct ar6_softc_dev *arPriv, WMI_HCI_EVENT *cmd); - -#ifdef WAPI_ENABLE -int ap_set_wapi_key(struct ar6_softc_dev *arPriv, void *ik); -void ap_wapi_rekey_event(struct ar6_softc_dev *arPriv, A_UINT8 type, A_UINT8 *mac); -#endif - -#ifdef P2P -void ar6000_p2pdev_event(struct ar6_softc_dev *arPriv, const A_UINT8 *addr, - const A_UINT8 *dev_addr, - const A_UINT8 *pri_dev_type, const A_UINT8 *dev_name, - A_UINT8 dev_name_len, A_UINT16 config_methods, - A_UINT8 dev_capab, A_UINT8 grp_capab); -void p2p_go_neg_event(struct ar6_softc_dev *arPriv, A_UINT8 *res, A_UINT8 len); -void p2p_go_neg_req_event(struct ar6_softc_dev *arPriv, const A_UINT8 *sa, A_UINT16 dev_passwd_id); -void p2p_invite_sent_result_event(struct ar6_softc_dev *arPriv, A_UINT8 *res, - A_UINT8 len); -void p2p_invite_rcvd_result_event(struct ar6_softc_dev *arPriv, A_UINT8 *res, - A_UINT8 len); -void ar6000_p2p_prov_disc_req_event(struct ar6_softc_dev *arPriv, - const A_UINT8 *peer, A_UINT16 wps_config_method, - const A_UINT8 *dev_addr, const A_UINT8 *pri_dev_type, - const A_UINT8 *dev_name, A_UINT8 dev_name_len, - A_UINT16 supp_config_methods, A_UINT8 dev_capab, A_UINT8 group_capab); -void ar6000_p2p_prov_disc_resp_event(struct ar6_softc_dev *arPriv, - A_UINT8 *peer, A_UINT16 config_methods); -void *get_p2p_ctx(struct ar6_softc_dev *arPriv); -void *get_wmi_ctx(struct ar6_softc_dev *arPriv); -NETWORK_SUBTYPE get_network_subtype(struct ar6_softc_dev *arPriv); -void ar6000_p2p_sd_rx_event(struct ar6_softc_dev *arPriv, WMI_P2P_SDPD_RX_EVENT *ev); -#endif - -A_STATUS ar6000_connect_to_ap(struct ar6_softc_dev *arPriv); -A_STATUS ar6000_disconnect(struct ar6_softc_dev *arPriv); -A_STATUS ar6000_update_wlan_pwr_state(struct ar6_softc *ar, AR6000_WLAN_STATE state, A_BOOL suspending); - -A_STATUS ar6000_set_wlan_state(struct ar6_softc *ar, AR6000_WLAN_STATE state); -A_STATUS ar6000_set_bt_hw_state(struct ar6_softc *ar, A_UINT32 state); - -#ifdef CONFIG_PM -A_STATUS ar6000_suspend_ev(void *context); -A_STATUS ar6000_resume_ev(void *context); -A_STATUS ar6000_power_change_ev(void *context, A_UINT32 config); -void ar6000_check_wow_status(struct ar6_softc *ar, struct sk_buff *skb, A_BOOL isEvent); -#endif - -void ar6000_pm_init(void); -void ar6000_pm_exit(void); - -void ar6000_indicate_proberesp(struct ar6_softc_dev *arPriv , A_UINT8* pData , A_UINT16 len ,A_UINT8* bssid); -void ar6000_indicate_beacon(struct ar6_softc_dev *arPriv , A_UINT8* pData , A_UINT16 len ,A_UINT8* bssid); -void ar6000_assoc_req_report_event (void *context, A_UINT8 status, A_UINT8 rspType, A_UINT8* pData, int len); - -void ar6000_get_device_addr(struct ar6_softc_dev *arPriv, A_UINT8 *addr); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/drivers/net/wireless/ar6003/host/os/linux/include/athdrv_linux.h b/drivers/net/wireless/ar6003/host/os/linux/include/athdrv_linux.h deleted file mode 100644 index 1e20d6727b84..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/include/athdrv_linux.h +++ /dev/null @@ -1,1470 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -#ifndef _ATHDRV_LINUX_H -#define _ATHDRV_LINUX_H - -#ifdef __cplusplus -extern "C" { -#endif - - -/* - * There are two types of ioctl's here: Standard ioctls and - * eXtended ioctls. All extended ioctls (XIOCTL) are multiplexed - * off of the single ioctl command, AR6000_IOCTL_EXTENDED. The - * arguments for every XIOCTL starts with a 32-bit command word - * that is used to select which extended ioctl is in use. After - * the command word are command-specific arguments. - */ - -/* Linux standard Wireless Extensions, private ioctl interfaces */ -#define IEEE80211_IOCTL_SETPARAM (SIOCIWFIRSTPRIV+0) -#define IEEE80211_IOCTL_SETKEY (SIOCIWFIRSTPRIV+1) -#define IEEE80211_IOCTL_DELKEY (SIOCIWFIRSTPRIV+2) -#define IEEE80211_IOCTL_SETMLME (SIOCIWFIRSTPRIV+3) -#define IEEE80211_IOCTL_ADDPMKID (SIOCIWFIRSTPRIV+4) -#define IEEE80211_IOCTL_SETOPTIE (SIOCIWFIRSTPRIV+5) -//#define IEEE80211_IOCTL_GETPARAM (SIOCIWFIRSTPRIV+6) -//#define IEEE80211_IOCTL_SETWMMPARAMS (SIOCIWFIRSTPRIV+7) -//#define IEEE80211_IOCTL_GETWMMPARAMS (SIOCIWFIRSTPRIV+8) -//#define IEEE80211_IOCTL_GETOPTIE (SIOCIWFIRSTPRIV+9) -//#define IEEE80211_IOCTL_SETAUTHALG (SIOCIWFIRSTPRIV+10) -#define IEEE80211_IOCTL_LASTONE (SIOCIWFIRSTPRIV+10) - - - -/* ====WMI Ioctls==== */ -/* - * - * Many ioctls simply provide WMI services to application code: - * an application makes such an ioctl call with a set of arguments - * that are packaged into the corresponding WMI message, and sent - * to the Target. - */ - -#define AR6000_IOCTL_WMI_GETREV (SIOCIWFIRSTPRIV+11) -/* - * arguments: - * ar6000_version *revision - */ - -#define AR6000_IOCTL_WMI_SETPWR (SIOCIWFIRSTPRIV+12) -/* - * arguments: - * WMI_POWER_MODE_CMD pwrModeCmd (see include/wmi.h) - * uses: WMI_SET_POWER_MODE_CMDID - */ - -#define AR6000_IOCTL_WMI_SETSCAN (SIOCIWFIRSTPRIV+13) -/* - * arguments: - * WMI_SCAN_PARAMS_CMD scanParams (see include/wmi.h) - * uses: WMI_SET_SCAN_PARAMS_CMDID - */ - -#define AR6000_IOCTL_WMI_SETLISTENINT (SIOCIWFIRSTPRIV+14) -/* - * arguments: - * UINT32 listenInterval - * uses: WMI_SET_LISTEN_INT_CMDID - */ - -#define AR6000_IOCTL_WMI_SETBSSFILTER (SIOCIWFIRSTPRIV+15) -/* - * arguments: - * WMI_BSS_FILTER filter (see include/wmi.h) - * uses: WMI_SET_BSS_FILTER_CMDID - */ - -#define AR6000_IOCTL_WMI_SET_CHANNELPARAMS (SIOCIWFIRSTPRIV+16) -/* - * arguments: - * WMI_CHANNEL_PARAMS_CMD chParams - * uses: WMI_SET_CHANNEL_PARAMS_CMDID - */ - -#define AR6000_IOCTL_WMI_SET_PROBEDSSID (SIOCIWFIRSTPRIV+17) -/* - * arguments: - * WMI_PROBED_SSID_CMD probedSsids (see include/wmi.h) - * uses: WMI_SETPROBED_SSID_CMDID - */ - -#define AR6000_IOCTL_WMI_SET_PMPARAMS (SIOCIWFIRSTPRIV+18) -/* - * arguments: - * WMI_POWER_PARAMS_CMD powerParams (see include/wmi.h) - * uses: WMI_SET_POWER_PARAMS_CMDID - */ - -#define AR6000_IOCTL_WMI_SET_BADAP (SIOCIWFIRSTPRIV+19) -/* - * arguments: - * WMI_ADD_BAD_AP_CMD badAPs (see include/wmi.h) - * uses: WMI_ADD_BAD_AP_CMDID - */ - -#define AR6000_IOCTL_WMI_GET_QOS_QUEUE (SIOCIWFIRSTPRIV+20) -/* - * arguments: - * ar6000_queuereq queueRequest (see below) - */ - -#define AR6000_IOCTL_WMI_CREATE_QOS (SIOCIWFIRSTPRIV+21) -/* - * arguments: - * WMI_CREATE_PSTREAM createPstreamCmd (see include/wmi.h) - * uses: WMI_CREATE_PSTREAM_CMDID - */ - -#define AR6000_IOCTL_WMI_DELETE_QOS (SIOCIWFIRSTPRIV+22) -/* - * arguments: - * WMI_DELETE_PSTREAM_CMD deletePstreamCmd (see include/wmi.h) - * uses: WMI_DELETE_PSTREAM_CMDID - */ - -#define AR6000_IOCTL_WMI_SET_SNRTHRESHOLD (SIOCIWFIRSTPRIV+23) -/* - * arguments: - * WMI_SNR_THRESHOLD_PARAMS_CMD thresholdParams (see include/wmi.h) - * uses: WMI_SNR_THRESHOLD_PARAMS_CMDID - */ - -#define AR6000_IOCTL_WMI_SET_ERROR_REPORT_BITMASK (SIOCIWFIRSTPRIV+24) -/* - * arguments: - * WMI_TARGET_ERROR_REPORT_BITMASK errorReportBitMask (see include/wmi.h) - * uses: WMI_TARGET_ERROR_REPORT_BITMASK_CMDID - */ - -#define AR6000_IOCTL_WMI_GET_TARGET_STATS (SIOCIWFIRSTPRIV+25) -/* - * arguments: - * TARGET_STATS *targetStats (see below) - * uses: WMI_GET_STATISTICS_CMDID - */ - -#define AR6000_IOCTL_WMI_SET_ASSOC_INFO (SIOCIWFIRSTPRIV+26) -/* - * arguments: - * WMI_SET_ASSOC_INFO_CMD setAssocInfoCmd - * uses: WMI_SET_ASSOC_INFO_CMDID - */ - -#define AR6000_IOCTL_WMI_SET_ACCESS_PARAMS (SIOCIWFIRSTPRIV+27) -/* - * arguments: - * WMI_SET_ACCESS_PARAMS_CMD setAccessParams (see include/wmi.h) - * uses: WMI_SET_ACCESS_PARAMS_CMDID - */ - -#define AR6000_IOCTL_WMI_SET_BMISS_TIME (SIOCIWFIRSTPRIV+28) -/* - * arguments: - * UINT32 beaconMissTime - * uses: WMI_SET_BMISS_TIME_CMDID - */ - -#define AR6000_IOCTL_WMI_SET_DISC_TIMEOUT (SIOCIWFIRSTPRIV+29) -/* - * arguments: - * WMI_DISC_TIMEOUT_CMD disconnectTimeoutCmd (see include/wmi.h) - * uses: WMI_SET_DISC_TIMEOUT_CMDID - */ - -#define AR6000_IOCTL_WMI_SET_IBSS_PM_CAPS (SIOCIWFIRSTPRIV+30) -/* - * arguments: - * WMI_IBSS_PM_CAPS_CMD ibssPowerMgmtCapsCmd - * uses: WMI_SET_IBSS_PM_CAPS_CMDID - */ - -/* - * There is a very small space available for driver-private - * wireless ioctls. In order to circumvent this limitation, - * we multiplex a bunch of ioctls (XIOCTLs) on top of a - * single AR6000_IOCTL_EXTENDED ioctl. - */ -#define AR6000_IOCTL_EXTENDED (SIOCIWFIRSTPRIV+31) - -typedef enum { - AR6000_XIOCTL_BMI_DONE = 1, - AR6000_XIOCTL_BMI_READ_MEMORY, - AR6000_XIOCTL_BMI_WRITE_MEMORY, - AR6000_XIOCTL_BMI_EXECUTE, - AR6000_XIOCTL_BMI_SET_APP_START, - AR6000_XIOCTL_BMI_READ_SOC_REGISTER, - AR6000_XIOCTL_BMI_WRITE_SOC_REGISTER, - AR6000_XIOCTL_BMI_TEST, - AR6000_XIOCTL_UNUSED9, - AR6000_XIOCTL_UNUSED10, /* 10 */ - AR6000_XIOCTL_UNUSED11, - AR6000_XIOCTL_FORCE_TARGET_RESET, - AR6000_XIOCTL_HTC_RAW_OPEN, - AR6000_XIOCTL_HTC_RAW_CLOSE, - AR6000_XIOCTL_HTC_RAW_READ, - AR6000_XIOCTL_HTC_RAW_WRITE, - AR6000_XIOCTL_CHECK_TARGET_READY, - AR6000_XIOCTL_GPIO_OUTPUT_SET, - AR6000_XIOCTL_GPIO_INPUT_GET, - AR6000_XIOCTL_GPIO_REGISTER_SET, /* 20 */ - AR6000_XIOCTL_GPIO_REGISTER_GET, - AR6000_XIOCTL_GPIO_INTR_ACK, - AR6000_XIOCTL_GPIO_INTR_WAIT, - AR6000_XIOCTL_SET_ADHOC_BSSID, - AR6000_XIOCTL_UNUSED25, - AR6000_XIOCTL_UNUSED26, - AR6000_XIOCTL_SET_BEACON_INTVAL, - IEEE80211_IOCTL_SETAUTHALG, - AR6000_XIOCTL_SET_VOICE_PKT_SIZE, - AR6000_XIOCTL_SET_MAX_SP, /* 30 */ - AR6000_XIOCTL_WMI_GET_ROAM_TBL, - AR6000_XIOCTL_WMI_SET_ROAM_CTRL, - AR6000_XIOCTRL_WMI_SET_POWERSAVE_TIMERS, - AR6000_XIOCTRL_WMI_GET_POWER_MODE, - AR6000_XIOCTRL_WMI_SET_WLAN_STATE, - AR6000_XIOCTL_WMI_GET_ROAM_DATA, - AR6000_XIOCTL_WMI_SETRETRYLIMITS, - AR6000_XIOCTL_TCMD_CONT_TX, - AR6000_XIOCTL_TCMD_CONT_RX, - AR6000_XIOCTL_TCMD_PM, /* 40 */ - AR6000_XIOCTL_WMI_STARTSCAN, - AR6000_XIOCTL_WMI_SETFIXRATES, - AR6000_XIOCTL_WMI_GETFIXRATES, - AR6000_XIOCTL_WMI_SET_RSSITHRESHOLD, - AR6000_XIOCTL_WMI_CLR_RSSISNR, - AR6000_XIOCTL_WMI_SET_LQTHRESHOLD, - AR6000_XIOCTL_WMI_SET_RTS, - AR6000_XIOCTL_WMI_SET_LPREAMBLE, - AR6000_XIOCTL_WMI_SET_AUTHMODE, - AR6000_XIOCTL_WMI_SET_REASSOCMODE, /* 50 */ - AR6000_XIOCTL_WMI_SET_WMM, - AR6000_XIOCTL_WMI_SET_HB_CHALLENGE_RESP_PARAMS, - AR6000_XIOCTL_WMI_GET_HB_CHALLENGE_RESP, - AR6000_XIOCTL_WMI_GET_RD, - AR6000_XIOCTL_DIAG_READ, - AR6000_XIOCTL_DIAG_WRITE, - AR6000_XIOCTL_WMI_SET_TXOP, - AR6000_XIOCTL_USER_SETKEYS, - AR6000_XIOCTL_WMI_SET_KEEPALIVE, - AR6000_XIOCTL_WMI_GET_KEEPALIVE, /* 60 */ - AR6000_XIOCTL_BMI_ROMPATCH_INSTALL, - AR6000_XIOCTL_BMI_ROMPATCH_UNINSTALL, - AR6000_XIOCTL_BMI_ROMPATCH_ACTIVATE, - AR6000_XIOCTL_BMI_ROMPATCH_DEACTIVATE, - AR6000_XIOCTL_WMI_SET_APPIE, - AR6000_XIOCTL_WMI_SET_MGMT_FRM_RX_FILTER, - AR6000_XIOCTL_DBGLOG_CFG_MODULE, - AR6000_XIOCTL_DBGLOG_GET_DEBUG_LOGS, - AR6000_XIOCTL_WMI_SET_WSC_STATUS = 70, /* 70 */ - AR6000_XIOCTL_WMI_SET_BT_STATUS, - AR6000_XIOCTL_WMI_SET_BT_PARAMS, - AR6000_XIOCTL_WMI_SET_HOST_SLEEP_MODE, - AR6000_XIOCTL_WMI_SET_WOW_MODE, - AR6000_XIOCTL_WMI_GET_WOW_LIST, - AR6000_XIOCTL_WMI_ADD_WOW_PATTERN, - AR6000_XIOCTL_WMI_DEL_WOW_PATTERN, - AR6000_XIOCTL_TARGET_INFO, - AR6000_XIOCTL_DUMP_HTC_CREDIT_STATE, - AR6000_XIOCTL_TRAFFIC_ACTIVITY_CHANGE, /* 80 */ - AR6000_XIOCTL_WMI_SET_CONNECT_CTRL_FLAGS, - AR6000_XIOCTL_WMI_SET_AKMP_PARAMS, - AR6000_XIOCTL_WMI_GET_PMKID_LIST, - AR6000_XIOCTL_WMI_SET_PMKID_LIST, - AR6000_XIOCTL_WMI_SET_PARAMS, - AR6000_XIOCTL_WMI_SET_MCAST_FILTER, - AR6000_XIOCTL_WMI_DEL_MCAST_FILTER, - AR6000_XIOCTL_UNUSED90 = 90, /* 90 */ - AR6000_XIOCTL_BMI_LZ_STREAM_START, - AR6000_XIOCTL_BMI_LZ_DATA, - AR6000_XIOCTL_PROF_CFG, - AR6000_XIOCTL_PROF_ADDR_SET, - AR6000_XIOCTL_PROF_START, - AR6000_XIOCTL_PROF_STOP, - AR6000_XIOCTL_PROF_COUNT_GET, - AR6000_XIOCTL_WMI_ABORT_SCAN, - AR6000_XIOCTL_AP_GET_STA_LIST, - AR6000_XIOCTL_AP_HIDDEN_SSID, /* 100 */ - AR6000_XIOCTL_AP_SET_NUM_STA, - AR6000_XIOCTL_AP_SET_ACL_MAC, - AR6000_XIOCTL_AP_GET_ACL_LIST, - AR6000_XIOCTL_AP_COMMIT_CONFIG, - IEEE80211_IOCTL_GETWPAIE, - AR6000_XIOCTL_AP_CONN_INACT_TIME, - AR6000_XIOCTL_AP_PROT_SCAN_TIME, - AR6000_XIOCTL_AP_SET_COUNTRY, - AR6000_XIOCTL_AP_SET_DTIM, - AR6000_XIOCTL_WMI_TARGET_EVENT_REPORT, /* 110 */ - AR6000_XIOCTL_SET_IP, - AR6000_XIOCTL_AP_SET_ACL_POLICY, - AR6000_XIOCTL_AP_CTRL_BSS_COMM, - AR6000_XIOCTL_DUMP_MODULE_DEBUG_INFO, - AR6000_XIOCTL_MODULE_DEBUG_SET_MASK, - AR6000_XIOCTL_MODULE_DEBUG_GET_MASK, - AR6000_XIOCTL_DUMP_RCV_AGGR_STATS, - AR6000_XIOCTL_SET_HT_CAP, - AR6000_XIOCTL_SET_HT_OP, - AR6000_XIOCTL_AP_GET_STAT, /* 120 */ - AR6000_XIOCTL_SET_TX_SELECT_RATES, - AR6000_XIOCTL_SETUP_AGGR, - AR6000_XIOCTL_ALLOW_AGGR, - AR6000_XIOCTL_AP_GET_HIDDEN_SSID, - AR6000_XIOCTL_AP_GET_COUNTRY, - AR6000_XIOCTL_AP_GET_WMODE, - AR6000_XIOCTL_AP_GET_DTIM, - AR6000_XIOCTL_AP_GET_BINTVL, - AR6000_XIOCTL_AP_GET_RTS, - AR6000_XIOCTL_DELE_AGGR, /* 130 */ - AR6000_XIOCTL_FETCH_TARGET_REGS, - AR6000_XIOCTL_HCI_CMD, - AR6000_XIOCTL_ACL_DATA, - AR6000_XIOCTL_WLAN_CONN_PRECEDENCE, - AR6000_XIOCTL_AP_SET_11BG_RATESET, - AR6000_XIOCTL_WMI_SET_AP_PS, - AR6000_XIOCTL_WMI_MCAST_FILTER, - AR6000_XIOCTL_WMI_SET_BTCOEX_FE_ANT, - AR6000_XIOCTL_WMI_SET_BTCOEX_COLOCATED_BT_DEV, - AR6000_XIOCTL_WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG, /* 140 */ - AR6000_XIOCTL_WMI_SET_BTCOEX_SCO_CONFIG, - AR6000_XIOCTL_WMI_SET_BTCOEX_A2DP_CONFIG, - AR6000_XIOCTL_WMI_SET_BTCOEX_ACLCOEX_CONFIG, - AR6000_XIOCTL_WMI_SET_BTCOEX_DEBUG, - AR6000_XIOCTL_WMI_SET_BT_OPERATING_STATUS, - AR6000_XIOCTL_WMI_GET_BTCOEX_CONFIG, - AR6000_XIOCTL_WMI_GET_BTCOEX_STATS, - AR6000_XIOCTL_WMI_SET_QOS_SUPP, - AR6000_XIOCTL_AP_SET_DFS, - AR6000_XIOCTL_WMI_P2P_DISCOVER, /* 150 */ - AR6000_XIOCTL_WMI_P2P_STOP_FIND, - AR6000_XIOCTL_WMI_P2P_CANCEL, - AR6000_XIOCTL_WMI_P2P_LISTEN, - AR6000_XIOCTL_WMI_P2P_GO_NEG, - AR6000_XIOCTL_WMI_P2P_AUTH_GO_NEG, - AR6000_XIOCTL_WMI_P2P_REJECT, - AR6000_XIOCTL_WMI_P2P_CONFIG, - AR6000_XIOCTL_WMI_WPS_CONFIG, - AR6000_XIOCTL_WMI_P2P_FINDNODE, - AR6000_XIOCTL_WMI_P2P_GRP_INIT, /* 160 */ - AR6000_XIOCTL_WMI_P2P_GRP_FORMATION_DONE, - AR6000_XIOCTL_WMI_P2P_INVITE, - AR6000_XIOCTL_WMI_P2P_PROV_DISC, - AR6000_XIOCTL_WMI_P2P_SET, - AR6000_XIOCTL_WMI_P2P_PEER, - AR6000_XIOCTL_WMI_P2P_FLUSH, - AR6000_XIOCTL_WMI_GET_GO_PARAMS, - AR6000_XIOCTL_WMI_P2P_AUTH_INVITE, - AR6000_XIOCTL_WMI_P2P_GET_IF_ADDR, - AR6000_XIOCTL_WMI_P2P_GET_DEV_ADDR, /* 170 */ - AR6000_XIOCTL_WMI_P2P_SDPD_TX_CMD, - AR6000_XIOTCL_WMI_P2P_SD_CANCEL_REQUEST, - AR6000_XIOCTL_SET_BT_HW_POWER_STATE, - AR6000_XIOCTL_GET_BT_HW_POWER_STATE, - AR6000_XIOCTL_GET_WLAN_SLEEP_STATE, - AR6000_XIOCTL_WMI_SET_TX_SGI_PARAM, - AR6000_XIOCTL_WMI_ENABLE_WAC_PARAM, - AR6000_XIOCTL_WAC_SCAN_REPLY, - AR6000_XIOCTL_WMI_WAC_CTRL_REQ, - AR6000_XIOCTL_WMI_SET_WPA_OFFLOAD_STATE, /* 180 */ - AR6000_XIOCTL_WMI_SET_PASSPHRASE, - AR6000_XIOCTL_BMI_NVRAM_PROCESS, - AR6000_XIOCTL_WMI_SET_DIVERSITY_PARAM, - AR6000_XIOCTL_WMI_FORCE_ASSERT, - AR6000_XIOCTL_WMI_ENABLE_PKTLOG, - AR6000_XIOCTL_WMI_DISABLE_PKTLOG, - AR6000_XIOCTL_WMI_GET_PKTLOG, - AR6000_XIOCTL_AP_ACS_DISABLE_HI_CHANNELS, - AR6000_XIOCTL_TCMD_CMDS, - AR6000_XIOCTL_WMI_SET_EXCESS_TX_RETRY_THRES, /* 190 */ - AR6000_XIOCTL_AP_GET_NUM_STA, - AR6000_XIOCTL_SUSPEND_DRIVER, - AR6000_XIOCTL_RESUME_DRIVER, - AR6000_XIOCTL_GET_SUBMODE, - AR6000_XIOCTL_WMI_AP_SET_APSD, - AR6000_XIOCTL_TCMD_SETREG, - AR6000_XIOCTL_GET_HT_CAP, - AR6000_XIOCTL_WMI_GET_P2P_IE, /* 198 */ -} XTND_IOCLTS; - - - -///* ====BMI Extended Ioctls==== */ -// -//#define AR6000_XIOCTL_BMI_DONE 1 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_BMI_DONE) -// * uses: BMI_DONE -// */ -// -//#define AR6000_XIOCTL_BMI_READ_MEMORY 2 -///* -// * arguments: -// * union { -// * struct { -// * UINT32 cmd (AR6000_XIOCTL_BMI_READ_MEMORY) -// * UINT32 address -// * UINT32 length -// * } -// * char results[length] -// * } -// * uses: BMI_READ_MEMORY -// */ -// -//#define AR6000_XIOCTL_BMI_WRITE_MEMORY 3 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_BMI_WRITE_MEMORY) -// * UINT32 address -// * UINT32 length -// * char data[length] -// * uses: BMI_WRITE_MEMORY -// */ -// -//#define AR6000_XIOCTL_BMI_EXECUTE 4 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_BMI_EXECUTE) -// * UINT32 TargetAddress -// * UINT32 parameter -// * uses: BMI_EXECUTE -// */ -// -//#define AR6000_XIOCTL_BMI_SET_APP_START 5 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_BMI_SET_APP_START) -// * UINT32 TargetAddress -// * uses: BMI_SET_APP_START -// */ -// -//#define AR6000_XIOCTL_BMI_READ_SOC_REGISTER 6 -///* -// * arguments: -// * union { -// * struct { -// * UINT32 cmd (AR6000_XIOCTL_BMI_READ_SOC_REGISTER) -// * UINT32 TargetAddress, 32-bit aligned -// * } -// * UINT32 result -// * } -// * uses: BMI_READ_SOC_REGISTER -// */ -// -//#define AR6000_XIOCTL_BMI_WRITE_SOC_REGISTER 7 -///* -// * arguments: -// * struct { -// * UINT32 cmd (AR6000_XIOCTL_BMI_WRITE_SOC_REGISTER) -// * UINT32 TargetAddress, 32-bit aligned -// * UINT32 newValue -// * } -// * uses: BMI_WRITE_SOC_REGISTER -// */ -// -//#define AR6000_XIOCTL_BMI_TEST 8 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_BMI_TEST) -// * UINT32 address -// * UINT32 length -// * UINT32 count -// */ -// -// -// -///* Historical Host-side DataSet support */ -//#define AR6000_XIOCTL_UNUSED9 9 -//#define AR6000_XIOCTL_UNUSED10 10 -//#define AR6000_XIOCTL_UNUSED11 11 -// -///* ====Misc Extended Ioctls==== */ -// -//#define AR6000_XIOCTL_FORCE_TARGET_RESET 12 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_FORCE_TARGET_RESET) -// */ -// -// -//#ifdef HTC_RAW_INTERFACE -///* HTC Raw Interface Ioctls */ -//#define AR6000_XIOCTL_HTC_RAW_OPEN 13 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_HTC_RAW_OPEN) -// */ -// -//#define AR6000_XIOCTL_HTC_RAW_CLOSE 14 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_HTC_RAW_CLOSE) -// */ -// -//#define AR6000_XIOCTL_HTC_RAW_READ 15 -///* -// * arguments: -// * union { -// * struct { -// * UINT32 cmd (AR6000_XIOCTL_HTC_RAW_READ) -// * UINT32 mailboxID -// * UINT32 length -// * } -// * results[length] -// * } -// */ -// -//#define AR6000_XIOCTL_HTC_RAW_WRITE 16 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_HTC_RAW_WRITE) -// * UINT32 mailboxID -// * UINT32 length -// * char buffer[length] -// */ -//#endif /* HTC_RAW_INTERFACE */ -// -//#define AR6000_XIOCTL_CHECK_TARGET_READY 17 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_CHECK_TARGET_READY) -// */ -// -// -// -///* ====GPIO (General Purpose I/O) Extended Ioctls==== */ -// -//#define AR6000_XIOCTL_GPIO_OUTPUT_SET 18 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_GPIO_OUTPUT_SET) -// * ar6000_gpio_output_set_cmd_s (see below) -// * uses: WMIX_GPIO_OUTPUT_SET_CMDID -// */ -// -//#define AR6000_XIOCTL_GPIO_INPUT_GET 19 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_GPIO_INPUT_GET) -// * uses: WMIX_GPIO_INPUT_GET_CMDID -// */ -// -//#define AR6000_XIOCTL_GPIO_REGISTER_SET 20 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_GPIO_REGISTER_SET) -// * ar6000_gpio_register_cmd_s (see below) -// * uses: WMIX_GPIO_REGISTER_SET_CMDID -// */ -// -//#define AR6000_XIOCTL_GPIO_REGISTER_GET 21 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_GPIO_REGISTER_GET) -// * ar6000_gpio_register_cmd_s (see below) -// * uses: WMIX_GPIO_REGISTER_GET_CMDID -// */ -// -//#define AR6000_XIOCTL_GPIO_INTR_ACK 22 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_GPIO_INTR_ACK) -// * ar6000_cpio_intr_ack_cmd_s (see below) -// * uses: WMIX_GPIO_INTR_ACK_CMDID -// */ -// -//#define AR6000_XIOCTL_GPIO_INTR_WAIT 23 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_GPIO_INTR_WAIT) -// */ -// -// -// -///* ====more wireless commands==== */ -// -//#define AR6000_XIOCTL_SET_ADHOC_BSSID 24 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_SET_ADHOC_BSSID) -// * WMI_SET_ADHOC_BSSID_CMD setAdHocBssidCmd (see include/wmi.h) -// */ -// -//#define AR6000_XIOCTL_SET_OPT_MODE 25 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_SET_OPT_MODE) -// * WMI_SET_OPT_MODE_CMD setOptModeCmd (see include/wmi.h) -// * uses: WMI_SET_OPT_MODE_CMDID -// */ -// -//#define AR6000_XIOCTL_OPT_SEND_FRAME 26 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_OPT_SEND_FRAME) -// * WMI_OPT_TX_FRAME_CMD optTxFrameCmd (see include/wmi.h) -// * uses: WMI_OPT_TX_FRAME_CMDID -// */ -// -//#define AR6000_XIOCTL_SET_BEACON_INTVAL 27 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_SET_BEACON_INTVAL) -// * WMI_BEACON_INT_CMD beaconIntCmd (see include/wmi.h) -// * uses: WMI_SET_BEACON_INT_CMDID -// */ -// -// -//#define IEEE80211_IOCTL_SETAUTHALG 28 -// -// -//#define AR6000_XIOCTL_SET_VOICE_PKT_SIZE 29 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_SET_VOICE_PKT_SIZE) -// * WMI_SET_VOICE_PKT_SIZE_CMD setVoicePktSizeCmd (see include/wmi.h) -// * uses: WMI_SET_VOICE_PKT_SIZE_CMDID -// */ -// -// -//#define AR6000_XIOCTL_SET_MAX_SP 30 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_SET_MAX_SP) -// * WMI_SET_MAX_SP_LEN_CMD maxSPLen(see include/wmi.h) -// * uses: WMI_SET_MAX_SP_LEN_CMDID -// */ -// -//#define AR6000_XIOCTL_WMI_GET_ROAM_TBL 31 -// -//#define AR6000_XIOCTL_WMI_SET_ROAM_CTRL 32 -// -//#define AR6000_XIOCTRL_WMI_SET_POWERSAVE_TIMERS 33 -// -// -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTRL_WMI_SET_POWERSAVE_TIMERS) -// * WMI_SET_POWERSAVE_TIMERS_CMD powerSaveTimers(see include/wmi.h) -// * WMI_SET_POWERSAVE_TIMERS_CMDID -// */ -// -//#define AR6000_XIOCTRL_WMI_GET_POWER_MODE 34 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTRL_WMI_GET_POWER_MODE) -// */ -// -//#define AR6000_XIOCTRL_WMI_SET_WLAN_STATE 35 - -typedef enum { - WLAN_DISABLED, - WLAN_ENABLED -} AR6000_WLAN_STATE; - -///* -// * arguments: -// * enable/disable -// */ -// -//#define AR6000_XIOCTL_WMI_GET_ROAM_DATA 36 -// -//#define AR6000_XIOCTL_WMI_SETRETRYLIMITS 37 -///* -// * arguments: -// * WMI_SET_RETRY_LIMITS_CMD ibssSetRetryLimitsCmd -// * uses: WMI_SET_RETRY_LIMITS_CMDID -// */ -// -//#ifdef CONFIG_HOST_TCMD_SUPPORT -///* ====extended commands for radio test ==== */ -// -//#define AR6000_XIOCTL_TCMD_CONT_TX 38 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_TCMD_CONT_TX) -// * WMI_TCMD_CONT_TX_CMD contTxCmd (see include/wmi.h) -// * uses: WMI_TCMD_CONT_TX_CMDID -// */ -// -//#define AR6000_XIOCTL_TCMD_CONT_RX 39 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_TCMD_CONT_RX) -// * WMI_TCMD_CONT_RX_CMD rxCmd (see include/wmi.h) -// * uses: WMI_TCMD_CONT_RX_CMDID -// */ -// -//#define AR6000_XIOCTL_TCMD_PM 40 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_TCMD_PM) -// * WMI_TCMD_PM_CMD pmCmd (see include/wmi.h) -// * uses: WMI_TCMD_PM_CMDID -// */ -// -//#endif /* CONFIG_HOST_TCMD_SUPPORT */ -// -//#define AR6000_XIOCTL_WMI_STARTSCAN 41 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_WMI_STARTSCAN) -// * UINT8 scanType -// * UINT8 scanConnected -// * A_BOOL forceFgScan -// * uses: WMI_START_SCAN_CMDID -// */ -// -//#define AR6000_XIOCTL_WMI_SETFIXRATES 42 -// -//#define AR6000_XIOCTL_WMI_GETFIXRATES 43 -// -// -//#define AR6000_XIOCTL_WMI_SET_RSSITHRESHOLD 44 -///* -// * arguments: -// * WMI_RSSI_THRESHOLD_PARAMS_CMD thresholdParams (see include/wmi.h) -// * uses: WMI_RSSI_THRESHOLD_PARAMS_CMDID -// */ -// -//#define AR6000_XIOCTL_WMI_CLR_RSSISNR 45 -///* -// * arguments: -// * WMI_CLR_RSSISNR_CMD thresholdParams (see include/wmi.h) -// * uses: WMI_CLR_RSSISNR_CMDID -// */ -// -//#define AR6000_XIOCTL_WMI_SET_LQTHRESHOLD 46 -///* -// * arguments: -// * WMI_LQ_THRESHOLD_PARAMS_CMD thresholdParams (see include/wmi.h) -// * uses: WMI_LQ_THRESHOLD_PARAMS_CMDID -// */ -// -//#define AR6000_XIOCTL_WMI_SET_RTS 47 -///* -// * arguments: -// * WMI_SET_RTS_MODE_CMD (see include/wmi.h) -// * uses: WMI_SET_RTS_MODE_CMDID -// */ -// -//#define AR6000_XIOCTL_WMI_SET_LPREAMBLE 48 -// -//#define AR6000_XIOCTL_WMI_SET_AUTHMODE 49 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_WMI_SET_AUTHMODE) -// * UINT8 mode -// * uses: WMI_SET_RECONNECT_AUTH_MODE_CMDID -// */ -// -//#define AR6000_XIOCTL_WMI_SET_REASSOCMODE 50 -// -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_WMI_SET_WMM) -// * UINT8 mode -// * uses: WMI_SET_WMM_CMDID -// */ -//#define AR6000_XIOCTL_WMI_SET_WMM 51 -// -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_WMI_SET_HB_CHALLENGE_RESP_PARAMS) -// * UINT32 frequency -// * UINT8 threshold -// */ -//#define AR6000_XIOCTL_WMI_SET_HB_CHALLENGE_RESP_PARAMS 52 -// -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_WMI_GET_HB_CHALLENGE_RESP) -// * UINT32 cookie -// */ -//#define AR6000_XIOCTL_WMI_GET_HB_CHALLENGE_RESP 53 -// -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_WMI_GET_RD) -// * UINT32 regDomain -// */ -//#define AR6000_XIOCTL_WMI_GET_RD 54 -// -//#define AR6000_XIOCTL_DIAG_READ 55 -// -//#define AR6000_XIOCTL_DIAG_WRITE 56 -// -///* -// * arguments cmd (AR6000_XIOCTL_SET_TXOP) -// * WMI_TXOP_CFG txopEnable -// */ -//#define AR6000_XIOCTL_WMI_SET_TXOP 57 -// -//#ifdef USER_KEYS -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_USER_SETKEYS) -// * UINT32 keyOpCtrl -// * uses AR6000_USER_SETKEYS_INFO -// */ -//#define AR6000_XIOCTL_USER_SETKEYS 58 -//#endif /* USER_KEYS */ -// -//#define AR6000_XIOCTL_WMI_SET_KEEPALIVE 59 -///* -// * arguments: -// * UINT8 cmd (AR6000_XIOCTL_WMI_SET_KEEPALIVE) -// * UINT8 keepaliveInterval -// * uses: WMI_SET_KEEPALIVE_CMDID -// */ -// -//#define AR6000_XIOCTL_WMI_GET_KEEPALIVE 60 -///* -// * arguments: -// * UINT8 cmd (AR6000_XIOCTL_WMI_GET_KEEPALIVE) -// * UINT8 keepaliveInterval -// * A_BOOL configured -// * uses: WMI_GET_KEEPALIVE_CMDID -// */ -// -///* ====ROM Patching Extended Ioctls==== */ -// -//#define AR6000_XIOCTL_BMI_ROMPATCH_INSTALL 61 -///* -// * arguments: -// * union { -// * struct { -// * UINT32 cmd (AR6000_XIOCTL_BMI_ROMPATCH_INSTALL) -// * UINT32 ROM Address -// * UINT32 RAM Address -// * UINT32 number of bytes -// * UINT32 activate? (0 or 1) -// * } -// * A_UINT32 resulting rompatch ID -// * } -// * uses: BMI_ROMPATCH_INSTALL -// */ -// -//#define AR6000_XIOCTL_BMI_ROMPATCH_UNINSTALL 62 -///* -// * arguments: -// * struct { -// * UINT32 cmd (AR6000_XIOCTL_BMI_ROMPATCH_UNINSTALL) -// * UINT32 rompatch ID -// * } -// * uses: BMI_ROMPATCH_UNINSTALL -// */ -// -//#define AR6000_XIOCTL_BMI_ROMPATCH_ACTIVATE 63 -///* -// * arguments: -// * struct { -// * UINT32 cmd (AR6000_XIOCTL_BMI_ROMPATCH_ACTIVATE) -// * UINT32 rompatch count -// * UINT32 rompatch IDs[rompatch count] -// * } -// * uses: BMI_ROMPATCH_ACTIVATE -// */ -// -//#define AR6000_XIOCTL_BMI_ROMPATCH_DEACTIVATE 64 -///* -// * arguments: -// * struct { -// * UINT32 cmd (AR6000_XIOCTL_BMI_ROMPATCH_DEACTIVATE) -// * UINT32 rompatch count -// * UINT32 rompatch IDs[rompatch count] -// * } -// * uses: BMI_ROMPATCH_DEACTIVATE -// */ -// -//#define AR6000_XIOCTL_WMI_SET_APPIE 65 -///* -// * arguments: -// * struct { -// * UINT32 cmd (AR6000_XIOCTL_WMI_SET_APPIE) -// * UINT32 app_frmtype; -// * UINT32 app_buflen; -// * UINT8 app_buf[]; -// * } -// */ -//#define AR6000_XIOCTL_WMI_SET_MGMT_FRM_RX_FILTER 66 -///* -// * arguments: -// * A_UINT32 filter_type; -// */ -// -//#define AR6000_XIOCTL_DBGLOG_CFG_MODULE 67 -// -//#define AR6000_XIOCTL_DBGLOG_GET_DEBUG_LOGS 68 -// -//#define AR6000_XIOCTL_WMI_SET_WSC_STATUS 70 -///* -// * arguments: -// * A_UINT32 wsc_status; -// * (WSC_REG_INACTIVE or WSC_REG_ACTIVE) -// */ -// -///* -// * arguments: -// * struct { -// * A_UINT8 streamType; -// * A_UINT8 status; -// * } -// * uses: WMI_SET_BT_STATUS_CMDID -// */ -//#define AR6000_XIOCTL_WMI_SET_BT_STATUS 71 -// -///* -// * arguments: -// * struct { -// * A_UINT8 paramType; -// * union { -// * A_UINT8 noSCOPkts; -// * BT_PARAMS_A2DP a2dpParams; -// * BT_COEX_REGS regs; -// * }; -// * } -// * uses: WMI_SET_BT_PARAM_CMDID -// */ -//#define AR6000_XIOCTL_WMI_SET_BT_PARAMS 72 -// -//#define AR6000_XIOCTL_WMI_SET_HOST_SLEEP_MODE 73 -//#define AR6000_XIOCTL_WMI_SET_WOW_MODE 74 -//#define AR6000_XIOCTL_WMI_GET_WOW_LIST 75 -//#define AR6000_XIOCTL_WMI_ADD_WOW_PATTERN 76 -//#define AR6000_XIOCTL_WMI_DEL_WOW_PATTERN 77 -// -// -// -//#define AR6000_XIOCTL_TARGET_INFO 78 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_TARGET_INFO) -// * A_UINT32 TargetVersion (returned) -// * A_UINT32 TargetType (returned) -// * (See also bmi_msg.h target_ver and target_type) -// */ -// -//#define AR6000_XIOCTL_DUMP_HTC_CREDIT_STATE 79 -///* -// * arguments: -// * none -// */ -// -//#define AR6000_XIOCTL_TRAFFIC_ACTIVITY_CHANGE 80 -///* -// * This ioctl is used to emulate traffic activity -// * timeouts. Activity/inactivity will trigger the driver -// * to re-balance credits. -// * -// * arguments: -// * ar6000_traffic_activity_change -// */ -// -//#define AR6000_XIOCTL_WMI_SET_CONNECT_CTRL_FLAGS 81 -///* -// * This ioctl is used to set the connect control flags -// * -// * arguments: -// * A_UINT32 connectCtrlFlags -// */ -// -//#define AR6000_XIOCTL_WMI_SET_AKMP_PARAMS 82 -///* -// * This IOCTL sets any Authentication,Key Management and Protection -// * related parameters. This is used along with the information set in -// * Connect Command. -// * Currently this enables Multiple PMKIDs to an AP. -// * -// * arguments: -// * struct { -// * A_UINT32 akmpInfo; -// * } -// * uses: WMI_SET_AKMP_PARAMS_CMD -// */ -// -//#define AR6000_XIOCTL_WMI_GET_PMKID_LIST 83 -// -//#define AR6000_XIOCTL_WMI_SET_PMKID_LIST 84 -///* -// * This IOCTL is used to set a list of PMKIDs. This list of -// * PMKIDs is used in the [Re]AssocReq Frame. This list is used -// * only if the MultiPMKID option is enabled via the -// * AR6000_XIOCTL_WMI_SET_AKMP_PARAMS IOCTL. -// * -// * arguments: -// * struct { -// * A_UINT32 numPMKID; -// * WMI_PMKID pmkidList[WMI_MAX_PMKID_CACHE]; -// * } -// * uses: WMI_SET_PMKIDLIST_CMD -// */ -// -//#define AR6000_XIOCTL_WMI_SET_PARAMS 85 -//#define AR6000_XIOCTL_WMI_SET_MCAST_FILTER 86 -//#define AR6000_XIOCTL_WMI_DEL_MCAST_FILTER 87 -// -// -///* Historical DSETPATCH support for INI patches */ -//#define AR6000_XIOCTL_UNUSED90 90 -// -// -///* Support LZ-compressed firmware download */ -//#define AR6000_XIOCTL_BMI_LZ_STREAM_START 91 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_BMI_LZ_STREAM_START) -// * UINT32 address -// * uses: BMI_LZ_STREAM_START -// */ -// -//#define AR6000_XIOCTL_BMI_LZ_DATA 92 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_BMI_LZ_DATA) -// * UINT32 length -// * char data[length] -// * uses: BMI_LZ_DATA -// */ -// -//#define AR6000_XIOCTL_PROF_CFG 93 -///* -// * arguments: -// * A_UINT32 period -// * A_UINT32 nbins -// */ -// -//#define AR6000_XIOCTL_PROF_ADDR_SET 94 -///* -// * arguments: -// * A_UINT32 Target address -// */ -// -//#define AR6000_XIOCTL_PROF_START 95 -// -//#define AR6000_XIOCTL_PROF_STOP 96 -// -//#define AR6000_XIOCTL_PROF_COUNT_GET 97 -// -//#define AR6000_XIOCTL_WMI_ABORT_SCAN 98 -// -///* -// * AP mode -// */ -//#define AR6000_XIOCTL_AP_GET_STA_LIST 99 -// -//#define AR6000_XIOCTL_AP_HIDDEN_SSID 100 -// -//#define AR6000_XIOCTL_AP_SET_NUM_STA 101 -// -//#define AR6000_XIOCTL_AP_SET_ACL_MAC 102 -// -//#define AR6000_XIOCTL_AP_GET_ACL_LIST 103 -// -//#define AR6000_XIOCTL_AP_COMMIT_CONFIG 104 -// -//#define IEEE80211_IOCTL_GETWPAIE 105 -// -//#define AR6000_XIOCTL_AP_CONN_INACT_TIME 106 -// -//#define AR6000_XIOCTL_AP_PROT_SCAN_TIME 107 -// -//#define AR6000_XIOCTL_AP_SET_COUNTRY 108 -// -//#define AR6000_XIOCTL_AP_SET_DTIM 109 -// -// -// -// -//#define AR6000_XIOCTL_WMI_TARGET_EVENT_REPORT 110 -// -//#define AR6000_XIOCTL_SET_IP 111 -// -//#define AR6000_XIOCTL_AP_SET_ACL_POLICY 112 -// -//#define AR6000_XIOCTL_AP_CTRL_BSS_COMM 113 -// -//#define AR6000_XIOCTL_DUMP_MODULE_DEBUG_INFO 114 -// -//#define AR6000_XIOCTL_MODULE_DEBUG_SET_MASK 115 -// -//#define AR6000_XIOCTL_MODULE_DEBUG_GET_MASK 116 -// -//#define AR6000_XIOCTL_DUMP_RCV_AGGR_STATS 117 -// -//#define AR6000_XIOCTL_SET_HT_CAP 118 -// -//#define AR6000_XIOCTL_SET_HT_OP 119 -// -//#define AR6000_XIOCTL_AP_GET_STAT 120 -// -//#define AR6000_XIOCTL_SET_TX_SELECT_RATES 121 -// -//#define AR6000_XIOCTL_SETUP_AGGR 122 -// -//#define AR6000_XIOCTL_ALLOW_AGGR 123 -// -//#define AR6000_XIOCTL_AP_GET_HIDDEN_SSID 124 -// -//#define AR6000_XIOCTL_AP_GET_COUNTRY 125 -// -//#define AR6000_XIOCTL_AP_GET_WMODE 126 -// -//#define AR6000_XIOCTL_AP_GET_DTIM 127 -// -//#define AR6000_XIOCTL_AP_GET_BINTVL 128 -// -//#define AR6000_XIOCTL_AP_GET_RTS 129 -// -//#define AR6000_XIOCTL_DELE_AGGR 130 -// -//#define AR6000_XIOCTL_FETCH_TARGET_REGS 131 -// -//#define AR6000_XIOCTL_HCI_CMD 132 -// -//#define AR6000_XIOCTL_ACL_DATA 133 -// -//#define AR6000_XIOCTL_WLAN_CONN_PRECEDENCE 134 -// -//#define AR6000_XIOCTL_AP_SET_11BG_RATESET 135 -// -//#define AR6000_XIOCTL_WMI_SET_AP_PS 136 -// -//#define AR6000_XIOCTL_WMI_MCAST_FILTER 137 -// -//#define AR6000_XIOCTL_WMI_SET_BTCOEX_FE_ANT 138 -// -//#define AR6000_XIOCTL_WMI_SET_BTCOEX_COLOCATED_BT_DEV 139 -// -//#define AR6000_XIOCTL_WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG 140 -// -//#define AR6000_XIOCTL_WMI_SET_BTCOEX_SCO_CONFIG 141 -// -//#define AR6000_XIOCTL_WMI_SET_BTCOEX_A2DP_CONFIG 142 -// -//#define AR6000_XIOCTL_WMI_SET_BTCOEX_ACLCOEX_CONFIG 143 -// -//#define AR6000_XIOCTL_WMI_SET_BTCOEX_DEBUG 144 -// -//#define AR6000_XIOCTL_WMI_SET_BT_OPERATING_STATUS 145 -// -//#define AR6000_XIOCTL_WMI_GET_BTCOEX_CONFIG 146 -// -//#define AR6000_XIOCTL_WMI_GET_BTCOEX_STATS 147 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_WMI_SET_QOS_SUPP) -// * UINT8 mode -// * uses: WMI_SET_QOS_SUPP_CMDID -// */ -//#define AR6000_XIOCTL_WMI_SET_QOS_SUPP 148 -// -//#define AR6000_XIOCTL_AP_SET_DFS 149 -// -//#ifdef P2P -//#define AR6000_XIOCTL_WMI_P2P_DISCOVER 150 -//#define AR6000_XIOCTL_WMI_P2P_LISTEN 151 -//#define AR6000_XIOCTL_WMI_P2P_GO_NEG 152 -//#define AR6000_XIOCTL_WMI_P2P_CONFIG 153 -//#define AR6000_XIOCTL_WMI_WPS_CONFIG 154 -//#define AR6000_XIOCTL_WMI_P2P_FINDNODE 155 -//#endif -//#define AR6000_XIOCTL_SET_BT_HW_POWER_STATE 156 -//#define AR6000_XIOCTL_GET_BT_HW_POWER_STATE 157 -//#define AR6000_XIOCTL_GET_WLAN_SLEEP_STATE 158 -//#define AR6000_XIOCTL_WMI_SET_TX_SGI_PARAM 159 -///* -// * arguments: -// * WMI_AP_PS_CMD apPsCmd -// * uses: WMI_AP_PS_CMDID -// */ -// -// -//// WAC -//#define AR6000_XIOCTL_WMI_ENABLE_WAC_PARAM 160 -// -//#define AR6000_XIOCTL_WAC_SCAN_REPLY 161 -// -//#define AR6000_XIOCTL_WMI_WAC_CTRL_REQ 162 -// -//#define AR6000_XIOCTL_WMI_SET_WPA_OFFLOAD_STATE 163 -// -//#define AR6000_XIOCTL_WMI_SET_PASSPHRASE 164 -// -//#define AR6000_XIOCTL_BMI_NVRAM_PROCESS 165 -// -//#define AR6000_XIOCTL_AP_ACS_DISABLE_HI_CHANNELS 166 -// -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_BMI_NVRAM_PROCESS) -// * UINT8 name[BMI_NVRAM_SEG_NAME_SZ] -// * uses: BMI_NVRAM_PROCESS -// */ -// -// -//#ifdef CONFIG_HOST_TCMD_SUPPORT -///* ====additional extended commands for radio test ==== */ -// -//#define AR6000_XIOCTL_TCMD_CMDS 167 -///* -// * arguments: -// * UINT32 cmd (AR6000_XIOCTL_TCMD_CMDS) -// * WMI_TCMD_CMDS_CMD cmdsCmd (see include/wmi.h) -// * uses: WMI_TCMD_CMDS_CMDID -// */ -// -//#endif //ifdef CONFIG_HOST_TCMD_SUPPORT -// -//#define AR6000_XIOCTL_WMI_SET_DIVERSITY_PARAM 168 -// -//#define AR6000_XIOCTL_WMI_FORCE_ASSERT 169 -// -//#define AR6000_XIOCTL_WMI_SET_EXCESS_TX_RETRY_THRES 170 -// -//#define AR6000_XIOCTL_AP_GET_NUM_STA 171 -// -//#define AR6000_XIOCTL_SUSPEND_DRIVER 172 -// -//#define AR6000_XIOCTL_RESUME_DRIVER 173 - -/* used by AR6000_IOCTL_WMI_GETREV */ -struct ar6000_version { - A_UINT32 host_ver; - A_UINT32 target_ver; - A_UINT32 wlan_ver; - A_UINT32 abi_ver; - A_UINT32 targetconf_ver; -}; - -/* used by AR6000_IOCTL_WMI_GET_QOS_QUEUE */ -struct ar6000_queuereq { - A_UINT8 trafficClass; - A_UINT16 activeTsids; -}; - -/* used by AR6000_IOCTL_WMI_GET_TARGET_STATS */ -typedef struct targetStats_t { - A_UINT64 tx_packets; - A_UINT64 tx_bytes; - A_UINT64 tx_unicast_pkts; - A_UINT64 tx_unicast_bytes; - A_UINT64 tx_multicast_pkts; - A_UINT64 tx_multicast_bytes; - A_UINT64 tx_broadcast_pkts; - A_UINT64 tx_broadcast_bytes; - A_UINT64 tx_rts_success_cnt; - A_UINT64 tx_packet_per_ac[4]; - - A_UINT64 tx_errors; - A_UINT64 tx_failed_cnt; - A_UINT64 tx_retry_cnt; - A_UINT64 tx_mult_retry_cnt; - A_UINT64 tx_rts_fail_cnt; - - A_UINT64 rx_packets; - A_UINT64 rx_bytes; - A_UINT64 rx_unicast_pkts; - A_UINT64 rx_unicast_bytes; - A_UINT64 rx_multicast_pkts; - A_UINT64 rx_multicast_bytes; - A_UINT64 rx_broadcast_pkts; - A_UINT64 rx_broadcast_bytes; - A_UINT64 rx_fragment_pkt; - - A_UINT64 rx_errors; - A_UINT64 rx_crcerr; - A_UINT64 rx_key_cache_miss; - A_UINT64 rx_decrypt_err; - A_UINT64 rx_duplicate_frames; - - A_UINT64 tkip_local_mic_failure; - A_UINT64 tkip_counter_measures_invoked; - A_UINT64 tkip_replays; - A_UINT64 tkip_format_errors; - A_UINT64 ccmp_format_errors; - A_UINT64 ccmp_replays; - - A_UINT64 power_save_failure_cnt; - - A_UINT64 cs_bmiss_cnt; - A_UINT64 cs_lowRssi_cnt; - A_UINT64 cs_connect_cnt; - A_UINT64 cs_disconnect_cnt; - - A_INT32 tx_unicast_rate; - A_INT32 rx_unicast_rate; - - A_UINT32 lq_val; - - A_UINT32 wow_num_pkts_dropped; - A_UINT16 wow_num_events_discarded; - - A_INT16 noise_floor_calibation; - A_INT16 cs_rssi; - A_INT16 cs_aveBeacon_rssi; - A_UINT8 cs_aveBeacon_snr; - A_UINT8 cs_lastRoam_msec; - A_UINT8 cs_snr; - - A_UINT8 wow_num_host_pkt_wakeups; - A_UINT8 wow_num_host_event_wakeups; - - A_UINT32 arp_received; - A_UINT32 arp_matched; - A_UINT32 arp_replied; -}TARGET_STATS; - -typedef struct targetStats_cmd_t { - TARGET_STATS targetStats; - int clearStats; -} TARGET_STATS_CMD; - -/* used by AR6000_XIOCTL_USER_SETKEYS */ - -/* - * Setting this bit to 1 doesnot initialize the RSC on the firmware - */ -#define AR6000_XIOCTL_USER_SETKEYS_RSC_CTRL 1 -#define AR6000_USER_SETKEYS_RSC_UNCHANGED 0x00000002 - -typedef struct { - A_UINT32 keyOpCtrl; /* Bit Map of Key Mgmt Ctrl Flags */ -} AR6000_USER_SETKEYS_INFO; - - -/* used by AR6000_XIOCTL_GPIO_OUTPUT_SET */ -struct ar6000_gpio_output_set_cmd_s { - A_UINT32 set_mask; - A_UINT32 clear_mask; - A_UINT32 enable_mask; - A_UINT32 disable_mask; -}; - -/* - * used by AR6000_XIOCTL_GPIO_REGISTER_GET and AR6000_XIOCTL_GPIO_REGISTER_SET - */ -struct ar6000_gpio_register_cmd_s { - A_UINT32 gpioreg_id; - A_UINT32 value; -}; - -/* used by AR6000_XIOCTL_GPIO_INTR_ACK */ -struct ar6000_gpio_intr_ack_cmd_s { - A_UINT32 ack_mask; -}; - -/* used by AR6000_XIOCTL_GPIO_INTR_WAIT */ -struct ar6000_gpio_intr_wait_cmd_s { - A_UINT32 intr_mask; - A_UINT32 input_values; -}; - -/* used by the AR6000_XIOCTL_DBGLOG_CFG_MODULE */ -typedef struct ar6000_dbglog_module_config_s { - A_UINT32 valid; - A_UINT16 mmask; - A_UINT16 tsr; - A_BOOL rep; - A_UINT16 size; -} DBGLOG_MODULE_CONFIG; - -typedef struct user_rssi_thold_t { - A_INT16 tag; - A_INT16 rssi; -} USER_RSSI_THOLD; - -typedef struct user_rssi_params_t { - A_UINT8 weight; - A_UINT32 pollTime; - USER_RSSI_THOLD tholds[12]; -} USER_RSSI_PARAMS; - -typedef struct ar6000_get_btcoex_config_cmd_t{ - A_UINT32 btProfileType; - A_UINT32 linkId; - }AR6000_GET_BTCOEX_CONFIG_CMD; - -typedef struct ar6000_btcoex_config_t { - AR6000_GET_BTCOEX_CONFIG_CMD configCmd; - A_UINT32 * configEvent; -} AR6000_BTCOEX_CONFIG; - -typedef struct ar6000_btcoex_stats_t { - A_UINT32 * statsEvent; - }AR6000_BTCOEX_STATS; -/* - * Host driver may have some config parameters. Typically, these - * config params are one time config parameters. These could - * correspond to any of the underlying modules. Host driver exposes - * an api for the underlying modules to get this config. - */ -#define AR6000_DRIVER_CFG_BASE 0x8000 - -/* Should driver perform wlan node caching? */ -#define AR6000_DRIVER_CFG_GET_WLANNODECACHING 0x8001 -/*Should we log raw WMI msgs */ -#define AR6000_DRIVER_CFG_LOG_RAW_WMI_MSGS 0x8002 - -/* used by AR6000_XIOCTL_DIAG_READ & AR6000_XIOCTL_DIAG_WRITE */ -struct ar6000_diag_window_cmd_s { - unsigned int addr; - unsigned int value; -}; - - -struct ar6000_traffic_activity_change { - A_UINT32 StreamID; /* stream ID to indicate activity change */ - A_UINT32 Active; /* active (1) or inactive (0) */ -}; - -/* Used with AR6000_XIOCTL_PROF_COUNT_GET */ -struct prof_count_s { - A_UINT32 addr; /* bin start address */ - A_UINT32 count; /* hit count */ -}; - - -/* used by AR6000_XIOCTL_MODULE_DEBUG_SET_MASK */ -/* AR6000_XIOCTL_MODULE_DEBUG_GET_MASK */ -/* AR6000_XIOCTL_DUMP_MODULE_DEBUG_INFO */ -struct drv_debug_module_s { - A_CHAR modulename[128]; /* name of module */ - A_UINT32 mask; /* new mask to set .. or .. current mask */ -}; - -/* All HCI related rx events are sent up to the host app - * via a wmi event id. It can contain ACL data or HCI event, - * based on which it will be de-multiplexed. - */ -typedef enum { - PAL_HCI_EVENT = 0, - PAL_HCI_RX_DATA, -} WMI_PAL_EVENT_INFO; - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/drivers/net/wireless/ar6003/host/os/linux/include/athtypes_linux.h b/drivers/net/wireless/ar6003/host/os/linux/include/athtypes_linux.h deleted file mode 100644 index 9d9ecbb2a4d7..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/include/athtypes_linux.h +++ /dev/null @@ -1,53 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This file contains the definitions of the basic atheros data types. -// It is used to map the data types in atheros files to a platform specific -// type. -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -#ifndef _ATHTYPES_LINUX_H_ -#define _ATHTYPES_LINUX_H_ - -#ifdef __KERNEL__ -#include -#else -#include -#endif - -typedef int8_t A_INT8; -typedef int16_t A_INT16; -typedef int32_t A_INT32; -typedef int64_t A_INT64; - -typedef u_int8_t A_UINT8; -typedef u_int16_t A_UINT16; -typedef u_int32_t A_UINT32; -typedef u_int64_t A_UINT64; - -typedef int A_BOOL; -typedef char A_CHAR; -typedef unsigned char A_UCHAR; -typedef unsigned long A_ATH_TIMER; - - -#endif /* _ATHTYPES_LINUX_H_ */ diff --git a/drivers/net/wireless/ar6003/host/os/linux/include/cfg80211.h b/drivers/net/wireless/ar6003/host/os/linux/include/cfg80211.h deleted file mode 100644 index eeab404be789..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/include/cfg80211.h +++ /dev/null @@ -1,50 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -#ifndef _AR6K_CFG80211_H_ -#define _AR6K_CFG80211_H_ - -struct wireless_dev *ar6k_cfg80211_init(struct device *dev); -void ar6k_cfg80211_deinit(AR_SOFTC_DEV_T *arPriv); - -void ar6k_cfg80211_scanComplete_event(AR_SOFTC_DEV_T *arPriv, A_STATUS status); - -void ar6k_cfg80211_connect_event(AR_SOFTC_DEV_T *arPriv, A_UINT16 channel, - A_UINT8 *bssid, A_UINT16 listenInterval, - A_UINT16 beaconInterval,NETWORK_TYPE networkType, - A_UINT8 beaconIeLen, A_UINT8 assocReqLen, - A_UINT8 assocRespLen, A_UINT8 *assocInfo); - -void ar6k_cfg80211_disconnect_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 reason, - A_UINT8 *bssid, A_UINT8 assocRespLen, - A_UINT8 *assocInfo, A_UINT16 protocolReasonStatus); - -void ar6k_cfg80211_tkip_micerr_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 keyid, A_BOOL ismcast); - -#endif /* _AR6K_CFG80211_H_ */ - - - - - - diff --git a/drivers/net/wireless/ar6003/host/os/linux/include/config_linux.h b/drivers/net/wireless/ar6003/host/os/linux/include/config_linux.h deleted file mode 100644 index 16dc80474635..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/include/config_linux.h +++ /dev/null @@ -1,70 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -#ifndef _CONFIG_LINUX_H_ -#define _CONFIG_LINUX_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/* - * Host-side GPIO support is optional. - * If run-time access to GPIO pins is not required, then - * this should be changed to #undef. - */ -#define CONFIG_HOST_GPIO_SUPPORT - -/* - * Host side Test Command support - * Note: when HCI SDIO is enabled, a low stack IRQ or statck overflow is - * hit on FC10. So with HCI SDIO, minimize the stack allocation by - * mutually exclude TCMD_SUPPORT, which allocates large buffers - * in AR_TCMD_RESP in AR_SOFTC_T - * - */ -#ifndef HCI_TRANSPORT_SDIO -//#define CONFIG_HOST_TCMD_SUPPORT -#endif - -/* Host-side support for Target-side profiling */ -#undef CONFIG_TARGET_PROFILE_SUPPORT -/*DIX OFFLOAD SUPPORT*/ -/*#define DIX_RX_OFFLOAD*/ -/*#define DIX_TX_OFFLOAD*/ - -/* IP/TCP checksum offload */ -/* Checksum offload is currently not supported for 64 bit platforms */ -#ifndef __LP64__ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) -#define CONFIG_CHECKSUM_OFFLOAD -#endif -#endif /* __LP64__ */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/drivers/net/wireless/ar6003/host/os/linux/include/debug_linux.h b/drivers/net/wireless/ar6003/host/os/linux/include/debug_linux.h deleted file mode 100644 index b8dba52badce..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/include/debug_linux.h +++ /dev/null @@ -1,50 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -#ifndef _DEBUG_LINUX_H_ -#define _DEBUG_LINUX_H_ - - /* macro to remove parens */ -#define ATH_PRINTX_ARG(arg...) arg - -#ifdef DEBUG - /* NOTE: the AR_DEBUG_PRINTF macro is defined here to handle special handling of variable arg macros - * which may be compiler dependent. */ -#define AR_DEBUG_PRINTF(mask, args) do { \ - if (GET_ATH_MODULE_DEBUG_VAR_MASK(ATH_MODULE_NAME) & (mask)) { \ - A_LOGGER(mask, ATH_MODULE_NAME, ATH_PRINTX_ARG args); \ - } \ -} while (0) -#else - /* on non-debug builds, keep in error and warning messages in the driver, all other - * message tracing will get compiled out */ -#define AR_DEBUG_PRINTF(mask, args) \ - if ((mask) & (ATH_DEBUG_ERR | ATH_DEBUG_WARN)) { A_PRINTF(ATH_PRINTX_ARG args); } - -#endif - - /* compile specific macro to get the function name string */ -#define _A_FUNCNAME_ __func__ - - -#endif /* _DEBUG_LINUX_H_ */ diff --git a/drivers/net/wireless/ar6003/host/os/linux/include/export_hci_transport.h b/drivers/net/wireless/ar6003/host/os/linux/include/export_hci_transport.h deleted file mode 100644 index c1506805a4d5..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/include/export_hci_transport.h +++ /dev/null @@ -1,76 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2009-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// HCI bridge implementation -// -// Author(s): ="Atheros" -//============================================================================== - -#include "hci_transport_api.h" -#include "common_drv.h" - -extern HCI_TRANSPORT_HANDLE (*_HCI_TransportAttach)(void *HTCHandle, HCI_TRANSPORT_CONFIG_INFO *pInfo); -extern void (*_HCI_TransportDetach)(HCI_TRANSPORT_HANDLE HciTrans); -extern A_STATUS (*_HCI_TransportAddReceivePkts)(HCI_TRANSPORT_HANDLE HciTrans, HTC_PACKET_QUEUE *pQueue); -extern A_STATUS (*_HCI_TransportSendPkt)(HCI_TRANSPORT_HANDLE HciTrans, HTC_PACKET *pPacket, A_BOOL Synchronous); -extern void (*_HCI_TransportStop)(HCI_TRANSPORT_HANDLE HciTrans); -extern A_STATUS (*_HCI_TransportStart)(HCI_TRANSPORT_HANDLE HciTrans); -extern A_STATUS (*_HCI_TransportEnableDisableAsyncRecv)(HCI_TRANSPORT_HANDLE HciTrans, A_BOOL Enable); -extern A_STATUS (*_HCI_TransportRecvHCIEventSync)(HCI_TRANSPORT_HANDLE HciTrans, - HTC_PACKET *pPacket, - int MaxPollMS); -extern A_STATUS (*_HCI_TransportSetBaudRate)(HCI_TRANSPORT_HANDLE HciTrans, A_UINT32 Baud); -extern A_STATUS (*_HCI_TransportEnablePowerMgmt)(HCI_TRANSPORT_HANDLE HciTrans, A_BOOL Enable); - - -#define HCI_TransportAttach(HTCHandle, pInfo) \ - _HCI_TransportAttach((HTCHandle), (pInfo)) -#define HCI_TransportDetach(HciTrans) \ - _HCI_TransportDetach(HciTrans) -#define HCI_TransportAddReceivePkts(HciTrans, pQueue) \ - _HCI_TransportAddReceivePkts((HciTrans), (pQueue)) -#define HCI_TransportSendPkt(HciTrans, pPacket, Synchronous) \ - _HCI_TransportSendPkt((HciTrans), (pPacket), (Synchronous)) -#define HCI_TransportStop(HciTrans) \ - _HCI_TransportStop((HciTrans)) -#define HCI_TransportStart(HciTrans) \ - _HCI_TransportStart((HciTrans)) -#define HCI_TransportEnableDisableAsyncRecv(HciTrans, Enable) \ - _HCI_TransportEnableDisableAsyncRecv((HciTrans), (Enable)) -#define HCI_TransportRecvHCIEventSync(HciTrans, pPacket, MaxPollMS) \ - _HCI_TransportRecvHCIEventSync((HciTrans), (pPacket), (MaxPollMS)) -#define HCI_TransportSetBaudRate(HciTrans, Baud) \ - _HCI_TransportSetBaudRate((HciTrans), (Baud)) -#define HCI_TransportEnablePowerMgmt(HciTrans, Enable) \ - _HCI_TransportEnablePowerMgmt((HciTrans), (Enable)) - - -extern A_STATUS ar6000_register_hci_transport(HCI_TRANSPORT_CALLBACKS *hciTransCallbacks); - -extern A_STATUS ar6000_get_hif_dev(HIF_DEVICE *device, void *config); - -extern A_STATUS ar6000_set_uart_config(HIF_DEVICE *hifDevice, A_UINT32 scale, A_UINT32 step); - -/* get core clock register settings - * data: 0 - 40/44MHz - * 1 - 80/88MHz - * where (5G band/2.4G band) - * assume 2.4G band for now - */ -extern A_STATUS ar6000_get_core_clock_config(HIF_DEVICE *hifDevice, A_UINT32 *data); diff --git a/drivers/net/wireless/ar6003/host/os/linux/include/ieee80211_ioctl.h b/drivers/net/wireless/ar6003/host/os/linux/include/ieee80211_ioctl.h deleted file mode 100644 index 714441211536..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/include/ieee80211_ioctl.h +++ /dev/null @@ -1,181 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -#ifndef _IEEE80211_IOCTL_H_ -#define _IEEE80211_IOCTL_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Extracted from the MADWIFI net80211/ieee80211_ioctl.h - */ - -/* - * WPA/RSN get/set key request. Specify the key/cipher - * type and whether the key is to be used for sending and/or - * receiving. The key index should be set only when working - * with global keys (use IEEE80211_KEYIX_NONE for ``no index''). - * Otherwise a unicast/pairwise key is specified by the bssid - * (on a station) or mac address (on an ap). They key length - * must include any MIC key data; otherwise it should be no - more than IEEE80211_KEYBUF_SIZE. - */ -struct ieee80211req_key { - u_int8_t ik_type; /* key/cipher type */ - u_int8_t ik_pad; - u_int16_t ik_keyix; /* key index */ - u_int8_t ik_keylen; /* key length in bytes */ - u_int8_t ik_flags; -#define IEEE80211_KEY_XMIT 0x01 -#define IEEE80211_KEY_RECV 0x02 -#define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */ - u_int8_t ik_macaddr[IEEE80211_ADDR_LEN]; - u_int64_t ik_keyrsc; /* key receive sequence counter */ - u_int64_t ik_keytsc; /* key transmit sequence counter */ - u_int8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE]; -}; -/* - * Delete a key either by index or address. Set the index - * to IEEE80211_KEYIX_NONE when deleting a unicast key. - */ -struct ieee80211req_del_key { - u_int8_t idk_keyix; /* key index */ - u_int8_t idk_macaddr[IEEE80211_ADDR_LEN]; -}; -/* - * MLME state manipulation request. IEEE80211_MLME_ASSOC - * only makes sense when operating as a station. The other - * requests can be used when operating as a station or an - * ap (to effect a station). - */ -struct ieee80211req_mlme { - u_int8_t im_op; /* operation to perform */ -#define IEEE80211_MLME_ASSOC 1 /* associate station */ -#define IEEE80211_MLME_DISASSOC 2 /* disassociate station */ -#define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */ -#define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */ -#define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */ - u_int16_t im_reason; /* 802.11 reason code */ - u_int8_t im_macaddr[IEEE80211_ADDR_LEN]; -}; - -struct ieee80211req_addpmkid { - u_int8_t pi_bssid[IEEE80211_ADDR_LEN]; - u_int8_t pi_enable; - u_int8_t pi_pmkid[16]; -}; - -#define AUTH_ALG_OPEN_SYSTEM 0x01 -#define AUTH_ALG_SHARED_KEY 0x02 -#define AUTH_ALG_LEAP 0x04 - -struct ieee80211req_authalg { - u_int8_t auth_alg; -}; - -/* - * Request to add an IE to a Management Frame - */ -enum{ - IEEE80211_APPIE_FRAME_BEACON = 0, - IEEE80211_APPIE_FRAME_PROBE_REQ = 1, - IEEE80211_APPIE_FRAME_PROBE_RESP = 2, - IEEE80211_APPIE_FRAME_ASSOC_REQ = 3, - IEEE80211_APPIE_FRAME_ASSOC_RESP = 4, - IEEE80211_APPIE_NUM_OF_FRAME = 5 -}; - -/* - * The Maximum length of the IE that can be added to a Management frame - */ -#define IEEE80211_APPIE_FRAME_MAX_LEN 200 - -struct ieee80211req_getset_appiebuf { - u_int32_t app_frmtype; /* management frame type for which buffer is added */ - u_int32_t app_buflen; /*application supplied buffer length */ - u_int8_t app_buf[]; -}; - -/* - * The following definitions are used by an application to set filter - * for receiving management frames - */ -enum { - IEEE80211_FILTER_TYPE_BEACON = 0x1, - IEEE80211_FILTER_TYPE_PROBE_REQ = 0x2, - IEEE80211_FILTER_TYPE_PROBE_RESP = 0x4, - IEEE80211_FILTER_TYPE_ASSOC_REQ = 0x8, - IEEE80211_FILTER_TYPE_ASSOC_RESP = 0x10, - IEEE80211_FILTER_TYPE_AUTH = 0x20, - IEEE80211_FILTER_TYPE_DEAUTH = 0x40, - IEEE80211_FILTER_TYPE_DISASSOC = 0x80, - IEEE80211_FILTER_TYPE_ALL = 0xFF /* used to check the valid filter bits */ -}; - -struct ieee80211req_set_filter { - u_int32_t app_filterype; /* management frame filter type */ -}; - -enum { - IEEE80211_PARAM_AUTHMODE = 3, /* Authentication Mode */ - IEEE80211_PARAM_MCASTCIPHER = 5, - IEEE80211_PARAM_MCASTKEYLEN = 6, /* multicast key length */ - IEEE80211_PARAM_UCASTCIPHER = 8, - IEEE80211_PARAM_UCASTKEYLEN = 9, /* unicast key length */ - IEEE80211_PARAM_WPA = 10, /* WPA mode (0,1,2) */ - IEEE80211_PARAM_ROAMING = 12, /* roaming mode */ - IEEE80211_PARAM_PRIVACY = 13, /* privacy invoked */ - IEEE80211_PARAM_COUNTERMEASURES = 14, /* WPA/TKIP countermeasures */ - IEEE80211_PARAM_DROPUNENCRYPTED = 15, /* discard unencrypted frames */ - IEEE80211_PARAM_WAPI = 16, /* WAPI policy from wapid */ -}; - -/* - * Values for IEEE80211_PARAM_WPA - */ -#define WPA_MODE_WPA1 1 -#define WPA_MODE_WPA2 2 -#define WPA_MODE_AUTO 3 -#define WPA_MODE_NONE 4 - -struct ieee80211req_wpaie { - u_int8_t wpa_macaddr[IEEE80211_ADDR_LEN]; - u_int8_t wpa_ie[IEEE80211_MAX_IE]; - u_int8_t rsn_ie[IEEE80211_MAX_IE]; -}; - -#ifndef IW_ENCODE_ALG_PMK -#define IW_ENCODE_ALG_PMK 4 -#endif -#ifndef IW_ENCODE_ALG_KRK -#define IW_ENCODE_ALG_KRK 6 -#endif -#ifdef __cplusplus -} -#endif - -#endif /* _IEEE80211_IOCTL_H_ */ diff --git a/drivers/net/wireless/ar6003/host/os/linux/include/osapi_linux.h b/drivers/net/wireless/ar6003/host/os/linux/include/osapi_linux.h deleted file mode 100644 index bfdbba30b3be..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/include/osapi_linux.h +++ /dev/null @@ -1,432 +0,0 @@ -//------------------------------------------------------------------------------ -// This file contains the definitions of the basic atheros data types. -// It is used to map the data types in atheros files to a platform specific -// type. -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -#ifndef _OSAPI_LINUX_H_ -#define _OSAPI_LINUX_H_ - -#ifdef __KERNEL__ - -#include -#include -#include -#include -#include -#include -#include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) -#include -#endif -/*************************************/ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) -#include -#endif -#include -#include -#include -#ifdef KERNEL_2_4 -#include -#include -#endif - -#include - -#ifdef __GNUC__ -#define __ATTRIB_PACK __attribute__ ((packed)) -#define __ATTRIB_PRINTF __attribute__ ((format (printf, 1, 2))) -#define __ATTRIB_NORETURN __attribute__ ((noreturn)) -#ifndef INLINE -#define INLINE __inline__ -#endif -#else /* Not GCC */ -#define __ATTRIB_PACK -#define __ATTRIB_PRINTF -#define __ATTRIB_NORETURN -#ifndef INLINE -#define INLINE __inline -#endif -#endif /* End __GNUC__ */ - -#define PREPACK -#define POSTPACK __ATTRIB_PACK - -/* - * Endianes macros - */ -#define A_BE2CPU8(x) ntohb(x) -#define A_BE2CPU16(x) ntohs(x) -#define A_BE2CPU32(x) ntohl(x) - -#define A_LE2CPU8(x) (x) -#define A_LE2CPU16(x) (x) -#define A_LE2CPU32(x) (x) - -#define A_CPU2BE8(x) htonb(x) -#define A_CPU2BE16(x) htons(x) -#define A_CPU2BE32(x) htonl(x) - -#define A_MEMCPY(dst, src, len) memcpy((A_UINT8 *)(dst), (src), (len)) -#define A_MEMZERO(addr, len) memset(addr, 0, len) -#define A_MEMCMP(addr1, addr2, len) memcmp((addr1), (addr2), (len)) - -#ifdef AR6K_ALLOC_DEBUG -#define a_meminfo_add(p, s) __a_meminfo_add(p, s, __func__, __LINE) -void __a_meminfo_add(void *ptr, size_t msize, const char *func, int lineno); -void a_meminfo_del(void *ptr); -void* a_mem_alloc(size_t msize, int type, const char *func, int lineno); -void a_mem_free(void *ptr); -void a_meminfo_report(int clear); -A_BOOL a_meminfo_find(void *ptr); -#define A_MALLOC(size) a_mem_alloc((size), GFP_KERNEL, __func__, __LINE__) -#define A_MALLOC_NOWAIT(size) a_mem_alloc((size), GFP_ATOMIC, __func__, __LINE__) -#define A_FREE(addr) a_mem_free(addr) -#define A_NETIF_RX(skb) do { a_meminfo_del(skb); netif_rx(skb); } while (0) -#define A_NETIF_RX_NI(skb) do { a_meminfo_del(skb); netif_rx_ni(skb); } while (0) -#else -#define a_meminfo_report(_c) -#define A_MALLOC(size) kmalloc((size), GFP_KERNEL) -#define A_MALLOC_NOWAIT(size) kmalloc((size), GFP_ATOMIC) -#define A_FREE(addr) kfree(addr) -#define A_NETIF_RX(skb) netif_rx(skb) -#define A_NETIF_RX_NI(skb) netif_rx_ni(skb) -#endif - -#if defined(ANDROID_ENV) && defined(CONFIG_ANDROID_LOGGER) -extern unsigned int enablelogcat; -extern int android_logger_lv(void* module, int mask); -enum logidx { LOG_MAIN_IDX = 0 }; -extern int logger_write(const enum logidx idx, - const unsigned char prio, - const char __kernel * const tag, - const char __kernel * const fmt, - ...); -#define A_ANDROID_PRINTF(mask, module, tags, args...) do { \ - if (enablelogcat) \ - logger_write(LOG_MAIN_IDX, android_logger_lv(module, mask), tags, args); \ - else \ - printk(KERN_ALERT args); \ -} while (0) -#ifdef DEBUG -#define A_LOGGER_MODULE_NAME(x) #x -#define A_LOGGER(mask, mod, args...) \ - A_ANDROID_PRINTF(mask, &GET_ATH_MODULE_DEBUG_VAR_NAME(mod), "ar6k_" A_LOGGER_MODULE_NAME(mod), args); -#endif -#define A_PRINTF(args...) A_ANDROID_PRINTF(ATH_DEBUG_INFO, NULL, "ar6k_driver", args) -#else -#define A_LOGGER(mask, mod, args...) printk(KERN_ALERT args) -#define A_PRINTF(args...) printk(KERN_ALERT args) -#endif /* ANDROID */ -#define A_PRINTF_LOG(args...) printk(args) -#define A_SPRINTF(buf, args...) sprintf (buf, args) - -/* Mutual Exclusion */ -typedef spinlock_t A_MUTEX_T; -#define A_MUTEX_INIT(mutex) spin_lock_init(mutex) -#define A_MUTEX_LOCK(mutex) spin_lock_bh(mutex) -#define A_MUTEX_UNLOCK(mutex) spin_unlock_bh(mutex) -#define A_IS_MUTEX_VALID(mutex) TRUE /* okay to return true, since A_MUTEX_DELETE does nothing */ -#define A_MUTEX_DELETE(mutex) /* spin locks are not kernel resources so nothing to free.. */ - -/* Get current time in ms adding a constant offset (in ms) */ -#define A_GET_MS(offset) \ - (((jiffies / HZ) * 1000) + (offset)) - -/* - * Timer Functions - */ -#define A_MDELAY(msecs) mdelay(msecs) -typedef struct timer_list A_TIMER; - -#define A_INIT_TIMER(pTimer, pFunction, pArg) do { \ - init_timer(pTimer); \ - (pTimer)->function = (pFunction); \ - (pTimer)->data = (unsigned long)(pArg); \ -} while (0) - -/* - * Start a Timer that elapses after 'periodMSec' milli-seconds - * Support is provided for a one-shot timer. The 'repeatFlag' is - * ignored. - */ -#define A_TIMEOUT_MS(pTimer, periodMSec, repeatFlag) do { \ - if (repeatFlag) { \ - printk("\n" __FILE__ ":%d: Timer Repeat requested\n",__LINE__); \ - panic("Timer Repeat"); \ - } \ - mod_timer((pTimer), jiffies + HZ * (periodMSec) / 1000); \ -} while (0) - -/* - * Cancel the Timer. - */ -#define A_UNTIMEOUT(pTimer) do { \ - del_timer((pTimer)); \ -} while (0) - -#define A_DELETE_TIMER(pTimer) do { \ -} while (0) - -/* - * Wait Queue related functions - */ -typedef wait_queue_head_t A_WAITQUEUE_HEAD; -#define A_INIT_WAITQUEUE_HEAD(head) init_waitqueue_head(head) -#ifndef wait_event_interruptible_timeout -#define __wait_event_interruptible_timeout(wq, condition, ret) \ -do { \ - wait_queue_t __wait; \ - init_waitqueue_entry(&__wait, current); \ - \ - add_wait_queue(&wq, &__wait); \ - for (;;) { \ - set_current_state(TASK_INTERRUPTIBLE); \ - if (condition) \ - break; \ - if (!signal_pending(current)) { \ - ret = schedule_timeout(ret); \ - if (!ret) \ - break; \ - continue; \ - } \ - ret = -ERESTARTSYS; \ - break; \ - } \ - current->state = TASK_RUNNING; \ - remove_wait_queue(&wq, &__wait); \ -} while (0) - -#define wait_event_interruptible_timeout(wq, condition, timeout) \ -({ \ - long __ret = timeout; \ - if (!(condition)) \ - __wait_event_interruptible_timeout(wq, condition, __ret); \ - __ret; \ -}) -#endif /* wait_event_interruptible_timeout */ - -#define A_WAIT_EVENT_INTERRUPTIBLE_TIMEOUT(head, condition, timeout) do { \ - wait_event_interruptible_timeout(head, condition, timeout); \ -} while (0) - -#define A_WAKE_UP(head) wake_up(head) - -#ifdef DEBUG -extern unsigned int panic_on_assert; -#define A_ASSERT(expr) \ - if (!(expr)) { \ - printk(KERN_ALERT"Debug Assert Caught, File %s, Line: %d, Test:%s \n",__FILE__, __LINE__,#expr); \ - if (panic_on_assert) panic(#expr); \ - } -#else -#define A_ASSERT(expr) -#endif /* DEBUG */ - -#ifdef ANDROID_ENV -struct firmware; -int android_request_firmware(const struct firmware **firmware_p, const char *filename, - struct device *device); -void android_release_firmware(const struct firmware *firmware); -#define A_REQUEST_FIRMWARE(_ppf, _pfile, _dev) android_request_firmware(_ppf, _pfile, _dev) -#define A_RELEASE_FIRMWARE(_pf) android_release_firmware(_pf) -#else -#define A_REQUEST_FIRMWARE(_ppf, _pfile, _dev) request_firmware(_ppf, _pfile, _dev) -#define A_RELEASE_FIRMWARE(_pf) release_firmware(_pf) -#endif - -/* - * Initialization of the network buffer subsystem - */ -#define A_NETBUF_INIT() - -/* - * Network buffer queue support - */ -typedef struct sk_buff_head A_NETBUF_QUEUE_T; - -#define A_NETBUF_QUEUE_INIT(q) \ - a_netbuf_queue_init(q) - -#define A_NETBUF_ENQUEUE(q, pkt) \ - a_netbuf_enqueue((q), (pkt)) -#define A_NETBUF_PREQUEUE(q, pkt) \ - a_netbuf_prequeue((q), (pkt)) -#define A_NETBUF_DEQUEUE(q) \ - (a_netbuf_dequeue(q)) -#define A_NETBUF_QUEUE_SIZE(q) \ - a_netbuf_queue_size(q) -#define A_NETBUF_QUEUE_EMPTY(q) \ - a_netbuf_queue_empty(q) - -/* - * Network buffer support - */ -#ifdef AR6K_ALLOC_DEBUG -#define A_NETBUF_ALLOC(size) \ - a_netbuf_alloc(size, __func__, __LINE__) -#define A_NETBUF_ALLOC_RAW(size) \ - a_netbuf_alloc_raw(size, __func__, __LINE__) -#define A_NETBUF_CHECK(bufPtr) \ - a_netbuf_check(bufPtr, __func__, __LINE__) -#else -#define A_NETBUF_ALLOC(size) \ - a_netbuf_alloc(size) -#define A_NETBUF_ALLOC_RAW(size) \ - a_netbuf_alloc_raw(size) -#endif /* AR6K_ALLOC_DEBUG */ -#define A_NETBUF_FREE(bufPtr) \ - a_netbuf_free(bufPtr) -#define A_NETBUF_DATA(bufPtr) \ - a_netbuf_to_data(bufPtr) -#define A_NETBUF_LEN(bufPtr) \ - a_netbuf_to_len(bufPtr) -#define A_NETBUF_PUSH(bufPtr, len) \ - a_netbuf_push(bufPtr, len) -#define A_NETBUF_PUT(bufPtr, len) \ - a_netbuf_put(bufPtr, len) -#define A_NETBUF_TRIM(bufPtr,len) \ - a_netbuf_trim(bufPtr, len) -#define A_NETBUF_PULL(bufPtr, len) \ - a_netbuf_pull(bufPtr, len) -#define A_NETBUF_HEADROOM(bufPtr)\ - a_netbuf_headroom(bufPtr) -#define A_NETBUF_SETLEN(bufPtr,len) \ - a_netbuf_setlen(bufPtr, len) - -/* Add data to end of a buffer */ -#define A_NETBUF_PUT_DATA(bufPtr, srcPtr, len) \ - a_netbuf_put_data(bufPtr, srcPtr, len) - -/* Add data to start of the buffer */ -#define A_NETBUF_PUSH_DATA(bufPtr, srcPtr, len) \ - a_netbuf_push_data(bufPtr, srcPtr, len) - -/* Remove data at start of the buffer */ -#define A_NETBUF_PULL_DATA(bufPtr, dstPtr, len) \ - a_netbuf_pull_data(bufPtr, dstPtr, len) - -/* Remove data from the end of the buffer */ -#define A_NETBUF_TRIM_DATA(bufPtr, dstPtr, len) \ - a_netbuf_trim_data(bufPtr, dstPtr, len) - -/* View data as "size" contiguous bytes of type "t" */ -#define A_NETBUF_VIEW_DATA(bufPtr, t, size) \ - (t )( ((struct skbuf *)(bufPtr))->data) - -/* return the beginning of the headroom for the buffer */ -#define A_NETBUF_HEAD(bufPtr) \ - ((((struct sk_buff *)(bufPtr))->head)) - -/* - * OS specific network buffer access routines - */ -#ifdef AR6K_ALLOC_DEBUG -void *a_netbuf_alloc(int size, const char *func, int lineno); -void *a_netbuf_alloc_raw(int size, const char *func, int lineno); -void a_netbuf_check(void *bufPtr, const char *func, int lineno); -#else -void *a_netbuf_alloc(int size); -void *a_netbuf_alloc_raw(int size); -#endif -void a_netbuf_free(void *bufPtr); -void *a_netbuf_to_data(void *bufPtr); -A_UINT32 a_netbuf_to_len(void *bufPtr); -A_STATUS a_netbuf_push(void *bufPtr, A_INT32 len); -A_STATUS a_netbuf_push_data(void *bufPtr, char *srcPtr, A_INT32 len); -A_STATUS a_netbuf_put(void *bufPtr, A_INT32 len); -A_STATUS a_netbuf_put_data(void *bufPtr, char *srcPtr, A_INT32 len); -A_STATUS a_netbuf_pull(void *bufPtr, A_INT32 len); -A_STATUS a_netbuf_pull_data(void *bufPtr, char *dstPtr, A_INT32 len); -A_STATUS a_netbuf_trim(void *bufPtr, A_INT32 len); -A_STATUS a_netbuf_trim_data(void *bufPtr, char *dstPtr, A_INT32 len); -A_STATUS a_netbuf_setlen(void *bufPtr, A_INT32 len); -A_INT32 a_netbuf_headroom(void *bufPtr); -void a_netbuf_enqueue(A_NETBUF_QUEUE_T *q, void *pkt); -void a_netbuf_prequeue(A_NETBUF_QUEUE_T *q, void *pkt); -void *a_netbuf_dequeue(A_NETBUF_QUEUE_T *q); -int a_netbuf_queue_size(A_NETBUF_QUEUE_T *q); -int a_netbuf_queue_empty(A_NETBUF_QUEUE_T *q); -int a_netbuf_queue_empty(A_NETBUF_QUEUE_T *q); -void a_netbuf_queue_init(A_NETBUF_QUEUE_T *q); - -/* - * Kernel v.s User space functions - */ -A_UINT32 a_copy_to_user(void *to, const void *from, A_UINT32 n); -A_UINT32 a_copy_from_user(void *to, const void *from, A_UINT32 n); - -/* In linux, WLAN Rx and Tx run in different contexts, so no need to check - * for any commands/data queued for WLAN */ -#define A_CHECK_DRV_TX() - -#define A_GET_CACHE_LINE_BYTES() L1_CACHE_BYTES - -#define A_CACHE_LINE_PAD 128 - -static inline void *A_ALIGN_TO_CACHE_LINE(void *ptr) { - return (void *)L1_CACHE_ALIGN((unsigned long)ptr); -} - -#else /* __KERNEL__ */ - -#ifdef __GNUC__ -#define __ATTRIB_PACK __attribute__ ((packed)) -#define __ATTRIB_PRINTF __attribute__ ((format (printf, 1, 2))) -#define __ATTRIB_NORETURN __attribute__ ((noreturn)) -#ifndef INLINE -#define INLINE __inline__ -#endif -#else /* Not GCC */ -#define __ATTRIB_PACK -#define __ATTRIB_PRINTF -#define __ATTRIB_NORETURN -#ifndef INLINE -#define INLINE __inline -#endif -#endif /* End __GNUC__ */ - -#define PREPACK -#define POSTPACK __ATTRIB_PACK - -#define A_MEMCPY(dst, src, len) memcpy((dst), (src), (len)) -#define A_MEMZERO(addr, len) memset((addr), 0, (len)) -#define A_MEMCMP(addr1, addr2, len) memcmp((addr1), (addr2), (len)) -#define A_MALLOC(size) malloc(size) -#define A_FREE(addr) free(addr) - -#ifdef ANDROID -#ifndef err -#include -#define err(_s, args...) do { \ - fprintf(stderr, "%s: line %d ", __FILE__, __LINE__); \ - fprintf(stderr, args); fprintf(stderr, ": %d\n", errno); \ - exit(_s); } while (0) -#endif -#else -#include -#endif - -#endif /* __KERNEL__ */ - -#endif /* _OSAPI_LINUX_H_ */ diff --git a/drivers/net/wireless/ar6003/host/os/linux/include/wlan_config.h b/drivers/net/wireless/ar6003/host/os/linux/include/wlan_config.h deleted file mode 100644 index c38db55427ef..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/include/wlan_config.h +++ /dev/null @@ -1,146 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This file contains the tunable configuration items for the WLAN module -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _HOST_WLAN_CONFIG_H_ -#define _HOST_WLAN_CONFIG_H_ - -/* Include definitions here that can be used to tune the WLAN module behavior. - * Different customers can tune the behavior as per their needs, here. - */ - -/* This configuration item when defined will consider the barker preamble - * mentioned in the ERP IE of the beacons from the AP to determine the short - * preamble support sent in the (Re)Assoc request frames. - */ -#define WLAN_CONFIG_DONOT_IGNORE_BARKER_IN_ERP 0 - -/* This config item when defined will not send the power module state transition - * failure events that happen during scan, to the host. - */ -#define WLAN_CONFIG_IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN 0 - -/* This config item disables sending a DisAssoc frame prior to sending a - * DeAuth frame. - */ -#define WLAN_CONFIG_NO_DISASSOC_UPON_DEAUTH 0 - -/* - * This configuration item enable/disable keepalive support. - * Keepalive support: In the absence of any data traffic to AP, null - * frames will be sent to the AP at periodic interval, to keep the association - * active. This configuration item defines the periodic interval. - * Use value of zero to disable keepalive support - * Default: 60 seconds - */ -#define WLAN_CONFIG_KEEP_ALIVE_INTERVAL 60 - -/* - * This configuration item sets the value of disconnect timeout - * Firmware delays sending the disconnec event to the host for this - * timeout after is gets disconnected from the current AP. - * If the firmware successly roams within the disconnect timeout - * it sends a new connect event - */ -#ifdef ANDROID_ENV -#define WLAN_CONFIG_DISCONNECT_TIMEOUT 3 -#else -#define WLAN_CONFIG_DISCONNECT_TIMEOUT 10 -#endif /* ANDROID_ENV */ - -/* - * This configuration item enable BT clock sharing support - * 1 - Enable - * 0 - Disable (Default) - */ -#define WLAN_CONFIG_BT_SHARING 0 - -/* - * This configuration item sets WIFI OFF policy - * 0 - CUT_POWER - * 1 - DEEP_SLEEP (Default) - */ -#define WLAN_CONFIG_WLAN_OFF 1 - -/* - * This configuration item disables 11n support. - * 0 - Enable - * 1 - Disable - */ -#define WLAN_CONFIG_DISABLE_11N 0 - -/* - * This configuration item sets suspend policy - * 0 - CUT_POWER (Default) - * 1 - DEEP_SLEEP - * 2 - WoW - * 3 - CUT_POWER if BT OFF (clock sharing designs only) - */ -#define WLAN_CONFIG_PM_SUSPEND 0 - -/* - * This configuration item sets suspend policy to use if PM_SUSPEND is - * set to WoW and device is not connected at the time of suspend - * 0 - CUT_POWER (Default) - * 1 - DEEP_SLEEP - * 2 - WoW - * 3 - CUT_POWER if BT OFF (clock sharing designs only) - */ -#define WLAN_CONFIG_PM_WOW2 0 - -/* - * Define GPIO number for WoW in your platform other than zero - * Wake lock will be called when GPIO asserted. - */ -#define PLAT_WOW_GPIO_PIN 0 - -/* - * This configuration item for the WOW patterns in AP mode - * 0 - Wake up host only if any unicast IP, EAPOL-like and ARP, broadcast dhcp and ARP packets. (default) - * 1 - Wake up host if any unicast/broadcast/multicast packets - */ -#define WLAN_CONFIG_SIMPLE_WOW_AP_MODE 0 - -/* - * Define the GPIO number for WLAN CHIP_PWD PIN other than zero - * Only use when you define plat_setup_power as plat_setup_power_stub - */ - -#define PLAT_WLAN_CHIP_PWD_PIN 1 - -/* - * Platform specific function to power ON/OFF AR6000 with CHIP_PWD PIN - * and enable/disable SDIO card detection - * - * Either implement wlan CHIP_PWD PIN and power GPIO control into - * plat_setup_power_stub(..) place holder in ar6000_pm.c - * or redefine plat_setup_power(..) into your export funciton. - */ - -#if PLAT_WLAN_CHIP_PWD_PIN -extern void plat_setup_power_stub(struct ar6_softc *ar, int on, int detect); -#define plat_setup_power(ar, on, detect) plat_setup_power_stub(ar, on, detect) -#else -#define plat_setup_power(ar, on, detect) /* define as your function */ -#endif - -#endif /* _HOST_WLAN_CONFIG_H_ */ diff --git a/drivers/net/wireless/ar6003/host/os/linux/include/wmi_filter_linux.h b/drivers/net/wireless/ar6003/host/os/linux/include/wmi_filter_linux.h deleted file mode 100644 index 2c52f6d79484..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/include/wmi_filter_linux.h +++ /dev/null @@ -1,346 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -#ifndef _WMI_FILTER_LINUX_H_ -#define _WMI_FILTER_LINUX_H_ - -/* - * sioctl_filter - Standard ioctl - * pioctl_filter - Priv ioctl - * xioctl_filter - eXtended ioctl - * - * ---- Possible values for the WMI filter --------------- - * (0) - Block this cmd always (or) not implemented - * (INFRA_NETWORK) - Allow this cmd only in STA mode - * (ADHOC_NETWORK) - Allow this cmd only in IBSS mode - * (AP_NETWORK) - Allow this cmd only in AP mode - * (INFRA_NETWORK | ADHOC_NETWORK) - Block this cmd in AP mode - * (ADHOC_NETWORK | AP_NETWORK) - Block this cmd in STA mode - * (INFRA_NETWORK | AP_NETWORK) - Block this cmd in IBSS mode - * (INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK)- allow only when mode is set - * (0xFF) - Allow this cmd always irrespective of mode - */ - -A_UINT8 sioctl_filter[] = { -(AP_NETWORK), /* SIOCSIWCOMMIT 0x8B00 */ -(0xFF), /* SIOCGIWNAME 0x8B01 */ -(0), /* SIOCSIWNWID 0x8B02 */ -(0), /* SIOCGIWNWID 0x8B03 */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* SIOCSIWFREQ 0x8B04 */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* SIOCGIWFREQ 0x8B05 */ -(0xFF), /* SIOCSIWMODE 0x8B06 */ -(0xFF), /* SIOCGIWMODE 0x8B07 */ -(0), /* SIOCSIWSENS 0x8B08 */ -(0), /* SIOCGIWSENS 0x8B09 */ -(0), /* SIOCSIWRANGE 0x8B0A */ -(0xFF), /* SIOCGIWRANGE 0x8B0B */ -(0), /* SIOCSIWPRIV 0x8B0C */ -(0), /* SIOCGIWPRIV 0x8B0D */ -(0), /* SIOCSIWSTATS 0x8B0E */ -(0), /* SIOCGIWSTATS 0x8B0F */ -(0), /* SIOCSIWSPY 0x8B10 */ -(0), /* SIOCGIWSPY 0x8B11 */ -(0), /* SIOCSIWTHRSPY 0x8B12 */ -(0), /* SIOCGIWTHRSPY 0x8B13 */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* SIOCSIWAP 0x8B14 */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* SIOCGIWAP 0x8B15 */ -#if (WIRELESS_EXT >= 18) -(INFRA_NETWORK | ADHOC_NETWORK), /* SIOCSIWMLME 0X8B16 */ -#else -(0), /* Dummy 0 */ -#endif /* WIRELESS_EXT */ -(0), /* SIOCGIWAPLIST 0x8B17 */ -(INFRA_NETWORK | ADHOC_NETWORK), /* SIOCSIWSCAN 0x8B18 */ -(INFRA_NETWORK | ADHOC_NETWORK), /* SIOCGIWSCAN 0x8B19 */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* SIOCSIWESSID 0x8B1A */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* SIOCGIWESSID 0x8B1B */ -(0), /* SIOCSIWNICKN 0x8B1C */ -(0), /* SIOCGIWNICKN 0x8B1D */ -(0), /* Dummy 0 */ -(0), /* Dummy 0 */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* SIOCSIWRATE 0x8B20 */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* SIOCGIWRATE 0x8B21 */ -(0), /* SIOCSIWRTS 0x8B22 */ -(0), /* SIOCGIWRTS 0x8B23 */ -(0), /* SIOCSIWFRAG 0x8B24 */ -(0), /* SIOCGIWFRAG 0x8B25 */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* SIOCSIWTXPOW 0x8B26 */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* SIOCGIWTXPOW 0x8B27 */ -(INFRA_NETWORK | ADHOC_NETWORK), /* SIOCSIWRETRY 0x8B28 */ -(INFRA_NETWORK | ADHOC_NETWORK), /* SIOCGIWRETRY 0x8B29 */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* SIOCSIWENCODE 0x8B2A */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* SIOCGIWENCODE 0x8B2B */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* SIOCSIWPOWER 0x8B2C */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* SIOCGIWPOWER 0x8B2D */ -}; - - - -A_UINT8 pioctl_filter[] = { -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* IEEE80211_IOCTL_SETPARAM (SIOCIWFIRSTPRIV+0) */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* IEEE80211_IOCTL_SETKEY (SIOCIWFIRSTPRIV+1) */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* IEEE80211_IOCTL_DELKEY (SIOCIWFIRSTPRIV+2) */ -(AP_NETWORK), /* IEEE80211_IOCTL_SETMLME (SIOCIWFIRSTPRIV+3) */ -(INFRA_NETWORK), /* IEEE80211_IOCTL_ADDPMKID (SIOCIWFIRSTPRIV+4) */ -(0), /* IEEE80211_IOCTL_SETOPTIE (SIOCIWFIRSTPRIV+5) */ -(0), /* (SIOCIWFIRSTPRIV+6) */ -(0), /* (SIOCIWFIRSTPRIV+7) */ -(0), /* (SIOCIWFIRSTPRIV+8) */ -(0), /* (SIOCIWFIRSTPRIV+9) */ -(0), /* IEEE80211_IOCTL_LASTONE (SIOCIWFIRSTPRIV+10) */ -(0xFF), /* AR6000_IOCTL_WMI_GETREV (SIOCIWFIRSTPRIV+11) */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_IOCTL_WMI_SETPWR (SIOCIWFIRSTPRIV+12) */ -(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_IOCTL_WMI_SETSCAN (SIOCIWFIRSTPRIV+13) */ -(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_IOCTL_WMI_SETLISTENINT (SIOCIWFIRSTPRIV+14) */ -(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_IOCTL_WMI_SETBSSFILTER (SIOCIWFIRSTPRIV+15) */ -(INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_IOCTL_WMI_SET_CHANNELPARAMS (SIOCIWFIRSTPRIV+16) */ -(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_IOCTL_WMI_SET_PROBEDSSID (SIOCIWFIRSTPRIV+17) */ -(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_IOCTL_WMI_SET_PMPARAMS (SIOCIWFIRSTPRIV+18) */ -(INFRA_NETWORK), /* AR6000_IOCTL_WMI_SET_BADAP (SIOCIWFIRSTPRIV+19) */ -(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_IOCTL_WMI_GET_QOS_QUEUE (SIOCIWFIRSTPRIV+20) */ -(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_IOCTL_WMI_CREATE_QOS (SIOCIWFIRSTPRIV+21) */ -(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_IOCTL_WMI_DELETE_QOS (SIOCIWFIRSTPRIV+22) */ -(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_IOCTL_WMI_SET_SNRTHRESHOLD (SIOCIWFIRSTPRIV+23) */ -(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_IOCTL_WMI_SET_ERROR_REPORT_BITMASK (SIOCIWFIRSTPRIV+24)*/ -(0xFF), /* AR6000_IOCTL_WMI_GET_TARGET_STATS (SIOCIWFIRSTPRIV+25) */ -(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_IOCTL_WMI_SET_ASSOC_INFO (SIOCIWFIRSTPRIV+26) */ -(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_IOCTL_WMI_SET_ACCESS_PARAMS (SIOCIWFIRSTPRIV+27) */ -(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_IOCTL_WMI_SET_BMISS_TIME (SIOCIWFIRSTPRIV+28) */ -(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_IOCTL_WMI_SET_DISC_TIMEOUT (SIOCIWFIRSTPRIV+29) */ -(ADHOC_NETWORK), /* AR6000_IOCTL_WMI_SET_IBSS_PM_CAPS (SIOCIWFIRSTPRIV+30) */ -}; - -/* Submode for the sake of filtering XIOCTLs are broadly set to 2 types. - * P2P Submode & Non-P2P submode. IOCLT cmds can be marked to be valid only in - * P2P Submode or Non-P2P submode or both. The bits- b5,b6,b7 are used to encode - * this information in the IOCTL filters. The LSBits b0-b4 are used to encode - * the mode information. - */ -#define XIOCTL_FILTER_P2P_SUBMODE 0x20 -#define XIOCTL_FILTER_NONP2P_SUBMODE 0x40 -#define XIOCTL_FILTER_SUBMODE_DONTCARE \ - (XIOCTL_FILTER_P2P_SUBMODE | XIOCTL_FILTER_NONP2P_SUBMODE) - -A_UINT8 xioctl_filter[] = { -(0xFF), /* Dummy 0 */ -(0xFF), /* AR6000_XIOCTL_BMI_DONE 1 */ -(0xFF), /* AR6000_XIOCTL_BMI_READ_MEMORY 2 */ -(0xFF), /* AR6000_XIOCTL_BMI_WRITE_MEMORY 3 */ -(0xFF), /* AR6000_XIOCTL_BMI_EXECUTE 4 */ -(0xFF), /* AR6000_XIOCTL_BMI_SET_APP_START 5 */ -(0xFF), /* AR6000_XIOCTL_BMI_READ_SOC_REGISTER 6 */ -(0xFF), /* AR6000_XIOCTL_BMI_WRITE_SOC_REGISTER 7 */ -(0xFF), /* AR6000_XIOCTL_BMI_TEST 8 */ -(0xFF), /* AR6000_XIOCTL_UNUSED9 9 */ -(0xFF), /* AR6000_XIOCTL_UNUSED10 10 */ -(0xFF), /* AR6000_XIOCTL_UNUSED11 11 */ -(0xFF), /* AR6000_XIOCTL_FORCE_TARGET_RESET 12 */ -(0xFF), /* AR6000_XIOCTL_HTC_RAW_OPEN 13 */ -(0xFF), /* AR6000_XIOCTL_HTC_RAW_CLOSE 14 */ -(0xFF), /* AR6000_XIOCTL_HTC_RAW_READ 15 */ -(0xFF), /* AR6000_XIOCTL_HTC_RAW_WRITE 16 */ -(0xFF), /* AR6000_XIOCTL_CHECK_TARGET_READY 17 */ -(0xFF), /* AR6000_XIOCTL_GPIO_OUTPUT_SET 18 */ -(0xFF), /* AR6000_XIOCTL_GPIO_INPUT_GET 19 */ -(0xFF), /* AR6000_XIOCTL_GPIO_REGISTER_SET 20 */ -(0xFF), /* AR6000_XIOCTL_GPIO_REGISTER_GET 21 */ -(0xFF), /* AR6000_XIOCTL_GPIO_INTR_ACK 22 */ -(0xFF), /* AR6000_XIOCTL_GPIO_INTR_WAIT 23 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_SET_ADHOC_BSSID 24 */ -(0x00), /*AR6000_XIOCTL_UNUSED 25 */ -(0x00), /*AR6000_XIOCTL_UNUSED 26 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_SET_BEACON_INTVAL 27 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* IEEE80211_IOCTL_SETAUTHALG 28 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_SET_VOICE_PKT_SIZE 29 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_SET_MAX_SP 30 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_GET_ROAM_TBL 31 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_ROAM_CTRL 32 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTRL_WMI_SET_POWERSAVE_TIMERS 33 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTRL_WMI_GET_POWER_MODE 34 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTRL_WMI_SET_WLAN_STATE 35 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_GET_ROAM_DATA 36 */ -(0xFF), /* AR6000_XIOCTL_WMI_SETRETRYLIMITS 37 */ -(0xFF), /* AR6000_XIOCTL_TCMD_CONT_TX 38 */ -(0xFF), /* AR6000_XIOCTL_TCMD_CONT_RX 39 */ -(0xFF), /* AR6000_XIOCTL_TCMD_PM 40 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_STARTSCAN 41 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_SETFIXRATES 42 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_GETFIXRATES 43 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_RSSITHRESHOLD 44 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_CLR_RSSISNR 45 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_LQTHRESHOLD 46 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_SET_RTS 47 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_SET_LPREAMBLE 48 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_SET_AUTHMODE 49 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_REASSOCMODE 50 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_SET_WMM 51 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_HB_CHALLENGE_RESP_PARAMS 52 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_GET_HB_CHALLENGE_RESP 53 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_GET_RD 54 */ -(0xFF), /* AR6000_XIOCTL_DIAG_READ 55 */ -(0xFF), /* AR6000_XIOCTL_DIAG_WRITE 56 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_TXOP 57 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK), /* AR6000_XIOCTL_USER_SETKEYS 58 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK), /* AR6000_XIOCTL_WMI_SET_KEEPALIVE 59 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK), /* AR6000_XIOCTL_WMI_GET_KEEPALIVE 60 */ -(0xFF), /* AR6000_XIOCTL_BMI_ROMPATCH_INSTALL 61 */ -(0xFF), /* AR6000_XIOCTL_BMI_ROMPATCH_UNINSTALL 62 */ -(0xFF), /* AR6000_XIOCTL_BMI_ROMPATCH_ACTIVATE 63 */ -(0xFF), /* AR6000_XIOCTL_BMI_ROMPATCH_DEACTIVATE 64 */ -(0xFF), /* AR6000_XIOCTL_WMI_SET_APPIE 65 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | 0x1F), /* AR6000_XIOCTL_WMI_SET_MGMT_FRM_RX_FILTER 66 */ -(0xFF), /* AR6000_XIOCTL_DBGLOG_CFG_MODULE 67 */ -(0xFF), /* AR6000_XIOCTL_DBGLOG_GET_DEBUG_LOGS 68 */ -(0xFF), /* Dummy 69 */ -(0xFF), /* AR6000_XIOCTL_WMI_SET_WSC_STATUS 70 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_BT_STATUS 71 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_BT_PARAMS 72 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_SET_HOST_SLEEP_MODE 73 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_SET_WOW_MODE 74 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_GET_WOW_LIST 75 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_ADD_WOW_PATTERN 76 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_DEL_WOW_PATTERN 77 */ -(0xFF), /* AR6000_XIOCTL_TARGET_INFO 78 */ -(0xFF), /* AR6000_XIOCTL_DUMP_HTC_CREDIT_STATE 79 */ -(0xFF), /* AR6000_XIOCTL_TRAFFIC_ACTIVITY_CHANGE 80 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_CONNECT_CTRL_FLAGS 81 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_AKMP_PARAMS 82 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_GET_PMKID_LIST 83 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_PMKID_LIST 84 */ -(0xFF), /* Dummy 85 */ -(0xFF), /* Dummy 86 */ -(0xFF), /* Dummy 87 */ -(0xFF), /* Dummy 88 */ -(0xFF), /* Dummy 89 */ -(0xFF), /* AR6000_XIOCTL_UNUSED90 90 */ -(0xFF), /* AR6000_XIOCTL_BMI_LZ_STREAM_START 91 */ -(0xFF), /* AR6000_XIOCTL_BMI_LZ_DATA 92 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_PROF_CFG 93 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_PROF_ADDR_SET 94 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_PROF_START 95 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_PROF_STOP 96 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_PROF_COUNT_GET 97 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_ABORT_SCAN 98 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_GET_STA_LIST 99 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | AP_NETWORK), /* AR6000_XIOCTL_AP_HIDDEN_SSID 100 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_SET_NUM_STA 101 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_SET_ACL_MAC 102 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_GET_ACL_LIST 103 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_COMMIT_CONFIG 104 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* IEEE80211_IOCTL_GETWPAIE 105 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_CONN_INACT_TIME 106 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_PROT_SCAN_TIME 107 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_WMI_SET_COUNTRY 108 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_SET_DTIM 109 */ -(0xFF), /* AR6000_XIOCTL_WMI_TARGET_EVENT_REPORT 110 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_SET_IP 111 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_SET_ACL_POLICY 112 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_CTRL_BSS_COMM 113 */ -(0xFF), /* AR6000_XIOCTL_DUMP_MODULE_DEBUG_INFO 114 */ -(0xFF), /* AR6000_XIOCTL_MODULE_DEBUG_SET_MASK 115 */ -(0xFF), /* AR6000_XIOCTL_MODULE_DEBUG_GET_MASK 116 */ -(0xFF), /* AR6000_XIOCTL_DUMP_RCV_AGGR_STATS 117 */ -(0xFF), /* AR6000_XIOCTL_SET_HT_CAP 118 */ -(0xFF), /* AR6000_XIOCTL_SET_HT_OP 119 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_GET_STAT 120 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | 0x1F), /* AR6000_XIOCTL_SET_TX_SELECT_RATES 121 */ -(0xFF), /* AR6000_XIOCTL_SETUP_AGGR 122 */ -(0xFF), /* AR6000_XIOCTL_ALLOW_AGGR 123 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | AP_NETWORK), /* AR6000_XIOCTL_AP_GET_HIDDEN_SSID 124 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_GET_COUNTRY 125 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_GET_WMODE 126 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_GET_DTIM 127 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_AP_GET_BINTVL 128 */ -(0xFF), /* AR6000_XIOCTL_AP_GET_RTS 129 */ -(0xFF), /* AR6000_XIOCTL_DELE_AGGR 130 */ -(0xFF), /* AR6000_XIOCTL_FETCH_TARGET_REGS 131 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | 0x1F), /* AR6000_XIOCTL_HCI_CMD 132 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | 0x1F), /* AR6000_XIOCTL_ACL_DATA 133 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | 0x1F), /* AR6000_XIOCTL_WLAN_CONN_PRECEDENCE 134 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | AP_NETWORK), /* AR6000_XIOCTL_AP_SET_11BG_RATESET 135 */ -(0xFF), -(0xFF), -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_SET_BTCOEX_FE_ANT 138 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_SET_BTCOEX_COLOCATED_BT_DEV 139 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG 140 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_SET_BTCOEX_SCO_CONFIG 141 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_SET_BTCOEX_A2DP_CONFIG 142 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_SET_BTCOEX_ACLCOEX_CONFIG 143 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_SET_BTCOEX_DEBUG 144 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_SET_BT_OPERATING_STATUS 145 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_GET_BTCOEX_CONFIG 146 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_GET_BTCOEX_GET_STATS 147 */ -(0xFF), /* AR6000_XIOCTL_WMI_SET_QOS_SUPP 148 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_SET_DFS 149 */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* P2P CMDS BEGIN AR6000_XIOCTL_WMI_P2P_DISCOVER 150 */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_STOP_FIND */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_CANCEL */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_LISTEN */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_GO_NEG */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_AUTH_GO_NEG */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_REJECT */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_CONFIG */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_WPS_CONFIG */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_FINDNODE */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_GRP_INIT 160 */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_GRP_FORMATION_DONE */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_INVITE */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_PROV_DISC */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_SET */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_PEER */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_FLUSH */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_GET_GO_PARAMS */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_AUTH_INVITE */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_GET_IF_ADDR */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_GET_DEV_ADDR 170 */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_P2P_SDPD_TX_CMD */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOTCL_WMI_P2P_SD_CANCEL_REQUEST */ -(0xFF), /* AR6000_XIOCTL_SET_BT_HW_POWER_STATE 173 */ -(0xFF), /* AR6000_XIOCTL_GET_BT_HW_POWER_STATE 174 */ -(0xFF), /* AR6000_XIOCTL_GET_WLAN_SLEEP_STATE 175 */ -(0xFF), /* AR6000_XIOCTL_WMI_SET_TX_SGI_PARAM 176 */ -(0xFF), /* R6000_XIOCTL_WMI_ENABLE_WAC_PARAM 177 */ -(0xFF), /* AR6000_XIOCTL_WAC_SCAN_REPLY 178 */ -(0xFF), /* AR6000_XIOCTL_WMI_WAC_CTRL_REQ 179 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_WPA_OFFLOAD_STATE 180 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_PASSPHRASE 181 */ -(0xFF), /* AR6000_XIOCTL_BMI_NVRAM_PROCESS 182 */ -(0xFF), /* AR6000_XIOCTL_WMI_SET_DIVERSITY_PARAM 183 */ -(0xFF), /* AR6000_XIOCTL_WMI_FORCE_ASSERT 184 */ -(0xFF), /* AR6000_XIOCTL_WMI_ENABLE_PKTLOG 185 */ -(0xFF), /* AR6000_XIOCTL_WMI_DISABLE_PKTLOG 186 */ -(0xFF), /* AR6000_XIOCTL_WMI_GET_PKTLOG 187 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | AP_NETWORK), /* AR6000_XIOCTL_AP_ACS_DISABLE_HI_CHANNELS 188 */ -(0xFF), /* AR6000_XIOCTL_TCMD_CMDS 189 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_EXCESS_TX_RETRY_THRES 190 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_AP_GET_NUM_STA 191 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | 0x1F), /* AR6000_XIOCTL_SUSPEND_DRIVER 192 */ -(XIOCTL_FILTER_NONP2P_SUBMODE | 0x1F), /* AR6000_XIOCTL_RESUME_DRIVER 193 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | INFRA_NETWORK | ADHOC_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_GET_SUBMODE 194 */ -(XIOCTL_FILTER_SUBMODE_DONTCARE | AP_NETWORK), /* AR6000_XIOCTL_WMI_AP_APSD 195 */ -(0xFF), /* AR6000_XIOCTL_TCMD_SETREG 196 */ -(0xFF), /* AR6000_XIOCTL_GET_HT_CAP 197 */ -(XIOCTL_FILTER_P2P_SUBMODE | INFRA_NETWORK | AP_NETWORK), /* AR6000_XIOCTL_WMI_GET_P2P_IE 198 */ -}; - -#endif /*_WMI_FILTER_LINUX_H_*/ diff --git a/drivers/net/wireless/ar6003/host/os/linux/ioctl.c b/drivers/net/wireless/ar6003/host/os/linux/ioctl.c deleted file mode 100644 index f507446d938e..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/ioctl.c +++ /dev/null @@ -1,5611 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -#include "ar6000_drv.h" -#include "a_drv_api.h" -#include "ieee80211_ioctl.h" -#include "ar6kap_common.h" -#include "targaddrs.h" -#include "a_hci.h" -#include "wlan_config.h" -#include "wac_defs.h" -#ifdef P2P -#include "p2p_api.h" -#endif /* P2P */ - -extern int enablerssicompensation; -A_UINT32 tcmdRxFreq; -extern unsigned int wmitimeout; -extern int tspecCompliance; -extern int bmienable; -extern int bypasswmi; -extern int loghci; - -static int -ar6000_ioctl_get_roam_tbl(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if(wmi_get_roam_tbl_cmd(arPriv->arWmi) != A_OK) { - return -EIO; - } - - return 0; -} - -static int -ar6000_ioctl_get_roam_data(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - /* currently assume only roam times are required */ - if(wmi_get_roam_data_cmd(arPriv->arWmi, ROAM_DATA_TIME) != A_OK) { - return -EIO; - } - - - return 0; -} - -static int -ar6000_ioctl_set_roam_ctrl(struct net_device *dev, char *userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_ROAM_CTRL_CMD cmd; - A_UINT8 size = sizeof(cmd); - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, userdata, size)) { - return -EFAULT; - } - - if (cmd.roamCtrlType == WMI_SET_HOST_BIAS) { - if (cmd.info.bssBiasInfo.numBss > 1) { - size += (cmd.info.bssBiasInfo.numBss - 1) * sizeof(WMI_BSS_BIAS); - } - } - - if (copy_from_user(&cmd, userdata, size)) { - return -EFAULT; - } - - if(wmi_set_roam_ctrl_cmd(arPriv->arWmi, &cmd, size) != A_OK) { - return -EIO; - } - - return 0; -} - -static int -ar6000_ioctl_set_powersave_timers(struct net_device *dev, char *userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_POWERSAVE_TIMERS_POLICY_CMD cmd; - A_UINT8 size = sizeof(cmd); - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (copy_from_user(&cmd, userdata, size)) { - return -EFAULT; - } - - if (copy_from_user(&cmd, userdata, size)) { - return -EFAULT; - } - - if(wmi_set_powersave_timers_cmd(arPriv->arWmi, &cmd, size) != A_OK) { - return -EIO; - } - - return 0; -} - -static int -ar6000_ioctl_set_qos_supp(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_QOS_SUPP_CMD cmd; - A_STATUS ret; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (copy_from_user(&cmd, (char *)((unsigned int*)rq->ifr_data + 1), - sizeof(cmd))) - { - return -EFAULT; - } - - ret = wmi_set_qos_supp_cmd(arPriv->arWmi, cmd.status); - - switch (ret) { - case A_OK: - return 0; - case A_EBUSY : - return -EBUSY; - case A_NO_MEMORY: - return -ENOMEM; - case A_EINVAL: - default: - return -EFAULT; - } -} - -static int -ar6000_ioctl_set_wmm(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_WMM_CMD cmd; - A_STATUS ret; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (copy_from_user(&cmd, (char *)((unsigned int*)rq->ifr_data + 1), - sizeof(cmd))) - { - return -EFAULT; - } - - if (cmd.status == WMI_WMM_ENABLED) { - arPriv->arWmmEnabled = TRUE; - } else { - arPriv->arWmmEnabled = FALSE; - } - - ret = wmi_set_wmm_cmd(arPriv->arWmi, cmd.status); - - switch (ret) { - case A_OK: - return 0; - case A_EBUSY : - return -EBUSY; - case A_NO_MEMORY: - return -ENOMEM; - case A_EINVAL: - default: - return -EFAULT; - } -} - -static int -ar6000_ioctl_set_txop(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_WMM_TXOP_CMD cmd; - A_STATUS ret; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (copy_from_user(&cmd, (char *)((unsigned int*)rq->ifr_data + 1), - sizeof(cmd))) - { - return -EFAULT; - } - - ret = wmi_set_wmm_txop(arPriv->arWmi, cmd.txopEnable); - - switch (ret) { - case A_OK: - return 0; - case A_EBUSY : - return -EBUSY; - case A_NO_MEMORY: - return -ENOMEM; - case A_EINVAL: - default: - return -EFAULT; - } -} - -static int -ar6000_ioctl_get_rd(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - A_STATUS ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if(copy_to_user((char *)((unsigned int*)rq->ifr_data + 1), - &arPriv->arRegCode, sizeof(arPriv->arRegCode))) - ret = -EFAULT; - - return ret; -} - -static int -ar6000_ioctl_set_country(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_AP_SET_COUNTRY_CMD cmd; - A_STATUS ret; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (copy_from_user(&cmd, (char *)((unsigned int*)rq->ifr_data + 1), - sizeof(cmd))) - { - return -EFAULT; - } - - arPriv->ap_profile_flag = 1; /* There is a change in profile */ - - ret = wmi_set_country(arPriv->arWmi, cmd.countryCode); - A_MEMCPY(arPriv->arAp.ap_country_code, cmd.countryCode, 3); - - switch (ret) { - case A_OK: - return 0; - case A_EBUSY : - return -EBUSY; - case A_NO_MEMORY: - return -ENOMEM; - case A_EINVAL: - default: - return -EFAULT; - } -} - - -/* Get power mode command */ -static int -ar6000_ioctl_get_power_mode(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_POWER_MODE_CMD power_mode; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - power_mode.powerMode = wmi_get_power_mode_cmd(arPriv->arWmi); - if (copy_to_user(rq->ifr_data, &power_mode, sizeof(WMI_POWER_MODE_CMD))) { - ret = -EFAULT; - } - - return ret; -} - - -static int -ar6000_ioctl_set_channelParams(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_CHANNEL_PARAMS_CMD cmd, *cmdp; - int ret = 0; - int i = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_DEV_T *arTempPriv = NULL; - - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) { - return -EFAULT; - } - - if( (arPriv->arNextMode == AP_NETWORK) && (cmd.numChannels || cmd.scanParam) ) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ERROR: Only wmode is allowed in AP mode\n")); - return -EIO; - } - - if (cmd.numChannels > 1) { - cmdp = A_MALLOC(130); - if (copy_from_user(cmdp, rq->ifr_data, - sizeof (*cmdp) + - ((cmd.numChannels - 1) * sizeof(A_UINT16)))) - { - A_FREE(cmdp); - return -EFAULT; - } - } else { - cmdp = &cmd; - } - - if ((arPriv->arPhyCapability == WMI_11NG_CAPABILITY) && - ((cmdp->phyMode == WMI_11A_MODE) || (cmdp->phyMode == WMI_11AG_MODE))) - { - ret = -EINVAL; - } - - for(i = 0;i < ar->arConfNumDev;i++){ - arTempPriv = ar->arDev[i]; - if (arTempPriv != arPriv){ - if (((arTempPriv->phymode == WMI_11A_MODE) && (cmdp->phyMode != WMI_11A_MODE)) || (((arTempPriv->phymode != WMI_11A_MODE) && arTempPriv->phymode != WMI_11AG_MODE ) && (cmdp->phyMode == WMI_11A_MODE))){ - ret = -EINVAL; - break; - } - } - - } - if (!ret && - (wmi_set_channelParams_cmd(arPriv->arWmi, cmdp->scanParam, cmdp->phyMode, - cmdp->numChannels, cmdp->channelList) - != A_OK)) - { - ret = -EIO; - } - - if (!ret) - arPriv->phymode = cmdp->phyMode; - - if (cmd.numChannels > 1) { - A_FREE(cmdp); - } - - /* Set the profile change flag to allow a commit cmd */ - if (!ret) - arPriv->ap_profile_flag = 1; - - return ret; -} - - -static int -ar6000_ioctl_set_snr_threshold(struct net_device *dev, struct ifreq *rq) -{ - - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SNR_THRESHOLD_PARAMS_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) { - return -EFAULT; - } - - if( wmi_set_snr_threshold_params(arPriv->arWmi, &cmd) != A_OK ) { - ret = -EIO; - } - - return ret; -} - -static int -ar6000_ioctl_set_rssi_threshold(struct net_device *dev, struct ifreq *rq) -{ -#define SWAP_THOLD(thold1, thold2) do { \ - USER_RSSI_THOLD tmpThold; \ - tmpThold.tag = thold1.tag; \ - tmpThold.rssi = thold1.rssi; \ - thold1.tag = thold2.tag; \ - thold1.rssi = thold2.rssi; \ - thold2.tag = tmpThold.tag; \ - thold2.rssi = tmpThold.rssi; \ -} while (0) - - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - AR_SOFTC_T *ar = arPriv->arSoftc; - WMI_RSSI_THRESHOLD_PARAMS_CMD cmd; - USER_RSSI_PARAMS rssiParams; - A_INT32 i, j; - int ret = 0; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user((char *)&rssiParams, (char *)((unsigned int *)rq->ifr_data + 1), sizeof(USER_RSSI_PARAMS))) { - return -EFAULT; - } - cmd.weight = rssiParams.weight; - cmd.pollTime = rssiParams.pollTime; - - A_MEMCPY(arSta->rssi_map, &rssiParams.tholds, sizeof(arSta->rssi_map)); - /* - * only 6 elements, so use bubble sorting, in ascending order - */ - for (i = 5; i > 0; i--) { - for (j = 0; j < i; j++) { /* above tholds */ - if (arSta->rssi_map[j+1].rssi < arSta->rssi_map[j].rssi) { - SWAP_THOLD(arSta->rssi_map[j+1], arSta->rssi_map[j]); - } else if (arSta->rssi_map[j+1].rssi == arSta->rssi_map[j].rssi) { - return EFAULT; - } - } - } - for (i = 11; i > 6; i--) { - for (j = 6; j < i; j++) { /* below tholds */ - if (arSta->rssi_map[j+1].rssi < arSta->rssi_map[j].rssi) { - SWAP_THOLD(arSta->rssi_map[j+1], arSta->rssi_map[j]); - } else if (arSta->rssi_map[j+1].rssi == arSta->rssi_map[j].rssi) { - return EFAULT; - } - } - } - -#ifdef DEBUG - for (i = 0; i < 12; i++) { - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("thold[%d].tag: %d, thold[%d].rssi: %d \n", - i, arSta->rssi_map[i].tag, i, arSta->rssi_map[i].rssi)); - } -#endif - - if (enablerssicompensation) { - for (i = 0; i < 6; i++) - arSta->rssi_map[i].rssi = rssi_compensation_reverse_calc(arPriv, arSta->rssi_map[i].rssi, TRUE); - for (i = 6; i < 12; i++) - arSta->rssi_map[i].rssi = rssi_compensation_reverse_calc(arPriv, arSta->rssi_map[i].rssi, FALSE); - } - - cmd.thresholdAbove1_Val = arSta->rssi_map[0].rssi; - cmd.thresholdAbove2_Val = arSta->rssi_map[1].rssi; - cmd.thresholdAbove3_Val = arSta->rssi_map[2].rssi; - cmd.thresholdAbove4_Val = arSta->rssi_map[3].rssi; - cmd.thresholdAbove5_Val = arSta->rssi_map[4].rssi; - cmd.thresholdAbove6_Val = arSta->rssi_map[5].rssi; - cmd.thresholdBelow1_Val = arSta->rssi_map[6].rssi; - cmd.thresholdBelow2_Val = arSta->rssi_map[7].rssi; - cmd.thresholdBelow3_Val = arSta->rssi_map[8].rssi; - cmd.thresholdBelow4_Val = arSta->rssi_map[9].rssi; - cmd.thresholdBelow5_Val = arSta->rssi_map[10].rssi; - cmd.thresholdBelow6_Val = arSta->rssi_map[11].rssi; - - if( wmi_set_rssi_threshold_params(arPriv->arWmi, &cmd) != A_OK ) { - ret = -EIO; - } - - return ret; -} - -static int -ar6000_ioctl_set_lq_threshold(struct net_device *dev, struct ifreq *rq) -{ - - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_LQ_THRESHOLD_PARAMS_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, (char *)((unsigned int *)rq->ifr_data + 1), sizeof(cmd))) { - return -EFAULT; - } - - if( wmi_set_lq_threshold_params(arPriv->arWmi, &cmd) != A_OK ) { - ret = -EIO; - } - - return ret; -} - - -static int -ar6000_ioctl_set_probedSsid(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_PROBED_SSID_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_probedSsid_cmd(arPriv->arWmi, cmd.entryIndex, cmd.flag, cmd.ssidLength, - cmd.ssid) != A_OK) - { - ret = -EIO; - } - - return ret; -} - -static int -ar6000_ioctl_set_badAp(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_ADD_BAD_AP_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) { - return -EFAULT; - } - - if (cmd.badApIndex > WMI_MAX_BAD_AP_INDEX) { - return -EIO; - } - - if (A_MEMCMP(cmd.bssid, null_mac, AR6000_ETH_ADDR_LEN) == 0) { - /* - * This is a delete badAP. - */ - if (wmi_deleteBadAp_cmd(arPriv->arWmi, cmd.badApIndex) != A_OK) { - ret = -EIO; - } - } else { - if (wmi_addBadAp_cmd(arPriv->arWmi, cmd.badApIndex, cmd.bssid) != A_OK) { - ret = -EIO; - } - } - - return ret; -} - -static int -ar6000_ioctl_create_qos(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_CREATE_PSTREAM_CMD cmd; - A_STATUS ret; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - - if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) { - return -EFAULT; - } - - ret = wmi_verify_tspec_params(&cmd, tspecCompliance); - if (ret == A_OK) - ret = wmi_create_pstream_cmd(arPriv->arWmi, &cmd); - - switch (ret) { - case A_OK: - return 0; - case A_EBUSY : - return -EBUSY; - case A_NO_MEMORY: - return -ENOMEM; - case A_EINVAL: - default: - return -EFAULT; - } -} - -static int -ar6000_ioctl_delete_qos(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_DELETE_PSTREAM_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) { - return -EFAULT; - } - - ret = wmi_delete_pstream_cmd(arPriv->arWmi, cmd.trafficClass, cmd.tsid); - - switch (ret) { - case A_OK: - return 0; - case A_EBUSY : - return -EBUSY; - case A_NO_MEMORY: - return -ENOMEM; - case A_EINVAL: - default: - return -EFAULT; - } -} - -static int -ar6000_ioctl_get_qos_queue(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - struct ar6000_queuereq qreq; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if( copy_from_user(&qreq, rq->ifr_data, - sizeof(struct ar6000_queuereq))) - return -EFAULT; - - qreq.activeTsids = wmi_get_mapped_qos_queue(arPriv->arWmi, qreq.trafficClass); - - if (copy_to_user(rq->ifr_data, &qreq, - sizeof(struct ar6000_queuereq))) - { - ret = -EFAULT; - } - - return ret; -} - -#ifdef CONFIG_HOST_TCMD_SUPPORT -static A_STATUS -ar6000_ioctl_tcmd_cmd_resp(struct net_device *dev, struct ifreq *rq, A_UINT8 *data, A_UINT32 len) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - A_UINT8 buf[4+TC_CMDS_SIZE_MAX]; - int ret = 0; - - if (ar->bIsDestroyProgress) { - return -EBUSY; - } - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (down_interruptible(&ar->arSem)) { - return -ERESTARTSYS; - } - - if (ar->bIsDestroyProgress) { - up(&ar->arSem); - return -EBUSY; - } - - ar->tcmdRxReport = 0; - if (wmi_test_cmd(arPriv->arWmi, data, len) != A_OK) { - up(&ar->arSem); - return -EIO; - } - - wait_event_interruptible_timeout(arPriv->arEvent, ar->tcmdRxReport != 0, wmitimeout * HZ); - - if (signal_pending(current)) { - ret = -EINTR; - } - - *(A_UINT16*)&(buf[0]) = ar->tcmdResp.len; - buf[2] = ar->tcmdResp.ver; - A_MEMCPY((buf+4), ar->tcmdResp.buf, sizeof(ar->tcmdResp.buf)); - - if (!ret && copy_to_user(rq->ifr_data, buf, sizeof(buf))) { - ret = -EFAULT; - } - - up(&ar->arSem); - - return ret; -} - -static A_STATUS -ar6000_ioctl_tcmd_get_rx_report(struct net_device *dev, - struct ifreq *rq, A_UINT8 *data, A_UINT32 len) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - A_UINT32 buf[4+TCMD_MAX_RATES]; - int ret = 0; - - if (ar->bIsDestroyProgress) { - return -EBUSY; - } - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (down_interruptible(&ar->arSem)) { - return -ERESTARTSYS; - } - - if (ar->bIsDestroyProgress) { - up(&ar->arSem); - return -EBUSY; - } - - ar->tcmdRxReport = 0; - if (wmi_test_cmd(arPriv->arWmi, data, len) != A_OK) { - up(&ar->arSem); - return -EIO; - } - - wait_event_interruptible_timeout(arPriv->arEvent, ar->tcmdRxReport != 0, wmitimeout * HZ); - - if (signal_pending(current)) { - ret = -EINTR; - } - - buf[0] = ar->tcmdRxTotalPkt; - buf[1] = ar->tcmdRxRssi; - buf[2] = ar->tcmdRxcrcErrPkt; - buf[3] = ar->tcmdRxsecErrPkt; - A_MEMCPY(((A_UCHAR *)buf)+(4*sizeof(A_UINT32)), ar->tcmdRateCnt, sizeof(ar->tcmdRateCnt)); - A_MEMCPY(((A_UCHAR *)buf)+(4*sizeof(A_UINT32))+(TCMD_MAX_RATES *sizeof(A_UINT16)), ar->tcmdRateCntShortGuard, sizeof(ar->tcmdRateCntShortGuard)); - - if (!ret && copy_to_user(rq->ifr_data, buf, sizeof(buf))) { - ret = -EFAULT; - } - - up(&ar->arSem); - - return ret; -} - -void -ar6000_tcmd_rx_report_event(AR_SOFTC_DEV_T *arPriv, A_UINT8 * results, int len) -{ - - AR_SOFTC_T *ar = arPriv->arSoftc; - TCMD_CONT_RX * rx_rep = (TCMD_CONT_RX *)results; - - if (TC_CMD_RESP == rx_rep->act) { - TC_CMDS *tCmd = (TC_CMDS *)results; - ar->tcmdResp.len = tCmd->hdr.u.parm.length; - ar->tcmdResp.ver = tCmd->hdr.u.parm.version; - A_MEMZERO(ar->tcmdResp.buf, sizeof(ar->tcmdResp.buf)); - A_MEMCPY(ar->tcmdResp.buf, tCmd->buf, sizeof(ar->tcmdResp.buf)); - ar->tcmdRxReport = 1; - } - else { /*(rx_rep->act == TCMD_CONT_RX_REPORT) */ - if (enablerssicompensation) { - rx_rep->u.report.rssiInDBm = rssi_compensation_calc_tcmd(ar, tcmdRxFreq, rx_rep->u.report.rssiInDBm,rx_rep->u.report.totalPkt); - } - - - ar->tcmdRxTotalPkt = rx_rep->u.report.totalPkt; - ar->tcmdRxRssi = rx_rep->u.report.rssiInDBm; - ar->tcmdRxcrcErrPkt = rx_rep->u.report.crcErrPkt; - ar->tcmdRxsecErrPkt = rx_rep->u.report.secErrPkt; - ar->tcmdRxReport = 1; - A_MEMZERO(ar->tcmdRateCnt, sizeof(ar->tcmdRateCnt)); - A_MEMZERO(ar->tcmdRateCntShortGuard, sizeof(ar->tcmdRateCntShortGuard)); - A_MEMCPY(ar->tcmdRateCnt, rx_rep->u.report.rateCnt, sizeof(ar->tcmdRateCnt)); - A_MEMCPY(ar->tcmdRateCntShortGuard, rx_rep->u.report.rateCntShortGuard, sizeof(ar->tcmdRateCntShortGuard)); - } - - wake_up(&arPriv->arEvent); -} -#endif /* CONFIG_HOST_TCMD_SUPPORT*/ - -static int -ar6000_ioctl_set_error_report_bitmask(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_TARGET_ERROR_REPORT_BITMASK cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) { - return -EFAULT; - } - - ret = wmi_set_error_report_bitmask(arPriv->arWmi, cmd.bitmask); - - return (ret==0 ? ret : -EINVAL); -} - -static int -ar6000_clear_target_stats(struct net_device *dev) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - TARGET_STATS *pStats = &arPriv->arTargetStats; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - AR6000_SPIN_LOCK(&arPriv->arPrivLock, 0); - A_MEMZERO(pStats, sizeof(TARGET_STATS)); - AR6000_SPIN_UNLOCK(&arPriv->arPrivLock, 0); - return ret; -} - -static int -ar6000_ioctl_get_target_stats(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - TARGET_STATS_CMD cmd; - TARGET_STATS *pStats = &arPriv->arTargetStats; - int ret = 0; - - if (ar->bIsDestroyProgress) { - return -EBUSY; - } - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) { - return -EFAULT; - } - if (down_interruptible(&ar->arSem)) { - return -ERESTARTSYS; - } - if (ar->bIsDestroyProgress) { - up(&ar->arSem); - return -EBUSY; - } - - arPriv->statsUpdatePending = TRUE; - - if(wmi_get_stats_cmd(arPriv->arWmi) != A_OK) { - up(&ar->arSem); - return -EIO; - } - - wait_event_interruptible_timeout(arPriv->arEvent, arPriv->statsUpdatePending == FALSE, wmitimeout * HZ); - - if (signal_pending(current)) { - ret = -EINTR; - } - - if (!ret && copy_to_user(rq->ifr_data, pStats, sizeof(*pStats))) { - ret = -EFAULT; - } - - if (cmd.clearStats == 1) { - ret = ar6000_clear_target_stats(dev); - } - - up(&ar->arSem); - - a_meminfo_report(FALSE); - - return ret; -} - -static int -ar6000_ioctl_get_ap_stats(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - A_UINT32 action; /* Allocating only the desired space on the frame. Declaring is as a WMI_AP_MODE_STAT variable results in exceeding the compiler imposed limit on the maximum frame size */ - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - WMI_PER_STA_STAT *pStats = ar->arAPStats; - WMI_AP_MODE_STAT ret_stat; - A_UINT8 i, j=0; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (copy_from_user(&action, (char *)((unsigned int*)rq->ifr_data + 1), - sizeof(A_UINT32))) - { - return -EFAULT; - } - if (action == AP_CLEAR_STATS) { - AR6000_SPIN_LOCK(&ar->arLock, 0); - for(i = 0; i < NUM_CONN; i++) { - if(ar->connTbl[i].arPriv == arPriv) { - pStats[i].tx_bytes = 0; - pStats[i].tx_pkts = 0; - pStats[i].tx_error = 0; - pStats[i].tx_discard = 0; - pStats[i].rx_bytes = 0; - pStats[i].rx_pkts = 0; - pStats[i].rx_error = 0; - pStats[i].rx_discard = 0; - } - } - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - return ret; - } - - if (down_interruptible(&ar->arSem)) { - return -ERESTARTSYS; - } - - arPriv->statsUpdatePending = TRUE; - - if(wmi_get_stats_cmd(arPriv->arWmi) != A_OK) { - up(&ar->arSem); - return -EIO; - } - - wait_event_interruptible_timeout(arPriv->arEvent, arPriv->statsUpdatePending == FALSE, wmitimeout * HZ); - - if (signal_pending(current)) { - ret = -EINTR; - } - - A_MEMZERO(&ret_stat, sizeof(ret_stat)); - for(i = 0; i < NUM_CONN; i++) { - if(ar->connTbl[i].arPriv == arPriv) { - ret_stat.sta[j].aid = pStats[i].aid; - ret_stat.sta[j].tx_bytes = pStats[i].tx_bytes; - ret_stat.sta[j].tx_pkts = pStats[i].tx_pkts; - ret_stat.sta[j].tx_error = pStats[i].tx_error; - ret_stat.sta[j].tx_discard = pStats[i].tx_discard; - ret_stat.sta[j].rx_bytes = pStats[i].rx_bytes; - ret_stat.sta[j].rx_pkts = pStats[i].rx_pkts; - ret_stat.sta[j].rx_error = pStats[i].rx_error; - ret_stat.sta[j].rx_discard = pStats[i].rx_discard; - j++; - } - } - - if (!ret && copy_to_user(rq->ifr_data, &ret_stat, sizeof(ret_stat))) { - ret = -EFAULT; - } - - up(&ar->arSem); - - return ret; -} - -static int -ar6000_ioctl_set_access_params(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_ACCESS_PARAMS_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_set_access_params_cmd(arPriv->arWmi, cmd.ac, cmd.txop, cmd.eCWmin, cmd.eCWmax, - cmd.aifsn) == A_OK) - { - ret = 0; - } else { - ret = -EINVAL; - } - - return (ret); -} - -static int -ar6000_ioctl_set_disconnect_timeout(struct net_device *dev, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_DISC_TIMEOUT_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_disctimeout_cmd(arPriv->arWmi, cmd.disconnectTimeout) == A_OK) - { - ret = 0; - } else { - ret = -EINVAL; - } - - return (ret); -} - -static int -ar6000_xioctl_set_voice_pkt_size(struct net_device *dev, char * userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_VOICE_PKT_SIZE_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_set_voice_pkt_size_cmd(arPriv->arWmi, cmd.voicePktSize) == A_OK) - { - ret = 0; - } else { - ret = -EINVAL; - } - - - return (ret); -} - -static int -ar6000_xioctl_set_max_sp_len(struct net_device *dev, char * userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_MAX_SP_LEN_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_set_max_sp_len_cmd(arPriv->arWmi, cmd.maxSPLen) == A_OK) - { - ret = 0; - } else { - ret = -EINVAL; - } - - return (ret); -} - - -static int -ar6000_xioctl_set_bt_status_cmd(struct net_device *dev, char * userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_BT_STATUS_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_set_bt_status_cmd(arPriv->arWmi, cmd.streamType, cmd.status) == A_OK) - { - ret = 0; - } else { - ret = -EINVAL; - } - - return (ret); -} - -static int -ar6000_xioctl_set_bt_params_cmd(struct net_device *dev, char * userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_BT_PARAMS_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_set_bt_params_cmd(arPriv->arWmi, &cmd) == A_OK) - { - ret = 0; - } else { - ret = -EINVAL; - } - - return (ret); -} - -static int -ar6000_xioctl_set_btcoex_fe_ant_cmd(struct net_device * dev, char * userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_BTCOEX_FE_ANT_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_set_btcoex_fe_ant_cmd(arPriv->arWmi, &cmd) == A_OK) - { - ret = 0; - } else { - ret = -EINVAL; - } - - return(ret); -} - -static int -ar6000_xioctl_set_btcoex_colocated_bt_dev_cmd(struct net_device * dev, char * userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_set_btcoex_colocated_bt_dev_cmd(arPriv->arWmi, &cmd) == A_OK) - { - ret = 0; - } else { - ret = -EINVAL; - } - - return(ret); -} - -static int -ar6000_xioctl_set_btcoex_btinquiry_page_config_cmd(struct net_device * dev, char * userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_set_btcoex_btinquiry_page_config_cmd(arPriv->arWmi, &cmd) == A_OK) - { - ret = 0; - } else { - ret = -EINVAL; - } - - return(ret); -} - -static int -ar6000_xioctl_set_btcoex_sco_config_cmd(struct net_device * dev, char * userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_BTCOEX_SCO_CONFIG_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_set_btcoex_sco_config_cmd(arPriv->arWmi, &cmd) == A_OK) - { - ret = 0; - } else { - ret = -EINVAL; - } - - return(ret); -} - -static int -ar6000_xioctl_set_btcoex_a2dp_config_cmd(struct net_device * dev, - char * userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_BTCOEX_A2DP_CONFIG_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_set_btcoex_a2dp_config_cmd(arPriv->arWmi, &cmd) == A_OK) - { - ret = 0; - } else { - ret = -EINVAL; - } - - return(ret); -} - -static int -ar6000_xioctl_set_btcoex_aclcoex_config_cmd(struct net_device * dev, char * userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_set_btcoex_aclcoex_config_cmd(arPriv->arWmi, &cmd) == A_OK) - { - ret = 0; - } else { - ret = -EINVAL; - } - - return(ret); -} - -static int -ar60000_xioctl_set_btcoex_debug_cmd(struct net_device * dev, char * userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_BTCOEX_DEBUG_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_set_btcoex_debug_cmd(arPriv->arWmi, &cmd) == A_OK) - { - ret = 0; - } else { - ret = -EINVAL; - } - - return(ret); -} - -static int -ar6000_xioctl_set_btcoex_bt_operating_status_cmd(struct net_device * dev, char * userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMD cmd; - int ret = 0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - - if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_set_btcoex_bt_operating_status_cmd(arPriv->arWmi, &cmd) == A_OK) - { - ret = 0; - } else { - ret = -EINVAL; - } - return(ret); -} - -static int -ar6000_xioctl_get_btcoex_config_cmd(struct net_device * dev, char * userdata, - struct ifreq *rq) -{ - - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - AR6000_BTCOEX_CONFIG btcoexConfig; - WMI_BTCOEX_CONFIG_EVENT *pbtcoexConfigEv = &arPriv->arBtcoexConfig; - - int ret = 0; - - if (ar->bIsDestroyProgress) { - return -EBUSY; - } - if (ar->arWmiReady == FALSE) { - return -EIO; - } - if (copy_from_user(&btcoexConfig.configCmd, userdata, sizeof(AR6000_BTCOEX_CONFIG))) { - return -EFAULT; - } - if (down_interruptible(&ar->arSem)) { - return -ERESTARTSYS; - } - - if (wmi_get_btcoex_config_cmd(arPriv->arWmi, (WMI_GET_BTCOEX_CONFIG_CMD *)&btcoexConfig.configCmd) != A_OK) - { - up(&ar->arSem); - return -EIO; - } - - arPriv->statsUpdatePending = TRUE; - - wait_event_interruptible_timeout(arPriv->arEvent, arPriv->statsUpdatePending == FALSE, wmitimeout * HZ); - - if (signal_pending(current)) { - ret = -EINTR; - } - - if (!ret && copy_to_user(btcoexConfig.configEvent, pbtcoexConfigEv, sizeof(WMI_BTCOEX_CONFIG_EVENT))) { - ret = -EFAULT; - } - up(&ar->arSem); - return ret; -} - -static int -ar6000_xioctl_get_btcoex_stats_cmd(struct net_device * dev, char * userdata, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - AR6000_BTCOEX_STATS btcoexStats; - WMI_BTCOEX_STATS_EVENT *pbtcoexStats = &arPriv->arBtcoexStats; - int ret = 0; - - if (ar->bIsDestroyProgress) { - return -EBUSY; - } - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (down_interruptible(&ar->arSem)) { - return -ERESTARTSYS; - } - - if (copy_from_user(&btcoexStats.statsEvent, userdata, sizeof(AR6000_BTCOEX_CONFIG))) { - return -EFAULT; - } - - if (wmi_get_btcoex_stats_cmd(arPriv->arWmi) != A_OK) - { - up(&ar->arSem); - return -EIO; - } - - arPriv->statsUpdatePending = TRUE; - - wait_event_interruptible_timeout(arPriv->arEvent, arPriv->statsUpdatePending == FALSE, wmitimeout * HZ); - - if (signal_pending(current)) { - ret = -EINTR; - } - - if (!ret && copy_to_user(btcoexStats.statsEvent, pbtcoexStats, sizeof(WMI_BTCOEX_STATS_EVENT))) { - ret = -EFAULT; - } - - - up(&ar->arSem); - - return(ret); -} - -static int -ar6000_xioctl_set_excess_tx_retry_thres_cmd(struct net_device * dev, char * userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - WMI_SET_EXCESS_TX_RETRY_THRES_CMD cmd; - int ret = 0; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_set_excess_tx_retry_thres_cmd(arPriv->arWmi, &cmd) != A_OK) - { - ret = -EINVAL; - } - return(ret); -} - -static int -ar6000_xioctl_wac_ctrl_req_get_cmd(struct net_device * dev, char * userdata, struct ifreq *rq) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - WMI_WAC_CTRL_REQ_CMD cmd; - int ret = 0; - - if (ar->bIsDestroyProgress) { - return -EBUSY; - } - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (down_interruptible(&ar->arSem)) { - return -ERESTARTSYS; - } - - if (copy_from_user(&cmd, userdata, sizeof(WMI_WAC_CTRL_REQ_CMD))) { - return -EFAULT; - } - - if (wmi_wac_ctrl_req_cmd(arPriv->arWmi, &cmd) != A_OK) - { - up(&ar->arSem); - return -EIO; - } - - arPriv->statsUpdatePending = TRUE; - - wait_event_interruptible_timeout(arPriv->arEvent, arPriv->statsUpdatePending == FALSE, wmitimeout * HZ); - - if (signal_pending(current)) { - ret = -EINTR; - } - - if (!ret && copy_to_user(rq->ifr_data, &arPriv->wacInfo, sizeof(WMI_GET_WAC_INFO))) { - ret = -EFAULT; - } - - up(&ar->arSem); - - return(ret); -} - -static int -ar6000_xioctl_set_passphrase_cmd(struct net_device * dev, char * userdata) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - WMI_SET_PASSPHRASE_CMD cmd; - int ret = 0; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - return -EFAULT; - } - - if (wmi_set_passphrase_cmd(arPriv->arWmi, &cmd) == A_OK) - { - /* enable WPA offload */ - arSta->arConnectCtrlFlags |= CONNECT_DO_WPA_OFFLOAD; - ret = 0; - } else { - ret = -EINVAL; - } - return(ret); -} - -#ifdef CONFIG_HOST_GPIO_SUPPORT -struct ar6000_gpio_intr_wait_cmd_s gpio_intr_results; -/* gpio_reg_results and gpio_data_available are protected by arSem */ -static struct ar6000_gpio_register_cmd_s gpio_reg_results; -static A_BOOL gpio_data_available; /* Requested GPIO data available */ -static A_BOOL gpio_intr_available; /* GPIO interrupt info available */ -static A_BOOL gpio_ack_received; /* GPIO ack was received */ - -/* Host-side initialization for General Purpose I/O support */ -void ar6000_gpio_init(void) -{ - gpio_intr_available = FALSE; - gpio_data_available = FALSE; - gpio_ack_received = FALSE; -} - -/* - * Called when a GPIO interrupt is received from the Target. - * intr_values shows which GPIO pins have interrupted. - * input_values shows a recent value of GPIO pins. - */ -void -ar6000_gpio_intr_rx(AR_SOFTC_DEV_T *arPriv, A_UINT32 intr_mask, A_UINT32 input_values) -{ - gpio_intr_results.intr_mask = intr_mask; - gpio_intr_results.input_values = input_values; - *((volatile A_BOOL *)&gpio_intr_available) = TRUE; - wake_up(&arPriv->arEvent); -} - -/* - * This is called when a response is received from the Target - * for a previous or ar6000_gpio_input_get or ar6000_gpio_register_get - * call. - */ -void -ar6000_gpio_data_rx(AR_SOFTC_DEV_T *arPriv, A_UINT32 reg_id, A_UINT32 value) -{ - gpio_reg_results.gpioreg_id = reg_id; - gpio_reg_results.value = value; - *((volatile A_BOOL *)&gpio_data_available) = TRUE; - wake_up(&arPriv->arEvent); -} - -/* - * This is called when an acknowledgement is received from the Target - * for a previous or ar6000_gpio_output_set or ar6000_gpio_register_set - * call. - */ -void -ar6000_gpio_ack_rx(AR_SOFTC_DEV_T *arPriv) -{ - gpio_ack_received = TRUE; - wake_up(&arPriv->arEvent); -} - -A_STATUS -ar6000_gpio_output_set(struct net_device *dev, - A_UINT32 set_mask, - A_UINT32 clear_mask, - A_UINT32 enable_mask, - A_UINT32 disable_mask) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - - gpio_ack_received = FALSE; - return wmi_gpio_output_set(arPriv->arWmi, - set_mask, clear_mask, enable_mask, disable_mask); -} - -static A_STATUS -ar6000_gpio_input_get(struct net_device *dev) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - - *((volatile A_BOOL *)&gpio_data_available) = FALSE; - return wmi_gpio_input_get(arPriv->arWmi); -} - -static A_STATUS -ar6000_gpio_register_set(struct net_device *dev, - A_UINT32 gpioreg_id, - A_UINT32 value) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - - gpio_ack_received = FALSE; - return wmi_gpio_register_set(arPriv->arWmi, gpioreg_id, value); -} - -static A_STATUS -ar6000_gpio_register_get(struct net_device *dev, - A_UINT32 gpioreg_id) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - - *((volatile A_BOOL *)&gpio_data_available) = FALSE; - return wmi_gpio_register_get(arPriv->arWmi, gpioreg_id); -} - -static A_STATUS -ar6000_gpio_intr_ack(struct net_device *dev, - A_UINT32 ack_mask) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - - gpio_intr_available = FALSE; - return wmi_gpio_intr_ack(arPriv->arWmi, ack_mask); -} -#endif /* CONFIG_HOST_GPIO_SUPPORT */ - -#if defined(CONFIG_TARGET_PROFILE_SUPPORT) -static struct prof_count_s prof_count_results; -static A_BOOL prof_count_available; /* Requested GPIO data available */ - -static A_STATUS -prof_count_get(struct net_device *dev) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - - *((volatile A_BOOL *)&prof_count_available) = FALSE; - return wmi_prof_count_get_cmd(arPriv->arWmi); -} - -/* - * This is called when a response is received from the Target - * for a previous prof_count_get call. - */ -void -prof_count_rx(A_UINT32 addr, A_UINT32 count) -{ - prof_count_results.addr = addr; - prof_count_results.count = count; - *((volatile A_BOOL *)&prof_count_available) = TRUE; - wake_up(&arEvent); -} -#endif /* CONFIG_TARGET_PROFILE_SUPPORT */ - - -static A_STATUS -ar6000_create_acl_data_osbuf(struct net_device *dev, A_UINT8 *userdata, void **p_osbuf) -{ - void *osbuf = NULL; - A_UINT8 tmp_space[8]; - HCI_ACL_DATA_PKT *acl; - A_UINT8 hdr_size, *datap=NULL; - A_STATUS ret = A_OK; - - /* ACL is in data path. There is a need to create pool - * mechanism for allocating and freeing NETBUFs - ToDo later. - */ - - *p_osbuf = NULL; - acl = (HCI_ACL_DATA_PKT *)tmp_space; - hdr_size = sizeof(acl->hdl_and_flags) + sizeof(acl->data_len); - - do { - if (a_copy_from_user(acl, userdata, hdr_size)) { - ret = A_EFAULT; - break; - } - - osbuf = A_NETBUF_ALLOC(hdr_size + acl->data_len); - if (osbuf == NULL) { - ret = A_NO_MEMORY; - break; - } - A_NETBUF_PUT(osbuf, hdr_size + acl->data_len); - datap = (A_UINT8 *)A_NETBUF_DATA(osbuf); - - /* Real copy to osbuf */ - acl = (HCI_ACL_DATA_PKT *)(datap); - A_MEMCPY(acl, tmp_space, hdr_size); - if (a_copy_from_user(acl->data, userdata + hdr_size, acl->data_len)) { - ret = A_EFAULT; - break; - } - } while(FALSE); - - if (ret == A_OK) { - *p_osbuf = osbuf; - } else { - A_NETBUF_FREE(osbuf); - } - return ret; -} - - - -int -ar6000_ioctl_ap_setparam(AR_SOFTC_DEV_T *arPriv, int param, int value) -{ - int ret=0; - - switch(param) { - case IEEE80211_PARAM_WPA: - switch (value) { - case WPA_MODE_WPA1: - arPriv->arAuthMode = WMI_WPA_AUTH; - break; - case WPA_MODE_WPA2: - arPriv->arAuthMode = WMI_WPA2_AUTH; - break; - case WPA_MODE_AUTO: - arPriv->arAuthMode = WMI_WPA_AUTH | WMI_WPA2_AUTH; - break; - case WPA_MODE_NONE: - arPriv->arAuthMode = WMI_NONE_AUTH; - break; - } - break; - case IEEE80211_PARAM_AUTHMODE: - if(value == IEEE80211_AUTH_WPA_PSK) { - if (WMI_WPA_AUTH == arPriv->arAuthMode) { - arPriv->arAuthMode = WMI_WPA_PSK_AUTH; - } else if (WMI_WPA2_AUTH == arPriv->arAuthMode) { - arPriv->arAuthMode = WMI_WPA2_PSK_AUTH; - } else if ((WMI_WPA_AUTH | WMI_WPA2_AUTH) == arPriv->arAuthMode) { - arPriv->arAuthMode = WMI_WPA_PSK_AUTH | WMI_WPA2_PSK_AUTH; - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Error - Setting PSK "\ - "mode when WPA param was set to %d\n", - arPriv->arAuthMode)); - ret = -EIO; - } - } - break; - case IEEE80211_PARAM_UCASTCIPHER: - arPriv->arPairwiseCrypto = 0; - if(value & (1<arPairwiseCrypto |= AES_CRYPT; - } - if(value & (1<arPairwiseCrypto |= TKIP_CRYPT; - } - if(!arPriv->arPairwiseCrypto) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("Error - Invalid cipher in WPA \n")); - ret = -EIO; - } - break; - case IEEE80211_PARAM_PRIVACY: - if(value == 0) { - arPriv->arDot11AuthMode = OPEN_AUTH; - arPriv->arAuthMode = WMI_NONE_AUTH; - arPriv->arPairwiseCrypto = NONE_CRYPT; - arPriv->arPairwiseCryptoLen = 0; - arPriv->arGroupCrypto = NONE_CRYPT; - arPriv->arGroupCryptoLen = 0; - } - break; -#ifdef WAPI_ENABLE - case IEEE80211_PARAM_WAPI: - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("WAPI Policy: %d\n", value)); - arPriv->arDot11AuthMode = OPEN_AUTH; - arPriv->arAuthMode = WMI_NONE_AUTH; - if(value & 0x1) { - arPriv->arPairwiseCrypto = WAPI_CRYPT; - arPriv->arGroupCrypto = WAPI_CRYPT; - } else { - arPriv->arPairwiseCrypto = NONE_CRYPT; - arPriv->arGroupCrypto = NONE_CRYPT; - } - break; -#endif - } - return ret; -} - -int -ar6000_ioctl_setparam(AR_SOFTC_DEV_T *arPriv, int param, int value) -{ - A_BOOL profChanged = FALSE; - int ret=0; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if(arPriv->arNextMode == AP_NETWORK) { - arPriv->ap_profile_flag = 1; /* There is a change in profile */ - switch (param) { - case IEEE80211_PARAM_WPA: - case IEEE80211_PARAM_AUTHMODE: - case IEEE80211_PARAM_UCASTCIPHER: - case IEEE80211_PARAM_PRIVACY: - case IEEE80211_PARAM_WAPI: - ret = ar6000_ioctl_ap_setparam(arPriv, param, value); - return ret; - } - } - - switch (param) { - case IEEE80211_PARAM_WPA: - switch (value) { - case WPA_MODE_WPA1: - arPriv->arAuthMode = WMI_WPA_AUTH; - profChanged = TRUE; - break; - case WPA_MODE_WPA2: - arPriv->arAuthMode = WMI_WPA2_AUTH; - profChanged = TRUE; - break; - case WPA_MODE_NONE: - arPriv->arAuthMode = WMI_NONE_AUTH; - profChanged = TRUE; - break; - } - break; - case IEEE80211_PARAM_AUTHMODE: - switch(value) { - case IEEE80211_AUTH_WPA_PSK: - if (WMI_WPA_AUTH == arPriv->arAuthMode) { - arPriv->arAuthMode = WMI_WPA_PSK_AUTH; - profChanged = TRUE; - } else if (WMI_WPA2_AUTH == arPriv->arAuthMode) { - arPriv->arAuthMode = WMI_WPA2_PSK_AUTH; - profChanged = TRUE; - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Error - Setting PSK "\ - "mode when WPA param was set to %d\n", - arPriv->arAuthMode)); - ret = -EIO; - } - break; - case IEEE80211_AUTH_WPA_CCKM: - if (WMI_WPA2_AUTH == arPriv->arAuthMode) { - arPriv->arAuthMode = WMI_WPA2_AUTH_CCKM; - } else { - arPriv->arAuthMode = WMI_WPA_AUTH_CCKM; - } - break; - default: - break; - } - break; - case IEEE80211_PARAM_UCASTCIPHER: - switch (value) { - case IEEE80211_CIPHER_AES_CCM: - arPriv->arPairwiseCrypto = AES_CRYPT; - profChanged = TRUE; - break; - case IEEE80211_CIPHER_TKIP: - arPriv->arPairwiseCrypto = TKIP_CRYPT; - profChanged = TRUE; - break; - case IEEE80211_CIPHER_WEP: - arPriv->arPairwiseCrypto = WEP_CRYPT; - profChanged = TRUE; - break; - case IEEE80211_CIPHER_NONE: - arPriv->arPairwiseCrypto = NONE_CRYPT; - profChanged = TRUE; - break; - } - break; - case IEEE80211_PARAM_UCASTKEYLEN: - if (!IEEE80211_IS_VALID_WEP_CIPHER_LEN(value)) { - ret = -EIO; - } else { - arPriv->arPairwiseCryptoLen = value; - } - break; - case IEEE80211_PARAM_MCASTCIPHER: - switch (value) { - case IEEE80211_CIPHER_AES_CCM: - arPriv->arGroupCrypto = AES_CRYPT; - profChanged = TRUE; - break; - case IEEE80211_CIPHER_TKIP: - arPriv->arGroupCrypto = TKIP_CRYPT; - profChanged = TRUE; - break; - case IEEE80211_CIPHER_WEP: - arPriv->arGroupCrypto = WEP_CRYPT; - profChanged = TRUE; - break; - case IEEE80211_CIPHER_NONE: - arPriv->arGroupCrypto = NONE_CRYPT; - profChanged = TRUE; - break; - } - break; - case IEEE80211_PARAM_MCASTKEYLEN: - if (!IEEE80211_IS_VALID_WEP_CIPHER_LEN(value)) { - ret = -EIO; - } else { - arPriv->arGroupCryptoLen = value; - } - break; - case IEEE80211_PARAM_COUNTERMEASURES: - if (ar->arWmiReady == FALSE) { - return -EIO; - } - wmi_set_tkip_countermeasures_cmd(arPriv->arWmi, value); - break; - default: - break; - } - if ((arPriv->arNextMode != AP_NETWORK) && (profChanged == TRUE)) { - /* - * profile has changed. Erase ssid to signal change - */ - A_MEMZERO(arPriv->arSsid, sizeof(arPriv->arSsid)); - } - - return ret; -} - -int -ar6000_sendkey(AR_SOFTC_DEV_T *arPriv, struct ieee80211req_key *ik, KEY_USAGE keyUsage) -{ - A_STATUS status; - CRYPTO_TYPE keyType = NONE_CRYPT; - - switch (ik->ik_type) { - case IEEE80211_CIPHER_WEP: - keyType = WEP_CRYPT; - break; - case IEEE80211_CIPHER_TKIP: - keyType = TKIP_CRYPT; - break; - case IEEE80211_CIPHER_AES_CCM: - keyType = AES_CRYPT; - break; - default: - break; - } - - if (IEEE80211_CIPHER_CCKM_KRK != ik->ik_type) { - if (NONE_CRYPT == keyType) { - return A_ERROR; - } - - if ((WEP_CRYPT == keyType)&&(!arPriv->arConnected)) { - int index = ik->ik_keyix; - - if (!IEEE80211_IS_VALID_WEP_CIPHER_LEN(ik->ik_keylen)) { - return A_ERROR; - } - - A_MEMZERO(arPriv->arWepKeyList[index].arKey, - sizeof(arPriv->arWepKeyList[index].arKey)); - A_MEMCPY(arPriv->arWepKeyList[index].arKey, ik->ik_keydata, ik->ik_keylen); - arPriv->arWepKeyList[index].arKeyLen = ik->ik_keylen; - - if(ik->ik_flags & IEEE80211_KEY_DEFAULT){ - arPriv->arDefTxKeyIndex = index; - } - - return A_OK; - } - - status = wmi_addKey_cmd(arPriv->arWmi, ik->ik_keyix, keyType, keyUsage, - ik->ik_keylen, (A_UINT8 *)&ik->ik_keyrsc, - ik->ik_keydata, KEY_OP_INIT_VAL, ik->ik_macaddr, - SYNC_BOTH_WMIFLAG); - - } else { - status = wmi_add_krk_cmd(arPriv->arWmi, ik->ik_keydata); - } - - return status; -} - -int -ar6000_ioctl_setkey(AR_SOFTC_DEV_T *arPriv, struct ieee80211req_key *ik) -{ - KEY_USAGE keyUsage; - A_STATUS status; - CRYPTO_TYPE keyType = NONE_CRYPT; - - if ( (0 == memcmp(ik->ik_macaddr, null_mac, IEEE80211_ADDR_LEN)) || - (0 == memcmp(ik->ik_macaddr, bcast_mac, IEEE80211_ADDR_LEN)) ) { - keyUsage = GROUP_USAGE; - } else { - keyUsage = PAIRWISE_USAGE; - } - - if(arPriv->arNextMode == AP_NETWORK) { - AR_SOFTC_AP_T *arAp = &arPriv->arAp; - - if (keyUsage == GROUP_USAGE) { - A_MEMCPY(&arAp->ap_mode_bkey, ik, sizeof(struct ieee80211req_key)); - } - - #ifdef WAPI_ENABLE - if(arPriv->arPairwiseCrypto == WAPI_CRYPT) { - return ap_set_wapi_key(arPriv, ik); - } - #endif - - status = ar6000_sendkey(arPriv, ik, keyUsage); - - } else { - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - - #ifdef USER_KEYS - arSta->user_saved_keys.keyOk = FALSE; - arSta->user_saved_keys.keyType = keyType; - if (keyUsage == GROUP_USAGE) { - A_MEMCPY(&arSta->user_saved_keys.bcast_ik, ik, - sizeof(struct ieee80211req_key)); - } else { - A_MEMCPY(&arSta->user_saved_keys.ucast_ik, ik, - sizeof(struct ieee80211req_key)); - } - #endif - - if (((WMI_WPA_PSK_AUTH == arPriv->arAuthMode) || - (WMI_WPA2_PSK_AUTH == arPriv->arAuthMode)) && - (GROUP_USAGE & keyUsage)) - { - A_UNTIMEOUT(&arSta->disconnect_timer); - } - - status = ar6000_sendkey(arPriv, ik, keyUsage); - - #ifdef USER_KEYS - if (status == A_OK) { - arSta->user_saved_keys.keyOk = TRUE; - } - #endif - } - - if (status != A_OK) { - return -EIO; - } - - return 0; -} - -int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - AR_SOFTC_AP_T *arAp = &arPriv->arAp; - HIF_DEVICE *hifDevice = ar->arHifDevice; - int ret = 0, param; - unsigned int address = 0; - unsigned int length = 0; - unsigned char *buffer; - char *userdata; - - /* - * ioctl operations may have to wait for the Target, so we cannot hold rtnl. - * Prevent the device from disappearing under us and release the lock during - * the ioctl operation. - */ - dev_hold(dev); - rtnl_unlock(); - - if (cmd == AR6000_IOCTL_EXTENDED) { - /* - * This allows for many more wireless ioctls than would otherwise - * be available. Applications embed the actual ioctl command in - * the first word of the parameter block, and use the command - * AR6000_IOCTL_EXTENDED_CMD on the ioctl call. - */ - get_user(cmd, (int *)rq->ifr_data); - userdata = (char *)(((unsigned int *)rq->ifr_data)+1); - if(is_xioctl_allowed(arPriv->arNextMode, - arPriv->arNetworkSubType, cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("xioctl: cmd=%d not allowed in this mode\n",cmd)); - ret = -EOPNOTSUPP; - goto ioctl_done; - } - } else { - A_STATUS ret = is_iwioctl_allowed(arPriv->arNextMode, cmd); - if(ret == A_ENOTSUP) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("iwioctl: cmd=0x%x not allowed in this mode\n", cmd)); - ret = -EOPNOTSUPP; - goto ioctl_done; - } else if (ret == A_ERROR) { - /* It is not our ioctl (out of range ioctl) */ - ret = -EOPNOTSUPP; - goto ioctl_done; - } - userdata = (char *)rq->ifr_data; - } - - if ((ar->arWlanState == WLAN_DISABLED) && - ((cmd != AR6000_XIOCTRL_WMI_SET_WLAN_STATE) && - (cmd != AR6000_XIOCTL_GET_WLAN_SLEEP_STATE) && - (cmd != AR6000_XIOCTL_DIAG_READ) && - (cmd != AR6000_XIOCTL_DIAG_WRITE) && - (cmd != AR6000_XIOCTL_SET_BT_HW_POWER_STATE) && - (cmd != AR6000_XIOCTL_GET_BT_HW_POWER_STATE) && - (cmd != AR6000_IOCTL_WMI_GETREV) && - (cmd != AR6000_XIOCTL_RESUME_DRIVER))) - { - ret = -EIO; - goto ioctl_done; - } - - - ret = 0; - switch(cmd) - { - case IEEE80211_IOCTL_SETPARAM: - { - int param, value; - int *ptr = (int *)rq->ifr_ifru.ifru_newname; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else { - param = *ptr++; - value = *ptr; - ret = ar6000_ioctl_setparam(arPriv,param,value); - } - break; - } - case IEEE80211_IOCTL_SETKEY: - { - struct ieee80211req_key keydata; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&keydata, userdata, - sizeof(struct ieee80211req_key))) { - ret = -EFAULT; - } else { - ar6000_ioctl_setkey(arPriv, &keydata); - } - break; - } - case IEEE80211_IOCTL_DELKEY: - case IEEE80211_IOCTL_SETOPTIE: - { - //ret = -EIO; - break; - } - case IEEE80211_IOCTL_SETMLME: - { - struct ieee80211req_mlme mlme; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&mlme, userdata, - sizeof(struct ieee80211req_mlme))) { - ret = -EFAULT; - } else { - switch (mlme.im_op) { - case IEEE80211_MLME_AUTHORIZE: - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("setmlme AUTHORIZE %02X:%02X\n", - mlme.im_macaddr[4], mlme.im_macaddr[5])); - break; - case IEEE80211_MLME_UNAUTHORIZE: - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("setmlme UNAUTHORIZE %02X:%02X\n", - mlme.im_macaddr[4], mlme.im_macaddr[5])); - break; - case IEEE80211_MLME_DEAUTH: - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("setmlme DEAUTH %02X:%02X\n", - mlme.im_macaddr[4], mlme.im_macaddr[5])); - //remove_sta(ar, mlme.im_macaddr); - break; - case IEEE80211_MLME_DISASSOC: - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("setmlme DISASSOC %02X:%02X\n", - mlme.im_macaddr[4], mlme.im_macaddr[5])); - //remove_sta(ar, mlme.im_macaddr); - break; - default: - ret = 0; - goto ioctl_done; - } - - wmi_ap_set_mlme(arPriv->arWmi, mlme.im_op, mlme.im_macaddr, - mlme.im_reason); - } - break; - } - case IEEE80211_IOCTL_ADDPMKID: - { - struct ieee80211req_addpmkid req; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&req, userdata, sizeof(struct ieee80211req_addpmkid))) { - ret = -EFAULT; - } else { - A_STATUS status; - - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("Add pmkid for %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x en=%d\n", - req.pi_bssid[0], req.pi_bssid[1], req.pi_bssid[2], - req.pi_bssid[3], req.pi_bssid[4], req.pi_bssid[5], - req.pi_enable)); - - status = wmi_setPmkid_cmd(arPriv->arWmi, req.pi_bssid, req.pi_pmkid, - req.pi_enable); - - if (status != A_OK) { - ret = -EIO; - goto ioctl_done; - } - } - break; - } -#ifdef CONFIG_HOST_TCMD_SUPPORT - case AR6000_XIOCTL_TCMD_CONT_TX: - { - TCMD_CONT_TX txCmd; - - if ((ar->tcmdPm == TCMD_PM_SLEEP) || - (ar->tcmdPm == TCMD_PM_DEEPSLEEP)) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Can NOT send tx tcmd when target is asleep! \n")); - ret = -EOPNOTSUPP; - goto ioctl_done; - } - - if(copy_from_user(&txCmd, userdata, sizeof(TCMD_CONT_TX))) { - ret = -EFAULT; - goto ioctl_done; - } else { - wmi_test_cmd(arPriv->arWmi,(A_UINT8 *)&txCmd, sizeof(TCMD_CONT_TX)); - } - } - break; - case AR6000_XIOCTL_TCMD_CONT_RX: - { - TCMD_CONT_RX rxCmd; - - if ((ar->tcmdPm == TCMD_PM_SLEEP) || - (ar->tcmdPm == TCMD_PM_DEEPSLEEP)) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Can NOT send rx tcmd when target is asleep! \n")); - ret = -EOPNOTSUPP; - goto ioctl_done; - } - if(copy_from_user(&rxCmd, userdata, sizeof(TCMD_CONT_RX))) { - ret = -EFAULT; - goto ioctl_done; - } - - switch(rxCmd.act) - { - case TCMD_CONT_RX_PROMIS: - case TCMD_CONT_RX_FILTER: - case TCMD_CONT_RX_SETMAC: - case TCMD_CONT_RX_SET_ANT_SWITCH_TABLE: - wmi_test_cmd(arPriv->arWmi,(A_UINT8 *)&rxCmd, - sizeof(TCMD_CONT_RX)); - tcmdRxFreq = rxCmd.u.para.freq; - break; - case TCMD_CONT_RX_REPORT: - ar6000_ioctl_tcmd_get_rx_report(dev, rq, - (A_UINT8 *)&rxCmd, sizeof(TCMD_CONT_RX)); - break; - default: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unknown Cont Rx mode: %d\n",rxCmd.act)); - ret = -EINVAL; - goto ioctl_done; - } - } - break; - case AR6000_XIOCTL_TCMD_PM: - { - TCMD_PM pmCmd; - - if(copy_from_user(&pmCmd, userdata, sizeof(TCMD_PM))) { - ret = -EFAULT; - goto ioctl_done; - } - ar->tcmdPm = pmCmd.mode; - wmi_test_cmd(arPriv->arWmi, (A_UINT8*)&pmCmd, sizeof(TCMD_PM)); - } - break; - - case AR6000_XIOCTL_TCMD_CMDS: - { - TC_CMDS cmdsCmd; - if(copy_from_user(&cmdsCmd, userdata, sizeof(TC_CMDS))) { - ret = -EFAULT; - goto ioctl_done; - } - ar6000_ioctl_tcmd_cmd_resp(dev, rq, (A_UINT8 *)&cmdsCmd, sizeof(TC_CMDS)); -#if 0 - wmi_test_cmd(arPriv->arWmi, (A_UINT8*)&cmdsCmd, sizeof(TC_CMDS)); -#endif - } - break; - - case AR6000_XIOCTL_TCMD_SETREG: - { - TCMD_SET_REG setRegCmd; - - if(copy_from_user(&setRegCmd, userdata, sizeof(TCMD_SET_REG))) { - ret = -EFAULT; - goto ioctl_done; - } - wmi_test_cmd(arPriv->arWmi, (A_UINT8*)&setRegCmd, sizeof(TCMD_SET_REG)); - } - break; -#endif /* CONFIG_HOST_TCMD_SUPPORT */ - - case AR6000_XIOCTL_BMI_DONE: - if(bmienable) - { - rtnl_lock(); /* ar6000_init expects to be called holding rtnl lock */ - ret = ar6000_init(dev); - rtnl_unlock(); - } - else - { - ret = BMIDone(hifDevice); - } - break; - - case AR6000_XIOCTL_BMI_READ_MEMORY: - get_user(address, (unsigned int *)userdata); - get_user(length, (unsigned int *)userdata + 1); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Read Memory (address: 0x%x, length: %d)\n", - address, length)); - if ((buffer = (unsigned char *)A_MALLOC(length)) != NULL) { - A_MEMZERO(buffer, length); - ret = BMIReadMemory(hifDevice, address, buffer, length); - if (copy_to_user(rq->ifr_data, buffer, length)) { - ret = -EFAULT; - } - A_FREE(buffer); - } else { - ret = -ENOMEM; - } - break; - - case AR6000_XIOCTL_BMI_WRITE_MEMORY: - get_user(address, (unsigned int *)userdata); - get_user(length, (unsigned int *)userdata + 1); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Write Memory (address: 0x%x, length: %d)\n", - address, length)); - if ((buffer = (unsigned char *)A_MALLOC(length)) != NULL) { - A_MEMZERO(buffer, length); - if (copy_from_user(buffer, &userdata[sizeof(address) + - sizeof(length)], length)) - { - ret = -EFAULT; - } else { - ret = BMIWriteMemory(hifDevice, address, buffer, length); - } - A_FREE(buffer); - } else { - ret = -ENOMEM; - } - break; - - case AR6000_XIOCTL_BMI_TEST: - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("No longer supported\n")); - ret = -EOPNOTSUPP; - break; - - case AR6000_XIOCTL_BMI_EXECUTE: - get_user(address, (unsigned int *)userdata); - get_user(param, (unsigned int *)userdata + 1); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Execute (address: 0x%x, param: %d)\n", - address, param)); - ret = BMIExecute(hifDevice, address, (A_UINT32*)¶m); - put_user(param, (unsigned int *)rq->ifr_data); /* return value */ - break; - - case AR6000_XIOCTL_BMI_SET_APP_START: - get_user(address, (unsigned int *)userdata); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Set App Start (address: 0x%x)\n", address)); - ret = BMISetAppStart(hifDevice, address); - break; - - case AR6000_XIOCTL_BMI_READ_SOC_REGISTER: - get_user(address, (unsigned int *)userdata); - ret = BMIReadSOCRegister(hifDevice, address, (A_UINT32*)¶m); - put_user(param, (unsigned int *)rq->ifr_data); /* return value */ - break; - - case AR6000_XIOCTL_BMI_WRITE_SOC_REGISTER: - get_user(address, (unsigned int *)userdata); - get_user(param, (unsigned int *)userdata + 1); - ret = BMIWriteSOCRegister(hifDevice, address, param); - break; - -#ifdef HTC_RAW_INTERFACE - case AR6000_XIOCTL_HTC_RAW_OPEN: - ret = A_OK; - if (!arRawIfEnabled(ar)) { - /* make sure block size is set in case the target was reset since last - * BMI phase (i.e. flashup downloads) */ - ret = ar6000_set_htc_params(ar->arHifDevice, - ar->arTargetType, - 0, /* use default yield */ - 0 /* use default number of HTC ctrl buffers */ - ); - if (A_FAILED(ret)) { - break; - } - /* Terminate the BMI phase */ - ret = BMIDone(hifDevice); - if (ret == A_OK) { - ret = ar6000_htc_raw_open(ar); - } - } - break; - - case AR6000_XIOCTL_HTC_RAW_CLOSE: - if (arRawIfEnabled(ar)) { - ret = ar6000_htc_raw_close(ar); - arRawIfEnabled(ar) = FALSE; - } else { - ret = A_ERROR; - } - break; - - case AR6000_XIOCTL_HTC_RAW_READ: - if (arRawIfEnabled(ar)) { - unsigned int streamID; - get_user(streamID, (unsigned int *)userdata); - get_user(length, (unsigned int *)userdata + 1); - buffer = (unsigned char*)rq->ifr_data + sizeof(length); - ret = ar6000_htc_raw_read(ar, (HTC_RAW_STREAM_ID)streamID, - (char*)buffer, length); - put_user(ret, (unsigned int *)rq->ifr_data); - } else { - ret = A_ERROR; - } - break; - - case AR6000_XIOCTL_HTC_RAW_WRITE: - if (arRawIfEnabled(ar)) { - unsigned int streamID; - get_user(streamID, (unsigned int *)userdata); - get_user(length, (unsigned int *)userdata + 1); - buffer = (unsigned char*)userdata + sizeof(streamID) + sizeof(length); - ret = ar6000_htc_raw_write(ar, (HTC_RAW_STREAM_ID)streamID, - (char*)buffer, length); - put_user(ret, (unsigned int *)rq->ifr_data); - } else { - ret = A_ERROR; - } - break; -#endif /* HTC_RAW_INTERFACE */ - - case AR6000_XIOCTL_BMI_LZ_STREAM_START: - get_user(address, (unsigned int *)userdata); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Start Compressed Stream (address: 0x%x)\n", address)); - ret = BMILZStreamStart(hifDevice, address); - break; - - case AR6000_XIOCTL_BMI_LZ_DATA: - get_user(length, (unsigned int *)userdata); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Send Compressed Data (length: %d)\n", length)); - if ((buffer = (unsigned char *)A_MALLOC(length)) != NULL) { - A_MEMZERO(buffer, length); - if (copy_from_user(buffer, &userdata[sizeof(length)], length)) - { - ret = -EFAULT; - } else { - ret = BMILZData(hifDevice, buffer, length); - } - A_FREE(buffer); - } else { - ret = -ENOMEM; - } - break; - -#if defined(CONFIG_TARGET_PROFILE_SUPPORT) - /* - * Optional support for Target-side profiling. - * Not needed in production. - */ - - /* Configure Target-side profiling */ - case AR6000_XIOCTL_PROF_CFG: - { - A_UINT32 period; - A_UINT32 nbins; - get_user(period, (unsigned int *)userdata); - get_user(nbins, (unsigned int *)userdata + 1); - - if (wmi_prof_cfg_cmd(arPriv->arWmi, period, nbins) != A_OK) { - ret = -EIO; - } - - break; - } - - /* Start a profiling bucket/bin at the specified address */ - case AR6000_XIOCTL_PROF_ADDR_SET: - { - A_UINT32 addr; - get_user(addr, (unsigned int *)userdata); - - if (wmi_prof_addr_set_cmd(arPriv->arWmi, addr) != A_OK) { - ret = -EIO; - } - - break; - } - - /* START Target-side profiling */ - case AR6000_XIOCTL_PROF_START: - wmi_prof_start_cmd(arPriv->arWmi); - break; - - /* STOP Target-side profiling */ - case AR6000_XIOCTL_PROF_STOP: - wmi_prof_stop_cmd(arPriv->arWmi); - break; - case AR6000_XIOCTL_PROF_COUNT_GET: - { - if (ar->bIsDestroyProgress) { - ret = -EBUSY; - goto ioctl_done; - } - if (ar->arWmiReady == FALSE) { - ret = -EIO; - goto ioctl_done; - } - if (down_interruptible(&ar->arSem)) { - ret = -ERESTARTSYS; - goto ioctl_done; - } - if (ar->bIsDestroyProgress) { - up(&ar->arSem); - ret = -EBUSY; - goto ioctl_done; - } - - prof_count_available = FALSE; - ret = prof_count_get(dev); - if (ret != A_OK) { - up(&ar->arSem); - ret = -EIO; - goto ioctl_done; - } - - /* Wait for Target to respond. */ - wait_event_interruptible(arPriv->arEvent, prof_count_available); - if (signal_pending(current)) { - ret = -EINTR; - } else { - if (copy_to_user(userdata, &prof_count_results, - sizeof(prof_count_results))) - { - ret = -EFAULT; - } - } - up(&ar->arSem); - break; - } -#endif /* CONFIG_TARGET_PROFILE_SUPPORT */ - - case AR6000_IOCTL_WMI_GETREV: - { - if (copy_to_user(rq->ifr_data, &ar->arVersion, - sizeof(ar->arVersion))) - { - ret = -EFAULT; - } - break; - } - case AR6000_IOCTL_WMI_SETPWR: - { - WMI_POWER_MODE_CMD pwrModeCmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&pwrModeCmd, userdata, - sizeof(pwrModeCmd))) - { - ret = -EFAULT; - } else { - if (wmi_powermode_cmd(arPriv->arWmi, pwrModeCmd.powerMode) - != A_OK) - { - ret = -EIO; - } - } - break; - } - case AR6000_IOCTL_WMI_SET_IBSS_PM_CAPS: - { - WMI_IBSS_PM_CAPS_CMD ibssPmCaps; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&ibssPmCaps, userdata, - sizeof(ibssPmCaps))) - { - ret = -EFAULT; - } else { - if (wmi_ibsspmcaps_cmd(arPriv->arWmi, ibssPmCaps.power_saving, ibssPmCaps.ttl, - ibssPmCaps.atim_windows, ibssPmCaps.timeout_value) != A_OK) - { - ret = -EIO; - } - AR6000_SPIN_LOCK(&arPriv->arPrivLock, 0); - arPriv->arSta.arIbssPsEnable = ibssPmCaps.power_saving; - AR6000_SPIN_UNLOCK(&arPriv->arPrivLock, 0); - } - break; - } - case AR6000_XIOCTL_WMI_SET_AP_PS: - { - WMI_AP_PS_CMD apPsCmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&apPsCmd, userdata, - sizeof(apPsCmd))) - { - ret = -EFAULT; - } else { - if (wmi_apps_cmd(arPriv->arWmi, apPsCmd.psType, apPsCmd.idle_time, - apPsCmd.ps_period, apPsCmd.sleep_period) != A_OK) - { - ret = -EIO; - } - } - break; - } - case AR6000_IOCTL_WMI_SET_PMPARAMS: - { - WMI_POWER_PARAMS_CMD pmParams; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&pmParams, userdata, - sizeof(pmParams))) - { - ret = -EFAULT; - } else { - if (wmi_pmparams_cmd(arPriv->arWmi, pmParams.idle_period, - pmParams.pspoll_number, - pmParams.dtim_policy, - pmParams.tx_wakeup_policy, - pmParams.num_tx_to_wakeup, -#if WLAN_CONFIG_IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN - IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN -#else - SEND_POWER_SAVE_FAIL_EVENT_ALWAYS -#endif - ) != A_OK) - { - ret = -EIO; - } - } - break; - } - case AR6000_IOCTL_WMI_SETSCAN: - { - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&arSta->scParams, userdata, - sizeof(arSta->scParams))) - { - ret = -EFAULT; - } else { - if (CAN_SCAN_IN_CONNECT(arSta->scParams.scanCtrlFlags)) { - arSta->arSkipScan = FALSE; - } else { - arSta->arSkipScan = TRUE; - } - - if (wmi_scanparams_cmd(arPriv->arWmi, arSta->scParams.fg_start_period, - arSta->scParams.fg_end_period, - arSta->scParams.bg_period, - arSta->scParams.minact_chdwell_time, - arSta->scParams.maxact_chdwell_time, - arSta->scParams.pas_chdwell_time, - arSta->scParams.shortScanRatio, - arSta->scParams.scanCtrlFlags, - arSta->scParams.max_dfsch_act_time, - arSta->scParams.maxact_scan_per_ssid) != A_OK) - { - ret = -EIO; - } - } - break; - } - case AR6000_IOCTL_WMI_SETLISTENINT: - { - WMI_LISTEN_INT_CMD listenCmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&listenCmd, userdata, - sizeof(listenCmd))) - { - ret = -EFAULT; - } else { - if (wmi_listeninterval_cmd(arPriv->arWmi, listenCmd.listenInterval, listenCmd.numBeacons) != A_OK) { - ret = -EIO; - } else { - AR6000_SPIN_LOCK(&arPriv->arPrivLock, 0); - arSta->arListenIntervalT = listenCmd.listenInterval; - arSta->arListenIntervalB = listenCmd.numBeacons; - AR6000_SPIN_UNLOCK(&arPriv->arPrivLock, 0); - } - - } - break; - } - case AR6000_IOCTL_WMI_SET_BMISS_TIME: - { - WMI_BMISS_TIME_CMD bmissCmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&bmissCmd, userdata, - sizeof(bmissCmd))) - { - ret = -EFAULT; - } else { - if (wmi_bmisstime_cmd(arPriv->arWmi, bmissCmd.bmissTime, bmissCmd.numBeacons) != A_OK) { - ret = -EIO; - } - } - break; - } - case AR6000_IOCTL_WMI_SETBSSFILTER: - { - WMI_BSS_FILTER_CMD filt; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&filt, userdata, - sizeof(filt))) - { - ret = -EFAULT; - } else { - if (wmi_bssfilter_cmd(arPriv->arWmi, filt.bssFilter, filt.ieMask) - != A_OK) { - ret = -EIO; - } else { - arSta->arUserBssFilter = filt.bssFilter; - } - } - break; - } - - case AR6000_IOCTL_WMI_SET_SNRTHRESHOLD: - { - ret = ar6000_ioctl_set_snr_threshold(dev, rq); - break; - } - case AR6000_XIOCTL_WMI_SET_RSSITHRESHOLD: - { - ret = ar6000_ioctl_set_rssi_threshold(dev, rq); - break; - } - case AR6000_XIOCTL_WMI_CLR_RSSISNR: - { - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } - ret = wmi_clr_rssi_snr(arPriv->arWmi); - break; - } - case AR6000_XIOCTL_WMI_SET_LQTHRESHOLD: - { - ret = ar6000_ioctl_set_lq_threshold(dev, rq); - break; - } - case AR6000_XIOCTL_WMI_SET_LPREAMBLE: - { - WMI_SET_LPREAMBLE_CMD setLpreambleCmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&setLpreambleCmd, userdata, - sizeof(setLpreambleCmd))) - { - ret = -EFAULT; - } else { - if (wmi_set_lpreamble_cmd(arPriv->arWmi, setLpreambleCmd.status, -#if WLAN_CONFIG_DONOT_IGNORE_BARKER_IN_ERP - WMI_DONOT_IGNORE_BARKER_IN_ERP -#else - WMI_IGNORE_BARKER_IN_ERP -#endif - ) != A_OK) - { - ret = -EIO; - } - } - - break; - } - case AR6000_XIOCTL_WMI_SET_RTS: - { - WMI_SET_RTS_CMD rtsCmd; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&rtsCmd, userdata, - sizeof(rtsCmd))) - { - ret = -EFAULT; - } else { - if(arPriv->arNetworkType == AP_NETWORK) { - arAp->arRTS = rtsCmd.threshold; - } - if (wmi_set_rts_cmd(arPriv->arWmi, rtsCmd.threshold) - != A_OK) - { - ret = -EIO; - } - } - - break; - } - case AR6000_XIOCTL_WMI_SET_WMM: - { - ret = ar6000_ioctl_set_wmm(dev, rq); - break; - } - case AR6000_XIOCTL_WMI_SET_QOS_SUPP: - { - ret = ar6000_ioctl_set_qos_supp(dev, rq); - break; - } - case AR6000_XIOCTL_WMI_SET_TXOP: - { - ret = ar6000_ioctl_set_txop(dev, rq); - break; - } - case AR6000_XIOCTL_WMI_GET_RD: - { - ret = ar6000_ioctl_get_rd(dev, rq); - break; - } - case AR6000_IOCTL_WMI_SET_CHANNELPARAMS: - { - ret = ar6000_ioctl_set_channelParams(dev, rq); - break; - } - case AR6000_IOCTL_WMI_SET_PROBEDSSID: - { - ret = ar6000_ioctl_set_probedSsid(dev, rq); - break; - } - case AR6000_IOCTL_WMI_SET_BADAP: - { - ret = ar6000_ioctl_set_badAp(dev, rq); - break; - } - case AR6000_IOCTL_WMI_CREATE_QOS: - { - ret = ar6000_ioctl_create_qos(dev, rq); - break; - } - case AR6000_IOCTL_WMI_DELETE_QOS: - { - ret = ar6000_ioctl_delete_qos(dev, rq); - break; - } - case AR6000_IOCTL_WMI_GET_QOS_QUEUE: - { - ret = ar6000_ioctl_get_qos_queue(dev, rq); - break; - } - case AR6000_IOCTL_WMI_GET_TARGET_STATS: - { - ret = ar6000_ioctl_get_target_stats(dev, rq); - break; - } - case AR6000_IOCTL_WMI_SET_ERROR_REPORT_BITMASK: - { - ret = ar6000_ioctl_set_error_report_bitmask(dev, rq); - break; - } - case AR6000_IOCTL_WMI_SET_ASSOC_INFO: - { - WMI_SET_ASSOC_INFO_CMD cmd; - A_UINT8 assocInfo[WMI_MAX_ASSOC_INFO_LEN]; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else { - get_user(cmd.ieType, userdata); - if (cmd.ieType >= WMI_MAX_ASSOC_INFO_TYPE) { - ret = -EIO; - } else { - get_user(cmd.bufferSize, userdata + 1); - if (cmd.bufferSize > WMI_MAX_ASSOC_INFO_LEN) { - ret = -EFAULT; - break; - } - if (copy_from_user(assocInfo, userdata + 2, - cmd.bufferSize)) - { - ret = -EFAULT; - } else { - if (wmi_associnfo_cmd(arPriv->arWmi, cmd.ieType, - cmd.bufferSize, - assocInfo) != A_OK) - { - ret = -EIO; - } - } - } - } - break; - } - case AR6000_IOCTL_WMI_SET_ACCESS_PARAMS: - { - ret = ar6000_ioctl_set_access_params(dev, rq); - break; - } - case AR6000_IOCTL_WMI_SET_DISC_TIMEOUT: - { - ret = ar6000_ioctl_set_disconnect_timeout(dev, rq); - break; - } - case AR6000_XIOCTL_FORCE_TARGET_RESET: - { - if (ar->arHtcTarget) - { -// HTCForceReset(htcTarget); - } - else - { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN,("ar6000_ioctl cannot attempt reset.\n")); - } - break; - } - case AR6000_XIOCTL_TARGET_INFO: - case AR6000_XIOCTL_CHECK_TARGET_READY: /* backwards compatibility */ - { - /* If we made it to here, then the Target exists and is ready. */ - - if (cmd == AR6000_XIOCTL_TARGET_INFO) { - if (copy_to_user((A_UINT32 *)rq->ifr_data, &ar->arVersion.target_ver, - sizeof(ar->arVersion.target_ver))) - { - ret = -EFAULT; - } - if (copy_to_user(((A_UINT32 *)rq->ifr_data)+1, &ar->arTargetType, - sizeof(ar->arTargetType))) - { - ret = -EFAULT; - } - } - break; - } - case AR6000_XIOCTL_WMI_SET_HB_CHALLENGE_RESP_PARAMS: - { - WMI_SET_HB_CHALLENGE_RESP_PARAMS_CMD hbparam; - - if (copy_from_user(&hbparam, userdata, sizeof(hbparam))) - { - ret = -EFAULT; - } else { - AR6000_SPIN_LOCK(&ar->arLock, 0); - /* Start a cyclic timer with the parameters provided. */ - if (hbparam.frequency) { - ar->arHBChallengeResp.frequency = hbparam.frequency; - } - if (hbparam.threshold) { - ar->arHBChallengeResp.missThres = hbparam.threshold; - } - - /* Delete the pending timer and start a new one */ - if (timer_pending(&ar->arHBChallengeResp.timer)) { - A_UNTIMEOUT(&ar->arHBChallengeResp.timer); - } - A_TIMEOUT_MS(&ar->arHBChallengeResp.timer, ar->arHBChallengeResp.frequency * 1000, 0); - AR6000_SPIN_UNLOCK(&ar->arLock, 0); - } - break; - } - case AR6000_XIOCTL_WMI_GET_HB_CHALLENGE_RESP: - { - A_UINT32 cookie; - - if (copy_from_user(&cookie, userdata, sizeof(cookie))) { - ret = -EFAULT; - goto ioctl_done; - } - - /* Send the challenge on the control channel */ - if (wmi_get_challenge_resp_cmd(arPriv->arWmi, cookie, APP_HB_CHALLENGE) != A_OK) { - ret = -EIO; - goto ioctl_done; - } - break; - } -#ifdef USER_KEYS - case AR6000_XIOCTL_USER_SETKEYS: - { - - arSta->user_savedkeys_stat = USER_SAVEDKEYS_STAT_RUN; - - if (copy_from_user(&arSta->user_key_ctrl, userdata, - sizeof(arSta->user_key_ctrl))) - { - ret = -EFAULT; - goto ioctl_done; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("ar6000 USER set key %x\n", arSta->user_key_ctrl)); - break; - } -#endif /* USER_KEYS */ - -#ifdef CONFIG_HOST_GPIO_SUPPORT - case AR6000_XIOCTL_GPIO_OUTPUT_SET: - { - struct ar6000_gpio_output_set_cmd_s gpio_output_set_cmd; - - if (ar->bIsDestroyProgress) { - ret = -EBUSY; - goto ioctl_done; - } - if (ar->arWmiReady == FALSE) { - ret = -EIO; - goto ioctl_done; - } - if (down_interruptible(&ar->arSem)) { - ret = -ERESTARTSYS; - goto ioctl_done; - } - if (ar->bIsDestroyProgress) { - up(&ar->arSem); - ret = -EBUSY; - goto ioctl_done; - } - - if (copy_from_user(&gpio_output_set_cmd, userdata, - sizeof(gpio_output_set_cmd))) - { - ret = -EFAULT; - } else { - ret = ar6000_gpio_output_set(dev, - gpio_output_set_cmd.set_mask, - gpio_output_set_cmd.clear_mask, - gpio_output_set_cmd.enable_mask, - gpio_output_set_cmd.disable_mask); - if (ret != A_OK) { - ret = EIO; - } - } - up(&ar->arSem); - break; - } - case AR6000_XIOCTL_GPIO_INPUT_GET: - { - if (ar->bIsDestroyProgress) { - ret = -EBUSY; - goto ioctl_done; - } - if (ar->arWmiReady == FALSE) { - ret = -EIO; - goto ioctl_done; - } - if (down_interruptible(&ar->arSem)) { - ret = -ERESTARTSYS; - goto ioctl_done; - } - if (ar->bIsDestroyProgress) { - up(&ar->arSem); - ret = -EBUSY; - goto ioctl_done; - } - - ret = ar6000_gpio_input_get(dev); - if (ret != A_OK) { - up(&ar->arSem); - ret = -EIO; - goto ioctl_done; - } - - /* Wait for Target to respond. */ - wait_event_interruptible(arPriv->arEvent, gpio_data_available); - if (signal_pending(current)) { - ret = -EINTR; - } else { - A_ASSERT(gpio_reg_results.gpioreg_id == GPIO_ID_NONE); - - if (copy_to_user(userdata, &gpio_reg_results.value, - sizeof(gpio_reg_results.value))) - { - ret = -EFAULT; - } - } - up(&ar->arSem); - break; - } - case AR6000_XIOCTL_GPIO_REGISTER_SET: - { - struct ar6000_gpio_register_cmd_s gpio_register_cmd; - - if (ar->bIsDestroyProgress) { - ret = -EBUSY; - goto ioctl_done; - } - if (ar->arWmiReady == FALSE) { - ret = -EIO; - goto ioctl_done; - } - if (down_interruptible(&ar->arSem)) { - ret = -ERESTARTSYS; - goto ioctl_done; - } - if (ar->bIsDestroyProgress) { - up(&ar->arSem); - ret = -EBUSY; - goto ioctl_done; - } - - if (copy_from_user(&gpio_register_cmd, userdata, - sizeof(gpio_register_cmd))) - { - ret = -EFAULT; - } else { - ret = ar6000_gpio_register_set(dev, - gpio_register_cmd.gpioreg_id, - gpio_register_cmd.value); - if (ret != A_OK) { - ret = EIO; - } - - /* Wait for acknowledgement from Target */ - wait_event_interruptible(arPriv->arEvent, gpio_ack_received); - if (signal_pending(current)) { - ret = -EINTR; - } - } - up(&ar->arSem); - break; - } - case AR6000_XIOCTL_GPIO_REGISTER_GET: - { - struct ar6000_gpio_register_cmd_s gpio_register_cmd; - - if (ar->bIsDestroyProgress) { - ret = -EBUSY; - goto ioctl_done; - } - if (ar->arWmiReady == FALSE) { - ret = -EIO; - goto ioctl_done; - } - if (down_interruptible(&ar->arSem)) { - ret = -ERESTARTSYS; - goto ioctl_done; - } - if (ar->bIsDestroyProgress) { - up(&ar->arSem); - ret = -EBUSY; - goto ioctl_done; - } - - if (copy_from_user(&gpio_register_cmd, userdata, - sizeof(gpio_register_cmd))) - { - ret = -EFAULT; - } else { - ret = ar6000_gpio_register_get(dev, gpio_register_cmd.gpioreg_id); - if (ret != A_OK) { - up(&ar->arSem); - ret = -EIO; - goto ioctl_done; - } - - /* Wait for Target to respond. */ - wait_event_interruptible(arPriv->arEvent, gpio_data_available); - if (signal_pending(current)) { - ret = -EINTR; - } else { - A_ASSERT(gpio_register_cmd.gpioreg_id == gpio_reg_results.gpioreg_id); - if (copy_to_user(userdata, &gpio_reg_results, - sizeof(gpio_reg_results))) - { - ret = -EFAULT; - } - } - } - up(&ar->arSem); - break; - } - case AR6000_XIOCTL_GPIO_INTR_ACK: - { - struct ar6000_gpio_intr_ack_cmd_s gpio_intr_ack_cmd; - - if (ar->bIsDestroyProgress) { - ret = -EBUSY; - goto ioctl_done; - } - if (ar->arWmiReady == FALSE) { - ret = -EIO; - goto ioctl_done; - } - if (down_interruptible(&ar->arSem)) { - ret = -ERESTARTSYS; - goto ioctl_done; - } - - if (ar->bIsDestroyProgress) { - up(&ar->arSem); - ret = -EBUSY; - goto ioctl_done; - } - - if (copy_from_user(&gpio_intr_ack_cmd, userdata, - sizeof(gpio_intr_ack_cmd))) - { - ret = -EFAULT; - } else { - ret = ar6000_gpio_intr_ack(dev, gpio_intr_ack_cmd.ack_mask); - if (ret != A_OK) { - ret = EIO; - } - } - up(&ar->arSem); - break; - } - case AR6000_XIOCTL_GPIO_INTR_WAIT: - { - /* Wait for Target to report an interrupt. */ - wait_event_interruptible(arPriv->arEvent, gpio_intr_available); - - if (signal_pending(current)) { - ret = -EINTR; - } else { - if (copy_to_user(userdata, &gpio_intr_results, - sizeof(gpio_intr_results))) - { - ret = -EFAULT; - } - } - break; - } -#endif /* CONFIG_HOST_GPIO_SUPPORT */ - - case AR6000_XIOCTL_DBGLOG_CFG_MODULE: - { - struct ar6000_dbglog_module_config_s config; - - if (copy_from_user(&config, userdata, sizeof(config))) { - ret = -EFAULT; - goto ioctl_done; - } - - /* Send the challenge on the control channel */ - if (wmi_config_debug_module_cmd(arPriv->arWmi, config.mmask, - config.tsr, config.rep, - config.size, config.valid) != A_OK) - { - ret = -EIO; - goto ioctl_done; - } - break; - } - - case AR6000_XIOCTL_DBGLOG_GET_DEBUG_LOGS: - { - /* Send the challenge on the control channel */ - if (ar6000_dbglog_get_debug_logs(ar) != A_OK) - { - ret = -EIO; - goto ioctl_done; - } - break; - } - - case AR6000_XIOCTL_SET_ADHOC_BSSID: - { - WMI_SET_ADHOC_BSSID_CMD adhocBssid; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&adhocBssid, userdata, - sizeof(adhocBssid))) - { - ret = -EFAULT; - } else if (A_MEMCMP(adhocBssid.bssid, bcast_mac, - AR6000_ETH_ADDR_LEN) == 0) - { - ret = -EFAULT; - } else { - - A_MEMCPY(arSta->arReqBssid, adhocBssid.bssid, sizeof(arSta->arReqBssid)); - } - break; - } - - case AR6000_XIOCTL_WMI_SETRETRYLIMITS: - { - WMI_SET_RETRY_LIMITS_CMD setRetryParams; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&setRetryParams, userdata, - sizeof(setRetryParams))) - { - ret = -EFAULT; - } else { - if (wmi_set_retry_limits_cmd(arPriv->arWmi, setRetryParams.frameType, - setRetryParams.trafficClass, - setRetryParams.maxRetries, - setRetryParams.enableNotify) != A_OK) - { - ret = -EIO; - } - AR6000_SPIN_LOCK(&arPriv->arPrivLock, 0); - arPriv->arMaxRetries = setRetryParams.maxRetries; - AR6000_SPIN_UNLOCK(&arPriv->arPrivLock, 0); - } - break; - } - - case AR6000_XIOCTL_SET_BEACON_INTVAL: - { - WMI_BEACON_INT_CMD bIntvlCmd; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&bIntvlCmd, userdata, - sizeof(bIntvlCmd))) - { - ret = -EFAULT; - } else if (wmi_set_adhoc_bconIntvl_cmd(arPriv->arWmi, bIntvlCmd.beaconInterval) - != A_OK) - { - ret = -EIO; - } - if(ret == 0) { - arAp->ap_beacon_interval = bIntvlCmd.beaconInterval; - arPriv->ap_profile_flag = 1; /* There is a change in profile */ - } - break; - } - case IEEE80211_IOCTL_SETAUTHALG: - { - struct ieee80211req_authalg req; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&req, userdata, - sizeof(struct ieee80211req_authalg))) - { - ret = -EFAULT; - } else { - if (req.auth_alg & AUTH_ALG_OPEN_SYSTEM) { - arPriv->arDot11AuthMode |= OPEN_AUTH; - arPriv->arPairwiseCrypto = NONE_CRYPT; - arPriv->arGroupCrypto = NONE_CRYPT; - } - if (req.auth_alg & AUTH_ALG_SHARED_KEY) { - arPriv->arDot11AuthMode |= SHARED_AUTH; - arPriv->arPairwiseCrypto = WEP_CRYPT; - arPriv->arGroupCrypto = WEP_CRYPT; - arPriv->arAuthMode = WMI_NONE_AUTH; - } - if (req.auth_alg == AUTH_ALG_LEAP) { - arPriv->arDot11AuthMode = LEAP_AUTH; - } - } - break; - } - - case AR6000_XIOCTL_SET_VOICE_PKT_SIZE: - ret = ar6000_xioctl_set_voice_pkt_size(dev, userdata); - break; - - case AR6000_XIOCTL_SET_MAX_SP: - ret = ar6000_xioctl_set_max_sp_len(dev, userdata); - break; - - case AR6000_XIOCTL_WMI_GET_ROAM_TBL: - ret = ar6000_ioctl_get_roam_tbl(dev, rq); - break; - case AR6000_XIOCTL_WMI_SET_ROAM_CTRL: - ret = ar6000_ioctl_set_roam_ctrl(dev, userdata); - break; - case AR6000_XIOCTRL_WMI_SET_POWERSAVE_TIMERS: - ret = ar6000_ioctl_set_powersave_timers(dev, userdata); - break; - case AR6000_XIOCTRL_WMI_GET_POWER_MODE: - ret = ar6000_ioctl_get_power_mode(dev, rq); - break; - - case AR6000_XIOCTRL_WMI_SET_WLAN_STATE: - { - AR6000_WLAN_STATE state; - get_user(state, (unsigned int *)userdata); - if (ar6000_set_wlan_state(ar, state)!=A_OK) { - ret = -EIO; - } - break; - } - - case AR6000_XIOCTL_WMI_GET_ROAM_DATA: - ret = ar6000_ioctl_get_roam_data(dev, rq); - break; - - case AR6000_XIOCTL_WMI_SET_BT_STATUS: - ret = ar6000_xioctl_set_bt_status_cmd(dev, userdata); - break; - - case AR6000_XIOCTL_WMI_SET_BT_PARAMS: - ret = ar6000_xioctl_set_bt_params_cmd(dev, userdata); - break; - - case AR6000_XIOCTL_WMI_SET_BTCOEX_FE_ANT: - ret = ar6000_xioctl_set_btcoex_fe_ant_cmd(dev, userdata); - break; - - case AR6000_XIOCTL_WMI_SET_BTCOEX_COLOCATED_BT_DEV: - ret = ar6000_xioctl_set_btcoex_colocated_bt_dev_cmd(dev, userdata); - break; - - case AR6000_XIOCTL_WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG: - ret = ar6000_xioctl_set_btcoex_btinquiry_page_config_cmd(dev, userdata); - break; - - case AR6000_XIOCTL_WMI_SET_BTCOEX_SCO_CONFIG: - ret = ar6000_xioctl_set_btcoex_sco_config_cmd( dev, userdata); - break; - - case AR6000_XIOCTL_WMI_SET_BTCOEX_A2DP_CONFIG: - ret = ar6000_xioctl_set_btcoex_a2dp_config_cmd(dev, userdata); - break; - - case AR6000_XIOCTL_WMI_SET_BTCOEX_ACLCOEX_CONFIG: - ret = ar6000_xioctl_set_btcoex_aclcoex_config_cmd(dev, userdata); - break; - - case AR6000_XIOCTL_WMI_SET_BTCOEX_DEBUG: - ret = ar60000_xioctl_set_btcoex_debug_cmd(dev, userdata); - break; - - case AR6000_XIOCTL_WMI_SET_BT_OPERATING_STATUS: - ret = ar6000_xioctl_set_btcoex_bt_operating_status_cmd(dev, userdata); - break; - - case AR6000_XIOCTL_WMI_GET_BTCOEX_CONFIG: - ret = ar6000_xioctl_get_btcoex_config_cmd(dev, userdata, rq); - break; - - case AR6000_XIOCTL_WMI_GET_BTCOEX_STATS: - ret = ar6000_xioctl_get_btcoex_stats_cmd(dev, userdata, rq); - break; - - case AR6000_XIOCTL_WMI_STARTSCAN: - { - WMI_START_SCAN_CMD setStartScanCmd, *cmdp; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&setStartScanCmd, userdata, - sizeof(setStartScanCmd))) - { - ret = -EFAULT; - } else { - if (setStartScanCmd.numChannels > 1) { - cmdp = A_MALLOC(130); - if (copy_from_user(cmdp, userdata, - sizeof (*cmdp) + - ((setStartScanCmd.numChannels - 1) * - sizeof(A_UINT16)))) - { - A_FREE(cmdp); - ret = -EFAULT; - goto ioctl_done; - } - } else { - cmdp = &setStartScanCmd; - } - - if (wmi_startscan_cmd(arPriv->arWmi, cmdp->scanType, - cmdp->forceFgScan, - cmdp->isLegacy, - cmdp->homeDwellTime, - cmdp->forceScanInterval, - cmdp->numChannels, - cmdp->channelList) != A_OK) - { - ret = -EIO; - } - if (setStartScanCmd.numChannels > 1) { - A_FREE(cmdp); - } - } - break; - } - case AR6000_XIOCTL_WMI_SETFIXRATES: - { - WMI_FIX_RATES_CMD setFixRatesCmd; - A_STATUS returnStatus; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&setFixRatesCmd, userdata, - sizeof(setFixRatesCmd))) - { - ret = -EFAULT; - } else { - returnStatus = wmi_set_fixrates_cmd(arPriv->arWmi, setFixRatesCmd.fixRateMask); - if (returnStatus == A_EINVAL) { - ret = -EINVAL; - } else if(returnStatus != A_OK) { - ret = -EIO; - } else { - arPriv->ap_profile_flag = 1; /* There is a change in profile */ - } - } - break; - } - - case AR6000_XIOCTL_WMI_GETFIXRATES: - { - WMI_FIX_RATES_CMD getFixRatesCmd; - int ret = 0; - - if (ar->bIsDestroyProgress) { - ret = -EBUSY; - goto ioctl_done; - } - if (ar->arWmiReady == FALSE) { - ret = -EIO; - goto ioctl_done; - } - - if (down_interruptible(&ar->arSem)) { - ret = -ERESTARTSYS; - goto ioctl_done; - } - if (ar->bIsDestroyProgress) { - up(&ar->arSem); - ret = -EBUSY; - goto ioctl_done; - } - /* Used copy_from_user/copy_to_user to access user space data */ - if (copy_from_user(&getFixRatesCmd, userdata, sizeof(getFixRatesCmd))) { - ret = -EFAULT; - } else { - arPriv->arRateMask[0] = 0xFFFFFFFF; - arPriv->arRateMask[1] = 0xFFFFFFFF; - - if (wmi_get_ratemask_cmd(arPriv->arWmi) != A_OK) { - up(&ar->arSem); - ret = -EIO; - goto ioctl_done; - } - - wait_event_interruptible_timeout(arPriv->arEvent, (arPriv->arRateMask[0] != 0xFFFFFFFF) && - (arPriv->arRateMask[1] != 0xFFFFFFFF), wmitimeout * HZ); - - if (signal_pending(current)) { - ret = -EINTR; - } - - if (!ret) { - getFixRatesCmd.fixRateMask[0] = arPriv->arRateMask[0]; - getFixRatesCmd.fixRateMask[1] = arPriv->arRateMask[1]; - } - - if(copy_to_user(userdata, &getFixRatesCmd, sizeof(getFixRatesCmd))) { - ret = -EFAULT; - } - - up(&ar->arSem); - } - break; - } - case AR6000_XIOCTL_WMI_SET_AUTHMODE: - { - WMI_SET_AUTH_MODE_CMD setAuthMode; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&setAuthMode, userdata, - sizeof(setAuthMode))) { - ret = -EFAULT; - } else { - if (wmi_set_authmode_cmd(arPriv->arWmi, setAuthMode.mode) != A_OK) - { - ret = -EIO; - } - } - break; - } - case AR6000_XIOCTL_WMI_SET_REASSOCMODE: - { - WMI_SET_REASSOC_MODE_CMD setReassocMode; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&setReassocMode, userdata, - sizeof(setReassocMode))) { - ret = -EFAULT; - } else { - if (wmi_set_reassocmode_cmd(arPriv->arWmi, setReassocMode.mode) != A_OK) - { - ret = -EIO; - } - } - break; - } - case AR6000_XIOCTL_DIAG_READ: - { - A_UINT32 addr, data; - get_user(addr, (unsigned int *)userdata); - addr = TARG_VTOP(ar->arTargetType, addr); - if (ar6000_ReadRegDiag(ar->arHifDevice, &addr, &data) != A_OK) { - ret = -EIO; - } - put_user(data, (unsigned int *)userdata + 1); - break; - } - case AR6000_XIOCTL_DIAG_WRITE: - { - A_UINT32 addr, data; - get_user(addr, (unsigned int *)userdata); - get_user(data, (unsigned int *)userdata + 1); - addr = TARG_VTOP(ar->arTargetType, addr); - if (ar6000_WriteRegDiag(ar->arHifDevice, &addr, &data) != A_OK) { - ret = -EIO; - } - break; - } - case AR6000_XIOCTL_WMI_SET_KEEPALIVE: - { - WMI_SET_KEEPALIVE_CMD setKeepAlive; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - goto ioctl_done; - } else if (copy_from_user(&setKeepAlive, userdata, - sizeof(setKeepAlive))){ - ret = -EFAULT; - } else { - if (wmi_set_keepalive_cmd(arPriv->arWmi, setKeepAlive.keepaliveInterval) != A_OK) { - ret = -EIO; - } - } - break; - } - case AR6000_XIOCTL_WMI_SET_PARAMS: - { - WMI_SET_PARAMS_CMD cmd; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - goto ioctl_done; - } else if (copy_from_user(&cmd, userdata, - sizeof(cmd))){ - ret = -EFAULT; - } else if (copy_from_user(&cmd, userdata, - sizeof(cmd) + cmd.length)) - { - ret = -EFAULT; - } else { - if (wmi_set_params_cmd(arPriv->arWmi, cmd.opcode, cmd.length, cmd.buffer) != A_OK) { - ret = -EIO; - } - } - break; - } - case AR6000_XIOCTL_WMI_SET_MCAST_FILTER: - { - WMI_SET_MCAST_FILTER_CMD cmd; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - goto ioctl_done; - } else if (copy_from_user(&cmd, userdata, - sizeof(cmd))){ - ret = -EFAULT; - } else { - if (wmi_set_mcast_filter_cmd(arPriv->arWmi, &cmd.multicast_mac[0]) != A_OK) { - ret = -EIO; - } - } - break; - } - case AR6000_XIOCTL_WMI_DEL_MCAST_FILTER: - { - WMI_SET_MCAST_FILTER_CMD cmd; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - goto ioctl_done; - } else if (copy_from_user(&cmd, userdata, - sizeof(cmd))){ - ret = -EFAULT; - } else { - if (wmi_del_mcast_filter_cmd(arPriv->arWmi, &cmd.multicast_mac[0]) != A_OK) { - ret = -EIO; - } - } - break; - } - case AR6000_XIOCTL_WMI_MCAST_FILTER: - { - WMI_MCAST_FILTER_CMD cmd; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - goto ioctl_done; - } else if (copy_from_user(&cmd, userdata, - sizeof(cmd))){ - ret = -EFAULT; - } else { - if (wmi_mcast_filter_cmd(arPriv->arWmi, cmd.enable) != A_OK) { - ret = -EIO; - } - } - break; - } - case AR6000_XIOCTL_WMI_GET_KEEPALIVE: - { - WMI_GET_KEEPALIVE_CMD getKeepAlive; - int ret = 0; - if (ar->bIsDestroyProgress) { - ret =-EBUSY; - goto ioctl_done; - } - if (ar->arWmiReady == FALSE) { - ret = -EIO; - goto ioctl_done; - } - if (down_interruptible(&ar->arSem)) { - ret = -ERESTARTSYS; - goto ioctl_done; - } - if (ar->bIsDestroyProgress) { - up(&ar->arSem); - ret = -EBUSY; - goto ioctl_done; - } - if (copy_from_user(&getKeepAlive, userdata,sizeof(getKeepAlive))) { - ret = -EFAULT; - } else { - getKeepAlive.keepaliveInterval = wmi_get_keepalive_cmd(arPriv->arWmi); - arSta->arKeepaliveConfigured = 0xFF; - if (wmi_get_keepalive_configured(arPriv->arWmi) != A_OK){ - up(&ar->arSem); - ret = -EIO; - goto ioctl_done; - } - wait_event_interruptible_timeout(arPriv->arEvent, arSta->arKeepaliveConfigured != 0xFF, wmitimeout * HZ); - if (signal_pending(current)) { - ret = -EINTR; - } - - if (!ret) { - getKeepAlive.configured = arSta->arKeepaliveConfigured; - } - if (copy_to_user(userdata, &getKeepAlive, sizeof(getKeepAlive))) { - ret = -EFAULT; - } - } - up(&ar->arSem); - break; - } - case AR6000_XIOCTL_WMI_SET_APPIE: - { - WMI_SET_APPIE_CMD appIEcmd; - A_UINT8 appIeInfo[IEEE80211_APPIE_FRAME_MAX_LEN]; - A_UINT32 fType,ieLen; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - goto ioctl_done; - } - get_user(fType, (A_UINT32 *)userdata); - appIEcmd.mgmtFrmType = fType; - if (appIEcmd.mgmtFrmType >= IEEE80211_APPIE_NUM_OF_FRAME) { - ret = -EIO; - } else { - get_user(ieLen, (A_UINT32 *)(userdata + 4)); - appIEcmd.ieLen = ieLen; - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("WPSIE: Type-%d, Len-%d\n",appIEcmd.mgmtFrmType, appIEcmd.ieLen)); - if (appIEcmd.ieLen > IEEE80211_APPIE_FRAME_MAX_LEN) { - ret = -EIO; - break; - } - if (copy_from_user(appIeInfo, userdata + 8, appIEcmd.ieLen)) { - ret = -EFAULT; - } else { - if (wmi_set_appie_cmd(arPriv->arWmi, appIEcmd.mgmtFrmType, - appIEcmd.ieLen, appIeInfo) != A_OK) - { - ret = -EIO; - } - } - } - break; - } - case AR6000_XIOCTL_WMI_SET_MGMT_FRM_RX_FILTER: - { - WMI_BSS_FILTER_CMD cmd; - A_UINT32 filterType; - - if (copy_from_user(&filterType, userdata, sizeof(A_UINT32))) - { - ret = -EFAULT; - goto ioctl_done; - } - if (filterType & (IEEE80211_FILTER_TYPE_BEACON | - IEEE80211_FILTER_TYPE_PROBE_RESP)) - { - cmd.bssFilter = ALL_BSS_FILTER; - } else { - cmd.bssFilter = NONE_BSS_FILTER; - } - if (wmi_bssfilter_cmd(arPriv->arWmi, cmd.bssFilter, 0) != A_OK) { - ret = -EIO; - } else { - arSta->arUserBssFilter = cmd.bssFilter; - } - - AR6000_SPIN_LOCK(&arPriv->arPrivLock, 0); - arSta->arMgmtFilter = filterType; - AR6000_SPIN_UNLOCK(&arPriv->arPrivLock, 0); - break; - } - case AR6000_XIOCTL_WMI_SET_WSC_STATUS: - { - A_UINT32 wsc_status; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - goto ioctl_done; - } else if (copy_from_user(&wsc_status, userdata, sizeof(A_UINT32))) { - ret = -EFAULT; - goto ioctl_done; - } - if (wmi_set_wsc_status_cmd(arPriv->arWmi, wsc_status) != A_OK) { - ret = -EIO; - } - break; - } - case AR6000_XIOCTL_BMI_ROMPATCH_INSTALL: - { - A_UINT32 ROM_addr; - A_UINT32 RAM_addr; - A_UINT32 nbytes; - A_UINT32 do_activate; - A_UINT32 rompatch_id; - - get_user(ROM_addr, (A_UINT32 *)userdata); - get_user(RAM_addr, (A_UINT32 *)userdata + 1); - get_user(nbytes, (A_UINT32 *)userdata + 2); - get_user(do_activate, (A_UINT32 *)userdata + 3); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Install rompatch from ROM: 0x%x to RAM: 0x%x length: %d\n", - ROM_addr, RAM_addr, nbytes)); - ret = BMIrompatchInstall(hifDevice, ROM_addr, RAM_addr, - nbytes, do_activate, &rompatch_id); - if (ret == A_OK) { - put_user(rompatch_id, (unsigned int *)rq->ifr_data); /* return value */ - } - break; - } - - case AR6000_XIOCTL_BMI_ROMPATCH_UNINSTALL: - { - A_UINT32 rompatch_id; - - get_user(rompatch_id, (A_UINT32 *)userdata); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("UNinstall rompatch_id %d\n", rompatch_id)); - ret = BMIrompatchUninstall(hifDevice, rompatch_id); - break; - } - - case AR6000_XIOCTL_BMI_ROMPATCH_ACTIVATE: - case AR6000_XIOCTL_BMI_ROMPATCH_DEACTIVATE: - { - A_UINT32 rompatch_count; - - get_user(rompatch_count, (A_UINT32 *)userdata); - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Change rompatch activation count=%d\n", rompatch_count)); - length = sizeof(A_UINT32) * rompatch_count; - if ((buffer = (unsigned char *)A_MALLOC(length)) != NULL) { - A_MEMZERO(buffer, length); - if (copy_from_user(buffer, &userdata[sizeof(rompatch_count)], length)) - { - ret = -EFAULT; - } else { - if (cmd == AR6000_XIOCTL_BMI_ROMPATCH_ACTIVATE) { - ret = BMIrompatchActivate(hifDevice, rompatch_count, (A_UINT32 *)buffer); - } else { - ret = BMIrompatchDeactivate(hifDevice, rompatch_count, (A_UINT32 *)buffer); - } - } - A_FREE(buffer); - } else { - ret = -ENOMEM; - } - - break; - } - case AR6000_XIOCTL_SET_IP: - { - WMI_SET_IP_CMD setIP; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&setIP, userdata, - sizeof(setIP))) { - ret = -EFAULT; - } else { - if (wmi_set_ip_cmd(arPriv->arWmi, - &setIP) != A_OK) - { - ret = -EIO; - } - } - break; - } - - case AR6000_XIOCTL_WMI_SET_HOST_SLEEP_MODE: - { - WMI_SET_HOST_SLEEP_MODE_CMD setHostSleepMode; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&setHostSleepMode, userdata, - sizeof(setHostSleepMode))) { - ret = -EFAULT; - } else { - if (wmi_set_host_sleep_mode_cmd(arPriv->arWmi, - &setHostSleepMode) != A_OK) - { - ret = -EIO; - } - } - break; - } - case AR6000_XIOCTL_WMI_SET_WOW_MODE: - { - WMI_SET_WOW_MODE_CMD setWowMode; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&setWowMode, userdata, - sizeof(setWowMode))) { - ret = -EFAULT; - } else { - if (wmi_set_wow_mode_cmd(arPriv->arWmi, - &setWowMode) != A_OK) - { - ret = -EIO; - } - } - break; - } - case AR6000_XIOCTL_WMI_GET_WOW_LIST: - { - WMI_GET_WOW_LIST_CMD getWowList; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&getWowList, userdata, - sizeof(getWowList))) { - ret = -EFAULT; - } else { - if (wmi_get_wow_list_cmd(arPriv->arWmi, - &getWowList) != A_OK) - { - ret = -EIO; - } - } - break; - } - case AR6000_XIOCTL_WMI_ADD_WOW_PATTERN: - { -#define WOW_PATTERN_SIZE 64 -#define WOW_MASK_SIZE 64 - - WMI_ADD_WOW_PATTERN_CMD cmd; - A_UINT8 mask_data[WOW_PATTERN_SIZE]={0}; - A_UINT8 pattern_data[WOW_PATTERN_SIZE]={0}; - - do { - if (ar->arWmiReady == FALSE) { - ret = -EIO; - break; - } - if(copy_from_user(&cmd, userdata, - sizeof(WMI_ADD_WOW_PATTERN_CMD))) - { - ret = -EFAULT; - break; - } - if (copy_from_user(pattern_data, - userdata + 3, - cmd.filter_size)) - { - ret = -EFAULT; - break; - } - if (copy_from_user(mask_data, - (userdata + 3 + cmd.filter_size), - cmd.filter_size)) - { - ret = -EFAULT; - break; - } - if (wmi_add_wow_pattern_cmd(arPriv->arWmi, - &cmd, pattern_data, mask_data, cmd.filter_size) != A_OK) - { - ret = -EIO; - } - } while(FALSE); -#undef WOW_PATTERN_SIZE -#undef WOW_MASK_SIZE - break; - } - case AR6000_XIOCTL_WMI_DEL_WOW_PATTERN: - { - WMI_DEL_WOW_PATTERN_CMD delWowPattern; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&delWowPattern, userdata, - sizeof(delWowPattern))) { - ret = -EFAULT; - } else { - if (wmi_del_wow_pattern_cmd(arPriv->arWmi, - &delWowPattern) != A_OK) - { - ret = -EIO; - } - } - break; - } - case AR6000_XIOCTL_DUMP_HTC_CREDIT_STATE: - if (ar->arHtcTarget != NULL) { -#ifdef ATH_DEBUG_MODULE - HTCDumpCreditStates(ar->arHtcTarget); -#endif /* ATH_DEBUG_MODULE */ -#ifdef HTC_EP_STAT_PROFILING - { - HTC_ENDPOINT_STATS stats; - int i; - - for (i = 0; i < 5; i++) { - if (HTCGetEndpointStatistics(ar->arHtcTarget, - i, - HTC_EP_STAT_SAMPLE_AND_CLEAR, - &stats)) { - A_PRINTF(KERN_ALERT"------- Profiling Endpoint : %d \n", i); - A_PRINTF(KERN_ALERT"TxCreditLowIndications : %d \n", stats.TxCreditLowIndications); - A_PRINTF(KERN_ALERT"TxIssued : %d \n", stats.TxIssued); - A_PRINTF(KERN_ALERT"TxDropped: %d \n", stats.TxDropped); - A_PRINTF(KERN_ALERT"TxPacketsBundled : %d \n", stats.TxPacketsBundled); - A_PRINTF(KERN_ALERT"TxBundles : %d \n", stats.TxBundles); - A_PRINTF(KERN_ALERT"TxCreditRpts : %d \n", stats.TxCreditRpts); - A_PRINTF(KERN_ALERT"TxCreditsRptsFromRx : %d \n", stats.TxCreditRptsFromRx); - A_PRINTF(KERN_ALERT"TxCreditsRptsFromOther : %d \n", stats.TxCreditRptsFromOther); - A_PRINTF(KERN_ALERT"TxCreditsRptsFromEp0 : %d \n", stats.TxCreditRptsFromEp0); - A_PRINTF(KERN_ALERT"TxCreditsFromRx : %d \n", stats.TxCreditsFromRx); - A_PRINTF(KERN_ALERT"TxCreditsFromOther : %d \n", stats.TxCreditsFromOther); - A_PRINTF(KERN_ALERT"TxCreditsFromEp0 : %d \n", stats.TxCreditsFromEp0); - A_PRINTF(KERN_ALERT"TxCreditsConsummed : %d \n", stats.TxCreditsConsummed); - A_PRINTF(KERN_ALERT"TxCreditsReturned : %d \n", stats.TxCreditsReturned); - A_PRINTF(KERN_ALERT"RxReceived : %d \n", stats.RxReceived); - A_PRINTF(KERN_ALERT"RxPacketsBundled : %d \n", stats.RxPacketsBundled); - A_PRINTF(KERN_ALERT"RxLookAheads : %d \n", stats.RxLookAheads); - A_PRINTF(KERN_ALERT"RxBundleLookAheads : %d \n", stats.RxBundleLookAheads); - A_PRINTF(KERN_ALERT"RxBundleIndFromHdr : %d \n", stats.RxBundleIndFromHdr); - A_PRINTF(KERN_ALERT"RxAllocThreshHit : %d \n", stats.RxAllocThreshHit); - A_PRINTF(KERN_ALERT"RxAllocThreshBytes : %d \n", stats.RxAllocThreshBytes); - A_PRINTF(KERN_ALERT"---- \n"); - - } - } - } -#endif - } - break; - case AR6000_XIOCTL_TRAFFIC_ACTIVITY_CHANGE: - if (ar->arHtcTarget != NULL) { - struct ar6000_traffic_activity_change data; - - if (copy_from_user(&data, userdata, sizeof(data))) - { - ret = -EFAULT; - goto ioctl_done; - } - /* note, this is used for testing (mbox ping testing), indicate activity - * change using the stream ID as the traffic class */ - ar6000_indicate_tx_activity(arPriv, - (A_UINT8)data.StreamID, - data.Active ? TRUE : FALSE); - } - break; - case AR6000_XIOCTL_WMI_SET_CONNECT_CTRL_FLAGS: - { - A_UINT32 connectCtrlFlags; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&connectCtrlFlags, userdata, - sizeof(connectCtrlFlags))) - { - ret = -EFAULT; - } else { - arSta->arConnectCtrlFlags = connectCtrlFlags; - } - } - break; - case AR6000_XIOCTL_WMI_SET_AKMP_PARAMS: - { - WMI_SET_AKMP_PARAMS_CMD akmpParams; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&akmpParams, userdata, - sizeof(WMI_SET_AKMP_PARAMS_CMD))) - { - ret = -EFAULT; - } else { - if (wmi_set_akmp_params_cmd(arPriv->arWmi, &akmpParams) != A_OK) { - ret = -EIO; - } - } - break; - } - case AR6000_XIOCTL_WMI_SET_PMKID_LIST: - { - WMI_SET_PMKID_LIST_CMD pmkidInfo; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - break; - } - if (copy_from_user(&pmkidInfo.numPMKID, userdata, - sizeof(pmkidInfo.numPMKID))) { - ret = -EFAULT; - break; - } - if (copy_from_user(&pmkidInfo.pmkidList, - userdata + sizeof(pmkidInfo.numPMKID), - pmkidInfo.numPMKID * sizeof(WMI_PMKID))) - { - ret = -EFAULT; - break; - } - if (wmi_set_pmkid_list_cmd(arPriv->arWmi, &pmkidInfo) != A_OK) { - ret = -EIO; - } - break; - } - case AR6000_XIOCTL_WMI_GET_PMKID_LIST: - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (wmi_get_pmkid_list_cmd(arPriv->arWmi) != A_OK) { - ret = -EIO; - } - break; - case AR6000_XIOCTL_WMI_ABORT_SCAN: - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } - ret = wmi_abort_scan_cmd(arPriv->arWmi); - break; - case AR6000_XIOCTL_AP_HIDDEN_SSID: - { - A_UINT8 hidden_ssid; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&hidden_ssid, userdata, sizeof(hidden_ssid))) { - ret = -EFAULT; - } else { - wmi_ap_set_hidden_ssid(arPriv->arWmi, hidden_ssid); - arAp->ap_hidden_ssid = hidden_ssid; - arPriv->ap_profile_flag = 1; /* There is a change in profile */ - } - break; - } - case AR6000_XIOCTL_AP_GET_STA_LIST: - { - WMI_SET_HT_CAP_CMD htCap; - - htCap.band = A_BAND_24GHZ; - if(arPriv->phymode == WMI_11A_MODE) { - htCap.band = A_BAND_5GHZ; - } - wmi_get_ht_cap_cmd(arPriv->arWmi, &htCap); - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else { - A_UINT8 i, j=0; - ap_get_sta_t temp; - A_MEMZERO(&temp, sizeof(temp)); - for(i=0;iconnTbl[i].arPriv == arPriv) { - A_MEMCPY(temp.sta[j].mac, ar->connTbl[i].mac, ATH_MAC_LEN); - temp.sta[j].aid = ar->connTbl[i].aid; - temp.sta[j].keymgmt = ar->connTbl[i].keymgmt; - temp.sta[j].ucipher = ar->connTbl[i].ucipher; - temp.sta[j].auth = ar->connTbl[i].auth; - temp.sta[j].wmode = ar->connTbl[i].wmode; - if(htCap.enable == 2) { - /* Set MSB to indicate 11n-only mode */ - temp.sta[j].wmode |= 0x80; - } - j++; - } - } - if(copy_to_user((ap_get_sta_t *)rq->ifr_data, &temp, sizeof(temp))) { - ret = -EFAULT; - } - } - break; - } - case AR6000_XIOCTL_AP_SET_NUM_STA: - { - A_UINT8 num_sta; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&num_sta, userdata, sizeof(num_sta))) { - ret = -EFAULT; - } else { - ret = ar6000_ap_set_num_sta(ar, arPriv, num_sta); - } - break; - } - case AR6000_XIOCTL_AP_SET_DFS: - { -#ifdef ATH_SUPPORT_DFS - A_UINT8 enable; - if (copy_from_user(&enable, userdata, sizeof(enable))) { - ret = -EFAULT; - } else { - wmi_ap_set_dfs(arPriv->arWmi, enable); - } -#else - ret = -EIO; -#endif - break; - } - - case AR6000_XIOCTL_AP_SET_ACL_POLICY: - { - A_UINT8 policy; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&policy, userdata, sizeof(policy))) { - ret = -EFAULT; - } else { - if(!(policy & AP_ACL_RETAIN_LIST_MASK)) { - /* clear ACL list */ - memset(&arAp->g_acl,0,sizeof(WMI_AP_ACL)); - } - arAp->g_acl.policy = policy; - wmi_ap_set_acl_policy(arPriv->arWmi, policy); - } - break; - } - case AR6000_XIOCTL_AP_SET_ACL_MAC: - { - WMI_AP_ACL_MAC_CMD acl; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&acl, userdata, sizeof(acl))) { - ret = -EFAULT; - } else { - if(acl_add_del_mac(&arAp->g_acl, &acl)) { - wmi_ap_acl_mac_list(arPriv->arWmi, &acl); - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ACL list error\n")); - ret = -EIO; - } - } - break; - } - case AR6000_XIOCTL_AP_GET_ACL_LIST: - { - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if(copy_to_user((WMI_AP_ACL *)rq->ifr_data, &arAp->g_acl, - sizeof(WMI_AP_ACL))) { - ret = -EFAULT; - } - break; - } - case AR6000_XIOCTL_AP_COMMIT_CONFIG: - { - ret = ar6000_ap_mode_profile_commit(arPriv); - break; - } - case IEEE80211_IOCTL_GETWPAIE: - { - struct ieee80211req_wpaie wpaie; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&wpaie, userdata, sizeof(wpaie))) { - ret = -EFAULT; - } else if (ar6000_ap_mode_get_wpa_ie(arPriv, &wpaie)) { - ret = -EFAULT; - } else if(copy_to_user(userdata, &wpaie, sizeof(wpaie))) { - ret = -EFAULT; - } - break; - } - case AR6000_XIOCTL_AP_CONN_INACT_TIME: - { - A_UINT32 period; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&period, userdata, sizeof(period))) { - ret = -EFAULT; - } else { - wmi_ap_conn_inact_time(arPriv->arWmi, period); - } - break; - } - case AR6000_XIOCTL_AP_PROT_SCAN_TIME: - { - WMI_AP_PROT_SCAN_TIME_CMD bgscan; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&bgscan, userdata, sizeof(bgscan))) { - ret = -EFAULT; - } else { - wmi_ap_bgscan_time(arPriv->arWmi, bgscan.period_min, bgscan.dwell_ms); - } - break; - } - case AR6000_XIOCTL_AP_SET_COUNTRY: - { - ret = ar6000_ioctl_set_country(dev, rq); - break; - } - case AR6000_XIOCTL_AP_SET_DTIM: - { - WMI_AP_SET_DTIM_CMD d; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&d, userdata, sizeof(d))) { - ret = -EFAULT; - } else { - if(d.dtim > 0 && d.dtim < 11) { - arAp->ap_dtim_period = d.dtim; - wmi_ap_set_dtim(arPriv->arWmi, d.dtim); - arPriv->ap_profile_flag = 1; /* There is a change in profile */ - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("DTIM out of range. Valid range is [1-10]\n")); - ret = -EIO; - } - } - break; - } - case AR6000_XIOCTL_WMI_TARGET_EVENT_REPORT: - { - WMI_SET_TARGET_EVENT_REPORT_CMD evtCfgCmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } - if (copy_from_user(&evtCfgCmd, userdata, - sizeof(evtCfgCmd))) { - ret = -EFAULT; - break; - } - ret = wmi_set_target_event_report_cmd(arPriv->arWmi, &evtCfgCmd); - break; - } - case AR6000_XIOCTL_AP_CTRL_BSS_COMM: - { - A_UINT8 intra=0; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&intra, userdata, sizeof(intra))) { - ret = -EFAULT; - } else { - if(intra & 0x80) { /* interbss */ - ar->inter_bss = ( (intra & 0xF) ? 1 : 0 ); - } else { - arAp->intra_bss = ( intra ? 1 : 0 ); - } - } - /* If P2P is enabled on this device, also indicate intra_bss setting to the firmware - * so that it can be reflected in the Group Capability bit of the p2p-go. - */ -#ifdef P2P - { - NETWORK_SUBTYPE networkSubType = arPriv->arNetworkSubType; - - if (networkSubType == SUBTYPE_P2PDEV || - networkSubType == SUBTYPE_P2PCLIENT || - networkSubType == SUBTYPE_P2PGO) { - - WMI_P2P_SET_CMD set_p2p_config; - A_MEMZERO(&set_p2p_config, sizeof(WMI_P2P_SET_CMD)); - - set_p2p_config.config_id = WMI_P2P_CONFID_INTRA_BSS; - set_p2p_config.val.intra_bss.flag = intra; - - wmi_p2p_set_cmd(arPriv->arWmi, &set_p2p_config); - } - } -#endif /* P2P */ - break; - } - case AR6000_XIOCTL_DUMP_MODULE_DEBUG_INFO: - { - struct drv_debug_module_s moduleinfo; - - if (copy_from_user(&moduleinfo, userdata, sizeof(moduleinfo))) { - ret = -EFAULT; - break; - } - - a_dump_module_debug_info_by_name(moduleinfo.modulename); - ret = 0; - break; - } - case AR6000_XIOCTL_MODULE_DEBUG_SET_MASK: - { - struct drv_debug_module_s moduleinfo; - - if (copy_from_user(&moduleinfo, userdata, sizeof(moduleinfo))) { - ret = -EFAULT; - break; - } - - if (A_FAILED(a_set_module_mask(moduleinfo.modulename, moduleinfo.mask))) { - ret = -EFAULT; - } - - break; - } - case AR6000_XIOCTL_MODULE_DEBUG_GET_MASK: - { - struct drv_debug_module_s moduleinfo; - - if (copy_from_user(&moduleinfo, userdata, sizeof(moduleinfo))) { - ret = -EFAULT; - break; - } - - if (A_FAILED(a_get_module_mask(moduleinfo.modulename, &moduleinfo.mask))) { - ret = -EFAULT; - break; - } - - if (copy_to_user(userdata, &moduleinfo, sizeof(moduleinfo))) { - ret = -EFAULT; - break; - } - - break; - } -#ifdef ATH_AR6K_11N_SUPPORT - case AR6000_XIOCTL_DUMP_RCV_AGGR_STATS: - { - PACKET_LOG *copy_of_pkt_log; - - aggr_dump_stats(ar->connTbl[0].conn_aggr, ©_of_pkt_log); - if (copy_to_user(rq->ifr_data, copy_of_pkt_log, sizeof(PACKET_LOG))) { - ret = -EFAULT; - } - break; - } - case AR6000_XIOCTL_SETUP_AGGR: - { - WMI_ADDBA_REQ_CMD cmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - ret = -EFAULT; - } else { - wmi_setup_aggr_cmd(arPriv->arWmi, cmd.tid); - } - } - break; - - case AR6000_XIOCTL_DELE_AGGR: - { - WMI_DELBA_REQ_CMD cmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - ret = -EFAULT; - } else { - wmi_delete_aggr_cmd(arPriv->arWmi, cmd.tid, cmd.is_sender_initiator); - } - } - break; - - case AR6000_XIOCTL_ALLOW_AGGR: - { - WMI_ALLOW_AGGR_CMD cmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - ret = -EFAULT; - } else { - wmi_allow_aggr_cmd(arPriv->arWmi, cmd.tx_allow_aggr, cmd.rx_allow_aggr); - } - } - break; - - case AR6000_XIOCTL_SET_HT_CAP: - { - WMI_SET_HT_CAP_CMD htCap; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&htCap, userdata, sizeof(htCap))) { - ret = -EFAULT; - } else if (wmi_set_ht_cap_cmd(arPriv->arWmi, &htCap) != A_OK) { - ret = -EIO; - } - break; - } - - case AR6000_XIOCTL_GET_HT_CAP: - { - WMI_SET_HT_CAP_CMD htCap; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&htCap, userdata, sizeof(htCap))) { - ret = -EFAULT; - } else if (wmi_get_ht_cap_cmd(arPriv->arWmi, &htCap) != A_OK) { - ret = -EIO; - } else if(copy_to_user((WMI_SET_HT_CAP_CMD *)rq->ifr_data, - &htCap, sizeof(htCap))) { - ret = -EFAULT; - } - break; - } - - case AR6000_XIOCTL_SET_HT_OP: - { - WMI_SET_HT_OP_CMD htOp; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&htOp, userdata, - sizeof(htOp))){ - ret = -EFAULT; - } else { - - if (wmi_set_ht_op_cmd(arPriv->arWmi, htOp.sta_chan_width) != A_OK) - { - ret = -EIO; - } - } - break; - } -#endif - case AR6000_XIOCTL_ACL_DATA: - { - void *osbuf = NULL; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (ar6000_create_acl_data_osbuf(dev, (A_UINT8*)userdata, &osbuf) != A_OK) { - ret = -EIO; - } else { - if (wmi_data_hdr_add(arPriv->arWmi, osbuf, DATA_MSGTYPE, 0, WMI_DATA_HDR_DATA_TYPE_ACL,0,NULL) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("XIOCTL_ACL_DATA - wmi_data_hdr_add failed\n")); - } else { - /* Send data buffer over HTC */ - ar6000_acl_data_tx(osbuf, arPriv); - } - } - break; - } - case AR6000_XIOCTL_HCI_CMD: - { - char tmp_buf[512]; - A_INT8 i; - WMI_HCI_CMD *cmd = (WMI_HCI_CMD *)tmp_buf; - A_UINT8 size; - - size = sizeof(cmd->cmd_buf_sz); - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(cmd, userdata, size)) { - ret = -EFAULT; - } else if(copy_from_user(cmd->buf, userdata + size, cmd->cmd_buf_sz)) { - ret = -EFAULT; - } else { - if (wmi_send_hci_cmd(arPriv->arWmi, cmd->buf, cmd->cmd_buf_sz) != A_OK) { - ret = -EIO; - }else if(loghci) { - A_PRINTF_LOG("HCI Command To PAL --> \n"); - for(i = 0; i < cmd->cmd_buf_sz; i++) { - A_PRINTF_LOG("0x%02x ",cmd->buf[i]); - if((i % 10) == 0) { - A_PRINTF_LOG("\n"); - } - } - A_PRINTF_LOG("\n"); - A_PRINTF_LOG("==================================\n"); - } - } - break; - } - case AR6000_XIOCTL_WLAN_CONN_PRECEDENCE: - { - WMI_SET_BT_WLAN_CONN_PRECEDENCE cmd; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&cmd, userdata, sizeof(cmd))) { - ret = -EFAULT; - } else { - if (cmd.precedence == BT_WLAN_CONN_PRECDENCE_WLAN || - cmd.precedence == BT_WLAN_CONN_PRECDENCE_PAL) { - if ( wmi_set_wlan_conn_precedence_cmd(arPriv->arWmi, cmd.precedence) != A_OK) { - ret = -EIO; - } - } else { - ret = -EINVAL; - } - } - break; - } - case AR6000_XIOCTL_AP_GET_STAT: - { - ret = ar6000_ioctl_get_ap_stats(dev, rq); - break; - } - case AR6000_XIOCTL_SET_TX_SELECT_RATES: - { - WMI_SET_TX_SELECT_RATES_CMD masks; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&masks, userdata, - sizeof(masks))) { - ret = -EFAULT; - } else { - - if (wmi_set_tx_select_rates_cmd(arPriv->arWmi, masks.rateMasks) != A_OK) - { - ret = -EIO; - } - } - break; - } - case AR6000_XIOCTL_AP_GET_HIDDEN_SSID: - { - WMI_AP_HIDDEN_SSID_CMD ssid; - ssid.hidden_ssid = arAp->ap_hidden_ssid; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if(copy_to_user((WMI_AP_HIDDEN_SSID_CMD *)rq->ifr_data, - &ssid, sizeof(WMI_AP_HIDDEN_SSID_CMD))) { - ret = -EFAULT; - } - break; - } - case AR6000_XIOCTL_AP_GET_COUNTRY: - { - WMI_AP_SET_COUNTRY_CMD cty; - A_MEMCPY(cty.countryCode, arAp->ap_country_code, 3); - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if(copy_to_user((WMI_AP_SET_COUNTRY_CMD *)rq->ifr_data, - &cty, sizeof(WMI_AP_SET_COUNTRY_CMD))) { - ret = -EFAULT; - } - break; - } - case AR6000_XIOCTL_AP_GET_WMODE: - { - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if(copy_to_user((A_UINT8 *)rq->ifr_data, - &arPriv->phymode, sizeof(A_UINT8))) { - ret = -EFAULT; - } - break; - } - case AR6000_XIOCTL_AP_GET_DTIM: - { - WMI_AP_SET_DTIM_CMD dtim; - dtim.dtim = arAp->ap_dtim_period; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if(copy_to_user((WMI_AP_SET_DTIM_CMD *)rq->ifr_data, - &dtim, sizeof(WMI_AP_SET_DTIM_CMD))) { - ret = -EFAULT; - } - break; - } - case AR6000_XIOCTL_AP_GET_BINTVL: - { - WMI_BEACON_INT_CMD bi; - bi.beaconInterval = arAp->ap_beacon_interval; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if(copy_to_user((WMI_BEACON_INT_CMD *)rq->ifr_data, - &bi, sizeof(WMI_BEACON_INT_CMD))) { - ret = -EFAULT; - } - break; - } - case AR6000_XIOCTL_AP_GET_RTS: - { - WMI_SET_RTS_CMD rts; - rts.threshold = arAp->arRTS; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if(copy_to_user((WMI_SET_RTS_CMD *)rq->ifr_data, - &rts, sizeof(WMI_SET_RTS_CMD))) { - ret = -EFAULT; - } - break; - } - case AR6000_XIOCTL_FETCH_TARGET_REGS: - { - A_UINT32 targregs[AR6003_FETCH_TARG_REGS_COUNT]; - - if (ar->arTargetType == TARGET_TYPE_AR6003) { - ar6k_FetchTargetRegs(hifDevice, targregs); - if (copy_to_user((A_UINT32 *)rq->ifr_data, &targregs, sizeof(targregs))) - { - ret = -EFAULT; - } - } else { - ret = -EOPNOTSUPP; - } - break; - } - case AR6000_XIOCTL_AP_SET_11BG_RATESET: - { - WMI_AP_SET_11BG_RATESET_CMD rate; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&rate, userdata, sizeof(rate))) { - ret = -EFAULT; - } else { - wmi_ap_set_rateset(arPriv->arWmi, rate.rateset); - } - break; - } - case AR6000_XIOCTL_GET_WLAN_SLEEP_STATE: - { - WMI_REPORT_SLEEP_STATE_EVENT wmiSleepEvent ; - - if (ar->arWlanState == WLAN_ENABLED) { - wmiSleepEvent.sleepState = WMI_REPORT_SLEEP_STATUS_IS_AWAKE; - } else { - wmiSleepEvent.sleepState = WMI_REPORT_SLEEP_STATUS_IS_DEEP_SLEEP; - } - rq->ifr_ifru.ifru_ivalue = ar->arWlanState; /* return value */ - ar6000_send_event_to_app(arPriv, WMI_REPORT_SLEEP_STATE_EVENTID, (A_UINT8*)&wmiSleepEvent, - sizeof(WMI_REPORT_SLEEP_STATE_EVENTID)); - break; - } -#ifdef P2P - case AR6000_XIOCTL_WMI_P2P_DISCOVER: - { - WMI_BSS_FILTER_CMD filt; - - /*Issue the WMI_FIND CMD*/ - WMI_P2P_FIND_CMD find_param; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - break; - } - A_MEMZERO(&filt, sizeof(WMI_BSS_FILTER_CMD)); - /*Set BSS filter to ALL*/ - filt.bssFilter = ALL_BSS_FILTER; - - if (wmi_bssfilter_cmd(arPriv->arWmi, filt.bssFilter, filt.ieMask) - != A_OK) { - ret = -EIO; - } else { - arSta->arUserBssFilter = filt.bssFilter; - if (copy_from_user(&find_param, userdata, sizeof(WMI_P2P_FIND_CMD))) { - ret = -EFAULT; - } else { - p2p_clear_peers_reported_flag(A_WMI_GET_P2P_CTX(arPriv)); - wmi_p2p_discover(arPriv->arWmi, &find_param); - } - } - break; - } - case AR6000_XIOCTL_WMI_P2P_STOP_FIND: - { - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else { - wmi_p2p_stop_find(arPriv->arWmi); - } - break; - } - case AR6000_XIOCTL_WMI_P2P_CANCEL: - { - wmi_p2p_cancel(arPriv->arWmi); - break; - } - case AR6000_XIOCTL_WMI_P2P_LISTEN: - { - A_UINT32 timeout; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&timeout, userdata, sizeof(timeout))) { - ret = -EFAULT; - } else { - wmi_p2p_listen(arPriv->arWmi, timeout); - } - break; - } - case AR6000_XIOCTL_WMI_P2P_GO_NEG: - { - /*Issue the WMI_GO_NEG CMD*/ - WMI_P2P_GO_NEG_START_CMD go_param; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&go_param, userdata, sizeof(WMI_P2P_GO_NEG_START_CMD))) { - ret = -EFAULT; - } else { - if (p2p_go_neg_start(A_WMI_GET_P2P_CTX(arPriv), &go_param) - != A_OK) { - ret = -EFAULT; - } - } - break; - } - case AR6000_XIOCTL_WMI_P2P_AUTH_GO_NEG: - { - WMI_P2P_GO_NEG_START_CMD go_neg_auth_param; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&go_neg_auth_param, userdata, sizeof(WMI_P2P_GO_NEG_START_CMD))) { - ret = -EFAULT; - } else { - if (p2p_auth_go_neg(A_WMI_GET_P2P_CTX(arPriv), - &go_neg_auth_param) != A_OK) { - ret = -EFAULT; - } - } - break; - } - case AR6000_XIOCTL_WMI_P2P_REJECT: - { - A_UINT8 p2p_reject_peer[IEEE80211_ADDR_LEN]; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(p2p_reject_peer, userdata, - IEEE80211_ADDR_LEN)) { - ret = -EFAULT; - } else { - if (p2p_peer_reject(A_WMI_GET_P2P_CTX(arPriv), - p2p_reject_peer) != A_OK) { - ret = -EFAULT; - } - } - break; - } - case AR6000_XIOCTL_WMI_P2P_CONFIG: - { - WMI_P2P_SET_CONFIG_CMD set_p2p_config; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&set_p2p_config, userdata, sizeof(WMI_P2P_SET_CONFIG_CMD))) { - ret = -EFAULT; - } else { - wmi_p2p_set_config(arPriv->arWmi, &set_p2p_config); - } - break; - } - case AR6000_XIOCTL_WMI_WPS_CONFIG: - { - WMI_WPS_SET_CONFIG_CMD set_wps_config; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&set_wps_config, userdata, sizeof(WMI_WPS_SET_CONFIG_CMD))) { - ret = -EFAULT; - } else { - wmi_wps_set_config(arPriv->arWmi, &set_wps_config); - } - break; - } - case AR6000_XIOCTL_WMI_P2P_FINDNODE: - { - A_UINT8 macaddr[AR6000_ETH_ADDR_LEN]; - bss_t *ni; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(macaddr, userdata,AR6000_ETH_ADDR_LEN)) { - ret = -EFAULT; - } else { - ni = wmi_find_node(arPriv->arWmi, macaddr); - if (ni) { - if(copy_to_user((A_UINT16 *)rq->ifr_data, - &ni->ni_cie.ie_chan, sizeof(A_UINT16))) { - ret = -EFAULT; - } - } - else { - ret = -EFAULT; - } - } - break; - } - case AR6000_XIOCTL_WMI_P2P_GRP_INIT: - { - WMI_P2P_GRP_INIT_CMD p2p_grp_init_cmd; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&p2p_grp_init_cmd, userdata, - sizeof(WMI_P2P_GRP_INIT_CMD))) { - ret = -EFAULT; - } else { - wmi_p2p_grp_init_cmd(arPriv->arWmi, &p2p_grp_init_cmd); - } - break; - } - case AR6000_XIOCTL_WMI_P2P_GRP_FORMATION_DONE: - { - WMI_P2P_GRP_FORMATION_DONE_CMD p2p_grp_done_cmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&p2p_grp_done_cmd, userdata, - sizeof(WMI_P2P_GRP_FORMATION_DONE_CMD))) { - ret = -EFAULT; - } else { - wmi_p2p_grp_done_cmd(arPriv->arWmi, &p2p_grp_done_cmd); - } - break; - } - case AR6000_XIOCTL_WMI_P2P_INVITE: - { - WMI_P2P_INVITE_CMD p2p_invite_param; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&p2p_invite_param, userdata, - sizeof(WMI_P2P_INVITE_CMD))) { - ret = -EFAULT; - } else { - if (p2p_invite_cmd(A_WMI_GET_P2P_CTX(arPriv), &p2p_invite_param) - != A_OK) { - ret = -EFAULT; - } - } - break; - } - case AR6000_XIOCTL_WMI_P2P_PROV_DISC: - { - A_UINT8 peer[IEEE80211_ADDR_LEN]; - A_UINT16 wps_method; - A_UINT8 buf[8]; - - A_MEMZERO(peer, IEEE80211_ADDR_LEN); - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(buf, userdata, 8)) { - ret = -EFAULT; - } else { - A_MEMCPY(peer, buf, IEEE80211_ADDR_LEN); - wps_method = (*(A_UINT16 *)(&buf[6])); - - if (p2p_prov_disc_req(A_WMI_GET_P2P_CTX(arPriv), peer, wps_method) != A_OK) { - ret = -EFAULT; - } - } - - break; - } - case AR6000_XIOCTL_WMI_P2P_GET_IF_ADDR: - { - A_UINT8 buf[12]; - const A_UINT8 zero_mac[] = {0,0,0,0,0,0}; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(buf, userdata, 12)) { - ret = -EFAULT; - } else { - if (p2p_get_ifaddr(A_WMI_GET_P2P_CTX(arPriv), - buf) == A_OK) { - if(copy_to_user((A_UINT8 *)rq->ifr_data, - buf+6, IEEE80211_ADDR_LEN)) { - ret = -EFAULT; - } - } else { - if(copy_to_user((A_UINT8 *)rq->ifr_data, - zero_mac, IEEE80211_ADDR_LEN)) { - ret = -EFAULT; - } - } - } - break; - } - case AR6000_XIOCTL_WMI_P2P_GET_DEV_ADDR: - { - A_UINT8 buf[12]; - const A_UINT8 zero_mac[] = {0,0,0,0,0,0}; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(buf, userdata, 12)) { - ret = -EFAULT; - } else { - if (p2p_get_devaddr(A_WMI_GET_P2P_CTX(arPriv), - buf) == A_OK) { - if(copy_to_user((A_UINT8 *)rq->ifr_data, - buf+6, IEEE80211_ADDR_LEN)) { - ret = -EFAULT; - } - } else { - if(copy_to_user((A_UINT8 *)rq->ifr_data, - zero_mac, IEEE80211_ADDR_LEN)) { - ret = -EFAULT; - } - } - } - break; - } - case AR6000_XIOCTL_WMI_P2P_SET: - { - WMI_P2P_SET_CMD set_p2p_config; - A_MEMZERO(&set_p2p_config, sizeof(WMI_P2P_SET_CMD)); - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&set_p2p_config, userdata, sizeof(WMI_P2P_SET_CMD))) { - ret = -EFAULT; - } else { - wmi_p2p_set_cmd(arPriv->arWmi, &set_p2p_config); - } - break; - } - case AR6000_XIOCTL_WMI_P2P_PEER: - { - A_UINT8 buf[12]; - const A_UINT8 zero_mac[] = {0,0,0,0,0,0}; - - A_UINT8 peer_info_buf[1000]; - A_UINT32 peer_info_buf_used; - - int first_element; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(buf, userdata, 12)) { - ret = -EFAULT; - } else { - /* - * Check the "next" value set in driver_ar6003.c of the supplicant. - * This determines whether we have a "P2P_PEER FIRST" (if = 1) or - * "P2P_PEER NEXT-" (if = 2) command, or just a plain p2p_peer - * command (if = 0) - */ - if (buf[6] != 0) { - if (buf[6] == 1) { - first_element = 1; - } else { - first_element = 0; - } - peer_info_buf_used = p2p_get_next_addr(A_WMI_GET_P2P_CTX(arPriv), buf, peer_info_buf, sizeof(peer_info_buf), first_element); - if (peer_info_buf_used == 0) { - ret = -ENODEV; - } - *((A_UINT32 *)rq->ifr_data) = peer_info_buf_used; - if(copy_to_user(((A_UINT32 *)(rq->ifr_data)+1), - peer_info_buf, peer_info_buf_used)){ - ret = -EFAULT; - } - } else { - if (p2p_peer(A_WMI_GET_P2P_CTX(arPriv), - buf, *(buf+6)) == A_OK) { - peer_info_buf_used = p2p_get_peer_info(A_WMI_GET_P2P_CTX(arPriv), buf, - peer_info_buf, sizeof(peer_info_buf)); - *((A_UINT32 *)rq->ifr_data) = peer_info_buf_used; - if(copy_to_user(((A_UINT32 *)(rq->ifr_data)+1), - peer_info_buf, peer_info_buf_used)) { - ret = -EFAULT; - } - } else { - if(copy_to_user((A_UINT16 *)rq->ifr_data, - zero_mac, IEEE80211_ADDR_LEN)) { - ret = -EFAULT; - } - } - } - } - break; - } - case AR6000_XIOCTL_WMI_P2P_FLUSH: - { - p2p_free_all_devices(A_WMI_GET_P2P_CTX(arPriv)); - p2p_free_all_sd_queries(A_WMI_GET_P2P_CTX(arPriv)); - break; - } - case AR6000_XIOCTL_WMI_GET_GO_PARAMS: - { - A_UINT8 go_dev_addr[AR6000_ETH_ADDR_LEN]; - struct { - A_UINT16 oper_freq; - A_UINT8 ssid[WMI_MAX_SSID_LEN]; - A_UINT8 ssid_len; - } go_params; - - A_MEMZERO(&go_params, sizeof(go_params)); - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(go_dev_addr, - userdata, AR6000_ETH_ADDR_LEN)) { - ret = -EFAULT; - } else { - if (wmi_p2p_get_go_params(A_WMI_GET_P2P_CTX(arPriv), - go_dev_addr, &go_params.oper_freq, go_params.ssid, - &go_params.ssid_len) == A_OK) { - if(copy_to_user((A_UINT16 *)rq->ifr_data, - &go_params, sizeof(go_params))) { - ret = -EFAULT; - } - } else { - ret = -EFAULT; - } - } - break; - } - case AR6000_XIOCTL_WMI_P2P_AUTH_INVITE: - { - A_UINT8 auth_peer[IEEE80211_ADDR_LEN]={0,0,0,0,0,0}; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(auth_peer, userdata,IEEE80211_ADDR_LEN)) { - ret = -EFAULT; - } else { - if (p2p_auth_invite(A_WMI_GET_P2P_CTX(arPriv), - auth_peer) != A_OK) { - ret = -EFAULT; - } - } - break; - } - case AR6000_XIOCTL_WMI_P2P_SDPD_TX_CMD: - { - WMI_P2P_SDPD_TX_CMD sdpd_tx_cmd; - A_UINT32 qid = 0; - - A_MEMZERO(&sdpd_tx_cmd, sizeof(WMI_P2P_SDPD_TX_CMD)); - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&sdpd_tx_cmd, userdata, - sizeof(WMI_P2P_SDPD_TX_CMD))) { - ret = -EFAULT; - } else { - if (p2p_sdpd_tx_cmd(A_WMI_GET_P2P_CTX(arPriv), - &sdpd_tx_cmd, &qid) != - A_OK) { - ret = -EFAULT; - } else { - if(copy_to_user((A_UINT8 *)rq->ifr_data, - (void *)&qid, sizeof(A_UINT32))) { - ret = -EFAULT; - } - } - } - break; - } - case AR6000_XIOTCL_WMI_P2P_SD_CANCEL_REQUEST: - { - A_UINT32 qid; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&qid, userdata, sizeof(qid))) { - ret = -EFAULT; - } else if (p2p_sd_cancel_request(A_WMI_GET_P2P_CTX(arPriv),qid) != - A_OK) { - ret = -EFAULT; - } - break; - } - case AR6000_XIOCTL_WMI_GET_P2P_IE: - { - A_UINT8 buf[12]; - const A_UINT8 zero_mac[] = {0,0,0,0,0,0}; - A_UINT8 * p2p_buf = NULL; - A_UINT8 p2p_buf_len = 0; - - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(buf, userdata, 12)) { - ret = -EFAULT; - } else { - - if (p2p_peer(A_WMI_GET_P2P_CTX(arPriv), - buf, *(buf+6)) == A_OK) { - - p2p_get_device_p2p_buf(A_WMI_GET_P2P_CTX(arPriv),buf, &p2p_buf, &p2p_buf_len); - - if(p2p_buf) { - *((A_UINT8 *)rq->ifr_data) = p2p_buf_len; - - if(copy_to_user(((A_UINT8 *)(rq->ifr_data)+1), - p2p_buf, p2p_buf_len)) { - ret = -EFAULT; - } - } - } else { - if(copy_to_user((A_UINT16 *)rq->ifr_data, - zero_mac, IEEE80211_ADDR_LEN)) { - ret = -EFAULT; - } - } - } - break; - } -#endif /* P2P */ - -#ifdef CONFIG_PM - case AR6000_XIOCTL_SET_BT_HW_POWER_STATE: - { - unsigned int state; - get_user(state, (unsigned int *)userdata); - if (ar6000_set_bt_hw_state(ar, state)!=A_OK) { - ret = -EIO; - } - break; - } - case AR6000_XIOCTL_GET_BT_HW_POWER_STATE: - rq->ifr_ifru.ifru_ivalue = !ar->arBTOff; /* return value */ - break; -#endif - - case AR6000_XIOCTL_WMI_SET_TX_SGI_PARAM: - { - WMI_SET_TX_SGI_PARAM_CMD SGICmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&SGICmd, userdata, - sizeof(SGICmd))){ - ret = -EFAULT; - } else{ - if (wmi_SGI_cmd(arPriv->arWmi, SGICmd.sgiMask, SGICmd.sgiPERThreshold) != A_OK) { - ret = -EIO; - } - - } - break; - } - - case AR6000_XIOCTL_WMI_SET_PASSPHRASE: - { - ret = ar6000_xioctl_set_passphrase_cmd(dev, userdata); - break; - } - - case AR6000_XIOCTL_WMI_SET_EXCESS_TX_RETRY_THRES: - { - ret = ar6000_xioctl_set_excess_tx_retry_thres_cmd(dev, userdata); - break; - } - - case AR6000_XIOCTL_WMI_ENABLE_WAC_PARAM: - { - WMI_WAC_ENABLE_CMD cmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&cmd, userdata, sizeof(cmd))) - { - ret = -EFAULT; - } else { - if ( cmd.enable & 0x80 ) { - cmd.enable &= ~0x80; - ar6000_send_generic_event_to_app(arPriv, WMI_ENABLE_WAC_CMDID, - (A_UINT8*)&cmd, sizeof(WMI_WAC_ENABLE_CMD)); - } - else { - if (wmi_wac_enable_cmd(arPriv->arWmi, &cmd) - != A_OK) - { - ret = -EIO; - } - } - } - break; - } - - case AR6000_XIOCTL_WAC_SCAN_REPLY: - { - WMI_WAC_SCAN_REPLY_CMD cmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&cmd, userdata, sizeof(cmd))) - { - ret = -EFAULT; - } else { - if (wmi_wac_scan_reply_cmd(arPriv->arWmi, cmd.cmdid) - != A_OK) - { - ret = -EIO; - } - } - break; - } - - case AR6000_XIOCTL_WMI_WAC_CTRL_REQ: - { - WMI_WAC_CTRL_REQ_CMD cmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&cmd, userdata, sizeof(cmd))) - { - ret = -EFAULT; - } else { - if ( WAC_SET == cmd.req ) { - if (wmi_wac_ctrl_req_cmd(arPriv->arWmi, &cmd) - != A_OK) - { - ret = -EIO; - } - } - else if ( WAC_GET == cmd.req ) { - ret = ar6000_xioctl_wac_ctrl_req_get_cmd(dev, userdata, rq); - } - } - break; - } - - case AR6000_XIOCTL_WMI_SET_WPA_OFFLOAD_STATE: - { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - A_UINT8 wpaOffloadState = 0; - - if (copy_from_user(&wpaOffloadState, userdata, sizeof(A_UINT8))) { - ret = -EFAULT; - } else { - arSta->wpaOffloadEnabled = (wpaOffloadState) ? TRUE : FALSE; - } -#else - ret = -EOPNOTSUPP; -#endif /* LINUX_VERSION_CODE >= 2.6.27 */ - break; - } - - case AR6000_XIOCTL_BMI_NVRAM_PROCESS: - { - A_UCHAR seg_name[BMI_NVRAM_SEG_NAME_SZ+1]; - A_UINT32 rv = 0; - - if (copy_from_user(seg_name, userdata, sizeof(seg_name))) { - ret = -EFAULT; - break; - } - - seg_name[BMI_NVRAM_SEG_NAME_SZ] = '\0'; - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("Process NVRAM segment: %s\n", seg_name)); - - if (BMInvramProcess(hifDevice, seg_name, &rv) != A_OK) { - ret = -EIO; - } - put_user(rv, (unsigned int *)rq->ifr_data); /* return value */ - - break; - } - - case AR6000_XIOCTL_AP_ACS_DISABLE_HI_CHANNELS: - { - A_UINT32 acs; - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&acs, userdata, sizeof(acs))) { - ret = -EFAULT; - } else { - ar->arAcsDisableHiChannel = acs; - } - break; - } - - case AR6000_XIOCTL_WMI_FORCE_ASSERT: - { - if (wmi_force_target_assert(arPriv->arWmi) != A_OK) - { - ret = -EIO; - } - break; - } - - case AR6000_XIOCTL_WMI_SET_DIVERSITY_PARAM: - { - WMI_DIV_PARAMS_CMD cmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&cmd, userdata, sizeof(cmd))) - { - ret = -EFAULT; - } else - { - if (wmi_set_div_param_cmd(arPriv->arWmi, cmd.divIdleTime, cmd.antRssiThresh, cmd.divEnable, cmd.active_treshold_rate) - != A_OK) - { - ret = -EIO; - } - - } - break; - } - case AR6000_XIOCTL_AP_GET_NUM_STA: - { - A_UINT8 num_sta, ret_num_sta; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&num_sta, userdata, sizeof(num_sta))) { - ret = -EFAULT; - } else { - if(num_sta & 0x80) { - ret_num_sta = ar->gNumSta; - } else { - ret_num_sta = arPriv->num_sta; - } - if(copy_to_user((A_UINT8 *)rq->ifr_data, - &ret_num_sta, sizeof(A_UINT8))) { - ret = -EFAULT; - } - } - break; - } -#ifdef CONFIG_PM - case AR6000_XIOCTL_SUSPEND_DRIVER: - { - ar6000_suspend_ev(ar); - break; - } - case AR6000_XIOCTL_RESUME_DRIVER: - { - ar6000_resume_ev(ar); - break; - } -#endif - case AR6000_XIOCTL_GET_SUBMODE: - { - if (copy_to_user((A_UINT8 *)rq->ifr_data, &arPriv->arNetworkSubType, - sizeof(A_UINT8))) - { - ret = -EFAULT; - } - break; - } - case AR6000_XIOCTL_WMI_AP_SET_APSD: - { - WMI_AP_SET_APSD_CMD cmd; - - if (ar->arWmiReady == FALSE) { - ret = -EIO; - } else if (copy_from_user(&cmd, userdata, sizeof(WMI_AP_SET_APSD_CMD))) { - ret = -EFAULT; - } else { - if(wmi_ap_set_apsd(arPriv->arWmi, cmd.enable) != A_OK) { - ret = -EIO; - } else { - arPriv->ap_profile_flag = 1; /* There is a change in profile */ - } - } - break; - } - - default: - ret = -EOPNOTSUPP; - } - -ioctl_done: - rtnl_lock(); /* restore rtnl state */ - dev_put(dev); - - return ret; -} - -A_UINT8 mac_cmp_wild(A_UINT8 *mac, A_UINT8 *new_mac, A_UINT8 wild, A_UINT8 new_wild) -{ - A_UINT8 i; - - for(i=0;i=0;i--) - { - if(mac_cmp_wild(a->acl_mac[i], acl->mac, a->wildcard[i], - acl->wildcard)==0) - already_avail = i; - - if(!((1 << i) & a->index)) - free_slot = i; - } - - if(acl->action == ADD_MAC_ADDR) - { - /* Dont add mac if it is already available */ - if((already_avail >= 0) || (free_slot == -1)) - return 0; - - A_MEMCPY(a->acl_mac[free_slot], acl->mac, ATH_MAC_LEN); - a->index = a->index | (1 << free_slot); - acl->index = free_slot; - a->wildcard[free_slot] = acl->wildcard; - return 1; - } - else if(acl->action == DEL_MAC_ADDR) - { - if(acl->index > AP_ACL_SIZE) - return 0; - - if(!(a->index & (1 << acl->index))) - return 0; - - A_MEMZERO(a->acl_mac[acl->index],ATH_MAC_LEN); - a->index = a->index & ~(1 << acl->index); - a->wildcard[acl->index] = 0; - return 1; - } - - return 0; -} diff --git a/drivers/net/wireless/ar6003/host/os/linux/netbuf.c b/drivers/net/wireless/ar6003/host/os/linux/netbuf.c deleted file mode 100644 index 963b99e7cc9f..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/netbuf.c +++ /dev/null @@ -1,272 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ -#include -#include -#include -#include "athdefs.h" -#include "a_types.h" -#include "a_osapi.h" -#include "htc_packet.h" - -#define AR6000_DATA_OFFSET 64 - -void a_netbuf_enqueue(A_NETBUF_QUEUE_T *q, void *pkt) -{ - skb_queue_tail((struct sk_buff_head *) q, (struct sk_buff *) pkt); -} - -void a_netbuf_prequeue(A_NETBUF_QUEUE_T *q, void *pkt) -{ - skb_queue_head((struct sk_buff_head *) q, (struct sk_buff *) pkt); -} - -void *a_netbuf_dequeue(A_NETBUF_QUEUE_T *q) -{ - return((void *) skb_dequeue((struct sk_buff_head *) q)); -} - -int a_netbuf_queue_size(A_NETBUF_QUEUE_T *q) -{ - return(skb_queue_len((struct sk_buff_head *) q)); -} - -int a_netbuf_queue_empty(A_NETBUF_QUEUE_T *q) -{ - return(skb_queue_empty((struct sk_buff_head *) q)); -} - -void a_netbuf_queue_init(A_NETBUF_QUEUE_T *q) -{ - skb_queue_head_init((struct sk_buff_head *) q); -} - -#ifdef AR6K_ALLOC_DEBUG -void * -a_netbuf_alloc(int size, const char *func, int lineno) -#else -void * -a_netbuf_alloc(int size) -#endif -{ - struct sk_buff *skb; - size += 2 * (A_GET_CACHE_LINE_BYTES()); /* add some cacheline space at front and back of buffer */ - skb = dev_alloc_skb(AR6000_DATA_OFFSET + sizeof(HTC_PACKET) + size); - if (skb) { - skb_reserve(skb, AR6000_DATA_OFFSET + sizeof(HTC_PACKET) + A_GET_CACHE_LINE_BYTES()); -#ifdef AR6K_ALLOC_DEBUG - __a_meminfo_add(skb, size, func, lineno); -#endif - } - return ((void *)skb); -} - -/* - * Allocate an SKB w.o. any encapsulation requirement. - */ -#ifdef AR6K_ALLOC_DEBUG -void * -a_netbuf_alloc_raw(int size, const char *func, int lineno) -#else -void * -a_netbuf_alloc_raw(int size) -#endif -{ - struct sk_buff *skb; - - skb = dev_alloc_skb(size); -#ifdef AR6K_ALLOC_DEBUG - __a_meminfo_add(skb, size, func, lineno); -#endif - return ((void *)skb); -} - -void -a_netbuf_free(void *bufPtr) -{ - struct sk_buff *skb = (struct sk_buff *)bufPtr; -#ifdef AR6K_ALLOC_DEBUG - a_meminfo_del(bufPtr); -#endif - dev_kfree_skb(skb); -} - -A_UINT32 -a_netbuf_to_len(void *bufPtr) -{ - return (((struct sk_buff *)bufPtr)->len); -} - -void * -a_netbuf_to_data(void *bufPtr) -{ - return (((struct sk_buff *)bufPtr)->data); -} - -/* - * Add len # of bytes to the beginning of the network buffer - * pointed to by bufPtr - */ -A_STATUS -a_netbuf_push(void *bufPtr, A_INT32 len) -{ - skb_push((struct sk_buff *)bufPtr, len); - - return A_OK; -} - -/* - * Add len # of bytes to the beginning of the network buffer - * pointed to by bufPtr and also fill with data - */ -A_STATUS -a_netbuf_push_data(void *bufPtr, char *srcPtr, A_INT32 len) -{ - skb_push((struct sk_buff *) bufPtr, len); - A_MEMCPY(((struct sk_buff *)bufPtr)->data, srcPtr, len); - - return A_OK; -} - -/* - * Add len # of bytes to the end of the network buffer - * pointed to by bufPtr - */ -A_STATUS -a_netbuf_put(void *bufPtr, A_INT32 len) -{ - skb_put((struct sk_buff *)bufPtr, len); - - return A_OK; -} - -/* - * Add len # of bytes to the end of the network buffer - * pointed to by bufPtr and also fill with data - */ -A_STATUS -a_netbuf_put_data(void *bufPtr, char *srcPtr, A_INT32 len) -{ - char *start = (char*)(((struct sk_buff *)bufPtr)->data + - ((struct sk_buff *)bufPtr)->len); - skb_put((struct sk_buff *)bufPtr, len); - A_MEMCPY(start, srcPtr, len); - - return A_OK; -} - - -/* - * Trim the network buffer pointed to by bufPtr to len # of bytes - */ -A_STATUS -a_netbuf_setlen(void *bufPtr, A_INT32 len) -{ - skb_trim((struct sk_buff *)bufPtr, len); - - return A_OK; -} - -/* - * Chop of len # of bytes from the end of the buffer. - */ -A_STATUS -a_netbuf_trim(void *bufPtr, A_INT32 len) -{ - skb_trim((struct sk_buff *)bufPtr, ((struct sk_buff *)bufPtr)->len - len); - - return A_OK; -} - -/* - * Chop of len # of bytes from the end of the buffer and return the data. - */ -A_STATUS -a_netbuf_trim_data(void *bufPtr, char *dstPtr, A_INT32 len) -{ - char *start = (char*)(((struct sk_buff *)bufPtr)->data + - (((struct sk_buff *)bufPtr)->len - len)); - - A_MEMCPY(dstPtr, start, len); - skb_trim((struct sk_buff *)bufPtr, ((struct sk_buff *)bufPtr)->len - len); - - return A_OK; -} - - -/* - * Returns the number of bytes available to a a_netbuf_push() - */ -A_INT32 -a_netbuf_headroom(void *bufPtr) -{ - return (skb_headroom((struct sk_buff *)bufPtr)); -} - -/* - * Removes specified number of bytes from the beginning of the buffer - */ -A_STATUS -a_netbuf_pull(void *bufPtr, A_INT32 len) -{ - skb_pull((struct sk_buff *)bufPtr, len); - - return A_OK; -} - -/* - * Removes specified number of bytes from the beginning of the buffer - * and return the data - */ -A_STATUS -a_netbuf_pull_data(void *bufPtr, char *dstPtr, A_INT32 len) -{ - A_MEMCPY(dstPtr, ((struct sk_buff *)bufPtr)->data, len); - skb_pull((struct sk_buff *)bufPtr, len); - - return A_OK; -} - - -#ifdef AR6K_ALLOC_DEBUG -void a_netbuf_check(void *bufPtr, const char *func, int lineno) -{ - struct sk_buff *skb = (struct sk_buff *)bufPtr; - A_UINT32 len; - A_BOOL found = FALSE; - found = a_meminfo_find(skb); - - if (found == FALSE) - { - len = A_NETBUF_LEN(skb); - __a_meminfo_add(skb, len, func, lineno); - } -} -#endif - -#ifdef EXPORT_HCI_BRIDGE_INTERFACE -EXPORT_SYMBOL(a_netbuf_to_data); -EXPORT_SYMBOL(a_netbuf_put); -EXPORT_SYMBOL(a_netbuf_pull); -EXPORT_SYMBOL(a_netbuf_alloc); -EXPORT_SYMBOL(a_netbuf_free); -#endif diff --git a/drivers/net/wireless/ar6003/host/os/linux/wireless_ext.c b/drivers/net/wireless/ar6003/host/os/linux/wireless_ext.c deleted file mode 100644 index 3413ba376b97..000000000000 --- a/drivers/net/wireless/ar6003/host/os/linux/wireless_ext.c +++ /dev/null @@ -1,2945 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Communications Inc. -// All rights reserved. -// -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// -// Author(s): ="Atheros" -//------------------------------------------------------------------------------ - -#include "ar6000_drv.h" - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) -#define IWE_STREAM_ADD_EVENT(p1, p2, p3, p4, p5) \ - iwe_stream_add_event((p1), (p2), (p3), (p4), (p5)) -#else -#define IWE_STREAM_ADD_EVENT(p1, p2, p3, p4, p5) \ - iwe_stream_add_event((p2), (p3), (p4), (p5)) -#endif - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) -#define IWE_STREAM_ADD_POINT(p1, p2, p3, p4, p5) \ - iwe_stream_add_point((p1), (p2), (p3), (p4), (p5)) -#else -#define IWE_STREAM_ADD_POINT(p1, p2, p3, p4, p5) \ - iwe_stream_add_point((p2), (p3), (p4), (p5)) -#endif - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) -#define IWE_STREAM_ADD_VALUE(p1, p2, p3, p4, p5, p6) \ - iwe_stream_add_value((p1), (p2), (p3), (p4), (p5), (p6)) -#else -#define IWE_STREAM_ADD_VALUE(p1, p2, p3, p4, p5, p6) \ - iwe_stream_add_value((p2), (p3), (p4), (p5), (p6)) -#endif - -static void ar6000_set_quality(struct iw_quality *iq, A_INT8 rssi); -extern unsigned int wmitimeout; - -#if WIRELESS_EXT > 14 -/* - * Encode a WPA or RSN information element as a custom - * element using the hostap format. - */ -static u_int -encode_ie(void *buf, size_t bufsize, - const u_int8_t *ie, size_t ielen, - const char *leader, size_t leader_len) -{ - u_int8_t *p; - int i; - - if (bufsize < leader_len) - return 0; - p = buf; - memcpy(p, leader, leader_len); - bufsize -= leader_len; - p += leader_len; - for (i = 0; i < ielen && bufsize > 2; i++) - { - p += sprintf((char*)p, "%02x", ie[i]); - bufsize -= 2; - } - return (i == ielen ? p - (u_int8_t *)buf : 0); -} -#endif /* WIRELESS_EXT > 14 */ - -static A_UINT8 -get_bss_phy_capability(bss_t *bss) -{ - A_UINT8 capability = 0; - struct ieee80211_common_ie *cie = &bss->ni_cie; -#define CHAN_IS_11A(x) (!((x >= 2412) && (x <= 2484))) - if (CHAN_IS_11A(cie->ie_chan)) { - if (cie->ie_htcap) { - capability = WMI_11NA_CAPABILITY; - } else { - capability = WMI_11A_CAPABILITY; - } - } else if ((cie->ie_erp) || (cie->ie_xrates)) { - if (cie->ie_htcap) { - capability = WMI_11NG_CAPABILITY; - } else { - capability = WMI_11G_CAPABILITY; - } - } - return capability; -} - -void -ar6000_scan_node(void *arg, bss_t *ni) -{ - struct iw_event iwe; -#if WIRELESS_EXT > 14 - char buf[256]; -#endif - struct ar_giwscan_param *param; - A_CHAR *current_ev; - A_CHAR *end_buf; - struct ieee80211_common_ie *cie; - A_CHAR *current_val; - A_INT32 j; - A_UINT32 rate_len, data_len = 0; - - /* Node table now contains entries from P2P Action frames and Probe Request also. Return - * if the frame type is an action frame/ Probe request. - */ - if ((ni->ni_frametype == ACTION_MGMT_FTYPE) || (ni->ni_frametype == PROBEREQ_FTYPE) || (ni->ni_buf == NULL)) { - return; - } - - param = (struct ar_giwscan_param *)arg; - - current_ev = param->current_ev; - end_buf = param->end_buf; - - cie = &ni->ni_cie; - - if ((end_buf - current_ev) > IW_EV_ADDR_LEN) - { - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = SIOCGIWAP; - iwe.u.ap_addr.sa_family = ARPHRD_ETHER; - A_MEMCPY(iwe.u.ap_addr.sa_data, ni->ni_macaddr, 6); - current_ev = IWE_STREAM_ADD_EVENT(param->info, current_ev, end_buf, - &iwe, IW_EV_ADDR_LEN); - } - param->bytes_needed += IW_EV_ADDR_LEN; - - data_len = cie->ie_ssid[1] + IW_EV_POINT_LEN; - if ((end_buf - current_ev) > data_len) - { - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = SIOCGIWESSID; - iwe.u.data.flags = 1; - iwe.u.data.length = cie->ie_ssid[1]; - current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, end_buf, - &iwe, (char*)&cie->ie_ssid[2]); - } - param->bytes_needed += data_len; - - if (cie->ie_capInfo & (IEEE80211_CAPINFO_ESS|IEEE80211_CAPINFO_IBSS)) { - if ((end_buf - current_ev) > IW_EV_UINT_LEN) - { - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = SIOCGIWMODE; - iwe.u.mode = cie->ie_capInfo & IEEE80211_CAPINFO_ESS ? - IW_MODE_MASTER : IW_MODE_ADHOC; - current_ev = IWE_STREAM_ADD_EVENT(param->info, current_ev, end_buf, - &iwe, IW_EV_UINT_LEN); - } - param->bytes_needed += IW_EV_UINT_LEN; - } - - if ((end_buf - current_ev) > IW_EV_FREQ_LEN) - { - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = SIOCGIWFREQ; - iwe.u.freq.m = cie->ie_chan * 100000; - iwe.u.freq.e = 1; - current_ev = IWE_STREAM_ADD_EVENT(param->info, current_ev, end_buf, - &iwe, IW_EV_FREQ_LEN); - } - param->bytes_needed += IW_EV_FREQ_LEN; - - if ((end_buf - current_ev) > IW_EV_QUAL_LEN) - { - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = IWEVQUAL; - ar6000_set_quality(&iwe.u.qual, ni->ni_snr); - current_ev = IWE_STREAM_ADD_EVENT(param->info, current_ev, end_buf, - &iwe, IW_EV_QUAL_LEN); - } - param->bytes_needed += IW_EV_QUAL_LEN; - - if ((end_buf - current_ev) > IW_EV_POINT_LEN) - { - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = SIOCGIWENCODE; - if (cie->ie_capInfo & IEEE80211_CAPINFO_PRIVACY) { - iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; - } else { - iwe.u.data.flags = IW_ENCODE_DISABLED; - } - iwe.u.data.length = 0; - current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, end_buf, - &iwe, ""); - } - param->bytes_needed += IW_EV_POINT_LEN; - - /* supported bit rate */ - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = SIOCGIWRATE; - iwe.u.bitrate.fixed = 0; - iwe.u.bitrate.disabled = 0; - iwe.u.bitrate.value = 0; - current_val = current_ev + IW_EV_LCP_LEN; - param->bytes_needed += IW_EV_LCP_LEN; - - if (cie->ie_rates != NULL) { - rate_len = cie->ie_rates[1]; - data_len = (rate_len * (IW_EV_PARAM_LEN - IW_EV_LCP_LEN)); - if ((end_buf - current_ev) > data_len) - { - for (j = 0; j < rate_len; j++) { - unsigned char val; - val = cie->ie_rates[2 + j]; - iwe.u.bitrate.value = - (val >= 0x80)? ((val - 0x80) * 500000): (val * 500000); - current_val = IWE_STREAM_ADD_VALUE(param->info, current_ev, - current_val, end_buf, - &iwe, IW_EV_PARAM_LEN); - } - } - param->bytes_needed += data_len; - } - - if (cie->ie_xrates != NULL) { - rate_len = cie->ie_xrates[1]; - data_len = (rate_len * (IW_EV_PARAM_LEN - IW_EV_LCP_LEN)); - if ((end_buf - current_ev) > data_len) - { - for (j = 0; j < rate_len; j++) { - unsigned char val; - val = cie->ie_xrates[2 + j]; - iwe.u.bitrate.value = - (val >= 0x80)? ((val - 0x80) * 500000): (val * 500000); - current_val = IWE_STREAM_ADD_VALUE(param->info, current_ev, - current_val, end_buf, - &iwe, IW_EV_PARAM_LEN); - } - } - param->bytes_needed += data_len; - } - /* remove fixed header if no rates were added */ - if ((current_val - current_ev) > IW_EV_LCP_LEN) - current_ev = current_val; - -#if WIRELESS_EXT >= 18 - /* IE */ - if (cie->ie_wpa != NULL) { - data_len = cie->ie_wpa[1] + 2 + IW_EV_POINT_LEN; - if ((end_buf - current_ev) > data_len) - { - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = IWEVGENIE; - iwe.u.data.length = cie->ie_wpa[1] + 2; - current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, end_buf, - &iwe, (char*)cie->ie_wpa); - } - param->bytes_needed += data_len; - } - - if (cie->ie_rsn != NULL && cie->ie_rsn[0] == IEEE80211_ELEMID_RSN) { - data_len = cie->ie_rsn[1] + 2 + IW_EV_POINT_LEN; - if ((end_buf - current_ev) > data_len) - { - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = IWEVGENIE; - iwe.u.data.length = cie->ie_rsn[1] + 2; - current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, end_buf, - &iwe, (char*)cie->ie_rsn); - } - param->bytes_needed += data_len; - } - -#endif /* WIRELESS_EXT >= 18 */ - - if ((end_buf - current_ev) > IW_EV_CHAR_LEN) - { - /* protocol */ - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = SIOCGIWNAME; - switch (get_bss_phy_capability(ni)) { - case WMI_11A_CAPABILITY: - snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11a"); - break; - case WMI_11G_CAPABILITY: - snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11g"); - break; - case WMI_11NA_CAPABILITY: - snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11na"); - break; - case WMI_11NG_CAPABILITY: - snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11ng"); - break; - default: - snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11b"); - break; - } - current_ev = IWE_STREAM_ADD_EVENT(param->info, current_ev, end_buf, - &iwe, IW_EV_CHAR_LEN); - } - param->bytes_needed += IW_EV_CHAR_LEN; - -#if WIRELESS_EXT > 14 - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = IWEVCUSTOM; - iwe.u.data.length = snprintf(buf, sizeof(buf), "bcn_int=%d", cie->ie_beaconInt); - data_len = iwe.u.data.length + IW_EV_POINT_LEN; - if ((end_buf - current_ev) > data_len) - { - current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, end_buf, - &iwe, buf); - } - param->bytes_needed += data_len; - -#if WIRELESS_EXT < 18 - if (cie->ie_wpa != NULL) { - static const char wpa_leader[] = "wpa_ie="; - data_len = (sizeof(wpa_leader) - 1) + ((cie->ie_wpa[1]+2) * 2) + IW_EV_POINT_LEN; - if ((end_buf - current_ev) > data_len) - { - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = IWEVCUSTOM; - iwe.u.data.length = encode_ie(buf, sizeof(buf), cie->ie_wpa, - cie->ie_wpa[1]+2, - wpa_leader, sizeof(wpa_leader)-1); - - if (iwe.u.data.length != 0) { - current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, - end_buf, &iwe, buf); - } - } - param->bytes_needed += data_len; - } - - if (cie->ie_rsn != NULL && cie->ie_rsn[0] == IEEE80211_ELEMID_RSN) { - static const char rsn_leader[] = "rsn_ie="; - data_len = (sizeof(rsn_leader) - 1) + ((cie->ie_rsn[1]+2) * 2) + IW_EV_POINT_LEN; - if ((end_buf - current_ev) > data_len) - { - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = IWEVCUSTOM; - iwe.u.data.length = encode_ie(buf, sizeof(buf), cie->ie_rsn, - cie->ie_rsn[1]+2, - rsn_leader, sizeof(rsn_leader)-1); - - if (iwe.u.data.length != 0) { - current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, - end_buf, &iwe, buf); - } - } - param->bytes_needed += data_len; - } -#endif /* WIRELESS_EXT < 18 */ - - if (cie->ie_wmm != NULL) { - static const char wmm_leader[] = "wmm_ie="; - data_len = (sizeof(wmm_leader) - 1) + ((cie->ie_wmm[1]+2) * 2) + IW_EV_POINT_LEN; - if ((end_buf - current_ev) > data_len) - { - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = IWEVCUSTOM; - iwe.u.data.length = encode_ie(buf, sizeof(buf), cie->ie_wmm, - cie->ie_wmm[1]+2, - wmm_leader, sizeof(wmm_leader)-1); - if (iwe.u.data.length != 0) { - current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, - end_buf, &iwe, buf); - } - } - param->bytes_needed += data_len; - } - - if (cie->ie_ath != NULL) { - static const char ath_leader[] = "ath_ie="; - data_len = (sizeof(ath_leader) - 1) + ((cie->ie_ath[1]+2) * 2) + IW_EV_POINT_LEN; - if ((end_buf - current_ev) > data_len) - { - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = IWEVCUSTOM; - iwe.u.data.length = encode_ie(buf, sizeof(buf), cie->ie_ath, - cie->ie_ath[1]+2, - ath_leader, sizeof(ath_leader)-1); - if (iwe.u.data.length != 0) { - current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, - end_buf, &iwe, buf); - } - } - param->bytes_needed += data_len; - } - -#ifdef WAPI_ENABLE - if (cie->ie_wapi != NULL) { - static const char wapi_leader[] = "wapi_ie="; - data_len = (sizeof(wapi_leader) - 1) + ((cie->ie_wapi[1] + 2) * 2) + IW_EV_POINT_LEN; - if ((end_buf - current_ev) > data_len) { - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = IWEVCUSTOM; - iwe.u.data.length = encode_ie(buf, sizeof(buf), cie->ie_wapi, - cie->ie_wapi[1] + 2, - wapi_leader, sizeof(wapi_leader) - 1); - if (iwe.u.data.length != 0) { - current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, - end_buf, &iwe, buf); - } - } - param->bytes_needed += data_len; - } -#endif /* WAPI_ENABLE */ - -#endif /* WIRELESS_EXT > 14 */ - -#if WIRELESS_EXT >= 18 - if (cie->ie_wsc != NULL) { - data_len = (cie->ie_wsc[1] + 2) + IW_EV_POINT_LEN; - if ((end_buf - current_ev) > data_len) - { - A_MEMZERO(&iwe, sizeof(iwe)); - iwe.cmd = IWEVGENIE; - iwe.u.data.length = cie->ie_wsc[1] + 2; - current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, end_buf, - &iwe, (char*)cie->ie_wsc); - } - param->bytes_needed += data_len; - } -#endif /* WIRELESS_EXT >= 18 */ - - param->current_ev = current_ev; -} - -int -ar6000_ioctl_giwscan(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *data, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - struct ar_giwscan_param param; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - param.current_ev = extra; - param.end_buf = extra + data->length; - param.bytes_needed = 0; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - param.info = info; -#endif - - /* Translate data to WE format */ - wmi_iterate_nodes(arPriv->arWmi, ar6000_scan_node, ¶m); - - /* check if bytes needed is greater than bytes consumed */ - if (param.bytes_needed > (param.current_ev - extra)) - { - /* Request one byte more than needed, because when "data->length" equals bytes_needed, - it is not possible to add the last event data as all iwe_stream_add_xxxxx() functions - checks whether (cur_ptr + ev_len) < end_ptr, due to this one more retry would happen*/ - data->length = param.bytes_needed + 1; - - return -E2BIG; - } - - return 0; -} - -extern int reconnect_flag; -/* SIOCSIWESSID */ -static int -ar6000_ioctl_siwessid(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *data, char *ssid) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_DEV_T *arTempPriv = NULL; - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - A_STATUS status; - A_UINT8 i=0; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->bIsDestroyProgress) { - return -EBUSY; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - -#if defined(WIRELESS_EXT) - if (WIRELESS_EXT > 20) { - data->length += 1; - } -#endif - /* Handling AP-STA Concurrency */ - if((ar->arConfNumDev > 1)) { - if ((data->flags) && - (arPriv->arNetworkType == INFRA_NETWORK) && - ((arPriv->arSsidLen != (data->length - 1)) || - (A_MEMCMP(arPriv->arSsid, ssid, arPriv->arSsidLen) != 0))){ - for(i=0;iarConfNumDev;i++) { - arTempPriv = ar->arDev[i]; - if((AP_NETWORK == arTempPriv->arNetworkType) && - (arTempPriv->arConnected)) { - wmi_disconnect_cmd(arTempPriv->arWmi); - /*Restart AP only in non P2P mode*/ - if((arTempPriv->arNetworkSubType != SUBTYPE_P2PGO) && - (arTempPriv->arNetworkSubType !=SUBTYPE_P2PDEV)){ - arTempPriv->arHoldConnection = TRUE; - ar->arHoldConnection = TRUE; - arTempPriv->ap_profile_flag = TRUE; - } - } - } - } - } - /* - * iwconfig passes a null terminated string with length including this - * so we need to account for this - */ - if (data->flags && (!data->length || (data->length == 1) || - ((data->length - 1) > sizeof(arPriv->arSsid)))) - { - /* - * ssid is invalid - */ - return -EINVAL; - } - - if (arPriv->arNetworkType == AP_NETWORK) { - if(!data->flags) { - /* stop AP */ - wmi_disconnect_cmd(arPriv->arWmi); - if(arPriv->arNetworkSubType == SUBTYPE_P2PGO) { - wait_event_interruptible_timeout(arPriv->arEvent, arPriv->arConnected == FALSE, wmitimeout * HZ); - if (signal_pending(current)) { - return -EINTR; - } - } - - } else if(A_MEMCMP(arPriv->arSsid,ssid,32) != 0) { - /* SSID change for AP network - Will take effect on commit */ - arPriv->arSsidLen = data->length - 1; - A_MEMZERO(arPriv->arSsid, WMI_MAX_SSID_LEN); - A_MEMCPY(arPriv->arSsid, ssid, arPriv->arSsidLen); - } - arPriv->ap_profile_flag = 1; /* There is a change in profile */ - arPriv->arConnected = FALSE; - return 0; - } - - /* Added for bug 25178, return an IOCTL error instead of target returning - Illegal parameter error when either the BSSID or channel is missing - and we cannot scan during connect. - */ - if (data->flags) { - if (arSta->arSkipScan == TRUE && - (arPriv->arChannelHint == 0 || - (!arSta->arReqBssid[0] && !arSta->arReqBssid[1] && !arSta->arReqBssid[2] && - !arSta->arReqBssid[3] && !arSta->arReqBssid[4] && !arSta->arReqBssid[5]))) - { - return -EINVAL; - } - } - - if (down_interruptible(&ar->arSem)) { - return -ERESTARTSYS; - } - - if (ar->bIsDestroyProgress || ar->arWlanState == WLAN_DISABLED) { - up(&ar->arSem); - return -EBUSY; - } - - if (ar->arTxPending[wmi_get_control_ep(arPriv->arWmi)]) { - /* - * sleep until the command queue drains - */ - wait_event_interruptible_timeout(arPriv->arEvent, - ar->arTxPending[wmi_get_control_ep(arPriv->arWmi)] == 0, wmitimeout * HZ); - if (signal_pending(current)) { - up(&ar->arSem); - return -EINTR; - } - } - - - if (!data->flags) { -#ifdef ATH6K_CONFIG_CFG80211 - if (arPriv->arConnected) { -#endif /* ATH6K_CONFIG_CFG80211 */ - ar6000_init_mode_info(arPriv); -#ifdef ATH6K_CONFIG_CFG80211 - } -#endif /* ATH6K_CONFIG_CFG80211 */ - } - - if (((arPriv->arSsidLen) || - ((arPriv->arSsidLen == 0) && (arPriv->arConnected || arSta->arConnectPending)) || - (!data->flags))) - { - if ((!data->flags) || - (A_MEMCMP(arPriv->arSsid, ssid, arPriv->arSsidLen) != 0) || - (arPriv->arSsidLen != (data->length - 1))) - { - /* - * SSID set previously or essid off has been issued. - * - * Disconnect Command is issued in two cases after wmi is ready - * (1) ssid is different from the previous setting - * (2) essid off has been issued - * - */ - if (ar->arWmiReady == TRUE) { - reconnect_flag = 0; - status = wmi_setPmkid_cmd(arPriv->arWmi, arPriv->arBssid, NULL, 0); - ar6000_disconnect(arPriv); - A_MEMZERO(arPriv->arSsid, sizeof(arPriv->arSsid)); - arPriv->arSsidLen = 0; - if (arSta->arSkipScan == FALSE) { - A_MEMZERO(arSta->arReqBssid, sizeof(arSta->arReqBssid)); - } - if (!data->flags) { - up(&ar->arSem); - return 0; - } - } else { - up(&ar->arSem); - } - } - else - { - /* - * SSID is same, so we assume profile hasn't changed. - * If the interface is up and wmi is ready, we issue - * a reconnect cmd. Issue a reconnect only we are already - * connected. - */ - if((arPriv->arConnected == TRUE) && (ar->arWmiReady == TRUE)) - { - reconnect_flag = TRUE; - status = wmi_reconnect_cmd(arPriv->arWmi,arSta->arReqBssid, - arPriv->arChannelHint); - up(&ar->arSem); - if (status != A_OK) { - return -EIO; - } - return 0; - } - else{ - /* - * Dont return if connect is pending. - */ - if(!(arSta->arConnectPending)) { - up(&ar->arSem); - return 0; - } - } - } - } - - arPriv->arSsidLen = data->length - 1; - A_MEMCPY(arPriv->arSsid, ssid, arPriv->arSsidLen); - - if (ar6000_connect_to_ap(arPriv)!= A_OK) { - up(&ar->arSem); - return -EIO; - }else{ - up(&ar->arSem); - } - return 0; -} - -/* SIOCGIWESSID */ -static int -ar6000_ioctl_giwessid(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *data, char *essid) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - if (!arPriv->arSsidLen) { - return -EINVAL; - } - - data->flags = 1; - data->length = arPriv->arSsidLen; - A_MEMCPY(essid, arPriv->arSsid, arPriv->arSsidLen); - - return 0; -} - - -void ar6000_install_static_wep_keys(AR_SOFTC_DEV_T *arPriv) -{ - A_UINT8 index; - A_UINT8 keyUsage; - AR_SOFTC_AP_T *ap = &arPriv->arAp; - - for (index = WMI_MIN_KEY_INDEX; index <= WMI_MAX_KEY_INDEX; index++) { - if (arPriv->arWepKeyList[index].arKeyLen) { - keyUsage = GROUP_USAGE; - if (index == arPriv->arDefTxKeyIndex) { - keyUsage |= TX_USAGE; - } - wmi_addKey_cmd(arPriv->arWmi, - index, - WEP_CRYPT, - keyUsage, - arPriv->arWepKeyList[index].arKeyLen, - NULL, - arPriv->arWepKeyList[index].arKey, KEY_OP_INIT_VAL, NULL, - NO_SYNC_WMIFLAG); - } - } - ap->deKeySet = FALSE; -} - -/* - * SIOCSIWRATE - */ -int -ar6000_ioctl_siwrate(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *rrq, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - A_UINT32 kbps; - A_INT8 rate_idx; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (rrq->fixed) { - kbps = rrq->value / 1000; /* rrq->value is in bps */ - } else { - kbps = -1; /* -1 indicates auto rate */ - } - if(kbps != -1 && wmi_validate_bitrate(arPriv->arWmi, kbps, &rate_idx) != A_OK) - { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BitRate is not Valid %d\n", kbps)); - return -EINVAL; - } - arPriv->arBitRate = kbps; - if(ar->arWmiReady == TRUE) - { - if (wmi_set_bitrate_cmd(arPriv->arWmi, kbps, -1, -1) != A_OK) { - return -EINVAL; - } - } - return 0; -} - -/* - * SIOCGIWRATE - */ -int -ar6000_ioctl_giwrate(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *rrq, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - int ret = 0; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->bIsDestroyProgress) { - return -EBUSY; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - if ((arPriv->arNextMode != AP_NETWORK && !arPriv->arConnected) || ar->arWmiReady == FALSE) { - rrq->value = 1000 * 1000; - return 0; - } - - if (arPriv->arBitRate!=-1 && arPriv->arBitRate!=0xFFFF) { - rrq->fixed = TRUE; - rrq->value = arPriv->arBitRate * 1000; - return 0; - } - - if (down_interruptible(&ar->arSem)) { - return -ERESTARTSYS; - } - - if (ar->bIsDestroyProgress || ar->arWlanState == WLAN_DISABLED) { - up(&ar->arSem); - return -EBUSY; - } - - arPriv->arBitRate = 0xFFFF; - if (wmi_get_bitrate_cmd(arPriv->arWmi) != A_OK) { - up(&ar->arSem); - return -EIO; - } - wait_event_interruptible_timeout(arPriv->arEvent, arPriv->arBitRate != 0xFFFF, wmitimeout * HZ); - if (signal_pending(current)) { - ret = -EINTR; - } - /* If the interface is down or wmi is not ready or the target is not - connected - return the value stored in the device structure */ - if (!ret) { - if (arPriv->arBitRate == -1) { - rrq->fixed = TRUE; - rrq->value = 0; - } else { - rrq->fixed = FALSE; - rrq->value = arPriv->arBitRate * 1000; - } - arPriv->arBitRate = -1; /* clean it up for next query */ - } - - up(&ar->arSem); - - return ret; -} - -/* - * SIOCSIWTXPOW - */ -static int -ar6000_ioctl_siwtxpow(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *rrq, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - A_UINT8 dbM; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - if (rrq->disabled) { - return -EOPNOTSUPP; - } - - if (rrq->fixed) { - if (rrq->flags != IW_TXPOW_DBM) { - return -EOPNOTSUPP; - } - arPriv->arTxPwr= dbM = rrq->value; - arPriv->arTxPwrSet = TRUE; - } else { - arPriv->arTxPwr = dbM = 0; - arPriv->arTxPwrSet = FALSE; - } - if(ar->arWmiReady == TRUE) - { - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_TX,("Set tx pwr cmd %d dbM\n", dbM)); - wmi_set_txPwr_cmd(arPriv->arWmi, dbM); - } - return 0; -} - -/* - * SIOCGIWTXPOW - */ -int -ar6000_ioctl_giwtxpow(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *rrq, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - int ret = 0; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->bIsDestroyProgress) { - return -EBUSY; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - if (down_interruptible(&ar->arSem)) { - return -ERESTARTSYS; - } - - if (ar->bIsDestroyProgress) { - up(&ar->arSem); - return -EBUSY; - } - - if((ar->arWmiReady == TRUE) && (arPriv->arConnected == TRUE)) - { - arPriv->arTxPwr = 0; - - if (wmi_get_txPwr_cmd(arPriv->arWmi) != A_OK) { - up(&ar->arSem); - return -EIO; - } - - wait_event_interruptible_timeout(arPriv->arEvent, arPriv->arTxPwr != 0, wmitimeout * HZ); - - if (signal_pending(current)) { - ret = -EINTR; - } - } - /* If the interace is down or wmi is not ready or target is not connected - then return value stored in the device structure */ - - if (!ret) { - if (arPriv->arTxPwrSet == TRUE) { - rrq->fixed = TRUE; - } - rrq->value = arPriv->arTxPwr; - rrq->flags = IW_TXPOW_DBM; - // - // IWLIST need this flag to get TxPower - // - rrq->disabled = 0; - } - - up(&ar->arSem); - - return ret; -} - -/* - * SIOCSIWRETRY - * since iwconfig only provides us with one max retry value, we use it - * to apply to data frames of the BE traffic class. - */ -static int -ar6000_ioctl_siwretry(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *rrq, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - if (rrq->disabled) { - return -EOPNOTSUPP; - } - - if ((rrq->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT) { - return -EOPNOTSUPP; - } - - if ( !(rrq->value >= WMI_MIN_RETRIES) || !(rrq->value <= WMI_MAX_RETRIES)) { - return - EINVAL; - } - if(ar->arWmiReady == TRUE) - { - if (wmi_set_retry_limits_cmd(arPriv->arWmi, DATA_FRAMETYPE, WMM_AC_BE, - rrq->value, 0) != A_OK){ - return -EINVAL; - } - } - arPriv->arMaxRetries = rrq->value; - return 0; -} - -/* - * SIOCGIWRETRY - */ -static int -ar6000_ioctl_giwretry(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *rrq, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - rrq->disabled = 0; - switch (rrq->flags & IW_RETRY_TYPE) { - case IW_RETRY_LIFETIME: - return -EOPNOTSUPP; - break; - case IW_RETRY_LIMIT: - rrq->flags = IW_RETRY_LIMIT; - switch (rrq->flags & IW_RETRY_MODIFIER) { - case IW_RETRY_MIN: - rrq->flags |= IW_RETRY_MIN; - rrq->value = WMI_MIN_RETRIES; - break; - case IW_RETRY_MAX: - rrq->flags |= IW_RETRY_MAX; - rrq->value = arPriv->arMaxRetries; - break; - } - break; - } - return 0; -} - -/* - * SIOCSIWENCODE - */ -static int -ar6000_ioctl_siwencode(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *erq, char *keybuf) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_AP_T *ap = &arPriv->arAp; - - int index; - A_INT32 auth = 0; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if(arPriv->arNextMode != AP_NETWORK) { - /* - * Static WEP Keys should be configured before setting the SSID - */ - if (arPriv->arSsid[0] && erq->length) { - return -EIO; - } - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - index = erq->flags & IW_ENCODE_INDEX; - - if (index && (((index - 1) < WMI_MIN_KEY_INDEX) || - ((index - 1) > WMI_MAX_KEY_INDEX))) - { - return -EIO; - } - - if (erq->flags & IW_ENCODE_DISABLED) { - /* - * Encryption disabled - */ - if (index) { - /* - * If key index was specified then clear the specified key - */ - index--; - A_MEMZERO(arPriv->arWepKeyList[index].arKey, - sizeof(arPriv->arWepKeyList[index].arKey)); - arPriv->arWepKeyList[index].arKeyLen = 0; - } - arPriv->arDot11AuthMode = OPEN_AUTH; - arPriv->arPairwiseCrypto = NONE_CRYPT; - arPriv->arGroupCrypto = NONE_CRYPT; - arPriv->arAuthMode = WMI_NONE_AUTH; - } else { - /* - * Enabling WEP encryption - */ - if (index) { - index--; /* keyindex is off base 1 in iwconfig */ - } - - if (erq->flags & IW_ENCODE_OPEN) { - auth |= OPEN_AUTH; - } - if (erq->flags & IW_ENCODE_RESTRICTED) { - auth |= SHARED_AUTH; - } - - if (!auth) { - auth = OPEN_AUTH; - } - - if (!ap->deKeySet) { - arPriv->arDefTxKeyIndex = index; - } - - if (erq->length) { - if (!IEEE80211_IS_VALID_WEP_CIPHER_LEN(erq->length)) { - return -EIO; - } - - A_MEMZERO(arPriv->arWepKeyList[index].arKey, - sizeof(arPriv->arWepKeyList[index].arKey)); - A_MEMCPY(arPriv->arWepKeyList[index].arKey, keybuf, erq->length); - arPriv->arWepKeyList[index].arKeyLen = erq->length; - arPriv->arDot11AuthMode = auth; - } else { - if (arPriv->arWepKeyList[index].arKeyLen == 0) { - return -EIO; - } - arPriv->arDefTxKeyIndex = index; - - if(arPriv->arSsidLen && arPriv->arWepKeyList[index].arKeyLen) { - wmi_addKey_cmd(arPriv->arWmi, - index, - WEP_CRYPT, - GROUP_USAGE | TX_USAGE, - arPriv->arWepKeyList[index].arKeyLen, - NULL, - arPriv->arWepKeyList[index].arKey, KEY_OP_INIT_VAL, NULL, - NO_SYNC_WMIFLAG); - } - ap->deKeySet = TRUE; - } - - arPriv->arPairwiseCrypto = WEP_CRYPT; - arPriv->arGroupCrypto = WEP_CRYPT; - arPriv->arAuthMode = WMI_NONE_AUTH; - } - - if(arPriv->arNextMode != AP_NETWORK) { - /* - * profile has changed. Erase ssid to signal change - */ - A_MEMZERO(arPriv->arSsid, sizeof(arPriv->arSsid)); - arPriv->arSsidLen = 0; - } - arPriv->ap_profile_flag = 1; /* There is a change in profile */ - return 0; -} - -static int -ar6000_ioctl_giwencode(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *erq, char *key) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - A_UINT8 keyIndex; - struct ar_wep_key *wk; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - if (arPriv->arPairwiseCrypto == NONE_CRYPT) { - erq->length = 0; - erq->flags = IW_ENCODE_DISABLED; - } else { - if (arPriv->arPairwiseCrypto == WEP_CRYPT) { - /* get the keyIndex */ - keyIndex = erq->flags & IW_ENCODE_INDEX; - if (0 == keyIndex) { - keyIndex = arPriv->arDefTxKeyIndex; - } else if ((keyIndex - 1 < WMI_MIN_KEY_INDEX) || - (keyIndex - 1 > WMI_MAX_KEY_INDEX)) - { - keyIndex = WMI_MIN_KEY_INDEX; - } else { - keyIndex--; - } - erq->flags = keyIndex + 1; - erq->flags &= ~IW_ENCODE_DISABLED; - wk = &arPriv->arWepKeyList[keyIndex]; - if (erq->length > wk->arKeyLen) { - erq->length = wk->arKeyLen; - } - if (wk->arKeyLen) { - A_MEMCPY(key, wk->arKey, erq->length); - } - } else { - erq->flags &= ~IW_ENCODE_DISABLED; - if (arPriv->arSta.user_saved_keys.keyOk) { - erq->length = arPriv->arSta.user_saved_keys.ucast_ik.ik_keylen; - if (erq->length) { - A_MEMCPY(key, arPriv->arSta.user_saved_keys.ucast_ik.ik_keydata, erq->length); - } - } else { - erq->length = 1; // not really printing any key but let iwconfig know enc is on - } - } - - if (arPriv->arDot11AuthMode & OPEN_AUTH) { - erq->flags |= IW_ENCODE_OPEN; - } - if (arPriv->arDot11AuthMode & SHARED_AUTH) { - erq->flags |= IW_ENCODE_RESTRICTED; - } - } - - return 0; -} - -#if WIRELESS_EXT >= 18 -/* - * SIOCSIWGENIE - */ -static int -ar6000_ioctl_siwgenie(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *erq, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - A_UCHAR *ie = extra; - A_UINT16 ieLen = erq->length; - const A_UINT8 wfa_oui[] = { 0x00, 0x50, 0xf2, 0x04 }; - const A_UINT8 wpa_oui[] = { 0x00, 0x50, 0xf2, 0x01 }; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - if (ieLen > IEEE80211_APPIE_FRAME_MAX_LEN) { - return -EIO; - } - - /* get the Information Element and check if it's a WPS IE */ - if (ieLen>=6 && - ((ie[0]==IEEE80211_ELEMID_VENDOR) && - memcmp(&ie[2], wfa_oui, sizeof(wfa_oui))==0)) { - /* WPS IE detected, notify target */ - AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("WPS IE detected -- setting WPS flag\n")); - arPriv->arSta.arConnectCtrlFlags |= CONNECT_WPS_FLAG; - } else { - if ((ieLen>=1 && ie[0]==IEEE80211_ELEMID_RSN) || - (ieLen>=6 && ie[0]==IEEE80211_ELEMID_VENDOR && - memcmp(&ie[2], wpa_oui, sizeof(wpa_oui))==0)) { - ieLen = 0; /* Firmware will set for us. Clear the previous one */ - } -#ifdef CONFIG_WAPI - else if (ieLen>=1 && ie[0]==IEEE80211_ELEMID_WAPI) { - //A_PRINTF("Set WAPI IE\n"); - } -#endif - arPriv->arSta.arConnectCtrlFlags &= ~CONNECT_WPS_FLAG; - } - - wmi_set_appie_cmd(arPriv->arWmi, WMI_FRAME_ASSOC_REQ, ieLen, ie); - return 0; -} - - -/* - * SIOCGIWGENIE - */ -static int -ar6000_ioctl_giwgenie(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *erq, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - erq->length = 0; - erq->flags = 0; - - return 0; -} - -/* - * SIOCSIWAUTH - */ -static int -ar6000_ioctl_siwauth(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *data, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - - A_BOOL profChanged; - A_UINT16 param; - A_INT32 ret; - A_INT32 value; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - param = data->flags & IW_AUTH_INDEX; - value = data->value; - profChanged = TRUE; - ret = 0; - - switch (param) { - case IW_AUTH_WPA_VERSION: - if (value & IW_AUTH_WPA_VERSION_DISABLED) { - arPriv->arAuthMode = WMI_NONE_AUTH; - } else if (value & IW_AUTH_WPA_VERSION_WPA) { - arPriv->arAuthMode = WMI_WPA_AUTH; - } else if (value & IW_AUTH_WPA_VERSION_WPA2) { - arPriv->arAuthMode = WMI_WPA2_AUTH; - } else { - ret = -1; - profChanged = FALSE; - } - break; - case IW_AUTH_CIPHER_PAIRWISE: - if (value & IW_AUTH_CIPHER_NONE) { - arPriv->arPairwiseCrypto = NONE_CRYPT; - arPriv->arPairwiseCryptoLen = 0; - } else if (value & IW_AUTH_CIPHER_WEP40) { - arPriv->arPairwiseCrypto = WEP_CRYPT; - arPriv->arPairwiseCryptoLen = 5; - } else if (value & IW_AUTH_CIPHER_TKIP) { - arPriv->arPairwiseCrypto = TKIP_CRYPT; - arPriv->arPairwiseCryptoLen = 0; - } else if (value & IW_AUTH_CIPHER_CCMP) { - arPriv->arPairwiseCrypto = AES_CRYPT; - arPriv->arPairwiseCryptoLen = 0; - } else if (value & IW_AUTH_CIPHER_WEP104) { - arPriv->arPairwiseCrypto = WEP_CRYPT; - arPriv->arPairwiseCryptoLen = 13; -#ifdef WAPI_ENABLE - } else if (value & IW_AUTH_CIPHER_SMS4) { - arPriv->arPairwiseCrypto = WAPI_CRYPT; - arPriv->arPairwiseCryptoLen = 0; -#endif - } else { - ret = -1; - profChanged = FALSE; - } - break; - case IW_AUTH_CIPHER_GROUP: - if (value & IW_AUTH_CIPHER_NONE) { - arPriv->arGroupCrypto = NONE_CRYPT; - arPriv->arGroupCryptoLen = 0; - } else if (value & IW_AUTH_CIPHER_WEP40) { - arPriv->arGroupCrypto = WEP_CRYPT; - arPriv->arGroupCryptoLen = 5; - } else if (value & IW_AUTH_CIPHER_TKIP) { - arPriv->arGroupCrypto = TKIP_CRYPT; - arPriv->arGroupCryptoLen = 0; - } else if (value & IW_AUTH_CIPHER_CCMP) { - arPriv->arGroupCrypto = AES_CRYPT; - arPriv->arGroupCryptoLen = 0; - } else if (value & IW_AUTH_CIPHER_WEP104) { - arPriv->arGroupCrypto = WEP_CRYPT; - arPriv->arGroupCryptoLen = 13; -#ifdef WAPI_ENABLE - } else if (value & IW_AUTH_CIPHER_SMS4) { - arPriv->arGroupCrypto = WAPI_CRYPT; - arPriv->arGroupCryptoLen = 0; -#endif - } else { - ret = -1; - profChanged = FALSE; - } - break; - case IW_AUTH_KEY_MGMT: - if (value & IW_AUTH_KEY_MGMT_PSK) { - if (WMI_WPA_AUTH == arPriv->arAuthMode) { - arPriv->arAuthMode = WMI_WPA_PSK_AUTH; - } else if (WMI_WPA2_AUTH == arPriv->arAuthMode) { - arPriv->arAuthMode = WMI_WPA2_PSK_AUTH; - } else { - ret = -1; - } -#define IW_AUTH_KEY_MGMT_CCKM 8 - } else if (value & IW_AUTH_KEY_MGMT_CCKM) { - if (WMI_WPA_AUTH == arPriv->arAuthMode) { - arPriv->arAuthMode = WMI_WPA_AUTH_CCKM; - } else if (WMI_WPA2_AUTH == arPriv->arAuthMode) { - arPriv->arAuthMode = WMI_WPA2_AUTH_CCKM; - } else { - ret = -1; - } - } else if (!(value & IW_AUTH_KEY_MGMT_802_1X)) { - arPriv->arAuthMode = WMI_NONE_AUTH; - } - break; - case IW_AUTH_TKIP_COUNTERMEASURES: - wmi_set_tkip_countermeasures_cmd(arPriv->arWmi, value); - profChanged = FALSE; - break; - case IW_AUTH_DROP_UNENCRYPTED: - profChanged = FALSE; - break; - case IW_AUTH_80211_AUTH_ALG: - arPriv->arDot11AuthMode = 0; - if (value & IW_AUTH_ALG_OPEN_SYSTEM) { - arPriv->arDot11AuthMode |= OPEN_AUTH; - } - if (value & IW_AUTH_ALG_SHARED_KEY) { - arPriv->arDot11AuthMode |= SHARED_AUTH; - } - if (value & IW_AUTH_ALG_LEAP) { - arPriv->arDot11AuthMode = LEAP_AUTH; - } - if(arPriv->arDot11AuthMode == 0) { - ret = -1; - profChanged = FALSE; - } - break; - case IW_AUTH_WPA_ENABLED: - if (!value) { - arPriv->arAuthMode = WMI_NONE_AUTH; - /* when the supplicant is stopped, it calls this - * handler with value=0. The followings need to be - * reset if the STA were to connect again - * without security - */ - arPriv->arDot11AuthMode = OPEN_AUTH; - arPriv->arPairwiseCrypto = NONE_CRYPT; - arPriv->arPairwiseCryptoLen = 0; - arPriv->arGroupCrypto = NONE_CRYPT; - arPriv->arGroupCryptoLen = 0; - } - break; - case IW_AUTH_RX_UNENCRYPTED_EAPOL: - profChanged = FALSE; - break; - case IW_AUTH_ROAMING_CONTROL: - profChanged = FALSE; - break; - case IW_AUTH_PRIVACY_INVOKED: - if (!value) { - arPriv->arPairwiseCrypto = NONE_CRYPT; - arPriv->arPairwiseCryptoLen = 0; - arPriv->arGroupCrypto = NONE_CRYPT; - arPriv->arGroupCryptoLen = 0; - } - break; - default: - ret = -1; - profChanged = FALSE; - break; - } - - if (profChanged == TRUE) { - /* - * profile has changed. Erase ssid to signal change - */ - A_MEMZERO(arPriv->arSsid, sizeof(arPriv->arSsid)); - arPriv->arSsidLen = 0; - } - - return ret; -} - - -/* - * SIOCGIWAUTH - */ -static int -ar6000_ioctl_giwauth(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *data, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - A_UINT16 param; - A_INT32 ret; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - param = data->flags & IW_AUTH_INDEX; - ret = 0; - data->value = 0; - - - switch (param) { - case IW_AUTH_WPA_VERSION: - if (arPriv->arAuthMode == WMI_NONE_AUTH) { - data->value |= IW_AUTH_WPA_VERSION_DISABLED; - } else if (arPriv->arAuthMode == WMI_WPA_AUTH) { - data->value |= IW_AUTH_WPA_VERSION_WPA; - } else if (arPriv->arAuthMode == WMI_WPA2_AUTH) { - data->value |= IW_AUTH_WPA_VERSION_WPA2; - } else { - ret = -1; - } - break; - case IW_AUTH_CIPHER_PAIRWISE: - if (arPriv->arPairwiseCrypto == NONE_CRYPT) { - data->value |= IW_AUTH_CIPHER_NONE; - } else if (arPriv->arPairwiseCrypto == WEP_CRYPT) { - if (arPriv->arPairwiseCryptoLen == 13) { - data->value |= IW_AUTH_CIPHER_WEP104; - } else { - data->value |= IW_AUTH_CIPHER_WEP40; - } - } else if (arPriv->arPairwiseCrypto == TKIP_CRYPT) { - data->value |= IW_AUTH_CIPHER_TKIP; - } else if (arPriv->arPairwiseCrypto == AES_CRYPT) { - data->value |= IW_AUTH_CIPHER_CCMP; - } else { - ret = -1; - } - break; - case IW_AUTH_CIPHER_GROUP: - if (arPriv->arGroupCrypto == NONE_CRYPT) { - data->value |= IW_AUTH_CIPHER_NONE; - } else if (arPriv->arGroupCrypto == WEP_CRYPT) { - if (arPriv->arGroupCryptoLen == 13) { - data->value |= IW_AUTH_CIPHER_WEP104; - } else { - data->value |= IW_AUTH_CIPHER_WEP40; - } - } else if (arPriv->arGroupCrypto == TKIP_CRYPT) { - data->value |= IW_AUTH_CIPHER_TKIP; - } else if (arPriv->arGroupCrypto == AES_CRYPT) { - data->value |= IW_AUTH_CIPHER_CCMP; - } else { - ret = -1; - } - break; - case IW_AUTH_KEY_MGMT: - if ((arPriv->arAuthMode == WMI_WPA_PSK_AUTH) || - (arPriv->arAuthMode == WMI_WPA2_PSK_AUTH)) { - data->value |= IW_AUTH_KEY_MGMT_PSK; - } else if ((arPriv->arAuthMode == WMI_WPA_AUTH) || - (arPriv->arAuthMode == WMI_WPA2_AUTH)) { - data->value |= IW_AUTH_KEY_MGMT_802_1X; - } - break; - case IW_AUTH_TKIP_COUNTERMEASURES: - // TODO. Save countermeassure enable/disable - data->value = 0; - break; - case IW_AUTH_DROP_UNENCRYPTED: - break; - case IW_AUTH_80211_AUTH_ALG: - if (arPriv->arDot11AuthMode == OPEN_AUTH) { - data->value |= IW_AUTH_ALG_OPEN_SYSTEM; - } else if (arPriv->arDot11AuthMode == SHARED_AUTH) { - data->value |= IW_AUTH_ALG_SHARED_KEY; - } else if (arPriv->arDot11AuthMode == LEAP_AUTH) { - data->value |= IW_AUTH_ALG_LEAP; - } else { - ret = -1; - } - break; - case IW_AUTH_WPA_ENABLED: - if (arPriv->arAuthMode == WMI_NONE_AUTH) { - data->value = 0; - } else { - data->value = 1; - } - break; - case IW_AUTH_RX_UNENCRYPTED_EAPOL: - break; - case IW_AUTH_ROAMING_CONTROL: - break; - case IW_AUTH_PRIVACY_INVOKED: - if (arPriv->arPairwiseCrypto == NONE_CRYPT) { - data->value = 0; - } else { - data->value = 1; - } - break; - default: - ret = -1; - break; - } - - return 0; -} - -/* - * SIOCSIWPMKSA - */ -static int -ar6000_ioctl_siwpmksa(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *data, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - A_INT32 ret; - A_STATUS status; - struct iw_pmksa *pmksa; - - pmksa = (struct iw_pmksa *)extra; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - ret = 0; - status = A_OK; - - switch (pmksa->cmd) { - case IW_PMKSA_ADD: - status = wmi_setPmkid_cmd(arPriv->arWmi, (A_UINT8*)pmksa->bssid.sa_data, pmksa->pmkid, TRUE); - break; - case IW_PMKSA_REMOVE: - status = wmi_setPmkid_cmd(arPriv->arWmi, (A_UINT8*)pmksa->bssid.sa_data, pmksa->pmkid, FALSE); - break; - case IW_PMKSA_FLUSH: - if (arPriv->arConnected == TRUE) { - status = wmi_setPmkid_cmd(arPriv->arWmi, arPriv->arBssid, NULL, 0); - } - break; - default: - ret=-1; - break; - } - if (status != A_OK) { - ret = -1; - } - - return ret; -} - -#ifdef WAPI_ENABLE - -#define PN_INIT 0x5c365c36 - -static int ar6000_set_wapi_key(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *erq, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; - KEY_USAGE keyUsage = 0; - A_INT32 keyLen; - A_UINT8 *keyData; - A_INT32 index; - A_UINT32 *PN; - A_INT32 i; - A_STATUS status; - A_UINT8 wapiKeyRsc[16]; - CRYPTO_TYPE keyType = WAPI_CRYPT; - const A_UINT8 broadcastMac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - - index = erq->flags & IW_ENCODE_INDEX; - if (index && (((index - 1) < WMI_MIN_KEY_INDEX) || - ((index - 1) > WMI_MAX_KEY_INDEX))) { - return -EIO; - } - - index--; - if (index < 0 || index > 4) { - return -EIO; - } - keyData = (A_UINT8 *)(ext + 1); - keyLen = erq->length - sizeof(struct iw_encode_ext); - A_MEMCPY(wapiKeyRsc, ext->tx_seq, sizeof(wapiKeyRsc)); - - if (A_MEMCMP(ext->addr.sa_data, broadcastMac, sizeof(broadcastMac)) == 0) { - keyUsage |= GROUP_USAGE; - PN = (A_UINT32 *)wapiKeyRsc; - for (i = 0; i < 4; i++) { - PN[i] = PN_INIT; - } - } else { - keyUsage |= PAIRWISE_USAGE; - } - status = wmi_addKey_cmd(arPriv->arWmi, - index, - keyType, - keyUsage, - keyLen, - wapiKeyRsc, - keyData, - KEY_OP_INIT_WAPIPN, - NULL, - SYNC_BEFORE_WMIFLAG); - if (A_OK != status) { - return -EIO; - } - return 0; -} - -#endif - -/* - * SIOCSIWENCODEEXT - */ -static int -ar6000_ioctl_siwencodeext(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *erq, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - A_INT32 index; - struct iw_encode_ext *ext; - KEY_USAGE keyUsage; - A_INT32 keyLen; - A_UINT8 *keyData; - A_UINT8 keyRsc[8]; - A_STATUS status; - CRYPTO_TYPE keyType; -#ifdef USER_KEYS - struct ieee80211req_key ik; -#endif /* USER_KEYS */ - AR_SOFTC_AP_T *arAp = &arPriv->arAp; - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - -#ifdef USER_KEYS - arPriv->arSta.user_saved_keys.keyOk = FALSE; -#endif /* USER_KEYS */ - - index = erq->flags & IW_ENCODE_INDEX; - - if (index && (((index - 1) < WMI_MIN_KEY_INDEX) || - ((index - 1) > WMI_MAX_KEY_INDEX))) - { - return -EIO; - } - - ext = (struct iw_encode_ext *)extra; - if (erq->flags & IW_ENCODE_DISABLED) { - /* - * Encryption disabled - */ - if (index) { - /* - * If key index was specified then clear the specified key - */ - index--; - A_MEMZERO(arPriv->arWepKeyList[index].arKey, - sizeof(arPriv->arWepKeyList[index].arKey)); - arPriv->arWepKeyList[index].arKeyLen = 0; - } - } else { - /* - * Enabling WEP encryption - */ - if (index) { - index--; /* keyindex is off base 1 in iwconfig */ - } - - keyUsage = 0; - keyLen = erq->length - sizeof(struct iw_encode_ext); - - if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { - keyUsage = TX_USAGE; - arPriv->arDefTxKeyIndex = index; - // Just setting the key index - if (keyLen == 0) { - return 0; - } - } - - if (keyLen <= 0) { - if (ext->alg == IW_ENCODE_ALG_KRK) { - wmi_delete_krk_cmd(arPriv->arWmi); - } - return -EIO; - } - - /* key follows iw_encode_ext */ - keyData = (A_UINT8 *)(ext + 1); - - switch (ext->alg) { - case IW_ENCODE_ALG_WEP: - keyType = WEP_CRYPT; -#ifdef USER_KEYS - ik.ik_type = IEEE80211_CIPHER_WEP; -#endif /* USER_KEYS */ - if(arPriv->arNextMode == AP_NETWORK) { - arAp->ap_mode_bkey.ik_type = IEEE80211_CIPHER_WEP; - } - if (!IEEE80211_IS_VALID_WEP_CIPHER_LEN(keyLen)) { - return -EIO; - } - - /* Check whether it is static wep. */ - if (!arPriv->arConnected) { - A_MEMZERO(arPriv->arWepKeyList[index].arKey, - sizeof(arPriv->arWepKeyList[index].arKey)); - A_MEMCPY(arPriv->arWepKeyList[index].arKey, keyData, keyLen); - arPriv->arWepKeyList[index].arKeyLen = keyLen; - - return 0; - } - break; - case IW_ENCODE_ALG_TKIP: - keyType = TKIP_CRYPT; -#ifdef USER_KEYS - ik.ik_type = IEEE80211_CIPHER_TKIP; -#endif /* USER_KEYS */ - if(arPriv->arNextMode == AP_NETWORK) { - arAp->ap_mode_bkey.ik_type = IEEE80211_CIPHER_TKIP; - } - break; - case IW_ENCODE_ALG_CCMP: - keyType = AES_CRYPT; -#ifdef USER_KEYS - ik.ik_type = IEEE80211_CIPHER_AES_CCM; -#endif /* USER_KEYS */ - if(arPriv->arNextMode == AP_NETWORK) { - arAp->ap_mode_bkey.ik_type = IEEE80211_CIPHER_AES_CCM; - } - break; -#ifdef WAPI_ENABLE - case IW_ENCODE_ALG_SM4: - return ar6000_set_wapi_key(dev, info, erq, extra); -#endif - case IW_ENCODE_ALG_PMK: - arPriv->arSta.arConnectCtrlFlags |= CONNECT_DO_WPA_OFFLOAD; - return wmi_set_pmk_cmd(arPriv->arWmi, keyData); - case IW_ENCODE_ALG_KRK: - return wmi_add_krk_cmd(arPriv->arWmi, keyData); - default: - return -EIO; - } - - - if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { - keyUsage |= GROUP_USAGE; - if(arPriv->arNextMode == AP_NETWORK) { - keyUsage &= ~TX_USAGE; - arAp->ap_mode_bkey.ik_keyix = index; - arAp->ap_mode_bkey.ik_keylen = keyLen; - memcpy(arAp->ap_mode_bkey.ik_keydata, keyData, keyLen); - memcpy(&arAp->ap_mode_bkey.ik_keyrsc, keyRsc, sizeof(keyRsc)); - memcpy(arAp->ap_mode_bkey.ik_macaddr, ext->addr.sa_data, ETH_ALEN); - } - } else { - keyUsage |= PAIRWISE_USAGE; - } - - if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) { - A_MEMCPY(keyRsc, ext->rx_seq, sizeof(keyRsc)); - } else { - A_MEMZERO(keyRsc, sizeof(keyRsc)); - } - - if (((WMI_WPA_PSK_AUTH == arPriv->arAuthMode) || (WMI_WPA2_PSK_AUTH == arPriv->arAuthMode)) && - (GROUP_USAGE & keyUsage)) - { - A_UNTIMEOUT(&arPriv->arSta.disconnect_timer); - } - - status = wmi_addKey_cmd(arPriv->arWmi, index, keyType, keyUsage, - keyLen, keyRsc, - keyData, KEY_OP_INIT_VAL, - (A_UINT8*)ext->addr.sa_data, - SYNC_BOTH_WMIFLAG); - if (status != A_OK) { - return -EIO; - } - -#ifdef USER_KEYS - ik.ik_keyix = index; - ik.ik_keylen = keyLen; - memcpy(ik.ik_keydata, keyData, keyLen); - memcpy(&ik.ik_keyrsc, keyRsc, sizeof(keyRsc)); - memcpy(ik.ik_macaddr, ext->addr.sa_data, ETH_ALEN); - if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { - memcpy(&arPriv->arSta.user_saved_keys.bcast_ik, &ik, - sizeof(struct ieee80211req_key)); - } else { - memcpy(&arPriv->arSta.user_saved_keys.ucast_ik, &ik, - sizeof(struct ieee80211req_key)); - } - arPriv->arSta.user_saved_keys.keyOk = TRUE; -#endif /* USER_KEYS */ - } - - - return 0; -} - -/* - * SIOCGIWENCODEEXT - */ -static int -ar6000_ioctl_giwencodeext(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *erq, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - if (arPriv->arPairwiseCrypto == NONE_CRYPT) { - erq->length = 0; - erq->flags = IW_ENCODE_DISABLED; - } else { - erq->length = 0; - } - - return 0; -} -#endif // WIRELESS_EXT >= 18 - -#if WIRELESS_EXT > 20 -static int ar6000_ioctl_siwpower(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ -#ifndef ATH6K_CONFIG_OTA_MODE - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - WMI_POWER_MODE power_mode; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - if (wrqu->power.disabled) - power_mode = MAX_PERF_POWER; - else - power_mode = REC_POWER; - - if (wmi_powermode_cmd(arPriv->arWmi, power_mode) < 0) - return -EIO; -#endif - return 0; -} - -static int ar6000_ioctl_giwpower(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - WMI_POWER_MODE power_mode; - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - power_mode = wmi_get_power_mode_cmd(arPriv->arWmi); - - if (power_mode == MAX_PERF_POWER) - wrqu->power.disabled = 1; - else - wrqu->power.disabled = 0; - - return 0; -} -#endif // WIRELESS_EXT > 20 - -/* - * SIOCGIWNAME - */ -int -ar6000_ioctl_giwname(struct net_device *dev, - struct iw_request_info *info, - char *name, char *extra) -{ - A_UINT8 capability; - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - capability = arPriv->arPhyCapability; - if(arPriv->arNetworkType == INFRA_NETWORK && arPriv->arConnected) { - bss_t *bss = wmi_find_node(arPriv->arWmi, arPriv->arBssid); - if (bss) { - capability = get_bss_phy_capability(bss); - wmi_node_return(arPriv->arWmi, bss); - } - } - switch (capability) { - case (WMI_11A_CAPABILITY): - strncpy(name, "AR6000 802.11a", IFNAMSIZ); - break; - case (WMI_11G_CAPABILITY): - strncpy(name, "AR6000 802.11g", IFNAMSIZ); - break; - case (WMI_11AG_CAPABILITY): - strncpy(name, "AR6000 802.11ag", IFNAMSIZ); - break; - case (WMI_11NA_CAPABILITY): - strncpy(name, "AR6000 802.11na", IFNAMSIZ); - break; - case (WMI_11NG_CAPABILITY): - strncpy(name, "AR6000 802.11ng", IFNAMSIZ); - break; - case (WMI_11NAG_CAPABILITY): - strncpy(name, "AR6K 802.11nag", IFNAMSIZ); - break; - default: - strncpy(name, "AR6000 802.11b", IFNAMSIZ); - break; - } - - return 0; -} - -/* - * SIOCSIWFREQ - */ -int -ar6000_ioctl_siwfreq(struct net_device *dev, - struct iw_request_info *info, - struct iw_freq *freq, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - /* - * We support limiting the channels via wmiconfig. - * - * We use this command to configure the channel hint for the connect cmd - * so it is possible the target will end up connecting to a different - * channel. - */ - if (freq->e > 1) { - return -EINVAL; - } else if (freq->e == 1) { - if ((arPriv->arPhyCapability == WMI_11NG_CAPABILITY) && (((freq->m / 100000) >= 5180) && ((freq->m / 100000) <= 5825))) { - return -EINVAL; - } - arPriv->arChannelHint = freq->m / 100000; - } else if(freq->m > 0) { - if ((arPriv->arPhyCapability == WMI_11NG_CAPABILITY) && ((wlan_ieee2freq(freq->m) >=5180) && (wlan_ieee2freq(freq->m) <= 5825))) { - return -EINVAL; - } - arPriv->arChannelHint = wlan_ieee2freq(freq->m); - } else { - /* Auto Channel Selection */ - arPriv->arChannelHint = 0; - } - - arPriv->ap_profile_flag = 1; /* There is a change in profile */ - - A_PRINTF("channel hint set to %d\n", arPriv->arChannelHint); - return 0; -} - -/* - * SIOCGIWFREQ - */ -int -ar6000_ioctl_giwfreq(struct net_device *dev, - struct iw_request_info *info, - struct iw_freq *freq, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - if (arPriv->arNetworkType == AP_NETWORK) { - if(arPriv->arChannelHint) { - freq->m = arPriv->arChannelHint * 100000; - } else if(arPriv->arBssChannel) { - freq->m = arPriv->arBssChannel * 100000; - } else { - return -EINVAL; - } - } else { - if (arPriv->arConnected != TRUE) { - return -EINVAL; - } else { - freq->m = arPriv->arBssChannel * 100000; - } - } - - freq->e = 1; - - return 0; -} - -/* - * SIOCSIWMODE - */ -int -ar6000_ioctl_siwmode(struct net_device *dev, - struct iw_request_info *info, - __u32 *mode, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - -#if 0 - /* - * clear SSID during mode switch in connected state - */ - if(!(arPriv->arNetworkType == (((*mode) == IW_MODE_INFRA) ? INFRA_NETWORK : ADHOC_NETWORK)) - && (arPriv->arConnected == TRUE) ){ - A_MEMZERO(arPriv->arSsid, sizeof(arPriv->arSsid)); - arPriv->arSsidLen = 0; - } -#endif - - switch (*mode) { - case IW_MODE_INFRA: - arPriv->arNextMode = INFRA_NETWORK; - break; - case IW_MODE_ADHOC: - arPriv->arNextMode = ADHOC_NETWORK; - break; - case IW_MODE_MASTER: - arPriv->arNextMode = AP_NETWORK; - break; - default: - return -EINVAL; - } - - if (arPriv->arNetworkType != arPriv->arNextMode) { - ar6000_init_mode_info(arPriv); - } - - /* Update the arNetworkType */ - arPriv->arNetworkType = arPriv->arNextMode; - - return 0; -} - -/* - * SIOCGIWMODE - */ -int -ar6000_ioctl_giwmode(struct net_device *dev, - struct iw_request_info *info, - __u32 *mode, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - switch (arPriv->arNetworkType) { - case INFRA_NETWORK: - *mode = IW_MODE_INFRA; - break; - case ADHOC_NETWORK: - *mode = IW_MODE_ADHOC; - break; - case AP_NETWORK: - *mode = IW_MODE_MASTER; - break; - default: - return -EIO; - } - return 0; -} - -/* - * SIOCSIWSENS - */ -int -ar6000_ioctl_siwsens(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *sens, char *extra) -{ - return 0; -} - -/* - * SIOCGIWSENS - */ -int -ar6000_ioctl_giwsens(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *sens, char *extra) -{ - sens->value = 0; - sens->fixed = 1; - - return 0; -} - -/* - * SIOCGIWRANGE - */ -int -ar6000_ioctl_giwrange(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *data, char *extra) -{ - - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - struct iw_range *range = (struct iw_range *) extra; - int i, j, ret = 0; - const A_INT32 rateTable[] = { - 1000, 2000, 5500, 11000, - 6000, 9000, 12000, 18000, 24000, 36000, 48000, 54000, - 6500, 13000, 19500, 26000, 39000, 52000, 58500, 65000 }; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->bIsDestroyProgress) { - return -EBUSY; - } - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (down_interruptible(&ar->arSem)) { - return -ERESTARTSYS; - } - - if (ar->bIsDestroyProgress) { - up(&ar->arSem); - return -EBUSY; - } - - arSta->arNumChannels = -1; - A_MEMZERO(arSta->arChannelList, sizeof (arSta->arChannelList)); - - if (wmi_get_channelList_cmd(arPriv->arWmi) != A_OK) { - up(&ar->arSem); - return -EIO; - } - - wait_event_interruptible_timeout(arPriv->arEvent, arSta->arNumChannels != -1, wmitimeout * HZ); - - if (signal_pending(current)) { - up(&ar->arSem); - return -EINTR; - } - - data->length = sizeof(struct iw_range); - A_MEMZERO(range, sizeof(struct iw_range)); - - range->enc_capa |= IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2; - range->enc_capa |= IW_ENC_CAPA_CIPHER_TKIP|IW_ENC_CAPA_CIPHER_CCMP; - /* Event capability (kernel + driver) */ - range->event_capa[0] = (IW_EVENT_CAPA_K_0 | - IW_EVENT_CAPA_MASK(SIOCGIWAP) | - IW_EVENT_CAPA_MASK(SIOCGIWSCAN)); - range->event_capa[1] = IW_EVENT_CAPA_K_1; - range->event_capa[4] = (IW_EVENT_CAPA_MASK(IWEVCUSTOM) | - IW_EVENT_CAPA_MASK(IWEVREGISTERED) | - IW_EVENT_CAPA_MASK(IWEVEXPIRED) | -#if WIRELESS_EXT >= 18 - IW_EVENT_CAPA_MASK(IWEVPMKIDCAND) | - IW_EVENT_CAPA_MASK(IWEVASSOCRESPIE) | - IW_EVENT_CAPA_MASK(IWEVASSOCREQIE) | - IW_EVENT_CAPA_MASK(IWEVGENIE) | -#endif - 0); - - range->scan_capa = IW_SCAN_CAPA_ESSID | IW_SCAN_CAPA_CHANNEL; - - range->txpower_capa = 0; - - range->min_pmp = 1 * 1024; - range->max_pmp = 65535 * 1024; - range->min_pmt = 1 * 1024; - range->max_pmt = 1000 * 1024; - range->pmp_flags = IW_POWER_PERIOD; - range->pmt_flags = IW_POWER_TIMEOUT; - range->pm_capa = 0; - - range->we_version_compiled = WIRELESS_EXT; - range->we_version_source = 13; - - range->retry_capa = IW_RETRY_LIMIT; - range->retry_flags = IW_RETRY_LIMIT; - range->min_retry = 0; - range->max_retry = 255; - - range->num_frequency = range->num_channels = arSta->arNumChannels; - for (i = 0; i < arSta->arNumChannels; i++) { - range->freq[i].i = wlan_freq2ieee(arSta->arChannelList[i]); - range->freq[i].m = arSta->arChannelList[i] * 100000; - range->freq[i].e = 1; - /* - * Linux supports max of 32 channels, bail out once you - * reach the max. - */ - if (i == IW_MAX_FREQUENCIES) { - break; - } - } - - /* Max quality is max field value minus noise floor */ - range->max_qual.qual = 0xff - 161; - - /* - * In order to use dBm measurements, 'level' must be lower - * than any possible measurement (see iw_print_stats() in - * wireless tools). It's unclear how this is meant to be - * done, but setting zero in these values forces dBm and - * the actual numbers are not used. - */ - range->max_qual.level = 0; - range->max_qual.noise = 0; - - range->sensitivity = 3; - - range->max_encoding_tokens = 4; - /* XXX query driver to find out supported key sizes */ - range->num_encoding_sizes = 3; - range->encoding_size[0] = 5; /* 40-bit */ - range->encoding_size[1] = 13; /* 104-bit */ - range->encoding_size[2] = 16; /* 128-bit */ - - for (i=0, j=0; iarWmi, rateTable[i], &rateIdx)==A_OK) { - range->bitrate[j] = wmi_get_rate(i) * 1000; - ++j; - } - } - range->num_bitrates = j; - - /* estimated maximum TCP throughput values (bps) */ - range->throughput = 22000000; - - range->min_rts = 0; - range->max_rts = 2347; - range->min_frag = 256; - range->max_frag = 2346; - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - if (arSta->wpaOffloadEnabled) { - range->enc_capa |= IW_ENC_CAPA_4WAY_HANDSHAKE; - } -#endif /* LINUX_VERSION_CODE >= 2.6.27 */ - - up(&ar->arSem); - - return ret; -} - -/* - * SIOCSIWPRIV - * - */ -int -ar6000_ioctl_siwpriv(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *data, char *extra) -{ - int ret = -EOPNOTSUPP; - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; -#ifdef ANDROID_ENV - extern int android_ioctl_siwpriv(struct net_device *, struct iw_request_info *, struct iw_point *, char*); - char cmd[5]; - if (data->pointer) { - if (copy_from_user(cmd, data->pointer, sizeof(cmd))) - return -EIO; - } -#endif - - if (!ar || - ( (!ar->arWmiReady || (ar->arWlanState != WLAN_ENABLED)) -#ifdef ANDROID_ENV - && (!data->pointer || strncasecmp(cmd, "START", 5)!=0) -#endif - ) - ) { - return -EIO; - } - -#ifdef ANDROID_ENV - ret = android_ioctl_siwpriv(dev, info, data, extra); - if (ret!=-EOPNOTSUPP) { - return ret; - } -#endif - return ret; -} - -/* - * SIOCSIWAP - * This ioctl is used to set the desired bssid for the connect command. - */ -int -ar6000_ioctl_siwap(struct net_device *dev, - struct iw_request_info *info, - struct sockaddr *ap_addr, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - if (ap_addr->sa_family != ARPHRD_ETHER) { - return -EIO; - } - - if (A_MEMCMP(&ap_addr->sa_data, bcast_mac, AR6000_ETH_ADDR_LEN) == 0) { - A_MEMZERO(arSta->arReqBssid, sizeof(arSta->arReqBssid)); - } else { - A_MEMCPY(arSta->arReqBssid, &ap_addr->sa_data, sizeof(arSta->arReqBssid)); - } - - return 0; -} - -/* - * SIOCGIWAP - */ -int -ar6000_ioctl_giwap(struct net_device *dev, - struct iw_request_info *info, - struct sockaddr *ap_addr, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - if (arPriv->arNetworkType == AP_NETWORK) { - A_MEMCPY(&ap_addr->sa_data, dev->dev_addr, ATH_MAC_LEN); - ap_addr->sa_family = ARPHRD_ETHER; - return 0; - } - - if (arPriv->arConnected != TRUE) { - return -EINVAL; - } - - A_MEMCPY(&ap_addr->sa_data, arPriv->arBssid, sizeof(arPriv->arBssid)); - ap_addr->sa_family = ARPHRD_ETHER; - - return 0; -} - -#if (WIRELESS_EXT >= 18) -/* - * SIOCSIWMLME - */ -int -ar6000_ioctl_siwmlme(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *data, char *extra) -{ - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->bIsDestroyProgress) { - return -EBUSY; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (down_interruptible(&ar->arSem)) { - return -ERESTARTSYS; - } - - if (data->pointer && data->length == sizeof(struct iw_mlme)) { - - A_UINT8 arNetworkType; - struct iw_mlme mlme; - - if (copy_from_user(&mlme, data->pointer, sizeof(struct iw_mlme))) { - up(&ar->arSem); - return -EIO; - } - - switch (mlme.cmd) { - - case IW_MLME_DEAUTH: - /* fall through */ - case IW_MLME_DISASSOC: - if ((arPriv->arConnected != TRUE) || - (memcmp(arPriv->arBssid, mlme.addr.sa_data, 6) != 0)) { - - up(&ar->arSem); - return -EINVAL; - } - wmi_setPmkid_cmd(arPriv->arWmi, arPriv->arBssid, NULL, 0); - arNetworkType = arPriv->arNetworkType; - ar6000_init_profile_info(arPriv); - arPriv->arNetworkType = arNetworkType; - reconnect_flag = 0; - ar6000_disconnect(arPriv); - A_MEMZERO(arPriv->arSsid, sizeof(arPriv->arSsid)); - arPriv->arSsidLen = 0; - if (arSta->arSkipScan == FALSE) { - A_MEMZERO(arSta->arReqBssid, sizeof(arSta->arReqBssid)); - } - break; - - case IW_MLME_AUTH: - /* fall through */ - case IW_MLME_ASSOC: - /* fall through */ - default: - up(&ar->arSem); - return -EOPNOTSUPP; - } - } - - up(&ar->arSem); - return 0; -} -#endif /* WIRELESS_EXT >= 18 */ - -/* - * SIOCGIWAPLIST - */ -int -ar6000_ioctl_iwaplist(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *data, char *extra) -{ - return -EIO; /* for now */ -} - -/* - * SIOCSIWSCAN - */ -int -ar6000_ioctl_siwscan(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *data, char *extra) -{ -#define ACT_DWELLTIME_DEFAULT 105 -#define HOME_TXDRAIN_TIME 100 -#define SCAN_INT HOME_TXDRAIN_TIME + ACT_DWELLTIME_DEFAULT - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_DEV_T *arApPriv = NULL; - AR_SOFTC_T *ar = arPriv->arSoftc; - AR_SOFTC_STA_T *arSta = &arPriv->arSta; - A_UINT16 connChannel = 0; - int ret = 0; - struct iw_scan_req *req = (struct iw_scan_req *) extra; - A_INT8 numChan = 0; - A_UINT16 channelList[IW_MAX_FREQUENCIES], *pChannelList = NULL; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - if (data->length < sizeof(struct iw_scan_req)) { - req = NULL; - } - - /* If scan is issued in the middle of ongoing scan or connect, - dont issue another one */ - if ( arSta->scan_triggered > 0 ) { - ++arSta->scan_triggered; - if (arSta->scan_triggered < 5) { - return 0; - } else { - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_SCAN,("Scan request is triggered over 5 times. Not scan complete event\n")); - } - } - - if (!arSta->arUserBssFilter) { - if (wmi_bssfilter_cmd(arPriv->arWmi, ALL_BSS_FILTER, 0) != A_OK) { - return -EIO; - } - } - - if (arPriv->arConnected) { - if (wmi_get_stats_cmd(arPriv->arWmi) != A_OK) { - return -EIO; - } - } - -#if WIRELESS_EXT >= 18 - if ( req && (data->flags & IW_SCAN_THIS_ESSID) == IW_SCAN_THIS_ESSID ) { - if (wmi_probedSsid_cmd(arPriv->arWmi, 0, - SPECIFIC_SSID_FLAG, req->essid_len, req->essid) == A_OK) { - if (!arSta->scanSpecificSsid) { - arSta->scanSpecificSsid = 1; - } - } - } else { - A_UINT8 idx; - for (idx=0; idxscanSpecificSsid; ++idx) { - /* index 0 always reserves for broadcast SSID*/ - A_UINT8 flag = (idx==0) ? ANY_SSID_FLAG : DISABLE_SSID_FLAG; - wmi_probedSsid_cmd(arPriv->arWmi, idx, flag, 0, NULL); - } - arSta->scanSpecificSsid = 0; - } - - if ( req && (data->flags & IW_SCAN_THIS_FREQ) == IW_SCAN_THIS_FREQ && req->num_channels>0) { - A_UINT8 i; - for (i=0; inum_channels; ++i) { - struct iw_freq *freq = &req->channel_list[i]; - A_UINT16 *dst = &channelList[numChan]; - if (freq->e == 1) { - /* freq->m == (Freq HZ value) divided by (10 ^ freq->e) */ - *dst = freq->m / 100000; - ++numChan; - } else if (freq->e < 1 && freq->m) { - /* It is a channel number if freq->e == 0 */ - *dst = wlan_ieee2freq(freq->m); - ++numChan; - } - } - if (numChan > 0) { - pChannelList = channelList; - } - } -#endif /* WIRELESS_EXT >= 18 */ - - /* AP-STA concurrency. Allow scan only on connected channel when AP and STA - * both are functional. - */ - GET_CONN_AP_PRIV(ar,arApPriv); - if((arApPriv) && (arPriv->arConnected)){ - connChannel = arPriv->arBssChannel; - if (wmi_startscan_cmd(arPriv->arWmi, WMI_LONG_SCAN, FALSE, FALSE, \ - 0, 0, 1,&connChannel) != A_OK) { - ret = -EIO; - } - } else { - if (wmi_startscan_cmd(arPriv->arWmi, WMI_LONG_SCAN, FALSE, FALSE, \ - 0, 0, numChan, pChannelList) != A_OK) { - ret = -EIO; - } - } - if (ret == 0) { - arSta->scan_triggered = 1; - } - - return ret; -#undef ACT_DWELLTIME_DEFAULT -#undef HOME_TXDRAIN_TIME -#undef SCAN_INT -} - - -/* - * Units are in db above the noise floor. That means the - * rssi values reported in the tx/rx descriptors in the - * driver are the SNR expressed in db. - * - * If you assume that the noise floor is -95, which is an - * excellent assumption 99.5 % of the time, then you can - * derive the absolute signal level (i.e. -95 + rssi). - * There are some other slight factors to take into account - * depending on whether the rssi measurement is from 11b, - * 11g, or 11a. These differences are at most 2db and - * can be documented. - * - * NB: various calculations are based on the orinoco/wavelan - * drivers for compatibility - */ -static void -ar6000_set_quality(struct iw_quality *iq, A_INT8 rssi) -{ - if (rssi < 0) { - iq->qual = 0; - } else { - iq->qual = rssi; - } - - /* NB: max is 94 because noise is hardcoded to 161 */ - if (iq->qual > 94) - iq->qual = 94; - - iq->noise = 161; /* -95dBm */ - iq->level = iq->noise + iq->qual; - iq->updated = 7; -} - - -int -ar6000_ioctl_siwcommit(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *data, char *extra) -{ - - AR_SOFTC_DEV_T *arPriv = (AR_SOFTC_DEV_T *)ar6k_priv(dev); - AR_SOFTC_T *ar = arPriv->arSoftc; - - if (is_iwioctl_allowed(arPriv->arNextMode, info->cmd) != A_OK) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd)); - return -EOPNOTSUPP; - } - - if (ar->arWmiReady == FALSE) { - return -EIO; - } - - if (ar->arWlanState == WLAN_DISABLED) { - return -EIO; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_CONNECT,("AP: SSID %s freq %d authmode %d dot11 auth %d"\ - " PW crypto %d GRP crypto %d\n", - arPriv->arSsid, arPriv->arChannelHint, - arPriv->arAuthMode, arPriv->arDot11AuthMode, - arPriv->arPairwiseCrypto, arPriv->arGroupCrypto)); - - /* Stop getting pkts from upper stack */ - netif_stop_queue(arPriv->arNetDev); - /* Flush the Tx queues */ - ar6000_TxDataCleanup(ar); - /* Start getting pkts from upper stack */ - netif_wake_queue(arPriv->arNetDev); - - ar6000_ap_mode_profile_commit(arPriv); - - return 0; -} - -#define W_PROTO(_x) wait_ ## _x -#define WAIT_HANDLER_IMPL(_x, type) \ -int wait_ ## _x (struct net_device *dev, struct iw_request_info *info, type wrqu, char *extra) {\ - int ret; \ - dev_hold(dev); \ - rtnl_unlock(); \ - ret = _x(dev, info, wrqu, extra); \ - rtnl_lock(); \ - dev_put(dev); \ - return ret;\ -} - -WAIT_HANDLER_IMPL(ar6000_ioctl_siwessid, struct iw_point *) -WAIT_HANDLER_IMPL(ar6000_ioctl_giwrate, struct iw_param *) -WAIT_HANDLER_IMPL(ar6000_ioctl_giwtxpow, struct iw_param *) -WAIT_HANDLER_IMPL(ar6000_ioctl_giwrange, struct iw_point*) - -/* Structures to export the Wireless Handlers */ -static const iw_handler ath_handlers[] = { - (iw_handler) ar6000_ioctl_siwcommit, /* SIOCSIWCOMMIT */ - (iw_handler) ar6000_ioctl_giwname, /* SIOCGIWNAME */ - (iw_handler) NULL, /* SIOCSIWNWID */ - (iw_handler) NULL, /* SIOCGIWNWID */ - (iw_handler) ar6000_ioctl_siwfreq, /* SIOCSIWFREQ */ - (iw_handler) ar6000_ioctl_giwfreq, /* SIOCGIWFREQ */ - (iw_handler) ar6000_ioctl_siwmode, /* SIOCSIWMODE */ - (iw_handler) ar6000_ioctl_giwmode, /* SIOCGIWMODE */ - (iw_handler) ar6000_ioctl_siwsens, /* SIOCSIWSENS */ - (iw_handler) ar6000_ioctl_giwsens, /* SIOCGIWSENS */ - (iw_handler) NULL /* not _used */, /* SIOCSIWRANGE */ - (iw_handler) W_PROTO(ar6000_ioctl_giwrange),/* SIOCGIWRANGE */ - (iw_handler) ar6000_ioctl_siwpriv, /* SIOCSIWPRIV */ - (iw_handler) NULL /* kernel code */, /* SIOCGIWPRIV */ - (iw_handler) NULL /* not used */, /* SIOCSIWSTATS */ - (iw_handler) NULL /* kernel code */, /* SIOCGIWSTATS */ - (iw_handler) NULL, /* SIOCSIWSPY */ - (iw_handler) NULL, /* SIOCGIWSPY */ - (iw_handler) NULL, /* SIOCSIWTHRSPY */ - (iw_handler) NULL, /* SIOCGIWTHRSPY */ - (iw_handler) ar6000_ioctl_siwap, /* SIOCSIWAP */ - (iw_handler) ar6000_ioctl_giwap, /* SIOCGIWAP */ -#if (WIRELESS_EXT >= 18) - (iw_handler) ar6000_ioctl_siwmlme, /* SIOCSIWMLME */ -#else - (iw_handler) NULL, /* -- hole -- */ -#endif /* WIRELESS_EXT >= 18 */ - (iw_handler) ar6000_ioctl_iwaplist, /* SIOCGIWAPLIST */ - (iw_handler) ar6000_ioctl_siwscan, /* SIOCSIWSCAN */ - (iw_handler) ar6000_ioctl_giwscan, /* SIOCGIWSCAN */ - (iw_handler) W_PROTO(ar6000_ioctl_siwessid),/* SIOCSIWESSID */ - (iw_handler) ar6000_ioctl_giwessid, /* SIOCGIWESSID */ - (iw_handler) NULL, /* SIOCSIWNICKN */ - (iw_handler) NULL, /* SIOCGIWNICKN */ - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) ar6000_ioctl_siwrate, /* SIOCSIWRATE */ - (iw_handler) W_PROTO(ar6000_ioctl_giwrate), /* SIOCGIWRATE */ - (iw_handler) NULL, /* SIOCSIWRTS */ - (iw_handler) NULL, /* SIOCGIWRTS */ - (iw_handler) NULL, /* SIOCSIWFRAG */ - (iw_handler) NULL, /* SIOCGIWFRAG */ - (iw_handler) ar6000_ioctl_siwtxpow, /* SIOCSIWTXPOW */ - (iw_handler) W_PROTO(ar6000_ioctl_giwtxpow),/* SIOCGIWTXPOW */ - (iw_handler) ar6000_ioctl_siwretry, /* SIOCSIWRETRY */ - (iw_handler) ar6000_ioctl_giwretry, /* SIOCGIWRETRY */ - (iw_handler) ar6000_ioctl_siwencode, /* SIOCSIWENCODE */ - (iw_handler) ar6000_ioctl_giwencode, /* SIOCGIWENCODE */ -#if WIRELESS_EXT > 20 - (iw_handler) ar6000_ioctl_siwpower, /* SIOCSIWPOWER */ - (iw_handler) ar6000_ioctl_giwpower, /* SIOCGIWPOWER */ -#endif // WIRELESS_EXT > 20 -#if WIRELESS_EXT >= 18 - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) ar6000_ioctl_siwgenie, /* SIOCSIWGENIE */ - (iw_handler) ar6000_ioctl_giwgenie, /* SIOCGIWGENIE */ - (iw_handler) ar6000_ioctl_siwauth, /* SIOCSIWAUTH */ - (iw_handler) ar6000_ioctl_giwauth, /* SIOCGIWAUTH */ - (iw_handler) ar6000_ioctl_siwencodeext, /* SIOCSIWENCODEEXT */ - (iw_handler) ar6000_ioctl_giwencodeext, /* SIOCGIWENCODEEXT */ - (iw_handler) ar6000_ioctl_siwpmksa, /* SIOCSIWPMKSA */ -#endif // WIRELESS_EXT >= 18 -}; - -struct iw_handler_def ath_iw_handler_def = { - .standard = (iw_handler *)ath_handlers, - .num_standard = ARRAY_SIZE(ath_handlers), -// .private = NULL, -// .num_private = 0, -}; diff --git a/drivers/net/wireless/ar6003/host/p2p/makefile b/drivers/net/wireless/ar6003/host/p2p/makefile deleted file mode 100644 index 1ba034c4900e..000000000000 --- a/drivers/net/wireless/ar6003/host/p2p/makefile +++ /dev/null @@ -1,26 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2005-2007 Atheros Corporation. All rights reserved. -# -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# -#------------------------------------------------------------------------------ -#============================================================================== -# Author(s): ="Atheros" -#============================================================================== -!INCLUDE $(_MAKEENVROOT)\makefile.def - - - diff --git a/drivers/net/wireless/ar6003/host/p2p/p2p_internal.h b/drivers/net/wireless/ar6003/host/p2p/p2p_internal.h deleted file mode 100644 index 4dc905992538..000000000000 --- a/drivers/net/wireless/ar6003/host/p2p/p2p_internal.h +++ /dev/null @@ -1,93 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This file contains internal definitions for the host P2P module. -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef __P2P_INTERNAL_H__ -#define __P2P_INTERNAL_H__ - -#include -#include -#include -#include - -/* P2P peer device context */ -struct host_p2p_dev { - DL_LIST list; - struct p2p_device dev; - struct p2p_dev_ctx *p2p; - A_UINT8 ref_cnt; - A_UINT8 *p2p_buf; - A_UINT32 p2p_buf_len; - A_UINT8 persistent_grp; -/* Persistent P2P Info*/ - A_UINT8 role_go; - A_UINT8 ssid[WMI_MAX_SSID_LEN]; - A_UINT8 ssid_len; -}; - -/* Global P2P Context structure */ -struct p2p_ctx { - A_INT8 go_intent; -}; - -struct p2p_sd_query { - struct p2p_sd_query *next; - A_UINT8 peer[ETH_ALEN]; - A_UINT8 for_all_peers; - A_UINT8 *tlvs; - A_UINT16 tlv_len; -}; - -/* Device specific P2P context */ -struct p2p_dev_ctx { - struct p2p_ctx *p2p_ctx; - DL_LIST devices; - A_UINT8 peer_filter[ETH_ALEN]; - A_UINT8 p2p_auth_invite[ETH_ALEN]; - void *dev; /* AR6K priv context */ - struct p2p_sd_query *sd_queries; - struct p2p_sd_query *curr_sd_query; - A_UINT8 srv_update_indic; -}; - -#define P2P_MAX_GROUP_ENTRIES 10 - -struct p2p_client_info { - const A_UINT8 *p2p_device_addr; - const A_UINT8 *p2p_interface_addr; - const A_UINT8 *pri_dev_type; - const A_UINT8 *sec_dev_types; - const A_CHAR *dev_name; - A_UINT32 dev_name_len; - A_UINT16 config_methods; - A_UINT8 dev_capab; - A_UINT8 num_sec_dev_types; -}; - -struct p2p_group_info { - A_UINT32 num_clients; - struct p2p_client_info client[P2P_MAX_GROUP_ENTRIES]; -}; - -#define P2P_GROUP_CAPAB_PERSISTENT_GROUP (1<<1) -#endif /* __P2P_INTERNAL_H__ */ diff --git a/drivers/net/wireless/ar6003/host/p2p/p2p_main.c b/drivers/net/wireless/ar6003/host/p2p/p2p_main.c deleted file mode 100644 index 6702fc80f7c5..000000000000 --- a/drivers/net/wireless/ar6003/host/p2p/p2p_main.c +++ /dev/null @@ -1,2676 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2009-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This file implements the host side P2P module. -// -// Author(s): ="Atheros" -//============================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include -#include "p2p_internal.h" - -#include -#define WPS_DEV_TYPE_BUFSIZE 21 -#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] -#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" -#include - -struct wmi_t; - -extern A_STATUS wmi_p2p_go_neg_rsp_cmd(struct wmi_t *wmip, A_UINT8 status, - A_UINT8 go_intent, A_UINT32 wps_method, A_UINT16 listen_freq, - A_UINT8 *wpsbuf, A_UINT32 wpslen, A_UINT8 *p2pbuf, A_UINT32 p2plen, - A_UINT8 dialog_token, A_UINT8 persistent_grp); - -extern A_STATUS wmi_p2p_invite_req_rsp_cmd(struct wmi_t *wmip, A_UINT8 status, - A_INT8 is_go, A_UINT8 *grp_bssid, A_UINT8 *p2pbuf, - A_UINT8 p2plen, A_UINT8 dialog_token); - -extern A_STATUS -wmi_p2p_go_neg_start(struct wmi_t *wmip, WMI_P2P_GO_NEG_START_CMD *go_param); - -extern A_STATUS wmi_p2p_invite_cmd(struct wmi_t *wmip, WMI_P2P_INVITE_CMD *buf); - -extern A_STATUS wmi_p2p_prov_disc_cmd(struct wmi_t *wmip, - WMI_P2P_PROV_DISC_REQ_CMD *buf); - -extern A_STATUS wmi_p2p_stop_sdpd(struct wmi_t *wmip); - -extern void wmi_node_return (struct wmi_t *wmip, bss_t *bss); - -extern void wmi_node_update_timestamp(struct wmi_t *wmip, bss_t *bss); - -extern void wmi_setup_node(struct wmi_t *wmip, bss_t *bss, const A_UINT8 *bssid); -extern bss_t *wmi_node_alloc(struct wmi_t *wmip, A_UINT8 len); - -extern bss_t *wmi_find_node(struct wmi_t *wmip, const A_UINT8 *macaddr); - - -static struct p2p_sd_query *p2p_pending_sd_req(struct p2p_dev_ctx *p2p_dev_ctx, - struct host_p2p_dev *dev); - - -/* Global P2P context */ -static struct p2p_ctx *g_p2p_ctx; - -#define IEEE80211_ELEMID_VENDOR 221 /* vendor private */ -#define IEEE80211_ELEMID_SSID 0 - -static A_STATUS p2p_parse_subelement(A_UINT8 id, const A_UINT8 *data, - A_UINT16 len, struct p2p_ie *p2p_ie) -{ - A_STATUS status = A_OK; - const A_UINT8 *pos; - A_UINT32 i, nlen; - - switch (id) { - case P2P_ATTR_CAPABILITY: - if (len < 2) { - return A_ERROR; - } - p2p_ie->capability = data; - break; - case P2P_ATTR_GROUP_OWNER_INTENT: - if (len < 1) { - return A_ERROR; - } - p2p_ie->go_intent = data; - break; - case P2P_ATTR_STATUS: - if (len < 1) { - return A_ERROR; - } - p2p_ie->status = data; - break; - case P2P_ATTR_LISTEN_CHANNEL: - if (len == 0) { - break; - } - if (len < 2) { - return A_ERROR; - } - p2p_ie->listen_channel = data; - break; - - case P2P_ATTR_OPERATING_CHANNEL: - if (len == 0) { - break; - } - if (len < 2) { - return A_ERROR; - } - p2p_ie->operating_channel = data; - break; - - case P2P_ATTR_CHANNEL_LIST: - if (len < 3) { - return A_ERROR; - } - p2p_ie->channel_list = data; - p2p_ie->channel_list_len = len; - break; - case P2P_ATTR_GROUP_INFO: - p2p_ie->group_info = data; - p2p_ie->group_info_len = len; - break; - case P2P_ATTR_DEVICE_INFO: - if (len < ETH_ALEN + 2 + 8 + 1) { - return A_ERROR; - } - p2p_ie->p2p_device_info = data; - p2p_ie->p2p_device_info_len = len; - pos = data; - p2p_ie->p2p_device_addr = pos; - pos += ETH_ALEN; - p2p_ie->config_methods = WPA_GET_BE16(pos); - pos += 2; - p2p_ie->pri_dev_type = pos; - pos += 8; - p2p_ie->num_sec_dev_types = *pos++; - if (p2p_ie->num_sec_dev_types * 8 > data + len - pos) { - return A_ERROR; - } - pos += p2p_ie->num_sec_dev_types * 8; - if (data + len - pos < 4) { - return A_ERROR; - } - if (WPA_GET_BE16(pos) != ATTR_DEV_NAME) { - return A_ERROR; - } - pos += 2; - nlen = WPA_GET_BE16(pos); - pos += 2; - if (data + len - pos < (int) nlen || nlen > 32) { - return A_ERROR; - } - A_MEMCPY(p2p_ie->device_name, pos, nlen); - p2p_ie->dev_name_len = nlen; - for (i = 0; i < nlen; i++) { - if (p2p_ie->device_name[i] == '\0') - break; - if (p2p_ie->device_name[i] < 32) - p2p_ie->device_name[i] = '_'; - } - break; - case P2P_ATTR_CONFIGURATION_TIMEOUT: - if (len < 2) { - return A_ERROR; - } - p2p_ie->config_timeout = data; - break; - case P2P_ATTR_INTENDED_INTERFACE_ADDR: - if (len < ETH_ALEN) { - return A_ERROR; - } - p2p_ie->intended_addr = data; - break; - default: - break; - } - - return status; -} - - -/** - * p2p_parse_p2p_ie - Parse P2P IE - */ -static A_STATUS p2p_parse_p2p_ie(const A_UINT8 *data, A_UINT8 len, struct p2p_ie *msg) -{ - A_STATUS status = A_OK; - const A_UINT8 *pos = data; - const A_UINT8 *end = pos + len; - - while (pos < end) { - A_UINT16 attr_len; - if (pos + 2 >= end) { - return A_ERROR; - } - attr_len = WPA_GET_LE16((pos + 1)); - if (pos + 3 + attr_len > end) { - return A_ERROR; - } - if ((status = p2p_parse_subelement(pos[0], pos + 3, attr_len, msg)) != - A_OK) { - return A_ERROR; - } - pos += 3 + attr_len; - } - - return status; -} - -static A_STATUS wps_set_attr(struct wps_parse_attr *attr, A_UINT16 type, - const A_UINT8 *pos, A_UINT16 len) -{ - A_STATUS status = A_OK; - - switch (type) { - case ATTR_VERSION: - if (len != 1) { - return A_ERROR; - } - attr->version = pos; - break; - case ATTR_MSG_TYPE: - if (len != 1) { - return A_ERROR; - } - attr->msg_type = pos; - break; - case ATTR_ENROLLEE_NONCE: - if (len != WPS_NONCE_LEN) { - return A_ERROR; - } - attr->enrollee_nonce = pos; - break; - case ATTR_REGISTRAR_NONCE: - if (len != WPS_NONCE_LEN) { - return A_ERROR; - } - attr->registrar_nonce = pos; - break; - case ATTR_UUID_E: - if (len != WPS_UUID_LEN) { - return A_ERROR; - } - attr->uuid_e = pos; - break; - case ATTR_UUID_R: - if (len != WPS_UUID_LEN) { - return A_ERROR; - } - attr->uuid_r = pos; - break; - case ATTR_AUTH_TYPE_FLAGS: - if (len != 2) { - return A_ERROR; - } - attr->auth_type_flags = pos; - break; - case ATTR_ENCR_TYPE_FLAGS: - if (len != 2) { - return A_ERROR; - } - attr->encr_type_flags = pos; - break; - case ATTR_CONN_TYPE_FLAGS: - if (len != 1) { - return A_ERROR; - } - attr->conn_type_flags = pos; - break; - case ATTR_CONFIG_METHODS: - if (len != 2) { - return A_ERROR; - } - attr->config_methods = pos; - break; - case ATTR_SELECTED_REGISTRAR_CONFIG_METHODS: - if (len != 2) { - return A_ERROR; - } - attr->sel_reg_config_methods = pos; - break; - case ATTR_PRIMARY_DEV_TYPE: - if (len != WPS_DEV_TYPE_LEN) { - return A_ERROR; - } - attr->primary_dev_type = pos; - break; - case ATTR_RF_BANDS: - if (len != 1) { - return A_ERROR; - } - attr->rf_bands = pos; - break; - case ATTR_ASSOC_STATE: - if (len != 2) { - return A_ERROR; - } - attr->assoc_state = pos; - break; - case ATTR_CONFIG_ERROR: - if (len != 2) { - return A_ERROR; - } - attr->config_error = pos; - break; - case ATTR_DEV_PASSWORD_ID: - if (len != 2) { - return A_ERROR; - } - attr->dev_password_id = pos; - break; - case ATTR_OS_VERSION: - if (len != 4) { - return A_ERROR; - } - attr->os_version = pos; - break; - case ATTR_WPS_STATE: - if (len != 1) { - return A_ERROR; - } - attr->wps_state = pos; - break; - case ATTR_AUTHENTICATOR: - if (len != WPS_AUTHENTICATOR_LEN) { - return A_ERROR; - } - attr->authenticator = pos; - break; - case ATTR_R_HASH1: - if (len != WPS_HASH_LEN) { - return A_ERROR; - } - attr->r_hash1 = pos; - break; - case ATTR_R_HASH2: - if (len != WPS_HASH_LEN) { - return A_ERROR; - } - attr->r_hash2 = pos; - break; - case ATTR_E_HASH1: - if (len != WPS_HASH_LEN) { - return A_ERROR; - } - attr->e_hash1 = pos; - break; - case ATTR_E_HASH2: - if (len != WPS_HASH_LEN) { - return A_ERROR; - } - attr->e_hash2 = pos; - break; - case ATTR_R_SNONCE1: - if (len != WPS_SECRET_NONCE_LEN) { - return A_ERROR; - } - attr->r_snonce1 = pos; - break; - case ATTR_R_SNONCE2: - if (len != WPS_SECRET_NONCE_LEN) { - return A_ERROR; - } - attr->r_snonce2 = pos; - break; - case ATTR_E_SNONCE1: - if (len != WPS_SECRET_NONCE_LEN) { - return A_ERROR; - } - attr->e_snonce1 = pos; - break; - case ATTR_E_SNONCE2: - if (len != WPS_SECRET_NONCE_LEN) { - return A_ERROR; - } - attr->e_snonce2 = pos; - break; - case ATTR_KEY_WRAP_AUTH: - if (len != WPS_KWA_LEN) { - return A_ERROR; - } - attr->key_wrap_auth = pos; - break; - case ATTR_AUTH_TYPE: - if (len != 2) { - return A_ERROR; - } - attr->auth_type = pos; - break; - case ATTR_ENCR_TYPE: - if (len != 2) { - return A_ERROR; - } - attr->encr_type = pos; - break; - case ATTR_NETWORK_INDEX: - if (len != 1) { - return A_ERROR; - } - attr->network_idx = pos; - break; - case ATTR_NETWORK_KEY_INDEX: - if (len != 1) { - return A_ERROR; - } - attr->network_key_idx = pos; - break; - case ATTR_MAC_ADDR: - if (len != ETH_ALEN) { - return A_ERROR; - } - attr->mac_addr = pos; - break; - case ATTR_KEY_PROVIDED_AUTO: - if (len != 1) { - return A_ERROR; - } - attr->key_prov_auto = pos; - break; - case ATTR_802_1X_ENABLED: - if (len != 1) { - return A_ERROR; - } - attr->dot1x_enabled = pos; - break; - case ATTR_SELECTED_REGISTRAR: - if (len != 1) { - return A_ERROR; - } - attr->selected_registrar = pos; - break; - case ATTR_REQUEST_TYPE: - if (len != 1) { - return A_ERROR; - } - attr->request_type = pos; - break; - case ATTR_RESPONSE_TYPE: - if (len != 1) { - return A_ERROR; - } - attr->request_type = pos; - break; - case ATTR_MANUFACTURER: - attr->manufacturer = pos; - attr->manufacturer_len = len; - break; - case ATTR_MODEL_NAME: - attr->model_name = pos; - attr->model_name_len = len; - break; - case ATTR_MODEL_NUMBER: - attr->model_number = pos; - attr->model_number_len = len; - break; - case ATTR_SERIAL_NUMBER: - attr->serial_number = pos; - attr->serial_number_len = len; - break; - case ATTR_DEV_NAME: - attr->dev_name = pos; - attr->dev_name_len = len; - break; - case ATTR_PUBLIC_KEY: - attr->public_key = pos; - attr->public_key_len = len; - break; - case ATTR_ENCR_SETTINGS: - attr->encr_settings = pos; - attr->encr_settings_len = len; - break; - case ATTR_CRED: - if (attr->num_cred >= MAX_CRED_COUNT) { - break; - } - attr->cred[attr->num_cred] = pos; - attr->cred_len[attr->num_cred] = len; - attr->num_cred++; - break; - case ATTR_SSID: - attr->ssid = pos; - attr->ssid_len = len; - break; - case ATTR_NETWORK_KEY: - attr->network_key = pos; - attr->network_key_len = len; - break; - case ATTR_EAP_TYPE: - attr->eap_type = pos; - attr->eap_type_len = len; - break; - case ATTR_EAP_IDENTITY: - attr->eap_identity = pos; - attr->eap_identity_len = len; - break; - default: - break; - } - - return status; -} - -static A_STATUS wps_parse_msg(const A_UINT8 *data, A_UINT8 len, struct wps_parse_attr *attr) -{ - A_STATUS status = A_OK; - const A_UINT8 *pos, *end; - A_UINT16 type; - - A_MEMZERO(attr, sizeof(*attr)); - pos = data; - end = pos + len; - - while (pos < end) { - if (end - pos < 4) { - return A_ERROR; - } - - type = WPA_GET_BE16(pos); - pos += 2; - len = WPA_GET_BE16(pos); - pos += 2; - if (len > end - pos) { - return A_ERROR; - } - - if ((status = wps_set_attr(attr, type, pos, len)) != A_OK) { - return status; - } - - pos += len; - } - - return status; -} - - -static A_STATUS p2p_parse_wps_ie(const A_UINT8 *data, A_UINT8 len, struct p2p_ie *p2p_ie) -{ - A_STATUS status = A_OK; - struct wps_parse_attr attr; - - if ( (status = wps_parse_msg(data, len, &attr)) != A_OK ) { - return status; - } - - if (attr.dev_name && attr.dev_name_len < sizeof(p2p_ie->wps_device_name)) { - A_MEMCPY(p2p_ie->wps_device_name, attr.dev_name, attr.dev_name_len); - p2p_ie->wps_dev_name_len = attr.dev_name_len; - } - - if (attr.config_methods) { - p2p_ie->wps_config_methods = WPA_GET_BE16((attr.config_methods)); - } - - if (attr.dev_password_id) { - p2p_ie->dev_password_id = WPA_GET_BE16(attr.dev_password_id); - } - - if(attr.primary_dev_type) { - p2p_ie->wps_pri_dev_type = attr.primary_dev_type; - - } - - return status; -} -static A_STATUS p2p_get_ie(WMI_BI_FTYPE fType, const A_UINT8 *data, A_UINT32 len, A_UINT32 vendor_type, A_UINT8 **ie, A_UINT32 *ie_len) -{ - const A_UINT8 *frm, *efrm; - A_STATUS status = A_ENODEV; - struct p2p_ie p2p_ie ; - A_UINT8 tlv_len; - - switch(fType) { - case BEACON_FTYPE: - case PROBERESP_FTYPE: - /* - * beacon/probe response frame format - * [8] time stamp - * [2] beacon interval - * [2] capability information - * [tlv]s... - */ - data += 12; - len -= 12; - break; - case ACTION_MGMT_FTYPE: - /* Action frame format: - * [1] Category code - * [1] Action field - * [3] WFA Specific OUI - * [1] OUI Type - * [1] OUI SubType - * [1] Dialog Token - * [TLV]s... - * - P2P IE, WSC IE - */ - data += 8; - len -= 8; - break; - case PROBEREQ_FTYPE: - - break; - default: - A_ASSERT(FALSE); - break; - } - - frm = data; - efrm = (A_UINT8 *) (frm + len); - - while (frm < efrm) { - switch (*frm) { - case IEEE80211_ELEMID_VENDOR: - tlv_len = frm[1]-4; - if(isp2poui(frm) && (vendor_type == P2P_OUI) && (tlv_len)) { - status = p2p_parse_p2p_ie(frm+6, frm[1]-4, &p2p_ie); - if(status == A_OK && (frm[1] -4 !=0)) { - *ie = (A_UINT8 *)frm+6; - *ie_len = frm[1]-4 ; - } - } - break; - default: - break; - } - /* Discontinue parsing if there is a bad IE */ - if (status != A_OK && status != A_ENODEV) { - break; - } - frm += frm[1] + 2; - } - - return status; -} -/** - * p2p_parse_ies - Parse P2P message IEs (both WPS and P2P IE) - */ -static A_STATUS p2p_parse_ies(const A_UINT8 *data, A_UINT32 len, struct p2p_ie *p2p_ie) -{ - const A_UINT8 *frm, *efrm; - A_STATUS status = A_ENODEV; - A_BOOL found = FALSE; - - frm = data; - efrm = (A_UINT8 *) (frm + len); - - while (frm < efrm) { - switch (*frm) { - case IEEE80211_ELEMID_VENDOR: - if(iswscoui(frm)) { - status = p2p_parse_wps_ie(frm+6, frm[1]-4, p2p_ie); - } else if(isp2poui(frm)) { - found = TRUE; - status = p2p_parse_p2p_ie(frm+6, frm[1]-4, p2p_ie); - } - break; - case IEEE80211_ELEMID_SSID: - p2p_ie->ssid = frm; - break; - default: - break; - } - /* Discontinue parsing if there is a bad IE */ - if (status != A_OK && status != A_ENODEV) { - break; - } - frm += frm[1] + 2; - } - - if (status == A_OK && !found) { - status = A_ENODEV; - } - - return status; -} - -/* This function prunes the frame depending on its type to point the data ptr to - * the IEs portion of the frame & calls the p2p_parse_ies() to parse the P2P & - * WPS IEs. - */ -static A_STATUS p2p_parse(WMI_BI_FTYPE fType, const A_UINT8 *data, A_UINT32 len, struct p2p_ie *p2p_ie) -{ - A_STATUS status = A_OK; - - switch(fType) { - case BEACON_FTYPE: - case PROBERESP_FTYPE: - /* - * beacon/probe response frame format - * [8] time stamp - * [2] beacon interval - * [2] capability information - * [tlv]s... - */ - data += 12; - len -= 12; - break; - case ACTION_MGMT_FTYPE: - /* Action frame format: - * [1] Category code - * [1] Action field - * [3] WFA Specific OUI - * [1] OUI Type - * [1] OUI SubType - * [1] Dialog Token - * [TLV]s... - * - P2P IE, WSC IE - */ - p2p_ie->dialog_token = *(data+7); - data += 8; - len -= 8; - break; - - case PROBEREQ_FTYPE: - - break; - default: - A_ASSERT(FALSE); - break; - } - - status = p2p_parse_ies(data, len, p2p_ie); - - return status; -} - -static A_STATUS p2p_group_info_parse(const A_UINT8 *group_info, A_UINT32 group_info_len, - struct p2p_group_info *info) -{ - const A_UINT8 *start, *end; - - A_MEMZERO(info, sizeof(*info)); - - start = group_info; - end = start + group_info_len; - - - while (start < end) { - struct p2p_client_info *cli; - - const A_UINT8 *t, *cend; - A_UINT32 count; - - cli = &info->client[info->num_clients]; - cend = start + 1 + start[0]; - - if (cend > end) { - return A_ERROR; /* invalid data */ - } - - /* 'start' at begin of P2P Client Info Descriptor */ - /* t at Device Capability Bitmap */ - t = start + 1 + 2 * ETH_ALEN; - if (t > cend) { - return A_ERROR; /* invalid data */ - } - - cli->p2p_device_addr = start + 1; - cli->p2p_interface_addr = start + 1 + ETH_ALEN; - cli->dev_capab = t[0]; - - if (t + 1 + 2 + 8 + 1 > cend) { - return A_ERROR; /* invalid data */ - } - - cli->config_methods = WPA_GET_BE16(&t[1]); - cli->pri_dev_type = &t[3]; - - t += 1 + 2 + 8; - /* t at Number of Secondary Device Types */ - cli->num_sec_dev_types = *t++; - if (t + 8 * cli->num_sec_dev_types > cend) { - return A_ERROR; /* invalid data */ - } - cli->sec_dev_types = t; - t += 8 * cli->num_sec_dev_types; - - /* t at Device Name in WPS TLV format */ - if (t + 2 + 2 > cend) { - return A_ERROR; /* invalid data */ - } - if (WPA_GET_BE16(t) != ATTR_DEV_NAME) { - return A_ERROR; /* invalid Device Name TLV */ - } - t += 2; - count = WPA_GET_BE16(t); - t += 2; - if (count > cend - t) { - return A_ERROR; /* invalid Device Name TLV */ - } - if (count >= 32) { - count = 32; - } - cli->dev_name = (const char *) t; - cli->dev_name_len = count; - - start = cend; - - info->num_clients++; - if (info->num_clients == P2P_MAX_GROUP_ENTRIES) { - return A_ERROR; - } - } - - return A_OK; -} - -static void p2p_copy_client_info(struct host_p2p_dev *dev, - struct p2p_client_info *cli) -{ - A_MEMCPY((dev->dev).device_name, cli->dev_name, cli->dev_name_len); - (dev->dev).device_name[cli->dev_name_len] = '\0'; - (dev->dev).dev_capab = cli->dev_capab; - (dev->dev).config_methods = cli->config_methods; - A_MEMCPY((dev->dev).pri_dev_type, cli->pri_dev_type, 8); -} - - -//static A_STATUS ieee802_11_vendor_ie_concat(const A_UINT8 *ies, -// A_UINT32 ies_len, A_UINT32 oui_type, A_UINT8 *buf, A_UINT32 *buflen) -//{ -// const A_UINT8 *end, *pos, *ie; -// A_UINT8 len=0; -// -// pos = ies; -// end = ies + ies_len; -// ie = NULL; -// -// while (pos + 1 < end) { -// if (pos + 2 + pos[1] > end) -// return A_ERROR; -// if (pos[0] == WLAN_EID_VENDOR_SPECIFIC && pos[1] >= 4 && -// WPA_GET_BE32(&pos[2]) == oui_type) { -// ie = pos; -// break; -// } -// pos += 2 + pos[1]; -// } -// -// if (ie == NULL) { -// *buflen = 0; -// return A_OK; /* No specified vendor IE found */ -// } -// -// if (buf == NULL) -// return A_ERROR; -// -// /* -// * There may be multiple vendor IEs in the message, so need to -// * concatenate their data fields. -// */ -// while (pos + 1 < end) { -// if (pos + 2 + pos[1] > end) -// break; -// if (pos[0] == WLAN_EID_VENDOR_SPECIFIC && pos[1] >= 4 && -// WPA_GET_BE32(&pos[2]) == oui_type) { -//#define MAX_BUF_SIZE 512 -// A_ASSERT((len+pos[1]-4) <= MAX_BUF_SIZE); -// A_MEMCPY(buf+len, pos+6, pos[1]-4); -// len += pos[1]-4; -// } -// pos += 2 + pos[1]; -// } -// -// /* store the length of the IE to return to the caller. -// */ -// *buflen = len; -// -// return A_OK; -//} - -static A_INT16 p2p_channel_to_freq_j4(A_UINT8 reg_class, A_UINT8 channel) -{ - /* Table J-4 in P802.11REVmb/D4.0 - Global operating classes */ - /* TODO: more regulatory classes */ - switch (reg_class) { - case 81: - /* channels 1..13 */ - if (channel < 1 || channel > 13) - return -1; - return 2407 + 5 * channel; - case 82: - /* channel 14 */ - if (channel != 14) - return -1; - return 2414 + 5 * channel; - case 83: /* channels 1..9; 40 MHz */ - case 84: /* channels 5..13; 40 MHz */ - if (channel < 1 || channel > 13) - return -1; - return 2407 + 5 * channel; - case 115: /* channels 36,40,44,48; indoor only */ - case 118: /* channels 52,56,60,64; dfs */ - if (channel < 36 || channel > 64) - return -1; - return 5000 + 5 * channel; - case 124: /* channels 149,153,157,161 */ - case 125: /* channels 149,153,157,161,165,169 */ - if (channel < 149 || channel > 161) - return -1; - return 5000 + 5 * channel; - case 116: /* channels 36,44; 40 MHz; indoor only */ - case 117: /* channels 40,48; 40 MHz; indoor only */ - case 119: /* channels 52,60; 40 MHz; dfs */ - case 120: /* channels 56,64; 40 MHz; dfs */ - if (channel < 36 || channel > 64) - return -1; - return 5000 + 5 * channel; - case 126: /* channels 149,157; 40 MHz */ - case 127: /* channels 153,161; 40 MHz */ - if (channel < 149 || channel > 161) - return -1; - return 5000 + 5 * channel; - } - return -1; -} - - -/** - * p2p_channel_to_freq - Convert channel info to frequency - * @country: Country code - * @reg_class: Regulatory class - * @channel: Channel number - * Returns: Frequency in MHz or -1 if the specified channel is unknown - */ -static A_INT16 p2p_channel_to_freq(const A_CHAR *country, A_UINT8 reg_class, A_UINT8 channel) -{ - if (country[2] == 0x04) { - return p2p_channel_to_freq_j4(reg_class, channel); - } - - /* These are mainly for backwards compatibility; to be removed */ - switch (reg_class) { - case 1: /* US/1, EU/1, JP/1 = 5 GHz, channels 36,40,44,48 */ - if (channel < 36 || channel > 48) - return -1; - return 5000 + 5 * channel; - case 3: /* US/3 = 5 GHz, channels 149,153,157,161 */ - case 5: /* US/5 = 5 GHz, channels 149,153,157,161 */ - if (channel < 149 || channel > 161) - return -1; - return 5000 + 5 * channel; - case 4: /* EU/4 = 2.407 GHz, channels 1..13 */ - case 12: /* US/12 = 2.407 GHz, channels 1..11 */ - case 30: /* JP/30 = 2.407 GHz, channels 1..13 */ - if (channel < 1 || channel > 13) - return -1; - return 2407 + 5 * channel; - case 31: /* JP/31 = 2.414 GHz, channel 14 */ - if (channel != 14) - return -1; - return 2414 + 5 * channel; - } - - return -1; -} - -static void p2p_add_device_info_from_scan_data(struct p2p_dev_ctx *p2p_dev_ctx, struct host_p2p_dev *p2p_peer, A_UINT8 *addr, A_UINT16 channel, const A_UINT8 *p2p_dev_addr, struct p2p_ie *msg, const A_UINT8 *data, A_UINT32 len) -{ - if (A_MEMCMP(addr, p2p_dev_addr, ETH_ALEN) != 0) { - A_MEMCPY(p2p_peer->dev.interface_addr, addr, ETH_ALEN); - } - - if (msg->ssid && - (msg->ssid[1] != P2P_WILDCARD_SSID_LEN || - A_MEMCMP(msg->ssid + 2, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN) - != 0)) { - A_MEMCPY(p2p_peer->dev.oper_ssid, msg->ssid + 2, msg->ssid[1]); - p2p_peer->dev.oper_ssid_len = msg->ssid[1]; - - A_MEMCPY(p2p_peer->dev.interface_addr, addr, ETH_ALEN); - } - - p2p_peer->dev.listen_freq = channel; - - if (msg->group_info) { - p2p_peer->dev.oper_freq = channel; - } - - if (msg->pri_dev_type) { - A_MEMCPY(p2p_peer->dev.pri_dev_type, msg->pri_dev_type, - sizeof(p2p_peer->dev.pri_dev_type)); - } - - A_MEMCPY(p2p_peer->dev.device_name, msg->device_name, sizeof(p2p_peer->dev.device_name)); - - p2p_peer->dev.config_methods = msg->config_methods ? msg->config_methods : - msg->wps_config_methods; - - if (msg->capability) { - p2p_peer->dev.dev_capab = msg->capability[0]; - p2p_peer->dev.group_capab = msg->capability[1]; - } - - if (msg->ext_listen_timing) { - p2p_peer->dev.ext_listen_period = WPA_GET_LE16(msg->ext_listen_timing); - p2p_peer->dev.ext_listen_interval = - WPA_GET_LE16(msg->ext_listen_timing + 2); - } - - /* TODO: Add group clients if this is a beacon containing grp info attribute - * in the P2P IE. - */ - - /* If the device reported by other then probe req only then DONOT report again. - * But if this dev is reported ONLY by probe req, report again with mode info. - */ - if ((p2p_peer->dev.flags & P2P_DEV_REPORTED) && ((p2p_peer->dev.flags & P2P_DEV_PROBE_REQ_ONLY) == 0)) - return; - - if (p2p_peer->dev.flags & P2P_DEV_USER_REJECTED) { - return; - } - - /* report device to driver & App */ - A_WMI_P2PDEV_EVENT(p2p_dev_ctx->dev, addr, p2p_dev_addr, msg->pri_dev_type, - msg->device_name, msg->dev_name_len, - msg->config_methods, - msg->capability[0], msg->capability[1]); - - p2p_peer->dev.flags |= P2P_DEV_REPORTED; - - p2p_peer->dev.flags &= - ~(P2P_DEV_PROBE_REQ_ONLY | P2P_DEV_GROUP_CLIENT_ONLY); - return; -} - -static void p2p_add_device_info_from_action_frame(struct p2p_dev_ctx - *p2p_dev_ctx, struct host_p2p_dev *p2p_peer, - A_UINT8 *addr, struct p2p_ie *msg) -{ - A_INT16 freq; - - if (msg->pri_dev_type) { - A_MEMCPY(p2p_peer->dev.pri_dev_type, msg->pri_dev_type, - sizeof(p2p_peer->dev.pri_dev_type)); - } - - A_MEMCPY(p2p_peer->dev.device_name, msg->device_name, sizeof(p2p_peer->dev.device_name)); - - p2p_peer->dev.config_methods = msg->config_methods ? msg->config_methods : - msg->wps_config_methods; - - if (msg->capability) { - p2p_peer->dev.dev_capab = msg->capability[0]; - p2p_peer->dev.group_capab = msg->capability[1]; - } - - if (msg->listen_channel) { - freq = p2p_channel_to_freq((const A_CHAR *)msg->listen_channel, - msg->listen_channel[3], msg->listen_channel[4]); - if (freq > 0) { - p2p_peer->dev.listen_freq = freq; - } - } - - if (msg->ext_listen_timing) { - p2p_peer->dev.ext_listen_period = WPA_GET_LE16(msg->ext_listen_timing); - p2p_peer->dev.ext_listen_interval = - WPA_GET_LE16(msg->ext_listen_timing + 2); - } - - if (p2p_peer->dev.flags & P2P_DEV_PROBE_REQ_ONLY) { - p2p_peer->dev.flags &= ~P2P_DEV_PROBE_REQ_ONLY; - } - - p2p_peer->dev.flags &= ~P2P_DEV_GROUP_CLIENT_ONLY; - - - /* report device to driver & App */ - A_WMI_P2PDEV_EVENT(p2p_dev_ctx->dev, addr, p2p_peer->dev.p2p_device_addr, - msg->pri_dev_type, - msg->device_name, msg->dev_name_len, - msg->config_methods, - (msg->capability) ? msg->capability[0]:0, (msg->capability)?msg->capability[1]:0); - - p2p_peer->dev.flags |= P2P_DEV_REPORTED; - - return; -} - -struct host_p2p_dev *p2p_get_device(void *ctx, const A_UINT8 *addr) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - struct host_p2p_dev *dev; - PDL_LIST pListItem; - - ITERATE_OVER_LIST(&p2p_dev_ctx->devices, pListItem) { - dev = A_CONTAINING_STRUCT(pListItem, struct host_p2p_dev, list); - if (A_MEMCMP((dev->dev).p2p_device_addr, addr, ETH_ALEN) == 0) { - return dev; - } - } - - return NULL; -} - -struct host_p2p_dev *p2p_get_next_device(void *ctx, const A_UINT8 *addr, int first_element) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - struct host_p2p_dev *dev; - PDL_LIST pListItem; - - if (first_element) { - /* - * If the request is for the FIRST element, there is no - * address of the item before the desired item to return, - * so we just return the first element in the list. - */ - if (DL_LIST_IS_EMPTY(&p2p_dev_ctx->devices)) { - return NULL; - } - pListItem = DL_LIST_GET_ITEM_AT_HEAD(&p2p_dev_ctx->devices); - return A_CONTAINING_STRUCT(pListItem, struct host_p2p_dev, list); - } - ITERATE_OVER_LIST(&p2p_dev_ctx->devices, pListItem) { - /* - * Iterate over the list. If we find the item with the - * matching address, return the NEXT element in the list. - * The DL_LIST is a doubly-linked list with &p2p_dev_ctx->devices - * at both the head and tail of the list. This struct is - * not a list element itself, but is used to mark where the list - * begins and ends. Therefore, if the NEXT item in the list - * is &p2p_dev_ctx->devices, we've reached the end, and we should - * continue (which will break out of the ITERATE_OVER_LIST loop - * and then return NULL - */ - dev = A_CONTAINING_STRUCT(pListItem, struct host_p2p_dev, list); - if (A_MEMCMP((dev->dev).p2p_device_addr, addr, ETH_ALEN) == 0) { - if (pListItem->pNext == &p2p_dev_ctx->devices) { - continue; - } - return A_CONTAINING_STRUCT(pListItem->pNext, struct host_p2p_dev, list); - } - } - return NULL; -} - -struct host_p2p_dev *p2p_get_device_intf_addrs(void *ctx, const A_UINT8 *intfaddr) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - struct host_p2p_dev *dev; - PDL_LIST pListItem; - - ITERATE_OVER_LIST(&p2p_dev_ctx->devices, pListItem) { - dev = A_CONTAINING_STRUCT(pListItem, struct host_p2p_dev, list); - if (A_MEMCMP((dev->dev).interface_addr, intfaddr, ETH_ALEN) == 0) { - return dev; - } - } - - return NULL; -} - -static struct host_p2p_dev *p2p_create_device(struct p2p_dev_ctx *p2p_dev_ctx, - const A_UINT8 *addr) -{ - struct host_p2p_dev *p2p_dev = NULL; - - /* check if the device is already in the list. If so return the dev, - */ - p2p_dev = p2p_get_device(p2p_dev_ctx, addr); - - if (p2p_dev) { - return p2p_dev; - } - - p2p_dev = A_MALLOC_NOWAIT(sizeof(struct host_p2p_dev)); - if (!p2p_dev) { - return NULL; - } - A_MEMZERO(p2p_dev, sizeof(struct host_p2p_dev)); - DL_LIST_INIT(&p2p_dev->list); - p2p_dev->p2p = p2p_dev_ctx; - - /* Add to the device list */ - DL_ListAdd(&p2p_dev_ctx->devices,&p2p_dev->list); - A_MEMCPY((p2p_dev->dev).p2p_device_addr, addr, ETH_ALEN); - p2p_dev->p2p_buf = NULL; - p2p_dev->p2p_buf_len = 0; - - A_PRINTF("+: %x:%x\n", addr[4], addr[5]); - - return p2p_dev; -} - -/* API Routines */ - -void *p2p_init(void *dev) -{ - struct p2p_dev_ctx *p2p_dev_ctx = NULL; - - /* Allocate the global P2P context if not yet allocated */ - if (!g_p2p_ctx) { - g_p2p_ctx = (struct p2p_ctx *) A_MALLOC_NOWAIT(sizeof(struct p2p_ctx)); - if (!g_p2p_ctx) { - return NULL; - } - A_MEMZERO(g_p2p_ctx, sizeof(struct p2p_ctx)); - - /* Initialize dev common state. - */ - g_p2p_ctx->go_intent = -1; - } - - /* Allocate the device specific P2P context. - */ - p2p_dev_ctx = (struct p2p_dev_ctx *) - A_MALLOC_NOWAIT(sizeof(struct p2p_dev_ctx)); - if (!p2p_dev_ctx) { - return NULL; - } - A_MEMZERO(p2p_dev_ctx, sizeof(struct p2p_dev_ctx)); - p2p_dev_ctx->p2p_ctx = g_p2p_ctx; - - /* Store a ref to the dev in the device context - */ - p2p_dev_ctx->dev = dev; - DL_LIST_INIT(&p2p_dev_ctx->devices); - - return (void *)p2p_dev_ctx; -} - -void *p2p_bssinfo_rx(void *ctx, WMI_BI_FTYPE fType, A_UINT8 *addr, A_UINT16 channel, const A_UINT8 *data, A_UINT32 len) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - struct p2p_ie msg; - struct host_p2p_dev *peer_dev = NULL; - A_STATUS status = A_OK; - const A_UINT8 *p2p_dev_addr=NULL; - A_UINT8 myaddr[ETH_ALEN]; - - A_MEMZERO(&msg, sizeof(struct p2p_ie)); - - A_WMI_GET_DEVICE_ADDR(p2p_dev_ctx->dev, myaddr); - - status = p2p_parse(fType, data, len, &msg); - if (status != A_OK) { - /* No P2P IE or Bad P2P/WPS IE */ - return NULL; - } else { - if (fType == BEACON_FTYPE || fType == PROBERESP_FTYPE) { - /* If the bssinfo msg is of Beacon|Probe-resp type check if - * the device address or device id is present in the msg. if - * not ignore scan data without p2p device info or device id. - */ - if (msg.p2p_device_addr) { - p2p_dev_addr = msg.p2p_device_addr; - } else if (msg.device_id) { - p2p_dev_addr = msg.device_id; - } else { - /* No p2p device id or device address. Ignore this dev */ - return NULL; - } - - if (!is_zero_mac_addr(p2p_dev_ctx->peer_filter) && - A_MEMCMP(p2p_dev_addr, p2p_dev_ctx->peer_filter, - ETH_ALEN) != 0) { - /* dev does not match the set peer filter. Ignore this dev */ - return NULL; - } - - peer_dev = p2p_create_device(p2p_dev_ctx, p2p_dev_addr); - - if (!peer_dev) { - return NULL; - } - - /* Update device info frm scan data */ - p2p_add_device_info_from_scan_data(p2p_dev_ctx, peer_dev, addr, - channel, p2p_dev_addr, &msg, data, len); - - p2p_get_ie(fType, data, len, P2P_OUI, &peer_dev->p2p_buf, &peer_dev->p2p_buf_len); - - /* Mark the device for SD if any. - */ - if (p2p_pending_sd_req(p2p_dev_ctx, peer_dev)) { - peer_dev->dev.flags |= P2P_DEV_SD_SCHEDULE; - } - - /* Add device nodes for each client info descriptor in the Group Info element, - * if the Group Info element is present in the probe-resp frame. - */ - if (msg.group_info && msg.group_info_len) { - struct p2p_group_info info; - - /* Group Info element present. - */ - if (p2p_group_info_parse(msg.group_info, msg.group_info_len, &info) == A_OK) { - PDL_LIST pListItem; - struct host_p2p_dev *dev; - A_UINT8 num; - - /* Clear old data for this group. - */ - ITERATE_OVER_LIST(&p2p_dev_ctx->devices, pListItem) { - dev = A_CONTAINING_STRUCT(pListItem, struct host_p2p_dev, list); - if (A_MEMCMP((dev->dev).member_in_go_iface, addr, ETH_ALEN) == 0) { - A_MEMZERO((dev->dev).member_in_go_iface, ETH_ALEN); - A_MEMZERO((dev->dev).member_in_go_dev, ETH_ALEN); - } - } - - /* Update device list based on latest client info desc from this - * group. - */ - - for (num=0; num < info.num_clients; num++) { - struct p2p_client_info *cli = &info.client[num]; - - /* If this client info desc. is our own, discard it. - */ - if (A_MEMCMP(cli->p2p_device_addr, myaddr, ETH_ALEN) - == 0) { - continue; - } - - dev = p2p_get_device(p2p_dev_ctx, cli->p2p_device_addr); - if (dev) { - bss_t *bss=NULL; - /* Update device details if what is present is not got directly from the - * client. - */ - if ((dev->dev).flags & (P2P_DEV_GROUP_CLIENT_ONLY | P2P_DEV_PROBE_REQ_ONLY)) { - p2p_copy_client_info(dev, cli); - } - - if ((dev->dev).flags & P2P_DEV_PROBE_REQ_ONLY) { - (dev->dev).flags &= ~P2P_DEV_PROBE_REQ_ONLY; - } - - - /* Update the WLAN Node timestamp for this dev. - */ - bss = wmi_find_node(A_WMI_GET_WMI_CTX(p2p_dev_ctx->dev), cli->p2p_device_addr); - if (bss) { - wmi_node_update_timestamp(A_WMI_GET_WMI_CTX(p2p_dev_ctx->dev), bss); - wmi_node_return(A_WMI_GET_WMI_CTX(p2p_dev_ctx->dev), bss); - } - } else { - bss_t *bss=NULL; - /* Add new device to the list. Also setup a Node entry in the WLAN node - * (Scan table). - */ - dev = p2p_create_device(p2p_dev_ctx, cli->p2p_device_addr); - if (dev == NULL) { - continue; - } - - (dev->dev).flags |= P2P_DEV_GROUP_CLIENT_ONLY; - p2p_copy_client_info(dev, cli); - (dev->dev).oper_freq = channel; - - /* Mark the device for SD if any. - */ - if (p2p_pending_sd_req(p2p_dev_ctx, peer_dev)) { - peer_dev->dev.flags |= P2P_DEV_SD_SCHEDULE; - } - - /* Setup a WLAN node entry */ - bss = wmi_node_alloc(A_WMI_GET_WMI_CTX(p2p_dev_ctx->dev), 0); - - if (bss == NULL) { - p2p_device_free(dev); - continue; - } - - wmi_setup_node(A_WMI_GET_WMI_CTX(p2p_dev_ctx->dev), bss, cli->p2p_device_addr); - - /* Initialize bss state. - */ - bss->p2p_dev = dev; - /* Bump up the p2p dev ref. count. - */ - p2p_increment_dev_ref_count(dev); - bss->ni_frametype = fType; - - /* report device to driver & App */ - A_WMI_P2PDEV_EVENT(p2p_dev_ctx->dev, addr, cli->p2p_device_addr, cli->pri_dev_type, - cli->dev_name, cli->dev_name_len, - cli->config_methods, - cli->dev_capab, 0); - - dev->dev.flags |= P2P_DEV_REPORTED; - } - - A_MEMCPY((dev->dev).interface_addr, cli->p2p_interface_addr, ETH_ALEN); - A_MEMCPY((dev->dev).member_in_go_dev, p2p_dev_addr, ETH_ALEN); - A_MEMCPY((dev->dev).member_in_go_iface, addr, ETH_ALEN); - } - } - } - } /* BEACON_FTYPE || PROBERESP_FTYPE */ - else if (fType == ACTION_MGMT_FTYPE) { - peer_dev = p2p_create_device(p2p_dev_ctx, addr); - - if (!peer_dev) { - return NULL; - } - - /* Update device info from ACTION frame (GO Neg. Req. or Invitation - * or Provisional Disc Req. frames). - */ - p2p_add_device_info_from_action_frame(p2p_dev_ctx, peer_dev, addr, - &msg); - p2p_get_ie(fType, data, len, P2P_OUI, &peer_dev->p2p_buf, &peer_dev->p2p_buf_len); - - /* Mark the device for SD if any. - */ - if (p2p_pending_sd_req(p2p_dev_ctx, peer_dev)) { - peer_dev->dev.flags |= P2P_DEV_SD_SCHEDULE; - } - - } /* ACTION_MGMT_FTYPE */ - else if (fType == PROBEREQ_FTYPE) { - - /* Add this peer to device list only if it is a probe req with wildcard SSID. Probe - * req frames with non-wildcard SSID shall come from p2p groups & hence not used to - * populate our device list. - */ - if (msg.ssid == NULL || msg.ssid[1] != P2P_WILDCARD_SSID_LEN || - A_MEMCMP(msg.ssid + 2, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN) - != 0) { - return NULL; - } - - peer_dev = p2p_create_device(p2p_dev_ctx, addr); - - if (!peer_dev) { - return NULL; - } - - if (msg.capability) { - peer_dev->dev.dev_capab = msg.capability[0]; - peer_dev->dev.group_capab = msg.capability[1]; - } - - if (msg.listen_channel) { - A_MEMCPY(peer_dev->dev.country, msg.listen_channel, 3); - peer_dev->dev.listen_freq = p2p_channel_to_freq(peer_dev->dev.country, - msg.listen_channel[3], - msg.listen_channel[4]); - } - - A_MEMCPY(peer_dev->dev.device_name, msg.wps_device_name, sizeof(peer_dev->dev.device_name)); - - if (msg.pri_dev_type) { - A_MEMCPY(peer_dev->dev.pri_dev_type, msg.pri_dev_type, - sizeof(peer_dev->dev.pri_dev_type)); - } - else if(msg.wps_pri_dev_type) { - A_MEMCPY(peer_dev->dev.pri_dev_type, msg.wps_pri_dev_type, - sizeof(peer_dev->dev.pri_dev_type)); - } - - /* Mark the device for SD if any. - */ - if (p2p_pending_sd_req(p2p_dev_ctx, peer_dev)) { - peer_dev->dev.flags |= P2P_DEV_SD_SCHEDULE; - } - - if (peer_dev->dev.flags & P2P_DEV_REPORTED || - peer_dev->dev.flags & P2P_DEV_USER_REJECTED) { - return (void *)peer_dev; - } - peer_dev->dev.flags |= P2P_DEV_PROBE_REQ_ONLY; - - /* report device to driver & App */ - A_WMI_P2PDEV_EVENT(p2p_dev_ctx->dev, addr, peer_dev->dev.p2p_device_addr, - peer_dev->dev.pri_dev_type, - msg.wps_device_name, msg.wps_dev_name_len, - msg.wps_config_methods, - (msg.capability) ? msg.capability[0]:0, (msg.capability)?msg.capability[1]:0); - - peer_dev->dev.flags |= P2P_DEV_REPORTED; - - } /* PROBEREQ_FTYPE */ - } - - return (void *)peer_dev; -} - -void p2p_go_neg_req_rx(void *ctx, const A_UINT8 *datap, A_UINT8 len) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - struct p2p_ctx *p2p_cmn_ctx = (struct p2p_ctx *)p2p_dev_ctx->p2p_ctx; - WMI_P2P_GO_NEG_REQ_EVENT *ev = (WMI_P2P_GO_NEG_REQ_EVENT *)datap; - struct host_p2p_dev *peer = NULL; - enum p2p_status_code result = P2P_SC_SUCCESS; - - /* Get hold of the peer device from the device list. - */ - peer = p2p_get_device(p2p_dev_ctx, ev->sa); - - A_ASSERT(peer != NULL); - - if (peer->dev.flags & P2P_DEV_USER_REJECTED) { - result = P2P_SC_FAIL_REJECTED_BY_USER; - goto send_rsp; - } - - if (peer->dev.wps_method == WPS_NOT_READY) { - struct p2p_ie p2p_ie; - - A_MEMZERO(&p2p_ie, sizeof(struct p2p_ie)); - result = P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE; - peer->dev.flags |= P2P_DEV_PEER_WAITING_RESPONSE; - - /* Parse the dev passwd id from the WPS iE in the GO Neg. req. - */ - p2p_parse_wps_ie(ev->wps_buf, ev->wps_buflen, &p2p_ie); - - A_WMI_P2PGONEG_REQ_EVENT(p2p_dev_ctx->dev, ev->sa, p2p_ie.dev_password_id); - goto send_rsp; - } - /*Parse P2P IE */ - { - struct p2p_ie p2p_ie; - A_MEMZERO(&p2p_ie, sizeof(struct p2p_ie)); - p2p_parse_p2p_ie(ev->p2p_buf, ev->p2p_buflen, &p2p_ie); - if(p2p_ie.capability[1] & P2P_GROUP_CAPAB_PERSISTENT_GROUP) - peer->persistent_grp = 1; - } - - /* The P2P/WPS IEs from the req buffer are copied to the resp. buffer. - */ - - /* Send WMI_P2P_GO_NEG_REQ_RSP_CMD with the user result - * , WPS method to use, go_intent to use. - */ -send_rsp: - wmi_p2p_go_neg_rsp_cmd(A_WMI_GET_WMI_CTX(p2p_dev_ctx->dev), result, - p2p_cmn_ctx->go_intent, peer->dev.wps_method, peer->dev.listen_freq, - ev->wps_buf, ev->wps_buflen, ev->p2p_buf, ev->p2p_buflen, - ev->dialog_token, peer->persistent_grp); - - return; -} - -void p2p_invite_req_rx(void *ctx, const A_UINT8 *datap, A_UINT8 len) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - WMI_P2P_INVITE_REQ_EVENT *inv_req_ev = (WMI_P2P_INVITE_REQ_EVENT *)datap; - struct host_p2p_dev *dev = NULL; - enum p2p_status_code status = P2P_SC_SUCCESS; - A_INT8 is_go=0; - A_UINT8 grp_bssid[ETH_ALEN]; - - /* Get hold of the peer device from the device list. - */ - dev = p2p_get_device(p2p_dev_ctx, inv_req_ev->sa); - - /* Device is not there in the list. Send a failure response for the - * Invitation. - */ - if (dev == NULL) { - status = P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE; - } else { - /* if the peer device is present in our dev list, check if the user has - * authorized to accept an invitation from this peer to join an active - * group. - */ - if (!inv_req_ev->is_persistent) { - if (is_zero_mac_addr(p2p_dev_ctx->p2p_auth_invite) || - (A_MEMCMP(inv_req_ev->sa, - p2p_dev_ctx->p2p_auth_invite, ETH_ALEN) && - (!is_zero_mac_addr(inv_req_ev->go_dev_addr) && - A_MEMCMP(inv_req_ev->go_dev_addr, - p2p_dev_ctx->p2p_auth_invite, ETH_ALEN) - ))) - { - /* Do not accept Invitation automatically. TODO: We can - * notify the user here & request approval. - */ - status = P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE; - } - } else { - /*Persistent Group */ - if(A_MEMCMP(dev->ssid, inv_req_ev->ssid.ssid, dev->ssid_len) == 0) { - if(dev->role_go) { - A_MEMCPY(grp_bssid, inv_req_ev->go_dev_addr, ETH_ALEN); - is_go = 1; - } - } - } - } /* dev != NULL */ - - /* The P2P/WPS IEs from the req buffer are copied to the resp. buffer. - */ - wmi_p2p_invite_req_rsp_cmd(A_WMI_GET_WMI_CTX(p2p_dev_ctx->dev), status, - is_go, grp_bssid, inv_req_ev->p2p_buf, - inv_req_ev->p2p_buflen, inv_req_ev->dialog_token); - - return; -} - -void p2p_prov_disc_req_rx(void *ctx, const A_UINT8 *datap, A_UINT8 len) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - WMI_P2P_PROV_DISC_REQ_EVENT *prov_disc_req_ev = - (WMI_P2P_PROV_DISC_REQ_EVENT *)datap; - struct host_p2p_dev *peer = NULL; - - /* Get hold of the peer device from the device list. The peer dev should - * be present in our dev list.(atleast added to the list from the bss_info - * ev that the firmware would have sent prior to this event). - */ - peer = p2p_get_device(p2p_dev_ctx, prov_disc_req_ev->sa); - - /* Set up the WPS method in use by the peer in the device context. - */ - if (peer) { - peer->dev.flags &= ~(P2P_DEV_PD_PEER_DISPLAY | P2P_DEV_PD_PEER_KEYPAD); - } - if (prov_disc_req_ev->wps_config_method & WPS_CONFIG_DISPLAY) { - if (peer) { - peer->dev.flags |= P2P_DEV_PD_PEER_KEYPAD; - } - } else if (prov_disc_req_ev->wps_config_method & WPS_CONFIG_KEYPAD) { - if (peer) { - peer->dev.flags |= P2P_DEV_PD_PEER_DISPLAY; - } - } - - /* Report PD request event to the Supplicant so that the user App can - * be prompted for any necessary inputs. - */ - -printk(KERN_ALERT "wps_cfg_method: %d, dev_cfg_method: %d, \ - dev_capab: %d, grp_capab: %d\n", prov_disc_req_ev->wps_config_method, - prov_disc_req_ev->dev_config_methods, prov_disc_req_ev->device_capab, - prov_disc_req_ev->group_capab); - - A_WMI_P2P_PROV_DISC_REQ_EVENT(p2p_dev_ctx->dev, prov_disc_req_ev->sa, - prov_disc_req_ev->wps_config_method, prov_disc_req_ev->dev_addr, - prov_disc_req_ev->pri_dev_type, prov_disc_req_ev->device_name, - prov_disc_req_ev->dev_name_len, - prov_disc_req_ev->dev_config_methods, prov_disc_req_ev->device_capab, - prov_disc_req_ev->group_capab); - - return; -} - -void p2p_prov_disc_resp_rx(void *ctx, const A_UINT8 *datap, A_UINT8 len) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - WMI_P2P_PROV_DISC_RESP_EVENT *prov_disc_resp_ev = - (WMI_P2P_PROV_DISC_RESP_EVENT *)datap; - struct host_p2p_dev *peer = NULL; - - /* Get hold of the peer device from the device list. The peer dev should - * be present in our dev list.(atleast added to the list from the bss_info - * ev that the firmware would have sent prior to this event). - */ - peer = p2p_get_device(p2p_dev_ctx, prov_disc_resp_ev->peer); - - /* Set up the WPS method in use by the peer in the device context. - */ - if (peer) { - peer->dev.flags &= ~(P2P_DEV_PD_PEER_DISPLAY | P2P_DEV_PD_PEER_KEYPAD); - } - if (prov_disc_resp_ev->config_methods & WPS_CONFIG_DISPLAY) { - if (peer) { - peer->dev.flags |= P2P_DEV_PD_PEER_KEYPAD; - } - } else if (prov_disc_resp_ev->config_methods & WPS_CONFIG_KEYPAD) { - if (peer) { - peer->dev.flags |= P2P_DEV_PD_PEER_DISPLAY; - } - } - - peer->dev.req_config_methods = 0; - - /* Report PD response event to the Supplicant so that the user App can - * be prompted for any necessary inputs. - */ - A_WMI_P2P_PROV_DISC_RESP_EVENT(p2p_dev_ctx->dev, prov_disc_resp_ev->peer, - prov_disc_resp_ev->config_methods); - - return; -} - -A_STATUS p2p_auth_invite(void *ctx, A_UINT8 *auth_peer) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - A_STATUS status = A_OK; - - /* Mark the peer as authorized by the user for Invitation. - */ - A_MEMCPY(p2p_dev_ctx->p2p_auth_invite, auth_peer, ETH_ALEN); - - return status; -} - -A_STATUS p2p_auth_go_neg(void *ctx, WMI_P2P_GO_NEG_START_CMD *auth_go_neg_param) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - struct p2p_ctx *p2p_cmn_ctx = (struct p2p_ctx *)p2p_dev_ctx->p2p_ctx; - struct host_p2p_dev *peer = NULL; - A_STATUS status = A_OK; - - /* Get hold of the peer device. - */ - peer = p2p_get_device(ctx, auth_go_neg_param->peer_addr); - if (peer == NULL) { - /* Unknown peer device. - */ - status = A_ERROR; - } else { - /* Mark the peer as authorized by the user & ready for GO Negotiation. - */ - peer->dev.flags &= ~P2P_DEV_NOT_YET_READY; - peer->dev.flags &= ~P2P_DEV_USER_REJECTED; - - p2p_cmn_ctx->go_intent = auth_go_neg_param->go_intent; - peer->persistent_grp = auth_go_neg_param->persistent_grp; - peer->dev.wps_method = auth_go_neg_param->wps_method; - } - - return status; -} - -A_STATUS p2p_peer_reject(void *ctx, A_UINT8 *peer_addr) -{ - struct host_p2p_dev *peer = NULL; - A_STATUS status = A_OK; - - /* Get hold of the peer device. - */ - peer = p2p_get_device(ctx, peer_addr); - if (peer == NULL) { - /* Unknown peer device. - */ - status = A_ERROR; - } else { - peer->dev.flags |= P2P_DEV_USER_REJECTED; - } - - return status; -} - -A_STATUS p2p_go_neg_start(void *ctx, WMI_P2P_GO_NEG_START_CMD *go_neg_param) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - struct host_p2p_dev *peer = NULL; - struct host_p2p_dev *peer_go = NULL; - A_STATUS status = A_OK; - - /* Get hold of the peer device. - */ - peer = p2p_get_device(ctx, go_neg_param->peer_addr); - if (peer == NULL) { - /* Unknown peer device. - */ - return A_ERROR; - } - - /* Monotonically increasing per device dialog tokens - generated from host - * & wraps back to 0. Send in WMI param from host. - */ - peer->dev.dialog_token++; - if (peer->dev.dialog_token == 0) { - peer->dev.dialog_token = 1; - } - - /* Mark the peer as authorized by the user & ready for GO Negotiation. - */ - peer->dev.flags &= ~P2P_DEV_NOT_YET_READY; - peer->dev.flags &= ~P2P_DEV_USER_REJECTED; - - peer->dev.wps_method = go_neg_param->wps_method; - - if (peer->dev.listen_freq) { - go_neg_param->listen_freq = peer->dev.listen_freq; - } else if (peer->dev.oper_freq) { - go_neg_param->listen_freq = peer->dev.oper_freq; - } - - go_neg_param->dialog_token = peer->dev.dialog_token; - go_neg_param->dev_capab = peer->dev.dev_capab; - - - /* If this peer is a member of a group, then get info about the GO of that group. This is - * useful to send device discoverability request to its GO, in case this peer does not - * respond to our GO Negotiation request. - */ - if (!is_zero_mac_addr(peer->dev.member_in_go_dev)) { - A_MEMCPY(go_neg_param->member_in_go_dev, peer->dev.member_in_go_dev, ETH_ALEN); - - peer_go = p2p_get_device(ctx, peer->dev.member_in_go_dev); - - if (peer_go) { - - peer_go->dev.dialog_token++; - if (peer_go->dev.dialog_token == 0) { - peer_go->dev.dialog_token = 1; - } - go_neg_param->go_dev_dialog_token = peer_go->dev.dialog_token; - - go_neg_param->go_oper_freq = peer_go->dev.oper_freq; - - if (peer_go->dev.oper_ssid_len) { - A_MEMCPY(go_neg_param->peer_go_ssid.ssid, peer_go->dev.oper_ssid, - peer_go->dev.oper_ssid_len); - go_neg_param->peer_go_ssid.ssidLength = peer_go->dev.oper_ssid_len; - } - } - } - - status = wmi_p2p_go_neg_start(A_WMI_GET_WMI_CTX(p2p_dev_ctx->dev), - go_neg_param); - - return status; -} - -A_STATUS p2p_invite_cmd(void *ctx, WMI_P2P_INVITE_CMD *invite_param) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - struct host_p2p_dev *peer = NULL; - A_STATUS status = A_OK; - - /* Get hold of the peer device. - */ - peer = p2p_get_device(ctx, invite_param->peer_addr); - if (peer == NULL) { - /* Unknown peer device. - */ - return A_ERROR; - } - - /* Monotonically increasing per device dialog tokens - generated from host - * & wraps back to 0. Send in WMI param from host. - */ - peer->dev.dialog_token++; - if (peer->dev.dialog_token == 0) { - peer->dev.dialog_token = 1; - } - - invite_param->dialog_token = peer->dev.dialog_token; - - status = wmi_p2p_invite_cmd(A_WMI_GET_WMI_CTX(p2p_dev_ctx->dev), - invite_param); - - return status; -} - -A_STATUS p2p_prov_disc_req(void *ctx, A_UINT8 *peer_addr, A_UINT16 wps_method) -{ - - struct host_p2p_dev *peer = NULL; - - /* Get hold of the peer device. - */ - peer = p2p_get_device(ctx, peer_addr); - if (peer == NULL) { - /* Unknown peer device. - */ - peer = p2p_get_device_intf_addrs(ctx, peer_addr); - } - - if (peer == NULL || (peer->dev.flags & P2P_DEV_PROBE_REQ_ONLY)) { - return A_ERROR; - } - - peer->dev.req_config_methods = wps_method; - - /* Return from here. PD will happen in the context of p2p_find(). - */ - return A_OK; -} - - -void p2p_send_prov_disc_req(struct host_p2p_dev *peer) -{ - struct p2p_dev_ctx *p2p_dev_ctx = peer->p2p; - WMI_P2P_PROV_DISC_REQ_CMD prov_disc_req; - - - /* Set up the PD Request cmd params. - */ - A_MEMZERO(&prov_disc_req, sizeof(WMI_P2P_PROV_DISC_REQ_CMD)); - - A_MEMCPY(prov_disc_req.peer, peer->dev.p2p_device_addr, ATH_MAC_LEN); - prov_disc_req.wps_method = peer->dev.req_config_methods; - - /* Monotonically increasing per device dialog tokens - generated from host - * & wraps back to 0. Send in WMI param from host. - */ - peer->dev.dialog_token++; - if (peer->dev.dialog_token == 0) { - peer->dev.dialog_token = 1; - } - prov_disc_req.dialog_token = peer->dev.dialog_token; - - if (peer->dev.listen_freq) { - prov_disc_req.listen_freq = peer->dev.listen_freq; - } else if (peer->dev.oper_freq) { - prov_disc_req.listen_freq = peer->dev.oper_freq; - } - - if (peer->dev.oper_ssid_len) { - A_MEMCPY(prov_disc_req.go_oper_ssid.ssid, peer->dev.oper_ssid, peer->dev.oper_ssid_len); - prov_disc_req.go_oper_ssid.ssidLength = peer->dev.oper_ssid_len; - - if (!is_zero_mac_addr(peer->dev.interface_addr)) { - A_MEMCPY(prov_disc_req.go_dev_addr, peer->dev.interface_addr, - ATH_MAC_LEN); - } else { - A_MEMCPY(prov_disc_req.go_dev_addr, prov_disc_req.peer, - ATH_MAC_LEN); - } - } - - wmi_p2p_prov_disc_cmd(A_WMI_GET_WMI_CTX(p2p_dev_ctx->dev), &prov_disc_req); - - return; -} - -void p2p_free_all_devices(void *ctx) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - - /* - * In order to free all of the devices from the dl_list, we CANNOT - * simply call p2p_device_free on all of the peers. This is because - * there might be references to these devices from the scan table, and - * just freeing the devices would potentially cause a segfault. - * Therefore, we use wmi_free_allnodes to eliminate all references from - * the scan table as well as to free the devices from the dl_list. - */ - wmi_free_allnodes(A_WMI_GET_WMI_CTX(p2p_dev_ctx->dev)); -} - -void p2p_device_free(void *peer_dev) -{ - struct host_p2p_dev *peer = (struct host_p2p_dev *)peer_dev; - - /* decrement the ref count & free up the node if the ref. cnt becomes - * zero. - */ - if (--peer->ref_cnt == 0) { - DL_ListRemove(&peer->list); - A_PRINTF("-: %x:%x\n", (peer->dev).p2p_device_addr[4], - (peer->dev).p2p_device_addr[5]); - A_FREE(peer); - } - - A_PRINTF("-%d\n", peer->ref_cnt); - return; -} - -A_STATUS p2p_peer(void *ctx, A_UINT8 *peer_addr, A_UINT8 next) -{ - struct host_p2p_dev *peer = NULL; - A_STATUS status; - - /* Get hold of the peer device. - */ - peer = p2p_get_device(ctx, peer_addr); - if (peer) { - A_PRINTF("peer Found\n"); - status = A_OK; - } else { - A_PRINTF("peer NOTFound\n"); - status = A_DEVICE_NOT_FOUND; - } - - return status; -} - - -A_STATUS p2p_get_device_p2p_buf(void *ctx, A_UINT8 *peer_addr, A_UINT8 **ni_buf, A_UINT8 *ni_buf_len) -{ - struct host_p2p_dev *peer = NULL; - A_STATUS status; - /* Get hold of the peer device */ - peer = p2p_get_device(ctx, peer_addr); - if (peer) { - *ni_buf = peer->p2p_buf; - *ni_buf_len = peer->p2p_buf_len; - status = A_OK; - } else { - status = A_DEVICE_NOT_FOUND; - } - - return status; - -} - -A_STATUS p2p_get_ifaddr (void *ctx, A_UINT8 *dev_addr) -{ - struct host_p2p_dev *peer = NULL; - A_STATUS status; - - /* Get hold of the peer device. - */ - peer = p2p_get_device(ctx, dev_addr); - if (peer) { - A_MEMCPY((dev_addr+6), peer->dev.interface_addr, ATH_MAC_LEN); - status = A_OK; - } else { - status = A_DEVICE_NOT_FOUND; - } - - return status; - -} - -A_STATUS p2p_get_devaddr (void *ctx, A_UINT8 *intf_addr) -{ - struct host_p2p_dev *peer = NULL; - A_STATUS status; - - /* Get hold of the peer device by interface address. - */ - peer = p2p_get_device_intf_addrs(ctx, intf_addr); - if (peer) { - A_MEMCPY((intf_addr+6), (peer->dev).p2p_device_addr, ATH_MAC_LEN); - status = A_OK; - } else { - status = A_DEVICE_NOT_FOUND; - } - - return status; - -} - -A_STATUS wmi_p2p_get_go_params(void *ctx, A_UINT8 *go_dev_addr, - A_UINT16 *oper_freq, A_UINT8 *ssid, A_UINT8 *ssid_len) -{ - struct host_p2p_dev *peer = NULL; - A_STATUS status; - - /* Get hold of the peer device. - */ - peer = p2p_get_device(ctx, go_dev_addr); - if (peer) { - A_PRINTF("peer Found\n"); - *oper_freq = peer->dev.oper_freq; - - if (peer->dev.oper_ssid) { - A_MEMCPY(ssid, peer->dev.oper_ssid, peer->dev.oper_ssid_len); - *ssid_len = peer->dev.oper_ssid_len; - } - status = A_OK; - } else { - A_PRINTF("peer NOTFound\n"); - status = A_DEVICE_NOT_FOUND; - } - - return status; -} - -void p2p_increment_dev_ref_count(struct host_p2p_dev *dev) -{ - /* Increment the ref count. The dev ages out in 2 mins time (configurable) - * Unlikely to have more than 255 references to the dev before it - * ages out. - */ - dev->ref_cnt++; - - A_PRINTF("+%d\n", dev->ref_cnt); - - return; -} - -static void p2p_free_sd_query(struct p2p_sd_query *q) -{ - if (q == NULL) { - return; - } - if (q->tlvs) { - A_FREE(q->tlvs); - } - A_FREE(q); -} - -static int p2p_unlink_sd_query(void *ctx, struct p2p_sd_query *query) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - struct p2p_sd_query *q, *prev; - - q = p2p_dev_ctx->sd_queries; - prev = NULL; - - while (q) { - if (q == query) { - if (prev) - prev->next = q->next; - else - p2p_dev_ctx->sd_queries = q->next; - if (p2p_dev_ctx->sd_queries == query) - p2p_dev_ctx->sd_queries = NULL; - return 1; - } - prev = q; - q = q->next; - } - return 0; -} - -void p2p_free_all_sd_queries(void *ctx) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - struct p2p_sd_query *q, *next; - - /* - * Walk through the list and free all of the p2p_sd_queries - */ - q = p2p_dev_ctx->sd_queries; - - while (q) { - next = q->next; - if (p2p_unlink_sd_query(p2p_dev_ctx, q)) { - p2p_free_sd_query(q); - } - q = next; - } - - /* - * Null out the sd_queries pointer in the p2p_dev_ctx. This - * item no longer exists! - */ - p2p_dev_ctx->sd_queries = NULL; - - /* - * Now null out the curr_sd_query pointer because if it exists, - * the sd_query has been freed already. - */ - p2p_dev_ctx->curr_sd_query = NULL; -} - -A_STATUS p2p_sd_request(void *ctx, A_UINT8 *peer_addr, A_UINT8 *tlv_buf, A_UINT8 tlv_buflen, A_UINT32 *qid) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - struct p2p_sd_query *q; - - q = A_MALLOC_NOWAIT(sizeof(struct p2p_sd_query)); - if (q == NULL) { - return A_ERROR; - } - - A_MEMZERO(q, sizeof(struct p2p_sd_query)); - - if (is_zero_mac_addr(peer_addr)) { - q->for_all_peers = 1; - } else { - A_MEMCPY(q->peer, peer_addr, ETH_ALEN); - } - - q->tlvs = A_MALLOC_NOWAIT(tlv_buflen); - if (q->tlvs == NULL) { - p2p_free_sd_query(q); - return A_ERROR; - } - A_MEMZERO(q->tlvs, tlv_buflen); - - A_MEMCPY(q->tlvs, tlv_buf, tlv_buflen); - q->tlv_len = tlv_buflen; - - q->next = p2p_dev_ctx->sd_queries; - p2p_dev_ctx->sd_queries = q; - - *qid = (A_UINT32)q; - - return A_OK; -} - -A_STATUS p2p_sdpd_tx_cmd(void *ctx, WMI_P2P_SDPD_TX_CMD *sdpd_tx_cmd, A_UINT32 *qid) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - A_STATUS status; - - *qid = 0; - if (sdpd_tx_cmd->type == WMI_P2P_SD_TYPE_GAS_INITIAL_REQ) { - status = p2p_sd_request(ctx, sdpd_tx_cmd->peer_addr, sdpd_tx_cmd->tlv, sdpd_tx_cmd->tlv_length, qid); - } else { - status = wmi_p2p_sdpd_tx_cmd(A_WMI_GET_WMI_CTX(p2p_dev_ctx->dev), sdpd_tx_cmd); - } - - return status; -} - -A_STATUS p2p_sd_cancel_request(void *ctx, A_UINT32 qid) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - - if (p2p_unlink_sd_query(p2p_dev_ctx, (void *)qid)) { - p2p_free_sd_query((void *)qid); - } - - return A_OK; -} - -void p2p_start_sdpd_event_rx(void *ctx) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - struct host_p2p_dev *dev; - PDL_LIST pListItem; - WMI_P2P_SDPD_TX_CMD p2p_sdpd_req; - struct p2p_sd_query *query; - - ITERATE_OVER_LIST(&p2p_dev_ctx->devices, pListItem) { - - dev = A_CONTAINING_STRUCT(pListItem, struct host_p2p_dev, list); - - /* DO Service Discovery */ - if (dev->dev.flags & P2P_DEV_SD_SCHEDULE) { - A_MEMZERO(&p2p_sdpd_req, sizeof(WMI_P2P_SDPD_TX_CMD)); - - query = p2p_pending_sd_req(p2p_dev_ctx, dev); - - p2p_dev_ctx->curr_sd_query = query; - - if (query == NULL) { - continue; - } else { - if (dev->dev.listen_freq) { - p2p_sdpd_req.freq = dev->dev.listen_freq; - } else if (dev->dev.oper_freq) { - p2p_sdpd_req.freq = dev->dev.oper_freq; - } - p2p_sdpd_req.type = WMI_P2P_SD_TYPE_GAS_INITIAL_REQ; - A_MEMCPY(p2p_sdpd_req.peer_addr, dev->dev.p2p_device_addr, ETH_ALEN); - A_MEMCPY(p2p_sdpd_req.tlv, query->tlvs, query->tlv_len); - p2p_sdpd_req.tlv_length = query->tlv_len; - p2p_sdpd_req.update_indic = p2p_dev_ctx->srv_update_indic; - - wmi_p2p_sdpd_tx_cmd(A_WMI_GET_WMI_CTX(p2p_dev_ctx->dev), &p2p_sdpd_req); - return; - } - } else if (dev->dev.req_config_methods && !(dev->dev.flags & P2P_DEV_PD_FOR_JOIN)) { - /*Do Provisional Discovery */ - p2p_send_prov_disc_req(dev); - return; - } - } - - /* Send the WMI_P2P_SDPD_STOP_CMD for the firmware to continue with Listen in FIND. - */ - wmi_p2p_stop_sdpd(A_WMI_GET_WMI_CTX(p2p_dev_ctx->dev)); - - return; -} - -void p2p_sdpd_rx_event_rx(void *ctx, const A_UINT8 *datap, A_UINT8 len) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - WMI_P2P_SDPD_RX_EVENT *ev; - - ev = (WMI_P2P_SDPD_RX_EVENT *)datap; - - /* Pass the event up to the Supplicant */ - switch (ev->type) { - case WMI_P2P_SD_TYPE_GAS_INITIAL_REQ: - case WMI_P2P_SD_TYPE_GAS_COMEBACK_REQ: - case WMI_P2P_SD_TYPE_GAS_INITIAL_RESP: - case WMI_P2P_SD_TYPE_GAS_COMEBACK_RESP: - A_WMI_P2P_SD_RX_EVENT(p2p_dev_ctx->dev, ev); - break; - case WMI_P2P_SD_TYPE_STATUS_IND: - A_PRINTF("SDPD Status Indication\n"); - break; - case WMI_P2P_PD_TYPE_RESP: - A_PRINTF("PD response got\n"); - break; - default: - A_PRINTF("SDPD resp event %x not supported \n", ev->type); - break; - } - - /* Check the SD transaction status if it is a SD response & drive the FSM appropriately. - */ - switch (ev->type) { - case WMI_P2P_SD_TYPE_GAS_INITIAL_RESP: - case WMI_P2P_SD_TYPE_GAS_COMEBACK_RESP: - - if (ev->transaction_status == WMI_P2P_SDPD_TRANSACTION_COMP) { - struct host_p2p_dev *sd_peer = NULL; - - sd_peer = p2p_get_device(p2p_dev_ctx, ev->peer_addr); - - if (sd_peer) { - sd_peer->dev.flags |= P2P_DEV_SD_INFO; - } - - /* Remove directed queries that have been handled. - */ - if (p2p_dev_ctx->curr_sd_query && !(p2p_dev_ctx->curr_sd_query->for_all_peers)) { - if (p2p_unlink_sd_query(p2p_dev_ctx, p2p_dev_ctx->curr_sd_query)) { - p2p_free_sd_query((void *)p2p_dev_ctx->curr_sd_query); - } - } - } - - case WMI_P2P_SD_TYPE_STATUS_IND: - - if (ev->transaction_status == WMI_P2P_SDPD_TRANSACTION_COMP) { - struct host_p2p_dev *sd_peer = NULL; - - /* Clean up SD pending state for this dev for which the SD transaction - * completed. - */ - sd_peer = p2p_get_device(p2p_dev_ctx, ev->peer_addr); - - /* Query for this device completed. - */ - if (sd_peer) { - sd_peer->dev.flags &= ~P2P_DEV_SD_SCHEDULE; - } - - /* Proceed with the next SD/PD. - */ - p2p_start_sdpd_event_rx(ctx); - } - break; - - case WMI_P2P_PD_TYPE_RESP: - - /* Proceed with the next SD/PD. - */ - p2p_start_sdpd_event_rx(ctx); - break; - - default: - break; - } - - return; -} - -static struct p2p_sd_query *p2p_pending_sd_req(struct p2p_dev_ctx *p2p_dev_ctx, - struct host_p2p_dev *dev) -{ - struct p2p_sd_query *q; - - if (!(dev->dev.dev_capab & P2P_DEV_CAPAB_SERVICE_DISCOVERY)) { - return NULL; /* peer does not support SD */ - } - - for (q = p2p_dev_ctx->sd_queries; q; q = q->next) { - if (q->for_all_peers && !(dev->dev.flags & P2P_DEV_SD_INFO)) { - return q; - } - if (!q->for_all_peers && - A_MEMCMP(q->peer, dev->dev.p2p_device_addr, ETH_ALEN) == 0) - return q; - } - - return NULL; -} - -void p2p_go_neg_complete_rx(void *ctx, const A_UINT8 *datap, A_UINT8 len) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - WMI_P2P_GO_NEG_RESULT_EVENT *ev = (WMI_P2P_GO_NEG_RESULT_EVENT *)datap; - struct host_p2p_dev *peer = NULL; - - /* Get hold of the peer device from the device list. - */ - peer = p2p_get_device(p2p_dev_ctx, ev->peer_device_addr); - - A_ASSERT(peer != NULL); - /*Store minimal persistent group info for Invitation processing*/ - if(ev->persistent_grp) { - peer->persistent_grp = ev->persistent_grp; - peer->role_go = ev->role_go; - peer->ssid_len = ev->ssid_len; - A_MEMCPY(peer->ssid, ev->ssid, ev->ssid_len); - } - return; -} -/** - * wpa_ssid_txt - Convert SSID to a printable string - * @ssid: SSID (32-octet string) - * @ssid_len: Length of ssid in octets - * Returns: Pointer to a printable string - * - * This function can be used to convert SSIDs into printable form. In most - * cases, SSIDs do not use unprintable characters, but IEEE 802.11 standard - * does not limit the used character set, so anything could be used in an SSID. - * - * This function uses a static buffer, so only one call can be used at the - * time, i.e., this is not re-entrant and the returned buffer must be used - * before calling this again. - */ -static const char * wpa_ssid_txt(const u8 *ssid, A_UINT8 ssid_len) -{ - static char ssid_txt[33]; - char *pos; - - if (ssid_len > 32) - ssid_len = 32; - memcpy(ssid_txt, ssid, ssid_len); - ssid_txt[ssid_len] = '\0'; - for (pos = ssid_txt; *pos != '\0'; pos++) { - if ((u8) *pos < 32 || (u8) *pos >= 127) - *pos = '_'; - } - return ssid_txt; -} - -static const char * p2p_go_state_text(enum p2p_go_state go_state) -{ - switch (go_state) { - case UNKNOWN_GO: - return "unknown"; - case LOCAL_GO: - return "local"; - case REMOTE_GO: - return "remote"; - } - - return "??"; -} - -static char * wps_dev_type_bin2str(const u8 dev_type[WPS_DEV_TYPE_LEN], char *buf, - A_UINT32 buf_len) -{ - int ret; - - ret = snprintf(buf, buf_len, "%u-%08X-%u", - WPA_GET_BE16(dev_type), WPA_GET_BE32(&dev_type[2]), - WPA_GET_BE16(&dev_type[6])); - if (ret < 0 || (unsigned int) ret >= buf_len) - return NULL; - - return buf; -} - - -static const char * p2p_wps_method_text(enum p2p_wps_method method) -{ - switch (method) { - case WPS_NOT_READY: - return "not-ready"; - case WPS_PIN_LABEL: - return "Label"; - case WPS_PIN_DISPLAY: - return "Display"; - case WPS_PIN_KEYPAD: - return "Keypad"; - case WPS_PBC: - return "PBC"; - } - - return "??"; -} - - -int p2p_get_peer_info(void *ctx, A_UINT8 *peer_addr, A_UINT8 *buf, A_UINT32 buflen) -{ - struct host_p2p_dev *peer = NULL; - struct p2p_device *dev; - int res; - A_UINT8 *pos, *end; - A_UINT8 devtype[WPS_DEV_TYPE_BUFSIZE]; - bss_t *bss; - A_UINT32 level = 0; - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - - /* Get hold of the peer device - */ - peer = p2p_get_device(ctx, peer_addr); - if (!peer) { - return 0; - } - - dev = &peer->dev; - - bss = wmi_find_node(A_WMI_GET_WMI_CTX(p2p_dev_ctx->dev), dev->p2p_device_addr); - if(bss) { - level = bss->ni_snr; - /* NB: max is 94 because noise is hardcoded to 161 */ - if (level > 94) - level = 94; - - level += 161; /*Add Noise -95dBm*/ - /*level greater than Noise max_level*/ - if(level >=64) - level -=0x100; - } - pos = buf; - end = buf + buflen; - - res = snprintf(pos, end - pos, MACSTR "\n", - MAC2STR(dev->p2p_device_addr)); - - if (res < 0 || res >= end - pos) { - return pos - buf; - return A_NO_MEMORY; - } - - pos += res; - - res = snprintf(pos, end - pos, - "listen_freq=%d\n" - "level=%d\n" - "wps_method=%s\n" - "interface_addr=" MACSTR "\n" - "member_in_go_dev=" MACSTR "\n" - "member_in_go_iface=" MACSTR "\n" - "pri_dev_type=%s\n" - "device_name=%s\n" - "config_methods=0x%x\n" - "dev_capab=0x%x\n" - "group_capab=0x%x\n" - "go_neg_req_sent=%d\n" - "go_state=%s\n" - "dialog_token=%u\n" - "intended_addr=" MACSTR "\n" - "country=%c%c\n" - "oper_freq=%d\n" - "req_config_methods=0x%x\n" - "flags=%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n" - "status=%d\n" - "wait_count=%u\n" - "invitation_reqs=%u\n", - dev->listen_freq, - level, - p2p_wps_method_text(dev->wps_method), - MAC2STR(dev->interface_addr), - MAC2STR(dev->member_in_go_dev), - MAC2STR(dev->member_in_go_iface), - wps_dev_type_bin2str(dev->pri_dev_type, - devtype, sizeof(devtype)), - dev->device_name, - dev->config_methods, - dev->dev_capab, - dev->group_capab, - dev->go_neg_req_sent, - p2p_go_state_text(dev->go_state), - dev->dialog_token, - MAC2STR(dev->intended_addr), - dev->country[0] ? dev->country[0] : '_', - dev->country[1] ? dev->country[1] : '_', - dev->oper_freq, - dev->req_config_methods, - dev->flags & P2P_DEV_PROBE_REQ_ONLY ? - "[PROBE_REQ_ONLY]" : "", - dev->flags & P2P_DEV_REPORTED ? "[REPORTED]" : "", - dev->flags & P2P_DEV_NOT_YET_READY ? - "[NOT_YET_READY]" : "", - dev->flags & P2P_DEV_SD_INFO ? "[SD_INFO]" : "", - dev->flags & P2P_DEV_SD_SCHEDULE ? "[SD_SCHEDULE]" : - "", - dev->flags & P2P_DEV_PD_PEER_DISPLAY ? - "[PD_PEER_DISPLAY]" : "", - dev->flags & P2P_DEV_PD_PEER_KEYPAD ? - "[PD_PEER_KEYPAD]" : "", - dev->flags & P2P_DEV_USER_REJECTED ? - "[USER_REJECTED]" : "", - dev->flags & P2P_DEV_PEER_WAITING_RESPONSE ? - "[PEER_WAITING_RESPONSE]" : "", - dev->flags & P2P_DEV_PREFER_PERSISTENT_GROUP ? - "[PREFER_PERSISTENT_GROUP]" : "", - dev->flags & P2P_DEV_WAIT_GO_NEG_RESPONSE ? - "[WAIT_GO_NEG_RESPONSE]" : "", - dev->flags & P2P_DEV_WAIT_GO_NEG_CONFIRM ? - "[WAIT_GO_NEG_CONFIRM]" : "", - dev->flags & P2P_DEV_GROUP_CLIENT_ONLY ? - "[GROUP_CLIENT_ONLY]" : "", - dev->flags & P2P_DEV_FORCE_FREQ ? - "[FORCE_FREQ]" : "", - dev->status, - dev->wait_count, - dev->invitation_reqs); - if (res < 0 || res >= end - pos) { - return pos - buf; - } - - pos += res; - - if (dev->ext_listen_period) { - res = snprintf(pos, end - pos, - "ext_listen_period=%u\n" - "ext_listen_interval=%u\n", - dev->ext_listen_period, - dev->ext_listen_interval); - if (res < 0 || res >= end - pos) { - return pos - buf; - } - pos += res; - } - - if (dev->oper_ssid_len) { - res = snprintf(pos, end - pos, - "oper_ssid=%s\n", - wpa_ssid_txt(dev->oper_ssid, - dev->oper_ssid_len)); - if (res < 0 || res >= end - pos) { - return pos - buf; - } - } - return pos - buf; -} - -int p2p_get_next_addr(void *ctx, A_UINT8 *addr, A_UINT8 *buf, A_UINT32 buflen, int first_element) -{ - struct host_p2p_dev *peer = NULL; - struct p2p_device *dev; - int res; - A_UINT8 *pos, *end; - - peer = p2p_get_next_device(ctx, addr, first_element); - - if (!peer) { - return 0; - } - - dev = &peer->dev; - - pos = buf; - end = buf + buflen; - - res = snprintf(pos, end - pos, MACSTR "\n", - MAC2STR(dev->p2p_device_addr)); - - if (res < 0 || res >= end - pos) { - return pos - buf; - return A_NO_MEMORY; - } - - pos += res; - - return pos - buf; -} - -void p2p_clear_peers_reported_flag(void *ctx) -{ - struct p2p_dev_ctx *p2p_dev_ctx = (struct p2p_dev_ctx *)ctx; - struct host_p2p_dev *dev; - PDL_LIST pListItem; - - ITERATE_OVER_LIST(&p2p_dev_ctx->devices, pListItem) { - dev = A_CONTAINING_STRUCT(pListItem, struct host_p2p_dev, list); - dev->dev.flags &= (~P2P_DEV_REPORTED); - } -} - -void p2p_clear_peers_authorized_flag(void *ctx, const A_UINT8 *addr) -{ - struct host_p2p_dev *peer = NULL; - - /* Get hold of the peer device. - */ - peer = p2p_get_device(ctx, addr); - if (peer == NULL) { - /* Find using interface addr. - */ - peer = p2p_get_device_intf_addrs(ctx, addr); - } - - if (peer) { - peer->dev.wps_method = WPS_NOT_READY; - } - - return; -} - diff --git a/drivers/net/wireless/ar6003/host/regtable/AR6002def.c b/drivers/net/wireless/ar6003/host/regtable/AR6002def.c deleted file mode 100644 index 5bc66e246b2f..000000000000 --- a/drivers/net/wireless/ar6003/host/regtable/AR6002def.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2008 Atheros Communications, Inc. - * All rights reserved. - * - * - * -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// - * - */ - -#if defined(AR6002_HEADERS_DEF) || defined(ATHR_WIN_DEF) -#define AR6002 1 -#define AR6002_REV 2 - -#define UNDEFINED 0x0fffffff - -#include "common_drv.h" -#include "AR6002/hw2.0/hw/apb_map.h" -#include "AR6002/hw2.0/hw/gpio_reg.h" -#include "AR6002/hw2.0/hw/rtc_reg.h" -#include "AR6002/hw2.0/hw/si_reg.h" -#include "AR6002/hw2.0/hw/mbox_reg.h" -#include "AR6002/hw2.0/hw/mbox_host_reg.h" - -#define MY_TARGET_DEF AR6002_TARGETdef -#define MY_HOST_DEF AR6002_HOSTdef -#define MY_TARGET_BOARD_DATA_SZ AR6002_BOARD_DATA_SZ -#define MY_TARGET_BOARD_EXT_DATA_SZ AR6002_BOARD_EXT_DATA_SZ -#define RTC_WMAC_BASE_ADDRESS RTC_BASE_ADDRESS -#define RTC_SOC_BASE_ADDRESS RTC_BASE_ADDRESS -#define WLAN_SYSTEM_SLEEP_OFFSET SYSTEM_SLEEP_OFFSET -#define WLAN_SYSTEM_SLEEP_DISABLE_LSB SYSTEM_SLEEP_DISABLE_LSB -#define WLAN_SYSTEM_SLEEP_DISABLE_MASK SYSTEM_SLEEP_DISABLE_MASK -#define WLAN_RESET_CONTROL_OFFSET RESET_CONTROL_OFFSET -#define WLAN_RESET_CONTROL_COLD_RST_MASK RESET_CONTROL_COLD_RST_MASK -#define WLAN_RESET_CONTROL_WARM_RST_MASK RESET_CONTROL_WARM_RST_MASK - - -/* Should not be used for AR6002 */ -#define CLOCK_GPIO_OFFSET UNDEFINED -#define CLOCK_GPIO_BT_CLK_OUT_EN_LSB UNDEFINED -#define CLOCK_GPIO_BT_CLK_OUT_EN_MASK UNDEFINED - -#include "targetdef.h" -#include "hostdef.h" -#else -#include "common_drv.h" -#include "targetdef.h" -#include "hostdef.h" -struct targetdef_s *AR6002_TARGETdef=NULL; -struct hostdef_s *AR6002_HOSTdef=NULL; -#endif /* AR6002_HEADERS_DEF */ diff --git a/drivers/net/wireless/ar6003/host/regtable/AR6003def.c b/drivers/net/wireless/ar6003/host/regtable/AR6003def.c deleted file mode 100644 index 144b1bdcca7b..000000000000 --- a/drivers/net/wireless/ar6003/host/regtable/AR6003def.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2008 Atheros Communications, Inc. - * All rights reserved. - * - * - * -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// - * - */ - -#if defined(AR6003_HEADERS_DEF) || defined(ATHR_WIN_DEF) -#define AR6002 1 -#define AR6002_REV 4 - -#define WLAN_HEADERS 1 -#include "common_drv.h" -#include "AR6002/hw4.0/hw/apb_map.h" -#include "AR6002/hw4.0/hw/gpio_reg.h" -#include "AR6002/hw4.0/hw/rtc_reg.h" -#include "AR6002/hw4.0/hw/si_reg.h" -#include "AR6002/hw4.0/hw/mbox_reg.h" -#include "AR6002/hw4.0/hw/mbox_wlan_host_reg.h" - -#define MY_TARGET_DEF AR6003_TARGETdef -#define MY_HOST_DEF AR6003_HOSTdef -#define MY_TARGET_BOARD_DATA_SZ AR6003_BOARD_DATA_SZ -#define MY_TARGET_BOARD_EXT_DATA_SZ AR6003_BOARD_EXT_DATA_SZ -#define RTC_WMAC_BASE_ADDRESS RTC_BASE_ADDRESS -#define RTC_SOC_BASE_ADDRESS RTC_BASE_ADDRESS - -#include "targetdef.h" -#include "hostdef.h" -#else -#include "common_drv.h" -#include "targetdef.h" -#include "hostdef.h" -struct targetdef_s *AR6003_TARGETdef=NULL; -struct hostdef_s *AR6003_HOSTdef=NULL; -#endif /*AR6003_HEADERS_DEF */ diff --git a/drivers/net/wireless/ar6003/host/regtable/MCKINLEYdef.c b/drivers/net/wireless/ar6003/host/regtable/MCKINLEYdef.c deleted file mode 100644 index 6829bae5f0cc..000000000000 --- a/drivers/net/wireless/ar6003/host/regtable/MCKINLEYdef.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2010 Atheros Communications, Inc. - * All rights reserved. - * - * - * -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// - * - */ -#if defined(MCKINLEY_HEADERS_DEF) || defined(ATHR_WIN_DEF) -#define AR6002 1 -#define AR6002_REV 6 - -#define WLAN_HEADERS 1 -#include "common_drv.h" -#include "AR6002/hw6.0/hw/apb_map.h" -#include "AR6002/hw6.0/hw/gpio_reg.h" -#include "AR6002/hw6.0/hw/rtc_reg.h" -#include "AR6002/hw6.0/hw/si_reg.h" -#include "AR6002/hw6.0/hw/mbox_reg.h" -#include "AR6002/hw6.0/hw/mbox_wlan_host_reg.h" - -#define SYSTEM_SLEEP_OFFSET SOC_SYSTEM_SLEEP_OFFSET - -#define MY_TARGET_DEF MCKINLEY_TARGETdef -#define MY_HOST_DEF MCKINLEY_HOSTdef -#define MY_TARGET_BOARD_DATA_SZ MCKINLEY_BOARD_DATA_SZ -#define MY_TARGET_BOARD_EXT_DATA_SZ MCKINLEY_BOARD_EXT_DATA_SZ -#include "targetdef.h" -#include "hostdef.h" -#else -#include "common_drv.h" -#include "targetdef.h" -#include "hostdef.h" -struct targetdef_s *MCKINLEY_TARGETdef=NULL; -struct hostdef_s *MCKINLEY_HOSTdef=NULL; -#endif /*MCKINLEY_HEADERS_DEF */ diff --git a/drivers/net/wireless/ar6003/host/regtable/hostdef.h b/drivers/net/wireless/ar6003/host/regtable/hostdef.h deleted file mode 100644 index e1544751e462..000000000000 --- a/drivers/net/wireless/ar6003/host/regtable/hostdef.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2008 Atheros Communications, Inc. - * All rights reserved. - * - * - * -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// - * - */ - -#ifndef HOSTDEFS_H_ -#define HOSTDEFS_H_ - -#include -#include -#include -#include -#include "host_reg_table.h" - -extern struct hostdef_s *AR6002_HOSTdef; -extern struct hostdef_s *AR6003_HOSTdef; -extern struct hostdef_s *MCKINLEY_HOSTdef; - -#endif diff --git a/drivers/net/wireless/ar6003/host/regtable/makefile b/drivers/net/wireless/ar6003/host/regtable/makefile deleted file mode 100644 index 1ba034c4900e..000000000000 --- a/drivers/net/wireless/ar6003/host/regtable/makefile +++ /dev/null @@ -1,26 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2005-2007 Atheros Corporation. All rights reserved. -# -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# -#------------------------------------------------------------------------------ -#============================================================================== -# Author(s): ="Atheros" -#============================================================================== -!INCLUDE $(_MAKEENVROOT)\makefile.def - - - diff --git a/drivers/net/wireless/ar6003/host/regtable/regtable.c b/drivers/net/wireless/ar6003/host/regtable/regtable.c deleted file mode 100644 index 000a72df8168..000000000000 --- a/drivers/net/wireless/ar6003/host/regtable/regtable.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2010 Atheros Communications, Inc. - * All rights reserved. - * - * - * -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// - * - */ - - -#include "common_drv.h" -#include "bmi_msg.h" - -#include "targetdef.h" -#include "hostdef.h" -#include "hif.h" - - -/* Target-dependent addresses and definitions */ -struct targetdef_s *targetdef; -/* HIF-dependent addresses and definitions */ -struct hostdef_s *hostdef; - -void target_register_tbl_attach(A_UINT32 target_type) -{ - switch (target_type) { - case TARGET_TYPE_AR6002: - targetdef = AR6002_TARGETdef; - break; - case TARGET_TYPE_AR6003: - targetdef = AR6003_TARGETdef; - break; - case TARGET_TYPE_MCKINLEY: - targetdef = MCKINLEY_TARGETdef; - break; - default: - break; - } -} - -void hif_register_tbl_attach(A_UINT32 hif_type) -{ - switch (hif_type) { - case HIF_TYPE_AR6002: - hostdef = AR6002_HOSTdef; - break; - case HIF_TYPE_AR6003: - hostdef = AR6003_HOSTdef; - break; - case HIF_TYPE_MCKINLEY: - hostdef = MCKINLEY_HOSTdef; - break; - default: - break; - } -} - -EXPORT_SYMBOL(targetdef); -EXPORT_SYMBOL(hostdef); diff --git a/drivers/net/wireless/ar6003/host/regtable/targetdef.h b/drivers/net/wireless/ar6003/host/regtable/targetdef.h deleted file mode 100644 index bc8b8f7db7ea..000000000000 --- a/drivers/net/wireless/ar6003/host/regtable/targetdef.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2008 Atheros Communications, Inc. - * All rights reserved. - * - * - * -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// - * - */ - -#ifndef TARGETDEFS_H_ -#define TARGETDEFS_H_ - -#include -#include -#include -#include -#include "target_reg_table.h" - -extern struct targetdef_s *AR6002_TARGETdef; -extern struct targetdef_s *AR6003_TARGETdef; -extern struct targetdef_s *MCKINLEY_TARGETdef; - -#endif diff --git a/drivers/net/wireless/ar6003/host/reorder/aggr_rx_internal.h b/drivers/net/wireless/ar6003/host/reorder/aggr_rx_internal.h deleted file mode 100644 index 00531c808430..000000000000 --- a/drivers/net/wireless/ar6003/host/reorder/aggr_rx_internal.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * - * Copyright (c) 2004-2010 Atheros Communications Inc. - * All rights reserved. - * - * -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// - * - */ - -#ifndef __AGGR_RX_INTERNAL_H__ -#define __AGGR_RX_INTERNAL_H__ - -#include "a_osapi.h" -#include "aggr_recv_api.h" - -//#define AGGR_DEBUG - -#define AGGR_WIN_IDX(x, y) ((x) % (y)) -#define AGGR_INCR_IDX(x, y) AGGR_WIN_IDX(((x)+1), (y)) -#define AGGR_DCRM_IDX(x, y) AGGR_WIN_IDX(((x)-1), (y)) -#define IEEE80211_MAX_SEQ_NO 0xFFF -#define IEEE80211_NEXT_SEQ_NO(x) (((x) + 1) & IEEE80211_MAX_SEQ_NO) - - -#define NUM_OF_TIDS 8 -#define AGGR_SZ_DEFAULT 8 - -#define AGGR_WIN_SZ_MIN 2 -#define AGGR_WIN_SZ_MAX 8 -/* TID Window sz is double of what is negotiated. Derive TID_WINDOW_SZ from win_sz, per tid */ -#define TID_WINDOW_SZ(_x) ((_x) << 1) - -#define AGGR_NUM_OF_FREE_NETBUFS 16 - -#define AGGR_GET_RXTID_STATS(_p, _x) (&(_p->stat[(_x)])) -#define AGGR_GET_RXTID(_p, _x) (&(_p->RxTid[(_x)])) - -/* Hold q is a function of win_sz, which is negotiated per tid */ -#define HOLD_Q_SZ(_x) (TID_WINDOW_SZ((_x))*sizeof(OSBUF_HOLD_Q)) -/* AGGR_RX_TIMEOUT value is important as a (too) small value can cause frames to be - * delivered out of order and a (too) large value can cause undesirable latency in - * certain situations. */ -#define AGGR_RX_TIMEOUT 400 /* Timeout(in ms) for delivery of frames, if they are stuck */ - -typedef enum { - ALL_SEQNO = 0, - CONTIGUOUS_SEQNO = 1, -}DELIVERY_ORDER; - -typedef struct { - void *osbuf; - A_BOOL is_amsdu; - A_UINT16 seq_no; -}OSBUF_HOLD_Q; - - -#if 0 -typedef struct { - A_UINT16 seqno_st; - A_UINT16 seqno_end; -}WINDOW_SNAPSHOT; -#endif - -typedef struct { - A_BOOL aggr; /* is it ON or OFF */ - A_BOOL progress; /* TRUE when frames have arrived after a timer start */ - A_BOOL timerMon; /* TRUE if the timer started for the sake of this TID */ - A_UINT16 win_sz; /* negotiated window size */ - A_UINT16 seq_next; /* Next seq no, in current window */ - A_UINT32 hold_q_sz; /* Num of frames that can be held in hold q */ - OSBUF_HOLD_Q *hold_q; /* Hold q for re-order */ -#if 0 - WINDOW_SNAPSHOT old_win; /* Sliding window snapshot - for timeout */ -#endif - A_NETBUF_QUEUE_T q; /* q head for enqueuing frames for dispatch */ - A_MUTEX_T lock; -}RXTID; - -typedef struct { - A_UINT32 num_into_aggr; /* hitting at the input of this module */ - A_UINT32 num_dups; /* duplicate */ - A_UINT32 num_oow; /* out of window */ - A_UINT32 num_mpdu; /* single payload 802.3/802.11 frame */ - A_UINT32 num_amsdu; /* AMSDU */ - A_UINT32 num_delivered; /* frames delivered to IP stack */ - A_UINT32 num_timeouts; /* num of timeouts, during which frames delivered */ - A_UINT32 num_hole; /* frame not present, when window moved over */ - A_UINT32 num_bar; /* num of resets of seq_num, via BAR */ -}RXTID_STATS; - -typedef struct { - void *dev; /* dev handle */ - A_UINT8 aggr_sz; /* config value of aggregation size */ - A_UINT8 timerScheduled; - A_TIMER timer; /* timer for returning held up pkts in re-order que */ - RXTID RxTid[NUM_OF_TIDS]; /* Per tid window */ -#ifdef AGGR_DEBUG - RXTID_STATS stat[NUM_OF_TIDS]; /* Tid based statistics */ -#endif -}AGGR_CONN_INFO; - -typedef struct { - RX_CALLBACK rx_fn; /* callback function to return frames; to upper layer */ - ALLOC_NETBUFS netbuf_allocator; /* OS netbuf alloc fn */ - A_NETBUF_QUEUE_T freeQ; /* pre-allocated buffers - for A_MSDU slicing */ -#ifdef AGGR_DEBUG - PACKET_LOG pkt_log; /* Log info of the packets */ -#endif -}AGGR_INFO; - -#endif /* __AGGR_RX_INTERNAL_H__ */ diff --git a/drivers/net/wireless/ar6003/host/reorder/makefile b/drivers/net/wireless/ar6003/host/reorder/makefile deleted file mode 100644 index 1ba034c4900e..000000000000 --- a/drivers/net/wireless/ar6003/host/reorder/makefile +++ /dev/null @@ -1,26 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2005-2007 Atheros Corporation. All rights reserved. -# -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# -#------------------------------------------------------------------------------ -#============================================================================== -# Author(s): ="Atheros" -#============================================================================== -!INCLUDE $(_MAKEENVROOT)\makefile.def - - - diff --git a/drivers/net/wireless/ar6003/host/reorder/rcv_aggr.c b/drivers/net/wireless/ar6003/host/reorder/rcv_aggr.c deleted file mode 100644 index 047b06ed85c8..000000000000 --- a/drivers/net/wireless/ar6003/host/reorder/rcv_aggr.c +++ /dev/null @@ -1,749 +0,0 @@ -/* - * - * Copyright (c) 2010 Atheros Communications Inc. - * All rights reserved. - * - * -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// - * - */ - -#ifdef ATH_AR6K_11N_SUPPORT - -#include -#include -#include -#include -#include -#include "ieee80211.h" -#include "pkt_log.h" -#include "aggr_recv_api.h" -#include "aggr_rx_internal.h" -#include "wmi.h" - -extern A_STATUS -wmi_dot3_2_dix(void *osbuf); - -static void -aggr_slice_amsdu(AGGR_CONN_INFO *p_aggr_conn, RXTID *rxtid, void **osbuf); - -static void -aggr_timeout(A_ATH_TIMER arg); - -static void -aggr_deque_frms(AGGR_CONN_INFO *p_aggr_conn, A_UINT8 tid, A_UINT16 seq_no, A_UINT8 order); - -static void -aggr_dispatch_frames(AGGR_CONN_INFO *p_aggr_conn, A_NETBUF_QUEUE_T *q); - -static void * -aggr_get_osbuf(void); - -static AGGR_INFO *p_aggr = NULL; - -#define QOS_PAD_LEN 2 - -A_UINT8 -aggr_init(ALLOC_NETBUFS netbuf_allocator, RX_CALLBACK fn) -{ - p_aggr = A_MALLOC(sizeof(AGGR_INFO)); - - if(p_aggr) { - /* Init data structures */ - A_MEMZERO(p_aggr, sizeof(AGGR_INFO)); - A_NETBUF_QUEUE_INIT(&p_aggr->freeQ); - p_aggr->rx_fn = fn; - p_aggr->netbuf_allocator = netbuf_allocator; - p_aggr->netbuf_allocator(&p_aggr->freeQ, AGGR_NUM_OF_FREE_NETBUFS); - return A_OK; - } - - A_PRINTF("Failed to allocate memory for aggr_node\n"); - return ((A_UINT8)A_ERROR); -} - -void * -aggr_init_conn(void) -{ - AGGR_CONN_INFO *p_aggr_conn = NULL; - RXTID *rxtid; - A_UINT8 i; - - do { - p_aggr_conn = A_MALLOC(sizeof(AGGR_CONN_INFO)); - if(!p_aggr_conn) { - A_PRINTF("Failed to allocate memory for aggr_node_conn \n"); - break; - } - - /* Init timer and data structures */ - A_MEMZERO(p_aggr_conn, sizeof(AGGR_CONN_INFO)); - p_aggr_conn->aggr_sz = AGGR_SZ_DEFAULT; - A_INIT_TIMER(&p_aggr_conn->timer, aggr_timeout, p_aggr_conn); - p_aggr_conn->timerScheduled = FALSE; - - for(i = 0; i < NUM_OF_TIDS; i++) { - rxtid = AGGR_GET_RXTID(p_aggr_conn, i); - rxtid->aggr = FALSE; - rxtid->progress = FALSE; - rxtid->timerMon = FALSE; - A_NETBUF_QUEUE_INIT(&rxtid->q); - A_MUTEX_INIT(&rxtid->lock); - } - }while(FALSE); - - return (p_aggr_conn); -} - -/* utility function to clear rx hold_q for a tid */ -static void -aggr_delete_tid_state(AGGR_CONN_INFO *p_aggr_conn, A_UINT8 tid) -{ - RXTID *rxtid; - - A_ASSERT(tid < NUM_OF_TIDS && p_aggr_conn); - if (!(tid < NUM_OF_TIDS && p_aggr)) { - return; /* in case panic_on_assert==0 */ - } - rxtid = AGGR_GET_RXTID(p_aggr_conn, tid); - if(rxtid->aggr) { - aggr_deque_frms(p_aggr_conn, tid, 0, ALL_SEQNO); - } - - rxtid->aggr = FALSE; - rxtid->progress = FALSE; - rxtid->timerMon = FALSE; - rxtid->win_sz = 0; - rxtid->seq_next = 0; - rxtid->hold_q_sz = 0; - - if(rxtid->hold_q) { - A_FREE(rxtid->hold_q); - rxtid->hold_q = NULL; - } - -#ifdef AGGR_DEBUG - { - RXTID_STATS *stats; - stats = AGGR_GET_RXTID_STATS(p_aggr_conn, tid); - A_MEMZERO(stats, sizeof(RXTID_STATS)); - } -#endif - -} - -void -aggr_module_destroy(void) -{ - if(p_aggr) { - /* free the freeQ and its contents*/ - while(A_NETBUF_QUEUE_SIZE(&p_aggr->freeQ)) { - A_NETBUF_FREE(A_NETBUF_DEQUEUE(&p_aggr->freeQ)); - } - A_FREE(p_aggr); - p_aggr = NULL; - } -} - -void -aggr_module_destroy_timers(void *cntxt) -{ - - AGGR_CONN_INFO *p_aggr_conn = (AGGR_CONN_INFO *)cntxt; - - if(p_aggr_conn) { - if(p_aggr_conn->timerScheduled) { - A_UNTIMEOUT(&p_aggr_conn->timer); - p_aggr_conn->timerScheduled = FALSE; - } - - A_DELETE_TIMER (&p_aggr_conn->timer); - } -} - -void -aggr_module_destroy_conn(void *cntxt) -{ - AGGR_CONN_INFO *p_aggr_conn = (AGGR_CONN_INFO *)cntxt; - RXTID *rxtid; - A_UINT8 i, k; - A_ASSERT(p_aggr_conn); - - if(p_aggr_conn) { - if(p_aggr_conn->timerScheduled) { - A_UNTIMEOUT(&p_aggr_conn->timer); - p_aggr_conn->timerScheduled = FALSE; - } - - A_DELETE_TIMER (&p_aggr_conn->timer); - - for(i = 0; i < NUM_OF_TIDS; i++) { - rxtid = AGGR_GET_RXTID(p_aggr_conn, i); - /* Free the hold q contents and hold_q*/ - if(rxtid->hold_q) { - for(k = 0; k< rxtid->hold_q_sz; k++) { - if(rxtid->hold_q[k].osbuf) { - A_NETBUF_FREE(rxtid->hold_q[k].osbuf); - } - } - A_FREE(rxtid->hold_q); - rxtid->hold_q = NULL; - } - /* Free the dispatch q contents*/ - while(A_NETBUF_QUEUE_SIZE(&rxtid->q)) { - A_NETBUF_FREE(A_NETBUF_DEQUEUE(&rxtid->q)); - } - if (A_IS_MUTEX_VALID(&rxtid->lock)) { - A_MUTEX_DELETE(&rxtid->lock); - } - } - A_FREE(p_aggr_conn); - p_aggr_conn = NULL; - } -} - -void -aggr_process_bar(void *cntxt, A_UINT8 tid, A_UINT16 seq_no) -{ - AGGR_CONN_INFO *p_aggr_conn = (AGGR_CONN_INFO *)cntxt; - - A_ASSERT(p_aggr_conn); - -#ifdef AGGR_DEBUG - { - RXTID_STATS *stats; - stats = AGGR_GET_RXTID_STATS(p_aggr_conn, tid); - stats->num_bar++; - } -#endif - - aggr_deque_frms(p_aggr_conn, tid, seq_no, ALL_SEQNO); -} - - -void -aggr_recv_addba_req_evt(void *cntxt, A_UINT8 tid, A_UINT16 seq_no, A_UINT8 win_sz) -{ - AGGR_CONN_INFO *p_aggr_conn = (AGGR_CONN_INFO *)cntxt; - RXTID *rxtid; - - A_ASSERT(p_aggr_conn); - rxtid = AGGR_GET_RXTID(p_aggr_conn, tid); - - if(rxtid->aggr) { - /* Just go and deliver all the frames up from this - * queue, as if we got DELBA and re-initialize the queue - */ - aggr_delete_tid_state(p_aggr_conn, tid); - } - - rxtid->seq_next = seq_no; - /* create these queues, only upon receiving of ADDBA for a - * tid, reducing memory requirement - */ - rxtid->hold_q = A_MALLOC(HOLD_Q_SZ(win_sz)); - if((rxtid->hold_q == NULL)) { - A_PRINTF("Failed to allocate memory, tid = %d\n", tid); - A_ASSERT(0); - return; /* in case panic_on_assert==0 */ - } - A_MEMZERO(rxtid->hold_q, HOLD_Q_SZ(win_sz)); - - /* Update rxtid for the window sz */ - rxtid->win_sz = win_sz; - /* hold_q_sz inicates the depth of holding q - which is - * a factor of win_sz. Compute once, as it will be used often - */ - rxtid->hold_q_sz = TID_WINDOW_SZ(win_sz); - /* There should be no frames on q - even when second ADDBA comes in. - * If aggr was previously ON on this tid, we would have cleaned up - * the q - */ - if(A_NETBUF_QUEUE_SIZE(&rxtid->q) != 0) { - A_PRINTF("ERROR: Frames still on queue ?\n"); - A_ASSERT(0); - } - - rxtid->aggr = TRUE; -} - -void -aggr_recv_delba_req_evt(void *cntxt, A_UINT8 tid) -{ - AGGR_CONN_INFO *p_aggr_conn = (AGGR_CONN_INFO *)cntxt; - RXTID *rxtid; - - A_ASSERT(p_aggr_conn); - - rxtid = AGGR_GET_RXTID(p_aggr_conn, tid); - - if(rxtid->aggr) { - aggr_delete_tid_state(p_aggr_conn, tid); - } -} - -static void -aggr_deque_frms(AGGR_CONN_INFO *p_aggr_conn, A_UINT8 tid, A_UINT16 seq_no, A_UINT8 order) -{ - RXTID *rxtid; - OSBUF_HOLD_Q *node; - A_UINT16 idx, idx_end, seq_end; -#ifdef AGGR_DEBUG - RXTID_STATS *stats; -#endif - - A_ASSERT(p_aggr_conn); - rxtid = AGGR_GET_RXTID(p_aggr_conn, tid); -#ifdef AGGR_DEBUG - stats = AGGR_GET_RXTID_STATS(p_aggr_conn, tid); -#endif - - /* idx is absolute location for first frame */ - idx = AGGR_WIN_IDX(rxtid->seq_next, rxtid->hold_q_sz); - - /* idx_end is typically the last possible frame in the window, - * but changes to 'the' seq_no, when BAR comes. If seq_no - * is non-zero, we will go up to that and stop. - * Note: last seq no in current window will occupy the same - * index position as index that is just previous to start. - * An imp point : if win_sz is 7, for seq_no space of 4095, - * then, there would be holes when sequence wrap around occurs. - * Target should judiciously choose the win_sz, based on - * this condition. For 4095, (TID_WINDOW_SZ = 2 x win_sz - * 2, 4, 8, 16 win_sz works fine). - * We must deque from "idx" to "idx_end", including both. - */ - seq_end = (seq_no) ? seq_no : rxtid->seq_next; - idx_end = AGGR_WIN_IDX(seq_end, rxtid->hold_q_sz); - - /* Critical section begins */ - A_MUTEX_LOCK(&rxtid->lock); - do { - - node = &rxtid->hold_q[idx]; - - if((order == CONTIGUOUS_SEQNO) && (!node->osbuf)) - break; - - /* chain frames and deliver frames bcos: - * 1. either the frames are in order and window is contiguous, OR - * 2. we need to deque frames, irrespective of holes - */ - if(node->osbuf) { - if(node->is_amsdu) { - aggr_slice_amsdu(p_aggr_conn, rxtid, &node->osbuf); - } else { - A_NETBUF_ENQUEUE(&rxtid->q, node->osbuf); - } - node->osbuf = NULL; - } -#ifdef AGGR_DEBUG - else { - stats->num_hole++; - } -#endif - /* window is moving */ - rxtid->seq_next = IEEE80211_NEXT_SEQ_NO(rxtid->seq_next); - idx = AGGR_WIN_IDX(rxtid->seq_next, rxtid->hold_q_sz); - } while(idx != idx_end); - /* Critical section ends */ - A_MUTEX_UNLOCK(&rxtid->lock); - -#ifdef AGGR_DEBUG - stats->num_delivered += A_NETBUF_QUEUE_SIZE(&rxtid->q); -#endif - aggr_dispatch_frames(p_aggr_conn, &rxtid->q); -} - -static void * -aggr_get_osbuf(void) -{ - void *buf = NULL; - - /* Starving for buffers? get more from OS - * check for low netbuffers( < 1/4 AGGR_NUM_OF_FREE_NETBUFS) : - * re-allocate bufs if so - * allocate a free buf from freeQ - */ - if (A_NETBUF_QUEUE_SIZE(&p_aggr->freeQ) < (AGGR_NUM_OF_FREE_NETBUFS >> 2)) { - p_aggr->netbuf_allocator(&p_aggr->freeQ, AGGR_NUM_OF_FREE_NETBUFS); - } - - if (A_NETBUF_QUEUE_SIZE(&p_aggr->freeQ)) { - buf = A_NETBUF_DEQUEUE(&p_aggr->freeQ); - } - - return buf; -} - - -static void -aggr_slice_amsdu(AGGR_CONN_INFO *p_aggr_conn, RXTID *rxtid, void **osbuf) -{ - void *new_buf; - A_UINT16 frame_8023_len, payload_8023_len, mac_hdr_len, amsdu_len; - A_UINT8 *framep; - - - /* Frame format at this point: - * [DIX hdr | 802.3 | 802.3 | ... | 802.3] - * - * Strip the DIX header. - * Iterate through the osbuf and do: - * grab a free netbuf from freeQ - * find the start and end of a frame - * copy it to netbuf(Vista can do better here) - * convert all msdu's(802.3) frames to upper layer format - os routine - * -for now lets convert from 802.3 to dix - * enque this to dispatch q of tid - * repeat - * free the osbuf - to OS. It's been sliced. - */ - /* Frame format in native wifi path: - * [802.11 hdr | 802.3 | 802.3 |...|802.3] - * Save a pointer to the start of 802.11 Hdr and Strip the 802.11 hdr - * Iterate through the osbuf and do: - * grab a free netbuf from freeQ - * Find the start and end of the frame - * Copy the dot 11 header,followed by the payload data. 802.3 hdr in the - individual msdu must not be copied - * repeat - * free the osbuf containing the A-MSDU. - */ - - - mac_hdr_len = sizeof(ATH_MAC_HDR); - - framep = A_NETBUF_DATA(*osbuf) + mac_hdr_len; - amsdu_len = A_NETBUF_LEN(*osbuf) - mac_hdr_len; - - while(amsdu_len > mac_hdr_len) { - /* Begin of a 802.3 frame */ - payload_8023_len = A_BE2CPU16(((ATH_MAC_HDR *)framep)->typeOrLen); -#define MAX_MSDU_SUBFRAME_PAYLOAD_LEN 1508 -#define MIN_MSDU_SUBFRAME_PAYLOAD_LEN 46 - if(payload_8023_len < MIN_MSDU_SUBFRAME_PAYLOAD_LEN || payload_8023_len > MAX_MSDU_SUBFRAME_PAYLOAD_LEN) { - A_PRINTF("802.3 AMSDU frame bound check failed. len %d\n", payload_8023_len); - break; - } - frame_8023_len = payload_8023_len + mac_hdr_len; - new_buf = aggr_get_osbuf(); - if(new_buf == NULL) { - A_PRINTF("No buffer available \n"); - break; - } - - A_MEMCPY(A_NETBUF_DATA(new_buf), framep, frame_8023_len); - A_NETBUF_PUT(new_buf, frame_8023_len); - if (wmi_dot3_2_dix(new_buf) != A_OK) { - A_PRINTF("dot3_2_dix err..\n"); - A_NETBUF_FREE(new_buf); - break; - } - - - A_NETBUF_ENQUEUE(&rxtid->q, new_buf); - - /* Is this the last subframe within this aggregate ? */ - if ((amsdu_len - frame_8023_len) == 0) { - break; - } - - /* Add the length of A-MSDU subframe padding bytes - - * Round to nearest word. - */ - frame_8023_len = ((frame_8023_len + 3) & ~3); - - framep += frame_8023_len; - amsdu_len -= frame_8023_len; - } - - A_NETBUF_FREE(*osbuf); - *osbuf = NULL; -} - -void -aggr_process_recv_frm(void *cntxt, A_UINT8 tid, A_UINT16 seq_no, A_BOOL is_amsdu, void **osbuf) -{ - AGGR_CONN_INFO *p_aggr_conn = (AGGR_CONN_INFO *)cntxt; - RXTID *rxtid; -#ifdef AGGR_DEBUG - RXTID_STATS *stats; -#endif - A_UINT16 idx, st, cur, end; - OSBUF_HOLD_Q *node; - - A_ASSERT(p_aggr_conn); - A_ASSERT(tid < NUM_OF_TIDS); - - rxtid = AGGR_GET_RXTID(p_aggr_conn, tid); -#ifdef AGGR_DEBUG - stats = AGGR_GET_RXTID_STATS(p_aggr_conn, tid); - stats->num_into_aggr++; -#endif - - if(!rxtid->aggr) { - if(is_amsdu) { - aggr_slice_amsdu(p_aggr_conn, rxtid, osbuf); -#ifdef AGGR_DEBUG - stats->num_amsdu++; -#endif - aggr_dispatch_frames(p_aggr_conn, &rxtid->q); - } - return; - } - - /* Check the incoming sequence no, if it's in the window */ - st = rxtid->seq_next; - cur = seq_no; - end = (st + rxtid->hold_q_sz-1) & IEEE80211_MAX_SEQ_NO; - -#ifdef AGGR_DEBUG - { - A_UINT16 *log_idx; - PACKET_LOG *log; - - /* Log the pkt info for future analysis */ - log = &p_aggr->pkt_log; - log_idx = &log->last_idx; - log->info[*log_idx].cur = cur; - log->info[*log_idx].st = st; - log->info[*log_idx].end = end; - *log_idx = IEEE80211_NEXT_SEQ_NO(*log_idx); - } -#endif - - if(((st < end) && (cur < st || cur > end)) || - ((st > end) && (cur > end) && (cur < st))) { - /* the cur frame is outside the window. Since we know - * our target would not do this without reason it must - * be assumed that the window has moved for some valid reason. - * Therefore, we dequeue all frames and start fresh. - */ - A_UINT16 extended_end; - - extended_end = (end + rxtid->hold_q_sz-1) & IEEE80211_MAX_SEQ_NO; - - if(((end < extended_end) && (cur < end || cur > extended_end)) || - ((end > extended_end) && (cur > extended_end) && (cur < end))) { - // dequeue all frames in queue and shift window to new frame - aggr_deque_frms(p_aggr_conn, tid, 0, ALL_SEQNO); - //set window start so that new frame is last frame in window - if(cur >= rxtid->hold_q_sz-1) { - rxtid->seq_next = cur - (rxtid->hold_q_sz-1); - }else{ - rxtid->seq_next = IEEE80211_MAX_SEQ_NO - (rxtid->hold_q_sz-2 - cur); - } - } else { - // dequeue only those frames that are outside the new shifted window - if(cur >= rxtid->hold_q_sz-1) { - st = cur - (rxtid->hold_q_sz-1); - }else{ - st = IEEE80211_MAX_SEQ_NO - (rxtid->hold_q_sz-2 - cur); - } - - aggr_deque_frms(p_aggr_conn, tid, st, ALL_SEQNO); - } -#ifdef AGGR_DEBUG - stats->num_oow++; -#endif - } - - idx = AGGR_WIN_IDX(seq_no, rxtid->hold_q_sz); - - /*enque the frame, in hold_q */ - node = &rxtid->hold_q[idx]; - - A_MUTEX_LOCK(&rxtid->lock); - if(node->osbuf) { - /* Is the cur frame duplicate or something beyond our - * window(hold_q -> which is 2x, already)? - * 1. Duplicate is easy - drop incoming frame. - * 2. Not falling in current sliding window. - * 2a. is the frame_seq_no preceding current tid_seq_no? - * -> drop the frame. perhaps sender did not get our ACK. - * this is taken care of above. - * 2b. is the frame_seq_no beyond window(st, TID_WINDOW_SZ); - * -> Taken care of it above, by moving window forward. - * - */ - A_NETBUF_FREE(node->osbuf); -#ifdef AGGR_DEBUG - stats->num_dups++; -#endif - } - - node->osbuf = *osbuf; - node->is_amsdu = is_amsdu; - node->seq_no = seq_no; -#ifdef AGGR_DEBUG - if(node->is_amsdu) { - stats->num_amsdu++; - } else { - stats->num_mpdu++; - } -#endif - A_MUTEX_UNLOCK(&rxtid->lock); - - *osbuf = NULL; - aggr_deque_frms(p_aggr_conn, tid, 0, CONTIGUOUS_SEQNO); - - if(p_aggr_conn->timerScheduled) { - rxtid->progress = TRUE; - }else{ - for(idx=0 ; idxhold_q_sz ; idx++) { - if(rxtid->hold_q[idx].osbuf) { - /* there is a frame in the queue and no timer so - * start a timer to ensure that the frame doesn't remain - * stuck forever. */ - p_aggr_conn->timerScheduled = TRUE; - A_TIMEOUT_MS(&p_aggr_conn->timer, AGGR_RX_TIMEOUT, 0); - rxtid->progress = FALSE; - rxtid->timerMon = TRUE; - break; - } - } - } -} - -/* - * aggr_reset_state -- Called when it is deemed necessary to clear the aggregate - * hold Q state. Examples include when a Connect event or disconnect event is - * received. - */ -void -aggr_reset_state(void *cntxt, void *dev) -{ - A_UINT8 tid; - AGGR_CONN_INFO *p_aggr_conn = (AGGR_CONN_INFO *)cntxt; - - A_ASSERT(p_aggr_conn); - - p_aggr_conn->dev = dev; - for(tid=0 ; tidaggr == FALSE || - rxtid->timerMon == FALSE || - rxtid->progress == TRUE) { - continue; - } - // dequeue all frames in for this tid -#ifdef AGGR_DEBUG - stats->num_timeouts++; -#endif - A_PRINTF("TO: st %d end %d\n", rxtid->seq_next, ((rxtid->seq_next + rxtid->hold_q_sz-1) & IEEE80211_MAX_SEQ_NO)); - aggr_deque_frms(p_aggr_conn, i, 0, ALL_SEQNO); - } - - p_aggr_conn->timerScheduled = FALSE; - // determine whether a new timer should be started. - for(i = 0; i < NUM_OF_TIDS; i++) { - rxtid = AGGR_GET_RXTID(p_aggr_conn, i); - - if(rxtid->aggr == TRUE && rxtid->hold_q) { - for(j = 0 ; j < rxtid->hold_q_sz ; j++) - { - if(rxtid->hold_q[j].osbuf) - { - p_aggr_conn->timerScheduled = TRUE; - rxtid->timerMon = TRUE; - rxtid->progress = FALSE; - break; - } - } - - if(j >= rxtid->hold_q_sz) { - rxtid->timerMon = FALSE; - } - } - } - - if(p_aggr_conn->timerScheduled) { - /* Rearm the timer*/ - A_TIMEOUT_MS(&p_aggr_conn->timer, AGGR_RX_TIMEOUT, 0); - } - -} - -static void -aggr_dispatch_frames(AGGR_CONN_INFO *p_aggr_conn, A_NETBUF_QUEUE_T *q) -{ - void *osbuf; - - if(p_aggr_conn->dev == NULL) { - while(A_NETBUF_QUEUE_SIZE(q)) { - A_NETBUF_FREE(A_NETBUF_DEQUEUE(q)); - } - } - else { - while((osbuf = A_NETBUF_DEQUEUE(q))!= NULL) { - p_aggr->rx_fn(p_aggr_conn->dev, osbuf); - } - } -} - -void -aggr_dump_stats(void *cntxt, PACKET_LOG **log_buf) -{ -#ifdef AGGR_DEBUG - AGGR_CONN_INFO *p_aggr_conn = (AGGR_CONN_INFO *)cntxt; - RXTID *rxtid; - RXTID_STATS *stats; - A_UINT8 i; - - *log_buf = &p_aggr->pkt_log; - A_PRINTF("\n\n================================================\n"); - A_PRINTF("tid: num_into_aggr, dups, oow, mpdu, amsdu, delivered, timeouts, holes, bar, seq_next\n"); - for(i = 0; i < NUM_OF_TIDS; i++) { - stats = AGGR_GET_RXTID_STATS(p_aggr_conn, i); - rxtid = AGGR_GET_RXTID(p_aggr_conn, i); - A_PRINTF("%d: %d %d %d %d %d %d %d %d %d : %d\n", i, stats->num_into_aggr, stats->num_dups, - stats->num_oow, stats->num_mpdu, - stats->num_amsdu, stats->num_delivered, stats->num_timeouts, - stats->num_hole, stats->num_bar, - rxtid->seq_next); - } - A_PRINTF("================================================\n\n"); -#else - A_PRINTF("AGGR_DEBUG is not enabled\n"); -#endif -} - -#endif /* ATH_AR6K_11N_SUPPORT */ diff --git a/drivers/net/wireless/ar6003/host/wlan/include/ieee80211.h b/drivers/net/wireless/ar6003/host/wlan/include/ieee80211.h deleted file mode 100644 index c4fd13fe0a91..000000000000 --- a/drivers/net/wireless/ar6003/host/wlan/include/ieee80211.h +++ /dev/null @@ -1,401 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== -#ifndef _NET80211_IEEE80211_H_ -#define _NET80211_IEEE80211_H_ - -#include "athstartpack.h" - -/* - * 802.11 protocol definitions. - */ -#define IEEE80211_WEP_KEYLEN 5 /* 40bit */ -#define IEEE80211_WEP_IVLEN 3 /* 24bit */ -#define IEEE80211_WEP_KIDLEN 1 /* 1 octet */ -#define IEEE80211_WEP_CRCLEN 4 /* CRC-32 */ -#define IEEE80211_WEP_NKID 4 /* number of key ids */ - -/* - * 802.11i defines an extended IV for use with non-WEP ciphers. - * When the EXTIV bit is set in the key id byte an additional - * 4 bytes immediately follow the IV for TKIP. For CCMP the - * EXTIV bit is likewise set but the 8 bytes represent the - * CCMP header rather than IV+extended-IV. - */ -#define IEEE80211_WEP_EXTIV 0x20 -#define IEEE80211_WEP_EXTIVLEN 4 /* extended IV length */ -#define IEEE80211_WEP_MICLEN 8 /* trailing MIC */ - -#define IEEE80211_CRC_LEN 4 - -#ifdef WAPI_ENABLE -#define IEEE80211_WAPI_EXTIVLEN 10 /* extended IV length */ -#endif /* WAPI ENABLE */ - - -#define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */ -/* is 802.11 address multicast/broadcast? */ -#define IEEE80211_IS_MULTICAST(_a) (*(_a) & 0x01) -#define IEEE80211_IS_BROADCAST(_a) (*(_a) == 0xFF) -#define WEP_HEADER (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN) -#define WEP_TRAILER IEEE80211_WEP_CRCLEN -#define CCMP_HEADER (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + \ - IEEE80211_WEP_EXTIVLEN) -#define CCMP_TRAILER IEEE80211_WEP_MICLEN -#define TKIP_HEADER (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + \ - IEEE80211_WEP_EXTIVLEN) -#define TKIP_TRAILER IEEE80211_WEP_CRCLEN -#define TKIP_MICLEN IEEE80211_WEP_MICLEN - - -#define IEEE80211_ADDR_EQ(addr1, addr2) \ - (A_MEMCMP(addr1, addr2, IEEE80211_ADDR_LEN) == 0) - -#define IEEE80211_ADDR_COPY(dst,src) A_MEMCPY(dst,src,IEEE80211_ADDR_LEN) - -#define IEEE80211_KEYBUF_SIZE 16 -#define IEEE80211_MICBUF_SIZE (8+8) /* space for both tx and rx */ - -/* - * NB: these values are ordered carefully; there are lots of - * of implications in any reordering. In particular beware - * that 4 is not used to avoid conflicting with IEEE80211_F_PRIVACY. - */ -#define IEEE80211_CIPHER_WEP 0 -#define IEEE80211_CIPHER_TKIP 1 -#define IEEE80211_CIPHER_AES_OCB 2 -#define IEEE80211_CIPHER_AES_CCM 3 -#define IEEE80211_CIPHER_CKIP 5 -#define IEEE80211_CIPHER_CCKM_KRK 6 -#define IEEE80211_CIPHER_NONE 7 /* pseudo value */ - -#define IEEE80211_CIPHER_MAX (IEEE80211_CIPHER_NONE+1) - -#define IEEE80211_IS_VALID_WEP_CIPHER_LEN(len) \ - (((len) == 5) || ((len) == 13) || ((len) == 16)) - - - -/* - * generic definitions for IEEE 802.11 frames - */ -PREPACK struct ieee80211_frame { - A_UINT8 i_fc[2]; - A_UINT8 i_dur[2]; - A_UINT8 i_addr1[IEEE80211_ADDR_LEN]; - A_UINT8 i_addr2[IEEE80211_ADDR_LEN]; - A_UINT8 i_addr3[IEEE80211_ADDR_LEN]; - A_UINT8 i_seq[2]; - /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */ - /* see below */ -} POSTPACK; - -PREPACK struct ieee80211_qosframe { - A_UINT8 i_fc[2]; - A_UINT8 i_dur[2]; - A_UINT8 i_addr1[IEEE80211_ADDR_LEN]; - A_UINT8 i_addr2[IEEE80211_ADDR_LEN]; - A_UINT8 i_addr3[IEEE80211_ADDR_LEN]; - A_UINT8 i_seq[2]; - A_UINT8 i_qos[2]; -} POSTPACK; - -#define IEEE80211_FC0_VERSION_MASK 0x03 -#define IEEE80211_FC0_VERSION_SHIFT 0 -#define IEEE80211_FC0_VERSION_0 0x00 -#define IEEE80211_FC0_TYPE_MASK 0x0c -#define IEEE80211_FC0_TYPE_SHIFT 2 -#define IEEE80211_FC0_TYPE_MGT 0x00 -#define IEEE80211_FC0_TYPE_CTL 0x04 -#define IEEE80211_FC0_TYPE_DATA 0x08 - -#define IEEE80211_FC0_SUBTYPE_MASK 0xf0 -#define IEEE80211_FC0_SUBTYPE_SHIFT 4 -/* for TYPE_MGT */ -#define IEEE80211_FC0_SUBTYPE_ASSOC_REQ 0x00 -#define IEEE80211_FC0_SUBTYPE_ASSOC_RESP 0x10 -#define IEEE80211_FC0_SUBTYPE_REASSOC_REQ 0x20 -#define IEEE80211_FC0_SUBTYPE_REASSOC_RESP 0x30 -#define IEEE80211_FC0_SUBTYPE_PROBE_REQ 0x40 -#define IEEE80211_FC0_SUBTYPE_PROBE_RESP 0x50 -#define IEEE80211_FC0_SUBTYPE_BEACON 0x80 -#define IEEE80211_FC0_SUBTYPE_ATIM 0x90 -#define IEEE80211_FC0_SUBTYPE_DISASSOC 0xa0 -#define IEEE80211_FC0_SUBTYPE_AUTH 0xb0 -#define IEEE80211_FC0_SUBTYPE_DEAUTH 0xc0 -/* for TYPE_CTL */ -#define IEEE80211_FC0_SUBTYPE_PS_POLL 0xa0 -#define IEEE80211_FC0_SUBTYPE_RTS 0xb0 -#define IEEE80211_FC0_SUBTYPE_CTS 0xc0 -#define IEEE80211_FC0_SUBTYPE_ACK 0xd0 -#define IEEE80211_FC0_SUBTYPE_CF_END 0xe0 -#define IEEE80211_FC0_SUBTYPE_CF_END_ACK 0xf0 -/* for TYPE_DATA (bit combination) */ -#define IEEE80211_FC0_SUBTYPE_DATA 0x00 -#define IEEE80211_FC0_SUBTYPE_CF_ACK 0x10 -#define IEEE80211_FC0_SUBTYPE_CF_POLL 0x20 -#define IEEE80211_FC0_SUBTYPE_CF_ACPL 0x30 -#define IEEE80211_FC0_SUBTYPE_NODATA 0x40 -#define IEEE80211_FC0_SUBTYPE_CFACK 0x50 -#define IEEE80211_FC0_SUBTYPE_CFPOLL 0x60 -#define IEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK 0x70 -#define IEEE80211_FC0_SUBTYPE_QOS 0x80 -#define IEEE80211_FC0_SUBTYPE_QOS_NULL 0xc0 - -#define IEEE80211_FC1_DIR_MASK 0x03 -#define IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */ -#define IEEE80211_FC1_DIR_TODS 0x01 /* STA->AP */ -#define IEEE80211_FC1_DIR_FROMDS 0x02 /* AP ->STA */ -#define IEEE80211_FC1_DIR_DSTODS 0x03 /* AP ->AP */ - -#define IEEE80211_FC1_MORE_FRAG 0x04 -#define IEEE80211_FC1_RETRY 0x08 -#define IEEE80211_FC1_PWR_MGT 0x10 -#define IEEE80211_FC1_MORE_DATA 0x20 -#define IEEE80211_FC1_WEP 0x40 -#define IEEE80211_FC1_ORDER 0x80 - -#define IEEE80211_SEQ_FRAG_MASK 0x000f -#define IEEE80211_SEQ_FRAG_SHIFT 0 -#define IEEE80211_SEQ_SEQ_MASK 0xfff0 -#define IEEE80211_SEQ_SEQ_SHIFT 4 - -#define IEEE80211_NWID_LEN 32 - -/* - * 802.11 rate set. - */ -#define IEEE80211_RATE_SIZE 8 /* 802.11 standard */ -#define IEEE80211_RATE_MAXSIZE 15 /* max rates we'll handle */ - -#define WMM_NUM_AC 4 /* 4 AC categories */ - -#define WMM_PARAM_ACI_M 0x60 /* Mask for ACI field */ -#define WMM_PARAM_ACI_S 5 /* Shift for ACI field */ -#define WMM_PARAM_ACM_M 0x10 /* Mask for ACM bit */ -#define WMM_PARAM_ACM_S 4 /* Shift for ACM bit */ -#define WMM_PARAM_AIFSN_M 0x0f /* Mask for aifsn field */ -#define WMM_PARAM_LOGCWMIN_M 0x0f /* Mask for CwMin field (in log) */ -#define WMM_PARAM_LOGCWMAX_M 0xf0 /* Mask for CwMax field (in log) */ -#define WMM_PARAM_LOGCWMAX_S 4 /* Shift for CwMax field */ - -#define WMM_AC_TO_TID(_ac) ( \ - ((_ac) == WMM_AC_VO) ? 6 : \ - ((_ac) == WMM_AC_VI) ? 5 : \ - ((_ac) == WMM_AC_BK) ? 1 : \ - 0) - -#define TID_TO_WMM_AC(_tid) ( \ - ((_tid) < 1) ? WMM_AC_BE : \ - ((_tid) < 3) ? WMM_AC_BK : \ - ((_tid) < 6) ? WMM_AC_VI : \ - WMM_AC_VO) -/* - * Management information element payloads. - */ - -enum { - IEEE80211_ELEMID_SSID = 0, - IEEE80211_ELEMID_RATES = 1, - IEEE80211_ELEMID_FHPARMS = 2, - IEEE80211_ELEMID_DSPARMS = 3, - IEEE80211_ELEMID_CFPARMS = 4, - IEEE80211_ELEMID_TIM = 5, - IEEE80211_ELEMID_IBSSPARMS = 6, - IEEE80211_ELEMID_COUNTRY = 7, - IEEE80211_ELEMID_CHALLENGE = 16, - /* 17-31 reserved for challenge text extension */ - IEEE80211_ELEMID_PWRCNSTR = 32, - IEEE80211_ELEMID_PWRCAP = 33, - IEEE80211_ELEMID_TPCREQ = 34, - IEEE80211_ELEMID_TPCREP = 35, - IEEE80211_ELEMID_SUPPCHAN = 36, - IEEE80211_ELEMID_CHANSWITCH = 37, - IEEE80211_ELEMID_MEASREQ = 38, - IEEE80211_ELEMID_MEASREP = 39, - IEEE80211_ELEMID_QUIET = 40, - IEEE80211_ELEMID_IBSSDFS = 41, - IEEE80211_ELEMID_ERP = 42, - IEEE80211_ELEMID_HTCAP_ANA = 45, /* Address ANA, and non-ANA story, for interop. CL#171733 */ - IEEE80211_ELEMID_RSN = 48, - IEEE80211_ELEMID_XRATES = 50, - IEEE80211_ELEMID_HTINFO_ANA = 61, -#ifdef WAPI_ENABLE - IEEE80211_ELEMID_WAPI = 68, -#endif - IEEE80211_ELEMID_TPC = 150, - IEEE80211_ELEMID_CCKM = 156, - IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ -}; - -#define ATH_OUI 0x7f0300 /* Atheros OUI */ -#define ATH_OUI_TYPE 0x01 -#define ATH_OUI_SUBTYPE 0x01 -#define ATH_OUI_VERSION 0x00 - -#define WPA_OUI 0xf25000 -#define WPA_OUI_TYPE 0x01 -#define WPA_VERSION 1 /* current supported version */ - -#define WPA_CSE_NULL 0x00 -#define WPA_CSE_WEP40 0x01 -#define WPA_CSE_TKIP 0x02 -#define WPA_CSE_CCMP 0x04 -#define WPA_CSE_WEP104 0x05 - -#define WPA_ASE_NONE 0x00 -#define WPA_ASE_8021X_UNSPEC 0x01 -#define WPA_ASE_8021X_PSK 0x02 - -#define RSN_OUI 0xac0f00 -#define RSN_VERSION 1 /* current supported version */ - -#define RSN_CSE_NULL 0x00 -#define RSN_CSE_WEP40 0x01 -#define RSN_CSE_TKIP 0x02 -#define RSN_CSE_WRAP 0x03 -#define RSN_CSE_CCMP 0x04 -#define RSN_CSE_WEP104 0x05 - -#define RSN_ASE_NONE 0x00 -#define RSN_ASE_8021X_UNSPEC 0x01 -#define RSN_ASE_8021X_PSK 0x02 - -#define RSN_CAP_PREAUTH 0x01 - -#define WMM_OUI 0xf25000 -#define WMM_OUI_TYPE 0x02 -#define WMM_INFO_OUI_SUBTYPE 0x00 -#define WMM_PARAM_OUI_SUBTYPE 0x01 -#define WMM_VERSION 1 - -/* WMM stream classes */ -#define WMM_NUM_AC 4 -#define WMM_AC_BE 0 /* best effort */ -#define WMM_AC_BK 1 /* background */ -#define WMM_AC_VI 2 /* video */ -#define WMM_AC_VO 3 /* voice */ - -/* TSPEC related */ -#define ACTION_CATEGORY_CODE_TSPEC 17 -#define ACTION_CODE_TSPEC_ADDTS 0 -#define ACTION_CODE_TSPEC_ADDTS_RESP 1 -#define ACTION_CODE_TSPEC_DELTS 2 - -typedef enum { - TSPEC_STATUS_CODE_ADMISSION_ACCEPTED = 0, - TSPEC_STATUS_CODE_ADDTS_INVALID_PARAMS = 0x1, - TSPEC_STATUS_CODE_ADDTS_REQUEST_REFUSED = 0x3, - TSPEC_STATUS_CODE_UNSPECIFIED_QOS_RELATED_FAILURE = 0xC8, - TSPEC_STATUS_CODE_REQUESTED_REFUSED_POLICY_CONFIGURATION = 0xC9, - TSPEC_STATUS_CODE_INSUFFCIENT_BANDWIDTH = 0xCA, - TSPEC_STATUS_CODE_INVALID_PARAMS = 0xCB, - TSPEC_STATUS_CODE_DELTS_SENT = 0x30, - TSPEC_STATUS_CODE_DELTS_RECV = 0x31, -} TSPEC_STATUS_CODE; - -#define TSPEC_TSID_MASK 0xF -#define TSPEC_TSID_S 1 - -/* - * WMM/802.11e Tspec Element - */ -typedef PREPACK struct wmm_tspec_ie_t { - A_UINT8 elementId; - A_UINT8 len; - A_UINT8 oui[3]; - A_UINT8 ouiType; - A_UINT8 ouiSubType; - A_UINT8 version; - A_UINT16 tsInfo_info; - A_UINT8 tsInfo_reserved; - A_UINT16 nominalMSDU; - A_UINT16 maxMSDU; - A_UINT32 minServiceInt; - A_UINT32 maxServiceInt; - A_UINT32 inactivityInt; - A_UINT32 suspensionInt; - A_UINT32 serviceStartTime; - A_UINT32 minDataRate; - A_UINT32 meanDataRate; - A_UINT32 peakDataRate; - A_UINT32 maxBurstSize; - A_UINT32 delayBound; - A_UINT32 minPhyRate; - A_UINT16 sba; - A_UINT16 mediumTime; -} POSTPACK WMM_TSPEC_IE; - - -/* - * BEACON management packets - * - * octet timestamp[8] - * octet beacon interval[2] - * octet capability information[2] - * information element - * octet elemid - * octet length - * octet information[length] - */ - -#define IEEE80211_BEACON_INTERVAL(beacon) \ - ((beacon)[8] | ((beacon)[9] << 8)) -#define IEEE80211_BEACON_CAPABILITY(beacon) \ - ((beacon)[10] | ((beacon)[11] << 8)) - -#define IEEE80211_CAPINFO_ESS 0x0001 -#define IEEE80211_CAPINFO_IBSS 0x0002 -#define IEEE80211_CAPINFO_CF_POLLABLE 0x0004 -#define IEEE80211_CAPINFO_CF_POLLREQ 0x0008 -#define IEEE80211_CAPINFO_PRIVACY 0x0010 -#define IEEE80211_CAPINFO_SHORT_PREAMBLE 0x0020 -#define IEEE80211_CAPINFO_PBCC 0x0040 -#define IEEE80211_CAPINFO_CHNL_AGILITY 0x0080 -/* bits 8-9 are reserved */ -#define IEEE80211_CAPINFO_SHORT_SLOTTIME 0x0400 -#define IEEE80211_CAPINFO_APSD 0x0800 -/* bit 12 is reserved */ -#define IEEE80211_CAPINFO_DSSSOFDM 0x2000 -/* bits 14-15 are reserved */ - -/* - * Authentication Modes - */ - -enum ieee80211_authmode { - IEEE80211_AUTH_NONE = 0, - IEEE80211_AUTH_OPEN = 1, - IEEE80211_AUTH_SHARED = 2, - IEEE80211_AUTH_8021X = 3, - IEEE80211_AUTH_AUTO = 4, /* auto-select/accept */ - /* NB: these are used only for ioctls */ - IEEE80211_AUTH_WPA = 5, /* WPA/RSN w/ 802.1x */ - IEEE80211_AUTH_WPA_PSK = 6, /* WPA/RSN w/ PSK */ - IEEE80211_AUTH_WPA_CCKM = 7, /* WPA/RSN IE w/ CCKM */ -}; - -#define IEEE80211_PS_MAX_QUEUE 50 /*Maximum no of buffers that can be queues for PS*/ - -#include "athendpack.h" - -#endif /* _NET80211_IEEE80211_H_ */ diff --git a/drivers/net/wireless/ar6003/host/wlan/include/ieee80211_node.h b/drivers/net/wireless/ar6003/host/wlan/include/ieee80211_node.h deleted file mode 100644 index 70a8ada59f6b..000000000000 --- a/drivers/net/wireless/ar6003/host/wlan/include/ieee80211_node.h +++ /dev/null @@ -1,84 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== -#ifndef _IEEE80211_NODE_H_ -#define _IEEE80211_NODE_H_ - -/* - * Node locking definitions. - */ -#define IEEE80211_NODE_LOCK_INIT(_nt) A_MUTEX_INIT(&(_nt)->nt_nodelock) -#define IEEE80211_NODE_LOCK_DESTROY(_nt) if (A_IS_MUTEX_VALID(&(_nt)->nt_nodelock)) { \ - A_MUTEX_DELETE(&(_nt)->nt_nodelock); } - -#define IEEE80211_NODE_LOCK(_nt) A_MUTEX_LOCK(&(_nt)->nt_nodelock) -#define IEEE80211_NODE_UNLOCK(_nt) A_MUTEX_UNLOCK(&(_nt)->nt_nodelock) -#define IEEE80211_NODE_LOCK_BH(_nt) A_MUTEX_LOCK(&(_nt)->nt_nodelock) -#define IEEE80211_NODE_UNLOCK_BH(_nt) A_MUTEX_UNLOCK(&(_nt)->nt_nodelock) -#define IEEE80211_NODE_LOCK_ASSERT(_nt) - -/* - * Node reference counting definitions. - * - * ieee80211_node_initref initialize the reference count to 1 - * ieee80211_node_incref add a reference - * ieee80211_node_decref remove a reference - * ieee80211_node_dectestref remove a reference and return 1 if this - * is the last reference, otherwise 0 - * ieee80211_node_refcnt reference count for printing (only) - */ -#define ieee80211_node_initref(_ni) ((_ni)->ni_refcnt = 1) -#define ieee80211_node_incref(_ni) ((_ni)->ni_refcnt++) -#define ieee80211_node_decref(_ni) ((_ni)->ni_refcnt--) -#define ieee80211_node_dectestref(_ni) (((_ni)->ni_refcnt--) == 1) -#define ieee80211_node_refcnt(_ni) ((_ni)->ni_refcnt) - -#define IEEE80211_NODE_HASHSIZE 32 -/* simple hash is enough for variation of macaddr */ -#define IEEE80211_NODE_HASH(addr) \ - (((const A_UINT8 *)(addr))[IEEE80211_ADDR_LEN - 1] % \ - IEEE80211_NODE_HASHSIZE) - -/* - * Table of ieee80211_node instances. Each ieee80211com - * has at least one for holding the scan candidates. - * When operating as an access point or in ibss mode there - * is a second table for associated stations or neighbors. - */ -struct ieee80211_node_table { - void *nt_wmip; /* back reference */ - A_MUTEX_T nt_nodelock; /* on node table */ - struct bss *nt_node_first; /* information of all nodes */ - struct bss *nt_node_last; /* information of all nodes */ - struct bss *nt_hash[IEEE80211_NODE_HASHSIZE]; - const char *nt_name; /* for debugging */ - A_UINT32 nt_scangen; /* gen# for timeout scan */ - A_UINT32 nt_nodeAge; /* node aging time */ -#ifdef OS_ROAM_MANAGEMENT - A_UINT32 nt_si_gen; /* gen# for scan indication*/ -#endif -}; - -#define WLAN_NODE_INACT_TIMEOUT_MSEC 120000 -#define WLAN_NODE_INACT_CNT 15 // gModify.4 - -#endif /* _IEEE80211_NODE_H_ */ diff --git a/drivers/net/wireless/ar6003/host/wlan/src/makefile b/drivers/net/wireless/ar6003/host/wlan/src/makefile deleted file mode 100644 index 1ba034c4900e..000000000000 --- a/drivers/net/wireless/ar6003/host/wlan/src/makefile +++ /dev/null @@ -1,26 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2005-2007 Atheros Corporation. All rights reserved. -# -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# -#------------------------------------------------------------------------------ -#============================================================================== -# Author(s): ="Atheros" -#============================================================================== -!INCLUDE $(_MAKEENVROOT)\makefile.def - - - diff --git a/drivers/net/wireless/ar6003/host/wlan/src/wlan_node.c b/drivers/net/wireless/ar6003/host/wlan/src/wlan_node.c deleted file mode 100644 index a616ad705731..000000000000 --- a/drivers/net/wireless/ar6003/host/wlan/src/wlan_node.c +++ /dev/null @@ -1,644 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// IEEE 802.11 node handling support. -// -// Author(s): ="Atheros" -//============================================================================== -#include -#include -#include -#include -#define ATH_MODULE_NAME wlan -#include -#include "htc.h" -#include "htc_api.h" -#include -#include -#include -#include -#include -#ifdef P2P -#include -#endif /* P2P */ - -#define ATH_DEBUG_WLAN ATH_DEBUG_MAKE_MODULE_MASK(0) - -#ifdef DEBUG - -static ATH_DEBUG_MASK_DESCRIPTION wlan_debug_desc[] = { - { ATH_DEBUG_WLAN , "General WLAN Node Tracing"}, -}; - -ATH_DEBUG_INSTANTIATE_MODULE_VAR(wlan, - "wlan", - "WLAN Node Management", - ATH_DEBUG_MASK_DEFAULTS, - ATH_DEBUG_DESCRIPTION_COUNT(wlan_debug_desc), - wlan_debug_desc); - -#endif - -static bss_t * _ieee80211_find_node (struct ieee80211_node_table *nt, - const A_UINT8 *macaddr); - -bss_t * -wlan_node_alloc(struct ieee80211_node_table *nt, int wh_size) -{ - bss_t *ni; - - ni = A_MALLOC_NOWAIT(sizeof(bss_t)); - - if (ni != NULL) { - A_MEMZERO(ni, sizeof(bss_t)); - if (wh_size) - { - ni->ni_buf = A_MALLOC_NOWAIT(wh_size); - if (ni->ni_buf == NULL) { - A_FREE(ni); - ni = NULL; - return ni; - } else { - A_MEMZERO(ni->ni_buf, wh_size); - } - } - } else { - return ni; - } - - /* Make sure our lists are clean */ - ni->ni_list_next = NULL; - ni->ni_list_prev = NULL; - ni->ni_hash_next = NULL; - ni->ni_hash_prev = NULL; - - // - // ni_scangen never initialized before and during suspend/resume of winmobile, - // that some junk has been stored in this, due to this scan list didn't properly updated - // - ni->ni_scangen = 0; - -#ifdef OS_ROAM_MANAGEMENT - ni->ni_si_gen = 0; -#endif - - return ni; -} - -void -wlan_node_free(bss_t *ni) -{ - if (ni->ni_buf != NULL) { - A_FREE(ni->ni_buf); - ni->ni_buf = NULL; - } -#ifdef P2P - if (ni->p2p_dev) { - p2p_device_free(ni->p2p_dev); - } -#endif /* P2P */ - A_FREE(ni); - ni = NULL; -} - -void -wlan_node_update_timestamp(struct ieee80211_node_table *nt, bss_t *ni) -{ - ni->ni_tstamp = A_GET_MS(0); - ni->ni_actcnt = WLAN_NODE_INACT_CNT; - return; -} - -void -wlan_setup_node(struct ieee80211_node_table *nt, bss_t *ni, - const A_UINT8 *macaddr) -{ - int hash; - A_UINT32 timeoutValue = 0; - - A_MEMCPY(ni->ni_macaddr, macaddr, IEEE80211_ADDR_LEN); - hash = IEEE80211_NODE_HASH (macaddr); - ieee80211_node_initref (ni); /* mark referenced */ - - timeoutValue = nt->nt_nodeAge; - - wlan_node_update_timestamp(nt, ni); - - IEEE80211_NODE_LOCK_BH(nt); - - /* Insert at the end of the node list */ - ni->ni_list_next = NULL; - ni->ni_list_prev = nt->nt_node_last; - if(nt->nt_node_last != NULL) - { - nt->nt_node_last->ni_list_next = ni; - } - nt->nt_node_last = ni; - if(nt->nt_node_first == NULL) - { - nt->nt_node_first = ni; - } - - /* Insert into the hash list i.e. the bucket */ - if((ni->ni_hash_next = nt->nt_hash[hash]) != NULL) - { - nt->nt_hash[hash]->ni_hash_prev = ni; - } - ni->ni_hash_prev = NULL; - nt->nt_hash[hash] = ni; - - IEEE80211_NODE_UNLOCK_BH(nt); -} - -static bss_t * -_ieee80211_find_node(struct ieee80211_node_table *nt, - const A_UINT8 *macaddr) -{ - bss_t *ni = NULL; - int hash = 0; - - IEEE80211_NODE_LOCK_ASSERT(nt); - - hash = IEEE80211_NODE_HASH(macaddr); - - if (hash >= IEEE80211_NODE_HASHSIZE) - { - // overflow???? - return NULL; - } - - if (hash < 0) - { - // underflow???? - return NULL; - } - - if (NULL == nt) - { - return NULL; - } - - if (NULL == nt->nt_hash) - { - return NULL; - } - - if (NULL == nt->nt_hash[hash]) - { - return NULL; - } - - for(ni = nt->nt_hash[hash]; ni; ni = ni->ni_hash_next) { - if (IEEE80211_ADDR_EQ(ni->ni_macaddr, macaddr)) { - ieee80211_node_incref(ni); /* mark referenced */ - return ni; - } - } - return NULL; -} - -bss_t * -wlan_find_node(struct ieee80211_node_table *nt, const A_UINT8 *macaddr) -{ - bss_t *ni = NULL; - - if (NULL == nt || NULL == macaddr) - { - return ni; // NULL - } - - IEEE80211_NODE_LOCK(nt); - ni = _ieee80211_find_node(nt, macaddr); - IEEE80211_NODE_UNLOCK(nt); - return ni; -} - - -/* Update the buffer alone, not the entire node. - * This involves, - * 1) Freeing the buffer alone. - * 2) Allocating a new buffer - * 3) Update the node timestamp with the current time. - */ -A_STATUS -wlan_node_buf_update(struct ieee80211_node_table *nt, bss_t *ni, A_UINT32 len) -{ - IEEE80211_NODE_LOCK(nt); - - /* Free the ni_buf alone. - */ - if (ni->ni_buf != NULL) { - A_FREE(ni->ni_buf); - ni->ni_buf = NULL; - } - - /* Allocate ni_buf for the new length. - */ - if (len) { - ni->ni_buf = A_MALLOC_NOWAIT(len); - if (ni->ni_buf == NULL) { - return A_ERROR; - } else { - A_MEMZERO(ni->ni_buf, len); - } - } - - /* Update the Node's timestamp. - */ - wlan_node_update_timestamp(nt, ni); - - IEEE80211_NODE_UNLOCK(nt); - - return A_OK; -} - -/* - * Reclaim a node. If this is the last reference count then - * do the normal free work. Otherwise remove it from the node - * table and mark it gone by clearing the back-reference. - */ -void -wlan_node_reclaim(struct ieee80211_node_table *nt, bss_t *ni) -{ - IEEE80211_NODE_LOCK(nt); - - if(ni->ni_list_prev == NULL) - { - /* First in list so fix the list head */ - nt->nt_node_first = ni->ni_list_next; - } - else - { - ni->ni_list_prev->ni_list_next = ni->ni_list_next; - } - - if(ni->ni_list_next == NULL) - { - /* Last in list so fix list tail */ - nt->nt_node_last = ni->ni_list_prev; - } - else - { - ni->ni_list_next->ni_list_prev = ni->ni_list_prev; - } - - if(ni->ni_hash_prev == NULL) - { - /* First in list so fix the list head */ - int hash; - hash = IEEE80211_NODE_HASH(ni->ni_macaddr); - nt->nt_hash[hash] = ni->ni_hash_next; - } - else - { - ni->ni_hash_prev->ni_hash_next = ni->ni_hash_next; - } - - if(ni->ni_hash_next != NULL) - { - ni->ni_hash_next->ni_hash_prev = ni->ni_hash_prev; - } - wlan_node_free(ni); - - IEEE80211_NODE_UNLOCK(nt); -} - -static void -wlan_node_dec_free(bss_t *ni) -{ - if (ieee80211_node_dectestref(ni)) { - wlan_node_free(ni); - } -} - -void -wlan_free_allnodes(struct ieee80211_node_table *nt) -{ - bss_t *ni; - - while ((ni = nt->nt_node_first) != NULL) { - wlan_node_reclaim(nt, ni); - } -} - -void -wlan_iterate_nodes(struct ieee80211_node_table *nt, wlan_node_iter_func *f, - void *arg) -{ - bss_t *ni; - A_UINT32 gen; - - gen = ++nt->nt_scangen; - - IEEE80211_NODE_LOCK(nt); - for (ni = nt->nt_node_first; ni; ni = ni->ni_list_next) { - if (ni->ni_scangen != gen) { - ni->ni_scangen = gen; - (void) ieee80211_node_incref(ni); - (*f)(arg, ni); - wlan_node_dec_free(ni); - } - } - IEEE80211_NODE_UNLOCK(nt); -} - -/* - * Node table support. - */ -void -wlan_node_table_init(void *wmip, struct ieee80211_node_table *nt) -{ - int i; - - AR_DEBUG_PRINTF(ATH_DEBUG_WLAN, ("node table = 0x%lx\n", (unsigned long)nt)); - IEEE80211_NODE_LOCK_INIT(nt); - - A_REGISTER_MODULE_DEBUG_INFO(wlan); - - nt->nt_node_first = nt->nt_node_last = NULL; - for(i = 0; i < IEEE80211_NODE_HASHSIZE; i++) - { - nt->nt_hash[i] = NULL; - } - - nt->nt_wmip = wmip; - nt->nt_nodeAge = WLAN_NODE_INACT_TIMEOUT_MSEC; - - // - // nt_scangen never initialized before and during suspend/resume of winmobile, - // that some junk has been stored in this, due to this scan list didn't properly updated - // - nt->nt_scangen = 0; - -#ifdef OS_ROAM_MANAGEMENT - nt->nt_si_gen = 0; -#endif -} - -void -wlan_set_nodeage(struct ieee80211_node_table *nt, A_UINT32 nodeAge) -{ - nt->nt_nodeAge = nodeAge; - return; -} -void -wlan_refresh_inactive_nodes (struct ieee80211_node_table *nt) -{ - bss_t *bss, *nextBss; - A_UINT8 myBssid[IEEE80211_ADDR_LEN]; - A_UINT32 timeoutValue = 0; - A_UINT32 now = A_GET_MS(0); - timeoutValue = nt->nt_nodeAge; - - wmi_get_current_bssid(nt->nt_wmip, myBssid); - - bss = nt->nt_node_first; - while (bss != NULL) - { - nextBss = bss->ni_list_next; - if (A_MEMCMP(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0) - { -#ifdef P2P - if (((now - bss->ni_tstamp) > timeoutValue)) -#else - if (((now - bss->ni_tstamp) > timeoutValue) || --bss->ni_actcnt == 0) -#endif /* P2P */ - { - /* - * free up all but the current bss - if set - */ - wlan_node_reclaim(nt, bss); - } - } - bss = nextBss; - } -} - -void -wlan_node_table_cleanup(struct ieee80211_node_table *nt) -{ - wlan_free_allnodes(nt); - IEEE80211_NODE_LOCK_DESTROY(nt); -} - -bss_t * -wlan_find_Ssidnode (struct ieee80211_node_table *nt, A_UCHAR *pSsid, - A_UINT32 ssidLength, A_BOOL bIsWPA2, A_BOOL bMatchSSID) -{ - bss_t *ni = NULL; - A_UCHAR *pIESsid = NULL; - - IEEE80211_NODE_LOCK (nt); - - for (ni = nt->nt_node_first; ni; ni = ni->ni_list_next) { - pIESsid = ni->ni_cie.ie_ssid; - if ((pIESsid) && pIESsid[1] <= 32) { - - // Step 1 : Check SSID - if (0x00 == memcmp (pSsid, &pIESsid[2], ssidLength)) { - - // - // Step 2.1 : Check MatchSSID is TRUE, if so, return Matched SSID - // Profile, otherwise check whether WPA2 or WPA - // - if (TRUE == bMatchSSID) { - ieee80211_node_incref (ni); /* mark referenced */ - IEEE80211_NODE_UNLOCK (nt); - return ni; - } - - // Step 2 : if SSID matches, check WPA or WPA2 - if (TRUE == bIsWPA2 && NULL != ni->ni_cie.ie_rsn) { - ieee80211_node_incref (ni); /* mark referenced */ - IEEE80211_NODE_UNLOCK (nt); - return ni; - } - if (FALSE == bIsWPA2 && NULL != ni->ni_cie.ie_wpa) { - ieee80211_node_incref(ni); /* mark referenced */ - IEEE80211_NODE_UNLOCK (nt); - return ni; - } - } - } - } - - IEEE80211_NODE_UNLOCK (nt); - - return NULL; -} - -void -wlan_node_return (struct ieee80211_node_table *nt, bss_t *ni) -{ - IEEE80211_NODE_LOCK (nt); - wlan_node_dec_free (ni); - IEEE80211_NODE_UNLOCK (nt); -} - -void -wlan_node_remove_core (struct ieee80211_node_table *nt, bss_t *ni) -{ - if(ni->ni_list_prev == NULL) - { - /* First in list so fix the list head */ - nt->nt_node_first = ni->ni_list_next; - } - else - { - ni->ni_list_prev->ni_list_next = ni->ni_list_next; - } - - if(ni->ni_list_next == NULL) - { - /* Last in list so fix list tail */ - nt->nt_node_last = ni->ni_list_prev; - } - else - { - ni->ni_list_next->ni_list_prev = ni->ni_list_prev; - } - - if(ni->ni_hash_prev == NULL) - { - /* First in list so fix the list head */ - int hash; - hash = IEEE80211_NODE_HASH(ni->ni_macaddr); - nt->nt_hash[hash] = ni->ni_hash_next; - } - else - { - ni->ni_hash_prev->ni_hash_next = ni->ni_hash_next; - } - - if(ni->ni_hash_next != NULL) - { - ni->ni_hash_next->ni_hash_prev = ni->ni_hash_prev; - } -} - -bss_t * -wlan_node_remove(struct ieee80211_node_table *nt, A_UINT8 *bssid) -{ - bss_t *bss, *nextBss; - - IEEE80211_NODE_LOCK(nt); - - bss = nt->nt_node_first; - - while (bss != NULL) - { - nextBss = bss->ni_list_next; - - if (A_MEMCMP(bssid, bss->ni_macaddr, 6) == 0) - { - wlan_node_remove_core (nt, bss); - IEEE80211_NODE_UNLOCK(nt); - return bss; - } - - bss = nextBss; - } - - IEEE80211_NODE_UNLOCK(nt); - return NULL; -} - -bss_t * -wlan_find_matching_Ssidnode (struct ieee80211_node_table *nt, A_UCHAR *pSsid, - A_UINT32 ssidLength, A_UINT32 dot11AuthMode, A_UINT32 authMode, - A_UINT32 pairwiseCryptoType, A_UINT32 grpwiseCryptoTyp) -{ - bss_t *ni = NULL; - bss_t *best_ni = NULL; - A_UCHAR *pIESsid = NULL; - - IEEE80211_NODE_LOCK (nt); - - for (ni = nt->nt_node_first; ni; ni = ni->ni_list_next) { - pIESsid = ni->ni_cie.ie_ssid; - if (pIESsid[1] <= 32) { - - // Step 1 : Check SSID - if (0x00 == memcmp (pSsid, &pIESsid[2], ssidLength)) { - - if (ni->ni_cie.ie_capInfo & 0x10) - { - - if ((NULL != ni->ni_cie.ie_rsn) && (WMI_WPA2_PSK_AUTH == authMode)) - { - /* WPA2 */ - if (NULL == best_ni) - { - best_ni = ni; - } - else if (ni->ni_rssi > best_ni->ni_rssi) - { - best_ni = ni; - } - } - else if ((NULL != ni->ni_cie.ie_wpa) && (WMI_WPA_PSK_AUTH == authMode)) - { - /* WPA */ - if (NULL == best_ni) - { - best_ni = ni; - } - else if (ni->ni_rssi > best_ni->ni_rssi) - { - best_ni = ni; - } - } - else if (WEP_CRYPT == pairwiseCryptoType) - { - /* WEP */ - if (NULL == best_ni) - { - best_ni = ni; - } - else if (ni->ni_rssi > best_ni->ni_rssi) - { - best_ni = ni; - } - } - } - else - { - /* open AP */ - if ((OPEN_AUTH == authMode) && (NONE_CRYPT == pairwiseCryptoType)) - { - if (NULL == best_ni) - { - best_ni = ni; - } - else if (ni->ni_rssi > best_ni->ni_rssi) - { - best_ni = ni; - } - } - } - } - } - } - - IEEE80211_NODE_UNLOCK (nt); - - return best_ni; -} - diff --git a/drivers/net/wireless/ar6003/host/wlan/src/wlan_recv_beacon.c b/drivers/net/wireless/ar6003/host/wlan/src/wlan_recv_beacon.c deleted file mode 100644 index c0cbe39c3655..000000000000 --- a/drivers/net/wireless/ar6003/host/wlan/src/wlan_recv_beacon.c +++ /dev/null @@ -1,206 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// IEEE 802.11 input handling. -// -// Author(s): ="Atheros" -//============================================================================== - -#include "a_config.h" -#include "athdefs.h" -#include "a_types.h" -#include "a_osapi.h" -#include -#include -#include - -#define IEEE80211_VERIFY_LENGTH(_len, _minlen) do { \ - if ((_len) < (_minlen)) { \ - return A_EINVAL; \ - } \ -} while (0) - -#define IEEE80211_VERIFY_ELEMENT(__elem, __maxlen) do { \ - if ((__elem) == NULL) { \ - return A_EINVAL; \ - } \ - if ((__elem)[1] > (__maxlen)) { \ - return A_EINVAL; \ - } \ -} while (0) - - -/* unaligned little endian access */ -#define LE_READ_2(p) \ - ((A_UINT16) \ - ((((A_UINT8 *)(p))[0] ) | (((A_UINT8 *)(p))[1] << 8))) - -#define LE_READ_4(p) \ - ((A_UINT32) \ - ((((A_UINT8 *)(p))[0] ) | (((A_UINT8 *)(p))[1] << 8) | \ - (((A_UINT8 *)(p))[2] << 16) | (((A_UINT8 *)(p))[3] << 24))) - - -static int __inline -iswpaoui(const A_UINT8 *frm) -{ - return frm[1] > 3 && LE_READ_4(frm+2) == ((WPA_OUI_TYPE<<24)|WPA_OUI); -} - -static int __inline -iswmmoui(const A_UINT8 *frm) -{ - return frm[1] > 3 && LE_READ_4(frm+2) == ((WMM_OUI_TYPE<<24)|WMM_OUI); -} - -/* unused functions for now */ -#if 0 -static int __inline -iswmmparam(const A_UINT8 *frm) -{ - return frm[1] > 5 && frm[6] == WMM_PARAM_OUI_SUBTYPE; -} - -static int __inline -iswmminfo(const A_UINT8 *frm) -{ - return frm[1] > 5 && frm[6] == WMM_INFO_OUI_SUBTYPE; -} -#endif - -static int __inline -isatherosoui(const A_UINT8 *frm) -{ - return frm[1] > 3 && LE_READ_4(frm+2) == ((ATH_OUI_TYPE<<24)|ATH_OUI); -} - -static int __inline -iswscoui(const A_UINT8 *frm) -{ - return frm[1] > 3 && LE_READ_4(frm+2) == ((0x04<<24)|WPA_OUI); -} - -A_STATUS -wlan_parse_beacon(A_UINT8 *buf, int framelen, struct ieee80211_common_ie *cie) -{ - A_UINT8 *frm, *efrm; - A_UINT8 elemid_ssid = FALSE; - - frm = buf; - efrm = (A_UINT8 *) (frm + framelen); - - /* - * beacon/probe response frame format - * [8] time stamp - * [2] beacon interval - * [2] capability information - * [tlv] ssid - * [tlv] supported rates - * [tlv] country information - * [tlv] parameter set (FH/DS) - * [tlv] erp information - * [tlv] extended supported rates - * [tlv] WMM - * [tlv] WPA or RSN - * [tlv] Atheros Advanced Capabilities - */ - IEEE80211_VERIFY_LENGTH(efrm - frm, 12); - A_MEMZERO(cie, sizeof(*cie)); - - cie->ie_tstamp = frm; frm += 8; - cie->ie_beaconInt = A_LE2CPU16(*(A_UINT16 *)frm); frm += 2; - cie->ie_capInfo = A_LE2CPU16(*(A_UINT16 *)frm); frm += 2; - cie->ie_chan = 0; - - while (frm < efrm) { - switch (*frm) { - case IEEE80211_ELEMID_SSID: - if (!elemid_ssid) { - cie->ie_ssid = frm; - elemid_ssid = TRUE; - } - break; - case IEEE80211_ELEMID_RATES: - cie->ie_rates = frm; - break; - case IEEE80211_ELEMID_COUNTRY: - cie->ie_country = frm; - break; - case IEEE80211_ELEMID_FHPARMS: - break; - case IEEE80211_ELEMID_DSPARMS: - cie->ie_chan = frm[2]; - break; - case IEEE80211_ELEMID_TIM: - cie->ie_tim = frm; - break; - case IEEE80211_ELEMID_IBSSPARMS: - break; - case IEEE80211_ELEMID_XRATES: - cie->ie_xrates = frm; - break; - case IEEE80211_ELEMID_ERP: - if (frm[1] != 1) { - //A_PRINTF("Discarding ERP Element - Bad Len\n"); - return A_EINVAL; - } - cie->ie_erp = frm[2]; - break; - case IEEE80211_ELEMID_RSN: - /* - * Some APs, like TP-LINK, will report a RSN with zero unicast cipher suites in probe resp. - */ - if ((frm[1]<2+4+2) || (LE_READ_2(frm+2+2+4)==0)) { - return A_EINVAL; - } - cie->ie_rsn = frm; - break; - case IEEE80211_ELEMID_HTCAP_ANA: - cie->ie_htcap = frm; - break; - case IEEE80211_ELEMID_HTINFO_ANA: - cie->ie_htop = frm; - break; -#ifdef WAPI_ENABLE - case IEEE80211_ELEMID_WAPI: - cie->ie_wapi = frm; - break; -#endif - case IEEE80211_ELEMID_VENDOR: - if (iswpaoui(frm)) { - cie->ie_wpa = frm; - } else if (iswmmoui(frm)) { - cie->ie_wmm = frm; - } else if (isatherosoui(frm)) { - cie->ie_ath = frm; - } else if(iswscoui(frm)) { - cie->ie_wsc = frm; - } - break; - default: - break; - } - frm += frm[1] + 2; - } - IEEE80211_VERIFY_ELEMENT(cie->ie_rates, IEEE80211_RATE_MAXSIZE); - IEEE80211_VERIFY_ELEMENT(cie->ie_ssid, IEEE80211_NWID_LEN); - - return A_OK; -} diff --git a/drivers/net/wireless/ar6003/host/wlan/src/wlan_utils.c b/drivers/net/wireless/ar6003/host/wlan/src/wlan_utils.c deleted file mode 100644 index fc76132b36aa..000000000000 --- a/drivers/net/wireless/ar6003/host/wlan/src/wlan_utils.c +++ /dev/null @@ -1,62 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This module implements frequently used wlan utilies -// -// Author(s): ="Atheros" -//============================================================================== - -#include -#include -#include -#include - -/* - * converts ieee channel number to frequency - */ -A_UINT16 -wlan_ieee2freq(int chan) -{ - if (chan == 14) { - return 2484; - } - if (chan < 14) { /* 0-13 */ - return (2407 + (chan*5)); - } - if (chan < 27) { /* 15-26 */ - return (2512 + ((chan-15)*20)); - } - return (5000 + (chan*5)); -} - -/* - * Converts MHz frequency to IEEE channel number. - */ -A_UINT32 -wlan_freq2ieee(A_UINT16 freq) -{ - if (freq == 2484) - return 14; - if (freq < 2484) - return (freq - 2407) / 5; - if (freq < 5000) - return 15 + ((freq - 2512) / 20); - return (freq - 5000) / 5; -} diff --git a/drivers/net/wireless/ar6003/host/wmi/makefile b/drivers/net/wireless/ar6003/host/wmi/makefile deleted file mode 100644 index 1ba034c4900e..000000000000 --- a/drivers/net/wireless/ar6003/host/wmi/makefile +++ /dev/null @@ -1,26 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2005-2007 Atheros Corporation. All rights reserved. -# -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# -#------------------------------------------------------------------------------ -#============================================================================== -# Author(s): ="Atheros" -#============================================================================== -!INCLUDE $(_MAKEENVROOT)\makefile.def - - - diff --git a/drivers/net/wireless/ar6003/host/wmi/wmi.c b/drivers/net/wireless/ar6003/host/wmi/wmi.c deleted file mode 100644 index 7c33a2ac7b0e..000000000000 --- a/drivers/net/wireless/ar6003/host/wmi/wmi.c +++ /dev/null @@ -1,9173 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This module implements the hardware independent layer of the -// Wireless Module Interface (WMI) protocol. -// -// Author(s): ="Atheros" -//============================================================================== - -#include -#include -#include -#include -#include "htc.h" -#include "htc_api.h" -#include "wmi.h" -#include -#include -#include -#include -#include "dset_api.h" -#include "gpio_api.h" -#include "wmi_host.h" -#include "a_drv.h" -#include "a_drv_api.h" -#define ATH_MODULE_NAME wmi -#include "a_debug.h" -#include "dbglog_api.h" -#include "roaming.h" -#ifdef P2P -#include "p2p_api.h" -#endif /* P2P */ - -#define RSSI_AVE(avg, rssi, weight) \ - ((!(avg)) ? (rssi) : \ - ((((avg) * (weight)) + ((16 - (weight)) * (rssi))) / 16)) - -#define ATH_DEBUG_WMI ATH_DEBUG_MAKE_MODULE_MASK(0) - -#ifdef DEBUG - -static ATH_DEBUG_MASK_DESCRIPTION wmi_debug_desc[] = { - { ATH_DEBUG_WMI , "General WMI Tracing"}, -}; - -ATH_DEBUG_INSTANTIATE_MODULE_VAR(wmi, - "wmi", - "Wireless Module Interface", - ATH_DEBUG_MASK_DEFAULTS, - ATH_DEBUG_DESCRIPTION_COUNT(wmi_debug_desc), - wmi_debug_desc); - -#endif - -#ifndef REXOS -#define DBGARG _A_FUNCNAME_ -#define DBGFMT "%s() : " -#define DBG_WMI ATH_DEBUG_WMI -#define DBG_ERROR ATH_DEBUG_ERR -#define DBG_WMI2 ATH_DEBUG_WMI -#define A_DPRINTF AR_DEBUG_PRINTF -#endif - -#ifdef ATH_SUPPORT_DFS - -static A_STATUS -wmi_dfs_phyerr_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -static A_STATUS -wmi_dfs_attach_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -static A_STATUS -wmi_dfs_init_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -static A_STATUS -wmi_dfs_reset_delaylines_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -static A_STATUS -wmi_dfs_reset_radarq_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -static A_STATUS -wmi_dfs_reset_ar_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -static A_STATUS -wmi_dfs_reset_arq_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -static A_STATUS -wmi_dfs_set_dur_multiplier_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -static A_STATUS -wmi_dfs_set_bangradar_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -static A_STATUS -wmi_dfs_set_debuglevel_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -#endif /* ATH_SUPPORT_DFS */ - -#ifdef CONFIG_WLAN_RFKILL - -static A_STATUS wmi_rfkill_state_change_event(struct wmi_t *wmip, A_UINT8* datap,int len); -static A_STATUS wmi_rfkill_get_mode_cmd_event_rx(struct wmi_t *wmip, A_UINT8* datap,int len); -#endif /* CONFIG_WLAN_RFKILL */ - -static A_STATUS wmi_ready_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -static A_STATUS wmi_connect_event_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -static A_STATUS wmi_disconnect_event_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); - -static A_STATUS wmi_tkip_micerr_event_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -static A_STATUS wmi_bssInfo_event_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -static A_STATUS wmi_opt_frame_event_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -static A_STATUS wmi_pstream_timeout_event_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -static A_STATUS wmi_sync_point(struct wmi_t *wmip); - -static A_STATUS wmi_bitrate_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -static A_STATUS wmi_ratemask_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -static A_STATUS wmi_channelList_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -static A_STATUS wmi_regDomain_event_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -static A_STATUS wmi_txPwr_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -static A_STATUS wmi_neighborReport_event_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); - -static A_STATUS wmi_dset_open_req_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -#ifdef CONFIG_HOST_DSET_SUPPORT -static A_STATUS wmi_dset_close_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -static A_STATUS wmi_dset_data_req_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -#endif /* CONFIG_HOST_DSET_SUPPORT */ - - -static A_STATUS wmi_scanComplete_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -static A_STATUS wmi_errorEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -static A_STATUS wmi_statsEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -static A_STATUS wmi_rssiThresholdEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -static A_STATUS wmi_hbChallengeResp_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -static A_STATUS wmi_reportErrorEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -static A_STATUS wmi_cac_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -static A_STATUS wmi_channel_change_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -static A_STATUS wmi_roam_tbl_event_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -static A_STATUS wmi_roam_data_event_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -static A_STATUS wmi_get_wow_list_event_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -static A_STATUS -wmi_get_pmkid_list_event_rx(struct wmi_t *wmip, A_UINT8 *datap, A_UINT32 len); - -static A_STATUS -wmi_set_params_event_rx(struct wmi_t *wmip, A_UINT8 *datap, A_UINT32 len); - -static A_STATUS -wmi_wacGetInfoReply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -#ifdef CONFIG_HOST_GPIO_SUPPORT -static A_STATUS wmi_gpio_intr_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -static A_STATUS wmi_gpio_data_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -static A_STATUS wmi_gpio_ack_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -#endif /* CONFIG_HOST_GPIO_SUPPORT */ - -#ifdef CONFIG_HOST_TCMD_SUPPORT -static A_STATUS -wmi_tcmd_test_report_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -#endif - -static A_STATUS -wmi_txRetryErrEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -static A_STATUS -wmi_snrThresholdEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -static A_STATUS -wmi_lqThresholdEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -static A_BOOL -wmi_is_bitrate_index_valid(struct wmi_t *wmip, A_INT32 rateIndex); - -static A_STATUS -wmi_aplistEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -static A_STATUS -wmi_dbglog_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -static A_STATUS wmi_keepalive_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - -A_STATUS wmi_cmd_send_xtnd(struct wmi_t *wmip, void *osbuf, WMIX_COMMAND_ID cmdId, - WMI_SYNC_FLAG syncflag); - -A_UINT8 ar6000_get_upper_threshold(A_INT16 rssi, SQ_THRESHOLD_PARAMS *sq_thresh, A_UINT32 size); -A_UINT8 ar6000_get_lower_threshold(A_INT16 rssi, SQ_THRESHOLD_PARAMS *sq_thresh, A_UINT32 size); - -void wmi_cache_configure_rssithreshold(struct wmi_t *wmip, WMI_RSSI_THRESHOLD_PARAMS_CMD *rssiCmd); -void wmi_cache_configure_snrthreshold(struct wmi_t *wmip, WMI_SNR_THRESHOLD_PARAMS_CMD *snrCmd); -static A_STATUS wmi_send_rssi_threshold_params(struct wmi_t *wmip, - WMI_RSSI_THRESHOLD_PARAMS_CMD *rssiCmd); -static A_STATUS wmi_send_snr_threshold_params(struct wmi_t *wmip, - WMI_SNR_THRESHOLD_PARAMS_CMD *snrCmd); -#if defined(CONFIG_TARGET_PROFILE_SUPPORT) -static A_STATUS -wmi_prof_count_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -#endif /* CONFIG_TARGET_PROFILE_SUPPORT */ - -static A_STATUS wmi_pspoll_event_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -static A_STATUS wmi_dtimexpiry_event_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); - -static A_STATUS wmi_peer_node_event_rx (struct wmi_t *wmip, A_UINT8 *datap, - int len); -#ifdef ATH_AR6K_11N_SUPPORT -static A_STATUS wmi_addba_req_event_rx(struct wmi_t *, A_UINT8 *, int); -static A_STATUS wmi_addba_resp_event_rx(struct wmi_t *, A_UINT8 *, int); -static A_STATUS wmi_delba_req_event_rx(struct wmi_t *, A_UINT8 *, int); -static A_STATUS wmi_btcoex_config_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -static A_STATUS wmi_btcoex_stats_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); -#endif -static A_STATUS wmi_hci_event_rx(struct wmi_t *, A_UINT8 *, int); - -#ifdef WAPI_ENABLE -static A_STATUS wmi_wapi_rekey_event_rx(struct wmi_t *wmip, A_UINT8 *datap, - int len); -#endif - -static A_STATUS -wmi_report_assoc_req_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); - - -#if defined(UNDER_CE) || defined(WIN_NWF) -#if defined(NDIS51_MINIPORT) -unsigned int processDot11Hdr = 0; -#else -unsigned int processDot11Hdr = 1; -#endif -#else -extern unsigned int processDot11Hdr; -#endif - -int wps_enable; -static const A_INT32 wmi_rateTable[][2] = { - //{W/O SGI, with SGI} - {1000, 1000}, - {2000, 2000}, - {5500, 5500}, - {11000, 11000}, - {6000, 6000}, - {9000, 9000}, - {12000, 12000}, - {18000, 18000}, - {24000, 24000}, - {36000, 36000}, - {48000, 48000}, - {54000, 54000}, - {6500, 7200}, - {13000, 14400}, - {19500, 21700}, - {26000, 28900}, - {39000, 43300}, - {52000, 57800}, - {58500, 65000}, - {65000, 72200}, - {13500, 15000}, - {27000, 30000}, - {40500, 45000}, - {54000, 60000}, - {81000, 90000}, - {108000, 120000}, - {121500, 135000}, - {135000, 150000}, - {0, 0}}; - -#define MODE_A_SUPPORT_RATE_START ((A_INT32) 4) -#define MODE_A_SUPPORT_RATE_STOP ((A_INT32) 11) - -#define MODE_GONLY_SUPPORT_RATE_START MODE_A_SUPPORT_RATE_START -#define MODE_GONLY_SUPPORT_RATE_STOP MODE_A_SUPPORT_RATE_STOP - -#define MODE_B_SUPPORT_RATE_START ((A_INT32) 0) -#define MODE_B_SUPPORT_RATE_STOP ((A_INT32) 3) - -#define MODE_G_SUPPORT_RATE_START ((A_INT32) 0) -#define MODE_G_SUPPORT_RATE_STOP ((A_INT32) 11) - -#define MODE_GHT20_SUPPORT_RATE_START ((A_INT32) 0) -#define MODE_GHT20_SUPPORT_RATE_STOP ((A_INT32) 19) - -#define MAX_NUMBER_OF_SUPPORT_RATES (MODE_GHT20_SUPPORT_RATE_STOP + 1) - -/* 802.1d to AC mapping. Refer pg 57 of WMM-test-plan-v1.2 */ -const A_UINT8 up_to_ac[]= { - WMM_AC_BE, - WMM_AC_BK, - WMM_AC_BK, - WMM_AC_BE, - WMM_AC_VI, - WMM_AC_VI, - WMM_AC_VO, - WMM_AC_VO, - }; - -#include "athstartpack.h" - -/* This stuff is used when we want a simple layer-3 visibility */ -typedef PREPACK struct _iphdr { - A_UINT8 ip_ver_hdrlen; /* version and hdr length */ - A_UINT8 ip_tos; /* type of service */ - A_UINT16 ip_len; /* total length */ - A_UINT16 ip_id; /* identification */ - A_INT16 ip_off; /* fragment offset field */ -#define IP_DF 0x4000 /* dont fragment flag */ -#define IP_MF 0x2000 /* more fragments flag */ -#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ - A_UINT8 ip_ttl; /* time to live */ - A_UINT8 ip_p; /* protocol */ - A_UINT16 ip_sum; /* checksum */ - A_UINT8 ip_src[4]; /* source and dest address */ - A_UINT8 ip_dst[4]; -} POSTPACK iphdr; - -#include "athendpack.h" - -A_INT16 rssi_event_value = 0; -A_INT16 snr_event_value = 0; - -A_BOOL is_probe_ssid = FALSE; - -struct wmi_t *wmi_list[NUM_DEV]; -#ifdef P2P -static A_STATUS -wmi_p2p_goneg_result_event_rx(struct wmi_t *wmip, A_UINT8 *datap,A_UINT8 len); - -static A_STATUS wmi_p2p_goneg_req_rx(struct wmi_t *wmip, A_UINT8 *datap, - A_UINT8 len); -static A_STATUS wmi_p2p_invite_req_rx(struct wmi_t *wmip, A_UINT8 *datap, - A_UINT8 len); -static A_STATUS wmi_p2p_invite_rcvd_result_rx(struct wmi_t *wmip, - A_UINT8 *datap, A_UINT8 len); -static A_STATUS wmi_p2p_invite_sent_result_rx(struct wmi_t *wmip, A_UINT8 *datap, A_UINT8 len); -static A_STATUS wmi_p2p_prov_disc_resp_rx(struct wmi_t *wmip, - A_UINT8 *datap, A_UINT8 len); -static A_STATUS wmi_p2p_prov_disc_req_rx(struct wmi_t *wmip, - A_UINT8 *datap, A_UINT8 len); -static A_STATUS wmi_p2p_start_sdpd_event_rx(struct wmi_t *wmip, - A_UINT8 *datap, A_UINT8 len); -static A_STATUS wmi_p2p_sdpd_rx_event_rx(struct wmi_t *wmip, - A_UINT8 *datap, A_UINT8 len); -#endif /* P2P */ - -static struct wmi_priv_t *pWmiPriv = NULL; - -void * -wmi_init(void *devt, int devid) -{ - struct wmi_t *wmip; - - A_REGISTER_MODULE_DEBUG_INFO(wmi); - - wmip = A_MALLOC(sizeof(struct wmi_t)); - if (wmip == NULL) { - return (NULL); - } - A_MEMZERO(wmip, sizeof(*wmip)); - wmip->wmi_devt = devt; - wlan_node_table_init(wmip, &wmip->wmi_scan_table); - - wmip->wmi_powerMode = REC_POWER; - wmip->wmi_phyMode = WMI_11G_MODE; - - wmip->wmi_pair_crypto_type = NONE_CRYPT; - wmip->wmi_grp_crypto_type = NONE_CRYPT; - - A_MEMZERO(&wmip->wmi_ht_cap[A_BAND_24GHZ], sizeof(WMI_SET_HT_CAP_CMD)); - A_MEMZERO(&wmip->wmi_ht_cap[A_BAND_5GHZ], sizeof(WMI_SET_HT_CAP_CMD)); - - wmip->wmi_ht_cap[A_BAND_24GHZ].enable = 1; - wmip->wmi_ht_cap[A_BAND_5GHZ].enable = 1; - - wmip->wmi_ht_cap[A_BAND_24GHZ].short_GI_20MHz = 1; - wmip->wmi_ht_cap[A_BAND_5GHZ].short_GI_20MHz = 1; - - wmip->wmi_dev_index = devid; - wmi_list[devid] = wmip; - /*One time memory allocation for wmi virtual device structure*/ - if(pWmiPriv == NULL) { - pWmiPriv = A_MALLOC(sizeof(struct wmi_priv_t)); - if (pWmiPriv == NULL) { - return (NULL); - } - A_MEMZERO(pWmiPriv, sizeof(*pWmiPriv)); - A_MUTEX_INIT(&pWmiPriv->wmi_lock); - wmi_qos_state_init(NULL); - A_WMI_SET_NUMDATAENDPTS(wmip->wmi_devt, 1); - } - - return (wmip); -} - -void -wmi_qos_state_init(struct wmi_t *wmip) -{ - A_UINT8 i; - - if (pWmiPriv == NULL) { - return; - } - LOCK_WMI(pWmiPriv); - - /* Initialize QoS States */ - pWmiPriv->wmi_numQoSStream = 0; - - pWmiPriv->wmi_fatPipeExists = 0; - - for (i=0; i < WMM_NUM_AC; i++) { - pWmiPriv->wmi_streamExistsForAC[i]=0; - } - - UNLOCK_WMI(pWmiPriv); - -} - -void -wmi_set_control_ep(struct wmi_t * wmip, HTC_ENDPOINT_ID eid) -{ - A_ASSERT( eid != ENDPOINT_UNUSED); - pWmiPriv->wmi_endpoint_id = eid; -} - -HTC_ENDPOINT_ID -wmi_get_control_ep(struct wmi_t * wmip) -{ - return(pWmiPriv->wmi_endpoint_id); -} - -void -wmi_shutdown(struct wmi_t *wmip) -{ - - if (wmip != NULL) { - wlan_node_table_cleanup(&wmip->wmi_scan_table); - A_FREE(wmip); - wmip = NULL; - } - - if (pWmiPriv != NULL) { - if (A_IS_MUTEX_VALID(&pWmiPriv->wmi_lock)) { - A_MUTEX_DELETE(&pWmiPriv->wmi_lock); - } - A_FREE(pWmiPriv); - pWmiPriv = NULL; - } -} - -/* - * performs DIX to 802.3 encapsulation for transmit packets. - * uses passed in buffer. Returns buffer or NULL if failed. - * Assumes the entire DIX header is contigous and that there is - * enough room in the buffer for a 802.3 mac header and LLC+SNAP headers. - */ -A_STATUS -wmi_dix_2_dot3(struct wmi_t *wmip, void *osbuf) -{ - A_UINT8 *datap; - A_UINT16 typeorlen; - ATH_MAC_HDR macHdr; - ATH_LLC_SNAP_HDR *llcHdr; -#ifdef DIX_TX_OFFLOAD - /*Ethernet to DIX Conversion is offloaded to firmware */ - A_ASSERT(osbuf != NULL); - - if(A_NETBUF_HEADROOM(osbuf) < (sizeof(ATH_LLC_SNAP_HDR) + sizeof(WMI_DATA_HDR))) { - return A_NO_MEMORY; - } - - datap = A_NETBUF_DATA(osbuf); - typeorlen = *(A_UINT16 *)(datap + ATH_MAC_LEN + ATH_MAC_LEN); - - if(!IS_ETHERTYPE(A_BE2CPU16(typeorlen))) { - /*packet is already in 802.3 format - return success*/ - A_DPRINTF(DBG_WMI,(DBGFMT"packet in 802.3 format\n",DBGARG)); - return A_OK; - } - - /*Save MAC fields and lenght to be inserted later*/ - macHdr.typeOrLen = A_CPU2BE16(A_NETBUF_LEN(osbuf) - sizeof(ATH_MAC_HDR) + - sizeof(ATH_LLC_SNAP_HDR)); - - /*Make room for LLC+SNAP headers*/ - if(A_NETBUF_PUSH(osbuf, sizeof(ATH_LLC_SNAP_HDR)) != A_OK) { - return A_NO_MEMORY; - } - - datap = A_NETBUF_DATA(osbuf); - - llcHdr = (ATH_LLC_SNAP_HDR *)(datap); - llcHdr->etherType = macHdr.typeOrLen; - return (A_OK); -#else - - A_ASSERT(osbuf != NULL); - - if (A_NETBUF_HEADROOM(osbuf) < - (sizeof(ATH_LLC_SNAP_HDR) + sizeof(WMI_DATA_HDR))) - { - return A_NO_MEMORY; - } - - datap = A_NETBUF_DATA(osbuf); - - typeorlen = *(A_UINT16 *)(datap + ATH_MAC_LEN + ATH_MAC_LEN); - - if (!IS_ETHERTYPE(A_BE2CPU16(typeorlen))) { - /* - * packet is already in 802.3 format - return success - */ - A_DPRINTF(DBG_WMI, (DBGFMT "packet already 802.3\n", DBGARG)); - return (A_OK); - } - - /* - * Save mac fields and length to be inserted later - */ - A_MEMCPY(macHdr.dstMac, datap, ATH_MAC_LEN); - A_MEMCPY(macHdr.srcMac, datap + ATH_MAC_LEN, ATH_MAC_LEN); - macHdr.typeOrLen = A_CPU2BE16(A_NETBUF_LEN(osbuf) - sizeof(ATH_MAC_HDR) + - sizeof(ATH_LLC_SNAP_HDR)); - - /* - * Make room for LLC+SNAP headers - */ - if (A_NETBUF_PUSH(osbuf, sizeof(ATH_LLC_SNAP_HDR)) != A_OK) { - return A_NO_MEMORY; - } - datap = A_NETBUF_DATA(osbuf); - - A_MEMCPY(datap, &macHdr, sizeof (ATH_MAC_HDR)); - - llcHdr = (ATH_LLC_SNAP_HDR *)(datap + sizeof(ATH_MAC_HDR)); - llcHdr->dsap = 0xAA; - llcHdr->ssap = 0xAA; - llcHdr->cntl = 0x03; - llcHdr->orgCode[0] = 0x0; - llcHdr->orgCode[1] = 0x0; - llcHdr->orgCode[2] = 0x0; - llcHdr->etherType = typeorlen; - - return (A_OK); -#endif -} - -A_STATUS wmi_meta_add(struct wmi_t *wmip, void *osbuf, A_UINT8 *pVersion,void *pTxMetaS) -{ - switch(*pVersion){ - case 0: - return (A_OK); - case WMI_META_VERSION_1: - { - WMI_TX_META_V1 *pV1= NULL; - A_ASSERT(osbuf != NULL); - if (A_NETBUF_PUSH(osbuf, WMI_MAX_TX_META_SZ) != A_OK) { - return A_NO_MEMORY; - } - - pV1 = (WMI_TX_META_V1 *)A_NETBUF_DATA(osbuf); - /* the pktID is used in conjunction with txComplete messages - * allowing the target to notify which tx requests have been - * completed and how. */ - pV1->pktID = 0; - /* the ratePolicyID allows the host to specify which rate policy - * to use for transmitting this packet. 0 means use default behavior. */ - pV1->ratePolicyID = 0; - A_ASSERT(pVersion != NULL); - /* the version must be used to populate the meta field of the WMI_DATA_HDR */ - *pVersion = WMI_META_VERSION_1; - return (A_OK); - } -#ifdef CONFIG_CHECKSUM_OFFLOAD - case WMI_META_VERSION_2: - { - WMI_TX_META_V2 *pV2 ; - A_ASSERT(osbuf != NULL); - if (A_NETBUF_PUSH(osbuf, WMI_MAX_TX_META_SZ) != A_OK) { - return A_NO_MEMORY; - } - pV2 = (WMI_TX_META_V2 *)A_NETBUF_DATA(osbuf); - A_MEMCPY(pV2,(WMI_TX_META_V2 *)pTxMetaS,sizeof(WMI_TX_META_V2)); - return (A_OK); - } -#endif - default: - return (A_OK); - } -} - -/* Adds a WMI data header */ -A_STATUS -wmi_data_hdr_add(struct wmi_t *wmip, void *osbuf, A_UINT8 msgType, A_UINT32 flags, - WMI_DATA_HDR_DATA_TYPE data_type,A_UINT8 metaVersion, void *pTxMetaS) -{ - WMI_DATA_HDR *dtHdr; -// A_UINT8 metaVersion = 0; - A_STATUS status; - - A_ASSERT(osbuf != NULL); - - /* adds the meta data field after the wmi data hdr. If metaVersion - * is returns 0 then no meta field was added. */ - if ((status = wmi_meta_add(wmip, osbuf, &metaVersion,pTxMetaS)) != A_OK) { - return status; - } - - if (A_NETBUF_PUSH(osbuf, sizeof(WMI_DATA_HDR)) != A_OK) { - return A_NO_MEMORY; - } - - dtHdr = (WMI_DATA_HDR *)A_NETBUF_DATA(osbuf); - A_MEMZERO(dtHdr, sizeof(WMI_DATA_HDR)); - - WMI_DATA_HDR_SET_MSG_TYPE(dtHdr, msgType); - WMI_DATA_HDR_SET_DATA_TYPE(dtHdr, data_type); - - if (flags & WMI_DATA_HDR_FLAGS_MORE) { - WMI_DATA_HDR_SET_MORE_BIT(dtHdr); - } - if (flags & WMI_DATA_HDR_FLAGS_EOSP) { - WMI_DATA_HDR_SET_EOSP_BIT(dtHdr); - } - - WMI_DATA_HDR_SET_META(dtHdr, metaVersion); - //dtHdr->rssi = 0; - WMI_DATA_HDR_SET_DEVID(dtHdr, wmip->wmi_dev_index); - return (A_OK); -} - - -A_UINT8 wmi_implicit_create_pstream(struct wmi_t *wmip, void *osbuf, A_UINT32 layer2Priority, A_BOOL wmmEnabled) -{ - A_UINT8 *datap; - A_UINT8 trafficClass = WMM_AC_BE; - A_UINT16 ipType = IP_ETHERTYPE; - WMI_DATA_HDR *dtHdr; - A_BOOL streamExists = FALSE; - A_UINT8 userPriority; - A_UINT32 hdrsize, metasize; - ATH_LLC_SNAP_HDR *llcHdr; - - WMI_CREATE_PSTREAM_CMD cmd; - - A_ASSERT(osbuf != NULL); - - // - // Initialize header size - // - hdrsize = 0; - - datap = A_NETBUF_DATA(osbuf); - dtHdr = (WMI_DATA_HDR *)datap; - metasize = (WMI_DATA_HDR_GET_META(dtHdr))? WMI_MAX_TX_META_SZ : 0; - - if (!wmmEnabled) - { - /* If WMM is disabled all traffic goes as BE traffic */ - userPriority = 0; - } - else - { - if (processDot11Hdr) - { - hdrsize = A_ROUND_UP(sizeof(struct ieee80211_qosframe),sizeof(A_UINT32)); - llcHdr = (ATH_LLC_SNAP_HDR *)(datap + sizeof(WMI_DATA_HDR) + metasize + - hdrsize); - - - } - else - { - llcHdr = (ATH_LLC_SNAP_HDR *)(datap + sizeof(WMI_DATA_HDR) + metasize + - sizeof(ATH_MAC_HDR)); - } - - if (llcHdr->etherType == A_CPU2BE16(ipType)) - { - /* Extract the endpoint info from the TOS field in the IP header */ - - userPriority = wmi_determine_userPriority (((A_UINT8 *)llcHdr) + sizeof(ATH_LLC_SNAP_HDR),layer2Priority); - } - else - { - userPriority = layer2Priority & 0x7; - } - } - - trafficClass = convert_userPriority_to_trafficClass(userPriority); - - WMI_DATA_HDR_SET_UP(dtHdr, userPriority); - /* lower 3-bits are 802.1d priority */ - //dtHdr->info |= (userPriority & WMI_DATA_HDR_UP_MASK) << WMI_DATA_HDR_UP_SHIFT; - - LOCK_WMI(pWmiPriv); - streamExists = pWmiPriv->wmi_fatPipeExists; - UNLOCK_WMI(pWmiPriv); - - if (!(streamExists & (1 << trafficClass))) - { - - A_MEMZERO(&cmd, sizeof(cmd)); - cmd.trafficClass = trafficClass; - cmd.userPriority = userPriority; - cmd.inactivityInt = WMI_IMPLICIT_PSTREAM_INACTIVITY_INT; - - /* Implicit streams are created with TSID 0xFF */ - cmd.tsid = WMI_IMPLICIT_PSTREAM; - wmi_create_pstream_cmd(wmip, &cmd); - } - - return trafficClass; -} - -A_STATUS -wmi_dot11_hdr_add (struct wmi_t *wmip, void *osbuf, NETWORK_TYPE mode) -{ - A_UINT8 *datap; - A_UINT16 typeorlen; - ATH_MAC_HDR macHdr; - ATH_LLC_SNAP_HDR *llcHdr; - struct ieee80211_frame *wh; - A_UINT32 hdrsize; - - A_ASSERT(osbuf != NULL); - - if (A_NETBUF_HEADROOM(osbuf) < - (sizeof(struct ieee80211_qosframe) + sizeof(ATH_LLC_SNAP_HDR) + sizeof(WMI_DATA_HDR))) - { - return A_NO_MEMORY; - } - - datap = A_NETBUF_DATA(osbuf); - - typeorlen = *(A_UINT16 *)(datap + ATH_MAC_LEN + ATH_MAC_LEN); - - if (!IS_ETHERTYPE(A_BE2CPU16(typeorlen))) { -/* - * packet is already in 802.3 format - return success - */ - A_DPRINTF(DBG_WMI, (DBGFMT "packet already 802.3\n", DBGARG)); - goto AddDot11Hdr; - } - - /* - * Save mac fields and length to be inserted later - */ - A_MEMCPY(macHdr.dstMac, datap, ATH_MAC_LEN); - A_MEMCPY(macHdr.srcMac, datap + ATH_MAC_LEN, ATH_MAC_LEN); - macHdr.typeOrLen = A_CPU2BE16(A_NETBUF_LEN(osbuf) - sizeof(ATH_MAC_HDR) + - sizeof(ATH_LLC_SNAP_HDR)); - - // Remove the Ethernet hdr - A_NETBUF_PULL(osbuf, sizeof(ATH_MAC_HDR)); - /* - * Make room for LLC+SNAP headers - */ - if (A_NETBUF_PUSH(osbuf, sizeof(ATH_LLC_SNAP_HDR)) != A_OK) { - return A_NO_MEMORY; - } - datap = A_NETBUF_DATA(osbuf); - - llcHdr = (ATH_LLC_SNAP_HDR *)(datap); - llcHdr->dsap = 0xAA; - llcHdr->ssap = 0xAA; - llcHdr->cntl = 0x03; - llcHdr->orgCode[0] = 0x0; - llcHdr->orgCode[1] = 0x0; - llcHdr->orgCode[2] = 0x0; - llcHdr->etherType = typeorlen; - -AddDot11Hdr: - /* Make room for 802.11 hdr */ - if (wmip->wmi_is_wmm_enabled) - { - hdrsize = A_ROUND_UP(sizeof(struct ieee80211_qosframe),sizeof(A_UINT32)); - if (A_NETBUF_PUSH(osbuf, hdrsize) != A_OK) - { - return A_NO_MEMORY; - } - wh = (struct ieee80211_frame *) A_NETBUF_DATA(osbuf); - wh->i_fc[0] = IEEE80211_FC0_SUBTYPE_QOS; - } - else - { - hdrsize = A_ROUND_UP(sizeof(struct ieee80211_frame),sizeof(A_UINT32)); - if (A_NETBUF_PUSH(osbuf, hdrsize) != A_OK) - { - return A_NO_MEMORY; - } - wh = (struct ieee80211_frame *) A_NETBUF_DATA(osbuf); - wh->i_fc[0] = IEEE80211_FC0_SUBTYPE_DATA; - } - /* Setup the SA & DA */ - IEEE80211_ADDR_COPY(wh->i_addr2, macHdr.srcMac); - - if (mode == INFRA_NETWORK) { - IEEE80211_ADDR_COPY(wh->i_addr3, macHdr.dstMac); - } - else if (mode == ADHOC_NETWORK) { - IEEE80211_ADDR_COPY(wh->i_addr1, macHdr.dstMac); - } - - return (A_OK); -} - -A_STATUS -wmi_dot11_hdr_remove(struct wmi_t *wmip, void *osbuf) -{ - A_UINT8 *datap; - struct ieee80211_frame *pwh,wh; - A_UINT8 type,subtype; - ATH_LLC_SNAP_HDR *llcHdr; - ATH_MAC_HDR macHdr; - A_UINT32 hdrsize; - - A_ASSERT(osbuf != NULL); - datap = A_NETBUF_DATA(osbuf); - - pwh = (struct ieee80211_frame *)datap; - type = pwh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; - subtype = pwh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; - - A_MEMCPY((A_UINT8 *)&wh, datap, sizeof(struct ieee80211_frame)); - - /* strip off the 802.11 hdr*/ - if (subtype == IEEE80211_FC0_SUBTYPE_QOS) { - hdrsize = A_ROUND_UP(sizeof(struct ieee80211_qosframe),sizeof(A_UINT32)); - A_NETBUF_PULL(osbuf, hdrsize); - } else if (subtype == IEEE80211_FC0_SUBTYPE_DATA) { - A_NETBUF_PULL(osbuf, sizeof(struct ieee80211_frame)); - } - - datap = A_NETBUF_DATA(osbuf); - llcHdr = (ATH_LLC_SNAP_HDR *)(datap); - - macHdr.typeOrLen = llcHdr->etherType; - A_MEMZERO(macHdr.dstMac, sizeof(macHdr.dstMac)); - A_MEMZERO(macHdr.srcMac, sizeof(macHdr.srcMac)); - - switch (wh.i_fc[1] & IEEE80211_FC1_DIR_MASK) { - case IEEE80211_FC1_DIR_NODS: - IEEE80211_ADDR_COPY(macHdr.dstMac, wh.i_addr1); - IEEE80211_ADDR_COPY(macHdr.srcMac, wh.i_addr2); - break; - case IEEE80211_FC1_DIR_TODS: - IEEE80211_ADDR_COPY(macHdr.dstMac, wh.i_addr3); - IEEE80211_ADDR_COPY(macHdr.srcMac, wh.i_addr2); - break; - case IEEE80211_FC1_DIR_FROMDS: - IEEE80211_ADDR_COPY(macHdr.dstMac, wh.i_addr1); - IEEE80211_ADDR_COPY(macHdr.srcMac, wh.i_addr3); - break; - case IEEE80211_FC1_DIR_DSTODS: - break; - } - - // Remove the LLC Hdr. - A_NETBUF_PULL(osbuf, sizeof(ATH_LLC_SNAP_HDR)); - - // Insert the ATH MAC hdr. - - A_NETBUF_PUSH(osbuf, sizeof(ATH_MAC_HDR)); - datap = A_NETBUF_DATA(osbuf); - - A_MEMCPY (datap, &macHdr, sizeof(ATH_MAC_HDR)); - - return A_OK; -} - -/* - * performs 802.3 to DIX encapsulation for received packets. - * Assumes the entire 802.3 header is contigous. - */ -A_STATUS -wmi_dot3_2_dix(void *osbuf) -{ - A_UINT8 *datap; - ATH_MAC_HDR macHdr; - ATH_LLC_SNAP_HDR *llcHdr; - - A_ASSERT(osbuf != NULL); - - datap = A_NETBUF_DATA(osbuf); - - A_MEMCPY(&macHdr, datap, sizeof(ATH_MAC_HDR)); - llcHdr = (ATH_LLC_SNAP_HDR *)(datap + sizeof(ATH_MAC_HDR)); - macHdr.typeOrLen = llcHdr->etherType; - - if (A_NETBUF_PULL(osbuf, sizeof(ATH_LLC_SNAP_HDR)) != A_OK) { - return A_NO_MEMORY; - } - - datap = A_NETBUF_DATA(osbuf); - - A_MEMCPY(datap, &macHdr, sizeof (ATH_MAC_HDR)); - - return (A_OK); -} - -/* - * Removes a WMI data header - */ -A_STATUS -wmi_data_hdr_remove(struct wmi_t *wmip, void *osbuf) -{ - A_ASSERT(osbuf != NULL); - - return (A_NETBUF_PULL(osbuf, sizeof(WMI_DATA_HDR))); -} - -void -wmi_iterate_nodes(struct wmi_t *wmip, wlan_node_iter_func *f, void *arg) -{ - wlan_iterate_nodes(&wmip->wmi_scan_table, f, arg); -} - -static A_STATUS -wmi_report_wmm_params(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_REPORT_WMM_PARAMS_EVENT *ev; - A_UINT8 i; - - if (len < sizeof(*ev)) { - return A_EINVAL; - } - ev = (WMI_REPORT_WMM_PARAMS_EVENT *)datap; - - A_PRINTF("WMM params\n"); - for (i = 0; i < 4; i++) { - A_PRINTF("AC %d, ACM %d, AIFSN %d, CWmin %d, CWmax %d, TXOPlimit %d\n", i, - ev->wmm_params[i].acm, - ev->wmm_params[i].aifsn, - ev->wmm_params[i].logcwmin, - ev->wmm_params[i].logcwmax, - ev->wmm_params[i].txopLimit); - } - - return A_OK; -} - -/* - * WMI Extended Event received from Target. - */ -A_STATUS -wmi_control_rx_xtnd(struct wmi_t *wmip, void *osbuf) -{ - WMIX_CMD_HDR *cmd; - A_UINT16 id; - A_UINT8 *datap; - A_UINT32 len; - A_STATUS status = A_OK; - - if (A_NETBUF_LEN(osbuf) < sizeof(WMIX_CMD_HDR)) { - A_DPRINTF(DBG_WMI, (DBGFMT "bad packet 1\n", DBGARG)); - wmip->wmi_stats.cmd_len_err++; - return A_ERROR; - } - - cmd = (WMIX_CMD_HDR *)A_NETBUF_DATA(osbuf); - id = cmd->commandId; - - if (A_NETBUF_PULL(osbuf, sizeof(WMIX_CMD_HDR)) != A_OK) { - A_DPRINTF(DBG_WMI, (DBGFMT "bad packet 2\n", DBGARG)); - wmip->wmi_stats.cmd_len_err++; - return A_ERROR; - } - - datap = A_NETBUF_DATA(osbuf); - len = A_NETBUF_LEN(osbuf); - - switch (id) { - case (WMIX_DSETOPENREQ_EVENTID): - status = wmi_dset_open_req_rx(wmip, datap, len); - break; -#ifdef CONFIG_HOST_DSET_SUPPORT - case (WMIX_DSETCLOSE_EVENTID): - status = wmi_dset_close_rx(wmip, datap, len); - break; - case (WMIX_DSETDATAREQ_EVENTID): - status = wmi_dset_data_req_rx(wmip, datap, len); - break; -#endif /* CONFIG_HOST_DSET_SUPPORT */ -#ifdef CONFIG_HOST_GPIO_SUPPORT - case (WMIX_GPIO_INTR_EVENTID): - wmi_gpio_intr_rx(wmip, datap, len); - break; - case (WMIX_GPIO_DATA_EVENTID): - wmi_gpio_data_rx(wmip, datap, len); - break; - case (WMIX_GPIO_ACK_EVENTID): - wmi_gpio_ack_rx(wmip, datap, len); - break; -#endif /* CONFIG_HOST_GPIO_SUPPORT */ - case (WMIX_HB_CHALLENGE_RESP_EVENTID): - wmi_hbChallengeResp_rx(wmip, datap, len); - break; - case (WMIX_DBGLOG_EVENTID): - wmi_dbglog_event_rx(wmip, datap, len); - break; -#if defined(CONFIG_TARGET_PROFILE_SUPPORT) - case (WMIX_PROF_COUNT_EVENTID): - wmi_prof_count_rx(wmip, datap, len); - break; -#endif /* CONFIG_TARGET_PROFILE_SUPPORT */ - default: - A_DPRINTF(DBG_WMI|DBG_ERROR, - (DBGFMT "Unknown id 0x%x\n", DBGARG, id)); - wmip->wmi_stats.cmd_id_err++; - status = A_ERROR; - break; - } - - return status; -} - -/* - * Control Path - */ -A_UINT32 cmdRecvNum; - -A_STATUS -wmi_control_rx(struct wmi_t *wmip, void *osbuf) -{ - WMI_CMD_HDR *cmd; - A_UINT16 id; - A_UINT8 *datap; - A_UINT32 len, i, loggingReq; - A_STATUS status = A_OK; - - A_ASSERT(osbuf != NULL); - if (A_NETBUF_LEN(osbuf) < sizeof(WMI_CMD_HDR)) { - A_NETBUF_FREE(osbuf); - A_DPRINTF(DBG_WMI, (DBGFMT "bad packet 1\n", DBGARG)); - wmip->wmi_stats.cmd_len_err++; - return A_ERROR; - } - - cmd = (WMI_CMD_HDR *)A_NETBUF_DATA(osbuf); - id = cmd->commandId; - - if (A_NETBUF_PULL(osbuf, sizeof(WMI_CMD_HDR)) != A_OK) { - A_NETBUF_FREE(osbuf); - A_DPRINTF(DBG_WMI, (DBGFMT "bad packet 2\n", DBGARG)); - wmip->wmi_stats.cmd_len_err++; - return A_ERROR; - } - - datap = A_NETBUF_DATA(osbuf); - len = A_NETBUF_LEN(osbuf); - - loggingReq = 0; - - ar6000_get_driver_cfg(wmip->wmi_devt, - AR6000_DRIVER_CFG_LOG_RAW_WMI_MSGS, - &loggingReq); - - if(loggingReq) { - AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("WMI %d \n",id)); - AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("WMI devid %d \n",wmip->wmi_dev_index)); - AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("WMI recv, MsgNo %d : ", cmdRecvNum)); - for(i = 0; i < len; i++) - AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("%x ", datap[i])); - AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("\n")); - } - - LOCK_WMI(pWmiPriv); - cmdRecvNum++; - UNLOCK_WMI(pWmiPriv); - - switch (id) { - case (WMI_GET_BITRATE_CMDID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_GET_BITRATE_CMDID\n", DBGARG)); - status = wmi_bitrate_reply_rx(wmip, datap, len); - break; - case (WMI_GET_CHANNEL_LIST_CMDID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_GET_CHANNEL_LIST_CMDID\n", DBGARG)); - status = wmi_channelList_reply_rx(wmip, datap, len); - break; - case (WMI_GET_TX_PWR_CMDID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_GET_TX_PWR_CMDID\n", DBGARG)); - status = wmi_txPwr_reply_rx(wmip, datap, len); - break; - case (WMI_READY_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_READY_EVENTID\n", DBGARG)); - status = wmi_ready_event_rx(wmip, datap, len); - A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len); - A_WMI_DBGLOG_INIT_DONE(wmip->wmi_devt); - break; - case (WMI_CONNECT_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_CONNECT_EVENTID\n", DBGARG)); - status = wmi_connect_event_rx(wmip, datap, len); - A_WMI_SEND_GENERIC_EVENT_TO_APP(wmip->wmi_devt, id, datap, len); - break; - case (WMI_DISCONNECT_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_DISCONNECT_EVENTID\n", DBGARG)); - status = wmi_disconnect_event_rx(wmip, datap, len); - A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len); - break; - case (WMI_PEER_NODE_EVENTID): - A_DPRINTF (DBG_WMI, (DBGFMT "WMI_PEER_NODE_EVENTID\n", DBGARG)); - status = wmi_peer_node_event_rx(wmip, datap, len); - A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len); - break; - case (WMI_TKIP_MICERR_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_TKIP_MICERR_EVENTID\n", DBGARG)); - status = wmi_tkip_micerr_event_rx(wmip, datap, len); - break; - case (WMI_BSSINFO_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_BSSINFO_EVENTID\n", DBGARG)); - { - /* - * convert WMI_BSS_INFO_HDR2 to WMI_BSS_INFO_HDR - * Take a local copy of the WMI_BSS_INFO_HDR2 from the wmi buffer - * and reconstruct the WMI_BSS_INFO_HDR in its place - */ - WMI_BSS_INFO_HDR2 bih2; - WMI_BSS_INFO_HDR *bih; - A_UINT16 devBitMap; - A_UINT16 dev_id = 0; - struct wmi_t *wmiptr; - A_MEMCPY(&bih2, datap, sizeof(WMI_BSS_INFO_HDR2)); - - A_NETBUF_PUSH(osbuf, 4); - datap = A_NETBUF_DATA(osbuf); - len = A_NETBUF_LEN(osbuf); - bih = (WMI_BSS_INFO_HDR *)datap; - - bih->channel = bih2.channel; - bih->frameType = bih2.frameType; - bih->snr = bih2.snr; - bih->rssi = bih2.snr - 95; - bih->ieMask = bih2.ieMask; - A_MEMCPY(bih->bssid, bih2.bssid, ATH_MAC_LEN); - /* Deliever the BSS info event based on the device id set - * by target - */ - devBitMap = (bih2.ieMask >> 12); - do { - - if(devBitMap & 1) { - wmiptr = wmi_list[dev_id]; - status = wmi_bssInfo_event_rx(wmiptr, datap, len); - A_WMI_SEND_GENERIC_EVENT_TO_APP(wmiptr->wmi_devt, id, datap, len); - } - devBitMap = (devBitMap >> 1); - dev_id++; - }while(devBitMap); - } - break; - case (WMI_REGDOMAIN_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_REGDOMAIN_EVENTID\n", DBGARG)); - status = wmi_regDomain_event_rx(wmip, datap, len); - break; - case (WMI_PSTREAM_TIMEOUT_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_PSTREAM_TIMEOUT_EVENTID\n", DBGARG)); - status = wmi_pstream_timeout_event_rx(wmip, datap, len); - /* pstreams are fatpipe abstractions that get implicitly created. - * User apps only deal with thinstreams. creation of a thinstream - * by the user or data traffic flow in an AC triggers implicit - * pstream creation. Do we need to send this event to App..? - * no harm in sending it. - */ - A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len); - break; - case (WMI_NEIGHBOR_REPORT_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_NEIGHBOR_REPORT_EVENTID\n", DBGARG)); - status = wmi_neighborReport_event_rx(wmip, datap, len); - break; - case (WMI_SCAN_COMPLETE_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_SCAN_COMPLETE_EVENTID\n", DBGARG)); - status = wmi_scanComplete_rx(wmip, datap, len); - A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len); - break; - case (WMI_CMDERROR_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_CMDERROR_EVENTID\n", DBGARG)); - status = wmi_errorEvent_rx(wmip, datap, len); - break; - case (WMI_REPORT_STATISTICS_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_REPORT_STATISTICS_EVENTID\n", DBGARG)); - status = wmi_statsEvent_rx(wmip, datap, len); - break; - case (WMI_RSSI_THRESHOLD_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_RSSI_THRESHOLD_EVENTID\n", DBGARG)); - status = wmi_rssiThresholdEvent_rx(wmip, datap, len); - break; - case (WMI_ERROR_REPORT_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_ERROR_REPORT_EVENTID\n", DBGARG)); - status = wmi_reportErrorEvent_rx(wmip, datap, len); - A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len); - break; - case (WMI_OPT_RX_FRAME_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_OPT_RX_FRAME_EVENTID\n", DBGARG)); - status = wmi_opt_frame_event_rx(wmip, datap, len); - break; - case (WMI_REPORT_ROAM_TBL_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_REPORT_ROAM_TBL_EVENTID\n", DBGARG)); - status = wmi_roam_tbl_event_rx(wmip, datap, len); - break; - case (WMI_EXTENSION_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_EXTENSION_EVENTID\n", DBGARG)); - status = wmi_control_rx_xtnd(wmip, osbuf); - break; - case (WMI_CAC_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_CAC_EVENTID\n", DBGARG)); - status = wmi_cac_event_rx(wmip, datap, len); - break; - case (WMI_CHANNEL_CHANGE_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_CHANNEL_CHANGE_EVENTID\n", DBGARG)); - status = wmi_channel_change_event_rx(wmip, datap, len); - break; - case (WMI_REPORT_ROAM_DATA_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_REPORT_ROAM_DATA_EVENTID\n", DBGARG)); - status = wmi_roam_data_event_rx(wmip, datap, len); - break; -#ifdef CONFIG_HOST_TCMD_SUPPORT - case (WMI_TEST_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_TEST_EVENTID\n", DBGARG)); - status = wmi_tcmd_test_report_rx(wmip, datap, len); - break; -#endif - case (WMI_GET_FIXRATES_CMDID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_GET_FIXRATES_CMDID\n", DBGARG)); - status = wmi_ratemask_reply_rx(wmip, datap, len); - break; - case (WMI_TX_RETRY_ERR_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_TX_RETRY_ERR_EVENTID\n", DBGARG)); - status = wmi_txRetryErrEvent_rx(wmip, datap, len); - A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len); - break; - case (WMI_SNR_THRESHOLD_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_SNR_THRESHOLD_EVENTID\n", DBGARG)); - status = wmi_snrThresholdEvent_rx(wmip, datap, len); - break; - case (WMI_LQ_THRESHOLD_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_LQ_THRESHOLD_EVENTID\n", DBGARG)); - status = wmi_lqThresholdEvent_rx(wmip, datap, len); - A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len); - break; - case (WMI_APLIST_EVENTID): - AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("Received APLIST Event\n")); - status = wmi_aplistEvent_rx(wmip, datap, len); - break; - case (WMI_GET_KEEPALIVE_CMDID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_GET_KEEPALIVE_CMDID\n", DBGARG)); - status = wmi_keepalive_reply_rx(wmip, datap, len); - break; - case (WMI_GET_WOW_LIST_EVENTID): - status = wmi_get_wow_list_event_rx(wmip, datap, len); - break; - case (WMI_GET_PMKID_LIST_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_GET_PMKID_LIST Event\n", DBGARG)); - status = wmi_get_pmkid_list_event_rx(wmip, datap, len); - break; - case (WMI_PSPOLL_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_PSPOLL_EVENT\n", DBGARG)); - status = wmi_pspoll_event_rx(wmip, datap, len); - break; - case (WMI_DTIMEXPIRY_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_DTIMEXPIRY_EVENT\n", DBGARG)); - status = wmi_dtimexpiry_event_rx(wmip, datap, len); - break; - case (WMI_SET_PARAMS_REPLY_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_SET_PARAMS_REPLY Event\n", DBGARG)); - status = wmi_set_params_event_rx(wmip, datap, len); - break; -#ifdef ATH_AR6K_11N_SUPPORT - case (WMI_ADDBA_REQ_EVENTID): - status = wmi_addba_req_event_rx(wmip, datap, len); - break; - case (WMI_ADDBA_RESP_EVENTID): - status = wmi_addba_resp_event_rx(wmip, datap, len); - break; - case (WMI_DELBA_REQ_EVENTID): - status = wmi_delba_req_event_rx(wmip, datap, len); - break; - case (WMI_REPORT_BTCOEX_CONFIG_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_BTCOEX_CONFIG_EVENTID", DBGARG)); - status = wmi_btcoex_config_event_rx(wmip, datap, len); - break; - case (WMI_REPORT_BTCOEX_STATS_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_BTCOEX_STATS_EVENTID", DBGARG)); - status = wmi_btcoex_stats_event_rx(wmip, datap, len); - break; -#endif - case (WMI_TX_COMPLETE_EVENTID): - { - int index; - TX_COMPLETE_MSG_V1 *pV1; - WMI_TX_COMPLETE_EVENT *pEv = (WMI_TX_COMPLETE_EVENT *)datap; - A_PRINTF("comp: %d %d %d\n", pEv->numMessages, pEv->msgLen, pEv->msgType); - - for(index = 0 ; index < pEv->numMessages ; index++) { - pV1 = (TX_COMPLETE_MSG_V1 *)(datap + sizeof(WMI_TX_COMPLETE_EVENT) + index*sizeof(TX_COMPLETE_MSG_V1)); - A_PRINTF("msg: %d %d %d %d\n", pV1->status, pV1->pktID, pV1->rateIdx, pV1->ackFailures); - } - } - break; - case (WMI_HCI_EVENT_EVENTID): - status = wmi_hci_event_rx(wmip, datap, len); - break; -#ifdef WAPI_ENABLE - case (WMI_WAPI_REKEY_EVENTID): - A_DPRINTF(DBG_WMI, (DBGFMT "WMI_WAPI_REKEY_EVENTID", DBGARG)); - status = wmi_wapi_rekey_event_rx(wmip, datap, len); - break; -#endif - -#ifdef ATH_SUPPORT_DFS - case WMI_DFS_HOST_ATTACH_EVENTID: - status = wmi_dfs_attach_event_rx(wmip, datap, len); - break; - case WMI_DFS_HOST_INIT_EVENTID: - status = wmi_dfs_init_event_rx(wmip, datap, len); - break; - case WMI_DFS_RESET_DELAYLINES_EVENTID: - status = wmi_dfs_reset_delaylines_event_rx(wmip, datap, len); - break; - case WMI_DFS_RESET_RADARQ_EVENTID: - status = wmi_dfs_reset_radarq_event_rx(wmip, datap, len); - break; - case WMI_DFS_RESET_AR_EVENTID: - status = wmi_dfs_reset_ar_event_rx(wmip, datap, len); - break; - case WMI_DFS_RESET_ARQ_EVENTID: - status = wmi_dfs_reset_arq_event_rx(wmip, datap, len); - break; - case WMI_DFS_SET_DUR_MULTIPLIER_EVENTID: - status = wmi_dfs_set_dur_multiplier_event_rx(wmip, datap, len); - break; - case WMI_DFS_SET_BANGRADAR_EVENTID: - status = wmi_dfs_set_bangradar_event_rx(wmip, datap, len); - break; - case WMI_DFS_SET_DEBUGLEVEL_EVENTID: - status = wmi_dfs_set_debuglevel_event_rx(wmip, datap, len); - break; - case WMI_DFS_PHYERR_EVENTID: - status = wmi_dfs_phyerr_event_rx(wmip, datap, len); - break; -#endif /* ATH_SUPPORT_DFS */ -#ifdef P2P - case WMI_P2P_GO_NEG_RESULT_EVENTID: - status = wmi_p2p_goneg_result_event_rx(wmip, datap, len) ; - break; - - case WMI_P2P_GO_NEG_REQ_EVENTID: - status = wmi_p2p_goneg_req_rx(wmip, datap, len); - break; - - case WMI_P2P_INVITE_SENT_RESULT_EVENTID: - status = wmi_p2p_invite_sent_result_rx(wmip, datap, len); - break; - - case WMI_P2P_INVITE_REQ_EVENTID: - status = wmi_p2p_invite_req_rx(wmip, datap, len); - break; - - case WMI_P2P_INVITE_RCVD_RESULT_EVENTID: - status = wmi_p2p_invite_rcvd_result_rx(wmip, datap, len); - break; - - case WMI_P2P_PROV_DISC_REQ_EVENTID: - status = wmi_p2p_prov_disc_req_rx(wmip, datap, len); - break; - - case WMI_P2P_PROV_DISC_RESP_EVENTID: - status = wmi_p2p_prov_disc_resp_rx(wmip, datap, len); - break; - - case WMI_P2P_START_SDPD_EVENTID: - status = wmi_p2p_start_sdpd_event_rx(wmip, datap, len); - break; - - case WMI_P2P_SDPD_RX_EVENTID: - status = wmi_p2p_sdpd_rx_event_rx(wmip, datap, len); - break; -#endif /* P2P */ - - case WMI_WAC_REPORT_BSS_EVENTID: - { - WMI_BSS_INFO_HDR2 *p = (WMI_BSS_INFO_HDR2 *)datap; - A_DPRINTF(ATH_DEBUG_ERR, (DBGFMT "WMI_WAC_REPORT_BSS: %x:%x:%x:%x:%x:%x\n", DBGARG, - p->bssid[0], - p->bssid[1], - p->bssid[2], - p->bssid[3], - p->bssid[4], - p->bssid[5])); - } - case WMI_WAC_SCAN_DONE_EVENTID: - case WMI_WAC_START_WPS_EVENTID: - A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len); - break; - case WMI_WAC_CTRL_REQ_REPLY_EVENTID: - { - status = wmi_wacGetInfoReply_rx(wmip, datap, len); - break; - } - case WMI_REPORT_WMM_PARAMS_EVENTID: - { - status = wmi_report_wmm_params(wmip, datap, len); - break; - } -#ifdef CONFIG_WLAN_RFKILL - case (WMI_RFKILL_STATE_CHANGE_EVENTID): - status = wmi_rfkill_state_change_event(wmip,datap,len); - break; - - case (WMI_RFKILL_GET_MODE_CMD_EVENTID): - status = wmi_rfkill_get_mode_cmd_event_rx(wmip,datap,len); - break; - -#endif /* CONFIG_WLAN_RFKILL */ - - case WMI_ASSOC_REQ_EVENTID: - status = wmi_report_assoc_req_rx(wmip, datap, len); - break; - - default: - A_DPRINTF(DBG_WMI|DBG_ERROR, - (DBGFMT "Unknown id 0x%x\n", DBGARG, id)); - wmip->wmi_stats.cmd_id_err++; - status = A_ERROR; - break; - } - - A_NETBUF_FREE(osbuf); - - return status; -} - -/* Send a "simple" wmi command -- one with no arguments */ -static A_STATUS -wmi_simple_cmd(struct wmi_t *wmip, WMI_COMMAND_ID cmdid) -{ - void *osbuf; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(0); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - status = wmi_cmd_send(wmip, osbuf, cmdid, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -/* Send a "simple" extended wmi command -- one with no arguments. - Enabling this command only if GPIO or profiling support is enabled. - This is to suppress warnings on some platforms */ -#if defined(CONFIG_HOST_GPIO_SUPPORT) || defined(CONFIG_TARGET_PROFILE_SUPPORT) -static A_STATUS -wmi_simple_cmd_xtnd(struct wmi_t *wmip, WMIX_COMMAND_ID cmdid) -{ - void *osbuf; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(0); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - status = wmi_cmd_send_xtnd(wmip, osbuf, cmdid, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} -#endif - -static A_STATUS -wmi_ready_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_READY_EVENT *ev = (WMI_READY_EVENT *)datap; - - if (len < sizeof(WMI_READY_EVENT)) { - return A_EINVAL; - } - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - pWmiPriv->wmi_ready = TRUE; - A_WMI_READY_EVENT(wmip->wmi_devt, ev->macaddr, ev->phyCapability, - ev->sw_version, ev->abi_version); - - return A_OK; -} - -#define LE_READ_4(p) \ - ((A_UINT32) \ - ((((A_UINT8 *)(p))[0] ) | (((A_UINT8 *)(p))[1] << 8) | \ - (((A_UINT8 *)(p))[2] << 16) | (((A_UINT8 *)(p))[3] << 24))) - -static int __inline -iswmmoui(const A_UINT8 *frm) -{ - return frm[1] > 3 && LE_READ_4(frm+2) == ((WMM_OUI_TYPE<<24)|WMM_OUI); -} - -static int __inline -iswmmparam(const A_UINT8 *frm) -{ - return frm[1] > 5 && frm[6] == WMM_PARAM_OUI_SUBTYPE; -} - - -static A_STATUS -wmi_connect_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_CONNECT_EVENT *ev; - A_UINT8 *pie,*peie; - - if (len < sizeof(WMI_CONNECT_EVENT)) - { - return A_EINVAL; - } - ev = (WMI_CONNECT_EVENT *)datap; - - A_MEMCPY(wmip->wmi_bssid, ev->u.infra_ibss_bss.bssid, ATH_MAC_LEN); - - /* initialize pointer to start of assoc rsp IEs */ - pie = ev->assocInfo + ev->beaconIeLen + ev->assocReqLen + - sizeof(A_UINT16) + /* capinfo*/ - sizeof(A_UINT16) + /* status Code */ - sizeof(A_UINT16) ; /* associd */ - - /* initialize pointer to end of assoc rsp IEs */ - peie = ev->assocInfo + ev->beaconIeLen + ev->assocReqLen + ev->assocRespLen; - - while (pie < peie) - { - switch (*pie) - { - case IEEE80211_ELEMID_VENDOR: - if (iswmmoui(pie)) - { - if(iswmmparam (pie)) - { - wmip->wmi_is_wmm_enabled = TRUE; - } - } - break; - } - - if (wmip->wmi_is_wmm_enabled) - { - break; - } - pie += pie[1] + 2; - } - - A_WMI_CONNECT_EVENT(wmip->wmi_devt, ev); - - return A_OK; -} - -static A_STATUS -wmi_regDomain_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_REG_DOMAIN_EVENT *ev; - - if (len < sizeof(*ev)) { - return A_EINVAL; - } - ev = (WMI_REG_DOMAIN_EVENT *)datap; - - A_WMI_REGDOMAIN_EVENT(wmip->wmi_devt, ev->regDomain); - - return A_OK; -} - -static A_STATUS -wmi_neighborReport_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_NEIGHBOR_REPORT_EVENT *ev; - int numAps; - - if (len < sizeof(*ev)) { - return A_EINVAL; - } - ev = (WMI_NEIGHBOR_REPORT_EVENT *)datap; - numAps = ev->numberOfAps; - - if (len < (int)(sizeof(*ev) + ((numAps - 1) * sizeof(WMI_NEIGHBOR_INFO)))) { - return A_EINVAL; - } - - A_WMI_NEIGHBORREPORT_EVENT(wmip->wmi_devt, numAps, ev->neighbor); - - return A_OK; -} - -static A_STATUS -wmi_disconnect_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_DISCONNECT_EVENT *ev; - - if (len < sizeof(WMI_DISCONNECT_EVENT)) { - return A_EINVAL; - } - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - ev = (WMI_DISCONNECT_EVENT *)datap; - - A_MEMZERO(wmip->wmi_bssid, sizeof(wmip->wmi_bssid)); - - wmip->wmi_is_wmm_enabled = FALSE; - wmip->wmi_pair_crypto_type = NONE_CRYPT; - wmip->wmi_grp_crypto_type = NONE_CRYPT; - - A_WMI_DISCONNECT_EVENT(wmip->wmi_devt, ev->disconnectReason, ev->bssid, - ev->assocRespLen, ev->assocInfo, ev->protocolReasonStatus); - - return A_OK; -} - - -#ifdef ATH_SUPPORT_DFS - -static A_STATUS -wmi_dfs_attach_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_DFS_HOST_ATTACH_EVENT *ev; - - if (len < sizeof(WMI_DFS_HOST_ATTACH_EVENT)) { - return A_EINVAL; - } - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - ev = (WMI_DFS_HOST_ATTACH_EVENT *)datap; - - A_WMI_DFS_ATTACH_EVENT(wmip->wmi_devt, ev); - - return A_OK; -} - -static A_STATUS -wmi_dfs_init_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_DFS_HOST_INIT_EVENT *ev; - if (len < sizeof(WMI_DFS_HOST_INIT_EVENT)) { - return A_EINVAL; - } - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - ev = (WMI_DFS_HOST_INIT_EVENT *)datap; - - A_WMI_DFS_INIT_EVENT(wmip->wmi_devt, ev); - return A_OK; -} - -static A_STATUS -wmi_dfs_phyerr_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_DFS_PHYERR_EVENT *ev; - if (len < sizeof(WMI_DFS_PHYERR_EVENT)) { - return A_EINVAL; - } - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - ev = (WMI_DFS_PHYERR_EVENT *)datap; - - A_WMI_DFS_PHYERR_EVENT(wmip->wmi_devt, ev); - return A_OK; -} - -static A_STATUS -wmi_dfs_set_dur_multiplier_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - A_UINT32 *ev; - if (len < sizeof(A_UINT32)) { - return A_EINVAL; - } - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - ev = (A_UINT32 *)datap; - - A_WMI_DFS_SET_DUR_MULTIPLIER_EVENT(wmip->wmi_devt, *ev); - return A_OK; -} - -static A_STATUS -wmi_dfs_set_bangradar_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - A_UINT32 *ev; - if (len < sizeof(A_UINT32)) { - return A_EINVAL; - } - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - ev = (A_UINT32 *)datap; - - A_WMI_DFS_SET_BANGRADAR_EVENT(wmip->wmi_devt, *ev); - return A_OK; -} - - -static A_STATUS -wmi_dfs_set_debuglevel_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - A_UINT32 *ev; - if (len < sizeof(A_UINT32)) { - return A_EINVAL; - } - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - ev = (A_UINT32 *)datap; - - A_WMI_DFS_SET_DEBUGLEVEL_EVENT(wmip->wmi_devt, *ev); - return A_OK; -} - -static A_STATUS -wmi_dfs_reset_delaylines_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_DFS_RESET_DELAYLINES_EVENT(wmip->wmi_devt); - return A_OK; -} - -static A_STATUS -wmi_dfs_reset_radarq_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_DFS_RESET_RADARQ_EVENT(wmip->wmi_devt); - return A_OK; -} - -static A_STATUS -wmi_dfs_reset_ar_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_DFS_RESET_AR_EVENT(wmip->wmi_devt); - return A_OK; -} - -static A_STATUS -wmi_dfs_reset_arq_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_DFS_RESET_ARQ_EVENT(wmip->wmi_devt); - return A_OK; -} - -A_STATUS -wmi_set_dfs_minrssithresh_cmd(struct wmi_t *wmip, A_INT32 rssi) -{ - void *osbuf; - A_INT32 *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (A_INT32 *)(A_NETBUF_DATA(osbuf)); - *cmd = rssi; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_DFS_MINRSSITHRESH_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_dfs_maxpulsedur_cmd(struct wmi_t *wmip, A_UINT32 value) -{ - void *osbuf; - A_INT32 *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (A_UINT32 *)(A_NETBUF_DATA(osbuf)); - *cmd = value; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_DFS_MAXPULSEDUR_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_radarDetected_cmd(struct wmi_t *wmip, A_INT16 chan_index, A_INT8 bang_radar) -{ - void *osbuf; - WMI_RADAR_DETECTED_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_RADAR_DETECTED_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->chan_index = chan_index; - cmd->bang_radar = bang_radar; - - status = wmi_cmd_send(wmip, osbuf, WMI_DFS_RADAR_DETECTED_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -/* - * IOCTL: AR6000_XIOCTL_AP_SET_DFS - * - * This command is used to enable/disable DFS before the device is up - * */ -A_STATUS -wmi_ap_set_dfs(struct wmi_t *wmip, A_UINT8 enable) -{ - void *osbuf; - WMI_SET_DFS_CMD *dfs; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_SET_DFS_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_SET_DFS_CMD)); - dfs = (WMI_SET_DFS_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(dfs, sizeof(*dfs)); - - dfs->enable = enable; - - A_DPRINTF(DBG_WMI, (DBGFMT "AR6000_XIOCTL_AP_SET_DFS %d\n", DBGARG , enable)); - status = wmi_cmd_send(wmip, osbuf, WMI_SET_DFS_ENABLE_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -#endif /* ATH_SUPPORT_DFS */ - -static A_STATUS -wmi_peer_node_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_PEER_NODE_EVENT *ev; - - if (len < sizeof(WMI_PEER_NODE_EVENT)) { - return A_EINVAL; - } - ev = (WMI_PEER_NODE_EVENT *)datap; - if (ev->eventCode == PEER_NODE_JOIN_EVENT) { - A_DPRINTF (DBG_WMI, (DBGFMT "Joined node with Macaddr: ", DBGARG)); - } else if(ev->eventCode == PEER_NODE_LEAVE_EVENT) { - A_DPRINTF (DBG_WMI, (DBGFMT "left node with Macaddr: ", DBGARG)); - } - - A_WMI_PEER_EVENT (wmip->wmi_devt, ev->eventCode, ev->peerMacAddr); - - return A_OK; -} - -static A_STATUS -wmi_tkip_micerr_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_TKIP_MICERR_EVENT *ev; - - if (len < sizeof(*ev)) { - return A_EINVAL; - } - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - ev = (WMI_TKIP_MICERR_EVENT *)datap; - A_WMI_TKIP_MICERR_EVENT(wmip->wmi_devt, ev->keyid, ev->ismcast); - - return A_OK; -} - -static A_STATUS -wmi_bssInfo_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - bss_t *bss = NULL; - WMI_BSS_INFO_HDR *bih; - A_UINT8 *buf; - A_UINT32 nodeCachingAllowed = 1; - A_UCHAR cached_ssid_len = 0; - A_UCHAR cached_ssid_buf[IEEE80211_NWID_LEN] = {0}; - A_UINT8 beacon_ssid_len = 0; - A_UINT8 newNode=0; - A_STATUS status = A_OK; - -#ifdef P2P - NETWORK_SUBTYPE networkSubType; -#endif /* P2P */ - - - if (len <= sizeof(WMI_BSS_INFO_HDR)) { - return A_EINVAL; - } - - bih = (WMI_BSS_INFO_HDR *)datap; - bss = wlan_find_node(&wmip->wmi_scan_table, bih->bssid); - - if (bih->rssi > 0) { - if (NULL == bss) - return A_OK; //no node found in the table, just drop the node with incorrect RSSI - else - bih->rssi = bss->ni_rssi; //Adjust RSSI in datap in case it is used in A_WMI_BSSINFO_EVENT_RX - } - - A_WMI_BSSINFO_EVENT_RX(wmip->wmi_devt, datap, len); - /* What is driver config for wlan node caching? */ - if(ar6000_get_driver_cfg(wmip->wmi_devt, - AR6000_DRIVER_CFG_GET_WLANNODECACHING, - &nodeCachingAllowed) != A_OK) { - status = A_EINVAL; - goto err_exit; - } - - if(!nodeCachingAllowed) { - status = A_OK; - goto err_exit; - } - - buf = datap + sizeof(WMI_BSS_INFO_HDR); - len -= sizeof(WMI_BSS_INFO_HDR); - if(bih->frameType == PROBERESP_FTYPE) - { - A_WMI_PROBERESP_RECV_EVENT(wmip->wmi_devt,buf,len,bih->bssid); - } - else if(bih->frameType == BEACON_FTYPE) - { - A_WMI_BEACON_RECV_EVENT(wmip->wmi_devt,buf,len,bih->bssid); - } - - A_DPRINTF(DBG_WMI2, (DBGFMT "bssInfo event - ch %u, rssi %02x, " - "bssid \"%02x:%02x:%02x:%02x:%02x:%02x\"\n", DBGARG, - bih->channel, (unsigned char) bih->rssi, bih->bssid[0], - bih->bssid[1], bih->bssid[2], bih->bssid[3], bih->bssid[4], - bih->bssid[5])); - - if(wps_enable && (bih->frameType == PROBERESP_FTYPE) ) { - status = A_OK; - goto err_exit; - } - - if (bss != NULL) { -#ifdef P2P - /* In the case of P2P device, BSS_INFO_EVENTS are generated not only for - * beacons/Probe-Resps but also P2P ACTION frames like GO-Neg-Req/ - * Invitation/Provisional-Discovery & Probe-Req frames. A existence of - * a peer device can be discovered from any of the above mentioned - * frames. But the primary means of gathering peer device information is - * a beacon/probe-resp. Other means are used when a beacon/Probe-resp - * is not got from that device or when we receive other frames (action) - * from that device even before we started scanning & discovered - * that device. - * If a probe resp/beacon is received from a peer, always update the - * device info from this buffer. - * If the peer device is already discovered by means of a probe-resp - * when we receive a GO-NEG-REQ or Invitation or Prov-disc frame from - * the same peer, do not update the buffer or the device info. - * If the peer is discovered by a Probe-Req. & we receive a - * beacon/probe-resp, Action frame, update the device info. - * If the peer is discovered by an Action frame & when we receive an - * Action frame, do not update the device info. - */ - - /* The WLAN Node table would be organized as below : - * The Node entries can be of the following types: - * 1. Due to a beacon/Probe-resp from a legacy Infrastructure AP. - * 2. Due to a Probe-resp from a p2p-device. - * 3. Due to a beacon/Probe-resp from a p2p-go. - * 4. Due to a client info descriptor in the group info element in the probe-resp from p2p-go. - * 5. Due to a P2P ACTION frame (GO-Neg-Req, Invitation, Prov-Disc-Req.) - * 6. Due to a Probe Req from a p2p-dev. - * In case 1) the WLAN Node key is the BSSID of the Infra AP. - * In case 2) the WLAN Node key is the device addr of the p2p-dev. - * In case 3) the WLAN Node key is the interface addr of the p2p-go. - * In case 4) the beacon/Probe-resp from the p2p-go can contain - * a P2P Group Info element in which case it will one Node entry added for each client info - * descriptor in the GroupInfo element of the probe-resp. In this case the Node key is the - * device addr of the p2p-client. - * In case 5) & 6), the WLAN Node key is the device addr of the p2p-dev. - */ - if ((bss->p2p_dev) && (bss->ni_frametype == BEACON_FTYPE || - bss->ni_frametype == PROBERESP_FTYPE || - bss->ni_frametype == ACTION_MGMT_FTYPE)) { - if ((bih->frameType == ACTION_MGMT_FTYPE || - bih->frameType == PROBEREQ_FTYPE)) { - /* Do not update the ni_buf in the node or update the device info. Just update the node - * timestamp. - */ - wmi_node_update_timestamp(wmip, bss); - status = A_OK; - goto err_exit; - } - } -#endif /* P2P */ - - /* Legacy Way - This is no longer valid. Retaining the comment to know - * the history. Now we do not reclaim the entire node. We only update - * the ni_buf. - * Free up the node. Not the most efficient process given - * we are about to allocate a new node but it is simple and should be - * adequate. - */ - /* In case of hidden AP, beacon will not have ssid, - * but a directed probe response will have it, - * so cache the probe-resp-ssid if already present. */ - if (((TRUE == is_probe_ssid) || IEEE80211_ADDR_EQ (wmip->wmi_bssid, bih->bssid)) && - ((BEACON_FTYPE == bih->frameType) || PROBERESP_FTYPE == bih->frameType)) - { - A_UCHAR *ie_ssid; - - ie_ssid = bss->ni_cie.ie_ssid; - if(ie_ssid && (ie_ssid[1] <= IEEE80211_NWID_LEN) && (ie_ssid[2] != 0)) - { - cached_ssid_len = ie_ssid[1]; - if (cached_ssid_len) - { - memcpy(cached_ssid_buf, ie_ssid + 2, cached_ssid_len); - } - } - } - - /* - * Use the current average rssi of associated AP base on assumpiton - * 1. Most os with GUI will update RSSI by wmi_get_stats_cmd() periodically - * 2. wmi_get_stats_cmd(..) will be called when calling wmi_startscan_cmd(...) - * The average value of RSSI give end-user better feeling for instance value of scan result - * It also sync up RSSI info in GUI between scan result and RSSI signal icon - */ - if (bss && IEEE80211_ADDR_EQ (wmip->wmi_bssid, bih->bssid)) { - bih->rssi = bss->ni_rssi; - bih->snr = bss->ni_snr; - } - - bih->rssi = RSSI_AVE(bss->ni_rssi, bih->rssi, 13); - bih->snr = RSSI_AVE(bss->ni_snr, bih->snr, 13); - - - /* beacon/probe response frame format - * [8] time stamp - * [2] beacon interval - * [2] capability information - * [tlv] ssid */ - beacon_ssid_len = buf[SSID_IE_LEN_INDEX]; - - /* If ssid is cached for this hidden AP, then change buffer len accordingly. */ - if (((TRUE == is_probe_ssid) || IEEE80211_ADDR_EQ (wmip->wmi_bssid, bih->bssid)) && - ((BEACON_FTYPE == bih->frameType) || (PROBERESP_FTYPE == bih->frameType)) && - (0 != cached_ssid_len) && - (0 == beacon_ssid_len || (cached_ssid_len > beacon_ssid_len && 0 == buf[SSID_IE_LEN_INDEX + 1]))) - { - len += (cached_ssid_len - beacon_ssid_len); - } - - /* - * Some APs, like TP-LINK, will report a RSN with zero unicast cipher suites in probe resp. - * Do not update the ni_buf if buf is invalid. It also handles other invalid IEs - */ - if (bih->frameType == PROBERESP_FTYPE) { - struct ieee80211_common_ie cie; - if (wlan_parse_beacon(buf, len, &cie)!=A_OK) { - wmi_node_update_timestamp(wmip, bss); - status = A_OK; - goto err_exit; - } - } - - /* Free up just the ni_buf from the node. Not the entire Node as done - * before. The previous method of reclaiming the entire node even for - * updates leads to frequent node reclaims/allocs in the case of P2P. - */ - - if (wlan_node_buf_update(&wmip->wmi_scan_table, bss, len) != A_OK) { - status = A_NO_MEMORY; - goto err_exit; - } - } else { -#ifdef P2P - /* If this bss_info_ev is for a p2p-client that is part of a P2P group, - * then its dev-addr wont be found in the WLAN node table. But this dev will - * be in the p2p-dev list. This will be part of the p2p-clients in the list - * that hangs from the WLAN Node that has the interface-addr of the p2p-go - * as its key. If this is the case, do not update the p2p-dev info from - * this frame if this is a ACTION or Probe-req frame. The p2p-dev info - * will be updated only from the probe-resp from its p2p-go. - */ - /*networkSubType = A_WMI_GET_DEV_NETWORK_SUBTYPE(wmip->wmi_devt); - if (networkSubType == SUBTYPE_P2PDEV || - networkSubType == SUBTYPE_P2PCLIENT || - networkSubType == SUBTYPE_P2PGO) { - if (p2p_get_device(A_WMI_GET_P2P_CTX(wmip->wmi_devt), - bih->bssid) != NULL) { - if ((bih->frameType == ACTION_MGMT_FTYPE || - bih->frameType == PROBEREQ_FTYPE)) { - status = A_OK; - goto err_exit; - } - } - }*/ -#endif /* P2P */ - - bss = wlan_node_alloc(&wmip->wmi_scan_table, len); - - if (bss == NULL) { - return A_NO_MEMORY; - } - - newNode = 1; - } - - bss->ni_frametype = bih->frameType; - bss->ni_snr = bih->snr; - bss->ni_rssi = bih->rssi; - A_ASSERT(bss->ni_buf != NULL); - - /* In case of hidden AP, beacon will not have ssid, - * but a directed probe response will have it, - * so place the cached-ssid(probe-resp) in the bssinfo. */ - if (((TRUE == is_probe_ssid) || IEEE80211_ADDR_EQ (wmip->wmi_bssid, bih->bssid)) && - ((BEACON_FTYPE == bih->frameType) || (PROBERESP_FTYPE == bih->frameType))&& - (0 != cached_ssid_len) && - (0 == beacon_ssid_len || (beacon_ssid_len && 0 == buf[SSID_IE_LEN_INDEX + 1]))) - { - A_UINT8 *ni_buf = bss->ni_buf; - int buf_len = len; - - /* copy the first 14 bytes such as - * time-stamp(8), beacon-interval(2), cap-info(2), ssid-id(1), ssid-len(1). */ - A_MEMCPY(ni_buf, buf, SSID_IE_LEN_INDEX + 1); - - ni_buf[SSID_IE_LEN_INDEX] = cached_ssid_len; - ni_buf += (SSID_IE_LEN_INDEX + 1); - - buf += (SSID_IE_LEN_INDEX + 1); - buf_len -= (SSID_IE_LEN_INDEX + 1); - - /* copy the cached ssid */ - A_MEMCPY(ni_buf, cached_ssid_buf, cached_ssid_len); - ni_buf += cached_ssid_len; - - buf += beacon_ssid_len; - buf_len -= beacon_ssid_len; - - if (cached_ssid_len > beacon_ssid_len) - buf_len -= (cached_ssid_len - beacon_ssid_len); - - if (buf_len) - { - /* now copy the rest of bytes */ - A_MEMCPY(ni_buf, buf, buf_len); - } - } - else - { - if (len) - { - A_MEMCPY(bss->ni_buf, buf, len); - } - } - - bss->ni_framelen = len; - - - if ((bih->frameType == BEACON_FTYPE || bih->frameType == PROBERESP_FTYPE) && - wlan_parse_beacon(bss->ni_buf, len, &bss->ni_cie) != A_OK) { - status = A_EINVAL; - goto err_exit; - } - -#ifdef P2P - /* If this device is in P2P submode, parse P2P IEs if any. - * BSSINFO_EVENT from p2p module in firmware can be generated for - * GO NEG REQ frame/INVITATION frame or probe req frame in addition to - * beacon/Probe resp frames. Pass these frames - * to the p2p module for parsing & creating a device entry - * if P2P IE is present in them. - */ - networkSubType = A_WMI_GET_DEV_NETWORK_SUBTYPE(wmip->wmi_devt); - if (networkSubType == SUBTYPE_P2PDEV || networkSubType == SUBTYPE_P2PCLIENT - || networkSubType == SUBTYPE_P2PGO) { - - if (bss->p2p_dev != NULL) { - /* A p2p-dev instance is already present in the p2p module. This - * BSS info event will just update it. - */ - p2p_bssinfo_rx(A_WMI_GET_P2P_CTX(wmip->wmi_devt), - bih->frameType, bih->bssid, bih->channel, bss->ni_buf, len); - } else { - /* A new BSS node entry is getting added. This node may get a ref. - * to an already existing p2p-dev instance or may create a new one. - * Increment its reference count here. - */ - bss->p2p_dev = p2p_bssinfo_rx(A_WMI_GET_P2P_CTX(wmip->wmi_devt), - bih->frameType, bih->bssid, bih->channel, bss->ni_buf, len); - if (bss->p2p_dev) { - p2p_increment_dev_ref_count(bss->p2p_dev); - } - } - } -#endif /* P2P */ - - - /* - * Update the frequency in ie_chan, overwriting of channel number - * which is done in wlan_parse_beacon - */ - bss->ni_cie.ie_chan = bih->channel; - - /* If the Node was updated, release the ref. count acquired by wlan_find_node() in the - * beginning. - */ -err_exit: - if (newNode) { - if (status == A_OK) { - wlan_setup_node(&wmip->wmi_scan_table, bss, bih->bssid); - } else if (bss) { - wlan_node_free(bss); - } - } else { - wmi_node_return(wmip, bss); - } - - return status; -} - -static A_STATUS -wmi_opt_frame_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - bss_t *bss; - WMI_OPT_RX_INFO_HDR *bih; - A_UINT8 *buf; - - if (len <= sizeof(WMI_OPT_RX_INFO_HDR)) { - return A_EINVAL; - } - - bih = (WMI_OPT_RX_INFO_HDR *)datap; - buf = datap + sizeof(WMI_OPT_RX_INFO_HDR); - len -= sizeof(WMI_OPT_RX_INFO_HDR); - - A_DPRINTF(DBG_WMI2, (DBGFMT "opt frame event %2.2x:%2.2x\n", DBGARG, - bih->bssid[4], bih->bssid[5])); - - bss = wlan_find_node(&wmip->wmi_scan_table, bih->bssid); - if (bss != NULL) { - /* - * Free up the node. Not the most efficient process given - * we are about to allocate a new node but it is simple and should be - * adequate. - */ - wlan_node_reclaim(&wmip->wmi_scan_table, bss); - } - - bss = wlan_node_alloc(&wmip->wmi_scan_table, len); - if (bss == NULL) { - return A_NO_MEMORY; - } - - bss->ni_snr = bih->snr; - bss->ni_cie.ie_chan = bih->channel; - A_ASSERT(bss->ni_buf != NULL); - - if (len) - { - A_MEMCPY(bss->ni_buf, buf, len); - } - - wlan_setup_node(&wmip->wmi_scan_table, bss, bih->bssid); - - return A_OK; -} - - /* This event indicates inactivity timeout of a fatpipe(pstream) - * at the target - */ -static A_STATUS -wmi_pstream_timeout_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_PSTREAM_TIMEOUT_EVENT *ev; - - if (len < sizeof(WMI_PSTREAM_TIMEOUT_EVENT)) { - return A_EINVAL; - } - - A_DPRINTF(DBG_WMI, (DBGFMT "wmi_pstream_timeout_event_rx\n", DBGARG)); - - ev = (WMI_PSTREAM_TIMEOUT_EVENT *)datap; - - /* When the pstream (fat pipe == AC) timesout, it means there were no - * thinStreams within this pstream & it got implicitly created due to - * data flow on this AC. We start the inactivity timer only for - * implicitly created pstream. Just reset the host state. - */ - /* Set the activeTsids for this AC to 0 */ - LOCK_WMI(pWmiPriv); - pWmiPriv->wmi_streamExistsForAC[ev->trafficClass]=0; - pWmiPriv->wmi_fatPipeExists &= ~(1 << ev->trafficClass); - UNLOCK_WMI(pWmiPriv); - - /*Indicate inactivity to driver layer for this fatpipe (pstream)*/ - A_WMI_STREAM_TX_INACTIVE(wmip->wmi_devt, ev->trafficClass); - - return A_OK; -} - -static A_STATUS -wmi_bitrate_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_BIT_RATE_REPLY *reply; - A_INT32 rate; - A_UINT32 sgi,index; - /* 54149: - * WMI_BIT_RATE_CMD structure is changed to WMI_BIT_RATE_REPLY. - * since there is difference in the length and to avoid returning - * error value. - */ - if (len < sizeof(WMI_BIT_RATE_REPLY)) { - return A_EINVAL; - } - reply = (WMI_BIT_RATE_REPLY *)datap; - A_DPRINTF(DBG_WMI, - (DBGFMT "Enter - rateindex %d\n", DBGARG, reply->rateIndex)); - - if (reply->rateIndex == (A_INT8) RATE_AUTO) { - rate = RATE_AUTO; - } else { - // the SGI state is stored as the MSb of the rateIndex - index = reply->rateIndex & 0x7f; - sgi = (reply->rateIndex & 0x80)? 1:0; - rate = wmi_rateTable[index][sgi]; - } - - A_WMI_BITRATE_RX(wmip->wmi_devt, rate); - return A_OK; -} - -static A_STATUS -wmi_ratemask_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_FIX_RATES_REPLY *reply; - - if (len < sizeof(WMI_FIX_RATES_REPLY)) { - return A_EINVAL; - } - reply = (WMI_FIX_RATES_REPLY *)datap; - A_DPRINTF(DBG_WMI, - (DBGFMT "Enter - fixed rate mask %04x%04x\n", DBGARG, reply->fixRateMask[0], reply->fixRateMask[1])); - - A_WMI_RATEMASK_RX(wmip->wmi_devt, reply->fixRateMask); - - return A_OK; -} - -static A_STATUS -wmi_channelList_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_CHANNEL_LIST_REPLY *reply; - - if (len < sizeof(WMI_CHANNEL_LIST_REPLY)) { - return A_EINVAL; - } - reply = (WMI_CHANNEL_LIST_REPLY *)datap; - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_CHANNELLIST_RX(wmip->wmi_devt, reply->numChannels, - reply->channelList); - - return A_OK; -} - -static A_STATUS -wmi_txPwr_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_TX_PWR_REPLY *reply; - - if (len < sizeof(*reply)) { - return A_EINVAL; - } - reply = (WMI_TX_PWR_REPLY *)datap; - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_TXPWR_RX(wmip->wmi_devt, reply->dbM); - - return A_OK; -} -static A_STATUS -wmi_keepalive_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_GET_KEEPALIVE_CMD *reply; - - if (len < sizeof(*reply)) { - return A_EINVAL; - } - reply = (WMI_GET_KEEPALIVE_CMD *)datap; - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_KEEPALIVE_RX(wmip->wmi_devt, reply->configured); - - return A_OK; -} - - -static A_STATUS -wmi_dset_open_req_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMIX_DSETOPENREQ_EVENT *dsetopenreq; - - if (len < sizeof(WMIX_DSETOPENREQ_EVENT)) { - return A_EINVAL; - } - dsetopenreq = (WMIX_DSETOPENREQ_EVENT *)datap; - A_DPRINTF(DBG_WMI, - (DBGFMT "Enter - dset_id=0x%x\n", DBGARG, dsetopenreq->dset_id)); - A_WMI_DSET_OPEN_REQ(wmip->wmi_devt, - dsetopenreq->dset_id, - dsetopenreq->targ_dset_handle, - dsetopenreq->targ_reply_fn, - dsetopenreq->targ_reply_arg); - - return A_OK; -} - -#ifdef CONFIG_HOST_DSET_SUPPORT -static A_STATUS -wmi_dset_close_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMIX_DSETCLOSE_EVENT *dsetclose; - - if (len < sizeof(WMIX_DSETCLOSE_EVENT)) { - return A_EINVAL; - } - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - dsetclose = (WMIX_DSETCLOSE_EVENT *)datap; - A_WMI_DSET_CLOSE(wmip->wmi_devt, dsetclose->access_cookie); - - return A_OK; -} - -static A_STATUS -wmi_dset_data_req_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMIX_DSETDATAREQ_EVENT *dsetdatareq; - - if (len < sizeof(WMIX_DSETDATAREQ_EVENT)) { - return A_EINVAL; - } - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - dsetdatareq = (WMIX_DSETDATAREQ_EVENT *)datap; - A_WMI_DSET_DATA_REQ(wmip->wmi_devt, - dsetdatareq->access_cookie, - dsetdatareq->offset, - dsetdatareq->length, - dsetdatareq->targ_buf, - dsetdatareq->targ_reply_fn, - dsetdatareq->targ_reply_arg); - - return A_OK; -} -#endif /* CONFIG_HOST_DSET_SUPPORT */ - -static A_STATUS -wmi_scanComplete_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_SCAN_COMPLETE_EVENT *ev; - - ev = (WMI_SCAN_COMPLETE_EVENT *)datap; - if ((A_STATUS)ev->status == A_OK) { - wlan_refresh_inactive_nodes(&wmip->wmi_scan_table); - } - A_WMI_SCANCOMPLETE_EVENT(wmip->wmi_devt, (A_STATUS) ev->status); - //is_probe_ssid = FALSE; - - return A_OK; -} - -/* - * Target is reporting a programming error. This is for - * developer aid only. Target only checks a few common violations - * and it is responsibility of host to do all error checking. - * Behavior of target after wmi error event is undefined. - * A reset is recommended. - */ -static A_STATUS -wmi_errorEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_CMD_ERROR_EVENT *ev; - - ev = (WMI_CMD_ERROR_EVENT *)datap; - AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("Programming Error: cmd=%d Interface id: %d", - ev->commandId, wmip->wmi_dev_index)); - switch (ev->errorCode) { - case (INVALID_PARAM): - AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("Illegal Parameter\n")); - break; - case (ILLEGAL_STATE): - AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("Illegal State\n")); - break; - case (INTERNAL_ERROR): - AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("Internal Error\n")); - break; - } - - return A_OK; -} - - -static A_STATUS -wmi_statsEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_TARGETSTATS_EVENT(wmip->wmi_devt, datap, len); - - return A_OK; -} - -static A_STATUS -wmi_rssiThresholdEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_RSSI_THRESHOLD_EVENT *reply; - WMI_RSSI_THRESHOLD_VAL newThreshold; - WMI_RSSI_THRESHOLD_PARAMS_CMD cmd; - SQ_THRESHOLD_PARAMS *sq_thresh = - &wmip->wmi_SqThresholdParams[SIGNAL_QUALITY_METRICS_RSSI]; - A_UINT8 upper_rssi_threshold, lower_rssi_threshold; - A_INT16 rssi; - - if (len < sizeof(*reply)) { - return A_EINVAL; - } - reply = (WMI_RSSI_THRESHOLD_EVENT *)datap; - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - newThreshold = (WMI_RSSI_THRESHOLD_VAL) reply->range; - rssi = reply->rssi; - - /* - * Identify the threshold breached and communicate that to the app. After - * that install a new set of thresholds based on the signal quality - * reported by the target - */ - if (newThreshold) { - /* Upper threshold breached */ - if (rssi < sq_thresh->upper_threshold[0]) { - A_DPRINTF(DBG_WMI, (DBGFMT "Spurious upper RSSI threshold event: " - " %d\n", DBGARG, rssi)); - } else if ((rssi < sq_thresh->upper_threshold[1]) && - (rssi >= sq_thresh->upper_threshold[0])) - { - newThreshold = WMI_RSSI_THRESHOLD1_ABOVE; - } else if ((rssi < sq_thresh->upper_threshold[2]) && - (rssi >= sq_thresh->upper_threshold[1])) - { - newThreshold = WMI_RSSI_THRESHOLD2_ABOVE; - } else if ((rssi < sq_thresh->upper_threshold[3]) && - (rssi >= sq_thresh->upper_threshold[2])) - { - newThreshold = WMI_RSSI_THRESHOLD3_ABOVE; - } else if ((rssi < sq_thresh->upper_threshold[4]) && - (rssi >= sq_thresh->upper_threshold[3])) - { - newThreshold = WMI_RSSI_THRESHOLD4_ABOVE; - } else if ((rssi < sq_thresh->upper_threshold[5]) && - (rssi >= sq_thresh->upper_threshold[4])) - { - newThreshold = WMI_RSSI_THRESHOLD5_ABOVE; - } else if (rssi >= sq_thresh->upper_threshold[5]) { - newThreshold = WMI_RSSI_THRESHOLD6_ABOVE; - } - } else { - /* Lower threshold breached */ - if (rssi > sq_thresh->lower_threshold[0]) { - A_DPRINTF(DBG_WMI, (DBGFMT "Spurious lower RSSI threshold event: " - "%d %d\n", DBGARG, rssi, sq_thresh->lower_threshold[0])); - } else if ((rssi > sq_thresh->lower_threshold[1]) && - (rssi <= sq_thresh->lower_threshold[0])) - { - newThreshold = WMI_RSSI_THRESHOLD6_BELOW; - } else if ((rssi > sq_thresh->lower_threshold[2]) && - (rssi <= sq_thresh->lower_threshold[1])) - { - newThreshold = WMI_RSSI_THRESHOLD5_BELOW; - } else if ((rssi > sq_thresh->lower_threshold[3]) && - (rssi <= sq_thresh->lower_threshold[2])) - { - newThreshold = WMI_RSSI_THRESHOLD4_BELOW; - } else if ((rssi > sq_thresh->lower_threshold[4]) && - (rssi <= sq_thresh->lower_threshold[3])) - { - newThreshold = WMI_RSSI_THRESHOLD3_BELOW; - } else if ((rssi > sq_thresh->lower_threshold[5]) && - (rssi <= sq_thresh->lower_threshold[4])) - { - newThreshold = WMI_RSSI_THRESHOLD2_BELOW; - } else if (rssi <= sq_thresh->lower_threshold[5]) { - newThreshold = WMI_RSSI_THRESHOLD1_BELOW; - } - } - /* Calculate and install the next set of thresholds */ - lower_rssi_threshold = ar6000_get_lower_threshold(rssi, sq_thresh, - sq_thresh->lower_threshold_valid_count); - upper_rssi_threshold = ar6000_get_upper_threshold(rssi, sq_thresh, - sq_thresh->upper_threshold_valid_count); - /* Issue a wmi command to install the thresholds */ - cmd.thresholdAbove1_Val = upper_rssi_threshold; - cmd.thresholdBelow1_Val = lower_rssi_threshold; - cmd.weight = sq_thresh->weight; - cmd.pollTime = sq_thresh->polling_interval; - - rssi_event_value = rssi; - - if (wmi_send_rssi_threshold_params(wmip, &cmd) != A_OK) { - A_DPRINTF(DBG_WMI, (DBGFMT "Unable to configure the RSSI thresholds\n", - DBGARG)); - } - - A_WMI_RSSI_THRESHOLD_EVENT(wmip->wmi_devt, newThreshold, reply->rssi); - - return A_OK; -} - - -static A_STATUS -wmi_reportErrorEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_TARGET_ERROR_REPORT_EVENT *reply; - - if (len < sizeof(*reply)) { - return A_EINVAL; - } - reply = (WMI_TARGET_ERROR_REPORT_EVENT *)datap; - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_REPORT_ERROR_EVENT(wmip->wmi_devt, (WMI_TARGET_ERROR_VAL) reply->errorVal); - - return A_OK; -} - -static A_STATUS -wmi_cac_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_CAC_EVENT *reply; - WMM_TSPEC_IE *tspec_ie; - A_UINT16 activeTsids; - - if (len < sizeof(*reply)) { - return A_EINVAL; - } - reply = (WMI_CAC_EVENT *)datap; - - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - if ((reply->cac_indication == CAC_INDICATION_ADMISSION_RESP) && - (reply->statusCode != TSPEC_STATUS_CODE_ADMISSION_ACCEPTED)) { - tspec_ie = (WMM_TSPEC_IE *) &(reply->tspecSuggestion); - - wmi_delete_pstream_cmd(wmip, reply->ac, - (tspec_ie->tsInfo_info >> TSPEC_TSID_S) & TSPEC_TSID_MASK); - } - else if (reply->cac_indication == CAC_INDICATION_NO_RESP) { - A_UINT16 activeTsids; - A_UINT8 i; - - /* following assumes that there is only one outstanding ADDTS request - when this event is received */ - LOCK_WMI(pWmiPriv); - activeTsids = pWmiPriv->wmi_streamExistsForAC[reply->ac]; - UNLOCK_WMI(pWmiPriv); - - for (i = 0; i < sizeof(activeTsids) * 8; i++) { - if ((activeTsids >> i) & 1) { - break; - } - } - if (i < (sizeof(activeTsids) * 8)) { - wmi_delete_pstream_cmd(wmip, reply->ac, i); - } - } - /* - * Ev#72990: Clear active tsids and Add missing handling - * for delete qos stream from AP - */ - else if (reply->cac_indication == CAC_INDICATION_DELETE) { - A_UINT8 tsid = 0; - A_UINT8 tsidActive; - - tspec_ie = (WMM_TSPEC_IE *) &(reply->tspecSuggestion); - tsid= ((tspec_ie->tsInfo_info >> TSPEC_TSID_S) & TSPEC_TSID_MASK); - LOCK_WMI(pWmiPriv); - tsidActive = (pWmiPriv->wmi_streamExistsForAC[reply->ac] & (1<wmi_streamExistsForAC[reply->ac] &= ~(1<wmi_streamExistsForAC[reply->ac]; - UNLOCK_WMI(pWmiPriv); - - /* Indicate stream inactivity to driver layer only if all tsids - * within this AC are deleted. - */ - if ((!activeTsids) && (tsidActive)) { - A_WMI_STREAM_TX_INACTIVE(wmip->wmi_devt, reply->ac); - pWmiPriv->wmi_fatPipeExists &= ~(1 << reply->ac); - } - } - A_WMI_CAC_EVENT(wmip->wmi_devt, reply->ac, - reply->cac_indication, reply->statusCode, - reply->tspecSuggestion); - - return A_OK; -} - -static A_STATUS -wmi_channel_change_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_CHANNEL_CHANGE_EVENT *reply; - - if (len < sizeof(*reply)) { - return A_EINVAL; - } - reply = (WMI_CHANNEL_CHANGE_EVENT *)datap; - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_CHANNEL_CHANGE_EVENT(wmip->wmi_devt, reply->oldChannel, - reply->newChannel); - - return A_OK; -} - -static A_STATUS -wmi_hbChallengeResp_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMIX_HB_CHALLENGE_RESP_EVENT *reply; - - if (len < sizeof(*reply)) { - return A_EINVAL; - } - reply = (WMIX_HB_CHALLENGE_RESP_EVENT *)datap; - A_DPRINTF(DBG_WMI, (DBGFMT "wmi: challenge response event\n", DBGARG)); - - A_WMI_HBCHALLENGERESP_EVENT(wmip->wmi_devt, reply->cookie, reply->source); - - return A_OK; -} - -static A_STATUS -wmi_roam_tbl_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_TARGET_ROAM_TBL *reply; - - if (len < sizeof(*reply)) { - return A_EINVAL; - } - reply = (WMI_TARGET_ROAM_TBL *)datap; - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_ROAM_TABLE_EVENT(wmip->wmi_devt, reply); - - return A_OK; -} - -static A_STATUS -wmi_roam_data_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_TARGET_ROAM_DATA *reply; - - if (len < sizeof(*reply)) { - return A_EINVAL; - } - reply = (WMI_TARGET_ROAM_DATA *)datap; - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_ROAM_DATA_EVENT(wmip->wmi_devt, reply); - - return A_OK; -} - -static A_STATUS -wmi_txRetryErrEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - if (len < sizeof(WMI_TX_RETRY_ERR_EVENT)) { - return A_EINVAL; - } - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_TX_RETRY_ERR_EVENT(wmip->wmi_devt); - - return A_OK; -} - -static A_STATUS -wmi_snrThresholdEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_SNR_THRESHOLD_EVENT *reply; - SQ_THRESHOLD_PARAMS *sq_thresh = - &wmip->wmi_SqThresholdParams[SIGNAL_QUALITY_METRICS_SNR]; - WMI_SNR_THRESHOLD_VAL newThreshold; - WMI_SNR_THRESHOLD_PARAMS_CMD cmd; - A_UINT8 upper_snr_threshold, lower_snr_threshold; - A_INT16 snr; - - if (len < sizeof(*reply)) { - return A_EINVAL; - } - reply = (WMI_SNR_THRESHOLD_EVENT *)datap; - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - newThreshold = (WMI_SNR_THRESHOLD_VAL) reply->range; - snr = reply->snr; - /* - * Identify the threshold breached and communicate that to the app. After - * that install a new set of thresholds based on the signal quality - * reported by the target - */ - if (newThreshold) { - /* Upper threshold breached */ - if (snr < sq_thresh->upper_threshold[0]) { - A_DPRINTF(DBG_WMI, (DBGFMT "Spurious upper SNR threshold event: " - "%d\n", DBGARG, snr)); - } else if ((snr < sq_thresh->upper_threshold[1]) && - (snr >= sq_thresh->upper_threshold[0])) - { - newThreshold = WMI_SNR_THRESHOLD1_ABOVE; - } else if ((snr < sq_thresh->upper_threshold[2]) && - (snr >= sq_thresh->upper_threshold[1])) - { - newThreshold = WMI_SNR_THRESHOLD2_ABOVE; - } else if ((snr < sq_thresh->upper_threshold[3]) && - (snr >= sq_thresh->upper_threshold[2])) - { - newThreshold = WMI_SNR_THRESHOLD3_ABOVE; - } else if (snr >= sq_thresh->upper_threshold[3]) { - newThreshold = WMI_SNR_THRESHOLD4_ABOVE; - } - } else { - /* Lower threshold breached */ - if (snr > sq_thresh->lower_threshold[0]) { - A_DPRINTF(DBG_WMI, (DBGFMT "Spurious lower SNR threshold event: " - "%d %d\n", DBGARG, snr, sq_thresh->lower_threshold[0])); - } else if ((snr > sq_thresh->lower_threshold[1]) && - (snr <= sq_thresh->lower_threshold[0])) - { - newThreshold = WMI_SNR_THRESHOLD4_BELOW; - } else if ((snr > sq_thresh->lower_threshold[2]) && - (snr <= sq_thresh->lower_threshold[1])) - { - newThreshold = WMI_SNR_THRESHOLD3_BELOW; - } else if ((snr > sq_thresh->lower_threshold[3]) && - (snr <= sq_thresh->lower_threshold[2])) - { - newThreshold = WMI_SNR_THRESHOLD2_BELOW; - } else if (snr <= sq_thresh->lower_threshold[3]) { - newThreshold = WMI_SNR_THRESHOLD1_BELOW; - } - } - - /* Calculate and install the next set of thresholds */ - lower_snr_threshold = ar6000_get_lower_threshold(snr, sq_thresh, - sq_thresh->lower_threshold_valid_count); - upper_snr_threshold = ar6000_get_upper_threshold(snr, sq_thresh, - sq_thresh->upper_threshold_valid_count); - - /* Issue a wmi command to install the thresholds */ - cmd.thresholdAbove1_Val = upper_snr_threshold; - cmd.thresholdBelow1_Val = lower_snr_threshold; - cmd.weight = sq_thresh->weight; - cmd.pollTime = sq_thresh->polling_interval; - - A_DPRINTF(DBG_WMI, (DBGFMT "snr: %d, threshold: %d, lower: %d, upper: %d\n" - ,DBGARG, snr, newThreshold, lower_snr_threshold, - upper_snr_threshold)); - - snr_event_value = snr; - - if (wmi_send_snr_threshold_params(wmip, &cmd) != A_OK) { - A_DPRINTF(DBG_WMI, (DBGFMT "Unable to configure the SNR thresholds\n", - DBGARG)); - } - A_WMI_SNR_THRESHOLD_EVENT_RX(wmip->wmi_devt, newThreshold, reply->snr); - - return A_OK; -} - -static A_STATUS -wmi_lqThresholdEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_LQ_THRESHOLD_EVENT *reply; - - if (len < sizeof(*reply)) { - return A_EINVAL; - } - reply = (WMI_LQ_THRESHOLD_EVENT *)datap; - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_LQ_THRESHOLD_EVENT_RX(wmip->wmi_devt, - (WMI_LQ_THRESHOLD_VAL) reply->range, - reply->lq); - - return A_OK; -} - -static A_STATUS -wmi_aplistEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - A_UINT16 ap_info_entry_size; - WMI_APLIST_EVENT *ev = (WMI_APLIST_EVENT *)datap; - WMI_AP_INFO_V1 *ap_info_v1; - A_UINT8 i; - - if (len < sizeof(WMI_APLIST_EVENT)) { - return A_EINVAL; - } - - if (ev->apListVer == APLIST_VER1) { - ap_info_entry_size = sizeof(WMI_AP_INFO_V1); - ap_info_v1 = (WMI_AP_INFO_V1 *)ev->apList; - } else { - return A_EINVAL; - } - - AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("Number of APs in APLIST Event is %d\n", ev->numAP)); - if (len < (int)(sizeof(WMI_APLIST_EVENT) + - (ev->numAP - 1) * ap_info_entry_size)) - { - return A_EINVAL; - } - - /* - * AP List Ver1 Contents - */ - for (i = 0; i < ev->numAP; i++) { - AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("AP#%d BSSID %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x "\ - "Channel %d\n", i, - ap_info_v1->bssid[0], ap_info_v1->bssid[1], - ap_info_v1->bssid[2], ap_info_v1->bssid[3], - ap_info_v1->bssid[4], ap_info_v1->bssid[5], - ap_info_v1->channel)); - ap_info_v1++; - } - return A_OK; -} - -static A_STATUS -wmi_dbglog_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - A_UINT32 dropped; - - dropped = *((A_UINT32 *)datap); - datap += sizeof(dropped); - len -= sizeof(dropped); - A_WMI_DBGLOG_EVENT(wmip->wmi_devt, dropped, (A_INT8*)datap, len); - return A_OK; -} - -static A_STATUS -wmi_wacGetInfoReply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - A_WMI_WACINFO_EVENT(wmip->wmi_devt, datap, len); - - return A_OK; -} - -#ifdef CONFIG_HOST_GPIO_SUPPORT -static A_STATUS -wmi_gpio_intr_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMIX_GPIO_INTR_EVENT *gpio_intr = (WMIX_GPIO_INTR_EVENT *)datap; - - A_DPRINTF(DBG_WMI, - (DBGFMT "Enter - intrmask=0x%x input=0x%x.\n", DBGARG, - gpio_intr->intr_mask, gpio_intr->input_values)); - - A_WMI_GPIO_INTR_RX(wmip->wmi_devt, gpio_intr->intr_mask, gpio_intr->input_values); - - return A_OK; -} - -static A_STATUS -wmi_gpio_data_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMIX_GPIO_DATA_EVENT *gpio_data = (WMIX_GPIO_DATA_EVENT *)datap; - - A_DPRINTF(DBG_WMI, - (DBGFMT "Enter - reg=%d value=0x%x\n", DBGARG, - gpio_data->reg_id, gpio_data->value)); - - A_WMI_GPIO_DATA_RX(wmip->wmi_devt, gpio_data->reg_id, gpio_data->value); - - return A_OK; -} - -static A_STATUS -wmi_gpio_ack_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_GPIO_ACK_RX(wmip->wmi_devt); - - return A_OK; -} -#endif /* CONFIG_HOST_GPIO_SUPPORT */ - -/* - * Called to send a wmi command. Command specific data is already built - * on osbuf and current osbuf->data points to it. - */ -A_STATUS -wmi_cmd_send(struct wmi_t *wmip, void *osbuf, WMI_COMMAND_ID cmdId, - WMI_SYNC_FLAG syncflag) -{ - WMI_CMD_HDR *cHdr; - HTC_ENDPOINT_ID eid = pWmiPriv->wmi_endpoint_id; - A_STATUS status; - - A_ASSERT(osbuf != NULL); - - if (syncflag >= END_WMIFLAG) { - return A_EINVAL; - } - - if ((syncflag == SYNC_BEFORE_WMIFLAG) || (syncflag == SYNC_BOTH_WMIFLAG)) { - /* - * We want to make sure all data currently queued is transmitted before - * the cmd execution. Establish a new sync point. - */ - status = wmi_sync_point(wmip); - - if (status != A_OK) { - return status; - } - } - - if (A_NETBUF_PUSH(osbuf, sizeof(WMI_CMD_HDR)) != A_OK) { - return A_NO_MEMORY; - } - - cHdr = (WMI_CMD_HDR *)A_NETBUF_DATA(osbuf); - cHdr->commandId = (A_UINT16) cmdId; - WMI_CMD_HDR_SET_DEVID(cHdr, wmip->wmi_dev_index); // added for virtual interface - - status = A_WMI_CONTROL_TX(wmip->wmi_devt, osbuf, eid); - - if (status != A_OK) { - return status; - } - - if ((syncflag == SYNC_AFTER_WMIFLAG) || (syncflag == SYNC_BOTH_WMIFLAG)) { - /* - * We want to make sure all new data queued waits for the command to - * execute. Establish a new sync point. - */ - status = wmi_sync_point(wmip); - - if (status != A_OK) { - return status; - } - - } - return status; -#undef IS_OPT_TX_CMD -} - -A_STATUS -wmi_cmd_send_xtnd(struct wmi_t *wmip, void *osbuf, WMIX_COMMAND_ID cmdId, - WMI_SYNC_FLAG syncflag) -{ - WMIX_CMD_HDR *cHdr; - - if (A_NETBUF_PUSH(osbuf, sizeof(WMIX_CMD_HDR)) != A_OK) { - return A_NO_MEMORY; - } - - cHdr = (WMIX_CMD_HDR *)A_NETBUF_DATA(osbuf); - cHdr->commandId = (A_UINT32) cmdId; - - return wmi_cmd_send(wmip, osbuf, WMI_EXTENSION_CMDID, syncflag); -} - -A_STATUS -wmi_connect_cmd(struct wmi_t *wmip, NETWORK_TYPE netType, - DOT11_AUTH_MODE dot11AuthMode, AUTH_MODE authMode, - CRYPTO_TYPE pairwiseCrypto, A_UINT8 pairwiseCryptoLen, - CRYPTO_TYPE groupCrypto, A_UINT8 groupCryptoLen, - int ssidLength, A_UCHAR *ssid, - A_UINT8 *bssid, A_UINT16 channel, A_UINT32 ctrl_flags) -{ - void *osbuf; - WMI_CONNECT_CMD *cc; - A_STATUS status; - - if ((pairwiseCrypto == NONE_CRYPT) && (groupCrypto != NONE_CRYPT)) { - return A_EINVAL; - } - if ((pairwiseCrypto != NONE_CRYPT) && (groupCrypto == NONE_CRYPT)) { - return A_EINVAL; - } - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_CONNECT_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_CONNECT_CMD)); - - cc = (WMI_CONNECT_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cc, sizeof(*cc)); - - if (ssidLength) - { - A_MEMCPY(cc->ssid, ssid, ssidLength); - } - - cc->ssidLength = ssidLength; - cc->networkType = netType; - cc->dot11AuthMode = dot11AuthMode; - cc->authMode = authMode; - cc->pairwiseCryptoType = pairwiseCrypto; - cc->pairwiseCryptoLen = pairwiseCryptoLen; - cc->groupCryptoType = groupCrypto; - cc->groupCryptoLen = groupCryptoLen; - cc->channel = channel; - cc->ctrl_flags = ctrl_flags; - - if (bssid != NULL) { - A_MEMCPY(cc->bssid, bssid, ATH_MAC_LEN); - } - - wmip->wmi_pair_crypto_type = pairwiseCrypto; - wmip->wmi_grp_crypto_type = groupCrypto; - - status = wmi_cmd_send(wmip, osbuf, WMI_CONNECT_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_div_param_cmd(struct wmi_t *wmip, A_UINT32 divIdleTime, - A_UINT8 antRssiThresh, A_UINT8 divEnable, A_UINT16 active_treshold_rate) -{ - void *osbuf; - WMI_DIV_PARAMS_CMD *dc; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_DIV_PARAMS_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_DIV_PARAMS_CMD)); - - dc = (WMI_DIV_PARAMS_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(dc, sizeof(*dc)); - - dc->divIdleTime = divIdleTime; - dc->antRssiThresh = antRssiThresh; - dc->divEnable = divEnable; - dc->active_treshold_rate = active_treshold_rate; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_DIV_PARAMS_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_reconnect_cmd(struct wmi_t *wmip, A_UINT8 *bssid, A_UINT16 channel) -{ - void *osbuf; - WMI_RECONNECT_CMD *cc; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_RECONNECT_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_RECONNECT_CMD)); - - cc = (WMI_RECONNECT_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cc, sizeof(*cc)); - - cc->channel = channel; - - if (bssid != NULL) { - A_MEMCPY(cc->bssid, bssid, ATH_MAC_LEN); - } - - status = wmi_cmd_send(wmip, osbuf, WMI_RECONNECT_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_disconnect_cmd(struct wmi_t *wmip) -{ - A_STATUS status; - - /* Bug fix for 24817(elevator bug) - the disconnect command does not - need to do a SYNC before.*/ - status = wmi_simple_cmd(wmip, WMI_DISCONNECT_CMDID); - - return status; -} - -A_STATUS -wmi_startscan_cmd(struct wmi_t *wmip, WMI_SCAN_TYPE scanType, - A_BOOL forceFgScan, A_BOOL isLegacy, - A_UINT32 homeDwellTime, A_UINT32 forceScanInterval, - A_INT8 numChan, A_UINT16 *channelList) -{ - void *osbuf; - WMI_START_SCAN_CMD *sc; - A_INT8 size; - A_STATUS status; - - size = sizeof (*sc); - - if ((scanType != WMI_LONG_SCAN) && (scanType != WMI_SHORT_SCAN)) { - return A_EINVAL; - } - - if (numChan) { - if (numChan > WMI_MAX_CHANNELS) { - return A_EINVAL; - } - size += sizeof(A_UINT16) * (numChan - 1); - } - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, size); - - sc = (WMI_START_SCAN_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(sc, sizeof(*sc)); - sc->scanType = scanType; - sc->forceFgScan = forceFgScan; - sc->isLegacy = isLegacy; - sc->homeDwellTime = homeDwellTime; - sc->forceScanInterval = forceScanInterval; - sc->numChannels = numChan; - if (numChan) { - A_MEMCPY(sc->channelList, channelList, numChan * sizeof(A_UINT16)); - } - - status = wmi_cmd_send(wmip, osbuf, WMI_START_SCAN_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_scanparams_cmd(struct wmi_t *wmip, A_UINT16 fg_start_sec, - A_UINT16 fg_end_sec, A_UINT16 bg_sec, - A_UINT16 minact_chdw_msec, A_UINT16 maxact_chdw_msec, - A_UINT16 pas_chdw_msec, - A_UINT8 shScanRatio, A_UINT8 scanCtrlFlags, - A_UINT32 max_dfsch_act_time, A_UINT16 maxact_scan_per_ssid) -{ - void *osbuf; - WMI_SCAN_PARAMS_CMD *sc; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*sc)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*sc)); - - sc = (WMI_SCAN_PARAMS_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(sc, sizeof(*sc)); - sc->fg_start_period = fg_start_sec; - sc->fg_end_period = fg_end_sec; - sc->bg_period = bg_sec; - sc->minact_chdwell_time = minact_chdw_msec; - sc->maxact_chdwell_time = maxact_chdw_msec; - sc->pas_chdwell_time = pas_chdw_msec; - sc->shortScanRatio = shScanRatio; - sc->scanCtrlFlags = scanCtrlFlags; - sc->max_dfsch_act_time = max_dfsch_act_time; - sc->maxact_scan_per_ssid = maxact_scan_per_ssid; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_SCAN_PARAMS_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_bssfilter_cmd(struct wmi_t *wmip, A_UINT8 filter, A_UINT32 ieMask) -{ - void *osbuf; - WMI_BSS_FILTER_CMD *cmd; - A_STATUS status; - - if (filter >= LAST_BSS_FILTER) { - return A_EINVAL; - } - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_BSS_FILTER_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->bssFilter = filter; - cmd->ieMask = ieMask; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_BSS_FILTER_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_probedSsid_cmd(struct wmi_t *wmip, A_UINT8 index, A_UINT8 flag, - A_UINT8 ssidLength, A_UCHAR *ssid) -{ - void *osbuf; - WMI_PROBED_SSID_CMD *cmd; - A_STATUS status; - - if (index > MAX_PROBED_SSID_INDEX) { - return A_EINVAL; - } - if (ssidLength > sizeof(cmd->ssid)) { - return A_EINVAL; - } - if ((flag & (DISABLE_SSID_FLAG | ANY_SSID_FLAG)) && (ssidLength > 0)) { - is_probe_ssid = FALSE; - return A_EINVAL; - } - if ((flag & SPECIFIC_SSID_FLAG) && !ssidLength) { - return A_EINVAL; - } - - if (flag & SPECIFIC_SSID_FLAG) { - is_probe_ssid = TRUE; - } - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_PROBED_SSID_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->entryIndex = index; - cmd->flag = flag; - cmd->ssidLength = ssidLength; - - if (ssidLength) - { - A_MEMCPY(cmd->ssid, ssid, ssidLength); - } - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_PROBED_SSID_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_listeninterval_cmd(struct wmi_t *wmip, A_UINT16 listenInterval, A_UINT16 listenBeacons) -{ - void *osbuf; - WMI_LISTEN_INT_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_LISTEN_INT_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->listenInterval = listenInterval; - cmd->numBeacons = listenBeacons; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_LISTEN_INT_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_bmisstime_cmd(struct wmi_t *wmip, A_UINT16 bmissTime, A_UINT16 bmissBeacons) -{ - void *osbuf; - WMI_BMISS_TIME_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_BMISS_TIME_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->bmissTime = bmissTime; - cmd->numBeacons = bmissBeacons; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_BMISS_TIME_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_associnfo_cmd(struct wmi_t *wmip, A_UINT8 ieType, - A_UINT8 ieLen, A_UINT8 *ieInfo) -{ - void *osbuf; - WMI_SET_ASSOC_INFO_CMD *cmd; - A_UINT16 cmdLen; - A_STATUS status; - - cmdLen = sizeof(*cmd) + ieLen - 1; - osbuf = A_NETBUF_ALLOC(cmdLen); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, cmdLen); - - cmd = (WMI_SET_ASSOC_INFO_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, cmdLen); - cmd->ieType = ieType; - cmd->bufferSize = ieLen; - - if (ieLen) - { - A_MEMCPY(cmd->assocInfo, ieInfo, ieLen); - } - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_ASSOC_INFO_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_powermode_cmd(struct wmi_t *wmip, A_UINT8 powerMode) -{ - void *osbuf; - WMI_POWER_MODE_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_POWER_MODE_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->powerMode = powerMode; - wmip->wmi_powerMode = powerMode; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_POWER_MODE_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_ibsspmcaps_cmd(struct wmi_t *wmip, A_UINT8 pmEnable, A_UINT8 ttl, - A_UINT16 atim_windows, A_UINT16 timeout_value) -{ - void *osbuf; - WMI_IBSS_PM_CAPS_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_IBSS_PM_CAPS_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->power_saving = pmEnable; - cmd->ttl = ttl; - cmd->atim_windows = atim_windows; - cmd->timeout_value = timeout_value; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_IBSS_PM_CAPS_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_apps_cmd(struct wmi_t *wmip, A_UINT8 psType, A_UINT32 idle_time, - A_UINT32 ps_period, A_UINT8 sleep_period) -{ - void *osbuf; - WMI_AP_PS_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_AP_PS_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->psType = psType; - cmd->idle_time = idle_time; - cmd->ps_period = ps_period; - cmd->sleep_period = sleep_period; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_AP_PS_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_pmparams_cmd(struct wmi_t *wmip, A_UINT16 idlePeriod, - A_UINT16 psPollNum, A_UINT16 dtimPolicy, - A_UINT16 tx_wakeup_policy, A_UINT16 num_tx_to_wakeup, - A_UINT16 ps_fail_event_policy) -{ - void *osbuf; - WMI_POWER_PARAMS_CMD *pm; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*pm)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*pm)); - - pm = (WMI_POWER_PARAMS_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(pm, sizeof(*pm)); - pm->idle_period = idlePeriod; - pm->pspoll_number = psPollNum; - pm->dtim_policy = dtimPolicy; - pm->tx_wakeup_policy = tx_wakeup_policy; - pm->num_tx_to_wakeup = num_tx_to_wakeup; - pm->ps_fail_event_policy = ps_fail_event_policy; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_POWER_PARAMS_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_disctimeout_cmd(struct wmi_t *wmip, A_UINT8 timeout) -{ - void *osbuf; - WMI_DISC_TIMEOUT_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_DISC_TIMEOUT_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->disconnectTimeout = timeout; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_DISC_TIMEOUT_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - - - -A_STATUS -wmi_addKey_cmd(struct wmi_t *wmip, A_UINT8 keyIndex, CRYPTO_TYPE keyType, - A_UINT8 keyUsage, A_UINT8 keyLength, A_UINT8 *keyRSC, - A_UINT8 *keyMaterial, A_UINT8 key_op_ctrl, A_UINT8 *macAddr, - WMI_SYNC_FLAG sync_flag) -{ - void *osbuf; - WMI_ADD_CIPHER_KEY_CMD *cmd; - A_STATUS status; - - if ((keyIndex > WMI_MAX_KEY_INDEX) || (keyLength > WMI_MAX_KEY_LEN) || - (keyMaterial == NULL)) - { - return A_EINVAL; - } - - if ((WEP_CRYPT != keyType) && (NULL == keyRSC)) { - return A_EINVAL; - } - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_ADD_CIPHER_KEY_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->keyIndex = keyIndex; - cmd->keyType = keyType; - cmd->keyUsage = keyUsage; - cmd->keyLength = keyLength; - A_MEMCPY(cmd->key, keyMaterial, keyLength); -#ifdef WAPI_ENABLE - if (NULL != keyRSC && key_op_ctrl != KEY_OP_INIT_WAPIPN) { -#else - if (NULL != keyRSC) { -#endif // WAPI_ENABLE - A_MEMCPY(cmd->keyRSC, keyRSC, sizeof(cmd->keyRSC)); - } - cmd->key_op_ctrl = key_op_ctrl; - - if(macAddr) { - A_MEMCPY(cmd->key_macaddr,macAddr,IEEE80211_ADDR_LEN); - } - - status = wmi_cmd_send(wmip, osbuf, WMI_ADD_CIPHER_KEY_CMDID, sync_flag); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_add_krk_cmd(struct wmi_t *wmip, A_UINT8 *krk) -{ - void *osbuf; - WMI_ADD_KRK_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_ADD_KRK_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - A_MEMCPY(cmd->krk, krk, WMI_KRK_LEN); - - status = wmi_cmd_send(wmip, osbuf, WMI_ADD_KRK_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_delete_krk_cmd(struct wmi_t *wmip) -{ - return wmi_simple_cmd(wmip, WMI_DELETE_KRK_CMDID); -} - -A_STATUS -wmi_deleteKey_cmd(struct wmi_t *wmip, A_UINT8 keyIndex) -{ - void *osbuf; - WMI_DELETE_CIPHER_KEY_CMD *cmd; - A_STATUS status; - - if (keyIndex > WMI_MAX_KEY_INDEX) { - return A_EINVAL; - } - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_DELETE_CIPHER_KEY_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->keyIndex = keyIndex; - - status = wmi_cmd_send(wmip, osbuf, WMI_DELETE_CIPHER_KEY_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_setPmkid_cmd(struct wmi_t *wmip, A_UINT8 *bssid, A_UINT8 *pmkId, - A_BOOL set) -{ - void *osbuf; - WMI_SET_PMKID_CMD *cmd; - A_STATUS status; - - if (bssid == NULL) { - return A_EINVAL; - } - - if ((set == TRUE) && (pmkId == NULL)) { - return A_EINVAL; - } - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_PMKID_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMCPY(cmd->bssid, bssid, sizeof(cmd->bssid)); - if (set == TRUE) { - A_MEMCPY(cmd->pmkid, pmkId, sizeof(cmd->pmkid)); - cmd->enable = PMKID_ENABLE; - } else { - A_MEMZERO(cmd->pmkid, sizeof(cmd->pmkid)); - cmd->enable = PMKID_DISABLE; - } - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_PMKID_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_tkip_countermeasures_cmd(struct wmi_t *wmip, A_BOOL en) -{ - void *osbuf; - WMI_SET_TKIP_COUNTERMEASURES_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_TKIP_COUNTERMEASURES_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->cm_en = (en == TRUE)? WMI_TKIP_CM_ENABLE : WMI_TKIP_CM_DISABLE; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_TKIP_COUNTERMEASURES_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_akmp_params_cmd(struct wmi_t *wmip, - WMI_SET_AKMP_PARAMS_CMD *akmpParams) -{ - void *osbuf; - WMI_SET_AKMP_PARAMS_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - cmd = (WMI_SET_AKMP_PARAMS_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->akmpInfo = akmpParams->akmpInfo; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_AKMP_PARAMS_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_pmkid_list_cmd(struct wmi_t *wmip, - WMI_SET_PMKID_LIST_CMD *pmkInfo) -{ - void *osbuf; - WMI_SET_PMKID_LIST_CMD *cmd; - A_UINT16 cmdLen; - A_UINT8 i; - A_STATUS status; - - cmdLen = sizeof(pmkInfo->numPMKID) + - pmkInfo->numPMKID * sizeof(WMI_PMKID); - - osbuf = A_NETBUF_ALLOC(cmdLen); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, cmdLen); - cmd = (WMI_SET_PMKID_LIST_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->numPMKID = pmkInfo->numPMKID; - - for (i = 0; i < cmd->numPMKID; i++) { - A_MEMCPY(&cmd->pmkidList[i], &pmkInfo->pmkidList[i], - WMI_PMKID_LEN); - } - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_PMKID_LIST_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_get_pmkid_list_cmd(struct wmi_t *wmip) -{ - return wmi_simple_cmd(wmip, WMI_GET_PMKID_LIST_CMDID); -} - -A_STATUS -wmi_dataSync_send(struct wmi_t *wmip, void *osbuf, HTC_ENDPOINT_ID eid) -{ - WMI_DATA_HDR *dtHdr; - - A_ASSERT( eid != pWmiPriv->wmi_endpoint_id); - A_ASSERT(osbuf != NULL); - - if (A_NETBUF_PUSH(osbuf, sizeof(WMI_DATA_HDR)) != A_OK) { - return A_NO_MEMORY; - } - - dtHdr = (WMI_DATA_HDR *)A_NETBUF_DATA(osbuf); - A_MEMZERO(dtHdr, sizeof(WMI_DATA_HDR)); - dtHdr->info = - (SYNC_MSGTYPE & WMI_DATA_HDR_MSG_TYPE_MASK) << WMI_DATA_HDR_MSG_TYPE_SHIFT; - - A_DPRINTF(DBG_WMI, (DBGFMT "Enter - eid %d\n", DBGARG, eid)); - - return (A_WMI_CONTROL_TX(wmip->wmi_devt, osbuf, eid)); -} - -typedef struct _WMI_DATA_SYNC_BUFS { - A_UINT8 trafficClass; - void *osbuf; -}WMI_DATA_SYNC_BUFS; - -static A_STATUS -wmi_sync_point(struct wmi_t *wmip) -{ - void *cmd_osbuf; - WMI_SYNC_CMD *cmd; - WMI_DATA_SYNC_BUFS dataSyncBufs[WMM_NUM_AC]; - A_UINT8 i,numPriStreams=0; - A_STATUS status = A_OK; - A_UINT8 wmi_fatPipeExists; - - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - memset(dataSyncBufs,0,sizeof(dataSyncBufs)); - - /* lock out while we walk through the priority list and assemble our local array */ - LOCK_WMI(pWmiPriv); - /* Cache the data stream exists within the lock */ - wmi_fatPipeExists =pWmiPriv->wmi_fatPipeExists; - - for (i=0; i < WMM_NUM_AC ; i++) { - if (wmi_fatPipeExists & (1 << i)) { - numPriStreams++; - dataSyncBufs[numPriStreams-1].trafficClass = i; - } - } - - UNLOCK_WMI(pWmiPriv); - - /* dataSyncBufs is now filled with entries (starting at index 0) containing valid streamIDs */ - - do { - /* - * We allocate all network buffers needed so we will be able to - * send all required frames. - */ - cmd_osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (cmd_osbuf == NULL) { - status = A_NO_MEMORY; - break; - } - - A_NETBUF_PUT(cmd_osbuf, sizeof(*cmd)); - - cmd = (WMI_SYNC_CMD *)(A_NETBUF_DATA(cmd_osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - - /* In the SYNC cmd sent on the control Ep, send a bitmap of the data - * eps on which the Data Sync will be sent - */ - cmd->dataSyncMap = wmi_fatPipeExists; - - for (i=0; i < numPriStreams ; i++) { - dataSyncBufs[i].osbuf = A_NETBUF_ALLOC(0); - if (dataSyncBufs[i].osbuf == NULL) { - status = A_NO_MEMORY; - break; - } - } //end for - - /* if Buffer allocation for any of the dataSync fails, then do not - * send the Synchronize cmd on the control ep - */ - if (A_FAILED(status)) { - break; - } - - /* - * Send sync cmd followed by sync data messages on all endpoints being - * used - */ - status = wmi_cmd_send(wmip, cmd_osbuf, WMI_SYNCHRONIZE_CMDID, - NO_SYNC_WMIFLAG); - - if (A_FAILED(status)) { - break; - } - /* cmd buffer sent, we no longer own it */ - cmd_osbuf = NULL; - - for(i=0; i < numPriStreams; i++) { - A_ASSERT(dataSyncBufs[i].osbuf != NULL); - status = wmi_dataSync_send(wmip, - dataSyncBufs[i].osbuf, - A_WMI_Ac2EndpointID(wmip->wmi_devt, - dataSyncBufs[i]. - trafficClass) - ); - - if (A_FAILED(status)) { - break; - } - /* we don't own this buffer anymore, NULL it out of the array so it - * won't get cleaned up */ - dataSyncBufs[i].osbuf = NULL; - } //end for - - } while(FALSE); - - /* free up any resources left over (possibly due to an error) */ - - if (cmd_osbuf != NULL) { - A_NETBUF_FREE(cmd_osbuf); - } - - for (i = 0; i < numPriStreams; i++) { - if (dataSyncBufs[i].osbuf != NULL) { - A_NETBUF_FREE(dataSyncBufs[i].osbuf); - } - } - - return (status); -} - -A_STATUS -wmi_create_pstream_cmd(struct wmi_t *wmip, WMI_CREATE_PSTREAM_CMD *params) -{ - void *osbuf; - WMI_CREATE_PSTREAM_CMD *cmd; - A_UINT8 fatPipeExistsForAC=0; - A_INT32 minimalPHY = 0; - A_INT32 nominalPHY = 0; - A_STATUS status; - - /* Validate all the parameters. */ - if( !((params->userPriority < 8) && - (params->userPriority <= 0x7) && - (convert_userPriority_to_trafficClass(params->userPriority) == params->trafficClass) && - (params->trafficDirection == UPLINK_TRAFFIC || - params->trafficDirection == DNLINK_TRAFFIC || - params->trafficDirection == BIDIR_TRAFFIC) && - (params->trafficType == TRAFFIC_TYPE_APERIODIC || - params->trafficType == TRAFFIC_TYPE_PERIODIC ) && - (params->voicePSCapability == DISABLE_FOR_THIS_AC || - params->voicePSCapability == ENABLE_FOR_THIS_AC || - params->voicePSCapability == ENABLE_FOR_ALL_AC) && - (params->tsid == WMI_IMPLICIT_PSTREAM || params->tsid <= WMI_MAX_THINSTREAM)) ) - { - return A_EINVAL; - } - - // - // check nominal PHY rate is >= minimalPHY, so that DUT - // can allow TSRS IE - // - - // get the physical rate - minimalPHY = ((params->minPhyRate / 1000)/1000); // unit of bps - - // check minimal phy < nominal phy rate - // - if (params->nominalPHY >= minimalPHY) - { - nominalPHY = (params->nominalPHY * 1000)/500; // unit of 500 kbps - A_DPRINTF(DBG_WMI, - (DBGFMT "TSRS IE Enabled::MinPhy %x->NominalPhy ===> %x\n", DBGARG, - minimalPHY, nominalPHY)); - - params->nominalPHY = nominalPHY; - } - else - { - params->nominalPHY = 0; - } - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - A_DPRINTF(DBG_WMI, - (DBGFMT "Sending create_pstream_cmd: ac=%d tsid:%d\n", DBGARG, - params->trafficClass, params->tsid)); - - cmd = (WMI_CREATE_PSTREAM_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - A_MEMCPY(cmd, params, sizeof(*cmd)); - - if (!cmd->inactivityInt) { - A_NETBUF_FREE(osbuf); - return A_EINVAL; - } - - /* this is an implicitly created Fat pipe */ - if ((A_UINT32)params->tsid == (A_UINT32)WMI_IMPLICIT_PSTREAM) { - LOCK_WMI(pWmiPriv); - fatPipeExistsForAC = (pWmiPriv->wmi_fatPipeExists & (1 << params->trafficClass)); - /* - * EV#84204 target assert failure in _tx_aggr_drain_post_process() - * To prevent the driver from sending the back-to-back CREATE_PSTREAM cmd - */ - if (fatPipeExistsForAC) { - UNLOCK_WMI(pWmiPriv); - A_NETBUF_FREE(osbuf); - return A_OK; - } - pWmiPriv->wmi_fatPipeExists |= (1<trafficClass); - UNLOCK_WMI(pWmiPriv); - } else { - /* this is an explicitly created thin stream within a fat pipe */ - LOCK_WMI(pWmiPriv); - fatPipeExistsForAC = (pWmiPriv->wmi_fatPipeExists & (1 << params->trafficClass)); - pWmiPriv->wmi_streamExistsForAC[params->trafficClass] |= (1<tsid); - /* if a thinstream becomes active, the fat pipe automatically - * becomes active - */ - pWmiPriv->wmi_fatPipeExists |= (1<trafficClass); - UNLOCK_WMI(pWmiPriv); - } - - /* Indicate activty change to driver layer only if this is the - * first TSID to get created in this AC explicitly or an implicit - * fat pipe is getting created. - */ - if (!fatPipeExistsForAC) { - A_WMI_STREAM_TX_ACTIVE(wmip->wmi_devt, params->trafficClass); - } - - /* mike: should be SYNC_BEFORE_WMIFLAG */ - status = wmi_cmd_send(wmip, osbuf, WMI_CREATE_PSTREAM_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_delete_pstream_cmd(struct wmi_t *wmip, A_UINT8 trafficClass, A_UINT8 tsid) -{ - void *osbuf; - WMI_DELETE_PSTREAM_CMD *cmd; - A_STATUS status; - A_UINT16 activeTsids=0; - - /* validate the parameters */ - if (trafficClass > 3) { - A_DPRINTF(DBG_WMI, (DBGFMT "Invalid trafficClass: %d\n", DBGARG, trafficClass)); - return A_EINVAL; - } - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_DELETE_PSTREAM_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - - cmd->trafficClass = trafficClass; - cmd->tsid = tsid; - - LOCK_WMI(pWmiPriv); - activeTsids = pWmiPriv->wmi_streamExistsForAC[trafficClass]; - UNLOCK_WMI(pWmiPriv); - - /* Check if the tsid was created & exists */ - if (!(activeTsids & (1<wmi_streamExistsForAC[trafficClass] &= ~(1<wmi_streamExistsForAC[trafficClass]; - UNLOCK_WMI(pWmiPriv); - - - /* Indicate stream inactivity to driver layer only if all tsids - * within this AC are deleted. - */ - if(!activeTsids) { - A_WMI_STREAM_TX_INACTIVE(wmip->wmi_devt, trafficClass); - pWmiPriv->wmi_fatPipeExists &= ~(1< 15)){ - - return A_EINVAL; - } - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_FRAME_RATES_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - - frameType = (A_UINT8)((subType << 4) | type); - - cmd->bEnableMask = bEnable; - cmd->frameType = frameType; - cmd->frameRateMask[0] = rateMask; - cmd->frameRateMask[1] = 0; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_FRAMERATES_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -/* - * used to set the bit rate. rate is in Kbps. If rate == -1 - * then auto selection is used. - */ -A_STATUS -wmi_set_bitrate_cmd(struct wmi_t *wmip, A_INT32 dataRate, A_INT32 mgmtRate, A_INT32 ctlRate) -{ - void *osbuf; - WMI_BIT_RATE_CMD *cmd; - A_INT8 drix, mrix, crix, ret_val; - A_STATUS status; - - if (dataRate != -1) { - ret_val = wmi_validate_bitrate(wmip, dataRate, &drix); - if(ret_val == A_EINVAL){ - return A_EINVAL; - } - } else { - drix = -1; - } - - if (mgmtRate != -1) { - ret_val = wmi_validate_bitrate(wmip, mgmtRate, &mrix); - if(ret_val == A_EINVAL){ - return A_EINVAL; - } - } else { - mrix = -1; - } - if (ctlRate != -1) { - ret_val = wmi_validate_bitrate(wmip, ctlRate, &crix); - if(ret_val == A_EINVAL){ - return A_EINVAL; - } - } else { - crix = -1; - } - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_BIT_RATE_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - - cmd->rateIndex = drix; - cmd->mgmtRateIndex = mrix; - cmd->ctlRateIndex = crix; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_BITRATE_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_get_bitrate_cmd(struct wmi_t *wmip) -{ - return wmi_simple_cmd(wmip, WMI_GET_BITRATE_CMDID); -} - -/* - * Returns TRUE iff the given rate index is legal in the current PHY mode. - */ -A_BOOL -wmi_is_bitrate_index_valid(struct wmi_t *wmip, A_INT32 rateIndex) -{ - WMI_PHY_MODE phyMode = (WMI_PHY_MODE) wmip->wmi_phyMode; - A_BOOL isValid = TRUE; - switch(phyMode) { - case WMI_11A_MODE: - if (wmip->wmi_ht_cap[A_BAND_5GHZ].enable){ - if ((rateIndex < MODE_A_SUPPORT_RATE_START) || (rateIndex > MODE_GHT20_SUPPORT_RATE_STOP)) { - isValid = FALSE; - } - } else { - if ((rateIndex < MODE_A_SUPPORT_RATE_START) || (rateIndex > MODE_A_SUPPORT_RATE_STOP)) { - isValid = FALSE; - } - } - break; - - case WMI_11B_MODE: - if ((rateIndex < MODE_B_SUPPORT_RATE_START) || (rateIndex > MODE_B_SUPPORT_RATE_STOP)) { - isValid = FALSE; - } - break; - - case WMI_11GONLY_MODE: - if (wmip->wmi_ht_cap[A_BAND_24GHZ].enable){ - if ((rateIndex < MODE_GONLY_SUPPORT_RATE_START) || (rateIndex > MODE_GHT20_SUPPORT_RATE_STOP)) { - isValid = FALSE; - } - } else { - if ((rateIndex < MODE_GONLY_SUPPORT_RATE_START) || (rateIndex > MODE_GONLY_SUPPORT_RATE_STOP)) { - isValid = FALSE; - } - } - break; - - case WMI_11G_MODE: - case WMI_11AG_MODE: - if (wmip->wmi_ht_cap[A_BAND_24GHZ].enable){ - if ((rateIndex < MODE_G_SUPPORT_RATE_START) || (rateIndex > MODE_GHT20_SUPPORT_RATE_STOP)) { - isValid = FALSE; - } - } else { - if ((rateIndex < MODE_G_SUPPORT_RATE_START) || (rateIndex > MODE_G_SUPPORT_RATE_STOP)) { - isValid = FALSE; - } - } - break; - default: - A_ASSERT(FALSE); - break; - } - - return isValid; -} - -A_INT8 -wmi_validate_bitrate(struct wmi_t *wmip, A_INT32 rate, A_INT8 *rate_idx) -{ - A_INT8 i; - A_UINT8 sgi; - - sgi = wmip->wmi_ht_cap[A_BAND_24GHZ].short_GI_20MHz; - sgi |= wmip->wmi_ht_cap[A_BAND_5GHZ].short_GI_20MHz; - - for (i=0;;i++) - { - if (wmi_rateTable[(A_UINT32) i][sgi] == 0) { - return A_EINVAL; - } - if (wmi_rateTable[(A_UINT32) i][sgi] == rate) { - break; - } - } - - if(wmi_is_bitrate_index_valid(wmip, (A_INT32) i) != TRUE) { - return A_EINVAL; - } - - *rate_idx = i; - return A_OK; -} - -A_STATUS -wmi_set_fixrates_cmd(struct wmi_t *wmip, A_UINT32 *fixRatesMask) -{ - void *osbuf; - WMI_FIX_RATES_CMD *cmd; - A_STATUS status; -#if 0 - A_INT32 rateIndex; -/* This check does not work for AR6003 as the HT modes are enabled only when - * the STA is connected to a HT_BSS and is not based only on channel. It is - * safe to skip this check however because rate control will only use rates - * that are permitted by the valid rate mask and the fix rate mask. Meaning - * the fix rate mask is not sufficient by itself to cause an invalid rate - * to be used. */ - /* Make sure all rates in the mask are valid in the current PHY mode */ - for(rateIndex = 0; rateIndex < MAX_NUMBER_OF_SUPPORT_RATES; rateIndex++) { - if((1 << rateIndex) & (A_UINT32)fixRatesMask) { - if(wmi_is_bitrate_index_valid(wmip, rateIndex) != TRUE) { - A_DPRINTF(DBG_WMI, (DBGFMT "Set Fix Rates command failed: Given rate is illegal in current PHY mode\n", DBGARG)); - return A_EINVAL; - } - } - } -#endif - - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_FIX_RATES_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - - cmd->fixRateMask[0] = fixRatesMask[0]; - cmd->fixRateMask[1] = fixRatesMask[1]; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_FIXRATES_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_get_ratemask_cmd(struct wmi_t *wmip) -{ - return wmi_simple_cmd(wmip, WMI_GET_FIXRATES_CMDID); -} - -A_STATUS -wmi_get_channelList_cmd(struct wmi_t *wmip) -{ - return wmi_simple_cmd(wmip, WMI_GET_CHANNEL_LIST_CMDID); -} - -/* - * used to generate a wmi sey channel Parameters cmd. - * mode should always be specified and corresponds to the phy mode of the - * wlan. - * numChan should alway sbe specified. If zero indicates that all available - * channels should be used. - * channelList is an array of channel frequencies (in Mhz) which the radio - * should limit its operation to. It should be NULL if numChan == 0. Size of - * array should correspond to numChan entries. - */ -A_STATUS -wmi_set_channelParams_cmd(struct wmi_t *wmip, A_UINT8 scanParam, - WMI_PHY_MODE mode, A_INT8 numChan, - A_UINT16 *channelList) -{ - void *osbuf; - WMI_CHANNEL_PARAMS_CMD *cmd; - A_INT8 size; - A_STATUS status; - - if (wmip->wmi_phyMode != mode) { - wmi_free_allnodes(wmip); - } - - size = sizeof (*cmd); - - if (numChan) { - if (numChan > WMI_MAX_CHANNELS) { - return A_EINVAL; - } - size += sizeof(A_UINT16) * (numChan - 1); - } - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, size); - - cmd = (WMI_CHANNEL_PARAMS_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, size); - - wmip->wmi_phyMode = mode; - cmd->scanParam = scanParam; - cmd->phyMode = mode; - cmd->numChannels = numChan; - A_MEMCPY(cmd->channelList, channelList, numChan * sizeof(A_UINT16)); - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_CHANNEL_PARAMS_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -void -wmi_cache_configure_rssithreshold(struct wmi_t *wmip, WMI_RSSI_THRESHOLD_PARAMS_CMD *rssiCmd) -{ - SQ_THRESHOLD_PARAMS *sq_thresh = - &wmip->wmi_SqThresholdParams[SIGNAL_QUALITY_METRICS_RSSI]; - /* - * Parse the command and store the threshold values here. The checks - * for valid values can be put here - */ - sq_thresh->weight = rssiCmd->weight; - sq_thresh->polling_interval = rssiCmd->pollTime; - - sq_thresh->upper_threshold[0] = rssiCmd->thresholdAbove1_Val - SIGNAL_QUALITY_NOISE_FLOOR; - sq_thresh->upper_threshold[1] = rssiCmd->thresholdAbove2_Val - SIGNAL_QUALITY_NOISE_FLOOR; - sq_thresh->upper_threshold[2] = rssiCmd->thresholdAbove3_Val - SIGNAL_QUALITY_NOISE_FLOOR; - sq_thresh->upper_threshold[3] = rssiCmd->thresholdAbove4_Val - SIGNAL_QUALITY_NOISE_FLOOR; - sq_thresh->upper_threshold[4] = rssiCmd->thresholdAbove5_Val - SIGNAL_QUALITY_NOISE_FLOOR; - sq_thresh->upper_threshold[5] = rssiCmd->thresholdAbove6_Val - SIGNAL_QUALITY_NOISE_FLOOR; - sq_thresh->upper_threshold_valid_count = 6; - - /* List sorted in descending order */ - sq_thresh->lower_threshold[0] = rssiCmd->thresholdBelow6_Val - SIGNAL_QUALITY_NOISE_FLOOR; - sq_thresh->lower_threshold[1] = rssiCmd->thresholdBelow5_Val - SIGNAL_QUALITY_NOISE_FLOOR; - sq_thresh->lower_threshold[2] = rssiCmd->thresholdBelow4_Val - SIGNAL_QUALITY_NOISE_FLOOR; - sq_thresh->lower_threshold[3] = rssiCmd->thresholdBelow3_Val - SIGNAL_QUALITY_NOISE_FLOOR; - sq_thresh->lower_threshold[4] = rssiCmd->thresholdBelow2_Val - SIGNAL_QUALITY_NOISE_FLOOR; - sq_thresh->lower_threshold[5] = rssiCmd->thresholdBelow1_Val - SIGNAL_QUALITY_NOISE_FLOOR; - sq_thresh->lower_threshold_valid_count = 6; - - if (!rssi_event_value) { - /* - * Configuring the thresholds to their extremes allows the host to get an - * event from the target which is used for the configuring the correct - * thresholds - */ - rssiCmd->thresholdAbove1_Val = sq_thresh->upper_threshold[0]; - rssiCmd->thresholdBelow1_Val = sq_thresh->lower_threshold[0]; - } else { - /* - * In case the user issues multiple times of rssi_threshold_setting, - * we should not use the extreames anymore, the target does not expect that. - */ - rssiCmd->thresholdAbove1_Val = ar6000_get_upper_threshold(rssi_event_value, sq_thresh, - sq_thresh->upper_threshold_valid_count); - rssiCmd->thresholdBelow1_Val = ar6000_get_lower_threshold(rssi_event_value, sq_thresh, - sq_thresh->lower_threshold_valid_count); -} -} - -A_STATUS -wmi_set_rssi_threshold_params(struct wmi_t *wmip, - WMI_RSSI_THRESHOLD_PARAMS_CMD *rssiCmd) -{ - - /* Check these values are in ascending order */ - if( rssiCmd->thresholdAbove6_Val <= rssiCmd->thresholdAbove5_Val || - rssiCmd->thresholdAbove5_Val <= rssiCmd->thresholdAbove4_Val || - rssiCmd->thresholdAbove4_Val <= rssiCmd->thresholdAbove3_Val || - rssiCmd->thresholdAbove3_Val <= rssiCmd->thresholdAbove2_Val || - rssiCmd->thresholdAbove2_Val <= rssiCmd->thresholdAbove1_Val || - rssiCmd->thresholdBelow6_Val <= rssiCmd->thresholdBelow5_Val || - rssiCmd->thresholdBelow5_Val <= rssiCmd->thresholdBelow4_Val || - rssiCmd->thresholdBelow4_Val <= rssiCmd->thresholdBelow3_Val || - rssiCmd->thresholdBelow3_Val <= rssiCmd->thresholdBelow2_Val || - rssiCmd->thresholdBelow2_Val <= rssiCmd->thresholdBelow1_Val) - { - return A_EINVAL; - } - - wmi_cache_configure_rssithreshold(wmip, rssiCmd); - - return (wmi_send_rssi_threshold_params(wmip, rssiCmd)); -} - -A_STATUS -wmi_set_ip_cmd(struct wmi_t *wmip, WMI_SET_IP_CMD *ipCmd) -{ - void *osbuf; - WMI_SET_IP_CMD *cmd; - A_STATUS status; - - /* Multicast address are not valid */ - if((*((A_UINT8*)&ipCmd->ips[0]) >= 0xE0) || - (*((A_UINT8*)&ipCmd->ips[1]) >= 0xE0)) { - return A_EINVAL; - } - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_SET_IP_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_SET_IP_CMD)); - cmd = (WMI_SET_IP_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMCPY(cmd, ipCmd, sizeof(WMI_SET_IP_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_IP_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_host_sleep_mode_cmd(struct wmi_t *wmip, - WMI_SET_HOST_SLEEP_MODE_CMD *hostModeCmd) -{ - void *osbuf; - A_INT8 size; - WMI_SET_HOST_SLEEP_MODE_CMD *cmd; - A_UINT16 activeTsids=0; - A_UINT8 streamExists=0; - A_UINT8 i; - A_STATUS status; - - if( hostModeCmd->awake == hostModeCmd->asleep) { - return A_EINVAL; - } - - size = sizeof (*cmd); - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, size); - - cmd = (WMI_SET_HOST_SLEEP_MODE_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, size); - A_MEMCPY(cmd, hostModeCmd, sizeof(WMI_SET_HOST_SLEEP_MODE_CMD)); - - if(hostModeCmd->asleep) { - /* - * Relinquish credits from all implicitly created pstreams since when we - * go to sleep. If user created explicit thinstreams exists with in a - * fatpipe leave them intact for the user to delete - */ - LOCK_WMI(pWmiPriv); - streamExists = pWmiPriv->wmi_fatPipeExists; - UNLOCK_WMI(pWmiPriv); - - for(i=0;i< WMM_NUM_AC;i++) { - if (streamExists & (1<wmi_streamExistsForAC[i]; - UNLOCK_WMI(pWmiPriv); - /* If there are no user created thin streams delete the fatpipe */ - if(!activeTsids) { - streamExists &= ~(1<wmi_devt,i); - } - } - } - - /* Update the fatpipes that exists*/ - LOCK_WMI(pWmiPriv); - pWmiPriv->wmi_fatPipeExists = streamExists; - UNLOCK_WMI(pWmiPriv); - } - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_HOST_SLEEP_MODE_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_wow_mode_cmd(struct wmi_t *wmip, - WMI_SET_WOW_MODE_CMD *wowModeCmd) -{ - void *osbuf; - A_INT8 size; - WMI_SET_WOW_MODE_CMD *cmd; - A_STATUS status; - - size = sizeof (*cmd); - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, size); - - cmd = (WMI_SET_WOW_MODE_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, size); - A_MEMCPY(cmd, wowModeCmd, sizeof(WMI_SET_WOW_MODE_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_WOW_MODE_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_get_wow_list_cmd(struct wmi_t *wmip, - WMI_GET_WOW_LIST_CMD *wowListCmd) -{ - void *osbuf; - A_INT8 size; - WMI_GET_WOW_LIST_CMD *cmd; - A_STATUS status; - - size = sizeof (*cmd); - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, size); - - cmd = (WMI_GET_WOW_LIST_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, size); - A_MEMCPY(cmd, wowListCmd, sizeof(WMI_GET_WOW_LIST_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_GET_WOW_LIST_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -static A_STATUS -wmi_get_wow_list_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_GET_WOW_LIST_REPLY *reply; - - if (len < sizeof(WMI_GET_WOW_LIST_REPLY)) { - return A_EINVAL; - } - reply = (WMI_GET_WOW_LIST_REPLY *)datap; - - A_WMI_WOW_LIST_EVENT(wmip->wmi_devt, reply->num_filters, - reply); - - return A_OK; -} - -A_STATUS wmi_add_wow_pattern_cmd(struct wmi_t *wmip, - WMI_ADD_WOW_PATTERN_CMD *addWowCmd, - A_UINT8* pattern, A_UINT8* mask, - A_UINT8 pattern_size) -{ - void *osbuf; - A_INT8 size; - WMI_ADD_WOW_PATTERN_CMD *cmd; - A_UINT8 *filter_mask = NULL; - A_STATUS status; - - size = sizeof (*cmd); - - size += ((2 * addWowCmd->filter_size)* sizeof(A_UINT8)); - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, size); - - cmd = (WMI_ADD_WOW_PATTERN_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->filter_list_id = addWowCmd->filter_list_id; - cmd->filter_offset = addWowCmd->filter_offset; - cmd->filter_size = addWowCmd->filter_size; - - A_MEMCPY(cmd->filter, pattern, addWowCmd->filter_size); - - filter_mask = (A_UINT8*)(cmd->filter + cmd->filter_size); - A_MEMCPY(filter_mask, mask, addWowCmd->filter_size); - - - status = wmi_cmd_send(wmip, osbuf, WMI_ADD_WOW_PATTERN_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_del_wow_pattern_cmd(struct wmi_t *wmip, - WMI_DEL_WOW_PATTERN_CMD *delWowCmd) -{ - void *osbuf; - A_INT8 size; - WMI_DEL_WOW_PATTERN_CMD *cmd; - A_STATUS status; - - size = sizeof (*cmd); - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, size); - - cmd = (WMI_DEL_WOW_PATTERN_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, size); - A_MEMCPY(cmd, delWowCmd, sizeof(WMI_DEL_WOW_PATTERN_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_DEL_WOW_PATTERN_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -void -wmi_cache_configure_snrthreshold(struct wmi_t *wmip, WMI_SNR_THRESHOLD_PARAMS_CMD *snrCmd) -{ - SQ_THRESHOLD_PARAMS *sq_thresh = - &wmip->wmi_SqThresholdParams[SIGNAL_QUALITY_METRICS_SNR]; - /* - * Parse the command and store the threshold values here. The checks - * for valid values can be put here - */ - sq_thresh->weight = snrCmd->weight; - sq_thresh->polling_interval = snrCmd->pollTime; - - sq_thresh->upper_threshold[0] = snrCmd->thresholdAbove1_Val; - sq_thresh->upper_threshold[1] = snrCmd->thresholdAbove2_Val; - sq_thresh->upper_threshold[2] = snrCmd->thresholdAbove3_Val; - sq_thresh->upper_threshold[3] = snrCmd->thresholdAbove4_Val; - sq_thresh->upper_threshold_valid_count = 4; - - /* List sorted in descending order */ - sq_thresh->lower_threshold[0] = snrCmd->thresholdBelow4_Val; - sq_thresh->lower_threshold[1] = snrCmd->thresholdBelow3_Val; - sq_thresh->lower_threshold[2] = snrCmd->thresholdBelow2_Val; - sq_thresh->lower_threshold[3] = snrCmd->thresholdBelow1_Val; - sq_thresh->lower_threshold_valid_count = 4; - - if (!snr_event_value) { - /* - * Configuring the thresholds to their extremes allows the host to get an - * event from the target which is used for the configuring the correct - * thresholds - */ - snrCmd->thresholdAbove1_Val = (A_UINT8)sq_thresh->upper_threshold[0]; - snrCmd->thresholdBelow1_Val = (A_UINT8)sq_thresh->lower_threshold[0]; - } else { - /* - * In case the user issues multiple times of snr_threshold_setting, - * we should not use the extreames anymore, the target does not expect that. - */ - snrCmd->thresholdAbove1_Val = ar6000_get_upper_threshold(snr_event_value, sq_thresh, - sq_thresh->upper_threshold_valid_count); - snrCmd->thresholdBelow1_Val = ar6000_get_lower_threshold(snr_event_value, sq_thresh, - sq_thresh->lower_threshold_valid_count); - } - -} -A_STATUS -wmi_set_snr_threshold_params(struct wmi_t *wmip, - WMI_SNR_THRESHOLD_PARAMS_CMD *snrCmd) -{ - if( snrCmd->thresholdAbove4_Val <= snrCmd->thresholdAbove3_Val || - snrCmd->thresholdAbove3_Val <= snrCmd->thresholdAbove2_Val || - snrCmd->thresholdAbove2_Val <= snrCmd->thresholdAbove1_Val || - snrCmd->thresholdBelow4_Val <= snrCmd->thresholdBelow3_Val || - snrCmd->thresholdBelow3_Val <= snrCmd->thresholdBelow2_Val || - snrCmd->thresholdBelow2_Val <= snrCmd->thresholdBelow1_Val) - { - return A_EINVAL; - } - wmi_cache_configure_snrthreshold(wmip, snrCmd); - return (wmi_send_snr_threshold_params(wmip, snrCmd)); -} - -A_STATUS -wmi_clr_rssi_snr(struct wmi_t *wmip) -{ - void *osbuf; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(int)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - status = wmi_cmd_send(wmip, osbuf, WMI_CLR_RSSI_SNR_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_lq_threshold_params(struct wmi_t *wmip, - WMI_LQ_THRESHOLD_PARAMS_CMD *lqCmd) -{ - void *osbuf; - A_INT8 size; - WMI_LQ_THRESHOLD_PARAMS_CMD *cmd; - A_STATUS status; - /* These values are in ascending order */ - if( lqCmd->thresholdAbove4_Val <= lqCmd->thresholdAbove3_Val || - lqCmd->thresholdAbove3_Val <= lqCmd->thresholdAbove2_Val || - lqCmd->thresholdAbove2_Val <= lqCmd->thresholdAbove1_Val || - lqCmd->thresholdBelow4_Val <= lqCmd->thresholdBelow3_Val || - lqCmd->thresholdBelow3_Val <= lqCmd->thresholdBelow2_Val || - lqCmd->thresholdBelow2_Val <= lqCmd->thresholdBelow1_Val ) { - - return A_EINVAL; - } - - size = sizeof (*cmd); - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, size); - - cmd = (WMI_LQ_THRESHOLD_PARAMS_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, size); - A_MEMCPY(cmd, lqCmd, sizeof(WMI_LQ_THRESHOLD_PARAMS_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_LQ_THRESHOLD_PARAMS_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_error_report_bitmask(struct wmi_t *wmip, A_UINT32 mask) -{ - void *osbuf; - A_INT8 size; - WMI_TARGET_ERROR_REPORT_BITMASK *cmd; - A_STATUS status; - - size = sizeof (*cmd); - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, size); - - cmd = (WMI_TARGET_ERROR_REPORT_BITMASK *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, size); - - cmd->bitmask = mask; - - status = wmi_cmd_send(wmip, osbuf, WMI_TARGET_ERROR_REPORT_BITMASK_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_get_challenge_resp_cmd(struct wmi_t *wmip, A_UINT32 cookie, A_UINT32 source) -{ - void *osbuf; - WMIX_HB_CHALLENGE_RESP_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMIX_HB_CHALLENGE_RESP_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->cookie = cookie; - cmd->source = source; - - status = wmi_cmd_send_xtnd(wmip, osbuf, WMIX_HB_CHALLENGE_RESP_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_config_debug_module_cmd(struct wmi_t *wmip, A_UINT16 mmask, - A_UINT16 tsr, A_BOOL rep, A_UINT16 size, - A_UINT32 valid) -{ - void *osbuf; - WMIX_DBGLOG_CFG_MODULE_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMIX_DBGLOG_CFG_MODULE_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->config.cfgmmask = mmask; - cmd->config.cfgtsr = tsr; - cmd->config.cfgrep = rep; - cmd->config.cfgsize = size; - cmd->config.cfgvalid = valid; - - status = wmi_cmd_send_xtnd(wmip, osbuf, WMIX_DBGLOG_CFG_MODULE_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_get_stats_cmd(struct wmi_t *wmip) -{ - return wmi_simple_cmd(wmip, WMI_GET_STATISTICS_CMDID); -} - -A_STATUS -wmi_addBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex, A_UINT8 *bssid) -{ - void *osbuf; - WMI_ADD_BAD_AP_CMD *cmd; - A_STATUS status; - - if ((bssid == NULL) || (apIndex > WMI_MAX_BAD_AP_INDEX)) { - return A_EINVAL; - } - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_ADD_BAD_AP_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->badApIndex = apIndex; - A_MEMCPY(cmd->bssid, bssid, sizeof(cmd->bssid)); - - status = wmi_cmd_send(wmip, osbuf, WMI_ADD_BAD_AP_CMDID, SYNC_BEFORE_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_deleteBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex) -{ - void *osbuf; - WMI_DELETE_BAD_AP_CMD *cmd; - A_STATUS status; - - if (apIndex > WMI_MAX_BAD_AP_INDEX) { - return A_EINVAL; - } - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_DELETE_BAD_AP_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->badApIndex = apIndex; - - status = wmi_cmd_send(wmip, osbuf, WMI_DELETE_BAD_AP_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_abort_scan_cmd(struct wmi_t *wmip) -{ - return wmi_simple_cmd(wmip, WMI_ABORT_SCAN_CMDID); -} - -A_STATUS -wmi_set_txPwr_cmd(struct wmi_t *wmip, A_UINT8 dbM) -{ - void *osbuf; - WMI_SET_TX_PWR_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_TX_PWR_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->dbM = dbM; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_TX_PWR_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_get_txPwr_cmd(struct wmi_t *wmip) -{ - return wmi_simple_cmd(wmip, WMI_GET_TX_PWR_CMDID); -} - -A_UINT16 -wmi_get_mapped_qos_queue(struct wmi_t *wmip, A_UINT8 trafficClass) -{ - A_UINT16 activeTsids=0; - - LOCK_WMI(pWmiPriv); - activeTsids = pWmiPriv->wmi_streamExistsForAC[trafficClass]; - UNLOCK_WMI(pWmiPriv); - - return activeTsids; -} - -A_STATUS -wmi_get_roam_tbl_cmd(struct wmi_t *wmip) -{ - return wmi_simple_cmd(wmip, WMI_GET_ROAM_TBL_CMDID); -} - -A_STATUS -wmi_get_roam_data_cmd(struct wmi_t *wmip, A_UINT8 roamDataType) -{ - void *osbuf; - A_UINT32 size = sizeof(A_UINT8); - WMI_TARGET_ROAM_DATA *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(size); /* no payload */ - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, size); - - cmd = (WMI_TARGET_ROAM_DATA *)(A_NETBUF_DATA(osbuf)); - cmd->roamDataType = roamDataType; - - status = wmi_cmd_send(wmip, osbuf, WMI_GET_ROAM_DATA_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_roam_ctrl_cmd(struct wmi_t *wmip, WMI_SET_ROAM_CTRL_CMD *p, - A_UINT8 size) -{ - void *osbuf; - WMI_SET_ROAM_CTRL_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, size); - - cmd = (WMI_SET_ROAM_CTRL_CMD *)(A_NETBUF_DATA(osbuf)); - - if (size) - { - A_MEMZERO(cmd, size); - A_MEMCPY(cmd, p, size); - } - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_ROAM_CTRL_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_powersave_timers_cmd(struct wmi_t *wmip, - WMI_POWERSAVE_TIMERS_POLICY_CMD *pCmd, - A_UINT8 size) -{ - void *osbuf; - WMI_POWERSAVE_TIMERS_POLICY_CMD *cmd; - A_STATUS status; - - /* These timers can't be zero */ - if(!pCmd->psPollTimeout || !pCmd->triggerTimeout || - !(pCmd->apsdTimPolicy == IGNORE_TIM_ALL_QUEUES_APSD || - pCmd->apsdTimPolicy == PROCESS_TIM_ALL_QUEUES_APSD) || - !(pCmd->simulatedAPSDTimPolicy == IGNORE_TIM_SIMULATED_APSD || - pCmd->simulatedAPSDTimPolicy == PROCESS_TIM_SIMULATED_APSD)) - return A_EINVAL; - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, size); - - cmd = (WMI_POWERSAVE_TIMERS_POLICY_CMD *)(A_NETBUF_DATA(osbuf)); - - if (size) - { - A_MEMZERO(cmd, size); - A_MEMCPY(cmd, pCmd, size); - } - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_POWERSAVE_TIMERS_POLICY_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -#ifdef CONFIG_HOST_GPIO_SUPPORT -/* Send a command to Target to change GPIO output pins. */ -A_STATUS -wmi_gpio_output_set(struct wmi_t *wmip, - A_UINT32 set_mask, - A_UINT32 clear_mask, - A_UINT32 enable_mask, - A_UINT32 disable_mask) -{ - void *osbuf; - WMIX_GPIO_OUTPUT_SET_CMD *output_set; - int size; - A_STATUS status; - - size = sizeof(*output_set); - - A_DPRINTF(DBG_WMI, - (DBGFMT "Enter - set=0x%x clear=0x%x enb=0x%x dis=0x%x\n", DBGARG, - set_mask, clear_mask, enable_mask, disable_mask)); - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, size); - output_set = (WMIX_GPIO_OUTPUT_SET_CMD *)(A_NETBUF_DATA(osbuf)); - - output_set->set_mask = set_mask; - output_set->clear_mask = clear_mask; - output_set->enable_mask = enable_mask; - output_set->disable_mask = disable_mask; - - status = wmi_cmd_send_xtnd(wmip, osbuf, WMIX_GPIO_OUTPUT_SET_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -/* Send a command to the Target requesting state of the GPIO input pins */ -A_STATUS -wmi_gpio_input_get(struct wmi_t *wmip) -{ - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - return wmi_simple_cmd_xtnd(wmip, WMIX_GPIO_INPUT_GET_CMDID); -} - -/* Send a command to the Target that changes the value of a GPIO register. */ -A_STATUS -wmi_gpio_register_set(struct wmi_t *wmip, - A_UINT32 gpioreg_id, - A_UINT32 value) -{ - void *osbuf; - WMIX_GPIO_REGISTER_SET_CMD *register_set; - int size; - A_STATUS status; - - size = sizeof(*register_set); - - A_DPRINTF(DBG_WMI, - (DBGFMT "Enter - reg=%d value=0x%x\n", DBGARG, gpioreg_id, value)); - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, size); - register_set = (WMIX_GPIO_REGISTER_SET_CMD *)(A_NETBUF_DATA(osbuf)); - - register_set->gpioreg_id = gpioreg_id; - register_set->value = value; - - status = wmi_cmd_send_xtnd(wmip, osbuf, WMIX_GPIO_REGISTER_SET_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -/* Send a command to the Target to fetch the value of a GPIO register. */ -A_STATUS -wmi_gpio_register_get(struct wmi_t *wmip, - A_UINT32 gpioreg_id) -{ - void *osbuf; - WMIX_GPIO_REGISTER_GET_CMD *register_get; - int size; - A_STATUS status; - - size = sizeof(*register_get); - - A_DPRINTF(DBG_WMI, (DBGFMT "Enter - reg=%d\n", DBGARG, gpioreg_id)); - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, size); - register_get = (WMIX_GPIO_REGISTER_GET_CMD *)(A_NETBUF_DATA(osbuf)); - - register_get->gpioreg_id = gpioreg_id; - - status = wmi_cmd_send_xtnd(wmip, osbuf, WMIX_GPIO_REGISTER_GET_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -/* Send a command to the Target acknowledging some GPIO interrupts. */ -A_STATUS -wmi_gpio_intr_ack(struct wmi_t *wmip, - A_UINT32 ack_mask) -{ - void *osbuf; - WMIX_GPIO_INTR_ACK_CMD *intr_ack; - int size; - A_STATUS status; - - size = sizeof(*intr_ack); - - A_DPRINTF(DBG_WMI, (DBGFMT "Enter ack_mask=0x%x\n", DBGARG, ack_mask)); - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, size); - intr_ack = (WMIX_GPIO_INTR_ACK_CMD *)(A_NETBUF_DATA(osbuf)); - - intr_ack->ack_mask = ack_mask; - - status = wmi_cmd_send_xtnd(wmip, osbuf, WMIX_GPIO_INTR_ACK_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} -#endif /* CONFIG_HOST_GPIO_SUPPORT */ - -A_STATUS -wmi_set_access_params_cmd(struct wmi_t *wmip, A_UINT8 ac, A_UINT16 txop, A_UINT8 eCWmin, - A_UINT8 eCWmax, A_UINT8 aifsn) -{ - void *osbuf; - WMI_SET_ACCESS_PARAMS_CMD *cmd; - A_STATUS status; - - if ((eCWmin > WMI_MAX_CW_ACPARAM) || (eCWmax > WMI_MAX_CW_ACPARAM) || - (aifsn > WMI_MAX_AIFSN_ACPARAM) || (ac >= WMM_NUM_AC)) - { - return A_EINVAL; - } - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_ACCESS_PARAMS_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->txop = txop; - cmd->eCWmin = eCWmin; - cmd->eCWmax = eCWmax; - cmd->aifsn = aifsn; - cmd->ac = ac; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_ACCESS_PARAMS_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_retry_limits_cmd(struct wmi_t *wmip, A_UINT8 frameType, - A_UINT8 trafficClass, A_UINT8 maxRetries, - A_UINT8 enableNotify) -{ - void *osbuf; - WMI_SET_RETRY_LIMITS_CMD *cmd; - A_STATUS status; - - if ((frameType != MGMT_FRAMETYPE) && (frameType != CONTROL_FRAMETYPE) && - (frameType != DATA_FRAMETYPE)) - { - return A_EINVAL; - } - - if (maxRetries > WMI_MAX_RETRIES) { - return A_EINVAL; - } - - if (frameType != DATA_FRAMETYPE) { - trafficClass = 0; - } - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_RETRY_LIMITS_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->frameType = frameType; - cmd->trafficClass = trafficClass; - cmd->maxRetries = maxRetries; - cmd->enableNotify = enableNotify; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_RETRY_LIMITS_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -void -wmi_get_current_bssid(struct wmi_t *wmip, A_UINT8 *bssid) -{ - if (bssid != NULL) { - A_MEMCPY(bssid, wmip->wmi_bssid, ATH_MAC_LEN); - } -} - -A_STATUS -wmi_set_adhoc_bconIntvl_cmd(struct wmi_t *wmip, A_UINT16 intvl) -{ - void *osbuf; - WMI_BEACON_INT_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_BEACON_INT_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->beaconInterval = intvl; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_BEACON_INT_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - - -A_STATUS -wmi_set_voice_pkt_size_cmd(struct wmi_t *wmip, A_UINT16 voicePktSize) -{ - void *osbuf; - WMI_SET_VOICE_PKT_SIZE_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_VOICE_PKT_SIZE_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->voicePktSize = voicePktSize; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_VOICE_PKT_SIZE_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - - -A_STATUS -wmi_set_max_sp_len_cmd(struct wmi_t *wmip, A_UINT8 maxSPLen) -{ - void *osbuf; - WMI_SET_MAX_SP_LEN_CMD *cmd; - A_STATUS status; - - /* maxSPLen is a two-bit value. If user trys to set anything - * other than this, then its invalid - */ - if(maxSPLen & ~0x03) - return A_EINVAL; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_MAX_SP_LEN_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->maxSPLen = maxSPLen; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_MAX_SP_LEN_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_UINT8 -wmi_determine_userPriority( - A_UINT8 *pkt, - A_UINT32 layer2Pri) -{ - A_UINT8 ipPri; - iphdr *ipHdr = (iphdr *)pkt; - - /* Determine IPTOS priority */ - /* - * IP Tos format : - * (Refer Pg 57 WMM-test-plan-v1.2) - * IP-TOS - 8bits - * : DSCP(6-bits) ECN(2-bits) - * : DSCP - P2 P1 P0 X X X - * where (P2 P1 P0) form 802.1D - */ - ipPri = ipHdr->ip_tos >> 5; - ipPri &= 0x7; - - if ((layer2Pri & 0x7) > ipPri) - return ((A_UINT8)layer2Pri & 0x7); - else - return ipPri; -} - -A_UINT8 -convert_userPriority_to_trafficClass(A_UINT8 userPriority) -{ - return (up_to_ac[userPriority & 0x7]); -} - -A_UINT8 -wmi_get_power_mode_cmd(struct wmi_t *wmip) -{ - return wmip->wmi_powerMode; -} - -A_STATUS -wmi_verify_tspec_params(WMI_CREATE_PSTREAM_CMD *pCmd, A_BOOL tspecCompliance) -{ - A_STATUS ret = A_OK; - -#define TSPEC_SUSPENSION_INTERVAL_ATHEROS_DEF (~0) -#define TSPEC_SERVICE_START_TIME_ATHEROS_DEF 0 -#define TSPEC_MAX_BURST_SIZE_ATHEROS_DEF 0 -#define TSPEC_DELAY_BOUND_ATHEROS_DEF 0 -#define TSPEC_MEDIUM_TIME_ATHEROS_DEF 0 -#define TSPEC_SBA_ATHEROS_DEF 0x2000 /* factor is 1 */ - - /* Verify TSPEC params for ATHEROS compliance */ - if(tspecCompliance == ATHEROS_COMPLIANCE) { - if ((pCmd->suspensionInt != TSPEC_SUSPENSION_INTERVAL_ATHEROS_DEF) || - (pCmd->serviceStartTime != TSPEC_SERVICE_START_TIME_ATHEROS_DEF) || - (pCmd->minDataRate != pCmd->meanDataRate) || - (pCmd->minDataRate != pCmd->peakDataRate) || - (pCmd->maxBurstSize != TSPEC_MAX_BURST_SIZE_ATHEROS_DEF) || - (pCmd->delayBound != TSPEC_DELAY_BOUND_ATHEROS_DEF) || - (pCmd->sba != TSPEC_SBA_ATHEROS_DEF) || - (pCmd->mediumTime != TSPEC_MEDIUM_TIME_ATHEROS_DEF)) { - - A_DPRINTF(DBG_WMI, (DBGFMT "Invalid TSPEC params\n", DBGARG)); - //A_PRINTF("%s: Invalid TSPEC params\n", __func__); - ret = A_EINVAL; - } - } - - return ret; -} - -#ifdef CONFIG_HOST_TCMD_SUPPORT -static A_STATUS -wmi_tcmd_test_report_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_TCMD_RX_REPORT_EVENT(wmip->wmi_devt, datap, len); - - return A_OK; -} - -#endif /* CONFIG_HOST_TCMD_SUPPORT*/ - -A_STATUS -wmi_set_authmode_cmd(struct wmi_t *wmip, A_UINT8 mode) -{ - void *osbuf; - WMI_SET_AUTH_MODE_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_AUTH_MODE_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->mode = mode; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_AUTH_MODE_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_reassocmode_cmd(struct wmi_t *wmip, A_UINT8 mode) -{ - void *osbuf; - WMI_SET_REASSOC_MODE_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_REASSOC_MODE_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->mode = mode; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_REASSOC_MODE_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_lpreamble_cmd(struct wmi_t *wmip, A_UINT8 status, A_UINT8 preamblePolicy) -{ - void *osbuf; - WMI_SET_LPREAMBLE_CMD *cmd; - A_STATUS wmi_cmd_send_status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_LPREAMBLE_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->status = status; - cmd->preamblePolicy = preamblePolicy; - - wmi_cmd_send_status = wmi_cmd_send(wmip, osbuf, WMI_SET_LPREAMBLE_CMDID, - NO_SYNC_WMIFLAG); - - if (wmi_cmd_send_status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return wmi_cmd_send_status; -} - -A_STATUS -wmi_set_rts_cmd(struct wmi_t *wmip, A_UINT16 threshold) -{ - void *osbuf; - WMI_SET_RTS_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_RTS_CMD*)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->threshold = threshold; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_RTS_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_wmm_cmd(struct wmi_t *wmip, WMI_WMM_STATUS status) -{ - void *osbuf; - WMI_SET_WMM_CMD *cmd; - A_STATUS wmi_cmd_send_status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_WMM_CMD*)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->status = status; - - wmi_cmd_send_status = wmi_cmd_send(wmip, osbuf, WMI_SET_WMM_CMDID, - NO_SYNC_WMIFLAG); - - if (wmi_cmd_send_status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return wmi_cmd_send_status; -} - -A_STATUS -wmi_set_qos_supp_cmd(struct wmi_t *wmip, A_UINT8 status) -{ - void *osbuf; - WMI_SET_QOS_SUPP_CMD *cmd; - A_STATUS wmi_cmd_send_status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_QOS_SUPP_CMD*)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->status = status; - wmi_cmd_send_status = wmi_cmd_send(wmip, osbuf, WMI_SET_QOS_SUPP_CMDID, - NO_SYNC_WMIFLAG); - - if (wmi_cmd_send_status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return wmi_cmd_send_status; -} - - -A_STATUS -wmi_set_wmm_txop(struct wmi_t *wmip, WMI_TXOP_CFG cfg) -{ - void *osbuf; - WMI_SET_WMM_TXOP_CMD *cmd; - A_STATUS status; - - if( !((cfg == WMI_TXOP_DISABLED) || (cfg == WMI_TXOP_ENABLED)) ) - return A_EINVAL; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_WMM_TXOP_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->txopEnable = cfg; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_WMM_TXOP_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_country(struct wmi_t *wmip, A_UCHAR *countryCode) -{ - void *osbuf; - WMI_AP_SET_COUNTRY_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_AP_SET_COUNTRY_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - A_MEMCPY(cmd->countryCode,countryCode,3); - - status = wmi_cmd_send(wmip, osbuf, WMI_AP_SET_COUNTRY_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -#ifdef CONFIG_HOST_TCMD_SUPPORT -/* WMI layer doesn't need to know the data type of the test cmd. - This would be beneficial for customers like Qualcomm, who might - have different test command requirements from differnt manufacturers - */ -A_STATUS -wmi_test_cmd(struct wmi_t *wmip, A_UINT8 *buf, A_UINT32 len) -{ - void *osbuf; - char *data; - A_STATUS status; - - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - osbuf= A_NETBUF_ALLOC(len); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, len); - data = A_NETBUF_DATA(osbuf); - A_MEMCPY(data, buf, len); - - status = wmi_cmd_send(wmip, osbuf, WMI_TEST_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -#endif - -A_STATUS -wmi_set_bt_status_cmd(struct wmi_t *wmip, A_UINT8 streamType, A_UINT8 status) -{ - void *osbuf; - WMI_SET_BT_STATUS_CMD *cmd; - A_STATUS wmi_cmd_send_status; - - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, ("Enter - streamType=%d, status=%d\n", streamType, status)); - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_BT_STATUS_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->streamType = streamType; - cmd->status = status; - - wmi_cmd_send_status = wmi_cmd_send(wmip, osbuf, WMI_SET_BT_STATUS_CMDID, - NO_SYNC_WMIFLAG); - - if (wmi_cmd_send_status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return wmi_cmd_send_status; -} - -A_STATUS -wmi_set_bt_params_cmd(struct wmi_t *wmip, WMI_SET_BT_PARAMS_CMD* cmd) -{ - void *osbuf; - WMI_SET_BT_PARAMS_CMD* alloc_cmd; - A_STATUS status; - - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, ("cmd params is %d\n", cmd->paramType)); - - if (cmd->paramType == BT_PARAM_SCO) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, ("sco params %d %d %d %d %d %d %d %d %d %d %d %d\n", cmd->info.scoParams.numScoCyclesForceTrigger, - cmd->info.scoParams.dataResponseTimeout, - cmd->info.scoParams.stompScoRules, - cmd->info.scoParams.scoOptFlags, - cmd->info.scoParams.stompDutyCyleVal, - cmd->info.scoParams.stompDutyCyleMaxVal, - cmd->info.scoParams.psPollLatencyFraction, - cmd->info.scoParams.noSCOSlots, - cmd->info.scoParams.noIdleSlots, - cmd->info.scoParams.scoOptOffRssi, - cmd->info.scoParams.scoOptOnRssi, - cmd->info.scoParams.scoOptRtsCount)); - } - else if (cmd->paramType == BT_PARAM_A2DP) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, ("A2DP params %d %d %d %d %d %d %d %d\n", cmd->info.a2dpParams.a2dpWlanUsageLimit, - cmd->info.a2dpParams.a2dpBurstCntMin, - cmd->info.a2dpParams.a2dpDataRespTimeout, - cmd->info.a2dpParams.a2dpOptFlags, - cmd->info.a2dpParams.isCoLocatedBtRoleMaster, - cmd->info.a2dpParams.a2dpOptOffRssi, - cmd->info.a2dpParams.a2dpOptOnRssi, - cmd->info.a2dpParams.a2dpOptRtsCount)); - } - else if (cmd->paramType == BT_PARAM_ANTENNA_CONFIG) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, ("Ant config %d\n", cmd->info.antType)); - } - else if (cmd->paramType == BT_PARAM_COLOCATED_BT_DEVICE) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, ("co-located BT %d\n", cmd->info.coLocatedBtDev)); - } - else if (cmd->paramType == BT_PARAM_ACLCOEX) { - AR_DEBUG_PRINTF(ATH_DEBUG_WARN, ("ACL params %d %d %d\n", cmd->info.aclCoexParams.aclWlanMediumUsageTime, - cmd->info.aclCoexParams.aclBtMediumUsageTime, - cmd->info.aclCoexParams.aclDataRespTimeout)); - } - else if (cmd->paramType == BT_PARAM_11A_SEPARATE_ANT) { - A_DPRINTF(DBG_WMI, (DBGFMT "11A ant\n", DBGARG)); - } - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - alloc_cmd = (WMI_SET_BT_PARAMS_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(alloc_cmd, sizeof(*cmd)); - A_MEMCPY(alloc_cmd, cmd, sizeof(*cmd)); - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_BT_PARAMS_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_btcoex_fe_ant_cmd(struct wmi_t *wmip, WMI_SET_BTCOEX_FE_ANT_CMD * cmd) -{ - void *osbuf; - WMI_SET_BTCOEX_FE_ANT_CMD *alloc_cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - alloc_cmd = (WMI_SET_BTCOEX_FE_ANT_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(alloc_cmd, sizeof(*cmd)); - A_MEMCPY(alloc_cmd,cmd,sizeof(WMI_SET_BTCOEX_FE_ANT_CMD)); - status = wmi_cmd_send(wmip, osbuf, WMI_SET_BTCOEX_FE_ANT_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - - -A_STATUS -wmi_set_btcoex_colocated_bt_dev_cmd(struct wmi_t *wmip, - WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD * cmd) -{ - void *osbuf; - WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD *alloc_cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - alloc_cmd = (WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(alloc_cmd, sizeof(*cmd)); - A_MEMCPY(alloc_cmd,cmd,sizeof(WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD)); - A_PRINTF("colocated bt = %d\n", alloc_cmd->btcoexCoLocatedBTdev); - status = wmi_cmd_send(wmip, osbuf, WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_btcoex_btinquiry_page_config_cmd(struct wmi_t *wmip, - WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMD* cmd) -{ - void *osbuf; - WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMD *alloc_cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - alloc_cmd = (WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(alloc_cmd, sizeof(*cmd)); - A_MEMCPY(alloc_cmd,cmd,sizeof(WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMD)); - status = wmi_cmd_send(wmip, osbuf, WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_btcoex_sco_config_cmd(struct wmi_t *wmip, - WMI_SET_BTCOEX_SCO_CONFIG_CMD * cmd) -{ - void *osbuf; - WMI_SET_BTCOEX_SCO_CONFIG_CMD *alloc_cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - alloc_cmd = (WMI_SET_BTCOEX_SCO_CONFIG_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(alloc_cmd, sizeof(*cmd)); - A_MEMCPY(alloc_cmd,cmd,sizeof(WMI_SET_BTCOEX_SCO_CONFIG_CMD)); - status = wmi_cmd_send(wmip, osbuf, WMI_SET_BTCOEX_SCO_CONFIG_CMDID , - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_btcoex_a2dp_config_cmd(struct wmi_t *wmip, - WMI_SET_BTCOEX_A2DP_CONFIG_CMD * cmd) -{ - void *osbuf; - WMI_SET_BTCOEX_A2DP_CONFIG_CMD *alloc_cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - alloc_cmd = (WMI_SET_BTCOEX_A2DP_CONFIG_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(alloc_cmd, sizeof(*cmd)); - A_MEMCPY(alloc_cmd,cmd,sizeof(WMI_SET_BTCOEX_A2DP_CONFIG_CMD)); - status = wmi_cmd_send(wmip, osbuf, WMI_SET_BTCOEX_A2DP_CONFIG_CMDID , - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_btcoex_aclcoex_config_cmd(struct wmi_t *wmip, - WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD * cmd) -{ - void *osbuf; - WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD *alloc_cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - alloc_cmd = (WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(alloc_cmd, sizeof(*cmd)); - A_MEMCPY(alloc_cmd,cmd,sizeof(WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD)); - status = wmi_cmd_send(wmip, osbuf, WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMDID , - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_btcoex_debug_cmd(struct wmi_t *wmip, WMI_SET_BTCOEX_DEBUG_CMD * cmd) -{ - void *osbuf; - WMI_SET_BTCOEX_DEBUG_CMD *alloc_cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - alloc_cmd = (WMI_SET_BTCOEX_DEBUG_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(alloc_cmd, sizeof(*cmd)); - A_MEMCPY(alloc_cmd,cmd,sizeof(WMI_SET_BTCOEX_DEBUG_CMD)); - status = wmi_cmd_send(wmip, osbuf, WMI_SET_BTCOEX_DEBUG_CMDID , - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_btcoex_bt_operating_status_cmd(struct wmi_t * wmip, - WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMD * cmd) -{ - void *osbuf; - WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMD *alloc_cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - alloc_cmd = (WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(alloc_cmd, sizeof(*cmd)); - A_MEMCPY(alloc_cmd,cmd,sizeof(WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMD)); - status = wmi_cmd_send(wmip, osbuf, WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID , - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_get_btcoex_config_cmd(struct wmi_t * wmip, WMI_GET_BTCOEX_CONFIG_CMD * cmd) -{ - void *osbuf; - WMI_GET_BTCOEX_CONFIG_CMD *alloc_cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - alloc_cmd = (WMI_GET_BTCOEX_CONFIG_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(alloc_cmd, sizeof(*cmd)); - A_MEMCPY(alloc_cmd,cmd,sizeof(WMI_GET_BTCOEX_CONFIG_CMD)); - status = wmi_cmd_send(wmip, osbuf, WMI_GET_BTCOEX_CONFIG_CMDID , - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_get_btcoex_stats_cmd(struct wmi_t *wmip) -{ - - return wmi_simple_cmd(wmip, WMI_GET_BTCOEX_STATS_CMDID); - -} - -A_STATUS -wmi_get_keepalive_configured(struct wmi_t *wmip) -{ - void *osbuf; - WMI_GET_KEEPALIVE_CMD *cmd; - A_STATUS status; - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - cmd = (WMI_GET_KEEPALIVE_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - status = wmi_cmd_send(wmip, osbuf, WMI_GET_KEEPALIVE_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_UINT8 -wmi_get_keepalive_cmd(struct wmi_t *wmip) -{ - return wmip->wmi_keepaliveInterval; -} - -A_STATUS -wmi_set_keepalive_cmd(struct wmi_t *wmip, A_UINT8 keepaliveInterval) -{ - void *osbuf; - WMI_SET_KEEPALIVE_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_KEEPALIVE_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->keepaliveInterval = keepaliveInterval; - wmip->wmi_keepaliveInterval = keepaliveInterval; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_KEEPALIVE_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_params_cmd(struct wmi_t *wmip, A_UINT32 opcode, A_UINT32 length, A_CHAR* buffer) -{ - void *osbuf; - WMI_SET_PARAMS_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd) + length); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd) + length); - - cmd = (WMI_SET_PARAMS_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->opcode = opcode; - cmd->length = length; - - if (length) - { - A_MEMCPY(cmd->buffer, buffer, length); - } - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_PARAMS_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - - -A_STATUS -wmi_set_mcast_filter_cmd(struct wmi_t *wmip, A_UINT8 *filter) -{ - void *osbuf; - A_BOOL mcast_ipv6 = FALSE; - WMI_SET_MCAST_FILTER_CMD *cmd; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - if(filter[0] == 0x33 && filter[1] == 0x33) { - mcast_ipv6 = TRUE; - } - else - { - if(filter[0] == 0x01 && filter[1] == 0x00 && filter[2] == 0x5e && filter[3] <= 0x7F) { - mcast_ipv6 = FALSE; - } - else { - return A_BAD_ADDRESS; - } - } - - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_MCAST_FILTER_CMD *)(A_NETBUF_DATA(osbuf)); - if(mcast_ipv6) { - cmd->multicast_mac[0] = 0x33; - cmd->multicast_mac[1] = 0x33; - cmd->multicast_mac[2] = filter[2]; - cmd->multicast_mac[3] = filter[3]; - } - else { - cmd->multicast_mac[0] = 0x01; - cmd->multicast_mac[1] = 0x00; - cmd->multicast_mac[2] = 0x5e; - cmd->multicast_mac[3] = filter[3]&0x7F; - } - cmd->multicast_mac[4] = filter[4]; - cmd->multicast_mac[5] = filter[5]; - - return (wmi_cmd_send(wmip, osbuf, WMI_SET_MCAST_FILTER_CMDID, - NO_SYNC_WMIFLAG)); -} - - -A_STATUS -wmi_del_mcast_filter_cmd(struct wmi_t *wmip, A_UINT8 *filter) -{ - void *osbuf; - A_BOOL mcast_ipv6 = FALSE; - WMI_SET_MCAST_FILTER_CMD *cmd; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - if(filter[0] == 0x33 && filter[1] == 0x33) { - mcast_ipv6 = TRUE; - } - else - { - if(filter[0] == 0x01 && filter[1] == 0x00 && filter[2] == 0x5e && filter[3] <= 0x7F) { - mcast_ipv6 = FALSE; - } - else { - return A_BAD_ADDRESS; - } - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_MCAST_FILTER_CMD *)(A_NETBUF_DATA(osbuf)); - if(mcast_ipv6) { - cmd->multicast_mac[0] = 0x33; - cmd->multicast_mac[1] = 0x33; - cmd->multicast_mac[2] = filter[2]; - cmd->multicast_mac[3] = filter[3]; - } - else { - cmd->multicast_mac[0] = 0x01; - cmd->multicast_mac[1] = 0x00; - cmd->multicast_mac[2] = 0x5e; - cmd->multicast_mac[3] = filter[3]&0x7F; - } - cmd->multicast_mac[4] = filter[4]; - cmd->multicast_mac[5] = filter[5]; - - return (wmi_cmd_send(wmip, osbuf, WMI_DEL_MCAST_FILTER_CMDID, - NO_SYNC_WMIFLAG)); -} - -A_STATUS -wmi_mcast_filter_cmd(struct wmi_t *wmip, A_UINT8 enable) -{ - void *osbuf; - WMI_MCAST_FILTER_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_MCAST_FILTER_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->enable = enable; - - status = wmi_cmd_send(wmip, osbuf, WMI_MCAST_FILTER_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_appie_cmd(struct wmi_t *wmip, A_UINT8 mgmtFrmType, A_UINT8 ieLen, - A_UINT8 *ieInfo) -{ - void *osbuf; - WMI_SET_APPIE_CMD *cmd; - A_UINT16 cmdLen; - A_STATUS status; - - cmdLen = sizeof(*cmd) + ieLen - 1; - osbuf = A_NETBUF_ALLOC(cmdLen); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, cmdLen); - - cmd = (WMI_SET_APPIE_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, cmdLen); - - cmd->mgmtFrmType = mgmtFrmType; - cmd->ieLen = ieLen; - A_MEMCPY(cmd->ieInfo, ieInfo, ieLen); - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_APPIE_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_halparam_cmd(struct wmi_t *wmip, A_UINT8 *cmd, A_UINT16 dataLen) -{ - void *osbuf; - A_UINT8 *data; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(dataLen); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, dataLen); - - data = A_NETBUF_DATA(osbuf); - - A_MEMCPY(data, cmd, dataLen); - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_WHALPARAM_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_INT32 -wmi_get_rate(A_INT8 rateindex) -{ - if (rateindex == RATE_AUTO) { - return 0; - } else { - return(wmi_rateTable[(A_UINT32) rateindex][0]); - } -} - -void -wmi_node_return (struct wmi_t *wmip, bss_t *bss) -{ - if (NULL != bss) - { - wlan_node_return(&wmip->wmi_scan_table, bss); - } -} - -void -wmi_node_update_timestamp(struct wmi_t *wmip, bss_t *bss) -{ - if (NULL != bss) { - wlan_node_update_timestamp(&wmip->wmi_scan_table, bss); - } -} - -void wmi_setup_node(struct wmi_t *wmip, bss_t *bss, const A_UINT8 *bssid) -{ - wlan_setup_node(&wmip->wmi_scan_table, bss, bssid); -} - -bss_t *wmi_node_alloc(struct wmi_t *wmip, A_UINT8 len) -{ - return wlan_node_alloc(&wmip->wmi_scan_table, len); -} - -void -wmi_set_nodeage(struct wmi_t *wmip, A_UINT32 nodeAge) -{ - wlan_set_nodeage(&wmip->wmi_scan_table,nodeAge); -} - -bss_t * -wmi_find_Ssidnode (struct wmi_t *wmip, A_UCHAR *pSsid, - A_UINT32 ssidLength, A_BOOL bIsWPA2, A_BOOL bMatchSSID) -{ - bss_t *node = NULL; - node = wlan_find_Ssidnode (&wmip->wmi_scan_table, pSsid, - ssidLength, bIsWPA2, bMatchSSID); - return node; -} - - -void -wmi_free_allnodes(struct wmi_t *wmip) -{ - wlan_free_allnodes(&wmip->wmi_scan_table); -} - -bss_t * -wmi_find_node(struct wmi_t *wmip, const A_UINT8 *macaddr) -{ - bss_t *ni=NULL; - ni=wlan_find_node(&wmip->wmi_scan_table,macaddr); - return ni; -} - -void -wmi_free_node(struct wmi_t *wmip, const A_UINT8 *macaddr) -{ - bss_t *ni=NULL; - - ni=wlan_find_node(&wmip->wmi_scan_table,macaddr); - if (ni != NULL) { - wlan_node_reclaim(&wmip->wmi_scan_table, ni); - } - - return; -} - -A_STATUS -wmi_dset_open_reply(struct wmi_t *wmip, - A_UINT32 status, - A_UINT32 access_cookie, - A_UINT32 dset_size, - A_UINT32 dset_version, - A_UINT32 targ_handle, - A_UINT32 targ_reply_fn, - A_UINT32 targ_reply_arg) -{ - void *osbuf; - WMIX_DSETOPEN_REPLY_CMD *open_reply; - A_STATUS wmi_cmd_send_xtnd_status; - - A_DPRINTF(DBG_WMI, (DBGFMT "Enter - wmip=0x%lx\n", DBGARG, (unsigned long)wmip)); - - osbuf = A_NETBUF_ALLOC(sizeof(*open_reply)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*open_reply)); - open_reply = (WMIX_DSETOPEN_REPLY_CMD *)(A_NETBUF_DATA(osbuf)); - - open_reply->status = status; - open_reply->targ_dset_handle = targ_handle; - open_reply->targ_reply_fn = targ_reply_fn; - open_reply->targ_reply_arg = targ_reply_arg; - open_reply->access_cookie = access_cookie; - open_reply->size = dset_size; - open_reply->version = dset_version; - - wmi_cmd_send_xtnd_status = wmi_cmd_send_xtnd(wmip, osbuf, WMIX_DSETOPEN_REPLY_CMDID, - NO_SYNC_WMIFLAG); - - if (wmi_cmd_send_xtnd_status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return wmi_cmd_send_xtnd_status; -} - -static A_STATUS -wmi_get_pmkid_list_event_rx(struct wmi_t *wmip, A_UINT8 *datap, A_UINT32 len) -{ - WMI_PMKID_LIST_REPLY *reply; - A_UINT32 expected_len; - - if (len < sizeof(WMI_PMKID_LIST_REPLY)) { - return A_EINVAL; - } - reply = (WMI_PMKID_LIST_REPLY *)datap; - expected_len = sizeof(reply->numPMKID) + reply->numPMKID * WMI_PMKID_LEN; - - if (len < expected_len) { - return A_EINVAL; - } - - A_WMI_PMKID_LIST_EVENT(wmip->wmi_devt, reply->numPMKID, - reply->pmkidList, reply->bssidList[0]); - - return A_OK; -} - - -static A_STATUS -wmi_set_params_event_rx(struct wmi_t *wmip, A_UINT8 *datap, A_UINT32 len) -{ - WMI_SET_PARAMS_REPLY *reply; - - if (len < sizeof(WMI_SET_PARAMS_REPLY)) { - return A_EINVAL; - } - reply = (WMI_SET_PARAMS_REPLY *)datap; - - if (A_OK == reply->status) - { - - } - else - { - - } - - return A_OK; -} - - - -#ifdef CONFIG_HOST_DSET_SUPPORT -A_STATUS -wmi_dset_data_reply(struct wmi_t *wmip, - A_UINT32 status, - A_UINT8 *user_buf, - A_UINT32 length, - A_UINT32 targ_buf, - A_UINT32 targ_reply_fn, - A_UINT32 targ_reply_arg) -{ - void *osbuf; - WMIX_DSETDATA_REPLY_CMD *data_reply; - A_UINT32 size; - A_STATUS wmi_cmd_send_xtnd_status; - - size = sizeof(*data_reply) + length; - - if (size <= length) { - return A_ERROR; - } - - A_DPRINTF(DBG_WMI, - (DBGFMT "Enter - length=%d status=%d\n", DBGARG, length, status)); - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - A_NETBUF_PUT(osbuf, size); - data_reply = (WMIX_DSETDATA_REPLY_CMD *)(A_NETBUF_DATA(osbuf)); - - data_reply->status = status; - data_reply->targ_buf = targ_buf; - data_reply->targ_reply_fn = targ_reply_fn; - data_reply->targ_reply_arg = targ_reply_arg; - data_reply->length = length; - - if (status == A_OK) { - if (a_copy_from_user(data_reply->buf, user_buf, length)) { - A_NETBUF_FREE(osbuf); - return A_ERROR; - } - } - - wmi_cmd_send_xtnd_status = wmi_cmd_send_xtnd(wmip, osbuf, WMIX_DSETDATA_REPLY_CMDID, - NO_SYNC_WMIFLAG); - - if (wmi_cmd_send_xtnd_status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return wmi_cmd_send_xtnd_status; -} -#endif /* CONFIG_HOST_DSET_SUPPORT */ - -A_STATUS -wmi_set_wsc_status_cmd(struct wmi_t *wmip, A_UINT32 status) -{ - void *osbuf; - char *cmd; - A_STATUS wmi_cmd_send_status; - - wps_enable = status; -#ifdef AR6K_ALLOC_DEBUG - osbuf = a_netbuf_alloc(sizeof(1), __func__, __LINE__); -#else - osbuf = a_netbuf_alloc(sizeof(1)); -#endif - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - a_netbuf_put(osbuf, sizeof(1)); - - cmd = (char *)(a_netbuf_to_data(osbuf)); - - A_MEMZERO(cmd, sizeof(*cmd)); - cmd[0] = (status?1:0); - wmi_cmd_send_status = wmi_cmd_send(wmip, osbuf, WMI_SET_WSC_STATUS_CMDID, - NO_SYNC_WMIFLAG); - - if (wmi_cmd_send_status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return wmi_cmd_send_status; -} - -#if defined(CONFIG_TARGET_PROFILE_SUPPORT) -A_STATUS -wmi_prof_cfg_cmd(struct wmi_t *wmip, - A_UINT32 period, - A_UINT32 nbins) -{ - void *osbuf; - WMIX_PROF_CFG_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMIX_PROF_CFG_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->period = period; - cmd->nbins = nbins; - - status = wmi_cmd_send_xtnd(wmip, osbuf, WMIX_PROF_CFG_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_prof_addr_set_cmd(struct wmi_t *wmip, A_UINT32 addr) -{ - void *osbuf; - WMIX_PROF_ADDR_SET_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMIX_PROF_ADDR_SET_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->addr = addr; - - status = wmi_cmd_send_xtnd(wmip, osbuf, WMIX_PROF_ADDR_SET_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_prof_start_cmd(struct wmi_t *wmip) -{ - return wmi_simple_cmd_xtnd(wmip, WMIX_PROF_START_CMDID); -} - -A_STATUS -wmi_prof_stop_cmd(struct wmi_t *wmip) -{ - return wmi_simple_cmd_xtnd(wmip, WMIX_PROF_STOP_CMDID); -} - -A_STATUS -wmi_prof_count_get_cmd(struct wmi_t *wmip) -{ - return wmi_simple_cmd_xtnd(wmip, WMIX_PROF_COUNT_GET_CMDID); -} - -/* Called to handle WMIX_PROF_CONT_EVENTID */ -static A_STATUS -wmi_prof_count_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMIX_PROF_COUNT_EVENT *prof_data = (WMIX_PROF_COUNT_EVENT *)datap; - - A_DPRINTF(DBG_WMI, - (DBGFMT "Enter - addr=0x%x count=%d\n", DBGARG, - prof_data->addr, prof_data->count)); - - A_WMI_PROF_COUNT_RX(prof_data->addr, prof_data->count); - - return A_OK; -} -#endif /* CONFIG_TARGET_PROFILE_SUPPORT */ - -#ifdef OS_ROAM_MANAGEMENT - -#define ETHERNET_MAC_ADDRESS_LENGTH 6 - -void -wmi_scan_indication (struct wmi_t *wmip) -{ - struct ieee80211_node_table *nt; - A_UINT32 gen; - A_UINT32 size; - A_UINT32 bsssize; - bss_t *bss; - A_UINT32 numbss; - PNDIS_802_11_BSSID_SCAN_INFO psi; - PBYTE pie; - NDIS_802_11_FIXED_IEs *pFixed; - NDIS_802_11_VARIABLE_IEs *pVar; - A_UINT32 RateSize; - - struct ar6kScanIndication - { - NDIS_802_11_STATUS_INDICATION ind; - NDIS_802_11_BSSID_SCAN_INFO_LIST slist; - } *pAr6kScanIndEvent; - - nt = &wmip->wmi_scan_table; - - ++nt->nt_si_gen; - - - gen = nt->nt_si_gen; - - size = offsetof(struct ar6kScanIndication, slist) + - offsetof(NDIS_802_11_BSSID_SCAN_INFO_LIST, BssidScanInfo); - - numbss = 0; - - IEEE80211_NODE_LOCK(nt); - - //calc size - for (bss = nt->nt_node_first; bss; bss = bss->ni_list_next) { - if (bss->ni_si_gen != gen) { - bsssize = offsetof(NDIS_802_11_BSSID_SCAN_INFO, Bssid) + offsetof(NDIS_WLAN_BSSID_EX, IEs); - bsssize = bsssize + sizeof(NDIS_802_11_FIXED_IEs); - -#ifdef SUPPORT_WPA2 - if (bss->ni_cie.ie_rsn) { - bsssize = bsssize + bss->ni_cie.ie_rsn[1] + 2; - } -#endif - if (bss->ni_cie.ie_wpa) { - bsssize = bsssize + bss->ni_cie.ie_wpa[1] + 2; - } - - // bsssize must be a multiple of 4 to maintain alignment. - bsssize = (bsssize + 3) & ~3; - - size += bsssize; - - numbss++; - } - } - - if (0 == numbss) - { -// RETAILMSG(1, (L"AR6K: scan indication: 0 bss\n")); - ar6000_scan_indication (wmip->wmi_devt, NULL, 0); - IEEE80211_NODE_UNLOCK (nt); - return; - } - - pAr6kScanIndEvent = A_MALLOC(size); - - if (NULL == pAr6kScanIndEvent) - { - IEEE80211_NODE_UNLOCK(nt); - return; - } - - A_MEMZERO(pAr6kScanIndEvent, size); - - //copy data - pAr6kScanIndEvent->ind.StatusType = Ndis802_11StatusType_BssidScanInfoList; - pAr6kScanIndEvent->slist.Version = 1; - pAr6kScanIndEvent->slist.NumItems = numbss; - - psi = &pAr6kScanIndEvent->slist.BssidScanInfo[0]; - - for (bss = nt->nt_node_first; bss; bss = bss->ni_list_next) { - if (bss->ni_si_gen != gen) { - - bss->ni_si_gen = gen; - - //Set scan time - psi->ScanTime = bss->ni_tstamp - WLAN_NODE_INACT_TIMEOUT_MSEC; - - // Copy data to bssid_ex - bsssize = offsetof(NDIS_WLAN_BSSID_EX, IEs); - bsssize = bsssize + sizeof(NDIS_802_11_FIXED_IEs); - -#ifdef SUPPORT_WPA2 - if (bss->ni_cie.ie_rsn) { - bsssize = bsssize + bss->ni_cie.ie_rsn[1] + 2; - } -#endif - if (bss->ni_cie.ie_wpa) { - bsssize = bsssize + bss->ni_cie.ie_wpa[1] + 2; - } - - // bsssize must be a multiple of 4 to maintain alignment. - bsssize = (bsssize + 3) & ~3; - - psi->Bssid.Length = bsssize; - - memcpy (psi->Bssid.MacAddress, bss->ni_macaddr, ETHERNET_MAC_ADDRESS_LENGTH); - - -//if (((bss->ni_macaddr[3] == 0xCE) && (bss->ni_macaddr[4] == 0xF0) && (bss->ni_macaddr[5] == 0xE7)) || -// ((bss->ni_macaddr[3] == 0x03) && (bss->ni_macaddr[4] == 0xE2) && (bss->ni_macaddr[5] == 0x70))) -// RETAILMSG (1, (L"%x\n",bss->ni_macaddr[5])); - - psi->Bssid.Ssid.SsidLength = 0; - pie = bss->ni_cie.ie_ssid; - - if (pie) { - // Format of SSID IE is: - // Type (1 octet) - // Length (1 octet) - // SSID (Length octets) - // - // Validation of the IE should have occurred within WMI. - // - if (pie[1] <= 32) { - psi->Bssid.Ssid.SsidLength = pie[1]; - memcpy(psi->Bssid.Ssid.Ssid, &pie[2], psi->Bssid.Ssid.SsidLength); - } - } - psi->Bssid.Privacy = (bss->ni_cie.ie_capInfo & 0x10) ? 1 : 0; - - //Post the RSSI value relative to the Standard Noise floor value. - psi->Bssid.Rssi = bss->ni_rssi; - - if (bss->ni_cie.ie_chan >= 2412 && bss->ni_cie.ie_chan <= 2484) { - - if (bss->ni_cie.ie_rates && bss->ni_cie.ie_xrates) { - psi->Bssid.NetworkTypeInUse = Ndis802_11OFDM24; - } - else { - psi->Bssid.NetworkTypeInUse = Ndis802_11DS; - } - } - else { - psi->Bssid.NetworkTypeInUse = Ndis802_11OFDM5; - } - - psi->Bssid.Configuration.Length = sizeof(psi->Bssid.Configuration); - psi->Bssid.Configuration.BeaconPeriod = bss->ni_cie.ie_beaconInt; // Units are Kmicroseconds (1024 us) - psi->Bssid.Configuration.ATIMWindow = 0; - psi->Bssid.Configuration.DSConfig = bss->ni_cie.ie_chan * 1000; - psi->Bssid.InfrastructureMode = ((bss->ni_cie.ie_capInfo & 0x03) == 0x01 ) ? Ndis802_11Infrastructure : Ndis802_11IBSS; - - RateSize = 0; - pie = bss->ni_cie.ie_rates; - if (pie) { - RateSize = (pie[1] < NDIS_802_11_LENGTH_RATES_EX) ? pie[1] : NDIS_802_11_LENGTH_RATES_EX; - memcpy(psi->Bssid.SupportedRates, &pie[2], RateSize); - } - pie = bss->ni_cie.ie_xrates; - if (pie && RateSize < NDIS_802_11_LENGTH_RATES_EX) { - memcpy(psi->Bssid.SupportedRates + RateSize, &pie[2], - (pie[1] < (NDIS_802_11_LENGTH_RATES_EX - RateSize)) ? pie[1] : (NDIS_802_11_LENGTH_RATES_EX - RateSize)); - } - - // Copy the fixed IEs - psi->Bssid.IELength = sizeof(NDIS_802_11_FIXED_IEs); - - pFixed = (NDIS_802_11_FIXED_IEs *)psi->Bssid.IEs; - memcpy(pFixed->Timestamp, bss->ni_cie.ie_tstamp, sizeof(pFixed->Timestamp)); - pFixed->BeaconInterval = bss->ni_cie.ie_beaconInt; - pFixed->Capabilities = bss->ni_cie.ie_capInfo; - - // Copy selected variable IEs - - pVar = (NDIS_802_11_VARIABLE_IEs *)((PBYTE)pFixed + sizeof(NDIS_802_11_FIXED_IEs)); - -#ifdef SUPPORT_WPA2 - // Copy the WPAv2 IE - if (bss->ni_cie.ie_rsn) { - pie = bss->ni_cie.ie_rsn; - psi->Bssid.IELength += pie[1] + 2; - memcpy(pVar, pie, pie[1] + 2); - pVar = (NDIS_802_11_VARIABLE_IEs *)((PBYTE)pVar + pie[1] + 2); - } -#endif - // Copy the WPAv1 IE - if (bss->ni_cie.ie_wpa) { - pie = bss->ni_cie.ie_wpa; - psi->Bssid.IELength += pie[1] + 2; - memcpy(pVar, pie, pie[1] + 2); - pVar = (NDIS_802_11_VARIABLE_IEs *)((PBYTE)pVar + pie[1] + 2); - } - - // Advance buffer pointer - psi = (PNDIS_802_11_BSSID_SCAN_INFO)((BYTE*)psi + bsssize + FIELD_OFFSET(NDIS_802_11_BSSID_SCAN_INFO, Bssid)); - } - } - - IEEE80211_NODE_UNLOCK(nt); - -// wmi_free_allnodes(wmip); - -// RETAILMSG(1, (L"AR6K: scan indication: %u bss\n", numbss)); - - ar6000_scan_indication (wmip->wmi_devt, pAr6kScanIndEvent, size); - - A_FREE(pAr6kScanIndEvent); -} -#endif - -A_UINT8 -ar6000_get_upper_threshold(A_INT16 rssi, SQ_THRESHOLD_PARAMS *sq_thresh, - A_UINT32 size) -{ - A_UINT32 index; - A_UINT8 threshold = (A_UINT8)sq_thresh->upper_threshold[size - 1]; - - /* The list is already in sorted order. Get the next lower value */ - for (index = 0; index < size; index ++) { - if (rssi < sq_thresh->upper_threshold[index]) { - threshold = (A_UINT8)sq_thresh->upper_threshold[index]; - break; - } - } - - return threshold; -} - -A_UINT8 -ar6000_get_lower_threshold(A_INT16 rssi, SQ_THRESHOLD_PARAMS *sq_thresh, - A_UINT32 size) -{ - A_UINT32 index; - A_UINT8 threshold = (A_UINT8)sq_thresh->lower_threshold[size - 1]; - - /* The list is already in sorted order. Get the next lower value */ - for (index = 0; index < size; index ++) { - if (rssi > sq_thresh->lower_threshold[index]) { - threshold = (A_UINT8)sq_thresh->lower_threshold[index]; - break; - } - } - - return threshold; -} -static A_STATUS -wmi_send_rssi_threshold_params(struct wmi_t *wmip, - WMI_RSSI_THRESHOLD_PARAMS_CMD *rssiCmd) -{ - void *osbuf; - A_INT8 size; - WMI_RSSI_THRESHOLD_PARAMS_CMD *cmd; - A_STATUS status; - - size = sizeof (*cmd); - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, size); - - cmd = (WMI_RSSI_THRESHOLD_PARAMS_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, size); - A_MEMCPY(cmd, rssiCmd, sizeof(WMI_RSSI_THRESHOLD_PARAMS_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_RSSI_THRESHOLD_PARAMS_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} -static A_STATUS -wmi_send_snr_threshold_params(struct wmi_t *wmip, - WMI_SNR_THRESHOLD_PARAMS_CMD *snrCmd) -{ - void *osbuf; - A_INT8 size; - WMI_SNR_THRESHOLD_PARAMS_CMD *cmd; - A_STATUS status; - - size = sizeof (*cmd); - - osbuf = A_NETBUF_ALLOC(size); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, size); - cmd = (WMI_SNR_THRESHOLD_PARAMS_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, size); - A_MEMCPY(cmd, snrCmd, sizeof(WMI_SNR_THRESHOLD_PARAMS_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_SNR_THRESHOLD_PARAMS_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_target_event_report_cmd(struct wmi_t *wmip, WMI_SET_TARGET_EVENT_REPORT_CMD* cmd) -{ - void *osbuf; - WMI_SET_TARGET_EVENT_REPORT_CMD* alloc_cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - alloc_cmd = (WMI_SET_TARGET_EVENT_REPORT_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(alloc_cmd, sizeof(*cmd)); - A_MEMCPY(alloc_cmd, cmd, sizeof(*cmd)); - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_TARGET_EVENT_REPORT_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -bss_t *wmi_rm_current_bss (struct wmi_t *wmip, A_UINT8 *id) -{ - wmi_get_current_bssid (wmip, id); - return wlan_node_remove (&wmip->wmi_scan_table, id); -} - -A_STATUS wmi_add_current_bss (struct wmi_t *wmip, A_UINT8 *id, bss_t *bss) -{ - wlan_setup_node (&wmip->wmi_scan_table, bss, id); - return A_OK; -} - -#ifdef ATH_AR6K_11N_SUPPORT -static A_STATUS -wmi_addba_req_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_ADDBA_REQ_EVENT *cmd = (WMI_ADDBA_REQ_EVENT *)datap; - - A_WMI_AGGR_RECV_ADDBA_REQ_EVT(wmip->wmi_devt, cmd); - - return A_OK; -} - - -static A_STATUS -wmi_addba_resp_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_ADDBA_RESP_EVENT *cmd = (WMI_ADDBA_RESP_EVENT *)datap; - - A_WMI_AGGR_RECV_ADDBA_RESP_EVT(wmip->wmi_devt, cmd); - - return A_OK; -} - -static A_STATUS -wmi_delba_req_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_DELBA_EVENT *cmd = (WMI_DELBA_EVENT *)datap; - - A_WMI_AGGR_RECV_DELBA_REQ_EVT(wmip->wmi_devt, cmd); - - return A_OK; -} - -A_STATUS -wmi_btcoex_config_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_BTCOEX_CONFIG_EVENT(wmip->wmi_devt, datap, len); - - return A_OK; -} - - -A_STATUS -wmi_btcoex_stats_event_rx(struct wmi_t * wmip,A_UINT8 * datap,int len) -{ - A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); - - A_WMI_BTCOEX_STATS_EVENT(wmip->wmi_devt, datap, len); - - return A_OK; - -} -#endif - -static A_STATUS -wmi_hci_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_HCI_EVENT *cmd = (WMI_HCI_EVENT *)datap; - A_WMI_HCI_EVENT_EVT(wmip->wmi_devt, cmd); - - return A_OK; -} - -//////////////////////////////////////////////////////////////////////////////// -//// //// -//// AP mode functions //// -//// //// -//////////////////////////////////////////////////////////////////////////////// -/* - * IOCTL: AR6000_XIOCTL_AP_COMMIT_CONFIG - * - * When AR6K in AP mode, This command will be called after - * changing ssid, channel etc. It will pass the profile to - * target with a flag which will indicate which parameter changed, - * also if this flag is 0, there was no change in parametes, so - * commit cmd will not be sent to target. Without calling this IOCTL - * the changes will not take effect. - */ -A_STATUS -wmi_ap_profile_commit(struct wmi_t *wmip, WMI_CONNECT_CMD *p) -{ - void *osbuf; - WMI_CONNECT_CMD *cm; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cm)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cm)); - cm = (WMI_CONNECT_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cm, sizeof(*cm)); - - A_MEMCPY(cm,p,sizeof(*cm)); - - status = wmi_cmd_send(wmip, osbuf, WMI_AP_CONFIG_COMMIT_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -/* - * IOCTL: AR6000_XIOCTL_AP_HIDDEN_SSID - * - * This command will be used to enable/disable hidden ssid functioanlity of - * beacon. If it is enabled, ssid will be NULL in beacon. - */ -A_STATUS -wmi_ap_set_hidden_ssid(struct wmi_t *wmip, A_UINT8 hidden_ssid) -{ - void *osbuf; - WMI_AP_HIDDEN_SSID_CMD *hs; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_AP_HIDDEN_SSID_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_AP_HIDDEN_SSID_CMD)); - hs = (WMI_AP_HIDDEN_SSID_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(hs, sizeof(*hs)); - - hs->hidden_ssid = hidden_ssid; - - A_DPRINTF(DBG_WMI, (DBGFMT "AR6000_XIOCTL_AP_HIDDEN_SSID %d\n", DBGARG , hidden_ssid)); - status = wmi_cmd_send(wmip, osbuf, WMI_AP_HIDDEN_SSID_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -/* - * IOCTL: AR6000_XIOCTL_AP_SET_MAX_NUM_STA - * - * This command is used to limit max num of STA that can connect - * with this AP. This value should not exceed AP_MAX_NUM_STA (this - * is max num of STA supported by AP). Value was already validated - * in ioctl.c - */ -A_STATUS -wmi_ap_set_num_sta(struct wmi_t *wmip, A_UINT8 num_sta) -{ - void *osbuf; - WMI_AP_NUM_STA_CMD *ns; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_AP_NUM_STA_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_AP_NUM_STA_CMD)); - ns = (WMI_AP_NUM_STA_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(ns, sizeof(*ns)); - - ns->num_sta = num_sta; - - A_DPRINTF(DBG_WMI, (DBGFMT "AR6000_XIOCTL_AP_SET_MAX_NUM_STA %d\n", DBGARG , num_sta)); - status = wmi_cmd_send(wmip, osbuf, WMI_AP_SET_NUM_STA_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -/* - * IOCTL: AR6000_XIOCTL_AP_SET_ACL_MAC - * - * This command is used to send list of mac of STAs which will - * be allowed to connect with this AP. When this list is empty - * firware will allow all STAs till the count reaches AP_MAX_NUM_STA. - */ -A_STATUS -wmi_ap_acl_mac_list(struct wmi_t *wmip, WMI_AP_ACL_MAC_CMD *acl) -{ - void *osbuf; - WMI_AP_ACL_MAC_CMD *a; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_AP_ACL_MAC_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_AP_ACL_MAC_CMD)); - a = (WMI_AP_ACL_MAC_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(a, sizeof(*a)); - A_MEMCPY(a,acl,sizeof(*acl)); - - status = wmi_cmd_send(wmip, osbuf, WMI_AP_ACL_MAC_LIST_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -/* - * IOCTL: AR6000_XIOCTL_AP_SET_MLME - * - * This command is used to send list of mac of STAs which will - * be allowed to connect with this AP. When this list is empty - * firware will allow all STAs till the count reaches AP_MAX_NUM_STA. - */ -A_STATUS -wmi_ap_set_mlme(struct wmi_t *wmip, A_UINT8 cmd, A_UINT8 *mac, A_UINT16 reason) -{ - void *osbuf; - WMI_AP_SET_MLME_CMD *mlme; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_AP_SET_MLME_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_AP_SET_MLME_CMD)); - mlme = (WMI_AP_SET_MLME_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(mlme, sizeof(*mlme)); - - mlme->cmd = cmd; - A_MEMCPY(mlme->mac, mac, ATH_MAC_LEN); - mlme->reason = reason; - - status = wmi_cmd_send(wmip, osbuf, WMI_AP_SET_MLME_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -static A_STATUS -wmi_pspoll_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_PSPOLL_EVENT *ev; - - if (len < sizeof(WMI_PSPOLL_EVENT)) { - return A_EINVAL; - } - ev = (WMI_PSPOLL_EVENT *)datap; - - A_WMI_PSPOLL_EVENT(wmip->wmi_devt, ev->aid); - return A_OK; -} - -static A_STATUS -wmi_dtimexpiry_event_rx(struct wmi_t *wmip, A_UINT8 *datap,int len) -{ - A_WMI_DTIMEXPIRY_EVENT(wmip->wmi_devt); - return A_OK; -} - -#ifdef WAPI_ENABLE -static A_STATUS -wmi_wapi_rekey_event_rx(struct wmi_t *wmip, A_UINT8 *datap,int len) -{ - A_UINT8 *ev; - - if (len < 7) { - return A_EINVAL; - } - ev = (A_UINT8 *)datap; - - A_WMI_WAPI_REKEY_EVENT(wmip->wmi_devt, *ev, &ev[1]); - return A_OK; -} -#endif - -#ifdef CONFIG_WLAN_RFKILL -static A_STATUS wmi_rfkill_get_mode_cmd_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - A_STATUS status = A_OK; - - do - { - if(len < sizeof(WMI_RFKILL_MODE_CMD)) - { - status = A_EINVAL; - break; - } - - A_WMI_RFKILL_GET_MODE_CMD_EVENT(wmip->wmi_devt,datap,len); - }while(FALSE); - - return status; -} - -static A_STATUS wmi_rfkill_state_change_event(struct wmi_t *wmip, A_UINT8* datap,int len) -{ - A_STATUS status = A_OK; - A_UINT8 *ev = NULL; - - if (len < sizeof(A_UINT8)) - { - return A_EINVAL; - } - - ev = (A_UINT8*)datap; - - A_WMI_RFKILL_STATE_CHANGE_EVENT(wmip->wmi_devt, *ev); - - return status; -} - -A_STATUS wmi_set_rfkill_mode_cmd(struct wmi_t *wmip,WMI_RFKILL_MODE_CMD *pCmd) -{ - A_STATUS status = A_OK; - void *osbuf = NULL; - WMI_RFKILL_MODE_CMD *prfkill_set_mode_cmd = NULL; - - do - { - osbuf = A_NETBUF_ALLOC(sizeof(WMI_RFKILL_MODE_CMD)); - if(NULL == osbuf) - { - status = A_NO_MEMORY; - break; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_RFKILL_MODE_CMD)); - - prfkill_set_mode_cmd = (WMI_RFKILL_MODE_CMD*)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(prfkill_set_mode_cmd, sizeof(WMI_RFKILL_MODE_CMD)); - A_MEMCPY(prfkill_set_mode_cmd,pCmd, sizeof(WMI_RFKILL_MODE_CMD)); - - status = wmi_cmd_send(wmip, - osbuf, - WMI_SET_RFKILL_MODE_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - }while(FALSE); - - return status; -} - -A_STATUS wmi_get_rfkill_mode_cmd(struct wmi_t *wmip) -{ - A_STATUS status = A_OK; - - status = wmi_simple_cmd(wmip,WMI_GET_RFKILL_MODE_CMDID); - - return status; -} -#endif /* CONFIG_WLAN_RFKILL */ - - -A_STATUS -wmi_set_pvb_cmd(struct wmi_t *wmip, A_UINT16 aid, A_BOOL flag) -{ - WMI_AP_SET_PVB_CMD *cmd; - void *osbuf = NULL; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_AP_SET_PVB_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_AP_SET_PVB_CMD)); - cmd = (WMI_AP_SET_PVB_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - - cmd->aid = aid; - cmd->flag = flag; - - status = wmi_cmd_send(wmip, osbuf, WMI_AP_SET_PVB_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_ap_conn_inact_time(struct wmi_t *wmip, A_UINT32 period) -{ - WMI_AP_CONN_INACT_CMD *cmd; - void *osbuf = NULL; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_AP_CONN_INACT_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_AP_CONN_INACT_CMD)); - cmd = (WMI_AP_CONN_INACT_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - - cmd->period = period; - - status = wmi_cmd_send(wmip, osbuf, WMI_AP_CONN_INACT_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_ap_bgscan_time(struct wmi_t *wmip, A_UINT32 period, A_UINT32 dwell) -{ - WMI_AP_PROT_SCAN_TIME_CMD *cmd; - void *osbuf = NULL; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_AP_PROT_SCAN_TIME_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_AP_PROT_SCAN_TIME_CMD)); - cmd = (WMI_AP_PROT_SCAN_TIME_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - - cmd->period_min = period; - cmd->dwell_ms = dwell; - - status = wmi_cmd_send(wmip, osbuf, WMI_AP_PROT_SCAN_TIME_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_ap_set_dtim(struct wmi_t *wmip, A_UINT8 dtim) -{ - WMI_AP_SET_DTIM_CMD *cmd; - void *osbuf = NULL; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_AP_SET_DTIM_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_AP_SET_DTIM_CMD)); - cmd = (WMI_AP_SET_DTIM_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - - cmd->dtim = dtim; - - status = wmi_cmd_send(wmip, osbuf, WMI_AP_SET_DTIM_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -/* - * IOCTL: AR6000_XIOCTL_AP_SET_ACL_POLICY - * - * This command is used to set ACL policay. While changing policy, if you - * want to retain the existing MAC addresses in the ACL list, policy should be - * OR with AP_ACL_RETAIN_LIST_MASK, else the existing list will be cleared. - * If there is no chage in policy, the list will be intact. - */ -A_STATUS -wmi_ap_set_acl_policy(struct wmi_t *wmip, A_UINT8 policy) -{ - void *osbuf; - WMI_AP_ACL_POLICY_CMD *po; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_AP_ACL_POLICY_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; -} - - A_NETBUF_PUT(osbuf, sizeof(WMI_AP_ACL_POLICY_CMD)); - po = (WMI_AP_ACL_POLICY_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(po, sizeof(*po)); - - po->policy = policy; - - status = wmi_cmd_send(wmip, osbuf, WMI_AP_ACL_POLICY_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_ap_set_rateset(struct wmi_t *wmip, A_UINT8 rateset) -{ - void *osbuf; - WMI_AP_SET_11BG_RATESET_CMD *rs; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_AP_SET_11BG_RATESET_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_AP_SET_11BG_RATESET_CMD)); - rs = (WMI_AP_SET_11BG_RATESET_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(rs, sizeof(*rs)); - - rs->rateset = rateset; - - status = wmi_cmd_send(wmip, osbuf, WMI_AP_SET_11BG_RATESET_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -#ifdef ATH_AR6K_11N_SUPPORT -A_STATUS -wmi_set_ht_cap_cmd(struct wmi_t *wmip, WMI_SET_HT_CAP_CMD *cmd) -{ - void *osbuf; - WMI_SET_HT_CAP_CMD *htCap; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*htCap)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*htCap)); - - A_MEMCPY(&wmip->wmi_ht_cap[cmd->band], cmd, sizeof(WMI_SET_HT_CAP_CMD)); - - htCap = (WMI_SET_HT_CAP_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(htCap, sizeof(*htCap)); - A_MEMCPY(htCap, cmd, sizeof(*htCap)); - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_HT_CAP_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_get_ht_cap_cmd(struct wmi_t *wmip, WMI_SET_HT_CAP_CMD *cmd) -{ - A_MEMCPY(cmd, &wmip->wmi_ht_cap[cmd->band], sizeof(WMI_SET_HT_CAP_CMD)); - - return A_OK; -} - -A_STATUS -wmi_set_ht_op_cmd(struct wmi_t *wmip, A_UINT8 sta_chan_width) -{ - void *osbuf; - WMI_SET_HT_OP_CMD *htInfo; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*htInfo)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*htInfo)); - - htInfo = (WMI_SET_HT_OP_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(htInfo, sizeof(*htInfo)); - htInfo->sta_chan_width = sta_chan_width; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_HT_OP_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} -#endif - -A_STATUS -wmi_set_tx_select_rates_cmd(struct wmi_t *wmip, A_UINT32 *pMaskArray) -{ - void *osbuf; - WMI_SET_TX_SELECT_RATES_CMD *pData; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*pData)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*pData)); - - pData = (WMI_SET_TX_SELECT_RATES_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMCPY(pData, pMaskArray, sizeof(*pData)); - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_TX_SELECT_RATES_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - - -A_STATUS -wmi_send_hci_cmd(struct wmi_t *wmip, A_UINT8 *buf, A_UINT16 sz) -{ - void *osbuf; - WMI_HCI_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd) + sz); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd) + sz); - cmd = (WMI_HCI_CMD *)(A_NETBUF_DATA(osbuf)); - - cmd->cmd_buf_sz = sz; - A_MEMCPY(cmd->buf, buf, sz); - status = wmi_cmd_send(wmip, osbuf, WMI_HCI_CMD_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -#ifdef ATH_AR6K_11N_SUPPORT -A_STATUS -wmi_allow_aggr_cmd(struct wmi_t *wmip, A_UINT16 tx_tidmask, A_UINT16 rx_tidmask) -{ - void *osbuf; - WMI_ALLOW_AGGR_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_ALLOW_AGGR_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->tx_allow_aggr = tx_tidmask; - cmd->rx_allow_aggr = rx_tidmask; - - status = wmi_cmd_send(wmip, osbuf, WMI_ALLOW_AGGR_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_setup_aggr_cmd(struct wmi_t *wmip, A_UINT8 tid) -{ - void *osbuf; - WMI_ADDBA_REQ_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_ADDBA_REQ_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->tid = tid; - - status = wmi_cmd_send(wmip, osbuf, WMI_ADDBA_REQ_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_delete_aggr_cmd(struct wmi_t *wmip, A_UINT8 tid, A_BOOL uplink) -{ - void *osbuf; - WMI_DELBA_REQ_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_DELBA_REQ_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->tid = tid; - cmd->is_sender_initiator = uplink; /* uplink =1 - uplink direction, 0=downlink direction */ - - /* Delete the local aggr state, on host */ - status = wmi_cmd_send(wmip, osbuf, WMI_DELBA_REQ_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} -#endif - -A_STATUS -wmi_set_rx_frame_format_cmd(struct wmi_t *wmip, A_UINT8 rxMetaVersion, - A_BOOL rxDot11Hdr, A_BOOL defragOnHost) -{ - void *osbuf; - WMI_RX_FRAME_FORMAT_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_RX_FRAME_FORMAT_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->dot11Hdr = (rxDot11Hdr==TRUE)? 1:0; - cmd->defragOnHost = (defragOnHost==TRUE)? 1:0; - cmd->metaVersion = rxMetaVersion; /* */ - - /* Delete the local aggr state, on host */ - status = wmi_cmd_send(wmip, osbuf, WMI_RX_FRAME_FORMAT_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - - -A_STATUS -wmi_set_tx_mac_rules_cmd (struct wmi_t *wmip, A_UINT32 rules) -{ - void *osbuf; - WMI_CONFIG_TX_MAC_RULES_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_CONFIG_TX_MAC_RULES_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->rules = rules; - - status = wmi_cmd_send(wmip, osbuf, WMI_CONFIG_TX_MAC_RULES_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_promiscuous_mode_cmd (struct wmi_t *wmip, A_BOOL bMode) -{ - void *osbuf; - WMI_SET_PROMISCUOUS_MODE_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_PROMISCUOUS_MODE_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->enable = (bMode==TRUE)? 1:0; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_PROMISCUOUS_MODE_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_thin_mode_cmd(struct wmi_t *wmip, A_BOOL bThinMode) -{ - void *osbuf; - WMI_SET_THIN_MODE_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_THIN_MODE_CMD *)(A_NETBUF_DATA(osbuf)); - cmd->enable = (bThinMode==TRUE)? 1:0; - - /* Delete the local aggr state, on host */ - status = wmi_cmd_send(wmip, osbuf, WMI_SET_THIN_MODE_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - - -A_STATUS -wmi_set_wlan_conn_precedence_cmd(struct wmi_t *wmip, BT_WLAN_CONN_PRECEDENCE precedence) -{ - void *osbuf; - WMI_SET_BT_WLAN_CONN_PRECEDENCE *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_BT_WLAN_CONN_PRECEDENCE *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->precedence = precedence; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_BT_WLAN_CONN_PRECEDENCE_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_pmk_cmd(struct wmi_t *wmip, A_UINT8 *pmk) -{ - void *osbuf; - WMI_SET_PMK_CMD *p; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_SET_PMK_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_SET_PMK_CMD)); - - p = (WMI_SET_PMK_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(p, sizeof(*p)); - - A_MEMCPY(p->pmk, pmk, WMI_PMK_LEN); - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_PMK_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_passphrase_cmd(struct wmi_t *wmip, WMI_SET_PASSPHRASE_CMD *cmd) -{ - void *osbuf; - WMI_SET_PASSPHRASE_CMD *p; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_SET_PASSPHRASE_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_SET_PASSPHRASE_CMD)); - - p = (WMI_SET_PASSPHRASE_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(p, sizeof(*p)); - - A_MEMCPY(p->ssid, cmd->ssid, WMI_MAX_SSID_LEN); - p->ssid_len = cmd->ssid_len; - A_MEMCPY(p->passphrase, cmd->passphrase, WMI_PASSPHRASE_LEN); - p->passphrase_len = cmd->passphrase_len; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_PASSPHRASE_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_excess_tx_retry_thres_cmd(struct wmi_t *wmip, WMI_SET_EXCESS_TX_RETRY_THRES_CMD *cmd) -{ - void *osbuf; - WMI_SET_EXCESS_TX_RETRY_THRES_CMD *p; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_SET_EXCESS_TX_RETRY_THRES_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_SET_EXCESS_TX_RETRY_THRES_CMD)); - - p = (WMI_SET_EXCESS_TX_RETRY_THRES_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(p, sizeof(*p)); - - p->threshold = cmd->threshold; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_EXCESS_TX_RETRY_THRES_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_SGI_cmd(struct wmi_t *wmip, A_UINT32 *sgiMask, A_UINT8 sgiPERThreshold) -{ - void *osbuf; - WMI_SET_TX_SGI_PARAM_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY ; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_TX_SGI_PARAM_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->sgiMask[0] = sgiMask[0]; - cmd->sgiMask[1] = sgiMask[1]; - cmd->sgiPERThreshold = sgiPERThreshold; - status = wmi_cmd_send(wmip, osbuf, WMI_SET_TX_SGI_PARAM_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -#ifdef P2P -A_STATUS -wmi_p2p_discover(struct wmi_t *wmip, WMI_P2P_FIND_CMD *find_param) -{ - void *osbuf; - WMI_P2P_FIND_CMD *p; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_P2P_FIND_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_P2P_FIND_CMD)); - - p = (WMI_P2P_FIND_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(p, sizeof(*p)); - - A_MEMCPY(p, find_param, sizeof(WMI_P2P_FIND_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_P2P_FIND_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_p2p_stop_find(struct wmi_t *wmip) -{ - return wmi_simple_cmd(wmip, WMI_P2P_STOP_FIND_CMDID); -} - -A_STATUS -wmi_p2p_cancel(struct wmi_t *wmip) -{ - return wmi_simple_cmd(wmip, WMI_P2P_CANCEL_CMDID); -} - -A_STATUS -wmi_p2p_listen(struct wmi_t *wmip, A_UINT32 timeout) -{ - void *osbuf; - WMI_P2P_LISTEN_CMD *p; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_P2P_LISTEN_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_P2P_LISTEN_CMD)); - - p = (WMI_P2P_LISTEN_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(p, sizeof(*p)); - - p->timeout = timeout; - - status = wmi_cmd_send(wmip, osbuf, WMI_P2P_LISTEN_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_p2p_go_neg_start(struct wmi_t *wmip, WMI_P2P_GO_NEG_START_CMD *go_param) -{ - void *osbuf; - WMI_P2P_GO_NEG_START_CMD *p; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_P2P_GO_NEG_START_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_P2P_GO_NEG_START_CMD)); - - p = (WMI_P2P_GO_NEG_START_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(p, sizeof(*p)); - - A_MEMCPY(p, go_param, sizeof(WMI_P2P_GO_NEG_START_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_P2P_GO_NEG_START_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS wmi_p2p_go_neg_rsp_cmd(struct wmi_t *wmip, A_UINT8 status, - A_UINT8 go_intent, A_UINT32 wps_method, A_UINT16 listen_freq, - A_UINT8 *wpsbuf, A_UINT32 wpslen, A_UINT8 *p2pbuf, A_UINT32 p2plen, - A_UINT8 dialog_token, A_UINT8 persistent_grp) -{ - void *osbuf; - WMI_P2P_GO_NEG_REQ_RSP_CMD *pCmd; - A_STATUS wmi_cmd_send_status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_P2P_GO_NEG_REQ_RSP_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_P2P_GO_NEG_REQ_RSP_CMD)); - - pCmd = (WMI_P2P_GO_NEG_REQ_RSP_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(pCmd, sizeof(WMI_P2P_GO_NEG_REQ_RSP_CMD)); - - pCmd->status = status; - pCmd->go_intent = go_intent; - pCmd->wps_method = wps_method; - pCmd->listen_freq = listen_freq; - - pCmd->wps_buflen = wpslen; - A_MEMCPY(pCmd->wps_buf, wpsbuf, wpslen); - - pCmd->p2p_buflen = p2plen; - A_MEMCPY(pCmd->p2p_buf, p2pbuf, p2plen); - - pCmd->dialog_token = dialog_token; - pCmd->persistent_grp = persistent_grp; - - wmi_cmd_send_status = wmi_cmd_send(wmip, osbuf, WMI_P2P_GO_NEG_REQ_RSP_CMDID, NO_SYNC_WMIFLAG); - - if (wmi_cmd_send_status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return wmi_cmd_send_status; -} - -A_STATUS wmi_p2p_invite_req_rsp_cmd(struct wmi_t *wmip, A_UINT8 status, - A_INT8 is_go, A_UINT8 *grp_bssid, A_UINT8 *p2pbuf, - A_UINT8 p2plen, A_UINT8 dialog_token) -{ - void *osbuf; - WMI_P2P_INVITE_REQ_RSP_CMD *pCmd; - A_STATUS wmi_cmd_send_status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_P2P_INVITE_REQ_RSP_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_P2P_INVITE_REQ_RSP_CMD)); - - pCmd = (WMI_P2P_INVITE_REQ_RSP_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(pCmd, sizeof(WMI_P2P_INVITE_REQ_RSP_CMD)); - - pCmd->status = status; - /* TODO: For persistent group setup the is_go & grp_bssid params. - */ - - pCmd->p2p_buflen = p2plen; - A_MEMCPY(pCmd->p2p_buf, p2pbuf, p2plen); - A_MEMCPY(pCmd->group_bssid, grp_bssid, sizeof(ATH_MAC_LEN)); - pCmd->dialog_token = dialog_token; - pCmd->is_go = is_go; - - wmi_cmd_send_status = wmi_cmd_send(wmip, osbuf, WMI_P2P_INVITE_REQ_RSP_CMDID, NO_SYNC_WMIFLAG); - - if (wmi_cmd_send_status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return wmi_cmd_send_status; -} - -A_STATUS -wmi_p2p_set_config(struct wmi_t *wmip, WMI_P2P_SET_CONFIG_CMD *config) -{ - void *osbuf; - WMI_P2P_SET_CONFIG_CMD *p; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_P2P_SET_CONFIG_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_P2P_SET_CONFIG_CMD)); - - p = (WMI_P2P_SET_CONFIG_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(p, sizeof(*p)); - - A_MEMCPY(p, config, sizeof(WMI_P2P_SET_CONFIG_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_P2P_SET_CONFIG_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_wps_set_config(struct wmi_t *wmip, WMI_WPS_SET_CONFIG_CMD *wps_config) -{ - void *osbuf; - WMI_WPS_SET_CONFIG_CMD *p; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_WPS_SET_CONFIG_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_WPS_SET_CONFIG_CMD)); - - p = (WMI_WPS_SET_CONFIG_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(p, sizeof(*p)); - - A_MEMCPY(p, wps_config, sizeof(WMI_WPS_SET_CONFIG_CMD)); - - status = wmi_cmd_send(wmip, osbuf,WMI_WPS_SET_CONFIG_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS wmi_p2p_grp_init_cmd(struct wmi_t *wmip, WMI_P2P_GRP_INIT_CMD *buf) -{ - void *osbuf; - WMI_P2P_GRP_INIT_CMD *p2p_grp_init_cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_P2P_GRP_INIT_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_P2P_GRP_INIT_CMD)); - - p2p_grp_init_cmd = (WMI_P2P_GRP_INIT_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(p2p_grp_init_cmd, sizeof(WMI_P2P_GRP_INIT_CMD)); - - A_MEMCPY(p2p_grp_init_cmd, buf, sizeof(WMI_P2P_GRP_INIT_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_P2P_GRP_INIT_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS wmi_p2p_grp_done_cmd(struct wmi_t *wmip, - WMI_P2P_GRP_FORMATION_DONE_CMD *buf) -{ - void *osbuf; - WMI_P2P_GRP_FORMATION_DONE_CMD *p2p_grp_done_cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_P2P_GRP_FORMATION_DONE_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_P2P_GRP_FORMATION_DONE_CMD)); - - p2p_grp_done_cmd = (WMI_P2P_GRP_FORMATION_DONE_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(p2p_grp_done_cmd, sizeof(WMI_P2P_GRP_FORMATION_DONE_CMD)); - - A_MEMCPY(p2p_grp_done_cmd, buf, sizeof(WMI_P2P_GRP_FORMATION_DONE_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_P2P_GRP_FORMATION_DONE_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS wmi_p2p_invite_cmd(struct wmi_t *wmip, WMI_P2P_INVITE_CMD *buf) -{ - void *osbuf; - WMI_P2P_INVITE_CMD *p2p_invite_cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_P2P_INVITE_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_P2P_INVITE_CMD)); - - p2p_invite_cmd = (WMI_P2P_INVITE_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(p2p_invite_cmd, sizeof(WMI_P2P_INVITE_CMD)); - - A_MEMCPY(p2p_invite_cmd, buf, sizeof(WMI_P2P_INVITE_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_P2P_INVITE_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS wmi_p2p_prov_disc_cmd(struct wmi_t *wmip, - WMI_P2P_PROV_DISC_REQ_CMD *buf) -{ - void *osbuf; - WMI_P2P_PROV_DISC_REQ_CMD *p2p_prov_disc_req; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_P2P_PROV_DISC_REQ_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_P2P_PROV_DISC_REQ_CMD)); - - p2p_prov_disc_req = (WMI_P2P_PROV_DISC_REQ_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(p2p_prov_disc_req, sizeof(WMI_P2P_PROV_DISC_REQ_CMD)); - - A_MEMCPY(p2p_prov_disc_req, buf, sizeof(WMI_P2P_PROV_DISC_REQ_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_P2P_PROV_DISC_REQ_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS wmi_p2p_set_cmd(struct wmi_t *wmip, WMI_P2P_SET_CMD *buf) -{ - void *osbuf; - WMI_P2P_SET_CMD *p2p_set_config; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_P2P_SET_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_P2P_SET_CMD)); - - p2p_set_config = (WMI_P2P_SET_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(p2p_set_config, sizeof(WMI_P2P_SET_CMD)); - - A_MEMCPY(p2p_set_config, buf, sizeof(WMI_P2P_SET_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_P2P_SET_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS wmi_p2p_sdpd_tx_cmd(struct wmi_t *wmip, WMI_P2P_SDPD_TX_CMD *buf) -{ - void *osbuf; - WMI_P2P_SDPD_TX_CMD *p2p_sdpd_tx; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_P2P_SDPD_TX_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_P2P_SDPD_TX_CMD)); - - p2p_sdpd_tx = (WMI_P2P_SDPD_TX_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(p2p_sdpd_tx, sizeof(WMI_P2P_SDPD_TX_CMD)); - - A_MEMCPY(p2p_sdpd_tx, buf, sizeof(WMI_P2P_SDPD_TX_CMD)); - - status = wmi_cmd_send(wmip, osbuf, WMI_P2P_SDPD_TX_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS wmi_p2p_stop_sdpd(struct wmi_t *wmip) -{ - void *osbuf; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(1); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - status = wmi_cmd_send(wmip, osbuf, WMI_P2P_STOP_SDPD_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -static A_STATUS -wmi_p2p_goneg_result_event_rx(struct wmi_t *wmip, A_UINT8 *datap, A_UINT8 len) -{ - p2p_go_neg_complete_rx(A_WMI_GET_P2P_CTX(wmip->wmi_devt), datap, len); - A_WMI_P2PGONEG_EVENT(wmip->wmi_devt, datap, len); - return A_OK; -} - -static A_STATUS wmi_p2p_goneg_req_rx(struct wmi_t *wmip, A_UINT8 *datap, - A_UINT8 len) -{ - p2p_go_neg_req_rx(A_WMI_GET_P2P_CTX(wmip->wmi_devt), datap, len); - return A_OK; -} - -static A_STATUS wmi_p2p_invite_req_rx(struct wmi_t *wmip, A_UINT8 *datap, - A_UINT8 len) -{ - p2p_invite_req_rx(A_WMI_GET_P2P_CTX(wmip->wmi_devt), datap, len); - return A_OK; -} - - -static A_STATUS wmi_p2p_invite_sent_result_rx(struct wmi_t *wmip, - A_UINT8 *datap, A_UINT8 len) -{ - A_WMI_P2P_INVITE_SENT_RESULT_EVENT(wmip->wmi_devt, datap, len); - return A_OK; -} - -static A_STATUS wmi_p2p_prov_disc_resp_rx(struct wmi_t *wmip, - A_UINT8 *datap, A_UINT8 len) -{ - p2p_prov_disc_resp_rx(A_WMI_GET_P2P_CTX(wmip->wmi_devt), datap, len); - return A_OK; -} - -static A_STATUS wmi_p2p_start_sdpd_event_rx(struct wmi_t *wmip, - A_UINT8 *datap, A_UINT8 len) -{ - p2p_start_sdpd_event_rx(A_WMI_GET_P2P_CTX(wmip->wmi_devt)); - return A_OK; -} - -static A_STATUS wmi_p2p_sdpd_rx_event_rx(struct wmi_t *wmip, - A_UINT8 *datap, A_UINT8 len) -{ - p2p_sdpd_rx_event_rx(A_WMI_GET_P2P_CTX(wmip->wmi_devt), datap, len); - return A_OK; -} - -static A_STATUS wmi_p2p_prov_disc_req_rx(struct wmi_t *wmip, - A_UINT8 *datap, A_UINT8 len) -{ - p2p_prov_disc_req_rx(A_WMI_GET_P2P_CTX(wmip->wmi_devt), datap, len); - return A_OK; -} - -static A_STATUS wmi_p2p_invite_rcvd_result_rx(struct wmi_t *wmip, - A_UINT8 *datap, A_UINT8 len) -{ - A_WMI_P2P_INVITE_RCVD_RESULT_EVENT(wmip->wmi_devt, datap, len); - return A_OK; -} -#endif /* P2P */ - -bss_t * -wmi_find_matching_Ssidnode (struct wmi_t *wmip, A_UCHAR *pSsid, - A_UINT32 ssidLength, - A_UINT32 dot11AuthMode, A_UINT32 authMode, - A_UINT32 pairwiseCryptoType, A_UINT32 grpwiseCryptoTyp) -{ - bss_t *node = NULL; - node = wlan_find_matching_Ssidnode (&wmip->wmi_scan_table, pSsid, - ssidLength, dot11AuthMode, authMode, pairwiseCryptoType, grpwiseCryptoTyp); - - return node; -} - -A_UINT16 -wmi_ieee2freq (int chan) -{ - A_UINT16 freq = 0; - freq = wlan_ieee2freq (chan); - return freq; - -} - -A_UINT32 -wmi_freq2ieee (A_UINT16 freq) -{ - A_UINT16 chan = 0; - chan = wlan_freq2ieee (freq); - return chan; -} - -A_STATUS -wmi_beacon2bssnode (struct wmi_t *wmip, A_UINT8 *datap, int len, A_UINT8 *bssid, A_UINT16 channel) -{ - A_STATUS status = A_OK; - bss_t *bss = NULL; - - bss = wlan_node_alloc (&wmip->wmi_scan_table, len); - - if (bss == NULL) { - return A_NO_MEMORY; - } - - bss->ni_snr = 95; - bss->ni_rssi = -58; - - A_ASSERT(bss->ni_buf != NULL); - - A_MEMCPY(bss->ni_buf, datap, len); - - bss->ni_framelen = len; - if (wlan_parse_beacon(bss->ni_buf, len, &bss->ni_cie) != A_OK) { - wlan_node_free(bss); - return A_EINVAL; - } - - /* - * Update the frequency in ie_chan, overwriting of channel number - * which is done in wlan_parse_beacon - */ - bss->ni_cie.ie_chan = channel; - wlan_setup_node(&wmip->wmi_scan_table, bss, bssid); - return status; -} - -//WAC -A_STATUS -wmi_wac_enable_cmd(struct wmi_t *wmip, WMI_WAC_ENABLE_CMD *param) -{ - void *osbuf; - WMI_WAC_ENABLE_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_WAC_ENABLE_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->enable = param->enable; - cmd->period = param->period; - cmd->threshold = param->threshold; - cmd->rssi = param->rssi; - A_MEMCPY(cmd->wps_pin, param->wps_pin, 8); - - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("WAC ENABLE: 0x%x\n", WMI_ENABLE_WAC_CMDID)); - status = wmi_cmd_send(wmip, osbuf, WMI_ENABLE_WAC_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_wac_scan_reply_cmd(struct wmi_t *wmip, WAC_SUBCMD param) -{ - void *osbuf; - WMI_WAC_SCAN_REPLY_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_WAC_SCAN_REPLY_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->cmdid = param; - - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("WAC SCAN REPLY: 0x%x\n", WMI_WAC_SCAN_REPLY_CMDID)); - - status = wmi_cmd_send(wmip, osbuf, WMI_WAC_SCAN_REPLY_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_wac_ctrl_req_cmd(struct wmi_t *wmip, WMI_WAC_CTRL_REQ_CMD *param) -{ - void *osbuf; - WMI_WAC_CTRL_REQ_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_WAC_CTRL_REQ_CMD *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->req = param->req; - cmd->cmd = param->cmd; - cmd->frame = param->frame; - A_MEMCPY(cmd->ie, param->ie, 17); - - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("WAC CTRL REQ: 0x%x\n", WMI_WAC_CTRL_REQ_CMDID)); - status = wmi_cmd_send(wmip, osbuf, WMI_WAC_CTRL_REQ_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_assoc_req_report_cmd (struct wmi_t *wmip, A_UINT8 host_accept, A_UINT8 host_reaspncode, A_UINT8 target_status, A_UINT8 *sta_mac_addr, A_UINT8 rspType) -{ - void *osbuf; - WMI_SEND_ASSOCRES_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC (sizeof(*cmd)); - - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT (osbuf, sizeof(*cmd)); - - cmd = (WMI_SEND_ASSOCRES_CMD *)(A_NETBUF_DATA(osbuf)); - - A_MEMZERO (cmd, sizeof(*cmd)); - - cmd->host_accept = host_accept; - cmd->host_reasonCode = host_reaspncode; - cmd->target_status = target_status; - - A_MEMCPY (cmd->sta_mac_addr, sta_mac_addr, ATH_MAC_LEN); - - cmd->rspType = rspType; - - status = wmi_cmd_send(wmip, osbuf, WMI_SEND_ASSOC_RES_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_assoc_req_enable_cmd (struct wmi_t *wmip, A_UINT8 enable) -{ - void *osbuf; - WMI_SET_ASSOCREQ_RELAY *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); - - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(*cmd)); - - cmd = (WMI_SET_ASSOCREQ_RELAY *)(A_NETBUF_DATA(osbuf)); - A_MEMZERO(cmd, sizeof(*cmd)); - cmd->enable = enable; - - status = wmi_cmd_send(wmip, osbuf, WMI_SET_ASSOC_REQ_RELAY_CMDID, - NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -static A_STATUS -wmi_report_assoc_req_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) -{ - WMI_ASSOCREQ_EVENT *ev; - - if (len < sizeof(WMI_ASSOCREQ_EVENT)) - { - return A_EINVAL; - } - - ev = (WMI_ASSOCREQ_EVENT *) datap; - - A_WMI_ASSOC_REQ_REPORT_EVENT(wmip->wmi_devt, ev->status, ev->rspType, datap, len); - - return A_OK; -} - -A_STATUS -wmi_force_target_assert(struct wmi_t *wmip) -{ - return wmi_simple_cmd(wmip, WMI_FORCE_TARGET_ASSERT_CMDID); -} - -/* - * This command will be used to enable/disable AP uAPSD feature - */ -A_STATUS -wmi_ap_set_apsd(struct wmi_t *wmip, A_UINT8 enable) -{ - void *osbuf; - WMI_AP_SET_APSD_CMD *cmd; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_AP_SET_APSD_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_AP_SET_APSD_CMD)); - cmd = (WMI_AP_SET_APSD_CMD *)(A_NETBUF_DATA(osbuf)); - - cmd->enable = enable; - - status = wmi_cmd_send(wmip, osbuf, WMI_AP_SET_APSD_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} - -A_STATUS -wmi_set_apsd_buffered_traffic_cmd(struct wmi_t *wmip, A_UINT16 aid, A_UINT16 bitmap, A_UINT32 flags) -{ - WMI_AP_APSD_BUFFERED_TRAFFIC_CMD *cmd; - void *osbuf; - A_STATUS status; - - osbuf = A_NETBUF_ALLOC(sizeof(WMI_AP_APSD_BUFFERED_TRAFFIC_CMD)); - if (osbuf == NULL) { - return A_NO_MEMORY; - } - - A_NETBUF_PUT(osbuf, sizeof(WMI_AP_APSD_BUFFERED_TRAFFIC_CMD)); - cmd = (WMI_AP_APSD_BUFFERED_TRAFFIC_CMD *)(A_NETBUF_DATA(osbuf)); - - cmd->aid = aid; - cmd->bitmap = bitmap; - cmd->flags = flags; - - status = wmi_cmd_send(wmip, osbuf, WMI_AP_APSD_BUFFERED_TRAFFIC_CMDID, NO_SYNC_WMIFLAG); - - if (status != A_OK) { - A_NETBUF_FREE(osbuf); - } - - return status; -} diff --git a/drivers/net/wireless/ar6003/host/wmi/wmi_host.h b/drivers/net/wireless/ar6003/host/wmi/wmi_host.h deleted file mode 100644 index 560cb8c001eb..000000000000 --- a/drivers/net/wireless/ar6003/host/wmi/wmi_host.h +++ /dev/null @@ -1,95 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This file contains local definitios for the wmi host module. -// -// Author(s): ="Atheros" -//============================================================================== -#ifndef _WMI_HOST_H_ -#define _WMI_HOST_H_ - -#include "roaming.h" -#ifdef __cplusplus -extern "C" { -#endif - -struct wmi_stats { - A_UINT32 cmd_len_err; - A_UINT32 cmd_id_err; -}; - -#define SSID_IE_LEN_INDEX 13 - - -/* Host side link management data structures */ -#define SIGNAL_QUALITY_THRESHOLD_LEVELS 6 -#define SIGNAL_QUALITY_UPPER_THRESHOLD_LEVELS SIGNAL_QUALITY_THRESHOLD_LEVELS -#define SIGNAL_QUALITY_LOWER_THRESHOLD_LEVELS SIGNAL_QUALITY_THRESHOLD_LEVELS -typedef struct sq_threshold_params_s { - A_INT16 upper_threshold[SIGNAL_QUALITY_UPPER_THRESHOLD_LEVELS]; - A_INT16 lower_threshold[SIGNAL_QUALITY_LOWER_THRESHOLD_LEVELS]; - A_UINT32 upper_threshold_valid_count; - A_UINT32 lower_threshold_valid_count; - A_UINT32 polling_interval; - A_UINT8 weight; - A_UINT8 last_rssi; //normally you would expect this to be bss specific but we keep only one instance because its only valid when the device is in a connected state. Not sure if it belongs to host or target. - A_UINT8 last_rssi_poll_event; //Not sure if it belongs to host or target -} SQ_THRESHOLD_PARAMS; - -/* - * Virtual device specific wmi_t data structure - */ - -struct wmi_t { - void *wmi_devt; - struct ieee80211_node_table wmi_scan_table; - A_UINT8 wmi_bssid[ATH_MAC_LEN]; - A_UINT8 wmi_powerMode; - A_UINT8 wmi_phyMode; - A_UINT8 wmi_keepaliveInterval; - SQ_THRESHOLD_PARAMS wmi_SqThresholdParams[SIGNAL_QUALITY_METRICS_NUM_MAX]; - CRYPTO_TYPE wmi_pair_crypto_type; - CRYPTO_TYPE wmi_grp_crypto_type; - WMI_SET_HT_CAP_CMD wmi_ht_cap[A_NUM_BANDS]; - A_BOOL wmi_is_wmm_enabled; - A_UINT8 wmi_dev_index; - struct wmi_stats wmi_stats; -}; - -/* - * Virtual device independent wmi data structure - */ - -struct wmi_priv_t { - A_BOOL wmi_ready; - A_BOOL wmi_numQoSStream; - A_UINT8 wmi_fatPipeExists; - A_UINT16 wmi_streamExistsForAC[WMM_NUM_AC]; - HTC_ENDPOINT_ID wmi_endpoint_id; - A_MUTEX_T wmi_lock; -}; -#define LOCK_WMI(w) A_MUTEX_LOCK(&(w)->wmi_lock); -#define UNLOCK_WMI(w) A_MUTEX_UNLOCK(&(w)->wmi_lock); - -#ifdef __cplusplus -} -#endif - -#endif /* _WMI_HOST_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/AR6002_regdump.h b/drivers/net/wireless/ar6003/include/AR6002/AR6002_regdump.h deleted file mode 100644 index e3291cf4dbd4..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/AR6002_regdump.h +++ /dev/null @@ -1,60 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2006-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef __AR6002_REGDUMP_H__ -#define __AR6002_REGDUMP_H__ - -#if !defined(__ASSEMBLER__) -/* - * XTensa CPU state - * This must match the state saved by the target exception handler. - */ -struct XTensa_exception_frame_s { - A_UINT32 xt_pc; - A_UINT32 xt_ps; - A_UINT32 xt_sar; - A_UINT32 xt_vpri; - A_UINT32 xt_a2; - A_UINT32 xt_a3; - A_UINT32 xt_a4; - A_UINT32 xt_a5; - A_UINT32 xt_exccause; - A_UINT32 xt_lcount; - A_UINT32 xt_lbeg; - A_UINT32 xt_lend; - - A_UINT32 epc1, epc2, epc3, epc4; - - /* Extra info to simplify post-mortem stack walkback */ -#define AR6002_REGDUMP_FRAMES 10 - struct { - A_UINT32 a0; /* pc */ - A_UINT32 a1; /* sp */ - A_UINT32 a2; - A_UINT32 a3; - } wb[AR6002_REGDUMP_FRAMES]; -}; -typedef struct XTensa_exception_frame_s CPU_exception_frame_t; -#define RD_SIZE sizeof(CPU_exception_frame_t) - -#endif -#endif /* __AR6002_REGDUMP_H__ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/AR6K_version.h b/drivers/net/wireless/ar6003/include/AR6002/AR6K_version.h deleted file mode 100644 index 4a4c01d2dae9..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/AR6K_version.h +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#define __VER_MAJOR_ 3 -#define __VER_MINOR_ 1 -#define __VER_PATCH_ 1 - -/* The makear6ksdk script (used for release builds) modifies the following line. */ -#define __BUILD_NUMBER_ 488 - - -/* Format of the version number. */ -#define VER_MAJOR_BIT_OFFSET 28 -#define VER_MINOR_BIT_OFFSET 24 -#define VER_PATCH_BIT_OFFSET 16 -#define VER_BUILD_NUM_BIT_OFFSET 0 - - -/* - * The version has the following format: - * Bits 28-31: Major version - * Bits 24-27: Minor version - * Bits 16-23: Patch version - * Bits 0-15: Build number (automatically generated during build process ) - * E.g. Build 1.1.3.7 would be represented as 0x11030007. - * - * DO NOT split the following macro into multiple lines as this may confuse the build scripts. - */ -#define AR6K_SW_VERSION ( ( __VER_MAJOR_ << VER_MAJOR_BIT_OFFSET ) + ( __VER_MINOR_ << VER_MINOR_BIT_OFFSET ) + ( __VER_PATCH_ << VER_PATCH_BIT_OFFSET ) + ( __BUILD_NUMBER_ << VER_BUILD_NUM_BIT_OFFSET ) ) - -/* ABI Version. Reflects the version of binary interface exposed by AR6K target firmware. Needs to be incremented by 1 for any change in the firmware that requires upgrade of the driver on the host side for the change to work correctly */ -#define AR6K_ABI_VERSION 1 diff --git a/drivers/net/wireless/ar6003/include/AR6002/addrs.h b/drivers/net/wireless/ar6003/include/AR6002/addrs.h deleted file mode 100644 index 273779890390..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/addrs.h +++ /dev/null @@ -1,123 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef __ADDRS_H__ -#define __ADDRS_H__ - -/* - * Special AR6002 Addresses that may be needed by special - * applications (e.g. ART) on the Host as well as Target. - */ - -#if defined(AR6002_REV2) -#define AR6K_RAM_START 0x00500000 -#define TARG_RAM_OFFSET(vaddr) ((A_UINT32)(vaddr) & 0xfffff) -#define TARG_RAM_SZ (184*1024) -#define TARG_ROM_SZ (80*1024) -#endif -#if defined(AR6002_REV4) || defined(AR6003) -#define AR6K_RAM_START 0x00540000 -#define TARG_RAM_OFFSET(vaddr) (((A_UINT32)(vaddr) & 0xfffff) - 0x40000) -#define TARG_RAM_SZ (256*1024) -#define TARG_ROM_SZ (256*1024) -#endif -#if defined(AR6002_REV6) || defined(AR6004) -#define AR6K_RAM_START 0x00400000 -#define TARG_RAM_OFFSET(vaddr) (((A_UINT32)(vaddr) & 0x3fffff)) -#define TARG_RAM_SZ (256*1024) -#define TARG_ROM_SZ (512*1024) - -#define TARG_IRAM_START 0x00998000 -#define TARG_IRAM_SZ ((128+32)*1024) - -#define TARG_RAM_ACS_RESERVE 32 - -#endif - -#define AR6002_BOARD_DATA_SZ 768 -#define AR6002_BOARD_EXT_DATA_SZ 0 -#define AR6003_BOARD_DATA_SZ 1024 -/* Reserve space for extended board data */ -/* AR6003 v2 has only 768 bytes for extended board data */ -#define AR6003_VER2_BOARD_EXT_DATA_SZ 768 -#if defined(AR6002_REV42) -#define AR6003_BOARD_EXT_DATA_SZ AR6003_VER2_BOARD_EXT_DATA_SZ -#else -#define AR6003_BOARD_EXT_DATA_SZ 1024 -#endif /* AR6002_REV42 */ -#define MCKINLEY_BOARD_DATA_SZ 1024 -#define MCKINLEY_BOARD_EXT_DATA_SZ 0 - -#define AR6K_RAM_ADDR(byte_offset) (AR6K_RAM_START+(byte_offset)) -#define TARG_RAM_ADDRS(byte_offset) AR6K_RAM_ADDR(byte_offset) - -#if defined(AR6002_REV2) || defined(AR6002_REV4) -#define AR6K_ROM_START 0x004e0000 -#define TARG_ROM_OFFSET(vaddr) (((A_UINT32)(vaddr) & 0x1fffff) - 0xe0000) -#endif /* AR6002_REV2 || AR6002_REV4 */ -#if defined(AR6002_REV6) -#define AR6K_ROM_START 0x00900000 -#define TARG_ROM_OFFSET(vaddr) ((A_UINT32)(vaddr) & 0xfffff) -#endif /* AR6002_REV6 */ -#define AR6K_ROM_ADDR(byte_offset) (AR6K_ROM_START+(byte_offset)) -#define TARG_ROM_ADDRS(byte_offset) AR6K_ROM_ADDR(byte_offset) - -/* - * At this ROM address is a pointer to the start of the ROM DataSet Index. - * If there are no ROM DataSets, there's a 0 at this address. - */ -#define ROM_DATASET_INDEX_ADDR (TARG_ROM_ADDRS(TARG_ROM_SZ)-8) -#define ROM_MBIST_CKSUM_ADDR (TARG_ROM_ADDRS(TARG_ROM_SZ)-4) - -/* - * The API A_BOARD_DATA_ADDR() is the proper way to get a read pointer to - * board data. - */ - -/* Size of Board Data, in bytes */ -#if defined(AR6002_REV4) || defined(AR6003) -#define BOARD_DATA_SZ (AR6003_BOARD_DATA_SZ + AR6003_BOARD_EXT_DATA_SZ) -#endif -#if defined(AR6002_REV6) -#define BOARD_DATA_SZ MCKINLEY_BOARD_DATA_SZ -#endif -#if !defined(BOARD_DATA_SZ) -#define BOARD_DATA_SZ AR6002_BOARD_DATA_SZ -#endif - - -/* - * Constants used by ASM code to access fields of host_interest_s, - * which is at a fixed location in RAM. - */ -#if defined(AR6002_REV4) || defined(AR6003) || defined(AR6002_REV6) -#define HOST_INTEREST_FLASH_IS_PRESENT_ADDR (AR6K_RAM_START + 0x60c) -#endif -#if !defined(HOST_INTEREST_FLASH_IS_PRESENT_ADDR) -#define HOST_INTEREST_FLASH_IS_PRESENT_ADDR (AR6K_RAM_START + 0x40c) -#endif -#define FLASH_IS_PRESENT_TARGADDR HOST_INTEREST_FLASH_IS_PRESENT_ADDR - -#endif /* __ADDRS_H__ */ - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsEnv.vr b/drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsEnv.vr deleted file mode 100644 index aa95b3672da0..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsEnv.vr +++ /dev/null @@ -1,58 +0,0 @@ -#include -#include -#include "AveStdLib.vri" - -#ifndef SYNOPSYS_NTB - #include "MercuryEnv.vrh" - #include "LegacyRegsEnvConfig.vrh" - #include "LegacyRegsTop.vrh" -#endif - -class LegacyRegsEnv extends MercuryEnv { - LegacyRegsEnvConfig envConfig; - LegacyRegsTop regsTop; - - task new(string name = "LegacyRegsEnv", LegacyRegsEnvConfig envConfig = null); - virtual function AveEnvConfig GetEnvConfig(); - virtual task build(); - virtual task directed_test_t(); -} - - -task LegacyRegsEnv::new(string name = "LegacyRegsEnv", LegacyRegsEnvConfig envConfig = null) { - MercuryTopConfig mercuryTopConfig; - LegacyRegsTopConfig legacyRegsTopConfig; - - super.new(); - this.envConfig = envConfig; - if (this.envConfig == null) this.envConfig = new(); - cast_assign(mercuryTopConfig, this.envConfig.GetTopConfig()); - - // build and register LegacyRegsTopConfig - legacyRegsTopConfig = new(*, *, "legacyRegsTopConfig"); - mercuryTopConfig.RegisterConfig(legacyRegsTopConfig); -} - -function AveEnvConfig LegacyRegsEnv::GetEnvConfig() { - GetEnvConfig = this.envConfig; -} - -task LegacyRegsEnv::build() { - MercuryTopConfig mercuryTopConfig; - LegacyRegsTopConfig legacyRegsTopConfig; - super.build(); - - // build and register MercuryTop - cast_assign(mercuryTopConfig, this.envConfig.GetTopConfig()); - this.mercuryTop = new(mercuryTopConfig); - this.RegisterTop(this.mercuryTop); - - // build and register LegacyRegsTop. - cast_assign(legacyRegsTopConfig, mercuryTopConfig.GetConfigInstanceByName("legacyRegsTopConfig")); - this.regsTop = new("LegacyRegsTop", "regsTop", 0, legacyRegsTopConfig); - void = this.mercuryTop.RegisterXactor(this.regsTop, AVE_TOP_NO_WAIT_FOR_DONE); -} - -task LegacyRegsEnv::directed_test_t() { -} - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsEnvConfig.vr b/drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsEnvConfig.vr deleted file mode 100644 index ed706ac02fa2..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsEnvConfig.vr +++ /dev/null @@ -1,42 +0,0 @@ -#include -#include "AveStdLib.vri" - -#ifndef SYNOPSYS_NTB - #include "MercuryEnvConfig.vrh" -#endif - -class LegacyRegsEnvConfig extends MercuryEnvConfig { - static local rvm_log log = new("LegacyRegsEnvConfig", "class"); - - constraint LegacyRegsEnvConfigConstraint { - numRuns == 1; - } - - constraint LegacyRegsEnvConfigTest; - - task new(rvm_log log = null); - virtual function rvm_data allocate(); - virtual function AveTopConfig GetTopConfig(); - virtual task SetTopConfig(AveTopConfig topConfig); -} - -task LegacyRegsEnvConfig::new(rvm_log log = null) { - super.new((log != null) ? log : this.log); - if (log != null) this.log = log; -} - -function rvm_data LegacyRegsEnvConfig::allocate() { - LegacyRegsEnvConfig envConfig = new(); - allocate = envConfig; -} - -function AveTopConfig LegacyRegsEnvConfig::GetTopConfig() { - GetTopConfig = this.topConfig; -} - -task LegacyRegsEnvConfig::SetTopConfig(AveTopConfig topConfig) { - if (!cast_assign(this.topConfig, topConfig, CHECK)) { - rvm_fatal(log, "Cannot set topConfig to non-LegacyRegsTopConfig instance"); - } -} - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsTop.vr b/drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsTop.vr deleted file mode 100644 index 17e9c626383b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsTop.vr +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include - -#ifndef SYNOPSYS_NTB - #include "AveTop.vrh" - #include "LegacyRegsTopConfig.vrh" -#endif - -class LegacyRegsTop extends AveTop { - LegacyRegsTopConfig topConfig; - - task new(string name, string instance, integer stream_id, LegacyRegsTopConfig topConfig); - virtual task reset_dut_t(); - virtual task start_xactor(); - virtual task stop_xactor(); - virtual task reset_xactor(integer rstType); -} - -task LegacyRegsTop::new(string name, string instance, integer stream_id, LegacyRegsTopConfig topConfig) { - super.new(name, instance, stream_id, topConfig); - this.topConfig = topConfig; -} - -task LegacyRegsTop::reset_dut_t() { - super.reset_dut_t(); -} - -task LegacyRegsTop::start_xactor() { - super.start_xactor(); -} - -task LegacyRegsTop::stop_xactor() { - super.stop_xactor(); -} - -task LegacyRegsTop::reset_xactor(integer rstType) { - super.reset_xactor(rstType); -} - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsTopConfig.vr b/drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsTopConfig.vr deleted file mode 100644 index 162195e5760f..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/LegacyRegsTopConfig.vr +++ /dev/null @@ -1,46 +0,0 @@ -#include - -#ifndef SYNOPSYS_NTB - #include "AveTopConfig.vr" -#endif - -class LegacyRegsTopConfig extends AveTopConfig { - local rvm_log log = new("LegacyRegsTopConfig", "class"); - - task new(rvm_log log = null, string name="LegacyRegsTopConfig", string instance="class"); - virtual function rvm_data allocate(); - virtual function rvm_data copy(rvm_data cpy = null); - virtual function AveData GetDutConfig(); - virtual task SetDutConfig(AveData dutConfig); -} - -task LegacyRegsTopConfig::new(rvm_log log = null, string name="LegacyRegsTopConfig", string instance="class") { - super.new(((log != null) ? log : this.log), name, instance); - if (log != null) this.log = log; -} - -function rvm_data LegacyRegsTopConfig::allocate() { - LegacyRegsTopConfig c = new(); - allocate = c; -} - -function rvm_data LegacyRegsTopConfig::copy(rvm_data cpy = null) { - LegacyRegsTopConfig to; - if (cpy == null) { - cast_assign(to, this.allocate()); - } - else { - if(!cast_assign(to, cpy, CHECK)) - rvm_error(this.log, "PROBLEM"); - } - void = super.copy(to); - copy = to; -} - -function AveData LegacyRegsTopConfig::GetDutConfig() { - GetDutConfig = null; -} - -task LegacyRegsTopConfig::SetDutConfig(AveData dutConfig) { -} - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/Makefile.child b/drivers/net/wireless/ar6003/include/AR6002/hw/Makefile.child deleted file mode 100644 index bff4ba902e61..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/Makefile.child +++ /dev/null @@ -1,10 +0,0 @@ -################################################################################ -# $Id: //depot/chips/mercury/2.1/dv/soc/src/ave/regs/Makefile.child#1 $ -################################################################################ - -NTB_SRCS += $(ROOT)/regs/LegacyRegsTopConfig.vr \ - $(ROOT)/regs/LegacyRegsTop.vr \ - $(ROOT)/regs/LegacyRegsEnvConfig.vr \ - $(ROOT)/regs/LegacyRegsEnv.vr \ - -NTB_INC_DIRS += $(ROOT)/regs diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/Makefile.reg b/drivers/net/wireless/ar6003/include/AR6002/hw/Makefile.reg deleted file mode 100644 index 946d31e9a986..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/Makefile.reg +++ /dev/null @@ -1,28 +0,0 @@ - - -GEN_VRH = reg -vrh -P4_EDIT = p4 edit -P4_SUBMIT = p4 submit - -REG_RTL_DIR = ../../../../../rtl -REG_SRCS = $(shell find $(REG_RTL_DIR) -name '*.reg'); -REG_VRH_TGTS = $(wildcard *_reg.vrh) - -REDO_ALL_REG_VRH = $(foreach var, $(REG_VRH_TGTS), $(GEN_VRH) $(filter %$(patsubst %vrh,%reg,$(var)), $(REG_SRCS));) - -VPATH = $(dir $(REG_SRCS)) - -all: $(REG_VRH_TGTS) - -refresh_all_reg_vrh: - $(P4_EDIT) $(REG_VRH_TGTS) - $(REDO_ALL_REG_VRH) - $(P4_SUBMIT) ... - -%_reg.vrh : %_reg.reg - $(P4_EDIT) $@ - $(GEN_VRH) $< - $(P4_SUBMIT) ... - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/addac.h b/drivers/net/wireless/ar6003/include/AR6002/hw/addac.h deleted file mode 100644 index 0c58cc04adad..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/addac.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef _ADDAC_REG_H_ -#define _ADDAC_REG_H_ - -#define ADDAC_ADDAC1_ADDRESS 0x00000000 -#define ADDAC_ADDAC1_OFFSET 0x00000000 -#define ADDAC_ADDAC1_PLL_SVREG_MSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_LSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_MASK 0x80000000 -#define ADDAC_ADDAC1_PLL_SVREG_GET(x) (((x) & ADDAC_ADDAC1_PLL_SVREG_MASK) >> ADDAC_ADDAC1_PLL_SVREG_LSB) -#define ADDAC_ADDAC1_PLL_SVREG_SET(x) (((x) << ADDAC_ADDAC1_PLL_SVREG_LSB) & ADDAC_ADDAC1_PLL_SVREG_MASK) -#define ADDAC_ADDAC1_PLL_SCLAMP_MSB 30 -#define ADDAC_ADDAC1_PLL_SCLAMP_LSB 28 -#define ADDAC_ADDAC1_PLL_SCLAMP_MASK 0x70000000 -#define ADDAC_ADDAC1_PLL_SCLAMP_GET(x) (((x) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) >> ADDAC_ADDAC1_PLL_SCLAMP_LSB) -#define ADDAC_ADDAC1_PLL_SCLAMP_SET(x) (((x) << ADDAC_ADDAC1_PLL_SCLAMP_LSB) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) -#define ADDAC_ADDAC1_PLL_ATB_MSB 27 -#define ADDAC_ADDAC1_PLL_ATB_LSB 26 -#define ADDAC_ADDAC1_PLL_ATB_MASK 0x0c000000 -#define ADDAC_ADDAC1_PLL_ATB_GET(x) (((x) & ADDAC_ADDAC1_PLL_ATB_MASK) >> ADDAC_ADDAC1_PLL_ATB_LSB) -#define ADDAC_ADDAC1_PLL_ATB_SET(x) (((x) << ADDAC_ADDAC1_PLL_ATB_LSB) & ADDAC_ADDAC1_PLL_ATB_MASK) -#define ADDAC_ADDAC1_PLL_ICP_MSB 25 -#define ADDAC_ADDAC1_PLL_ICP_LSB 23 -#define ADDAC_ADDAC1_PLL_ICP_MASK 0x03800000 -#define ADDAC_ADDAC1_PLL_ICP_GET(x) (((x) & ADDAC_ADDAC1_PLL_ICP_MASK) >> ADDAC_ADDAC1_PLL_ICP_LSB) -#define ADDAC_ADDAC1_PLL_ICP_SET(x) (((x) << ADDAC_ADDAC1_PLL_ICP_LSB) & ADDAC_ADDAC1_PLL_ICP_MASK) -#define ADDAC_ADDAC1_PLL_FILTER_MSB 22 -#define ADDAC_ADDAC1_PLL_FILTER_LSB 15 -#define ADDAC_ADDAC1_PLL_FILTER_MASK 0x007f8000 -#define ADDAC_ADDAC1_PLL_FILTER_GET(x) (((x) & ADDAC_ADDAC1_PLL_FILTER_MASK) >> ADDAC_ADDAC1_PLL_FILTER_LSB) -#define ADDAC_ADDAC1_PLL_FILTER_SET(x) (((x) << ADDAC_ADDAC1_PLL_FILTER_LSB) & ADDAC_ADDAC1_PLL_FILTER_MASK) -#define ADDAC_ADDAC1_PWDPLL_MSB 14 -#define ADDAC_ADDAC1_PWDPLL_LSB 14 -#define ADDAC_ADDAC1_PWDPLL_MASK 0x00004000 -#define ADDAC_ADDAC1_PWDPLL_GET(x) (((x) & ADDAC_ADDAC1_PWDPLL_MASK) >> ADDAC_ADDAC1_PWDPLL_LSB) -#define ADDAC_ADDAC1_PWDPLL_SET(x) (((x) << ADDAC_ADDAC1_PWDPLL_LSB) & ADDAC_ADDAC1_PWDPLL_MASK) -#define ADDAC_ADDAC1_PWDADC_MSB 13 -#define ADDAC_ADDAC1_PWDADC_LSB 13 -#define ADDAC_ADDAC1_PWDADC_MASK 0x00002000 -#define ADDAC_ADDAC1_PWDADC_GET(x) (((x) & ADDAC_ADDAC1_PWDADC_MASK) >> ADDAC_ADDAC1_PWDADC_LSB) -#define ADDAC_ADDAC1_PWDADC_SET(x) (((x) << ADDAC_ADDAC1_PWDADC_LSB) & ADDAC_ADDAC1_PWDADC_MASK) -#define ADDAC_ADDAC1_PWDDAC_MSB 12 -#define ADDAC_ADDAC1_PWDDAC_LSB 12 -#define ADDAC_ADDAC1_PWDDAC_MASK 0x00001000 -#define ADDAC_ADDAC1_PWDDAC_GET(x) (((x) & ADDAC_ADDAC1_PWDDAC_MASK) >> ADDAC_ADDAC1_PWDDAC_LSB) -#define ADDAC_ADDAC1_PWDDAC_SET(x) (((x) << ADDAC_ADDAC1_PWDDAC_LSB) & ADDAC_ADDAC1_PWDDAC_MASK) -#define ADDAC_ADDAC1_FORCEMSBLOW_MSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_LSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_MASK 0x00000800 -#define ADDAC_ADDAC1_FORCEMSBLOW_GET(x) (((x) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) >> ADDAC_ADDAC1_FORCEMSBLOW_LSB) -#define ADDAC_ADDAC1_FORCEMSBLOW_SET(x) (((x) << ADDAC_ADDAC1_FORCEMSBLOW_LSB) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) -#define ADDAC_ADDAC1_SELMANPWDS_MSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_LSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_MASK 0x00000400 -#define ADDAC_ADDAC1_SELMANPWDS_GET(x) (((x) & ADDAC_ADDAC1_SELMANPWDS_MASK) >> ADDAC_ADDAC1_SELMANPWDS_LSB) -#define ADDAC_ADDAC1_SELMANPWDS_SET(x) (((x) << ADDAC_ADDAC1_SELMANPWDS_LSB) & ADDAC_ADDAC1_SELMANPWDS_MASK) -#define ADDAC_ADDAC1_INV_CLK160_ADC_MSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_LSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_MASK 0x00000200 -#define ADDAC_ADDAC1_INV_CLK160_ADC_GET(x) (((x) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) >> ADDAC_ADDAC1_INV_CLK160_ADC_LSB) -#define ADDAC_ADDAC1_INV_CLK160_ADC_SET(x) (((x) << ADDAC_ADDAC1_INV_CLK160_ADC_LSB) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) -#define ADDAC_ADDAC1_CM_SEL_MSB 8 -#define ADDAC_ADDAC1_CM_SEL_LSB 7 -#define ADDAC_ADDAC1_CM_SEL_MASK 0x00000180 -#define ADDAC_ADDAC1_CM_SEL_GET(x) (((x) & ADDAC_ADDAC1_CM_SEL_MASK) >> ADDAC_ADDAC1_CM_SEL_LSB) -#define ADDAC_ADDAC1_CM_SEL_SET(x) (((x) << ADDAC_ADDAC1_CM_SEL_LSB) & ADDAC_ADDAC1_CM_SEL_MASK) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_LSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MASK 0x00000040 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_GET(x) (((x) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) >> ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_SET(x) (((x) << ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) -#define ADDAC_ADDAC1_SPARE_MSB 5 -#define ADDAC_ADDAC1_SPARE_LSB 0 -#define ADDAC_ADDAC1_SPARE_MASK 0x0000003f -#define ADDAC_ADDAC1_SPARE_GET(x) (((x) & ADDAC_ADDAC1_SPARE_MASK) >> ADDAC_ADDAC1_SPARE_LSB) -#define ADDAC_ADDAC1_SPARE_SET(x) (((x) << ADDAC_ADDAC1_SPARE_LSB) & ADDAC_ADDAC1_SPARE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct addac_reg_s { - volatile unsigned int addac_addac1; -} addac_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _ADDAC_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/addac.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/addac.vrh deleted file mode 100644 index caa44243dcc3..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/addac.vrh +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef _ADDAC_VRH_ -#define _ADDAC_VRH_ - -#define ADDAC_ADDAC1_ADDRESS 'h00000000 -#define ADDAC_ADDAC1_PLL_SVREG_MSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_LSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_MASK 'h80000000 -#define ADDAC_ADDAC1_PLL_SVREG_GET(x) (((x) & ADDAC_ADDAC1_PLL_SVREG_MASK) >> ADDAC_ADDAC1_PLL_SVREG_LSB) -#define ADDAC_ADDAC1_PLL_SVREG_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_SVREG_LSB) & ADDAC_ADDAC1_PLL_SVREG_MASK) -#define ADDAC_ADDAC1_PLL_SVREG_RESET 1'h1 -#define ADDAC_ADDAC1_PLL_SCLAMP_MSB 30 -#define ADDAC_ADDAC1_PLL_SCLAMP_LSB 28 -#define ADDAC_ADDAC1_PLL_SCLAMP_MASK 'h70000000 -#define ADDAC_ADDAC1_PLL_SCLAMP_GET(x) (((x) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) >> ADDAC_ADDAC1_PLL_SCLAMP_LSB) -#define ADDAC_ADDAC1_PLL_SCLAMP_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_SCLAMP_LSB) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) -#define ADDAC_ADDAC1_PLL_SCLAMP_RESET 3'h5 -#define ADDAC_ADDAC1_PLL_ATB_MSB 27 -#define ADDAC_ADDAC1_PLL_ATB_LSB 26 -#define ADDAC_ADDAC1_PLL_ATB_MASK 'h0c000000 -#define ADDAC_ADDAC1_PLL_ATB_GET(x) (((x) & ADDAC_ADDAC1_PLL_ATB_MASK) >> ADDAC_ADDAC1_PLL_ATB_LSB) -#define ADDAC_ADDAC1_PLL_ATB_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_ATB_LSB) & ADDAC_ADDAC1_PLL_ATB_MASK) -#define ADDAC_ADDAC1_PLL_ATB_RESET 2'h0 -#define ADDAC_ADDAC1_PLL_ICP_MSB 25 -#define ADDAC_ADDAC1_PLL_ICP_LSB 23 -#define ADDAC_ADDAC1_PLL_ICP_MASK 'h03800000 -#define ADDAC_ADDAC1_PLL_ICP_GET(x) (((x) & ADDAC_ADDAC1_PLL_ICP_MASK) >> ADDAC_ADDAC1_PLL_ICP_LSB) -#define ADDAC_ADDAC1_PLL_ICP_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_ICP_LSB) & ADDAC_ADDAC1_PLL_ICP_MASK) -#define ADDAC_ADDAC1_PLL_ICP_RESET 3'h0 -#define ADDAC_ADDAC1_PLL_FILTER_MSB 22 -#define ADDAC_ADDAC1_PLL_FILTER_LSB 15 -#define ADDAC_ADDAC1_PLL_FILTER_MASK 'h007f8000 -#define ADDAC_ADDAC1_PLL_FILTER_GET(x) (((x) & ADDAC_ADDAC1_PLL_FILTER_MASK) >> ADDAC_ADDAC1_PLL_FILTER_LSB) -#define ADDAC_ADDAC1_PLL_FILTER_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_FILTER_LSB) & ADDAC_ADDAC1_PLL_FILTER_MASK) -#define ADDAC_ADDAC1_PLL_FILTER_RESET 8'h35 -#define ADDAC_ADDAC1_PWDPLL_MSB 14 -#define ADDAC_ADDAC1_PWDPLL_LSB 14 -#define ADDAC_ADDAC1_PWDPLL_MASK 'h00004000 -#define ADDAC_ADDAC1_PWDPLL_GET(x) (((x) & ADDAC_ADDAC1_PWDPLL_MASK) >> ADDAC_ADDAC1_PWDPLL_LSB) -#define ADDAC_ADDAC1_PWDPLL_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PWDPLL_LSB) & ADDAC_ADDAC1_PWDPLL_MASK) -#define ADDAC_ADDAC1_PWDPLL_RESET 1'h0 -#define ADDAC_ADDAC1_PWDADC_MSB 13 -#define ADDAC_ADDAC1_PWDADC_LSB 13 -#define ADDAC_ADDAC1_PWDADC_MASK 'h00002000 -#define ADDAC_ADDAC1_PWDADC_GET(x) (((x) & ADDAC_ADDAC1_PWDADC_MASK) >> ADDAC_ADDAC1_PWDADC_LSB) -#define ADDAC_ADDAC1_PWDADC_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PWDADC_LSB) & ADDAC_ADDAC1_PWDADC_MASK) -#define ADDAC_ADDAC1_PWDADC_RESET 1'h0 -#define ADDAC_ADDAC1_PWDDAC_MSB 12 -#define ADDAC_ADDAC1_PWDDAC_LSB 12 -#define ADDAC_ADDAC1_PWDDAC_MASK 'h00001000 -#define ADDAC_ADDAC1_PWDDAC_GET(x) (((x) & ADDAC_ADDAC1_PWDDAC_MASK) >> ADDAC_ADDAC1_PWDDAC_LSB) -#define ADDAC_ADDAC1_PWDDAC_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PWDDAC_LSB) & ADDAC_ADDAC1_PWDDAC_MASK) -#define ADDAC_ADDAC1_PWDDAC_RESET 1'h0 -#define ADDAC_ADDAC1_FORCEMSBLOW_MSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_LSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_MASK 'h00000800 -#define ADDAC_ADDAC1_FORCEMSBLOW_GET(x) (((x) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) >> ADDAC_ADDAC1_FORCEMSBLOW_LSB) -#define ADDAC_ADDAC1_FORCEMSBLOW_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_FORCEMSBLOW_LSB) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) -#define ADDAC_ADDAC1_FORCEMSBLOW_RESET 1'h0 -#define ADDAC_ADDAC1_SELMANPWDS_MSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_LSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_MASK 'h00000400 -#define ADDAC_ADDAC1_SELMANPWDS_GET(x) (((x) & ADDAC_ADDAC1_SELMANPWDS_MASK) >> ADDAC_ADDAC1_SELMANPWDS_LSB) -#define ADDAC_ADDAC1_SELMANPWDS_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_SELMANPWDS_LSB) & ADDAC_ADDAC1_SELMANPWDS_MASK) -#define ADDAC_ADDAC1_SELMANPWDS_RESET 1'h0 -#define ADDAC_ADDAC1_INV_CLK160_ADC_MSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_LSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_MASK 'h00000200 -#define ADDAC_ADDAC1_INV_CLK160_ADC_GET(x) (((x) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) >> ADDAC_ADDAC1_INV_CLK160_ADC_LSB) -#define ADDAC_ADDAC1_INV_CLK160_ADC_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_INV_CLK160_ADC_LSB) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) -#define ADDAC_ADDAC1_INV_CLK160_ADC_RESET 1'h0 -#define ADDAC_ADDAC1_CM_SEL_MSB 8 -#define ADDAC_ADDAC1_CM_SEL_LSB 7 -#define ADDAC_ADDAC1_CM_SEL_MASK 'h00000180 -#define ADDAC_ADDAC1_CM_SEL_GET(x) (((x) & ADDAC_ADDAC1_CM_SEL_MASK) >> ADDAC_ADDAC1_CM_SEL_LSB) -#define ADDAC_ADDAC1_CM_SEL_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_CM_SEL_LSB) & ADDAC_ADDAC1_CM_SEL_MASK) -#define ADDAC_ADDAC1_CM_SEL_RESET 2'h1 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_LSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MASK 'h00000040 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_GET(x) (((x) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) >> ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_RESET 1'h0 -#define ADDAC_ADDAC1_SPARE_MSB 5 -#define ADDAC_ADDAC1_SPARE_LSB 0 -#define ADDAC_ADDAC1_SPARE_MASK 'h0000003f -#define ADDAC_ADDAC1_SPARE_GET(x) (((x) & ADDAC_ADDAC1_SPARE_MASK) >> ADDAC_ADDAC1_SPARE_LSB) -#define ADDAC_ADDAC1_SPARE_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_SPARE_LSB) & ADDAC_ADDAC1_SPARE_MASK) -#define ADDAC_ADDAC1_SPARE_RESET 6'h0 -#define ADDAC_ADDAC1_RESET (32'h0 | \ - ADDAC_ADDAC1_PLL_SVREG_SET(ADDAC_ADDAC1_PLL_SVREG_RESET) | \ - ADDAC_ADDAC1_PLL_SCLAMP_SET(ADDAC_ADDAC1_PLL_SCLAMP_RESET) | \ - ADDAC_ADDAC1_PLL_ATB_SET(ADDAC_ADDAC1_PLL_ATB_RESET) | \ - ADDAC_ADDAC1_PLL_ICP_SET(ADDAC_ADDAC1_PLL_ICP_RESET) | \ - ADDAC_ADDAC1_PLL_FILTER_SET(ADDAC_ADDAC1_PLL_FILTER_RESET) | \ - ADDAC_ADDAC1_PWDPLL_SET(ADDAC_ADDAC1_PWDPLL_RESET) | \ - ADDAC_ADDAC1_PWDADC_SET(ADDAC_ADDAC1_PWDADC_RESET) | \ - ADDAC_ADDAC1_PWDDAC_SET(ADDAC_ADDAC1_PWDDAC_RESET) | \ - ADDAC_ADDAC1_FORCEMSBLOW_SET(ADDAC_ADDAC1_FORCEMSBLOW_RESET) | \ - ADDAC_ADDAC1_SELMANPWDS_SET(ADDAC_ADDAC1_SELMANPWDS_RESET) | \ - ADDAC_ADDAC1_INV_CLK160_ADC_SET(ADDAC_ADDAC1_INV_CLK160_ADC_RESET) | \ - ADDAC_ADDAC1_CM_SEL_SET(ADDAC_ADDAC1_CM_SEL_RESET) | \ - ADDAC_ADDAC1_DISABLE_DAC_REG_SET(ADDAC_ADDAC1_DISABLE_DAC_REG_RESET) | \ - ADDAC_ADDAC1_SPARE_SET(ADDAC_ADDAC1_SPARE_RESET)) -#define ADDAC_ADDAC1_HW_MASK (32'h0) -#define ADDAC_ADDAC1_SW_MASK (32'h0 | \ - ADDAC_ADDAC1_PLL_SVREG_MASK | \ - ADDAC_ADDAC1_PLL_SCLAMP_MASK | \ - ADDAC_ADDAC1_PLL_ATB_MASK | \ - ADDAC_ADDAC1_PLL_ICP_MASK | \ - ADDAC_ADDAC1_PLL_FILTER_MASK | \ - ADDAC_ADDAC1_PWDPLL_MASK | \ - ADDAC_ADDAC1_PWDADC_MASK | \ - ADDAC_ADDAC1_PWDDAC_MASK | \ - ADDAC_ADDAC1_FORCEMSBLOW_MASK | \ - ADDAC_ADDAC1_SELMANPWDS_MASK | \ - ADDAC_ADDAC1_INV_CLK160_ADC_MASK | \ - ADDAC_ADDAC1_CM_SEL_MASK | \ - ADDAC_ADDAC1_DISABLE_DAC_REG_MASK | \ - ADDAC_ADDAC1_SPARE_MASK) - -#define ADDAC_ADDRESS_MSB 1 - -#endif /* _ADDAC_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/analog_intf_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/analog_intf_reg.h deleted file mode 100644 index 9c82767b6efb..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/analog_intf_reg.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef _ANALOG_INTF_REG_REG_H_ -#define _ANALOG_INTF_REG_REG_H_ - -#define SW_OVERRIDE_ADDRESS 0x00000080 -#define SW_OVERRIDE_OFFSET 0x00000080 -#define SW_OVERRIDE_SUPDATE_DELAY_MSB 1 -#define SW_OVERRIDE_SUPDATE_DELAY_LSB 1 -#define SW_OVERRIDE_SUPDATE_DELAY_MASK 0x00000002 -#define SW_OVERRIDE_SUPDATE_DELAY_GET(x) (((x) & SW_OVERRIDE_SUPDATE_DELAY_MASK) >> SW_OVERRIDE_SUPDATE_DELAY_LSB) -#define SW_OVERRIDE_SUPDATE_DELAY_SET(x) (((x) << SW_OVERRIDE_SUPDATE_DELAY_LSB) & SW_OVERRIDE_SUPDATE_DELAY_MASK) -#define SW_OVERRIDE_ENABLE_MSB 0 -#define SW_OVERRIDE_ENABLE_LSB 0 -#define SW_OVERRIDE_ENABLE_MASK 0x00000001 -#define SW_OVERRIDE_ENABLE_GET(x) (((x) & SW_OVERRIDE_ENABLE_MASK) >> SW_OVERRIDE_ENABLE_LSB) -#define SW_OVERRIDE_ENABLE_SET(x) (((x) << SW_OVERRIDE_ENABLE_LSB) & SW_OVERRIDE_ENABLE_MASK) - -#define SIN_VAL_ADDRESS 0x00000084 -#define SIN_VAL_OFFSET 0x00000084 -#define SIN_VAL_SIN_MSB 0 -#define SIN_VAL_SIN_LSB 0 -#define SIN_VAL_SIN_MASK 0x00000001 -#define SIN_VAL_SIN_GET(x) (((x) & SIN_VAL_SIN_MASK) >> SIN_VAL_SIN_LSB) -#define SIN_VAL_SIN_SET(x) (((x) << SIN_VAL_SIN_LSB) & SIN_VAL_SIN_MASK) - -#define SW_SCLK_ADDRESS 0x00000088 -#define SW_SCLK_OFFSET 0x00000088 -#define SW_SCLK_SW_SCLK_MSB 0 -#define SW_SCLK_SW_SCLK_LSB 0 -#define SW_SCLK_SW_SCLK_MASK 0x00000001 -#define SW_SCLK_SW_SCLK_GET(x) (((x) & SW_SCLK_SW_SCLK_MASK) >> SW_SCLK_SW_SCLK_LSB) -#define SW_SCLK_SW_SCLK_SET(x) (((x) << SW_SCLK_SW_SCLK_LSB) & SW_SCLK_SW_SCLK_MASK) - -#define SW_CNTL_ADDRESS 0x0000008c -#define SW_CNTL_OFFSET 0x0000008c -#define SW_CNTL_SW_SCAPTURE_MSB 2 -#define SW_CNTL_SW_SCAPTURE_LSB 2 -#define SW_CNTL_SW_SCAPTURE_MASK 0x00000004 -#define SW_CNTL_SW_SCAPTURE_GET(x) (((x) & SW_CNTL_SW_SCAPTURE_MASK) >> SW_CNTL_SW_SCAPTURE_LSB) -#define SW_CNTL_SW_SCAPTURE_SET(x) (((x) << SW_CNTL_SW_SCAPTURE_LSB) & SW_CNTL_SW_SCAPTURE_MASK) -#define SW_CNTL_SW_SUPDATE_MSB 1 -#define SW_CNTL_SW_SUPDATE_LSB 1 -#define SW_CNTL_SW_SUPDATE_MASK 0x00000002 -#define SW_CNTL_SW_SUPDATE_GET(x) (((x) & SW_CNTL_SW_SUPDATE_MASK) >> SW_CNTL_SW_SUPDATE_LSB) -#define SW_CNTL_SW_SUPDATE_SET(x) (((x) << SW_CNTL_SW_SUPDATE_LSB) & SW_CNTL_SW_SUPDATE_MASK) -#define SW_CNTL_SW_SOUT_MSB 0 -#define SW_CNTL_SW_SOUT_LSB 0 -#define SW_CNTL_SW_SOUT_MASK 0x00000001 -#define SW_CNTL_SW_SOUT_GET(x) (((x) & SW_CNTL_SW_SOUT_MASK) >> SW_CNTL_SW_SOUT_LSB) -#define SW_CNTL_SW_SOUT_SET(x) (((x) << SW_CNTL_SW_SOUT_LSB) & SW_CNTL_SW_SOUT_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct analog_intf_reg_reg_s { - unsigned char pad0[128]; /* pad to 0x80 */ - volatile unsigned int sw_override; - volatile unsigned int sin_val; - volatile unsigned int sw_sclk; - volatile unsigned int sw_cntl; -} analog_intf_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _ANALOG_INTF_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/analog_intf_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/analog_intf_reg.vrh deleted file mode 100644 index ade586e92eec..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/analog_intf_reg.vrh +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef _ANALOG_INTF_REG_VRH_ -#define _ANALOG_INTF_REG_VRH_ - -#define SW_OVERRIDE_ADDRESS 'h00000080 -#define SW_OVERRIDE_SUPDATE_DELAY_MSB 1 -#define SW_OVERRIDE_SUPDATE_DELAY_LSB 1 -#define SW_OVERRIDE_SUPDATE_DELAY_MASK 'h00000002 -#define SW_OVERRIDE_SUPDATE_DELAY_GET(x) (((x) & SW_OVERRIDE_SUPDATE_DELAY_MASK) >> SW_OVERRIDE_SUPDATE_DELAY_LSB) -#define SW_OVERRIDE_SUPDATE_DELAY_SET(x) (((32'd0 | (x)) << SW_OVERRIDE_SUPDATE_DELAY_LSB) & SW_OVERRIDE_SUPDATE_DELAY_MASK) -#define SW_OVERRIDE_SUPDATE_DELAY_RESET 1'h0 -#define SW_OVERRIDE_ENABLE_MSB 0 -#define SW_OVERRIDE_ENABLE_LSB 0 -#define SW_OVERRIDE_ENABLE_MASK 'h00000001 -#define SW_OVERRIDE_ENABLE_GET(x) (((x) & SW_OVERRIDE_ENABLE_MASK) >> SW_OVERRIDE_ENABLE_LSB) -#define SW_OVERRIDE_ENABLE_SET(x) (((32'd0 | (x)) << SW_OVERRIDE_ENABLE_LSB) & SW_OVERRIDE_ENABLE_MASK) -#define SW_OVERRIDE_ENABLE_RESET 1'h0 -#define SW_OVERRIDE_RESET (32'h0 | \ - SW_OVERRIDE_SUPDATE_DELAY_SET(SW_OVERRIDE_SUPDATE_DELAY_RESET) | \ - SW_OVERRIDE_ENABLE_SET(SW_OVERRIDE_ENABLE_RESET)) -#define SW_OVERRIDE_HW_MASK (32'h0) -#define SW_OVERRIDE_SW_MASK (32'h0 | \ - SW_OVERRIDE_SUPDATE_DELAY_MASK | \ - SW_OVERRIDE_ENABLE_MASK) - -#define SIN_VAL_ADDRESS 'h00000084 -#define SIN_VAL_SIN_MSB 0 -#define SIN_VAL_SIN_LSB 0 -#define SIN_VAL_SIN_MASK 'h00000001 -#define SIN_VAL_SIN_GET(x) (((x) & SIN_VAL_SIN_MASK) >> SIN_VAL_SIN_LSB) -#define SIN_VAL_SIN_SET(x) (((32'd0 | (x)) << SIN_VAL_SIN_LSB) & SIN_VAL_SIN_MASK) -#define SIN_VAL_SIN_RESET 1'h0 -#define SIN_VAL_RESET (32'h0 | \ - SIN_VAL_SIN_SET(SIN_VAL_SIN_RESET)) -#define SIN_VAL_HW_MASK (32'h0 | \ - SIN_VAL_SIN_MASK) -#define SIN_VAL_SW_MASK (32'h0) - -#define SW_SCLK_ADDRESS 'h00000088 -#define SW_SCLK_SW_SCLK_MSB 0 -#define SW_SCLK_SW_SCLK_LSB 0 -#define SW_SCLK_SW_SCLK_MASK 'h00000001 -#define SW_SCLK_SW_SCLK_GET(x) (((x) & SW_SCLK_SW_SCLK_MASK) >> SW_SCLK_SW_SCLK_LSB) -#define SW_SCLK_SW_SCLK_SET(x) (((32'd0 | (x)) << SW_SCLK_SW_SCLK_LSB) & SW_SCLK_SW_SCLK_MASK) -#define SW_SCLK_SW_SCLK_RESET 1'h0 -#define SW_SCLK_RESET (32'h0 | \ - SW_SCLK_SW_SCLK_SET(SW_SCLK_SW_SCLK_RESET)) -#define SW_SCLK_HW_MASK (32'h0) -#define SW_SCLK_SW_MASK (32'h0 | \ - SW_SCLK_SW_SCLK_MASK) - -#define SW_CNTL_ADDRESS 'h0000008c -#define SW_CNTL_SW_SCAPTURE_MSB 2 -#define SW_CNTL_SW_SCAPTURE_LSB 2 -#define SW_CNTL_SW_SCAPTURE_MASK 'h00000004 -#define SW_CNTL_SW_SCAPTURE_GET(x) (((x) & SW_CNTL_SW_SCAPTURE_MASK) >> SW_CNTL_SW_SCAPTURE_LSB) -#define SW_CNTL_SW_SCAPTURE_SET(x) (((32'd0 | (x)) << SW_CNTL_SW_SCAPTURE_LSB) & SW_CNTL_SW_SCAPTURE_MASK) -#define SW_CNTL_SW_SCAPTURE_RESET 1'h0 -#define SW_CNTL_SW_SUPDATE_MSB 1 -#define SW_CNTL_SW_SUPDATE_LSB 1 -#define SW_CNTL_SW_SUPDATE_MASK 'h00000002 -#define SW_CNTL_SW_SUPDATE_GET(x) (((x) & SW_CNTL_SW_SUPDATE_MASK) >> SW_CNTL_SW_SUPDATE_LSB) -#define SW_CNTL_SW_SUPDATE_SET(x) (((32'd0 | (x)) << SW_CNTL_SW_SUPDATE_LSB) & SW_CNTL_SW_SUPDATE_MASK) -#define SW_CNTL_SW_SUPDATE_RESET 1'h0 -#define SW_CNTL_SW_SOUT_MSB 0 -#define SW_CNTL_SW_SOUT_LSB 0 -#define SW_CNTL_SW_SOUT_MASK 'h00000001 -#define SW_CNTL_SW_SOUT_GET(x) (((x) & SW_CNTL_SW_SOUT_MASK) >> SW_CNTL_SW_SOUT_LSB) -#define SW_CNTL_SW_SOUT_SET(x) (((32'd0 | (x)) << SW_CNTL_SW_SOUT_LSB) & SW_CNTL_SW_SOUT_MASK) -#define SW_CNTL_SW_SOUT_RESET 1'h0 -#define SW_CNTL_RESET (32'h0 | \ - SW_CNTL_SW_SCAPTURE_SET(SW_CNTL_SW_SCAPTURE_RESET) | \ - SW_CNTL_SW_SUPDATE_SET(SW_CNTL_SW_SUPDATE_RESET) | \ - SW_CNTL_SW_SOUT_SET(SW_CNTL_SW_SOUT_RESET)) -#define SW_CNTL_HW_MASK (32'h0) -#define SW_CNTL_SW_MASK (32'h0 | \ - SW_CNTL_SW_SCAPTURE_MASK | \ - SW_CNTL_SW_SUPDATE_MASK | \ - SW_CNTL_SW_SOUT_MASK) - -#define ANALOG_INTF_REG_ADDRESS_MSB 7 - -#endif /* _ANALOG_INTF_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/analog_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/analog_reg.h deleted file mode 100644 index cf562b86f655..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/analog_reg.h +++ /dev/null @@ -1,1932 +0,0 @@ -#ifndef _ANALOG_REG_REG_H_ -#define _ANALOG_REG_REG_H_ - -#define SYNTH_SYNTH1_ADDRESS 0x00000000 -#define SYNTH_SYNTH1_OFFSET 0x00000000 -#define SYNTH_SYNTH1_PWD_BIAS_MSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_LSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_MASK 0x80000000 -#define SYNTH_SYNTH1_PWD_BIAS_GET(x) (((x) & SYNTH_SYNTH1_PWD_BIAS_MASK) >> SYNTH_SYNTH1_PWD_BIAS_LSB) -#define SYNTH_SYNTH1_PWD_BIAS_SET(x) (((x) << SYNTH_SYNTH1_PWD_BIAS_LSB) & SYNTH_SYNTH1_PWD_BIAS_MASK) -#define SYNTH_SYNTH1_PWD_CP_MSB 30 -#define SYNTH_SYNTH1_PWD_CP_LSB 30 -#define SYNTH_SYNTH1_PWD_CP_MASK 0x40000000 -#define SYNTH_SYNTH1_PWD_CP_GET(x) (((x) & SYNTH_SYNTH1_PWD_CP_MASK) >> SYNTH_SYNTH1_PWD_CP_LSB) -#define SYNTH_SYNTH1_PWD_CP_SET(x) (((x) << SYNTH_SYNTH1_PWD_CP_LSB) & SYNTH_SYNTH1_PWD_CP_MASK) -#define SYNTH_SYNTH1_PWD_VCMON_MSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_LSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_MASK 0x20000000 -#define SYNTH_SYNTH1_PWD_VCMON_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCMON_MASK) >> SYNTH_SYNTH1_PWD_VCMON_LSB) -#define SYNTH_SYNTH1_PWD_VCMON_SET(x) (((x) << SYNTH_SYNTH1_PWD_VCMON_LSB) & SYNTH_SYNTH1_PWD_VCMON_MASK) -#define SYNTH_SYNTH1_PWD_VCO_MSB 28 -#define SYNTH_SYNTH1_PWD_VCO_LSB 28 -#define SYNTH_SYNTH1_PWD_VCO_MASK 0x10000000 -#define SYNTH_SYNTH1_PWD_VCO_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCO_MASK) >> SYNTH_SYNTH1_PWD_VCO_LSB) -#define SYNTH_SYNTH1_PWD_VCO_SET(x) (((x) << SYNTH_SYNTH1_PWD_VCO_LSB) & SYNTH_SYNTH1_PWD_VCO_MASK) -#define SYNTH_SYNTH1_PWD_PRESC_MSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_LSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_MASK 0x08000000 -#define SYNTH_SYNTH1_PWD_PRESC_GET(x) (((x) & SYNTH_SYNTH1_PWD_PRESC_MASK) >> SYNTH_SYNTH1_PWD_PRESC_LSB) -#define SYNTH_SYNTH1_PWD_PRESC_SET(x) (((x) << SYNTH_SYNTH1_PWD_PRESC_LSB) & SYNTH_SYNTH1_PWD_PRESC_MASK) -#define SYNTH_SYNTH1_PWD_LODIV_MSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_LSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_MASK 0x04000000 -#define SYNTH_SYNTH1_PWD_LODIV_GET(x) (((x) & SYNTH_SYNTH1_PWD_LODIV_MASK) >> SYNTH_SYNTH1_PWD_LODIV_LSB) -#define SYNTH_SYNTH1_PWD_LODIV_SET(x) (((x) << SYNTH_SYNTH1_PWD_LODIV_LSB) & SYNTH_SYNTH1_PWD_LODIV_MASK) -#define SYNTH_SYNTH1_PWD_LOMIX_MSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_LSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_MASK 0x02000000 -#define SYNTH_SYNTH1_PWD_LOMIX_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOMIX_MASK) >> SYNTH_SYNTH1_PWD_LOMIX_LSB) -#define SYNTH_SYNTH1_PWD_LOMIX_SET(x) (((x) << SYNTH_SYNTH1_PWD_LOMIX_LSB) & SYNTH_SYNTH1_PWD_LOMIX_MASK) -#define SYNTH_SYNTH1_FORCE_LO_ON_MSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_LSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_MASK 0x01000000 -#define SYNTH_SYNTH1_FORCE_LO_ON_GET(x) (((x) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) >> SYNTH_SYNTH1_FORCE_LO_ON_LSB) -#define SYNTH_SYNTH1_FORCE_LO_ON_SET(x) (((x) << SYNTH_SYNTH1_FORCE_LO_ON_LSB) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) -#define SYNTH_SYNTH1_PWD_LOBUF5G_MSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_LSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_MASK 0x00800000 -#define SYNTH_SYNTH1_PWD_LOBUF5G_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) >> SYNTH_SYNTH1_PWD_LOBUF5G_LSB) -#define SYNTH_SYNTH1_PWD_LOBUF5G_SET(x) (((x) << SYNTH_SYNTH1_PWD_LOBUF5G_LSB) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) -#define SYNTH_SYNTH1_VCOREGBYPASS_MSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_LSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_MASK 0x00400000 -#define SYNTH_SYNTH1_VCOREGBYPASS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) >> SYNTH_SYNTH1_VCOREGBYPASS_LSB) -#define SYNTH_SYNTH1_VCOREGBYPASS_SET(x) (((x) << SYNTH_SYNTH1_VCOREGBYPASS_LSB) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) -#define SYNTH_SYNTH1_VCOREGLEVEL_MSB 21 -#define SYNTH_SYNTH1_VCOREGLEVEL_LSB 20 -#define SYNTH_SYNTH1_VCOREGLEVEL_MASK 0x00300000 -#define SYNTH_SYNTH1_VCOREGLEVEL_GET(x) (((x) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) >> SYNTH_SYNTH1_VCOREGLEVEL_LSB) -#define SYNTH_SYNTH1_VCOREGLEVEL_SET(x) (((x) << SYNTH_SYNTH1_VCOREGLEVEL_LSB) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) -#define SYNTH_SYNTH1_VCOREGBIAS_MSB 19 -#define SYNTH_SYNTH1_VCOREGBIAS_LSB 18 -#define SYNTH_SYNTH1_VCOREGBIAS_MASK 0x000c0000 -#define SYNTH_SYNTH1_VCOREGBIAS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBIAS_MASK) >> SYNTH_SYNTH1_VCOREGBIAS_LSB) -#define SYNTH_SYNTH1_VCOREGBIAS_SET(x) (((x) << SYNTH_SYNTH1_VCOREGBIAS_LSB) & SYNTH_SYNTH1_VCOREGBIAS_MASK) -#define SYNTH_SYNTH1_SLIDINGIF_MSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_LSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_MASK 0x00020000 -#define SYNTH_SYNTH1_SLIDINGIF_GET(x) (((x) & SYNTH_SYNTH1_SLIDINGIF_MASK) >> SYNTH_SYNTH1_SLIDINGIF_LSB) -#define SYNTH_SYNTH1_SLIDINGIF_SET(x) (((x) << SYNTH_SYNTH1_SLIDINGIF_LSB) & SYNTH_SYNTH1_SLIDINGIF_MASK) -#define SYNTH_SYNTH1_SPARE_PWD_MSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_LSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_MASK 0x00010000 -#define SYNTH_SYNTH1_SPARE_PWD_GET(x) (((x) & SYNTH_SYNTH1_SPARE_PWD_MASK) >> SYNTH_SYNTH1_SPARE_PWD_LSB) -#define SYNTH_SYNTH1_SPARE_PWD_SET(x) (((x) << SYNTH_SYNTH1_SPARE_PWD_LSB) & SYNTH_SYNTH1_SPARE_PWD_MASK) -#define SYNTH_SYNTH1_CON_VDDVCOREG_MSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_LSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_MASK 0x00008000 -#define SYNTH_SYNTH1_CON_VDDVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) >> SYNTH_SYNTH1_CON_VDDVCOREG_LSB) -#define SYNTH_SYNTH1_CON_VDDVCOREG_SET(x) (((x) << SYNTH_SYNTH1_CON_VDDVCOREG_LSB) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) -#define SYNTH_SYNTH1_CON_IVCOREG_MSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_LSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_MASK 0x00004000 -#define SYNTH_SYNTH1_CON_IVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOREG_MASK) >> SYNTH_SYNTH1_CON_IVCOREG_LSB) -#define SYNTH_SYNTH1_CON_IVCOREG_SET(x) (((x) << SYNTH_SYNTH1_CON_IVCOREG_LSB) & SYNTH_SYNTH1_CON_IVCOREG_MASK) -#define SYNTH_SYNTH1_CON_IVCOBUF_MSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_LSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_MASK 0x00002000 -#define SYNTH_SYNTH1_CON_IVCOBUF_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) >> SYNTH_SYNTH1_CON_IVCOBUF_LSB) -#define SYNTH_SYNTH1_CON_IVCOBUF_SET(x) (((x) << SYNTH_SYNTH1_CON_IVCOBUF_LSB) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) -#define SYNTH_SYNTH1_SEL_VCMONABUS_MSB 12 -#define SYNTH_SYNTH1_SEL_VCMONABUS_LSB 10 -#define SYNTH_SYNTH1_SEL_VCMONABUS_MASK 0x00001c00 -#define SYNTH_SYNTH1_SEL_VCMONABUS_GET(x) (((x) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) >> SYNTH_SYNTH1_SEL_VCMONABUS_LSB) -#define SYNTH_SYNTH1_SEL_VCMONABUS_SET(x) (((x) << SYNTH_SYNTH1_SEL_VCMONABUS_LSB) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK 0x00000200 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) >> SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_LSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MASK 0x00000100 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) >> SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK 0x00000080 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK 0x00000040 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_MSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_LSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_MASK 0x00000020 -#define SYNTH_SYNTH1_MONITOR_FB_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_MASK) >> SYNTH_SYNTH1_MONITOR_FB_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_FB_LSB) & SYNTH_SYNTH1_MONITOR_FB_MASK) -#define SYNTH_SYNTH1_MONITOR_REF_MSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_LSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_MASK 0x00000010 -#define SYNTH_SYNTH1_MONITOR_REF_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_REF_MASK) >> SYNTH_SYNTH1_MONITOR_REF_LSB) -#define SYNTH_SYNTH1_MONITOR_REF_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_REF_LSB) & SYNTH_SYNTH1_MONITOR_REF_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK 0x00000008 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) >> SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK 0x00000004 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) >> SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_LSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MASK 0x00000002 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) >> SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK 0x00000001 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) >> SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) - -#define SYNTH_SYNTH2_ADDRESS 0x00000004 -#define SYNTH_SYNTH2_OFFSET 0x00000004 -#define SYNTH_SYNTH2_VC_CAL_REF_MSB 31 -#define SYNTH_SYNTH2_VC_CAL_REF_LSB 29 -#define SYNTH_SYNTH2_VC_CAL_REF_MASK 0xe0000000 -#define SYNTH_SYNTH2_VC_CAL_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_CAL_REF_MASK) >> SYNTH_SYNTH2_VC_CAL_REF_LSB) -#define SYNTH_SYNTH2_VC_CAL_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_CAL_REF_LSB) & SYNTH_SYNTH2_VC_CAL_REF_MASK) -#define SYNTH_SYNTH2_VC_HI_REF_MSB 28 -#define SYNTH_SYNTH2_VC_HI_REF_LSB 26 -#define SYNTH_SYNTH2_VC_HI_REF_MASK 0x1c000000 -#define SYNTH_SYNTH2_VC_HI_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_HI_REF_MASK) >> SYNTH_SYNTH2_VC_HI_REF_LSB) -#define SYNTH_SYNTH2_VC_HI_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_HI_REF_LSB) & SYNTH_SYNTH2_VC_HI_REF_MASK) -#define SYNTH_SYNTH2_VC_MID_REF_MSB 25 -#define SYNTH_SYNTH2_VC_MID_REF_LSB 23 -#define SYNTH_SYNTH2_VC_MID_REF_MASK 0x03800000 -#define SYNTH_SYNTH2_VC_MID_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_MID_REF_MASK) >> SYNTH_SYNTH2_VC_MID_REF_LSB) -#define SYNTH_SYNTH2_VC_MID_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_MID_REF_LSB) & SYNTH_SYNTH2_VC_MID_REF_MASK) -#define SYNTH_SYNTH2_VC_LOW_REF_MSB 22 -#define SYNTH_SYNTH2_VC_LOW_REF_LSB 20 -#define SYNTH_SYNTH2_VC_LOW_REF_MASK 0x00700000 -#define SYNTH_SYNTH2_VC_LOW_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_LOW_REF_MASK) >> SYNTH_SYNTH2_VC_LOW_REF_LSB) -#define SYNTH_SYNTH2_VC_LOW_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_LOW_REF_LSB) & SYNTH_SYNTH2_VC_LOW_REF_MASK) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MSB 19 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB 15 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK 0x000f8000 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_GET(x) (((x) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) >> SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_SET(x) (((x) << SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) -#define SYNTH_SYNTH2_LOOP_CP_MSB 14 -#define SYNTH_SYNTH2_LOOP_CP_LSB 10 -#define SYNTH_SYNTH2_LOOP_CP_MASK 0x00007c00 -#define SYNTH_SYNTH2_LOOP_CP_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CP_MASK) >> SYNTH_SYNTH2_LOOP_CP_LSB) -#define SYNTH_SYNTH2_LOOP_CP_SET(x) (((x) << SYNTH_SYNTH2_LOOP_CP_LSB) & SYNTH_SYNTH2_LOOP_CP_MASK) -#define SYNTH_SYNTH2_LOOP_RS_MSB 9 -#define SYNTH_SYNTH2_LOOP_RS_LSB 5 -#define SYNTH_SYNTH2_LOOP_RS_MASK 0x000003e0 -#define SYNTH_SYNTH2_LOOP_RS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_RS_MASK) >> SYNTH_SYNTH2_LOOP_RS_LSB) -#define SYNTH_SYNTH2_LOOP_RS_SET(x) (((x) << SYNTH_SYNTH2_LOOP_RS_LSB) & SYNTH_SYNTH2_LOOP_RS_MASK) -#define SYNTH_SYNTH2_LOOP_CS_MSB 4 -#define SYNTH_SYNTH2_LOOP_CS_LSB 3 -#define SYNTH_SYNTH2_LOOP_CS_MASK 0x00000018 -#define SYNTH_SYNTH2_LOOP_CS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CS_MASK) >> SYNTH_SYNTH2_LOOP_CS_LSB) -#define SYNTH_SYNTH2_LOOP_CS_SET(x) (((x) << SYNTH_SYNTH2_LOOP_CS_LSB) & SYNTH_SYNTH2_LOOP_CS_MASK) -#define SYNTH_SYNTH2_SPARE_BITS_MSB 2 -#define SYNTH_SYNTH2_SPARE_BITS_LSB 0 -#define SYNTH_SYNTH2_SPARE_BITS_MASK 0x00000007 -#define SYNTH_SYNTH2_SPARE_BITS_GET(x) (((x) & SYNTH_SYNTH2_SPARE_BITS_MASK) >> SYNTH_SYNTH2_SPARE_BITS_LSB) -#define SYNTH_SYNTH2_SPARE_BITS_SET(x) (((x) << SYNTH_SYNTH2_SPARE_BITS_LSB) & SYNTH_SYNTH2_SPARE_BITS_MASK) - -#define SYNTH_SYNTH3_ADDRESS 0x00000008 -#define SYNTH_SYNTH3_OFFSET 0x00000008 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_LSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MASK 0x80000000 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_GET(x) (((x) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) >> SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) -#define SYNTH_SYNTH3_DIS_CLK_XTAL_SET(x) (((x) << SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_LSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MASK 0x40000000 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_GET(x) (((x) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) >> SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_SET(x) (((x) << SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MSB 29 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB 24 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK 0x3f000000 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_SET(x) (((x) << SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_PWRUP_MSB 23 -#define SYNTH_SYNTH3_WAIT_PWRUP_LSB 18 -#define SYNTH_SYNTH3_WAIT_PWRUP_MASK 0x00fc0000 -#define SYNTH_SYNTH3_WAIT_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_PWRUP_SET(x) (((x) << SYNTH_SYNTH3_WAIT_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MSB 17 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_LSB 12 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MASK 0x0003f000 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_SET(x) (((x) << SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MSB 11 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_LSB 6 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MASK 0x00000fc0 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_SET(x) (((x) << SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MSB 5 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_LSB 0 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MASK 0x0000003f -#define SYNTH_SYNTH3_WAIT_VC_CHECK_GET(x) (((x) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) >> SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_SET(x) (((x) << SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) - -#define SYNTH_SYNTH4_ADDRESS 0x0000000c -#define SYNTH_SYNTH4_OFFSET 0x0000000c -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK 0x80000000 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_GET(x) (((x) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) >> SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_SET(x) (((x) << SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) -#define SYNTH_SYNTH4_DIS_LOSTVC_MSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_LSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_MASK 0x40000000 -#define SYNTH_SYNTH4_DIS_LOSTVC_GET(x) (((x) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) >> SYNTH_SYNTH4_DIS_LOSTVC_LSB) -#define SYNTH_SYNTH4_DIS_LOSTVC_SET(x) (((x) << SYNTH_SYNTH4_DIS_LOSTVC_LSB) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_LSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MASK 0x20000000 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_GET(x) (((x) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) >> SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_SET(x) (((x) << SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK 0x10000000 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_GET(x) (((x) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) >> SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_SET(x) (((x) << SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) -#define SYNTH_SYNTH4_FORCE_PINVC_MSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_LSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_MASK 0x08000000 -#define SYNTH_SYNTH4_FORCE_PINVC_GET(x) (((x) & SYNTH_SYNTH4_FORCE_PINVC_MASK) >> SYNTH_SYNTH4_FORCE_PINVC_LSB) -#define SYNTH_SYNTH4_FORCE_PINVC_SET(x) (((x) << SYNTH_SYNTH4_FORCE_PINVC_LSB) & SYNTH_SYNTH4_FORCE_PINVC_MASK) -#define SYNTH_SYNTH4_FORCE_VCOCAP_MSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_LSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_MASK 0x04000000 -#define SYNTH_SYNTH4_FORCE_VCOCAP_GET(x) (((x) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) >> SYNTH_SYNTH4_FORCE_VCOCAP_LSB) -#define SYNTH_SYNTH4_FORCE_VCOCAP_SET(x) (((x) << SYNTH_SYNTH4_FORCE_VCOCAP_LSB) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) -#define SYNTH_SYNTH4_VCOCAP_OVR_MSB 25 -#define SYNTH_SYNTH4_VCOCAP_OVR_LSB 18 -#define SYNTH_SYNTH4_VCOCAP_OVR_MASK 0x03fc0000 -#define SYNTH_SYNTH4_VCOCAP_OVR_GET(x) (((x) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) >> SYNTH_SYNTH4_VCOCAP_OVR_LSB) -#define SYNTH_SYNTH4_VCOCAP_OVR_SET(x) (((x) << SYNTH_SYNTH4_VCOCAP_OVR_LSB) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) -#define SYNTH_SYNTH4_VCOCAPPULLUP_MSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_LSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_MASK 0x00020000 -#define SYNTH_SYNTH4_VCOCAPPULLUP_GET(x) (((x) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) >> SYNTH_SYNTH4_VCOCAPPULLUP_LSB) -#define SYNTH_SYNTH4_VCOCAPPULLUP_SET(x) (((x) << SYNTH_SYNTH4_VCOCAPPULLUP_LSB) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) -#define SYNTH_SYNTH4_REFDIVSEL_MSB 16 -#define SYNTH_SYNTH4_REFDIVSEL_LSB 15 -#define SYNTH_SYNTH4_REFDIVSEL_MASK 0x00018000 -#define SYNTH_SYNTH4_REFDIVSEL_GET(x) (((x) & SYNTH_SYNTH4_REFDIVSEL_MASK) >> SYNTH_SYNTH4_REFDIVSEL_LSB) -#define SYNTH_SYNTH4_REFDIVSEL_SET(x) (((x) << SYNTH_SYNTH4_REFDIVSEL_LSB) & SYNTH_SYNTH4_REFDIVSEL_MASK) -#define SYNTH_SYNTH4_PFDDELAY_MSB 14 -#define SYNTH_SYNTH4_PFDDELAY_LSB 14 -#define SYNTH_SYNTH4_PFDDELAY_MASK 0x00004000 -#define SYNTH_SYNTH4_PFDDELAY_GET(x) (((x) & SYNTH_SYNTH4_PFDDELAY_MASK) >> SYNTH_SYNTH4_PFDDELAY_LSB) -#define SYNTH_SYNTH4_PFDDELAY_SET(x) (((x) << SYNTH_SYNTH4_PFDDELAY_LSB) & SYNTH_SYNTH4_PFDDELAY_MASK) -#define SYNTH_SYNTH4_PFD_DISABLE_MSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_LSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_MASK 0x00002000 -#define SYNTH_SYNTH4_PFD_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_PFD_DISABLE_MASK) >> SYNTH_SYNTH4_PFD_DISABLE_LSB) -#define SYNTH_SYNTH4_PFD_DISABLE_SET(x) (((x) << SYNTH_SYNTH4_PFD_DISABLE_LSB) & SYNTH_SYNTH4_PFD_DISABLE_MASK) -#define SYNTH_SYNTH4_PRESCSEL_MSB 12 -#define SYNTH_SYNTH4_PRESCSEL_LSB 11 -#define SYNTH_SYNTH4_PRESCSEL_MASK 0x00001800 -#define SYNTH_SYNTH4_PRESCSEL_GET(x) (((x) & SYNTH_SYNTH4_PRESCSEL_MASK) >> SYNTH_SYNTH4_PRESCSEL_LSB) -#define SYNTH_SYNTH4_PRESCSEL_SET(x) (((x) << SYNTH_SYNTH4_PRESCSEL_LSB) & SYNTH_SYNTH4_PRESCSEL_MASK) -#define SYNTH_SYNTH4_RESET_PRESC_MSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_LSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_MASK 0x00000400 -#define SYNTH_SYNTH4_RESET_PRESC_GET(x) (((x) & SYNTH_SYNTH4_RESET_PRESC_MASK) >> SYNTH_SYNTH4_RESET_PRESC_LSB) -#define SYNTH_SYNTH4_RESET_PRESC_SET(x) (((x) << SYNTH_SYNTH4_RESET_PRESC_LSB) & SYNTH_SYNTH4_RESET_PRESC_MASK) -#define SYNTH_SYNTH4_SDM_DISABLE_MSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_LSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_MASK 0x00000200 -#define SYNTH_SYNTH4_SDM_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_SDM_DISABLE_MASK) >> SYNTH_SYNTH4_SDM_DISABLE_LSB) -#define SYNTH_SYNTH4_SDM_DISABLE_SET(x) (((x) << SYNTH_SYNTH4_SDM_DISABLE_LSB) & SYNTH_SYNTH4_SDM_DISABLE_MASK) -#define SYNTH_SYNTH4_SDM_MODE_MSB 8 -#define SYNTH_SYNTH4_SDM_MODE_LSB 8 -#define SYNTH_SYNTH4_SDM_MODE_MASK 0x00000100 -#define SYNTH_SYNTH4_SDM_MODE_GET(x) (((x) & SYNTH_SYNTH4_SDM_MODE_MASK) >> SYNTH_SYNTH4_SDM_MODE_LSB) -#define SYNTH_SYNTH4_SDM_MODE_SET(x) (((x) << SYNTH_SYNTH4_SDM_MODE_LSB) & SYNTH_SYNTH4_SDM_MODE_MASK) -#define SYNTH_SYNTH4_SDM_DITHER_MSB 7 -#define SYNTH_SYNTH4_SDM_DITHER_LSB 6 -#define SYNTH_SYNTH4_SDM_DITHER_MASK 0x000000c0 -#define SYNTH_SYNTH4_SDM_DITHER_GET(x) (((x) & SYNTH_SYNTH4_SDM_DITHER_MASK) >> SYNTH_SYNTH4_SDM_DITHER_LSB) -#define SYNTH_SYNTH4_SDM_DITHER_SET(x) (((x) << SYNTH_SYNTH4_SDM_DITHER_LSB) & SYNTH_SYNTH4_SDM_DITHER_MASK) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK 0x00000020 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_GET(x) (((x) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) >> SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_SET(x) (((x) << SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK 0x00000010 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_GET(x) (((x) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) >> SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_SET(x) (((x) << SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) -#define SYNTH_SYNTH4_SPARE_MISC_MSB 3 -#define SYNTH_SYNTH4_SPARE_MISC_LSB 2 -#define SYNTH_SYNTH4_SPARE_MISC_MASK 0x0000000c -#define SYNTH_SYNTH4_SPARE_MISC_GET(x) (((x) & SYNTH_SYNTH4_SPARE_MISC_MASK) >> SYNTH_SYNTH4_SPARE_MISC_LSB) -#define SYNTH_SYNTH4_SPARE_MISC_SET(x) (((x) << SYNTH_SYNTH4_SPARE_MISC_LSB) & SYNTH_SYNTH4_SPARE_MISC_MASK) -#define SYNTH_SYNTH4_LONGSHIFTSEL_MSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_LSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_MASK 0x00000002 -#define SYNTH_SYNTH4_LONGSHIFTSEL_GET(x) (((x) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) >> SYNTH_SYNTH4_LONGSHIFTSEL_LSB) -#define SYNTH_SYNTH4_LONGSHIFTSEL_SET(x) (((x) << SYNTH_SYNTH4_LONGSHIFTSEL_LSB) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_LSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MASK 0x00000001 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_GET(x) (((x) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) >> SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_SET(x) (((x) << SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) - -#define SYNTH_SYNTH5_ADDRESS 0x00000010 -#define SYNTH_SYNTH5_OFFSET 0x00000010 -#define SYNTH_SYNTH5_LOOP_IP0_MSB 31 -#define SYNTH_SYNTH5_LOOP_IP0_LSB 28 -#define SYNTH_SYNTH5_LOOP_IP0_MASK 0xf0000000 -#define SYNTH_SYNTH5_LOOP_IP0_GET(x) (((x) & SYNTH_SYNTH5_LOOP_IP0_MASK) >> SYNTH_SYNTH5_LOOP_IP0_LSB) -#define SYNTH_SYNTH5_LOOP_IP0_SET(x) (((x) << SYNTH_SYNTH5_LOOP_IP0_LSB) & SYNTH_SYNTH5_LOOP_IP0_MASK) -#define SYNTH_SYNTH5_SLOPE_IP_MSB 27 -#define SYNTH_SYNTH5_SLOPE_IP_LSB 25 -#define SYNTH_SYNTH5_SLOPE_IP_MASK 0x0e000000 -#define SYNTH_SYNTH5_SLOPE_IP_GET(x) (((x) & SYNTH_SYNTH5_SLOPE_IP_MASK) >> SYNTH_SYNTH5_SLOPE_IP_LSB) -#define SYNTH_SYNTH5_SLOPE_IP_SET(x) (((x) << SYNTH_SYNTH5_SLOPE_IP_LSB) & SYNTH_SYNTH5_SLOPE_IP_MASK) -#define SYNTH_SYNTH5_CPBIAS_MSB 24 -#define SYNTH_SYNTH5_CPBIAS_LSB 23 -#define SYNTH_SYNTH5_CPBIAS_MASK 0x01800000 -#define SYNTH_SYNTH5_CPBIAS_GET(x) (((x) & SYNTH_SYNTH5_CPBIAS_MASK) >> SYNTH_SYNTH5_CPBIAS_LSB) -#define SYNTH_SYNTH5_CPBIAS_SET(x) (((x) << SYNTH_SYNTH5_CPBIAS_LSB) & SYNTH_SYNTH5_CPBIAS_MASK) -#define SYNTH_SYNTH5_CPSTEERING_EN_MSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_LSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_MASK 0x00400000 -#define SYNTH_SYNTH5_CPSTEERING_EN_GET(x) (((x) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) >> SYNTH_SYNTH5_CPSTEERING_EN_LSB) -#define SYNTH_SYNTH5_CPSTEERING_EN_SET(x) (((x) << SYNTH_SYNTH5_CPSTEERING_EN_LSB) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) -#define SYNTH_SYNTH5_CPLOWLK_MSB 21 -#define SYNTH_SYNTH5_CPLOWLK_LSB 21 -#define SYNTH_SYNTH5_CPLOWLK_MASK 0x00200000 -#define SYNTH_SYNTH5_CPLOWLK_GET(x) (((x) & SYNTH_SYNTH5_CPLOWLK_MASK) >> SYNTH_SYNTH5_CPLOWLK_LSB) -#define SYNTH_SYNTH5_CPLOWLK_SET(x) (((x) << SYNTH_SYNTH5_CPLOWLK_LSB) & SYNTH_SYNTH5_CPLOWLK_MASK) -#define SYNTH_SYNTH5_LOOPLEAKCUR_MSB 20 -#define SYNTH_SYNTH5_LOOPLEAKCUR_LSB 17 -#define SYNTH_SYNTH5_LOOPLEAKCUR_MASK 0x001e0000 -#define SYNTH_SYNTH5_LOOPLEAKCUR_GET(x) (((x) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) >> SYNTH_SYNTH5_LOOPLEAKCUR_LSB) -#define SYNTH_SYNTH5_LOOPLEAKCUR_SET(x) (((x) << SYNTH_SYNTH5_LOOPLEAKCUR_LSB) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) -#define SYNTH_SYNTH5_CAPRANGE1_MSB 16 -#define SYNTH_SYNTH5_CAPRANGE1_LSB 13 -#define SYNTH_SYNTH5_CAPRANGE1_MASK 0x0001e000 -#define SYNTH_SYNTH5_CAPRANGE1_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE1_MASK) >> SYNTH_SYNTH5_CAPRANGE1_LSB) -#define SYNTH_SYNTH5_CAPRANGE1_SET(x) (((x) << SYNTH_SYNTH5_CAPRANGE1_LSB) & SYNTH_SYNTH5_CAPRANGE1_MASK) -#define SYNTH_SYNTH5_CAPRANGE2_MSB 12 -#define SYNTH_SYNTH5_CAPRANGE2_LSB 9 -#define SYNTH_SYNTH5_CAPRANGE2_MASK 0x00001e00 -#define SYNTH_SYNTH5_CAPRANGE2_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE2_MASK) >> SYNTH_SYNTH5_CAPRANGE2_LSB) -#define SYNTH_SYNTH5_CAPRANGE2_SET(x) (((x) << SYNTH_SYNTH5_CAPRANGE2_LSB) & SYNTH_SYNTH5_CAPRANGE2_MASK) -#define SYNTH_SYNTH5_CAPRANGE3_MSB 8 -#define SYNTH_SYNTH5_CAPRANGE3_LSB 5 -#define SYNTH_SYNTH5_CAPRANGE3_MASK 0x000001e0 -#define SYNTH_SYNTH5_CAPRANGE3_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE3_MASK) >> SYNTH_SYNTH5_CAPRANGE3_LSB) -#define SYNTH_SYNTH5_CAPRANGE3_SET(x) (((x) << SYNTH_SYNTH5_CAPRANGE3_LSB) & SYNTH_SYNTH5_CAPRANGE3_MASK) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK 0x00000010 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_SET(x) (((x) << SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MSB 3 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB 2 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK 0x0000000c -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_GET(x) (((x) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) >> SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_SET(x) (((x) << SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) -#define SYNTH_SYNTH5_SPARE_MSB 1 -#define SYNTH_SYNTH5_SPARE_LSB 0 -#define SYNTH_SYNTH5_SPARE_MASK 0x00000003 -#define SYNTH_SYNTH5_SPARE_GET(x) (((x) & SYNTH_SYNTH5_SPARE_MASK) >> SYNTH_SYNTH5_SPARE_LSB) -#define SYNTH_SYNTH5_SPARE_SET(x) (((x) << SYNTH_SYNTH5_SPARE_LSB) & SYNTH_SYNTH5_SPARE_MASK) - -#define SYNTH_SYNTH6_ADDRESS 0x00000014 -#define SYNTH_SYNTH6_OFFSET 0x00000014 -#define SYNTH_SYNTH6_IRCP_MSB 31 -#define SYNTH_SYNTH6_IRCP_LSB 29 -#define SYNTH_SYNTH6_IRCP_MASK 0xe0000000 -#define SYNTH_SYNTH6_IRCP_GET(x) (((x) & SYNTH_SYNTH6_IRCP_MASK) >> SYNTH_SYNTH6_IRCP_LSB) -#define SYNTH_SYNTH6_IRCP_SET(x) (((x) << SYNTH_SYNTH6_IRCP_LSB) & SYNTH_SYNTH6_IRCP_MASK) -#define SYNTH_SYNTH6_IRVCMON_MSB 28 -#define SYNTH_SYNTH6_IRVCMON_LSB 26 -#define SYNTH_SYNTH6_IRVCMON_MASK 0x1c000000 -#define SYNTH_SYNTH6_IRVCMON_GET(x) (((x) & SYNTH_SYNTH6_IRVCMON_MASK) >> SYNTH_SYNTH6_IRVCMON_LSB) -#define SYNTH_SYNTH6_IRVCMON_SET(x) (((x) << SYNTH_SYNTH6_IRVCMON_LSB) & SYNTH_SYNTH6_IRVCMON_MASK) -#define SYNTH_SYNTH6_IRSPARE_MSB 25 -#define SYNTH_SYNTH6_IRSPARE_LSB 23 -#define SYNTH_SYNTH6_IRSPARE_MASK 0x03800000 -#define SYNTH_SYNTH6_IRSPARE_GET(x) (((x) & SYNTH_SYNTH6_IRSPARE_MASK) >> SYNTH_SYNTH6_IRSPARE_LSB) -#define SYNTH_SYNTH6_IRSPARE_SET(x) (((x) << SYNTH_SYNTH6_IRSPARE_LSB) & SYNTH_SYNTH6_IRSPARE_MASK) -#define SYNTH_SYNTH6_ICPRESC_MSB 22 -#define SYNTH_SYNTH6_ICPRESC_LSB 20 -#define SYNTH_SYNTH6_ICPRESC_MASK 0x00700000 -#define SYNTH_SYNTH6_ICPRESC_GET(x) (((x) & SYNTH_SYNTH6_ICPRESC_MASK) >> SYNTH_SYNTH6_ICPRESC_LSB) -#define SYNTH_SYNTH6_ICPRESC_SET(x) (((x) << SYNTH_SYNTH6_ICPRESC_LSB) & SYNTH_SYNTH6_ICPRESC_MASK) -#define SYNTH_SYNTH6_ICLODIV_MSB 19 -#define SYNTH_SYNTH6_ICLODIV_LSB 17 -#define SYNTH_SYNTH6_ICLODIV_MASK 0x000e0000 -#define SYNTH_SYNTH6_ICLODIV_GET(x) (((x) & SYNTH_SYNTH6_ICLODIV_MASK) >> SYNTH_SYNTH6_ICLODIV_LSB) -#define SYNTH_SYNTH6_ICLODIV_SET(x) (((x) << SYNTH_SYNTH6_ICLODIV_LSB) & SYNTH_SYNTH6_ICLODIV_MASK) -#define SYNTH_SYNTH6_ICLOMIX_MSB 16 -#define SYNTH_SYNTH6_ICLOMIX_LSB 14 -#define SYNTH_SYNTH6_ICLOMIX_MASK 0x0001c000 -#define SYNTH_SYNTH6_ICLOMIX_GET(x) (((x) & SYNTH_SYNTH6_ICLOMIX_MASK) >> SYNTH_SYNTH6_ICLOMIX_LSB) -#define SYNTH_SYNTH6_ICLOMIX_SET(x) (((x) << SYNTH_SYNTH6_ICLOMIX_LSB) & SYNTH_SYNTH6_ICLOMIX_MASK) -#define SYNTH_SYNTH6_ICSPAREA_MSB 13 -#define SYNTH_SYNTH6_ICSPAREA_LSB 11 -#define SYNTH_SYNTH6_ICSPAREA_MASK 0x00003800 -#define SYNTH_SYNTH6_ICSPAREA_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREA_MASK) >> SYNTH_SYNTH6_ICSPAREA_LSB) -#define SYNTH_SYNTH6_ICSPAREA_SET(x) (((x) << SYNTH_SYNTH6_ICSPAREA_LSB) & SYNTH_SYNTH6_ICSPAREA_MASK) -#define SYNTH_SYNTH6_ICSPAREB_MSB 10 -#define SYNTH_SYNTH6_ICSPAREB_LSB 8 -#define SYNTH_SYNTH6_ICSPAREB_MASK 0x00000700 -#define SYNTH_SYNTH6_ICSPAREB_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREB_MASK) >> SYNTH_SYNTH6_ICSPAREB_LSB) -#define SYNTH_SYNTH6_ICSPAREB_SET(x) (((x) << SYNTH_SYNTH6_ICSPAREB_LSB) & SYNTH_SYNTH6_ICSPAREB_MASK) -#define SYNTH_SYNTH6_ICVCO_MSB 7 -#define SYNTH_SYNTH6_ICVCO_LSB 5 -#define SYNTH_SYNTH6_ICVCO_MASK 0x000000e0 -#define SYNTH_SYNTH6_ICVCO_GET(x) (((x) & SYNTH_SYNTH6_ICVCO_MASK) >> SYNTH_SYNTH6_ICVCO_LSB) -#define SYNTH_SYNTH6_ICVCO_SET(x) (((x) << SYNTH_SYNTH6_ICVCO_LSB) & SYNTH_SYNTH6_ICVCO_MASK) -#define SYNTH_SYNTH6_VCOBUFBIAS_MSB 4 -#define SYNTH_SYNTH6_VCOBUFBIAS_LSB 3 -#define SYNTH_SYNTH6_VCOBUFBIAS_MASK 0x00000018 -#define SYNTH_SYNTH6_VCOBUFBIAS_GET(x) (((x) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) >> SYNTH_SYNTH6_VCOBUFBIAS_LSB) -#define SYNTH_SYNTH6_VCOBUFBIAS_SET(x) (((x) << SYNTH_SYNTH6_VCOBUFBIAS_LSB) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) -#define SYNTH_SYNTH6_SPARE_BIAS_MSB 2 -#define SYNTH_SYNTH6_SPARE_BIAS_LSB 0 -#define SYNTH_SYNTH6_SPARE_BIAS_MASK 0x00000007 -#define SYNTH_SYNTH6_SPARE_BIAS_GET(x) (((x) & SYNTH_SYNTH6_SPARE_BIAS_MASK) >> SYNTH_SYNTH6_SPARE_BIAS_LSB) -#define SYNTH_SYNTH6_SPARE_BIAS_SET(x) (((x) << SYNTH_SYNTH6_SPARE_BIAS_LSB) & SYNTH_SYNTH6_SPARE_BIAS_MASK) - -#define SYNTH_SYNTH7_ADDRESS 0x00000018 -#define SYNTH_SYNTH7_OFFSET 0x00000018 -#define SYNTH_SYNTH7_SYNTH_ON_MSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_LSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_MASK 0x80000000 -#define SYNTH_SYNTH7_SYNTH_ON_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_ON_MASK) >> SYNTH_SYNTH7_SYNTH_ON_LSB) -#define SYNTH_SYNTH7_SYNTH_ON_SET(x) (((x) << SYNTH_SYNTH7_SYNTH_ON_LSB) & SYNTH_SYNTH7_SYNTH_ON_MASK) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MSB 30 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_LSB 27 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MASK 0x78000000 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) >> SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_SET(x) (((x) << SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) -#define SYNTH_SYNTH7_CAP_SEARCH_MSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_LSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_MASK 0x04000000 -#define SYNTH_SYNTH7_CAP_SEARCH_GET(x) (((x) & SYNTH_SYNTH7_CAP_SEARCH_MASK) >> SYNTH_SYNTH7_CAP_SEARCH_LSB) -#define SYNTH_SYNTH7_CAP_SEARCH_SET(x) (((x) << SYNTH_SYNTH7_CAP_SEARCH_LSB) & SYNTH_SYNTH7_CAP_SEARCH_MASK) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK 0x02000000 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) >> SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_SET(x) (((x) << SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) -#define SYNTH_SYNTH7_PIN_VC_MSB 24 -#define SYNTH_SYNTH7_PIN_VC_LSB 24 -#define SYNTH_SYNTH7_PIN_VC_MASK 0x01000000 -#define SYNTH_SYNTH7_PIN_VC_GET(x) (((x) & SYNTH_SYNTH7_PIN_VC_MASK) >> SYNTH_SYNTH7_PIN_VC_LSB) -#define SYNTH_SYNTH7_PIN_VC_SET(x) (((x) << SYNTH_SYNTH7_PIN_VC_LSB) & SYNTH_SYNTH7_PIN_VC_MASK) -#define SYNTH_SYNTH7_VCO_CAP_ST_MSB 23 -#define SYNTH_SYNTH7_VCO_CAP_ST_LSB 16 -#define SYNTH_SYNTH7_VCO_CAP_ST_MASK 0x00ff0000 -#define SYNTH_SYNTH7_VCO_CAP_ST_GET(x) (((x) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) >> SYNTH_SYNTH7_VCO_CAP_ST_LSB) -#define SYNTH_SYNTH7_VCO_CAP_ST_SET(x) (((x) << SYNTH_SYNTH7_VCO_CAP_ST_LSB) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) -#define SYNTH_SYNTH7_SHORT_R_MSB 15 -#define SYNTH_SYNTH7_SHORT_R_LSB 15 -#define SYNTH_SYNTH7_SHORT_R_MASK 0x00008000 -#define SYNTH_SYNTH7_SHORT_R_GET(x) (((x) & SYNTH_SYNTH7_SHORT_R_MASK) >> SYNTH_SYNTH7_SHORT_R_LSB) -#define SYNTH_SYNTH7_SHORT_R_SET(x) (((x) << SYNTH_SYNTH7_SHORT_R_LSB) & SYNTH_SYNTH7_SHORT_R_MASK) -#define SYNTH_SYNTH7_RESET_RFD_MSB 14 -#define SYNTH_SYNTH7_RESET_RFD_LSB 14 -#define SYNTH_SYNTH7_RESET_RFD_MASK 0x00004000 -#define SYNTH_SYNTH7_RESET_RFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_RFD_MASK) >> SYNTH_SYNTH7_RESET_RFD_LSB) -#define SYNTH_SYNTH7_RESET_RFD_SET(x) (((x) << SYNTH_SYNTH7_RESET_RFD_LSB) & SYNTH_SYNTH7_RESET_RFD_MASK) -#define SYNTH_SYNTH7_RESET_PFD_MSB 13 -#define SYNTH_SYNTH7_RESET_PFD_LSB 13 -#define SYNTH_SYNTH7_RESET_PFD_MASK 0x00002000 -#define SYNTH_SYNTH7_RESET_PFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_PFD_MASK) >> SYNTH_SYNTH7_RESET_PFD_LSB) -#define SYNTH_SYNTH7_RESET_PFD_SET(x) (((x) << SYNTH_SYNTH7_RESET_PFD_LSB) & SYNTH_SYNTH7_RESET_PFD_MASK) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK 0x00001000 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_GET(x) (((x) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) >> SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_SET(x) (((x) << SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) -#define SYNTH_SYNTH7_RESET_SDM_B_MSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_LSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_MASK 0x00000800 -#define SYNTH_SYNTH7_RESET_SDM_B_GET(x) (((x) & SYNTH_SYNTH7_RESET_SDM_B_MASK) >> SYNTH_SYNTH7_RESET_SDM_B_LSB) -#define SYNTH_SYNTH7_RESET_SDM_B_SET(x) (((x) << SYNTH_SYNTH7_RESET_SDM_B_LSB) & SYNTH_SYNTH7_RESET_SDM_B_MASK) -#define SYNTH_SYNTH7_VC2HIGH_MSB 10 -#define SYNTH_SYNTH7_VC2HIGH_LSB 10 -#define SYNTH_SYNTH7_VC2HIGH_MASK 0x00000400 -#define SYNTH_SYNTH7_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH7_VC2HIGH_MASK) >> SYNTH_SYNTH7_VC2HIGH_LSB) -#define SYNTH_SYNTH7_VC2HIGH_SET(x) (((x) << SYNTH_SYNTH7_VC2HIGH_LSB) & SYNTH_SYNTH7_VC2HIGH_MASK) -#define SYNTH_SYNTH7_VC2LOW_MSB 9 -#define SYNTH_SYNTH7_VC2LOW_LSB 9 -#define SYNTH_SYNTH7_VC2LOW_MASK 0x00000200 -#define SYNTH_SYNTH7_VC2LOW_GET(x) (((x) & SYNTH_SYNTH7_VC2LOW_MASK) >> SYNTH_SYNTH7_VC2LOW_LSB) -#define SYNTH_SYNTH7_VC2LOW_SET(x) (((x) << SYNTH_SYNTH7_VC2LOW_LSB) & SYNTH_SYNTH7_VC2LOW_MASK) -#define SYNTH_SYNTH7_LOOP_IP_MSB 8 -#define SYNTH_SYNTH7_LOOP_IP_LSB 5 -#define SYNTH_SYNTH7_LOOP_IP_MASK 0x000001e0 -#define SYNTH_SYNTH7_LOOP_IP_GET(x) (((x) & SYNTH_SYNTH7_LOOP_IP_MASK) >> SYNTH_SYNTH7_LOOP_IP_LSB) -#define SYNTH_SYNTH7_LOOP_IP_SET(x) (((x) << SYNTH_SYNTH7_LOOP_IP_LSB) & SYNTH_SYNTH7_LOOP_IP_MASK) -#define SYNTH_SYNTH7_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH7_LOBUF5GTUNE_LSB 3 -#define SYNTH_SYNTH7_LOBUF5GTUNE_MASK 0x00000018 -#define SYNTH_SYNTH7_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH7_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH7_LOBUF5GTUNE_SET(x) (((x) << SYNTH_SYNTH7_LOBUF5GTUNE_LSB) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH7_SPARE_READ_MSB 2 -#define SYNTH_SYNTH7_SPARE_READ_LSB 0 -#define SYNTH_SYNTH7_SPARE_READ_MASK 0x00000007 -#define SYNTH_SYNTH7_SPARE_READ_GET(x) (((x) & SYNTH_SYNTH7_SPARE_READ_MASK) >> SYNTH_SYNTH7_SPARE_READ_LSB) -#define SYNTH_SYNTH7_SPARE_READ_SET(x) (((x) << SYNTH_SYNTH7_SPARE_READ_LSB) & SYNTH_SYNTH7_SPARE_READ_MASK) - -#define SYNTH_SYNTH8_ADDRESS 0x0000001c -#define SYNTH_SYNTH8_OFFSET 0x0000001c -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK 0x80000000 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_GET(x) (((x) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) >> SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_SET(x) (((x) << SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) -#define SYNTH_SYNTH8_FRACMODE_MSB 30 -#define SYNTH_SYNTH8_FRACMODE_LSB 30 -#define SYNTH_SYNTH8_FRACMODE_MASK 0x40000000 -#define SYNTH_SYNTH8_FRACMODE_GET(x) (((x) & SYNTH_SYNTH8_FRACMODE_MASK) >> SYNTH_SYNTH8_FRACMODE_LSB) -#define SYNTH_SYNTH8_FRACMODE_SET(x) (((x) << SYNTH_SYNTH8_FRACMODE_LSB) & SYNTH_SYNTH8_FRACMODE_MASK) -#define SYNTH_SYNTH8_AMODEREFSEL_MSB 29 -#define SYNTH_SYNTH8_AMODEREFSEL_LSB 28 -#define SYNTH_SYNTH8_AMODEREFSEL_MASK 0x30000000 -#define SYNTH_SYNTH8_AMODEREFSEL_GET(x) (((x) & SYNTH_SYNTH8_AMODEREFSEL_MASK) >> SYNTH_SYNTH8_AMODEREFSEL_LSB) -#define SYNTH_SYNTH8_AMODEREFSEL_SET(x) (((x) << SYNTH_SYNTH8_AMODEREFSEL_LSB) & SYNTH_SYNTH8_AMODEREFSEL_MASK) -#define SYNTH_SYNTH8_SPARE_MSB 27 -#define SYNTH_SYNTH8_SPARE_LSB 27 -#define SYNTH_SYNTH8_SPARE_MASK 0x08000000 -#define SYNTH_SYNTH8_SPARE_GET(x) (((x) & SYNTH_SYNTH8_SPARE_MASK) >> SYNTH_SYNTH8_SPARE_LSB) -#define SYNTH_SYNTH8_SPARE_SET(x) (((x) << SYNTH_SYNTH8_SPARE_LSB) & SYNTH_SYNTH8_SPARE_MASK) -#define SYNTH_SYNTH8_CHANSEL_MSB 26 -#define SYNTH_SYNTH8_CHANSEL_LSB 18 -#define SYNTH_SYNTH8_CHANSEL_MASK 0x07fc0000 -#define SYNTH_SYNTH8_CHANSEL_GET(x) (((x) & SYNTH_SYNTH8_CHANSEL_MASK) >> SYNTH_SYNTH8_CHANSEL_LSB) -#define SYNTH_SYNTH8_CHANSEL_SET(x) (((x) << SYNTH_SYNTH8_CHANSEL_LSB) & SYNTH_SYNTH8_CHANSEL_MASK) -#define SYNTH_SYNTH8_CHANFRAC_MSB 17 -#define SYNTH_SYNTH8_CHANFRAC_LSB 1 -#define SYNTH_SYNTH8_CHANFRAC_MASK 0x0003fffe -#define SYNTH_SYNTH8_CHANFRAC_GET(x) (((x) & SYNTH_SYNTH8_CHANFRAC_MASK) >> SYNTH_SYNTH8_CHANFRAC_LSB) -#define SYNTH_SYNTH8_CHANFRAC_SET(x) (((x) << SYNTH_SYNTH8_CHANFRAC_LSB) & SYNTH_SYNTH8_CHANFRAC_MASK) -#define SYNTH_SYNTH8_FORCE_FRACLSB_MSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_LSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_MASK 0x00000001 -#define SYNTH_SYNTH8_FORCE_FRACLSB_GET(x) (((x) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) >> SYNTH_SYNTH8_FORCE_FRACLSB_LSB) -#define SYNTH_SYNTH8_FORCE_FRACLSB_SET(x) (((x) << SYNTH_SYNTH8_FORCE_FRACLSB_LSB) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) - -#define RF5G_RF5G1_ADDRESS 0x00000020 -#define RF5G_RF5G1_OFFSET 0x00000020 -#define RF5G_RF5G1_PDTXLO5_MSB 31 -#define RF5G_RF5G1_PDTXLO5_LSB 31 -#define RF5G_RF5G1_PDTXLO5_MASK 0x80000000 -#define RF5G_RF5G1_PDTXLO5_GET(x) (((x) & RF5G_RF5G1_PDTXLO5_MASK) >> RF5G_RF5G1_PDTXLO5_LSB) -#define RF5G_RF5G1_PDTXLO5_SET(x) (((x) << RF5G_RF5G1_PDTXLO5_LSB) & RF5G_RF5G1_PDTXLO5_MASK) -#define RF5G_RF5G1_PDTXMIX5_MSB 30 -#define RF5G_RF5G1_PDTXMIX5_LSB 30 -#define RF5G_RF5G1_PDTXMIX5_MASK 0x40000000 -#define RF5G_RF5G1_PDTXMIX5_GET(x) (((x) & RF5G_RF5G1_PDTXMIX5_MASK) >> RF5G_RF5G1_PDTXMIX5_LSB) -#define RF5G_RF5G1_PDTXMIX5_SET(x) (((x) << RF5G_RF5G1_PDTXMIX5_LSB) & RF5G_RF5G1_PDTXMIX5_MASK) -#define RF5G_RF5G1_PDTXBUF5_MSB 29 -#define RF5G_RF5G1_PDTXBUF5_LSB 29 -#define RF5G_RF5G1_PDTXBUF5_MASK 0x20000000 -#define RF5G_RF5G1_PDTXBUF5_GET(x) (((x) & RF5G_RF5G1_PDTXBUF5_MASK) >> RF5G_RF5G1_PDTXBUF5_LSB) -#define RF5G_RF5G1_PDTXBUF5_SET(x) (((x) << RF5G_RF5G1_PDTXBUF5_LSB) & RF5G_RF5G1_PDTXBUF5_MASK) -#define RF5G_RF5G1_PDPADRV5_MSB 28 -#define RF5G_RF5G1_PDPADRV5_LSB 28 -#define RF5G_RF5G1_PDPADRV5_MASK 0x10000000 -#define RF5G_RF5G1_PDPADRV5_GET(x) (((x) & RF5G_RF5G1_PDPADRV5_MASK) >> RF5G_RF5G1_PDPADRV5_LSB) -#define RF5G_RF5G1_PDPADRV5_SET(x) (((x) << RF5G_RF5G1_PDPADRV5_LSB) & RF5G_RF5G1_PDPADRV5_MASK) -#define RF5G_RF5G1_PDPAOUT5_MSB 27 -#define RF5G_RF5G1_PDPAOUT5_LSB 27 -#define RF5G_RF5G1_PDPAOUT5_MASK 0x08000000 -#define RF5G_RF5G1_PDPAOUT5_GET(x) (((x) & RF5G_RF5G1_PDPAOUT5_MASK) >> RF5G_RF5G1_PDPAOUT5_LSB) -#define RF5G_RF5G1_PDPAOUT5_SET(x) (((x) << RF5G_RF5G1_PDPAOUT5_LSB) & RF5G_RF5G1_PDPAOUT5_MASK) -#define RF5G_RF5G1_TUNE_PADRV5_MSB 26 -#define RF5G_RF5G1_TUNE_PADRV5_LSB 24 -#define RF5G_RF5G1_TUNE_PADRV5_MASK 0x07000000 -#define RF5G_RF5G1_TUNE_PADRV5_GET(x) (((x) & RF5G_RF5G1_TUNE_PADRV5_MASK) >> RF5G_RF5G1_TUNE_PADRV5_LSB) -#define RF5G_RF5G1_TUNE_PADRV5_SET(x) (((x) << RF5G_RF5G1_TUNE_PADRV5_LSB) & RF5G_RF5G1_TUNE_PADRV5_MASK) -#define RF5G_RF5G1_PWDTXPKD_MSB 23 -#define RF5G_RF5G1_PWDTXPKD_LSB 21 -#define RF5G_RF5G1_PWDTXPKD_MASK 0x00e00000 -#define RF5G_RF5G1_PWDTXPKD_GET(x) (((x) & RF5G_RF5G1_PWDTXPKD_MASK) >> RF5G_RF5G1_PWDTXPKD_LSB) -#define RF5G_RF5G1_PWDTXPKD_SET(x) (((x) << RF5G_RF5G1_PWDTXPKD_LSB) & RF5G_RF5G1_PWDTXPKD_MASK) -#define RF5G_RF5G1_DB5_MSB 20 -#define RF5G_RF5G1_DB5_LSB 18 -#define RF5G_RF5G1_DB5_MASK 0x001c0000 -#define RF5G_RF5G1_DB5_GET(x) (((x) & RF5G_RF5G1_DB5_MASK) >> RF5G_RF5G1_DB5_LSB) -#define RF5G_RF5G1_DB5_SET(x) (((x) << RF5G_RF5G1_DB5_LSB) & RF5G_RF5G1_DB5_MASK) -#define RF5G_RF5G1_OB5_MSB 17 -#define RF5G_RF5G1_OB5_LSB 15 -#define RF5G_RF5G1_OB5_MASK 0x00038000 -#define RF5G_RF5G1_OB5_GET(x) (((x) & RF5G_RF5G1_OB5_MASK) >> RF5G_RF5G1_OB5_LSB) -#define RF5G_RF5G1_OB5_SET(x) (((x) << RF5G_RF5G1_OB5_LSB) & RF5G_RF5G1_OB5_MASK) -#define RF5G_RF5G1_TX5_ATB_SEL_MSB 14 -#define RF5G_RF5G1_TX5_ATB_SEL_LSB 12 -#define RF5G_RF5G1_TX5_ATB_SEL_MASK 0x00007000 -#define RF5G_RF5G1_TX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_TX5_ATB_SEL_MASK) >> RF5G_RF5G1_TX5_ATB_SEL_LSB) -#define RF5G_RF5G1_TX5_ATB_SEL_SET(x) (((x) << RF5G_RF5G1_TX5_ATB_SEL_LSB) & RF5G_RF5G1_TX5_ATB_SEL_MASK) -#define RF5G_RF5G1_PDLO5DIV_MSB 11 -#define RF5G_RF5G1_PDLO5DIV_LSB 11 -#define RF5G_RF5G1_PDLO5DIV_MASK 0x00000800 -#define RF5G_RF5G1_PDLO5DIV_GET(x) (((x) & RF5G_RF5G1_PDLO5DIV_MASK) >> RF5G_RF5G1_PDLO5DIV_LSB) -#define RF5G_RF5G1_PDLO5DIV_SET(x) (((x) << RF5G_RF5G1_PDLO5DIV_LSB) & RF5G_RF5G1_PDLO5DIV_MASK) -#define RF5G_RF5G1_PDLO5MIX_MSB 10 -#define RF5G_RF5G1_PDLO5MIX_LSB 10 -#define RF5G_RF5G1_PDLO5MIX_MASK 0x00000400 -#define RF5G_RF5G1_PDLO5MIX_GET(x) (((x) & RF5G_RF5G1_PDLO5MIX_MASK) >> RF5G_RF5G1_PDLO5MIX_LSB) -#define RF5G_RF5G1_PDLO5MIX_SET(x) (((x) << RF5G_RF5G1_PDLO5MIX_LSB) & RF5G_RF5G1_PDLO5MIX_MASK) -#define RF5G_RF5G1_PDQBUF5_MSB 9 -#define RF5G_RF5G1_PDQBUF5_LSB 9 -#define RF5G_RF5G1_PDQBUF5_MASK 0x00000200 -#define RF5G_RF5G1_PDQBUF5_GET(x) (((x) & RF5G_RF5G1_PDQBUF5_MASK) >> RF5G_RF5G1_PDQBUF5_LSB) -#define RF5G_RF5G1_PDQBUF5_SET(x) (((x) << RF5G_RF5G1_PDQBUF5_LSB) & RF5G_RF5G1_PDQBUF5_MASK) -#define RF5G_RF5G1_PDLO5AGC_MSB 8 -#define RF5G_RF5G1_PDLO5AGC_LSB 8 -#define RF5G_RF5G1_PDLO5AGC_MASK 0x00000100 -#define RF5G_RF5G1_PDLO5AGC_GET(x) (((x) & RF5G_RF5G1_PDLO5AGC_MASK) >> RF5G_RF5G1_PDLO5AGC_LSB) -#define RF5G_RF5G1_PDLO5AGC_SET(x) (((x) << RF5G_RF5G1_PDLO5AGC_LSB) & RF5G_RF5G1_PDLO5AGC_MASK) -#define RF5G_RF5G1_PDREGLO5_MSB 7 -#define RF5G_RF5G1_PDREGLO5_LSB 7 -#define RF5G_RF5G1_PDREGLO5_MASK 0x00000080 -#define RF5G_RF5G1_PDREGLO5_GET(x) (((x) & RF5G_RF5G1_PDREGLO5_MASK) >> RF5G_RF5G1_PDREGLO5_LSB) -#define RF5G_RF5G1_PDREGLO5_SET(x) (((x) << RF5G_RF5G1_PDREGLO5_LSB) & RF5G_RF5G1_PDREGLO5_MASK) -#define RF5G_RF5G1_LO5_ATB_SEL_MSB 6 -#define RF5G_RF5G1_LO5_ATB_SEL_LSB 4 -#define RF5G_RF5G1_LO5_ATB_SEL_MASK 0x00000070 -#define RF5G_RF5G1_LO5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_LO5_ATB_SEL_MASK) >> RF5G_RF5G1_LO5_ATB_SEL_LSB) -#define RF5G_RF5G1_LO5_ATB_SEL_SET(x) (((x) << RF5G_RF5G1_LO5_ATB_SEL_LSB) & RF5G_RF5G1_LO5_ATB_SEL_MASK) -#define RF5G_RF5G1_LO5CONTROL_MSB 3 -#define RF5G_RF5G1_LO5CONTROL_LSB 3 -#define RF5G_RF5G1_LO5CONTROL_MASK 0x00000008 -#define RF5G_RF5G1_LO5CONTROL_GET(x) (((x) & RF5G_RF5G1_LO5CONTROL_MASK) >> RF5G_RF5G1_LO5CONTROL_LSB) -#define RF5G_RF5G1_LO5CONTROL_SET(x) (((x) << RF5G_RF5G1_LO5CONTROL_LSB) & RF5G_RF5G1_LO5CONTROL_MASK) -#define RF5G_RF5G1_REGLO_BYPASS5_MSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_LSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_MASK 0x00000004 -#define RF5G_RF5G1_REGLO_BYPASS5_GET(x) (((x) & RF5G_RF5G1_REGLO_BYPASS5_MASK) >> RF5G_RF5G1_REGLO_BYPASS5_LSB) -#define RF5G_RF5G1_REGLO_BYPASS5_SET(x) (((x) << RF5G_RF5G1_REGLO_BYPASS5_LSB) & RF5G_RF5G1_REGLO_BYPASS5_MASK) -#define RF5G_RF5G1_SPARE_MSB 1 -#define RF5G_RF5G1_SPARE_LSB 0 -#define RF5G_RF5G1_SPARE_MASK 0x00000003 -#define RF5G_RF5G1_SPARE_GET(x) (((x) & RF5G_RF5G1_SPARE_MASK) >> RF5G_RF5G1_SPARE_LSB) -#define RF5G_RF5G1_SPARE_SET(x) (((x) << RF5G_RF5G1_SPARE_LSB) & RF5G_RF5G1_SPARE_MASK) - -#define RF5G_RF5G2_ADDRESS 0x00000024 -#define RF5G_RF5G2_OFFSET 0x00000024 -#define RF5G_RF5G2_AGCLO_B_MSB 31 -#define RF5G_RF5G2_AGCLO_B_LSB 29 -#define RF5G_RF5G2_AGCLO_B_MASK 0xe0000000 -#define RF5G_RF5G2_AGCLO_B_GET(x) (((x) & RF5G_RF5G2_AGCLO_B_MASK) >> RF5G_RF5G2_AGCLO_B_LSB) -#define RF5G_RF5G2_AGCLO_B_SET(x) (((x) << RF5G_RF5G2_AGCLO_B_LSB) & RF5G_RF5G2_AGCLO_B_MASK) -#define RF5G_RF5G2_RX5_ATB_SEL_MSB 28 -#define RF5G_RF5G2_RX5_ATB_SEL_LSB 26 -#define RF5G_RF5G2_RX5_ATB_SEL_MASK 0x1c000000 -#define RF5G_RF5G2_RX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G2_RX5_ATB_SEL_MASK) >> RF5G_RF5G2_RX5_ATB_SEL_LSB) -#define RF5G_RF5G2_RX5_ATB_SEL_SET(x) (((x) << RF5G_RF5G2_RX5_ATB_SEL_LSB) & RF5G_RF5G2_RX5_ATB_SEL_MASK) -#define RF5G_RF5G2_PDCMOSLO5_MSB 25 -#define RF5G_RF5G2_PDCMOSLO5_LSB 25 -#define RF5G_RF5G2_PDCMOSLO5_MASK 0x02000000 -#define RF5G_RF5G2_PDCMOSLO5_GET(x) (((x) & RF5G_RF5G2_PDCMOSLO5_MASK) >> RF5G_RF5G2_PDCMOSLO5_LSB) -#define RF5G_RF5G2_PDCMOSLO5_SET(x) (((x) << RF5G_RF5G2_PDCMOSLO5_LSB) & RF5G_RF5G2_PDCMOSLO5_MASK) -#define RF5G_RF5G2_PDVGM5_MSB 24 -#define RF5G_RF5G2_PDVGM5_LSB 24 -#define RF5G_RF5G2_PDVGM5_MASK 0x01000000 -#define RF5G_RF5G2_PDVGM5_GET(x) (((x) & RF5G_RF5G2_PDVGM5_MASK) >> RF5G_RF5G2_PDVGM5_LSB) -#define RF5G_RF5G2_PDVGM5_SET(x) (((x) << RF5G_RF5G2_PDVGM5_LSB) & RF5G_RF5G2_PDVGM5_MASK) -#define RF5G_RF5G2_PDCSLNA5_MSB 23 -#define RF5G_RF5G2_PDCSLNA5_LSB 23 -#define RF5G_RF5G2_PDCSLNA5_MASK 0x00800000 -#define RF5G_RF5G2_PDCSLNA5_GET(x) (((x) & RF5G_RF5G2_PDCSLNA5_MASK) >> RF5G_RF5G2_PDCSLNA5_LSB) -#define RF5G_RF5G2_PDCSLNA5_SET(x) (((x) << RF5G_RF5G2_PDCSLNA5_LSB) & RF5G_RF5G2_PDCSLNA5_MASK) -#define RF5G_RF5G2_PDRFVGA5_MSB 22 -#define RF5G_RF5G2_PDRFVGA5_LSB 22 -#define RF5G_RF5G2_PDRFVGA5_MASK 0x00400000 -#define RF5G_RF5G2_PDRFVGA5_GET(x) (((x) & RF5G_RF5G2_PDRFVGA5_MASK) >> RF5G_RF5G2_PDRFVGA5_LSB) -#define RF5G_RF5G2_PDRFVGA5_SET(x) (((x) << RF5G_RF5G2_PDRFVGA5_LSB) & RF5G_RF5G2_PDRFVGA5_MASK) -#define RF5G_RF5G2_PDREGFE5_MSB 21 -#define RF5G_RF5G2_PDREGFE5_LSB 21 -#define RF5G_RF5G2_PDREGFE5_MASK 0x00200000 -#define RF5G_RF5G2_PDREGFE5_GET(x) (((x) & RF5G_RF5G2_PDREGFE5_MASK) >> RF5G_RF5G2_PDREGFE5_LSB) -#define RF5G_RF5G2_PDREGFE5_SET(x) (((x) << RF5G_RF5G2_PDREGFE5_LSB) & RF5G_RF5G2_PDREGFE5_MASK) -#define RF5G_RF5G2_TUNE_RFVGA5_MSB 20 -#define RF5G_RF5G2_TUNE_RFVGA5_LSB 18 -#define RF5G_RF5G2_TUNE_RFVGA5_MASK 0x001c0000 -#define RF5G_RF5G2_TUNE_RFVGA5_GET(x) (((x) & RF5G_RF5G2_TUNE_RFVGA5_MASK) >> RF5G_RF5G2_TUNE_RFVGA5_LSB) -#define RF5G_RF5G2_TUNE_RFVGA5_SET(x) (((x) << RF5G_RF5G2_TUNE_RFVGA5_LSB) & RF5G_RF5G2_TUNE_RFVGA5_MASK) -#define RF5G_RF5G2_BRFVGA5_MSB 17 -#define RF5G_RF5G2_BRFVGA5_LSB 15 -#define RF5G_RF5G2_BRFVGA5_MASK 0x00038000 -#define RF5G_RF5G2_BRFVGA5_GET(x) (((x) & RF5G_RF5G2_BRFVGA5_MASK) >> RF5G_RF5G2_BRFVGA5_LSB) -#define RF5G_RF5G2_BRFVGA5_SET(x) (((x) << RF5G_RF5G2_BRFVGA5_LSB) & RF5G_RF5G2_BRFVGA5_MASK) -#define RF5G_RF5G2_BCSLNA5_MSB 14 -#define RF5G_RF5G2_BCSLNA5_LSB 12 -#define RF5G_RF5G2_BCSLNA5_MASK 0x00007000 -#define RF5G_RF5G2_BCSLNA5_GET(x) (((x) & RF5G_RF5G2_BCSLNA5_MASK) >> RF5G_RF5G2_BCSLNA5_LSB) -#define RF5G_RF5G2_BCSLNA5_SET(x) (((x) << RF5G_RF5G2_BCSLNA5_LSB) & RF5G_RF5G2_BCSLNA5_MASK) -#define RF5G_RF5G2_BVGM5_MSB 11 -#define RF5G_RF5G2_BVGM5_LSB 9 -#define RF5G_RF5G2_BVGM5_MASK 0x00000e00 -#define RF5G_RF5G2_BVGM5_GET(x) (((x) & RF5G_RF5G2_BVGM5_MASK) >> RF5G_RF5G2_BVGM5_LSB) -#define RF5G_RF5G2_BVGM5_SET(x) (((x) << RF5G_RF5G2_BVGM5_LSB) & RF5G_RF5G2_BVGM5_MASK) -#define RF5G_RF5G2_REGFE_BYPASS5_MSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_LSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_MASK 0x00000100 -#define RF5G_RF5G2_REGFE_BYPASS5_GET(x) (((x) & RF5G_RF5G2_REGFE_BYPASS5_MASK) >> RF5G_RF5G2_REGFE_BYPASS5_LSB) -#define RF5G_RF5G2_REGFE_BYPASS5_SET(x) (((x) << RF5G_RF5G2_REGFE_BYPASS5_LSB) & RF5G_RF5G2_REGFE_BYPASS5_MASK) -#define RF5G_RF5G2_LNA5_ATTENMODE_MSB 7 -#define RF5G_RF5G2_LNA5_ATTENMODE_LSB 6 -#define RF5G_RF5G2_LNA5_ATTENMODE_MASK 0x000000c0 -#define RF5G_RF5G2_LNA5_ATTENMODE_GET(x) (((x) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) >> RF5G_RF5G2_LNA5_ATTENMODE_LSB) -#define RF5G_RF5G2_LNA5_ATTENMODE_SET(x) (((x) << RF5G_RF5G2_LNA5_ATTENMODE_LSB) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) -#define RF5G_RF5G2_ENABLE_PCA_MSB 5 -#define RF5G_RF5G2_ENABLE_PCA_LSB 5 -#define RF5G_RF5G2_ENABLE_PCA_MASK 0x00000020 -#define RF5G_RF5G2_ENABLE_PCA_GET(x) (((x) & RF5G_RF5G2_ENABLE_PCA_MASK) >> RF5G_RF5G2_ENABLE_PCA_LSB) -#define RF5G_RF5G2_ENABLE_PCA_SET(x) (((x) << RF5G_RF5G2_ENABLE_PCA_LSB) & RF5G_RF5G2_ENABLE_PCA_MASK) -#define RF5G_RF5G2_TUNE_LO_MSB 4 -#define RF5G_RF5G2_TUNE_LO_LSB 2 -#define RF5G_RF5G2_TUNE_LO_MASK 0x0000001c -#define RF5G_RF5G2_TUNE_LO_GET(x) (((x) & RF5G_RF5G2_TUNE_LO_MASK) >> RF5G_RF5G2_TUNE_LO_LSB) -#define RF5G_RF5G2_TUNE_LO_SET(x) (((x) << RF5G_RF5G2_TUNE_LO_LSB) & RF5G_RF5G2_TUNE_LO_MASK) -#define RF5G_RF5G2_SPARE_MSB 1 -#define RF5G_RF5G2_SPARE_LSB 0 -#define RF5G_RF5G2_SPARE_MASK 0x00000003 -#define RF5G_RF5G2_SPARE_GET(x) (((x) & RF5G_RF5G2_SPARE_MASK) >> RF5G_RF5G2_SPARE_LSB) -#define RF5G_RF5G2_SPARE_SET(x) (((x) << RF5G_RF5G2_SPARE_LSB) & RF5G_RF5G2_SPARE_MASK) - -#define RF2G_RF2G1_ADDRESS 0x00000028 -#define RF2G_RF2G1_OFFSET 0x00000028 -#define RF2G_RF2G1_BLNA1_MSB 31 -#define RF2G_RF2G1_BLNA1_LSB 29 -#define RF2G_RF2G1_BLNA1_MASK 0xe0000000 -#define RF2G_RF2G1_BLNA1_GET(x) (((x) & RF2G_RF2G1_BLNA1_MASK) >> RF2G_RF2G1_BLNA1_LSB) -#define RF2G_RF2G1_BLNA1_SET(x) (((x) << RF2G_RF2G1_BLNA1_LSB) & RF2G_RF2G1_BLNA1_MASK) -#define RF2G_RF2G1_BLNA1F_MSB 28 -#define RF2G_RF2G1_BLNA1F_LSB 26 -#define RF2G_RF2G1_BLNA1F_MASK 0x1c000000 -#define RF2G_RF2G1_BLNA1F_GET(x) (((x) & RF2G_RF2G1_BLNA1F_MASK) >> RF2G_RF2G1_BLNA1F_LSB) -#define RF2G_RF2G1_BLNA1F_SET(x) (((x) << RF2G_RF2G1_BLNA1F_LSB) & RF2G_RF2G1_BLNA1F_MASK) -#define RF2G_RF2G1_BLNA1BUF_MSB 25 -#define RF2G_RF2G1_BLNA1BUF_LSB 23 -#define RF2G_RF2G1_BLNA1BUF_MASK 0x03800000 -#define RF2G_RF2G1_BLNA1BUF_GET(x) (((x) & RF2G_RF2G1_BLNA1BUF_MASK) >> RF2G_RF2G1_BLNA1BUF_LSB) -#define RF2G_RF2G1_BLNA1BUF_SET(x) (((x) << RF2G_RF2G1_BLNA1BUF_LSB) & RF2G_RF2G1_BLNA1BUF_MASK) -#define RF2G_RF2G1_BLNA2_MSB 22 -#define RF2G_RF2G1_BLNA2_LSB 20 -#define RF2G_RF2G1_BLNA2_MASK 0x00700000 -#define RF2G_RF2G1_BLNA2_GET(x) (((x) & RF2G_RF2G1_BLNA2_MASK) >> RF2G_RF2G1_BLNA2_LSB) -#define RF2G_RF2G1_BLNA2_SET(x) (((x) << RF2G_RF2G1_BLNA2_LSB) & RF2G_RF2G1_BLNA2_MASK) -#define RF2G_RF2G1_DB_MSB 19 -#define RF2G_RF2G1_DB_LSB 17 -#define RF2G_RF2G1_DB_MASK 0x000e0000 -#define RF2G_RF2G1_DB_GET(x) (((x) & RF2G_RF2G1_DB_MASK) >> RF2G_RF2G1_DB_LSB) -#define RF2G_RF2G1_DB_SET(x) (((x) << RF2G_RF2G1_DB_LSB) & RF2G_RF2G1_DB_MASK) -#define RF2G_RF2G1_OB_MSB 16 -#define RF2G_RF2G1_OB_LSB 14 -#define RF2G_RF2G1_OB_MASK 0x0001c000 -#define RF2G_RF2G1_OB_GET(x) (((x) & RF2G_RF2G1_OB_MASK) >> RF2G_RF2G1_OB_LSB) -#define RF2G_RF2G1_OB_SET(x) (((x) << RF2G_RF2G1_OB_LSB) & RF2G_RF2G1_OB_MASK) -#define RF2G_RF2G1_FE_ATB_SEL_MSB 13 -#define RF2G_RF2G1_FE_ATB_SEL_LSB 11 -#define RF2G_RF2G1_FE_ATB_SEL_MASK 0x00003800 -#define RF2G_RF2G1_FE_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_FE_ATB_SEL_MASK) >> RF2G_RF2G1_FE_ATB_SEL_LSB) -#define RF2G_RF2G1_FE_ATB_SEL_SET(x) (((x) << RF2G_RF2G1_FE_ATB_SEL_LSB) & RF2G_RF2G1_FE_ATB_SEL_MASK) -#define RF2G_RF2G1_RF_ATB_SEL_MSB 10 -#define RF2G_RF2G1_RF_ATB_SEL_LSB 8 -#define RF2G_RF2G1_RF_ATB_SEL_MASK 0x00000700 -#define RF2G_RF2G1_RF_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_RF_ATB_SEL_MASK) >> RF2G_RF2G1_RF_ATB_SEL_LSB) -#define RF2G_RF2G1_RF_ATB_SEL_SET(x) (((x) << RF2G_RF2G1_RF_ATB_SEL_LSB) & RF2G_RF2G1_RF_ATB_SEL_MASK) -#define RF2G_RF2G1_SELLNA_MSB 7 -#define RF2G_RF2G1_SELLNA_LSB 7 -#define RF2G_RF2G1_SELLNA_MASK 0x00000080 -#define RF2G_RF2G1_SELLNA_GET(x) (((x) & RF2G_RF2G1_SELLNA_MASK) >> RF2G_RF2G1_SELLNA_LSB) -#define RF2G_RF2G1_SELLNA_SET(x) (((x) << RF2G_RF2G1_SELLNA_LSB) & RF2G_RF2G1_SELLNA_MASK) -#define RF2G_RF2G1_LOCONTROL_MSB 6 -#define RF2G_RF2G1_LOCONTROL_LSB 6 -#define RF2G_RF2G1_LOCONTROL_MASK 0x00000040 -#define RF2G_RF2G1_LOCONTROL_GET(x) (((x) & RF2G_RF2G1_LOCONTROL_MASK) >> RF2G_RF2G1_LOCONTROL_LSB) -#define RF2G_RF2G1_LOCONTROL_SET(x) (((x) << RF2G_RF2G1_LOCONTROL_LSB) & RF2G_RF2G1_LOCONTROL_MASK) -#define RF2G_RF2G1_SHORTLNA2_MSB 5 -#define RF2G_RF2G1_SHORTLNA2_LSB 5 -#define RF2G_RF2G1_SHORTLNA2_MASK 0x00000020 -#define RF2G_RF2G1_SHORTLNA2_GET(x) (((x) & RF2G_RF2G1_SHORTLNA2_MASK) >> RF2G_RF2G1_SHORTLNA2_LSB) -#define RF2G_RF2G1_SHORTLNA2_SET(x) (((x) << RF2G_RF2G1_SHORTLNA2_LSB) & RF2G_RF2G1_SHORTLNA2_MASK) -#define RF2G_RF2G1_SPARE_MSB 4 -#define RF2G_RF2G1_SPARE_LSB 0 -#define RF2G_RF2G1_SPARE_MASK 0x0000001f -#define RF2G_RF2G1_SPARE_GET(x) (((x) & RF2G_RF2G1_SPARE_MASK) >> RF2G_RF2G1_SPARE_LSB) -#define RF2G_RF2G1_SPARE_SET(x) (((x) << RF2G_RF2G1_SPARE_LSB) & RF2G_RF2G1_SPARE_MASK) - -#define RF2G_RF2G2_ADDRESS 0x0000002c -#define RF2G_RF2G2_OFFSET 0x0000002c -#define RF2G_RF2G2_PDCGLNA_MSB 31 -#define RF2G_RF2G2_PDCGLNA_LSB 31 -#define RF2G_RF2G2_PDCGLNA_MASK 0x80000000 -#define RF2G_RF2G2_PDCGLNA_GET(x) (((x) & RF2G_RF2G2_PDCGLNA_MASK) >> RF2G_RF2G2_PDCGLNA_LSB) -#define RF2G_RF2G2_PDCGLNA_SET(x) (((x) << RF2G_RF2G2_PDCGLNA_LSB) & RF2G_RF2G2_PDCGLNA_MASK) -#define RF2G_RF2G2_PDCGLNABUF_MSB 30 -#define RF2G_RF2G2_PDCGLNABUF_LSB 30 -#define RF2G_RF2G2_PDCGLNABUF_MASK 0x40000000 -#define RF2G_RF2G2_PDCGLNABUF_GET(x) (((x) & RF2G_RF2G2_PDCGLNABUF_MASK) >> RF2G_RF2G2_PDCGLNABUF_LSB) -#define RF2G_RF2G2_PDCGLNABUF_SET(x) (((x) << RF2G_RF2G2_PDCGLNABUF_LSB) & RF2G_RF2G2_PDCGLNABUF_MASK) -#define RF2G_RF2G2_PDCSLNA_MSB 29 -#define RF2G_RF2G2_PDCSLNA_LSB 29 -#define RF2G_RF2G2_PDCSLNA_MASK 0x20000000 -#define RF2G_RF2G2_PDCSLNA_GET(x) (((x) & RF2G_RF2G2_PDCSLNA_MASK) >> RF2G_RF2G2_PDCSLNA_LSB) -#define RF2G_RF2G2_PDCSLNA_SET(x) (((x) << RF2G_RF2G2_PDCSLNA_LSB) & RF2G_RF2G2_PDCSLNA_MASK) -#define RF2G_RF2G2_PDDIV_MSB 28 -#define RF2G_RF2G2_PDDIV_LSB 28 -#define RF2G_RF2G2_PDDIV_MASK 0x10000000 -#define RF2G_RF2G2_PDDIV_GET(x) (((x) & RF2G_RF2G2_PDDIV_MASK) >> RF2G_RF2G2_PDDIV_LSB) -#define RF2G_RF2G2_PDDIV_SET(x) (((x) << RF2G_RF2G2_PDDIV_LSB) & RF2G_RF2G2_PDDIV_MASK) -#define RF2G_RF2G2_PDPADRV_MSB 27 -#define RF2G_RF2G2_PDPADRV_LSB 27 -#define RF2G_RF2G2_PDPADRV_MASK 0x08000000 -#define RF2G_RF2G2_PDPADRV_GET(x) (((x) & RF2G_RF2G2_PDPADRV_MASK) >> RF2G_RF2G2_PDPADRV_LSB) -#define RF2G_RF2G2_PDPADRV_SET(x) (((x) << RF2G_RF2G2_PDPADRV_LSB) & RF2G_RF2G2_PDPADRV_MASK) -#define RF2G_RF2G2_PDPAOUT_MSB 26 -#define RF2G_RF2G2_PDPAOUT_LSB 26 -#define RF2G_RF2G2_PDPAOUT_MASK 0x04000000 -#define RF2G_RF2G2_PDPAOUT_GET(x) (((x) & RF2G_RF2G2_PDPAOUT_MASK) >> RF2G_RF2G2_PDPAOUT_LSB) -#define RF2G_RF2G2_PDPAOUT_SET(x) (((x) << RF2G_RF2G2_PDPAOUT_LSB) & RF2G_RF2G2_PDPAOUT_MASK) -#define RF2G_RF2G2_PDREGLNA_MSB 25 -#define RF2G_RF2G2_PDREGLNA_LSB 25 -#define RF2G_RF2G2_PDREGLNA_MASK 0x02000000 -#define RF2G_RF2G2_PDREGLNA_GET(x) (((x) & RF2G_RF2G2_PDREGLNA_MASK) >> RF2G_RF2G2_PDREGLNA_LSB) -#define RF2G_RF2G2_PDREGLNA_SET(x) (((x) << RF2G_RF2G2_PDREGLNA_LSB) & RF2G_RF2G2_PDREGLNA_MASK) -#define RF2G_RF2G2_PDREGLO_MSB 24 -#define RF2G_RF2G2_PDREGLO_LSB 24 -#define RF2G_RF2G2_PDREGLO_MASK 0x01000000 -#define RF2G_RF2G2_PDREGLO_GET(x) (((x) & RF2G_RF2G2_PDREGLO_MASK) >> RF2G_RF2G2_PDREGLO_LSB) -#define RF2G_RF2G2_PDREGLO_SET(x) (((x) << RF2G_RF2G2_PDREGLO_LSB) & RF2G_RF2G2_PDREGLO_MASK) -#define RF2G_RF2G2_PDRFGM_MSB 23 -#define RF2G_RF2G2_PDRFGM_LSB 23 -#define RF2G_RF2G2_PDRFGM_MASK 0x00800000 -#define RF2G_RF2G2_PDRFGM_GET(x) (((x) & RF2G_RF2G2_PDRFGM_MASK) >> RF2G_RF2G2_PDRFGM_LSB) -#define RF2G_RF2G2_PDRFGM_SET(x) (((x) << RF2G_RF2G2_PDRFGM_LSB) & RF2G_RF2G2_PDRFGM_MASK) -#define RF2G_RF2G2_PDRXLO_MSB 22 -#define RF2G_RF2G2_PDRXLO_LSB 22 -#define RF2G_RF2G2_PDRXLO_MASK 0x00400000 -#define RF2G_RF2G2_PDRXLO_GET(x) (((x) & RF2G_RF2G2_PDRXLO_MASK) >> RF2G_RF2G2_PDRXLO_LSB) -#define RF2G_RF2G2_PDRXLO_SET(x) (((x) << RF2G_RF2G2_PDRXLO_LSB) & RF2G_RF2G2_PDRXLO_MASK) -#define RF2G_RF2G2_PDTXLO_MSB 21 -#define RF2G_RF2G2_PDTXLO_LSB 21 -#define RF2G_RF2G2_PDTXLO_MASK 0x00200000 -#define RF2G_RF2G2_PDTXLO_GET(x) (((x) & RF2G_RF2G2_PDTXLO_MASK) >> RF2G_RF2G2_PDTXLO_LSB) -#define RF2G_RF2G2_PDTXLO_SET(x) (((x) << RF2G_RF2G2_PDTXLO_LSB) & RF2G_RF2G2_PDTXLO_MASK) -#define RF2G_RF2G2_PDTXMIX_MSB 20 -#define RF2G_RF2G2_PDTXMIX_LSB 20 -#define RF2G_RF2G2_PDTXMIX_MASK 0x00100000 -#define RF2G_RF2G2_PDTXMIX_GET(x) (((x) & RF2G_RF2G2_PDTXMIX_MASK) >> RF2G_RF2G2_PDTXMIX_LSB) -#define RF2G_RF2G2_PDTXMIX_SET(x) (((x) << RF2G_RF2G2_PDTXMIX_LSB) & RF2G_RF2G2_PDTXMIX_MASK) -#define RF2G_RF2G2_REGLNA_BYPASS_MSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_LSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_MASK 0x00080000 -#define RF2G_RF2G2_REGLNA_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLNA_BYPASS_MASK) >> RF2G_RF2G2_REGLNA_BYPASS_LSB) -#define RF2G_RF2G2_REGLNA_BYPASS_SET(x) (((x) << RF2G_RF2G2_REGLNA_BYPASS_LSB) & RF2G_RF2G2_REGLNA_BYPASS_MASK) -#define RF2G_RF2G2_REGLO_BYPASS_MSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_LSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_MASK 0x00040000 -#define RF2G_RF2G2_REGLO_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLO_BYPASS_MASK) >> RF2G_RF2G2_REGLO_BYPASS_LSB) -#define RF2G_RF2G2_REGLO_BYPASS_SET(x) (((x) << RF2G_RF2G2_REGLO_BYPASS_LSB) & RF2G_RF2G2_REGLO_BYPASS_MASK) -#define RF2G_RF2G2_ENABLE_PCB_MSB 17 -#define RF2G_RF2G2_ENABLE_PCB_LSB 17 -#define RF2G_RF2G2_ENABLE_PCB_MASK 0x00020000 -#define RF2G_RF2G2_ENABLE_PCB_GET(x) (((x) & RF2G_RF2G2_ENABLE_PCB_MASK) >> RF2G_RF2G2_ENABLE_PCB_LSB) -#define RF2G_RF2G2_ENABLE_PCB_SET(x) (((x) << RF2G_RF2G2_ENABLE_PCB_LSB) & RF2G_RF2G2_ENABLE_PCB_MASK) -#define RF2G_RF2G2_SPARE_MSB 16 -#define RF2G_RF2G2_SPARE_LSB 0 -#define RF2G_RF2G2_SPARE_MASK 0x0001ffff -#define RF2G_RF2G2_SPARE_GET(x) (((x) & RF2G_RF2G2_SPARE_MASK) >> RF2G_RF2G2_SPARE_LSB) -#define RF2G_RF2G2_SPARE_SET(x) (((x) << RF2G_RF2G2_SPARE_LSB) & RF2G_RF2G2_SPARE_MASK) - -#define TOP_GAIN_ADDRESS 0x00000030 -#define TOP_GAIN_OFFSET 0x00000030 -#define TOP_GAIN_TX6DBLOQGAIN_MSB 31 -#define TOP_GAIN_TX6DBLOQGAIN_LSB 30 -#define TOP_GAIN_TX6DBLOQGAIN_MASK 0xc0000000 -#define TOP_GAIN_TX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX6DBLOQGAIN_MASK) >> TOP_GAIN_TX6DBLOQGAIN_LSB) -#define TOP_GAIN_TX6DBLOQGAIN_SET(x) (((x) << TOP_GAIN_TX6DBLOQGAIN_LSB) & TOP_GAIN_TX6DBLOQGAIN_MASK) -#define TOP_GAIN_TX1DBLOQGAIN_MSB 29 -#define TOP_GAIN_TX1DBLOQGAIN_LSB 27 -#define TOP_GAIN_TX1DBLOQGAIN_MASK 0x38000000 -#define TOP_GAIN_TX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX1DBLOQGAIN_MASK) >> TOP_GAIN_TX1DBLOQGAIN_LSB) -#define TOP_GAIN_TX1DBLOQGAIN_SET(x) (((x) << TOP_GAIN_TX1DBLOQGAIN_LSB) & TOP_GAIN_TX1DBLOQGAIN_MASK) -#define TOP_GAIN_TXV2IGAIN_MSB 26 -#define TOP_GAIN_TXV2IGAIN_LSB 25 -#define TOP_GAIN_TXV2IGAIN_MASK 0x06000000 -#define TOP_GAIN_TXV2IGAIN_GET(x) (((x) & TOP_GAIN_TXV2IGAIN_MASK) >> TOP_GAIN_TXV2IGAIN_LSB) -#define TOP_GAIN_TXV2IGAIN_SET(x) (((x) << TOP_GAIN_TXV2IGAIN_LSB) & TOP_GAIN_TXV2IGAIN_MASK) -#define TOP_GAIN_PABUF5GN_MSB 24 -#define TOP_GAIN_PABUF5GN_LSB 24 -#define TOP_GAIN_PABUF5GN_MASK 0x01000000 -#define TOP_GAIN_PABUF5GN_GET(x) (((x) & TOP_GAIN_PABUF5GN_MASK) >> TOP_GAIN_PABUF5GN_LSB) -#define TOP_GAIN_PABUF5GN_SET(x) (((x) << TOP_GAIN_PABUF5GN_LSB) & TOP_GAIN_PABUF5GN_MASK) -#define TOP_GAIN_PADRVGN_MSB 23 -#define TOP_GAIN_PADRVGN_LSB 21 -#define TOP_GAIN_PADRVGN_MASK 0x00e00000 -#define TOP_GAIN_PADRVGN_GET(x) (((x) & TOP_GAIN_PADRVGN_MASK) >> TOP_GAIN_PADRVGN_LSB) -#define TOP_GAIN_PADRVGN_SET(x) (((x) << TOP_GAIN_PADRVGN_LSB) & TOP_GAIN_PADRVGN_MASK) -#define TOP_GAIN_PAOUT2GN_MSB 20 -#define TOP_GAIN_PAOUT2GN_LSB 18 -#define TOP_GAIN_PAOUT2GN_MASK 0x001c0000 -#define TOP_GAIN_PAOUT2GN_GET(x) (((x) & TOP_GAIN_PAOUT2GN_MASK) >> TOP_GAIN_PAOUT2GN_LSB) -#define TOP_GAIN_PAOUT2GN_SET(x) (((x) << TOP_GAIN_PAOUT2GN_LSB) & TOP_GAIN_PAOUT2GN_MASK) -#define TOP_GAIN_LNAON_MSB 17 -#define TOP_GAIN_LNAON_LSB 17 -#define TOP_GAIN_LNAON_MASK 0x00020000 -#define TOP_GAIN_LNAON_GET(x) (((x) & TOP_GAIN_LNAON_MASK) >> TOP_GAIN_LNAON_LSB) -#define TOP_GAIN_LNAON_SET(x) (((x) << TOP_GAIN_LNAON_LSB) & TOP_GAIN_LNAON_MASK) -#define TOP_GAIN_LNAGAIN_MSB 16 -#define TOP_GAIN_LNAGAIN_LSB 13 -#define TOP_GAIN_LNAGAIN_MASK 0x0001e000 -#define TOP_GAIN_LNAGAIN_GET(x) (((x) & TOP_GAIN_LNAGAIN_MASK) >> TOP_GAIN_LNAGAIN_LSB) -#define TOP_GAIN_LNAGAIN_SET(x) (((x) << TOP_GAIN_LNAGAIN_LSB) & TOP_GAIN_LNAGAIN_MASK) -#define TOP_GAIN_RFVGA5GAIN_MSB 12 -#define TOP_GAIN_RFVGA5GAIN_LSB 11 -#define TOP_GAIN_RFVGA5GAIN_MASK 0x00001800 -#define TOP_GAIN_RFVGA5GAIN_GET(x) (((x) & TOP_GAIN_RFVGA5GAIN_MASK) >> TOP_GAIN_RFVGA5GAIN_LSB) -#define TOP_GAIN_RFVGA5GAIN_SET(x) (((x) << TOP_GAIN_RFVGA5GAIN_LSB) & TOP_GAIN_RFVGA5GAIN_MASK) -#define TOP_GAIN_RFGMGN_MSB 10 -#define TOP_GAIN_RFGMGN_LSB 8 -#define TOP_GAIN_RFGMGN_MASK 0x00000700 -#define TOP_GAIN_RFGMGN_GET(x) (((x) & TOP_GAIN_RFGMGN_MASK) >> TOP_GAIN_RFGMGN_LSB) -#define TOP_GAIN_RFGMGN_SET(x) (((x) << TOP_GAIN_RFGMGN_LSB) & TOP_GAIN_RFGMGN_MASK) -#define TOP_GAIN_RX6DBLOQGAIN_MSB 7 -#define TOP_GAIN_RX6DBLOQGAIN_LSB 6 -#define TOP_GAIN_RX6DBLOQGAIN_MASK 0x000000c0 -#define TOP_GAIN_RX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBLOQGAIN_MASK) >> TOP_GAIN_RX6DBLOQGAIN_LSB) -#define TOP_GAIN_RX6DBLOQGAIN_SET(x) (((x) << TOP_GAIN_RX6DBLOQGAIN_LSB) & TOP_GAIN_RX6DBLOQGAIN_MASK) -#define TOP_GAIN_RX1DBLOQGAIN_MSB 5 -#define TOP_GAIN_RX1DBLOQGAIN_LSB 3 -#define TOP_GAIN_RX1DBLOQGAIN_MASK 0x00000038 -#define TOP_GAIN_RX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX1DBLOQGAIN_MASK) >> TOP_GAIN_RX1DBLOQGAIN_LSB) -#define TOP_GAIN_RX1DBLOQGAIN_SET(x) (((x) << TOP_GAIN_RX1DBLOQGAIN_LSB) & TOP_GAIN_RX1DBLOQGAIN_MASK) -#define TOP_GAIN_RX6DBHIQGAIN_MSB 2 -#define TOP_GAIN_RX6DBHIQGAIN_LSB 1 -#define TOP_GAIN_RX6DBHIQGAIN_MASK 0x00000006 -#define TOP_GAIN_RX6DBHIQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBHIQGAIN_MASK) >> TOP_GAIN_RX6DBHIQGAIN_LSB) -#define TOP_GAIN_RX6DBHIQGAIN_SET(x) (((x) << TOP_GAIN_RX6DBHIQGAIN_LSB) & TOP_GAIN_RX6DBHIQGAIN_MASK) -#define TOP_GAIN_SPARE_MSB 0 -#define TOP_GAIN_SPARE_LSB 0 -#define TOP_GAIN_SPARE_MASK 0x00000001 -#define TOP_GAIN_SPARE_GET(x) (((x) & TOP_GAIN_SPARE_MASK) >> TOP_GAIN_SPARE_LSB) -#define TOP_GAIN_SPARE_SET(x) (((x) << TOP_GAIN_SPARE_LSB) & TOP_GAIN_SPARE_MASK) - -#define TOP_TOP_ADDRESS 0x00000034 -#define TOP_TOP_OFFSET 0x00000034 -#define TOP_TOP_LOCALTXGAIN_MSB 31 -#define TOP_TOP_LOCALTXGAIN_LSB 31 -#define TOP_TOP_LOCALTXGAIN_MASK 0x80000000 -#define TOP_TOP_LOCALTXGAIN_GET(x) (((x) & TOP_TOP_LOCALTXGAIN_MASK) >> TOP_TOP_LOCALTXGAIN_LSB) -#define TOP_TOP_LOCALTXGAIN_SET(x) (((x) << TOP_TOP_LOCALTXGAIN_LSB) & TOP_TOP_LOCALTXGAIN_MASK) -#define TOP_TOP_LOCALRXGAIN_MSB 30 -#define TOP_TOP_LOCALRXGAIN_LSB 30 -#define TOP_TOP_LOCALRXGAIN_MASK 0x40000000 -#define TOP_TOP_LOCALRXGAIN_GET(x) (((x) & TOP_TOP_LOCALRXGAIN_MASK) >> TOP_TOP_LOCALRXGAIN_LSB) -#define TOP_TOP_LOCALRXGAIN_SET(x) (((x) << TOP_TOP_LOCALRXGAIN_LSB) & TOP_TOP_LOCALRXGAIN_MASK) -#define TOP_TOP_LOCALMODE_MSB 29 -#define TOP_TOP_LOCALMODE_LSB 29 -#define TOP_TOP_LOCALMODE_MASK 0x20000000 -#define TOP_TOP_LOCALMODE_GET(x) (((x) & TOP_TOP_LOCALMODE_MASK) >> TOP_TOP_LOCALMODE_LSB) -#define TOP_TOP_LOCALMODE_SET(x) (((x) << TOP_TOP_LOCALMODE_LSB) & TOP_TOP_LOCALMODE_MASK) -#define TOP_TOP_CALFC_MSB 28 -#define TOP_TOP_CALFC_LSB 28 -#define TOP_TOP_CALFC_MASK 0x10000000 -#define TOP_TOP_CALFC_GET(x) (((x) & TOP_TOP_CALFC_MASK) >> TOP_TOP_CALFC_LSB) -#define TOP_TOP_CALFC_SET(x) (((x) << TOP_TOP_CALFC_LSB) & TOP_TOP_CALFC_MASK) -#define TOP_TOP_CALDC_MSB 27 -#define TOP_TOP_CALDC_LSB 27 -#define TOP_TOP_CALDC_MASK 0x08000000 -#define TOP_TOP_CALDC_GET(x) (((x) & TOP_TOP_CALDC_MASK) >> TOP_TOP_CALDC_LSB) -#define TOP_TOP_CALDC_SET(x) (((x) << TOP_TOP_CALDC_LSB) & TOP_TOP_CALDC_MASK) -#define TOP_TOP_CAL_RESIDUE_MSB 26 -#define TOP_TOP_CAL_RESIDUE_LSB 26 -#define TOP_TOP_CAL_RESIDUE_MASK 0x04000000 -#define TOP_TOP_CAL_RESIDUE_GET(x) (((x) & TOP_TOP_CAL_RESIDUE_MASK) >> TOP_TOP_CAL_RESIDUE_LSB) -#define TOP_TOP_CAL_RESIDUE_SET(x) (((x) << TOP_TOP_CAL_RESIDUE_LSB) & TOP_TOP_CAL_RESIDUE_MASK) -#define TOP_TOP_BMODE_MSB 25 -#define TOP_TOP_BMODE_LSB 25 -#define TOP_TOP_BMODE_MASK 0x02000000 -#define TOP_TOP_BMODE_GET(x) (((x) & TOP_TOP_BMODE_MASK) >> TOP_TOP_BMODE_LSB) -#define TOP_TOP_BMODE_SET(x) (((x) << TOP_TOP_BMODE_LSB) & TOP_TOP_BMODE_MASK) -#define TOP_TOP_SYNTHON_MSB 24 -#define TOP_TOP_SYNTHON_LSB 24 -#define TOP_TOP_SYNTHON_MASK 0x01000000 -#define TOP_TOP_SYNTHON_GET(x) (((x) & TOP_TOP_SYNTHON_MASK) >> TOP_TOP_SYNTHON_LSB) -#define TOP_TOP_SYNTHON_SET(x) (((x) << TOP_TOP_SYNTHON_LSB) & TOP_TOP_SYNTHON_MASK) -#define TOP_TOP_RXON_MSB 23 -#define TOP_TOP_RXON_LSB 23 -#define TOP_TOP_RXON_MASK 0x00800000 -#define TOP_TOP_RXON_GET(x) (((x) & TOP_TOP_RXON_MASK) >> TOP_TOP_RXON_LSB) -#define TOP_TOP_RXON_SET(x) (((x) << TOP_TOP_RXON_LSB) & TOP_TOP_RXON_MASK) -#define TOP_TOP_TXON_MSB 22 -#define TOP_TOP_TXON_LSB 22 -#define TOP_TOP_TXON_MASK 0x00400000 -#define TOP_TOP_TXON_GET(x) (((x) & TOP_TOP_TXON_MASK) >> TOP_TOP_TXON_LSB) -#define TOP_TOP_TXON_SET(x) (((x) << TOP_TOP_TXON_LSB) & TOP_TOP_TXON_MASK) -#define TOP_TOP_PAON_MSB 21 -#define TOP_TOP_PAON_LSB 21 -#define TOP_TOP_PAON_MASK 0x00200000 -#define TOP_TOP_PAON_GET(x) (((x) & TOP_TOP_PAON_MASK) >> TOP_TOP_PAON_LSB) -#define TOP_TOP_PAON_SET(x) (((x) << TOP_TOP_PAON_LSB) & TOP_TOP_PAON_MASK) -#define TOP_TOP_CALTX_MSB 20 -#define TOP_TOP_CALTX_LSB 20 -#define TOP_TOP_CALTX_MASK 0x00100000 -#define TOP_TOP_CALTX_GET(x) (((x) & TOP_TOP_CALTX_MASK) >> TOP_TOP_CALTX_LSB) -#define TOP_TOP_CALTX_SET(x) (((x) << TOP_TOP_CALTX_LSB) & TOP_TOP_CALTX_MASK) -#define TOP_TOP_LOCALADDAC_MSB 19 -#define TOP_TOP_LOCALADDAC_LSB 19 -#define TOP_TOP_LOCALADDAC_MASK 0x00080000 -#define TOP_TOP_LOCALADDAC_GET(x) (((x) & TOP_TOP_LOCALADDAC_MASK) >> TOP_TOP_LOCALADDAC_LSB) -#define TOP_TOP_LOCALADDAC_SET(x) (((x) << TOP_TOP_LOCALADDAC_LSB) & TOP_TOP_LOCALADDAC_MASK) -#define TOP_TOP_PWDPLL_MSB 18 -#define TOP_TOP_PWDPLL_LSB 18 -#define TOP_TOP_PWDPLL_MASK 0x00040000 -#define TOP_TOP_PWDPLL_GET(x) (((x) & TOP_TOP_PWDPLL_MASK) >> TOP_TOP_PWDPLL_LSB) -#define TOP_TOP_PWDPLL_SET(x) (((x) << TOP_TOP_PWDPLL_LSB) & TOP_TOP_PWDPLL_MASK) -#define TOP_TOP_PWDADC_MSB 17 -#define TOP_TOP_PWDADC_LSB 17 -#define TOP_TOP_PWDADC_MASK 0x00020000 -#define TOP_TOP_PWDADC_GET(x) (((x) & TOP_TOP_PWDADC_MASK) >> TOP_TOP_PWDADC_LSB) -#define TOP_TOP_PWDADC_SET(x) (((x) << TOP_TOP_PWDADC_LSB) & TOP_TOP_PWDADC_MASK) -#define TOP_TOP_PWDDAC_MSB 16 -#define TOP_TOP_PWDDAC_LSB 16 -#define TOP_TOP_PWDDAC_MASK 0x00010000 -#define TOP_TOP_PWDDAC_GET(x) (((x) & TOP_TOP_PWDDAC_MASK) >> TOP_TOP_PWDDAC_LSB) -#define TOP_TOP_PWDDAC_SET(x) (((x) << TOP_TOP_PWDDAC_LSB) & TOP_TOP_PWDDAC_MASK) -#define TOP_TOP_LOCALXTAL_MSB 15 -#define TOP_TOP_LOCALXTAL_LSB 15 -#define TOP_TOP_LOCALXTAL_MASK 0x00008000 -#define TOP_TOP_LOCALXTAL_GET(x) (((x) & TOP_TOP_LOCALXTAL_MASK) >> TOP_TOP_LOCALXTAL_LSB) -#define TOP_TOP_LOCALXTAL_SET(x) (((x) << TOP_TOP_LOCALXTAL_LSB) & TOP_TOP_LOCALXTAL_MASK) -#define TOP_TOP_PWDCLKIN_MSB 14 -#define TOP_TOP_PWDCLKIN_LSB 14 -#define TOP_TOP_PWDCLKIN_MASK 0x00004000 -#define TOP_TOP_PWDCLKIN_GET(x) (((x) & TOP_TOP_PWDCLKIN_MASK) >> TOP_TOP_PWDCLKIN_LSB) -#define TOP_TOP_PWDCLKIN_SET(x) (((x) << TOP_TOP_PWDCLKIN_LSB) & TOP_TOP_PWDCLKIN_MASK) -#define TOP_TOP_OSCON_MSB 13 -#define TOP_TOP_OSCON_LSB 13 -#define TOP_TOP_OSCON_MASK 0x00002000 -#define TOP_TOP_OSCON_GET(x) (((x) & TOP_TOP_OSCON_MASK) >> TOP_TOP_OSCON_LSB) -#define TOP_TOP_OSCON_SET(x) (((x) << TOP_TOP_OSCON_LSB) & TOP_TOP_OSCON_MASK) -#define TOP_TOP_SCLKEN_FORCE_MSB 12 -#define TOP_TOP_SCLKEN_FORCE_LSB 12 -#define TOP_TOP_SCLKEN_FORCE_MASK 0x00001000 -#define TOP_TOP_SCLKEN_FORCE_GET(x) (((x) & TOP_TOP_SCLKEN_FORCE_MASK) >> TOP_TOP_SCLKEN_FORCE_LSB) -#define TOP_TOP_SCLKEN_FORCE_SET(x) (((x) << TOP_TOP_SCLKEN_FORCE_LSB) & TOP_TOP_SCLKEN_FORCE_MASK) -#define TOP_TOP_SYNTHON_FORCE_MSB 11 -#define TOP_TOP_SYNTHON_FORCE_LSB 11 -#define TOP_TOP_SYNTHON_FORCE_MASK 0x00000800 -#define TOP_TOP_SYNTHON_FORCE_GET(x) (((x) & TOP_TOP_SYNTHON_FORCE_MASK) >> TOP_TOP_SYNTHON_FORCE_LSB) -#define TOP_TOP_SYNTHON_FORCE_SET(x) (((x) << TOP_TOP_SYNTHON_FORCE_LSB) & TOP_TOP_SYNTHON_FORCE_MASK) -#define TOP_TOP_PDBIAS_MSB 10 -#define TOP_TOP_PDBIAS_LSB 10 -#define TOP_TOP_PDBIAS_MASK 0x00000400 -#define TOP_TOP_PDBIAS_GET(x) (((x) & TOP_TOP_PDBIAS_MASK) >> TOP_TOP_PDBIAS_LSB) -#define TOP_TOP_PDBIAS_SET(x) (((x) << TOP_TOP_PDBIAS_LSB) & TOP_TOP_PDBIAS_MASK) -#define TOP_TOP_DATAOUTSEL_MSB 9 -#define TOP_TOP_DATAOUTSEL_LSB 8 -#define TOP_TOP_DATAOUTSEL_MASK 0x00000300 -#define TOP_TOP_DATAOUTSEL_GET(x) (((x) & TOP_TOP_DATAOUTSEL_MASK) >> TOP_TOP_DATAOUTSEL_LSB) -#define TOP_TOP_DATAOUTSEL_SET(x) (((x) << TOP_TOP_DATAOUTSEL_LSB) & TOP_TOP_DATAOUTSEL_MASK) -#define TOP_TOP_REVID_MSB 7 -#define TOP_TOP_REVID_LSB 5 -#define TOP_TOP_REVID_MASK 0x000000e0 -#define TOP_TOP_REVID_GET(x) (((x) & TOP_TOP_REVID_MASK) >> TOP_TOP_REVID_LSB) -#define TOP_TOP_REVID_SET(x) (((x) << TOP_TOP_REVID_LSB) & TOP_TOP_REVID_MASK) -#define TOP_TOP_INT2PAD_MSB 4 -#define TOP_TOP_INT2PAD_LSB 4 -#define TOP_TOP_INT2PAD_MASK 0x00000010 -#define TOP_TOP_INT2PAD_GET(x) (((x) & TOP_TOP_INT2PAD_MASK) >> TOP_TOP_INT2PAD_LSB) -#define TOP_TOP_INT2PAD_SET(x) (((x) << TOP_TOP_INT2PAD_LSB) & TOP_TOP_INT2PAD_MASK) -#define TOP_TOP_INTH2PAD_MSB 3 -#define TOP_TOP_INTH2PAD_LSB 3 -#define TOP_TOP_INTH2PAD_MASK 0x00000008 -#define TOP_TOP_INTH2PAD_GET(x) (((x) & TOP_TOP_INTH2PAD_MASK) >> TOP_TOP_INTH2PAD_LSB) -#define TOP_TOP_INTH2PAD_SET(x) (((x) << TOP_TOP_INTH2PAD_LSB) & TOP_TOP_INTH2PAD_MASK) -#define TOP_TOP_PAD2GND_MSB 2 -#define TOP_TOP_PAD2GND_LSB 2 -#define TOP_TOP_PAD2GND_MASK 0x00000004 -#define TOP_TOP_PAD2GND_GET(x) (((x) & TOP_TOP_PAD2GND_MASK) >> TOP_TOP_PAD2GND_LSB) -#define TOP_TOP_PAD2GND_SET(x) (((x) << TOP_TOP_PAD2GND_LSB) & TOP_TOP_PAD2GND_MASK) -#define TOP_TOP_INT2GND_MSB 1 -#define TOP_TOP_INT2GND_LSB 1 -#define TOP_TOP_INT2GND_MASK 0x00000002 -#define TOP_TOP_INT2GND_GET(x) (((x) & TOP_TOP_INT2GND_MASK) >> TOP_TOP_INT2GND_LSB) -#define TOP_TOP_INT2GND_SET(x) (((x) << TOP_TOP_INT2GND_LSB) & TOP_TOP_INT2GND_MASK) -#define TOP_TOP_FORCE_XPAON_MSB 0 -#define TOP_TOP_FORCE_XPAON_LSB 0 -#define TOP_TOP_FORCE_XPAON_MASK 0x00000001 -#define TOP_TOP_FORCE_XPAON_GET(x) (((x) & TOP_TOP_FORCE_XPAON_MASK) >> TOP_TOP_FORCE_XPAON_LSB) -#define TOP_TOP_FORCE_XPAON_SET(x) (((x) << TOP_TOP_FORCE_XPAON_LSB) & TOP_TOP_FORCE_XPAON_MASK) - -#define BIAS_BIAS_SEL_ADDRESS 0x00000038 -#define BIAS_BIAS_SEL_OFFSET 0x00000038 -#define BIAS_BIAS_SEL_PADON_MSB 31 -#define BIAS_BIAS_SEL_PADON_LSB 31 -#define BIAS_BIAS_SEL_PADON_MASK 0x80000000 -#define BIAS_BIAS_SEL_PADON_GET(x) (((x) & BIAS_BIAS_SEL_PADON_MASK) >> BIAS_BIAS_SEL_PADON_LSB) -#define BIAS_BIAS_SEL_PADON_SET(x) (((x) << BIAS_BIAS_SEL_PADON_LSB) & BIAS_BIAS_SEL_PADON_MASK) -#define BIAS_BIAS_SEL_SEL_BIAS_MSB 30 -#define BIAS_BIAS_SEL_SEL_BIAS_LSB 25 -#define BIAS_BIAS_SEL_SEL_BIAS_MASK 0x7e000000 -#define BIAS_BIAS_SEL_SEL_BIAS_GET(x) (((x) & BIAS_BIAS_SEL_SEL_BIAS_MASK) >> BIAS_BIAS_SEL_SEL_BIAS_LSB) -#define BIAS_BIAS_SEL_SEL_BIAS_SET(x) (((x) << BIAS_BIAS_SEL_SEL_BIAS_LSB) & BIAS_BIAS_SEL_SEL_BIAS_MASK) -#define BIAS_BIAS_SEL_SEL_SPARE_MSB 24 -#define BIAS_BIAS_SEL_SEL_SPARE_LSB 21 -#define BIAS_BIAS_SEL_SEL_SPARE_MASK 0x01e00000 -#define BIAS_BIAS_SEL_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SEL_SPARE_SET(x) (((x) << BIAS_BIAS_SEL_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_SPARE_MSB 20 -#define BIAS_BIAS_SEL_SPARE_LSB 20 -#define BIAS_BIAS_SEL_SPARE_MASK 0x00100000 -#define BIAS_BIAS_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SPARE_SET(x) (((x) << BIAS_BIAS_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MSB 19 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB 17 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK 0x000e0000 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK 0x00010000 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_SET(x) (((x) << BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK 0x00008000 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_SET(x) (((x) << BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK 0x00004000 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_LSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MASK 0x00002000 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) >> BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MSB 12 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB 10 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK 0x00001c00 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MSB 9 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_LSB 7 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MASK 0x00000380 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) >> BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MSB 6 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_LSB 4 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MASK 0x00000070 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) >> BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MSB 3 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_LSB 1 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MASK 0x0000000e -#define BIAS_BIAS_SEL_PWD_ICTXPC25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) >> BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) -#define BIAS_BIAS_SEL_PWD_ICLDO25_MSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_LSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_MASK 0x00000001 -#define BIAS_BIAS_SEL_PWD_ICLDO25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) >> BIAS_BIAS_SEL_PWD_ICLDO25_LSB) -#define BIAS_BIAS_SEL_PWD_ICLDO25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICLDO25_LSB) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) - -#define BIAS_BIAS1_ADDRESS 0x0000003c -#define BIAS_BIAS1_OFFSET 0x0000003c -#define BIAS_BIAS1_PWD_ICDAC2BB25_MSB 31 -#define BIAS_BIAS1_PWD_ICDAC2BB25_LSB 29 -#define BIAS_BIAS1_PWD_ICDAC2BB25_MASK 0xe0000000 -#define BIAS_BIAS1_PWD_ICDAC2BB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) >> BIAS_BIAS1_PWD_ICDAC2BB25_LSB) -#define BIAS_BIAS1_PWD_ICDAC2BB25_SET(x) (((x) << BIAS_BIAS1_PWD_ICDAC2BB25_LSB) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) -#define BIAS_BIAS1_PWD_IC2GVGM25_MSB 28 -#define BIAS_BIAS1_PWD_IC2GVGM25_LSB 26 -#define BIAS_BIAS1_PWD_IC2GVGM25_MASK 0x1c000000 -#define BIAS_BIAS1_PWD_IC2GVGM25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) >> BIAS_BIAS1_PWD_IC2GVGM25_LSB) -#define BIAS_BIAS1_PWD_IC2GVGM25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GVGM25_LSB) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) -#define BIAS_BIAS1_PWD_IC2GRFFE25_MSB 25 -#define BIAS_BIAS1_PWD_IC2GRFFE25_LSB 23 -#define BIAS_BIAS1_PWD_IC2GRFFE25_MASK 0x03800000 -#define BIAS_BIAS1_PWD_IC2GRFFE25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) >> BIAS_BIAS1_PWD_IC2GRFFE25_LSB) -#define BIAS_BIAS1_PWD_IC2GRFFE25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GRFFE25_LSB) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) -#define BIAS_BIAS1_PWD_IC2GLOREG25_MSB 22 -#define BIAS_BIAS1_PWD_IC2GLOREG25_LSB 20 -#define BIAS_BIAS1_PWD_IC2GLOREG25_MASK 0x00700000 -#define BIAS_BIAS1_PWD_IC2GLOREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLOREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLOREG25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GLOREG25_LSB) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MSB 19 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_LSB 17 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MASK 0x000e0000 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORB25_MSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_LSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_MASK 0x00010000 -#define BIAS_BIAS1_PWD_ICDETECTORB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORB25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORB25_SET(x) (((x) << BIAS_BIAS1_PWD_ICDETECTORB25_LSB) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORA25_MSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_LSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_MASK 0x00008000 -#define BIAS_BIAS1_PWD_ICDETECTORA25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORA25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORA25_SET(x) (((x) << BIAS_BIAS1_PWD_ICDETECTORA25_LSB) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) -#define BIAS_BIAS1_PWD_IC5GRXRF25_MSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_LSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_MASK 0x00004000 -#define BIAS_BIAS1_PWD_IC5GRXRF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) >> BIAS_BIAS1_PWD_IC5GRXRF25_LSB) -#define BIAS_BIAS1_PWD_IC5GRXRF25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GRXRF25_LSB) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXPA25_MSB 13 -#define BIAS_BIAS1_PWD_IC5GTXPA25_LSB 11 -#define BIAS_BIAS1_PWD_IC5GTXPA25_MASK 0x00003800 -#define BIAS_BIAS1_PWD_IC5GTXPA25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) >> BIAS_BIAS1_PWD_IC5GTXPA25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXPA25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GTXPA25_LSB) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MSB 10 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_LSB 8 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MASK 0x00000700 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) >> BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) -#define BIAS_BIAS1_PWD_IC5GQB25_MSB 7 -#define BIAS_BIAS1_PWD_IC5GQB25_LSB 5 -#define BIAS_BIAS1_PWD_IC5GQB25_MASK 0x000000e0 -#define BIAS_BIAS1_PWD_IC5GQB25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GQB25_MASK) >> BIAS_BIAS1_PWD_IC5GQB25_LSB) -#define BIAS_BIAS1_PWD_IC5GQB25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GQB25_LSB) & BIAS_BIAS1_PWD_IC5GQB25_MASK) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MSB 4 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_LSB 2 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MASK 0x0000001c -#define BIAS_BIAS1_PWD_IC5GMIXQ25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) >> BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) -#define BIAS_BIAS1_SPARE_MSB 1 -#define BIAS_BIAS1_SPARE_LSB 0 -#define BIAS_BIAS1_SPARE_MASK 0x00000003 -#define BIAS_BIAS1_SPARE_GET(x) (((x) & BIAS_BIAS1_SPARE_MASK) >> BIAS_BIAS1_SPARE_LSB) -#define BIAS_BIAS1_SPARE_SET(x) (((x) << BIAS_BIAS1_SPARE_LSB) & BIAS_BIAS1_SPARE_MASK) - -#define BIAS_BIAS2_ADDRESS 0x00000040 -#define BIAS_BIAS2_OFFSET 0x00000040 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MSB 31 -#define BIAS_BIAS2_PWD_IC5GMIXI25_LSB 29 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MASK 0xe0000000 -#define BIAS_BIAS2_PWD_IC5GMIXI25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) >> BIAS_BIAS2_PWD_IC5GMIXI25_LSB) -#define BIAS_BIAS2_PWD_IC5GMIXI25_SET(x) (((x) << BIAS_BIAS2_PWD_IC5GMIXI25_LSB) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) -#define BIAS_BIAS2_PWD_IC5GDIV25_MSB 28 -#define BIAS_BIAS2_PWD_IC5GDIV25_LSB 26 -#define BIAS_BIAS2_PWD_IC5GDIV25_MASK 0x1c000000 -#define BIAS_BIAS2_PWD_IC5GDIV25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) >> BIAS_BIAS2_PWD_IC5GDIV25_LSB) -#define BIAS_BIAS2_PWD_IC5GDIV25_SET(x) (((x) << BIAS_BIAS2_PWD_IC5GDIV25_LSB) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) -#define BIAS_BIAS2_PWD_IC5GLOREG25_MSB 25 -#define BIAS_BIAS2_PWD_IC5GLOREG25_LSB 23 -#define BIAS_BIAS2_PWD_IC5GLOREG25_MASK 0x03800000 -#define BIAS_BIAS2_PWD_IC5GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) >> BIAS_BIAS2_PWD_IC5GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IC5GLOREG25_SET(x) (((x) << BIAS_BIAS2_PWD_IC5GLOREG25_LSB) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IRPLL25_MSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_LSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_MASK 0x00400000 -#define BIAS_BIAS2_PWD_IRPLL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRPLL25_MASK) >> BIAS_BIAS2_PWD_IRPLL25_LSB) -#define BIAS_BIAS2_PWD_IRPLL25_SET(x) (((x) << BIAS_BIAS2_PWD_IRPLL25_LSB) & BIAS_BIAS2_PWD_IRPLL25_MASK) -#define BIAS_BIAS2_PWD_IRXTAL25_MSB 21 -#define BIAS_BIAS2_PWD_IRXTAL25_LSB 19 -#define BIAS_BIAS2_PWD_IRXTAL25_MASK 0x00380000 -#define BIAS_BIAS2_PWD_IRXTAL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRXTAL25_MASK) >> BIAS_BIAS2_PWD_IRXTAL25_LSB) -#define BIAS_BIAS2_PWD_IRXTAL25_SET(x) (((x) << BIAS_BIAS2_PWD_IRXTAL25_LSB) & BIAS_BIAS2_PWD_IRXTAL25_MASK) -#define BIAS_BIAS2_PWD_IRTSENS25_MSB 18 -#define BIAS_BIAS2_PWD_IRTSENS25_LSB 16 -#define BIAS_BIAS2_PWD_IRTSENS25_MASK 0x00070000 -#define BIAS_BIAS2_PWD_IRTSENS25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTSENS25_MASK) >> BIAS_BIAS2_PWD_IRTSENS25_LSB) -#define BIAS_BIAS2_PWD_IRTSENS25_SET(x) (((x) << BIAS_BIAS2_PWD_IRTSENS25_LSB) & BIAS_BIAS2_PWD_IRTSENS25_MASK) -#define BIAS_BIAS2_PWD_IRTXPC25_MSB 15 -#define BIAS_BIAS2_PWD_IRTXPC25_LSB 13 -#define BIAS_BIAS2_PWD_IRTXPC25_MASK 0x0000e000 -#define BIAS_BIAS2_PWD_IRTXPC25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTXPC25_MASK) >> BIAS_BIAS2_PWD_IRTXPC25_LSB) -#define BIAS_BIAS2_PWD_IRTXPC25_SET(x) (((x) << BIAS_BIAS2_PWD_IRTXPC25_LSB) & BIAS_BIAS2_PWD_IRTXPC25_MASK) -#define BIAS_BIAS2_PWD_IRLDO25_MSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_LSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_MASK 0x00001000 -#define BIAS_BIAS2_PWD_IRLDO25_GET(x) (((x) & BIAS_BIAS2_PWD_IRLDO25_MASK) >> BIAS_BIAS2_PWD_IRLDO25_LSB) -#define BIAS_BIAS2_PWD_IRLDO25_SET(x) (((x) << BIAS_BIAS2_PWD_IRLDO25_LSB) & BIAS_BIAS2_PWD_IRLDO25_MASK) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MSB 11 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_LSB 9 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MASK 0x00000e00 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) >> BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_SET(x) (((x) << BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) -#define BIAS_BIAS2_PWD_IR2GLOREG25_MSB 8 -#define BIAS_BIAS2_PWD_IR2GLOREG25_LSB 6 -#define BIAS_BIAS2_PWD_IR2GLOREG25_MASK 0x000001c0 -#define BIAS_BIAS2_PWD_IR2GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLOREG25_SET(x) (((x) << BIAS_BIAS2_PWD_IR2GLOREG25_LSB) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MSB 5 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_LSB 3 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MASK 0x00000038 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_SET(x) (((x) << BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MSB 2 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB 0 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK 0x00000007 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_GET(x) (((x) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) >> BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_SET(x) (((x) << BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) - -#define BIAS_BIAS3_ADDRESS 0x00000044 -#define BIAS_BIAS3_OFFSET 0x00000044 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MSB 31 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_LSB 29 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MASK 0xe0000000 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) >> BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) -#define BIAS_BIAS3_PWD_IR5GTXMIX25_SET(x) (((x) << BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) -#define BIAS_BIAS3_PWD_IR5GAGC25_MSB 28 -#define BIAS_BIAS3_PWD_IR5GAGC25_LSB 26 -#define BIAS_BIAS3_PWD_IR5GAGC25_MASK 0x1c000000 -#define BIAS_BIAS3_PWD_IR5GAGC25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) >> BIAS_BIAS3_PWD_IR5GAGC25_LSB) -#define BIAS_BIAS3_PWD_IR5GAGC25_SET(x) (((x) << BIAS_BIAS3_PWD_IR5GAGC25_LSB) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) -#define BIAS_BIAS3_PWD_ICDAC50_MSB 25 -#define BIAS_BIAS3_PWD_ICDAC50_LSB 23 -#define BIAS_BIAS3_PWD_ICDAC50_MASK 0x03800000 -#define BIAS_BIAS3_PWD_ICDAC50_GET(x) (((x) & BIAS_BIAS3_PWD_ICDAC50_MASK) >> BIAS_BIAS3_PWD_ICDAC50_LSB) -#define BIAS_BIAS3_PWD_ICDAC50_SET(x) (((x) << BIAS_BIAS3_PWD_ICDAC50_LSB) & BIAS_BIAS3_PWD_ICDAC50_MASK) -#define BIAS_BIAS3_PWD_ICSYNTH50_MSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_LSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_MASK 0x00400000 -#define BIAS_BIAS3_PWD_ICSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) >> BIAS_BIAS3_PWD_ICSYNTH50_LSB) -#define BIAS_BIAS3_PWD_ICSYNTH50_SET(x) (((x) << BIAS_BIAS3_PWD_ICSYNTH50_LSB) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) -#define BIAS_BIAS3_PWD_ICBB50_MSB 21 -#define BIAS_BIAS3_PWD_ICBB50_LSB 21 -#define BIAS_BIAS3_PWD_ICBB50_MASK 0x00200000 -#define BIAS_BIAS3_PWD_ICBB50_GET(x) (((x) & BIAS_BIAS3_PWD_ICBB50_MASK) >> BIAS_BIAS3_PWD_ICBB50_LSB) -#define BIAS_BIAS3_PWD_ICBB50_SET(x) (((x) << BIAS_BIAS3_PWD_ICBB50_LSB) & BIAS_BIAS3_PWD_ICBB50_MASK) -#define BIAS_BIAS3_PWD_IC2GDIV50_MSB 20 -#define BIAS_BIAS3_PWD_IC2GDIV50_LSB 18 -#define BIAS_BIAS3_PWD_IC2GDIV50_MASK 0x001c0000 -#define BIAS_BIAS3_PWD_IC2GDIV50_GET(x) (((x) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) >> BIAS_BIAS3_PWD_IC2GDIV50_LSB) -#define BIAS_BIAS3_PWD_IC2GDIV50_SET(x) (((x) << BIAS_BIAS3_PWD_IC2GDIV50_LSB) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) -#define BIAS_BIAS3_PWD_IRSYNTH50_MSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_LSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_MASK 0x00020000 -#define BIAS_BIAS3_PWD_IRSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) >> BIAS_BIAS3_PWD_IRSYNTH50_LSB) -#define BIAS_BIAS3_PWD_IRSYNTH50_SET(x) (((x) << BIAS_BIAS3_PWD_IRSYNTH50_LSB) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) -#define BIAS_BIAS3_PWD_IRBB50_MSB 16 -#define BIAS_BIAS3_PWD_IRBB50_LSB 16 -#define BIAS_BIAS3_PWD_IRBB50_MASK 0x00010000 -#define BIAS_BIAS3_PWD_IRBB50_GET(x) (((x) & BIAS_BIAS3_PWD_IRBB50_MASK) >> BIAS_BIAS3_PWD_IRBB50_LSB) -#define BIAS_BIAS3_PWD_IRBB50_SET(x) (((x) << BIAS_BIAS3_PWD_IRBB50_LSB) & BIAS_BIAS3_PWD_IRBB50_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE1_MSB 15 -#define BIAS_BIAS3_PWD_IC25SPARE1_LSB 13 -#define BIAS_BIAS3_PWD_IC25SPARE1_MASK 0x0000e000 -#define BIAS_BIAS3_PWD_IC25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) >> BIAS_BIAS3_PWD_IC25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE1_SET(x) (((x) << BIAS_BIAS3_PWD_IC25SPARE1_LSB) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE2_MSB 12 -#define BIAS_BIAS3_PWD_IC25SPARE2_LSB 10 -#define BIAS_BIAS3_PWD_IC25SPARE2_MASK 0x00001c00 -#define BIAS_BIAS3_PWD_IC25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) >> BIAS_BIAS3_PWD_IC25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE2_SET(x) (((x) << BIAS_BIAS3_PWD_IC25SPARE2_LSB) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE1_MSB 9 -#define BIAS_BIAS3_PWD_IR25SPARE1_LSB 7 -#define BIAS_BIAS3_PWD_IR25SPARE1_MASK 0x00000380 -#define BIAS_BIAS3_PWD_IR25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) >> BIAS_BIAS3_PWD_IR25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE1_SET(x) (((x) << BIAS_BIAS3_PWD_IR25SPARE1_LSB) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE2_MSB 6 -#define BIAS_BIAS3_PWD_IR25SPARE2_LSB 4 -#define BIAS_BIAS3_PWD_IR25SPARE2_MASK 0x00000070 -#define BIAS_BIAS3_PWD_IR25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) >> BIAS_BIAS3_PWD_IR25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE2_SET(x) (((x) << BIAS_BIAS3_PWD_IR25SPARE2_LSB) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) -#define BIAS_BIAS3_PWD_ICDACREG12P5_MSB 3 -#define BIAS_BIAS3_PWD_ICDACREG12P5_LSB 1 -#define BIAS_BIAS3_PWD_ICDACREG12P5_MASK 0x0000000e -#define BIAS_BIAS3_PWD_ICDACREG12P5_GET(x) (((x) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) >> BIAS_BIAS3_PWD_ICDACREG12P5_LSB) -#define BIAS_BIAS3_PWD_ICDACREG12P5_SET(x) (((x) << BIAS_BIAS3_PWD_ICDACREG12P5_LSB) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) -#define BIAS_BIAS3_SPARE_MSB 0 -#define BIAS_BIAS3_SPARE_LSB 0 -#define BIAS_BIAS3_SPARE_MASK 0x00000001 -#define BIAS_BIAS3_SPARE_GET(x) (((x) & BIAS_BIAS3_SPARE_MASK) >> BIAS_BIAS3_SPARE_LSB) -#define BIAS_BIAS3_SPARE_SET(x) (((x) << BIAS_BIAS3_SPARE_LSB) & BIAS_BIAS3_SPARE_MASK) - -#define TXPC_TXPC_ADDRESS 0x00000048 -#define TXPC_TXPC_OFFSET 0x00000048 -#define TXPC_TXPC_SELINTPD_MSB 31 -#define TXPC_TXPC_SELINTPD_LSB 31 -#define TXPC_TXPC_SELINTPD_MASK 0x80000000 -#define TXPC_TXPC_SELINTPD_GET(x) (((x) & TXPC_TXPC_SELINTPD_MASK) >> TXPC_TXPC_SELINTPD_LSB) -#define TXPC_TXPC_SELINTPD_SET(x) (((x) << TXPC_TXPC_SELINTPD_LSB) & TXPC_TXPC_SELINTPD_MASK) -#define TXPC_TXPC_TEST_MSB 30 -#define TXPC_TXPC_TEST_LSB 30 -#define TXPC_TXPC_TEST_MASK 0x40000000 -#define TXPC_TXPC_TEST_GET(x) (((x) & TXPC_TXPC_TEST_MASK) >> TXPC_TXPC_TEST_LSB) -#define TXPC_TXPC_TEST_SET(x) (((x) << TXPC_TXPC_TEST_LSB) & TXPC_TXPC_TEST_MASK) -#define TXPC_TXPC_TESTGAIN_MSB 29 -#define TXPC_TXPC_TESTGAIN_LSB 28 -#define TXPC_TXPC_TESTGAIN_MASK 0x30000000 -#define TXPC_TXPC_TESTGAIN_GET(x) (((x) & TXPC_TXPC_TESTGAIN_MASK) >> TXPC_TXPC_TESTGAIN_LSB) -#define TXPC_TXPC_TESTGAIN_SET(x) (((x) << TXPC_TXPC_TESTGAIN_LSB) & TXPC_TXPC_TESTGAIN_MASK) -#define TXPC_TXPC_TESTDAC_MSB 27 -#define TXPC_TXPC_TESTDAC_LSB 22 -#define TXPC_TXPC_TESTDAC_MASK 0x0fc00000 -#define TXPC_TXPC_TESTDAC_GET(x) (((x) & TXPC_TXPC_TESTDAC_MASK) >> TXPC_TXPC_TESTDAC_LSB) -#define TXPC_TXPC_TESTDAC_SET(x) (((x) << TXPC_TXPC_TESTDAC_LSB) & TXPC_TXPC_TESTDAC_MASK) -#define TXPC_TXPC_TESTPWDPC_MSB 21 -#define TXPC_TXPC_TESTPWDPC_LSB 21 -#define TXPC_TXPC_TESTPWDPC_MASK 0x00200000 -#define TXPC_TXPC_TESTPWDPC_GET(x) (((x) & TXPC_TXPC_TESTPWDPC_MASK) >> TXPC_TXPC_TESTPWDPC_LSB) -#define TXPC_TXPC_TESTPWDPC_SET(x) (((x) << TXPC_TXPC_TESTPWDPC_LSB) & TXPC_TXPC_TESTPWDPC_MASK) -#define TXPC_TXPC_CURHALF_MSB 20 -#define TXPC_TXPC_CURHALF_LSB 20 -#define TXPC_TXPC_CURHALF_MASK 0x00100000 -#define TXPC_TXPC_CURHALF_GET(x) (((x) & TXPC_TXPC_CURHALF_MASK) >> TXPC_TXPC_CURHALF_LSB) -#define TXPC_TXPC_CURHALF_SET(x) (((x) << TXPC_TXPC_CURHALF_LSB) & TXPC_TXPC_CURHALF_MASK) -#define TXPC_TXPC_NEGOUT_MSB 19 -#define TXPC_TXPC_NEGOUT_LSB 19 -#define TXPC_TXPC_NEGOUT_MASK 0x00080000 -#define TXPC_TXPC_NEGOUT_GET(x) (((x) & TXPC_TXPC_NEGOUT_MASK) >> TXPC_TXPC_NEGOUT_LSB) -#define TXPC_TXPC_NEGOUT_SET(x) (((x) << TXPC_TXPC_NEGOUT_LSB) & TXPC_TXPC_NEGOUT_MASK) -#define TXPC_TXPC_CLKDELAY_MSB 18 -#define TXPC_TXPC_CLKDELAY_LSB 18 -#define TXPC_TXPC_CLKDELAY_MASK 0x00040000 -#define TXPC_TXPC_CLKDELAY_GET(x) (((x) & TXPC_TXPC_CLKDELAY_MASK) >> TXPC_TXPC_CLKDELAY_LSB) -#define TXPC_TXPC_CLKDELAY_SET(x) (((x) << TXPC_TXPC_CLKDELAY_LSB) & TXPC_TXPC_CLKDELAY_MASK) -#define TXPC_TXPC_SELMODREF_MSB 17 -#define TXPC_TXPC_SELMODREF_LSB 17 -#define TXPC_TXPC_SELMODREF_MASK 0x00020000 -#define TXPC_TXPC_SELMODREF_GET(x) (((x) & TXPC_TXPC_SELMODREF_MASK) >> TXPC_TXPC_SELMODREF_LSB) -#define TXPC_TXPC_SELMODREF_SET(x) (((x) << TXPC_TXPC_SELMODREF_LSB) & TXPC_TXPC_SELMODREF_MASK) -#define TXPC_TXPC_SELCMOUT_MSB 16 -#define TXPC_TXPC_SELCMOUT_LSB 16 -#define TXPC_TXPC_SELCMOUT_MASK 0x00010000 -#define TXPC_TXPC_SELCMOUT_GET(x) (((x) & TXPC_TXPC_SELCMOUT_MASK) >> TXPC_TXPC_SELCMOUT_LSB) -#define TXPC_TXPC_SELCMOUT_SET(x) (((x) << TXPC_TXPC_SELCMOUT_LSB) & TXPC_TXPC_SELCMOUT_MASK) -#define TXPC_TXPC_TSMODE_MSB 15 -#define TXPC_TXPC_TSMODE_LSB 14 -#define TXPC_TXPC_TSMODE_MASK 0x0000c000 -#define TXPC_TXPC_TSMODE_GET(x) (((x) & TXPC_TXPC_TSMODE_MASK) >> TXPC_TXPC_TSMODE_LSB) -#define TXPC_TXPC_TSMODE_SET(x) (((x) << TXPC_TXPC_TSMODE_LSB) & TXPC_TXPC_TSMODE_MASK) -#define TXPC_TXPC_N_MSB 13 -#define TXPC_TXPC_N_LSB 6 -#define TXPC_TXPC_N_MASK 0x00003fc0 -#define TXPC_TXPC_N_GET(x) (((x) & TXPC_TXPC_N_MASK) >> TXPC_TXPC_N_LSB) -#define TXPC_TXPC_N_SET(x) (((x) << TXPC_TXPC_N_LSB) & TXPC_TXPC_N_MASK) -#define TXPC_TXPC_ON1STSYNTHON_MSB 5 -#define TXPC_TXPC_ON1STSYNTHON_LSB 5 -#define TXPC_TXPC_ON1STSYNTHON_MASK 0x00000020 -#define TXPC_TXPC_ON1STSYNTHON_GET(x) (((x) & TXPC_TXPC_ON1STSYNTHON_MASK) >> TXPC_TXPC_ON1STSYNTHON_LSB) -#define TXPC_TXPC_ON1STSYNTHON_SET(x) (((x) << TXPC_TXPC_ON1STSYNTHON_LSB) & TXPC_TXPC_ON1STSYNTHON_MASK) -#define TXPC_TXPC_SELINIT_MSB 4 -#define TXPC_TXPC_SELINIT_LSB 3 -#define TXPC_TXPC_SELINIT_MASK 0x00000018 -#define TXPC_TXPC_SELINIT_GET(x) (((x) & TXPC_TXPC_SELINIT_MASK) >> TXPC_TXPC_SELINIT_LSB) -#define TXPC_TXPC_SELINIT_SET(x) (((x) << TXPC_TXPC_SELINIT_LSB) & TXPC_TXPC_SELINIT_MASK) -#define TXPC_TXPC_SELCOUNT_MSB 2 -#define TXPC_TXPC_SELCOUNT_LSB 2 -#define TXPC_TXPC_SELCOUNT_MASK 0x00000004 -#define TXPC_TXPC_SELCOUNT_GET(x) (((x) & TXPC_TXPC_SELCOUNT_MASK) >> TXPC_TXPC_SELCOUNT_LSB) -#define TXPC_TXPC_SELCOUNT_SET(x) (((x) << TXPC_TXPC_SELCOUNT_LSB) & TXPC_TXPC_SELCOUNT_MASK) -#define TXPC_TXPC_ATBSEL_MSB 1 -#define TXPC_TXPC_ATBSEL_LSB 0 -#define TXPC_TXPC_ATBSEL_MASK 0x00000003 -#define TXPC_TXPC_ATBSEL_GET(x) (((x) & TXPC_TXPC_ATBSEL_MASK) >> TXPC_TXPC_ATBSEL_LSB) -#define TXPC_TXPC_ATBSEL_SET(x) (((x) << TXPC_TXPC_ATBSEL_LSB) & TXPC_TXPC_ATBSEL_MASK) - -#define TXPC_MISC_ADDRESS 0x0000004c -#define TXPC_MISC_OFFSET 0x0000004c -#define TXPC_MISC_FLIPBMODE_MSB 31 -#define TXPC_MISC_FLIPBMODE_LSB 31 -#define TXPC_MISC_FLIPBMODE_MASK 0x80000000 -#define TXPC_MISC_FLIPBMODE_GET(x) (((x) & TXPC_MISC_FLIPBMODE_MASK) >> TXPC_MISC_FLIPBMODE_LSB) -#define TXPC_MISC_FLIPBMODE_SET(x) (((x) << TXPC_MISC_FLIPBMODE_LSB) & TXPC_MISC_FLIPBMODE_MASK) -#define TXPC_MISC_LEVEL_MSB 30 -#define TXPC_MISC_LEVEL_LSB 29 -#define TXPC_MISC_LEVEL_MASK 0x60000000 -#define TXPC_MISC_LEVEL_GET(x) (((x) & TXPC_MISC_LEVEL_MASK) >> TXPC_MISC_LEVEL_LSB) -#define TXPC_MISC_LEVEL_SET(x) (((x) << TXPC_MISC_LEVEL_LSB) & TXPC_MISC_LEVEL_MASK) -#define TXPC_MISC_LDO_TEST_MODE_MSB 28 -#define TXPC_MISC_LDO_TEST_MODE_LSB 28 -#define TXPC_MISC_LDO_TEST_MODE_MASK 0x10000000 -#define TXPC_MISC_LDO_TEST_MODE_GET(x) (((x) & TXPC_MISC_LDO_TEST_MODE_MASK) >> TXPC_MISC_LDO_TEST_MODE_LSB) -#define TXPC_MISC_LDO_TEST_MODE_SET(x) (((x) << TXPC_MISC_LDO_TEST_MODE_LSB) & TXPC_MISC_LDO_TEST_MODE_MASK) -#define TXPC_MISC_NOTCXODET_MSB 27 -#define TXPC_MISC_NOTCXODET_LSB 27 -#define TXPC_MISC_NOTCXODET_MASK 0x08000000 -#define TXPC_MISC_NOTCXODET_GET(x) (((x) & TXPC_MISC_NOTCXODET_MASK) >> TXPC_MISC_NOTCXODET_LSB) -#define TXPC_MISC_NOTCXODET_SET(x) (((x) << TXPC_MISC_NOTCXODET_LSB) & TXPC_MISC_NOTCXODET_MASK) -#define TXPC_MISC_PWDCLKIND_MSB 26 -#define TXPC_MISC_PWDCLKIND_LSB 26 -#define TXPC_MISC_PWDCLKIND_MASK 0x04000000 -#define TXPC_MISC_PWDCLKIND_GET(x) (((x) & TXPC_MISC_PWDCLKIND_MASK) >> TXPC_MISC_PWDCLKIND_LSB) -#define TXPC_MISC_PWDCLKIND_SET(x) (((x) << TXPC_MISC_PWDCLKIND_LSB) & TXPC_MISC_PWDCLKIND_MASK) -#define TXPC_MISC_PWDXINPAD_MSB 25 -#define TXPC_MISC_PWDXINPAD_LSB 25 -#define TXPC_MISC_PWDXINPAD_MASK 0x02000000 -#define TXPC_MISC_PWDXINPAD_GET(x) (((x) & TXPC_MISC_PWDXINPAD_MASK) >> TXPC_MISC_PWDXINPAD_LSB) -#define TXPC_MISC_PWDXINPAD_SET(x) (((x) << TXPC_MISC_PWDXINPAD_LSB) & TXPC_MISC_PWDXINPAD_MASK) -#define TXPC_MISC_LOCALBIAS_MSB 24 -#define TXPC_MISC_LOCALBIAS_LSB 24 -#define TXPC_MISC_LOCALBIAS_MASK 0x01000000 -#define TXPC_MISC_LOCALBIAS_GET(x) (((x) & TXPC_MISC_LOCALBIAS_MASK) >> TXPC_MISC_LOCALBIAS_LSB) -#define TXPC_MISC_LOCALBIAS_SET(x) (((x) << TXPC_MISC_LOCALBIAS_LSB) & TXPC_MISC_LOCALBIAS_MASK) -#define TXPC_MISC_LOCALBIAS2X_MSB 23 -#define TXPC_MISC_LOCALBIAS2X_LSB 23 -#define TXPC_MISC_LOCALBIAS2X_MASK 0x00800000 -#define TXPC_MISC_LOCALBIAS2X_GET(x) (((x) & TXPC_MISC_LOCALBIAS2X_MASK) >> TXPC_MISC_LOCALBIAS2X_LSB) -#define TXPC_MISC_LOCALBIAS2X_SET(x) (((x) << TXPC_MISC_LOCALBIAS2X_LSB) & TXPC_MISC_LOCALBIAS2X_MASK) -#define TXPC_MISC_SELTSP_MSB 22 -#define TXPC_MISC_SELTSP_LSB 22 -#define TXPC_MISC_SELTSP_MASK 0x00400000 -#define TXPC_MISC_SELTSP_GET(x) (((x) & TXPC_MISC_SELTSP_MASK) >> TXPC_MISC_SELTSP_LSB) -#define TXPC_MISC_SELTSP_SET(x) (((x) << TXPC_MISC_SELTSP_LSB) & TXPC_MISC_SELTSP_MASK) -#define TXPC_MISC_SELTSN_MSB 21 -#define TXPC_MISC_SELTSN_LSB 21 -#define TXPC_MISC_SELTSN_MASK 0x00200000 -#define TXPC_MISC_SELTSN_GET(x) (((x) & TXPC_MISC_SELTSN_MASK) >> TXPC_MISC_SELTSN_LSB) -#define TXPC_MISC_SELTSN_SET(x) (((x) << TXPC_MISC_SELTSN_LSB) & TXPC_MISC_SELTSN_MASK) -#define TXPC_MISC_SPARE_A_MSB 20 -#define TXPC_MISC_SPARE_A_LSB 18 -#define TXPC_MISC_SPARE_A_MASK 0x001c0000 -#define TXPC_MISC_SPARE_A_GET(x) (((x) & TXPC_MISC_SPARE_A_MASK) >> TXPC_MISC_SPARE_A_LSB) -#define TXPC_MISC_SPARE_A_SET(x) (((x) << TXPC_MISC_SPARE_A_LSB) & TXPC_MISC_SPARE_A_MASK) -#define TXPC_MISC_DECOUT_MSB 17 -#define TXPC_MISC_DECOUT_LSB 8 -#define TXPC_MISC_DECOUT_MASK 0x0003ff00 -#define TXPC_MISC_DECOUT_GET(x) (((x) & TXPC_MISC_DECOUT_MASK) >> TXPC_MISC_DECOUT_LSB) -#define TXPC_MISC_DECOUT_SET(x) (((x) << TXPC_MISC_DECOUT_LSB) & TXPC_MISC_DECOUT_MASK) -#define TXPC_MISC_XTALDIV_MSB 7 -#define TXPC_MISC_XTALDIV_LSB 6 -#define TXPC_MISC_XTALDIV_MASK 0x000000c0 -#define TXPC_MISC_XTALDIV_GET(x) (((x) & TXPC_MISC_XTALDIV_MASK) >> TXPC_MISC_XTALDIV_LSB) -#define TXPC_MISC_XTALDIV_SET(x) (((x) << TXPC_MISC_XTALDIV_LSB) & TXPC_MISC_XTALDIV_MASK) -#define TXPC_MISC_SPARE_MSB 5 -#define TXPC_MISC_SPARE_LSB 0 -#define TXPC_MISC_SPARE_MASK 0x0000003f -#define TXPC_MISC_SPARE_GET(x) (((x) & TXPC_MISC_SPARE_MASK) >> TXPC_MISC_SPARE_LSB) -#define TXPC_MISC_SPARE_SET(x) (((x) << TXPC_MISC_SPARE_LSB) & TXPC_MISC_SPARE_MASK) - -#define RXTXBB_RXTXBB1_ADDRESS 0x00000050 -#define RXTXBB_RXTXBB1_OFFSET 0x00000050 -#define RXTXBB_RXTXBB1_SPARE_MSB 31 -#define RXTXBB_RXTXBB1_SPARE_LSB 19 -#define RXTXBB_RXTXBB1_SPARE_MASK 0xfff80000 -#define RXTXBB_RXTXBB1_SPARE_GET(x) (((x) & RXTXBB_RXTXBB1_SPARE_MASK) >> RXTXBB_RXTXBB1_SPARE_LSB) -#define RXTXBB_RXTXBB1_SPARE_SET(x) (((x) << RXTXBB_RXTXBB1_SPARE_LSB) & RXTXBB_RXTXBB1_SPARE_MASK) -#define RXTXBB_RXTXBB1_FNOTCH_MSB 18 -#define RXTXBB_RXTXBB1_FNOTCH_LSB 17 -#define RXTXBB_RXTXBB1_FNOTCH_MASK 0x00060000 -#define RXTXBB_RXTXBB1_FNOTCH_GET(x) (((x) & RXTXBB_RXTXBB1_FNOTCH_MASK) >> RXTXBB_RXTXBB1_FNOTCH_LSB) -#define RXTXBB_RXTXBB1_FNOTCH_SET(x) (((x) << RXTXBB_RXTXBB1_FNOTCH_LSB) & RXTXBB_RXTXBB1_FNOTCH_MASK) -#define RXTXBB_RXTXBB1_SEL_ATB_MSB 16 -#define RXTXBB_RXTXBB1_SEL_ATB_LSB 9 -#define RXTXBB_RXTXBB1_SEL_ATB_MASK 0x0001fe00 -#define RXTXBB_RXTXBB1_SEL_ATB_GET(x) (((x) & RXTXBB_RXTXBB1_SEL_ATB_MASK) >> RXTXBB_RXTXBB1_SEL_ATB_LSB) -#define RXTXBB_RXTXBB1_SEL_ATB_SET(x) (((x) << RXTXBB_RXTXBB1_SEL_ATB_LSB) & RXTXBB_RXTXBB1_SEL_ATB_MASK) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_LSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MASK 0x00000100 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_GET(x) (((x) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) >> RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_SET(x) (((x) << RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) -#define RXTXBB_RXTXBB1_PDV2I_MSB 7 -#define RXTXBB_RXTXBB1_PDV2I_LSB 7 -#define RXTXBB_RXTXBB1_PDV2I_MASK 0x00000080 -#define RXTXBB_RXTXBB1_PDV2I_GET(x) (((x) & RXTXBB_RXTXBB1_PDV2I_MASK) >> RXTXBB_RXTXBB1_PDV2I_LSB) -#define RXTXBB_RXTXBB1_PDV2I_SET(x) (((x) << RXTXBB_RXTXBB1_PDV2I_LSB) & RXTXBB_RXTXBB1_PDV2I_MASK) -#define RXTXBB_RXTXBB1_PDI2V_MSB 6 -#define RXTXBB_RXTXBB1_PDI2V_LSB 6 -#define RXTXBB_RXTXBB1_PDI2V_MASK 0x00000040 -#define RXTXBB_RXTXBB1_PDI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDI2V_MASK) >> RXTXBB_RXTXBB1_PDI2V_LSB) -#define RXTXBB_RXTXBB1_PDI2V_SET(x) (((x) << RXTXBB_RXTXBB1_PDI2V_LSB) & RXTXBB_RXTXBB1_PDI2V_MASK) -#define RXTXBB_RXTXBB1_PDRXTXBB_MSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_LSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_MASK 0x00000020 -#define RXTXBB_RXTXBB1_PDRXTXBB_GET(x) (((x) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) >> RXTXBB_RXTXBB1_PDRXTXBB_LSB) -#define RXTXBB_RXTXBB1_PDRXTXBB_SET(x) (((x) << RXTXBB_RXTXBB1_PDRXTXBB_LSB) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK 0x00000010 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK 0x00000008 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_LSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MASK 0x00000004 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) >> RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_SET(x) (((x) << RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) -#define RXTXBB_RXTXBB1_PDLOQ_MSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_LSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_MASK 0x00000002 -#define RXTXBB_RXTXBB1_PDLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDLOQ_MASK) >> RXTXBB_RXTXBB1_PDLOQ_LSB) -#define RXTXBB_RXTXBB1_PDLOQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDLOQ_LSB) & RXTXBB_RXTXBB1_PDLOQ_MASK) -#define RXTXBB_RXTXBB1_PDHIQ_MSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_LSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_MASK 0x00000001 -#define RXTXBB_RXTXBB1_PDHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDHIQ_MASK) >> RXTXBB_RXTXBB1_PDHIQ_LSB) -#define RXTXBB_RXTXBB1_PDHIQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDHIQ_LSB) & RXTXBB_RXTXBB1_PDHIQ_MASK) - -#define RXTXBB_RXTXBB2_ADDRESS 0x00000054 -#define RXTXBB_RXTXBB2_OFFSET 0x00000054 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MSB 31 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB 29 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK 0xe0000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_SET(x) (((x) << RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MSB 28 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB 26 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK 0x1c000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_SET(x) (((x) << RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MSB 25 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB 23 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK 0x03800000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_SET(x) (((x) << RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) -#define RXTXBB_RXTXBB2_SPARE_MSB 22 -#define RXTXBB_RXTXBB2_SPARE_LSB 21 -#define RXTXBB_RXTXBB2_SPARE_MASK 0x00600000 -#define RXTXBB_RXTXBB2_SPARE_GET(x) (((x) & RXTXBB_RXTXBB2_SPARE_MASK) >> RXTXBB_RXTXBB2_SPARE_LSB) -#define RXTXBB_RXTXBB2_SPARE_SET(x) (((x) << RXTXBB_RXTXBB2_SPARE_LSB) & RXTXBB_RXTXBB2_SPARE_MASK) -#define RXTXBB_RXTXBB2_SHORTBUFFER_MSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_LSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_MASK 0x00100000 -#define RXTXBB_RXTXBB2_SHORTBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) >> RXTXBB_RXTXBB2_SHORTBUFFER_LSB) -#define RXTXBB_RXTXBB2_SHORTBUFFER_SET(x) (((x) << RXTXBB_RXTXBB2_SHORTBUFFER_LSB) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) -#define RXTXBB_RXTXBB2_SELBUFFER_MSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_LSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_MASK 0x00080000 -#define RXTXBB_RXTXBB2_SELBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SELBUFFER_MASK) >> RXTXBB_RXTXBB2_SELBUFFER_LSB) -#define RXTXBB_RXTXBB2_SELBUFFER_SET(x) (((x) << RXTXBB_RXTXBB2_SELBUFFER_LSB) & RXTXBB_RXTXBB2_SELBUFFER_MASK) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK 0x00040000 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK 0x00020000 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK 0x00010000 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK 0x00008000 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) -#define RXTXBB_RXTXBB2_CMSEL_MSB 14 -#define RXTXBB_RXTXBB2_CMSEL_LSB 13 -#define RXTXBB_RXTXBB2_CMSEL_MASK 0x00006000 -#define RXTXBB_RXTXBB2_CMSEL_GET(x) (((x) & RXTXBB_RXTXBB2_CMSEL_MASK) >> RXTXBB_RXTXBB2_CMSEL_LSB) -#define RXTXBB_RXTXBB2_CMSEL_SET(x) (((x) << RXTXBB_RXTXBB2_CMSEL_LSB) & RXTXBB_RXTXBB2_CMSEL_MASK) -#define RXTXBB_RXTXBB2_FILTERFC_MSB 12 -#define RXTXBB_RXTXBB2_FILTERFC_LSB 8 -#define RXTXBB_RXTXBB2_FILTERFC_MASK 0x00001f00 -#define RXTXBB_RXTXBB2_FILTERFC_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERFC_MASK) >> RXTXBB_RXTXBB2_FILTERFC_LSB) -#define RXTXBB_RXTXBB2_FILTERFC_SET(x) (((x) << RXTXBB_RXTXBB2_FILTERFC_LSB) & RXTXBB_RXTXBB2_FILTERFC_MASK) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK 0x00000080 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_GET(x) (((x) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) >> RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_SET(x) (((x) << RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK 0x00000040 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) >> RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_SET(x) (((x) << RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK 0x00000020 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK 0x00000010 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK 0x00000008 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK 0x00000004 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK 0x00000002 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK 0x00000001 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_GET(x) (((x) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) >> RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_SET(x) (((x) << RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) - -#define RXTXBB_RXTXBB3_ADDRESS 0x00000058 -#define RXTXBB_RXTXBB3_OFFSET 0x00000058 -#define RXTXBB_RXTXBB3_SPARE_MSB 31 -#define RXTXBB_RXTXBB3_SPARE_LSB 27 -#define RXTXBB_RXTXBB3_SPARE_MASK 0xf8000000 -#define RXTXBB_RXTXBB3_SPARE_GET(x) (((x) & RXTXBB_RXTXBB3_SPARE_MASK) >> RXTXBB_RXTXBB3_SPARE_LSB) -#define RXTXBB_RXTXBB3_SPARE_SET(x) (((x) << RXTXBB_RXTXBB3_SPARE_LSB) & RXTXBB_RXTXBB3_SPARE_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MSB 26 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB 24 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK 0x07000000 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MSB 23 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB 21 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK 0x00e00000 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MSB 20 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB 18 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK 0x001c0000 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MSB 17 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB 15 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK 0x00038000 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MSB 14 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB 12 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK 0x00007000 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MSB 11 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB 9 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK 0x00000e00 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MSB 8 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB 6 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK 0x000001c0 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MSB 5 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB 3 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK 0x00000038 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) >> RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MSB 2 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB 0 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK 0x00000007 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) - -#define RXTXBB_RXTXBB4_ADDRESS 0x0000005c -#define RXTXBB_RXTXBB4_OFFSET 0x0000005c -#define RXTXBB_RXTXBB4_SPARE_MSB 31 -#define RXTXBB_RXTXBB4_SPARE_LSB 31 -#define RXTXBB_RXTXBB4_SPARE_MASK 0x80000000 -#define RXTXBB_RXTXBB4_SPARE_GET(x) (((x) & RXTXBB_RXTXBB4_SPARE_MASK) >> RXTXBB_RXTXBB4_SPARE_LSB) -#define RXTXBB_RXTXBB4_SPARE_SET(x) (((x) << RXTXBB_RXTXBB4_SPARE_LSB) & RXTXBB_RXTXBB4_SPARE_MASK) -#define RXTXBB_RXTXBB4_LOCALOFFSET_MSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_LSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_MASK 0x40000000 -#define RXTXBB_RXTXBB4_LOCALOFFSET_GET(x) (((x) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) >> RXTXBB_RXTXBB4_LOCALOFFSET_LSB) -#define RXTXBB_RXTXBB4_LOCALOFFSET_SET(x) (((x) << RXTXBB_RXTXBB4_LOCALOFFSET_LSB) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHII_MSB 29 -#define RXTXBB_RXTXBB4_OFSTCORRHII_LSB 25 -#define RXTXBB_RXTXBB4_OFSTCORRHII_MASK 0x3e000000 -#define RXTXBB_RXTXBB4_OFSTCORRHII_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHII_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHII_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRHII_LSB) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MSB 24 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB 20 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK 0x01f00000 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MSB 19 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_LSB 15 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MASK 0x000f8000 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MSB 14 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB 10 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK 0x00007c00 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MSB 9 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB 5 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK 0x000003e0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MSB 4 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB 0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK 0x0000001f -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) - -#define ADDAC_ADDAC1_ADDRESS 0x00000060 -#define ADDAC_ADDAC1_OFFSET 0x00000060 -#define ADDAC_ADDAC1_PLL_SVREG_MSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_LSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_MASK 0x80000000 -#define ADDAC_ADDAC1_PLL_SVREG_GET(x) (((x) & ADDAC_ADDAC1_PLL_SVREG_MASK) >> ADDAC_ADDAC1_PLL_SVREG_LSB) -#define ADDAC_ADDAC1_PLL_SVREG_SET(x) (((x) << ADDAC_ADDAC1_PLL_SVREG_LSB) & ADDAC_ADDAC1_PLL_SVREG_MASK) -#define ADDAC_ADDAC1_PLL_SCLAMP_MSB 30 -#define ADDAC_ADDAC1_PLL_SCLAMP_LSB 28 -#define ADDAC_ADDAC1_PLL_SCLAMP_MASK 0x70000000 -#define ADDAC_ADDAC1_PLL_SCLAMP_GET(x) (((x) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) >> ADDAC_ADDAC1_PLL_SCLAMP_LSB) -#define ADDAC_ADDAC1_PLL_SCLAMP_SET(x) (((x) << ADDAC_ADDAC1_PLL_SCLAMP_LSB) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) -#define ADDAC_ADDAC1_PLL_ATB_MSB 27 -#define ADDAC_ADDAC1_PLL_ATB_LSB 26 -#define ADDAC_ADDAC1_PLL_ATB_MASK 0x0c000000 -#define ADDAC_ADDAC1_PLL_ATB_GET(x) (((x) & ADDAC_ADDAC1_PLL_ATB_MASK) >> ADDAC_ADDAC1_PLL_ATB_LSB) -#define ADDAC_ADDAC1_PLL_ATB_SET(x) (((x) << ADDAC_ADDAC1_PLL_ATB_LSB) & ADDAC_ADDAC1_PLL_ATB_MASK) -#define ADDAC_ADDAC1_PLL_ICP_MSB 25 -#define ADDAC_ADDAC1_PLL_ICP_LSB 23 -#define ADDAC_ADDAC1_PLL_ICP_MASK 0x03800000 -#define ADDAC_ADDAC1_PLL_ICP_GET(x) (((x) & ADDAC_ADDAC1_PLL_ICP_MASK) >> ADDAC_ADDAC1_PLL_ICP_LSB) -#define ADDAC_ADDAC1_PLL_ICP_SET(x) (((x) << ADDAC_ADDAC1_PLL_ICP_LSB) & ADDAC_ADDAC1_PLL_ICP_MASK) -#define ADDAC_ADDAC1_PLL_FILTER_MSB 22 -#define ADDAC_ADDAC1_PLL_FILTER_LSB 15 -#define ADDAC_ADDAC1_PLL_FILTER_MASK 0x007f8000 -#define ADDAC_ADDAC1_PLL_FILTER_GET(x) (((x) & ADDAC_ADDAC1_PLL_FILTER_MASK) >> ADDAC_ADDAC1_PLL_FILTER_LSB) -#define ADDAC_ADDAC1_PLL_FILTER_SET(x) (((x) << ADDAC_ADDAC1_PLL_FILTER_LSB) & ADDAC_ADDAC1_PLL_FILTER_MASK) -#define ADDAC_ADDAC1_PWDPLL_MSB 14 -#define ADDAC_ADDAC1_PWDPLL_LSB 14 -#define ADDAC_ADDAC1_PWDPLL_MASK 0x00004000 -#define ADDAC_ADDAC1_PWDPLL_GET(x) (((x) & ADDAC_ADDAC1_PWDPLL_MASK) >> ADDAC_ADDAC1_PWDPLL_LSB) -#define ADDAC_ADDAC1_PWDPLL_SET(x) (((x) << ADDAC_ADDAC1_PWDPLL_LSB) & ADDAC_ADDAC1_PWDPLL_MASK) -#define ADDAC_ADDAC1_PWDADC_MSB 13 -#define ADDAC_ADDAC1_PWDADC_LSB 13 -#define ADDAC_ADDAC1_PWDADC_MASK 0x00002000 -#define ADDAC_ADDAC1_PWDADC_GET(x) (((x) & ADDAC_ADDAC1_PWDADC_MASK) >> ADDAC_ADDAC1_PWDADC_LSB) -#define ADDAC_ADDAC1_PWDADC_SET(x) (((x) << ADDAC_ADDAC1_PWDADC_LSB) & ADDAC_ADDAC1_PWDADC_MASK) -#define ADDAC_ADDAC1_PWDDAC_MSB 12 -#define ADDAC_ADDAC1_PWDDAC_LSB 12 -#define ADDAC_ADDAC1_PWDDAC_MASK 0x00001000 -#define ADDAC_ADDAC1_PWDDAC_GET(x) (((x) & ADDAC_ADDAC1_PWDDAC_MASK) >> ADDAC_ADDAC1_PWDDAC_LSB) -#define ADDAC_ADDAC1_PWDDAC_SET(x) (((x) << ADDAC_ADDAC1_PWDDAC_LSB) & ADDAC_ADDAC1_PWDDAC_MASK) -#define ADDAC_ADDAC1_FORCEMSBLOW_MSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_LSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_MASK 0x00000800 -#define ADDAC_ADDAC1_FORCEMSBLOW_GET(x) (((x) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) >> ADDAC_ADDAC1_FORCEMSBLOW_LSB) -#define ADDAC_ADDAC1_FORCEMSBLOW_SET(x) (((x) << ADDAC_ADDAC1_FORCEMSBLOW_LSB) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) -#define ADDAC_ADDAC1_SELMANPWDS_MSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_LSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_MASK 0x00000400 -#define ADDAC_ADDAC1_SELMANPWDS_GET(x) (((x) & ADDAC_ADDAC1_SELMANPWDS_MASK) >> ADDAC_ADDAC1_SELMANPWDS_LSB) -#define ADDAC_ADDAC1_SELMANPWDS_SET(x) (((x) << ADDAC_ADDAC1_SELMANPWDS_LSB) & ADDAC_ADDAC1_SELMANPWDS_MASK) -#define ADDAC_ADDAC1_INV_CLK160_ADC_MSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_LSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_MASK 0x00000200 -#define ADDAC_ADDAC1_INV_CLK160_ADC_GET(x) (((x) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) >> ADDAC_ADDAC1_INV_CLK160_ADC_LSB) -#define ADDAC_ADDAC1_INV_CLK160_ADC_SET(x) (((x) << ADDAC_ADDAC1_INV_CLK160_ADC_LSB) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) -#define ADDAC_ADDAC1_CM_SEL_MSB 8 -#define ADDAC_ADDAC1_CM_SEL_LSB 7 -#define ADDAC_ADDAC1_CM_SEL_MASK 0x00000180 -#define ADDAC_ADDAC1_CM_SEL_GET(x) (((x) & ADDAC_ADDAC1_CM_SEL_MASK) >> ADDAC_ADDAC1_CM_SEL_LSB) -#define ADDAC_ADDAC1_CM_SEL_SET(x) (((x) << ADDAC_ADDAC1_CM_SEL_LSB) & ADDAC_ADDAC1_CM_SEL_MASK) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_LSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MASK 0x00000040 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_GET(x) (((x) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) >> ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_SET(x) (((x) << ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) -#define ADDAC_ADDAC1_SPARE_MSB 5 -#define ADDAC_ADDAC1_SPARE_LSB 0 -#define ADDAC_ADDAC1_SPARE_MASK 0x0000003f -#define ADDAC_ADDAC1_SPARE_GET(x) (((x) & ADDAC_ADDAC1_SPARE_MASK) >> ADDAC_ADDAC1_SPARE_LSB) -#define ADDAC_ADDAC1_SPARE_SET(x) (((x) << ADDAC_ADDAC1_SPARE_LSB) & ADDAC_ADDAC1_SPARE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct analog_reg_reg_s { - volatile unsigned int synth_synth1; - volatile unsigned int synth_synth2; - volatile unsigned int synth_synth3; - volatile unsigned int synth_synth4; - volatile unsigned int synth_synth5; - volatile unsigned int synth_synth6; - volatile unsigned int synth_synth7; - volatile unsigned int synth_synth8; - volatile unsigned int rf5g_rf5g1; - volatile unsigned int rf5g_rf5g2; - volatile unsigned int rf2g_rf2g1; - volatile unsigned int rf2g_rf2g2; - volatile unsigned int top_gain; - volatile unsigned int top_top; - volatile unsigned int bias_bias_sel; - volatile unsigned int bias_bias1; - volatile unsigned int bias_bias2; - volatile unsigned int bias_bias3; - volatile unsigned int txpc_txpc; - volatile unsigned int txpc_misc; - volatile unsigned int rxtxbb_rxtxbb1; - volatile unsigned int rxtxbb_rxtxbb2; - volatile unsigned int rxtxbb_rxtxbb3; - volatile unsigned int rxtxbb_rxtxbb4; - volatile unsigned int addac_addac1; -} analog_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _ANALOG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/analog_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/analog_reg.vrh deleted file mode 100644 index 9fd2269c3b6a..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/analog_reg.vrh +++ /dev/null @@ -1,3084 +0,0 @@ -#ifndef _ANALOG_REG_VRH_ -#define _ANALOG_REG_VRH_ - -#define SYNTH_SYNTH1_ADDRESS 'h00000000 -#define SYNTH_SYNTH1_PWD_BIAS_MSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_LSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_MASK 'h80000000 -#define SYNTH_SYNTH1_PWD_BIAS_GET(x) (((x) & SYNTH_SYNTH1_PWD_BIAS_MASK) >> SYNTH_SYNTH1_PWD_BIAS_LSB) -#define SYNTH_SYNTH1_PWD_BIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_BIAS_LSB) & SYNTH_SYNTH1_PWD_BIAS_MASK) -#define SYNTH_SYNTH1_PWD_BIAS_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_CP_MSB 30 -#define SYNTH_SYNTH1_PWD_CP_LSB 30 -#define SYNTH_SYNTH1_PWD_CP_MASK 'h40000000 -#define SYNTH_SYNTH1_PWD_CP_GET(x) (((x) & SYNTH_SYNTH1_PWD_CP_MASK) >> SYNTH_SYNTH1_PWD_CP_LSB) -#define SYNTH_SYNTH1_PWD_CP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_CP_LSB) & SYNTH_SYNTH1_PWD_CP_MASK) -#define SYNTH_SYNTH1_PWD_CP_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_VCMON_MSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_LSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_MASK 'h20000000 -#define SYNTH_SYNTH1_PWD_VCMON_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCMON_MASK) >> SYNTH_SYNTH1_PWD_VCMON_LSB) -#define SYNTH_SYNTH1_PWD_VCMON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_VCMON_LSB) & SYNTH_SYNTH1_PWD_VCMON_MASK) -#define SYNTH_SYNTH1_PWD_VCMON_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_VCO_MSB 28 -#define SYNTH_SYNTH1_PWD_VCO_LSB 28 -#define SYNTH_SYNTH1_PWD_VCO_MASK 'h10000000 -#define SYNTH_SYNTH1_PWD_VCO_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCO_MASK) >> SYNTH_SYNTH1_PWD_VCO_LSB) -#define SYNTH_SYNTH1_PWD_VCO_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_VCO_LSB) & SYNTH_SYNTH1_PWD_VCO_MASK) -#define SYNTH_SYNTH1_PWD_VCO_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_PRESC_MSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_LSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_MASK 'h08000000 -#define SYNTH_SYNTH1_PWD_PRESC_GET(x) (((x) & SYNTH_SYNTH1_PWD_PRESC_MASK) >> SYNTH_SYNTH1_PWD_PRESC_LSB) -#define SYNTH_SYNTH1_PWD_PRESC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_PRESC_LSB) & SYNTH_SYNTH1_PWD_PRESC_MASK) -#define SYNTH_SYNTH1_PWD_PRESC_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_LODIV_MSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_LSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_MASK 'h04000000 -#define SYNTH_SYNTH1_PWD_LODIV_GET(x) (((x) & SYNTH_SYNTH1_PWD_LODIV_MASK) >> SYNTH_SYNTH1_PWD_LODIV_LSB) -#define SYNTH_SYNTH1_PWD_LODIV_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_LODIV_LSB) & SYNTH_SYNTH1_PWD_LODIV_MASK) -#define SYNTH_SYNTH1_PWD_LODIV_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_LOMIX_MSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_LSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_MASK 'h02000000 -#define SYNTH_SYNTH1_PWD_LOMIX_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOMIX_MASK) >> SYNTH_SYNTH1_PWD_LOMIX_LSB) -#define SYNTH_SYNTH1_PWD_LOMIX_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_LOMIX_LSB) & SYNTH_SYNTH1_PWD_LOMIX_MASK) -#define SYNTH_SYNTH1_PWD_LOMIX_RESET 1'h0 -#define SYNTH_SYNTH1_FORCE_LO_ON_MSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_LSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_MASK 'h01000000 -#define SYNTH_SYNTH1_FORCE_LO_ON_GET(x) (((x) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) >> SYNTH_SYNTH1_FORCE_LO_ON_LSB) -#define SYNTH_SYNTH1_FORCE_LO_ON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_FORCE_LO_ON_LSB) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) -#define SYNTH_SYNTH1_FORCE_LO_ON_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_LOBUF5G_MSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_LSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_MASK 'h00800000 -#define SYNTH_SYNTH1_PWD_LOBUF5G_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) >> SYNTH_SYNTH1_PWD_LOBUF5G_LSB) -#define SYNTH_SYNTH1_PWD_LOBUF5G_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_LOBUF5G_LSB) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) -#define SYNTH_SYNTH1_PWD_LOBUF5G_RESET 1'h0 -#define SYNTH_SYNTH1_VCOREGBYPASS_MSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_LSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_MASK 'h00400000 -#define SYNTH_SYNTH1_VCOREGBYPASS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) >> SYNTH_SYNTH1_VCOREGBYPASS_LSB) -#define SYNTH_SYNTH1_VCOREGBYPASS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_VCOREGBYPASS_LSB) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) -#define SYNTH_SYNTH1_VCOREGBYPASS_RESET 1'h1 -#define SYNTH_SYNTH1_VCOREGLEVEL_MSB 21 -#define SYNTH_SYNTH1_VCOREGLEVEL_LSB 20 -#define SYNTH_SYNTH1_VCOREGLEVEL_MASK 'h00300000 -#define SYNTH_SYNTH1_VCOREGLEVEL_GET(x) (((x) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) >> SYNTH_SYNTH1_VCOREGLEVEL_LSB) -#define SYNTH_SYNTH1_VCOREGLEVEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_VCOREGLEVEL_LSB) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) -#define SYNTH_SYNTH1_VCOREGLEVEL_RESET 2'h1 -#define SYNTH_SYNTH1_VCOREGBIAS_MSB 19 -#define SYNTH_SYNTH1_VCOREGBIAS_LSB 18 -#define SYNTH_SYNTH1_VCOREGBIAS_MASK 'h000c0000 -#define SYNTH_SYNTH1_VCOREGBIAS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBIAS_MASK) >> SYNTH_SYNTH1_VCOREGBIAS_LSB) -#define SYNTH_SYNTH1_VCOREGBIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_VCOREGBIAS_LSB) & SYNTH_SYNTH1_VCOREGBIAS_MASK) -#define SYNTH_SYNTH1_VCOREGBIAS_RESET 2'h1 -#define SYNTH_SYNTH1_SLIDINGIF_MSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_LSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_MASK 'h00020000 -#define SYNTH_SYNTH1_SLIDINGIF_GET(x) (((x) & SYNTH_SYNTH1_SLIDINGIF_MASK) >> SYNTH_SYNTH1_SLIDINGIF_LSB) -#define SYNTH_SYNTH1_SLIDINGIF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_SLIDINGIF_LSB) & SYNTH_SYNTH1_SLIDINGIF_MASK) -#define SYNTH_SYNTH1_SLIDINGIF_RESET 1'h0 -#define SYNTH_SYNTH1_SPARE_PWD_MSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_LSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_MASK 'h00010000 -#define SYNTH_SYNTH1_SPARE_PWD_GET(x) (((x) & SYNTH_SYNTH1_SPARE_PWD_MASK) >> SYNTH_SYNTH1_SPARE_PWD_LSB) -#define SYNTH_SYNTH1_SPARE_PWD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_SPARE_PWD_LSB) & SYNTH_SYNTH1_SPARE_PWD_MASK) -#define SYNTH_SYNTH1_SPARE_PWD_RESET 1'h0 -#define SYNTH_SYNTH1_CON_VDDVCOREG_MSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_LSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_MASK 'h00008000 -#define SYNTH_SYNTH1_CON_VDDVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) >> SYNTH_SYNTH1_CON_VDDVCOREG_LSB) -#define SYNTH_SYNTH1_CON_VDDVCOREG_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_CON_VDDVCOREG_LSB) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) -#define SYNTH_SYNTH1_CON_VDDVCOREG_RESET 1'h0 -#define SYNTH_SYNTH1_CON_IVCOREG_MSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_LSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_MASK 'h00004000 -#define SYNTH_SYNTH1_CON_IVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOREG_MASK) >> SYNTH_SYNTH1_CON_IVCOREG_LSB) -#define SYNTH_SYNTH1_CON_IVCOREG_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_CON_IVCOREG_LSB) & SYNTH_SYNTH1_CON_IVCOREG_MASK) -#define SYNTH_SYNTH1_CON_IVCOREG_RESET 1'h0 -#define SYNTH_SYNTH1_CON_IVCOBUF_MSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_LSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_MASK 'h00002000 -#define SYNTH_SYNTH1_CON_IVCOBUF_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) >> SYNTH_SYNTH1_CON_IVCOBUF_LSB) -#define SYNTH_SYNTH1_CON_IVCOBUF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_CON_IVCOBUF_LSB) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) -#define SYNTH_SYNTH1_CON_IVCOBUF_RESET 1'h0 -#define SYNTH_SYNTH1_SEL_VCMONABUS_MSB 12 -#define SYNTH_SYNTH1_SEL_VCMONABUS_LSB 10 -#define SYNTH_SYNTH1_SEL_VCMONABUS_MASK 'h00001c00 -#define SYNTH_SYNTH1_SEL_VCMONABUS_GET(x) (((x) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) >> SYNTH_SYNTH1_SEL_VCMONABUS_LSB) -#define SYNTH_SYNTH1_SEL_VCMONABUS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_SEL_VCMONABUS_LSB) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) -#define SYNTH_SYNTH1_SEL_VCMONABUS_RESET 3'h0 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK 'h00000200 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) >> SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_RESET 1'h0 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_LSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MASK 'h00000100 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) >> SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_RESET 1'h0 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK 'h00000080 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_RESET 1'h0 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK 'h00000040 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_FB_MSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_LSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_MASK 'h00000020 -#define SYNTH_SYNTH1_MONITOR_FB_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_MASK) >> SYNTH_SYNTH1_MONITOR_FB_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_FB_LSB) & SYNTH_SYNTH1_MONITOR_FB_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_REF_MSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_LSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_MASK 'h00000010 -#define SYNTH_SYNTH1_MONITOR_REF_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_REF_MASK) >> SYNTH_SYNTH1_MONITOR_REF_LSB) -#define SYNTH_SYNTH1_MONITOR_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_REF_LSB) & SYNTH_SYNTH1_MONITOR_REF_MASK) -#define SYNTH_SYNTH1_MONITOR_REF_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK 'h00000008 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) >> SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK 'h00000004 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) >> SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_LSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MASK 'h00000002 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) >> SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK 'h00000001 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) >> SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_RESET 1'h0 -#define SYNTH_SYNTH1_RESET (32'h0 | \ - SYNTH_SYNTH1_PWD_BIAS_SET(SYNTH_SYNTH1_PWD_BIAS_RESET) | \ - SYNTH_SYNTH1_PWD_CP_SET(SYNTH_SYNTH1_PWD_CP_RESET) | \ - SYNTH_SYNTH1_PWD_VCMON_SET(SYNTH_SYNTH1_PWD_VCMON_RESET) | \ - SYNTH_SYNTH1_PWD_VCO_SET(SYNTH_SYNTH1_PWD_VCO_RESET) | \ - SYNTH_SYNTH1_PWD_PRESC_SET(SYNTH_SYNTH1_PWD_PRESC_RESET) | \ - SYNTH_SYNTH1_PWD_LODIV_SET(SYNTH_SYNTH1_PWD_LODIV_RESET) | \ - SYNTH_SYNTH1_PWD_LOMIX_SET(SYNTH_SYNTH1_PWD_LOMIX_RESET) | \ - SYNTH_SYNTH1_FORCE_LO_ON_SET(SYNTH_SYNTH1_FORCE_LO_ON_RESET) | \ - SYNTH_SYNTH1_PWD_LOBUF5G_SET(SYNTH_SYNTH1_PWD_LOBUF5G_RESET) | \ - SYNTH_SYNTH1_VCOREGBYPASS_SET(SYNTH_SYNTH1_VCOREGBYPASS_RESET) | \ - SYNTH_SYNTH1_VCOREGLEVEL_SET(SYNTH_SYNTH1_VCOREGLEVEL_RESET) | \ - SYNTH_SYNTH1_VCOREGBIAS_SET(SYNTH_SYNTH1_VCOREGBIAS_RESET) | \ - SYNTH_SYNTH1_SLIDINGIF_SET(SYNTH_SYNTH1_SLIDINGIF_RESET) | \ - SYNTH_SYNTH1_SPARE_PWD_SET(SYNTH_SYNTH1_SPARE_PWD_RESET) | \ - SYNTH_SYNTH1_CON_VDDVCOREG_SET(SYNTH_SYNTH1_CON_VDDVCOREG_RESET) | \ - SYNTH_SYNTH1_CON_IVCOREG_SET(SYNTH_SYNTH1_CON_IVCOREG_RESET) | \ - SYNTH_SYNTH1_CON_IVCOBUF_SET(SYNTH_SYNTH1_CON_IVCOBUF_RESET) | \ - SYNTH_SYNTH1_SEL_VCMONABUS_SET(SYNTH_SYNTH1_SEL_VCMONABUS_RESET) | \ - SYNTH_SYNTH1_PWUP_VCOBUF_PD_SET(SYNTH_SYNTH1_PWUP_VCOBUF_PD_RESET) | \ - SYNTH_SYNTH1_PWUP_LODIV_PD_SET(SYNTH_SYNTH1_PWUP_LODIV_PD_RESET) | \ - SYNTH_SYNTH1_PWUP_LOMIX_PD_SET(SYNTH_SYNTH1_PWUP_LOMIX_PD_RESET) | \ - SYNTH_SYNTH1_PWUP_LOBUF5G_PD_SET(SYNTH_SYNTH1_PWUP_LOBUF5G_PD_RESET) | \ - SYNTH_SYNTH1_MONITOR_FB_SET(SYNTH_SYNTH1_MONITOR_FB_RESET) | \ - SYNTH_SYNTH1_MONITOR_REF_SET(SYNTH_SYNTH1_MONITOR_REF_RESET) | \ - SYNTH_SYNTH1_MONITOR_FB_DIV2_SET(SYNTH_SYNTH1_MONITOR_FB_DIV2_RESET) | \ - SYNTH_SYNTH1_MONITOR_VC2HIGH_SET(SYNTH_SYNTH1_MONITOR_VC2HIGH_RESET) | \ - SYNTH_SYNTH1_MONITOR_VC2LOW_SET(SYNTH_SYNTH1_MONITOR_VC2LOW_RESET) | \ - SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_SET(SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_RESET)) -#define SYNTH_SYNTH1_HW_MASK (32'h0) -#define SYNTH_SYNTH1_SW_MASK (32'h0 | \ - SYNTH_SYNTH1_PWD_BIAS_MASK | \ - SYNTH_SYNTH1_PWD_CP_MASK | \ - SYNTH_SYNTH1_PWD_VCMON_MASK | \ - SYNTH_SYNTH1_PWD_VCO_MASK | \ - SYNTH_SYNTH1_PWD_PRESC_MASK | \ - SYNTH_SYNTH1_PWD_LODIV_MASK | \ - SYNTH_SYNTH1_PWD_LOMIX_MASK | \ - SYNTH_SYNTH1_FORCE_LO_ON_MASK | \ - SYNTH_SYNTH1_PWD_LOBUF5G_MASK | \ - SYNTH_SYNTH1_VCOREGBYPASS_MASK | \ - SYNTH_SYNTH1_VCOREGLEVEL_MASK | \ - SYNTH_SYNTH1_VCOREGBIAS_MASK | \ - SYNTH_SYNTH1_SLIDINGIF_MASK | \ - SYNTH_SYNTH1_SPARE_PWD_MASK | \ - SYNTH_SYNTH1_CON_VDDVCOREG_MASK | \ - SYNTH_SYNTH1_CON_IVCOREG_MASK | \ - SYNTH_SYNTH1_CON_IVCOBUF_MASK | \ - SYNTH_SYNTH1_SEL_VCMONABUS_MASK | \ - SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK | \ - SYNTH_SYNTH1_PWUP_LODIV_PD_MASK | \ - SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK | \ - SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK | \ - SYNTH_SYNTH1_MONITOR_FB_MASK | \ - SYNTH_SYNTH1_MONITOR_REF_MASK | \ - SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK | \ - SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK | \ - SYNTH_SYNTH1_MONITOR_VC2LOW_MASK | \ - SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) - -#define SYNTH_SYNTH2_ADDRESS 'h00000004 -#define SYNTH_SYNTH2_VC_CAL_REF_MSB 31 -#define SYNTH_SYNTH2_VC_CAL_REF_LSB 29 -#define SYNTH_SYNTH2_VC_CAL_REF_MASK 'he0000000 -#define SYNTH_SYNTH2_VC_CAL_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_CAL_REF_MASK) >> SYNTH_SYNTH2_VC_CAL_REF_LSB) -#define SYNTH_SYNTH2_VC_CAL_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_CAL_REF_LSB) & SYNTH_SYNTH2_VC_CAL_REF_MASK) -#define SYNTH_SYNTH2_VC_CAL_REF_RESET 3'h0 -#define SYNTH_SYNTH2_VC_HI_REF_MSB 28 -#define SYNTH_SYNTH2_VC_HI_REF_LSB 26 -#define SYNTH_SYNTH2_VC_HI_REF_MASK 'h1c000000 -#define SYNTH_SYNTH2_VC_HI_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_HI_REF_MASK) >> SYNTH_SYNTH2_VC_HI_REF_LSB) -#define SYNTH_SYNTH2_VC_HI_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_HI_REF_LSB) & SYNTH_SYNTH2_VC_HI_REF_MASK) -#define SYNTH_SYNTH2_VC_HI_REF_RESET 3'h3 -#define SYNTH_SYNTH2_VC_MID_REF_MSB 25 -#define SYNTH_SYNTH2_VC_MID_REF_LSB 23 -#define SYNTH_SYNTH2_VC_MID_REF_MASK 'h03800000 -#define SYNTH_SYNTH2_VC_MID_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_MID_REF_MASK) >> SYNTH_SYNTH2_VC_MID_REF_LSB) -#define SYNTH_SYNTH2_VC_MID_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_MID_REF_LSB) & SYNTH_SYNTH2_VC_MID_REF_MASK) -#define SYNTH_SYNTH2_VC_MID_REF_RESET 3'h4 -#define SYNTH_SYNTH2_VC_LOW_REF_MSB 22 -#define SYNTH_SYNTH2_VC_LOW_REF_LSB 20 -#define SYNTH_SYNTH2_VC_LOW_REF_MASK 'h00700000 -#define SYNTH_SYNTH2_VC_LOW_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_LOW_REF_MASK) >> SYNTH_SYNTH2_VC_LOW_REF_LSB) -#define SYNTH_SYNTH2_VC_LOW_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_LOW_REF_LSB) & SYNTH_SYNTH2_VC_LOW_REF_MASK) -#define SYNTH_SYNTH2_VC_LOW_REF_RESET 3'h4 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MSB 19 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB 15 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK 'h000f8000 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_GET(x) (((x) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) >> SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_RESET 5'h8 -#define SYNTH_SYNTH2_LOOP_CP_MSB 14 -#define SYNTH_SYNTH2_LOOP_CP_LSB 10 -#define SYNTH_SYNTH2_LOOP_CP_MASK 'h00007c00 -#define SYNTH_SYNTH2_LOOP_CP_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CP_MASK) >> SYNTH_SYNTH2_LOOP_CP_LSB) -#define SYNTH_SYNTH2_LOOP_CP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_CP_LSB) & SYNTH_SYNTH2_LOOP_CP_MASK) -#define SYNTH_SYNTH2_LOOP_CP_RESET 5'h8 -#define SYNTH_SYNTH2_LOOP_RS_MSB 9 -#define SYNTH_SYNTH2_LOOP_RS_LSB 5 -#define SYNTH_SYNTH2_LOOP_RS_MASK 'h000003e0 -#define SYNTH_SYNTH2_LOOP_RS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_RS_MASK) >> SYNTH_SYNTH2_LOOP_RS_LSB) -#define SYNTH_SYNTH2_LOOP_RS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_RS_LSB) & SYNTH_SYNTH2_LOOP_RS_MASK) -#define SYNTH_SYNTH2_LOOP_RS_RESET 5'h5 -#define SYNTH_SYNTH2_LOOP_CS_MSB 4 -#define SYNTH_SYNTH2_LOOP_CS_LSB 3 -#define SYNTH_SYNTH2_LOOP_CS_MASK 'h00000018 -#define SYNTH_SYNTH2_LOOP_CS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CS_MASK) >> SYNTH_SYNTH2_LOOP_CS_LSB) -#define SYNTH_SYNTH2_LOOP_CS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_CS_LSB) & SYNTH_SYNTH2_LOOP_CS_MASK) -#define SYNTH_SYNTH2_LOOP_CS_RESET 2'h3 -#define SYNTH_SYNTH2_SPARE_BITS_MSB 2 -#define SYNTH_SYNTH2_SPARE_BITS_LSB 0 -#define SYNTH_SYNTH2_SPARE_BITS_MASK 'h00000007 -#define SYNTH_SYNTH2_SPARE_BITS_GET(x) (((x) & SYNTH_SYNTH2_SPARE_BITS_MASK) >> SYNTH_SYNTH2_SPARE_BITS_LSB) -#define SYNTH_SYNTH2_SPARE_BITS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_SPARE_BITS_LSB) & SYNTH_SYNTH2_SPARE_BITS_MASK) -#define SYNTH_SYNTH2_SPARE_BITS_RESET 3'h0 -#define SYNTH_SYNTH2_RESET (32'h0 | \ - SYNTH_SYNTH2_VC_CAL_REF_SET(SYNTH_SYNTH2_VC_CAL_REF_RESET) | \ - SYNTH_SYNTH2_VC_HI_REF_SET(SYNTH_SYNTH2_VC_HI_REF_RESET) | \ - SYNTH_SYNTH2_VC_MID_REF_SET(SYNTH_SYNTH2_VC_MID_REF_RESET) | \ - SYNTH_SYNTH2_VC_LOW_REF_SET(SYNTH_SYNTH2_VC_LOW_REF_RESET) | \ - SYNTH_SYNTH2_LOOP_3RD_ORDER_R_SET(SYNTH_SYNTH2_LOOP_3RD_ORDER_R_RESET) | \ - SYNTH_SYNTH2_LOOP_CP_SET(SYNTH_SYNTH2_LOOP_CP_RESET) | \ - SYNTH_SYNTH2_LOOP_RS_SET(SYNTH_SYNTH2_LOOP_RS_RESET) | \ - SYNTH_SYNTH2_LOOP_CS_SET(SYNTH_SYNTH2_LOOP_CS_RESET) | \ - SYNTH_SYNTH2_SPARE_BITS_SET(SYNTH_SYNTH2_SPARE_BITS_RESET)) -#define SYNTH_SYNTH2_HW_MASK (32'h0) -#define SYNTH_SYNTH2_SW_MASK (32'h0 | \ - SYNTH_SYNTH2_VC_CAL_REF_MASK | \ - SYNTH_SYNTH2_VC_HI_REF_MASK | \ - SYNTH_SYNTH2_VC_MID_REF_MASK | \ - SYNTH_SYNTH2_VC_LOW_REF_MASK | \ - SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK | \ - SYNTH_SYNTH2_LOOP_CP_MASK | \ - SYNTH_SYNTH2_LOOP_RS_MASK | \ - SYNTH_SYNTH2_LOOP_CS_MASK | \ - SYNTH_SYNTH2_SPARE_BITS_MASK) - -#define SYNTH_SYNTH3_ADDRESS 'h00000008 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_LSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MASK 'h80000000 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_GET(x) (((x) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) >> SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) -#define SYNTH_SYNTH3_DIS_CLK_XTAL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) -#define SYNTH_SYNTH3_DIS_CLK_XTAL_RESET 1'h0 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_LSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MASK 'h40000000 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_GET(x) (((x) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) >> SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_RESET 1'h1 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MSB 29 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB 24 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK 'h3f000000 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_RESET 6'h14 -#define SYNTH_SYNTH3_WAIT_PWRUP_MSB 23 -#define SYNTH_SYNTH3_WAIT_PWRUP_LSB 18 -#define SYNTH_SYNTH3_WAIT_PWRUP_MASK 'h00fc0000 -#define SYNTH_SYNTH3_WAIT_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_PWRUP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_PWRUP_RESET 6'h8 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MSB 17 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_LSB 12 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MASK 'h0003f000 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_RESET 6'h14 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MSB 11 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_LSB 6 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MASK 'h00000fc0 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_RESET 6'h14 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MSB 5 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_LSB 0 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MASK 'h0000003f -#define SYNTH_SYNTH3_WAIT_VC_CHECK_GET(x) (((x) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) >> SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_RESET 6'h14 -#define SYNTH_SYNTH3_RESET (32'h0 | \ - SYNTH_SYNTH3_DIS_CLK_XTAL_SET(SYNTH_SYNTH3_DIS_CLK_XTAL_RESET) | \ - SYNTH_SYNTH3_SEL_CLK_DIV2_SET(SYNTH_SYNTH3_SEL_CLK_DIV2_RESET) | \ - SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_SET(SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_RESET) | \ - SYNTH_SYNTH3_WAIT_PWRUP_SET(SYNTH_SYNTH3_WAIT_PWRUP_RESET) | \ - SYNTH_SYNTH3_WAIT_CAL_BIN_SET(SYNTH_SYNTH3_WAIT_CAL_BIN_RESET) | \ - SYNTH_SYNTH3_WAIT_CAL_LIN_SET(SYNTH_SYNTH3_WAIT_CAL_LIN_RESET) | \ - SYNTH_SYNTH3_WAIT_VC_CHECK_SET(SYNTH_SYNTH3_WAIT_VC_CHECK_RESET)) -#define SYNTH_SYNTH3_HW_MASK (32'h0) -#define SYNTH_SYNTH3_SW_MASK (32'h0 | \ - SYNTH_SYNTH3_DIS_CLK_XTAL_MASK | \ - SYNTH_SYNTH3_SEL_CLK_DIV2_MASK | \ - SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK | \ - SYNTH_SYNTH3_WAIT_PWRUP_MASK | \ - SYNTH_SYNTH3_WAIT_CAL_BIN_MASK | \ - SYNTH_SYNTH3_WAIT_CAL_LIN_MASK | \ - SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) - -#define SYNTH_SYNTH4_ADDRESS 'h0000000c -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK 'h80000000 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_GET(x) (((x) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) >> SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_RESET 1'h0 -#define SYNTH_SYNTH4_DIS_LOSTVC_MSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_LSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_MASK 'h40000000 -#define SYNTH_SYNTH4_DIS_LOSTVC_GET(x) (((x) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) >> SYNTH_SYNTH4_DIS_LOSTVC_LSB) -#define SYNTH_SYNTH4_DIS_LOSTVC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_DIS_LOSTVC_LSB) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) -#define SYNTH_SYNTH4_DIS_LOSTVC_RESET 1'h0 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_LSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MASK 'h20000000 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_GET(x) (((x) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) >> SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_RESET 1'h0 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK 'h10000000 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_GET(x) (((x) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) >> SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_RESET 1'h1 -#define SYNTH_SYNTH4_FORCE_PINVC_MSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_LSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_MASK 'h08000000 -#define SYNTH_SYNTH4_FORCE_PINVC_GET(x) (((x) & SYNTH_SYNTH4_FORCE_PINVC_MASK) >> SYNTH_SYNTH4_FORCE_PINVC_LSB) -#define SYNTH_SYNTH4_FORCE_PINVC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_FORCE_PINVC_LSB) & SYNTH_SYNTH4_FORCE_PINVC_MASK) -#define SYNTH_SYNTH4_FORCE_PINVC_RESET 1'h0 -#define SYNTH_SYNTH4_FORCE_VCOCAP_MSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_LSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_MASK 'h04000000 -#define SYNTH_SYNTH4_FORCE_VCOCAP_GET(x) (((x) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) >> SYNTH_SYNTH4_FORCE_VCOCAP_LSB) -#define SYNTH_SYNTH4_FORCE_VCOCAP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_FORCE_VCOCAP_LSB) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) -#define SYNTH_SYNTH4_FORCE_VCOCAP_RESET 1'h0 -#define SYNTH_SYNTH4_VCOCAP_OVR_MSB 25 -#define SYNTH_SYNTH4_VCOCAP_OVR_LSB 18 -#define SYNTH_SYNTH4_VCOCAP_OVR_MASK 'h03fc0000 -#define SYNTH_SYNTH4_VCOCAP_OVR_GET(x) (((x) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) >> SYNTH_SYNTH4_VCOCAP_OVR_LSB) -#define SYNTH_SYNTH4_VCOCAP_OVR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_VCOCAP_OVR_LSB) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) -#define SYNTH_SYNTH4_VCOCAP_OVR_RESET 8'h80 -#define SYNTH_SYNTH4_VCOCAPPULLUP_MSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_LSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_MASK 'h00020000 -#define SYNTH_SYNTH4_VCOCAPPULLUP_GET(x) (((x) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) >> SYNTH_SYNTH4_VCOCAPPULLUP_LSB) -#define SYNTH_SYNTH4_VCOCAPPULLUP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_VCOCAPPULLUP_LSB) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) -#define SYNTH_SYNTH4_VCOCAPPULLUP_RESET 1'h1 -#define SYNTH_SYNTH4_REFDIVSEL_MSB 16 -#define SYNTH_SYNTH4_REFDIVSEL_LSB 15 -#define SYNTH_SYNTH4_REFDIVSEL_MASK 'h00018000 -#define SYNTH_SYNTH4_REFDIVSEL_GET(x) (((x) & SYNTH_SYNTH4_REFDIVSEL_MASK) >> SYNTH_SYNTH4_REFDIVSEL_LSB) -#define SYNTH_SYNTH4_REFDIVSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_REFDIVSEL_LSB) & SYNTH_SYNTH4_REFDIVSEL_MASK) -#define SYNTH_SYNTH4_REFDIVSEL_RESET 2'h0 -#define SYNTH_SYNTH4_PFDDELAY_MSB 14 -#define SYNTH_SYNTH4_PFDDELAY_LSB 14 -#define SYNTH_SYNTH4_PFDDELAY_MASK 'h00004000 -#define SYNTH_SYNTH4_PFDDELAY_GET(x) (((x) & SYNTH_SYNTH4_PFDDELAY_MASK) >> SYNTH_SYNTH4_PFDDELAY_LSB) -#define SYNTH_SYNTH4_PFDDELAY_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PFDDELAY_LSB) & SYNTH_SYNTH4_PFDDELAY_MASK) -#define SYNTH_SYNTH4_PFDDELAY_RESET 1'h1 -#define SYNTH_SYNTH4_PFD_DISABLE_MSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_LSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_MASK 'h00002000 -#define SYNTH_SYNTH4_PFD_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_PFD_DISABLE_MASK) >> SYNTH_SYNTH4_PFD_DISABLE_LSB) -#define SYNTH_SYNTH4_PFD_DISABLE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PFD_DISABLE_LSB) & SYNTH_SYNTH4_PFD_DISABLE_MASK) -#define SYNTH_SYNTH4_PFD_DISABLE_RESET 1'h0 -#define SYNTH_SYNTH4_PRESCSEL_MSB 12 -#define SYNTH_SYNTH4_PRESCSEL_LSB 11 -#define SYNTH_SYNTH4_PRESCSEL_MASK 'h00001800 -#define SYNTH_SYNTH4_PRESCSEL_GET(x) (((x) & SYNTH_SYNTH4_PRESCSEL_MASK) >> SYNTH_SYNTH4_PRESCSEL_LSB) -#define SYNTH_SYNTH4_PRESCSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PRESCSEL_LSB) & SYNTH_SYNTH4_PRESCSEL_MASK) -#define SYNTH_SYNTH4_PRESCSEL_RESET 2'h3 -#define SYNTH_SYNTH4_RESET_PRESC_MSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_LSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_MASK 'h00000400 -#define SYNTH_SYNTH4_RESET_PRESC_GET(x) (((x) & SYNTH_SYNTH4_RESET_PRESC_MASK) >> SYNTH_SYNTH4_RESET_PRESC_LSB) -#define SYNTH_SYNTH4_RESET_PRESC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_RESET_PRESC_LSB) & SYNTH_SYNTH4_RESET_PRESC_MASK) -#define SYNTH_SYNTH4_RESET_PRESC_RESET 1'h0 -#define SYNTH_SYNTH4_SDM_DISABLE_MSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_LSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_MASK 'h00000200 -#define SYNTH_SYNTH4_SDM_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_SDM_DISABLE_MASK) >> SYNTH_SYNTH4_SDM_DISABLE_LSB) -#define SYNTH_SYNTH4_SDM_DISABLE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SDM_DISABLE_LSB) & SYNTH_SYNTH4_SDM_DISABLE_MASK) -#define SYNTH_SYNTH4_SDM_DISABLE_RESET 1'h0 -#define SYNTH_SYNTH4_SDM_MODE_MSB 8 -#define SYNTH_SYNTH4_SDM_MODE_LSB 8 -#define SYNTH_SYNTH4_SDM_MODE_MASK 'h00000100 -#define SYNTH_SYNTH4_SDM_MODE_GET(x) (((x) & SYNTH_SYNTH4_SDM_MODE_MASK) >> SYNTH_SYNTH4_SDM_MODE_LSB) -#define SYNTH_SYNTH4_SDM_MODE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SDM_MODE_LSB) & SYNTH_SYNTH4_SDM_MODE_MASK) -#define SYNTH_SYNTH4_SDM_MODE_RESET 1'h0 -#define SYNTH_SYNTH4_SDM_DITHER_MSB 7 -#define SYNTH_SYNTH4_SDM_DITHER_LSB 6 -#define SYNTH_SYNTH4_SDM_DITHER_MASK 'h000000c0 -#define SYNTH_SYNTH4_SDM_DITHER_GET(x) (((x) & SYNTH_SYNTH4_SDM_DITHER_MASK) >> SYNTH_SYNTH4_SDM_DITHER_LSB) -#define SYNTH_SYNTH4_SDM_DITHER_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SDM_DITHER_LSB) & SYNTH_SYNTH4_SDM_DITHER_MASK) -#define SYNTH_SYNTH4_SDM_DITHER_RESET 2'h0 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK 'h00000020 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_GET(x) (((x) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) >> SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_RESET 1'h0 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK 'h00000010 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_GET(x) (((x) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) >> SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_RESET 1'h0 -#define SYNTH_SYNTH4_SPARE_MISC_MSB 3 -#define SYNTH_SYNTH4_SPARE_MISC_LSB 2 -#define SYNTH_SYNTH4_SPARE_MISC_MASK 'h0000000c -#define SYNTH_SYNTH4_SPARE_MISC_GET(x) (((x) & SYNTH_SYNTH4_SPARE_MISC_MASK) >> SYNTH_SYNTH4_SPARE_MISC_LSB) -#define SYNTH_SYNTH4_SPARE_MISC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SPARE_MISC_LSB) & SYNTH_SYNTH4_SPARE_MISC_MASK) -#define SYNTH_SYNTH4_SPARE_MISC_RESET 2'h0 -#define SYNTH_SYNTH4_LONGSHIFTSEL_MSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_LSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_MASK 'h00000002 -#define SYNTH_SYNTH4_LONGSHIFTSEL_GET(x) (((x) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) >> SYNTH_SYNTH4_LONGSHIFTSEL_LSB) -#define SYNTH_SYNTH4_LONGSHIFTSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_LONGSHIFTSEL_LSB) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) -#define SYNTH_SYNTH4_LONGSHIFTSEL_RESET 1'h0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_LSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MASK 'h00000001 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_GET(x) (((x) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) >> SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_RESET 1'h0 -#define SYNTH_SYNTH4_RESET (32'h0 | \ - SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_SET(SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_RESET) | \ - SYNTH_SYNTH4_DIS_LOSTVC_SET(SYNTH_SYNTH4_DIS_LOSTVC_RESET) | \ - SYNTH_SYNTH4_ALWAYS_SHORTR_SET(SYNTH_SYNTH4_ALWAYS_SHORTR_RESET) | \ - SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_SET(SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_RESET) | \ - SYNTH_SYNTH4_FORCE_PINVC_SET(SYNTH_SYNTH4_FORCE_PINVC_RESET) | \ - SYNTH_SYNTH4_FORCE_VCOCAP_SET(SYNTH_SYNTH4_FORCE_VCOCAP_RESET) | \ - SYNTH_SYNTH4_VCOCAP_OVR_SET(SYNTH_SYNTH4_VCOCAP_OVR_RESET) | \ - SYNTH_SYNTH4_VCOCAPPULLUP_SET(SYNTH_SYNTH4_VCOCAPPULLUP_RESET) | \ - SYNTH_SYNTH4_REFDIVSEL_SET(SYNTH_SYNTH4_REFDIVSEL_RESET) | \ - SYNTH_SYNTH4_PFDDELAY_SET(SYNTH_SYNTH4_PFDDELAY_RESET) | \ - SYNTH_SYNTH4_PFD_DISABLE_SET(SYNTH_SYNTH4_PFD_DISABLE_RESET) | \ - SYNTH_SYNTH4_PRESCSEL_SET(SYNTH_SYNTH4_PRESCSEL_RESET) | \ - SYNTH_SYNTH4_RESET_PRESC_SET(SYNTH_SYNTH4_RESET_PRESC_RESET) | \ - SYNTH_SYNTH4_SDM_DISABLE_SET(SYNTH_SYNTH4_SDM_DISABLE_RESET) | \ - SYNTH_SYNTH4_SDM_MODE_SET(SYNTH_SYNTH4_SDM_MODE_RESET) | \ - SYNTH_SYNTH4_SDM_DITHER_SET(SYNTH_SYNTH4_SDM_DITHER_RESET) | \ - SYNTH_SYNTH4_PSCOUNT_FBSEL_SET(SYNTH_SYNTH4_PSCOUNT_FBSEL_RESET) | \ - SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_SET(SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_RESET) | \ - SYNTH_SYNTH4_SPARE_MISC_SET(SYNTH_SYNTH4_SPARE_MISC_RESET) | \ - SYNTH_SYNTH4_LONGSHIFTSEL_SET(SYNTH_SYNTH4_LONGSHIFTSEL_RESET) | \ - SYNTH_SYNTH4_FORCE_SHIFTREG_SET(SYNTH_SYNTH4_FORCE_SHIFTREG_RESET)) -#define SYNTH_SYNTH4_HW_MASK (32'h0) -#define SYNTH_SYNTH4_SW_MASK (32'h0 | \ - SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK | \ - SYNTH_SYNTH4_DIS_LOSTVC_MASK | \ - SYNTH_SYNTH4_ALWAYS_SHORTR_MASK | \ - SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK | \ - SYNTH_SYNTH4_FORCE_PINVC_MASK | \ - SYNTH_SYNTH4_FORCE_VCOCAP_MASK | \ - SYNTH_SYNTH4_VCOCAP_OVR_MASK | \ - SYNTH_SYNTH4_VCOCAPPULLUP_MASK | \ - SYNTH_SYNTH4_REFDIVSEL_MASK | \ - SYNTH_SYNTH4_PFDDELAY_MASK | \ - SYNTH_SYNTH4_PFD_DISABLE_MASK | \ - SYNTH_SYNTH4_PRESCSEL_MASK | \ - SYNTH_SYNTH4_RESET_PRESC_MASK | \ - SYNTH_SYNTH4_SDM_DISABLE_MASK | \ - SYNTH_SYNTH4_SDM_MODE_MASK | \ - SYNTH_SYNTH4_SDM_DITHER_MASK | \ - SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK | \ - SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK | \ - SYNTH_SYNTH4_SPARE_MISC_MASK | \ - SYNTH_SYNTH4_LONGSHIFTSEL_MASK | \ - SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) - -#define SYNTH_SYNTH5_ADDRESS 'h00000010 -#define SYNTH_SYNTH5_LOOP_IP0_MSB 31 -#define SYNTH_SYNTH5_LOOP_IP0_LSB 28 -#define SYNTH_SYNTH5_LOOP_IP0_MASK 'hf0000000 -#define SYNTH_SYNTH5_LOOP_IP0_GET(x) (((x) & SYNTH_SYNTH5_LOOP_IP0_MASK) >> SYNTH_SYNTH5_LOOP_IP0_LSB) -#define SYNTH_SYNTH5_LOOP_IP0_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_LOOP_IP0_LSB) & SYNTH_SYNTH5_LOOP_IP0_MASK) -#define SYNTH_SYNTH5_LOOP_IP0_RESET 4'hd -#define SYNTH_SYNTH5_SLOPE_IP_MSB 27 -#define SYNTH_SYNTH5_SLOPE_IP_LSB 25 -#define SYNTH_SYNTH5_SLOPE_IP_MASK 'h0e000000 -#define SYNTH_SYNTH5_SLOPE_IP_GET(x) (((x) & SYNTH_SYNTH5_SLOPE_IP_MASK) >> SYNTH_SYNTH5_SLOPE_IP_LSB) -#define SYNTH_SYNTH5_SLOPE_IP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_SLOPE_IP_LSB) & SYNTH_SYNTH5_SLOPE_IP_MASK) -#define SYNTH_SYNTH5_SLOPE_IP_RESET 3'h0 -#define SYNTH_SYNTH5_CPBIAS_MSB 24 -#define SYNTH_SYNTH5_CPBIAS_LSB 23 -#define SYNTH_SYNTH5_CPBIAS_MASK 'h01800000 -#define SYNTH_SYNTH5_CPBIAS_GET(x) (((x) & SYNTH_SYNTH5_CPBIAS_MASK) >> SYNTH_SYNTH5_CPBIAS_LSB) -#define SYNTH_SYNTH5_CPBIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CPBIAS_LSB) & SYNTH_SYNTH5_CPBIAS_MASK) -#define SYNTH_SYNTH5_CPBIAS_RESET 2'h1 -#define SYNTH_SYNTH5_CPSTEERING_EN_MSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_LSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_MASK 'h00400000 -#define SYNTH_SYNTH5_CPSTEERING_EN_GET(x) (((x) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) >> SYNTH_SYNTH5_CPSTEERING_EN_LSB) -#define SYNTH_SYNTH5_CPSTEERING_EN_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CPSTEERING_EN_LSB) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) -#define SYNTH_SYNTH5_CPSTEERING_EN_RESET 1'h0 -#define SYNTH_SYNTH5_CPLOWLK_MSB 21 -#define SYNTH_SYNTH5_CPLOWLK_LSB 21 -#define SYNTH_SYNTH5_CPLOWLK_MASK 'h00200000 -#define SYNTH_SYNTH5_CPLOWLK_GET(x) (((x) & SYNTH_SYNTH5_CPLOWLK_MASK) >> SYNTH_SYNTH5_CPLOWLK_LSB) -#define SYNTH_SYNTH5_CPLOWLK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CPLOWLK_LSB) & SYNTH_SYNTH5_CPLOWLK_MASK) -#define SYNTH_SYNTH5_CPLOWLK_RESET 1'h0 -#define SYNTH_SYNTH5_LOOPLEAKCUR_MSB 20 -#define SYNTH_SYNTH5_LOOPLEAKCUR_LSB 17 -#define SYNTH_SYNTH5_LOOPLEAKCUR_MASK 'h001e0000 -#define SYNTH_SYNTH5_LOOPLEAKCUR_GET(x) (((x) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) >> SYNTH_SYNTH5_LOOPLEAKCUR_LSB) -#define SYNTH_SYNTH5_LOOPLEAKCUR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_LOOPLEAKCUR_LSB) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) -#define SYNTH_SYNTH5_LOOPLEAKCUR_RESET 4'h0 -#define SYNTH_SYNTH5_CAPRANGE1_MSB 16 -#define SYNTH_SYNTH5_CAPRANGE1_LSB 13 -#define SYNTH_SYNTH5_CAPRANGE1_MASK 'h0001e000 -#define SYNTH_SYNTH5_CAPRANGE1_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE1_MASK) >> SYNTH_SYNTH5_CAPRANGE1_LSB) -#define SYNTH_SYNTH5_CAPRANGE1_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CAPRANGE1_LSB) & SYNTH_SYNTH5_CAPRANGE1_MASK) -#define SYNTH_SYNTH5_CAPRANGE1_RESET 4'h4 -#define SYNTH_SYNTH5_CAPRANGE2_MSB 12 -#define SYNTH_SYNTH5_CAPRANGE2_LSB 9 -#define SYNTH_SYNTH5_CAPRANGE2_MASK 'h00001e00 -#define SYNTH_SYNTH5_CAPRANGE2_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE2_MASK) >> SYNTH_SYNTH5_CAPRANGE2_LSB) -#define SYNTH_SYNTH5_CAPRANGE2_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CAPRANGE2_LSB) & SYNTH_SYNTH5_CAPRANGE2_MASK) -#define SYNTH_SYNTH5_CAPRANGE2_RESET 4'h8 -#define SYNTH_SYNTH5_CAPRANGE3_MSB 8 -#define SYNTH_SYNTH5_CAPRANGE3_LSB 5 -#define SYNTH_SYNTH5_CAPRANGE3_MASK 'h000001e0 -#define SYNTH_SYNTH5_CAPRANGE3_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE3_MASK) >> SYNTH_SYNTH5_CAPRANGE3_LSB) -#define SYNTH_SYNTH5_CAPRANGE3_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CAPRANGE3_LSB) & SYNTH_SYNTH5_CAPRANGE3_MASK) -#define SYNTH_SYNTH5_CAPRANGE3_RESET 4'hc -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK 'h00000010 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_RESET 1'h0 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MSB 3 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB 2 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK 'h0000000c -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_GET(x) (((x) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) >> SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_RESET 2'h2 -#define SYNTH_SYNTH5_SPARE_MSB 1 -#define SYNTH_SYNTH5_SPARE_LSB 0 -#define SYNTH_SYNTH5_SPARE_MASK 'h00000003 -#define SYNTH_SYNTH5_SPARE_GET(x) (((x) & SYNTH_SYNTH5_SPARE_MASK) >> SYNTH_SYNTH5_SPARE_LSB) -#define SYNTH_SYNTH5_SPARE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_SPARE_LSB) & SYNTH_SYNTH5_SPARE_MASK) -#define SYNTH_SYNTH5_SPARE_RESET 2'h0 -#define SYNTH_SYNTH5_RESET (32'h0 | \ - SYNTH_SYNTH5_LOOP_IP0_SET(SYNTH_SYNTH5_LOOP_IP0_RESET) | \ - SYNTH_SYNTH5_SLOPE_IP_SET(SYNTH_SYNTH5_SLOPE_IP_RESET) | \ - SYNTH_SYNTH5_CPBIAS_SET(SYNTH_SYNTH5_CPBIAS_RESET) | \ - SYNTH_SYNTH5_CPSTEERING_EN_SET(SYNTH_SYNTH5_CPSTEERING_EN_RESET) | \ - SYNTH_SYNTH5_CPLOWLK_SET(SYNTH_SYNTH5_CPLOWLK_RESET) | \ - SYNTH_SYNTH5_LOOPLEAKCUR_SET(SYNTH_SYNTH5_LOOPLEAKCUR_RESET) | \ - SYNTH_SYNTH5_CAPRANGE1_SET(SYNTH_SYNTH5_CAPRANGE1_RESET) | \ - SYNTH_SYNTH5_CAPRANGE2_SET(SYNTH_SYNTH5_CAPRANGE2_RESET) | \ - SYNTH_SYNTH5_CAPRANGE3_SET(SYNTH_SYNTH5_CAPRANGE3_RESET) | \ - SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_SET(SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_RESET) | \ - SYNTH_SYNTH5_LOBUF5GTUNE_OVR_SET(SYNTH_SYNTH5_LOBUF5GTUNE_OVR_RESET) | \ - SYNTH_SYNTH5_SPARE_SET(SYNTH_SYNTH5_SPARE_RESET)) -#define SYNTH_SYNTH5_HW_MASK (32'h0) -#define SYNTH_SYNTH5_SW_MASK (32'h0 | \ - SYNTH_SYNTH5_LOOP_IP0_MASK | \ - SYNTH_SYNTH5_SLOPE_IP_MASK | \ - SYNTH_SYNTH5_CPBIAS_MASK | \ - SYNTH_SYNTH5_CPSTEERING_EN_MASK | \ - SYNTH_SYNTH5_CPLOWLK_MASK | \ - SYNTH_SYNTH5_LOOPLEAKCUR_MASK | \ - SYNTH_SYNTH5_CAPRANGE1_MASK | \ - SYNTH_SYNTH5_CAPRANGE2_MASK | \ - SYNTH_SYNTH5_CAPRANGE3_MASK | \ - SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK | \ - SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK | \ - SYNTH_SYNTH5_SPARE_MASK) - -#define SYNTH_SYNTH6_ADDRESS 'h00000014 -#define SYNTH_SYNTH6_IRCP_MSB 31 -#define SYNTH_SYNTH6_IRCP_LSB 29 -#define SYNTH_SYNTH6_IRCP_MASK 'he0000000 -#define SYNTH_SYNTH6_IRCP_GET(x) (((x) & SYNTH_SYNTH6_IRCP_MASK) >> SYNTH_SYNTH6_IRCP_LSB) -#define SYNTH_SYNTH6_IRCP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_IRCP_LSB) & SYNTH_SYNTH6_IRCP_MASK) -#define SYNTH_SYNTH6_IRCP_RESET 3'h4 -#define SYNTH_SYNTH6_IRVCMON_MSB 28 -#define SYNTH_SYNTH6_IRVCMON_LSB 26 -#define SYNTH_SYNTH6_IRVCMON_MASK 'h1c000000 -#define SYNTH_SYNTH6_IRVCMON_GET(x) (((x) & SYNTH_SYNTH6_IRVCMON_MASK) >> SYNTH_SYNTH6_IRVCMON_LSB) -#define SYNTH_SYNTH6_IRVCMON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_IRVCMON_LSB) & SYNTH_SYNTH6_IRVCMON_MASK) -#define SYNTH_SYNTH6_IRVCMON_RESET 3'h4 -#define SYNTH_SYNTH6_IRSPARE_MSB 25 -#define SYNTH_SYNTH6_IRSPARE_LSB 23 -#define SYNTH_SYNTH6_IRSPARE_MASK 'h03800000 -#define SYNTH_SYNTH6_IRSPARE_GET(x) (((x) & SYNTH_SYNTH6_IRSPARE_MASK) >> SYNTH_SYNTH6_IRSPARE_LSB) -#define SYNTH_SYNTH6_IRSPARE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_IRSPARE_LSB) & SYNTH_SYNTH6_IRSPARE_MASK) -#define SYNTH_SYNTH6_IRSPARE_RESET 3'h4 -#define SYNTH_SYNTH6_ICPRESC_MSB 22 -#define SYNTH_SYNTH6_ICPRESC_LSB 20 -#define SYNTH_SYNTH6_ICPRESC_MASK 'h00700000 -#define SYNTH_SYNTH6_ICPRESC_GET(x) (((x) & SYNTH_SYNTH6_ICPRESC_MASK) >> SYNTH_SYNTH6_ICPRESC_LSB) -#define SYNTH_SYNTH6_ICPRESC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICPRESC_LSB) & SYNTH_SYNTH6_ICPRESC_MASK) -#define SYNTH_SYNTH6_ICPRESC_RESET 3'h4 -#define SYNTH_SYNTH6_ICLODIV_MSB 19 -#define SYNTH_SYNTH6_ICLODIV_LSB 17 -#define SYNTH_SYNTH6_ICLODIV_MASK 'h000e0000 -#define SYNTH_SYNTH6_ICLODIV_GET(x) (((x) & SYNTH_SYNTH6_ICLODIV_MASK) >> SYNTH_SYNTH6_ICLODIV_LSB) -#define SYNTH_SYNTH6_ICLODIV_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICLODIV_LSB) & SYNTH_SYNTH6_ICLODIV_MASK) -#define SYNTH_SYNTH6_ICLODIV_RESET 3'h4 -#define SYNTH_SYNTH6_ICLOMIX_MSB 16 -#define SYNTH_SYNTH6_ICLOMIX_LSB 14 -#define SYNTH_SYNTH6_ICLOMIX_MASK 'h0001c000 -#define SYNTH_SYNTH6_ICLOMIX_GET(x) (((x) & SYNTH_SYNTH6_ICLOMIX_MASK) >> SYNTH_SYNTH6_ICLOMIX_LSB) -#define SYNTH_SYNTH6_ICLOMIX_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICLOMIX_LSB) & SYNTH_SYNTH6_ICLOMIX_MASK) -#define SYNTH_SYNTH6_ICLOMIX_RESET 3'h4 -#define SYNTH_SYNTH6_ICSPAREA_MSB 13 -#define SYNTH_SYNTH6_ICSPAREA_LSB 11 -#define SYNTH_SYNTH6_ICSPAREA_MASK 'h00003800 -#define SYNTH_SYNTH6_ICSPAREA_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREA_MASK) >> SYNTH_SYNTH6_ICSPAREA_LSB) -#define SYNTH_SYNTH6_ICSPAREA_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICSPAREA_LSB) & SYNTH_SYNTH6_ICSPAREA_MASK) -#define SYNTH_SYNTH6_ICSPAREA_RESET 3'h4 -#define SYNTH_SYNTH6_ICSPAREB_MSB 10 -#define SYNTH_SYNTH6_ICSPAREB_LSB 8 -#define SYNTH_SYNTH6_ICSPAREB_MASK 'h00000700 -#define SYNTH_SYNTH6_ICSPAREB_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREB_MASK) >> SYNTH_SYNTH6_ICSPAREB_LSB) -#define SYNTH_SYNTH6_ICSPAREB_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICSPAREB_LSB) & SYNTH_SYNTH6_ICSPAREB_MASK) -#define SYNTH_SYNTH6_ICSPAREB_RESET 3'h4 -#define SYNTH_SYNTH6_ICVCO_MSB 7 -#define SYNTH_SYNTH6_ICVCO_LSB 5 -#define SYNTH_SYNTH6_ICVCO_MASK 'h000000e0 -#define SYNTH_SYNTH6_ICVCO_GET(x) (((x) & SYNTH_SYNTH6_ICVCO_MASK) >> SYNTH_SYNTH6_ICVCO_LSB) -#define SYNTH_SYNTH6_ICVCO_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICVCO_LSB) & SYNTH_SYNTH6_ICVCO_MASK) -#define SYNTH_SYNTH6_ICVCO_RESET 3'h4 -#define SYNTH_SYNTH6_VCOBUFBIAS_MSB 4 -#define SYNTH_SYNTH6_VCOBUFBIAS_LSB 3 -#define SYNTH_SYNTH6_VCOBUFBIAS_MASK 'h00000018 -#define SYNTH_SYNTH6_VCOBUFBIAS_GET(x) (((x) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) >> SYNTH_SYNTH6_VCOBUFBIAS_LSB) -#define SYNTH_SYNTH6_VCOBUFBIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_VCOBUFBIAS_LSB) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) -#define SYNTH_SYNTH6_VCOBUFBIAS_RESET 2'h2 -#define SYNTH_SYNTH6_SPARE_BIAS_MSB 2 -#define SYNTH_SYNTH6_SPARE_BIAS_LSB 0 -#define SYNTH_SYNTH6_SPARE_BIAS_MASK 'h00000007 -#define SYNTH_SYNTH6_SPARE_BIAS_GET(x) (((x) & SYNTH_SYNTH6_SPARE_BIAS_MASK) >> SYNTH_SYNTH6_SPARE_BIAS_LSB) -#define SYNTH_SYNTH6_SPARE_BIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_SPARE_BIAS_LSB) & SYNTH_SYNTH6_SPARE_BIAS_MASK) -#define SYNTH_SYNTH6_SPARE_BIAS_RESET 3'h0 -#define SYNTH_SYNTH6_RESET (32'h0 | \ - SYNTH_SYNTH6_IRCP_SET(SYNTH_SYNTH6_IRCP_RESET) | \ - SYNTH_SYNTH6_IRVCMON_SET(SYNTH_SYNTH6_IRVCMON_RESET) | \ - SYNTH_SYNTH6_IRSPARE_SET(SYNTH_SYNTH6_IRSPARE_RESET) | \ - SYNTH_SYNTH6_ICPRESC_SET(SYNTH_SYNTH6_ICPRESC_RESET) | \ - SYNTH_SYNTH6_ICLODIV_SET(SYNTH_SYNTH6_ICLODIV_RESET) | \ - SYNTH_SYNTH6_ICLOMIX_SET(SYNTH_SYNTH6_ICLOMIX_RESET) | \ - SYNTH_SYNTH6_ICSPAREA_SET(SYNTH_SYNTH6_ICSPAREA_RESET) | \ - SYNTH_SYNTH6_ICSPAREB_SET(SYNTH_SYNTH6_ICSPAREB_RESET) | \ - SYNTH_SYNTH6_ICVCO_SET(SYNTH_SYNTH6_ICVCO_RESET) | \ - SYNTH_SYNTH6_VCOBUFBIAS_SET(SYNTH_SYNTH6_VCOBUFBIAS_RESET) | \ - SYNTH_SYNTH6_SPARE_BIAS_SET(SYNTH_SYNTH6_SPARE_BIAS_RESET)) -#define SYNTH_SYNTH6_HW_MASK (32'h0) -#define SYNTH_SYNTH6_SW_MASK (32'h0 | \ - SYNTH_SYNTH6_IRCP_MASK | \ - SYNTH_SYNTH6_IRVCMON_MASK | \ - SYNTH_SYNTH6_IRSPARE_MASK | \ - SYNTH_SYNTH6_ICPRESC_MASK | \ - SYNTH_SYNTH6_ICLODIV_MASK | \ - SYNTH_SYNTH6_ICLOMIX_MASK | \ - SYNTH_SYNTH6_ICSPAREA_MASK | \ - SYNTH_SYNTH6_ICSPAREB_MASK | \ - SYNTH_SYNTH6_ICVCO_MASK | \ - SYNTH_SYNTH6_VCOBUFBIAS_MASK | \ - SYNTH_SYNTH6_SPARE_BIAS_MASK) - -#define SYNTH_SYNTH7_ADDRESS 'h00000018 -#define SYNTH_SYNTH7_SYNTH_ON_MSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_LSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_MASK 'h80000000 -#define SYNTH_SYNTH7_SYNTH_ON_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_ON_MASK) >> SYNTH_SYNTH7_SYNTH_ON_LSB) -#define SYNTH_SYNTH7_SYNTH_ON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SYNTH_ON_LSB) & SYNTH_SYNTH7_SYNTH_ON_MASK) -#define SYNTH_SYNTH7_SYNTH_ON_RESET 1'h0 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MSB 30 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_LSB 27 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MASK 'h78000000 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) >> SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_RESET 4'h0 -#define SYNTH_SYNTH7_CAP_SEARCH_MSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_LSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_MASK 'h04000000 -#define SYNTH_SYNTH7_CAP_SEARCH_GET(x) (((x) & SYNTH_SYNTH7_CAP_SEARCH_MASK) >> SYNTH_SYNTH7_CAP_SEARCH_LSB) -#define SYNTH_SYNTH7_CAP_SEARCH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_CAP_SEARCH_LSB) & SYNTH_SYNTH7_CAP_SEARCH_MASK) -#define SYNTH_SYNTH7_CAP_SEARCH_RESET 1'h0 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK 'h02000000 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) >> SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_RESET 1'h0 -#define SYNTH_SYNTH7_PIN_VC_MSB 24 -#define SYNTH_SYNTH7_PIN_VC_LSB 24 -#define SYNTH_SYNTH7_PIN_VC_MASK 'h01000000 -#define SYNTH_SYNTH7_PIN_VC_GET(x) (((x) & SYNTH_SYNTH7_PIN_VC_MASK) >> SYNTH_SYNTH7_PIN_VC_LSB) -#define SYNTH_SYNTH7_PIN_VC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_PIN_VC_LSB) & SYNTH_SYNTH7_PIN_VC_MASK) -#define SYNTH_SYNTH7_PIN_VC_RESET 1'h0 -#define SYNTH_SYNTH7_VCO_CAP_ST_MSB 23 -#define SYNTH_SYNTH7_VCO_CAP_ST_LSB 16 -#define SYNTH_SYNTH7_VCO_CAP_ST_MASK 'h00ff0000 -#define SYNTH_SYNTH7_VCO_CAP_ST_GET(x) (((x) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) >> SYNTH_SYNTH7_VCO_CAP_ST_LSB) -#define SYNTH_SYNTH7_VCO_CAP_ST_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_VCO_CAP_ST_LSB) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) -#define SYNTH_SYNTH7_VCO_CAP_ST_RESET 8'h0 -#define SYNTH_SYNTH7_SHORT_R_MSB 15 -#define SYNTH_SYNTH7_SHORT_R_LSB 15 -#define SYNTH_SYNTH7_SHORT_R_MASK 'h00008000 -#define SYNTH_SYNTH7_SHORT_R_GET(x) (((x) & SYNTH_SYNTH7_SHORT_R_MASK) >> SYNTH_SYNTH7_SHORT_R_LSB) -#define SYNTH_SYNTH7_SHORT_R_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SHORT_R_LSB) & SYNTH_SYNTH7_SHORT_R_MASK) -#define SYNTH_SYNTH7_SHORT_R_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_RFD_MSB 14 -#define SYNTH_SYNTH7_RESET_RFD_LSB 14 -#define SYNTH_SYNTH7_RESET_RFD_MASK 'h00004000 -#define SYNTH_SYNTH7_RESET_RFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_RFD_MASK) >> SYNTH_SYNTH7_RESET_RFD_LSB) -#define SYNTH_SYNTH7_RESET_RFD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_RFD_LSB) & SYNTH_SYNTH7_RESET_RFD_MASK) -#define SYNTH_SYNTH7_RESET_RFD_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_PFD_MSB 13 -#define SYNTH_SYNTH7_RESET_PFD_LSB 13 -#define SYNTH_SYNTH7_RESET_PFD_MASK 'h00002000 -#define SYNTH_SYNTH7_RESET_PFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_PFD_MASK) >> SYNTH_SYNTH7_RESET_PFD_LSB) -#define SYNTH_SYNTH7_RESET_PFD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_PFD_LSB) & SYNTH_SYNTH7_RESET_PFD_MASK) -#define SYNTH_SYNTH7_RESET_PFD_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK 'h00001000 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_GET(x) (((x) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) >> SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_SDM_B_MSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_LSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_MASK 'h00000800 -#define SYNTH_SYNTH7_RESET_SDM_B_GET(x) (((x) & SYNTH_SYNTH7_RESET_SDM_B_MASK) >> SYNTH_SYNTH7_RESET_SDM_B_LSB) -#define SYNTH_SYNTH7_RESET_SDM_B_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_SDM_B_LSB) & SYNTH_SYNTH7_RESET_SDM_B_MASK) -#define SYNTH_SYNTH7_RESET_SDM_B_RESET 1'h0 -#define SYNTH_SYNTH7_VC2HIGH_MSB 10 -#define SYNTH_SYNTH7_VC2HIGH_LSB 10 -#define SYNTH_SYNTH7_VC2HIGH_MASK 'h00000400 -#define SYNTH_SYNTH7_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH7_VC2HIGH_MASK) >> SYNTH_SYNTH7_VC2HIGH_LSB) -#define SYNTH_SYNTH7_VC2HIGH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_VC2HIGH_LSB) & SYNTH_SYNTH7_VC2HIGH_MASK) -#define SYNTH_SYNTH7_VC2HIGH_RESET 1'h0 -#define SYNTH_SYNTH7_VC2LOW_MSB 9 -#define SYNTH_SYNTH7_VC2LOW_LSB 9 -#define SYNTH_SYNTH7_VC2LOW_MASK 'h00000200 -#define SYNTH_SYNTH7_VC2LOW_GET(x) (((x) & SYNTH_SYNTH7_VC2LOW_MASK) >> SYNTH_SYNTH7_VC2LOW_LSB) -#define SYNTH_SYNTH7_VC2LOW_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_VC2LOW_LSB) & SYNTH_SYNTH7_VC2LOW_MASK) -#define SYNTH_SYNTH7_VC2LOW_RESET 1'h0 -#define SYNTH_SYNTH7_LOOP_IP_MSB 8 -#define SYNTH_SYNTH7_LOOP_IP_LSB 5 -#define SYNTH_SYNTH7_LOOP_IP_MASK 'h000001e0 -#define SYNTH_SYNTH7_LOOP_IP_GET(x) (((x) & SYNTH_SYNTH7_LOOP_IP_MASK) >> SYNTH_SYNTH7_LOOP_IP_LSB) -#define SYNTH_SYNTH7_LOOP_IP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_LOOP_IP_LSB) & SYNTH_SYNTH7_LOOP_IP_MASK) -#define SYNTH_SYNTH7_LOOP_IP_RESET 4'h0 -#define SYNTH_SYNTH7_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH7_LOBUF5GTUNE_LSB 3 -#define SYNTH_SYNTH7_LOBUF5GTUNE_MASK 'h00000018 -#define SYNTH_SYNTH7_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH7_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH7_LOBUF5GTUNE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_LOBUF5GTUNE_LSB) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH7_LOBUF5GTUNE_RESET 2'h0 -#define SYNTH_SYNTH7_SPARE_READ_MSB 2 -#define SYNTH_SYNTH7_SPARE_READ_LSB 0 -#define SYNTH_SYNTH7_SPARE_READ_MASK 'h00000007 -#define SYNTH_SYNTH7_SPARE_READ_GET(x) (((x) & SYNTH_SYNTH7_SPARE_READ_MASK) >> SYNTH_SYNTH7_SPARE_READ_LSB) -#define SYNTH_SYNTH7_SPARE_READ_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SPARE_READ_LSB) & SYNTH_SYNTH7_SPARE_READ_MASK) -#define SYNTH_SYNTH7_SPARE_READ_RESET 3'h0 -#define SYNTH_SYNTH7_RESET (32'h0 | \ - SYNTH_SYNTH7_SYNTH_ON_SET(SYNTH_SYNTH7_SYNTH_ON_RESET) | \ - SYNTH_SYNTH7_SYNTH_SM_STATE_SET(SYNTH_SYNTH7_SYNTH_SM_STATE_RESET) | \ - SYNTH_SYNTH7_CAP_SEARCH_SET(SYNTH_SYNTH7_CAP_SEARCH_RESET) | \ - SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_SET(SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_RESET) | \ - SYNTH_SYNTH7_PIN_VC_SET(SYNTH_SYNTH7_PIN_VC_RESET) | \ - SYNTH_SYNTH7_VCO_CAP_ST_SET(SYNTH_SYNTH7_VCO_CAP_ST_RESET) | \ - SYNTH_SYNTH7_SHORT_R_SET(SYNTH_SYNTH7_SHORT_R_RESET) | \ - SYNTH_SYNTH7_RESET_RFD_SET(SYNTH_SYNTH7_RESET_RFD_RESET) | \ - SYNTH_SYNTH7_RESET_PFD_SET(SYNTH_SYNTH7_RESET_PFD_RESET) | \ - SYNTH_SYNTH7_RESET_PSCOUNTERS_SET(SYNTH_SYNTH7_RESET_PSCOUNTERS_RESET) | \ - SYNTH_SYNTH7_RESET_SDM_B_SET(SYNTH_SYNTH7_RESET_SDM_B_RESET) | \ - SYNTH_SYNTH7_VC2HIGH_SET(SYNTH_SYNTH7_VC2HIGH_RESET) | \ - SYNTH_SYNTH7_VC2LOW_SET(SYNTH_SYNTH7_VC2LOW_RESET) | \ - SYNTH_SYNTH7_LOOP_IP_SET(SYNTH_SYNTH7_LOOP_IP_RESET) | \ - SYNTH_SYNTH7_LOBUF5GTUNE_SET(SYNTH_SYNTH7_LOBUF5GTUNE_RESET) | \ - SYNTH_SYNTH7_SPARE_READ_SET(SYNTH_SYNTH7_SPARE_READ_RESET)) -#define SYNTH_SYNTH7_HW_MASK (32'h0 | \ - SYNTH_SYNTH7_SYNTH_ON_MASK | \ - SYNTH_SYNTH7_SYNTH_SM_STATE_MASK | \ - SYNTH_SYNTH7_CAP_SEARCH_MASK | \ - SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK | \ - SYNTH_SYNTH7_PIN_VC_MASK | \ - SYNTH_SYNTH7_VCO_CAP_ST_MASK | \ - SYNTH_SYNTH7_SHORT_R_MASK | \ - SYNTH_SYNTH7_RESET_RFD_MASK | \ - SYNTH_SYNTH7_RESET_PFD_MASK | \ - SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK | \ - SYNTH_SYNTH7_RESET_SDM_B_MASK | \ - SYNTH_SYNTH7_VC2HIGH_MASK | \ - SYNTH_SYNTH7_VC2LOW_MASK | \ - SYNTH_SYNTH7_LOOP_IP_MASK | \ - SYNTH_SYNTH7_LOBUF5GTUNE_MASK | \ - SYNTH_SYNTH7_SPARE_READ_MASK) -#define SYNTH_SYNTH7_SW_MASK (32'h0) - -#define SYNTH_SYNTH8_ADDRESS 'h0000001c -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK 'h80000000 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_GET(x) (((x) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) >> SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_RESET 1'h0 -#define SYNTH_SYNTH8_FRACMODE_MSB 30 -#define SYNTH_SYNTH8_FRACMODE_LSB 30 -#define SYNTH_SYNTH8_FRACMODE_MASK 'h40000000 -#define SYNTH_SYNTH8_FRACMODE_GET(x) (((x) & SYNTH_SYNTH8_FRACMODE_MASK) >> SYNTH_SYNTH8_FRACMODE_LSB) -#define SYNTH_SYNTH8_FRACMODE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_FRACMODE_LSB) & SYNTH_SYNTH8_FRACMODE_MASK) -#define SYNTH_SYNTH8_FRACMODE_RESET 1'h0 -#define SYNTH_SYNTH8_AMODEREFSEL_MSB 29 -#define SYNTH_SYNTH8_AMODEREFSEL_LSB 28 -#define SYNTH_SYNTH8_AMODEREFSEL_MASK 'h30000000 -#define SYNTH_SYNTH8_AMODEREFSEL_GET(x) (((x) & SYNTH_SYNTH8_AMODEREFSEL_MASK) >> SYNTH_SYNTH8_AMODEREFSEL_LSB) -#define SYNTH_SYNTH8_AMODEREFSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_AMODEREFSEL_LSB) & SYNTH_SYNTH8_AMODEREFSEL_MASK) -#define SYNTH_SYNTH8_AMODEREFSEL_RESET 2'h0 -#define SYNTH_SYNTH8_SPARE_MSB 27 -#define SYNTH_SYNTH8_SPARE_LSB 27 -#define SYNTH_SYNTH8_SPARE_MASK 'h08000000 -#define SYNTH_SYNTH8_SPARE_GET(x) (((x) & SYNTH_SYNTH8_SPARE_MASK) >> SYNTH_SYNTH8_SPARE_LSB) -#define SYNTH_SYNTH8_SPARE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_SPARE_LSB) & SYNTH_SYNTH8_SPARE_MASK) -#define SYNTH_SYNTH8_SPARE_RESET 1'h0 -#define SYNTH_SYNTH8_CHANSEL_MSB 26 -#define SYNTH_SYNTH8_CHANSEL_LSB 18 -#define SYNTH_SYNTH8_CHANSEL_MASK 'h07fc0000 -#define SYNTH_SYNTH8_CHANSEL_GET(x) (((x) & SYNTH_SYNTH8_CHANSEL_MASK) >> SYNTH_SYNTH8_CHANSEL_LSB) -#define SYNTH_SYNTH8_CHANSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_CHANSEL_LSB) & SYNTH_SYNTH8_CHANSEL_MASK) -#define SYNTH_SYNTH8_CHANSEL_RESET 9'h0 -#define SYNTH_SYNTH8_CHANFRAC_MSB 17 -#define SYNTH_SYNTH8_CHANFRAC_LSB 1 -#define SYNTH_SYNTH8_CHANFRAC_MASK 'h0003fffe -#define SYNTH_SYNTH8_CHANFRAC_GET(x) (((x) & SYNTH_SYNTH8_CHANFRAC_MASK) >> SYNTH_SYNTH8_CHANFRAC_LSB) -#define SYNTH_SYNTH8_CHANFRAC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_CHANFRAC_LSB) & SYNTH_SYNTH8_CHANFRAC_MASK) -#define SYNTH_SYNTH8_CHANFRAC_RESET 17'h0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_MSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_LSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_MASK 'h00000001 -#define SYNTH_SYNTH8_FORCE_FRACLSB_GET(x) (((x) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) >> SYNTH_SYNTH8_FORCE_FRACLSB_LSB) -#define SYNTH_SYNTH8_FORCE_FRACLSB_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_FORCE_FRACLSB_LSB) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) -#define SYNTH_SYNTH8_FORCE_FRACLSB_RESET 1'h0 -#define SYNTH_SYNTH8_RESET (32'h0 | \ - SYNTH_SYNTH8_LOADSYNTHCHANNEL_SET(SYNTH_SYNTH8_LOADSYNTHCHANNEL_RESET) | \ - SYNTH_SYNTH8_FRACMODE_SET(SYNTH_SYNTH8_FRACMODE_RESET) | \ - SYNTH_SYNTH8_AMODEREFSEL_SET(SYNTH_SYNTH8_AMODEREFSEL_RESET) | \ - SYNTH_SYNTH8_SPARE_SET(SYNTH_SYNTH8_SPARE_RESET) | \ - SYNTH_SYNTH8_CHANSEL_SET(SYNTH_SYNTH8_CHANSEL_RESET) | \ - SYNTH_SYNTH8_CHANFRAC_SET(SYNTH_SYNTH8_CHANFRAC_RESET) | \ - SYNTH_SYNTH8_FORCE_FRACLSB_SET(SYNTH_SYNTH8_FORCE_FRACLSB_RESET)) -#define SYNTH_SYNTH8_HW_MASK (32'h0 | \ - SYNTH_SYNTH8_FRACMODE_MASK | \ - SYNTH_SYNTH8_AMODEREFSEL_MASK | \ - SYNTH_SYNTH8_SPARE_MASK | \ - SYNTH_SYNTH8_CHANSEL_MASK | \ - SYNTH_SYNTH8_CHANFRAC_MASK) -#define SYNTH_SYNTH8_SW_MASK (32'h0 | \ - SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK | \ - SYNTH_SYNTH8_FRACMODE_MASK | \ - SYNTH_SYNTH8_AMODEREFSEL_MASK | \ - SYNTH_SYNTH8_SPARE_MASK | \ - SYNTH_SYNTH8_CHANSEL_MASK | \ - SYNTH_SYNTH8_CHANFRAC_MASK | \ - SYNTH_SYNTH8_FORCE_FRACLSB_MASK) - -#define RF5G_RF5G1_ADDRESS 'h00000020 -#define RF5G_RF5G1_PDTXLO5_MSB 31 -#define RF5G_RF5G1_PDTXLO5_LSB 31 -#define RF5G_RF5G1_PDTXLO5_MASK 'h80000000 -#define RF5G_RF5G1_PDTXLO5_GET(x) (((x) & RF5G_RF5G1_PDTXLO5_MASK) >> RF5G_RF5G1_PDTXLO5_LSB) -#define RF5G_RF5G1_PDTXLO5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDTXLO5_LSB) & RF5G_RF5G1_PDTXLO5_MASK) -#define RF5G_RF5G1_PDTXLO5_RESET 1'h0 -#define RF5G_RF5G1_PDTXMIX5_MSB 30 -#define RF5G_RF5G1_PDTXMIX5_LSB 30 -#define RF5G_RF5G1_PDTXMIX5_MASK 'h40000000 -#define RF5G_RF5G1_PDTXMIX5_GET(x) (((x) & RF5G_RF5G1_PDTXMIX5_MASK) >> RF5G_RF5G1_PDTXMIX5_LSB) -#define RF5G_RF5G1_PDTXMIX5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDTXMIX5_LSB) & RF5G_RF5G1_PDTXMIX5_MASK) -#define RF5G_RF5G1_PDTXMIX5_RESET 1'h0 -#define RF5G_RF5G1_PDTXBUF5_MSB 29 -#define RF5G_RF5G1_PDTXBUF5_LSB 29 -#define RF5G_RF5G1_PDTXBUF5_MASK 'h20000000 -#define RF5G_RF5G1_PDTXBUF5_GET(x) (((x) & RF5G_RF5G1_PDTXBUF5_MASK) >> RF5G_RF5G1_PDTXBUF5_LSB) -#define RF5G_RF5G1_PDTXBUF5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDTXBUF5_LSB) & RF5G_RF5G1_PDTXBUF5_MASK) -#define RF5G_RF5G1_PDTXBUF5_RESET 1'h0 -#define RF5G_RF5G1_PDPADRV5_MSB 28 -#define RF5G_RF5G1_PDPADRV5_LSB 28 -#define RF5G_RF5G1_PDPADRV5_MASK 'h10000000 -#define RF5G_RF5G1_PDPADRV5_GET(x) (((x) & RF5G_RF5G1_PDPADRV5_MASK) >> RF5G_RF5G1_PDPADRV5_LSB) -#define RF5G_RF5G1_PDPADRV5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDPADRV5_LSB) & RF5G_RF5G1_PDPADRV5_MASK) -#define RF5G_RF5G1_PDPADRV5_RESET 1'h0 -#define RF5G_RF5G1_PDPAOUT5_MSB 27 -#define RF5G_RF5G1_PDPAOUT5_LSB 27 -#define RF5G_RF5G1_PDPAOUT5_MASK 'h08000000 -#define RF5G_RF5G1_PDPAOUT5_GET(x) (((x) & RF5G_RF5G1_PDPAOUT5_MASK) >> RF5G_RF5G1_PDPAOUT5_LSB) -#define RF5G_RF5G1_PDPAOUT5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDPAOUT5_LSB) & RF5G_RF5G1_PDPAOUT5_MASK) -#define RF5G_RF5G1_PDPAOUT5_RESET 1'h0 -#define RF5G_RF5G1_TUNE_PADRV5_MSB 26 -#define RF5G_RF5G1_TUNE_PADRV5_LSB 24 -#define RF5G_RF5G1_TUNE_PADRV5_MASK 'h07000000 -#define RF5G_RF5G1_TUNE_PADRV5_GET(x) (((x) & RF5G_RF5G1_TUNE_PADRV5_MASK) >> RF5G_RF5G1_TUNE_PADRV5_LSB) -#define RF5G_RF5G1_TUNE_PADRV5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_TUNE_PADRV5_LSB) & RF5G_RF5G1_TUNE_PADRV5_MASK) -#define RF5G_RF5G1_TUNE_PADRV5_RESET 3'h0 -#define RF5G_RF5G1_PWDTXPKD_MSB 23 -#define RF5G_RF5G1_PWDTXPKD_LSB 21 -#define RF5G_RF5G1_PWDTXPKD_MASK 'h00e00000 -#define RF5G_RF5G1_PWDTXPKD_GET(x) (((x) & RF5G_RF5G1_PWDTXPKD_MASK) >> RF5G_RF5G1_PWDTXPKD_LSB) -#define RF5G_RF5G1_PWDTXPKD_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PWDTXPKD_LSB) & RF5G_RF5G1_PWDTXPKD_MASK) -#define RF5G_RF5G1_PWDTXPKD_RESET 3'h7 -#define RF5G_RF5G1_DB5_MSB 20 -#define RF5G_RF5G1_DB5_LSB 18 -#define RF5G_RF5G1_DB5_MASK 'h001c0000 -#define RF5G_RF5G1_DB5_GET(x) (((x) & RF5G_RF5G1_DB5_MASK) >> RF5G_RF5G1_DB5_LSB) -#define RF5G_RF5G1_DB5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_DB5_LSB) & RF5G_RF5G1_DB5_MASK) -#define RF5G_RF5G1_DB5_RESET 3'h4 -#define RF5G_RF5G1_OB5_MSB 17 -#define RF5G_RF5G1_OB5_LSB 15 -#define RF5G_RF5G1_OB5_MASK 'h00038000 -#define RF5G_RF5G1_OB5_GET(x) (((x) & RF5G_RF5G1_OB5_MASK) >> RF5G_RF5G1_OB5_LSB) -#define RF5G_RF5G1_OB5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_OB5_LSB) & RF5G_RF5G1_OB5_MASK) -#define RF5G_RF5G1_OB5_RESET 3'h4 -#define RF5G_RF5G1_TX5_ATB_SEL_MSB 14 -#define RF5G_RF5G1_TX5_ATB_SEL_LSB 12 -#define RF5G_RF5G1_TX5_ATB_SEL_MASK 'h00007000 -#define RF5G_RF5G1_TX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_TX5_ATB_SEL_MASK) >> RF5G_RF5G1_TX5_ATB_SEL_LSB) -#define RF5G_RF5G1_TX5_ATB_SEL_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_TX5_ATB_SEL_LSB) & RF5G_RF5G1_TX5_ATB_SEL_MASK) -#define RF5G_RF5G1_TX5_ATB_SEL_RESET 3'h0 -#define RF5G_RF5G1_PDLO5DIV_MSB 11 -#define RF5G_RF5G1_PDLO5DIV_LSB 11 -#define RF5G_RF5G1_PDLO5DIV_MASK 'h00000800 -#define RF5G_RF5G1_PDLO5DIV_GET(x) (((x) & RF5G_RF5G1_PDLO5DIV_MASK) >> RF5G_RF5G1_PDLO5DIV_LSB) -#define RF5G_RF5G1_PDLO5DIV_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDLO5DIV_LSB) & RF5G_RF5G1_PDLO5DIV_MASK) -#define RF5G_RF5G1_PDLO5DIV_RESET 1'h0 -#define RF5G_RF5G1_PDLO5MIX_MSB 10 -#define RF5G_RF5G1_PDLO5MIX_LSB 10 -#define RF5G_RF5G1_PDLO5MIX_MASK 'h00000400 -#define RF5G_RF5G1_PDLO5MIX_GET(x) (((x) & RF5G_RF5G1_PDLO5MIX_MASK) >> RF5G_RF5G1_PDLO5MIX_LSB) -#define RF5G_RF5G1_PDLO5MIX_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDLO5MIX_LSB) & RF5G_RF5G1_PDLO5MIX_MASK) -#define RF5G_RF5G1_PDLO5MIX_RESET 1'h0 -#define RF5G_RF5G1_PDQBUF5_MSB 9 -#define RF5G_RF5G1_PDQBUF5_LSB 9 -#define RF5G_RF5G1_PDQBUF5_MASK 'h00000200 -#define RF5G_RF5G1_PDQBUF5_GET(x) (((x) & RF5G_RF5G1_PDQBUF5_MASK) >> RF5G_RF5G1_PDQBUF5_LSB) -#define RF5G_RF5G1_PDQBUF5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDQBUF5_LSB) & RF5G_RF5G1_PDQBUF5_MASK) -#define RF5G_RF5G1_PDQBUF5_RESET 1'h0 -#define RF5G_RF5G1_PDLO5AGC_MSB 8 -#define RF5G_RF5G1_PDLO5AGC_LSB 8 -#define RF5G_RF5G1_PDLO5AGC_MASK 'h00000100 -#define RF5G_RF5G1_PDLO5AGC_GET(x) (((x) & RF5G_RF5G1_PDLO5AGC_MASK) >> RF5G_RF5G1_PDLO5AGC_LSB) -#define RF5G_RF5G1_PDLO5AGC_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDLO5AGC_LSB) & RF5G_RF5G1_PDLO5AGC_MASK) -#define RF5G_RF5G1_PDLO5AGC_RESET 1'h0 -#define RF5G_RF5G1_PDREGLO5_MSB 7 -#define RF5G_RF5G1_PDREGLO5_LSB 7 -#define RF5G_RF5G1_PDREGLO5_MASK 'h00000080 -#define RF5G_RF5G1_PDREGLO5_GET(x) (((x) & RF5G_RF5G1_PDREGLO5_MASK) >> RF5G_RF5G1_PDREGLO5_LSB) -#define RF5G_RF5G1_PDREGLO5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDREGLO5_LSB) & RF5G_RF5G1_PDREGLO5_MASK) -#define RF5G_RF5G1_PDREGLO5_RESET 1'h0 -#define RF5G_RF5G1_LO5_ATB_SEL_MSB 6 -#define RF5G_RF5G1_LO5_ATB_SEL_LSB 4 -#define RF5G_RF5G1_LO5_ATB_SEL_MASK 'h00000070 -#define RF5G_RF5G1_LO5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_LO5_ATB_SEL_MASK) >> RF5G_RF5G1_LO5_ATB_SEL_LSB) -#define RF5G_RF5G1_LO5_ATB_SEL_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_LO5_ATB_SEL_LSB) & RF5G_RF5G1_LO5_ATB_SEL_MASK) -#define RF5G_RF5G1_LO5_ATB_SEL_RESET 3'h0 -#define RF5G_RF5G1_LO5CONTROL_MSB 3 -#define RF5G_RF5G1_LO5CONTROL_LSB 3 -#define RF5G_RF5G1_LO5CONTROL_MASK 'h00000008 -#define RF5G_RF5G1_LO5CONTROL_GET(x) (((x) & RF5G_RF5G1_LO5CONTROL_MASK) >> RF5G_RF5G1_LO5CONTROL_LSB) -#define RF5G_RF5G1_LO5CONTROL_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_LO5CONTROL_LSB) & RF5G_RF5G1_LO5CONTROL_MASK) -#define RF5G_RF5G1_LO5CONTROL_RESET 1'h0 -#define RF5G_RF5G1_REGLO_BYPASS5_MSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_LSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_MASK 'h00000004 -#define RF5G_RF5G1_REGLO_BYPASS5_GET(x) (((x) & RF5G_RF5G1_REGLO_BYPASS5_MASK) >> RF5G_RF5G1_REGLO_BYPASS5_LSB) -#define RF5G_RF5G1_REGLO_BYPASS5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_REGLO_BYPASS5_LSB) & RF5G_RF5G1_REGLO_BYPASS5_MASK) -#define RF5G_RF5G1_REGLO_BYPASS5_RESET 1'h0 -#define RF5G_RF5G1_SPARE_MSB 1 -#define RF5G_RF5G1_SPARE_LSB 0 -#define RF5G_RF5G1_SPARE_MASK 'h00000003 -#define RF5G_RF5G1_SPARE_GET(x) (((x) & RF5G_RF5G1_SPARE_MASK) >> RF5G_RF5G1_SPARE_LSB) -#define RF5G_RF5G1_SPARE_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_SPARE_LSB) & RF5G_RF5G1_SPARE_MASK) -#define RF5G_RF5G1_SPARE_RESET 2'h0 -#define RF5G_RF5G1_RESET (32'h0 | \ - RF5G_RF5G1_PDTXLO5_SET(RF5G_RF5G1_PDTXLO5_RESET) | \ - RF5G_RF5G1_PDTXMIX5_SET(RF5G_RF5G1_PDTXMIX5_RESET) | \ - RF5G_RF5G1_PDTXBUF5_SET(RF5G_RF5G1_PDTXBUF5_RESET) | \ - RF5G_RF5G1_PDPADRV5_SET(RF5G_RF5G1_PDPADRV5_RESET) | \ - RF5G_RF5G1_PDPAOUT5_SET(RF5G_RF5G1_PDPAOUT5_RESET) | \ - RF5G_RF5G1_TUNE_PADRV5_SET(RF5G_RF5G1_TUNE_PADRV5_RESET) | \ - RF5G_RF5G1_PWDTXPKD_SET(RF5G_RF5G1_PWDTXPKD_RESET) | \ - RF5G_RF5G1_DB5_SET(RF5G_RF5G1_DB5_RESET) | \ - RF5G_RF5G1_OB5_SET(RF5G_RF5G1_OB5_RESET) | \ - RF5G_RF5G1_TX5_ATB_SEL_SET(RF5G_RF5G1_TX5_ATB_SEL_RESET) | \ - RF5G_RF5G1_PDLO5DIV_SET(RF5G_RF5G1_PDLO5DIV_RESET) | \ - RF5G_RF5G1_PDLO5MIX_SET(RF5G_RF5G1_PDLO5MIX_RESET) | \ - RF5G_RF5G1_PDQBUF5_SET(RF5G_RF5G1_PDQBUF5_RESET) | \ - RF5G_RF5G1_PDLO5AGC_SET(RF5G_RF5G1_PDLO5AGC_RESET) | \ - RF5G_RF5G1_PDREGLO5_SET(RF5G_RF5G1_PDREGLO5_RESET) | \ - RF5G_RF5G1_LO5_ATB_SEL_SET(RF5G_RF5G1_LO5_ATB_SEL_RESET) | \ - RF5G_RF5G1_LO5CONTROL_SET(RF5G_RF5G1_LO5CONTROL_RESET) | \ - RF5G_RF5G1_REGLO_BYPASS5_SET(RF5G_RF5G1_REGLO_BYPASS5_RESET) | \ - RF5G_RF5G1_SPARE_SET(RF5G_RF5G1_SPARE_RESET)) -#define RF5G_RF5G1_HW_MASK (32'h0) -#define RF5G_RF5G1_SW_MASK (32'h0 | \ - RF5G_RF5G1_PDTXLO5_MASK | \ - RF5G_RF5G1_PDTXMIX5_MASK | \ - RF5G_RF5G1_PDTXBUF5_MASK | \ - RF5G_RF5G1_PDPADRV5_MASK | \ - RF5G_RF5G1_PDPAOUT5_MASK | \ - RF5G_RF5G1_TUNE_PADRV5_MASK | \ - RF5G_RF5G1_PWDTXPKD_MASK | \ - RF5G_RF5G1_DB5_MASK | \ - RF5G_RF5G1_OB5_MASK | \ - RF5G_RF5G1_TX5_ATB_SEL_MASK | \ - RF5G_RF5G1_PDLO5DIV_MASK | \ - RF5G_RF5G1_PDLO5MIX_MASK | \ - RF5G_RF5G1_PDQBUF5_MASK | \ - RF5G_RF5G1_PDLO5AGC_MASK | \ - RF5G_RF5G1_PDREGLO5_MASK | \ - RF5G_RF5G1_LO5_ATB_SEL_MASK | \ - RF5G_RF5G1_LO5CONTROL_MASK | \ - RF5G_RF5G1_REGLO_BYPASS5_MASK | \ - RF5G_RF5G1_SPARE_MASK) - -#define RF5G_RF5G2_ADDRESS 'h00000024 -#define RF5G_RF5G2_AGCLO_B_MSB 31 -#define RF5G_RF5G2_AGCLO_B_LSB 29 -#define RF5G_RF5G2_AGCLO_B_MASK 'he0000000 -#define RF5G_RF5G2_AGCLO_B_GET(x) (((x) & RF5G_RF5G2_AGCLO_B_MASK) >> RF5G_RF5G2_AGCLO_B_LSB) -#define RF5G_RF5G2_AGCLO_B_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_AGCLO_B_LSB) & RF5G_RF5G2_AGCLO_B_MASK) -#define RF5G_RF5G2_AGCLO_B_RESET 3'h4 -#define RF5G_RF5G2_RX5_ATB_SEL_MSB 28 -#define RF5G_RF5G2_RX5_ATB_SEL_LSB 26 -#define RF5G_RF5G2_RX5_ATB_SEL_MASK 'h1c000000 -#define RF5G_RF5G2_RX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G2_RX5_ATB_SEL_MASK) >> RF5G_RF5G2_RX5_ATB_SEL_LSB) -#define RF5G_RF5G2_RX5_ATB_SEL_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_RX5_ATB_SEL_LSB) & RF5G_RF5G2_RX5_ATB_SEL_MASK) -#define RF5G_RF5G2_RX5_ATB_SEL_RESET 3'h0 -#define RF5G_RF5G2_PDCMOSLO5_MSB 25 -#define RF5G_RF5G2_PDCMOSLO5_LSB 25 -#define RF5G_RF5G2_PDCMOSLO5_MASK 'h02000000 -#define RF5G_RF5G2_PDCMOSLO5_GET(x) (((x) & RF5G_RF5G2_PDCMOSLO5_MASK) >> RF5G_RF5G2_PDCMOSLO5_LSB) -#define RF5G_RF5G2_PDCMOSLO5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDCMOSLO5_LSB) & RF5G_RF5G2_PDCMOSLO5_MASK) -#define RF5G_RF5G2_PDCMOSLO5_RESET 1'h0 -#define RF5G_RF5G2_PDVGM5_MSB 24 -#define RF5G_RF5G2_PDVGM5_LSB 24 -#define RF5G_RF5G2_PDVGM5_MASK 'h01000000 -#define RF5G_RF5G2_PDVGM5_GET(x) (((x) & RF5G_RF5G2_PDVGM5_MASK) >> RF5G_RF5G2_PDVGM5_LSB) -#define RF5G_RF5G2_PDVGM5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDVGM5_LSB) & RF5G_RF5G2_PDVGM5_MASK) -#define RF5G_RF5G2_PDVGM5_RESET 1'h0 -#define RF5G_RF5G2_PDCSLNA5_MSB 23 -#define RF5G_RF5G2_PDCSLNA5_LSB 23 -#define RF5G_RF5G2_PDCSLNA5_MASK 'h00800000 -#define RF5G_RF5G2_PDCSLNA5_GET(x) (((x) & RF5G_RF5G2_PDCSLNA5_MASK) >> RF5G_RF5G2_PDCSLNA5_LSB) -#define RF5G_RF5G2_PDCSLNA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDCSLNA5_LSB) & RF5G_RF5G2_PDCSLNA5_MASK) -#define RF5G_RF5G2_PDCSLNA5_RESET 1'h0 -#define RF5G_RF5G2_PDRFVGA5_MSB 22 -#define RF5G_RF5G2_PDRFVGA5_LSB 22 -#define RF5G_RF5G2_PDRFVGA5_MASK 'h00400000 -#define RF5G_RF5G2_PDRFVGA5_GET(x) (((x) & RF5G_RF5G2_PDRFVGA5_MASK) >> RF5G_RF5G2_PDRFVGA5_LSB) -#define RF5G_RF5G2_PDRFVGA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDRFVGA5_LSB) & RF5G_RF5G2_PDRFVGA5_MASK) -#define RF5G_RF5G2_PDRFVGA5_RESET 1'h0 -#define RF5G_RF5G2_PDREGFE5_MSB 21 -#define RF5G_RF5G2_PDREGFE5_LSB 21 -#define RF5G_RF5G2_PDREGFE5_MASK 'h00200000 -#define RF5G_RF5G2_PDREGFE5_GET(x) (((x) & RF5G_RF5G2_PDREGFE5_MASK) >> RF5G_RF5G2_PDREGFE5_LSB) -#define RF5G_RF5G2_PDREGFE5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDREGFE5_LSB) & RF5G_RF5G2_PDREGFE5_MASK) -#define RF5G_RF5G2_PDREGFE5_RESET 1'h0 -#define RF5G_RF5G2_TUNE_RFVGA5_MSB 20 -#define RF5G_RF5G2_TUNE_RFVGA5_LSB 18 -#define RF5G_RF5G2_TUNE_RFVGA5_MASK 'h001c0000 -#define RF5G_RF5G2_TUNE_RFVGA5_GET(x) (((x) & RF5G_RF5G2_TUNE_RFVGA5_MASK) >> RF5G_RF5G2_TUNE_RFVGA5_LSB) -#define RF5G_RF5G2_TUNE_RFVGA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_TUNE_RFVGA5_LSB) & RF5G_RF5G2_TUNE_RFVGA5_MASK) -#define RF5G_RF5G2_TUNE_RFVGA5_RESET 3'h0 -#define RF5G_RF5G2_BRFVGA5_MSB 17 -#define RF5G_RF5G2_BRFVGA5_LSB 15 -#define RF5G_RF5G2_BRFVGA5_MASK 'h00038000 -#define RF5G_RF5G2_BRFVGA5_GET(x) (((x) & RF5G_RF5G2_BRFVGA5_MASK) >> RF5G_RF5G2_BRFVGA5_LSB) -#define RF5G_RF5G2_BRFVGA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_BRFVGA5_LSB) & RF5G_RF5G2_BRFVGA5_MASK) -#define RF5G_RF5G2_BRFVGA5_RESET 3'h5 -#define RF5G_RF5G2_BCSLNA5_MSB 14 -#define RF5G_RF5G2_BCSLNA5_LSB 12 -#define RF5G_RF5G2_BCSLNA5_MASK 'h00007000 -#define RF5G_RF5G2_BCSLNA5_GET(x) (((x) & RF5G_RF5G2_BCSLNA5_MASK) >> RF5G_RF5G2_BCSLNA5_LSB) -#define RF5G_RF5G2_BCSLNA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_BCSLNA5_LSB) & RF5G_RF5G2_BCSLNA5_MASK) -#define RF5G_RF5G2_BCSLNA5_RESET 3'h3 -#define RF5G_RF5G2_BVGM5_MSB 11 -#define RF5G_RF5G2_BVGM5_LSB 9 -#define RF5G_RF5G2_BVGM5_MASK 'h00000e00 -#define RF5G_RF5G2_BVGM5_GET(x) (((x) & RF5G_RF5G2_BVGM5_MASK) >> RF5G_RF5G2_BVGM5_LSB) -#define RF5G_RF5G2_BVGM5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_BVGM5_LSB) & RF5G_RF5G2_BVGM5_MASK) -#define RF5G_RF5G2_BVGM5_RESET 3'h1 -#define RF5G_RF5G2_REGFE_BYPASS5_MSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_LSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_MASK 'h00000100 -#define RF5G_RF5G2_REGFE_BYPASS5_GET(x) (((x) & RF5G_RF5G2_REGFE_BYPASS5_MASK) >> RF5G_RF5G2_REGFE_BYPASS5_LSB) -#define RF5G_RF5G2_REGFE_BYPASS5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_REGFE_BYPASS5_LSB) & RF5G_RF5G2_REGFE_BYPASS5_MASK) -#define RF5G_RF5G2_REGFE_BYPASS5_RESET 1'h0 -#define RF5G_RF5G2_LNA5_ATTENMODE_MSB 7 -#define RF5G_RF5G2_LNA5_ATTENMODE_LSB 6 -#define RF5G_RF5G2_LNA5_ATTENMODE_MASK 'h000000c0 -#define RF5G_RF5G2_LNA5_ATTENMODE_GET(x) (((x) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) >> RF5G_RF5G2_LNA5_ATTENMODE_LSB) -#define RF5G_RF5G2_LNA5_ATTENMODE_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_LNA5_ATTENMODE_LSB) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) -#define RF5G_RF5G2_LNA5_ATTENMODE_RESET 2'h0 -#define RF5G_RF5G2_ENABLE_PCA_MSB 5 -#define RF5G_RF5G2_ENABLE_PCA_LSB 5 -#define RF5G_RF5G2_ENABLE_PCA_MASK 'h00000020 -#define RF5G_RF5G2_ENABLE_PCA_GET(x) (((x) & RF5G_RF5G2_ENABLE_PCA_MASK) >> RF5G_RF5G2_ENABLE_PCA_LSB) -#define RF5G_RF5G2_ENABLE_PCA_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_ENABLE_PCA_LSB) & RF5G_RF5G2_ENABLE_PCA_MASK) -#define RF5G_RF5G2_ENABLE_PCA_RESET 1'h0 -#define RF5G_RF5G2_TUNE_LO_MSB 4 -#define RF5G_RF5G2_TUNE_LO_LSB 2 -#define RF5G_RF5G2_TUNE_LO_MASK 'h0000001c -#define RF5G_RF5G2_TUNE_LO_GET(x) (((x) & RF5G_RF5G2_TUNE_LO_MASK) >> RF5G_RF5G2_TUNE_LO_LSB) -#define RF5G_RF5G2_TUNE_LO_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_TUNE_LO_LSB) & RF5G_RF5G2_TUNE_LO_MASK) -#define RF5G_RF5G2_TUNE_LO_RESET 3'h0 -#define RF5G_RF5G2_SPARE_MSB 1 -#define RF5G_RF5G2_SPARE_LSB 0 -#define RF5G_RF5G2_SPARE_MASK 'h00000003 -#define RF5G_RF5G2_SPARE_GET(x) (((x) & RF5G_RF5G2_SPARE_MASK) >> RF5G_RF5G2_SPARE_LSB) -#define RF5G_RF5G2_SPARE_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_SPARE_LSB) & RF5G_RF5G2_SPARE_MASK) -#define RF5G_RF5G2_SPARE_RESET 2'h0 -#define RF5G_RF5G2_RESET (32'h0 | \ - RF5G_RF5G2_AGCLO_B_SET(RF5G_RF5G2_AGCLO_B_RESET) | \ - RF5G_RF5G2_RX5_ATB_SEL_SET(RF5G_RF5G2_RX5_ATB_SEL_RESET) | \ - RF5G_RF5G2_PDCMOSLO5_SET(RF5G_RF5G2_PDCMOSLO5_RESET) | \ - RF5G_RF5G2_PDVGM5_SET(RF5G_RF5G2_PDVGM5_RESET) | \ - RF5G_RF5G2_PDCSLNA5_SET(RF5G_RF5G2_PDCSLNA5_RESET) | \ - RF5G_RF5G2_PDRFVGA5_SET(RF5G_RF5G2_PDRFVGA5_RESET) | \ - RF5G_RF5G2_PDREGFE5_SET(RF5G_RF5G2_PDREGFE5_RESET) | \ - RF5G_RF5G2_TUNE_RFVGA5_SET(RF5G_RF5G2_TUNE_RFVGA5_RESET) | \ - RF5G_RF5G2_BRFVGA5_SET(RF5G_RF5G2_BRFVGA5_RESET) | \ - RF5G_RF5G2_BCSLNA5_SET(RF5G_RF5G2_BCSLNA5_RESET) | \ - RF5G_RF5G2_BVGM5_SET(RF5G_RF5G2_BVGM5_RESET) | \ - RF5G_RF5G2_REGFE_BYPASS5_SET(RF5G_RF5G2_REGFE_BYPASS5_RESET) | \ - RF5G_RF5G2_LNA5_ATTENMODE_SET(RF5G_RF5G2_LNA5_ATTENMODE_RESET) | \ - RF5G_RF5G2_ENABLE_PCA_SET(RF5G_RF5G2_ENABLE_PCA_RESET) | \ - RF5G_RF5G2_TUNE_LO_SET(RF5G_RF5G2_TUNE_LO_RESET) | \ - RF5G_RF5G2_SPARE_SET(RF5G_RF5G2_SPARE_RESET)) -#define RF5G_RF5G2_HW_MASK (32'h0) -#define RF5G_RF5G2_SW_MASK (32'h0 | \ - RF5G_RF5G2_AGCLO_B_MASK | \ - RF5G_RF5G2_RX5_ATB_SEL_MASK | \ - RF5G_RF5G2_PDCMOSLO5_MASK | \ - RF5G_RF5G2_PDVGM5_MASK | \ - RF5G_RF5G2_PDCSLNA5_MASK | \ - RF5G_RF5G2_PDRFVGA5_MASK | \ - RF5G_RF5G2_PDREGFE5_MASK | \ - RF5G_RF5G2_TUNE_RFVGA5_MASK | \ - RF5G_RF5G2_BRFVGA5_MASK | \ - RF5G_RF5G2_BCSLNA5_MASK | \ - RF5G_RF5G2_BVGM5_MASK | \ - RF5G_RF5G2_REGFE_BYPASS5_MASK | \ - RF5G_RF5G2_LNA5_ATTENMODE_MASK | \ - RF5G_RF5G2_ENABLE_PCA_MASK | \ - RF5G_RF5G2_TUNE_LO_MASK | \ - RF5G_RF5G2_SPARE_MASK) - -#define RF2G_RF2G1_ADDRESS 'h00000028 -#define RF2G_RF2G1_BLNA1_MSB 31 -#define RF2G_RF2G1_BLNA1_LSB 29 -#define RF2G_RF2G1_BLNA1_MASK 'he0000000 -#define RF2G_RF2G1_BLNA1_GET(x) (((x) & RF2G_RF2G1_BLNA1_MASK) >> RF2G_RF2G1_BLNA1_LSB) -#define RF2G_RF2G1_BLNA1_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA1_LSB) & RF2G_RF2G1_BLNA1_MASK) -#define RF2G_RF2G1_BLNA1_RESET 3'h3 -#define RF2G_RF2G1_BLNA1F_MSB 28 -#define RF2G_RF2G1_BLNA1F_LSB 26 -#define RF2G_RF2G1_BLNA1F_MASK 'h1c000000 -#define RF2G_RF2G1_BLNA1F_GET(x) (((x) & RF2G_RF2G1_BLNA1F_MASK) >> RF2G_RF2G1_BLNA1F_LSB) -#define RF2G_RF2G1_BLNA1F_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA1F_LSB) & RF2G_RF2G1_BLNA1F_MASK) -#define RF2G_RF2G1_BLNA1F_RESET 3'h0 -#define RF2G_RF2G1_BLNA1BUF_MSB 25 -#define RF2G_RF2G1_BLNA1BUF_LSB 23 -#define RF2G_RF2G1_BLNA1BUF_MASK 'h03800000 -#define RF2G_RF2G1_BLNA1BUF_GET(x) (((x) & RF2G_RF2G1_BLNA1BUF_MASK) >> RF2G_RF2G1_BLNA1BUF_LSB) -#define RF2G_RF2G1_BLNA1BUF_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA1BUF_LSB) & RF2G_RF2G1_BLNA1BUF_MASK) -#define RF2G_RF2G1_BLNA1BUF_RESET 3'h3 -#define RF2G_RF2G1_BLNA2_MSB 22 -#define RF2G_RF2G1_BLNA2_LSB 20 -#define RF2G_RF2G1_BLNA2_MASK 'h00700000 -#define RF2G_RF2G1_BLNA2_GET(x) (((x) & RF2G_RF2G1_BLNA2_MASK) >> RF2G_RF2G1_BLNA2_LSB) -#define RF2G_RF2G1_BLNA2_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA2_LSB) & RF2G_RF2G1_BLNA2_MASK) -#define RF2G_RF2G1_BLNA2_RESET 3'h3 -#define RF2G_RF2G1_DB_MSB 19 -#define RF2G_RF2G1_DB_LSB 17 -#define RF2G_RF2G1_DB_MASK 'h000e0000 -#define RF2G_RF2G1_DB_GET(x) (((x) & RF2G_RF2G1_DB_MASK) >> RF2G_RF2G1_DB_LSB) -#define RF2G_RF2G1_DB_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_DB_LSB) & RF2G_RF2G1_DB_MASK) -#define RF2G_RF2G1_DB_RESET 3'h3 -#define RF2G_RF2G1_OB_MSB 16 -#define RF2G_RF2G1_OB_LSB 14 -#define RF2G_RF2G1_OB_MASK 'h0001c000 -#define RF2G_RF2G1_OB_GET(x) (((x) & RF2G_RF2G1_OB_MASK) >> RF2G_RF2G1_OB_LSB) -#define RF2G_RF2G1_OB_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_OB_LSB) & RF2G_RF2G1_OB_MASK) -#define RF2G_RF2G1_OB_RESET 3'h3 -#define RF2G_RF2G1_FE_ATB_SEL_MSB 13 -#define RF2G_RF2G1_FE_ATB_SEL_LSB 11 -#define RF2G_RF2G1_FE_ATB_SEL_MASK 'h00003800 -#define RF2G_RF2G1_FE_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_FE_ATB_SEL_MASK) >> RF2G_RF2G1_FE_ATB_SEL_LSB) -#define RF2G_RF2G1_FE_ATB_SEL_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_FE_ATB_SEL_LSB) & RF2G_RF2G1_FE_ATB_SEL_MASK) -#define RF2G_RF2G1_FE_ATB_SEL_RESET 3'h0 -#define RF2G_RF2G1_RF_ATB_SEL_MSB 10 -#define RF2G_RF2G1_RF_ATB_SEL_LSB 8 -#define RF2G_RF2G1_RF_ATB_SEL_MASK 'h00000700 -#define RF2G_RF2G1_RF_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_RF_ATB_SEL_MASK) >> RF2G_RF2G1_RF_ATB_SEL_LSB) -#define RF2G_RF2G1_RF_ATB_SEL_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_RF_ATB_SEL_LSB) & RF2G_RF2G1_RF_ATB_SEL_MASK) -#define RF2G_RF2G1_RF_ATB_SEL_RESET 3'h0 -#define RF2G_RF2G1_SELLNA_MSB 7 -#define RF2G_RF2G1_SELLNA_LSB 7 -#define RF2G_RF2G1_SELLNA_MASK 'h00000080 -#define RF2G_RF2G1_SELLNA_GET(x) (((x) & RF2G_RF2G1_SELLNA_MASK) >> RF2G_RF2G1_SELLNA_LSB) -#define RF2G_RF2G1_SELLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_SELLNA_LSB) & RF2G_RF2G1_SELLNA_MASK) -#define RF2G_RF2G1_SELLNA_RESET 1'h1 -#define RF2G_RF2G1_LOCONTROL_MSB 6 -#define RF2G_RF2G1_LOCONTROL_LSB 6 -#define RF2G_RF2G1_LOCONTROL_MASK 'h00000040 -#define RF2G_RF2G1_LOCONTROL_GET(x) (((x) & RF2G_RF2G1_LOCONTROL_MASK) >> RF2G_RF2G1_LOCONTROL_LSB) -#define RF2G_RF2G1_LOCONTROL_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_LOCONTROL_LSB) & RF2G_RF2G1_LOCONTROL_MASK) -#define RF2G_RF2G1_LOCONTROL_RESET 1'h0 -#define RF2G_RF2G1_SHORTLNA2_MSB 5 -#define RF2G_RF2G1_SHORTLNA2_LSB 5 -#define RF2G_RF2G1_SHORTLNA2_MASK 'h00000020 -#define RF2G_RF2G1_SHORTLNA2_GET(x) (((x) & RF2G_RF2G1_SHORTLNA2_MASK) >> RF2G_RF2G1_SHORTLNA2_LSB) -#define RF2G_RF2G1_SHORTLNA2_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_SHORTLNA2_LSB) & RF2G_RF2G1_SHORTLNA2_MASK) -#define RF2G_RF2G1_SHORTLNA2_RESET 1'h0 -#define RF2G_RF2G1_SPARE_MSB 4 -#define RF2G_RF2G1_SPARE_LSB 0 -#define RF2G_RF2G1_SPARE_MASK 'h0000001f -#define RF2G_RF2G1_SPARE_GET(x) (((x) & RF2G_RF2G1_SPARE_MASK) >> RF2G_RF2G1_SPARE_LSB) -#define RF2G_RF2G1_SPARE_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_SPARE_LSB) & RF2G_RF2G1_SPARE_MASK) -#define RF2G_RF2G1_SPARE_RESET 5'h0 -#define RF2G_RF2G1_RESET (32'h0 | \ - RF2G_RF2G1_BLNA1_SET(RF2G_RF2G1_BLNA1_RESET) | \ - RF2G_RF2G1_BLNA1F_SET(RF2G_RF2G1_BLNA1F_RESET) | \ - RF2G_RF2G1_BLNA1BUF_SET(RF2G_RF2G1_BLNA1BUF_RESET) | \ - RF2G_RF2G1_BLNA2_SET(RF2G_RF2G1_BLNA2_RESET) | \ - RF2G_RF2G1_DB_SET(RF2G_RF2G1_DB_RESET) | \ - RF2G_RF2G1_OB_SET(RF2G_RF2G1_OB_RESET) | \ - RF2G_RF2G1_FE_ATB_SEL_SET(RF2G_RF2G1_FE_ATB_SEL_RESET) | \ - RF2G_RF2G1_RF_ATB_SEL_SET(RF2G_RF2G1_RF_ATB_SEL_RESET) | \ - RF2G_RF2G1_SELLNA_SET(RF2G_RF2G1_SELLNA_RESET) | \ - RF2G_RF2G1_LOCONTROL_SET(RF2G_RF2G1_LOCONTROL_RESET) | \ - RF2G_RF2G1_SHORTLNA2_SET(RF2G_RF2G1_SHORTLNA2_RESET) | \ - RF2G_RF2G1_SPARE_SET(RF2G_RF2G1_SPARE_RESET)) -#define RF2G_RF2G1_HW_MASK (32'h0) -#define RF2G_RF2G1_SW_MASK (32'h0 | \ - RF2G_RF2G1_BLNA1_MASK | \ - RF2G_RF2G1_BLNA1F_MASK | \ - RF2G_RF2G1_BLNA1BUF_MASK | \ - RF2G_RF2G1_BLNA2_MASK | \ - RF2G_RF2G1_DB_MASK | \ - RF2G_RF2G1_OB_MASK | \ - RF2G_RF2G1_FE_ATB_SEL_MASK | \ - RF2G_RF2G1_RF_ATB_SEL_MASK | \ - RF2G_RF2G1_SELLNA_MASK | \ - RF2G_RF2G1_LOCONTROL_MASK | \ - RF2G_RF2G1_SHORTLNA2_MASK | \ - RF2G_RF2G1_SPARE_MASK) - -#define RF2G_RF2G2_ADDRESS 'h0000002c -#define RF2G_RF2G2_PDCGLNA_MSB 31 -#define RF2G_RF2G2_PDCGLNA_LSB 31 -#define RF2G_RF2G2_PDCGLNA_MASK 'h80000000 -#define RF2G_RF2G2_PDCGLNA_GET(x) (((x) & RF2G_RF2G2_PDCGLNA_MASK) >> RF2G_RF2G2_PDCGLNA_LSB) -#define RF2G_RF2G2_PDCGLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDCGLNA_LSB) & RF2G_RF2G2_PDCGLNA_MASK) -#define RF2G_RF2G2_PDCGLNA_RESET 1'h0 -#define RF2G_RF2G2_PDCGLNABUF_MSB 30 -#define RF2G_RF2G2_PDCGLNABUF_LSB 30 -#define RF2G_RF2G2_PDCGLNABUF_MASK 'h40000000 -#define RF2G_RF2G2_PDCGLNABUF_GET(x) (((x) & RF2G_RF2G2_PDCGLNABUF_MASK) >> RF2G_RF2G2_PDCGLNABUF_LSB) -#define RF2G_RF2G2_PDCGLNABUF_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDCGLNABUF_LSB) & RF2G_RF2G2_PDCGLNABUF_MASK) -#define RF2G_RF2G2_PDCGLNABUF_RESET 1'h0 -#define RF2G_RF2G2_PDCSLNA_MSB 29 -#define RF2G_RF2G2_PDCSLNA_LSB 29 -#define RF2G_RF2G2_PDCSLNA_MASK 'h20000000 -#define RF2G_RF2G2_PDCSLNA_GET(x) (((x) & RF2G_RF2G2_PDCSLNA_MASK) >> RF2G_RF2G2_PDCSLNA_LSB) -#define RF2G_RF2G2_PDCSLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDCSLNA_LSB) & RF2G_RF2G2_PDCSLNA_MASK) -#define RF2G_RF2G2_PDCSLNA_RESET 1'h0 -#define RF2G_RF2G2_PDDIV_MSB 28 -#define RF2G_RF2G2_PDDIV_LSB 28 -#define RF2G_RF2G2_PDDIV_MASK 'h10000000 -#define RF2G_RF2G2_PDDIV_GET(x) (((x) & RF2G_RF2G2_PDDIV_MASK) >> RF2G_RF2G2_PDDIV_LSB) -#define RF2G_RF2G2_PDDIV_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDDIV_LSB) & RF2G_RF2G2_PDDIV_MASK) -#define RF2G_RF2G2_PDDIV_RESET 1'h0 -#define RF2G_RF2G2_PDPADRV_MSB 27 -#define RF2G_RF2G2_PDPADRV_LSB 27 -#define RF2G_RF2G2_PDPADRV_MASK 'h08000000 -#define RF2G_RF2G2_PDPADRV_GET(x) (((x) & RF2G_RF2G2_PDPADRV_MASK) >> RF2G_RF2G2_PDPADRV_LSB) -#define RF2G_RF2G2_PDPADRV_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDPADRV_LSB) & RF2G_RF2G2_PDPADRV_MASK) -#define RF2G_RF2G2_PDPADRV_RESET 1'h0 -#define RF2G_RF2G2_PDPAOUT_MSB 26 -#define RF2G_RF2G2_PDPAOUT_LSB 26 -#define RF2G_RF2G2_PDPAOUT_MASK 'h04000000 -#define RF2G_RF2G2_PDPAOUT_GET(x) (((x) & RF2G_RF2G2_PDPAOUT_MASK) >> RF2G_RF2G2_PDPAOUT_LSB) -#define RF2G_RF2G2_PDPAOUT_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDPAOUT_LSB) & RF2G_RF2G2_PDPAOUT_MASK) -#define RF2G_RF2G2_PDPAOUT_RESET 1'h0 -#define RF2G_RF2G2_PDREGLNA_MSB 25 -#define RF2G_RF2G2_PDREGLNA_LSB 25 -#define RF2G_RF2G2_PDREGLNA_MASK 'h02000000 -#define RF2G_RF2G2_PDREGLNA_GET(x) (((x) & RF2G_RF2G2_PDREGLNA_MASK) >> RF2G_RF2G2_PDREGLNA_LSB) -#define RF2G_RF2G2_PDREGLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDREGLNA_LSB) & RF2G_RF2G2_PDREGLNA_MASK) -#define RF2G_RF2G2_PDREGLNA_RESET 1'h0 -#define RF2G_RF2G2_PDREGLO_MSB 24 -#define RF2G_RF2G2_PDREGLO_LSB 24 -#define RF2G_RF2G2_PDREGLO_MASK 'h01000000 -#define RF2G_RF2G2_PDREGLO_GET(x) (((x) & RF2G_RF2G2_PDREGLO_MASK) >> RF2G_RF2G2_PDREGLO_LSB) -#define RF2G_RF2G2_PDREGLO_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDREGLO_LSB) & RF2G_RF2G2_PDREGLO_MASK) -#define RF2G_RF2G2_PDREGLO_RESET 1'h0 -#define RF2G_RF2G2_PDRFGM_MSB 23 -#define RF2G_RF2G2_PDRFGM_LSB 23 -#define RF2G_RF2G2_PDRFGM_MASK 'h00800000 -#define RF2G_RF2G2_PDRFGM_GET(x) (((x) & RF2G_RF2G2_PDRFGM_MASK) >> RF2G_RF2G2_PDRFGM_LSB) -#define RF2G_RF2G2_PDRFGM_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDRFGM_LSB) & RF2G_RF2G2_PDRFGM_MASK) -#define RF2G_RF2G2_PDRFGM_RESET 1'h0 -#define RF2G_RF2G2_PDRXLO_MSB 22 -#define RF2G_RF2G2_PDRXLO_LSB 22 -#define RF2G_RF2G2_PDRXLO_MASK 'h00400000 -#define RF2G_RF2G2_PDRXLO_GET(x) (((x) & RF2G_RF2G2_PDRXLO_MASK) >> RF2G_RF2G2_PDRXLO_LSB) -#define RF2G_RF2G2_PDRXLO_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDRXLO_LSB) & RF2G_RF2G2_PDRXLO_MASK) -#define RF2G_RF2G2_PDRXLO_RESET 1'h0 -#define RF2G_RF2G2_PDTXLO_MSB 21 -#define RF2G_RF2G2_PDTXLO_LSB 21 -#define RF2G_RF2G2_PDTXLO_MASK 'h00200000 -#define RF2G_RF2G2_PDTXLO_GET(x) (((x) & RF2G_RF2G2_PDTXLO_MASK) >> RF2G_RF2G2_PDTXLO_LSB) -#define RF2G_RF2G2_PDTXLO_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDTXLO_LSB) & RF2G_RF2G2_PDTXLO_MASK) -#define RF2G_RF2G2_PDTXLO_RESET 1'h0 -#define RF2G_RF2G2_PDTXMIX_MSB 20 -#define RF2G_RF2G2_PDTXMIX_LSB 20 -#define RF2G_RF2G2_PDTXMIX_MASK 'h00100000 -#define RF2G_RF2G2_PDTXMIX_GET(x) (((x) & RF2G_RF2G2_PDTXMIX_MASK) >> RF2G_RF2G2_PDTXMIX_LSB) -#define RF2G_RF2G2_PDTXMIX_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDTXMIX_LSB) & RF2G_RF2G2_PDTXMIX_MASK) -#define RF2G_RF2G2_PDTXMIX_RESET 1'h0 -#define RF2G_RF2G2_REGLNA_BYPASS_MSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_LSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_MASK 'h00080000 -#define RF2G_RF2G2_REGLNA_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLNA_BYPASS_MASK) >> RF2G_RF2G2_REGLNA_BYPASS_LSB) -#define RF2G_RF2G2_REGLNA_BYPASS_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_REGLNA_BYPASS_LSB) & RF2G_RF2G2_REGLNA_BYPASS_MASK) -#define RF2G_RF2G2_REGLNA_BYPASS_RESET 1'h0 -#define RF2G_RF2G2_REGLO_BYPASS_MSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_LSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_MASK 'h00040000 -#define RF2G_RF2G2_REGLO_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLO_BYPASS_MASK) >> RF2G_RF2G2_REGLO_BYPASS_LSB) -#define RF2G_RF2G2_REGLO_BYPASS_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_REGLO_BYPASS_LSB) & RF2G_RF2G2_REGLO_BYPASS_MASK) -#define RF2G_RF2G2_REGLO_BYPASS_RESET 1'h0 -#define RF2G_RF2G2_ENABLE_PCB_MSB 17 -#define RF2G_RF2G2_ENABLE_PCB_LSB 17 -#define RF2G_RF2G2_ENABLE_PCB_MASK 'h00020000 -#define RF2G_RF2G2_ENABLE_PCB_GET(x) (((x) & RF2G_RF2G2_ENABLE_PCB_MASK) >> RF2G_RF2G2_ENABLE_PCB_LSB) -#define RF2G_RF2G2_ENABLE_PCB_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_ENABLE_PCB_LSB) & RF2G_RF2G2_ENABLE_PCB_MASK) -#define RF2G_RF2G2_ENABLE_PCB_RESET 1'h0 -#define RF2G_RF2G2_SPARE_MSB 16 -#define RF2G_RF2G2_SPARE_LSB 0 -#define RF2G_RF2G2_SPARE_MASK 'h0001ffff -#define RF2G_RF2G2_SPARE_GET(x) (((x) & RF2G_RF2G2_SPARE_MASK) >> RF2G_RF2G2_SPARE_LSB) -#define RF2G_RF2G2_SPARE_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_SPARE_LSB) & RF2G_RF2G2_SPARE_MASK) -#define RF2G_RF2G2_SPARE_RESET 17'h0 -#define RF2G_RF2G2_RESET (32'h0 | \ - RF2G_RF2G2_PDCGLNA_SET(RF2G_RF2G2_PDCGLNA_RESET) | \ - RF2G_RF2G2_PDCGLNABUF_SET(RF2G_RF2G2_PDCGLNABUF_RESET) | \ - RF2G_RF2G2_PDCSLNA_SET(RF2G_RF2G2_PDCSLNA_RESET) | \ - RF2G_RF2G2_PDDIV_SET(RF2G_RF2G2_PDDIV_RESET) | \ - RF2G_RF2G2_PDPADRV_SET(RF2G_RF2G2_PDPADRV_RESET) | \ - RF2G_RF2G2_PDPAOUT_SET(RF2G_RF2G2_PDPAOUT_RESET) | \ - RF2G_RF2G2_PDREGLNA_SET(RF2G_RF2G2_PDREGLNA_RESET) | \ - RF2G_RF2G2_PDREGLO_SET(RF2G_RF2G2_PDREGLO_RESET) | \ - RF2G_RF2G2_PDRFGM_SET(RF2G_RF2G2_PDRFGM_RESET) | \ - RF2G_RF2G2_PDRXLO_SET(RF2G_RF2G2_PDRXLO_RESET) | \ - RF2G_RF2G2_PDTXLO_SET(RF2G_RF2G2_PDTXLO_RESET) | \ - RF2G_RF2G2_PDTXMIX_SET(RF2G_RF2G2_PDTXMIX_RESET) | \ - RF2G_RF2G2_REGLNA_BYPASS_SET(RF2G_RF2G2_REGLNA_BYPASS_RESET) | \ - RF2G_RF2G2_REGLO_BYPASS_SET(RF2G_RF2G2_REGLO_BYPASS_RESET) | \ - RF2G_RF2G2_ENABLE_PCB_SET(RF2G_RF2G2_ENABLE_PCB_RESET) | \ - RF2G_RF2G2_SPARE_SET(RF2G_RF2G2_SPARE_RESET)) -#define RF2G_RF2G2_HW_MASK (32'h0) -#define RF2G_RF2G2_SW_MASK (32'h0 | \ - RF2G_RF2G2_PDCGLNA_MASK | \ - RF2G_RF2G2_PDCGLNABUF_MASK | \ - RF2G_RF2G2_PDCSLNA_MASK | \ - RF2G_RF2G2_PDDIV_MASK | \ - RF2G_RF2G2_PDPADRV_MASK | \ - RF2G_RF2G2_PDPAOUT_MASK | \ - RF2G_RF2G2_PDREGLNA_MASK | \ - RF2G_RF2G2_PDREGLO_MASK | \ - RF2G_RF2G2_PDRFGM_MASK | \ - RF2G_RF2G2_PDRXLO_MASK | \ - RF2G_RF2G2_PDTXLO_MASK | \ - RF2G_RF2G2_PDTXMIX_MASK | \ - RF2G_RF2G2_REGLNA_BYPASS_MASK | \ - RF2G_RF2G2_REGLO_BYPASS_MASK | \ - RF2G_RF2G2_ENABLE_PCB_MASK | \ - RF2G_RF2G2_SPARE_MASK) - -#define TOP_GAIN_ADDRESS 'h00000030 -#define TOP_GAIN_TX6DBLOQGAIN_MSB 31 -#define TOP_GAIN_TX6DBLOQGAIN_LSB 30 -#define TOP_GAIN_TX6DBLOQGAIN_MASK 'hc0000000 -#define TOP_GAIN_TX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX6DBLOQGAIN_MASK) >> TOP_GAIN_TX6DBLOQGAIN_LSB) -#define TOP_GAIN_TX6DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_TX6DBLOQGAIN_LSB) & TOP_GAIN_TX6DBLOQGAIN_MASK) -#define TOP_GAIN_TX6DBLOQGAIN_RESET 2'h3 -#define TOP_GAIN_TX1DBLOQGAIN_MSB 29 -#define TOP_GAIN_TX1DBLOQGAIN_LSB 27 -#define TOP_GAIN_TX1DBLOQGAIN_MASK 'h38000000 -#define TOP_GAIN_TX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX1DBLOQGAIN_MASK) >> TOP_GAIN_TX1DBLOQGAIN_LSB) -#define TOP_GAIN_TX1DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_TX1DBLOQGAIN_LSB) & TOP_GAIN_TX1DBLOQGAIN_MASK) -#define TOP_GAIN_TX1DBLOQGAIN_RESET 3'h6 -#define TOP_GAIN_TXV2IGAIN_MSB 26 -#define TOP_GAIN_TXV2IGAIN_LSB 25 -#define TOP_GAIN_TXV2IGAIN_MASK 'h06000000 -#define TOP_GAIN_TXV2IGAIN_GET(x) (((x) & TOP_GAIN_TXV2IGAIN_MASK) >> TOP_GAIN_TXV2IGAIN_LSB) -#define TOP_GAIN_TXV2IGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_TXV2IGAIN_LSB) & TOP_GAIN_TXV2IGAIN_MASK) -#define TOP_GAIN_TXV2IGAIN_RESET 2'h3 -#define TOP_GAIN_PABUF5GN_MSB 24 -#define TOP_GAIN_PABUF5GN_LSB 24 -#define TOP_GAIN_PABUF5GN_MASK 'h01000000 -#define TOP_GAIN_PABUF5GN_GET(x) (((x) & TOP_GAIN_PABUF5GN_MASK) >> TOP_GAIN_PABUF5GN_LSB) -#define TOP_GAIN_PABUF5GN_SET(x) (((32'd0 | (x)) << TOP_GAIN_PABUF5GN_LSB) & TOP_GAIN_PABUF5GN_MASK) -#define TOP_GAIN_PABUF5GN_RESET 1'h1 -#define TOP_GAIN_PADRVGN_MSB 23 -#define TOP_GAIN_PADRVGN_LSB 21 -#define TOP_GAIN_PADRVGN_MASK 'h00e00000 -#define TOP_GAIN_PADRVGN_GET(x) (((x) & TOP_GAIN_PADRVGN_MASK) >> TOP_GAIN_PADRVGN_LSB) -#define TOP_GAIN_PADRVGN_SET(x) (((32'd0 | (x)) << TOP_GAIN_PADRVGN_LSB) & TOP_GAIN_PADRVGN_MASK) -#define TOP_GAIN_PADRVGN_RESET 3'h7 -#define TOP_GAIN_PAOUT2GN_MSB 20 -#define TOP_GAIN_PAOUT2GN_LSB 18 -#define TOP_GAIN_PAOUT2GN_MASK 'h001c0000 -#define TOP_GAIN_PAOUT2GN_GET(x) (((x) & TOP_GAIN_PAOUT2GN_MASK) >> TOP_GAIN_PAOUT2GN_LSB) -#define TOP_GAIN_PAOUT2GN_SET(x) (((32'd0 | (x)) << TOP_GAIN_PAOUT2GN_LSB) & TOP_GAIN_PAOUT2GN_MASK) -#define TOP_GAIN_PAOUT2GN_RESET 3'h7 -#define TOP_GAIN_LNAON_MSB 17 -#define TOP_GAIN_LNAON_LSB 17 -#define TOP_GAIN_LNAON_MASK 'h00020000 -#define TOP_GAIN_LNAON_GET(x) (((x) & TOP_GAIN_LNAON_MASK) >> TOP_GAIN_LNAON_LSB) -#define TOP_GAIN_LNAON_SET(x) (((32'd0 | (x)) << TOP_GAIN_LNAON_LSB) & TOP_GAIN_LNAON_MASK) -#define TOP_GAIN_LNAON_RESET 1'h1 -#define TOP_GAIN_LNAGAIN_MSB 16 -#define TOP_GAIN_LNAGAIN_LSB 13 -#define TOP_GAIN_LNAGAIN_MASK 'h0001e000 -#define TOP_GAIN_LNAGAIN_GET(x) (((x) & TOP_GAIN_LNAGAIN_MASK) >> TOP_GAIN_LNAGAIN_LSB) -#define TOP_GAIN_LNAGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_LNAGAIN_LSB) & TOP_GAIN_LNAGAIN_MASK) -#define TOP_GAIN_LNAGAIN_RESET 4'hf -#define TOP_GAIN_RFVGA5GAIN_MSB 12 -#define TOP_GAIN_RFVGA5GAIN_LSB 11 -#define TOP_GAIN_RFVGA5GAIN_MASK 'h00001800 -#define TOP_GAIN_RFVGA5GAIN_GET(x) (((x) & TOP_GAIN_RFVGA5GAIN_MASK) >> TOP_GAIN_RFVGA5GAIN_LSB) -#define TOP_GAIN_RFVGA5GAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RFVGA5GAIN_LSB) & TOP_GAIN_RFVGA5GAIN_MASK) -#define TOP_GAIN_RFVGA5GAIN_RESET 2'h3 -#define TOP_GAIN_RFGMGN_MSB 10 -#define TOP_GAIN_RFGMGN_LSB 8 -#define TOP_GAIN_RFGMGN_MASK 'h00000700 -#define TOP_GAIN_RFGMGN_GET(x) (((x) & TOP_GAIN_RFGMGN_MASK) >> TOP_GAIN_RFGMGN_LSB) -#define TOP_GAIN_RFGMGN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RFGMGN_LSB) & TOP_GAIN_RFGMGN_MASK) -#define TOP_GAIN_RFGMGN_RESET 3'h7 -#define TOP_GAIN_RX6DBLOQGAIN_MSB 7 -#define TOP_GAIN_RX6DBLOQGAIN_LSB 6 -#define TOP_GAIN_RX6DBLOQGAIN_MASK 'h000000c0 -#define TOP_GAIN_RX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBLOQGAIN_MASK) >> TOP_GAIN_RX6DBLOQGAIN_LSB) -#define TOP_GAIN_RX6DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RX6DBLOQGAIN_LSB) & TOP_GAIN_RX6DBLOQGAIN_MASK) -#define TOP_GAIN_RX6DBLOQGAIN_RESET 2'h3 -#define TOP_GAIN_RX1DBLOQGAIN_MSB 5 -#define TOP_GAIN_RX1DBLOQGAIN_LSB 3 -#define TOP_GAIN_RX1DBLOQGAIN_MASK 'h00000038 -#define TOP_GAIN_RX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX1DBLOQGAIN_MASK) >> TOP_GAIN_RX1DBLOQGAIN_LSB) -#define TOP_GAIN_RX1DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RX1DBLOQGAIN_LSB) & TOP_GAIN_RX1DBLOQGAIN_MASK) -#define TOP_GAIN_RX1DBLOQGAIN_RESET 3'h6 -#define TOP_GAIN_RX6DBHIQGAIN_MSB 2 -#define TOP_GAIN_RX6DBHIQGAIN_LSB 1 -#define TOP_GAIN_RX6DBHIQGAIN_MASK 'h00000006 -#define TOP_GAIN_RX6DBHIQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBHIQGAIN_MASK) >> TOP_GAIN_RX6DBHIQGAIN_LSB) -#define TOP_GAIN_RX6DBHIQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RX6DBHIQGAIN_LSB) & TOP_GAIN_RX6DBHIQGAIN_MASK) -#define TOP_GAIN_RX6DBHIQGAIN_RESET 2'h3 -#define TOP_GAIN_SPARE_MSB 0 -#define TOP_GAIN_SPARE_LSB 0 -#define TOP_GAIN_SPARE_MASK 'h00000001 -#define TOP_GAIN_SPARE_GET(x) (((x) & TOP_GAIN_SPARE_MASK) >> TOP_GAIN_SPARE_LSB) -#define TOP_GAIN_SPARE_SET(x) (((32'd0 | (x)) << TOP_GAIN_SPARE_LSB) & TOP_GAIN_SPARE_MASK) -#define TOP_GAIN_SPARE_RESET 1'h0 -#define TOP_GAIN_RESET (32'h0 | \ - TOP_GAIN_TX6DBLOQGAIN_SET(TOP_GAIN_TX6DBLOQGAIN_RESET) | \ - TOP_GAIN_TX1DBLOQGAIN_SET(TOP_GAIN_TX1DBLOQGAIN_RESET) | \ - TOP_GAIN_TXV2IGAIN_SET(TOP_GAIN_TXV2IGAIN_RESET) | \ - TOP_GAIN_PABUF5GN_SET(TOP_GAIN_PABUF5GN_RESET) | \ - TOP_GAIN_PADRVGN_SET(TOP_GAIN_PADRVGN_RESET) | \ - TOP_GAIN_PAOUT2GN_SET(TOP_GAIN_PAOUT2GN_RESET) | \ - TOP_GAIN_LNAON_SET(TOP_GAIN_LNAON_RESET) | \ - TOP_GAIN_LNAGAIN_SET(TOP_GAIN_LNAGAIN_RESET) | \ - TOP_GAIN_RFVGA5GAIN_SET(TOP_GAIN_RFVGA5GAIN_RESET) | \ - TOP_GAIN_RFGMGN_SET(TOP_GAIN_RFGMGN_RESET) | \ - TOP_GAIN_RX6DBLOQGAIN_SET(TOP_GAIN_RX6DBLOQGAIN_RESET) | \ - TOP_GAIN_RX1DBLOQGAIN_SET(TOP_GAIN_RX1DBLOQGAIN_RESET) | \ - TOP_GAIN_RX6DBHIQGAIN_SET(TOP_GAIN_RX6DBHIQGAIN_RESET) | \ - TOP_GAIN_SPARE_SET(TOP_GAIN_SPARE_RESET)) -#define TOP_GAIN_HW_MASK (32'h0 | \ - TOP_GAIN_TX6DBLOQGAIN_MASK | \ - TOP_GAIN_TX1DBLOQGAIN_MASK | \ - TOP_GAIN_TXV2IGAIN_MASK | \ - TOP_GAIN_PABUF5GN_MASK | \ - TOP_GAIN_PADRVGN_MASK | \ - TOP_GAIN_PAOUT2GN_MASK | \ - TOP_GAIN_LNAON_MASK | \ - TOP_GAIN_LNAGAIN_MASK | \ - TOP_GAIN_RFVGA5GAIN_MASK | \ - TOP_GAIN_RFGMGN_MASK | \ - TOP_GAIN_RX6DBLOQGAIN_MASK | \ - TOP_GAIN_RX1DBLOQGAIN_MASK | \ - TOP_GAIN_RX6DBHIQGAIN_MASK | \ - TOP_GAIN_SPARE_MASK) -#define TOP_GAIN_SW_MASK (32'h0 | \ - TOP_GAIN_TX6DBLOQGAIN_MASK | \ - TOP_GAIN_TX1DBLOQGAIN_MASK | \ - TOP_GAIN_TXV2IGAIN_MASK | \ - TOP_GAIN_PABUF5GN_MASK | \ - TOP_GAIN_PADRVGN_MASK | \ - TOP_GAIN_PAOUT2GN_MASK | \ - TOP_GAIN_LNAON_MASK | \ - TOP_GAIN_LNAGAIN_MASK | \ - TOP_GAIN_RFVGA5GAIN_MASK | \ - TOP_GAIN_RFGMGN_MASK | \ - TOP_GAIN_RX6DBLOQGAIN_MASK | \ - TOP_GAIN_RX1DBLOQGAIN_MASK | \ - TOP_GAIN_RX6DBHIQGAIN_MASK | \ - TOP_GAIN_SPARE_MASK) - -#define TOP_TOP_ADDRESS 'h00000034 -#define TOP_TOP_LOCALTXGAIN_MSB 31 -#define TOP_TOP_LOCALTXGAIN_LSB 31 -#define TOP_TOP_LOCALTXGAIN_MASK 'h80000000 -#define TOP_TOP_LOCALTXGAIN_GET(x) (((x) & TOP_TOP_LOCALTXGAIN_MASK) >> TOP_TOP_LOCALTXGAIN_LSB) -#define TOP_TOP_LOCALTXGAIN_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALTXGAIN_LSB) & TOP_TOP_LOCALTXGAIN_MASK) -#define TOP_TOP_LOCALTXGAIN_RESET 1'h0 -#define TOP_TOP_LOCALRXGAIN_MSB 30 -#define TOP_TOP_LOCALRXGAIN_LSB 30 -#define TOP_TOP_LOCALRXGAIN_MASK 'h40000000 -#define TOP_TOP_LOCALRXGAIN_GET(x) (((x) & TOP_TOP_LOCALRXGAIN_MASK) >> TOP_TOP_LOCALRXGAIN_LSB) -#define TOP_TOP_LOCALRXGAIN_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALRXGAIN_LSB) & TOP_TOP_LOCALRXGAIN_MASK) -#define TOP_TOP_LOCALRXGAIN_RESET 1'h0 -#define TOP_TOP_LOCALMODE_MSB 29 -#define TOP_TOP_LOCALMODE_LSB 29 -#define TOP_TOP_LOCALMODE_MASK 'h20000000 -#define TOP_TOP_LOCALMODE_GET(x) (((x) & TOP_TOP_LOCALMODE_MASK) >> TOP_TOP_LOCALMODE_LSB) -#define TOP_TOP_LOCALMODE_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALMODE_LSB) & TOP_TOP_LOCALMODE_MASK) -#define TOP_TOP_LOCALMODE_RESET 1'h0 -#define TOP_TOP_CALFC_MSB 28 -#define TOP_TOP_CALFC_LSB 28 -#define TOP_TOP_CALFC_MASK 'h10000000 -#define TOP_TOP_CALFC_GET(x) (((x) & TOP_TOP_CALFC_MASK) >> TOP_TOP_CALFC_LSB) -#define TOP_TOP_CALFC_SET(x) (((32'd0 | (x)) << TOP_TOP_CALFC_LSB) & TOP_TOP_CALFC_MASK) -#define TOP_TOP_CALFC_RESET 1'h0 -#define TOP_TOP_CALDC_MSB 27 -#define TOP_TOP_CALDC_LSB 27 -#define TOP_TOP_CALDC_MASK 'h08000000 -#define TOP_TOP_CALDC_GET(x) (((x) & TOP_TOP_CALDC_MASK) >> TOP_TOP_CALDC_LSB) -#define TOP_TOP_CALDC_SET(x) (((32'd0 | (x)) << TOP_TOP_CALDC_LSB) & TOP_TOP_CALDC_MASK) -#define TOP_TOP_CALDC_RESET 1'h0 -#define TOP_TOP_CAL_RESIDUE_MSB 26 -#define TOP_TOP_CAL_RESIDUE_LSB 26 -#define TOP_TOP_CAL_RESIDUE_MASK 'h04000000 -#define TOP_TOP_CAL_RESIDUE_GET(x) (((x) & TOP_TOP_CAL_RESIDUE_MASK) >> TOP_TOP_CAL_RESIDUE_LSB) -#define TOP_TOP_CAL_RESIDUE_SET(x) (((32'd0 | (x)) << TOP_TOP_CAL_RESIDUE_LSB) & TOP_TOP_CAL_RESIDUE_MASK) -#define TOP_TOP_CAL_RESIDUE_RESET 1'h0 -#define TOP_TOP_BMODE_MSB 25 -#define TOP_TOP_BMODE_LSB 25 -#define TOP_TOP_BMODE_MASK 'h02000000 -#define TOP_TOP_BMODE_GET(x) (((x) & TOP_TOP_BMODE_MASK) >> TOP_TOP_BMODE_LSB) -#define TOP_TOP_BMODE_SET(x) (((32'd0 | (x)) << TOP_TOP_BMODE_LSB) & TOP_TOP_BMODE_MASK) -#define TOP_TOP_BMODE_RESET 1'h1 -#define TOP_TOP_SYNTHON_MSB 24 -#define TOP_TOP_SYNTHON_LSB 24 -#define TOP_TOP_SYNTHON_MASK 'h01000000 -#define TOP_TOP_SYNTHON_GET(x) (((x) & TOP_TOP_SYNTHON_MASK) >> TOP_TOP_SYNTHON_LSB) -#define TOP_TOP_SYNTHON_SET(x) (((32'd0 | (x)) << TOP_TOP_SYNTHON_LSB) & TOP_TOP_SYNTHON_MASK) -#define TOP_TOP_SYNTHON_RESET 1'h0 -#define TOP_TOP_RXON_MSB 23 -#define TOP_TOP_RXON_LSB 23 -#define TOP_TOP_RXON_MASK 'h00800000 -#define TOP_TOP_RXON_GET(x) (((x) & TOP_TOP_RXON_MASK) >> TOP_TOP_RXON_LSB) -#define TOP_TOP_RXON_SET(x) (((32'd0 | (x)) << TOP_TOP_RXON_LSB) & TOP_TOP_RXON_MASK) -#define TOP_TOP_RXON_RESET 1'h0 -#define TOP_TOP_TXON_MSB 22 -#define TOP_TOP_TXON_LSB 22 -#define TOP_TOP_TXON_MASK 'h00400000 -#define TOP_TOP_TXON_GET(x) (((x) & TOP_TOP_TXON_MASK) >> TOP_TOP_TXON_LSB) -#define TOP_TOP_TXON_SET(x) (((32'd0 | (x)) << TOP_TOP_TXON_LSB) & TOP_TOP_TXON_MASK) -#define TOP_TOP_TXON_RESET 1'h0 -#define TOP_TOP_PAON_MSB 21 -#define TOP_TOP_PAON_LSB 21 -#define TOP_TOP_PAON_MASK 'h00200000 -#define TOP_TOP_PAON_GET(x) (((x) & TOP_TOP_PAON_MASK) >> TOP_TOP_PAON_LSB) -#define TOP_TOP_PAON_SET(x) (((32'd0 | (x)) << TOP_TOP_PAON_LSB) & TOP_TOP_PAON_MASK) -#define TOP_TOP_PAON_RESET 1'h0 -#define TOP_TOP_CALTX_MSB 20 -#define TOP_TOP_CALTX_LSB 20 -#define TOP_TOP_CALTX_MASK 'h00100000 -#define TOP_TOP_CALTX_GET(x) (((x) & TOP_TOP_CALTX_MASK) >> TOP_TOP_CALTX_LSB) -#define TOP_TOP_CALTX_SET(x) (((32'd0 | (x)) << TOP_TOP_CALTX_LSB) & TOP_TOP_CALTX_MASK) -#define TOP_TOP_CALTX_RESET 1'h0 -#define TOP_TOP_LOCALADDAC_MSB 19 -#define TOP_TOP_LOCALADDAC_LSB 19 -#define TOP_TOP_LOCALADDAC_MASK 'h00080000 -#define TOP_TOP_LOCALADDAC_GET(x) (((x) & TOP_TOP_LOCALADDAC_MASK) >> TOP_TOP_LOCALADDAC_LSB) -#define TOP_TOP_LOCALADDAC_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALADDAC_LSB) & TOP_TOP_LOCALADDAC_MASK) -#define TOP_TOP_LOCALADDAC_RESET 1'h0 -#define TOP_TOP_PWDPLL_MSB 18 -#define TOP_TOP_PWDPLL_LSB 18 -#define TOP_TOP_PWDPLL_MASK 'h00040000 -#define TOP_TOP_PWDPLL_GET(x) (((x) & TOP_TOP_PWDPLL_MASK) >> TOP_TOP_PWDPLL_LSB) -#define TOP_TOP_PWDPLL_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDPLL_LSB) & TOP_TOP_PWDPLL_MASK) -#define TOP_TOP_PWDPLL_RESET 1'h0 -#define TOP_TOP_PWDADC_MSB 17 -#define TOP_TOP_PWDADC_LSB 17 -#define TOP_TOP_PWDADC_MASK 'h00020000 -#define TOP_TOP_PWDADC_GET(x) (((x) & TOP_TOP_PWDADC_MASK) >> TOP_TOP_PWDADC_LSB) -#define TOP_TOP_PWDADC_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDADC_LSB) & TOP_TOP_PWDADC_MASK) -#define TOP_TOP_PWDADC_RESET 1'h0 -#define TOP_TOP_PWDDAC_MSB 16 -#define TOP_TOP_PWDDAC_LSB 16 -#define TOP_TOP_PWDDAC_MASK 'h00010000 -#define TOP_TOP_PWDDAC_GET(x) (((x) & TOP_TOP_PWDDAC_MASK) >> TOP_TOP_PWDDAC_LSB) -#define TOP_TOP_PWDDAC_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDDAC_LSB) & TOP_TOP_PWDDAC_MASK) -#define TOP_TOP_PWDDAC_RESET 1'h0 -#define TOP_TOP_LOCALXTAL_MSB 15 -#define TOP_TOP_LOCALXTAL_LSB 15 -#define TOP_TOP_LOCALXTAL_MASK 'h00008000 -#define TOP_TOP_LOCALXTAL_GET(x) (((x) & TOP_TOP_LOCALXTAL_MASK) >> TOP_TOP_LOCALXTAL_LSB) -#define TOP_TOP_LOCALXTAL_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALXTAL_LSB) & TOP_TOP_LOCALXTAL_MASK) -#define TOP_TOP_LOCALXTAL_RESET 1'h0 -#define TOP_TOP_PWDCLKIN_MSB 14 -#define TOP_TOP_PWDCLKIN_LSB 14 -#define TOP_TOP_PWDCLKIN_MASK 'h00004000 -#define TOP_TOP_PWDCLKIN_GET(x) (((x) & TOP_TOP_PWDCLKIN_MASK) >> TOP_TOP_PWDCLKIN_LSB) -#define TOP_TOP_PWDCLKIN_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDCLKIN_LSB) & TOP_TOP_PWDCLKIN_MASK) -#define TOP_TOP_PWDCLKIN_RESET 1'h0 -#define TOP_TOP_OSCON_MSB 13 -#define TOP_TOP_OSCON_LSB 13 -#define TOP_TOP_OSCON_MASK 'h00002000 -#define TOP_TOP_OSCON_GET(x) (((x) & TOP_TOP_OSCON_MASK) >> TOP_TOP_OSCON_LSB) -#define TOP_TOP_OSCON_SET(x) (((32'd0 | (x)) << TOP_TOP_OSCON_LSB) & TOP_TOP_OSCON_MASK) -#define TOP_TOP_OSCON_RESET 1'h1 -#define TOP_TOP_SCLKEN_FORCE_MSB 12 -#define TOP_TOP_SCLKEN_FORCE_LSB 12 -#define TOP_TOP_SCLKEN_FORCE_MASK 'h00001000 -#define TOP_TOP_SCLKEN_FORCE_GET(x) (((x) & TOP_TOP_SCLKEN_FORCE_MASK) >> TOP_TOP_SCLKEN_FORCE_LSB) -#define TOP_TOP_SCLKEN_FORCE_SET(x) (((32'd0 | (x)) << TOP_TOP_SCLKEN_FORCE_LSB) & TOP_TOP_SCLKEN_FORCE_MASK) -#define TOP_TOP_SCLKEN_FORCE_RESET 1'h0 -#define TOP_TOP_SYNTHON_FORCE_MSB 11 -#define TOP_TOP_SYNTHON_FORCE_LSB 11 -#define TOP_TOP_SYNTHON_FORCE_MASK 'h00000800 -#define TOP_TOP_SYNTHON_FORCE_GET(x) (((x) & TOP_TOP_SYNTHON_FORCE_MASK) >> TOP_TOP_SYNTHON_FORCE_LSB) -#define TOP_TOP_SYNTHON_FORCE_SET(x) (((32'd0 | (x)) << TOP_TOP_SYNTHON_FORCE_LSB) & TOP_TOP_SYNTHON_FORCE_MASK) -#define TOP_TOP_SYNTHON_FORCE_RESET 1'h0 -#define TOP_TOP_PDBIAS_MSB 10 -#define TOP_TOP_PDBIAS_LSB 10 -#define TOP_TOP_PDBIAS_MASK 'h00000400 -#define TOP_TOP_PDBIAS_GET(x) (((x) & TOP_TOP_PDBIAS_MASK) >> TOP_TOP_PDBIAS_LSB) -#define TOP_TOP_PDBIAS_SET(x) (((32'd0 | (x)) << TOP_TOP_PDBIAS_LSB) & TOP_TOP_PDBIAS_MASK) -#define TOP_TOP_PDBIAS_RESET 1'h0 -#define TOP_TOP_DATAOUTSEL_MSB 9 -#define TOP_TOP_DATAOUTSEL_LSB 8 -#define TOP_TOP_DATAOUTSEL_MASK 'h00000300 -#define TOP_TOP_DATAOUTSEL_GET(x) (((x) & TOP_TOP_DATAOUTSEL_MASK) >> TOP_TOP_DATAOUTSEL_LSB) -#define TOP_TOP_DATAOUTSEL_SET(x) (((32'd0 | (x)) << TOP_TOP_DATAOUTSEL_LSB) & TOP_TOP_DATAOUTSEL_MASK) -#define TOP_TOP_DATAOUTSEL_RESET 2'h3 -#define TOP_TOP_REVID_MSB 7 -#define TOP_TOP_REVID_LSB 5 -#define TOP_TOP_REVID_MASK 'h000000e0 -#define TOP_TOP_REVID_GET(x) (((x) & TOP_TOP_REVID_MASK) >> TOP_TOP_REVID_LSB) -#define TOP_TOP_REVID_SET(x) (((32'd0 | (x)) << TOP_TOP_REVID_LSB) & TOP_TOP_REVID_MASK) -#define TOP_TOP_REVID_RESET 3'h0 -#define TOP_TOP_INT2PAD_MSB 4 -#define TOP_TOP_INT2PAD_LSB 4 -#define TOP_TOP_INT2PAD_MASK 'h00000010 -#define TOP_TOP_INT2PAD_GET(x) (((x) & TOP_TOP_INT2PAD_MASK) >> TOP_TOP_INT2PAD_LSB) -#define TOP_TOP_INT2PAD_SET(x) (((32'd0 | (x)) << TOP_TOP_INT2PAD_LSB) & TOP_TOP_INT2PAD_MASK) -#define TOP_TOP_INT2PAD_RESET 1'h0 -#define TOP_TOP_INTH2PAD_MSB 3 -#define TOP_TOP_INTH2PAD_LSB 3 -#define TOP_TOP_INTH2PAD_MASK 'h00000008 -#define TOP_TOP_INTH2PAD_GET(x) (((x) & TOP_TOP_INTH2PAD_MASK) >> TOP_TOP_INTH2PAD_LSB) -#define TOP_TOP_INTH2PAD_SET(x) (((32'd0 | (x)) << TOP_TOP_INTH2PAD_LSB) & TOP_TOP_INTH2PAD_MASK) -#define TOP_TOP_INTH2PAD_RESET 1'h0 -#define TOP_TOP_PAD2GND_MSB 2 -#define TOP_TOP_PAD2GND_LSB 2 -#define TOP_TOP_PAD2GND_MASK 'h00000004 -#define TOP_TOP_PAD2GND_GET(x) (((x) & TOP_TOP_PAD2GND_MASK) >> TOP_TOP_PAD2GND_LSB) -#define TOP_TOP_PAD2GND_SET(x) (((32'd0 | (x)) << TOP_TOP_PAD2GND_LSB) & TOP_TOP_PAD2GND_MASK) -#define TOP_TOP_PAD2GND_RESET 1'h0 -#define TOP_TOP_INT2GND_MSB 1 -#define TOP_TOP_INT2GND_LSB 1 -#define TOP_TOP_INT2GND_MASK 'h00000002 -#define TOP_TOP_INT2GND_GET(x) (((x) & TOP_TOP_INT2GND_MASK) >> TOP_TOP_INT2GND_LSB) -#define TOP_TOP_INT2GND_SET(x) (((32'd0 | (x)) << TOP_TOP_INT2GND_LSB) & TOP_TOP_INT2GND_MASK) -#define TOP_TOP_INT2GND_RESET 1'h0 -#define TOP_TOP_FORCE_XPAON_MSB 0 -#define TOP_TOP_FORCE_XPAON_LSB 0 -#define TOP_TOP_FORCE_XPAON_MASK 'h00000001 -#define TOP_TOP_FORCE_XPAON_GET(x) (((x) & TOP_TOP_FORCE_XPAON_MASK) >> TOP_TOP_FORCE_XPAON_LSB) -#define TOP_TOP_FORCE_XPAON_SET(x) (((32'd0 | (x)) << TOP_TOP_FORCE_XPAON_LSB) & TOP_TOP_FORCE_XPAON_MASK) -#define TOP_TOP_FORCE_XPAON_RESET 1'h0 -#define TOP_TOP_RESET (32'h0 | \ - TOP_TOP_LOCALTXGAIN_SET(TOP_TOP_LOCALTXGAIN_RESET) | \ - TOP_TOP_LOCALRXGAIN_SET(TOP_TOP_LOCALRXGAIN_RESET) | \ - TOP_TOP_LOCALMODE_SET(TOP_TOP_LOCALMODE_RESET) | \ - TOP_TOP_CALFC_SET(TOP_TOP_CALFC_RESET) | \ - TOP_TOP_CALDC_SET(TOP_TOP_CALDC_RESET) | \ - TOP_TOP_CAL_RESIDUE_SET(TOP_TOP_CAL_RESIDUE_RESET) | \ - TOP_TOP_BMODE_SET(TOP_TOP_BMODE_RESET) | \ - TOP_TOP_SYNTHON_SET(TOP_TOP_SYNTHON_RESET) | \ - TOP_TOP_RXON_SET(TOP_TOP_RXON_RESET) | \ - TOP_TOP_TXON_SET(TOP_TOP_TXON_RESET) | \ - TOP_TOP_PAON_SET(TOP_TOP_PAON_RESET) | \ - TOP_TOP_CALTX_SET(TOP_TOP_CALTX_RESET) | \ - TOP_TOP_LOCALADDAC_SET(TOP_TOP_LOCALADDAC_RESET) | \ - TOP_TOP_PWDPLL_SET(TOP_TOP_PWDPLL_RESET) | \ - TOP_TOP_PWDADC_SET(TOP_TOP_PWDADC_RESET) | \ - TOP_TOP_PWDDAC_SET(TOP_TOP_PWDDAC_RESET) | \ - TOP_TOP_LOCALXTAL_SET(TOP_TOP_LOCALXTAL_RESET) | \ - TOP_TOP_PWDCLKIN_SET(TOP_TOP_PWDCLKIN_RESET) | \ - TOP_TOP_OSCON_SET(TOP_TOP_OSCON_RESET) | \ - TOP_TOP_SCLKEN_FORCE_SET(TOP_TOP_SCLKEN_FORCE_RESET) | \ - TOP_TOP_SYNTHON_FORCE_SET(TOP_TOP_SYNTHON_FORCE_RESET) | \ - TOP_TOP_PDBIAS_SET(TOP_TOP_PDBIAS_RESET) | \ - TOP_TOP_DATAOUTSEL_SET(TOP_TOP_DATAOUTSEL_RESET) | \ - TOP_TOP_REVID_SET(TOP_TOP_REVID_RESET) | \ - TOP_TOP_INT2PAD_SET(TOP_TOP_INT2PAD_RESET) | \ - TOP_TOP_INTH2PAD_SET(TOP_TOP_INTH2PAD_RESET) | \ - TOP_TOP_PAD2GND_SET(TOP_TOP_PAD2GND_RESET) | \ - TOP_TOP_INT2GND_SET(TOP_TOP_INT2GND_RESET) | \ - TOP_TOP_FORCE_XPAON_SET(TOP_TOP_FORCE_XPAON_RESET)) -#define TOP_TOP_HW_MASK (32'h0 | \ - TOP_TOP_CALFC_MASK | \ - TOP_TOP_CALDC_MASK | \ - TOP_TOP_CAL_RESIDUE_MASK | \ - TOP_TOP_BMODE_MASK | \ - TOP_TOP_SYNTHON_MASK | \ - TOP_TOP_RXON_MASK | \ - TOP_TOP_TXON_MASK | \ - TOP_TOP_PAON_MASK | \ - TOP_TOP_CALTX_MASK | \ - TOP_TOP_PWDPLL_MASK | \ - TOP_TOP_PWDADC_MASK | \ - TOP_TOP_PWDDAC_MASK | \ - TOP_TOP_PWDCLKIN_MASK | \ - TOP_TOP_OSCON_MASK | \ - TOP_TOP_REVID_MASK) -#define TOP_TOP_SW_MASK (32'h0 | \ - TOP_TOP_LOCALTXGAIN_MASK | \ - TOP_TOP_LOCALRXGAIN_MASK | \ - TOP_TOP_LOCALMODE_MASK | \ - TOP_TOP_CALFC_MASK | \ - TOP_TOP_CALDC_MASK | \ - TOP_TOP_CAL_RESIDUE_MASK | \ - TOP_TOP_BMODE_MASK | \ - TOP_TOP_SYNTHON_MASK | \ - TOP_TOP_RXON_MASK | \ - TOP_TOP_TXON_MASK | \ - TOP_TOP_PAON_MASK | \ - TOP_TOP_CALTX_MASK | \ - TOP_TOP_LOCALADDAC_MASK | \ - TOP_TOP_PWDPLL_MASK | \ - TOP_TOP_PWDADC_MASK | \ - TOP_TOP_PWDDAC_MASK | \ - TOP_TOP_LOCALXTAL_MASK | \ - TOP_TOP_PWDCLKIN_MASK | \ - TOP_TOP_OSCON_MASK | \ - TOP_TOP_SCLKEN_FORCE_MASK | \ - TOP_TOP_SYNTHON_FORCE_MASK | \ - TOP_TOP_PDBIAS_MASK | \ - TOP_TOP_DATAOUTSEL_MASK | \ - TOP_TOP_INT2PAD_MASK | \ - TOP_TOP_INTH2PAD_MASK | \ - TOP_TOP_PAD2GND_MASK | \ - TOP_TOP_INT2GND_MASK | \ - TOP_TOP_FORCE_XPAON_MASK) - -#define BIAS_BIAS_SEL_ADDRESS 'h00000038 -#define BIAS_BIAS_SEL_PADON_MSB 31 -#define BIAS_BIAS_SEL_PADON_LSB 31 -#define BIAS_BIAS_SEL_PADON_MASK 'h80000000 -#define BIAS_BIAS_SEL_PADON_GET(x) (((x) & BIAS_BIAS_SEL_PADON_MASK) >> BIAS_BIAS_SEL_PADON_LSB) -#define BIAS_BIAS_SEL_PADON_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PADON_LSB) & BIAS_BIAS_SEL_PADON_MASK) -#define BIAS_BIAS_SEL_PADON_RESET 1'h0 -#define BIAS_BIAS_SEL_SEL_BIAS_MSB 30 -#define BIAS_BIAS_SEL_SEL_BIAS_LSB 25 -#define BIAS_BIAS_SEL_SEL_BIAS_MASK 'h7e000000 -#define BIAS_BIAS_SEL_SEL_BIAS_GET(x) (((x) & BIAS_BIAS_SEL_SEL_BIAS_MASK) >> BIAS_BIAS_SEL_SEL_BIAS_LSB) -#define BIAS_BIAS_SEL_SEL_BIAS_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_SEL_BIAS_LSB) & BIAS_BIAS_SEL_SEL_BIAS_MASK) -#define BIAS_BIAS_SEL_SEL_BIAS_RESET 6'h0 -#define BIAS_BIAS_SEL_SEL_SPARE_MSB 24 -#define BIAS_BIAS_SEL_SEL_SPARE_LSB 21 -#define BIAS_BIAS_SEL_SEL_SPARE_MASK 'h01e00000 -#define BIAS_BIAS_SEL_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SEL_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_SEL_SPARE_RESET 4'h0 -#define BIAS_BIAS_SEL_SPARE_MSB 20 -#define BIAS_BIAS_SEL_SPARE_LSB 20 -#define BIAS_BIAS_SEL_SPARE_MASK 'h00100000 -#define BIAS_BIAS_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_SPARE_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MSB 19 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB 17 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK 'h000e0000 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_RESET 3'h6 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK 'h00010000 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK 'h00008000 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK 'h00004000 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_LSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MASK 'h00002000 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) >> BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MSB 12 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB 10 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK 'h00001c00 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MSB 9 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_LSB 7 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MASK 'h00000380 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) >> BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MSB 6 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_LSB 4 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MASK 'h00000070 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) >> BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MSB 3 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_LSB 1 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MASK 'h0000000e -#define BIAS_BIAS_SEL_PWD_ICTXPC25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) >> BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICLDO25_MSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_LSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_MASK 'h00000001 -#define BIAS_BIAS_SEL_PWD_ICLDO25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) >> BIAS_BIAS_SEL_PWD_ICLDO25_LSB) -#define BIAS_BIAS_SEL_PWD_ICLDO25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICLDO25_LSB) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) -#define BIAS_BIAS_SEL_PWD_ICLDO25_RESET 1'h0 -#define BIAS_BIAS_SEL_RESET (32'h0 | \ - BIAS_BIAS_SEL_PADON_SET(BIAS_BIAS_SEL_PADON_RESET) | \ - BIAS_BIAS_SEL_SEL_BIAS_SET(BIAS_BIAS_SEL_SEL_BIAS_RESET) | \ - BIAS_BIAS_SEL_SEL_SPARE_SET(BIAS_BIAS_SEL_SEL_SPARE_RESET) | \ - BIAS_BIAS_SEL_SPARE_SET(BIAS_BIAS_SEL_SPARE_RESET) | \ - BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_SET(BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_RESET) | \ - BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_SET(BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_RESET) | \ - BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_SET(BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_RESET) | \ - BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_SET(BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICCPLL25_SET(BIAS_BIAS_SEL_PWD_ICCPLL25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_SET(BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICXTAL25_SET(BIAS_BIAS_SEL_PWD_ICXTAL25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICTSENS25_SET(BIAS_BIAS_SEL_PWD_ICTSENS25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICTXPC25_SET(BIAS_BIAS_SEL_PWD_ICTXPC25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICLDO25_SET(BIAS_BIAS_SEL_PWD_ICLDO25_RESET)) -#define BIAS_BIAS_SEL_HW_MASK (32'h0) -#define BIAS_BIAS_SEL_SW_MASK (32'h0 | \ - BIAS_BIAS_SEL_PADON_MASK | \ - BIAS_BIAS_SEL_SEL_BIAS_MASK | \ - BIAS_BIAS_SEL_SEL_SPARE_MASK | \ - BIAS_BIAS_SEL_SPARE_MASK | \ - BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK | \ - BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK | \ - BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK | \ - BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK | \ - BIAS_BIAS_SEL_PWD_ICCPLL25_MASK | \ - BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK | \ - BIAS_BIAS_SEL_PWD_ICXTAL25_MASK | \ - BIAS_BIAS_SEL_PWD_ICTSENS25_MASK | \ - BIAS_BIAS_SEL_PWD_ICTXPC25_MASK | \ - BIAS_BIAS_SEL_PWD_ICLDO25_MASK) - -#define BIAS_BIAS1_ADDRESS 'h0000003c -#define BIAS_BIAS1_PWD_ICDAC2BB25_MSB 31 -#define BIAS_BIAS1_PWD_ICDAC2BB25_LSB 29 -#define BIAS_BIAS1_PWD_ICDAC2BB25_MASK 'he0000000 -#define BIAS_BIAS1_PWD_ICDAC2BB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) >> BIAS_BIAS1_PWD_ICDAC2BB25_LSB) -#define BIAS_BIAS1_PWD_ICDAC2BB25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_ICDAC2BB25_LSB) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) -#define BIAS_BIAS1_PWD_ICDAC2BB25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GVGM25_MSB 28 -#define BIAS_BIAS1_PWD_IC2GVGM25_LSB 26 -#define BIAS_BIAS1_PWD_IC2GVGM25_MASK 'h1c000000 -#define BIAS_BIAS1_PWD_IC2GVGM25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) >> BIAS_BIAS1_PWD_IC2GVGM25_LSB) -#define BIAS_BIAS1_PWD_IC2GVGM25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GVGM25_LSB) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) -#define BIAS_BIAS1_PWD_IC2GVGM25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GRFFE25_MSB 25 -#define BIAS_BIAS1_PWD_IC2GRFFE25_LSB 23 -#define BIAS_BIAS1_PWD_IC2GRFFE25_MASK 'h03800000 -#define BIAS_BIAS1_PWD_IC2GRFFE25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) >> BIAS_BIAS1_PWD_IC2GRFFE25_LSB) -#define BIAS_BIAS1_PWD_IC2GRFFE25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GRFFE25_LSB) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) -#define BIAS_BIAS1_PWD_IC2GRFFE25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GLOREG25_MSB 22 -#define BIAS_BIAS1_PWD_IC2GLOREG25_LSB 20 -#define BIAS_BIAS1_PWD_IC2GLOREG25_MASK 'h00700000 -#define BIAS_BIAS1_PWD_IC2GLOREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLOREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLOREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GLOREG25_LSB) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) -#define BIAS_BIAS1_PWD_IC2GLOREG25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MSB 19 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_LSB 17 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MASK 'h000e0000 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_RESET 3'h3 -#define BIAS_BIAS1_PWD_ICDETECTORB25_MSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_LSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_MASK 'h00010000 -#define BIAS_BIAS1_PWD_ICDETECTORB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORB25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORB25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_ICDETECTORB25_LSB) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORB25_RESET 1'h0 -#define BIAS_BIAS1_PWD_ICDETECTORA25_MSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_LSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_MASK 'h00008000 -#define BIAS_BIAS1_PWD_ICDETECTORA25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORA25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORA25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_ICDETECTORA25_LSB) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORA25_RESET 1'h0 -#define BIAS_BIAS1_PWD_IC5GRXRF25_MSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_LSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_MASK 'h00004000 -#define BIAS_BIAS1_PWD_IC5GRXRF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) >> BIAS_BIAS1_PWD_IC5GRXRF25_LSB) -#define BIAS_BIAS1_PWD_IC5GRXRF25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GRXRF25_LSB) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) -#define BIAS_BIAS1_PWD_IC5GRXRF25_RESET 1'h0 -#define BIAS_BIAS1_PWD_IC5GTXPA25_MSB 13 -#define BIAS_BIAS1_PWD_IC5GTXPA25_LSB 11 -#define BIAS_BIAS1_PWD_IC5GTXPA25_MASK 'h00003800 -#define BIAS_BIAS1_PWD_IC5GTXPA25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) >> BIAS_BIAS1_PWD_IC5GTXPA25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXPA25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GTXPA25_LSB) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXPA25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MSB 10 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_LSB 8 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MASK 'h00000700 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) >> BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC5GQB25_MSB 7 -#define BIAS_BIAS1_PWD_IC5GQB25_LSB 5 -#define BIAS_BIAS1_PWD_IC5GQB25_MASK 'h000000e0 -#define BIAS_BIAS1_PWD_IC5GQB25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GQB25_MASK) >> BIAS_BIAS1_PWD_IC5GQB25_LSB) -#define BIAS_BIAS1_PWD_IC5GQB25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GQB25_LSB) & BIAS_BIAS1_PWD_IC5GQB25_MASK) -#define BIAS_BIAS1_PWD_IC5GQB25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MSB 4 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_LSB 2 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MASK 'h0000001c -#define BIAS_BIAS1_PWD_IC5GMIXQ25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) >> BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_RESET 3'h3 -#define BIAS_BIAS1_SPARE_MSB 1 -#define BIAS_BIAS1_SPARE_LSB 0 -#define BIAS_BIAS1_SPARE_MASK 'h00000003 -#define BIAS_BIAS1_SPARE_GET(x) (((x) & BIAS_BIAS1_SPARE_MASK) >> BIAS_BIAS1_SPARE_LSB) -#define BIAS_BIAS1_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_SPARE_LSB) & BIAS_BIAS1_SPARE_MASK) -#define BIAS_BIAS1_SPARE_RESET 2'h3 -#define BIAS_BIAS1_RESET (32'h0 | \ - BIAS_BIAS1_PWD_ICDAC2BB25_SET(BIAS_BIAS1_PWD_ICDAC2BB25_RESET) | \ - BIAS_BIAS1_PWD_IC2GVGM25_SET(BIAS_BIAS1_PWD_IC2GVGM25_RESET) | \ - BIAS_BIAS1_PWD_IC2GRFFE25_SET(BIAS_BIAS1_PWD_IC2GRFFE25_RESET) | \ - BIAS_BIAS1_PWD_IC2GLOREG25_SET(BIAS_BIAS1_PWD_IC2GLOREG25_RESET) | \ - BIAS_BIAS1_PWD_IC2GLNAREG25_SET(BIAS_BIAS1_PWD_IC2GLNAREG25_RESET) | \ - BIAS_BIAS1_PWD_ICDETECTORB25_SET(BIAS_BIAS1_PWD_ICDETECTORB25_RESET) | \ - BIAS_BIAS1_PWD_ICDETECTORA25_SET(BIAS_BIAS1_PWD_ICDETECTORA25_RESET) | \ - BIAS_BIAS1_PWD_IC5GRXRF25_SET(BIAS_BIAS1_PWD_IC5GRXRF25_RESET) | \ - BIAS_BIAS1_PWD_IC5GTXPA25_SET(BIAS_BIAS1_PWD_IC5GTXPA25_RESET) | \ - BIAS_BIAS1_PWD_IC5GTXBUF25_SET(BIAS_BIAS1_PWD_IC5GTXBUF25_RESET) | \ - BIAS_BIAS1_PWD_IC5GQB25_SET(BIAS_BIAS1_PWD_IC5GQB25_RESET) | \ - BIAS_BIAS1_PWD_IC5GMIXQ25_SET(BIAS_BIAS1_PWD_IC5GMIXQ25_RESET) | \ - BIAS_BIAS1_SPARE_SET(BIAS_BIAS1_SPARE_RESET)) -#define BIAS_BIAS1_HW_MASK (32'h0) -#define BIAS_BIAS1_SW_MASK (32'h0 | \ - BIAS_BIAS1_PWD_ICDAC2BB25_MASK | \ - BIAS_BIAS1_PWD_IC2GVGM25_MASK | \ - BIAS_BIAS1_PWD_IC2GRFFE25_MASK | \ - BIAS_BIAS1_PWD_IC2GLOREG25_MASK | \ - BIAS_BIAS1_PWD_IC2GLNAREG25_MASK | \ - BIAS_BIAS1_PWD_ICDETECTORB25_MASK | \ - BIAS_BIAS1_PWD_ICDETECTORA25_MASK | \ - BIAS_BIAS1_PWD_IC5GRXRF25_MASK | \ - BIAS_BIAS1_PWD_IC5GTXPA25_MASK | \ - BIAS_BIAS1_PWD_IC5GTXBUF25_MASK | \ - BIAS_BIAS1_PWD_IC5GQB25_MASK | \ - BIAS_BIAS1_PWD_IC5GMIXQ25_MASK | \ - BIAS_BIAS1_SPARE_MASK) - -#define BIAS_BIAS2_ADDRESS 'h00000040 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MSB 31 -#define BIAS_BIAS2_PWD_IC5GMIXI25_LSB 29 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MASK 'he0000000 -#define BIAS_BIAS2_PWD_IC5GMIXI25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) >> BIAS_BIAS2_PWD_IC5GMIXI25_LSB) -#define BIAS_BIAS2_PWD_IC5GMIXI25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IC5GMIXI25_LSB) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) -#define BIAS_BIAS2_PWD_IC5GMIXI25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IC5GDIV25_MSB 28 -#define BIAS_BIAS2_PWD_IC5GDIV25_LSB 26 -#define BIAS_BIAS2_PWD_IC5GDIV25_MASK 'h1c000000 -#define BIAS_BIAS2_PWD_IC5GDIV25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) >> BIAS_BIAS2_PWD_IC5GDIV25_LSB) -#define BIAS_BIAS2_PWD_IC5GDIV25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IC5GDIV25_LSB) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) -#define BIAS_BIAS2_PWD_IC5GDIV25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IC5GLOREG25_MSB 25 -#define BIAS_BIAS2_PWD_IC5GLOREG25_LSB 23 -#define BIAS_BIAS2_PWD_IC5GLOREG25_MASK 'h03800000 -#define BIAS_BIAS2_PWD_IC5GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) >> BIAS_BIAS2_PWD_IC5GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IC5GLOREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IC5GLOREG25_LSB) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IC5GLOREG25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRPLL25_MSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_LSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_MASK 'h00400000 -#define BIAS_BIAS2_PWD_IRPLL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRPLL25_MASK) >> BIAS_BIAS2_PWD_IRPLL25_LSB) -#define BIAS_BIAS2_PWD_IRPLL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRPLL25_LSB) & BIAS_BIAS2_PWD_IRPLL25_MASK) -#define BIAS_BIAS2_PWD_IRPLL25_RESET 1'h0 -#define BIAS_BIAS2_PWD_IRXTAL25_MSB 21 -#define BIAS_BIAS2_PWD_IRXTAL25_LSB 19 -#define BIAS_BIAS2_PWD_IRXTAL25_MASK 'h00380000 -#define BIAS_BIAS2_PWD_IRXTAL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRXTAL25_MASK) >> BIAS_BIAS2_PWD_IRXTAL25_LSB) -#define BIAS_BIAS2_PWD_IRXTAL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRXTAL25_LSB) & BIAS_BIAS2_PWD_IRXTAL25_MASK) -#define BIAS_BIAS2_PWD_IRXTAL25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRTSENS25_MSB 18 -#define BIAS_BIAS2_PWD_IRTSENS25_LSB 16 -#define BIAS_BIAS2_PWD_IRTSENS25_MASK 'h00070000 -#define BIAS_BIAS2_PWD_IRTSENS25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTSENS25_MASK) >> BIAS_BIAS2_PWD_IRTSENS25_LSB) -#define BIAS_BIAS2_PWD_IRTSENS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRTSENS25_LSB) & BIAS_BIAS2_PWD_IRTSENS25_MASK) -#define BIAS_BIAS2_PWD_IRTSENS25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRTXPC25_MSB 15 -#define BIAS_BIAS2_PWD_IRTXPC25_LSB 13 -#define BIAS_BIAS2_PWD_IRTXPC25_MASK 'h0000e000 -#define BIAS_BIAS2_PWD_IRTXPC25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTXPC25_MASK) >> BIAS_BIAS2_PWD_IRTXPC25_LSB) -#define BIAS_BIAS2_PWD_IRTXPC25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRTXPC25_LSB) & BIAS_BIAS2_PWD_IRTXPC25_MASK) -#define BIAS_BIAS2_PWD_IRTXPC25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRLDO25_MSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_LSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_MASK 'h00001000 -#define BIAS_BIAS2_PWD_IRLDO25_GET(x) (((x) & BIAS_BIAS2_PWD_IRLDO25_MASK) >> BIAS_BIAS2_PWD_IRLDO25_LSB) -#define BIAS_BIAS2_PWD_IRLDO25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRLDO25_LSB) & BIAS_BIAS2_PWD_IRLDO25_MASK) -#define BIAS_BIAS2_PWD_IRLDO25_RESET 1'h0 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MSB 11 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_LSB 9 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MASK 'h00000e00 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) >> BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IR2GLOREG25_MSB 8 -#define BIAS_BIAS2_PWD_IR2GLOREG25_LSB 6 -#define BIAS_BIAS2_PWD_IR2GLOREG25_MASK 'h000001c0 -#define BIAS_BIAS2_PWD_IR2GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLOREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR2GLOREG25_LSB) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IR2GLOREG25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MSB 5 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_LSB 3 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MASK 'h00000038 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MSB 2 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB 0 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK 'h00000007 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_GET(x) (((x) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) >> BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_RESET 3'h3 -#define BIAS_BIAS2_RESET (32'h0 | \ - BIAS_BIAS2_PWD_IC5GMIXI25_SET(BIAS_BIAS2_PWD_IC5GMIXI25_RESET) | \ - BIAS_BIAS2_PWD_IC5GDIV25_SET(BIAS_BIAS2_PWD_IC5GDIV25_RESET) | \ - BIAS_BIAS2_PWD_IC5GLOREG25_SET(BIAS_BIAS2_PWD_IC5GLOREG25_RESET) | \ - BIAS_BIAS2_PWD_IRPLL25_SET(BIAS_BIAS2_PWD_IRPLL25_RESET) | \ - BIAS_BIAS2_PWD_IRXTAL25_SET(BIAS_BIAS2_PWD_IRXTAL25_RESET) | \ - BIAS_BIAS2_PWD_IRTSENS25_SET(BIAS_BIAS2_PWD_IRTSENS25_RESET) | \ - BIAS_BIAS2_PWD_IRTXPC25_SET(BIAS_BIAS2_PWD_IRTXPC25_RESET) | \ - BIAS_BIAS2_PWD_IRLDO25_SET(BIAS_BIAS2_PWD_IRLDO25_RESET) | \ - BIAS_BIAS2_PWD_IR2GTXMIX25_SET(BIAS_BIAS2_PWD_IR2GTXMIX25_RESET) | \ - BIAS_BIAS2_PWD_IR2GLOREG25_SET(BIAS_BIAS2_PWD_IR2GLOREG25_RESET) | \ - BIAS_BIAS2_PWD_IR2GLNAREG25_SET(BIAS_BIAS2_PWD_IR2GLNAREG25_RESET) | \ - BIAS_BIAS2_PWD_IR5GRFVREF2525_SET(BIAS_BIAS2_PWD_IR5GRFVREF2525_RESET)) -#define BIAS_BIAS2_HW_MASK (32'h0) -#define BIAS_BIAS2_SW_MASK (32'h0 | \ - BIAS_BIAS2_PWD_IC5GMIXI25_MASK | \ - BIAS_BIAS2_PWD_IC5GDIV25_MASK | \ - BIAS_BIAS2_PWD_IC5GLOREG25_MASK | \ - BIAS_BIAS2_PWD_IRPLL25_MASK | \ - BIAS_BIAS2_PWD_IRXTAL25_MASK | \ - BIAS_BIAS2_PWD_IRTSENS25_MASK | \ - BIAS_BIAS2_PWD_IRTXPC25_MASK | \ - BIAS_BIAS2_PWD_IRLDO25_MASK | \ - BIAS_BIAS2_PWD_IR2GTXMIX25_MASK | \ - BIAS_BIAS2_PWD_IR2GLOREG25_MASK | \ - BIAS_BIAS2_PWD_IR2GLNAREG25_MASK | \ - BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) - -#define BIAS_BIAS3_ADDRESS 'h00000044 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MSB 31 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_LSB 29 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MASK 'he0000000 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) >> BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) -#define BIAS_BIAS3_PWD_IR5GTXMIX25_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) -#define BIAS_BIAS3_PWD_IR5GTXMIX25_RESET 3'h3 -#define BIAS_BIAS3_PWD_IR5GAGC25_MSB 28 -#define BIAS_BIAS3_PWD_IR5GAGC25_LSB 26 -#define BIAS_BIAS3_PWD_IR5GAGC25_MASK 'h1c000000 -#define BIAS_BIAS3_PWD_IR5GAGC25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) >> BIAS_BIAS3_PWD_IR5GAGC25_LSB) -#define BIAS_BIAS3_PWD_IR5GAGC25_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR5GAGC25_LSB) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) -#define BIAS_BIAS3_PWD_IR5GAGC25_RESET 3'h3 -#define BIAS_BIAS3_PWD_ICDAC50_MSB 25 -#define BIAS_BIAS3_PWD_ICDAC50_LSB 23 -#define BIAS_BIAS3_PWD_ICDAC50_MASK 'h03800000 -#define BIAS_BIAS3_PWD_ICDAC50_GET(x) (((x) & BIAS_BIAS3_PWD_ICDAC50_MASK) >> BIAS_BIAS3_PWD_ICDAC50_LSB) -#define BIAS_BIAS3_PWD_ICDAC50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICDAC50_LSB) & BIAS_BIAS3_PWD_ICDAC50_MASK) -#define BIAS_BIAS3_PWD_ICDAC50_RESET 3'h3 -#define BIAS_BIAS3_PWD_ICSYNTH50_MSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_LSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_MASK 'h00400000 -#define BIAS_BIAS3_PWD_ICSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) >> BIAS_BIAS3_PWD_ICSYNTH50_LSB) -#define BIAS_BIAS3_PWD_ICSYNTH50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICSYNTH50_LSB) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) -#define BIAS_BIAS3_PWD_ICSYNTH50_RESET 1'h0 -#define BIAS_BIAS3_PWD_ICBB50_MSB 21 -#define BIAS_BIAS3_PWD_ICBB50_LSB 21 -#define BIAS_BIAS3_PWD_ICBB50_MASK 'h00200000 -#define BIAS_BIAS3_PWD_ICBB50_GET(x) (((x) & BIAS_BIAS3_PWD_ICBB50_MASK) >> BIAS_BIAS3_PWD_ICBB50_LSB) -#define BIAS_BIAS3_PWD_ICBB50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICBB50_LSB) & BIAS_BIAS3_PWD_ICBB50_MASK) -#define BIAS_BIAS3_PWD_ICBB50_RESET 1'h0 -#define BIAS_BIAS3_PWD_IC2GDIV50_MSB 20 -#define BIAS_BIAS3_PWD_IC2GDIV50_LSB 18 -#define BIAS_BIAS3_PWD_IC2GDIV50_MASK 'h001c0000 -#define BIAS_BIAS3_PWD_IC2GDIV50_GET(x) (((x) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) >> BIAS_BIAS3_PWD_IC2GDIV50_LSB) -#define BIAS_BIAS3_PWD_IC2GDIV50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IC2GDIV50_LSB) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) -#define BIAS_BIAS3_PWD_IC2GDIV50_RESET 3'h3 -#define BIAS_BIAS3_PWD_IRSYNTH50_MSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_LSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_MASK 'h00020000 -#define BIAS_BIAS3_PWD_IRSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) >> BIAS_BIAS3_PWD_IRSYNTH50_LSB) -#define BIAS_BIAS3_PWD_IRSYNTH50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IRSYNTH50_LSB) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) -#define BIAS_BIAS3_PWD_IRSYNTH50_RESET 1'h0 -#define BIAS_BIAS3_PWD_IRBB50_MSB 16 -#define BIAS_BIAS3_PWD_IRBB50_LSB 16 -#define BIAS_BIAS3_PWD_IRBB50_MASK 'h00010000 -#define BIAS_BIAS3_PWD_IRBB50_GET(x) (((x) & BIAS_BIAS3_PWD_IRBB50_MASK) >> BIAS_BIAS3_PWD_IRBB50_LSB) -#define BIAS_BIAS3_PWD_IRBB50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IRBB50_LSB) & BIAS_BIAS3_PWD_IRBB50_MASK) -#define BIAS_BIAS3_PWD_IRBB50_RESET 1'h0 -#define BIAS_BIAS3_PWD_IC25SPARE1_MSB 15 -#define BIAS_BIAS3_PWD_IC25SPARE1_LSB 13 -#define BIAS_BIAS3_PWD_IC25SPARE1_MASK 'h0000e000 -#define BIAS_BIAS3_PWD_IC25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) >> BIAS_BIAS3_PWD_IC25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE1_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IC25SPARE1_LSB) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE1_RESET 3'h3 -#define BIAS_BIAS3_PWD_IC25SPARE2_MSB 12 -#define BIAS_BIAS3_PWD_IC25SPARE2_LSB 10 -#define BIAS_BIAS3_PWD_IC25SPARE2_MASK 'h00001c00 -#define BIAS_BIAS3_PWD_IC25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) >> BIAS_BIAS3_PWD_IC25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE2_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IC25SPARE2_LSB) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE2_RESET 3'h3 -#define BIAS_BIAS3_PWD_IR25SPARE1_MSB 9 -#define BIAS_BIAS3_PWD_IR25SPARE1_LSB 7 -#define BIAS_BIAS3_PWD_IR25SPARE1_MASK 'h00000380 -#define BIAS_BIAS3_PWD_IR25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) >> BIAS_BIAS3_PWD_IR25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE1_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR25SPARE1_LSB) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE1_RESET 3'h3 -#define BIAS_BIAS3_PWD_IR25SPARE2_MSB 6 -#define BIAS_BIAS3_PWD_IR25SPARE2_LSB 4 -#define BIAS_BIAS3_PWD_IR25SPARE2_MASK 'h00000070 -#define BIAS_BIAS3_PWD_IR25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) >> BIAS_BIAS3_PWD_IR25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE2_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR25SPARE2_LSB) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE2_RESET 3'h3 -#define BIAS_BIAS3_PWD_ICDACREG12P5_MSB 3 -#define BIAS_BIAS3_PWD_ICDACREG12P5_LSB 1 -#define BIAS_BIAS3_PWD_ICDACREG12P5_MASK 'h0000000e -#define BIAS_BIAS3_PWD_ICDACREG12P5_GET(x) (((x) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) >> BIAS_BIAS3_PWD_ICDACREG12P5_LSB) -#define BIAS_BIAS3_PWD_ICDACREG12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICDACREG12P5_LSB) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) -#define BIAS_BIAS3_PWD_ICDACREG12P5_RESET 3'h5 -#define BIAS_BIAS3_SPARE_MSB 0 -#define BIAS_BIAS3_SPARE_LSB 0 -#define BIAS_BIAS3_SPARE_MASK 'h00000001 -#define BIAS_BIAS3_SPARE_GET(x) (((x) & BIAS_BIAS3_SPARE_MASK) >> BIAS_BIAS3_SPARE_LSB) -#define BIAS_BIAS3_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_SPARE_LSB) & BIAS_BIAS3_SPARE_MASK) -#define BIAS_BIAS3_SPARE_RESET 1'h0 -#define BIAS_BIAS3_RESET (32'h0 | \ - BIAS_BIAS3_PWD_IR5GTXMIX25_SET(BIAS_BIAS3_PWD_IR5GTXMIX25_RESET) | \ - BIAS_BIAS3_PWD_IR5GAGC25_SET(BIAS_BIAS3_PWD_IR5GAGC25_RESET) | \ - BIAS_BIAS3_PWD_ICDAC50_SET(BIAS_BIAS3_PWD_ICDAC50_RESET) | \ - BIAS_BIAS3_PWD_ICSYNTH50_SET(BIAS_BIAS3_PWD_ICSYNTH50_RESET) | \ - BIAS_BIAS3_PWD_ICBB50_SET(BIAS_BIAS3_PWD_ICBB50_RESET) | \ - BIAS_BIAS3_PWD_IC2GDIV50_SET(BIAS_BIAS3_PWD_IC2GDIV50_RESET) | \ - BIAS_BIAS3_PWD_IRSYNTH50_SET(BIAS_BIAS3_PWD_IRSYNTH50_RESET) | \ - BIAS_BIAS3_PWD_IRBB50_SET(BIAS_BIAS3_PWD_IRBB50_RESET) | \ - BIAS_BIAS3_PWD_IC25SPARE1_SET(BIAS_BIAS3_PWD_IC25SPARE1_RESET) | \ - BIAS_BIAS3_PWD_IC25SPARE2_SET(BIAS_BIAS3_PWD_IC25SPARE2_RESET) | \ - BIAS_BIAS3_PWD_IR25SPARE1_SET(BIAS_BIAS3_PWD_IR25SPARE1_RESET) | \ - BIAS_BIAS3_PWD_IR25SPARE2_SET(BIAS_BIAS3_PWD_IR25SPARE2_RESET) | \ - BIAS_BIAS3_PWD_ICDACREG12P5_SET(BIAS_BIAS3_PWD_ICDACREG12P5_RESET) | \ - BIAS_BIAS3_SPARE_SET(BIAS_BIAS3_SPARE_RESET)) -#define BIAS_BIAS3_HW_MASK (32'h0) -#define BIAS_BIAS3_SW_MASK (32'h0 | \ - BIAS_BIAS3_PWD_IR5GTXMIX25_MASK | \ - BIAS_BIAS3_PWD_IR5GAGC25_MASK | \ - BIAS_BIAS3_PWD_ICDAC50_MASK | \ - BIAS_BIAS3_PWD_ICSYNTH50_MASK | \ - BIAS_BIAS3_PWD_ICBB50_MASK | \ - BIAS_BIAS3_PWD_IC2GDIV50_MASK | \ - BIAS_BIAS3_PWD_IRSYNTH50_MASK | \ - BIAS_BIAS3_PWD_IRBB50_MASK | \ - BIAS_BIAS3_PWD_IC25SPARE1_MASK | \ - BIAS_BIAS3_PWD_IC25SPARE2_MASK | \ - BIAS_BIAS3_PWD_IR25SPARE1_MASK | \ - BIAS_BIAS3_PWD_IR25SPARE2_MASK | \ - BIAS_BIAS3_PWD_ICDACREG12P5_MASK | \ - BIAS_BIAS3_SPARE_MASK) - -#define TXPC_TXPC_ADDRESS 'h00000048 -#define TXPC_TXPC_SELINTPD_MSB 31 -#define TXPC_TXPC_SELINTPD_LSB 31 -#define TXPC_TXPC_SELINTPD_MASK 'h80000000 -#define TXPC_TXPC_SELINTPD_GET(x) (((x) & TXPC_TXPC_SELINTPD_MASK) >> TXPC_TXPC_SELINTPD_LSB) -#define TXPC_TXPC_SELINTPD_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELINTPD_LSB) & TXPC_TXPC_SELINTPD_MASK) -#define TXPC_TXPC_SELINTPD_RESET 1'h0 -#define TXPC_TXPC_TEST_MSB 30 -#define TXPC_TXPC_TEST_LSB 30 -#define TXPC_TXPC_TEST_MASK 'h40000000 -#define TXPC_TXPC_TEST_GET(x) (((x) & TXPC_TXPC_TEST_MASK) >> TXPC_TXPC_TEST_LSB) -#define TXPC_TXPC_TEST_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TEST_LSB) & TXPC_TXPC_TEST_MASK) -#define TXPC_TXPC_TEST_RESET 1'h0 -#define TXPC_TXPC_TESTGAIN_MSB 29 -#define TXPC_TXPC_TESTGAIN_LSB 28 -#define TXPC_TXPC_TESTGAIN_MASK 'h30000000 -#define TXPC_TXPC_TESTGAIN_GET(x) (((x) & TXPC_TXPC_TESTGAIN_MASK) >> TXPC_TXPC_TESTGAIN_LSB) -#define TXPC_TXPC_TESTGAIN_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TESTGAIN_LSB) & TXPC_TXPC_TESTGAIN_MASK) -#define TXPC_TXPC_TESTGAIN_RESET 2'h0 -#define TXPC_TXPC_TESTDAC_MSB 27 -#define TXPC_TXPC_TESTDAC_LSB 22 -#define TXPC_TXPC_TESTDAC_MASK 'h0fc00000 -#define TXPC_TXPC_TESTDAC_GET(x) (((x) & TXPC_TXPC_TESTDAC_MASK) >> TXPC_TXPC_TESTDAC_LSB) -#define TXPC_TXPC_TESTDAC_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TESTDAC_LSB) & TXPC_TXPC_TESTDAC_MASK) -#define TXPC_TXPC_TESTDAC_RESET 6'h20 -#define TXPC_TXPC_TESTPWDPC_MSB 21 -#define TXPC_TXPC_TESTPWDPC_LSB 21 -#define TXPC_TXPC_TESTPWDPC_MASK 'h00200000 -#define TXPC_TXPC_TESTPWDPC_GET(x) (((x) & TXPC_TXPC_TESTPWDPC_MASK) >> TXPC_TXPC_TESTPWDPC_LSB) -#define TXPC_TXPC_TESTPWDPC_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TESTPWDPC_LSB) & TXPC_TXPC_TESTPWDPC_MASK) -#define TXPC_TXPC_TESTPWDPC_RESET 1'h0 -#define TXPC_TXPC_CURHALF_MSB 20 -#define TXPC_TXPC_CURHALF_LSB 20 -#define TXPC_TXPC_CURHALF_MASK 'h00100000 -#define TXPC_TXPC_CURHALF_GET(x) (((x) & TXPC_TXPC_CURHALF_MASK) >> TXPC_TXPC_CURHALF_LSB) -#define TXPC_TXPC_CURHALF_SET(x) (((32'd0 | (x)) << TXPC_TXPC_CURHALF_LSB) & TXPC_TXPC_CURHALF_MASK) -#define TXPC_TXPC_CURHALF_RESET 1'h1 -#define TXPC_TXPC_NEGOUT_MSB 19 -#define TXPC_TXPC_NEGOUT_LSB 19 -#define TXPC_TXPC_NEGOUT_MASK 'h00080000 -#define TXPC_TXPC_NEGOUT_GET(x) (((x) & TXPC_TXPC_NEGOUT_MASK) >> TXPC_TXPC_NEGOUT_LSB) -#define TXPC_TXPC_NEGOUT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_NEGOUT_LSB) & TXPC_TXPC_NEGOUT_MASK) -#define TXPC_TXPC_NEGOUT_RESET 1'h0 -#define TXPC_TXPC_CLKDELAY_MSB 18 -#define TXPC_TXPC_CLKDELAY_LSB 18 -#define TXPC_TXPC_CLKDELAY_MASK 'h00040000 -#define TXPC_TXPC_CLKDELAY_GET(x) (((x) & TXPC_TXPC_CLKDELAY_MASK) >> TXPC_TXPC_CLKDELAY_LSB) -#define TXPC_TXPC_CLKDELAY_SET(x) (((32'd0 | (x)) << TXPC_TXPC_CLKDELAY_LSB) & TXPC_TXPC_CLKDELAY_MASK) -#define TXPC_TXPC_CLKDELAY_RESET 1'h0 -#define TXPC_TXPC_SELMODREF_MSB 17 -#define TXPC_TXPC_SELMODREF_LSB 17 -#define TXPC_TXPC_SELMODREF_MASK 'h00020000 -#define TXPC_TXPC_SELMODREF_GET(x) (((x) & TXPC_TXPC_SELMODREF_MASK) >> TXPC_TXPC_SELMODREF_LSB) -#define TXPC_TXPC_SELMODREF_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELMODREF_LSB) & TXPC_TXPC_SELMODREF_MASK) -#define TXPC_TXPC_SELMODREF_RESET 1'h0 -#define TXPC_TXPC_SELCMOUT_MSB 16 -#define TXPC_TXPC_SELCMOUT_LSB 16 -#define TXPC_TXPC_SELCMOUT_MASK 'h00010000 -#define TXPC_TXPC_SELCMOUT_GET(x) (((x) & TXPC_TXPC_SELCMOUT_MASK) >> TXPC_TXPC_SELCMOUT_LSB) -#define TXPC_TXPC_SELCMOUT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELCMOUT_LSB) & TXPC_TXPC_SELCMOUT_MASK) -#define TXPC_TXPC_SELCMOUT_RESET 1'h0 -#define TXPC_TXPC_TSMODE_MSB 15 -#define TXPC_TXPC_TSMODE_LSB 14 -#define TXPC_TXPC_TSMODE_MASK 'h0000c000 -#define TXPC_TXPC_TSMODE_GET(x) (((x) & TXPC_TXPC_TSMODE_MASK) >> TXPC_TXPC_TSMODE_LSB) -#define TXPC_TXPC_TSMODE_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TSMODE_LSB) & TXPC_TXPC_TSMODE_MASK) -#define TXPC_TXPC_TSMODE_RESET 2'h0 -#define TXPC_TXPC_N_MSB 13 -#define TXPC_TXPC_N_LSB 6 -#define TXPC_TXPC_N_MASK 'h00003fc0 -#define TXPC_TXPC_N_GET(x) (((x) & TXPC_TXPC_N_MASK) >> TXPC_TXPC_N_LSB) -#define TXPC_TXPC_N_SET(x) (((32'd0 | (x)) << TXPC_TXPC_N_LSB) & TXPC_TXPC_N_MASK) -#define TXPC_TXPC_N_RESET 8'h80 -#define TXPC_TXPC_ON1STSYNTHON_MSB 5 -#define TXPC_TXPC_ON1STSYNTHON_LSB 5 -#define TXPC_TXPC_ON1STSYNTHON_MASK 'h00000020 -#define TXPC_TXPC_ON1STSYNTHON_GET(x) (((x) & TXPC_TXPC_ON1STSYNTHON_MASK) >> TXPC_TXPC_ON1STSYNTHON_LSB) -#define TXPC_TXPC_ON1STSYNTHON_SET(x) (((32'd0 | (x)) << TXPC_TXPC_ON1STSYNTHON_LSB) & TXPC_TXPC_ON1STSYNTHON_MASK) -#define TXPC_TXPC_ON1STSYNTHON_RESET 1'h1 -#define TXPC_TXPC_SELINIT_MSB 4 -#define TXPC_TXPC_SELINIT_LSB 3 -#define TXPC_TXPC_SELINIT_MASK 'h00000018 -#define TXPC_TXPC_SELINIT_GET(x) (((x) & TXPC_TXPC_SELINIT_MASK) >> TXPC_TXPC_SELINIT_LSB) -#define TXPC_TXPC_SELINIT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELINIT_LSB) & TXPC_TXPC_SELINIT_MASK) -#define TXPC_TXPC_SELINIT_RESET 2'h3 -#define TXPC_TXPC_SELCOUNT_MSB 2 -#define TXPC_TXPC_SELCOUNT_LSB 2 -#define TXPC_TXPC_SELCOUNT_MASK 'h00000004 -#define TXPC_TXPC_SELCOUNT_GET(x) (((x) & TXPC_TXPC_SELCOUNT_MASK) >> TXPC_TXPC_SELCOUNT_LSB) -#define TXPC_TXPC_SELCOUNT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELCOUNT_LSB) & TXPC_TXPC_SELCOUNT_MASK) -#define TXPC_TXPC_SELCOUNT_RESET 1'h1 -#define TXPC_TXPC_ATBSEL_MSB 1 -#define TXPC_TXPC_ATBSEL_LSB 0 -#define TXPC_TXPC_ATBSEL_MASK 'h00000003 -#define TXPC_TXPC_ATBSEL_GET(x) (((x) & TXPC_TXPC_ATBSEL_MASK) >> TXPC_TXPC_ATBSEL_LSB) -#define TXPC_TXPC_ATBSEL_SET(x) (((32'd0 | (x)) << TXPC_TXPC_ATBSEL_LSB) & TXPC_TXPC_ATBSEL_MASK) -#define TXPC_TXPC_ATBSEL_RESET 2'h0 -#define TXPC_TXPC_RESET (32'h0 | \ - TXPC_TXPC_SELINTPD_SET(TXPC_TXPC_SELINTPD_RESET) | \ - TXPC_TXPC_TEST_SET(TXPC_TXPC_TEST_RESET) | \ - TXPC_TXPC_TESTGAIN_SET(TXPC_TXPC_TESTGAIN_RESET) | \ - TXPC_TXPC_TESTDAC_SET(TXPC_TXPC_TESTDAC_RESET) | \ - TXPC_TXPC_TESTPWDPC_SET(TXPC_TXPC_TESTPWDPC_RESET) | \ - TXPC_TXPC_CURHALF_SET(TXPC_TXPC_CURHALF_RESET) | \ - TXPC_TXPC_NEGOUT_SET(TXPC_TXPC_NEGOUT_RESET) | \ - TXPC_TXPC_CLKDELAY_SET(TXPC_TXPC_CLKDELAY_RESET) | \ - TXPC_TXPC_SELMODREF_SET(TXPC_TXPC_SELMODREF_RESET) | \ - TXPC_TXPC_SELCMOUT_SET(TXPC_TXPC_SELCMOUT_RESET) | \ - TXPC_TXPC_TSMODE_SET(TXPC_TXPC_TSMODE_RESET) | \ - TXPC_TXPC_N_SET(TXPC_TXPC_N_RESET) | \ - TXPC_TXPC_ON1STSYNTHON_SET(TXPC_TXPC_ON1STSYNTHON_RESET) | \ - TXPC_TXPC_SELINIT_SET(TXPC_TXPC_SELINIT_RESET) | \ - TXPC_TXPC_SELCOUNT_SET(TXPC_TXPC_SELCOUNT_RESET) | \ - TXPC_TXPC_ATBSEL_SET(TXPC_TXPC_ATBSEL_RESET)) -#define TXPC_TXPC_HW_MASK (32'h0) -#define TXPC_TXPC_SW_MASK (32'h0 | \ - TXPC_TXPC_SELINTPD_MASK | \ - TXPC_TXPC_TEST_MASK | \ - TXPC_TXPC_TESTGAIN_MASK | \ - TXPC_TXPC_TESTDAC_MASK | \ - TXPC_TXPC_TESTPWDPC_MASK | \ - TXPC_TXPC_CURHALF_MASK | \ - TXPC_TXPC_NEGOUT_MASK | \ - TXPC_TXPC_CLKDELAY_MASK | \ - TXPC_TXPC_SELMODREF_MASK | \ - TXPC_TXPC_SELCMOUT_MASK | \ - TXPC_TXPC_TSMODE_MASK | \ - TXPC_TXPC_N_MASK | \ - TXPC_TXPC_ON1STSYNTHON_MASK | \ - TXPC_TXPC_SELINIT_MASK | \ - TXPC_TXPC_SELCOUNT_MASK | \ - TXPC_TXPC_ATBSEL_MASK) - -#define TXPC_MISC_ADDRESS 'h0000004c -#define TXPC_MISC_FLIPBMODE_MSB 31 -#define TXPC_MISC_FLIPBMODE_LSB 31 -#define TXPC_MISC_FLIPBMODE_MASK 'h80000000 -#define TXPC_MISC_FLIPBMODE_GET(x) (((x) & TXPC_MISC_FLIPBMODE_MASK) >> TXPC_MISC_FLIPBMODE_LSB) -#define TXPC_MISC_FLIPBMODE_SET(x) (((32'd0 | (x)) << TXPC_MISC_FLIPBMODE_LSB) & TXPC_MISC_FLIPBMODE_MASK) -#define TXPC_MISC_FLIPBMODE_RESET 1'h0 -#define TXPC_MISC_LEVEL_MSB 30 -#define TXPC_MISC_LEVEL_LSB 29 -#define TXPC_MISC_LEVEL_MASK 'h60000000 -#define TXPC_MISC_LEVEL_GET(x) (((x) & TXPC_MISC_LEVEL_MASK) >> TXPC_MISC_LEVEL_LSB) -#define TXPC_MISC_LEVEL_SET(x) (((32'd0 | (x)) << TXPC_MISC_LEVEL_LSB) & TXPC_MISC_LEVEL_MASK) -#define TXPC_MISC_LEVEL_RESET 2'h0 -#define TXPC_MISC_LDO_TEST_MODE_MSB 28 -#define TXPC_MISC_LDO_TEST_MODE_LSB 28 -#define TXPC_MISC_LDO_TEST_MODE_MASK 'h10000000 -#define TXPC_MISC_LDO_TEST_MODE_GET(x) (((x) & TXPC_MISC_LDO_TEST_MODE_MASK) >> TXPC_MISC_LDO_TEST_MODE_LSB) -#define TXPC_MISC_LDO_TEST_MODE_SET(x) (((32'd0 | (x)) << TXPC_MISC_LDO_TEST_MODE_LSB) & TXPC_MISC_LDO_TEST_MODE_MASK) -#define TXPC_MISC_LDO_TEST_MODE_RESET 1'h0 -#define TXPC_MISC_NOTCXODET_MSB 27 -#define TXPC_MISC_NOTCXODET_LSB 27 -#define TXPC_MISC_NOTCXODET_MASK 'h08000000 -#define TXPC_MISC_NOTCXODET_GET(x) (((x) & TXPC_MISC_NOTCXODET_MASK) >> TXPC_MISC_NOTCXODET_LSB) -#define TXPC_MISC_NOTCXODET_SET(x) (((32'd0 | (x)) << TXPC_MISC_NOTCXODET_LSB) & TXPC_MISC_NOTCXODET_MASK) -#define TXPC_MISC_NOTCXODET_RESET 1'h0 -#define TXPC_MISC_PWDCLKIND_MSB 26 -#define TXPC_MISC_PWDCLKIND_LSB 26 -#define TXPC_MISC_PWDCLKIND_MASK 'h04000000 -#define TXPC_MISC_PWDCLKIND_GET(x) (((x) & TXPC_MISC_PWDCLKIND_MASK) >> TXPC_MISC_PWDCLKIND_LSB) -#define TXPC_MISC_PWDCLKIND_SET(x) (((32'd0 | (x)) << TXPC_MISC_PWDCLKIND_LSB) & TXPC_MISC_PWDCLKIND_MASK) -#define TXPC_MISC_PWDCLKIND_RESET 1'h0 -#define TXPC_MISC_PWDXINPAD_MSB 25 -#define TXPC_MISC_PWDXINPAD_LSB 25 -#define TXPC_MISC_PWDXINPAD_MASK 'h02000000 -#define TXPC_MISC_PWDXINPAD_GET(x) (((x) & TXPC_MISC_PWDXINPAD_MASK) >> TXPC_MISC_PWDXINPAD_LSB) -#define TXPC_MISC_PWDXINPAD_SET(x) (((32'd0 | (x)) << TXPC_MISC_PWDXINPAD_LSB) & TXPC_MISC_PWDXINPAD_MASK) -#define TXPC_MISC_PWDXINPAD_RESET 1'h0 -#define TXPC_MISC_LOCALBIAS_MSB 24 -#define TXPC_MISC_LOCALBIAS_LSB 24 -#define TXPC_MISC_LOCALBIAS_MASK 'h01000000 -#define TXPC_MISC_LOCALBIAS_GET(x) (((x) & TXPC_MISC_LOCALBIAS_MASK) >> TXPC_MISC_LOCALBIAS_LSB) -#define TXPC_MISC_LOCALBIAS_SET(x) (((32'd0 | (x)) << TXPC_MISC_LOCALBIAS_LSB) & TXPC_MISC_LOCALBIAS_MASK) -#define TXPC_MISC_LOCALBIAS_RESET 1'h1 -#define TXPC_MISC_LOCALBIAS2X_MSB 23 -#define TXPC_MISC_LOCALBIAS2X_LSB 23 -#define TXPC_MISC_LOCALBIAS2X_MASK 'h00800000 -#define TXPC_MISC_LOCALBIAS2X_GET(x) (((x) & TXPC_MISC_LOCALBIAS2X_MASK) >> TXPC_MISC_LOCALBIAS2X_LSB) -#define TXPC_MISC_LOCALBIAS2X_SET(x) (((32'd0 | (x)) << TXPC_MISC_LOCALBIAS2X_LSB) & TXPC_MISC_LOCALBIAS2X_MASK) -#define TXPC_MISC_LOCALBIAS2X_RESET 1'h0 -#define TXPC_MISC_SELTSP_MSB 22 -#define TXPC_MISC_SELTSP_LSB 22 -#define TXPC_MISC_SELTSP_MASK 'h00400000 -#define TXPC_MISC_SELTSP_GET(x) (((x) & TXPC_MISC_SELTSP_MASK) >> TXPC_MISC_SELTSP_LSB) -#define TXPC_MISC_SELTSP_SET(x) (((32'd0 | (x)) << TXPC_MISC_SELTSP_LSB) & TXPC_MISC_SELTSP_MASK) -#define TXPC_MISC_SELTSP_RESET 1'h0 -#define TXPC_MISC_SELTSN_MSB 21 -#define TXPC_MISC_SELTSN_LSB 21 -#define TXPC_MISC_SELTSN_MASK 'h00200000 -#define TXPC_MISC_SELTSN_GET(x) (((x) & TXPC_MISC_SELTSN_MASK) >> TXPC_MISC_SELTSN_LSB) -#define TXPC_MISC_SELTSN_SET(x) (((32'd0 | (x)) << TXPC_MISC_SELTSN_LSB) & TXPC_MISC_SELTSN_MASK) -#define TXPC_MISC_SELTSN_RESET 1'h0 -#define TXPC_MISC_SPARE_A_MSB 20 -#define TXPC_MISC_SPARE_A_LSB 18 -#define TXPC_MISC_SPARE_A_MASK 'h001c0000 -#define TXPC_MISC_SPARE_A_GET(x) (((x) & TXPC_MISC_SPARE_A_MASK) >> TXPC_MISC_SPARE_A_LSB) -#define TXPC_MISC_SPARE_A_SET(x) (((32'd0 | (x)) << TXPC_MISC_SPARE_A_LSB) & TXPC_MISC_SPARE_A_MASK) -#define TXPC_MISC_SPARE_A_RESET 3'h0 -#define TXPC_MISC_DECOUT_MSB 17 -#define TXPC_MISC_DECOUT_LSB 8 -#define TXPC_MISC_DECOUT_MASK 'h0003ff00 -#define TXPC_MISC_DECOUT_GET(x) (((x) & TXPC_MISC_DECOUT_MASK) >> TXPC_MISC_DECOUT_LSB) -#define TXPC_MISC_DECOUT_SET(x) (((32'd0 | (x)) << TXPC_MISC_DECOUT_LSB) & TXPC_MISC_DECOUT_MASK) -#define TXPC_MISC_DECOUT_RESET 10'h0 -#define TXPC_MISC_XTALDIV_MSB 7 -#define TXPC_MISC_XTALDIV_LSB 6 -#define TXPC_MISC_XTALDIV_MASK 'h000000c0 -#define TXPC_MISC_XTALDIV_GET(x) (((x) & TXPC_MISC_XTALDIV_MASK) >> TXPC_MISC_XTALDIV_LSB) -#define TXPC_MISC_XTALDIV_SET(x) (((32'd0 | (x)) << TXPC_MISC_XTALDIV_LSB) & TXPC_MISC_XTALDIV_MASK) -#define TXPC_MISC_XTALDIV_RESET 2'h0 -#define TXPC_MISC_SPARE_MSB 5 -#define TXPC_MISC_SPARE_LSB 0 -#define TXPC_MISC_SPARE_MASK 'h0000003f -#define TXPC_MISC_SPARE_GET(x) (((x) & TXPC_MISC_SPARE_MASK) >> TXPC_MISC_SPARE_LSB) -#define TXPC_MISC_SPARE_SET(x) (((32'd0 | (x)) << TXPC_MISC_SPARE_LSB) & TXPC_MISC_SPARE_MASK) -#define TXPC_MISC_SPARE_RESET 6'h0 -#define TXPC_MISC_RESET (32'h0 | \ - TXPC_MISC_FLIPBMODE_SET(TXPC_MISC_FLIPBMODE_RESET) | \ - TXPC_MISC_LEVEL_SET(TXPC_MISC_LEVEL_RESET) | \ - TXPC_MISC_LDO_TEST_MODE_SET(TXPC_MISC_LDO_TEST_MODE_RESET) | \ - TXPC_MISC_NOTCXODET_SET(TXPC_MISC_NOTCXODET_RESET) | \ - TXPC_MISC_PWDCLKIND_SET(TXPC_MISC_PWDCLKIND_RESET) | \ - TXPC_MISC_PWDXINPAD_SET(TXPC_MISC_PWDXINPAD_RESET) | \ - TXPC_MISC_LOCALBIAS_SET(TXPC_MISC_LOCALBIAS_RESET) | \ - TXPC_MISC_LOCALBIAS2X_SET(TXPC_MISC_LOCALBIAS2X_RESET) | \ - TXPC_MISC_SELTSP_SET(TXPC_MISC_SELTSP_RESET) | \ - TXPC_MISC_SELTSN_SET(TXPC_MISC_SELTSN_RESET) | \ - TXPC_MISC_SPARE_A_SET(TXPC_MISC_SPARE_A_RESET) | \ - TXPC_MISC_DECOUT_SET(TXPC_MISC_DECOUT_RESET) | \ - TXPC_MISC_XTALDIV_SET(TXPC_MISC_XTALDIV_RESET) | \ - TXPC_MISC_SPARE_SET(TXPC_MISC_SPARE_RESET)) -#define TXPC_MISC_HW_MASK (32'h0 | \ - TXPC_MISC_DECOUT_MASK) -#define TXPC_MISC_SW_MASK (32'h0 | \ - TXPC_MISC_FLIPBMODE_MASK | \ - TXPC_MISC_LEVEL_MASK | \ - TXPC_MISC_LDO_TEST_MODE_MASK | \ - TXPC_MISC_NOTCXODET_MASK | \ - TXPC_MISC_PWDCLKIND_MASK | \ - TXPC_MISC_PWDXINPAD_MASK | \ - TXPC_MISC_LOCALBIAS_MASK | \ - TXPC_MISC_LOCALBIAS2X_MASK | \ - TXPC_MISC_SELTSP_MASK | \ - TXPC_MISC_SELTSN_MASK | \ - TXPC_MISC_SPARE_A_MASK | \ - TXPC_MISC_DECOUT_MASK | \ - TXPC_MISC_XTALDIV_MASK | \ - TXPC_MISC_SPARE_MASK) - -#define RXTXBB_RXTXBB1_ADDRESS 'h00000050 -#define RXTXBB_RXTXBB1_SPARE_MSB 31 -#define RXTXBB_RXTXBB1_SPARE_LSB 19 -#define RXTXBB_RXTXBB1_SPARE_MASK 'hfff80000 -#define RXTXBB_RXTXBB1_SPARE_GET(x) (((x) & RXTXBB_RXTXBB1_SPARE_MASK) >> RXTXBB_RXTXBB1_SPARE_LSB) -#define RXTXBB_RXTXBB1_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_SPARE_LSB) & RXTXBB_RXTXBB1_SPARE_MASK) -#define RXTXBB_RXTXBB1_SPARE_RESET 13'h0 -#define RXTXBB_RXTXBB1_FNOTCH_MSB 18 -#define RXTXBB_RXTXBB1_FNOTCH_LSB 17 -#define RXTXBB_RXTXBB1_FNOTCH_MASK 'h00060000 -#define RXTXBB_RXTXBB1_FNOTCH_GET(x) (((x) & RXTXBB_RXTXBB1_FNOTCH_MASK) >> RXTXBB_RXTXBB1_FNOTCH_LSB) -#define RXTXBB_RXTXBB1_FNOTCH_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_FNOTCH_LSB) & RXTXBB_RXTXBB1_FNOTCH_MASK) -#define RXTXBB_RXTXBB1_FNOTCH_RESET 2'h0 -#define RXTXBB_RXTXBB1_SEL_ATB_MSB 16 -#define RXTXBB_RXTXBB1_SEL_ATB_LSB 9 -#define RXTXBB_RXTXBB1_SEL_ATB_MASK 'h0001fe00 -#define RXTXBB_RXTXBB1_SEL_ATB_GET(x) (((x) & RXTXBB_RXTXBB1_SEL_ATB_MASK) >> RXTXBB_RXTXBB1_SEL_ATB_LSB) -#define RXTXBB_RXTXBB1_SEL_ATB_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_SEL_ATB_LSB) & RXTXBB_RXTXBB1_SEL_ATB_MASK) -#define RXTXBB_RXTXBB1_SEL_ATB_RESET 8'h0 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_LSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MASK 'h00000100 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_GET(x) (((x) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) >> RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDV2I_MSB 7 -#define RXTXBB_RXTXBB1_PDV2I_LSB 7 -#define RXTXBB_RXTXBB1_PDV2I_MASK 'h00000080 -#define RXTXBB_RXTXBB1_PDV2I_GET(x) (((x) & RXTXBB_RXTXBB1_PDV2I_MASK) >> RXTXBB_RXTXBB1_PDV2I_LSB) -#define RXTXBB_RXTXBB1_PDV2I_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDV2I_LSB) & RXTXBB_RXTXBB1_PDV2I_MASK) -#define RXTXBB_RXTXBB1_PDV2I_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDI2V_MSB 6 -#define RXTXBB_RXTXBB1_PDI2V_LSB 6 -#define RXTXBB_RXTXBB1_PDI2V_MASK 'h00000040 -#define RXTXBB_RXTXBB1_PDI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDI2V_MASK) >> RXTXBB_RXTXBB1_PDI2V_LSB) -#define RXTXBB_RXTXBB1_PDI2V_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDI2V_LSB) & RXTXBB_RXTXBB1_PDI2V_MASK) -#define RXTXBB_RXTXBB1_PDI2V_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDRXTXBB_MSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_LSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_MASK 'h00000020 -#define RXTXBB_RXTXBB1_PDRXTXBB_GET(x) (((x) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) >> RXTXBB_RXTXBB1_PDRXTXBB_LSB) -#define RXTXBB_RXTXBB1_PDRXTXBB_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDRXTXBB_LSB) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) -#define RXTXBB_RXTXBB1_PDRXTXBB_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK 'h00000010 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK 'h00000008 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_LSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MASK 'h00000004 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) >> RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDLOQ_MSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_LSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_MASK 'h00000002 -#define RXTXBB_RXTXBB1_PDLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDLOQ_MASK) >> RXTXBB_RXTXBB1_PDLOQ_LSB) -#define RXTXBB_RXTXBB1_PDLOQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDLOQ_LSB) & RXTXBB_RXTXBB1_PDLOQ_MASK) -#define RXTXBB_RXTXBB1_PDLOQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDHIQ_MSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_LSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_MASK 'h00000001 -#define RXTXBB_RXTXBB1_PDHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDHIQ_MASK) >> RXTXBB_RXTXBB1_PDHIQ_LSB) -#define RXTXBB_RXTXBB1_PDHIQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDHIQ_LSB) & RXTXBB_RXTXBB1_PDHIQ_MASK) -#define RXTXBB_RXTXBB1_PDHIQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_RESET (32'h0 | \ - RXTXBB_RXTXBB1_SPARE_SET(RXTXBB_RXTXBB1_SPARE_RESET) | \ - RXTXBB_RXTXBB1_FNOTCH_SET(RXTXBB_RXTXBB1_FNOTCH_RESET) | \ - RXTXBB_RXTXBB1_SEL_ATB_SET(RXTXBB_RXTXBB1_SEL_ATB_RESET) | \ - RXTXBB_RXTXBB1_PDDACINTERFACE_SET(RXTXBB_RXTXBB1_PDDACINTERFACE_RESET) | \ - RXTXBB_RXTXBB1_PDV2I_SET(RXTXBB_RXTXBB1_PDV2I_RESET) | \ - RXTXBB_RXTXBB1_PDI2V_SET(RXTXBB_RXTXBB1_PDI2V_RESET) | \ - RXTXBB_RXTXBB1_PDRXTXBB_SET(RXTXBB_RXTXBB1_PDRXTXBB_RESET) | \ - RXTXBB_RXTXBB1_PDOFFSETLOQ_SET(RXTXBB_RXTXBB1_PDOFFSETLOQ_RESET) | \ - RXTXBB_RXTXBB1_PDOFFSETHIQ_SET(RXTXBB_RXTXBB1_PDOFFSETHIQ_RESET) | \ - RXTXBB_RXTXBB1_PDOFFSETI2V_SET(RXTXBB_RXTXBB1_PDOFFSETI2V_RESET) | \ - RXTXBB_RXTXBB1_PDLOQ_SET(RXTXBB_RXTXBB1_PDLOQ_RESET) | \ - RXTXBB_RXTXBB1_PDHIQ_SET(RXTXBB_RXTXBB1_PDHIQ_RESET)) -#define RXTXBB_RXTXBB1_HW_MASK (32'h0) -#define RXTXBB_RXTXBB1_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB1_SPARE_MASK | \ - RXTXBB_RXTXBB1_FNOTCH_MASK | \ - RXTXBB_RXTXBB1_SEL_ATB_MASK | \ - RXTXBB_RXTXBB1_PDDACINTERFACE_MASK | \ - RXTXBB_RXTXBB1_PDV2I_MASK | \ - RXTXBB_RXTXBB1_PDI2V_MASK | \ - RXTXBB_RXTXBB1_PDRXTXBB_MASK | \ - RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK | \ - RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK | \ - RXTXBB_RXTXBB1_PDOFFSETI2V_MASK | \ - RXTXBB_RXTXBB1_PDLOQ_MASK | \ - RXTXBB_RXTXBB1_PDHIQ_MASK) - -#define RXTXBB_RXTXBB2_ADDRESS 'h00000054 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MSB 31 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB 29 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK 'he0000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_RESET 3'h6 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MSB 28 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB 26 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK 'h1c000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_RESET 3'h6 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MSB 25 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB 23 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK 'h03800000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_RESET 3'h6 -#define RXTXBB_RXTXBB2_SPARE_MSB 22 -#define RXTXBB_RXTXBB2_SPARE_LSB 21 -#define RXTXBB_RXTXBB2_SPARE_MASK 'h00600000 -#define RXTXBB_RXTXBB2_SPARE_GET(x) (((x) & RXTXBB_RXTXBB2_SPARE_MASK) >> RXTXBB_RXTXBB2_SPARE_LSB) -#define RXTXBB_RXTXBB2_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SPARE_LSB) & RXTXBB_RXTXBB2_SPARE_MASK) -#define RXTXBB_RXTXBB2_SPARE_RESET 2'h0 -#define RXTXBB_RXTXBB2_SHORTBUFFER_MSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_LSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_MASK 'h00100000 -#define RXTXBB_RXTXBB2_SHORTBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) >> RXTXBB_RXTXBB2_SHORTBUFFER_LSB) -#define RXTXBB_RXTXBB2_SHORTBUFFER_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SHORTBUFFER_LSB) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) -#define RXTXBB_RXTXBB2_SHORTBUFFER_RESET 1'h0 -#define RXTXBB_RXTXBB2_SELBUFFER_MSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_LSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_MASK 'h00080000 -#define RXTXBB_RXTXBB2_SELBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SELBUFFER_MASK) >> RXTXBB_RXTXBB2_SELBUFFER_LSB) -#define RXTXBB_RXTXBB2_SELBUFFER_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SELBUFFER_LSB) & RXTXBB_RXTXBB2_SELBUFFER_MASK) -#define RXTXBB_RXTXBB2_SELBUFFER_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK 'h00040000 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK 'h00020000 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK 'h00010000 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK 'h00008000 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_CMSEL_MSB 14 -#define RXTXBB_RXTXBB2_CMSEL_LSB 13 -#define RXTXBB_RXTXBB2_CMSEL_MASK 'h00006000 -#define RXTXBB_RXTXBB2_CMSEL_GET(x) (((x) & RXTXBB_RXTXBB2_CMSEL_MASK) >> RXTXBB_RXTXBB2_CMSEL_LSB) -#define RXTXBB_RXTXBB2_CMSEL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_CMSEL_LSB) & RXTXBB_RXTXBB2_CMSEL_MASK) -#define RXTXBB_RXTXBB2_CMSEL_RESET 2'h1 -#define RXTXBB_RXTXBB2_FILTERFC_MSB 12 -#define RXTXBB_RXTXBB2_FILTERFC_LSB 8 -#define RXTXBB_RXTXBB2_FILTERFC_MASK 'h00001f00 -#define RXTXBB_RXTXBB2_FILTERFC_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERFC_MASK) >> RXTXBB_RXTXBB2_FILTERFC_LSB) -#define RXTXBB_RXTXBB2_FILTERFC_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_FILTERFC_LSB) & RXTXBB_RXTXBB2_FILTERFC_MASK) -#define RXTXBB_RXTXBB2_FILTERFC_RESET 5'h10 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK 'h00000080 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_GET(x) (((x) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) >> RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_RESET 1'h0 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK 'h00000040 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) >> RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK 'h00000020 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK 'h00000010 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_RESET 1'h1 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK 'h00000008 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK 'h00000004 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK 'h00000002 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_RESET 1'h1 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK 'h00000001 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_GET(x) (((x) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) >> RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_RESET 1'h0 -#define RXTXBB_RXTXBB2_RESET (32'h0 | \ - RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_SET(RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_RESET) | \ - RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_SET(RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_RESET) | \ - RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_SET(RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_RESET) | \ - RXTXBB_RXTXBB2_SPARE_SET(RXTXBB_RXTXBB2_SPARE_RESET) | \ - RXTXBB_RXTXBB2_SHORTBUFFER_SET(RXTXBB_RXTXBB2_SHORTBUFFER_RESET) | \ - RXTXBB_RXTXBB2_SELBUFFER_SET(RXTXBB_RXTXBB2_SELBUFFER_RESET) | \ - RXTXBB_RXTXBB2_SEL_DAC_TEST_SET(RXTXBB_RXTXBB2_SEL_DAC_TEST_RESET) | \ - RXTXBB_RXTXBB2_SEL_LOQ_TEST_SET(RXTXBB_RXTXBB2_SEL_LOQ_TEST_RESET) | \ - RXTXBB_RXTXBB2_SEL_HIQ_TEST_SET(RXTXBB_RXTXBB2_SEL_HIQ_TEST_RESET) | \ - RXTXBB_RXTXBB2_SEL_I2V_TEST_SET(RXTXBB_RXTXBB2_SEL_I2V_TEST_RESET) | \ - RXTXBB_RXTXBB2_CMSEL_SET(RXTXBB_RXTXBB2_CMSEL_RESET) | \ - RXTXBB_RXTXBB2_FILTERFC_SET(RXTXBB_RXTXBB2_FILTERFC_RESET) | \ - RXTXBB_RXTXBB2_LOCALFILTERTUNING_SET(RXTXBB_RXTXBB2_LOCALFILTERTUNING_RESET) | \ - RXTXBB_RXTXBB2_FILTERDOUBLEBW_SET(RXTXBB_RXTXBB2_FILTERDOUBLEBW_RESET) | \ - RXTXBB_RXTXBB2_PATH2HIQ_EN_SET(RXTXBB_RXTXBB2_PATH2HIQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH1HIQ_EN_SET(RXTXBB_RXTXBB2_PATH1HIQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH3LOQ_EN_SET(RXTXBB_RXTXBB2_PATH3LOQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH2LOQ_EN_SET(RXTXBB_RXTXBB2_PATH2LOQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH1LOQ_EN_SET(RXTXBB_RXTXBB2_PATH1LOQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH_OVERRIDE_SET(RXTXBB_RXTXBB2_PATH_OVERRIDE_RESET)) -#define RXTXBB_RXTXBB2_HW_MASK (32'h0 | \ - RXTXBB_RXTXBB2_FILTERFC_MASK) -#define RXTXBB_RXTXBB2_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK | \ - RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK | \ - RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK | \ - RXTXBB_RXTXBB2_SPARE_MASK | \ - RXTXBB_RXTXBB2_SHORTBUFFER_MASK | \ - RXTXBB_RXTXBB2_SELBUFFER_MASK | \ - RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK | \ - RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK | \ - RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK | \ - RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK | \ - RXTXBB_RXTXBB2_CMSEL_MASK | \ - RXTXBB_RXTXBB2_FILTERFC_MASK | \ - RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK | \ - RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK | \ - RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) - -#define RXTXBB_RXTXBB3_ADDRESS 'h00000058 -#define RXTXBB_RXTXBB3_SPARE_MSB 31 -#define RXTXBB_RXTXBB3_SPARE_LSB 27 -#define RXTXBB_RXTXBB3_SPARE_MASK 'hf8000000 -#define RXTXBB_RXTXBB3_SPARE_GET(x) (((x) & RXTXBB_RXTXBB3_SPARE_MASK) >> RXTXBB_RXTXBB3_SPARE_LSB) -#define RXTXBB_RXTXBB3_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_SPARE_LSB) & RXTXBB_RXTXBB3_SPARE_MASK) -#define RXTXBB_RXTXBB3_SPARE_RESET 5'h0 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MSB 26 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB 24 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK 'h07000000 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MSB 23 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB 21 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK 'h00e00000 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MSB 20 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB 18 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK 'h001c0000 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MSB 17 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB 15 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK 'h00038000 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MSB 14 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB 12 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK 'h00007000 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MSB 11 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB 9 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK 'h00000e00 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MSB 8 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB 6 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK 'h000001c0 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MSB 5 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB 3 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK 'h00000038 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) >> RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_RESET 3'h2 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MSB 2 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB 0 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK 'h00000007 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_RESET (32'h0 | \ - RXTXBB_RXTXBB3_SPARE_SET(RXTXBB_RXTXBB3_SPARE_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_SET(RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_SET(RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_RESET)) -#define RXTXBB_RXTXBB3_HW_MASK (32'h0) -#define RXTXBB_RXTXBB3_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB3_SPARE_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) - -#define RXTXBB_RXTXBB4_ADDRESS 'h0000005c -#define RXTXBB_RXTXBB4_SPARE_MSB 31 -#define RXTXBB_RXTXBB4_SPARE_LSB 31 -#define RXTXBB_RXTXBB4_SPARE_MASK 'h80000000 -#define RXTXBB_RXTXBB4_SPARE_GET(x) (((x) & RXTXBB_RXTXBB4_SPARE_MASK) >> RXTXBB_RXTXBB4_SPARE_LSB) -#define RXTXBB_RXTXBB4_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_SPARE_LSB) & RXTXBB_RXTXBB4_SPARE_MASK) -#define RXTXBB_RXTXBB4_SPARE_RESET 1'h0 -#define RXTXBB_RXTXBB4_LOCALOFFSET_MSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_LSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_MASK 'h40000000 -#define RXTXBB_RXTXBB4_LOCALOFFSET_GET(x) (((x) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) >> RXTXBB_RXTXBB4_LOCALOFFSET_LSB) -#define RXTXBB_RXTXBB4_LOCALOFFSET_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_LOCALOFFSET_LSB) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) -#define RXTXBB_RXTXBB4_LOCALOFFSET_RESET 1'h0 -#define RXTXBB_RXTXBB4_OFSTCORRHII_MSB 29 -#define RXTXBB_RXTXBB4_OFSTCORRHII_LSB 25 -#define RXTXBB_RXTXBB4_OFSTCORRHII_MASK 'h3e000000 -#define RXTXBB_RXTXBB4_OFSTCORRHII_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHII_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHII_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRHII_LSB) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHII_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MSB 24 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB 20 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK 'h01f00000 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MSB 19 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_LSB 15 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MASK 'h000f8000 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MSB 14 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB 10 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK 'h00007c00 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MSB 9 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB 5 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK 'h000003e0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MSB 4 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB 0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK 'h0000001f -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_RESET 5'h10 -#define RXTXBB_RXTXBB4_RESET (32'h0 | \ - RXTXBB_RXTXBB4_SPARE_SET(RXTXBB_RXTXBB4_SPARE_RESET) | \ - RXTXBB_RXTXBB4_LOCALOFFSET_SET(RXTXBB_RXTXBB4_LOCALOFFSET_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRHII_SET(RXTXBB_RXTXBB4_OFSTCORRHII_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRHIQ_SET(RXTXBB_RXTXBB4_OFSTCORRHIQ_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRLOI_SET(RXTXBB_RXTXBB4_OFSTCORRLOI_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRLOQ_SET(RXTXBB_RXTXBB4_OFSTCORRLOQ_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRI2VI_SET(RXTXBB_RXTXBB4_OFSTCORRI2VI_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRI2VQ_SET(RXTXBB_RXTXBB4_OFSTCORRI2VQ_RESET)) -#define RXTXBB_RXTXBB4_HW_MASK (32'h0 | \ - RXTXBB_RXTXBB4_OFSTCORRHII_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) -#define RXTXBB_RXTXBB4_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB4_SPARE_MASK | \ - RXTXBB_RXTXBB4_LOCALOFFSET_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRHII_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) - -#define ADDAC_ADDAC1_ADDRESS 'h00000060 -#define ADDAC_ADDAC1_PLL_SVREG_MSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_LSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_MASK 'h80000000 -#define ADDAC_ADDAC1_PLL_SVREG_GET(x) (((x) & ADDAC_ADDAC1_PLL_SVREG_MASK) >> ADDAC_ADDAC1_PLL_SVREG_LSB) -#define ADDAC_ADDAC1_PLL_SVREG_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_SVREG_LSB) & ADDAC_ADDAC1_PLL_SVREG_MASK) -#define ADDAC_ADDAC1_PLL_SVREG_RESET 1'h1 -#define ADDAC_ADDAC1_PLL_SCLAMP_MSB 30 -#define ADDAC_ADDAC1_PLL_SCLAMP_LSB 28 -#define ADDAC_ADDAC1_PLL_SCLAMP_MASK 'h70000000 -#define ADDAC_ADDAC1_PLL_SCLAMP_GET(x) (((x) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) >> ADDAC_ADDAC1_PLL_SCLAMP_LSB) -#define ADDAC_ADDAC1_PLL_SCLAMP_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_SCLAMP_LSB) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) -#define ADDAC_ADDAC1_PLL_SCLAMP_RESET 3'h5 -#define ADDAC_ADDAC1_PLL_ATB_MSB 27 -#define ADDAC_ADDAC1_PLL_ATB_LSB 26 -#define ADDAC_ADDAC1_PLL_ATB_MASK 'h0c000000 -#define ADDAC_ADDAC1_PLL_ATB_GET(x) (((x) & ADDAC_ADDAC1_PLL_ATB_MASK) >> ADDAC_ADDAC1_PLL_ATB_LSB) -#define ADDAC_ADDAC1_PLL_ATB_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_ATB_LSB) & ADDAC_ADDAC1_PLL_ATB_MASK) -#define ADDAC_ADDAC1_PLL_ATB_RESET 2'h0 -#define ADDAC_ADDAC1_PLL_ICP_MSB 25 -#define ADDAC_ADDAC1_PLL_ICP_LSB 23 -#define ADDAC_ADDAC1_PLL_ICP_MASK 'h03800000 -#define ADDAC_ADDAC1_PLL_ICP_GET(x) (((x) & ADDAC_ADDAC1_PLL_ICP_MASK) >> ADDAC_ADDAC1_PLL_ICP_LSB) -#define ADDAC_ADDAC1_PLL_ICP_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_ICP_LSB) & ADDAC_ADDAC1_PLL_ICP_MASK) -#define ADDAC_ADDAC1_PLL_ICP_RESET 3'h0 -#define ADDAC_ADDAC1_PLL_FILTER_MSB 22 -#define ADDAC_ADDAC1_PLL_FILTER_LSB 15 -#define ADDAC_ADDAC1_PLL_FILTER_MASK 'h007f8000 -#define ADDAC_ADDAC1_PLL_FILTER_GET(x) (((x) & ADDAC_ADDAC1_PLL_FILTER_MASK) >> ADDAC_ADDAC1_PLL_FILTER_LSB) -#define ADDAC_ADDAC1_PLL_FILTER_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_FILTER_LSB) & ADDAC_ADDAC1_PLL_FILTER_MASK) -#define ADDAC_ADDAC1_PLL_FILTER_RESET 8'h35 -#define ADDAC_ADDAC1_PWDPLL_MSB 14 -#define ADDAC_ADDAC1_PWDPLL_LSB 14 -#define ADDAC_ADDAC1_PWDPLL_MASK 'h00004000 -#define ADDAC_ADDAC1_PWDPLL_GET(x) (((x) & ADDAC_ADDAC1_PWDPLL_MASK) >> ADDAC_ADDAC1_PWDPLL_LSB) -#define ADDAC_ADDAC1_PWDPLL_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PWDPLL_LSB) & ADDAC_ADDAC1_PWDPLL_MASK) -#define ADDAC_ADDAC1_PWDPLL_RESET 1'h0 -#define ADDAC_ADDAC1_PWDADC_MSB 13 -#define ADDAC_ADDAC1_PWDADC_LSB 13 -#define ADDAC_ADDAC1_PWDADC_MASK 'h00002000 -#define ADDAC_ADDAC1_PWDADC_GET(x) (((x) & ADDAC_ADDAC1_PWDADC_MASK) >> ADDAC_ADDAC1_PWDADC_LSB) -#define ADDAC_ADDAC1_PWDADC_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PWDADC_LSB) & ADDAC_ADDAC1_PWDADC_MASK) -#define ADDAC_ADDAC1_PWDADC_RESET 1'h0 -#define ADDAC_ADDAC1_PWDDAC_MSB 12 -#define ADDAC_ADDAC1_PWDDAC_LSB 12 -#define ADDAC_ADDAC1_PWDDAC_MASK 'h00001000 -#define ADDAC_ADDAC1_PWDDAC_GET(x) (((x) & ADDAC_ADDAC1_PWDDAC_MASK) >> ADDAC_ADDAC1_PWDDAC_LSB) -#define ADDAC_ADDAC1_PWDDAC_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PWDDAC_LSB) & ADDAC_ADDAC1_PWDDAC_MASK) -#define ADDAC_ADDAC1_PWDDAC_RESET 1'h0 -#define ADDAC_ADDAC1_FORCEMSBLOW_MSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_LSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_MASK 'h00000800 -#define ADDAC_ADDAC1_FORCEMSBLOW_GET(x) (((x) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) >> ADDAC_ADDAC1_FORCEMSBLOW_LSB) -#define ADDAC_ADDAC1_FORCEMSBLOW_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_FORCEMSBLOW_LSB) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) -#define ADDAC_ADDAC1_FORCEMSBLOW_RESET 1'h0 -#define ADDAC_ADDAC1_SELMANPWDS_MSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_LSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_MASK 'h00000400 -#define ADDAC_ADDAC1_SELMANPWDS_GET(x) (((x) & ADDAC_ADDAC1_SELMANPWDS_MASK) >> ADDAC_ADDAC1_SELMANPWDS_LSB) -#define ADDAC_ADDAC1_SELMANPWDS_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_SELMANPWDS_LSB) & ADDAC_ADDAC1_SELMANPWDS_MASK) -#define ADDAC_ADDAC1_SELMANPWDS_RESET 1'h0 -#define ADDAC_ADDAC1_INV_CLK160_ADC_MSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_LSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_MASK 'h00000200 -#define ADDAC_ADDAC1_INV_CLK160_ADC_GET(x) (((x) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) >> ADDAC_ADDAC1_INV_CLK160_ADC_LSB) -#define ADDAC_ADDAC1_INV_CLK160_ADC_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_INV_CLK160_ADC_LSB) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) -#define ADDAC_ADDAC1_INV_CLK160_ADC_RESET 1'h0 -#define ADDAC_ADDAC1_CM_SEL_MSB 8 -#define ADDAC_ADDAC1_CM_SEL_LSB 7 -#define ADDAC_ADDAC1_CM_SEL_MASK 'h00000180 -#define ADDAC_ADDAC1_CM_SEL_GET(x) (((x) & ADDAC_ADDAC1_CM_SEL_MASK) >> ADDAC_ADDAC1_CM_SEL_LSB) -#define ADDAC_ADDAC1_CM_SEL_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_CM_SEL_LSB) & ADDAC_ADDAC1_CM_SEL_MASK) -#define ADDAC_ADDAC1_CM_SEL_RESET 2'h1 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_LSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MASK 'h00000040 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_GET(x) (((x) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) >> ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_RESET 1'h0 -#define ADDAC_ADDAC1_SPARE_MSB 5 -#define ADDAC_ADDAC1_SPARE_LSB 0 -#define ADDAC_ADDAC1_SPARE_MASK 'h0000003f -#define ADDAC_ADDAC1_SPARE_GET(x) (((x) & ADDAC_ADDAC1_SPARE_MASK) >> ADDAC_ADDAC1_SPARE_LSB) -#define ADDAC_ADDAC1_SPARE_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_SPARE_LSB) & ADDAC_ADDAC1_SPARE_MASK) -#define ADDAC_ADDAC1_SPARE_RESET 6'h0 -#define ADDAC_ADDAC1_RESET (32'h0 | \ - ADDAC_ADDAC1_PLL_SVREG_SET(ADDAC_ADDAC1_PLL_SVREG_RESET) | \ - ADDAC_ADDAC1_PLL_SCLAMP_SET(ADDAC_ADDAC1_PLL_SCLAMP_RESET) | \ - ADDAC_ADDAC1_PLL_ATB_SET(ADDAC_ADDAC1_PLL_ATB_RESET) | \ - ADDAC_ADDAC1_PLL_ICP_SET(ADDAC_ADDAC1_PLL_ICP_RESET) | \ - ADDAC_ADDAC1_PLL_FILTER_SET(ADDAC_ADDAC1_PLL_FILTER_RESET) | \ - ADDAC_ADDAC1_PWDPLL_SET(ADDAC_ADDAC1_PWDPLL_RESET) | \ - ADDAC_ADDAC1_PWDADC_SET(ADDAC_ADDAC1_PWDADC_RESET) | \ - ADDAC_ADDAC1_PWDDAC_SET(ADDAC_ADDAC1_PWDDAC_RESET) | \ - ADDAC_ADDAC1_FORCEMSBLOW_SET(ADDAC_ADDAC1_FORCEMSBLOW_RESET) | \ - ADDAC_ADDAC1_SELMANPWDS_SET(ADDAC_ADDAC1_SELMANPWDS_RESET) | \ - ADDAC_ADDAC1_INV_CLK160_ADC_SET(ADDAC_ADDAC1_INV_CLK160_ADC_RESET) | \ - ADDAC_ADDAC1_CM_SEL_SET(ADDAC_ADDAC1_CM_SEL_RESET) | \ - ADDAC_ADDAC1_DISABLE_DAC_REG_SET(ADDAC_ADDAC1_DISABLE_DAC_REG_RESET) | \ - ADDAC_ADDAC1_SPARE_SET(ADDAC_ADDAC1_SPARE_RESET)) -#define ADDAC_ADDAC1_HW_MASK (32'h0) -#define ADDAC_ADDAC1_SW_MASK (32'h0 | \ - ADDAC_ADDAC1_PLL_SVREG_MASK | \ - ADDAC_ADDAC1_PLL_SCLAMP_MASK | \ - ADDAC_ADDAC1_PLL_ATB_MASK | \ - ADDAC_ADDAC1_PLL_ICP_MASK | \ - ADDAC_ADDAC1_PLL_FILTER_MASK | \ - ADDAC_ADDAC1_PWDPLL_MASK | \ - ADDAC_ADDAC1_PWDADC_MASK | \ - ADDAC_ADDAC1_PWDDAC_MASK | \ - ADDAC_ADDAC1_FORCEMSBLOW_MASK | \ - ADDAC_ADDAC1_SELMANPWDS_MASK | \ - ADDAC_ADDAC1_INV_CLK160_ADC_MASK | \ - ADDAC_ADDAC1_CM_SEL_MASK | \ - ADDAC_ADDAC1_DISABLE_DAC_REG_MASK | \ - ADDAC_ADDAC1_SPARE_MASK) - -#define ANALOG_REG_ADDRESS_MSB 6 - -#endif /* _ANALOG_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/apb_map.h b/drivers/net/wireless/ar6003/include/AR6002/hw/apb_map.h deleted file mode 100644 index f3bf6d6cc82b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/apb_map.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _APB_MAP_H_ -#define _APB_MAP_H_ - -#define RTC_BASE_ADDRESS 0x00004000 -#define VMC_BASE_ADDRESS 0x00008000 -#define UART_BASE_ADDRESS 0x0000c000 -#define SI_BASE_ADDRESS 0x00010000 -#define GPIO_BASE_ADDRESS 0x00014000 -#define MBOX_BASE_ADDRESS 0x00018000 -#define ANALOG_INTF_BASE_ADDRESS 0x0001c000 -#define MAC_BASE_ADDRESS 0x00020000 - -#endif /* _APB_MAP_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/apb_map.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/apb_map.vrh deleted file mode 100644 index 078e022f9d74..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/apb_map.vrh +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _APB_MAP_VRH_ -#define _APB_MAP_VRH_ - -#define RTC_BASE_ADDRESS 'h00004000 -#define RTC_END_ADDRESS 'h000041ff -#define VMC_BASE_ADDRESS 'h00008000 -#define VMC_END_ADDRESS 'h000083ff -#define UART_BASE_ADDRESS 'h0000c000 -#define UART_END_ADDRESS 'h0000c03f -#define SI_BASE_ADDRESS 'h00010000 -#define SI_END_ADDRESS 'h0001001f -#define GPIO_BASE_ADDRESS 'h00014000 -#define GPIO_END_ADDRESS 'h000140ff -#define MBOX_BASE_ADDRESS 'h00018000 -#define MBOX_END_ADDRESS 'h0001bfff -#define ANALOG_INTF_BASE_ADDRESS 'h0001c000 -#define ANALOG_INTF_END_ADDRESS 'h0001c0ff -#define MAC_BASE_ADDRESS 'h00020000 -#define MAC_END_ADDRESS 'h0002ffff - -#endif /* _APB_MAP_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/bias_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/bias_reg.h deleted file mode 100644 index f8ca13152959..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/bias_reg.h +++ /dev/null @@ -1,293 +0,0 @@ -#ifndef _BIAS_REG_REG_H_ -#define _BIAS_REG_REG_H_ - -#define BIAS_BIAS_SEL_ADDRESS 0x00000000 -#define BIAS_BIAS_SEL_OFFSET 0x00000000 -#define BIAS_BIAS_SEL_PADON_MSB 31 -#define BIAS_BIAS_SEL_PADON_LSB 31 -#define BIAS_BIAS_SEL_PADON_MASK 0x80000000 -#define BIAS_BIAS_SEL_PADON_GET(x) (((x) & BIAS_BIAS_SEL_PADON_MASK) >> BIAS_BIAS_SEL_PADON_LSB) -#define BIAS_BIAS_SEL_PADON_SET(x) (((x) << BIAS_BIAS_SEL_PADON_LSB) & BIAS_BIAS_SEL_PADON_MASK) -#define BIAS_BIAS_SEL_SEL_BIAS_MSB 30 -#define BIAS_BIAS_SEL_SEL_BIAS_LSB 25 -#define BIAS_BIAS_SEL_SEL_BIAS_MASK 0x7e000000 -#define BIAS_BIAS_SEL_SEL_BIAS_GET(x) (((x) & BIAS_BIAS_SEL_SEL_BIAS_MASK) >> BIAS_BIAS_SEL_SEL_BIAS_LSB) -#define BIAS_BIAS_SEL_SEL_BIAS_SET(x) (((x) << BIAS_BIAS_SEL_SEL_BIAS_LSB) & BIAS_BIAS_SEL_SEL_BIAS_MASK) -#define BIAS_BIAS_SEL_SEL_SPARE_MSB 24 -#define BIAS_BIAS_SEL_SEL_SPARE_LSB 21 -#define BIAS_BIAS_SEL_SEL_SPARE_MASK 0x01e00000 -#define BIAS_BIAS_SEL_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SEL_SPARE_SET(x) (((x) << BIAS_BIAS_SEL_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_SPARE_MSB 20 -#define BIAS_BIAS_SEL_SPARE_LSB 20 -#define BIAS_BIAS_SEL_SPARE_MASK 0x00100000 -#define BIAS_BIAS_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SPARE_SET(x) (((x) << BIAS_BIAS_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MSB 19 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB 17 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK 0x000e0000 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK 0x00010000 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_SET(x) (((x) << BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK 0x00008000 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_SET(x) (((x) << BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK 0x00004000 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_LSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MASK 0x00002000 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) >> BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MSB 12 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB 10 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK 0x00001c00 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MSB 9 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_LSB 7 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MASK 0x00000380 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) >> BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MSB 6 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_LSB 4 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MASK 0x00000070 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) >> BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MSB 3 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_LSB 1 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MASK 0x0000000e -#define BIAS_BIAS_SEL_PWD_ICTXPC25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) >> BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) -#define BIAS_BIAS_SEL_PWD_ICLDO25_MSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_LSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_MASK 0x00000001 -#define BIAS_BIAS_SEL_PWD_ICLDO25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) >> BIAS_BIAS_SEL_PWD_ICLDO25_LSB) -#define BIAS_BIAS_SEL_PWD_ICLDO25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICLDO25_LSB) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) - -#define BIAS_BIAS1_ADDRESS 0x00000004 -#define BIAS_BIAS1_OFFSET 0x00000004 -#define BIAS_BIAS1_PWD_ICDAC2BB25_MSB 31 -#define BIAS_BIAS1_PWD_ICDAC2BB25_LSB 29 -#define BIAS_BIAS1_PWD_ICDAC2BB25_MASK 0xe0000000 -#define BIAS_BIAS1_PWD_ICDAC2BB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) >> BIAS_BIAS1_PWD_ICDAC2BB25_LSB) -#define BIAS_BIAS1_PWD_ICDAC2BB25_SET(x) (((x) << BIAS_BIAS1_PWD_ICDAC2BB25_LSB) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) -#define BIAS_BIAS1_PWD_IC2GVGM25_MSB 28 -#define BIAS_BIAS1_PWD_IC2GVGM25_LSB 26 -#define BIAS_BIAS1_PWD_IC2GVGM25_MASK 0x1c000000 -#define BIAS_BIAS1_PWD_IC2GVGM25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) >> BIAS_BIAS1_PWD_IC2GVGM25_LSB) -#define BIAS_BIAS1_PWD_IC2GVGM25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GVGM25_LSB) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) -#define BIAS_BIAS1_PWD_IC2GRFFE25_MSB 25 -#define BIAS_BIAS1_PWD_IC2GRFFE25_LSB 23 -#define BIAS_BIAS1_PWD_IC2GRFFE25_MASK 0x03800000 -#define BIAS_BIAS1_PWD_IC2GRFFE25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) >> BIAS_BIAS1_PWD_IC2GRFFE25_LSB) -#define BIAS_BIAS1_PWD_IC2GRFFE25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GRFFE25_LSB) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) -#define BIAS_BIAS1_PWD_IC2GLOREG25_MSB 22 -#define BIAS_BIAS1_PWD_IC2GLOREG25_LSB 20 -#define BIAS_BIAS1_PWD_IC2GLOREG25_MASK 0x00700000 -#define BIAS_BIAS1_PWD_IC2GLOREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLOREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLOREG25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GLOREG25_LSB) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MSB 19 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_LSB 17 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MASK 0x000e0000 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORB25_MSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_LSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_MASK 0x00010000 -#define BIAS_BIAS1_PWD_ICDETECTORB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORB25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORB25_SET(x) (((x) << BIAS_BIAS1_PWD_ICDETECTORB25_LSB) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORA25_MSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_LSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_MASK 0x00008000 -#define BIAS_BIAS1_PWD_ICDETECTORA25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORA25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORA25_SET(x) (((x) << BIAS_BIAS1_PWD_ICDETECTORA25_LSB) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) -#define BIAS_BIAS1_PWD_IC5GRXRF25_MSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_LSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_MASK 0x00004000 -#define BIAS_BIAS1_PWD_IC5GRXRF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) >> BIAS_BIAS1_PWD_IC5GRXRF25_LSB) -#define BIAS_BIAS1_PWD_IC5GRXRF25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GRXRF25_LSB) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXPA25_MSB 13 -#define BIAS_BIAS1_PWD_IC5GTXPA25_LSB 11 -#define BIAS_BIAS1_PWD_IC5GTXPA25_MASK 0x00003800 -#define BIAS_BIAS1_PWD_IC5GTXPA25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) >> BIAS_BIAS1_PWD_IC5GTXPA25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXPA25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GTXPA25_LSB) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MSB 10 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_LSB 8 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MASK 0x00000700 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) >> BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) -#define BIAS_BIAS1_PWD_IC5GQB25_MSB 7 -#define BIAS_BIAS1_PWD_IC5GQB25_LSB 5 -#define BIAS_BIAS1_PWD_IC5GQB25_MASK 0x000000e0 -#define BIAS_BIAS1_PWD_IC5GQB25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GQB25_MASK) >> BIAS_BIAS1_PWD_IC5GQB25_LSB) -#define BIAS_BIAS1_PWD_IC5GQB25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GQB25_LSB) & BIAS_BIAS1_PWD_IC5GQB25_MASK) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MSB 4 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_LSB 2 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MASK 0x0000001c -#define BIAS_BIAS1_PWD_IC5GMIXQ25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) >> BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) -#define BIAS_BIAS1_SPARE_MSB 1 -#define BIAS_BIAS1_SPARE_LSB 0 -#define BIAS_BIAS1_SPARE_MASK 0x00000003 -#define BIAS_BIAS1_SPARE_GET(x) (((x) & BIAS_BIAS1_SPARE_MASK) >> BIAS_BIAS1_SPARE_LSB) -#define BIAS_BIAS1_SPARE_SET(x) (((x) << BIAS_BIAS1_SPARE_LSB) & BIAS_BIAS1_SPARE_MASK) - -#define BIAS_BIAS2_ADDRESS 0x00000008 -#define BIAS_BIAS2_OFFSET 0x00000008 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MSB 31 -#define BIAS_BIAS2_PWD_IC5GMIXI25_LSB 29 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MASK 0xe0000000 -#define BIAS_BIAS2_PWD_IC5GMIXI25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) >> BIAS_BIAS2_PWD_IC5GMIXI25_LSB) -#define BIAS_BIAS2_PWD_IC5GMIXI25_SET(x) (((x) << BIAS_BIAS2_PWD_IC5GMIXI25_LSB) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) -#define BIAS_BIAS2_PWD_IC5GDIV25_MSB 28 -#define BIAS_BIAS2_PWD_IC5GDIV25_LSB 26 -#define BIAS_BIAS2_PWD_IC5GDIV25_MASK 0x1c000000 -#define BIAS_BIAS2_PWD_IC5GDIV25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) >> BIAS_BIAS2_PWD_IC5GDIV25_LSB) -#define BIAS_BIAS2_PWD_IC5GDIV25_SET(x) (((x) << BIAS_BIAS2_PWD_IC5GDIV25_LSB) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) -#define BIAS_BIAS2_PWD_IC5GLOREG25_MSB 25 -#define BIAS_BIAS2_PWD_IC5GLOREG25_LSB 23 -#define BIAS_BIAS2_PWD_IC5GLOREG25_MASK 0x03800000 -#define BIAS_BIAS2_PWD_IC5GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) >> BIAS_BIAS2_PWD_IC5GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IC5GLOREG25_SET(x) (((x) << BIAS_BIAS2_PWD_IC5GLOREG25_LSB) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IRPLL25_MSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_LSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_MASK 0x00400000 -#define BIAS_BIAS2_PWD_IRPLL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRPLL25_MASK) >> BIAS_BIAS2_PWD_IRPLL25_LSB) -#define BIAS_BIAS2_PWD_IRPLL25_SET(x) (((x) << BIAS_BIAS2_PWD_IRPLL25_LSB) & BIAS_BIAS2_PWD_IRPLL25_MASK) -#define BIAS_BIAS2_PWD_IRXTAL25_MSB 21 -#define BIAS_BIAS2_PWD_IRXTAL25_LSB 19 -#define BIAS_BIAS2_PWD_IRXTAL25_MASK 0x00380000 -#define BIAS_BIAS2_PWD_IRXTAL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRXTAL25_MASK) >> BIAS_BIAS2_PWD_IRXTAL25_LSB) -#define BIAS_BIAS2_PWD_IRXTAL25_SET(x) (((x) << BIAS_BIAS2_PWD_IRXTAL25_LSB) & BIAS_BIAS2_PWD_IRXTAL25_MASK) -#define BIAS_BIAS2_PWD_IRTSENS25_MSB 18 -#define BIAS_BIAS2_PWD_IRTSENS25_LSB 16 -#define BIAS_BIAS2_PWD_IRTSENS25_MASK 0x00070000 -#define BIAS_BIAS2_PWD_IRTSENS25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTSENS25_MASK) >> BIAS_BIAS2_PWD_IRTSENS25_LSB) -#define BIAS_BIAS2_PWD_IRTSENS25_SET(x) (((x) << BIAS_BIAS2_PWD_IRTSENS25_LSB) & BIAS_BIAS2_PWD_IRTSENS25_MASK) -#define BIAS_BIAS2_PWD_IRTXPC25_MSB 15 -#define BIAS_BIAS2_PWD_IRTXPC25_LSB 13 -#define BIAS_BIAS2_PWD_IRTXPC25_MASK 0x0000e000 -#define BIAS_BIAS2_PWD_IRTXPC25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTXPC25_MASK) >> BIAS_BIAS2_PWD_IRTXPC25_LSB) -#define BIAS_BIAS2_PWD_IRTXPC25_SET(x) (((x) << BIAS_BIAS2_PWD_IRTXPC25_LSB) & BIAS_BIAS2_PWD_IRTXPC25_MASK) -#define BIAS_BIAS2_PWD_IRLDO25_MSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_LSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_MASK 0x00001000 -#define BIAS_BIAS2_PWD_IRLDO25_GET(x) (((x) & BIAS_BIAS2_PWD_IRLDO25_MASK) >> BIAS_BIAS2_PWD_IRLDO25_LSB) -#define BIAS_BIAS2_PWD_IRLDO25_SET(x) (((x) << BIAS_BIAS2_PWD_IRLDO25_LSB) & BIAS_BIAS2_PWD_IRLDO25_MASK) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MSB 11 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_LSB 9 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MASK 0x00000e00 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) >> BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_SET(x) (((x) << BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) -#define BIAS_BIAS2_PWD_IR2GLOREG25_MSB 8 -#define BIAS_BIAS2_PWD_IR2GLOREG25_LSB 6 -#define BIAS_BIAS2_PWD_IR2GLOREG25_MASK 0x000001c0 -#define BIAS_BIAS2_PWD_IR2GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLOREG25_SET(x) (((x) << BIAS_BIAS2_PWD_IR2GLOREG25_LSB) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MSB 5 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_LSB 3 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MASK 0x00000038 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_SET(x) (((x) << BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MSB 2 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB 0 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK 0x00000007 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_GET(x) (((x) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) >> BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_SET(x) (((x) << BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) - -#define BIAS_BIAS3_ADDRESS 0x0000000c -#define BIAS_BIAS3_OFFSET 0x0000000c -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MSB 31 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_LSB 29 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MASK 0xe0000000 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) >> BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) -#define BIAS_BIAS3_PWD_IR5GTXMIX25_SET(x) (((x) << BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) -#define BIAS_BIAS3_PWD_IR5GAGC25_MSB 28 -#define BIAS_BIAS3_PWD_IR5GAGC25_LSB 26 -#define BIAS_BIAS3_PWD_IR5GAGC25_MASK 0x1c000000 -#define BIAS_BIAS3_PWD_IR5GAGC25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) >> BIAS_BIAS3_PWD_IR5GAGC25_LSB) -#define BIAS_BIAS3_PWD_IR5GAGC25_SET(x) (((x) << BIAS_BIAS3_PWD_IR5GAGC25_LSB) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) -#define BIAS_BIAS3_PWD_ICDAC50_MSB 25 -#define BIAS_BIAS3_PWD_ICDAC50_LSB 23 -#define BIAS_BIAS3_PWD_ICDAC50_MASK 0x03800000 -#define BIAS_BIAS3_PWD_ICDAC50_GET(x) (((x) & BIAS_BIAS3_PWD_ICDAC50_MASK) >> BIAS_BIAS3_PWD_ICDAC50_LSB) -#define BIAS_BIAS3_PWD_ICDAC50_SET(x) (((x) << BIAS_BIAS3_PWD_ICDAC50_LSB) & BIAS_BIAS3_PWD_ICDAC50_MASK) -#define BIAS_BIAS3_PWD_ICSYNTH50_MSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_LSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_MASK 0x00400000 -#define BIAS_BIAS3_PWD_ICSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) >> BIAS_BIAS3_PWD_ICSYNTH50_LSB) -#define BIAS_BIAS3_PWD_ICSYNTH50_SET(x) (((x) << BIAS_BIAS3_PWD_ICSYNTH50_LSB) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) -#define BIAS_BIAS3_PWD_ICBB50_MSB 21 -#define BIAS_BIAS3_PWD_ICBB50_LSB 21 -#define BIAS_BIAS3_PWD_ICBB50_MASK 0x00200000 -#define BIAS_BIAS3_PWD_ICBB50_GET(x) (((x) & BIAS_BIAS3_PWD_ICBB50_MASK) >> BIAS_BIAS3_PWD_ICBB50_LSB) -#define BIAS_BIAS3_PWD_ICBB50_SET(x) (((x) << BIAS_BIAS3_PWD_ICBB50_LSB) & BIAS_BIAS3_PWD_ICBB50_MASK) -#define BIAS_BIAS3_PWD_IC2GDIV50_MSB 20 -#define BIAS_BIAS3_PWD_IC2GDIV50_LSB 18 -#define BIAS_BIAS3_PWD_IC2GDIV50_MASK 0x001c0000 -#define BIAS_BIAS3_PWD_IC2GDIV50_GET(x) (((x) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) >> BIAS_BIAS3_PWD_IC2GDIV50_LSB) -#define BIAS_BIAS3_PWD_IC2GDIV50_SET(x) (((x) << BIAS_BIAS3_PWD_IC2GDIV50_LSB) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) -#define BIAS_BIAS3_PWD_IRSYNTH50_MSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_LSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_MASK 0x00020000 -#define BIAS_BIAS3_PWD_IRSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) >> BIAS_BIAS3_PWD_IRSYNTH50_LSB) -#define BIAS_BIAS3_PWD_IRSYNTH50_SET(x) (((x) << BIAS_BIAS3_PWD_IRSYNTH50_LSB) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) -#define BIAS_BIAS3_PWD_IRBB50_MSB 16 -#define BIAS_BIAS3_PWD_IRBB50_LSB 16 -#define BIAS_BIAS3_PWD_IRBB50_MASK 0x00010000 -#define BIAS_BIAS3_PWD_IRBB50_GET(x) (((x) & BIAS_BIAS3_PWD_IRBB50_MASK) >> BIAS_BIAS3_PWD_IRBB50_LSB) -#define BIAS_BIAS3_PWD_IRBB50_SET(x) (((x) << BIAS_BIAS3_PWD_IRBB50_LSB) & BIAS_BIAS3_PWD_IRBB50_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE1_MSB 15 -#define BIAS_BIAS3_PWD_IC25SPARE1_LSB 13 -#define BIAS_BIAS3_PWD_IC25SPARE1_MASK 0x0000e000 -#define BIAS_BIAS3_PWD_IC25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) >> BIAS_BIAS3_PWD_IC25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE1_SET(x) (((x) << BIAS_BIAS3_PWD_IC25SPARE1_LSB) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE2_MSB 12 -#define BIAS_BIAS3_PWD_IC25SPARE2_LSB 10 -#define BIAS_BIAS3_PWD_IC25SPARE2_MASK 0x00001c00 -#define BIAS_BIAS3_PWD_IC25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) >> BIAS_BIAS3_PWD_IC25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE2_SET(x) (((x) << BIAS_BIAS3_PWD_IC25SPARE2_LSB) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE1_MSB 9 -#define BIAS_BIAS3_PWD_IR25SPARE1_LSB 7 -#define BIAS_BIAS3_PWD_IR25SPARE1_MASK 0x00000380 -#define BIAS_BIAS3_PWD_IR25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) >> BIAS_BIAS3_PWD_IR25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE1_SET(x) (((x) << BIAS_BIAS3_PWD_IR25SPARE1_LSB) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE2_MSB 6 -#define BIAS_BIAS3_PWD_IR25SPARE2_LSB 4 -#define BIAS_BIAS3_PWD_IR25SPARE2_MASK 0x00000070 -#define BIAS_BIAS3_PWD_IR25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) >> BIAS_BIAS3_PWD_IR25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE2_SET(x) (((x) << BIAS_BIAS3_PWD_IR25SPARE2_LSB) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) -#define BIAS_BIAS3_PWD_ICDACREG12P5_MSB 3 -#define BIAS_BIAS3_PWD_ICDACREG12P5_LSB 1 -#define BIAS_BIAS3_PWD_ICDACREG12P5_MASK 0x0000000e -#define BIAS_BIAS3_PWD_ICDACREG12P5_GET(x) (((x) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) >> BIAS_BIAS3_PWD_ICDACREG12P5_LSB) -#define BIAS_BIAS3_PWD_ICDACREG12P5_SET(x) (((x) << BIAS_BIAS3_PWD_ICDACREG12P5_LSB) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) -#define BIAS_BIAS3_SPARE_MSB 0 -#define BIAS_BIAS3_SPARE_LSB 0 -#define BIAS_BIAS3_SPARE_MASK 0x00000001 -#define BIAS_BIAS3_SPARE_GET(x) (((x) & BIAS_BIAS3_SPARE_MASK) >> BIAS_BIAS3_SPARE_LSB) -#define BIAS_BIAS3_SPARE_SET(x) (((x) << BIAS_BIAS3_SPARE_LSB) & BIAS_BIAS3_SPARE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct bias_reg_reg_s { - volatile unsigned int bias_bias_sel; - volatile unsigned int bias_bias1; - volatile unsigned int bias_bias2; - volatile unsigned int bias_bias3; -} bias_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _BIAS_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/bias_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/bias_reg.vrh deleted file mode 100644 index c5cc4fe95445..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/bias_reg.vrh +++ /dev/null @@ -1,450 +0,0 @@ -#ifndef _BIAS_REG_VRH_ -#define _BIAS_REG_VRH_ - -#define BIAS_BIAS_SEL_ADDRESS 'h00000000 -#define BIAS_BIAS_SEL_PADON_MSB 31 -#define BIAS_BIAS_SEL_PADON_LSB 31 -#define BIAS_BIAS_SEL_PADON_MASK 'h80000000 -#define BIAS_BIAS_SEL_PADON_GET(x) (((x) & BIAS_BIAS_SEL_PADON_MASK) >> BIAS_BIAS_SEL_PADON_LSB) -#define BIAS_BIAS_SEL_PADON_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PADON_LSB) & BIAS_BIAS_SEL_PADON_MASK) -#define BIAS_BIAS_SEL_PADON_RESET 1'h0 -#define BIAS_BIAS_SEL_SEL_BIAS_MSB 30 -#define BIAS_BIAS_SEL_SEL_BIAS_LSB 25 -#define BIAS_BIAS_SEL_SEL_BIAS_MASK 'h7e000000 -#define BIAS_BIAS_SEL_SEL_BIAS_GET(x) (((x) & BIAS_BIAS_SEL_SEL_BIAS_MASK) >> BIAS_BIAS_SEL_SEL_BIAS_LSB) -#define BIAS_BIAS_SEL_SEL_BIAS_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_SEL_BIAS_LSB) & BIAS_BIAS_SEL_SEL_BIAS_MASK) -#define BIAS_BIAS_SEL_SEL_BIAS_RESET 6'h0 -#define BIAS_BIAS_SEL_SEL_SPARE_MSB 24 -#define BIAS_BIAS_SEL_SEL_SPARE_LSB 21 -#define BIAS_BIAS_SEL_SEL_SPARE_MASK 'h01e00000 -#define BIAS_BIAS_SEL_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SEL_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_SEL_SPARE_RESET 4'h0 -#define BIAS_BIAS_SEL_SPARE_MSB 20 -#define BIAS_BIAS_SEL_SPARE_LSB 20 -#define BIAS_BIAS_SEL_SPARE_MASK 'h00100000 -#define BIAS_BIAS_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_SPARE_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MSB 19 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB 17 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK 'h000e0000 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_RESET 3'h6 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK 'h00010000 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK 'h00008000 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK 'h00004000 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_LSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MASK 'h00002000 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) >> BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MSB 12 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB 10 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK 'h00001c00 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MSB 9 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_LSB 7 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MASK 'h00000380 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) >> BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MSB 6 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_LSB 4 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MASK 'h00000070 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) >> BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MSB 3 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_LSB 1 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MASK 'h0000000e -#define BIAS_BIAS_SEL_PWD_ICTXPC25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) >> BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICLDO25_MSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_LSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_MASK 'h00000001 -#define BIAS_BIAS_SEL_PWD_ICLDO25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) >> BIAS_BIAS_SEL_PWD_ICLDO25_LSB) -#define BIAS_BIAS_SEL_PWD_ICLDO25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICLDO25_LSB) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) -#define BIAS_BIAS_SEL_PWD_ICLDO25_RESET 1'h0 -#define BIAS_BIAS_SEL_RESET (32'h0 | \ - BIAS_BIAS_SEL_PADON_SET(BIAS_BIAS_SEL_PADON_RESET) | \ - BIAS_BIAS_SEL_SEL_BIAS_SET(BIAS_BIAS_SEL_SEL_BIAS_RESET) | \ - BIAS_BIAS_SEL_SEL_SPARE_SET(BIAS_BIAS_SEL_SEL_SPARE_RESET) | \ - BIAS_BIAS_SEL_SPARE_SET(BIAS_BIAS_SEL_SPARE_RESET) | \ - BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_SET(BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_RESET) | \ - BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_SET(BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_RESET) | \ - BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_SET(BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_RESET) | \ - BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_SET(BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICCPLL25_SET(BIAS_BIAS_SEL_PWD_ICCPLL25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_SET(BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICXTAL25_SET(BIAS_BIAS_SEL_PWD_ICXTAL25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICTSENS25_SET(BIAS_BIAS_SEL_PWD_ICTSENS25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICTXPC25_SET(BIAS_BIAS_SEL_PWD_ICTXPC25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICLDO25_SET(BIAS_BIAS_SEL_PWD_ICLDO25_RESET)) -#define BIAS_BIAS_SEL_HW_MASK (32'h0) -#define BIAS_BIAS_SEL_SW_MASK (32'h0 | \ - BIAS_BIAS_SEL_PADON_MASK | \ - BIAS_BIAS_SEL_SEL_BIAS_MASK | \ - BIAS_BIAS_SEL_SEL_SPARE_MASK | \ - BIAS_BIAS_SEL_SPARE_MASK | \ - BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK | \ - BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK | \ - BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK | \ - BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK | \ - BIAS_BIAS_SEL_PWD_ICCPLL25_MASK | \ - BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK | \ - BIAS_BIAS_SEL_PWD_ICXTAL25_MASK | \ - BIAS_BIAS_SEL_PWD_ICTSENS25_MASK | \ - BIAS_BIAS_SEL_PWD_ICTXPC25_MASK | \ - BIAS_BIAS_SEL_PWD_ICLDO25_MASK) - -#define BIAS_BIAS1_ADDRESS 'h00000004 -#define BIAS_BIAS1_PWD_ICDAC2BB25_MSB 31 -#define BIAS_BIAS1_PWD_ICDAC2BB25_LSB 29 -#define BIAS_BIAS1_PWD_ICDAC2BB25_MASK 'he0000000 -#define BIAS_BIAS1_PWD_ICDAC2BB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) >> BIAS_BIAS1_PWD_ICDAC2BB25_LSB) -#define BIAS_BIAS1_PWD_ICDAC2BB25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_ICDAC2BB25_LSB) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) -#define BIAS_BIAS1_PWD_ICDAC2BB25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GVGM25_MSB 28 -#define BIAS_BIAS1_PWD_IC2GVGM25_LSB 26 -#define BIAS_BIAS1_PWD_IC2GVGM25_MASK 'h1c000000 -#define BIAS_BIAS1_PWD_IC2GVGM25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) >> BIAS_BIAS1_PWD_IC2GVGM25_LSB) -#define BIAS_BIAS1_PWD_IC2GVGM25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GVGM25_LSB) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) -#define BIAS_BIAS1_PWD_IC2GVGM25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GRFFE25_MSB 25 -#define BIAS_BIAS1_PWD_IC2GRFFE25_LSB 23 -#define BIAS_BIAS1_PWD_IC2GRFFE25_MASK 'h03800000 -#define BIAS_BIAS1_PWD_IC2GRFFE25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) >> BIAS_BIAS1_PWD_IC2GRFFE25_LSB) -#define BIAS_BIAS1_PWD_IC2GRFFE25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GRFFE25_LSB) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) -#define BIAS_BIAS1_PWD_IC2GRFFE25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GLOREG25_MSB 22 -#define BIAS_BIAS1_PWD_IC2GLOREG25_LSB 20 -#define BIAS_BIAS1_PWD_IC2GLOREG25_MASK 'h00700000 -#define BIAS_BIAS1_PWD_IC2GLOREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLOREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLOREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GLOREG25_LSB) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) -#define BIAS_BIAS1_PWD_IC2GLOREG25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MSB 19 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_LSB 17 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MASK 'h000e0000 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_RESET 3'h3 -#define BIAS_BIAS1_PWD_ICDETECTORB25_MSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_LSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_MASK 'h00010000 -#define BIAS_BIAS1_PWD_ICDETECTORB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORB25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORB25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_ICDETECTORB25_LSB) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORB25_RESET 1'h0 -#define BIAS_BIAS1_PWD_ICDETECTORA25_MSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_LSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_MASK 'h00008000 -#define BIAS_BIAS1_PWD_ICDETECTORA25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORA25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORA25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_ICDETECTORA25_LSB) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORA25_RESET 1'h0 -#define BIAS_BIAS1_PWD_IC5GRXRF25_MSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_LSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_MASK 'h00004000 -#define BIAS_BIAS1_PWD_IC5GRXRF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) >> BIAS_BIAS1_PWD_IC5GRXRF25_LSB) -#define BIAS_BIAS1_PWD_IC5GRXRF25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GRXRF25_LSB) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) -#define BIAS_BIAS1_PWD_IC5GRXRF25_RESET 1'h0 -#define BIAS_BIAS1_PWD_IC5GTXPA25_MSB 13 -#define BIAS_BIAS1_PWD_IC5GTXPA25_LSB 11 -#define BIAS_BIAS1_PWD_IC5GTXPA25_MASK 'h00003800 -#define BIAS_BIAS1_PWD_IC5GTXPA25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) >> BIAS_BIAS1_PWD_IC5GTXPA25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXPA25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GTXPA25_LSB) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXPA25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MSB 10 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_LSB 8 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MASK 'h00000700 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) >> BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC5GQB25_MSB 7 -#define BIAS_BIAS1_PWD_IC5GQB25_LSB 5 -#define BIAS_BIAS1_PWD_IC5GQB25_MASK 'h000000e0 -#define BIAS_BIAS1_PWD_IC5GQB25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GQB25_MASK) >> BIAS_BIAS1_PWD_IC5GQB25_LSB) -#define BIAS_BIAS1_PWD_IC5GQB25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GQB25_LSB) & BIAS_BIAS1_PWD_IC5GQB25_MASK) -#define BIAS_BIAS1_PWD_IC5GQB25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MSB 4 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_LSB 2 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MASK 'h0000001c -#define BIAS_BIAS1_PWD_IC5GMIXQ25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) >> BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_RESET 3'h3 -#define BIAS_BIAS1_SPARE_MSB 1 -#define BIAS_BIAS1_SPARE_LSB 0 -#define BIAS_BIAS1_SPARE_MASK 'h00000003 -#define BIAS_BIAS1_SPARE_GET(x) (((x) & BIAS_BIAS1_SPARE_MASK) >> BIAS_BIAS1_SPARE_LSB) -#define BIAS_BIAS1_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_SPARE_LSB) & BIAS_BIAS1_SPARE_MASK) -#define BIAS_BIAS1_SPARE_RESET 2'h3 -#define BIAS_BIAS1_RESET (32'h0 | \ - BIAS_BIAS1_PWD_ICDAC2BB25_SET(BIAS_BIAS1_PWD_ICDAC2BB25_RESET) | \ - BIAS_BIAS1_PWD_IC2GVGM25_SET(BIAS_BIAS1_PWD_IC2GVGM25_RESET) | \ - BIAS_BIAS1_PWD_IC2GRFFE25_SET(BIAS_BIAS1_PWD_IC2GRFFE25_RESET) | \ - BIAS_BIAS1_PWD_IC2GLOREG25_SET(BIAS_BIAS1_PWD_IC2GLOREG25_RESET) | \ - BIAS_BIAS1_PWD_IC2GLNAREG25_SET(BIAS_BIAS1_PWD_IC2GLNAREG25_RESET) | \ - BIAS_BIAS1_PWD_ICDETECTORB25_SET(BIAS_BIAS1_PWD_ICDETECTORB25_RESET) | \ - BIAS_BIAS1_PWD_ICDETECTORA25_SET(BIAS_BIAS1_PWD_ICDETECTORA25_RESET) | \ - BIAS_BIAS1_PWD_IC5GRXRF25_SET(BIAS_BIAS1_PWD_IC5GRXRF25_RESET) | \ - BIAS_BIAS1_PWD_IC5GTXPA25_SET(BIAS_BIAS1_PWD_IC5GTXPA25_RESET) | \ - BIAS_BIAS1_PWD_IC5GTXBUF25_SET(BIAS_BIAS1_PWD_IC5GTXBUF25_RESET) | \ - BIAS_BIAS1_PWD_IC5GQB25_SET(BIAS_BIAS1_PWD_IC5GQB25_RESET) | \ - BIAS_BIAS1_PWD_IC5GMIXQ25_SET(BIAS_BIAS1_PWD_IC5GMIXQ25_RESET) | \ - BIAS_BIAS1_SPARE_SET(BIAS_BIAS1_SPARE_RESET)) -#define BIAS_BIAS1_HW_MASK (32'h0) -#define BIAS_BIAS1_SW_MASK (32'h0 | \ - BIAS_BIAS1_PWD_ICDAC2BB25_MASK | \ - BIAS_BIAS1_PWD_IC2GVGM25_MASK | \ - BIAS_BIAS1_PWD_IC2GRFFE25_MASK | \ - BIAS_BIAS1_PWD_IC2GLOREG25_MASK | \ - BIAS_BIAS1_PWD_IC2GLNAREG25_MASK | \ - BIAS_BIAS1_PWD_ICDETECTORB25_MASK | \ - BIAS_BIAS1_PWD_ICDETECTORA25_MASK | \ - BIAS_BIAS1_PWD_IC5GRXRF25_MASK | \ - BIAS_BIAS1_PWD_IC5GTXPA25_MASK | \ - BIAS_BIAS1_PWD_IC5GTXBUF25_MASK | \ - BIAS_BIAS1_PWD_IC5GQB25_MASK | \ - BIAS_BIAS1_PWD_IC5GMIXQ25_MASK | \ - BIAS_BIAS1_SPARE_MASK) - -#define BIAS_BIAS2_ADDRESS 'h00000008 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MSB 31 -#define BIAS_BIAS2_PWD_IC5GMIXI25_LSB 29 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MASK 'he0000000 -#define BIAS_BIAS2_PWD_IC5GMIXI25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) >> BIAS_BIAS2_PWD_IC5GMIXI25_LSB) -#define BIAS_BIAS2_PWD_IC5GMIXI25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IC5GMIXI25_LSB) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) -#define BIAS_BIAS2_PWD_IC5GMIXI25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IC5GDIV25_MSB 28 -#define BIAS_BIAS2_PWD_IC5GDIV25_LSB 26 -#define BIAS_BIAS2_PWD_IC5GDIV25_MASK 'h1c000000 -#define BIAS_BIAS2_PWD_IC5GDIV25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) >> BIAS_BIAS2_PWD_IC5GDIV25_LSB) -#define BIAS_BIAS2_PWD_IC5GDIV25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IC5GDIV25_LSB) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) -#define BIAS_BIAS2_PWD_IC5GDIV25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IC5GLOREG25_MSB 25 -#define BIAS_BIAS2_PWD_IC5GLOREG25_LSB 23 -#define BIAS_BIAS2_PWD_IC5GLOREG25_MASK 'h03800000 -#define BIAS_BIAS2_PWD_IC5GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) >> BIAS_BIAS2_PWD_IC5GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IC5GLOREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IC5GLOREG25_LSB) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IC5GLOREG25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRPLL25_MSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_LSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_MASK 'h00400000 -#define BIAS_BIAS2_PWD_IRPLL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRPLL25_MASK) >> BIAS_BIAS2_PWD_IRPLL25_LSB) -#define BIAS_BIAS2_PWD_IRPLL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRPLL25_LSB) & BIAS_BIAS2_PWD_IRPLL25_MASK) -#define BIAS_BIAS2_PWD_IRPLL25_RESET 1'h0 -#define BIAS_BIAS2_PWD_IRXTAL25_MSB 21 -#define BIAS_BIAS2_PWD_IRXTAL25_LSB 19 -#define BIAS_BIAS2_PWD_IRXTAL25_MASK 'h00380000 -#define BIAS_BIAS2_PWD_IRXTAL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRXTAL25_MASK) >> BIAS_BIAS2_PWD_IRXTAL25_LSB) -#define BIAS_BIAS2_PWD_IRXTAL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRXTAL25_LSB) & BIAS_BIAS2_PWD_IRXTAL25_MASK) -#define BIAS_BIAS2_PWD_IRXTAL25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRTSENS25_MSB 18 -#define BIAS_BIAS2_PWD_IRTSENS25_LSB 16 -#define BIAS_BIAS2_PWD_IRTSENS25_MASK 'h00070000 -#define BIAS_BIAS2_PWD_IRTSENS25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTSENS25_MASK) >> BIAS_BIAS2_PWD_IRTSENS25_LSB) -#define BIAS_BIAS2_PWD_IRTSENS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRTSENS25_LSB) & BIAS_BIAS2_PWD_IRTSENS25_MASK) -#define BIAS_BIAS2_PWD_IRTSENS25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRTXPC25_MSB 15 -#define BIAS_BIAS2_PWD_IRTXPC25_LSB 13 -#define BIAS_BIAS2_PWD_IRTXPC25_MASK 'h0000e000 -#define BIAS_BIAS2_PWD_IRTXPC25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTXPC25_MASK) >> BIAS_BIAS2_PWD_IRTXPC25_LSB) -#define BIAS_BIAS2_PWD_IRTXPC25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRTXPC25_LSB) & BIAS_BIAS2_PWD_IRTXPC25_MASK) -#define BIAS_BIAS2_PWD_IRTXPC25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRLDO25_MSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_LSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_MASK 'h00001000 -#define BIAS_BIAS2_PWD_IRLDO25_GET(x) (((x) & BIAS_BIAS2_PWD_IRLDO25_MASK) >> BIAS_BIAS2_PWD_IRLDO25_LSB) -#define BIAS_BIAS2_PWD_IRLDO25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRLDO25_LSB) & BIAS_BIAS2_PWD_IRLDO25_MASK) -#define BIAS_BIAS2_PWD_IRLDO25_RESET 1'h0 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MSB 11 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_LSB 9 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MASK 'h00000e00 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) >> BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IR2GLOREG25_MSB 8 -#define BIAS_BIAS2_PWD_IR2GLOREG25_LSB 6 -#define BIAS_BIAS2_PWD_IR2GLOREG25_MASK 'h000001c0 -#define BIAS_BIAS2_PWD_IR2GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLOREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR2GLOREG25_LSB) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IR2GLOREG25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MSB 5 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_LSB 3 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MASK 'h00000038 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MSB 2 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB 0 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK 'h00000007 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_GET(x) (((x) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) >> BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_RESET 3'h3 -#define BIAS_BIAS2_RESET (32'h0 | \ - BIAS_BIAS2_PWD_IC5GMIXI25_SET(BIAS_BIAS2_PWD_IC5GMIXI25_RESET) | \ - BIAS_BIAS2_PWD_IC5GDIV25_SET(BIAS_BIAS2_PWD_IC5GDIV25_RESET) | \ - BIAS_BIAS2_PWD_IC5GLOREG25_SET(BIAS_BIAS2_PWD_IC5GLOREG25_RESET) | \ - BIAS_BIAS2_PWD_IRPLL25_SET(BIAS_BIAS2_PWD_IRPLL25_RESET) | \ - BIAS_BIAS2_PWD_IRXTAL25_SET(BIAS_BIAS2_PWD_IRXTAL25_RESET) | \ - BIAS_BIAS2_PWD_IRTSENS25_SET(BIAS_BIAS2_PWD_IRTSENS25_RESET) | \ - BIAS_BIAS2_PWD_IRTXPC25_SET(BIAS_BIAS2_PWD_IRTXPC25_RESET) | \ - BIAS_BIAS2_PWD_IRLDO25_SET(BIAS_BIAS2_PWD_IRLDO25_RESET) | \ - BIAS_BIAS2_PWD_IR2GTXMIX25_SET(BIAS_BIAS2_PWD_IR2GTXMIX25_RESET) | \ - BIAS_BIAS2_PWD_IR2GLOREG25_SET(BIAS_BIAS2_PWD_IR2GLOREG25_RESET) | \ - BIAS_BIAS2_PWD_IR2GLNAREG25_SET(BIAS_BIAS2_PWD_IR2GLNAREG25_RESET) | \ - BIAS_BIAS2_PWD_IR5GRFVREF2525_SET(BIAS_BIAS2_PWD_IR5GRFVREF2525_RESET)) -#define BIAS_BIAS2_HW_MASK (32'h0) -#define BIAS_BIAS2_SW_MASK (32'h0 | \ - BIAS_BIAS2_PWD_IC5GMIXI25_MASK | \ - BIAS_BIAS2_PWD_IC5GDIV25_MASK | \ - BIAS_BIAS2_PWD_IC5GLOREG25_MASK | \ - BIAS_BIAS2_PWD_IRPLL25_MASK | \ - BIAS_BIAS2_PWD_IRXTAL25_MASK | \ - BIAS_BIAS2_PWD_IRTSENS25_MASK | \ - BIAS_BIAS2_PWD_IRTXPC25_MASK | \ - BIAS_BIAS2_PWD_IRLDO25_MASK | \ - BIAS_BIAS2_PWD_IR2GTXMIX25_MASK | \ - BIAS_BIAS2_PWD_IR2GLOREG25_MASK | \ - BIAS_BIAS2_PWD_IR2GLNAREG25_MASK | \ - BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) - -#define BIAS_BIAS3_ADDRESS 'h0000000c -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MSB 31 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_LSB 29 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MASK 'he0000000 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) >> BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) -#define BIAS_BIAS3_PWD_IR5GTXMIX25_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) -#define BIAS_BIAS3_PWD_IR5GTXMIX25_RESET 3'h3 -#define BIAS_BIAS3_PWD_IR5GAGC25_MSB 28 -#define BIAS_BIAS3_PWD_IR5GAGC25_LSB 26 -#define BIAS_BIAS3_PWD_IR5GAGC25_MASK 'h1c000000 -#define BIAS_BIAS3_PWD_IR5GAGC25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) >> BIAS_BIAS3_PWD_IR5GAGC25_LSB) -#define BIAS_BIAS3_PWD_IR5GAGC25_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR5GAGC25_LSB) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) -#define BIAS_BIAS3_PWD_IR5GAGC25_RESET 3'h3 -#define BIAS_BIAS3_PWD_ICDAC50_MSB 25 -#define BIAS_BIAS3_PWD_ICDAC50_LSB 23 -#define BIAS_BIAS3_PWD_ICDAC50_MASK 'h03800000 -#define BIAS_BIAS3_PWD_ICDAC50_GET(x) (((x) & BIAS_BIAS3_PWD_ICDAC50_MASK) >> BIAS_BIAS3_PWD_ICDAC50_LSB) -#define BIAS_BIAS3_PWD_ICDAC50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICDAC50_LSB) & BIAS_BIAS3_PWD_ICDAC50_MASK) -#define BIAS_BIAS3_PWD_ICDAC50_RESET 3'h3 -#define BIAS_BIAS3_PWD_ICSYNTH50_MSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_LSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_MASK 'h00400000 -#define BIAS_BIAS3_PWD_ICSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) >> BIAS_BIAS3_PWD_ICSYNTH50_LSB) -#define BIAS_BIAS3_PWD_ICSYNTH50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICSYNTH50_LSB) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) -#define BIAS_BIAS3_PWD_ICSYNTH50_RESET 1'h0 -#define BIAS_BIAS3_PWD_ICBB50_MSB 21 -#define BIAS_BIAS3_PWD_ICBB50_LSB 21 -#define BIAS_BIAS3_PWD_ICBB50_MASK 'h00200000 -#define BIAS_BIAS3_PWD_ICBB50_GET(x) (((x) & BIAS_BIAS3_PWD_ICBB50_MASK) >> BIAS_BIAS3_PWD_ICBB50_LSB) -#define BIAS_BIAS3_PWD_ICBB50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICBB50_LSB) & BIAS_BIAS3_PWD_ICBB50_MASK) -#define BIAS_BIAS3_PWD_ICBB50_RESET 1'h0 -#define BIAS_BIAS3_PWD_IC2GDIV50_MSB 20 -#define BIAS_BIAS3_PWD_IC2GDIV50_LSB 18 -#define BIAS_BIAS3_PWD_IC2GDIV50_MASK 'h001c0000 -#define BIAS_BIAS3_PWD_IC2GDIV50_GET(x) (((x) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) >> BIAS_BIAS3_PWD_IC2GDIV50_LSB) -#define BIAS_BIAS3_PWD_IC2GDIV50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IC2GDIV50_LSB) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) -#define BIAS_BIAS3_PWD_IC2GDIV50_RESET 3'h3 -#define BIAS_BIAS3_PWD_IRSYNTH50_MSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_LSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_MASK 'h00020000 -#define BIAS_BIAS3_PWD_IRSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) >> BIAS_BIAS3_PWD_IRSYNTH50_LSB) -#define BIAS_BIAS3_PWD_IRSYNTH50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IRSYNTH50_LSB) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) -#define BIAS_BIAS3_PWD_IRSYNTH50_RESET 1'h0 -#define BIAS_BIAS3_PWD_IRBB50_MSB 16 -#define BIAS_BIAS3_PWD_IRBB50_LSB 16 -#define BIAS_BIAS3_PWD_IRBB50_MASK 'h00010000 -#define BIAS_BIAS3_PWD_IRBB50_GET(x) (((x) & BIAS_BIAS3_PWD_IRBB50_MASK) >> BIAS_BIAS3_PWD_IRBB50_LSB) -#define BIAS_BIAS3_PWD_IRBB50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IRBB50_LSB) & BIAS_BIAS3_PWD_IRBB50_MASK) -#define BIAS_BIAS3_PWD_IRBB50_RESET 1'h0 -#define BIAS_BIAS3_PWD_IC25SPARE1_MSB 15 -#define BIAS_BIAS3_PWD_IC25SPARE1_LSB 13 -#define BIAS_BIAS3_PWD_IC25SPARE1_MASK 'h0000e000 -#define BIAS_BIAS3_PWD_IC25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) >> BIAS_BIAS3_PWD_IC25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE1_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IC25SPARE1_LSB) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE1_RESET 3'h3 -#define BIAS_BIAS3_PWD_IC25SPARE2_MSB 12 -#define BIAS_BIAS3_PWD_IC25SPARE2_LSB 10 -#define BIAS_BIAS3_PWD_IC25SPARE2_MASK 'h00001c00 -#define BIAS_BIAS3_PWD_IC25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) >> BIAS_BIAS3_PWD_IC25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE2_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IC25SPARE2_LSB) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE2_RESET 3'h3 -#define BIAS_BIAS3_PWD_IR25SPARE1_MSB 9 -#define BIAS_BIAS3_PWD_IR25SPARE1_LSB 7 -#define BIAS_BIAS3_PWD_IR25SPARE1_MASK 'h00000380 -#define BIAS_BIAS3_PWD_IR25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) >> BIAS_BIAS3_PWD_IR25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE1_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR25SPARE1_LSB) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE1_RESET 3'h3 -#define BIAS_BIAS3_PWD_IR25SPARE2_MSB 6 -#define BIAS_BIAS3_PWD_IR25SPARE2_LSB 4 -#define BIAS_BIAS3_PWD_IR25SPARE2_MASK 'h00000070 -#define BIAS_BIAS3_PWD_IR25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) >> BIAS_BIAS3_PWD_IR25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE2_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR25SPARE2_LSB) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE2_RESET 3'h3 -#define BIAS_BIAS3_PWD_ICDACREG12P5_MSB 3 -#define BIAS_BIAS3_PWD_ICDACREG12P5_LSB 1 -#define BIAS_BIAS3_PWD_ICDACREG12P5_MASK 'h0000000e -#define BIAS_BIAS3_PWD_ICDACREG12P5_GET(x) (((x) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) >> BIAS_BIAS3_PWD_ICDACREG12P5_LSB) -#define BIAS_BIAS3_PWD_ICDACREG12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICDACREG12P5_LSB) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) -#define BIAS_BIAS3_PWD_ICDACREG12P5_RESET 3'h5 -#define BIAS_BIAS3_SPARE_MSB 0 -#define BIAS_BIAS3_SPARE_LSB 0 -#define BIAS_BIAS3_SPARE_MASK 'h00000001 -#define BIAS_BIAS3_SPARE_GET(x) (((x) & BIAS_BIAS3_SPARE_MASK) >> BIAS_BIAS3_SPARE_LSB) -#define BIAS_BIAS3_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_SPARE_LSB) & BIAS_BIAS3_SPARE_MASK) -#define BIAS_BIAS3_SPARE_RESET 1'h0 -#define BIAS_BIAS3_RESET (32'h0 | \ - BIAS_BIAS3_PWD_IR5GTXMIX25_SET(BIAS_BIAS3_PWD_IR5GTXMIX25_RESET) | \ - BIAS_BIAS3_PWD_IR5GAGC25_SET(BIAS_BIAS3_PWD_IR5GAGC25_RESET) | \ - BIAS_BIAS3_PWD_ICDAC50_SET(BIAS_BIAS3_PWD_ICDAC50_RESET) | \ - BIAS_BIAS3_PWD_ICSYNTH50_SET(BIAS_BIAS3_PWD_ICSYNTH50_RESET) | \ - BIAS_BIAS3_PWD_ICBB50_SET(BIAS_BIAS3_PWD_ICBB50_RESET) | \ - BIAS_BIAS3_PWD_IC2GDIV50_SET(BIAS_BIAS3_PWD_IC2GDIV50_RESET) | \ - BIAS_BIAS3_PWD_IRSYNTH50_SET(BIAS_BIAS3_PWD_IRSYNTH50_RESET) | \ - BIAS_BIAS3_PWD_IRBB50_SET(BIAS_BIAS3_PWD_IRBB50_RESET) | \ - BIAS_BIAS3_PWD_IC25SPARE1_SET(BIAS_BIAS3_PWD_IC25SPARE1_RESET) | \ - BIAS_BIAS3_PWD_IC25SPARE2_SET(BIAS_BIAS3_PWD_IC25SPARE2_RESET) | \ - BIAS_BIAS3_PWD_IR25SPARE1_SET(BIAS_BIAS3_PWD_IR25SPARE1_RESET) | \ - BIAS_BIAS3_PWD_IR25SPARE2_SET(BIAS_BIAS3_PWD_IR25SPARE2_RESET) | \ - BIAS_BIAS3_PWD_ICDACREG12P5_SET(BIAS_BIAS3_PWD_ICDACREG12P5_RESET) | \ - BIAS_BIAS3_SPARE_SET(BIAS_BIAS3_SPARE_RESET)) -#define BIAS_BIAS3_HW_MASK (32'h0) -#define BIAS_BIAS3_SW_MASK (32'h0 | \ - BIAS_BIAS3_PWD_IR5GTXMIX25_MASK | \ - BIAS_BIAS3_PWD_IR5GAGC25_MASK | \ - BIAS_BIAS3_PWD_ICDAC50_MASK | \ - BIAS_BIAS3_PWD_ICSYNTH50_MASK | \ - BIAS_BIAS3_PWD_ICBB50_MASK | \ - BIAS_BIAS3_PWD_IC2GDIV50_MASK | \ - BIAS_BIAS3_PWD_IRSYNTH50_MASK | \ - BIAS_BIAS3_PWD_IRBB50_MASK | \ - BIAS_BIAS3_PWD_IC25SPARE1_MASK | \ - BIAS_BIAS3_PWD_IC25SPARE2_MASK | \ - BIAS_BIAS3_PWD_IR25SPARE1_MASK | \ - BIAS_BIAS3_PWD_IR25SPARE2_MASK | \ - BIAS_BIAS3_PWD_ICDACREG12P5_MASK | \ - BIAS_BIAS3_SPARE_MASK) - -#define BIAS_REG_ADDRESS_MSB 3 - -#endif /* _BIAS_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/gpio_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/gpio_reg.h deleted file mode 100644 index 4f2b964b7df3..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/gpio_reg.h +++ /dev/null @@ -1,977 +0,0 @@ -#ifndef _GPIO_REG_REG_H_ -#define _GPIO_REG_REG_H_ - -#define GPIO_OUT_ADDRESS 0x00000000 -#define GPIO_OUT_OFFSET 0x00000000 -#define GPIO_OUT_DATA_MSB 17 -#define GPIO_OUT_DATA_LSB 0 -#define GPIO_OUT_DATA_MASK 0x0003ffff -#define GPIO_OUT_DATA_GET(x) (((x) & GPIO_OUT_DATA_MASK) >> GPIO_OUT_DATA_LSB) -#define GPIO_OUT_DATA_SET(x) (((x) << GPIO_OUT_DATA_LSB) & GPIO_OUT_DATA_MASK) - -#define GPIO_OUT_W1TS_ADDRESS 0x00000004 -#define GPIO_OUT_W1TS_OFFSET 0x00000004 -#define GPIO_OUT_W1TS_DATA_MSB 17 -#define GPIO_OUT_W1TS_DATA_LSB 0 -#define GPIO_OUT_W1TS_DATA_MASK 0x0003ffff -#define GPIO_OUT_W1TS_DATA_GET(x) (((x) & GPIO_OUT_W1TS_DATA_MASK) >> GPIO_OUT_W1TS_DATA_LSB) -#define GPIO_OUT_W1TS_DATA_SET(x) (((x) << GPIO_OUT_W1TS_DATA_LSB) & GPIO_OUT_W1TS_DATA_MASK) - -#define GPIO_OUT_W1TC_ADDRESS 0x00000008 -#define GPIO_OUT_W1TC_OFFSET 0x00000008 -#define GPIO_OUT_W1TC_DATA_MSB 17 -#define GPIO_OUT_W1TC_DATA_LSB 0 -#define GPIO_OUT_W1TC_DATA_MASK 0x0003ffff -#define GPIO_OUT_W1TC_DATA_GET(x) (((x) & GPIO_OUT_W1TC_DATA_MASK) >> GPIO_OUT_W1TC_DATA_LSB) -#define GPIO_OUT_W1TC_DATA_SET(x) (((x) << GPIO_OUT_W1TC_DATA_LSB) & GPIO_OUT_W1TC_DATA_MASK) - -#define GPIO_ENABLE_ADDRESS 0x0000000c -#define GPIO_ENABLE_OFFSET 0x0000000c -#define GPIO_ENABLE_DATA_MSB 17 -#define GPIO_ENABLE_DATA_LSB 0 -#define GPIO_ENABLE_DATA_MASK 0x0003ffff -#define GPIO_ENABLE_DATA_GET(x) (((x) & GPIO_ENABLE_DATA_MASK) >> GPIO_ENABLE_DATA_LSB) -#define GPIO_ENABLE_DATA_SET(x) (((x) << GPIO_ENABLE_DATA_LSB) & GPIO_ENABLE_DATA_MASK) - -#define GPIO_ENABLE_W1TS_ADDRESS 0x00000010 -#define GPIO_ENABLE_W1TS_OFFSET 0x00000010 -#define GPIO_ENABLE_W1TS_DATA_MSB 17 -#define GPIO_ENABLE_W1TS_DATA_LSB 0 -#define GPIO_ENABLE_W1TS_DATA_MASK 0x0003ffff -#define GPIO_ENABLE_W1TS_DATA_GET(x) (((x) & GPIO_ENABLE_W1TS_DATA_MASK) >> GPIO_ENABLE_W1TS_DATA_LSB) -#define GPIO_ENABLE_W1TS_DATA_SET(x) (((x) << GPIO_ENABLE_W1TS_DATA_LSB) & GPIO_ENABLE_W1TS_DATA_MASK) - -#define GPIO_ENABLE_W1TC_ADDRESS 0x00000014 -#define GPIO_ENABLE_W1TC_OFFSET 0x00000014 -#define GPIO_ENABLE_W1TC_DATA_MSB 17 -#define GPIO_ENABLE_W1TC_DATA_LSB 0 -#define GPIO_ENABLE_W1TC_DATA_MASK 0x0003ffff -#define GPIO_ENABLE_W1TC_DATA_GET(x) (((x) & GPIO_ENABLE_W1TC_DATA_MASK) >> GPIO_ENABLE_W1TC_DATA_LSB) -#define GPIO_ENABLE_W1TC_DATA_SET(x) (((x) << GPIO_ENABLE_W1TC_DATA_LSB) & GPIO_ENABLE_W1TC_DATA_MASK) - -#define GPIO_IN_ADDRESS 0x00000018 -#define GPIO_IN_OFFSET 0x00000018 -#define GPIO_IN_DATA_MSB 17 -#define GPIO_IN_DATA_LSB 0 -#define GPIO_IN_DATA_MASK 0x0003ffff -#define GPIO_IN_DATA_GET(x) (((x) & GPIO_IN_DATA_MASK) >> GPIO_IN_DATA_LSB) -#define GPIO_IN_DATA_SET(x) (((x) << GPIO_IN_DATA_LSB) & GPIO_IN_DATA_MASK) - -#define GPIO_STATUS_ADDRESS 0x0000001c -#define GPIO_STATUS_OFFSET 0x0000001c -#define GPIO_STATUS_INTERRUPT_MSB 17 -#define GPIO_STATUS_INTERRUPT_LSB 0 -#define GPIO_STATUS_INTERRUPT_MASK 0x0003ffff -#define GPIO_STATUS_INTERRUPT_GET(x) (((x) & GPIO_STATUS_INTERRUPT_MASK) >> GPIO_STATUS_INTERRUPT_LSB) -#define GPIO_STATUS_INTERRUPT_SET(x) (((x) << GPIO_STATUS_INTERRUPT_LSB) & GPIO_STATUS_INTERRUPT_MASK) - -#define GPIO_STATUS_W1TS_ADDRESS 0x00000020 -#define GPIO_STATUS_W1TS_OFFSET 0x00000020 -#define GPIO_STATUS_W1TS_INTERRUPT_MSB 17 -#define GPIO_STATUS_W1TS_INTERRUPT_LSB 0 -#define GPIO_STATUS_W1TS_INTERRUPT_MASK 0x0003ffff -#define GPIO_STATUS_W1TS_INTERRUPT_GET(x) (((x) & GPIO_STATUS_W1TS_INTERRUPT_MASK) >> GPIO_STATUS_W1TS_INTERRUPT_LSB) -#define GPIO_STATUS_W1TS_INTERRUPT_SET(x) (((x) << GPIO_STATUS_W1TS_INTERRUPT_LSB) & GPIO_STATUS_W1TS_INTERRUPT_MASK) - -#define GPIO_STATUS_W1TC_ADDRESS 0x00000024 -#define GPIO_STATUS_W1TC_OFFSET 0x00000024 -#define GPIO_STATUS_W1TC_INTERRUPT_MSB 17 -#define GPIO_STATUS_W1TC_INTERRUPT_LSB 0 -#define GPIO_STATUS_W1TC_INTERRUPT_MASK 0x0003ffff -#define GPIO_STATUS_W1TC_INTERRUPT_GET(x) (((x) & GPIO_STATUS_W1TC_INTERRUPT_MASK) >> GPIO_STATUS_W1TC_INTERRUPT_LSB) -#define GPIO_STATUS_W1TC_INTERRUPT_SET(x) (((x) << GPIO_STATUS_W1TC_INTERRUPT_LSB) & GPIO_STATUS_W1TC_INTERRUPT_MASK) - -#define GPIO_PIN0_ADDRESS 0x00000028 -#define GPIO_PIN0_OFFSET 0x00000028 -#define GPIO_PIN0_CONFIG_MSB 12 -#define GPIO_PIN0_CONFIG_LSB 11 -#define GPIO_PIN0_CONFIG_MASK 0x00001800 -#define GPIO_PIN0_CONFIG_GET(x) (((x) & GPIO_PIN0_CONFIG_MASK) >> GPIO_PIN0_CONFIG_LSB) -#define GPIO_PIN0_CONFIG_SET(x) (((x) << GPIO_PIN0_CONFIG_LSB) & GPIO_PIN0_CONFIG_MASK) -#define GPIO_PIN0_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN0_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN0_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN0_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN0_WAKEUP_ENABLE_MASK) >> GPIO_PIN0_WAKEUP_ENABLE_LSB) -#define GPIO_PIN0_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN0_WAKEUP_ENABLE_LSB) & GPIO_PIN0_WAKEUP_ENABLE_MASK) -#define GPIO_PIN0_INT_TYPE_MSB 9 -#define GPIO_PIN0_INT_TYPE_LSB 7 -#define GPIO_PIN0_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN0_INT_TYPE_GET(x) (((x) & GPIO_PIN0_INT_TYPE_MASK) >> GPIO_PIN0_INT_TYPE_LSB) -#define GPIO_PIN0_INT_TYPE_SET(x) (((x) << GPIO_PIN0_INT_TYPE_LSB) & GPIO_PIN0_INT_TYPE_MASK) -#define GPIO_PIN0_PAD_DRIVER_MSB 2 -#define GPIO_PIN0_PAD_DRIVER_LSB 2 -#define GPIO_PIN0_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN0_PAD_DRIVER_GET(x) (((x) & GPIO_PIN0_PAD_DRIVER_MASK) >> GPIO_PIN0_PAD_DRIVER_LSB) -#define GPIO_PIN0_PAD_DRIVER_SET(x) (((x) << GPIO_PIN0_PAD_DRIVER_LSB) & GPIO_PIN0_PAD_DRIVER_MASK) -#define GPIO_PIN0_SOURCE_MSB 0 -#define GPIO_PIN0_SOURCE_LSB 0 -#define GPIO_PIN0_SOURCE_MASK 0x00000001 -#define GPIO_PIN0_SOURCE_GET(x) (((x) & GPIO_PIN0_SOURCE_MASK) >> GPIO_PIN0_SOURCE_LSB) -#define GPIO_PIN0_SOURCE_SET(x) (((x) << GPIO_PIN0_SOURCE_LSB) & GPIO_PIN0_SOURCE_MASK) - -#define GPIO_PIN1_ADDRESS 0x0000002c -#define GPIO_PIN1_OFFSET 0x0000002c -#define GPIO_PIN1_CONFIG_MSB 12 -#define GPIO_PIN1_CONFIG_LSB 11 -#define GPIO_PIN1_CONFIG_MASK 0x00001800 -#define GPIO_PIN1_CONFIG_GET(x) (((x) & GPIO_PIN1_CONFIG_MASK) >> GPIO_PIN1_CONFIG_LSB) -#define GPIO_PIN1_CONFIG_SET(x) (((x) << GPIO_PIN1_CONFIG_LSB) & GPIO_PIN1_CONFIG_MASK) -#define GPIO_PIN1_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN1_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN1_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN1_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN1_WAKEUP_ENABLE_MASK) >> GPIO_PIN1_WAKEUP_ENABLE_LSB) -#define GPIO_PIN1_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN1_WAKEUP_ENABLE_LSB) & GPIO_PIN1_WAKEUP_ENABLE_MASK) -#define GPIO_PIN1_INT_TYPE_MSB 9 -#define GPIO_PIN1_INT_TYPE_LSB 7 -#define GPIO_PIN1_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN1_INT_TYPE_GET(x) (((x) & GPIO_PIN1_INT_TYPE_MASK) >> GPIO_PIN1_INT_TYPE_LSB) -#define GPIO_PIN1_INT_TYPE_SET(x) (((x) << GPIO_PIN1_INT_TYPE_LSB) & GPIO_PIN1_INT_TYPE_MASK) -#define GPIO_PIN1_PAD_DRIVER_MSB 2 -#define GPIO_PIN1_PAD_DRIVER_LSB 2 -#define GPIO_PIN1_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN1_PAD_DRIVER_GET(x) (((x) & GPIO_PIN1_PAD_DRIVER_MASK) >> GPIO_PIN1_PAD_DRIVER_LSB) -#define GPIO_PIN1_PAD_DRIVER_SET(x) (((x) << GPIO_PIN1_PAD_DRIVER_LSB) & GPIO_PIN1_PAD_DRIVER_MASK) -#define GPIO_PIN1_SOURCE_MSB 0 -#define GPIO_PIN1_SOURCE_LSB 0 -#define GPIO_PIN1_SOURCE_MASK 0x00000001 -#define GPIO_PIN1_SOURCE_GET(x) (((x) & GPIO_PIN1_SOURCE_MASK) >> GPIO_PIN1_SOURCE_LSB) -#define GPIO_PIN1_SOURCE_SET(x) (((x) << GPIO_PIN1_SOURCE_LSB) & GPIO_PIN1_SOURCE_MASK) - -#define GPIO_PIN2_ADDRESS 0x00000030 -#define GPIO_PIN2_OFFSET 0x00000030 -#define GPIO_PIN2_CONFIG_MSB 12 -#define GPIO_PIN2_CONFIG_LSB 11 -#define GPIO_PIN2_CONFIG_MASK 0x00001800 -#define GPIO_PIN2_CONFIG_GET(x) (((x) & GPIO_PIN2_CONFIG_MASK) >> GPIO_PIN2_CONFIG_LSB) -#define GPIO_PIN2_CONFIG_SET(x) (((x) << GPIO_PIN2_CONFIG_LSB) & GPIO_PIN2_CONFIG_MASK) -#define GPIO_PIN2_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN2_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN2_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN2_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN2_WAKEUP_ENABLE_MASK) >> GPIO_PIN2_WAKEUP_ENABLE_LSB) -#define GPIO_PIN2_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN2_WAKEUP_ENABLE_LSB) & GPIO_PIN2_WAKEUP_ENABLE_MASK) -#define GPIO_PIN2_INT_TYPE_MSB 9 -#define GPIO_PIN2_INT_TYPE_LSB 7 -#define GPIO_PIN2_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN2_INT_TYPE_GET(x) (((x) & GPIO_PIN2_INT_TYPE_MASK) >> GPIO_PIN2_INT_TYPE_LSB) -#define GPIO_PIN2_INT_TYPE_SET(x) (((x) << GPIO_PIN2_INT_TYPE_LSB) & GPIO_PIN2_INT_TYPE_MASK) -#define GPIO_PIN2_PAD_DRIVER_MSB 2 -#define GPIO_PIN2_PAD_DRIVER_LSB 2 -#define GPIO_PIN2_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN2_PAD_DRIVER_GET(x) (((x) & GPIO_PIN2_PAD_DRIVER_MASK) >> GPIO_PIN2_PAD_DRIVER_LSB) -#define GPIO_PIN2_PAD_DRIVER_SET(x) (((x) << GPIO_PIN2_PAD_DRIVER_LSB) & GPIO_PIN2_PAD_DRIVER_MASK) -#define GPIO_PIN2_SOURCE_MSB 0 -#define GPIO_PIN2_SOURCE_LSB 0 -#define GPIO_PIN2_SOURCE_MASK 0x00000001 -#define GPIO_PIN2_SOURCE_GET(x) (((x) & GPIO_PIN2_SOURCE_MASK) >> GPIO_PIN2_SOURCE_LSB) -#define GPIO_PIN2_SOURCE_SET(x) (((x) << GPIO_PIN2_SOURCE_LSB) & GPIO_PIN2_SOURCE_MASK) - -#define GPIO_PIN3_ADDRESS 0x00000034 -#define GPIO_PIN3_OFFSET 0x00000034 -#define GPIO_PIN3_CONFIG_MSB 12 -#define GPIO_PIN3_CONFIG_LSB 11 -#define GPIO_PIN3_CONFIG_MASK 0x00001800 -#define GPIO_PIN3_CONFIG_GET(x) (((x) & GPIO_PIN3_CONFIG_MASK) >> GPIO_PIN3_CONFIG_LSB) -#define GPIO_PIN3_CONFIG_SET(x) (((x) << GPIO_PIN3_CONFIG_LSB) & GPIO_PIN3_CONFIG_MASK) -#define GPIO_PIN3_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN3_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN3_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN3_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN3_WAKEUP_ENABLE_MASK) >> GPIO_PIN3_WAKEUP_ENABLE_LSB) -#define GPIO_PIN3_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN3_WAKEUP_ENABLE_LSB) & GPIO_PIN3_WAKEUP_ENABLE_MASK) -#define GPIO_PIN3_INT_TYPE_MSB 9 -#define GPIO_PIN3_INT_TYPE_LSB 7 -#define GPIO_PIN3_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN3_INT_TYPE_GET(x) (((x) & GPIO_PIN3_INT_TYPE_MASK) >> GPIO_PIN3_INT_TYPE_LSB) -#define GPIO_PIN3_INT_TYPE_SET(x) (((x) << GPIO_PIN3_INT_TYPE_LSB) & GPIO_PIN3_INT_TYPE_MASK) -#define GPIO_PIN3_PAD_DRIVER_MSB 2 -#define GPIO_PIN3_PAD_DRIVER_LSB 2 -#define GPIO_PIN3_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN3_PAD_DRIVER_GET(x) (((x) & GPIO_PIN3_PAD_DRIVER_MASK) >> GPIO_PIN3_PAD_DRIVER_LSB) -#define GPIO_PIN3_PAD_DRIVER_SET(x) (((x) << GPIO_PIN3_PAD_DRIVER_LSB) & GPIO_PIN3_PAD_DRIVER_MASK) -#define GPIO_PIN3_SOURCE_MSB 0 -#define GPIO_PIN3_SOURCE_LSB 0 -#define GPIO_PIN3_SOURCE_MASK 0x00000001 -#define GPIO_PIN3_SOURCE_GET(x) (((x) & GPIO_PIN3_SOURCE_MASK) >> GPIO_PIN3_SOURCE_LSB) -#define GPIO_PIN3_SOURCE_SET(x) (((x) << GPIO_PIN3_SOURCE_LSB) & GPIO_PIN3_SOURCE_MASK) - -#define GPIO_PIN4_ADDRESS 0x00000038 -#define GPIO_PIN4_OFFSET 0x00000038 -#define GPIO_PIN4_CONFIG_MSB 12 -#define GPIO_PIN4_CONFIG_LSB 11 -#define GPIO_PIN4_CONFIG_MASK 0x00001800 -#define GPIO_PIN4_CONFIG_GET(x) (((x) & GPIO_PIN4_CONFIG_MASK) >> GPIO_PIN4_CONFIG_LSB) -#define GPIO_PIN4_CONFIG_SET(x) (((x) << GPIO_PIN4_CONFIG_LSB) & GPIO_PIN4_CONFIG_MASK) -#define GPIO_PIN4_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN4_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN4_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN4_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN4_WAKEUP_ENABLE_MASK) >> GPIO_PIN4_WAKEUP_ENABLE_LSB) -#define GPIO_PIN4_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN4_WAKEUP_ENABLE_LSB) & GPIO_PIN4_WAKEUP_ENABLE_MASK) -#define GPIO_PIN4_INT_TYPE_MSB 9 -#define GPIO_PIN4_INT_TYPE_LSB 7 -#define GPIO_PIN4_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN4_INT_TYPE_GET(x) (((x) & GPIO_PIN4_INT_TYPE_MASK) >> GPIO_PIN4_INT_TYPE_LSB) -#define GPIO_PIN4_INT_TYPE_SET(x) (((x) << GPIO_PIN4_INT_TYPE_LSB) & GPIO_PIN4_INT_TYPE_MASK) -#define GPIO_PIN4_PAD_DRIVER_MSB 2 -#define GPIO_PIN4_PAD_DRIVER_LSB 2 -#define GPIO_PIN4_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN4_PAD_DRIVER_GET(x) (((x) & GPIO_PIN4_PAD_DRIVER_MASK) >> GPIO_PIN4_PAD_DRIVER_LSB) -#define GPIO_PIN4_PAD_DRIVER_SET(x) (((x) << GPIO_PIN4_PAD_DRIVER_LSB) & GPIO_PIN4_PAD_DRIVER_MASK) -#define GPIO_PIN4_SOURCE_MSB 0 -#define GPIO_PIN4_SOURCE_LSB 0 -#define GPIO_PIN4_SOURCE_MASK 0x00000001 -#define GPIO_PIN4_SOURCE_GET(x) (((x) & GPIO_PIN4_SOURCE_MASK) >> GPIO_PIN4_SOURCE_LSB) -#define GPIO_PIN4_SOURCE_SET(x) (((x) << GPIO_PIN4_SOURCE_LSB) & GPIO_PIN4_SOURCE_MASK) - -#define GPIO_PIN5_ADDRESS 0x0000003c -#define GPIO_PIN5_OFFSET 0x0000003c -#define GPIO_PIN5_CONFIG_MSB 12 -#define GPIO_PIN5_CONFIG_LSB 11 -#define GPIO_PIN5_CONFIG_MASK 0x00001800 -#define GPIO_PIN5_CONFIG_GET(x) (((x) & GPIO_PIN5_CONFIG_MASK) >> GPIO_PIN5_CONFIG_LSB) -#define GPIO_PIN5_CONFIG_SET(x) (((x) << GPIO_PIN5_CONFIG_LSB) & GPIO_PIN5_CONFIG_MASK) -#define GPIO_PIN5_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN5_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN5_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN5_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN5_WAKEUP_ENABLE_MASK) >> GPIO_PIN5_WAKEUP_ENABLE_LSB) -#define GPIO_PIN5_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN5_WAKEUP_ENABLE_LSB) & GPIO_PIN5_WAKEUP_ENABLE_MASK) -#define GPIO_PIN5_INT_TYPE_MSB 9 -#define GPIO_PIN5_INT_TYPE_LSB 7 -#define GPIO_PIN5_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN5_INT_TYPE_GET(x) (((x) & GPIO_PIN5_INT_TYPE_MASK) >> GPIO_PIN5_INT_TYPE_LSB) -#define GPIO_PIN5_INT_TYPE_SET(x) (((x) << GPIO_PIN5_INT_TYPE_LSB) & GPIO_PIN5_INT_TYPE_MASK) -#define GPIO_PIN5_PAD_DRIVER_MSB 2 -#define GPIO_PIN5_PAD_DRIVER_LSB 2 -#define GPIO_PIN5_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN5_PAD_DRIVER_GET(x) (((x) & GPIO_PIN5_PAD_DRIVER_MASK) >> GPIO_PIN5_PAD_DRIVER_LSB) -#define GPIO_PIN5_PAD_DRIVER_SET(x) (((x) << GPIO_PIN5_PAD_DRIVER_LSB) & GPIO_PIN5_PAD_DRIVER_MASK) -#define GPIO_PIN5_SOURCE_MSB 0 -#define GPIO_PIN5_SOURCE_LSB 0 -#define GPIO_PIN5_SOURCE_MASK 0x00000001 -#define GPIO_PIN5_SOURCE_GET(x) (((x) & GPIO_PIN5_SOURCE_MASK) >> GPIO_PIN5_SOURCE_LSB) -#define GPIO_PIN5_SOURCE_SET(x) (((x) << GPIO_PIN5_SOURCE_LSB) & GPIO_PIN5_SOURCE_MASK) - -#define GPIO_PIN6_ADDRESS 0x00000040 -#define GPIO_PIN6_OFFSET 0x00000040 -#define GPIO_PIN6_CONFIG_MSB 12 -#define GPIO_PIN6_CONFIG_LSB 11 -#define GPIO_PIN6_CONFIG_MASK 0x00001800 -#define GPIO_PIN6_CONFIG_GET(x) (((x) & GPIO_PIN6_CONFIG_MASK) >> GPIO_PIN6_CONFIG_LSB) -#define GPIO_PIN6_CONFIG_SET(x) (((x) << GPIO_PIN6_CONFIG_LSB) & GPIO_PIN6_CONFIG_MASK) -#define GPIO_PIN6_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN6_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN6_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN6_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN6_WAKEUP_ENABLE_MASK) >> GPIO_PIN6_WAKEUP_ENABLE_LSB) -#define GPIO_PIN6_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN6_WAKEUP_ENABLE_LSB) & GPIO_PIN6_WAKEUP_ENABLE_MASK) -#define GPIO_PIN6_INT_TYPE_MSB 9 -#define GPIO_PIN6_INT_TYPE_LSB 7 -#define GPIO_PIN6_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN6_INT_TYPE_GET(x) (((x) & GPIO_PIN6_INT_TYPE_MASK) >> GPIO_PIN6_INT_TYPE_LSB) -#define GPIO_PIN6_INT_TYPE_SET(x) (((x) << GPIO_PIN6_INT_TYPE_LSB) & GPIO_PIN6_INT_TYPE_MASK) -#define GPIO_PIN6_PAD_DRIVER_MSB 2 -#define GPIO_PIN6_PAD_DRIVER_LSB 2 -#define GPIO_PIN6_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN6_PAD_DRIVER_GET(x) (((x) & GPIO_PIN6_PAD_DRIVER_MASK) >> GPIO_PIN6_PAD_DRIVER_LSB) -#define GPIO_PIN6_PAD_DRIVER_SET(x) (((x) << GPIO_PIN6_PAD_DRIVER_LSB) & GPIO_PIN6_PAD_DRIVER_MASK) -#define GPIO_PIN6_SOURCE_MSB 0 -#define GPIO_PIN6_SOURCE_LSB 0 -#define GPIO_PIN6_SOURCE_MASK 0x00000001 -#define GPIO_PIN6_SOURCE_GET(x) (((x) & GPIO_PIN6_SOURCE_MASK) >> GPIO_PIN6_SOURCE_LSB) -#define GPIO_PIN6_SOURCE_SET(x) (((x) << GPIO_PIN6_SOURCE_LSB) & GPIO_PIN6_SOURCE_MASK) - -#define GPIO_PIN7_ADDRESS 0x00000044 -#define GPIO_PIN7_OFFSET 0x00000044 -#define GPIO_PIN7_CONFIG_MSB 12 -#define GPIO_PIN7_CONFIG_LSB 11 -#define GPIO_PIN7_CONFIG_MASK 0x00001800 -#define GPIO_PIN7_CONFIG_GET(x) (((x) & GPIO_PIN7_CONFIG_MASK) >> GPIO_PIN7_CONFIG_LSB) -#define GPIO_PIN7_CONFIG_SET(x) (((x) << GPIO_PIN7_CONFIG_LSB) & GPIO_PIN7_CONFIG_MASK) -#define GPIO_PIN7_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN7_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN7_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN7_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN7_WAKEUP_ENABLE_MASK) >> GPIO_PIN7_WAKEUP_ENABLE_LSB) -#define GPIO_PIN7_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN7_WAKEUP_ENABLE_LSB) & GPIO_PIN7_WAKEUP_ENABLE_MASK) -#define GPIO_PIN7_INT_TYPE_MSB 9 -#define GPIO_PIN7_INT_TYPE_LSB 7 -#define GPIO_PIN7_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN7_INT_TYPE_GET(x) (((x) & GPIO_PIN7_INT_TYPE_MASK) >> GPIO_PIN7_INT_TYPE_LSB) -#define GPIO_PIN7_INT_TYPE_SET(x) (((x) << GPIO_PIN7_INT_TYPE_LSB) & GPIO_PIN7_INT_TYPE_MASK) -#define GPIO_PIN7_PAD_DRIVER_MSB 2 -#define GPIO_PIN7_PAD_DRIVER_LSB 2 -#define GPIO_PIN7_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN7_PAD_DRIVER_GET(x) (((x) & GPIO_PIN7_PAD_DRIVER_MASK) >> GPIO_PIN7_PAD_DRIVER_LSB) -#define GPIO_PIN7_PAD_DRIVER_SET(x) (((x) << GPIO_PIN7_PAD_DRIVER_LSB) & GPIO_PIN7_PAD_DRIVER_MASK) -#define GPIO_PIN7_SOURCE_MSB 0 -#define GPIO_PIN7_SOURCE_LSB 0 -#define GPIO_PIN7_SOURCE_MASK 0x00000001 -#define GPIO_PIN7_SOURCE_GET(x) (((x) & GPIO_PIN7_SOURCE_MASK) >> GPIO_PIN7_SOURCE_LSB) -#define GPIO_PIN7_SOURCE_SET(x) (((x) << GPIO_PIN7_SOURCE_LSB) & GPIO_PIN7_SOURCE_MASK) - -#define GPIO_PIN8_ADDRESS 0x00000048 -#define GPIO_PIN8_OFFSET 0x00000048 -#define GPIO_PIN8_CONFIG_MSB 12 -#define GPIO_PIN8_CONFIG_LSB 11 -#define GPIO_PIN8_CONFIG_MASK 0x00001800 -#define GPIO_PIN8_CONFIG_GET(x) (((x) & GPIO_PIN8_CONFIG_MASK) >> GPIO_PIN8_CONFIG_LSB) -#define GPIO_PIN8_CONFIG_SET(x) (((x) << GPIO_PIN8_CONFIG_LSB) & GPIO_PIN8_CONFIG_MASK) -#define GPIO_PIN8_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN8_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN8_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN8_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN8_WAKEUP_ENABLE_MASK) >> GPIO_PIN8_WAKEUP_ENABLE_LSB) -#define GPIO_PIN8_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN8_WAKEUP_ENABLE_LSB) & GPIO_PIN8_WAKEUP_ENABLE_MASK) -#define GPIO_PIN8_INT_TYPE_MSB 9 -#define GPIO_PIN8_INT_TYPE_LSB 7 -#define GPIO_PIN8_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN8_INT_TYPE_GET(x) (((x) & GPIO_PIN8_INT_TYPE_MASK) >> GPIO_PIN8_INT_TYPE_LSB) -#define GPIO_PIN8_INT_TYPE_SET(x) (((x) << GPIO_PIN8_INT_TYPE_LSB) & GPIO_PIN8_INT_TYPE_MASK) -#define GPIO_PIN8_PAD_DRIVER_MSB 2 -#define GPIO_PIN8_PAD_DRIVER_LSB 2 -#define GPIO_PIN8_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN8_PAD_DRIVER_GET(x) (((x) & GPIO_PIN8_PAD_DRIVER_MASK) >> GPIO_PIN8_PAD_DRIVER_LSB) -#define GPIO_PIN8_PAD_DRIVER_SET(x) (((x) << GPIO_PIN8_PAD_DRIVER_LSB) & GPIO_PIN8_PAD_DRIVER_MASK) -#define GPIO_PIN8_SOURCE_MSB 0 -#define GPIO_PIN8_SOURCE_LSB 0 -#define GPIO_PIN8_SOURCE_MASK 0x00000001 -#define GPIO_PIN8_SOURCE_GET(x) (((x) & GPIO_PIN8_SOURCE_MASK) >> GPIO_PIN8_SOURCE_LSB) -#define GPIO_PIN8_SOURCE_SET(x) (((x) << GPIO_PIN8_SOURCE_LSB) & GPIO_PIN8_SOURCE_MASK) - -#define GPIO_PIN9_ADDRESS 0x0000004c -#define GPIO_PIN9_OFFSET 0x0000004c -#define GPIO_PIN9_CONFIG_MSB 12 -#define GPIO_PIN9_CONFIG_LSB 11 -#define GPIO_PIN9_CONFIG_MASK 0x00001800 -#define GPIO_PIN9_CONFIG_GET(x) (((x) & GPIO_PIN9_CONFIG_MASK) >> GPIO_PIN9_CONFIG_LSB) -#define GPIO_PIN9_CONFIG_SET(x) (((x) << GPIO_PIN9_CONFIG_LSB) & GPIO_PIN9_CONFIG_MASK) -#define GPIO_PIN9_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN9_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN9_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN9_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN9_WAKEUP_ENABLE_MASK) >> GPIO_PIN9_WAKEUP_ENABLE_LSB) -#define GPIO_PIN9_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN9_WAKEUP_ENABLE_LSB) & GPIO_PIN9_WAKEUP_ENABLE_MASK) -#define GPIO_PIN9_INT_TYPE_MSB 9 -#define GPIO_PIN9_INT_TYPE_LSB 7 -#define GPIO_PIN9_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN9_INT_TYPE_GET(x) (((x) & GPIO_PIN9_INT_TYPE_MASK) >> GPIO_PIN9_INT_TYPE_LSB) -#define GPIO_PIN9_INT_TYPE_SET(x) (((x) << GPIO_PIN9_INT_TYPE_LSB) & GPIO_PIN9_INT_TYPE_MASK) -#define GPIO_PIN9_PAD_DRIVER_MSB 2 -#define GPIO_PIN9_PAD_DRIVER_LSB 2 -#define GPIO_PIN9_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN9_PAD_DRIVER_GET(x) (((x) & GPIO_PIN9_PAD_DRIVER_MASK) >> GPIO_PIN9_PAD_DRIVER_LSB) -#define GPIO_PIN9_PAD_DRIVER_SET(x) (((x) << GPIO_PIN9_PAD_DRIVER_LSB) & GPIO_PIN9_PAD_DRIVER_MASK) -#define GPIO_PIN9_SOURCE_MSB 0 -#define GPIO_PIN9_SOURCE_LSB 0 -#define GPIO_PIN9_SOURCE_MASK 0x00000001 -#define GPIO_PIN9_SOURCE_GET(x) (((x) & GPIO_PIN9_SOURCE_MASK) >> GPIO_PIN9_SOURCE_LSB) -#define GPIO_PIN9_SOURCE_SET(x) (((x) << GPIO_PIN9_SOURCE_LSB) & GPIO_PIN9_SOURCE_MASK) - -#define GPIO_PIN10_ADDRESS 0x00000050 -#define GPIO_PIN10_OFFSET 0x00000050 -#define GPIO_PIN10_CONFIG_MSB 12 -#define GPIO_PIN10_CONFIG_LSB 11 -#define GPIO_PIN10_CONFIG_MASK 0x00001800 -#define GPIO_PIN10_CONFIG_GET(x) (((x) & GPIO_PIN10_CONFIG_MASK) >> GPIO_PIN10_CONFIG_LSB) -#define GPIO_PIN10_CONFIG_SET(x) (((x) << GPIO_PIN10_CONFIG_LSB) & GPIO_PIN10_CONFIG_MASK) -#define GPIO_PIN10_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN10_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN10_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN10_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN10_WAKEUP_ENABLE_MASK) >> GPIO_PIN10_WAKEUP_ENABLE_LSB) -#define GPIO_PIN10_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN10_WAKEUP_ENABLE_LSB) & GPIO_PIN10_WAKEUP_ENABLE_MASK) -#define GPIO_PIN10_INT_TYPE_MSB 9 -#define GPIO_PIN10_INT_TYPE_LSB 7 -#define GPIO_PIN10_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN10_INT_TYPE_GET(x) (((x) & GPIO_PIN10_INT_TYPE_MASK) >> GPIO_PIN10_INT_TYPE_LSB) -#define GPIO_PIN10_INT_TYPE_SET(x) (((x) << GPIO_PIN10_INT_TYPE_LSB) & GPIO_PIN10_INT_TYPE_MASK) -#define GPIO_PIN10_PAD_DRIVER_MSB 2 -#define GPIO_PIN10_PAD_DRIVER_LSB 2 -#define GPIO_PIN10_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN10_PAD_DRIVER_GET(x) (((x) & GPIO_PIN10_PAD_DRIVER_MASK) >> GPIO_PIN10_PAD_DRIVER_LSB) -#define GPIO_PIN10_PAD_DRIVER_SET(x) (((x) << GPIO_PIN10_PAD_DRIVER_LSB) & GPIO_PIN10_PAD_DRIVER_MASK) -#define GPIO_PIN10_SOURCE_MSB 0 -#define GPIO_PIN10_SOURCE_LSB 0 -#define GPIO_PIN10_SOURCE_MASK 0x00000001 -#define GPIO_PIN10_SOURCE_GET(x) (((x) & GPIO_PIN10_SOURCE_MASK) >> GPIO_PIN10_SOURCE_LSB) -#define GPIO_PIN10_SOURCE_SET(x) (((x) << GPIO_PIN10_SOURCE_LSB) & GPIO_PIN10_SOURCE_MASK) - -#define GPIO_PIN11_ADDRESS 0x00000054 -#define GPIO_PIN11_OFFSET 0x00000054 -#define GPIO_PIN11_CONFIG_MSB 12 -#define GPIO_PIN11_CONFIG_LSB 11 -#define GPIO_PIN11_CONFIG_MASK 0x00001800 -#define GPIO_PIN11_CONFIG_GET(x) (((x) & GPIO_PIN11_CONFIG_MASK) >> GPIO_PIN11_CONFIG_LSB) -#define GPIO_PIN11_CONFIG_SET(x) (((x) << GPIO_PIN11_CONFIG_LSB) & GPIO_PIN11_CONFIG_MASK) -#define GPIO_PIN11_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN11_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN11_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN11_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN11_WAKEUP_ENABLE_MASK) >> GPIO_PIN11_WAKEUP_ENABLE_LSB) -#define GPIO_PIN11_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN11_WAKEUP_ENABLE_LSB) & GPIO_PIN11_WAKEUP_ENABLE_MASK) -#define GPIO_PIN11_INT_TYPE_MSB 9 -#define GPIO_PIN11_INT_TYPE_LSB 7 -#define GPIO_PIN11_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN11_INT_TYPE_GET(x) (((x) & GPIO_PIN11_INT_TYPE_MASK) >> GPIO_PIN11_INT_TYPE_LSB) -#define GPIO_PIN11_INT_TYPE_SET(x) (((x) << GPIO_PIN11_INT_TYPE_LSB) & GPIO_PIN11_INT_TYPE_MASK) -#define GPIO_PIN11_PAD_DRIVER_MSB 2 -#define GPIO_PIN11_PAD_DRIVER_LSB 2 -#define GPIO_PIN11_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN11_PAD_DRIVER_GET(x) (((x) & GPIO_PIN11_PAD_DRIVER_MASK) >> GPIO_PIN11_PAD_DRIVER_LSB) -#define GPIO_PIN11_PAD_DRIVER_SET(x) (((x) << GPIO_PIN11_PAD_DRIVER_LSB) & GPIO_PIN11_PAD_DRIVER_MASK) -#define GPIO_PIN11_SOURCE_MSB 0 -#define GPIO_PIN11_SOURCE_LSB 0 -#define GPIO_PIN11_SOURCE_MASK 0x00000001 -#define GPIO_PIN11_SOURCE_GET(x) (((x) & GPIO_PIN11_SOURCE_MASK) >> GPIO_PIN11_SOURCE_LSB) -#define GPIO_PIN11_SOURCE_SET(x) (((x) << GPIO_PIN11_SOURCE_LSB) & GPIO_PIN11_SOURCE_MASK) - -#define GPIO_PIN12_ADDRESS 0x00000058 -#define GPIO_PIN12_OFFSET 0x00000058 -#define GPIO_PIN12_CONFIG_MSB 12 -#define GPIO_PIN12_CONFIG_LSB 11 -#define GPIO_PIN12_CONFIG_MASK 0x00001800 -#define GPIO_PIN12_CONFIG_GET(x) (((x) & GPIO_PIN12_CONFIG_MASK) >> GPIO_PIN12_CONFIG_LSB) -#define GPIO_PIN12_CONFIG_SET(x) (((x) << GPIO_PIN12_CONFIG_LSB) & GPIO_PIN12_CONFIG_MASK) -#define GPIO_PIN12_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN12_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN12_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN12_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN12_WAKEUP_ENABLE_MASK) >> GPIO_PIN12_WAKEUP_ENABLE_LSB) -#define GPIO_PIN12_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN12_WAKEUP_ENABLE_LSB) & GPIO_PIN12_WAKEUP_ENABLE_MASK) -#define GPIO_PIN12_INT_TYPE_MSB 9 -#define GPIO_PIN12_INT_TYPE_LSB 7 -#define GPIO_PIN12_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN12_INT_TYPE_GET(x) (((x) & GPIO_PIN12_INT_TYPE_MASK) >> GPIO_PIN12_INT_TYPE_LSB) -#define GPIO_PIN12_INT_TYPE_SET(x) (((x) << GPIO_PIN12_INT_TYPE_LSB) & GPIO_PIN12_INT_TYPE_MASK) -#define GPIO_PIN12_PAD_DRIVER_MSB 2 -#define GPIO_PIN12_PAD_DRIVER_LSB 2 -#define GPIO_PIN12_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN12_PAD_DRIVER_GET(x) (((x) & GPIO_PIN12_PAD_DRIVER_MASK) >> GPIO_PIN12_PAD_DRIVER_LSB) -#define GPIO_PIN12_PAD_DRIVER_SET(x) (((x) << GPIO_PIN12_PAD_DRIVER_LSB) & GPIO_PIN12_PAD_DRIVER_MASK) -#define GPIO_PIN12_SOURCE_MSB 0 -#define GPIO_PIN12_SOURCE_LSB 0 -#define GPIO_PIN12_SOURCE_MASK 0x00000001 -#define GPIO_PIN12_SOURCE_GET(x) (((x) & GPIO_PIN12_SOURCE_MASK) >> GPIO_PIN12_SOURCE_LSB) -#define GPIO_PIN12_SOURCE_SET(x) (((x) << GPIO_PIN12_SOURCE_LSB) & GPIO_PIN12_SOURCE_MASK) - -#define GPIO_PIN13_ADDRESS 0x0000005c -#define GPIO_PIN13_OFFSET 0x0000005c -#define GPIO_PIN13_CONFIG_MSB 12 -#define GPIO_PIN13_CONFIG_LSB 11 -#define GPIO_PIN13_CONFIG_MASK 0x00001800 -#define GPIO_PIN13_CONFIG_GET(x) (((x) & GPIO_PIN13_CONFIG_MASK) >> GPIO_PIN13_CONFIG_LSB) -#define GPIO_PIN13_CONFIG_SET(x) (((x) << GPIO_PIN13_CONFIG_LSB) & GPIO_PIN13_CONFIG_MASK) -#define GPIO_PIN13_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN13_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN13_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN13_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN13_WAKEUP_ENABLE_MASK) >> GPIO_PIN13_WAKEUP_ENABLE_LSB) -#define GPIO_PIN13_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN13_WAKEUP_ENABLE_LSB) & GPIO_PIN13_WAKEUP_ENABLE_MASK) -#define GPIO_PIN13_INT_TYPE_MSB 9 -#define GPIO_PIN13_INT_TYPE_LSB 7 -#define GPIO_PIN13_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN13_INT_TYPE_GET(x) (((x) & GPIO_PIN13_INT_TYPE_MASK) >> GPIO_PIN13_INT_TYPE_LSB) -#define GPIO_PIN13_INT_TYPE_SET(x) (((x) << GPIO_PIN13_INT_TYPE_LSB) & GPIO_PIN13_INT_TYPE_MASK) -#define GPIO_PIN13_PAD_DRIVER_MSB 2 -#define GPIO_PIN13_PAD_DRIVER_LSB 2 -#define GPIO_PIN13_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN13_PAD_DRIVER_GET(x) (((x) & GPIO_PIN13_PAD_DRIVER_MASK) >> GPIO_PIN13_PAD_DRIVER_LSB) -#define GPIO_PIN13_PAD_DRIVER_SET(x) (((x) << GPIO_PIN13_PAD_DRIVER_LSB) & GPIO_PIN13_PAD_DRIVER_MASK) -#define GPIO_PIN13_SOURCE_MSB 0 -#define GPIO_PIN13_SOURCE_LSB 0 -#define GPIO_PIN13_SOURCE_MASK 0x00000001 -#define GPIO_PIN13_SOURCE_GET(x) (((x) & GPIO_PIN13_SOURCE_MASK) >> GPIO_PIN13_SOURCE_LSB) -#define GPIO_PIN13_SOURCE_SET(x) (((x) << GPIO_PIN13_SOURCE_LSB) & GPIO_PIN13_SOURCE_MASK) - -#define GPIO_PIN14_ADDRESS 0x00000060 -#define GPIO_PIN14_OFFSET 0x00000060 -#define GPIO_PIN14_CONFIG_MSB 12 -#define GPIO_PIN14_CONFIG_LSB 11 -#define GPIO_PIN14_CONFIG_MASK 0x00001800 -#define GPIO_PIN14_CONFIG_GET(x) (((x) & GPIO_PIN14_CONFIG_MASK) >> GPIO_PIN14_CONFIG_LSB) -#define GPIO_PIN14_CONFIG_SET(x) (((x) << GPIO_PIN14_CONFIG_LSB) & GPIO_PIN14_CONFIG_MASK) -#define GPIO_PIN14_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN14_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN14_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN14_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN14_WAKEUP_ENABLE_MASK) >> GPIO_PIN14_WAKEUP_ENABLE_LSB) -#define GPIO_PIN14_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN14_WAKEUP_ENABLE_LSB) & GPIO_PIN14_WAKEUP_ENABLE_MASK) -#define GPIO_PIN14_INT_TYPE_MSB 9 -#define GPIO_PIN14_INT_TYPE_LSB 7 -#define GPIO_PIN14_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN14_INT_TYPE_GET(x) (((x) & GPIO_PIN14_INT_TYPE_MASK) >> GPIO_PIN14_INT_TYPE_LSB) -#define GPIO_PIN14_INT_TYPE_SET(x) (((x) << GPIO_PIN14_INT_TYPE_LSB) & GPIO_PIN14_INT_TYPE_MASK) -#define GPIO_PIN14_PAD_DRIVER_MSB 2 -#define GPIO_PIN14_PAD_DRIVER_LSB 2 -#define GPIO_PIN14_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN14_PAD_DRIVER_GET(x) (((x) & GPIO_PIN14_PAD_DRIVER_MASK) >> GPIO_PIN14_PAD_DRIVER_LSB) -#define GPIO_PIN14_PAD_DRIVER_SET(x) (((x) << GPIO_PIN14_PAD_DRIVER_LSB) & GPIO_PIN14_PAD_DRIVER_MASK) -#define GPIO_PIN14_SOURCE_MSB 0 -#define GPIO_PIN14_SOURCE_LSB 0 -#define GPIO_PIN14_SOURCE_MASK 0x00000001 -#define GPIO_PIN14_SOURCE_GET(x) (((x) & GPIO_PIN14_SOURCE_MASK) >> GPIO_PIN14_SOURCE_LSB) -#define GPIO_PIN14_SOURCE_SET(x) (((x) << GPIO_PIN14_SOURCE_LSB) & GPIO_PIN14_SOURCE_MASK) - -#define GPIO_PIN15_ADDRESS 0x00000064 -#define GPIO_PIN15_OFFSET 0x00000064 -#define GPIO_PIN15_CONFIG_MSB 12 -#define GPIO_PIN15_CONFIG_LSB 11 -#define GPIO_PIN15_CONFIG_MASK 0x00001800 -#define GPIO_PIN15_CONFIG_GET(x) (((x) & GPIO_PIN15_CONFIG_MASK) >> GPIO_PIN15_CONFIG_LSB) -#define GPIO_PIN15_CONFIG_SET(x) (((x) << GPIO_PIN15_CONFIG_LSB) & GPIO_PIN15_CONFIG_MASK) -#define GPIO_PIN15_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN15_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN15_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN15_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN15_WAKEUP_ENABLE_MASK) >> GPIO_PIN15_WAKEUP_ENABLE_LSB) -#define GPIO_PIN15_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN15_WAKEUP_ENABLE_LSB) & GPIO_PIN15_WAKEUP_ENABLE_MASK) -#define GPIO_PIN15_INT_TYPE_MSB 9 -#define GPIO_PIN15_INT_TYPE_LSB 7 -#define GPIO_PIN15_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN15_INT_TYPE_GET(x) (((x) & GPIO_PIN15_INT_TYPE_MASK) >> GPIO_PIN15_INT_TYPE_LSB) -#define GPIO_PIN15_INT_TYPE_SET(x) (((x) << GPIO_PIN15_INT_TYPE_LSB) & GPIO_PIN15_INT_TYPE_MASK) -#define GPIO_PIN15_PAD_DRIVER_MSB 2 -#define GPIO_PIN15_PAD_DRIVER_LSB 2 -#define GPIO_PIN15_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN15_PAD_DRIVER_GET(x) (((x) & GPIO_PIN15_PAD_DRIVER_MASK) >> GPIO_PIN15_PAD_DRIVER_LSB) -#define GPIO_PIN15_PAD_DRIVER_SET(x) (((x) << GPIO_PIN15_PAD_DRIVER_LSB) & GPIO_PIN15_PAD_DRIVER_MASK) -#define GPIO_PIN15_SOURCE_MSB 0 -#define GPIO_PIN15_SOURCE_LSB 0 -#define GPIO_PIN15_SOURCE_MASK 0x00000001 -#define GPIO_PIN15_SOURCE_GET(x) (((x) & GPIO_PIN15_SOURCE_MASK) >> GPIO_PIN15_SOURCE_LSB) -#define GPIO_PIN15_SOURCE_SET(x) (((x) << GPIO_PIN15_SOURCE_LSB) & GPIO_PIN15_SOURCE_MASK) - -#define GPIO_PIN16_ADDRESS 0x00000068 -#define GPIO_PIN16_OFFSET 0x00000068 -#define GPIO_PIN16_CONFIG_MSB 12 -#define GPIO_PIN16_CONFIG_LSB 11 -#define GPIO_PIN16_CONFIG_MASK 0x00001800 -#define GPIO_PIN16_CONFIG_GET(x) (((x) & GPIO_PIN16_CONFIG_MASK) >> GPIO_PIN16_CONFIG_LSB) -#define GPIO_PIN16_CONFIG_SET(x) (((x) << GPIO_PIN16_CONFIG_LSB) & GPIO_PIN16_CONFIG_MASK) -#define GPIO_PIN16_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN16_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN16_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN16_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN16_WAKEUP_ENABLE_MASK) >> GPIO_PIN16_WAKEUP_ENABLE_LSB) -#define GPIO_PIN16_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN16_WAKEUP_ENABLE_LSB) & GPIO_PIN16_WAKEUP_ENABLE_MASK) -#define GPIO_PIN16_INT_TYPE_MSB 9 -#define GPIO_PIN16_INT_TYPE_LSB 7 -#define GPIO_PIN16_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN16_INT_TYPE_GET(x) (((x) & GPIO_PIN16_INT_TYPE_MASK) >> GPIO_PIN16_INT_TYPE_LSB) -#define GPIO_PIN16_INT_TYPE_SET(x) (((x) << GPIO_PIN16_INT_TYPE_LSB) & GPIO_PIN16_INT_TYPE_MASK) -#define GPIO_PIN16_PAD_DRIVER_MSB 2 -#define GPIO_PIN16_PAD_DRIVER_LSB 2 -#define GPIO_PIN16_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN16_PAD_DRIVER_GET(x) (((x) & GPIO_PIN16_PAD_DRIVER_MASK) >> GPIO_PIN16_PAD_DRIVER_LSB) -#define GPIO_PIN16_PAD_DRIVER_SET(x) (((x) << GPIO_PIN16_PAD_DRIVER_LSB) & GPIO_PIN16_PAD_DRIVER_MASK) -#define GPIO_PIN16_SOURCE_MSB 0 -#define GPIO_PIN16_SOURCE_LSB 0 -#define GPIO_PIN16_SOURCE_MASK 0x00000001 -#define GPIO_PIN16_SOURCE_GET(x) (((x) & GPIO_PIN16_SOURCE_MASK) >> GPIO_PIN16_SOURCE_LSB) -#define GPIO_PIN16_SOURCE_SET(x) (((x) << GPIO_PIN16_SOURCE_LSB) & GPIO_PIN16_SOURCE_MASK) - -#define GPIO_PIN17_ADDRESS 0x0000006c -#define GPIO_PIN17_OFFSET 0x0000006c -#define GPIO_PIN17_CONFIG_MSB 12 -#define GPIO_PIN17_CONFIG_LSB 11 -#define GPIO_PIN17_CONFIG_MASK 0x00001800 -#define GPIO_PIN17_CONFIG_GET(x) (((x) & GPIO_PIN17_CONFIG_MASK) >> GPIO_PIN17_CONFIG_LSB) -#define GPIO_PIN17_CONFIG_SET(x) (((x) << GPIO_PIN17_CONFIG_LSB) & GPIO_PIN17_CONFIG_MASK) -#define GPIO_PIN17_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN17_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN17_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN17_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN17_WAKEUP_ENABLE_MASK) >> GPIO_PIN17_WAKEUP_ENABLE_LSB) -#define GPIO_PIN17_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN17_WAKEUP_ENABLE_LSB) & GPIO_PIN17_WAKEUP_ENABLE_MASK) -#define GPIO_PIN17_INT_TYPE_MSB 9 -#define GPIO_PIN17_INT_TYPE_LSB 7 -#define GPIO_PIN17_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN17_INT_TYPE_GET(x) (((x) & GPIO_PIN17_INT_TYPE_MASK) >> GPIO_PIN17_INT_TYPE_LSB) -#define GPIO_PIN17_INT_TYPE_SET(x) (((x) << GPIO_PIN17_INT_TYPE_LSB) & GPIO_PIN17_INT_TYPE_MASK) -#define GPIO_PIN17_PAD_DRIVER_MSB 2 -#define GPIO_PIN17_PAD_DRIVER_LSB 2 -#define GPIO_PIN17_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN17_PAD_DRIVER_GET(x) (((x) & GPIO_PIN17_PAD_DRIVER_MASK) >> GPIO_PIN17_PAD_DRIVER_LSB) -#define GPIO_PIN17_PAD_DRIVER_SET(x) (((x) << GPIO_PIN17_PAD_DRIVER_LSB) & GPIO_PIN17_PAD_DRIVER_MASK) -#define GPIO_PIN17_SOURCE_MSB 0 -#define GPIO_PIN17_SOURCE_LSB 0 -#define GPIO_PIN17_SOURCE_MASK 0x00000001 -#define GPIO_PIN17_SOURCE_GET(x) (((x) & GPIO_PIN17_SOURCE_MASK) >> GPIO_PIN17_SOURCE_LSB) -#define GPIO_PIN17_SOURCE_SET(x) (((x) << GPIO_PIN17_SOURCE_LSB) & GPIO_PIN17_SOURCE_MASK) - -#define SDIO_PIN_ADDRESS 0x00000070 -#define SDIO_PIN_OFFSET 0x00000070 -#define SDIO_PIN_PAD_PULL_MSB 3 -#define SDIO_PIN_PAD_PULL_LSB 2 -#define SDIO_PIN_PAD_PULL_MASK 0x0000000c -#define SDIO_PIN_PAD_PULL_GET(x) (((x) & SDIO_PIN_PAD_PULL_MASK) >> SDIO_PIN_PAD_PULL_LSB) -#define SDIO_PIN_PAD_PULL_SET(x) (((x) << SDIO_PIN_PAD_PULL_LSB) & SDIO_PIN_PAD_PULL_MASK) -#define SDIO_PIN_PAD_STRENGTH_MSB 1 -#define SDIO_PIN_PAD_STRENGTH_LSB 0 -#define SDIO_PIN_PAD_STRENGTH_MASK 0x00000003 -#define SDIO_PIN_PAD_STRENGTH_GET(x) (((x) & SDIO_PIN_PAD_STRENGTH_MASK) >> SDIO_PIN_PAD_STRENGTH_LSB) -#define SDIO_PIN_PAD_STRENGTH_SET(x) (((x) << SDIO_PIN_PAD_STRENGTH_LSB) & SDIO_PIN_PAD_STRENGTH_MASK) - -#define CLK_REQ_PIN_ADDRESS 0x00000074 -#define CLK_REQ_PIN_OFFSET 0x00000074 -#define CLK_REQ_PIN_ATE_OE_L_MSB 4 -#define CLK_REQ_PIN_ATE_OE_L_LSB 4 -#define CLK_REQ_PIN_ATE_OE_L_MASK 0x00000010 -#define CLK_REQ_PIN_ATE_OE_L_GET(x) (((x) & CLK_REQ_PIN_ATE_OE_L_MASK) >> CLK_REQ_PIN_ATE_OE_L_LSB) -#define CLK_REQ_PIN_ATE_OE_L_SET(x) (((x) << CLK_REQ_PIN_ATE_OE_L_LSB) & CLK_REQ_PIN_ATE_OE_L_MASK) -#define CLK_REQ_PIN_PAD_PULL_MSB 3 -#define CLK_REQ_PIN_PAD_PULL_LSB 2 -#define CLK_REQ_PIN_PAD_PULL_MASK 0x0000000c -#define CLK_REQ_PIN_PAD_PULL_GET(x) (((x) & CLK_REQ_PIN_PAD_PULL_MASK) >> CLK_REQ_PIN_PAD_PULL_LSB) -#define CLK_REQ_PIN_PAD_PULL_SET(x) (((x) << CLK_REQ_PIN_PAD_PULL_LSB) & CLK_REQ_PIN_PAD_PULL_MASK) -#define CLK_REQ_PIN_PAD_STRENGTH_MSB 1 -#define CLK_REQ_PIN_PAD_STRENGTH_LSB 0 -#define CLK_REQ_PIN_PAD_STRENGTH_MASK 0x00000003 -#define CLK_REQ_PIN_PAD_STRENGTH_GET(x) (((x) & CLK_REQ_PIN_PAD_STRENGTH_MASK) >> CLK_REQ_PIN_PAD_STRENGTH_LSB) -#define CLK_REQ_PIN_PAD_STRENGTH_SET(x) (((x) << CLK_REQ_PIN_PAD_STRENGTH_LSB) & CLK_REQ_PIN_PAD_STRENGTH_MASK) - -#define SIGMA_DELTA_ADDRESS 0x00000078 -#define SIGMA_DELTA_OFFSET 0x00000078 -#define SIGMA_DELTA_ENABLE_MSB 16 -#define SIGMA_DELTA_ENABLE_LSB 16 -#define SIGMA_DELTA_ENABLE_MASK 0x00010000 -#define SIGMA_DELTA_ENABLE_GET(x) (((x) & SIGMA_DELTA_ENABLE_MASK) >> SIGMA_DELTA_ENABLE_LSB) -#define SIGMA_DELTA_ENABLE_SET(x) (((x) << SIGMA_DELTA_ENABLE_LSB) & SIGMA_DELTA_ENABLE_MASK) -#define SIGMA_DELTA_PRESCALAR_MSB 15 -#define SIGMA_DELTA_PRESCALAR_LSB 8 -#define SIGMA_DELTA_PRESCALAR_MASK 0x0000ff00 -#define SIGMA_DELTA_PRESCALAR_GET(x) (((x) & SIGMA_DELTA_PRESCALAR_MASK) >> SIGMA_DELTA_PRESCALAR_LSB) -#define SIGMA_DELTA_PRESCALAR_SET(x) (((x) << SIGMA_DELTA_PRESCALAR_LSB) & SIGMA_DELTA_PRESCALAR_MASK) -#define SIGMA_DELTA_TARGET_MSB 7 -#define SIGMA_DELTA_TARGET_LSB 0 -#define SIGMA_DELTA_TARGET_MASK 0x000000ff -#define SIGMA_DELTA_TARGET_GET(x) (((x) & SIGMA_DELTA_TARGET_MASK) >> SIGMA_DELTA_TARGET_LSB) -#define SIGMA_DELTA_TARGET_SET(x) (((x) << SIGMA_DELTA_TARGET_LSB) & SIGMA_DELTA_TARGET_MASK) - -#define DEBUG_CONTROL_ADDRESS 0x0000007c -#define DEBUG_CONTROL_OFFSET 0x0000007c -#define DEBUG_CONTROL_OBS_OE_L_MSB 1 -#define DEBUG_CONTROL_OBS_OE_L_LSB 1 -#define DEBUG_CONTROL_OBS_OE_L_MASK 0x00000002 -#define DEBUG_CONTROL_OBS_OE_L_GET(x) (((x) & DEBUG_CONTROL_OBS_OE_L_MASK) >> DEBUG_CONTROL_OBS_OE_L_LSB) -#define DEBUG_CONTROL_OBS_OE_L_SET(x) (((x) << DEBUG_CONTROL_OBS_OE_L_LSB) & DEBUG_CONTROL_OBS_OE_L_MASK) -#define DEBUG_CONTROL_ENABLE_MSB 0 -#define DEBUG_CONTROL_ENABLE_LSB 0 -#define DEBUG_CONTROL_ENABLE_MASK 0x00000001 -#define DEBUG_CONTROL_ENABLE_GET(x) (((x) & DEBUG_CONTROL_ENABLE_MASK) >> DEBUG_CONTROL_ENABLE_LSB) -#define DEBUG_CONTROL_ENABLE_SET(x) (((x) << DEBUG_CONTROL_ENABLE_LSB) & DEBUG_CONTROL_ENABLE_MASK) - -#define DEBUG_INPUT_SEL_ADDRESS 0x00000080 -#define DEBUG_INPUT_SEL_OFFSET 0x00000080 -#define DEBUG_INPUT_SEL_SRC_MSB 3 -#define DEBUG_INPUT_SEL_SRC_LSB 0 -#define DEBUG_INPUT_SEL_SRC_MASK 0x0000000f -#define DEBUG_INPUT_SEL_SRC_GET(x) (((x) & DEBUG_INPUT_SEL_SRC_MASK) >> DEBUG_INPUT_SEL_SRC_LSB) -#define DEBUG_INPUT_SEL_SRC_SET(x) (((x) << DEBUG_INPUT_SEL_SRC_LSB) & DEBUG_INPUT_SEL_SRC_MASK) - -#define DEBUG_OUT_ADDRESS 0x00000084 -#define DEBUG_OUT_OFFSET 0x00000084 -#define DEBUG_OUT_DATA_MSB 17 -#define DEBUG_OUT_DATA_LSB 0 -#define DEBUG_OUT_DATA_MASK 0x0003ffff -#define DEBUG_OUT_DATA_GET(x) (((x) & DEBUG_OUT_DATA_MASK) >> DEBUG_OUT_DATA_LSB) -#define DEBUG_OUT_DATA_SET(x) (((x) << DEBUG_OUT_DATA_LSB) & DEBUG_OUT_DATA_MASK) - -#define LA_CONTROL_ADDRESS 0x00000088 -#define LA_CONTROL_OFFSET 0x00000088 -#define LA_CONTROL_RUN_MSB 1 -#define LA_CONTROL_RUN_LSB 1 -#define LA_CONTROL_RUN_MASK 0x00000002 -#define LA_CONTROL_RUN_GET(x) (((x) & LA_CONTROL_RUN_MASK) >> LA_CONTROL_RUN_LSB) -#define LA_CONTROL_RUN_SET(x) (((x) << LA_CONTROL_RUN_LSB) & LA_CONTROL_RUN_MASK) -#define LA_CONTROL_TRIGGERED_MSB 0 -#define LA_CONTROL_TRIGGERED_LSB 0 -#define LA_CONTROL_TRIGGERED_MASK 0x00000001 -#define LA_CONTROL_TRIGGERED_GET(x) (((x) & LA_CONTROL_TRIGGERED_MASK) >> LA_CONTROL_TRIGGERED_LSB) -#define LA_CONTROL_TRIGGERED_SET(x) (((x) << LA_CONTROL_TRIGGERED_LSB) & LA_CONTROL_TRIGGERED_MASK) - -#define LA_CLOCK_ADDRESS 0x0000008c -#define LA_CLOCK_OFFSET 0x0000008c -#define LA_CLOCK_DIV_MSB 7 -#define LA_CLOCK_DIV_LSB 0 -#define LA_CLOCK_DIV_MASK 0x000000ff -#define LA_CLOCK_DIV_GET(x) (((x) & LA_CLOCK_DIV_MASK) >> LA_CLOCK_DIV_LSB) -#define LA_CLOCK_DIV_SET(x) (((x) << LA_CLOCK_DIV_LSB) & LA_CLOCK_DIV_MASK) - -#define LA_STATUS_ADDRESS 0x00000090 -#define LA_STATUS_OFFSET 0x00000090 -#define LA_STATUS_INTERRUPT_MSB 0 -#define LA_STATUS_INTERRUPT_LSB 0 -#define LA_STATUS_INTERRUPT_MASK 0x00000001 -#define LA_STATUS_INTERRUPT_GET(x) (((x) & LA_STATUS_INTERRUPT_MASK) >> LA_STATUS_INTERRUPT_LSB) -#define LA_STATUS_INTERRUPT_SET(x) (((x) << LA_STATUS_INTERRUPT_LSB) & LA_STATUS_INTERRUPT_MASK) - -#define LA_TRIGGER_SAMPLE_ADDRESS 0x00000094 -#define LA_TRIGGER_SAMPLE_OFFSET 0x00000094 -#define LA_TRIGGER_SAMPLE_COUNT_MSB 15 -#define LA_TRIGGER_SAMPLE_COUNT_LSB 0 -#define LA_TRIGGER_SAMPLE_COUNT_MASK 0x0000ffff -#define LA_TRIGGER_SAMPLE_COUNT_GET(x) (((x) & LA_TRIGGER_SAMPLE_COUNT_MASK) >> LA_TRIGGER_SAMPLE_COUNT_LSB) -#define LA_TRIGGER_SAMPLE_COUNT_SET(x) (((x) << LA_TRIGGER_SAMPLE_COUNT_LSB) & LA_TRIGGER_SAMPLE_COUNT_MASK) - -#define LA_TRIGGER_POSITION_ADDRESS 0x00000098 -#define LA_TRIGGER_POSITION_OFFSET 0x00000098 -#define LA_TRIGGER_POSITION_VALUE_MSB 15 -#define LA_TRIGGER_POSITION_VALUE_LSB 0 -#define LA_TRIGGER_POSITION_VALUE_MASK 0x0000ffff -#define LA_TRIGGER_POSITION_VALUE_GET(x) (((x) & LA_TRIGGER_POSITION_VALUE_MASK) >> LA_TRIGGER_POSITION_VALUE_LSB) -#define LA_TRIGGER_POSITION_VALUE_SET(x) (((x) << LA_TRIGGER_POSITION_VALUE_LSB) & LA_TRIGGER_POSITION_VALUE_MASK) - -#define LA_PRE_TRIGGER_ADDRESS 0x0000009c -#define LA_PRE_TRIGGER_OFFSET 0x0000009c -#define LA_PRE_TRIGGER_COUNT_MSB 15 -#define LA_PRE_TRIGGER_COUNT_LSB 0 -#define LA_PRE_TRIGGER_COUNT_MASK 0x0000ffff -#define LA_PRE_TRIGGER_COUNT_GET(x) (((x) & LA_PRE_TRIGGER_COUNT_MASK) >> LA_PRE_TRIGGER_COUNT_LSB) -#define LA_PRE_TRIGGER_COUNT_SET(x) (((x) << LA_PRE_TRIGGER_COUNT_LSB) & LA_PRE_TRIGGER_COUNT_MASK) - -#define LA_POST_TRIGGER_ADDRESS 0x000000a0 -#define LA_POST_TRIGGER_OFFSET 0x000000a0 -#define LA_POST_TRIGGER_COUNT_MSB 15 -#define LA_POST_TRIGGER_COUNT_LSB 0 -#define LA_POST_TRIGGER_COUNT_MASK 0x0000ffff -#define LA_POST_TRIGGER_COUNT_GET(x) (((x) & LA_POST_TRIGGER_COUNT_MASK) >> LA_POST_TRIGGER_COUNT_LSB) -#define LA_POST_TRIGGER_COUNT_SET(x) (((x) << LA_POST_TRIGGER_COUNT_LSB) & LA_POST_TRIGGER_COUNT_MASK) - -#define LA_FILTER_CONTROL_ADDRESS 0x000000a4 -#define LA_FILTER_CONTROL_OFFSET 0x000000a4 -#define LA_FILTER_CONTROL_DELTA_MSB 0 -#define LA_FILTER_CONTROL_DELTA_LSB 0 -#define LA_FILTER_CONTROL_DELTA_MASK 0x00000001 -#define LA_FILTER_CONTROL_DELTA_GET(x) (((x) & LA_FILTER_CONTROL_DELTA_MASK) >> LA_FILTER_CONTROL_DELTA_LSB) -#define LA_FILTER_CONTROL_DELTA_SET(x) (((x) << LA_FILTER_CONTROL_DELTA_LSB) & LA_FILTER_CONTROL_DELTA_MASK) - -#define LA_FILTER_DATA_ADDRESS 0x000000a8 -#define LA_FILTER_DATA_OFFSET 0x000000a8 -#define LA_FILTER_DATA_MATCH_MSB 17 -#define LA_FILTER_DATA_MATCH_LSB 0 -#define LA_FILTER_DATA_MATCH_MASK 0x0003ffff -#define LA_FILTER_DATA_MATCH_GET(x) (((x) & LA_FILTER_DATA_MATCH_MASK) >> LA_FILTER_DATA_MATCH_LSB) -#define LA_FILTER_DATA_MATCH_SET(x) (((x) << LA_FILTER_DATA_MATCH_LSB) & LA_FILTER_DATA_MATCH_MASK) - -#define LA_FILTER_WILDCARD_ADDRESS 0x000000ac -#define LA_FILTER_WILDCARD_OFFSET 0x000000ac -#define LA_FILTER_WILDCARD_MATCH_MSB 17 -#define LA_FILTER_WILDCARD_MATCH_LSB 0 -#define LA_FILTER_WILDCARD_MATCH_MASK 0x0003ffff -#define LA_FILTER_WILDCARD_MATCH_GET(x) (((x) & LA_FILTER_WILDCARD_MATCH_MASK) >> LA_FILTER_WILDCARD_MATCH_LSB) -#define LA_FILTER_WILDCARD_MATCH_SET(x) (((x) << LA_FILTER_WILDCARD_MATCH_LSB) & LA_FILTER_WILDCARD_MATCH_MASK) - -#define LA_TRIGGERA_DATA_ADDRESS 0x000000b0 -#define LA_TRIGGERA_DATA_OFFSET 0x000000b0 -#define LA_TRIGGERA_DATA_MATCH_MSB 17 -#define LA_TRIGGERA_DATA_MATCH_LSB 0 -#define LA_TRIGGERA_DATA_MATCH_MASK 0x0003ffff -#define LA_TRIGGERA_DATA_MATCH_GET(x) (((x) & LA_TRIGGERA_DATA_MATCH_MASK) >> LA_TRIGGERA_DATA_MATCH_LSB) -#define LA_TRIGGERA_DATA_MATCH_SET(x) (((x) << LA_TRIGGERA_DATA_MATCH_LSB) & LA_TRIGGERA_DATA_MATCH_MASK) - -#define LA_TRIGGERA_WILDCARD_ADDRESS 0x000000b4 -#define LA_TRIGGERA_WILDCARD_OFFSET 0x000000b4 -#define LA_TRIGGERA_WILDCARD_MATCH_MSB 17 -#define LA_TRIGGERA_WILDCARD_MATCH_LSB 0 -#define LA_TRIGGERA_WILDCARD_MATCH_MASK 0x0003ffff -#define LA_TRIGGERA_WILDCARD_MATCH_GET(x) (((x) & LA_TRIGGERA_WILDCARD_MATCH_MASK) >> LA_TRIGGERA_WILDCARD_MATCH_LSB) -#define LA_TRIGGERA_WILDCARD_MATCH_SET(x) (((x) << LA_TRIGGERA_WILDCARD_MATCH_LSB) & LA_TRIGGERA_WILDCARD_MATCH_MASK) - -#define LA_TRIGGERB_DATA_ADDRESS 0x000000b8 -#define LA_TRIGGERB_DATA_OFFSET 0x000000b8 -#define LA_TRIGGERB_DATA_MATCH_MSB 17 -#define LA_TRIGGERB_DATA_MATCH_LSB 0 -#define LA_TRIGGERB_DATA_MATCH_MASK 0x0003ffff -#define LA_TRIGGERB_DATA_MATCH_GET(x) (((x) & LA_TRIGGERB_DATA_MATCH_MASK) >> LA_TRIGGERB_DATA_MATCH_LSB) -#define LA_TRIGGERB_DATA_MATCH_SET(x) (((x) << LA_TRIGGERB_DATA_MATCH_LSB) & LA_TRIGGERB_DATA_MATCH_MASK) - -#define LA_TRIGGERB_WILDCARD_ADDRESS 0x000000bc -#define LA_TRIGGERB_WILDCARD_OFFSET 0x000000bc -#define LA_TRIGGERB_WILDCARD_MATCH_MSB 17 -#define LA_TRIGGERB_WILDCARD_MATCH_LSB 0 -#define LA_TRIGGERB_WILDCARD_MATCH_MASK 0x0003ffff -#define LA_TRIGGERB_WILDCARD_MATCH_GET(x) (((x) & LA_TRIGGERB_WILDCARD_MATCH_MASK) >> LA_TRIGGERB_WILDCARD_MATCH_LSB) -#define LA_TRIGGERB_WILDCARD_MATCH_SET(x) (((x) << LA_TRIGGERB_WILDCARD_MATCH_LSB) & LA_TRIGGERB_WILDCARD_MATCH_MASK) - -#define LA_TRIGGER_ADDRESS 0x000000c0 -#define LA_TRIGGER_OFFSET 0x000000c0 -#define LA_TRIGGER_EVENT_MSB 2 -#define LA_TRIGGER_EVENT_LSB 0 -#define LA_TRIGGER_EVENT_MASK 0x00000007 -#define LA_TRIGGER_EVENT_GET(x) (((x) & LA_TRIGGER_EVENT_MASK) >> LA_TRIGGER_EVENT_LSB) -#define LA_TRIGGER_EVENT_SET(x) (((x) << LA_TRIGGER_EVENT_LSB) & LA_TRIGGER_EVENT_MASK) - -#define LA_FIFO_ADDRESS 0x000000c4 -#define LA_FIFO_OFFSET 0x000000c4 -#define LA_FIFO_FULL_MSB 1 -#define LA_FIFO_FULL_LSB 1 -#define LA_FIFO_FULL_MASK 0x00000002 -#define LA_FIFO_FULL_GET(x) (((x) & LA_FIFO_FULL_MASK) >> LA_FIFO_FULL_LSB) -#define LA_FIFO_FULL_SET(x) (((x) << LA_FIFO_FULL_LSB) & LA_FIFO_FULL_MASK) -#define LA_FIFO_EMPTY_MSB 0 -#define LA_FIFO_EMPTY_LSB 0 -#define LA_FIFO_EMPTY_MASK 0x00000001 -#define LA_FIFO_EMPTY_GET(x) (((x) & LA_FIFO_EMPTY_MASK) >> LA_FIFO_EMPTY_LSB) -#define LA_FIFO_EMPTY_SET(x) (((x) << LA_FIFO_EMPTY_LSB) & LA_FIFO_EMPTY_MASK) - -#define LA_ADDRESS 0x000000c8 -#define LA_OFFSET 0x000000c8 -#define LA_DATA_MSB 17 -#define LA_DATA_LSB 0 -#define LA_DATA_MASK 0x0003ffff -#define LA_DATA_GET(x) (((x) & LA_DATA_MASK) >> LA_DATA_LSB) -#define LA_DATA_SET(x) (((x) << LA_DATA_LSB) & LA_DATA_MASK) - -#define ANT_PIN_ADDRESS 0x000000d0 -#define ANT_PIN_OFFSET 0x000000d0 -#define ANT_PIN_PAD_PULL_MSB 3 -#define ANT_PIN_PAD_PULL_LSB 2 -#define ANT_PIN_PAD_PULL_MASK 0x0000000c -#define ANT_PIN_PAD_PULL_GET(x) (((x) & ANT_PIN_PAD_PULL_MASK) >> ANT_PIN_PAD_PULL_LSB) -#define ANT_PIN_PAD_PULL_SET(x) (((x) << ANT_PIN_PAD_PULL_LSB) & ANT_PIN_PAD_PULL_MASK) -#define ANT_PIN_PAD_STRENGTH_MSB 1 -#define ANT_PIN_PAD_STRENGTH_LSB 0 -#define ANT_PIN_PAD_STRENGTH_MASK 0x00000003 -#define ANT_PIN_PAD_STRENGTH_GET(x) (((x) & ANT_PIN_PAD_STRENGTH_MASK) >> ANT_PIN_PAD_STRENGTH_LSB) -#define ANT_PIN_PAD_STRENGTH_SET(x) (((x) << ANT_PIN_PAD_STRENGTH_LSB) & ANT_PIN_PAD_STRENGTH_MASK) - -#define ANTD_PIN_ADDRESS 0x000000d4 -#define ANTD_PIN_OFFSET 0x000000d4 -#define ANTD_PIN_PAD_PULL_MSB 1 -#define ANTD_PIN_PAD_PULL_LSB 0 -#define ANTD_PIN_PAD_PULL_MASK 0x00000003 -#define ANTD_PIN_PAD_PULL_GET(x) (((x) & ANTD_PIN_PAD_PULL_MASK) >> ANTD_PIN_PAD_PULL_LSB) -#define ANTD_PIN_PAD_PULL_SET(x) (((x) << ANTD_PIN_PAD_PULL_LSB) & ANTD_PIN_PAD_PULL_MASK) - -#define GPIO_PIN_ADDRESS 0x000000d8 -#define GPIO_PIN_OFFSET 0x000000d8 -#define GPIO_PIN_PAD_PULL_MSB 3 -#define GPIO_PIN_PAD_PULL_LSB 2 -#define GPIO_PIN_PAD_PULL_MASK 0x0000000c -#define GPIO_PIN_PAD_PULL_GET(x) (((x) & GPIO_PIN_PAD_PULL_MASK) >> GPIO_PIN_PAD_PULL_LSB) -#define GPIO_PIN_PAD_PULL_SET(x) (((x) << GPIO_PIN_PAD_PULL_LSB) & GPIO_PIN_PAD_PULL_MASK) -#define GPIO_PIN_PAD_STRENGTH_MSB 1 -#define GPIO_PIN_PAD_STRENGTH_LSB 0 -#define GPIO_PIN_PAD_STRENGTH_MASK 0x00000003 -#define GPIO_PIN_PAD_STRENGTH_GET(x) (((x) & GPIO_PIN_PAD_STRENGTH_MASK) >> GPIO_PIN_PAD_STRENGTH_LSB) -#define GPIO_PIN_PAD_STRENGTH_SET(x) (((x) << GPIO_PIN_PAD_STRENGTH_LSB) & GPIO_PIN_PAD_STRENGTH_MASK) - -#define GPIO_H_PIN_ADDRESS 0x000000dc -#define GPIO_H_PIN_OFFSET 0x000000dc -#define GPIO_H_PIN_PAD_PULL_MSB 1 -#define GPIO_H_PIN_PAD_PULL_LSB 0 -#define GPIO_H_PIN_PAD_PULL_MASK 0x00000003 -#define GPIO_H_PIN_PAD_PULL_GET(x) (((x) & GPIO_H_PIN_PAD_PULL_MASK) >> GPIO_H_PIN_PAD_PULL_LSB) -#define GPIO_H_PIN_PAD_PULL_SET(x) (((x) << GPIO_H_PIN_PAD_PULL_LSB) & GPIO_H_PIN_PAD_PULL_MASK) - -#define BT_PIN_ADDRESS 0x000000e0 -#define BT_PIN_OFFSET 0x000000e0 -#define BT_PIN_PAD_PULL_MSB 3 -#define BT_PIN_PAD_PULL_LSB 2 -#define BT_PIN_PAD_PULL_MASK 0x0000000c -#define BT_PIN_PAD_PULL_GET(x) (((x) & BT_PIN_PAD_PULL_MASK) >> BT_PIN_PAD_PULL_LSB) -#define BT_PIN_PAD_PULL_SET(x) (((x) << BT_PIN_PAD_PULL_LSB) & BT_PIN_PAD_PULL_MASK) -#define BT_PIN_PAD_STRENGTH_MSB 1 -#define BT_PIN_PAD_STRENGTH_LSB 0 -#define BT_PIN_PAD_STRENGTH_MASK 0x00000003 -#define BT_PIN_PAD_STRENGTH_GET(x) (((x) & BT_PIN_PAD_STRENGTH_MASK) >> BT_PIN_PAD_STRENGTH_LSB) -#define BT_PIN_PAD_STRENGTH_SET(x) (((x) << BT_PIN_PAD_STRENGTH_LSB) & BT_PIN_PAD_STRENGTH_MASK) - -#define BT_WLAN_PIN_ADDRESS 0x000000e4 -#define BT_WLAN_PIN_OFFSET 0x000000e4 -#define BT_WLAN_PIN_PAD_PULL_MSB 1 -#define BT_WLAN_PIN_PAD_PULL_LSB 0 -#define BT_WLAN_PIN_PAD_PULL_MASK 0x00000003 -#define BT_WLAN_PIN_PAD_PULL_GET(x) (((x) & BT_WLAN_PIN_PAD_PULL_MASK) >> BT_WLAN_PIN_PAD_PULL_LSB) -#define BT_WLAN_PIN_PAD_PULL_SET(x) (((x) << BT_WLAN_PIN_PAD_PULL_LSB) & BT_WLAN_PIN_PAD_PULL_MASK) - -#define SI_UART_PIN_ADDRESS 0x000000e8 -#define SI_UART_PIN_OFFSET 0x000000e8 -#define SI_UART_PIN_PAD_PULL_MSB 3 -#define SI_UART_PIN_PAD_PULL_LSB 2 -#define SI_UART_PIN_PAD_PULL_MASK 0x0000000c -#define SI_UART_PIN_PAD_PULL_GET(x) (((x) & SI_UART_PIN_PAD_PULL_MASK) >> SI_UART_PIN_PAD_PULL_LSB) -#define SI_UART_PIN_PAD_PULL_SET(x) (((x) << SI_UART_PIN_PAD_PULL_LSB) & SI_UART_PIN_PAD_PULL_MASK) -#define SI_UART_PIN_PAD_STRENGTH_MSB 1 -#define SI_UART_PIN_PAD_STRENGTH_LSB 0 -#define SI_UART_PIN_PAD_STRENGTH_MASK 0x00000003 -#define SI_UART_PIN_PAD_STRENGTH_GET(x) (((x) & SI_UART_PIN_PAD_STRENGTH_MASK) >> SI_UART_PIN_PAD_STRENGTH_LSB) -#define SI_UART_PIN_PAD_STRENGTH_SET(x) (((x) << SI_UART_PIN_PAD_STRENGTH_LSB) & SI_UART_PIN_PAD_STRENGTH_MASK) - -#define CLK32K_PIN_ADDRESS 0x000000ec -#define CLK32K_PIN_OFFSET 0x000000ec -#define CLK32K_PIN_PAD_PULL_MSB 1 -#define CLK32K_PIN_PAD_PULL_LSB 0 -#define CLK32K_PIN_PAD_PULL_MASK 0x00000003 -#define CLK32K_PIN_PAD_PULL_GET(x) (((x) & CLK32K_PIN_PAD_PULL_MASK) >> CLK32K_PIN_PAD_PULL_LSB) -#define CLK32K_PIN_PAD_PULL_SET(x) (((x) << CLK32K_PIN_PAD_PULL_LSB) & CLK32K_PIN_PAD_PULL_MASK) - -#define RESET_TUPLE_STATUS_ADDRESS 0x000000f0 -#define RESET_TUPLE_STATUS_OFFSET 0x000000f0 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MSB 11 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB 8 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK 0x00000f00 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_GET(x) (((x) & RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK) >> RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB) -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_SET(x) (((x) << RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB) & RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK) -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MSB 7 -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB 0 -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK 0x000000ff -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_GET(x) (((x) & RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK) >> RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB) -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_SET(x) (((x) << RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB) & RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct gpio_reg_reg_s { - volatile unsigned int gpio_out; - volatile unsigned int gpio_out_w1ts; - volatile unsigned int gpio_out_w1tc; - volatile unsigned int gpio_enable; - volatile unsigned int gpio_enable_w1ts; - volatile unsigned int gpio_enable_w1tc; - volatile unsigned int gpio_in; - volatile unsigned int gpio_status; - volatile unsigned int gpio_status_w1ts; - volatile unsigned int gpio_status_w1tc; - volatile unsigned int gpio_pin0; - volatile unsigned int gpio_pin1; - volatile unsigned int gpio_pin2; - volatile unsigned int gpio_pin3; - volatile unsigned int gpio_pin4; - volatile unsigned int gpio_pin5; - volatile unsigned int gpio_pin6; - volatile unsigned int gpio_pin7; - volatile unsigned int gpio_pin8; - volatile unsigned int gpio_pin9; - volatile unsigned int gpio_pin10; - volatile unsigned int gpio_pin11; - volatile unsigned int gpio_pin12; - volatile unsigned int gpio_pin13; - volatile unsigned int gpio_pin14; - volatile unsigned int gpio_pin15; - volatile unsigned int gpio_pin16; - volatile unsigned int gpio_pin17; - volatile unsigned int sdio_pin; - volatile unsigned int clk_req_pin; - volatile unsigned int sigma_delta; - volatile unsigned int debug_control; - volatile unsigned int debug_input_sel; - volatile unsigned int debug_out; - volatile unsigned int la_control; - volatile unsigned int la_clock; - volatile unsigned int la_status; - volatile unsigned int la_trigger_sample; - volatile unsigned int la_trigger_position; - volatile unsigned int la_pre_trigger; - volatile unsigned int la_post_trigger; - volatile unsigned int la_filter_control; - volatile unsigned int la_filter_data; - volatile unsigned int la_filter_wildcard; - volatile unsigned int la_triggera_data; - volatile unsigned int la_triggera_wildcard; - volatile unsigned int la_triggerb_data; - volatile unsigned int la_triggerb_wildcard; - volatile unsigned int la_trigger; - volatile unsigned int la_fifo; - volatile unsigned int la[2]; - volatile unsigned int ant_pin; - volatile unsigned int antd_pin; - volatile unsigned int gpio_pin; - volatile unsigned int gpio_h_pin; - volatile unsigned int bt_pin; - volatile unsigned int bt_wlan_pin; - volatile unsigned int si_uart_pin; - volatile unsigned int clk32k_pin; - volatile unsigned int reset_tuple_status; -} gpio_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _GPIO_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/gpio_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/gpio_reg.vrh deleted file mode 100644 index 82a4f9a9ca00..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/gpio_reg.vrh +++ /dev/null @@ -1,1471 +0,0 @@ -#ifndef _GPIO_REG_VRH_ -#define _GPIO_REG_VRH_ - -#define GPIO_OUT_ADDRESS 'h00000000 -#define GPIO_OUT_DATA_MSB 17 -#define GPIO_OUT_DATA_LSB 0 -#define GPIO_OUT_DATA_MASK 'h0003ffff -#define GPIO_OUT_DATA_GET(x) (((x) & GPIO_OUT_DATA_MASK) >> GPIO_OUT_DATA_LSB) -#define GPIO_OUT_DATA_SET(x) (((32'd0 | (x)) << GPIO_OUT_DATA_LSB) & GPIO_OUT_DATA_MASK) -#define GPIO_OUT_DATA_RESET 18'h0 -#define GPIO_OUT_RESET (32'h0 | \ - GPIO_OUT_DATA_SET(GPIO_OUT_DATA_RESET)) -#define GPIO_OUT_HW_MASK (32'h0) -#define GPIO_OUT_SW_MASK (32'h0 | \ - GPIO_OUT_DATA_MASK) - -#define GPIO_OUT_W1TS_ADDRESS 'h00000004 -#define GPIO_OUT_W1TS_DATA_MSB 17 -#define GPIO_OUT_W1TS_DATA_LSB 0 -#define GPIO_OUT_W1TS_DATA_MASK 'h0003ffff -#define GPIO_OUT_W1TS_DATA_GET(x) (((x) & GPIO_OUT_W1TS_DATA_MASK) >> GPIO_OUT_W1TS_DATA_LSB) -#define GPIO_OUT_W1TS_DATA_SET(x) (((32'd0 | (x)) << GPIO_OUT_W1TS_DATA_LSB) & GPIO_OUT_W1TS_DATA_MASK) -#define GPIO_OUT_W1TS_DATA_RESET 18'h0 -#define GPIO_OUT_W1TS_RESET (32'h0 | \ - GPIO_OUT_W1TS_DATA_SET(GPIO_OUT_W1TS_DATA_RESET)) -#define GPIO_OUT_W1TS_HW_MASK (32'h0) -#define GPIO_OUT_W1TS_SW_MASK (32'h0 | \ - GPIO_OUT_W1TS_DATA_MASK) - -#define GPIO_OUT_W1TC_ADDRESS 'h00000008 -#define GPIO_OUT_W1TC_DATA_MSB 17 -#define GPIO_OUT_W1TC_DATA_LSB 0 -#define GPIO_OUT_W1TC_DATA_MASK 'h0003ffff -#define GPIO_OUT_W1TC_DATA_GET(x) (((x) & GPIO_OUT_W1TC_DATA_MASK) >> GPIO_OUT_W1TC_DATA_LSB) -#define GPIO_OUT_W1TC_DATA_SET(x) (((32'd0 | (x)) << GPIO_OUT_W1TC_DATA_LSB) & GPIO_OUT_W1TC_DATA_MASK) -#define GPIO_OUT_W1TC_DATA_RESET 18'h0 -#define GPIO_OUT_W1TC_RESET (32'h0 | \ - GPIO_OUT_W1TC_DATA_SET(GPIO_OUT_W1TC_DATA_RESET)) -#define GPIO_OUT_W1TC_HW_MASK (32'h0) -#define GPIO_OUT_W1TC_SW_MASK (32'h0 | \ - GPIO_OUT_W1TC_DATA_MASK) - -#define GPIO_ENABLE_ADDRESS 'h0000000c -#define GPIO_ENABLE_DATA_MSB 17 -#define GPIO_ENABLE_DATA_LSB 0 -#define GPIO_ENABLE_DATA_MASK 'h0003ffff -#define GPIO_ENABLE_DATA_GET(x) (((x) & GPIO_ENABLE_DATA_MASK) >> GPIO_ENABLE_DATA_LSB) -#define GPIO_ENABLE_DATA_SET(x) (((32'd0 | (x)) << GPIO_ENABLE_DATA_LSB) & GPIO_ENABLE_DATA_MASK) -#define GPIO_ENABLE_DATA_RESET 18'h0 -#define GPIO_ENABLE_RESET (32'h0 | \ - GPIO_ENABLE_DATA_SET(GPIO_ENABLE_DATA_RESET)) -#define GPIO_ENABLE_HW_MASK (32'h0) -#define GPIO_ENABLE_SW_MASK (32'h0 | \ - GPIO_ENABLE_DATA_MASK) - -#define GPIO_ENABLE_W1TS_ADDRESS 'h00000010 -#define GPIO_ENABLE_W1TS_DATA_MSB 17 -#define GPIO_ENABLE_W1TS_DATA_LSB 0 -#define GPIO_ENABLE_W1TS_DATA_MASK 'h0003ffff -#define GPIO_ENABLE_W1TS_DATA_GET(x) (((x) & GPIO_ENABLE_W1TS_DATA_MASK) >> GPIO_ENABLE_W1TS_DATA_LSB) -#define GPIO_ENABLE_W1TS_DATA_SET(x) (((32'd0 | (x)) << GPIO_ENABLE_W1TS_DATA_LSB) & GPIO_ENABLE_W1TS_DATA_MASK) -#define GPIO_ENABLE_W1TS_DATA_RESET 18'h0 -#define GPIO_ENABLE_W1TS_RESET (32'h0 | \ - GPIO_ENABLE_W1TS_DATA_SET(GPIO_ENABLE_W1TS_DATA_RESET)) -#define GPIO_ENABLE_W1TS_HW_MASK (32'h0) -#define GPIO_ENABLE_W1TS_SW_MASK (32'h0 | \ - GPIO_ENABLE_W1TS_DATA_MASK) - -#define GPIO_ENABLE_W1TC_ADDRESS 'h00000014 -#define GPIO_ENABLE_W1TC_DATA_MSB 17 -#define GPIO_ENABLE_W1TC_DATA_LSB 0 -#define GPIO_ENABLE_W1TC_DATA_MASK 'h0003ffff -#define GPIO_ENABLE_W1TC_DATA_GET(x) (((x) & GPIO_ENABLE_W1TC_DATA_MASK) >> GPIO_ENABLE_W1TC_DATA_LSB) -#define GPIO_ENABLE_W1TC_DATA_SET(x) (((32'd0 | (x)) << GPIO_ENABLE_W1TC_DATA_LSB) & GPIO_ENABLE_W1TC_DATA_MASK) -#define GPIO_ENABLE_W1TC_DATA_RESET 18'h0 -#define GPIO_ENABLE_W1TC_RESET (32'h0 | \ - GPIO_ENABLE_W1TC_DATA_SET(GPIO_ENABLE_W1TC_DATA_RESET)) -#define GPIO_ENABLE_W1TC_HW_MASK (32'h0) -#define GPIO_ENABLE_W1TC_SW_MASK (32'h0 | \ - GPIO_ENABLE_W1TC_DATA_MASK) - -#define GPIO_IN_ADDRESS 'h00000018 -#define GPIO_IN_DATA_MSB 17 -#define GPIO_IN_DATA_LSB 0 -#define GPIO_IN_DATA_MASK 'h0003ffff -#define GPIO_IN_DATA_GET(x) (((x) & GPIO_IN_DATA_MASK) >> GPIO_IN_DATA_LSB) -#define GPIO_IN_DATA_SET(x) (((32'd0 | (x)) << GPIO_IN_DATA_LSB) & GPIO_IN_DATA_MASK) -#define GPIO_IN_DATA_RESET 18'h0 -#define GPIO_IN_RESET (32'h0 | \ - GPIO_IN_DATA_SET(GPIO_IN_DATA_RESET)) -#define GPIO_IN_HW_MASK (32'h0 | \ - GPIO_IN_DATA_MASK) -#define GPIO_IN_SW_MASK (32'h0) - -#define GPIO_STATUS_ADDRESS 'h0000001c -#define GPIO_STATUS_INTERRUPT_MSB 17 -#define GPIO_STATUS_INTERRUPT_LSB 0 -#define GPIO_STATUS_INTERRUPT_MASK 'h0003ffff -#define GPIO_STATUS_INTERRUPT_GET(x) (((x) & GPIO_STATUS_INTERRUPT_MASK) >> GPIO_STATUS_INTERRUPT_LSB) -#define GPIO_STATUS_INTERRUPT_SET(x) (((32'd0 | (x)) << GPIO_STATUS_INTERRUPT_LSB) & GPIO_STATUS_INTERRUPT_MASK) -#define GPIO_STATUS_INTERRUPT_RESET 18'h0 -#define GPIO_STATUS_RESET (32'h0 | \ - GPIO_STATUS_INTERRUPT_SET(GPIO_STATUS_INTERRUPT_RESET)) -#define GPIO_STATUS_HW_MASK (32'h0 | \ - GPIO_STATUS_INTERRUPT_MASK) -#define GPIO_STATUS_SW_MASK (32'h0 | \ - GPIO_STATUS_INTERRUPT_MASK) - -#define GPIO_STATUS_W1TS_ADDRESS 'h00000020 -#define GPIO_STATUS_W1TS_INTERRUPT_MSB 17 -#define GPIO_STATUS_W1TS_INTERRUPT_LSB 0 -#define GPIO_STATUS_W1TS_INTERRUPT_MASK 'h0003ffff -#define GPIO_STATUS_W1TS_INTERRUPT_GET(x) (((x) & GPIO_STATUS_W1TS_INTERRUPT_MASK) >> GPIO_STATUS_W1TS_INTERRUPT_LSB) -#define GPIO_STATUS_W1TS_INTERRUPT_SET(x) (((32'd0 | (x)) << GPIO_STATUS_W1TS_INTERRUPT_LSB) & GPIO_STATUS_W1TS_INTERRUPT_MASK) -#define GPIO_STATUS_W1TS_INTERRUPT_RESET 18'h0 -#define GPIO_STATUS_W1TS_RESET (32'h0 | \ - GPIO_STATUS_W1TS_INTERRUPT_SET(GPIO_STATUS_W1TS_INTERRUPT_RESET)) -#define GPIO_STATUS_W1TS_HW_MASK (32'h0) -#define GPIO_STATUS_W1TS_SW_MASK (32'h0 | \ - GPIO_STATUS_W1TS_INTERRUPT_MASK) - -#define GPIO_STATUS_W1TC_ADDRESS 'h00000024 -#define GPIO_STATUS_W1TC_INTERRUPT_MSB 17 -#define GPIO_STATUS_W1TC_INTERRUPT_LSB 0 -#define GPIO_STATUS_W1TC_INTERRUPT_MASK 'h0003ffff -#define GPIO_STATUS_W1TC_INTERRUPT_GET(x) (((x) & GPIO_STATUS_W1TC_INTERRUPT_MASK) >> GPIO_STATUS_W1TC_INTERRUPT_LSB) -#define GPIO_STATUS_W1TC_INTERRUPT_SET(x) (((32'd0 | (x)) << GPIO_STATUS_W1TC_INTERRUPT_LSB) & GPIO_STATUS_W1TC_INTERRUPT_MASK) -#define GPIO_STATUS_W1TC_INTERRUPT_RESET 18'h0 -#define GPIO_STATUS_W1TC_RESET (32'h0 | \ - GPIO_STATUS_W1TC_INTERRUPT_SET(GPIO_STATUS_W1TC_INTERRUPT_RESET)) -#define GPIO_STATUS_W1TC_HW_MASK (32'h0) -#define GPIO_STATUS_W1TC_SW_MASK (32'h0 | \ - GPIO_STATUS_W1TC_INTERRUPT_MASK) - -#define GPIO_PIN0_ADDRESS 'h00000028 -#define GPIO_PIN0_CONFIG_MSB 12 -#define GPIO_PIN0_CONFIG_LSB 11 -#define GPIO_PIN0_CONFIG_MASK 'h00001800 -#define GPIO_PIN0_CONFIG_GET(x) (((x) & GPIO_PIN0_CONFIG_MASK) >> GPIO_PIN0_CONFIG_LSB) -#define GPIO_PIN0_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN0_CONFIG_LSB) & GPIO_PIN0_CONFIG_MASK) -#define GPIO_PIN0_CONFIG_RESET 2'h0 -#define GPIO_PIN0_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN0_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN0_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN0_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN0_WAKEUP_ENABLE_MASK) >> GPIO_PIN0_WAKEUP_ENABLE_LSB) -#define GPIO_PIN0_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN0_WAKEUP_ENABLE_LSB) & GPIO_PIN0_WAKEUP_ENABLE_MASK) -#define GPIO_PIN0_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN0_INT_TYPE_MSB 9 -#define GPIO_PIN0_INT_TYPE_LSB 7 -#define GPIO_PIN0_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN0_INT_TYPE_GET(x) (((x) & GPIO_PIN0_INT_TYPE_MASK) >> GPIO_PIN0_INT_TYPE_LSB) -#define GPIO_PIN0_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN0_INT_TYPE_LSB) & GPIO_PIN0_INT_TYPE_MASK) -#define GPIO_PIN0_INT_TYPE_RESET 3'h0 -#define GPIO_PIN0_PAD_DRIVER_MSB 2 -#define GPIO_PIN0_PAD_DRIVER_LSB 2 -#define GPIO_PIN0_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN0_PAD_DRIVER_GET(x) (((x) & GPIO_PIN0_PAD_DRIVER_MASK) >> GPIO_PIN0_PAD_DRIVER_LSB) -#define GPIO_PIN0_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN0_PAD_DRIVER_LSB) & GPIO_PIN0_PAD_DRIVER_MASK) -#define GPIO_PIN0_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN0_SOURCE_MSB 0 -#define GPIO_PIN0_SOURCE_LSB 0 -#define GPIO_PIN0_SOURCE_MASK 'h00000001 -#define GPIO_PIN0_SOURCE_GET(x) (((x) & GPIO_PIN0_SOURCE_MASK) >> GPIO_PIN0_SOURCE_LSB) -#define GPIO_PIN0_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN0_SOURCE_LSB) & GPIO_PIN0_SOURCE_MASK) -#define GPIO_PIN0_SOURCE_RESET 1'h0 -#define GPIO_PIN0_RESET (32'h0 | \ - GPIO_PIN0_CONFIG_SET(GPIO_PIN0_CONFIG_RESET) | \ - GPIO_PIN0_WAKEUP_ENABLE_SET(GPIO_PIN0_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN0_INT_TYPE_SET(GPIO_PIN0_INT_TYPE_RESET) | \ - GPIO_PIN0_PAD_DRIVER_SET(GPIO_PIN0_PAD_DRIVER_RESET) | \ - GPIO_PIN0_SOURCE_SET(GPIO_PIN0_SOURCE_RESET)) -#define GPIO_PIN0_HW_MASK (32'h0) -#define GPIO_PIN0_SW_MASK (32'h0 | \ - GPIO_PIN0_CONFIG_MASK | \ - GPIO_PIN0_WAKEUP_ENABLE_MASK | \ - GPIO_PIN0_INT_TYPE_MASK | \ - GPIO_PIN0_PAD_DRIVER_MASK | \ - GPIO_PIN0_SOURCE_MASK) - -#define GPIO_PIN1_ADDRESS 'h0000002c -#define GPIO_PIN1_CONFIG_MSB 12 -#define GPIO_PIN1_CONFIG_LSB 11 -#define GPIO_PIN1_CONFIG_MASK 'h00001800 -#define GPIO_PIN1_CONFIG_GET(x) (((x) & GPIO_PIN1_CONFIG_MASK) >> GPIO_PIN1_CONFIG_LSB) -#define GPIO_PIN1_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN1_CONFIG_LSB) & GPIO_PIN1_CONFIG_MASK) -#define GPIO_PIN1_CONFIG_RESET 2'h0 -#define GPIO_PIN1_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN1_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN1_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN1_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN1_WAKEUP_ENABLE_MASK) >> GPIO_PIN1_WAKEUP_ENABLE_LSB) -#define GPIO_PIN1_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN1_WAKEUP_ENABLE_LSB) & GPIO_PIN1_WAKEUP_ENABLE_MASK) -#define GPIO_PIN1_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN1_INT_TYPE_MSB 9 -#define GPIO_PIN1_INT_TYPE_LSB 7 -#define GPIO_PIN1_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN1_INT_TYPE_GET(x) (((x) & GPIO_PIN1_INT_TYPE_MASK) >> GPIO_PIN1_INT_TYPE_LSB) -#define GPIO_PIN1_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN1_INT_TYPE_LSB) & GPIO_PIN1_INT_TYPE_MASK) -#define GPIO_PIN1_INT_TYPE_RESET 3'h0 -#define GPIO_PIN1_PAD_DRIVER_MSB 2 -#define GPIO_PIN1_PAD_DRIVER_LSB 2 -#define GPIO_PIN1_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN1_PAD_DRIVER_GET(x) (((x) & GPIO_PIN1_PAD_DRIVER_MASK) >> GPIO_PIN1_PAD_DRIVER_LSB) -#define GPIO_PIN1_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN1_PAD_DRIVER_LSB) & GPIO_PIN1_PAD_DRIVER_MASK) -#define GPIO_PIN1_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN1_SOURCE_MSB 0 -#define GPIO_PIN1_SOURCE_LSB 0 -#define GPIO_PIN1_SOURCE_MASK 'h00000001 -#define GPIO_PIN1_SOURCE_GET(x) (((x) & GPIO_PIN1_SOURCE_MASK) >> GPIO_PIN1_SOURCE_LSB) -#define GPIO_PIN1_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN1_SOURCE_LSB) & GPIO_PIN1_SOURCE_MASK) -#define GPIO_PIN1_SOURCE_RESET 1'h0 -#define GPIO_PIN1_RESET (32'h0 | \ - GPIO_PIN1_CONFIG_SET(GPIO_PIN1_CONFIG_RESET) | \ - GPIO_PIN1_WAKEUP_ENABLE_SET(GPIO_PIN1_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN1_INT_TYPE_SET(GPIO_PIN1_INT_TYPE_RESET) | \ - GPIO_PIN1_PAD_DRIVER_SET(GPIO_PIN1_PAD_DRIVER_RESET) | \ - GPIO_PIN1_SOURCE_SET(GPIO_PIN1_SOURCE_RESET)) -#define GPIO_PIN1_HW_MASK (32'h0) -#define GPIO_PIN1_SW_MASK (32'h0 | \ - GPIO_PIN1_CONFIG_MASK | \ - GPIO_PIN1_WAKEUP_ENABLE_MASK | \ - GPIO_PIN1_INT_TYPE_MASK | \ - GPIO_PIN1_PAD_DRIVER_MASK | \ - GPIO_PIN1_SOURCE_MASK) - -#define GPIO_PIN2_ADDRESS 'h00000030 -#define GPIO_PIN2_CONFIG_MSB 12 -#define GPIO_PIN2_CONFIG_LSB 11 -#define GPIO_PIN2_CONFIG_MASK 'h00001800 -#define GPIO_PIN2_CONFIG_GET(x) (((x) & GPIO_PIN2_CONFIG_MASK) >> GPIO_PIN2_CONFIG_LSB) -#define GPIO_PIN2_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN2_CONFIG_LSB) & GPIO_PIN2_CONFIG_MASK) -#define GPIO_PIN2_CONFIG_RESET 2'h0 -#define GPIO_PIN2_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN2_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN2_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN2_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN2_WAKEUP_ENABLE_MASK) >> GPIO_PIN2_WAKEUP_ENABLE_LSB) -#define GPIO_PIN2_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN2_WAKEUP_ENABLE_LSB) & GPIO_PIN2_WAKEUP_ENABLE_MASK) -#define GPIO_PIN2_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN2_INT_TYPE_MSB 9 -#define GPIO_PIN2_INT_TYPE_LSB 7 -#define GPIO_PIN2_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN2_INT_TYPE_GET(x) (((x) & GPIO_PIN2_INT_TYPE_MASK) >> GPIO_PIN2_INT_TYPE_LSB) -#define GPIO_PIN2_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN2_INT_TYPE_LSB) & GPIO_PIN2_INT_TYPE_MASK) -#define GPIO_PIN2_INT_TYPE_RESET 3'h0 -#define GPIO_PIN2_PAD_DRIVER_MSB 2 -#define GPIO_PIN2_PAD_DRIVER_LSB 2 -#define GPIO_PIN2_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN2_PAD_DRIVER_GET(x) (((x) & GPIO_PIN2_PAD_DRIVER_MASK) >> GPIO_PIN2_PAD_DRIVER_LSB) -#define GPIO_PIN2_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN2_PAD_DRIVER_LSB) & GPIO_PIN2_PAD_DRIVER_MASK) -#define GPIO_PIN2_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN2_SOURCE_MSB 0 -#define GPIO_PIN2_SOURCE_LSB 0 -#define GPIO_PIN2_SOURCE_MASK 'h00000001 -#define GPIO_PIN2_SOURCE_GET(x) (((x) & GPIO_PIN2_SOURCE_MASK) >> GPIO_PIN2_SOURCE_LSB) -#define GPIO_PIN2_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN2_SOURCE_LSB) & GPIO_PIN2_SOURCE_MASK) -#define GPIO_PIN2_SOURCE_RESET 1'h0 -#define GPIO_PIN2_RESET (32'h0 | \ - GPIO_PIN2_CONFIG_SET(GPIO_PIN2_CONFIG_RESET) | \ - GPIO_PIN2_WAKEUP_ENABLE_SET(GPIO_PIN2_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN2_INT_TYPE_SET(GPIO_PIN2_INT_TYPE_RESET) | \ - GPIO_PIN2_PAD_DRIVER_SET(GPIO_PIN2_PAD_DRIVER_RESET) | \ - GPIO_PIN2_SOURCE_SET(GPIO_PIN2_SOURCE_RESET)) -#define GPIO_PIN2_HW_MASK (32'h0) -#define GPIO_PIN2_SW_MASK (32'h0 | \ - GPIO_PIN2_CONFIG_MASK | \ - GPIO_PIN2_WAKEUP_ENABLE_MASK | \ - GPIO_PIN2_INT_TYPE_MASK | \ - GPIO_PIN2_PAD_DRIVER_MASK | \ - GPIO_PIN2_SOURCE_MASK) - -#define GPIO_PIN3_ADDRESS 'h00000034 -#define GPIO_PIN3_CONFIG_MSB 12 -#define GPIO_PIN3_CONFIG_LSB 11 -#define GPIO_PIN3_CONFIG_MASK 'h00001800 -#define GPIO_PIN3_CONFIG_GET(x) (((x) & GPIO_PIN3_CONFIG_MASK) >> GPIO_PIN3_CONFIG_LSB) -#define GPIO_PIN3_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN3_CONFIG_LSB) & GPIO_PIN3_CONFIG_MASK) -#define GPIO_PIN3_CONFIG_RESET 2'h0 -#define GPIO_PIN3_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN3_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN3_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN3_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN3_WAKEUP_ENABLE_MASK) >> GPIO_PIN3_WAKEUP_ENABLE_LSB) -#define GPIO_PIN3_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN3_WAKEUP_ENABLE_LSB) & GPIO_PIN3_WAKEUP_ENABLE_MASK) -#define GPIO_PIN3_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN3_INT_TYPE_MSB 9 -#define GPIO_PIN3_INT_TYPE_LSB 7 -#define GPIO_PIN3_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN3_INT_TYPE_GET(x) (((x) & GPIO_PIN3_INT_TYPE_MASK) >> GPIO_PIN3_INT_TYPE_LSB) -#define GPIO_PIN3_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN3_INT_TYPE_LSB) & GPIO_PIN3_INT_TYPE_MASK) -#define GPIO_PIN3_INT_TYPE_RESET 3'h0 -#define GPIO_PIN3_PAD_DRIVER_MSB 2 -#define GPIO_PIN3_PAD_DRIVER_LSB 2 -#define GPIO_PIN3_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN3_PAD_DRIVER_GET(x) (((x) & GPIO_PIN3_PAD_DRIVER_MASK) >> GPIO_PIN3_PAD_DRIVER_LSB) -#define GPIO_PIN3_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN3_PAD_DRIVER_LSB) & GPIO_PIN3_PAD_DRIVER_MASK) -#define GPIO_PIN3_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN3_SOURCE_MSB 0 -#define GPIO_PIN3_SOURCE_LSB 0 -#define GPIO_PIN3_SOURCE_MASK 'h00000001 -#define GPIO_PIN3_SOURCE_GET(x) (((x) & GPIO_PIN3_SOURCE_MASK) >> GPIO_PIN3_SOURCE_LSB) -#define GPIO_PIN3_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN3_SOURCE_LSB) & GPIO_PIN3_SOURCE_MASK) -#define GPIO_PIN3_SOURCE_RESET 1'h0 -#define GPIO_PIN3_RESET (32'h0 | \ - GPIO_PIN3_CONFIG_SET(GPIO_PIN3_CONFIG_RESET) | \ - GPIO_PIN3_WAKEUP_ENABLE_SET(GPIO_PIN3_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN3_INT_TYPE_SET(GPIO_PIN3_INT_TYPE_RESET) | \ - GPIO_PIN3_PAD_DRIVER_SET(GPIO_PIN3_PAD_DRIVER_RESET) | \ - GPIO_PIN3_SOURCE_SET(GPIO_PIN3_SOURCE_RESET)) -#define GPIO_PIN3_HW_MASK (32'h0) -#define GPIO_PIN3_SW_MASK (32'h0 | \ - GPIO_PIN3_CONFIG_MASK | \ - GPIO_PIN3_WAKEUP_ENABLE_MASK | \ - GPIO_PIN3_INT_TYPE_MASK | \ - GPIO_PIN3_PAD_DRIVER_MASK | \ - GPIO_PIN3_SOURCE_MASK) - -#define GPIO_PIN4_ADDRESS 'h00000038 -#define GPIO_PIN4_CONFIG_MSB 12 -#define GPIO_PIN4_CONFIG_LSB 11 -#define GPIO_PIN4_CONFIG_MASK 'h00001800 -#define GPIO_PIN4_CONFIG_GET(x) (((x) & GPIO_PIN4_CONFIG_MASK) >> GPIO_PIN4_CONFIG_LSB) -#define GPIO_PIN4_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN4_CONFIG_LSB) & GPIO_PIN4_CONFIG_MASK) -#define GPIO_PIN4_CONFIG_RESET 2'h0 -#define GPIO_PIN4_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN4_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN4_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN4_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN4_WAKEUP_ENABLE_MASK) >> GPIO_PIN4_WAKEUP_ENABLE_LSB) -#define GPIO_PIN4_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN4_WAKEUP_ENABLE_LSB) & GPIO_PIN4_WAKEUP_ENABLE_MASK) -#define GPIO_PIN4_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN4_INT_TYPE_MSB 9 -#define GPIO_PIN4_INT_TYPE_LSB 7 -#define GPIO_PIN4_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN4_INT_TYPE_GET(x) (((x) & GPIO_PIN4_INT_TYPE_MASK) >> GPIO_PIN4_INT_TYPE_LSB) -#define GPIO_PIN4_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN4_INT_TYPE_LSB) & GPIO_PIN4_INT_TYPE_MASK) -#define GPIO_PIN4_INT_TYPE_RESET 3'h0 -#define GPIO_PIN4_PAD_DRIVER_MSB 2 -#define GPIO_PIN4_PAD_DRIVER_LSB 2 -#define GPIO_PIN4_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN4_PAD_DRIVER_GET(x) (((x) & GPIO_PIN4_PAD_DRIVER_MASK) >> GPIO_PIN4_PAD_DRIVER_LSB) -#define GPIO_PIN4_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN4_PAD_DRIVER_LSB) & GPIO_PIN4_PAD_DRIVER_MASK) -#define GPIO_PIN4_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN4_SOURCE_MSB 0 -#define GPIO_PIN4_SOURCE_LSB 0 -#define GPIO_PIN4_SOURCE_MASK 'h00000001 -#define GPIO_PIN4_SOURCE_GET(x) (((x) & GPIO_PIN4_SOURCE_MASK) >> GPIO_PIN4_SOURCE_LSB) -#define GPIO_PIN4_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN4_SOURCE_LSB) & GPIO_PIN4_SOURCE_MASK) -#define GPIO_PIN4_SOURCE_RESET 1'h0 -#define GPIO_PIN4_RESET (32'h0 | \ - GPIO_PIN4_CONFIG_SET(GPIO_PIN4_CONFIG_RESET) | \ - GPIO_PIN4_WAKEUP_ENABLE_SET(GPIO_PIN4_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN4_INT_TYPE_SET(GPIO_PIN4_INT_TYPE_RESET) | \ - GPIO_PIN4_PAD_DRIVER_SET(GPIO_PIN4_PAD_DRIVER_RESET) | \ - GPIO_PIN4_SOURCE_SET(GPIO_PIN4_SOURCE_RESET)) -#define GPIO_PIN4_HW_MASK (32'h0) -#define GPIO_PIN4_SW_MASK (32'h0 | \ - GPIO_PIN4_CONFIG_MASK | \ - GPIO_PIN4_WAKEUP_ENABLE_MASK | \ - GPIO_PIN4_INT_TYPE_MASK | \ - GPIO_PIN4_PAD_DRIVER_MASK | \ - GPIO_PIN4_SOURCE_MASK) - -#define GPIO_PIN5_ADDRESS 'h0000003c -#define GPIO_PIN5_CONFIG_MSB 12 -#define GPIO_PIN5_CONFIG_LSB 11 -#define GPIO_PIN5_CONFIG_MASK 'h00001800 -#define GPIO_PIN5_CONFIG_GET(x) (((x) & GPIO_PIN5_CONFIG_MASK) >> GPIO_PIN5_CONFIG_LSB) -#define GPIO_PIN5_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN5_CONFIG_LSB) & GPIO_PIN5_CONFIG_MASK) -#define GPIO_PIN5_CONFIG_RESET 2'h0 -#define GPIO_PIN5_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN5_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN5_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN5_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN5_WAKEUP_ENABLE_MASK) >> GPIO_PIN5_WAKEUP_ENABLE_LSB) -#define GPIO_PIN5_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN5_WAKEUP_ENABLE_LSB) & GPIO_PIN5_WAKEUP_ENABLE_MASK) -#define GPIO_PIN5_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN5_INT_TYPE_MSB 9 -#define GPIO_PIN5_INT_TYPE_LSB 7 -#define GPIO_PIN5_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN5_INT_TYPE_GET(x) (((x) & GPIO_PIN5_INT_TYPE_MASK) >> GPIO_PIN5_INT_TYPE_LSB) -#define GPIO_PIN5_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN5_INT_TYPE_LSB) & GPIO_PIN5_INT_TYPE_MASK) -#define GPIO_PIN5_INT_TYPE_RESET 3'h0 -#define GPIO_PIN5_PAD_DRIVER_MSB 2 -#define GPIO_PIN5_PAD_DRIVER_LSB 2 -#define GPIO_PIN5_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN5_PAD_DRIVER_GET(x) (((x) & GPIO_PIN5_PAD_DRIVER_MASK) >> GPIO_PIN5_PAD_DRIVER_LSB) -#define GPIO_PIN5_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN5_PAD_DRIVER_LSB) & GPIO_PIN5_PAD_DRIVER_MASK) -#define GPIO_PIN5_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN5_SOURCE_MSB 0 -#define GPIO_PIN5_SOURCE_LSB 0 -#define GPIO_PIN5_SOURCE_MASK 'h00000001 -#define GPIO_PIN5_SOURCE_GET(x) (((x) & GPIO_PIN5_SOURCE_MASK) >> GPIO_PIN5_SOURCE_LSB) -#define GPIO_PIN5_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN5_SOURCE_LSB) & GPIO_PIN5_SOURCE_MASK) -#define GPIO_PIN5_SOURCE_RESET 1'h0 -#define GPIO_PIN5_RESET (32'h0 | \ - GPIO_PIN5_CONFIG_SET(GPIO_PIN5_CONFIG_RESET) | \ - GPIO_PIN5_WAKEUP_ENABLE_SET(GPIO_PIN5_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN5_INT_TYPE_SET(GPIO_PIN5_INT_TYPE_RESET) | \ - GPIO_PIN5_PAD_DRIVER_SET(GPIO_PIN5_PAD_DRIVER_RESET) | \ - GPIO_PIN5_SOURCE_SET(GPIO_PIN5_SOURCE_RESET)) -#define GPIO_PIN5_HW_MASK (32'h0) -#define GPIO_PIN5_SW_MASK (32'h0 | \ - GPIO_PIN5_CONFIG_MASK | \ - GPIO_PIN5_WAKEUP_ENABLE_MASK | \ - GPIO_PIN5_INT_TYPE_MASK | \ - GPIO_PIN5_PAD_DRIVER_MASK | \ - GPIO_PIN5_SOURCE_MASK) - -#define GPIO_PIN6_ADDRESS 'h00000040 -#define GPIO_PIN6_CONFIG_MSB 12 -#define GPIO_PIN6_CONFIG_LSB 11 -#define GPIO_PIN6_CONFIG_MASK 'h00001800 -#define GPIO_PIN6_CONFIG_GET(x) (((x) & GPIO_PIN6_CONFIG_MASK) >> GPIO_PIN6_CONFIG_LSB) -#define GPIO_PIN6_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN6_CONFIG_LSB) & GPIO_PIN6_CONFIG_MASK) -#define GPIO_PIN6_CONFIG_RESET 2'h0 -#define GPIO_PIN6_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN6_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN6_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN6_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN6_WAKEUP_ENABLE_MASK) >> GPIO_PIN6_WAKEUP_ENABLE_LSB) -#define GPIO_PIN6_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN6_WAKEUP_ENABLE_LSB) & GPIO_PIN6_WAKEUP_ENABLE_MASK) -#define GPIO_PIN6_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN6_INT_TYPE_MSB 9 -#define GPIO_PIN6_INT_TYPE_LSB 7 -#define GPIO_PIN6_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN6_INT_TYPE_GET(x) (((x) & GPIO_PIN6_INT_TYPE_MASK) >> GPIO_PIN6_INT_TYPE_LSB) -#define GPIO_PIN6_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN6_INT_TYPE_LSB) & GPIO_PIN6_INT_TYPE_MASK) -#define GPIO_PIN6_INT_TYPE_RESET 3'h0 -#define GPIO_PIN6_PAD_DRIVER_MSB 2 -#define GPIO_PIN6_PAD_DRIVER_LSB 2 -#define GPIO_PIN6_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN6_PAD_DRIVER_GET(x) (((x) & GPIO_PIN6_PAD_DRIVER_MASK) >> GPIO_PIN6_PAD_DRIVER_LSB) -#define GPIO_PIN6_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN6_PAD_DRIVER_LSB) & GPIO_PIN6_PAD_DRIVER_MASK) -#define GPIO_PIN6_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN6_SOURCE_MSB 0 -#define GPIO_PIN6_SOURCE_LSB 0 -#define GPIO_PIN6_SOURCE_MASK 'h00000001 -#define GPIO_PIN6_SOURCE_GET(x) (((x) & GPIO_PIN6_SOURCE_MASK) >> GPIO_PIN6_SOURCE_LSB) -#define GPIO_PIN6_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN6_SOURCE_LSB) & GPIO_PIN6_SOURCE_MASK) -#define GPIO_PIN6_SOURCE_RESET 1'h0 -#define GPIO_PIN6_RESET (32'h0 | \ - GPIO_PIN6_CONFIG_SET(GPIO_PIN6_CONFIG_RESET) | \ - GPIO_PIN6_WAKEUP_ENABLE_SET(GPIO_PIN6_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN6_INT_TYPE_SET(GPIO_PIN6_INT_TYPE_RESET) | \ - GPIO_PIN6_PAD_DRIVER_SET(GPIO_PIN6_PAD_DRIVER_RESET) | \ - GPIO_PIN6_SOURCE_SET(GPIO_PIN6_SOURCE_RESET)) -#define GPIO_PIN6_HW_MASK (32'h0) -#define GPIO_PIN6_SW_MASK (32'h0 | \ - GPIO_PIN6_CONFIG_MASK | \ - GPIO_PIN6_WAKEUP_ENABLE_MASK | \ - GPIO_PIN6_INT_TYPE_MASK | \ - GPIO_PIN6_PAD_DRIVER_MASK | \ - GPIO_PIN6_SOURCE_MASK) - -#define GPIO_PIN7_ADDRESS 'h00000044 -#define GPIO_PIN7_CONFIG_MSB 12 -#define GPIO_PIN7_CONFIG_LSB 11 -#define GPIO_PIN7_CONFIG_MASK 'h00001800 -#define GPIO_PIN7_CONFIG_GET(x) (((x) & GPIO_PIN7_CONFIG_MASK) >> GPIO_PIN7_CONFIG_LSB) -#define GPIO_PIN7_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN7_CONFIG_LSB) & GPIO_PIN7_CONFIG_MASK) -#define GPIO_PIN7_CONFIG_RESET 2'h0 -#define GPIO_PIN7_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN7_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN7_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN7_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN7_WAKEUP_ENABLE_MASK) >> GPIO_PIN7_WAKEUP_ENABLE_LSB) -#define GPIO_PIN7_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN7_WAKEUP_ENABLE_LSB) & GPIO_PIN7_WAKEUP_ENABLE_MASK) -#define GPIO_PIN7_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN7_INT_TYPE_MSB 9 -#define GPIO_PIN7_INT_TYPE_LSB 7 -#define GPIO_PIN7_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN7_INT_TYPE_GET(x) (((x) & GPIO_PIN7_INT_TYPE_MASK) >> GPIO_PIN7_INT_TYPE_LSB) -#define GPIO_PIN7_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN7_INT_TYPE_LSB) & GPIO_PIN7_INT_TYPE_MASK) -#define GPIO_PIN7_INT_TYPE_RESET 3'h0 -#define GPIO_PIN7_PAD_DRIVER_MSB 2 -#define GPIO_PIN7_PAD_DRIVER_LSB 2 -#define GPIO_PIN7_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN7_PAD_DRIVER_GET(x) (((x) & GPIO_PIN7_PAD_DRIVER_MASK) >> GPIO_PIN7_PAD_DRIVER_LSB) -#define GPIO_PIN7_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN7_PAD_DRIVER_LSB) & GPIO_PIN7_PAD_DRIVER_MASK) -#define GPIO_PIN7_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN7_SOURCE_MSB 0 -#define GPIO_PIN7_SOURCE_LSB 0 -#define GPIO_PIN7_SOURCE_MASK 'h00000001 -#define GPIO_PIN7_SOURCE_GET(x) (((x) & GPIO_PIN7_SOURCE_MASK) >> GPIO_PIN7_SOURCE_LSB) -#define GPIO_PIN7_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN7_SOURCE_LSB) & GPIO_PIN7_SOURCE_MASK) -#define GPIO_PIN7_SOURCE_RESET 1'h0 -#define GPIO_PIN7_RESET (32'h0 | \ - GPIO_PIN7_CONFIG_SET(GPIO_PIN7_CONFIG_RESET) | \ - GPIO_PIN7_WAKEUP_ENABLE_SET(GPIO_PIN7_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN7_INT_TYPE_SET(GPIO_PIN7_INT_TYPE_RESET) | \ - GPIO_PIN7_PAD_DRIVER_SET(GPIO_PIN7_PAD_DRIVER_RESET) | \ - GPIO_PIN7_SOURCE_SET(GPIO_PIN7_SOURCE_RESET)) -#define GPIO_PIN7_HW_MASK (32'h0) -#define GPIO_PIN7_SW_MASK (32'h0 | \ - GPIO_PIN7_CONFIG_MASK | \ - GPIO_PIN7_WAKEUP_ENABLE_MASK | \ - GPIO_PIN7_INT_TYPE_MASK | \ - GPIO_PIN7_PAD_DRIVER_MASK | \ - GPIO_PIN7_SOURCE_MASK) - -#define GPIO_PIN8_ADDRESS 'h00000048 -#define GPIO_PIN8_CONFIG_MSB 12 -#define GPIO_PIN8_CONFIG_LSB 11 -#define GPIO_PIN8_CONFIG_MASK 'h00001800 -#define GPIO_PIN8_CONFIG_GET(x) (((x) & GPIO_PIN8_CONFIG_MASK) >> GPIO_PIN8_CONFIG_LSB) -#define GPIO_PIN8_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN8_CONFIG_LSB) & GPIO_PIN8_CONFIG_MASK) -#define GPIO_PIN8_CONFIG_RESET 2'h0 -#define GPIO_PIN8_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN8_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN8_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN8_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN8_WAKEUP_ENABLE_MASK) >> GPIO_PIN8_WAKEUP_ENABLE_LSB) -#define GPIO_PIN8_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN8_WAKEUP_ENABLE_LSB) & GPIO_PIN8_WAKEUP_ENABLE_MASK) -#define GPIO_PIN8_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN8_INT_TYPE_MSB 9 -#define GPIO_PIN8_INT_TYPE_LSB 7 -#define GPIO_PIN8_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN8_INT_TYPE_GET(x) (((x) & GPIO_PIN8_INT_TYPE_MASK) >> GPIO_PIN8_INT_TYPE_LSB) -#define GPIO_PIN8_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN8_INT_TYPE_LSB) & GPIO_PIN8_INT_TYPE_MASK) -#define GPIO_PIN8_INT_TYPE_RESET 3'h0 -#define GPIO_PIN8_PAD_DRIVER_MSB 2 -#define GPIO_PIN8_PAD_DRIVER_LSB 2 -#define GPIO_PIN8_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN8_PAD_DRIVER_GET(x) (((x) & GPIO_PIN8_PAD_DRIVER_MASK) >> GPIO_PIN8_PAD_DRIVER_LSB) -#define GPIO_PIN8_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN8_PAD_DRIVER_LSB) & GPIO_PIN8_PAD_DRIVER_MASK) -#define GPIO_PIN8_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN8_SOURCE_MSB 0 -#define GPIO_PIN8_SOURCE_LSB 0 -#define GPIO_PIN8_SOURCE_MASK 'h00000001 -#define GPIO_PIN8_SOURCE_GET(x) (((x) & GPIO_PIN8_SOURCE_MASK) >> GPIO_PIN8_SOURCE_LSB) -#define GPIO_PIN8_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN8_SOURCE_LSB) & GPIO_PIN8_SOURCE_MASK) -#define GPIO_PIN8_SOURCE_RESET 1'h0 -#define GPIO_PIN8_RESET (32'h0 | \ - GPIO_PIN8_CONFIG_SET(GPIO_PIN8_CONFIG_RESET) | \ - GPIO_PIN8_WAKEUP_ENABLE_SET(GPIO_PIN8_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN8_INT_TYPE_SET(GPIO_PIN8_INT_TYPE_RESET) | \ - GPIO_PIN8_PAD_DRIVER_SET(GPIO_PIN8_PAD_DRIVER_RESET) | \ - GPIO_PIN8_SOURCE_SET(GPIO_PIN8_SOURCE_RESET)) -#define GPIO_PIN8_HW_MASK (32'h0) -#define GPIO_PIN8_SW_MASK (32'h0 | \ - GPIO_PIN8_CONFIG_MASK | \ - GPIO_PIN8_WAKEUP_ENABLE_MASK | \ - GPIO_PIN8_INT_TYPE_MASK | \ - GPIO_PIN8_PAD_DRIVER_MASK | \ - GPIO_PIN8_SOURCE_MASK) - -#define GPIO_PIN9_ADDRESS 'h0000004c -#define GPIO_PIN9_CONFIG_MSB 12 -#define GPIO_PIN9_CONFIG_LSB 11 -#define GPIO_PIN9_CONFIG_MASK 'h00001800 -#define GPIO_PIN9_CONFIG_GET(x) (((x) & GPIO_PIN9_CONFIG_MASK) >> GPIO_PIN9_CONFIG_LSB) -#define GPIO_PIN9_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN9_CONFIG_LSB) & GPIO_PIN9_CONFIG_MASK) -#define GPIO_PIN9_CONFIG_RESET 2'h0 -#define GPIO_PIN9_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN9_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN9_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN9_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN9_WAKEUP_ENABLE_MASK) >> GPIO_PIN9_WAKEUP_ENABLE_LSB) -#define GPIO_PIN9_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN9_WAKEUP_ENABLE_LSB) & GPIO_PIN9_WAKEUP_ENABLE_MASK) -#define GPIO_PIN9_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN9_INT_TYPE_MSB 9 -#define GPIO_PIN9_INT_TYPE_LSB 7 -#define GPIO_PIN9_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN9_INT_TYPE_GET(x) (((x) & GPIO_PIN9_INT_TYPE_MASK) >> GPIO_PIN9_INT_TYPE_LSB) -#define GPIO_PIN9_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN9_INT_TYPE_LSB) & GPIO_PIN9_INT_TYPE_MASK) -#define GPIO_PIN9_INT_TYPE_RESET 3'h0 -#define GPIO_PIN9_PAD_DRIVER_MSB 2 -#define GPIO_PIN9_PAD_DRIVER_LSB 2 -#define GPIO_PIN9_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN9_PAD_DRIVER_GET(x) (((x) & GPIO_PIN9_PAD_DRIVER_MASK) >> GPIO_PIN9_PAD_DRIVER_LSB) -#define GPIO_PIN9_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN9_PAD_DRIVER_LSB) & GPIO_PIN9_PAD_DRIVER_MASK) -#define GPIO_PIN9_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN9_SOURCE_MSB 0 -#define GPIO_PIN9_SOURCE_LSB 0 -#define GPIO_PIN9_SOURCE_MASK 'h00000001 -#define GPIO_PIN9_SOURCE_GET(x) (((x) & GPIO_PIN9_SOURCE_MASK) >> GPIO_PIN9_SOURCE_LSB) -#define GPIO_PIN9_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN9_SOURCE_LSB) & GPIO_PIN9_SOURCE_MASK) -#define GPIO_PIN9_SOURCE_RESET 1'h0 -#define GPIO_PIN9_RESET (32'h0 | \ - GPIO_PIN9_CONFIG_SET(GPIO_PIN9_CONFIG_RESET) | \ - GPIO_PIN9_WAKEUP_ENABLE_SET(GPIO_PIN9_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN9_INT_TYPE_SET(GPIO_PIN9_INT_TYPE_RESET) | \ - GPIO_PIN9_PAD_DRIVER_SET(GPIO_PIN9_PAD_DRIVER_RESET) | \ - GPIO_PIN9_SOURCE_SET(GPIO_PIN9_SOURCE_RESET)) -#define GPIO_PIN9_HW_MASK (32'h0) -#define GPIO_PIN9_SW_MASK (32'h0 | \ - GPIO_PIN9_CONFIG_MASK | \ - GPIO_PIN9_WAKEUP_ENABLE_MASK | \ - GPIO_PIN9_INT_TYPE_MASK | \ - GPIO_PIN9_PAD_DRIVER_MASK | \ - GPIO_PIN9_SOURCE_MASK) - -#define GPIO_PIN10_ADDRESS 'h00000050 -#define GPIO_PIN10_CONFIG_MSB 12 -#define GPIO_PIN10_CONFIG_LSB 11 -#define GPIO_PIN10_CONFIG_MASK 'h00001800 -#define GPIO_PIN10_CONFIG_GET(x) (((x) & GPIO_PIN10_CONFIG_MASK) >> GPIO_PIN10_CONFIG_LSB) -#define GPIO_PIN10_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN10_CONFIG_LSB) & GPIO_PIN10_CONFIG_MASK) -#define GPIO_PIN10_CONFIG_RESET 2'h0 -#define GPIO_PIN10_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN10_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN10_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN10_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN10_WAKEUP_ENABLE_MASK) >> GPIO_PIN10_WAKEUP_ENABLE_LSB) -#define GPIO_PIN10_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN10_WAKEUP_ENABLE_LSB) & GPIO_PIN10_WAKEUP_ENABLE_MASK) -#define GPIO_PIN10_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN10_INT_TYPE_MSB 9 -#define GPIO_PIN10_INT_TYPE_LSB 7 -#define GPIO_PIN10_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN10_INT_TYPE_GET(x) (((x) & GPIO_PIN10_INT_TYPE_MASK) >> GPIO_PIN10_INT_TYPE_LSB) -#define GPIO_PIN10_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN10_INT_TYPE_LSB) & GPIO_PIN10_INT_TYPE_MASK) -#define GPIO_PIN10_INT_TYPE_RESET 3'h0 -#define GPIO_PIN10_PAD_DRIVER_MSB 2 -#define GPIO_PIN10_PAD_DRIVER_LSB 2 -#define GPIO_PIN10_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN10_PAD_DRIVER_GET(x) (((x) & GPIO_PIN10_PAD_DRIVER_MASK) >> GPIO_PIN10_PAD_DRIVER_LSB) -#define GPIO_PIN10_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN10_PAD_DRIVER_LSB) & GPIO_PIN10_PAD_DRIVER_MASK) -#define GPIO_PIN10_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN10_SOURCE_MSB 0 -#define GPIO_PIN10_SOURCE_LSB 0 -#define GPIO_PIN10_SOURCE_MASK 'h00000001 -#define GPIO_PIN10_SOURCE_GET(x) (((x) & GPIO_PIN10_SOURCE_MASK) >> GPIO_PIN10_SOURCE_LSB) -#define GPIO_PIN10_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN10_SOURCE_LSB) & GPIO_PIN10_SOURCE_MASK) -#define GPIO_PIN10_SOURCE_RESET 1'h0 -#define GPIO_PIN10_RESET (32'h0 | \ - GPIO_PIN10_CONFIG_SET(GPIO_PIN10_CONFIG_RESET) | \ - GPIO_PIN10_WAKEUP_ENABLE_SET(GPIO_PIN10_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN10_INT_TYPE_SET(GPIO_PIN10_INT_TYPE_RESET) | \ - GPIO_PIN10_PAD_DRIVER_SET(GPIO_PIN10_PAD_DRIVER_RESET) | \ - GPIO_PIN10_SOURCE_SET(GPIO_PIN10_SOURCE_RESET)) -#define GPIO_PIN10_HW_MASK (32'h0) -#define GPIO_PIN10_SW_MASK (32'h0 | \ - GPIO_PIN10_CONFIG_MASK | \ - GPIO_PIN10_WAKEUP_ENABLE_MASK | \ - GPIO_PIN10_INT_TYPE_MASK | \ - GPIO_PIN10_PAD_DRIVER_MASK | \ - GPIO_PIN10_SOURCE_MASK) - -#define GPIO_PIN11_ADDRESS 'h00000054 -#define GPIO_PIN11_CONFIG_MSB 12 -#define GPIO_PIN11_CONFIG_LSB 11 -#define GPIO_PIN11_CONFIG_MASK 'h00001800 -#define GPIO_PIN11_CONFIG_GET(x) (((x) & GPIO_PIN11_CONFIG_MASK) >> GPIO_PIN11_CONFIG_LSB) -#define GPIO_PIN11_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN11_CONFIG_LSB) & GPIO_PIN11_CONFIG_MASK) -#define GPIO_PIN11_CONFIG_RESET 2'h0 -#define GPIO_PIN11_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN11_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN11_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN11_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN11_WAKEUP_ENABLE_MASK) >> GPIO_PIN11_WAKEUP_ENABLE_LSB) -#define GPIO_PIN11_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN11_WAKEUP_ENABLE_LSB) & GPIO_PIN11_WAKEUP_ENABLE_MASK) -#define GPIO_PIN11_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN11_INT_TYPE_MSB 9 -#define GPIO_PIN11_INT_TYPE_LSB 7 -#define GPIO_PIN11_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN11_INT_TYPE_GET(x) (((x) & GPIO_PIN11_INT_TYPE_MASK) >> GPIO_PIN11_INT_TYPE_LSB) -#define GPIO_PIN11_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN11_INT_TYPE_LSB) & GPIO_PIN11_INT_TYPE_MASK) -#define GPIO_PIN11_INT_TYPE_RESET 3'h0 -#define GPIO_PIN11_PAD_DRIVER_MSB 2 -#define GPIO_PIN11_PAD_DRIVER_LSB 2 -#define GPIO_PIN11_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN11_PAD_DRIVER_GET(x) (((x) & GPIO_PIN11_PAD_DRIVER_MASK) >> GPIO_PIN11_PAD_DRIVER_LSB) -#define GPIO_PIN11_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN11_PAD_DRIVER_LSB) & GPIO_PIN11_PAD_DRIVER_MASK) -#define GPIO_PIN11_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN11_SOURCE_MSB 0 -#define GPIO_PIN11_SOURCE_LSB 0 -#define GPIO_PIN11_SOURCE_MASK 'h00000001 -#define GPIO_PIN11_SOURCE_GET(x) (((x) & GPIO_PIN11_SOURCE_MASK) >> GPIO_PIN11_SOURCE_LSB) -#define GPIO_PIN11_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN11_SOURCE_LSB) & GPIO_PIN11_SOURCE_MASK) -#define GPIO_PIN11_SOURCE_RESET 1'h0 -#define GPIO_PIN11_RESET (32'h0 | \ - GPIO_PIN11_CONFIG_SET(GPIO_PIN11_CONFIG_RESET) | \ - GPIO_PIN11_WAKEUP_ENABLE_SET(GPIO_PIN11_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN11_INT_TYPE_SET(GPIO_PIN11_INT_TYPE_RESET) | \ - GPIO_PIN11_PAD_DRIVER_SET(GPIO_PIN11_PAD_DRIVER_RESET) | \ - GPIO_PIN11_SOURCE_SET(GPIO_PIN11_SOURCE_RESET)) -#define GPIO_PIN11_HW_MASK (32'h0) -#define GPIO_PIN11_SW_MASK (32'h0 | \ - GPIO_PIN11_CONFIG_MASK | \ - GPIO_PIN11_WAKEUP_ENABLE_MASK | \ - GPIO_PIN11_INT_TYPE_MASK | \ - GPIO_PIN11_PAD_DRIVER_MASK | \ - GPIO_PIN11_SOURCE_MASK) - -#define GPIO_PIN12_ADDRESS 'h00000058 -#define GPIO_PIN12_CONFIG_MSB 12 -#define GPIO_PIN12_CONFIG_LSB 11 -#define GPIO_PIN12_CONFIG_MASK 'h00001800 -#define GPIO_PIN12_CONFIG_GET(x) (((x) & GPIO_PIN12_CONFIG_MASK) >> GPIO_PIN12_CONFIG_LSB) -#define GPIO_PIN12_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN12_CONFIG_LSB) & GPIO_PIN12_CONFIG_MASK) -#define GPIO_PIN12_CONFIG_RESET 2'h0 -#define GPIO_PIN12_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN12_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN12_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN12_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN12_WAKEUP_ENABLE_MASK) >> GPIO_PIN12_WAKEUP_ENABLE_LSB) -#define GPIO_PIN12_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN12_WAKEUP_ENABLE_LSB) & GPIO_PIN12_WAKEUP_ENABLE_MASK) -#define GPIO_PIN12_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN12_INT_TYPE_MSB 9 -#define GPIO_PIN12_INT_TYPE_LSB 7 -#define GPIO_PIN12_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN12_INT_TYPE_GET(x) (((x) & GPIO_PIN12_INT_TYPE_MASK) >> GPIO_PIN12_INT_TYPE_LSB) -#define GPIO_PIN12_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN12_INT_TYPE_LSB) & GPIO_PIN12_INT_TYPE_MASK) -#define GPIO_PIN12_INT_TYPE_RESET 3'h0 -#define GPIO_PIN12_PAD_DRIVER_MSB 2 -#define GPIO_PIN12_PAD_DRIVER_LSB 2 -#define GPIO_PIN12_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN12_PAD_DRIVER_GET(x) (((x) & GPIO_PIN12_PAD_DRIVER_MASK) >> GPIO_PIN12_PAD_DRIVER_LSB) -#define GPIO_PIN12_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN12_PAD_DRIVER_LSB) & GPIO_PIN12_PAD_DRIVER_MASK) -#define GPIO_PIN12_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN12_SOURCE_MSB 0 -#define GPIO_PIN12_SOURCE_LSB 0 -#define GPIO_PIN12_SOURCE_MASK 'h00000001 -#define GPIO_PIN12_SOURCE_GET(x) (((x) & GPIO_PIN12_SOURCE_MASK) >> GPIO_PIN12_SOURCE_LSB) -#define GPIO_PIN12_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN12_SOURCE_LSB) & GPIO_PIN12_SOURCE_MASK) -#define GPIO_PIN12_SOURCE_RESET 1'h0 -#define GPIO_PIN12_RESET (32'h0 | \ - GPIO_PIN12_CONFIG_SET(GPIO_PIN12_CONFIG_RESET) | \ - GPIO_PIN12_WAKEUP_ENABLE_SET(GPIO_PIN12_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN12_INT_TYPE_SET(GPIO_PIN12_INT_TYPE_RESET) | \ - GPIO_PIN12_PAD_DRIVER_SET(GPIO_PIN12_PAD_DRIVER_RESET) | \ - GPIO_PIN12_SOURCE_SET(GPIO_PIN12_SOURCE_RESET)) -#define GPIO_PIN12_HW_MASK (32'h0) -#define GPIO_PIN12_SW_MASK (32'h0 | \ - GPIO_PIN12_CONFIG_MASK | \ - GPIO_PIN12_WAKEUP_ENABLE_MASK | \ - GPIO_PIN12_INT_TYPE_MASK | \ - GPIO_PIN12_PAD_DRIVER_MASK | \ - GPIO_PIN12_SOURCE_MASK) - -#define GPIO_PIN13_ADDRESS 'h0000005c -#define GPIO_PIN13_CONFIG_MSB 12 -#define GPIO_PIN13_CONFIG_LSB 11 -#define GPIO_PIN13_CONFIG_MASK 'h00001800 -#define GPIO_PIN13_CONFIG_GET(x) (((x) & GPIO_PIN13_CONFIG_MASK) >> GPIO_PIN13_CONFIG_LSB) -#define GPIO_PIN13_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN13_CONFIG_LSB) & GPIO_PIN13_CONFIG_MASK) -#define GPIO_PIN13_CONFIG_RESET 2'h0 -#define GPIO_PIN13_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN13_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN13_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN13_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN13_WAKEUP_ENABLE_MASK) >> GPIO_PIN13_WAKEUP_ENABLE_LSB) -#define GPIO_PIN13_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN13_WAKEUP_ENABLE_LSB) & GPIO_PIN13_WAKEUP_ENABLE_MASK) -#define GPIO_PIN13_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN13_INT_TYPE_MSB 9 -#define GPIO_PIN13_INT_TYPE_LSB 7 -#define GPIO_PIN13_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN13_INT_TYPE_GET(x) (((x) & GPIO_PIN13_INT_TYPE_MASK) >> GPIO_PIN13_INT_TYPE_LSB) -#define GPIO_PIN13_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN13_INT_TYPE_LSB) & GPIO_PIN13_INT_TYPE_MASK) -#define GPIO_PIN13_INT_TYPE_RESET 3'h0 -#define GPIO_PIN13_PAD_DRIVER_MSB 2 -#define GPIO_PIN13_PAD_DRIVER_LSB 2 -#define GPIO_PIN13_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN13_PAD_DRIVER_GET(x) (((x) & GPIO_PIN13_PAD_DRIVER_MASK) >> GPIO_PIN13_PAD_DRIVER_LSB) -#define GPIO_PIN13_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN13_PAD_DRIVER_LSB) & GPIO_PIN13_PAD_DRIVER_MASK) -#define GPIO_PIN13_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN13_SOURCE_MSB 0 -#define GPIO_PIN13_SOURCE_LSB 0 -#define GPIO_PIN13_SOURCE_MASK 'h00000001 -#define GPIO_PIN13_SOURCE_GET(x) (((x) & GPIO_PIN13_SOURCE_MASK) >> GPIO_PIN13_SOURCE_LSB) -#define GPIO_PIN13_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN13_SOURCE_LSB) & GPIO_PIN13_SOURCE_MASK) -#define GPIO_PIN13_SOURCE_RESET 1'h0 -#define GPIO_PIN13_RESET (32'h0 | \ - GPIO_PIN13_CONFIG_SET(GPIO_PIN13_CONFIG_RESET) | \ - GPIO_PIN13_WAKEUP_ENABLE_SET(GPIO_PIN13_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN13_INT_TYPE_SET(GPIO_PIN13_INT_TYPE_RESET) | \ - GPIO_PIN13_PAD_DRIVER_SET(GPIO_PIN13_PAD_DRIVER_RESET) | \ - GPIO_PIN13_SOURCE_SET(GPIO_PIN13_SOURCE_RESET)) -#define GPIO_PIN13_HW_MASK (32'h0) -#define GPIO_PIN13_SW_MASK (32'h0 | \ - GPIO_PIN13_CONFIG_MASK | \ - GPIO_PIN13_WAKEUP_ENABLE_MASK | \ - GPIO_PIN13_INT_TYPE_MASK | \ - GPIO_PIN13_PAD_DRIVER_MASK | \ - GPIO_PIN13_SOURCE_MASK) - -#define GPIO_PIN14_ADDRESS 'h00000060 -#define GPIO_PIN14_CONFIG_MSB 12 -#define GPIO_PIN14_CONFIG_LSB 11 -#define GPIO_PIN14_CONFIG_MASK 'h00001800 -#define GPIO_PIN14_CONFIG_GET(x) (((x) & GPIO_PIN14_CONFIG_MASK) >> GPIO_PIN14_CONFIG_LSB) -#define GPIO_PIN14_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN14_CONFIG_LSB) & GPIO_PIN14_CONFIG_MASK) -#define GPIO_PIN14_CONFIG_RESET 2'h0 -#define GPIO_PIN14_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN14_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN14_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN14_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN14_WAKEUP_ENABLE_MASK) >> GPIO_PIN14_WAKEUP_ENABLE_LSB) -#define GPIO_PIN14_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN14_WAKEUP_ENABLE_LSB) & GPIO_PIN14_WAKEUP_ENABLE_MASK) -#define GPIO_PIN14_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN14_INT_TYPE_MSB 9 -#define GPIO_PIN14_INT_TYPE_LSB 7 -#define GPIO_PIN14_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN14_INT_TYPE_GET(x) (((x) & GPIO_PIN14_INT_TYPE_MASK) >> GPIO_PIN14_INT_TYPE_LSB) -#define GPIO_PIN14_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN14_INT_TYPE_LSB) & GPIO_PIN14_INT_TYPE_MASK) -#define GPIO_PIN14_INT_TYPE_RESET 3'h0 -#define GPIO_PIN14_PAD_DRIVER_MSB 2 -#define GPIO_PIN14_PAD_DRIVER_LSB 2 -#define GPIO_PIN14_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN14_PAD_DRIVER_GET(x) (((x) & GPIO_PIN14_PAD_DRIVER_MASK) >> GPIO_PIN14_PAD_DRIVER_LSB) -#define GPIO_PIN14_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN14_PAD_DRIVER_LSB) & GPIO_PIN14_PAD_DRIVER_MASK) -#define GPIO_PIN14_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN14_SOURCE_MSB 0 -#define GPIO_PIN14_SOURCE_LSB 0 -#define GPIO_PIN14_SOURCE_MASK 'h00000001 -#define GPIO_PIN14_SOURCE_GET(x) (((x) & GPIO_PIN14_SOURCE_MASK) >> GPIO_PIN14_SOURCE_LSB) -#define GPIO_PIN14_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN14_SOURCE_LSB) & GPIO_PIN14_SOURCE_MASK) -#define GPIO_PIN14_SOURCE_RESET 1'h0 -#define GPIO_PIN14_RESET (32'h0 | \ - GPIO_PIN14_CONFIG_SET(GPIO_PIN14_CONFIG_RESET) | \ - GPIO_PIN14_WAKEUP_ENABLE_SET(GPIO_PIN14_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN14_INT_TYPE_SET(GPIO_PIN14_INT_TYPE_RESET) | \ - GPIO_PIN14_PAD_DRIVER_SET(GPIO_PIN14_PAD_DRIVER_RESET) | \ - GPIO_PIN14_SOURCE_SET(GPIO_PIN14_SOURCE_RESET)) -#define GPIO_PIN14_HW_MASK (32'h0) -#define GPIO_PIN14_SW_MASK (32'h0 | \ - GPIO_PIN14_CONFIG_MASK | \ - GPIO_PIN14_WAKEUP_ENABLE_MASK | \ - GPIO_PIN14_INT_TYPE_MASK | \ - GPIO_PIN14_PAD_DRIVER_MASK | \ - GPIO_PIN14_SOURCE_MASK) - -#define GPIO_PIN15_ADDRESS 'h00000064 -#define GPIO_PIN15_CONFIG_MSB 12 -#define GPIO_PIN15_CONFIG_LSB 11 -#define GPIO_PIN15_CONFIG_MASK 'h00001800 -#define GPIO_PIN15_CONFIG_GET(x) (((x) & GPIO_PIN15_CONFIG_MASK) >> GPIO_PIN15_CONFIG_LSB) -#define GPIO_PIN15_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN15_CONFIG_LSB) & GPIO_PIN15_CONFIG_MASK) -#define GPIO_PIN15_CONFIG_RESET 2'h0 -#define GPIO_PIN15_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN15_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN15_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN15_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN15_WAKEUP_ENABLE_MASK) >> GPIO_PIN15_WAKEUP_ENABLE_LSB) -#define GPIO_PIN15_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN15_WAKEUP_ENABLE_LSB) & GPIO_PIN15_WAKEUP_ENABLE_MASK) -#define GPIO_PIN15_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN15_INT_TYPE_MSB 9 -#define GPIO_PIN15_INT_TYPE_LSB 7 -#define GPIO_PIN15_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN15_INT_TYPE_GET(x) (((x) & GPIO_PIN15_INT_TYPE_MASK) >> GPIO_PIN15_INT_TYPE_LSB) -#define GPIO_PIN15_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN15_INT_TYPE_LSB) & GPIO_PIN15_INT_TYPE_MASK) -#define GPIO_PIN15_INT_TYPE_RESET 3'h0 -#define GPIO_PIN15_PAD_DRIVER_MSB 2 -#define GPIO_PIN15_PAD_DRIVER_LSB 2 -#define GPIO_PIN15_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN15_PAD_DRIVER_GET(x) (((x) & GPIO_PIN15_PAD_DRIVER_MASK) >> GPIO_PIN15_PAD_DRIVER_LSB) -#define GPIO_PIN15_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN15_PAD_DRIVER_LSB) & GPIO_PIN15_PAD_DRIVER_MASK) -#define GPIO_PIN15_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN15_SOURCE_MSB 0 -#define GPIO_PIN15_SOURCE_LSB 0 -#define GPIO_PIN15_SOURCE_MASK 'h00000001 -#define GPIO_PIN15_SOURCE_GET(x) (((x) & GPIO_PIN15_SOURCE_MASK) >> GPIO_PIN15_SOURCE_LSB) -#define GPIO_PIN15_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN15_SOURCE_LSB) & GPIO_PIN15_SOURCE_MASK) -#define GPIO_PIN15_SOURCE_RESET 1'h0 -#define GPIO_PIN15_RESET (32'h0 | \ - GPIO_PIN15_CONFIG_SET(GPIO_PIN15_CONFIG_RESET) | \ - GPIO_PIN15_WAKEUP_ENABLE_SET(GPIO_PIN15_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN15_INT_TYPE_SET(GPIO_PIN15_INT_TYPE_RESET) | \ - GPIO_PIN15_PAD_DRIVER_SET(GPIO_PIN15_PAD_DRIVER_RESET) | \ - GPIO_PIN15_SOURCE_SET(GPIO_PIN15_SOURCE_RESET)) -#define GPIO_PIN15_HW_MASK (32'h0) -#define GPIO_PIN15_SW_MASK (32'h0 | \ - GPIO_PIN15_CONFIG_MASK | \ - GPIO_PIN15_WAKEUP_ENABLE_MASK | \ - GPIO_PIN15_INT_TYPE_MASK | \ - GPIO_PIN15_PAD_DRIVER_MASK | \ - GPIO_PIN15_SOURCE_MASK) - -#define GPIO_PIN16_ADDRESS 'h00000068 -#define GPIO_PIN16_CONFIG_MSB 12 -#define GPIO_PIN16_CONFIG_LSB 11 -#define GPIO_PIN16_CONFIG_MASK 'h00001800 -#define GPIO_PIN16_CONFIG_GET(x) (((x) & GPIO_PIN16_CONFIG_MASK) >> GPIO_PIN16_CONFIG_LSB) -#define GPIO_PIN16_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN16_CONFIG_LSB) & GPIO_PIN16_CONFIG_MASK) -#define GPIO_PIN16_CONFIG_RESET 2'h0 -#define GPIO_PIN16_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN16_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN16_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN16_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN16_WAKEUP_ENABLE_MASK) >> GPIO_PIN16_WAKEUP_ENABLE_LSB) -#define GPIO_PIN16_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN16_WAKEUP_ENABLE_LSB) & GPIO_PIN16_WAKEUP_ENABLE_MASK) -#define GPIO_PIN16_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN16_INT_TYPE_MSB 9 -#define GPIO_PIN16_INT_TYPE_LSB 7 -#define GPIO_PIN16_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN16_INT_TYPE_GET(x) (((x) & GPIO_PIN16_INT_TYPE_MASK) >> GPIO_PIN16_INT_TYPE_LSB) -#define GPIO_PIN16_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN16_INT_TYPE_LSB) & GPIO_PIN16_INT_TYPE_MASK) -#define GPIO_PIN16_INT_TYPE_RESET 3'h0 -#define GPIO_PIN16_PAD_DRIVER_MSB 2 -#define GPIO_PIN16_PAD_DRIVER_LSB 2 -#define GPIO_PIN16_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN16_PAD_DRIVER_GET(x) (((x) & GPIO_PIN16_PAD_DRIVER_MASK) >> GPIO_PIN16_PAD_DRIVER_LSB) -#define GPIO_PIN16_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN16_PAD_DRIVER_LSB) & GPIO_PIN16_PAD_DRIVER_MASK) -#define GPIO_PIN16_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN16_SOURCE_MSB 0 -#define GPIO_PIN16_SOURCE_LSB 0 -#define GPIO_PIN16_SOURCE_MASK 'h00000001 -#define GPIO_PIN16_SOURCE_GET(x) (((x) & GPIO_PIN16_SOURCE_MASK) >> GPIO_PIN16_SOURCE_LSB) -#define GPIO_PIN16_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN16_SOURCE_LSB) & GPIO_PIN16_SOURCE_MASK) -#define GPIO_PIN16_SOURCE_RESET 1'h0 -#define GPIO_PIN16_RESET (32'h0 | \ - GPIO_PIN16_CONFIG_SET(GPIO_PIN16_CONFIG_RESET) | \ - GPIO_PIN16_WAKEUP_ENABLE_SET(GPIO_PIN16_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN16_INT_TYPE_SET(GPIO_PIN16_INT_TYPE_RESET) | \ - GPIO_PIN16_PAD_DRIVER_SET(GPIO_PIN16_PAD_DRIVER_RESET) | \ - GPIO_PIN16_SOURCE_SET(GPIO_PIN16_SOURCE_RESET)) -#define GPIO_PIN16_HW_MASK (32'h0) -#define GPIO_PIN16_SW_MASK (32'h0 | \ - GPIO_PIN16_CONFIG_MASK | \ - GPIO_PIN16_WAKEUP_ENABLE_MASK | \ - GPIO_PIN16_INT_TYPE_MASK | \ - GPIO_PIN16_PAD_DRIVER_MASK | \ - GPIO_PIN16_SOURCE_MASK) - -#define GPIO_PIN17_ADDRESS 'h0000006c -#define GPIO_PIN17_CONFIG_MSB 12 -#define GPIO_PIN17_CONFIG_LSB 11 -#define GPIO_PIN17_CONFIG_MASK 'h00001800 -#define GPIO_PIN17_CONFIG_GET(x) (((x) & GPIO_PIN17_CONFIG_MASK) >> GPIO_PIN17_CONFIG_LSB) -#define GPIO_PIN17_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN17_CONFIG_LSB) & GPIO_PIN17_CONFIG_MASK) -#define GPIO_PIN17_CONFIG_RESET 2'h0 -#define GPIO_PIN17_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN17_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN17_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN17_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN17_WAKEUP_ENABLE_MASK) >> GPIO_PIN17_WAKEUP_ENABLE_LSB) -#define GPIO_PIN17_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN17_WAKEUP_ENABLE_LSB) & GPIO_PIN17_WAKEUP_ENABLE_MASK) -#define GPIO_PIN17_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN17_INT_TYPE_MSB 9 -#define GPIO_PIN17_INT_TYPE_LSB 7 -#define GPIO_PIN17_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN17_INT_TYPE_GET(x) (((x) & GPIO_PIN17_INT_TYPE_MASK) >> GPIO_PIN17_INT_TYPE_LSB) -#define GPIO_PIN17_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN17_INT_TYPE_LSB) & GPIO_PIN17_INT_TYPE_MASK) -#define GPIO_PIN17_INT_TYPE_RESET 3'h0 -#define GPIO_PIN17_PAD_DRIVER_MSB 2 -#define GPIO_PIN17_PAD_DRIVER_LSB 2 -#define GPIO_PIN17_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN17_PAD_DRIVER_GET(x) (((x) & GPIO_PIN17_PAD_DRIVER_MASK) >> GPIO_PIN17_PAD_DRIVER_LSB) -#define GPIO_PIN17_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN17_PAD_DRIVER_LSB) & GPIO_PIN17_PAD_DRIVER_MASK) -#define GPIO_PIN17_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN17_SOURCE_MSB 0 -#define GPIO_PIN17_SOURCE_LSB 0 -#define GPIO_PIN17_SOURCE_MASK 'h00000001 -#define GPIO_PIN17_SOURCE_GET(x) (((x) & GPIO_PIN17_SOURCE_MASK) >> GPIO_PIN17_SOURCE_LSB) -#define GPIO_PIN17_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN17_SOURCE_LSB) & GPIO_PIN17_SOURCE_MASK) -#define GPIO_PIN17_SOURCE_RESET 1'h0 -#define GPIO_PIN17_RESET (32'h0 | \ - GPIO_PIN17_CONFIG_SET(GPIO_PIN17_CONFIG_RESET) | \ - GPIO_PIN17_WAKEUP_ENABLE_SET(GPIO_PIN17_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN17_INT_TYPE_SET(GPIO_PIN17_INT_TYPE_RESET) | \ - GPIO_PIN17_PAD_DRIVER_SET(GPIO_PIN17_PAD_DRIVER_RESET) | \ - GPIO_PIN17_SOURCE_SET(GPIO_PIN17_SOURCE_RESET)) -#define GPIO_PIN17_HW_MASK (32'h0) -#define GPIO_PIN17_SW_MASK (32'h0 | \ - GPIO_PIN17_CONFIG_MASK | \ - GPIO_PIN17_WAKEUP_ENABLE_MASK | \ - GPIO_PIN17_INT_TYPE_MASK | \ - GPIO_PIN17_PAD_DRIVER_MASK | \ - GPIO_PIN17_SOURCE_MASK) - -#define SDIO_PIN_ADDRESS 'h00000070 -#define SDIO_PIN_PAD_PULL_MSB 3 -#define SDIO_PIN_PAD_PULL_LSB 2 -#define SDIO_PIN_PAD_PULL_MASK 'h0000000c -#define SDIO_PIN_PAD_PULL_GET(x) (((x) & SDIO_PIN_PAD_PULL_MASK) >> SDIO_PIN_PAD_PULL_LSB) -#define SDIO_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << SDIO_PIN_PAD_PULL_LSB) & SDIO_PIN_PAD_PULL_MASK) -#define SDIO_PIN_PAD_PULL_RESET 2'h1 -#define SDIO_PIN_PAD_STRENGTH_MSB 1 -#define SDIO_PIN_PAD_STRENGTH_LSB 0 -#define SDIO_PIN_PAD_STRENGTH_MASK 'h00000003 -#define SDIO_PIN_PAD_STRENGTH_GET(x) (((x) & SDIO_PIN_PAD_STRENGTH_MASK) >> SDIO_PIN_PAD_STRENGTH_LSB) -#define SDIO_PIN_PAD_STRENGTH_SET(x) (((32'd0 | (x)) << SDIO_PIN_PAD_STRENGTH_LSB) & SDIO_PIN_PAD_STRENGTH_MASK) -#define SDIO_PIN_PAD_STRENGTH_RESET 2'h1 -#define SDIO_PIN_RESET (32'h0 | \ - SDIO_PIN_PAD_PULL_SET(SDIO_PIN_PAD_PULL_RESET) | \ - SDIO_PIN_PAD_STRENGTH_SET(SDIO_PIN_PAD_STRENGTH_RESET)) -#define SDIO_PIN_HW_MASK (32'h0) -#define SDIO_PIN_SW_MASK (32'h0 | \ - SDIO_PIN_PAD_PULL_MASK | \ - SDIO_PIN_PAD_STRENGTH_MASK) - -#define CLK_REQ_PIN_ADDRESS 'h00000074 -#define CLK_REQ_PIN_ATE_OE_L_MSB 4 -#define CLK_REQ_PIN_ATE_OE_L_LSB 4 -#define CLK_REQ_PIN_ATE_OE_L_MASK 'h00000010 -#define CLK_REQ_PIN_ATE_OE_L_GET(x) (((x) & CLK_REQ_PIN_ATE_OE_L_MASK) >> CLK_REQ_PIN_ATE_OE_L_LSB) -#define CLK_REQ_PIN_ATE_OE_L_SET(x) (((32'd0 | (x)) << CLK_REQ_PIN_ATE_OE_L_LSB) & CLK_REQ_PIN_ATE_OE_L_MASK) -#define CLK_REQ_PIN_ATE_OE_L_RESET 1'h0 -#define CLK_REQ_PIN_PAD_PULL_MSB 3 -#define CLK_REQ_PIN_PAD_PULL_LSB 2 -#define CLK_REQ_PIN_PAD_PULL_MASK 'h0000000c -#define CLK_REQ_PIN_PAD_PULL_GET(x) (((x) & CLK_REQ_PIN_PAD_PULL_MASK) >> CLK_REQ_PIN_PAD_PULL_LSB) -#define CLK_REQ_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << CLK_REQ_PIN_PAD_PULL_LSB) & CLK_REQ_PIN_PAD_PULL_MASK) -#define CLK_REQ_PIN_PAD_PULL_RESET 2'h2 -#define CLK_REQ_PIN_PAD_STRENGTH_MSB 1 -#define CLK_REQ_PIN_PAD_STRENGTH_LSB 0 -#define CLK_REQ_PIN_PAD_STRENGTH_MASK 'h00000003 -#define CLK_REQ_PIN_PAD_STRENGTH_GET(x) (((x) & CLK_REQ_PIN_PAD_STRENGTH_MASK) >> CLK_REQ_PIN_PAD_STRENGTH_LSB) -#define CLK_REQ_PIN_PAD_STRENGTH_SET(x) (((32'd0 | (x)) << CLK_REQ_PIN_PAD_STRENGTH_LSB) & CLK_REQ_PIN_PAD_STRENGTH_MASK) -#define CLK_REQ_PIN_PAD_STRENGTH_RESET 2'h1 -#define CLK_REQ_PIN_RESET (32'h0 | \ - CLK_REQ_PIN_ATE_OE_L_SET(CLK_REQ_PIN_ATE_OE_L_RESET) | \ - CLK_REQ_PIN_PAD_PULL_SET(CLK_REQ_PIN_PAD_PULL_RESET) | \ - CLK_REQ_PIN_PAD_STRENGTH_SET(CLK_REQ_PIN_PAD_STRENGTH_RESET)) -#define CLK_REQ_PIN_HW_MASK (32'h0) -#define CLK_REQ_PIN_SW_MASK (32'h0 | \ - CLK_REQ_PIN_ATE_OE_L_MASK | \ - CLK_REQ_PIN_PAD_PULL_MASK | \ - CLK_REQ_PIN_PAD_STRENGTH_MASK) - -#define SIGMA_DELTA_ADDRESS 'h00000078 -#define SIGMA_DELTA_ENABLE_MSB 16 -#define SIGMA_DELTA_ENABLE_LSB 16 -#define SIGMA_DELTA_ENABLE_MASK 'h00010000 -#define SIGMA_DELTA_ENABLE_GET(x) (((x) & SIGMA_DELTA_ENABLE_MASK) >> SIGMA_DELTA_ENABLE_LSB) -#define SIGMA_DELTA_ENABLE_SET(x) (((32'd0 | (x)) << SIGMA_DELTA_ENABLE_LSB) & SIGMA_DELTA_ENABLE_MASK) -#define SIGMA_DELTA_ENABLE_RESET 1'h0 -#define SIGMA_DELTA_PRESCALAR_MSB 15 -#define SIGMA_DELTA_PRESCALAR_LSB 8 -#define SIGMA_DELTA_PRESCALAR_MASK 'h0000ff00 -#define SIGMA_DELTA_PRESCALAR_GET(x) (((x) & SIGMA_DELTA_PRESCALAR_MASK) >> SIGMA_DELTA_PRESCALAR_LSB) -#define SIGMA_DELTA_PRESCALAR_SET(x) (((32'd0 | (x)) << SIGMA_DELTA_PRESCALAR_LSB) & SIGMA_DELTA_PRESCALAR_MASK) -#define SIGMA_DELTA_PRESCALAR_RESET 8'h0 -#define SIGMA_DELTA_TARGET_MSB 7 -#define SIGMA_DELTA_TARGET_LSB 0 -#define SIGMA_DELTA_TARGET_MASK 'h000000ff -#define SIGMA_DELTA_TARGET_GET(x) (((x) & SIGMA_DELTA_TARGET_MASK) >> SIGMA_DELTA_TARGET_LSB) -#define SIGMA_DELTA_TARGET_SET(x) (((32'd0 | (x)) << SIGMA_DELTA_TARGET_LSB) & SIGMA_DELTA_TARGET_MASK) -#define SIGMA_DELTA_TARGET_RESET 8'h0 -#define SIGMA_DELTA_RESET (32'h0 | \ - SIGMA_DELTA_ENABLE_SET(SIGMA_DELTA_ENABLE_RESET) | \ - SIGMA_DELTA_PRESCALAR_SET(SIGMA_DELTA_PRESCALAR_RESET) | \ - SIGMA_DELTA_TARGET_SET(SIGMA_DELTA_TARGET_RESET)) -#define SIGMA_DELTA_HW_MASK (32'h0) -#define SIGMA_DELTA_SW_MASK (32'h0 | \ - SIGMA_DELTA_ENABLE_MASK | \ - SIGMA_DELTA_PRESCALAR_MASK | \ - SIGMA_DELTA_TARGET_MASK) - -#define DEBUG_CONTROL_ADDRESS 'h0000007c -#define DEBUG_CONTROL_OBS_OE_L_MSB 1 -#define DEBUG_CONTROL_OBS_OE_L_LSB 1 -#define DEBUG_CONTROL_OBS_OE_L_MASK 'h00000002 -#define DEBUG_CONTROL_OBS_OE_L_GET(x) (((x) & DEBUG_CONTROL_OBS_OE_L_MASK) >> DEBUG_CONTROL_OBS_OE_L_LSB) -#define DEBUG_CONTROL_OBS_OE_L_SET(x) (((32'd0 | (x)) << DEBUG_CONTROL_OBS_OE_L_LSB) & DEBUG_CONTROL_OBS_OE_L_MASK) -#define DEBUG_CONTROL_OBS_OE_L_RESET 1'h1 -#define DEBUG_CONTROL_ENABLE_MSB 0 -#define DEBUG_CONTROL_ENABLE_LSB 0 -#define DEBUG_CONTROL_ENABLE_MASK 'h00000001 -#define DEBUG_CONTROL_ENABLE_GET(x) (((x) & DEBUG_CONTROL_ENABLE_MASK) >> DEBUG_CONTROL_ENABLE_LSB) -#define DEBUG_CONTROL_ENABLE_SET(x) (((32'd0 | (x)) << DEBUG_CONTROL_ENABLE_LSB) & DEBUG_CONTROL_ENABLE_MASK) -#define DEBUG_CONTROL_ENABLE_RESET 1'h0 -#define DEBUG_CONTROL_RESET (32'h0 | \ - DEBUG_CONTROL_OBS_OE_L_SET(DEBUG_CONTROL_OBS_OE_L_RESET) | \ - DEBUG_CONTROL_ENABLE_SET(DEBUG_CONTROL_ENABLE_RESET)) -#define DEBUG_CONTROL_HW_MASK (32'h0) -#define DEBUG_CONTROL_SW_MASK (32'h0 | \ - DEBUG_CONTROL_OBS_OE_L_MASK | \ - DEBUG_CONTROL_ENABLE_MASK) - -#define DEBUG_INPUT_SEL_ADDRESS 'h00000080 -#define DEBUG_INPUT_SEL_SRC_MSB 3 -#define DEBUG_INPUT_SEL_SRC_LSB 0 -#define DEBUG_INPUT_SEL_SRC_MASK 'h0000000f -#define DEBUG_INPUT_SEL_SRC_GET(x) (((x) & DEBUG_INPUT_SEL_SRC_MASK) >> DEBUG_INPUT_SEL_SRC_LSB) -#define DEBUG_INPUT_SEL_SRC_SET(x) (((32'd0 | (x)) << DEBUG_INPUT_SEL_SRC_LSB) & DEBUG_INPUT_SEL_SRC_MASK) -#define DEBUG_INPUT_SEL_SRC_RESET 4'h0 -#define DEBUG_INPUT_SEL_RESET (32'h0 | \ - DEBUG_INPUT_SEL_SRC_SET(DEBUG_INPUT_SEL_SRC_RESET)) -#define DEBUG_INPUT_SEL_HW_MASK (32'h0) -#define DEBUG_INPUT_SEL_SW_MASK (32'h0 | \ - DEBUG_INPUT_SEL_SRC_MASK) - -#define DEBUG_OUT_ADDRESS 'h00000084 -#define DEBUG_OUT_DATA_MSB 17 -#define DEBUG_OUT_DATA_LSB 0 -#define DEBUG_OUT_DATA_MASK 'h0003ffff -#define DEBUG_OUT_DATA_GET(x) (((x) & DEBUG_OUT_DATA_MASK) >> DEBUG_OUT_DATA_LSB) -#define DEBUG_OUT_DATA_SET(x) (((32'd0 | (x)) << DEBUG_OUT_DATA_LSB) & DEBUG_OUT_DATA_MASK) -#define DEBUG_OUT_DATA_RESET 18'h0 -#define DEBUG_OUT_RESET (32'h0 | \ - DEBUG_OUT_DATA_SET(DEBUG_OUT_DATA_RESET)) -#define DEBUG_OUT_HW_MASK (32'h0 | \ - DEBUG_OUT_DATA_MASK) -#define DEBUG_OUT_SW_MASK (32'h0) - -#define LA_CONTROL_ADDRESS 'h00000088 -#define LA_CONTROL_RUN_MSB 1 -#define LA_CONTROL_RUN_LSB 1 -#define LA_CONTROL_RUN_MASK 'h00000002 -#define LA_CONTROL_RUN_GET(x) (((x) & LA_CONTROL_RUN_MASK) >> LA_CONTROL_RUN_LSB) -#define LA_CONTROL_RUN_SET(x) (((32'd0 | (x)) << LA_CONTROL_RUN_LSB) & LA_CONTROL_RUN_MASK) -#define LA_CONTROL_RUN_RESET 1'h0 -#define LA_CONTROL_TRIGGERED_MSB 0 -#define LA_CONTROL_TRIGGERED_LSB 0 -#define LA_CONTROL_TRIGGERED_MASK 'h00000001 -#define LA_CONTROL_TRIGGERED_GET(x) (((x) & LA_CONTROL_TRIGGERED_MASK) >> LA_CONTROL_TRIGGERED_LSB) -#define LA_CONTROL_TRIGGERED_SET(x) (((32'd0 | (x)) << LA_CONTROL_TRIGGERED_LSB) & LA_CONTROL_TRIGGERED_MASK) -#define LA_CONTROL_TRIGGERED_RESET 1'h0 -#define LA_CONTROL_RESET (32'h0 | \ - LA_CONTROL_RUN_SET(LA_CONTROL_RUN_RESET) | \ - LA_CONTROL_TRIGGERED_SET(LA_CONTROL_TRIGGERED_RESET)) -#define LA_CONTROL_HW_MASK (32'h0 | \ - LA_CONTROL_RUN_MASK | \ - LA_CONTROL_TRIGGERED_MASK) -#define LA_CONTROL_SW_MASK (32'h0 | \ - LA_CONTROL_RUN_MASK) - -#define LA_CLOCK_ADDRESS 'h0000008c -#define LA_CLOCK_DIV_MSB 7 -#define LA_CLOCK_DIV_LSB 0 -#define LA_CLOCK_DIV_MASK 'h000000ff -#define LA_CLOCK_DIV_GET(x) (((x) & LA_CLOCK_DIV_MASK) >> LA_CLOCK_DIV_LSB) -#define LA_CLOCK_DIV_SET(x) (((32'd0 | (x)) << LA_CLOCK_DIV_LSB) & LA_CLOCK_DIV_MASK) -#define LA_CLOCK_DIV_RESET 8'h0 -#define LA_CLOCK_RESET (32'h0 | \ - LA_CLOCK_DIV_SET(LA_CLOCK_DIV_RESET)) -#define LA_CLOCK_HW_MASK (32'h0) -#define LA_CLOCK_SW_MASK (32'h0 | \ - LA_CLOCK_DIV_MASK) - -#define LA_STATUS_ADDRESS 'h00000090 -#define LA_STATUS_INTERRUPT_MSB 0 -#define LA_STATUS_INTERRUPT_LSB 0 -#define LA_STATUS_INTERRUPT_MASK 'h00000001 -#define LA_STATUS_INTERRUPT_GET(x) (((x) & LA_STATUS_INTERRUPT_MASK) >> LA_STATUS_INTERRUPT_LSB) -#define LA_STATUS_INTERRUPT_SET(x) (((32'd0 | (x)) << LA_STATUS_INTERRUPT_LSB) & LA_STATUS_INTERRUPT_MASK) -#define LA_STATUS_INTERRUPT_RESET 1'h0 -#define LA_STATUS_RESET (32'h0 | \ - LA_STATUS_INTERRUPT_SET(LA_STATUS_INTERRUPT_RESET)) -#define LA_STATUS_HW_MASK (32'h0 | \ - LA_STATUS_INTERRUPT_MASK) -#define LA_STATUS_SW_MASK (32'h0 | \ - LA_STATUS_INTERRUPT_MASK) - -#define LA_TRIGGER_SAMPLE_ADDRESS 'h00000094 -#define LA_TRIGGER_SAMPLE_COUNT_MSB 15 -#define LA_TRIGGER_SAMPLE_COUNT_LSB 0 -#define LA_TRIGGER_SAMPLE_COUNT_MASK 'h0000ffff -#define LA_TRIGGER_SAMPLE_COUNT_GET(x) (((x) & LA_TRIGGER_SAMPLE_COUNT_MASK) >> LA_TRIGGER_SAMPLE_COUNT_LSB) -#define LA_TRIGGER_SAMPLE_COUNT_SET(x) (((32'd0 | (x)) << LA_TRIGGER_SAMPLE_COUNT_LSB) & LA_TRIGGER_SAMPLE_COUNT_MASK) -#define LA_TRIGGER_SAMPLE_COUNT_RESET 16'h0 -#define LA_TRIGGER_SAMPLE_RESET (32'h0 | \ - LA_TRIGGER_SAMPLE_COUNT_SET(LA_TRIGGER_SAMPLE_COUNT_RESET)) -#define LA_TRIGGER_SAMPLE_HW_MASK (32'h0) -#define LA_TRIGGER_SAMPLE_SW_MASK (32'h0 | \ - LA_TRIGGER_SAMPLE_COUNT_MASK) - -#define LA_TRIGGER_POSITION_ADDRESS 'h00000098 -#define LA_TRIGGER_POSITION_VALUE_MSB 15 -#define LA_TRIGGER_POSITION_VALUE_LSB 0 -#define LA_TRIGGER_POSITION_VALUE_MASK 'h0000ffff -#define LA_TRIGGER_POSITION_VALUE_GET(x) (((x) & LA_TRIGGER_POSITION_VALUE_MASK) >> LA_TRIGGER_POSITION_VALUE_LSB) -#define LA_TRIGGER_POSITION_VALUE_SET(x) (((32'd0 | (x)) << LA_TRIGGER_POSITION_VALUE_LSB) & LA_TRIGGER_POSITION_VALUE_MASK) -#define LA_TRIGGER_POSITION_VALUE_RESET 16'h1 -#define LA_TRIGGER_POSITION_RESET (32'h0 | \ - LA_TRIGGER_POSITION_VALUE_SET(LA_TRIGGER_POSITION_VALUE_RESET)) -#define LA_TRIGGER_POSITION_HW_MASK (32'h0) -#define LA_TRIGGER_POSITION_SW_MASK (32'h0 | \ - LA_TRIGGER_POSITION_VALUE_MASK) - -#define LA_PRE_TRIGGER_ADDRESS 'h0000009c -#define LA_PRE_TRIGGER_COUNT_MSB 15 -#define LA_PRE_TRIGGER_COUNT_LSB 0 -#define LA_PRE_TRIGGER_COUNT_MASK 'h0000ffff -#define LA_PRE_TRIGGER_COUNT_GET(x) (((x) & LA_PRE_TRIGGER_COUNT_MASK) >> LA_PRE_TRIGGER_COUNT_LSB) -#define LA_PRE_TRIGGER_COUNT_SET(x) (((32'd0 | (x)) << LA_PRE_TRIGGER_COUNT_LSB) & LA_PRE_TRIGGER_COUNT_MASK) -#define LA_PRE_TRIGGER_COUNT_RESET 16'h0 -#define LA_PRE_TRIGGER_RESET (32'h0 | \ - LA_PRE_TRIGGER_COUNT_SET(LA_PRE_TRIGGER_COUNT_RESET)) -#define LA_PRE_TRIGGER_HW_MASK (32'h0 | \ - LA_PRE_TRIGGER_COUNT_MASK) -#define LA_PRE_TRIGGER_SW_MASK (32'h0 | \ - LA_PRE_TRIGGER_COUNT_MASK) - -#define LA_POST_TRIGGER_ADDRESS 'h000000a0 -#define LA_POST_TRIGGER_COUNT_MSB 15 -#define LA_POST_TRIGGER_COUNT_LSB 0 -#define LA_POST_TRIGGER_COUNT_MASK 'h0000ffff -#define LA_POST_TRIGGER_COUNT_GET(x) (((x) & LA_POST_TRIGGER_COUNT_MASK) >> LA_POST_TRIGGER_COUNT_LSB) -#define LA_POST_TRIGGER_COUNT_SET(x) (((32'd0 | (x)) << LA_POST_TRIGGER_COUNT_LSB) & LA_POST_TRIGGER_COUNT_MASK) -#define LA_POST_TRIGGER_COUNT_RESET 16'h0 -#define LA_POST_TRIGGER_RESET (32'h0 | \ - LA_POST_TRIGGER_COUNT_SET(LA_POST_TRIGGER_COUNT_RESET)) -#define LA_POST_TRIGGER_HW_MASK (32'h0 | \ - LA_POST_TRIGGER_COUNT_MASK) -#define LA_POST_TRIGGER_SW_MASK (32'h0 | \ - LA_POST_TRIGGER_COUNT_MASK) - -#define LA_FILTER_CONTROL_ADDRESS 'h000000a4 -#define LA_FILTER_CONTROL_DELTA_MSB 0 -#define LA_FILTER_CONTROL_DELTA_LSB 0 -#define LA_FILTER_CONTROL_DELTA_MASK 'h00000001 -#define LA_FILTER_CONTROL_DELTA_GET(x) (((x) & LA_FILTER_CONTROL_DELTA_MASK) >> LA_FILTER_CONTROL_DELTA_LSB) -#define LA_FILTER_CONTROL_DELTA_SET(x) (((32'd0 | (x)) << LA_FILTER_CONTROL_DELTA_LSB) & LA_FILTER_CONTROL_DELTA_MASK) -#define LA_FILTER_CONTROL_DELTA_RESET 1'h0 -#define LA_FILTER_CONTROL_RESET (32'h0 | \ - LA_FILTER_CONTROL_DELTA_SET(LA_FILTER_CONTROL_DELTA_RESET)) -#define LA_FILTER_CONTROL_HW_MASK (32'h0) -#define LA_FILTER_CONTROL_SW_MASK (32'h0 | \ - LA_FILTER_CONTROL_DELTA_MASK) - -#define LA_FILTER_DATA_ADDRESS 'h000000a8 -#define LA_FILTER_DATA_MATCH_MSB 17 -#define LA_FILTER_DATA_MATCH_LSB 0 -#define LA_FILTER_DATA_MATCH_MASK 'h0003ffff -#define LA_FILTER_DATA_MATCH_GET(x) (((x) & LA_FILTER_DATA_MATCH_MASK) >> LA_FILTER_DATA_MATCH_LSB) -#define LA_FILTER_DATA_MATCH_SET(x) (((32'd0 | (x)) << LA_FILTER_DATA_MATCH_LSB) & LA_FILTER_DATA_MATCH_MASK) -#define LA_FILTER_DATA_MATCH_RESET 18'h0 -#define LA_FILTER_DATA_RESET (32'h0 | \ - LA_FILTER_DATA_MATCH_SET(LA_FILTER_DATA_MATCH_RESET)) -#define LA_FILTER_DATA_HW_MASK (32'h0) -#define LA_FILTER_DATA_SW_MASK (32'h0 | \ - LA_FILTER_DATA_MATCH_MASK) - -#define LA_FILTER_WILDCARD_ADDRESS 'h000000ac -#define LA_FILTER_WILDCARD_MATCH_MSB 17 -#define LA_FILTER_WILDCARD_MATCH_LSB 0 -#define LA_FILTER_WILDCARD_MATCH_MASK 'h0003ffff -#define LA_FILTER_WILDCARD_MATCH_GET(x) (((x) & LA_FILTER_WILDCARD_MATCH_MASK) >> LA_FILTER_WILDCARD_MATCH_LSB) -#define LA_FILTER_WILDCARD_MATCH_SET(x) (((32'd0 | (x)) << LA_FILTER_WILDCARD_MATCH_LSB) & LA_FILTER_WILDCARD_MATCH_MASK) -#define LA_FILTER_WILDCARD_MATCH_RESET 18'h0 -#define LA_FILTER_WILDCARD_RESET (32'h0 | \ - LA_FILTER_WILDCARD_MATCH_SET(LA_FILTER_WILDCARD_MATCH_RESET)) -#define LA_FILTER_WILDCARD_HW_MASK (32'h0) -#define LA_FILTER_WILDCARD_SW_MASK (32'h0 | \ - LA_FILTER_WILDCARD_MATCH_MASK) - -#define LA_TRIGGERA_DATA_ADDRESS 'h000000b0 -#define LA_TRIGGERA_DATA_MATCH_MSB 17 -#define LA_TRIGGERA_DATA_MATCH_LSB 0 -#define LA_TRIGGERA_DATA_MATCH_MASK 'h0003ffff -#define LA_TRIGGERA_DATA_MATCH_GET(x) (((x) & LA_TRIGGERA_DATA_MATCH_MASK) >> LA_TRIGGERA_DATA_MATCH_LSB) -#define LA_TRIGGERA_DATA_MATCH_SET(x) (((32'd0 | (x)) << LA_TRIGGERA_DATA_MATCH_LSB) & LA_TRIGGERA_DATA_MATCH_MASK) -#define LA_TRIGGERA_DATA_MATCH_RESET 18'h0 -#define LA_TRIGGERA_DATA_RESET (32'h0 | \ - LA_TRIGGERA_DATA_MATCH_SET(LA_TRIGGERA_DATA_MATCH_RESET)) -#define LA_TRIGGERA_DATA_HW_MASK (32'h0) -#define LA_TRIGGERA_DATA_SW_MASK (32'h0 | \ - LA_TRIGGERA_DATA_MATCH_MASK) - -#define LA_TRIGGERA_WILDCARD_ADDRESS 'h000000b4 -#define LA_TRIGGERA_WILDCARD_MATCH_MSB 17 -#define LA_TRIGGERA_WILDCARD_MATCH_LSB 0 -#define LA_TRIGGERA_WILDCARD_MATCH_MASK 'h0003ffff -#define LA_TRIGGERA_WILDCARD_MATCH_GET(x) (((x) & LA_TRIGGERA_WILDCARD_MATCH_MASK) >> LA_TRIGGERA_WILDCARD_MATCH_LSB) -#define LA_TRIGGERA_WILDCARD_MATCH_SET(x) (((32'd0 | (x)) << LA_TRIGGERA_WILDCARD_MATCH_LSB) & LA_TRIGGERA_WILDCARD_MATCH_MASK) -#define LA_TRIGGERA_WILDCARD_MATCH_RESET 18'h0 -#define LA_TRIGGERA_WILDCARD_RESET (32'h0 | \ - LA_TRIGGERA_WILDCARD_MATCH_SET(LA_TRIGGERA_WILDCARD_MATCH_RESET)) -#define LA_TRIGGERA_WILDCARD_HW_MASK (32'h0) -#define LA_TRIGGERA_WILDCARD_SW_MASK (32'h0 | \ - LA_TRIGGERA_WILDCARD_MATCH_MASK) - -#define LA_TRIGGERB_DATA_ADDRESS 'h000000b8 -#define LA_TRIGGERB_DATA_MATCH_MSB 17 -#define LA_TRIGGERB_DATA_MATCH_LSB 0 -#define LA_TRIGGERB_DATA_MATCH_MASK 'h0003ffff -#define LA_TRIGGERB_DATA_MATCH_GET(x) (((x) & LA_TRIGGERB_DATA_MATCH_MASK) >> LA_TRIGGERB_DATA_MATCH_LSB) -#define LA_TRIGGERB_DATA_MATCH_SET(x) (((32'd0 | (x)) << LA_TRIGGERB_DATA_MATCH_LSB) & LA_TRIGGERB_DATA_MATCH_MASK) -#define LA_TRIGGERB_DATA_MATCH_RESET 18'h0 -#define LA_TRIGGERB_DATA_RESET (32'h0 | \ - LA_TRIGGERB_DATA_MATCH_SET(LA_TRIGGERB_DATA_MATCH_RESET)) -#define LA_TRIGGERB_DATA_HW_MASK (32'h0) -#define LA_TRIGGERB_DATA_SW_MASK (32'h0 | \ - LA_TRIGGERB_DATA_MATCH_MASK) - -#define LA_TRIGGERB_WILDCARD_ADDRESS 'h000000bc -#define LA_TRIGGERB_WILDCARD_MATCH_MSB 17 -#define LA_TRIGGERB_WILDCARD_MATCH_LSB 0 -#define LA_TRIGGERB_WILDCARD_MATCH_MASK 'h0003ffff -#define LA_TRIGGERB_WILDCARD_MATCH_GET(x) (((x) & LA_TRIGGERB_WILDCARD_MATCH_MASK) >> LA_TRIGGERB_WILDCARD_MATCH_LSB) -#define LA_TRIGGERB_WILDCARD_MATCH_SET(x) (((32'd0 | (x)) << LA_TRIGGERB_WILDCARD_MATCH_LSB) & LA_TRIGGERB_WILDCARD_MATCH_MASK) -#define LA_TRIGGERB_WILDCARD_MATCH_RESET 18'h0 -#define LA_TRIGGERB_WILDCARD_RESET (32'h0 | \ - LA_TRIGGERB_WILDCARD_MATCH_SET(LA_TRIGGERB_WILDCARD_MATCH_RESET)) -#define LA_TRIGGERB_WILDCARD_HW_MASK (32'h0) -#define LA_TRIGGERB_WILDCARD_SW_MASK (32'h0 | \ - LA_TRIGGERB_WILDCARD_MATCH_MASK) - -#define LA_TRIGGER_ADDRESS 'h000000c0 -#define LA_TRIGGER_EVENT_MSB 2 -#define LA_TRIGGER_EVENT_LSB 0 -#define LA_TRIGGER_EVENT_MASK 'h00000007 -#define LA_TRIGGER_EVENT_GET(x) (((x) & LA_TRIGGER_EVENT_MASK) >> LA_TRIGGER_EVENT_LSB) -#define LA_TRIGGER_EVENT_SET(x) (((32'd0 | (x)) << LA_TRIGGER_EVENT_LSB) & LA_TRIGGER_EVENT_MASK) -#define LA_TRIGGER_EVENT_RESET 3'h0 -#define LA_TRIGGER_RESET (32'h0 | \ - LA_TRIGGER_EVENT_SET(LA_TRIGGER_EVENT_RESET)) -#define LA_TRIGGER_HW_MASK (32'h0) -#define LA_TRIGGER_SW_MASK (32'h0 | \ - LA_TRIGGER_EVENT_MASK) - -#define LA_FIFO_ADDRESS 'h000000c4 -#define LA_FIFO_FULL_MSB 1 -#define LA_FIFO_FULL_LSB 1 -#define LA_FIFO_FULL_MASK 'h00000002 -#define LA_FIFO_FULL_GET(x) (((x) & LA_FIFO_FULL_MASK) >> LA_FIFO_FULL_LSB) -#define LA_FIFO_FULL_SET(x) (((32'd0 | (x)) << LA_FIFO_FULL_LSB) & LA_FIFO_FULL_MASK) -#define LA_FIFO_FULL_RESET 1'h0 -#define LA_FIFO_EMPTY_MSB 0 -#define LA_FIFO_EMPTY_LSB 0 -#define LA_FIFO_EMPTY_MASK 'h00000001 -#define LA_FIFO_EMPTY_GET(x) (((x) & LA_FIFO_EMPTY_MASK) >> LA_FIFO_EMPTY_LSB) -#define LA_FIFO_EMPTY_SET(x) (((32'd0 | (x)) << LA_FIFO_EMPTY_LSB) & LA_FIFO_EMPTY_MASK) -#define LA_FIFO_EMPTY_RESET 1'h0 -#define LA_FIFO_RESET (32'h0 | \ - LA_FIFO_FULL_SET(LA_FIFO_FULL_RESET) | \ - LA_FIFO_EMPTY_SET(LA_FIFO_EMPTY_RESET)) -#define LA_FIFO_HW_MASK (32'h0 | \ - LA_FIFO_FULL_MASK | \ - LA_FIFO_EMPTY_MASK) -#define LA_FIFO_SW_MASK (32'h0) - -#define LA_ADDRESS 'h000000c8 -#define LA_DATA_MSB 17 -#define LA_DATA_LSB 0 -#define LA_DATA_MASK 'h0003ffff -#define LA_DATA_GET(x) (((x) & LA_DATA_MASK) >> LA_DATA_LSB) -#define LA_DATA_SET(x) (((32'd0 | (x)) << LA_DATA_LSB) & LA_DATA_MASK) -#define LA_DATA_RESET 18'h0 -#define LA_RESET (32'h0 | \ - LA_DATA_SET(LA_DATA_RESET)) -#define LA_HW_MASK (32'h0 | \ - LA_DATA_MASK) -#define LA_SW_MASK (32'h0) - -#define ANT_PIN_ADDRESS 'h000000d0 -#define ANT_PIN_PAD_PULL_MSB 3 -#define ANT_PIN_PAD_PULL_LSB 2 -#define ANT_PIN_PAD_PULL_MASK 'h0000000c -#define ANT_PIN_PAD_PULL_GET(x) (((x) & ANT_PIN_PAD_PULL_MASK) >> ANT_PIN_PAD_PULL_LSB) -#define ANT_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << ANT_PIN_PAD_PULL_LSB) & ANT_PIN_PAD_PULL_MASK) -#define ANT_PIN_PAD_PULL_RESET 2'h2 -#define ANT_PIN_PAD_STRENGTH_MSB 1 -#define ANT_PIN_PAD_STRENGTH_LSB 0 -#define ANT_PIN_PAD_STRENGTH_MASK 'h00000003 -#define ANT_PIN_PAD_STRENGTH_GET(x) (((x) & ANT_PIN_PAD_STRENGTH_MASK) >> ANT_PIN_PAD_STRENGTH_LSB) -#define ANT_PIN_PAD_STRENGTH_SET(x) (((32'd0 | (x)) << ANT_PIN_PAD_STRENGTH_LSB) & ANT_PIN_PAD_STRENGTH_MASK) -#define ANT_PIN_PAD_STRENGTH_RESET 2'h1 -#define ANT_PIN_RESET (32'h0 | \ - ANT_PIN_PAD_PULL_SET(ANT_PIN_PAD_PULL_RESET) | \ - ANT_PIN_PAD_STRENGTH_SET(ANT_PIN_PAD_STRENGTH_RESET)) -#define ANT_PIN_HW_MASK (32'h0) -#define ANT_PIN_SW_MASK (32'h0 | \ - ANT_PIN_PAD_PULL_MASK | \ - ANT_PIN_PAD_STRENGTH_MASK) - -#define ANTD_PIN_ADDRESS 'h000000d4 -#define ANTD_PIN_PAD_PULL_MSB 1 -#define ANTD_PIN_PAD_PULL_LSB 0 -#define ANTD_PIN_PAD_PULL_MASK 'h00000003 -#define ANTD_PIN_PAD_PULL_GET(x) (((x) & ANTD_PIN_PAD_PULL_MASK) >> ANTD_PIN_PAD_PULL_LSB) -#define ANTD_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << ANTD_PIN_PAD_PULL_LSB) & ANTD_PIN_PAD_PULL_MASK) -#define ANTD_PIN_PAD_PULL_RESET 2'h1 -#define ANTD_PIN_RESET (32'h0 | \ - ANTD_PIN_PAD_PULL_SET(ANTD_PIN_PAD_PULL_RESET)) -#define ANTD_PIN_HW_MASK (32'h0) -#define ANTD_PIN_SW_MASK (32'h0 | \ - ANTD_PIN_PAD_PULL_MASK) - -#define GPIO_PIN_ADDRESS 'h000000d8 -#define GPIO_PIN_PAD_PULL_MSB 3 -#define GPIO_PIN_PAD_PULL_LSB 2 -#define GPIO_PIN_PAD_PULL_MASK 'h0000000c -#define GPIO_PIN_PAD_PULL_GET(x) (((x) & GPIO_PIN_PAD_PULL_MASK) >> GPIO_PIN_PAD_PULL_LSB) -#define GPIO_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << GPIO_PIN_PAD_PULL_LSB) & GPIO_PIN_PAD_PULL_MASK) -#define GPIO_PIN_PAD_PULL_RESET 2'h2 -#define GPIO_PIN_PAD_STRENGTH_MSB 1 -#define GPIO_PIN_PAD_STRENGTH_LSB 0 -#define GPIO_PIN_PAD_STRENGTH_MASK 'h00000003 -#define GPIO_PIN_PAD_STRENGTH_GET(x) (((x) & GPIO_PIN_PAD_STRENGTH_MASK) >> GPIO_PIN_PAD_STRENGTH_LSB) -#define GPIO_PIN_PAD_STRENGTH_SET(x) (((32'd0 | (x)) << GPIO_PIN_PAD_STRENGTH_LSB) & GPIO_PIN_PAD_STRENGTH_MASK) -#define GPIO_PIN_PAD_STRENGTH_RESET 2'h1 -#define GPIO_PIN_RESET (32'h0 | \ - GPIO_PIN_PAD_PULL_SET(GPIO_PIN_PAD_PULL_RESET) | \ - GPIO_PIN_PAD_STRENGTH_SET(GPIO_PIN_PAD_STRENGTH_RESET)) -#define GPIO_PIN_HW_MASK (32'h0) -#define GPIO_PIN_SW_MASK (32'h0 | \ - GPIO_PIN_PAD_PULL_MASK | \ - GPIO_PIN_PAD_STRENGTH_MASK) - -#define GPIO_H_PIN_ADDRESS 'h000000dc -#define GPIO_H_PIN_PAD_PULL_MSB 1 -#define GPIO_H_PIN_PAD_PULL_LSB 0 -#define GPIO_H_PIN_PAD_PULL_MASK 'h00000003 -#define GPIO_H_PIN_PAD_PULL_GET(x) (((x) & GPIO_H_PIN_PAD_PULL_MASK) >> GPIO_H_PIN_PAD_PULL_LSB) -#define GPIO_H_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << GPIO_H_PIN_PAD_PULL_LSB) & GPIO_H_PIN_PAD_PULL_MASK) -#define GPIO_H_PIN_PAD_PULL_RESET 2'h0 -#define GPIO_H_PIN_RESET (32'h0 | \ - GPIO_H_PIN_PAD_PULL_SET(GPIO_H_PIN_PAD_PULL_RESET)) -#define GPIO_H_PIN_HW_MASK (32'h0) -#define GPIO_H_PIN_SW_MASK (32'h0 | \ - GPIO_H_PIN_PAD_PULL_MASK) - -#define BT_PIN_ADDRESS 'h000000e0 -#define BT_PIN_PAD_PULL_MSB 3 -#define BT_PIN_PAD_PULL_LSB 2 -#define BT_PIN_PAD_PULL_MASK 'h0000000c -#define BT_PIN_PAD_PULL_GET(x) (((x) & BT_PIN_PAD_PULL_MASK) >> BT_PIN_PAD_PULL_LSB) -#define BT_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << BT_PIN_PAD_PULL_LSB) & BT_PIN_PAD_PULL_MASK) -#define BT_PIN_PAD_PULL_RESET 2'h0 -#define BT_PIN_PAD_STRENGTH_MSB 1 -#define BT_PIN_PAD_STRENGTH_LSB 0 -#define BT_PIN_PAD_STRENGTH_MASK 'h00000003 -#define BT_PIN_PAD_STRENGTH_GET(x) (((x) & BT_PIN_PAD_STRENGTH_MASK) >> BT_PIN_PAD_STRENGTH_LSB) -#define BT_PIN_PAD_STRENGTH_SET(x) (((32'd0 | (x)) << BT_PIN_PAD_STRENGTH_LSB) & BT_PIN_PAD_STRENGTH_MASK) -#define BT_PIN_PAD_STRENGTH_RESET 2'h1 -#define BT_PIN_RESET (32'h0 | \ - BT_PIN_PAD_PULL_SET(BT_PIN_PAD_PULL_RESET) | \ - BT_PIN_PAD_STRENGTH_SET(BT_PIN_PAD_STRENGTH_RESET)) -#define BT_PIN_HW_MASK (32'h0) -#define BT_PIN_SW_MASK (32'h0 | \ - BT_PIN_PAD_PULL_MASK | \ - BT_PIN_PAD_STRENGTH_MASK) - -#define BT_WLAN_PIN_ADDRESS 'h000000e4 -#define BT_WLAN_PIN_PAD_PULL_MSB 1 -#define BT_WLAN_PIN_PAD_PULL_LSB 0 -#define BT_WLAN_PIN_PAD_PULL_MASK 'h00000003 -#define BT_WLAN_PIN_PAD_PULL_GET(x) (((x) & BT_WLAN_PIN_PAD_PULL_MASK) >> BT_WLAN_PIN_PAD_PULL_LSB) -#define BT_WLAN_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << BT_WLAN_PIN_PAD_PULL_LSB) & BT_WLAN_PIN_PAD_PULL_MASK) -#define BT_WLAN_PIN_PAD_PULL_RESET 2'h2 -#define BT_WLAN_PIN_RESET (32'h0 | \ - BT_WLAN_PIN_PAD_PULL_SET(BT_WLAN_PIN_PAD_PULL_RESET)) -#define BT_WLAN_PIN_HW_MASK (32'h0) -#define BT_WLAN_PIN_SW_MASK (32'h0 | \ - BT_WLAN_PIN_PAD_PULL_MASK) - -#define SI_UART_PIN_ADDRESS 'h000000e8 -#define SI_UART_PIN_PAD_PULL_MSB 3 -#define SI_UART_PIN_PAD_PULL_LSB 2 -#define SI_UART_PIN_PAD_PULL_MASK 'h0000000c -#define SI_UART_PIN_PAD_PULL_GET(x) (((x) & SI_UART_PIN_PAD_PULL_MASK) >> SI_UART_PIN_PAD_PULL_LSB) -#define SI_UART_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << SI_UART_PIN_PAD_PULL_LSB) & SI_UART_PIN_PAD_PULL_MASK) -#define SI_UART_PIN_PAD_PULL_RESET 2'h1 -#define SI_UART_PIN_PAD_STRENGTH_MSB 1 -#define SI_UART_PIN_PAD_STRENGTH_LSB 0 -#define SI_UART_PIN_PAD_STRENGTH_MASK 'h00000003 -#define SI_UART_PIN_PAD_STRENGTH_GET(x) (((x) & SI_UART_PIN_PAD_STRENGTH_MASK) >> SI_UART_PIN_PAD_STRENGTH_LSB) -#define SI_UART_PIN_PAD_STRENGTH_SET(x) (((32'd0 | (x)) << SI_UART_PIN_PAD_STRENGTH_LSB) & SI_UART_PIN_PAD_STRENGTH_MASK) -#define SI_UART_PIN_PAD_STRENGTH_RESET 2'h1 -#define SI_UART_PIN_RESET (32'h0 | \ - SI_UART_PIN_PAD_PULL_SET(SI_UART_PIN_PAD_PULL_RESET) | \ - SI_UART_PIN_PAD_STRENGTH_SET(SI_UART_PIN_PAD_STRENGTH_RESET)) -#define SI_UART_PIN_HW_MASK (32'h0) -#define SI_UART_PIN_SW_MASK (32'h0 | \ - SI_UART_PIN_PAD_PULL_MASK | \ - SI_UART_PIN_PAD_STRENGTH_MASK) - -#define CLK32K_PIN_ADDRESS 'h000000ec -#define CLK32K_PIN_PAD_PULL_MSB 1 -#define CLK32K_PIN_PAD_PULL_LSB 0 -#define CLK32K_PIN_PAD_PULL_MASK 'h00000003 -#define CLK32K_PIN_PAD_PULL_GET(x) (((x) & CLK32K_PIN_PAD_PULL_MASK) >> CLK32K_PIN_PAD_PULL_LSB) -#define CLK32K_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << CLK32K_PIN_PAD_PULL_LSB) & CLK32K_PIN_PAD_PULL_MASK) -#define CLK32K_PIN_PAD_PULL_RESET 2'h0 -#define CLK32K_PIN_RESET (32'h0 | \ - CLK32K_PIN_PAD_PULL_SET(CLK32K_PIN_PAD_PULL_RESET)) -#define CLK32K_PIN_HW_MASK (32'h0) -#define CLK32K_PIN_SW_MASK (32'h0 | \ - CLK32K_PIN_PAD_PULL_MASK) - -#define RESET_TUPLE_STATUS_ADDRESS 'h000000f0 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MSB 11 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB 8 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK 'h00000f00 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_GET(x) (((x) & RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK) >> RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB) -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_SET(x) (((32'd0 | (x)) << RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB) & RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK) -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_RESET 4'h0 -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MSB 7 -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB 0 -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK 'h000000ff -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_GET(x) (((x) & RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK) >> RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB) -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_SET(x) (((32'd0 | (x)) << RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB) & RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK) -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_RESET 8'h0 -#define RESET_TUPLE_STATUS_RESET (32'h0 | \ - RESET_TUPLE_STATUS_TEST_RESET_TUPLE_SET(RESET_TUPLE_STATUS_TEST_RESET_TUPLE_RESET) | \ - RESET_TUPLE_STATUS_PIN_RESET_TUPLE_SET(RESET_TUPLE_STATUS_PIN_RESET_TUPLE_RESET)) -#define RESET_TUPLE_STATUS_HW_MASK (32'h0 | \ - RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK | \ - RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK) -#define RESET_TUPLE_STATUS_SW_MASK (32'h0) - -#define GPIO_REG_ADDRESS_MSB 7 - -#endif /* _GPIO_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/mac_pcu.h b/drivers/net/wireless/ar6003/include/AR6002/hw/mac_pcu.h deleted file mode 100644 index 6a07583b91b8..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/mac_pcu.h +++ /dev/null @@ -1,980 +0,0 @@ -#ifndef _MAC_PCU_H -#define _MAC_PCU_H - -#define FIFO_BOUND 1024 - -#define CLK32_TIMER0 0 -#define CLK32_TIMER1 1 -#define CLK32_TIMER2 2 -#define CLK32_TIMER3 3 -#define CLK32_TSF_L32 4 -#define CLK32_TSF_U32 5 -#define CLK32_SLP1 6 -#define CLK32_SLP2 7 -#define CLK32_SLP3 8 -#define CLK32_QT1 9 -#define CLK32_QT2 10 -//#define CLK32_TSFCAL 11 - -//#define CLK_S_SYNC1 0 -//#define CLK_S_SYNC6 1 -//#define CLK_S_SYNC7 2 -//#define CLK_S_SYNC8 3 - -#define KTYPE_40 0 -#define KTYPE_104 1 -#define KTYPE_TKIP_NO_MIC 2 -#define KTYPE_128 3 -#define KTYPE_TKIP 4 -//#define KTYPE_AES_OCB 5 -#define KTYPE_WAPI 5 -#define KTYPE_AES_CCM 6 -#define KTYPE_NOTHING 7 - -//Frame Type in Descriptor -#define TXDESC_FT_NORMAL 0 -#define TXDESC_FT_ATIM 1 -#define TXDESC_FT_PS_POLL 2 -#define TXDESC_FT_BEACON 3 -#define TXDESC_FT_PROBE_RESP 4 -#define TXDESC_FT_CHIRP 5 -#define TXDESC_FT_GROUP_POLL 6 -#define TXDESC_FT_DIRECT_POLL 7 -//#define TXDESC_FT_SYNC 8 -#define TXDESC_FT_BEACON_NO_TSF_UPDATE 9 - -//Frame Type: Management -#define FTYPE_ASSOCIATION_REQ 0x00 -#define FTYPE_ASSOCIATION_RES 0x04 -#define FTYPE_REASSOCIATION_REQ 0x08 -#define FTYPE_REASSOCIATION_RES 0x0c -#define FTYPE_PBREQ 0x10 // change to TYPE_PROBE_REQ TBD -#define FTYPE_PBRES 0x14 // change to TYPE_PROBE_RES TBD -#define FTYPE_BEACON 0x20 -#define FTYPE_ATIM 0x24 -#define FTYPE_DISASSOCIATE 0x28 -#define FTYPE_AUTHENICATE 0x2c -#define FTYPE_DEAUTHENICATE 0x30 - -//Frame Type: Control -#define FTYPE_PSPOLL 0x29 -#define FTYPE_RTS 0x2d -#define FTYPE_CTS 0x31 -#define FTYPE_ACK 0x35 -#define FTYPE_CFEND 0x39 -#define FTYPE_CFEND_ACK 0x3d // change to FTYPE_CFEND_ACK TBD - -//Frame Type: Data -#define FTYPE_DATA 0x02 -#define FTYPE_DATA_CFACK 0x06 -#define FTYPE_DATA_CFPOLL 0x0a -#define FTYPE_DATA_CFACK_CFPOLL 0x0e -#define FTYPE_NULL 0x12 -#define FTYPE_CFACK 0x16 -#define FTYPE_CFPOLL 0x1a -#define FTYPE_CFACK_CFPOLL 0x1e - -//Frame Control Fields -#define FCTL_TO_DS 8 -#define FCTL_FROM_DS 9 -#define FCTL_MORE_FRAG 10 -#define FCTL_RETRY 11 -#define FCTL_POWER_MGNT 12 -#define FCTL_MORE_DATA 13 -#define FCTL_WEP 14 -#define FCTL_TYPE 3:2 - -//Rate -#define OFDM_RATE_6Mb 0x0b -#define OFDM_RATE_9Mb 0x0f -#define OFDM_RATE_12Mb 0x0a -#define OFDM_RATE_18Mb 0x0e -#define OFDM_RATE_24Mb 0x09 -#define OFDM_RATE_36Mb 0x0d -#define OFDM_RATE_48Mb 0x08 -#define OFDM_RATE_54Mb 0x0c -#define CCK_RATE_1Mb_L 0x1b -#define CCK_RATE_2Mb_L 0x1a -#define CCK_RATE_2Mb_S 0x1e -#define CCK_RATE_5_5Mb_L 0x19 -#define CCK_RATE_5_5Mb_S 0x1d -#define CCK_RATE_11Mb_L 0x18 - -#define CCK_RATE_11Mb_S 0x1c -#define XR_RATE_0_25Mb 0x03 -#define XR_RATE_0_5Mb 0x07 -#define XR_RATE_1Mb 0x02 -#define XR_RATE_2Mb 0x06 -#define XR_RATE_3Mb 0x01 - -//Registers -#define PCU_REG 0x0 -#define KEY_REG 0x1 -#define D2A2_REG 0x3 - -#define REG_STA_ID0 0x0 -#define STA_ADDR_L32 31:0 - -#define REG_STA_ID1 0x1 -#define STA_ADDR_U16 15:0 -#define AP 16 -#define ADHOC 17 -#define PWR_SV 18 -#define NO_KEYSRCH 19 -#define PCF 20 -#define USE_DEF_ANT 21 -#define DEF_ANT_UPDATE 22 -#define RTS_DEF_ANT 23 -#define ACKCTS_6MB 24 -#define RATE_11B 25 -#define SECTOR_SELF_GEN 26 -#define CRPT_MIC_ENABLE 27 -#define KSRCH_MODE 28 -#define PRESERVE_SEQNUM 29 -#define CBCIV_ENDIAN 30 -#define ADHOC_MCAST_SEARCH 31 - -#define REG_BSS_ID0 0x2 -#define BSSID_L32 31:0 - -#define REG_BSS_ID1 0x3 -#define BSSID_U16 15:0 -#define AID 31:16 - -#define MAC_PCU_REG_BCNRSSI_OFFSET 0x4 -#define MAC_PCU_REG_BCNRSSI_BCN_RSSI_AVE_FIELD 11:0 -#define MAC_PCU_REG_BCNRSSI_BCN_RSSI_AVE_RESET 0x800 - -#define REG_TIME_OUT 0x5 -#define ACK_TIME_OUT 15:0 -#define CTS_TIME_OUT 31:16 - -#define MAC_PCU_REG_BCNSIG_OFFSET 0x6 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_LO_THR_FIELD 7:0 -#define MAC_PCU_REG_BCNSIG_BCN_MISS_THR_FIELD 15:8 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_HI_THR_FIELD 23:16 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_WEIGHT_FIELD 28:24 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_RESET_FIELD 29 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_LO_THR_RESET 0 -#define MAC_PCU_REG_BCNSIG_BCN_MISS_THR_RESET 0xFF -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_HI_THR_RESET 0x7F -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_WEIGHT_RESET 0 - -#define REG_USEC 0x7 -#define USEC 6:0 -#define USEC32 13:7 -#define TX_DELAY 18:14 -#define RX_DELAY 24:19 - -#define REG_BEACON 0x8 -#define BEACON_PERIOD 15:0 -#define TIM_OFFSET 22:16 -#define RESET_TSF 24 - -#define REG_CFP_PERIOD 0x9 - -#define REG_TIMER0 0xa - -#define REG_TIMER1 0xb - -#define REG_TIMER2 0xc - -#define REG_TIMER3 0xd - -#define REG_CFP_DUR 0xe - -#define REG_RX_FILTER 0xf -#define UNICAST 0 -#define MULTICAST 1 -#define BROADCAST 2 -#define CONTROL 3 -#define BEACON 4 -#define PROMISCUOUS 5 -#define XR_POLL 6 -#define PROBE_REQ 7 -//#define SYNC 8 -#define MY_BEACON 9 - -#define REG_MCAST_FIL0 0x10 - -#define REG_MCAST_FIL1 0x11 - -#define MAC_PCU_REG_DIAGSW_OFFSET 0x12 -#define MAC_PCU_REG_DIAGSW_DIS_WEP_ACK_FIELD 0 -#define MAC_PCU_REG_DIAGSW_DIS_ACK_FIELD 1 -#define MAC_PCU_REG_DIAGSW_DIS_CTS_FIELD 2 -#define MAC_PCU_REG_DIAGSW_DIS_ENC_FIELD 3 -#define MAC_PCU_REG_DIAGSW_DIS_DEC_FIELD 4 -#define MAC_PCU_REG_DIAGSW_DIS_RX_FIELD 5 -#define MAC_PCU_REG_DIAGSW_LOOP_BACK_FIELD 6 -#define MAC_PCU_REG_DIAGSW_CORR_FCS_FIELD 7 -#define MAC_PCU_REG_DIAGSW_CHAN_INFO_FIELD 8 -#define MAC_PCU_REG_DIAGSW_RESERVED_FIELD 16:9 -#define MAC_PCU_REG_DIAGSW_ACCEPT_NONV0_FIELD 17 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_0_1_FIELD 19:18 -#define MAC_PCU_REG_DIAGSW_RXCLR_HIGH_FIELD 20 -#define MAC_PCU_REG_DIAGSW_IGNORE_NAV_FIELD 21 -#define MAC_PCU_REG_DIAGSW_CHANIDLE_HIGH_FIELD 22 -#define MAC_PCU_REG_DIAGSW_PHYERR_ENABLE_NEW_FIELD 23 -#define MAC_PCU_REG_DIAGSW_DUAL_CHAIN_CHAN_INFO_FIELD 24 -#define MAC_PCU_REG_DIAGSW_FORCE_RX_ABORT_FIELD 25 -#define MAC_PCU_REG_DIAGSW_SATURATE_CYCLE_CNT_FIELD 26 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_2_FIELD 27 -#define MAC_PCU_REG_DIAGSW_DIS_WEP_ACK_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_ACK_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_CTS_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_ENC_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_DEC_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_RX_RESET 0 -#define MAC_PCU_REG_DIAGSW_LOOP_BACK_RESET 0 -#define MAC_PCU_REG_DIAGSW_CORR_FCS_RESET 0 -#define MAC_PCU_REG_DIAGSW_CHAN_INFO_RESET 0 -#define MAC_PCU_REG_DIAGSW_RESERVED_RESET 0 -#define MAC_PCU_REG_DIAGSW_ACCEPT_NONV0_RESET 0 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_0_1_RESET 0 -#define MAC_PCU_REG_DIAGSW_RXCLR_HIGH_RESET 0 -#define MAC_PCU_REG_DIAGSW_IGNORE_NAV_RESET 0 -#define MAC_PCU_REG_DIAGSW_CHANIDLE_HIGH_RESET 0 -#define MAC_PCU_REG_DIAGSW_PHYERR_ENABLE_NEW_RESET 0 -#define MAC_PCU_REG_DIAGSW_DUAL_CHAIN_CHAN_INFO_RESET 0 -#define MAC_PCU_REG_DIAGSW_FORCE_RX_ABORT_RESET 0 -#define MAC_PCU_REG_DIAGSW_SATURATE_CYCLE_CNT_RESET 0 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_2_RESET 0 - -#define REG_TSF_L32 0x13 - -#define REG_TSF_U32 0x14 - -#define REG_TST_ADDAC 0x15 -#define TEST_MODE 0 -#define TEST_LOOP 1 -#define LOOP_LEN 12:2 -#define TEST_UPPER_8B 13 -#define TEST_MSB 14 -#define TEST_CAPTURE 15 - -#define REG_DEF_ANT 0x16 - -#define MAC_PCU_REG_MUTE_MASKS0_OFFSET 0x17 -#define MAC_PCU_REG_MUTE_MASKS0_FC_FIELD 15:0 -#define MAC_PCU_REG_MUTE_MASKS0_QOS_FIELD 31:16 -#define MAC_PCU_REG_MUTE_MASKS0_FC_RESET 0xC7FF -#define MAC_PCU_REG_MUTE_MASKS0_QOS_RESET 0xFFFF - -#define MAC_PCU_REG_MUTE_MASKS1_OFFSET 0x18 -#define MAC_PCU_REG_MUTE_MASKS1_SEQ_FIELD 15:0 -#define MAC_PCU_REG_MUTE_MASKS1_FC_MGMT_FIELD 31:16 -#define MAC_PCU_REG_MUTE_MASKS1_SEQ_RESET 0x000F -#define MAC_PCU_REG_MUTE_MASKS1_FC_MGMT_RESET 0xE7FF - -#define MAC_PCU_REG_GATED_CLKS_OFFSET 0x19 -//#define MAC_PCU_REG_GATED_SYNC_FIELD 0 -#define MAC_PCU_REG_GATED_TX_FIELD 1 -#define MAC_PCU_REG_GATED_RX_FIELD 2 -#define MAC_PCU_REG_GATED_REG_FIELD 3 -//#define MAC_PCU_REG_GATED_SYNC_RESET 0x1 -#define MAC_PCU_REG_GATED_TX_RESET 0x0 -#define MAC_PCU_REG_GATED_RX_RESET 0x0 -#define MAC_PCU_REG_GATED_REG_RESET 0x0 - -#define MAC_PCU_REG_OBS2_OFFSET 0x1a -#define MAC_PCU_REG_OBS2_OBS_BUS_FIELD 17:0 - -#define MAC_PCU_REG_OBS1_OFFSET 0x1b -#define MAC_PCU_REG_OBS1_TX_STATE_FIELD 28:24 -#define MAC_PCU_REG_OBS1_RX_STATE_FIELD 23:20 -#define MAC_PCU_REG_OBS1_WEP_STATE_FIELD 17:12 -#define MAC_PCU_REG_OBS1_RX_CLEAR_FIELD 11 -#define MAC_PCU_REG_OBS1_RX_FRAME_FIELD 10 -#define MAC_PCU_REG_OBS1_TX_FRAME_FIELD 9 -#define MAC_PCU_REG_OBS1_TX_HOLD_FIELD 8 -#define MAC_PCU_REG_OBS1_CHAN_IDLE_FIELD 7 -#define MAC_PCU_REG_OBS1_QUIET_TIME_FIELD 6 -#define MAC_PCU_REG_OBS1_TX_HCF_FIELD 5 -#define MAC_PCU_REG_OBS1_FILTER_PASS_FIELD 4 -#define MAC_PCU_REG_OBS1_RX_MY_BEACON_FIELD 3 -#define MAC_PCU_REG_OBS1_RX_WEP_FIELD 2 -#define MAC_PCU_REG_OBS1_PCU_RX_END_FIELD 1 -#define MAC_PCU_REG_OBS1_PCU_DIRECTED_FIELD 0 - -#define REG_LAST_TSTP 0x20 - -#define REG_NAV 0x21 - -#define REG_RTS_OK 0x22 - -#define REG_RTS_FAIL 0x23 - -#define REG_ACK_FAIL 0x24 - -#define REG_FCS_FAIL 0x25 - -#define REG_BEACON_CNT 0x26 - -#define MAC_PCU_REG_XRMODE_OFFSET 0x30 -#define MAC_PCU_REG_XRMODE_XR_POLL_TYPE_FIELD 5:0 -#define MAC_PCU_REG_XRMODE_XR_WAIT_FOR_POLL_FIELD 7 -#define MAC_PCU_REG_XRMODE_XR_FRAME_HOLD_FIELD 31:20 -#define MAC_PCU_REG_XRMODE_XR_POLL_TYPE_RESET 0x1A -#define MAC_PCU_REG_XRMODE_XR_WAIT_FOR_POLL_RESET 0x0 -#define MAC_PCU_REG_XRMODE_XR_FRAME_HOLD_RESET 680 - -#define MAC_PCU_REG_XRDEL_OFFSET 0x31 -#define MAC_PCU_REG_XRDEL_XR_SLOT_DELAY_FIELD 15:0 -#define MAC_PCU_REG_XRDEL_XR_CHIRP_DATA_DELAY_FIELD 31:16 -#define MAC_PCU_REG_XRDEL_XR_SLOT_DELAY_RESET 360 -#define MAC_PCU_REG_XRDEL_XR_CHIRP_DATA_DELAY_RESET 1680 - -#define MAC_PCU_REG_XRTO_OFFSET 0x32 -#define MAC_PCU_REG_XRTO_XR_CHIRP_TIMEOUT_FIELD 15:0 -#define MAC_PCU_REG_XRTO_XR_POLL_TIMEOUT_FIELD 31:16 -#define MAC_PCU_REG_XRTO_XR_CHIRP_TIMEOUT_RESET 7200 -#define MAC_PCU_REG_XRTO_XR_POLL_TIMEOUT_RESET 5000 - -#define MAC_PCU_REG_XRCRP_OFFSET 0x33 -#define MAC_PCU_REG_XRCRP_XR_SEND_CHIRP_FIELD 0 -#define MAC_PCU_REG_XRCRP_XR_CHIRP_GAP_FIELD 31:16 -#define MAC_PCU_REG_XRCRP_XR_SEND_CHIRP_RESET 0x0 -#define MAC_PCU_REG_XRCRP_XR_CHIRP_GAP_RESET 500 - -#define MAC_PCU_REG_XRSTMP_OFFSET 0x34 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_FIELD 0 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_BSSID_FIELD 1 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_FIELD 2 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_BSSID_FIELD 3 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_DATA_FIELD 4 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_DATA_FIELD 5 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_THRESH_FIELD 15:8 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_THRESH_FIELD 23:16 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_RESET 0x0 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_BSSID_RESET 0x0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_RESET 0x0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_BSSID_RESET 0x0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_DATA_RESET 0x0 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_DATA_RESET 0x0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_THRESH_RESET 0x25 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_THRESH_RESET 0x25 - -#define MAC_PCU_REG_SLP1_OFFSET 0x35 -//#define MAC_PCU_REG_SLP1_NEXT_DTIM_FIELD 18:0 -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_EXT_FIELD 4:0 -#define MAC_PCU_REG_SLP1_ASSUME_DTIM_FIELD 19 -//#define MAC_PCU_REG_SLP1_ENH_SLEEP_ENABLE_FIELD 20 -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_FIELD 31:21 -// #define MAC_PCU_REG_SLP1_NEXT_DTIM_RESET 0x2aaaa -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_EXT_RESET 0x0 -#define MAC_PCU_REG_SLP1_ASSUME_DTIM_RESET 0x0 -//#define MAC_PCU_REG_SLP1_ENH_SLEEP_ENABLE_RESET 0x1 -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_RESET 5 - -#define MAC_PCU_REG_SLP2_OFFSET 0x36 -//#define MAC_PCU_REG_SLP2_NEXT_TIM_FIELD 18:0 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_EXT_FIELD 4:0 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_FIELD 31:21 -//#define MAC_PCU_REG_SLP2_NEXT_TIM_RESET 0x55555 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_EXT_RESET 0x0 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_RESET 2 - -//#define MAC_PCU_REG_SLP3_OFFSET 0x37 -//#define MAC_PCU_REG_SLP3_TIM_PERIOD_FIELD 15:0 -//#define MAC_PCU_REG_SLP3_DTIM_PERIOD_FIELD 31:16 -//#define MAC_PCU_REG_SLP3_TIM_PERIOD_RESET 2 -//#define MAC_PCU_REG_SLP3_DTIM_PERIOD_RESET 3 - -#define MAC_PCU_REG_BSSMSKL_OFFSET 0x38 -#define MAC_PCU_REG_BSSMSKL_BSSID_MASK_L_FIELD 31:0 -#define MAC_PCU_REG_BSSMSKL_BSSID_MASK_L_RESET 0xFFFFFFFF - -#define MAC_PCU_REG_BSSMSKH_OFFSET 0x39 -#define MAC_PCU_REG_BSSMSKH_BSSID_MASK_H_FIELD 15:0 -#define MAC_PCU_REG_BSSMSKH_BSSID_MASK_H_RESET 0xFFFF - -#define MAC_PCU_REG_TPC_OFFSET 0x3A -#define MAC_PCU_REG_TPC_ACK_PWR_FIELD 5:0 -#define MAC_PCU_REG_TPC_CTS_PWR_FIELD 13:8 -#define MAC_PCU_REG_TPC_CHIRP_PWR_FIELD 21:16 -#define MAC_PCU_REG_TPC_ACK_PWR_RESET 0x3f -#define MAC_PCU_REG_TPC_CTS_PWR_RESET 0x3f -#define MAC_PCU_REG_TPC_CHIRP_PWR_RESET 0x3f - -#define MAC_PCU_REG_TFC_OFFSET 0x3B -#define MAC_PCU_REG_TFC_TX_FRAME_CNT_FIELD 31:0 -#define MAC_PCU_REG_TFC_TX_FRAME_CNT_RESET 0 - -#define MAC_PCU_REG_RFC_OFFSET 0x3C -#define MAC_PCU_REG_RFC_RX_FRAME_CNT_FIELD 31:0 -#define MAC_PCU_REG_RFC_RX_FRAME_CNT_RESET 0 - -#define MAC_PCU_REG_RCC_OFFSET 0x3D -#define MAC_PCU_REG_RCC_RX_CLEAR_CNT_FIELD 31:0 -#define MAC_PCU_REG_RCC_RX_CLEAR_CNT_RESET 0 - -#define MAC_PCU_REG_CC_OFFSET 0x3E -#define MAC_PCU_REG_CC_CYCLE_CNT_FIELD 31:0 -#define MAC_PCU_REG_CC_CYCLE_CNT_RESET 0 - -#define MAC_PCU_REG_QT1_OFFSET 0x3F -#define MAC_PCU_REG_QT1_NEXT_QUIET_FIELD 15:0 -#define MAC_PCU_REG_QT1_QUIET_ENABLE_FIELD 16 -#define MAC_PCU_REG_QT1_QUIET_ACK_CTS_ENABLE_FIELD 17 -#define MAC_PCU_REG_QT1_NEXT_QUIET_RESET 0 -#define MAC_PCU_REG_QT1_QUIET_ENABLE_RESET 0x0 -#define MAC_PCU_REG_QT1_QUIET_ACK_CTS_ENABLE_RESET 0x1 - -#define MAC_PCU_REG_QT2_OFFSET 0x40 -#define MAC_PCU_REG_QT2_QUIET_PERIOD_FIELD 15:0 -#define MAC_PCU_REG_QT2_QUIET_DURATION_FIELD 31:16 -#define MAC_PCU_REG_QT2_QUIET_PERIOD_RESET 0002 -#define MAC_PCU_REG_QT2_QUIET_DURATION_RESET 0001 - -#define MAC_PCU_REG_TSF_OFFSET 0x41 -#define MAC_PCU_REG_TSF_INCREMENT_FIELD 7:0 -#define MAC_PCU_REG_TSF_INCREMENT_RESET 0x01 - -#define MAC_PCU_REG_NOACK_OFFSET 0x42 -#define MAC_PCU_REG_NOACK_2_BIT_VALUES_FIELD 3:0 -#define MAC_PCU_REG_NOACK_BIT_OFFSET_FIELD 6:4 -#define MAC_PCU_REG_NOACK_BYTE_OFFSET_FIELD 8:7 -#define MAC_PCU_REG_NOACK_2_BIT_VALUES_RESET 0x2 -#define MAC_PCU_REG_NOACK_BIT_OFFSET_RESET 0x5 -#define MAC_PCU_REG_NOACK_BYTE_OFFSET_RESET 0x0 - -#define MAC_PCU_REG_PHYERR_OFFSET 0x43 -#define MAC_PCU_REG_PHYERR_MASK_FIELD 31:0 -#define MAC_PCU_REG_PHYERR_MASK_RESET 0x0 - -#define MAC_PCU_REG_XRLAT_OFFSET 0x44 -#define MAC_PCU_REG_XRLAT_XR_TX_DELAY_FIELD 11:0 -#define MAC_PCU_REG_XRLAT_XR_TX_DELAY_RESET 0x168 - -#define MAC_PCU_REG_ACKSIFS_OFFSET_RESERVED 0x45 -#define MAC_PCU_REG_ACKSIFS_INCREMENT_FIELD_RESERVED 7:0 -#define MAC_PCU_REG_ACKSIFS_INCREMENT_RESET_RESERVED 0x0 - -#define MAC_PCU_REG_MICQOSCTL_OFFSET 0x46 -#define MAC_PCU_REG_MICQOSCTL_FIELD 15:0 -#define MAC_PCU_REG_MICQOSCTL_ENABLE_FIELD 16 -#define MAC_PCU_REG_MICQOSCTL_RESET 0x00aa -#define MAC_PCU_REG_MICQOSCTL_ENABLE_RESET 0x1 - -#define MAC_PCU_REG_MICQOSSEL_OFFSET 0x47 -#define MAC_PCU_REG_MICQOSSEL_FIELD 31:0 -#define MAC_PCU_REG_MICQOSSEL_RESET 0x00003210 - -#define MAC_PCU_REG_MISCMODE_OFFSET 0x48 -#define MAC_PCU_REG_MISCMODE_BSSID_MATCH_FORCE_FIELD 0 -#define MAC_PCU_REG_MISCMODE_ACKSIFS_MEMORY_FIELD_RESERVED 1 -#define MAC_PCU_REG_MISCMODE_MIC_NEW_LOCATION_FIELD 2 -#define MAC_PCU_REG_MISCMODE_TX_ADD_TSF_FIELD 3 -#define MAC_PCU_REG_MISCMODE_CCK_SIFS_MODE_FIELD 4 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MODE_FIELD_RESERVED 5 -#define MAC_PCU_REG_MISCMODE_BFCOEF_ENABLE_FIELD 6 -#define MAC_PCU_REG_MISCMODE_BFCOEF_UPDATE_SELF_GEN_FIELD 7 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MCAST_FIELD 8 -#define MAC_PCU_REG_MISCMODE_DUAL_CHAIN_ANT_MODE_FIELD 9 -#define MAC_PCU_REG_MISCMODE_FALCON_DESC_MODE_FIELD 10 -#define MAC_PCU_REG_MISCMODE_KC_RX_ANT_UPDATE_FIELD 11 -#define MAC_PCU_REG_MISCMODE_TXOP_TBTT_LIMIT_FIELD 12 -#define MAC_PCU_REG_MISCMODE_FALCON_BB_INTERFACE_FIELD 13 -#define MAC_PCU_REG_MISCMODE_MISS_BEACON_IN_SLEEP_FIELD 14 -#define MAC_PCU_REG_MISCMODE_BUG_12306_FIX_ENABLE_FIELD 17 -#define MAC_PCU_REG_MISCMODE_FORCE_QUIET_COLLISION_FIELD 18 -#define MAC_PCU_REG_MISCMODE_BUG_12549_FORCE_TXBF_FIELD 19 -#define MAC_PCU_REG_MISCMODE_BT_ANT_PREVENTS_RX_FIELD 20 -#define MAC_PCU_REG_MISCMODE_TBTT_PROTECT_FIELD 21 -#define MAC_PCU_REG_MISCMODE_HCF_POLL_CANCELS_NAV_FIELD 22 -#define MAC_PCU_REG_MISCMODE_RX_HCF_POLL_ENABLE_FIELD 23 -#define MAC_PCU_REG_MISCMODE_CLEAR_VMF_FIELD 24 -#define MAC_PCU_REG_MISCMODE_CLEAR_FIRST_HCF_FIELD 25 -#define MAC_PCU_REG_MISCMODE_ADHOC_MCAST_KEYID_ENABLE_FIELD 26 -#define MAC_PCU_REG_MISCMODE_ALLOW_RAC_FIELD 27 -#define MAC_PCU_REG_MISCMODE_BSSID_MATCH_FORCE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_ACKSIFS_MEMORY_RESET_RESERVED 0x0 -#define MAC_PCU_REG_MISCMODE_MIC_NEW_LOCATION_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_TX_ADD_TSF_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_CCK_SIFS_MODE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MODE_RESET_RESERVED 0x0 -#define MAC_PCU_REG_MISCMODE_BFCOEF_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_BFCOEF_UPDATE_SELF_GEN_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MCAST_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_DUAL_CHAIN_ANT_MODE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_FALCON_DESC_MODE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_KC_RX_ANT_UPDATE_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_TXOP_TBTT_LIMIT_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_FALCON_BB_INTERFACE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_MISS_BEACON_IN_SLEEP_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_BUG_12306_FIX_ENABLE_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_FORCE_QUIET_COLLISION_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_BUG_12549_FORCE_TXBF_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_BT_ANT_PREVENTS_RX_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_TBTT_PROTECT_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_HCF_POLL_CANCELS_NAV_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_RX_HCF_POLL_ENABLE_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_CLEAR_VMF_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_CLEAR_FIRST_HCF_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_ADHOC_MCAST_KEYID_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_ALLOW_RAC_RESET 0x0 - -#define MAC_PCU_REG_FILTOFDM_OFFSET 0x49 -#define MAC_PCU_REG_FILTOFDM_CNT_FIELD 23:0 -#define MAC_PCU_REG_FILTOFDM_CNT_RESET 0x0 - -#define MAC_PCU_REG_FILTCCK_OFFSET 0x4A -#define MAC_PCU_REG_FILTCCK_CNT_FIELD 23:0 -#define MAC_PCU_REG_FILTCCK_CNT_RESET 0x0 - -#define MAC_PCU_REG_PHYCNT1_OFFSET 0x4B -#define MAC_PCU_REG_PHYCNT1_FIELD 23:0 -#define MAC_PCU_REG_PHYCNT1_RESET 0x0 - -#define MAC_PCU_REG_PHYCNTMASK1_OFFSET 0x4C -#define MAC_PCU_REG_PHYCNTMASK1_FIELD 31:0 -#define MAC_PCU_REG_PHYCNTMASK1_RESET 0x0 - -#define MAC_PCU_REG_PHYCNT2_OFFSET 0x4D -#define MAC_PCU_REG_PHYCNT2_FIELD 23:0 -#define MAC_PCU_REG_PHYCNT2_RESET 0x0 - -#define MAC_PCU_REG_PHYCNTMASK2_OFFSET 0x4E -#define MAC_PCU_REG_PHYCNTMASK2_FIELD 31:0 -#define MAC_PCU_REG_PHYCNTMASK2_RESET 0x0 - -#define MAC_PCU_REG_TSFTHRESH_OFFSET 0x4F -#define MAC_PCU_REG_TSFTHRESH_FIELD 15:0 -#define MAC_PCU_REG_TSFTHRESH_RESET 0xFFFF - -//#define MAC_PCU_REG_TSFCAL_OFFSET 0x50 -//#define MAC_PCU_REG_TSFCAL_COUNT_FIELD 3:0 -//#define MAC_PCU_REG_TSFCAL_INTERVAL_FIELD 7:4 -//#define MAC_PCU_REG_TSFCAL_ENABLE_FIELD 8 -//#define MAC_PCU_REG_TSFCAL_AUTO_CAL_FIELD 9 -//#define MAC_PCU_REG_TSFCAL_VALUE_WE_FIELD 10 -//#define MAC_PCU_REG_TSFCAL_VALUE_FIELD 31:16 -//#define MAC_PCU_REG_TSFCAL_COUNT_RESET 0x8 -//#define MAC_PCU_REG_TSFCAL_INTERVAL_RESET 0xa -//#define MAC_PCU_REG_TSFCAL_ENABLE_RESET 0x1 -//#define MAC_PCU_REG_TSFCAL_AUTO_CAL_RESET 0x1 -//#define MAC_PCU_REG_TSFCAL_VALUE_WE_RESET 0x0 -//#define MAC_PCU_REG_TSFCAL_VALUE_RESET 0x8000 - -#define MAC_PCU_REG_PHYERR_EIFS_OFFSET 0x51 -#define MAC_PCU_REG_PHYERR_EIFS_MASK_FIELD 31:0 -#define MAC_PCU_REG_PHYERR_EIFS_MASK_RESET 0x0 - -//#define MAC_PCU_REG_SYNC1_OFFSET 0x52 -//#define MAC_PCU_REG_SYNC1_TIME_FIELD 30:0 -//#define MAC_PCU_REG_SYNC1_TIME_RESET 0x0 - -//#define MAC_PCU_REG_SYNC2_OFFSET 0x53 -//#define MAC_PCU_REG_SYNC2_TIME_OFFSET_FIELD 7:0 -//#define MAC_PCU_REG_SYNC2_MASTER_FIELD 8 -//#define MAC_PCU_REG_SYNC2_REPLACE_FIELD 9 -//#define MAC_PCU_REG_SYNC2_TUNE_FIELD 10 -//#define MAC_PCU_REG_SYNC2_CLEAR_FIELD 11 -//#define MAC_PCU_REG_SYNC2_INTR_THRESH_FIELD 31:16 -//#define MAC_PCU_REG_SYNC2_TIME_OFFSET_RESET 0x0 -//#define MAC_PCU_REG_SYNC2_MASTER_RESET 0x0 -//#define MAC_PCU_REG_SYNC2_REPLACE_RESET 0x0 -//#define MAC_PCU_REG_SYNC2_TUNE_RESET 0x0 -//#define MAC_PCU_REG_SYNC2_CLEAR_RESET 0x0 -//#define MAC_PCU_REG_SYNC2_INTR_THRESH_RESET 0xFFFF - -//#define MAC_PCU_REG_SYNC3_OFFSET 0x54 -//#define MAC_PCU_REG_SYNC3_MCAST_ADDR_L_FIELD 31:0 -//#define MAC_PCU_REG_SYNC3_MCAST_ADDR_L_RESET 0x0 - -//#define MAC_PCU_REG_SYNC4_OFFSET 0x55 -//#define MAC_PCU_REG_SYNC4_MCAST_ADDR_U_FIELD 15:0 -//#define MAC_PCU_REG_SYNC4_MCAST_ADDR_U_RESET 0x0 - -//#define MAC_PCU_REG_SYNC5_OFFSET 0x56 -//#define MAC_PCU_REG_SYNC5_RX_TIME_FIELD 30:0 - -//#define MAC_PCU_REG_SYNC6_OFFSET 0x57 -//#define MAC_PCU_REG_SYNC6_INC_FIELD 31:0 - -//#define MAC_PCU_REG_SYNC7_OFFSET 0x58 -//#define MAC_PCU_REG_SYNC7_LAST_TIME_FIELD 30:0 - -//#define MAC_PCU_REG_SYNC8_OFFSET 0x59 -//#define MAC_PCU_REG_SYNC8_UPDATED_TIME_FIELD 30:0 - -#define MAC_PCU_REG_PHYCNT3_OFFSET 0x5A -#define MAC_PCU_REG_PHYCNT3_FIELD 23:0 -#define MAC_PCU_REG_PHYCNT3_RESET 0x0 - -#define MAC_PCU_REG_PHYCNTMASK3_OFFSET 0x5B -#define MAC_PCU_REG_PHYCNTMASK3_FIELD 31:0 -#define MAC_PCU_REG_PHYCNTMASK3_RESET 0x0 - -#define MAC_PCU_REG_BTMODE_OFFSET 0x5C -#define MAC_PCU_REG_BTMODE_TIME_EXTEND_FIELD 7:0 -#define MAC_PCU_REG_BTMODE_TXSTATE_EXTEND_FIELD 8 -#define MAC_PCU_REG_BTMODE_TX_FRAME_EXTEND_FIELD 9 -#define MAC_PCU_REG_BTMODE_MODE_FIELD 11:10 -#define MAC_PCU_REG_BTMODE_QUIET_FIELD 12 -#define MAC_PCU_REG_BTMODE_QCU_THRESH_FIELD 16:13 -#define MAC_PCU_REG_BTMODE_RX_CLEAR_POLARITY_FIELD 17 -#define MAC_PCU_REG_BTMODE_PRIORITY_TIME_FIELD 23:18 -#define MAC_PCU_REG_BTMODE_FIRST_SLOT_TIME_FIELD 31:24 -#define MAC_PCU_REG_BTMODE_TIME_EXTEND_RESET 0x20 -#define MAC_PCU_REG_BTMODE_TXSTATE_EXTEND_RESET 0x1 -#define MAC_PCU_REG_BTMODE_TX_FRAME_EXTEND_RESET 0x1 -#define MAC_PCU_REG_BTMODE_MODE_RESET 0x3 -#define MAC_PCU_REG_BTMODE_QUIET_RESET 0x1 -#define MAC_PCU_REG_BTMODE_QCU_THRESH_RESET 0x1 -#define MAC_PCU_REG_BTMODE_RX_CLEAR_POLARITY_RESET 0x0 -#define MAC_PCU_REG_BTMODE_PRIORITY_TIME_RESET 0x05 -#define MAC_PCU_REG_BTMODE_FIRST_SLOT_TIME_RESET 0x9B - -#define MAC_PCU_REG_BTWEIGHT_OFFSET 0x5D -#define MAC_PCU_REG_BTWEIGHT_BT_WEIGHT_FIELD 15:0 -#define MAC_PCU_REG_BTWEIGHT_WL_WEIGHT_FIELD 31:16 -#define MAC_PCU_REG_BTWEIGHT_BT_WEIGHT_RESET 0xFA50 -#define MAC_PCU_REG_BTWEIGHT_WL_WEIGHT_RESET 0xFAA4 - -#define MAC_PCU_REG_HCF_OFFSET 0x5E -#define MAC_PCU_REG_HCF_TIMEOUT_FIELD 15:0 -#define MAC_PCU_REG_HCF_TIMEOUT_RESET 0x100 - -#define MAC_PCU_REG_BTMODE2_OFFSET 0x5F -#define MAC_PCU_REG_BTMODE2_BT_BCN_MISS_THRESH_FIELD 7:0 -#define MAC_PCU_REG_BTMODE2_BCN_MISS_CNT_FIELD 15:8 -#define MAC_PCU_REG_BTMODE2_BT_HOLD_RX_CLEAR_FIELD 16 -#define MAC_PCU_REG_BTMODE2_WL_CONTROL_ANT_FIELD 17 -#define MAC_PCU_REG_BTMODE2_RESPOND_TO_BT_ACTIVE_FIELD 18 -#define MAC_PCU_REG_BTMODE2_PROTECT_BT_AFTER_WAKEUP_FIELD 19 -#define MAC_PCU_REG_BTMODE2_DISABLE_BT_ANT_FIELD 20 -#define MAC_PCU_REG_BTMODE2_BT_BCN_MISS_THRESH_RESET 0 -#define MAC_PCU_REG_BTMODE2_BT_HOLD_RX_CLEAR_RESET 0 -#define MAC_PCU_REG_BTMODE2_WL_CONTROL_ANT_RESET 0x0 -#define MAC_PCU_REG_BTMODE2_RESPOND_TO_BT_ACTIVE_RESET 0x0 -#define MAC_PCU_REG_BTMODE2_PROTECT_BT_AFTER_WAKEUP_RESET 0x0 -#define MAC_PCU_REG_BTMODE2_DISABLE_BT_ANT_RESET 0x0 - -#define MAC_PCU_REG_BFCOEF1_OFFSET 0x60 -#define MAC_PCU_REG_BFCOEF1_UPPER_OFFSET 0x67 -#define MAC_PCU_REG_BFCOEF1_KEY_VALID_FIELD 31 -#define MAC_PCU_REG_BFCOEF1_KEYIDX_FIELD 30:24 -#define MAC_PCU_REG_BFCOEF1_TSF_FIELD 23:0 -#define MAC_PCU_REG_BFCOEF1_KEY_VALID_RESET 0x0 - -#define MAC_PCU_REG_BFCOEF2_OFFSET 0x70 -#define MAC_PCU_REG_BFCOEF2_THRESH_FIELD 22:0 -#define MAC_PCU_REG_BFCOEF2_LOCK_FIELD 31:24 -#define MAC_PCU_REG_BFCOEF2_THRESH_RESET 0x0 -#define MAC_PCU_REG_BFCOEF2_LOCK_RESET 0x0 - -#define MAC_PCU_REG_KCMASK_OFFSET 0x71 -#define MAC_PCU_REG_KCMASK_47_32_FIELD 15:0 -#define MAC_PCU_REG_KCMASK_47_32_RESET 0 -#define MAC_PCU_REG_KCMASK_31_0_FIELD 16 -#define MAC_PCU_REG_KCMASK_31_0_RESET 0 - -#define MAC_PCU_REG_TXSIFS_OFFSET 0x74 -#define MAC_PCU_REG_TXSIFS_SIFS_TIME_FIELD 7:0 -#define MAC_PCU_REG_TXSIFS_TX_LATENCY_FIELD 11:8 -#define MAC_PCU_REG_TXSIFS_ACK_SHIFT_FIELD 14:12 -#define MAC_PCU_REG_TXSIFS_SIFS_TIME_RESET 16 -#define MAC_PCU_REG_TXSIFS_TX_LATENCY_RESET 2 -#define MAC_PCU_REG_TXSIFS_ACK_SHIFT_RESET 3 - -#define MAC_PCU_REG_TXOP_X_OFFSET 0x7b -#define MAC_PCU_REG_TXOP_X_FIELD 7:0 -#define MAC_PCU_REG_TXOP_X_RESET 0 - -#define MAC_PCU_REG_TXOP_0_3_OFFSET 0x7c -#define MAC_PCU_REG_TXOP_0_FIELD 7:0 -#define MAC_PCU_REG_TXOP_1_FIELD 15:8 -#define MAC_PCU_REG_TXOP_2_FIELD 23:16 -#define MAC_PCU_REG_TXOP_3_FIELD 31:24 -#define MAC_PCU_REG_TXOP_0_RESET 0 -#define MAC_PCU_REG_TXOP_1_RESET 0 -#define MAC_PCU_REG_TXOP_2_RESET 0 -#define MAC_PCU_REG_TXOP_3_RESET 0 - -#define MAC_PCU_REG_TXOP_4_7_OFFSET 0x7d -#define MAC_PCU_REG_TXOP_4_FIELD 7:0 -#define MAC_PCU_REG_TXOP_5_FIELD 15:8 -#define MAC_PCU_REG_TXOP_6_FIELD 23:16 -#define MAC_PCU_REG_TXOP_7_FIELD 31:24 -#define MAC_PCU_REG_TXOP_4_RESET 0 -#define MAC_PCU_REG_TXOP_5_RESET 0 -#define MAC_PCU_REG_TXOP_6_RESET 0 -#define MAC_PCU_REG_TXOP_7_RESET 0 - -#define MAC_PCU_REG_TXOP_8_11_OFFSET 0x7e -#define MAC_PCU_REG_TXOP_8_FIELD 7:0 -#define MAC_PCU_REG_TXOP_9_FIELD 15:8 -#define MAC_PCU_REG_TXOP_10_FIELD 23:16 -#define MAC_PCU_REG_TXOP_11_FIELD 31:24 -#define MAC_PCU_REG_TXOP_8_RESET 0 -#define MAC_PCU_REG_TXOP_9_RESET 0 -#define MAC_PCU_REG_TXOP_10_RESET 0 -#define MAC_PCU_REG_TXOP_11_RESET 0 - -#define MAC_PCU_REG_TXOP_12_15_OFFSET 0x7f -#define MAC_PCU_REG_TXOP_12_FIELD 7:0 -#define MAC_PCU_REG_TXOP_13_FIELD 15:8 -#define MAC_PCU_REG_TXOP_14_FIELD 23:16 -#define MAC_PCU_REG_TXOP_15_FIELD 31:24 -#define MAC_PCU_REG_TXOP_12_RESET 0 -#define MAC_PCU_REG_TXOP_13_RESET 0 -#define MAC_PCU_REG_TXOP_14_RESET 0 -#define MAC_PCU_REG_TXOP_15_RESET 0 - -#define MAC_PCU_REG_GNRCTMR_N_OFFSET 0x80 -#define MAC_PCU_REG_GNRCTMR_N_UPPER_OFFSET 0x87 -#define MAC_PCU_REG_GNRCTMR_N_FIELD 31:0 - -#define MAC_PCU_REG_GNRCTMR_P_OFFSET 0x88 -#define MAC_PCU_REG_GNRCTMR_P_UPPER_OFFSET 0x8F -#define MAC_PCU_REG_GNRCTMR_P_FIELD 27:0 - -#define MAC_PCU_REG_GNRCTMR_M_OFFSET 0x90 -#define MAC_PCU_REG_GNRCTMR_M_ENABLE_FIELD 7:0 -#define MAC_PCU_REG_GNRCTMR_M_OVERFLOW_INDEX_FIELD 10:8 -#define MAC_PCU_REG_GNRCTMR_M_THRESH_FIELD 31:12 -#define MAC_PCU_REG_GNRCTMR_M_ENABLE_RESET 0x0 -#define MAC_PCU_REG_GNRCTMR_M_THRESH_RESET 0x00100 - -#define MAC_PCU_REG_SLP32_MODE_OFFSET 0x91 -#define MAC_PCU_REG_SLP32_MODE_HALF_CLK_LATENCY_FIELD 19:0 -#define MAC_PCU_REG_SLP32_MODE_ENABLE_FIELD 20 -#define MAC_PCU_REG_SLP32_MODE_TSF_WRITE_STAT_FIELD 21 -#define MAC_PCU_REG_SLP32_MODE_HALF_CLK_LATENCY_RESET 0x0F424 -#define MAC_PCU_REG_SLP32_MODE_ENABLE_RESET 0x1 - -#define MAC_PCU_REG_SLP32_WAKE_OFFSET 0x92 -#define MAC_PCU_REG_SLP32_WAKE_XTL_TIME_FIELD 15:0 -#define MAC_PCU_REG_SLP32_WAKE_XTL_TIME_RESET 0x07EF - -#define MAC_PCU_REG_SLP32_TSF_INC_OFFSET 0x93 -#define MAC_PCU_REG_SLP32_TSF_INC_FIELD 19:0 -#define MAC_PCU_REG_SLP32_TSF_INC_RESET 0x1E848 - -#define MAC_PCU_REG_SLPMIB1_OFFSET 0x94 -#define MAC_PCU_REG_SLPMIB1_SLEEP_CNT_FIELD 31:0 - -#define MAC_PCU_REG_SLPMIB2_OFFSET 0x95 -#define MAC_PCU_REG_SLPMIB2_CYCLE_CNT_FIELD 31:0 - -#define MAC_PCU_REG_SLPMIB3_OFFSET 0x96 -#define MAC_PCU_REG_SLPMIB3_CLR_CNT_FIELD 0 -#define MAC_PCU_REG_SLPMIB3_PEND_FIELD 1 - -#define MAC_PCU_REG_MISCMODE2_OFFSET 0x97 -#define MAC_PCU_REG_MISCMODE2_MGMT_CRYPTO_ENABLE_FIELD 0 -#define MAC_PCU_REG_MISCMODE2_NO_CRYPTO_FOR_NON_DATA_PKT_FIELD 1 -#define MAC_PCU_REG_MISCMODE2_MGMT_QOS_FIELD 15:8 -#define MAC_PCU_REG_MISCMODE2_BC_MC_WAPI_MODE_FIELD 16 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_FOR_1ST_PKT_FIELD 17 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_IF_ZERO_FIELD 18 -#define MAC_PCU_REG_MISCMODE2_MGMT_CRYPTO_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE2_NO_CRYPTO_FOR_NON_DATA_PKT_RESET 0x0 -#define MAC_PCU_REG_MISCMODE2_MGMT_QOS_RESET 0x10 -#define MAC_PCU_REG_MISCMODE2_BC_MC_WAPI_MODE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_FOR_1ST_PKT_RESET 0x0 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_IF_ZERO_RESET 0x0 - -#define MAC_PCU_REG_SLP4_OFFSET 0x98 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_DUR_FIELD 15:0 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_ENABLE_FIELD 16 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_DUR_RESET 0x5 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_ENABLE_RESET 0x0 - -#define MAC_PCU_REG_SLP5_OFFSET 0x99 -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_FIELD 23:0 -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_ENABLE_FIELD 24 -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_RESET 0xff_ffff -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_ENABLE_RESET 0x0 - -#define MAC_PCU_REG_MCICTL_OFFSET 0x9a -#define MAC_PCU_REG_MCICTL_MCI_ENABLE_FIELD 0 -#define MAC_PCU_REG_MCICTL_OLA_ENABLE_FIELD 1 -#define MAC_PCU_REG_MCICTL_PREEMPT_ENABLE_FIELD 2 -#define MAC_PCU_REG_MCICTL_CHANNEL_BUSY_ENABLE_FIELD 3 -#define MAC_PCU_REG_MCICTL_EARLY_NOTIFY_DELAY_FIELD 9:4 -#define MAC_PCU_REG_MCICTL_BMISS_FORCE_WL_FIELD 10 -#define MAC_PCU_REG_MCICTL_SLEEP_FORCE_BT_FIELD 11 -#define MAC_PCU_REG_MCICTL_HP_QCU_STOMP_BT_FIELD 12 -#define MAC_PCU_REG_MCICTL_MCI_BUSY_FIELD 31 -#define MAC_PCU_REG_MCICTL_MCI_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MCICTL_OLA_ENABLE_RESET 0x1 -#define MAC_PCU_REG_MCICTL_PREEMPT_ENABLE_RESET 0x1 -#define MAC_PCU_REG_MCICTL_CHANNEL_BUSY_ENABLE_RESET 0x1 -#define MAC_PCU_REG_MCICTL_EARLY_NOTIFY_DELAY_RESET 0x5 -#define MAC_PCU_REG_MCICTL_BMISS_FORCE_WL_RESET 0x0 -#define MAC_PCU_REG_MCICTL_SLEEP_FORCE_BT_RESET 0x1 -#define MAC_PCU_REG_MCICTL_HP_QCU_STOMP_BT_RESET 0x0 - -#define MAC_PCU_REG_MCIISR_OFFSET 0x9b -#define MAC_PCU_REG_MCIISR_ACT_RPT_RCV_INT_FIELD 0 -#define MAC_PCU_REG_MCIISR_ACT_DEN_RCV_INT_FIELD 1 -#define MAC_PCU_REG_MCIISR_FRQ_RPT_RCV_INT_FIELD 2 -#define MAC_PCU_REG_MCIISR_QOS_RPT_RCV_INT_FIELD 3 -#define MAC_PCU_REG_MCIISR_GEN_RPT_RCV_INT_FIELD 4 -#define MAC_PCU_REG_MCIISR_ACT_RPT_RCV_INT_RESET 0x0 -#define MAC_PCU_REG_MCIISR_ACT_DEN_RCV_INT_RESET 0x0 -#define MAC_PCU_REG_MCIISR_FRQ_RPT_RCV_INT_RESET 0x0 -#define MAC_PCU_REG_MCIISR_QOS_RPT_RCV_INT_RESET 0x0 -#define MAC_PCU_REG_MCIISR_GEN_RPT_RCV_INT_RESET 0x0 - -#define MAC_PCU_REG_MCIIER_OFFSET 0x9c -#define MAC_PCU_REG_MCIIER_ACT_RPT_RCV_INT_ENABLE_FIELD 0 -#define MAC_PCU_REG_MCIIER_ACT_DEN_RCV_INT_ENABLE_FIELD 1 -#define MAC_PCU_REG_MCIIER_FRQ_RPT_RCV_INT_ENABLE_FIELD 2 -#define MAC_PCU_REG_MCIIER_QOS_RPT_RCV_INT_ENABLE_FIELD 3 -#define MAC_PCU_REG_MCIIER_GEN_RPT_RCV_INT_ENABLE_FIELD 4 -#define MAC_PCU_REG_MCIIER_ACT_RPT_RCV_INT_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MCIIER_ACT_DEN_RCV_INT_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MCIIER_FRQ_RPT_RCV_INT_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MCIIER_QOS_RPT_RCV_INT_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MCIIER_GEN_RPT_RCV_INT_ENABLE_RESET 0x0 - -#define MAC_PCU_REG_MCIWLP_OFFSET 0x9d -#define MAC_PCU_REG_MCIWLP_RESET 0x0 - -#define MAC_PCU_REG_MCIARW_OFFSET 0x9e -#define MAC_PCU_REG_MCIARW_RESET 0x0 - -#define MAC_PCU_REG_MCIARR_OFFSET 0x9f - -#define MAC_PCU_REG_MCIADW_OFFSET 0xa0 -#define MAC_PCU_REG_MCIADW_RESET 0x0 - -#define MAC_PCU_REG_MCIADR_OFFSET 0xa1 - -#define MAC_PCU_REG_MCIFRW_OFFSET 0xa2 -#define MAC_PCU_REG_MCIFRW_RESET 0x0 - -#define MAC_PCU_REG_MCIFRR_OFFSET 0xa3 - -#define MAC_PCU_REG_MCIQRW_OFFSET 0xa4 -#define MAC_PCU_REG_MCIQRW_RESET 0x0 - -#define MAC_PCU_REG_MCIQRR_OFFSET 0xa5 - -#define MAC_PCU_REG_MCIGRW_OFFSET 0xa6 -#define MAC_PCU_REG_MCIGRW_RESET 0x0 - -#define MAC_PCU_REG_MCIGRR_OFFSET 0xa7 - -#define MAC_PCU_REG_MCISTAT_OFFSET 0xa8 -#define MAC_PCU_REG_MCISTAT_ACT_RPT_RCV_CNT_FIELD 7:0 -#define MAC_PCU_REG_MCISTAT_QC_CNT_FIELD 15:8 -#define MAC_PCU_REG_MCISTAT_OLA_CNT_FIELD 23:16 -#define MAC_PCU_REG_MCISTAT_PREEMPT_CNT_FIELD 31:24 -#define MAC_PCU_REG_MCISTAT_ACT_RPT_RCV_CNT_RESET 0x0 -#define MAC_PCU_REG_MCISTAT_QC_CNT_RESET 0x0 -#define MAC_PCU_REG_MCISTAT_OLA_CNT_RESET 0x0 -#define MAC_PCU_REG_MCISTAT_PREEMPT_CNT_RESET 0x0 - -#define MAC_PCU_REG_BASIC_RATE_SET0_OFFSET 0xa9 -#define MAC_PCU_REG_BRATE_1MB_L_FIELD 4:0 -#define MAC_PCU_REG_BRATE_2MB_L_FIELD 9:5 -#define MAC_PCU_REG_BRATE_2MB_S_FIELD 14:10 -#define MAC_PCU_REG_BRATE_5_5MB_L_FIELD 19:15 -#define MAC_PCU_REG_BRATE_5_5MB_S_FIELD 24:20 -#define MAC_PCU_REG_BRATE_11MB_L_FIELD 29:25 -#define MAC_PCU_REG_BRATE_1MB_L_RESET #CCK_RATE_1Mb_L -#define MAC_PCU_REG_BRATE_2MB_L_RESET #CCK_RATE_2Mb_L -#define MAC_PCU_REG_BRATE_2MB_S_RESET #CCK_RATE_2Mb_S -#define MAC_PCU_REG_BRATE_5_5MB_L_RESET #CCK_RATE_5_5Mb_L -#define MAC_PCU_REG_BRATE_5_5MB_S_RESET #CCK_RATE_5_5Mb_S -#define MAC_PCU_REG_BRATE_11MB_L_RESET #CCK_RATE_11Mb_L - -#define MAC_PCU_REG_BASIC_RATE_SET1_OFFSET 0xaa -#define MAC_PCU_REG_BRATE_11MB_S_FIELD 4:0 -#define MAC_PCU_REG_BRATE_6MB_FIELD 9:5 -#define MAC_PCU_REG_BRATE_9MB_FIELD 14:10 -#define MAC_PCU_REG_BRATE_12MB_FIELD 19:15 -#define MAC_PCU_REG_BRATE_18MB_FIELD 24:20 -#define MAC_PCU_REG_BRATE_24MB_FIELD 29:25 -#define MAC_PCU_REG_BRATE_11MB_S_RESET #CCK_RATE_11Mb_S -#define MAC_PCU_REG_BRATE_6MB_RESET #OFDM_RATE_6Mb -#define MAC_PCU_REG_BRATE_9MB_RESET #OFDM_RATE_6Mb -#define MAC_PCU_REG_BRATE_12MB_RESET #OFDM_RATE_12Mb -#define MAC_PCU_REG_BRATE_18MB_RESET #OFDM_RATE_12Mb -#define MAC_PCU_REG_BRATE_24MB_RESET #OFDM_RATE_24Mb - -#define MAC_PCU_REG_BASIC_RATE_SET2_OFFSET 0xab -#define MAC_PCU_REG_BRATE_36MB_FIELD 4:0 -#define MAC_PCU_REG_BRATE_48MB_FIELD 9:5 -#define MAC_PCU_REG_BRATE_54MB_FIELD 14:10 -#define MAC_PCU_REG_BRATE_36MB_RESET #OFDM_RATE_24Mb -#define MAC_PCU_REG_BRATE_48MB_RESET #OFDM_RATE_24Mb -#define MAC_PCU_REG_BRATE_54MB_RESET #OFDM_RATE_24Mb - -#define MAC_PCU_REG_SEC_BSSID_L32_OFFSET 0xac -#define MAC_PCU_REG_SEC_BSSID_L32_FIELD 31:0 -#define MAC_PCU_REG_SEC_BSSID_L32_RESET 0x0 - -#define MAC_PCU_REG_SEC_BSSID_U16_OFFSET 0xad -#define MAC_PCU_REG_SEC_BSSID_U16_FIELD 15:0 -#define MAC_PCU_REG_SEC_BSSID_ENABLE_FIELD 16 -#define MAC_PCU_REG_SEC_BSSID_U16_RESET 0x0 -#define MAC_PCU_REG_SEC_BSSID_ENABLE_RESET 0x0 - -#define MAC_PCU_REG_FTYPE_OFFSET 0x140 -#define MAC_PCU_REG_FTYPE_UPPER_OFFSET 0x17F -#define MAC_PCU_REG_FTYPE_BFCOEF_RX_UPDATE_NORMAL_FIELD 0 -#define MAC_PCU_REG_FTYPE_BFCOEF_RX_UPDATE_SELF_GEN_FIELD 1 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_NORMAL_FIELD 2 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_SELF_GEN_FIELD 3 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_GEN_FIELD 4 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_MCAST_FIELD 5 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_ALL_FIELD 6 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_DIRECTED_FIELD 7 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_MCAST_FIELD 8 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_BCAST_FIELD 9 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_MC_BC_BSSID_FIELD 10 - -#define MAC_PCU_REG_ACKSIFSMEM_OFFSET_RESERVED 0x1A0 -#define MAC_PCU_REG_ACKSIFSMEM_UPPER_OFFSET_RESERVED 0x1BF -#define MAC_PCU_REG_ACKSIFSMEM_NORMAL_FIELD_RESERVED 9:0 -#define MAC_PCU_REG_ACKSIFSMEM_TURBO_FIELD_RESERVED 19:10 - -#define MAC_PCU_REG_DUR_OFFSET 0x1C0 -#define MAC_PCU_REG_DUR_UPPER_OFFSET 0x1DF -#define MAC_PCU_REG_DUR_RATE_TO_DURATION_FIELD 15:0 - -#define MAC_PCU_REG_RTD_OFFSET 0x1F0 -#define MAC_PCU_REG_RTD_UPPER_OFFSET 0x1F7 -#define MAC_PCU_REG_RTD_RATE_TO_DB_0_FIELD 4:0 -#define MAC_PCU_REG_RTD_RATE_TO_DB_1_FIELD 12:8 -#define MAC_PCU_REG_RTD_RATE_TO_DB_2_FIELD 20:16 -#define MAC_PCU_REG_RTD_RATE_TO_DB_3_FIELD 28:24 - -#define MAC_PCU_REG_DTR_OFFSET 0x1F8 -#define MAC_PCU_REG_DTR_UPPER_OFFSET 0x1FF -#define MAC_PCU_REG_DTR_DB_TO_RATE_0_FIELD 4:0 -#define MAC_PCU_REG_DTR_DB_TO_RATE_1_FIELD 12:8 -#define MAC_PCU_REG_DTR_DB_TO_RATE_2_FIELD 20:16 -#define MAC_PCU_REG_DTR_DB_TO_RATE_3_FIELD 28:24 - -#define MAC_PCU_REG_KC_OFFSET 0x200 -#define MAC_PCU_REG_KC_UPPER_OFFSET 0x5FF -#define MAC_PCU_REG_KC_KEY_31_0_FIELD 31:0 -#define MAC_PCU_REG_KC_KEY_47_32_FIELD 15:0 -#define MAC_PCU_REG_KC_KEY_79_48_FIELD 31:0 -#define MAC_PCU_REG_KC_KEY_95_80_FIELD 15:0 -#define MAC_PCU_REG_KC_KEY_127_96_FIELD 31:0 -#define MAC_PCU_REG_KC_KEY_TYPE_FIELD 2:0 -#define MAC_PCU_REG_KC_LAST_ANTENNA_FIELD 3 -#define MAC_PCU_REG_KC_ASYNC_ACK_OFFSET_FIELD 8:4 -#define MAC_PCU_REG_KC_UPDATE_BEAM_FORMING_FIELD 9 -#define MAC_PCU_REG_KC_RX_CHAIN_0_ACK_ANT_FIELD 10 -#define MAC_PCU_REG_KC_RX_CHAIN_1_ACK_ANT_FIELD 11 -#define MAC_PCU_REG_KC_TX_CHAIN_0_ANT_SEL_FIELD 12 -#define MAC_PCU_REG_KC_TX_CHAIN_1_ANT_SEL_FIELD 13 -#define MAC_PCU_REG_KC_TX_CHAIN_SEL_FIELD 14 -#define MAC_PCU_REG_KC_ADDR_32_1_FIELD 31:0 -#define MAC_PCU_REG_KC_ADDR_47_33_FIELD 14:0 -#define MAC_PCU_REG_KC_VALID_FIELD 1 - -//Misc -#define ELEM_START 36 -#define CFP_ELEM 4 - -#endif diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/mac_pcu.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/mac_pcu.vrh deleted file mode 100644 index 0ed8ff6737d0..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/mac_pcu.vrh +++ /dev/null @@ -1,979 +0,0 @@ - -#define _MAC_PCU_H - -#define FIFO_BOUND 1024 - -#define CLK32_TIMER0 0 -#define CLK32_TIMER1 1 -#define CLK32_TIMER2 2 -#define CLK32_TIMER3 3 -#define CLK32_TSF_L32 4 -#define CLK32_TSF_U32 5 -#define CLK32_SLP1 6 -#define CLK32_SLP2 7 -#define CLK32_SLP3 8 -#define CLK32_QT1 9 -#define CLK32_QT2 10 -//#define CLK32_TSFCAL 11 - -//#define CLK_S_SYNC1 0 -//#define CLK_S_SYNC6 1 -//#define CLK_S_SYNC7 2 -//#define CLK_S_SYNC8 3 - -#define KTYPE_40 0 -#define KTYPE_104 1 -#define KTYPE_TKIP_NO_MIC 2 -#define KTYPE_128 3 -#define KTYPE_TKIP 4 -//#define KTYPE_AES_OCB 5 -#define KTYPE_WAPI 5 -#define KTYPE_AES_CCM 6 -#define KTYPE_NOTHING 7 - -//Frame Type in Descriptor -#define TXDESC_FT_NORMAL 0 -#define TXDESC_FT_ATIM 1 -#define TXDESC_FT_PS_POLL 2 -#define TXDESC_FT_BEACON 3 -#define TXDESC_FT_PROBE_RESP 4 -#define TXDESC_FT_CHIRP 5 -#define TXDESC_FT_GROUP_POLL 6 -#define TXDESC_FT_DIRECT_POLL 7 -//#define TXDESC_FT_SYNC 8 -#define TXDESC_FT_BEACON_NO_TSF_UPDATE 9 - -//Frame Type: Management -#define FTYPE_ASSOCIATION_REQ 6'b000000 -#define FTYPE_ASSOCIATION_RES 6'b000100 -#define FTYPE_REASSOCIATION_REQ 6'b001000 -#define FTYPE_REASSOCIATION_RES 6'b001100 -#define FTYPE_PBREQ 6'b010000 // change to TYPE_PROBE_REQ TBD -#define FTYPE_PBRES 6'b010100 // change to TYPE_PROBE_RES TBD -#define FTYPE_BEACON 6'b100000 -#define FTYPE_ATIM 6'b100100 -#define FTYPE_DISASSOCIATE 6'b101000 -#define FTYPE_AUTHENICATE 6'b101100 -#define FTYPE_DEAUTHENICATE 6'b110000 - -//Frame Type: Control -#define FTYPE_PSPOLL 6'b101001 -#define FTYPE_RTS 6'b101101 -#define FTYPE_CTS 6'b110001 -#define FTYPE_ACK 6'b110101 -#define FTYPE_CFEND 6'b111001 -#define FTYPE_CFEND_ACK 6'b111101 // change to FTYPE_CFEND_ACK TBD - -//Frame Type: Data -#define FTYPE_DATA 6'b000010 -#define FTYPE_DATA_CFACK 6'b000110 -#define FTYPE_DATA_CFPOLL 6'b001010 -#define FTYPE_DATA_CFACK_CFPOLL 6'b001110 -#define FTYPE_NULL 6'b010010 -#define FTYPE_CFACK 6'b010110 -#define FTYPE_CFPOLL 6'b011010 -#define FTYPE_CFACK_CFPOLL 6'b011110 - -//Frame Control Fields -#define FCTL_TO_DS 8 -#define FCTL_FROM_DS 9 -#define FCTL_MORE_FRAG 10 -#define FCTL_RETRY 11 -#define FCTL_POWER_MGNT 12 -#define FCTL_MORE_DATA 13 -#define FCTL_WEP 14 -#define FCTL_TYPE 3:2 - -//Rate -#define OFDM_RATE_6Mb 5'h0b -#define OFDM_RATE_9Mb 5'h0f -#define OFDM_RATE_12Mb 5'h0a -#define OFDM_RATE_18Mb 5'h0e -#define OFDM_RATE_24Mb 5'h09 -#define OFDM_RATE_36Mb 5'h0d -#define OFDM_RATE_48Mb 5'h08 -#define OFDM_RATE_54Mb 5'h0c -#define CCK_RATE_1Mb_L 5'h1b -#define CCK_RATE_2Mb_L 5'h1a -#define CCK_RATE_2Mb_S 5'h1e -#define CCK_RATE_5_5Mb_L 5'h19 -#define CCK_RATE_5_5Mb_S 5'h1d -#define CCK_RATE_11Mb_L 5'h18 - -#define CCK_RATE_11Mb_S 5'h1c -#define XR_RATE_0_25Mb 5'h03 -#define XR_RATE_0_5Mb 5'h07 -#define XR_RATE_1Mb 5'h02 -#define XR_RATE_2Mb 5'h06 -#define XR_RATE_3Mb 5'h01 - -//Registers -#define PCU_REG 'h0 -#define KEY_REG 'h1 -#define D2A2_REG 'h3 - -#define REG_STA_ID0 'h0 -#define STA_ADDR_L32 31:0 - -#define REG_STA_ID1 'h1 -#define STA_ADDR_U16 15:0 -#define AP 16 -#define ADHOC 17 -#define PWR_SV 18 -#define NO_KEYSRCH 19 -#define PCF 20 -#define USE_DEF_ANT 21 -#define DEF_ANT_UPDATE 22 -#define RTS_DEF_ANT 23 -#define ACKCTS_6MB 24 -#define RATE_11B 25 -#define SECTOR_SELF_GEN 26 -#define CRPT_MIC_ENABLE 27 -#define KSRCH_MODE 28 -#define PRESERVE_SEQNUM 29 -#define CBCIV_ENDIAN 30 -#define ADHOC_MCAST_SEARCH 31 - -#define REG_BSS_ID0 'h2 -#define BSSID_L32 31:0 - -#define REG_BSS_ID1 'h3 -#define BSSID_U16 15:0 -#define AID 31:16 - -#define MAC_PCU_REG_BCNRSSI_OFFSET 'h4 -#define MAC_PCU_REG_BCNRSSI_BCN_RSSI_AVE_FIELD 11:0 -#define MAC_PCU_REG_BCNRSSI_BCN_RSSI_AVE_RESET 12'h800 - -#define REG_TIME_OUT 'h5 -#define ACK_TIME_OUT 15:0 -#define CTS_TIME_OUT 31:16 - -#define MAC_PCU_REG_BCNSIG_OFFSET 'h6 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_LO_THR_FIELD 7:0 -#define MAC_PCU_REG_BCNSIG_BCN_MISS_THR_FIELD 15:8 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_HI_THR_FIELD 23:16 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_WEIGHT_FIELD 28:24 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_RESET_FIELD 29 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_LO_THR_RESET 0 -#define MAC_PCU_REG_BCNSIG_BCN_MISS_THR_RESET 8'hFF -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_HI_THR_RESET 8'h7F -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_WEIGHT_RESET 0 - -#define REG_USEC 'h7 -#define USEC 6:0 -#define USEC32 13:7 -#define TX_DELAY 18:14 -#define RX_DELAY 24:19 - -#define REG_BEACON 'h8 -#define BEACON_PERIOD 15:0 -#define TIM_OFFSET 22:16 -#define RESET_TSF 24 - -#define REG_CFP_PERIOD 'h9 - -#define REG_TIMER0 'ha - -#define REG_TIMER1 'hb - -#define REG_TIMER2 'hc - -#define REG_TIMER3 'hd - -#define REG_CFP_DUR 'he - -#define REG_RX_FILTER 'hf -#define UNICAST 0 -#define MULTICAST 1 -#define BROADCAST 2 -#define CONTROL 3 -#define BEACON 4 -#define PROMISCUOUS 5 -#define XR_POLL 6 -#define PROBE_REQ 7 -//#define SYNC 8 -#define MY_BEACON 9 - -#define REG_MCAST_FIL0 'h10 - -#define REG_MCAST_FIL1 'h11 - -#define MAC_PCU_REG_DIAGSW_OFFSET 'h12 -#define MAC_PCU_REG_DIAGSW_DIS_WEP_ACK_FIELD 0 -#define MAC_PCU_REG_DIAGSW_DIS_ACK_FIELD 1 -#define MAC_PCU_REG_DIAGSW_DIS_CTS_FIELD 2 -#define MAC_PCU_REG_DIAGSW_DIS_ENC_FIELD 3 -#define MAC_PCU_REG_DIAGSW_DIS_DEC_FIELD 4 -#define MAC_PCU_REG_DIAGSW_DIS_RX_FIELD 5 -#define MAC_PCU_REG_DIAGSW_LOOP_BACK_FIELD 6 -#define MAC_PCU_REG_DIAGSW_CORR_FCS_FIELD 7 -#define MAC_PCU_REG_DIAGSW_CHAN_INFO_FIELD 8 -#define MAC_PCU_REG_DIAGSW_RESERVED_FIELD 16:9 -#define MAC_PCU_REG_DIAGSW_ACCEPT_NONV0_FIELD 17 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_0_1_FIELD 19:18 -#define MAC_PCU_REG_DIAGSW_RXCLR_HIGH_FIELD 20 -#define MAC_PCU_REG_DIAGSW_IGNORE_NAV_FIELD 21 -#define MAC_PCU_REG_DIAGSW_CHANIDLE_HIGH_FIELD 22 -#define MAC_PCU_REG_DIAGSW_PHYERR_ENABLE_NEW_FIELD 23 -#define MAC_PCU_REG_DIAGSW_DUAL_CHAIN_CHAN_INFO_FIELD 24 -#define MAC_PCU_REG_DIAGSW_FORCE_RX_ABORT_FIELD 25 -#define MAC_PCU_REG_DIAGSW_SATURATE_CYCLE_CNT_FIELD 26 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_2_FIELD 27 -#define MAC_PCU_REG_DIAGSW_DIS_WEP_ACK_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_ACK_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_CTS_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_ENC_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_DEC_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_RX_RESET 0 -#define MAC_PCU_REG_DIAGSW_LOOP_BACK_RESET 0 -#define MAC_PCU_REG_DIAGSW_CORR_FCS_RESET 0 -#define MAC_PCU_REG_DIAGSW_CHAN_INFO_RESET 0 -#define MAC_PCU_REG_DIAGSW_RESERVED_RESET 0 -#define MAC_PCU_REG_DIAGSW_ACCEPT_NONV0_RESET 0 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_0_1_RESET 0 -#define MAC_PCU_REG_DIAGSW_RXCLR_HIGH_RESET 0 -#define MAC_PCU_REG_DIAGSW_IGNORE_NAV_RESET 0 -#define MAC_PCU_REG_DIAGSW_CHANIDLE_HIGH_RESET 0 -#define MAC_PCU_REG_DIAGSW_PHYERR_ENABLE_NEW_RESET 0 -#define MAC_PCU_REG_DIAGSW_DUAL_CHAIN_CHAN_INFO_RESET 0 -#define MAC_PCU_REG_DIAGSW_FORCE_RX_ABORT_RESET 0 -#define MAC_PCU_REG_DIAGSW_SATURATE_CYCLE_CNT_RESET 0 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_2_RESET 0 - -#define REG_TSF_L32 'h13 - -#define REG_TSF_U32 'h14 - -#define REG_TST_ADDAC 'h15 -#define TEST_MODE 0 -#define TEST_LOOP 1 -#define LOOP_LEN 12:2 -#define TEST_UPPER_8B 13 -#define TEST_MSB 14 -#define TEST_CAPTURE 15 - -#define REG_DEF_ANT 'h16 - -#define MAC_PCU_REG_MUTE_MASKS0_OFFSET 'h17 -#define MAC_PCU_REG_MUTE_MASKS0_FC_FIELD 15:0 -#define MAC_PCU_REG_MUTE_MASKS0_QOS_FIELD 31:16 -#define MAC_PCU_REG_MUTE_MASKS0_FC_RESET 16'hC7FF -#define MAC_PCU_REG_MUTE_MASKS0_QOS_RESET 16'hFFFF - -#define MAC_PCU_REG_MUTE_MASKS1_OFFSET 'h18 -#define MAC_PCU_REG_MUTE_MASKS1_SEQ_FIELD 15:0 -#define MAC_PCU_REG_MUTE_MASKS1_FC_MGMT_FIELD 31:16 -#define MAC_PCU_REG_MUTE_MASKS1_SEQ_RESET 16'h000F -#define MAC_PCU_REG_MUTE_MASKS1_FC_MGMT_RESET 16'hE7FF - -#define MAC_PCU_REG_GATED_CLKS_OFFSET 'h19 -//#define MAC_PCU_REG_GATED_SYNC_FIELD 0 -#define MAC_PCU_REG_GATED_TX_FIELD 1 -#define MAC_PCU_REG_GATED_RX_FIELD 2 -#define MAC_PCU_REG_GATED_REG_FIELD 3 -//#define MAC_PCU_REG_GATED_SYNC_RESET 1'b1 -#define MAC_PCU_REG_GATED_TX_RESET 1'b0 -#define MAC_PCU_REG_GATED_RX_RESET 1'b0 -#define MAC_PCU_REG_GATED_REG_RESET 1'b0 - -#define MAC_PCU_REG_OBS2_OFFSET 'h1a -#define MAC_PCU_REG_OBS2_OBS_BUS_FIELD 17:0 - -#define MAC_PCU_REG_OBS1_OFFSET 'h1b -#define MAC_PCU_REG_OBS1_TX_STATE_FIELD 28:24 -#define MAC_PCU_REG_OBS1_RX_STATE_FIELD 23:20 -#define MAC_PCU_REG_OBS1_WEP_STATE_FIELD 17:12 -#define MAC_PCU_REG_OBS1_RX_CLEAR_FIELD 11 -#define MAC_PCU_REG_OBS1_RX_FRAME_FIELD 10 -#define MAC_PCU_REG_OBS1_TX_FRAME_FIELD 9 -#define MAC_PCU_REG_OBS1_TX_HOLD_FIELD 8 -#define MAC_PCU_REG_OBS1_CHAN_IDLE_FIELD 7 -#define MAC_PCU_REG_OBS1_QUIET_TIME_FIELD 6 -#define MAC_PCU_REG_OBS1_TX_HCF_FIELD 5 -#define MAC_PCU_REG_OBS1_FILTER_PASS_FIELD 4 -#define MAC_PCU_REG_OBS1_RX_MY_BEACON_FIELD 3 -#define MAC_PCU_REG_OBS1_RX_WEP_FIELD 2 -#define MAC_PCU_REG_OBS1_PCU_RX_END_FIELD 1 -#define MAC_PCU_REG_OBS1_PCU_DIRECTED_FIELD 0 - -#define REG_LAST_TSTP 'h20 - -#define REG_NAV 'h21 - -#define REG_RTS_OK 'h22 - -#define REG_RTS_FAIL 'h23 - -#define REG_ACK_FAIL 'h24 - -#define REG_FCS_FAIL 'h25 - -#define REG_BEACON_CNT 'h26 - -#define MAC_PCU_REG_XRMODE_OFFSET 'h30 -#define MAC_PCU_REG_XRMODE_XR_POLL_TYPE_FIELD 5:0 -#define MAC_PCU_REG_XRMODE_XR_WAIT_FOR_POLL_FIELD 7 -#define MAC_PCU_REG_XRMODE_XR_FRAME_HOLD_FIELD 31:20 -#define MAC_PCU_REG_XRMODE_XR_POLL_TYPE_RESET 6'h1A -#define MAC_PCU_REG_XRMODE_XR_WAIT_FOR_POLL_RESET 1'b0 -#define MAC_PCU_REG_XRMODE_XR_FRAME_HOLD_RESET 12'd680 - -#define MAC_PCU_REG_XRDEL_OFFSET 'h31 -#define MAC_PCU_REG_XRDEL_XR_SLOT_DELAY_FIELD 15:0 -#define MAC_PCU_REG_XRDEL_XR_CHIRP_DATA_DELAY_FIELD 31:16 -#define MAC_PCU_REG_XRDEL_XR_SLOT_DELAY_RESET 16'd360 -#define MAC_PCU_REG_XRDEL_XR_CHIRP_DATA_DELAY_RESET 16'd1680 - -#define MAC_PCU_REG_XRTO_OFFSET 'h32 -#define MAC_PCU_REG_XRTO_XR_CHIRP_TIMEOUT_FIELD 15:0 -#define MAC_PCU_REG_XRTO_XR_POLL_TIMEOUT_FIELD 31:16 -#define MAC_PCU_REG_XRTO_XR_CHIRP_TIMEOUT_RESET 16'd7200 -#define MAC_PCU_REG_XRTO_XR_POLL_TIMEOUT_RESET 16'd5000 - -#define MAC_PCU_REG_XRCRP_OFFSET 'h33 -#define MAC_PCU_REG_XRCRP_XR_SEND_CHIRP_FIELD 0 -#define MAC_PCU_REG_XRCRP_XR_CHIRP_GAP_FIELD 31:16 -#define MAC_PCU_REG_XRCRP_XR_SEND_CHIRP_RESET 1'b0 -#define MAC_PCU_REG_XRCRP_XR_CHIRP_GAP_RESET 16'd500 - -#define MAC_PCU_REG_XRSTMP_OFFSET 'h34 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_FIELD 0 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_BSSID_FIELD 1 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_FIELD 2 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_BSSID_FIELD 3 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_DATA_FIELD 4 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_DATA_FIELD 5 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_THRESH_FIELD 15:8 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_THRESH_FIELD 23:16 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_RESET 1'b0 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_BSSID_RESET 1'b0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_RESET 1'b0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_BSSID_RESET 1'b0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_DATA_RESET 1'b0 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_DATA_RESET 1'b0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_THRESH_RESET 8'h25 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_THRESH_RESET 8'h25 - -#define MAC_PCU_REG_SLP1_OFFSET 'h35 -//#define MAC_PCU_REG_SLP1_NEXT_DTIM_FIELD 18:0 -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_EXT_FIELD 4:0 -#define MAC_PCU_REG_SLP1_ASSUME_DTIM_FIELD 19 -//#define MAC_PCU_REG_SLP1_ENH_SLEEP_ENABLE_FIELD 20 -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_FIELD 31:21 -// #define MAC_PCU_REG_SLP1_NEXT_DTIM_RESET 19'h2aaaa -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_EXT_RESET 5'h0 -#define MAC_PCU_REG_SLP1_ASSUME_DTIM_RESET 1'b0 -//#define MAC_PCU_REG_SLP1_ENH_SLEEP_ENABLE_RESET 1'b1 -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_RESET 11'd5 - -#define MAC_PCU_REG_SLP2_OFFSET 'h36 -//#define MAC_PCU_REG_SLP2_NEXT_TIM_FIELD 18:0 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_EXT_FIELD 4:0 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_FIELD 31:21 -//#define MAC_PCU_REG_SLP2_NEXT_TIM_RESET 19'h55555 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_EXT_RESET 5'h0 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_RESET 11'd2 - -//#define MAC_PCU_REG_SLP3_OFFSET 'h37 -//#define MAC_PCU_REG_SLP3_TIM_PERIOD_FIELD 15:0 -//#define MAC_PCU_REG_SLP3_DTIM_PERIOD_FIELD 31:16 -//#define MAC_PCU_REG_SLP3_TIM_PERIOD_RESET 16'd2 -//#define MAC_PCU_REG_SLP3_DTIM_PERIOD_RESET 16'd3 - -#define MAC_PCU_REG_BSSMSKL_OFFSET 'h38 -#define MAC_PCU_REG_BSSMSKL_BSSID_MASK_L_FIELD 31:0 -#define MAC_PCU_REG_BSSMSKL_BSSID_MASK_L_RESET 32'hFFFFFFFF - -#define MAC_PCU_REG_BSSMSKH_OFFSET 'h39 -#define MAC_PCU_REG_BSSMSKH_BSSID_MASK_H_FIELD 15:0 -#define MAC_PCU_REG_BSSMSKH_BSSID_MASK_H_RESET 16'hFFFF - -#define MAC_PCU_REG_TPC_OFFSET 'h3A -#define MAC_PCU_REG_TPC_ACK_PWR_FIELD 5:0 -#define MAC_PCU_REG_TPC_CTS_PWR_FIELD 13:8 -#define MAC_PCU_REG_TPC_CHIRP_PWR_FIELD 21:16 -#define MAC_PCU_REG_TPC_ACK_PWR_RESET 6'h3f -#define MAC_PCU_REG_TPC_CTS_PWR_RESET 6'h3f -#define MAC_PCU_REG_TPC_CHIRP_PWR_RESET 6'h3f - -#define MAC_PCU_REG_TFC_OFFSET 'h3B -#define MAC_PCU_REG_TFC_TX_FRAME_CNT_FIELD 31:0 -#define MAC_PCU_REG_TFC_TX_FRAME_CNT_RESET 0 - -#define MAC_PCU_REG_RFC_OFFSET 'h3C -#define MAC_PCU_REG_RFC_RX_FRAME_CNT_FIELD 31:0 -#define MAC_PCU_REG_RFC_RX_FRAME_CNT_RESET 0 - -#define MAC_PCU_REG_RCC_OFFSET 'h3D -#define MAC_PCU_REG_RCC_RX_CLEAR_CNT_FIELD 31:0 -#define MAC_PCU_REG_RCC_RX_CLEAR_CNT_RESET 0 - -#define MAC_PCU_REG_CC_OFFSET 'h3E -#define MAC_PCU_REG_CC_CYCLE_CNT_FIELD 31:0 -#define MAC_PCU_REG_CC_CYCLE_CNT_RESET 0 - -#define MAC_PCU_REG_QT1_OFFSET 'h3F -#define MAC_PCU_REG_QT1_NEXT_QUIET_FIELD 15:0 -#define MAC_PCU_REG_QT1_QUIET_ENABLE_FIELD 16 -#define MAC_PCU_REG_QT1_QUIET_ACK_CTS_ENABLE_FIELD 17 -#define MAC_PCU_REG_QT1_NEXT_QUIET_RESET 16'd0 -#define MAC_PCU_REG_QT1_QUIET_ENABLE_RESET 1'b0 -#define MAC_PCU_REG_QT1_QUIET_ACK_CTS_ENABLE_RESET 1'b1 - -#define MAC_PCU_REG_QT2_OFFSET 'h40 -#define MAC_PCU_REG_QT2_QUIET_PERIOD_FIELD 15:0 -#define MAC_PCU_REG_QT2_QUIET_DURATION_FIELD 31:16 -#define MAC_PCU_REG_QT2_QUIET_PERIOD_RESET 16'd0002 -#define MAC_PCU_REG_QT2_QUIET_DURATION_RESET 16'd0001 - -#define MAC_PCU_REG_TSF_OFFSET 'h41 -#define MAC_PCU_REG_TSF_INCREMENT_FIELD 7:0 -#define MAC_PCU_REG_TSF_INCREMENT_RESET 8'h01 - -#define MAC_PCU_REG_NOACK_OFFSET 'h42 -#define MAC_PCU_REG_NOACK_2_BIT_VALUES_FIELD 3:0 -#define MAC_PCU_REG_NOACK_BIT_OFFSET_FIELD 6:4 -#define MAC_PCU_REG_NOACK_BYTE_OFFSET_FIELD 8:7 -#define MAC_PCU_REG_NOACK_2_BIT_VALUES_RESET 4'h2 -#define MAC_PCU_REG_NOACK_BIT_OFFSET_RESET 3'h5 -#define MAC_PCU_REG_NOACK_BYTE_OFFSET_RESET 2'h0 - -#define MAC_PCU_REG_PHYERR_OFFSET 'h43 -#define MAC_PCU_REG_PHYERR_MASK_FIELD 31:0 -#define MAC_PCU_REG_PHYERR_MASK_RESET 32'h0 - -#define MAC_PCU_REG_XRLAT_OFFSET 'h44 -#define MAC_PCU_REG_XRLAT_XR_TX_DELAY_FIELD 11:0 -#define MAC_PCU_REG_XRLAT_XR_TX_DELAY_RESET 12'h168 - -#define MAC_PCU_REG_ACKSIFS_OFFSET_RESERVED 'h45 -#define MAC_PCU_REG_ACKSIFS_INCREMENT_FIELD_RESERVED 7:0 -#define MAC_PCU_REG_ACKSIFS_INCREMENT_RESET_RESERVED 8'h0 - -#define MAC_PCU_REG_MICQOSCTL_OFFSET 'h46 -#define MAC_PCU_REG_MICQOSCTL_FIELD 15:0 -#define MAC_PCU_REG_MICQOSCTL_ENABLE_FIELD 16 -#define MAC_PCU_REG_MICQOSCTL_RESET 16'h00aa -#define MAC_PCU_REG_MICQOSCTL_ENABLE_RESET 1'h1 - -#define MAC_PCU_REG_MICQOSSEL_OFFSET 'h47 -#define MAC_PCU_REG_MICQOSSEL_FIELD 31:0 -#define MAC_PCU_REG_MICQOSSEL_RESET 32'h00003210 - -#define MAC_PCU_REG_MISCMODE_OFFSET 'h48 -#define MAC_PCU_REG_MISCMODE_BSSID_MATCH_FORCE_FIELD 0 -#define MAC_PCU_REG_MISCMODE_ACKSIFS_MEMORY_FIELD_RESERVED 1 -#define MAC_PCU_REG_MISCMODE_MIC_NEW_LOCATION_FIELD 2 -#define MAC_PCU_REG_MISCMODE_TX_ADD_TSF_FIELD 3 -#define MAC_PCU_REG_MISCMODE_CCK_SIFS_MODE_FIELD 4 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MODE_FIELD_RESERVED 5 -#define MAC_PCU_REG_MISCMODE_BFCOEF_ENABLE_FIELD 6 -#define MAC_PCU_REG_MISCMODE_BFCOEF_UPDATE_SELF_GEN_FIELD 7 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MCAST_FIELD 8 -#define MAC_PCU_REG_MISCMODE_DUAL_CHAIN_ANT_MODE_FIELD 9 -#define MAC_PCU_REG_MISCMODE_FALCON_DESC_MODE_FIELD 10 -#define MAC_PCU_REG_MISCMODE_KC_RX_ANT_UPDATE_FIELD 11 -#define MAC_PCU_REG_MISCMODE_TXOP_TBTT_LIMIT_FIELD 12 -#define MAC_PCU_REG_MISCMODE_FALCON_BB_INTERFACE_FIELD 13 -#define MAC_PCU_REG_MISCMODE_MISS_BEACON_IN_SLEEP_FIELD 14 -#define MAC_PCU_REG_MISCMODE_BUG_12306_FIX_ENABLE_FIELD 17 -#define MAC_PCU_REG_MISCMODE_FORCE_QUIET_COLLISION_FIELD 18 -#define MAC_PCU_REG_MISCMODE_BUG_12549_FORCE_TXBF_FIELD 19 -#define MAC_PCU_REG_MISCMODE_BT_ANT_PREVENTS_RX_FIELD 20 -#define MAC_PCU_REG_MISCMODE_TBTT_PROTECT_FIELD 21 -#define MAC_PCU_REG_MISCMODE_HCF_POLL_CANCELS_NAV_FIELD 22 -#define MAC_PCU_REG_MISCMODE_RX_HCF_POLL_ENABLE_FIELD 23 -#define MAC_PCU_REG_MISCMODE_CLEAR_VMF_FIELD 24 -#define MAC_PCU_REG_MISCMODE_CLEAR_FIRST_HCF_FIELD 25 -#define MAC_PCU_REG_MISCMODE_ADHOC_MCAST_KEYID_ENABLE_FIELD 26 -#define MAC_PCU_REG_MISCMODE_ALLOW_RAC_FIELD 27 -#define MAC_PCU_REG_MISCMODE_BSSID_MATCH_FORCE_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_ACKSIFS_MEMORY_RESET_RESERVED 1'h0 -#define MAC_PCU_REG_MISCMODE_MIC_NEW_LOCATION_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_TX_ADD_TSF_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_CCK_SIFS_MODE_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MODE_RESET_RESERVED 1'h0 -#define MAC_PCU_REG_MISCMODE_BFCOEF_ENABLE_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_BFCOEF_UPDATE_SELF_GEN_RESET 1'h1 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MCAST_RESET 1'h1 -#define MAC_PCU_REG_MISCMODE_DUAL_CHAIN_ANT_MODE_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_FALCON_DESC_MODE_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_KC_RX_ANT_UPDATE_RESET 1'h1 -#define MAC_PCU_REG_MISCMODE_TXOP_TBTT_LIMIT_RESET 1'b0 -#define MAC_PCU_REG_MISCMODE_FALCON_BB_INTERFACE_RESET 1'b0 -#define MAC_PCU_REG_MISCMODE_MISS_BEACON_IN_SLEEP_RESET 1'h1 -#define MAC_PCU_REG_MISCMODE_BUG_12306_FIX_ENABLE_RESET 1'h1 -#define MAC_PCU_REG_MISCMODE_FORCE_QUIET_COLLISION_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_BUG_12549_FORCE_TXBF_RESET 1'b0 -#define MAC_PCU_REG_MISCMODE_BT_ANT_PREVENTS_RX_RESET 1'b1 -#define MAC_PCU_REG_MISCMODE_TBTT_PROTECT_RESET 1'b1 -#define MAC_PCU_REG_MISCMODE_HCF_POLL_CANCELS_NAV_RESET 1'b1 -#define MAC_PCU_REG_MISCMODE_RX_HCF_POLL_ENABLE_RESET 1'b1 -#define MAC_PCU_REG_MISCMODE_CLEAR_VMF_RESET 1'b0 -#define MAC_PCU_REG_MISCMODE_CLEAR_FIRST_HCF_RESET 1'b0 -#define MAC_PCU_REG_MISCMODE_ADHOC_MCAST_KEYID_ENABLE_RESET 1'b0 -#define MAC_PCU_REG_MISCMODE_ALLOW_RAC_RESET 1'b0 - -#define MAC_PCU_REG_FILTOFDM_OFFSET 'h49 -#define MAC_PCU_REG_FILTOFDM_CNT_FIELD 23:0 -#define MAC_PCU_REG_FILTOFDM_CNT_RESET 24'h0 - -#define MAC_PCU_REG_FILTCCK_OFFSET 'h4A -#define MAC_PCU_REG_FILTCCK_CNT_FIELD 23:0 -#define MAC_PCU_REG_FILTCCK_CNT_RESET 24'h0 - -#define MAC_PCU_REG_PHYCNT1_OFFSET 'h4B -#define MAC_PCU_REG_PHYCNT1_FIELD 23:0 -#define MAC_PCU_REG_PHYCNT1_RESET 24'h0 - -#define MAC_PCU_REG_PHYCNTMASK1_OFFSET 'h4C -#define MAC_PCU_REG_PHYCNTMASK1_FIELD 31:0 -#define MAC_PCU_REG_PHYCNTMASK1_RESET 32'h0 - -#define MAC_PCU_REG_PHYCNT2_OFFSET 'h4D -#define MAC_PCU_REG_PHYCNT2_FIELD 23:0 -#define MAC_PCU_REG_PHYCNT2_RESET 24'h0 - -#define MAC_PCU_REG_PHYCNTMASK2_OFFSET 'h4E -#define MAC_PCU_REG_PHYCNTMASK2_FIELD 31:0 -#define MAC_PCU_REG_PHYCNTMASK2_RESET 32'h0 - -#define MAC_PCU_REG_TSFTHRESH_OFFSET 'h4F -#define MAC_PCU_REG_TSFTHRESH_FIELD 15:0 -#define MAC_PCU_REG_TSFTHRESH_RESET 16'hFFFF - -//#define MAC_PCU_REG_TSFCAL_OFFSET 'h50 -//#define MAC_PCU_REG_TSFCAL_COUNT_FIELD 3:0 -//#define MAC_PCU_REG_TSFCAL_INTERVAL_FIELD 7:4 -//#define MAC_PCU_REG_TSFCAL_ENABLE_FIELD 8 -//#define MAC_PCU_REG_TSFCAL_AUTO_CAL_FIELD 9 -//#define MAC_PCU_REG_TSFCAL_VALUE_WE_FIELD 10 -//#define MAC_PCU_REG_TSFCAL_VALUE_FIELD 31:16 -//#define MAC_PCU_REG_TSFCAL_COUNT_RESET 'h8 -//#define MAC_PCU_REG_TSFCAL_INTERVAL_RESET 'ha -//#define MAC_PCU_REG_TSFCAL_ENABLE_RESET 'h1 -//#define MAC_PCU_REG_TSFCAL_AUTO_CAL_RESET 'h1 -//#define MAC_PCU_REG_TSFCAL_VALUE_WE_RESET 'h0 -//#define MAC_PCU_REG_TSFCAL_VALUE_RESET 'h8000 - -#define MAC_PCU_REG_PHYERR_EIFS_OFFSET 'h51 -#define MAC_PCU_REG_PHYERR_EIFS_MASK_FIELD 31:0 -#define MAC_PCU_REG_PHYERR_EIFS_MASK_RESET 'h0 - -//#define MAC_PCU_REG_SYNC1_OFFSET 'h52 -//#define MAC_PCU_REG_SYNC1_TIME_FIELD 30:0 -//#define MAC_PCU_REG_SYNC1_TIME_RESET 32'h0 - -//#define MAC_PCU_REG_SYNC2_OFFSET 'h53 -//#define MAC_PCU_REG_SYNC2_TIME_OFFSET_FIELD 7:0 -//#define MAC_PCU_REG_SYNC2_MASTER_FIELD 8 -//#define MAC_PCU_REG_SYNC2_REPLACE_FIELD 9 -//#define MAC_PCU_REG_SYNC2_TUNE_FIELD 10 -//#define MAC_PCU_REG_SYNC2_CLEAR_FIELD 11 -//#define MAC_PCU_REG_SYNC2_INTR_THRESH_FIELD 31:16 -//#define MAC_PCU_REG_SYNC2_TIME_OFFSET_RESET 8'h0 -//#define MAC_PCU_REG_SYNC2_MASTER_RESET 1'h0 -//#define MAC_PCU_REG_SYNC2_REPLACE_RESET 1'h0 -//#define MAC_PCU_REG_SYNC2_TUNE_RESET 1'h0 -//#define MAC_PCU_REG_SYNC2_CLEAR_RESET 1'h0 -//#define MAC_PCU_REG_SYNC2_INTR_THRESH_RESET 16'hFFFF - -//#define MAC_PCU_REG_SYNC3_OFFSET 'h54 -//#define MAC_PCU_REG_SYNC3_MCAST_ADDR_L_FIELD 31:0 -//#define MAC_PCU_REG_SYNC3_MCAST_ADDR_L_RESET 32'h0 - -//#define MAC_PCU_REG_SYNC4_OFFSET 'h55 -//#define MAC_PCU_REG_SYNC4_MCAST_ADDR_U_FIELD 15:0 -//#define MAC_PCU_REG_SYNC4_MCAST_ADDR_U_RESET 16'h0 - -//#define MAC_PCU_REG_SYNC5_OFFSET 'h56 -//#define MAC_PCU_REG_SYNC5_RX_TIME_FIELD 30:0 - -//#define MAC_PCU_REG_SYNC6_OFFSET 'h57 -//#define MAC_PCU_REG_SYNC6_INC_FIELD 31:0 - -//#define MAC_PCU_REG_SYNC7_OFFSET 'h58 -//#define MAC_PCU_REG_SYNC7_LAST_TIME_FIELD 30:0 - -//#define MAC_PCU_REG_SYNC8_OFFSET 'h59 -//#define MAC_PCU_REG_SYNC8_UPDATED_TIME_FIELD 30:0 - -#define MAC_PCU_REG_PHYCNT3_OFFSET 'h5A -#define MAC_PCU_REG_PHYCNT3_FIELD 23:0 -#define MAC_PCU_REG_PHYCNT3_RESET 24'h0 - -#define MAC_PCU_REG_PHYCNTMASK3_OFFSET 'h5B -#define MAC_PCU_REG_PHYCNTMASK3_FIELD 31:0 -#define MAC_PCU_REG_PHYCNTMASK3_RESET 32'h0 - -#define MAC_PCU_REG_BTMODE_OFFSET 'h5C -#define MAC_PCU_REG_BTMODE_TIME_EXTEND_FIELD 7:0 -#define MAC_PCU_REG_BTMODE_TXSTATE_EXTEND_FIELD 8 -#define MAC_PCU_REG_BTMODE_TX_FRAME_EXTEND_FIELD 9 -#define MAC_PCU_REG_BTMODE_MODE_FIELD 11:10 -#define MAC_PCU_REG_BTMODE_QUIET_FIELD 12 -#define MAC_PCU_REG_BTMODE_QCU_THRESH_FIELD 16:13 -#define MAC_PCU_REG_BTMODE_RX_CLEAR_POLARITY_FIELD 17 -#define MAC_PCU_REG_BTMODE_PRIORITY_TIME_FIELD 23:18 -#define MAC_PCU_REG_BTMODE_FIRST_SLOT_TIME_FIELD 31:24 -#define MAC_PCU_REG_BTMODE_TIME_EXTEND_RESET 8'h20 -#define MAC_PCU_REG_BTMODE_TXSTATE_EXTEND_RESET 1'b1 -#define MAC_PCU_REG_BTMODE_TX_FRAME_EXTEND_RESET 1'b1 -#define MAC_PCU_REG_BTMODE_MODE_RESET 2'h3 -#define MAC_PCU_REG_BTMODE_QUIET_RESET 1'b1 -#define MAC_PCU_REG_BTMODE_QCU_THRESH_RESET 4'b0001 -#define MAC_PCU_REG_BTMODE_RX_CLEAR_POLARITY_RESET 1'b0 -#define MAC_PCU_REG_BTMODE_PRIORITY_TIME_RESET 6'h05 -#define MAC_PCU_REG_BTMODE_FIRST_SLOT_TIME_RESET 8'h9B - -#define MAC_PCU_REG_BTWEIGHT_OFFSET 'h5D -#define MAC_PCU_REG_BTWEIGHT_BT_WEIGHT_FIELD 15:0 -#define MAC_PCU_REG_BTWEIGHT_WL_WEIGHT_FIELD 31:16 -#define MAC_PCU_REG_BTWEIGHT_BT_WEIGHT_RESET 16'b11_11_10_10_01_01_00_00 -#define MAC_PCU_REG_BTWEIGHT_WL_WEIGHT_RESET 16'b11_11_10_10_10_10_01_00 - -#define MAC_PCU_REG_HCF_OFFSET 'h5E -#define MAC_PCU_REG_HCF_TIMEOUT_FIELD 15:0 -#define MAC_PCU_REG_HCF_TIMEOUT_RESET 'h100 - -#define MAC_PCU_REG_BTMODE2_OFFSET 'h5F -#define MAC_PCU_REG_BTMODE2_BT_BCN_MISS_THRESH_FIELD 7:0 -#define MAC_PCU_REG_BTMODE2_BCN_MISS_CNT_FIELD 15:8 -#define MAC_PCU_REG_BTMODE2_BT_HOLD_RX_CLEAR_FIELD 16 -#define MAC_PCU_REG_BTMODE2_WL_CONTROL_ANT_FIELD 17 -#define MAC_PCU_REG_BTMODE2_RESPOND_TO_BT_ACTIVE_FIELD 18 -#define MAC_PCU_REG_BTMODE2_PROTECT_BT_AFTER_WAKEUP_FIELD 19 -#define MAC_PCU_REG_BTMODE2_DISABLE_BT_ANT_FIELD 20 -#define MAC_PCU_REG_BTMODE2_BT_BCN_MISS_THRESH_RESET 0 -#define MAC_PCU_REG_BTMODE2_BT_HOLD_RX_CLEAR_RESET 0 -#define MAC_PCU_REG_BTMODE2_WL_CONTROL_ANT_RESET 1'h0 -#define MAC_PCU_REG_BTMODE2_RESPOND_TO_BT_ACTIVE_RESET 1'h0 -#define MAC_PCU_REG_BTMODE2_PROTECT_BT_AFTER_WAKEUP_RESET 1'h0 -#define MAC_PCU_REG_BTMODE2_DISABLE_BT_ANT_RESET 1'h0 - -#define MAC_PCU_REG_BFCOEF1_OFFSET 'h60 -#define MAC_PCU_REG_BFCOEF1_UPPER_OFFSET 'h67 -#define MAC_PCU_REG_BFCOEF1_KEY_VALID_FIELD 31 -#define MAC_PCU_REG_BFCOEF1_KEYIDX_FIELD 30:24 -#define MAC_PCU_REG_BFCOEF1_TSF_FIELD 23:0 -#define MAC_PCU_REG_BFCOEF1_KEY_VALID_RESET 1'b0 - -#define MAC_PCU_REG_BFCOEF2_OFFSET 'h70 -#define MAC_PCU_REG_BFCOEF2_THRESH_FIELD 22:0 -#define MAC_PCU_REG_BFCOEF2_LOCK_FIELD 31:24 -#define MAC_PCU_REG_BFCOEF2_THRESH_RESET 23'b0 -#define MAC_PCU_REG_BFCOEF2_LOCK_RESET 8'b0 - -#define MAC_PCU_REG_KCMASK_OFFSET 'h71 -#define MAC_PCU_REG_KCMASK_47_32_FIELD 15:0 -#define MAC_PCU_REG_KCMASK_47_32_RESET 0 -#define MAC_PCU_REG_KCMASK_31_0_FIELD 16 -#define MAC_PCU_REG_KCMASK_31_0_RESET 0 - -#define MAC_PCU_REG_TXSIFS_OFFSET 'h74 -#define MAC_PCU_REG_TXSIFS_SIFS_TIME_FIELD 7:0 -#define MAC_PCU_REG_TXSIFS_TX_LATENCY_FIELD 11:8 -#define MAC_PCU_REG_TXSIFS_ACK_SHIFT_FIELD 14:12 -#define MAC_PCU_REG_TXSIFS_SIFS_TIME_RESET 16 -#define MAC_PCU_REG_TXSIFS_TX_LATENCY_RESET 2 -#define MAC_PCU_REG_TXSIFS_ACK_SHIFT_RESET 3 - -#define MAC_PCU_REG_TXOP_X_OFFSET 'h7b -#define MAC_PCU_REG_TXOP_X_FIELD 7:0 -#define MAC_PCU_REG_TXOP_X_RESET 0 - -#define MAC_PCU_REG_TXOP_0_3_OFFSET 'h7c -#define MAC_PCU_REG_TXOP_0_FIELD 7:0 -#define MAC_PCU_REG_TXOP_1_FIELD 15:8 -#define MAC_PCU_REG_TXOP_2_FIELD 23:16 -#define MAC_PCU_REG_TXOP_3_FIELD 31:24 -#define MAC_PCU_REG_TXOP_0_RESET 0 -#define MAC_PCU_REG_TXOP_1_RESET 0 -#define MAC_PCU_REG_TXOP_2_RESET 0 -#define MAC_PCU_REG_TXOP_3_RESET 0 - -#define MAC_PCU_REG_TXOP_4_7_OFFSET 'h7d -#define MAC_PCU_REG_TXOP_4_FIELD 7:0 -#define MAC_PCU_REG_TXOP_5_FIELD 15:8 -#define MAC_PCU_REG_TXOP_6_FIELD 23:16 -#define MAC_PCU_REG_TXOP_7_FIELD 31:24 -#define MAC_PCU_REG_TXOP_4_RESET 0 -#define MAC_PCU_REG_TXOP_5_RESET 0 -#define MAC_PCU_REG_TXOP_6_RESET 0 -#define MAC_PCU_REG_TXOP_7_RESET 0 - -#define MAC_PCU_REG_TXOP_8_11_OFFSET 'h7e -#define MAC_PCU_REG_TXOP_8_FIELD 7:0 -#define MAC_PCU_REG_TXOP_9_FIELD 15:8 -#define MAC_PCU_REG_TXOP_10_FIELD 23:16 -#define MAC_PCU_REG_TXOP_11_FIELD 31:24 -#define MAC_PCU_REG_TXOP_8_RESET 0 -#define MAC_PCU_REG_TXOP_9_RESET 0 -#define MAC_PCU_REG_TXOP_10_RESET 0 -#define MAC_PCU_REG_TXOP_11_RESET 0 - -#define MAC_PCU_REG_TXOP_12_15_OFFSET 'h7f -#define MAC_PCU_REG_TXOP_12_FIELD 7:0 -#define MAC_PCU_REG_TXOP_13_FIELD 15:8 -#define MAC_PCU_REG_TXOP_14_FIELD 23:16 -#define MAC_PCU_REG_TXOP_15_FIELD 31:24 -#define MAC_PCU_REG_TXOP_12_RESET 0 -#define MAC_PCU_REG_TXOP_13_RESET 0 -#define MAC_PCU_REG_TXOP_14_RESET 0 -#define MAC_PCU_REG_TXOP_15_RESET 0 - -#define MAC_PCU_REG_GNRCTMR_N_OFFSET 'h80 -#define MAC_PCU_REG_GNRCTMR_N_UPPER_OFFSET 'h87 -#define MAC_PCU_REG_GNRCTMR_N_FIELD 31:0 - -#define MAC_PCU_REG_GNRCTMR_P_OFFSET 'h88 -#define MAC_PCU_REG_GNRCTMR_P_UPPER_OFFSET 'h8F -#define MAC_PCU_REG_GNRCTMR_P_FIELD 27:0 - -#define MAC_PCU_REG_GNRCTMR_M_OFFSET 'h90 -#define MAC_PCU_REG_GNRCTMR_M_ENABLE_FIELD 7:0 -#define MAC_PCU_REG_GNRCTMR_M_OVERFLOW_INDEX_FIELD 10:8 -#define MAC_PCU_REG_GNRCTMR_M_THRESH_FIELD 31:12 -#define MAC_PCU_REG_GNRCTMR_M_ENABLE_RESET 8'h0 -#define MAC_PCU_REG_GNRCTMR_M_THRESH_RESET 20'h00100 - -#define MAC_PCU_REG_SLP32_MODE_OFFSET 'h91 -#define MAC_PCU_REG_SLP32_MODE_HALF_CLK_LATENCY_FIELD 19:0 -#define MAC_PCU_REG_SLP32_MODE_ENABLE_FIELD 20 -#define MAC_PCU_REG_SLP32_MODE_TSF_WRITE_STAT_FIELD 21 -#define MAC_PCU_REG_SLP32_MODE_HALF_CLK_LATENCY_RESET 20'h0F424 -#define MAC_PCU_REG_SLP32_MODE_ENABLE_RESET 1'b1 - -#define MAC_PCU_REG_SLP32_WAKE_OFFSET 'h92 -#define MAC_PCU_REG_SLP32_WAKE_XTL_TIME_FIELD 15:0 -#define MAC_PCU_REG_SLP32_WAKE_XTL_TIME_RESET 16'h07EF - -#define MAC_PCU_REG_SLP32_TSF_INC_OFFSET 'h93 -#define MAC_PCU_REG_SLP32_TSF_INC_FIELD 19:0 -#define MAC_PCU_REG_SLP32_TSF_INC_RESET 20'h1E848 - -#define MAC_PCU_REG_SLPMIB1_OFFSET 'h94 -#define MAC_PCU_REG_SLPMIB1_SLEEP_CNT_FIELD 31:0 - -#define MAC_PCU_REG_SLPMIB2_OFFSET 'h95 -#define MAC_PCU_REG_SLPMIB2_CYCLE_CNT_FIELD 31:0 - -#define MAC_PCU_REG_SLPMIB3_OFFSET 'h96 -#define MAC_PCU_REG_SLPMIB3_CLR_CNT_FIELD 0 -#define MAC_PCU_REG_SLPMIB3_PEND_FIELD 1 - -#define MAC_PCU_REG_MISCMODE2_OFFSET 'h97 -#define MAC_PCU_REG_MISCMODE2_MGMT_CRYPTO_ENABLE_FIELD 0 -#define MAC_PCU_REG_MISCMODE2_NO_CRYPTO_FOR_NON_DATA_PKT_FIELD 1 -#define MAC_PCU_REG_MISCMODE2_MGMT_QOS_FIELD 15:8 -#define MAC_PCU_REG_MISCMODE2_BC_MC_WAPI_MODE_FIELD 16 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_FOR_1ST_PKT_FIELD 17 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_IF_ZERO_FIELD 18 -#define MAC_PCU_REG_MISCMODE2_MGMT_CRYPTO_ENABLE_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE2_NO_CRYPTO_FOR_NON_DATA_PKT_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE2_MGMT_QOS_RESET 8'h10 -#define MAC_PCU_REG_MISCMODE2_BC_MC_WAPI_MODE_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_FOR_1ST_PKT_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_IF_ZERO_RESET 1'h0 - -#define MAC_PCU_REG_SLP4_OFFSET 'h98 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_DUR_FIELD 15:0 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_ENABLE_FIELD 16 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_DUR_RESET 16'h5 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_ENABLE_RESET 1'h0 - -#define MAC_PCU_REG_SLP5_OFFSET 'h99 -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_FIELD 23:0 -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_ENABLE_FIELD 24 -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_RESET 24'hff_ffff -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_ENABLE_RESET 1'h0 - -#define MAC_PCU_REG_MCICTL_OFFSET 'h9a -#define MAC_PCU_REG_MCICTL_MCI_ENABLE_FIELD 0 -#define MAC_PCU_REG_MCICTL_OLA_ENABLE_FIELD 1 -#define MAC_PCU_REG_MCICTL_PREEMPT_ENABLE_FIELD 2 -#define MAC_PCU_REG_MCICTL_CHANNEL_BUSY_ENABLE_FIELD 3 -#define MAC_PCU_REG_MCICTL_EARLY_NOTIFY_DELAY_FIELD 9:4 -#define MAC_PCU_REG_MCICTL_BMISS_FORCE_WL_FIELD 10 -#define MAC_PCU_REG_MCICTL_SLEEP_FORCE_BT_FIELD 11 -#define MAC_PCU_REG_MCICTL_HP_QCU_STOMP_BT_FIELD 12 -#define MAC_PCU_REG_MCICTL_MCI_BUSY_FIELD 31 -#define MAC_PCU_REG_MCICTL_MCI_ENABLE_RESET 1'h0 -#define MAC_PCU_REG_MCICTL_OLA_ENABLE_RESET 1'h1 -#define MAC_PCU_REG_MCICTL_PREEMPT_ENABLE_RESET 1'h1 -#define MAC_PCU_REG_MCICTL_CHANNEL_BUSY_ENABLE_RESET 1'h1 -#define MAC_PCU_REG_MCICTL_EARLY_NOTIFY_DELAY_RESET 6'h5 -#define MAC_PCU_REG_MCICTL_BMISS_FORCE_WL_RESET 1'b0 -#define MAC_PCU_REG_MCICTL_SLEEP_FORCE_BT_RESET 1'b1 -#define MAC_PCU_REG_MCICTL_HP_QCU_STOMP_BT_RESET 1'b0 - -#define MAC_PCU_REG_MCIISR_OFFSET 'h9b -#define MAC_PCU_REG_MCIISR_ACT_RPT_RCV_INT_FIELD 0 -#define MAC_PCU_REG_MCIISR_ACT_DEN_RCV_INT_FIELD 1 -#define MAC_PCU_REG_MCIISR_FRQ_RPT_RCV_INT_FIELD 2 -#define MAC_PCU_REG_MCIISR_QOS_RPT_RCV_INT_FIELD 3 -#define MAC_PCU_REG_MCIISR_GEN_RPT_RCV_INT_FIELD 4 -#define MAC_PCU_REG_MCIISR_ACT_RPT_RCV_INT_RESET 1'b0 -#define MAC_PCU_REG_MCIISR_ACT_DEN_RCV_INT_RESET 1'b0 -#define MAC_PCU_REG_MCIISR_FRQ_RPT_RCV_INT_RESET 1'b0 -#define MAC_PCU_REG_MCIISR_QOS_RPT_RCV_INT_RESET 1'b0 -#define MAC_PCU_REG_MCIISR_GEN_RPT_RCV_INT_RESET 1'b0 - -#define MAC_PCU_REG_MCIIER_OFFSET 'h9c -#define MAC_PCU_REG_MCIIER_ACT_RPT_RCV_INT_ENABLE_FIELD 0 -#define MAC_PCU_REG_MCIIER_ACT_DEN_RCV_INT_ENABLE_FIELD 1 -#define MAC_PCU_REG_MCIIER_FRQ_RPT_RCV_INT_ENABLE_FIELD 2 -#define MAC_PCU_REG_MCIIER_QOS_RPT_RCV_INT_ENABLE_FIELD 3 -#define MAC_PCU_REG_MCIIER_GEN_RPT_RCV_INT_ENABLE_FIELD 4 -#define MAC_PCU_REG_MCIIER_ACT_RPT_RCV_INT_ENABLE_RESET 1'b0 -#define MAC_PCU_REG_MCIIER_ACT_DEN_RCV_INT_ENABLE_RESET 1'b0 -#define MAC_PCU_REG_MCIIER_FRQ_RPT_RCV_INT_ENABLE_RESET 1'b0 -#define MAC_PCU_REG_MCIIER_QOS_RPT_RCV_INT_ENABLE_RESET 1'b0 -#define MAC_PCU_REG_MCIIER_GEN_RPT_RCV_INT_ENABLE_RESET 1'b0 - -#define MAC_PCU_REG_MCIWLP_OFFSET 'h9d -#define MAC_PCU_REG_MCIWLP_RESET 30'h0 - -#define MAC_PCU_REG_MCIARW_OFFSET 'h9e -#define MAC_PCU_REG_MCIARW_RESET 32'h0 - -#define MAC_PCU_REG_MCIARR_OFFSET 'h9f - -#define MAC_PCU_REG_MCIADW_OFFSET 'ha0 -#define MAC_PCU_REG_MCIADW_RESET 32'h0 - -#define MAC_PCU_REG_MCIADR_OFFSET 'ha1 - -#define MAC_PCU_REG_MCIFRW_OFFSET 'ha2 -#define MAC_PCU_REG_MCIFRW_RESET 32'h0 - -#define MAC_PCU_REG_MCIFRR_OFFSET 'ha3 - -#define MAC_PCU_REG_MCIQRW_OFFSET 'ha4 -#define MAC_PCU_REG_MCIQRW_RESET 32'h0 - -#define MAC_PCU_REG_MCIQRR_OFFSET 'ha5 - -#define MAC_PCU_REG_MCIGRW_OFFSET 'ha6 -#define MAC_PCU_REG_MCIGRW_RESET 32'h0 - -#define MAC_PCU_REG_MCIGRR_OFFSET 'ha7 - -#define MAC_PCU_REG_MCISTAT_OFFSET 'ha8 -#define MAC_PCU_REG_MCISTAT_ACT_RPT_RCV_CNT_FIELD 7:0 -#define MAC_PCU_REG_MCISTAT_QC_CNT_FIELD 15:8 -#define MAC_PCU_REG_MCISTAT_OLA_CNT_FIELD 23:16 -#define MAC_PCU_REG_MCISTAT_PREEMPT_CNT_FIELD 31:24 -#define MAC_PCU_REG_MCISTAT_ACT_RPT_RCV_CNT_RESET 8'h0 -#define MAC_PCU_REG_MCISTAT_QC_CNT_RESET 8'h0 -#define MAC_PCU_REG_MCISTAT_OLA_CNT_RESET 8'h0 -#define MAC_PCU_REG_MCISTAT_PREEMPT_CNT_RESET 8'h0 - -#define MAC_PCU_REG_BASIC_RATE_SET0_OFFSET 'ha9 -#define MAC_PCU_REG_BRATE_1MB_L_FIELD 4:0 -#define MAC_PCU_REG_BRATE_2MB_L_FIELD 9:5 -#define MAC_PCU_REG_BRATE_2MB_S_FIELD 14:10 -#define MAC_PCU_REG_BRATE_5_5MB_L_FIELD 19:15 -#define MAC_PCU_REG_BRATE_5_5MB_S_FIELD 24:20 -#define MAC_PCU_REG_BRATE_11MB_L_FIELD 29:25 -#define MAC_PCU_REG_BRATE_1MB_L_RESET #CCK_RATE_1Mb_L -#define MAC_PCU_REG_BRATE_2MB_L_RESET #CCK_RATE_2Mb_L -#define MAC_PCU_REG_BRATE_2MB_S_RESET #CCK_RATE_2Mb_S -#define MAC_PCU_REG_BRATE_5_5MB_L_RESET #CCK_RATE_5_5Mb_L -#define MAC_PCU_REG_BRATE_5_5MB_S_RESET #CCK_RATE_5_5Mb_S -#define MAC_PCU_REG_BRATE_11MB_L_RESET #CCK_RATE_11Mb_L - -#define MAC_PCU_REG_BASIC_RATE_SET1_OFFSET 'haa -#define MAC_PCU_REG_BRATE_11MB_S_FIELD 4:0 -#define MAC_PCU_REG_BRATE_6MB_FIELD 9:5 -#define MAC_PCU_REG_BRATE_9MB_FIELD 14:10 -#define MAC_PCU_REG_BRATE_12MB_FIELD 19:15 -#define MAC_PCU_REG_BRATE_18MB_FIELD 24:20 -#define MAC_PCU_REG_BRATE_24MB_FIELD 29:25 -#define MAC_PCU_REG_BRATE_11MB_S_RESET #CCK_RATE_11Mb_S -#define MAC_PCU_REG_BRATE_6MB_RESET #OFDM_RATE_6Mb -#define MAC_PCU_REG_BRATE_9MB_RESET #OFDM_RATE_6Mb -#define MAC_PCU_REG_BRATE_12MB_RESET #OFDM_RATE_12Mb -#define MAC_PCU_REG_BRATE_18MB_RESET #OFDM_RATE_12Mb -#define MAC_PCU_REG_BRATE_24MB_RESET #OFDM_RATE_24Mb - -#define MAC_PCU_REG_BASIC_RATE_SET2_OFFSET 'hab -#define MAC_PCU_REG_BRATE_36MB_FIELD 4:0 -#define MAC_PCU_REG_BRATE_48MB_FIELD 9:5 -#define MAC_PCU_REG_BRATE_54MB_FIELD 14:10 -#define MAC_PCU_REG_BRATE_36MB_RESET #OFDM_RATE_24Mb -#define MAC_PCU_REG_BRATE_48MB_RESET #OFDM_RATE_24Mb -#define MAC_PCU_REG_BRATE_54MB_RESET #OFDM_RATE_24Mb - -#define MAC_PCU_REG_SEC_BSSID_L32_OFFSET 'hac -#define MAC_PCU_REG_SEC_BSSID_L32_FIELD 31:0 -#define MAC_PCU_REG_SEC_BSSID_L32_RESET 32'h0 - -#define MAC_PCU_REG_SEC_BSSID_U16_OFFSET 'had -#define MAC_PCU_REG_SEC_BSSID_U16_FIELD 15:0 -#define MAC_PCU_REG_SEC_BSSID_ENABLE_FIELD 16 -#define MAC_PCU_REG_SEC_BSSID_U16_RESET 16'h0 -#define MAC_PCU_REG_SEC_BSSID_ENABLE_RESET 1'b0 - -#define MAC_PCU_REG_FTYPE_OFFSET 'h140 -#define MAC_PCU_REG_FTYPE_UPPER_OFFSET 'h17F -#define MAC_PCU_REG_FTYPE_BFCOEF_RX_UPDATE_NORMAL_FIELD 0 -#define MAC_PCU_REG_FTYPE_BFCOEF_RX_UPDATE_SELF_GEN_FIELD 1 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_NORMAL_FIELD 2 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_SELF_GEN_FIELD 3 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_GEN_FIELD 4 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_MCAST_FIELD 5 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_ALL_FIELD 6 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_DIRECTED_FIELD 7 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_MCAST_FIELD 8 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_BCAST_FIELD 9 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_MC_BC_BSSID_FIELD 10 - -#define MAC_PCU_REG_ACKSIFSMEM_OFFSET_RESERVED 'h1A0 -#define MAC_PCU_REG_ACKSIFSMEM_UPPER_OFFSET_RESERVED 'h1BF -#define MAC_PCU_REG_ACKSIFSMEM_NORMAL_FIELD_RESERVED 9:0 -#define MAC_PCU_REG_ACKSIFSMEM_TURBO_FIELD_RESERVED 19:10 - -#define MAC_PCU_REG_DUR_OFFSET 'h1C0 -#define MAC_PCU_REG_DUR_UPPER_OFFSET 'h1DF -#define MAC_PCU_REG_DUR_RATE_TO_DURATION_FIELD 15:0 - -#define MAC_PCU_REG_RTD_OFFSET 'h1F0 -#define MAC_PCU_REG_RTD_UPPER_OFFSET 'h1F7 -#define MAC_PCU_REG_RTD_RATE_TO_DB_0_FIELD 4:0 -#define MAC_PCU_REG_RTD_RATE_TO_DB_1_FIELD 12:8 -#define MAC_PCU_REG_RTD_RATE_TO_DB_2_FIELD 20:16 -#define MAC_PCU_REG_RTD_RATE_TO_DB_3_FIELD 28:24 - -#define MAC_PCU_REG_DTR_OFFSET 'h1F8 -#define MAC_PCU_REG_DTR_UPPER_OFFSET 'h1FF -#define MAC_PCU_REG_DTR_DB_TO_RATE_0_FIELD 4:0 -#define MAC_PCU_REG_DTR_DB_TO_RATE_1_FIELD 12:8 -#define MAC_PCU_REG_DTR_DB_TO_RATE_2_FIELD 20:16 -#define MAC_PCU_REG_DTR_DB_TO_RATE_3_FIELD 28:24 - -#define MAC_PCU_REG_KC_OFFSET 'h200 -#define MAC_PCU_REG_KC_UPPER_OFFSET 'h5FF -#define MAC_PCU_REG_KC_KEY_31_0_FIELD 31:0 -#define MAC_PCU_REG_KC_KEY_47_32_FIELD 15:0 -#define MAC_PCU_REG_KC_KEY_79_48_FIELD 31:0 -#define MAC_PCU_REG_KC_KEY_95_80_FIELD 15:0 -#define MAC_PCU_REG_KC_KEY_127_96_FIELD 31:0 -#define MAC_PCU_REG_KC_KEY_TYPE_FIELD 2:0 -#define MAC_PCU_REG_KC_LAST_ANTENNA_FIELD 3 -#define MAC_PCU_REG_KC_ASYNC_ACK_OFFSET_FIELD 8:4 -#define MAC_PCU_REG_KC_UPDATE_BEAM_FORMING_FIELD 9 -#define MAC_PCU_REG_KC_RX_CHAIN_0_ACK_ANT_FIELD 10 -#define MAC_PCU_REG_KC_RX_CHAIN_1_ACK_ANT_FIELD 11 -#define MAC_PCU_REG_KC_TX_CHAIN_0_ANT_SEL_FIELD 12 -#define MAC_PCU_REG_KC_TX_CHAIN_1_ANT_SEL_FIELD 13 -#define MAC_PCU_REG_KC_TX_CHAIN_SEL_FIELD 14 -#define MAC_PCU_REG_KC_ADDR_32_1_FIELD 31:0 -#define MAC_PCU_REG_KC_ADDR_47_33_FIELD 14:0 -#define MAC_PCU_REG_KC_VALID_FIELD 1 - -//Misc -#define ELEM_START 36 -#define CFP_ELEM 4 - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/mbox_host_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/mbox_host_reg.h deleted file mode 100644 index f836ae47a303..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/mbox_host_reg.h +++ /dev/null @@ -1,386 +0,0 @@ -#ifndef _MBOX_HOST_REG_REG_H_ -#define _MBOX_HOST_REG_REG_H_ - -#define HOST_INT_STATUS_ADDRESS 0x00000400 -#define HOST_INT_STATUS_OFFSET 0x00000400 -#define HOST_INT_STATUS_ERROR_MSB 7 -#define HOST_INT_STATUS_ERROR_LSB 7 -#define HOST_INT_STATUS_ERROR_MASK 0x00000080 -#define HOST_INT_STATUS_ERROR_GET(x) (((x) & HOST_INT_STATUS_ERROR_MASK) >> HOST_INT_STATUS_ERROR_LSB) -#define HOST_INT_STATUS_ERROR_SET(x) (((x) << HOST_INT_STATUS_ERROR_LSB) & HOST_INT_STATUS_ERROR_MASK) -#define HOST_INT_STATUS_CPU_MSB 6 -#define HOST_INT_STATUS_CPU_LSB 6 -#define HOST_INT_STATUS_CPU_MASK 0x00000040 -#define HOST_INT_STATUS_CPU_GET(x) (((x) & HOST_INT_STATUS_CPU_MASK) >> HOST_INT_STATUS_CPU_LSB) -#define HOST_INT_STATUS_CPU_SET(x) (((x) << HOST_INT_STATUS_CPU_LSB) & HOST_INT_STATUS_CPU_MASK) -#define HOST_INT_STATUS_DRAGON_INT_MSB 5 -#define HOST_INT_STATUS_DRAGON_INT_LSB 5 -#define HOST_INT_STATUS_DRAGON_INT_MASK 0x00000020 -#define HOST_INT_STATUS_DRAGON_INT_GET(x) (((x) & HOST_INT_STATUS_DRAGON_INT_MASK) >> HOST_INT_STATUS_DRAGON_INT_LSB) -#define HOST_INT_STATUS_DRAGON_INT_SET(x) (((x) << HOST_INT_STATUS_DRAGON_INT_LSB) & HOST_INT_STATUS_DRAGON_INT_MASK) -#define HOST_INT_STATUS_COUNTER_MSB 4 -#define HOST_INT_STATUS_COUNTER_LSB 4 -#define HOST_INT_STATUS_COUNTER_MASK 0x00000010 -#define HOST_INT_STATUS_COUNTER_GET(x) (((x) & HOST_INT_STATUS_COUNTER_MASK) >> HOST_INT_STATUS_COUNTER_LSB) -#define HOST_INT_STATUS_COUNTER_SET(x) (((x) << HOST_INT_STATUS_COUNTER_LSB) & HOST_INT_STATUS_COUNTER_MASK) -#define HOST_INT_STATUS_MBOX_DATA_MSB 3 -#define HOST_INT_STATUS_MBOX_DATA_LSB 0 -#define HOST_INT_STATUS_MBOX_DATA_MASK 0x0000000f -#define HOST_INT_STATUS_MBOX_DATA_GET(x) (((x) & HOST_INT_STATUS_MBOX_DATA_MASK) >> HOST_INT_STATUS_MBOX_DATA_LSB) -#define HOST_INT_STATUS_MBOX_DATA_SET(x) (((x) << HOST_INT_STATUS_MBOX_DATA_LSB) & HOST_INT_STATUS_MBOX_DATA_MASK) - -#define CPU_INT_STATUS_ADDRESS 0x00000401 -#define CPU_INT_STATUS_OFFSET 0x00000401 -#define CPU_INT_STATUS_BIT_MSB 7 -#define CPU_INT_STATUS_BIT_LSB 0 -#define CPU_INT_STATUS_BIT_MASK 0x000000ff -#define CPU_INT_STATUS_BIT_GET(x) (((x) & CPU_INT_STATUS_BIT_MASK) >> CPU_INT_STATUS_BIT_LSB) -#define CPU_INT_STATUS_BIT_SET(x) (((x) << CPU_INT_STATUS_BIT_LSB) & CPU_INT_STATUS_BIT_MASK) - -#define ERROR_INT_STATUS_ADDRESS 0x00000402 -#define ERROR_INT_STATUS_OFFSET 0x00000402 -#define ERROR_INT_STATUS_SPI_MSB 3 -#define ERROR_INT_STATUS_SPI_LSB 3 -#define ERROR_INT_STATUS_SPI_MASK 0x00000008 -#define ERROR_INT_STATUS_SPI_GET(x) (((x) & ERROR_INT_STATUS_SPI_MASK) >> ERROR_INT_STATUS_SPI_LSB) -#define ERROR_INT_STATUS_SPI_SET(x) (((x) << ERROR_INT_STATUS_SPI_LSB) & ERROR_INT_STATUS_SPI_MASK) -#define ERROR_INT_STATUS_WAKEUP_MSB 2 -#define ERROR_INT_STATUS_WAKEUP_LSB 2 -#define ERROR_INT_STATUS_WAKEUP_MASK 0x00000004 -#define ERROR_INT_STATUS_WAKEUP_GET(x) (((x) & ERROR_INT_STATUS_WAKEUP_MASK) >> ERROR_INT_STATUS_WAKEUP_LSB) -#define ERROR_INT_STATUS_WAKEUP_SET(x) (((x) << ERROR_INT_STATUS_WAKEUP_LSB) & ERROR_INT_STATUS_WAKEUP_MASK) -#define ERROR_INT_STATUS_RX_UNDERFLOW_MSB 1 -#define ERROR_INT_STATUS_RX_UNDERFLOW_LSB 1 -#define ERROR_INT_STATUS_RX_UNDERFLOW_MASK 0x00000002 -#define ERROR_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) >> ERROR_INT_STATUS_RX_UNDERFLOW_LSB) -#define ERROR_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << ERROR_INT_STATUS_RX_UNDERFLOW_LSB) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) -#define ERROR_INT_STATUS_TX_OVERFLOW_MSB 0 -#define ERROR_INT_STATUS_TX_OVERFLOW_LSB 0 -#define ERROR_INT_STATUS_TX_OVERFLOW_MASK 0x00000001 -#define ERROR_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) >> ERROR_INT_STATUS_TX_OVERFLOW_LSB) -#define ERROR_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << ERROR_INT_STATUS_TX_OVERFLOW_LSB) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) - -#define COUNTER_INT_STATUS_ADDRESS 0x00000403 -#define COUNTER_INT_STATUS_OFFSET 0x00000403 -#define COUNTER_INT_STATUS_COUNTER_MSB 7 -#define COUNTER_INT_STATUS_COUNTER_LSB 0 -#define COUNTER_INT_STATUS_COUNTER_MASK 0x000000ff -#define COUNTER_INT_STATUS_COUNTER_GET(x) (((x) & COUNTER_INT_STATUS_COUNTER_MASK) >> COUNTER_INT_STATUS_COUNTER_LSB) -#define COUNTER_INT_STATUS_COUNTER_SET(x) (((x) << COUNTER_INT_STATUS_COUNTER_LSB) & COUNTER_INT_STATUS_COUNTER_MASK) - -#define MBOX_FRAME_ADDRESS 0x00000404 -#define MBOX_FRAME_OFFSET 0x00000404 -#define MBOX_FRAME_RX_EOM_MSB 7 -#define MBOX_FRAME_RX_EOM_LSB 4 -#define MBOX_FRAME_RX_EOM_MASK 0x000000f0 -#define MBOX_FRAME_RX_EOM_GET(x) (((x) & MBOX_FRAME_RX_EOM_MASK) >> MBOX_FRAME_RX_EOM_LSB) -#define MBOX_FRAME_RX_EOM_SET(x) (((x) << MBOX_FRAME_RX_EOM_LSB) & MBOX_FRAME_RX_EOM_MASK) -#define MBOX_FRAME_RX_SOM_MSB 3 -#define MBOX_FRAME_RX_SOM_LSB 0 -#define MBOX_FRAME_RX_SOM_MASK 0x0000000f -#define MBOX_FRAME_RX_SOM_GET(x) (((x) & MBOX_FRAME_RX_SOM_MASK) >> MBOX_FRAME_RX_SOM_LSB) -#define MBOX_FRAME_RX_SOM_SET(x) (((x) << MBOX_FRAME_RX_SOM_LSB) & MBOX_FRAME_RX_SOM_MASK) - -#define RX_LOOKAHEAD_VALID_ADDRESS 0x00000405 -#define RX_LOOKAHEAD_VALID_OFFSET 0x00000405 -#define RX_LOOKAHEAD_VALID_MBOX_MSB 3 -#define RX_LOOKAHEAD_VALID_MBOX_LSB 0 -#define RX_LOOKAHEAD_VALID_MBOX_MASK 0x0000000f -#define RX_LOOKAHEAD_VALID_MBOX_GET(x) (((x) & RX_LOOKAHEAD_VALID_MBOX_MASK) >> RX_LOOKAHEAD_VALID_MBOX_LSB) -#define RX_LOOKAHEAD_VALID_MBOX_SET(x) (((x) << RX_LOOKAHEAD_VALID_MBOX_LSB) & RX_LOOKAHEAD_VALID_MBOX_MASK) - -#define RX_LOOKAHEAD0_ADDRESS 0x00000408 -#define RX_LOOKAHEAD0_OFFSET 0x00000408 -#define RX_LOOKAHEAD0_DATA_MSB 7 -#define RX_LOOKAHEAD0_DATA_LSB 0 -#define RX_LOOKAHEAD0_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD0_DATA_GET(x) (((x) & RX_LOOKAHEAD0_DATA_MASK) >> RX_LOOKAHEAD0_DATA_LSB) -#define RX_LOOKAHEAD0_DATA_SET(x) (((x) << RX_LOOKAHEAD0_DATA_LSB) & RX_LOOKAHEAD0_DATA_MASK) - -#define RX_LOOKAHEAD1_ADDRESS 0x0000040c -#define RX_LOOKAHEAD1_OFFSET 0x0000040c -#define RX_LOOKAHEAD1_DATA_MSB 7 -#define RX_LOOKAHEAD1_DATA_LSB 0 -#define RX_LOOKAHEAD1_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD1_DATA_GET(x) (((x) & RX_LOOKAHEAD1_DATA_MASK) >> RX_LOOKAHEAD1_DATA_LSB) -#define RX_LOOKAHEAD1_DATA_SET(x) (((x) << RX_LOOKAHEAD1_DATA_LSB) & RX_LOOKAHEAD1_DATA_MASK) - -#define RX_LOOKAHEAD2_ADDRESS 0x00000410 -#define RX_LOOKAHEAD2_OFFSET 0x00000410 -#define RX_LOOKAHEAD2_DATA_MSB 7 -#define RX_LOOKAHEAD2_DATA_LSB 0 -#define RX_LOOKAHEAD2_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD2_DATA_GET(x) (((x) & RX_LOOKAHEAD2_DATA_MASK) >> RX_LOOKAHEAD2_DATA_LSB) -#define RX_LOOKAHEAD2_DATA_SET(x) (((x) << RX_LOOKAHEAD2_DATA_LSB) & RX_LOOKAHEAD2_DATA_MASK) - -#define RX_LOOKAHEAD3_ADDRESS 0x00000414 -#define RX_LOOKAHEAD3_OFFSET 0x00000414 -#define RX_LOOKAHEAD3_DATA_MSB 7 -#define RX_LOOKAHEAD3_DATA_LSB 0 -#define RX_LOOKAHEAD3_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD3_DATA_GET(x) (((x) & RX_LOOKAHEAD3_DATA_MASK) >> RX_LOOKAHEAD3_DATA_LSB) -#define RX_LOOKAHEAD3_DATA_SET(x) (((x) << RX_LOOKAHEAD3_DATA_LSB) & RX_LOOKAHEAD3_DATA_MASK) - -#define INT_STATUS_ENABLE_ADDRESS 0x00000418 -#define INT_STATUS_ENABLE_OFFSET 0x00000418 -#define INT_STATUS_ENABLE_ERROR_MSB 7 -#define INT_STATUS_ENABLE_ERROR_LSB 7 -#define INT_STATUS_ENABLE_ERROR_MASK 0x00000080 -#define INT_STATUS_ENABLE_ERROR_GET(x) (((x) & INT_STATUS_ENABLE_ERROR_MASK) >> INT_STATUS_ENABLE_ERROR_LSB) -#define INT_STATUS_ENABLE_ERROR_SET(x) (((x) << INT_STATUS_ENABLE_ERROR_LSB) & INT_STATUS_ENABLE_ERROR_MASK) -#define INT_STATUS_ENABLE_CPU_MSB 6 -#define INT_STATUS_ENABLE_CPU_LSB 6 -#define INT_STATUS_ENABLE_CPU_MASK 0x00000040 -#define INT_STATUS_ENABLE_CPU_GET(x) (((x) & INT_STATUS_ENABLE_CPU_MASK) >> INT_STATUS_ENABLE_CPU_LSB) -#define INT_STATUS_ENABLE_CPU_SET(x) (((x) << INT_STATUS_ENABLE_CPU_LSB) & INT_STATUS_ENABLE_CPU_MASK) -#define INT_STATUS_ENABLE_DRAGON_INT_MSB 5 -#define INT_STATUS_ENABLE_DRAGON_INT_LSB 5 -#define INT_STATUS_ENABLE_DRAGON_INT_MASK 0x00000020 -#define INT_STATUS_ENABLE_DRAGON_INT_GET(x) (((x) & INT_STATUS_ENABLE_DRAGON_INT_MASK) >> INT_STATUS_ENABLE_DRAGON_INT_LSB) -#define INT_STATUS_ENABLE_DRAGON_INT_SET(x) (((x) << INT_STATUS_ENABLE_DRAGON_INT_LSB) & INT_STATUS_ENABLE_DRAGON_INT_MASK) -#define INT_STATUS_ENABLE_COUNTER_MSB 4 -#define INT_STATUS_ENABLE_COUNTER_LSB 4 -#define INT_STATUS_ENABLE_COUNTER_MASK 0x00000010 -#define INT_STATUS_ENABLE_COUNTER_GET(x) (((x) & INT_STATUS_ENABLE_COUNTER_MASK) >> INT_STATUS_ENABLE_COUNTER_LSB) -#define INT_STATUS_ENABLE_COUNTER_SET(x) (((x) << INT_STATUS_ENABLE_COUNTER_LSB) & INT_STATUS_ENABLE_COUNTER_MASK) -#define INT_STATUS_ENABLE_MBOX_DATA_MSB 3 -#define INT_STATUS_ENABLE_MBOX_DATA_LSB 0 -#define INT_STATUS_ENABLE_MBOX_DATA_MASK 0x0000000f -#define INT_STATUS_ENABLE_MBOX_DATA_GET(x) (((x) & INT_STATUS_ENABLE_MBOX_DATA_MASK) >> INT_STATUS_ENABLE_MBOX_DATA_LSB) -#define INT_STATUS_ENABLE_MBOX_DATA_SET(x) (((x) << INT_STATUS_ENABLE_MBOX_DATA_LSB) & INT_STATUS_ENABLE_MBOX_DATA_MASK) - -#define CPU_INT_STATUS_ENABLE_ADDRESS 0x00000419 -#define CPU_INT_STATUS_ENABLE_OFFSET 0x00000419 -#define CPU_INT_STATUS_ENABLE_BIT_MSB 7 -#define CPU_INT_STATUS_ENABLE_BIT_LSB 0 -#define CPU_INT_STATUS_ENABLE_BIT_MASK 0x000000ff -#define CPU_INT_STATUS_ENABLE_BIT_GET(x) (((x) & CPU_INT_STATUS_ENABLE_BIT_MASK) >> CPU_INT_STATUS_ENABLE_BIT_LSB) -#define CPU_INT_STATUS_ENABLE_BIT_SET(x) (((x) << CPU_INT_STATUS_ENABLE_BIT_LSB) & CPU_INT_STATUS_ENABLE_BIT_MASK) - -#define ERROR_STATUS_ENABLE_ADDRESS 0x0000041a -#define ERROR_STATUS_ENABLE_OFFSET 0x0000041a -#define ERROR_STATUS_ENABLE_WAKEUP_MSB 2 -#define ERROR_STATUS_ENABLE_WAKEUP_LSB 2 -#define ERROR_STATUS_ENABLE_WAKEUP_MASK 0x00000004 -#define ERROR_STATUS_ENABLE_WAKEUP_GET(x) (((x) & ERROR_STATUS_ENABLE_WAKEUP_MASK) >> ERROR_STATUS_ENABLE_WAKEUP_LSB) -#define ERROR_STATUS_ENABLE_WAKEUP_SET(x) (((x) << ERROR_STATUS_ENABLE_WAKEUP_LSB) & ERROR_STATUS_ENABLE_WAKEUP_MASK) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MSB 1 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB 1 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK 0x00000002 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) >> ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MSB 0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB 0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK 0x00000001 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) >> ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) - -#define COUNTER_INT_STATUS_ENABLE_ADDRESS 0x0000041b -#define COUNTER_INT_STATUS_ENABLE_OFFSET 0x0000041b -#define COUNTER_INT_STATUS_ENABLE_BIT_MSB 7 -#define COUNTER_INT_STATUS_ENABLE_BIT_LSB 0 -#define COUNTER_INT_STATUS_ENABLE_BIT_MASK 0x000000ff -#define COUNTER_INT_STATUS_ENABLE_BIT_GET(x) (((x) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) >> COUNTER_INT_STATUS_ENABLE_BIT_LSB) -#define COUNTER_INT_STATUS_ENABLE_BIT_SET(x) (((x) << COUNTER_INT_STATUS_ENABLE_BIT_LSB) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) - -#define COUNT_ADDRESS 0x00000420 -#define COUNT_OFFSET 0x00000420 -#define COUNT_VALUE_MSB 7 -#define COUNT_VALUE_LSB 0 -#define COUNT_VALUE_MASK 0x000000ff -#define COUNT_VALUE_GET(x) (((x) & COUNT_VALUE_MASK) >> COUNT_VALUE_LSB) -#define COUNT_VALUE_SET(x) (((x) << COUNT_VALUE_LSB) & COUNT_VALUE_MASK) - -#define COUNT_DEC_ADDRESS 0x00000440 -#define COUNT_DEC_OFFSET 0x00000440 -#define COUNT_DEC_VALUE_MSB 7 -#define COUNT_DEC_VALUE_LSB 0 -#define COUNT_DEC_VALUE_MASK 0x000000ff -#define COUNT_DEC_VALUE_GET(x) (((x) & COUNT_DEC_VALUE_MASK) >> COUNT_DEC_VALUE_LSB) -#define COUNT_DEC_VALUE_SET(x) (((x) << COUNT_DEC_VALUE_LSB) & COUNT_DEC_VALUE_MASK) - -#define SCRATCH_ADDRESS 0x00000460 -#define SCRATCH_OFFSET 0x00000460 -#define SCRATCH_VALUE_MSB 7 -#define SCRATCH_VALUE_LSB 0 -#define SCRATCH_VALUE_MASK 0x000000ff -#define SCRATCH_VALUE_GET(x) (((x) & SCRATCH_VALUE_MASK) >> SCRATCH_VALUE_LSB) -#define SCRATCH_VALUE_SET(x) (((x) << SCRATCH_VALUE_LSB) & SCRATCH_VALUE_MASK) - -#define FIFO_TIMEOUT_ADDRESS 0x00000468 -#define FIFO_TIMEOUT_OFFSET 0x00000468 -#define FIFO_TIMEOUT_VALUE_MSB 7 -#define FIFO_TIMEOUT_VALUE_LSB 0 -#define FIFO_TIMEOUT_VALUE_MASK 0x000000ff -#define FIFO_TIMEOUT_VALUE_GET(x) (((x) & FIFO_TIMEOUT_VALUE_MASK) >> FIFO_TIMEOUT_VALUE_LSB) -#define FIFO_TIMEOUT_VALUE_SET(x) (((x) << FIFO_TIMEOUT_VALUE_LSB) & FIFO_TIMEOUT_VALUE_MASK) - -#define FIFO_TIMEOUT_ENABLE_ADDRESS 0x00000469 -#define FIFO_TIMEOUT_ENABLE_OFFSET 0x00000469 -#define FIFO_TIMEOUT_ENABLE_SET_MSB 0 -#define FIFO_TIMEOUT_ENABLE_SET_LSB 0 -#define FIFO_TIMEOUT_ENABLE_SET_MASK 0x00000001 -#define FIFO_TIMEOUT_ENABLE_SET_GET(x) (((x) & FIFO_TIMEOUT_ENABLE_SET_MASK) >> FIFO_TIMEOUT_ENABLE_SET_LSB) -#define FIFO_TIMEOUT_ENABLE_SET_SET(x) (((x) << FIFO_TIMEOUT_ENABLE_SET_LSB) & FIFO_TIMEOUT_ENABLE_SET_MASK) - -#define DISABLE_SLEEP_ADDRESS 0x0000046a -#define DISABLE_SLEEP_OFFSET 0x0000046a -#define DISABLE_SLEEP_FOR_INT_MSB 1 -#define DISABLE_SLEEP_FOR_INT_LSB 1 -#define DISABLE_SLEEP_FOR_INT_MASK 0x00000002 -#define DISABLE_SLEEP_FOR_INT_GET(x) (((x) & DISABLE_SLEEP_FOR_INT_MASK) >> DISABLE_SLEEP_FOR_INT_LSB) -#define DISABLE_SLEEP_FOR_INT_SET(x) (((x) << DISABLE_SLEEP_FOR_INT_LSB) & DISABLE_SLEEP_FOR_INT_MASK) -#define DISABLE_SLEEP_ON_MSB 0 -#define DISABLE_SLEEP_ON_LSB 0 -#define DISABLE_SLEEP_ON_MASK 0x00000001 -#define DISABLE_SLEEP_ON_GET(x) (((x) & DISABLE_SLEEP_ON_MASK) >> DISABLE_SLEEP_ON_LSB) -#define DISABLE_SLEEP_ON_SET(x) (((x) << DISABLE_SLEEP_ON_LSB) & DISABLE_SLEEP_ON_MASK) - -#define LOCAL_BUS_ADDRESS 0x00000470 -#define LOCAL_BUS_OFFSET 0x00000470 -#define LOCAL_BUS_STATE_MSB 1 -#define LOCAL_BUS_STATE_LSB 0 -#define LOCAL_BUS_STATE_MASK 0x00000003 -#define LOCAL_BUS_STATE_GET(x) (((x) & LOCAL_BUS_STATE_MASK) >> LOCAL_BUS_STATE_LSB) -#define LOCAL_BUS_STATE_SET(x) (((x) << LOCAL_BUS_STATE_LSB) & LOCAL_BUS_STATE_MASK) - -#define INT_WLAN_ADDRESS 0x00000472 -#define INT_WLAN_OFFSET 0x00000472 -#define INT_WLAN_VECTOR_MSB 7 -#define INT_WLAN_VECTOR_LSB 0 -#define INT_WLAN_VECTOR_MASK 0x000000ff -#define INT_WLAN_VECTOR_GET(x) (((x) & INT_WLAN_VECTOR_MASK) >> INT_WLAN_VECTOR_LSB) -#define INT_WLAN_VECTOR_SET(x) (((x) << INT_WLAN_VECTOR_LSB) & INT_WLAN_VECTOR_MASK) - -#define WINDOW_DATA_ADDRESS 0x00000474 -#define WINDOW_DATA_OFFSET 0x00000474 -#define WINDOW_DATA_DATA_MSB 7 -#define WINDOW_DATA_DATA_LSB 0 -#define WINDOW_DATA_DATA_MASK 0x000000ff -#define WINDOW_DATA_DATA_GET(x) (((x) & WINDOW_DATA_DATA_MASK) >> WINDOW_DATA_DATA_LSB) -#define WINDOW_DATA_DATA_SET(x) (((x) << WINDOW_DATA_DATA_LSB) & WINDOW_DATA_DATA_MASK) - -#define WINDOW_WRITE_ADDR_ADDRESS 0x00000478 -#define WINDOW_WRITE_ADDR_OFFSET 0x00000478 -#define WINDOW_WRITE_ADDR_ADDR_MSB 7 -#define WINDOW_WRITE_ADDR_ADDR_LSB 0 -#define WINDOW_WRITE_ADDR_ADDR_MASK 0x000000ff -#define WINDOW_WRITE_ADDR_ADDR_GET(x) (((x) & WINDOW_WRITE_ADDR_ADDR_MASK) >> WINDOW_WRITE_ADDR_ADDR_LSB) -#define WINDOW_WRITE_ADDR_ADDR_SET(x) (((x) << WINDOW_WRITE_ADDR_ADDR_LSB) & WINDOW_WRITE_ADDR_ADDR_MASK) - -#define WINDOW_READ_ADDR_ADDRESS 0x0000047c -#define WINDOW_READ_ADDR_OFFSET 0x0000047c -#define WINDOW_READ_ADDR_ADDR_MSB 7 -#define WINDOW_READ_ADDR_ADDR_LSB 0 -#define WINDOW_READ_ADDR_ADDR_MASK 0x000000ff -#define WINDOW_READ_ADDR_ADDR_GET(x) (((x) & WINDOW_READ_ADDR_ADDR_MASK) >> WINDOW_READ_ADDR_ADDR_LSB) -#define WINDOW_READ_ADDR_ADDR_SET(x) (((x) << WINDOW_READ_ADDR_ADDR_LSB) & WINDOW_READ_ADDR_ADDR_MASK) - -#define SPI_CONFIG_ADDRESS 0x00000480 -#define SPI_CONFIG_OFFSET 0x00000480 -#define SPI_CONFIG_SPI_RESET_MSB 4 -#define SPI_CONFIG_SPI_RESET_LSB 4 -#define SPI_CONFIG_SPI_RESET_MASK 0x00000010 -#define SPI_CONFIG_SPI_RESET_GET(x) (((x) & SPI_CONFIG_SPI_RESET_MASK) >> SPI_CONFIG_SPI_RESET_LSB) -#define SPI_CONFIG_SPI_RESET_SET(x) (((x) << SPI_CONFIG_SPI_RESET_LSB) & SPI_CONFIG_SPI_RESET_MASK) -#define SPI_CONFIG_INTERRUPT_ENABLE_MSB 3 -#define SPI_CONFIG_INTERRUPT_ENABLE_LSB 3 -#define SPI_CONFIG_INTERRUPT_ENABLE_MASK 0x00000008 -#define SPI_CONFIG_INTERRUPT_ENABLE_GET(x) (((x) & SPI_CONFIG_INTERRUPT_ENABLE_MASK) >> SPI_CONFIG_INTERRUPT_ENABLE_LSB) -#define SPI_CONFIG_INTERRUPT_ENABLE_SET(x) (((x) << SPI_CONFIG_INTERRUPT_ENABLE_LSB) & SPI_CONFIG_INTERRUPT_ENABLE_MASK) -#define SPI_CONFIG_TEST_MODE_MSB 2 -#define SPI_CONFIG_TEST_MODE_LSB 2 -#define SPI_CONFIG_TEST_MODE_MASK 0x00000004 -#define SPI_CONFIG_TEST_MODE_GET(x) (((x) & SPI_CONFIG_TEST_MODE_MASK) >> SPI_CONFIG_TEST_MODE_LSB) -#define SPI_CONFIG_TEST_MODE_SET(x) (((x) << SPI_CONFIG_TEST_MODE_LSB) & SPI_CONFIG_TEST_MODE_MASK) -#define SPI_CONFIG_DATA_SIZE_MSB 1 -#define SPI_CONFIG_DATA_SIZE_LSB 0 -#define SPI_CONFIG_DATA_SIZE_MASK 0x00000003 -#define SPI_CONFIG_DATA_SIZE_GET(x) (((x) & SPI_CONFIG_DATA_SIZE_MASK) >> SPI_CONFIG_DATA_SIZE_LSB) -#define SPI_CONFIG_DATA_SIZE_SET(x) (((x) << SPI_CONFIG_DATA_SIZE_LSB) & SPI_CONFIG_DATA_SIZE_MASK) - -#define SPI_STATUS_ADDRESS 0x00000481 -#define SPI_STATUS_OFFSET 0x00000481 -#define SPI_STATUS_ADDR_ERR_MSB 3 -#define SPI_STATUS_ADDR_ERR_LSB 3 -#define SPI_STATUS_ADDR_ERR_MASK 0x00000008 -#define SPI_STATUS_ADDR_ERR_GET(x) (((x) & SPI_STATUS_ADDR_ERR_MASK) >> SPI_STATUS_ADDR_ERR_LSB) -#define SPI_STATUS_ADDR_ERR_SET(x) (((x) << SPI_STATUS_ADDR_ERR_LSB) & SPI_STATUS_ADDR_ERR_MASK) -#define SPI_STATUS_RD_ERR_MSB 2 -#define SPI_STATUS_RD_ERR_LSB 2 -#define SPI_STATUS_RD_ERR_MASK 0x00000004 -#define SPI_STATUS_RD_ERR_GET(x) (((x) & SPI_STATUS_RD_ERR_MASK) >> SPI_STATUS_RD_ERR_LSB) -#define SPI_STATUS_RD_ERR_SET(x) (((x) << SPI_STATUS_RD_ERR_LSB) & SPI_STATUS_RD_ERR_MASK) -#define SPI_STATUS_WR_ERR_MSB 1 -#define SPI_STATUS_WR_ERR_LSB 1 -#define SPI_STATUS_WR_ERR_MASK 0x00000002 -#define SPI_STATUS_WR_ERR_GET(x) (((x) & SPI_STATUS_WR_ERR_MASK) >> SPI_STATUS_WR_ERR_LSB) -#define SPI_STATUS_WR_ERR_SET(x) (((x) << SPI_STATUS_WR_ERR_LSB) & SPI_STATUS_WR_ERR_MASK) -#define SPI_STATUS_READY_MSB 0 -#define SPI_STATUS_READY_LSB 0 -#define SPI_STATUS_READY_MASK 0x00000001 -#define SPI_STATUS_READY_GET(x) (((x) & SPI_STATUS_READY_MASK) >> SPI_STATUS_READY_LSB) -#define SPI_STATUS_READY_SET(x) (((x) << SPI_STATUS_READY_LSB) & SPI_STATUS_READY_MASK) - -#define NON_ASSOC_SLEEP_EN_ADDRESS 0x00000482 -#define NON_ASSOC_SLEEP_EN_OFFSET 0x00000482 -#define NON_ASSOC_SLEEP_EN_BIT_MSB 0 -#define NON_ASSOC_SLEEP_EN_BIT_LSB 0 -#define NON_ASSOC_SLEEP_EN_BIT_MASK 0x00000001 -#define NON_ASSOC_SLEEP_EN_BIT_GET(x) (((x) & NON_ASSOC_SLEEP_EN_BIT_MASK) >> NON_ASSOC_SLEEP_EN_BIT_LSB) -#define NON_ASSOC_SLEEP_EN_BIT_SET(x) (((x) << NON_ASSOC_SLEEP_EN_BIT_LSB) & NON_ASSOC_SLEEP_EN_BIT_MASK) - -#define CIS_WINDOW_ADDRESS 0x00000600 -#define CIS_WINDOW_OFFSET 0x00000600 -#define CIS_WINDOW_DATA_MSB 7 -#define CIS_WINDOW_DATA_LSB 0 -#define CIS_WINDOW_DATA_MASK 0x000000ff -#define CIS_WINDOW_DATA_GET(x) (((x) & CIS_WINDOW_DATA_MASK) >> CIS_WINDOW_DATA_LSB) -#define CIS_WINDOW_DATA_SET(x) (((x) << CIS_WINDOW_DATA_LSB) & CIS_WINDOW_DATA_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct mbox_host_reg_reg_s { - unsigned char pad0[1024]; /* pad to 0x400 */ - volatile unsigned char host_int_status; - volatile unsigned char cpu_int_status; - volatile unsigned char error_int_status; - volatile unsigned char counter_int_status; - volatile unsigned char mbox_frame; - volatile unsigned char rx_lookahead_valid; - unsigned char pad1[2]; /* pad to 0x408 */ - volatile unsigned char rx_lookahead0[4]; - volatile unsigned char rx_lookahead1[4]; - volatile unsigned char rx_lookahead2[4]; - volatile unsigned char rx_lookahead3[4]; - volatile unsigned char int_status_enable; - volatile unsigned char cpu_int_status_enable; - volatile unsigned char error_status_enable; - volatile unsigned char counter_int_status_enable; - unsigned char pad2[4]; /* pad to 0x420 */ - volatile unsigned char count[8]; - unsigned char pad3[24]; /* pad to 0x440 */ - volatile unsigned char count_dec[32]; - volatile unsigned char scratch[8]; - volatile unsigned char fifo_timeout; - volatile unsigned char fifo_timeout_enable; - volatile unsigned char disable_sleep; - unsigned char pad4[5]; /* pad to 0x470 */ - volatile unsigned char local_bus; - unsigned char pad5[1]; /* pad to 0x472 */ - volatile unsigned char int_wlan; - unsigned char pad6[1]; /* pad to 0x474 */ - volatile unsigned char window_data[4]; - volatile unsigned char window_write_addr[4]; - volatile unsigned char window_read_addr[4]; - volatile unsigned char spi_config; - volatile unsigned char spi_status; - volatile unsigned char non_assoc_sleep_en; - unsigned char pad7[381]; /* pad to 0x600 */ - volatile unsigned char cis_window[512]; -} mbox_host_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _MBOX_HOST_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/mbox_host_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/mbox_host_reg.vrh deleted file mode 100644 index 3cf45eaa0cee..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/mbox_host_reg.vrh +++ /dev/null @@ -1,563 +0,0 @@ -#ifndef _MBOX_HOST_REG_VRH_ -#define _MBOX_HOST_REG_VRH_ - -#define HOST_INT_STATUS_ADDRESS 'h00000400 -#define HOST_INT_STATUS_ERROR_MSB 7 -#define HOST_INT_STATUS_ERROR_LSB 7 -#define HOST_INT_STATUS_ERROR_MASK 'h00000080 -#define HOST_INT_STATUS_ERROR_GET(x) (((x) & HOST_INT_STATUS_ERROR_MASK) >> HOST_INT_STATUS_ERROR_LSB) -#define HOST_INT_STATUS_ERROR_SET(x) (((8'd0 | (x)) << HOST_INT_STATUS_ERROR_LSB) & HOST_INT_STATUS_ERROR_MASK) -#define HOST_INT_STATUS_ERROR_RESET 1'h0 -#define HOST_INT_STATUS_CPU_MSB 6 -#define HOST_INT_STATUS_CPU_LSB 6 -#define HOST_INT_STATUS_CPU_MASK 'h00000040 -#define HOST_INT_STATUS_CPU_GET(x) (((x) & HOST_INT_STATUS_CPU_MASK) >> HOST_INT_STATUS_CPU_LSB) -#define HOST_INT_STATUS_CPU_SET(x) (((8'd0 | (x)) << HOST_INT_STATUS_CPU_LSB) & HOST_INT_STATUS_CPU_MASK) -#define HOST_INT_STATUS_CPU_RESET 1'h0 -#define HOST_INT_STATUS_DRAGON_INT_MSB 5 -#define HOST_INT_STATUS_DRAGON_INT_LSB 5 -#define HOST_INT_STATUS_DRAGON_INT_MASK 'h00000020 -#define HOST_INT_STATUS_DRAGON_INT_GET(x) (((x) & HOST_INT_STATUS_DRAGON_INT_MASK) >> HOST_INT_STATUS_DRAGON_INT_LSB) -#define HOST_INT_STATUS_DRAGON_INT_SET(x) (((8'd0 | (x)) << HOST_INT_STATUS_DRAGON_INT_LSB) & HOST_INT_STATUS_DRAGON_INT_MASK) -#define HOST_INT_STATUS_DRAGON_INT_RESET 1'h0 -#define HOST_INT_STATUS_COUNTER_MSB 4 -#define HOST_INT_STATUS_COUNTER_LSB 4 -#define HOST_INT_STATUS_COUNTER_MASK 'h00000010 -#define HOST_INT_STATUS_COUNTER_GET(x) (((x) & HOST_INT_STATUS_COUNTER_MASK) >> HOST_INT_STATUS_COUNTER_LSB) -#define HOST_INT_STATUS_COUNTER_SET(x) (((8'd0 | (x)) << HOST_INT_STATUS_COUNTER_LSB) & HOST_INT_STATUS_COUNTER_MASK) -#define HOST_INT_STATUS_COUNTER_RESET 1'h0 -#define HOST_INT_STATUS_MBOX_DATA_MSB 3 -#define HOST_INT_STATUS_MBOX_DATA_LSB 0 -#define HOST_INT_STATUS_MBOX_DATA_MASK 'h0000000f -#define HOST_INT_STATUS_MBOX_DATA_GET(x) (((x) & HOST_INT_STATUS_MBOX_DATA_MASK) >> HOST_INT_STATUS_MBOX_DATA_LSB) -#define HOST_INT_STATUS_MBOX_DATA_SET(x) (((8'd0 | (x)) << HOST_INT_STATUS_MBOX_DATA_LSB) & HOST_INT_STATUS_MBOX_DATA_MASK) -#define HOST_INT_STATUS_MBOX_DATA_RESET 4'h0 -#define HOST_INT_STATUS_RESET (8'h0 | \ - HOST_INT_STATUS_ERROR_SET(HOST_INT_STATUS_ERROR_RESET) | \ - HOST_INT_STATUS_CPU_SET(HOST_INT_STATUS_CPU_RESET) | \ - HOST_INT_STATUS_DRAGON_INT_SET(HOST_INT_STATUS_DRAGON_INT_RESET) | \ - HOST_INT_STATUS_COUNTER_SET(HOST_INT_STATUS_COUNTER_RESET) | \ - HOST_INT_STATUS_MBOX_DATA_SET(HOST_INT_STATUS_MBOX_DATA_RESET)) -#define HOST_INT_STATUS_HW_MASK (8'h0 | \ - HOST_INT_STATUS_ERROR_MASK | \ - HOST_INT_STATUS_CPU_MASK | \ - HOST_INT_STATUS_DRAGON_INT_MASK | \ - HOST_INT_STATUS_COUNTER_MASK | \ - HOST_INT_STATUS_MBOX_DATA_MASK) -#define HOST_INT_STATUS_SW_MASK (8'h0) - -#define CPU_INT_STATUS_ADDRESS 'h00000401 -#define CPU_INT_STATUS_BIT_MSB 7 -#define CPU_INT_STATUS_BIT_LSB 0 -#define CPU_INT_STATUS_BIT_MASK 'h000000ff -#define CPU_INT_STATUS_BIT_GET(x) (((x) & CPU_INT_STATUS_BIT_MASK) >> CPU_INT_STATUS_BIT_LSB) -#define CPU_INT_STATUS_BIT_SET(x) (((8'd0 | (x)) << CPU_INT_STATUS_BIT_LSB) & CPU_INT_STATUS_BIT_MASK) -#define CPU_INT_STATUS_BIT_RESET 8'h0 -#define CPU_INT_STATUS_RESET (8'h0 | \ - CPU_INT_STATUS_BIT_SET(CPU_INT_STATUS_BIT_RESET)) -#define CPU_INT_STATUS_HW_MASK (8'h0 | \ - CPU_INT_STATUS_BIT_MASK) -#define CPU_INT_STATUS_SW_MASK (8'h0 | \ - CPU_INT_STATUS_BIT_MASK) - -#define ERROR_INT_STATUS_ADDRESS 'h00000402 -#define ERROR_INT_STATUS_SPI_MSB 3 -#define ERROR_INT_STATUS_SPI_LSB 3 -#define ERROR_INT_STATUS_SPI_MASK 'h00000008 -#define ERROR_INT_STATUS_SPI_GET(x) (((x) & ERROR_INT_STATUS_SPI_MASK) >> ERROR_INT_STATUS_SPI_LSB) -#define ERROR_INT_STATUS_SPI_SET(x) (((8'd0 | (x)) << ERROR_INT_STATUS_SPI_LSB) & ERROR_INT_STATUS_SPI_MASK) -#define ERROR_INT_STATUS_SPI_RESET 1'h0 -#define ERROR_INT_STATUS_WAKEUP_MSB 2 -#define ERROR_INT_STATUS_WAKEUP_LSB 2 -#define ERROR_INT_STATUS_WAKEUP_MASK 'h00000004 -#define ERROR_INT_STATUS_WAKEUP_GET(x) (((x) & ERROR_INT_STATUS_WAKEUP_MASK) >> ERROR_INT_STATUS_WAKEUP_LSB) -#define ERROR_INT_STATUS_WAKEUP_SET(x) (((8'd0 | (x)) << ERROR_INT_STATUS_WAKEUP_LSB) & ERROR_INT_STATUS_WAKEUP_MASK) -#define ERROR_INT_STATUS_WAKEUP_RESET 1'h0 -#define ERROR_INT_STATUS_RX_UNDERFLOW_MSB 1 -#define ERROR_INT_STATUS_RX_UNDERFLOW_LSB 1 -#define ERROR_INT_STATUS_RX_UNDERFLOW_MASK 'h00000002 -#define ERROR_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) >> ERROR_INT_STATUS_RX_UNDERFLOW_LSB) -#define ERROR_INT_STATUS_RX_UNDERFLOW_SET(x) (((8'd0 | (x)) << ERROR_INT_STATUS_RX_UNDERFLOW_LSB) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) -#define ERROR_INT_STATUS_RX_UNDERFLOW_RESET 1'h0 -#define ERROR_INT_STATUS_TX_OVERFLOW_MSB 0 -#define ERROR_INT_STATUS_TX_OVERFLOW_LSB 0 -#define ERROR_INT_STATUS_TX_OVERFLOW_MASK 'h00000001 -#define ERROR_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) >> ERROR_INT_STATUS_TX_OVERFLOW_LSB) -#define ERROR_INT_STATUS_TX_OVERFLOW_SET(x) (((8'd0 | (x)) << ERROR_INT_STATUS_TX_OVERFLOW_LSB) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) -#define ERROR_INT_STATUS_TX_OVERFLOW_RESET 1'h0 -#define ERROR_INT_STATUS_RESET (8'h0 | \ - ERROR_INT_STATUS_SPI_SET(ERROR_INT_STATUS_SPI_RESET) | \ - ERROR_INT_STATUS_WAKEUP_SET(ERROR_INT_STATUS_WAKEUP_RESET) | \ - ERROR_INT_STATUS_RX_UNDERFLOW_SET(ERROR_INT_STATUS_RX_UNDERFLOW_RESET) | \ - ERROR_INT_STATUS_TX_OVERFLOW_SET(ERROR_INT_STATUS_TX_OVERFLOW_RESET)) -#define ERROR_INT_STATUS_HW_MASK (8'h0 | \ - ERROR_INT_STATUS_SPI_MASK | \ - ERROR_INT_STATUS_WAKEUP_MASK | \ - ERROR_INT_STATUS_RX_UNDERFLOW_MASK | \ - ERROR_INT_STATUS_TX_OVERFLOW_MASK) -#define ERROR_INT_STATUS_SW_MASK (8'h0 | \ - ERROR_INT_STATUS_WAKEUP_MASK | \ - ERROR_INT_STATUS_RX_UNDERFLOW_MASK | \ - ERROR_INT_STATUS_TX_OVERFLOW_MASK) - -#define COUNTER_INT_STATUS_ADDRESS 'h00000403 -#define COUNTER_INT_STATUS_COUNTER_MSB 7 -#define COUNTER_INT_STATUS_COUNTER_LSB 0 -#define COUNTER_INT_STATUS_COUNTER_MASK 'h000000ff -#define COUNTER_INT_STATUS_COUNTER_GET(x) (((x) & COUNTER_INT_STATUS_COUNTER_MASK) >> COUNTER_INT_STATUS_COUNTER_LSB) -#define COUNTER_INT_STATUS_COUNTER_SET(x) (((8'd0 | (x)) << COUNTER_INT_STATUS_COUNTER_LSB) & COUNTER_INT_STATUS_COUNTER_MASK) -#define COUNTER_INT_STATUS_COUNTER_RESET 8'h0 -#define COUNTER_INT_STATUS_RESET (8'h0 | \ - COUNTER_INT_STATUS_COUNTER_SET(COUNTER_INT_STATUS_COUNTER_RESET)) -#define COUNTER_INT_STATUS_HW_MASK (8'h0 | \ - COUNTER_INT_STATUS_COUNTER_MASK) -#define COUNTER_INT_STATUS_SW_MASK (8'h0) - -#define MBOX_FRAME_ADDRESS 'h00000404 -#define MBOX_FRAME_RX_EOM_MSB 7 -#define MBOX_FRAME_RX_EOM_LSB 4 -#define MBOX_FRAME_RX_EOM_MASK 'h000000f0 -#define MBOX_FRAME_RX_EOM_GET(x) (((x) & MBOX_FRAME_RX_EOM_MASK) >> MBOX_FRAME_RX_EOM_LSB) -#define MBOX_FRAME_RX_EOM_SET(x) (((8'd0 | (x)) << MBOX_FRAME_RX_EOM_LSB) & MBOX_FRAME_RX_EOM_MASK) -#define MBOX_FRAME_RX_EOM_RESET 4'h0 -#define MBOX_FRAME_RX_SOM_MSB 3 -#define MBOX_FRAME_RX_SOM_LSB 0 -#define MBOX_FRAME_RX_SOM_MASK 'h0000000f -#define MBOX_FRAME_RX_SOM_GET(x) (((x) & MBOX_FRAME_RX_SOM_MASK) >> MBOX_FRAME_RX_SOM_LSB) -#define MBOX_FRAME_RX_SOM_SET(x) (((8'd0 | (x)) << MBOX_FRAME_RX_SOM_LSB) & MBOX_FRAME_RX_SOM_MASK) -#define MBOX_FRAME_RX_SOM_RESET 4'hf -#define MBOX_FRAME_RESET (8'h0 | \ - MBOX_FRAME_RX_EOM_SET(MBOX_FRAME_RX_EOM_RESET) | \ - MBOX_FRAME_RX_SOM_SET(MBOX_FRAME_RX_SOM_RESET)) -#define MBOX_FRAME_HW_MASK (8'h0 | \ - MBOX_FRAME_RX_EOM_MASK | \ - MBOX_FRAME_RX_SOM_MASK) -#define MBOX_FRAME_SW_MASK (8'h0) - -#define RX_LOOKAHEAD_VALID_ADDRESS 'h00000405 -#define RX_LOOKAHEAD_VALID_MBOX_MSB 3 -#define RX_LOOKAHEAD_VALID_MBOX_LSB 0 -#define RX_LOOKAHEAD_VALID_MBOX_MASK 'h0000000f -#define RX_LOOKAHEAD_VALID_MBOX_GET(x) (((x) & RX_LOOKAHEAD_VALID_MBOX_MASK) >> RX_LOOKAHEAD_VALID_MBOX_LSB) -#define RX_LOOKAHEAD_VALID_MBOX_SET(x) (((8'd0 | (x)) << RX_LOOKAHEAD_VALID_MBOX_LSB) & RX_LOOKAHEAD_VALID_MBOX_MASK) -#define RX_LOOKAHEAD_VALID_MBOX_RESET 4'h0 -#define RX_LOOKAHEAD_VALID_RESET (8'h0 | \ - RX_LOOKAHEAD_VALID_MBOX_SET(RX_LOOKAHEAD_VALID_MBOX_RESET)) -#define RX_LOOKAHEAD_VALID_HW_MASK (8'h0 | \ - RX_LOOKAHEAD_VALID_MBOX_MASK) -#define RX_LOOKAHEAD_VALID_SW_MASK (8'h0) - -#define RX_LOOKAHEAD0_ADDRESS 'h00000408 -#define RX_LOOKAHEAD0_DATA_MSB 7 -#define RX_LOOKAHEAD0_DATA_LSB 0 -#define RX_LOOKAHEAD0_DATA_MASK 'h000000ff -#define RX_LOOKAHEAD0_DATA_GET(x) (((x) & RX_LOOKAHEAD0_DATA_MASK) >> RX_LOOKAHEAD0_DATA_LSB) -#define RX_LOOKAHEAD0_DATA_SET(x) (((8'd0 | (x)) << RX_LOOKAHEAD0_DATA_LSB) & RX_LOOKAHEAD0_DATA_MASK) -#define RX_LOOKAHEAD0_DATA_RESET 8'h0 -#define RX_LOOKAHEAD0_RESET (8'h0 | \ - RX_LOOKAHEAD0_DATA_SET(RX_LOOKAHEAD0_DATA_RESET)) -#define RX_LOOKAHEAD0_HW_MASK (8'h0 | \ - RX_LOOKAHEAD0_DATA_MASK) -#define RX_LOOKAHEAD0_SW_MASK (8'h0) - -#define RX_LOOKAHEAD1_ADDRESS 'h0000040c -#define RX_LOOKAHEAD1_DATA_MSB 7 -#define RX_LOOKAHEAD1_DATA_LSB 0 -#define RX_LOOKAHEAD1_DATA_MASK 'h000000ff -#define RX_LOOKAHEAD1_DATA_GET(x) (((x) & RX_LOOKAHEAD1_DATA_MASK) >> RX_LOOKAHEAD1_DATA_LSB) -#define RX_LOOKAHEAD1_DATA_SET(x) (((8'd0 | (x)) << RX_LOOKAHEAD1_DATA_LSB) & RX_LOOKAHEAD1_DATA_MASK) -#define RX_LOOKAHEAD1_DATA_RESET 8'h0 -#define RX_LOOKAHEAD1_RESET (8'h0 | \ - RX_LOOKAHEAD1_DATA_SET(RX_LOOKAHEAD1_DATA_RESET)) -#define RX_LOOKAHEAD1_HW_MASK (8'h0 | \ - RX_LOOKAHEAD1_DATA_MASK) -#define RX_LOOKAHEAD1_SW_MASK (8'h0) - -#define RX_LOOKAHEAD2_ADDRESS 'h00000410 -#define RX_LOOKAHEAD2_DATA_MSB 7 -#define RX_LOOKAHEAD2_DATA_LSB 0 -#define RX_LOOKAHEAD2_DATA_MASK 'h000000ff -#define RX_LOOKAHEAD2_DATA_GET(x) (((x) & RX_LOOKAHEAD2_DATA_MASK) >> RX_LOOKAHEAD2_DATA_LSB) -#define RX_LOOKAHEAD2_DATA_SET(x) (((8'd0 | (x)) << RX_LOOKAHEAD2_DATA_LSB) & RX_LOOKAHEAD2_DATA_MASK) -#define RX_LOOKAHEAD2_DATA_RESET 8'h0 -#define RX_LOOKAHEAD2_RESET (8'h0 | \ - RX_LOOKAHEAD2_DATA_SET(RX_LOOKAHEAD2_DATA_RESET)) -#define RX_LOOKAHEAD2_HW_MASK (8'h0 | \ - RX_LOOKAHEAD2_DATA_MASK) -#define RX_LOOKAHEAD2_SW_MASK (8'h0) - -#define RX_LOOKAHEAD3_ADDRESS 'h00000414 -#define RX_LOOKAHEAD3_DATA_MSB 7 -#define RX_LOOKAHEAD3_DATA_LSB 0 -#define RX_LOOKAHEAD3_DATA_MASK 'h000000ff -#define RX_LOOKAHEAD3_DATA_GET(x) (((x) & RX_LOOKAHEAD3_DATA_MASK) >> RX_LOOKAHEAD3_DATA_LSB) -#define RX_LOOKAHEAD3_DATA_SET(x) (((8'd0 | (x)) << RX_LOOKAHEAD3_DATA_LSB) & RX_LOOKAHEAD3_DATA_MASK) -#define RX_LOOKAHEAD3_DATA_RESET 8'h0 -#define RX_LOOKAHEAD3_RESET (8'h0 | \ - RX_LOOKAHEAD3_DATA_SET(RX_LOOKAHEAD3_DATA_RESET)) -#define RX_LOOKAHEAD3_HW_MASK (8'h0 | \ - RX_LOOKAHEAD3_DATA_MASK) -#define RX_LOOKAHEAD3_SW_MASK (8'h0) - -#define INT_STATUS_ENABLE_ADDRESS 'h00000418 -#define INT_STATUS_ENABLE_ERROR_MSB 7 -#define INT_STATUS_ENABLE_ERROR_LSB 7 -#define INT_STATUS_ENABLE_ERROR_MASK 'h00000080 -#define INT_STATUS_ENABLE_ERROR_GET(x) (((x) & INT_STATUS_ENABLE_ERROR_MASK) >> INT_STATUS_ENABLE_ERROR_LSB) -#define INT_STATUS_ENABLE_ERROR_SET(x) (((8'd0 | (x)) << INT_STATUS_ENABLE_ERROR_LSB) & INT_STATUS_ENABLE_ERROR_MASK) -#define INT_STATUS_ENABLE_ERROR_RESET 1'h1 -#define INT_STATUS_ENABLE_CPU_MSB 6 -#define INT_STATUS_ENABLE_CPU_LSB 6 -#define INT_STATUS_ENABLE_CPU_MASK 'h00000040 -#define INT_STATUS_ENABLE_CPU_GET(x) (((x) & INT_STATUS_ENABLE_CPU_MASK) >> INT_STATUS_ENABLE_CPU_LSB) -#define INT_STATUS_ENABLE_CPU_SET(x) (((8'd0 | (x)) << INT_STATUS_ENABLE_CPU_LSB) & INT_STATUS_ENABLE_CPU_MASK) -#define INT_STATUS_ENABLE_CPU_RESET 1'h1 -#define INT_STATUS_ENABLE_DRAGON_INT_MSB 5 -#define INT_STATUS_ENABLE_DRAGON_INT_LSB 5 -#define INT_STATUS_ENABLE_DRAGON_INT_MASK 'h00000020 -#define INT_STATUS_ENABLE_DRAGON_INT_GET(x) (((x) & INT_STATUS_ENABLE_DRAGON_INT_MASK) >> INT_STATUS_ENABLE_DRAGON_INT_LSB) -#define INT_STATUS_ENABLE_DRAGON_INT_SET(x) (((8'd0 | (x)) << INT_STATUS_ENABLE_DRAGON_INT_LSB) & INT_STATUS_ENABLE_DRAGON_INT_MASK) -#define INT_STATUS_ENABLE_DRAGON_INT_RESET 1'h0 -#define INT_STATUS_ENABLE_COUNTER_MSB 4 -#define INT_STATUS_ENABLE_COUNTER_LSB 4 -#define INT_STATUS_ENABLE_COUNTER_MASK 'h00000010 -#define INT_STATUS_ENABLE_COUNTER_GET(x) (((x) & INT_STATUS_ENABLE_COUNTER_MASK) >> INT_STATUS_ENABLE_COUNTER_LSB) -#define INT_STATUS_ENABLE_COUNTER_SET(x) (((8'd0 | (x)) << INT_STATUS_ENABLE_COUNTER_LSB) & INT_STATUS_ENABLE_COUNTER_MASK) -#define INT_STATUS_ENABLE_COUNTER_RESET 1'h0 -#define INT_STATUS_ENABLE_MBOX_DATA_MSB 3 -#define INT_STATUS_ENABLE_MBOX_DATA_LSB 0 -#define INT_STATUS_ENABLE_MBOX_DATA_MASK 'h0000000f -#define INT_STATUS_ENABLE_MBOX_DATA_GET(x) (((x) & INT_STATUS_ENABLE_MBOX_DATA_MASK) >> INT_STATUS_ENABLE_MBOX_DATA_LSB) -#define INT_STATUS_ENABLE_MBOX_DATA_SET(x) (((8'd0 | (x)) << INT_STATUS_ENABLE_MBOX_DATA_LSB) & INT_STATUS_ENABLE_MBOX_DATA_MASK) -#define INT_STATUS_ENABLE_MBOX_DATA_RESET 4'hf -#define INT_STATUS_ENABLE_RESET (8'h0 | \ - INT_STATUS_ENABLE_ERROR_SET(INT_STATUS_ENABLE_ERROR_RESET) | \ - INT_STATUS_ENABLE_CPU_SET(INT_STATUS_ENABLE_CPU_RESET) | \ - INT_STATUS_ENABLE_DRAGON_INT_SET(INT_STATUS_ENABLE_DRAGON_INT_RESET) | \ - INT_STATUS_ENABLE_COUNTER_SET(INT_STATUS_ENABLE_COUNTER_RESET) | \ - INT_STATUS_ENABLE_MBOX_DATA_SET(INT_STATUS_ENABLE_MBOX_DATA_RESET)) -#define INT_STATUS_ENABLE_HW_MASK (8'h0) -#define INT_STATUS_ENABLE_SW_MASK (8'h0 | \ - INT_STATUS_ENABLE_ERROR_MASK | \ - INT_STATUS_ENABLE_CPU_MASK | \ - INT_STATUS_ENABLE_DRAGON_INT_MASK | \ - INT_STATUS_ENABLE_COUNTER_MASK | \ - INT_STATUS_ENABLE_MBOX_DATA_MASK) - -#define CPU_INT_STATUS_ENABLE_ADDRESS 'h00000419 -#define CPU_INT_STATUS_ENABLE_BIT_MSB 7 -#define CPU_INT_STATUS_ENABLE_BIT_LSB 0 -#define CPU_INT_STATUS_ENABLE_BIT_MASK 'h000000ff -#define CPU_INT_STATUS_ENABLE_BIT_GET(x) (((x) & CPU_INT_STATUS_ENABLE_BIT_MASK) >> CPU_INT_STATUS_ENABLE_BIT_LSB) -#define CPU_INT_STATUS_ENABLE_BIT_SET(x) (((8'd0 | (x)) << CPU_INT_STATUS_ENABLE_BIT_LSB) & CPU_INT_STATUS_ENABLE_BIT_MASK) -#define CPU_INT_STATUS_ENABLE_BIT_RESET 8'hff -#define CPU_INT_STATUS_ENABLE_RESET (8'h0 | \ - CPU_INT_STATUS_ENABLE_BIT_SET(CPU_INT_STATUS_ENABLE_BIT_RESET)) -#define CPU_INT_STATUS_ENABLE_HW_MASK (8'h0) -#define CPU_INT_STATUS_ENABLE_SW_MASK (8'h0 | \ - CPU_INT_STATUS_ENABLE_BIT_MASK) - -#define ERROR_STATUS_ENABLE_ADDRESS 'h0000041a -#define ERROR_STATUS_ENABLE_WAKEUP_MSB 2 -#define ERROR_STATUS_ENABLE_WAKEUP_LSB 2 -#define ERROR_STATUS_ENABLE_WAKEUP_MASK 'h00000004 -#define ERROR_STATUS_ENABLE_WAKEUP_GET(x) (((x) & ERROR_STATUS_ENABLE_WAKEUP_MASK) >> ERROR_STATUS_ENABLE_WAKEUP_LSB) -#define ERROR_STATUS_ENABLE_WAKEUP_SET(x) (((8'd0 | (x)) << ERROR_STATUS_ENABLE_WAKEUP_LSB) & ERROR_STATUS_ENABLE_WAKEUP_MASK) -#define ERROR_STATUS_ENABLE_WAKEUP_RESET 1'h0 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MSB 1 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB 1 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK 'h00000002 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) >> ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_SET(x) (((8'd0 | (x)) << ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_RESET 1'h0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MSB 0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB 0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK 'h00000001 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) >> ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_SET(x) (((8'd0 | (x)) << ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_RESET 1'h0 -#define ERROR_STATUS_ENABLE_RESET (8'h0 | \ - ERROR_STATUS_ENABLE_WAKEUP_SET(ERROR_STATUS_ENABLE_WAKEUP_RESET) | \ - ERROR_STATUS_ENABLE_RX_UNDERFLOW_SET(ERROR_STATUS_ENABLE_RX_UNDERFLOW_RESET) | \ - ERROR_STATUS_ENABLE_TX_OVERFLOW_SET(ERROR_STATUS_ENABLE_TX_OVERFLOW_RESET)) -#define ERROR_STATUS_ENABLE_HW_MASK (8'h0) -#define ERROR_STATUS_ENABLE_SW_MASK (8'h0 | \ - ERROR_STATUS_ENABLE_WAKEUP_MASK | \ - ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK | \ - ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) - -#define COUNTER_INT_STATUS_ENABLE_ADDRESS 'h0000041b -#define COUNTER_INT_STATUS_ENABLE_BIT_MSB 7 -#define COUNTER_INT_STATUS_ENABLE_BIT_LSB 0 -#define COUNTER_INT_STATUS_ENABLE_BIT_MASK 'h000000ff -#define COUNTER_INT_STATUS_ENABLE_BIT_GET(x) (((x) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) >> COUNTER_INT_STATUS_ENABLE_BIT_LSB) -#define COUNTER_INT_STATUS_ENABLE_BIT_SET(x) (((8'd0 | (x)) << COUNTER_INT_STATUS_ENABLE_BIT_LSB) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) -#define COUNTER_INT_STATUS_ENABLE_BIT_RESET 8'hff -#define COUNTER_INT_STATUS_ENABLE_RESET (8'h0 | \ - COUNTER_INT_STATUS_ENABLE_BIT_SET(COUNTER_INT_STATUS_ENABLE_BIT_RESET)) -#define COUNTER_INT_STATUS_ENABLE_HW_MASK (8'h0) -#define COUNTER_INT_STATUS_ENABLE_SW_MASK (8'h0 | \ - COUNTER_INT_STATUS_ENABLE_BIT_MASK) - -#define COUNT_ADDRESS 'h00000420 -#define COUNT_VALUE_MSB 7 -#define COUNT_VALUE_LSB 0 -#define COUNT_VALUE_MASK 'h000000ff -#define COUNT_VALUE_GET(x) (((x) & COUNT_VALUE_MASK) >> COUNT_VALUE_LSB) -#define COUNT_VALUE_SET(x) (((8'd0 | (x)) << COUNT_VALUE_LSB) & COUNT_VALUE_MASK) -#define COUNT_VALUE_RESET 8'h0 -#define COUNT_RESET (8'h0 | \ - COUNT_VALUE_SET(COUNT_VALUE_RESET)) -#define COUNT_HW_MASK (8'h0 | \ - COUNT_VALUE_MASK) -#define COUNT_SW_MASK (8'h0 | \ - COUNT_VALUE_MASK) - -#define COUNT_DEC_ADDRESS 'h00000440 -#define COUNT_DEC_VALUE_MSB 7 -#define COUNT_DEC_VALUE_LSB 0 -#define COUNT_DEC_VALUE_MASK 'h000000ff -#define COUNT_DEC_VALUE_GET(x) (((x) & COUNT_DEC_VALUE_MASK) >> COUNT_DEC_VALUE_LSB) -#define COUNT_DEC_VALUE_SET(x) (((8'd0 | (x)) << COUNT_DEC_VALUE_LSB) & COUNT_DEC_VALUE_MASK) -#define COUNT_DEC_VALUE_RESET 8'h0 -#define COUNT_DEC_RESET (8'h0 | \ - COUNT_DEC_VALUE_SET(COUNT_DEC_VALUE_RESET)) -#define COUNT_DEC_HW_MASK (8'h0 | \ - COUNT_DEC_VALUE_MASK) -#define COUNT_DEC_SW_MASK (8'h0 | \ - COUNT_DEC_VALUE_MASK) - -#define SCRATCH_ADDRESS 'h00000460 -#define SCRATCH_VALUE_MSB 7 -#define SCRATCH_VALUE_LSB 0 -#define SCRATCH_VALUE_MASK 'h000000ff -#define SCRATCH_VALUE_GET(x) (((x) & SCRATCH_VALUE_MASK) >> SCRATCH_VALUE_LSB) -#define SCRATCH_VALUE_SET(x) (((8'd0 | (x)) << SCRATCH_VALUE_LSB) & SCRATCH_VALUE_MASK) -#define SCRATCH_VALUE_RESET 8'h0 -#define SCRATCH_RESET (8'h0 | \ - SCRATCH_VALUE_SET(SCRATCH_VALUE_RESET)) -#define SCRATCH_HW_MASK (8'h0 | \ - SCRATCH_VALUE_MASK) -#define SCRATCH_SW_MASK (8'h0 | \ - SCRATCH_VALUE_MASK) - -#define FIFO_TIMEOUT_ADDRESS 'h00000468 -#define FIFO_TIMEOUT_VALUE_MSB 7 -#define FIFO_TIMEOUT_VALUE_LSB 0 -#define FIFO_TIMEOUT_VALUE_MASK 'h000000ff -#define FIFO_TIMEOUT_VALUE_GET(x) (((x) & FIFO_TIMEOUT_VALUE_MASK) >> FIFO_TIMEOUT_VALUE_LSB) -#define FIFO_TIMEOUT_VALUE_SET(x) (((8'd0 | (x)) << FIFO_TIMEOUT_VALUE_LSB) & FIFO_TIMEOUT_VALUE_MASK) -#define FIFO_TIMEOUT_VALUE_RESET 8'hff -#define FIFO_TIMEOUT_RESET (8'h0 | \ - FIFO_TIMEOUT_VALUE_SET(FIFO_TIMEOUT_VALUE_RESET)) -#define FIFO_TIMEOUT_HW_MASK (8'h0) -#define FIFO_TIMEOUT_SW_MASK (8'h0 | \ - FIFO_TIMEOUT_VALUE_MASK) - -#define FIFO_TIMEOUT_ENABLE_ADDRESS 'h00000469 -#define FIFO_TIMEOUT_ENABLE_SET_MSB 0 -#define FIFO_TIMEOUT_ENABLE_SET_LSB 0 -#define FIFO_TIMEOUT_ENABLE_SET_MASK 'h00000001 -#define FIFO_TIMEOUT_ENABLE_SET_GET(x) (((x) & FIFO_TIMEOUT_ENABLE_SET_MASK) >> FIFO_TIMEOUT_ENABLE_SET_LSB) -#define FIFO_TIMEOUT_ENABLE_SET_SET(x) (((8'd0 | (x)) << FIFO_TIMEOUT_ENABLE_SET_LSB) & FIFO_TIMEOUT_ENABLE_SET_MASK) -#define FIFO_TIMEOUT_ENABLE_SET_RESET 1'h1 -#define FIFO_TIMEOUT_ENABLE_RESET (8'h0 | \ - FIFO_TIMEOUT_ENABLE_SET_SET(FIFO_TIMEOUT_ENABLE_SET_RESET)) -#define FIFO_TIMEOUT_ENABLE_HW_MASK (8'h0) -#define FIFO_TIMEOUT_ENABLE_SW_MASK (8'h0 | \ - FIFO_TIMEOUT_ENABLE_SET_MASK) - -#define DISABLE_SLEEP_ADDRESS 'h0000046a -#define DISABLE_SLEEP_FOR_INT_MSB 1 -#define DISABLE_SLEEP_FOR_INT_LSB 1 -#define DISABLE_SLEEP_FOR_INT_MASK 'h00000002 -#define DISABLE_SLEEP_FOR_INT_GET(x) (((x) & DISABLE_SLEEP_FOR_INT_MASK) >> DISABLE_SLEEP_FOR_INT_LSB) -#define DISABLE_SLEEP_FOR_INT_SET(x) (((8'd0 | (x)) << DISABLE_SLEEP_FOR_INT_LSB) & DISABLE_SLEEP_FOR_INT_MASK) -#define DISABLE_SLEEP_FOR_INT_RESET 1'h0 -#define DISABLE_SLEEP_ON_MSB 0 -#define DISABLE_SLEEP_ON_LSB 0 -#define DISABLE_SLEEP_ON_MASK 'h00000001 -#define DISABLE_SLEEP_ON_GET(x) (((x) & DISABLE_SLEEP_ON_MASK) >> DISABLE_SLEEP_ON_LSB) -#define DISABLE_SLEEP_ON_SET(x) (((8'd0 | (x)) << DISABLE_SLEEP_ON_LSB) & DISABLE_SLEEP_ON_MASK) -#define DISABLE_SLEEP_ON_RESET 1'h0 -#define DISABLE_SLEEP_RESET (8'h0 | \ - DISABLE_SLEEP_FOR_INT_SET(DISABLE_SLEEP_FOR_INT_RESET) | \ - DISABLE_SLEEP_ON_SET(DISABLE_SLEEP_ON_RESET)) -#define DISABLE_SLEEP_HW_MASK (8'h0) -#define DISABLE_SLEEP_SW_MASK (8'h0 | \ - DISABLE_SLEEP_FOR_INT_MASK | \ - DISABLE_SLEEP_ON_MASK) - -#define LOCAL_BUS_ADDRESS 'h00000470 -#define LOCAL_BUS_STATE_MSB 1 -#define LOCAL_BUS_STATE_LSB 0 -#define LOCAL_BUS_STATE_MASK 'h00000003 -#define LOCAL_BUS_STATE_GET(x) (((x) & LOCAL_BUS_STATE_MASK) >> LOCAL_BUS_STATE_LSB) -#define LOCAL_BUS_STATE_SET(x) (((8'd0 | (x)) << LOCAL_BUS_STATE_LSB) & LOCAL_BUS_STATE_MASK) -#define LOCAL_BUS_STATE_RESET 2'h0 -#define LOCAL_BUS_RESET (8'h0 | \ - LOCAL_BUS_STATE_SET(LOCAL_BUS_STATE_RESET)) -#define LOCAL_BUS_HW_MASK (8'h0 | \ - LOCAL_BUS_STATE_MASK) -#define LOCAL_BUS_SW_MASK (8'h0) - -#define INT_WLAN_ADDRESS 'h00000472 -#define INT_WLAN_VECTOR_MSB 7 -#define INT_WLAN_VECTOR_LSB 0 -#define INT_WLAN_VECTOR_MASK 'h000000ff -#define INT_WLAN_VECTOR_GET(x) (((x) & INT_WLAN_VECTOR_MASK) >> INT_WLAN_VECTOR_LSB) -#define INT_WLAN_VECTOR_SET(x) (((8'd0 | (x)) << INT_WLAN_VECTOR_LSB) & INT_WLAN_VECTOR_MASK) -#define INT_WLAN_VECTOR_RESET 8'h0 -#define INT_WLAN_RESET (8'h0 | \ - INT_WLAN_VECTOR_SET(INT_WLAN_VECTOR_RESET)) -#define INT_WLAN_HW_MASK (8'h0 | \ - INT_WLAN_VECTOR_MASK) -#define INT_WLAN_SW_MASK (8'h0 | \ - INT_WLAN_VECTOR_MASK) - -#define WINDOW_DATA_ADDRESS 'h00000474 -#define WINDOW_DATA_DATA_MSB 7 -#define WINDOW_DATA_DATA_LSB 0 -#define WINDOW_DATA_DATA_MASK 'h000000ff -#define WINDOW_DATA_DATA_GET(x) (((x) & WINDOW_DATA_DATA_MASK) >> WINDOW_DATA_DATA_LSB) -#define WINDOW_DATA_DATA_SET(x) (((8'd0 | (x)) << WINDOW_DATA_DATA_LSB) & WINDOW_DATA_DATA_MASK) -#define WINDOW_DATA_DATA_RESET 8'h0 -#define WINDOW_DATA_RESET (8'h0 | \ - WINDOW_DATA_DATA_SET(WINDOW_DATA_DATA_RESET)) -#define WINDOW_DATA_HW_MASK (8'h0 | \ - WINDOW_DATA_DATA_MASK) -#define WINDOW_DATA_SW_MASK (8'h0 | \ - WINDOW_DATA_DATA_MASK) - -#define WINDOW_WRITE_ADDR_ADDRESS 'h00000478 -#define WINDOW_WRITE_ADDR_ADDR_MSB 7 -#define WINDOW_WRITE_ADDR_ADDR_LSB 0 -#define WINDOW_WRITE_ADDR_ADDR_MASK 'h000000ff -#define WINDOW_WRITE_ADDR_ADDR_GET(x) (((x) & WINDOW_WRITE_ADDR_ADDR_MASK) >> WINDOW_WRITE_ADDR_ADDR_LSB) -#define WINDOW_WRITE_ADDR_ADDR_SET(x) (((8'd0 | (x)) << WINDOW_WRITE_ADDR_ADDR_LSB) & WINDOW_WRITE_ADDR_ADDR_MASK) -#define WINDOW_WRITE_ADDR_ADDR_RESET 8'h0 -#define WINDOW_WRITE_ADDR_RESET (8'h0 | \ - WINDOW_WRITE_ADDR_ADDR_SET(WINDOW_WRITE_ADDR_ADDR_RESET)) -#define WINDOW_WRITE_ADDR_HW_MASK (8'h0) -#define WINDOW_WRITE_ADDR_SW_MASK (8'h0 | \ - WINDOW_WRITE_ADDR_ADDR_MASK) - -#define WINDOW_READ_ADDR_ADDRESS 'h0000047c -#define WINDOW_READ_ADDR_ADDR_MSB 7 -#define WINDOW_READ_ADDR_ADDR_LSB 0 -#define WINDOW_READ_ADDR_ADDR_MASK 'h000000ff -#define WINDOW_READ_ADDR_ADDR_GET(x) (((x) & WINDOW_READ_ADDR_ADDR_MASK) >> WINDOW_READ_ADDR_ADDR_LSB) -#define WINDOW_READ_ADDR_ADDR_SET(x) (((8'd0 | (x)) << WINDOW_READ_ADDR_ADDR_LSB) & WINDOW_READ_ADDR_ADDR_MASK) -#define WINDOW_READ_ADDR_ADDR_RESET 8'h0 -#define WINDOW_READ_ADDR_RESET (8'h0 | \ - WINDOW_READ_ADDR_ADDR_SET(WINDOW_READ_ADDR_ADDR_RESET)) -#define WINDOW_READ_ADDR_HW_MASK (8'h0) -#define WINDOW_READ_ADDR_SW_MASK (8'h0 | \ - WINDOW_READ_ADDR_ADDR_MASK) - -#define SPI_CONFIG_ADDRESS 'h00000480 -#define SPI_CONFIG_SPI_RESET_MSB 4 -#define SPI_CONFIG_SPI_RESET_LSB 4 -#define SPI_CONFIG_SPI_RESET_MASK 'h00000010 -#define SPI_CONFIG_SPI_RESET_GET(x) (((x) & SPI_CONFIG_SPI_RESET_MASK) >> SPI_CONFIG_SPI_RESET_LSB) -#define SPI_CONFIG_SPI_RESET_SET(x) (((8'd0 | (x)) << SPI_CONFIG_SPI_RESET_LSB) & SPI_CONFIG_SPI_RESET_MASK) -#define SPI_CONFIG_SPI_RESET_RESET 1'h0 -#define SPI_CONFIG_INTERRUPT_ENABLE_MSB 3 -#define SPI_CONFIG_INTERRUPT_ENABLE_LSB 3 -#define SPI_CONFIG_INTERRUPT_ENABLE_MASK 'h00000008 -#define SPI_CONFIG_INTERRUPT_ENABLE_GET(x) (((x) & SPI_CONFIG_INTERRUPT_ENABLE_MASK) >> SPI_CONFIG_INTERRUPT_ENABLE_LSB) -#define SPI_CONFIG_INTERRUPT_ENABLE_SET(x) (((8'd0 | (x)) << SPI_CONFIG_INTERRUPT_ENABLE_LSB) & SPI_CONFIG_INTERRUPT_ENABLE_MASK) -#define SPI_CONFIG_INTERRUPT_ENABLE_RESET 1'h0 -#define SPI_CONFIG_TEST_MODE_MSB 2 -#define SPI_CONFIG_TEST_MODE_LSB 2 -#define SPI_CONFIG_TEST_MODE_MASK 'h00000004 -#define SPI_CONFIG_TEST_MODE_GET(x) (((x) & SPI_CONFIG_TEST_MODE_MASK) >> SPI_CONFIG_TEST_MODE_LSB) -#define SPI_CONFIG_TEST_MODE_SET(x) (((8'd0 | (x)) << SPI_CONFIG_TEST_MODE_LSB) & SPI_CONFIG_TEST_MODE_MASK) -#define SPI_CONFIG_TEST_MODE_RESET 1'h0 -#define SPI_CONFIG_DATA_SIZE_MSB 1 -#define SPI_CONFIG_DATA_SIZE_LSB 0 -#define SPI_CONFIG_DATA_SIZE_MASK 'h00000003 -#define SPI_CONFIG_DATA_SIZE_GET(x) (((x) & SPI_CONFIG_DATA_SIZE_MASK) >> SPI_CONFIG_DATA_SIZE_LSB) -#define SPI_CONFIG_DATA_SIZE_SET(x) (((8'd0 | (x)) << SPI_CONFIG_DATA_SIZE_LSB) & SPI_CONFIG_DATA_SIZE_MASK) -#define SPI_CONFIG_DATA_SIZE_RESET 2'h2 -#define SPI_CONFIG_RESET (8'h0 | \ - SPI_CONFIG_SPI_RESET_SET(SPI_CONFIG_SPI_RESET_RESET) | \ - SPI_CONFIG_INTERRUPT_ENABLE_SET(SPI_CONFIG_INTERRUPT_ENABLE_RESET) | \ - SPI_CONFIG_TEST_MODE_SET(SPI_CONFIG_TEST_MODE_RESET) | \ - SPI_CONFIG_DATA_SIZE_SET(SPI_CONFIG_DATA_SIZE_RESET)) -#define SPI_CONFIG_HW_MASK (8'h0) -#define SPI_CONFIG_SW_MASK (8'h0 | \ - SPI_CONFIG_SPI_RESET_MASK | \ - SPI_CONFIG_INTERRUPT_ENABLE_MASK | \ - SPI_CONFIG_TEST_MODE_MASK | \ - SPI_CONFIG_DATA_SIZE_MASK) - -#define SPI_STATUS_ADDRESS 'h00000481 -#define SPI_STATUS_ADDR_ERR_MSB 3 -#define SPI_STATUS_ADDR_ERR_LSB 3 -#define SPI_STATUS_ADDR_ERR_MASK 'h00000008 -#define SPI_STATUS_ADDR_ERR_GET(x) (((x) & SPI_STATUS_ADDR_ERR_MASK) >> SPI_STATUS_ADDR_ERR_LSB) -#define SPI_STATUS_ADDR_ERR_SET(x) (((8'd0 | (x)) << SPI_STATUS_ADDR_ERR_LSB) & SPI_STATUS_ADDR_ERR_MASK) -#define SPI_STATUS_ADDR_ERR_RESET 1'h0 -#define SPI_STATUS_RD_ERR_MSB 2 -#define SPI_STATUS_RD_ERR_LSB 2 -#define SPI_STATUS_RD_ERR_MASK 'h00000004 -#define SPI_STATUS_RD_ERR_GET(x) (((x) & SPI_STATUS_RD_ERR_MASK) >> SPI_STATUS_RD_ERR_LSB) -#define SPI_STATUS_RD_ERR_SET(x) (((8'd0 | (x)) << SPI_STATUS_RD_ERR_LSB) & SPI_STATUS_RD_ERR_MASK) -#define SPI_STATUS_RD_ERR_RESET 1'h0 -#define SPI_STATUS_WR_ERR_MSB 1 -#define SPI_STATUS_WR_ERR_LSB 1 -#define SPI_STATUS_WR_ERR_MASK 'h00000002 -#define SPI_STATUS_WR_ERR_GET(x) (((x) & SPI_STATUS_WR_ERR_MASK) >> SPI_STATUS_WR_ERR_LSB) -#define SPI_STATUS_WR_ERR_SET(x) (((8'd0 | (x)) << SPI_STATUS_WR_ERR_LSB) & SPI_STATUS_WR_ERR_MASK) -#define SPI_STATUS_WR_ERR_RESET 1'h0 -#define SPI_STATUS_READY_MSB 0 -#define SPI_STATUS_READY_LSB 0 -#define SPI_STATUS_READY_MASK 'h00000001 -#define SPI_STATUS_READY_GET(x) (((x) & SPI_STATUS_READY_MASK) >> SPI_STATUS_READY_LSB) -#define SPI_STATUS_READY_SET(x) (((8'd0 | (x)) << SPI_STATUS_READY_LSB) & SPI_STATUS_READY_MASK) -#define SPI_STATUS_READY_RESET 1'h1 -#define SPI_STATUS_RESET (8'h0 | \ - SPI_STATUS_ADDR_ERR_SET(SPI_STATUS_ADDR_ERR_RESET) | \ - SPI_STATUS_RD_ERR_SET(SPI_STATUS_RD_ERR_RESET) | \ - SPI_STATUS_WR_ERR_SET(SPI_STATUS_WR_ERR_RESET) | \ - SPI_STATUS_READY_SET(SPI_STATUS_READY_RESET)) -#define SPI_STATUS_HW_MASK (8'h0 | \ - SPI_STATUS_ADDR_ERR_MASK | \ - SPI_STATUS_RD_ERR_MASK | \ - SPI_STATUS_WR_ERR_MASK | \ - SPI_STATUS_READY_MASK) -#define SPI_STATUS_SW_MASK (8'h0 | \ - SPI_STATUS_ADDR_ERR_MASK | \ - SPI_STATUS_RD_ERR_MASK | \ - SPI_STATUS_WR_ERR_MASK) - -#define NON_ASSOC_SLEEP_EN_ADDRESS 'h00000482 -#define NON_ASSOC_SLEEP_EN_BIT_MSB 0 -#define NON_ASSOC_SLEEP_EN_BIT_LSB 0 -#define NON_ASSOC_SLEEP_EN_BIT_MASK 'h00000001 -#define NON_ASSOC_SLEEP_EN_BIT_GET(x) (((x) & NON_ASSOC_SLEEP_EN_BIT_MASK) >> NON_ASSOC_SLEEP_EN_BIT_LSB) -#define NON_ASSOC_SLEEP_EN_BIT_SET(x) (((8'd0 | (x)) << NON_ASSOC_SLEEP_EN_BIT_LSB) & NON_ASSOC_SLEEP_EN_BIT_MASK) -#define NON_ASSOC_SLEEP_EN_BIT_RESET 1'h0 -#define NON_ASSOC_SLEEP_EN_RESET (8'h0 | \ - NON_ASSOC_SLEEP_EN_BIT_SET(NON_ASSOC_SLEEP_EN_BIT_RESET)) -#define NON_ASSOC_SLEEP_EN_HW_MASK (8'h0) -#define NON_ASSOC_SLEEP_EN_SW_MASK (8'h0 | \ - NON_ASSOC_SLEEP_EN_BIT_MASK) - -#define CIS_WINDOW_ADDRESS 'h00000600 -#define CIS_WINDOW_DATA_MSB 7 -#define CIS_WINDOW_DATA_LSB 0 -#define CIS_WINDOW_DATA_MASK 'h000000ff -#define CIS_WINDOW_DATA_GET(x) (((x) & CIS_WINDOW_DATA_MASK) >> CIS_WINDOW_DATA_LSB) -#define CIS_WINDOW_DATA_SET(x) (((8'd0 | (x)) << CIS_WINDOW_DATA_LSB) & CIS_WINDOW_DATA_MASK) -#define CIS_WINDOW_DATA_RESET 8'h0 -#define CIS_WINDOW_RESET (8'h0 | \ - CIS_WINDOW_DATA_SET(CIS_WINDOW_DATA_RESET)) -#define CIS_WINDOW_HW_MASK (8'h0) -#define CIS_WINDOW_SW_MASK (8'h0 | \ - CIS_WINDOW_DATA_MASK) - -#define MBOX_HOST_REG_ADDRESS_MSB 10 - -#endif /* _MBOX_HOST_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/mbox_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/mbox_reg.h deleted file mode 100644 index 4e07d2286107..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/mbox_reg.h +++ /dev/null @@ -1,481 +0,0 @@ -#ifndef _MBOX_REG_REG_H_ -#define _MBOX_REG_REG_H_ - -#define MBOX_FIFO_ADDRESS 0x00000000 -#define MBOX_FIFO_OFFSET 0x00000000 -#define MBOX_FIFO_DATA_MSB 19 -#define MBOX_FIFO_DATA_LSB 0 -#define MBOX_FIFO_DATA_MASK 0x000fffff -#define MBOX_FIFO_DATA_GET(x) (((x) & MBOX_FIFO_DATA_MASK) >> MBOX_FIFO_DATA_LSB) -#define MBOX_FIFO_DATA_SET(x) (((x) << MBOX_FIFO_DATA_LSB) & MBOX_FIFO_DATA_MASK) - -#define MBOX_FIFO_STATUS_ADDRESS 0x00000010 -#define MBOX_FIFO_STATUS_OFFSET 0x00000010 -#define MBOX_FIFO_STATUS_EMPTY_MSB 19 -#define MBOX_FIFO_STATUS_EMPTY_LSB 16 -#define MBOX_FIFO_STATUS_EMPTY_MASK 0x000f0000 -#define MBOX_FIFO_STATUS_EMPTY_GET(x) (((x) & MBOX_FIFO_STATUS_EMPTY_MASK) >> MBOX_FIFO_STATUS_EMPTY_LSB) -#define MBOX_FIFO_STATUS_EMPTY_SET(x) (((x) << MBOX_FIFO_STATUS_EMPTY_LSB) & MBOX_FIFO_STATUS_EMPTY_MASK) -#define MBOX_FIFO_STATUS_FULL_MSB 15 -#define MBOX_FIFO_STATUS_FULL_LSB 12 -#define MBOX_FIFO_STATUS_FULL_MASK 0x0000f000 -#define MBOX_FIFO_STATUS_FULL_GET(x) (((x) & MBOX_FIFO_STATUS_FULL_MASK) >> MBOX_FIFO_STATUS_FULL_LSB) -#define MBOX_FIFO_STATUS_FULL_SET(x) (((x) << MBOX_FIFO_STATUS_FULL_LSB) & MBOX_FIFO_STATUS_FULL_MASK) - -#define MBOX_DMA_POLICY_ADDRESS 0x00000014 -#define MBOX_DMA_POLICY_OFFSET 0x00000014 -#define MBOX_DMA_POLICY_TX_QUANTUM_MSB 3 -#define MBOX_DMA_POLICY_TX_QUANTUM_LSB 3 -#define MBOX_DMA_POLICY_TX_QUANTUM_MASK 0x00000008 -#define MBOX_DMA_POLICY_TX_QUANTUM_GET(x) (((x) & MBOX_DMA_POLICY_TX_QUANTUM_MASK) >> MBOX_DMA_POLICY_TX_QUANTUM_LSB) -#define MBOX_DMA_POLICY_TX_QUANTUM_SET(x) (((x) << MBOX_DMA_POLICY_TX_QUANTUM_LSB) & MBOX_DMA_POLICY_TX_QUANTUM_MASK) -#define MBOX_DMA_POLICY_TX_ORDER_MSB 2 -#define MBOX_DMA_POLICY_TX_ORDER_LSB 2 -#define MBOX_DMA_POLICY_TX_ORDER_MASK 0x00000004 -#define MBOX_DMA_POLICY_TX_ORDER_GET(x) (((x) & MBOX_DMA_POLICY_TX_ORDER_MASK) >> MBOX_DMA_POLICY_TX_ORDER_LSB) -#define MBOX_DMA_POLICY_TX_ORDER_SET(x) (((x) << MBOX_DMA_POLICY_TX_ORDER_LSB) & MBOX_DMA_POLICY_TX_ORDER_MASK) -#define MBOX_DMA_POLICY_RX_QUANTUM_MSB 1 -#define MBOX_DMA_POLICY_RX_QUANTUM_LSB 1 -#define MBOX_DMA_POLICY_RX_QUANTUM_MASK 0x00000002 -#define MBOX_DMA_POLICY_RX_QUANTUM_GET(x) (((x) & MBOX_DMA_POLICY_RX_QUANTUM_MASK) >> MBOX_DMA_POLICY_RX_QUANTUM_LSB) -#define MBOX_DMA_POLICY_RX_QUANTUM_SET(x) (((x) << MBOX_DMA_POLICY_RX_QUANTUM_LSB) & MBOX_DMA_POLICY_RX_QUANTUM_MASK) -#define MBOX_DMA_POLICY_RX_ORDER_MSB 0 -#define MBOX_DMA_POLICY_RX_ORDER_LSB 0 -#define MBOX_DMA_POLICY_RX_ORDER_MASK 0x00000001 -#define MBOX_DMA_POLICY_RX_ORDER_GET(x) (((x) & MBOX_DMA_POLICY_RX_ORDER_MASK) >> MBOX_DMA_POLICY_RX_ORDER_LSB) -#define MBOX_DMA_POLICY_RX_ORDER_SET(x) (((x) << MBOX_DMA_POLICY_RX_ORDER_LSB) & MBOX_DMA_POLICY_RX_ORDER_MASK) - -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000018 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000018 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX0_DMA_RX_CONTROL_ADDRESS 0x0000001c -#define MBOX0_DMA_RX_CONTROL_OFFSET 0x0000001c -#define MBOX0_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX0_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX0_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX0_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_RESUME_MASK) >> MBOX0_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX0_DMA_RX_CONTROL_RESUME_SET(x) (((x) << MBOX0_DMA_RX_CONTROL_RESUME_LSB) & MBOX0_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX0_DMA_RX_CONTROL_START_MSB 1 -#define MBOX0_DMA_RX_CONTROL_START_LSB 1 -#define MBOX0_DMA_RX_CONTROL_START_MASK 0x00000002 -#define MBOX0_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_START_MASK) >> MBOX0_DMA_RX_CONTROL_START_LSB) -#define MBOX0_DMA_RX_CONTROL_START_SET(x) (((x) << MBOX0_DMA_RX_CONTROL_START_LSB) & MBOX0_DMA_RX_CONTROL_START_MASK) -#define MBOX0_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX0_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX0_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define MBOX0_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_STOP_MASK) >> MBOX0_DMA_RX_CONTROL_STOP_LSB) -#define MBOX0_DMA_RX_CONTROL_STOP_SET(x) (((x) << MBOX0_DMA_RX_CONTROL_STOP_LSB) & MBOX0_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000020 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000020 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX0_DMA_TX_CONTROL_ADDRESS 0x00000024 -#define MBOX0_DMA_TX_CONTROL_OFFSET 0x00000024 -#define MBOX0_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX0_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX0_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX0_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_RESUME_MASK) >> MBOX0_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX0_DMA_TX_CONTROL_RESUME_SET(x) (((x) << MBOX0_DMA_TX_CONTROL_RESUME_LSB) & MBOX0_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX0_DMA_TX_CONTROL_START_MSB 1 -#define MBOX0_DMA_TX_CONTROL_START_LSB 1 -#define MBOX0_DMA_TX_CONTROL_START_MASK 0x00000002 -#define MBOX0_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_START_MASK) >> MBOX0_DMA_TX_CONTROL_START_LSB) -#define MBOX0_DMA_TX_CONTROL_START_SET(x) (((x) << MBOX0_DMA_TX_CONTROL_START_LSB) & MBOX0_DMA_TX_CONTROL_START_MASK) -#define MBOX0_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX0_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX0_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define MBOX0_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_STOP_MASK) >> MBOX0_DMA_TX_CONTROL_STOP_LSB) -#define MBOX0_DMA_TX_CONTROL_STOP_SET(x) (((x) << MBOX0_DMA_TX_CONTROL_STOP_LSB) & MBOX0_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000028 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000028 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX1_DMA_RX_CONTROL_ADDRESS 0x0000002c -#define MBOX1_DMA_RX_CONTROL_OFFSET 0x0000002c -#define MBOX1_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX1_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX1_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX1_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX1_DMA_RX_CONTROL_RESUME_MASK) >> MBOX1_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX1_DMA_RX_CONTROL_RESUME_SET(x) (((x) << MBOX1_DMA_RX_CONTROL_RESUME_LSB) & MBOX1_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX1_DMA_RX_CONTROL_START_MSB 1 -#define MBOX1_DMA_RX_CONTROL_START_LSB 1 -#define MBOX1_DMA_RX_CONTROL_START_MASK 0x00000002 -#define MBOX1_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX1_DMA_RX_CONTROL_START_MASK) >> MBOX1_DMA_RX_CONTROL_START_LSB) -#define MBOX1_DMA_RX_CONTROL_START_SET(x) (((x) << MBOX1_DMA_RX_CONTROL_START_LSB) & MBOX1_DMA_RX_CONTROL_START_MASK) -#define MBOX1_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX1_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX1_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define MBOX1_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX1_DMA_RX_CONTROL_STOP_MASK) >> MBOX1_DMA_RX_CONTROL_STOP_LSB) -#define MBOX1_DMA_RX_CONTROL_STOP_SET(x) (((x) << MBOX1_DMA_RX_CONTROL_STOP_LSB) & MBOX1_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000030 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000030 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX1_DMA_TX_CONTROL_ADDRESS 0x00000034 -#define MBOX1_DMA_TX_CONTROL_OFFSET 0x00000034 -#define MBOX1_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX1_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX1_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX1_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX1_DMA_TX_CONTROL_RESUME_MASK) >> MBOX1_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX1_DMA_TX_CONTROL_RESUME_SET(x) (((x) << MBOX1_DMA_TX_CONTROL_RESUME_LSB) & MBOX1_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX1_DMA_TX_CONTROL_START_MSB 1 -#define MBOX1_DMA_TX_CONTROL_START_LSB 1 -#define MBOX1_DMA_TX_CONTROL_START_MASK 0x00000002 -#define MBOX1_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX1_DMA_TX_CONTROL_START_MASK) >> MBOX1_DMA_TX_CONTROL_START_LSB) -#define MBOX1_DMA_TX_CONTROL_START_SET(x) (((x) << MBOX1_DMA_TX_CONTROL_START_LSB) & MBOX1_DMA_TX_CONTROL_START_MASK) -#define MBOX1_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX1_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX1_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define MBOX1_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX1_DMA_TX_CONTROL_STOP_MASK) >> MBOX1_DMA_TX_CONTROL_STOP_LSB) -#define MBOX1_DMA_TX_CONTROL_STOP_SET(x) (((x) << MBOX1_DMA_TX_CONTROL_STOP_LSB) & MBOX1_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000038 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000038 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX2_DMA_RX_CONTROL_ADDRESS 0x0000003c -#define MBOX2_DMA_RX_CONTROL_OFFSET 0x0000003c -#define MBOX2_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX2_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX2_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX2_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX2_DMA_RX_CONTROL_RESUME_MASK) >> MBOX2_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX2_DMA_RX_CONTROL_RESUME_SET(x) (((x) << MBOX2_DMA_RX_CONTROL_RESUME_LSB) & MBOX2_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX2_DMA_RX_CONTROL_START_MSB 1 -#define MBOX2_DMA_RX_CONTROL_START_LSB 1 -#define MBOX2_DMA_RX_CONTROL_START_MASK 0x00000002 -#define MBOX2_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX2_DMA_RX_CONTROL_START_MASK) >> MBOX2_DMA_RX_CONTROL_START_LSB) -#define MBOX2_DMA_RX_CONTROL_START_SET(x) (((x) << MBOX2_DMA_RX_CONTROL_START_LSB) & MBOX2_DMA_RX_CONTROL_START_MASK) -#define MBOX2_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX2_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX2_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define MBOX2_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX2_DMA_RX_CONTROL_STOP_MASK) >> MBOX2_DMA_RX_CONTROL_STOP_LSB) -#define MBOX2_DMA_RX_CONTROL_STOP_SET(x) (((x) << MBOX2_DMA_RX_CONTROL_STOP_LSB) & MBOX2_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000040 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000040 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX2_DMA_TX_CONTROL_ADDRESS 0x00000044 -#define MBOX2_DMA_TX_CONTROL_OFFSET 0x00000044 -#define MBOX2_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX2_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX2_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX2_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX2_DMA_TX_CONTROL_RESUME_MASK) >> MBOX2_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX2_DMA_TX_CONTROL_RESUME_SET(x) (((x) << MBOX2_DMA_TX_CONTROL_RESUME_LSB) & MBOX2_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX2_DMA_TX_CONTROL_START_MSB 1 -#define MBOX2_DMA_TX_CONTROL_START_LSB 1 -#define MBOX2_DMA_TX_CONTROL_START_MASK 0x00000002 -#define MBOX2_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX2_DMA_TX_CONTROL_START_MASK) >> MBOX2_DMA_TX_CONTROL_START_LSB) -#define MBOX2_DMA_TX_CONTROL_START_SET(x) (((x) << MBOX2_DMA_TX_CONTROL_START_LSB) & MBOX2_DMA_TX_CONTROL_START_MASK) -#define MBOX2_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX2_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX2_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define MBOX2_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX2_DMA_TX_CONTROL_STOP_MASK) >> MBOX2_DMA_TX_CONTROL_STOP_LSB) -#define MBOX2_DMA_TX_CONTROL_STOP_SET(x) (((x) << MBOX2_DMA_TX_CONTROL_STOP_LSB) & MBOX2_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000048 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000048 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX3_DMA_RX_CONTROL_ADDRESS 0x0000004c -#define MBOX3_DMA_RX_CONTROL_OFFSET 0x0000004c -#define MBOX3_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX3_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX3_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX3_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX3_DMA_RX_CONTROL_RESUME_MASK) >> MBOX3_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX3_DMA_RX_CONTROL_RESUME_SET(x) (((x) << MBOX3_DMA_RX_CONTROL_RESUME_LSB) & MBOX3_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX3_DMA_RX_CONTROL_START_MSB 1 -#define MBOX3_DMA_RX_CONTROL_START_LSB 1 -#define MBOX3_DMA_RX_CONTROL_START_MASK 0x00000002 -#define MBOX3_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX3_DMA_RX_CONTROL_START_MASK) >> MBOX3_DMA_RX_CONTROL_START_LSB) -#define MBOX3_DMA_RX_CONTROL_START_SET(x) (((x) << MBOX3_DMA_RX_CONTROL_START_LSB) & MBOX3_DMA_RX_CONTROL_START_MASK) -#define MBOX3_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX3_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX3_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define MBOX3_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX3_DMA_RX_CONTROL_STOP_MASK) >> MBOX3_DMA_RX_CONTROL_STOP_LSB) -#define MBOX3_DMA_RX_CONTROL_STOP_SET(x) (((x) << MBOX3_DMA_RX_CONTROL_STOP_LSB) & MBOX3_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000050 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000050 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX3_DMA_TX_CONTROL_ADDRESS 0x00000054 -#define MBOX3_DMA_TX_CONTROL_OFFSET 0x00000054 -#define MBOX3_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX3_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX3_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX3_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX3_DMA_TX_CONTROL_RESUME_MASK) >> MBOX3_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX3_DMA_TX_CONTROL_RESUME_SET(x) (((x) << MBOX3_DMA_TX_CONTROL_RESUME_LSB) & MBOX3_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX3_DMA_TX_CONTROL_START_MSB 1 -#define MBOX3_DMA_TX_CONTROL_START_LSB 1 -#define MBOX3_DMA_TX_CONTROL_START_MASK 0x00000002 -#define MBOX3_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX3_DMA_TX_CONTROL_START_MASK) >> MBOX3_DMA_TX_CONTROL_START_LSB) -#define MBOX3_DMA_TX_CONTROL_START_SET(x) (((x) << MBOX3_DMA_TX_CONTROL_START_LSB) & MBOX3_DMA_TX_CONTROL_START_MASK) -#define MBOX3_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX3_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX3_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define MBOX3_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX3_DMA_TX_CONTROL_STOP_MASK) >> MBOX3_DMA_TX_CONTROL_STOP_LSB) -#define MBOX3_DMA_TX_CONTROL_STOP_SET(x) (((x) << MBOX3_DMA_TX_CONTROL_STOP_LSB) & MBOX3_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX_INT_STATUS_ADDRESS 0x00000058 -#define MBOX_INT_STATUS_OFFSET 0x00000058 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MSB 31 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB 28 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK 0xf0000000 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) >> MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) & MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB 27 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB 24 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK 0x0f000000 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) >> MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) (((x) << MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) & MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MSB 23 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB 20 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK 0x00f00000 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) >> MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) & MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) -#define MBOX_INT_STATUS_TX_OVERFLOW_MSB 17 -#define MBOX_INT_STATUS_TX_OVERFLOW_LSB 17 -#define MBOX_INT_STATUS_TX_OVERFLOW_MASK 0x00020000 -#define MBOX_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & MBOX_INT_STATUS_TX_OVERFLOW_MASK) >> MBOX_INT_STATUS_TX_OVERFLOW_LSB) -#define MBOX_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << MBOX_INT_STATUS_TX_OVERFLOW_LSB) & MBOX_INT_STATUS_TX_OVERFLOW_MASK) -#define MBOX_INT_STATUS_RX_UNDERFLOW_MSB 16 -#define MBOX_INT_STATUS_RX_UNDERFLOW_LSB 16 -#define MBOX_INT_STATUS_RX_UNDERFLOW_MASK 0x00010000 -#define MBOX_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & MBOX_INT_STATUS_RX_UNDERFLOW_MASK) >> MBOX_INT_STATUS_RX_UNDERFLOW_LSB) -#define MBOX_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << MBOX_INT_STATUS_RX_UNDERFLOW_LSB) & MBOX_INT_STATUS_RX_UNDERFLOW_MASK) -#define MBOX_INT_STATUS_TX_NOT_EMPTY_MSB 15 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_LSB 12 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_MASK 0x0000f000 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) (((x) & MBOX_INT_STATUS_TX_NOT_EMPTY_MASK) >> MBOX_INT_STATUS_TX_NOT_EMPTY_LSB) -#define MBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) (((x) << MBOX_INT_STATUS_TX_NOT_EMPTY_LSB) & MBOX_INT_STATUS_TX_NOT_EMPTY_MASK) -#define MBOX_INT_STATUS_RX_NOT_FULL_MSB 11 -#define MBOX_INT_STATUS_RX_NOT_FULL_LSB 8 -#define MBOX_INT_STATUS_RX_NOT_FULL_MASK 0x00000f00 -#define MBOX_INT_STATUS_RX_NOT_FULL_GET(x) (((x) & MBOX_INT_STATUS_RX_NOT_FULL_MASK) >> MBOX_INT_STATUS_RX_NOT_FULL_LSB) -#define MBOX_INT_STATUS_RX_NOT_FULL_SET(x) (((x) << MBOX_INT_STATUS_RX_NOT_FULL_LSB) & MBOX_INT_STATUS_RX_NOT_FULL_MASK) -#define MBOX_INT_STATUS_HOST_MSB 7 -#define MBOX_INT_STATUS_HOST_LSB 0 -#define MBOX_INT_STATUS_HOST_MASK 0x000000ff -#define MBOX_INT_STATUS_HOST_GET(x) (((x) & MBOX_INT_STATUS_HOST_MASK) >> MBOX_INT_STATUS_HOST_LSB) -#define MBOX_INT_STATUS_HOST_SET(x) (((x) << MBOX_INT_STATUS_HOST_LSB) & MBOX_INT_STATUS_HOST_MASK) - -#define MBOX_INT_ENABLE_ADDRESS 0x0000005c -#define MBOX_INT_ENABLE_OFFSET 0x0000005c -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB 31 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB 28 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK 0xf0000000 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) >> MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) & MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB 27 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB 24 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK 0x0f000000 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) >> MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) (((x) << MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) & MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB 23 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB 20 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK 0x00f00000 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) >> MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) & MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) -#define MBOX_INT_ENABLE_TX_OVERFLOW_MSB 17 -#define MBOX_INT_ENABLE_TX_OVERFLOW_LSB 17 -#define MBOX_INT_ENABLE_TX_OVERFLOW_MASK 0x00020000 -#define MBOX_INT_ENABLE_TX_OVERFLOW_GET(x) (((x) & MBOX_INT_ENABLE_TX_OVERFLOW_MASK) >> MBOX_INT_ENABLE_TX_OVERFLOW_LSB) -#define MBOX_INT_ENABLE_TX_OVERFLOW_SET(x) (((x) << MBOX_INT_ENABLE_TX_OVERFLOW_LSB) & MBOX_INT_ENABLE_TX_OVERFLOW_MASK) -#define MBOX_INT_ENABLE_RX_UNDERFLOW_MSB 16 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_LSB 16 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_MASK 0x00010000 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) (((x) & MBOX_INT_ENABLE_RX_UNDERFLOW_MASK) >> MBOX_INT_ENABLE_RX_UNDERFLOW_LSB) -#define MBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) (((x) << MBOX_INT_ENABLE_RX_UNDERFLOW_LSB) & MBOX_INT_ENABLE_RX_UNDERFLOW_MASK) -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MSB 15 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB 12 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK 0x0000f000 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) (((x) & MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) >> MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) (((x) << MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) & MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) -#define MBOX_INT_ENABLE_RX_NOT_FULL_MSB 11 -#define MBOX_INT_ENABLE_RX_NOT_FULL_LSB 8 -#define MBOX_INT_ENABLE_RX_NOT_FULL_MASK 0x00000f00 -#define MBOX_INT_ENABLE_RX_NOT_FULL_GET(x) (((x) & MBOX_INT_ENABLE_RX_NOT_FULL_MASK) >> MBOX_INT_ENABLE_RX_NOT_FULL_LSB) -#define MBOX_INT_ENABLE_RX_NOT_FULL_SET(x) (((x) << MBOX_INT_ENABLE_RX_NOT_FULL_LSB) & MBOX_INT_ENABLE_RX_NOT_FULL_MASK) -#define MBOX_INT_ENABLE_HOST_MSB 7 -#define MBOX_INT_ENABLE_HOST_LSB 0 -#define MBOX_INT_ENABLE_HOST_MASK 0x000000ff -#define MBOX_INT_ENABLE_HOST_GET(x) (((x) & MBOX_INT_ENABLE_HOST_MASK) >> MBOX_INT_ENABLE_HOST_LSB) -#define MBOX_INT_ENABLE_HOST_SET(x) (((x) << MBOX_INT_ENABLE_HOST_LSB) & MBOX_INT_ENABLE_HOST_MASK) - -#define INT_HOST_ADDRESS 0x00000060 -#define INT_HOST_OFFSET 0x00000060 -#define INT_HOST_VECTOR_MSB 7 -#define INT_HOST_VECTOR_LSB 0 -#define INT_HOST_VECTOR_MASK 0x000000ff -#define INT_HOST_VECTOR_GET(x) (((x) & INT_HOST_VECTOR_MASK) >> INT_HOST_VECTOR_LSB) -#define INT_HOST_VECTOR_SET(x) (((x) << INT_HOST_VECTOR_LSB) & INT_HOST_VECTOR_MASK) - -#define LOCAL_COUNT_ADDRESS 0x00000080 -#define LOCAL_COUNT_OFFSET 0x00000080 -#define LOCAL_COUNT_VALUE_MSB 7 -#define LOCAL_COUNT_VALUE_LSB 0 -#define LOCAL_COUNT_VALUE_MASK 0x000000ff -#define LOCAL_COUNT_VALUE_GET(x) (((x) & LOCAL_COUNT_VALUE_MASK) >> LOCAL_COUNT_VALUE_LSB) -#define LOCAL_COUNT_VALUE_SET(x) (((x) << LOCAL_COUNT_VALUE_LSB) & LOCAL_COUNT_VALUE_MASK) - -#define COUNT_INC_ADDRESS 0x000000a0 -#define COUNT_INC_OFFSET 0x000000a0 -#define COUNT_INC_VALUE_MSB 7 -#define COUNT_INC_VALUE_LSB 0 -#define COUNT_INC_VALUE_MASK 0x000000ff -#define COUNT_INC_VALUE_GET(x) (((x) & COUNT_INC_VALUE_MASK) >> COUNT_INC_VALUE_LSB) -#define COUNT_INC_VALUE_SET(x) (((x) << COUNT_INC_VALUE_LSB) & COUNT_INC_VALUE_MASK) - -#define LOCAL_SCRATCH_ADDRESS 0x000000c0 -#define LOCAL_SCRATCH_OFFSET 0x000000c0 -#define LOCAL_SCRATCH_VALUE_MSB 7 -#define LOCAL_SCRATCH_VALUE_LSB 0 -#define LOCAL_SCRATCH_VALUE_MASK 0x000000ff -#define LOCAL_SCRATCH_VALUE_GET(x) (((x) & LOCAL_SCRATCH_VALUE_MASK) >> LOCAL_SCRATCH_VALUE_LSB) -#define LOCAL_SCRATCH_VALUE_SET(x) (((x) << LOCAL_SCRATCH_VALUE_LSB) & LOCAL_SCRATCH_VALUE_MASK) - -#define USE_LOCAL_BUS_ADDRESS 0x000000e0 -#define USE_LOCAL_BUS_OFFSET 0x000000e0 -#define USE_LOCAL_BUS_PIN_INIT_MSB 0 -#define USE_LOCAL_BUS_PIN_INIT_LSB 0 -#define USE_LOCAL_BUS_PIN_INIT_MASK 0x00000001 -#define USE_LOCAL_BUS_PIN_INIT_GET(x) (((x) & USE_LOCAL_BUS_PIN_INIT_MASK) >> USE_LOCAL_BUS_PIN_INIT_LSB) -#define USE_LOCAL_BUS_PIN_INIT_SET(x) (((x) << USE_LOCAL_BUS_PIN_INIT_LSB) & USE_LOCAL_BUS_PIN_INIT_MASK) - -#define SDIO_CONFIG_ADDRESS 0x000000e4 -#define SDIO_CONFIG_OFFSET 0x000000e4 -#define SDIO_CONFIG_CCCR_IOR1_MSB 0 -#define SDIO_CONFIG_CCCR_IOR1_LSB 0 -#define SDIO_CONFIG_CCCR_IOR1_MASK 0x00000001 -#define SDIO_CONFIG_CCCR_IOR1_GET(x) (((x) & SDIO_CONFIG_CCCR_IOR1_MASK) >> SDIO_CONFIG_CCCR_IOR1_LSB) -#define SDIO_CONFIG_CCCR_IOR1_SET(x) (((x) << SDIO_CONFIG_CCCR_IOR1_LSB) & SDIO_CONFIG_CCCR_IOR1_MASK) - -#define MBOX_DEBUG_ADDRESS 0x000000e8 -#define MBOX_DEBUG_OFFSET 0x000000e8 -#define MBOX_DEBUG_SEL_MSB 2 -#define MBOX_DEBUG_SEL_LSB 0 -#define MBOX_DEBUG_SEL_MASK 0x00000007 -#define MBOX_DEBUG_SEL_GET(x) (((x) & MBOX_DEBUG_SEL_MASK) >> MBOX_DEBUG_SEL_LSB) -#define MBOX_DEBUG_SEL_SET(x) (((x) << MBOX_DEBUG_SEL_LSB) & MBOX_DEBUG_SEL_MASK) - -#define MBOX_FIFO_RESET_ADDRESS 0x000000ec -#define MBOX_FIFO_RESET_OFFSET 0x000000ec -#define MBOX_FIFO_RESET_INIT_MSB 0 -#define MBOX_FIFO_RESET_INIT_LSB 0 -#define MBOX_FIFO_RESET_INIT_MASK 0x00000001 -#define MBOX_FIFO_RESET_INIT_GET(x) (((x) & MBOX_FIFO_RESET_INIT_MASK) >> MBOX_FIFO_RESET_INIT_LSB) -#define MBOX_FIFO_RESET_INIT_SET(x) (((x) << MBOX_FIFO_RESET_INIT_LSB) & MBOX_FIFO_RESET_INIT_MASK) - -#define MBOX_TXFIFO_POP_ADDRESS 0x000000f0 -#define MBOX_TXFIFO_POP_OFFSET 0x000000f0 -#define MBOX_TXFIFO_POP_DATA_MSB 0 -#define MBOX_TXFIFO_POP_DATA_LSB 0 -#define MBOX_TXFIFO_POP_DATA_MASK 0x00000001 -#define MBOX_TXFIFO_POP_DATA_GET(x) (((x) & MBOX_TXFIFO_POP_DATA_MASK) >> MBOX_TXFIFO_POP_DATA_LSB) -#define MBOX_TXFIFO_POP_DATA_SET(x) (((x) << MBOX_TXFIFO_POP_DATA_LSB) & MBOX_TXFIFO_POP_DATA_MASK) - -#define MBOX_RXFIFO_POP_ADDRESS 0x00000100 -#define MBOX_RXFIFO_POP_OFFSET 0x00000100 -#define MBOX_RXFIFO_POP_DATA_MSB 0 -#define MBOX_RXFIFO_POP_DATA_LSB 0 -#define MBOX_RXFIFO_POP_DATA_MASK 0x00000001 -#define MBOX_RXFIFO_POP_DATA_GET(x) (((x) & MBOX_RXFIFO_POP_DATA_MASK) >> MBOX_RXFIFO_POP_DATA_LSB) -#define MBOX_RXFIFO_POP_DATA_SET(x) (((x) << MBOX_RXFIFO_POP_DATA_LSB) & MBOX_RXFIFO_POP_DATA_MASK) - -#define SDIO_DEBUG_ADDRESS 0x00000110 -#define SDIO_DEBUG_OFFSET 0x00000110 -#define SDIO_DEBUG_SEL_MSB 3 -#define SDIO_DEBUG_SEL_LSB 0 -#define SDIO_DEBUG_SEL_MASK 0x0000000f -#define SDIO_DEBUG_SEL_GET(x) (((x) & SDIO_DEBUG_SEL_MASK) >> SDIO_DEBUG_SEL_LSB) -#define SDIO_DEBUG_SEL_SET(x) (((x) << SDIO_DEBUG_SEL_LSB) & SDIO_DEBUG_SEL_MASK) - -#define HOST_IF_WINDOW_ADDRESS 0x00002000 -#define HOST_IF_WINDOW_OFFSET 0x00002000 -#define HOST_IF_WINDOW_DATA_MSB 7 -#define HOST_IF_WINDOW_DATA_LSB 0 -#define HOST_IF_WINDOW_DATA_MASK 0x000000ff -#define HOST_IF_WINDOW_DATA_GET(x) (((x) & HOST_IF_WINDOW_DATA_MASK) >> HOST_IF_WINDOW_DATA_LSB) -#define HOST_IF_WINDOW_DATA_SET(x) (((x) << HOST_IF_WINDOW_DATA_LSB) & HOST_IF_WINDOW_DATA_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct mbox_reg_reg_s { - volatile unsigned int mbox_fifo[4]; - volatile unsigned int mbox_fifo_status; - volatile unsigned int mbox_dma_policy; - volatile unsigned int mbox0_dma_rx_descriptor_base; - volatile unsigned int mbox0_dma_rx_control; - volatile unsigned int mbox0_dma_tx_descriptor_base; - volatile unsigned int mbox0_dma_tx_control; - volatile unsigned int mbox1_dma_rx_descriptor_base; - volatile unsigned int mbox1_dma_rx_control; - volatile unsigned int mbox1_dma_tx_descriptor_base; - volatile unsigned int mbox1_dma_tx_control; - volatile unsigned int mbox2_dma_rx_descriptor_base; - volatile unsigned int mbox2_dma_rx_control; - volatile unsigned int mbox2_dma_tx_descriptor_base; - volatile unsigned int mbox2_dma_tx_control; - volatile unsigned int mbox3_dma_rx_descriptor_base; - volatile unsigned int mbox3_dma_rx_control; - volatile unsigned int mbox3_dma_tx_descriptor_base; - volatile unsigned int mbox3_dma_tx_control; - volatile unsigned int mbox_int_status; - volatile unsigned int mbox_int_enable; - volatile unsigned int int_host; - unsigned char pad0[28]; /* pad to 0x80 */ - volatile unsigned int local_count[8]; - volatile unsigned int count_inc[8]; - volatile unsigned int local_scratch[8]; - volatile unsigned int use_local_bus; - volatile unsigned int sdio_config; - volatile unsigned int mbox_debug; - volatile unsigned int mbox_fifo_reset; - volatile unsigned int mbox_txfifo_pop[4]; - volatile unsigned int mbox_rxfifo_pop[4]; - volatile unsigned int sdio_debug; - unsigned char pad1[7916]; /* pad to 0x2000 */ - volatile unsigned int host_if_window[2048]; -} mbox_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _MBOX_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/mbox_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/mbox_reg.vrh deleted file mode 100644 index a6d23e84b9a4..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/mbox_reg.vrh +++ /dev/null @@ -1,746 +0,0 @@ -#ifndef _MBOX_REG_VRH_ -#define _MBOX_REG_VRH_ - -#define MBOX_FIFO_ADDRESS 'h00000000 -#define MBOX_FIFO_DATA_MSB 19 -#define MBOX_FIFO_DATA_LSB 0 -#define MBOX_FIFO_DATA_MASK 'h000fffff -#define MBOX_FIFO_DATA_GET(x) (((x) & MBOX_FIFO_DATA_MASK) >> MBOX_FIFO_DATA_LSB) -#define MBOX_FIFO_DATA_SET(x) (((32'd0 | (x)) << MBOX_FIFO_DATA_LSB) & MBOX_FIFO_DATA_MASK) -#define MBOX_FIFO_DATA_RESET 20'h0 -#define MBOX_FIFO_RESET (32'h0 | \ - MBOX_FIFO_DATA_SET(MBOX_FIFO_DATA_RESET)) -#define MBOX_FIFO_HW_MASK (32'h0 | \ - MBOX_FIFO_DATA_MASK) -#define MBOX_FIFO_SW_MASK (32'h0 | \ - MBOX_FIFO_DATA_MASK) - -#define MBOX_FIFO_STATUS_ADDRESS 'h00000010 -#define MBOX_FIFO_STATUS_EMPTY_MSB 19 -#define MBOX_FIFO_STATUS_EMPTY_LSB 16 -#define MBOX_FIFO_STATUS_EMPTY_MASK 'h000f0000 -#define MBOX_FIFO_STATUS_EMPTY_GET(x) (((x) & MBOX_FIFO_STATUS_EMPTY_MASK) >> MBOX_FIFO_STATUS_EMPTY_LSB) -#define MBOX_FIFO_STATUS_EMPTY_SET(x) (((32'd0 | (x)) << MBOX_FIFO_STATUS_EMPTY_LSB) & MBOX_FIFO_STATUS_EMPTY_MASK) -#define MBOX_FIFO_STATUS_EMPTY_RESET 4'hf -#define MBOX_FIFO_STATUS_FULL_MSB 15 -#define MBOX_FIFO_STATUS_FULL_LSB 12 -#define MBOX_FIFO_STATUS_FULL_MASK 'h0000f000 -#define MBOX_FIFO_STATUS_FULL_GET(x) (((x) & MBOX_FIFO_STATUS_FULL_MASK) >> MBOX_FIFO_STATUS_FULL_LSB) -#define MBOX_FIFO_STATUS_FULL_SET(x) (((32'd0 | (x)) << MBOX_FIFO_STATUS_FULL_LSB) & MBOX_FIFO_STATUS_FULL_MASK) -#define MBOX_FIFO_STATUS_FULL_RESET 4'h0 -#define MBOX_FIFO_STATUS_RESET (32'h0 | \ - MBOX_FIFO_STATUS_EMPTY_SET(MBOX_FIFO_STATUS_EMPTY_RESET) | \ - MBOX_FIFO_STATUS_FULL_SET(MBOX_FIFO_STATUS_FULL_RESET)) -#define MBOX_FIFO_STATUS_HW_MASK (32'h0 | \ - MBOX_FIFO_STATUS_EMPTY_MASK | \ - MBOX_FIFO_STATUS_FULL_MASK) -#define MBOX_FIFO_STATUS_SW_MASK (32'h0) - -#define MBOX_DMA_POLICY_ADDRESS 'h00000014 -#define MBOX_DMA_POLICY_TX_QUANTUM_MSB 3 -#define MBOX_DMA_POLICY_TX_QUANTUM_LSB 3 -#define MBOX_DMA_POLICY_TX_QUANTUM_MASK 'h00000008 -#define MBOX_DMA_POLICY_TX_QUANTUM_GET(x) (((x) & MBOX_DMA_POLICY_TX_QUANTUM_MASK) >> MBOX_DMA_POLICY_TX_QUANTUM_LSB) -#define MBOX_DMA_POLICY_TX_QUANTUM_SET(x) (((32'd0 | (x)) << MBOX_DMA_POLICY_TX_QUANTUM_LSB) & MBOX_DMA_POLICY_TX_QUANTUM_MASK) -#define MBOX_DMA_POLICY_TX_QUANTUM_RESET 1'h0 -#define MBOX_DMA_POLICY_TX_ORDER_MSB 2 -#define MBOX_DMA_POLICY_TX_ORDER_LSB 2 -#define MBOX_DMA_POLICY_TX_ORDER_MASK 'h00000004 -#define MBOX_DMA_POLICY_TX_ORDER_GET(x) (((x) & MBOX_DMA_POLICY_TX_ORDER_MASK) >> MBOX_DMA_POLICY_TX_ORDER_LSB) -#define MBOX_DMA_POLICY_TX_ORDER_SET(x) (((32'd0 | (x)) << MBOX_DMA_POLICY_TX_ORDER_LSB) & MBOX_DMA_POLICY_TX_ORDER_MASK) -#define MBOX_DMA_POLICY_TX_ORDER_RESET 1'h0 -#define MBOX_DMA_POLICY_RX_QUANTUM_MSB 1 -#define MBOX_DMA_POLICY_RX_QUANTUM_LSB 1 -#define MBOX_DMA_POLICY_RX_QUANTUM_MASK 'h00000002 -#define MBOX_DMA_POLICY_RX_QUANTUM_GET(x) (((x) & MBOX_DMA_POLICY_RX_QUANTUM_MASK) >> MBOX_DMA_POLICY_RX_QUANTUM_LSB) -#define MBOX_DMA_POLICY_RX_QUANTUM_SET(x) (((32'd0 | (x)) << MBOX_DMA_POLICY_RX_QUANTUM_LSB) & MBOX_DMA_POLICY_RX_QUANTUM_MASK) -#define MBOX_DMA_POLICY_RX_QUANTUM_RESET 1'h0 -#define MBOX_DMA_POLICY_RX_ORDER_MSB 0 -#define MBOX_DMA_POLICY_RX_ORDER_LSB 0 -#define MBOX_DMA_POLICY_RX_ORDER_MASK 'h00000001 -#define MBOX_DMA_POLICY_RX_ORDER_GET(x) (((x) & MBOX_DMA_POLICY_RX_ORDER_MASK) >> MBOX_DMA_POLICY_RX_ORDER_LSB) -#define MBOX_DMA_POLICY_RX_ORDER_SET(x) (((32'd0 | (x)) << MBOX_DMA_POLICY_RX_ORDER_LSB) & MBOX_DMA_POLICY_RX_ORDER_MASK) -#define MBOX_DMA_POLICY_RX_ORDER_RESET 1'h0 -#define MBOX_DMA_POLICY_RESET (32'h0 | \ - MBOX_DMA_POLICY_TX_QUANTUM_SET(MBOX_DMA_POLICY_TX_QUANTUM_RESET) | \ - MBOX_DMA_POLICY_TX_ORDER_SET(MBOX_DMA_POLICY_TX_ORDER_RESET) | \ - MBOX_DMA_POLICY_RX_QUANTUM_SET(MBOX_DMA_POLICY_RX_QUANTUM_RESET) | \ - MBOX_DMA_POLICY_RX_ORDER_SET(MBOX_DMA_POLICY_RX_ORDER_RESET)) -#define MBOX_DMA_POLICY_HW_MASK (32'h0) -#define MBOX_DMA_POLICY_SW_MASK (32'h0 | \ - MBOX_DMA_POLICY_TX_QUANTUM_MASK | \ - MBOX_DMA_POLICY_TX_ORDER_MASK | \ - MBOX_DMA_POLICY_RX_QUANTUM_MASK | \ - MBOX_DMA_POLICY_RX_ORDER_MASK) - -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS 'h00000018 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX0_DMA_RX_CONTROL_ADDRESS 'h0000001c -#define MBOX0_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX0_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX0_DMA_RX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX0_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_RESUME_MASK) >> MBOX0_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX0_DMA_RX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX0_DMA_RX_CONTROL_RESUME_LSB) & MBOX0_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX0_DMA_RX_CONTROL_RESUME_RESET 1'h0 -#define MBOX0_DMA_RX_CONTROL_START_MSB 1 -#define MBOX0_DMA_RX_CONTROL_START_LSB 1 -#define MBOX0_DMA_RX_CONTROL_START_MASK 'h00000002 -#define MBOX0_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_START_MASK) >> MBOX0_DMA_RX_CONTROL_START_LSB) -#define MBOX0_DMA_RX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX0_DMA_RX_CONTROL_START_LSB) & MBOX0_DMA_RX_CONTROL_START_MASK) -#define MBOX0_DMA_RX_CONTROL_START_RESET 1'h0 -#define MBOX0_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX0_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX0_DMA_RX_CONTROL_STOP_MASK 'h00000001 -#define MBOX0_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_STOP_MASK) >> MBOX0_DMA_RX_CONTROL_STOP_LSB) -#define MBOX0_DMA_RX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX0_DMA_RX_CONTROL_STOP_LSB) & MBOX0_DMA_RX_CONTROL_STOP_MASK) -#define MBOX0_DMA_RX_CONTROL_STOP_RESET 1'h0 -#define MBOX0_DMA_RX_CONTROL_RESET (32'h0 | \ - MBOX0_DMA_RX_CONTROL_RESUME_SET(MBOX0_DMA_RX_CONTROL_RESUME_RESET) | \ - MBOX0_DMA_RX_CONTROL_START_SET(MBOX0_DMA_RX_CONTROL_START_RESET) | \ - MBOX0_DMA_RX_CONTROL_STOP_SET(MBOX0_DMA_RX_CONTROL_STOP_RESET)) -#define MBOX0_DMA_RX_CONTROL_HW_MASK (32'h0 | \ - MBOX0_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX0_DMA_RX_CONTROL_START_MASK | \ - MBOX0_DMA_RX_CONTROL_STOP_MASK) -#define MBOX0_DMA_RX_CONTROL_SW_MASK (32'h0 | \ - MBOX0_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX0_DMA_RX_CONTROL_START_MASK | \ - MBOX0_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS 'h00000020 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX0_DMA_TX_CONTROL_ADDRESS 'h00000024 -#define MBOX0_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX0_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX0_DMA_TX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX0_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_RESUME_MASK) >> MBOX0_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX0_DMA_TX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX0_DMA_TX_CONTROL_RESUME_LSB) & MBOX0_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX0_DMA_TX_CONTROL_RESUME_RESET 1'h0 -#define MBOX0_DMA_TX_CONTROL_START_MSB 1 -#define MBOX0_DMA_TX_CONTROL_START_LSB 1 -#define MBOX0_DMA_TX_CONTROL_START_MASK 'h00000002 -#define MBOX0_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_START_MASK) >> MBOX0_DMA_TX_CONTROL_START_LSB) -#define MBOX0_DMA_TX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX0_DMA_TX_CONTROL_START_LSB) & MBOX0_DMA_TX_CONTROL_START_MASK) -#define MBOX0_DMA_TX_CONTROL_START_RESET 1'h0 -#define MBOX0_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX0_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX0_DMA_TX_CONTROL_STOP_MASK 'h00000001 -#define MBOX0_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_STOP_MASK) >> MBOX0_DMA_TX_CONTROL_STOP_LSB) -#define MBOX0_DMA_TX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX0_DMA_TX_CONTROL_STOP_LSB) & MBOX0_DMA_TX_CONTROL_STOP_MASK) -#define MBOX0_DMA_TX_CONTROL_STOP_RESET 1'h0 -#define MBOX0_DMA_TX_CONTROL_RESET (32'h0 | \ - MBOX0_DMA_TX_CONTROL_RESUME_SET(MBOX0_DMA_TX_CONTROL_RESUME_RESET) | \ - MBOX0_DMA_TX_CONTROL_START_SET(MBOX0_DMA_TX_CONTROL_START_RESET) | \ - MBOX0_DMA_TX_CONTROL_STOP_SET(MBOX0_DMA_TX_CONTROL_STOP_RESET)) -#define MBOX0_DMA_TX_CONTROL_HW_MASK (32'h0 | \ - MBOX0_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX0_DMA_TX_CONTROL_START_MASK | \ - MBOX0_DMA_TX_CONTROL_STOP_MASK) -#define MBOX0_DMA_TX_CONTROL_SW_MASK (32'h0 | \ - MBOX0_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX0_DMA_TX_CONTROL_START_MASK | \ - MBOX0_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS 'h00000028 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX1_DMA_RX_CONTROL_ADDRESS 'h0000002c -#define MBOX1_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX1_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX1_DMA_RX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX1_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX1_DMA_RX_CONTROL_RESUME_MASK) >> MBOX1_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX1_DMA_RX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX1_DMA_RX_CONTROL_RESUME_LSB) & MBOX1_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX1_DMA_RX_CONTROL_RESUME_RESET 1'h0 -#define MBOX1_DMA_RX_CONTROL_START_MSB 1 -#define MBOX1_DMA_RX_CONTROL_START_LSB 1 -#define MBOX1_DMA_RX_CONTROL_START_MASK 'h00000002 -#define MBOX1_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX1_DMA_RX_CONTROL_START_MASK) >> MBOX1_DMA_RX_CONTROL_START_LSB) -#define MBOX1_DMA_RX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX1_DMA_RX_CONTROL_START_LSB) & MBOX1_DMA_RX_CONTROL_START_MASK) -#define MBOX1_DMA_RX_CONTROL_START_RESET 1'h0 -#define MBOX1_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX1_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX1_DMA_RX_CONTROL_STOP_MASK 'h00000001 -#define MBOX1_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX1_DMA_RX_CONTROL_STOP_MASK) >> MBOX1_DMA_RX_CONTROL_STOP_LSB) -#define MBOX1_DMA_RX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX1_DMA_RX_CONTROL_STOP_LSB) & MBOX1_DMA_RX_CONTROL_STOP_MASK) -#define MBOX1_DMA_RX_CONTROL_STOP_RESET 1'h0 -#define MBOX1_DMA_RX_CONTROL_RESET (32'h0 | \ - MBOX1_DMA_RX_CONTROL_RESUME_SET(MBOX1_DMA_RX_CONTROL_RESUME_RESET) | \ - MBOX1_DMA_RX_CONTROL_START_SET(MBOX1_DMA_RX_CONTROL_START_RESET) | \ - MBOX1_DMA_RX_CONTROL_STOP_SET(MBOX1_DMA_RX_CONTROL_STOP_RESET)) -#define MBOX1_DMA_RX_CONTROL_HW_MASK (32'h0 | \ - MBOX1_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX1_DMA_RX_CONTROL_START_MASK | \ - MBOX1_DMA_RX_CONTROL_STOP_MASK) -#define MBOX1_DMA_RX_CONTROL_SW_MASK (32'h0 | \ - MBOX1_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX1_DMA_RX_CONTROL_START_MASK | \ - MBOX1_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS 'h00000030 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX1_DMA_TX_CONTROL_ADDRESS 'h00000034 -#define MBOX1_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX1_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX1_DMA_TX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX1_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX1_DMA_TX_CONTROL_RESUME_MASK) >> MBOX1_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX1_DMA_TX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX1_DMA_TX_CONTROL_RESUME_LSB) & MBOX1_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX1_DMA_TX_CONTROL_RESUME_RESET 1'h0 -#define MBOX1_DMA_TX_CONTROL_START_MSB 1 -#define MBOX1_DMA_TX_CONTROL_START_LSB 1 -#define MBOX1_DMA_TX_CONTROL_START_MASK 'h00000002 -#define MBOX1_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX1_DMA_TX_CONTROL_START_MASK) >> MBOX1_DMA_TX_CONTROL_START_LSB) -#define MBOX1_DMA_TX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX1_DMA_TX_CONTROL_START_LSB) & MBOX1_DMA_TX_CONTROL_START_MASK) -#define MBOX1_DMA_TX_CONTROL_START_RESET 1'h0 -#define MBOX1_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX1_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX1_DMA_TX_CONTROL_STOP_MASK 'h00000001 -#define MBOX1_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX1_DMA_TX_CONTROL_STOP_MASK) >> MBOX1_DMA_TX_CONTROL_STOP_LSB) -#define MBOX1_DMA_TX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX1_DMA_TX_CONTROL_STOP_LSB) & MBOX1_DMA_TX_CONTROL_STOP_MASK) -#define MBOX1_DMA_TX_CONTROL_STOP_RESET 1'h0 -#define MBOX1_DMA_TX_CONTROL_RESET (32'h0 | \ - MBOX1_DMA_TX_CONTROL_RESUME_SET(MBOX1_DMA_TX_CONTROL_RESUME_RESET) | \ - MBOX1_DMA_TX_CONTROL_START_SET(MBOX1_DMA_TX_CONTROL_START_RESET) | \ - MBOX1_DMA_TX_CONTROL_STOP_SET(MBOX1_DMA_TX_CONTROL_STOP_RESET)) -#define MBOX1_DMA_TX_CONTROL_HW_MASK (32'h0 | \ - MBOX1_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX1_DMA_TX_CONTROL_START_MASK | \ - MBOX1_DMA_TX_CONTROL_STOP_MASK) -#define MBOX1_DMA_TX_CONTROL_SW_MASK (32'h0 | \ - MBOX1_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX1_DMA_TX_CONTROL_START_MASK | \ - MBOX1_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS 'h00000038 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX2_DMA_RX_CONTROL_ADDRESS 'h0000003c -#define MBOX2_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX2_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX2_DMA_RX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX2_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX2_DMA_RX_CONTROL_RESUME_MASK) >> MBOX2_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX2_DMA_RX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX2_DMA_RX_CONTROL_RESUME_LSB) & MBOX2_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX2_DMA_RX_CONTROL_RESUME_RESET 1'h0 -#define MBOX2_DMA_RX_CONTROL_START_MSB 1 -#define MBOX2_DMA_RX_CONTROL_START_LSB 1 -#define MBOX2_DMA_RX_CONTROL_START_MASK 'h00000002 -#define MBOX2_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX2_DMA_RX_CONTROL_START_MASK) >> MBOX2_DMA_RX_CONTROL_START_LSB) -#define MBOX2_DMA_RX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX2_DMA_RX_CONTROL_START_LSB) & MBOX2_DMA_RX_CONTROL_START_MASK) -#define MBOX2_DMA_RX_CONTROL_START_RESET 1'h0 -#define MBOX2_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX2_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX2_DMA_RX_CONTROL_STOP_MASK 'h00000001 -#define MBOX2_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX2_DMA_RX_CONTROL_STOP_MASK) >> MBOX2_DMA_RX_CONTROL_STOP_LSB) -#define MBOX2_DMA_RX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX2_DMA_RX_CONTROL_STOP_LSB) & MBOX2_DMA_RX_CONTROL_STOP_MASK) -#define MBOX2_DMA_RX_CONTROL_STOP_RESET 1'h0 -#define MBOX2_DMA_RX_CONTROL_RESET (32'h0 | \ - MBOX2_DMA_RX_CONTROL_RESUME_SET(MBOX2_DMA_RX_CONTROL_RESUME_RESET) | \ - MBOX2_DMA_RX_CONTROL_START_SET(MBOX2_DMA_RX_CONTROL_START_RESET) | \ - MBOX2_DMA_RX_CONTROL_STOP_SET(MBOX2_DMA_RX_CONTROL_STOP_RESET)) -#define MBOX2_DMA_RX_CONTROL_HW_MASK (32'h0 | \ - MBOX2_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX2_DMA_RX_CONTROL_START_MASK | \ - MBOX2_DMA_RX_CONTROL_STOP_MASK) -#define MBOX2_DMA_RX_CONTROL_SW_MASK (32'h0 | \ - MBOX2_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX2_DMA_RX_CONTROL_START_MASK | \ - MBOX2_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS 'h00000040 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX2_DMA_TX_CONTROL_ADDRESS 'h00000044 -#define MBOX2_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX2_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX2_DMA_TX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX2_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX2_DMA_TX_CONTROL_RESUME_MASK) >> MBOX2_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX2_DMA_TX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX2_DMA_TX_CONTROL_RESUME_LSB) & MBOX2_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX2_DMA_TX_CONTROL_RESUME_RESET 1'h0 -#define MBOX2_DMA_TX_CONTROL_START_MSB 1 -#define MBOX2_DMA_TX_CONTROL_START_LSB 1 -#define MBOX2_DMA_TX_CONTROL_START_MASK 'h00000002 -#define MBOX2_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX2_DMA_TX_CONTROL_START_MASK) >> MBOX2_DMA_TX_CONTROL_START_LSB) -#define MBOX2_DMA_TX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX2_DMA_TX_CONTROL_START_LSB) & MBOX2_DMA_TX_CONTROL_START_MASK) -#define MBOX2_DMA_TX_CONTROL_START_RESET 1'h0 -#define MBOX2_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX2_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX2_DMA_TX_CONTROL_STOP_MASK 'h00000001 -#define MBOX2_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX2_DMA_TX_CONTROL_STOP_MASK) >> MBOX2_DMA_TX_CONTROL_STOP_LSB) -#define MBOX2_DMA_TX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX2_DMA_TX_CONTROL_STOP_LSB) & MBOX2_DMA_TX_CONTROL_STOP_MASK) -#define MBOX2_DMA_TX_CONTROL_STOP_RESET 1'h0 -#define MBOX2_DMA_TX_CONTROL_RESET (32'h0 | \ - MBOX2_DMA_TX_CONTROL_RESUME_SET(MBOX2_DMA_TX_CONTROL_RESUME_RESET) | \ - MBOX2_DMA_TX_CONTROL_START_SET(MBOX2_DMA_TX_CONTROL_START_RESET) | \ - MBOX2_DMA_TX_CONTROL_STOP_SET(MBOX2_DMA_TX_CONTROL_STOP_RESET)) -#define MBOX2_DMA_TX_CONTROL_HW_MASK (32'h0 | \ - MBOX2_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX2_DMA_TX_CONTROL_START_MASK | \ - MBOX2_DMA_TX_CONTROL_STOP_MASK) -#define MBOX2_DMA_TX_CONTROL_SW_MASK (32'h0 | \ - MBOX2_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX2_DMA_TX_CONTROL_START_MASK | \ - MBOX2_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS 'h00000048 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX3_DMA_RX_CONTROL_ADDRESS 'h0000004c -#define MBOX3_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX3_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX3_DMA_RX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX3_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX3_DMA_RX_CONTROL_RESUME_MASK) >> MBOX3_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX3_DMA_RX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX3_DMA_RX_CONTROL_RESUME_LSB) & MBOX3_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX3_DMA_RX_CONTROL_RESUME_RESET 1'h0 -#define MBOX3_DMA_RX_CONTROL_START_MSB 1 -#define MBOX3_DMA_RX_CONTROL_START_LSB 1 -#define MBOX3_DMA_RX_CONTROL_START_MASK 'h00000002 -#define MBOX3_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX3_DMA_RX_CONTROL_START_MASK) >> MBOX3_DMA_RX_CONTROL_START_LSB) -#define MBOX3_DMA_RX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX3_DMA_RX_CONTROL_START_LSB) & MBOX3_DMA_RX_CONTROL_START_MASK) -#define MBOX3_DMA_RX_CONTROL_START_RESET 1'h0 -#define MBOX3_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX3_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX3_DMA_RX_CONTROL_STOP_MASK 'h00000001 -#define MBOX3_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX3_DMA_RX_CONTROL_STOP_MASK) >> MBOX3_DMA_RX_CONTROL_STOP_LSB) -#define MBOX3_DMA_RX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX3_DMA_RX_CONTROL_STOP_LSB) & MBOX3_DMA_RX_CONTROL_STOP_MASK) -#define MBOX3_DMA_RX_CONTROL_STOP_RESET 1'h0 -#define MBOX3_DMA_RX_CONTROL_RESET (32'h0 | \ - MBOX3_DMA_RX_CONTROL_RESUME_SET(MBOX3_DMA_RX_CONTROL_RESUME_RESET) | \ - MBOX3_DMA_RX_CONTROL_START_SET(MBOX3_DMA_RX_CONTROL_START_RESET) | \ - MBOX3_DMA_RX_CONTROL_STOP_SET(MBOX3_DMA_RX_CONTROL_STOP_RESET)) -#define MBOX3_DMA_RX_CONTROL_HW_MASK (32'h0 | \ - MBOX3_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX3_DMA_RX_CONTROL_START_MASK | \ - MBOX3_DMA_RX_CONTROL_STOP_MASK) -#define MBOX3_DMA_RX_CONTROL_SW_MASK (32'h0 | \ - MBOX3_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX3_DMA_RX_CONTROL_START_MASK | \ - MBOX3_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS 'h00000050 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX3_DMA_TX_CONTROL_ADDRESS 'h00000054 -#define MBOX3_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX3_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX3_DMA_TX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX3_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX3_DMA_TX_CONTROL_RESUME_MASK) >> MBOX3_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX3_DMA_TX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX3_DMA_TX_CONTROL_RESUME_LSB) & MBOX3_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX3_DMA_TX_CONTROL_RESUME_RESET 1'h0 -#define MBOX3_DMA_TX_CONTROL_START_MSB 1 -#define MBOX3_DMA_TX_CONTROL_START_LSB 1 -#define MBOX3_DMA_TX_CONTROL_START_MASK 'h00000002 -#define MBOX3_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX3_DMA_TX_CONTROL_START_MASK) >> MBOX3_DMA_TX_CONTROL_START_LSB) -#define MBOX3_DMA_TX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX3_DMA_TX_CONTROL_START_LSB) & MBOX3_DMA_TX_CONTROL_START_MASK) -#define MBOX3_DMA_TX_CONTROL_START_RESET 1'h0 -#define MBOX3_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX3_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX3_DMA_TX_CONTROL_STOP_MASK 'h00000001 -#define MBOX3_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX3_DMA_TX_CONTROL_STOP_MASK) >> MBOX3_DMA_TX_CONTROL_STOP_LSB) -#define MBOX3_DMA_TX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX3_DMA_TX_CONTROL_STOP_LSB) & MBOX3_DMA_TX_CONTROL_STOP_MASK) -#define MBOX3_DMA_TX_CONTROL_STOP_RESET 1'h0 -#define MBOX3_DMA_TX_CONTROL_RESET (32'h0 | \ - MBOX3_DMA_TX_CONTROL_RESUME_SET(MBOX3_DMA_TX_CONTROL_RESUME_RESET) | \ - MBOX3_DMA_TX_CONTROL_START_SET(MBOX3_DMA_TX_CONTROL_START_RESET) | \ - MBOX3_DMA_TX_CONTROL_STOP_SET(MBOX3_DMA_TX_CONTROL_STOP_RESET)) -#define MBOX3_DMA_TX_CONTROL_HW_MASK (32'h0 | \ - MBOX3_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX3_DMA_TX_CONTROL_START_MASK | \ - MBOX3_DMA_TX_CONTROL_STOP_MASK) -#define MBOX3_DMA_TX_CONTROL_SW_MASK (32'h0 | \ - MBOX3_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX3_DMA_TX_CONTROL_START_MASK | \ - MBOX3_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX_INT_STATUS_ADDRESS 'h00000058 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MSB 31 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB 28 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK 'hf0000000 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) >> MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) & MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_RESET 4'h0 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB 27 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB 24 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK 'h0f000000 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) >> MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) & MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_RESET 4'h0 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MSB 23 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB 20 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK 'h00f00000 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) >> MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) & MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_RESET 4'h0 -#define MBOX_INT_STATUS_TX_OVERFLOW_MSB 17 -#define MBOX_INT_STATUS_TX_OVERFLOW_LSB 17 -#define MBOX_INT_STATUS_TX_OVERFLOW_MASK 'h00020000 -#define MBOX_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & MBOX_INT_STATUS_TX_OVERFLOW_MASK) >> MBOX_INT_STATUS_TX_OVERFLOW_LSB) -#define MBOX_INT_STATUS_TX_OVERFLOW_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_TX_OVERFLOW_LSB) & MBOX_INT_STATUS_TX_OVERFLOW_MASK) -#define MBOX_INT_STATUS_TX_OVERFLOW_RESET 1'h0 -#define MBOX_INT_STATUS_RX_UNDERFLOW_MSB 16 -#define MBOX_INT_STATUS_RX_UNDERFLOW_LSB 16 -#define MBOX_INT_STATUS_RX_UNDERFLOW_MASK 'h00010000 -#define MBOX_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & MBOX_INT_STATUS_RX_UNDERFLOW_MASK) >> MBOX_INT_STATUS_RX_UNDERFLOW_LSB) -#define MBOX_INT_STATUS_RX_UNDERFLOW_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_RX_UNDERFLOW_LSB) & MBOX_INT_STATUS_RX_UNDERFLOW_MASK) -#define MBOX_INT_STATUS_RX_UNDERFLOW_RESET 1'h0 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_MSB 15 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_LSB 12 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_MASK 'h0000f000 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) (((x) & MBOX_INT_STATUS_TX_NOT_EMPTY_MASK) >> MBOX_INT_STATUS_TX_NOT_EMPTY_LSB) -#define MBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_TX_NOT_EMPTY_LSB) & MBOX_INT_STATUS_TX_NOT_EMPTY_MASK) -#define MBOX_INT_STATUS_TX_NOT_EMPTY_RESET 4'h0 -#define MBOX_INT_STATUS_RX_NOT_FULL_MSB 11 -#define MBOX_INT_STATUS_RX_NOT_FULL_LSB 8 -#define MBOX_INT_STATUS_RX_NOT_FULL_MASK 'h00000f00 -#define MBOX_INT_STATUS_RX_NOT_FULL_GET(x) (((x) & MBOX_INT_STATUS_RX_NOT_FULL_MASK) >> MBOX_INT_STATUS_RX_NOT_FULL_LSB) -#define MBOX_INT_STATUS_RX_NOT_FULL_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_RX_NOT_FULL_LSB) & MBOX_INT_STATUS_RX_NOT_FULL_MASK) -#define MBOX_INT_STATUS_RX_NOT_FULL_RESET 4'h0 -#define MBOX_INT_STATUS_HOST_MSB 7 -#define MBOX_INT_STATUS_HOST_LSB 0 -#define MBOX_INT_STATUS_HOST_MASK 'h000000ff -#define MBOX_INT_STATUS_HOST_GET(x) (((x) & MBOX_INT_STATUS_HOST_MASK) >> MBOX_INT_STATUS_HOST_LSB) -#define MBOX_INT_STATUS_HOST_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_HOST_LSB) & MBOX_INT_STATUS_HOST_MASK) -#define MBOX_INT_STATUS_HOST_RESET 8'h0 -#define MBOX_INT_STATUS_RESET (32'h0 | \ - MBOX_INT_STATUS_RX_DMA_COMPLETE_SET(MBOX_INT_STATUS_RX_DMA_COMPLETE_RESET) | \ - MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_RESET) | \ - MBOX_INT_STATUS_TX_DMA_COMPLETE_SET(MBOX_INT_STATUS_TX_DMA_COMPLETE_RESET) | \ - MBOX_INT_STATUS_TX_OVERFLOW_SET(MBOX_INT_STATUS_TX_OVERFLOW_RESET) | \ - MBOX_INT_STATUS_RX_UNDERFLOW_SET(MBOX_INT_STATUS_RX_UNDERFLOW_RESET) | \ - MBOX_INT_STATUS_TX_NOT_EMPTY_SET(MBOX_INT_STATUS_TX_NOT_EMPTY_RESET) | \ - MBOX_INT_STATUS_RX_NOT_FULL_SET(MBOX_INT_STATUS_RX_NOT_FULL_RESET) | \ - MBOX_INT_STATUS_HOST_SET(MBOX_INT_STATUS_HOST_RESET)) -#define MBOX_INT_STATUS_HW_MASK (32'h0 | \ - MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK | \ - MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK | \ - MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK | \ - MBOX_INT_STATUS_TX_OVERFLOW_MASK | \ - MBOX_INT_STATUS_RX_UNDERFLOW_MASK | \ - MBOX_INT_STATUS_TX_NOT_EMPTY_MASK | \ - MBOX_INT_STATUS_RX_NOT_FULL_MASK | \ - MBOX_INT_STATUS_HOST_MASK) -#define MBOX_INT_STATUS_SW_MASK (32'h0 | \ - MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK | \ - MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK | \ - MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK | \ - MBOX_INT_STATUS_TX_OVERFLOW_MASK | \ - MBOX_INT_STATUS_RX_UNDERFLOW_MASK | \ - MBOX_INT_STATUS_TX_NOT_EMPTY_MASK | \ - MBOX_INT_STATUS_RX_NOT_FULL_MASK | \ - MBOX_INT_STATUS_HOST_MASK) - -#define MBOX_INT_ENABLE_ADDRESS 'h0000005c -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB 31 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB 28 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK 'hf0000000 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) >> MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) & MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_RESET 4'h0 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB 27 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB 24 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK 'h0f000000 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) >> MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) & MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_RESET 4'h0 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB 23 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB 20 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK 'h00f00000 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) >> MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) & MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_RESET 4'h0 -#define MBOX_INT_ENABLE_TX_OVERFLOW_MSB 17 -#define MBOX_INT_ENABLE_TX_OVERFLOW_LSB 17 -#define MBOX_INT_ENABLE_TX_OVERFLOW_MASK 'h00020000 -#define MBOX_INT_ENABLE_TX_OVERFLOW_GET(x) (((x) & MBOX_INT_ENABLE_TX_OVERFLOW_MASK) >> MBOX_INT_ENABLE_TX_OVERFLOW_LSB) -#define MBOX_INT_ENABLE_TX_OVERFLOW_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_TX_OVERFLOW_LSB) & MBOX_INT_ENABLE_TX_OVERFLOW_MASK) -#define MBOX_INT_ENABLE_TX_OVERFLOW_RESET 1'h0 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_MSB 16 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_LSB 16 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_MASK 'h00010000 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) (((x) & MBOX_INT_ENABLE_RX_UNDERFLOW_MASK) >> MBOX_INT_ENABLE_RX_UNDERFLOW_LSB) -#define MBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_RX_UNDERFLOW_LSB) & MBOX_INT_ENABLE_RX_UNDERFLOW_MASK) -#define MBOX_INT_ENABLE_RX_UNDERFLOW_RESET 1'h0 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MSB 15 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB 12 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK 'h0000f000 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) (((x) & MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) >> MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) & MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_RESET 4'h0 -#define MBOX_INT_ENABLE_RX_NOT_FULL_MSB 11 -#define MBOX_INT_ENABLE_RX_NOT_FULL_LSB 8 -#define MBOX_INT_ENABLE_RX_NOT_FULL_MASK 'h00000f00 -#define MBOX_INT_ENABLE_RX_NOT_FULL_GET(x) (((x) & MBOX_INT_ENABLE_RX_NOT_FULL_MASK) >> MBOX_INT_ENABLE_RX_NOT_FULL_LSB) -#define MBOX_INT_ENABLE_RX_NOT_FULL_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_RX_NOT_FULL_LSB) & MBOX_INT_ENABLE_RX_NOT_FULL_MASK) -#define MBOX_INT_ENABLE_RX_NOT_FULL_RESET 4'h0 -#define MBOX_INT_ENABLE_HOST_MSB 7 -#define MBOX_INT_ENABLE_HOST_LSB 0 -#define MBOX_INT_ENABLE_HOST_MASK 'h000000ff -#define MBOX_INT_ENABLE_HOST_GET(x) (((x) & MBOX_INT_ENABLE_HOST_MASK) >> MBOX_INT_ENABLE_HOST_LSB) -#define MBOX_INT_ENABLE_HOST_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_HOST_LSB) & MBOX_INT_ENABLE_HOST_MASK) -#define MBOX_INT_ENABLE_HOST_RESET 8'hff -#define MBOX_INT_ENABLE_RESET (32'h0 | \ - MBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(MBOX_INT_ENABLE_RX_DMA_COMPLETE_RESET) | \ - MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_RESET) | \ - MBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(MBOX_INT_ENABLE_TX_DMA_COMPLETE_RESET) | \ - MBOX_INT_ENABLE_TX_OVERFLOW_SET(MBOX_INT_ENABLE_TX_OVERFLOW_RESET) | \ - MBOX_INT_ENABLE_RX_UNDERFLOW_SET(MBOX_INT_ENABLE_RX_UNDERFLOW_RESET) | \ - MBOX_INT_ENABLE_TX_NOT_EMPTY_SET(MBOX_INT_ENABLE_TX_NOT_EMPTY_RESET) | \ - MBOX_INT_ENABLE_RX_NOT_FULL_SET(MBOX_INT_ENABLE_RX_NOT_FULL_RESET) | \ - MBOX_INT_ENABLE_HOST_SET(MBOX_INT_ENABLE_HOST_RESET)) -#define MBOX_INT_ENABLE_HW_MASK (32'h0) -#define MBOX_INT_ENABLE_SW_MASK (32'h0 | \ - MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK | \ - MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK | \ - MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK | \ - MBOX_INT_ENABLE_TX_OVERFLOW_MASK | \ - MBOX_INT_ENABLE_RX_UNDERFLOW_MASK | \ - MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK | \ - MBOX_INT_ENABLE_RX_NOT_FULL_MASK | \ - MBOX_INT_ENABLE_HOST_MASK) - -#define INT_HOST_ADDRESS 'h00000060 -#define INT_HOST_VECTOR_MSB 7 -#define INT_HOST_VECTOR_LSB 0 -#define INT_HOST_VECTOR_MASK 'h000000ff -#define INT_HOST_VECTOR_GET(x) (((x) & INT_HOST_VECTOR_MASK) >> INT_HOST_VECTOR_LSB) -#define INT_HOST_VECTOR_SET(x) (((32'd0 | (x)) << INT_HOST_VECTOR_LSB) & INT_HOST_VECTOR_MASK) -#define INT_HOST_VECTOR_RESET 8'h0 -#define INT_HOST_RESET (32'h0 | \ - INT_HOST_VECTOR_SET(INT_HOST_VECTOR_RESET)) -#define INT_HOST_HW_MASK (32'h0 | \ - INT_HOST_VECTOR_MASK) -#define INT_HOST_SW_MASK (32'h0 | \ - INT_HOST_VECTOR_MASK) - -#define LOCAL_COUNT_ADDRESS 'h00000080 -#define LOCAL_COUNT_VALUE_MSB 7 -#define LOCAL_COUNT_VALUE_LSB 0 -#define LOCAL_COUNT_VALUE_MASK 'h000000ff -#define LOCAL_COUNT_VALUE_GET(x) (((x) & LOCAL_COUNT_VALUE_MASK) >> LOCAL_COUNT_VALUE_LSB) -#define LOCAL_COUNT_VALUE_SET(x) (((32'd0 | (x)) << LOCAL_COUNT_VALUE_LSB) & LOCAL_COUNT_VALUE_MASK) -#define LOCAL_COUNT_VALUE_RESET 8'h0 -#define LOCAL_COUNT_RESET (32'h0 | \ - LOCAL_COUNT_VALUE_SET(LOCAL_COUNT_VALUE_RESET)) -#define LOCAL_COUNT_HW_MASK (32'h0 | \ - LOCAL_COUNT_VALUE_MASK) -#define LOCAL_COUNT_SW_MASK (32'h0 | \ - LOCAL_COUNT_VALUE_MASK) - -#define COUNT_INC_ADDRESS 'h000000a0 -#define COUNT_INC_VALUE_MSB 7 -#define COUNT_INC_VALUE_LSB 0 -#define COUNT_INC_VALUE_MASK 'h000000ff -#define COUNT_INC_VALUE_GET(x) (((x) & COUNT_INC_VALUE_MASK) >> COUNT_INC_VALUE_LSB) -#define COUNT_INC_VALUE_SET(x) (((32'd0 | (x)) << COUNT_INC_VALUE_LSB) & COUNT_INC_VALUE_MASK) -#define COUNT_INC_VALUE_RESET 8'h0 -#define COUNT_INC_RESET (32'h0 | \ - COUNT_INC_VALUE_SET(COUNT_INC_VALUE_RESET)) -#define COUNT_INC_HW_MASK (32'h0 | \ - COUNT_INC_VALUE_MASK) -#define COUNT_INC_SW_MASK (32'h0 | \ - COUNT_INC_VALUE_MASK) - -#define LOCAL_SCRATCH_ADDRESS 'h000000c0 -#define LOCAL_SCRATCH_VALUE_MSB 7 -#define LOCAL_SCRATCH_VALUE_LSB 0 -#define LOCAL_SCRATCH_VALUE_MASK 'h000000ff -#define LOCAL_SCRATCH_VALUE_GET(x) (((x) & LOCAL_SCRATCH_VALUE_MASK) >> LOCAL_SCRATCH_VALUE_LSB) -#define LOCAL_SCRATCH_VALUE_SET(x) (((32'd0 | (x)) << LOCAL_SCRATCH_VALUE_LSB) & LOCAL_SCRATCH_VALUE_MASK) -#define LOCAL_SCRATCH_VALUE_RESET 8'h0 -#define LOCAL_SCRATCH_RESET (32'h0 | \ - LOCAL_SCRATCH_VALUE_SET(LOCAL_SCRATCH_VALUE_RESET)) -#define LOCAL_SCRATCH_HW_MASK (32'h0 | \ - LOCAL_SCRATCH_VALUE_MASK) -#define LOCAL_SCRATCH_SW_MASK (32'h0 | \ - LOCAL_SCRATCH_VALUE_MASK) - -#define USE_LOCAL_BUS_ADDRESS 'h000000e0 -#define USE_LOCAL_BUS_PIN_INIT_MSB 0 -#define USE_LOCAL_BUS_PIN_INIT_LSB 0 -#define USE_LOCAL_BUS_PIN_INIT_MASK 'h00000001 -#define USE_LOCAL_BUS_PIN_INIT_GET(x) (((x) & USE_LOCAL_BUS_PIN_INIT_MASK) >> USE_LOCAL_BUS_PIN_INIT_LSB) -#define USE_LOCAL_BUS_PIN_INIT_SET(x) (((32'd0 | (x)) << USE_LOCAL_BUS_PIN_INIT_LSB) & USE_LOCAL_BUS_PIN_INIT_MASK) -#define USE_LOCAL_BUS_PIN_INIT_RESET 1'h0 -#define USE_LOCAL_BUS_RESET (32'h0 | \ - USE_LOCAL_BUS_PIN_INIT_SET(USE_LOCAL_BUS_PIN_INIT_RESET)) -#define USE_LOCAL_BUS_HW_MASK (32'h0 | \ - USE_LOCAL_BUS_PIN_INIT_MASK) -#define USE_LOCAL_BUS_SW_MASK (32'h0) - -#define SDIO_CONFIG_ADDRESS 'h000000e4 -#define SDIO_CONFIG_CCCR_IOR1_MSB 0 -#define SDIO_CONFIG_CCCR_IOR1_LSB 0 -#define SDIO_CONFIG_CCCR_IOR1_MASK 'h00000001 -#define SDIO_CONFIG_CCCR_IOR1_GET(x) (((x) & SDIO_CONFIG_CCCR_IOR1_MASK) >> SDIO_CONFIG_CCCR_IOR1_LSB) -#define SDIO_CONFIG_CCCR_IOR1_SET(x) (((32'd0 | (x)) << SDIO_CONFIG_CCCR_IOR1_LSB) & SDIO_CONFIG_CCCR_IOR1_MASK) -#define SDIO_CONFIG_CCCR_IOR1_RESET 1'h0 -#define SDIO_CONFIG_RESET (32'h0 | \ - SDIO_CONFIG_CCCR_IOR1_SET(SDIO_CONFIG_CCCR_IOR1_RESET)) -#define SDIO_CONFIG_HW_MASK (32'h0) -#define SDIO_CONFIG_SW_MASK (32'h0 | \ - SDIO_CONFIG_CCCR_IOR1_MASK) - -#define MBOX_DEBUG_ADDRESS 'h000000e8 -#define MBOX_DEBUG_SEL_MSB 2 -#define MBOX_DEBUG_SEL_LSB 0 -#define MBOX_DEBUG_SEL_MASK 'h00000007 -#define MBOX_DEBUG_SEL_GET(x) (((x) & MBOX_DEBUG_SEL_MASK) >> MBOX_DEBUG_SEL_LSB) -#define MBOX_DEBUG_SEL_SET(x) (((32'd0 | (x)) << MBOX_DEBUG_SEL_LSB) & MBOX_DEBUG_SEL_MASK) -#define MBOX_DEBUG_SEL_RESET 3'h0 -#define MBOX_DEBUG_RESET (32'h0 | \ - MBOX_DEBUG_SEL_SET(MBOX_DEBUG_SEL_RESET)) -#define MBOX_DEBUG_HW_MASK (32'h0) -#define MBOX_DEBUG_SW_MASK (32'h0 | \ - MBOX_DEBUG_SEL_MASK) - -#define MBOX_FIFO_RESET_ADDRESS 'h000000ec -#define MBOX_FIFO_RESET_INIT_MSB 0 -#define MBOX_FIFO_RESET_INIT_LSB 0 -#define MBOX_FIFO_RESET_INIT_MASK 'h00000001 -#define MBOX_FIFO_RESET_INIT_GET(x) (((x) & MBOX_FIFO_RESET_INIT_MASK) >> MBOX_FIFO_RESET_INIT_LSB) -#define MBOX_FIFO_RESET_INIT_SET(x) (((32'd0 | (x)) << MBOX_FIFO_RESET_INIT_LSB) & MBOX_FIFO_RESET_INIT_MASK) -#define MBOX_FIFO_RESET_INIT_RESET 1'h0 -#define MBOX_FIFO_RESET_RESET (32'h0 | \ - MBOX_FIFO_RESET_INIT_SET(MBOX_FIFO_RESET_INIT_RESET)) -#define MBOX_FIFO_RESET_HW_MASK (32'h0 | \ - MBOX_FIFO_RESET_INIT_MASK) -#define MBOX_FIFO_RESET_SW_MASK (32'h0 | \ - MBOX_FIFO_RESET_INIT_MASK) - -#define MBOX_TXFIFO_POP_ADDRESS 'h000000f0 -#define MBOX_TXFIFO_POP_DATA_MSB 0 -#define MBOX_TXFIFO_POP_DATA_LSB 0 -#define MBOX_TXFIFO_POP_DATA_MASK 'h00000001 -#define MBOX_TXFIFO_POP_DATA_GET(x) (((x) & MBOX_TXFIFO_POP_DATA_MASK) >> MBOX_TXFIFO_POP_DATA_LSB) -#define MBOX_TXFIFO_POP_DATA_SET(x) (((32'd0 | (x)) << MBOX_TXFIFO_POP_DATA_LSB) & MBOX_TXFIFO_POP_DATA_MASK) -#define MBOX_TXFIFO_POP_DATA_RESET 1'h0 -#define MBOX_TXFIFO_POP_RESET (32'h0 | \ - MBOX_TXFIFO_POP_DATA_SET(MBOX_TXFIFO_POP_DATA_RESET)) -#define MBOX_TXFIFO_POP_HW_MASK (32'h0) -#define MBOX_TXFIFO_POP_SW_MASK (32'h0 | \ - MBOX_TXFIFO_POP_DATA_MASK) - -#define MBOX_RXFIFO_POP_ADDRESS 'h00000100 -#define MBOX_RXFIFO_POP_DATA_MSB 0 -#define MBOX_RXFIFO_POP_DATA_LSB 0 -#define MBOX_RXFIFO_POP_DATA_MASK 'h00000001 -#define MBOX_RXFIFO_POP_DATA_GET(x) (((x) & MBOX_RXFIFO_POP_DATA_MASK) >> MBOX_RXFIFO_POP_DATA_LSB) -#define MBOX_RXFIFO_POP_DATA_SET(x) (((32'd0 | (x)) << MBOX_RXFIFO_POP_DATA_LSB) & MBOX_RXFIFO_POP_DATA_MASK) -#define MBOX_RXFIFO_POP_DATA_RESET 1'h0 -#define MBOX_RXFIFO_POP_RESET (32'h0 | \ - MBOX_RXFIFO_POP_DATA_SET(MBOX_RXFIFO_POP_DATA_RESET)) -#define MBOX_RXFIFO_POP_HW_MASK (32'h0) -#define MBOX_RXFIFO_POP_SW_MASK (32'h0 | \ - MBOX_RXFIFO_POP_DATA_MASK) - -#define SDIO_DEBUG_ADDRESS 'h00000110 -#define SDIO_DEBUG_SEL_MSB 3 -#define SDIO_DEBUG_SEL_LSB 0 -#define SDIO_DEBUG_SEL_MASK 'h0000000f -#define SDIO_DEBUG_SEL_GET(x) (((x) & SDIO_DEBUG_SEL_MASK) >> SDIO_DEBUG_SEL_LSB) -#define SDIO_DEBUG_SEL_SET(x) (((32'd0 | (x)) << SDIO_DEBUG_SEL_LSB) & SDIO_DEBUG_SEL_MASK) -#define SDIO_DEBUG_SEL_RESET 4'h0 -#define SDIO_DEBUG_RESET (32'h0 | \ - SDIO_DEBUG_SEL_SET(SDIO_DEBUG_SEL_RESET)) -#define SDIO_DEBUG_HW_MASK (32'h0) -#define SDIO_DEBUG_SW_MASK (32'h0 | \ - SDIO_DEBUG_SEL_MASK) - -#define HOST_IF_WINDOW_ADDRESS 'h00002000 -#define HOST_IF_WINDOW_DATA_MSB 7 -#define HOST_IF_WINDOW_DATA_LSB 0 -#define HOST_IF_WINDOW_DATA_MASK 'h000000ff -#define HOST_IF_WINDOW_DATA_GET(x) (((x) & HOST_IF_WINDOW_DATA_MASK) >> HOST_IF_WINDOW_DATA_LSB) -#define HOST_IF_WINDOW_DATA_SET(x) (((32'd0 | (x)) << HOST_IF_WINDOW_DATA_LSB) & HOST_IF_WINDOW_DATA_MASK) -#define HOST_IF_WINDOW_DATA_RESET 8'h0 -#define HOST_IF_WINDOW_RESET (32'h0 | \ - HOST_IF_WINDOW_DATA_SET(HOST_IF_WINDOW_DATA_RESET)) -#define HOST_IF_WINDOW_HW_MASK (32'h0 | \ - HOST_IF_WINDOW_DATA_MASK) -#define HOST_IF_WINDOW_SW_MASK (32'h0 | \ - HOST_IF_WINDOW_DATA_MASK) - -#define MBOX_REG_ADDRESS_MSB 13 - -#endif /* _MBOX_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/rf2G_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/rf2G_reg.h deleted file mode 100644 index f214c9c101c3..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/rf2G_reg.h +++ /dev/null @@ -1,160 +0,0 @@ -#ifndef _RF2G_REG_REG_H_ -#define _RF2G_REG_REG_H_ - -#define RF2G_RF2G1_ADDRESS 0x00000000 -#define RF2G_RF2G1_OFFSET 0x00000000 -#define RF2G_RF2G1_BLNA1_MSB 31 -#define RF2G_RF2G1_BLNA1_LSB 29 -#define RF2G_RF2G1_BLNA1_MASK 0xe0000000 -#define RF2G_RF2G1_BLNA1_GET(x) (((x) & RF2G_RF2G1_BLNA1_MASK) >> RF2G_RF2G1_BLNA1_LSB) -#define RF2G_RF2G1_BLNA1_SET(x) (((x) << RF2G_RF2G1_BLNA1_LSB) & RF2G_RF2G1_BLNA1_MASK) -#define RF2G_RF2G1_BLNA1F_MSB 28 -#define RF2G_RF2G1_BLNA1F_LSB 26 -#define RF2G_RF2G1_BLNA1F_MASK 0x1c000000 -#define RF2G_RF2G1_BLNA1F_GET(x) (((x) & RF2G_RF2G1_BLNA1F_MASK) >> RF2G_RF2G1_BLNA1F_LSB) -#define RF2G_RF2G1_BLNA1F_SET(x) (((x) << RF2G_RF2G1_BLNA1F_LSB) & RF2G_RF2G1_BLNA1F_MASK) -#define RF2G_RF2G1_BLNA1BUF_MSB 25 -#define RF2G_RF2G1_BLNA1BUF_LSB 23 -#define RF2G_RF2G1_BLNA1BUF_MASK 0x03800000 -#define RF2G_RF2G1_BLNA1BUF_GET(x) (((x) & RF2G_RF2G1_BLNA1BUF_MASK) >> RF2G_RF2G1_BLNA1BUF_LSB) -#define RF2G_RF2G1_BLNA1BUF_SET(x) (((x) << RF2G_RF2G1_BLNA1BUF_LSB) & RF2G_RF2G1_BLNA1BUF_MASK) -#define RF2G_RF2G1_BLNA2_MSB 22 -#define RF2G_RF2G1_BLNA2_LSB 20 -#define RF2G_RF2G1_BLNA2_MASK 0x00700000 -#define RF2G_RF2G1_BLNA2_GET(x) (((x) & RF2G_RF2G1_BLNA2_MASK) >> RF2G_RF2G1_BLNA2_LSB) -#define RF2G_RF2G1_BLNA2_SET(x) (((x) << RF2G_RF2G1_BLNA2_LSB) & RF2G_RF2G1_BLNA2_MASK) -#define RF2G_RF2G1_DB_MSB 19 -#define RF2G_RF2G1_DB_LSB 17 -#define RF2G_RF2G1_DB_MASK 0x000e0000 -#define RF2G_RF2G1_DB_GET(x) (((x) & RF2G_RF2G1_DB_MASK) >> RF2G_RF2G1_DB_LSB) -#define RF2G_RF2G1_DB_SET(x) (((x) << RF2G_RF2G1_DB_LSB) & RF2G_RF2G1_DB_MASK) -#define RF2G_RF2G1_OB_MSB 16 -#define RF2G_RF2G1_OB_LSB 14 -#define RF2G_RF2G1_OB_MASK 0x0001c000 -#define RF2G_RF2G1_OB_GET(x) (((x) & RF2G_RF2G1_OB_MASK) >> RF2G_RF2G1_OB_LSB) -#define RF2G_RF2G1_OB_SET(x) (((x) << RF2G_RF2G1_OB_LSB) & RF2G_RF2G1_OB_MASK) -#define RF2G_RF2G1_FE_ATB_SEL_MSB 13 -#define RF2G_RF2G1_FE_ATB_SEL_LSB 11 -#define RF2G_RF2G1_FE_ATB_SEL_MASK 0x00003800 -#define RF2G_RF2G1_FE_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_FE_ATB_SEL_MASK) >> RF2G_RF2G1_FE_ATB_SEL_LSB) -#define RF2G_RF2G1_FE_ATB_SEL_SET(x) (((x) << RF2G_RF2G1_FE_ATB_SEL_LSB) & RF2G_RF2G1_FE_ATB_SEL_MASK) -#define RF2G_RF2G1_RF_ATB_SEL_MSB 10 -#define RF2G_RF2G1_RF_ATB_SEL_LSB 8 -#define RF2G_RF2G1_RF_ATB_SEL_MASK 0x00000700 -#define RF2G_RF2G1_RF_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_RF_ATB_SEL_MASK) >> RF2G_RF2G1_RF_ATB_SEL_LSB) -#define RF2G_RF2G1_RF_ATB_SEL_SET(x) (((x) << RF2G_RF2G1_RF_ATB_SEL_LSB) & RF2G_RF2G1_RF_ATB_SEL_MASK) -#define RF2G_RF2G1_SELLNA_MSB 7 -#define RF2G_RF2G1_SELLNA_LSB 7 -#define RF2G_RF2G1_SELLNA_MASK 0x00000080 -#define RF2G_RF2G1_SELLNA_GET(x) (((x) & RF2G_RF2G1_SELLNA_MASK) >> RF2G_RF2G1_SELLNA_LSB) -#define RF2G_RF2G1_SELLNA_SET(x) (((x) << RF2G_RF2G1_SELLNA_LSB) & RF2G_RF2G1_SELLNA_MASK) -#define RF2G_RF2G1_LOCONTROL_MSB 6 -#define RF2G_RF2G1_LOCONTROL_LSB 6 -#define RF2G_RF2G1_LOCONTROL_MASK 0x00000040 -#define RF2G_RF2G1_LOCONTROL_GET(x) (((x) & RF2G_RF2G1_LOCONTROL_MASK) >> RF2G_RF2G1_LOCONTROL_LSB) -#define RF2G_RF2G1_LOCONTROL_SET(x) (((x) << RF2G_RF2G1_LOCONTROL_LSB) & RF2G_RF2G1_LOCONTROL_MASK) -#define RF2G_RF2G1_SHORTLNA2_MSB 5 -#define RF2G_RF2G1_SHORTLNA2_LSB 5 -#define RF2G_RF2G1_SHORTLNA2_MASK 0x00000020 -#define RF2G_RF2G1_SHORTLNA2_GET(x) (((x) & RF2G_RF2G1_SHORTLNA2_MASK) >> RF2G_RF2G1_SHORTLNA2_LSB) -#define RF2G_RF2G1_SHORTLNA2_SET(x) (((x) << RF2G_RF2G1_SHORTLNA2_LSB) & RF2G_RF2G1_SHORTLNA2_MASK) -#define RF2G_RF2G1_SPARE_MSB 4 -#define RF2G_RF2G1_SPARE_LSB 0 -#define RF2G_RF2G1_SPARE_MASK 0x0000001f -#define RF2G_RF2G1_SPARE_GET(x) (((x) & RF2G_RF2G1_SPARE_MASK) >> RF2G_RF2G1_SPARE_LSB) -#define RF2G_RF2G1_SPARE_SET(x) (((x) << RF2G_RF2G1_SPARE_LSB) & RF2G_RF2G1_SPARE_MASK) - -#define RF2G_RF2G2_ADDRESS 0x00000004 -#define RF2G_RF2G2_OFFSET 0x00000004 -#define RF2G_RF2G2_PDCGLNA_MSB 31 -#define RF2G_RF2G2_PDCGLNA_LSB 31 -#define RF2G_RF2G2_PDCGLNA_MASK 0x80000000 -#define RF2G_RF2G2_PDCGLNA_GET(x) (((x) & RF2G_RF2G2_PDCGLNA_MASK) >> RF2G_RF2G2_PDCGLNA_LSB) -#define RF2G_RF2G2_PDCGLNA_SET(x) (((x) << RF2G_RF2G2_PDCGLNA_LSB) & RF2G_RF2G2_PDCGLNA_MASK) -#define RF2G_RF2G2_PDCGLNABUF_MSB 30 -#define RF2G_RF2G2_PDCGLNABUF_LSB 30 -#define RF2G_RF2G2_PDCGLNABUF_MASK 0x40000000 -#define RF2G_RF2G2_PDCGLNABUF_GET(x) (((x) & RF2G_RF2G2_PDCGLNABUF_MASK) >> RF2G_RF2G2_PDCGLNABUF_LSB) -#define RF2G_RF2G2_PDCGLNABUF_SET(x) (((x) << RF2G_RF2G2_PDCGLNABUF_LSB) & RF2G_RF2G2_PDCGLNABUF_MASK) -#define RF2G_RF2G2_PDCSLNA_MSB 29 -#define RF2G_RF2G2_PDCSLNA_LSB 29 -#define RF2G_RF2G2_PDCSLNA_MASK 0x20000000 -#define RF2G_RF2G2_PDCSLNA_GET(x) (((x) & RF2G_RF2G2_PDCSLNA_MASK) >> RF2G_RF2G2_PDCSLNA_LSB) -#define RF2G_RF2G2_PDCSLNA_SET(x) (((x) << RF2G_RF2G2_PDCSLNA_LSB) & RF2G_RF2G2_PDCSLNA_MASK) -#define RF2G_RF2G2_PDDIV_MSB 28 -#define RF2G_RF2G2_PDDIV_LSB 28 -#define RF2G_RF2G2_PDDIV_MASK 0x10000000 -#define RF2G_RF2G2_PDDIV_GET(x) (((x) & RF2G_RF2G2_PDDIV_MASK) >> RF2G_RF2G2_PDDIV_LSB) -#define RF2G_RF2G2_PDDIV_SET(x) (((x) << RF2G_RF2G2_PDDIV_LSB) & RF2G_RF2G2_PDDIV_MASK) -#define RF2G_RF2G2_PDPADRV_MSB 27 -#define RF2G_RF2G2_PDPADRV_LSB 27 -#define RF2G_RF2G2_PDPADRV_MASK 0x08000000 -#define RF2G_RF2G2_PDPADRV_GET(x) (((x) & RF2G_RF2G2_PDPADRV_MASK) >> RF2G_RF2G2_PDPADRV_LSB) -#define RF2G_RF2G2_PDPADRV_SET(x) (((x) << RF2G_RF2G2_PDPADRV_LSB) & RF2G_RF2G2_PDPADRV_MASK) -#define RF2G_RF2G2_PDPAOUT_MSB 26 -#define RF2G_RF2G2_PDPAOUT_LSB 26 -#define RF2G_RF2G2_PDPAOUT_MASK 0x04000000 -#define RF2G_RF2G2_PDPAOUT_GET(x) (((x) & RF2G_RF2G2_PDPAOUT_MASK) >> RF2G_RF2G2_PDPAOUT_LSB) -#define RF2G_RF2G2_PDPAOUT_SET(x) (((x) << RF2G_RF2G2_PDPAOUT_LSB) & RF2G_RF2G2_PDPAOUT_MASK) -#define RF2G_RF2G2_PDREGLNA_MSB 25 -#define RF2G_RF2G2_PDREGLNA_LSB 25 -#define RF2G_RF2G2_PDREGLNA_MASK 0x02000000 -#define RF2G_RF2G2_PDREGLNA_GET(x) (((x) & RF2G_RF2G2_PDREGLNA_MASK) >> RF2G_RF2G2_PDREGLNA_LSB) -#define RF2G_RF2G2_PDREGLNA_SET(x) (((x) << RF2G_RF2G2_PDREGLNA_LSB) & RF2G_RF2G2_PDREGLNA_MASK) -#define RF2G_RF2G2_PDREGLO_MSB 24 -#define RF2G_RF2G2_PDREGLO_LSB 24 -#define RF2G_RF2G2_PDREGLO_MASK 0x01000000 -#define RF2G_RF2G2_PDREGLO_GET(x) (((x) & RF2G_RF2G2_PDREGLO_MASK) >> RF2G_RF2G2_PDREGLO_LSB) -#define RF2G_RF2G2_PDREGLO_SET(x) (((x) << RF2G_RF2G2_PDREGLO_LSB) & RF2G_RF2G2_PDREGLO_MASK) -#define RF2G_RF2G2_PDRFGM_MSB 23 -#define RF2G_RF2G2_PDRFGM_LSB 23 -#define RF2G_RF2G2_PDRFGM_MASK 0x00800000 -#define RF2G_RF2G2_PDRFGM_GET(x) (((x) & RF2G_RF2G2_PDRFGM_MASK) >> RF2G_RF2G2_PDRFGM_LSB) -#define RF2G_RF2G2_PDRFGM_SET(x) (((x) << RF2G_RF2G2_PDRFGM_LSB) & RF2G_RF2G2_PDRFGM_MASK) -#define RF2G_RF2G2_PDRXLO_MSB 22 -#define RF2G_RF2G2_PDRXLO_LSB 22 -#define RF2G_RF2G2_PDRXLO_MASK 0x00400000 -#define RF2G_RF2G2_PDRXLO_GET(x) (((x) & RF2G_RF2G2_PDRXLO_MASK) >> RF2G_RF2G2_PDRXLO_LSB) -#define RF2G_RF2G2_PDRXLO_SET(x) (((x) << RF2G_RF2G2_PDRXLO_LSB) & RF2G_RF2G2_PDRXLO_MASK) -#define RF2G_RF2G2_PDTXLO_MSB 21 -#define RF2G_RF2G2_PDTXLO_LSB 21 -#define RF2G_RF2G2_PDTXLO_MASK 0x00200000 -#define RF2G_RF2G2_PDTXLO_GET(x) (((x) & RF2G_RF2G2_PDTXLO_MASK) >> RF2G_RF2G2_PDTXLO_LSB) -#define RF2G_RF2G2_PDTXLO_SET(x) (((x) << RF2G_RF2G2_PDTXLO_LSB) & RF2G_RF2G2_PDTXLO_MASK) -#define RF2G_RF2G2_PDTXMIX_MSB 20 -#define RF2G_RF2G2_PDTXMIX_LSB 20 -#define RF2G_RF2G2_PDTXMIX_MASK 0x00100000 -#define RF2G_RF2G2_PDTXMIX_GET(x) (((x) & RF2G_RF2G2_PDTXMIX_MASK) >> RF2G_RF2G2_PDTXMIX_LSB) -#define RF2G_RF2G2_PDTXMIX_SET(x) (((x) << RF2G_RF2G2_PDTXMIX_LSB) & RF2G_RF2G2_PDTXMIX_MASK) -#define RF2G_RF2G2_REGLNA_BYPASS_MSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_LSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_MASK 0x00080000 -#define RF2G_RF2G2_REGLNA_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLNA_BYPASS_MASK) >> RF2G_RF2G2_REGLNA_BYPASS_LSB) -#define RF2G_RF2G2_REGLNA_BYPASS_SET(x) (((x) << RF2G_RF2G2_REGLNA_BYPASS_LSB) & RF2G_RF2G2_REGLNA_BYPASS_MASK) -#define RF2G_RF2G2_REGLO_BYPASS_MSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_LSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_MASK 0x00040000 -#define RF2G_RF2G2_REGLO_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLO_BYPASS_MASK) >> RF2G_RF2G2_REGLO_BYPASS_LSB) -#define RF2G_RF2G2_REGLO_BYPASS_SET(x) (((x) << RF2G_RF2G2_REGLO_BYPASS_LSB) & RF2G_RF2G2_REGLO_BYPASS_MASK) -#define RF2G_RF2G2_ENABLE_PCB_MSB 17 -#define RF2G_RF2G2_ENABLE_PCB_LSB 17 -#define RF2G_RF2G2_ENABLE_PCB_MASK 0x00020000 -#define RF2G_RF2G2_ENABLE_PCB_GET(x) (((x) & RF2G_RF2G2_ENABLE_PCB_MASK) >> RF2G_RF2G2_ENABLE_PCB_LSB) -#define RF2G_RF2G2_ENABLE_PCB_SET(x) (((x) << RF2G_RF2G2_ENABLE_PCB_LSB) & RF2G_RF2G2_ENABLE_PCB_MASK) -#define RF2G_RF2G2_SPARE_MSB 16 -#define RF2G_RF2G2_SPARE_LSB 0 -#define RF2G_RF2G2_SPARE_MASK 0x0001ffff -#define RF2G_RF2G2_SPARE_GET(x) (((x) & RF2G_RF2G2_SPARE_MASK) >> RF2G_RF2G2_SPARE_LSB) -#define RF2G_RF2G2_SPARE_SET(x) (((x) << RF2G_RF2G2_SPARE_LSB) & RF2G_RF2G2_SPARE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct rf2g_reg_reg_s { - volatile unsigned int rf2g_rf2g1; - volatile unsigned int rf2g_rf2g2; -} rf2g_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _RF2G_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/rf2G_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/rf2G_reg.vrh deleted file mode 100644 index abcf5f12caf0..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/rf2G_reg.vrh +++ /dev/null @@ -1,240 +0,0 @@ -#ifndef _RF2G_REG_VRH_ -#define _RF2G_REG_VRH_ - -#define RF2G_RF2G1_ADDRESS 'h00000000 -#define RF2G_RF2G1_BLNA1_MSB 31 -#define RF2G_RF2G1_BLNA1_LSB 29 -#define RF2G_RF2G1_BLNA1_MASK 'he0000000 -#define RF2G_RF2G1_BLNA1_GET(x) (((x) & RF2G_RF2G1_BLNA1_MASK) >> RF2G_RF2G1_BLNA1_LSB) -#define RF2G_RF2G1_BLNA1_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA1_LSB) & RF2G_RF2G1_BLNA1_MASK) -#define RF2G_RF2G1_BLNA1_RESET 3'h3 -#define RF2G_RF2G1_BLNA1F_MSB 28 -#define RF2G_RF2G1_BLNA1F_LSB 26 -#define RF2G_RF2G1_BLNA1F_MASK 'h1c000000 -#define RF2G_RF2G1_BLNA1F_GET(x) (((x) & RF2G_RF2G1_BLNA1F_MASK) >> RF2G_RF2G1_BLNA1F_LSB) -#define RF2G_RF2G1_BLNA1F_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA1F_LSB) & RF2G_RF2G1_BLNA1F_MASK) -#define RF2G_RF2G1_BLNA1F_RESET 3'h0 -#define RF2G_RF2G1_BLNA1BUF_MSB 25 -#define RF2G_RF2G1_BLNA1BUF_LSB 23 -#define RF2G_RF2G1_BLNA1BUF_MASK 'h03800000 -#define RF2G_RF2G1_BLNA1BUF_GET(x) (((x) & RF2G_RF2G1_BLNA1BUF_MASK) >> RF2G_RF2G1_BLNA1BUF_LSB) -#define RF2G_RF2G1_BLNA1BUF_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA1BUF_LSB) & RF2G_RF2G1_BLNA1BUF_MASK) -#define RF2G_RF2G1_BLNA1BUF_RESET 3'h3 -#define RF2G_RF2G1_BLNA2_MSB 22 -#define RF2G_RF2G1_BLNA2_LSB 20 -#define RF2G_RF2G1_BLNA2_MASK 'h00700000 -#define RF2G_RF2G1_BLNA2_GET(x) (((x) & RF2G_RF2G1_BLNA2_MASK) >> RF2G_RF2G1_BLNA2_LSB) -#define RF2G_RF2G1_BLNA2_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA2_LSB) & RF2G_RF2G1_BLNA2_MASK) -#define RF2G_RF2G1_BLNA2_RESET 3'h3 -#define RF2G_RF2G1_DB_MSB 19 -#define RF2G_RF2G1_DB_LSB 17 -#define RF2G_RF2G1_DB_MASK 'h000e0000 -#define RF2G_RF2G1_DB_GET(x) (((x) & RF2G_RF2G1_DB_MASK) >> RF2G_RF2G1_DB_LSB) -#define RF2G_RF2G1_DB_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_DB_LSB) & RF2G_RF2G1_DB_MASK) -#define RF2G_RF2G1_DB_RESET 3'h3 -#define RF2G_RF2G1_OB_MSB 16 -#define RF2G_RF2G1_OB_LSB 14 -#define RF2G_RF2G1_OB_MASK 'h0001c000 -#define RF2G_RF2G1_OB_GET(x) (((x) & RF2G_RF2G1_OB_MASK) >> RF2G_RF2G1_OB_LSB) -#define RF2G_RF2G1_OB_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_OB_LSB) & RF2G_RF2G1_OB_MASK) -#define RF2G_RF2G1_OB_RESET 3'h3 -#define RF2G_RF2G1_FE_ATB_SEL_MSB 13 -#define RF2G_RF2G1_FE_ATB_SEL_LSB 11 -#define RF2G_RF2G1_FE_ATB_SEL_MASK 'h00003800 -#define RF2G_RF2G1_FE_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_FE_ATB_SEL_MASK) >> RF2G_RF2G1_FE_ATB_SEL_LSB) -#define RF2G_RF2G1_FE_ATB_SEL_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_FE_ATB_SEL_LSB) & RF2G_RF2G1_FE_ATB_SEL_MASK) -#define RF2G_RF2G1_FE_ATB_SEL_RESET 3'h0 -#define RF2G_RF2G1_RF_ATB_SEL_MSB 10 -#define RF2G_RF2G1_RF_ATB_SEL_LSB 8 -#define RF2G_RF2G1_RF_ATB_SEL_MASK 'h00000700 -#define RF2G_RF2G1_RF_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_RF_ATB_SEL_MASK) >> RF2G_RF2G1_RF_ATB_SEL_LSB) -#define RF2G_RF2G1_RF_ATB_SEL_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_RF_ATB_SEL_LSB) & RF2G_RF2G1_RF_ATB_SEL_MASK) -#define RF2G_RF2G1_RF_ATB_SEL_RESET 3'h0 -#define RF2G_RF2G1_SELLNA_MSB 7 -#define RF2G_RF2G1_SELLNA_LSB 7 -#define RF2G_RF2G1_SELLNA_MASK 'h00000080 -#define RF2G_RF2G1_SELLNA_GET(x) (((x) & RF2G_RF2G1_SELLNA_MASK) >> RF2G_RF2G1_SELLNA_LSB) -#define RF2G_RF2G1_SELLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_SELLNA_LSB) & RF2G_RF2G1_SELLNA_MASK) -#define RF2G_RF2G1_SELLNA_RESET 1'h1 -#define RF2G_RF2G1_LOCONTROL_MSB 6 -#define RF2G_RF2G1_LOCONTROL_LSB 6 -#define RF2G_RF2G1_LOCONTROL_MASK 'h00000040 -#define RF2G_RF2G1_LOCONTROL_GET(x) (((x) & RF2G_RF2G1_LOCONTROL_MASK) >> RF2G_RF2G1_LOCONTROL_LSB) -#define RF2G_RF2G1_LOCONTROL_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_LOCONTROL_LSB) & RF2G_RF2G1_LOCONTROL_MASK) -#define RF2G_RF2G1_LOCONTROL_RESET 1'h0 -#define RF2G_RF2G1_SHORTLNA2_MSB 5 -#define RF2G_RF2G1_SHORTLNA2_LSB 5 -#define RF2G_RF2G1_SHORTLNA2_MASK 'h00000020 -#define RF2G_RF2G1_SHORTLNA2_GET(x) (((x) & RF2G_RF2G1_SHORTLNA2_MASK) >> RF2G_RF2G1_SHORTLNA2_LSB) -#define RF2G_RF2G1_SHORTLNA2_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_SHORTLNA2_LSB) & RF2G_RF2G1_SHORTLNA2_MASK) -#define RF2G_RF2G1_SHORTLNA2_RESET 1'h0 -#define RF2G_RF2G1_SPARE_MSB 4 -#define RF2G_RF2G1_SPARE_LSB 0 -#define RF2G_RF2G1_SPARE_MASK 'h0000001f -#define RF2G_RF2G1_SPARE_GET(x) (((x) & RF2G_RF2G1_SPARE_MASK) >> RF2G_RF2G1_SPARE_LSB) -#define RF2G_RF2G1_SPARE_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_SPARE_LSB) & RF2G_RF2G1_SPARE_MASK) -#define RF2G_RF2G1_SPARE_RESET 5'h0 -#define RF2G_RF2G1_RESET (32'h0 | \ - RF2G_RF2G1_BLNA1_SET(RF2G_RF2G1_BLNA1_RESET) | \ - RF2G_RF2G1_BLNA1F_SET(RF2G_RF2G1_BLNA1F_RESET) | \ - RF2G_RF2G1_BLNA1BUF_SET(RF2G_RF2G1_BLNA1BUF_RESET) | \ - RF2G_RF2G1_BLNA2_SET(RF2G_RF2G1_BLNA2_RESET) | \ - RF2G_RF2G1_DB_SET(RF2G_RF2G1_DB_RESET) | \ - RF2G_RF2G1_OB_SET(RF2G_RF2G1_OB_RESET) | \ - RF2G_RF2G1_FE_ATB_SEL_SET(RF2G_RF2G1_FE_ATB_SEL_RESET) | \ - RF2G_RF2G1_RF_ATB_SEL_SET(RF2G_RF2G1_RF_ATB_SEL_RESET) | \ - RF2G_RF2G1_SELLNA_SET(RF2G_RF2G1_SELLNA_RESET) | \ - RF2G_RF2G1_LOCONTROL_SET(RF2G_RF2G1_LOCONTROL_RESET) | \ - RF2G_RF2G1_SHORTLNA2_SET(RF2G_RF2G1_SHORTLNA2_RESET) | \ - RF2G_RF2G1_SPARE_SET(RF2G_RF2G1_SPARE_RESET)) -#define RF2G_RF2G1_HW_MASK (32'h0) -#define RF2G_RF2G1_SW_MASK (32'h0 | \ - RF2G_RF2G1_BLNA1_MASK | \ - RF2G_RF2G1_BLNA1F_MASK | \ - RF2G_RF2G1_BLNA1BUF_MASK | \ - RF2G_RF2G1_BLNA2_MASK | \ - RF2G_RF2G1_DB_MASK | \ - RF2G_RF2G1_OB_MASK | \ - RF2G_RF2G1_FE_ATB_SEL_MASK | \ - RF2G_RF2G1_RF_ATB_SEL_MASK | \ - RF2G_RF2G1_SELLNA_MASK | \ - RF2G_RF2G1_LOCONTROL_MASK | \ - RF2G_RF2G1_SHORTLNA2_MASK | \ - RF2G_RF2G1_SPARE_MASK) - -#define RF2G_RF2G2_ADDRESS 'h00000004 -#define RF2G_RF2G2_PDCGLNA_MSB 31 -#define RF2G_RF2G2_PDCGLNA_LSB 31 -#define RF2G_RF2G2_PDCGLNA_MASK 'h80000000 -#define RF2G_RF2G2_PDCGLNA_GET(x) (((x) & RF2G_RF2G2_PDCGLNA_MASK) >> RF2G_RF2G2_PDCGLNA_LSB) -#define RF2G_RF2G2_PDCGLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDCGLNA_LSB) & RF2G_RF2G2_PDCGLNA_MASK) -#define RF2G_RF2G2_PDCGLNA_RESET 1'h0 -#define RF2G_RF2G2_PDCGLNABUF_MSB 30 -#define RF2G_RF2G2_PDCGLNABUF_LSB 30 -#define RF2G_RF2G2_PDCGLNABUF_MASK 'h40000000 -#define RF2G_RF2G2_PDCGLNABUF_GET(x) (((x) & RF2G_RF2G2_PDCGLNABUF_MASK) >> RF2G_RF2G2_PDCGLNABUF_LSB) -#define RF2G_RF2G2_PDCGLNABUF_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDCGLNABUF_LSB) & RF2G_RF2G2_PDCGLNABUF_MASK) -#define RF2G_RF2G2_PDCGLNABUF_RESET 1'h0 -#define RF2G_RF2G2_PDCSLNA_MSB 29 -#define RF2G_RF2G2_PDCSLNA_LSB 29 -#define RF2G_RF2G2_PDCSLNA_MASK 'h20000000 -#define RF2G_RF2G2_PDCSLNA_GET(x) (((x) & RF2G_RF2G2_PDCSLNA_MASK) >> RF2G_RF2G2_PDCSLNA_LSB) -#define RF2G_RF2G2_PDCSLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDCSLNA_LSB) & RF2G_RF2G2_PDCSLNA_MASK) -#define RF2G_RF2G2_PDCSLNA_RESET 1'h0 -#define RF2G_RF2G2_PDDIV_MSB 28 -#define RF2G_RF2G2_PDDIV_LSB 28 -#define RF2G_RF2G2_PDDIV_MASK 'h10000000 -#define RF2G_RF2G2_PDDIV_GET(x) (((x) & RF2G_RF2G2_PDDIV_MASK) >> RF2G_RF2G2_PDDIV_LSB) -#define RF2G_RF2G2_PDDIV_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDDIV_LSB) & RF2G_RF2G2_PDDIV_MASK) -#define RF2G_RF2G2_PDDIV_RESET 1'h0 -#define RF2G_RF2G2_PDPADRV_MSB 27 -#define RF2G_RF2G2_PDPADRV_LSB 27 -#define RF2G_RF2G2_PDPADRV_MASK 'h08000000 -#define RF2G_RF2G2_PDPADRV_GET(x) (((x) & RF2G_RF2G2_PDPADRV_MASK) >> RF2G_RF2G2_PDPADRV_LSB) -#define RF2G_RF2G2_PDPADRV_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDPADRV_LSB) & RF2G_RF2G2_PDPADRV_MASK) -#define RF2G_RF2G2_PDPADRV_RESET 1'h0 -#define RF2G_RF2G2_PDPAOUT_MSB 26 -#define RF2G_RF2G2_PDPAOUT_LSB 26 -#define RF2G_RF2G2_PDPAOUT_MASK 'h04000000 -#define RF2G_RF2G2_PDPAOUT_GET(x) (((x) & RF2G_RF2G2_PDPAOUT_MASK) >> RF2G_RF2G2_PDPAOUT_LSB) -#define RF2G_RF2G2_PDPAOUT_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDPAOUT_LSB) & RF2G_RF2G2_PDPAOUT_MASK) -#define RF2G_RF2G2_PDPAOUT_RESET 1'h0 -#define RF2G_RF2G2_PDREGLNA_MSB 25 -#define RF2G_RF2G2_PDREGLNA_LSB 25 -#define RF2G_RF2G2_PDREGLNA_MASK 'h02000000 -#define RF2G_RF2G2_PDREGLNA_GET(x) (((x) & RF2G_RF2G2_PDREGLNA_MASK) >> RF2G_RF2G2_PDREGLNA_LSB) -#define RF2G_RF2G2_PDREGLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDREGLNA_LSB) & RF2G_RF2G2_PDREGLNA_MASK) -#define RF2G_RF2G2_PDREGLNA_RESET 1'h0 -#define RF2G_RF2G2_PDREGLO_MSB 24 -#define RF2G_RF2G2_PDREGLO_LSB 24 -#define RF2G_RF2G2_PDREGLO_MASK 'h01000000 -#define RF2G_RF2G2_PDREGLO_GET(x) (((x) & RF2G_RF2G2_PDREGLO_MASK) >> RF2G_RF2G2_PDREGLO_LSB) -#define RF2G_RF2G2_PDREGLO_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDREGLO_LSB) & RF2G_RF2G2_PDREGLO_MASK) -#define RF2G_RF2G2_PDREGLO_RESET 1'h0 -#define RF2G_RF2G2_PDRFGM_MSB 23 -#define RF2G_RF2G2_PDRFGM_LSB 23 -#define RF2G_RF2G2_PDRFGM_MASK 'h00800000 -#define RF2G_RF2G2_PDRFGM_GET(x) (((x) & RF2G_RF2G2_PDRFGM_MASK) >> RF2G_RF2G2_PDRFGM_LSB) -#define RF2G_RF2G2_PDRFGM_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDRFGM_LSB) & RF2G_RF2G2_PDRFGM_MASK) -#define RF2G_RF2G2_PDRFGM_RESET 1'h0 -#define RF2G_RF2G2_PDRXLO_MSB 22 -#define RF2G_RF2G2_PDRXLO_LSB 22 -#define RF2G_RF2G2_PDRXLO_MASK 'h00400000 -#define RF2G_RF2G2_PDRXLO_GET(x) (((x) & RF2G_RF2G2_PDRXLO_MASK) >> RF2G_RF2G2_PDRXLO_LSB) -#define RF2G_RF2G2_PDRXLO_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDRXLO_LSB) & RF2G_RF2G2_PDRXLO_MASK) -#define RF2G_RF2G2_PDRXLO_RESET 1'h0 -#define RF2G_RF2G2_PDTXLO_MSB 21 -#define RF2G_RF2G2_PDTXLO_LSB 21 -#define RF2G_RF2G2_PDTXLO_MASK 'h00200000 -#define RF2G_RF2G2_PDTXLO_GET(x) (((x) & RF2G_RF2G2_PDTXLO_MASK) >> RF2G_RF2G2_PDTXLO_LSB) -#define RF2G_RF2G2_PDTXLO_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDTXLO_LSB) & RF2G_RF2G2_PDTXLO_MASK) -#define RF2G_RF2G2_PDTXLO_RESET 1'h0 -#define RF2G_RF2G2_PDTXMIX_MSB 20 -#define RF2G_RF2G2_PDTXMIX_LSB 20 -#define RF2G_RF2G2_PDTXMIX_MASK 'h00100000 -#define RF2G_RF2G2_PDTXMIX_GET(x) (((x) & RF2G_RF2G2_PDTXMIX_MASK) >> RF2G_RF2G2_PDTXMIX_LSB) -#define RF2G_RF2G2_PDTXMIX_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDTXMIX_LSB) & RF2G_RF2G2_PDTXMIX_MASK) -#define RF2G_RF2G2_PDTXMIX_RESET 1'h0 -#define RF2G_RF2G2_REGLNA_BYPASS_MSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_LSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_MASK 'h00080000 -#define RF2G_RF2G2_REGLNA_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLNA_BYPASS_MASK) >> RF2G_RF2G2_REGLNA_BYPASS_LSB) -#define RF2G_RF2G2_REGLNA_BYPASS_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_REGLNA_BYPASS_LSB) & RF2G_RF2G2_REGLNA_BYPASS_MASK) -#define RF2G_RF2G2_REGLNA_BYPASS_RESET 1'h0 -#define RF2G_RF2G2_REGLO_BYPASS_MSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_LSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_MASK 'h00040000 -#define RF2G_RF2G2_REGLO_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLO_BYPASS_MASK) >> RF2G_RF2G2_REGLO_BYPASS_LSB) -#define RF2G_RF2G2_REGLO_BYPASS_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_REGLO_BYPASS_LSB) & RF2G_RF2G2_REGLO_BYPASS_MASK) -#define RF2G_RF2G2_REGLO_BYPASS_RESET 1'h0 -#define RF2G_RF2G2_ENABLE_PCB_MSB 17 -#define RF2G_RF2G2_ENABLE_PCB_LSB 17 -#define RF2G_RF2G2_ENABLE_PCB_MASK 'h00020000 -#define RF2G_RF2G2_ENABLE_PCB_GET(x) (((x) & RF2G_RF2G2_ENABLE_PCB_MASK) >> RF2G_RF2G2_ENABLE_PCB_LSB) -#define RF2G_RF2G2_ENABLE_PCB_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_ENABLE_PCB_LSB) & RF2G_RF2G2_ENABLE_PCB_MASK) -#define RF2G_RF2G2_ENABLE_PCB_RESET 1'h0 -#define RF2G_RF2G2_SPARE_MSB 16 -#define RF2G_RF2G2_SPARE_LSB 0 -#define RF2G_RF2G2_SPARE_MASK 'h0001ffff -#define RF2G_RF2G2_SPARE_GET(x) (((x) & RF2G_RF2G2_SPARE_MASK) >> RF2G_RF2G2_SPARE_LSB) -#define RF2G_RF2G2_SPARE_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_SPARE_LSB) & RF2G_RF2G2_SPARE_MASK) -#define RF2G_RF2G2_SPARE_RESET 17'h0 -#define RF2G_RF2G2_RESET (32'h0 | \ - RF2G_RF2G2_PDCGLNA_SET(RF2G_RF2G2_PDCGLNA_RESET) | \ - RF2G_RF2G2_PDCGLNABUF_SET(RF2G_RF2G2_PDCGLNABUF_RESET) | \ - RF2G_RF2G2_PDCSLNA_SET(RF2G_RF2G2_PDCSLNA_RESET) | \ - RF2G_RF2G2_PDDIV_SET(RF2G_RF2G2_PDDIV_RESET) | \ - RF2G_RF2G2_PDPADRV_SET(RF2G_RF2G2_PDPADRV_RESET) | \ - RF2G_RF2G2_PDPAOUT_SET(RF2G_RF2G2_PDPAOUT_RESET) | \ - RF2G_RF2G2_PDREGLNA_SET(RF2G_RF2G2_PDREGLNA_RESET) | \ - RF2G_RF2G2_PDREGLO_SET(RF2G_RF2G2_PDREGLO_RESET) | \ - RF2G_RF2G2_PDRFGM_SET(RF2G_RF2G2_PDRFGM_RESET) | \ - RF2G_RF2G2_PDRXLO_SET(RF2G_RF2G2_PDRXLO_RESET) | \ - RF2G_RF2G2_PDTXLO_SET(RF2G_RF2G2_PDTXLO_RESET) | \ - RF2G_RF2G2_PDTXMIX_SET(RF2G_RF2G2_PDTXMIX_RESET) | \ - RF2G_RF2G2_REGLNA_BYPASS_SET(RF2G_RF2G2_REGLNA_BYPASS_RESET) | \ - RF2G_RF2G2_REGLO_BYPASS_SET(RF2G_RF2G2_REGLO_BYPASS_RESET) | \ - RF2G_RF2G2_ENABLE_PCB_SET(RF2G_RF2G2_ENABLE_PCB_RESET) | \ - RF2G_RF2G2_SPARE_SET(RF2G_RF2G2_SPARE_RESET)) -#define RF2G_RF2G2_HW_MASK (32'h0) -#define RF2G_RF2G2_SW_MASK (32'h0 | \ - RF2G_RF2G2_PDCGLNA_MASK | \ - RF2G_RF2G2_PDCGLNABUF_MASK | \ - RF2G_RF2G2_PDCSLNA_MASK | \ - RF2G_RF2G2_PDDIV_MASK | \ - RF2G_RF2G2_PDPADRV_MASK | \ - RF2G_RF2G2_PDPAOUT_MASK | \ - RF2G_RF2G2_PDREGLNA_MASK | \ - RF2G_RF2G2_PDREGLO_MASK | \ - RF2G_RF2G2_PDRFGM_MASK | \ - RF2G_RF2G2_PDRXLO_MASK | \ - RF2G_RF2G2_PDTXLO_MASK | \ - RF2G_RF2G2_PDTXMIX_MASK | \ - RF2G_RF2G2_REGLNA_BYPASS_MASK | \ - RF2G_RF2G2_REGLO_BYPASS_MASK | \ - RF2G_RF2G2_ENABLE_PCB_MASK | \ - RF2G_RF2G2_SPARE_MASK) - -#define RF2G_REG_ADDRESS_MSB 2 - -#endif /* _RF2G_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/rf5G_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/rf5G_reg.h deleted file mode 100644 index 463529e9b62b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/rf5G_reg.h +++ /dev/null @@ -1,195 +0,0 @@ -#ifndef _RF5G_REG_REG_H_ -#define _RF5G_REG_REG_H_ - -#define RF5G_RF5G1_ADDRESS 0x00000000 -#define RF5G_RF5G1_OFFSET 0x00000000 -#define RF5G_RF5G1_PDTXLO5_MSB 31 -#define RF5G_RF5G1_PDTXLO5_LSB 31 -#define RF5G_RF5G1_PDTXLO5_MASK 0x80000000 -#define RF5G_RF5G1_PDTXLO5_GET(x) (((x) & RF5G_RF5G1_PDTXLO5_MASK) >> RF5G_RF5G1_PDTXLO5_LSB) -#define RF5G_RF5G1_PDTXLO5_SET(x) (((x) << RF5G_RF5G1_PDTXLO5_LSB) & RF5G_RF5G1_PDTXLO5_MASK) -#define RF5G_RF5G1_PDTXMIX5_MSB 30 -#define RF5G_RF5G1_PDTXMIX5_LSB 30 -#define RF5G_RF5G1_PDTXMIX5_MASK 0x40000000 -#define RF5G_RF5G1_PDTXMIX5_GET(x) (((x) & RF5G_RF5G1_PDTXMIX5_MASK) >> RF5G_RF5G1_PDTXMIX5_LSB) -#define RF5G_RF5G1_PDTXMIX5_SET(x) (((x) << RF5G_RF5G1_PDTXMIX5_LSB) & RF5G_RF5G1_PDTXMIX5_MASK) -#define RF5G_RF5G1_PDTXBUF5_MSB 29 -#define RF5G_RF5G1_PDTXBUF5_LSB 29 -#define RF5G_RF5G1_PDTXBUF5_MASK 0x20000000 -#define RF5G_RF5G1_PDTXBUF5_GET(x) (((x) & RF5G_RF5G1_PDTXBUF5_MASK) >> RF5G_RF5G1_PDTXBUF5_LSB) -#define RF5G_RF5G1_PDTXBUF5_SET(x) (((x) << RF5G_RF5G1_PDTXBUF5_LSB) & RF5G_RF5G1_PDTXBUF5_MASK) -#define RF5G_RF5G1_PDPADRV5_MSB 28 -#define RF5G_RF5G1_PDPADRV5_LSB 28 -#define RF5G_RF5G1_PDPADRV5_MASK 0x10000000 -#define RF5G_RF5G1_PDPADRV5_GET(x) (((x) & RF5G_RF5G1_PDPADRV5_MASK) >> RF5G_RF5G1_PDPADRV5_LSB) -#define RF5G_RF5G1_PDPADRV5_SET(x) (((x) << RF5G_RF5G1_PDPADRV5_LSB) & RF5G_RF5G1_PDPADRV5_MASK) -#define RF5G_RF5G1_PDPAOUT5_MSB 27 -#define RF5G_RF5G1_PDPAOUT5_LSB 27 -#define RF5G_RF5G1_PDPAOUT5_MASK 0x08000000 -#define RF5G_RF5G1_PDPAOUT5_GET(x) (((x) & RF5G_RF5G1_PDPAOUT5_MASK) >> RF5G_RF5G1_PDPAOUT5_LSB) -#define RF5G_RF5G1_PDPAOUT5_SET(x) (((x) << RF5G_RF5G1_PDPAOUT5_LSB) & RF5G_RF5G1_PDPAOUT5_MASK) -#define RF5G_RF5G1_TUNE_PADRV5_MSB 26 -#define RF5G_RF5G1_TUNE_PADRV5_LSB 24 -#define RF5G_RF5G1_TUNE_PADRV5_MASK 0x07000000 -#define RF5G_RF5G1_TUNE_PADRV5_GET(x) (((x) & RF5G_RF5G1_TUNE_PADRV5_MASK) >> RF5G_RF5G1_TUNE_PADRV5_LSB) -#define RF5G_RF5G1_TUNE_PADRV5_SET(x) (((x) << RF5G_RF5G1_TUNE_PADRV5_LSB) & RF5G_RF5G1_TUNE_PADRV5_MASK) -#define RF5G_RF5G1_PWDTXPKD_MSB 23 -#define RF5G_RF5G1_PWDTXPKD_LSB 21 -#define RF5G_RF5G1_PWDTXPKD_MASK 0x00e00000 -#define RF5G_RF5G1_PWDTXPKD_GET(x) (((x) & RF5G_RF5G1_PWDTXPKD_MASK) >> RF5G_RF5G1_PWDTXPKD_LSB) -#define RF5G_RF5G1_PWDTXPKD_SET(x) (((x) << RF5G_RF5G1_PWDTXPKD_LSB) & RF5G_RF5G1_PWDTXPKD_MASK) -#define RF5G_RF5G1_DB5_MSB 20 -#define RF5G_RF5G1_DB5_LSB 18 -#define RF5G_RF5G1_DB5_MASK 0x001c0000 -#define RF5G_RF5G1_DB5_GET(x) (((x) & RF5G_RF5G1_DB5_MASK) >> RF5G_RF5G1_DB5_LSB) -#define RF5G_RF5G1_DB5_SET(x) (((x) << RF5G_RF5G1_DB5_LSB) & RF5G_RF5G1_DB5_MASK) -#define RF5G_RF5G1_OB5_MSB 17 -#define RF5G_RF5G1_OB5_LSB 15 -#define RF5G_RF5G1_OB5_MASK 0x00038000 -#define RF5G_RF5G1_OB5_GET(x) (((x) & RF5G_RF5G1_OB5_MASK) >> RF5G_RF5G1_OB5_LSB) -#define RF5G_RF5G1_OB5_SET(x) (((x) << RF5G_RF5G1_OB5_LSB) & RF5G_RF5G1_OB5_MASK) -#define RF5G_RF5G1_TX5_ATB_SEL_MSB 14 -#define RF5G_RF5G1_TX5_ATB_SEL_LSB 12 -#define RF5G_RF5G1_TX5_ATB_SEL_MASK 0x00007000 -#define RF5G_RF5G1_TX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_TX5_ATB_SEL_MASK) >> RF5G_RF5G1_TX5_ATB_SEL_LSB) -#define RF5G_RF5G1_TX5_ATB_SEL_SET(x) (((x) << RF5G_RF5G1_TX5_ATB_SEL_LSB) & RF5G_RF5G1_TX5_ATB_SEL_MASK) -#define RF5G_RF5G1_PDLO5DIV_MSB 11 -#define RF5G_RF5G1_PDLO5DIV_LSB 11 -#define RF5G_RF5G1_PDLO5DIV_MASK 0x00000800 -#define RF5G_RF5G1_PDLO5DIV_GET(x) (((x) & RF5G_RF5G1_PDLO5DIV_MASK) >> RF5G_RF5G1_PDLO5DIV_LSB) -#define RF5G_RF5G1_PDLO5DIV_SET(x) (((x) << RF5G_RF5G1_PDLO5DIV_LSB) & RF5G_RF5G1_PDLO5DIV_MASK) -#define RF5G_RF5G1_PDLO5MIX_MSB 10 -#define RF5G_RF5G1_PDLO5MIX_LSB 10 -#define RF5G_RF5G1_PDLO5MIX_MASK 0x00000400 -#define RF5G_RF5G1_PDLO5MIX_GET(x) (((x) & RF5G_RF5G1_PDLO5MIX_MASK) >> RF5G_RF5G1_PDLO5MIX_LSB) -#define RF5G_RF5G1_PDLO5MIX_SET(x) (((x) << RF5G_RF5G1_PDLO5MIX_LSB) & RF5G_RF5G1_PDLO5MIX_MASK) -#define RF5G_RF5G1_PDQBUF5_MSB 9 -#define RF5G_RF5G1_PDQBUF5_LSB 9 -#define RF5G_RF5G1_PDQBUF5_MASK 0x00000200 -#define RF5G_RF5G1_PDQBUF5_GET(x) (((x) & RF5G_RF5G1_PDQBUF5_MASK) >> RF5G_RF5G1_PDQBUF5_LSB) -#define RF5G_RF5G1_PDQBUF5_SET(x) (((x) << RF5G_RF5G1_PDQBUF5_LSB) & RF5G_RF5G1_PDQBUF5_MASK) -#define RF5G_RF5G1_PDLO5AGC_MSB 8 -#define RF5G_RF5G1_PDLO5AGC_LSB 8 -#define RF5G_RF5G1_PDLO5AGC_MASK 0x00000100 -#define RF5G_RF5G1_PDLO5AGC_GET(x) (((x) & RF5G_RF5G1_PDLO5AGC_MASK) >> RF5G_RF5G1_PDLO5AGC_LSB) -#define RF5G_RF5G1_PDLO5AGC_SET(x) (((x) << RF5G_RF5G1_PDLO5AGC_LSB) & RF5G_RF5G1_PDLO5AGC_MASK) -#define RF5G_RF5G1_PDREGLO5_MSB 7 -#define RF5G_RF5G1_PDREGLO5_LSB 7 -#define RF5G_RF5G1_PDREGLO5_MASK 0x00000080 -#define RF5G_RF5G1_PDREGLO5_GET(x) (((x) & RF5G_RF5G1_PDREGLO5_MASK) >> RF5G_RF5G1_PDREGLO5_LSB) -#define RF5G_RF5G1_PDREGLO5_SET(x) (((x) << RF5G_RF5G1_PDREGLO5_LSB) & RF5G_RF5G1_PDREGLO5_MASK) -#define RF5G_RF5G1_LO5_ATB_SEL_MSB 6 -#define RF5G_RF5G1_LO5_ATB_SEL_LSB 4 -#define RF5G_RF5G1_LO5_ATB_SEL_MASK 0x00000070 -#define RF5G_RF5G1_LO5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_LO5_ATB_SEL_MASK) >> RF5G_RF5G1_LO5_ATB_SEL_LSB) -#define RF5G_RF5G1_LO5_ATB_SEL_SET(x) (((x) << RF5G_RF5G1_LO5_ATB_SEL_LSB) & RF5G_RF5G1_LO5_ATB_SEL_MASK) -#define RF5G_RF5G1_LO5CONTROL_MSB 3 -#define RF5G_RF5G1_LO5CONTROL_LSB 3 -#define RF5G_RF5G1_LO5CONTROL_MASK 0x00000008 -#define RF5G_RF5G1_LO5CONTROL_GET(x) (((x) & RF5G_RF5G1_LO5CONTROL_MASK) >> RF5G_RF5G1_LO5CONTROL_LSB) -#define RF5G_RF5G1_LO5CONTROL_SET(x) (((x) << RF5G_RF5G1_LO5CONTROL_LSB) & RF5G_RF5G1_LO5CONTROL_MASK) -#define RF5G_RF5G1_REGLO_BYPASS5_MSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_LSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_MASK 0x00000004 -#define RF5G_RF5G1_REGLO_BYPASS5_GET(x) (((x) & RF5G_RF5G1_REGLO_BYPASS5_MASK) >> RF5G_RF5G1_REGLO_BYPASS5_LSB) -#define RF5G_RF5G1_REGLO_BYPASS5_SET(x) (((x) << RF5G_RF5G1_REGLO_BYPASS5_LSB) & RF5G_RF5G1_REGLO_BYPASS5_MASK) -#define RF5G_RF5G1_SPARE_MSB 1 -#define RF5G_RF5G1_SPARE_LSB 0 -#define RF5G_RF5G1_SPARE_MASK 0x00000003 -#define RF5G_RF5G1_SPARE_GET(x) (((x) & RF5G_RF5G1_SPARE_MASK) >> RF5G_RF5G1_SPARE_LSB) -#define RF5G_RF5G1_SPARE_SET(x) (((x) << RF5G_RF5G1_SPARE_LSB) & RF5G_RF5G1_SPARE_MASK) - -#define RF5G_RF5G2_ADDRESS 0x00000004 -#define RF5G_RF5G2_OFFSET 0x00000004 -#define RF5G_RF5G2_AGCLO_B_MSB 31 -#define RF5G_RF5G2_AGCLO_B_LSB 29 -#define RF5G_RF5G2_AGCLO_B_MASK 0xe0000000 -#define RF5G_RF5G2_AGCLO_B_GET(x) (((x) & RF5G_RF5G2_AGCLO_B_MASK) >> RF5G_RF5G2_AGCLO_B_LSB) -#define RF5G_RF5G2_AGCLO_B_SET(x) (((x) << RF5G_RF5G2_AGCLO_B_LSB) & RF5G_RF5G2_AGCLO_B_MASK) -#define RF5G_RF5G2_RX5_ATB_SEL_MSB 28 -#define RF5G_RF5G2_RX5_ATB_SEL_LSB 26 -#define RF5G_RF5G2_RX5_ATB_SEL_MASK 0x1c000000 -#define RF5G_RF5G2_RX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G2_RX5_ATB_SEL_MASK) >> RF5G_RF5G2_RX5_ATB_SEL_LSB) -#define RF5G_RF5G2_RX5_ATB_SEL_SET(x) (((x) << RF5G_RF5G2_RX5_ATB_SEL_LSB) & RF5G_RF5G2_RX5_ATB_SEL_MASK) -#define RF5G_RF5G2_PDCMOSLO5_MSB 25 -#define RF5G_RF5G2_PDCMOSLO5_LSB 25 -#define RF5G_RF5G2_PDCMOSLO5_MASK 0x02000000 -#define RF5G_RF5G2_PDCMOSLO5_GET(x) (((x) & RF5G_RF5G2_PDCMOSLO5_MASK) >> RF5G_RF5G2_PDCMOSLO5_LSB) -#define RF5G_RF5G2_PDCMOSLO5_SET(x) (((x) << RF5G_RF5G2_PDCMOSLO5_LSB) & RF5G_RF5G2_PDCMOSLO5_MASK) -#define RF5G_RF5G2_PDVGM5_MSB 24 -#define RF5G_RF5G2_PDVGM5_LSB 24 -#define RF5G_RF5G2_PDVGM5_MASK 0x01000000 -#define RF5G_RF5G2_PDVGM5_GET(x) (((x) & RF5G_RF5G2_PDVGM5_MASK) >> RF5G_RF5G2_PDVGM5_LSB) -#define RF5G_RF5G2_PDVGM5_SET(x) (((x) << RF5G_RF5G2_PDVGM5_LSB) & RF5G_RF5G2_PDVGM5_MASK) -#define RF5G_RF5G2_PDCSLNA5_MSB 23 -#define RF5G_RF5G2_PDCSLNA5_LSB 23 -#define RF5G_RF5G2_PDCSLNA5_MASK 0x00800000 -#define RF5G_RF5G2_PDCSLNA5_GET(x) (((x) & RF5G_RF5G2_PDCSLNA5_MASK) >> RF5G_RF5G2_PDCSLNA5_LSB) -#define RF5G_RF5G2_PDCSLNA5_SET(x) (((x) << RF5G_RF5G2_PDCSLNA5_LSB) & RF5G_RF5G2_PDCSLNA5_MASK) -#define RF5G_RF5G2_PDRFVGA5_MSB 22 -#define RF5G_RF5G2_PDRFVGA5_LSB 22 -#define RF5G_RF5G2_PDRFVGA5_MASK 0x00400000 -#define RF5G_RF5G2_PDRFVGA5_GET(x) (((x) & RF5G_RF5G2_PDRFVGA5_MASK) >> RF5G_RF5G2_PDRFVGA5_LSB) -#define RF5G_RF5G2_PDRFVGA5_SET(x) (((x) << RF5G_RF5G2_PDRFVGA5_LSB) & RF5G_RF5G2_PDRFVGA5_MASK) -#define RF5G_RF5G2_PDREGFE5_MSB 21 -#define RF5G_RF5G2_PDREGFE5_LSB 21 -#define RF5G_RF5G2_PDREGFE5_MASK 0x00200000 -#define RF5G_RF5G2_PDREGFE5_GET(x) (((x) & RF5G_RF5G2_PDREGFE5_MASK) >> RF5G_RF5G2_PDREGFE5_LSB) -#define RF5G_RF5G2_PDREGFE5_SET(x) (((x) << RF5G_RF5G2_PDREGFE5_LSB) & RF5G_RF5G2_PDREGFE5_MASK) -#define RF5G_RF5G2_TUNE_RFVGA5_MSB 20 -#define RF5G_RF5G2_TUNE_RFVGA5_LSB 18 -#define RF5G_RF5G2_TUNE_RFVGA5_MASK 0x001c0000 -#define RF5G_RF5G2_TUNE_RFVGA5_GET(x) (((x) & RF5G_RF5G2_TUNE_RFVGA5_MASK) >> RF5G_RF5G2_TUNE_RFVGA5_LSB) -#define RF5G_RF5G2_TUNE_RFVGA5_SET(x) (((x) << RF5G_RF5G2_TUNE_RFVGA5_LSB) & RF5G_RF5G2_TUNE_RFVGA5_MASK) -#define RF5G_RF5G2_BRFVGA5_MSB 17 -#define RF5G_RF5G2_BRFVGA5_LSB 15 -#define RF5G_RF5G2_BRFVGA5_MASK 0x00038000 -#define RF5G_RF5G2_BRFVGA5_GET(x) (((x) & RF5G_RF5G2_BRFVGA5_MASK) >> RF5G_RF5G2_BRFVGA5_LSB) -#define RF5G_RF5G2_BRFVGA5_SET(x) (((x) << RF5G_RF5G2_BRFVGA5_LSB) & RF5G_RF5G2_BRFVGA5_MASK) -#define RF5G_RF5G2_BCSLNA5_MSB 14 -#define RF5G_RF5G2_BCSLNA5_LSB 12 -#define RF5G_RF5G2_BCSLNA5_MASK 0x00007000 -#define RF5G_RF5G2_BCSLNA5_GET(x) (((x) & RF5G_RF5G2_BCSLNA5_MASK) >> RF5G_RF5G2_BCSLNA5_LSB) -#define RF5G_RF5G2_BCSLNA5_SET(x) (((x) << RF5G_RF5G2_BCSLNA5_LSB) & RF5G_RF5G2_BCSLNA5_MASK) -#define RF5G_RF5G2_BVGM5_MSB 11 -#define RF5G_RF5G2_BVGM5_LSB 9 -#define RF5G_RF5G2_BVGM5_MASK 0x00000e00 -#define RF5G_RF5G2_BVGM5_GET(x) (((x) & RF5G_RF5G2_BVGM5_MASK) >> RF5G_RF5G2_BVGM5_LSB) -#define RF5G_RF5G2_BVGM5_SET(x) (((x) << RF5G_RF5G2_BVGM5_LSB) & RF5G_RF5G2_BVGM5_MASK) -#define RF5G_RF5G2_REGFE_BYPASS5_MSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_LSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_MASK 0x00000100 -#define RF5G_RF5G2_REGFE_BYPASS5_GET(x) (((x) & RF5G_RF5G2_REGFE_BYPASS5_MASK) >> RF5G_RF5G2_REGFE_BYPASS5_LSB) -#define RF5G_RF5G2_REGFE_BYPASS5_SET(x) (((x) << RF5G_RF5G2_REGFE_BYPASS5_LSB) & RF5G_RF5G2_REGFE_BYPASS5_MASK) -#define RF5G_RF5G2_LNA5_ATTENMODE_MSB 7 -#define RF5G_RF5G2_LNA5_ATTENMODE_LSB 6 -#define RF5G_RF5G2_LNA5_ATTENMODE_MASK 0x000000c0 -#define RF5G_RF5G2_LNA5_ATTENMODE_GET(x) (((x) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) >> RF5G_RF5G2_LNA5_ATTENMODE_LSB) -#define RF5G_RF5G2_LNA5_ATTENMODE_SET(x) (((x) << RF5G_RF5G2_LNA5_ATTENMODE_LSB) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) -#define RF5G_RF5G2_ENABLE_PCA_MSB 5 -#define RF5G_RF5G2_ENABLE_PCA_LSB 5 -#define RF5G_RF5G2_ENABLE_PCA_MASK 0x00000020 -#define RF5G_RF5G2_ENABLE_PCA_GET(x) (((x) & RF5G_RF5G2_ENABLE_PCA_MASK) >> RF5G_RF5G2_ENABLE_PCA_LSB) -#define RF5G_RF5G2_ENABLE_PCA_SET(x) (((x) << RF5G_RF5G2_ENABLE_PCA_LSB) & RF5G_RF5G2_ENABLE_PCA_MASK) -#define RF5G_RF5G2_TUNE_LO_MSB 4 -#define RF5G_RF5G2_TUNE_LO_LSB 2 -#define RF5G_RF5G2_TUNE_LO_MASK 0x0000001c -#define RF5G_RF5G2_TUNE_LO_GET(x) (((x) & RF5G_RF5G2_TUNE_LO_MASK) >> RF5G_RF5G2_TUNE_LO_LSB) -#define RF5G_RF5G2_TUNE_LO_SET(x) (((x) << RF5G_RF5G2_TUNE_LO_LSB) & RF5G_RF5G2_TUNE_LO_MASK) -#define RF5G_RF5G2_SPARE_MSB 1 -#define RF5G_RF5G2_SPARE_LSB 0 -#define RF5G_RF5G2_SPARE_MASK 0x00000003 -#define RF5G_RF5G2_SPARE_GET(x) (((x) & RF5G_RF5G2_SPARE_MASK) >> RF5G_RF5G2_SPARE_LSB) -#define RF5G_RF5G2_SPARE_SET(x) (((x) << RF5G_RF5G2_SPARE_LSB) & RF5G_RF5G2_SPARE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct rf5g_reg_reg_s { - volatile unsigned int rf5g_rf5g1; - volatile unsigned int rf5g_rf5g2; -} rf5g_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _RF5G_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/rf5G_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/rf5G_reg.vrh deleted file mode 100644 index 6627936f3063..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/rf5G_reg.vrh +++ /dev/null @@ -1,296 +0,0 @@ -#ifndef _RF5G_REG_VRH_ -#define _RF5G_REG_VRH_ - -#define RF5G_RF5G1_ADDRESS 'h00000000 -#define RF5G_RF5G1_PDTXLO5_MSB 31 -#define RF5G_RF5G1_PDTXLO5_LSB 31 -#define RF5G_RF5G1_PDTXLO5_MASK 'h80000000 -#define RF5G_RF5G1_PDTXLO5_GET(x) (((x) & RF5G_RF5G1_PDTXLO5_MASK) >> RF5G_RF5G1_PDTXLO5_LSB) -#define RF5G_RF5G1_PDTXLO5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDTXLO5_LSB) & RF5G_RF5G1_PDTXLO5_MASK) -#define RF5G_RF5G1_PDTXLO5_RESET 1'h0 -#define RF5G_RF5G1_PDTXMIX5_MSB 30 -#define RF5G_RF5G1_PDTXMIX5_LSB 30 -#define RF5G_RF5G1_PDTXMIX5_MASK 'h40000000 -#define RF5G_RF5G1_PDTXMIX5_GET(x) (((x) & RF5G_RF5G1_PDTXMIX5_MASK) >> RF5G_RF5G1_PDTXMIX5_LSB) -#define RF5G_RF5G1_PDTXMIX5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDTXMIX5_LSB) & RF5G_RF5G1_PDTXMIX5_MASK) -#define RF5G_RF5G1_PDTXMIX5_RESET 1'h0 -#define RF5G_RF5G1_PDTXBUF5_MSB 29 -#define RF5G_RF5G1_PDTXBUF5_LSB 29 -#define RF5G_RF5G1_PDTXBUF5_MASK 'h20000000 -#define RF5G_RF5G1_PDTXBUF5_GET(x) (((x) & RF5G_RF5G1_PDTXBUF5_MASK) >> RF5G_RF5G1_PDTXBUF5_LSB) -#define RF5G_RF5G1_PDTXBUF5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDTXBUF5_LSB) & RF5G_RF5G1_PDTXBUF5_MASK) -#define RF5G_RF5G1_PDTXBUF5_RESET 1'h0 -#define RF5G_RF5G1_PDPADRV5_MSB 28 -#define RF5G_RF5G1_PDPADRV5_LSB 28 -#define RF5G_RF5G1_PDPADRV5_MASK 'h10000000 -#define RF5G_RF5G1_PDPADRV5_GET(x) (((x) & RF5G_RF5G1_PDPADRV5_MASK) >> RF5G_RF5G1_PDPADRV5_LSB) -#define RF5G_RF5G1_PDPADRV5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDPADRV5_LSB) & RF5G_RF5G1_PDPADRV5_MASK) -#define RF5G_RF5G1_PDPADRV5_RESET 1'h0 -#define RF5G_RF5G1_PDPAOUT5_MSB 27 -#define RF5G_RF5G1_PDPAOUT5_LSB 27 -#define RF5G_RF5G1_PDPAOUT5_MASK 'h08000000 -#define RF5G_RF5G1_PDPAOUT5_GET(x) (((x) & RF5G_RF5G1_PDPAOUT5_MASK) >> RF5G_RF5G1_PDPAOUT5_LSB) -#define RF5G_RF5G1_PDPAOUT5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDPAOUT5_LSB) & RF5G_RF5G1_PDPAOUT5_MASK) -#define RF5G_RF5G1_PDPAOUT5_RESET 1'h0 -#define RF5G_RF5G1_TUNE_PADRV5_MSB 26 -#define RF5G_RF5G1_TUNE_PADRV5_LSB 24 -#define RF5G_RF5G1_TUNE_PADRV5_MASK 'h07000000 -#define RF5G_RF5G1_TUNE_PADRV5_GET(x) (((x) & RF5G_RF5G1_TUNE_PADRV5_MASK) >> RF5G_RF5G1_TUNE_PADRV5_LSB) -#define RF5G_RF5G1_TUNE_PADRV5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_TUNE_PADRV5_LSB) & RF5G_RF5G1_TUNE_PADRV5_MASK) -#define RF5G_RF5G1_TUNE_PADRV5_RESET 3'h0 -#define RF5G_RF5G1_PWDTXPKD_MSB 23 -#define RF5G_RF5G1_PWDTXPKD_LSB 21 -#define RF5G_RF5G1_PWDTXPKD_MASK 'h00e00000 -#define RF5G_RF5G1_PWDTXPKD_GET(x) (((x) & RF5G_RF5G1_PWDTXPKD_MASK) >> RF5G_RF5G1_PWDTXPKD_LSB) -#define RF5G_RF5G1_PWDTXPKD_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PWDTXPKD_LSB) & RF5G_RF5G1_PWDTXPKD_MASK) -#define RF5G_RF5G1_PWDTXPKD_RESET 3'h7 -#define RF5G_RF5G1_DB5_MSB 20 -#define RF5G_RF5G1_DB5_LSB 18 -#define RF5G_RF5G1_DB5_MASK 'h001c0000 -#define RF5G_RF5G1_DB5_GET(x) (((x) & RF5G_RF5G1_DB5_MASK) >> RF5G_RF5G1_DB5_LSB) -#define RF5G_RF5G1_DB5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_DB5_LSB) & RF5G_RF5G1_DB5_MASK) -#define RF5G_RF5G1_DB5_RESET 3'h4 -#define RF5G_RF5G1_OB5_MSB 17 -#define RF5G_RF5G1_OB5_LSB 15 -#define RF5G_RF5G1_OB5_MASK 'h00038000 -#define RF5G_RF5G1_OB5_GET(x) (((x) & RF5G_RF5G1_OB5_MASK) >> RF5G_RF5G1_OB5_LSB) -#define RF5G_RF5G1_OB5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_OB5_LSB) & RF5G_RF5G1_OB5_MASK) -#define RF5G_RF5G1_OB5_RESET 3'h4 -#define RF5G_RF5G1_TX5_ATB_SEL_MSB 14 -#define RF5G_RF5G1_TX5_ATB_SEL_LSB 12 -#define RF5G_RF5G1_TX5_ATB_SEL_MASK 'h00007000 -#define RF5G_RF5G1_TX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_TX5_ATB_SEL_MASK) >> RF5G_RF5G1_TX5_ATB_SEL_LSB) -#define RF5G_RF5G1_TX5_ATB_SEL_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_TX5_ATB_SEL_LSB) & RF5G_RF5G1_TX5_ATB_SEL_MASK) -#define RF5G_RF5G1_TX5_ATB_SEL_RESET 3'h0 -#define RF5G_RF5G1_PDLO5DIV_MSB 11 -#define RF5G_RF5G1_PDLO5DIV_LSB 11 -#define RF5G_RF5G1_PDLO5DIV_MASK 'h00000800 -#define RF5G_RF5G1_PDLO5DIV_GET(x) (((x) & RF5G_RF5G1_PDLO5DIV_MASK) >> RF5G_RF5G1_PDLO5DIV_LSB) -#define RF5G_RF5G1_PDLO5DIV_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDLO5DIV_LSB) & RF5G_RF5G1_PDLO5DIV_MASK) -#define RF5G_RF5G1_PDLO5DIV_RESET 1'h0 -#define RF5G_RF5G1_PDLO5MIX_MSB 10 -#define RF5G_RF5G1_PDLO5MIX_LSB 10 -#define RF5G_RF5G1_PDLO5MIX_MASK 'h00000400 -#define RF5G_RF5G1_PDLO5MIX_GET(x) (((x) & RF5G_RF5G1_PDLO5MIX_MASK) >> RF5G_RF5G1_PDLO5MIX_LSB) -#define RF5G_RF5G1_PDLO5MIX_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDLO5MIX_LSB) & RF5G_RF5G1_PDLO5MIX_MASK) -#define RF5G_RF5G1_PDLO5MIX_RESET 1'h0 -#define RF5G_RF5G1_PDQBUF5_MSB 9 -#define RF5G_RF5G1_PDQBUF5_LSB 9 -#define RF5G_RF5G1_PDQBUF5_MASK 'h00000200 -#define RF5G_RF5G1_PDQBUF5_GET(x) (((x) & RF5G_RF5G1_PDQBUF5_MASK) >> RF5G_RF5G1_PDQBUF5_LSB) -#define RF5G_RF5G1_PDQBUF5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDQBUF5_LSB) & RF5G_RF5G1_PDQBUF5_MASK) -#define RF5G_RF5G1_PDQBUF5_RESET 1'h0 -#define RF5G_RF5G1_PDLO5AGC_MSB 8 -#define RF5G_RF5G1_PDLO5AGC_LSB 8 -#define RF5G_RF5G1_PDLO5AGC_MASK 'h00000100 -#define RF5G_RF5G1_PDLO5AGC_GET(x) (((x) & RF5G_RF5G1_PDLO5AGC_MASK) >> RF5G_RF5G1_PDLO5AGC_LSB) -#define RF5G_RF5G1_PDLO5AGC_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDLO5AGC_LSB) & RF5G_RF5G1_PDLO5AGC_MASK) -#define RF5G_RF5G1_PDLO5AGC_RESET 1'h0 -#define RF5G_RF5G1_PDREGLO5_MSB 7 -#define RF5G_RF5G1_PDREGLO5_LSB 7 -#define RF5G_RF5G1_PDREGLO5_MASK 'h00000080 -#define RF5G_RF5G1_PDREGLO5_GET(x) (((x) & RF5G_RF5G1_PDREGLO5_MASK) >> RF5G_RF5G1_PDREGLO5_LSB) -#define RF5G_RF5G1_PDREGLO5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDREGLO5_LSB) & RF5G_RF5G1_PDREGLO5_MASK) -#define RF5G_RF5G1_PDREGLO5_RESET 1'h0 -#define RF5G_RF5G1_LO5_ATB_SEL_MSB 6 -#define RF5G_RF5G1_LO5_ATB_SEL_LSB 4 -#define RF5G_RF5G1_LO5_ATB_SEL_MASK 'h00000070 -#define RF5G_RF5G1_LO5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_LO5_ATB_SEL_MASK) >> RF5G_RF5G1_LO5_ATB_SEL_LSB) -#define RF5G_RF5G1_LO5_ATB_SEL_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_LO5_ATB_SEL_LSB) & RF5G_RF5G1_LO5_ATB_SEL_MASK) -#define RF5G_RF5G1_LO5_ATB_SEL_RESET 3'h0 -#define RF5G_RF5G1_LO5CONTROL_MSB 3 -#define RF5G_RF5G1_LO5CONTROL_LSB 3 -#define RF5G_RF5G1_LO5CONTROL_MASK 'h00000008 -#define RF5G_RF5G1_LO5CONTROL_GET(x) (((x) & RF5G_RF5G1_LO5CONTROL_MASK) >> RF5G_RF5G1_LO5CONTROL_LSB) -#define RF5G_RF5G1_LO5CONTROL_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_LO5CONTROL_LSB) & RF5G_RF5G1_LO5CONTROL_MASK) -#define RF5G_RF5G1_LO5CONTROL_RESET 1'h0 -#define RF5G_RF5G1_REGLO_BYPASS5_MSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_LSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_MASK 'h00000004 -#define RF5G_RF5G1_REGLO_BYPASS5_GET(x) (((x) & RF5G_RF5G1_REGLO_BYPASS5_MASK) >> RF5G_RF5G1_REGLO_BYPASS5_LSB) -#define RF5G_RF5G1_REGLO_BYPASS5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_REGLO_BYPASS5_LSB) & RF5G_RF5G1_REGLO_BYPASS5_MASK) -#define RF5G_RF5G1_REGLO_BYPASS5_RESET 1'h0 -#define RF5G_RF5G1_SPARE_MSB 1 -#define RF5G_RF5G1_SPARE_LSB 0 -#define RF5G_RF5G1_SPARE_MASK 'h00000003 -#define RF5G_RF5G1_SPARE_GET(x) (((x) & RF5G_RF5G1_SPARE_MASK) >> RF5G_RF5G1_SPARE_LSB) -#define RF5G_RF5G1_SPARE_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_SPARE_LSB) & RF5G_RF5G1_SPARE_MASK) -#define RF5G_RF5G1_SPARE_RESET 2'h0 -#define RF5G_RF5G1_RESET (32'h0 | \ - RF5G_RF5G1_PDTXLO5_SET(RF5G_RF5G1_PDTXLO5_RESET) | \ - RF5G_RF5G1_PDTXMIX5_SET(RF5G_RF5G1_PDTXMIX5_RESET) | \ - RF5G_RF5G1_PDTXBUF5_SET(RF5G_RF5G1_PDTXBUF5_RESET) | \ - RF5G_RF5G1_PDPADRV5_SET(RF5G_RF5G1_PDPADRV5_RESET) | \ - RF5G_RF5G1_PDPAOUT5_SET(RF5G_RF5G1_PDPAOUT5_RESET) | \ - RF5G_RF5G1_TUNE_PADRV5_SET(RF5G_RF5G1_TUNE_PADRV5_RESET) | \ - RF5G_RF5G1_PWDTXPKD_SET(RF5G_RF5G1_PWDTXPKD_RESET) | \ - RF5G_RF5G1_DB5_SET(RF5G_RF5G1_DB5_RESET) | \ - RF5G_RF5G1_OB5_SET(RF5G_RF5G1_OB5_RESET) | \ - RF5G_RF5G1_TX5_ATB_SEL_SET(RF5G_RF5G1_TX5_ATB_SEL_RESET) | \ - RF5G_RF5G1_PDLO5DIV_SET(RF5G_RF5G1_PDLO5DIV_RESET) | \ - RF5G_RF5G1_PDLO5MIX_SET(RF5G_RF5G1_PDLO5MIX_RESET) | \ - RF5G_RF5G1_PDQBUF5_SET(RF5G_RF5G1_PDQBUF5_RESET) | \ - RF5G_RF5G1_PDLO5AGC_SET(RF5G_RF5G1_PDLO5AGC_RESET) | \ - RF5G_RF5G1_PDREGLO5_SET(RF5G_RF5G1_PDREGLO5_RESET) | \ - RF5G_RF5G1_LO5_ATB_SEL_SET(RF5G_RF5G1_LO5_ATB_SEL_RESET) | \ - RF5G_RF5G1_LO5CONTROL_SET(RF5G_RF5G1_LO5CONTROL_RESET) | \ - RF5G_RF5G1_REGLO_BYPASS5_SET(RF5G_RF5G1_REGLO_BYPASS5_RESET) | \ - RF5G_RF5G1_SPARE_SET(RF5G_RF5G1_SPARE_RESET)) -#define RF5G_RF5G1_HW_MASK (32'h0) -#define RF5G_RF5G1_SW_MASK (32'h0 | \ - RF5G_RF5G1_PDTXLO5_MASK | \ - RF5G_RF5G1_PDTXMIX5_MASK | \ - RF5G_RF5G1_PDTXBUF5_MASK | \ - RF5G_RF5G1_PDPADRV5_MASK | \ - RF5G_RF5G1_PDPAOUT5_MASK | \ - RF5G_RF5G1_TUNE_PADRV5_MASK | \ - RF5G_RF5G1_PWDTXPKD_MASK | \ - RF5G_RF5G1_DB5_MASK | \ - RF5G_RF5G1_OB5_MASK | \ - RF5G_RF5G1_TX5_ATB_SEL_MASK | \ - RF5G_RF5G1_PDLO5DIV_MASK | \ - RF5G_RF5G1_PDLO5MIX_MASK | \ - RF5G_RF5G1_PDQBUF5_MASK | \ - RF5G_RF5G1_PDLO5AGC_MASK | \ - RF5G_RF5G1_PDREGLO5_MASK | \ - RF5G_RF5G1_LO5_ATB_SEL_MASK | \ - RF5G_RF5G1_LO5CONTROL_MASK | \ - RF5G_RF5G1_REGLO_BYPASS5_MASK | \ - RF5G_RF5G1_SPARE_MASK) - -#define RF5G_RF5G2_ADDRESS 'h00000004 -#define RF5G_RF5G2_AGCLO_B_MSB 31 -#define RF5G_RF5G2_AGCLO_B_LSB 29 -#define RF5G_RF5G2_AGCLO_B_MASK 'he0000000 -#define RF5G_RF5G2_AGCLO_B_GET(x) (((x) & RF5G_RF5G2_AGCLO_B_MASK) >> RF5G_RF5G2_AGCLO_B_LSB) -#define RF5G_RF5G2_AGCLO_B_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_AGCLO_B_LSB) & RF5G_RF5G2_AGCLO_B_MASK) -#define RF5G_RF5G2_AGCLO_B_RESET 3'h4 -#define RF5G_RF5G2_RX5_ATB_SEL_MSB 28 -#define RF5G_RF5G2_RX5_ATB_SEL_LSB 26 -#define RF5G_RF5G2_RX5_ATB_SEL_MASK 'h1c000000 -#define RF5G_RF5G2_RX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G2_RX5_ATB_SEL_MASK) >> RF5G_RF5G2_RX5_ATB_SEL_LSB) -#define RF5G_RF5G2_RX5_ATB_SEL_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_RX5_ATB_SEL_LSB) & RF5G_RF5G2_RX5_ATB_SEL_MASK) -#define RF5G_RF5G2_RX5_ATB_SEL_RESET 3'h0 -#define RF5G_RF5G2_PDCMOSLO5_MSB 25 -#define RF5G_RF5G2_PDCMOSLO5_LSB 25 -#define RF5G_RF5G2_PDCMOSLO5_MASK 'h02000000 -#define RF5G_RF5G2_PDCMOSLO5_GET(x) (((x) & RF5G_RF5G2_PDCMOSLO5_MASK) >> RF5G_RF5G2_PDCMOSLO5_LSB) -#define RF5G_RF5G2_PDCMOSLO5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDCMOSLO5_LSB) & RF5G_RF5G2_PDCMOSLO5_MASK) -#define RF5G_RF5G2_PDCMOSLO5_RESET 1'h0 -#define RF5G_RF5G2_PDVGM5_MSB 24 -#define RF5G_RF5G2_PDVGM5_LSB 24 -#define RF5G_RF5G2_PDVGM5_MASK 'h01000000 -#define RF5G_RF5G2_PDVGM5_GET(x) (((x) & RF5G_RF5G2_PDVGM5_MASK) >> RF5G_RF5G2_PDVGM5_LSB) -#define RF5G_RF5G2_PDVGM5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDVGM5_LSB) & RF5G_RF5G2_PDVGM5_MASK) -#define RF5G_RF5G2_PDVGM5_RESET 1'h0 -#define RF5G_RF5G2_PDCSLNA5_MSB 23 -#define RF5G_RF5G2_PDCSLNA5_LSB 23 -#define RF5G_RF5G2_PDCSLNA5_MASK 'h00800000 -#define RF5G_RF5G2_PDCSLNA5_GET(x) (((x) & RF5G_RF5G2_PDCSLNA5_MASK) >> RF5G_RF5G2_PDCSLNA5_LSB) -#define RF5G_RF5G2_PDCSLNA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDCSLNA5_LSB) & RF5G_RF5G2_PDCSLNA5_MASK) -#define RF5G_RF5G2_PDCSLNA5_RESET 1'h0 -#define RF5G_RF5G2_PDRFVGA5_MSB 22 -#define RF5G_RF5G2_PDRFVGA5_LSB 22 -#define RF5G_RF5G2_PDRFVGA5_MASK 'h00400000 -#define RF5G_RF5G2_PDRFVGA5_GET(x) (((x) & RF5G_RF5G2_PDRFVGA5_MASK) >> RF5G_RF5G2_PDRFVGA5_LSB) -#define RF5G_RF5G2_PDRFVGA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDRFVGA5_LSB) & RF5G_RF5G2_PDRFVGA5_MASK) -#define RF5G_RF5G2_PDRFVGA5_RESET 1'h0 -#define RF5G_RF5G2_PDREGFE5_MSB 21 -#define RF5G_RF5G2_PDREGFE5_LSB 21 -#define RF5G_RF5G2_PDREGFE5_MASK 'h00200000 -#define RF5G_RF5G2_PDREGFE5_GET(x) (((x) & RF5G_RF5G2_PDREGFE5_MASK) >> RF5G_RF5G2_PDREGFE5_LSB) -#define RF5G_RF5G2_PDREGFE5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDREGFE5_LSB) & RF5G_RF5G2_PDREGFE5_MASK) -#define RF5G_RF5G2_PDREGFE5_RESET 1'h0 -#define RF5G_RF5G2_TUNE_RFVGA5_MSB 20 -#define RF5G_RF5G2_TUNE_RFVGA5_LSB 18 -#define RF5G_RF5G2_TUNE_RFVGA5_MASK 'h001c0000 -#define RF5G_RF5G2_TUNE_RFVGA5_GET(x) (((x) & RF5G_RF5G2_TUNE_RFVGA5_MASK) >> RF5G_RF5G2_TUNE_RFVGA5_LSB) -#define RF5G_RF5G2_TUNE_RFVGA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_TUNE_RFVGA5_LSB) & RF5G_RF5G2_TUNE_RFVGA5_MASK) -#define RF5G_RF5G2_TUNE_RFVGA5_RESET 3'h0 -#define RF5G_RF5G2_BRFVGA5_MSB 17 -#define RF5G_RF5G2_BRFVGA5_LSB 15 -#define RF5G_RF5G2_BRFVGA5_MASK 'h00038000 -#define RF5G_RF5G2_BRFVGA5_GET(x) (((x) & RF5G_RF5G2_BRFVGA5_MASK) >> RF5G_RF5G2_BRFVGA5_LSB) -#define RF5G_RF5G2_BRFVGA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_BRFVGA5_LSB) & RF5G_RF5G2_BRFVGA5_MASK) -#define RF5G_RF5G2_BRFVGA5_RESET 3'h5 -#define RF5G_RF5G2_BCSLNA5_MSB 14 -#define RF5G_RF5G2_BCSLNA5_LSB 12 -#define RF5G_RF5G2_BCSLNA5_MASK 'h00007000 -#define RF5G_RF5G2_BCSLNA5_GET(x) (((x) & RF5G_RF5G2_BCSLNA5_MASK) >> RF5G_RF5G2_BCSLNA5_LSB) -#define RF5G_RF5G2_BCSLNA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_BCSLNA5_LSB) & RF5G_RF5G2_BCSLNA5_MASK) -#define RF5G_RF5G2_BCSLNA5_RESET 3'h3 -#define RF5G_RF5G2_BVGM5_MSB 11 -#define RF5G_RF5G2_BVGM5_LSB 9 -#define RF5G_RF5G2_BVGM5_MASK 'h00000e00 -#define RF5G_RF5G2_BVGM5_GET(x) (((x) & RF5G_RF5G2_BVGM5_MASK) >> RF5G_RF5G2_BVGM5_LSB) -#define RF5G_RF5G2_BVGM5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_BVGM5_LSB) & RF5G_RF5G2_BVGM5_MASK) -#define RF5G_RF5G2_BVGM5_RESET 3'h1 -#define RF5G_RF5G2_REGFE_BYPASS5_MSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_LSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_MASK 'h00000100 -#define RF5G_RF5G2_REGFE_BYPASS5_GET(x) (((x) & RF5G_RF5G2_REGFE_BYPASS5_MASK) >> RF5G_RF5G2_REGFE_BYPASS5_LSB) -#define RF5G_RF5G2_REGFE_BYPASS5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_REGFE_BYPASS5_LSB) & RF5G_RF5G2_REGFE_BYPASS5_MASK) -#define RF5G_RF5G2_REGFE_BYPASS5_RESET 1'h0 -#define RF5G_RF5G2_LNA5_ATTENMODE_MSB 7 -#define RF5G_RF5G2_LNA5_ATTENMODE_LSB 6 -#define RF5G_RF5G2_LNA5_ATTENMODE_MASK 'h000000c0 -#define RF5G_RF5G2_LNA5_ATTENMODE_GET(x) (((x) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) >> RF5G_RF5G2_LNA5_ATTENMODE_LSB) -#define RF5G_RF5G2_LNA5_ATTENMODE_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_LNA5_ATTENMODE_LSB) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) -#define RF5G_RF5G2_LNA5_ATTENMODE_RESET 2'h0 -#define RF5G_RF5G2_ENABLE_PCA_MSB 5 -#define RF5G_RF5G2_ENABLE_PCA_LSB 5 -#define RF5G_RF5G2_ENABLE_PCA_MASK 'h00000020 -#define RF5G_RF5G2_ENABLE_PCA_GET(x) (((x) & RF5G_RF5G2_ENABLE_PCA_MASK) >> RF5G_RF5G2_ENABLE_PCA_LSB) -#define RF5G_RF5G2_ENABLE_PCA_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_ENABLE_PCA_LSB) & RF5G_RF5G2_ENABLE_PCA_MASK) -#define RF5G_RF5G2_ENABLE_PCA_RESET 1'h0 -#define RF5G_RF5G2_TUNE_LO_MSB 4 -#define RF5G_RF5G2_TUNE_LO_LSB 2 -#define RF5G_RF5G2_TUNE_LO_MASK 'h0000001c -#define RF5G_RF5G2_TUNE_LO_GET(x) (((x) & RF5G_RF5G2_TUNE_LO_MASK) >> RF5G_RF5G2_TUNE_LO_LSB) -#define RF5G_RF5G2_TUNE_LO_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_TUNE_LO_LSB) & RF5G_RF5G2_TUNE_LO_MASK) -#define RF5G_RF5G2_TUNE_LO_RESET 3'h0 -#define RF5G_RF5G2_SPARE_MSB 1 -#define RF5G_RF5G2_SPARE_LSB 0 -#define RF5G_RF5G2_SPARE_MASK 'h00000003 -#define RF5G_RF5G2_SPARE_GET(x) (((x) & RF5G_RF5G2_SPARE_MASK) >> RF5G_RF5G2_SPARE_LSB) -#define RF5G_RF5G2_SPARE_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_SPARE_LSB) & RF5G_RF5G2_SPARE_MASK) -#define RF5G_RF5G2_SPARE_RESET 2'h0 -#define RF5G_RF5G2_RESET (32'h0 | \ - RF5G_RF5G2_AGCLO_B_SET(RF5G_RF5G2_AGCLO_B_RESET) | \ - RF5G_RF5G2_RX5_ATB_SEL_SET(RF5G_RF5G2_RX5_ATB_SEL_RESET) | \ - RF5G_RF5G2_PDCMOSLO5_SET(RF5G_RF5G2_PDCMOSLO5_RESET) | \ - RF5G_RF5G2_PDVGM5_SET(RF5G_RF5G2_PDVGM5_RESET) | \ - RF5G_RF5G2_PDCSLNA5_SET(RF5G_RF5G2_PDCSLNA5_RESET) | \ - RF5G_RF5G2_PDRFVGA5_SET(RF5G_RF5G2_PDRFVGA5_RESET) | \ - RF5G_RF5G2_PDREGFE5_SET(RF5G_RF5G2_PDREGFE5_RESET) | \ - RF5G_RF5G2_TUNE_RFVGA5_SET(RF5G_RF5G2_TUNE_RFVGA5_RESET) | \ - RF5G_RF5G2_BRFVGA5_SET(RF5G_RF5G2_BRFVGA5_RESET) | \ - RF5G_RF5G2_BCSLNA5_SET(RF5G_RF5G2_BCSLNA5_RESET) | \ - RF5G_RF5G2_BVGM5_SET(RF5G_RF5G2_BVGM5_RESET) | \ - RF5G_RF5G2_REGFE_BYPASS5_SET(RF5G_RF5G2_REGFE_BYPASS5_RESET) | \ - RF5G_RF5G2_LNA5_ATTENMODE_SET(RF5G_RF5G2_LNA5_ATTENMODE_RESET) | \ - RF5G_RF5G2_ENABLE_PCA_SET(RF5G_RF5G2_ENABLE_PCA_RESET) | \ - RF5G_RF5G2_TUNE_LO_SET(RF5G_RF5G2_TUNE_LO_RESET) | \ - RF5G_RF5G2_SPARE_SET(RF5G_RF5G2_SPARE_RESET)) -#define RF5G_RF5G2_HW_MASK (32'h0) -#define RF5G_RF5G2_SW_MASK (32'h0 | \ - RF5G_RF5G2_AGCLO_B_MASK | \ - RF5G_RF5G2_RX5_ATB_SEL_MASK | \ - RF5G_RF5G2_PDCMOSLO5_MASK | \ - RF5G_RF5G2_PDVGM5_MASK | \ - RF5G_RF5G2_PDCSLNA5_MASK | \ - RF5G_RF5G2_PDRFVGA5_MASK | \ - RF5G_RF5G2_PDREGFE5_MASK | \ - RF5G_RF5G2_TUNE_RFVGA5_MASK | \ - RF5G_RF5G2_BRFVGA5_MASK | \ - RF5G_RF5G2_BCSLNA5_MASK | \ - RF5G_RF5G2_BVGM5_MASK | \ - RF5G_RF5G2_REGFE_BYPASS5_MASK | \ - RF5G_RF5G2_LNA5_ATTENMODE_MASK | \ - RF5G_RF5G2_ENABLE_PCA_MASK | \ - RF5G_RF5G2_TUNE_LO_MASK | \ - RF5G_RF5G2_SPARE_MASK) - -#define RF5G_REG_ADDRESS_MSB 2 - -#endif /* _RF5G_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/rtc_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/rtc_reg.h deleted file mode 100644 index 8b3980afb643..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/rtc_reg.h +++ /dev/null @@ -1,1163 +0,0 @@ -#ifndef _RTC_REG_REG_H_ -#define _RTC_REG_REG_H_ - -#define RESET_CONTROL_ADDRESS 0x00000000 -#define RESET_CONTROL_OFFSET 0x00000000 -#define RESET_CONTROL_CPU_INIT_RESET_MSB 11 -#define RESET_CONTROL_CPU_INIT_RESET_LSB 11 -#define RESET_CONTROL_CPU_INIT_RESET_MASK 0x00000800 -#define RESET_CONTROL_CPU_INIT_RESET_GET(x) (((x) & RESET_CONTROL_CPU_INIT_RESET_MASK) >> RESET_CONTROL_CPU_INIT_RESET_LSB) -#define RESET_CONTROL_CPU_INIT_RESET_SET(x) (((x) << RESET_CONTROL_CPU_INIT_RESET_LSB) & RESET_CONTROL_CPU_INIT_RESET_MASK) -#define RESET_CONTROL_VMC_REMAP_RESET_MSB 10 -#define RESET_CONTROL_VMC_REMAP_RESET_LSB 10 -#define RESET_CONTROL_VMC_REMAP_RESET_MASK 0x00000400 -#define RESET_CONTROL_VMC_REMAP_RESET_GET(x) (((x) & RESET_CONTROL_VMC_REMAP_RESET_MASK) >> RESET_CONTROL_VMC_REMAP_RESET_LSB) -#define RESET_CONTROL_VMC_REMAP_RESET_SET(x) (((x) << RESET_CONTROL_VMC_REMAP_RESET_LSB) & RESET_CONTROL_VMC_REMAP_RESET_MASK) -#define RESET_CONTROL_RST_OUT_MSB 9 -#define RESET_CONTROL_RST_OUT_LSB 9 -#define RESET_CONTROL_RST_OUT_MASK 0x00000200 -#define RESET_CONTROL_RST_OUT_GET(x) (((x) & RESET_CONTROL_RST_OUT_MASK) >> RESET_CONTROL_RST_OUT_LSB) -#define RESET_CONTROL_RST_OUT_SET(x) (((x) << RESET_CONTROL_RST_OUT_LSB) & RESET_CONTROL_RST_OUT_MASK) -#define RESET_CONTROL_COLD_RST_MSB 8 -#define RESET_CONTROL_COLD_RST_LSB 8 -#define RESET_CONTROL_COLD_RST_MASK 0x00000100 -#define RESET_CONTROL_COLD_RST_GET(x) (((x) & RESET_CONTROL_COLD_RST_MASK) >> RESET_CONTROL_COLD_RST_LSB) -#define RESET_CONTROL_COLD_RST_SET(x) (((x) << RESET_CONTROL_COLD_RST_LSB) & RESET_CONTROL_COLD_RST_MASK) -#define RESET_CONTROL_WARM_RST_MSB 7 -#define RESET_CONTROL_WARM_RST_LSB 7 -#define RESET_CONTROL_WARM_RST_MASK 0x00000080 -#define RESET_CONTROL_WARM_RST_GET(x) (((x) & RESET_CONTROL_WARM_RST_MASK) >> RESET_CONTROL_WARM_RST_LSB) -#define RESET_CONTROL_WARM_RST_SET(x) (((x) << RESET_CONTROL_WARM_RST_LSB) & RESET_CONTROL_WARM_RST_MASK) -#define RESET_CONTROL_CPU_WARM_RST_MSB 6 -#define RESET_CONTROL_CPU_WARM_RST_LSB 6 -#define RESET_CONTROL_CPU_WARM_RST_MASK 0x00000040 -#define RESET_CONTROL_CPU_WARM_RST_GET(x) (((x) & RESET_CONTROL_CPU_WARM_RST_MASK) >> RESET_CONTROL_CPU_WARM_RST_LSB) -#define RESET_CONTROL_CPU_WARM_RST_SET(x) (((x) << RESET_CONTROL_CPU_WARM_RST_LSB) & RESET_CONTROL_CPU_WARM_RST_MASK) -#define RESET_CONTROL_MAC_COLD_RST_MSB 5 -#define RESET_CONTROL_MAC_COLD_RST_LSB 5 -#define RESET_CONTROL_MAC_COLD_RST_MASK 0x00000020 -#define RESET_CONTROL_MAC_COLD_RST_GET(x) (((x) & RESET_CONTROL_MAC_COLD_RST_MASK) >> RESET_CONTROL_MAC_COLD_RST_LSB) -#define RESET_CONTROL_MAC_COLD_RST_SET(x) (((x) << RESET_CONTROL_MAC_COLD_RST_LSB) & RESET_CONTROL_MAC_COLD_RST_MASK) -#define RESET_CONTROL_MAC_WARM_RST_MSB 4 -#define RESET_CONTROL_MAC_WARM_RST_LSB 4 -#define RESET_CONTROL_MAC_WARM_RST_MASK 0x00000010 -#define RESET_CONTROL_MAC_WARM_RST_GET(x) (((x) & RESET_CONTROL_MAC_WARM_RST_MASK) >> RESET_CONTROL_MAC_WARM_RST_LSB) -#define RESET_CONTROL_MAC_WARM_RST_SET(x) (((x) << RESET_CONTROL_MAC_WARM_RST_LSB) & RESET_CONTROL_MAC_WARM_RST_MASK) -#define RESET_CONTROL_MBOX_RST_MSB 2 -#define RESET_CONTROL_MBOX_RST_LSB 2 -#define RESET_CONTROL_MBOX_RST_MASK 0x00000004 -#define RESET_CONTROL_MBOX_RST_GET(x) (((x) & RESET_CONTROL_MBOX_RST_MASK) >> RESET_CONTROL_MBOX_RST_LSB) -#define RESET_CONTROL_MBOX_RST_SET(x) (((x) << RESET_CONTROL_MBOX_RST_LSB) & RESET_CONTROL_MBOX_RST_MASK) -#define RESET_CONTROL_UART_RST_MSB 1 -#define RESET_CONTROL_UART_RST_LSB 1 -#define RESET_CONTROL_UART_RST_MASK 0x00000002 -#define RESET_CONTROL_UART_RST_GET(x) (((x) & RESET_CONTROL_UART_RST_MASK) >> RESET_CONTROL_UART_RST_LSB) -#define RESET_CONTROL_UART_RST_SET(x) (((x) << RESET_CONTROL_UART_RST_LSB) & RESET_CONTROL_UART_RST_MASK) -#define RESET_CONTROL_SI0_RST_MSB 0 -#define RESET_CONTROL_SI0_RST_LSB 0 -#define RESET_CONTROL_SI0_RST_MASK 0x00000001 -#define RESET_CONTROL_SI0_RST_GET(x) (((x) & RESET_CONTROL_SI0_RST_MASK) >> RESET_CONTROL_SI0_RST_LSB) -#define RESET_CONTROL_SI0_RST_SET(x) (((x) << RESET_CONTROL_SI0_RST_LSB) & RESET_CONTROL_SI0_RST_MASK) - -#define XTAL_CONTROL_ADDRESS 0x00000004 -#define XTAL_CONTROL_OFFSET 0x00000004 -#define XTAL_CONTROL_TCXO_MSB 0 -#define XTAL_CONTROL_TCXO_LSB 0 -#define XTAL_CONTROL_TCXO_MASK 0x00000001 -#define XTAL_CONTROL_TCXO_GET(x) (((x) & XTAL_CONTROL_TCXO_MASK) >> XTAL_CONTROL_TCXO_LSB) -#define XTAL_CONTROL_TCXO_SET(x) (((x) << XTAL_CONTROL_TCXO_LSB) & XTAL_CONTROL_TCXO_MASK) - -#define TCXO_DETECT_ADDRESS 0x00000008 -#define TCXO_DETECT_OFFSET 0x00000008 -#define TCXO_DETECT_PRESENT_MSB 0 -#define TCXO_DETECT_PRESENT_LSB 0 -#define TCXO_DETECT_PRESENT_MASK 0x00000001 -#define TCXO_DETECT_PRESENT_GET(x) (((x) & TCXO_DETECT_PRESENT_MASK) >> TCXO_DETECT_PRESENT_LSB) -#define TCXO_DETECT_PRESENT_SET(x) (((x) << TCXO_DETECT_PRESENT_LSB) & TCXO_DETECT_PRESENT_MASK) - -#define XTAL_TEST_ADDRESS 0x0000000c -#define XTAL_TEST_OFFSET 0x0000000c -#define XTAL_TEST_NOTCXODET_MSB 0 -#define XTAL_TEST_NOTCXODET_LSB 0 -#define XTAL_TEST_NOTCXODET_MASK 0x00000001 -#define XTAL_TEST_NOTCXODET_GET(x) (((x) & XTAL_TEST_NOTCXODET_MASK) >> XTAL_TEST_NOTCXODET_LSB) -#define XTAL_TEST_NOTCXODET_SET(x) (((x) << XTAL_TEST_NOTCXODET_LSB) & XTAL_TEST_NOTCXODET_MASK) - -#define QUADRATURE_ADDRESS 0x00000010 -#define QUADRATURE_OFFSET 0x00000010 -#define QUADRATURE_ADC_MSB 5 -#define QUADRATURE_ADC_LSB 4 -#define QUADRATURE_ADC_MASK 0x00000030 -#define QUADRATURE_ADC_GET(x) (((x) & QUADRATURE_ADC_MASK) >> QUADRATURE_ADC_LSB) -#define QUADRATURE_ADC_SET(x) (((x) << QUADRATURE_ADC_LSB) & QUADRATURE_ADC_MASK) -#define QUADRATURE_SEL_MSB 2 -#define QUADRATURE_SEL_LSB 2 -#define QUADRATURE_SEL_MASK 0x00000004 -#define QUADRATURE_SEL_GET(x) (((x) & QUADRATURE_SEL_MASK) >> QUADRATURE_SEL_LSB) -#define QUADRATURE_SEL_SET(x) (((x) << QUADRATURE_SEL_LSB) & QUADRATURE_SEL_MASK) -#define QUADRATURE_DAC_MSB 1 -#define QUADRATURE_DAC_LSB 0 -#define QUADRATURE_DAC_MASK 0x00000003 -#define QUADRATURE_DAC_GET(x) (((x) & QUADRATURE_DAC_MASK) >> QUADRATURE_DAC_LSB) -#define QUADRATURE_DAC_SET(x) (((x) << QUADRATURE_DAC_LSB) & QUADRATURE_DAC_MASK) - -#define PLL_CONTROL_ADDRESS 0x00000014 -#define PLL_CONTROL_OFFSET 0x00000014 -#define PLL_CONTROL_DIG_TEST_CLK_MSB 20 -#define PLL_CONTROL_DIG_TEST_CLK_LSB 20 -#define PLL_CONTROL_DIG_TEST_CLK_MASK 0x00100000 -#define PLL_CONTROL_DIG_TEST_CLK_GET(x) (((x) & PLL_CONTROL_DIG_TEST_CLK_MASK) >> PLL_CONTROL_DIG_TEST_CLK_LSB) -#define PLL_CONTROL_DIG_TEST_CLK_SET(x) (((x) << PLL_CONTROL_DIG_TEST_CLK_LSB) & PLL_CONTROL_DIG_TEST_CLK_MASK) -#define PLL_CONTROL_MAC_OVERRIDE_MSB 19 -#define PLL_CONTROL_MAC_OVERRIDE_LSB 19 -#define PLL_CONTROL_MAC_OVERRIDE_MASK 0x00080000 -#define PLL_CONTROL_MAC_OVERRIDE_GET(x) (((x) & PLL_CONTROL_MAC_OVERRIDE_MASK) >> PLL_CONTROL_MAC_OVERRIDE_LSB) -#define PLL_CONTROL_MAC_OVERRIDE_SET(x) (((x) << PLL_CONTROL_MAC_OVERRIDE_LSB) & PLL_CONTROL_MAC_OVERRIDE_MASK) -#define PLL_CONTROL_NOPWD_MSB 18 -#define PLL_CONTROL_NOPWD_LSB 18 -#define PLL_CONTROL_NOPWD_MASK 0x00040000 -#define PLL_CONTROL_NOPWD_GET(x) (((x) & PLL_CONTROL_NOPWD_MASK) >> PLL_CONTROL_NOPWD_LSB) -#define PLL_CONTROL_NOPWD_SET(x) (((x) << PLL_CONTROL_NOPWD_LSB) & PLL_CONTROL_NOPWD_MASK) -#define PLL_CONTROL_UPDATING_MSB 17 -#define PLL_CONTROL_UPDATING_LSB 17 -#define PLL_CONTROL_UPDATING_MASK 0x00020000 -#define PLL_CONTROL_UPDATING_GET(x) (((x) & PLL_CONTROL_UPDATING_MASK) >> PLL_CONTROL_UPDATING_LSB) -#define PLL_CONTROL_UPDATING_SET(x) (((x) << PLL_CONTROL_UPDATING_LSB) & PLL_CONTROL_UPDATING_MASK) -#define PLL_CONTROL_BYPASS_MSB 16 -#define PLL_CONTROL_BYPASS_LSB 16 -#define PLL_CONTROL_BYPASS_MASK 0x00010000 -#define PLL_CONTROL_BYPASS_GET(x) (((x) & PLL_CONTROL_BYPASS_MASK) >> PLL_CONTROL_BYPASS_LSB) -#define PLL_CONTROL_BYPASS_SET(x) (((x) << PLL_CONTROL_BYPASS_LSB) & PLL_CONTROL_BYPASS_MASK) -#define PLL_CONTROL_REFDIV_MSB 15 -#define PLL_CONTROL_REFDIV_LSB 12 -#define PLL_CONTROL_REFDIV_MASK 0x0000f000 -#define PLL_CONTROL_REFDIV_GET(x) (((x) & PLL_CONTROL_REFDIV_MASK) >> PLL_CONTROL_REFDIV_LSB) -#define PLL_CONTROL_REFDIV_SET(x) (((x) << PLL_CONTROL_REFDIV_LSB) & PLL_CONTROL_REFDIV_MASK) -#define PLL_CONTROL_DIV_MSB 9 -#define PLL_CONTROL_DIV_LSB 0 -#define PLL_CONTROL_DIV_MASK 0x000003ff -#define PLL_CONTROL_DIV_GET(x) (((x) & PLL_CONTROL_DIV_MASK) >> PLL_CONTROL_DIV_LSB) -#define PLL_CONTROL_DIV_SET(x) (((x) << PLL_CONTROL_DIV_LSB) & PLL_CONTROL_DIV_MASK) - -#define PLL_SETTLE_ADDRESS 0x00000018 -#define PLL_SETTLE_OFFSET 0x00000018 -#define PLL_SETTLE_TIME_MSB 11 -#define PLL_SETTLE_TIME_LSB 0 -#define PLL_SETTLE_TIME_MASK 0x00000fff -#define PLL_SETTLE_TIME_GET(x) (((x) & PLL_SETTLE_TIME_MASK) >> PLL_SETTLE_TIME_LSB) -#define PLL_SETTLE_TIME_SET(x) (((x) << PLL_SETTLE_TIME_LSB) & PLL_SETTLE_TIME_MASK) - -#define XTAL_SETTLE_ADDRESS 0x0000001c -#define XTAL_SETTLE_OFFSET 0x0000001c -#define XTAL_SETTLE_TIME_MSB 7 -#define XTAL_SETTLE_TIME_LSB 0 -#define XTAL_SETTLE_TIME_MASK 0x000000ff -#define XTAL_SETTLE_TIME_GET(x) (((x) & XTAL_SETTLE_TIME_MASK) >> XTAL_SETTLE_TIME_LSB) -#define XTAL_SETTLE_TIME_SET(x) (((x) << XTAL_SETTLE_TIME_LSB) & XTAL_SETTLE_TIME_MASK) - -#define CPU_CLOCK_ADDRESS 0x00000020 -#define CPU_CLOCK_OFFSET 0x00000020 -#define CPU_CLOCK_STANDARD_MSB 1 -#define CPU_CLOCK_STANDARD_LSB 0 -#define CPU_CLOCK_STANDARD_MASK 0x00000003 -#define CPU_CLOCK_STANDARD_GET(x) (((x) & CPU_CLOCK_STANDARD_MASK) >> CPU_CLOCK_STANDARD_LSB) -#define CPU_CLOCK_STANDARD_SET(x) (((x) << CPU_CLOCK_STANDARD_LSB) & CPU_CLOCK_STANDARD_MASK) - -#define CLOCK_OUT_ADDRESS 0x00000024 -#define CLOCK_OUT_OFFSET 0x00000024 -#define CLOCK_OUT_SELECT_MSB 3 -#define CLOCK_OUT_SELECT_LSB 0 -#define CLOCK_OUT_SELECT_MASK 0x0000000f -#define CLOCK_OUT_SELECT_GET(x) (((x) & CLOCK_OUT_SELECT_MASK) >> CLOCK_OUT_SELECT_LSB) -#define CLOCK_OUT_SELECT_SET(x) (((x) << CLOCK_OUT_SELECT_LSB) & CLOCK_OUT_SELECT_MASK) - -#define CLOCK_CONTROL_ADDRESS 0x00000028 -#define CLOCK_CONTROL_OFFSET 0x00000028 -#define CLOCK_CONTROL_LF_CLK32_MSB 2 -#define CLOCK_CONTROL_LF_CLK32_LSB 2 -#define CLOCK_CONTROL_LF_CLK32_MASK 0x00000004 -#define CLOCK_CONTROL_LF_CLK32_GET(x) (((x) & CLOCK_CONTROL_LF_CLK32_MASK) >> CLOCK_CONTROL_LF_CLK32_LSB) -#define CLOCK_CONTROL_LF_CLK32_SET(x) (((x) << CLOCK_CONTROL_LF_CLK32_LSB) & CLOCK_CONTROL_LF_CLK32_MASK) -#define CLOCK_CONTROL_UART_CLK_MSB 1 -#define CLOCK_CONTROL_UART_CLK_LSB 1 -#define CLOCK_CONTROL_UART_CLK_MASK 0x00000002 -#define CLOCK_CONTROL_UART_CLK_GET(x) (((x) & CLOCK_CONTROL_UART_CLK_MASK) >> CLOCK_CONTROL_UART_CLK_LSB) -#define CLOCK_CONTROL_UART_CLK_SET(x) (((x) << CLOCK_CONTROL_UART_CLK_LSB) & CLOCK_CONTROL_UART_CLK_MASK) -#define CLOCK_CONTROL_SI0_CLK_MSB 0 -#define CLOCK_CONTROL_SI0_CLK_LSB 0 -#define CLOCK_CONTROL_SI0_CLK_MASK 0x00000001 -#define CLOCK_CONTROL_SI0_CLK_GET(x) (((x) & CLOCK_CONTROL_SI0_CLK_MASK) >> CLOCK_CONTROL_SI0_CLK_LSB) -#define CLOCK_CONTROL_SI0_CLK_SET(x) (((x) << CLOCK_CONTROL_SI0_CLK_LSB) & CLOCK_CONTROL_SI0_CLK_MASK) - -#define BIAS_OVERRIDE_ADDRESS 0x0000002c -#define BIAS_OVERRIDE_OFFSET 0x0000002c -#define BIAS_OVERRIDE_ON_MSB 0 -#define BIAS_OVERRIDE_ON_LSB 0 -#define BIAS_OVERRIDE_ON_MASK 0x00000001 -#define BIAS_OVERRIDE_ON_GET(x) (((x) & BIAS_OVERRIDE_ON_MASK) >> BIAS_OVERRIDE_ON_LSB) -#define BIAS_OVERRIDE_ON_SET(x) (((x) << BIAS_OVERRIDE_ON_LSB) & BIAS_OVERRIDE_ON_MASK) - -#define WDT_CONTROL_ADDRESS 0x00000030 -#define WDT_CONTROL_OFFSET 0x00000030 -#define WDT_CONTROL_ACTION_MSB 2 -#define WDT_CONTROL_ACTION_LSB 0 -#define WDT_CONTROL_ACTION_MASK 0x00000007 -#define WDT_CONTROL_ACTION_GET(x) (((x) & WDT_CONTROL_ACTION_MASK) >> WDT_CONTROL_ACTION_LSB) -#define WDT_CONTROL_ACTION_SET(x) (((x) << WDT_CONTROL_ACTION_LSB) & WDT_CONTROL_ACTION_MASK) - -#define WDT_STATUS_ADDRESS 0x00000034 -#define WDT_STATUS_OFFSET 0x00000034 -#define WDT_STATUS_INTERRUPT_MSB 0 -#define WDT_STATUS_INTERRUPT_LSB 0 -#define WDT_STATUS_INTERRUPT_MASK 0x00000001 -#define WDT_STATUS_INTERRUPT_GET(x) (((x) & WDT_STATUS_INTERRUPT_MASK) >> WDT_STATUS_INTERRUPT_LSB) -#define WDT_STATUS_INTERRUPT_SET(x) (((x) << WDT_STATUS_INTERRUPT_LSB) & WDT_STATUS_INTERRUPT_MASK) - -#define WDT_ADDRESS 0x00000038 -#define WDT_OFFSET 0x00000038 -#define WDT_TARGET_MSB 21 -#define WDT_TARGET_LSB 0 -#define WDT_TARGET_MASK 0x003fffff -#define WDT_TARGET_GET(x) (((x) & WDT_TARGET_MASK) >> WDT_TARGET_LSB) -#define WDT_TARGET_SET(x) (((x) << WDT_TARGET_LSB) & WDT_TARGET_MASK) - -#define WDT_COUNT_ADDRESS 0x0000003c -#define WDT_COUNT_OFFSET 0x0000003c -#define WDT_COUNT_VALUE_MSB 21 -#define WDT_COUNT_VALUE_LSB 0 -#define WDT_COUNT_VALUE_MASK 0x003fffff -#define WDT_COUNT_VALUE_GET(x) (((x) & WDT_COUNT_VALUE_MASK) >> WDT_COUNT_VALUE_LSB) -#define WDT_COUNT_VALUE_SET(x) (((x) << WDT_COUNT_VALUE_LSB) & WDT_COUNT_VALUE_MASK) - -#define WDT_RESET_ADDRESS 0x00000040 -#define WDT_RESET_OFFSET 0x00000040 -#define WDT_RESET_VALUE_MSB 0 -#define WDT_RESET_VALUE_LSB 0 -#define WDT_RESET_VALUE_MASK 0x00000001 -#define WDT_RESET_VALUE_GET(x) (((x) & WDT_RESET_VALUE_MASK) >> WDT_RESET_VALUE_LSB) -#define WDT_RESET_VALUE_SET(x) (((x) << WDT_RESET_VALUE_LSB) & WDT_RESET_VALUE_MASK) - -#define INT_STATUS_ADDRESS 0x00000044 -#define INT_STATUS_OFFSET 0x00000044 -#define INT_STATUS_RTC_POWER_MSB 14 -#define INT_STATUS_RTC_POWER_LSB 14 -#define INT_STATUS_RTC_POWER_MASK 0x00004000 -#define INT_STATUS_RTC_POWER_GET(x) (((x) & INT_STATUS_RTC_POWER_MASK) >> INT_STATUS_RTC_POWER_LSB) -#define INT_STATUS_RTC_POWER_SET(x) (((x) << INT_STATUS_RTC_POWER_LSB) & INT_STATUS_RTC_POWER_MASK) -#define INT_STATUS_MAC_MSB 13 -#define INT_STATUS_MAC_LSB 13 -#define INT_STATUS_MAC_MASK 0x00002000 -#define INT_STATUS_MAC_GET(x) (((x) & INT_STATUS_MAC_MASK) >> INT_STATUS_MAC_LSB) -#define INT_STATUS_MAC_SET(x) (((x) << INT_STATUS_MAC_LSB) & INT_STATUS_MAC_MASK) -#define INT_STATUS_MAILBOX_MSB 12 -#define INT_STATUS_MAILBOX_LSB 12 -#define INT_STATUS_MAILBOX_MASK 0x00001000 -#define INT_STATUS_MAILBOX_GET(x) (((x) & INT_STATUS_MAILBOX_MASK) >> INT_STATUS_MAILBOX_LSB) -#define INT_STATUS_MAILBOX_SET(x) (((x) << INT_STATUS_MAILBOX_LSB) & INT_STATUS_MAILBOX_MASK) -#define INT_STATUS_RTC_ALARM_MSB 11 -#define INT_STATUS_RTC_ALARM_LSB 11 -#define INT_STATUS_RTC_ALARM_MASK 0x00000800 -#define INT_STATUS_RTC_ALARM_GET(x) (((x) & INT_STATUS_RTC_ALARM_MASK) >> INT_STATUS_RTC_ALARM_LSB) -#define INT_STATUS_RTC_ALARM_SET(x) (((x) << INT_STATUS_RTC_ALARM_LSB) & INT_STATUS_RTC_ALARM_MASK) -#define INT_STATUS_HF_TIMER_MSB 10 -#define INT_STATUS_HF_TIMER_LSB 10 -#define INT_STATUS_HF_TIMER_MASK 0x00000400 -#define INT_STATUS_HF_TIMER_GET(x) (((x) & INT_STATUS_HF_TIMER_MASK) >> INT_STATUS_HF_TIMER_LSB) -#define INT_STATUS_HF_TIMER_SET(x) (((x) << INT_STATUS_HF_TIMER_LSB) & INT_STATUS_HF_TIMER_MASK) -#define INT_STATUS_LF_TIMER3_MSB 9 -#define INT_STATUS_LF_TIMER3_LSB 9 -#define INT_STATUS_LF_TIMER3_MASK 0x00000200 -#define INT_STATUS_LF_TIMER3_GET(x) (((x) & INT_STATUS_LF_TIMER3_MASK) >> INT_STATUS_LF_TIMER3_LSB) -#define INT_STATUS_LF_TIMER3_SET(x) (((x) << INT_STATUS_LF_TIMER3_LSB) & INT_STATUS_LF_TIMER3_MASK) -#define INT_STATUS_LF_TIMER2_MSB 8 -#define INT_STATUS_LF_TIMER2_LSB 8 -#define INT_STATUS_LF_TIMER2_MASK 0x00000100 -#define INT_STATUS_LF_TIMER2_GET(x) (((x) & INT_STATUS_LF_TIMER2_MASK) >> INT_STATUS_LF_TIMER2_LSB) -#define INT_STATUS_LF_TIMER2_SET(x) (((x) << INT_STATUS_LF_TIMER2_LSB) & INT_STATUS_LF_TIMER2_MASK) -#define INT_STATUS_LF_TIMER1_MSB 7 -#define INT_STATUS_LF_TIMER1_LSB 7 -#define INT_STATUS_LF_TIMER1_MASK 0x00000080 -#define INT_STATUS_LF_TIMER1_GET(x) (((x) & INT_STATUS_LF_TIMER1_MASK) >> INT_STATUS_LF_TIMER1_LSB) -#define INT_STATUS_LF_TIMER1_SET(x) (((x) << INT_STATUS_LF_TIMER1_LSB) & INT_STATUS_LF_TIMER1_MASK) -#define INT_STATUS_LF_TIMER0_MSB 6 -#define INT_STATUS_LF_TIMER0_LSB 6 -#define INT_STATUS_LF_TIMER0_MASK 0x00000040 -#define INT_STATUS_LF_TIMER0_GET(x) (((x) & INT_STATUS_LF_TIMER0_MASK) >> INT_STATUS_LF_TIMER0_LSB) -#define INT_STATUS_LF_TIMER0_SET(x) (((x) << INT_STATUS_LF_TIMER0_LSB) & INT_STATUS_LF_TIMER0_MASK) -#define INT_STATUS_KEYPAD_MSB 5 -#define INT_STATUS_KEYPAD_LSB 5 -#define INT_STATUS_KEYPAD_MASK 0x00000020 -#define INT_STATUS_KEYPAD_GET(x) (((x) & INT_STATUS_KEYPAD_MASK) >> INT_STATUS_KEYPAD_LSB) -#define INT_STATUS_KEYPAD_SET(x) (((x) << INT_STATUS_KEYPAD_LSB) & INT_STATUS_KEYPAD_MASK) -#define INT_STATUS_SI_MSB 4 -#define INT_STATUS_SI_LSB 4 -#define INT_STATUS_SI_MASK 0x00000010 -#define INT_STATUS_SI_GET(x) (((x) & INT_STATUS_SI_MASK) >> INT_STATUS_SI_LSB) -#define INT_STATUS_SI_SET(x) (((x) << INT_STATUS_SI_LSB) & INT_STATUS_SI_MASK) -#define INT_STATUS_GPIO_MSB 3 -#define INT_STATUS_GPIO_LSB 3 -#define INT_STATUS_GPIO_MASK 0x00000008 -#define INT_STATUS_GPIO_GET(x) (((x) & INT_STATUS_GPIO_MASK) >> INT_STATUS_GPIO_LSB) -#define INT_STATUS_GPIO_SET(x) (((x) << INT_STATUS_GPIO_LSB) & INT_STATUS_GPIO_MASK) -#define INT_STATUS_UART_MSB 2 -#define INT_STATUS_UART_LSB 2 -#define INT_STATUS_UART_MASK 0x00000004 -#define INT_STATUS_UART_GET(x) (((x) & INT_STATUS_UART_MASK) >> INT_STATUS_UART_LSB) -#define INT_STATUS_UART_SET(x) (((x) << INT_STATUS_UART_LSB) & INT_STATUS_UART_MASK) -#define INT_STATUS_ERROR_MSB 1 -#define INT_STATUS_ERROR_LSB 1 -#define INT_STATUS_ERROR_MASK 0x00000002 -#define INT_STATUS_ERROR_GET(x) (((x) & INT_STATUS_ERROR_MASK) >> INT_STATUS_ERROR_LSB) -#define INT_STATUS_ERROR_SET(x) (((x) << INT_STATUS_ERROR_LSB) & INT_STATUS_ERROR_MASK) -#define INT_STATUS_WDT_INT_MSB 0 -#define INT_STATUS_WDT_INT_LSB 0 -#define INT_STATUS_WDT_INT_MASK 0x00000001 -#define INT_STATUS_WDT_INT_GET(x) (((x) & INT_STATUS_WDT_INT_MASK) >> INT_STATUS_WDT_INT_LSB) -#define INT_STATUS_WDT_INT_SET(x) (((x) << INT_STATUS_WDT_INT_LSB) & INT_STATUS_WDT_INT_MASK) - -#define LF_TIMER0_ADDRESS 0x00000048 -#define LF_TIMER0_OFFSET 0x00000048 -#define LF_TIMER0_TARGET_MSB 31 -#define LF_TIMER0_TARGET_LSB 0 -#define LF_TIMER0_TARGET_MASK 0xffffffff -#define LF_TIMER0_TARGET_GET(x) (((x) & LF_TIMER0_TARGET_MASK) >> LF_TIMER0_TARGET_LSB) -#define LF_TIMER0_TARGET_SET(x) (((x) << LF_TIMER0_TARGET_LSB) & LF_TIMER0_TARGET_MASK) - -#define LF_TIMER_COUNT0_ADDRESS 0x0000004c -#define LF_TIMER_COUNT0_OFFSET 0x0000004c -#define LF_TIMER_COUNT0_VALUE_MSB 31 -#define LF_TIMER_COUNT0_VALUE_LSB 0 -#define LF_TIMER_COUNT0_VALUE_MASK 0xffffffff -#define LF_TIMER_COUNT0_VALUE_GET(x) (((x) & LF_TIMER_COUNT0_VALUE_MASK) >> LF_TIMER_COUNT0_VALUE_LSB) -#define LF_TIMER_COUNT0_VALUE_SET(x) (((x) << LF_TIMER_COUNT0_VALUE_LSB) & LF_TIMER_COUNT0_VALUE_MASK) - -#define LF_TIMER_CONTROL0_ADDRESS 0x00000050 -#define LF_TIMER_CONTROL0_OFFSET 0x00000050 -#define LF_TIMER_CONTROL0_ENABLE_MSB 2 -#define LF_TIMER_CONTROL0_ENABLE_LSB 2 -#define LF_TIMER_CONTROL0_ENABLE_MASK 0x00000004 -#define LF_TIMER_CONTROL0_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL0_ENABLE_MASK) >> LF_TIMER_CONTROL0_ENABLE_LSB) -#define LF_TIMER_CONTROL0_ENABLE_SET(x) (((x) << LF_TIMER_CONTROL0_ENABLE_LSB) & LF_TIMER_CONTROL0_ENABLE_MASK) -#define LF_TIMER_CONTROL0_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL0_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL0_AUTO_RESTART_MASK 0x00000002 -#define LF_TIMER_CONTROL0_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL0_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL0_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL0_AUTO_RESTART_SET(x) (((x) << LF_TIMER_CONTROL0_AUTO_RESTART_LSB) & LF_TIMER_CONTROL0_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL0_RESET_MSB 0 -#define LF_TIMER_CONTROL0_RESET_LSB 0 -#define LF_TIMER_CONTROL0_RESET_MASK 0x00000001 -#define LF_TIMER_CONTROL0_RESET_GET(x) (((x) & LF_TIMER_CONTROL0_RESET_MASK) >> LF_TIMER_CONTROL0_RESET_LSB) -#define LF_TIMER_CONTROL0_RESET_SET(x) (((x) << LF_TIMER_CONTROL0_RESET_LSB) & LF_TIMER_CONTROL0_RESET_MASK) - -#define LF_TIMER_STATUS0_ADDRESS 0x00000054 -#define LF_TIMER_STATUS0_OFFSET 0x00000054 -#define LF_TIMER_STATUS0_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS0_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS0_INTERRUPT_MASK 0x00000001 -#define LF_TIMER_STATUS0_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS0_INTERRUPT_MASK) >> LF_TIMER_STATUS0_INTERRUPT_LSB) -#define LF_TIMER_STATUS0_INTERRUPT_SET(x) (((x) << LF_TIMER_STATUS0_INTERRUPT_LSB) & LF_TIMER_STATUS0_INTERRUPT_MASK) - -#define LF_TIMER1_ADDRESS 0x00000058 -#define LF_TIMER1_OFFSET 0x00000058 -#define LF_TIMER1_TARGET_MSB 31 -#define LF_TIMER1_TARGET_LSB 0 -#define LF_TIMER1_TARGET_MASK 0xffffffff -#define LF_TIMER1_TARGET_GET(x) (((x) & LF_TIMER1_TARGET_MASK) >> LF_TIMER1_TARGET_LSB) -#define LF_TIMER1_TARGET_SET(x) (((x) << LF_TIMER1_TARGET_LSB) & LF_TIMER1_TARGET_MASK) - -#define LF_TIMER_COUNT1_ADDRESS 0x0000005c -#define LF_TIMER_COUNT1_OFFSET 0x0000005c -#define LF_TIMER_COUNT1_VALUE_MSB 31 -#define LF_TIMER_COUNT1_VALUE_LSB 0 -#define LF_TIMER_COUNT1_VALUE_MASK 0xffffffff -#define LF_TIMER_COUNT1_VALUE_GET(x) (((x) & LF_TIMER_COUNT1_VALUE_MASK) >> LF_TIMER_COUNT1_VALUE_LSB) -#define LF_TIMER_COUNT1_VALUE_SET(x) (((x) << LF_TIMER_COUNT1_VALUE_LSB) & LF_TIMER_COUNT1_VALUE_MASK) - -#define LF_TIMER_CONTROL1_ADDRESS 0x00000060 -#define LF_TIMER_CONTROL1_OFFSET 0x00000060 -#define LF_TIMER_CONTROL1_ENABLE_MSB 2 -#define LF_TIMER_CONTROL1_ENABLE_LSB 2 -#define LF_TIMER_CONTROL1_ENABLE_MASK 0x00000004 -#define LF_TIMER_CONTROL1_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL1_ENABLE_MASK) >> LF_TIMER_CONTROL1_ENABLE_LSB) -#define LF_TIMER_CONTROL1_ENABLE_SET(x) (((x) << LF_TIMER_CONTROL1_ENABLE_LSB) & LF_TIMER_CONTROL1_ENABLE_MASK) -#define LF_TIMER_CONTROL1_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL1_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL1_AUTO_RESTART_MASK 0x00000002 -#define LF_TIMER_CONTROL1_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL1_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL1_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL1_AUTO_RESTART_SET(x) (((x) << LF_TIMER_CONTROL1_AUTO_RESTART_LSB) & LF_TIMER_CONTROL1_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL1_RESET_MSB 0 -#define LF_TIMER_CONTROL1_RESET_LSB 0 -#define LF_TIMER_CONTROL1_RESET_MASK 0x00000001 -#define LF_TIMER_CONTROL1_RESET_GET(x) (((x) & LF_TIMER_CONTROL1_RESET_MASK) >> LF_TIMER_CONTROL1_RESET_LSB) -#define LF_TIMER_CONTROL1_RESET_SET(x) (((x) << LF_TIMER_CONTROL1_RESET_LSB) & LF_TIMER_CONTROL1_RESET_MASK) - -#define LF_TIMER_STATUS1_ADDRESS 0x00000064 -#define LF_TIMER_STATUS1_OFFSET 0x00000064 -#define LF_TIMER_STATUS1_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS1_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS1_INTERRUPT_MASK 0x00000001 -#define LF_TIMER_STATUS1_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS1_INTERRUPT_MASK) >> LF_TIMER_STATUS1_INTERRUPT_LSB) -#define LF_TIMER_STATUS1_INTERRUPT_SET(x) (((x) << LF_TIMER_STATUS1_INTERRUPT_LSB) & LF_TIMER_STATUS1_INTERRUPT_MASK) - -#define LF_TIMER2_ADDRESS 0x00000068 -#define LF_TIMER2_OFFSET 0x00000068 -#define LF_TIMER2_TARGET_MSB 31 -#define LF_TIMER2_TARGET_LSB 0 -#define LF_TIMER2_TARGET_MASK 0xffffffff -#define LF_TIMER2_TARGET_GET(x) (((x) & LF_TIMER2_TARGET_MASK) >> LF_TIMER2_TARGET_LSB) -#define LF_TIMER2_TARGET_SET(x) (((x) << LF_TIMER2_TARGET_LSB) & LF_TIMER2_TARGET_MASK) - -#define LF_TIMER_COUNT2_ADDRESS 0x0000006c -#define LF_TIMER_COUNT2_OFFSET 0x0000006c -#define LF_TIMER_COUNT2_VALUE_MSB 31 -#define LF_TIMER_COUNT2_VALUE_LSB 0 -#define LF_TIMER_COUNT2_VALUE_MASK 0xffffffff -#define LF_TIMER_COUNT2_VALUE_GET(x) (((x) & LF_TIMER_COUNT2_VALUE_MASK) >> LF_TIMER_COUNT2_VALUE_LSB) -#define LF_TIMER_COUNT2_VALUE_SET(x) (((x) << LF_TIMER_COUNT2_VALUE_LSB) & LF_TIMER_COUNT2_VALUE_MASK) - -#define LF_TIMER_CONTROL2_ADDRESS 0x00000070 -#define LF_TIMER_CONTROL2_OFFSET 0x00000070 -#define LF_TIMER_CONTROL2_ENABLE_MSB 2 -#define LF_TIMER_CONTROL2_ENABLE_LSB 2 -#define LF_TIMER_CONTROL2_ENABLE_MASK 0x00000004 -#define LF_TIMER_CONTROL2_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL2_ENABLE_MASK) >> LF_TIMER_CONTROL2_ENABLE_LSB) -#define LF_TIMER_CONTROL2_ENABLE_SET(x) (((x) << LF_TIMER_CONTROL2_ENABLE_LSB) & LF_TIMER_CONTROL2_ENABLE_MASK) -#define LF_TIMER_CONTROL2_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL2_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL2_AUTO_RESTART_MASK 0x00000002 -#define LF_TIMER_CONTROL2_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL2_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL2_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL2_AUTO_RESTART_SET(x) (((x) << LF_TIMER_CONTROL2_AUTO_RESTART_LSB) & LF_TIMER_CONTROL2_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL2_RESET_MSB 0 -#define LF_TIMER_CONTROL2_RESET_LSB 0 -#define LF_TIMER_CONTROL2_RESET_MASK 0x00000001 -#define LF_TIMER_CONTROL2_RESET_GET(x) (((x) & LF_TIMER_CONTROL2_RESET_MASK) >> LF_TIMER_CONTROL2_RESET_LSB) -#define LF_TIMER_CONTROL2_RESET_SET(x) (((x) << LF_TIMER_CONTROL2_RESET_LSB) & LF_TIMER_CONTROL2_RESET_MASK) - -#define LF_TIMER_STATUS2_ADDRESS 0x00000074 -#define LF_TIMER_STATUS2_OFFSET 0x00000074 -#define LF_TIMER_STATUS2_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS2_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS2_INTERRUPT_MASK 0x00000001 -#define LF_TIMER_STATUS2_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS2_INTERRUPT_MASK) >> LF_TIMER_STATUS2_INTERRUPT_LSB) -#define LF_TIMER_STATUS2_INTERRUPT_SET(x) (((x) << LF_TIMER_STATUS2_INTERRUPT_LSB) & LF_TIMER_STATUS2_INTERRUPT_MASK) - -#define LF_TIMER3_ADDRESS 0x00000078 -#define LF_TIMER3_OFFSET 0x00000078 -#define LF_TIMER3_TARGET_MSB 31 -#define LF_TIMER3_TARGET_LSB 0 -#define LF_TIMER3_TARGET_MASK 0xffffffff -#define LF_TIMER3_TARGET_GET(x) (((x) & LF_TIMER3_TARGET_MASK) >> LF_TIMER3_TARGET_LSB) -#define LF_TIMER3_TARGET_SET(x) (((x) << LF_TIMER3_TARGET_LSB) & LF_TIMER3_TARGET_MASK) - -#define LF_TIMER_COUNT3_ADDRESS 0x0000007c -#define LF_TIMER_COUNT3_OFFSET 0x0000007c -#define LF_TIMER_COUNT3_VALUE_MSB 31 -#define LF_TIMER_COUNT3_VALUE_LSB 0 -#define LF_TIMER_COUNT3_VALUE_MASK 0xffffffff -#define LF_TIMER_COUNT3_VALUE_GET(x) (((x) & LF_TIMER_COUNT3_VALUE_MASK) >> LF_TIMER_COUNT3_VALUE_LSB) -#define LF_TIMER_COUNT3_VALUE_SET(x) (((x) << LF_TIMER_COUNT3_VALUE_LSB) & LF_TIMER_COUNT3_VALUE_MASK) - -#define LF_TIMER_CONTROL3_ADDRESS 0x00000080 -#define LF_TIMER_CONTROL3_OFFSET 0x00000080 -#define LF_TIMER_CONTROL3_ENABLE_MSB 2 -#define LF_TIMER_CONTROL3_ENABLE_LSB 2 -#define LF_TIMER_CONTROL3_ENABLE_MASK 0x00000004 -#define LF_TIMER_CONTROL3_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL3_ENABLE_MASK) >> LF_TIMER_CONTROL3_ENABLE_LSB) -#define LF_TIMER_CONTROL3_ENABLE_SET(x) (((x) << LF_TIMER_CONTROL3_ENABLE_LSB) & LF_TIMER_CONTROL3_ENABLE_MASK) -#define LF_TIMER_CONTROL3_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL3_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL3_AUTO_RESTART_MASK 0x00000002 -#define LF_TIMER_CONTROL3_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL3_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL3_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL3_AUTO_RESTART_SET(x) (((x) << LF_TIMER_CONTROL3_AUTO_RESTART_LSB) & LF_TIMER_CONTROL3_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL3_RESET_MSB 0 -#define LF_TIMER_CONTROL3_RESET_LSB 0 -#define LF_TIMER_CONTROL3_RESET_MASK 0x00000001 -#define LF_TIMER_CONTROL3_RESET_GET(x) (((x) & LF_TIMER_CONTROL3_RESET_MASK) >> LF_TIMER_CONTROL3_RESET_LSB) -#define LF_TIMER_CONTROL3_RESET_SET(x) (((x) << LF_TIMER_CONTROL3_RESET_LSB) & LF_TIMER_CONTROL3_RESET_MASK) - -#define LF_TIMER_STATUS3_ADDRESS 0x00000084 -#define LF_TIMER_STATUS3_OFFSET 0x00000084 -#define LF_TIMER_STATUS3_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS3_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS3_INTERRUPT_MASK 0x00000001 -#define LF_TIMER_STATUS3_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS3_INTERRUPT_MASK) >> LF_TIMER_STATUS3_INTERRUPT_LSB) -#define LF_TIMER_STATUS3_INTERRUPT_SET(x) (((x) << LF_TIMER_STATUS3_INTERRUPT_LSB) & LF_TIMER_STATUS3_INTERRUPT_MASK) - -#define HF_TIMER_ADDRESS 0x00000088 -#define HF_TIMER_OFFSET 0x00000088 -#define HF_TIMER_TARGET_MSB 31 -#define HF_TIMER_TARGET_LSB 12 -#define HF_TIMER_TARGET_MASK 0xfffff000 -#define HF_TIMER_TARGET_GET(x) (((x) & HF_TIMER_TARGET_MASK) >> HF_TIMER_TARGET_LSB) -#define HF_TIMER_TARGET_SET(x) (((x) << HF_TIMER_TARGET_LSB) & HF_TIMER_TARGET_MASK) - -#define HF_TIMER_COUNT_ADDRESS 0x0000008c -#define HF_TIMER_COUNT_OFFSET 0x0000008c -#define HF_TIMER_COUNT_VALUE_MSB 31 -#define HF_TIMER_COUNT_VALUE_LSB 12 -#define HF_TIMER_COUNT_VALUE_MASK 0xfffff000 -#define HF_TIMER_COUNT_VALUE_GET(x) (((x) & HF_TIMER_COUNT_VALUE_MASK) >> HF_TIMER_COUNT_VALUE_LSB) -#define HF_TIMER_COUNT_VALUE_SET(x) (((x) << HF_TIMER_COUNT_VALUE_LSB) & HF_TIMER_COUNT_VALUE_MASK) - -#define HF_LF_COUNT_ADDRESS 0x00000090 -#define HF_LF_COUNT_OFFSET 0x00000090 -#define HF_LF_COUNT_VALUE_MSB 31 -#define HF_LF_COUNT_VALUE_LSB 0 -#define HF_LF_COUNT_VALUE_MASK 0xffffffff -#define HF_LF_COUNT_VALUE_GET(x) (((x) & HF_LF_COUNT_VALUE_MASK) >> HF_LF_COUNT_VALUE_LSB) -#define HF_LF_COUNT_VALUE_SET(x) (((x) << HF_LF_COUNT_VALUE_LSB) & HF_LF_COUNT_VALUE_MASK) - -#define HF_TIMER_CONTROL_ADDRESS 0x00000094 -#define HF_TIMER_CONTROL_OFFSET 0x00000094 -#define HF_TIMER_CONTROL_ENABLE_MSB 3 -#define HF_TIMER_CONTROL_ENABLE_LSB 3 -#define HF_TIMER_CONTROL_ENABLE_MASK 0x00000008 -#define HF_TIMER_CONTROL_ENABLE_GET(x) (((x) & HF_TIMER_CONTROL_ENABLE_MASK) >> HF_TIMER_CONTROL_ENABLE_LSB) -#define HF_TIMER_CONTROL_ENABLE_SET(x) (((x) << HF_TIMER_CONTROL_ENABLE_LSB) & HF_TIMER_CONTROL_ENABLE_MASK) -#define HF_TIMER_CONTROL_ON_MSB 2 -#define HF_TIMER_CONTROL_ON_LSB 2 -#define HF_TIMER_CONTROL_ON_MASK 0x00000004 -#define HF_TIMER_CONTROL_ON_GET(x) (((x) & HF_TIMER_CONTROL_ON_MASK) >> HF_TIMER_CONTROL_ON_LSB) -#define HF_TIMER_CONTROL_ON_SET(x) (((x) << HF_TIMER_CONTROL_ON_LSB) & HF_TIMER_CONTROL_ON_MASK) -#define HF_TIMER_CONTROL_AUTO_RESTART_MSB 1 -#define HF_TIMER_CONTROL_AUTO_RESTART_LSB 1 -#define HF_TIMER_CONTROL_AUTO_RESTART_MASK 0x00000002 -#define HF_TIMER_CONTROL_AUTO_RESTART_GET(x) (((x) & HF_TIMER_CONTROL_AUTO_RESTART_MASK) >> HF_TIMER_CONTROL_AUTO_RESTART_LSB) -#define HF_TIMER_CONTROL_AUTO_RESTART_SET(x) (((x) << HF_TIMER_CONTROL_AUTO_RESTART_LSB) & HF_TIMER_CONTROL_AUTO_RESTART_MASK) -#define HF_TIMER_CONTROL_RESET_MSB 0 -#define HF_TIMER_CONTROL_RESET_LSB 0 -#define HF_TIMER_CONTROL_RESET_MASK 0x00000001 -#define HF_TIMER_CONTROL_RESET_GET(x) (((x) & HF_TIMER_CONTROL_RESET_MASK) >> HF_TIMER_CONTROL_RESET_LSB) -#define HF_TIMER_CONTROL_RESET_SET(x) (((x) << HF_TIMER_CONTROL_RESET_LSB) & HF_TIMER_CONTROL_RESET_MASK) - -#define HF_TIMER_STATUS_ADDRESS 0x00000098 -#define HF_TIMER_STATUS_OFFSET 0x00000098 -#define HF_TIMER_STATUS_INTERRUPT_MSB 0 -#define HF_TIMER_STATUS_INTERRUPT_LSB 0 -#define HF_TIMER_STATUS_INTERRUPT_MASK 0x00000001 -#define HF_TIMER_STATUS_INTERRUPT_GET(x) (((x) & HF_TIMER_STATUS_INTERRUPT_MASK) >> HF_TIMER_STATUS_INTERRUPT_LSB) -#define HF_TIMER_STATUS_INTERRUPT_SET(x) (((x) << HF_TIMER_STATUS_INTERRUPT_LSB) & HF_TIMER_STATUS_INTERRUPT_MASK) - -#define RTC_CONTROL_ADDRESS 0x0000009c -#define RTC_CONTROL_OFFSET 0x0000009c -#define RTC_CONTROL_ENABLE_MSB 2 -#define RTC_CONTROL_ENABLE_LSB 2 -#define RTC_CONTROL_ENABLE_MASK 0x00000004 -#define RTC_CONTROL_ENABLE_GET(x) (((x) & RTC_CONTROL_ENABLE_MASK) >> RTC_CONTROL_ENABLE_LSB) -#define RTC_CONTROL_ENABLE_SET(x) (((x) << RTC_CONTROL_ENABLE_LSB) & RTC_CONTROL_ENABLE_MASK) -#define RTC_CONTROL_LOAD_RTC_MSB 1 -#define RTC_CONTROL_LOAD_RTC_LSB 1 -#define RTC_CONTROL_LOAD_RTC_MASK 0x00000002 -#define RTC_CONTROL_LOAD_RTC_GET(x) (((x) & RTC_CONTROL_LOAD_RTC_MASK) >> RTC_CONTROL_LOAD_RTC_LSB) -#define RTC_CONTROL_LOAD_RTC_SET(x) (((x) << RTC_CONTROL_LOAD_RTC_LSB) & RTC_CONTROL_LOAD_RTC_MASK) -#define RTC_CONTROL_LOAD_ALARM_MSB 0 -#define RTC_CONTROL_LOAD_ALARM_LSB 0 -#define RTC_CONTROL_LOAD_ALARM_MASK 0x00000001 -#define RTC_CONTROL_LOAD_ALARM_GET(x) (((x) & RTC_CONTROL_LOAD_ALARM_MASK) >> RTC_CONTROL_LOAD_ALARM_LSB) -#define RTC_CONTROL_LOAD_ALARM_SET(x) (((x) << RTC_CONTROL_LOAD_ALARM_LSB) & RTC_CONTROL_LOAD_ALARM_MASK) - -#define RTC_TIME_ADDRESS 0x000000a0 -#define RTC_TIME_OFFSET 0x000000a0 -#define RTC_TIME_WEEK_DAY_MSB 26 -#define RTC_TIME_WEEK_DAY_LSB 24 -#define RTC_TIME_WEEK_DAY_MASK 0x07000000 -#define RTC_TIME_WEEK_DAY_GET(x) (((x) & RTC_TIME_WEEK_DAY_MASK) >> RTC_TIME_WEEK_DAY_LSB) -#define RTC_TIME_WEEK_DAY_SET(x) (((x) << RTC_TIME_WEEK_DAY_LSB) & RTC_TIME_WEEK_DAY_MASK) -#define RTC_TIME_HOUR_MSB 21 -#define RTC_TIME_HOUR_LSB 16 -#define RTC_TIME_HOUR_MASK 0x003f0000 -#define RTC_TIME_HOUR_GET(x) (((x) & RTC_TIME_HOUR_MASK) >> RTC_TIME_HOUR_LSB) -#define RTC_TIME_HOUR_SET(x) (((x) << RTC_TIME_HOUR_LSB) & RTC_TIME_HOUR_MASK) -#define RTC_TIME_MINUTE_MSB 14 -#define RTC_TIME_MINUTE_LSB 8 -#define RTC_TIME_MINUTE_MASK 0x00007f00 -#define RTC_TIME_MINUTE_GET(x) (((x) & RTC_TIME_MINUTE_MASK) >> RTC_TIME_MINUTE_LSB) -#define RTC_TIME_MINUTE_SET(x) (((x) << RTC_TIME_MINUTE_LSB) & RTC_TIME_MINUTE_MASK) -#define RTC_TIME_SECOND_MSB 6 -#define RTC_TIME_SECOND_LSB 0 -#define RTC_TIME_SECOND_MASK 0x0000007f -#define RTC_TIME_SECOND_GET(x) (((x) & RTC_TIME_SECOND_MASK) >> RTC_TIME_SECOND_LSB) -#define RTC_TIME_SECOND_SET(x) (((x) << RTC_TIME_SECOND_LSB) & RTC_TIME_SECOND_MASK) - -#define RTC_DATE_ADDRESS 0x000000a4 -#define RTC_DATE_OFFSET 0x000000a4 -#define RTC_DATE_YEAR_MSB 23 -#define RTC_DATE_YEAR_LSB 16 -#define RTC_DATE_YEAR_MASK 0x00ff0000 -#define RTC_DATE_YEAR_GET(x) (((x) & RTC_DATE_YEAR_MASK) >> RTC_DATE_YEAR_LSB) -#define RTC_DATE_YEAR_SET(x) (((x) << RTC_DATE_YEAR_LSB) & RTC_DATE_YEAR_MASK) -#define RTC_DATE_MONTH_MSB 12 -#define RTC_DATE_MONTH_LSB 8 -#define RTC_DATE_MONTH_MASK 0x00001f00 -#define RTC_DATE_MONTH_GET(x) (((x) & RTC_DATE_MONTH_MASK) >> RTC_DATE_MONTH_LSB) -#define RTC_DATE_MONTH_SET(x) (((x) << RTC_DATE_MONTH_LSB) & RTC_DATE_MONTH_MASK) -#define RTC_DATE_MONTH_DAY_MSB 5 -#define RTC_DATE_MONTH_DAY_LSB 0 -#define RTC_DATE_MONTH_DAY_MASK 0x0000003f -#define RTC_DATE_MONTH_DAY_GET(x) (((x) & RTC_DATE_MONTH_DAY_MASK) >> RTC_DATE_MONTH_DAY_LSB) -#define RTC_DATE_MONTH_DAY_SET(x) (((x) << RTC_DATE_MONTH_DAY_LSB) & RTC_DATE_MONTH_DAY_MASK) - -#define RTC_SET_TIME_ADDRESS 0x000000a8 -#define RTC_SET_TIME_OFFSET 0x000000a8 -#define RTC_SET_TIME_WEEK_DAY_MSB 26 -#define RTC_SET_TIME_WEEK_DAY_LSB 24 -#define RTC_SET_TIME_WEEK_DAY_MASK 0x07000000 -#define RTC_SET_TIME_WEEK_DAY_GET(x) (((x) & RTC_SET_TIME_WEEK_DAY_MASK) >> RTC_SET_TIME_WEEK_DAY_LSB) -#define RTC_SET_TIME_WEEK_DAY_SET(x) (((x) << RTC_SET_TIME_WEEK_DAY_LSB) & RTC_SET_TIME_WEEK_DAY_MASK) -#define RTC_SET_TIME_HOUR_MSB 21 -#define RTC_SET_TIME_HOUR_LSB 16 -#define RTC_SET_TIME_HOUR_MASK 0x003f0000 -#define RTC_SET_TIME_HOUR_GET(x) (((x) & RTC_SET_TIME_HOUR_MASK) >> RTC_SET_TIME_HOUR_LSB) -#define RTC_SET_TIME_HOUR_SET(x) (((x) << RTC_SET_TIME_HOUR_LSB) & RTC_SET_TIME_HOUR_MASK) -#define RTC_SET_TIME_MINUTE_MSB 14 -#define RTC_SET_TIME_MINUTE_LSB 8 -#define RTC_SET_TIME_MINUTE_MASK 0x00007f00 -#define RTC_SET_TIME_MINUTE_GET(x) (((x) & RTC_SET_TIME_MINUTE_MASK) >> RTC_SET_TIME_MINUTE_LSB) -#define RTC_SET_TIME_MINUTE_SET(x) (((x) << RTC_SET_TIME_MINUTE_LSB) & RTC_SET_TIME_MINUTE_MASK) -#define RTC_SET_TIME_SECOND_MSB 6 -#define RTC_SET_TIME_SECOND_LSB 0 -#define RTC_SET_TIME_SECOND_MASK 0x0000007f -#define RTC_SET_TIME_SECOND_GET(x) (((x) & RTC_SET_TIME_SECOND_MASK) >> RTC_SET_TIME_SECOND_LSB) -#define RTC_SET_TIME_SECOND_SET(x) (((x) << RTC_SET_TIME_SECOND_LSB) & RTC_SET_TIME_SECOND_MASK) - -#define RTC_SET_DATE_ADDRESS 0x000000ac -#define RTC_SET_DATE_OFFSET 0x000000ac -#define RTC_SET_DATE_YEAR_MSB 23 -#define RTC_SET_DATE_YEAR_LSB 16 -#define RTC_SET_DATE_YEAR_MASK 0x00ff0000 -#define RTC_SET_DATE_YEAR_GET(x) (((x) & RTC_SET_DATE_YEAR_MASK) >> RTC_SET_DATE_YEAR_LSB) -#define RTC_SET_DATE_YEAR_SET(x) (((x) << RTC_SET_DATE_YEAR_LSB) & RTC_SET_DATE_YEAR_MASK) -#define RTC_SET_DATE_MONTH_MSB 12 -#define RTC_SET_DATE_MONTH_LSB 8 -#define RTC_SET_DATE_MONTH_MASK 0x00001f00 -#define RTC_SET_DATE_MONTH_GET(x) (((x) & RTC_SET_DATE_MONTH_MASK) >> RTC_SET_DATE_MONTH_LSB) -#define RTC_SET_DATE_MONTH_SET(x) (((x) << RTC_SET_DATE_MONTH_LSB) & RTC_SET_DATE_MONTH_MASK) -#define RTC_SET_DATE_MONTH_DAY_MSB 5 -#define RTC_SET_DATE_MONTH_DAY_LSB 0 -#define RTC_SET_DATE_MONTH_DAY_MASK 0x0000003f -#define RTC_SET_DATE_MONTH_DAY_GET(x) (((x) & RTC_SET_DATE_MONTH_DAY_MASK) >> RTC_SET_DATE_MONTH_DAY_LSB) -#define RTC_SET_DATE_MONTH_DAY_SET(x) (((x) << RTC_SET_DATE_MONTH_DAY_LSB) & RTC_SET_DATE_MONTH_DAY_MASK) - -#define RTC_SET_ALARM_ADDRESS 0x000000b0 -#define RTC_SET_ALARM_OFFSET 0x000000b0 -#define RTC_SET_ALARM_HOUR_MSB 21 -#define RTC_SET_ALARM_HOUR_LSB 16 -#define RTC_SET_ALARM_HOUR_MASK 0x003f0000 -#define RTC_SET_ALARM_HOUR_GET(x) (((x) & RTC_SET_ALARM_HOUR_MASK) >> RTC_SET_ALARM_HOUR_LSB) -#define RTC_SET_ALARM_HOUR_SET(x) (((x) << RTC_SET_ALARM_HOUR_LSB) & RTC_SET_ALARM_HOUR_MASK) -#define RTC_SET_ALARM_MINUTE_MSB 14 -#define RTC_SET_ALARM_MINUTE_LSB 8 -#define RTC_SET_ALARM_MINUTE_MASK 0x00007f00 -#define RTC_SET_ALARM_MINUTE_GET(x) (((x) & RTC_SET_ALARM_MINUTE_MASK) >> RTC_SET_ALARM_MINUTE_LSB) -#define RTC_SET_ALARM_MINUTE_SET(x) (((x) << RTC_SET_ALARM_MINUTE_LSB) & RTC_SET_ALARM_MINUTE_MASK) -#define RTC_SET_ALARM_SECOND_MSB 6 -#define RTC_SET_ALARM_SECOND_LSB 0 -#define RTC_SET_ALARM_SECOND_MASK 0x0000007f -#define RTC_SET_ALARM_SECOND_GET(x) (((x) & RTC_SET_ALARM_SECOND_MASK) >> RTC_SET_ALARM_SECOND_LSB) -#define RTC_SET_ALARM_SECOND_SET(x) (((x) << RTC_SET_ALARM_SECOND_LSB) & RTC_SET_ALARM_SECOND_MASK) - -#define RTC_CONFIG_ADDRESS 0x000000b4 -#define RTC_CONFIG_OFFSET 0x000000b4 -#define RTC_CONFIG_BCD_MSB 2 -#define RTC_CONFIG_BCD_LSB 2 -#define RTC_CONFIG_BCD_MASK 0x00000004 -#define RTC_CONFIG_BCD_GET(x) (((x) & RTC_CONFIG_BCD_MASK) >> RTC_CONFIG_BCD_LSB) -#define RTC_CONFIG_BCD_SET(x) (((x) << RTC_CONFIG_BCD_LSB) & RTC_CONFIG_BCD_MASK) -#define RTC_CONFIG_TWELVE_HOUR_MSB 1 -#define RTC_CONFIG_TWELVE_HOUR_LSB 1 -#define RTC_CONFIG_TWELVE_HOUR_MASK 0x00000002 -#define RTC_CONFIG_TWELVE_HOUR_GET(x) (((x) & RTC_CONFIG_TWELVE_HOUR_MASK) >> RTC_CONFIG_TWELVE_HOUR_LSB) -#define RTC_CONFIG_TWELVE_HOUR_SET(x) (((x) << RTC_CONFIG_TWELVE_HOUR_LSB) & RTC_CONFIG_TWELVE_HOUR_MASK) -#define RTC_CONFIG_DSE_MSB 0 -#define RTC_CONFIG_DSE_LSB 0 -#define RTC_CONFIG_DSE_MASK 0x00000001 -#define RTC_CONFIG_DSE_GET(x) (((x) & RTC_CONFIG_DSE_MASK) >> RTC_CONFIG_DSE_LSB) -#define RTC_CONFIG_DSE_SET(x) (((x) << RTC_CONFIG_DSE_LSB) & RTC_CONFIG_DSE_MASK) - -#define RTC_ALARM_STATUS_ADDRESS 0x000000b8 -#define RTC_ALARM_STATUS_OFFSET 0x000000b8 -#define RTC_ALARM_STATUS_ENABLE_MSB 1 -#define RTC_ALARM_STATUS_ENABLE_LSB 1 -#define RTC_ALARM_STATUS_ENABLE_MASK 0x00000002 -#define RTC_ALARM_STATUS_ENABLE_GET(x) (((x) & RTC_ALARM_STATUS_ENABLE_MASK) >> RTC_ALARM_STATUS_ENABLE_LSB) -#define RTC_ALARM_STATUS_ENABLE_SET(x) (((x) << RTC_ALARM_STATUS_ENABLE_LSB) & RTC_ALARM_STATUS_ENABLE_MASK) -#define RTC_ALARM_STATUS_INTERRUPT_MSB 0 -#define RTC_ALARM_STATUS_INTERRUPT_LSB 0 -#define RTC_ALARM_STATUS_INTERRUPT_MASK 0x00000001 -#define RTC_ALARM_STATUS_INTERRUPT_GET(x) (((x) & RTC_ALARM_STATUS_INTERRUPT_MASK) >> RTC_ALARM_STATUS_INTERRUPT_LSB) -#define RTC_ALARM_STATUS_INTERRUPT_SET(x) (((x) << RTC_ALARM_STATUS_INTERRUPT_LSB) & RTC_ALARM_STATUS_INTERRUPT_MASK) - -#define UART_WAKEUP_ADDRESS 0x000000bc -#define UART_WAKEUP_OFFSET 0x000000bc -#define UART_WAKEUP_ENABLE_MSB 0 -#define UART_WAKEUP_ENABLE_LSB 0 -#define UART_WAKEUP_ENABLE_MASK 0x00000001 -#define UART_WAKEUP_ENABLE_GET(x) (((x) & UART_WAKEUP_ENABLE_MASK) >> UART_WAKEUP_ENABLE_LSB) -#define UART_WAKEUP_ENABLE_SET(x) (((x) << UART_WAKEUP_ENABLE_LSB) & UART_WAKEUP_ENABLE_MASK) - -#define RESET_CAUSE_ADDRESS 0x000000c0 -#define RESET_CAUSE_OFFSET 0x000000c0 -#define RESET_CAUSE_LAST_MSB 2 -#define RESET_CAUSE_LAST_LSB 0 -#define RESET_CAUSE_LAST_MASK 0x00000007 -#define RESET_CAUSE_LAST_GET(x) (((x) & RESET_CAUSE_LAST_MASK) >> RESET_CAUSE_LAST_LSB) -#define RESET_CAUSE_LAST_SET(x) (((x) << RESET_CAUSE_LAST_LSB) & RESET_CAUSE_LAST_MASK) - -#define SYSTEM_SLEEP_ADDRESS 0x000000c4 -#define SYSTEM_SLEEP_OFFSET 0x000000c4 -#define SYSTEM_SLEEP_HOST_IF_MSB 4 -#define SYSTEM_SLEEP_HOST_IF_LSB 4 -#define SYSTEM_SLEEP_HOST_IF_MASK 0x00000010 -#define SYSTEM_SLEEP_HOST_IF_GET(x) (((x) & SYSTEM_SLEEP_HOST_IF_MASK) >> SYSTEM_SLEEP_HOST_IF_LSB) -#define SYSTEM_SLEEP_HOST_IF_SET(x) (((x) << SYSTEM_SLEEP_HOST_IF_LSB) & SYSTEM_SLEEP_HOST_IF_MASK) -#define SYSTEM_SLEEP_MBOX_MSB 3 -#define SYSTEM_SLEEP_MBOX_LSB 3 -#define SYSTEM_SLEEP_MBOX_MASK 0x00000008 -#define SYSTEM_SLEEP_MBOX_GET(x) (((x) & SYSTEM_SLEEP_MBOX_MASK) >> SYSTEM_SLEEP_MBOX_LSB) -#define SYSTEM_SLEEP_MBOX_SET(x) (((x) << SYSTEM_SLEEP_MBOX_LSB) & SYSTEM_SLEEP_MBOX_MASK) -#define SYSTEM_SLEEP_MAC_IF_MSB 2 -#define SYSTEM_SLEEP_MAC_IF_LSB 2 -#define SYSTEM_SLEEP_MAC_IF_MASK 0x00000004 -#define SYSTEM_SLEEP_MAC_IF_GET(x) (((x) & SYSTEM_SLEEP_MAC_IF_MASK) >> SYSTEM_SLEEP_MAC_IF_LSB) -#define SYSTEM_SLEEP_MAC_IF_SET(x) (((x) << SYSTEM_SLEEP_MAC_IF_LSB) & SYSTEM_SLEEP_MAC_IF_MASK) -#define SYSTEM_SLEEP_LIGHT_MSB 1 -#define SYSTEM_SLEEP_LIGHT_LSB 1 -#define SYSTEM_SLEEP_LIGHT_MASK 0x00000002 -#define SYSTEM_SLEEP_LIGHT_GET(x) (((x) & SYSTEM_SLEEP_LIGHT_MASK) >> SYSTEM_SLEEP_LIGHT_LSB) -#define SYSTEM_SLEEP_LIGHT_SET(x) (((x) << SYSTEM_SLEEP_LIGHT_LSB) & SYSTEM_SLEEP_LIGHT_MASK) -#define SYSTEM_SLEEP_DISABLE_MSB 0 -#define SYSTEM_SLEEP_DISABLE_LSB 0 -#define SYSTEM_SLEEP_DISABLE_MASK 0x00000001 -#define SYSTEM_SLEEP_DISABLE_GET(x) (((x) & SYSTEM_SLEEP_DISABLE_MASK) >> SYSTEM_SLEEP_DISABLE_LSB) -#define SYSTEM_SLEEP_DISABLE_SET(x) (((x) << SYSTEM_SLEEP_DISABLE_LSB) & SYSTEM_SLEEP_DISABLE_MASK) - -#define SDIO_WRAPPER_ADDRESS 0x000000c8 -#define SDIO_WRAPPER_OFFSET 0x000000c8 -#define SDIO_WRAPPER_SLEEP_MSB 3 -#define SDIO_WRAPPER_SLEEP_LSB 3 -#define SDIO_WRAPPER_SLEEP_MASK 0x00000008 -#define SDIO_WRAPPER_SLEEP_GET(x) (((x) & SDIO_WRAPPER_SLEEP_MASK) >> SDIO_WRAPPER_SLEEP_LSB) -#define SDIO_WRAPPER_SLEEP_SET(x) (((x) << SDIO_WRAPPER_SLEEP_LSB) & SDIO_WRAPPER_SLEEP_MASK) -#define SDIO_WRAPPER_WAKEUP_MSB 2 -#define SDIO_WRAPPER_WAKEUP_LSB 2 -#define SDIO_WRAPPER_WAKEUP_MASK 0x00000004 -#define SDIO_WRAPPER_WAKEUP_GET(x) (((x) & SDIO_WRAPPER_WAKEUP_MASK) >> SDIO_WRAPPER_WAKEUP_LSB) -#define SDIO_WRAPPER_WAKEUP_SET(x) (((x) << SDIO_WRAPPER_WAKEUP_LSB) & SDIO_WRAPPER_WAKEUP_MASK) -#define SDIO_WRAPPER_SOC_ON_MSB 1 -#define SDIO_WRAPPER_SOC_ON_LSB 1 -#define SDIO_WRAPPER_SOC_ON_MASK 0x00000002 -#define SDIO_WRAPPER_SOC_ON_GET(x) (((x) & SDIO_WRAPPER_SOC_ON_MASK) >> SDIO_WRAPPER_SOC_ON_LSB) -#define SDIO_WRAPPER_SOC_ON_SET(x) (((x) << SDIO_WRAPPER_SOC_ON_LSB) & SDIO_WRAPPER_SOC_ON_MASK) -#define SDIO_WRAPPER_ON_MSB 0 -#define SDIO_WRAPPER_ON_LSB 0 -#define SDIO_WRAPPER_ON_MASK 0x00000001 -#define SDIO_WRAPPER_ON_GET(x) (((x) & SDIO_WRAPPER_ON_MASK) >> SDIO_WRAPPER_ON_LSB) -#define SDIO_WRAPPER_ON_SET(x) (((x) << SDIO_WRAPPER_ON_LSB) & SDIO_WRAPPER_ON_MASK) - -#define MAC_SLEEP_CONTROL_ADDRESS 0x000000cc -#define MAC_SLEEP_CONTROL_OFFSET 0x000000cc -#define MAC_SLEEP_CONTROL_ENABLE_MSB 1 -#define MAC_SLEEP_CONTROL_ENABLE_LSB 0 -#define MAC_SLEEP_CONTROL_ENABLE_MASK 0x00000003 -#define MAC_SLEEP_CONTROL_ENABLE_GET(x) (((x) & MAC_SLEEP_CONTROL_ENABLE_MASK) >> MAC_SLEEP_CONTROL_ENABLE_LSB) -#define MAC_SLEEP_CONTROL_ENABLE_SET(x) (((x) << MAC_SLEEP_CONTROL_ENABLE_LSB) & MAC_SLEEP_CONTROL_ENABLE_MASK) - -#define KEEP_AWAKE_ADDRESS 0x000000d0 -#define KEEP_AWAKE_OFFSET 0x000000d0 -#define KEEP_AWAKE_COUNT_MSB 7 -#define KEEP_AWAKE_COUNT_LSB 0 -#define KEEP_AWAKE_COUNT_MASK 0x000000ff -#define KEEP_AWAKE_COUNT_GET(x) (((x) & KEEP_AWAKE_COUNT_MASK) >> KEEP_AWAKE_COUNT_LSB) -#define KEEP_AWAKE_COUNT_SET(x) (((x) << KEEP_AWAKE_COUNT_LSB) & KEEP_AWAKE_COUNT_MASK) - -#define LPO_CAL_TIME_ADDRESS 0x000000d4 -#define LPO_CAL_TIME_OFFSET 0x000000d4 -#define LPO_CAL_TIME_LENGTH_MSB 13 -#define LPO_CAL_TIME_LENGTH_LSB 0 -#define LPO_CAL_TIME_LENGTH_MASK 0x00003fff -#define LPO_CAL_TIME_LENGTH_GET(x) (((x) & LPO_CAL_TIME_LENGTH_MASK) >> LPO_CAL_TIME_LENGTH_LSB) -#define LPO_CAL_TIME_LENGTH_SET(x) (((x) << LPO_CAL_TIME_LENGTH_LSB) & LPO_CAL_TIME_LENGTH_MASK) - -#define LPO_INIT_DIVIDEND_INT_ADDRESS 0x000000d8 -#define LPO_INIT_DIVIDEND_INT_OFFSET 0x000000d8 -#define LPO_INIT_DIVIDEND_INT_VALUE_MSB 23 -#define LPO_INIT_DIVIDEND_INT_VALUE_LSB 0 -#define LPO_INIT_DIVIDEND_INT_VALUE_MASK 0x00ffffff -#define LPO_INIT_DIVIDEND_INT_VALUE_GET(x) (((x) & LPO_INIT_DIVIDEND_INT_VALUE_MASK) >> LPO_INIT_DIVIDEND_INT_VALUE_LSB) -#define LPO_INIT_DIVIDEND_INT_VALUE_SET(x) (((x) << LPO_INIT_DIVIDEND_INT_VALUE_LSB) & LPO_INIT_DIVIDEND_INT_VALUE_MASK) - -#define LPO_INIT_DIVIDEND_FRACTION_ADDRESS 0x000000dc -#define LPO_INIT_DIVIDEND_FRACTION_OFFSET 0x000000dc -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_MSB 10 -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB 0 -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK 0x000007ff -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_GET(x) (((x) & LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK) >> LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB) -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_SET(x) (((x) << LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB) & LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK) - -#define LPO_CAL_ADDRESS 0x000000e0 -#define LPO_CAL_OFFSET 0x000000e0 -#define LPO_CAL_ENABLE_MSB 20 -#define LPO_CAL_ENABLE_LSB 20 -#define LPO_CAL_ENABLE_MASK 0x00100000 -#define LPO_CAL_ENABLE_GET(x) (((x) & LPO_CAL_ENABLE_MASK) >> LPO_CAL_ENABLE_LSB) -#define LPO_CAL_ENABLE_SET(x) (((x) << LPO_CAL_ENABLE_LSB) & LPO_CAL_ENABLE_MASK) -#define LPO_CAL_COUNT_MSB 19 -#define LPO_CAL_COUNT_LSB 0 -#define LPO_CAL_COUNT_MASK 0x000fffff -#define LPO_CAL_COUNT_GET(x) (((x) & LPO_CAL_COUNT_MASK) >> LPO_CAL_COUNT_LSB) -#define LPO_CAL_COUNT_SET(x) (((x) << LPO_CAL_COUNT_LSB) & LPO_CAL_COUNT_MASK) - -#define LPO_CAL_TEST_CONTROL_ADDRESS 0x000000e4 -#define LPO_CAL_TEST_CONTROL_OFFSET 0x000000e4 -#define LPO_CAL_TEST_CONTROL_ENABLE_MSB 5 -#define LPO_CAL_TEST_CONTROL_ENABLE_LSB 5 -#define LPO_CAL_TEST_CONTROL_ENABLE_MASK 0x00000020 -#define LPO_CAL_TEST_CONTROL_ENABLE_GET(x) (((x) & LPO_CAL_TEST_CONTROL_ENABLE_MASK) >> LPO_CAL_TEST_CONTROL_ENABLE_LSB) -#define LPO_CAL_TEST_CONTROL_ENABLE_SET(x) (((x) << LPO_CAL_TEST_CONTROL_ENABLE_LSB) & LPO_CAL_TEST_CONTROL_ENABLE_MASK) -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_MSB 4 -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB 0 -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK 0x0000001f -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_GET(x) (((x) & LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK) >> LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB) -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_SET(x) (((x) << LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB) & LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK) - -#define LPO_CAL_TEST_STATUS_ADDRESS 0x000000e8 -#define LPO_CAL_TEST_STATUS_OFFSET 0x000000e8 -#define LPO_CAL_TEST_STATUS_READY_MSB 16 -#define LPO_CAL_TEST_STATUS_READY_LSB 16 -#define LPO_CAL_TEST_STATUS_READY_MASK 0x00010000 -#define LPO_CAL_TEST_STATUS_READY_GET(x) (((x) & LPO_CAL_TEST_STATUS_READY_MASK) >> LPO_CAL_TEST_STATUS_READY_LSB) -#define LPO_CAL_TEST_STATUS_READY_SET(x) (((x) << LPO_CAL_TEST_STATUS_READY_LSB) & LPO_CAL_TEST_STATUS_READY_MASK) -#define LPO_CAL_TEST_STATUS_COUNT_MSB 15 -#define LPO_CAL_TEST_STATUS_COUNT_LSB 0 -#define LPO_CAL_TEST_STATUS_COUNT_MASK 0x0000ffff -#define LPO_CAL_TEST_STATUS_COUNT_GET(x) (((x) & LPO_CAL_TEST_STATUS_COUNT_MASK) >> LPO_CAL_TEST_STATUS_COUNT_LSB) -#define LPO_CAL_TEST_STATUS_COUNT_SET(x) (((x) << LPO_CAL_TEST_STATUS_COUNT_LSB) & LPO_CAL_TEST_STATUS_COUNT_MASK) - -#define CHIP_ID_ADDRESS 0x000000ec -#define CHIP_ID_OFFSET 0x000000ec -#define CHIP_ID_DEVICE_ID_MSB 31 -#define CHIP_ID_DEVICE_ID_LSB 16 -#define CHIP_ID_DEVICE_ID_MASK 0xffff0000 -#define CHIP_ID_DEVICE_ID_GET(x) (((x) & CHIP_ID_DEVICE_ID_MASK) >> CHIP_ID_DEVICE_ID_LSB) -#define CHIP_ID_DEVICE_ID_SET(x) (((x) << CHIP_ID_DEVICE_ID_LSB) & CHIP_ID_DEVICE_ID_MASK) -#define CHIP_ID_CONFIG_ID_MSB 15 -#define CHIP_ID_CONFIG_ID_LSB 4 -#define CHIP_ID_CONFIG_ID_MASK 0x0000fff0 -#define CHIP_ID_CONFIG_ID_GET(x) (((x) & CHIP_ID_CONFIG_ID_MASK) >> CHIP_ID_CONFIG_ID_LSB) -#define CHIP_ID_CONFIG_ID_SET(x) (((x) << CHIP_ID_CONFIG_ID_LSB) & CHIP_ID_CONFIG_ID_MASK) -#define CHIP_ID_VERSION_ID_MSB 3 -#define CHIP_ID_VERSION_ID_LSB 0 -#define CHIP_ID_VERSION_ID_MASK 0x0000000f -#define CHIP_ID_VERSION_ID_GET(x) (((x) & CHIP_ID_VERSION_ID_MASK) >> CHIP_ID_VERSION_ID_LSB) -#define CHIP_ID_VERSION_ID_SET(x) (((x) << CHIP_ID_VERSION_ID_LSB) & CHIP_ID_VERSION_ID_MASK) - -#define DERIVED_RTC_CLK_ADDRESS 0x000000f0 -#define DERIVED_RTC_CLK_OFFSET 0x000000f0 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MSB 20 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB 20 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK 0x00100000 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_GET(x) (((x) & DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK) >> DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_SET(x) (((x) << DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB) & DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_MSB 18 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB 18 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK 0x00040000 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_GET(x) (((x) & DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK) >> DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_SET(x) (((x) << DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB) & DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK) -#define DERIVED_RTC_CLK_FORCE_MSB 17 -#define DERIVED_RTC_CLK_FORCE_LSB 16 -#define DERIVED_RTC_CLK_FORCE_MASK 0x00030000 -#define DERIVED_RTC_CLK_FORCE_GET(x) (((x) & DERIVED_RTC_CLK_FORCE_MASK) >> DERIVED_RTC_CLK_FORCE_LSB) -#define DERIVED_RTC_CLK_FORCE_SET(x) (((x) << DERIVED_RTC_CLK_FORCE_LSB) & DERIVED_RTC_CLK_FORCE_MASK) -#define DERIVED_RTC_CLK_PERIOD_MSB 15 -#define DERIVED_RTC_CLK_PERIOD_LSB 1 -#define DERIVED_RTC_CLK_PERIOD_MASK 0x0000fffe -#define DERIVED_RTC_CLK_PERIOD_GET(x) (((x) & DERIVED_RTC_CLK_PERIOD_MASK) >> DERIVED_RTC_CLK_PERIOD_LSB) -#define DERIVED_RTC_CLK_PERIOD_SET(x) (((x) << DERIVED_RTC_CLK_PERIOD_LSB) & DERIVED_RTC_CLK_PERIOD_MASK) - -#define MAC_PCU_SLP32_MODE_ADDRESS 0x000000f4 -#define MAC_PCU_SLP32_MODE_OFFSET 0x000000f4 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MSB 21 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_LSB 21 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MASK 0x00200000 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_GET(x) (((x) & MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MASK) >> MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_LSB) -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_SET(x) (((x) << MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_LSB) & MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MASK) -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MSB 19 -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB 0 -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK 0x000fffff -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_GET(x) (((x) & MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK) >> MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB) -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_SET(x) (((x) << MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB) & MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK) - -#define MAC_PCU_SLP32_WAKE_ADDRESS 0x000000f8 -#define MAC_PCU_SLP32_WAKE_OFFSET 0x000000f8 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_MSB 15 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_LSB 0 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_MASK 0x0000ffff -#define MAC_PCU_SLP32_WAKE_XTL_TIME_GET(x) (((x) & MAC_PCU_SLP32_WAKE_XTL_TIME_MASK) >> MAC_PCU_SLP32_WAKE_XTL_TIME_LSB) -#define MAC_PCU_SLP32_WAKE_XTL_TIME_SET(x) (((x) << MAC_PCU_SLP32_WAKE_XTL_TIME_LSB) & MAC_PCU_SLP32_WAKE_XTL_TIME_MASK) - -#define MAC_PCU_SLP32_INC_ADDRESS 0x000000fc -#define MAC_PCU_SLP32_INC_OFFSET 0x000000fc -#define MAC_PCU_SLP32_INC_TSF_INC_MSB 19 -#define MAC_PCU_SLP32_INC_TSF_INC_LSB 0 -#define MAC_PCU_SLP32_INC_TSF_INC_MASK 0x000fffff -#define MAC_PCU_SLP32_INC_TSF_INC_GET(x) (((x) & MAC_PCU_SLP32_INC_TSF_INC_MASK) >> MAC_PCU_SLP32_INC_TSF_INC_LSB) -#define MAC_PCU_SLP32_INC_TSF_INC_SET(x) (((x) << MAC_PCU_SLP32_INC_TSF_INC_LSB) & MAC_PCU_SLP32_INC_TSF_INC_MASK) - -#define MAC_PCU_SLP_MIB1_ADDRESS 0x00000100 -#define MAC_PCU_SLP_MIB1_OFFSET 0x00000100 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_MSB 31 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB 0 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK 0xffffffff -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_GET(x) (((x) & MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK) >> MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB) -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_SET(x) (((x) << MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB) & MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK) - -#define MAC_PCU_SLP_MIB2_ADDRESS 0x00000104 -#define MAC_PCU_SLP_MIB2_OFFSET 0x00000104 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_MSB 31 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB 0 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK 0xffffffff -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_GET(x) (((x) & MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK) >> MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB) -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_SET(x) (((x) << MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB) & MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK) - -#define MAC_PCU_SLP_MIB3_ADDRESS 0x00000108 -#define MAC_PCU_SLP_MIB3_OFFSET 0x00000108 -#define MAC_PCU_SLP_MIB3_PENDING_MSB 1 -#define MAC_PCU_SLP_MIB3_PENDING_LSB 1 -#define MAC_PCU_SLP_MIB3_PENDING_MASK 0x00000002 -#define MAC_PCU_SLP_MIB3_PENDING_GET(x) (((x) & MAC_PCU_SLP_MIB3_PENDING_MASK) >> MAC_PCU_SLP_MIB3_PENDING_LSB) -#define MAC_PCU_SLP_MIB3_PENDING_SET(x) (((x) << MAC_PCU_SLP_MIB3_PENDING_LSB) & MAC_PCU_SLP_MIB3_PENDING_MASK) -#define MAC_PCU_SLP_MIB3_CLR_CNT_MSB 0 -#define MAC_PCU_SLP_MIB3_CLR_CNT_LSB 0 -#define MAC_PCU_SLP_MIB3_CLR_CNT_MASK 0x00000001 -#define MAC_PCU_SLP_MIB3_CLR_CNT_GET(x) (((x) & MAC_PCU_SLP_MIB3_CLR_CNT_MASK) >> MAC_PCU_SLP_MIB3_CLR_CNT_LSB) -#define MAC_PCU_SLP_MIB3_CLR_CNT_SET(x) (((x) << MAC_PCU_SLP_MIB3_CLR_CNT_LSB) & MAC_PCU_SLP_MIB3_CLR_CNT_MASK) - -#define MAC_PCU_SLP_BEACON_ADDRESS 0x0000010c -#define MAC_PCU_SLP_BEACON_OFFSET 0x0000010c -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MSB 24 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_LSB 24 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MASK 0x01000000 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_GET(x) (((x) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MASK) >> MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_LSB) -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_SET(x) (((x) << MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_LSB) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MASK) -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MSB 23 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_LSB 0 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MASK 0x00ffffff -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_GET(x) (((x) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MASK) >> MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_LSB) -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_SET(x) (((x) << MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_LSB) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MASK) - -#define POWER_REG_ADDRESS 0x00000110 -#define POWER_REG_OFFSET 0x00000110 -#define POWER_REG_VLVL_MSB 11 -#define POWER_REG_VLVL_LSB 8 -#define POWER_REG_VLVL_MASK 0x00000f00 -#define POWER_REG_VLVL_GET(x) (((x) & POWER_REG_VLVL_MASK) >> POWER_REG_VLVL_LSB) -#define POWER_REG_VLVL_SET(x) (((x) << POWER_REG_VLVL_LSB) & POWER_REG_VLVL_MASK) -#define POWER_REG_CPU_INT_ENABLE_MSB 7 -#define POWER_REG_CPU_INT_ENABLE_LSB 7 -#define POWER_REG_CPU_INT_ENABLE_MASK 0x00000080 -#define POWER_REG_CPU_INT_ENABLE_GET(x) (((x) & POWER_REG_CPU_INT_ENABLE_MASK) >> POWER_REG_CPU_INT_ENABLE_LSB) -#define POWER_REG_CPU_INT_ENABLE_SET(x) (((x) << POWER_REG_CPU_INT_ENABLE_LSB) & POWER_REG_CPU_INT_ENABLE_MASK) -#define POWER_REG_WLAN_ISO_DIS_MSB 6 -#define POWER_REG_WLAN_ISO_DIS_LSB 6 -#define POWER_REG_WLAN_ISO_DIS_MASK 0x00000040 -#define POWER_REG_WLAN_ISO_DIS_GET(x) (((x) & POWER_REG_WLAN_ISO_DIS_MASK) >> POWER_REG_WLAN_ISO_DIS_LSB) -#define POWER_REG_WLAN_ISO_DIS_SET(x) (((x) << POWER_REG_WLAN_ISO_DIS_LSB) & POWER_REG_WLAN_ISO_DIS_MASK) -#define POWER_REG_WLAN_ISO_CNTL_MSB 5 -#define POWER_REG_WLAN_ISO_CNTL_LSB 5 -#define POWER_REG_WLAN_ISO_CNTL_MASK 0x00000020 -#define POWER_REG_WLAN_ISO_CNTL_GET(x) (((x) & POWER_REG_WLAN_ISO_CNTL_MASK) >> POWER_REG_WLAN_ISO_CNTL_LSB) -#define POWER_REG_WLAN_ISO_CNTL_SET(x) (((x) << POWER_REG_WLAN_ISO_CNTL_LSB) & POWER_REG_WLAN_ISO_CNTL_MASK) -#define POWER_REG_RADIO_PWD_EN_MSB 4 -#define POWER_REG_RADIO_PWD_EN_LSB 4 -#define POWER_REG_RADIO_PWD_EN_MASK 0x00000010 -#define POWER_REG_RADIO_PWD_EN_GET(x) (((x) & POWER_REG_RADIO_PWD_EN_MASK) >> POWER_REG_RADIO_PWD_EN_LSB) -#define POWER_REG_RADIO_PWD_EN_SET(x) (((x) << POWER_REG_RADIO_PWD_EN_LSB) & POWER_REG_RADIO_PWD_EN_MASK) -#define POWER_REG_SOC_SCALE_EN_MSB 3 -#define POWER_REG_SOC_SCALE_EN_LSB 3 -#define POWER_REG_SOC_SCALE_EN_MASK 0x00000008 -#define POWER_REG_SOC_SCALE_EN_GET(x) (((x) & POWER_REG_SOC_SCALE_EN_MASK) >> POWER_REG_SOC_SCALE_EN_LSB) -#define POWER_REG_SOC_SCALE_EN_SET(x) (((x) << POWER_REG_SOC_SCALE_EN_LSB) & POWER_REG_SOC_SCALE_EN_MASK) -#define POWER_REG_WLAN_SCALE_EN_MSB 2 -#define POWER_REG_WLAN_SCALE_EN_LSB 2 -#define POWER_REG_WLAN_SCALE_EN_MASK 0x00000004 -#define POWER_REG_WLAN_SCALE_EN_GET(x) (((x) & POWER_REG_WLAN_SCALE_EN_MASK) >> POWER_REG_WLAN_SCALE_EN_LSB) -#define POWER_REG_WLAN_SCALE_EN_SET(x) (((x) << POWER_REG_WLAN_SCALE_EN_LSB) & POWER_REG_WLAN_SCALE_EN_MASK) -#define POWER_REG_WLAN_PWD_EN_MSB 1 -#define POWER_REG_WLAN_PWD_EN_LSB 1 -#define POWER_REG_WLAN_PWD_EN_MASK 0x00000002 -#define POWER_REG_WLAN_PWD_EN_GET(x) (((x) & POWER_REG_WLAN_PWD_EN_MASK) >> POWER_REG_WLAN_PWD_EN_LSB) -#define POWER_REG_WLAN_PWD_EN_SET(x) (((x) << POWER_REG_WLAN_PWD_EN_LSB) & POWER_REG_WLAN_PWD_EN_MASK) -#define POWER_REG_POWER_EN_MSB 0 -#define POWER_REG_POWER_EN_LSB 0 -#define POWER_REG_POWER_EN_MASK 0x00000001 -#define POWER_REG_POWER_EN_GET(x) (((x) & POWER_REG_POWER_EN_MASK) >> POWER_REG_POWER_EN_LSB) -#define POWER_REG_POWER_EN_SET(x) (((x) << POWER_REG_POWER_EN_LSB) & POWER_REG_POWER_EN_MASK) - -#define CORE_CLK_CTRL_ADDRESS 0x00000114 -#define CORE_CLK_CTRL_OFFSET 0x00000114 -#define CORE_CLK_CTRL_DIV_MSB 2 -#define CORE_CLK_CTRL_DIV_LSB 0 -#define CORE_CLK_CTRL_DIV_MASK 0x00000007 -#define CORE_CLK_CTRL_DIV_GET(x) (((x) & CORE_CLK_CTRL_DIV_MASK) >> CORE_CLK_CTRL_DIV_LSB) -#define CORE_CLK_CTRL_DIV_SET(x) (((x) << CORE_CLK_CTRL_DIV_LSB) & CORE_CLK_CTRL_DIV_MASK) - -#define SDIO_SETUP_CIRCUIT_ADDRESS 0x00000120 -#define SDIO_SETUP_CIRCUIT_OFFSET 0x00000120 -#define SDIO_SETUP_CIRCUIT_VECTOR_MSB 7 -#define SDIO_SETUP_CIRCUIT_VECTOR_LSB 0 -#define SDIO_SETUP_CIRCUIT_VECTOR_MASK 0x000000ff -#define SDIO_SETUP_CIRCUIT_VECTOR_GET(x) (((x) & SDIO_SETUP_CIRCUIT_VECTOR_MASK) >> SDIO_SETUP_CIRCUIT_VECTOR_LSB) -#define SDIO_SETUP_CIRCUIT_VECTOR_SET(x) (((x) << SDIO_SETUP_CIRCUIT_VECTOR_LSB) & SDIO_SETUP_CIRCUIT_VECTOR_MASK) - -#define SDIO_SETUP_CONFIG_ADDRESS 0x00000140 -#define SDIO_SETUP_CONFIG_OFFSET 0x00000140 -#define SDIO_SETUP_CONFIG_ENABLE_MSB 1 -#define SDIO_SETUP_CONFIG_ENABLE_LSB 1 -#define SDIO_SETUP_CONFIG_ENABLE_MASK 0x00000002 -#define SDIO_SETUP_CONFIG_ENABLE_GET(x) (((x) & SDIO_SETUP_CONFIG_ENABLE_MASK) >> SDIO_SETUP_CONFIG_ENABLE_LSB) -#define SDIO_SETUP_CONFIG_ENABLE_SET(x) (((x) << SDIO_SETUP_CONFIG_ENABLE_LSB) & SDIO_SETUP_CONFIG_ENABLE_MASK) -#define SDIO_SETUP_CONFIG_CLEAR_MSB 0 -#define SDIO_SETUP_CONFIG_CLEAR_LSB 0 -#define SDIO_SETUP_CONFIG_CLEAR_MASK 0x00000001 -#define SDIO_SETUP_CONFIG_CLEAR_GET(x) (((x) & SDIO_SETUP_CONFIG_CLEAR_MASK) >> SDIO_SETUP_CONFIG_CLEAR_LSB) -#define SDIO_SETUP_CONFIG_CLEAR_SET(x) (((x) << SDIO_SETUP_CONFIG_CLEAR_LSB) & SDIO_SETUP_CONFIG_CLEAR_MASK) - -#define CPU_SETUP_CONFIG_ADDRESS 0x00000144 -#define CPU_SETUP_CONFIG_OFFSET 0x00000144 -#define CPU_SETUP_CONFIG_ENABLE_MSB 1 -#define CPU_SETUP_CONFIG_ENABLE_LSB 1 -#define CPU_SETUP_CONFIG_ENABLE_MASK 0x00000002 -#define CPU_SETUP_CONFIG_ENABLE_GET(x) (((x) & CPU_SETUP_CONFIG_ENABLE_MASK) >> CPU_SETUP_CONFIG_ENABLE_LSB) -#define CPU_SETUP_CONFIG_ENABLE_SET(x) (((x) << CPU_SETUP_CONFIG_ENABLE_LSB) & CPU_SETUP_CONFIG_ENABLE_MASK) -#define CPU_SETUP_CONFIG_CLEAR_MSB 0 -#define CPU_SETUP_CONFIG_CLEAR_LSB 0 -#define CPU_SETUP_CONFIG_CLEAR_MASK 0x00000001 -#define CPU_SETUP_CONFIG_CLEAR_GET(x) (((x) & CPU_SETUP_CONFIG_CLEAR_MASK) >> CPU_SETUP_CONFIG_CLEAR_LSB) -#define CPU_SETUP_CONFIG_CLEAR_SET(x) (((x) << CPU_SETUP_CONFIG_CLEAR_LSB) & CPU_SETUP_CONFIG_CLEAR_MASK) - -#define CPU_SETUP_CIRCUIT_ADDRESS 0x00000160 -#define CPU_SETUP_CIRCUIT_OFFSET 0x00000160 -#define CPU_SETUP_CIRCUIT_VECTOR_MSB 7 -#define CPU_SETUP_CIRCUIT_VECTOR_LSB 0 -#define CPU_SETUP_CIRCUIT_VECTOR_MASK 0x000000ff -#define CPU_SETUP_CIRCUIT_VECTOR_GET(x) (((x) & CPU_SETUP_CIRCUIT_VECTOR_MASK) >> CPU_SETUP_CIRCUIT_VECTOR_LSB) -#define CPU_SETUP_CIRCUIT_VECTOR_SET(x) (((x) << CPU_SETUP_CIRCUIT_VECTOR_LSB) & CPU_SETUP_CIRCUIT_VECTOR_MASK) - -#define BB_SETUP_CONFIG_ADDRESS 0x00000180 -#define BB_SETUP_CONFIG_OFFSET 0x00000180 -#define BB_SETUP_CONFIG_ENABLE_MSB 1 -#define BB_SETUP_CONFIG_ENABLE_LSB 1 -#define BB_SETUP_CONFIG_ENABLE_MASK 0x00000002 -#define BB_SETUP_CONFIG_ENABLE_GET(x) (((x) & BB_SETUP_CONFIG_ENABLE_MASK) >> BB_SETUP_CONFIG_ENABLE_LSB) -#define BB_SETUP_CONFIG_ENABLE_SET(x) (((x) << BB_SETUP_CONFIG_ENABLE_LSB) & BB_SETUP_CONFIG_ENABLE_MASK) -#define BB_SETUP_CONFIG_CLEAR_MSB 0 -#define BB_SETUP_CONFIG_CLEAR_LSB 0 -#define BB_SETUP_CONFIG_CLEAR_MASK 0x00000001 -#define BB_SETUP_CONFIG_CLEAR_GET(x) (((x) & BB_SETUP_CONFIG_CLEAR_MASK) >> BB_SETUP_CONFIG_CLEAR_LSB) -#define BB_SETUP_CONFIG_CLEAR_SET(x) (((x) << BB_SETUP_CONFIG_CLEAR_LSB) & BB_SETUP_CONFIG_CLEAR_MASK) - -#define BB_SETUP_CIRCUIT_ADDRESS 0x000001a0 -#define BB_SETUP_CIRCUIT_OFFSET 0x000001a0 -#define BB_SETUP_CIRCUIT_VECTOR_MSB 7 -#define BB_SETUP_CIRCUIT_VECTOR_LSB 0 -#define BB_SETUP_CIRCUIT_VECTOR_MASK 0x000000ff -#define BB_SETUP_CIRCUIT_VECTOR_GET(x) (((x) & BB_SETUP_CIRCUIT_VECTOR_MASK) >> BB_SETUP_CIRCUIT_VECTOR_LSB) -#define BB_SETUP_CIRCUIT_VECTOR_SET(x) (((x) << BB_SETUP_CIRCUIT_VECTOR_LSB) & BB_SETUP_CIRCUIT_VECTOR_MASK) - -#define GPIO_WAKEUP_CONTROL_ADDRESS 0x000001c0 -#define GPIO_WAKEUP_CONTROL_OFFSET 0x000001c0 -#define GPIO_WAKEUP_CONTROL_ENABLE_MSB 0 -#define GPIO_WAKEUP_CONTROL_ENABLE_LSB 0 -#define GPIO_WAKEUP_CONTROL_ENABLE_MASK 0x00000001 -#define GPIO_WAKEUP_CONTROL_ENABLE_GET(x) (((x) & GPIO_WAKEUP_CONTROL_ENABLE_MASK) >> GPIO_WAKEUP_CONTROL_ENABLE_LSB) -#define GPIO_WAKEUP_CONTROL_ENABLE_SET(x) (((x) << GPIO_WAKEUP_CONTROL_ENABLE_LSB) & GPIO_WAKEUP_CONTROL_ENABLE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct rtc_reg_reg_s { - volatile unsigned int reset_control; - volatile unsigned int xtal_control; - volatile unsigned int tcxo_detect; - volatile unsigned int xtal_test; - volatile unsigned int quadrature; - volatile unsigned int pll_control; - volatile unsigned int pll_settle; - volatile unsigned int xtal_settle; - volatile unsigned int cpu_clock; - volatile unsigned int clock_out; - volatile unsigned int clock_control; - volatile unsigned int bias_override; - volatile unsigned int wdt_control; - volatile unsigned int wdt_status; - volatile unsigned int wdt; - volatile unsigned int wdt_count; - volatile unsigned int wdt_reset; - volatile unsigned int int_status; - volatile unsigned int lf_timer0; - volatile unsigned int lf_timer_count0; - volatile unsigned int lf_timer_control0; - volatile unsigned int lf_timer_status0; - volatile unsigned int lf_timer1; - volatile unsigned int lf_timer_count1; - volatile unsigned int lf_timer_control1; - volatile unsigned int lf_timer_status1; - volatile unsigned int lf_timer2; - volatile unsigned int lf_timer_count2; - volatile unsigned int lf_timer_control2; - volatile unsigned int lf_timer_status2; - volatile unsigned int lf_timer3; - volatile unsigned int lf_timer_count3; - volatile unsigned int lf_timer_control3; - volatile unsigned int lf_timer_status3; - volatile unsigned int hf_timer; - volatile unsigned int hf_timer_count; - volatile unsigned int hf_lf_count; - volatile unsigned int hf_timer_control; - volatile unsigned int hf_timer_status; - volatile unsigned int rtc_control; - volatile unsigned int rtc_time; - volatile unsigned int rtc_date; - volatile unsigned int rtc_set_time; - volatile unsigned int rtc_set_date; - volatile unsigned int rtc_set_alarm; - volatile unsigned int rtc_config; - volatile unsigned int rtc_alarm_status; - volatile unsigned int uart_wakeup; - volatile unsigned int reset_cause; - volatile unsigned int system_sleep; - volatile unsigned int sdio_wrapper; - volatile unsigned int mac_sleep_control; - volatile unsigned int keep_awake; - volatile unsigned int lpo_cal_time; - volatile unsigned int lpo_init_dividend_int; - volatile unsigned int lpo_init_dividend_fraction; - volatile unsigned int lpo_cal; - volatile unsigned int lpo_cal_test_control; - volatile unsigned int lpo_cal_test_status; - volatile unsigned int chip_id; - volatile unsigned int derived_rtc_clk; - volatile unsigned int mac_pcu_slp32_mode; - volatile unsigned int mac_pcu_slp32_wake; - volatile unsigned int mac_pcu_slp32_inc; - volatile unsigned int mac_pcu_slp_mib1; - volatile unsigned int mac_pcu_slp_mib2; - volatile unsigned int mac_pcu_slp_mib3; - volatile unsigned int mac_pcu_slp_beacon; - volatile unsigned int power_reg; - volatile unsigned int core_clk_ctrl; - unsigned char pad0[8]; /* pad to 0x120 */ - volatile unsigned int sdio_setup_circuit[8]; - volatile unsigned int sdio_setup_config; - volatile unsigned int cpu_setup_config; - unsigned char pad1[24]; /* pad to 0x160 */ - volatile unsigned int cpu_setup_circuit[8]; - volatile unsigned int bb_setup_config; - unsigned char pad2[28]; /* pad to 0x1a0 */ - volatile unsigned int bb_setup_circuit[8]; - volatile unsigned int gpio_wakeup_control; -} rtc_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _RTC_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/rtc_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/rtc_reg.vrh deleted file mode 100644 index a95f3422d38b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/rtc_reg.vrh +++ /dev/null @@ -1,1758 +0,0 @@ -#ifndef _RTC_REG_VRH_ -#define _RTC_REG_VRH_ - -#define RESET_CONTROL_ADDRESS 'h00000000 -#define RESET_CONTROL_CPU_INIT_RESET_MSB 11 -#define RESET_CONTROL_CPU_INIT_RESET_LSB 11 -#define RESET_CONTROL_CPU_INIT_RESET_MASK 'h00000800 -#define RESET_CONTROL_CPU_INIT_RESET_GET(x) (((x) & RESET_CONTROL_CPU_INIT_RESET_MASK) >> RESET_CONTROL_CPU_INIT_RESET_LSB) -#define RESET_CONTROL_CPU_INIT_RESET_SET(x) (((32'd0 | (x)) << RESET_CONTROL_CPU_INIT_RESET_LSB) & RESET_CONTROL_CPU_INIT_RESET_MASK) -#define RESET_CONTROL_CPU_INIT_RESET_RESET 1'h1 -#define RESET_CONTROL_VMC_REMAP_RESET_MSB 10 -#define RESET_CONTROL_VMC_REMAP_RESET_LSB 10 -#define RESET_CONTROL_VMC_REMAP_RESET_MASK 'h00000400 -#define RESET_CONTROL_VMC_REMAP_RESET_GET(x) (((x) & RESET_CONTROL_VMC_REMAP_RESET_MASK) >> RESET_CONTROL_VMC_REMAP_RESET_LSB) -#define RESET_CONTROL_VMC_REMAP_RESET_SET(x) (((32'd0 | (x)) << RESET_CONTROL_VMC_REMAP_RESET_LSB) & RESET_CONTROL_VMC_REMAP_RESET_MASK) -#define RESET_CONTROL_VMC_REMAP_RESET_RESET 1'h0 -#define RESET_CONTROL_RST_OUT_MSB 9 -#define RESET_CONTROL_RST_OUT_LSB 9 -#define RESET_CONTROL_RST_OUT_MASK 'h00000200 -#define RESET_CONTROL_RST_OUT_GET(x) (((x) & RESET_CONTROL_RST_OUT_MASK) >> RESET_CONTROL_RST_OUT_LSB) -#define RESET_CONTROL_RST_OUT_SET(x) (((32'd0 | (x)) << RESET_CONTROL_RST_OUT_LSB) & RESET_CONTROL_RST_OUT_MASK) -#define RESET_CONTROL_RST_OUT_RESET 1'h0 -#define RESET_CONTROL_COLD_RST_MSB 8 -#define RESET_CONTROL_COLD_RST_LSB 8 -#define RESET_CONTROL_COLD_RST_MASK 'h00000100 -#define RESET_CONTROL_COLD_RST_GET(x) (((x) & RESET_CONTROL_COLD_RST_MASK) >> RESET_CONTROL_COLD_RST_LSB) -#define RESET_CONTROL_COLD_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_COLD_RST_LSB) & RESET_CONTROL_COLD_RST_MASK) -#define RESET_CONTROL_COLD_RST_RESET 1'h0 -#define RESET_CONTROL_WARM_RST_MSB 7 -#define RESET_CONTROL_WARM_RST_LSB 7 -#define RESET_CONTROL_WARM_RST_MASK 'h00000080 -#define RESET_CONTROL_WARM_RST_GET(x) (((x) & RESET_CONTROL_WARM_RST_MASK) >> RESET_CONTROL_WARM_RST_LSB) -#define RESET_CONTROL_WARM_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_WARM_RST_LSB) & RESET_CONTROL_WARM_RST_MASK) -#define RESET_CONTROL_WARM_RST_RESET 1'h0 -#define RESET_CONTROL_CPU_WARM_RST_MSB 6 -#define RESET_CONTROL_CPU_WARM_RST_LSB 6 -#define RESET_CONTROL_CPU_WARM_RST_MASK 'h00000040 -#define RESET_CONTROL_CPU_WARM_RST_GET(x) (((x) & RESET_CONTROL_CPU_WARM_RST_MASK) >> RESET_CONTROL_CPU_WARM_RST_LSB) -#define RESET_CONTROL_CPU_WARM_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_CPU_WARM_RST_LSB) & RESET_CONTROL_CPU_WARM_RST_MASK) -#define RESET_CONTROL_CPU_WARM_RST_RESET 1'h0 -#define RESET_CONTROL_MAC_COLD_RST_MSB 5 -#define RESET_CONTROL_MAC_COLD_RST_LSB 5 -#define RESET_CONTROL_MAC_COLD_RST_MASK 'h00000020 -#define RESET_CONTROL_MAC_COLD_RST_GET(x) (((x) & RESET_CONTROL_MAC_COLD_RST_MASK) >> RESET_CONTROL_MAC_COLD_RST_LSB) -#define RESET_CONTROL_MAC_COLD_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_MAC_COLD_RST_LSB) & RESET_CONTROL_MAC_COLD_RST_MASK) -#define RESET_CONTROL_MAC_COLD_RST_RESET 1'h1 -#define RESET_CONTROL_MAC_WARM_RST_MSB 4 -#define RESET_CONTROL_MAC_WARM_RST_LSB 4 -#define RESET_CONTROL_MAC_WARM_RST_MASK 'h00000010 -#define RESET_CONTROL_MAC_WARM_RST_GET(x) (((x) & RESET_CONTROL_MAC_WARM_RST_MASK) >> RESET_CONTROL_MAC_WARM_RST_LSB) -#define RESET_CONTROL_MAC_WARM_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_MAC_WARM_RST_LSB) & RESET_CONTROL_MAC_WARM_RST_MASK) -#define RESET_CONTROL_MAC_WARM_RST_RESET 1'h1 -#define RESET_CONTROL_MBOX_RST_MSB 2 -#define RESET_CONTROL_MBOX_RST_LSB 2 -#define RESET_CONTROL_MBOX_RST_MASK 'h00000004 -#define RESET_CONTROL_MBOX_RST_GET(x) (((x) & RESET_CONTROL_MBOX_RST_MASK) >> RESET_CONTROL_MBOX_RST_LSB) -#define RESET_CONTROL_MBOX_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_MBOX_RST_LSB) & RESET_CONTROL_MBOX_RST_MASK) -#define RESET_CONTROL_MBOX_RST_RESET 1'h0 -#define RESET_CONTROL_UART_RST_MSB 1 -#define RESET_CONTROL_UART_RST_LSB 1 -#define RESET_CONTROL_UART_RST_MASK 'h00000002 -#define RESET_CONTROL_UART_RST_GET(x) (((x) & RESET_CONTROL_UART_RST_MASK) >> RESET_CONTROL_UART_RST_LSB) -#define RESET_CONTROL_UART_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_UART_RST_LSB) & RESET_CONTROL_UART_RST_MASK) -#define RESET_CONTROL_UART_RST_RESET 1'h0 -#define RESET_CONTROL_SI0_RST_MSB 0 -#define RESET_CONTROL_SI0_RST_LSB 0 -#define RESET_CONTROL_SI0_RST_MASK 'h00000001 -#define RESET_CONTROL_SI0_RST_GET(x) (((x) & RESET_CONTROL_SI0_RST_MASK) >> RESET_CONTROL_SI0_RST_LSB) -#define RESET_CONTROL_SI0_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_SI0_RST_LSB) & RESET_CONTROL_SI0_RST_MASK) -#define RESET_CONTROL_SI0_RST_RESET 1'h0 -#define RESET_CONTROL_RESET (32'h0 | \ - RESET_CONTROL_CPU_INIT_RESET_SET(RESET_CONTROL_CPU_INIT_RESET_RESET) | \ - RESET_CONTROL_VMC_REMAP_RESET_SET(RESET_CONTROL_VMC_REMAP_RESET_RESET) | \ - RESET_CONTROL_RST_OUT_SET(RESET_CONTROL_RST_OUT_RESET) | \ - RESET_CONTROL_COLD_RST_SET(RESET_CONTROL_COLD_RST_RESET) | \ - RESET_CONTROL_WARM_RST_SET(RESET_CONTROL_WARM_RST_RESET) | \ - RESET_CONTROL_CPU_WARM_RST_SET(RESET_CONTROL_CPU_WARM_RST_RESET) | \ - RESET_CONTROL_MAC_COLD_RST_SET(RESET_CONTROL_MAC_COLD_RST_RESET) | \ - RESET_CONTROL_MAC_WARM_RST_SET(RESET_CONTROL_MAC_WARM_RST_RESET) | \ - RESET_CONTROL_MBOX_RST_SET(RESET_CONTROL_MBOX_RST_RESET) | \ - RESET_CONTROL_UART_RST_SET(RESET_CONTROL_UART_RST_RESET) | \ - RESET_CONTROL_SI0_RST_SET(RESET_CONTROL_SI0_RST_RESET)) -#define RESET_CONTROL_HW_MASK (32'h0 | \ - RESET_CONTROL_WARM_RST_MASK | \ - RESET_CONTROL_CPU_WARM_RST_MASK | \ - RESET_CONTROL_MAC_COLD_RST_MASK | \ - RESET_CONTROL_MAC_WARM_RST_MASK) -#define RESET_CONTROL_SW_MASK (32'h0 | \ - RESET_CONTROL_CPU_INIT_RESET_MASK | \ - RESET_CONTROL_VMC_REMAP_RESET_MASK | \ - RESET_CONTROL_RST_OUT_MASK | \ - RESET_CONTROL_COLD_RST_MASK | \ - RESET_CONTROL_WARM_RST_MASK | \ - RESET_CONTROL_CPU_WARM_RST_MASK | \ - RESET_CONTROL_MAC_COLD_RST_MASK | \ - RESET_CONTROL_MAC_WARM_RST_MASK | \ - RESET_CONTROL_MBOX_RST_MASK | \ - RESET_CONTROL_UART_RST_MASK | \ - RESET_CONTROL_SI0_RST_MASK) - -#define XTAL_CONTROL_ADDRESS 'h00000004 -#define XTAL_CONTROL_TCXO_MSB 0 -#define XTAL_CONTROL_TCXO_LSB 0 -#define XTAL_CONTROL_TCXO_MASK 'h00000001 -#define XTAL_CONTROL_TCXO_GET(x) (((x) & XTAL_CONTROL_TCXO_MASK) >> XTAL_CONTROL_TCXO_LSB) -#define XTAL_CONTROL_TCXO_SET(x) (((32'd0 | (x)) << XTAL_CONTROL_TCXO_LSB) & XTAL_CONTROL_TCXO_MASK) -#define XTAL_CONTROL_TCXO_RESET 1'h0 -#define XTAL_CONTROL_RESET (32'h0 | \ - XTAL_CONTROL_TCXO_SET(XTAL_CONTROL_TCXO_RESET)) -#define XTAL_CONTROL_HW_MASK (32'h0) -#define XTAL_CONTROL_SW_MASK (32'h0 | \ - XTAL_CONTROL_TCXO_MASK) - -#define TCXO_DETECT_ADDRESS 'h00000008 -#define TCXO_DETECT_PRESENT_MSB 0 -#define TCXO_DETECT_PRESENT_LSB 0 -#define TCXO_DETECT_PRESENT_MASK 'h00000001 -#define TCXO_DETECT_PRESENT_GET(x) (((x) & TCXO_DETECT_PRESENT_MASK) >> TCXO_DETECT_PRESENT_LSB) -#define TCXO_DETECT_PRESENT_SET(x) (((32'd0 | (x)) << TCXO_DETECT_PRESENT_LSB) & TCXO_DETECT_PRESENT_MASK) -#define TCXO_DETECT_PRESENT_RESET 1'h0 -#define TCXO_DETECT_RESET (32'h0 | \ - TCXO_DETECT_PRESENT_SET(TCXO_DETECT_PRESENT_RESET)) -#define TCXO_DETECT_HW_MASK (32'h0 | \ - TCXO_DETECT_PRESENT_MASK) -#define TCXO_DETECT_SW_MASK (32'h0) - -#define XTAL_TEST_ADDRESS 'h0000000c -#define XTAL_TEST_NOTCXODET_MSB 0 -#define XTAL_TEST_NOTCXODET_LSB 0 -#define XTAL_TEST_NOTCXODET_MASK 'h00000001 -#define XTAL_TEST_NOTCXODET_GET(x) (((x) & XTAL_TEST_NOTCXODET_MASK) >> XTAL_TEST_NOTCXODET_LSB) -#define XTAL_TEST_NOTCXODET_SET(x) (((32'd0 | (x)) << XTAL_TEST_NOTCXODET_LSB) & XTAL_TEST_NOTCXODET_MASK) -#define XTAL_TEST_NOTCXODET_RESET 1'h0 -#define XTAL_TEST_RESET (32'h0 | \ - XTAL_TEST_NOTCXODET_SET(XTAL_TEST_NOTCXODET_RESET)) -#define XTAL_TEST_HW_MASK (32'h0) -#define XTAL_TEST_SW_MASK (32'h0 | \ - XTAL_TEST_NOTCXODET_MASK) - -#define QUADRATURE_ADDRESS 'h00000010 -#define QUADRATURE_ADC_MSB 5 -#define QUADRATURE_ADC_LSB 4 -#define QUADRATURE_ADC_MASK 'h00000030 -#define QUADRATURE_ADC_GET(x) (((x) & QUADRATURE_ADC_MASK) >> QUADRATURE_ADC_LSB) -#define QUADRATURE_ADC_SET(x) (((32'd0 | (x)) << QUADRATURE_ADC_LSB) & QUADRATURE_ADC_MASK) -#define QUADRATURE_ADC_RESET 2'h0 -#define QUADRATURE_SEL_MSB 2 -#define QUADRATURE_SEL_LSB 2 -#define QUADRATURE_SEL_MASK 'h00000004 -#define QUADRATURE_SEL_GET(x) (((x) & QUADRATURE_SEL_MASK) >> QUADRATURE_SEL_LSB) -#define QUADRATURE_SEL_SET(x) (((32'd0 | (x)) << QUADRATURE_SEL_LSB) & QUADRATURE_SEL_MASK) -#define QUADRATURE_SEL_RESET 1'h0 -#define QUADRATURE_DAC_MSB 1 -#define QUADRATURE_DAC_LSB 0 -#define QUADRATURE_DAC_MASK 'h00000003 -#define QUADRATURE_DAC_GET(x) (((x) & QUADRATURE_DAC_MASK) >> QUADRATURE_DAC_LSB) -#define QUADRATURE_DAC_SET(x) (((32'd0 | (x)) << QUADRATURE_DAC_LSB) & QUADRATURE_DAC_MASK) -#define QUADRATURE_DAC_RESET 2'h2 -#define QUADRATURE_RESET (32'h0 | \ - QUADRATURE_ADC_SET(QUADRATURE_ADC_RESET) | \ - QUADRATURE_SEL_SET(QUADRATURE_SEL_RESET) | \ - QUADRATURE_DAC_SET(QUADRATURE_DAC_RESET)) -#define QUADRATURE_HW_MASK (32'h0) -#define QUADRATURE_SW_MASK (32'h0 | \ - QUADRATURE_ADC_MASK | \ - QUADRATURE_SEL_MASK | \ - QUADRATURE_DAC_MASK) - -#define PLL_CONTROL_ADDRESS 'h00000014 -#define PLL_CONTROL_DIG_TEST_CLK_MSB 20 -#define PLL_CONTROL_DIG_TEST_CLK_LSB 20 -#define PLL_CONTROL_DIG_TEST_CLK_MASK 'h00100000 -#define PLL_CONTROL_DIG_TEST_CLK_GET(x) (((x) & PLL_CONTROL_DIG_TEST_CLK_MASK) >> PLL_CONTROL_DIG_TEST_CLK_LSB) -#define PLL_CONTROL_DIG_TEST_CLK_SET(x) (((32'd0 | (x)) << PLL_CONTROL_DIG_TEST_CLK_LSB) & PLL_CONTROL_DIG_TEST_CLK_MASK) -#define PLL_CONTROL_DIG_TEST_CLK_RESET 1'h0 -#define PLL_CONTROL_MAC_OVERRIDE_MSB 19 -#define PLL_CONTROL_MAC_OVERRIDE_LSB 19 -#define PLL_CONTROL_MAC_OVERRIDE_MASK 'h00080000 -#define PLL_CONTROL_MAC_OVERRIDE_GET(x) (((x) & PLL_CONTROL_MAC_OVERRIDE_MASK) >> PLL_CONTROL_MAC_OVERRIDE_LSB) -#define PLL_CONTROL_MAC_OVERRIDE_SET(x) (((32'd0 | (x)) << PLL_CONTROL_MAC_OVERRIDE_LSB) & PLL_CONTROL_MAC_OVERRIDE_MASK) -#define PLL_CONTROL_MAC_OVERRIDE_RESET 1'h0 -#define PLL_CONTROL_NOPWD_MSB 18 -#define PLL_CONTROL_NOPWD_LSB 18 -#define PLL_CONTROL_NOPWD_MASK 'h00040000 -#define PLL_CONTROL_NOPWD_GET(x) (((x) & PLL_CONTROL_NOPWD_MASK) >> PLL_CONTROL_NOPWD_LSB) -#define PLL_CONTROL_NOPWD_SET(x) (((32'd0 | (x)) << PLL_CONTROL_NOPWD_LSB) & PLL_CONTROL_NOPWD_MASK) -#define PLL_CONTROL_NOPWD_RESET 1'h0 -#define PLL_CONTROL_UPDATING_MSB 17 -#define PLL_CONTROL_UPDATING_LSB 17 -#define PLL_CONTROL_UPDATING_MASK 'h00020000 -#define PLL_CONTROL_UPDATING_GET(x) (((x) & PLL_CONTROL_UPDATING_MASK) >> PLL_CONTROL_UPDATING_LSB) -#define PLL_CONTROL_UPDATING_SET(x) (((32'd0 | (x)) << PLL_CONTROL_UPDATING_LSB) & PLL_CONTROL_UPDATING_MASK) -#define PLL_CONTROL_UPDATING_RESET 1'h0 -#define PLL_CONTROL_BYPASS_MSB 16 -#define PLL_CONTROL_BYPASS_LSB 16 -#define PLL_CONTROL_BYPASS_MASK 'h00010000 -#define PLL_CONTROL_BYPASS_GET(x) (((x) & PLL_CONTROL_BYPASS_MASK) >> PLL_CONTROL_BYPASS_LSB) -#define PLL_CONTROL_BYPASS_SET(x) (((32'd0 | (x)) << PLL_CONTROL_BYPASS_LSB) & PLL_CONTROL_BYPASS_MASK) -#define PLL_CONTROL_BYPASS_RESET 1'h1 -#define PLL_CONTROL_REFDIV_MSB 15 -#define PLL_CONTROL_REFDIV_LSB 12 -#define PLL_CONTROL_REFDIV_MASK 'h0000f000 -#define PLL_CONTROL_REFDIV_GET(x) (((x) & PLL_CONTROL_REFDIV_MASK) >> PLL_CONTROL_REFDIV_LSB) -#define PLL_CONTROL_REFDIV_SET(x) (((32'd0 | (x)) << PLL_CONTROL_REFDIV_LSB) & PLL_CONTROL_REFDIV_MASK) -#define PLL_CONTROL_REFDIV_RESET 4'h5 -#define PLL_CONTROL_DIV_MSB 9 -#define PLL_CONTROL_DIV_LSB 0 -#define PLL_CONTROL_DIV_MASK 'h000003ff -#define PLL_CONTROL_DIV_GET(x) (((x) & PLL_CONTROL_DIV_MASK) >> PLL_CONTROL_DIV_LSB) -#define PLL_CONTROL_DIV_SET(x) (((32'd0 | (x)) << PLL_CONTROL_DIV_LSB) & PLL_CONTROL_DIV_MASK) -#define PLL_CONTROL_DIV_RESET 10'h28 -#define PLL_CONTROL_RESET (32'h0 | \ - PLL_CONTROL_DIG_TEST_CLK_SET(PLL_CONTROL_DIG_TEST_CLK_RESET) | \ - PLL_CONTROL_MAC_OVERRIDE_SET(PLL_CONTROL_MAC_OVERRIDE_RESET) | \ - PLL_CONTROL_NOPWD_SET(PLL_CONTROL_NOPWD_RESET) | \ - PLL_CONTROL_UPDATING_SET(PLL_CONTROL_UPDATING_RESET) | \ - PLL_CONTROL_BYPASS_SET(PLL_CONTROL_BYPASS_RESET) | \ - PLL_CONTROL_REFDIV_SET(PLL_CONTROL_REFDIV_RESET) | \ - PLL_CONTROL_DIV_SET(PLL_CONTROL_DIV_RESET)) -#define PLL_CONTROL_HW_MASK (32'h0 | \ - PLL_CONTROL_UPDATING_MASK) -#define PLL_CONTROL_SW_MASK (32'h0 | \ - PLL_CONTROL_DIG_TEST_CLK_MASK | \ - PLL_CONTROL_MAC_OVERRIDE_MASK | \ - PLL_CONTROL_NOPWD_MASK | \ - PLL_CONTROL_BYPASS_MASK | \ - PLL_CONTROL_REFDIV_MASK | \ - PLL_CONTROL_DIV_MASK) - -#define PLL_SETTLE_ADDRESS 'h00000018 -#define PLL_SETTLE_TIME_MSB 11 -#define PLL_SETTLE_TIME_LSB 0 -#define PLL_SETTLE_TIME_MASK 'h00000fff -#define PLL_SETTLE_TIME_GET(x) (((x) & PLL_SETTLE_TIME_MASK) >> PLL_SETTLE_TIME_LSB) -#define PLL_SETTLE_TIME_SET(x) (((32'd0 | (x)) << PLL_SETTLE_TIME_LSB) & PLL_SETTLE_TIME_MASK) -#define PLL_SETTLE_TIME_RESET 12'h400 -#define PLL_SETTLE_RESET (32'h0 | \ - PLL_SETTLE_TIME_SET(PLL_SETTLE_TIME_RESET)) -#define PLL_SETTLE_HW_MASK (32'h0) -#define PLL_SETTLE_SW_MASK (32'h0 | \ - PLL_SETTLE_TIME_MASK) - -#define XTAL_SETTLE_ADDRESS 'h0000001c -#define XTAL_SETTLE_TIME_MSB 7 -#define XTAL_SETTLE_TIME_LSB 0 -#define XTAL_SETTLE_TIME_MASK 'h000000ff -#define XTAL_SETTLE_TIME_GET(x) (((x) & XTAL_SETTLE_TIME_MASK) >> XTAL_SETTLE_TIME_LSB) -#define XTAL_SETTLE_TIME_SET(x) (((32'd0 | (x)) << XTAL_SETTLE_TIME_LSB) & XTAL_SETTLE_TIME_MASK) -#define XTAL_SETTLE_TIME_RESET 8'h7f -#define XTAL_SETTLE_RESET (32'h0 | \ - XTAL_SETTLE_TIME_SET(XTAL_SETTLE_TIME_RESET)) -#define XTAL_SETTLE_HW_MASK (32'h0 | \ - XTAL_SETTLE_TIME_MASK) -#define XTAL_SETTLE_SW_MASK (32'h0 | \ - XTAL_SETTLE_TIME_MASK) - -#define CPU_CLOCK_ADDRESS 'h00000020 -#define CPU_CLOCK_STANDARD_MSB 1 -#define CPU_CLOCK_STANDARD_LSB 0 -#define CPU_CLOCK_STANDARD_MASK 'h00000003 -#define CPU_CLOCK_STANDARD_GET(x) (((x) & CPU_CLOCK_STANDARD_MASK) >> CPU_CLOCK_STANDARD_LSB) -#define CPU_CLOCK_STANDARD_SET(x) (((32'd0 | (x)) << CPU_CLOCK_STANDARD_LSB) & CPU_CLOCK_STANDARD_MASK) -#define CPU_CLOCK_STANDARD_RESET 2'h3 -#define CPU_CLOCK_RESET (32'h0 | \ - CPU_CLOCK_STANDARD_SET(CPU_CLOCK_STANDARD_RESET)) -#define CPU_CLOCK_HW_MASK (32'h0) -#define CPU_CLOCK_SW_MASK (32'h0 | \ - CPU_CLOCK_STANDARD_MASK) - -#define CLOCK_OUT_ADDRESS 'h00000024 -#define CLOCK_OUT_SELECT_MSB 3 -#define CLOCK_OUT_SELECT_LSB 0 -#define CLOCK_OUT_SELECT_MASK 'h0000000f -#define CLOCK_OUT_SELECT_GET(x) (((x) & CLOCK_OUT_SELECT_MASK) >> CLOCK_OUT_SELECT_LSB) -#define CLOCK_OUT_SELECT_SET(x) (((32'd0 | (x)) << CLOCK_OUT_SELECT_LSB) & CLOCK_OUT_SELECT_MASK) -#define CLOCK_OUT_SELECT_RESET 4'hf -#define CLOCK_OUT_RESET (32'h0 | \ - CLOCK_OUT_SELECT_SET(CLOCK_OUT_SELECT_RESET)) -#define CLOCK_OUT_HW_MASK (32'h0) -#define CLOCK_OUT_SW_MASK (32'h0 | \ - CLOCK_OUT_SELECT_MASK) - -#define CLOCK_CONTROL_ADDRESS 'h00000028 -#define CLOCK_CONTROL_LF_CLK32_MSB 2 -#define CLOCK_CONTROL_LF_CLK32_LSB 2 -#define CLOCK_CONTROL_LF_CLK32_MASK 'h00000004 -#define CLOCK_CONTROL_LF_CLK32_GET(x) (((x) & CLOCK_CONTROL_LF_CLK32_MASK) >> CLOCK_CONTROL_LF_CLK32_LSB) -#define CLOCK_CONTROL_LF_CLK32_SET(x) (((32'd0 | (x)) << CLOCK_CONTROL_LF_CLK32_LSB) & CLOCK_CONTROL_LF_CLK32_MASK) -#define CLOCK_CONTROL_LF_CLK32_RESET 1'h0 -#define CLOCK_CONTROL_UART_CLK_MSB 1 -#define CLOCK_CONTROL_UART_CLK_LSB 1 -#define CLOCK_CONTROL_UART_CLK_MASK 'h00000002 -#define CLOCK_CONTROL_UART_CLK_GET(x) (((x) & CLOCK_CONTROL_UART_CLK_MASK) >> CLOCK_CONTROL_UART_CLK_LSB) -#define CLOCK_CONTROL_UART_CLK_SET(x) (((32'd0 | (x)) << CLOCK_CONTROL_UART_CLK_LSB) & CLOCK_CONTROL_UART_CLK_MASK) -#define CLOCK_CONTROL_UART_CLK_RESET 1'h0 -#define CLOCK_CONTROL_SI0_CLK_MSB 0 -#define CLOCK_CONTROL_SI0_CLK_LSB 0 -#define CLOCK_CONTROL_SI0_CLK_MASK 'h00000001 -#define CLOCK_CONTROL_SI0_CLK_GET(x) (((x) & CLOCK_CONTROL_SI0_CLK_MASK) >> CLOCK_CONTROL_SI0_CLK_LSB) -#define CLOCK_CONTROL_SI0_CLK_SET(x) (((32'd0 | (x)) << CLOCK_CONTROL_SI0_CLK_LSB) & CLOCK_CONTROL_SI0_CLK_MASK) -#define CLOCK_CONTROL_SI0_CLK_RESET 1'h1 -#define CLOCK_CONTROL_RESET (32'h0 | \ - CLOCK_CONTROL_LF_CLK32_SET(CLOCK_CONTROL_LF_CLK32_RESET) | \ - CLOCK_CONTROL_UART_CLK_SET(CLOCK_CONTROL_UART_CLK_RESET) | \ - CLOCK_CONTROL_SI0_CLK_SET(CLOCK_CONTROL_SI0_CLK_RESET)) -#define CLOCK_CONTROL_HW_MASK (32'h0) -#define CLOCK_CONTROL_SW_MASK (32'h0 | \ - CLOCK_CONTROL_LF_CLK32_MASK | \ - CLOCK_CONTROL_UART_CLK_MASK | \ - CLOCK_CONTROL_SI0_CLK_MASK) - -#define BIAS_OVERRIDE_ADDRESS 'h0000002c -#define BIAS_OVERRIDE_ON_MSB 0 -#define BIAS_OVERRIDE_ON_LSB 0 -#define BIAS_OVERRIDE_ON_MASK 'h00000001 -#define BIAS_OVERRIDE_ON_GET(x) (((x) & BIAS_OVERRIDE_ON_MASK) >> BIAS_OVERRIDE_ON_LSB) -#define BIAS_OVERRIDE_ON_SET(x) (((32'd0 | (x)) << BIAS_OVERRIDE_ON_LSB) & BIAS_OVERRIDE_ON_MASK) -#define BIAS_OVERRIDE_ON_RESET 1'h0 -#define BIAS_OVERRIDE_RESET (32'h0 | \ - BIAS_OVERRIDE_ON_SET(BIAS_OVERRIDE_ON_RESET)) -#define BIAS_OVERRIDE_HW_MASK (32'h0) -#define BIAS_OVERRIDE_SW_MASK (32'h0 | \ - BIAS_OVERRIDE_ON_MASK) - -#define WDT_CONTROL_ADDRESS 'h00000030 -#define WDT_CONTROL_ACTION_MSB 2 -#define WDT_CONTROL_ACTION_LSB 0 -#define WDT_CONTROL_ACTION_MASK 'h00000007 -#define WDT_CONTROL_ACTION_GET(x) (((x) & WDT_CONTROL_ACTION_MASK) >> WDT_CONTROL_ACTION_LSB) -#define WDT_CONTROL_ACTION_SET(x) (((32'd0 | (x)) << WDT_CONTROL_ACTION_LSB) & WDT_CONTROL_ACTION_MASK) -#define WDT_CONTROL_ACTION_RESET 3'h2 -#define WDT_CONTROL_RESET (32'h0 | \ - WDT_CONTROL_ACTION_SET(WDT_CONTROL_ACTION_RESET)) -#define WDT_CONTROL_HW_MASK (32'h0) -#define WDT_CONTROL_SW_MASK (32'h0 | \ - WDT_CONTROL_ACTION_MASK) - -#define WDT_STATUS_ADDRESS 'h00000034 -#define WDT_STATUS_INTERRUPT_MSB 0 -#define WDT_STATUS_INTERRUPT_LSB 0 -#define WDT_STATUS_INTERRUPT_MASK 'h00000001 -#define WDT_STATUS_INTERRUPT_GET(x) (((x) & WDT_STATUS_INTERRUPT_MASK) >> WDT_STATUS_INTERRUPT_LSB) -#define WDT_STATUS_INTERRUPT_SET(x) (((32'd0 | (x)) << WDT_STATUS_INTERRUPT_LSB) & WDT_STATUS_INTERRUPT_MASK) -#define WDT_STATUS_INTERRUPT_RESET 1'h0 -#define WDT_STATUS_RESET (32'h0 | \ - WDT_STATUS_INTERRUPT_SET(WDT_STATUS_INTERRUPT_RESET)) -#define WDT_STATUS_HW_MASK (32'h0 | \ - WDT_STATUS_INTERRUPT_MASK) -#define WDT_STATUS_SW_MASK (32'h0 | \ - WDT_STATUS_INTERRUPT_MASK) - -#define WDT_ADDRESS 'h00000038 -#define WDT_TARGET_MSB 21 -#define WDT_TARGET_LSB 0 -#define WDT_TARGET_MASK 'h003fffff -#define WDT_TARGET_GET(x) (((x) & WDT_TARGET_MASK) >> WDT_TARGET_LSB) -#define WDT_TARGET_SET(x) (((32'd0 | (x)) << WDT_TARGET_LSB) & WDT_TARGET_MASK) -#define WDT_TARGET_RESET 22'h3fffff -#define WDT_RESET (32'h0 | \ - WDT_TARGET_SET(WDT_TARGET_RESET)) -#define WDT_HW_MASK (32'h0) -#define WDT_SW_MASK (32'h0 | \ - WDT_TARGET_MASK) - -#define WDT_COUNT_ADDRESS 'h0000003c -#define WDT_COUNT_VALUE_MSB 21 -#define WDT_COUNT_VALUE_LSB 0 -#define WDT_COUNT_VALUE_MASK 'h003fffff -#define WDT_COUNT_VALUE_GET(x) (((x) & WDT_COUNT_VALUE_MASK) >> WDT_COUNT_VALUE_LSB) -#define WDT_COUNT_VALUE_SET(x) (((32'd0 | (x)) << WDT_COUNT_VALUE_LSB) & WDT_COUNT_VALUE_MASK) -#define WDT_COUNT_VALUE_RESET 22'h0 -#define WDT_COUNT_RESET (32'h0 | \ - WDT_COUNT_VALUE_SET(WDT_COUNT_VALUE_RESET)) -#define WDT_COUNT_HW_MASK (32'h0 | \ - WDT_COUNT_VALUE_MASK) -#define WDT_COUNT_SW_MASK (32'h0) - -#define WDT_RESET_ADDRESS 'h00000040 -#define WDT_RESET_VALUE_MSB 0 -#define WDT_RESET_VALUE_LSB 0 -#define WDT_RESET_VALUE_MASK 'h00000001 -#define WDT_RESET_VALUE_GET(x) (((x) & WDT_RESET_VALUE_MASK) >> WDT_RESET_VALUE_LSB) -#define WDT_RESET_VALUE_SET(x) (((32'd0 | (x)) << WDT_RESET_VALUE_LSB) & WDT_RESET_VALUE_MASK) -#define WDT_RESET_VALUE_RESET 1'h0 -#define WDT_RESET_RESET (32'h0 | \ - WDT_RESET_VALUE_SET(WDT_RESET_VALUE_RESET)) -#define WDT_RESET_HW_MASK (32'h0 | \ - WDT_RESET_VALUE_MASK) -#define WDT_RESET_SW_MASK (32'h0 | \ - WDT_RESET_VALUE_MASK) - -#define INT_STATUS_ADDRESS 'h00000044 -#define INT_STATUS_RTC_POWER_MSB 14 -#define INT_STATUS_RTC_POWER_LSB 14 -#define INT_STATUS_RTC_POWER_MASK 'h00004000 -#define INT_STATUS_RTC_POWER_GET(x) (((x) & INT_STATUS_RTC_POWER_MASK) >> INT_STATUS_RTC_POWER_LSB) -#define INT_STATUS_RTC_POWER_SET(x) (((32'd0 | (x)) << INT_STATUS_RTC_POWER_LSB) & INT_STATUS_RTC_POWER_MASK) -#define INT_STATUS_RTC_POWER_RESET 1'h0 -#define INT_STATUS_MAC_MSB 13 -#define INT_STATUS_MAC_LSB 13 -#define INT_STATUS_MAC_MASK 'h00002000 -#define INT_STATUS_MAC_GET(x) (((x) & INT_STATUS_MAC_MASK) >> INT_STATUS_MAC_LSB) -#define INT_STATUS_MAC_SET(x) (((32'd0 | (x)) << INT_STATUS_MAC_LSB) & INT_STATUS_MAC_MASK) -#define INT_STATUS_MAC_RESET 1'h0 -#define INT_STATUS_MAILBOX_MSB 12 -#define INT_STATUS_MAILBOX_LSB 12 -#define INT_STATUS_MAILBOX_MASK 'h00001000 -#define INT_STATUS_MAILBOX_GET(x) (((x) & INT_STATUS_MAILBOX_MASK) >> INT_STATUS_MAILBOX_LSB) -#define INT_STATUS_MAILBOX_SET(x) (((32'd0 | (x)) << INT_STATUS_MAILBOX_LSB) & INT_STATUS_MAILBOX_MASK) -#define INT_STATUS_MAILBOX_RESET 1'h0 -#define INT_STATUS_RTC_ALARM_MSB 11 -#define INT_STATUS_RTC_ALARM_LSB 11 -#define INT_STATUS_RTC_ALARM_MASK 'h00000800 -#define INT_STATUS_RTC_ALARM_GET(x) (((x) & INT_STATUS_RTC_ALARM_MASK) >> INT_STATUS_RTC_ALARM_LSB) -#define INT_STATUS_RTC_ALARM_SET(x) (((32'd0 | (x)) << INT_STATUS_RTC_ALARM_LSB) & INT_STATUS_RTC_ALARM_MASK) -#define INT_STATUS_RTC_ALARM_RESET 1'h0 -#define INT_STATUS_HF_TIMER_MSB 10 -#define INT_STATUS_HF_TIMER_LSB 10 -#define INT_STATUS_HF_TIMER_MASK 'h00000400 -#define INT_STATUS_HF_TIMER_GET(x) (((x) & INT_STATUS_HF_TIMER_MASK) >> INT_STATUS_HF_TIMER_LSB) -#define INT_STATUS_HF_TIMER_SET(x) (((32'd0 | (x)) << INT_STATUS_HF_TIMER_LSB) & INT_STATUS_HF_TIMER_MASK) -#define INT_STATUS_HF_TIMER_RESET 1'h0 -#define INT_STATUS_LF_TIMER3_MSB 9 -#define INT_STATUS_LF_TIMER3_LSB 9 -#define INT_STATUS_LF_TIMER3_MASK 'h00000200 -#define INT_STATUS_LF_TIMER3_GET(x) (((x) & INT_STATUS_LF_TIMER3_MASK) >> INT_STATUS_LF_TIMER3_LSB) -#define INT_STATUS_LF_TIMER3_SET(x) (((32'd0 | (x)) << INT_STATUS_LF_TIMER3_LSB) & INT_STATUS_LF_TIMER3_MASK) -#define INT_STATUS_LF_TIMER3_RESET 1'h0 -#define INT_STATUS_LF_TIMER2_MSB 8 -#define INT_STATUS_LF_TIMER2_LSB 8 -#define INT_STATUS_LF_TIMER2_MASK 'h00000100 -#define INT_STATUS_LF_TIMER2_GET(x) (((x) & INT_STATUS_LF_TIMER2_MASK) >> INT_STATUS_LF_TIMER2_LSB) -#define INT_STATUS_LF_TIMER2_SET(x) (((32'd0 | (x)) << INT_STATUS_LF_TIMER2_LSB) & INT_STATUS_LF_TIMER2_MASK) -#define INT_STATUS_LF_TIMER2_RESET 1'h0 -#define INT_STATUS_LF_TIMER1_MSB 7 -#define INT_STATUS_LF_TIMER1_LSB 7 -#define INT_STATUS_LF_TIMER1_MASK 'h00000080 -#define INT_STATUS_LF_TIMER1_GET(x) (((x) & INT_STATUS_LF_TIMER1_MASK) >> INT_STATUS_LF_TIMER1_LSB) -#define INT_STATUS_LF_TIMER1_SET(x) (((32'd0 | (x)) << INT_STATUS_LF_TIMER1_LSB) & INT_STATUS_LF_TIMER1_MASK) -#define INT_STATUS_LF_TIMER1_RESET 1'h0 -#define INT_STATUS_LF_TIMER0_MSB 6 -#define INT_STATUS_LF_TIMER0_LSB 6 -#define INT_STATUS_LF_TIMER0_MASK 'h00000040 -#define INT_STATUS_LF_TIMER0_GET(x) (((x) & INT_STATUS_LF_TIMER0_MASK) >> INT_STATUS_LF_TIMER0_LSB) -#define INT_STATUS_LF_TIMER0_SET(x) (((32'd0 | (x)) << INT_STATUS_LF_TIMER0_LSB) & INT_STATUS_LF_TIMER0_MASK) -#define INT_STATUS_LF_TIMER0_RESET 1'h0 -#define INT_STATUS_KEYPAD_MSB 5 -#define INT_STATUS_KEYPAD_LSB 5 -#define INT_STATUS_KEYPAD_MASK 'h00000020 -#define INT_STATUS_KEYPAD_GET(x) (((x) & INT_STATUS_KEYPAD_MASK) >> INT_STATUS_KEYPAD_LSB) -#define INT_STATUS_KEYPAD_SET(x) (((32'd0 | (x)) << INT_STATUS_KEYPAD_LSB) & INT_STATUS_KEYPAD_MASK) -#define INT_STATUS_KEYPAD_RESET 1'h0 -#define INT_STATUS_SI_MSB 4 -#define INT_STATUS_SI_LSB 4 -#define INT_STATUS_SI_MASK 'h00000010 -#define INT_STATUS_SI_GET(x) (((x) & INT_STATUS_SI_MASK) >> INT_STATUS_SI_LSB) -#define INT_STATUS_SI_SET(x) (((32'd0 | (x)) << INT_STATUS_SI_LSB) & INT_STATUS_SI_MASK) -#define INT_STATUS_SI_RESET 1'h0 -#define INT_STATUS_GPIO_MSB 3 -#define INT_STATUS_GPIO_LSB 3 -#define INT_STATUS_GPIO_MASK 'h00000008 -#define INT_STATUS_GPIO_GET(x) (((x) & INT_STATUS_GPIO_MASK) >> INT_STATUS_GPIO_LSB) -#define INT_STATUS_GPIO_SET(x) (((32'd0 | (x)) << INT_STATUS_GPIO_LSB) & INT_STATUS_GPIO_MASK) -#define INT_STATUS_GPIO_RESET 1'h0 -#define INT_STATUS_UART_MSB 2 -#define INT_STATUS_UART_LSB 2 -#define INT_STATUS_UART_MASK 'h00000004 -#define INT_STATUS_UART_GET(x) (((x) & INT_STATUS_UART_MASK) >> INT_STATUS_UART_LSB) -#define INT_STATUS_UART_SET(x) (((32'd0 | (x)) << INT_STATUS_UART_LSB) & INT_STATUS_UART_MASK) -#define INT_STATUS_UART_RESET 1'h0 -#define INT_STATUS_ERROR_MSB 1 -#define INT_STATUS_ERROR_LSB 1 -#define INT_STATUS_ERROR_MASK 'h00000002 -#define INT_STATUS_ERROR_GET(x) (((x) & INT_STATUS_ERROR_MASK) >> INT_STATUS_ERROR_LSB) -#define INT_STATUS_ERROR_SET(x) (((32'd0 | (x)) << INT_STATUS_ERROR_LSB) & INT_STATUS_ERROR_MASK) -#define INT_STATUS_ERROR_RESET 1'h0 -#define INT_STATUS_WDT_INT_MSB 0 -#define INT_STATUS_WDT_INT_LSB 0 -#define INT_STATUS_WDT_INT_MASK 'h00000001 -#define INT_STATUS_WDT_INT_GET(x) (((x) & INT_STATUS_WDT_INT_MASK) >> INT_STATUS_WDT_INT_LSB) -#define INT_STATUS_WDT_INT_SET(x) (((32'd0 | (x)) << INT_STATUS_WDT_INT_LSB) & INT_STATUS_WDT_INT_MASK) -#define INT_STATUS_WDT_INT_RESET 1'h0 -#define INT_STATUS_RESET (32'h0 | \ - INT_STATUS_RTC_POWER_SET(INT_STATUS_RTC_POWER_RESET) | \ - INT_STATUS_MAC_SET(INT_STATUS_MAC_RESET) | \ - INT_STATUS_MAILBOX_SET(INT_STATUS_MAILBOX_RESET) | \ - INT_STATUS_RTC_ALARM_SET(INT_STATUS_RTC_ALARM_RESET) | \ - INT_STATUS_HF_TIMER_SET(INT_STATUS_HF_TIMER_RESET) | \ - INT_STATUS_LF_TIMER3_SET(INT_STATUS_LF_TIMER3_RESET) | \ - INT_STATUS_LF_TIMER2_SET(INT_STATUS_LF_TIMER2_RESET) | \ - INT_STATUS_LF_TIMER1_SET(INT_STATUS_LF_TIMER1_RESET) | \ - INT_STATUS_LF_TIMER0_SET(INT_STATUS_LF_TIMER0_RESET) | \ - INT_STATUS_KEYPAD_SET(INT_STATUS_KEYPAD_RESET) | \ - INT_STATUS_SI_SET(INT_STATUS_SI_RESET) | \ - INT_STATUS_GPIO_SET(INT_STATUS_GPIO_RESET) | \ - INT_STATUS_UART_SET(INT_STATUS_UART_RESET) | \ - INT_STATUS_ERROR_SET(INT_STATUS_ERROR_RESET) | \ - INT_STATUS_WDT_INT_SET(INT_STATUS_WDT_INT_RESET)) -#define INT_STATUS_HW_MASK (32'h0 | \ - INT_STATUS_RTC_POWER_MASK | \ - INT_STATUS_MAC_MASK | \ - INT_STATUS_MAILBOX_MASK | \ - INT_STATUS_RTC_ALARM_MASK | \ - INT_STATUS_HF_TIMER_MASK | \ - INT_STATUS_LF_TIMER3_MASK | \ - INT_STATUS_LF_TIMER2_MASK | \ - INT_STATUS_LF_TIMER1_MASK | \ - INT_STATUS_LF_TIMER0_MASK | \ - INT_STATUS_KEYPAD_MASK | \ - INT_STATUS_SI_MASK | \ - INT_STATUS_GPIO_MASK | \ - INT_STATUS_UART_MASK | \ - INT_STATUS_ERROR_MASK | \ - INT_STATUS_WDT_INT_MASK) -#define INT_STATUS_SW_MASK (32'h0) - -#define LF_TIMER0_ADDRESS 'h00000048 -#define LF_TIMER0_TARGET_MSB 31 -#define LF_TIMER0_TARGET_LSB 0 -#define LF_TIMER0_TARGET_MASK 'hffffffff -#define LF_TIMER0_TARGET_GET(x) (((x) & LF_TIMER0_TARGET_MASK) >> LF_TIMER0_TARGET_LSB) -#define LF_TIMER0_TARGET_SET(x) (((32'd0 | (x)) << LF_TIMER0_TARGET_LSB) & LF_TIMER0_TARGET_MASK) -#define LF_TIMER0_TARGET_RESET 32'h0 -#define LF_TIMER0_RESET (32'h0 | \ - LF_TIMER0_TARGET_SET(LF_TIMER0_TARGET_RESET)) -#define LF_TIMER0_HW_MASK (32'h0) -#define LF_TIMER0_SW_MASK (32'h0 | \ - LF_TIMER0_TARGET_MASK) - -#define LF_TIMER_COUNT0_ADDRESS 'h0000004c -#define LF_TIMER_COUNT0_VALUE_MSB 31 -#define LF_TIMER_COUNT0_VALUE_LSB 0 -#define LF_TIMER_COUNT0_VALUE_MASK 'hffffffff -#define LF_TIMER_COUNT0_VALUE_GET(x) (((x) & LF_TIMER_COUNT0_VALUE_MASK) >> LF_TIMER_COUNT0_VALUE_LSB) -#define LF_TIMER_COUNT0_VALUE_SET(x) (((32'd0 | (x)) << LF_TIMER_COUNT0_VALUE_LSB) & LF_TIMER_COUNT0_VALUE_MASK) -#define LF_TIMER_COUNT0_VALUE_RESET 32'h0 -#define LF_TIMER_COUNT0_RESET (32'h0 | \ - LF_TIMER_COUNT0_VALUE_SET(LF_TIMER_COUNT0_VALUE_RESET)) -#define LF_TIMER_COUNT0_HW_MASK (32'h0 | \ - LF_TIMER_COUNT0_VALUE_MASK) -#define LF_TIMER_COUNT0_SW_MASK (32'h0) - -#define LF_TIMER_CONTROL0_ADDRESS 'h00000050 -#define LF_TIMER_CONTROL0_ENABLE_MSB 2 -#define LF_TIMER_CONTROL0_ENABLE_LSB 2 -#define LF_TIMER_CONTROL0_ENABLE_MASK 'h00000004 -#define LF_TIMER_CONTROL0_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL0_ENABLE_MASK) >> LF_TIMER_CONTROL0_ENABLE_LSB) -#define LF_TIMER_CONTROL0_ENABLE_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL0_ENABLE_LSB) & LF_TIMER_CONTROL0_ENABLE_MASK) -#define LF_TIMER_CONTROL0_ENABLE_RESET 1'h0 -#define LF_TIMER_CONTROL0_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL0_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL0_AUTO_RESTART_MASK 'h00000002 -#define LF_TIMER_CONTROL0_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL0_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL0_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL0_AUTO_RESTART_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL0_AUTO_RESTART_LSB) & LF_TIMER_CONTROL0_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL0_AUTO_RESTART_RESET 1'h0 -#define LF_TIMER_CONTROL0_RESET_MSB 0 -#define LF_TIMER_CONTROL0_RESET_LSB 0 -#define LF_TIMER_CONTROL0_RESET_MASK 'h00000001 -#define LF_TIMER_CONTROL0_RESET_GET(x) (((x) & LF_TIMER_CONTROL0_RESET_MASK) >> LF_TIMER_CONTROL0_RESET_LSB) -#define LF_TIMER_CONTROL0_RESET_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL0_RESET_LSB) & LF_TIMER_CONTROL0_RESET_MASK) -#define LF_TIMER_CONTROL0_RESET_RESET 1'h0 -#define LF_TIMER_CONTROL0_RESET (32'h0 | \ - LF_TIMER_CONTROL0_ENABLE_SET(LF_TIMER_CONTROL0_ENABLE_RESET) | \ - LF_TIMER_CONTROL0_AUTO_RESTART_SET(LF_TIMER_CONTROL0_AUTO_RESTART_RESET) | \ - LF_TIMER_CONTROL0_RESET_SET(LF_TIMER_CONTROL0_RESET_RESET)) -#define LF_TIMER_CONTROL0_HW_MASK (32'h0 | \ - LF_TIMER_CONTROL0_RESET_MASK) -#define LF_TIMER_CONTROL0_SW_MASK (32'h0 | \ - LF_TIMER_CONTROL0_ENABLE_MASK | \ - LF_TIMER_CONTROL0_AUTO_RESTART_MASK | \ - LF_TIMER_CONTROL0_RESET_MASK) - -#define LF_TIMER_STATUS0_ADDRESS 'h00000054 -#define LF_TIMER_STATUS0_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS0_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS0_INTERRUPT_MASK 'h00000001 -#define LF_TIMER_STATUS0_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS0_INTERRUPT_MASK) >> LF_TIMER_STATUS0_INTERRUPT_LSB) -#define LF_TIMER_STATUS0_INTERRUPT_SET(x) (((32'd0 | (x)) << LF_TIMER_STATUS0_INTERRUPT_LSB) & LF_TIMER_STATUS0_INTERRUPT_MASK) -#define LF_TIMER_STATUS0_INTERRUPT_RESET 1'h0 -#define LF_TIMER_STATUS0_RESET (32'h0 | \ - LF_TIMER_STATUS0_INTERRUPT_SET(LF_TIMER_STATUS0_INTERRUPT_RESET)) -#define LF_TIMER_STATUS0_HW_MASK (32'h0 | \ - LF_TIMER_STATUS0_INTERRUPT_MASK) -#define LF_TIMER_STATUS0_SW_MASK (32'h0 | \ - LF_TIMER_STATUS0_INTERRUPT_MASK) - -#define LF_TIMER1_ADDRESS 'h00000058 -#define LF_TIMER1_TARGET_MSB 31 -#define LF_TIMER1_TARGET_LSB 0 -#define LF_TIMER1_TARGET_MASK 'hffffffff -#define LF_TIMER1_TARGET_GET(x) (((x) & LF_TIMER1_TARGET_MASK) >> LF_TIMER1_TARGET_LSB) -#define LF_TIMER1_TARGET_SET(x) (((32'd0 | (x)) << LF_TIMER1_TARGET_LSB) & LF_TIMER1_TARGET_MASK) -#define LF_TIMER1_TARGET_RESET 32'h0 -#define LF_TIMER1_RESET (32'h0 | \ - LF_TIMER1_TARGET_SET(LF_TIMER1_TARGET_RESET)) -#define LF_TIMER1_HW_MASK (32'h0) -#define LF_TIMER1_SW_MASK (32'h0 | \ - LF_TIMER1_TARGET_MASK) - -#define LF_TIMER_COUNT1_ADDRESS 'h0000005c -#define LF_TIMER_COUNT1_VALUE_MSB 31 -#define LF_TIMER_COUNT1_VALUE_LSB 0 -#define LF_TIMER_COUNT1_VALUE_MASK 'hffffffff -#define LF_TIMER_COUNT1_VALUE_GET(x) (((x) & LF_TIMER_COUNT1_VALUE_MASK) >> LF_TIMER_COUNT1_VALUE_LSB) -#define LF_TIMER_COUNT1_VALUE_SET(x) (((32'd0 | (x)) << LF_TIMER_COUNT1_VALUE_LSB) & LF_TIMER_COUNT1_VALUE_MASK) -#define LF_TIMER_COUNT1_VALUE_RESET 32'h0 -#define LF_TIMER_COUNT1_RESET (32'h0 | \ - LF_TIMER_COUNT1_VALUE_SET(LF_TIMER_COUNT1_VALUE_RESET)) -#define LF_TIMER_COUNT1_HW_MASK (32'h0 | \ - LF_TIMER_COUNT1_VALUE_MASK) -#define LF_TIMER_COUNT1_SW_MASK (32'h0) - -#define LF_TIMER_CONTROL1_ADDRESS 'h00000060 -#define LF_TIMER_CONTROL1_ENABLE_MSB 2 -#define LF_TIMER_CONTROL1_ENABLE_LSB 2 -#define LF_TIMER_CONTROL1_ENABLE_MASK 'h00000004 -#define LF_TIMER_CONTROL1_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL1_ENABLE_MASK) >> LF_TIMER_CONTROL1_ENABLE_LSB) -#define LF_TIMER_CONTROL1_ENABLE_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL1_ENABLE_LSB) & LF_TIMER_CONTROL1_ENABLE_MASK) -#define LF_TIMER_CONTROL1_ENABLE_RESET 1'h0 -#define LF_TIMER_CONTROL1_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL1_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL1_AUTO_RESTART_MASK 'h00000002 -#define LF_TIMER_CONTROL1_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL1_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL1_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL1_AUTO_RESTART_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL1_AUTO_RESTART_LSB) & LF_TIMER_CONTROL1_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL1_AUTO_RESTART_RESET 1'h0 -#define LF_TIMER_CONTROL1_RESET_MSB 0 -#define LF_TIMER_CONTROL1_RESET_LSB 0 -#define LF_TIMER_CONTROL1_RESET_MASK 'h00000001 -#define LF_TIMER_CONTROL1_RESET_GET(x) (((x) & LF_TIMER_CONTROL1_RESET_MASK) >> LF_TIMER_CONTROL1_RESET_LSB) -#define LF_TIMER_CONTROL1_RESET_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL1_RESET_LSB) & LF_TIMER_CONTROL1_RESET_MASK) -#define LF_TIMER_CONTROL1_RESET_RESET 1'h0 -#define LF_TIMER_CONTROL1_RESET (32'h0 | \ - LF_TIMER_CONTROL1_ENABLE_SET(LF_TIMER_CONTROL1_ENABLE_RESET) | \ - LF_TIMER_CONTROL1_AUTO_RESTART_SET(LF_TIMER_CONTROL1_AUTO_RESTART_RESET) | \ - LF_TIMER_CONTROL1_RESET_SET(LF_TIMER_CONTROL1_RESET_RESET)) -#define LF_TIMER_CONTROL1_HW_MASK (32'h0 | \ - LF_TIMER_CONTROL1_RESET_MASK) -#define LF_TIMER_CONTROL1_SW_MASK (32'h0 | \ - LF_TIMER_CONTROL1_ENABLE_MASK | \ - LF_TIMER_CONTROL1_AUTO_RESTART_MASK | \ - LF_TIMER_CONTROL1_RESET_MASK) - -#define LF_TIMER_STATUS1_ADDRESS 'h00000064 -#define LF_TIMER_STATUS1_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS1_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS1_INTERRUPT_MASK 'h00000001 -#define LF_TIMER_STATUS1_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS1_INTERRUPT_MASK) >> LF_TIMER_STATUS1_INTERRUPT_LSB) -#define LF_TIMER_STATUS1_INTERRUPT_SET(x) (((32'd0 | (x)) << LF_TIMER_STATUS1_INTERRUPT_LSB) & LF_TIMER_STATUS1_INTERRUPT_MASK) -#define LF_TIMER_STATUS1_INTERRUPT_RESET 1'h0 -#define LF_TIMER_STATUS1_RESET (32'h0 | \ - LF_TIMER_STATUS1_INTERRUPT_SET(LF_TIMER_STATUS1_INTERRUPT_RESET)) -#define LF_TIMER_STATUS1_HW_MASK (32'h0 | \ - LF_TIMER_STATUS1_INTERRUPT_MASK) -#define LF_TIMER_STATUS1_SW_MASK (32'h0 | \ - LF_TIMER_STATUS1_INTERRUPT_MASK) - -#define LF_TIMER2_ADDRESS 'h00000068 -#define LF_TIMER2_TARGET_MSB 31 -#define LF_TIMER2_TARGET_LSB 0 -#define LF_TIMER2_TARGET_MASK 'hffffffff -#define LF_TIMER2_TARGET_GET(x) (((x) & LF_TIMER2_TARGET_MASK) >> LF_TIMER2_TARGET_LSB) -#define LF_TIMER2_TARGET_SET(x) (((32'd0 | (x)) << LF_TIMER2_TARGET_LSB) & LF_TIMER2_TARGET_MASK) -#define LF_TIMER2_TARGET_RESET 32'h0 -#define LF_TIMER2_RESET (32'h0 | \ - LF_TIMER2_TARGET_SET(LF_TIMER2_TARGET_RESET)) -#define LF_TIMER2_HW_MASK (32'h0) -#define LF_TIMER2_SW_MASK (32'h0 | \ - LF_TIMER2_TARGET_MASK) - -#define LF_TIMER_COUNT2_ADDRESS 'h0000006c -#define LF_TIMER_COUNT2_VALUE_MSB 31 -#define LF_TIMER_COUNT2_VALUE_LSB 0 -#define LF_TIMER_COUNT2_VALUE_MASK 'hffffffff -#define LF_TIMER_COUNT2_VALUE_GET(x) (((x) & LF_TIMER_COUNT2_VALUE_MASK) >> LF_TIMER_COUNT2_VALUE_LSB) -#define LF_TIMER_COUNT2_VALUE_SET(x) (((32'd0 | (x)) << LF_TIMER_COUNT2_VALUE_LSB) & LF_TIMER_COUNT2_VALUE_MASK) -#define LF_TIMER_COUNT2_VALUE_RESET 32'h0 -#define LF_TIMER_COUNT2_RESET (32'h0 | \ - LF_TIMER_COUNT2_VALUE_SET(LF_TIMER_COUNT2_VALUE_RESET)) -#define LF_TIMER_COUNT2_HW_MASK (32'h0 | \ - LF_TIMER_COUNT2_VALUE_MASK) -#define LF_TIMER_COUNT2_SW_MASK (32'h0) - -#define LF_TIMER_CONTROL2_ADDRESS 'h00000070 -#define LF_TIMER_CONTROL2_ENABLE_MSB 2 -#define LF_TIMER_CONTROL2_ENABLE_LSB 2 -#define LF_TIMER_CONTROL2_ENABLE_MASK 'h00000004 -#define LF_TIMER_CONTROL2_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL2_ENABLE_MASK) >> LF_TIMER_CONTROL2_ENABLE_LSB) -#define LF_TIMER_CONTROL2_ENABLE_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL2_ENABLE_LSB) & LF_TIMER_CONTROL2_ENABLE_MASK) -#define LF_TIMER_CONTROL2_ENABLE_RESET 1'h0 -#define LF_TIMER_CONTROL2_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL2_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL2_AUTO_RESTART_MASK 'h00000002 -#define LF_TIMER_CONTROL2_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL2_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL2_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL2_AUTO_RESTART_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL2_AUTO_RESTART_LSB) & LF_TIMER_CONTROL2_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL2_AUTO_RESTART_RESET 1'h0 -#define LF_TIMER_CONTROL2_RESET_MSB 0 -#define LF_TIMER_CONTROL2_RESET_LSB 0 -#define LF_TIMER_CONTROL2_RESET_MASK 'h00000001 -#define LF_TIMER_CONTROL2_RESET_GET(x) (((x) & LF_TIMER_CONTROL2_RESET_MASK) >> LF_TIMER_CONTROL2_RESET_LSB) -#define LF_TIMER_CONTROL2_RESET_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL2_RESET_LSB) & LF_TIMER_CONTROL2_RESET_MASK) -#define LF_TIMER_CONTROL2_RESET_RESET 1'h0 -#define LF_TIMER_CONTROL2_RESET (32'h0 | \ - LF_TIMER_CONTROL2_ENABLE_SET(LF_TIMER_CONTROL2_ENABLE_RESET) | \ - LF_TIMER_CONTROL2_AUTO_RESTART_SET(LF_TIMER_CONTROL2_AUTO_RESTART_RESET) | \ - LF_TIMER_CONTROL2_RESET_SET(LF_TIMER_CONTROL2_RESET_RESET)) -#define LF_TIMER_CONTROL2_HW_MASK (32'h0 | \ - LF_TIMER_CONTROL2_RESET_MASK) -#define LF_TIMER_CONTROL2_SW_MASK (32'h0 | \ - LF_TIMER_CONTROL2_ENABLE_MASK | \ - LF_TIMER_CONTROL2_AUTO_RESTART_MASK | \ - LF_TIMER_CONTROL2_RESET_MASK) - -#define LF_TIMER_STATUS2_ADDRESS 'h00000074 -#define LF_TIMER_STATUS2_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS2_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS2_INTERRUPT_MASK 'h00000001 -#define LF_TIMER_STATUS2_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS2_INTERRUPT_MASK) >> LF_TIMER_STATUS2_INTERRUPT_LSB) -#define LF_TIMER_STATUS2_INTERRUPT_SET(x) (((32'd0 | (x)) << LF_TIMER_STATUS2_INTERRUPT_LSB) & LF_TIMER_STATUS2_INTERRUPT_MASK) -#define LF_TIMER_STATUS2_INTERRUPT_RESET 1'h0 -#define LF_TIMER_STATUS2_RESET (32'h0 | \ - LF_TIMER_STATUS2_INTERRUPT_SET(LF_TIMER_STATUS2_INTERRUPT_RESET)) -#define LF_TIMER_STATUS2_HW_MASK (32'h0 | \ - LF_TIMER_STATUS2_INTERRUPT_MASK) -#define LF_TIMER_STATUS2_SW_MASK (32'h0 | \ - LF_TIMER_STATUS2_INTERRUPT_MASK) - -#define LF_TIMER3_ADDRESS 'h00000078 -#define LF_TIMER3_TARGET_MSB 31 -#define LF_TIMER3_TARGET_LSB 0 -#define LF_TIMER3_TARGET_MASK 'hffffffff -#define LF_TIMER3_TARGET_GET(x) (((x) & LF_TIMER3_TARGET_MASK) >> LF_TIMER3_TARGET_LSB) -#define LF_TIMER3_TARGET_SET(x) (((32'd0 | (x)) << LF_TIMER3_TARGET_LSB) & LF_TIMER3_TARGET_MASK) -#define LF_TIMER3_TARGET_RESET 32'h0 -#define LF_TIMER3_RESET (32'h0 | \ - LF_TIMER3_TARGET_SET(LF_TIMER3_TARGET_RESET)) -#define LF_TIMER3_HW_MASK (32'h0) -#define LF_TIMER3_SW_MASK (32'h0 | \ - LF_TIMER3_TARGET_MASK) - -#define LF_TIMER_COUNT3_ADDRESS 'h0000007c -#define LF_TIMER_COUNT3_VALUE_MSB 31 -#define LF_TIMER_COUNT3_VALUE_LSB 0 -#define LF_TIMER_COUNT3_VALUE_MASK 'hffffffff -#define LF_TIMER_COUNT3_VALUE_GET(x) (((x) & LF_TIMER_COUNT3_VALUE_MASK) >> LF_TIMER_COUNT3_VALUE_LSB) -#define LF_TIMER_COUNT3_VALUE_SET(x) (((32'd0 | (x)) << LF_TIMER_COUNT3_VALUE_LSB) & LF_TIMER_COUNT3_VALUE_MASK) -#define LF_TIMER_COUNT3_VALUE_RESET 32'h0 -#define LF_TIMER_COUNT3_RESET (32'h0 | \ - LF_TIMER_COUNT3_VALUE_SET(LF_TIMER_COUNT3_VALUE_RESET)) -#define LF_TIMER_COUNT3_HW_MASK (32'h0 | \ - LF_TIMER_COUNT3_VALUE_MASK) -#define LF_TIMER_COUNT3_SW_MASK (32'h0) - -#define LF_TIMER_CONTROL3_ADDRESS 'h00000080 -#define LF_TIMER_CONTROL3_ENABLE_MSB 2 -#define LF_TIMER_CONTROL3_ENABLE_LSB 2 -#define LF_TIMER_CONTROL3_ENABLE_MASK 'h00000004 -#define LF_TIMER_CONTROL3_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL3_ENABLE_MASK) >> LF_TIMER_CONTROL3_ENABLE_LSB) -#define LF_TIMER_CONTROL3_ENABLE_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL3_ENABLE_LSB) & LF_TIMER_CONTROL3_ENABLE_MASK) -#define LF_TIMER_CONTROL3_ENABLE_RESET 1'h0 -#define LF_TIMER_CONTROL3_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL3_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL3_AUTO_RESTART_MASK 'h00000002 -#define LF_TIMER_CONTROL3_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL3_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL3_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL3_AUTO_RESTART_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL3_AUTO_RESTART_LSB) & LF_TIMER_CONTROL3_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL3_AUTO_RESTART_RESET 1'h0 -#define LF_TIMER_CONTROL3_RESET_MSB 0 -#define LF_TIMER_CONTROL3_RESET_LSB 0 -#define LF_TIMER_CONTROL3_RESET_MASK 'h00000001 -#define LF_TIMER_CONTROL3_RESET_GET(x) (((x) & LF_TIMER_CONTROL3_RESET_MASK) >> LF_TIMER_CONTROL3_RESET_LSB) -#define LF_TIMER_CONTROL3_RESET_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL3_RESET_LSB) & LF_TIMER_CONTROL3_RESET_MASK) -#define LF_TIMER_CONTROL3_RESET_RESET 1'h0 -#define LF_TIMER_CONTROL3_RESET (32'h0 | \ - LF_TIMER_CONTROL3_ENABLE_SET(LF_TIMER_CONTROL3_ENABLE_RESET) | \ - LF_TIMER_CONTROL3_AUTO_RESTART_SET(LF_TIMER_CONTROL3_AUTO_RESTART_RESET) | \ - LF_TIMER_CONTROL3_RESET_SET(LF_TIMER_CONTROL3_RESET_RESET)) -#define LF_TIMER_CONTROL3_HW_MASK (32'h0 | \ - LF_TIMER_CONTROL3_RESET_MASK) -#define LF_TIMER_CONTROL3_SW_MASK (32'h0 | \ - LF_TIMER_CONTROL3_ENABLE_MASK | \ - LF_TIMER_CONTROL3_AUTO_RESTART_MASK | \ - LF_TIMER_CONTROL3_RESET_MASK) - -#define LF_TIMER_STATUS3_ADDRESS 'h00000084 -#define LF_TIMER_STATUS3_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS3_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS3_INTERRUPT_MASK 'h00000001 -#define LF_TIMER_STATUS3_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS3_INTERRUPT_MASK) >> LF_TIMER_STATUS3_INTERRUPT_LSB) -#define LF_TIMER_STATUS3_INTERRUPT_SET(x) (((32'd0 | (x)) << LF_TIMER_STATUS3_INTERRUPT_LSB) & LF_TIMER_STATUS3_INTERRUPT_MASK) -#define LF_TIMER_STATUS3_INTERRUPT_RESET 1'h0 -#define LF_TIMER_STATUS3_RESET (32'h0 | \ - LF_TIMER_STATUS3_INTERRUPT_SET(LF_TIMER_STATUS3_INTERRUPT_RESET)) -#define LF_TIMER_STATUS3_HW_MASK (32'h0 | \ - LF_TIMER_STATUS3_INTERRUPT_MASK) -#define LF_TIMER_STATUS3_SW_MASK (32'h0 | \ - LF_TIMER_STATUS3_INTERRUPT_MASK) - -#define HF_TIMER_ADDRESS 'h00000088 -#define HF_TIMER_TARGET_MSB 31 -#define HF_TIMER_TARGET_LSB 12 -#define HF_TIMER_TARGET_MASK 'hfffff000 -#define HF_TIMER_TARGET_GET(x) (((x) & HF_TIMER_TARGET_MASK) >> HF_TIMER_TARGET_LSB) -#define HF_TIMER_TARGET_SET(x) (((32'd0 | (x)) << HF_TIMER_TARGET_LSB) & HF_TIMER_TARGET_MASK) -#define HF_TIMER_TARGET_RESET 20'h0 -#define HF_TIMER_RESET (32'h0 | \ - HF_TIMER_TARGET_SET(HF_TIMER_TARGET_RESET)) -#define HF_TIMER_HW_MASK (32'h0) -#define HF_TIMER_SW_MASK (32'h0 | \ - HF_TIMER_TARGET_MASK) - -#define HF_TIMER_COUNT_ADDRESS 'h0000008c -#define HF_TIMER_COUNT_VALUE_MSB 31 -#define HF_TIMER_COUNT_VALUE_LSB 12 -#define HF_TIMER_COUNT_VALUE_MASK 'hfffff000 -#define HF_TIMER_COUNT_VALUE_GET(x) (((x) & HF_TIMER_COUNT_VALUE_MASK) >> HF_TIMER_COUNT_VALUE_LSB) -#define HF_TIMER_COUNT_VALUE_SET(x) (((32'd0 | (x)) << HF_TIMER_COUNT_VALUE_LSB) & HF_TIMER_COUNT_VALUE_MASK) -#define HF_TIMER_COUNT_VALUE_RESET 20'h0 -#define HF_TIMER_COUNT_RESET (32'h0 | \ - HF_TIMER_COUNT_VALUE_SET(HF_TIMER_COUNT_VALUE_RESET)) -#define HF_TIMER_COUNT_HW_MASK (32'h0 | \ - HF_TIMER_COUNT_VALUE_MASK) -#define HF_TIMER_COUNT_SW_MASK (32'h0) - -#define HF_LF_COUNT_ADDRESS 'h00000090 -#define HF_LF_COUNT_VALUE_MSB 31 -#define HF_LF_COUNT_VALUE_LSB 0 -#define HF_LF_COUNT_VALUE_MASK 'hffffffff -#define HF_LF_COUNT_VALUE_GET(x) (((x) & HF_LF_COUNT_VALUE_MASK) >> HF_LF_COUNT_VALUE_LSB) -#define HF_LF_COUNT_VALUE_SET(x) (((32'd0 | (x)) << HF_LF_COUNT_VALUE_LSB) & HF_LF_COUNT_VALUE_MASK) -#define HF_LF_COUNT_VALUE_RESET 32'h0 -#define HF_LF_COUNT_RESET (32'h0 | \ - HF_LF_COUNT_VALUE_SET(HF_LF_COUNT_VALUE_RESET)) -#define HF_LF_COUNT_HW_MASK (32'h0 | \ - HF_LF_COUNT_VALUE_MASK) -#define HF_LF_COUNT_SW_MASK (32'h0) - -#define HF_TIMER_CONTROL_ADDRESS 'h00000094 -#define HF_TIMER_CONTROL_ENABLE_MSB 3 -#define HF_TIMER_CONTROL_ENABLE_LSB 3 -#define HF_TIMER_CONTROL_ENABLE_MASK 'h00000008 -#define HF_TIMER_CONTROL_ENABLE_GET(x) (((x) & HF_TIMER_CONTROL_ENABLE_MASK) >> HF_TIMER_CONTROL_ENABLE_LSB) -#define HF_TIMER_CONTROL_ENABLE_SET(x) (((32'd0 | (x)) << HF_TIMER_CONTROL_ENABLE_LSB) & HF_TIMER_CONTROL_ENABLE_MASK) -#define HF_TIMER_CONTROL_ENABLE_RESET 1'h1 -#define HF_TIMER_CONTROL_ON_MSB 2 -#define HF_TIMER_CONTROL_ON_LSB 2 -#define HF_TIMER_CONTROL_ON_MASK 'h00000004 -#define HF_TIMER_CONTROL_ON_GET(x) (((x) & HF_TIMER_CONTROL_ON_MASK) >> HF_TIMER_CONTROL_ON_LSB) -#define HF_TIMER_CONTROL_ON_SET(x) (((32'd0 | (x)) << HF_TIMER_CONTROL_ON_LSB) & HF_TIMER_CONTROL_ON_MASK) -#define HF_TIMER_CONTROL_ON_RESET 1'h0 -#define HF_TIMER_CONTROL_AUTO_RESTART_MSB 1 -#define HF_TIMER_CONTROL_AUTO_RESTART_LSB 1 -#define HF_TIMER_CONTROL_AUTO_RESTART_MASK 'h00000002 -#define HF_TIMER_CONTROL_AUTO_RESTART_GET(x) (((x) & HF_TIMER_CONTROL_AUTO_RESTART_MASK) >> HF_TIMER_CONTROL_AUTO_RESTART_LSB) -#define HF_TIMER_CONTROL_AUTO_RESTART_SET(x) (((32'd0 | (x)) << HF_TIMER_CONTROL_AUTO_RESTART_LSB) & HF_TIMER_CONTROL_AUTO_RESTART_MASK) -#define HF_TIMER_CONTROL_AUTO_RESTART_RESET 1'h0 -#define HF_TIMER_CONTROL_RESET_MSB 0 -#define HF_TIMER_CONTROL_RESET_LSB 0 -#define HF_TIMER_CONTROL_RESET_MASK 'h00000001 -#define HF_TIMER_CONTROL_RESET_GET(x) (((x) & HF_TIMER_CONTROL_RESET_MASK) >> HF_TIMER_CONTROL_RESET_LSB) -#define HF_TIMER_CONTROL_RESET_SET(x) (((32'd0 | (x)) << HF_TIMER_CONTROL_RESET_LSB) & HF_TIMER_CONTROL_RESET_MASK) -#define HF_TIMER_CONTROL_RESET_RESET 1'h0 -#define HF_TIMER_CONTROL_RESET (32'h0 | \ - HF_TIMER_CONTROL_ENABLE_SET(HF_TIMER_CONTROL_ENABLE_RESET) | \ - HF_TIMER_CONTROL_ON_SET(HF_TIMER_CONTROL_ON_RESET) | \ - HF_TIMER_CONTROL_AUTO_RESTART_SET(HF_TIMER_CONTROL_AUTO_RESTART_RESET) | \ - HF_TIMER_CONTROL_RESET_SET(HF_TIMER_CONTROL_RESET_RESET)) -#define HF_TIMER_CONTROL_HW_MASK (32'h0 | \ - HF_TIMER_CONTROL_RESET_MASK) -#define HF_TIMER_CONTROL_SW_MASK (32'h0 | \ - HF_TIMER_CONTROL_ENABLE_MASK | \ - HF_TIMER_CONTROL_ON_MASK | \ - HF_TIMER_CONTROL_AUTO_RESTART_MASK | \ - HF_TIMER_CONTROL_RESET_MASK) - -#define HF_TIMER_STATUS_ADDRESS 'h00000098 -#define HF_TIMER_STATUS_INTERRUPT_MSB 0 -#define HF_TIMER_STATUS_INTERRUPT_LSB 0 -#define HF_TIMER_STATUS_INTERRUPT_MASK 'h00000001 -#define HF_TIMER_STATUS_INTERRUPT_GET(x) (((x) & HF_TIMER_STATUS_INTERRUPT_MASK) >> HF_TIMER_STATUS_INTERRUPT_LSB) -#define HF_TIMER_STATUS_INTERRUPT_SET(x) (((32'd0 | (x)) << HF_TIMER_STATUS_INTERRUPT_LSB) & HF_TIMER_STATUS_INTERRUPT_MASK) -#define HF_TIMER_STATUS_INTERRUPT_RESET 1'h0 -#define HF_TIMER_STATUS_RESET (32'h0 | \ - HF_TIMER_STATUS_INTERRUPT_SET(HF_TIMER_STATUS_INTERRUPT_RESET)) -#define HF_TIMER_STATUS_HW_MASK (32'h0 | \ - HF_TIMER_STATUS_INTERRUPT_MASK) -#define HF_TIMER_STATUS_SW_MASK (32'h0 | \ - HF_TIMER_STATUS_INTERRUPT_MASK) - -#define RTC_CONTROL_ADDRESS 'h0000009c -#define RTC_CONTROL_ENABLE_MSB 2 -#define RTC_CONTROL_ENABLE_LSB 2 -#define RTC_CONTROL_ENABLE_MASK 'h00000004 -#define RTC_CONTROL_ENABLE_GET(x) (((x) & RTC_CONTROL_ENABLE_MASK) >> RTC_CONTROL_ENABLE_LSB) -#define RTC_CONTROL_ENABLE_SET(x) (((32'd0 | (x)) << RTC_CONTROL_ENABLE_LSB) & RTC_CONTROL_ENABLE_MASK) -#define RTC_CONTROL_ENABLE_RESET 1'h0 -#define RTC_CONTROL_LOAD_RTC_MSB 1 -#define RTC_CONTROL_LOAD_RTC_LSB 1 -#define RTC_CONTROL_LOAD_RTC_MASK 'h00000002 -#define RTC_CONTROL_LOAD_RTC_GET(x) (((x) & RTC_CONTROL_LOAD_RTC_MASK) >> RTC_CONTROL_LOAD_RTC_LSB) -#define RTC_CONTROL_LOAD_RTC_SET(x) (((32'd0 | (x)) << RTC_CONTROL_LOAD_RTC_LSB) & RTC_CONTROL_LOAD_RTC_MASK) -#define RTC_CONTROL_LOAD_RTC_RESET 1'h0 -#define RTC_CONTROL_LOAD_ALARM_MSB 0 -#define RTC_CONTROL_LOAD_ALARM_LSB 0 -#define RTC_CONTROL_LOAD_ALARM_MASK 'h00000001 -#define RTC_CONTROL_LOAD_ALARM_GET(x) (((x) & RTC_CONTROL_LOAD_ALARM_MASK) >> RTC_CONTROL_LOAD_ALARM_LSB) -#define RTC_CONTROL_LOAD_ALARM_SET(x) (((32'd0 | (x)) << RTC_CONTROL_LOAD_ALARM_LSB) & RTC_CONTROL_LOAD_ALARM_MASK) -#define RTC_CONTROL_LOAD_ALARM_RESET 1'h0 -#define RTC_CONTROL_RESET (32'h0 | \ - RTC_CONTROL_ENABLE_SET(RTC_CONTROL_ENABLE_RESET) | \ - RTC_CONTROL_LOAD_RTC_SET(RTC_CONTROL_LOAD_RTC_RESET) | \ - RTC_CONTROL_LOAD_ALARM_SET(RTC_CONTROL_LOAD_ALARM_RESET)) -#define RTC_CONTROL_HW_MASK (32'h0 | \ - RTC_CONTROL_LOAD_RTC_MASK | \ - RTC_CONTROL_LOAD_ALARM_MASK) -#define RTC_CONTROL_SW_MASK (32'h0 | \ - RTC_CONTROL_ENABLE_MASK | \ - RTC_CONTROL_LOAD_RTC_MASK | \ - RTC_CONTROL_LOAD_ALARM_MASK) - -#define RTC_TIME_ADDRESS 'h000000a0 -#define RTC_TIME_WEEK_DAY_MSB 26 -#define RTC_TIME_WEEK_DAY_LSB 24 -#define RTC_TIME_WEEK_DAY_MASK 'h07000000 -#define RTC_TIME_WEEK_DAY_GET(x) (((x) & RTC_TIME_WEEK_DAY_MASK) >> RTC_TIME_WEEK_DAY_LSB) -#define RTC_TIME_WEEK_DAY_SET(x) (((32'd0 | (x)) << RTC_TIME_WEEK_DAY_LSB) & RTC_TIME_WEEK_DAY_MASK) -#define RTC_TIME_WEEK_DAY_RESET 3'h1 -#define RTC_TIME_HOUR_MSB 21 -#define RTC_TIME_HOUR_LSB 16 -#define RTC_TIME_HOUR_MASK 'h003f0000 -#define RTC_TIME_HOUR_GET(x) (((x) & RTC_TIME_HOUR_MASK) >> RTC_TIME_HOUR_LSB) -#define RTC_TIME_HOUR_SET(x) (((32'd0 | (x)) << RTC_TIME_HOUR_LSB) & RTC_TIME_HOUR_MASK) -#define RTC_TIME_HOUR_RESET 6'h12 -#define RTC_TIME_MINUTE_MSB 14 -#define RTC_TIME_MINUTE_LSB 8 -#define RTC_TIME_MINUTE_MASK 'h00007f00 -#define RTC_TIME_MINUTE_GET(x) (((x) & RTC_TIME_MINUTE_MASK) >> RTC_TIME_MINUTE_LSB) -#define RTC_TIME_MINUTE_SET(x) (((32'd0 | (x)) << RTC_TIME_MINUTE_LSB) & RTC_TIME_MINUTE_MASK) -#define RTC_TIME_MINUTE_RESET 7'h0 -#define RTC_TIME_SECOND_MSB 6 -#define RTC_TIME_SECOND_LSB 0 -#define RTC_TIME_SECOND_MASK 'h0000007f -#define RTC_TIME_SECOND_GET(x) (((x) & RTC_TIME_SECOND_MASK) >> RTC_TIME_SECOND_LSB) -#define RTC_TIME_SECOND_SET(x) (((32'd0 | (x)) << RTC_TIME_SECOND_LSB) & RTC_TIME_SECOND_MASK) -#define RTC_TIME_SECOND_RESET 7'h0 -#define RTC_TIME_RESET (32'h0 | \ - RTC_TIME_WEEK_DAY_SET(RTC_TIME_WEEK_DAY_RESET) | \ - RTC_TIME_HOUR_SET(RTC_TIME_HOUR_RESET) | \ - RTC_TIME_MINUTE_SET(RTC_TIME_MINUTE_RESET) | \ - RTC_TIME_SECOND_SET(RTC_TIME_SECOND_RESET)) -#define RTC_TIME_HW_MASK (32'h0 | \ - RTC_TIME_WEEK_DAY_MASK | \ - RTC_TIME_HOUR_MASK | \ - RTC_TIME_MINUTE_MASK | \ - RTC_TIME_SECOND_MASK) -#define RTC_TIME_SW_MASK (32'h0) - -#define RTC_DATE_ADDRESS 'h000000a4 -#define RTC_DATE_YEAR_MSB 23 -#define RTC_DATE_YEAR_LSB 16 -#define RTC_DATE_YEAR_MASK 'h00ff0000 -#define RTC_DATE_YEAR_GET(x) (((x) & RTC_DATE_YEAR_MASK) >> RTC_DATE_YEAR_LSB) -#define RTC_DATE_YEAR_SET(x) (((32'd0 | (x)) << RTC_DATE_YEAR_LSB) & RTC_DATE_YEAR_MASK) -#define RTC_DATE_YEAR_RESET 8'h0 -#define RTC_DATE_MONTH_MSB 12 -#define RTC_DATE_MONTH_LSB 8 -#define RTC_DATE_MONTH_MASK 'h00001f00 -#define RTC_DATE_MONTH_GET(x) (((x) & RTC_DATE_MONTH_MASK) >> RTC_DATE_MONTH_LSB) -#define RTC_DATE_MONTH_SET(x) (((32'd0 | (x)) << RTC_DATE_MONTH_LSB) & RTC_DATE_MONTH_MASK) -#define RTC_DATE_MONTH_RESET 5'h1 -#define RTC_DATE_MONTH_DAY_MSB 5 -#define RTC_DATE_MONTH_DAY_LSB 0 -#define RTC_DATE_MONTH_DAY_MASK 'h0000003f -#define RTC_DATE_MONTH_DAY_GET(x) (((x) & RTC_DATE_MONTH_DAY_MASK) >> RTC_DATE_MONTH_DAY_LSB) -#define RTC_DATE_MONTH_DAY_SET(x) (((32'd0 | (x)) << RTC_DATE_MONTH_DAY_LSB) & RTC_DATE_MONTH_DAY_MASK) -#define RTC_DATE_MONTH_DAY_RESET 6'h1 -#define RTC_DATE_RESET (32'h0 | \ - RTC_DATE_YEAR_SET(RTC_DATE_YEAR_RESET) | \ - RTC_DATE_MONTH_SET(RTC_DATE_MONTH_RESET) | \ - RTC_DATE_MONTH_DAY_SET(RTC_DATE_MONTH_DAY_RESET)) -#define RTC_DATE_HW_MASK (32'h0 | \ - RTC_DATE_YEAR_MASK | \ - RTC_DATE_MONTH_MASK | \ - RTC_DATE_MONTH_DAY_MASK) -#define RTC_DATE_SW_MASK (32'h0) - -#define RTC_SET_TIME_ADDRESS 'h000000a8 -#define RTC_SET_TIME_WEEK_DAY_MSB 26 -#define RTC_SET_TIME_WEEK_DAY_LSB 24 -#define RTC_SET_TIME_WEEK_DAY_MASK 'h07000000 -#define RTC_SET_TIME_WEEK_DAY_GET(x) (((x) & RTC_SET_TIME_WEEK_DAY_MASK) >> RTC_SET_TIME_WEEK_DAY_LSB) -#define RTC_SET_TIME_WEEK_DAY_SET(x) (((32'd0 | (x)) << RTC_SET_TIME_WEEK_DAY_LSB) & RTC_SET_TIME_WEEK_DAY_MASK) -#define RTC_SET_TIME_WEEK_DAY_RESET 3'h1 -#define RTC_SET_TIME_HOUR_MSB 21 -#define RTC_SET_TIME_HOUR_LSB 16 -#define RTC_SET_TIME_HOUR_MASK 'h003f0000 -#define RTC_SET_TIME_HOUR_GET(x) (((x) & RTC_SET_TIME_HOUR_MASK) >> RTC_SET_TIME_HOUR_LSB) -#define RTC_SET_TIME_HOUR_SET(x) (((32'd0 | (x)) << RTC_SET_TIME_HOUR_LSB) & RTC_SET_TIME_HOUR_MASK) -#define RTC_SET_TIME_HOUR_RESET 6'h0 -#define RTC_SET_TIME_MINUTE_MSB 14 -#define RTC_SET_TIME_MINUTE_LSB 8 -#define RTC_SET_TIME_MINUTE_MASK 'h00007f00 -#define RTC_SET_TIME_MINUTE_GET(x) (((x) & RTC_SET_TIME_MINUTE_MASK) >> RTC_SET_TIME_MINUTE_LSB) -#define RTC_SET_TIME_MINUTE_SET(x) (((32'd0 | (x)) << RTC_SET_TIME_MINUTE_LSB) & RTC_SET_TIME_MINUTE_MASK) -#define RTC_SET_TIME_MINUTE_RESET 7'h0 -#define RTC_SET_TIME_SECOND_MSB 6 -#define RTC_SET_TIME_SECOND_LSB 0 -#define RTC_SET_TIME_SECOND_MASK 'h0000007f -#define RTC_SET_TIME_SECOND_GET(x) (((x) & RTC_SET_TIME_SECOND_MASK) >> RTC_SET_TIME_SECOND_LSB) -#define RTC_SET_TIME_SECOND_SET(x) (((32'd0 | (x)) << RTC_SET_TIME_SECOND_LSB) & RTC_SET_TIME_SECOND_MASK) -#define RTC_SET_TIME_SECOND_RESET 7'h0 -#define RTC_SET_TIME_RESET (32'h0 | \ - RTC_SET_TIME_WEEK_DAY_SET(RTC_SET_TIME_WEEK_DAY_RESET) | \ - RTC_SET_TIME_HOUR_SET(RTC_SET_TIME_HOUR_RESET) | \ - RTC_SET_TIME_MINUTE_SET(RTC_SET_TIME_MINUTE_RESET) | \ - RTC_SET_TIME_SECOND_SET(RTC_SET_TIME_SECOND_RESET)) -#define RTC_SET_TIME_HW_MASK (32'h0) -#define RTC_SET_TIME_SW_MASK (32'h0 | \ - RTC_SET_TIME_WEEK_DAY_MASK | \ - RTC_SET_TIME_HOUR_MASK | \ - RTC_SET_TIME_MINUTE_MASK | \ - RTC_SET_TIME_SECOND_MASK) - -#define RTC_SET_DATE_ADDRESS 'h000000ac -#define RTC_SET_DATE_YEAR_MSB 23 -#define RTC_SET_DATE_YEAR_LSB 16 -#define RTC_SET_DATE_YEAR_MASK 'h00ff0000 -#define RTC_SET_DATE_YEAR_GET(x) (((x) & RTC_SET_DATE_YEAR_MASK) >> RTC_SET_DATE_YEAR_LSB) -#define RTC_SET_DATE_YEAR_SET(x) (((32'd0 | (x)) << RTC_SET_DATE_YEAR_LSB) & RTC_SET_DATE_YEAR_MASK) -#define RTC_SET_DATE_YEAR_RESET 8'h0 -#define RTC_SET_DATE_MONTH_MSB 12 -#define RTC_SET_DATE_MONTH_LSB 8 -#define RTC_SET_DATE_MONTH_MASK 'h00001f00 -#define RTC_SET_DATE_MONTH_GET(x) (((x) & RTC_SET_DATE_MONTH_MASK) >> RTC_SET_DATE_MONTH_LSB) -#define RTC_SET_DATE_MONTH_SET(x) (((32'd0 | (x)) << RTC_SET_DATE_MONTH_LSB) & RTC_SET_DATE_MONTH_MASK) -#define RTC_SET_DATE_MONTH_RESET 5'h1 -#define RTC_SET_DATE_MONTH_DAY_MSB 5 -#define RTC_SET_DATE_MONTH_DAY_LSB 0 -#define RTC_SET_DATE_MONTH_DAY_MASK 'h0000003f -#define RTC_SET_DATE_MONTH_DAY_GET(x) (((x) & RTC_SET_DATE_MONTH_DAY_MASK) >> RTC_SET_DATE_MONTH_DAY_LSB) -#define RTC_SET_DATE_MONTH_DAY_SET(x) (((32'd0 | (x)) << RTC_SET_DATE_MONTH_DAY_LSB) & RTC_SET_DATE_MONTH_DAY_MASK) -#define RTC_SET_DATE_MONTH_DAY_RESET 6'h1 -#define RTC_SET_DATE_RESET (32'h0 | \ - RTC_SET_DATE_YEAR_SET(RTC_SET_DATE_YEAR_RESET) | \ - RTC_SET_DATE_MONTH_SET(RTC_SET_DATE_MONTH_RESET) | \ - RTC_SET_DATE_MONTH_DAY_SET(RTC_SET_DATE_MONTH_DAY_RESET)) -#define RTC_SET_DATE_HW_MASK (32'h0) -#define RTC_SET_DATE_SW_MASK (32'h0 | \ - RTC_SET_DATE_YEAR_MASK | \ - RTC_SET_DATE_MONTH_MASK | \ - RTC_SET_DATE_MONTH_DAY_MASK) - -#define RTC_SET_ALARM_ADDRESS 'h000000b0 -#define RTC_SET_ALARM_HOUR_MSB 21 -#define RTC_SET_ALARM_HOUR_LSB 16 -#define RTC_SET_ALARM_HOUR_MASK 'h003f0000 -#define RTC_SET_ALARM_HOUR_GET(x) (((x) & RTC_SET_ALARM_HOUR_MASK) >> RTC_SET_ALARM_HOUR_LSB) -#define RTC_SET_ALARM_HOUR_SET(x) (((32'd0 | (x)) << RTC_SET_ALARM_HOUR_LSB) & RTC_SET_ALARM_HOUR_MASK) -#define RTC_SET_ALARM_HOUR_RESET 6'h0 -#define RTC_SET_ALARM_MINUTE_MSB 14 -#define RTC_SET_ALARM_MINUTE_LSB 8 -#define RTC_SET_ALARM_MINUTE_MASK 'h00007f00 -#define RTC_SET_ALARM_MINUTE_GET(x) (((x) & RTC_SET_ALARM_MINUTE_MASK) >> RTC_SET_ALARM_MINUTE_LSB) -#define RTC_SET_ALARM_MINUTE_SET(x) (((32'd0 | (x)) << RTC_SET_ALARM_MINUTE_LSB) & RTC_SET_ALARM_MINUTE_MASK) -#define RTC_SET_ALARM_MINUTE_RESET 7'h0 -#define RTC_SET_ALARM_SECOND_MSB 6 -#define RTC_SET_ALARM_SECOND_LSB 0 -#define RTC_SET_ALARM_SECOND_MASK 'h0000007f -#define RTC_SET_ALARM_SECOND_GET(x) (((x) & RTC_SET_ALARM_SECOND_MASK) >> RTC_SET_ALARM_SECOND_LSB) -#define RTC_SET_ALARM_SECOND_SET(x) (((32'd0 | (x)) << RTC_SET_ALARM_SECOND_LSB) & RTC_SET_ALARM_SECOND_MASK) -#define RTC_SET_ALARM_SECOND_RESET 7'h0 -#define RTC_SET_ALARM_RESET (32'h0 | \ - RTC_SET_ALARM_HOUR_SET(RTC_SET_ALARM_HOUR_RESET) | \ - RTC_SET_ALARM_MINUTE_SET(RTC_SET_ALARM_MINUTE_RESET) | \ - RTC_SET_ALARM_SECOND_SET(RTC_SET_ALARM_SECOND_RESET)) -#define RTC_SET_ALARM_HW_MASK (32'h0) -#define RTC_SET_ALARM_SW_MASK (32'h0 | \ - RTC_SET_ALARM_HOUR_MASK | \ - RTC_SET_ALARM_MINUTE_MASK | \ - RTC_SET_ALARM_SECOND_MASK) - -#define RTC_CONFIG_ADDRESS 'h000000b4 -#define RTC_CONFIG_BCD_MSB 2 -#define RTC_CONFIG_BCD_LSB 2 -#define RTC_CONFIG_BCD_MASK 'h00000004 -#define RTC_CONFIG_BCD_GET(x) (((x) & RTC_CONFIG_BCD_MASK) >> RTC_CONFIG_BCD_LSB) -#define RTC_CONFIG_BCD_SET(x) (((32'd0 | (x)) << RTC_CONFIG_BCD_LSB) & RTC_CONFIG_BCD_MASK) -#define RTC_CONFIG_BCD_RESET 1'h1 -#define RTC_CONFIG_TWELVE_HOUR_MSB 1 -#define RTC_CONFIG_TWELVE_HOUR_LSB 1 -#define RTC_CONFIG_TWELVE_HOUR_MASK 'h00000002 -#define RTC_CONFIG_TWELVE_HOUR_GET(x) (((x) & RTC_CONFIG_TWELVE_HOUR_MASK) >> RTC_CONFIG_TWELVE_HOUR_LSB) -#define RTC_CONFIG_TWELVE_HOUR_SET(x) (((32'd0 | (x)) << RTC_CONFIG_TWELVE_HOUR_LSB) & RTC_CONFIG_TWELVE_HOUR_MASK) -#define RTC_CONFIG_TWELVE_HOUR_RESET 1'h1 -#define RTC_CONFIG_DSE_MSB 0 -#define RTC_CONFIG_DSE_LSB 0 -#define RTC_CONFIG_DSE_MASK 'h00000001 -#define RTC_CONFIG_DSE_GET(x) (((x) & RTC_CONFIG_DSE_MASK) >> RTC_CONFIG_DSE_LSB) -#define RTC_CONFIG_DSE_SET(x) (((32'd0 | (x)) << RTC_CONFIG_DSE_LSB) & RTC_CONFIG_DSE_MASK) -#define RTC_CONFIG_DSE_RESET 1'h1 -#define RTC_CONFIG_RESET (32'h0 | \ - RTC_CONFIG_BCD_SET(RTC_CONFIG_BCD_RESET) | \ - RTC_CONFIG_TWELVE_HOUR_SET(RTC_CONFIG_TWELVE_HOUR_RESET) | \ - RTC_CONFIG_DSE_SET(RTC_CONFIG_DSE_RESET)) -#define RTC_CONFIG_HW_MASK (32'h0) -#define RTC_CONFIG_SW_MASK (32'h0 | \ - RTC_CONFIG_BCD_MASK | \ - RTC_CONFIG_TWELVE_HOUR_MASK | \ - RTC_CONFIG_DSE_MASK) - -#define RTC_ALARM_STATUS_ADDRESS 'h000000b8 -#define RTC_ALARM_STATUS_ENABLE_MSB 1 -#define RTC_ALARM_STATUS_ENABLE_LSB 1 -#define RTC_ALARM_STATUS_ENABLE_MASK 'h00000002 -#define RTC_ALARM_STATUS_ENABLE_GET(x) (((x) & RTC_ALARM_STATUS_ENABLE_MASK) >> RTC_ALARM_STATUS_ENABLE_LSB) -#define RTC_ALARM_STATUS_ENABLE_SET(x) (((32'd0 | (x)) << RTC_ALARM_STATUS_ENABLE_LSB) & RTC_ALARM_STATUS_ENABLE_MASK) -#define RTC_ALARM_STATUS_ENABLE_RESET 1'h0 -#define RTC_ALARM_STATUS_INTERRUPT_MSB 0 -#define RTC_ALARM_STATUS_INTERRUPT_LSB 0 -#define RTC_ALARM_STATUS_INTERRUPT_MASK 'h00000001 -#define RTC_ALARM_STATUS_INTERRUPT_GET(x) (((x) & RTC_ALARM_STATUS_INTERRUPT_MASK) >> RTC_ALARM_STATUS_INTERRUPT_LSB) -#define RTC_ALARM_STATUS_INTERRUPT_SET(x) (((32'd0 | (x)) << RTC_ALARM_STATUS_INTERRUPT_LSB) & RTC_ALARM_STATUS_INTERRUPT_MASK) -#define RTC_ALARM_STATUS_INTERRUPT_RESET 1'h0 -#define RTC_ALARM_STATUS_RESET (32'h0 | \ - RTC_ALARM_STATUS_ENABLE_SET(RTC_ALARM_STATUS_ENABLE_RESET) | \ - RTC_ALARM_STATUS_INTERRUPT_SET(RTC_ALARM_STATUS_INTERRUPT_RESET)) -#define RTC_ALARM_STATUS_HW_MASK (32'h0 | \ - RTC_ALARM_STATUS_ENABLE_MASK | \ - RTC_ALARM_STATUS_INTERRUPT_MASK) -#define RTC_ALARM_STATUS_SW_MASK (32'h0 | \ - RTC_ALARM_STATUS_ENABLE_MASK | \ - RTC_ALARM_STATUS_INTERRUPT_MASK) - -#define UART_WAKEUP_ADDRESS 'h000000bc -#define UART_WAKEUP_ENABLE_MSB 0 -#define UART_WAKEUP_ENABLE_LSB 0 -#define UART_WAKEUP_ENABLE_MASK 'h00000001 -#define UART_WAKEUP_ENABLE_GET(x) (((x) & UART_WAKEUP_ENABLE_MASK) >> UART_WAKEUP_ENABLE_LSB) -#define UART_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << UART_WAKEUP_ENABLE_LSB) & UART_WAKEUP_ENABLE_MASK) -#define UART_WAKEUP_ENABLE_RESET 1'h0 -#define UART_WAKEUP_RESET (32'h0 | \ - UART_WAKEUP_ENABLE_SET(UART_WAKEUP_ENABLE_RESET)) -#define UART_WAKEUP_HW_MASK (32'h0) -#define UART_WAKEUP_SW_MASK (32'h0 | \ - UART_WAKEUP_ENABLE_MASK) - -#define RESET_CAUSE_ADDRESS 'h000000c0 -#define RESET_CAUSE_LAST_MSB 2 -#define RESET_CAUSE_LAST_LSB 0 -#define RESET_CAUSE_LAST_MASK 'h00000007 -#define RESET_CAUSE_LAST_GET(x) (((x) & RESET_CAUSE_LAST_MASK) >> RESET_CAUSE_LAST_LSB) -#define RESET_CAUSE_LAST_SET(x) (((32'd0 | (x)) << RESET_CAUSE_LAST_LSB) & RESET_CAUSE_LAST_MASK) -#define RESET_CAUSE_LAST_RESET 3'h0 -#define RESET_CAUSE_RESET (32'h0 | \ - RESET_CAUSE_LAST_SET(RESET_CAUSE_LAST_RESET)) -#define RESET_CAUSE_HW_MASK (32'h0 | \ - RESET_CAUSE_LAST_MASK) -#define RESET_CAUSE_SW_MASK (32'h0) - -#define SYSTEM_SLEEP_ADDRESS 'h000000c4 -#define SYSTEM_SLEEP_HOST_IF_MSB 4 -#define SYSTEM_SLEEP_HOST_IF_LSB 4 -#define SYSTEM_SLEEP_HOST_IF_MASK 'h00000010 -#define SYSTEM_SLEEP_HOST_IF_GET(x) (((x) & SYSTEM_SLEEP_HOST_IF_MASK) >> SYSTEM_SLEEP_HOST_IF_LSB) -#define SYSTEM_SLEEP_HOST_IF_SET(x) (((32'd0 | (x)) << SYSTEM_SLEEP_HOST_IF_LSB) & SYSTEM_SLEEP_HOST_IF_MASK) -#define SYSTEM_SLEEP_HOST_IF_RESET 1'h1 -#define SYSTEM_SLEEP_MBOX_MSB 3 -#define SYSTEM_SLEEP_MBOX_LSB 3 -#define SYSTEM_SLEEP_MBOX_MASK 'h00000008 -#define SYSTEM_SLEEP_MBOX_GET(x) (((x) & SYSTEM_SLEEP_MBOX_MASK) >> SYSTEM_SLEEP_MBOX_LSB) -#define SYSTEM_SLEEP_MBOX_SET(x) (((32'd0 | (x)) << SYSTEM_SLEEP_MBOX_LSB) & SYSTEM_SLEEP_MBOX_MASK) -#define SYSTEM_SLEEP_MBOX_RESET 1'h1 -#define SYSTEM_SLEEP_MAC_IF_MSB 2 -#define SYSTEM_SLEEP_MAC_IF_LSB 2 -#define SYSTEM_SLEEP_MAC_IF_MASK 'h00000004 -#define SYSTEM_SLEEP_MAC_IF_GET(x) (((x) & SYSTEM_SLEEP_MAC_IF_MASK) >> SYSTEM_SLEEP_MAC_IF_LSB) -#define SYSTEM_SLEEP_MAC_IF_SET(x) (((32'd0 | (x)) << SYSTEM_SLEEP_MAC_IF_LSB) & SYSTEM_SLEEP_MAC_IF_MASK) -#define SYSTEM_SLEEP_MAC_IF_RESET 1'h1 -#define SYSTEM_SLEEP_LIGHT_MSB 1 -#define SYSTEM_SLEEP_LIGHT_LSB 1 -#define SYSTEM_SLEEP_LIGHT_MASK 'h00000002 -#define SYSTEM_SLEEP_LIGHT_GET(x) (((x) & SYSTEM_SLEEP_LIGHT_MASK) >> SYSTEM_SLEEP_LIGHT_LSB) -#define SYSTEM_SLEEP_LIGHT_SET(x) (((32'd0 | (x)) << SYSTEM_SLEEP_LIGHT_LSB) & SYSTEM_SLEEP_LIGHT_MASK) -#define SYSTEM_SLEEP_LIGHT_RESET 1'h0 -#define SYSTEM_SLEEP_DISABLE_MSB 0 -#define SYSTEM_SLEEP_DISABLE_LSB 0 -#define SYSTEM_SLEEP_DISABLE_MASK 'h00000001 -#define SYSTEM_SLEEP_DISABLE_GET(x) (((x) & SYSTEM_SLEEP_DISABLE_MASK) >> SYSTEM_SLEEP_DISABLE_LSB) -#define SYSTEM_SLEEP_DISABLE_SET(x) (((32'd0 | (x)) << SYSTEM_SLEEP_DISABLE_LSB) & SYSTEM_SLEEP_DISABLE_MASK) -#define SYSTEM_SLEEP_DISABLE_RESET 1'h1 -#define SYSTEM_SLEEP_RESET (32'h0 | \ - SYSTEM_SLEEP_HOST_IF_SET(SYSTEM_SLEEP_HOST_IF_RESET) | \ - SYSTEM_SLEEP_MBOX_SET(SYSTEM_SLEEP_MBOX_RESET) | \ - SYSTEM_SLEEP_MAC_IF_SET(SYSTEM_SLEEP_MAC_IF_RESET) | \ - SYSTEM_SLEEP_LIGHT_SET(SYSTEM_SLEEP_LIGHT_RESET) | \ - SYSTEM_SLEEP_DISABLE_SET(SYSTEM_SLEEP_DISABLE_RESET)) -#define SYSTEM_SLEEP_HW_MASK (32'h0 | \ - SYSTEM_SLEEP_HOST_IF_MASK | \ - SYSTEM_SLEEP_MBOX_MASK | \ - SYSTEM_SLEEP_MAC_IF_MASK) -#define SYSTEM_SLEEP_SW_MASK (32'h0 | \ - SYSTEM_SLEEP_LIGHT_MASK | \ - SYSTEM_SLEEP_DISABLE_MASK) - -#define SDIO_WRAPPER_ADDRESS 'h000000c8 -#define SDIO_WRAPPER_SLEEP_MSB 3 -#define SDIO_WRAPPER_SLEEP_LSB 3 -#define SDIO_WRAPPER_SLEEP_MASK 'h00000008 -#define SDIO_WRAPPER_SLEEP_GET(x) (((x) & SDIO_WRAPPER_SLEEP_MASK) >> SDIO_WRAPPER_SLEEP_LSB) -#define SDIO_WRAPPER_SLEEP_SET(x) (((32'd0 | (x)) << SDIO_WRAPPER_SLEEP_LSB) & SDIO_WRAPPER_SLEEP_MASK) -#define SDIO_WRAPPER_SLEEP_RESET 1'h1 -#define SDIO_WRAPPER_WAKEUP_MSB 2 -#define SDIO_WRAPPER_WAKEUP_LSB 2 -#define SDIO_WRAPPER_WAKEUP_MASK 'h00000004 -#define SDIO_WRAPPER_WAKEUP_GET(x) (((x) & SDIO_WRAPPER_WAKEUP_MASK) >> SDIO_WRAPPER_WAKEUP_LSB) -#define SDIO_WRAPPER_WAKEUP_SET(x) (((32'd0 | (x)) << SDIO_WRAPPER_WAKEUP_LSB) & SDIO_WRAPPER_WAKEUP_MASK) -#define SDIO_WRAPPER_WAKEUP_RESET 1'h1 -#define SDIO_WRAPPER_SOC_ON_MSB 1 -#define SDIO_WRAPPER_SOC_ON_LSB 1 -#define SDIO_WRAPPER_SOC_ON_MASK 'h00000002 -#define SDIO_WRAPPER_SOC_ON_GET(x) (((x) & SDIO_WRAPPER_SOC_ON_MASK) >> SDIO_WRAPPER_SOC_ON_LSB) -#define SDIO_WRAPPER_SOC_ON_SET(x) (((32'd0 | (x)) << SDIO_WRAPPER_SOC_ON_LSB) & SDIO_WRAPPER_SOC_ON_MASK) -#define SDIO_WRAPPER_SOC_ON_RESET 1'h1 -#define SDIO_WRAPPER_ON_MSB 0 -#define SDIO_WRAPPER_ON_LSB 0 -#define SDIO_WRAPPER_ON_MASK 'h00000001 -#define SDIO_WRAPPER_ON_GET(x) (((x) & SDIO_WRAPPER_ON_MASK) >> SDIO_WRAPPER_ON_LSB) -#define SDIO_WRAPPER_ON_SET(x) (((32'd0 | (x)) << SDIO_WRAPPER_ON_LSB) & SDIO_WRAPPER_ON_MASK) -#define SDIO_WRAPPER_ON_RESET 1'h1 -#define SDIO_WRAPPER_RESET (32'h0 | \ - SDIO_WRAPPER_SLEEP_SET(SDIO_WRAPPER_SLEEP_RESET) | \ - SDIO_WRAPPER_WAKEUP_SET(SDIO_WRAPPER_WAKEUP_RESET) | \ - SDIO_WRAPPER_SOC_ON_SET(SDIO_WRAPPER_SOC_ON_RESET) | \ - SDIO_WRAPPER_ON_SET(SDIO_WRAPPER_ON_RESET)) -#define SDIO_WRAPPER_HW_MASK (32'h0) -#define SDIO_WRAPPER_SW_MASK (32'h0 | \ - SDIO_WRAPPER_SLEEP_MASK | \ - SDIO_WRAPPER_WAKEUP_MASK | \ - SDIO_WRAPPER_SOC_ON_MASK | \ - SDIO_WRAPPER_ON_MASK) - -#define MAC_SLEEP_CONTROL_ADDRESS 'h000000cc -#define MAC_SLEEP_CONTROL_ENABLE_MSB 1 -#define MAC_SLEEP_CONTROL_ENABLE_LSB 0 -#define MAC_SLEEP_CONTROL_ENABLE_MASK 'h00000003 -#define MAC_SLEEP_CONTROL_ENABLE_GET(x) (((x) & MAC_SLEEP_CONTROL_ENABLE_MASK) >> MAC_SLEEP_CONTROL_ENABLE_LSB) -#define MAC_SLEEP_CONTROL_ENABLE_SET(x) (((32'd0 | (x)) << MAC_SLEEP_CONTROL_ENABLE_LSB) & MAC_SLEEP_CONTROL_ENABLE_MASK) -#define MAC_SLEEP_CONTROL_ENABLE_RESET 2'h1 -#define MAC_SLEEP_CONTROL_RESET (32'h0 | \ - MAC_SLEEP_CONTROL_ENABLE_SET(MAC_SLEEP_CONTROL_ENABLE_RESET)) -#define MAC_SLEEP_CONTROL_HW_MASK (32'h0) -#define MAC_SLEEP_CONTROL_SW_MASK (32'h0 | \ - MAC_SLEEP_CONTROL_ENABLE_MASK) - -#define KEEP_AWAKE_ADDRESS 'h000000d0 -#define KEEP_AWAKE_COUNT_MSB 7 -#define KEEP_AWAKE_COUNT_LSB 0 -#define KEEP_AWAKE_COUNT_MASK 'h000000ff -#define KEEP_AWAKE_COUNT_GET(x) (((x) & KEEP_AWAKE_COUNT_MASK) >> KEEP_AWAKE_COUNT_LSB) -#define KEEP_AWAKE_COUNT_SET(x) (((32'd0 | (x)) << KEEP_AWAKE_COUNT_LSB) & KEEP_AWAKE_COUNT_MASK) -#define KEEP_AWAKE_COUNT_RESET 8'h2 -#define KEEP_AWAKE_RESET (32'h0 | \ - KEEP_AWAKE_COUNT_SET(KEEP_AWAKE_COUNT_RESET)) -#define KEEP_AWAKE_HW_MASK (32'h0) -#define KEEP_AWAKE_SW_MASK (32'h0 | \ - KEEP_AWAKE_COUNT_MASK) - -#define LPO_CAL_TIME_ADDRESS 'h000000d4 -#define LPO_CAL_TIME_LENGTH_MSB 13 -#define LPO_CAL_TIME_LENGTH_LSB 0 -#define LPO_CAL_TIME_LENGTH_MASK 'h00003fff -#define LPO_CAL_TIME_LENGTH_GET(x) (((x) & LPO_CAL_TIME_LENGTH_MASK) >> LPO_CAL_TIME_LENGTH_LSB) -#define LPO_CAL_TIME_LENGTH_SET(x) (((32'd0 | (x)) << LPO_CAL_TIME_LENGTH_LSB) & LPO_CAL_TIME_LENGTH_MASK) -#define LPO_CAL_TIME_LENGTH_RESET 14'h421 -#define LPO_CAL_TIME_RESET (32'h0 | \ - LPO_CAL_TIME_LENGTH_SET(LPO_CAL_TIME_LENGTH_RESET)) -#define LPO_CAL_TIME_HW_MASK (32'h0) -#define LPO_CAL_TIME_SW_MASK (32'h0 | \ - LPO_CAL_TIME_LENGTH_MASK) - -#define LPO_INIT_DIVIDEND_INT_ADDRESS 'h000000d8 -#define LPO_INIT_DIVIDEND_INT_VALUE_MSB 23 -#define LPO_INIT_DIVIDEND_INT_VALUE_LSB 0 -#define LPO_INIT_DIVIDEND_INT_VALUE_MASK 'h00ffffff -#define LPO_INIT_DIVIDEND_INT_VALUE_GET(x) (((x) & LPO_INIT_DIVIDEND_INT_VALUE_MASK) >> LPO_INIT_DIVIDEND_INT_VALUE_LSB) -#define LPO_INIT_DIVIDEND_INT_VALUE_SET(x) (((32'd0 | (x)) << LPO_INIT_DIVIDEND_INT_VALUE_LSB) & LPO_INIT_DIVIDEND_INT_VALUE_MASK) -#define LPO_INIT_DIVIDEND_INT_VALUE_RESET 24'hcce41 -#define LPO_INIT_DIVIDEND_INT_RESET (32'h0 | \ - LPO_INIT_DIVIDEND_INT_VALUE_SET(LPO_INIT_DIVIDEND_INT_VALUE_RESET)) -#define LPO_INIT_DIVIDEND_INT_HW_MASK (32'h0) -#define LPO_INIT_DIVIDEND_INT_SW_MASK (32'h0 | \ - LPO_INIT_DIVIDEND_INT_VALUE_MASK) - -#define LPO_INIT_DIVIDEND_FRACTION_ADDRESS 'h000000dc -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_MSB 10 -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB 0 -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK 'h000007ff -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_GET(x) (((x) & LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK) >> LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB) -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_SET(x) (((32'd0 | (x)) << LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB) & LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK) -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_RESET 11'h330 -#define LPO_INIT_DIVIDEND_FRACTION_RESET (32'h0 | \ - LPO_INIT_DIVIDEND_FRACTION_VALUE_SET(LPO_INIT_DIVIDEND_FRACTION_VALUE_RESET)) -#define LPO_INIT_DIVIDEND_FRACTION_HW_MASK (32'h0) -#define LPO_INIT_DIVIDEND_FRACTION_SW_MASK (32'h0 | \ - LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK) - -#define LPO_CAL_ADDRESS 'h000000e0 -#define LPO_CAL_ENABLE_MSB 20 -#define LPO_CAL_ENABLE_LSB 20 -#define LPO_CAL_ENABLE_MASK 'h00100000 -#define LPO_CAL_ENABLE_GET(x) (((x) & LPO_CAL_ENABLE_MASK) >> LPO_CAL_ENABLE_LSB) -#define LPO_CAL_ENABLE_SET(x) (((32'd0 | (x)) << LPO_CAL_ENABLE_LSB) & LPO_CAL_ENABLE_MASK) -#define LPO_CAL_ENABLE_RESET 1'h0 -#define LPO_CAL_COUNT_MSB 19 -#define LPO_CAL_COUNT_LSB 0 -#define LPO_CAL_COUNT_MASK 'h000fffff -#define LPO_CAL_COUNT_GET(x) (((x) & LPO_CAL_COUNT_MASK) >> LPO_CAL_COUNT_LSB) -#define LPO_CAL_COUNT_SET(x) (((32'd0 | (x)) << LPO_CAL_COUNT_LSB) & LPO_CAL_COUNT_MASK) -#define LPO_CAL_COUNT_RESET 20'h12c00 -#define LPO_CAL_RESET (32'h0 | \ - LPO_CAL_ENABLE_SET(LPO_CAL_ENABLE_RESET) | \ - LPO_CAL_COUNT_SET(LPO_CAL_COUNT_RESET)) -#define LPO_CAL_HW_MASK (32'h0 | \ - LPO_CAL_COUNT_MASK) -#define LPO_CAL_SW_MASK (32'h0 | \ - LPO_CAL_ENABLE_MASK) - -#define LPO_CAL_TEST_CONTROL_ADDRESS 'h000000e4 -#define LPO_CAL_TEST_CONTROL_ENABLE_MSB 5 -#define LPO_CAL_TEST_CONTROL_ENABLE_LSB 5 -#define LPO_CAL_TEST_CONTROL_ENABLE_MASK 'h00000020 -#define LPO_CAL_TEST_CONTROL_ENABLE_GET(x) (((x) & LPO_CAL_TEST_CONTROL_ENABLE_MASK) >> LPO_CAL_TEST_CONTROL_ENABLE_LSB) -#define LPO_CAL_TEST_CONTROL_ENABLE_SET(x) (((32'd0 | (x)) << LPO_CAL_TEST_CONTROL_ENABLE_LSB) & LPO_CAL_TEST_CONTROL_ENABLE_MASK) -#define LPO_CAL_TEST_CONTROL_ENABLE_RESET 1'h0 -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_MSB 4 -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB 0 -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK 'h0000001f -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_GET(x) (((x) & LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK) >> LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB) -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_SET(x) (((32'd0 | (x)) << LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB) & LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK) -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_RESET 5'h0 -#define LPO_CAL_TEST_CONTROL_RESET (32'h0 | \ - LPO_CAL_TEST_CONTROL_ENABLE_SET(LPO_CAL_TEST_CONTROL_ENABLE_RESET) | \ - LPO_CAL_TEST_CONTROL_RTC_CYCLES_SET(LPO_CAL_TEST_CONTROL_RTC_CYCLES_RESET)) -#define LPO_CAL_TEST_CONTROL_HW_MASK (32'h0) -#define LPO_CAL_TEST_CONTROL_SW_MASK (32'h0 | \ - LPO_CAL_TEST_CONTROL_ENABLE_MASK | \ - LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK) - -#define LPO_CAL_TEST_STATUS_ADDRESS 'h000000e8 -#define LPO_CAL_TEST_STATUS_READY_MSB 16 -#define LPO_CAL_TEST_STATUS_READY_LSB 16 -#define LPO_CAL_TEST_STATUS_READY_MASK 'h00010000 -#define LPO_CAL_TEST_STATUS_READY_GET(x) (((x) & LPO_CAL_TEST_STATUS_READY_MASK) >> LPO_CAL_TEST_STATUS_READY_LSB) -#define LPO_CAL_TEST_STATUS_READY_SET(x) (((32'd0 | (x)) << LPO_CAL_TEST_STATUS_READY_LSB) & LPO_CAL_TEST_STATUS_READY_MASK) -#define LPO_CAL_TEST_STATUS_READY_RESET 1'h0 -#define LPO_CAL_TEST_STATUS_COUNT_MSB 15 -#define LPO_CAL_TEST_STATUS_COUNT_LSB 0 -#define LPO_CAL_TEST_STATUS_COUNT_MASK 'h0000ffff -#define LPO_CAL_TEST_STATUS_COUNT_GET(x) (((x) & LPO_CAL_TEST_STATUS_COUNT_MASK) >> LPO_CAL_TEST_STATUS_COUNT_LSB) -#define LPO_CAL_TEST_STATUS_COUNT_SET(x) (((32'd0 | (x)) << LPO_CAL_TEST_STATUS_COUNT_LSB) & LPO_CAL_TEST_STATUS_COUNT_MASK) -#define LPO_CAL_TEST_STATUS_COUNT_RESET 16'h0 -#define LPO_CAL_TEST_STATUS_RESET (32'h0 | \ - LPO_CAL_TEST_STATUS_READY_SET(LPO_CAL_TEST_STATUS_READY_RESET) | \ - LPO_CAL_TEST_STATUS_COUNT_SET(LPO_CAL_TEST_STATUS_COUNT_RESET)) -#define LPO_CAL_TEST_STATUS_HW_MASK (32'h0 | \ - LPO_CAL_TEST_STATUS_READY_MASK | \ - LPO_CAL_TEST_STATUS_COUNT_MASK) -#define LPO_CAL_TEST_STATUS_SW_MASK (32'h0) - -#define CHIP_ID_ADDRESS 'h000000ec -#define CHIP_ID_DEVICE_ID_MSB 31 -#define CHIP_ID_DEVICE_ID_LSB 16 -#define CHIP_ID_DEVICE_ID_MASK 'hffff0000 -#define CHIP_ID_DEVICE_ID_GET(x) (((x) & CHIP_ID_DEVICE_ID_MASK) >> CHIP_ID_DEVICE_ID_LSB) -#define CHIP_ID_DEVICE_ID_SET(x) (((32'd0 | (x)) << CHIP_ID_DEVICE_ID_LSB) & CHIP_ID_DEVICE_ID_MASK) -#define CHIP_ID_DEVICE_ID_RESET 16'h0 -#define CHIP_ID_CONFIG_ID_MSB 15 -#define CHIP_ID_CONFIG_ID_LSB 4 -#define CHIP_ID_CONFIG_ID_MASK 'h0000fff0 -#define CHIP_ID_CONFIG_ID_GET(x) (((x) & CHIP_ID_CONFIG_ID_MASK) >> CHIP_ID_CONFIG_ID_LSB) -#define CHIP_ID_CONFIG_ID_SET(x) (((32'd0 | (x)) << CHIP_ID_CONFIG_ID_LSB) & CHIP_ID_CONFIG_ID_MASK) -#define CHIP_ID_CONFIG_ID_RESET 12'h0 -#define CHIP_ID_VERSION_ID_MSB 3 -#define CHIP_ID_VERSION_ID_LSB 0 -#define CHIP_ID_VERSION_ID_MASK 'h0000000f -#define CHIP_ID_VERSION_ID_GET(x) (((x) & CHIP_ID_VERSION_ID_MASK) >> CHIP_ID_VERSION_ID_LSB) -#define CHIP_ID_VERSION_ID_SET(x) (((32'd0 | (x)) << CHIP_ID_VERSION_ID_LSB) & CHIP_ID_VERSION_ID_MASK) -#define CHIP_ID_VERSION_ID_RESET 4'h1 -#define CHIP_ID_RESET (32'h0 | \ - CHIP_ID_DEVICE_ID_SET(CHIP_ID_DEVICE_ID_RESET) | \ - CHIP_ID_CONFIG_ID_SET(CHIP_ID_CONFIG_ID_RESET) | \ - CHIP_ID_VERSION_ID_SET(CHIP_ID_VERSION_ID_RESET)) -#define CHIP_ID_HW_MASK (32'h0 | \ - CHIP_ID_DEVICE_ID_MASK | \ - CHIP_ID_CONFIG_ID_MASK | \ - CHIP_ID_VERSION_ID_MASK) -#define CHIP_ID_SW_MASK (32'h0) - -#define DERIVED_RTC_CLK_ADDRESS 'h000000f0 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MSB 20 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB 20 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK 'h00100000 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_GET(x) (((x) & DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK) >> DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_SET(x) (((32'd0 | (x)) << DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB) & DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_RESET 1'h0 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_MSB 18 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB 18 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK 'h00040000 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_GET(x) (((x) & DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK) >> DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_SET(x) (((32'd0 | (x)) << DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB) & DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_RESET 1'h0 -#define DERIVED_RTC_CLK_FORCE_MSB 17 -#define DERIVED_RTC_CLK_FORCE_LSB 16 -#define DERIVED_RTC_CLK_FORCE_MASK 'h00030000 -#define DERIVED_RTC_CLK_FORCE_GET(x) (((x) & DERIVED_RTC_CLK_FORCE_MASK) >> DERIVED_RTC_CLK_FORCE_LSB) -#define DERIVED_RTC_CLK_FORCE_SET(x) (((32'd0 | (x)) << DERIVED_RTC_CLK_FORCE_LSB) & DERIVED_RTC_CLK_FORCE_MASK) -#define DERIVED_RTC_CLK_FORCE_RESET 2'h0 -#define DERIVED_RTC_CLK_PERIOD_MSB 15 -#define DERIVED_RTC_CLK_PERIOD_LSB 1 -#define DERIVED_RTC_CLK_PERIOD_MASK 'h0000fffe -#define DERIVED_RTC_CLK_PERIOD_GET(x) (((x) & DERIVED_RTC_CLK_PERIOD_MASK) >> DERIVED_RTC_CLK_PERIOD_LSB) -#define DERIVED_RTC_CLK_PERIOD_SET(x) (((32'd0 | (x)) << DERIVED_RTC_CLK_PERIOD_LSB) & DERIVED_RTC_CLK_PERIOD_MASK) -#define DERIVED_RTC_CLK_PERIOD_RESET 15'h262 -#define DERIVED_RTC_CLK_RESET (32'h0 | \ - DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_SET(DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_RESET) | \ - DERIVED_RTC_CLK_EXTERNAL_DETECT_SET(DERIVED_RTC_CLK_EXTERNAL_DETECT_RESET) | \ - DERIVED_RTC_CLK_FORCE_SET(DERIVED_RTC_CLK_FORCE_RESET) | \ - DERIVED_RTC_CLK_PERIOD_SET(DERIVED_RTC_CLK_PERIOD_RESET)) -#define DERIVED_RTC_CLK_HW_MASK (32'h0 | \ - DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK) -#define DERIVED_RTC_CLK_SW_MASK (32'h0 | \ - DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK | \ - DERIVED_RTC_CLK_FORCE_MASK | \ - DERIVED_RTC_CLK_PERIOD_MASK) - -#define MAC_PCU_SLP32_MODE_ADDRESS 'h000000f4 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MSB 21 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_LSB 21 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MASK 'h00200000 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_GET(x) (((x) & MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MASK) >> MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_LSB) -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_LSB) & MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MASK) -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_RESET 1'h1 -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MSB 19 -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB 0 -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK 'h000fffff -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_GET(x) (((x) & MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK) >> MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB) -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB) & MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK) -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_RESET 20'hf424 -#define MAC_PCU_SLP32_MODE_RESET (32'h0 | \ - MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_SET(MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_RESET) | \ - MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_SET(MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_RESET)) -#define MAC_PCU_SLP32_MODE_HW_MASK (32'h0 | \ - MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MASK) -#define MAC_PCU_SLP32_MODE_SW_MASK (32'h0 | \ - MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK) - -#define MAC_PCU_SLP32_WAKE_ADDRESS 'h000000f8 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_MSB 15 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_LSB 0 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_MASK 'h0000ffff -#define MAC_PCU_SLP32_WAKE_XTL_TIME_GET(x) (((x) & MAC_PCU_SLP32_WAKE_XTL_TIME_MASK) >> MAC_PCU_SLP32_WAKE_XTL_TIME_LSB) -#define MAC_PCU_SLP32_WAKE_XTL_TIME_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP32_WAKE_XTL_TIME_LSB) & MAC_PCU_SLP32_WAKE_XTL_TIME_MASK) -#define MAC_PCU_SLP32_WAKE_XTL_TIME_RESET 16'h100 -#define MAC_PCU_SLP32_WAKE_RESET (32'h0 | \ - MAC_PCU_SLP32_WAKE_XTL_TIME_SET(MAC_PCU_SLP32_WAKE_XTL_TIME_RESET)) -#define MAC_PCU_SLP32_WAKE_HW_MASK (32'h0) -#define MAC_PCU_SLP32_WAKE_SW_MASK (32'h0 | \ - MAC_PCU_SLP32_WAKE_XTL_TIME_MASK) - -#define MAC_PCU_SLP32_INC_ADDRESS 'h000000fc -#define MAC_PCU_SLP32_INC_TSF_INC_MSB 19 -#define MAC_PCU_SLP32_INC_TSF_INC_LSB 0 -#define MAC_PCU_SLP32_INC_TSF_INC_MASK 'h000fffff -#define MAC_PCU_SLP32_INC_TSF_INC_GET(x) (((x) & MAC_PCU_SLP32_INC_TSF_INC_MASK) >> MAC_PCU_SLP32_INC_TSF_INC_LSB) -#define MAC_PCU_SLP32_INC_TSF_INC_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP32_INC_TSF_INC_LSB) & MAC_PCU_SLP32_INC_TSF_INC_MASK) -#define MAC_PCU_SLP32_INC_TSF_INC_RESET 20'h1e848 -#define MAC_PCU_SLP32_INC_RESET (32'h0 | \ - MAC_PCU_SLP32_INC_TSF_INC_SET(MAC_PCU_SLP32_INC_TSF_INC_RESET)) -#define MAC_PCU_SLP32_INC_HW_MASK (32'h0) -#define MAC_PCU_SLP32_INC_SW_MASK (32'h0 | \ - MAC_PCU_SLP32_INC_TSF_INC_MASK) - -#define MAC_PCU_SLP_MIB1_ADDRESS 'h00000100 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_MSB 31 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB 0 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK 'hffffffff -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_GET(x) (((x) & MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK) >> MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB) -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB) & MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK) -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_RESET 32'h0 -#define MAC_PCU_SLP_MIB1_RESET (32'h0 | \ - MAC_PCU_SLP_MIB1_SLEEP_CNT_SET(MAC_PCU_SLP_MIB1_SLEEP_CNT_RESET)) -#define MAC_PCU_SLP_MIB1_HW_MASK (32'h0 | \ - MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK) -#define MAC_PCU_SLP_MIB1_SW_MASK (32'h0 | \ - MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK) - -#define MAC_PCU_SLP_MIB2_ADDRESS 'h00000104 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_MSB 31 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB 0 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK 'hffffffff -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_GET(x) (((x) & MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK) >> MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB) -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB) & MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK) -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_RESET 32'h0 -#define MAC_PCU_SLP_MIB2_RESET (32'h0 | \ - MAC_PCU_SLP_MIB2_CYCLE_CNT_SET(MAC_PCU_SLP_MIB2_CYCLE_CNT_RESET)) -#define MAC_PCU_SLP_MIB2_HW_MASK (32'h0 | \ - MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK) -#define MAC_PCU_SLP_MIB2_SW_MASK (32'h0 | \ - MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK) - -#define MAC_PCU_SLP_MIB3_ADDRESS 'h00000108 -#define MAC_PCU_SLP_MIB3_PENDING_MSB 1 -#define MAC_PCU_SLP_MIB3_PENDING_LSB 1 -#define MAC_PCU_SLP_MIB3_PENDING_MASK 'h00000002 -#define MAC_PCU_SLP_MIB3_PENDING_GET(x) (((x) & MAC_PCU_SLP_MIB3_PENDING_MASK) >> MAC_PCU_SLP_MIB3_PENDING_LSB) -#define MAC_PCU_SLP_MIB3_PENDING_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP_MIB3_PENDING_LSB) & MAC_PCU_SLP_MIB3_PENDING_MASK) -#define MAC_PCU_SLP_MIB3_PENDING_RESET 1'h0 -#define MAC_PCU_SLP_MIB3_CLR_CNT_MSB 0 -#define MAC_PCU_SLP_MIB3_CLR_CNT_LSB 0 -#define MAC_PCU_SLP_MIB3_CLR_CNT_MASK 'h00000001 -#define MAC_PCU_SLP_MIB3_CLR_CNT_GET(x) (((x) & MAC_PCU_SLP_MIB3_CLR_CNT_MASK) >> MAC_PCU_SLP_MIB3_CLR_CNT_LSB) -#define MAC_PCU_SLP_MIB3_CLR_CNT_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP_MIB3_CLR_CNT_LSB) & MAC_PCU_SLP_MIB3_CLR_CNT_MASK) -#define MAC_PCU_SLP_MIB3_CLR_CNT_RESET 1'h0 -#define MAC_PCU_SLP_MIB3_RESET (32'h0 | \ - MAC_PCU_SLP_MIB3_PENDING_SET(MAC_PCU_SLP_MIB3_PENDING_RESET) | \ - MAC_PCU_SLP_MIB3_CLR_CNT_SET(MAC_PCU_SLP_MIB3_CLR_CNT_RESET)) -#define MAC_PCU_SLP_MIB3_HW_MASK (32'h0 | \ - MAC_PCU_SLP_MIB3_PENDING_MASK) -#define MAC_PCU_SLP_MIB3_SW_MASK (32'h0 | \ - MAC_PCU_SLP_MIB3_CLR_CNT_MASK) - -#define MAC_PCU_SLP_BEACON_ADDRESS 'h0000010c -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MSB 24 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_LSB 24 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MASK 'h01000000 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_GET(x) (((x) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MASK) >> MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_LSB) -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_LSB) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MASK) -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_RESET 1'h0 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MSB 23 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_LSB 0 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MASK 'h00ffffff -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_GET(x) (((x) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MASK) >> MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_LSB) -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_LSB) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MASK) -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_RESET 24'hffffff -#define MAC_PCU_SLP_BEACON_RESET (32'h0 | \ - MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_SET(MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_RESET) | \ - MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_SET(MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_RESET)) -#define MAC_PCU_SLP_BEACON_HW_MASK (32'h0) -#define MAC_PCU_SLP_BEACON_SW_MASK (32'h0 | \ - MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MASK | \ - MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MASK) - -#define POWER_REG_ADDRESS 'h00000110 -#define POWER_REG_VLVL_MSB 11 -#define POWER_REG_VLVL_LSB 8 -#define POWER_REG_VLVL_MASK 'h00000f00 -#define POWER_REG_VLVL_GET(x) (((x) & POWER_REG_VLVL_MASK) >> POWER_REG_VLVL_LSB) -#define POWER_REG_VLVL_SET(x) (((32'd0 | (x)) << POWER_REG_VLVL_LSB) & POWER_REG_VLVL_MASK) -#define POWER_REG_VLVL_RESET 4'h0 -#define POWER_REG_CPU_INT_ENABLE_MSB 7 -#define POWER_REG_CPU_INT_ENABLE_LSB 7 -#define POWER_REG_CPU_INT_ENABLE_MASK 'h00000080 -#define POWER_REG_CPU_INT_ENABLE_GET(x) (((x) & POWER_REG_CPU_INT_ENABLE_MASK) >> POWER_REG_CPU_INT_ENABLE_LSB) -#define POWER_REG_CPU_INT_ENABLE_SET(x) (((32'd0 | (x)) << POWER_REG_CPU_INT_ENABLE_LSB) & POWER_REG_CPU_INT_ENABLE_MASK) -#define POWER_REG_CPU_INT_ENABLE_RESET 1'h0 -#define POWER_REG_WLAN_ISO_DIS_MSB 6 -#define POWER_REG_WLAN_ISO_DIS_LSB 6 -#define POWER_REG_WLAN_ISO_DIS_MASK 'h00000040 -#define POWER_REG_WLAN_ISO_DIS_GET(x) (((x) & POWER_REG_WLAN_ISO_DIS_MASK) >> POWER_REG_WLAN_ISO_DIS_LSB) -#define POWER_REG_WLAN_ISO_DIS_SET(x) (((32'd0 | (x)) << POWER_REG_WLAN_ISO_DIS_LSB) & POWER_REG_WLAN_ISO_DIS_MASK) -#define POWER_REG_WLAN_ISO_DIS_RESET 1'h0 -#define POWER_REG_WLAN_ISO_CNTL_MSB 5 -#define POWER_REG_WLAN_ISO_CNTL_LSB 5 -#define POWER_REG_WLAN_ISO_CNTL_MASK 'h00000020 -#define POWER_REG_WLAN_ISO_CNTL_GET(x) (((x) & POWER_REG_WLAN_ISO_CNTL_MASK) >> POWER_REG_WLAN_ISO_CNTL_LSB) -#define POWER_REG_WLAN_ISO_CNTL_SET(x) (((32'd0 | (x)) << POWER_REG_WLAN_ISO_CNTL_LSB) & POWER_REG_WLAN_ISO_CNTL_MASK) -#define POWER_REG_WLAN_ISO_CNTL_RESET 1'h0 -#define POWER_REG_RADIO_PWD_EN_MSB 4 -#define POWER_REG_RADIO_PWD_EN_LSB 4 -#define POWER_REG_RADIO_PWD_EN_MASK 'h00000010 -#define POWER_REG_RADIO_PWD_EN_GET(x) (((x) & POWER_REG_RADIO_PWD_EN_MASK) >> POWER_REG_RADIO_PWD_EN_LSB) -#define POWER_REG_RADIO_PWD_EN_SET(x) (((32'd0 | (x)) << POWER_REG_RADIO_PWD_EN_LSB) & POWER_REG_RADIO_PWD_EN_MASK) -#define POWER_REG_RADIO_PWD_EN_RESET 1'h0 -#define POWER_REG_SOC_SCALE_EN_MSB 3 -#define POWER_REG_SOC_SCALE_EN_LSB 3 -#define POWER_REG_SOC_SCALE_EN_MASK 'h00000008 -#define POWER_REG_SOC_SCALE_EN_GET(x) (((x) & POWER_REG_SOC_SCALE_EN_MASK) >> POWER_REG_SOC_SCALE_EN_LSB) -#define POWER_REG_SOC_SCALE_EN_SET(x) (((32'd0 | (x)) << POWER_REG_SOC_SCALE_EN_LSB) & POWER_REG_SOC_SCALE_EN_MASK) -#define POWER_REG_SOC_SCALE_EN_RESET 1'h0 -#define POWER_REG_WLAN_SCALE_EN_MSB 2 -#define POWER_REG_WLAN_SCALE_EN_LSB 2 -#define POWER_REG_WLAN_SCALE_EN_MASK 'h00000004 -#define POWER_REG_WLAN_SCALE_EN_GET(x) (((x) & POWER_REG_WLAN_SCALE_EN_MASK) >> POWER_REG_WLAN_SCALE_EN_LSB) -#define POWER_REG_WLAN_SCALE_EN_SET(x) (((32'd0 | (x)) << POWER_REG_WLAN_SCALE_EN_LSB) & POWER_REG_WLAN_SCALE_EN_MASK) -#define POWER_REG_WLAN_SCALE_EN_RESET 1'h0 -#define POWER_REG_WLAN_PWD_EN_MSB 1 -#define POWER_REG_WLAN_PWD_EN_LSB 1 -#define POWER_REG_WLAN_PWD_EN_MASK 'h00000002 -#define POWER_REG_WLAN_PWD_EN_GET(x) (((x) & POWER_REG_WLAN_PWD_EN_MASK) >> POWER_REG_WLAN_PWD_EN_LSB) -#define POWER_REG_WLAN_PWD_EN_SET(x) (((32'd0 | (x)) << POWER_REG_WLAN_PWD_EN_LSB) & POWER_REG_WLAN_PWD_EN_MASK) -#define POWER_REG_WLAN_PWD_EN_RESET 1'h0 -#define POWER_REG_POWER_EN_MSB 0 -#define POWER_REG_POWER_EN_LSB 0 -#define POWER_REG_POWER_EN_MASK 'h00000001 -#define POWER_REG_POWER_EN_GET(x) (((x) & POWER_REG_POWER_EN_MASK) >> POWER_REG_POWER_EN_LSB) -#define POWER_REG_POWER_EN_SET(x) (((32'd0 | (x)) << POWER_REG_POWER_EN_LSB) & POWER_REG_POWER_EN_MASK) -#define POWER_REG_POWER_EN_RESET 1'h0 -#define POWER_REG_RESET (32'h0 | \ - POWER_REG_VLVL_SET(POWER_REG_VLVL_RESET) | \ - POWER_REG_CPU_INT_ENABLE_SET(POWER_REG_CPU_INT_ENABLE_RESET) | \ - POWER_REG_WLAN_ISO_DIS_SET(POWER_REG_WLAN_ISO_DIS_RESET) | \ - POWER_REG_WLAN_ISO_CNTL_SET(POWER_REG_WLAN_ISO_CNTL_RESET) | \ - POWER_REG_RADIO_PWD_EN_SET(POWER_REG_RADIO_PWD_EN_RESET) | \ - POWER_REG_SOC_SCALE_EN_SET(POWER_REG_SOC_SCALE_EN_RESET) | \ - POWER_REG_WLAN_SCALE_EN_SET(POWER_REG_WLAN_SCALE_EN_RESET) | \ - POWER_REG_WLAN_PWD_EN_SET(POWER_REG_WLAN_PWD_EN_RESET) | \ - POWER_REG_POWER_EN_SET(POWER_REG_POWER_EN_RESET)) -#define POWER_REG_HW_MASK (32'h0) -#define POWER_REG_SW_MASK (32'h0 | \ - POWER_REG_VLVL_MASK | \ - POWER_REG_CPU_INT_ENABLE_MASK | \ - POWER_REG_WLAN_ISO_DIS_MASK | \ - POWER_REG_WLAN_ISO_CNTL_MASK | \ - POWER_REG_RADIO_PWD_EN_MASK | \ - POWER_REG_SOC_SCALE_EN_MASK | \ - POWER_REG_WLAN_SCALE_EN_MASK | \ - POWER_REG_WLAN_PWD_EN_MASK | \ - POWER_REG_POWER_EN_MASK) - -#define CORE_CLK_CTRL_ADDRESS 'h00000114 -#define CORE_CLK_CTRL_DIV_MSB 2 -#define CORE_CLK_CTRL_DIV_LSB 0 -#define CORE_CLK_CTRL_DIV_MASK 'h00000007 -#define CORE_CLK_CTRL_DIV_GET(x) (((x) & CORE_CLK_CTRL_DIV_MASK) >> CORE_CLK_CTRL_DIV_LSB) -#define CORE_CLK_CTRL_DIV_SET(x) (((32'd0 | (x)) << CORE_CLK_CTRL_DIV_LSB) & CORE_CLK_CTRL_DIV_MASK) -#define CORE_CLK_CTRL_DIV_RESET 3'h2 -#define CORE_CLK_CTRL_RESET (32'h0 | \ - CORE_CLK_CTRL_DIV_SET(CORE_CLK_CTRL_DIV_RESET)) -#define CORE_CLK_CTRL_HW_MASK (32'h0) -#define CORE_CLK_CTRL_SW_MASK (32'h0 | \ - CORE_CLK_CTRL_DIV_MASK) - -#define SDIO_SETUP_CIRCUIT_ADDRESS 'h00000120 -#define SDIO_SETUP_CIRCUIT_VECTOR_MSB 7 -#define SDIO_SETUP_CIRCUIT_VECTOR_LSB 0 -#define SDIO_SETUP_CIRCUIT_VECTOR_MASK 'h000000ff -#define SDIO_SETUP_CIRCUIT_VECTOR_GET(x) (((x) & SDIO_SETUP_CIRCUIT_VECTOR_MASK) >> SDIO_SETUP_CIRCUIT_VECTOR_LSB) -#define SDIO_SETUP_CIRCUIT_VECTOR_SET(x) (((32'd0 | (x)) << SDIO_SETUP_CIRCUIT_VECTOR_LSB) & SDIO_SETUP_CIRCUIT_VECTOR_MASK) -#define SDIO_SETUP_CIRCUIT_VECTOR_RESET 8'h0 -#define SDIO_SETUP_CIRCUIT_RESET (32'h0 | \ - SDIO_SETUP_CIRCUIT_VECTOR_SET(SDIO_SETUP_CIRCUIT_VECTOR_RESET)) -#define SDIO_SETUP_CIRCUIT_HW_MASK (32'h0 | \ - SDIO_SETUP_CIRCUIT_VECTOR_MASK) -#define SDIO_SETUP_CIRCUIT_SW_MASK (32'h0) - -#define SDIO_SETUP_CONFIG_ADDRESS 'h00000140 -#define SDIO_SETUP_CONFIG_ENABLE_MSB 1 -#define SDIO_SETUP_CONFIG_ENABLE_LSB 1 -#define SDIO_SETUP_CONFIG_ENABLE_MASK 'h00000002 -#define SDIO_SETUP_CONFIG_ENABLE_GET(x) (((x) & SDIO_SETUP_CONFIG_ENABLE_MASK) >> SDIO_SETUP_CONFIG_ENABLE_LSB) -#define SDIO_SETUP_CONFIG_ENABLE_SET(x) (((32'd0 | (x)) << SDIO_SETUP_CONFIG_ENABLE_LSB) & SDIO_SETUP_CONFIG_ENABLE_MASK) -#define SDIO_SETUP_CONFIG_ENABLE_RESET 1'h0 -#define SDIO_SETUP_CONFIG_CLEAR_MSB 0 -#define SDIO_SETUP_CONFIG_CLEAR_LSB 0 -#define SDIO_SETUP_CONFIG_CLEAR_MASK 'h00000001 -#define SDIO_SETUP_CONFIG_CLEAR_GET(x) (((x) & SDIO_SETUP_CONFIG_CLEAR_MASK) >> SDIO_SETUP_CONFIG_CLEAR_LSB) -#define SDIO_SETUP_CONFIG_CLEAR_SET(x) (((32'd0 | (x)) << SDIO_SETUP_CONFIG_CLEAR_LSB) & SDIO_SETUP_CONFIG_CLEAR_MASK) -#define SDIO_SETUP_CONFIG_CLEAR_RESET 1'h1 -#define SDIO_SETUP_CONFIG_RESET (32'h0 | \ - SDIO_SETUP_CONFIG_ENABLE_SET(SDIO_SETUP_CONFIG_ENABLE_RESET) | \ - SDIO_SETUP_CONFIG_CLEAR_SET(SDIO_SETUP_CONFIG_CLEAR_RESET)) -#define SDIO_SETUP_CONFIG_HW_MASK (32'h0) -#define SDIO_SETUP_CONFIG_SW_MASK (32'h0 | \ - SDIO_SETUP_CONFIG_ENABLE_MASK | \ - SDIO_SETUP_CONFIG_CLEAR_MASK) - -#define CPU_SETUP_CONFIG_ADDRESS 'h00000144 -#define CPU_SETUP_CONFIG_ENABLE_MSB 1 -#define CPU_SETUP_CONFIG_ENABLE_LSB 1 -#define CPU_SETUP_CONFIG_ENABLE_MASK 'h00000002 -#define CPU_SETUP_CONFIG_ENABLE_GET(x) (((x) & CPU_SETUP_CONFIG_ENABLE_MASK) >> CPU_SETUP_CONFIG_ENABLE_LSB) -#define CPU_SETUP_CONFIG_ENABLE_SET(x) (((32'd0 | (x)) << CPU_SETUP_CONFIG_ENABLE_LSB) & CPU_SETUP_CONFIG_ENABLE_MASK) -#define CPU_SETUP_CONFIG_ENABLE_RESET 1'h0 -#define CPU_SETUP_CONFIG_CLEAR_MSB 0 -#define CPU_SETUP_CONFIG_CLEAR_LSB 0 -#define CPU_SETUP_CONFIG_CLEAR_MASK 'h00000001 -#define CPU_SETUP_CONFIG_CLEAR_GET(x) (((x) & CPU_SETUP_CONFIG_CLEAR_MASK) >> CPU_SETUP_CONFIG_CLEAR_LSB) -#define CPU_SETUP_CONFIG_CLEAR_SET(x) (((32'd0 | (x)) << CPU_SETUP_CONFIG_CLEAR_LSB) & CPU_SETUP_CONFIG_CLEAR_MASK) -#define CPU_SETUP_CONFIG_CLEAR_RESET 1'h0 -#define CPU_SETUP_CONFIG_RESET (32'h0 | \ - CPU_SETUP_CONFIG_ENABLE_SET(CPU_SETUP_CONFIG_ENABLE_RESET) | \ - CPU_SETUP_CONFIG_CLEAR_SET(CPU_SETUP_CONFIG_CLEAR_RESET)) -#define CPU_SETUP_CONFIG_HW_MASK (32'h0) -#define CPU_SETUP_CONFIG_SW_MASK (32'h0 | \ - CPU_SETUP_CONFIG_ENABLE_MASK | \ - CPU_SETUP_CONFIG_CLEAR_MASK) - -#define CPU_SETUP_CIRCUIT_ADDRESS 'h00000160 -#define CPU_SETUP_CIRCUIT_VECTOR_MSB 7 -#define CPU_SETUP_CIRCUIT_VECTOR_LSB 0 -#define CPU_SETUP_CIRCUIT_VECTOR_MASK 'h000000ff -#define CPU_SETUP_CIRCUIT_VECTOR_GET(x) (((x) & CPU_SETUP_CIRCUIT_VECTOR_MASK) >> CPU_SETUP_CIRCUIT_VECTOR_LSB) -#define CPU_SETUP_CIRCUIT_VECTOR_SET(x) (((32'd0 | (x)) << CPU_SETUP_CIRCUIT_VECTOR_LSB) & CPU_SETUP_CIRCUIT_VECTOR_MASK) -#define CPU_SETUP_CIRCUIT_VECTOR_RESET 8'h0 -#define CPU_SETUP_CIRCUIT_RESET (32'h0 | \ - CPU_SETUP_CIRCUIT_VECTOR_SET(CPU_SETUP_CIRCUIT_VECTOR_RESET)) -#define CPU_SETUP_CIRCUIT_HW_MASK (32'h0 | \ - CPU_SETUP_CIRCUIT_VECTOR_MASK) -#define CPU_SETUP_CIRCUIT_SW_MASK (32'h0) - -#define BB_SETUP_CONFIG_ADDRESS 'h00000180 -#define BB_SETUP_CONFIG_ENABLE_MSB 1 -#define BB_SETUP_CONFIG_ENABLE_LSB 1 -#define BB_SETUP_CONFIG_ENABLE_MASK 'h00000002 -#define BB_SETUP_CONFIG_ENABLE_GET(x) (((x) & BB_SETUP_CONFIG_ENABLE_MASK) >> BB_SETUP_CONFIG_ENABLE_LSB) -#define BB_SETUP_CONFIG_ENABLE_SET(x) (((32'd0 | (x)) << BB_SETUP_CONFIG_ENABLE_LSB) & BB_SETUP_CONFIG_ENABLE_MASK) -#define BB_SETUP_CONFIG_ENABLE_RESET 1'h0 -#define BB_SETUP_CONFIG_CLEAR_MSB 0 -#define BB_SETUP_CONFIG_CLEAR_LSB 0 -#define BB_SETUP_CONFIG_CLEAR_MASK 'h00000001 -#define BB_SETUP_CONFIG_CLEAR_GET(x) (((x) & BB_SETUP_CONFIG_CLEAR_MASK) >> BB_SETUP_CONFIG_CLEAR_LSB) -#define BB_SETUP_CONFIG_CLEAR_SET(x) (((32'd0 | (x)) << BB_SETUP_CONFIG_CLEAR_LSB) & BB_SETUP_CONFIG_CLEAR_MASK) -#define BB_SETUP_CONFIG_CLEAR_RESET 1'h0 -#define BB_SETUP_CONFIG_RESET (32'h0 | \ - BB_SETUP_CONFIG_ENABLE_SET(BB_SETUP_CONFIG_ENABLE_RESET) | \ - BB_SETUP_CONFIG_CLEAR_SET(BB_SETUP_CONFIG_CLEAR_RESET)) -#define BB_SETUP_CONFIG_HW_MASK (32'h0) -#define BB_SETUP_CONFIG_SW_MASK (32'h0 | \ - BB_SETUP_CONFIG_ENABLE_MASK | \ - BB_SETUP_CONFIG_CLEAR_MASK) - -#define BB_SETUP_CIRCUIT_ADDRESS 'h000001a0 -#define BB_SETUP_CIRCUIT_VECTOR_MSB 7 -#define BB_SETUP_CIRCUIT_VECTOR_LSB 0 -#define BB_SETUP_CIRCUIT_VECTOR_MASK 'h000000ff -#define BB_SETUP_CIRCUIT_VECTOR_GET(x) (((x) & BB_SETUP_CIRCUIT_VECTOR_MASK) >> BB_SETUP_CIRCUIT_VECTOR_LSB) -#define BB_SETUP_CIRCUIT_VECTOR_SET(x) (((32'd0 | (x)) << BB_SETUP_CIRCUIT_VECTOR_LSB) & BB_SETUP_CIRCUIT_VECTOR_MASK) -#define BB_SETUP_CIRCUIT_VECTOR_RESET 8'h0 -#define BB_SETUP_CIRCUIT_RESET (32'h0 | \ - BB_SETUP_CIRCUIT_VECTOR_SET(BB_SETUP_CIRCUIT_VECTOR_RESET)) -#define BB_SETUP_CIRCUIT_HW_MASK (32'h0 | \ - BB_SETUP_CIRCUIT_VECTOR_MASK) -#define BB_SETUP_CIRCUIT_SW_MASK (32'h0) - -#define GPIO_WAKEUP_CONTROL_ADDRESS 'h000001c0 -#define GPIO_WAKEUP_CONTROL_ENABLE_MSB 0 -#define GPIO_WAKEUP_CONTROL_ENABLE_LSB 0 -#define GPIO_WAKEUP_CONTROL_ENABLE_MASK 'h00000001 -#define GPIO_WAKEUP_CONTROL_ENABLE_GET(x) (((x) & GPIO_WAKEUP_CONTROL_ENABLE_MASK) >> GPIO_WAKEUP_CONTROL_ENABLE_LSB) -#define GPIO_WAKEUP_CONTROL_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_WAKEUP_CONTROL_ENABLE_LSB) & GPIO_WAKEUP_CONTROL_ENABLE_MASK) -#define GPIO_WAKEUP_CONTROL_ENABLE_RESET 1'h0 -#define GPIO_WAKEUP_CONTROL_RESET (32'h0 | \ - GPIO_WAKEUP_CONTROL_ENABLE_SET(GPIO_WAKEUP_CONTROL_ENABLE_RESET)) -#define GPIO_WAKEUP_CONTROL_HW_MASK (32'h0) -#define GPIO_WAKEUP_CONTROL_SW_MASK (32'h0 | \ - GPIO_WAKEUP_CONTROL_ENABLE_MASK) - -#define RTC_REG_ADDRESS_MSB 8 - -#endif /* _RTC_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/rxtxbb_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/rxtxbb_reg.h deleted file mode 100644 index 498d78701818..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/rxtxbb_reg.h +++ /dev/null @@ -1,278 +0,0 @@ -#ifndef _RXTXBB_REG_REG_H_ -#define _RXTXBB_REG_REG_H_ - -#define RXTXBB_RXTXBB1_ADDRESS 0x00000000 -#define RXTXBB_RXTXBB1_OFFSET 0x00000000 -#define RXTXBB_RXTXBB1_SPARE_MSB 31 -#define RXTXBB_RXTXBB1_SPARE_LSB 19 -#define RXTXBB_RXTXBB1_SPARE_MASK 0xfff80000 -#define RXTXBB_RXTXBB1_SPARE_GET(x) (((x) & RXTXBB_RXTXBB1_SPARE_MASK) >> RXTXBB_RXTXBB1_SPARE_LSB) -#define RXTXBB_RXTXBB1_SPARE_SET(x) (((x) << RXTXBB_RXTXBB1_SPARE_LSB) & RXTXBB_RXTXBB1_SPARE_MASK) -#define RXTXBB_RXTXBB1_FNOTCH_MSB 18 -#define RXTXBB_RXTXBB1_FNOTCH_LSB 17 -#define RXTXBB_RXTXBB1_FNOTCH_MASK 0x00060000 -#define RXTXBB_RXTXBB1_FNOTCH_GET(x) (((x) & RXTXBB_RXTXBB1_FNOTCH_MASK) >> RXTXBB_RXTXBB1_FNOTCH_LSB) -#define RXTXBB_RXTXBB1_FNOTCH_SET(x) (((x) << RXTXBB_RXTXBB1_FNOTCH_LSB) & RXTXBB_RXTXBB1_FNOTCH_MASK) -#define RXTXBB_RXTXBB1_SEL_ATB_MSB 16 -#define RXTXBB_RXTXBB1_SEL_ATB_LSB 9 -#define RXTXBB_RXTXBB1_SEL_ATB_MASK 0x0001fe00 -#define RXTXBB_RXTXBB1_SEL_ATB_GET(x) (((x) & RXTXBB_RXTXBB1_SEL_ATB_MASK) >> RXTXBB_RXTXBB1_SEL_ATB_LSB) -#define RXTXBB_RXTXBB1_SEL_ATB_SET(x) (((x) << RXTXBB_RXTXBB1_SEL_ATB_LSB) & RXTXBB_RXTXBB1_SEL_ATB_MASK) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_LSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MASK 0x00000100 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_GET(x) (((x) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) >> RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_SET(x) (((x) << RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) -#define RXTXBB_RXTXBB1_PDV2I_MSB 7 -#define RXTXBB_RXTXBB1_PDV2I_LSB 7 -#define RXTXBB_RXTXBB1_PDV2I_MASK 0x00000080 -#define RXTXBB_RXTXBB1_PDV2I_GET(x) (((x) & RXTXBB_RXTXBB1_PDV2I_MASK) >> RXTXBB_RXTXBB1_PDV2I_LSB) -#define RXTXBB_RXTXBB1_PDV2I_SET(x) (((x) << RXTXBB_RXTXBB1_PDV2I_LSB) & RXTXBB_RXTXBB1_PDV2I_MASK) -#define RXTXBB_RXTXBB1_PDI2V_MSB 6 -#define RXTXBB_RXTXBB1_PDI2V_LSB 6 -#define RXTXBB_RXTXBB1_PDI2V_MASK 0x00000040 -#define RXTXBB_RXTXBB1_PDI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDI2V_MASK) >> RXTXBB_RXTXBB1_PDI2V_LSB) -#define RXTXBB_RXTXBB1_PDI2V_SET(x) (((x) << RXTXBB_RXTXBB1_PDI2V_LSB) & RXTXBB_RXTXBB1_PDI2V_MASK) -#define RXTXBB_RXTXBB1_PDRXTXBB_MSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_LSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_MASK 0x00000020 -#define RXTXBB_RXTXBB1_PDRXTXBB_GET(x) (((x) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) >> RXTXBB_RXTXBB1_PDRXTXBB_LSB) -#define RXTXBB_RXTXBB1_PDRXTXBB_SET(x) (((x) << RXTXBB_RXTXBB1_PDRXTXBB_LSB) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK 0x00000010 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK 0x00000008 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_LSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MASK 0x00000004 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) >> RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_SET(x) (((x) << RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) -#define RXTXBB_RXTXBB1_PDLOQ_MSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_LSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_MASK 0x00000002 -#define RXTXBB_RXTXBB1_PDLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDLOQ_MASK) >> RXTXBB_RXTXBB1_PDLOQ_LSB) -#define RXTXBB_RXTXBB1_PDLOQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDLOQ_LSB) & RXTXBB_RXTXBB1_PDLOQ_MASK) -#define RXTXBB_RXTXBB1_PDHIQ_MSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_LSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_MASK 0x00000001 -#define RXTXBB_RXTXBB1_PDHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDHIQ_MASK) >> RXTXBB_RXTXBB1_PDHIQ_LSB) -#define RXTXBB_RXTXBB1_PDHIQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDHIQ_LSB) & RXTXBB_RXTXBB1_PDHIQ_MASK) - -#define RXTXBB_RXTXBB2_ADDRESS 0x00000004 -#define RXTXBB_RXTXBB2_OFFSET 0x00000004 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MSB 31 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB 29 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK 0xe0000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_SET(x) (((x) << RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MSB 28 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB 26 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK 0x1c000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_SET(x) (((x) << RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MSB 25 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB 23 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK 0x03800000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_SET(x) (((x) << RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) -#define RXTXBB_RXTXBB2_SPARE_MSB 22 -#define RXTXBB_RXTXBB2_SPARE_LSB 21 -#define RXTXBB_RXTXBB2_SPARE_MASK 0x00600000 -#define RXTXBB_RXTXBB2_SPARE_GET(x) (((x) & RXTXBB_RXTXBB2_SPARE_MASK) >> RXTXBB_RXTXBB2_SPARE_LSB) -#define RXTXBB_RXTXBB2_SPARE_SET(x) (((x) << RXTXBB_RXTXBB2_SPARE_LSB) & RXTXBB_RXTXBB2_SPARE_MASK) -#define RXTXBB_RXTXBB2_SHORTBUFFER_MSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_LSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_MASK 0x00100000 -#define RXTXBB_RXTXBB2_SHORTBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) >> RXTXBB_RXTXBB2_SHORTBUFFER_LSB) -#define RXTXBB_RXTXBB2_SHORTBUFFER_SET(x) (((x) << RXTXBB_RXTXBB2_SHORTBUFFER_LSB) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) -#define RXTXBB_RXTXBB2_SELBUFFER_MSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_LSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_MASK 0x00080000 -#define RXTXBB_RXTXBB2_SELBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SELBUFFER_MASK) >> RXTXBB_RXTXBB2_SELBUFFER_LSB) -#define RXTXBB_RXTXBB2_SELBUFFER_SET(x) (((x) << RXTXBB_RXTXBB2_SELBUFFER_LSB) & RXTXBB_RXTXBB2_SELBUFFER_MASK) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK 0x00040000 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK 0x00020000 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK 0x00010000 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK 0x00008000 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) -#define RXTXBB_RXTXBB2_CMSEL_MSB 14 -#define RXTXBB_RXTXBB2_CMSEL_LSB 13 -#define RXTXBB_RXTXBB2_CMSEL_MASK 0x00006000 -#define RXTXBB_RXTXBB2_CMSEL_GET(x) (((x) & RXTXBB_RXTXBB2_CMSEL_MASK) >> RXTXBB_RXTXBB2_CMSEL_LSB) -#define RXTXBB_RXTXBB2_CMSEL_SET(x) (((x) << RXTXBB_RXTXBB2_CMSEL_LSB) & RXTXBB_RXTXBB2_CMSEL_MASK) -#define RXTXBB_RXTXBB2_FILTERFC_MSB 12 -#define RXTXBB_RXTXBB2_FILTERFC_LSB 8 -#define RXTXBB_RXTXBB2_FILTERFC_MASK 0x00001f00 -#define RXTXBB_RXTXBB2_FILTERFC_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERFC_MASK) >> RXTXBB_RXTXBB2_FILTERFC_LSB) -#define RXTXBB_RXTXBB2_FILTERFC_SET(x) (((x) << RXTXBB_RXTXBB2_FILTERFC_LSB) & RXTXBB_RXTXBB2_FILTERFC_MASK) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK 0x00000080 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_GET(x) (((x) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) >> RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_SET(x) (((x) << RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK 0x00000040 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) >> RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_SET(x) (((x) << RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK 0x00000020 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK 0x00000010 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK 0x00000008 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK 0x00000004 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK 0x00000002 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK 0x00000001 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_GET(x) (((x) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) >> RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_SET(x) (((x) << RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) - -#define RXTXBB_RXTXBB3_ADDRESS 0x00000008 -#define RXTXBB_RXTXBB3_OFFSET 0x00000008 -#define RXTXBB_RXTXBB3_SPARE_MSB 31 -#define RXTXBB_RXTXBB3_SPARE_LSB 27 -#define RXTXBB_RXTXBB3_SPARE_MASK 0xf8000000 -#define RXTXBB_RXTXBB3_SPARE_GET(x) (((x) & RXTXBB_RXTXBB3_SPARE_MASK) >> RXTXBB_RXTXBB3_SPARE_LSB) -#define RXTXBB_RXTXBB3_SPARE_SET(x) (((x) << RXTXBB_RXTXBB3_SPARE_LSB) & RXTXBB_RXTXBB3_SPARE_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MSB 26 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB 24 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK 0x07000000 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MSB 23 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB 21 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK 0x00e00000 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MSB 20 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB 18 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK 0x001c0000 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MSB 17 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB 15 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK 0x00038000 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MSB 14 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB 12 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK 0x00007000 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MSB 11 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB 9 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK 0x00000e00 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MSB 8 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB 6 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK 0x000001c0 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MSB 5 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB 3 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK 0x00000038 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) >> RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MSB 2 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB 0 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK 0x00000007 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) - -#define RXTXBB_RXTXBB4_ADDRESS 0x0000000c -#define RXTXBB_RXTXBB4_OFFSET 0x0000000c -#define RXTXBB_RXTXBB4_SPARE_MSB 31 -#define RXTXBB_RXTXBB4_SPARE_LSB 31 -#define RXTXBB_RXTXBB4_SPARE_MASK 0x80000000 -#define RXTXBB_RXTXBB4_SPARE_GET(x) (((x) & RXTXBB_RXTXBB4_SPARE_MASK) >> RXTXBB_RXTXBB4_SPARE_LSB) -#define RXTXBB_RXTXBB4_SPARE_SET(x) (((x) << RXTXBB_RXTXBB4_SPARE_LSB) & RXTXBB_RXTXBB4_SPARE_MASK) -#define RXTXBB_RXTXBB4_LOCALOFFSET_MSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_LSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_MASK 0x40000000 -#define RXTXBB_RXTXBB4_LOCALOFFSET_GET(x) (((x) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) >> RXTXBB_RXTXBB4_LOCALOFFSET_LSB) -#define RXTXBB_RXTXBB4_LOCALOFFSET_SET(x) (((x) << RXTXBB_RXTXBB4_LOCALOFFSET_LSB) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHII_MSB 29 -#define RXTXBB_RXTXBB4_OFSTCORRHII_LSB 25 -#define RXTXBB_RXTXBB4_OFSTCORRHII_MASK 0x3e000000 -#define RXTXBB_RXTXBB4_OFSTCORRHII_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHII_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHII_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRHII_LSB) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MSB 24 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB 20 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK 0x01f00000 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MSB 19 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_LSB 15 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MASK 0x000f8000 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MSB 14 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB 10 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK 0x00007c00 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MSB 9 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB 5 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK 0x000003e0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MSB 4 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB 0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK 0x0000001f -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct rxtxbb_reg_reg_s { - volatile unsigned int rxtxbb_rxtxbb1; - volatile unsigned int rxtxbb_rxtxbb2; - volatile unsigned int rxtxbb_rxtxbb3; - volatile unsigned int rxtxbb_rxtxbb4; -} rxtxbb_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _RXTXBB_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/rxtxbb_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/rxtxbb_reg.vrh deleted file mode 100644 index 0b15458c4635..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/rxtxbb_reg.vrh +++ /dev/null @@ -1,433 +0,0 @@ -#ifndef _RXTXBB_REG_VRH_ -#define _RXTXBB_REG_VRH_ - -#define RXTXBB_RXTXBB1_ADDRESS 'h00000000 -#define RXTXBB_RXTXBB1_SPARE_MSB 31 -#define RXTXBB_RXTXBB1_SPARE_LSB 19 -#define RXTXBB_RXTXBB1_SPARE_MASK 'hfff80000 -#define RXTXBB_RXTXBB1_SPARE_GET(x) (((x) & RXTXBB_RXTXBB1_SPARE_MASK) >> RXTXBB_RXTXBB1_SPARE_LSB) -#define RXTXBB_RXTXBB1_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_SPARE_LSB) & RXTXBB_RXTXBB1_SPARE_MASK) -#define RXTXBB_RXTXBB1_SPARE_RESET 13'h0 -#define RXTXBB_RXTXBB1_FNOTCH_MSB 18 -#define RXTXBB_RXTXBB1_FNOTCH_LSB 17 -#define RXTXBB_RXTXBB1_FNOTCH_MASK 'h00060000 -#define RXTXBB_RXTXBB1_FNOTCH_GET(x) (((x) & RXTXBB_RXTXBB1_FNOTCH_MASK) >> RXTXBB_RXTXBB1_FNOTCH_LSB) -#define RXTXBB_RXTXBB1_FNOTCH_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_FNOTCH_LSB) & RXTXBB_RXTXBB1_FNOTCH_MASK) -#define RXTXBB_RXTXBB1_FNOTCH_RESET 2'h0 -#define RXTXBB_RXTXBB1_SEL_ATB_MSB 16 -#define RXTXBB_RXTXBB1_SEL_ATB_LSB 9 -#define RXTXBB_RXTXBB1_SEL_ATB_MASK 'h0001fe00 -#define RXTXBB_RXTXBB1_SEL_ATB_GET(x) (((x) & RXTXBB_RXTXBB1_SEL_ATB_MASK) >> RXTXBB_RXTXBB1_SEL_ATB_LSB) -#define RXTXBB_RXTXBB1_SEL_ATB_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_SEL_ATB_LSB) & RXTXBB_RXTXBB1_SEL_ATB_MASK) -#define RXTXBB_RXTXBB1_SEL_ATB_RESET 8'h0 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_LSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MASK 'h00000100 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_GET(x) (((x) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) >> RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDV2I_MSB 7 -#define RXTXBB_RXTXBB1_PDV2I_LSB 7 -#define RXTXBB_RXTXBB1_PDV2I_MASK 'h00000080 -#define RXTXBB_RXTXBB1_PDV2I_GET(x) (((x) & RXTXBB_RXTXBB1_PDV2I_MASK) >> RXTXBB_RXTXBB1_PDV2I_LSB) -#define RXTXBB_RXTXBB1_PDV2I_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDV2I_LSB) & RXTXBB_RXTXBB1_PDV2I_MASK) -#define RXTXBB_RXTXBB1_PDV2I_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDI2V_MSB 6 -#define RXTXBB_RXTXBB1_PDI2V_LSB 6 -#define RXTXBB_RXTXBB1_PDI2V_MASK 'h00000040 -#define RXTXBB_RXTXBB1_PDI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDI2V_MASK) >> RXTXBB_RXTXBB1_PDI2V_LSB) -#define RXTXBB_RXTXBB1_PDI2V_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDI2V_LSB) & RXTXBB_RXTXBB1_PDI2V_MASK) -#define RXTXBB_RXTXBB1_PDI2V_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDRXTXBB_MSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_LSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_MASK 'h00000020 -#define RXTXBB_RXTXBB1_PDRXTXBB_GET(x) (((x) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) >> RXTXBB_RXTXBB1_PDRXTXBB_LSB) -#define RXTXBB_RXTXBB1_PDRXTXBB_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDRXTXBB_LSB) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) -#define RXTXBB_RXTXBB1_PDRXTXBB_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK 'h00000010 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK 'h00000008 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_LSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MASK 'h00000004 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) >> RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDLOQ_MSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_LSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_MASK 'h00000002 -#define RXTXBB_RXTXBB1_PDLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDLOQ_MASK) >> RXTXBB_RXTXBB1_PDLOQ_LSB) -#define RXTXBB_RXTXBB1_PDLOQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDLOQ_LSB) & RXTXBB_RXTXBB1_PDLOQ_MASK) -#define RXTXBB_RXTXBB1_PDLOQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDHIQ_MSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_LSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_MASK 'h00000001 -#define RXTXBB_RXTXBB1_PDHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDHIQ_MASK) >> RXTXBB_RXTXBB1_PDHIQ_LSB) -#define RXTXBB_RXTXBB1_PDHIQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDHIQ_LSB) & RXTXBB_RXTXBB1_PDHIQ_MASK) -#define RXTXBB_RXTXBB1_PDHIQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_RESET (32'h0 | \ - RXTXBB_RXTXBB1_SPARE_SET(RXTXBB_RXTXBB1_SPARE_RESET) | \ - RXTXBB_RXTXBB1_FNOTCH_SET(RXTXBB_RXTXBB1_FNOTCH_RESET) | \ - RXTXBB_RXTXBB1_SEL_ATB_SET(RXTXBB_RXTXBB1_SEL_ATB_RESET) | \ - RXTXBB_RXTXBB1_PDDACINTERFACE_SET(RXTXBB_RXTXBB1_PDDACINTERFACE_RESET) | \ - RXTXBB_RXTXBB1_PDV2I_SET(RXTXBB_RXTXBB1_PDV2I_RESET) | \ - RXTXBB_RXTXBB1_PDI2V_SET(RXTXBB_RXTXBB1_PDI2V_RESET) | \ - RXTXBB_RXTXBB1_PDRXTXBB_SET(RXTXBB_RXTXBB1_PDRXTXBB_RESET) | \ - RXTXBB_RXTXBB1_PDOFFSETLOQ_SET(RXTXBB_RXTXBB1_PDOFFSETLOQ_RESET) | \ - RXTXBB_RXTXBB1_PDOFFSETHIQ_SET(RXTXBB_RXTXBB1_PDOFFSETHIQ_RESET) | \ - RXTXBB_RXTXBB1_PDOFFSETI2V_SET(RXTXBB_RXTXBB1_PDOFFSETI2V_RESET) | \ - RXTXBB_RXTXBB1_PDLOQ_SET(RXTXBB_RXTXBB1_PDLOQ_RESET) | \ - RXTXBB_RXTXBB1_PDHIQ_SET(RXTXBB_RXTXBB1_PDHIQ_RESET)) -#define RXTXBB_RXTXBB1_HW_MASK (32'h0) -#define RXTXBB_RXTXBB1_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB1_SPARE_MASK | \ - RXTXBB_RXTXBB1_FNOTCH_MASK | \ - RXTXBB_RXTXBB1_SEL_ATB_MASK | \ - RXTXBB_RXTXBB1_PDDACINTERFACE_MASK | \ - RXTXBB_RXTXBB1_PDV2I_MASK | \ - RXTXBB_RXTXBB1_PDI2V_MASK | \ - RXTXBB_RXTXBB1_PDRXTXBB_MASK | \ - RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK | \ - RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK | \ - RXTXBB_RXTXBB1_PDOFFSETI2V_MASK | \ - RXTXBB_RXTXBB1_PDLOQ_MASK | \ - RXTXBB_RXTXBB1_PDHIQ_MASK) - -#define RXTXBB_RXTXBB2_ADDRESS 'h00000004 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MSB 31 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB 29 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK 'he0000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_RESET 3'h6 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MSB 28 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB 26 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK 'h1c000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_RESET 3'h6 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MSB 25 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB 23 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK 'h03800000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_RESET 3'h6 -#define RXTXBB_RXTXBB2_SPARE_MSB 22 -#define RXTXBB_RXTXBB2_SPARE_LSB 21 -#define RXTXBB_RXTXBB2_SPARE_MASK 'h00600000 -#define RXTXBB_RXTXBB2_SPARE_GET(x) (((x) & RXTXBB_RXTXBB2_SPARE_MASK) >> RXTXBB_RXTXBB2_SPARE_LSB) -#define RXTXBB_RXTXBB2_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SPARE_LSB) & RXTXBB_RXTXBB2_SPARE_MASK) -#define RXTXBB_RXTXBB2_SPARE_RESET 2'h0 -#define RXTXBB_RXTXBB2_SHORTBUFFER_MSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_LSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_MASK 'h00100000 -#define RXTXBB_RXTXBB2_SHORTBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) >> RXTXBB_RXTXBB2_SHORTBUFFER_LSB) -#define RXTXBB_RXTXBB2_SHORTBUFFER_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SHORTBUFFER_LSB) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) -#define RXTXBB_RXTXBB2_SHORTBUFFER_RESET 1'h0 -#define RXTXBB_RXTXBB2_SELBUFFER_MSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_LSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_MASK 'h00080000 -#define RXTXBB_RXTXBB2_SELBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SELBUFFER_MASK) >> RXTXBB_RXTXBB2_SELBUFFER_LSB) -#define RXTXBB_RXTXBB2_SELBUFFER_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SELBUFFER_LSB) & RXTXBB_RXTXBB2_SELBUFFER_MASK) -#define RXTXBB_RXTXBB2_SELBUFFER_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK 'h00040000 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK 'h00020000 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK 'h00010000 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK 'h00008000 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_CMSEL_MSB 14 -#define RXTXBB_RXTXBB2_CMSEL_LSB 13 -#define RXTXBB_RXTXBB2_CMSEL_MASK 'h00006000 -#define RXTXBB_RXTXBB2_CMSEL_GET(x) (((x) & RXTXBB_RXTXBB2_CMSEL_MASK) >> RXTXBB_RXTXBB2_CMSEL_LSB) -#define RXTXBB_RXTXBB2_CMSEL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_CMSEL_LSB) & RXTXBB_RXTXBB2_CMSEL_MASK) -#define RXTXBB_RXTXBB2_CMSEL_RESET 2'h1 -#define RXTXBB_RXTXBB2_FILTERFC_MSB 12 -#define RXTXBB_RXTXBB2_FILTERFC_LSB 8 -#define RXTXBB_RXTXBB2_FILTERFC_MASK 'h00001f00 -#define RXTXBB_RXTXBB2_FILTERFC_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERFC_MASK) >> RXTXBB_RXTXBB2_FILTERFC_LSB) -#define RXTXBB_RXTXBB2_FILTERFC_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_FILTERFC_LSB) & RXTXBB_RXTXBB2_FILTERFC_MASK) -#define RXTXBB_RXTXBB2_FILTERFC_RESET 5'h10 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK 'h00000080 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_GET(x) (((x) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) >> RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_RESET 1'h0 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK 'h00000040 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) >> RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK 'h00000020 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK 'h00000010 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_RESET 1'h1 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK 'h00000008 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK 'h00000004 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK 'h00000002 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_RESET 1'h1 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK 'h00000001 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_GET(x) (((x) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) >> RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_RESET 1'h0 -#define RXTXBB_RXTXBB2_RESET (32'h0 | \ - RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_SET(RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_RESET) | \ - RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_SET(RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_RESET) | \ - RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_SET(RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_RESET) | \ - RXTXBB_RXTXBB2_SPARE_SET(RXTXBB_RXTXBB2_SPARE_RESET) | \ - RXTXBB_RXTXBB2_SHORTBUFFER_SET(RXTXBB_RXTXBB2_SHORTBUFFER_RESET) | \ - RXTXBB_RXTXBB2_SELBUFFER_SET(RXTXBB_RXTXBB2_SELBUFFER_RESET) | \ - RXTXBB_RXTXBB2_SEL_DAC_TEST_SET(RXTXBB_RXTXBB2_SEL_DAC_TEST_RESET) | \ - RXTXBB_RXTXBB2_SEL_LOQ_TEST_SET(RXTXBB_RXTXBB2_SEL_LOQ_TEST_RESET) | \ - RXTXBB_RXTXBB2_SEL_HIQ_TEST_SET(RXTXBB_RXTXBB2_SEL_HIQ_TEST_RESET) | \ - RXTXBB_RXTXBB2_SEL_I2V_TEST_SET(RXTXBB_RXTXBB2_SEL_I2V_TEST_RESET) | \ - RXTXBB_RXTXBB2_CMSEL_SET(RXTXBB_RXTXBB2_CMSEL_RESET) | \ - RXTXBB_RXTXBB2_FILTERFC_SET(RXTXBB_RXTXBB2_FILTERFC_RESET) | \ - RXTXBB_RXTXBB2_LOCALFILTERTUNING_SET(RXTXBB_RXTXBB2_LOCALFILTERTUNING_RESET) | \ - RXTXBB_RXTXBB2_FILTERDOUBLEBW_SET(RXTXBB_RXTXBB2_FILTERDOUBLEBW_RESET) | \ - RXTXBB_RXTXBB2_PATH2HIQ_EN_SET(RXTXBB_RXTXBB2_PATH2HIQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH1HIQ_EN_SET(RXTXBB_RXTXBB2_PATH1HIQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH3LOQ_EN_SET(RXTXBB_RXTXBB2_PATH3LOQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH2LOQ_EN_SET(RXTXBB_RXTXBB2_PATH2LOQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH1LOQ_EN_SET(RXTXBB_RXTXBB2_PATH1LOQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH_OVERRIDE_SET(RXTXBB_RXTXBB2_PATH_OVERRIDE_RESET)) -#define RXTXBB_RXTXBB2_HW_MASK (32'h0 | \ - RXTXBB_RXTXBB2_FILTERFC_MASK) -#define RXTXBB_RXTXBB2_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK | \ - RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK | \ - RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK | \ - RXTXBB_RXTXBB2_SPARE_MASK | \ - RXTXBB_RXTXBB2_SHORTBUFFER_MASK | \ - RXTXBB_RXTXBB2_SELBUFFER_MASK | \ - RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK | \ - RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK | \ - RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK | \ - RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK | \ - RXTXBB_RXTXBB2_CMSEL_MASK | \ - RXTXBB_RXTXBB2_FILTERFC_MASK | \ - RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK | \ - RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK | \ - RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) - -#define RXTXBB_RXTXBB3_ADDRESS 'h00000008 -#define RXTXBB_RXTXBB3_SPARE_MSB 31 -#define RXTXBB_RXTXBB3_SPARE_LSB 27 -#define RXTXBB_RXTXBB3_SPARE_MASK 'hf8000000 -#define RXTXBB_RXTXBB3_SPARE_GET(x) (((x) & RXTXBB_RXTXBB3_SPARE_MASK) >> RXTXBB_RXTXBB3_SPARE_LSB) -#define RXTXBB_RXTXBB3_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_SPARE_LSB) & RXTXBB_RXTXBB3_SPARE_MASK) -#define RXTXBB_RXTXBB3_SPARE_RESET 5'h0 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MSB 26 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB 24 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK 'h07000000 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MSB 23 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB 21 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK 'h00e00000 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MSB 20 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB 18 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK 'h001c0000 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MSB 17 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB 15 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK 'h00038000 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MSB 14 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB 12 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK 'h00007000 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MSB 11 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB 9 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK 'h00000e00 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MSB 8 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB 6 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK 'h000001c0 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MSB 5 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB 3 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK 'h00000038 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) >> RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_RESET 3'h2 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MSB 2 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB 0 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK 'h00000007 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_RESET (32'h0 | \ - RXTXBB_RXTXBB3_SPARE_SET(RXTXBB_RXTXBB3_SPARE_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_SET(RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_SET(RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_RESET)) -#define RXTXBB_RXTXBB3_HW_MASK (32'h0) -#define RXTXBB_RXTXBB3_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB3_SPARE_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) - -#define RXTXBB_RXTXBB4_ADDRESS 'h0000000c -#define RXTXBB_RXTXBB4_SPARE_MSB 31 -#define RXTXBB_RXTXBB4_SPARE_LSB 31 -#define RXTXBB_RXTXBB4_SPARE_MASK 'h80000000 -#define RXTXBB_RXTXBB4_SPARE_GET(x) (((x) & RXTXBB_RXTXBB4_SPARE_MASK) >> RXTXBB_RXTXBB4_SPARE_LSB) -#define RXTXBB_RXTXBB4_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_SPARE_LSB) & RXTXBB_RXTXBB4_SPARE_MASK) -#define RXTXBB_RXTXBB4_SPARE_RESET 1'h0 -#define RXTXBB_RXTXBB4_LOCALOFFSET_MSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_LSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_MASK 'h40000000 -#define RXTXBB_RXTXBB4_LOCALOFFSET_GET(x) (((x) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) >> RXTXBB_RXTXBB4_LOCALOFFSET_LSB) -#define RXTXBB_RXTXBB4_LOCALOFFSET_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_LOCALOFFSET_LSB) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) -#define RXTXBB_RXTXBB4_LOCALOFFSET_RESET 1'h0 -#define RXTXBB_RXTXBB4_OFSTCORRHII_MSB 29 -#define RXTXBB_RXTXBB4_OFSTCORRHII_LSB 25 -#define RXTXBB_RXTXBB4_OFSTCORRHII_MASK 'h3e000000 -#define RXTXBB_RXTXBB4_OFSTCORRHII_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHII_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHII_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRHII_LSB) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHII_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MSB 24 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB 20 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK 'h01f00000 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MSB 19 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_LSB 15 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MASK 'h000f8000 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MSB 14 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB 10 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK 'h00007c00 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MSB 9 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB 5 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK 'h000003e0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MSB 4 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB 0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK 'h0000001f -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_RESET 5'h10 -#define RXTXBB_RXTXBB4_RESET (32'h0 | \ - RXTXBB_RXTXBB4_SPARE_SET(RXTXBB_RXTXBB4_SPARE_RESET) | \ - RXTXBB_RXTXBB4_LOCALOFFSET_SET(RXTXBB_RXTXBB4_LOCALOFFSET_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRHII_SET(RXTXBB_RXTXBB4_OFSTCORRHII_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRHIQ_SET(RXTXBB_RXTXBB4_OFSTCORRHIQ_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRLOI_SET(RXTXBB_RXTXBB4_OFSTCORRLOI_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRLOQ_SET(RXTXBB_RXTXBB4_OFSTCORRLOQ_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRI2VI_SET(RXTXBB_RXTXBB4_OFSTCORRI2VI_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRI2VQ_SET(RXTXBB_RXTXBB4_OFSTCORRI2VQ_RESET)) -#define RXTXBB_RXTXBB4_HW_MASK (32'h0 | \ - RXTXBB_RXTXBB4_OFSTCORRHII_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) -#define RXTXBB_RXTXBB4_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB4_SPARE_MASK | \ - RXTXBB_RXTXBB4_LOCALOFFSET_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRHII_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) - -#define RXTXBB_REG_ADDRESS_MSB 3 - -#endif /* _RXTXBB_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/si_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/si_reg.h deleted file mode 100644 index 16fb99cfd0b8..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/si_reg.h +++ /dev/null @@ -1,186 +0,0 @@ -#ifndef _SI_REG_REG_H_ -#define _SI_REG_REG_H_ - -#define SI_CONFIG_ADDRESS 0x00000000 -#define SI_CONFIG_OFFSET 0x00000000 -#define SI_CONFIG_ERR_INT_MSB 19 -#define SI_CONFIG_ERR_INT_LSB 19 -#define SI_CONFIG_ERR_INT_MASK 0x00080000 -#define SI_CONFIG_ERR_INT_GET(x) (((x) & SI_CONFIG_ERR_INT_MASK) >> SI_CONFIG_ERR_INT_LSB) -#define SI_CONFIG_ERR_INT_SET(x) (((x) << SI_CONFIG_ERR_INT_LSB) & SI_CONFIG_ERR_INT_MASK) -#define SI_CONFIG_BIDIR_OD_DATA_MSB 18 -#define SI_CONFIG_BIDIR_OD_DATA_LSB 18 -#define SI_CONFIG_BIDIR_OD_DATA_MASK 0x00040000 -#define SI_CONFIG_BIDIR_OD_DATA_GET(x) (((x) & SI_CONFIG_BIDIR_OD_DATA_MASK) >> SI_CONFIG_BIDIR_OD_DATA_LSB) -#define SI_CONFIG_BIDIR_OD_DATA_SET(x) (((x) << SI_CONFIG_BIDIR_OD_DATA_LSB) & SI_CONFIG_BIDIR_OD_DATA_MASK) -#define SI_CONFIG_I2C_MSB 16 -#define SI_CONFIG_I2C_LSB 16 -#define SI_CONFIG_I2C_MASK 0x00010000 -#define SI_CONFIG_I2C_GET(x) (((x) & SI_CONFIG_I2C_MASK) >> SI_CONFIG_I2C_LSB) -#define SI_CONFIG_I2C_SET(x) (((x) << SI_CONFIG_I2C_LSB) & SI_CONFIG_I2C_MASK) -#define SI_CONFIG_POS_SAMPLE_MSB 7 -#define SI_CONFIG_POS_SAMPLE_LSB 7 -#define SI_CONFIG_POS_SAMPLE_MASK 0x00000080 -#define SI_CONFIG_POS_SAMPLE_GET(x) (((x) & SI_CONFIG_POS_SAMPLE_MASK) >> SI_CONFIG_POS_SAMPLE_LSB) -#define SI_CONFIG_POS_SAMPLE_SET(x) (((x) << SI_CONFIG_POS_SAMPLE_LSB) & SI_CONFIG_POS_SAMPLE_MASK) -#define SI_CONFIG_POS_DRIVE_MSB 6 -#define SI_CONFIG_POS_DRIVE_LSB 6 -#define SI_CONFIG_POS_DRIVE_MASK 0x00000040 -#define SI_CONFIG_POS_DRIVE_GET(x) (((x) & SI_CONFIG_POS_DRIVE_MASK) >> SI_CONFIG_POS_DRIVE_LSB) -#define SI_CONFIG_POS_DRIVE_SET(x) (((x) << SI_CONFIG_POS_DRIVE_LSB) & SI_CONFIG_POS_DRIVE_MASK) -#define SI_CONFIG_INACTIVE_DATA_MSB 5 -#define SI_CONFIG_INACTIVE_DATA_LSB 5 -#define SI_CONFIG_INACTIVE_DATA_MASK 0x00000020 -#define SI_CONFIG_INACTIVE_DATA_GET(x) (((x) & SI_CONFIG_INACTIVE_DATA_MASK) >> SI_CONFIG_INACTIVE_DATA_LSB) -#define SI_CONFIG_INACTIVE_DATA_SET(x) (((x) << SI_CONFIG_INACTIVE_DATA_LSB) & SI_CONFIG_INACTIVE_DATA_MASK) -#define SI_CONFIG_INACTIVE_CLK_MSB 4 -#define SI_CONFIG_INACTIVE_CLK_LSB 4 -#define SI_CONFIG_INACTIVE_CLK_MASK 0x00000010 -#define SI_CONFIG_INACTIVE_CLK_GET(x) (((x) & SI_CONFIG_INACTIVE_CLK_MASK) >> SI_CONFIG_INACTIVE_CLK_LSB) -#define SI_CONFIG_INACTIVE_CLK_SET(x) (((x) << SI_CONFIG_INACTIVE_CLK_LSB) & SI_CONFIG_INACTIVE_CLK_MASK) -#define SI_CONFIG_DIVIDER_MSB 3 -#define SI_CONFIG_DIVIDER_LSB 0 -#define SI_CONFIG_DIVIDER_MASK 0x0000000f -#define SI_CONFIG_DIVIDER_GET(x) (((x) & SI_CONFIG_DIVIDER_MASK) >> SI_CONFIG_DIVIDER_LSB) -#define SI_CONFIG_DIVIDER_SET(x) (((x) << SI_CONFIG_DIVIDER_LSB) & SI_CONFIG_DIVIDER_MASK) - -#define SI_CS_ADDRESS 0x00000004 -#define SI_CS_OFFSET 0x00000004 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_MSB 13 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_LSB 11 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_MASK 0x00003800 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_GET(x) (((x) & SI_CS_BIT_CNT_IN_LAST_BYTE_MASK) >> SI_CS_BIT_CNT_IN_LAST_BYTE_LSB) -#define SI_CS_BIT_CNT_IN_LAST_BYTE_SET(x) (((x) << SI_CS_BIT_CNT_IN_LAST_BYTE_LSB) & SI_CS_BIT_CNT_IN_LAST_BYTE_MASK) -#define SI_CS_DONE_ERR_MSB 10 -#define SI_CS_DONE_ERR_LSB 10 -#define SI_CS_DONE_ERR_MASK 0x00000400 -#define SI_CS_DONE_ERR_GET(x) (((x) & SI_CS_DONE_ERR_MASK) >> SI_CS_DONE_ERR_LSB) -#define SI_CS_DONE_ERR_SET(x) (((x) << SI_CS_DONE_ERR_LSB) & SI_CS_DONE_ERR_MASK) -#define SI_CS_DONE_INT_MSB 9 -#define SI_CS_DONE_INT_LSB 9 -#define SI_CS_DONE_INT_MASK 0x00000200 -#define SI_CS_DONE_INT_GET(x) (((x) & SI_CS_DONE_INT_MASK) >> SI_CS_DONE_INT_LSB) -#define SI_CS_DONE_INT_SET(x) (((x) << SI_CS_DONE_INT_LSB) & SI_CS_DONE_INT_MASK) -#define SI_CS_START_MSB 8 -#define SI_CS_START_LSB 8 -#define SI_CS_START_MASK 0x00000100 -#define SI_CS_START_GET(x) (((x) & SI_CS_START_MASK) >> SI_CS_START_LSB) -#define SI_CS_START_SET(x) (((x) << SI_CS_START_LSB) & SI_CS_START_MASK) -#define SI_CS_RX_CNT_MSB 7 -#define SI_CS_RX_CNT_LSB 4 -#define SI_CS_RX_CNT_MASK 0x000000f0 -#define SI_CS_RX_CNT_GET(x) (((x) & SI_CS_RX_CNT_MASK) >> SI_CS_RX_CNT_LSB) -#define SI_CS_RX_CNT_SET(x) (((x) << SI_CS_RX_CNT_LSB) & SI_CS_RX_CNT_MASK) -#define SI_CS_TX_CNT_MSB 3 -#define SI_CS_TX_CNT_LSB 0 -#define SI_CS_TX_CNT_MASK 0x0000000f -#define SI_CS_TX_CNT_GET(x) (((x) & SI_CS_TX_CNT_MASK) >> SI_CS_TX_CNT_LSB) -#define SI_CS_TX_CNT_SET(x) (((x) << SI_CS_TX_CNT_LSB) & SI_CS_TX_CNT_MASK) - -#define SI_TX_DATA0_ADDRESS 0x00000008 -#define SI_TX_DATA0_OFFSET 0x00000008 -#define SI_TX_DATA0_DATA3_MSB 31 -#define SI_TX_DATA0_DATA3_LSB 24 -#define SI_TX_DATA0_DATA3_MASK 0xff000000 -#define SI_TX_DATA0_DATA3_GET(x) (((x) & SI_TX_DATA0_DATA3_MASK) >> SI_TX_DATA0_DATA3_LSB) -#define SI_TX_DATA0_DATA3_SET(x) (((x) << SI_TX_DATA0_DATA3_LSB) & SI_TX_DATA0_DATA3_MASK) -#define SI_TX_DATA0_DATA2_MSB 23 -#define SI_TX_DATA0_DATA2_LSB 16 -#define SI_TX_DATA0_DATA2_MASK 0x00ff0000 -#define SI_TX_DATA0_DATA2_GET(x) (((x) & SI_TX_DATA0_DATA2_MASK) >> SI_TX_DATA0_DATA2_LSB) -#define SI_TX_DATA0_DATA2_SET(x) (((x) << SI_TX_DATA0_DATA2_LSB) & SI_TX_DATA0_DATA2_MASK) -#define SI_TX_DATA0_DATA1_MSB 15 -#define SI_TX_DATA0_DATA1_LSB 8 -#define SI_TX_DATA0_DATA1_MASK 0x0000ff00 -#define SI_TX_DATA0_DATA1_GET(x) (((x) & SI_TX_DATA0_DATA1_MASK) >> SI_TX_DATA0_DATA1_LSB) -#define SI_TX_DATA0_DATA1_SET(x) (((x) << SI_TX_DATA0_DATA1_LSB) & SI_TX_DATA0_DATA1_MASK) -#define SI_TX_DATA0_DATA0_MSB 7 -#define SI_TX_DATA0_DATA0_LSB 0 -#define SI_TX_DATA0_DATA0_MASK 0x000000ff -#define SI_TX_DATA0_DATA0_GET(x) (((x) & SI_TX_DATA0_DATA0_MASK) >> SI_TX_DATA0_DATA0_LSB) -#define SI_TX_DATA0_DATA0_SET(x) (((x) << SI_TX_DATA0_DATA0_LSB) & SI_TX_DATA0_DATA0_MASK) - -#define SI_TX_DATA1_ADDRESS 0x0000000c -#define SI_TX_DATA1_OFFSET 0x0000000c -#define SI_TX_DATA1_DATA7_MSB 31 -#define SI_TX_DATA1_DATA7_LSB 24 -#define SI_TX_DATA1_DATA7_MASK 0xff000000 -#define SI_TX_DATA1_DATA7_GET(x) (((x) & SI_TX_DATA1_DATA7_MASK) >> SI_TX_DATA1_DATA7_LSB) -#define SI_TX_DATA1_DATA7_SET(x) (((x) << SI_TX_DATA1_DATA7_LSB) & SI_TX_DATA1_DATA7_MASK) -#define SI_TX_DATA1_DATA6_MSB 23 -#define SI_TX_DATA1_DATA6_LSB 16 -#define SI_TX_DATA1_DATA6_MASK 0x00ff0000 -#define SI_TX_DATA1_DATA6_GET(x) (((x) & SI_TX_DATA1_DATA6_MASK) >> SI_TX_DATA1_DATA6_LSB) -#define SI_TX_DATA1_DATA6_SET(x) (((x) << SI_TX_DATA1_DATA6_LSB) & SI_TX_DATA1_DATA6_MASK) -#define SI_TX_DATA1_DATA5_MSB 15 -#define SI_TX_DATA1_DATA5_LSB 8 -#define SI_TX_DATA1_DATA5_MASK 0x0000ff00 -#define SI_TX_DATA1_DATA5_GET(x) (((x) & SI_TX_DATA1_DATA5_MASK) >> SI_TX_DATA1_DATA5_LSB) -#define SI_TX_DATA1_DATA5_SET(x) (((x) << SI_TX_DATA1_DATA5_LSB) & SI_TX_DATA1_DATA5_MASK) -#define SI_TX_DATA1_DATA4_MSB 7 -#define SI_TX_DATA1_DATA4_LSB 0 -#define SI_TX_DATA1_DATA4_MASK 0x000000ff -#define SI_TX_DATA1_DATA4_GET(x) (((x) & SI_TX_DATA1_DATA4_MASK) >> SI_TX_DATA1_DATA4_LSB) -#define SI_TX_DATA1_DATA4_SET(x) (((x) << SI_TX_DATA1_DATA4_LSB) & SI_TX_DATA1_DATA4_MASK) - -#define SI_RX_DATA0_ADDRESS 0x00000010 -#define SI_RX_DATA0_OFFSET 0x00000010 -#define SI_RX_DATA0_DATA3_MSB 31 -#define SI_RX_DATA0_DATA3_LSB 24 -#define SI_RX_DATA0_DATA3_MASK 0xff000000 -#define SI_RX_DATA0_DATA3_GET(x) (((x) & SI_RX_DATA0_DATA3_MASK) >> SI_RX_DATA0_DATA3_LSB) -#define SI_RX_DATA0_DATA3_SET(x) (((x) << SI_RX_DATA0_DATA3_LSB) & SI_RX_DATA0_DATA3_MASK) -#define SI_RX_DATA0_DATA2_MSB 23 -#define SI_RX_DATA0_DATA2_LSB 16 -#define SI_RX_DATA0_DATA2_MASK 0x00ff0000 -#define SI_RX_DATA0_DATA2_GET(x) (((x) & SI_RX_DATA0_DATA2_MASK) >> SI_RX_DATA0_DATA2_LSB) -#define SI_RX_DATA0_DATA2_SET(x) (((x) << SI_RX_DATA0_DATA2_LSB) & SI_RX_DATA0_DATA2_MASK) -#define SI_RX_DATA0_DATA1_MSB 15 -#define SI_RX_DATA0_DATA1_LSB 8 -#define SI_RX_DATA0_DATA1_MASK 0x0000ff00 -#define SI_RX_DATA0_DATA1_GET(x) (((x) & SI_RX_DATA0_DATA1_MASK) >> SI_RX_DATA0_DATA1_LSB) -#define SI_RX_DATA0_DATA1_SET(x) (((x) << SI_RX_DATA0_DATA1_LSB) & SI_RX_DATA0_DATA1_MASK) -#define SI_RX_DATA0_DATA0_MSB 7 -#define SI_RX_DATA0_DATA0_LSB 0 -#define SI_RX_DATA0_DATA0_MASK 0x000000ff -#define SI_RX_DATA0_DATA0_GET(x) (((x) & SI_RX_DATA0_DATA0_MASK) >> SI_RX_DATA0_DATA0_LSB) -#define SI_RX_DATA0_DATA0_SET(x) (((x) << SI_RX_DATA0_DATA0_LSB) & SI_RX_DATA0_DATA0_MASK) - -#define SI_RX_DATA1_ADDRESS 0x00000014 -#define SI_RX_DATA1_OFFSET 0x00000014 -#define SI_RX_DATA1_DATA7_MSB 31 -#define SI_RX_DATA1_DATA7_LSB 24 -#define SI_RX_DATA1_DATA7_MASK 0xff000000 -#define SI_RX_DATA1_DATA7_GET(x) (((x) & SI_RX_DATA1_DATA7_MASK) >> SI_RX_DATA1_DATA7_LSB) -#define SI_RX_DATA1_DATA7_SET(x) (((x) << SI_RX_DATA1_DATA7_LSB) & SI_RX_DATA1_DATA7_MASK) -#define SI_RX_DATA1_DATA6_MSB 23 -#define SI_RX_DATA1_DATA6_LSB 16 -#define SI_RX_DATA1_DATA6_MASK 0x00ff0000 -#define SI_RX_DATA1_DATA6_GET(x) (((x) & SI_RX_DATA1_DATA6_MASK) >> SI_RX_DATA1_DATA6_LSB) -#define SI_RX_DATA1_DATA6_SET(x) (((x) << SI_RX_DATA1_DATA6_LSB) & SI_RX_DATA1_DATA6_MASK) -#define SI_RX_DATA1_DATA5_MSB 15 -#define SI_RX_DATA1_DATA5_LSB 8 -#define SI_RX_DATA1_DATA5_MASK 0x0000ff00 -#define SI_RX_DATA1_DATA5_GET(x) (((x) & SI_RX_DATA1_DATA5_MASK) >> SI_RX_DATA1_DATA5_LSB) -#define SI_RX_DATA1_DATA5_SET(x) (((x) << SI_RX_DATA1_DATA5_LSB) & SI_RX_DATA1_DATA5_MASK) -#define SI_RX_DATA1_DATA4_MSB 7 -#define SI_RX_DATA1_DATA4_LSB 0 -#define SI_RX_DATA1_DATA4_MASK 0x000000ff -#define SI_RX_DATA1_DATA4_GET(x) (((x) & SI_RX_DATA1_DATA4_MASK) >> SI_RX_DATA1_DATA4_LSB) -#define SI_RX_DATA1_DATA4_SET(x) (((x) << SI_RX_DATA1_DATA4_LSB) & SI_RX_DATA1_DATA4_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct si_reg_reg_s { - volatile unsigned int si_config; - volatile unsigned int si_cs; - volatile unsigned int si_tx_data0; - volatile unsigned int si_tx_data1; - volatile unsigned int si_rx_data0; - volatile unsigned int si_rx_data1; -} si_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _SI_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/si_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/si_reg.vrh deleted file mode 100644 index 10751ad46f80..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/si_reg.vrh +++ /dev/null @@ -1,278 +0,0 @@ -#ifndef _SI_REG_VRH_ -#define _SI_REG_VRH_ - -#define SI_CONFIG_ADDRESS 'h00000000 -#define SI_CONFIG_ERR_INT_MSB 19 -#define SI_CONFIG_ERR_INT_LSB 19 -#define SI_CONFIG_ERR_INT_MASK 'h00080000 -#define SI_CONFIG_ERR_INT_GET(x) (((x) & SI_CONFIG_ERR_INT_MASK) >> SI_CONFIG_ERR_INT_LSB) -#define SI_CONFIG_ERR_INT_SET(x) (((32'd0 | (x)) << SI_CONFIG_ERR_INT_LSB) & SI_CONFIG_ERR_INT_MASK) -#define SI_CONFIG_ERR_INT_RESET 1'h0 -#define SI_CONFIG_BIDIR_OD_DATA_MSB 18 -#define SI_CONFIG_BIDIR_OD_DATA_LSB 18 -#define SI_CONFIG_BIDIR_OD_DATA_MASK 'h00040000 -#define SI_CONFIG_BIDIR_OD_DATA_GET(x) (((x) & SI_CONFIG_BIDIR_OD_DATA_MASK) >> SI_CONFIG_BIDIR_OD_DATA_LSB) -#define SI_CONFIG_BIDIR_OD_DATA_SET(x) (((32'd0 | (x)) << SI_CONFIG_BIDIR_OD_DATA_LSB) & SI_CONFIG_BIDIR_OD_DATA_MASK) -#define SI_CONFIG_BIDIR_OD_DATA_RESET 1'h1 -#define SI_CONFIG_I2C_MSB 16 -#define SI_CONFIG_I2C_LSB 16 -#define SI_CONFIG_I2C_MASK 'h00010000 -#define SI_CONFIG_I2C_GET(x) (((x) & SI_CONFIG_I2C_MASK) >> SI_CONFIG_I2C_LSB) -#define SI_CONFIG_I2C_SET(x) (((32'd0 | (x)) << SI_CONFIG_I2C_LSB) & SI_CONFIG_I2C_MASK) -#define SI_CONFIG_I2C_RESET 1'h1 -#define SI_CONFIG_POS_SAMPLE_MSB 7 -#define SI_CONFIG_POS_SAMPLE_LSB 7 -#define SI_CONFIG_POS_SAMPLE_MASK 'h00000080 -#define SI_CONFIG_POS_SAMPLE_GET(x) (((x) & SI_CONFIG_POS_SAMPLE_MASK) >> SI_CONFIG_POS_SAMPLE_LSB) -#define SI_CONFIG_POS_SAMPLE_SET(x) (((32'd0 | (x)) << SI_CONFIG_POS_SAMPLE_LSB) & SI_CONFIG_POS_SAMPLE_MASK) -#define SI_CONFIG_POS_SAMPLE_RESET 1'h1 -#define SI_CONFIG_POS_DRIVE_MSB 6 -#define SI_CONFIG_POS_DRIVE_LSB 6 -#define SI_CONFIG_POS_DRIVE_MASK 'h00000040 -#define SI_CONFIG_POS_DRIVE_GET(x) (((x) & SI_CONFIG_POS_DRIVE_MASK) >> SI_CONFIG_POS_DRIVE_LSB) -#define SI_CONFIG_POS_DRIVE_SET(x) (((32'd0 | (x)) << SI_CONFIG_POS_DRIVE_LSB) & SI_CONFIG_POS_DRIVE_MASK) -#define SI_CONFIG_POS_DRIVE_RESET 1'h0 -#define SI_CONFIG_INACTIVE_DATA_MSB 5 -#define SI_CONFIG_INACTIVE_DATA_LSB 5 -#define SI_CONFIG_INACTIVE_DATA_MASK 'h00000020 -#define SI_CONFIG_INACTIVE_DATA_GET(x) (((x) & SI_CONFIG_INACTIVE_DATA_MASK) >> SI_CONFIG_INACTIVE_DATA_LSB) -#define SI_CONFIG_INACTIVE_DATA_SET(x) (((32'd0 | (x)) << SI_CONFIG_INACTIVE_DATA_LSB) & SI_CONFIG_INACTIVE_DATA_MASK) -#define SI_CONFIG_INACTIVE_DATA_RESET 1'h1 -#define SI_CONFIG_INACTIVE_CLK_MSB 4 -#define SI_CONFIG_INACTIVE_CLK_LSB 4 -#define SI_CONFIG_INACTIVE_CLK_MASK 'h00000010 -#define SI_CONFIG_INACTIVE_CLK_GET(x) (((x) & SI_CONFIG_INACTIVE_CLK_MASK) >> SI_CONFIG_INACTIVE_CLK_LSB) -#define SI_CONFIG_INACTIVE_CLK_SET(x) (((32'd0 | (x)) << SI_CONFIG_INACTIVE_CLK_LSB) & SI_CONFIG_INACTIVE_CLK_MASK) -#define SI_CONFIG_INACTIVE_CLK_RESET 1'h1 -#define SI_CONFIG_DIVIDER_MSB 3 -#define SI_CONFIG_DIVIDER_LSB 0 -#define SI_CONFIG_DIVIDER_MASK 'h0000000f -#define SI_CONFIG_DIVIDER_GET(x) (((x) & SI_CONFIG_DIVIDER_MASK) >> SI_CONFIG_DIVIDER_LSB) -#define SI_CONFIG_DIVIDER_SET(x) (((32'd0 | (x)) << SI_CONFIG_DIVIDER_LSB) & SI_CONFIG_DIVIDER_MASK) -#define SI_CONFIG_DIVIDER_RESET 4'h0 -#define SI_CONFIG_RESET (32'h0 | \ - SI_CONFIG_ERR_INT_SET(SI_CONFIG_ERR_INT_RESET) | \ - SI_CONFIG_BIDIR_OD_DATA_SET(SI_CONFIG_BIDIR_OD_DATA_RESET) | \ - SI_CONFIG_I2C_SET(SI_CONFIG_I2C_RESET) | \ - SI_CONFIG_POS_SAMPLE_SET(SI_CONFIG_POS_SAMPLE_RESET) | \ - SI_CONFIG_POS_DRIVE_SET(SI_CONFIG_POS_DRIVE_RESET) | \ - SI_CONFIG_INACTIVE_DATA_SET(SI_CONFIG_INACTIVE_DATA_RESET) | \ - SI_CONFIG_INACTIVE_CLK_SET(SI_CONFIG_INACTIVE_CLK_RESET) | \ - SI_CONFIG_DIVIDER_SET(SI_CONFIG_DIVIDER_RESET)) -#define SI_CONFIG_HW_MASK (32'h0) -#define SI_CONFIG_SW_MASK (32'h0 | \ - SI_CONFIG_ERR_INT_MASK | \ - SI_CONFIG_BIDIR_OD_DATA_MASK | \ - SI_CONFIG_I2C_MASK | \ - SI_CONFIG_POS_SAMPLE_MASK | \ - SI_CONFIG_POS_DRIVE_MASK | \ - SI_CONFIG_INACTIVE_DATA_MASK | \ - SI_CONFIG_INACTIVE_CLK_MASK | \ - SI_CONFIG_DIVIDER_MASK) - -#define SI_CS_ADDRESS 'h00000004 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_MSB 13 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_LSB 11 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_MASK 'h00003800 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_GET(x) (((x) & SI_CS_BIT_CNT_IN_LAST_BYTE_MASK) >> SI_CS_BIT_CNT_IN_LAST_BYTE_LSB) -#define SI_CS_BIT_CNT_IN_LAST_BYTE_SET(x) (((32'd0 | (x)) << SI_CS_BIT_CNT_IN_LAST_BYTE_LSB) & SI_CS_BIT_CNT_IN_LAST_BYTE_MASK) -#define SI_CS_BIT_CNT_IN_LAST_BYTE_RESET 3'h0 -#define SI_CS_DONE_ERR_MSB 10 -#define SI_CS_DONE_ERR_LSB 10 -#define SI_CS_DONE_ERR_MASK 'h00000400 -#define SI_CS_DONE_ERR_GET(x) (((x) & SI_CS_DONE_ERR_MASK) >> SI_CS_DONE_ERR_LSB) -#define SI_CS_DONE_ERR_SET(x) (((32'd0 | (x)) << SI_CS_DONE_ERR_LSB) & SI_CS_DONE_ERR_MASK) -#define SI_CS_DONE_ERR_RESET 1'h0 -#define SI_CS_DONE_INT_MSB 9 -#define SI_CS_DONE_INT_LSB 9 -#define SI_CS_DONE_INT_MASK 'h00000200 -#define SI_CS_DONE_INT_GET(x) (((x) & SI_CS_DONE_INT_MASK) >> SI_CS_DONE_INT_LSB) -#define SI_CS_DONE_INT_SET(x) (((32'd0 | (x)) << SI_CS_DONE_INT_LSB) & SI_CS_DONE_INT_MASK) -#define SI_CS_DONE_INT_RESET 1'h0 -#define SI_CS_START_MSB 8 -#define SI_CS_START_LSB 8 -#define SI_CS_START_MASK 'h00000100 -#define SI_CS_START_GET(x) (((x) & SI_CS_START_MASK) >> SI_CS_START_LSB) -#define SI_CS_START_SET(x) (((32'd0 | (x)) << SI_CS_START_LSB) & SI_CS_START_MASK) -#define SI_CS_START_RESET 1'h0 -#define SI_CS_RX_CNT_MSB 7 -#define SI_CS_RX_CNT_LSB 4 -#define SI_CS_RX_CNT_MASK 'h000000f0 -#define SI_CS_RX_CNT_GET(x) (((x) & SI_CS_RX_CNT_MASK) >> SI_CS_RX_CNT_LSB) -#define SI_CS_RX_CNT_SET(x) (((32'd0 | (x)) << SI_CS_RX_CNT_LSB) & SI_CS_RX_CNT_MASK) -#define SI_CS_RX_CNT_RESET 4'h0 -#define SI_CS_TX_CNT_MSB 3 -#define SI_CS_TX_CNT_LSB 0 -#define SI_CS_TX_CNT_MASK 'h0000000f -#define SI_CS_TX_CNT_GET(x) (((x) & SI_CS_TX_CNT_MASK) >> SI_CS_TX_CNT_LSB) -#define SI_CS_TX_CNT_SET(x) (((32'd0 | (x)) << SI_CS_TX_CNT_LSB) & SI_CS_TX_CNT_MASK) -#define SI_CS_TX_CNT_RESET 4'h0 -#define SI_CS_RESET (32'h0 | \ - SI_CS_BIT_CNT_IN_LAST_BYTE_SET(SI_CS_BIT_CNT_IN_LAST_BYTE_RESET) | \ - SI_CS_DONE_ERR_SET(SI_CS_DONE_ERR_RESET) | \ - SI_CS_DONE_INT_SET(SI_CS_DONE_INT_RESET) | \ - SI_CS_START_SET(SI_CS_START_RESET) | \ - SI_CS_RX_CNT_SET(SI_CS_RX_CNT_RESET) | \ - SI_CS_TX_CNT_SET(SI_CS_TX_CNT_RESET)) -#define SI_CS_HW_MASK (32'h0 | \ - SI_CS_DONE_ERR_MASK | \ - SI_CS_DONE_INT_MASK | \ - SI_CS_START_MASK) -#define SI_CS_SW_MASK (32'h0 | \ - SI_CS_BIT_CNT_IN_LAST_BYTE_MASK | \ - SI_CS_DONE_INT_MASK | \ - SI_CS_START_MASK | \ - SI_CS_RX_CNT_MASK | \ - SI_CS_TX_CNT_MASK) - -#define SI_TX_DATA0_ADDRESS 'h00000008 -#define SI_TX_DATA0_DATA3_MSB 31 -#define SI_TX_DATA0_DATA3_LSB 24 -#define SI_TX_DATA0_DATA3_MASK 'hff000000 -#define SI_TX_DATA0_DATA3_GET(x) (((x) & SI_TX_DATA0_DATA3_MASK) >> SI_TX_DATA0_DATA3_LSB) -#define SI_TX_DATA0_DATA3_SET(x) (((32'd0 | (x)) << SI_TX_DATA0_DATA3_LSB) & SI_TX_DATA0_DATA3_MASK) -#define SI_TX_DATA0_DATA3_RESET 8'h0 -#define SI_TX_DATA0_DATA2_MSB 23 -#define SI_TX_DATA0_DATA2_LSB 16 -#define SI_TX_DATA0_DATA2_MASK 'h00ff0000 -#define SI_TX_DATA0_DATA2_GET(x) (((x) & SI_TX_DATA0_DATA2_MASK) >> SI_TX_DATA0_DATA2_LSB) -#define SI_TX_DATA0_DATA2_SET(x) (((32'd0 | (x)) << SI_TX_DATA0_DATA2_LSB) & SI_TX_DATA0_DATA2_MASK) -#define SI_TX_DATA0_DATA2_RESET 8'h0 -#define SI_TX_DATA0_DATA1_MSB 15 -#define SI_TX_DATA0_DATA1_LSB 8 -#define SI_TX_DATA0_DATA1_MASK 'h0000ff00 -#define SI_TX_DATA0_DATA1_GET(x) (((x) & SI_TX_DATA0_DATA1_MASK) >> SI_TX_DATA0_DATA1_LSB) -#define SI_TX_DATA0_DATA1_SET(x) (((32'd0 | (x)) << SI_TX_DATA0_DATA1_LSB) & SI_TX_DATA0_DATA1_MASK) -#define SI_TX_DATA0_DATA1_RESET 8'h0 -#define SI_TX_DATA0_DATA0_MSB 7 -#define SI_TX_DATA0_DATA0_LSB 0 -#define SI_TX_DATA0_DATA0_MASK 'h000000ff -#define SI_TX_DATA0_DATA0_GET(x) (((x) & SI_TX_DATA0_DATA0_MASK) >> SI_TX_DATA0_DATA0_LSB) -#define SI_TX_DATA0_DATA0_SET(x) (((32'd0 | (x)) << SI_TX_DATA0_DATA0_LSB) & SI_TX_DATA0_DATA0_MASK) -#define SI_TX_DATA0_DATA0_RESET 8'h0 -#define SI_TX_DATA0_RESET (32'h0 | \ - SI_TX_DATA0_DATA3_SET(SI_TX_DATA0_DATA3_RESET) | \ - SI_TX_DATA0_DATA2_SET(SI_TX_DATA0_DATA2_RESET) | \ - SI_TX_DATA0_DATA1_SET(SI_TX_DATA0_DATA1_RESET) | \ - SI_TX_DATA0_DATA0_SET(SI_TX_DATA0_DATA0_RESET)) -#define SI_TX_DATA0_HW_MASK (32'h0) -#define SI_TX_DATA0_SW_MASK (32'h0 | \ - SI_TX_DATA0_DATA3_MASK | \ - SI_TX_DATA0_DATA2_MASK | \ - SI_TX_DATA0_DATA1_MASK | \ - SI_TX_DATA0_DATA0_MASK) - -#define SI_TX_DATA1_ADDRESS 'h0000000c -#define SI_TX_DATA1_DATA7_MSB 31 -#define SI_TX_DATA1_DATA7_LSB 24 -#define SI_TX_DATA1_DATA7_MASK 'hff000000 -#define SI_TX_DATA1_DATA7_GET(x) (((x) & SI_TX_DATA1_DATA7_MASK) >> SI_TX_DATA1_DATA7_LSB) -#define SI_TX_DATA1_DATA7_SET(x) (((32'd0 | (x)) << SI_TX_DATA1_DATA7_LSB) & SI_TX_DATA1_DATA7_MASK) -#define SI_TX_DATA1_DATA7_RESET 8'h0 -#define SI_TX_DATA1_DATA6_MSB 23 -#define SI_TX_DATA1_DATA6_LSB 16 -#define SI_TX_DATA1_DATA6_MASK 'h00ff0000 -#define SI_TX_DATA1_DATA6_GET(x) (((x) & SI_TX_DATA1_DATA6_MASK) >> SI_TX_DATA1_DATA6_LSB) -#define SI_TX_DATA1_DATA6_SET(x) (((32'd0 | (x)) << SI_TX_DATA1_DATA6_LSB) & SI_TX_DATA1_DATA6_MASK) -#define SI_TX_DATA1_DATA6_RESET 8'h0 -#define SI_TX_DATA1_DATA5_MSB 15 -#define SI_TX_DATA1_DATA5_LSB 8 -#define SI_TX_DATA1_DATA5_MASK 'h0000ff00 -#define SI_TX_DATA1_DATA5_GET(x) (((x) & SI_TX_DATA1_DATA5_MASK) >> SI_TX_DATA1_DATA5_LSB) -#define SI_TX_DATA1_DATA5_SET(x) (((32'd0 | (x)) << SI_TX_DATA1_DATA5_LSB) & SI_TX_DATA1_DATA5_MASK) -#define SI_TX_DATA1_DATA5_RESET 8'h0 -#define SI_TX_DATA1_DATA4_MSB 7 -#define SI_TX_DATA1_DATA4_LSB 0 -#define SI_TX_DATA1_DATA4_MASK 'h000000ff -#define SI_TX_DATA1_DATA4_GET(x) (((x) & SI_TX_DATA1_DATA4_MASK) >> SI_TX_DATA1_DATA4_LSB) -#define SI_TX_DATA1_DATA4_SET(x) (((32'd0 | (x)) << SI_TX_DATA1_DATA4_LSB) & SI_TX_DATA1_DATA4_MASK) -#define SI_TX_DATA1_DATA4_RESET 8'h0 -#define SI_TX_DATA1_RESET (32'h0 | \ - SI_TX_DATA1_DATA7_SET(SI_TX_DATA1_DATA7_RESET) | \ - SI_TX_DATA1_DATA6_SET(SI_TX_DATA1_DATA6_RESET) | \ - SI_TX_DATA1_DATA5_SET(SI_TX_DATA1_DATA5_RESET) | \ - SI_TX_DATA1_DATA4_SET(SI_TX_DATA1_DATA4_RESET)) -#define SI_TX_DATA1_HW_MASK (32'h0) -#define SI_TX_DATA1_SW_MASK (32'h0 | \ - SI_TX_DATA1_DATA7_MASK | \ - SI_TX_DATA1_DATA6_MASK | \ - SI_TX_DATA1_DATA5_MASK | \ - SI_TX_DATA1_DATA4_MASK) - -#define SI_RX_DATA0_ADDRESS 'h00000010 -#define SI_RX_DATA0_DATA3_MSB 31 -#define SI_RX_DATA0_DATA3_LSB 24 -#define SI_RX_DATA0_DATA3_MASK 'hff000000 -#define SI_RX_DATA0_DATA3_GET(x) (((x) & SI_RX_DATA0_DATA3_MASK) >> SI_RX_DATA0_DATA3_LSB) -#define SI_RX_DATA0_DATA3_SET(x) (((32'd0 | (x)) << SI_RX_DATA0_DATA3_LSB) & SI_RX_DATA0_DATA3_MASK) -#define SI_RX_DATA0_DATA3_RESET 8'h0 -#define SI_RX_DATA0_DATA2_MSB 23 -#define SI_RX_DATA0_DATA2_LSB 16 -#define SI_RX_DATA0_DATA2_MASK 'h00ff0000 -#define SI_RX_DATA0_DATA2_GET(x) (((x) & SI_RX_DATA0_DATA2_MASK) >> SI_RX_DATA0_DATA2_LSB) -#define SI_RX_DATA0_DATA2_SET(x) (((32'd0 | (x)) << SI_RX_DATA0_DATA2_LSB) & SI_RX_DATA0_DATA2_MASK) -#define SI_RX_DATA0_DATA2_RESET 8'h0 -#define SI_RX_DATA0_DATA1_MSB 15 -#define SI_RX_DATA0_DATA1_LSB 8 -#define SI_RX_DATA0_DATA1_MASK 'h0000ff00 -#define SI_RX_DATA0_DATA1_GET(x) (((x) & SI_RX_DATA0_DATA1_MASK) >> SI_RX_DATA0_DATA1_LSB) -#define SI_RX_DATA0_DATA1_SET(x) (((32'd0 | (x)) << SI_RX_DATA0_DATA1_LSB) & SI_RX_DATA0_DATA1_MASK) -#define SI_RX_DATA0_DATA1_RESET 8'h0 -#define SI_RX_DATA0_DATA0_MSB 7 -#define SI_RX_DATA0_DATA0_LSB 0 -#define SI_RX_DATA0_DATA0_MASK 'h000000ff -#define SI_RX_DATA0_DATA0_GET(x) (((x) & SI_RX_DATA0_DATA0_MASK) >> SI_RX_DATA0_DATA0_LSB) -#define SI_RX_DATA0_DATA0_SET(x) (((32'd0 | (x)) << SI_RX_DATA0_DATA0_LSB) & SI_RX_DATA0_DATA0_MASK) -#define SI_RX_DATA0_DATA0_RESET 8'h0 -#define SI_RX_DATA0_RESET (32'h0 | \ - SI_RX_DATA0_DATA3_SET(SI_RX_DATA0_DATA3_RESET) | \ - SI_RX_DATA0_DATA2_SET(SI_RX_DATA0_DATA2_RESET) | \ - SI_RX_DATA0_DATA1_SET(SI_RX_DATA0_DATA1_RESET) | \ - SI_RX_DATA0_DATA0_SET(SI_RX_DATA0_DATA0_RESET)) -#define SI_RX_DATA0_HW_MASK (32'h0 | \ - SI_RX_DATA0_DATA3_MASK | \ - SI_RX_DATA0_DATA2_MASK | \ - SI_RX_DATA0_DATA1_MASK | \ - SI_RX_DATA0_DATA0_MASK) -#define SI_RX_DATA0_SW_MASK (32'h0) - -#define SI_RX_DATA1_ADDRESS 'h00000014 -#define SI_RX_DATA1_DATA7_MSB 31 -#define SI_RX_DATA1_DATA7_LSB 24 -#define SI_RX_DATA1_DATA7_MASK 'hff000000 -#define SI_RX_DATA1_DATA7_GET(x) (((x) & SI_RX_DATA1_DATA7_MASK) >> SI_RX_DATA1_DATA7_LSB) -#define SI_RX_DATA1_DATA7_SET(x) (((32'd0 | (x)) << SI_RX_DATA1_DATA7_LSB) & SI_RX_DATA1_DATA7_MASK) -#define SI_RX_DATA1_DATA7_RESET 8'h0 -#define SI_RX_DATA1_DATA6_MSB 23 -#define SI_RX_DATA1_DATA6_LSB 16 -#define SI_RX_DATA1_DATA6_MASK 'h00ff0000 -#define SI_RX_DATA1_DATA6_GET(x) (((x) & SI_RX_DATA1_DATA6_MASK) >> SI_RX_DATA1_DATA6_LSB) -#define SI_RX_DATA1_DATA6_SET(x) (((32'd0 | (x)) << SI_RX_DATA1_DATA6_LSB) & SI_RX_DATA1_DATA6_MASK) -#define SI_RX_DATA1_DATA6_RESET 8'h0 -#define SI_RX_DATA1_DATA5_MSB 15 -#define SI_RX_DATA1_DATA5_LSB 8 -#define SI_RX_DATA1_DATA5_MASK 'h0000ff00 -#define SI_RX_DATA1_DATA5_GET(x) (((x) & SI_RX_DATA1_DATA5_MASK) >> SI_RX_DATA1_DATA5_LSB) -#define SI_RX_DATA1_DATA5_SET(x) (((32'd0 | (x)) << SI_RX_DATA1_DATA5_LSB) & SI_RX_DATA1_DATA5_MASK) -#define SI_RX_DATA1_DATA5_RESET 8'h0 -#define SI_RX_DATA1_DATA4_MSB 7 -#define SI_RX_DATA1_DATA4_LSB 0 -#define SI_RX_DATA1_DATA4_MASK 'h000000ff -#define SI_RX_DATA1_DATA4_GET(x) (((x) & SI_RX_DATA1_DATA4_MASK) >> SI_RX_DATA1_DATA4_LSB) -#define SI_RX_DATA1_DATA4_SET(x) (((32'd0 | (x)) << SI_RX_DATA1_DATA4_LSB) & SI_RX_DATA1_DATA4_MASK) -#define SI_RX_DATA1_DATA4_RESET 8'h0 -#define SI_RX_DATA1_RESET (32'h0 | \ - SI_RX_DATA1_DATA7_SET(SI_RX_DATA1_DATA7_RESET) | \ - SI_RX_DATA1_DATA6_SET(SI_RX_DATA1_DATA6_RESET) | \ - SI_RX_DATA1_DATA5_SET(SI_RX_DATA1_DATA5_RESET) | \ - SI_RX_DATA1_DATA4_SET(SI_RX_DATA1_DATA4_RESET)) -#define SI_RX_DATA1_HW_MASK (32'h0 | \ - SI_RX_DATA1_DATA7_MASK | \ - SI_RX_DATA1_DATA6_MASK | \ - SI_RX_DATA1_DATA5_MASK | \ - SI_RX_DATA1_DATA4_MASK) -#define SI_RX_DATA1_SW_MASK (32'h0) - -#define SI_REG_ADDRESS_MSB 4 - -#endif /* _SI_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/synth_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/synth_reg.h deleted file mode 100644 index 2cdbc0d86b82..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/synth_reg.h +++ /dev/null @@ -1,599 +0,0 @@ -#ifndef _SYNTH_REG_REG_H_ -#define _SYNTH_REG_REG_H_ - -#define SYNTH_SYNTH1_ADDRESS 0x00000000 -#define SYNTH_SYNTH1_OFFSET 0x00000000 -#define SYNTH_SYNTH1_PWD_BIAS_MSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_LSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_MASK 0x80000000 -#define SYNTH_SYNTH1_PWD_BIAS_GET(x) (((x) & SYNTH_SYNTH1_PWD_BIAS_MASK) >> SYNTH_SYNTH1_PWD_BIAS_LSB) -#define SYNTH_SYNTH1_PWD_BIAS_SET(x) (((x) << SYNTH_SYNTH1_PWD_BIAS_LSB) & SYNTH_SYNTH1_PWD_BIAS_MASK) -#define SYNTH_SYNTH1_PWD_CP_MSB 30 -#define SYNTH_SYNTH1_PWD_CP_LSB 30 -#define SYNTH_SYNTH1_PWD_CP_MASK 0x40000000 -#define SYNTH_SYNTH1_PWD_CP_GET(x) (((x) & SYNTH_SYNTH1_PWD_CP_MASK) >> SYNTH_SYNTH1_PWD_CP_LSB) -#define SYNTH_SYNTH1_PWD_CP_SET(x) (((x) << SYNTH_SYNTH1_PWD_CP_LSB) & SYNTH_SYNTH1_PWD_CP_MASK) -#define SYNTH_SYNTH1_PWD_VCMON_MSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_LSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_MASK 0x20000000 -#define SYNTH_SYNTH1_PWD_VCMON_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCMON_MASK) >> SYNTH_SYNTH1_PWD_VCMON_LSB) -#define SYNTH_SYNTH1_PWD_VCMON_SET(x) (((x) << SYNTH_SYNTH1_PWD_VCMON_LSB) & SYNTH_SYNTH1_PWD_VCMON_MASK) -#define SYNTH_SYNTH1_PWD_VCO_MSB 28 -#define SYNTH_SYNTH1_PWD_VCO_LSB 28 -#define SYNTH_SYNTH1_PWD_VCO_MASK 0x10000000 -#define SYNTH_SYNTH1_PWD_VCO_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCO_MASK) >> SYNTH_SYNTH1_PWD_VCO_LSB) -#define SYNTH_SYNTH1_PWD_VCO_SET(x) (((x) << SYNTH_SYNTH1_PWD_VCO_LSB) & SYNTH_SYNTH1_PWD_VCO_MASK) -#define SYNTH_SYNTH1_PWD_PRESC_MSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_LSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_MASK 0x08000000 -#define SYNTH_SYNTH1_PWD_PRESC_GET(x) (((x) & SYNTH_SYNTH1_PWD_PRESC_MASK) >> SYNTH_SYNTH1_PWD_PRESC_LSB) -#define SYNTH_SYNTH1_PWD_PRESC_SET(x) (((x) << SYNTH_SYNTH1_PWD_PRESC_LSB) & SYNTH_SYNTH1_PWD_PRESC_MASK) -#define SYNTH_SYNTH1_PWD_LODIV_MSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_LSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_MASK 0x04000000 -#define SYNTH_SYNTH1_PWD_LODIV_GET(x) (((x) & SYNTH_SYNTH1_PWD_LODIV_MASK) >> SYNTH_SYNTH1_PWD_LODIV_LSB) -#define SYNTH_SYNTH1_PWD_LODIV_SET(x) (((x) << SYNTH_SYNTH1_PWD_LODIV_LSB) & SYNTH_SYNTH1_PWD_LODIV_MASK) -#define SYNTH_SYNTH1_PWD_LOMIX_MSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_LSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_MASK 0x02000000 -#define SYNTH_SYNTH1_PWD_LOMIX_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOMIX_MASK) >> SYNTH_SYNTH1_PWD_LOMIX_LSB) -#define SYNTH_SYNTH1_PWD_LOMIX_SET(x) (((x) << SYNTH_SYNTH1_PWD_LOMIX_LSB) & SYNTH_SYNTH1_PWD_LOMIX_MASK) -#define SYNTH_SYNTH1_FORCE_LO_ON_MSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_LSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_MASK 0x01000000 -#define SYNTH_SYNTH1_FORCE_LO_ON_GET(x) (((x) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) >> SYNTH_SYNTH1_FORCE_LO_ON_LSB) -#define SYNTH_SYNTH1_FORCE_LO_ON_SET(x) (((x) << SYNTH_SYNTH1_FORCE_LO_ON_LSB) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) -#define SYNTH_SYNTH1_PWD_LOBUF5G_MSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_LSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_MASK 0x00800000 -#define SYNTH_SYNTH1_PWD_LOBUF5G_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) >> SYNTH_SYNTH1_PWD_LOBUF5G_LSB) -#define SYNTH_SYNTH1_PWD_LOBUF5G_SET(x) (((x) << SYNTH_SYNTH1_PWD_LOBUF5G_LSB) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) -#define SYNTH_SYNTH1_VCOREGBYPASS_MSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_LSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_MASK 0x00400000 -#define SYNTH_SYNTH1_VCOREGBYPASS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) >> SYNTH_SYNTH1_VCOREGBYPASS_LSB) -#define SYNTH_SYNTH1_VCOREGBYPASS_SET(x) (((x) << SYNTH_SYNTH1_VCOREGBYPASS_LSB) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) -#define SYNTH_SYNTH1_VCOREGLEVEL_MSB 21 -#define SYNTH_SYNTH1_VCOREGLEVEL_LSB 20 -#define SYNTH_SYNTH1_VCOREGLEVEL_MASK 0x00300000 -#define SYNTH_SYNTH1_VCOREGLEVEL_GET(x) (((x) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) >> SYNTH_SYNTH1_VCOREGLEVEL_LSB) -#define SYNTH_SYNTH1_VCOREGLEVEL_SET(x) (((x) << SYNTH_SYNTH1_VCOREGLEVEL_LSB) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) -#define SYNTH_SYNTH1_VCOREGBIAS_MSB 19 -#define SYNTH_SYNTH1_VCOREGBIAS_LSB 18 -#define SYNTH_SYNTH1_VCOREGBIAS_MASK 0x000c0000 -#define SYNTH_SYNTH1_VCOREGBIAS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBIAS_MASK) >> SYNTH_SYNTH1_VCOREGBIAS_LSB) -#define SYNTH_SYNTH1_VCOREGBIAS_SET(x) (((x) << SYNTH_SYNTH1_VCOREGBIAS_LSB) & SYNTH_SYNTH1_VCOREGBIAS_MASK) -#define SYNTH_SYNTH1_SLIDINGIF_MSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_LSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_MASK 0x00020000 -#define SYNTH_SYNTH1_SLIDINGIF_GET(x) (((x) & SYNTH_SYNTH1_SLIDINGIF_MASK) >> SYNTH_SYNTH1_SLIDINGIF_LSB) -#define SYNTH_SYNTH1_SLIDINGIF_SET(x) (((x) << SYNTH_SYNTH1_SLIDINGIF_LSB) & SYNTH_SYNTH1_SLIDINGIF_MASK) -#define SYNTH_SYNTH1_SPARE_PWD_MSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_LSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_MASK 0x00010000 -#define SYNTH_SYNTH1_SPARE_PWD_GET(x) (((x) & SYNTH_SYNTH1_SPARE_PWD_MASK) >> SYNTH_SYNTH1_SPARE_PWD_LSB) -#define SYNTH_SYNTH1_SPARE_PWD_SET(x) (((x) << SYNTH_SYNTH1_SPARE_PWD_LSB) & SYNTH_SYNTH1_SPARE_PWD_MASK) -#define SYNTH_SYNTH1_CON_VDDVCOREG_MSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_LSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_MASK 0x00008000 -#define SYNTH_SYNTH1_CON_VDDVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) >> SYNTH_SYNTH1_CON_VDDVCOREG_LSB) -#define SYNTH_SYNTH1_CON_VDDVCOREG_SET(x) (((x) << SYNTH_SYNTH1_CON_VDDVCOREG_LSB) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) -#define SYNTH_SYNTH1_CON_IVCOREG_MSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_LSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_MASK 0x00004000 -#define SYNTH_SYNTH1_CON_IVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOREG_MASK) >> SYNTH_SYNTH1_CON_IVCOREG_LSB) -#define SYNTH_SYNTH1_CON_IVCOREG_SET(x) (((x) << SYNTH_SYNTH1_CON_IVCOREG_LSB) & SYNTH_SYNTH1_CON_IVCOREG_MASK) -#define SYNTH_SYNTH1_CON_IVCOBUF_MSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_LSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_MASK 0x00002000 -#define SYNTH_SYNTH1_CON_IVCOBUF_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) >> SYNTH_SYNTH1_CON_IVCOBUF_LSB) -#define SYNTH_SYNTH1_CON_IVCOBUF_SET(x) (((x) << SYNTH_SYNTH1_CON_IVCOBUF_LSB) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) -#define SYNTH_SYNTH1_SEL_VCMONABUS_MSB 12 -#define SYNTH_SYNTH1_SEL_VCMONABUS_LSB 10 -#define SYNTH_SYNTH1_SEL_VCMONABUS_MASK 0x00001c00 -#define SYNTH_SYNTH1_SEL_VCMONABUS_GET(x) (((x) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) >> SYNTH_SYNTH1_SEL_VCMONABUS_LSB) -#define SYNTH_SYNTH1_SEL_VCMONABUS_SET(x) (((x) << SYNTH_SYNTH1_SEL_VCMONABUS_LSB) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK 0x00000200 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) >> SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_LSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MASK 0x00000100 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) >> SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK 0x00000080 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK 0x00000040 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_MSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_LSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_MASK 0x00000020 -#define SYNTH_SYNTH1_MONITOR_FB_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_MASK) >> SYNTH_SYNTH1_MONITOR_FB_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_FB_LSB) & SYNTH_SYNTH1_MONITOR_FB_MASK) -#define SYNTH_SYNTH1_MONITOR_REF_MSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_LSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_MASK 0x00000010 -#define SYNTH_SYNTH1_MONITOR_REF_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_REF_MASK) >> SYNTH_SYNTH1_MONITOR_REF_LSB) -#define SYNTH_SYNTH1_MONITOR_REF_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_REF_LSB) & SYNTH_SYNTH1_MONITOR_REF_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK 0x00000008 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) >> SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK 0x00000004 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) >> SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_LSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MASK 0x00000002 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) >> SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK 0x00000001 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) >> SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) - -#define SYNTH_SYNTH2_ADDRESS 0x00000004 -#define SYNTH_SYNTH2_OFFSET 0x00000004 -#define SYNTH_SYNTH2_VC_CAL_REF_MSB 31 -#define SYNTH_SYNTH2_VC_CAL_REF_LSB 29 -#define SYNTH_SYNTH2_VC_CAL_REF_MASK 0xe0000000 -#define SYNTH_SYNTH2_VC_CAL_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_CAL_REF_MASK) >> SYNTH_SYNTH2_VC_CAL_REF_LSB) -#define SYNTH_SYNTH2_VC_CAL_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_CAL_REF_LSB) & SYNTH_SYNTH2_VC_CAL_REF_MASK) -#define SYNTH_SYNTH2_VC_HI_REF_MSB 28 -#define SYNTH_SYNTH2_VC_HI_REF_LSB 26 -#define SYNTH_SYNTH2_VC_HI_REF_MASK 0x1c000000 -#define SYNTH_SYNTH2_VC_HI_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_HI_REF_MASK) >> SYNTH_SYNTH2_VC_HI_REF_LSB) -#define SYNTH_SYNTH2_VC_HI_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_HI_REF_LSB) & SYNTH_SYNTH2_VC_HI_REF_MASK) -#define SYNTH_SYNTH2_VC_MID_REF_MSB 25 -#define SYNTH_SYNTH2_VC_MID_REF_LSB 23 -#define SYNTH_SYNTH2_VC_MID_REF_MASK 0x03800000 -#define SYNTH_SYNTH2_VC_MID_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_MID_REF_MASK) >> SYNTH_SYNTH2_VC_MID_REF_LSB) -#define SYNTH_SYNTH2_VC_MID_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_MID_REF_LSB) & SYNTH_SYNTH2_VC_MID_REF_MASK) -#define SYNTH_SYNTH2_VC_LOW_REF_MSB 22 -#define SYNTH_SYNTH2_VC_LOW_REF_LSB 20 -#define SYNTH_SYNTH2_VC_LOW_REF_MASK 0x00700000 -#define SYNTH_SYNTH2_VC_LOW_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_LOW_REF_MASK) >> SYNTH_SYNTH2_VC_LOW_REF_LSB) -#define SYNTH_SYNTH2_VC_LOW_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_LOW_REF_LSB) & SYNTH_SYNTH2_VC_LOW_REF_MASK) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MSB 19 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB 15 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK 0x000f8000 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_GET(x) (((x) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) >> SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_SET(x) (((x) << SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) -#define SYNTH_SYNTH2_LOOP_CP_MSB 14 -#define SYNTH_SYNTH2_LOOP_CP_LSB 10 -#define SYNTH_SYNTH2_LOOP_CP_MASK 0x00007c00 -#define SYNTH_SYNTH2_LOOP_CP_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CP_MASK) >> SYNTH_SYNTH2_LOOP_CP_LSB) -#define SYNTH_SYNTH2_LOOP_CP_SET(x) (((x) << SYNTH_SYNTH2_LOOP_CP_LSB) & SYNTH_SYNTH2_LOOP_CP_MASK) -#define SYNTH_SYNTH2_LOOP_RS_MSB 9 -#define SYNTH_SYNTH2_LOOP_RS_LSB 5 -#define SYNTH_SYNTH2_LOOP_RS_MASK 0x000003e0 -#define SYNTH_SYNTH2_LOOP_RS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_RS_MASK) >> SYNTH_SYNTH2_LOOP_RS_LSB) -#define SYNTH_SYNTH2_LOOP_RS_SET(x) (((x) << SYNTH_SYNTH2_LOOP_RS_LSB) & SYNTH_SYNTH2_LOOP_RS_MASK) -#define SYNTH_SYNTH2_LOOP_CS_MSB 4 -#define SYNTH_SYNTH2_LOOP_CS_LSB 3 -#define SYNTH_SYNTH2_LOOP_CS_MASK 0x00000018 -#define SYNTH_SYNTH2_LOOP_CS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CS_MASK) >> SYNTH_SYNTH2_LOOP_CS_LSB) -#define SYNTH_SYNTH2_LOOP_CS_SET(x) (((x) << SYNTH_SYNTH2_LOOP_CS_LSB) & SYNTH_SYNTH2_LOOP_CS_MASK) -#define SYNTH_SYNTH2_SPARE_BITS_MSB 2 -#define SYNTH_SYNTH2_SPARE_BITS_LSB 0 -#define SYNTH_SYNTH2_SPARE_BITS_MASK 0x00000007 -#define SYNTH_SYNTH2_SPARE_BITS_GET(x) (((x) & SYNTH_SYNTH2_SPARE_BITS_MASK) >> SYNTH_SYNTH2_SPARE_BITS_LSB) -#define SYNTH_SYNTH2_SPARE_BITS_SET(x) (((x) << SYNTH_SYNTH2_SPARE_BITS_LSB) & SYNTH_SYNTH2_SPARE_BITS_MASK) - -#define SYNTH_SYNTH3_ADDRESS 0x00000008 -#define SYNTH_SYNTH3_OFFSET 0x00000008 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_LSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MASK 0x80000000 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_GET(x) (((x) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) >> SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) -#define SYNTH_SYNTH3_DIS_CLK_XTAL_SET(x) (((x) << SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_LSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MASK 0x40000000 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_GET(x) (((x) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) >> SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_SET(x) (((x) << SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MSB 29 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB 24 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK 0x3f000000 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_SET(x) (((x) << SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_PWRUP_MSB 23 -#define SYNTH_SYNTH3_WAIT_PWRUP_LSB 18 -#define SYNTH_SYNTH3_WAIT_PWRUP_MASK 0x00fc0000 -#define SYNTH_SYNTH3_WAIT_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_PWRUP_SET(x) (((x) << SYNTH_SYNTH3_WAIT_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MSB 17 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_LSB 12 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MASK 0x0003f000 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_SET(x) (((x) << SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MSB 11 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_LSB 6 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MASK 0x00000fc0 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_SET(x) (((x) << SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MSB 5 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_LSB 0 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MASK 0x0000003f -#define SYNTH_SYNTH3_WAIT_VC_CHECK_GET(x) (((x) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) >> SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_SET(x) (((x) << SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) - -#define SYNTH_SYNTH4_ADDRESS 0x0000000c -#define SYNTH_SYNTH4_OFFSET 0x0000000c -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK 0x80000000 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_GET(x) (((x) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) >> SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_SET(x) (((x) << SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) -#define SYNTH_SYNTH4_DIS_LOSTVC_MSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_LSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_MASK 0x40000000 -#define SYNTH_SYNTH4_DIS_LOSTVC_GET(x) (((x) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) >> SYNTH_SYNTH4_DIS_LOSTVC_LSB) -#define SYNTH_SYNTH4_DIS_LOSTVC_SET(x) (((x) << SYNTH_SYNTH4_DIS_LOSTVC_LSB) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_LSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MASK 0x20000000 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_GET(x) (((x) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) >> SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_SET(x) (((x) << SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK 0x10000000 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_GET(x) (((x) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) >> SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_SET(x) (((x) << SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) -#define SYNTH_SYNTH4_FORCE_PINVC_MSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_LSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_MASK 0x08000000 -#define SYNTH_SYNTH4_FORCE_PINVC_GET(x) (((x) & SYNTH_SYNTH4_FORCE_PINVC_MASK) >> SYNTH_SYNTH4_FORCE_PINVC_LSB) -#define SYNTH_SYNTH4_FORCE_PINVC_SET(x) (((x) << SYNTH_SYNTH4_FORCE_PINVC_LSB) & SYNTH_SYNTH4_FORCE_PINVC_MASK) -#define SYNTH_SYNTH4_FORCE_VCOCAP_MSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_LSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_MASK 0x04000000 -#define SYNTH_SYNTH4_FORCE_VCOCAP_GET(x) (((x) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) >> SYNTH_SYNTH4_FORCE_VCOCAP_LSB) -#define SYNTH_SYNTH4_FORCE_VCOCAP_SET(x) (((x) << SYNTH_SYNTH4_FORCE_VCOCAP_LSB) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) -#define SYNTH_SYNTH4_VCOCAP_OVR_MSB 25 -#define SYNTH_SYNTH4_VCOCAP_OVR_LSB 18 -#define SYNTH_SYNTH4_VCOCAP_OVR_MASK 0x03fc0000 -#define SYNTH_SYNTH4_VCOCAP_OVR_GET(x) (((x) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) >> SYNTH_SYNTH4_VCOCAP_OVR_LSB) -#define SYNTH_SYNTH4_VCOCAP_OVR_SET(x) (((x) << SYNTH_SYNTH4_VCOCAP_OVR_LSB) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) -#define SYNTH_SYNTH4_VCOCAPPULLUP_MSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_LSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_MASK 0x00020000 -#define SYNTH_SYNTH4_VCOCAPPULLUP_GET(x) (((x) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) >> SYNTH_SYNTH4_VCOCAPPULLUP_LSB) -#define SYNTH_SYNTH4_VCOCAPPULLUP_SET(x) (((x) << SYNTH_SYNTH4_VCOCAPPULLUP_LSB) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) -#define SYNTH_SYNTH4_REFDIVSEL_MSB 16 -#define SYNTH_SYNTH4_REFDIVSEL_LSB 15 -#define SYNTH_SYNTH4_REFDIVSEL_MASK 0x00018000 -#define SYNTH_SYNTH4_REFDIVSEL_GET(x) (((x) & SYNTH_SYNTH4_REFDIVSEL_MASK) >> SYNTH_SYNTH4_REFDIVSEL_LSB) -#define SYNTH_SYNTH4_REFDIVSEL_SET(x) (((x) << SYNTH_SYNTH4_REFDIVSEL_LSB) & SYNTH_SYNTH4_REFDIVSEL_MASK) -#define SYNTH_SYNTH4_PFDDELAY_MSB 14 -#define SYNTH_SYNTH4_PFDDELAY_LSB 14 -#define SYNTH_SYNTH4_PFDDELAY_MASK 0x00004000 -#define SYNTH_SYNTH4_PFDDELAY_GET(x) (((x) & SYNTH_SYNTH4_PFDDELAY_MASK) >> SYNTH_SYNTH4_PFDDELAY_LSB) -#define SYNTH_SYNTH4_PFDDELAY_SET(x) (((x) << SYNTH_SYNTH4_PFDDELAY_LSB) & SYNTH_SYNTH4_PFDDELAY_MASK) -#define SYNTH_SYNTH4_PFD_DISABLE_MSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_LSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_MASK 0x00002000 -#define SYNTH_SYNTH4_PFD_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_PFD_DISABLE_MASK) >> SYNTH_SYNTH4_PFD_DISABLE_LSB) -#define SYNTH_SYNTH4_PFD_DISABLE_SET(x) (((x) << SYNTH_SYNTH4_PFD_DISABLE_LSB) & SYNTH_SYNTH4_PFD_DISABLE_MASK) -#define SYNTH_SYNTH4_PRESCSEL_MSB 12 -#define SYNTH_SYNTH4_PRESCSEL_LSB 11 -#define SYNTH_SYNTH4_PRESCSEL_MASK 0x00001800 -#define SYNTH_SYNTH4_PRESCSEL_GET(x) (((x) & SYNTH_SYNTH4_PRESCSEL_MASK) >> SYNTH_SYNTH4_PRESCSEL_LSB) -#define SYNTH_SYNTH4_PRESCSEL_SET(x) (((x) << SYNTH_SYNTH4_PRESCSEL_LSB) & SYNTH_SYNTH4_PRESCSEL_MASK) -#define SYNTH_SYNTH4_RESET_PRESC_MSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_LSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_MASK 0x00000400 -#define SYNTH_SYNTH4_RESET_PRESC_GET(x) (((x) & SYNTH_SYNTH4_RESET_PRESC_MASK) >> SYNTH_SYNTH4_RESET_PRESC_LSB) -#define SYNTH_SYNTH4_RESET_PRESC_SET(x) (((x) << SYNTH_SYNTH4_RESET_PRESC_LSB) & SYNTH_SYNTH4_RESET_PRESC_MASK) -#define SYNTH_SYNTH4_SDM_DISABLE_MSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_LSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_MASK 0x00000200 -#define SYNTH_SYNTH4_SDM_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_SDM_DISABLE_MASK) >> SYNTH_SYNTH4_SDM_DISABLE_LSB) -#define SYNTH_SYNTH4_SDM_DISABLE_SET(x) (((x) << SYNTH_SYNTH4_SDM_DISABLE_LSB) & SYNTH_SYNTH4_SDM_DISABLE_MASK) -#define SYNTH_SYNTH4_SDM_MODE_MSB 8 -#define SYNTH_SYNTH4_SDM_MODE_LSB 8 -#define SYNTH_SYNTH4_SDM_MODE_MASK 0x00000100 -#define SYNTH_SYNTH4_SDM_MODE_GET(x) (((x) & SYNTH_SYNTH4_SDM_MODE_MASK) >> SYNTH_SYNTH4_SDM_MODE_LSB) -#define SYNTH_SYNTH4_SDM_MODE_SET(x) (((x) << SYNTH_SYNTH4_SDM_MODE_LSB) & SYNTH_SYNTH4_SDM_MODE_MASK) -#define SYNTH_SYNTH4_SDM_DITHER_MSB 7 -#define SYNTH_SYNTH4_SDM_DITHER_LSB 6 -#define SYNTH_SYNTH4_SDM_DITHER_MASK 0x000000c0 -#define SYNTH_SYNTH4_SDM_DITHER_GET(x) (((x) & SYNTH_SYNTH4_SDM_DITHER_MASK) >> SYNTH_SYNTH4_SDM_DITHER_LSB) -#define SYNTH_SYNTH4_SDM_DITHER_SET(x) (((x) << SYNTH_SYNTH4_SDM_DITHER_LSB) & SYNTH_SYNTH4_SDM_DITHER_MASK) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK 0x00000020 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_GET(x) (((x) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) >> SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_SET(x) (((x) << SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK 0x00000010 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_GET(x) (((x) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) >> SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_SET(x) (((x) << SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) -#define SYNTH_SYNTH4_SPARE_MISC_MSB 3 -#define SYNTH_SYNTH4_SPARE_MISC_LSB 2 -#define SYNTH_SYNTH4_SPARE_MISC_MASK 0x0000000c -#define SYNTH_SYNTH4_SPARE_MISC_GET(x) (((x) & SYNTH_SYNTH4_SPARE_MISC_MASK) >> SYNTH_SYNTH4_SPARE_MISC_LSB) -#define SYNTH_SYNTH4_SPARE_MISC_SET(x) (((x) << SYNTH_SYNTH4_SPARE_MISC_LSB) & SYNTH_SYNTH4_SPARE_MISC_MASK) -#define SYNTH_SYNTH4_LONGSHIFTSEL_MSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_LSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_MASK 0x00000002 -#define SYNTH_SYNTH4_LONGSHIFTSEL_GET(x) (((x) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) >> SYNTH_SYNTH4_LONGSHIFTSEL_LSB) -#define SYNTH_SYNTH4_LONGSHIFTSEL_SET(x) (((x) << SYNTH_SYNTH4_LONGSHIFTSEL_LSB) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_LSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MASK 0x00000001 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_GET(x) (((x) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) >> SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_SET(x) (((x) << SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) - -#define SYNTH_SYNTH5_ADDRESS 0x00000010 -#define SYNTH_SYNTH5_OFFSET 0x00000010 -#define SYNTH_SYNTH5_LOOP_IP0_MSB 31 -#define SYNTH_SYNTH5_LOOP_IP0_LSB 28 -#define SYNTH_SYNTH5_LOOP_IP0_MASK 0xf0000000 -#define SYNTH_SYNTH5_LOOP_IP0_GET(x) (((x) & SYNTH_SYNTH5_LOOP_IP0_MASK) >> SYNTH_SYNTH5_LOOP_IP0_LSB) -#define SYNTH_SYNTH5_LOOP_IP0_SET(x) (((x) << SYNTH_SYNTH5_LOOP_IP0_LSB) & SYNTH_SYNTH5_LOOP_IP0_MASK) -#define SYNTH_SYNTH5_SLOPE_IP_MSB 27 -#define SYNTH_SYNTH5_SLOPE_IP_LSB 25 -#define SYNTH_SYNTH5_SLOPE_IP_MASK 0x0e000000 -#define SYNTH_SYNTH5_SLOPE_IP_GET(x) (((x) & SYNTH_SYNTH5_SLOPE_IP_MASK) >> SYNTH_SYNTH5_SLOPE_IP_LSB) -#define SYNTH_SYNTH5_SLOPE_IP_SET(x) (((x) << SYNTH_SYNTH5_SLOPE_IP_LSB) & SYNTH_SYNTH5_SLOPE_IP_MASK) -#define SYNTH_SYNTH5_CPBIAS_MSB 24 -#define SYNTH_SYNTH5_CPBIAS_LSB 23 -#define SYNTH_SYNTH5_CPBIAS_MASK 0x01800000 -#define SYNTH_SYNTH5_CPBIAS_GET(x) (((x) & SYNTH_SYNTH5_CPBIAS_MASK) >> SYNTH_SYNTH5_CPBIAS_LSB) -#define SYNTH_SYNTH5_CPBIAS_SET(x) (((x) << SYNTH_SYNTH5_CPBIAS_LSB) & SYNTH_SYNTH5_CPBIAS_MASK) -#define SYNTH_SYNTH5_CPSTEERING_EN_MSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_LSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_MASK 0x00400000 -#define SYNTH_SYNTH5_CPSTEERING_EN_GET(x) (((x) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) >> SYNTH_SYNTH5_CPSTEERING_EN_LSB) -#define SYNTH_SYNTH5_CPSTEERING_EN_SET(x) (((x) << SYNTH_SYNTH5_CPSTEERING_EN_LSB) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) -#define SYNTH_SYNTH5_CPLOWLK_MSB 21 -#define SYNTH_SYNTH5_CPLOWLK_LSB 21 -#define SYNTH_SYNTH5_CPLOWLK_MASK 0x00200000 -#define SYNTH_SYNTH5_CPLOWLK_GET(x) (((x) & SYNTH_SYNTH5_CPLOWLK_MASK) >> SYNTH_SYNTH5_CPLOWLK_LSB) -#define SYNTH_SYNTH5_CPLOWLK_SET(x) (((x) << SYNTH_SYNTH5_CPLOWLK_LSB) & SYNTH_SYNTH5_CPLOWLK_MASK) -#define SYNTH_SYNTH5_LOOPLEAKCUR_MSB 20 -#define SYNTH_SYNTH5_LOOPLEAKCUR_LSB 17 -#define SYNTH_SYNTH5_LOOPLEAKCUR_MASK 0x001e0000 -#define SYNTH_SYNTH5_LOOPLEAKCUR_GET(x) (((x) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) >> SYNTH_SYNTH5_LOOPLEAKCUR_LSB) -#define SYNTH_SYNTH5_LOOPLEAKCUR_SET(x) (((x) << SYNTH_SYNTH5_LOOPLEAKCUR_LSB) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) -#define SYNTH_SYNTH5_CAPRANGE1_MSB 16 -#define SYNTH_SYNTH5_CAPRANGE1_LSB 13 -#define SYNTH_SYNTH5_CAPRANGE1_MASK 0x0001e000 -#define SYNTH_SYNTH5_CAPRANGE1_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE1_MASK) >> SYNTH_SYNTH5_CAPRANGE1_LSB) -#define SYNTH_SYNTH5_CAPRANGE1_SET(x) (((x) << SYNTH_SYNTH5_CAPRANGE1_LSB) & SYNTH_SYNTH5_CAPRANGE1_MASK) -#define SYNTH_SYNTH5_CAPRANGE2_MSB 12 -#define SYNTH_SYNTH5_CAPRANGE2_LSB 9 -#define SYNTH_SYNTH5_CAPRANGE2_MASK 0x00001e00 -#define SYNTH_SYNTH5_CAPRANGE2_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE2_MASK) >> SYNTH_SYNTH5_CAPRANGE2_LSB) -#define SYNTH_SYNTH5_CAPRANGE2_SET(x) (((x) << SYNTH_SYNTH5_CAPRANGE2_LSB) & SYNTH_SYNTH5_CAPRANGE2_MASK) -#define SYNTH_SYNTH5_CAPRANGE3_MSB 8 -#define SYNTH_SYNTH5_CAPRANGE3_LSB 5 -#define SYNTH_SYNTH5_CAPRANGE3_MASK 0x000001e0 -#define SYNTH_SYNTH5_CAPRANGE3_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE3_MASK) >> SYNTH_SYNTH5_CAPRANGE3_LSB) -#define SYNTH_SYNTH5_CAPRANGE3_SET(x) (((x) << SYNTH_SYNTH5_CAPRANGE3_LSB) & SYNTH_SYNTH5_CAPRANGE3_MASK) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK 0x00000010 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_SET(x) (((x) << SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MSB 3 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB 2 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK 0x0000000c -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_GET(x) (((x) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) >> SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_SET(x) (((x) << SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) -#define SYNTH_SYNTH5_SPARE_MSB 1 -#define SYNTH_SYNTH5_SPARE_LSB 0 -#define SYNTH_SYNTH5_SPARE_MASK 0x00000003 -#define SYNTH_SYNTH5_SPARE_GET(x) (((x) & SYNTH_SYNTH5_SPARE_MASK) >> SYNTH_SYNTH5_SPARE_LSB) -#define SYNTH_SYNTH5_SPARE_SET(x) (((x) << SYNTH_SYNTH5_SPARE_LSB) & SYNTH_SYNTH5_SPARE_MASK) - -#define SYNTH_SYNTH6_ADDRESS 0x00000014 -#define SYNTH_SYNTH6_OFFSET 0x00000014 -#define SYNTH_SYNTH6_IRCP_MSB 31 -#define SYNTH_SYNTH6_IRCP_LSB 29 -#define SYNTH_SYNTH6_IRCP_MASK 0xe0000000 -#define SYNTH_SYNTH6_IRCP_GET(x) (((x) & SYNTH_SYNTH6_IRCP_MASK) >> SYNTH_SYNTH6_IRCP_LSB) -#define SYNTH_SYNTH6_IRCP_SET(x) (((x) << SYNTH_SYNTH6_IRCP_LSB) & SYNTH_SYNTH6_IRCP_MASK) -#define SYNTH_SYNTH6_IRVCMON_MSB 28 -#define SYNTH_SYNTH6_IRVCMON_LSB 26 -#define SYNTH_SYNTH6_IRVCMON_MASK 0x1c000000 -#define SYNTH_SYNTH6_IRVCMON_GET(x) (((x) & SYNTH_SYNTH6_IRVCMON_MASK) >> SYNTH_SYNTH6_IRVCMON_LSB) -#define SYNTH_SYNTH6_IRVCMON_SET(x) (((x) << SYNTH_SYNTH6_IRVCMON_LSB) & SYNTH_SYNTH6_IRVCMON_MASK) -#define SYNTH_SYNTH6_IRSPARE_MSB 25 -#define SYNTH_SYNTH6_IRSPARE_LSB 23 -#define SYNTH_SYNTH6_IRSPARE_MASK 0x03800000 -#define SYNTH_SYNTH6_IRSPARE_GET(x) (((x) & SYNTH_SYNTH6_IRSPARE_MASK) >> SYNTH_SYNTH6_IRSPARE_LSB) -#define SYNTH_SYNTH6_IRSPARE_SET(x) (((x) << SYNTH_SYNTH6_IRSPARE_LSB) & SYNTH_SYNTH6_IRSPARE_MASK) -#define SYNTH_SYNTH6_ICPRESC_MSB 22 -#define SYNTH_SYNTH6_ICPRESC_LSB 20 -#define SYNTH_SYNTH6_ICPRESC_MASK 0x00700000 -#define SYNTH_SYNTH6_ICPRESC_GET(x) (((x) & SYNTH_SYNTH6_ICPRESC_MASK) >> SYNTH_SYNTH6_ICPRESC_LSB) -#define SYNTH_SYNTH6_ICPRESC_SET(x) (((x) << SYNTH_SYNTH6_ICPRESC_LSB) & SYNTH_SYNTH6_ICPRESC_MASK) -#define SYNTH_SYNTH6_ICLODIV_MSB 19 -#define SYNTH_SYNTH6_ICLODIV_LSB 17 -#define SYNTH_SYNTH6_ICLODIV_MASK 0x000e0000 -#define SYNTH_SYNTH6_ICLODIV_GET(x) (((x) & SYNTH_SYNTH6_ICLODIV_MASK) >> SYNTH_SYNTH6_ICLODIV_LSB) -#define SYNTH_SYNTH6_ICLODIV_SET(x) (((x) << SYNTH_SYNTH6_ICLODIV_LSB) & SYNTH_SYNTH6_ICLODIV_MASK) -#define SYNTH_SYNTH6_ICLOMIX_MSB 16 -#define SYNTH_SYNTH6_ICLOMIX_LSB 14 -#define SYNTH_SYNTH6_ICLOMIX_MASK 0x0001c000 -#define SYNTH_SYNTH6_ICLOMIX_GET(x) (((x) & SYNTH_SYNTH6_ICLOMIX_MASK) >> SYNTH_SYNTH6_ICLOMIX_LSB) -#define SYNTH_SYNTH6_ICLOMIX_SET(x) (((x) << SYNTH_SYNTH6_ICLOMIX_LSB) & SYNTH_SYNTH6_ICLOMIX_MASK) -#define SYNTH_SYNTH6_ICSPAREA_MSB 13 -#define SYNTH_SYNTH6_ICSPAREA_LSB 11 -#define SYNTH_SYNTH6_ICSPAREA_MASK 0x00003800 -#define SYNTH_SYNTH6_ICSPAREA_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREA_MASK) >> SYNTH_SYNTH6_ICSPAREA_LSB) -#define SYNTH_SYNTH6_ICSPAREA_SET(x) (((x) << SYNTH_SYNTH6_ICSPAREA_LSB) & SYNTH_SYNTH6_ICSPAREA_MASK) -#define SYNTH_SYNTH6_ICSPAREB_MSB 10 -#define SYNTH_SYNTH6_ICSPAREB_LSB 8 -#define SYNTH_SYNTH6_ICSPAREB_MASK 0x00000700 -#define SYNTH_SYNTH6_ICSPAREB_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREB_MASK) >> SYNTH_SYNTH6_ICSPAREB_LSB) -#define SYNTH_SYNTH6_ICSPAREB_SET(x) (((x) << SYNTH_SYNTH6_ICSPAREB_LSB) & SYNTH_SYNTH6_ICSPAREB_MASK) -#define SYNTH_SYNTH6_ICVCO_MSB 7 -#define SYNTH_SYNTH6_ICVCO_LSB 5 -#define SYNTH_SYNTH6_ICVCO_MASK 0x000000e0 -#define SYNTH_SYNTH6_ICVCO_GET(x) (((x) & SYNTH_SYNTH6_ICVCO_MASK) >> SYNTH_SYNTH6_ICVCO_LSB) -#define SYNTH_SYNTH6_ICVCO_SET(x) (((x) << SYNTH_SYNTH6_ICVCO_LSB) & SYNTH_SYNTH6_ICVCO_MASK) -#define SYNTH_SYNTH6_VCOBUFBIAS_MSB 4 -#define SYNTH_SYNTH6_VCOBUFBIAS_LSB 3 -#define SYNTH_SYNTH6_VCOBUFBIAS_MASK 0x00000018 -#define SYNTH_SYNTH6_VCOBUFBIAS_GET(x) (((x) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) >> SYNTH_SYNTH6_VCOBUFBIAS_LSB) -#define SYNTH_SYNTH6_VCOBUFBIAS_SET(x) (((x) << SYNTH_SYNTH6_VCOBUFBIAS_LSB) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) -#define SYNTH_SYNTH6_SPARE_BIAS_MSB 2 -#define SYNTH_SYNTH6_SPARE_BIAS_LSB 0 -#define SYNTH_SYNTH6_SPARE_BIAS_MASK 0x00000007 -#define SYNTH_SYNTH6_SPARE_BIAS_GET(x) (((x) & SYNTH_SYNTH6_SPARE_BIAS_MASK) >> SYNTH_SYNTH6_SPARE_BIAS_LSB) -#define SYNTH_SYNTH6_SPARE_BIAS_SET(x) (((x) << SYNTH_SYNTH6_SPARE_BIAS_LSB) & SYNTH_SYNTH6_SPARE_BIAS_MASK) - -#define SYNTH_SYNTH7_ADDRESS 0x00000018 -#define SYNTH_SYNTH7_OFFSET 0x00000018 -#define SYNTH_SYNTH7_SYNTH_ON_MSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_LSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_MASK 0x80000000 -#define SYNTH_SYNTH7_SYNTH_ON_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_ON_MASK) >> SYNTH_SYNTH7_SYNTH_ON_LSB) -#define SYNTH_SYNTH7_SYNTH_ON_SET(x) (((x) << SYNTH_SYNTH7_SYNTH_ON_LSB) & SYNTH_SYNTH7_SYNTH_ON_MASK) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MSB 30 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_LSB 27 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MASK 0x78000000 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) >> SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_SET(x) (((x) << SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) -#define SYNTH_SYNTH7_CAP_SEARCH_MSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_LSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_MASK 0x04000000 -#define SYNTH_SYNTH7_CAP_SEARCH_GET(x) (((x) & SYNTH_SYNTH7_CAP_SEARCH_MASK) >> SYNTH_SYNTH7_CAP_SEARCH_LSB) -#define SYNTH_SYNTH7_CAP_SEARCH_SET(x) (((x) << SYNTH_SYNTH7_CAP_SEARCH_LSB) & SYNTH_SYNTH7_CAP_SEARCH_MASK) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK 0x02000000 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) >> SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_SET(x) (((x) << SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) -#define SYNTH_SYNTH7_PIN_VC_MSB 24 -#define SYNTH_SYNTH7_PIN_VC_LSB 24 -#define SYNTH_SYNTH7_PIN_VC_MASK 0x01000000 -#define SYNTH_SYNTH7_PIN_VC_GET(x) (((x) & SYNTH_SYNTH7_PIN_VC_MASK) >> SYNTH_SYNTH7_PIN_VC_LSB) -#define SYNTH_SYNTH7_PIN_VC_SET(x) (((x) << SYNTH_SYNTH7_PIN_VC_LSB) & SYNTH_SYNTH7_PIN_VC_MASK) -#define SYNTH_SYNTH7_VCO_CAP_ST_MSB 23 -#define SYNTH_SYNTH7_VCO_CAP_ST_LSB 16 -#define SYNTH_SYNTH7_VCO_CAP_ST_MASK 0x00ff0000 -#define SYNTH_SYNTH7_VCO_CAP_ST_GET(x) (((x) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) >> SYNTH_SYNTH7_VCO_CAP_ST_LSB) -#define SYNTH_SYNTH7_VCO_CAP_ST_SET(x) (((x) << SYNTH_SYNTH7_VCO_CAP_ST_LSB) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) -#define SYNTH_SYNTH7_SHORT_R_MSB 15 -#define SYNTH_SYNTH7_SHORT_R_LSB 15 -#define SYNTH_SYNTH7_SHORT_R_MASK 0x00008000 -#define SYNTH_SYNTH7_SHORT_R_GET(x) (((x) & SYNTH_SYNTH7_SHORT_R_MASK) >> SYNTH_SYNTH7_SHORT_R_LSB) -#define SYNTH_SYNTH7_SHORT_R_SET(x) (((x) << SYNTH_SYNTH7_SHORT_R_LSB) & SYNTH_SYNTH7_SHORT_R_MASK) -#define SYNTH_SYNTH7_RESET_RFD_MSB 14 -#define SYNTH_SYNTH7_RESET_RFD_LSB 14 -#define SYNTH_SYNTH7_RESET_RFD_MASK 0x00004000 -#define SYNTH_SYNTH7_RESET_RFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_RFD_MASK) >> SYNTH_SYNTH7_RESET_RFD_LSB) -#define SYNTH_SYNTH7_RESET_RFD_SET(x) (((x) << SYNTH_SYNTH7_RESET_RFD_LSB) & SYNTH_SYNTH7_RESET_RFD_MASK) -#define SYNTH_SYNTH7_RESET_PFD_MSB 13 -#define SYNTH_SYNTH7_RESET_PFD_LSB 13 -#define SYNTH_SYNTH7_RESET_PFD_MASK 0x00002000 -#define SYNTH_SYNTH7_RESET_PFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_PFD_MASK) >> SYNTH_SYNTH7_RESET_PFD_LSB) -#define SYNTH_SYNTH7_RESET_PFD_SET(x) (((x) << SYNTH_SYNTH7_RESET_PFD_LSB) & SYNTH_SYNTH7_RESET_PFD_MASK) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK 0x00001000 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_GET(x) (((x) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) >> SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_SET(x) (((x) << SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) -#define SYNTH_SYNTH7_RESET_SDM_B_MSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_LSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_MASK 0x00000800 -#define SYNTH_SYNTH7_RESET_SDM_B_GET(x) (((x) & SYNTH_SYNTH7_RESET_SDM_B_MASK) >> SYNTH_SYNTH7_RESET_SDM_B_LSB) -#define SYNTH_SYNTH7_RESET_SDM_B_SET(x) (((x) << SYNTH_SYNTH7_RESET_SDM_B_LSB) & SYNTH_SYNTH7_RESET_SDM_B_MASK) -#define SYNTH_SYNTH7_VC2HIGH_MSB 10 -#define SYNTH_SYNTH7_VC2HIGH_LSB 10 -#define SYNTH_SYNTH7_VC2HIGH_MASK 0x00000400 -#define SYNTH_SYNTH7_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH7_VC2HIGH_MASK) >> SYNTH_SYNTH7_VC2HIGH_LSB) -#define SYNTH_SYNTH7_VC2HIGH_SET(x) (((x) << SYNTH_SYNTH7_VC2HIGH_LSB) & SYNTH_SYNTH7_VC2HIGH_MASK) -#define SYNTH_SYNTH7_VC2LOW_MSB 9 -#define SYNTH_SYNTH7_VC2LOW_LSB 9 -#define SYNTH_SYNTH7_VC2LOW_MASK 0x00000200 -#define SYNTH_SYNTH7_VC2LOW_GET(x) (((x) & SYNTH_SYNTH7_VC2LOW_MASK) >> SYNTH_SYNTH7_VC2LOW_LSB) -#define SYNTH_SYNTH7_VC2LOW_SET(x) (((x) << SYNTH_SYNTH7_VC2LOW_LSB) & SYNTH_SYNTH7_VC2LOW_MASK) -#define SYNTH_SYNTH7_LOOP_IP_MSB 8 -#define SYNTH_SYNTH7_LOOP_IP_LSB 5 -#define SYNTH_SYNTH7_LOOP_IP_MASK 0x000001e0 -#define SYNTH_SYNTH7_LOOP_IP_GET(x) (((x) & SYNTH_SYNTH7_LOOP_IP_MASK) >> SYNTH_SYNTH7_LOOP_IP_LSB) -#define SYNTH_SYNTH7_LOOP_IP_SET(x) (((x) << SYNTH_SYNTH7_LOOP_IP_LSB) & SYNTH_SYNTH7_LOOP_IP_MASK) -#define SYNTH_SYNTH7_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH7_LOBUF5GTUNE_LSB 3 -#define SYNTH_SYNTH7_LOBUF5GTUNE_MASK 0x00000018 -#define SYNTH_SYNTH7_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH7_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH7_LOBUF5GTUNE_SET(x) (((x) << SYNTH_SYNTH7_LOBUF5GTUNE_LSB) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH7_SPARE_READ_MSB 2 -#define SYNTH_SYNTH7_SPARE_READ_LSB 0 -#define SYNTH_SYNTH7_SPARE_READ_MASK 0x00000007 -#define SYNTH_SYNTH7_SPARE_READ_GET(x) (((x) & SYNTH_SYNTH7_SPARE_READ_MASK) >> SYNTH_SYNTH7_SPARE_READ_LSB) -#define SYNTH_SYNTH7_SPARE_READ_SET(x) (((x) << SYNTH_SYNTH7_SPARE_READ_LSB) & SYNTH_SYNTH7_SPARE_READ_MASK) - -#define SYNTH_SYNTH8_ADDRESS 0x0000001c -#define SYNTH_SYNTH8_OFFSET 0x0000001c -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK 0x80000000 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_GET(x) (((x) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) >> SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_SET(x) (((x) << SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) -#define SYNTH_SYNTH8_FRACMODE_MSB 30 -#define SYNTH_SYNTH8_FRACMODE_LSB 30 -#define SYNTH_SYNTH8_FRACMODE_MASK 0x40000000 -#define SYNTH_SYNTH8_FRACMODE_GET(x) (((x) & SYNTH_SYNTH8_FRACMODE_MASK) >> SYNTH_SYNTH8_FRACMODE_LSB) -#define SYNTH_SYNTH8_FRACMODE_SET(x) (((x) << SYNTH_SYNTH8_FRACMODE_LSB) & SYNTH_SYNTH8_FRACMODE_MASK) -#define SYNTH_SYNTH8_AMODEREFSEL_MSB 29 -#define SYNTH_SYNTH8_AMODEREFSEL_LSB 28 -#define SYNTH_SYNTH8_AMODEREFSEL_MASK 0x30000000 -#define SYNTH_SYNTH8_AMODEREFSEL_GET(x) (((x) & SYNTH_SYNTH8_AMODEREFSEL_MASK) >> SYNTH_SYNTH8_AMODEREFSEL_LSB) -#define SYNTH_SYNTH8_AMODEREFSEL_SET(x) (((x) << SYNTH_SYNTH8_AMODEREFSEL_LSB) & SYNTH_SYNTH8_AMODEREFSEL_MASK) -#define SYNTH_SYNTH8_SPARE_MSB 27 -#define SYNTH_SYNTH8_SPARE_LSB 27 -#define SYNTH_SYNTH8_SPARE_MASK 0x08000000 -#define SYNTH_SYNTH8_SPARE_GET(x) (((x) & SYNTH_SYNTH8_SPARE_MASK) >> SYNTH_SYNTH8_SPARE_LSB) -#define SYNTH_SYNTH8_SPARE_SET(x) (((x) << SYNTH_SYNTH8_SPARE_LSB) & SYNTH_SYNTH8_SPARE_MASK) -#define SYNTH_SYNTH8_CHANSEL_MSB 26 -#define SYNTH_SYNTH8_CHANSEL_LSB 18 -#define SYNTH_SYNTH8_CHANSEL_MASK 0x07fc0000 -#define SYNTH_SYNTH8_CHANSEL_GET(x) (((x) & SYNTH_SYNTH8_CHANSEL_MASK) >> SYNTH_SYNTH8_CHANSEL_LSB) -#define SYNTH_SYNTH8_CHANSEL_SET(x) (((x) << SYNTH_SYNTH8_CHANSEL_LSB) & SYNTH_SYNTH8_CHANSEL_MASK) -#define SYNTH_SYNTH8_CHANFRAC_MSB 17 -#define SYNTH_SYNTH8_CHANFRAC_LSB 1 -#define SYNTH_SYNTH8_CHANFRAC_MASK 0x0003fffe -#define SYNTH_SYNTH8_CHANFRAC_GET(x) (((x) & SYNTH_SYNTH8_CHANFRAC_MASK) >> SYNTH_SYNTH8_CHANFRAC_LSB) -#define SYNTH_SYNTH8_CHANFRAC_SET(x) (((x) << SYNTH_SYNTH8_CHANFRAC_LSB) & SYNTH_SYNTH8_CHANFRAC_MASK) -#define SYNTH_SYNTH8_FORCE_FRACLSB_MSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_LSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_MASK 0x00000001 -#define SYNTH_SYNTH8_FORCE_FRACLSB_GET(x) (((x) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) >> SYNTH_SYNTH8_FORCE_FRACLSB_LSB) -#define SYNTH_SYNTH8_FORCE_FRACLSB_SET(x) (((x) << SYNTH_SYNTH8_FORCE_FRACLSB_LSB) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct synth_reg_reg_s { - volatile unsigned int synth_synth1; - volatile unsigned int synth_synth2; - volatile unsigned int synth_synth3; - volatile unsigned int synth_synth4; - volatile unsigned int synth_synth5; - volatile unsigned int synth_synth6; - volatile unsigned int synth_synth7; - volatile unsigned int synth_synth8; -} synth_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _SYNTH_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/synth_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/synth_reg.vrh deleted file mode 100644 index 306c6471becb..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/synth_reg.vrh +++ /dev/null @@ -1,939 +0,0 @@ -#ifndef _SYNTH_REG_VRH_ -#define _SYNTH_REG_VRH_ - -#define SYNTH_SYNTH1_ADDRESS 'h00000000 -#define SYNTH_SYNTH1_PWD_BIAS_MSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_LSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_MASK 'h80000000 -#define SYNTH_SYNTH1_PWD_BIAS_GET(x) (((x) & SYNTH_SYNTH1_PWD_BIAS_MASK) >> SYNTH_SYNTH1_PWD_BIAS_LSB) -#define SYNTH_SYNTH1_PWD_BIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_BIAS_LSB) & SYNTH_SYNTH1_PWD_BIAS_MASK) -#define SYNTH_SYNTH1_PWD_BIAS_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_CP_MSB 30 -#define SYNTH_SYNTH1_PWD_CP_LSB 30 -#define SYNTH_SYNTH1_PWD_CP_MASK 'h40000000 -#define SYNTH_SYNTH1_PWD_CP_GET(x) (((x) & SYNTH_SYNTH1_PWD_CP_MASK) >> SYNTH_SYNTH1_PWD_CP_LSB) -#define SYNTH_SYNTH1_PWD_CP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_CP_LSB) & SYNTH_SYNTH1_PWD_CP_MASK) -#define SYNTH_SYNTH1_PWD_CP_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_VCMON_MSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_LSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_MASK 'h20000000 -#define SYNTH_SYNTH1_PWD_VCMON_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCMON_MASK) >> SYNTH_SYNTH1_PWD_VCMON_LSB) -#define SYNTH_SYNTH1_PWD_VCMON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_VCMON_LSB) & SYNTH_SYNTH1_PWD_VCMON_MASK) -#define SYNTH_SYNTH1_PWD_VCMON_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_VCO_MSB 28 -#define SYNTH_SYNTH1_PWD_VCO_LSB 28 -#define SYNTH_SYNTH1_PWD_VCO_MASK 'h10000000 -#define SYNTH_SYNTH1_PWD_VCO_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCO_MASK) >> SYNTH_SYNTH1_PWD_VCO_LSB) -#define SYNTH_SYNTH1_PWD_VCO_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_VCO_LSB) & SYNTH_SYNTH1_PWD_VCO_MASK) -#define SYNTH_SYNTH1_PWD_VCO_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_PRESC_MSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_LSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_MASK 'h08000000 -#define SYNTH_SYNTH1_PWD_PRESC_GET(x) (((x) & SYNTH_SYNTH1_PWD_PRESC_MASK) >> SYNTH_SYNTH1_PWD_PRESC_LSB) -#define SYNTH_SYNTH1_PWD_PRESC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_PRESC_LSB) & SYNTH_SYNTH1_PWD_PRESC_MASK) -#define SYNTH_SYNTH1_PWD_PRESC_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_LODIV_MSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_LSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_MASK 'h04000000 -#define SYNTH_SYNTH1_PWD_LODIV_GET(x) (((x) & SYNTH_SYNTH1_PWD_LODIV_MASK) >> SYNTH_SYNTH1_PWD_LODIV_LSB) -#define SYNTH_SYNTH1_PWD_LODIV_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_LODIV_LSB) & SYNTH_SYNTH1_PWD_LODIV_MASK) -#define SYNTH_SYNTH1_PWD_LODIV_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_LOMIX_MSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_LSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_MASK 'h02000000 -#define SYNTH_SYNTH1_PWD_LOMIX_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOMIX_MASK) >> SYNTH_SYNTH1_PWD_LOMIX_LSB) -#define SYNTH_SYNTH1_PWD_LOMIX_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_LOMIX_LSB) & SYNTH_SYNTH1_PWD_LOMIX_MASK) -#define SYNTH_SYNTH1_PWD_LOMIX_RESET 1'h0 -#define SYNTH_SYNTH1_FORCE_LO_ON_MSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_LSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_MASK 'h01000000 -#define SYNTH_SYNTH1_FORCE_LO_ON_GET(x) (((x) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) >> SYNTH_SYNTH1_FORCE_LO_ON_LSB) -#define SYNTH_SYNTH1_FORCE_LO_ON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_FORCE_LO_ON_LSB) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) -#define SYNTH_SYNTH1_FORCE_LO_ON_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_LOBUF5G_MSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_LSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_MASK 'h00800000 -#define SYNTH_SYNTH1_PWD_LOBUF5G_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) >> SYNTH_SYNTH1_PWD_LOBUF5G_LSB) -#define SYNTH_SYNTH1_PWD_LOBUF5G_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_LOBUF5G_LSB) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) -#define SYNTH_SYNTH1_PWD_LOBUF5G_RESET 1'h0 -#define SYNTH_SYNTH1_VCOREGBYPASS_MSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_LSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_MASK 'h00400000 -#define SYNTH_SYNTH1_VCOREGBYPASS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) >> SYNTH_SYNTH1_VCOREGBYPASS_LSB) -#define SYNTH_SYNTH1_VCOREGBYPASS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_VCOREGBYPASS_LSB) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) -#define SYNTH_SYNTH1_VCOREGBYPASS_RESET 1'h1 -#define SYNTH_SYNTH1_VCOREGLEVEL_MSB 21 -#define SYNTH_SYNTH1_VCOREGLEVEL_LSB 20 -#define SYNTH_SYNTH1_VCOREGLEVEL_MASK 'h00300000 -#define SYNTH_SYNTH1_VCOREGLEVEL_GET(x) (((x) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) >> SYNTH_SYNTH1_VCOREGLEVEL_LSB) -#define SYNTH_SYNTH1_VCOREGLEVEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_VCOREGLEVEL_LSB) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) -#define SYNTH_SYNTH1_VCOREGLEVEL_RESET 2'h1 -#define SYNTH_SYNTH1_VCOREGBIAS_MSB 19 -#define SYNTH_SYNTH1_VCOREGBIAS_LSB 18 -#define SYNTH_SYNTH1_VCOREGBIAS_MASK 'h000c0000 -#define SYNTH_SYNTH1_VCOREGBIAS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBIAS_MASK) >> SYNTH_SYNTH1_VCOREGBIAS_LSB) -#define SYNTH_SYNTH1_VCOREGBIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_VCOREGBIAS_LSB) & SYNTH_SYNTH1_VCOREGBIAS_MASK) -#define SYNTH_SYNTH1_VCOREGBIAS_RESET 2'h1 -#define SYNTH_SYNTH1_SLIDINGIF_MSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_LSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_MASK 'h00020000 -#define SYNTH_SYNTH1_SLIDINGIF_GET(x) (((x) & SYNTH_SYNTH1_SLIDINGIF_MASK) >> SYNTH_SYNTH1_SLIDINGIF_LSB) -#define SYNTH_SYNTH1_SLIDINGIF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_SLIDINGIF_LSB) & SYNTH_SYNTH1_SLIDINGIF_MASK) -#define SYNTH_SYNTH1_SLIDINGIF_RESET 1'h0 -#define SYNTH_SYNTH1_SPARE_PWD_MSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_LSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_MASK 'h00010000 -#define SYNTH_SYNTH1_SPARE_PWD_GET(x) (((x) & SYNTH_SYNTH1_SPARE_PWD_MASK) >> SYNTH_SYNTH1_SPARE_PWD_LSB) -#define SYNTH_SYNTH1_SPARE_PWD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_SPARE_PWD_LSB) & SYNTH_SYNTH1_SPARE_PWD_MASK) -#define SYNTH_SYNTH1_SPARE_PWD_RESET 1'h0 -#define SYNTH_SYNTH1_CON_VDDVCOREG_MSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_LSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_MASK 'h00008000 -#define SYNTH_SYNTH1_CON_VDDVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) >> SYNTH_SYNTH1_CON_VDDVCOREG_LSB) -#define SYNTH_SYNTH1_CON_VDDVCOREG_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_CON_VDDVCOREG_LSB) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) -#define SYNTH_SYNTH1_CON_VDDVCOREG_RESET 1'h0 -#define SYNTH_SYNTH1_CON_IVCOREG_MSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_LSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_MASK 'h00004000 -#define SYNTH_SYNTH1_CON_IVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOREG_MASK) >> SYNTH_SYNTH1_CON_IVCOREG_LSB) -#define SYNTH_SYNTH1_CON_IVCOREG_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_CON_IVCOREG_LSB) & SYNTH_SYNTH1_CON_IVCOREG_MASK) -#define SYNTH_SYNTH1_CON_IVCOREG_RESET 1'h0 -#define SYNTH_SYNTH1_CON_IVCOBUF_MSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_LSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_MASK 'h00002000 -#define SYNTH_SYNTH1_CON_IVCOBUF_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) >> SYNTH_SYNTH1_CON_IVCOBUF_LSB) -#define SYNTH_SYNTH1_CON_IVCOBUF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_CON_IVCOBUF_LSB) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) -#define SYNTH_SYNTH1_CON_IVCOBUF_RESET 1'h0 -#define SYNTH_SYNTH1_SEL_VCMONABUS_MSB 12 -#define SYNTH_SYNTH1_SEL_VCMONABUS_LSB 10 -#define SYNTH_SYNTH1_SEL_VCMONABUS_MASK 'h00001c00 -#define SYNTH_SYNTH1_SEL_VCMONABUS_GET(x) (((x) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) >> SYNTH_SYNTH1_SEL_VCMONABUS_LSB) -#define SYNTH_SYNTH1_SEL_VCMONABUS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_SEL_VCMONABUS_LSB) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) -#define SYNTH_SYNTH1_SEL_VCMONABUS_RESET 3'h0 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK 'h00000200 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) >> SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_RESET 1'h0 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_LSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MASK 'h00000100 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) >> SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_RESET 1'h0 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK 'h00000080 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_RESET 1'h0 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK 'h00000040 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_FB_MSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_LSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_MASK 'h00000020 -#define SYNTH_SYNTH1_MONITOR_FB_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_MASK) >> SYNTH_SYNTH1_MONITOR_FB_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_FB_LSB) & SYNTH_SYNTH1_MONITOR_FB_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_REF_MSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_LSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_MASK 'h00000010 -#define SYNTH_SYNTH1_MONITOR_REF_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_REF_MASK) >> SYNTH_SYNTH1_MONITOR_REF_LSB) -#define SYNTH_SYNTH1_MONITOR_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_REF_LSB) & SYNTH_SYNTH1_MONITOR_REF_MASK) -#define SYNTH_SYNTH1_MONITOR_REF_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK 'h00000008 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) >> SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK 'h00000004 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) >> SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_LSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MASK 'h00000002 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) >> SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK 'h00000001 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) >> SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_RESET 1'h0 -#define SYNTH_SYNTH1_RESET (32'h0 | \ - SYNTH_SYNTH1_PWD_BIAS_SET(SYNTH_SYNTH1_PWD_BIAS_RESET) | \ - SYNTH_SYNTH1_PWD_CP_SET(SYNTH_SYNTH1_PWD_CP_RESET) | \ - SYNTH_SYNTH1_PWD_VCMON_SET(SYNTH_SYNTH1_PWD_VCMON_RESET) | \ - SYNTH_SYNTH1_PWD_VCO_SET(SYNTH_SYNTH1_PWD_VCO_RESET) | \ - SYNTH_SYNTH1_PWD_PRESC_SET(SYNTH_SYNTH1_PWD_PRESC_RESET) | \ - SYNTH_SYNTH1_PWD_LODIV_SET(SYNTH_SYNTH1_PWD_LODIV_RESET) | \ - SYNTH_SYNTH1_PWD_LOMIX_SET(SYNTH_SYNTH1_PWD_LOMIX_RESET) | \ - SYNTH_SYNTH1_FORCE_LO_ON_SET(SYNTH_SYNTH1_FORCE_LO_ON_RESET) | \ - SYNTH_SYNTH1_PWD_LOBUF5G_SET(SYNTH_SYNTH1_PWD_LOBUF5G_RESET) | \ - SYNTH_SYNTH1_VCOREGBYPASS_SET(SYNTH_SYNTH1_VCOREGBYPASS_RESET) | \ - SYNTH_SYNTH1_VCOREGLEVEL_SET(SYNTH_SYNTH1_VCOREGLEVEL_RESET) | \ - SYNTH_SYNTH1_VCOREGBIAS_SET(SYNTH_SYNTH1_VCOREGBIAS_RESET) | \ - SYNTH_SYNTH1_SLIDINGIF_SET(SYNTH_SYNTH1_SLIDINGIF_RESET) | \ - SYNTH_SYNTH1_SPARE_PWD_SET(SYNTH_SYNTH1_SPARE_PWD_RESET) | \ - SYNTH_SYNTH1_CON_VDDVCOREG_SET(SYNTH_SYNTH1_CON_VDDVCOREG_RESET) | \ - SYNTH_SYNTH1_CON_IVCOREG_SET(SYNTH_SYNTH1_CON_IVCOREG_RESET) | \ - SYNTH_SYNTH1_CON_IVCOBUF_SET(SYNTH_SYNTH1_CON_IVCOBUF_RESET) | \ - SYNTH_SYNTH1_SEL_VCMONABUS_SET(SYNTH_SYNTH1_SEL_VCMONABUS_RESET) | \ - SYNTH_SYNTH1_PWUP_VCOBUF_PD_SET(SYNTH_SYNTH1_PWUP_VCOBUF_PD_RESET) | \ - SYNTH_SYNTH1_PWUP_LODIV_PD_SET(SYNTH_SYNTH1_PWUP_LODIV_PD_RESET) | \ - SYNTH_SYNTH1_PWUP_LOMIX_PD_SET(SYNTH_SYNTH1_PWUP_LOMIX_PD_RESET) | \ - SYNTH_SYNTH1_PWUP_LOBUF5G_PD_SET(SYNTH_SYNTH1_PWUP_LOBUF5G_PD_RESET) | \ - SYNTH_SYNTH1_MONITOR_FB_SET(SYNTH_SYNTH1_MONITOR_FB_RESET) | \ - SYNTH_SYNTH1_MONITOR_REF_SET(SYNTH_SYNTH1_MONITOR_REF_RESET) | \ - SYNTH_SYNTH1_MONITOR_FB_DIV2_SET(SYNTH_SYNTH1_MONITOR_FB_DIV2_RESET) | \ - SYNTH_SYNTH1_MONITOR_VC2HIGH_SET(SYNTH_SYNTH1_MONITOR_VC2HIGH_RESET) | \ - SYNTH_SYNTH1_MONITOR_VC2LOW_SET(SYNTH_SYNTH1_MONITOR_VC2LOW_RESET) | \ - SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_SET(SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_RESET)) -#define SYNTH_SYNTH1_HW_MASK (32'h0) -#define SYNTH_SYNTH1_SW_MASK (32'h0 | \ - SYNTH_SYNTH1_PWD_BIAS_MASK | \ - SYNTH_SYNTH1_PWD_CP_MASK | \ - SYNTH_SYNTH1_PWD_VCMON_MASK | \ - SYNTH_SYNTH1_PWD_VCO_MASK | \ - SYNTH_SYNTH1_PWD_PRESC_MASK | \ - SYNTH_SYNTH1_PWD_LODIV_MASK | \ - SYNTH_SYNTH1_PWD_LOMIX_MASK | \ - SYNTH_SYNTH1_FORCE_LO_ON_MASK | \ - SYNTH_SYNTH1_PWD_LOBUF5G_MASK | \ - SYNTH_SYNTH1_VCOREGBYPASS_MASK | \ - SYNTH_SYNTH1_VCOREGLEVEL_MASK | \ - SYNTH_SYNTH1_VCOREGBIAS_MASK | \ - SYNTH_SYNTH1_SLIDINGIF_MASK | \ - SYNTH_SYNTH1_SPARE_PWD_MASK | \ - SYNTH_SYNTH1_CON_VDDVCOREG_MASK | \ - SYNTH_SYNTH1_CON_IVCOREG_MASK | \ - SYNTH_SYNTH1_CON_IVCOBUF_MASK | \ - SYNTH_SYNTH1_SEL_VCMONABUS_MASK | \ - SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK | \ - SYNTH_SYNTH1_PWUP_LODIV_PD_MASK | \ - SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK | \ - SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK | \ - SYNTH_SYNTH1_MONITOR_FB_MASK | \ - SYNTH_SYNTH1_MONITOR_REF_MASK | \ - SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK | \ - SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK | \ - SYNTH_SYNTH1_MONITOR_VC2LOW_MASK | \ - SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) - -#define SYNTH_SYNTH2_ADDRESS 'h00000004 -#define SYNTH_SYNTH2_VC_CAL_REF_MSB 31 -#define SYNTH_SYNTH2_VC_CAL_REF_LSB 29 -#define SYNTH_SYNTH2_VC_CAL_REF_MASK 'he0000000 -#define SYNTH_SYNTH2_VC_CAL_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_CAL_REF_MASK) >> SYNTH_SYNTH2_VC_CAL_REF_LSB) -#define SYNTH_SYNTH2_VC_CAL_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_CAL_REF_LSB) & SYNTH_SYNTH2_VC_CAL_REF_MASK) -#define SYNTH_SYNTH2_VC_CAL_REF_RESET 3'h0 -#define SYNTH_SYNTH2_VC_HI_REF_MSB 28 -#define SYNTH_SYNTH2_VC_HI_REF_LSB 26 -#define SYNTH_SYNTH2_VC_HI_REF_MASK 'h1c000000 -#define SYNTH_SYNTH2_VC_HI_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_HI_REF_MASK) >> SYNTH_SYNTH2_VC_HI_REF_LSB) -#define SYNTH_SYNTH2_VC_HI_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_HI_REF_LSB) & SYNTH_SYNTH2_VC_HI_REF_MASK) -#define SYNTH_SYNTH2_VC_HI_REF_RESET 3'h3 -#define SYNTH_SYNTH2_VC_MID_REF_MSB 25 -#define SYNTH_SYNTH2_VC_MID_REF_LSB 23 -#define SYNTH_SYNTH2_VC_MID_REF_MASK 'h03800000 -#define SYNTH_SYNTH2_VC_MID_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_MID_REF_MASK) >> SYNTH_SYNTH2_VC_MID_REF_LSB) -#define SYNTH_SYNTH2_VC_MID_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_MID_REF_LSB) & SYNTH_SYNTH2_VC_MID_REF_MASK) -#define SYNTH_SYNTH2_VC_MID_REF_RESET 3'h4 -#define SYNTH_SYNTH2_VC_LOW_REF_MSB 22 -#define SYNTH_SYNTH2_VC_LOW_REF_LSB 20 -#define SYNTH_SYNTH2_VC_LOW_REF_MASK 'h00700000 -#define SYNTH_SYNTH2_VC_LOW_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_LOW_REF_MASK) >> SYNTH_SYNTH2_VC_LOW_REF_LSB) -#define SYNTH_SYNTH2_VC_LOW_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_LOW_REF_LSB) & SYNTH_SYNTH2_VC_LOW_REF_MASK) -#define SYNTH_SYNTH2_VC_LOW_REF_RESET 3'h4 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MSB 19 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB 15 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK 'h000f8000 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_GET(x) (((x) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) >> SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_RESET 5'h8 -#define SYNTH_SYNTH2_LOOP_CP_MSB 14 -#define SYNTH_SYNTH2_LOOP_CP_LSB 10 -#define SYNTH_SYNTH2_LOOP_CP_MASK 'h00007c00 -#define SYNTH_SYNTH2_LOOP_CP_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CP_MASK) >> SYNTH_SYNTH2_LOOP_CP_LSB) -#define SYNTH_SYNTH2_LOOP_CP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_CP_LSB) & SYNTH_SYNTH2_LOOP_CP_MASK) -#define SYNTH_SYNTH2_LOOP_CP_RESET 5'h8 -#define SYNTH_SYNTH2_LOOP_RS_MSB 9 -#define SYNTH_SYNTH2_LOOP_RS_LSB 5 -#define SYNTH_SYNTH2_LOOP_RS_MASK 'h000003e0 -#define SYNTH_SYNTH2_LOOP_RS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_RS_MASK) >> SYNTH_SYNTH2_LOOP_RS_LSB) -#define SYNTH_SYNTH2_LOOP_RS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_RS_LSB) & SYNTH_SYNTH2_LOOP_RS_MASK) -#define SYNTH_SYNTH2_LOOP_RS_RESET 5'h5 -#define SYNTH_SYNTH2_LOOP_CS_MSB 4 -#define SYNTH_SYNTH2_LOOP_CS_LSB 3 -#define SYNTH_SYNTH2_LOOP_CS_MASK 'h00000018 -#define SYNTH_SYNTH2_LOOP_CS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CS_MASK) >> SYNTH_SYNTH2_LOOP_CS_LSB) -#define SYNTH_SYNTH2_LOOP_CS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_CS_LSB) & SYNTH_SYNTH2_LOOP_CS_MASK) -#define SYNTH_SYNTH2_LOOP_CS_RESET 2'h3 -#define SYNTH_SYNTH2_SPARE_BITS_MSB 2 -#define SYNTH_SYNTH2_SPARE_BITS_LSB 0 -#define SYNTH_SYNTH2_SPARE_BITS_MASK 'h00000007 -#define SYNTH_SYNTH2_SPARE_BITS_GET(x) (((x) & SYNTH_SYNTH2_SPARE_BITS_MASK) >> SYNTH_SYNTH2_SPARE_BITS_LSB) -#define SYNTH_SYNTH2_SPARE_BITS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_SPARE_BITS_LSB) & SYNTH_SYNTH2_SPARE_BITS_MASK) -#define SYNTH_SYNTH2_SPARE_BITS_RESET 3'h0 -#define SYNTH_SYNTH2_RESET (32'h0 | \ - SYNTH_SYNTH2_VC_CAL_REF_SET(SYNTH_SYNTH2_VC_CAL_REF_RESET) | \ - SYNTH_SYNTH2_VC_HI_REF_SET(SYNTH_SYNTH2_VC_HI_REF_RESET) | \ - SYNTH_SYNTH2_VC_MID_REF_SET(SYNTH_SYNTH2_VC_MID_REF_RESET) | \ - SYNTH_SYNTH2_VC_LOW_REF_SET(SYNTH_SYNTH2_VC_LOW_REF_RESET) | \ - SYNTH_SYNTH2_LOOP_3RD_ORDER_R_SET(SYNTH_SYNTH2_LOOP_3RD_ORDER_R_RESET) | \ - SYNTH_SYNTH2_LOOP_CP_SET(SYNTH_SYNTH2_LOOP_CP_RESET) | \ - SYNTH_SYNTH2_LOOP_RS_SET(SYNTH_SYNTH2_LOOP_RS_RESET) | \ - SYNTH_SYNTH2_LOOP_CS_SET(SYNTH_SYNTH2_LOOP_CS_RESET) | \ - SYNTH_SYNTH2_SPARE_BITS_SET(SYNTH_SYNTH2_SPARE_BITS_RESET)) -#define SYNTH_SYNTH2_HW_MASK (32'h0) -#define SYNTH_SYNTH2_SW_MASK (32'h0 | \ - SYNTH_SYNTH2_VC_CAL_REF_MASK | \ - SYNTH_SYNTH2_VC_HI_REF_MASK | \ - SYNTH_SYNTH2_VC_MID_REF_MASK | \ - SYNTH_SYNTH2_VC_LOW_REF_MASK | \ - SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK | \ - SYNTH_SYNTH2_LOOP_CP_MASK | \ - SYNTH_SYNTH2_LOOP_RS_MASK | \ - SYNTH_SYNTH2_LOOP_CS_MASK | \ - SYNTH_SYNTH2_SPARE_BITS_MASK) - -#define SYNTH_SYNTH3_ADDRESS 'h00000008 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_LSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MASK 'h80000000 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_GET(x) (((x) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) >> SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) -#define SYNTH_SYNTH3_DIS_CLK_XTAL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) -#define SYNTH_SYNTH3_DIS_CLK_XTAL_RESET 1'h0 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_LSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MASK 'h40000000 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_GET(x) (((x) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) >> SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_RESET 1'h1 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MSB 29 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB 24 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK 'h3f000000 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_RESET 6'h14 -#define SYNTH_SYNTH3_WAIT_PWRUP_MSB 23 -#define SYNTH_SYNTH3_WAIT_PWRUP_LSB 18 -#define SYNTH_SYNTH3_WAIT_PWRUP_MASK 'h00fc0000 -#define SYNTH_SYNTH3_WAIT_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_PWRUP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_PWRUP_RESET 6'h8 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MSB 17 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_LSB 12 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MASK 'h0003f000 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_RESET 6'h14 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MSB 11 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_LSB 6 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MASK 'h00000fc0 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_RESET 6'h14 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MSB 5 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_LSB 0 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MASK 'h0000003f -#define SYNTH_SYNTH3_WAIT_VC_CHECK_GET(x) (((x) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) >> SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_RESET 6'h14 -#define SYNTH_SYNTH3_RESET (32'h0 | \ - SYNTH_SYNTH3_DIS_CLK_XTAL_SET(SYNTH_SYNTH3_DIS_CLK_XTAL_RESET) | \ - SYNTH_SYNTH3_SEL_CLK_DIV2_SET(SYNTH_SYNTH3_SEL_CLK_DIV2_RESET) | \ - SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_SET(SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_RESET) | \ - SYNTH_SYNTH3_WAIT_PWRUP_SET(SYNTH_SYNTH3_WAIT_PWRUP_RESET) | \ - SYNTH_SYNTH3_WAIT_CAL_BIN_SET(SYNTH_SYNTH3_WAIT_CAL_BIN_RESET) | \ - SYNTH_SYNTH3_WAIT_CAL_LIN_SET(SYNTH_SYNTH3_WAIT_CAL_LIN_RESET) | \ - SYNTH_SYNTH3_WAIT_VC_CHECK_SET(SYNTH_SYNTH3_WAIT_VC_CHECK_RESET)) -#define SYNTH_SYNTH3_HW_MASK (32'h0) -#define SYNTH_SYNTH3_SW_MASK (32'h0 | \ - SYNTH_SYNTH3_DIS_CLK_XTAL_MASK | \ - SYNTH_SYNTH3_SEL_CLK_DIV2_MASK | \ - SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK | \ - SYNTH_SYNTH3_WAIT_PWRUP_MASK | \ - SYNTH_SYNTH3_WAIT_CAL_BIN_MASK | \ - SYNTH_SYNTH3_WAIT_CAL_LIN_MASK | \ - SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) - -#define SYNTH_SYNTH4_ADDRESS 'h0000000c -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK 'h80000000 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_GET(x) (((x) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) >> SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_RESET 1'h0 -#define SYNTH_SYNTH4_DIS_LOSTVC_MSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_LSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_MASK 'h40000000 -#define SYNTH_SYNTH4_DIS_LOSTVC_GET(x) (((x) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) >> SYNTH_SYNTH4_DIS_LOSTVC_LSB) -#define SYNTH_SYNTH4_DIS_LOSTVC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_DIS_LOSTVC_LSB) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) -#define SYNTH_SYNTH4_DIS_LOSTVC_RESET 1'h0 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_LSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MASK 'h20000000 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_GET(x) (((x) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) >> SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_RESET 1'h0 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK 'h10000000 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_GET(x) (((x) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) >> SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_RESET 1'h1 -#define SYNTH_SYNTH4_FORCE_PINVC_MSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_LSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_MASK 'h08000000 -#define SYNTH_SYNTH4_FORCE_PINVC_GET(x) (((x) & SYNTH_SYNTH4_FORCE_PINVC_MASK) >> SYNTH_SYNTH4_FORCE_PINVC_LSB) -#define SYNTH_SYNTH4_FORCE_PINVC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_FORCE_PINVC_LSB) & SYNTH_SYNTH4_FORCE_PINVC_MASK) -#define SYNTH_SYNTH4_FORCE_PINVC_RESET 1'h0 -#define SYNTH_SYNTH4_FORCE_VCOCAP_MSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_LSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_MASK 'h04000000 -#define SYNTH_SYNTH4_FORCE_VCOCAP_GET(x) (((x) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) >> SYNTH_SYNTH4_FORCE_VCOCAP_LSB) -#define SYNTH_SYNTH4_FORCE_VCOCAP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_FORCE_VCOCAP_LSB) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) -#define SYNTH_SYNTH4_FORCE_VCOCAP_RESET 1'h0 -#define SYNTH_SYNTH4_VCOCAP_OVR_MSB 25 -#define SYNTH_SYNTH4_VCOCAP_OVR_LSB 18 -#define SYNTH_SYNTH4_VCOCAP_OVR_MASK 'h03fc0000 -#define SYNTH_SYNTH4_VCOCAP_OVR_GET(x) (((x) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) >> SYNTH_SYNTH4_VCOCAP_OVR_LSB) -#define SYNTH_SYNTH4_VCOCAP_OVR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_VCOCAP_OVR_LSB) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) -#define SYNTH_SYNTH4_VCOCAP_OVR_RESET 8'h80 -#define SYNTH_SYNTH4_VCOCAPPULLUP_MSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_LSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_MASK 'h00020000 -#define SYNTH_SYNTH4_VCOCAPPULLUP_GET(x) (((x) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) >> SYNTH_SYNTH4_VCOCAPPULLUP_LSB) -#define SYNTH_SYNTH4_VCOCAPPULLUP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_VCOCAPPULLUP_LSB) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) -#define SYNTH_SYNTH4_VCOCAPPULLUP_RESET 1'h1 -#define SYNTH_SYNTH4_REFDIVSEL_MSB 16 -#define SYNTH_SYNTH4_REFDIVSEL_LSB 15 -#define SYNTH_SYNTH4_REFDIVSEL_MASK 'h00018000 -#define SYNTH_SYNTH4_REFDIVSEL_GET(x) (((x) & SYNTH_SYNTH4_REFDIVSEL_MASK) >> SYNTH_SYNTH4_REFDIVSEL_LSB) -#define SYNTH_SYNTH4_REFDIVSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_REFDIVSEL_LSB) & SYNTH_SYNTH4_REFDIVSEL_MASK) -#define SYNTH_SYNTH4_REFDIVSEL_RESET 2'h0 -#define SYNTH_SYNTH4_PFDDELAY_MSB 14 -#define SYNTH_SYNTH4_PFDDELAY_LSB 14 -#define SYNTH_SYNTH4_PFDDELAY_MASK 'h00004000 -#define SYNTH_SYNTH4_PFDDELAY_GET(x) (((x) & SYNTH_SYNTH4_PFDDELAY_MASK) >> SYNTH_SYNTH4_PFDDELAY_LSB) -#define SYNTH_SYNTH4_PFDDELAY_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PFDDELAY_LSB) & SYNTH_SYNTH4_PFDDELAY_MASK) -#define SYNTH_SYNTH4_PFDDELAY_RESET 1'h1 -#define SYNTH_SYNTH4_PFD_DISABLE_MSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_LSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_MASK 'h00002000 -#define SYNTH_SYNTH4_PFD_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_PFD_DISABLE_MASK) >> SYNTH_SYNTH4_PFD_DISABLE_LSB) -#define SYNTH_SYNTH4_PFD_DISABLE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PFD_DISABLE_LSB) & SYNTH_SYNTH4_PFD_DISABLE_MASK) -#define SYNTH_SYNTH4_PFD_DISABLE_RESET 1'h0 -#define SYNTH_SYNTH4_PRESCSEL_MSB 12 -#define SYNTH_SYNTH4_PRESCSEL_LSB 11 -#define SYNTH_SYNTH4_PRESCSEL_MASK 'h00001800 -#define SYNTH_SYNTH4_PRESCSEL_GET(x) (((x) & SYNTH_SYNTH4_PRESCSEL_MASK) >> SYNTH_SYNTH4_PRESCSEL_LSB) -#define SYNTH_SYNTH4_PRESCSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PRESCSEL_LSB) & SYNTH_SYNTH4_PRESCSEL_MASK) -#define SYNTH_SYNTH4_PRESCSEL_RESET 2'h3 -#define SYNTH_SYNTH4_RESET_PRESC_MSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_LSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_MASK 'h00000400 -#define SYNTH_SYNTH4_RESET_PRESC_GET(x) (((x) & SYNTH_SYNTH4_RESET_PRESC_MASK) >> SYNTH_SYNTH4_RESET_PRESC_LSB) -#define SYNTH_SYNTH4_RESET_PRESC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_RESET_PRESC_LSB) & SYNTH_SYNTH4_RESET_PRESC_MASK) -#define SYNTH_SYNTH4_RESET_PRESC_RESET 1'h0 -#define SYNTH_SYNTH4_SDM_DISABLE_MSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_LSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_MASK 'h00000200 -#define SYNTH_SYNTH4_SDM_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_SDM_DISABLE_MASK) >> SYNTH_SYNTH4_SDM_DISABLE_LSB) -#define SYNTH_SYNTH4_SDM_DISABLE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SDM_DISABLE_LSB) & SYNTH_SYNTH4_SDM_DISABLE_MASK) -#define SYNTH_SYNTH4_SDM_DISABLE_RESET 1'h0 -#define SYNTH_SYNTH4_SDM_MODE_MSB 8 -#define SYNTH_SYNTH4_SDM_MODE_LSB 8 -#define SYNTH_SYNTH4_SDM_MODE_MASK 'h00000100 -#define SYNTH_SYNTH4_SDM_MODE_GET(x) (((x) & SYNTH_SYNTH4_SDM_MODE_MASK) >> SYNTH_SYNTH4_SDM_MODE_LSB) -#define SYNTH_SYNTH4_SDM_MODE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SDM_MODE_LSB) & SYNTH_SYNTH4_SDM_MODE_MASK) -#define SYNTH_SYNTH4_SDM_MODE_RESET 1'h0 -#define SYNTH_SYNTH4_SDM_DITHER_MSB 7 -#define SYNTH_SYNTH4_SDM_DITHER_LSB 6 -#define SYNTH_SYNTH4_SDM_DITHER_MASK 'h000000c0 -#define SYNTH_SYNTH4_SDM_DITHER_GET(x) (((x) & SYNTH_SYNTH4_SDM_DITHER_MASK) >> SYNTH_SYNTH4_SDM_DITHER_LSB) -#define SYNTH_SYNTH4_SDM_DITHER_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SDM_DITHER_LSB) & SYNTH_SYNTH4_SDM_DITHER_MASK) -#define SYNTH_SYNTH4_SDM_DITHER_RESET 2'h0 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK 'h00000020 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_GET(x) (((x) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) >> SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_RESET 1'h0 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK 'h00000010 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_GET(x) (((x) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) >> SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_RESET 1'h0 -#define SYNTH_SYNTH4_SPARE_MISC_MSB 3 -#define SYNTH_SYNTH4_SPARE_MISC_LSB 2 -#define SYNTH_SYNTH4_SPARE_MISC_MASK 'h0000000c -#define SYNTH_SYNTH4_SPARE_MISC_GET(x) (((x) & SYNTH_SYNTH4_SPARE_MISC_MASK) >> SYNTH_SYNTH4_SPARE_MISC_LSB) -#define SYNTH_SYNTH4_SPARE_MISC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SPARE_MISC_LSB) & SYNTH_SYNTH4_SPARE_MISC_MASK) -#define SYNTH_SYNTH4_SPARE_MISC_RESET 2'h0 -#define SYNTH_SYNTH4_LONGSHIFTSEL_MSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_LSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_MASK 'h00000002 -#define SYNTH_SYNTH4_LONGSHIFTSEL_GET(x) (((x) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) >> SYNTH_SYNTH4_LONGSHIFTSEL_LSB) -#define SYNTH_SYNTH4_LONGSHIFTSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_LONGSHIFTSEL_LSB) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) -#define SYNTH_SYNTH4_LONGSHIFTSEL_RESET 1'h0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_LSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MASK 'h00000001 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_GET(x) (((x) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) >> SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_RESET 1'h0 -#define SYNTH_SYNTH4_RESET (32'h0 | \ - SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_SET(SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_RESET) | \ - SYNTH_SYNTH4_DIS_LOSTVC_SET(SYNTH_SYNTH4_DIS_LOSTVC_RESET) | \ - SYNTH_SYNTH4_ALWAYS_SHORTR_SET(SYNTH_SYNTH4_ALWAYS_SHORTR_RESET) | \ - SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_SET(SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_RESET) | \ - SYNTH_SYNTH4_FORCE_PINVC_SET(SYNTH_SYNTH4_FORCE_PINVC_RESET) | \ - SYNTH_SYNTH4_FORCE_VCOCAP_SET(SYNTH_SYNTH4_FORCE_VCOCAP_RESET) | \ - SYNTH_SYNTH4_VCOCAP_OVR_SET(SYNTH_SYNTH4_VCOCAP_OVR_RESET) | \ - SYNTH_SYNTH4_VCOCAPPULLUP_SET(SYNTH_SYNTH4_VCOCAPPULLUP_RESET) | \ - SYNTH_SYNTH4_REFDIVSEL_SET(SYNTH_SYNTH4_REFDIVSEL_RESET) | \ - SYNTH_SYNTH4_PFDDELAY_SET(SYNTH_SYNTH4_PFDDELAY_RESET) | \ - SYNTH_SYNTH4_PFD_DISABLE_SET(SYNTH_SYNTH4_PFD_DISABLE_RESET) | \ - SYNTH_SYNTH4_PRESCSEL_SET(SYNTH_SYNTH4_PRESCSEL_RESET) | \ - SYNTH_SYNTH4_RESET_PRESC_SET(SYNTH_SYNTH4_RESET_PRESC_RESET) | \ - SYNTH_SYNTH4_SDM_DISABLE_SET(SYNTH_SYNTH4_SDM_DISABLE_RESET) | \ - SYNTH_SYNTH4_SDM_MODE_SET(SYNTH_SYNTH4_SDM_MODE_RESET) | \ - SYNTH_SYNTH4_SDM_DITHER_SET(SYNTH_SYNTH4_SDM_DITHER_RESET) | \ - SYNTH_SYNTH4_PSCOUNT_FBSEL_SET(SYNTH_SYNTH4_PSCOUNT_FBSEL_RESET) | \ - SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_SET(SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_RESET) | \ - SYNTH_SYNTH4_SPARE_MISC_SET(SYNTH_SYNTH4_SPARE_MISC_RESET) | \ - SYNTH_SYNTH4_LONGSHIFTSEL_SET(SYNTH_SYNTH4_LONGSHIFTSEL_RESET) | \ - SYNTH_SYNTH4_FORCE_SHIFTREG_SET(SYNTH_SYNTH4_FORCE_SHIFTREG_RESET)) -#define SYNTH_SYNTH4_HW_MASK (32'h0) -#define SYNTH_SYNTH4_SW_MASK (32'h0 | \ - SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK | \ - SYNTH_SYNTH4_DIS_LOSTVC_MASK | \ - SYNTH_SYNTH4_ALWAYS_SHORTR_MASK | \ - SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK | \ - SYNTH_SYNTH4_FORCE_PINVC_MASK | \ - SYNTH_SYNTH4_FORCE_VCOCAP_MASK | \ - SYNTH_SYNTH4_VCOCAP_OVR_MASK | \ - SYNTH_SYNTH4_VCOCAPPULLUP_MASK | \ - SYNTH_SYNTH4_REFDIVSEL_MASK | \ - SYNTH_SYNTH4_PFDDELAY_MASK | \ - SYNTH_SYNTH4_PFD_DISABLE_MASK | \ - SYNTH_SYNTH4_PRESCSEL_MASK | \ - SYNTH_SYNTH4_RESET_PRESC_MASK | \ - SYNTH_SYNTH4_SDM_DISABLE_MASK | \ - SYNTH_SYNTH4_SDM_MODE_MASK | \ - SYNTH_SYNTH4_SDM_DITHER_MASK | \ - SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK | \ - SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK | \ - SYNTH_SYNTH4_SPARE_MISC_MASK | \ - SYNTH_SYNTH4_LONGSHIFTSEL_MASK | \ - SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) - -#define SYNTH_SYNTH5_ADDRESS 'h00000010 -#define SYNTH_SYNTH5_LOOP_IP0_MSB 31 -#define SYNTH_SYNTH5_LOOP_IP0_LSB 28 -#define SYNTH_SYNTH5_LOOP_IP0_MASK 'hf0000000 -#define SYNTH_SYNTH5_LOOP_IP0_GET(x) (((x) & SYNTH_SYNTH5_LOOP_IP0_MASK) >> SYNTH_SYNTH5_LOOP_IP0_LSB) -#define SYNTH_SYNTH5_LOOP_IP0_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_LOOP_IP0_LSB) & SYNTH_SYNTH5_LOOP_IP0_MASK) -#define SYNTH_SYNTH5_LOOP_IP0_RESET 4'hd -#define SYNTH_SYNTH5_SLOPE_IP_MSB 27 -#define SYNTH_SYNTH5_SLOPE_IP_LSB 25 -#define SYNTH_SYNTH5_SLOPE_IP_MASK 'h0e000000 -#define SYNTH_SYNTH5_SLOPE_IP_GET(x) (((x) & SYNTH_SYNTH5_SLOPE_IP_MASK) >> SYNTH_SYNTH5_SLOPE_IP_LSB) -#define SYNTH_SYNTH5_SLOPE_IP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_SLOPE_IP_LSB) & SYNTH_SYNTH5_SLOPE_IP_MASK) -#define SYNTH_SYNTH5_SLOPE_IP_RESET 3'h0 -#define SYNTH_SYNTH5_CPBIAS_MSB 24 -#define SYNTH_SYNTH5_CPBIAS_LSB 23 -#define SYNTH_SYNTH5_CPBIAS_MASK 'h01800000 -#define SYNTH_SYNTH5_CPBIAS_GET(x) (((x) & SYNTH_SYNTH5_CPBIAS_MASK) >> SYNTH_SYNTH5_CPBIAS_LSB) -#define SYNTH_SYNTH5_CPBIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CPBIAS_LSB) & SYNTH_SYNTH5_CPBIAS_MASK) -#define SYNTH_SYNTH5_CPBIAS_RESET 2'h1 -#define SYNTH_SYNTH5_CPSTEERING_EN_MSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_LSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_MASK 'h00400000 -#define SYNTH_SYNTH5_CPSTEERING_EN_GET(x) (((x) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) >> SYNTH_SYNTH5_CPSTEERING_EN_LSB) -#define SYNTH_SYNTH5_CPSTEERING_EN_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CPSTEERING_EN_LSB) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) -#define SYNTH_SYNTH5_CPSTEERING_EN_RESET 1'h0 -#define SYNTH_SYNTH5_CPLOWLK_MSB 21 -#define SYNTH_SYNTH5_CPLOWLK_LSB 21 -#define SYNTH_SYNTH5_CPLOWLK_MASK 'h00200000 -#define SYNTH_SYNTH5_CPLOWLK_GET(x) (((x) & SYNTH_SYNTH5_CPLOWLK_MASK) >> SYNTH_SYNTH5_CPLOWLK_LSB) -#define SYNTH_SYNTH5_CPLOWLK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CPLOWLK_LSB) & SYNTH_SYNTH5_CPLOWLK_MASK) -#define SYNTH_SYNTH5_CPLOWLK_RESET 1'h0 -#define SYNTH_SYNTH5_LOOPLEAKCUR_MSB 20 -#define SYNTH_SYNTH5_LOOPLEAKCUR_LSB 17 -#define SYNTH_SYNTH5_LOOPLEAKCUR_MASK 'h001e0000 -#define SYNTH_SYNTH5_LOOPLEAKCUR_GET(x) (((x) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) >> SYNTH_SYNTH5_LOOPLEAKCUR_LSB) -#define SYNTH_SYNTH5_LOOPLEAKCUR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_LOOPLEAKCUR_LSB) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) -#define SYNTH_SYNTH5_LOOPLEAKCUR_RESET 4'h0 -#define SYNTH_SYNTH5_CAPRANGE1_MSB 16 -#define SYNTH_SYNTH5_CAPRANGE1_LSB 13 -#define SYNTH_SYNTH5_CAPRANGE1_MASK 'h0001e000 -#define SYNTH_SYNTH5_CAPRANGE1_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE1_MASK) >> SYNTH_SYNTH5_CAPRANGE1_LSB) -#define SYNTH_SYNTH5_CAPRANGE1_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CAPRANGE1_LSB) & SYNTH_SYNTH5_CAPRANGE1_MASK) -#define SYNTH_SYNTH5_CAPRANGE1_RESET 4'h4 -#define SYNTH_SYNTH5_CAPRANGE2_MSB 12 -#define SYNTH_SYNTH5_CAPRANGE2_LSB 9 -#define SYNTH_SYNTH5_CAPRANGE2_MASK 'h00001e00 -#define SYNTH_SYNTH5_CAPRANGE2_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE2_MASK) >> SYNTH_SYNTH5_CAPRANGE2_LSB) -#define SYNTH_SYNTH5_CAPRANGE2_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CAPRANGE2_LSB) & SYNTH_SYNTH5_CAPRANGE2_MASK) -#define SYNTH_SYNTH5_CAPRANGE2_RESET 4'h8 -#define SYNTH_SYNTH5_CAPRANGE3_MSB 8 -#define SYNTH_SYNTH5_CAPRANGE3_LSB 5 -#define SYNTH_SYNTH5_CAPRANGE3_MASK 'h000001e0 -#define SYNTH_SYNTH5_CAPRANGE3_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE3_MASK) >> SYNTH_SYNTH5_CAPRANGE3_LSB) -#define SYNTH_SYNTH5_CAPRANGE3_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CAPRANGE3_LSB) & SYNTH_SYNTH5_CAPRANGE3_MASK) -#define SYNTH_SYNTH5_CAPRANGE3_RESET 4'hc -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK 'h00000010 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_RESET 1'h0 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MSB 3 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB 2 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK 'h0000000c -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_GET(x) (((x) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) >> SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_RESET 2'h2 -#define SYNTH_SYNTH5_SPARE_MSB 1 -#define SYNTH_SYNTH5_SPARE_LSB 0 -#define SYNTH_SYNTH5_SPARE_MASK 'h00000003 -#define SYNTH_SYNTH5_SPARE_GET(x) (((x) & SYNTH_SYNTH5_SPARE_MASK) >> SYNTH_SYNTH5_SPARE_LSB) -#define SYNTH_SYNTH5_SPARE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_SPARE_LSB) & SYNTH_SYNTH5_SPARE_MASK) -#define SYNTH_SYNTH5_SPARE_RESET 2'h0 -#define SYNTH_SYNTH5_RESET (32'h0 | \ - SYNTH_SYNTH5_LOOP_IP0_SET(SYNTH_SYNTH5_LOOP_IP0_RESET) | \ - SYNTH_SYNTH5_SLOPE_IP_SET(SYNTH_SYNTH5_SLOPE_IP_RESET) | \ - SYNTH_SYNTH5_CPBIAS_SET(SYNTH_SYNTH5_CPBIAS_RESET) | \ - SYNTH_SYNTH5_CPSTEERING_EN_SET(SYNTH_SYNTH5_CPSTEERING_EN_RESET) | \ - SYNTH_SYNTH5_CPLOWLK_SET(SYNTH_SYNTH5_CPLOWLK_RESET) | \ - SYNTH_SYNTH5_LOOPLEAKCUR_SET(SYNTH_SYNTH5_LOOPLEAKCUR_RESET) | \ - SYNTH_SYNTH5_CAPRANGE1_SET(SYNTH_SYNTH5_CAPRANGE1_RESET) | \ - SYNTH_SYNTH5_CAPRANGE2_SET(SYNTH_SYNTH5_CAPRANGE2_RESET) | \ - SYNTH_SYNTH5_CAPRANGE3_SET(SYNTH_SYNTH5_CAPRANGE3_RESET) | \ - SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_SET(SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_RESET) | \ - SYNTH_SYNTH5_LOBUF5GTUNE_OVR_SET(SYNTH_SYNTH5_LOBUF5GTUNE_OVR_RESET) | \ - SYNTH_SYNTH5_SPARE_SET(SYNTH_SYNTH5_SPARE_RESET)) -#define SYNTH_SYNTH5_HW_MASK (32'h0) -#define SYNTH_SYNTH5_SW_MASK (32'h0 | \ - SYNTH_SYNTH5_LOOP_IP0_MASK | \ - SYNTH_SYNTH5_SLOPE_IP_MASK | \ - SYNTH_SYNTH5_CPBIAS_MASK | \ - SYNTH_SYNTH5_CPSTEERING_EN_MASK | \ - SYNTH_SYNTH5_CPLOWLK_MASK | \ - SYNTH_SYNTH5_LOOPLEAKCUR_MASK | \ - SYNTH_SYNTH5_CAPRANGE1_MASK | \ - SYNTH_SYNTH5_CAPRANGE2_MASK | \ - SYNTH_SYNTH5_CAPRANGE3_MASK | \ - SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK | \ - SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK | \ - SYNTH_SYNTH5_SPARE_MASK) - -#define SYNTH_SYNTH6_ADDRESS 'h00000014 -#define SYNTH_SYNTH6_IRCP_MSB 31 -#define SYNTH_SYNTH6_IRCP_LSB 29 -#define SYNTH_SYNTH6_IRCP_MASK 'he0000000 -#define SYNTH_SYNTH6_IRCP_GET(x) (((x) & SYNTH_SYNTH6_IRCP_MASK) >> SYNTH_SYNTH6_IRCP_LSB) -#define SYNTH_SYNTH6_IRCP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_IRCP_LSB) & SYNTH_SYNTH6_IRCP_MASK) -#define SYNTH_SYNTH6_IRCP_RESET 3'h4 -#define SYNTH_SYNTH6_IRVCMON_MSB 28 -#define SYNTH_SYNTH6_IRVCMON_LSB 26 -#define SYNTH_SYNTH6_IRVCMON_MASK 'h1c000000 -#define SYNTH_SYNTH6_IRVCMON_GET(x) (((x) & SYNTH_SYNTH6_IRVCMON_MASK) >> SYNTH_SYNTH6_IRVCMON_LSB) -#define SYNTH_SYNTH6_IRVCMON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_IRVCMON_LSB) & SYNTH_SYNTH6_IRVCMON_MASK) -#define SYNTH_SYNTH6_IRVCMON_RESET 3'h4 -#define SYNTH_SYNTH6_IRSPARE_MSB 25 -#define SYNTH_SYNTH6_IRSPARE_LSB 23 -#define SYNTH_SYNTH6_IRSPARE_MASK 'h03800000 -#define SYNTH_SYNTH6_IRSPARE_GET(x) (((x) & SYNTH_SYNTH6_IRSPARE_MASK) >> SYNTH_SYNTH6_IRSPARE_LSB) -#define SYNTH_SYNTH6_IRSPARE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_IRSPARE_LSB) & SYNTH_SYNTH6_IRSPARE_MASK) -#define SYNTH_SYNTH6_IRSPARE_RESET 3'h4 -#define SYNTH_SYNTH6_ICPRESC_MSB 22 -#define SYNTH_SYNTH6_ICPRESC_LSB 20 -#define SYNTH_SYNTH6_ICPRESC_MASK 'h00700000 -#define SYNTH_SYNTH6_ICPRESC_GET(x) (((x) & SYNTH_SYNTH6_ICPRESC_MASK) >> SYNTH_SYNTH6_ICPRESC_LSB) -#define SYNTH_SYNTH6_ICPRESC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICPRESC_LSB) & SYNTH_SYNTH6_ICPRESC_MASK) -#define SYNTH_SYNTH6_ICPRESC_RESET 3'h4 -#define SYNTH_SYNTH6_ICLODIV_MSB 19 -#define SYNTH_SYNTH6_ICLODIV_LSB 17 -#define SYNTH_SYNTH6_ICLODIV_MASK 'h000e0000 -#define SYNTH_SYNTH6_ICLODIV_GET(x) (((x) & SYNTH_SYNTH6_ICLODIV_MASK) >> SYNTH_SYNTH6_ICLODIV_LSB) -#define SYNTH_SYNTH6_ICLODIV_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICLODIV_LSB) & SYNTH_SYNTH6_ICLODIV_MASK) -#define SYNTH_SYNTH6_ICLODIV_RESET 3'h4 -#define SYNTH_SYNTH6_ICLOMIX_MSB 16 -#define SYNTH_SYNTH6_ICLOMIX_LSB 14 -#define SYNTH_SYNTH6_ICLOMIX_MASK 'h0001c000 -#define SYNTH_SYNTH6_ICLOMIX_GET(x) (((x) & SYNTH_SYNTH6_ICLOMIX_MASK) >> SYNTH_SYNTH6_ICLOMIX_LSB) -#define SYNTH_SYNTH6_ICLOMIX_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICLOMIX_LSB) & SYNTH_SYNTH6_ICLOMIX_MASK) -#define SYNTH_SYNTH6_ICLOMIX_RESET 3'h4 -#define SYNTH_SYNTH6_ICSPAREA_MSB 13 -#define SYNTH_SYNTH6_ICSPAREA_LSB 11 -#define SYNTH_SYNTH6_ICSPAREA_MASK 'h00003800 -#define SYNTH_SYNTH6_ICSPAREA_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREA_MASK) >> SYNTH_SYNTH6_ICSPAREA_LSB) -#define SYNTH_SYNTH6_ICSPAREA_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICSPAREA_LSB) & SYNTH_SYNTH6_ICSPAREA_MASK) -#define SYNTH_SYNTH6_ICSPAREA_RESET 3'h4 -#define SYNTH_SYNTH6_ICSPAREB_MSB 10 -#define SYNTH_SYNTH6_ICSPAREB_LSB 8 -#define SYNTH_SYNTH6_ICSPAREB_MASK 'h00000700 -#define SYNTH_SYNTH6_ICSPAREB_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREB_MASK) >> SYNTH_SYNTH6_ICSPAREB_LSB) -#define SYNTH_SYNTH6_ICSPAREB_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICSPAREB_LSB) & SYNTH_SYNTH6_ICSPAREB_MASK) -#define SYNTH_SYNTH6_ICSPAREB_RESET 3'h4 -#define SYNTH_SYNTH6_ICVCO_MSB 7 -#define SYNTH_SYNTH6_ICVCO_LSB 5 -#define SYNTH_SYNTH6_ICVCO_MASK 'h000000e0 -#define SYNTH_SYNTH6_ICVCO_GET(x) (((x) & SYNTH_SYNTH6_ICVCO_MASK) >> SYNTH_SYNTH6_ICVCO_LSB) -#define SYNTH_SYNTH6_ICVCO_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICVCO_LSB) & SYNTH_SYNTH6_ICVCO_MASK) -#define SYNTH_SYNTH6_ICVCO_RESET 3'h4 -#define SYNTH_SYNTH6_VCOBUFBIAS_MSB 4 -#define SYNTH_SYNTH6_VCOBUFBIAS_LSB 3 -#define SYNTH_SYNTH6_VCOBUFBIAS_MASK 'h00000018 -#define SYNTH_SYNTH6_VCOBUFBIAS_GET(x) (((x) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) >> SYNTH_SYNTH6_VCOBUFBIAS_LSB) -#define SYNTH_SYNTH6_VCOBUFBIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_VCOBUFBIAS_LSB) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) -#define SYNTH_SYNTH6_VCOBUFBIAS_RESET 2'h2 -#define SYNTH_SYNTH6_SPARE_BIAS_MSB 2 -#define SYNTH_SYNTH6_SPARE_BIAS_LSB 0 -#define SYNTH_SYNTH6_SPARE_BIAS_MASK 'h00000007 -#define SYNTH_SYNTH6_SPARE_BIAS_GET(x) (((x) & SYNTH_SYNTH6_SPARE_BIAS_MASK) >> SYNTH_SYNTH6_SPARE_BIAS_LSB) -#define SYNTH_SYNTH6_SPARE_BIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_SPARE_BIAS_LSB) & SYNTH_SYNTH6_SPARE_BIAS_MASK) -#define SYNTH_SYNTH6_SPARE_BIAS_RESET 3'h0 -#define SYNTH_SYNTH6_RESET (32'h0 | \ - SYNTH_SYNTH6_IRCP_SET(SYNTH_SYNTH6_IRCP_RESET) | \ - SYNTH_SYNTH6_IRVCMON_SET(SYNTH_SYNTH6_IRVCMON_RESET) | \ - SYNTH_SYNTH6_IRSPARE_SET(SYNTH_SYNTH6_IRSPARE_RESET) | \ - SYNTH_SYNTH6_ICPRESC_SET(SYNTH_SYNTH6_ICPRESC_RESET) | \ - SYNTH_SYNTH6_ICLODIV_SET(SYNTH_SYNTH6_ICLODIV_RESET) | \ - SYNTH_SYNTH6_ICLOMIX_SET(SYNTH_SYNTH6_ICLOMIX_RESET) | \ - SYNTH_SYNTH6_ICSPAREA_SET(SYNTH_SYNTH6_ICSPAREA_RESET) | \ - SYNTH_SYNTH6_ICSPAREB_SET(SYNTH_SYNTH6_ICSPAREB_RESET) | \ - SYNTH_SYNTH6_ICVCO_SET(SYNTH_SYNTH6_ICVCO_RESET) | \ - SYNTH_SYNTH6_VCOBUFBIAS_SET(SYNTH_SYNTH6_VCOBUFBIAS_RESET) | \ - SYNTH_SYNTH6_SPARE_BIAS_SET(SYNTH_SYNTH6_SPARE_BIAS_RESET)) -#define SYNTH_SYNTH6_HW_MASK (32'h0) -#define SYNTH_SYNTH6_SW_MASK (32'h0 | \ - SYNTH_SYNTH6_IRCP_MASK | \ - SYNTH_SYNTH6_IRVCMON_MASK | \ - SYNTH_SYNTH6_IRSPARE_MASK | \ - SYNTH_SYNTH6_ICPRESC_MASK | \ - SYNTH_SYNTH6_ICLODIV_MASK | \ - SYNTH_SYNTH6_ICLOMIX_MASK | \ - SYNTH_SYNTH6_ICSPAREA_MASK | \ - SYNTH_SYNTH6_ICSPAREB_MASK | \ - SYNTH_SYNTH6_ICVCO_MASK | \ - SYNTH_SYNTH6_VCOBUFBIAS_MASK | \ - SYNTH_SYNTH6_SPARE_BIAS_MASK) - -#define SYNTH_SYNTH7_ADDRESS 'h00000018 -#define SYNTH_SYNTH7_SYNTH_ON_MSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_LSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_MASK 'h80000000 -#define SYNTH_SYNTH7_SYNTH_ON_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_ON_MASK) >> SYNTH_SYNTH7_SYNTH_ON_LSB) -#define SYNTH_SYNTH7_SYNTH_ON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SYNTH_ON_LSB) & SYNTH_SYNTH7_SYNTH_ON_MASK) -#define SYNTH_SYNTH7_SYNTH_ON_RESET 1'h0 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MSB 30 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_LSB 27 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MASK 'h78000000 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) >> SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_RESET 4'h0 -#define SYNTH_SYNTH7_CAP_SEARCH_MSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_LSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_MASK 'h04000000 -#define SYNTH_SYNTH7_CAP_SEARCH_GET(x) (((x) & SYNTH_SYNTH7_CAP_SEARCH_MASK) >> SYNTH_SYNTH7_CAP_SEARCH_LSB) -#define SYNTH_SYNTH7_CAP_SEARCH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_CAP_SEARCH_LSB) & SYNTH_SYNTH7_CAP_SEARCH_MASK) -#define SYNTH_SYNTH7_CAP_SEARCH_RESET 1'h0 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK 'h02000000 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) >> SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_RESET 1'h0 -#define SYNTH_SYNTH7_PIN_VC_MSB 24 -#define SYNTH_SYNTH7_PIN_VC_LSB 24 -#define SYNTH_SYNTH7_PIN_VC_MASK 'h01000000 -#define SYNTH_SYNTH7_PIN_VC_GET(x) (((x) & SYNTH_SYNTH7_PIN_VC_MASK) >> SYNTH_SYNTH7_PIN_VC_LSB) -#define SYNTH_SYNTH7_PIN_VC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_PIN_VC_LSB) & SYNTH_SYNTH7_PIN_VC_MASK) -#define SYNTH_SYNTH7_PIN_VC_RESET 1'h0 -#define SYNTH_SYNTH7_VCO_CAP_ST_MSB 23 -#define SYNTH_SYNTH7_VCO_CAP_ST_LSB 16 -#define SYNTH_SYNTH7_VCO_CAP_ST_MASK 'h00ff0000 -#define SYNTH_SYNTH7_VCO_CAP_ST_GET(x) (((x) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) >> SYNTH_SYNTH7_VCO_CAP_ST_LSB) -#define SYNTH_SYNTH7_VCO_CAP_ST_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_VCO_CAP_ST_LSB) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) -#define SYNTH_SYNTH7_VCO_CAP_ST_RESET 8'h0 -#define SYNTH_SYNTH7_SHORT_R_MSB 15 -#define SYNTH_SYNTH7_SHORT_R_LSB 15 -#define SYNTH_SYNTH7_SHORT_R_MASK 'h00008000 -#define SYNTH_SYNTH7_SHORT_R_GET(x) (((x) & SYNTH_SYNTH7_SHORT_R_MASK) >> SYNTH_SYNTH7_SHORT_R_LSB) -#define SYNTH_SYNTH7_SHORT_R_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SHORT_R_LSB) & SYNTH_SYNTH7_SHORT_R_MASK) -#define SYNTH_SYNTH7_SHORT_R_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_RFD_MSB 14 -#define SYNTH_SYNTH7_RESET_RFD_LSB 14 -#define SYNTH_SYNTH7_RESET_RFD_MASK 'h00004000 -#define SYNTH_SYNTH7_RESET_RFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_RFD_MASK) >> SYNTH_SYNTH7_RESET_RFD_LSB) -#define SYNTH_SYNTH7_RESET_RFD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_RFD_LSB) & SYNTH_SYNTH7_RESET_RFD_MASK) -#define SYNTH_SYNTH7_RESET_RFD_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_PFD_MSB 13 -#define SYNTH_SYNTH7_RESET_PFD_LSB 13 -#define SYNTH_SYNTH7_RESET_PFD_MASK 'h00002000 -#define SYNTH_SYNTH7_RESET_PFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_PFD_MASK) >> SYNTH_SYNTH7_RESET_PFD_LSB) -#define SYNTH_SYNTH7_RESET_PFD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_PFD_LSB) & SYNTH_SYNTH7_RESET_PFD_MASK) -#define SYNTH_SYNTH7_RESET_PFD_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK 'h00001000 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_GET(x) (((x) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) >> SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_SDM_B_MSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_LSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_MASK 'h00000800 -#define SYNTH_SYNTH7_RESET_SDM_B_GET(x) (((x) & SYNTH_SYNTH7_RESET_SDM_B_MASK) >> SYNTH_SYNTH7_RESET_SDM_B_LSB) -#define SYNTH_SYNTH7_RESET_SDM_B_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_SDM_B_LSB) & SYNTH_SYNTH7_RESET_SDM_B_MASK) -#define SYNTH_SYNTH7_RESET_SDM_B_RESET 1'h0 -#define SYNTH_SYNTH7_VC2HIGH_MSB 10 -#define SYNTH_SYNTH7_VC2HIGH_LSB 10 -#define SYNTH_SYNTH7_VC2HIGH_MASK 'h00000400 -#define SYNTH_SYNTH7_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH7_VC2HIGH_MASK) >> SYNTH_SYNTH7_VC2HIGH_LSB) -#define SYNTH_SYNTH7_VC2HIGH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_VC2HIGH_LSB) & SYNTH_SYNTH7_VC2HIGH_MASK) -#define SYNTH_SYNTH7_VC2HIGH_RESET 1'h0 -#define SYNTH_SYNTH7_VC2LOW_MSB 9 -#define SYNTH_SYNTH7_VC2LOW_LSB 9 -#define SYNTH_SYNTH7_VC2LOW_MASK 'h00000200 -#define SYNTH_SYNTH7_VC2LOW_GET(x) (((x) & SYNTH_SYNTH7_VC2LOW_MASK) >> SYNTH_SYNTH7_VC2LOW_LSB) -#define SYNTH_SYNTH7_VC2LOW_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_VC2LOW_LSB) & SYNTH_SYNTH7_VC2LOW_MASK) -#define SYNTH_SYNTH7_VC2LOW_RESET 1'h0 -#define SYNTH_SYNTH7_LOOP_IP_MSB 8 -#define SYNTH_SYNTH7_LOOP_IP_LSB 5 -#define SYNTH_SYNTH7_LOOP_IP_MASK 'h000001e0 -#define SYNTH_SYNTH7_LOOP_IP_GET(x) (((x) & SYNTH_SYNTH7_LOOP_IP_MASK) >> SYNTH_SYNTH7_LOOP_IP_LSB) -#define SYNTH_SYNTH7_LOOP_IP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_LOOP_IP_LSB) & SYNTH_SYNTH7_LOOP_IP_MASK) -#define SYNTH_SYNTH7_LOOP_IP_RESET 4'h0 -#define SYNTH_SYNTH7_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH7_LOBUF5GTUNE_LSB 3 -#define SYNTH_SYNTH7_LOBUF5GTUNE_MASK 'h00000018 -#define SYNTH_SYNTH7_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH7_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH7_LOBUF5GTUNE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_LOBUF5GTUNE_LSB) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH7_LOBUF5GTUNE_RESET 2'h0 -#define SYNTH_SYNTH7_SPARE_READ_MSB 2 -#define SYNTH_SYNTH7_SPARE_READ_LSB 0 -#define SYNTH_SYNTH7_SPARE_READ_MASK 'h00000007 -#define SYNTH_SYNTH7_SPARE_READ_GET(x) (((x) & SYNTH_SYNTH7_SPARE_READ_MASK) >> SYNTH_SYNTH7_SPARE_READ_LSB) -#define SYNTH_SYNTH7_SPARE_READ_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SPARE_READ_LSB) & SYNTH_SYNTH7_SPARE_READ_MASK) -#define SYNTH_SYNTH7_SPARE_READ_RESET 3'h0 -#define SYNTH_SYNTH7_RESET (32'h0 | \ - SYNTH_SYNTH7_SYNTH_ON_SET(SYNTH_SYNTH7_SYNTH_ON_RESET) | \ - SYNTH_SYNTH7_SYNTH_SM_STATE_SET(SYNTH_SYNTH7_SYNTH_SM_STATE_RESET) | \ - SYNTH_SYNTH7_CAP_SEARCH_SET(SYNTH_SYNTH7_CAP_SEARCH_RESET) | \ - SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_SET(SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_RESET) | \ - SYNTH_SYNTH7_PIN_VC_SET(SYNTH_SYNTH7_PIN_VC_RESET) | \ - SYNTH_SYNTH7_VCO_CAP_ST_SET(SYNTH_SYNTH7_VCO_CAP_ST_RESET) | \ - SYNTH_SYNTH7_SHORT_R_SET(SYNTH_SYNTH7_SHORT_R_RESET) | \ - SYNTH_SYNTH7_RESET_RFD_SET(SYNTH_SYNTH7_RESET_RFD_RESET) | \ - SYNTH_SYNTH7_RESET_PFD_SET(SYNTH_SYNTH7_RESET_PFD_RESET) | \ - SYNTH_SYNTH7_RESET_PSCOUNTERS_SET(SYNTH_SYNTH7_RESET_PSCOUNTERS_RESET) | \ - SYNTH_SYNTH7_RESET_SDM_B_SET(SYNTH_SYNTH7_RESET_SDM_B_RESET) | \ - SYNTH_SYNTH7_VC2HIGH_SET(SYNTH_SYNTH7_VC2HIGH_RESET) | \ - SYNTH_SYNTH7_VC2LOW_SET(SYNTH_SYNTH7_VC2LOW_RESET) | \ - SYNTH_SYNTH7_LOOP_IP_SET(SYNTH_SYNTH7_LOOP_IP_RESET) | \ - SYNTH_SYNTH7_LOBUF5GTUNE_SET(SYNTH_SYNTH7_LOBUF5GTUNE_RESET) | \ - SYNTH_SYNTH7_SPARE_READ_SET(SYNTH_SYNTH7_SPARE_READ_RESET)) -#define SYNTH_SYNTH7_HW_MASK (32'h0 | \ - SYNTH_SYNTH7_SYNTH_ON_MASK | \ - SYNTH_SYNTH7_SYNTH_SM_STATE_MASK | \ - SYNTH_SYNTH7_CAP_SEARCH_MASK | \ - SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK | \ - SYNTH_SYNTH7_PIN_VC_MASK | \ - SYNTH_SYNTH7_VCO_CAP_ST_MASK | \ - SYNTH_SYNTH7_SHORT_R_MASK | \ - SYNTH_SYNTH7_RESET_RFD_MASK | \ - SYNTH_SYNTH7_RESET_PFD_MASK | \ - SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK | \ - SYNTH_SYNTH7_RESET_SDM_B_MASK | \ - SYNTH_SYNTH7_VC2HIGH_MASK | \ - SYNTH_SYNTH7_VC2LOW_MASK | \ - SYNTH_SYNTH7_LOOP_IP_MASK | \ - SYNTH_SYNTH7_LOBUF5GTUNE_MASK | \ - SYNTH_SYNTH7_SPARE_READ_MASK) -#define SYNTH_SYNTH7_SW_MASK (32'h0) - -#define SYNTH_SYNTH8_ADDRESS 'h0000001c -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK 'h80000000 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_GET(x) (((x) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) >> SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_RESET 1'h0 -#define SYNTH_SYNTH8_FRACMODE_MSB 30 -#define SYNTH_SYNTH8_FRACMODE_LSB 30 -#define SYNTH_SYNTH8_FRACMODE_MASK 'h40000000 -#define SYNTH_SYNTH8_FRACMODE_GET(x) (((x) & SYNTH_SYNTH8_FRACMODE_MASK) >> SYNTH_SYNTH8_FRACMODE_LSB) -#define SYNTH_SYNTH8_FRACMODE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_FRACMODE_LSB) & SYNTH_SYNTH8_FRACMODE_MASK) -#define SYNTH_SYNTH8_FRACMODE_RESET 1'h0 -#define SYNTH_SYNTH8_AMODEREFSEL_MSB 29 -#define SYNTH_SYNTH8_AMODEREFSEL_LSB 28 -#define SYNTH_SYNTH8_AMODEREFSEL_MASK 'h30000000 -#define SYNTH_SYNTH8_AMODEREFSEL_GET(x) (((x) & SYNTH_SYNTH8_AMODEREFSEL_MASK) >> SYNTH_SYNTH8_AMODEREFSEL_LSB) -#define SYNTH_SYNTH8_AMODEREFSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_AMODEREFSEL_LSB) & SYNTH_SYNTH8_AMODEREFSEL_MASK) -#define SYNTH_SYNTH8_AMODEREFSEL_RESET 2'h0 -#define SYNTH_SYNTH8_SPARE_MSB 27 -#define SYNTH_SYNTH8_SPARE_LSB 27 -#define SYNTH_SYNTH8_SPARE_MASK 'h08000000 -#define SYNTH_SYNTH8_SPARE_GET(x) (((x) & SYNTH_SYNTH8_SPARE_MASK) >> SYNTH_SYNTH8_SPARE_LSB) -#define SYNTH_SYNTH8_SPARE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_SPARE_LSB) & SYNTH_SYNTH8_SPARE_MASK) -#define SYNTH_SYNTH8_SPARE_RESET 1'h0 -#define SYNTH_SYNTH8_CHANSEL_MSB 26 -#define SYNTH_SYNTH8_CHANSEL_LSB 18 -#define SYNTH_SYNTH8_CHANSEL_MASK 'h07fc0000 -#define SYNTH_SYNTH8_CHANSEL_GET(x) (((x) & SYNTH_SYNTH8_CHANSEL_MASK) >> SYNTH_SYNTH8_CHANSEL_LSB) -#define SYNTH_SYNTH8_CHANSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_CHANSEL_LSB) & SYNTH_SYNTH8_CHANSEL_MASK) -#define SYNTH_SYNTH8_CHANSEL_RESET 9'h0 -#define SYNTH_SYNTH8_CHANFRAC_MSB 17 -#define SYNTH_SYNTH8_CHANFRAC_LSB 1 -#define SYNTH_SYNTH8_CHANFRAC_MASK 'h0003fffe -#define SYNTH_SYNTH8_CHANFRAC_GET(x) (((x) & SYNTH_SYNTH8_CHANFRAC_MASK) >> SYNTH_SYNTH8_CHANFRAC_LSB) -#define SYNTH_SYNTH8_CHANFRAC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_CHANFRAC_LSB) & SYNTH_SYNTH8_CHANFRAC_MASK) -#define SYNTH_SYNTH8_CHANFRAC_RESET 17'h0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_MSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_LSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_MASK 'h00000001 -#define SYNTH_SYNTH8_FORCE_FRACLSB_GET(x) (((x) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) >> SYNTH_SYNTH8_FORCE_FRACLSB_LSB) -#define SYNTH_SYNTH8_FORCE_FRACLSB_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_FORCE_FRACLSB_LSB) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) -#define SYNTH_SYNTH8_FORCE_FRACLSB_RESET 1'h0 -#define SYNTH_SYNTH8_RESET (32'h0 | \ - SYNTH_SYNTH8_LOADSYNTHCHANNEL_SET(SYNTH_SYNTH8_LOADSYNTHCHANNEL_RESET) | \ - SYNTH_SYNTH8_FRACMODE_SET(SYNTH_SYNTH8_FRACMODE_RESET) | \ - SYNTH_SYNTH8_AMODEREFSEL_SET(SYNTH_SYNTH8_AMODEREFSEL_RESET) | \ - SYNTH_SYNTH8_SPARE_SET(SYNTH_SYNTH8_SPARE_RESET) | \ - SYNTH_SYNTH8_CHANSEL_SET(SYNTH_SYNTH8_CHANSEL_RESET) | \ - SYNTH_SYNTH8_CHANFRAC_SET(SYNTH_SYNTH8_CHANFRAC_RESET) | \ - SYNTH_SYNTH8_FORCE_FRACLSB_SET(SYNTH_SYNTH8_FORCE_FRACLSB_RESET)) -#define SYNTH_SYNTH8_HW_MASK (32'h0 | \ - SYNTH_SYNTH8_FRACMODE_MASK | \ - SYNTH_SYNTH8_AMODEREFSEL_MASK | \ - SYNTH_SYNTH8_SPARE_MASK | \ - SYNTH_SYNTH8_CHANSEL_MASK | \ - SYNTH_SYNTH8_CHANFRAC_MASK) -#define SYNTH_SYNTH8_SW_MASK (32'h0 | \ - SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK | \ - SYNTH_SYNTH8_FRACMODE_MASK | \ - SYNTH_SYNTH8_AMODEREFSEL_MASK | \ - SYNTH_SYNTH8_SPARE_MASK | \ - SYNTH_SYNTH8_CHANSEL_MASK | \ - SYNTH_SYNTH8_CHANFRAC_MASK | \ - SYNTH_SYNTH8_FORCE_FRACLSB_MASK) - -#define SYNTH_REG_ADDRESS_MSB 4 - -#endif /* _SYNTH_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/top_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/top_reg.h deleted file mode 100644 index 14ed9bfdcb6d..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/top_reg.h +++ /dev/null @@ -1,235 +0,0 @@ -#ifndef _TOP_REG_REG_H_ -#define _TOP_REG_REG_H_ - -#define TOP_GAIN_ADDRESS 0x00000000 -#define TOP_GAIN_OFFSET 0x00000000 -#define TOP_GAIN_TX6DBLOQGAIN_MSB 31 -#define TOP_GAIN_TX6DBLOQGAIN_LSB 30 -#define TOP_GAIN_TX6DBLOQGAIN_MASK 0xc0000000 -#define TOP_GAIN_TX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX6DBLOQGAIN_MASK) >> TOP_GAIN_TX6DBLOQGAIN_LSB) -#define TOP_GAIN_TX6DBLOQGAIN_SET(x) (((x) << TOP_GAIN_TX6DBLOQGAIN_LSB) & TOP_GAIN_TX6DBLOQGAIN_MASK) -#define TOP_GAIN_TX1DBLOQGAIN_MSB 29 -#define TOP_GAIN_TX1DBLOQGAIN_LSB 27 -#define TOP_GAIN_TX1DBLOQGAIN_MASK 0x38000000 -#define TOP_GAIN_TX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX1DBLOQGAIN_MASK) >> TOP_GAIN_TX1DBLOQGAIN_LSB) -#define TOP_GAIN_TX1DBLOQGAIN_SET(x) (((x) << TOP_GAIN_TX1DBLOQGAIN_LSB) & TOP_GAIN_TX1DBLOQGAIN_MASK) -#define TOP_GAIN_TXV2IGAIN_MSB 26 -#define TOP_GAIN_TXV2IGAIN_LSB 25 -#define TOP_GAIN_TXV2IGAIN_MASK 0x06000000 -#define TOP_GAIN_TXV2IGAIN_GET(x) (((x) & TOP_GAIN_TXV2IGAIN_MASK) >> TOP_GAIN_TXV2IGAIN_LSB) -#define TOP_GAIN_TXV2IGAIN_SET(x) (((x) << TOP_GAIN_TXV2IGAIN_LSB) & TOP_GAIN_TXV2IGAIN_MASK) -#define TOP_GAIN_PABUF5GN_MSB 24 -#define TOP_GAIN_PABUF5GN_LSB 24 -#define TOP_GAIN_PABUF5GN_MASK 0x01000000 -#define TOP_GAIN_PABUF5GN_GET(x) (((x) & TOP_GAIN_PABUF5GN_MASK) >> TOP_GAIN_PABUF5GN_LSB) -#define TOP_GAIN_PABUF5GN_SET(x) (((x) << TOP_GAIN_PABUF5GN_LSB) & TOP_GAIN_PABUF5GN_MASK) -#define TOP_GAIN_PADRVGN_MSB 23 -#define TOP_GAIN_PADRVGN_LSB 21 -#define TOP_GAIN_PADRVGN_MASK 0x00e00000 -#define TOP_GAIN_PADRVGN_GET(x) (((x) & TOP_GAIN_PADRVGN_MASK) >> TOP_GAIN_PADRVGN_LSB) -#define TOP_GAIN_PADRVGN_SET(x) (((x) << TOP_GAIN_PADRVGN_LSB) & TOP_GAIN_PADRVGN_MASK) -#define TOP_GAIN_PAOUT2GN_MSB 20 -#define TOP_GAIN_PAOUT2GN_LSB 18 -#define TOP_GAIN_PAOUT2GN_MASK 0x001c0000 -#define TOP_GAIN_PAOUT2GN_GET(x) (((x) & TOP_GAIN_PAOUT2GN_MASK) >> TOP_GAIN_PAOUT2GN_LSB) -#define TOP_GAIN_PAOUT2GN_SET(x) (((x) << TOP_GAIN_PAOUT2GN_LSB) & TOP_GAIN_PAOUT2GN_MASK) -#define TOP_GAIN_LNAON_MSB 17 -#define TOP_GAIN_LNAON_LSB 17 -#define TOP_GAIN_LNAON_MASK 0x00020000 -#define TOP_GAIN_LNAON_GET(x) (((x) & TOP_GAIN_LNAON_MASK) >> TOP_GAIN_LNAON_LSB) -#define TOP_GAIN_LNAON_SET(x) (((x) << TOP_GAIN_LNAON_LSB) & TOP_GAIN_LNAON_MASK) -#define TOP_GAIN_LNAGAIN_MSB 16 -#define TOP_GAIN_LNAGAIN_LSB 13 -#define TOP_GAIN_LNAGAIN_MASK 0x0001e000 -#define TOP_GAIN_LNAGAIN_GET(x) (((x) & TOP_GAIN_LNAGAIN_MASK) >> TOP_GAIN_LNAGAIN_LSB) -#define TOP_GAIN_LNAGAIN_SET(x) (((x) << TOP_GAIN_LNAGAIN_LSB) & TOP_GAIN_LNAGAIN_MASK) -#define TOP_GAIN_RFVGA5GAIN_MSB 12 -#define TOP_GAIN_RFVGA5GAIN_LSB 11 -#define TOP_GAIN_RFVGA5GAIN_MASK 0x00001800 -#define TOP_GAIN_RFVGA5GAIN_GET(x) (((x) & TOP_GAIN_RFVGA5GAIN_MASK) >> TOP_GAIN_RFVGA5GAIN_LSB) -#define TOP_GAIN_RFVGA5GAIN_SET(x) (((x) << TOP_GAIN_RFVGA5GAIN_LSB) & TOP_GAIN_RFVGA5GAIN_MASK) -#define TOP_GAIN_RFGMGN_MSB 10 -#define TOP_GAIN_RFGMGN_LSB 8 -#define TOP_GAIN_RFGMGN_MASK 0x00000700 -#define TOP_GAIN_RFGMGN_GET(x) (((x) & TOP_GAIN_RFGMGN_MASK) >> TOP_GAIN_RFGMGN_LSB) -#define TOP_GAIN_RFGMGN_SET(x) (((x) << TOP_GAIN_RFGMGN_LSB) & TOP_GAIN_RFGMGN_MASK) -#define TOP_GAIN_RX6DBLOQGAIN_MSB 7 -#define TOP_GAIN_RX6DBLOQGAIN_LSB 6 -#define TOP_GAIN_RX6DBLOQGAIN_MASK 0x000000c0 -#define TOP_GAIN_RX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBLOQGAIN_MASK) >> TOP_GAIN_RX6DBLOQGAIN_LSB) -#define TOP_GAIN_RX6DBLOQGAIN_SET(x) (((x) << TOP_GAIN_RX6DBLOQGAIN_LSB) & TOP_GAIN_RX6DBLOQGAIN_MASK) -#define TOP_GAIN_RX1DBLOQGAIN_MSB 5 -#define TOP_GAIN_RX1DBLOQGAIN_LSB 3 -#define TOP_GAIN_RX1DBLOQGAIN_MASK 0x00000038 -#define TOP_GAIN_RX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX1DBLOQGAIN_MASK) >> TOP_GAIN_RX1DBLOQGAIN_LSB) -#define TOP_GAIN_RX1DBLOQGAIN_SET(x) (((x) << TOP_GAIN_RX1DBLOQGAIN_LSB) & TOP_GAIN_RX1DBLOQGAIN_MASK) -#define TOP_GAIN_RX6DBHIQGAIN_MSB 2 -#define TOP_GAIN_RX6DBHIQGAIN_LSB 1 -#define TOP_GAIN_RX6DBHIQGAIN_MASK 0x00000006 -#define TOP_GAIN_RX6DBHIQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBHIQGAIN_MASK) >> TOP_GAIN_RX6DBHIQGAIN_LSB) -#define TOP_GAIN_RX6DBHIQGAIN_SET(x) (((x) << TOP_GAIN_RX6DBHIQGAIN_LSB) & TOP_GAIN_RX6DBHIQGAIN_MASK) -#define TOP_GAIN_SPARE_MSB 0 -#define TOP_GAIN_SPARE_LSB 0 -#define TOP_GAIN_SPARE_MASK 0x00000001 -#define TOP_GAIN_SPARE_GET(x) (((x) & TOP_GAIN_SPARE_MASK) >> TOP_GAIN_SPARE_LSB) -#define TOP_GAIN_SPARE_SET(x) (((x) << TOP_GAIN_SPARE_LSB) & TOP_GAIN_SPARE_MASK) - -#define TOP_TOP_ADDRESS 0x00000004 -#define TOP_TOP_OFFSET 0x00000004 -#define TOP_TOP_LOCALTXGAIN_MSB 31 -#define TOP_TOP_LOCALTXGAIN_LSB 31 -#define TOP_TOP_LOCALTXGAIN_MASK 0x80000000 -#define TOP_TOP_LOCALTXGAIN_GET(x) (((x) & TOP_TOP_LOCALTXGAIN_MASK) >> TOP_TOP_LOCALTXGAIN_LSB) -#define TOP_TOP_LOCALTXGAIN_SET(x) (((x) << TOP_TOP_LOCALTXGAIN_LSB) & TOP_TOP_LOCALTXGAIN_MASK) -#define TOP_TOP_LOCALRXGAIN_MSB 30 -#define TOP_TOP_LOCALRXGAIN_LSB 30 -#define TOP_TOP_LOCALRXGAIN_MASK 0x40000000 -#define TOP_TOP_LOCALRXGAIN_GET(x) (((x) & TOP_TOP_LOCALRXGAIN_MASK) >> TOP_TOP_LOCALRXGAIN_LSB) -#define TOP_TOP_LOCALRXGAIN_SET(x) (((x) << TOP_TOP_LOCALRXGAIN_LSB) & TOP_TOP_LOCALRXGAIN_MASK) -#define TOP_TOP_LOCALMODE_MSB 29 -#define TOP_TOP_LOCALMODE_LSB 29 -#define TOP_TOP_LOCALMODE_MASK 0x20000000 -#define TOP_TOP_LOCALMODE_GET(x) (((x) & TOP_TOP_LOCALMODE_MASK) >> TOP_TOP_LOCALMODE_LSB) -#define TOP_TOP_LOCALMODE_SET(x) (((x) << TOP_TOP_LOCALMODE_LSB) & TOP_TOP_LOCALMODE_MASK) -#define TOP_TOP_CALFC_MSB 28 -#define TOP_TOP_CALFC_LSB 28 -#define TOP_TOP_CALFC_MASK 0x10000000 -#define TOP_TOP_CALFC_GET(x) (((x) & TOP_TOP_CALFC_MASK) >> TOP_TOP_CALFC_LSB) -#define TOP_TOP_CALFC_SET(x) (((x) << TOP_TOP_CALFC_LSB) & TOP_TOP_CALFC_MASK) -#define TOP_TOP_CALDC_MSB 27 -#define TOP_TOP_CALDC_LSB 27 -#define TOP_TOP_CALDC_MASK 0x08000000 -#define TOP_TOP_CALDC_GET(x) (((x) & TOP_TOP_CALDC_MASK) >> TOP_TOP_CALDC_LSB) -#define TOP_TOP_CALDC_SET(x) (((x) << TOP_TOP_CALDC_LSB) & TOP_TOP_CALDC_MASK) -#define TOP_TOP_CAL_RESIDUE_MSB 26 -#define TOP_TOP_CAL_RESIDUE_LSB 26 -#define TOP_TOP_CAL_RESIDUE_MASK 0x04000000 -#define TOP_TOP_CAL_RESIDUE_GET(x) (((x) & TOP_TOP_CAL_RESIDUE_MASK) >> TOP_TOP_CAL_RESIDUE_LSB) -#define TOP_TOP_CAL_RESIDUE_SET(x) (((x) << TOP_TOP_CAL_RESIDUE_LSB) & TOP_TOP_CAL_RESIDUE_MASK) -#define TOP_TOP_BMODE_MSB 25 -#define TOP_TOP_BMODE_LSB 25 -#define TOP_TOP_BMODE_MASK 0x02000000 -#define TOP_TOP_BMODE_GET(x) (((x) & TOP_TOP_BMODE_MASK) >> TOP_TOP_BMODE_LSB) -#define TOP_TOP_BMODE_SET(x) (((x) << TOP_TOP_BMODE_LSB) & TOP_TOP_BMODE_MASK) -#define TOP_TOP_SYNTHON_MSB 24 -#define TOP_TOP_SYNTHON_LSB 24 -#define TOP_TOP_SYNTHON_MASK 0x01000000 -#define TOP_TOP_SYNTHON_GET(x) (((x) & TOP_TOP_SYNTHON_MASK) >> TOP_TOP_SYNTHON_LSB) -#define TOP_TOP_SYNTHON_SET(x) (((x) << TOP_TOP_SYNTHON_LSB) & TOP_TOP_SYNTHON_MASK) -#define TOP_TOP_RXON_MSB 23 -#define TOP_TOP_RXON_LSB 23 -#define TOP_TOP_RXON_MASK 0x00800000 -#define TOP_TOP_RXON_GET(x) (((x) & TOP_TOP_RXON_MASK) >> TOP_TOP_RXON_LSB) -#define TOP_TOP_RXON_SET(x) (((x) << TOP_TOP_RXON_LSB) & TOP_TOP_RXON_MASK) -#define TOP_TOP_TXON_MSB 22 -#define TOP_TOP_TXON_LSB 22 -#define TOP_TOP_TXON_MASK 0x00400000 -#define TOP_TOP_TXON_GET(x) (((x) & TOP_TOP_TXON_MASK) >> TOP_TOP_TXON_LSB) -#define TOP_TOP_TXON_SET(x) (((x) << TOP_TOP_TXON_LSB) & TOP_TOP_TXON_MASK) -#define TOP_TOP_PAON_MSB 21 -#define TOP_TOP_PAON_LSB 21 -#define TOP_TOP_PAON_MASK 0x00200000 -#define TOP_TOP_PAON_GET(x) (((x) & TOP_TOP_PAON_MASK) >> TOP_TOP_PAON_LSB) -#define TOP_TOP_PAON_SET(x) (((x) << TOP_TOP_PAON_LSB) & TOP_TOP_PAON_MASK) -#define TOP_TOP_CALTX_MSB 20 -#define TOP_TOP_CALTX_LSB 20 -#define TOP_TOP_CALTX_MASK 0x00100000 -#define TOP_TOP_CALTX_GET(x) (((x) & TOP_TOP_CALTX_MASK) >> TOP_TOP_CALTX_LSB) -#define TOP_TOP_CALTX_SET(x) (((x) << TOP_TOP_CALTX_LSB) & TOP_TOP_CALTX_MASK) -#define TOP_TOP_LOCALADDAC_MSB 19 -#define TOP_TOP_LOCALADDAC_LSB 19 -#define TOP_TOP_LOCALADDAC_MASK 0x00080000 -#define TOP_TOP_LOCALADDAC_GET(x) (((x) & TOP_TOP_LOCALADDAC_MASK) >> TOP_TOP_LOCALADDAC_LSB) -#define TOP_TOP_LOCALADDAC_SET(x) (((x) << TOP_TOP_LOCALADDAC_LSB) & TOP_TOP_LOCALADDAC_MASK) -#define TOP_TOP_PWDPLL_MSB 18 -#define TOP_TOP_PWDPLL_LSB 18 -#define TOP_TOP_PWDPLL_MASK 0x00040000 -#define TOP_TOP_PWDPLL_GET(x) (((x) & TOP_TOP_PWDPLL_MASK) >> TOP_TOP_PWDPLL_LSB) -#define TOP_TOP_PWDPLL_SET(x) (((x) << TOP_TOP_PWDPLL_LSB) & TOP_TOP_PWDPLL_MASK) -#define TOP_TOP_PWDADC_MSB 17 -#define TOP_TOP_PWDADC_LSB 17 -#define TOP_TOP_PWDADC_MASK 0x00020000 -#define TOP_TOP_PWDADC_GET(x) (((x) & TOP_TOP_PWDADC_MASK) >> TOP_TOP_PWDADC_LSB) -#define TOP_TOP_PWDADC_SET(x) (((x) << TOP_TOP_PWDADC_LSB) & TOP_TOP_PWDADC_MASK) -#define TOP_TOP_PWDDAC_MSB 16 -#define TOP_TOP_PWDDAC_LSB 16 -#define TOP_TOP_PWDDAC_MASK 0x00010000 -#define TOP_TOP_PWDDAC_GET(x) (((x) & TOP_TOP_PWDDAC_MASK) >> TOP_TOP_PWDDAC_LSB) -#define TOP_TOP_PWDDAC_SET(x) (((x) << TOP_TOP_PWDDAC_LSB) & TOP_TOP_PWDDAC_MASK) -#define TOP_TOP_LOCALXTAL_MSB 15 -#define TOP_TOP_LOCALXTAL_LSB 15 -#define TOP_TOP_LOCALXTAL_MASK 0x00008000 -#define TOP_TOP_LOCALXTAL_GET(x) (((x) & TOP_TOP_LOCALXTAL_MASK) >> TOP_TOP_LOCALXTAL_LSB) -#define TOP_TOP_LOCALXTAL_SET(x) (((x) << TOP_TOP_LOCALXTAL_LSB) & TOP_TOP_LOCALXTAL_MASK) -#define TOP_TOP_PWDCLKIN_MSB 14 -#define TOP_TOP_PWDCLKIN_LSB 14 -#define TOP_TOP_PWDCLKIN_MASK 0x00004000 -#define TOP_TOP_PWDCLKIN_GET(x) (((x) & TOP_TOP_PWDCLKIN_MASK) >> TOP_TOP_PWDCLKIN_LSB) -#define TOP_TOP_PWDCLKIN_SET(x) (((x) << TOP_TOP_PWDCLKIN_LSB) & TOP_TOP_PWDCLKIN_MASK) -#define TOP_TOP_OSCON_MSB 13 -#define TOP_TOP_OSCON_LSB 13 -#define TOP_TOP_OSCON_MASK 0x00002000 -#define TOP_TOP_OSCON_GET(x) (((x) & TOP_TOP_OSCON_MASK) >> TOP_TOP_OSCON_LSB) -#define TOP_TOP_OSCON_SET(x) (((x) << TOP_TOP_OSCON_LSB) & TOP_TOP_OSCON_MASK) -#define TOP_TOP_SCLKEN_FORCE_MSB 12 -#define TOP_TOP_SCLKEN_FORCE_LSB 12 -#define TOP_TOP_SCLKEN_FORCE_MASK 0x00001000 -#define TOP_TOP_SCLKEN_FORCE_GET(x) (((x) & TOP_TOP_SCLKEN_FORCE_MASK) >> TOP_TOP_SCLKEN_FORCE_LSB) -#define TOP_TOP_SCLKEN_FORCE_SET(x) (((x) << TOP_TOP_SCLKEN_FORCE_LSB) & TOP_TOP_SCLKEN_FORCE_MASK) -#define TOP_TOP_SYNTHON_FORCE_MSB 11 -#define TOP_TOP_SYNTHON_FORCE_LSB 11 -#define TOP_TOP_SYNTHON_FORCE_MASK 0x00000800 -#define TOP_TOP_SYNTHON_FORCE_GET(x) (((x) & TOP_TOP_SYNTHON_FORCE_MASK) >> TOP_TOP_SYNTHON_FORCE_LSB) -#define TOP_TOP_SYNTHON_FORCE_SET(x) (((x) << TOP_TOP_SYNTHON_FORCE_LSB) & TOP_TOP_SYNTHON_FORCE_MASK) -#define TOP_TOP_PDBIAS_MSB 10 -#define TOP_TOP_PDBIAS_LSB 10 -#define TOP_TOP_PDBIAS_MASK 0x00000400 -#define TOP_TOP_PDBIAS_GET(x) (((x) & TOP_TOP_PDBIAS_MASK) >> TOP_TOP_PDBIAS_LSB) -#define TOP_TOP_PDBIAS_SET(x) (((x) << TOP_TOP_PDBIAS_LSB) & TOP_TOP_PDBIAS_MASK) -#define TOP_TOP_DATAOUTSEL_MSB 9 -#define TOP_TOP_DATAOUTSEL_LSB 8 -#define TOP_TOP_DATAOUTSEL_MASK 0x00000300 -#define TOP_TOP_DATAOUTSEL_GET(x) (((x) & TOP_TOP_DATAOUTSEL_MASK) >> TOP_TOP_DATAOUTSEL_LSB) -#define TOP_TOP_DATAOUTSEL_SET(x) (((x) << TOP_TOP_DATAOUTSEL_LSB) & TOP_TOP_DATAOUTSEL_MASK) -#define TOP_TOP_REVID_MSB 7 -#define TOP_TOP_REVID_LSB 5 -#define TOP_TOP_REVID_MASK 0x000000e0 -#define TOP_TOP_REVID_GET(x) (((x) & TOP_TOP_REVID_MASK) >> TOP_TOP_REVID_LSB) -#define TOP_TOP_REVID_SET(x) (((x) << TOP_TOP_REVID_LSB) & TOP_TOP_REVID_MASK) -#define TOP_TOP_INT2PAD_MSB 4 -#define TOP_TOP_INT2PAD_LSB 4 -#define TOP_TOP_INT2PAD_MASK 0x00000010 -#define TOP_TOP_INT2PAD_GET(x) (((x) & TOP_TOP_INT2PAD_MASK) >> TOP_TOP_INT2PAD_LSB) -#define TOP_TOP_INT2PAD_SET(x) (((x) << TOP_TOP_INT2PAD_LSB) & TOP_TOP_INT2PAD_MASK) -#define TOP_TOP_INTH2PAD_MSB 3 -#define TOP_TOP_INTH2PAD_LSB 3 -#define TOP_TOP_INTH2PAD_MASK 0x00000008 -#define TOP_TOP_INTH2PAD_GET(x) (((x) & TOP_TOP_INTH2PAD_MASK) >> TOP_TOP_INTH2PAD_LSB) -#define TOP_TOP_INTH2PAD_SET(x) (((x) << TOP_TOP_INTH2PAD_LSB) & TOP_TOP_INTH2PAD_MASK) -#define TOP_TOP_PAD2GND_MSB 2 -#define TOP_TOP_PAD2GND_LSB 2 -#define TOP_TOP_PAD2GND_MASK 0x00000004 -#define TOP_TOP_PAD2GND_GET(x) (((x) & TOP_TOP_PAD2GND_MASK) >> TOP_TOP_PAD2GND_LSB) -#define TOP_TOP_PAD2GND_SET(x) (((x) << TOP_TOP_PAD2GND_LSB) & TOP_TOP_PAD2GND_MASK) -#define TOP_TOP_INT2GND_MSB 1 -#define TOP_TOP_INT2GND_LSB 1 -#define TOP_TOP_INT2GND_MASK 0x00000002 -#define TOP_TOP_INT2GND_GET(x) (((x) & TOP_TOP_INT2GND_MASK) >> TOP_TOP_INT2GND_LSB) -#define TOP_TOP_INT2GND_SET(x) (((x) << TOP_TOP_INT2GND_LSB) & TOP_TOP_INT2GND_MASK) -#define TOP_TOP_FORCE_XPAON_MSB 0 -#define TOP_TOP_FORCE_XPAON_LSB 0 -#define TOP_TOP_FORCE_XPAON_MASK 0x00000001 -#define TOP_TOP_FORCE_XPAON_GET(x) (((x) & TOP_TOP_FORCE_XPAON_MASK) >> TOP_TOP_FORCE_XPAON_LSB) -#define TOP_TOP_FORCE_XPAON_SET(x) (((x) << TOP_TOP_FORCE_XPAON_LSB) & TOP_TOP_FORCE_XPAON_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct top_reg_reg_s { - volatile unsigned int top_gain; - volatile unsigned int top_top; -} top_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _TOP_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/top_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/top_reg.vrh deleted file mode 100644 index 8641cc058ea1..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/top_reg.vrh +++ /dev/null @@ -1,388 +0,0 @@ -#ifndef _TOP_REG_VRH_ -#define _TOP_REG_VRH_ - -#define TOP_GAIN_ADDRESS 'h00000000 -#define TOP_GAIN_TX6DBLOQGAIN_MSB 31 -#define TOP_GAIN_TX6DBLOQGAIN_LSB 30 -#define TOP_GAIN_TX6DBLOQGAIN_MASK 'hc0000000 -#define TOP_GAIN_TX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX6DBLOQGAIN_MASK) >> TOP_GAIN_TX6DBLOQGAIN_LSB) -#define TOP_GAIN_TX6DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_TX6DBLOQGAIN_LSB) & TOP_GAIN_TX6DBLOQGAIN_MASK) -#define TOP_GAIN_TX6DBLOQGAIN_RESET 2'h3 -#define TOP_GAIN_TX1DBLOQGAIN_MSB 29 -#define TOP_GAIN_TX1DBLOQGAIN_LSB 27 -#define TOP_GAIN_TX1DBLOQGAIN_MASK 'h38000000 -#define TOP_GAIN_TX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX1DBLOQGAIN_MASK) >> TOP_GAIN_TX1DBLOQGAIN_LSB) -#define TOP_GAIN_TX1DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_TX1DBLOQGAIN_LSB) & TOP_GAIN_TX1DBLOQGAIN_MASK) -#define TOP_GAIN_TX1DBLOQGAIN_RESET 3'h6 -#define TOP_GAIN_TXV2IGAIN_MSB 26 -#define TOP_GAIN_TXV2IGAIN_LSB 25 -#define TOP_GAIN_TXV2IGAIN_MASK 'h06000000 -#define TOP_GAIN_TXV2IGAIN_GET(x) (((x) & TOP_GAIN_TXV2IGAIN_MASK) >> TOP_GAIN_TXV2IGAIN_LSB) -#define TOP_GAIN_TXV2IGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_TXV2IGAIN_LSB) & TOP_GAIN_TXV2IGAIN_MASK) -#define TOP_GAIN_TXV2IGAIN_RESET 2'h3 -#define TOP_GAIN_PABUF5GN_MSB 24 -#define TOP_GAIN_PABUF5GN_LSB 24 -#define TOP_GAIN_PABUF5GN_MASK 'h01000000 -#define TOP_GAIN_PABUF5GN_GET(x) (((x) & TOP_GAIN_PABUF5GN_MASK) >> TOP_GAIN_PABUF5GN_LSB) -#define TOP_GAIN_PABUF5GN_SET(x) (((32'd0 | (x)) << TOP_GAIN_PABUF5GN_LSB) & TOP_GAIN_PABUF5GN_MASK) -#define TOP_GAIN_PABUF5GN_RESET 1'h1 -#define TOP_GAIN_PADRVGN_MSB 23 -#define TOP_GAIN_PADRVGN_LSB 21 -#define TOP_GAIN_PADRVGN_MASK 'h00e00000 -#define TOP_GAIN_PADRVGN_GET(x) (((x) & TOP_GAIN_PADRVGN_MASK) >> TOP_GAIN_PADRVGN_LSB) -#define TOP_GAIN_PADRVGN_SET(x) (((32'd0 | (x)) << TOP_GAIN_PADRVGN_LSB) & TOP_GAIN_PADRVGN_MASK) -#define TOP_GAIN_PADRVGN_RESET 3'h7 -#define TOP_GAIN_PAOUT2GN_MSB 20 -#define TOP_GAIN_PAOUT2GN_LSB 18 -#define TOP_GAIN_PAOUT2GN_MASK 'h001c0000 -#define TOP_GAIN_PAOUT2GN_GET(x) (((x) & TOP_GAIN_PAOUT2GN_MASK) >> TOP_GAIN_PAOUT2GN_LSB) -#define TOP_GAIN_PAOUT2GN_SET(x) (((32'd0 | (x)) << TOP_GAIN_PAOUT2GN_LSB) & TOP_GAIN_PAOUT2GN_MASK) -#define TOP_GAIN_PAOUT2GN_RESET 3'h7 -#define TOP_GAIN_LNAON_MSB 17 -#define TOP_GAIN_LNAON_LSB 17 -#define TOP_GAIN_LNAON_MASK 'h00020000 -#define TOP_GAIN_LNAON_GET(x) (((x) & TOP_GAIN_LNAON_MASK) >> TOP_GAIN_LNAON_LSB) -#define TOP_GAIN_LNAON_SET(x) (((32'd0 | (x)) << TOP_GAIN_LNAON_LSB) & TOP_GAIN_LNAON_MASK) -#define TOP_GAIN_LNAON_RESET 1'h1 -#define TOP_GAIN_LNAGAIN_MSB 16 -#define TOP_GAIN_LNAGAIN_LSB 13 -#define TOP_GAIN_LNAGAIN_MASK 'h0001e000 -#define TOP_GAIN_LNAGAIN_GET(x) (((x) & TOP_GAIN_LNAGAIN_MASK) >> TOP_GAIN_LNAGAIN_LSB) -#define TOP_GAIN_LNAGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_LNAGAIN_LSB) & TOP_GAIN_LNAGAIN_MASK) -#define TOP_GAIN_LNAGAIN_RESET 4'hf -#define TOP_GAIN_RFVGA5GAIN_MSB 12 -#define TOP_GAIN_RFVGA5GAIN_LSB 11 -#define TOP_GAIN_RFVGA5GAIN_MASK 'h00001800 -#define TOP_GAIN_RFVGA5GAIN_GET(x) (((x) & TOP_GAIN_RFVGA5GAIN_MASK) >> TOP_GAIN_RFVGA5GAIN_LSB) -#define TOP_GAIN_RFVGA5GAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RFVGA5GAIN_LSB) & TOP_GAIN_RFVGA5GAIN_MASK) -#define TOP_GAIN_RFVGA5GAIN_RESET 2'h3 -#define TOP_GAIN_RFGMGN_MSB 10 -#define TOP_GAIN_RFGMGN_LSB 8 -#define TOP_GAIN_RFGMGN_MASK 'h00000700 -#define TOP_GAIN_RFGMGN_GET(x) (((x) & TOP_GAIN_RFGMGN_MASK) >> TOP_GAIN_RFGMGN_LSB) -#define TOP_GAIN_RFGMGN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RFGMGN_LSB) & TOP_GAIN_RFGMGN_MASK) -#define TOP_GAIN_RFGMGN_RESET 3'h7 -#define TOP_GAIN_RX6DBLOQGAIN_MSB 7 -#define TOP_GAIN_RX6DBLOQGAIN_LSB 6 -#define TOP_GAIN_RX6DBLOQGAIN_MASK 'h000000c0 -#define TOP_GAIN_RX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBLOQGAIN_MASK) >> TOP_GAIN_RX6DBLOQGAIN_LSB) -#define TOP_GAIN_RX6DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RX6DBLOQGAIN_LSB) & TOP_GAIN_RX6DBLOQGAIN_MASK) -#define TOP_GAIN_RX6DBLOQGAIN_RESET 2'h3 -#define TOP_GAIN_RX1DBLOQGAIN_MSB 5 -#define TOP_GAIN_RX1DBLOQGAIN_LSB 3 -#define TOP_GAIN_RX1DBLOQGAIN_MASK 'h00000038 -#define TOP_GAIN_RX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX1DBLOQGAIN_MASK) >> TOP_GAIN_RX1DBLOQGAIN_LSB) -#define TOP_GAIN_RX1DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RX1DBLOQGAIN_LSB) & TOP_GAIN_RX1DBLOQGAIN_MASK) -#define TOP_GAIN_RX1DBLOQGAIN_RESET 3'h6 -#define TOP_GAIN_RX6DBHIQGAIN_MSB 2 -#define TOP_GAIN_RX6DBHIQGAIN_LSB 1 -#define TOP_GAIN_RX6DBHIQGAIN_MASK 'h00000006 -#define TOP_GAIN_RX6DBHIQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBHIQGAIN_MASK) >> TOP_GAIN_RX6DBHIQGAIN_LSB) -#define TOP_GAIN_RX6DBHIQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RX6DBHIQGAIN_LSB) & TOP_GAIN_RX6DBHIQGAIN_MASK) -#define TOP_GAIN_RX6DBHIQGAIN_RESET 2'h3 -#define TOP_GAIN_SPARE_MSB 0 -#define TOP_GAIN_SPARE_LSB 0 -#define TOP_GAIN_SPARE_MASK 'h00000001 -#define TOP_GAIN_SPARE_GET(x) (((x) & TOP_GAIN_SPARE_MASK) >> TOP_GAIN_SPARE_LSB) -#define TOP_GAIN_SPARE_SET(x) (((32'd0 | (x)) << TOP_GAIN_SPARE_LSB) & TOP_GAIN_SPARE_MASK) -#define TOP_GAIN_SPARE_RESET 1'h0 -#define TOP_GAIN_RESET (32'h0 | \ - TOP_GAIN_TX6DBLOQGAIN_SET(TOP_GAIN_TX6DBLOQGAIN_RESET) | \ - TOP_GAIN_TX1DBLOQGAIN_SET(TOP_GAIN_TX1DBLOQGAIN_RESET) | \ - TOP_GAIN_TXV2IGAIN_SET(TOP_GAIN_TXV2IGAIN_RESET) | \ - TOP_GAIN_PABUF5GN_SET(TOP_GAIN_PABUF5GN_RESET) | \ - TOP_GAIN_PADRVGN_SET(TOP_GAIN_PADRVGN_RESET) | \ - TOP_GAIN_PAOUT2GN_SET(TOP_GAIN_PAOUT2GN_RESET) | \ - TOP_GAIN_LNAON_SET(TOP_GAIN_LNAON_RESET) | \ - TOP_GAIN_LNAGAIN_SET(TOP_GAIN_LNAGAIN_RESET) | \ - TOP_GAIN_RFVGA5GAIN_SET(TOP_GAIN_RFVGA5GAIN_RESET) | \ - TOP_GAIN_RFGMGN_SET(TOP_GAIN_RFGMGN_RESET) | \ - TOP_GAIN_RX6DBLOQGAIN_SET(TOP_GAIN_RX6DBLOQGAIN_RESET) | \ - TOP_GAIN_RX1DBLOQGAIN_SET(TOP_GAIN_RX1DBLOQGAIN_RESET) | \ - TOP_GAIN_RX6DBHIQGAIN_SET(TOP_GAIN_RX6DBHIQGAIN_RESET) | \ - TOP_GAIN_SPARE_SET(TOP_GAIN_SPARE_RESET)) -#define TOP_GAIN_HW_MASK (32'h0 | \ - TOP_GAIN_TX6DBLOQGAIN_MASK | \ - TOP_GAIN_TX1DBLOQGAIN_MASK | \ - TOP_GAIN_TXV2IGAIN_MASK | \ - TOP_GAIN_PABUF5GN_MASK | \ - TOP_GAIN_PADRVGN_MASK | \ - TOP_GAIN_PAOUT2GN_MASK | \ - TOP_GAIN_LNAON_MASK | \ - TOP_GAIN_LNAGAIN_MASK | \ - TOP_GAIN_RFVGA5GAIN_MASK | \ - TOP_GAIN_RFGMGN_MASK | \ - TOP_GAIN_RX6DBLOQGAIN_MASK | \ - TOP_GAIN_RX1DBLOQGAIN_MASK | \ - TOP_GAIN_RX6DBHIQGAIN_MASK | \ - TOP_GAIN_SPARE_MASK) -#define TOP_GAIN_SW_MASK (32'h0 | \ - TOP_GAIN_TX6DBLOQGAIN_MASK | \ - TOP_GAIN_TX1DBLOQGAIN_MASK | \ - TOP_GAIN_TXV2IGAIN_MASK | \ - TOP_GAIN_PABUF5GN_MASK | \ - TOP_GAIN_PADRVGN_MASK | \ - TOP_GAIN_PAOUT2GN_MASK | \ - TOP_GAIN_LNAON_MASK | \ - TOP_GAIN_LNAGAIN_MASK | \ - TOP_GAIN_RFVGA5GAIN_MASK | \ - TOP_GAIN_RFGMGN_MASK | \ - TOP_GAIN_RX6DBLOQGAIN_MASK | \ - TOP_GAIN_RX1DBLOQGAIN_MASK | \ - TOP_GAIN_RX6DBHIQGAIN_MASK | \ - TOP_GAIN_SPARE_MASK) - -#define TOP_TOP_ADDRESS 'h00000004 -#define TOP_TOP_LOCALTXGAIN_MSB 31 -#define TOP_TOP_LOCALTXGAIN_LSB 31 -#define TOP_TOP_LOCALTXGAIN_MASK 'h80000000 -#define TOP_TOP_LOCALTXGAIN_GET(x) (((x) & TOP_TOP_LOCALTXGAIN_MASK) >> TOP_TOP_LOCALTXGAIN_LSB) -#define TOP_TOP_LOCALTXGAIN_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALTXGAIN_LSB) & TOP_TOP_LOCALTXGAIN_MASK) -#define TOP_TOP_LOCALTXGAIN_RESET 1'h0 -#define TOP_TOP_LOCALRXGAIN_MSB 30 -#define TOP_TOP_LOCALRXGAIN_LSB 30 -#define TOP_TOP_LOCALRXGAIN_MASK 'h40000000 -#define TOP_TOP_LOCALRXGAIN_GET(x) (((x) & TOP_TOP_LOCALRXGAIN_MASK) >> TOP_TOP_LOCALRXGAIN_LSB) -#define TOP_TOP_LOCALRXGAIN_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALRXGAIN_LSB) & TOP_TOP_LOCALRXGAIN_MASK) -#define TOP_TOP_LOCALRXGAIN_RESET 1'h0 -#define TOP_TOP_LOCALMODE_MSB 29 -#define TOP_TOP_LOCALMODE_LSB 29 -#define TOP_TOP_LOCALMODE_MASK 'h20000000 -#define TOP_TOP_LOCALMODE_GET(x) (((x) & TOP_TOP_LOCALMODE_MASK) >> TOP_TOP_LOCALMODE_LSB) -#define TOP_TOP_LOCALMODE_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALMODE_LSB) & TOP_TOP_LOCALMODE_MASK) -#define TOP_TOP_LOCALMODE_RESET 1'h0 -#define TOP_TOP_CALFC_MSB 28 -#define TOP_TOP_CALFC_LSB 28 -#define TOP_TOP_CALFC_MASK 'h10000000 -#define TOP_TOP_CALFC_GET(x) (((x) & TOP_TOP_CALFC_MASK) >> TOP_TOP_CALFC_LSB) -#define TOP_TOP_CALFC_SET(x) (((32'd0 | (x)) << TOP_TOP_CALFC_LSB) & TOP_TOP_CALFC_MASK) -#define TOP_TOP_CALFC_RESET 1'h0 -#define TOP_TOP_CALDC_MSB 27 -#define TOP_TOP_CALDC_LSB 27 -#define TOP_TOP_CALDC_MASK 'h08000000 -#define TOP_TOP_CALDC_GET(x) (((x) & TOP_TOP_CALDC_MASK) >> TOP_TOP_CALDC_LSB) -#define TOP_TOP_CALDC_SET(x) (((32'd0 | (x)) << TOP_TOP_CALDC_LSB) & TOP_TOP_CALDC_MASK) -#define TOP_TOP_CALDC_RESET 1'h0 -#define TOP_TOP_CAL_RESIDUE_MSB 26 -#define TOP_TOP_CAL_RESIDUE_LSB 26 -#define TOP_TOP_CAL_RESIDUE_MASK 'h04000000 -#define TOP_TOP_CAL_RESIDUE_GET(x) (((x) & TOP_TOP_CAL_RESIDUE_MASK) >> TOP_TOP_CAL_RESIDUE_LSB) -#define TOP_TOP_CAL_RESIDUE_SET(x) (((32'd0 | (x)) << TOP_TOP_CAL_RESIDUE_LSB) & TOP_TOP_CAL_RESIDUE_MASK) -#define TOP_TOP_CAL_RESIDUE_RESET 1'h0 -#define TOP_TOP_BMODE_MSB 25 -#define TOP_TOP_BMODE_LSB 25 -#define TOP_TOP_BMODE_MASK 'h02000000 -#define TOP_TOP_BMODE_GET(x) (((x) & TOP_TOP_BMODE_MASK) >> TOP_TOP_BMODE_LSB) -#define TOP_TOP_BMODE_SET(x) (((32'd0 | (x)) << TOP_TOP_BMODE_LSB) & TOP_TOP_BMODE_MASK) -#define TOP_TOP_BMODE_RESET 1'h1 -#define TOP_TOP_SYNTHON_MSB 24 -#define TOP_TOP_SYNTHON_LSB 24 -#define TOP_TOP_SYNTHON_MASK 'h01000000 -#define TOP_TOP_SYNTHON_GET(x) (((x) & TOP_TOP_SYNTHON_MASK) >> TOP_TOP_SYNTHON_LSB) -#define TOP_TOP_SYNTHON_SET(x) (((32'd0 | (x)) << TOP_TOP_SYNTHON_LSB) & TOP_TOP_SYNTHON_MASK) -#define TOP_TOP_SYNTHON_RESET 1'h0 -#define TOP_TOP_RXON_MSB 23 -#define TOP_TOP_RXON_LSB 23 -#define TOP_TOP_RXON_MASK 'h00800000 -#define TOP_TOP_RXON_GET(x) (((x) & TOP_TOP_RXON_MASK) >> TOP_TOP_RXON_LSB) -#define TOP_TOP_RXON_SET(x) (((32'd0 | (x)) << TOP_TOP_RXON_LSB) & TOP_TOP_RXON_MASK) -#define TOP_TOP_RXON_RESET 1'h0 -#define TOP_TOP_TXON_MSB 22 -#define TOP_TOP_TXON_LSB 22 -#define TOP_TOP_TXON_MASK 'h00400000 -#define TOP_TOP_TXON_GET(x) (((x) & TOP_TOP_TXON_MASK) >> TOP_TOP_TXON_LSB) -#define TOP_TOP_TXON_SET(x) (((32'd0 | (x)) << TOP_TOP_TXON_LSB) & TOP_TOP_TXON_MASK) -#define TOP_TOP_TXON_RESET 1'h0 -#define TOP_TOP_PAON_MSB 21 -#define TOP_TOP_PAON_LSB 21 -#define TOP_TOP_PAON_MASK 'h00200000 -#define TOP_TOP_PAON_GET(x) (((x) & TOP_TOP_PAON_MASK) >> TOP_TOP_PAON_LSB) -#define TOP_TOP_PAON_SET(x) (((32'd0 | (x)) << TOP_TOP_PAON_LSB) & TOP_TOP_PAON_MASK) -#define TOP_TOP_PAON_RESET 1'h0 -#define TOP_TOP_CALTX_MSB 20 -#define TOP_TOP_CALTX_LSB 20 -#define TOP_TOP_CALTX_MASK 'h00100000 -#define TOP_TOP_CALTX_GET(x) (((x) & TOP_TOP_CALTX_MASK) >> TOP_TOP_CALTX_LSB) -#define TOP_TOP_CALTX_SET(x) (((32'd0 | (x)) << TOP_TOP_CALTX_LSB) & TOP_TOP_CALTX_MASK) -#define TOP_TOP_CALTX_RESET 1'h0 -#define TOP_TOP_LOCALADDAC_MSB 19 -#define TOP_TOP_LOCALADDAC_LSB 19 -#define TOP_TOP_LOCALADDAC_MASK 'h00080000 -#define TOP_TOP_LOCALADDAC_GET(x) (((x) & TOP_TOP_LOCALADDAC_MASK) >> TOP_TOP_LOCALADDAC_LSB) -#define TOP_TOP_LOCALADDAC_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALADDAC_LSB) & TOP_TOP_LOCALADDAC_MASK) -#define TOP_TOP_LOCALADDAC_RESET 1'h0 -#define TOP_TOP_PWDPLL_MSB 18 -#define TOP_TOP_PWDPLL_LSB 18 -#define TOP_TOP_PWDPLL_MASK 'h00040000 -#define TOP_TOP_PWDPLL_GET(x) (((x) & TOP_TOP_PWDPLL_MASK) >> TOP_TOP_PWDPLL_LSB) -#define TOP_TOP_PWDPLL_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDPLL_LSB) & TOP_TOP_PWDPLL_MASK) -#define TOP_TOP_PWDPLL_RESET 1'h0 -#define TOP_TOP_PWDADC_MSB 17 -#define TOP_TOP_PWDADC_LSB 17 -#define TOP_TOP_PWDADC_MASK 'h00020000 -#define TOP_TOP_PWDADC_GET(x) (((x) & TOP_TOP_PWDADC_MASK) >> TOP_TOP_PWDADC_LSB) -#define TOP_TOP_PWDADC_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDADC_LSB) & TOP_TOP_PWDADC_MASK) -#define TOP_TOP_PWDADC_RESET 1'h0 -#define TOP_TOP_PWDDAC_MSB 16 -#define TOP_TOP_PWDDAC_LSB 16 -#define TOP_TOP_PWDDAC_MASK 'h00010000 -#define TOP_TOP_PWDDAC_GET(x) (((x) & TOP_TOP_PWDDAC_MASK) >> TOP_TOP_PWDDAC_LSB) -#define TOP_TOP_PWDDAC_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDDAC_LSB) & TOP_TOP_PWDDAC_MASK) -#define TOP_TOP_PWDDAC_RESET 1'h0 -#define TOP_TOP_LOCALXTAL_MSB 15 -#define TOP_TOP_LOCALXTAL_LSB 15 -#define TOP_TOP_LOCALXTAL_MASK 'h00008000 -#define TOP_TOP_LOCALXTAL_GET(x) (((x) & TOP_TOP_LOCALXTAL_MASK) >> TOP_TOP_LOCALXTAL_LSB) -#define TOP_TOP_LOCALXTAL_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALXTAL_LSB) & TOP_TOP_LOCALXTAL_MASK) -#define TOP_TOP_LOCALXTAL_RESET 1'h0 -#define TOP_TOP_PWDCLKIN_MSB 14 -#define TOP_TOP_PWDCLKIN_LSB 14 -#define TOP_TOP_PWDCLKIN_MASK 'h00004000 -#define TOP_TOP_PWDCLKIN_GET(x) (((x) & TOP_TOP_PWDCLKIN_MASK) >> TOP_TOP_PWDCLKIN_LSB) -#define TOP_TOP_PWDCLKIN_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDCLKIN_LSB) & TOP_TOP_PWDCLKIN_MASK) -#define TOP_TOP_PWDCLKIN_RESET 1'h0 -#define TOP_TOP_OSCON_MSB 13 -#define TOP_TOP_OSCON_LSB 13 -#define TOP_TOP_OSCON_MASK 'h00002000 -#define TOP_TOP_OSCON_GET(x) (((x) & TOP_TOP_OSCON_MASK) >> TOP_TOP_OSCON_LSB) -#define TOP_TOP_OSCON_SET(x) (((32'd0 | (x)) << TOP_TOP_OSCON_LSB) & TOP_TOP_OSCON_MASK) -#define TOP_TOP_OSCON_RESET 1'h1 -#define TOP_TOP_SCLKEN_FORCE_MSB 12 -#define TOP_TOP_SCLKEN_FORCE_LSB 12 -#define TOP_TOP_SCLKEN_FORCE_MASK 'h00001000 -#define TOP_TOP_SCLKEN_FORCE_GET(x) (((x) & TOP_TOP_SCLKEN_FORCE_MASK) >> TOP_TOP_SCLKEN_FORCE_LSB) -#define TOP_TOP_SCLKEN_FORCE_SET(x) (((32'd0 | (x)) << TOP_TOP_SCLKEN_FORCE_LSB) & TOP_TOP_SCLKEN_FORCE_MASK) -#define TOP_TOP_SCLKEN_FORCE_RESET 1'h0 -#define TOP_TOP_SYNTHON_FORCE_MSB 11 -#define TOP_TOP_SYNTHON_FORCE_LSB 11 -#define TOP_TOP_SYNTHON_FORCE_MASK 'h00000800 -#define TOP_TOP_SYNTHON_FORCE_GET(x) (((x) & TOP_TOP_SYNTHON_FORCE_MASK) >> TOP_TOP_SYNTHON_FORCE_LSB) -#define TOP_TOP_SYNTHON_FORCE_SET(x) (((32'd0 | (x)) << TOP_TOP_SYNTHON_FORCE_LSB) & TOP_TOP_SYNTHON_FORCE_MASK) -#define TOP_TOP_SYNTHON_FORCE_RESET 1'h0 -#define TOP_TOP_PDBIAS_MSB 10 -#define TOP_TOP_PDBIAS_LSB 10 -#define TOP_TOP_PDBIAS_MASK 'h00000400 -#define TOP_TOP_PDBIAS_GET(x) (((x) & TOP_TOP_PDBIAS_MASK) >> TOP_TOP_PDBIAS_LSB) -#define TOP_TOP_PDBIAS_SET(x) (((32'd0 | (x)) << TOP_TOP_PDBIAS_LSB) & TOP_TOP_PDBIAS_MASK) -#define TOP_TOP_PDBIAS_RESET 1'h0 -#define TOP_TOP_DATAOUTSEL_MSB 9 -#define TOP_TOP_DATAOUTSEL_LSB 8 -#define TOP_TOP_DATAOUTSEL_MASK 'h00000300 -#define TOP_TOP_DATAOUTSEL_GET(x) (((x) & TOP_TOP_DATAOUTSEL_MASK) >> TOP_TOP_DATAOUTSEL_LSB) -#define TOP_TOP_DATAOUTSEL_SET(x) (((32'd0 | (x)) << TOP_TOP_DATAOUTSEL_LSB) & TOP_TOP_DATAOUTSEL_MASK) -#define TOP_TOP_DATAOUTSEL_RESET 2'h3 -#define TOP_TOP_REVID_MSB 7 -#define TOP_TOP_REVID_LSB 5 -#define TOP_TOP_REVID_MASK 'h000000e0 -#define TOP_TOP_REVID_GET(x) (((x) & TOP_TOP_REVID_MASK) >> TOP_TOP_REVID_LSB) -#define TOP_TOP_REVID_SET(x) (((32'd0 | (x)) << TOP_TOP_REVID_LSB) & TOP_TOP_REVID_MASK) -#define TOP_TOP_REVID_RESET 3'h0 -#define TOP_TOP_INT2PAD_MSB 4 -#define TOP_TOP_INT2PAD_LSB 4 -#define TOP_TOP_INT2PAD_MASK 'h00000010 -#define TOP_TOP_INT2PAD_GET(x) (((x) & TOP_TOP_INT2PAD_MASK) >> TOP_TOP_INT2PAD_LSB) -#define TOP_TOP_INT2PAD_SET(x) (((32'd0 | (x)) << TOP_TOP_INT2PAD_LSB) & TOP_TOP_INT2PAD_MASK) -#define TOP_TOP_INT2PAD_RESET 1'h0 -#define TOP_TOP_INTH2PAD_MSB 3 -#define TOP_TOP_INTH2PAD_LSB 3 -#define TOP_TOP_INTH2PAD_MASK 'h00000008 -#define TOP_TOP_INTH2PAD_GET(x) (((x) & TOP_TOP_INTH2PAD_MASK) >> TOP_TOP_INTH2PAD_LSB) -#define TOP_TOP_INTH2PAD_SET(x) (((32'd0 | (x)) << TOP_TOP_INTH2PAD_LSB) & TOP_TOP_INTH2PAD_MASK) -#define TOP_TOP_INTH2PAD_RESET 1'h0 -#define TOP_TOP_PAD2GND_MSB 2 -#define TOP_TOP_PAD2GND_LSB 2 -#define TOP_TOP_PAD2GND_MASK 'h00000004 -#define TOP_TOP_PAD2GND_GET(x) (((x) & TOP_TOP_PAD2GND_MASK) >> TOP_TOP_PAD2GND_LSB) -#define TOP_TOP_PAD2GND_SET(x) (((32'd0 | (x)) << TOP_TOP_PAD2GND_LSB) & TOP_TOP_PAD2GND_MASK) -#define TOP_TOP_PAD2GND_RESET 1'h0 -#define TOP_TOP_INT2GND_MSB 1 -#define TOP_TOP_INT2GND_LSB 1 -#define TOP_TOP_INT2GND_MASK 'h00000002 -#define TOP_TOP_INT2GND_GET(x) (((x) & TOP_TOP_INT2GND_MASK) >> TOP_TOP_INT2GND_LSB) -#define TOP_TOP_INT2GND_SET(x) (((32'd0 | (x)) << TOP_TOP_INT2GND_LSB) & TOP_TOP_INT2GND_MASK) -#define TOP_TOP_INT2GND_RESET 1'h0 -#define TOP_TOP_FORCE_XPAON_MSB 0 -#define TOP_TOP_FORCE_XPAON_LSB 0 -#define TOP_TOP_FORCE_XPAON_MASK 'h00000001 -#define TOP_TOP_FORCE_XPAON_GET(x) (((x) & TOP_TOP_FORCE_XPAON_MASK) >> TOP_TOP_FORCE_XPAON_LSB) -#define TOP_TOP_FORCE_XPAON_SET(x) (((32'd0 | (x)) << TOP_TOP_FORCE_XPAON_LSB) & TOP_TOP_FORCE_XPAON_MASK) -#define TOP_TOP_FORCE_XPAON_RESET 1'h0 -#define TOP_TOP_RESET (32'h0 | \ - TOP_TOP_LOCALTXGAIN_SET(TOP_TOP_LOCALTXGAIN_RESET) | \ - TOP_TOP_LOCALRXGAIN_SET(TOP_TOP_LOCALRXGAIN_RESET) | \ - TOP_TOP_LOCALMODE_SET(TOP_TOP_LOCALMODE_RESET) | \ - TOP_TOP_CALFC_SET(TOP_TOP_CALFC_RESET) | \ - TOP_TOP_CALDC_SET(TOP_TOP_CALDC_RESET) | \ - TOP_TOP_CAL_RESIDUE_SET(TOP_TOP_CAL_RESIDUE_RESET) | \ - TOP_TOP_BMODE_SET(TOP_TOP_BMODE_RESET) | \ - TOP_TOP_SYNTHON_SET(TOP_TOP_SYNTHON_RESET) | \ - TOP_TOP_RXON_SET(TOP_TOP_RXON_RESET) | \ - TOP_TOP_TXON_SET(TOP_TOP_TXON_RESET) | \ - TOP_TOP_PAON_SET(TOP_TOP_PAON_RESET) | \ - TOP_TOP_CALTX_SET(TOP_TOP_CALTX_RESET) | \ - TOP_TOP_LOCALADDAC_SET(TOP_TOP_LOCALADDAC_RESET) | \ - TOP_TOP_PWDPLL_SET(TOP_TOP_PWDPLL_RESET) | \ - TOP_TOP_PWDADC_SET(TOP_TOP_PWDADC_RESET) | \ - TOP_TOP_PWDDAC_SET(TOP_TOP_PWDDAC_RESET) | \ - TOP_TOP_LOCALXTAL_SET(TOP_TOP_LOCALXTAL_RESET) | \ - TOP_TOP_PWDCLKIN_SET(TOP_TOP_PWDCLKIN_RESET) | \ - TOP_TOP_OSCON_SET(TOP_TOP_OSCON_RESET) | \ - TOP_TOP_SCLKEN_FORCE_SET(TOP_TOP_SCLKEN_FORCE_RESET) | \ - TOP_TOP_SYNTHON_FORCE_SET(TOP_TOP_SYNTHON_FORCE_RESET) | \ - TOP_TOP_PDBIAS_SET(TOP_TOP_PDBIAS_RESET) | \ - TOP_TOP_DATAOUTSEL_SET(TOP_TOP_DATAOUTSEL_RESET) | \ - TOP_TOP_REVID_SET(TOP_TOP_REVID_RESET) | \ - TOP_TOP_INT2PAD_SET(TOP_TOP_INT2PAD_RESET) | \ - TOP_TOP_INTH2PAD_SET(TOP_TOP_INTH2PAD_RESET) | \ - TOP_TOP_PAD2GND_SET(TOP_TOP_PAD2GND_RESET) | \ - TOP_TOP_INT2GND_SET(TOP_TOP_INT2GND_RESET) | \ - TOP_TOP_FORCE_XPAON_SET(TOP_TOP_FORCE_XPAON_RESET)) -#define TOP_TOP_HW_MASK (32'h0 | \ - TOP_TOP_CALFC_MASK | \ - TOP_TOP_CALDC_MASK | \ - TOP_TOP_CAL_RESIDUE_MASK | \ - TOP_TOP_BMODE_MASK | \ - TOP_TOP_SYNTHON_MASK | \ - TOP_TOP_RXON_MASK | \ - TOP_TOP_TXON_MASK | \ - TOP_TOP_PAON_MASK | \ - TOP_TOP_CALTX_MASK | \ - TOP_TOP_PWDPLL_MASK | \ - TOP_TOP_PWDADC_MASK | \ - TOP_TOP_PWDDAC_MASK | \ - TOP_TOP_PWDCLKIN_MASK | \ - TOP_TOP_OSCON_MASK | \ - TOP_TOP_REVID_MASK) -#define TOP_TOP_SW_MASK (32'h0 | \ - TOP_TOP_LOCALTXGAIN_MASK | \ - TOP_TOP_LOCALRXGAIN_MASK | \ - TOP_TOP_LOCALMODE_MASK | \ - TOP_TOP_CALFC_MASK | \ - TOP_TOP_CALDC_MASK | \ - TOP_TOP_CAL_RESIDUE_MASK | \ - TOP_TOP_BMODE_MASK | \ - TOP_TOP_SYNTHON_MASK | \ - TOP_TOP_RXON_MASK | \ - TOP_TOP_TXON_MASK | \ - TOP_TOP_PAON_MASK | \ - TOP_TOP_CALTX_MASK | \ - TOP_TOP_LOCALADDAC_MASK | \ - TOP_TOP_PWDPLL_MASK | \ - TOP_TOP_PWDADC_MASK | \ - TOP_TOP_PWDDAC_MASK | \ - TOP_TOP_LOCALXTAL_MASK | \ - TOP_TOP_PWDCLKIN_MASK | \ - TOP_TOP_OSCON_MASK | \ - TOP_TOP_SCLKEN_FORCE_MASK | \ - TOP_TOP_SYNTHON_FORCE_MASK | \ - TOP_TOP_PDBIAS_MASK | \ - TOP_TOP_DATAOUTSEL_MASK | \ - TOP_TOP_INT2PAD_MASK | \ - TOP_TOP_INTH2PAD_MASK | \ - TOP_TOP_PAD2GND_MASK | \ - TOP_TOP_INT2GND_MASK | \ - TOP_TOP_FORCE_XPAON_MASK) - -#define TOP_REG_ADDRESS_MSB 2 - -#endif /* _TOP_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/txpc_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/txpc_reg.h deleted file mode 100644 index ed2b1260464d..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/txpc_reg.h +++ /dev/null @@ -1,170 +0,0 @@ -#ifndef _TXPC_REG_REG_H_ -#define _TXPC_REG_REG_H_ - -#define TXPC_TXPC_ADDRESS 0x00000000 -#define TXPC_TXPC_OFFSET 0x00000000 -#define TXPC_TXPC_SELINTPD_MSB 31 -#define TXPC_TXPC_SELINTPD_LSB 31 -#define TXPC_TXPC_SELINTPD_MASK 0x80000000 -#define TXPC_TXPC_SELINTPD_GET(x) (((x) & TXPC_TXPC_SELINTPD_MASK) >> TXPC_TXPC_SELINTPD_LSB) -#define TXPC_TXPC_SELINTPD_SET(x) (((x) << TXPC_TXPC_SELINTPD_LSB) & TXPC_TXPC_SELINTPD_MASK) -#define TXPC_TXPC_TEST_MSB 30 -#define TXPC_TXPC_TEST_LSB 30 -#define TXPC_TXPC_TEST_MASK 0x40000000 -#define TXPC_TXPC_TEST_GET(x) (((x) & TXPC_TXPC_TEST_MASK) >> TXPC_TXPC_TEST_LSB) -#define TXPC_TXPC_TEST_SET(x) (((x) << TXPC_TXPC_TEST_LSB) & TXPC_TXPC_TEST_MASK) -#define TXPC_TXPC_TESTGAIN_MSB 29 -#define TXPC_TXPC_TESTGAIN_LSB 28 -#define TXPC_TXPC_TESTGAIN_MASK 0x30000000 -#define TXPC_TXPC_TESTGAIN_GET(x) (((x) & TXPC_TXPC_TESTGAIN_MASK) >> TXPC_TXPC_TESTGAIN_LSB) -#define TXPC_TXPC_TESTGAIN_SET(x) (((x) << TXPC_TXPC_TESTGAIN_LSB) & TXPC_TXPC_TESTGAIN_MASK) -#define TXPC_TXPC_TESTDAC_MSB 27 -#define TXPC_TXPC_TESTDAC_LSB 22 -#define TXPC_TXPC_TESTDAC_MASK 0x0fc00000 -#define TXPC_TXPC_TESTDAC_GET(x) (((x) & TXPC_TXPC_TESTDAC_MASK) >> TXPC_TXPC_TESTDAC_LSB) -#define TXPC_TXPC_TESTDAC_SET(x) (((x) << TXPC_TXPC_TESTDAC_LSB) & TXPC_TXPC_TESTDAC_MASK) -#define TXPC_TXPC_TESTPWDPC_MSB 21 -#define TXPC_TXPC_TESTPWDPC_LSB 21 -#define TXPC_TXPC_TESTPWDPC_MASK 0x00200000 -#define TXPC_TXPC_TESTPWDPC_GET(x) (((x) & TXPC_TXPC_TESTPWDPC_MASK) >> TXPC_TXPC_TESTPWDPC_LSB) -#define TXPC_TXPC_TESTPWDPC_SET(x) (((x) << TXPC_TXPC_TESTPWDPC_LSB) & TXPC_TXPC_TESTPWDPC_MASK) -#define TXPC_TXPC_CURHALF_MSB 20 -#define TXPC_TXPC_CURHALF_LSB 20 -#define TXPC_TXPC_CURHALF_MASK 0x00100000 -#define TXPC_TXPC_CURHALF_GET(x) (((x) & TXPC_TXPC_CURHALF_MASK) >> TXPC_TXPC_CURHALF_LSB) -#define TXPC_TXPC_CURHALF_SET(x) (((x) << TXPC_TXPC_CURHALF_LSB) & TXPC_TXPC_CURHALF_MASK) -#define TXPC_TXPC_NEGOUT_MSB 19 -#define TXPC_TXPC_NEGOUT_LSB 19 -#define TXPC_TXPC_NEGOUT_MASK 0x00080000 -#define TXPC_TXPC_NEGOUT_GET(x) (((x) & TXPC_TXPC_NEGOUT_MASK) >> TXPC_TXPC_NEGOUT_LSB) -#define TXPC_TXPC_NEGOUT_SET(x) (((x) << TXPC_TXPC_NEGOUT_LSB) & TXPC_TXPC_NEGOUT_MASK) -#define TXPC_TXPC_CLKDELAY_MSB 18 -#define TXPC_TXPC_CLKDELAY_LSB 18 -#define TXPC_TXPC_CLKDELAY_MASK 0x00040000 -#define TXPC_TXPC_CLKDELAY_GET(x) (((x) & TXPC_TXPC_CLKDELAY_MASK) >> TXPC_TXPC_CLKDELAY_LSB) -#define TXPC_TXPC_CLKDELAY_SET(x) (((x) << TXPC_TXPC_CLKDELAY_LSB) & TXPC_TXPC_CLKDELAY_MASK) -#define TXPC_TXPC_SELMODREF_MSB 17 -#define TXPC_TXPC_SELMODREF_LSB 17 -#define TXPC_TXPC_SELMODREF_MASK 0x00020000 -#define TXPC_TXPC_SELMODREF_GET(x) (((x) & TXPC_TXPC_SELMODREF_MASK) >> TXPC_TXPC_SELMODREF_LSB) -#define TXPC_TXPC_SELMODREF_SET(x) (((x) << TXPC_TXPC_SELMODREF_LSB) & TXPC_TXPC_SELMODREF_MASK) -#define TXPC_TXPC_SELCMOUT_MSB 16 -#define TXPC_TXPC_SELCMOUT_LSB 16 -#define TXPC_TXPC_SELCMOUT_MASK 0x00010000 -#define TXPC_TXPC_SELCMOUT_GET(x) (((x) & TXPC_TXPC_SELCMOUT_MASK) >> TXPC_TXPC_SELCMOUT_LSB) -#define TXPC_TXPC_SELCMOUT_SET(x) (((x) << TXPC_TXPC_SELCMOUT_LSB) & TXPC_TXPC_SELCMOUT_MASK) -#define TXPC_TXPC_TSMODE_MSB 15 -#define TXPC_TXPC_TSMODE_LSB 14 -#define TXPC_TXPC_TSMODE_MASK 0x0000c000 -#define TXPC_TXPC_TSMODE_GET(x) (((x) & TXPC_TXPC_TSMODE_MASK) >> TXPC_TXPC_TSMODE_LSB) -#define TXPC_TXPC_TSMODE_SET(x) (((x) << TXPC_TXPC_TSMODE_LSB) & TXPC_TXPC_TSMODE_MASK) -#define TXPC_TXPC_N_MSB 13 -#define TXPC_TXPC_N_LSB 6 -#define TXPC_TXPC_N_MASK 0x00003fc0 -#define TXPC_TXPC_N_GET(x) (((x) & TXPC_TXPC_N_MASK) >> TXPC_TXPC_N_LSB) -#define TXPC_TXPC_N_SET(x) (((x) << TXPC_TXPC_N_LSB) & TXPC_TXPC_N_MASK) -#define TXPC_TXPC_ON1STSYNTHON_MSB 5 -#define TXPC_TXPC_ON1STSYNTHON_LSB 5 -#define TXPC_TXPC_ON1STSYNTHON_MASK 0x00000020 -#define TXPC_TXPC_ON1STSYNTHON_GET(x) (((x) & TXPC_TXPC_ON1STSYNTHON_MASK) >> TXPC_TXPC_ON1STSYNTHON_LSB) -#define TXPC_TXPC_ON1STSYNTHON_SET(x) (((x) << TXPC_TXPC_ON1STSYNTHON_LSB) & TXPC_TXPC_ON1STSYNTHON_MASK) -#define TXPC_TXPC_SELINIT_MSB 4 -#define TXPC_TXPC_SELINIT_LSB 3 -#define TXPC_TXPC_SELINIT_MASK 0x00000018 -#define TXPC_TXPC_SELINIT_GET(x) (((x) & TXPC_TXPC_SELINIT_MASK) >> TXPC_TXPC_SELINIT_LSB) -#define TXPC_TXPC_SELINIT_SET(x) (((x) << TXPC_TXPC_SELINIT_LSB) & TXPC_TXPC_SELINIT_MASK) -#define TXPC_TXPC_SELCOUNT_MSB 2 -#define TXPC_TXPC_SELCOUNT_LSB 2 -#define TXPC_TXPC_SELCOUNT_MASK 0x00000004 -#define TXPC_TXPC_SELCOUNT_GET(x) (((x) & TXPC_TXPC_SELCOUNT_MASK) >> TXPC_TXPC_SELCOUNT_LSB) -#define TXPC_TXPC_SELCOUNT_SET(x) (((x) << TXPC_TXPC_SELCOUNT_LSB) & TXPC_TXPC_SELCOUNT_MASK) -#define TXPC_TXPC_ATBSEL_MSB 1 -#define TXPC_TXPC_ATBSEL_LSB 0 -#define TXPC_TXPC_ATBSEL_MASK 0x00000003 -#define TXPC_TXPC_ATBSEL_GET(x) (((x) & TXPC_TXPC_ATBSEL_MASK) >> TXPC_TXPC_ATBSEL_LSB) -#define TXPC_TXPC_ATBSEL_SET(x) (((x) << TXPC_TXPC_ATBSEL_LSB) & TXPC_TXPC_ATBSEL_MASK) - -#define TXPC_MISC_ADDRESS 0x00000004 -#define TXPC_MISC_OFFSET 0x00000004 -#define TXPC_MISC_FLIPBMODE_MSB 31 -#define TXPC_MISC_FLIPBMODE_LSB 31 -#define TXPC_MISC_FLIPBMODE_MASK 0x80000000 -#define TXPC_MISC_FLIPBMODE_GET(x) (((x) & TXPC_MISC_FLIPBMODE_MASK) >> TXPC_MISC_FLIPBMODE_LSB) -#define TXPC_MISC_FLIPBMODE_SET(x) (((x) << TXPC_MISC_FLIPBMODE_LSB) & TXPC_MISC_FLIPBMODE_MASK) -#define TXPC_MISC_LEVEL_MSB 30 -#define TXPC_MISC_LEVEL_LSB 29 -#define TXPC_MISC_LEVEL_MASK 0x60000000 -#define TXPC_MISC_LEVEL_GET(x) (((x) & TXPC_MISC_LEVEL_MASK) >> TXPC_MISC_LEVEL_LSB) -#define TXPC_MISC_LEVEL_SET(x) (((x) << TXPC_MISC_LEVEL_LSB) & TXPC_MISC_LEVEL_MASK) -#define TXPC_MISC_LDO_TEST_MODE_MSB 28 -#define TXPC_MISC_LDO_TEST_MODE_LSB 28 -#define TXPC_MISC_LDO_TEST_MODE_MASK 0x10000000 -#define TXPC_MISC_LDO_TEST_MODE_GET(x) (((x) & TXPC_MISC_LDO_TEST_MODE_MASK) >> TXPC_MISC_LDO_TEST_MODE_LSB) -#define TXPC_MISC_LDO_TEST_MODE_SET(x) (((x) << TXPC_MISC_LDO_TEST_MODE_LSB) & TXPC_MISC_LDO_TEST_MODE_MASK) -#define TXPC_MISC_NOTCXODET_MSB 27 -#define TXPC_MISC_NOTCXODET_LSB 27 -#define TXPC_MISC_NOTCXODET_MASK 0x08000000 -#define TXPC_MISC_NOTCXODET_GET(x) (((x) & TXPC_MISC_NOTCXODET_MASK) >> TXPC_MISC_NOTCXODET_LSB) -#define TXPC_MISC_NOTCXODET_SET(x) (((x) << TXPC_MISC_NOTCXODET_LSB) & TXPC_MISC_NOTCXODET_MASK) -#define TXPC_MISC_PWDCLKIND_MSB 26 -#define TXPC_MISC_PWDCLKIND_LSB 26 -#define TXPC_MISC_PWDCLKIND_MASK 0x04000000 -#define TXPC_MISC_PWDCLKIND_GET(x) (((x) & TXPC_MISC_PWDCLKIND_MASK) >> TXPC_MISC_PWDCLKIND_LSB) -#define TXPC_MISC_PWDCLKIND_SET(x) (((x) << TXPC_MISC_PWDCLKIND_LSB) & TXPC_MISC_PWDCLKIND_MASK) -#define TXPC_MISC_PWDXINPAD_MSB 25 -#define TXPC_MISC_PWDXINPAD_LSB 25 -#define TXPC_MISC_PWDXINPAD_MASK 0x02000000 -#define TXPC_MISC_PWDXINPAD_GET(x) (((x) & TXPC_MISC_PWDXINPAD_MASK) >> TXPC_MISC_PWDXINPAD_LSB) -#define TXPC_MISC_PWDXINPAD_SET(x) (((x) << TXPC_MISC_PWDXINPAD_LSB) & TXPC_MISC_PWDXINPAD_MASK) -#define TXPC_MISC_LOCALBIAS_MSB 24 -#define TXPC_MISC_LOCALBIAS_LSB 24 -#define TXPC_MISC_LOCALBIAS_MASK 0x01000000 -#define TXPC_MISC_LOCALBIAS_GET(x) (((x) & TXPC_MISC_LOCALBIAS_MASK) >> TXPC_MISC_LOCALBIAS_LSB) -#define TXPC_MISC_LOCALBIAS_SET(x) (((x) << TXPC_MISC_LOCALBIAS_LSB) & TXPC_MISC_LOCALBIAS_MASK) -#define TXPC_MISC_LOCALBIAS2X_MSB 23 -#define TXPC_MISC_LOCALBIAS2X_LSB 23 -#define TXPC_MISC_LOCALBIAS2X_MASK 0x00800000 -#define TXPC_MISC_LOCALBIAS2X_GET(x) (((x) & TXPC_MISC_LOCALBIAS2X_MASK) >> TXPC_MISC_LOCALBIAS2X_LSB) -#define TXPC_MISC_LOCALBIAS2X_SET(x) (((x) << TXPC_MISC_LOCALBIAS2X_LSB) & TXPC_MISC_LOCALBIAS2X_MASK) -#define TXPC_MISC_SELTSP_MSB 22 -#define TXPC_MISC_SELTSP_LSB 22 -#define TXPC_MISC_SELTSP_MASK 0x00400000 -#define TXPC_MISC_SELTSP_GET(x) (((x) & TXPC_MISC_SELTSP_MASK) >> TXPC_MISC_SELTSP_LSB) -#define TXPC_MISC_SELTSP_SET(x) (((x) << TXPC_MISC_SELTSP_LSB) & TXPC_MISC_SELTSP_MASK) -#define TXPC_MISC_SELTSN_MSB 21 -#define TXPC_MISC_SELTSN_LSB 21 -#define TXPC_MISC_SELTSN_MASK 0x00200000 -#define TXPC_MISC_SELTSN_GET(x) (((x) & TXPC_MISC_SELTSN_MASK) >> TXPC_MISC_SELTSN_LSB) -#define TXPC_MISC_SELTSN_SET(x) (((x) << TXPC_MISC_SELTSN_LSB) & TXPC_MISC_SELTSN_MASK) -#define TXPC_MISC_SPARE_A_MSB 20 -#define TXPC_MISC_SPARE_A_LSB 18 -#define TXPC_MISC_SPARE_A_MASK 0x001c0000 -#define TXPC_MISC_SPARE_A_GET(x) (((x) & TXPC_MISC_SPARE_A_MASK) >> TXPC_MISC_SPARE_A_LSB) -#define TXPC_MISC_SPARE_A_SET(x) (((x) << TXPC_MISC_SPARE_A_LSB) & TXPC_MISC_SPARE_A_MASK) -#define TXPC_MISC_DECOUT_MSB 17 -#define TXPC_MISC_DECOUT_LSB 8 -#define TXPC_MISC_DECOUT_MASK 0x0003ff00 -#define TXPC_MISC_DECOUT_GET(x) (((x) & TXPC_MISC_DECOUT_MASK) >> TXPC_MISC_DECOUT_LSB) -#define TXPC_MISC_DECOUT_SET(x) (((x) << TXPC_MISC_DECOUT_LSB) & TXPC_MISC_DECOUT_MASK) -#define TXPC_MISC_XTALDIV_MSB 7 -#define TXPC_MISC_XTALDIV_LSB 6 -#define TXPC_MISC_XTALDIV_MASK 0x000000c0 -#define TXPC_MISC_XTALDIV_GET(x) (((x) & TXPC_MISC_XTALDIV_MASK) >> TXPC_MISC_XTALDIV_LSB) -#define TXPC_MISC_XTALDIV_SET(x) (((x) << TXPC_MISC_XTALDIV_LSB) & TXPC_MISC_XTALDIV_MASK) -#define TXPC_MISC_SPARE_MSB 5 -#define TXPC_MISC_SPARE_LSB 0 -#define TXPC_MISC_SPARE_MASK 0x0000003f -#define TXPC_MISC_SPARE_GET(x) (((x) & TXPC_MISC_SPARE_MASK) >> TXPC_MISC_SPARE_LSB) -#define TXPC_MISC_SPARE_SET(x) (((x) << TXPC_MISC_SPARE_LSB) & TXPC_MISC_SPARE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct txpc_reg_reg_s { - volatile unsigned int txpc_txpc; - volatile unsigned int txpc_misc; -} txpc_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _TXPC_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/txpc_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/txpc_reg.vrh deleted file mode 100644 index 0b5423f0805a..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/txpc_reg.vrh +++ /dev/null @@ -1,257 +0,0 @@ -#ifndef _TXPC_REG_VRH_ -#define _TXPC_REG_VRH_ - -#define TXPC_TXPC_ADDRESS 'h00000000 -#define TXPC_TXPC_SELINTPD_MSB 31 -#define TXPC_TXPC_SELINTPD_LSB 31 -#define TXPC_TXPC_SELINTPD_MASK 'h80000000 -#define TXPC_TXPC_SELINTPD_GET(x) (((x) & TXPC_TXPC_SELINTPD_MASK) >> TXPC_TXPC_SELINTPD_LSB) -#define TXPC_TXPC_SELINTPD_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELINTPD_LSB) & TXPC_TXPC_SELINTPD_MASK) -#define TXPC_TXPC_SELINTPD_RESET 1'h0 -#define TXPC_TXPC_TEST_MSB 30 -#define TXPC_TXPC_TEST_LSB 30 -#define TXPC_TXPC_TEST_MASK 'h40000000 -#define TXPC_TXPC_TEST_GET(x) (((x) & TXPC_TXPC_TEST_MASK) >> TXPC_TXPC_TEST_LSB) -#define TXPC_TXPC_TEST_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TEST_LSB) & TXPC_TXPC_TEST_MASK) -#define TXPC_TXPC_TEST_RESET 1'h0 -#define TXPC_TXPC_TESTGAIN_MSB 29 -#define TXPC_TXPC_TESTGAIN_LSB 28 -#define TXPC_TXPC_TESTGAIN_MASK 'h30000000 -#define TXPC_TXPC_TESTGAIN_GET(x) (((x) & TXPC_TXPC_TESTGAIN_MASK) >> TXPC_TXPC_TESTGAIN_LSB) -#define TXPC_TXPC_TESTGAIN_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TESTGAIN_LSB) & TXPC_TXPC_TESTGAIN_MASK) -#define TXPC_TXPC_TESTGAIN_RESET 2'h0 -#define TXPC_TXPC_TESTDAC_MSB 27 -#define TXPC_TXPC_TESTDAC_LSB 22 -#define TXPC_TXPC_TESTDAC_MASK 'h0fc00000 -#define TXPC_TXPC_TESTDAC_GET(x) (((x) & TXPC_TXPC_TESTDAC_MASK) >> TXPC_TXPC_TESTDAC_LSB) -#define TXPC_TXPC_TESTDAC_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TESTDAC_LSB) & TXPC_TXPC_TESTDAC_MASK) -#define TXPC_TXPC_TESTDAC_RESET 6'h20 -#define TXPC_TXPC_TESTPWDPC_MSB 21 -#define TXPC_TXPC_TESTPWDPC_LSB 21 -#define TXPC_TXPC_TESTPWDPC_MASK 'h00200000 -#define TXPC_TXPC_TESTPWDPC_GET(x) (((x) & TXPC_TXPC_TESTPWDPC_MASK) >> TXPC_TXPC_TESTPWDPC_LSB) -#define TXPC_TXPC_TESTPWDPC_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TESTPWDPC_LSB) & TXPC_TXPC_TESTPWDPC_MASK) -#define TXPC_TXPC_TESTPWDPC_RESET 1'h0 -#define TXPC_TXPC_CURHALF_MSB 20 -#define TXPC_TXPC_CURHALF_LSB 20 -#define TXPC_TXPC_CURHALF_MASK 'h00100000 -#define TXPC_TXPC_CURHALF_GET(x) (((x) & TXPC_TXPC_CURHALF_MASK) >> TXPC_TXPC_CURHALF_LSB) -#define TXPC_TXPC_CURHALF_SET(x) (((32'd0 | (x)) << TXPC_TXPC_CURHALF_LSB) & TXPC_TXPC_CURHALF_MASK) -#define TXPC_TXPC_CURHALF_RESET 1'h1 -#define TXPC_TXPC_NEGOUT_MSB 19 -#define TXPC_TXPC_NEGOUT_LSB 19 -#define TXPC_TXPC_NEGOUT_MASK 'h00080000 -#define TXPC_TXPC_NEGOUT_GET(x) (((x) & TXPC_TXPC_NEGOUT_MASK) >> TXPC_TXPC_NEGOUT_LSB) -#define TXPC_TXPC_NEGOUT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_NEGOUT_LSB) & TXPC_TXPC_NEGOUT_MASK) -#define TXPC_TXPC_NEGOUT_RESET 1'h0 -#define TXPC_TXPC_CLKDELAY_MSB 18 -#define TXPC_TXPC_CLKDELAY_LSB 18 -#define TXPC_TXPC_CLKDELAY_MASK 'h00040000 -#define TXPC_TXPC_CLKDELAY_GET(x) (((x) & TXPC_TXPC_CLKDELAY_MASK) >> TXPC_TXPC_CLKDELAY_LSB) -#define TXPC_TXPC_CLKDELAY_SET(x) (((32'd0 | (x)) << TXPC_TXPC_CLKDELAY_LSB) & TXPC_TXPC_CLKDELAY_MASK) -#define TXPC_TXPC_CLKDELAY_RESET 1'h0 -#define TXPC_TXPC_SELMODREF_MSB 17 -#define TXPC_TXPC_SELMODREF_LSB 17 -#define TXPC_TXPC_SELMODREF_MASK 'h00020000 -#define TXPC_TXPC_SELMODREF_GET(x) (((x) & TXPC_TXPC_SELMODREF_MASK) >> TXPC_TXPC_SELMODREF_LSB) -#define TXPC_TXPC_SELMODREF_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELMODREF_LSB) & TXPC_TXPC_SELMODREF_MASK) -#define TXPC_TXPC_SELMODREF_RESET 1'h0 -#define TXPC_TXPC_SELCMOUT_MSB 16 -#define TXPC_TXPC_SELCMOUT_LSB 16 -#define TXPC_TXPC_SELCMOUT_MASK 'h00010000 -#define TXPC_TXPC_SELCMOUT_GET(x) (((x) & TXPC_TXPC_SELCMOUT_MASK) >> TXPC_TXPC_SELCMOUT_LSB) -#define TXPC_TXPC_SELCMOUT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELCMOUT_LSB) & TXPC_TXPC_SELCMOUT_MASK) -#define TXPC_TXPC_SELCMOUT_RESET 1'h0 -#define TXPC_TXPC_TSMODE_MSB 15 -#define TXPC_TXPC_TSMODE_LSB 14 -#define TXPC_TXPC_TSMODE_MASK 'h0000c000 -#define TXPC_TXPC_TSMODE_GET(x) (((x) & TXPC_TXPC_TSMODE_MASK) >> TXPC_TXPC_TSMODE_LSB) -#define TXPC_TXPC_TSMODE_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TSMODE_LSB) & TXPC_TXPC_TSMODE_MASK) -#define TXPC_TXPC_TSMODE_RESET 2'h0 -#define TXPC_TXPC_N_MSB 13 -#define TXPC_TXPC_N_LSB 6 -#define TXPC_TXPC_N_MASK 'h00003fc0 -#define TXPC_TXPC_N_GET(x) (((x) & TXPC_TXPC_N_MASK) >> TXPC_TXPC_N_LSB) -#define TXPC_TXPC_N_SET(x) (((32'd0 | (x)) << TXPC_TXPC_N_LSB) & TXPC_TXPC_N_MASK) -#define TXPC_TXPC_N_RESET 8'h80 -#define TXPC_TXPC_ON1STSYNTHON_MSB 5 -#define TXPC_TXPC_ON1STSYNTHON_LSB 5 -#define TXPC_TXPC_ON1STSYNTHON_MASK 'h00000020 -#define TXPC_TXPC_ON1STSYNTHON_GET(x) (((x) & TXPC_TXPC_ON1STSYNTHON_MASK) >> TXPC_TXPC_ON1STSYNTHON_LSB) -#define TXPC_TXPC_ON1STSYNTHON_SET(x) (((32'd0 | (x)) << TXPC_TXPC_ON1STSYNTHON_LSB) & TXPC_TXPC_ON1STSYNTHON_MASK) -#define TXPC_TXPC_ON1STSYNTHON_RESET 1'h1 -#define TXPC_TXPC_SELINIT_MSB 4 -#define TXPC_TXPC_SELINIT_LSB 3 -#define TXPC_TXPC_SELINIT_MASK 'h00000018 -#define TXPC_TXPC_SELINIT_GET(x) (((x) & TXPC_TXPC_SELINIT_MASK) >> TXPC_TXPC_SELINIT_LSB) -#define TXPC_TXPC_SELINIT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELINIT_LSB) & TXPC_TXPC_SELINIT_MASK) -#define TXPC_TXPC_SELINIT_RESET 2'h3 -#define TXPC_TXPC_SELCOUNT_MSB 2 -#define TXPC_TXPC_SELCOUNT_LSB 2 -#define TXPC_TXPC_SELCOUNT_MASK 'h00000004 -#define TXPC_TXPC_SELCOUNT_GET(x) (((x) & TXPC_TXPC_SELCOUNT_MASK) >> TXPC_TXPC_SELCOUNT_LSB) -#define TXPC_TXPC_SELCOUNT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELCOUNT_LSB) & TXPC_TXPC_SELCOUNT_MASK) -#define TXPC_TXPC_SELCOUNT_RESET 1'h1 -#define TXPC_TXPC_ATBSEL_MSB 1 -#define TXPC_TXPC_ATBSEL_LSB 0 -#define TXPC_TXPC_ATBSEL_MASK 'h00000003 -#define TXPC_TXPC_ATBSEL_GET(x) (((x) & TXPC_TXPC_ATBSEL_MASK) >> TXPC_TXPC_ATBSEL_LSB) -#define TXPC_TXPC_ATBSEL_SET(x) (((32'd0 | (x)) << TXPC_TXPC_ATBSEL_LSB) & TXPC_TXPC_ATBSEL_MASK) -#define TXPC_TXPC_ATBSEL_RESET 2'h0 -#define TXPC_TXPC_RESET (32'h0 | \ - TXPC_TXPC_SELINTPD_SET(TXPC_TXPC_SELINTPD_RESET) | \ - TXPC_TXPC_TEST_SET(TXPC_TXPC_TEST_RESET) | \ - TXPC_TXPC_TESTGAIN_SET(TXPC_TXPC_TESTGAIN_RESET) | \ - TXPC_TXPC_TESTDAC_SET(TXPC_TXPC_TESTDAC_RESET) | \ - TXPC_TXPC_TESTPWDPC_SET(TXPC_TXPC_TESTPWDPC_RESET) | \ - TXPC_TXPC_CURHALF_SET(TXPC_TXPC_CURHALF_RESET) | \ - TXPC_TXPC_NEGOUT_SET(TXPC_TXPC_NEGOUT_RESET) | \ - TXPC_TXPC_CLKDELAY_SET(TXPC_TXPC_CLKDELAY_RESET) | \ - TXPC_TXPC_SELMODREF_SET(TXPC_TXPC_SELMODREF_RESET) | \ - TXPC_TXPC_SELCMOUT_SET(TXPC_TXPC_SELCMOUT_RESET) | \ - TXPC_TXPC_TSMODE_SET(TXPC_TXPC_TSMODE_RESET) | \ - TXPC_TXPC_N_SET(TXPC_TXPC_N_RESET) | \ - TXPC_TXPC_ON1STSYNTHON_SET(TXPC_TXPC_ON1STSYNTHON_RESET) | \ - TXPC_TXPC_SELINIT_SET(TXPC_TXPC_SELINIT_RESET) | \ - TXPC_TXPC_SELCOUNT_SET(TXPC_TXPC_SELCOUNT_RESET) | \ - TXPC_TXPC_ATBSEL_SET(TXPC_TXPC_ATBSEL_RESET)) -#define TXPC_TXPC_HW_MASK (32'h0) -#define TXPC_TXPC_SW_MASK (32'h0 | \ - TXPC_TXPC_SELINTPD_MASK | \ - TXPC_TXPC_TEST_MASK | \ - TXPC_TXPC_TESTGAIN_MASK | \ - TXPC_TXPC_TESTDAC_MASK | \ - TXPC_TXPC_TESTPWDPC_MASK | \ - TXPC_TXPC_CURHALF_MASK | \ - TXPC_TXPC_NEGOUT_MASK | \ - TXPC_TXPC_CLKDELAY_MASK | \ - TXPC_TXPC_SELMODREF_MASK | \ - TXPC_TXPC_SELCMOUT_MASK | \ - TXPC_TXPC_TSMODE_MASK | \ - TXPC_TXPC_N_MASK | \ - TXPC_TXPC_ON1STSYNTHON_MASK | \ - TXPC_TXPC_SELINIT_MASK | \ - TXPC_TXPC_SELCOUNT_MASK | \ - TXPC_TXPC_ATBSEL_MASK) - -#define TXPC_MISC_ADDRESS 'h00000004 -#define TXPC_MISC_FLIPBMODE_MSB 31 -#define TXPC_MISC_FLIPBMODE_LSB 31 -#define TXPC_MISC_FLIPBMODE_MASK 'h80000000 -#define TXPC_MISC_FLIPBMODE_GET(x) (((x) & TXPC_MISC_FLIPBMODE_MASK) >> TXPC_MISC_FLIPBMODE_LSB) -#define TXPC_MISC_FLIPBMODE_SET(x) (((32'd0 | (x)) << TXPC_MISC_FLIPBMODE_LSB) & TXPC_MISC_FLIPBMODE_MASK) -#define TXPC_MISC_FLIPBMODE_RESET 1'h0 -#define TXPC_MISC_LEVEL_MSB 30 -#define TXPC_MISC_LEVEL_LSB 29 -#define TXPC_MISC_LEVEL_MASK 'h60000000 -#define TXPC_MISC_LEVEL_GET(x) (((x) & TXPC_MISC_LEVEL_MASK) >> TXPC_MISC_LEVEL_LSB) -#define TXPC_MISC_LEVEL_SET(x) (((32'd0 | (x)) << TXPC_MISC_LEVEL_LSB) & TXPC_MISC_LEVEL_MASK) -#define TXPC_MISC_LEVEL_RESET 2'h0 -#define TXPC_MISC_LDO_TEST_MODE_MSB 28 -#define TXPC_MISC_LDO_TEST_MODE_LSB 28 -#define TXPC_MISC_LDO_TEST_MODE_MASK 'h10000000 -#define TXPC_MISC_LDO_TEST_MODE_GET(x) (((x) & TXPC_MISC_LDO_TEST_MODE_MASK) >> TXPC_MISC_LDO_TEST_MODE_LSB) -#define TXPC_MISC_LDO_TEST_MODE_SET(x) (((32'd0 | (x)) << TXPC_MISC_LDO_TEST_MODE_LSB) & TXPC_MISC_LDO_TEST_MODE_MASK) -#define TXPC_MISC_LDO_TEST_MODE_RESET 1'h0 -#define TXPC_MISC_NOTCXODET_MSB 27 -#define TXPC_MISC_NOTCXODET_LSB 27 -#define TXPC_MISC_NOTCXODET_MASK 'h08000000 -#define TXPC_MISC_NOTCXODET_GET(x) (((x) & TXPC_MISC_NOTCXODET_MASK) >> TXPC_MISC_NOTCXODET_LSB) -#define TXPC_MISC_NOTCXODET_SET(x) (((32'd0 | (x)) << TXPC_MISC_NOTCXODET_LSB) & TXPC_MISC_NOTCXODET_MASK) -#define TXPC_MISC_NOTCXODET_RESET 1'h0 -#define TXPC_MISC_PWDCLKIND_MSB 26 -#define TXPC_MISC_PWDCLKIND_LSB 26 -#define TXPC_MISC_PWDCLKIND_MASK 'h04000000 -#define TXPC_MISC_PWDCLKIND_GET(x) (((x) & TXPC_MISC_PWDCLKIND_MASK) >> TXPC_MISC_PWDCLKIND_LSB) -#define TXPC_MISC_PWDCLKIND_SET(x) (((32'd0 | (x)) << TXPC_MISC_PWDCLKIND_LSB) & TXPC_MISC_PWDCLKIND_MASK) -#define TXPC_MISC_PWDCLKIND_RESET 1'h0 -#define TXPC_MISC_PWDXINPAD_MSB 25 -#define TXPC_MISC_PWDXINPAD_LSB 25 -#define TXPC_MISC_PWDXINPAD_MASK 'h02000000 -#define TXPC_MISC_PWDXINPAD_GET(x) (((x) & TXPC_MISC_PWDXINPAD_MASK) >> TXPC_MISC_PWDXINPAD_LSB) -#define TXPC_MISC_PWDXINPAD_SET(x) (((32'd0 | (x)) << TXPC_MISC_PWDXINPAD_LSB) & TXPC_MISC_PWDXINPAD_MASK) -#define TXPC_MISC_PWDXINPAD_RESET 1'h0 -#define TXPC_MISC_LOCALBIAS_MSB 24 -#define TXPC_MISC_LOCALBIAS_LSB 24 -#define TXPC_MISC_LOCALBIAS_MASK 'h01000000 -#define TXPC_MISC_LOCALBIAS_GET(x) (((x) & TXPC_MISC_LOCALBIAS_MASK) >> TXPC_MISC_LOCALBIAS_LSB) -#define TXPC_MISC_LOCALBIAS_SET(x) (((32'd0 | (x)) << TXPC_MISC_LOCALBIAS_LSB) & TXPC_MISC_LOCALBIAS_MASK) -#define TXPC_MISC_LOCALBIAS_RESET 1'h1 -#define TXPC_MISC_LOCALBIAS2X_MSB 23 -#define TXPC_MISC_LOCALBIAS2X_LSB 23 -#define TXPC_MISC_LOCALBIAS2X_MASK 'h00800000 -#define TXPC_MISC_LOCALBIAS2X_GET(x) (((x) & TXPC_MISC_LOCALBIAS2X_MASK) >> TXPC_MISC_LOCALBIAS2X_LSB) -#define TXPC_MISC_LOCALBIAS2X_SET(x) (((32'd0 | (x)) << TXPC_MISC_LOCALBIAS2X_LSB) & TXPC_MISC_LOCALBIAS2X_MASK) -#define TXPC_MISC_LOCALBIAS2X_RESET 1'h0 -#define TXPC_MISC_SELTSP_MSB 22 -#define TXPC_MISC_SELTSP_LSB 22 -#define TXPC_MISC_SELTSP_MASK 'h00400000 -#define TXPC_MISC_SELTSP_GET(x) (((x) & TXPC_MISC_SELTSP_MASK) >> TXPC_MISC_SELTSP_LSB) -#define TXPC_MISC_SELTSP_SET(x) (((32'd0 | (x)) << TXPC_MISC_SELTSP_LSB) & TXPC_MISC_SELTSP_MASK) -#define TXPC_MISC_SELTSP_RESET 1'h0 -#define TXPC_MISC_SELTSN_MSB 21 -#define TXPC_MISC_SELTSN_LSB 21 -#define TXPC_MISC_SELTSN_MASK 'h00200000 -#define TXPC_MISC_SELTSN_GET(x) (((x) & TXPC_MISC_SELTSN_MASK) >> TXPC_MISC_SELTSN_LSB) -#define TXPC_MISC_SELTSN_SET(x) (((32'd0 | (x)) << TXPC_MISC_SELTSN_LSB) & TXPC_MISC_SELTSN_MASK) -#define TXPC_MISC_SELTSN_RESET 1'h0 -#define TXPC_MISC_SPARE_A_MSB 20 -#define TXPC_MISC_SPARE_A_LSB 18 -#define TXPC_MISC_SPARE_A_MASK 'h001c0000 -#define TXPC_MISC_SPARE_A_GET(x) (((x) & TXPC_MISC_SPARE_A_MASK) >> TXPC_MISC_SPARE_A_LSB) -#define TXPC_MISC_SPARE_A_SET(x) (((32'd0 | (x)) << TXPC_MISC_SPARE_A_LSB) & TXPC_MISC_SPARE_A_MASK) -#define TXPC_MISC_SPARE_A_RESET 3'h0 -#define TXPC_MISC_DECOUT_MSB 17 -#define TXPC_MISC_DECOUT_LSB 8 -#define TXPC_MISC_DECOUT_MASK 'h0003ff00 -#define TXPC_MISC_DECOUT_GET(x) (((x) & TXPC_MISC_DECOUT_MASK) >> TXPC_MISC_DECOUT_LSB) -#define TXPC_MISC_DECOUT_SET(x) (((32'd0 | (x)) << TXPC_MISC_DECOUT_LSB) & TXPC_MISC_DECOUT_MASK) -#define TXPC_MISC_DECOUT_RESET 10'h0 -#define TXPC_MISC_XTALDIV_MSB 7 -#define TXPC_MISC_XTALDIV_LSB 6 -#define TXPC_MISC_XTALDIV_MASK 'h000000c0 -#define TXPC_MISC_XTALDIV_GET(x) (((x) & TXPC_MISC_XTALDIV_MASK) >> TXPC_MISC_XTALDIV_LSB) -#define TXPC_MISC_XTALDIV_SET(x) (((32'd0 | (x)) << TXPC_MISC_XTALDIV_LSB) & TXPC_MISC_XTALDIV_MASK) -#define TXPC_MISC_XTALDIV_RESET 2'h0 -#define TXPC_MISC_SPARE_MSB 5 -#define TXPC_MISC_SPARE_LSB 0 -#define TXPC_MISC_SPARE_MASK 'h0000003f -#define TXPC_MISC_SPARE_GET(x) (((x) & TXPC_MISC_SPARE_MASK) >> TXPC_MISC_SPARE_LSB) -#define TXPC_MISC_SPARE_SET(x) (((32'd0 | (x)) << TXPC_MISC_SPARE_LSB) & TXPC_MISC_SPARE_MASK) -#define TXPC_MISC_SPARE_RESET 6'h0 -#define TXPC_MISC_RESET (32'h0 | \ - TXPC_MISC_FLIPBMODE_SET(TXPC_MISC_FLIPBMODE_RESET) | \ - TXPC_MISC_LEVEL_SET(TXPC_MISC_LEVEL_RESET) | \ - TXPC_MISC_LDO_TEST_MODE_SET(TXPC_MISC_LDO_TEST_MODE_RESET) | \ - TXPC_MISC_NOTCXODET_SET(TXPC_MISC_NOTCXODET_RESET) | \ - TXPC_MISC_PWDCLKIND_SET(TXPC_MISC_PWDCLKIND_RESET) | \ - TXPC_MISC_PWDXINPAD_SET(TXPC_MISC_PWDXINPAD_RESET) | \ - TXPC_MISC_LOCALBIAS_SET(TXPC_MISC_LOCALBIAS_RESET) | \ - TXPC_MISC_LOCALBIAS2X_SET(TXPC_MISC_LOCALBIAS2X_RESET) | \ - TXPC_MISC_SELTSP_SET(TXPC_MISC_SELTSP_RESET) | \ - TXPC_MISC_SELTSN_SET(TXPC_MISC_SELTSN_RESET) | \ - TXPC_MISC_SPARE_A_SET(TXPC_MISC_SPARE_A_RESET) | \ - TXPC_MISC_DECOUT_SET(TXPC_MISC_DECOUT_RESET) | \ - TXPC_MISC_XTALDIV_SET(TXPC_MISC_XTALDIV_RESET) | \ - TXPC_MISC_SPARE_SET(TXPC_MISC_SPARE_RESET)) -#define TXPC_MISC_HW_MASK (32'h0 | \ - TXPC_MISC_DECOUT_MASK) -#define TXPC_MISC_SW_MASK (32'h0 | \ - TXPC_MISC_FLIPBMODE_MASK | \ - TXPC_MISC_LEVEL_MASK | \ - TXPC_MISC_LDO_TEST_MODE_MASK | \ - TXPC_MISC_NOTCXODET_MASK | \ - TXPC_MISC_PWDCLKIND_MASK | \ - TXPC_MISC_PWDXINPAD_MASK | \ - TXPC_MISC_LOCALBIAS_MASK | \ - TXPC_MISC_LOCALBIAS2X_MASK | \ - TXPC_MISC_SELTSP_MASK | \ - TXPC_MISC_SELTSN_MASK | \ - TXPC_MISC_SPARE_A_MASK | \ - TXPC_MISC_DECOUT_MASK | \ - TXPC_MISC_XTALDIV_MASK | \ - TXPC_MISC_SPARE_MASK) - -#define TXPC_REG_ADDRESS_MSB 2 - -#endif /* _TXPC_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/uart_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/uart_reg.h deleted file mode 100644 index 5db321b72b2c..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/uart_reg.h +++ /dev/null @@ -1,327 +0,0 @@ -#ifndef _UART_REG_REG_H_ -#define _UART_REG_REG_H_ - -#define RBR_ADDRESS 0x00000000 -#define RBR_OFFSET 0x00000000 -#define RBR_RBR_MSB 7 -#define RBR_RBR_LSB 0 -#define RBR_RBR_MASK 0x000000ff -#define RBR_RBR_GET(x) (((x) & RBR_RBR_MASK) >> RBR_RBR_LSB) -#define RBR_RBR_SET(x) (((x) << RBR_RBR_LSB) & RBR_RBR_MASK) - -#define THR_ADDRESS 0x00000000 -#define THR_OFFSET 0x00000000 -#define THR_THR_MSB 7 -#define THR_THR_LSB 0 -#define THR_THR_MASK 0x000000ff -#define THR_THR_GET(x) (((x) & THR_THR_MASK) >> THR_THR_LSB) -#define THR_THR_SET(x) (((x) << THR_THR_LSB) & THR_THR_MASK) - -#define DLL_ADDRESS 0x00000000 -#define DLL_OFFSET 0x00000000 -#define DLL_DLL_MSB 7 -#define DLL_DLL_LSB 0 -#define DLL_DLL_MASK 0x000000ff -#define DLL_DLL_GET(x) (((x) & DLL_DLL_MASK) >> DLL_DLL_LSB) -#define DLL_DLL_SET(x) (((x) << DLL_DLL_LSB) & DLL_DLL_MASK) - -#define DLH_ADDRESS 0x00000004 -#define DLH_OFFSET 0x00000004 -#define DLH_DLH_MSB 7 -#define DLH_DLH_LSB 0 -#define DLH_DLH_MASK 0x000000ff -#define DLH_DLH_GET(x) (((x) & DLH_DLH_MASK) >> DLH_DLH_LSB) -#define DLH_DLH_SET(x) (((x) << DLH_DLH_LSB) & DLH_DLH_MASK) - -#define IER_ADDRESS 0x00000004 -#define IER_OFFSET 0x00000004 -#define IER_EDDSI_MSB 3 -#define IER_EDDSI_LSB 3 -#define IER_EDDSI_MASK 0x00000008 -#define IER_EDDSI_GET(x) (((x) & IER_EDDSI_MASK) >> IER_EDDSI_LSB) -#define IER_EDDSI_SET(x) (((x) << IER_EDDSI_LSB) & IER_EDDSI_MASK) -#define IER_ELSI_MSB 2 -#define IER_ELSI_LSB 2 -#define IER_ELSI_MASK 0x00000004 -#define IER_ELSI_GET(x) (((x) & IER_ELSI_MASK) >> IER_ELSI_LSB) -#define IER_ELSI_SET(x) (((x) << IER_ELSI_LSB) & IER_ELSI_MASK) -#define IER_ETBEI_MSB 1 -#define IER_ETBEI_LSB 1 -#define IER_ETBEI_MASK 0x00000002 -#define IER_ETBEI_GET(x) (((x) & IER_ETBEI_MASK) >> IER_ETBEI_LSB) -#define IER_ETBEI_SET(x) (((x) << IER_ETBEI_LSB) & IER_ETBEI_MASK) -#define IER_ERBFI_MSB 0 -#define IER_ERBFI_LSB 0 -#define IER_ERBFI_MASK 0x00000001 -#define IER_ERBFI_GET(x) (((x) & IER_ERBFI_MASK) >> IER_ERBFI_LSB) -#define IER_ERBFI_SET(x) (((x) << IER_ERBFI_LSB) & IER_ERBFI_MASK) - -#define IIR_ADDRESS 0x00000008 -#define IIR_OFFSET 0x00000008 -#define IIR_FIFO_STATUS_MSB 7 -#define IIR_FIFO_STATUS_LSB 6 -#define IIR_FIFO_STATUS_MASK 0x000000c0 -#define IIR_FIFO_STATUS_GET(x) (((x) & IIR_FIFO_STATUS_MASK) >> IIR_FIFO_STATUS_LSB) -#define IIR_FIFO_STATUS_SET(x) (((x) << IIR_FIFO_STATUS_LSB) & IIR_FIFO_STATUS_MASK) -#define IIR_IID_MSB 3 -#define IIR_IID_LSB 0 -#define IIR_IID_MASK 0x0000000f -#define IIR_IID_GET(x) (((x) & IIR_IID_MASK) >> IIR_IID_LSB) -#define IIR_IID_SET(x) (((x) << IIR_IID_LSB) & IIR_IID_MASK) - -#define FCR_ADDRESS 0x00000008 -#define FCR_OFFSET 0x00000008 -#define FCR_RCVR_TRIG_MSB 7 -#define FCR_RCVR_TRIG_LSB 6 -#define FCR_RCVR_TRIG_MASK 0x000000c0 -#define FCR_RCVR_TRIG_GET(x) (((x) & FCR_RCVR_TRIG_MASK) >> FCR_RCVR_TRIG_LSB) -#define FCR_RCVR_TRIG_SET(x) (((x) << FCR_RCVR_TRIG_LSB) & FCR_RCVR_TRIG_MASK) -#define FCR_DMA_MODE_MSB 3 -#define FCR_DMA_MODE_LSB 3 -#define FCR_DMA_MODE_MASK 0x00000008 -#define FCR_DMA_MODE_GET(x) (((x) & FCR_DMA_MODE_MASK) >> FCR_DMA_MODE_LSB) -#define FCR_DMA_MODE_SET(x) (((x) << FCR_DMA_MODE_LSB) & FCR_DMA_MODE_MASK) -#define FCR_XMIT_FIFO_RST_MSB 2 -#define FCR_XMIT_FIFO_RST_LSB 2 -#define FCR_XMIT_FIFO_RST_MASK 0x00000004 -#define FCR_XMIT_FIFO_RST_GET(x) (((x) & FCR_XMIT_FIFO_RST_MASK) >> FCR_XMIT_FIFO_RST_LSB) -#define FCR_XMIT_FIFO_RST_SET(x) (((x) << FCR_XMIT_FIFO_RST_LSB) & FCR_XMIT_FIFO_RST_MASK) -#define FCR_RCVR_FIFO_RST_MSB 1 -#define FCR_RCVR_FIFO_RST_LSB 1 -#define FCR_RCVR_FIFO_RST_MASK 0x00000002 -#define FCR_RCVR_FIFO_RST_GET(x) (((x) & FCR_RCVR_FIFO_RST_MASK) >> FCR_RCVR_FIFO_RST_LSB) -#define FCR_RCVR_FIFO_RST_SET(x) (((x) << FCR_RCVR_FIFO_RST_LSB) & FCR_RCVR_FIFO_RST_MASK) -#define FCR_FIFO_EN_MSB 0 -#define FCR_FIFO_EN_LSB 0 -#define FCR_FIFO_EN_MASK 0x00000001 -#define FCR_FIFO_EN_GET(x) (((x) & FCR_FIFO_EN_MASK) >> FCR_FIFO_EN_LSB) -#define FCR_FIFO_EN_SET(x) (((x) << FCR_FIFO_EN_LSB) & FCR_FIFO_EN_MASK) - -#define LCR_ADDRESS 0x0000000c -#define LCR_OFFSET 0x0000000c -#define LCR_DLAB_MSB 7 -#define LCR_DLAB_LSB 7 -#define LCR_DLAB_MASK 0x00000080 -#define LCR_DLAB_GET(x) (((x) & LCR_DLAB_MASK) >> LCR_DLAB_LSB) -#define LCR_DLAB_SET(x) (((x) << LCR_DLAB_LSB) & LCR_DLAB_MASK) -#define LCR_BREAK_MSB 6 -#define LCR_BREAK_LSB 6 -#define LCR_BREAK_MASK 0x00000040 -#define LCR_BREAK_GET(x) (((x) & LCR_BREAK_MASK) >> LCR_BREAK_LSB) -#define LCR_BREAK_SET(x) (((x) << LCR_BREAK_LSB) & LCR_BREAK_MASK) -#define LCR_EPS_MSB 4 -#define LCR_EPS_LSB 4 -#define LCR_EPS_MASK 0x00000010 -#define LCR_EPS_GET(x) (((x) & LCR_EPS_MASK) >> LCR_EPS_LSB) -#define LCR_EPS_SET(x) (((x) << LCR_EPS_LSB) & LCR_EPS_MASK) -#define LCR_PEN_MSB 3 -#define LCR_PEN_LSB 3 -#define LCR_PEN_MASK 0x00000008 -#define LCR_PEN_GET(x) (((x) & LCR_PEN_MASK) >> LCR_PEN_LSB) -#define LCR_PEN_SET(x) (((x) << LCR_PEN_LSB) & LCR_PEN_MASK) -#define LCR_STOP_MSB 2 -#define LCR_STOP_LSB 2 -#define LCR_STOP_MASK 0x00000004 -#define LCR_STOP_GET(x) (((x) & LCR_STOP_MASK) >> LCR_STOP_LSB) -#define LCR_STOP_SET(x) (((x) << LCR_STOP_LSB) & LCR_STOP_MASK) -#define LCR_CLS_MSB 1 -#define LCR_CLS_LSB 0 -#define LCR_CLS_MASK 0x00000003 -#define LCR_CLS_GET(x) (((x) & LCR_CLS_MASK) >> LCR_CLS_LSB) -#define LCR_CLS_SET(x) (((x) << LCR_CLS_LSB) & LCR_CLS_MASK) - -#define MCR_ADDRESS 0x00000010 -#define MCR_OFFSET 0x00000010 -#define MCR_LOOPBACK_MSB 5 -#define MCR_LOOPBACK_LSB 5 -#define MCR_LOOPBACK_MASK 0x00000020 -#define MCR_LOOPBACK_GET(x) (((x) & MCR_LOOPBACK_MASK) >> MCR_LOOPBACK_LSB) -#define MCR_LOOPBACK_SET(x) (((x) << MCR_LOOPBACK_LSB) & MCR_LOOPBACK_MASK) -#define MCR_OUT2_MSB 3 -#define MCR_OUT2_LSB 3 -#define MCR_OUT2_MASK 0x00000008 -#define MCR_OUT2_GET(x) (((x) & MCR_OUT2_MASK) >> MCR_OUT2_LSB) -#define MCR_OUT2_SET(x) (((x) << MCR_OUT2_LSB) & MCR_OUT2_MASK) -#define MCR_OUT1_MSB 2 -#define MCR_OUT1_LSB 2 -#define MCR_OUT1_MASK 0x00000004 -#define MCR_OUT1_GET(x) (((x) & MCR_OUT1_MASK) >> MCR_OUT1_LSB) -#define MCR_OUT1_SET(x) (((x) << MCR_OUT1_LSB) & MCR_OUT1_MASK) -#define MCR_RTS_MSB 1 -#define MCR_RTS_LSB 1 -#define MCR_RTS_MASK 0x00000002 -#define MCR_RTS_GET(x) (((x) & MCR_RTS_MASK) >> MCR_RTS_LSB) -#define MCR_RTS_SET(x) (((x) << MCR_RTS_LSB) & MCR_RTS_MASK) -#define MCR_DTR_MSB 0 -#define MCR_DTR_LSB 0 -#define MCR_DTR_MASK 0x00000001 -#define MCR_DTR_GET(x) (((x) & MCR_DTR_MASK) >> MCR_DTR_LSB) -#define MCR_DTR_SET(x) (((x) << MCR_DTR_LSB) & MCR_DTR_MASK) - -#define LSR_ADDRESS 0x00000014 -#define LSR_OFFSET 0x00000014 -#define LSR_FERR_MSB 7 -#define LSR_FERR_LSB 7 -#define LSR_FERR_MASK 0x00000080 -#define LSR_FERR_GET(x) (((x) & LSR_FERR_MASK) >> LSR_FERR_LSB) -#define LSR_FERR_SET(x) (((x) << LSR_FERR_LSB) & LSR_FERR_MASK) -#define LSR_TEMT_MSB 6 -#define LSR_TEMT_LSB 6 -#define LSR_TEMT_MASK 0x00000040 -#define LSR_TEMT_GET(x) (((x) & LSR_TEMT_MASK) >> LSR_TEMT_LSB) -#define LSR_TEMT_SET(x) (((x) << LSR_TEMT_LSB) & LSR_TEMT_MASK) -#define LSR_THRE_MSB 5 -#define LSR_THRE_LSB 5 -#define LSR_THRE_MASK 0x00000020 -#define LSR_THRE_GET(x) (((x) & LSR_THRE_MASK) >> LSR_THRE_LSB) -#define LSR_THRE_SET(x) (((x) << LSR_THRE_LSB) & LSR_THRE_MASK) -#define LSR_BI_MSB 4 -#define LSR_BI_LSB 4 -#define LSR_BI_MASK 0x00000010 -#define LSR_BI_GET(x) (((x) & LSR_BI_MASK) >> LSR_BI_LSB) -#define LSR_BI_SET(x) (((x) << LSR_BI_LSB) & LSR_BI_MASK) -#define LSR_FE_MSB 3 -#define LSR_FE_LSB 3 -#define LSR_FE_MASK 0x00000008 -#define LSR_FE_GET(x) (((x) & LSR_FE_MASK) >> LSR_FE_LSB) -#define LSR_FE_SET(x) (((x) << LSR_FE_LSB) & LSR_FE_MASK) -#define LSR_PE_MSB 2 -#define LSR_PE_LSB 2 -#define LSR_PE_MASK 0x00000004 -#define LSR_PE_GET(x) (((x) & LSR_PE_MASK) >> LSR_PE_LSB) -#define LSR_PE_SET(x) (((x) << LSR_PE_LSB) & LSR_PE_MASK) -#define LSR_OE_MSB 1 -#define LSR_OE_LSB 1 -#define LSR_OE_MASK 0x00000002 -#define LSR_OE_GET(x) (((x) & LSR_OE_MASK) >> LSR_OE_LSB) -#define LSR_OE_SET(x) (((x) << LSR_OE_LSB) & LSR_OE_MASK) -#define LSR_DR_MSB 0 -#define LSR_DR_LSB 0 -#define LSR_DR_MASK 0x00000001 -#define LSR_DR_GET(x) (((x) & LSR_DR_MASK) >> LSR_DR_LSB) -#define LSR_DR_SET(x) (((x) << LSR_DR_LSB) & LSR_DR_MASK) - -#define MSR_ADDRESS 0x00000018 -#define MSR_OFFSET 0x00000018 -#define MSR_DCD_MSB 7 -#define MSR_DCD_LSB 7 -#define MSR_DCD_MASK 0x00000080 -#define MSR_DCD_GET(x) (((x) & MSR_DCD_MASK) >> MSR_DCD_LSB) -#define MSR_DCD_SET(x) (((x) << MSR_DCD_LSB) & MSR_DCD_MASK) -#define MSR_RI_MSB 6 -#define MSR_RI_LSB 6 -#define MSR_RI_MASK 0x00000040 -#define MSR_RI_GET(x) (((x) & MSR_RI_MASK) >> MSR_RI_LSB) -#define MSR_RI_SET(x) (((x) << MSR_RI_LSB) & MSR_RI_MASK) -#define MSR_DSR_MSB 5 -#define MSR_DSR_LSB 5 -#define MSR_DSR_MASK 0x00000020 -#define MSR_DSR_GET(x) (((x) & MSR_DSR_MASK) >> MSR_DSR_LSB) -#define MSR_DSR_SET(x) (((x) << MSR_DSR_LSB) & MSR_DSR_MASK) -#define MSR_CTS_MSB 4 -#define MSR_CTS_LSB 4 -#define MSR_CTS_MASK 0x00000010 -#define MSR_CTS_GET(x) (((x) & MSR_CTS_MASK) >> MSR_CTS_LSB) -#define MSR_CTS_SET(x) (((x) << MSR_CTS_LSB) & MSR_CTS_MASK) -#define MSR_DDCD_MSB 3 -#define MSR_DDCD_LSB 3 -#define MSR_DDCD_MASK 0x00000008 -#define MSR_DDCD_GET(x) (((x) & MSR_DDCD_MASK) >> MSR_DDCD_LSB) -#define MSR_DDCD_SET(x) (((x) << MSR_DDCD_LSB) & MSR_DDCD_MASK) -#define MSR_TERI_MSB 2 -#define MSR_TERI_LSB 2 -#define MSR_TERI_MASK 0x00000004 -#define MSR_TERI_GET(x) (((x) & MSR_TERI_MASK) >> MSR_TERI_LSB) -#define MSR_TERI_SET(x) (((x) << MSR_TERI_LSB) & MSR_TERI_MASK) -#define MSR_DDSR_MSB 1 -#define MSR_DDSR_LSB 1 -#define MSR_DDSR_MASK 0x00000002 -#define MSR_DDSR_GET(x) (((x) & MSR_DDSR_MASK) >> MSR_DDSR_LSB) -#define MSR_DDSR_SET(x) (((x) << MSR_DDSR_LSB) & MSR_DDSR_MASK) -#define MSR_DCTS_MSB 0 -#define MSR_DCTS_LSB 0 -#define MSR_DCTS_MASK 0x00000001 -#define MSR_DCTS_GET(x) (((x) & MSR_DCTS_MASK) >> MSR_DCTS_LSB) -#define MSR_DCTS_SET(x) (((x) << MSR_DCTS_LSB) & MSR_DCTS_MASK) - -#define SCR_ADDRESS 0x0000001c -#define SCR_OFFSET 0x0000001c -#define SCR_SCR_MSB 7 -#define SCR_SCR_LSB 0 -#define SCR_SCR_MASK 0x000000ff -#define SCR_SCR_GET(x) (((x) & SCR_SCR_MASK) >> SCR_SCR_LSB) -#define SCR_SCR_SET(x) (((x) << SCR_SCR_LSB) & SCR_SCR_MASK) - -#define SRBR_ADDRESS 0x00000020 -#define SRBR_OFFSET 0x00000020 -#define SRBR_SRBR_MSB 7 -#define SRBR_SRBR_LSB 0 -#define SRBR_SRBR_MASK 0x000000ff -#define SRBR_SRBR_GET(x) (((x) & SRBR_SRBR_MASK) >> SRBR_SRBR_LSB) -#define SRBR_SRBR_SET(x) (((x) << SRBR_SRBR_LSB) & SRBR_SRBR_MASK) - -#define SIIR_ADDRESS 0x00000028 -#define SIIR_OFFSET 0x00000028 -#define SIIR_SIIR_MSB 7 -#define SIIR_SIIR_LSB 0 -#define SIIR_SIIR_MASK 0x000000ff -#define SIIR_SIIR_GET(x) (((x) & SIIR_SIIR_MASK) >> SIIR_SIIR_LSB) -#define SIIR_SIIR_SET(x) (((x) << SIIR_SIIR_LSB) & SIIR_SIIR_MASK) - -#define MWR_ADDRESS 0x0000002c -#define MWR_OFFSET 0x0000002c -#define MWR_MWR_MSB 31 -#define MWR_MWR_LSB 0 -#define MWR_MWR_MASK 0xffffffff -#define MWR_MWR_GET(x) (((x) & MWR_MWR_MASK) >> MWR_MWR_LSB) -#define MWR_MWR_SET(x) (((x) << MWR_MWR_LSB) & MWR_MWR_MASK) - -#define SLSR_ADDRESS 0x00000034 -#define SLSR_OFFSET 0x00000034 -#define SLSR_SLSR_MSB 7 -#define SLSR_SLSR_LSB 0 -#define SLSR_SLSR_MASK 0x000000ff -#define SLSR_SLSR_GET(x) (((x) & SLSR_SLSR_MASK) >> SLSR_SLSR_LSB) -#define SLSR_SLSR_SET(x) (((x) << SLSR_SLSR_LSB) & SLSR_SLSR_MASK) - -#define SMSR_ADDRESS 0x00000038 -#define SMSR_OFFSET 0x00000038 -#define SMSR_SMSR_MSB 7 -#define SMSR_SMSR_LSB 0 -#define SMSR_SMSR_MASK 0x000000ff -#define SMSR_SMSR_GET(x) (((x) & SMSR_SMSR_MASK) >> SMSR_SMSR_LSB) -#define SMSR_SMSR_SET(x) (((x) << SMSR_SMSR_LSB) & SMSR_SMSR_MASK) - -#define MRR_ADDRESS 0x0000003c -#define MRR_OFFSET 0x0000003c -#define MRR_MRR_MSB 31 -#define MRR_MRR_LSB 0 -#define MRR_MRR_MASK 0xffffffff -#define MRR_MRR_GET(x) (((x) & MRR_MRR_MASK) >> MRR_MRR_LSB) -#define MRR_MRR_SET(x) (((x) << MRR_MRR_LSB) & MRR_MRR_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct uart_reg_reg_s { - volatile unsigned int rbr; - volatile unsigned int dlh; - volatile unsigned int iir; - volatile unsigned int lcr; - volatile unsigned int mcr; - volatile unsigned int lsr; - volatile unsigned int msr; - volatile unsigned int scr; - volatile unsigned int srbr; - unsigned char pad0[4]; /* pad to 0x28 */ - volatile unsigned int siir; - volatile unsigned int mwr; - unsigned char pad1[4]; /* pad to 0x34 */ - volatile unsigned int slsr; - volatile unsigned int smsr; - volatile unsigned int mrr; -} uart_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _UART_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/uart_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/uart_reg.vrh deleted file mode 100644 index fe59c18daa3f..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/uart_reg.vrh +++ /dev/null @@ -1,488 +0,0 @@ -#ifndef _UART_REG_VRH_ -#define _UART_REG_VRH_ - -#define RBR_ADDRESS 'h00000000 -#define RBR_RBR_MSB 7 -#define RBR_RBR_LSB 0 -#define RBR_RBR_MASK 'h000000ff -#define RBR_RBR_GET(x) (((x) & RBR_RBR_MASK) >> RBR_RBR_LSB) -#define RBR_RBR_SET(x) (((32'd0 | (x)) << RBR_RBR_LSB) & RBR_RBR_MASK) -#define RBR_RBR_RESET 8'h0 -#define RBR_RESET (32'h0 | \ - RBR_RBR_SET(RBR_RBR_RESET)) -#define RBR_HW_MASK (32'h0 | \ - RBR_RBR_MASK) -#define RBR_SW_MASK (32'h0) - -#define THR_ADDRESS 'h00000000 -#define THR_THR_MSB 7 -#define THR_THR_LSB 0 -#define THR_THR_MASK 'h000000ff -#define THR_THR_GET(x) (((x) & THR_THR_MASK) >> THR_THR_LSB) -#define THR_THR_SET(x) (((32'd0 | (x)) << THR_THR_LSB) & THR_THR_MASK) -#define THR_THR_RESET 8'h0 -#define THR_RESET (32'h0 | \ - THR_THR_SET(THR_THR_RESET)) -#define THR_HW_MASK (32'h0) -#define THR_SW_MASK (32'h0 | \ - THR_THR_MASK) - -#define DLL_ADDRESS 'h00000000 -#define DLL_DLL_MSB 7 -#define DLL_DLL_LSB 0 -#define DLL_DLL_MASK 'h000000ff -#define DLL_DLL_GET(x) (((x) & DLL_DLL_MASK) >> DLL_DLL_LSB) -#define DLL_DLL_SET(x) (((32'd0 | (x)) << DLL_DLL_LSB) & DLL_DLL_MASK) -#define DLL_DLL_RESET 8'h0 -#define DLL_RESET (32'h0 | \ - DLL_DLL_SET(DLL_DLL_RESET)) -#define DLL_HW_MASK (32'h0) -#define DLL_SW_MASK (32'h0 | \ - DLL_DLL_MASK) - -#define DLH_ADDRESS 'h00000004 -#define DLH_DLH_MSB 7 -#define DLH_DLH_LSB 0 -#define DLH_DLH_MASK 'h000000ff -#define DLH_DLH_GET(x) (((x) & DLH_DLH_MASK) >> DLH_DLH_LSB) -#define DLH_DLH_SET(x) (((32'd0 | (x)) << DLH_DLH_LSB) & DLH_DLH_MASK) -#define DLH_DLH_RESET 8'h0 -#define DLH_RESET (32'h0 | \ - DLH_DLH_SET(DLH_DLH_RESET)) -#define DLH_HW_MASK (32'h0) -#define DLH_SW_MASK (32'h0 | \ - DLH_DLH_MASK) - -#define IER_ADDRESS 'h00000004 -#define IER_EDDSI_MSB 3 -#define IER_EDDSI_LSB 3 -#define IER_EDDSI_MASK 'h00000008 -#define IER_EDDSI_GET(x) (((x) & IER_EDDSI_MASK) >> IER_EDDSI_LSB) -#define IER_EDDSI_SET(x) (((32'd0 | (x)) << IER_EDDSI_LSB) & IER_EDDSI_MASK) -#define IER_EDDSI_RESET 1'h0 -#define IER_ELSI_MSB 2 -#define IER_ELSI_LSB 2 -#define IER_ELSI_MASK 'h00000004 -#define IER_ELSI_GET(x) (((x) & IER_ELSI_MASK) >> IER_ELSI_LSB) -#define IER_ELSI_SET(x) (((32'd0 | (x)) << IER_ELSI_LSB) & IER_ELSI_MASK) -#define IER_ELSI_RESET 1'h0 -#define IER_ETBEI_MSB 1 -#define IER_ETBEI_LSB 1 -#define IER_ETBEI_MASK 'h00000002 -#define IER_ETBEI_GET(x) (((x) & IER_ETBEI_MASK) >> IER_ETBEI_LSB) -#define IER_ETBEI_SET(x) (((32'd0 | (x)) << IER_ETBEI_LSB) & IER_ETBEI_MASK) -#define IER_ETBEI_RESET 1'h0 -#define IER_ERBFI_MSB 0 -#define IER_ERBFI_LSB 0 -#define IER_ERBFI_MASK 'h00000001 -#define IER_ERBFI_GET(x) (((x) & IER_ERBFI_MASK) >> IER_ERBFI_LSB) -#define IER_ERBFI_SET(x) (((32'd0 | (x)) << IER_ERBFI_LSB) & IER_ERBFI_MASK) -#define IER_ERBFI_RESET 1'h0 -#define IER_RESET (32'h0 | \ - IER_EDDSI_SET(IER_EDDSI_RESET) | \ - IER_ELSI_SET(IER_ELSI_RESET) | \ - IER_ETBEI_SET(IER_ETBEI_RESET) | \ - IER_ERBFI_SET(IER_ERBFI_RESET)) -#define IER_HW_MASK (32'h0) -#define IER_SW_MASK (32'h0 | \ - IER_EDDSI_MASK | \ - IER_ELSI_MASK | \ - IER_ETBEI_MASK | \ - IER_ERBFI_MASK) - -#define IIR_ADDRESS 'h00000008 -#define IIR_FIFO_STATUS_MSB 7 -#define IIR_FIFO_STATUS_LSB 6 -#define IIR_FIFO_STATUS_MASK 'h000000c0 -#define IIR_FIFO_STATUS_GET(x) (((x) & IIR_FIFO_STATUS_MASK) >> IIR_FIFO_STATUS_LSB) -#define IIR_FIFO_STATUS_SET(x) (((32'd0 | (x)) << IIR_FIFO_STATUS_LSB) & IIR_FIFO_STATUS_MASK) -#define IIR_FIFO_STATUS_RESET 2'h0 -#define IIR_IID_MSB 3 -#define IIR_IID_LSB 0 -#define IIR_IID_MASK 'h0000000f -#define IIR_IID_GET(x) (((x) & IIR_IID_MASK) >> IIR_IID_LSB) -#define IIR_IID_SET(x) (((32'd0 | (x)) << IIR_IID_LSB) & IIR_IID_MASK) -#define IIR_IID_RESET 4'h0 -#define IIR_RESET (32'h0 | \ - IIR_FIFO_STATUS_SET(IIR_FIFO_STATUS_RESET) | \ - IIR_IID_SET(IIR_IID_RESET)) -#define IIR_HW_MASK (32'h0 | \ - IIR_FIFO_STATUS_MASK | \ - IIR_IID_MASK) -#define IIR_SW_MASK (32'h0) - -#define FCR_ADDRESS 'h00000008 -#define FCR_RCVR_TRIG_MSB 7 -#define FCR_RCVR_TRIG_LSB 6 -#define FCR_RCVR_TRIG_MASK 'h000000c0 -#define FCR_RCVR_TRIG_GET(x) (((x) & FCR_RCVR_TRIG_MASK) >> FCR_RCVR_TRIG_LSB) -#define FCR_RCVR_TRIG_SET(x) (((32'd0 | (x)) << FCR_RCVR_TRIG_LSB) & FCR_RCVR_TRIG_MASK) -#define FCR_RCVR_TRIG_RESET 2'h0 -#define FCR_DMA_MODE_MSB 3 -#define FCR_DMA_MODE_LSB 3 -#define FCR_DMA_MODE_MASK 'h00000008 -#define FCR_DMA_MODE_GET(x) (((x) & FCR_DMA_MODE_MASK) >> FCR_DMA_MODE_LSB) -#define FCR_DMA_MODE_SET(x) (((32'd0 | (x)) << FCR_DMA_MODE_LSB) & FCR_DMA_MODE_MASK) -#define FCR_DMA_MODE_RESET 1'h0 -#define FCR_XMIT_FIFO_RST_MSB 2 -#define FCR_XMIT_FIFO_RST_LSB 2 -#define FCR_XMIT_FIFO_RST_MASK 'h00000004 -#define FCR_XMIT_FIFO_RST_GET(x) (((x) & FCR_XMIT_FIFO_RST_MASK) >> FCR_XMIT_FIFO_RST_LSB) -#define FCR_XMIT_FIFO_RST_SET(x) (((32'd0 | (x)) << FCR_XMIT_FIFO_RST_LSB) & FCR_XMIT_FIFO_RST_MASK) -#define FCR_XMIT_FIFO_RST_RESET 1'h0 -#define FCR_RCVR_FIFO_RST_MSB 1 -#define FCR_RCVR_FIFO_RST_LSB 1 -#define FCR_RCVR_FIFO_RST_MASK 'h00000002 -#define FCR_RCVR_FIFO_RST_GET(x) (((x) & FCR_RCVR_FIFO_RST_MASK) >> FCR_RCVR_FIFO_RST_LSB) -#define FCR_RCVR_FIFO_RST_SET(x) (((32'd0 | (x)) << FCR_RCVR_FIFO_RST_LSB) & FCR_RCVR_FIFO_RST_MASK) -#define FCR_RCVR_FIFO_RST_RESET 1'h0 -#define FCR_FIFO_EN_MSB 0 -#define FCR_FIFO_EN_LSB 0 -#define FCR_FIFO_EN_MASK 'h00000001 -#define FCR_FIFO_EN_GET(x) (((x) & FCR_FIFO_EN_MASK) >> FCR_FIFO_EN_LSB) -#define FCR_FIFO_EN_SET(x) (((32'd0 | (x)) << FCR_FIFO_EN_LSB) & FCR_FIFO_EN_MASK) -#define FCR_FIFO_EN_RESET 1'h0 -#define FCR_RESET (32'h0 | \ - FCR_RCVR_TRIG_SET(FCR_RCVR_TRIG_RESET) | \ - FCR_DMA_MODE_SET(FCR_DMA_MODE_RESET) | \ - FCR_XMIT_FIFO_RST_SET(FCR_XMIT_FIFO_RST_RESET) | \ - FCR_RCVR_FIFO_RST_SET(FCR_RCVR_FIFO_RST_RESET) | \ - FCR_FIFO_EN_SET(FCR_FIFO_EN_RESET)) -#define FCR_HW_MASK (32'h0) -#define FCR_SW_MASK (32'h0 | \ - FCR_RCVR_TRIG_MASK | \ - FCR_DMA_MODE_MASK | \ - FCR_XMIT_FIFO_RST_MASK | \ - FCR_RCVR_FIFO_RST_MASK | \ - FCR_FIFO_EN_MASK) - -#define LCR_ADDRESS 'h0000000c -#define LCR_DLAB_MSB 7 -#define LCR_DLAB_LSB 7 -#define LCR_DLAB_MASK 'h00000080 -#define LCR_DLAB_GET(x) (((x) & LCR_DLAB_MASK) >> LCR_DLAB_LSB) -#define LCR_DLAB_SET(x) (((32'd0 | (x)) << LCR_DLAB_LSB) & LCR_DLAB_MASK) -#define LCR_DLAB_RESET 1'h0 -#define LCR_BREAK_MSB 6 -#define LCR_BREAK_LSB 6 -#define LCR_BREAK_MASK 'h00000040 -#define LCR_BREAK_GET(x) (((x) & LCR_BREAK_MASK) >> LCR_BREAK_LSB) -#define LCR_BREAK_SET(x) (((32'd0 | (x)) << LCR_BREAK_LSB) & LCR_BREAK_MASK) -#define LCR_BREAK_RESET 1'h0 -#define LCR_EPS_MSB 4 -#define LCR_EPS_LSB 4 -#define LCR_EPS_MASK 'h00000010 -#define LCR_EPS_GET(x) (((x) & LCR_EPS_MASK) >> LCR_EPS_LSB) -#define LCR_EPS_SET(x) (((32'd0 | (x)) << LCR_EPS_LSB) & LCR_EPS_MASK) -#define LCR_EPS_RESET 1'h0 -#define LCR_PEN_MSB 3 -#define LCR_PEN_LSB 3 -#define LCR_PEN_MASK 'h00000008 -#define LCR_PEN_GET(x) (((x) & LCR_PEN_MASK) >> LCR_PEN_LSB) -#define LCR_PEN_SET(x) (((32'd0 | (x)) << LCR_PEN_LSB) & LCR_PEN_MASK) -#define LCR_PEN_RESET 1'h0 -#define LCR_STOP_MSB 2 -#define LCR_STOP_LSB 2 -#define LCR_STOP_MASK 'h00000004 -#define LCR_STOP_GET(x) (((x) & LCR_STOP_MASK) >> LCR_STOP_LSB) -#define LCR_STOP_SET(x) (((32'd0 | (x)) << LCR_STOP_LSB) & LCR_STOP_MASK) -#define LCR_STOP_RESET 1'h0 -#define LCR_CLS_MSB 1 -#define LCR_CLS_LSB 0 -#define LCR_CLS_MASK 'h00000003 -#define LCR_CLS_GET(x) (((x) & LCR_CLS_MASK) >> LCR_CLS_LSB) -#define LCR_CLS_SET(x) (((32'd0 | (x)) << LCR_CLS_LSB) & LCR_CLS_MASK) -#define LCR_CLS_RESET 2'h0 -#define LCR_RESET (32'h0 | \ - LCR_DLAB_SET(LCR_DLAB_RESET) | \ - LCR_BREAK_SET(LCR_BREAK_RESET) | \ - LCR_EPS_SET(LCR_EPS_RESET) | \ - LCR_PEN_SET(LCR_PEN_RESET) | \ - LCR_STOP_SET(LCR_STOP_RESET) | \ - LCR_CLS_SET(LCR_CLS_RESET)) -#define LCR_HW_MASK (32'h0) -#define LCR_SW_MASK (32'h0 | \ - LCR_DLAB_MASK | \ - LCR_BREAK_MASK | \ - LCR_EPS_MASK | \ - LCR_PEN_MASK | \ - LCR_STOP_MASK | \ - LCR_CLS_MASK) - -#define MCR_ADDRESS 'h00000010 -#define MCR_LOOPBACK_MSB 5 -#define MCR_LOOPBACK_LSB 5 -#define MCR_LOOPBACK_MASK 'h00000020 -#define MCR_LOOPBACK_GET(x) (((x) & MCR_LOOPBACK_MASK) >> MCR_LOOPBACK_LSB) -#define MCR_LOOPBACK_SET(x) (((32'd0 | (x)) << MCR_LOOPBACK_LSB) & MCR_LOOPBACK_MASK) -#define MCR_LOOPBACK_RESET 1'h1 -#define MCR_OUT2_MSB 3 -#define MCR_OUT2_LSB 3 -#define MCR_OUT2_MASK 'h00000008 -#define MCR_OUT2_GET(x) (((x) & MCR_OUT2_MASK) >> MCR_OUT2_LSB) -#define MCR_OUT2_SET(x) (((32'd0 | (x)) << MCR_OUT2_LSB) & MCR_OUT2_MASK) -#define MCR_OUT2_RESET 1'h1 -#define MCR_OUT1_MSB 2 -#define MCR_OUT1_LSB 2 -#define MCR_OUT1_MASK 'h00000004 -#define MCR_OUT1_GET(x) (((x) & MCR_OUT1_MASK) >> MCR_OUT1_LSB) -#define MCR_OUT1_SET(x) (((32'd0 | (x)) << MCR_OUT1_LSB) & MCR_OUT1_MASK) -#define MCR_OUT1_RESET 1'h1 -#define MCR_RTS_MSB 1 -#define MCR_RTS_LSB 1 -#define MCR_RTS_MASK 'h00000002 -#define MCR_RTS_GET(x) (((x) & MCR_RTS_MASK) >> MCR_RTS_LSB) -#define MCR_RTS_SET(x) (((32'd0 | (x)) << MCR_RTS_LSB) & MCR_RTS_MASK) -#define MCR_RTS_RESET 1'h1 -#define MCR_DTR_MSB 0 -#define MCR_DTR_LSB 0 -#define MCR_DTR_MASK 'h00000001 -#define MCR_DTR_GET(x) (((x) & MCR_DTR_MASK) >> MCR_DTR_LSB) -#define MCR_DTR_SET(x) (((32'd0 | (x)) << MCR_DTR_LSB) & MCR_DTR_MASK) -#define MCR_DTR_RESET 1'h1 -#define MCR_RESET (32'h0 | \ - MCR_LOOPBACK_SET(MCR_LOOPBACK_RESET) | \ - MCR_OUT2_SET(MCR_OUT2_RESET) | \ - MCR_OUT1_SET(MCR_OUT1_RESET) | \ - MCR_RTS_SET(MCR_RTS_RESET) | \ - MCR_DTR_SET(MCR_DTR_RESET)) -#define MCR_HW_MASK (32'h0) -#define MCR_SW_MASK (32'h0 | \ - MCR_LOOPBACK_MASK | \ - MCR_OUT2_MASK | \ - MCR_OUT1_MASK | \ - MCR_RTS_MASK | \ - MCR_DTR_MASK) - -#define LSR_ADDRESS 'h00000014 -#define LSR_FERR_MSB 7 -#define LSR_FERR_LSB 7 -#define LSR_FERR_MASK 'h00000080 -#define LSR_FERR_GET(x) (((x) & LSR_FERR_MASK) >> LSR_FERR_LSB) -#define LSR_FERR_SET(x) (((32'd0 | (x)) << LSR_FERR_LSB) & LSR_FERR_MASK) -#define LSR_FERR_RESET 1'h0 -#define LSR_TEMT_MSB 6 -#define LSR_TEMT_LSB 6 -#define LSR_TEMT_MASK 'h00000040 -#define LSR_TEMT_GET(x) (((x) & LSR_TEMT_MASK) >> LSR_TEMT_LSB) -#define LSR_TEMT_SET(x) (((32'd0 | (x)) << LSR_TEMT_LSB) & LSR_TEMT_MASK) -#define LSR_TEMT_RESET 1'h0 -#define LSR_THRE_MSB 5 -#define LSR_THRE_LSB 5 -#define LSR_THRE_MASK 'h00000020 -#define LSR_THRE_GET(x) (((x) & LSR_THRE_MASK) >> LSR_THRE_LSB) -#define LSR_THRE_SET(x) (((32'd0 | (x)) << LSR_THRE_LSB) & LSR_THRE_MASK) -#define LSR_THRE_RESET 1'h0 -#define LSR_BI_MSB 4 -#define LSR_BI_LSB 4 -#define LSR_BI_MASK 'h00000010 -#define LSR_BI_GET(x) (((x) & LSR_BI_MASK) >> LSR_BI_LSB) -#define LSR_BI_SET(x) (((32'd0 | (x)) << LSR_BI_LSB) & LSR_BI_MASK) -#define LSR_BI_RESET 1'h0 -#define LSR_FE_MSB 3 -#define LSR_FE_LSB 3 -#define LSR_FE_MASK 'h00000008 -#define LSR_FE_GET(x) (((x) & LSR_FE_MASK) >> LSR_FE_LSB) -#define LSR_FE_SET(x) (((32'd0 | (x)) << LSR_FE_LSB) & LSR_FE_MASK) -#define LSR_FE_RESET 1'h0 -#define LSR_PE_MSB 2 -#define LSR_PE_LSB 2 -#define LSR_PE_MASK 'h00000004 -#define LSR_PE_GET(x) (((x) & LSR_PE_MASK) >> LSR_PE_LSB) -#define LSR_PE_SET(x) (((32'd0 | (x)) << LSR_PE_LSB) & LSR_PE_MASK) -#define LSR_PE_RESET 1'h0 -#define LSR_OE_MSB 1 -#define LSR_OE_LSB 1 -#define LSR_OE_MASK 'h00000002 -#define LSR_OE_GET(x) (((x) & LSR_OE_MASK) >> LSR_OE_LSB) -#define LSR_OE_SET(x) (((32'd0 | (x)) << LSR_OE_LSB) & LSR_OE_MASK) -#define LSR_OE_RESET 1'h0 -#define LSR_DR_MSB 0 -#define LSR_DR_LSB 0 -#define LSR_DR_MASK 'h00000001 -#define LSR_DR_GET(x) (((x) & LSR_DR_MASK) >> LSR_DR_LSB) -#define LSR_DR_SET(x) (((32'd0 | (x)) << LSR_DR_LSB) & LSR_DR_MASK) -#define LSR_DR_RESET 1'h0 -#define LSR_RESET (32'h0 | \ - LSR_FERR_SET(LSR_FERR_RESET) | \ - LSR_TEMT_SET(LSR_TEMT_RESET) | \ - LSR_THRE_SET(LSR_THRE_RESET) | \ - LSR_BI_SET(LSR_BI_RESET) | \ - LSR_FE_SET(LSR_FE_RESET) | \ - LSR_PE_SET(LSR_PE_RESET) | \ - LSR_OE_SET(LSR_OE_RESET) | \ - LSR_DR_SET(LSR_DR_RESET)) -#define LSR_HW_MASK (32'h0) -#define LSR_SW_MASK (32'h0 | \ - LSR_FERR_MASK | \ - LSR_TEMT_MASK | \ - LSR_THRE_MASK | \ - LSR_BI_MASK | \ - LSR_FE_MASK | \ - LSR_PE_MASK | \ - LSR_OE_MASK | \ - LSR_DR_MASK) - -#define MSR_ADDRESS 'h00000018 -#define MSR_DCD_MSB 7 -#define MSR_DCD_LSB 7 -#define MSR_DCD_MASK 'h00000080 -#define MSR_DCD_GET(x) (((x) & MSR_DCD_MASK) >> MSR_DCD_LSB) -#define MSR_DCD_SET(x) (((32'd0 | (x)) << MSR_DCD_LSB) & MSR_DCD_MASK) -#define MSR_DCD_RESET 1'h0 -#define MSR_RI_MSB 6 -#define MSR_RI_LSB 6 -#define MSR_RI_MASK 'h00000040 -#define MSR_RI_GET(x) (((x) & MSR_RI_MASK) >> MSR_RI_LSB) -#define MSR_RI_SET(x) (((32'd0 | (x)) << MSR_RI_LSB) & MSR_RI_MASK) -#define MSR_RI_RESET 1'h0 -#define MSR_DSR_MSB 5 -#define MSR_DSR_LSB 5 -#define MSR_DSR_MASK 'h00000020 -#define MSR_DSR_GET(x) (((x) & MSR_DSR_MASK) >> MSR_DSR_LSB) -#define MSR_DSR_SET(x) (((32'd0 | (x)) << MSR_DSR_LSB) & MSR_DSR_MASK) -#define MSR_DSR_RESET 1'h0 -#define MSR_CTS_MSB 4 -#define MSR_CTS_LSB 4 -#define MSR_CTS_MASK 'h00000010 -#define MSR_CTS_GET(x) (((x) & MSR_CTS_MASK) >> MSR_CTS_LSB) -#define MSR_CTS_SET(x) (((32'd0 | (x)) << MSR_CTS_LSB) & MSR_CTS_MASK) -#define MSR_CTS_RESET 1'h0 -#define MSR_DDCD_MSB 3 -#define MSR_DDCD_LSB 3 -#define MSR_DDCD_MASK 'h00000008 -#define MSR_DDCD_GET(x) (((x) & MSR_DDCD_MASK) >> MSR_DDCD_LSB) -#define MSR_DDCD_SET(x) (((32'd0 | (x)) << MSR_DDCD_LSB) & MSR_DDCD_MASK) -#define MSR_DDCD_RESET 1'h0 -#define MSR_TERI_MSB 2 -#define MSR_TERI_LSB 2 -#define MSR_TERI_MASK 'h00000004 -#define MSR_TERI_GET(x) (((x) & MSR_TERI_MASK) >> MSR_TERI_LSB) -#define MSR_TERI_SET(x) (((32'd0 | (x)) << MSR_TERI_LSB) & MSR_TERI_MASK) -#define MSR_TERI_RESET 1'h0 -#define MSR_DDSR_MSB 1 -#define MSR_DDSR_LSB 1 -#define MSR_DDSR_MASK 'h00000002 -#define MSR_DDSR_GET(x) (((x) & MSR_DDSR_MASK) >> MSR_DDSR_LSB) -#define MSR_DDSR_SET(x) (((32'd0 | (x)) << MSR_DDSR_LSB) & MSR_DDSR_MASK) -#define MSR_DDSR_RESET 1'h0 -#define MSR_DCTS_MSB 0 -#define MSR_DCTS_LSB 0 -#define MSR_DCTS_MASK 'h00000001 -#define MSR_DCTS_GET(x) (((x) & MSR_DCTS_MASK) >> MSR_DCTS_LSB) -#define MSR_DCTS_SET(x) (((32'd0 | (x)) << MSR_DCTS_LSB) & MSR_DCTS_MASK) -#define MSR_DCTS_RESET 1'h0 -#define MSR_RESET (32'h0 | \ - MSR_DCD_SET(MSR_DCD_RESET) | \ - MSR_RI_SET(MSR_RI_RESET) | \ - MSR_DSR_SET(MSR_DSR_RESET) | \ - MSR_CTS_SET(MSR_CTS_RESET) | \ - MSR_DDCD_SET(MSR_DDCD_RESET) | \ - MSR_TERI_SET(MSR_TERI_RESET) | \ - MSR_DDSR_SET(MSR_DDSR_RESET) | \ - MSR_DCTS_SET(MSR_DCTS_RESET)) -#define MSR_HW_MASK (32'h0) -#define MSR_SW_MASK (32'h0 | \ - MSR_DCD_MASK | \ - MSR_RI_MASK | \ - MSR_DSR_MASK | \ - MSR_CTS_MASK | \ - MSR_DDCD_MASK | \ - MSR_TERI_MASK | \ - MSR_DDSR_MASK | \ - MSR_DCTS_MASK) - -#define SCR_ADDRESS 'h0000001c -#define SCR_SCR_MSB 7 -#define SCR_SCR_LSB 0 -#define SCR_SCR_MASK 'h000000ff -#define SCR_SCR_GET(x) (((x) & SCR_SCR_MASK) >> SCR_SCR_LSB) -#define SCR_SCR_SET(x) (((32'd0 | (x)) << SCR_SCR_LSB) & SCR_SCR_MASK) -#define SCR_SCR_RESET 8'h0 -#define SCR_RESET (32'h0 | \ - SCR_SCR_SET(SCR_SCR_RESET)) -#define SCR_HW_MASK (32'h0) -#define SCR_SW_MASK (32'h0 | \ - SCR_SCR_MASK) - -#define SRBR_ADDRESS 'h00000020 -#define SRBR_SRBR_MSB 7 -#define SRBR_SRBR_LSB 0 -#define SRBR_SRBR_MASK 'h000000ff -#define SRBR_SRBR_GET(x) (((x) & SRBR_SRBR_MASK) >> SRBR_SRBR_LSB) -#define SRBR_SRBR_SET(x) (((32'd0 | (x)) << SRBR_SRBR_LSB) & SRBR_SRBR_MASK) -#define SRBR_SRBR_RESET 8'h0 -#define SRBR_RESET (32'h0 | \ - SRBR_SRBR_SET(SRBR_SRBR_RESET)) -#define SRBR_HW_MASK (32'h0) -#define SRBR_SW_MASK (32'h0 | \ - SRBR_SRBR_MASK) - -#define SIIR_ADDRESS 'h00000028 -#define SIIR_SIIR_MSB 7 -#define SIIR_SIIR_LSB 0 -#define SIIR_SIIR_MASK 'h000000ff -#define SIIR_SIIR_GET(x) (((x) & SIIR_SIIR_MASK) >> SIIR_SIIR_LSB) -#define SIIR_SIIR_SET(x) (((32'd0 | (x)) << SIIR_SIIR_LSB) & SIIR_SIIR_MASK) -#define SIIR_SIIR_RESET 8'h0 -#define SIIR_RESET (32'h0 | \ - SIIR_SIIR_SET(SIIR_SIIR_RESET)) -#define SIIR_HW_MASK (32'h0) -#define SIIR_SW_MASK (32'h0 | \ - SIIR_SIIR_MASK) - -#define MWR_ADDRESS 'h0000002c -#define MWR_MWR_MSB 31 -#define MWR_MWR_LSB 0 -#define MWR_MWR_MASK 'hffffffff -#define MWR_MWR_GET(x) (((x) & MWR_MWR_MASK) >> MWR_MWR_LSB) -#define MWR_MWR_SET(x) (((32'd0 | (x)) << MWR_MWR_LSB) & MWR_MWR_MASK) -#define MWR_MWR_RESET 32'h0 -#define MWR_RESET (32'h0 | \ - MWR_MWR_SET(MWR_MWR_RESET)) -#define MWR_HW_MASK (32'h0) -#define MWR_SW_MASK (32'h0 | \ - MWR_MWR_MASK) - -#define SLSR_ADDRESS 'h00000034 -#define SLSR_SLSR_MSB 7 -#define SLSR_SLSR_LSB 0 -#define SLSR_SLSR_MASK 'h000000ff -#define SLSR_SLSR_GET(x) (((x) & SLSR_SLSR_MASK) >> SLSR_SLSR_LSB) -#define SLSR_SLSR_SET(x) (((32'd0 | (x)) << SLSR_SLSR_LSB) & SLSR_SLSR_MASK) -#define SLSR_SLSR_RESET 8'h0 -#define SLSR_RESET (32'h0 | \ - SLSR_SLSR_SET(SLSR_SLSR_RESET)) -#define SLSR_HW_MASK (32'h0) -#define SLSR_SW_MASK (32'h0 | \ - SLSR_SLSR_MASK) - -#define SMSR_ADDRESS 'h00000038 -#define SMSR_SMSR_MSB 7 -#define SMSR_SMSR_LSB 0 -#define SMSR_SMSR_MASK 'h000000ff -#define SMSR_SMSR_GET(x) (((x) & SMSR_SMSR_MASK) >> SMSR_SMSR_LSB) -#define SMSR_SMSR_SET(x) (((32'd0 | (x)) << SMSR_SMSR_LSB) & SMSR_SMSR_MASK) -#define SMSR_SMSR_RESET 8'h0 -#define SMSR_RESET (32'h0 | \ - SMSR_SMSR_SET(SMSR_SMSR_RESET)) -#define SMSR_HW_MASK (32'h0) -#define SMSR_SW_MASK (32'h0 | \ - SMSR_SMSR_MASK) - -#define MRR_ADDRESS 'h0000003c -#define MRR_MRR_MSB 31 -#define MRR_MRR_LSB 0 -#define MRR_MRR_MASK 'hffffffff -#define MRR_MRR_GET(x) (((x) & MRR_MRR_MASK) >> MRR_MRR_LSB) -#define MRR_MRR_SET(x) (((32'd0 | (x)) << MRR_MRR_LSB) & MRR_MRR_MASK) -#define MRR_MRR_RESET 32'h0 -#define MRR_RESET (32'h0 | \ - MRR_MRR_SET(MRR_MRR_RESET)) -#define MRR_HW_MASK (32'h0) -#define MRR_SW_MASK (32'h0 | \ - MRR_MRR_MASK) - -#define UART_REG_ADDRESS_MSB 5 - -#endif /* _UART_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/vmc_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw/vmc_reg.h deleted file mode 100644 index 932ec510d26b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/vmc_reg.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef _VMC_REG_REG_H_ -#define _VMC_REG_REG_H_ - -#define MC_TCAM_VALID_ADDRESS 0x00000000 -#define MC_TCAM_VALID_OFFSET 0x00000000 -#define MC_TCAM_VALID_BIT_MSB 0 -#define MC_TCAM_VALID_BIT_LSB 0 -#define MC_TCAM_VALID_BIT_MASK 0x00000001 -#define MC_TCAM_VALID_BIT_GET(x) (((x) & MC_TCAM_VALID_BIT_MASK) >> MC_TCAM_VALID_BIT_LSB) -#define MC_TCAM_VALID_BIT_SET(x) (((x) << MC_TCAM_VALID_BIT_LSB) & MC_TCAM_VALID_BIT_MASK) - -#define MC_TCAM_MASK_ADDRESS 0x00000080 -#define MC_TCAM_MASK_OFFSET 0x00000080 -#define MC_TCAM_MASK_SIZE_MSB 2 -#define MC_TCAM_MASK_SIZE_LSB 0 -#define MC_TCAM_MASK_SIZE_MASK 0x00000007 -#define MC_TCAM_MASK_SIZE_GET(x) (((x) & MC_TCAM_MASK_SIZE_MASK) >> MC_TCAM_MASK_SIZE_LSB) -#define MC_TCAM_MASK_SIZE_SET(x) (((x) << MC_TCAM_MASK_SIZE_LSB) & MC_TCAM_MASK_SIZE_MASK) - -#define MC_TCAM_COMPARE_ADDRESS 0x00000100 -#define MC_TCAM_COMPARE_OFFSET 0x00000100 -#define MC_TCAM_COMPARE_KEY_MSB 21 -#define MC_TCAM_COMPARE_KEY_LSB 5 -#define MC_TCAM_COMPARE_KEY_MASK 0x003fffe0 -#define MC_TCAM_COMPARE_KEY_GET(x) (((x) & MC_TCAM_COMPARE_KEY_MASK) >> MC_TCAM_COMPARE_KEY_LSB) -#define MC_TCAM_COMPARE_KEY_SET(x) (((x) << MC_TCAM_COMPARE_KEY_LSB) & MC_TCAM_COMPARE_KEY_MASK) - -#define MC_TCAM_TARGET_ADDRESS 0x00000180 -#define MC_TCAM_TARGET_OFFSET 0x00000180 -#define MC_TCAM_TARGET_ADDR_MSB 21 -#define MC_TCAM_TARGET_ADDR_LSB 5 -#define MC_TCAM_TARGET_ADDR_MASK 0x003fffe0 -#define MC_TCAM_TARGET_ADDR_GET(x) (((x) & MC_TCAM_TARGET_ADDR_MASK) >> MC_TCAM_TARGET_ADDR_LSB) -#define MC_TCAM_TARGET_ADDR_SET(x) (((x) << MC_TCAM_TARGET_ADDR_LSB) & MC_TCAM_TARGET_ADDR_MASK) - -#define ADDR_ERROR_CONTROL_ADDRESS 0x00000200 -#define ADDR_ERROR_CONTROL_OFFSET 0x00000200 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_MSB 1 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB 1 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK 0x00000002 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_GET(x) (((x) & ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK) >> ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB) -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_SET(x) (((x) << ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB) & ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK) -#define ADDR_ERROR_CONTROL_ENABLE_MSB 0 -#define ADDR_ERROR_CONTROL_ENABLE_LSB 0 -#define ADDR_ERROR_CONTROL_ENABLE_MASK 0x00000001 -#define ADDR_ERROR_CONTROL_ENABLE_GET(x) (((x) & ADDR_ERROR_CONTROL_ENABLE_MASK) >> ADDR_ERROR_CONTROL_ENABLE_LSB) -#define ADDR_ERROR_CONTROL_ENABLE_SET(x) (((x) << ADDR_ERROR_CONTROL_ENABLE_LSB) & ADDR_ERROR_CONTROL_ENABLE_MASK) - -#define ADDR_ERROR_STATUS_ADDRESS 0x00000204 -#define ADDR_ERROR_STATUS_OFFSET 0x00000204 -#define ADDR_ERROR_STATUS_WRITE_MSB 25 -#define ADDR_ERROR_STATUS_WRITE_LSB 25 -#define ADDR_ERROR_STATUS_WRITE_MASK 0x02000000 -#define ADDR_ERROR_STATUS_WRITE_GET(x) (((x) & ADDR_ERROR_STATUS_WRITE_MASK) >> ADDR_ERROR_STATUS_WRITE_LSB) -#define ADDR_ERROR_STATUS_WRITE_SET(x) (((x) << ADDR_ERROR_STATUS_WRITE_LSB) & ADDR_ERROR_STATUS_WRITE_MASK) -#define ADDR_ERROR_STATUS_ADDRESS_MSB 24 -#define ADDR_ERROR_STATUS_ADDRESS_LSB 0 -#define ADDR_ERROR_STATUS_ADDRESS_MASK 0x01ffffff -#define ADDR_ERROR_STATUS_ADDRESS_GET(x) (((x) & ADDR_ERROR_STATUS_ADDRESS_MASK) >> ADDR_ERROR_STATUS_ADDRESS_LSB) -#define ADDR_ERROR_STATUS_ADDRESS_SET(x) (((x) << ADDR_ERROR_STATUS_ADDRESS_LSB) & ADDR_ERROR_STATUS_ADDRESS_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct vmc_reg_reg_s { - volatile unsigned int mc_tcam_valid[32]; - volatile unsigned int mc_tcam_mask[32]; - volatile unsigned int mc_tcam_compare[32]; - volatile unsigned int mc_tcam_target[32]; - volatile unsigned int addr_error_control; - volatile unsigned int addr_error_status; -} vmc_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _VMC_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw/vmc_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw/vmc_reg.vrh deleted file mode 100644 index cd9b7e599390..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw/vmc_reg.vrh +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef _VMC_REG_VRH_ -#define _VMC_REG_VRH_ - -#define MC_TCAM_VALID_ADDRESS 'h00000000 -#define MC_TCAM_VALID_BIT_MSB 0 -#define MC_TCAM_VALID_BIT_LSB 0 -#define MC_TCAM_VALID_BIT_MASK 'h00000001 -#define MC_TCAM_VALID_BIT_GET(x) (((x) & MC_TCAM_VALID_BIT_MASK) >> MC_TCAM_VALID_BIT_LSB) -#define MC_TCAM_VALID_BIT_SET(x) (((32'd0 | (x)) << MC_TCAM_VALID_BIT_LSB) & MC_TCAM_VALID_BIT_MASK) -#define MC_TCAM_VALID_BIT_RESET 1'h0 -#define MC_TCAM_VALID_RESET (32'h0 | \ - MC_TCAM_VALID_BIT_SET(MC_TCAM_VALID_BIT_RESET)) -#define MC_TCAM_VALID_HW_MASK (32'h0) -#define MC_TCAM_VALID_SW_MASK (32'h0 | \ - MC_TCAM_VALID_BIT_MASK) - -#define MC_TCAM_MASK_ADDRESS 'h00000080 -#define MC_TCAM_MASK_SIZE_MSB 2 -#define MC_TCAM_MASK_SIZE_LSB 0 -#define MC_TCAM_MASK_SIZE_MASK 'h00000007 -#define MC_TCAM_MASK_SIZE_GET(x) (((x) & MC_TCAM_MASK_SIZE_MASK) >> MC_TCAM_MASK_SIZE_LSB) -#define MC_TCAM_MASK_SIZE_SET(x) (((32'd0 | (x)) << MC_TCAM_MASK_SIZE_LSB) & MC_TCAM_MASK_SIZE_MASK) -#define MC_TCAM_MASK_SIZE_RESET 3'h0 -#define MC_TCAM_MASK_RESET (32'h0 | \ - MC_TCAM_MASK_SIZE_SET(MC_TCAM_MASK_SIZE_RESET)) -#define MC_TCAM_MASK_HW_MASK (32'h0) -#define MC_TCAM_MASK_SW_MASK (32'h0 | \ - MC_TCAM_MASK_SIZE_MASK) - -#define MC_TCAM_COMPARE_ADDRESS 'h00000100 -#define MC_TCAM_COMPARE_KEY_MSB 21 -#define MC_TCAM_COMPARE_KEY_LSB 5 -#define MC_TCAM_COMPARE_KEY_MASK 'h003fffe0 -#define MC_TCAM_COMPARE_KEY_GET(x) (((x) & MC_TCAM_COMPARE_KEY_MASK) >> MC_TCAM_COMPARE_KEY_LSB) -#define MC_TCAM_COMPARE_KEY_SET(x) (((32'd0 | (x)) << MC_TCAM_COMPARE_KEY_LSB) & MC_TCAM_COMPARE_KEY_MASK) -#define MC_TCAM_COMPARE_KEY_RESET 17'h0 -#define MC_TCAM_COMPARE_RESET (32'h0 | \ - MC_TCAM_COMPARE_KEY_SET(MC_TCAM_COMPARE_KEY_RESET)) -#define MC_TCAM_COMPARE_HW_MASK (32'h0) -#define MC_TCAM_COMPARE_SW_MASK (32'h0 | \ - MC_TCAM_COMPARE_KEY_MASK) - -#define MC_TCAM_TARGET_ADDRESS 'h00000180 -#define MC_TCAM_TARGET_ADDR_MSB 21 -#define MC_TCAM_TARGET_ADDR_LSB 5 -#define MC_TCAM_TARGET_ADDR_MASK 'h003fffe0 -#define MC_TCAM_TARGET_ADDR_GET(x) (((x) & MC_TCAM_TARGET_ADDR_MASK) >> MC_TCAM_TARGET_ADDR_LSB) -#define MC_TCAM_TARGET_ADDR_SET(x) (((32'd0 | (x)) << MC_TCAM_TARGET_ADDR_LSB) & MC_TCAM_TARGET_ADDR_MASK) -#define MC_TCAM_TARGET_ADDR_RESET 17'h0 -#define MC_TCAM_TARGET_RESET (32'h0 | \ - MC_TCAM_TARGET_ADDR_SET(MC_TCAM_TARGET_ADDR_RESET)) -#define MC_TCAM_TARGET_HW_MASK (32'h0) -#define MC_TCAM_TARGET_SW_MASK (32'h0 | \ - MC_TCAM_TARGET_ADDR_MASK) - -#define ADDR_ERROR_CONTROL_ADDRESS 'h00000200 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_MSB 1 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB 1 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK 'h00000002 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_GET(x) (((x) & ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK) >> ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB) -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_SET(x) (((32'd0 | (x)) << ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB) & ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK) -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_RESET 1'h0 -#define ADDR_ERROR_CONTROL_ENABLE_MSB 0 -#define ADDR_ERROR_CONTROL_ENABLE_LSB 0 -#define ADDR_ERROR_CONTROL_ENABLE_MASK 'h00000001 -#define ADDR_ERROR_CONTROL_ENABLE_GET(x) (((x) & ADDR_ERROR_CONTROL_ENABLE_MASK) >> ADDR_ERROR_CONTROL_ENABLE_LSB) -#define ADDR_ERROR_CONTROL_ENABLE_SET(x) (((32'd0 | (x)) << ADDR_ERROR_CONTROL_ENABLE_LSB) & ADDR_ERROR_CONTROL_ENABLE_MASK) -#define ADDR_ERROR_CONTROL_ENABLE_RESET 1'h0 -#define ADDR_ERROR_CONTROL_RESET (32'h0 | \ - ADDR_ERROR_CONTROL_QUAL_ENABLE_SET(ADDR_ERROR_CONTROL_QUAL_ENABLE_RESET) | \ - ADDR_ERROR_CONTROL_ENABLE_SET(ADDR_ERROR_CONTROL_ENABLE_RESET)) -#define ADDR_ERROR_CONTROL_HW_MASK (32'h0) -#define ADDR_ERROR_CONTROL_SW_MASK (32'h0 | \ - ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK | \ - ADDR_ERROR_CONTROL_ENABLE_MASK) - -#define ADDR_ERROR_STATUS_ADDRESS 'h00000204 -#define ADDR_ERROR_STATUS_WRITE_MSB 25 -#define ADDR_ERROR_STATUS_WRITE_LSB 25 -#define ADDR_ERROR_STATUS_WRITE_MASK 'h02000000 -#define ADDR_ERROR_STATUS_WRITE_GET(x) (((x) & ADDR_ERROR_STATUS_WRITE_MASK) >> ADDR_ERROR_STATUS_WRITE_LSB) -#define ADDR_ERROR_STATUS_WRITE_SET(x) (((32'd0 | (x)) << ADDR_ERROR_STATUS_WRITE_LSB) & ADDR_ERROR_STATUS_WRITE_MASK) -#define ADDR_ERROR_STATUS_WRITE_RESET 1'h0 -#define ADDR_ERROR_STATUS_ADDRESS_MSB 24 -#define ADDR_ERROR_STATUS_ADDRESS_LSB 0 -#define ADDR_ERROR_STATUS_ADDRESS_MASK 'h01ffffff -#define ADDR_ERROR_STATUS_ADDRESS_GET(x) (((x) & ADDR_ERROR_STATUS_ADDRESS_MASK) >> ADDR_ERROR_STATUS_ADDRESS_LSB) -#define ADDR_ERROR_STATUS_ADDRESS_SET(x) (((32'd0 | (x)) << ADDR_ERROR_STATUS_ADDRESS_LSB) & ADDR_ERROR_STATUS_ADDRESS_MASK) -#define ADDR_ERROR_STATUS_ADDRESS_RESET 25'h0 -#define ADDR_ERROR_STATUS_RESET (32'h0 | \ - ADDR_ERROR_STATUS_WRITE_SET(ADDR_ERROR_STATUS_WRITE_RESET) | \ - ADDR_ERROR_STATUS_ADDRESS_SET(ADDR_ERROR_STATUS_ADDRESS_RESET)) -#define ADDR_ERROR_STATUS_HW_MASK (32'h0 | \ - ADDR_ERROR_STATUS_WRITE_MASK | \ - ADDR_ERROR_STATUS_ADDRESS_MASK) -#define ADDR_ERROR_STATUS_SW_MASK (32'h0) - -#define VMC_REG_ADDRESS_MSB 9 - -#endif /* _VMC_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsEnv.vr b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsEnv.vr deleted file mode 100644 index aa95b3672da0..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsEnv.vr +++ /dev/null @@ -1,58 +0,0 @@ -#include -#include -#include "AveStdLib.vri" - -#ifndef SYNOPSYS_NTB - #include "MercuryEnv.vrh" - #include "LegacyRegsEnvConfig.vrh" - #include "LegacyRegsTop.vrh" -#endif - -class LegacyRegsEnv extends MercuryEnv { - LegacyRegsEnvConfig envConfig; - LegacyRegsTop regsTop; - - task new(string name = "LegacyRegsEnv", LegacyRegsEnvConfig envConfig = null); - virtual function AveEnvConfig GetEnvConfig(); - virtual task build(); - virtual task directed_test_t(); -} - - -task LegacyRegsEnv::new(string name = "LegacyRegsEnv", LegacyRegsEnvConfig envConfig = null) { - MercuryTopConfig mercuryTopConfig; - LegacyRegsTopConfig legacyRegsTopConfig; - - super.new(); - this.envConfig = envConfig; - if (this.envConfig == null) this.envConfig = new(); - cast_assign(mercuryTopConfig, this.envConfig.GetTopConfig()); - - // build and register LegacyRegsTopConfig - legacyRegsTopConfig = new(*, *, "legacyRegsTopConfig"); - mercuryTopConfig.RegisterConfig(legacyRegsTopConfig); -} - -function AveEnvConfig LegacyRegsEnv::GetEnvConfig() { - GetEnvConfig = this.envConfig; -} - -task LegacyRegsEnv::build() { - MercuryTopConfig mercuryTopConfig; - LegacyRegsTopConfig legacyRegsTopConfig; - super.build(); - - // build and register MercuryTop - cast_assign(mercuryTopConfig, this.envConfig.GetTopConfig()); - this.mercuryTop = new(mercuryTopConfig); - this.RegisterTop(this.mercuryTop); - - // build and register LegacyRegsTop. - cast_assign(legacyRegsTopConfig, mercuryTopConfig.GetConfigInstanceByName("legacyRegsTopConfig")); - this.regsTop = new("LegacyRegsTop", "regsTop", 0, legacyRegsTopConfig); - void = this.mercuryTop.RegisterXactor(this.regsTop, AVE_TOP_NO_WAIT_FOR_DONE); -} - -task LegacyRegsEnv::directed_test_t() { -} - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsEnvConfig.vr b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsEnvConfig.vr deleted file mode 100644 index ed706ac02fa2..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsEnvConfig.vr +++ /dev/null @@ -1,42 +0,0 @@ -#include -#include "AveStdLib.vri" - -#ifndef SYNOPSYS_NTB - #include "MercuryEnvConfig.vrh" -#endif - -class LegacyRegsEnvConfig extends MercuryEnvConfig { - static local rvm_log log = new("LegacyRegsEnvConfig", "class"); - - constraint LegacyRegsEnvConfigConstraint { - numRuns == 1; - } - - constraint LegacyRegsEnvConfigTest; - - task new(rvm_log log = null); - virtual function rvm_data allocate(); - virtual function AveTopConfig GetTopConfig(); - virtual task SetTopConfig(AveTopConfig topConfig); -} - -task LegacyRegsEnvConfig::new(rvm_log log = null) { - super.new((log != null) ? log : this.log); - if (log != null) this.log = log; -} - -function rvm_data LegacyRegsEnvConfig::allocate() { - LegacyRegsEnvConfig envConfig = new(); - allocate = envConfig; -} - -function AveTopConfig LegacyRegsEnvConfig::GetTopConfig() { - GetTopConfig = this.topConfig; -} - -task LegacyRegsEnvConfig::SetTopConfig(AveTopConfig topConfig) { - if (!cast_assign(this.topConfig, topConfig, CHECK)) { - rvm_fatal(log, "Cannot set topConfig to non-LegacyRegsTopConfig instance"); - } -} - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsTop.vr b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsTop.vr deleted file mode 100644 index 17e9c626383b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsTop.vr +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include - -#ifndef SYNOPSYS_NTB - #include "AveTop.vrh" - #include "LegacyRegsTopConfig.vrh" -#endif - -class LegacyRegsTop extends AveTop { - LegacyRegsTopConfig topConfig; - - task new(string name, string instance, integer stream_id, LegacyRegsTopConfig topConfig); - virtual task reset_dut_t(); - virtual task start_xactor(); - virtual task stop_xactor(); - virtual task reset_xactor(integer rstType); -} - -task LegacyRegsTop::new(string name, string instance, integer stream_id, LegacyRegsTopConfig topConfig) { - super.new(name, instance, stream_id, topConfig); - this.topConfig = topConfig; -} - -task LegacyRegsTop::reset_dut_t() { - super.reset_dut_t(); -} - -task LegacyRegsTop::start_xactor() { - super.start_xactor(); -} - -task LegacyRegsTop::stop_xactor() { - super.stop_xactor(); -} - -task LegacyRegsTop::reset_xactor(integer rstType) { - super.reset_xactor(rstType); -} - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsTopConfig.vr b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsTopConfig.vr deleted file mode 100644 index 162195e5760f..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/LegacyRegsTopConfig.vr +++ /dev/null @@ -1,46 +0,0 @@ -#include - -#ifndef SYNOPSYS_NTB - #include "AveTopConfig.vr" -#endif - -class LegacyRegsTopConfig extends AveTopConfig { - local rvm_log log = new("LegacyRegsTopConfig", "class"); - - task new(rvm_log log = null, string name="LegacyRegsTopConfig", string instance="class"); - virtual function rvm_data allocate(); - virtual function rvm_data copy(rvm_data cpy = null); - virtual function AveData GetDutConfig(); - virtual task SetDutConfig(AveData dutConfig); -} - -task LegacyRegsTopConfig::new(rvm_log log = null, string name="LegacyRegsTopConfig", string instance="class") { - super.new(((log != null) ? log : this.log), name, instance); - if (log != null) this.log = log; -} - -function rvm_data LegacyRegsTopConfig::allocate() { - LegacyRegsTopConfig c = new(); - allocate = c; -} - -function rvm_data LegacyRegsTopConfig::copy(rvm_data cpy = null) { - LegacyRegsTopConfig to; - if (cpy == null) { - cast_assign(to, this.allocate()); - } - else { - if(!cast_assign(to, cpy, CHECK)) - rvm_error(this.log, "PROBLEM"); - } - void = super.copy(to); - copy = to; -} - -function AveData LegacyRegsTopConfig::GetDutConfig() { - GetDutConfig = null; -} - -task LegacyRegsTopConfig::SetDutConfig(AveData dutConfig) { -} - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/Makefile.child b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/Makefile.child deleted file mode 100644 index bff4ba902e61..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/Makefile.child +++ /dev/null @@ -1,10 +0,0 @@ -################################################################################ -# $Id: //depot/chips/mercury/2.1/dv/soc/src/ave/regs/Makefile.child#1 $ -################################################################################ - -NTB_SRCS += $(ROOT)/regs/LegacyRegsTopConfig.vr \ - $(ROOT)/regs/LegacyRegsTop.vr \ - $(ROOT)/regs/LegacyRegsEnvConfig.vr \ - $(ROOT)/regs/LegacyRegsEnv.vr \ - -NTB_INC_DIRS += $(ROOT)/regs diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/Makefile.reg b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/Makefile.reg deleted file mode 100644 index 946d31e9a986..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/Makefile.reg +++ /dev/null @@ -1,28 +0,0 @@ - - -GEN_VRH = reg -vrh -P4_EDIT = p4 edit -P4_SUBMIT = p4 submit - -REG_RTL_DIR = ../../../../../rtl -REG_SRCS = $(shell find $(REG_RTL_DIR) -name '*.reg'); -REG_VRH_TGTS = $(wildcard *_reg.vrh) - -REDO_ALL_REG_VRH = $(foreach var, $(REG_VRH_TGTS), $(GEN_VRH) $(filter %$(patsubst %vrh,%reg,$(var)), $(REG_SRCS));) - -VPATH = $(dir $(REG_SRCS)) - -all: $(REG_VRH_TGTS) - -refresh_all_reg_vrh: - $(P4_EDIT) $(REG_VRH_TGTS) - $(REDO_ALL_REG_VRH) - $(P4_SUBMIT) ... - -%_reg.vrh : %_reg.reg - $(P4_EDIT) $@ - $(GEN_VRH) $< - $(P4_SUBMIT) ... - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/addac.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/addac.h deleted file mode 100644 index 0c58cc04adad..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/addac.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef _ADDAC_REG_H_ -#define _ADDAC_REG_H_ - -#define ADDAC_ADDAC1_ADDRESS 0x00000000 -#define ADDAC_ADDAC1_OFFSET 0x00000000 -#define ADDAC_ADDAC1_PLL_SVREG_MSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_LSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_MASK 0x80000000 -#define ADDAC_ADDAC1_PLL_SVREG_GET(x) (((x) & ADDAC_ADDAC1_PLL_SVREG_MASK) >> ADDAC_ADDAC1_PLL_SVREG_LSB) -#define ADDAC_ADDAC1_PLL_SVREG_SET(x) (((x) << ADDAC_ADDAC1_PLL_SVREG_LSB) & ADDAC_ADDAC1_PLL_SVREG_MASK) -#define ADDAC_ADDAC1_PLL_SCLAMP_MSB 30 -#define ADDAC_ADDAC1_PLL_SCLAMP_LSB 28 -#define ADDAC_ADDAC1_PLL_SCLAMP_MASK 0x70000000 -#define ADDAC_ADDAC1_PLL_SCLAMP_GET(x) (((x) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) >> ADDAC_ADDAC1_PLL_SCLAMP_LSB) -#define ADDAC_ADDAC1_PLL_SCLAMP_SET(x) (((x) << ADDAC_ADDAC1_PLL_SCLAMP_LSB) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) -#define ADDAC_ADDAC1_PLL_ATB_MSB 27 -#define ADDAC_ADDAC1_PLL_ATB_LSB 26 -#define ADDAC_ADDAC1_PLL_ATB_MASK 0x0c000000 -#define ADDAC_ADDAC1_PLL_ATB_GET(x) (((x) & ADDAC_ADDAC1_PLL_ATB_MASK) >> ADDAC_ADDAC1_PLL_ATB_LSB) -#define ADDAC_ADDAC1_PLL_ATB_SET(x) (((x) << ADDAC_ADDAC1_PLL_ATB_LSB) & ADDAC_ADDAC1_PLL_ATB_MASK) -#define ADDAC_ADDAC1_PLL_ICP_MSB 25 -#define ADDAC_ADDAC1_PLL_ICP_LSB 23 -#define ADDAC_ADDAC1_PLL_ICP_MASK 0x03800000 -#define ADDAC_ADDAC1_PLL_ICP_GET(x) (((x) & ADDAC_ADDAC1_PLL_ICP_MASK) >> ADDAC_ADDAC1_PLL_ICP_LSB) -#define ADDAC_ADDAC1_PLL_ICP_SET(x) (((x) << ADDAC_ADDAC1_PLL_ICP_LSB) & ADDAC_ADDAC1_PLL_ICP_MASK) -#define ADDAC_ADDAC1_PLL_FILTER_MSB 22 -#define ADDAC_ADDAC1_PLL_FILTER_LSB 15 -#define ADDAC_ADDAC1_PLL_FILTER_MASK 0x007f8000 -#define ADDAC_ADDAC1_PLL_FILTER_GET(x) (((x) & ADDAC_ADDAC1_PLL_FILTER_MASK) >> ADDAC_ADDAC1_PLL_FILTER_LSB) -#define ADDAC_ADDAC1_PLL_FILTER_SET(x) (((x) << ADDAC_ADDAC1_PLL_FILTER_LSB) & ADDAC_ADDAC1_PLL_FILTER_MASK) -#define ADDAC_ADDAC1_PWDPLL_MSB 14 -#define ADDAC_ADDAC1_PWDPLL_LSB 14 -#define ADDAC_ADDAC1_PWDPLL_MASK 0x00004000 -#define ADDAC_ADDAC1_PWDPLL_GET(x) (((x) & ADDAC_ADDAC1_PWDPLL_MASK) >> ADDAC_ADDAC1_PWDPLL_LSB) -#define ADDAC_ADDAC1_PWDPLL_SET(x) (((x) << ADDAC_ADDAC1_PWDPLL_LSB) & ADDAC_ADDAC1_PWDPLL_MASK) -#define ADDAC_ADDAC1_PWDADC_MSB 13 -#define ADDAC_ADDAC1_PWDADC_LSB 13 -#define ADDAC_ADDAC1_PWDADC_MASK 0x00002000 -#define ADDAC_ADDAC1_PWDADC_GET(x) (((x) & ADDAC_ADDAC1_PWDADC_MASK) >> ADDAC_ADDAC1_PWDADC_LSB) -#define ADDAC_ADDAC1_PWDADC_SET(x) (((x) << ADDAC_ADDAC1_PWDADC_LSB) & ADDAC_ADDAC1_PWDADC_MASK) -#define ADDAC_ADDAC1_PWDDAC_MSB 12 -#define ADDAC_ADDAC1_PWDDAC_LSB 12 -#define ADDAC_ADDAC1_PWDDAC_MASK 0x00001000 -#define ADDAC_ADDAC1_PWDDAC_GET(x) (((x) & ADDAC_ADDAC1_PWDDAC_MASK) >> ADDAC_ADDAC1_PWDDAC_LSB) -#define ADDAC_ADDAC1_PWDDAC_SET(x) (((x) << ADDAC_ADDAC1_PWDDAC_LSB) & ADDAC_ADDAC1_PWDDAC_MASK) -#define ADDAC_ADDAC1_FORCEMSBLOW_MSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_LSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_MASK 0x00000800 -#define ADDAC_ADDAC1_FORCEMSBLOW_GET(x) (((x) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) >> ADDAC_ADDAC1_FORCEMSBLOW_LSB) -#define ADDAC_ADDAC1_FORCEMSBLOW_SET(x) (((x) << ADDAC_ADDAC1_FORCEMSBLOW_LSB) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) -#define ADDAC_ADDAC1_SELMANPWDS_MSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_LSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_MASK 0x00000400 -#define ADDAC_ADDAC1_SELMANPWDS_GET(x) (((x) & ADDAC_ADDAC1_SELMANPWDS_MASK) >> ADDAC_ADDAC1_SELMANPWDS_LSB) -#define ADDAC_ADDAC1_SELMANPWDS_SET(x) (((x) << ADDAC_ADDAC1_SELMANPWDS_LSB) & ADDAC_ADDAC1_SELMANPWDS_MASK) -#define ADDAC_ADDAC1_INV_CLK160_ADC_MSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_LSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_MASK 0x00000200 -#define ADDAC_ADDAC1_INV_CLK160_ADC_GET(x) (((x) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) >> ADDAC_ADDAC1_INV_CLK160_ADC_LSB) -#define ADDAC_ADDAC1_INV_CLK160_ADC_SET(x) (((x) << ADDAC_ADDAC1_INV_CLK160_ADC_LSB) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) -#define ADDAC_ADDAC1_CM_SEL_MSB 8 -#define ADDAC_ADDAC1_CM_SEL_LSB 7 -#define ADDAC_ADDAC1_CM_SEL_MASK 0x00000180 -#define ADDAC_ADDAC1_CM_SEL_GET(x) (((x) & ADDAC_ADDAC1_CM_SEL_MASK) >> ADDAC_ADDAC1_CM_SEL_LSB) -#define ADDAC_ADDAC1_CM_SEL_SET(x) (((x) << ADDAC_ADDAC1_CM_SEL_LSB) & ADDAC_ADDAC1_CM_SEL_MASK) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_LSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MASK 0x00000040 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_GET(x) (((x) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) >> ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_SET(x) (((x) << ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) -#define ADDAC_ADDAC1_SPARE_MSB 5 -#define ADDAC_ADDAC1_SPARE_LSB 0 -#define ADDAC_ADDAC1_SPARE_MASK 0x0000003f -#define ADDAC_ADDAC1_SPARE_GET(x) (((x) & ADDAC_ADDAC1_SPARE_MASK) >> ADDAC_ADDAC1_SPARE_LSB) -#define ADDAC_ADDAC1_SPARE_SET(x) (((x) << ADDAC_ADDAC1_SPARE_LSB) & ADDAC_ADDAC1_SPARE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct addac_reg_s { - volatile unsigned int addac_addac1; -} addac_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _ADDAC_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/addac.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/addac.vrh deleted file mode 100644 index caa44243dcc3..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/addac.vrh +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef _ADDAC_VRH_ -#define _ADDAC_VRH_ - -#define ADDAC_ADDAC1_ADDRESS 'h00000000 -#define ADDAC_ADDAC1_PLL_SVREG_MSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_LSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_MASK 'h80000000 -#define ADDAC_ADDAC1_PLL_SVREG_GET(x) (((x) & ADDAC_ADDAC1_PLL_SVREG_MASK) >> ADDAC_ADDAC1_PLL_SVREG_LSB) -#define ADDAC_ADDAC1_PLL_SVREG_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_SVREG_LSB) & ADDAC_ADDAC1_PLL_SVREG_MASK) -#define ADDAC_ADDAC1_PLL_SVREG_RESET 1'h1 -#define ADDAC_ADDAC1_PLL_SCLAMP_MSB 30 -#define ADDAC_ADDAC1_PLL_SCLAMP_LSB 28 -#define ADDAC_ADDAC1_PLL_SCLAMP_MASK 'h70000000 -#define ADDAC_ADDAC1_PLL_SCLAMP_GET(x) (((x) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) >> ADDAC_ADDAC1_PLL_SCLAMP_LSB) -#define ADDAC_ADDAC1_PLL_SCLAMP_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_SCLAMP_LSB) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) -#define ADDAC_ADDAC1_PLL_SCLAMP_RESET 3'h5 -#define ADDAC_ADDAC1_PLL_ATB_MSB 27 -#define ADDAC_ADDAC1_PLL_ATB_LSB 26 -#define ADDAC_ADDAC1_PLL_ATB_MASK 'h0c000000 -#define ADDAC_ADDAC1_PLL_ATB_GET(x) (((x) & ADDAC_ADDAC1_PLL_ATB_MASK) >> ADDAC_ADDAC1_PLL_ATB_LSB) -#define ADDAC_ADDAC1_PLL_ATB_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_ATB_LSB) & ADDAC_ADDAC1_PLL_ATB_MASK) -#define ADDAC_ADDAC1_PLL_ATB_RESET 2'h0 -#define ADDAC_ADDAC1_PLL_ICP_MSB 25 -#define ADDAC_ADDAC1_PLL_ICP_LSB 23 -#define ADDAC_ADDAC1_PLL_ICP_MASK 'h03800000 -#define ADDAC_ADDAC1_PLL_ICP_GET(x) (((x) & ADDAC_ADDAC1_PLL_ICP_MASK) >> ADDAC_ADDAC1_PLL_ICP_LSB) -#define ADDAC_ADDAC1_PLL_ICP_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_ICP_LSB) & ADDAC_ADDAC1_PLL_ICP_MASK) -#define ADDAC_ADDAC1_PLL_ICP_RESET 3'h0 -#define ADDAC_ADDAC1_PLL_FILTER_MSB 22 -#define ADDAC_ADDAC1_PLL_FILTER_LSB 15 -#define ADDAC_ADDAC1_PLL_FILTER_MASK 'h007f8000 -#define ADDAC_ADDAC1_PLL_FILTER_GET(x) (((x) & ADDAC_ADDAC1_PLL_FILTER_MASK) >> ADDAC_ADDAC1_PLL_FILTER_LSB) -#define ADDAC_ADDAC1_PLL_FILTER_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_FILTER_LSB) & ADDAC_ADDAC1_PLL_FILTER_MASK) -#define ADDAC_ADDAC1_PLL_FILTER_RESET 8'h35 -#define ADDAC_ADDAC1_PWDPLL_MSB 14 -#define ADDAC_ADDAC1_PWDPLL_LSB 14 -#define ADDAC_ADDAC1_PWDPLL_MASK 'h00004000 -#define ADDAC_ADDAC1_PWDPLL_GET(x) (((x) & ADDAC_ADDAC1_PWDPLL_MASK) >> ADDAC_ADDAC1_PWDPLL_LSB) -#define ADDAC_ADDAC1_PWDPLL_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PWDPLL_LSB) & ADDAC_ADDAC1_PWDPLL_MASK) -#define ADDAC_ADDAC1_PWDPLL_RESET 1'h0 -#define ADDAC_ADDAC1_PWDADC_MSB 13 -#define ADDAC_ADDAC1_PWDADC_LSB 13 -#define ADDAC_ADDAC1_PWDADC_MASK 'h00002000 -#define ADDAC_ADDAC1_PWDADC_GET(x) (((x) & ADDAC_ADDAC1_PWDADC_MASK) >> ADDAC_ADDAC1_PWDADC_LSB) -#define ADDAC_ADDAC1_PWDADC_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PWDADC_LSB) & ADDAC_ADDAC1_PWDADC_MASK) -#define ADDAC_ADDAC1_PWDADC_RESET 1'h0 -#define ADDAC_ADDAC1_PWDDAC_MSB 12 -#define ADDAC_ADDAC1_PWDDAC_LSB 12 -#define ADDAC_ADDAC1_PWDDAC_MASK 'h00001000 -#define ADDAC_ADDAC1_PWDDAC_GET(x) (((x) & ADDAC_ADDAC1_PWDDAC_MASK) >> ADDAC_ADDAC1_PWDDAC_LSB) -#define ADDAC_ADDAC1_PWDDAC_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PWDDAC_LSB) & ADDAC_ADDAC1_PWDDAC_MASK) -#define ADDAC_ADDAC1_PWDDAC_RESET 1'h0 -#define ADDAC_ADDAC1_FORCEMSBLOW_MSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_LSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_MASK 'h00000800 -#define ADDAC_ADDAC1_FORCEMSBLOW_GET(x) (((x) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) >> ADDAC_ADDAC1_FORCEMSBLOW_LSB) -#define ADDAC_ADDAC1_FORCEMSBLOW_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_FORCEMSBLOW_LSB) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) -#define ADDAC_ADDAC1_FORCEMSBLOW_RESET 1'h0 -#define ADDAC_ADDAC1_SELMANPWDS_MSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_LSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_MASK 'h00000400 -#define ADDAC_ADDAC1_SELMANPWDS_GET(x) (((x) & ADDAC_ADDAC1_SELMANPWDS_MASK) >> ADDAC_ADDAC1_SELMANPWDS_LSB) -#define ADDAC_ADDAC1_SELMANPWDS_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_SELMANPWDS_LSB) & ADDAC_ADDAC1_SELMANPWDS_MASK) -#define ADDAC_ADDAC1_SELMANPWDS_RESET 1'h0 -#define ADDAC_ADDAC1_INV_CLK160_ADC_MSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_LSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_MASK 'h00000200 -#define ADDAC_ADDAC1_INV_CLK160_ADC_GET(x) (((x) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) >> ADDAC_ADDAC1_INV_CLK160_ADC_LSB) -#define ADDAC_ADDAC1_INV_CLK160_ADC_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_INV_CLK160_ADC_LSB) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) -#define ADDAC_ADDAC1_INV_CLK160_ADC_RESET 1'h0 -#define ADDAC_ADDAC1_CM_SEL_MSB 8 -#define ADDAC_ADDAC1_CM_SEL_LSB 7 -#define ADDAC_ADDAC1_CM_SEL_MASK 'h00000180 -#define ADDAC_ADDAC1_CM_SEL_GET(x) (((x) & ADDAC_ADDAC1_CM_SEL_MASK) >> ADDAC_ADDAC1_CM_SEL_LSB) -#define ADDAC_ADDAC1_CM_SEL_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_CM_SEL_LSB) & ADDAC_ADDAC1_CM_SEL_MASK) -#define ADDAC_ADDAC1_CM_SEL_RESET 2'h1 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_LSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MASK 'h00000040 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_GET(x) (((x) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) >> ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_RESET 1'h0 -#define ADDAC_ADDAC1_SPARE_MSB 5 -#define ADDAC_ADDAC1_SPARE_LSB 0 -#define ADDAC_ADDAC1_SPARE_MASK 'h0000003f -#define ADDAC_ADDAC1_SPARE_GET(x) (((x) & ADDAC_ADDAC1_SPARE_MASK) >> ADDAC_ADDAC1_SPARE_LSB) -#define ADDAC_ADDAC1_SPARE_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_SPARE_LSB) & ADDAC_ADDAC1_SPARE_MASK) -#define ADDAC_ADDAC1_SPARE_RESET 6'h0 -#define ADDAC_ADDAC1_RESET (32'h0 | \ - ADDAC_ADDAC1_PLL_SVREG_SET(ADDAC_ADDAC1_PLL_SVREG_RESET) | \ - ADDAC_ADDAC1_PLL_SCLAMP_SET(ADDAC_ADDAC1_PLL_SCLAMP_RESET) | \ - ADDAC_ADDAC1_PLL_ATB_SET(ADDAC_ADDAC1_PLL_ATB_RESET) | \ - ADDAC_ADDAC1_PLL_ICP_SET(ADDAC_ADDAC1_PLL_ICP_RESET) | \ - ADDAC_ADDAC1_PLL_FILTER_SET(ADDAC_ADDAC1_PLL_FILTER_RESET) | \ - ADDAC_ADDAC1_PWDPLL_SET(ADDAC_ADDAC1_PWDPLL_RESET) | \ - ADDAC_ADDAC1_PWDADC_SET(ADDAC_ADDAC1_PWDADC_RESET) | \ - ADDAC_ADDAC1_PWDDAC_SET(ADDAC_ADDAC1_PWDDAC_RESET) | \ - ADDAC_ADDAC1_FORCEMSBLOW_SET(ADDAC_ADDAC1_FORCEMSBLOW_RESET) | \ - ADDAC_ADDAC1_SELMANPWDS_SET(ADDAC_ADDAC1_SELMANPWDS_RESET) | \ - ADDAC_ADDAC1_INV_CLK160_ADC_SET(ADDAC_ADDAC1_INV_CLK160_ADC_RESET) | \ - ADDAC_ADDAC1_CM_SEL_SET(ADDAC_ADDAC1_CM_SEL_RESET) | \ - ADDAC_ADDAC1_DISABLE_DAC_REG_SET(ADDAC_ADDAC1_DISABLE_DAC_REG_RESET) | \ - ADDAC_ADDAC1_SPARE_SET(ADDAC_ADDAC1_SPARE_RESET)) -#define ADDAC_ADDAC1_HW_MASK (32'h0) -#define ADDAC_ADDAC1_SW_MASK (32'h0 | \ - ADDAC_ADDAC1_PLL_SVREG_MASK | \ - ADDAC_ADDAC1_PLL_SCLAMP_MASK | \ - ADDAC_ADDAC1_PLL_ATB_MASK | \ - ADDAC_ADDAC1_PLL_ICP_MASK | \ - ADDAC_ADDAC1_PLL_FILTER_MASK | \ - ADDAC_ADDAC1_PWDPLL_MASK | \ - ADDAC_ADDAC1_PWDADC_MASK | \ - ADDAC_ADDAC1_PWDDAC_MASK | \ - ADDAC_ADDAC1_FORCEMSBLOW_MASK | \ - ADDAC_ADDAC1_SELMANPWDS_MASK | \ - ADDAC_ADDAC1_INV_CLK160_ADC_MASK | \ - ADDAC_ADDAC1_CM_SEL_MASK | \ - ADDAC_ADDAC1_DISABLE_DAC_REG_MASK | \ - ADDAC_ADDAC1_SPARE_MASK) - -#define ADDAC_ADDRESS_MSB 1 - -#endif /* _ADDAC_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_intf_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_intf_reg.h deleted file mode 100644 index 9c82767b6efb..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_intf_reg.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef _ANALOG_INTF_REG_REG_H_ -#define _ANALOG_INTF_REG_REG_H_ - -#define SW_OVERRIDE_ADDRESS 0x00000080 -#define SW_OVERRIDE_OFFSET 0x00000080 -#define SW_OVERRIDE_SUPDATE_DELAY_MSB 1 -#define SW_OVERRIDE_SUPDATE_DELAY_LSB 1 -#define SW_OVERRIDE_SUPDATE_DELAY_MASK 0x00000002 -#define SW_OVERRIDE_SUPDATE_DELAY_GET(x) (((x) & SW_OVERRIDE_SUPDATE_DELAY_MASK) >> SW_OVERRIDE_SUPDATE_DELAY_LSB) -#define SW_OVERRIDE_SUPDATE_DELAY_SET(x) (((x) << SW_OVERRIDE_SUPDATE_DELAY_LSB) & SW_OVERRIDE_SUPDATE_DELAY_MASK) -#define SW_OVERRIDE_ENABLE_MSB 0 -#define SW_OVERRIDE_ENABLE_LSB 0 -#define SW_OVERRIDE_ENABLE_MASK 0x00000001 -#define SW_OVERRIDE_ENABLE_GET(x) (((x) & SW_OVERRIDE_ENABLE_MASK) >> SW_OVERRIDE_ENABLE_LSB) -#define SW_OVERRIDE_ENABLE_SET(x) (((x) << SW_OVERRIDE_ENABLE_LSB) & SW_OVERRIDE_ENABLE_MASK) - -#define SIN_VAL_ADDRESS 0x00000084 -#define SIN_VAL_OFFSET 0x00000084 -#define SIN_VAL_SIN_MSB 0 -#define SIN_VAL_SIN_LSB 0 -#define SIN_VAL_SIN_MASK 0x00000001 -#define SIN_VAL_SIN_GET(x) (((x) & SIN_VAL_SIN_MASK) >> SIN_VAL_SIN_LSB) -#define SIN_VAL_SIN_SET(x) (((x) << SIN_VAL_SIN_LSB) & SIN_VAL_SIN_MASK) - -#define SW_SCLK_ADDRESS 0x00000088 -#define SW_SCLK_OFFSET 0x00000088 -#define SW_SCLK_SW_SCLK_MSB 0 -#define SW_SCLK_SW_SCLK_LSB 0 -#define SW_SCLK_SW_SCLK_MASK 0x00000001 -#define SW_SCLK_SW_SCLK_GET(x) (((x) & SW_SCLK_SW_SCLK_MASK) >> SW_SCLK_SW_SCLK_LSB) -#define SW_SCLK_SW_SCLK_SET(x) (((x) << SW_SCLK_SW_SCLK_LSB) & SW_SCLK_SW_SCLK_MASK) - -#define SW_CNTL_ADDRESS 0x0000008c -#define SW_CNTL_OFFSET 0x0000008c -#define SW_CNTL_SW_SCAPTURE_MSB 2 -#define SW_CNTL_SW_SCAPTURE_LSB 2 -#define SW_CNTL_SW_SCAPTURE_MASK 0x00000004 -#define SW_CNTL_SW_SCAPTURE_GET(x) (((x) & SW_CNTL_SW_SCAPTURE_MASK) >> SW_CNTL_SW_SCAPTURE_LSB) -#define SW_CNTL_SW_SCAPTURE_SET(x) (((x) << SW_CNTL_SW_SCAPTURE_LSB) & SW_CNTL_SW_SCAPTURE_MASK) -#define SW_CNTL_SW_SUPDATE_MSB 1 -#define SW_CNTL_SW_SUPDATE_LSB 1 -#define SW_CNTL_SW_SUPDATE_MASK 0x00000002 -#define SW_CNTL_SW_SUPDATE_GET(x) (((x) & SW_CNTL_SW_SUPDATE_MASK) >> SW_CNTL_SW_SUPDATE_LSB) -#define SW_CNTL_SW_SUPDATE_SET(x) (((x) << SW_CNTL_SW_SUPDATE_LSB) & SW_CNTL_SW_SUPDATE_MASK) -#define SW_CNTL_SW_SOUT_MSB 0 -#define SW_CNTL_SW_SOUT_LSB 0 -#define SW_CNTL_SW_SOUT_MASK 0x00000001 -#define SW_CNTL_SW_SOUT_GET(x) (((x) & SW_CNTL_SW_SOUT_MASK) >> SW_CNTL_SW_SOUT_LSB) -#define SW_CNTL_SW_SOUT_SET(x) (((x) << SW_CNTL_SW_SOUT_LSB) & SW_CNTL_SW_SOUT_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct analog_intf_reg_reg_s { - unsigned char pad0[128]; /* pad to 0x80 */ - volatile unsigned int sw_override; - volatile unsigned int sin_val; - volatile unsigned int sw_sclk; - volatile unsigned int sw_cntl; -} analog_intf_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _ANALOG_INTF_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_intf_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_intf_reg.vrh deleted file mode 100644 index ade586e92eec..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_intf_reg.vrh +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef _ANALOG_INTF_REG_VRH_ -#define _ANALOG_INTF_REG_VRH_ - -#define SW_OVERRIDE_ADDRESS 'h00000080 -#define SW_OVERRIDE_SUPDATE_DELAY_MSB 1 -#define SW_OVERRIDE_SUPDATE_DELAY_LSB 1 -#define SW_OVERRIDE_SUPDATE_DELAY_MASK 'h00000002 -#define SW_OVERRIDE_SUPDATE_DELAY_GET(x) (((x) & SW_OVERRIDE_SUPDATE_DELAY_MASK) >> SW_OVERRIDE_SUPDATE_DELAY_LSB) -#define SW_OVERRIDE_SUPDATE_DELAY_SET(x) (((32'd0 | (x)) << SW_OVERRIDE_SUPDATE_DELAY_LSB) & SW_OVERRIDE_SUPDATE_DELAY_MASK) -#define SW_OVERRIDE_SUPDATE_DELAY_RESET 1'h0 -#define SW_OVERRIDE_ENABLE_MSB 0 -#define SW_OVERRIDE_ENABLE_LSB 0 -#define SW_OVERRIDE_ENABLE_MASK 'h00000001 -#define SW_OVERRIDE_ENABLE_GET(x) (((x) & SW_OVERRIDE_ENABLE_MASK) >> SW_OVERRIDE_ENABLE_LSB) -#define SW_OVERRIDE_ENABLE_SET(x) (((32'd0 | (x)) << SW_OVERRIDE_ENABLE_LSB) & SW_OVERRIDE_ENABLE_MASK) -#define SW_OVERRIDE_ENABLE_RESET 1'h0 -#define SW_OVERRIDE_RESET (32'h0 | \ - SW_OVERRIDE_SUPDATE_DELAY_SET(SW_OVERRIDE_SUPDATE_DELAY_RESET) | \ - SW_OVERRIDE_ENABLE_SET(SW_OVERRIDE_ENABLE_RESET)) -#define SW_OVERRIDE_HW_MASK (32'h0) -#define SW_OVERRIDE_SW_MASK (32'h0 | \ - SW_OVERRIDE_SUPDATE_DELAY_MASK | \ - SW_OVERRIDE_ENABLE_MASK) - -#define SIN_VAL_ADDRESS 'h00000084 -#define SIN_VAL_SIN_MSB 0 -#define SIN_VAL_SIN_LSB 0 -#define SIN_VAL_SIN_MASK 'h00000001 -#define SIN_VAL_SIN_GET(x) (((x) & SIN_VAL_SIN_MASK) >> SIN_VAL_SIN_LSB) -#define SIN_VAL_SIN_SET(x) (((32'd0 | (x)) << SIN_VAL_SIN_LSB) & SIN_VAL_SIN_MASK) -#define SIN_VAL_SIN_RESET 1'h0 -#define SIN_VAL_RESET (32'h0 | \ - SIN_VAL_SIN_SET(SIN_VAL_SIN_RESET)) -#define SIN_VAL_HW_MASK (32'h0 | \ - SIN_VAL_SIN_MASK) -#define SIN_VAL_SW_MASK (32'h0) - -#define SW_SCLK_ADDRESS 'h00000088 -#define SW_SCLK_SW_SCLK_MSB 0 -#define SW_SCLK_SW_SCLK_LSB 0 -#define SW_SCLK_SW_SCLK_MASK 'h00000001 -#define SW_SCLK_SW_SCLK_GET(x) (((x) & SW_SCLK_SW_SCLK_MASK) >> SW_SCLK_SW_SCLK_LSB) -#define SW_SCLK_SW_SCLK_SET(x) (((32'd0 | (x)) << SW_SCLK_SW_SCLK_LSB) & SW_SCLK_SW_SCLK_MASK) -#define SW_SCLK_SW_SCLK_RESET 1'h0 -#define SW_SCLK_RESET (32'h0 | \ - SW_SCLK_SW_SCLK_SET(SW_SCLK_SW_SCLK_RESET)) -#define SW_SCLK_HW_MASK (32'h0) -#define SW_SCLK_SW_MASK (32'h0 | \ - SW_SCLK_SW_SCLK_MASK) - -#define SW_CNTL_ADDRESS 'h0000008c -#define SW_CNTL_SW_SCAPTURE_MSB 2 -#define SW_CNTL_SW_SCAPTURE_LSB 2 -#define SW_CNTL_SW_SCAPTURE_MASK 'h00000004 -#define SW_CNTL_SW_SCAPTURE_GET(x) (((x) & SW_CNTL_SW_SCAPTURE_MASK) >> SW_CNTL_SW_SCAPTURE_LSB) -#define SW_CNTL_SW_SCAPTURE_SET(x) (((32'd0 | (x)) << SW_CNTL_SW_SCAPTURE_LSB) & SW_CNTL_SW_SCAPTURE_MASK) -#define SW_CNTL_SW_SCAPTURE_RESET 1'h0 -#define SW_CNTL_SW_SUPDATE_MSB 1 -#define SW_CNTL_SW_SUPDATE_LSB 1 -#define SW_CNTL_SW_SUPDATE_MASK 'h00000002 -#define SW_CNTL_SW_SUPDATE_GET(x) (((x) & SW_CNTL_SW_SUPDATE_MASK) >> SW_CNTL_SW_SUPDATE_LSB) -#define SW_CNTL_SW_SUPDATE_SET(x) (((32'd0 | (x)) << SW_CNTL_SW_SUPDATE_LSB) & SW_CNTL_SW_SUPDATE_MASK) -#define SW_CNTL_SW_SUPDATE_RESET 1'h0 -#define SW_CNTL_SW_SOUT_MSB 0 -#define SW_CNTL_SW_SOUT_LSB 0 -#define SW_CNTL_SW_SOUT_MASK 'h00000001 -#define SW_CNTL_SW_SOUT_GET(x) (((x) & SW_CNTL_SW_SOUT_MASK) >> SW_CNTL_SW_SOUT_LSB) -#define SW_CNTL_SW_SOUT_SET(x) (((32'd0 | (x)) << SW_CNTL_SW_SOUT_LSB) & SW_CNTL_SW_SOUT_MASK) -#define SW_CNTL_SW_SOUT_RESET 1'h0 -#define SW_CNTL_RESET (32'h0 | \ - SW_CNTL_SW_SCAPTURE_SET(SW_CNTL_SW_SCAPTURE_RESET) | \ - SW_CNTL_SW_SUPDATE_SET(SW_CNTL_SW_SUPDATE_RESET) | \ - SW_CNTL_SW_SOUT_SET(SW_CNTL_SW_SOUT_RESET)) -#define SW_CNTL_HW_MASK (32'h0) -#define SW_CNTL_SW_MASK (32'h0 | \ - SW_CNTL_SW_SCAPTURE_MASK | \ - SW_CNTL_SW_SUPDATE_MASK | \ - SW_CNTL_SW_SOUT_MASK) - -#define ANALOG_INTF_REG_ADDRESS_MSB 7 - -#endif /* _ANALOG_INTF_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_reg.h deleted file mode 100644 index cf562b86f655..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_reg.h +++ /dev/null @@ -1,1932 +0,0 @@ -#ifndef _ANALOG_REG_REG_H_ -#define _ANALOG_REG_REG_H_ - -#define SYNTH_SYNTH1_ADDRESS 0x00000000 -#define SYNTH_SYNTH1_OFFSET 0x00000000 -#define SYNTH_SYNTH1_PWD_BIAS_MSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_LSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_MASK 0x80000000 -#define SYNTH_SYNTH1_PWD_BIAS_GET(x) (((x) & SYNTH_SYNTH1_PWD_BIAS_MASK) >> SYNTH_SYNTH1_PWD_BIAS_LSB) -#define SYNTH_SYNTH1_PWD_BIAS_SET(x) (((x) << SYNTH_SYNTH1_PWD_BIAS_LSB) & SYNTH_SYNTH1_PWD_BIAS_MASK) -#define SYNTH_SYNTH1_PWD_CP_MSB 30 -#define SYNTH_SYNTH1_PWD_CP_LSB 30 -#define SYNTH_SYNTH1_PWD_CP_MASK 0x40000000 -#define SYNTH_SYNTH1_PWD_CP_GET(x) (((x) & SYNTH_SYNTH1_PWD_CP_MASK) >> SYNTH_SYNTH1_PWD_CP_LSB) -#define SYNTH_SYNTH1_PWD_CP_SET(x) (((x) << SYNTH_SYNTH1_PWD_CP_LSB) & SYNTH_SYNTH1_PWD_CP_MASK) -#define SYNTH_SYNTH1_PWD_VCMON_MSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_LSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_MASK 0x20000000 -#define SYNTH_SYNTH1_PWD_VCMON_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCMON_MASK) >> SYNTH_SYNTH1_PWD_VCMON_LSB) -#define SYNTH_SYNTH1_PWD_VCMON_SET(x) (((x) << SYNTH_SYNTH1_PWD_VCMON_LSB) & SYNTH_SYNTH1_PWD_VCMON_MASK) -#define SYNTH_SYNTH1_PWD_VCO_MSB 28 -#define SYNTH_SYNTH1_PWD_VCO_LSB 28 -#define SYNTH_SYNTH1_PWD_VCO_MASK 0x10000000 -#define SYNTH_SYNTH1_PWD_VCO_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCO_MASK) >> SYNTH_SYNTH1_PWD_VCO_LSB) -#define SYNTH_SYNTH1_PWD_VCO_SET(x) (((x) << SYNTH_SYNTH1_PWD_VCO_LSB) & SYNTH_SYNTH1_PWD_VCO_MASK) -#define SYNTH_SYNTH1_PWD_PRESC_MSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_LSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_MASK 0x08000000 -#define SYNTH_SYNTH1_PWD_PRESC_GET(x) (((x) & SYNTH_SYNTH1_PWD_PRESC_MASK) >> SYNTH_SYNTH1_PWD_PRESC_LSB) -#define SYNTH_SYNTH1_PWD_PRESC_SET(x) (((x) << SYNTH_SYNTH1_PWD_PRESC_LSB) & SYNTH_SYNTH1_PWD_PRESC_MASK) -#define SYNTH_SYNTH1_PWD_LODIV_MSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_LSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_MASK 0x04000000 -#define SYNTH_SYNTH1_PWD_LODIV_GET(x) (((x) & SYNTH_SYNTH1_PWD_LODIV_MASK) >> SYNTH_SYNTH1_PWD_LODIV_LSB) -#define SYNTH_SYNTH1_PWD_LODIV_SET(x) (((x) << SYNTH_SYNTH1_PWD_LODIV_LSB) & SYNTH_SYNTH1_PWD_LODIV_MASK) -#define SYNTH_SYNTH1_PWD_LOMIX_MSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_LSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_MASK 0x02000000 -#define SYNTH_SYNTH1_PWD_LOMIX_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOMIX_MASK) >> SYNTH_SYNTH1_PWD_LOMIX_LSB) -#define SYNTH_SYNTH1_PWD_LOMIX_SET(x) (((x) << SYNTH_SYNTH1_PWD_LOMIX_LSB) & SYNTH_SYNTH1_PWD_LOMIX_MASK) -#define SYNTH_SYNTH1_FORCE_LO_ON_MSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_LSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_MASK 0x01000000 -#define SYNTH_SYNTH1_FORCE_LO_ON_GET(x) (((x) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) >> SYNTH_SYNTH1_FORCE_LO_ON_LSB) -#define SYNTH_SYNTH1_FORCE_LO_ON_SET(x) (((x) << SYNTH_SYNTH1_FORCE_LO_ON_LSB) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) -#define SYNTH_SYNTH1_PWD_LOBUF5G_MSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_LSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_MASK 0x00800000 -#define SYNTH_SYNTH1_PWD_LOBUF5G_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) >> SYNTH_SYNTH1_PWD_LOBUF5G_LSB) -#define SYNTH_SYNTH1_PWD_LOBUF5G_SET(x) (((x) << SYNTH_SYNTH1_PWD_LOBUF5G_LSB) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) -#define SYNTH_SYNTH1_VCOREGBYPASS_MSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_LSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_MASK 0x00400000 -#define SYNTH_SYNTH1_VCOREGBYPASS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) >> SYNTH_SYNTH1_VCOREGBYPASS_LSB) -#define SYNTH_SYNTH1_VCOREGBYPASS_SET(x) (((x) << SYNTH_SYNTH1_VCOREGBYPASS_LSB) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) -#define SYNTH_SYNTH1_VCOREGLEVEL_MSB 21 -#define SYNTH_SYNTH1_VCOREGLEVEL_LSB 20 -#define SYNTH_SYNTH1_VCOREGLEVEL_MASK 0x00300000 -#define SYNTH_SYNTH1_VCOREGLEVEL_GET(x) (((x) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) >> SYNTH_SYNTH1_VCOREGLEVEL_LSB) -#define SYNTH_SYNTH1_VCOREGLEVEL_SET(x) (((x) << SYNTH_SYNTH1_VCOREGLEVEL_LSB) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) -#define SYNTH_SYNTH1_VCOREGBIAS_MSB 19 -#define SYNTH_SYNTH1_VCOREGBIAS_LSB 18 -#define SYNTH_SYNTH1_VCOREGBIAS_MASK 0x000c0000 -#define SYNTH_SYNTH1_VCOREGBIAS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBIAS_MASK) >> SYNTH_SYNTH1_VCOREGBIAS_LSB) -#define SYNTH_SYNTH1_VCOREGBIAS_SET(x) (((x) << SYNTH_SYNTH1_VCOREGBIAS_LSB) & SYNTH_SYNTH1_VCOREGBIAS_MASK) -#define SYNTH_SYNTH1_SLIDINGIF_MSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_LSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_MASK 0x00020000 -#define SYNTH_SYNTH1_SLIDINGIF_GET(x) (((x) & SYNTH_SYNTH1_SLIDINGIF_MASK) >> SYNTH_SYNTH1_SLIDINGIF_LSB) -#define SYNTH_SYNTH1_SLIDINGIF_SET(x) (((x) << SYNTH_SYNTH1_SLIDINGIF_LSB) & SYNTH_SYNTH1_SLIDINGIF_MASK) -#define SYNTH_SYNTH1_SPARE_PWD_MSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_LSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_MASK 0x00010000 -#define SYNTH_SYNTH1_SPARE_PWD_GET(x) (((x) & SYNTH_SYNTH1_SPARE_PWD_MASK) >> SYNTH_SYNTH1_SPARE_PWD_LSB) -#define SYNTH_SYNTH1_SPARE_PWD_SET(x) (((x) << SYNTH_SYNTH1_SPARE_PWD_LSB) & SYNTH_SYNTH1_SPARE_PWD_MASK) -#define SYNTH_SYNTH1_CON_VDDVCOREG_MSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_LSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_MASK 0x00008000 -#define SYNTH_SYNTH1_CON_VDDVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) >> SYNTH_SYNTH1_CON_VDDVCOREG_LSB) -#define SYNTH_SYNTH1_CON_VDDVCOREG_SET(x) (((x) << SYNTH_SYNTH1_CON_VDDVCOREG_LSB) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) -#define SYNTH_SYNTH1_CON_IVCOREG_MSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_LSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_MASK 0x00004000 -#define SYNTH_SYNTH1_CON_IVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOREG_MASK) >> SYNTH_SYNTH1_CON_IVCOREG_LSB) -#define SYNTH_SYNTH1_CON_IVCOREG_SET(x) (((x) << SYNTH_SYNTH1_CON_IVCOREG_LSB) & SYNTH_SYNTH1_CON_IVCOREG_MASK) -#define SYNTH_SYNTH1_CON_IVCOBUF_MSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_LSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_MASK 0x00002000 -#define SYNTH_SYNTH1_CON_IVCOBUF_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) >> SYNTH_SYNTH1_CON_IVCOBUF_LSB) -#define SYNTH_SYNTH1_CON_IVCOBUF_SET(x) (((x) << SYNTH_SYNTH1_CON_IVCOBUF_LSB) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) -#define SYNTH_SYNTH1_SEL_VCMONABUS_MSB 12 -#define SYNTH_SYNTH1_SEL_VCMONABUS_LSB 10 -#define SYNTH_SYNTH1_SEL_VCMONABUS_MASK 0x00001c00 -#define SYNTH_SYNTH1_SEL_VCMONABUS_GET(x) (((x) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) >> SYNTH_SYNTH1_SEL_VCMONABUS_LSB) -#define SYNTH_SYNTH1_SEL_VCMONABUS_SET(x) (((x) << SYNTH_SYNTH1_SEL_VCMONABUS_LSB) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK 0x00000200 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) >> SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_LSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MASK 0x00000100 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) >> SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK 0x00000080 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK 0x00000040 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_MSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_LSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_MASK 0x00000020 -#define SYNTH_SYNTH1_MONITOR_FB_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_MASK) >> SYNTH_SYNTH1_MONITOR_FB_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_FB_LSB) & SYNTH_SYNTH1_MONITOR_FB_MASK) -#define SYNTH_SYNTH1_MONITOR_REF_MSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_LSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_MASK 0x00000010 -#define SYNTH_SYNTH1_MONITOR_REF_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_REF_MASK) >> SYNTH_SYNTH1_MONITOR_REF_LSB) -#define SYNTH_SYNTH1_MONITOR_REF_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_REF_LSB) & SYNTH_SYNTH1_MONITOR_REF_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK 0x00000008 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) >> SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK 0x00000004 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) >> SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_LSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MASK 0x00000002 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) >> SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK 0x00000001 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) >> SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) - -#define SYNTH_SYNTH2_ADDRESS 0x00000004 -#define SYNTH_SYNTH2_OFFSET 0x00000004 -#define SYNTH_SYNTH2_VC_CAL_REF_MSB 31 -#define SYNTH_SYNTH2_VC_CAL_REF_LSB 29 -#define SYNTH_SYNTH2_VC_CAL_REF_MASK 0xe0000000 -#define SYNTH_SYNTH2_VC_CAL_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_CAL_REF_MASK) >> SYNTH_SYNTH2_VC_CAL_REF_LSB) -#define SYNTH_SYNTH2_VC_CAL_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_CAL_REF_LSB) & SYNTH_SYNTH2_VC_CAL_REF_MASK) -#define SYNTH_SYNTH2_VC_HI_REF_MSB 28 -#define SYNTH_SYNTH2_VC_HI_REF_LSB 26 -#define SYNTH_SYNTH2_VC_HI_REF_MASK 0x1c000000 -#define SYNTH_SYNTH2_VC_HI_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_HI_REF_MASK) >> SYNTH_SYNTH2_VC_HI_REF_LSB) -#define SYNTH_SYNTH2_VC_HI_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_HI_REF_LSB) & SYNTH_SYNTH2_VC_HI_REF_MASK) -#define SYNTH_SYNTH2_VC_MID_REF_MSB 25 -#define SYNTH_SYNTH2_VC_MID_REF_LSB 23 -#define SYNTH_SYNTH2_VC_MID_REF_MASK 0x03800000 -#define SYNTH_SYNTH2_VC_MID_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_MID_REF_MASK) >> SYNTH_SYNTH2_VC_MID_REF_LSB) -#define SYNTH_SYNTH2_VC_MID_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_MID_REF_LSB) & SYNTH_SYNTH2_VC_MID_REF_MASK) -#define SYNTH_SYNTH2_VC_LOW_REF_MSB 22 -#define SYNTH_SYNTH2_VC_LOW_REF_LSB 20 -#define SYNTH_SYNTH2_VC_LOW_REF_MASK 0x00700000 -#define SYNTH_SYNTH2_VC_LOW_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_LOW_REF_MASK) >> SYNTH_SYNTH2_VC_LOW_REF_LSB) -#define SYNTH_SYNTH2_VC_LOW_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_LOW_REF_LSB) & SYNTH_SYNTH2_VC_LOW_REF_MASK) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MSB 19 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB 15 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK 0x000f8000 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_GET(x) (((x) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) >> SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_SET(x) (((x) << SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) -#define SYNTH_SYNTH2_LOOP_CP_MSB 14 -#define SYNTH_SYNTH2_LOOP_CP_LSB 10 -#define SYNTH_SYNTH2_LOOP_CP_MASK 0x00007c00 -#define SYNTH_SYNTH2_LOOP_CP_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CP_MASK) >> SYNTH_SYNTH2_LOOP_CP_LSB) -#define SYNTH_SYNTH2_LOOP_CP_SET(x) (((x) << SYNTH_SYNTH2_LOOP_CP_LSB) & SYNTH_SYNTH2_LOOP_CP_MASK) -#define SYNTH_SYNTH2_LOOP_RS_MSB 9 -#define SYNTH_SYNTH2_LOOP_RS_LSB 5 -#define SYNTH_SYNTH2_LOOP_RS_MASK 0x000003e0 -#define SYNTH_SYNTH2_LOOP_RS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_RS_MASK) >> SYNTH_SYNTH2_LOOP_RS_LSB) -#define SYNTH_SYNTH2_LOOP_RS_SET(x) (((x) << SYNTH_SYNTH2_LOOP_RS_LSB) & SYNTH_SYNTH2_LOOP_RS_MASK) -#define SYNTH_SYNTH2_LOOP_CS_MSB 4 -#define SYNTH_SYNTH2_LOOP_CS_LSB 3 -#define SYNTH_SYNTH2_LOOP_CS_MASK 0x00000018 -#define SYNTH_SYNTH2_LOOP_CS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CS_MASK) >> SYNTH_SYNTH2_LOOP_CS_LSB) -#define SYNTH_SYNTH2_LOOP_CS_SET(x) (((x) << SYNTH_SYNTH2_LOOP_CS_LSB) & SYNTH_SYNTH2_LOOP_CS_MASK) -#define SYNTH_SYNTH2_SPARE_BITS_MSB 2 -#define SYNTH_SYNTH2_SPARE_BITS_LSB 0 -#define SYNTH_SYNTH2_SPARE_BITS_MASK 0x00000007 -#define SYNTH_SYNTH2_SPARE_BITS_GET(x) (((x) & SYNTH_SYNTH2_SPARE_BITS_MASK) >> SYNTH_SYNTH2_SPARE_BITS_LSB) -#define SYNTH_SYNTH2_SPARE_BITS_SET(x) (((x) << SYNTH_SYNTH2_SPARE_BITS_LSB) & SYNTH_SYNTH2_SPARE_BITS_MASK) - -#define SYNTH_SYNTH3_ADDRESS 0x00000008 -#define SYNTH_SYNTH3_OFFSET 0x00000008 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_LSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MASK 0x80000000 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_GET(x) (((x) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) >> SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) -#define SYNTH_SYNTH3_DIS_CLK_XTAL_SET(x) (((x) << SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_LSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MASK 0x40000000 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_GET(x) (((x) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) >> SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_SET(x) (((x) << SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MSB 29 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB 24 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK 0x3f000000 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_SET(x) (((x) << SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_PWRUP_MSB 23 -#define SYNTH_SYNTH3_WAIT_PWRUP_LSB 18 -#define SYNTH_SYNTH3_WAIT_PWRUP_MASK 0x00fc0000 -#define SYNTH_SYNTH3_WAIT_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_PWRUP_SET(x) (((x) << SYNTH_SYNTH3_WAIT_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MSB 17 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_LSB 12 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MASK 0x0003f000 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_SET(x) (((x) << SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MSB 11 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_LSB 6 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MASK 0x00000fc0 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_SET(x) (((x) << SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MSB 5 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_LSB 0 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MASK 0x0000003f -#define SYNTH_SYNTH3_WAIT_VC_CHECK_GET(x) (((x) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) >> SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_SET(x) (((x) << SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) - -#define SYNTH_SYNTH4_ADDRESS 0x0000000c -#define SYNTH_SYNTH4_OFFSET 0x0000000c -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK 0x80000000 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_GET(x) (((x) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) >> SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_SET(x) (((x) << SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) -#define SYNTH_SYNTH4_DIS_LOSTVC_MSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_LSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_MASK 0x40000000 -#define SYNTH_SYNTH4_DIS_LOSTVC_GET(x) (((x) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) >> SYNTH_SYNTH4_DIS_LOSTVC_LSB) -#define SYNTH_SYNTH4_DIS_LOSTVC_SET(x) (((x) << SYNTH_SYNTH4_DIS_LOSTVC_LSB) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_LSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MASK 0x20000000 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_GET(x) (((x) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) >> SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_SET(x) (((x) << SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK 0x10000000 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_GET(x) (((x) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) >> SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_SET(x) (((x) << SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) -#define SYNTH_SYNTH4_FORCE_PINVC_MSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_LSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_MASK 0x08000000 -#define SYNTH_SYNTH4_FORCE_PINVC_GET(x) (((x) & SYNTH_SYNTH4_FORCE_PINVC_MASK) >> SYNTH_SYNTH4_FORCE_PINVC_LSB) -#define SYNTH_SYNTH4_FORCE_PINVC_SET(x) (((x) << SYNTH_SYNTH4_FORCE_PINVC_LSB) & SYNTH_SYNTH4_FORCE_PINVC_MASK) -#define SYNTH_SYNTH4_FORCE_VCOCAP_MSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_LSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_MASK 0x04000000 -#define SYNTH_SYNTH4_FORCE_VCOCAP_GET(x) (((x) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) >> SYNTH_SYNTH4_FORCE_VCOCAP_LSB) -#define SYNTH_SYNTH4_FORCE_VCOCAP_SET(x) (((x) << SYNTH_SYNTH4_FORCE_VCOCAP_LSB) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) -#define SYNTH_SYNTH4_VCOCAP_OVR_MSB 25 -#define SYNTH_SYNTH4_VCOCAP_OVR_LSB 18 -#define SYNTH_SYNTH4_VCOCAP_OVR_MASK 0x03fc0000 -#define SYNTH_SYNTH4_VCOCAP_OVR_GET(x) (((x) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) >> SYNTH_SYNTH4_VCOCAP_OVR_LSB) -#define SYNTH_SYNTH4_VCOCAP_OVR_SET(x) (((x) << SYNTH_SYNTH4_VCOCAP_OVR_LSB) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) -#define SYNTH_SYNTH4_VCOCAPPULLUP_MSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_LSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_MASK 0x00020000 -#define SYNTH_SYNTH4_VCOCAPPULLUP_GET(x) (((x) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) >> SYNTH_SYNTH4_VCOCAPPULLUP_LSB) -#define SYNTH_SYNTH4_VCOCAPPULLUP_SET(x) (((x) << SYNTH_SYNTH4_VCOCAPPULLUP_LSB) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) -#define SYNTH_SYNTH4_REFDIVSEL_MSB 16 -#define SYNTH_SYNTH4_REFDIVSEL_LSB 15 -#define SYNTH_SYNTH4_REFDIVSEL_MASK 0x00018000 -#define SYNTH_SYNTH4_REFDIVSEL_GET(x) (((x) & SYNTH_SYNTH4_REFDIVSEL_MASK) >> SYNTH_SYNTH4_REFDIVSEL_LSB) -#define SYNTH_SYNTH4_REFDIVSEL_SET(x) (((x) << SYNTH_SYNTH4_REFDIVSEL_LSB) & SYNTH_SYNTH4_REFDIVSEL_MASK) -#define SYNTH_SYNTH4_PFDDELAY_MSB 14 -#define SYNTH_SYNTH4_PFDDELAY_LSB 14 -#define SYNTH_SYNTH4_PFDDELAY_MASK 0x00004000 -#define SYNTH_SYNTH4_PFDDELAY_GET(x) (((x) & SYNTH_SYNTH4_PFDDELAY_MASK) >> SYNTH_SYNTH4_PFDDELAY_LSB) -#define SYNTH_SYNTH4_PFDDELAY_SET(x) (((x) << SYNTH_SYNTH4_PFDDELAY_LSB) & SYNTH_SYNTH4_PFDDELAY_MASK) -#define SYNTH_SYNTH4_PFD_DISABLE_MSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_LSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_MASK 0x00002000 -#define SYNTH_SYNTH4_PFD_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_PFD_DISABLE_MASK) >> SYNTH_SYNTH4_PFD_DISABLE_LSB) -#define SYNTH_SYNTH4_PFD_DISABLE_SET(x) (((x) << SYNTH_SYNTH4_PFD_DISABLE_LSB) & SYNTH_SYNTH4_PFD_DISABLE_MASK) -#define SYNTH_SYNTH4_PRESCSEL_MSB 12 -#define SYNTH_SYNTH4_PRESCSEL_LSB 11 -#define SYNTH_SYNTH4_PRESCSEL_MASK 0x00001800 -#define SYNTH_SYNTH4_PRESCSEL_GET(x) (((x) & SYNTH_SYNTH4_PRESCSEL_MASK) >> SYNTH_SYNTH4_PRESCSEL_LSB) -#define SYNTH_SYNTH4_PRESCSEL_SET(x) (((x) << SYNTH_SYNTH4_PRESCSEL_LSB) & SYNTH_SYNTH4_PRESCSEL_MASK) -#define SYNTH_SYNTH4_RESET_PRESC_MSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_LSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_MASK 0x00000400 -#define SYNTH_SYNTH4_RESET_PRESC_GET(x) (((x) & SYNTH_SYNTH4_RESET_PRESC_MASK) >> SYNTH_SYNTH4_RESET_PRESC_LSB) -#define SYNTH_SYNTH4_RESET_PRESC_SET(x) (((x) << SYNTH_SYNTH4_RESET_PRESC_LSB) & SYNTH_SYNTH4_RESET_PRESC_MASK) -#define SYNTH_SYNTH4_SDM_DISABLE_MSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_LSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_MASK 0x00000200 -#define SYNTH_SYNTH4_SDM_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_SDM_DISABLE_MASK) >> SYNTH_SYNTH4_SDM_DISABLE_LSB) -#define SYNTH_SYNTH4_SDM_DISABLE_SET(x) (((x) << SYNTH_SYNTH4_SDM_DISABLE_LSB) & SYNTH_SYNTH4_SDM_DISABLE_MASK) -#define SYNTH_SYNTH4_SDM_MODE_MSB 8 -#define SYNTH_SYNTH4_SDM_MODE_LSB 8 -#define SYNTH_SYNTH4_SDM_MODE_MASK 0x00000100 -#define SYNTH_SYNTH4_SDM_MODE_GET(x) (((x) & SYNTH_SYNTH4_SDM_MODE_MASK) >> SYNTH_SYNTH4_SDM_MODE_LSB) -#define SYNTH_SYNTH4_SDM_MODE_SET(x) (((x) << SYNTH_SYNTH4_SDM_MODE_LSB) & SYNTH_SYNTH4_SDM_MODE_MASK) -#define SYNTH_SYNTH4_SDM_DITHER_MSB 7 -#define SYNTH_SYNTH4_SDM_DITHER_LSB 6 -#define SYNTH_SYNTH4_SDM_DITHER_MASK 0x000000c0 -#define SYNTH_SYNTH4_SDM_DITHER_GET(x) (((x) & SYNTH_SYNTH4_SDM_DITHER_MASK) >> SYNTH_SYNTH4_SDM_DITHER_LSB) -#define SYNTH_SYNTH4_SDM_DITHER_SET(x) (((x) << SYNTH_SYNTH4_SDM_DITHER_LSB) & SYNTH_SYNTH4_SDM_DITHER_MASK) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK 0x00000020 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_GET(x) (((x) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) >> SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_SET(x) (((x) << SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK 0x00000010 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_GET(x) (((x) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) >> SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_SET(x) (((x) << SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) -#define SYNTH_SYNTH4_SPARE_MISC_MSB 3 -#define SYNTH_SYNTH4_SPARE_MISC_LSB 2 -#define SYNTH_SYNTH4_SPARE_MISC_MASK 0x0000000c -#define SYNTH_SYNTH4_SPARE_MISC_GET(x) (((x) & SYNTH_SYNTH4_SPARE_MISC_MASK) >> SYNTH_SYNTH4_SPARE_MISC_LSB) -#define SYNTH_SYNTH4_SPARE_MISC_SET(x) (((x) << SYNTH_SYNTH4_SPARE_MISC_LSB) & SYNTH_SYNTH4_SPARE_MISC_MASK) -#define SYNTH_SYNTH4_LONGSHIFTSEL_MSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_LSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_MASK 0x00000002 -#define SYNTH_SYNTH4_LONGSHIFTSEL_GET(x) (((x) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) >> SYNTH_SYNTH4_LONGSHIFTSEL_LSB) -#define SYNTH_SYNTH4_LONGSHIFTSEL_SET(x) (((x) << SYNTH_SYNTH4_LONGSHIFTSEL_LSB) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_LSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MASK 0x00000001 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_GET(x) (((x) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) >> SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_SET(x) (((x) << SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) - -#define SYNTH_SYNTH5_ADDRESS 0x00000010 -#define SYNTH_SYNTH5_OFFSET 0x00000010 -#define SYNTH_SYNTH5_LOOP_IP0_MSB 31 -#define SYNTH_SYNTH5_LOOP_IP0_LSB 28 -#define SYNTH_SYNTH5_LOOP_IP0_MASK 0xf0000000 -#define SYNTH_SYNTH5_LOOP_IP0_GET(x) (((x) & SYNTH_SYNTH5_LOOP_IP0_MASK) >> SYNTH_SYNTH5_LOOP_IP0_LSB) -#define SYNTH_SYNTH5_LOOP_IP0_SET(x) (((x) << SYNTH_SYNTH5_LOOP_IP0_LSB) & SYNTH_SYNTH5_LOOP_IP0_MASK) -#define SYNTH_SYNTH5_SLOPE_IP_MSB 27 -#define SYNTH_SYNTH5_SLOPE_IP_LSB 25 -#define SYNTH_SYNTH5_SLOPE_IP_MASK 0x0e000000 -#define SYNTH_SYNTH5_SLOPE_IP_GET(x) (((x) & SYNTH_SYNTH5_SLOPE_IP_MASK) >> SYNTH_SYNTH5_SLOPE_IP_LSB) -#define SYNTH_SYNTH5_SLOPE_IP_SET(x) (((x) << SYNTH_SYNTH5_SLOPE_IP_LSB) & SYNTH_SYNTH5_SLOPE_IP_MASK) -#define SYNTH_SYNTH5_CPBIAS_MSB 24 -#define SYNTH_SYNTH5_CPBIAS_LSB 23 -#define SYNTH_SYNTH5_CPBIAS_MASK 0x01800000 -#define SYNTH_SYNTH5_CPBIAS_GET(x) (((x) & SYNTH_SYNTH5_CPBIAS_MASK) >> SYNTH_SYNTH5_CPBIAS_LSB) -#define SYNTH_SYNTH5_CPBIAS_SET(x) (((x) << SYNTH_SYNTH5_CPBIAS_LSB) & SYNTH_SYNTH5_CPBIAS_MASK) -#define SYNTH_SYNTH5_CPSTEERING_EN_MSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_LSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_MASK 0x00400000 -#define SYNTH_SYNTH5_CPSTEERING_EN_GET(x) (((x) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) >> SYNTH_SYNTH5_CPSTEERING_EN_LSB) -#define SYNTH_SYNTH5_CPSTEERING_EN_SET(x) (((x) << SYNTH_SYNTH5_CPSTEERING_EN_LSB) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) -#define SYNTH_SYNTH5_CPLOWLK_MSB 21 -#define SYNTH_SYNTH5_CPLOWLK_LSB 21 -#define SYNTH_SYNTH5_CPLOWLK_MASK 0x00200000 -#define SYNTH_SYNTH5_CPLOWLK_GET(x) (((x) & SYNTH_SYNTH5_CPLOWLK_MASK) >> SYNTH_SYNTH5_CPLOWLK_LSB) -#define SYNTH_SYNTH5_CPLOWLK_SET(x) (((x) << SYNTH_SYNTH5_CPLOWLK_LSB) & SYNTH_SYNTH5_CPLOWLK_MASK) -#define SYNTH_SYNTH5_LOOPLEAKCUR_MSB 20 -#define SYNTH_SYNTH5_LOOPLEAKCUR_LSB 17 -#define SYNTH_SYNTH5_LOOPLEAKCUR_MASK 0x001e0000 -#define SYNTH_SYNTH5_LOOPLEAKCUR_GET(x) (((x) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) >> SYNTH_SYNTH5_LOOPLEAKCUR_LSB) -#define SYNTH_SYNTH5_LOOPLEAKCUR_SET(x) (((x) << SYNTH_SYNTH5_LOOPLEAKCUR_LSB) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) -#define SYNTH_SYNTH5_CAPRANGE1_MSB 16 -#define SYNTH_SYNTH5_CAPRANGE1_LSB 13 -#define SYNTH_SYNTH5_CAPRANGE1_MASK 0x0001e000 -#define SYNTH_SYNTH5_CAPRANGE1_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE1_MASK) >> SYNTH_SYNTH5_CAPRANGE1_LSB) -#define SYNTH_SYNTH5_CAPRANGE1_SET(x) (((x) << SYNTH_SYNTH5_CAPRANGE1_LSB) & SYNTH_SYNTH5_CAPRANGE1_MASK) -#define SYNTH_SYNTH5_CAPRANGE2_MSB 12 -#define SYNTH_SYNTH5_CAPRANGE2_LSB 9 -#define SYNTH_SYNTH5_CAPRANGE2_MASK 0x00001e00 -#define SYNTH_SYNTH5_CAPRANGE2_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE2_MASK) >> SYNTH_SYNTH5_CAPRANGE2_LSB) -#define SYNTH_SYNTH5_CAPRANGE2_SET(x) (((x) << SYNTH_SYNTH5_CAPRANGE2_LSB) & SYNTH_SYNTH5_CAPRANGE2_MASK) -#define SYNTH_SYNTH5_CAPRANGE3_MSB 8 -#define SYNTH_SYNTH5_CAPRANGE3_LSB 5 -#define SYNTH_SYNTH5_CAPRANGE3_MASK 0x000001e0 -#define SYNTH_SYNTH5_CAPRANGE3_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE3_MASK) >> SYNTH_SYNTH5_CAPRANGE3_LSB) -#define SYNTH_SYNTH5_CAPRANGE3_SET(x) (((x) << SYNTH_SYNTH5_CAPRANGE3_LSB) & SYNTH_SYNTH5_CAPRANGE3_MASK) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK 0x00000010 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_SET(x) (((x) << SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MSB 3 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB 2 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK 0x0000000c -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_GET(x) (((x) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) >> SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_SET(x) (((x) << SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) -#define SYNTH_SYNTH5_SPARE_MSB 1 -#define SYNTH_SYNTH5_SPARE_LSB 0 -#define SYNTH_SYNTH5_SPARE_MASK 0x00000003 -#define SYNTH_SYNTH5_SPARE_GET(x) (((x) & SYNTH_SYNTH5_SPARE_MASK) >> SYNTH_SYNTH5_SPARE_LSB) -#define SYNTH_SYNTH5_SPARE_SET(x) (((x) << SYNTH_SYNTH5_SPARE_LSB) & SYNTH_SYNTH5_SPARE_MASK) - -#define SYNTH_SYNTH6_ADDRESS 0x00000014 -#define SYNTH_SYNTH6_OFFSET 0x00000014 -#define SYNTH_SYNTH6_IRCP_MSB 31 -#define SYNTH_SYNTH6_IRCP_LSB 29 -#define SYNTH_SYNTH6_IRCP_MASK 0xe0000000 -#define SYNTH_SYNTH6_IRCP_GET(x) (((x) & SYNTH_SYNTH6_IRCP_MASK) >> SYNTH_SYNTH6_IRCP_LSB) -#define SYNTH_SYNTH6_IRCP_SET(x) (((x) << SYNTH_SYNTH6_IRCP_LSB) & SYNTH_SYNTH6_IRCP_MASK) -#define SYNTH_SYNTH6_IRVCMON_MSB 28 -#define SYNTH_SYNTH6_IRVCMON_LSB 26 -#define SYNTH_SYNTH6_IRVCMON_MASK 0x1c000000 -#define SYNTH_SYNTH6_IRVCMON_GET(x) (((x) & SYNTH_SYNTH6_IRVCMON_MASK) >> SYNTH_SYNTH6_IRVCMON_LSB) -#define SYNTH_SYNTH6_IRVCMON_SET(x) (((x) << SYNTH_SYNTH6_IRVCMON_LSB) & SYNTH_SYNTH6_IRVCMON_MASK) -#define SYNTH_SYNTH6_IRSPARE_MSB 25 -#define SYNTH_SYNTH6_IRSPARE_LSB 23 -#define SYNTH_SYNTH6_IRSPARE_MASK 0x03800000 -#define SYNTH_SYNTH6_IRSPARE_GET(x) (((x) & SYNTH_SYNTH6_IRSPARE_MASK) >> SYNTH_SYNTH6_IRSPARE_LSB) -#define SYNTH_SYNTH6_IRSPARE_SET(x) (((x) << SYNTH_SYNTH6_IRSPARE_LSB) & SYNTH_SYNTH6_IRSPARE_MASK) -#define SYNTH_SYNTH6_ICPRESC_MSB 22 -#define SYNTH_SYNTH6_ICPRESC_LSB 20 -#define SYNTH_SYNTH6_ICPRESC_MASK 0x00700000 -#define SYNTH_SYNTH6_ICPRESC_GET(x) (((x) & SYNTH_SYNTH6_ICPRESC_MASK) >> SYNTH_SYNTH6_ICPRESC_LSB) -#define SYNTH_SYNTH6_ICPRESC_SET(x) (((x) << SYNTH_SYNTH6_ICPRESC_LSB) & SYNTH_SYNTH6_ICPRESC_MASK) -#define SYNTH_SYNTH6_ICLODIV_MSB 19 -#define SYNTH_SYNTH6_ICLODIV_LSB 17 -#define SYNTH_SYNTH6_ICLODIV_MASK 0x000e0000 -#define SYNTH_SYNTH6_ICLODIV_GET(x) (((x) & SYNTH_SYNTH6_ICLODIV_MASK) >> SYNTH_SYNTH6_ICLODIV_LSB) -#define SYNTH_SYNTH6_ICLODIV_SET(x) (((x) << SYNTH_SYNTH6_ICLODIV_LSB) & SYNTH_SYNTH6_ICLODIV_MASK) -#define SYNTH_SYNTH6_ICLOMIX_MSB 16 -#define SYNTH_SYNTH6_ICLOMIX_LSB 14 -#define SYNTH_SYNTH6_ICLOMIX_MASK 0x0001c000 -#define SYNTH_SYNTH6_ICLOMIX_GET(x) (((x) & SYNTH_SYNTH6_ICLOMIX_MASK) >> SYNTH_SYNTH6_ICLOMIX_LSB) -#define SYNTH_SYNTH6_ICLOMIX_SET(x) (((x) << SYNTH_SYNTH6_ICLOMIX_LSB) & SYNTH_SYNTH6_ICLOMIX_MASK) -#define SYNTH_SYNTH6_ICSPAREA_MSB 13 -#define SYNTH_SYNTH6_ICSPAREA_LSB 11 -#define SYNTH_SYNTH6_ICSPAREA_MASK 0x00003800 -#define SYNTH_SYNTH6_ICSPAREA_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREA_MASK) >> SYNTH_SYNTH6_ICSPAREA_LSB) -#define SYNTH_SYNTH6_ICSPAREA_SET(x) (((x) << SYNTH_SYNTH6_ICSPAREA_LSB) & SYNTH_SYNTH6_ICSPAREA_MASK) -#define SYNTH_SYNTH6_ICSPAREB_MSB 10 -#define SYNTH_SYNTH6_ICSPAREB_LSB 8 -#define SYNTH_SYNTH6_ICSPAREB_MASK 0x00000700 -#define SYNTH_SYNTH6_ICSPAREB_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREB_MASK) >> SYNTH_SYNTH6_ICSPAREB_LSB) -#define SYNTH_SYNTH6_ICSPAREB_SET(x) (((x) << SYNTH_SYNTH6_ICSPAREB_LSB) & SYNTH_SYNTH6_ICSPAREB_MASK) -#define SYNTH_SYNTH6_ICVCO_MSB 7 -#define SYNTH_SYNTH6_ICVCO_LSB 5 -#define SYNTH_SYNTH6_ICVCO_MASK 0x000000e0 -#define SYNTH_SYNTH6_ICVCO_GET(x) (((x) & SYNTH_SYNTH6_ICVCO_MASK) >> SYNTH_SYNTH6_ICVCO_LSB) -#define SYNTH_SYNTH6_ICVCO_SET(x) (((x) << SYNTH_SYNTH6_ICVCO_LSB) & SYNTH_SYNTH6_ICVCO_MASK) -#define SYNTH_SYNTH6_VCOBUFBIAS_MSB 4 -#define SYNTH_SYNTH6_VCOBUFBIAS_LSB 3 -#define SYNTH_SYNTH6_VCOBUFBIAS_MASK 0x00000018 -#define SYNTH_SYNTH6_VCOBUFBIAS_GET(x) (((x) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) >> SYNTH_SYNTH6_VCOBUFBIAS_LSB) -#define SYNTH_SYNTH6_VCOBUFBIAS_SET(x) (((x) << SYNTH_SYNTH6_VCOBUFBIAS_LSB) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) -#define SYNTH_SYNTH6_SPARE_BIAS_MSB 2 -#define SYNTH_SYNTH6_SPARE_BIAS_LSB 0 -#define SYNTH_SYNTH6_SPARE_BIAS_MASK 0x00000007 -#define SYNTH_SYNTH6_SPARE_BIAS_GET(x) (((x) & SYNTH_SYNTH6_SPARE_BIAS_MASK) >> SYNTH_SYNTH6_SPARE_BIAS_LSB) -#define SYNTH_SYNTH6_SPARE_BIAS_SET(x) (((x) << SYNTH_SYNTH6_SPARE_BIAS_LSB) & SYNTH_SYNTH6_SPARE_BIAS_MASK) - -#define SYNTH_SYNTH7_ADDRESS 0x00000018 -#define SYNTH_SYNTH7_OFFSET 0x00000018 -#define SYNTH_SYNTH7_SYNTH_ON_MSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_LSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_MASK 0x80000000 -#define SYNTH_SYNTH7_SYNTH_ON_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_ON_MASK) >> SYNTH_SYNTH7_SYNTH_ON_LSB) -#define SYNTH_SYNTH7_SYNTH_ON_SET(x) (((x) << SYNTH_SYNTH7_SYNTH_ON_LSB) & SYNTH_SYNTH7_SYNTH_ON_MASK) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MSB 30 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_LSB 27 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MASK 0x78000000 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) >> SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_SET(x) (((x) << SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) -#define SYNTH_SYNTH7_CAP_SEARCH_MSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_LSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_MASK 0x04000000 -#define SYNTH_SYNTH7_CAP_SEARCH_GET(x) (((x) & SYNTH_SYNTH7_CAP_SEARCH_MASK) >> SYNTH_SYNTH7_CAP_SEARCH_LSB) -#define SYNTH_SYNTH7_CAP_SEARCH_SET(x) (((x) << SYNTH_SYNTH7_CAP_SEARCH_LSB) & SYNTH_SYNTH7_CAP_SEARCH_MASK) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK 0x02000000 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) >> SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_SET(x) (((x) << SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) -#define SYNTH_SYNTH7_PIN_VC_MSB 24 -#define SYNTH_SYNTH7_PIN_VC_LSB 24 -#define SYNTH_SYNTH7_PIN_VC_MASK 0x01000000 -#define SYNTH_SYNTH7_PIN_VC_GET(x) (((x) & SYNTH_SYNTH7_PIN_VC_MASK) >> SYNTH_SYNTH7_PIN_VC_LSB) -#define SYNTH_SYNTH7_PIN_VC_SET(x) (((x) << SYNTH_SYNTH7_PIN_VC_LSB) & SYNTH_SYNTH7_PIN_VC_MASK) -#define SYNTH_SYNTH7_VCO_CAP_ST_MSB 23 -#define SYNTH_SYNTH7_VCO_CAP_ST_LSB 16 -#define SYNTH_SYNTH7_VCO_CAP_ST_MASK 0x00ff0000 -#define SYNTH_SYNTH7_VCO_CAP_ST_GET(x) (((x) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) >> SYNTH_SYNTH7_VCO_CAP_ST_LSB) -#define SYNTH_SYNTH7_VCO_CAP_ST_SET(x) (((x) << SYNTH_SYNTH7_VCO_CAP_ST_LSB) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) -#define SYNTH_SYNTH7_SHORT_R_MSB 15 -#define SYNTH_SYNTH7_SHORT_R_LSB 15 -#define SYNTH_SYNTH7_SHORT_R_MASK 0x00008000 -#define SYNTH_SYNTH7_SHORT_R_GET(x) (((x) & SYNTH_SYNTH7_SHORT_R_MASK) >> SYNTH_SYNTH7_SHORT_R_LSB) -#define SYNTH_SYNTH7_SHORT_R_SET(x) (((x) << SYNTH_SYNTH7_SHORT_R_LSB) & SYNTH_SYNTH7_SHORT_R_MASK) -#define SYNTH_SYNTH7_RESET_RFD_MSB 14 -#define SYNTH_SYNTH7_RESET_RFD_LSB 14 -#define SYNTH_SYNTH7_RESET_RFD_MASK 0x00004000 -#define SYNTH_SYNTH7_RESET_RFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_RFD_MASK) >> SYNTH_SYNTH7_RESET_RFD_LSB) -#define SYNTH_SYNTH7_RESET_RFD_SET(x) (((x) << SYNTH_SYNTH7_RESET_RFD_LSB) & SYNTH_SYNTH7_RESET_RFD_MASK) -#define SYNTH_SYNTH7_RESET_PFD_MSB 13 -#define SYNTH_SYNTH7_RESET_PFD_LSB 13 -#define SYNTH_SYNTH7_RESET_PFD_MASK 0x00002000 -#define SYNTH_SYNTH7_RESET_PFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_PFD_MASK) >> SYNTH_SYNTH7_RESET_PFD_LSB) -#define SYNTH_SYNTH7_RESET_PFD_SET(x) (((x) << SYNTH_SYNTH7_RESET_PFD_LSB) & SYNTH_SYNTH7_RESET_PFD_MASK) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK 0x00001000 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_GET(x) (((x) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) >> SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_SET(x) (((x) << SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) -#define SYNTH_SYNTH7_RESET_SDM_B_MSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_LSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_MASK 0x00000800 -#define SYNTH_SYNTH7_RESET_SDM_B_GET(x) (((x) & SYNTH_SYNTH7_RESET_SDM_B_MASK) >> SYNTH_SYNTH7_RESET_SDM_B_LSB) -#define SYNTH_SYNTH7_RESET_SDM_B_SET(x) (((x) << SYNTH_SYNTH7_RESET_SDM_B_LSB) & SYNTH_SYNTH7_RESET_SDM_B_MASK) -#define SYNTH_SYNTH7_VC2HIGH_MSB 10 -#define SYNTH_SYNTH7_VC2HIGH_LSB 10 -#define SYNTH_SYNTH7_VC2HIGH_MASK 0x00000400 -#define SYNTH_SYNTH7_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH7_VC2HIGH_MASK) >> SYNTH_SYNTH7_VC2HIGH_LSB) -#define SYNTH_SYNTH7_VC2HIGH_SET(x) (((x) << SYNTH_SYNTH7_VC2HIGH_LSB) & SYNTH_SYNTH7_VC2HIGH_MASK) -#define SYNTH_SYNTH7_VC2LOW_MSB 9 -#define SYNTH_SYNTH7_VC2LOW_LSB 9 -#define SYNTH_SYNTH7_VC2LOW_MASK 0x00000200 -#define SYNTH_SYNTH7_VC2LOW_GET(x) (((x) & SYNTH_SYNTH7_VC2LOW_MASK) >> SYNTH_SYNTH7_VC2LOW_LSB) -#define SYNTH_SYNTH7_VC2LOW_SET(x) (((x) << SYNTH_SYNTH7_VC2LOW_LSB) & SYNTH_SYNTH7_VC2LOW_MASK) -#define SYNTH_SYNTH7_LOOP_IP_MSB 8 -#define SYNTH_SYNTH7_LOOP_IP_LSB 5 -#define SYNTH_SYNTH7_LOOP_IP_MASK 0x000001e0 -#define SYNTH_SYNTH7_LOOP_IP_GET(x) (((x) & SYNTH_SYNTH7_LOOP_IP_MASK) >> SYNTH_SYNTH7_LOOP_IP_LSB) -#define SYNTH_SYNTH7_LOOP_IP_SET(x) (((x) << SYNTH_SYNTH7_LOOP_IP_LSB) & SYNTH_SYNTH7_LOOP_IP_MASK) -#define SYNTH_SYNTH7_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH7_LOBUF5GTUNE_LSB 3 -#define SYNTH_SYNTH7_LOBUF5GTUNE_MASK 0x00000018 -#define SYNTH_SYNTH7_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH7_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH7_LOBUF5GTUNE_SET(x) (((x) << SYNTH_SYNTH7_LOBUF5GTUNE_LSB) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH7_SPARE_READ_MSB 2 -#define SYNTH_SYNTH7_SPARE_READ_LSB 0 -#define SYNTH_SYNTH7_SPARE_READ_MASK 0x00000007 -#define SYNTH_SYNTH7_SPARE_READ_GET(x) (((x) & SYNTH_SYNTH7_SPARE_READ_MASK) >> SYNTH_SYNTH7_SPARE_READ_LSB) -#define SYNTH_SYNTH7_SPARE_READ_SET(x) (((x) << SYNTH_SYNTH7_SPARE_READ_LSB) & SYNTH_SYNTH7_SPARE_READ_MASK) - -#define SYNTH_SYNTH8_ADDRESS 0x0000001c -#define SYNTH_SYNTH8_OFFSET 0x0000001c -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK 0x80000000 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_GET(x) (((x) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) >> SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_SET(x) (((x) << SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) -#define SYNTH_SYNTH8_FRACMODE_MSB 30 -#define SYNTH_SYNTH8_FRACMODE_LSB 30 -#define SYNTH_SYNTH8_FRACMODE_MASK 0x40000000 -#define SYNTH_SYNTH8_FRACMODE_GET(x) (((x) & SYNTH_SYNTH8_FRACMODE_MASK) >> SYNTH_SYNTH8_FRACMODE_LSB) -#define SYNTH_SYNTH8_FRACMODE_SET(x) (((x) << SYNTH_SYNTH8_FRACMODE_LSB) & SYNTH_SYNTH8_FRACMODE_MASK) -#define SYNTH_SYNTH8_AMODEREFSEL_MSB 29 -#define SYNTH_SYNTH8_AMODEREFSEL_LSB 28 -#define SYNTH_SYNTH8_AMODEREFSEL_MASK 0x30000000 -#define SYNTH_SYNTH8_AMODEREFSEL_GET(x) (((x) & SYNTH_SYNTH8_AMODEREFSEL_MASK) >> SYNTH_SYNTH8_AMODEREFSEL_LSB) -#define SYNTH_SYNTH8_AMODEREFSEL_SET(x) (((x) << SYNTH_SYNTH8_AMODEREFSEL_LSB) & SYNTH_SYNTH8_AMODEREFSEL_MASK) -#define SYNTH_SYNTH8_SPARE_MSB 27 -#define SYNTH_SYNTH8_SPARE_LSB 27 -#define SYNTH_SYNTH8_SPARE_MASK 0x08000000 -#define SYNTH_SYNTH8_SPARE_GET(x) (((x) & SYNTH_SYNTH8_SPARE_MASK) >> SYNTH_SYNTH8_SPARE_LSB) -#define SYNTH_SYNTH8_SPARE_SET(x) (((x) << SYNTH_SYNTH8_SPARE_LSB) & SYNTH_SYNTH8_SPARE_MASK) -#define SYNTH_SYNTH8_CHANSEL_MSB 26 -#define SYNTH_SYNTH8_CHANSEL_LSB 18 -#define SYNTH_SYNTH8_CHANSEL_MASK 0x07fc0000 -#define SYNTH_SYNTH8_CHANSEL_GET(x) (((x) & SYNTH_SYNTH8_CHANSEL_MASK) >> SYNTH_SYNTH8_CHANSEL_LSB) -#define SYNTH_SYNTH8_CHANSEL_SET(x) (((x) << SYNTH_SYNTH8_CHANSEL_LSB) & SYNTH_SYNTH8_CHANSEL_MASK) -#define SYNTH_SYNTH8_CHANFRAC_MSB 17 -#define SYNTH_SYNTH8_CHANFRAC_LSB 1 -#define SYNTH_SYNTH8_CHANFRAC_MASK 0x0003fffe -#define SYNTH_SYNTH8_CHANFRAC_GET(x) (((x) & SYNTH_SYNTH8_CHANFRAC_MASK) >> SYNTH_SYNTH8_CHANFRAC_LSB) -#define SYNTH_SYNTH8_CHANFRAC_SET(x) (((x) << SYNTH_SYNTH8_CHANFRAC_LSB) & SYNTH_SYNTH8_CHANFRAC_MASK) -#define SYNTH_SYNTH8_FORCE_FRACLSB_MSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_LSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_MASK 0x00000001 -#define SYNTH_SYNTH8_FORCE_FRACLSB_GET(x) (((x) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) >> SYNTH_SYNTH8_FORCE_FRACLSB_LSB) -#define SYNTH_SYNTH8_FORCE_FRACLSB_SET(x) (((x) << SYNTH_SYNTH8_FORCE_FRACLSB_LSB) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) - -#define RF5G_RF5G1_ADDRESS 0x00000020 -#define RF5G_RF5G1_OFFSET 0x00000020 -#define RF5G_RF5G1_PDTXLO5_MSB 31 -#define RF5G_RF5G1_PDTXLO5_LSB 31 -#define RF5G_RF5G1_PDTXLO5_MASK 0x80000000 -#define RF5G_RF5G1_PDTXLO5_GET(x) (((x) & RF5G_RF5G1_PDTXLO5_MASK) >> RF5G_RF5G1_PDTXLO5_LSB) -#define RF5G_RF5G1_PDTXLO5_SET(x) (((x) << RF5G_RF5G1_PDTXLO5_LSB) & RF5G_RF5G1_PDTXLO5_MASK) -#define RF5G_RF5G1_PDTXMIX5_MSB 30 -#define RF5G_RF5G1_PDTXMIX5_LSB 30 -#define RF5G_RF5G1_PDTXMIX5_MASK 0x40000000 -#define RF5G_RF5G1_PDTXMIX5_GET(x) (((x) & RF5G_RF5G1_PDTXMIX5_MASK) >> RF5G_RF5G1_PDTXMIX5_LSB) -#define RF5G_RF5G1_PDTXMIX5_SET(x) (((x) << RF5G_RF5G1_PDTXMIX5_LSB) & RF5G_RF5G1_PDTXMIX5_MASK) -#define RF5G_RF5G1_PDTXBUF5_MSB 29 -#define RF5G_RF5G1_PDTXBUF5_LSB 29 -#define RF5G_RF5G1_PDTXBUF5_MASK 0x20000000 -#define RF5G_RF5G1_PDTXBUF5_GET(x) (((x) & RF5G_RF5G1_PDTXBUF5_MASK) >> RF5G_RF5G1_PDTXBUF5_LSB) -#define RF5G_RF5G1_PDTXBUF5_SET(x) (((x) << RF5G_RF5G1_PDTXBUF5_LSB) & RF5G_RF5G1_PDTXBUF5_MASK) -#define RF5G_RF5G1_PDPADRV5_MSB 28 -#define RF5G_RF5G1_PDPADRV5_LSB 28 -#define RF5G_RF5G1_PDPADRV5_MASK 0x10000000 -#define RF5G_RF5G1_PDPADRV5_GET(x) (((x) & RF5G_RF5G1_PDPADRV5_MASK) >> RF5G_RF5G1_PDPADRV5_LSB) -#define RF5G_RF5G1_PDPADRV5_SET(x) (((x) << RF5G_RF5G1_PDPADRV5_LSB) & RF5G_RF5G1_PDPADRV5_MASK) -#define RF5G_RF5G1_PDPAOUT5_MSB 27 -#define RF5G_RF5G1_PDPAOUT5_LSB 27 -#define RF5G_RF5G1_PDPAOUT5_MASK 0x08000000 -#define RF5G_RF5G1_PDPAOUT5_GET(x) (((x) & RF5G_RF5G1_PDPAOUT5_MASK) >> RF5G_RF5G1_PDPAOUT5_LSB) -#define RF5G_RF5G1_PDPAOUT5_SET(x) (((x) << RF5G_RF5G1_PDPAOUT5_LSB) & RF5G_RF5G1_PDPAOUT5_MASK) -#define RF5G_RF5G1_TUNE_PADRV5_MSB 26 -#define RF5G_RF5G1_TUNE_PADRV5_LSB 24 -#define RF5G_RF5G1_TUNE_PADRV5_MASK 0x07000000 -#define RF5G_RF5G1_TUNE_PADRV5_GET(x) (((x) & RF5G_RF5G1_TUNE_PADRV5_MASK) >> RF5G_RF5G1_TUNE_PADRV5_LSB) -#define RF5G_RF5G1_TUNE_PADRV5_SET(x) (((x) << RF5G_RF5G1_TUNE_PADRV5_LSB) & RF5G_RF5G1_TUNE_PADRV5_MASK) -#define RF5G_RF5G1_PWDTXPKD_MSB 23 -#define RF5G_RF5G1_PWDTXPKD_LSB 21 -#define RF5G_RF5G1_PWDTXPKD_MASK 0x00e00000 -#define RF5G_RF5G1_PWDTXPKD_GET(x) (((x) & RF5G_RF5G1_PWDTXPKD_MASK) >> RF5G_RF5G1_PWDTXPKD_LSB) -#define RF5G_RF5G1_PWDTXPKD_SET(x) (((x) << RF5G_RF5G1_PWDTXPKD_LSB) & RF5G_RF5G1_PWDTXPKD_MASK) -#define RF5G_RF5G1_DB5_MSB 20 -#define RF5G_RF5G1_DB5_LSB 18 -#define RF5G_RF5G1_DB5_MASK 0x001c0000 -#define RF5G_RF5G1_DB5_GET(x) (((x) & RF5G_RF5G1_DB5_MASK) >> RF5G_RF5G1_DB5_LSB) -#define RF5G_RF5G1_DB5_SET(x) (((x) << RF5G_RF5G1_DB5_LSB) & RF5G_RF5G1_DB5_MASK) -#define RF5G_RF5G1_OB5_MSB 17 -#define RF5G_RF5G1_OB5_LSB 15 -#define RF5G_RF5G1_OB5_MASK 0x00038000 -#define RF5G_RF5G1_OB5_GET(x) (((x) & RF5G_RF5G1_OB5_MASK) >> RF5G_RF5G1_OB5_LSB) -#define RF5G_RF5G1_OB5_SET(x) (((x) << RF5G_RF5G1_OB5_LSB) & RF5G_RF5G1_OB5_MASK) -#define RF5G_RF5G1_TX5_ATB_SEL_MSB 14 -#define RF5G_RF5G1_TX5_ATB_SEL_LSB 12 -#define RF5G_RF5G1_TX5_ATB_SEL_MASK 0x00007000 -#define RF5G_RF5G1_TX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_TX5_ATB_SEL_MASK) >> RF5G_RF5G1_TX5_ATB_SEL_LSB) -#define RF5G_RF5G1_TX5_ATB_SEL_SET(x) (((x) << RF5G_RF5G1_TX5_ATB_SEL_LSB) & RF5G_RF5G1_TX5_ATB_SEL_MASK) -#define RF5G_RF5G1_PDLO5DIV_MSB 11 -#define RF5G_RF5G1_PDLO5DIV_LSB 11 -#define RF5G_RF5G1_PDLO5DIV_MASK 0x00000800 -#define RF5G_RF5G1_PDLO5DIV_GET(x) (((x) & RF5G_RF5G1_PDLO5DIV_MASK) >> RF5G_RF5G1_PDLO5DIV_LSB) -#define RF5G_RF5G1_PDLO5DIV_SET(x) (((x) << RF5G_RF5G1_PDLO5DIV_LSB) & RF5G_RF5G1_PDLO5DIV_MASK) -#define RF5G_RF5G1_PDLO5MIX_MSB 10 -#define RF5G_RF5G1_PDLO5MIX_LSB 10 -#define RF5G_RF5G1_PDLO5MIX_MASK 0x00000400 -#define RF5G_RF5G1_PDLO5MIX_GET(x) (((x) & RF5G_RF5G1_PDLO5MIX_MASK) >> RF5G_RF5G1_PDLO5MIX_LSB) -#define RF5G_RF5G1_PDLO5MIX_SET(x) (((x) << RF5G_RF5G1_PDLO5MIX_LSB) & RF5G_RF5G1_PDLO5MIX_MASK) -#define RF5G_RF5G1_PDQBUF5_MSB 9 -#define RF5G_RF5G1_PDQBUF5_LSB 9 -#define RF5G_RF5G1_PDQBUF5_MASK 0x00000200 -#define RF5G_RF5G1_PDQBUF5_GET(x) (((x) & RF5G_RF5G1_PDQBUF5_MASK) >> RF5G_RF5G1_PDQBUF5_LSB) -#define RF5G_RF5G1_PDQBUF5_SET(x) (((x) << RF5G_RF5G1_PDQBUF5_LSB) & RF5G_RF5G1_PDQBUF5_MASK) -#define RF5G_RF5G1_PDLO5AGC_MSB 8 -#define RF5G_RF5G1_PDLO5AGC_LSB 8 -#define RF5G_RF5G1_PDLO5AGC_MASK 0x00000100 -#define RF5G_RF5G1_PDLO5AGC_GET(x) (((x) & RF5G_RF5G1_PDLO5AGC_MASK) >> RF5G_RF5G1_PDLO5AGC_LSB) -#define RF5G_RF5G1_PDLO5AGC_SET(x) (((x) << RF5G_RF5G1_PDLO5AGC_LSB) & RF5G_RF5G1_PDLO5AGC_MASK) -#define RF5G_RF5G1_PDREGLO5_MSB 7 -#define RF5G_RF5G1_PDREGLO5_LSB 7 -#define RF5G_RF5G1_PDREGLO5_MASK 0x00000080 -#define RF5G_RF5G1_PDREGLO5_GET(x) (((x) & RF5G_RF5G1_PDREGLO5_MASK) >> RF5G_RF5G1_PDREGLO5_LSB) -#define RF5G_RF5G1_PDREGLO5_SET(x) (((x) << RF5G_RF5G1_PDREGLO5_LSB) & RF5G_RF5G1_PDREGLO5_MASK) -#define RF5G_RF5G1_LO5_ATB_SEL_MSB 6 -#define RF5G_RF5G1_LO5_ATB_SEL_LSB 4 -#define RF5G_RF5G1_LO5_ATB_SEL_MASK 0x00000070 -#define RF5G_RF5G1_LO5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_LO5_ATB_SEL_MASK) >> RF5G_RF5G1_LO5_ATB_SEL_LSB) -#define RF5G_RF5G1_LO5_ATB_SEL_SET(x) (((x) << RF5G_RF5G1_LO5_ATB_SEL_LSB) & RF5G_RF5G1_LO5_ATB_SEL_MASK) -#define RF5G_RF5G1_LO5CONTROL_MSB 3 -#define RF5G_RF5G1_LO5CONTROL_LSB 3 -#define RF5G_RF5G1_LO5CONTROL_MASK 0x00000008 -#define RF5G_RF5G1_LO5CONTROL_GET(x) (((x) & RF5G_RF5G1_LO5CONTROL_MASK) >> RF5G_RF5G1_LO5CONTROL_LSB) -#define RF5G_RF5G1_LO5CONTROL_SET(x) (((x) << RF5G_RF5G1_LO5CONTROL_LSB) & RF5G_RF5G1_LO5CONTROL_MASK) -#define RF5G_RF5G1_REGLO_BYPASS5_MSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_LSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_MASK 0x00000004 -#define RF5G_RF5G1_REGLO_BYPASS5_GET(x) (((x) & RF5G_RF5G1_REGLO_BYPASS5_MASK) >> RF5G_RF5G1_REGLO_BYPASS5_LSB) -#define RF5G_RF5G1_REGLO_BYPASS5_SET(x) (((x) << RF5G_RF5G1_REGLO_BYPASS5_LSB) & RF5G_RF5G1_REGLO_BYPASS5_MASK) -#define RF5G_RF5G1_SPARE_MSB 1 -#define RF5G_RF5G1_SPARE_LSB 0 -#define RF5G_RF5G1_SPARE_MASK 0x00000003 -#define RF5G_RF5G1_SPARE_GET(x) (((x) & RF5G_RF5G1_SPARE_MASK) >> RF5G_RF5G1_SPARE_LSB) -#define RF5G_RF5G1_SPARE_SET(x) (((x) << RF5G_RF5G1_SPARE_LSB) & RF5G_RF5G1_SPARE_MASK) - -#define RF5G_RF5G2_ADDRESS 0x00000024 -#define RF5G_RF5G2_OFFSET 0x00000024 -#define RF5G_RF5G2_AGCLO_B_MSB 31 -#define RF5G_RF5G2_AGCLO_B_LSB 29 -#define RF5G_RF5G2_AGCLO_B_MASK 0xe0000000 -#define RF5G_RF5G2_AGCLO_B_GET(x) (((x) & RF5G_RF5G2_AGCLO_B_MASK) >> RF5G_RF5G2_AGCLO_B_LSB) -#define RF5G_RF5G2_AGCLO_B_SET(x) (((x) << RF5G_RF5G2_AGCLO_B_LSB) & RF5G_RF5G2_AGCLO_B_MASK) -#define RF5G_RF5G2_RX5_ATB_SEL_MSB 28 -#define RF5G_RF5G2_RX5_ATB_SEL_LSB 26 -#define RF5G_RF5G2_RX5_ATB_SEL_MASK 0x1c000000 -#define RF5G_RF5G2_RX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G2_RX5_ATB_SEL_MASK) >> RF5G_RF5G2_RX5_ATB_SEL_LSB) -#define RF5G_RF5G2_RX5_ATB_SEL_SET(x) (((x) << RF5G_RF5G2_RX5_ATB_SEL_LSB) & RF5G_RF5G2_RX5_ATB_SEL_MASK) -#define RF5G_RF5G2_PDCMOSLO5_MSB 25 -#define RF5G_RF5G2_PDCMOSLO5_LSB 25 -#define RF5G_RF5G2_PDCMOSLO5_MASK 0x02000000 -#define RF5G_RF5G2_PDCMOSLO5_GET(x) (((x) & RF5G_RF5G2_PDCMOSLO5_MASK) >> RF5G_RF5G2_PDCMOSLO5_LSB) -#define RF5G_RF5G2_PDCMOSLO5_SET(x) (((x) << RF5G_RF5G2_PDCMOSLO5_LSB) & RF5G_RF5G2_PDCMOSLO5_MASK) -#define RF5G_RF5G2_PDVGM5_MSB 24 -#define RF5G_RF5G2_PDVGM5_LSB 24 -#define RF5G_RF5G2_PDVGM5_MASK 0x01000000 -#define RF5G_RF5G2_PDVGM5_GET(x) (((x) & RF5G_RF5G2_PDVGM5_MASK) >> RF5G_RF5G2_PDVGM5_LSB) -#define RF5G_RF5G2_PDVGM5_SET(x) (((x) << RF5G_RF5G2_PDVGM5_LSB) & RF5G_RF5G2_PDVGM5_MASK) -#define RF5G_RF5G2_PDCSLNA5_MSB 23 -#define RF5G_RF5G2_PDCSLNA5_LSB 23 -#define RF5G_RF5G2_PDCSLNA5_MASK 0x00800000 -#define RF5G_RF5G2_PDCSLNA5_GET(x) (((x) & RF5G_RF5G2_PDCSLNA5_MASK) >> RF5G_RF5G2_PDCSLNA5_LSB) -#define RF5G_RF5G2_PDCSLNA5_SET(x) (((x) << RF5G_RF5G2_PDCSLNA5_LSB) & RF5G_RF5G2_PDCSLNA5_MASK) -#define RF5G_RF5G2_PDRFVGA5_MSB 22 -#define RF5G_RF5G2_PDRFVGA5_LSB 22 -#define RF5G_RF5G2_PDRFVGA5_MASK 0x00400000 -#define RF5G_RF5G2_PDRFVGA5_GET(x) (((x) & RF5G_RF5G2_PDRFVGA5_MASK) >> RF5G_RF5G2_PDRFVGA5_LSB) -#define RF5G_RF5G2_PDRFVGA5_SET(x) (((x) << RF5G_RF5G2_PDRFVGA5_LSB) & RF5G_RF5G2_PDRFVGA5_MASK) -#define RF5G_RF5G2_PDREGFE5_MSB 21 -#define RF5G_RF5G2_PDREGFE5_LSB 21 -#define RF5G_RF5G2_PDREGFE5_MASK 0x00200000 -#define RF5G_RF5G2_PDREGFE5_GET(x) (((x) & RF5G_RF5G2_PDREGFE5_MASK) >> RF5G_RF5G2_PDREGFE5_LSB) -#define RF5G_RF5G2_PDREGFE5_SET(x) (((x) << RF5G_RF5G2_PDREGFE5_LSB) & RF5G_RF5G2_PDREGFE5_MASK) -#define RF5G_RF5G2_TUNE_RFVGA5_MSB 20 -#define RF5G_RF5G2_TUNE_RFVGA5_LSB 18 -#define RF5G_RF5G2_TUNE_RFVGA5_MASK 0x001c0000 -#define RF5G_RF5G2_TUNE_RFVGA5_GET(x) (((x) & RF5G_RF5G2_TUNE_RFVGA5_MASK) >> RF5G_RF5G2_TUNE_RFVGA5_LSB) -#define RF5G_RF5G2_TUNE_RFVGA5_SET(x) (((x) << RF5G_RF5G2_TUNE_RFVGA5_LSB) & RF5G_RF5G2_TUNE_RFVGA5_MASK) -#define RF5G_RF5G2_BRFVGA5_MSB 17 -#define RF5G_RF5G2_BRFVGA5_LSB 15 -#define RF5G_RF5G2_BRFVGA5_MASK 0x00038000 -#define RF5G_RF5G2_BRFVGA5_GET(x) (((x) & RF5G_RF5G2_BRFVGA5_MASK) >> RF5G_RF5G2_BRFVGA5_LSB) -#define RF5G_RF5G2_BRFVGA5_SET(x) (((x) << RF5G_RF5G2_BRFVGA5_LSB) & RF5G_RF5G2_BRFVGA5_MASK) -#define RF5G_RF5G2_BCSLNA5_MSB 14 -#define RF5G_RF5G2_BCSLNA5_LSB 12 -#define RF5G_RF5G2_BCSLNA5_MASK 0x00007000 -#define RF5G_RF5G2_BCSLNA5_GET(x) (((x) & RF5G_RF5G2_BCSLNA5_MASK) >> RF5G_RF5G2_BCSLNA5_LSB) -#define RF5G_RF5G2_BCSLNA5_SET(x) (((x) << RF5G_RF5G2_BCSLNA5_LSB) & RF5G_RF5G2_BCSLNA5_MASK) -#define RF5G_RF5G2_BVGM5_MSB 11 -#define RF5G_RF5G2_BVGM5_LSB 9 -#define RF5G_RF5G2_BVGM5_MASK 0x00000e00 -#define RF5G_RF5G2_BVGM5_GET(x) (((x) & RF5G_RF5G2_BVGM5_MASK) >> RF5G_RF5G2_BVGM5_LSB) -#define RF5G_RF5G2_BVGM5_SET(x) (((x) << RF5G_RF5G2_BVGM5_LSB) & RF5G_RF5G2_BVGM5_MASK) -#define RF5G_RF5G2_REGFE_BYPASS5_MSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_LSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_MASK 0x00000100 -#define RF5G_RF5G2_REGFE_BYPASS5_GET(x) (((x) & RF5G_RF5G2_REGFE_BYPASS5_MASK) >> RF5G_RF5G2_REGFE_BYPASS5_LSB) -#define RF5G_RF5G2_REGFE_BYPASS5_SET(x) (((x) << RF5G_RF5G2_REGFE_BYPASS5_LSB) & RF5G_RF5G2_REGFE_BYPASS5_MASK) -#define RF5G_RF5G2_LNA5_ATTENMODE_MSB 7 -#define RF5G_RF5G2_LNA5_ATTENMODE_LSB 6 -#define RF5G_RF5G2_LNA5_ATTENMODE_MASK 0x000000c0 -#define RF5G_RF5G2_LNA5_ATTENMODE_GET(x) (((x) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) >> RF5G_RF5G2_LNA5_ATTENMODE_LSB) -#define RF5G_RF5G2_LNA5_ATTENMODE_SET(x) (((x) << RF5G_RF5G2_LNA5_ATTENMODE_LSB) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) -#define RF5G_RF5G2_ENABLE_PCA_MSB 5 -#define RF5G_RF5G2_ENABLE_PCA_LSB 5 -#define RF5G_RF5G2_ENABLE_PCA_MASK 0x00000020 -#define RF5G_RF5G2_ENABLE_PCA_GET(x) (((x) & RF5G_RF5G2_ENABLE_PCA_MASK) >> RF5G_RF5G2_ENABLE_PCA_LSB) -#define RF5G_RF5G2_ENABLE_PCA_SET(x) (((x) << RF5G_RF5G2_ENABLE_PCA_LSB) & RF5G_RF5G2_ENABLE_PCA_MASK) -#define RF5G_RF5G2_TUNE_LO_MSB 4 -#define RF5G_RF5G2_TUNE_LO_LSB 2 -#define RF5G_RF5G2_TUNE_LO_MASK 0x0000001c -#define RF5G_RF5G2_TUNE_LO_GET(x) (((x) & RF5G_RF5G2_TUNE_LO_MASK) >> RF5G_RF5G2_TUNE_LO_LSB) -#define RF5G_RF5G2_TUNE_LO_SET(x) (((x) << RF5G_RF5G2_TUNE_LO_LSB) & RF5G_RF5G2_TUNE_LO_MASK) -#define RF5G_RF5G2_SPARE_MSB 1 -#define RF5G_RF5G2_SPARE_LSB 0 -#define RF5G_RF5G2_SPARE_MASK 0x00000003 -#define RF5G_RF5G2_SPARE_GET(x) (((x) & RF5G_RF5G2_SPARE_MASK) >> RF5G_RF5G2_SPARE_LSB) -#define RF5G_RF5G2_SPARE_SET(x) (((x) << RF5G_RF5G2_SPARE_LSB) & RF5G_RF5G2_SPARE_MASK) - -#define RF2G_RF2G1_ADDRESS 0x00000028 -#define RF2G_RF2G1_OFFSET 0x00000028 -#define RF2G_RF2G1_BLNA1_MSB 31 -#define RF2G_RF2G1_BLNA1_LSB 29 -#define RF2G_RF2G1_BLNA1_MASK 0xe0000000 -#define RF2G_RF2G1_BLNA1_GET(x) (((x) & RF2G_RF2G1_BLNA1_MASK) >> RF2G_RF2G1_BLNA1_LSB) -#define RF2G_RF2G1_BLNA1_SET(x) (((x) << RF2G_RF2G1_BLNA1_LSB) & RF2G_RF2G1_BLNA1_MASK) -#define RF2G_RF2G1_BLNA1F_MSB 28 -#define RF2G_RF2G1_BLNA1F_LSB 26 -#define RF2G_RF2G1_BLNA1F_MASK 0x1c000000 -#define RF2G_RF2G1_BLNA1F_GET(x) (((x) & RF2G_RF2G1_BLNA1F_MASK) >> RF2G_RF2G1_BLNA1F_LSB) -#define RF2G_RF2G1_BLNA1F_SET(x) (((x) << RF2G_RF2G1_BLNA1F_LSB) & RF2G_RF2G1_BLNA1F_MASK) -#define RF2G_RF2G1_BLNA1BUF_MSB 25 -#define RF2G_RF2G1_BLNA1BUF_LSB 23 -#define RF2G_RF2G1_BLNA1BUF_MASK 0x03800000 -#define RF2G_RF2G1_BLNA1BUF_GET(x) (((x) & RF2G_RF2G1_BLNA1BUF_MASK) >> RF2G_RF2G1_BLNA1BUF_LSB) -#define RF2G_RF2G1_BLNA1BUF_SET(x) (((x) << RF2G_RF2G1_BLNA1BUF_LSB) & RF2G_RF2G1_BLNA1BUF_MASK) -#define RF2G_RF2G1_BLNA2_MSB 22 -#define RF2G_RF2G1_BLNA2_LSB 20 -#define RF2G_RF2G1_BLNA2_MASK 0x00700000 -#define RF2G_RF2G1_BLNA2_GET(x) (((x) & RF2G_RF2G1_BLNA2_MASK) >> RF2G_RF2G1_BLNA2_LSB) -#define RF2G_RF2G1_BLNA2_SET(x) (((x) << RF2G_RF2G1_BLNA2_LSB) & RF2G_RF2G1_BLNA2_MASK) -#define RF2G_RF2G1_DB_MSB 19 -#define RF2G_RF2G1_DB_LSB 17 -#define RF2G_RF2G1_DB_MASK 0x000e0000 -#define RF2G_RF2G1_DB_GET(x) (((x) & RF2G_RF2G1_DB_MASK) >> RF2G_RF2G1_DB_LSB) -#define RF2G_RF2G1_DB_SET(x) (((x) << RF2G_RF2G1_DB_LSB) & RF2G_RF2G1_DB_MASK) -#define RF2G_RF2G1_OB_MSB 16 -#define RF2G_RF2G1_OB_LSB 14 -#define RF2G_RF2G1_OB_MASK 0x0001c000 -#define RF2G_RF2G1_OB_GET(x) (((x) & RF2G_RF2G1_OB_MASK) >> RF2G_RF2G1_OB_LSB) -#define RF2G_RF2G1_OB_SET(x) (((x) << RF2G_RF2G1_OB_LSB) & RF2G_RF2G1_OB_MASK) -#define RF2G_RF2G1_FE_ATB_SEL_MSB 13 -#define RF2G_RF2G1_FE_ATB_SEL_LSB 11 -#define RF2G_RF2G1_FE_ATB_SEL_MASK 0x00003800 -#define RF2G_RF2G1_FE_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_FE_ATB_SEL_MASK) >> RF2G_RF2G1_FE_ATB_SEL_LSB) -#define RF2G_RF2G1_FE_ATB_SEL_SET(x) (((x) << RF2G_RF2G1_FE_ATB_SEL_LSB) & RF2G_RF2G1_FE_ATB_SEL_MASK) -#define RF2G_RF2G1_RF_ATB_SEL_MSB 10 -#define RF2G_RF2G1_RF_ATB_SEL_LSB 8 -#define RF2G_RF2G1_RF_ATB_SEL_MASK 0x00000700 -#define RF2G_RF2G1_RF_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_RF_ATB_SEL_MASK) >> RF2G_RF2G1_RF_ATB_SEL_LSB) -#define RF2G_RF2G1_RF_ATB_SEL_SET(x) (((x) << RF2G_RF2G1_RF_ATB_SEL_LSB) & RF2G_RF2G1_RF_ATB_SEL_MASK) -#define RF2G_RF2G1_SELLNA_MSB 7 -#define RF2G_RF2G1_SELLNA_LSB 7 -#define RF2G_RF2G1_SELLNA_MASK 0x00000080 -#define RF2G_RF2G1_SELLNA_GET(x) (((x) & RF2G_RF2G1_SELLNA_MASK) >> RF2G_RF2G1_SELLNA_LSB) -#define RF2G_RF2G1_SELLNA_SET(x) (((x) << RF2G_RF2G1_SELLNA_LSB) & RF2G_RF2G1_SELLNA_MASK) -#define RF2G_RF2G1_LOCONTROL_MSB 6 -#define RF2G_RF2G1_LOCONTROL_LSB 6 -#define RF2G_RF2G1_LOCONTROL_MASK 0x00000040 -#define RF2G_RF2G1_LOCONTROL_GET(x) (((x) & RF2G_RF2G1_LOCONTROL_MASK) >> RF2G_RF2G1_LOCONTROL_LSB) -#define RF2G_RF2G1_LOCONTROL_SET(x) (((x) << RF2G_RF2G1_LOCONTROL_LSB) & RF2G_RF2G1_LOCONTROL_MASK) -#define RF2G_RF2G1_SHORTLNA2_MSB 5 -#define RF2G_RF2G1_SHORTLNA2_LSB 5 -#define RF2G_RF2G1_SHORTLNA2_MASK 0x00000020 -#define RF2G_RF2G1_SHORTLNA2_GET(x) (((x) & RF2G_RF2G1_SHORTLNA2_MASK) >> RF2G_RF2G1_SHORTLNA2_LSB) -#define RF2G_RF2G1_SHORTLNA2_SET(x) (((x) << RF2G_RF2G1_SHORTLNA2_LSB) & RF2G_RF2G1_SHORTLNA2_MASK) -#define RF2G_RF2G1_SPARE_MSB 4 -#define RF2G_RF2G1_SPARE_LSB 0 -#define RF2G_RF2G1_SPARE_MASK 0x0000001f -#define RF2G_RF2G1_SPARE_GET(x) (((x) & RF2G_RF2G1_SPARE_MASK) >> RF2G_RF2G1_SPARE_LSB) -#define RF2G_RF2G1_SPARE_SET(x) (((x) << RF2G_RF2G1_SPARE_LSB) & RF2G_RF2G1_SPARE_MASK) - -#define RF2G_RF2G2_ADDRESS 0x0000002c -#define RF2G_RF2G2_OFFSET 0x0000002c -#define RF2G_RF2G2_PDCGLNA_MSB 31 -#define RF2G_RF2G2_PDCGLNA_LSB 31 -#define RF2G_RF2G2_PDCGLNA_MASK 0x80000000 -#define RF2G_RF2G2_PDCGLNA_GET(x) (((x) & RF2G_RF2G2_PDCGLNA_MASK) >> RF2G_RF2G2_PDCGLNA_LSB) -#define RF2G_RF2G2_PDCGLNA_SET(x) (((x) << RF2G_RF2G2_PDCGLNA_LSB) & RF2G_RF2G2_PDCGLNA_MASK) -#define RF2G_RF2G2_PDCGLNABUF_MSB 30 -#define RF2G_RF2G2_PDCGLNABUF_LSB 30 -#define RF2G_RF2G2_PDCGLNABUF_MASK 0x40000000 -#define RF2G_RF2G2_PDCGLNABUF_GET(x) (((x) & RF2G_RF2G2_PDCGLNABUF_MASK) >> RF2G_RF2G2_PDCGLNABUF_LSB) -#define RF2G_RF2G2_PDCGLNABUF_SET(x) (((x) << RF2G_RF2G2_PDCGLNABUF_LSB) & RF2G_RF2G2_PDCGLNABUF_MASK) -#define RF2G_RF2G2_PDCSLNA_MSB 29 -#define RF2G_RF2G2_PDCSLNA_LSB 29 -#define RF2G_RF2G2_PDCSLNA_MASK 0x20000000 -#define RF2G_RF2G2_PDCSLNA_GET(x) (((x) & RF2G_RF2G2_PDCSLNA_MASK) >> RF2G_RF2G2_PDCSLNA_LSB) -#define RF2G_RF2G2_PDCSLNA_SET(x) (((x) << RF2G_RF2G2_PDCSLNA_LSB) & RF2G_RF2G2_PDCSLNA_MASK) -#define RF2G_RF2G2_PDDIV_MSB 28 -#define RF2G_RF2G2_PDDIV_LSB 28 -#define RF2G_RF2G2_PDDIV_MASK 0x10000000 -#define RF2G_RF2G2_PDDIV_GET(x) (((x) & RF2G_RF2G2_PDDIV_MASK) >> RF2G_RF2G2_PDDIV_LSB) -#define RF2G_RF2G2_PDDIV_SET(x) (((x) << RF2G_RF2G2_PDDIV_LSB) & RF2G_RF2G2_PDDIV_MASK) -#define RF2G_RF2G2_PDPADRV_MSB 27 -#define RF2G_RF2G2_PDPADRV_LSB 27 -#define RF2G_RF2G2_PDPADRV_MASK 0x08000000 -#define RF2G_RF2G2_PDPADRV_GET(x) (((x) & RF2G_RF2G2_PDPADRV_MASK) >> RF2G_RF2G2_PDPADRV_LSB) -#define RF2G_RF2G2_PDPADRV_SET(x) (((x) << RF2G_RF2G2_PDPADRV_LSB) & RF2G_RF2G2_PDPADRV_MASK) -#define RF2G_RF2G2_PDPAOUT_MSB 26 -#define RF2G_RF2G2_PDPAOUT_LSB 26 -#define RF2G_RF2G2_PDPAOUT_MASK 0x04000000 -#define RF2G_RF2G2_PDPAOUT_GET(x) (((x) & RF2G_RF2G2_PDPAOUT_MASK) >> RF2G_RF2G2_PDPAOUT_LSB) -#define RF2G_RF2G2_PDPAOUT_SET(x) (((x) << RF2G_RF2G2_PDPAOUT_LSB) & RF2G_RF2G2_PDPAOUT_MASK) -#define RF2G_RF2G2_PDREGLNA_MSB 25 -#define RF2G_RF2G2_PDREGLNA_LSB 25 -#define RF2G_RF2G2_PDREGLNA_MASK 0x02000000 -#define RF2G_RF2G2_PDREGLNA_GET(x) (((x) & RF2G_RF2G2_PDREGLNA_MASK) >> RF2G_RF2G2_PDREGLNA_LSB) -#define RF2G_RF2G2_PDREGLNA_SET(x) (((x) << RF2G_RF2G2_PDREGLNA_LSB) & RF2G_RF2G2_PDREGLNA_MASK) -#define RF2G_RF2G2_PDREGLO_MSB 24 -#define RF2G_RF2G2_PDREGLO_LSB 24 -#define RF2G_RF2G2_PDREGLO_MASK 0x01000000 -#define RF2G_RF2G2_PDREGLO_GET(x) (((x) & RF2G_RF2G2_PDREGLO_MASK) >> RF2G_RF2G2_PDREGLO_LSB) -#define RF2G_RF2G2_PDREGLO_SET(x) (((x) << RF2G_RF2G2_PDREGLO_LSB) & RF2G_RF2G2_PDREGLO_MASK) -#define RF2G_RF2G2_PDRFGM_MSB 23 -#define RF2G_RF2G2_PDRFGM_LSB 23 -#define RF2G_RF2G2_PDRFGM_MASK 0x00800000 -#define RF2G_RF2G2_PDRFGM_GET(x) (((x) & RF2G_RF2G2_PDRFGM_MASK) >> RF2G_RF2G2_PDRFGM_LSB) -#define RF2G_RF2G2_PDRFGM_SET(x) (((x) << RF2G_RF2G2_PDRFGM_LSB) & RF2G_RF2G2_PDRFGM_MASK) -#define RF2G_RF2G2_PDRXLO_MSB 22 -#define RF2G_RF2G2_PDRXLO_LSB 22 -#define RF2G_RF2G2_PDRXLO_MASK 0x00400000 -#define RF2G_RF2G2_PDRXLO_GET(x) (((x) & RF2G_RF2G2_PDRXLO_MASK) >> RF2G_RF2G2_PDRXLO_LSB) -#define RF2G_RF2G2_PDRXLO_SET(x) (((x) << RF2G_RF2G2_PDRXLO_LSB) & RF2G_RF2G2_PDRXLO_MASK) -#define RF2G_RF2G2_PDTXLO_MSB 21 -#define RF2G_RF2G2_PDTXLO_LSB 21 -#define RF2G_RF2G2_PDTXLO_MASK 0x00200000 -#define RF2G_RF2G2_PDTXLO_GET(x) (((x) & RF2G_RF2G2_PDTXLO_MASK) >> RF2G_RF2G2_PDTXLO_LSB) -#define RF2G_RF2G2_PDTXLO_SET(x) (((x) << RF2G_RF2G2_PDTXLO_LSB) & RF2G_RF2G2_PDTXLO_MASK) -#define RF2G_RF2G2_PDTXMIX_MSB 20 -#define RF2G_RF2G2_PDTXMIX_LSB 20 -#define RF2G_RF2G2_PDTXMIX_MASK 0x00100000 -#define RF2G_RF2G2_PDTXMIX_GET(x) (((x) & RF2G_RF2G2_PDTXMIX_MASK) >> RF2G_RF2G2_PDTXMIX_LSB) -#define RF2G_RF2G2_PDTXMIX_SET(x) (((x) << RF2G_RF2G2_PDTXMIX_LSB) & RF2G_RF2G2_PDTXMIX_MASK) -#define RF2G_RF2G2_REGLNA_BYPASS_MSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_LSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_MASK 0x00080000 -#define RF2G_RF2G2_REGLNA_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLNA_BYPASS_MASK) >> RF2G_RF2G2_REGLNA_BYPASS_LSB) -#define RF2G_RF2G2_REGLNA_BYPASS_SET(x) (((x) << RF2G_RF2G2_REGLNA_BYPASS_LSB) & RF2G_RF2G2_REGLNA_BYPASS_MASK) -#define RF2G_RF2G2_REGLO_BYPASS_MSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_LSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_MASK 0x00040000 -#define RF2G_RF2G2_REGLO_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLO_BYPASS_MASK) >> RF2G_RF2G2_REGLO_BYPASS_LSB) -#define RF2G_RF2G2_REGLO_BYPASS_SET(x) (((x) << RF2G_RF2G2_REGLO_BYPASS_LSB) & RF2G_RF2G2_REGLO_BYPASS_MASK) -#define RF2G_RF2G2_ENABLE_PCB_MSB 17 -#define RF2G_RF2G2_ENABLE_PCB_LSB 17 -#define RF2G_RF2G2_ENABLE_PCB_MASK 0x00020000 -#define RF2G_RF2G2_ENABLE_PCB_GET(x) (((x) & RF2G_RF2G2_ENABLE_PCB_MASK) >> RF2G_RF2G2_ENABLE_PCB_LSB) -#define RF2G_RF2G2_ENABLE_PCB_SET(x) (((x) << RF2G_RF2G2_ENABLE_PCB_LSB) & RF2G_RF2G2_ENABLE_PCB_MASK) -#define RF2G_RF2G2_SPARE_MSB 16 -#define RF2G_RF2G2_SPARE_LSB 0 -#define RF2G_RF2G2_SPARE_MASK 0x0001ffff -#define RF2G_RF2G2_SPARE_GET(x) (((x) & RF2G_RF2G2_SPARE_MASK) >> RF2G_RF2G2_SPARE_LSB) -#define RF2G_RF2G2_SPARE_SET(x) (((x) << RF2G_RF2G2_SPARE_LSB) & RF2G_RF2G2_SPARE_MASK) - -#define TOP_GAIN_ADDRESS 0x00000030 -#define TOP_GAIN_OFFSET 0x00000030 -#define TOP_GAIN_TX6DBLOQGAIN_MSB 31 -#define TOP_GAIN_TX6DBLOQGAIN_LSB 30 -#define TOP_GAIN_TX6DBLOQGAIN_MASK 0xc0000000 -#define TOP_GAIN_TX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX6DBLOQGAIN_MASK) >> TOP_GAIN_TX6DBLOQGAIN_LSB) -#define TOP_GAIN_TX6DBLOQGAIN_SET(x) (((x) << TOP_GAIN_TX6DBLOQGAIN_LSB) & TOP_GAIN_TX6DBLOQGAIN_MASK) -#define TOP_GAIN_TX1DBLOQGAIN_MSB 29 -#define TOP_GAIN_TX1DBLOQGAIN_LSB 27 -#define TOP_GAIN_TX1DBLOQGAIN_MASK 0x38000000 -#define TOP_GAIN_TX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX1DBLOQGAIN_MASK) >> TOP_GAIN_TX1DBLOQGAIN_LSB) -#define TOP_GAIN_TX1DBLOQGAIN_SET(x) (((x) << TOP_GAIN_TX1DBLOQGAIN_LSB) & TOP_GAIN_TX1DBLOQGAIN_MASK) -#define TOP_GAIN_TXV2IGAIN_MSB 26 -#define TOP_GAIN_TXV2IGAIN_LSB 25 -#define TOP_GAIN_TXV2IGAIN_MASK 0x06000000 -#define TOP_GAIN_TXV2IGAIN_GET(x) (((x) & TOP_GAIN_TXV2IGAIN_MASK) >> TOP_GAIN_TXV2IGAIN_LSB) -#define TOP_GAIN_TXV2IGAIN_SET(x) (((x) << TOP_GAIN_TXV2IGAIN_LSB) & TOP_GAIN_TXV2IGAIN_MASK) -#define TOP_GAIN_PABUF5GN_MSB 24 -#define TOP_GAIN_PABUF5GN_LSB 24 -#define TOP_GAIN_PABUF5GN_MASK 0x01000000 -#define TOP_GAIN_PABUF5GN_GET(x) (((x) & TOP_GAIN_PABUF5GN_MASK) >> TOP_GAIN_PABUF5GN_LSB) -#define TOP_GAIN_PABUF5GN_SET(x) (((x) << TOP_GAIN_PABUF5GN_LSB) & TOP_GAIN_PABUF5GN_MASK) -#define TOP_GAIN_PADRVGN_MSB 23 -#define TOP_GAIN_PADRVGN_LSB 21 -#define TOP_GAIN_PADRVGN_MASK 0x00e00000 -#define TOP_GAIN_PADRVGN_GET(x) (((x) & TOP_GAIN_PADRVGN_MASK) >> TOP_GAIN_PADRVGN_LSB) -#define TOP_GAIN_PADRVGN_SET(x) (((x) << TOP_GAIN_PADRVGN_LSB) & TOP_GAIN_PADRVGN_MASK) -#define TOP_GAIN_PAOUT2GN_MSB 20 -#define TOP_GAIN_PAOUT2GN_LSB 18 -#define TOP_GAIN_PAOUT2GN_MASK 0x001c0000 -#define TOP_GAIN_PAOUT2GN_GET(x) (((x) & TOP_GAIN_PAOUT2GN_MASK) >> TOP_GAIN_PAOUT2GN_LSB) -#define TOP_GAIN_PAOUT2GN_SET(x) (((x) << TOP_GAIN_PAOUT2GN_LSB) & TOP_GAIN_PAOUT2GN_MASK) -#define TOP_GAIN_LNAON_MSB 17 -#define TOP_GAIN_LNAON_LSB 17 -#define TOP_GAIN_LNAON_MASK 0x00020000 -#define TOP_GAIN_LNAON_GET(x) (((x) & TOP_GAIN_LNAON_MASK) >> TOP_GAIN_LNAON_LSB) -#define TOP_GAIN_LNAON_SET(x) (((x) << TOP_GAIN_LNAON_LSB) & TOP_GAIN_LNAON_MASK) -#define TOP_GAIN_LNAGAIN_MSB 16 -#define TOP_GAIN_LNAGAIN_LSB 13 -#define TOP_GAIN_LNAGAIN_MASK 0x0001e000 -#define TOP_GAIN_LNAGAIN_GET(x) (((x) & TOP_GAIN_LNAGAIN_MASK) >> TOP_GAIN_LNAGAIN_LSB) -#define TOP_GAIN_LNAGAIN_SET(x) (((x) << TOP_GAIN_LNAGAIN_LSB) & TOP_GAIN_LNAGAIN_MASK) -#define TOP_GAIN_RFVGA5GAIN_MSB 12 -#define TOP_GAIN_RFVGA5GAIN_LSB 11 -#define TOP_GAIN_RFVGA5GAIN_MASK 0x00001800 -#define TOP_GAIN_RFVGA5GAIN_GET(x) (((x) & TOP_GAIN_RFVGA5GAIN_MASK) >> TOP_GAIN_RFVGA5GAIN_LSB) -#define TOP_GAIN_RFVGA5GAIN_SET(x) (((x) << TOP_GAIN_RFVGA5GAIN_LSB) & TOP_GAIN_RFVGA5GAIN_MASK) -#define TOP_GAIN_RFGMGN_MSB 10 -#define TOP_GAIN_RFGMGN_LSB 8 -#define TOP_GAIN_RFGMGN_MASK 0x00000700 -#define TOP_GAIN_RFGMGN_GET(x) (((x) & TOP_GAIN_RFGMGN_MASK) >> TOP_GAIN_RFGMGN_LSB) -#define TOP_GAIN_RFGMGN_SET(x) (((x) << TOP_GAIN_RFGMGN_LSB) & TOP_GAIN_RFGMGN_MASK) -#define TOP_GAIN_RX6DBLOQGAIN_MSB 7 -#define TOP_GAIN_RX6DBLOQGAIN_LSB 6 -#define TOP_GAIN_RX6DBLOQGAIN_MASK 0x000000c0 -#define TOP_GAIN_RX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBLOQGAIN_MASK) >> TOP_GAIN_RX6DBLOQGAIN_LSB) -#define TOP_GAIN_RX6DBLOQGAIN_SET(x) (((x) << TOP_GAIN_RX6DBLOQGAIN_LSB) & TOP_GAIN_RX6DBLOQGAIN_MASK) -#define TOP_GAIN_RX1DBLOQGAIN_MSB 5 -#define TOP_GAIN_RX1DBLOQGAIN_LSB 3 -#define TOP_GAIN_RX1DBLOQGAIN_MASK 0x00000038 -#define TOP_GAIN_RX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX1DBLOQGAIN_MASK) >> TOP_GAIN_RX1DBLOQGAIN_LSB) -#define TOP_GAIN_RX1DBLOQGAIN_SET(x) (((x) << TOP_GAIN_RX1DBLOQGAIN_LSB) & TOP_GAIN_RX1DBLOQGAIN_MASK) -#define TOP_GAIN_RX6DBHIQGAIN_MSB 2 -#define TOP_GAIN_RX6DBHIQGAIN_LSB 1 -#define TOP_GAIN_RX6DBHIQGAIN_MASK 0x00000006 -#define TOP_GAIN_RX6DBHIQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBHIQGAIN_MASK) >> TOP_GAIN_RX6DBHIQGAIN_LSB) -#define TOP_GAIN_RX6DBHIQGAIN_SET(x) (((x) << TOP_GAIN_RX6DBHIQGAIN_LSB) & TOP_GAIN_RX6DBHIQGAIN_MASK) -#define TOP_GAIN_SPARE_MSB 0 -#define TOP_GAIN_SPARE_LSB 0 -#define TOP_GAIN_SPARE_MASK 0x00000001 -#define TOP_GAIN_SPARE_GET(x) (((x) & TOP_GAIN_SPARE_MASK) >> TOP_GAIN_SPARE_LSB) -#define TOP_GAIN_SPARE_SET(x) (((x) << TOP_GAIN_SPARE_LSB) & TOP_GAIN_SPARE_MASK) - -#define TOP_TOP_ADDRESS 0x00000034 -#define TOP_TOP_OFFSET 0x00000034 -#define TOP_TOP_LOCALTXGAIN_MSB 31 -#define TOP_TOP_LOCALTXGAIN_LSB 31 -#define TOP_TOP_LOCALTXGAIN_MASK 0x80000000 -#define TOP_TOP_LOCALTXGAIN_GET(x) (((x) & TOP_TOP_LOCALTXGAIN_MASK) >> TOP_TOP_LOCALTXGAIN_LSB) -#define TOP_TOP_LOCALTXGAIN_SET(x) (((x) << TOP_TOP_LOCALTXGAIN_LSB) & TOP_TOP_LOCALTXGAIN_MASK) -#define TOP_TOP_LOCALRXGAIN_MSB 30 -#define TOP_TOP_LOCALRXGAIN_LSB 30 -#define TOP_TOP_LOCALRXGAIN_MASK 0x40000000 -#define TOP_TOP_LOCALRXGAIN_GET(x) (((x) & TOP_TOP_LOCALRXGAIN_MASK) >> TOP_TOP_LOCALRXGAIN_LSB) -#define TOP_TOP_LOCALRXGAIN_SET(x) (((x) << TOP_TOP_LOCALRXGAIN_LSB) & TOP_TOP_LOCALRXGAIN_MASK) -#define TOP_TOP_LOCALMODE_MSB 29 -#define TOP_TOP_LOCALMODE_LSB 29 -#define TOP_TOP_LOCALMODE_MASK 0x20000000 -#define TOP_TOP_LOCALMODE_GET(x) (((x) & TOP_TOP_LOCALMODE_MASK) >> TOP_TOP_LOCALMODE_LSB) -#define TOP_TOP_LOCALMODE_SET(x) (((x) << TOP_TOP_LOCALMODE_LSB) & TOP_TOP_LOCALMODE_MASK) -#define TOP_TOP_CALFC_MSB 28 -#define TOP_TOP_CALFC_LSB 28 -#define TOP_TOP_CALFC_MASK 0x10000000 -#define TOP_TOP_CALFC_GET(x) (((x) & TOP_TOP_CALFC_MASK) >> TOP_TOP_CALFC_LSB) -#define TOP_TOP_CALFC_SET(x) (((x) << TOP_TOP_CALFC_LSB) & TOP_TOP_CALFC_MASK) -#define TOP_TOP_CALDC_MSB 27 -#define TOP_TOP_CALDC_LSB 27 -#define TOP_TOP_CALDC_MASK 0x08000000 -#define TOP_TOP_CALDC_GET(x) (((x) & TOP_TOP_CALDC_MASK) >> TOP_TOP_CALDC_LSB) -#define TOP_TOP_CALDC_SET(x) (((x) << TOP_TOP_CALDC_LSB) & TOP_TOP_CALDC_MASK) -#define TOP_TOP_CAL_RESIDUE_MSB 26 -#define TOP_TOP_CAL_RESIDUE_LSB 26 -#define TOP_TOP_CAL_RESIDUE_MASK 0x04000000 -#define TOP_TOP_CAL_RESIDUE_GET(x) (((x) & TOP_TOP_CAL_RESIDUE_MASK) >> TOP_TOP_CAL_RESIDUE_LSB) -#define TOP_TOP_CAL_RESIDUE_SET(x) (((x) << TOP_TOP_CAL_RESIDUE_LSB) & TOP_TOP_CAL_RESIDUE_MASK) -#define TOP_TOP_BMODE_MSB 25 -#define TOP_TOP_BMODE_LSB 25 -#define TOP_TOP_BMODE_MASK 0x02000000 -#define TOP_TOP_BMODE_GET(x) (((x) & TOP_TOP_BMODE_MASK) >> TOP_TOP_BMODE_LSB) -#define TOP_TOP_BMODE_SET(x) (((x) << TOP_TOP_BMODE_LSB) & TOP_TOP_BMODE_MASK) -#define TOP_TOP_SYNTHON_MSB 24 -#define TOP_TOP_SYNTHON_LSB 24 -#define TOP_TOP_SYNTHON_MASK 0x01000000 -#define TOP_TOP_SYNTHON_GET(x) (((x) & TOP_TOP_SYNTHON_MASK) >> TOP_TOP_SYNTHON_LSB) -#define TOP_TOP_SYNTHON_SET(x) (((x) << TOP_TOP_SYNTHON_LSB) & TOP_TOP_SYNTHON_MASK) -#define TOP_TOP_RXON_MSB 23 -#define TOP_TOP_RXON_LSB 23 -#define TOP_TOP_RXON_MASK 0x00800000 -#define TOP_TOP_RXON_GET(x) (((x) & TOP_TOP_RXON_MASK) >> TOP_TOP_RXON_LSB) -#define TOP_TOP_RXON_SET(x) (((x) << TOP_TOP_RXON_LSB) & TOP_TOP_RXON_MASK) -#define TOP_TOP_TXON_MSB 22 -#define TOP_TOP_TXON_LSB 22 -#define TOP_TOP_TXON_MASK 0x00400000 -#define TOP_TOP_TXON_GET(x) (((x) & TOP_TOP_TXON_MASK) >> TOP_TOP_TXON_LSB) -#define TOP_TOP_TXON_SET(x) (((x) << TOP_TOP_TXON_LSB) & TOP_TOP_TXON_MASK) -#define TOP_TOP_PAON_MSB 21 -#define TOP_TOP_PAON_LSB 21 -#define TOP_TOP_PAON_MASK 0x00200000 -#define TOP_TOP_PAON_GET(x) (((x) & TOP_TOP_PAON_MASK) >> TOP_TOP_PAON_LSB) -#define TOP_TOP_PAON_SET(x) (((x) << TOP_TOP_PAON_LSB) & TOP_TOP_PAON_MASK) -#define TOP_TOP_CALTX_MSB 20 -#define TOP_TOP_CALTX_LSB 20 -#define TOP_TOP_CALTX_MASK 0x00100000 -#define TOP_TOP_CALTX_GET(x) (((x) & TOP_TOP_CALTX_MASK) >> TOP_TOP_CALTX_LSB) -#define TOP_TOP_CALTX_SET(x) (((x) << TOP_TOP_CALTX_LSB) & TOP_TOP_CALTX_MASK) -#define TOP_TOP_LOCALADDAC_MSB 19 -#define TOP_TOP_LOCALADDAC_LSB 19 -#define TOP_TOP_LOCALADDAC_MASK 0x00080000 -#define TOP_TOP_LOCALADDAC_GET(x) (((x) & TOP_TOP_LOCALADDAC_MASK) >> TOP_TOP_LOCALADDAC_LSB) -#define TOP_TOP_LOCALADDAC_SET(x) (((x) << TOP_TOP_LOCALADDAC_LSB) & TOP_TOP_LOCALADDAC_MASK) -#define TOP_TOP_PWDPLL_MSB 18 -#define TOP_TOP_PWDPLL_LSB 18 -#define TOP_TOP_PWDPLL_MASK 0x00040000 -#define TOP_TOP_PWDPLL_GET(x) (((x) & TOP_TOP_PWDPLL_MASK) >> TOP_TOP_PWDPLL_LSB) -#define TOP_TOP_PWDPLL_SET(x) (((x) << TOP_TOP_PWDPLL_LSB) & TOP_TOP_PWDPLL_MASK) -#define TOP_TOP_PWDADC_MSB 17 -#define TOP_TOP_PWDADC_LSB 17 -#define TOP_TOP_PWDADC_MASK 0x00020000 -#define TOP_TOP_PWDADC_GET(x) (((x) & TOP_TOP_PWDADC_MASK) >> TOP_TOP_PWDADC_LSB) -#define TOP_TOP_PWDADC_SET(x) (((x) << TOP_TOP_PWDADC_LSB) & TOP_TOP_PWDADC_MASK) -#define TOP_TOP_PWDDAC_MSB 16 -#define TOP_TOP_PWDDAC_LSB 16 -#define TOP_TOP_PWDDAC_MASK 0x00010000 -#define TOP_TOP_PWDDAC_GET(x) (((x) & TOP_TOP_PWDDAC_MASK) >> TOP_TOP_PWDDAC_LSB) -#define TOP_TOP_PWDDAC_SET(x) (((x) << TOP_TOP_PWDDAC_LSB) & TOP_TOP_PWDDAC_MASK) -#define TOP_TOP_LOCALXTAL_MSB 15 -#define TOP_TOP_LOCALXTAL_LSB 15 -#define TOP_TOP_LOCALXTAL_MASK 0x00008000 -#define TOP_TOP_LOCALXTAL_GET(x) (((x) & TOP_TOP_LOCALXTAL_MASK) >> TOP_TOP_LOCALXTAL_LSB) -#define TOP_TOP_LOCALXTAL_SET(x) (((x) << TOP_TOP_LOCALXTAL_LSB) & TOP_TOP_LOCALXTAL_MASK) -#define TOP_TOP_PWDCLKIN_MSB 14 -#define TOP_TOP_PWDCLKIN_LSB 14 -#define TOP_TOP_PWDCLKIN_MASK 0x00004000 -#define TOP_TOP_PWDCLKIN_GET(x) (((x) & TOP_TOP_PWDCLKIN_MASK) >> TOP_TOP_PWDCLKIN_LSB) -#define TOP_TOP_PWDCLKIN_SET(x) (((x) << TOP_TOP_PWDCLKIN_LSB) & TOP_TOP_PWDCLKIN_MASK) -#define TOP_TOP_OSCON_MSB 13 -#define TOP_TOP_OSCON_LSB 13 -#define TOP_TOP_OSCON_MASK 0x00002000 -#define TOP_TOP_OSCON_GET(x) (((x) & TOP_TOP_OSCON_MASK) >> TOP_TOP_OSCON_LSB) -#define TOP_TOP_OSCON_SET(x) (((x) << TOP_TOP_OSCON_LSB) & TOP_TOP_OSCON_MASK) -#define TOP_TOP_SCLKEN_FORCE_MSB 12 -#define TOP_TOP_SCLKEN_FORCE_LSB 12 -#define TOP_TOP_SCLKEN_FORCE_MASK 0x00001000 -#define TOP_TOP_SCLKEN_FORCE_GET(x) (((x) & TOP_TOP_SCLKEN_FORCE_MASK) >> TOP_TOP_SCLKEN_FORCE_LSB) -#define TOP_TOP_SCLKEN_FORCE_SET(x) (((x) << TOP_TOP_SCLKEN_FORCE_LSB) & TOP_TOP_SCLKEN_FORCE_MASK) -#define TOP_TOP_SYNTHON_FORCE_MSB 11 -#define TOP_TOP_SYNTHON_FORCE_LSB 11 -#define TOP_TOP_SYNTHON_FORCE_MASK 0x00000800 -#define TOP_TOP_SYNTHON_FORCE_GET(x) (((x) & TOP_TOP_SYNTHON_FORCE_MASK) >> TOP_TOP_SYNTHON_FORCE_LSB) -#define TOP_TOP_SYNTHON_FORCE_SET(x) (((x) << TOP_TOP_SYNTHON_FORCE_LSB) & TOP_TOP_SYNTHON_FORCE_MASK) -#define TOP_TOP_PDBIAS_MSB 10 -#define TOP_TOP_PDBIAS_LSB 10 -#define TOP_TOP_PDBIAS_MASK 0x00000400 -#define TOP_TOP_PDBIAS_GET(x) (((x) & TOP_TOP_PDBIAS_MASK) >> TOP_TOP_PDBIAS_LSB) -#define TOP_TOP_PDBIAS_SET(x) (((x) << TOP_TOP_PDBIAS_LSB) & TOP_TOP_PDBIAS_MASK) -#define TOP_TOP_DATAOUTSEL_MSB 9 -#define TOP_TOP_DATAOUTSEL_LSB 8 -#define TOP_TOP_DATAOUTSEL_MASK 0x00000300 -#define TOP_TOP_DATAOUTSEL_GET(x) (((x) & TOP_TOP_DATAOUTSEL_MASK) >> TOP_TOP_DATAOUTSEL_LSB) -#define TOP_TOP_DATAOUTSEL_SET(x) (((x) << TOP_TOP_DATAOUTSEL_LSB) & TOP_TOP_DATAOUTSEL_MASK) -#define TOP_TOP_REVID_MSB 7 -#define TOP_TOP_REVID_LSB 5 -#define TOP_TOP_REVID_MASK 0x000000e0 -#define TOP_TOP_REVID_GET(x) (((x) & TOP_TOP_REVID_MASK) >> TOP_TOP_REVID_LSB) -#define TOP_TOP_REVID_SET(x) (((x) << TOP_TOP_REVID_LSB) & TOP_TOP_REVID_MASK) -#define TOP_TOP_INT2PAD_MSB 4 -#define TOP_TOP_INT2PAD_LSB 4 -#define TOP_TOP_INT2PAD_MASK 0x00000010 -#define TOP_TOP_INT2PAD_GET(x) (((x) & TOP_TOP_INT2PAD_MASK) >> TOP_TOP_INT2PAD_LSB) -#define TOP_TOP_INT2PAD_SET(x) (((x) << TOP_TOP_INT2PAD_LSB) & TOP_TOP_INT2PAD_MASK) -#define TOP_TOP_INTH2PAD_MSB 3 -#define TOP_TOP_INTH2PAD_LSB 3 -#define TOP_TOP_INTH2PAD_MASK 0x00000008 -#define TOP_TOP_INTH2PAD_GET(x) (((x) & TOP_TOP_INTH2PAD_MASK) >> TOP_TOP_INTH2PAD_LSB) -#define TOP_TOP_INTH2PAD_SET(x) (((x) << TOP_TOP_INTH2PAD_LSB) & TOP_TOP_INTH2PAD_MASK) -#define TOP_TOP_PAD2GND_MSB 2 -#define TOP_TOP_PAD2GND_LSB 2 -#define TOP_TOP_PAD2GND_MASK 0x00000004 -#define TOP_TOP_PAD2GND_GET(x) (((x) & TOP_TOP_PAD2GND_MASK) >> TOP_TOP_PAD2GND_LSB) -#define TOP_TOP_PAD2GND_SET(x) (((x) << TOP_TOP_PAD2GND_LSB) & TOP_TOP_PAD2GND_MASK) -#define TOP_TOP_INT2GND_MSB 1 -#define TOP_TOP_INT2GND_LSB 1 -#define TOP_TOP_INT2GND_MASK 0x00000002 -#define TOP_TOP_INT2GND_GET(x) (((x) & TOP_TOP_INT2GND_MASK) >> TOP_TOP_INT2GND_LSB) -#define TOP_TOP_INT2GND_SET(x) (((x) << TOP_TOP_INT2GND_LSB) & TOP_TOP_INT2GND_MASK) -#define TOP_TOP_FORCE_XPAON_MSB 0 -#define TOP_TOP_FORCE_XPAON_LSB 0 -#define TOP_TOP_FORCE_XPAON_MASK 0x00000001 -#define TOP_TOP_FORCE_XPAON_GET(x) (((x) & TOP_TOP_FORCE_XPAON_MASK) >> TOP_TOP_FORCE_XPAON_LSB) -#define TOP_TOP_FORCE_XPAON_SET(x) (((x) << TOP_TOP_FORCE_XPAON_LSB) & TOP_TOP_FORCE_XPAON_MASK) - -#define BIAS_BIAS_SEL_ADDRESS 0x00000038 -#define BIAS_BIAS_SEL_OFFSET 0x00000038 -#define BIAS_BIAS_SEL_PADON_MSB 31 -#define BIAS_BIAS_SEL_PADON_LSB 31 -#define BIAS_BIAS_SEL_PADON_MASK 0x80000000 -#define BIAS_BIAS_SEL_PADON_GET(x) (((x) & BIAS_BIAS_SEL_PADON_MASK) >> BIAS_BIAS_SEL_PADON_LSB) -#define BIAS_BIAS_SEL_PADON_SET(x) (((x) << BIAS_BIAS_SEL_PADON_LSB) & BIAS_BIAS_SEL_PADON_MASK) -#define BIAS_BIAS_SEL_SEL_BIAS_MSB 30 -#define BIAS_BIAS_SEL_SEL_BIAS_LSB 25 -#define BIAS_BIAS_SEL_SEL_BIAS_MASK 0x7e000000 -#define BIAS_BIAS_SEL_SEL_BIAS_GET(x) (((x) & BIAS_BIAS_SEL_SEL_BIAS_MASK) >> BIAS_BIAS_SEL_SEL_BIAS_LSB) -#define BIAS_BIAS_SEL_SEL_BIAS_SET(x) (((x) << BIAS_BIAS_SEL_SEL_BIAS_LSB) & BIAS_BIAS_SEL_SEL_BIAS_MASK) -#define BIAS_BIAS_SEL_SEL_SPARE_MSB 24 -#define BIAS_BIAS_SEL_SEL_SPARE_LSB 21 -#define BIAS_BIAS_SEL_SEL_SPARE_MASK 0x01e00000 -#define BIAS_BIAS_SEL_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SEL_SPARE_SET(x) (((x) << BIAS_BIAS_SEL_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_SPARE_MSB 20 -#define BIAS_BIAS_SEL_SPARE_LSB 20 -#define BIAS_BIAS_SEL_SPARE_MASK 0x00100000 -#define BIAS_BIAS_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SPARE_SET(x) (((x) << BIAS_BIAS_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MSB 19 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB 17 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK 0x000e0000 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK 0x00010000 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_SET(x) (((x) << BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK 0x00008000 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_SET(x) (((x) << BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK 0x00004000 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_LSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MASK 0x00002000 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) >> BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MSB 12 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB 10 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK 0x00001c00 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MSB 9 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_LSB 7 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MASK 0x00000380 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) >> BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MSB 6 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_LSB 4 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MASK 0x00000070 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) >> BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MSB 3 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_LSB 1 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MASK 0x0000000e -#define BIAS_BIAS_SEL_PWD_ICTXPC25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) >> BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) -#define BIAS_BIAS_SEL_PWD_ICLDO25_MSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_LSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_MASK 0x00000001 -#define BIAS_BIAS_SEL_PWD_ICLDO25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) >> BIAS_BIAS_SEL_PWD_ICLDO25_LSB) -#define BIAS_BIAS_SEL_PWD_ICLDO25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICLDO25_LSB) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) - -#define BIAS_BIAS1_ADDRESS 0x0000003c -#define BIAS_BIAS1_OFFSET 0x0000003c -#define BIAS_BIAS1_PWD_ICDAC2BB25_MSB 31 -#define BIAS_BIAS1_PWD_ICDAC2BB25_LSB 29 -#define BIAS_BIAS1_PWD_ICDAC2BB25_MASK 0xe0000000 -#define BIAS_BIAS1_PWD_ICDAC2BB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) >> BIAS_BIAS1_PWD_ICDAC2BB25_LSB) -#define BIAS_BIAS1_PWD_ICDAC2BB25_SET(x) (((x) << BIAS_BIAS1_PWD_ICDAC2BB25_LSB) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) -#define BIAS_BIAS1_PWD_IC2GVGM25_MSB 28 -#define BIAS_BIAS1_PWD_IC2GVGM25_LSB 26 -#define BIAS_BIAS1_PWD_IC2GVGM25_MASK 0x1c000000 -#define BIAS_BIAS1_PWD_IC2GVGM25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) >> BIAS_BIAS1_PWD_IC2GVGM25_LSB) -#define BIAS_BIAS1_PWD_IC2GVGM25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GVGM25_LSB) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) -#define BIAS_BIAS1_PWD_IC2GRFFE25_MSB 25 -#define BIAS_BIAS1_PWD_IC2GRFFE25_LSB 23 -#define BIAS_BIAS1_PWD_IC2GRFFE25_MASK 0x03800000 -#define BIAS_BIAS1_PWD_IC2GRFFE25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) >> BIAS_BIAS1_PWD_IC2GRFFE25_LSB) -#define BIAS_BIAS1_PWD_IC2GRFFE25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GRFFE25_LSB) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) -#define BIAS_BIAS1_PWD_IC2GLOREG25_MSB 22 -#define BIAS_BIAS1_PWD_IC2GLOREG25_LSB 20 -#define BIAS_BIAS1_PWD_IC2GLOREG25_MASK 0x00700000 -#define BIAS_BIAS1_PWD_IC2GLOREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLOREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLOREG25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GLOREG25_LSB) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MSB 19 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_LSB 17 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MASK 0x000e0000 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORB25_MSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_LSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_MASK 0x00010000 -#define BIAS_BIAS1_PWD_ICDETECTORB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORB25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORB25_SET(x) (((x) << BIAS_BIAS1_PWD_ICDETECTORB25_LSB) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORA25_MSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_LSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_MASK 0x00008000 -#define BIAS_BIAS1_PWD_ICDETECTORA25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORA25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORA25_SET(x) (((x) << BIAS_BIAS1_PWD_ICDETECTORA25_LSB) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) -#define BIAS_BIAS1_PWD_IC5GRXRF25_MSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_LSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_MASK 0x00004000 -#define BIAS_BIAS1_PWD_IC5GRXRF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) >> BIAS_BIAS1_PWD_IC5GRXRF25_LSB) -#define BIAS_BIAS1_PWD_IC5GRXRF25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GRXRF25_LSB) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXPA25_MSB 13 -#define BIAS_BIAS1_PWD_IC5GTXPA25_LSB 11 -#define BIAS_BIAS1_PWD_IC5GTXPA25_MASK 0x00003800 -#define BIAS_BIAS1_PWD_IC5GTXPA25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) >> BIAS_BIAS1_PWD_IC5GTXPA25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXPA25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GTXPA25_LSB) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MSB 10 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_LSB 8 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MASK 0x00000700 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) >> BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) -#define BIAS_BIAS1_PWD_IC5GQB25_MSB 7 -#define BIAS_BIAS1_PWD_IC5GQB25_LSB 5 -#define BIAS_BIAS1_PWD_IC5GQB25_MASK 0x000000e0 -#define BIAS_BIAS1_PWD_IC5GQB25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GQB25_MASK) >> BIAS_BIAS1_PWD_IC5GQB25_LSB) -#define BIAS_BIAS1_PWD_IC5GQB25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GQB25_LSB) & BIAS_BIAS1_PWD_IC5GQB25_MASK) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MSB 4 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_LSB 2 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MASK 0x0000001c -#define BIAS_BIAS1_PWD_IC5GMIXQ25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) >> BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) -#define BIAS_BIAS1_SPARE_MSB 1 -#define BIAS_BIAS1_SPARE_LSB 0 -#define BIAS_BIAS1_SPARE_MASK 0x00000003 -#define BIAS_BIAS1_SPARE_GET(x) (((x) & BIAS_BIAS1_SPARE_MASK) >> BIAS_BIAS1_SPARE_LSB) -#define BIAS_BIAS1_SPARE_SET(x) (((x) << BIAS_BIAS1_SPARE_LSB) & BIAS_BIAS1_SPARE_MASK) - -#define BIAS_BIAS2_ADDRESS 0x00000040 -#define BIAS_BIAS2_OFFSET 0x00000040 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MSB 31 -#define BIAS_BIAS2_PWD_IC5GMIXI25_LSB 29 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MASK 0xe0000000 -#define BIAS_BIAS2_PWD_IC5GMIXI25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) >> BIAS_BIAS2_PWD_IC5GMIXI25_LSB) -#define BIAS_BIAS2_PWD_IC5GMIXI25_SET(x) (((x) << BIAS_BIAS2_PWD_IC5GMIXI25_LSB) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) -#define BIAS_BIAS2_PWD_IC5GDIV25_MSB 28 -#define BIAS_BIAS2_PWD_IC5GDIV25_LSB 26 -#define BIAS_BIAS2_PWD_IC5GDIV25_MASK 0x1c000000 -#define BIAS_BIAS2_PWD_IC5GDIV25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) >> BIAS_BIAS2_PWD_IC5GDIV25_LSB) -#define BIAS_BIAS2_PWD_IC5GDIV25_SET(x) (((x) << BIAS_BIAS2_PWD_IC5GDIV25_LSB) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) -#define BIAS_BIAS2_PWD_IC5GLOREG25_MSB 25 -#define BIAS_BIAS2_PWD_IC5GLOREG25_LSB 23 -#define BIAS_BIAS2_PWD_IC5GLOREG25_MASK 0x03800000 -#define BIAS_BIAS2_PWD_IC5GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) >> BIAS_BIAS2_PWD_IC5GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IC5GLOREG25_SET(x) (((x) << BIAS_BIAS2_PWD_IC5GLOREG25_LSB) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IRPLL25_MSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_LSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_MASK 0x00400000 -#define BIAS_BIAS2_PWD_IRPLL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRPLL25_MASK) >> BIAS_BIAS2_PWD_IRPLL25_LSB) -#define BIAS_BIAS2_PWD_IRPLL25_SET(x) (((x) << BIAS_BIAS2_PWD_IRPLL25_LSB) & BIAS_BIAS2_PWD_IRPLL25_MASK) -#define BIAS_BIAS2_PWD_IRXTAL25_MSB 21 -#define BIAS_BIAS2_PWD_IRXTAL25_LSB 19 -#define BIAS_BIAS2_PWD_IRXTAL25_MASK 0x00380000 -#define BIAS_BIAS2_PWD_IRXTAL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRXTAL25_MASK) >> BIAS_BIAS2_PWD_IRXTAL25_LSB) -#define BIAS_BIAS2_PWD_IRXTAL25_SET(x) (((x) << BIAS_BIAS2_PWD_IRXTAL25_LSB) & BIAS_BIAS2_PWD_IRXTAL25_MASK) -#define BIAS_BIAS2_PWD_IRTSENS25_MSB 18 -#define BIAS_BIAS2_PWD_IRTSENS25_LSB 16 -#define BIAS_BIAS2_PWD_IRTSENS25_MASK 0x00070000 -#define BIAS_BIAS2_PWD_IRTSENS25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTSENS25_MASK) >> BIAS_BIAS2_PWD_IRTSENS25_LSB) -#define BIAS_BIAS2_PWD_IRTSENS25_SET(x) (((x) << BIAS_BIAS2_PWD_IRTSENS25_LSB) & BIAS_BIAS2_PWD_IRTSENS25_MASK) -#define BIAS_BIAS2_PWD_IRTXPC25_MSB 15 -#define BIAS_BIAS2_PWD_IRTXPC25_LSB 13 -#define BIAS_BIAS2_PWD_IRTXPC25_MASK 0x0000e000 -#define BIAS_BIAS2_PWD_IRTXPC25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTXPC25_MASK) >> BIAS_BIAS2_PWD_IRTXPC25_LSB) -#define BIAS_BIAS2_PWD_IRTXPC25_SET(x) (((x) << BIAS_BIAS2_PWD_IRTXPC25_LSB) & BIAS_BIAS2_PWD_IRTXPC25_MASK) -#define BIAS_BIAS2_PWD_IRLDO25_MSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_LSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_MASK 0x00001000 -#define BIAS_BIAS2_PWD_IRLDO25_GET(x) (((x) & BIAS_BIAS2_PWD_IRLDO25_MASK) >> BIAS_BIAS2_PWD_IRLDO25_LSB) -#define BIAS_BIAS2_PWD_IRLDO25_SET(x) (((x) << BIAS_BIAS2_PWD_IRLDO25_LSB) & BIAS_BIAS2_PWD_IRLDO25_MASK) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MSB 11 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_LSB 9 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MASK 0x00000e00 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) >> BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_SET(x) (((x) << BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) -#define BIAS_BIAS2_PWD_IR2GLOREG25_MSB 8 -#define BIAS_BIAS2_PWD_IR2GLOREG25_LSB 6 -#define BIAS_BIAS2_PWD_IR2GLOREG25_MASK 0x000001c0 -#define BIAS_BIAS2_PWD_IR2GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLOREG25_SET(x) (((x) << BIAS_BIAS2_PWD_IR2GLOREG25_LSB) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MSB 5 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_LSB 3 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MASK 0x00000038 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_SET(x) (((x) << BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MSB 2 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB 0 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK 0x00000007 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_GET(x) (((x) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) >> BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_SET(x) (((x) << BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) - -#define BIAS_BIAS3_ADDRESS 0x00000044 -#define BIAS_BIAS3_OFFSET 0x00000044 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MSB 31 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_LSB 29 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MASK 0xe0000000 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) >> BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) -#define BIAS_BIAS3_PWD_IR5GTXMIX25_SET(x) (((x) << BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) -#define BIAS_BIAS3_PWD_IR5GAGC25_MSB 28 -#define BIAS_BIAS3_PWD_IR5GAGC25_LSB 26 -#define BIAS_BIAS3_PWD_IR5GAGC25_MASK 0x1c000000 -#define BIAS_BIAS3_PWD_IR5GAGC25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) >> BIAS_BIAS3_PWD_IR5GAGC25_LSB) -#define BIAS_BIAS3_PWD_IR5GAGC25_SET(x) (((x) << BIAS_BIAS3_PWD_IR5GAGC25_LSB) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) -#define BIAS_BIAS3_PWD_ICDAC50_MSB 25 -#define BIAS_BIAS3_PWD_ICDAC50_LSB 23 -#define BIAS_BIAS3_PWD_ICDAC50_MASK 0x03800000 -#define BIAS_BIAS3_PWD_ICDAC50_GET(x) (((x) & BIAS_BIAS3_PWD_ICDAC50_MASK) >> BIAS_BIAS3_PWD_ICDAC50_LSB) -#define BIAS_BIAS3_PWD_ICDAC50_SET(x) (((x) << BIAS_BIAS3_PWD_ICDAC50_LSB) & BIAS_BIAS3_PWD_ICDAC50_MASK) -#define BIAS_BIAS3_PWD_ICSYNTH50_MSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_LSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_MASK 0x00400000 -#define BIAS_BIAS3_PWD_ICSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) >> BIAS_BIAS3_PWD_ICSYNTH50_LSB) -#define BIAS_BIAS3_PWD_ICSYNTH50_SET(x) (((x) << BIAS_BIAS3_PWD_ICSYNTH50_LSB) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) -#define BIAS_BIAS3_PWD_ICBB50_MSB 21 -#define BIAS_BIAS3_PWD_ICBB50_LSB 21 -#define BIAS_BIAS3_PWD_ICBB50_MASK 0x00200000 -#define BIAS_BIAS3_PWD_ICBB50_GET(x) (((x) & BIAS_BIAS3_PWD_ICBB50_MASK) >> BIAS_BIAS3_PWD_ICBB50_LSB) -#define BIAS_BIAS3_PWD_ICBB50_SET(x) (((x) << BIAS_BIAS3_PWD_ICBB50_LSB) & BIAS_BIAS3_PWD_ICBB50_MASK) -#define BIAS_BIAS3_PWD_IC2GDIV50_MSB 20 -#define BIAS_BIAS3_PWD_IC2GDIV50_LSB 18 -#define BIAS_BIAS3_PWD_IC2GDIV50_MASK 0x001c0000 -#define BIAS_BIAS3_PWD_IC2GDIV50_GET(x) (((x) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) >> BIAS_BIAS3_PWD_IC2GDIV50_LSB) -#define BIAS_BIAS3_PWD_IC2GDIV50_SET(x) (((x) << BIAS_BIAS3_PWD_IC2GDIV50_LSB) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) -#define BIAS_BIAS3_PWD_IRSYNTH50_MSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_LSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_MASK 0x00020000 -#define BIAS_BIAS3_PWD_IRSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) >> BIAS_BIAS3_PWD_IRSYNTH50_LSB) -#define BIAS_BIAS3_PWD_IRSYNTH50_SET(x) (((x) << BIAS_BIAS3_PWD_IRSYNTH50_LSB) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) -#define BIAS_BIAS3_PWD_IRBB50_MSB 16 -#define BIAS_BIAS3_PWD_IRBB50_LSB 16 -#define BIAS_BIAS3_PWD_IRBB50_MASK 0x00010000 -#define BIAS_BIAS3_PWD_IRBB50_GET(x) (((x) & BIAS_BIAS3_PWD_IRBB50_MASK) >> BIAS_BIAS3_PWD_IRBB50_LSB) -#define BIAS_BIAS3_PWD_IRBB50_SET(x) (((x) << BIAS_BIAS3_PWD_IRBB50_LSB) & BIAS_BIAS3_PWD_IRBB50_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE1_MSB 15 -#define BIAS_BIAS3_PWD_IC25SPARE1_LSB 13 -#define BIAS_BIAS3_PWD_IC25SPARE1_MASK 0x0000e000 -#define BIAS_BIAS3_PWD_IC25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) >> BIAS_BIAS3_PWD_IC25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE1_SET(x) (((x) << BIAS_BIAS3_PWD_IC25SPARE1_LSB) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE2_MSB 12 -#define BIAS_BIAS3_PWD_IC25SPARE2_LSB 10 -#define BIAS_BIAS3_PWD_IC25SPARE2_MASK 0x00001c00 -#define BIAS_BIAS3_PWD_IC25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) >> BIAS_BIAS3_PWD_IC25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE2_SET(x) (((x) << BIAS_BIAS3_PWD_IC25SPARE2_LSB) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE1_MSB 9 -#define BIAS_BIAS3_PWD_IR25SPARE1_LSB 7 -#define BIAS_BIAS3_PWD_IR25SPARE1_MASK 0x00000380 -#define BIAS_BIAS3_PWD_IR25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) >> BIAS_BIAS3_PWD_IR25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE1_SET(x) (((x) << BIAS_BIAS3_PWD_IR25SPARE1_LSB) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE2_MSB 6 -#define BIAS_BIAS3_PWD_IR25SPARE2_LSB 4 -#define BIAS_BIAS3_PWD_IR25SPARE2_MASK 0x00000070 -#define BIAS_BIAS3_PWD_IR25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) >> BIAS_BIAS3_PWD_IR25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE2_SET(x) (((x) << BIAS_BIAS3_PWD_IR25SPARE2_LSB) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) -#define BIAS_BIAS3_PWD_ICDACREG12P5_MSB 3 -#define BIAS_BIAS3_PWD_ICDACREG12P5_LSB 1 -#define BIAS_BIAS3_PWD_ICDACREG12P5_MASK 0x0000000e -#define BIAS_BIAS3_PWD_ICDACREG12P5_GET(x) (((x) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) >> BIAS_BIAS3_PWD_ICDACREG12P5_LSB) -#define BIAS_BIAS3_PWD_ICDACREG12P5_SET(x) (((x) << BIAS_BIAS3_PWD_ICDACREG12P5_LSB) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) -#define BIAS_BIAS3_SPARE_MSB 0 -#define BIAS_BIAS3_SPARE_LSB 0 -#define BIAS_BIAS3_SPARE_MASK 0x00000001 -#define BIAS_BIAS3_SPARE_GET(x) (((x) & BIAS_BIAS3_SPARE_MASK) >> BIAS_BIAS3_SPARE_LSB) -#define BIAS_BIAS3_SPARE_SET(x) (((x) << BIAS_BIAS3_SPARE_LSB) & BIAS_BIAS3_SPARE_MASK) - -#define TXPC_TXPC_ADDRESS 0x00000048 -#define TXPC_TXPC_OFFSET 0x00000048 -#define TXPC_TXPC_SELINTPD_MSB 31 -#define TXPC_TXPC_SELINTPD_LSB 31 -#define TXPC_TXPC_SELINTPD_MASK 0x80000000 -#define TXPC_TXPC_SELINTPD_GET(x) (((x) & TXPC_TXPC_SELINTPD_MASK) >> TXPC_TXPC_SELINTPD_LSB) -#define TXPC_TXPC_SELINTPD_SET(x) (((x) << TXPC_TXPC_SELINTPD_LSB) & TXPC_TXPC_SELINTPD_MASK) -#define TXPC_TXPC_TEST_MSB 30 -#define TXPC_TXPC_TEST_LSB 30 -#define TXPC_TXPC_TEST_MASK 0x40000000 -#define TXPC_TXPC_TEST_GET(x) (((x) & TXPC_TXPC_TEST_MASK) >> TXPC_TXPC_TEST_LSB) -#define TXPC_TXPC_TEST_SET(x) (((x) << TXPC_TXPC_TEST_LSB) & TXPC_TXPC_TEST_MASK) -#define TXPC_TXPC_TESTGAIN_MSB 29 -#define TXPC_TXPC_TESTGAIN_LSB 28 -#define TXPC_TXPC_TESTGAIN_MASK 0x30000000 -#define TXPC_TXPC_TESTGAIN_GET(x) (((x) & TXPC_TXPC_TESTGAIN_MASK) >> TXPC_TXPC_TESTGAIN_LSB) -#define TXPC_TXPC_TESTGAIN_SET(x) (((x) << TXPC_TXPC_TESTGAIN_LSB) & TXPC_TXPC_TESTGAIN_MASK) -#define TXPC_TXPC_TESTDAC_MSB 27 -#define TXPC_TXPC_TESTDAC_LSB 22 -#define TXPC_TXPC_TESTDAC_MASK 0x0fc00000 -#define TXPC_TXPC_TESTDAC_GET(x) (((x) & TXPC_TXPC_TESTDAC_MASK) >> TXPC_TXPC_TESTDAC_LSB) -#define TXPC_TXPC_TESTDAC_SET(x) (((x) << TXPC_TXPC_TESTDAC_LSB) & TXPC_TXPC_TESTDAC_MASK) -#define TXPC_TXPC_TESTPWDPC_MSB 21 -#define TXPC_TXPC_TESTPWDPC_LSB 21 -#define TXPC_TXPC_TESTPWDPC_MASK 0x00200000 -#define TXPC_TXPC_TESTPWDPC_GET(x) (((x) & TXPC_TXPC_TESTPWDPC_MASK) >> TXPC_TXPC_TESTPWDPC_LSB) -#define TXPC_TXPC_TESTPWDPC_SET(x) (((x) << TXPC_TXPC_TESTPWDPC_LSB) & TXPC_TXPC_TESTPWDPC_MASK) -#define TXPC_TXPC_CURHALF_MSB 20 -#define TXPC_TXPC_CURHALF_LSB 20 -#define TXPC_TXPC_CURHALF_MASK 0x00100000 -#define TXPC_TXPC_CURHALF_GET(x) (((x) & TXPC_TXPC_CURHALF_MASK) >> TXPC_TXPC_CURHALF_LSB) -#define TXPC_TXPC_CURHALF_SET(x) (((x) << TXPC_TXPC_CURHALF_LSB) & TXPC_TXPC_CURHALF_MASK) -#define TXPC_TXPC_NEGOUT_MSB 19 -#define TXPC_TXPC_NEGOUT_LSB 19 -#define TXPC_TXPC_NEGOUT_MASK 0x00080000 -#define TXPC_TXPC_NEGOUT_GET(x) (((x) & TXPC_TXPC_NEGOUT_MASK) >> TXPC_TXPC_NEGOUT_LSB) -#define TXPC_TXPC_NEGOUT_SET(x) (((x) << TXPC_TXPC_NEGOUT_LSB) & TXPC_TXPC_NEGOUT_MASK) -#define TXPC_TXPC_CLKDELAY_MSB 18 -#define TXPC_TXPC_CLKDELAY_LSB 18 -#define TXPC_TXPC_CLKDELAY_MASK 0x00040000 -#define TXPC_TXPC_CLKDELAY_GET(x) (((x) & TXPC_TXPC_CLKDELAY_MASK) >> TXPC_TXPC_CLKDELAY_LSB) -#define TXPC_TXPC_CLKDELAY_SET(x) (((x) << TXPC_TXPC_CLKDELAY_LSB) & TXPC_TXPC_CLKDELAY_MASK) -#define TXPC_TXPC_SELMODREF_MSB 17 -#define TXPC_TXPC_SELMODREF_LSB 17 -#define TXPC_TXPC_SELMODREF_MASK 0x00020000 -#define TXPC_TXPC_SELMODREF_GET(x) (((x) & TXPC_TXPC_SELMODREF_MASK) >> TXPC_TXPC_SELMODREF_LSB) -#define TXPC_TXPC_SELMODREF_SET(x) (((x) << TXPC_TXPC_SELMODREF_LSB) & TXPC_TXPC_SELMODREF_MASK) -#define TXPC_TXPC_SELCMOUT_MSB 16 -#define TXPC_TXPC_SELCMOUT_LSB 16 -#define TXPC_TXPC_SELCMOUT_MASK 0x00010000 -#define TXPC_TXPC_SELCMOUT_GET(x) (((x) & TXPC_TXPC_SELCMOUT_MASK) >> TXPC_TXPC_SELCMOUT_LSB) -#define TXPC_TXPC_SELCMOUT_SET(x) (((x) << TXPC_TXPC_SELCMOUT_LSB) & TXPC_TXPC_SELCMOUT_MASK) -#define TXPC_TXPC_TSMODE_MSB 15 -#define TXPC_TXPC_TSMODE_LSB 14 -#define TXPC_TXPC_TSMODE_MASK 0x0000c000 -#define TXPC_TXPC_TSMODE_GET(x) (((x) & TXPC_TXPC_TSMODE_MASK) >> TXPC_TXPC_TSMODE_LSB) -#define TXPC_TXPC_TSMODE_SET(x) (((x) << TXPC_TXPC_TSMODE_LSB) & TXPC_TXPC_TSMODE_MASK) -#define TXPC_TXPC_N_MSB 13 -#define TXPC_TXPC_N_LSB 6 -#define TXPC_TXPC_N_MASK 0x00003fc0 -#define TXPC_TXPC_N_GET(x) (((x) & TXPC_TXPC_N_MASK) >> TXPC_TXPC_N_LSB) -#define TXPC_TXPC_N_SET(x) (((x) << TXPC_TXPC_N_LSB) & TXPC_TXPC_N_MASK) -#define TXPC_TXPC_ON1STSYNTHON_MSB 5 -#define TXPC_TXPC_ON1STSYNTHON_LSB 5 -#define TXPC_TXPC_ON1STSYNTHON_MASK 0x00000020 -#define TXPC_TXPC_ON1STSYNTHON_GET(x) (((x) & TXPC_TXPC_ON1STSYNTHON_MASK) >> TXPC_TXPC_ON1STSYNTHON_LSB) -#define TXPC_TXPC_ON1STSYNTHON_SET(x) (((x) << TXPC_TXPC_ON1STSYNTHON_LSB) & TXPC_TXPC_ON1STSYNTHON_MASK) -#define TXPC_TXPC_SELINIT_MSB 4 -#define TXPC_TXPC_SELINIT_LSB 3 -#define TXPC_TXPC_SELINIT_MASK 0x00000018 -#define TXPC_TXPC_SELINIT_GET(x) (((x) & TXPC_TXPC_SELINIT_MASK) >> TXPC_TXPC_SELINIT_LSB) -#define TXPC_TXPC_SELINIT_SET(x) (((x) << TXPC_TXPC_SELINIT_LSB) & TXPC_TXPC_SELINIT_MASK) -#define TXPC_TXPC_SELCOUNT_MSB 2 -#define TXPC_TXPC_SELCOUNT_LSB 2 -#define TXPC_TXPC_SELCOUNT_MASK 0x00000004 -#define TXPC_TXPC_SELCOUNT_GET(x) (((x) & TXPC_TXPC_SELCOUNT_MASK) >> TXPC_TXPC_SELCOUNT_LSB) -#define TXPC_TXPC_SELCOUNT_SET(x) (((x) << TXPC_TXPC_SELCOUNT_LSB) & TXPC_TXPC_SELCOUNT_MASK) -#define TXPC_TXPC_ATBSEL_MSB 1 -#define TXPC_TXPC_ATBSEL_LSB 0 -#define TXPC_TXPC_ATBSEL_MASK 0x00000003 -#define TXPC_TXPC_ATBSEL_GET(x) (((x) & TXPC_TXPC_ATBSEL_MASK) >> TXPC_TXPC_ATBSEL_LSB) -#define TXPC_TXPC_ATBSEL_SET(x) (((x) << TXPC_TXPC_ATBSEL_LSB) & TXPC_TXPC_ATBSEL_MASK) - -#define TXPC_MISC_ADDRESS 0x0000004c -#define TXPC_MISC_OFFSET 0x0000004c -#define TXPC_MISC_FLIPBMODE_MSB 31 -#define TXPC_MISC_FLIPBMODE_LSB 31 -#define TXPC_MISC_FLIPBMODE_MASK 0x80000000 -#define TXPC_MISC_FLIPBMODE_GET(x) (((x) & TXPC_MISC_FLIPBMODE_MASK) >> TXPC_MISC_FLIPBMODE_LSB) -#define TXPC_MISC_FLIPBMODE_SET(x) (((x) << TXPC_MISC_FLIPBMODE_LSB) & TXPC_MISC_FLIPBMODE_MASK) -#define TXPC_MISC_LEVEL_MSB 30 -#define TXPC_MISC_LEVEL_LSB 29 -#define TXPC_MISC_LEVEL_MASK 0x60000000 -#define TXPC_MISC_LEVEL_GET(x) (((x) & TXPC_MISC_LEVEL_MASK) >> TXPC_MISC_LEVEL_LSB) -#define TXPC_MISC_LEVEL_SET(x) (((x) << TXPC_MISC_LEVEL_LSB) & TXPC_MISC_LEVEL_MASK) -#define TXPC_MISC_LDO_TEST_MODE_MSB 28 -#define TXPC_MISC_LDO_TEST_MODE_LSB 28 -#define TXPC_MISC_LDO_TEST_MODE_MASK 0x10000000 -#define TXPC_MISC_LDO_TEST_MODE_GET(x) (((x) & TXPC_MISC_LDO_TEST_MODE_MASK) >> TXPC_MISC_LDO_TEST_MODE_LSB) -#define TXPC_MISC_LDO_TEST_MODE_SET(x) (((x) << TXPC_MISC_LDO_TEST_MODE_LSB) & TXPC_MISC_LDO_TEST_MODE_MASK) -#define TXPC_MISC_NOTCXODET_MSB 27 -#define TXPC_MISC_NOTCXODET_LSB 27 -#define TXPC_MISC_NOTCXODET_MASK 0x08000000 -#define TXPC_MISC_NOTCXODET_GET(x) (((x) & TXPC_MISC_NOTCXODET_MASK) >> TXPC_MISC_NOTCXODET_LSB) -#define TXPC_MISC_NOTCXODET_SET(x) (((x) << TXPC_MISC_NOTCXODET_LSB) & TXPC_MISC_NOTCXODET_MASK) -#define TXPC_MISC_PWDCLKIND_MSB 26 -#define TXPC_MISC_PWDCLKIND_LSB 26 -#define TXPC_MISC_PWDCLKIND_MASK 0x04000000 -#define TXPC_MISC_PWDCLKIND_GET(x) (((x) & TXPC_MISC_PWDCLKIND_MASK) >> TXPC_MISC_PWDCLKIND_LSB) -#define TXPC_MISC_PWDCLKIND_SET(x) (((x) << TXPC_MISC_PWDCLKIND_LSB) & TXPC_MISC_PWDCLKIND_MASK) -#define TXPC_MISC_PWDXINPAD_MSB 25 -#define TXPC_MISC_PWDXINPAD_LSB 25 -#define TXPC_MISC_PWDXINPAD_MASK 0x02000000 -#define TXPC_MISC_PWDXINPAD_GET(x) (((x) & TXPC_MISC_PWDXINPAD_MASK) >> TXPC_MISC_PWDXINPAD_LSB) -#define TXPC_MISC_PWDXINPAD_SET(x) (((x) << TXPC_MISC_PWDXINPAD_LSB) & TXPC_MISC_PWDXINPAD_MASK) -#define TXPC_MISC_LOCALBIAS_MSB 24 -#define TXPC_MISC_LOCALBIAS_LSB 24 -#define TXPC_MISC_LOCALBIAS_MASK 0x01000000 -#define TXPC_MISC_LOCALBIAS_GET(x) (((x) & TXPC_MISC_LOCALBIAS_MASK) >> TXPC_MISC_LOCALBIAS_LSB) -#define TXPC_MISC_LOCALBIAS_SET(x) (((x) << TXPC_MISC_LOCALBIAS_LSB) & TXPC_MISC_LOCALBIAS_MASK) -#define TXPC_MISC_LOCALBIAS2X_MSB 23 -#define TXPC_MISC_LOCALBIAS2X_LSB 23 -#define TXPC_MISC_LOCALBIAS2X_MASK 0x00800000 -#define TXPC_MISC_LOCALBIAS2X_GET(x) (((x) & TXPC_MISC_LOCALBIAS2X_MASK) >> TXPC_MISC_LOCALBIAS2X_LSB) -#define TXPC_MISC_LOCALBIAS2X_SET(x) (((x) << TXPC_MISC_LOCALBIAS2X_LSB) & TXPC_MISC_LOCALBIAS2X_MASK) -#define TXPC_MISC_SELTSP_MSB 22 -#define TXPC_MISC_SELTSP_LSB 22 -#define TXPC_MISC_SELTSP_MASK 0x00400000 -#define TXPC_MISC_SELTSP_GET(x) (((x) & TXPC_MISC_SELTSP_MASK) >> TXPC_MISC_SELTSP_LSB) -#define TXPC_MISC_SELTSP_SET(x) (((x) << TXPC_MISC_SELTSP_LSB) & TXPC_MISC_SELTSP_MASK) -#define TXPC_MISC_SELTSN_MSB 21 -#define TXPC_MISC_SELTSN_LSB 21 -#define TXPC_MISC_SELTSN_MASK 0x00200000 -#define TXPC_MISC_SELTSN_GET(x) (((x) & TXPC_MISC_SELTSN_MASK) >> TXPC_MISC_SELTSN_LSB) -#define TXPC_MISC_SELTSN_SET(x) (((x) << TXPC_MISC_SELTSN_LSB) & TXPC_MISC_SELTSN_MASK) -#define TXPC_MISC_SPARE_A_MSB 20 -#define TXPC_MISC_SPARE_A_LSB 18 -#define TXPC_MISC_SPARE_A_MASK 0x001c0000 -#define TXPC_MISC_SPARE_A_GET(x) (((x) & TXPC_MISC_SPARE_A_MASK) >> TXPC_MISC_SPARE_A_LSB) -#define TXPC_MISC_SPARE_A_SET(x) (((x) << TXPC_MISC_SPARE_A_LSB) & TXPC_MISC_SPARE_A_MASK) -#define TXPC_MISC_DECOUT_MSB 17 -#define TXPC_MISC_DECOUT_LSB 8 -#define TXPC_MISC_DECOUT_MASK 0x0003ff00 -#define TXPC_MISC_DECOUT_GET(x) (((x) & TXPC_MISC_DECOUT_MASK) >> TXPC_MISC_DECOUT_LSB) -#define TXPC_MISC_DECOUT_SET(x) (((x) << TXPC_MISC_DECOUT_LSB) & TXPC_MISC_DECOUT_MASK) -#define TXPC_MISC_XTALDIV_MSB 7 -#define TXPC_MISC_XTALDIV_LSB 6 -#define TXPC_MISC_XTALDIV_MASK 0x000000c0 -#define TXPC_MISC_XTALDIV_GET(x) (((x) & TXPC_MISC_XTALDIV_MASK) >> TXPC_MISC_XTALDIV_LSB) -#define TXPC_MISC_XTALDIV_SET(x) (((x) << TXPC_MISC_XTALDIV_LSB) & TXPC_MISC_XTALDIV_MASK) -#define TXPC_MISC_SPARE_MSB 5 -#define TXPC_MISC_SPARE_LSB 0 -#define TXPC_MISC_SPARE_MASK 0x0000003f -#define TXPC_MISC_SPARE_GET(x) (((x) & TXPC_MISC_SPARE_MASK) >> TXPC_MISC_SPARE_LSB) -#define TXPC_MISC_SPARE_SET(x) (((x) << TXPC_MISC_SPARE_LSB) & TXPC_MISC_SPARE_MASK) - -#define RXTXBB_RXTXBB1_ADDRESS 0x00000050 -#define RXTXBB_RXTXBB1_OFFSET 0x00000050 -#define RXTXBB_RXTXBB1_SPARE_MSB 31 -#define RXTXBB_RXTXBB1_SPARE_LSB 19 -#define RXTXBB_RXTXBB1_SPARE_MASK 0xfff80000 -#define RXTXBB_RXTXBB1_SPARE_GET(x) (((x) & RXTXBB_RXTXBB1_SPARE_MASK) >> RXTXBB_RXTXBB1_SPARE_LSB) -#define RXTXBB_RXTXBB1_SPARE_SET(x) (((x) << RXTXBB_RXTXBB1_SPARE_LSB) & RXTXBB_RXTXBB1_SPARE_MASK) -#define RXTXBB_RXTXBB1_FNOTCH_MSB 18 -#define RXTXBB_RXTXBB1_FNOTCH_LSB 17 -#define RXTXBB_RXTXBB1_FNOTCH_MASK 0x00060000 -#define RXTXBB_RXTXBB1_FNOTCH_GET(x) (((x) & RXTXBB_RXTXBB1_FNOTCH_MASK) >> RXTXBB_RXTXBB1_FNOTCH_LSB) -#define RXTXBB_RXTXBB1_FNOTCH_SET(x) (((x) << RXTXBB_RXTXBB1_FNOTCH_LSB) & RXTXBB_RXTXBB1_FNOTCH_MASK) -#define RXTXBB_RXTXBB1_SEL_ATB_MSB 16 -#define RXTXBB_RXTXBB1_SEL_ATB_LSB 9 -#define RXTXBB_RXTXBB1_SEL_ATB_MASK 0x0001fe00 -#define RXTXBB_RXTXBB1_SEL_ATB_GET(x) (((x) & RXTXBB_RXTXBB1_SEL_ATB_MASK) >> RXTXBB_RXTXBB1_SEL_ATB_LSB) -#define RXTXBB_RXTXBB1_SEL_ATB_SET(x) (((x) << RXTXBB_RXTXBB1_SEL_ATB_LSB) & RXTXBB_RXTXBB1_SEL_ATB_MASK) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_LSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MASK 0x00000100 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_GET(x) (((x) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) >> RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_SET(x) (((x) << RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) -#define RXTXBB_RXTXBB1_PDV2I_MSB 7 -#define RXTXBB_RXTXBB1_PDV2I_LSB 7 -#define RXTXBB_RXTXBB1_PDV2I_MASK 0x00000080 -#define RXTXBB_RXTXBB1_PDV2I_GET(x) (((x) & RXTXBB_RXTXBB1_PDV2I_MASK) >> RXTXBB_RXTXBB1_PDV2I_LSB) -#define RXTXBB_RXTXBB1_PDV2I_SET(x) (((x) << RXTXBB_RXTXBB1_PDV2I_LSB) & RXTXBB_RXTXBB1_PDV2I_MASK) -#define RXTXBB_RXTXBB1_PDI2V_MSB 6 -#define RXTXBB_RXTXBB1_PDI2V_LSB 6 -#define RXTXBB_RXTXBB1_PDI2V_MASK 0x00000040 -#define RXTXBB_RXTXBB1_PDI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDI2V_MASK) >> RXTXBB_RXTXBB1_PDI2V_LSB) -#define RXTXBB_RXTXBB1_PDI2V_SET(x) (((x) << RXTXBB_RXTXBB1_PDI2V_LSB) & RXTXBB_RXTXBB1_PDI2V_MASK) -#define RXTXBB_RXTXBB1_PDRXTXBB_MSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_LSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_MASK 0x00000020 -#define RXTXBB_RXTXBB1_PDRXTXBB_GET(x) (((x) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) >> RXTXBB_RXTXBB1_PDRXTXBB_LSB) -#define RXTXBB_RXTXBB1_PDRXTXBB_SET(x) (((x) << RXTXBB_RXTXBB1_PDRXTXBB_LSB) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK 0x00000010 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK 0x00000008 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_LSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MASK 0x00000004 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) >> RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_SET(x) (((x) << RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) -#define RXTXBB_RXTXBB1_PDLOQ_MSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_LSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_MASK 0x00000002 -#define RXTXBB_RXTXBB1_PDLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDLOQ_MASK) >> RXTXBB_RXTXBB1_PDLOQ_LSB) -#define RXTXBB_RXTXBB1_PDLOQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDLOQ_LSB) & RXTXBB_RXTXBB1_PDLOQ_MASK) -#define RXTXBB_RXTXBB1_PDHIQ_MSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_LSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_MASK 0x00000001 -#define RXTXBB_RXTXBB1_PDHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDHIQ_MASK) >> RXTXBB_RXTXBB1_PDHIQ_LSB) -#define RXTXBB_RXTXBB1_PDHIQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDHIQ_LSB) & RXTXBB_RXTXBB1_PDHIQ_MASK) - -#define RXTXBB_RXTXBB2_ADDRESS 0x00000054 -#define RXTXBB_RXTXBB2_OFFSET 0x00000054 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MSB 31 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB 29 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK 0xe0000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_SET(x) (((x) << RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MSB 28 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB 26 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK 0x1c000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_SET(x) (((x) << RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MSB 25 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB 23 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK 0x03800000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_SET(x) (((x) << RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) -#define RXTXBB_RXTXBB2_SPARE_MSB 22 -#define RXTXBB_RXTXBB2_SPARE_LSB 21 -#define RXTXBB_RXTXBB2_SPARE_MASK 0x00600000 -#define RXTXBB_RXTXBB2_SPARE_GET(x) (((x) & RXTXBB_RXTXBB2_SPARE_MASK) >> RXTXBB_RXTXBB2_SPARE_LSB) -#define RXTXBB_RXTXBB2_SPARE_SET(x) (((x) << RXTXBB_RXTXBB2_SPARE_LSB) & RXTXBB_RXTXBB2_SPARE_MASK) -#define RXTXBB_RXTXBB2_SHORTBUFFER_MSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_LSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_MASK 0x00100000 -#define RXTXBB_RXTXBB2_SHORTBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) >> RXTXBB_RXTXBB2_SHORTBUFFER_LSB) -#define RXTXBB_RXTXBB2_SHORTBUFFER_SET(x) (((x) << RXTXBB_RXTXBB2_SHORTBUFFER_LSB) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) -#define RXTXBB_RXTXBB2_SELBUFFER_MSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_LSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_MASK 0x00080000 -#define RXTXBB_RXTXBB2_SELBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SELBUFFER_MASK) >> RXTXBB_RXTXBB2_SELBUFFER_LSB) -#define RXTXBB_RXTXBB2_SELBUFFER_SET(x) (((x) << RXTXBB_RXTXBB2_SELBUFFER_LSB) & RXTXBB_RXTXBB2_SELBUFFER_MASK) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK 0x00040000 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK 0x00020000 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK 0x00010000 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK 0x00008000 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) -#define RXTXBB_RXTXBB2_CMSEL_MSB 14 -#define RXTXBB_RXTXBB2_CMSEL_LSB 13 -#define RXTXBB_RXTXBB2_CMSEL_MASK 0x00006000 -#define RXTXBB_RXTXBB2_CMSEL_GET(x) (((x) & RXTXBB_RXTXBB2_CMSEL_MASK) >> RXTXBB_RXTXBB2_CMSEL_LSB) -#define RXTXBB_RXTXBB2_CMSEL_SET(x) (((x) << RXTXBB_RXTXBB2_CMSEL_LSB) & RXTXBB_RXTXBB2_CMSEL_MASK) -#define RXTXBB_RXTXBB2_FILTERFC_MSB 12 -#define RXTXBB_RXTXBB2_FILTERFC_LSB 8 -#define RXTXBB_RXTXBB2_FILTERFC_MASK 0x00001f00 -#define RXTXBB_RXTXBB2_FILTERFC_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERFC_MASK) >> RXTXBB_RXTXBB2_FILTERFC_LSB) -#define RXTXBB_RXTXBB2_FILTERFC_SET(x) (((x) << RXTXBB_RXTXBB2_FILTERFC_LSB) & RXTXBB_RXTXBB2_FILTERFC_MASK) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK 0x00000080 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_GET(x) (((x) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) >> RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_SET(x) (((x) << RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK 0x00000040 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) >> RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_SET(x) (((x) << RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK 0x00000020 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK 0x00000010 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK 0x00000008 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK 0x00000004 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK 0x00000002 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK 0x00000001 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_GET(x) (((x) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) >> RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_SET(x) (((x) << RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) - -#define RXTXBB_RXTXBB3_ADDRESS 0x00000058 -#define RXTXBB_RXTXBB3_OFFSET 0x00000058 -#define RXTXBB_RXTXBB3_SPARE_MSB 31 -#define RXTXBB_RXTXBB3_SPARE_LSB 27 -#define RXTXBB_RXTXBB3_SPARE_MASK 0xf8000000 -#define RXTXBB_RXTXBB3_SPARE_GET(x) (((x) & RXTXBB_RXTXBB3_SPARE_MASK) >> RXTXBB_RXTXBB3_SPARE_LSB) -#define RXTXBB_RXTXBB3_SPARE_SET(x) (((x) << RXTXBB_RXTXBB3_SPARE_LSB) & RXTXBB_RXTXBB3_SPARE_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MSB 26 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB 24 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK 0x07000000 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MSB 23 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB 21 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK 0x00e00000 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MSB 20 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB 18 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK 0x001c0000 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MSB 17 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB 15 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK 0x00038000 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MSB 14 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB 12 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK 0x00007000 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MSB 11 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB 9 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK 0x00000e00 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MSB 8 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB 6 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK 0x000001c0 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MSB 5 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB 3 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK 0x00000038 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) >> RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MSB 2 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB 0 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK 0x00000007 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) - -#define RXTXBB_RXTXBB4_ADDRESS 0x0000005c -#define RXTXBB_RXTXBB4_OFFSET 0x0000005c -#define RXTXBB_RXTXBB4_SPARE_MSB 31 -#define RXTXBB_RXTXBB4_SPARE_LSB 31 -#define RXTXBB_RXTXBB4_SPARE_MASK 0x80000000 -#define RXTXBB_RXTXBB4_SPARE_GET(x) (((x) & RXTXBB_RXTXBB4_SPARE_MASK) >> RXTXBB_RXTXBB4_SPARE_LSB) -#define RXTXBB_RXTXBB4_SPARE_SET(x) (((x) << RXTXBB_RXTXBB4_SPARE_LSB) & RXTXBB_RXTXBB4_SPARE_MASK) -#define RXTXBB_RXTXBB4_LOCALOFFSET_MSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_LSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_MASK 0x40000000 -#define RXTXBB_RXTXBB4_LOCALOFFSET_GET(x) (((x) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) >> RXTXBB_RXTXBB4_LOCALOFFSET_LSB) -#define RXTXBB_RXTXBB4_LOCALOFFSET_SET(x) (((x) << RXTXBB_RXTXBB4_LOCALOFFSET_LSB) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHII_MSB 29 -#define RXTXBB_RXTXBB4_OFSTCORRHII_LSB 25 -#define RXTXBB_RXTXBB4_OFSTCORRHII_MASK 0x3e000000 -#define RXTXBB_RXTXBB4_OFSTCORRHII_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHII_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHII_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRHII_LSB) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MSB 24 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB 20 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK 0x01f00000 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MSB 19 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_LSB 15 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MASK 0x000f8000 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MSB 14 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB 10 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK 0x00007c00 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MSB 9 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB 5 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK 0x000003e0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MSB 4 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB 0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK 0x0000001f -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) - -#define ADDAC_ADDAC1_ADDRESS 0x00000060 -#define ADDAC_ADDAC1_OFFSET 0x00000060 -#define ADDAC_ADDAC1_PLL_SVREG_MSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_LSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_MASK 0x80000000 -#define ADDAC_ADDAC1_PLL_SVREG_GET(x) (((x) & ADDAC_ADDAC1_PLL_SVREG_MASK) >> ADDAC_ADDAC1_PLL_SVREG_LSB) -#define ADDAC_ADDAC1_PLL_SVREG_SET(x) (((x) << ADDAC_ADDAC1_PLL_SVREG_LSB) & ADDAC_ADDAC1_PLL_SVREG_MASK) -#define ADDAC_ADDAC1_PLL_SCLAMP_MSB 30 -#define ADDAC_ADDAC1_PLL_SCLAMP_LSB 28 -#define ADDAC_ADDAC1_PLL_SCLAMP_MASK 0x70000000 -#define ADDAC_ADDAC1_PLL_SCLAMP_GET(x) (((x) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) >> ADDAC_ADDAC1_PLL_SCLAMP_LSB) -#define ADDAC_ADDAC1_PLL_SCLAMP_SET(x) (((x) << ADDAC_ADDAC1_PLL_SCLAMP_LSB) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) -#define ADDAC_ADDAC1_PLL_ATB_MSB 27 -#define ADDAC_ADDAC1_PLL_ATB_LSB 26 -#define ADDAC_ADDAC1_PLL_ATB_MASK 0x0c000000 -#define ADDAC_ADDAC1_PLL_ATB_GET(x) (((x) & ADDAC_ADDAC1_PLL_ATB_MASK) >> ADDAC_ADDAC1_PLL_ATB_LSB) -#define ADDAC_ADDAC1_PLL_ATB_SET(x) (((x) << ADDAC_ADDAC1_PLL_ATB_LSB) & ADDAC_ADDAC1_PLL_ATB_MASK) -#define ADDAC_ADDAC1_PLL_ICP_MSB 25 -#define ADDAC_ADDAC1_PLL_ICP_LSB 23 -#define ADDAC_ADDAC1_PLL_ICP_MASK 0x03800000 -#define ADDAC_ADDAC1_PLL_ICP_GET(x) (((x) & ADDAC_ADDAC1_PLL_ICP_MASK) >> ADDAC_ADDAC1_PLL_ICP_LSB) -#define ADDAC_ADDAC1_PLL_ICP_SET(x) (((x) << ADDAC_ADDAC1_PLL_ICP_LSB) & ADDAC_ADDAC1_PLL_ICP_MASK) -#define ADDAC_ADDAC1_PLL_FILTER_MSB 22 -#define ADDAC_ADDAC1_PLL_FILTER_LSB 15 -#define ADDAC_ADDAC1_PLL_FILTER_MASK 0x007f8000 -#define ADDAC_ADDAC1_PLL_FILTER_GET(x) (((x) & ADDAC_ADDAC1_PLL_FILTER_MASK) >> ADDAC_ADDAC1_PLL_FILTER_LSB) -#define ADDAC_ADDAC1_PLL_FILTER_SET(x) (((x) << ADDAC_ADDAC1_PLL_FILTER_LSB) & ADDAC_ADDAC1_PLL_FILTER_MASK) -#define ADDAC_ADDAC1_PWDPLL_MSB 14 -#define ADDAC_ADDAC1_PWDPLL_LSB 14 -#define ADDAC_ADDAC1_PWDPLL_MASK 0x00004000 -#define ADDAC_ADDAC1_PWDPLL_GET(x) (((x) & ADDAC_ADDAC1_PWDPLL_MASK) >> ADDAC_ADDAC1_PWDPLL_LSB) -#define ADDAC_ADDAC1_PWDPLL_SET(x) (((x) << ADDAC_ADDAC1_PWDPLL_LSB) & ADDAC_ADDAC1_PWDPLL_MASK) -#define ADDAC_ADDAC1_PWDADC_MSB 13 -#define ADDAC_ADDAC1_PWDADC_LSB 13 -#define ADDAC_ADDAC1_PWDADC_MASK 0x00002000 -#define ADDAC_ADDAC1_PWDADC_GET(x) (((x) & ADDAC_ADDAC1_PWDADC_MASK) >> ADDAC_ADDAC1_PWDADC_LSB) -#define ADDAC_ADDAC1_PWDADC_SET(x) (((x) << ADDAC_ADDAC1_PWDADC_LSB) & ADDAC_ADDAC1_PWDADC_MASK) -#define ADDAC_ADDAC1_PWDDAC_MSB 12 -#define ADDAC_ADDAC1_PWDDAC_LSB 12 -#define ADDAC_ADDAC1_PWDDAC_MASK 0x00001000 -#define ADDAC_ADDAC1_PWDDAC_GET(x) (((x) & ADDAC_ADDAC1_PWDDAC_MASK) >> ADDAC_ADDAC1_PWDDAC_LSB) -#define ADDAC_ADDAC1_PWDDAC_SET(x) (((x) << ADDAC_ADDAC1_PWDDAC_LSB) & ADDAC_ADDAC1_PWDDAC_MASK) -#define ADDAC_ADDAC1_FORCEMSBLOW_MSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_LSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_MASK 0x00000800 -#define ADDAC_ADDAC1_FORCEMSBLOW_GET(x) (((x) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) >> ADDAC_ADDAC1_FORCEMSBLOW_LSB) -#define ADDAC_ADDAC1_FORCEMSBLOW_SET(x) (((x) << ADDAC_ADDAC1_FORCEMSBLOW_LSB) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) -#define ADDAC_ADDAC1_SELMANPWDS_MSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_LSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_MASK 0x00000400 -#define ADDAC_ADDAC1_SELMANPWDS_GET(x) (((x) & ADDAC_ADDAC1_SELMANPWDS_MASK) >> ADDAC_ADDAC1_SELMANPWDS_LSB) -#define ADDAC_ADDAC1_SELMANPWDS_SET(x) (((x) << ADDAC_ADDAC1_SELMANPWDS_LSB) & ADDAC_ADDAC1_SELMANPWDS_MASK) -#define ADDAC_ADDAC1_INV_CLK160_ADC_MSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_LSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_MASK 0x00000200 -#define ADDAC_ADDAC1_INV_CLK160_ADC_GET(x) (((x) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) >> ADDAC_ADDAC1_INV_CLK160_ADC_LSB) -#define ADDAC_ADDAC1_INV_CLK160_ADC_SET(x) (((x) << ADDAC_ADDAC1_INV_CLK160_ADC_LSB) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) -#define ADDAC_ADDAC1_CM_SEL_MSB 8 -#define ADDAC_ADDAC1_CM_SEL_LSB 7 -#define ADDAC_ADDAC1_CM_SEL_MASK 0x00000180 -#define ADDAC_ADDAC1_CM_SEL_GET(x) (((x) & ADDAC_ADDAC1_CM_SEL_MASK) >> ADDAC_ADDAC1_CM_SEL_LSB) -#define ADDAC_ADDAC1_CM_SEL_SET(x) (((x) << ADDAC_ADDAC1_CM_SEL_LSB) & ADDAC_ADDAC1_CM_SEL_MASK) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_LSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MASK 0x00000040 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_GET(x) (((x) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) >> ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_SET(x) (((x) << ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) -#define ADDAC_ADDAC1_SPARE_MSB 5 -#define ADDAC_ADDAC1_SPARE_LSB 0 -#define ADDAC_ADDAC1_SPARE_MASK 0x0000003f -#define ADDAC_ADDAC1_SPARE_GET(x) (((x) & ADDAC_ADDAC1_SPARE_MASK) >> ADDAC_ADDAC1_SPARE_LSB) -#define ADDAC_ADDAC1_SPARE_SET(x) (((x) << ADDAC_ADDAC1_SPARE_LSB) & ADDAC_ADDAC1_SPARE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct analog_reg_reg_s { - volatile unsigned int synth_synth1; - volatile unsigned int synth_synth2; - volatile unsigned int synth_synth3; - volatile unsigned int synth_synth4; - volatile unsigned int synth_synth5; - volatile unsigned int synth_synth6; - volatile unsigned int synth_synth7; - volatile unsigned int synth_synth8; - volatile unsigned int rf5g_rf5g1; - volatile unsigned int rf5g_rf5g2; - volatile unsigned int rf2g_rf2g1; - volatile unsigned int rf2g_rf2g2; - volatile unsigned int top_gain; - volatile unsigned int top_top; - volatile unsigned int bias_bias_sel; - volatile unsigned int bias_bias1; - volatile unsigned int bias_bias2; - volatile unsigned int bias_bias3; - volatile unsigned int txpc_txpc; - volatile unsigned int txpc_misc; - volatile unsigned int rxtxbb_rxtxbb1; - volatile unsigned int rxtxbb_rxtxbb2; - volatile unsigned int rxtxbb_rxtxbb3; - volatile unsigned int rxtxbb_rxtxbb4; - volatile unsigned int addac_addac1; -} analog_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _ANALOG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_reg.vrh deleted file mode 100644 index 9fd2269c3b6a..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/analog_reg.vrh +++ /dev/null @@ -1,3084 +0,0 @@ -#ifndef _ANALOG_REG_VRH_ -#define _ANALOG_REG_VRH_ - -#define SYNTH_SYNTH1_ADDRESS 'h00000000 -#define SYNTH_SYNTH1_PWD_BIAS_MSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_LSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_MASK 'h80000000 -#define SYNTH_SYNTH1_PWD_BIAS_GET(x) (((x) & SYNTH_SYNTH1_PWD_BIAS_MASK) >> SYNTH_SYNTH1_PWD_BIAS_LSB) -#define SYNTH_SYNTH1_PWD_BIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_BIAS_LSB) & SYNTH_SYNTH1_PWD_BIAS_MASK) -#define SYNTH_SYNTH1_PWD_BIAS_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_CP_MSB 30 -#define SYNTH_SYNTH1_PWD_CP_LSB 30 -#define SYNTH_SYNTH1_PWD_CP_MASK 'h40000000 -#define SYNTH_SYNTH1_PWD_CP_GET(x) (((x) & SYNTH_SYNTH1_PWD_CP_MASK) >> SYNTH_SYNTH1_PWD_CP_LSB) -#define SYNTH_SYNTH1_PWD_CP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_CP_LSB) & SYNTH_SYNTH1_PWD_CP_MASK) -#define SYNTH_SYNTH1_PWD_CP_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_VCMON_MSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_LSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_MASK 'h20000000 -#define SYNTH_SYNTH1_PWD_VCMON_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCMON_MASK) >> SYNTH_SYNTH1_PWD_VCMON_LSB) -#define SYNTH_SYNTH1_PWD_VCMON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_VCMON_LSB) & SYNTH_SYNTH1_PWD_VCMON_MASK) -#define SYNTH_SYNTH1_PWD_VCMON_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_VCO_MSB 28 -#define SYNTH_SYNTH1_PWD_VCO_LSB 28 -#define SYNTH_SYNTH1_PWD_VCO_MASK 'h10000000 -#define SYNTH_SYNTH1_PWD_VCO_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCO_MASK) >> SYNTH_SYNTH1_PWD_VCO_LSB) -#define SYNTH_SYNTH1_PWD_VCO_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_VCO_LSB) & SYNTH_SYNTH1_PWD_VCO_MASK) -#define SYNTH_SYNTH1_PWD_VCO_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_PRESC_MSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_LSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_MASK 'h08000000 -#define SYNTH_SYNTH1_PWD_PRESC_GET(x) (((x) & SYNTH_SYNTH1_PWD_PRESC_MASK) >> SYNTH_SYNTH1_PWD_PRESC_LSB) -#define SYNTH_SYNTH1_PWD_PRESC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_PRESC_LSB) & SYNTH_SYNTH1_PWD_PRESC_MASK) -#define SYNTH_SYNTH1_PWD_PRESC_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_LODIV_MSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_LSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_MASK 'h04000000 -#define SYNTH_SYNTH1_PWD_LODIV_GET(x) (((x) & SYNTH_SYNTH1_PWD_LODIV_MASK) >> SYNTH_SYNTH1_PWD_LODIV_LSB) -#define SYNTH_SYNTH1_PWD_LODIV_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_LODIV_LSB) & SYNTH_SYNTH1_PWD_LODIV_MASK) -#define SYNTH_SYNTH1_PWD_LODIV_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_LOMIX_MSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_LSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_MASK 'h02000000 -#define SYNTH_SYNTH1_PWD_LOMIX_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOMIX_MASK) >> SYNTH_SYNTH1_PWD_LOMIX_LSB) -#define SYNTH_SYNTH1_PWD_LOMIX_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_LOMIX_LSB) & SYNTH_SYNTH1_PWD_LOMIX_MASK) -#define SYNTH_SYNTH1_PWD_LOMIX_RESET 1'h0 -#define SYNTH_SYNTH1_FORCE_LO_ON_MSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_LSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_MASK 'h01000000 -#define SYNTH_SYNTH1_FORCE_LO_ON_GET(x) (((x) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) >> SYNTH_SYNTH1_FORCE_LO_ON_LSB) -#define SYNTH_SYNTH1_FORCE_LO_ON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_FORCE_LO_ON_LSB) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) -#define SYNTH_SYNTH1_FORCE_LO_ON_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_LOBUF5G_MSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_LSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_MASK 'h00800000 -#define SYNTH_SYNTH1_PWD_LOBUF5G_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) >> SYNTH_SYNTH1_PWD_LOBUF5G_LSB) -#define SYNTH_SYNTH1_PWD_LOBUF5G_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_LOBUF5G_LSB) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) -#define SYNTH_SYNTH1_PWD_LOBUF5G_RESET 1'h0 -#define SYNTH_SYNTH1_VCOREGBYPASS_MSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_LSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_MASK 'h00400000 -#define SYNTH_SYNTH1_VCOREGBYPASS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) >> SYNTH_SYNTH1_VCOREGBYPASS_LSB) -#define SYNTH_SYNTH1_VCOREGBYPASS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_VCOREGBYPASS_LSB) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) -#define SYNTH_SYNTH1_VCOREGBYPASS_RESET 1'h1 -#define SYNTH_SYNTH1_VCOREGLEVEL_MSB 21 -#define SYNTH_SYNTH1_VCOREGLEVEL_LSB 20 -#define SYNTH_SYNTH1_VCOREGLEVEL_MASK 'h00300000 -#define SYNTH_SYNTH1_VCOREGLEVEL_GET(x) (((x) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) >> SYNTH_SYNTH1_VCOREGLEVEL_LSB) -#define SYNTH_SYNTH1_VCOREGLEVEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_VCOREGLEVEL_LSB) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) -#define SYNTH_SYNTH1_VCOREGLEVEL_RESET 2'h1 -#define SYNTH_SYNTH1_VCOREGBIAS_MSB 19 -#define SYNTH_SYNTH1_VCOREGBIAS_LSB 18 -#define SYNTH_SYNTH1_VCOREGBIAS_MASK 'h000c0000 -#define SYNTH_SYNTH1_VCOREGBIAS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBIAS_MASK) >> SYNTH_SYNTH1_VCOREGBIAS_LSB) -#define SYNTH_SYNTH1_VCOREGBIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_VCOREGBIAS_LSB) & SYNTH_SYNTH1_VCOREGBIAS_MASK) -#define SYNTH_SYNTH1_VCOREGBIAS_RESET 2'h1 -#define SYNTH_SYNTH1_SLIDINGIF_MSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_LSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_MASK 'h00020000 -#define SYNTH_SYNTH1_SLIDINGIF_GET(x) (((x) & SYNTH_SYNTH1_SLIDINGIF_MASK) >> SYNTH_SYNTH1_SLIDINGIF_LSB) -#define SYNTH_SYNTH1_SLIDINGIF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_SLIDINGIF_LSB) & SYNTH_SYNTH1_SLIDINGIF_MASK) -#define SYNTH_SYNTH1_SLIDINGIF_RESET 1'h0 -#define SYNTH_SYNTH1_SPARE_PWD_MSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_LSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_MASK 'h00010000 -#define SYNTH_SYNTH1_SPARE_PWD_GET(x) (((x) & SYNTH_SYNTH1_SPARE_PWD_MASK) >> SYNTH_SYNTH1_SPARE_PWD_LSB) -#define SYNTH_SYNTH1_SPARE_PWD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_SPARE_PWD_LSB) & SYNTH_SYNTH1_SPARE_PWD_MASK) -#define SYNTH_SYNTH1_SPARE_PWD_RESET 1'h0 -#define SYNTH_SYNTH1_CON_VDDVCOREG_MSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_LSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_MASK 'h00008000 -#define SYNTH_SYNTH1_CON_VDDVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) >> SYNTH_SYNTH1_CON_VDDVCOREG_LSB) -#define SYNTH_SYNTH1_CON_VDDVCOREG_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_CON_VDDVCOREG_LSB) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) -#define SYNTH_SYNTH1_CON_VDDVCOREG_RESET 1'h0 -#define SYNTH_SYNTH1_CON_IVCOREG_MSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_LSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_MASK 'h00004000 -#define SYNTH_SYNTH1_CON_IVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOREG_MASK) >> SYNTH_SYNTH1_CON_IVCOREG_LSB) -#define SYNTH_SYNTH1_CON_IVCOREG_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_CON_IVCOREG_LSB) & SYNTH_SYNTH1_CON_IVCOREG_MASK) -#define SYNTH_SYNTH1_CON_IVCOREG_RESET 1'h0 -#define SYNTH_SYNTH1_CON_IVCOBUF_MSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_LSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_MASK 'h00002000 -#define SYNTH_SYNTH1_CON_IVCOBUF_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) >> SYNTH_SYNTH1_CON_IVCOBUF_LSB) -#define SYNTH_SYNTH1_CON_IVCOBUF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_CON_IVCOBUF_LSB) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) -#define SYNTH_SYNTH1_CON_IVCOBUF_RESET 1'h0 -#define SYNTH_SYNTH1_SEL_VCMONABUS_MSB 12 -#define SYNTH_SYNTH1_SEL_VCMONABUS_LSB 10 -#define SYNTH_SYNTH1_SEL_VCMONABUS_MASK 'h00001c00 -#define SYNTH_SYNTH1_SEL_VCMONABUS_GET(x) (((x) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) >> SYNTH_SYNTH1_SEL_VCMONABUS_LSB) -#define SYNTH_SYNTH1_SEL_VCMONABUS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_SEL_VCMONABUS_LSB) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) -#define SYNTH_SYNTH1_SEL_VCMONABUS_RESET 3'h0 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK 'h00000200 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) >> SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_RESET 1'h0 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_LSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MASK 'h00000100 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) >> SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_RESET 1'h0 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK 'h00000080 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_RESET 1'h0 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK 'h00000040 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_FB_MSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_LSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_MASK 'h00000020 -#define SYNTH_SYNTH1_MONITOR_FB_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_MASK) >> SYNTH_SYNTH1_MONITOR_FB_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_FB_LSB) & SYNTH_SYNTH1_MONITOR_FB_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_REF_MSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_LSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_MASK 'h00000010 -#define SYNTH_SYNTH1_MONITOR_REF_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_REF_MASK) >> SYNTH_SYNTH1_MONITOR_REF_LSB) -#define SYNTH_SYNTH1_MONITOR_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_REF_LSB) & SYNTH_SYNTH1_MONITOR_REF_MASK) -#define SYNTH_SYNTH1_MONITOR_REF_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK 'h00000008 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) >> SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK 'h00000004 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) >> SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_LSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MASK 'h00000002 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) >> SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK 'h00000001 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) >> SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_RESET 1'h0 -#define SYNTH_SYNTH1_RESET (32'h0 | \ - SYNTH_SYNTH1_PWD_BIAS_SET(SYNTH_SYNTH1_PWD_BIAS_RESET) | \ - SYNTH_SYNTH1_PWD_CP_SET(SYNTH_SYNTH1_PWD_CP_RESET) | \ - SYNTH_SYNTH1_PWD_VCMON_SET(SYNTH_SYNTH1_PWD_VCMON_RESET) | \ - SYNTH_SYNTH1_PWD_VCO_SET(SYNTH_SYNTH1_PWD_VCO_RESET) | \ - SYNTH_SYNTH1_PWD_PRESC_SET(SYNTH_SYNTH1_PWD_PRESC_RESET) | \ - SYNTH_SYNTH1_PWD_LODIV_SET(SYNTH_SYNTH1_PWD_LODIV_RESET) | \ - SYNTH_SYNTH1_PWD_LOMIX_SET(SYNTH_SYNTH1_PWD_LOMIX_RESET) | \ - SYNTH_SYNTH1_FORCE_LO_ON_SET(SYNTH_SYNTH1_FORCE_LO_ON_RESET) | \ - SYNTH_SYNTH1_PWD_LOBUF5G_SET(SYNTH_SYNTH1_PWD_LOBUF5G_RESET) | \ - SYNTH_SYNTH1_VCOREGBYPASS_SET(SYNTH_SYNTH1_VCOREGBYPASS_RESET) | \ - SYNTH_SYNTH1_VCOREGLEVEL_SET(SYNTH_SYNTH1_VCOREGLEVEL_RESET) | \ - SYNTH_SYNTH1_VCOREGBIAS_SET(SYNTH_SYNTH1_VCOREGBIAS_RESET) | \ - SYNTH_SYNTH1_SLIDINGIF_SET(SYNTH_SYNTH1_SLIDINGIF_RESET) | \ - SYNTH_SYNTH1_SPARE_PWD_SET(SYNTH_SYNTH1_SPARE_PWD_RESET) | \ - SYNTH_SYNTH1_CON_VDDVCOREG_SET(SYNTH_SYNTH1_CON_VDDVCOREG_RESET) | \ - SYNTH_SYNTH1_CON_IVCOREG_SET(SYNTH_SYNTH1_CON_IVCOREG_RESET) | \ - SYNTH_SYNTH1_CON_IVCOBUF_SET(SYNTH_SYNTH1_CON_IVCOBUF_RESET) | \ - SYNTH_SYNTH1_SEL_VCMONABUS_SET(SYNTH_SYNTH1_SEL_VCMONABUS_RESET) | \ - SYNTH_SYNTH1_PWUP_VCOBUF_PD_SET(SYNTH_SYNTH1_PWUP_VCOBUF_PD_RESET) | \ - SYNTH_SYNTH1_PWUP_LODIV_PD_SET(SYNTH_SYNTH1_PWUP_LODIV_PD_RESET) | \ - SYNTH_SYNTH1_PWUP_LOMIX_PD_SET(SYNTH_SYNTH1_PWUP_LOMIX_PD_RESET) | \ - SYNTH_SYNTH1_PWUP_LOBUF5G_PD_SET(SYNTH_SYNTH1_PWUP_LOBUF5G_PD_RESET) | \ - SYNTH_SYNTH1_MONITOR_FB_SET(SYNTH_SYNTH1_MONITOR_FB_RESET) | \ - SYNTH_SYNTH1_MONITOR_REF_SET(SYNTH_SYNTH1_MONITOR_REF_RESET) | \ - SYNTH_SYNTH1_MONITOR_FB_DIV2_SET(SYNTH_SYNTH1_MONITOR_FB_DIV2_RESET) | \ - SYNTH_SYNTH1_MONITOR_VC2HIGH_SET(SYNTH_SYNTH1_MONITOR_VC2HIGH_RESET) | \ - SYNTH_SYNTH1_MONITOR_VC2LOW_SET(SYNTH_SYNTH1_MONITOR_VC2LOW_RESET) | \ - SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_SET(SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_RESET)) -#define SYNTH_SYNTH1_HW_MASK (32'h0) -#define SYNTH_SYNTH1_SW_MASK (32'h0 | \ - SYNTH_SYNTH1_PWD_BIAS_MASK | \ - SYNTH_SYNTH1_PWD_CP_MASK | \ - SYNTH_SYNTH1_PWD_VCMON_MASK | \ - SYNTH_SYNTH1_PWD_VCO_MASK | \ - SYNTH_SYNTH1_PWD_PRESC_MASK | \ - SYNTH_SYNTH1_PWD_LODIV_MASK | \ - SYNTH_SYNTH1_PWD_LOMIX_MASK | \ - SYNTH_SYNTH1_FORCE_LO_ON_MASK | \ - SYNTH_SYNTH1_PWD_LOBUF5G_MASK | \ - SYNTH_SYNTH1_VCOREGBYPASS_MASK | \ - SYNTH_SYNTH1_VCOREGLEVEL_MASK | \ - SYNTH_SYNTH1_VCOREGBIAS_MASK | \ - SYNTH_SYNTH1_SLIDINGIF_MASK | \ - SYNTH_SYNTH1_SPARE_PWD_MASK | \ - SYNTH_SYNTH1_CON_VDDVCOREG_MASK | \ - SYNTH_SYNTH1_CON_IVCOREG_MASK | \ - SYNTH_SYNTH1_CON_IVCOBUF_MASK | \ - SYNTH_SYNTH1_SEL_VCMONABUS_MASK | \ - SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK | \ - SYNTH_SYNTH1_PWUP_LODIV_PD_MASK | \ - SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK | \ - SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK | \ - SYNTH_SYNTH1_MONITOR_FB_MASK | \ - SYNTH_SYNTH1_MONITOR_REF_MASK | \ - SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK | \ - SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK | \ - SYNTH_SYNTH1_MONITOR_VC2LOW_MASK | \ - SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) - -#define SYNTH_SYNTH2_ADDRESS 'h00000004 -#define SYNTH_SYNTH2_VC_CAL_REF_MSB 31 -#define SYNTH_SYNTH2_VC_CAL_REF_LSB 29 -#define SYNTH_SYNTH2_VC_CAL_REF_MASK 'he0000000 -#define SYNTH_SYNTH2_VC_CAL_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_CAL_REF_MASK) >> SYNTH_SYNTH2_VC_CAL_REF_LSB) -#define SYNTH_SYNTH2_VC_CAL_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_CAL_REF_LSB) & SYNTH_SYNTH2_VC_CAL_REF_MASK) -#define SYNTH_SYNTH2_VC_CAL_REF_RESET 3'h0 -#define SYNTH_SYNTH2_VC_HI_REF_MSB 28 -#define SYNTH_SYNTH2_VC_HI_REF_LSB 26 -#define SYNTH_SYNTH2_VC_HI_REF_MASK 'h1c000000 -#define SYNTH_SYNTH2_VC_HI_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_HI_REF_MASK) >> SYNTH_SYNTH2_VC_HI_REF_LSB) -#define SYNTH_SYNTH2_VC_HI_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_HI_REF_LSB) & SYNTH_SYNTH2_VC_HI_REF_MASK) -#define SYNTH_SYNTH2_VC_HI_REF_RESET 3'h3 -#define SYNTH_SYNTH2_VC_MID_REF_MSB 25 -#define SYNTH_SYNTH2_VC_MID_REF_LSB 23 -#define SYNTH_SYNTH2_VC_MID_REF_MASK 'h03800000 -#define SYNTH_SYNTH2_VC_MID_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_MID_REF_MASK) >> SYNTH_SYNTH2_VC_MID_REF_LSB) -#define SYNTH_SYNTH2_VC_MID_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_MID_REF_LSB) & SYNTH_SYNTH2_VC_MID_REF_MASK) -#define SYNTH_SYNTH2_VC_MID_REF_RESET 3'h4 -#define SYNTH_SYNTH2_VC_LOW_REF_MSB 22 -#define SYNTH_SYNTH2_VC_LOW_REF_LSB 20 -#define SYNTH_SYNTH2_VC_LOW_REF_MASK 'h00700000 -#define SYNTH_SYNTH2_VC_LOW_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_LOW_REF_MASK) >> SYNTH_SYNTH2_VC_LOW_REF_LSB) -#define SYNTH_SYNTH2_VC_LOW_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_LOW_REF_LSB) & SYNTH_SYNTH2_VC_LOW_REF_MASK) -#define SYNTH_SYNTH2_VC_LOW_REF_RESET 3'h4 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MSB 19 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB 15 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK 'h000f8000 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_GET(x) (((x) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) >> SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_RESET 5'h8 -#define SYNTH_SYNTH2_LOOP_CP_MSB 14 -#define SYNTH_SYNTH2_LOOP_CP_LSB 10 -#define SYNTH_SYNTH2_LOOP_CP_MASK 'h00007c00 -#define SYNTH_SYNTH2_LOOP_CP_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CP_MASK) >> SYNTH_SYNTH2_LOOP_CP_LSB) -#define SYNTH_SYNTH2_LOOP_CP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_CP_LSB) & SYNTH_SYNTH2_LOOP_CP_MASK) -#define SYNTH_SYNTH2_LOOP_CP_RESET 5'h8 -#define SYNTH_SYNTH2_LOOP_RS_MSB 9 -#define SYNTH_SYNTH2_LOOP_RS_LSB 5 -#define SYNTH_SYNTH2_LOOP_RS_MASK 'h000003e0 -#define SYNTH_SYNTH2_LOOP_RS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_RS_MASK) >> SYNTH_SYNTH2_LOOP_RS_LSB) -#define SYNTH_SYNTH2_LOOP_RS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_RS_LSB) & SYNTH_SYNTH2_LOOP_RS_MASK) -#define SYNTH_SYNTH2_LOOP_RS_RESET 5'h5 -#define SYNTH_SYNTH2_LOOP_CS_MSB 4 -#define SYNTH_SYNTH2_LOOP_CS_LSB 3 -#define SYNTH_SYNTH2_LOOP_CS_MASK 'h00000018 -#define SYNTH_SYNTH2_LOOP_CS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CS_MASK) >> SYNTH_SYNTH2_LOOP_CS_LSB) -#define SYNTH_SYNTH2_LOOP_CS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_CS_LSB) & SYNTH_SYNTH2_LOOP_CS_MASK) -#define SYNTH_SYNTH2_LOOP_CS_RESET 2'h3 -#define SYNTH_SYNTH2_SPARE_BITS_MSB 2 -#define SYNTH_SYNTH2_SPARE_BITS_LSB 0 -#define SYNTH_SYNTH2_SPARE_BITS_MASK 'h00000007 -#define SYNTH_SYNTH2_SPARE_BITS_GET(x) (((x) & SYNTH_SYNTH2_SPARE_BITS_MASK) >> SYNTH_SYNTH2_SPARE_BITS_LSB) -#define SYNTH_SYNTH2_SPARE_BITS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_SPARE_BITS_LSB) & SYNTH_SYNTH2_SPARE_BITS_MASK) -#define SYNTH_SYNTH2_SPARE_BITS_RESET 3'h0 -#define SYNTH_SYNTH2_RESET (32'h0 | \ - SYNTH_SYNTH2_VC_CAL_REF_SET(SYNTH_SYNTH2_VC_CAL_REF_RESET) | \ - SYNTH_SYNTH2_VC_HI_REF_SET(SYNTH_SYNTH2_VC_HI_REF_RESET) | \ - SYNTH_SYNTH2_VC_MID_REF_SET(SYNTH_SYNTH2_VC_MID_REF_RESET) | \ - SYNTH_SYNTH2_VC_LOW_REF_SET(SYNTH_SYNTH2_VC_LOW_REF_RESET) | \ - SYNTH_SYNTH2_LOOP_3RD_ORDER_R_SET(SYNTH_SYNTH2_LOOP_3RD_ORDER_R_RESET) | \ - SYNTH_SYNTH2_LOOP_CP_SET(SYNTH_SYNTH2_LOOP_CP_RESET) | \ - SYNTH_SYNTH2_LOOP_RS_SET(SYNTH_SYNTH2_LOOP_RS_RESET) | \ - SYNTH_SYNTH2_LOOP_CS_SET(SYNTH_SYNTH2_LOOP_CS_RESET) | \ - SYNTH_SYNTH2_SPARE_BITS_SET(SYNTH_SYNTH2_SPARE_BITS_RESET)) -#define SYNTH_SYNTH2_HW_MASK (32'h0) -#define SYNTH_SYNTH2_SW_MASK (32'h0 | \ - SYNTH_SYNTH2_VC_CAL_REF_MASK | \ - SYNTH_SYNTH2_VC_HI_REF_MASK | \ - SYNTH_SYNTH2_VC_MID_REF_MASK | \ - SYNTH_SYNTH2_VC_LOW_REF_MASK | \ - SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK | \ - SYNTH_SYNTH2_LOOP_CP_MASK | \ - SYNTH_SYNTH2_LOOP_RS_MASK | \ - SYNTH_SYNTH2_LOOP_CS_MASK | \ - SYNTH_SYNTH2_SPARE_BITS_MASK) - -#define SYNTH_SYNTH3_ADDRESS 'h00000008 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_LSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MASK 'h80000000 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_GET(x) (((x) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) >> SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) -#define SYNTH_SYNTH3_DIS_CLK_XTAL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) -#define SYNTH_SYNTH3_DIS_CLK_XTAL_RESET 1'h0 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_LSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MASK 'h40000000 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_GET(x) (((x) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) >> SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_RESET 1'h1 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MSB 29 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB 24 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK 'h3f000000 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_RESET 6'h14 -#define SYNTH_SYNTH3_WAIT_PWRUP_MSB 23 -#define SYNTH_SYNTH3_WAIT_PWRUP_LSB 18 -#define SYNTH_SYNTH3_WAIT_PWRUP_MASK 'h00fc0000 -#define SYNTH_SYNTH3_WAIT_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_PWRUP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_PWRUP_RESET 6'h8 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MSB 17 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_LSB 12 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MASK 'h0003f000 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_RESET 6'h14 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MSB 11 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_LSB 6 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MASK 'h00000fc0 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_RESET 6'h14 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MSB 5 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_LSB 0 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MASK 'h0000003f -#define SYNTH_SYNTH3_WAIT_VC_CHECK_GET(x) (((x) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) >> SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_RESET 6'h14 -#define SYNTH_SYNTH3_RESET (32'h0 | \ - SYNTH_SYNTH3_DIS_CLK_XTAL_SET(SYNTH_SYNTH3_DIS_CLK_XTAL_RESET) | \ - SYNTH_SYNTH3_SEL_CLK_DIV2_SET(SYNTH_SYNTH3_SEL_CLK_DIV2_RESET) | \ - SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_SET(SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_RESET) | \ - SYNTH_SYNTH3_WAIT_PWRUP_SET(SYNTH_SYNTH3_WAIT_PWRUP_RESET) | \ - SYNTH_SYNTH3_WAIT_CAL_BIN_SET(SYNTH_SYNTH3_WAIT_CAL_BIN_RESET) | \ - SYNTH_SYNTH3_WAIT_CAL_LIN_SET(SYNTH_SYNTH3_WAIT_CAL_LIN_RESET) | \ - SYNTH_SYNTH3_WAIT_VC_CHECK_SET(SYNTH_SYNTH3_WAIT_VC_CHECK_RESET)) -#define SYNTH_SYNTH3_HW_MASK (32'h0) -#define SYNTH_SYNTH3_SW_MASK (32'h0 | \ - SYNTH_SYNTH3_DIS_CLK_XTAL_MASK | \ - SYNTH_SYNTH3_SEL_CLK_DIV2_MASK | \ - SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK | \ - SYNTH_SYNTH3_WAIT_PWRUP_MASK | \ - SYNTH_SYNTH3_WAIT_CAL_BIN_MASK | \ - SYNTH_SYNTH3_WAIT_CAL_LIN_MASK | \ - SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) - -#define SYNTH_SYNTH4_ADDRESS 'h0000000c -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK 'h80000000 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_GET(x) (((x) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) >> SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_RESET 1'h0 -#define SYNTH_SYNTH4_DIS_LOSTVC_MSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_LSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_MASK 'h40000000 -#define SYNTH_SYNTH4_DIS_LOSTVC_GET(x) (((x) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) >> SYNTH_SYNTH4_DIS_LOSTVC_LSB) -#define SYNTH_SYNTH4_DIS_LOSTVC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_DIS_LOSTVC_LSB) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) -#define SYNTH_SYNTH4_DIS_LOSTVC_RESET 1'h0 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_LSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MASK 'h20000000 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_GET(x) (((x) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) >> SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_RESET 1'h0 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK 'h10000000 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_GET(x) (((x) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) >> SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_RESET 1'h1 -#define SYNTH_SYNTH4_FORCE_PINVC_MSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_LSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_MASK 'h08000000 -#define SYNTH_SYNTH4_FORCE_PINVC_GET(x) (((x) & SYNTH_SYNTH4_FORCE_PINVC_MASK) >> SYNTH_SYNTH4_FORCE_PINVC_LSB) -#define SYNTH_SYNTH4_FORCE_PINVC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_FORCE_PINVC_LSB) & SYNTH_SYNTH4_FORCE_PINVC_MASK) -#define SYNTH_SYNTH4_FORCE_PINVC_RESET 1'h0 -#define SYNTH_SYNTH4_FORCE_VCOCAP_MSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_LSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_MASK 'h04000000 -#define SYNTH_SYNTH4_FORCE_VCOCAP_GET(x) (((x) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) >> SYNTH_SYNTH4_FORCE_VCOCAP_LSB) -#define SYNTH_SYNTH4_FORCE_VCOCAP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_FORCE_VCOCAP_LSB) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) -#define SYNTH_SYNTH4_FORCE_VCOCAP_RESET 1'h0 -#define SYNTH_SYNTH4_VCOCAP_OVR_MSB 25 -#define SYNTH_SYNTH4_VCOCAP_OVR_LSB 18 -#define SYNTH_SYNTH4_VCOCAP_OVR_MASK 'h03fc0000 -#define SYNTH_SYNTH4_VCOCAP_OVR_GET(x) (((x) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) >> SYNTH_SYNTH4_VCOCAP_OVR_LSB) -#define SYNTH_SYNTH4_VCOCAP_OVR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_VCOCAP_OVR_LSB) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) -#define SYNTH_SYNTH4_VCOCAP_OVR_RESET 8'h80 -#define SYNTH_SYNTH4_VCOCAPPULLUP_MSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_LSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_MASK 'h00020000 -#define SYNTH_SYNTH4_VCOCAPPULLUP_GET(x) (((x) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) >> SYNTH_SYNTH4_VCOCAPPULLUP_LSB) -#define SYNTH_SYNTH4_VCOCAPPULLUP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_VCOCAPPULLUP_LSB) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) -#define SYNTH_SYNTH4_VCOCAPPULLUP_RESET 1'h1 -#define SYNTH_SYNTH4_REFDIVSEL_MSB 16 -#define SYNTH_SYNTH4_REFDIVSEL_LSB 15 -#define SYNTH_SYNTH4_REFDIVSEL_MASK 'h00018000 -#define SYNTH_SYNTH4_REFDIVSEL_GET(x) (((x) & SYNTH_SYNTH4_REFDIVSEL_MASK) >> SYNTH_SYNTH4_REFDIVSEL_LSB) -#define SYNTH_SYNTH4_REFDIVSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_REFDIVSEL_LSB) & SYNTH_SYNTH4_REFDIVSEL_MASK) -#define SYNTH_SYNTH4_REFDIVSEL_RESET 2'h0 -#define SYNTH_SYNTH4_PFDDELAY_MSB 14 -#define SYNTH_SYNTH4_PFDDELAY_LSB 14 -#define SYNTH_SYNTH4_PFDDELAY_MASK 'h00004000 -#define SYNTH_SYNTH4_PFDDELAY_GET(x) (((x) & SYNTH_SYNTH4_PFDDELAY_MASK) >> SYNTH_SYNTH4_PFDDELAY_LSB) -#define SYNTH_SYNTH4_PFDDELAY_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PFDDELAY_LSB) & SYNTH_SYNTH4_PFDDELAY_MASK) -#define SYNTH_SYNTH4_PFDDELAY_RESET 1'h1 -#define SYNTH_SYNTH4_PFD_DISABLE_MSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_LSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_MASK 'h00002000 -#define SYNTH_SYNTH4_PFD_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_PFD_DISABLE_MASK) >> SYNTH_SYNTH4_PFD_DISABLE_LSB) -#define SYNTH_SYNTH4_PFD_DISABLE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PFD_DISABLE_LSB) & SYNTH_SYNTH4_PFD_DISABLE_MASK) -#define SYNTH_SYNTH4_PFD_DISABLE_RESET 1'h0 -#define SYNTH_SYNTH4_PRESCSEL_MSB 12 -#define SYNTH_SYNTH4_PRESCSEL_LSB 11 -#define SYNTH_SYNTH4_PRESCSEL_MASK 'h00001800 -#define SYNTH_SYNTH4_PRESCSEL_GET(x) (((x) & SYNTH_SYNTH4_PRESCSEL_MASK) >> SYNTH_SYNTH4_PRESCSEL_LSB) -#define SYNTH_SYNTH4_PRESCSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PRESCSEL_LSB) & SYNTH_SYNTH4_PRESCSEL_MASK) -#define SYNTH_SYNTH4_PRESCSEL_RESET 2'h3 -#define SYNTH_SYNTH4_RESET_PRESC_MSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_LSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_MASK 'h00000400 -#define SYNTH_SYNTH4_RESET_PRESC_GET(x) (((x) & SYNTH_SYNTH4_RESET_PRESC_MASK) >> SYNTH_SYNTH4_RESET_PRESC_LSB) -#define SYNTH_SYNTH4_RESET_PRESC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_RESET_PRESC_LSB) & SYNTH_SYNTH4_RESET_PRESC_MASK) -#define SYNTH_SYNTH4_RESET_PRESC_RESET 1'h0 -#define SYNTH_SYNTH4_SDM_DISABLE_MSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_LSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_MASK 'h00000200 -#define SYNTH_SYNTH4_SDM_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_SDM_DISABLE_MASK) >> SYNTH_SYNTH4_SDM_DISABLE_LSB) -#define SYNTH_SYNTH4_SDM_DISABLE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SDM_DISABLE_LSB) & SYNTH_SYNTH4_SDM_DISABLE_MASK) -#define SYNTH_SYNTH4_SDM_DISABLE_RESET 1'h0 -#define SYNTH_SYNTH4_SDM_MODE_MSB 8 -#define SYNTH_SYNTH4_SDM_MODE_LSB 8 -#define SYNTH_SYNTH4_SDM_MODE_MASK 'h00000100 -#define SYNTH_SYNTH4_SDM_MODE_GET(x) (((x) & SYNTH_SYNTH4_SDM_MODE_MASK) >> SYNTH_SYNTH4_SDM_MODE_LSB) -#define SYNTH_SYNTH4_SDM_MODE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SDM_MODE_LSB) & SYNTH_SYNTH4_SDM_MODE_MASK) -#define SYNTH_SYNTH4_SDM_MODE_RESET 1'h0 -#define SYNTH_SYNTH4_SDM_DITHER_MSB 7 -#define SYNTH_SYNTH4_SDM_DITHER_LSB 6 -#define SYNTH_SYNTH4_SDM_DITHER_MASK 'h000000c0 -#define SYNTH_SYNTH4_SDM_DITHER_GET(x) (((x) & SYNTH_SYNTH4_SDM_DITHER_MASK) >> SYNTH_SYNTH4_SDM_DITHER_LSB) -#define SYNTH_SYNTH4_SDM_DITHER_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SDM_DITHER_LSB) & SYNTH_SYNTH4_SDM_DITHER_MASK) -#define SYNTH_SYNTH4_SDM_DITHER_RESET 2'h0 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK 'h00000020 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_GET(x) (((x) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) >> SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_RESET 1'h0 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK 'h00000010 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_GET(x) (((x) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) >> SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_RESET 1'h0 -#define SYNTH_SYNTH4_SPARE_MISC_MSB 3 -#define SYNTH_SYNTH4_SPARE_MISC_LSB 2 -#define SYNTH_SYNTH4_SPARE_MISC_MASK 'h0000000c -#define SYNTH_SYNTH4_SPARE_MISC_GET(x) (((x) & SYNTH_SYNTH4_SPARE_MISC_MASK) >> SYNTH_SYNTH4_SPARE_MISC_LSB) -#define SYNTH_SYNTH4_SPARE_MISC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SPARE_MISC_LSB) & SYNTH_SYNTH4_SPARE_MISC_MASK) -#define SYNTH_SYNTH4_SPARE_MISC_RESET 2'h0 -#define SYNTH_SYNTH4_LONGSHIFTSEL_MSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_LSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_MASK 'h00000002 -#define SYNTH_SYNTH4_LONGSHIFTSEL_GET(x) (((x) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) >> SYNTH_SYNTH4_LONGSHIFTSEL_LSB) -#define SYNTH_SYNTH4_LONGSHIFTSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_LONGSHIFTSEL_LSB) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) -#define SYNTH_SYNTH4_LONGSHIFTSEL_RESET 1'h0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_LSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MASK 'h00000001 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_GET(x) (((x) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) >> SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_RESET 1'h0 -#define SYNTH_SYNTH4_RESET (32'h0 | \ - SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_SET(SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_RESET) | \ - SYNTH_SYNTH4_DIS_LOSTVC_SET(SYNTH_SYNTH4_DIS_LOSTVC_RESET) | \ - SYNTH_SYNTH4_ALWAYS_SHORTR_SET(SYNTH_SYNTH4_ALWAYS_SHORTR_RESET) | \ - SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_SET(SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_RESET) | \ - SYNTH_SYNTH4_FORCE_PINVC_SET(SYNTH_SYNTH4_FORCE_PINVC_RESET) | \ - SYNTH_SYNTH4_FORCE_VCOCAP_SET(SYNTH_SYNTH4_FORCE_VCOCAP_RESET) | \ - SYNTH_SYNTH4_VCOCAP_OVR_SET(SYNTH_SYNTH4_VCOCAP_OVR_RESET) | \ - SYNTH_SYNTH4_VCOCAPPULLUP_SET(SYNTH_SYNTH4_VCOCAPPULLUP_RESET) | \ - SYNTH_SYNTH4_REFDIVSEL_SET(SYNTH_SYNTH4_REFDIVSEL_RESET) | \ - SYNTH_SYNTH4_PFDDELAY_SET(SYNTH_SYNTH4_PFDDELAY_RESET) | \ - SYNTH_SYNTH4_PFD_DISABLE_SET(SYNTH_SYNTH4_PFD_DISABLE_RESET) | \ - SYNTH_SYNTH4_PRESCSEL_SET(SYNTH_SYNTH4_PRESCSEL_RESET) | \ - SYNTH_SYNTH4_RESET_PRESC_SET(SYNTH_SYNTH4_RESET_PRESC_RESET) | \ - SYNTH_SYNTH4_SDM_DISABLE_SET(SYNTH_SYNTH4_SDM_DISABLE_RESET) | \ - SYNTH_SYNTH4_SDM_MODE_SET(SYNTH_SYNTH4_SDM_MODE_RESET) | \ - SYNTH_SYNTH4_SDM_DITHER_SET(SYNTH_SYNTH4_SDM_DITHER_RESET) | \ - SYNTH_SYNTH4_PSCOUNT_FBSEL_SET(SYNTH_SYNTH4_PSCOUNT_FBSEL_RESET) | \ - SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_SET(SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_RESET) | \ - SYNTH_SYNTH4_SPARE_MISC_SET(SYNTH_SYNTH4_SPARE_MISC_RESET) | \ - SYNTH_SYNTH4_LONGSHIFTSEL_SET(SYNTH_SYNTH4_LONGSHIFTSEL_RESET) | \ - SYNTH_SYNTH4_FORCE_SHIFTREG_SET(SYNTH_SYNTH4_FORCE_SHIFTREG_RESET)) -#define SYNTH_SYNTH4_HW_MASK (32'h0) -#define SYNTH_SYNTH4_SW_MASK (32'h0 | \ - SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK | \ - SYNTH_SYNTH4_DIS_LOSTVC_MASK | \ - SYNTH_SYNTH4_ALWAYS_SHORTR_MASK | \ - SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK | \ - SYNTH_SYNTH4_FORCE_PINVC_MASK | \ - SYNTH_SYNTH4_FORCE_VCOCAP_MASK | \ - SYNTH_SYNTH4_VCOCAP_OVR_MASK | \ - SYNTH_SYNTH4_VCOCAPPULLUP_MASK | \ - SYNTH_SYNTH4_REFDIVSEL_MASK | \ - SYNTH_SYNTH4_PFDDELAY_MASK | \ - SYNTH_SYNTH4_PFD_DISABLE_MASK | \ - SYNTH_SYNTH4_PRESCSEL_MASK | \ - SYNTH_SYNTH4_RESET_PRESC_MASK | \ - SYNTH_SYNTH4_SDM_DISABLE_MASK | \ - SYNTH_SYNTH4_SDM_MODE_MASK | \ - SYNTH_SYNTH4_SDM_DITHER_MASK | \ - SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK | \ - SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK | \ - SYNTH_SYNTH4_SPARE_MISC_MASK | \ - SYNTH_SYNTH4_LONGSHIFTSEL_MASK | \ - SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) - -#define SYNTH_SYNTH5_ADDRESS 'h00000010 -#define SYNTH_SYNTH5_LOOP_IP0_MSB 31 -#define SYNTH_SYNTH5_LOOP_IP0_LSB 28 -#define SYNTH_SYNTH5_LOOP_IP0_MASK 'hf0000000 -#define SYNTH_SYNTH5_LOOP_IP0_GET(x) (((x) & SYNTH_SYNTH5_LOOP_IP0_MASK) >> SYNTH_SYNTH5_LOOP_IP0_LSB) -#define SYNTH_SYNTH5_LOOP_IP0_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_LOOP_IP0_LSB) & SYNTH_SYNTH5_LOOP_IP0_MASK) -#define SYNTH_SYNTH5_LOOP_IP0_RESET 4'hd -#define SYNTH_SYNTH5_SLOPE_IP_MSB 27 -#define SYNTH_SYNTH5_SLOPE_IP_LSB 25 -#define SYNTH_SYNTH5_SLOPE_IP_MASK 'h0e000000 -#define SYNTH_SYNTH5_SLOPE_IP_GET(x) (((x) & SYNTH_SYNTH5_SLOPE_IP_MASK) >> SYNTH_SYNTH5_SLOPE_IP_LSB) -#define SYNTH_SYNTH5_SLOPE_IP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_SLOPE_IP_LSB) & SYNTH_SYNTH5_SLOPE_IP_MASK) -#define SYNTH_SYNTH5_SLOPE_IP_RESET 3'h0 -#define SYNTH_SYNTH5_CPBIAS_MSB 24 -#define SYNTH_SYNTH5_CPBIAS_LSB 23 -#define SYNTH_SYNTH5_CPBIAS_MASK 'h01800000 -#define SYNTH_SYNTH5_CPBIAS_GET(x) (((x) & SYNTH_SYNTH5_CPBIAS_MASK) >> SYNTH_SYNTH5_CPBIAS_LSB) -#define SYNTH_SYNTH5_CPBIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CPBIAS_LSB) & SYNTH_SYNTH5_CPBIAS_MASK) -#define SYNTH_SYNTH5_CPBIAS_RESET 2'h1 -#define SYNTH_SYNTH5_CPSTEERING_EN_MSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_LSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_MASK 'h00400000 -#define SYNTH_SYNTH5_CPSTEERING_EN_GET(x) (((x) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) >> SYNTH_SYNTH5_CPSTEERING_EN_LSB) -#define SYNTH_SYNTH5_CPSTEERING_EN_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CPSTEERING_EN_LSB) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) -#define SYNTH_SYNTH5_CPSTEERING_EN_RESET 1'h0 -#define SYNTH_SYNTH5_CPLOWLK_MSB 21 -#define SYNTH_SYNTH5_CPLOWLK_LSB 21 -#define SYNTH_SYNTH5_CPLOWLK_MASK 'h00200000 -#define SYNTH_SYNTH5_CPLOWLK_GET(x) (((x) & SYNTH_SYNTH5_CPLOWLK_MASK) >> SYNTH_SYNTH5_CPLOWLK_LSB) -#define SYNTH_SYNTH5_CPLOWLK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CPLOWLK_LSB) & SYNTH_SYNTH5_CPLOWLK_MASK) -#define SYNTH_SYNTH5_CPLOWLK_RESET 1'h0 -#define SYNTH_SYNTH5_LOOPLEAKCUR_MSB 20 -#define SYNTH_SYNTH5_LOOPLEAKCUR_LSB 17 -#define SYNTH_SYNTH5_LOOPLEAKCUR_MASK 'h001e0000 -#define SYNTH_SYNTH5_LOOPLEAKCUR_GET(x) (((x) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) >> SYNTH_SYNTH5_LOOPLEAKCUR_LSB) -#define SYNTH_SYNTH5_LOOPLEAKCUR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_LOOPLEAKCUR_LSB) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) -#define SYNTH_SYNTH5_LOOPLEAKCUR_RESET 4'h0 -#define SYNTH_SYNTH5_CAPRANGE1_MSB 16 -#define SYNTH_SYNTH5_CAPRANGE1_LSB 13 -#define SYNTH_SYNTH5_CAPRANGE1_MASK 'h0001e000 -#define SYNTH_SYNTH5_CAPRANGE1_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE1_MASK) >> SYNTH_SYNTH5_CAPRANGE1_LSB) -#define SYNTH_SYNTH5_CAPRANGE1_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CAPRANGE1_LSB) & SYNTH_SYNTH5_CAPRANGE1_MASK) -#define SYNTH_SYNTH5_CAPRANGE1_RESET 4'h4 -#define SYNTH_SYNTH5_CAPRANGE2_MSB 12 -#define SYNTH_SYNTH5_CAPRANGE2_LSB 9 -#define SYNTH_SYNTH5_CAPRANGE2_MASK 'h00001e00 -#define SYNTH_SYNTH5_CAPRANGE2_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE2_MASK) >> SYNTH_SYNTH5_CAPRANGE2_LSB) -#define SYNTH_SYNTH5_CAPRANGE2_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CAPRANGE2_LSB) & SYNTH_SYNTH5_CAPRANGE2_MASK) -#define SYNTH_SYNTH5_CAPRANGE2_RESET 4'h8 -#define SYNTH_SYNTH5_CAPRANGE3_MSB 8 -#define SYNTH_SYNTH5_CAPRANGE3_LSB 5 -#define SYNTH_SYNTH5_CAPRANGE3_MASK 'h000001e0 -#define SYNTH_SYNTH5_CAPRANGE3_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE3_MASK) >> SYNTH_SYNTH5_CAPRANGE3_LSB) -#define SYNTH_SYNTH5_CAPRANGE3_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CAPRANGE3_LSB) & SYNTH_SYNTH5_CAPRANGE3_MASK) -#define SYNTH_SYNTH5_CAPRANGE3_RESET 4'hc -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK 'h00000010 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_RESET 1'h0 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MSB 3 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB 2 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK 'h0000000c -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_GET(x) (((x) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) >> SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_RESET 2'h2 -#define SYNTH_SYNTH5_SPARE_MSB 1 -#define SYNTH_SYNTH5_SPARE_LSB 0 -#define SYNTH_SYNTH5_SPARE_MASK 'h00000003 -#define SYNTH_SYNTH5_SPARE_GET(x) (((x) & SYNTH_SYNTH5_SPARE_MASK) >> SYNTH_SYNTH5_SPARE_LSB) -#define SYNTH_SYNTH5_SPARE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_SPARE_LSB) & SYNTH_SYNTH5_SPARE_MASK) -#define SYNTH_SYNTH5_SPARE_RESET 2'h0 -#define SYNTH_SYNTH5_RESET (32'h0 | \ - SYNTH_SYNTH5_LOOP_IP0_SET(SYNTH_SYNTH5_LOOP_IP0_RESET) | \ - SYNTH_SYNTH5_SLOPE_IP_SET(SYNTH_SYNTH5_SLOPE_IP_RESET) | \ - SYNTH_SYNTH5_CPBIAS_SET(SYNTH_SYNTH5_CPBIAS_RESET) | \ - SYNTH_SYNTH5_CPSTEERING_EN_SET(SYNTH_SYNTH5_CPSTEERING_EN_RESET) | \ - SYNTH_SYNTH5_CPLOWLK_SET(SYNTH_SYNTH5_CPLOWLK_RESET) | \ - SYNTH_SYNTH5_LOOPLEAKCUR_SET(SYNTH_SYNTH5_LOOPLEAKCUR_RESET) | \ - SYNTH_SYNTH5_CAPRANGE1_SET(SYNTH_SYNTH5_CAPRANGE1_RESET) | \ - SYNTH_SYNTH5_CAPRANGE2_SET(SYNTH_SYNTH5_CAPRANGE2_RESET) | \ - SYNTH_SYNTH5_CAPRANGE3_SET(SYNTH_SYNTH5_CAPRANGE3_RESET) | \ - SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_SET(SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_RESET) | \ - SYNTH_SYNTH5_LOBUF5GTUNE_OVR_SET(SYNTH_SYNTH5_LOBUF5GTUNE_OVR_RESET) | \ - SYNTH_SYNTH5_SPARE_SET(SYNTH_SYNTH5_SPARE_RESET)) -#define SYNTH_SYNTH5_HW_MASK (32'h0) -#define SYNTH_SYNTH5_SW_MASK (32'h0 | \ - SYNTH_SYNTH5_LOOP_IP0_MASK | \ - SYNTH_SYNTH5_SLOPE_IP_MASK | \ - SYNTH_SYNTH5_CPBIAS_MASK | \ - SYNTH_SYNTH5_CPSTEERING_EN_MASK | \ - SYNTH_SYNTH5_CPLOWLK_MASK | \ - SYNTH_SYNTH5_LOOPLEAKCUR_MASK | \ - SYNTH_SYNTH5_CAPRANGE1_MASK | \ - SYNTH_SYNTH5_CAPRANGE2_MASK | \ - SYNTH_SYNTH5_CAPRANGE3_MASK | \ - SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK | \ - SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK | \ - SYNTH_SYNTH5_SPARE_MASK) - -#define SYNTH_SYNTH6_ADDRESS 'h00000014 -#define SYNTH_SYNTH6_IRCP_MSB 31 -#define SYNTH_SYNTH6_IRCP_LSB 29 -#define SYNTH_SYNTH6_IRCP_MASK 'he0000000 -#define SYNTH_SYNTH6_IRCP_GET(x) (((x) & SYNTH_SYNTH6_IRCP_MASK) >> SYNTH_SYNTH6_IRCP_LSB) -#define SYNTH_SYNTH6_IRCP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_IRCP_LSB) & SYNTH_SYNTH6_IRCP_MASK) -#define SYNTH_SYNTH6_IRCP_RESET 3'h4 -#define SYNTH_SYNTH6_IRVCMON_MSB 28 -#define SYNTH_SYNTH6_IRVCMON_LSB 26 -#define SYNTH_SYNTH6_IRVCMON_MASK 'h1c000000 -#define SYNTH_SYNTH6_IRVCMON_GET(x) (((x) & SYNTH_SYNTH6_IRVCMON_MASK) >> SYNTH_SYNTH6_IRVCMON_LSB) -#define SYNTH_SYNTH6_IRVCMON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_IRVCMON_LSB) & SYNTH_SYNTH6_IRVCMON_MASK) -#define SYNTH_SYNTH6_IRVCMON_RESET 3'h4 -#define SYNTH_SYNTH6_IRSPARE_MSB 25 -#define SYNTH_SYNTH6_IRSPARE_LSB 23 -#define SYNTH_SYNTH6_IRSPARE_MASK 'h03800000 -#define SYNTH_SYNTH6_IRSPARE_GET(x) (((x) & SYNTH_SYNTH6_IRSPARE_MASK) >> SYNTH_SYNTH6_IRSPARE_LSB) -#define SYNTH_SYNTH6_IRSPARE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_IRSPARE_LSB) & SYNTH_SYNTH6_IRSPARE_MASK) -#define SYNTH_SYNTH6_IRSPARE_RESET 3'h4 -#define SYNTH_SYNTH6_ICPRESC_MSB 22 -#define SYNTH_SYNTH6_ICPRESC_LSB 20 -#define SYNTH_SYNTH6_ICPRESC_MASK 'h00700000 -#define SYNTH_SYNTH6_ICPRESC_GET(x) (((x) & SYNTH_SYNTH6_ICPRESC_MASK) >> SYNTH_SYNTH6_ICPRESC_LSB) -#define SYNTH_SYNTH6_ICPRESC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICPRESC_LSB) & SYNTH_SYNTH6_ICPRESC_MASK) -#define SYNTH_SYNTH6_ICPRESC_RESET 3'h4 -#define SYNTH_SYNTH6_ICLODIV_MSB 19 -#define SYNTH_SYNTH6_ICLODIV_LSB 17 -#define SYNTH_SYNTH6_ICLODIV_MASK 'h000e0000 -#define SYNTH_SYNTH6_ICLODIV_GET(x) (((x) & SYNTH_SYNTH6_ICLODIV_MASK) >> SYNTH_SYNTH6_ICLODIV_LSB) -#define SYNTH_SYNTH6_ICLODIV_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICLODIV_LSB) & SYNTH_SYNTH6_ICLODIV_MASK) -#define SYNTH_SYNTH6_ICLODIV_RESET 3'h4 -#define SYNTH_SYNTH6_ICLOMIX_MSB 16 -#define SYNTH_SYNTH6_ICLOMIX_LSB 14 -#define SYNTH_SYNTH6_ICLOMIX_MASK 'h0001c000 -#define SYNTH_SYNTH6_ICLOMIX_GET(x) (((x) & SYNTH_SYNTH6_ICLOMIX_MASK) >> SYNTH_SYNTH6_ICLOMIX_LSB) -#define SYNTH_SYNTH6_ICLOMIX_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICLOMIX_LSB) & SYNTH_SYNTH6_ICLOMIX_MASK) -#define SYNTH_SYNTH6_ICLOMIX_RESET 3'h4 -#define SYNTH_SYNTH6_ICSPAREA_MSB 13 -#define SYNTH_SYNTH6_ICSPAREA_LSB 11 -#define SYNTH_SYNTH6_ICSPAREA_MASK 'h00003800 -#define SYNTH_SYNTH6_ICSPAREA_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREA_MASK) >> SYNTH_SYNTH6_ICSPAREA_LSB) -#define SYNTH_SYNTH6_ICSPAREA_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICSPAREA_LSB) & SYNTH_SYNTH6_ICSPAREA_MASK) -#define SYNTH_SYNTH6_ICSPAREA_RESET 3'h4 -#define SYNTH_SYNTH6_ICSPAREB_MSB 10 -#define SYNTH_SYNTH6_ICSPAREB_LSB 8 -#define SYNTH_SYNTH6_ICSPAREB_MASK 'h00000700 -#define SYNTH_SYNTH6_ICSPAREB_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREB_MASK) >> SYNTH_SYNTH6_ICSPAREB_LSB) -#define SYNTH_SYNTH6_ICSPAREB_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICSPAREB_LSB) & SYNTH_SYNTH6_ICSPAREB_MASK) -#define SYNTH_SYNTH6_ICSPAREB_RESET 3'h4 -#define SYNTH_SYNTH6_ICVCO_MSB 7 -#define SYNTH_SYNTH6_ICVCO_LSB 5 -#define SYNTH_SYNTH6_ICVCO_MASK 'h000000e0 -#define SYNTH_SYNTH6_ICVCO_GET(x) (((x) & SYNTH_SYNTH6_ICVCO_MASK) >> SYNTH_SYNTH6_ICVCO_LSB) -#define SYNTH_SYNTH6_ICVCO_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICVCO_LSB) & SYNTH_SYNTH6_ICVCO_MASK) -#define SYNTH_SYNTH6_ICVCO_RESET 3'h4 -#define SYNTH_SYNTH6_VCOBUFBIAS_MSB 4 -#define SYNTH_SYNTH6_VCOBUFBIAS_LSB 3 -#define SYNTH_SYNTH6_VCOBUFBIAS_MASK 'h00000018 -#define SYNTH_SYNTH6_VCOBUFBIAS_GET(x) (((x) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) >> SYNTH_SYNTH6_VCOBUFBIAS_LSB) -#define SYNTH_SYNTH6_VCOBUFBIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_VCOBUFBIAS_LSB) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) -#define SYNTH_SYNTH6_VCOBUFBIAS_RESET 2'h2 -#define SYNTH_SYNTH6_SPARE_BIAS_MSB 2 -#define SYNTH_SYNTH6_SPARE_BIAS_LSB 0 -#define SYNTH_SYNTH6_SPARE_BIAS_MASK 'h00000007 -#define SYNTH_SYNTH6_SPARE_BIAS_GET(x) (((x) & SYNTH_SYNTH6_SPARE_BIAS_MASK) >> SYNTH_SYNTH6_SPARE_BIAS_LSB) -#define SYNTH_SYNTH6_SPARE_BIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_SPARE_BIAS_LSB) & SYNTH_SYNTH6_SPARE_BIAS_MASK) -#define SYNTH_SYNTH6_SPARE_BIAS_RESET 3'h0 -#define SYNTH_SYNTH6_RESET (32'h0 | \ - SYNTH_SYNTH6_IRCP_SET(SYNTH_SYNTH6_IRCP_RESET) | \ - SYNTH_SYNTH6_IRVCMON_SET(SYNTH_SYNTH6_IRVCMON_RESET) | \ - SYNTH_SYNTH6_IRSPARE_SET(SYNTH_SYNTH6_IRSPARE_RESET) | \ - SYNTH_SYNTH6_ICPRESC_SET(SYNTH_SYNTH6_ICPRESC_RESET) | \ - SYNTH_SYNTH6_ICLODIV_SET(SYNTH_SYNTH6_ICLODIV_RESET) | \ - SYNTH_SYNTH6_ICLOMIX_SET(SYNTH_SYNTH6_ICLOMIX_RESET) | \ - SYNTH_SYNTH6_ICSPAREA_SET(SYNTH_SYNTH6_ICSPAREA_RESET) | \ - SYNTH_SYNTH6_ICSPAREB_SET(SYNTH_SYNTH6_ICSPAREB_RESET) | \ - SYNTH_SYNTH6_ICVCO_SET(SYNTH_SYNTH6_ICVCO_RESET) | \ - SYNTH_SYNTH6_VCOBUFBIAS_SET(SYNTH_SYNTH6_VCOBUFBIAS_RESET) | \ - SYNTH_SYNTH6_SPARE_BIAS_SET(SYNTH_SYNTH6_SPARE_BIAS_RESET)) -#define SYNTH_SYNTH6_HW_MASK (32'h0) -#define SYNTH_SYNTH6_SW_MASK (32'h0 | \ - SYNTH_SYNTH6_IRCP_MASK | \ - SYNTH_SYNTH6_IRVCMON_MASK | \ - SYNTH_SYNTH6_IRSPARE_MASK | \ - SYNTH_SYNTH6_ICPRESC_MASK | \ - SYNTH_SYNTH6_ICLODIV_MASK | \ - SYNTH_SYNTH6_ICLOMIX_MASK | \ - SYNTH_SYNTH6_ICSPAREA_MASK | \ - SYNTH_SYNTH6_ICSPAREB_MASK | \ - SYNTH_SYNTH6_ICVCO_MASK | \ - SYNTH_SYNTH6_VCOBUFBIAS_MASK | \ - SYNTH_SYNTH6_SPARE_BIAS_MASK) - -#define SYNTH_SYNTH7_ADDRESS 'h00000018 -#define SYNTH_SYNTH7_SYNTH_ON_MSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_LSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_MASK 'h80000000 -#define SYNTH_SYNTH7_SYNTH_ON_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_ON_MASK) >> SYNTH_SYNTH7_SYNTH_ON_LSB) -#define SYNTH_SYNTH7_SYNTH_ON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SYNTH_ON_LSB) & SYNTH_SYNTH7_SYNTH_ON_MASK) -#define SYNTH_SYNTH7_SYNTH_ON_RESET 1'h0 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MSB 30 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_LSB 27 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MASK 'h78000000 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) >> SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_RESET 4'h0 -#define SYNTH_SYNTH7_CAP_SEARCH_MSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_LSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_MASK 'h04000000 -#define SYNTH_SYNTH7_CAP_SEARCH_GET(x) (((x) & SYNTH_SYNTH7_CAP_SEARCH_MASK) >> SYNTH_SYNTH7_CAP_SEARCH_LSB) -#define SYNTH_SYNTH7_CAP_SEARCH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_CAP_SEARCH_LSB) & SYNTH_SYNTH7_CAP_SEARCH_MASK) -#define SYNTH_SYNTH7_CAP_SEARCH_RESET 1'h0 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK 'h02000000 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) >> SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_RESET 1'h0 -#define SYNTH_SYNTH7_PIN_VC_MSB 24 -#define SYNTH_SYNTH7_PIN_VC_LSB 24 -#define SYNTH_SYNTH7_PIN_VC_MASK 'h01000000 -#define SYNTH_SYNTH7_PIN_VC_GET(x) (((x) & SYNTH_SYNTH7_PIN_VC_MASK) >> SYNTH_SYNTH7_PIN_VC_LSB) -#define SYNTH_SYNTH7_PIN_VC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_PIN_VC_LSB) & SYNTH_SYNTH7_PIN_VC_MASK) -#define SYNTH_SYNTH7_PIN_VC_RESET 1'h0 -#define SYNTH_SYNTH7_VCO_CAP_ST_MSB 23 -#define SYNTH_SYNTH7_VCO_CAP_ST_LSB 16 -#define SYNTH_SYNTH7_VCO_CAP_ST_MASK 'h00ff0000 -#define SYNTH_SYNTH7_VCO_CAP_ST_GET(x) (((x) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) >> SYNTH_SYNTH7_VCO_CAP_ST_LSB) -#define SYNTH_SYNTH7_VCO_CAP_ST_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_VCO_CAP_ST_LSB) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) -#define SYNTH_SYNTH7_VCO_CAP_ST_RESET 8'h0 -#define SYNTH_SYNTH7_SHORT_R_MSB 15 -#define SYNTH_SYNTH7_SHORT_R_LSB 15 -#define SYNTH_SYNTH7_SHORT_R_MASK 'h00008000 -#define SYNTH_SYNTH7_SHORT_R_GET(x) (((x) & SYNTH_SYNTH7_SHORT_R_MASK) >> SYNTH_SYNTH7_SHORT_R_LSB) -#define SYNTH_SYNTH7_SHORT_R_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SHORT_R_LSB) & SYNTH_SYNTH7_SHORT_R_MASK) -#define SYNTH_SYNTH7_SHORT_R_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_RFD_MSB 14 -#define SYNTH_SYNTH7_RESET_RFD_LSB 14 -#define SYNTH_SYNTH7_RESET_RFD_MASK 'h00004000 -#define SYNTH_SYNTH7_RESET_RFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_RFD_MASK) >> SYNTH_SYNTH7_RESET_RFD_LSB) -#define SYNTH_SYNTH7_RESET_RFD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_RFD_LSB) & SYNTH_SYNTH7_RESET_RFD_MASK) -#define SYNTH_SYNTH7_RESET_RFD_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_PFD_MSB 13 -#define SYNTH_SYNTH7_RESET_PFD_LSB 13 -#define SYNTH_SYNTH7_RESET_PFD_MASK 'h00002000 -#define SYNTH_SYNTH7_RESET_PFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_PFD_MASK) >> SYNTH_SYNTH7_RESET_PFD_LSB) -#define SYNTH_SYNTH7_RESET_PFD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_PFD_LSB) & SYNTH_SYNTH7_RESET_PFD_MASK) -#define SYNTH_SYNTH7_RESET_PFD_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK 'h00001000 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_GET(x) (((x) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) >> SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_SDM_B_MSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_LSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_MASK 'h00000800 -#define SYNTH_SYNTH7_RESET_SDM_B_GET(x) (((x) & SYNTH_SYNTH7_RESET_SDM_B_MASK) >> SYNTH_SYNTH7_RESET_SDM_B_LSB) -#define SYNTH_SYNTH7_RESET_SDM_B_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_SDM_B_LSB) & SYNTH_SYNTH7_RESET_SDM_B_MASK) -#define SYNTH_SYNTH7_RESET_SDM_B_RESET 1'h0 -#define SYNTH_SYNTH7_VC2HIGH_MSB 10 -#define SYNTH_SYNTH7_VC2HIGH_LSB 10 -#define SYNTH_SYNTH7_VC2HIGH_MASK 'h00000400 -#define SYNTH_SYNTH7_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH7_VC2HIGH_MASK) >> SYNTH_SYNTH7_VC2HIGH_LSB) -#define SYNTH_SYNTH7_VC2HIGH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_VC2HIGH_LSB) & SYNTH_SYNTH7_VC2HIGH_MASK) -#define SYNTH_SYNTH7_VC2HIGH_RESET 1'h0 -#define SYNTH_SYNTH7_VC2LOW_MSB 9 -#define SYNTH_SYNTH7_VC2LOW_LSB 9 -#define SYNTH_SYNTH7_VC2LOW_MASK 'h00000200 -#define SYNTH_SYNTH7_VC2LOW_GET(x) (((x) & SYNTH_SYNTH7_VC2LOW_MASK) >> SYNTH_SYNTH7_VC2LOW_LSB) -#define SYNTH_SYNTH7_VC2LOW_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_VC2LOW_LSB) & SYNTH_SYNTH7_VC2LOW_MASK) -#define SYNTH_SYNTH7_VC2LOW_RESET 1'h0 -#define SYNTH_SYNTH7_LOOP_IP_MSB 8 -#define SYNTH_SYNTH7_LOOP_IP_LSB 5 -#define SYNTH_SYNTH7_LOOP_IP_MASK 'h000001e0 -#define SYNTH_SYNTH7_LOOP_IP_GET(x) (((x) & SYNTH_SYNTH7_LOOP_IP_MASK) >> SYNTH_SYNTH7_LOOP_IP_LSB) -#define SYNTH_SYNTH7_LOOP_IP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_LOOP_IP_LSB) & SYNTH_SYNTH7_LOOP_IP_MASK) -#define SYNTH_SYNTH7_LOOP_IP_RESET 4'h0 -#define SYNTH_SYNTH7_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH7_LOBUF5GTUNE_LSB 3 -#define SYNTH_SYNTH7_LOBUF5GTUNE_MASK 'h00000018 -#define SYNTH_SYNTH7_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH7_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH7_LOBUF5GTUNE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_LOBUF5GTUNE_LSB) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH7_LOBUF5GTUNE_RESET 2'h0 -#define SYNTH_SYNTH7_SPARE_READ_MSB 2 -#define SYNTH_SYNTH7_SPARE_READ_LSB 0 -#define SYNTH_SYNTH7_SPARE_READ_MASK 'h00000007 -#define SYNTH_SYNTH7_SPARE_READ_GET(x) (((x) & SYNTH_SYNTH7_SPARE_READ_MASK) >> SYNTH_SYNTH7_SPARE_READ_LSB) -#define SYNTH_SYNTH7_SPARE_READ_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SPARE_READ_LSB) & SYNTH_SYNTH7_SPARE_READ_MASK) -#define SYNTH_SYNTH7_SPARE_READ_RESET 3'h0 -#define SYNTH_SYNTH7_RESET (32'h0 | \ - SYNTH_SYNTH7_SYNTH_ON_SET(SYNTH_SYNTH7_SYNTH_ON_RESET) | \ - SYNTH_SYNTH7_SYNTH_SM_STATE_SET(SYNTH_SYNTH7_SYNTH_SM_STATE_RESET) | \ - SYNTH_SYNTH7_CAP_SEARCH_SET(SYNTH_SYNTH7_CAP_SEARCH_RESET) | \ - SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_SET(SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_RESET) | \ - SYNTH_SYNTH7_PIN_VC_SET(SYNTH_SYNTH7_PIN_VC_RESET) | \ - SYNTH_SYNTH7_VCO_CAP_ST_SET(SYNTH_SYNTH7_VCO_CAP_ST_RESET) | \ - SYNTH_SYNTH7_SHORT_R_SET(SYNTH_SYNTH7_SHORT_R_RESET) | \ - SYNTH_SYNTH7_RESET_RFD_SET(SYNTH_SYNTH7_RESET_RFD_RESET) | \ - SYNTH_SYNTH7_RESET_PFD_SET(SYNTH_SYNTH7_RESET_PFD_RESET) | \ - SYNTH_SYNTH7_RESET_PSCOUNTERS_SET(SYNTH_SYNTH7_RESET_PSCOUNTERS_RESET) | \ - SYNTH_SYNTH7_RESET_SDM_B_SET(SYNTH_SYNTH7_RESET_SDM_B_RESET) | \ - SYNTH_SYNTH7_VC2HIGH_SET(SYNTH_SYNTH7_VC2HIGH_RESET) | \ - SYNTH_SYNTH7_VC2LOW_SET(SYNTH_SYNTH7_VC2LOW_RESET) | \ - SYNTH_SYNTH7_LOOP_IP_SET(SYNTH_SYNTH7_LOOP_IP_RESET) | \ - SYNTH_SYNTH7_LOBUF5GTUNE_SET(SYNTH_SYNTH7_LOBUF5GTUNE_RESET) | \ - SYNTH_SYNTH7_SPARE_READ_SET(SYNTH_SYNTH7_SPARE_READ_RESET)) -#define SYNTH_SYNTH7_HW_MASK (32'h0 | \ - SYNTH_SYNTH7_SYNTH_ON_MASK | \ - SYNTH_SYNTH7_SYNTH_SM_STATE_MASK | \ - SYNTH_SYNTH7_CAP_SEARCH_MASK | \ - SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK | \ - SYNTH_SYNTH7_PIN_VC_MASK | \ - SYNTH_SYNTH7_VCO_CAP_ST_MASK | \ - SYNTH_SYNTH7_SHORT_R_MASK | \ - SYNTH_SYNTH7_RESET_RFD_MASK | \ - SYNTH_SYNTH7_RESET_PFD_MASK | \ - SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK | \ - SYNTH_SYNTH7_RESET_SDM_B_MASK | \ - SYNTH_SYNTH7_VC2HIGH_MASK | \ - SYNTH_SYNTH7_VC2LOW_MASK | \ - SYNTH_SYNTH7_LOOP_IP_MASK | \ - SYNTH_SYNTH7_LOBUF5GTUNE_MASK | \ - SYNTH_SYNTH7_SPARE_READ_MASK) -#define SYNTH_SYNTH7_SW_MASK (32'h0) - -#define SYNTH_SYNTH8_ADDRESS 'h0000001c -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK 'h80000000 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_GET(x) (((x) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) >> SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_RESET 1'h0 -#define SYNTH_SYNTH8_FRACMODE_MSB 30 -#define SYNTH_SYNTH8_FRACMODE_LSB 30 -#define SYNTH_SYNTH8_FRACMODE_MASK 'h40000000 -#define SYNTH_SYNTH8_FRACMODE_GET(x) (((x) & SYNTH_SYNTH8_FRACMODE_MASK) >> SYNTH_SYNTH8_FRACMODE_LSB) -#define SYNTH_SYNTH8_FRACMODE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_FRACMODE_LSB) & SYNTH_SYNTH8_FRACMODE_MASK) -#define SYNTH_SYNTH8_FRACMODE_RESET 1'h0 -#define SYNTH_SYNTH8_AMODEREFSEL_MSB 29 -#define SYNTH_SYNTH8_AMODEREFSEL_LSB 28 -#define SYNTH_SYNTH8_AMODEREFSEL_MASK 'h30000000 -#define SYNTH_SYNTH8_AMODEREFSEL_GET(x) (((x) & SYNTH_SYNTH8_AMODEREFSEL_MASK) >> SYNTH_SYNTH8_AMODEREFSEL_LSB) -#define SYNTH_SYNTH8_AMODEREFSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_AMODEREFSEL_LSB) & SYNTH_SYNTH8_AMODEREFSEL_MASK) -#define SYNTH_SYNTH8_AMODEREFSEL_RESET 2'h0 -#define SYNTH_SYNTH8_SPARE_MSB 27 -#define SYNTH_SYNTH8_SPARE_LSB 27 -#define SYNTH_SYNTH8_SPARE_MASK 'h08000000 -#define SYNTH_SYNTH8_SPARE_GET(x) (((x) & SYNTH_SYNTH8_SPARE_MASK) >> SYNTH_SYNTH8_SPARE_LSB) -#define SYNTH_SYNTH8_SPARE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_SPARE_LSB) & SYNTH_SYNTH8_SPARE_MASK) -#define SYNTH_SYNTH8_SPARE_RESET 1'h0 -#define SYNTH_SYNTH8_CHANSEL_MSB 26 -#define SYNTH_SYNTH8_CHANSEL_LSB 18 -#define SYNTH_SYNTH8_CHANSEL_MASK 'h07fc0000 -#define SYNTH_SYNTH8_CHANSEL_GET(x) (((x) & SYNTH_SYNTH8_CHANSEL_MASK) >> SYNTH_SYNTH8_CHANSEL_LSB) -#define SYNTH_SYNTH8_CHANSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_CHANSEL_LSB) & SYNTH_SYNTH8_CHANSEL_MASK) -#define SYNTH_SYNTH8_CHANSEL_RESET 9'h0 -#define SYNTH_SYNTH8_CHANFRAC_MSB 17 -#define SYNTH_SYNTH8_CHANFRAC_LSB 1 -#define SYNTH_SYNTH8_CHANFRAC_MASK 'h0003fffe -#define SYNTH_SYNTH8_CHANFRAC_GET(x) (((x) & SYNTH_SYNTH8_CHANFRAC_MASK) >> SYNTH_SYNTH8_CHANFRAC_LSB) -#define SYNTH_SYNTH8_CHANFRAC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_CHANFRAC_LSB) & SYNTH_SYNTH8_CHANFRAC_MASK) -#define SYNTH_SYNTH8_CHANFRAC_RESET 17'h0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_MSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_LSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_MASK 'h00000001 -#define SYNTH_SYNTH8_FORCE_FRACLSB_GET(x) (((x) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) >> SYNTH_SYNTH8_FORCE_FRACLSB_LSB) -#define SYNTH_SYNTH8_FORCE_FRACLSB_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_FORCE_FRACLSB_LSB) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) -#define SYNTH_SYNTH8_FORCE_FRACLSB_RESET 1'h0 -#define SYNTH_SYNTH8_RESET (32'h0 | \ - SYNTH_SYNTH8_LOADSYNTHCHANNEL_SET(SYNTH_SYNTH8_LOADSYNTHCHANNEL_RESET) | \ - SYNTH_SYNTH8_FRACMODE_SET(SYNTH_SYNTH8_FRACMODE_RESET) | \ - SYNTH_SYNTH8_AMODEREFSEL_SET(SYNTH_SYNTH8_AMODEREFSEL_RESET) | \ - SYNTH_SYNTH8_SPARE_SET(SYNTH_SYNTH8_SPARE_RESET) | \ - SYNTH_SYNTH8_CHANSEL_SET(SYNTH_SYNTH8_CHANSEL_RESET) | \ - SYNTH_SYNTH8_CHANFRAC_SET(SYNTH_SYNTH8_CHANFRAC_RESET) | \ - SYNTH_SYNTH8_FORCE_FRACLSB_SET(SYNTH_SYNTH8_FORCE_FRACLSB_RESET)) -#define SYNTH_SYNTH8_HW_MASK (32'h0 | \ - SYNTH_SYNTH8_FRACMODE_MASK | \ - SYNTH_SYNTH8_AMODEREFSEL_MASK | \ - SYNTH_SYNTH8_SPARE_MASK | \ - SYNTH_SYNTH8_CHANSEL_MASK | \ - SYNTH_SYNTH8_CHANFRAC_MASK) -#define SYNTH_SYNTH8_SW_MASK (32'h0 | \ - SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK | \ - SYNTH_SYNTH8_FRACMODE_MASK | \ - SYNTH_SYNTH8_AMODEREFSEL_MASK | \ - SYNTH_SYNTH8_SPARE_MASK | \ - SYNTH_SYNTH8_CHANSEL_MASK | \ - SYNTH_SYNTH8_CHANFRAC_MASK | \ - SYNTH_SYNTH8_FORCE_FRACLSB_MASK) - -#define RF5G_RF5G1_ADDRESS 'h00000020 -#define RF5G_RF5G1_PDTXLO5_MSB 31 -#define RF5G_RF5G1_PDTXLO5_LSB 31 -#define RF5G_RF5G1_PDTXLO5_MASK 'h80000000 -#define RF5G_RF5G1_PDTXLO5_GET(x) (((x) & RF5G_RF5G1_PDTXLO5_MASK) >> RF5G_RF5G1_PDTXLO5_LSB) -#define RF5G_RF5G1_PDTXLO5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDTXLO5_LSB) & RF5G_RF5G1_PDTXLO5_MASK) -#define RF5G_RF5G1_PDTXLO5_RESET 1'h0 -#define RF5G_RF5G1_PDTXMIX5_MSB 30 -#define RF5G_RF5G1_PDTXMIX5_LSB 30 -#define RF5G_RF5G1_PDTXMIX5_MASK 'h40000000 -#define RF5G_RF5G1_PDTXMIX5_GET(x) (((x) & RF5G_RF5G1_PDTXMIX5_MASK) >> RF5G_RF5G1_PDTXMIX5_LSB) -#define RF5G_RF5G1_PDTXMIX5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDTXMIX5_LSB) & RF5G_RF5G1_PDTXMIX5_MASK) -#define RF5G_RF5G1_PDTXMIX5_RESET 1'h0 -#define RF5G_RF5G1_PDTXBUF5_MSB 29 -#define RF5G_RF5G1_PDTXBUF5_LSB 29 -#define RF5G_RF5G1_PDTXBUF5_MASK 'h20000000 -#define RF5G_RF5G1_PDTXBUF5_GET(x) (((x) & RF5G_RF5G1_PDTXBUF5_MASK) >> RF5G_RF5G1_PDTXBUF5_LSB) -#define RF5G_RF5G1_PDTXBUF5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDTXBUF5_LSB) & RF5G_RF5G1_PDTXBUF5_MASK) -#define RF5G_RF5G1_PDTXBUF5_RESET 1'h0 -#define RF5G_RF5G1_PDPADRV5_MSB 28 -#define RF5G_RF5G1_PDPADRV5_LSB 28 -#define RF5G_RF5G1_PDPADRV5_MASK 'h10000000 -#define RF5G_RF5G1_PDPADRV5_GET(x) (((x) & RF5G_RF5G1_PDPADRV5_MASK) >> RF5G_RF5G1_PDPADRV5_LSB) -#define RF5G_RF5G1_PDPADRV5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDPADRV5_LSB) & RF5G_RF5G1_PDPADRV5_MASK) -#define RF5G_RF5G1_PDPADRV5_RESET 1'h0 -#define RF5G_RF5G1_PDPAOUT5_MSB 27 -#define RF5G_RF5G1_PDPAOUT5_LSB 27 -#define RF5G_RF5G1_PDPAOUT5_MASK 'h08000000 -#define RF5G_RF5G1_PDPAOUT5_GET(x) (((x) & RF5G_RF5G1_PDPAOUT5_MASK) >> RF5G_RF5G1_PDPAOUT5_LSB) -#define RF5G_RF5G1_PDPAOUT5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDPAOUT5_LSB) & RF5G_RF5G1_PDPAOUT5_MASK) -#define RF5G_RF5G1_PDPAOUT5_RESET 1'h0 -#define RF5G_RF5G1_TUNE_PADRV5_MSB 26 -#define RF5G_RF5G1_TUNE_PADRV5_LSB 24 -#define RF5G_RF5G1_TUNE_PADRV5_MASK 'h07000000 -#define RF5G_RF5G1_TUNE_PADRV5_GET(x) (((x) & RF5G_RF5G1_TUNE_PADRV5_MASK) >> RF5G_RF5G1_TUNE_PADRV5_LSB) -#define RF5G_RF5G1_TUNE_PADRV5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_TUNE_PADRV5_LSB) & RF5G_RF5G1_TUNE_PADRV5_MASK) -#define RF5G_RF5G1_TUNE_PADRV5_RESET 3'h0 -#define RF5G_RF5G1_PWDTXPKD_MSB 23 -#define RF5G_RF5G1_PWDTXPKD_LSB 21 -#define RF5G_RF5G1_PWDTXPKD_MASK 'h00e00000 -#define RF5G_RF5G1_PWDTXPKD_GET(x) (((x) & RF5G_RF5G1_PWDTXPKD_MASK) >> RF5G_RF5G1_PWDTXPKD_LSB) -#define RF5G_RF5G1_PWDTXPKD_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PWDTXPKD_LSB) & RF5G_RF5G1_PWDTXPKD_MASK) -#define RF5G_RF5G1_PWDTXPKD_RESET 3'h7 -#define RF5G_RF5G1_DB5_MSB 20 -#define RF5G_RF5G1_DB5_LSB 18 -#define RF5G_RF5G1_DB5_MASK 'h001c0000 -#define RF5G_RF5G1_DB5_GET(x) (((x) & RF5G_RF5G1_DB5_MASK) >> RF5G_RF5G1_DB5_LSB) -#define RF5G_RF5G1_DB5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_DB5_LSB) & RF5G_RF5G1_DB5_MASK) -#define RF5G_RF5G1_DB5_RESET 3'h4 -#define RF5G_RF5G1_OB5_MSB 17 -#define RF5G_RF5G1_OB5_LSB 15 -#define RF5G_RF5G1_OB5_MASK 'h00038000 -#define RF5G_RF5G1_OB5_GET(x) (((x) & RF5G_RF5G1_OB5_MASK) >> RF5G_RF5G1_OB5_LSB) -#define RF5G_RF5G1_OB5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_OB5_LSB) & RF5G_RF5G1_OB5_MASK) -#define RF5G_RF5G1_OB5_RESET 3'h4 -#define RF5G_RF5G1_TX5_ATB_SEL_MSB 14 -#define RF5G_RF5G1_TX5_ATB_SEL_LSB 12 -#define RF5G_RF5G1_TX5_ATB_SEL_MASK 'h00007000 -#define RF5G_RF5G1_TX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_TX5_ATB_SEL_MASK) >> RF5G_RF5G1_TX5_ATB_SEL_LSB) -#define RF5G_RF5G1_TX5_ATB_SEL_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_TX5_ATB_SEL_LSB) & RF5G_RF5G1_TX5_ATB_SEL_MASK) -#define RF5G_RF5G1_TX5_ATB_SEL_RESET 3'h0 -#define RF5G_RF5G1_PDLO5DIV_MSB 11 -#define RF5G_RF5G1_PDLO5DIV_LSB 11 -#define RF5G_RF5G1_PDLO5DIV_MASK 'h00000800 -#define RF5G_RF5G1_PDLO5DIV_GET(x) (((x) & RF5G_RF5G1_PDLO5DIV_MASK) >> RF5G_RF5G1_PDLO5DIV_LSB) -#define RF5G_RF5G1_PDLO5DIV_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDLO5DIV_LSB) & RF5G_RF5G1_PDLO5DIV_MASK) -#define RF5G_RF5G1_PDLO5DIV_RESET 1'h0 -#define RF5G_RF5G1_PDLO5MIX_MSB 10 -#define RF5G_RF5G1_PDLO5MIX_LSB 10 -#define RF5G_RF5G1_PDLO5MIX_MASK 'h00000400 -#define RF5G_RF5G1_PDLO5MIX_GET(x) (((x) & RF5G_RF5G1_PDLO5MIX_MASK) >> RF5G_RF5G1_PDLO5MIX_LSB) -#define RF5G_RF5G1_PDLO5MIX_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDLO5MIX_LSB) & RF5G_RF5G1_PDLO5MIX_MASK) -#define RF5G_RF5G1_PDLO5MIX_RESET 1'h0 -#define RF5G_RF5G1_PDQBUF5_MSB 9 -#define RF5G_RF5G1_PDQBUF5_LSB 9 -#define RF5G_RF5G1_PDQBUF5_MASK 'h00000200 -#define RF5G_RF5G1_PDQBUF5_GET(x) (((x) & RF5G_RF5G1_PDQBUF5_MASK) >> RF5G_RF5G1_PDQBUF5_LSB) -#define RF5G_RF5G1_PDQBUF5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDQBUF5_LSB) & RF5G_RF5G1_PDQBUF5_MASK) -#define RF5G_RF5G1_PDQBUF5_RESET 1'h0 -#define RF5G_RF5G1_PDLO5AGC_MSB 8 -#define RF5G_RF5G1_PDLO5AGC_LSB 8 -#define RF5G_RF5G1_PDLO5AGC_MASK 'h00000100 -#define RF5G_RF5G1_PDLO5AGC_GET(x) (((x) & RF5G_RF5G1_PDLO5AGC_MASK) >> RF5G_RF5G1_PDLO5AGC_LSB) -#define RF5G_RF5G1_PDLO5AGC_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDLO5AGC_LSB) & RF5G_RF5G1_PDLO5AGC_MASK) -#define RF5G_RF5G1_PDLO5AGC_RESET 1'h0 -#define RF5G_RF5G1_PDREGLO5_MSB 7 -#define RF5G_RF5G1_PDREGLO5_LSB 7 -#define RF5G_RF5G1_PDREGLO5_MASK 'h00000080 -#define RF5G_RF5G1_PDREGLO5_GET(x) (((x) & RF5G_RF5G1_PDREGLO5_MASK) >> RF5G_RF5G1_PDREGLO5_LSB) -#define RF5G_RF5G1_PDREGLO5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDREGLO5_LSB) & RF5G_RF5G1_PDREGLO5_MASK) -#define RF5G_RF5G1_PDREGLO5_RESET 1'h0 -#define RF5G_RF5G1_LO5_ATB_SEL_MSB 6 -#define RF5G_RF5G1_LO5_ATB_SEL_LSB 4 -#define RF5G_RF5G1_LO5_ATB_SEL_MASK 'h00000070 -#define RF5G_RF5G1_LO5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_LO5_ATB_SEL_MASK) >> RF5G_RF5G1_LO5_ATB_SEL_LSB) -#define RF5G_RF5G1_LO5_ATB_SEL_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_LO5_ATB_SEL_LSB) & RF5G_RF5G1_LO5_ATB_SEL_MASK) -#define RF5G_RF5G1_LO5_ATB_SEL_RESET 3'h0 -#define RF5G_RF5G1_LO5CONTROL_MSB 3 -#define RF5G_RF5G1_LO5CONTROL_LSB 3 -#define RF5G_RF5G1_LO5CONTROL_MASK 'h00000008 -#define RF5G_RF5G1_LO5CONTROL_GET(x) (((x) & RF5G_RF5G1_LO5CONTROL_MASK) >> RF5G_RF5G1_LO5CONTROL_LSB) -#define RF5G_RF5G1_LO5CONTROL_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_LO5CONTROL_LSB) & RF5G_RF5G1_LO5CONTROL_MASK) -#define RF5G_RF5G1_LO5CONTROL_RESET 1'h0 -#define RF5G_RF5G1_REGLO_BYPASS5_MSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_LSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_MASK 'h00000004 -#define RF5G_RF5G1_REGLO_BYPASS5_GET(x) (((x) & RF5G_RF5G1_REGLO_BYPASS5_MASK) >> RF5G_RF5G1_REGLO_BYPASS5_LSB) -#define RF5G_RF5G1_REGLO_BYPASS5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_REGLO_BYPASS5_LSB) & RF5G_RF5G1_REGLO_BYPASS5_MASK) -#define RF5G_RF5G1_REGLO_BYPASS5_RESET 1'h0 -#define RF5G_RF5G1_SPARE_MSB 1 -#define RF5G_RF5G1_SPARE_LSB 0 -#define RF5G_RF5G1_SPARE_MASK 'h00000003 -#define RF5G_RF5G1_SPARE_GET(x) (((x) & RF5G_RF5G1_SPARE_MASK) >> RF5G_RF5G1_SPARE_LSB) -#define RF5G_RF5G1_SPARE_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_SPARE_LSB) & RF5G_RF5G1_SPARE_MASK) -#define RF5G_RF5G1_SPARE_RESET 2'h0 -#define RF5G_RF5G1_RESET (32'h0 | \ - RF5G_RF5G1_PDTXLO5_SET(RF5G_RF5G1_PDTXLO5_RESET) | \ - RF5G_RF5G1_PDTXMIX5_SET(RF5G_RF5G1_PDTXMIX5_RESET) | \ - RF5G_RF5G1_PDTXBUF5_SET(RF5G_RF5G1_PDTXBUF5_RESET) | \ - RF5G_RF5G1_PDPADRV5_SET(RF5G_RF5G1_PDPADRV5_RESET) | \ - RF5G_RF5G1_PDPAOUT5_SET(RF5G_RF5G1_PDPAOUT5_RESET) | \ - RF5G_RF5G1_TUNE_PADRV5_SET(RF5G_RF5G1_TUNE_PADRV5_RESET) | \ - RF5G_RF5G1_PWDTXPKD_SET(RF5G_RF5G1_PWDTXPKD_RESET) | \ - RF5G_RF5G1_DB5_SET(RF5G_RF5G1_DB5_RESET) | \ - RF5G_RF5G1_OB5_SET(RF5G_RF5G1_OB5_RESET) | \ - RF5G_RF5G1_TX5_ATB_SEL_SET(RF5G_RF5G1_TX5_ATB_SEL_RESET) | \ - RF5G_RF5G1_PDLO5DIV_SET(RF5G_RF5G1_PDLO5DIV_RESET) | \ - RF5G_RF5G1_PDLO5MIX_SET(RF5G_RF5G1_PDLO5MIX_RESET) | \ - RF5G_RF5G1_PDQBUF5_SET(RF5G_RF5G1_PDQBUF5_RESET) | \ - RF5G_RF5G1_PDLO5AGC_SET(RF5G_RF5G1_PDLO5AGC_RESET) | \ - RF5G_RF5G1_PDREGLO5_SET(RF5G_RF5G1_PDREGLO5_RESET) | \ - RF5G_RF5G1_LO5_ATB_SEL_SET(RF5G_RF5G1_LO5_ATB_SEL_RESET) | \ - RF5G_RF5G1_LO5CONTROL_SET(RF5G_RF5G1_LO5CONTROL_RESET) | \ - RF5G_RF5G1_REGLO_BYPASS5_SET(RF5G_RF5G1_REGLO_BYPASS5_RESET) | \ - RF5G_RF5G1_SPARE_SET(RF5G_RF5G1_SPARE_RESET)) -#define RF5G_RF5G1_HW_MASK (32'h0) -#define RF5G_RF5G1_SW_MASK (32'h0 | \ - RF5G_RF5G1_PDTXLO5_MASK | \ - RF5G_RF5G1_PDTXMIX5_MASK | \ - RF5G_RF5G1_PDTXBUF5_MASK | \ - RF5G_RF5G1_PDPADRV5_MASK | \ - RF5G_RF5G1_PDPAOUT5_MASK | \ - RF5G_RF5G1_TUNE_PADRV5_MASK | \ - RF5G_RF5G1_PWDTXPKD_MASK | \ - RF5G_RF5G1_DB5_MASK | \ - RF5G_RF5G1_OB5_MASK | \ - RF5G_RF5G1_TX5_ATB_SEL_MASK | \ - RF5G_RF5G1_PDLO5DIV_MASK | \ - RF5G_RF5G1_PDLO5MIX_MASK | \ - RF5G_RF5G1_PDQBUF5_MASK | \ - RF5G_RF5G1_PDLO5AGC_MASK | \ - RF5G_RF5G1_PDREGLO5_MASK | \ - RF5G_RF5G1_LO5_ATB_SEL_MASK | \ - RF5G_RF5G1_LO5CONTROL_MASK | \ - RF5G_RF5G1_REGLO_BYPASS5_MASK | \ - RF5G_RF5G1_SPARE_MASK) - -#define RF5G_RF5G2_ADDRESS 'h00000024 -#define RF5G_RF5G2_AGCLO_B_MSB 31 -#define RF5G_RF5G2_AGCLO_B_LSB 29 -#define RF5G_RF5G2_AGCLO_B_MASK 'he0000000 -#define RF5G_RF5G2_AGCLO_B_GET(x) (((x) & RF5G_RF5G2_AGCLO_B_MASK) >> RF5G_RF5G2_AGCLO_B_LSB) -#define RF5G_RF5G2_AGCLO_B_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_AGCLO_B_LSB) & RF5G_RF5G2_AGCLO_B_MASK) -#define RF5G_RF5G2_AGCLO_B_RESET 3'h4 -#define RF5G_RF5G2_RX5_ATB_SEL_MSB 28 -#define RF5G_RF5G2_RX5_ATB_SEL_LSB 26 -#define RF5G_RF5G2_RX5_ATB_SEL_MASK 'h1c000000 -#define RF5G_RF5G2_RX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G2_RX5_ATB_SEL_MASK) >> RF5G_RF5G2_RX5_ATB_SEL_LSB) -#define RF5G_RF5G2_RX5_ATB_SEL_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_RX5_ATB_SEL_LSB) & RF5G_RF5G2_RX5_ATB_SEL_MASK) -#define RF5G_RF5G2_RX5_ATB_SEL_RESET 3'h0 -#define RF5G_RF5G2_PDCMOSLO5_MSB 25 -#define RF5G_RF5G2_PDCMOSLO5_LSB 25 -#define RF5G_RF5G2_PDCMOSLO5_MASK 'h02000000 -#define RF5G_RF5G2_PDCMOSLO5_GET(x) (((x) & RF5G_RF5G2_PDCMOSLO5_MASK) >> RF5G_RF5G2_PDCMOSLO5_LSB) -#define RF5G_RF5G2_PDCMOSLO5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDCMOSLO5_LSB) & RF5G_RF5G2_PDCMOSLO5_MASK) -#define RF5G_RF5G2_PDCMOSLO5_RESET 1'h0 -#define RF5G_RF5G2_PDVGM5_MSB 24 -#define RF5G_RF5G2_PDVGM5_LSB 24 -#define RF5G_RF5G2_PDVGM5_MASK 'h01000000 -#define RF5G_RF5G2_PDVGM5_GET(x) (((x) & RF5G_RF5G2_PDVGM5_MASK) >> RF5G_RF5G2_PDVGM5_LSB) -#define RF5G_RF5G2_PDVGM5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDVGM5_LSB) & RF5G_RF5G2_PDVGM5_MASK) -#define RF5G_RF5G2_PDVGM5_RESET 1'h0 -#define RF5G_RF5G2_PDCSLNA5_MSB 23 -#define RF5G_RF5G2_PDCSLNA5_LSB 23 -#define RF5G_RF5G2_PDCSLNA5_MASK 'h00800000 -#define RF5G_RF5G2_PDCSLNA5_GET(x) (((x) & RF5G_RF5G2_PDCSLNA5_MASK) >> RF5G_RF5G2_PDCSLNA5_LSB) -#define RF5G_RF5G2_PDCSLNA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDCSLNA5_LSB) & RF5G_RF5G2_PDCSLNA5_MASK) -#define RF5G_RF5G2_PDCSLNA5_RESET 1'h0 -#define RF5G_RF5G2_PDRFVGA5_MSB 22 -#define RF5G_RF5G2_PDRFVGA5_LSB 22 -#define RF5G_RF5G2_PDRFVGA5_MASK 'h00400000 -#define RF5G_RF5G2_PDRFVGA5_GET(x) (((x) & RF5G_RF5G2_PDRFVGA5_MASK) >> RF5G_RF5G2_PDRFVGA5_LSB) -#define RF5G_RF5G2_PDRFVGA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDRFVGA5_LSB) & RF5G_RF5G2_PDRFVGA5_MASK) -#define RF5G_RF5G2_PDRFVGA5_RESET 1'h0 -#define RF5G_RF5G2_PDREGFE5_MSB 21 -#define RF5G_RF5G2_PDREGFE5_LSB 21 -#define RF5G_RF5G2_PDREGFE5_MASK 'h00200000 -#define RF5G_RF5G2_PDREGFE5_GET(x) (((x) & RF5G_RF5G2_PDREGFE5_MASK) >> RF5G_RF5G2_PDREGFE5_LSB) -#define RF5G_RF5G2_PDREGFE5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDREGFE5_LSB) & RF5G_RF5G2_PDREGFE5_MASK) -#define RF5G_RF5G2_PDREGFE5_RESET 1'h0 -#define RF5G_RF5G2_TUNE_RFVGA5_MSB 20 -#define RF5G_RF5G2_TUNE_RFVGA5_LSB 18 -#define RF5G_RF5G2_TUNE_RFVGA5_MASK 'h001c0000 -#define RF5G_RF5G2_TUNE_RFVGA5_GET(x) (((x) & RF5G_RF5G2_TUNE_RFVGA5_MASK) >> RF5G_RF5G2_TUNE_RFVGA5_LSB) -#define RF5G_RF5G2_TUNE_RFVGA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_TUNE_RFVGA5_LSB) & RF5G_RF5G2_TUNE_RFVGA5_MASK) -#define RF5G_RF5G2_TUNE_RFVGA5_RESET 3'h0 -#define RF5G_RF5G2_BRFVGA5_MSB 17 -#define RF5G_RF5G2_BRFVGA5_LSB 15 -#define RF5G_RF5G2_BRFVGA5_MASK 'h00038000 -#define RF5G_RF5G2_BRFVGA5_GET(x) (((x) & RF5G_RF5G2_BRFVGA5_MASK) >> RF5G_RF5G2_BRFVGA5_LSB) -#define RF5G_RF5G2_BRFVGA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_BRFVGA5_LSB) & RF5G_RF5G2_BRFVGA5_MASK) -#define RF5G_RF5G2_BRFVGA5_RESET 3'h5 -#define RF5G_RF5G2_BCSLNA5_MSB 14 -#define RF5G_RF5G2_BCSLNA5_LSB 12 -#define RF5G_RF5G2_BCSLNA5_MASK 'h00007000 -#define RF5G_RF5G2_BCSLNA5_GET(x) (((x) & RF5G_RF5G2_BCSLNA5_MASK) >> RF5G_RF5G2_BCSLNA5_LSB) -#define RF5G_RF5G2_BCSLNA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_BCSLNA5_LSB) & RF5G_RF5G2_BCSLNA5_MASK) -#define RF5G_RF5G2_BCSLNA5_RESET 3'h3 -#define RF5G_RF5G2_BVGM5_MSB 11 -#define RF5G_RF5G2_BVGM5_LSB 9 -#define RF5G_RF5G2_BVGM5_MASK 'h00000e00 -#define RF5G_RF5G2_BVGM5_GET(x) (((x) & RF5G_RF5G2_BVGM5_MASK) >> RF5G_RF5G2_BVGM5_LSB) -#define RF5G_RF5G2_BVGM5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_BVGM5_LSB) & RF5G_RF5G2_BVGM5_MASK) -#define RF5G_RF5G2_BVGM5_RESET 3'h1 -#define RF5G_RF5G2_REGFE_BYPASS5_MSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_LSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_MASK 'h00000100 -#define RF5G_RF5G2_REGFE_BYPASS5_GET(x) (((x) & RF5G_RF5G2_REGFE_BYPASS5_MASK) >> RF5G_RF5G2_REGFE_BYPASS5_LSB) -#define RF5G_RF5G2_REGFE_BYPASS5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_REGFE_BYPASS5_LSB) & RF5G_RF5G2_REGFE_BYPASS5_MASK) -#define RF5G_RF5G2_REGFE_BYPASS5_RESET 1'h0 -#define RF5G_RF5G2_LNA5_ATTENMODE_MSB 7 -#define RF5G_RF5G2_LNA5_ATTENMODE_LSB 6 -#define RF5G_RF5G2_LNA5_ATTENMODE_MASK 'h000000c0 -#define RF5G_RF5G2_LNA5_ATTENMODE_GET(x) (((x) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) >> RF5G_RF5G2_LNA5_ATTENMODE_LSB) -#define RF5G_RF5G2_LNA5_ATTENMODE_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_LNA5_ATTENMODE_LSB) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) -#define RF5G_RF5G2_LNA5_ATTENMODE_RESET 2'h0 -#define RF5G_RF5G2_ENABLE_PCA_MSB 5 -#define RF5G_RF5G2_ENABLE_PCA_LSB 5 -#define RF5G_RF5G2_ENABLE_PCA_MASK 'h00000020 -#define RF5G_RF5G2_ENABLE_PCA_GET(x) (((x) & RF5G_RF5G2_ENABLE_PCA_MASK) >> RF5G_RF5G2_ENABLE_PCA_LSB) -#define RF5G_RF5G2_ENABLE_PCA_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_ENABLE_PCA_LSB) & RF5G_RF5G2_ENABLE_PCA_MASK) -#define RF5G_RF5G2_ENABLE_PCA_RESET 1'h0 -#define RF5G_RF5G2_TUNE_LO_MSB 4 -#define RF5G_RF5G2_TUNE_LO_LSB 2 -#define RF5G_RF5G2_TUNE_LO_MASK 'h0000001c -#define RF5G_RF5G2_TUNE_LO_GET(x) (((x) & RF5G_RF5G2_TUNE_LO_MASK) >> RF5G_RF5G2_TUNE_LO_LSB) -#define RF5G_RF5G2_TUNE_LO_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_TUNE_LO_LSB) & RF5G_RF5G2_TUNE_LO_MASK) -#define RF5G_RF5G2_TUNE_LO_RESET 3'h0 -#define RF5G_RF5G2_SPARE_MSB 1 -#define RF5G_RF5G2_SPARE_LSB 0 -#define RF5G_RF5G2_SPARE_MASK 'h00000003 -#define RF5G_RF5G2_SPARE_GET(x) (((x) & RF5G_RF5G2_SPARE_MASK) >> RF5G_RF5G2_SPARE_LSB) -#define RF5G_RF5G2_SPARE_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_SPARE_LSB) & RF5G_RF5G2_SPARE_MASK) -#define RF5G_RF5G2_SPARE_RESET 2'h0 -#define RF5G_RF5G2_RESET (32'h0 | \ - RF5G_RF5G2_AGCLO_B_SET(RF5G_RF5G2_AGCLO_B_RESET) | \ - RF5G_RF5G2_RX5_ATB_SEL_SET(RF5G_RF5G2_RX5_ATB_SEL_RESET) | \ - RF5G_RF5G2_PDCMOSLO5_SET(RF5G_RF5G2_PDCMOSLO5_RESET) | \ - RF5G_RF5G2_PDVGM5_SET(RF5G_RF5G2_PDVGM5_RESET) | \ - RF5G_RF5G2_PDCSLNA5_SET(RF5G_RF5G2_PDCSLNA5_RESET) | \ - RF5G_RF5G2_PDRFVGA5_SET(RF5G_RF5G2_PDRFVGA5_RESET) | \ - RF5G_RF5G2_PDREGFE5_SET(RF5G_RF5G2_PDREGFE5_RESET) | \ - RF5G_RF5G2_TUNE_RFVGA5_SET(RF5G_RF5G2_TUNE_RFVGA5_RESET) | \ - RF5G_RF5G2_BRFVGA5_SET(RF5G_RF5G2_BRFVGA5_RESET) | \ - RF5G_RF5G2_BCSLNA5_SET(RF5G_RF5G2_BCSLNA5_RESET) | \ - RF5G_RF5G2_BVGM5_SET(RF5G_RF5G2_BVGM5_RESET) | \ - RF5G_RF5G2_REGFE_BYPASS5_SET(RF5G_RF5G2_REGFE_BYPASS5_RESET) | \ - RF5G_RF5G2_LNA5_ATTENMODE_SET(RF5G_RF5G2_LNA5_ATTENMODE_RESET) | \ - RF5G_RF5G2_ENABLE_PCA_SET(RF5G_RF5G2_ENABLE_PCA_RESET) | \ - RF5G_RF5G2_TUNE_LO_SET(RF5G_RF5G2_TUNE_LO_RESET) | \ - RF5G_RF5G2_SPARE_SET(RF5G_RF5G2_SPARE_RESET)) -#define RF5G_RF5G2_HW_MASK (32'h0) -#define RF5G_RF5G2_SW_MASK (32'h0 | \ - RF5G_RF5G2_AGCLO_B_MASK | \ - RF5G_RF5G2_RX5_ATB_SEL_MASK | \ - RF5G_RF5G2_PDCMOSLO5_MASK | \ - RF5G_RF5G2_PDVGM5_MASK | \ - RF5G_RF5G2_PDCSLNA5_MASK | \ - RF5G_RF5G2_PDRFVGA5_MASK | \ - RF5G_RF5G2_PDREGFE5_MASK | \ - RF5G_RF5G2_TUNE_RFVGA5_MASK | \ - RF5G_RF5G2_BRFVGA5_MASK | \ - RF5G_RF5G2_BCSLNA5_MASK | \ - RF5G_RF5G2_BVGM5_MASK | \ - RF5G_RF5G2_REGFE_BYPASS5_MASK | \ - RF5G_RF5G2_LNA5_ATTENMODE_MASK | \ - RF5G_RF5G2_ENABLE_PCA_MASK | \ - RF5G_RF5G2_TUNE_LO_MASK | \ - RF5G_RF5G2_SPARE_MASK) - -#define RF2G_RF2G1_ADDRESS 'h00000028 -#define RF2G_RF2G1_BLNA1_MSB 31 -#define RF2G_RF2G1_BLNA1_LSB 29 -#define RF2G_RF2G1_BLNA1_MASK 'he0000000 -#define RF2G_RF2G1_BLNA1_GET(x) (((x) & RF2G_RF2G1_BLNA1_MASK) >> RF2G_RF2G1_BLNA1_LSB) -#define RF2G_RF2G1_BLNA1_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA1_LSB) & RF2G_RF2G1_BLNA1_MASK) -#define RF2G_RF2G1_BLNA1_RESET 3'h3 -#define RF2G_RF2G1_BLNA1F_MSB 28 -#define RF2G_RF2G1_BLNA1F_LSB 26 -#define RF2G_RF2G1_BLNA1F_MASK 'h1c000000 -#define RF2G_RF2G1_BLNA1F_GET(x) (((x) & RF2G_RF2G1_BLNA1F_MASK) >> RF2G_RF2G1_BLNA1F_LSB) -#define RF2G_RF2G1_BLNA1F_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA1F_LSB) & RF2G_RF2G1_BLNA1F_MASK) -#define RF2G_RF2G1_BLNA1F_RESET 3'h0 -#define RF2G_RF2G1_BLNA1BUF_MSB 25 -#define RF2G_RF2G1_BLNA1BUF_LSB 23 -#define RF2G_RF2G1_BLNA1BUF_MASK 'h03800000 -#define RF2G_RF2G1_BLNA1BUF_GET(x) (((x) & RF2G_RF2G1_BLNA1BUF_MASK) >> RF2G_RF2G1_BLNA1BUF_LSB) -#define RF2G_RF2G1_BLNA1BUF_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA1BUF_LSB) & RF2G_RF2G1_BLNA1BUF_MASK) -#define RF2G_RF2G1_BLNA1BUF_RESET 3'h3 -#define RF2G_RF2G1_BLNA2_MSB 22 -#define RF2G_RF2G1_BLNA2_LSB 20 -#define RF2G_RF2G1_BLNA2_MASK 'h00700000 -#define RF2G_RF2G1_BLNA2_GET(x) (((x) & RF2G_RF2G1_BLNA2_MASK) >> RF2G_RF2G1_BLNA2_LSB) -#define RF2G_RF2G1_BLNA2_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA2_LSB) & RF2G_RF2G1_BLNA2_MASK) -#define RF2G_RF2G1_BLNA2_RESET 3'h3 -#define RF2G_RF2G1_DB_MSB 19 -#define RF2G_RF2G1_DB_LSB 17 -#define RF2G_RF2G1_DB_MASK 'h000e0000 -#define RF2G_RF2G1_DB_GET(x) (((x) & RF2G_RF2G1_DB_MASK) >> RF2G_RF2G1_DB_LSB) -#define RF2G_RF2G1_DB_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_DB_LSB) & RF2G_RF2G1_DB_MASK) -#define RF2G_RF2G1_DB_RESET 3'h3 -#define RF2G_RF2G1_OB_MSB 16 -#define RF2G_RF2G1_OB_LSB 14 -#define RF2G_RF2G1_OB_MASK 'h0001c000 -#define RF2G_RF2G1_OB_GET(x) (((x) & RF2G_RF2G1_OB_MASK) >> RF2G_RF2G1_OB_LSB) -#define RF2G_RF2G1_OB_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_OB_LSB) & RF2G_RF2G1_OB_MASK) -#define RF2G_RF2G1_OB_RESET 3'h3 -#define RF2G_RF2G1_FE_ATB_SEL_MSB 13 -#define RF2G_RF2G1_FE_ATB_SEL_LSB 11 -#define RF2G_RF2G1_FE_ATB_SEL_MASK 'h00003800 -#define RF2G_RF2G1_FE_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_FE_ATB_SEL_MASK) >> RF2G_RF2G1_FE_ATB_SEL_LSB) -#define RF2G_RF2G1_FE_ATB_SEL_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_FE_ATB_SEL_LSB) & RF2G_RF2G1_FE_ATB_SEL_MASK) -#define RF2G_RF2G1_FE_ATB_SEL_RESET 3'h0 -#define RF2G_RF2G1_RF_ATB_SEL_MSB 10 -#define RF2G_RF2G1_RF_ATB_SEL_LSB 8 -#define RF2G_RF2G1_RF_ATB_SEL_MASK 'h00000700 -#define RF2G_RF2G1_RF_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_RF_ATB_SEL_MASK) >> RF2G_RF2G1_RF_ATB_SEL_LSB) -#define RF2G_RF2G1_RF_ATB_SEL_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_RF_ATB_SEL_LSB) & RF2G_RF2G1_RF_ATB_SEL_MASK) -#define RF2G_RF2G1_RF_ATB_SEL_RESET 3'h0 -#define RF2G_RF2G1_SELLNA_MSB 7 -#define RF2G_RF2G1_SELLNA_LSB 7 -#define RF2G_RF2G1_SELLNA_MASK 'h00000080 -#define RF2G_RF2G1_SELLNA_GET(x) (((x) & RF2G_RF2G1_SELLNA_MASK) >> RF2G_RF2G1_SELLNA_LSB) -#define RF2G_RF2G1_SELLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_SELLNA_LSB) & RF2G_RF2G1_SELLNA_MASK) -#define RF2G_RF2G1_SELLNA_RESET 1'h1 -#define RF2G_RF2G1_LOCONTROL_MSB 6 -#define RF2G_RF2G1_LOCONTROL_LSB 6 -#define RF2G_RF2G1_LOCONTROL_MASK 'h00000040 -#define RF2G_RF2G1_LOCONTROL_GET(x) (((x) & RF2G_RF2G1_LOCONTROL_MASK) >> RF2G_RF2G1_LOCONTROL_LSB) -#define RF2G_RF2G1_LOCONTROL_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_LOCONTROL_LSB) & RF2G_RF2G1_LOCONTROL_MASK) -#define RF2G_RF2G1_LOCONTROL_RESET 1'h0 -#define RF2G_RF2G1_SHORTLNA2_MSB 5 -#define RF2G_RF2G1_SHORTLNA2_LSB 5 -#define RF2G_RF2G1_SHORTLNA2_MASK 'h00000020 -#define RF2G_RF2G1_SHORTLNA2_GET(x) (((x) & RF2G_RF2G1_SHORTLNA2_MASK) >> RF2G_RF2G1_SHORTLNA2_LSB) -#define RF2G_RF2G1_SHORTLNA2_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_SHORTLNA2_LSB) & RF2G_RF2G1_SHORTLNA2_MASK) -#define RF2G_RF2G1_SHORTLNA2_RESET 1'h0 -#define RF2G_RF2G1_SPARE_MSB 4 -#define RF2G_RF2G1_SPARE_LSB 0 -#define RF2G_RF2G1_SPARE_MASK 'h0000001f -#define RF2G_RF2G1_SPARE_GET(x) (((x) & RF2G_RF2G1_SPARE_MASK) >> RF2G_RF2G1_SPARE_LSB) -#define RF2G_RF2G1_SPARE_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_SPARE_LSB) & RF2G_RF2G1_SPARE_MASK) -#define RF2G_RF2G1_SPARE_RESET 5'h0 -#define RF2G_RF2G1_RESET (32'h0 | \ - RF2G_RF2G1_BLNA1_SET(RF2G_RF2G1_BLNA1_RESET) | \ - RF2G_RF2G1_BLNA1F_SET(RF2G_RF2G1_BLNA1F_RESET) | \ - RF2G_RF2G1_BLNA1BUF_SET(RF2G_RF2G1_BLNA1BUF_RESET) | \ - RF2G_RF2G1_BLNA2_SET(RF2G_RF2G1_BLNA2_RESET) | \ - RF2G_RF2G1_DB_SET(RF2G_RF2G1_DB_RESET) | \ - RF2G_RF2G1_OB_SET(RF2G_RF2G1_OB_RESET) | \ - RF2G_RF2G1_FE_ATB_SEL_SET(RF2G_RF2G1_FE_ATB_SEL_RESET) | \ - RF2G_RF2G1_RF_ATB_SEL_SET(RF2G_RF2G1_RF_ATB_SEL_RESET) | \ - RF2G_RF2G1_SELLNA_SET(RF2G_RF2G1_SELLNA_RESET) | \ - RF2G_RF2G1_LOCONTROL_SET(RF2G_RF2G1_LOCONTROL_RESET) | \ - RF2G_RF2G1_SHORTLNA2_SET(RF2G_RF2G1_SHORTLNA2_RESET) | \ - RF2G_RF2G1_SPARE_SET(RF2G_RF2G1_SPARE_RESET)) -#define RF2G_RF2G1_HW_MASK (32'h0) -#define RF2G_RF2G1_SW_MASK (32'h0 | \ - RF2G_RF2G1_BLNA1_MASK | \ - RF2G_RF2G1_BLNA1F_MASK | \ - RF2G_RF2G1_BLNA1BUF_MASK | \ - RF2G_RF2G1_BLNA2_MASK | \ - RF2G_RF2G1_DB_MASK | \ - RF2G_RF2G1_OB_MASK | \ - RF2G_RF2G1_FE_ATB_SEL_MASK | \ - RF2G_RF2G1_RF_ATB_SEL_MASK | \ - RF2G_RF2G1_SELLNA_MASK | \ - RF2G_RF2G1_LOCONTROL_MASK | \ - RF2G_RF2G1_SHORTLNA2_MASK | \ - RF2G_RF2G1_SPARE_MASK) - -#define RF2G_RF2G2_ADDRESS 'h0000002c -#define RF2G_RF2G2_PDCGLNA_MSB 31 -#define RF2G_RF2G2_PDCGLNA_LSB 31 -#define RF2G_RF2G2_PDCGLNA_MASK 'h80000000 -#define RF2G_RF2G2_PDCGLNA_GET(x) (((x) & RF2G_RF2G2_PDCGLNA_MASK) >> RF2G_RF2G2_PDCGLNA_LSB) -#define RF2G_RF2G2_PDCGLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDCGLNA_LSB) & RF2G_RF2G2_PDCGLNA_MASK) -#define RF2G_RF2G2_PDCGLNA_RESET 1'h0 -#define RF2G_RF2G2_PDCGLNABUF_MSB 30 -#define RF2G_RF2G2_PDCGLNABUF_LSB 30 -#define RF2G_RF2G2_PDCGLNABUF_MASK 'h40000000 -#define RF2G_RF2G2_PDCGLNABUF_GET(x) (((x) & RF2G_RF2G2_PDCGLNABUF_MASK) >> RF2G_RF2G2_PDCGLNABUF_LSB) -#define RF2G_RF2G2_PDCGLNABUF_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDCGLNABUF_LSB) & RF2G_RF2G2_PDCGLNABUF_MASK) -#define RF2G_RF2G2_PDCGLNABUF_RESET 1'h0 -#define RF2G_RF2G2_PDCSLNA_MSB 29 -#define RF2G_RF2G2_PDCSLNA_LSB 29 -#define RF2G_RF2G2_PDCSLNA_MASK 'h20000000 -#define RF2G_RF2G2_PDCSLNA_GET(x) (((x) & RF2G_RF2G2_PDCSLNA_MASK) >> RF2G_RF2G2_PDCSLNA_LSB) -#define RF2G_RF2G2_PDCSLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDCSLNA_LSB) & RF2G_RF2G2_PDCSLNA_MASK) -#define RF2G_RF2G2_PDCSLNA_RESET 1'h0 -#define RF2G_RF2G2_PDDIV_MSB 28 -#define RF2G_RF2G2_PDDIV_LSB 28 -#define RF2G_RF2G2_PDDIV_MASK 'h10000000 -#define RF2G_RF2G2_PDDIV_GET(x) (((x) & RF2G_RF2G2_PDDIV_MASK) >> RF2G_RF2G2_PDDIV_LSB) -#define RF2G_RF2G2_PDDIV_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDDIV_LSB) & RF2G_RF2G2_PDDIV_MASK) -#define RF2G_RF2G2_PDDIV_RESET 1'h0 -#define RF2G_RF2G2_PDPADRV_MSB 27 -#define RF2G_RF2G2_PDPADRV_LSB 27 -#define RF2G_RF2G2_PDPADRV_MASK 'h08000000 -#define RF2G_RF2G2_PDPADRV_GET(x) (((x) & RF2G_RF2G2_PDPADRV_MASK) >> RF2G_RF2G2_PDPADRV_LSB) -#define RF2G_RF2G2_PDPADRV_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDPADRV_LSB) & RF2G_RF2G2_PDPADRV_MASK) -#define RF2G_RF2G2_PDPADRV_RESET 1'h0 -#define RF2G_RF2G2_PDPAOUT_MSB 26 -#define RF2G_RF2G2_PDPAOUT_LSB 26 -#define RF2G_RF2G2_PDPAOUT_MASK 'h04000000 -#define RF2G_RF2G2_PDPAOUT_GET(x) (((x) & RF2G_RF2G2_PDPAOUT_MASK) >> RF2G_RF2G2_PDPAOUT_LSB) -#define RF2G_RF2G2_PDPAOUT_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDPAOUT_LSB) & RF2G_RF2G2_PDPAOUT_MASK) -#define RF2G_RF2G2_PDPAOUT_RESET 1'h0 -#define RF2G_RF2G2_PDREGLNA_MSB 25 -#define RF2G_RF2G2_PDREGLNA_LSB 25 -#define RF2G_RF2G2_PDREGLNA_MASK 'h02000000 -#define RF2G_RF2G2_PDREGLNA_GET(x) (((x) & RF2G_RF2G2_PDREGLNA_MASK) >> RF2G_RF2G2_PDREGLNA_LSB) -#define RF2G_RF2G2_PDREGLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDREGLNA_LSB) & RF2G_RF2G2_PDREGLNA_MASK) -#define RF2G_RF2G2_PDREGLNA_RESET 1'h0 -#define RF2G_RF2G2_PDREGLO_MSB 24 -#define RF2G_RF2G2_PDREGLO_LSB 24 -#define RF2G_RF2G2_PDREGLO_MASK 'h01000000 -#define RF2G_RF2G2_PDREGLO_GET(x) (((x) & RF2G_RF2G2_PDREGLO_MASK) >> RF2G_RF2G2_PDREGLO_LSB) -#define RF2G_RF2G2_PDREGLO_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDREGLO_LSB) & RF2G_RF2G2_PDREGLO_MASK) -#define RF2G_RF2G2_PDREGLO_RESET 1'h0 -#define RF2G_RF2G2_PDRFGM_MSB 23 -#define RF2G_RF2G2_PDRFGM_LSB 23 -#define RF2G_RF2G2_PDRFGM_MASK 'h00800000 -#define RF2G_RF2G2_PDRFGM_GET(x) (((x) & RF2G_RF2G2_PDRFGM_MASK) >> RF2G_RF2G2_PDRFGM_LSB) -#define RF2G_RF2G2_PDRFGM_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDRFGM_LSB) & RF2G_RF2G2_PDRFGM_MASK) -#define RF2G_RF2G2_PDRFGM_RESET 1'h0 -#define RF2G_RF2G2_PDRXLO_MSB 22 -#define RF2G_RF2G2_PDRXLO_LSB 22 -#define RF2G_RF2G2_PDRXLO_MASK 'h00400000 -#define RF2G_RF2G2_PDRXLO_GET(x) (((x) & RF2G_RF2G2_PDRXLO_MASK) >> RF2G_RF2G2_PDRXLO_LSB) -#define RF2G_RF2G2_PDRXLO_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDRXLO_LSB) & RF2G_RF2G2_PDRXLO_MASK) -#define RF2G_RF2G2_PDRXLO_RESET 1'h0 -#define RF2G_RF2G2_PDTXLO_MSB 21 -#define RF2G_RF2G2_PDTXLO_LSB 21 -#define RF2G_RF2G2_PDTXLO_MASK 'h00200000 -#define RF2G_RF2G2_PDTXLO_GET(x) (((x) & RF2G_RF2G2_PDTXLO_MASK) >> RF2G_RF2G2_PDTXLO_LSB) -#define RF2G_RF2G2_PDTXLO_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDTXLO_LSB) & RF2G_RF2G2_PDTXLO_MASK) -#define RF2G_RF2G2_PDTXLO_RESET 1'h0 -#define RF2G_RF2G2_PDTXMIX_MSB 20 -#define RF2G_RF2G2_PDTXMIX_LSB 20 -#define RF2G_RF2G2_PDTXMIX_MASK 'h00100000 -#define RF2G_RF2G2_PDTXMIX_GET(x) (((x) & RF2G_RF2G2_PDTXMIX_MASK) >> RF2G_RF2G2_PDTXMIX_LSB) -#define RF2G_RF2G2_PDTXMIX_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDTXMIX_LSB) & RF2G_RF2G2_PDTXMIX_MASK) -#define RF2G_RF2G2_PDTXMIX_RESET 1'h0 -#define RF2G_RF2G2_REGLNA_BYPASS_MSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_LSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_MASK 'h00080000 -#define RF2G_RF2G2_REGLNA_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLNA_BYPASS_MASK) >> RF2G_RF2G2_REGLNA_BYPASS_LSB) -#define RF2G_RF2G2_REGLNA_BYPASS_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_REGLNA_BYPASS_LSB) & RF2G_RF2G2_REGLNA_BYPASS_MASK) -#define RF2G_RF2G2_REGLNA_BYPASS_RESET 1'h0 -#define RF2G_RF2G2_REGLO_BYPASS_MSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_LSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_MASK 'h00040000 -#define RF2G_RF2G2_REGLO_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLO_BYPASS_MASK) >> RF2G_RF2G2_REGLO_BYPASS_LSB) -#define RF2G_RF2G2_REGLO_BYPASS_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_REGLO_BYPASS_LSB) & RF2G_RF2G2_REGLO_BYPASS_MASK) -#define RF2G_RF2G2_REGLO_BYPASS_RESET 1'h0 -#define RF2G_RF2G2_ENABLE_PCB_MSB 17 -#define RF2G_RF2G2_ENABLE_PCB_LSB 17 -#define RF2G_RF2G2_ENABLE_PCB_MASK 'h00020000 -#define RF2G_RF2G2_ENABLE_PCB_GET(x) (((x) & RF2G_RF2G2_ENABLE_PCB_MASK) >> RF2G_RF2G2_ENABLE_PCB_LSB) -#define RF2G_RF2G2_ENABLE_PCB_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_ENABLE_PCB_LSB) & RF2G_RF2G2_ENABLE_PCB_MASK) -#define RF2G_RF2G2_ENABLE_PCB_RESET 1'h0 -#define RF2G_RF2G2_SPARE_MSB 16 -#define RF2G_RF2G2_SPARE_LSB 0 -#define RF2G_RF2G2_SPARE_MASK 'h0001ffff -#define RF2G_RF2G2_SPARE_GET(x) (((x) & RF2G_RF2G2_SPARE_MASK) >> RF2G_RF2G2_SPARE_LSB) -#define RF2G_RF2G2_SPARE_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_SPARE_LSB) & RF2G_RF2G2_SPARE_MASK) -#define RF2G_RF2G2_SPARE_RESET 17'h0 -#define RF2G_RF2G2_RESET (32'h0 | \ - RF2G_RF2G2_PDCGLNA_SET(RF2G_RF2G2_PDCGLNA_RESET) | \ - RF2G_RF2G2_PDCGLNABUF_SET(RF2G_RF2G2_PDCGLNABUF_RESET) | \ - RF2G_RF2G2_PDCSLNA_SET(RF2G_RF2G2_PDCSLNA_RESET) | \ - RF2G_RF2G2_PDDIV_SET(RF2G_RF2G2_PDDIV_RESET) | \ - RF2G_RF2G2_PDPADRV_SET(RF2G_RF2G2_PDPADRV_RESET) | \ - RF2G_RF2G2_PDPAOUT_SET(RF2G_RF2G2_PDPAOUT_RESET) | \ - RF2G_RF2G2_PDREGLNA_SET(RF2G_RF2G2_PDREGLNA_RESET) | \ - RF2G_RF2G2_PDREGLO_SET(RF2G_RF2G2_PDREGLO_RESET) | \ - RF2G_RF2G2_PDRFGM_SET(RF2G_RF2G2_PDRFGM_RESET) | \ - RF2G_RF2G2_PDRXLO_SET(RF2G_RF2G2_PDRXLO_RESET) | \ - RF2G_RF2G2_PDTXLO_SET(RF2G_RF2G2_PDTXLO_RESET) | \ - RF2G_RF2G2_PDTXMIX_SET(RF2G_RF2G2_PDTXMIX_RESET) | \ - RF2G_RF2G2_REGLNA_BYPASS_SET(RF2G_RF2G2_REGLNA_BYPASS_RESET) | \ - RF2G_RF2G2_REGLO_BYPASS_SET(RF2G_RF2G2_REGLO_BYPASS_RESET) | \ - RF2G_RF2G2_ENABLE_PCB_SET(RF2G_RF2G2_ENABLE_PCB_RESET) | \ - RF2G_RF2G2_SPARE_SET(RF2G_RF2G2_SPARE_RESET)) -#define RF2G_RF2G2_HW_MASK (32'h0) -#define RF2G_RF2G2_SW_MASK (32'h0 | \ - RF2G_RF2G2_PDCGLNA_MASK | \ - RF2G_RF2G2_PDCGLNABUF_MASK | \ - RF2G_RF2G2_PDCSLNA_MASK | \ - RF2G_RF2G2_PDDIV_MASK | \ - RF2G_RF2G2_PDPADRV_MASK | \ - RF2G_RF2G2_PDPAOUT_MASK | \ - RF2G_RF2G2_PDREGLNA_MASK | \ - RF2G_RF2G2_PDREGLO_MASK | \ - RF2G_RF2G2_PDRFGM_MASK | \ - RF2G_RF2G2_PDRXLO_MASK | \ - RF2G_RF2G2_PDTXLO_MASK | \ - RF2G_RF2G2_PDTXMIX_MASK | \ - RF2G_RF2G2_REGLNA_BYPASS_MASK | \ - RF2G_RF2G2_REGLO_BYPASS_MASK | \ - RF2G_RF2G2_ENABLE_PCB_MASK | \ - RF2G_RF2G2_SPARE_MASK) - -#define TOP_GAIN_ADDRESS 'h00000030 -#define TOP_GAIN_TX6DBLOQGAIN_MSB 31 -#define TOP_GAIN_TX6DBLOQGAIN_LSB 30 -#define TOP_GAIN_TX6DBLOQGAIN_MASK 'hc0000000 -#define TOP_GAIN_TX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX6DBLOQGAIN_MASK) >> TOP_GAIN_TX6DBLOQGAIN_LSB) -#define TOP_GAIN_TX6DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_TX6DBLOQGAIN_LSB) & TOP_GAIN_TX6DBLOQGAIN_MASK) -#define TOP_GAIN_TX6DBLOQGAIN_RESET 2'h3 -#define TOP_GAIN_TX1DBLOQGAIN_MSB 29 -#define TOP_GAIN_TX1DBLOQGAIN_LSB 27 -#define TOP_GAIN_TX1DBLOQGAIN_MASK 'h38000000 -#define TOP_GAIN_TX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX1DBLOQGAIN_MASK) >> TOP_GAIN_TX1DBLOQGAIN_LSB) -#define TOP_GAIN_TX1DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_TX1DBLOQGAIN_LSB) & TOP_GAIN_TX1DBLOQGAIN_MASK) -#define TOP_GAIN_TX1DBLOQGAIN_RESET 3'h6 -#define TOP_GAIN_TXV2IGAIN_MSB 26 -#define TOP_GAIN_TXV2IGAIN_LSB 25 -#define TOP_GAIN_TXV2IGAIN_MASK 'h06000000 -#define TOP_GAIN_TXV2IGAIN_GET(x) (((x) & TOP_GAIN_TXV2IGAIN_MASK) >> TOP_GAIN_TXV2IGAIN_LSB) -#define TOP_GAIN_TXV2IGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_TXV2IGAIN_LSB) & TOP_GAIN_TXV2IGAIN_MASK) -#define TOP_GAIN_TXV2IGAIN_RESET 2'h3 -#define TOP_GAIN_PABUF5GN_MSB 24 -#define TOP_GAIN_PABUF5GN_LSB 24 -#define TOP_GAIN_PABUF5GN_MASK 'h01000000 -#define TOP_GAIN_PABUF5GN_GET(x) (((x) & TOP_GAIN_PABUF5GN_MASK) >> TOP_GAIN_PABUF5GN_LSB) -#define TOP_GAIN_PABUF5GN_SET(x) (((32'd0 | (x)) << TOP_GAIN_PABUF5GN_LSB) & TOP_GAIN_PABUF5GN_MASK) -#define TOP_GAIN_PABUF5GN_RESET 1'h1 -#define TOP_GAIN_PADRVGN_MSB 23 -#define TOP_GAIN_PADRVGN_LSB 21 -#define TOP_GAIN_PADRVGN_MASK 'h00e00000 -#define TOP_GAIN_PADRVGN_GET(x) (((x) & TOP_GAIN_PADRVGN_MASK) >> TOP_GAIN_PADRVGN_LSB) -#define TOP_GAIN_PADRVGN_SET(x) (((32'd0 | (x)) << TOP_GAIN_PADRVGN_LSB) & TOP_GAIN_PADRVGN_MASK) -#define TOP_GAIN_PADRVGN_RESET 3'h7 -#define TOP_GAIN_PAOUT2GN_MSB 20 -#define TOP_GAIN_PAOUT2GN_LSB 18 -#define TOP_GAIN_PAOUT2GN_MASK 'h001c0000 -#define TOP_GAIN_PAOUT2GN_GET(x) (((x) & TOP_GAIN_PAOUT2GN_MASK) >> TOP_GAIN_PAOUT2GN_LSB) -#define TOP_GAIN_PAOUT2GN_SET(x) (((32'd0 | (x)) << TOP_GAIN_PAOUT2GN_LSB) & TOP_GAIN_PAOUT2GN_MASK) -#define TOP_GAIN_PAOUT2GN_RESET 3'h7 -#define TOP_GAIN_LNAON_MSB 17 -#define TOP_GAIN_LNAON_LSB 17 -#define TOP_GAIN_LNAON_MASK 'h00020000 -#define TOP_GAIN_LNAON_GET(x) (((x) & TOP_GAIN_LNAON_MASK) >> TOP_GAIN_LNAON_LSB) -#define TOP_GAIN_LNAON_SET(x) (((32'd0 | (x)) << TOP_GAIN_LNAON_LSB) & TOP_GAIN_LNAON_MASK) -#define TOP_GAIN_LNAON_RESET 1'h1 -#define TOP_GAIN_LNAGAIN_MSB 16 -#define TOP_GAIN_LNAGAIN_LSB 13 -#define TOP_GAIN_LNAGAIN_MASK 'h0001e000 -#define TOP_GAIN_LNAGAIN_GET(x) (((x) & TOP_GAIN_LNAGAIN_MASK) >> TOP_GAIN_LNAGAIN_LSB) -#define TOP_GAIN_LNAGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_LNAGAIN_LSB) & TOP_GAIN_LNAGAIN_MASK) -#define TOP_GAIN_LNAGAIN_RESET 4'hf -#define TOP_GAIN_RFVGA5GAIN_MSB 12 -#define TOP_GAIN_RFVGA5GAIN_LSB 11 -#define TOP_GAIN_RFVGA5GAIN_MASK 'h00001800 -#define TOP_GAIN_RFVGA5GAIN_GET(x) (((x) & TOP_GAIN_RFVGA5GAIN_MASK) >> TOP_GAIN_RFVGA5GAIN_LSB) -#define TOP_GAIN_RFVGA5GAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RFVGA5GAIN_LSB) & TOP_GAIN_RFVGA5GAIN_MASK) -#define TOP_GAIN_RFVGA5GAIN_RESET 2'h3 -#define TOP_GAIN_RFGMGN_MSB 10 -#define TOP_GAIN_RFGMGN_LSB 8 -#define TOP_GAIN_RFGMGN_MASK 'h00000700 -#define TOP_GAIN_RFGMGN_GET(x) (((x) & TOP_GAIN_RFGMGN_MASK) >> TOP_GAIN_RFGMGN_LSB) -#define TOP_GAIN_RFGMGN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RFGMGN_LSB) & TOP_GAIN_RFGMGN_MASK) -#define TOP_GAIN_RFGMGN_RESET 3'h7 -#define TOP_GAIN_RX6DBLOQGAIN_MSB 7 -#define TOP_GAIN_RX6DBLOQGAIN_LSB 6 -#define TOP_GAIN_RX6DBLOQGAIN_MASK 'h000000c0 -#define TOP_GAIN_RX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBLOQGAIN_MASK) >> TOP_GAIN_RX6DBLOQGAIN_LSB) -#define TOP_GAIN_RX6DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RX6DBLOQGAIN_LSB) & TOP_GAIN_RX6DBLOQGAIN_MASK) -#define TOP_GAIN_RX6DBLOQGAIN_RESET 2'h3 -#define TOP_GAIN_RX1DBLOQGAIN_MSB 5 -#define TOP_GAIN_RX1DBLOQGAIN_LSB 3 -#define TOP_GAIN_RX1DBLOQGAIN_MASK 'h00000038 -#define TOP_GAIN_RX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX1DBLOQGAIN_MASK) >> TOP_GAIN_RX1DBLOQGAIN_LSB) -#define TOP_GAIN_RX1DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RX1DBLOQGAIN_LSB) & TOP_GAIN_RX1DBLOQGAIN_MASK) -#define TOP_GAIN_RX1DBLOQGAIN_RESET 3'h6 -#define TOP_GAIN_RX6DBHIQGAIN_MSB 2 -#define TOP_GAIN_RX6DBHIQGAIN_LSB 1 -#define TOP_GAIN_RX6DBHIQGAIN_MASK 'h00000006 -#define TOP_GAIN_RX6DBHIQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBHIQGAIN_MASK) >> TOP_GAIN_RX6DBHIQGAIN_LSB) -#define TOP_GAIN_RX6DBHIQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RX6DBHIQGAIN_LSB) & TOP_GAIN_RX6DBHIQGAIN_MASK) -#define TOP_GAIN_RX6DBHIQGAIN_RESET 2'h3 -#define TOP_GAIN_SPARE_MSB 0 -#define TOP_GAIN_SPARE_LSB 0 -#define TOP_GAIN_SPARE_MASK 'h00000001 -#define TOP_GAIN_SPARE_GET(x) (((x) & TOP_GAIN_SPARE_MASK) >> TOP_GAIN_SPARE_LSB) -#define TOP_GAIN_SPARE_SET(x) (((32'd0 | (x)) << TOP_GAIN_SPARE_LSB) & TOP_GAIN_SPARE_MASK) -#define TOP_GAIN_SPARE_RESET 1'h0 -#define TOP_GAIN_RESET (32'h0 | \ - TOP_GAIN_TX6DBLOQGAIN_SET(TOP_GAIN_TX6DBLOQGAIN_RESET) | \ - TOP_GAIN_TX1DBLOQGAIN_SET(TOP_GAIN_TX1DBLOQGAIN_RESET) | \ - TOP_GAIN_TXV2IGAIN_SET(TOP_GAIN_TXV2IGAIN_RESET) | \ - TOP_GAIN_PABUF5GN_SET(TOP_GAIN_PABUF5GN_RESET) | \ - TOP_GAIN_PADRVGN_SET(TOP_GAIN_PADRVGN_RESET) | \ - TOP_GAIN_PAOUT2GN_SET(TOP_GAIN_PAOUT2GN_RESET) | \ - TOP_GAIN_LNAON_SET(TOP_GAIN_LNAON_RESET) | \ - TOP_GAIN_LNAGAIN_SET(TOP_GAIN_LNAGAIN_RESET) | \ - TOP_GAIN_RFVGA5GAIN_SET(TOP_GAIN_RFVGA5GAIN_RESET) | \ - TOP_GAIN_RFGMGN_SET(TOP_GAIN_RFGMGN_RESET) | \ - TOP_GAIN_RX6DBLOQGAIN_SET(TOP_GAIN_RX6DBLOQGAIN_RESET) | \ - TOP_GAIN_RX1DBLOQGAIN_SET(TOP_GAIN_RX1DBLOQGAIN_RESET) | \ - TOP_GAIN_RX6DBHIQGAIN_SET(TOP_GAIN_RX6DBHIQGAIN_RESET) | \ - TOP_GAIN_SPARE_SET(TOP_GAIN_SPARE_RESET)) -#define TOP_GAIN_HW_MASK (32'h0 | \ - TOP_GAIN_TX6DBLOQGAIN_MASK | \ - TOP_GAIN_TX1DBLOQGAIN_MASK | \ - TOP_GAIN_TXV2IGAIN_MASK | \ - TOP_GAIN_PABUF5GN_MASK | \ - TOP_GAIN_PADRVGN_MASK | \ - TOP_GAIN_PAOUT2GN_MASK | \ - TOP_GAIN_LNAON_MASK | \ - TOP_GAIN_LNAGAIN_MASK | \ - TOP_GAIN_RFVGA5GAIN_MASK | \ - TOP_GAIN_RFGMGN_MASK | \ - TOP_GAIN_RX6DBLOQGAIN_MASK | \ - TOP_GAIN_RX1DBLOQGAIN_MASK | \ - TOP_GAIN_RX6DBHIQGAIN_MASK | \ - TOP_GAIN_SPARE_MASK) -#define TOP_GAIN_SW_MASK (32'h0 | \ - TOP_GAIN_TX6DBLOQGAIN_MASK | \ - TOP_GAIN_TX1DBLOQGAIN_MASK | \ - TOP_GAIN_TXV2IGAIN_MASK | \ - TOP_GAIN_PABUF5GN_MASK | \ - TOP_GAIN_PADRVGN_MASK | \ - TOP_GAIN_PAOUT2GN_MASK | \ - TOP_GAIN_LNAON_MASK | \ - TOP_GAIN_LNAGAIN_MASK | \ - TOP_GAIN_RFVGA5GAIN_MASK | \ - TOP_GAIN_RFGMGN_MASK | \ - TOP_GAIN_RX6DBLOQGAIN_MASK | \ - TOP_GAIN_RX1DBLOQGAIN_MASK | \ - TOP_GAIN_RX6DBHIQGAIN_MASK | \ - TOP_GAIN_SPARE_MASK) - -#define TOP_TOP_ADDRESS 'h00000034 -#define TOP_TOP_LOCALTXGAIN_MSB 31 -#define TOP_TOP_LOCALTXGAIN_LSB 31 -#define TOP_TOP_LOCALTXGAIN_MASK 'h80000000 -#define TOP_TOP_LOCALTXGAIN_GET(x) (((x) & TOP_TOP_LOCALTXGAIN_MASK) >> TOP_TOP_LOCALTXGAIN_LSB) -#define TOP_TOP_LOCALTXGAIN_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALTXGAIN_LSB) & TOP_TOP_LOCALTXGAIN_MASK) -#define TOP_TOP_LOCALTXGAIN_RESET 1'h0 -#define TOP_TOP_LOCALRXGAIN_MSB 30 -#define TOP_TOP_LOCALRXGAIN_LSB 30 -#define TOP_TOP_LOCALRXGAIN_MASK 'h40000000 -#define TOP_TOP_LOCALRXGAIN_GET(x) (((x) & TOP_TOP_LOCALRXGAIN_MASK) >> TOP_TOP_LOCALRXGAIN_LSB) -#define TOP_TOP_LOCALRXGAIN_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALRXGAIN_LSB) & TOP_TOP_LOCALRXGAIN_MASK) -#define TOP_TOP_LOCALRXGAIN_RESET 1'h0 -#define TOP_TOP_LOCALMODE_MSB 29 -#define TOP_TOP_LOCALMODE_LSB 29 -#define TOP_TOP_LOCALMODE_MASK 'h20000000 -#define TOP_TOP_LOCALMODE_GET(x) (((x) & TOP_TOP_LOCALMODE_MASK) >> TOP_TOP_LOCALMODE_LSB) -#define TOP_TOP_LOCALMODE_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALMODE_LSB) & TOP_TOP_LOCALMODE_MASK) -#define TOP_TOP_LOCALMODE_RESET 1'h0 -#define TOP_TOP_CALFC_MSB 28 -#define TOP_TOP_CALFC_LSB 28 -#define TOP_TOP_CALFC_MASK 'h10000000 -#define TOP_TOP_CALFC_GET(x) (((x) & TOP_TOP_CALFC_MASK) >> TOP_TOP_CALFC_LSB) -#define TOP_TOP_CALFC_SET(x) (((32'd0 | (x)) << TOP_TOP_CALFC_LSB) & TOP_TOP_CALFC_MASK) -#define TOP_TOP_CALFC_RESET 1'h0 -#define TOP_TOP_CALDC_MSB 27 -#define TOP_TOP_CALDC_LSB 27 -#define TOP_TOP_CALDC_MASK 'h08000000 -#define TOP_TOP_CALDC_GET(x) (((x) & TOP_TOP_CALDC_MASK) >> TOP_TOP_CALDC_LSB) -#define TOP_TOP_CALDC_SET(x) (((32'd0 | (x)) << TOP_TOP_CALDC_LSB) & TOP_TOP_CALDC_MASK) -#define TOP_TOP_CALDC_RESET 1'h0 -#define TOP_TOP_CAL_RESIDUE_MSB 26 -#define TOP_TOP_CAL_RESIDUE_LSB 26 -#define TOP_TOP_CAL_RESIDUE_MASK 'h04000000 -#define TOP_TOP_CAL_RESIDUE_GET(x) (((x) & TOP_TOP_CAL_RESIDUE_MASK) >> TOP_TOP_CAL_RESIDUE_LSB) -#define TOP_TOP_CAL_RESIDUE_SET(x) (((32'd0 | (x)) << TOP_TOP_CAL_RESIDUE_LSB) & TOP_TOP_CAL_RESIDUE_MASK) -#define TOP_TOP_CAL_RESIDUE_RESET 1'h0 -#define TOP_TOP_BMODE_MSB 25 -#define TOP_TOP_BMODE_LSB 25 -#define TOP_TOP_BMODE_MASK 'h02000000 -#define TOP_TOP_BMODE_GET(x) (((x) & TOP_TOP_BMODE_MASK) >> TOP_TOP_BMODE_LSB) -#define TOP_TOP_BMODE_SET(x) (((32'd0 | (x)) << TOP_TOP_BMODE_LSB) & TOP_TOP_BMODE_MASK) -#define TOP_TOP_BMODE_RESET 1'h1 -#define TOP_TOP_SYNTHON_MSB 24 -#define TOP_TOP_SYNTHON_LSB 24 -#define TOP_TOP_SYNTHON_MASK 'h01000000 -#define TOP_TOP_SYNTHON_GET(x) (((x) & TOP_TOP_SYNTHON_MASK) >> TOP_TOP_SYNTHON_LSB) -#define TOP_TOP_SYNTHON_SET(x) (((32'd0 | (x)) << TOP_TOP_SYNTHON_LSB) & TOP_TOP_SYNTHON_MASK) -#define TOP_TOP_SYNTHON_RESET 1'h0 -#define TOP_TOP_RXON_MSB 23 -#define TOP_TOP_RXON_LSB 23 -#define TOP_TOP_RXON_MASK 'h00800000 -#define TOP_TOP_RXON_GET(x) (((x) & TOP_TOP_RXON_MASK) >> TOP_TOP_RXON_LSB) -#define TOP_TOP_RXON_SET(x) (((32'd0 | (x)) << TOP_TOP_RXON_LSB) & TOP_TOP_RXON_MASK) -#define TOP_TOP_RXON_RESET 1'h0 -#define TOP_TOP_TXON_MSB 22 -#define TOP_TOP_TXON_LSB 22 -#define TOP_TOP_TXON_MASK 'h00400000 -#define TOP_TOP_TXON_GET(x) (((x) & TOP_TOP_TXON_MASK) >> TOP_TOP_TXON_LSB) -#define TOP_TOP_TXON_SET(x) (((32'd0 | (x)) << TOP_TOP_TXON_LSB) & TOP_TOP_TXON_MASK) -#define TOP_TOP_TXON_RESET 1'h0 -#define TOP_TOP_PAON_MSB 21 -#define TOP_TOP_PAON_LSB 21 -#define TOP_TOP_PAON_MASK 'h00200000 -#define TOP_TOP_PAON_GET(x) (((x) & TOP_TOP_PAON_MASK) >> TOP_TOP_PAON_LSB) -#define TOP_TOP_PAON_SET(x) (((32'd0 | (x)) << TOP_TOP_PAON_LSB) & TOP_TOP_PAON_MASK) -#define TOP_TOP_PAON_RESET 1'h0 -#define TOP_TOP_CALTX_MSB 20 -#define TOP_TOP_CALTX_LSB 20 -#define TOP_TOP_CALTX_MASK 'h00100000 -#define TOP_TOP_CALTX_GET(x) (((x) & TOP_TOP_CALTX_MASK) >> TOP_TOP_CALTX_LSB) -#define TOP_TOP_CALTX_SET(x) (((32'd0 | (x)) << TOP_TOP_CALTX_LSB) & TOP_TOP_CALTX_MASK) -#define TOP_TOP_CALTX_RESET 1'h0 -#define TOP_TOP_LOCALADDAC_MSB 19 -#define TOP_TOP_LOCALADDAC_LSB 19 -#define TOP_TOP_LOCALADDAC_MASK 'h00080000 -#define TOP_TOP_LOCALADDAC_GET(x) (((x) & TOP_TOP_LOCALADDAC_MASK) >> TOP_TOP_LOCALADDAC_LSB) -#define TOP_TOP_LOCALADDAC_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALADDAC_LSB) & TOP_TOP_LOCALADDAC_MASK) -#define TOP_TOP_LOCALADDAC_RESET 1'h0 -#define TOP_TOP_PWDPLL_MSB 18 -#define TOP_TOP_PWDPLL_LSB 18 -#define TOP_TOP_PWDPLL_MASK 'h00040000 -#define TOP_TOP_PWDPLL_GET(x) (((x) & TOP_TOP_PWDPLL_MASK) >> TOP_TOP_PWDPLL_LSB) -#define TOP_TOP_PWDPLL_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDPLL_LSB) & TOP_TOP_PWDPLL_MASK) -#define TOP_TOP_PWDPLL_RESET 1'h0 -#define TOP_TOP_PWDADC_MSB 17 -#define TOP_TOP_PWDADC_LSB 17 -#define TOP_TOP_PWDADC_MASK 'h00020000 -#define TOP_TOP_PWDADC_GET(x) (((x) & TOP_TOP_PWDADC_MASK) >> TOP_TOP_PWDADC_LSB) -#define TOP_TOP_PWDADC_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDADC_LSB) & TOP_TOP_PWDADC_MASK) -#define TOP_TOP_PWDADC_RESET 1'h0 -#define TOP_TOP_PWDDAC_MSB 16 -#define TOP_TOP_PWDDAC_LSB 16 -#define TOP_TOP_PWDDAC_MASK 'h00010000 -#define TOP_TOP_PWDDAC_GET(x) (((x) & TOP_TOP_PWDDAC_MASK) >> TOP_TOP_PWDDAC_LSB) -#define TOP_TOP_PWDDAC_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDDAC_LSB) & TOP_TOP_PWDDAC_MASK) -#define TOP_TOP_PWDDAC_RESET 1'h0 -#define TOP_TOP_LOCALXTAL_MSB 15 -#define TOP_TOP_LOCALXTAL_LSB 15 -#define TOP_TOP_LOCALXTAL_MASK 'h00008000 -#define TOP_TOP_LOCALXTAL_GET(x) (((x) & TOP_TOP_LOCALXTAL_MASK) >> TOP_TOP_LOCALXTAL_LSB) -#define TOP_TOP_LOCALXTAL_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALXTAL_LSB) & TOP_TOP_LOCALXTAL_MASK) -#define TOP_TOP_LOCALXTAL_RESET 1'h0 -#define TOP_TOP_PWDCLKIN_MSB 14 -#define TOP_TOP_PWDCLKIN_LSB 14 -#define TOP_TOP_PWDCLKIN_MASK 'h00004000 -#define TOP_TOP_PWDCLKIN_GET(x) (((x) & TOP_TOP_PWDCLKIN_MASK) >> TOP_TOP_PWDCLKIN_LSB) -#define TOP_TOP_PWDCLKIN_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDCLKIN_LSB) & TOP_TOP_PWDCLKIN_MASK) -#define TOP_TOP_PWDCLKIN_RESET 1'h0 -#define TOP_TOP_OSCON_MSB 13 -#define TOP_TOP_OSCON_LSB 13 -#define TOP_TOP_OSCON_MASK 'h00002000 -#define TOP_TOP_OSCON_GET(x) (((x) & TOP_TOP_OSCON_MASK) >> TOP_TOP_OSCON_LSB) -#define TOP_TOP_OSCON_SET(x) (((32'd0 | (x)) << TOP_TOP_OSCON_LSB) & TOP_TOP_OSCON_MASK) -#define TOP_TOP_OSCON_RESET 1'h1 -#define TOP_TOP_SCLKEN_FORCE_MSB 12 -#define TOP_TOP_SCLKEN_FORCE_LSB 12 -#define TOP_TOP_SCLKEN_FORCE_MASK 'h00001000 -#define TOP_TOP_SCLKEN_FORCE_GET(x) (((x) & TOP_TOP_SCLKEN_FORCE_MASK) >> TOP_TOP_SCLKEN_FORCE_LSB) -#define TOP_TOP_SCLKEN_FORCE_SET(x) (((32'd0 | (x)) << TOP_TOP_SCLKEN_FORCE_LSB) & TOP_TOP_SCLKEN_FORCE_MASK) -#define TOP_TOP_SCLKEN_FORCE_RESET 1'h0 -#define TOP_TOP_SYNTHON_FORCE_MSB 11 -#define TOP_TOP_SYNTHON_FORCE_LSB 11 -#define TOP_TOP_SYNTHON_FORCE_MASK 'h00000800 -#define TOP_TOP_SYNTHON_FORCE_GET(x) (((x) & TOP_TOP_SYNTHON_FORCE_MASK) >> TOP_TOP_SYNTHON_FORCE_LSB) -#define TOP_TOP_SYNTHON_FORCE_SET(x) (((32'd0 | (x)) << TOP_TOP_SYNTHON_FORCE_LSB) & TOP_TOP_SYNTHON_FORCE_MASK) -#define TOP_TOP_SYNTHON_FORCE_RESET 1'h0 -#define TOP_TOP_PDBIAS_MSB 10 -#define TOP_TOP_PDBIAS_LSB 10 -#define TOP_TOP_PDBIAS_MASK 'h00000400 -#define TOP_TOP_PDBIAS_GET(x) (((x) & TOP_TOP_PDBIAS_MASK) >> TOP_TOP_PDBIAS_LSB) -#define TOP_TOP_PDBIAS_SET(x) (((32'd0 | (x)) << TOP_TOP_PDBIAS_LSB) & TOP_TOP_PDBIAS_MASK) -#define TOP_TOP_PDBIAS_RESET 1'h0 -#define TOP_TOP_DATAOUTSEL_MSB 9 -#define TOP_TOP_DATAOUTSEL_LSB 8 -#define TOP_TOP_DATAOUTSEL_MASK 'h00000300 -#define TOP_TOP_DATAOUTSEL_GET(x) (((x) & TOP_TOP_DATAOUTSEL_MASK) >> TOP_TOP_DATAOUTSEL_LSB) -#define TOP_TOP_DATAOUTSEL_SET(x) (((32'd0 | (x)) << TOP_TOP_DATAOUTSEL_LSB) & TOP_TOP_DATAOUTSEL_MASK) -#define TOP_TOP_DATAOUTSEL_RESET 2'h3 -#define TOP_TOP_REVID_MSB 7 -#define TOP_TOP_REVID_LSB 5 -#define TOP_TOP_REVID_MASK 'h000000e0 -#define TOP_TOP_REVID_GET(x) (((x) & TOP_TOP_REVID_MASK) >> TOP_TOP_REVID_LSB) -#define TOP_TOP_REVID_SET(x) (((32'd0 | (x)) << TOP_TOP_REVID_LSB) & TOP_TOP_REVID_MASK) -#define TOP_TOP_REVID_RESET 3'h0 -#define TOP_TOP_INT2PAD_MSB 4 -#define TOP_TOP_INT2PAD_LSB 4 -#define TOP_TOP_INT2PAD_MASK 'h00000010 -#define TOP_TOP_INT2PAD_GET(x) (((x) & TOP_TOP_INT2PAD_MASK) >> TOP_TOP_INT2PAD_LSB) -#define TOP_TOP_INT2PAD_SET(x) (((32'd0 | (x)) << TOP_TOP_INT2PAD_LSB) & TOP_TOP_INT2PAD_MASK) -#define TOP_TOP_INT2PAD_RESET 1'h0 -#define TOP_TOP_INTH2PAD_MSB 3 -#define TOP_TOP_INTH2PAD_LSB 3 -#define TOP_TOP_INTH2PAD_MASK 'h00000008 -#define TOP_TOP_INTH2PAD_GET(x) (((x) & TOP_TOP_INTH2PAD_MASK) >> TOP_TOP_INTH2PAD_LSB) -#define TOP_TOP_INTH2PAD_SET(x) (((32'd0 | (x)) << TOP_TOP_INTH2PAD_LSB) & TOP_TOP_INTH2PAD_MASK) -#define TOP_TOP_INTH2PAD_RESET 1'h0 -#define TOP_TOP_PAD2GND_MSB 2 -#define TOP_TOP_PAD2GND_LSB 2 -#define TOP_TOP_PAD2GND_MASK 'h00000004 -#define TOP_TOP_PAD2GND_GET(x) (((x) & TOP_TOP_PAD2GND_MASK) >> TOP_TOP_PAD2GND_LSB) -#define TOP_TOP_PAD2GND_SET(x) (((32'd0 | (x)) << TOP_TOP_PAD2GND_LSB) & TOP_TOP_PAD2GND_MASK) -#define TOP_TOP_PAD2GND_RESET 1'h0 -#define TOP_TOP_INT2GND_MSB 1 -#define TOP_TOP_INT2GND_LSB 1 -#define TOP_TOP_INT2GND_MASK 'h00000002 -#define TOP_TOP_INT2GND_GET(x) (((x) & TOP_TOP_INT2GND_MASK) >> TOP_TOP_INT2GND_LSB) -#define TOP_TOP_INT2GND_SET(x) (((32'd0 | (x)) << TOP_TOP_INT2GND_LSB) & TOP_TOP_INT2GND_MASK) -#define TOP_TOP_INT2GND_RESET 1'h0 -#define TOP_TOP_FORCE_XPAON_MSB 0 -#define TOP_TOP_FORCE_XPAON_LSB 0 -#define TOP_TOP_FORCE_XPAON_MASK 'h00000001 -#define TOP_TOP_FORCE_XPAON_GET(x) (((x) & TOP_TOP_FORCE_XPAON_MASK) >> TOP_TOP_FORCE_XPAON_LSB) -#define TOP_TOP_FORCE_XPAON_SET(x) (((32'd0 | (x)) << TOP_TOP_FORCE_XPAON_LSB) & TOP_TOP_FORCE_XPAON_MASK) -#define TOP_TOP_FORCE_XPAON_RESET 1'h0 -#define TOP_TOP_RESET (32'h0 | \ - TOP_TOP_LOCALTXGAIN_SET(TOP_TOP_LOCALTXGAIN_RESET) | \ - TOP_TOP_LOCALRXGAIN_SET(TOP_TOP_LOCALRXGAIN_RESET) | \ - TOP_TOP_LOCALMODE_SET(TOP_TOP_LOCALMODE_RESET) | \ - TOP_TOP_CALFC_SET(TOP_TOP_CALFC_RESET) | \ - TOP_TOP_CALDC_SET(TOP_TOP_CALDC_RESET) | \ - TOP_TOP_CAL_RESIDUE_SET(TOP_TOP_CAL_RESIDUE_RESET) | \ - TOP_TOP_BMODE_SET(TOP_TOP_BMODE_RESET) | \ - TOP_TOP_SYNTHON_SET(TOP_TOP_SYNTHON_RESET) | \ - TOP_TOP_RXON_SET(TOP_TOP_RXON_RESET) | \ - TOP_TOP_TXON_SET(TOP_TOP_TXON_RESET) | \ - TOP_TOP_PAON_SET(TOP_TOP_PAON_RESET) | \ - TOP_TOP_CALTX_SET(TOP_TOP_CALTX_RESET) | \ - TOP_TOP_LOCALADDAC_SET(TOP_TOP_LOCALADDAC_RESET) | \ - TOP_TOP_PWDPLL_SET(TOP_TOP_PWDPLL_RESET) | \ - TOP_TOP_PWDADC_SET(TOP_TOP_PWDADC_RESET) | \ - TOP_TOP_PWDDAC_SET(TOP_TOP_PWDDAC_RESET) | \ - TOP_TOP_LOCALXTAL_SET(TOP_TOP_LOCALXTAL_RESET) | \ - TOP_TOP_PWDCLKIN_SET(TOP_TOP_PWDCLKIN_RESET) | \ - TOP_TOP_OSCON_SET(TOP_TOP_OSCON_RESET) | \ - TOP_TOP_SCLKEN_FORCE_SET(TOP_TOP_SCLKEN_FORCE_RESET) | \ - TOP_TOP_SYNTHON_FORCE_SET(TOP_TOP_SYNTHON_FORCE_RESET) | \ - TOP_TOP_PDBIAS_SET(TOP_TOP_PDBIAS_RESET) | \ - TOP_TOP_DATAOUTSEL_SET(TOP_TOP_DATAOUTSEL_RESET) | \ - TOP_TOP_REVID_SET(TOP_TOP_REVID_RESET) | \ - TOP_TOP_INT2PAD_SET(TOP_TOP_INT2PAD_RESET) | \ - TOP_TOP_INTH2PAD_SET(TOP_TOP_INTH2PAD_RESET) | \ - TOP_TOP_PAD2GND_SET(TOP_TOP_PAD2GND_RESET) | \ - TOP_TOP_INT2GND_SET(TOP_TOP_INT2GND_RESET) | \ - TOP_TOP_FORCE_XPAON_SET(TOP_TOP_FORCE_XPAON_RESET)) -#define TOP_TOP_HW_MASK (32'h0 | \ - TOP_TOP_CALFC_MASK | \ - TOP_TOP_CALDC_MASK | \ - TOP_TOP_CAL_RESIDUE_MASK | \ - TOP_TOP_BMODE_MASK | \ - TOP_TOP_SYNTHON_MASK | \ - TOP_TOP_RXON_MASK | \ - TOP_TOP_TXON_MASK | \ - TOP_TOP_PAON_MASK | \ - TOP_TOP_CALTX_MASK | \ - TOP_TOP_PWDPLL_MASK | \ - TOP_TOP_PWDADC_MASK | \ - TOP_TOP_PWDDAC_MASK | \ - TOP_TOP_PWDCLKIN_MASK | \ - TOP_TOP_OSCON_MASK | \ - TOP_TOP_REVID_MASK) -#define TOP_TOP_SW_MASK (32'h0 | \ - TOP_TOP_LOCALTXGAIN_MASK | \ - TOP_TOP_LOCALRXGAIN_MASK | \ - TOP_TOP_LOCALMODE_MASK | \ - TOP_TOP_CALFC_MASK | \ - TOP_TOP_CALDC_MASK | \ - TOP_TOP_CAL_RESIDUE_MASK | \ - TOP_TOP_BMODE_MASK | \ - TOP_TOP_SYNTHON_MASK | \ - TOP_TOP_RXON_MASK | \ - TOP_TOP_TXON_MASK | \ - TOP_TOP_PAON_MASK | \ - TOP_TOP_CALTX_MASK | \ - TOP_TOP_LOCALADDAC_MASK | \ - TOP_TOP_PWDPLL_MASK | \ - TOP_TOP_PWDADC_MASK | \ - TOP_TOP_PWDDAC_MASK | \ - TOP_TOP_LOCALXTAL_MASK | \ - TOP_TOP_PWDCLKIN_MASK | \ - TOP_TOP_OSCON_MASK | \ - TOP_TOP_SCLKEN_FORCE_MASK | \ - TOP_TOP_SYNTHON_FORCE_MASK | \ - TOP_TOP_PDBIAS_MASK | \ - TOP_TOP_DATAOUTSEL_MASK | \ - TOP_TOP_INT2PAD_MASK | \ - TOP_TOP_INTH2PAD_MASK | \ - TOP_TOP_PAD2GND_MASK | \ - TOP_TOP_INT2GND_MASK | \ - TOP_TOP_FORCE_XPAON_MASK) - -#define BIAS_BIAS_SEL_ADDRESS 'h00000038 -#define BIAS_BIAS_SEL_PADON_MSB 31 -#define BIAS_BIAS_SEL_PADON_LSB 31 -#define BIAS_BIAS_SEL_PADON_MASK 'h80000000 -#define BIAS_BIAS_SEL_PADON_GET(x) (((x) & BIAS_BIAS_SEL_PADON_MASK) >> BIAS_BIAS_SEL_PADON_LSB) -#define BIAS_BIAS_SEL_PADON_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PADON_LSB) & BIAS_BIAS_SEL_PADON_MASK) -#define BIAS_BIAS_SEL_PADON_RESET 1'h0 -#define BIAS_BIAS_SEL_SEL_BIAS_MSB 30 -#define BIAS_BIAS_SEL_SEL_BIAS_LSB 25 -#define BIAS_BIAS_SEL_SEL_BIAS_MASK 'h7e000000 -#define BIAS_BIAS_SEL_SEL_BIAS_GET(x) (((x) & BIAS_BIAS_SEL_SEL_BIAS_MASK) >> BIAS_BIAS_SEL_SEL_BIAS_LSB) -#define BIAS_BIAS_SEL_SEL_BIAS_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_SEL_BIAS_LSB) & BIAS_BIAS_SEL_SEL_BIAS_MASK) -#define BIAS_BIAS_SEL_SEL_BIAS_RESET 6'h0 -#define BIAS_BIAS_SEL_SEL_SPARE_MSB 24 -#define BIAS_BIAS_SEL_SEL_SPARE_LSB 21 -#define BIAS_BIAS_SEL_SEL_SPARE_MASK 'h01e00000 -#define BIAS_BIAS_SEL_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SEL_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_SEL_SPARE_RESET 4'h0 -#define BIAS_BIAS_SEL_SPARE_MSB 20 -#define BIAS_BIAS_SEL_SPARE_LSB 20 -#define BIAS_BIAS_SEL_SPARE_MASK 'h00100000 -#define BIAS_BIAS_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_SPARE_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MSB 19 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB 17 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK 'h000e0000 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_RESET 3'h6 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK 'h00010000 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK 'h00008000 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK 'h00004000 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_LSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MASK 'h00002000 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) >> BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MSB 12 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB 10 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK 'h00001c00 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MSB 9 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_LSB 7 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MASK 'h00000380 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) >> BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MSB 6 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_LSB 4 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MASK 'h00000070 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) >> BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MSB 3 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_LSB 1 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MASK 'h0000000e -#define BIAS_BIAS_SEL_PWD_ICTXPC25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) >> BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICLDO25_MSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_LSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_MASK 'h00000001 -#define BIAS_BIAS_SEL_PWD_ICLDO25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) >> BIAS_BIAS_SEL_PWD_ICLDO25_LSB) -#define BIAS_BIAS_SEL_PWD_ICLDO25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICLDO25_LSB) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) -#define BIAS_BIAS_SEL_PWD_ICLDO25_RESET 1'h0 -#define BIAS_BIAS_SEL_RESET (32'h0 | \ - BIAS_BIAS_SEL_PADON_SET(BIAS_BIAS_SEL_PADON_RESET) | \ - BIAS_BIAS_SEL_SEL_BIAS_SET(BIAS_BIAS_SEL_SEL_BIAS_RESET) | \ - BIAS_BIAS_SEL_SEL_SPARE_SET(BIAS_BIAS_SEL_SEL_SPARE_RESET) | \ - BIAS_BIAS_SEL_SPARE_SET(BIAS_BIAS_SEL_SPARE_RESET) | \ - BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_SET(BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_RESET) | \ - BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_SET(BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_RESET) | \ - BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_SET(BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_RESET) | \ - BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_SET(BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICCPLL25_SET(BIAS_BIAS_SEL_PWD_ICCPLL25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_SET(BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICXTAL25_SET(BIAS_BIAS_SEL_PWD_ICXTAL25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICTSENS25_SET(BIAS_BIAS_SEL_PWD_ICTSENS25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICTXPC25_SET(BIAS_BIAS_SEL_PWD_ICTXPC25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICLDO25_SET(BIAS_BIAS_SEL_PWD_ICLDO25_RESET)) -#define BIAS_BIAS_SEL_HW_MASK (32'h0) -#define BIAS_BIAS_SEL_SW_MASK (32'h0 | \ - BIAS_BIAS_SEL_PADON_MASK | \ - BIAS_BIAS_SEL_SEL_BIAS_MASK | \ - BIAS_BIAS_SEL_SEL_SPARE_MASK | \ - BIAS_BIAS_SEL_SPARE_MASK | \ - BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK | \ - BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK | \ - BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK | \ - BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK | \ - BIAS_BIAS_SEL_PWD_ICCPLL25_MASK | \ - BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK | \ - BIAS_BIAS_SEL_PWD_ICXTAL25_MASK | \ - BIAS_BIAS_SEL_PWD_ICTSENS25_MASK | \ - BIAS_BIAS_SEL_PWD_ICTXPC25_MASK | \ - BIAS_BIAS_SEL_PWD_ICLDO25_MASK) - -#define BIAS_BIAS1_ADDRESS 'h0000003c -#define BIAS_BIAS1_PWD_ICDAC2BB25_MSB 31 -#define BIAS_BIAS1_PWD_ICDAC2BB25_LSB 29 -#define BIAS_BIAS1_PWD_ICDAC2BB25_MASK 'he0000000 -#define BIAS_BIAS1_PWD_ICDAC2BB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) >> BIAS_BIAS1_PWD_ICDAC2BB25_LSB) -#define BIAS_BIAS1_PWD_ICDAC2BB25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_ICDAC2BB25_LSB) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) -#define BIAS_BIAS1_PWD_ICDAC2BB25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GVGM25_MSB 28 -#define BIAS_BIAS1_PWD_IC2GVGM25_LSB 26 -#define BIAS_BIAS1_PWD_IC2GVGM25_MASK 'h1c000000 -#define BIAS_BIAS1_PWD_IC2GVGM25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) >> BIAS_BIAS1_PWD_IC2GVGM25_LSB) -#define BIAS_BIAS1_PWD_IC2GVGM25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GVGM25_LSB) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) -#define BIAS_BIAS1_PWD_IC2GVGM25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GRFFE25_MSB 25 -#define BIAS_BIAS1_PWD_IC2GRFFE25_LSB 23 -#define BIAS_BIAS1_PWD_IC2GRFFE25_MASK 'h03800000 -#define BIAS_BIAS1_PWD_IC2GRFFE25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) >> BIAS_BIAS1_PWD_IC2GRFFE25_LSB) -#define BIAS_BIAS1_PWD_IC2GRFFE25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GRFFE25_LSB) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) -#define BIAS_BIAS1_PWD_IC2GRFFE25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GLOREG25_MSB 22 -#define BIAS_BIAS1_PWD_IC2GLOREG25_LSB 20 -#define BIAS_BIAS1_PWD_IC2GLOREG25_MASK 'h00700000 -#define BIAS_BIAS1_PWD_IC2GLOREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLOREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLOREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GLOREG25_LSB) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) -#define BIAS_BIAS1_PWD_IC2GLOREG25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MSB 19 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_LSB 17 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MASK 'h000e0000 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_RESET 3'h3 -#define BIAS_BIAS1_PWD_ICDETECTORB25_MSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_LSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_MASK 'h00010000 -#define BIAS_BIAS1_PWD_ICDETECTORB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORB25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORB25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_ICDETECTORB25_LSB) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORB25_RESET 1'h0 -#define BIAS_BIAS1_PWD_ICDETECTORA25_MSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_LSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_MASK 'h00008000 -#define BIAS_BIAS1_PWD_ICDETECTORA25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORA25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORA25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_ICDETECTORA25_LSB) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORA25_RESET 1'h0 -#define BIAS_BIAS1_PWD_IC5GRXRF25_MSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_LSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_MASK 'h00004000 -#define BIAS_BIAS1_PWD_IC5GRXRF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) >> BIAS_BIAS1_PWD_IC5GRXRF25_LSB) -#define BIAS_BIAS1_PWD_IC5GRXRF25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GRXRF25_LSB) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) -#define BIAS_BIAS1_PWD_IC5GRXRF25_RESET 1'h0 -#define BIAS_BIAS1_PWD_IC5GTXPA25_MSB 13 -#define BIAS_BIAS1_PWD_IC5GTXPA25_LSB 11 -#define BIAS_BIAS1_PWD_IC5GTXPA25_MASK 'h00003800 -#define BIAS_BIAS1_PWD_IC5GTXPA25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) >> BIAS_BIAS1_PWD_IC5GTXPA25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXPA25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GTXPA25_LSB) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXPA25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MSB 10 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_LSB 8 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MASK 'h00000700 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) >> BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC5GQB25_MSB 7 -#define BIAS_BIAS1_PWD_IC5GQB25_LSB 5 -#define BIAS_BIAS1_PWD_IC5GQB25_MASK 'h000000e0 -#define BIAS_BIAS1_PWD_IC5GQB25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GQB25_MASK) >> BIAS_BIAS1_PWD_IC5GQB25_LSB) -#define BIAS_BIAS1_PWD_IC5GQB25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GQB25_LSB) & BIAS_BIAS1_PWD_IC5GQB25_MASK) -#define BIAS_BIAS1_PWD_IC5GQB25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MSB 4 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_LSB 2 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MASK 'h0000001c -#define BIAS_BIAS1_PWD_IC5GMIXQ25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) >> BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_RESET 3'h3 -#define BIAS_BIAS1_SPARE_MSB 1 -#define BIAS_BIAS1_SPARE_LSB 0 -#define BIAS_BIAS1_SPARE_MASK 'h00000003 -#define BIAS_BIAS1_SPARE_GET(x) (((x) & BIAS_BIAS1_SPARE_MASK) >> BIAS_BIAS1_SPARE_LSB) -#define BIAS_BIAS1_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_SPARE_LSB) & BIAS_BIAS1_SPARE_MASK) -#define BIAS_BIAS1_SPARE_RESET 2'h3 -#define BIAS_BIAS1_RESET (32'h0 | \ - BIAS_BIAS1_PWD_ICDAC2BB25_SET(BIAS_BIAS1_PWD_ICDAC2BB25_RESET) | \ - BIAS_BIAS1_PWD_IC2GVGM25_SET(BIAS_BIAS1_PWD_IC2GVGM25_RESET) | \ - BIAS_BIAS1_PWD_IC2GRFFE25_SET(BIAS_BIAS1_PWD_IC2GRFFE25_RESET) | \ - BIAS_BIAS1_PWD_IC2GLOREG25_SET(BIAS_BIAS1_PWD_IC2GLOREG25_RESET) | \ - BIAS_BIAS1_PWD_IC2GLNAREG25_SET(BIAS_BIAS1_PWD_IC2GLNAREG25_RESET) | \ - BIAS_BIAS1_PWD_ICDETECTORB25_SET(BIAS_BIAS1_PWD_ICDETECTORB25_RESET) | \ - BIAS_BIAS1_PWD_ICDETECTORA25_SET(BIAS_BIAS1_PWD_ICDETECTORA25_RESET) | \ - BIAS_BIAS1_PWD_IC5GRXRF25_SET(BIAS_BIAS1_PWD_IC5GRXRF25_RESET) | \ - BIAS_BIAS1_PWD_IC5GTXPA25_SET(BIAS_BIAS1_PWD_IC5GTXPA25_RESET) | \ - BIAS_BIAS1_PWD_IC5GTXBUF25_SET(BIAS_BIAS1_PWD_IC5GTXBUF25_RESET) | \ - BIAS_BIAS1_PWD_IC5GQB25_SET(BIAS_BIAS1_PWD_IC5GQB25_RESET) | \ - BIAS_BIAS1_PWD_IC5GMIXQ25_SET(BIAS_BIAS1_PWD_IC5GMIXQ25_RESET) | \ - BIAS_BIAS1_SPARE_SET(BIAS_BIAS1_SPARE_RESET)) -#define BIAS_BIAS1_HW_MASK (32'h0) -#define BIAS_BIAS1_SW_MASK (32'h0 | \ - BIAS_BIAS1_PWD_ICDAC2BB25_MASK | \ - BIAS_BIAS1_PWD_IC2GVGM25_MASK | \ - BIAS_BIAS1_PWD_IC2GRFFE25_MASK | \ - BIAS_BIAS1_PWD_IC2GLOREG25_MASK | \ - BIAS_BIAS1_PWD_IC2GLNAREG25_MASK | \ - BIAS_BIAS1_PWD_ICDETECTORB25_MASK | \ - BIAS_BIAS1_PWD_ICDETECTORA25_MASK | \ - BIAS_BIAS1_PWD_IC5GRXRF25_MASK | \ - BIAS_BIAS1_PWD_IC5GTXPA25_MASK | \ - BIAS_BIAS1_PWD_IC5GTXBUF25_MASK | \ - BIAS_BIAS1_PWD_IC5GQB25_MASK | \ - BIAS_BIAS1_PWD_IC5GMIXQ25_MASK | \ - BIAS_BIAS1_SPARE_MASK) - -#define BIAS_BIAS2_ADDRESS 'h00000040 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MSB 31 -#define BIAS_BIAS2_PWD_IC5GMIXI25_LSB 29 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MASK 'he0000000 -#define BIAS_BIAS2_PWD_IC5GMIXI25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) >> BIAS_BIAS2_PWD_IC5GMIXI25_LSB) -#define BIAS_BIAS2_PWD_IC5GMIXI25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IC5GMIXI25_LSB) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) -#define BIAS_BIAS2_PWD_IC5GMIXI25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IC5GDIV25_MSB 28 -#define BIAS_BIAS2_PWD_IC5GDIV25_LSB 26 -#define BIAS_BIAS2_PWD_IC5GDIV25_MASK 'h1c000000 -#define BIAS_BIAS2_PWD_IC5GDIV25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) >> BIAS_BIAS2_PWD_IC5GDIV25_LSB) -#define BIAS_BIAS2_PWD_IC5GDIV25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IC5GDIV25_LSB) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) -#define BIAS_BIAS2_PWD_IC5GDIV25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IC5GLOREG25_MSB 25 -#define BIAS_BIAS2_PWD_IC5GLOREG25_LSB 23 -#define BIAS_BIAS2_PWD_IC5GLOREG25_MASK 'h03800000 -#define BIAS_BIAS2_PWD_IC5GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) >> BIAS_BIAS2_PWD_IC5GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IC5GLOREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IC5GLOREG25_LSB) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IC5GLOREG25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRPLL25_MSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_LSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_MASK 'h00400000 -#define BIAS_BIAS2_PWD_IRPLL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRPLL25_MASK) >> BIAS_BIAS2_PWD_IRPLL25_LSB) -#define BIAS_BIAS2_PWD_IRPLL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRPLL25_LSB) & BIAS_BIAS2_PWD_IRPLL25_MASK) -#define BIAS_BIAS2_PWD_IRPLL25_RESET 1'h0 -#define BIAS_BIAS2_PWD_IRXTAL25_MSB 21 -#define BIAS_BIAS2_PWD_IRXTAL25_LSB 19 -#define BIAS_BIAS2_PWD_IRXTAL25_MASK 'h00380000 -#define BIAS_BIAS2_PWD_IRXTAL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRXTAL25_MASK) >> BIAS_BIAS2_PWD_IRXTAL25_LSB) -#define BIAS_BIAS2_PWD_IRXTAL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRXTAL25_LSB) & BIAS_BIAS2_PWD_IRXTAL25_MASK) -#define BIAS_BIAS2_PWD_IRXTAL25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRTSENS25_MSB 18 -#define BIAS_BIAS2_PWD_IRTSENS25_LSB 16 -#define BIAS_BIAS2_PWD_IRTSENS25_MASK 'h00070000 -#define BIAS_BIAS2_PWD_IRTSENS25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTSENS25_MASK) >> BIAS_BIAS2_PWD_IRTSENS25_LSB) -#define BIAS_BIAS2_PWD_IRTSENS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRTSENS25_LSB) & BIAS_BIAS2_PWD_IRTSENS25_MASK) -#define BIAS_BIAS2_PWD_IRTSENS25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRTXPC25_MSB 15 -#define BIAS_BIAS2_PWD_IRTXPC25_LSB 13 -#define BIAS_BIAS2_PWD_IRTXPC25_MASK 'h0000e000 -#define BIAS_BIAS2_PWD_IRTXPC25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTXPC25_MASK) >> BIAS_BIAS2_PWD_IRTXPC25_LSB) -#define BIAS_BIAS2_PWD_IRTXPC25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRTXPC25_LSB) & BIAS_BIAS2_PWD_IRTXPC25_MASK) -#define BIAS_BIAS2_PWD_IRTXPC25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRLDO25_MSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_LSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_MASK 'h00001000 -#define BIAS_BIAS2_PWD_IRLDO25_GET(x) (((x) & BIAS_BIAS2_PWD_IRLDO25_MASK) >> BIAS_BIAS2_PWD_IRLDO25_LSB) -#define BIAS_BIAS2_PWD_IRLDO25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRLDO25_LSB) & BIAS_BIAS2_PWD_IRLDO25_MASK) -#define BIAS_BIAS2_PWD_IRLDO25_RESET 1'h0 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MSB 11 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_LSB 9 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MASK 'h00000e00 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) >> BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IR2GLOREG25_MSB 8 -#define BIAS_BIAS2_PWD_IR2GLOREG25_LSB 6 -#define BIAS_BIAS2_PWD_IR2GLOREG25_MASK 'h000001c0 -#define BIAS_BIAS2_PWD_IR2GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLOREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR2GLOREG25_LSB) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IR2GLOREG25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MSB 5 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_LSB 3 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MASK 'h00000038 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MSB 2 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB 0 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK 'h00000007 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_GET(x) (((x) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) >> BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_RESET 3'h3 -#define BIAS_BIAS2_RESET (32'h0 | \ - BIAS_BIAS2_PWD_IC5GMIXI25_SET(BIAS_BIAS2_PWD_IC5GMIXI25_RESET) | \ - BIAS_BIAS2_PWD_IC5GDIV25_SET(BIAS_BIAS2_PWD_IC5GDIV25_RESET) | \ - BIAS_BIAS2_PWD_IC5GLOREG25_SET(BIAS_BIAS2_PWD_IC5GLOREG25_RESET) | \ - BIAS_BIAS2_PWD_IRPLL25_SET(BIAS_BIAS2_PWD_IRPLL25_RESET) | \ - BIAS_BIAS2_PWD_IRXTAL25_SET(BIAS_BIAS2_PWD_IRXTAL25_RESET) | \ - BIAS_BIAS2_PWD_IRTSENS25_SET(BIAS_BIAS2_PWD_IRTSENS25_RESET) | \ - BIAS_BIAS2_PWD_IRTXPC25_SET(BIAS_BIAS2_PWD_IRTXPC25_RESET) | \ - BIAS_BIAS2_PWD_IRLDO25_SET(BIAS_BIAS2_PWD_IRLDO25_RESET) | \ - BIAS_BIAS2_PWD_IR2GTXMIX25_SET(BIAS_BIAS2_PWD_IR2GTXMIX25_RESET) | \ - BIAS_BIAS2_PWD_IR2GLOREG25_SET(BIAS_BIAS2_PWD_IR2GLOREG25_RESET) | \ - BIAS_BIAS2_PWD_IR2GLNAREG25_SET(BIAS_BIAS2_PWD_IR2GLNAREG25_RESET) | \ - BIAS_BIAS2_PWD_IR5GRFVREF2525_SET(BIAS_BIAS2_PWD_IR5GRFVREF2525_RESET)) -#define BIAS_BIAS2_HW_MASK (32'h0) -#define BIAS_BIAS2_SW_MASK (32'h0 | \ - BIAS_BIAS2_PWD_IC5GMIXI25_MASK | \ - BIAS_BIAS2_PWD_IC5GDIV25_MASK | \ - BIAS_BIAS2_PWD_IC5GLOREG25_MASK | \ - BIAS_BIAS2_PWD_IRPLL25_MASK | \ - BIAS_BIAS2_PWD_IRXTAL25_MASK | \ - BIAS_BIAS2_PWD_IRTSENS25_MASK | \ - BIAS_BIAS2_PWD_IRTXPC25_MASK | \ - BIAS_BIAS2_PWD_IRLDO25_MASK | \ - BIAS_BIAS2_PWD_IR2GTXMIX25_MASK | \ - BIAS_BIAS2_PWD_IR2GLOREG25_MASK | \ - BIAS_BIAS2_PWD_IR2GLNAREG25_MASK | \ - BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) - -#define BIAS_BIAS3_ADDRESS 'h00000044 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MSB 31 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_LSB 29 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MASK 'he0000000 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) >> BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) -#define BIAS_BIAS3_PWD_IR5GTXMIX25_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) -#define BIAS_BIAS3_PWD_IR5GTXMIX25_RESET 3'h3 -#define BIAS_BIAS3_PWD_IR5GAGC25_MSB 28 -#define BIAS_BIAS3_PWD_IR5GAGC25_LSB 26 -#define BIAS_BIAS3_PWD_IR5GAGC25_MASK 'h1c000000 -#define BIAS_BIAS3_PWD_IR5GAGC25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) >> BIAS_BIAS3_PWD_IR5GAGC25_LSB) -#define BIAS_BIAS3_PWD_IR5GAGC25_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR5GAGC25_LSB) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) -#define BIAS_BIAS3_PWD_IR5GAGC25_RESET 3'h3 -#define BIAS_BIAS3_PWD_ICDAC50_MSB 25 -#define BIAS_BIAS3_PWD_ICDAC50_LSB 23 -#define BIAS_BIAS3_PWD_ICDAC50_MASK 'h03800000 -#define BIAS_BIAS3_PWD_ICDAC50_GET(x) (((x) & BIAS_BIAS3_PWD_ICDAC50_MASK) >> BIAS_BIAS3_PWD_ICDAC50_LSB) -#define BIAS_BIAS3_PWD_ICDAC50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICDAC50_LSB) & BIAS_BIAS3_PWD_ICDAC50_MASK) -#define BIAS_BIAS3_PWD_ICDAC50_RESET 3'h3 -#define BIAS_BIAS3_PWD_ICSYNTH50_MSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_LSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_MASK 'h00400000 -#define BIAS_BIAS3_PWD_ICSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) >> BIAS_BIAS3_PWD_ICSYNTH50_LSB) -#define BIAS_BIAS3_PWD_ICSYNTH50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICSYNTH50_LSB) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) -#define BIAS_BIAS3_PWD_ICSYNTH50_RESET 1'h0 -#define BIAS_BIAS3_PWD_ICBB50_MSB 21 -#define BIAS_BIAS3_PWD_ICBB50_LSB 21 -#define BIAS_BIAS3_PWD_ICBB50_MASK 'h00200000 -#define BIAS_BIAS3_PWD_ICBB50_GET(x) (((x) & BIAS_BIAS3_PWD_ICBB50_MASK) >> BIAS_BIAS3_PWD_ICBB50_LSB) -#define BIAS_BIAS3_PWD_ICBB50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICBB50_LSB) & BIAS_BIAS3_PWD_ICBB50_MASK) -#define BIAS_BIAS3_PWD_ICBB50_RESET 1'h0 -#define BIAS_BIAS3_PWD_IC2GDIV50_MSB 20 -#define BIAS_BIAS3_PWD_IC2GDIV50_LSB 18 -#define BIAS_BIAS3_PWD_IC2GDIV50_MASK 'h001c0000 -#define BIAS_BIAS3_PWD_IC2GDIV50_GET(x) (((x) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) >> BIAS_BIAS3_PWD_IC2GDIV50_LSB) -#define BIAS_BIAS3_PWD_IC2GDIV50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IC2GDIV50_LSB) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) -#define BIAS_BIAS3_PWD_IC2GDIV50_RESET 3'h3 -#define BIAS_BIAS3_PWD_IRSYNTH50_MSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_LSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_MASK 'h00020000 -#define BIAS_BIAS3_PWD_IRSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) >> BIAS_BIAS3_PWD_IRSYNTH50_LSB) -#define BIAS_BIAS3_PWD_IRSYNTH50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IRSYNTH50_LSB) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) -#define BIAS_BIAS3_PWD_IRSYNTH50_RESET 1'h0 -#define BIAS_BIAS3_PWD_IRBB50_MSB 16 -#define BIAS_BIAS3_PWD_IRBB50_LSB 16 -#define BIAS_BIAS3_PWD_IRBB50_MASK 'h00010000 -#define BIAS_BIAS3_PWD_IRBB50_GET(x) (((x) & BIAS_BIAS3_PWD_IRBB50_MASK) >> BIAS_BIAS3_PWD_IRBB50_LSB) -#define BIAS_BIAS3_PWD_IRBB50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IRBB50_LSB) & BIAS_BIAS3_PWD_IRBB50_MASK) -#define BIAS_BIAS3_PWD_IRBB50_RESET 1'h0 -#define BIAS_BIAS3_PWD_IC25SPARE1_MSB 15 -#define BIAS_BIAS3_PWD_IC25SPARE1_LSB 13 -#define BIAS_BIAS3_PWD_IC25SPARE1_MASK 'h0000e000 -#define BIAS_BIAS3_PWD_IC25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) >> BIAS_BIAS3_PWD_IC25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE1_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IC25SPARE1_LSB) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE1_RESET 3'h3 -#define BIAS_BIAS3_PWD_IC25SPARE2_MSB 12 -#define BIAS_BIAS3_PWD_IC25SPARE2_LSB 10 -#define BIAS_BIAS3_PWD_IC25SPARE2_MASK 'h00001c00 -#define BIAS_BIAS3_PWD_IC25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) >> BIAS_BIAS3_PWD_IC25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE2_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IC25SPARE2_LSB) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE2_RESET 3'h3 -#define BIAS_BIAS3_PWD_IR25SPARE1_MSB 9 -#define BIAS_BIAS3_PWD_IR25SPARE1_LSB 7 -#define BIAS_BIAS3_PWD_IR25SPARE1_MASK 'h00000380 -#define BIAS_BIAS3_PWD_IR25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) >> BIAS_BIAS3_PWD_IR25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE1_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR25SPARE1_LSB) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE1_RESET 3'h3 -#define BIAS_BIAS3_PWD_IR25SPARE2_MSB 6 -#define BIAS_BIAS3_PWD_IR25SPARE2_LSB 4 -#define BIAS_BIAS3_PWD_IR25SPARE2_MASK 'h00000070 -#define BIAS_BIAS3_PWD_IR25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) >> BIAS_BIAS3_PWD_IR25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE2_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR25SPARE2_LSB) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE2_RESET 3'h3 -#define BIAS_BIAS3_PWD_ICDACREG12P5_MSB 3 -#define BIAS_BIAS3_PWD_ICDACREG12P5_LSB 1 -#define BIAS_BIAS3_PWD_ICDACREG12P5_MASK 'h0000000e -#define BIAS_BIAS3_PWD_ICDACREG12P5_GET(x) (((x) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) >> BIAS_BIAS3_PWD_ICDACREG12P5_LSB) -#define BIAS_BIAS3_PWD_ICDACREG12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICDACREG12P5_LSB) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) -#define BIAS_BIAS3_PWD_ICDACREG12P5_RESET 3'h5 -#define BIAS_BIAS3_SPARE_MSB 0 -#define BIAS_BIAS3_SPARE_LSB 0 -#define BIAS_BIAS3_SPARE_MASK 'h00000001 -#define BIAS_BIAS3_SPARE_GET(x) (((x) & BIAS_BIAS3_SPARE_MASK) >> BIAS_BIAS3_SPARE_LSB) -#define BIAS_BIAS3_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_SPARE_LSB) & BIAS_BIAS3_SPARE_MASK) -#define BIAS_BIAS3_SPARE_RESET 1'h0 -#define BIAS_BIAS3_RESET (32'h0 | \ - BIAS_BIAS3_PWD_IR5GTXMIX25_SET(BIAS_BIAS3_PWD_IR5GTXMIX25_RESET) | \ - BIAS_BIAS3_PWD_IR5GAGC25_SET(BIAS_BIAS3_PWD_IR5GAGC25_RESET) | \ - BIAS_BIAS3_PWD_ICDAC50_SET(BIAS_BIAS3_PWD_ICDAC50_RESET) | \ - BIAS_BIAS3_PWD_ICSYNTH50_SET(BIAS_BIAS3_PWD_ICSYNTH50_RESET) | \ - BIAS_BIAS3_PWD_ICBB50_SET(BIAS_BIAS3_PWD_ICBB50_RESET) | \ - BIAS_BIAS3_PWD_IC2GDIV50_SET(BIAS_BIAS3_PWD_IC2GDIV50_RESET) | \ - BIAS_BIAS3_PWD_IRSYNTH50_SET(BIAS_BIAS3_PWD_IRSYNTH50_RESET) | \ - BIAS_BIAS3_PWD_IRBB50_SET(BIAS_BIAS3_PWD_IRBB50_RESET) | \ - BIAS_BIAS3_PWD_IC25SPARE1_SET(BIAS_BIAS3_PWD_IC25SPARE1_RESET) | \ - BIAS_BIAS3_PWD_IC25SPARE2_SET(BIAS_BIAS3_PWD_IC25SPARE2_RESET) | \ - BIAS_BIAS3_PWD_IR25SPARE1_SET(BIAS_BIAS3_PWD_IR25SPARE1_RESET) | \ - BIAS_BIAS3_PWD_IR25SPARE2_SET(BIAS_BIAS3_PWD_IR25SPARE2_RESET) | \ - BIAS_BIAS3_PWD_ICDACREG12P5_SET(BIAS_BIAS3_PWD_ICDACREG12P5_RESET) | \ - BIAS_BIAS3_SPARE_SET(BIAS_BIAS3_SPARE_RESET)) -#define BIAS_BIAS3_HW_MASK (32'h0) -#define BIAS_BIAS3_SW_MASK (32'h0 | \ - BIAS_BIAS3_PWD_IR5GTXMIX25_MASK | \ - BIAS_BIAS3_PWD_IR5GAGC25_MASK | \ - BIAS_BIAS3_PWD_ICDAC50_MASK | \ - BIAS_BIAS3_PWD_ICSYNTH50_MASK | \ - BIAS_BIAS3_PWD_ICBB50_MASK | \ - BIAS_BIAS3_PWD_IC2GDIV50_MASK | \ - BIAS_BIAS3_PWD_IRSYNTH50_MASK | \ - BIAS_BIAS3_PWD_IRBB50_MASK | \ - BIAS_BIAS3_PWD_IC25SPARE1_MASK | \ - BIAS_BIAS3_PWD_IC25SPARE2_MASK | \ - BIAS_BIAS3_PWD_IR25SPARE1_MASK | \ - BIAS_BIAS3_PWD_IR25SPARE2_MASK | \ - BIAS_BIAS3_PWD_ICDACREG12P5_MASK | \ - BIAS_BIAS3_SPARE_MASK) - -#define TXPC_TXPC_ADDRESS 'h00000048 -#define TXPC_TXPC_SELINTPD_MSB 31 -#define TXPC_TXPC_SELINTPD_LSB 31 -#define TXPC_TXPC_SELINTPD_MASK 'h80000000 -#define TXPC_TXPC_SELINTPD_GET(x) (((x) & TXPC_TXPC_SELINTPD_MASK) >> TXPC_TXPC_SELINTPD_LSB) -#define TXPC_TXPC_SELINTPD_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELINTPD_LSB) & TXPC_TXPC_SELINTPD_MASK) -#define TXPC_TXPC_SELINTPD_RESET 1'h0 -#define TXPC_TXPC_TEST_MSB 30 -#define TXPC_TXPC_TEST_LSB 30 -#define TXPC_TXPC_TEST_MASK 'h40000000 -#define TXPC_TXPC_TEST_GET(x) (((x) & TXPC_TXPC_TEST_MASK) >> TXPC_TXPC_TEST_LSB) -#define TXPC_TXPC_TEST_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TEST_LSB) & TXPC_TXPC_TEST_MASK) -#define TXPC_TXPC_TEST_RESET 1'h0 -#define TXPC_TXPC_TESTGAIN_MSB 29 -#define TXPC_TXPC_TESTGAIN_LSB 28 -#define TXPC_TXPC_TESTGAIN_MASK 'h30000000 -#define TXPC_TXPC_TESTGAIN_GET(x) (((x) & TXPC_TXPC_TESTGAIN_MASK) >> TXPC_TXPC_TESTGAIN_LSB) -#define TXPC_TXPC_TESTGAIN_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TESTGAIN_LSB) & TXPC_TXPC_TESTGAIN_MASK) -#define TXPC_TXPC_TESTGAIN_RESET 2'h0 -#define TXPC_TXPC_TESTDAC_MSB 27 -#define TXPC_TXPC_TESTDAC_LSB 22 -#define TXPC_TXPC_TESTDAC_MASK 'h0fc00000 -#define TXPC_TXPC_TESTDAC_GET(x) (((x) & TXPC_TXPC_TESTDAC_MASK) >> TXPC_TXPC_TESTDAC_LSB) -#define TXPC_TXPC_TESTDAC_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TESTDAC_LSB) & TXPC_TXPC_TESTDAC_MASK) -#define TXPC_TXPC_TESTDAC_RESET 6'h20 -#define TXPC_TXPC_TESTPWDPC_MSB 21 -#define TXPC_TXPC_TESTPWDPC_LSB 21 -#define TXPC_TXPC_TESTPWDPC_MASK 'h00200000 -#define TXPC_TXPC_TESTPWDPC_GET(x) (((x) & TXPC_TXPC_TESTPWDPC_MASK) >> TXPC_TXPC_TESTPWDPC_LSB) -#define TXPC_TXPC_TESTPWDPC_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TESTPWDPC_LSB) & TXPC_TXPC_TESTPWDPC_MASK) -#define TXPC_TXPC_TESTPWDPC_RESET 1'h0 -#define TXPC_TXPC_CURHALF_MSB 20 -#define TXPC_TXPC_CURHALF_LSB 20 -#define TXPC_TXPC_CURHALF_MASK 'h00100000 -#define TXPC_TXPC_CURHALF_GET(x) (((x) & TXPC_TXPC_CURHALF_MASK) >> TXPC_TXPC_CURHALF_LSB) -#define TXPC_TXPC_CURHALF_SET(x) (((32'd0 | (x)) << TXPC_TXPC_CURHALF_LSB) & TXPC_TXPC_CURHALF_MASK) -#define TXPC_TXPC_CURHALF_RESET 1'h1 -#define TXPC_TXPC_NEGOUT_MSB 19 -#define TXPC_TXPC_NEGOUT_LSB 19 -#define TXPC_TXPC_NEGOUT_MASK 'h00080000 -#define TXPC_TXPC_NEGOUT_GET(x) (((x) & TXPC_TXPC_NEGOUT_MASK) >> TXPC_TXPC_NEGOUT_LSB) -#define TXPC_TXPC_NEGOUT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_NEGOUT_LSB) & TXPC_TXPC_NEGOUT_MASK) -#define TXPC_TXPC_NEGOUT_RESET 1'h0 -#define TXPC_TXPC_CLKDELAY_MSB 18 -#define TXPC_TXPC_CLKDELAY_LSB 18 -#define TXPC_TXPC_CLKDELAY_MASK 'h00040000 -#define TXPC_TXPC_CLKDELAY_GET(x) (((x) & TXPC_TXPC_CLKDELAY_MASK) >> TXPC_TXPC_CLKDELAY_LSB) -#define TXPC_TXPC_CLKDELAY_SET(x) (((32'd0 | (x)) << TXPC_TXPC_CLKDELAY_LSB) & TXPC_TXPC_CLKDELAY_MASK) -#define TXPC_TXPC_CLKDELAY_RESET 1'h0 -#define TXPC_TXPC_SELMODREF_MSB 17 -#define TXPC_TXPC_SELMODREF_LSB 17 -#define TXPC_TXPC_SELMODREF_MASK 'h00020000 -#define TXPC_TXPC_SELMODREF_GET(x) (((x) & TXPC_TXPC_SELMODREF_MASK) >> TXPC_TXPC_SELMODREF_LSB) -#define TXPC_TXPC_SELMODREF_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELMODREF_LSB) & TXPC_TXPC_SELMODREF_MASK) -#define TXPC_TXPC_SELMODREF_RESET 1'h0 -#define TXPC_TXPC_SELCMOUT_MSB 16 -#define TXPC_TXPC_SELCMOUT_LSB 16 -#define TXPC_TXPC_SELCMOUT_MASK 'h00010000 -#define TXPC_TXPC_SELCMOUT_GET(x) (((x) & TXPC_TXPC_SELCMOUT_MASK) >> TXPC_TXPC_SELCMOUT_LSB) -#define TXPC_TXPC_SELCMOUT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELCMOUT_LSB) & TXPC_TXPC_SELCMOUT_MASK) -#define TXPC_TXPC_SELCMOUT_RESET 1'h0 -#define TXPC_TXPC_TSMODE_MSB 15 -#define TXPC_TXPC_TSMODE_LSB 14 -#define TXPC_TXPC_TSMODE_MASK 'h0000c000 -#define TXPC_TXPC_TSMODE_GET(x) (((x) & TXPC_TXPC_TSMODE_MASK) >> TXPC_TXPC_TSMODE_LSB) -#define TXPC_TXPC_TSMODE_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TSMODE_LSB) & TXPC_TXPC_TSMODE_MASK) -#define TXPC_TXPC_TSMODE_RESET 2'h0 -#define TXPC_TXPC_N_MSB 13 -#define TXPC_TXPC_N_LSB 6 -#define TXPC_TXPC_N_MASK 'h00003fc0 -#define TXPC_TXPC_N_GET(x) (((x) & TXPC_TXPC_N_MASK) >> TXPC_TXPC_N_LSB) -#define TXPC_TXPC_N_SET(x) (((32'd0 | (x)) << TXPC_TXPC_N_LSB) & TXPC_TXPC_N_MASK) -#define TXPC_TXPC_N_RESET 8'h80 -#define TXPC_TXPC_ON1STSYNTHON_MSB 5 -#define TXPC_TXPC_ON1STSYNTHON_LSB 5 -#define TXPC_TXPC_ON1STSYNTHON_MASK 'h00000020 -#define TXPC_TXPC_ON1STSYNTHON_GET(x) (((x) & TXPC_TXPC_ON1STSYNTHON_MASK) >> TXPC_TXPC_ON1STSYNTHON_LSB) -#define TXPC_TXPC_ON1STSYNTHON_SET(x) (((32'd0 | (x)) << TXPC_TXPC_ON1STSYNTHON_LSB) & TXPC_TXPC_ON1STSYNTHON_MASK) -#define TXPC_TXPC_ON1STSYNTHON_RESET 1'h1 -#define TXPC_TXPC_SELINIT_MSB 4 -#define TXPC_TXPC_SELINIT_LSB 3 -#define TXPC_TXPC_SELINIT_MASK 'h00000018 -#define TXPC_TXPC_SELINIT_GET(x) (((x) & TXPC_TXPC_SELINIT_MASK) >> TXPC_TXPC_SELINIT_LSB) -#define TXPC_TXPC_SELINIT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELINIT_LSB) & TXPC_TXPC_SELINIT_MASK) -#define TXPC_TXPC_SELINIT_RESET 2'h3 -#define TXPC_TXPC_SELCOUNT_MSB 2 -#define TXPC_TXPC_SELCOUNT_LSB 2 -#define TXPC_TXPC_SELCOUNT_MASK 'h00000004 -#define TXPC_TXPC_SELCOUNT_GET(x) (((x) & TXPC_TXPC_SELCOUNT_MASK) >> TXPC_TXPC_SELCOUNT_LSB) -#define TXPC_TXPC_SELCOUNT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELCOUNT_LSB) & TXPC_TXPC_SELCOUNT_MASK) -#define TXPC_TXPC_SELCOUNT_RESET 1'h1 -#define TXPC_TXPC_ATBSEL_MSB 1 -#define TXPC_TXPC_ATBSEL_LSB 0 -#define TXPC_TXPC_ATBSEL_MASK 'h00000003 -#define TXPC_TXPC_ATBSEL_GET(x) (((x) & TXPC_TXPC_ATBSEL_MASK) >> TXPC_TXPC_ATBSEL_LSB) -#define TXPC_TXPC_ATBSEL_SET(x) (((32'd0 | (x)) << TXPC_TXPC_ATBSEL_LSB) & TXPC_TXPC_ATBSEL_MASK) -#define TXPC_TXPC_ATBSEL_RESET 2'h0 -#define TXPC_TXPC_RESET (32'h0 | \ - TXPC_TXPC_SELINTPD_SET(TXPC_TXPC_SELINTPD_RESET) | \ - TXPC_TXPC_TEST_SET(TXPC_TXPC_TEST_RESET) | \ - TXPC_TXPC_TESTGAIN_SET(TXPC_TXPC_TESTGAIN_RESET) | \ - TXPC_TXPC_TESTDAC_SET(TXPC_TXPC_TESTDAC_RESET) | \ - TXPC_TXPC_TESTPWDPC_SET(TXPC_TXPC_TESTPWDPC_RESET) | \ - TXPC_TXPC_CURHALF_SET(TXPC_TXPC_CURHALF_RESET) | \ - TXPC_TXPC_NEGOUT_SET(TXPC_TXPC_NEGOUT_RESET) | \ - TXPC_TXPC_CLKDELAY_SET(TXPC_TXPC_CLKDELAY_RESET) | \ - TXPC_TXPC_SELMODREF_SET(TXPC_TXPC_SELMODREF_RESET) | \ - TXPC_TXPC_SELCMOUT_SET(TXPC_TXPC_SELCMOUT_RESET) | \ - TXPC_TXPC_TSMODE_SET(TXPC_TXPC_TSMODE_RESET) | \ - TXPC_TXPC_N_SET(TXPC_TXPC_N_RESET) | \ - TXPC_TXPC_ON1STSYNTHON_SET(TXPC_TXPC_ON1STSYNTHON_RESET) | \ - TXPC_TXPC_SELINIT_SET(TXPC_TXPC_SELINIT_RESET) | \ - TXPC_TXPC_SELCOUNT_SET(TXPC_TXPC_SELCOUNT_RESET) | \ - TXPC_TXPC_ATBSEL_SET(TXPC_TXPC_ATBSEL_RESET)) -#define TXPC_TXPC_HW_MASK (32'h0) -#define TXPC_TXPC_SW_MASK (32'h0 | \ - TXPC_TXPC_SELINTPD_MASK | \ - TXPC_TXPC_TEST_MASK | \ - TXPC_TXPC_TESTGAIN_MASK | \ - TXPC_TXPC_TESTDAC_MASK | \ - TXPC_TXPC_TESTPWDPC_MASK | \ - TXPC_TXPC_CURHALF_MASK | \ - TXPC_TXPC_NEGOUT_MASK | \ - TXPC_TXPC_CLKDELAY_MASK | \ - TXPC_TXPC_SELMODREF_MASK | \ - TXPC_TXPC_SELCMOUT_MASK | \ - TXPC_TXPC_TSMODE_MASK | \ - TXPC_TXPC_N_MASK | \ - TXPC_TXPC_ON1STSYNTHON_MASK | \ - TXPC_TXPC_SELINIT_MASK | \ - TXPC_TXPC_SELCOUNT_MASK | \ - TXPC_TXPC_ATBSEL_MASK) - -#define TXPC_MISC_ADDRESS 'h0000004c -#define TXPC_MISC_FLIPBMODE_MSB 31 -#define TXPC_MISC_FLIPBMODE_LSB 31 -#define TXPC_MISC_FLIPBMODE_MASK 'h80000000 -#define TXPC_MISC_FLIPBMODE_GET(x) (((x) & TXPC_MISC_FLIPBMODE_MASK) >> TXPC_MISC_FLIPBMODE_LSB) -#define TXPC_MISC_FLIPBMODE_SET(x) (((32'd0 | (x)) << TXPC_MISC_FLIPBMODE_LSB) & TXPC_MISC_FLIPBMODE_MASK) -#define TXPC_MISC_FLIPBMODE_RESET 1'h0 -#define TXPC_MISC_LEVEL_MSB 30 -#define TXPC_MISC_LEVEL_LSB 29 -#define TXPC_MISC_LEVEL_MASK 'h60000000 -#define TXPC_MISC_LEVEL_GET(x) (((x) & TXPC_MISC_LEVEL_MASK) >> TXPC_MISC_LEVEL_LSB) -#define TXPC_MISC_LEVEL_SET(x) (((32'd0 | (x)) << TXPC_MISC_LEVEL_LSB) & TXPC_MISC_LEVEL_MASK) -#define TXPC_MISC_LEVEL_RESET 2'h0 -#define TXPC_MISC_LDO_TEST_MODE_MSB 28 -#define TXPC_MISC_LDO_TEST_MODE_LSB 28 -#define TXPC_MISC_LDO_TEST_MODE_MASK 'h10000000 -#define TXPC_MISC_LDO_TEST_MODE_GET(x) (((x) & TXPC_MISC_LDO_TEST_MODE_MASK) >> TXPC_MISC_LDO_TEST_MODE_LSB) -#define TXPC_MISC_LDO_TEST_MODE_SET(x) (((32'd0 | (x)) << TXPC_MISC_LDO_TEST_MODE_LSB) & TXPC_MISC_LDO_TEST_MODE_MASK) -#define TXPC_MISC_LDO_TEST_MODE_RESET 1'h0 -#define TXPC_MISC_NOTCXODET_MSB 27 -#define TXPC_MISC_NOTCXODET_LSB 27 -#define TXPC_MISC_NOTCXODET_MASK 'h08000000 -#define TXPC_MISC_NOTCXODET_GET(x) (((x) & TXPC_MISC_NOTCXODET_MASK) >> TXPC_MISC_NOTCXODET_LSB) -#define TXPC_MISC_NOTCXODET_SET(x) (((32'd0 | (x)) << TXPC_MISC_NOTCXODET_LSB) & TXPC_MISC_NOTCXODET_MASK) -#define TXPC_MISC_NOTCXODET_RESET 1'h0 -#define TXPC_MISC_PWDCLKIND_MSB 26 -#define TXPC_MISC_PWDCLKIND_LSB 26 -#define TXPC_MISC_PWDCLKIND_MASK 'h04000000 -#define TXPC_MISC_PWDCLKIND_GET(x) (((x) & TXPC_MISC_PWDCLKIND_MASK) >> TXPC_MISC_PWDCLKIND_LSB) -#define TXPC_MISC_PWDCLKIND_SET(x) (((32'd0 | (x)) << TXPC_MISC_PWDCLKIND_LSB) & TXPC_MISC_PWDCLKIND_MASK) -#define TXPC_MISC_PWDCLKIND_RESET 1'h0 -#define TXPC_MISC_PWDXINPAD_MSB 25 -#define TXPC_MISC_PWDXINPAD_LSB 25 -#define TXPC_MISC_PWDXINPAD_MASK 'h02000000 -#define TXPC_MISC_PWDXINPAD_GET(x) (((x) & TXPC_MISC_PWDXINPAD_MASK) >> TXPC_MISC_PWDXINPAD_LSB) -#define TXPC_MISC_PWDXINPAD_SET(x) (((32'd0 | (x)) << TXPC_MISC_PWDXINPAD_LSB) & TXPC_MISC_PWDXINPAD_MASK) -#define TXPC_MISC_PWDXINPAD_RESET 1'h0 -#define TXPC_MISC_LOCALBIAS_MSB 24 -#define TXPC_MISC_LOCALBIAS_LSB 24 -#define TXPC_MISC_LOCALBIAS_MASK 'h01000000 -#define TXPC_MISC_LOCALBIAS_GET(x) (((x) & TXPC_MISC_LOCALBIAS_MASK) >> TXPC_MISC_LOCALBIAS_LSB) -#define TXPC_MISC_LOCALBIAS_SET(x) (((32'd0 | (x)) << TXPC_MISC_LOCALBIAS_LSB) & TXPC_MISC_LOCALBIAS_MASK) -#define TXPC_MISC_LOCALBIAS_RESET 1'h1 -#define TXPC_MISC_LOCALBIAS2X_MSB 23 -#define TXPC_MISC_LOCALBIAS2X_LSB 23 -#define TXPC_MISC_LOCALBIAS2X_MASK 'h00800000 -#define TXPC_MISC_LOCALBIAS2X_GET(x) (((x) & TXPC_MISC_LOCALBIAS2X_MASK) >> TXPC_MISC_LOCALBIAS2X_LSB) -#define TXPC_MISC_LOCALBIAS2X_SET(x) (((32'd0 | (x)) << TXPC_MISC_LOCALBIAS2X_LSB) & TXPC_MISC_LOCALBIAS2X_MASK) -#define TXPC_MISC_LOCALBIAS2X_RESET 1'h0 -#define TXPC_MISC_SELTSP_MSB 22 -#define TXPC_MISC_SELTSP_LSB 22 -#define TXPC_MISC_SELTSP_MASK 'h00400000 -#define TXPC_MISC_SELTSP_GET(x) (((x) & TXPC_MISC_SELTSP_MASK) >> TXPC_MISC_SELTSP_LSB) -#define TXPC_MISC_SELTSP_SET(x) (((32'd0 | (x)) << TXPC_MISC_SELTSP_LSB) & TXPC_MISC_SELTSP_MASK) -#define TXPC_MISC_SELTSP_RESET 1'h0 -#define TXPC_MISC_SELTSN_MSB 21 -#define TXPC_MISC_SELTSN_LSB 21 -#define TXPC_MISC_SELTSN_MASK 'h00200000 -#define TXPC_MISC_SELTSN_GET(x) (((x) & TXPC_MISC_SELTSN_MASK) >> TXPC_MISC_SELTSN_LSB) -#define TXPC_MISC_SELTSN_SET(x) (((32'd0 | (x)) << TXPC_MISC_SELTSN_LSB) & TXPC_MISC_SELTSN_MASK) -#define TXPC_MISC_SELTSN_RESET 1'h0 -#define TXPC_MISC_SPARE_A_MSB 20 -#define TXPC_MISC_SPARE_A_LSB 18 -#define TXPC_MISC_SPARE_A_MASK 'h001c0000 -#define TXPC_MISC_SPARE_A_GET(x) (((x) & TXPC_MISC_SPARE_A_MASK) >> TXPC_MISC_SPARE_A_LSB) -#define TXPC_MISC_SPARE_A_SET(x) (((32'd0 | (x)) << TXPC_MISC_SPARE_A_LSB) & TXPC_MISC_SPARE_A_MASK) -#define TXPC_MISC_SPARE_A_RESET 3'h0 -#define TXPC_MISC_DECOUT_MSB 17 -#define TXPC_MISC_DECOUT_LSB 8 -#define TXPC_MISC_DECOUT_MASK 'h0003ff00 -#define TXPC_MISC_DECOUT_GET(x) (((x) & TXPC_MISC_DECOUT_MASK) >> TXPC_MISC_DECOUT_LSB) -#define TXPC_MISC_DECOUT_SET(x) (((32'd0 | (x)) << TXPC_MISC_DECOUT_LSB) & TXPC_MISC_DECOUT_MASK) -#define TXPC_MISC_DECOUT_RESET 10'h0 -#define TXPC_MISC_XTALDIV_MSB 7 -#define TXPC_MISC_XTALDIV_LSB 6 -#define TXPC_MISC_XTALDIV_MASK 'h000000c0 -#define TXPC_MISC_XTALDIV_GET(x) (((x) & TXPC_MISC_XTALDIV_MASK) >> TXPC_MISC_XTALDIV_LSB) -#define TXPC_MISC_XTALDIV_SET(x) (((32'd0 | (x)) << TXPC_MISC_XTALDIV_LSB) & TXPC_MISC_XTALDIV_MASK) -#define TXPC_MISC_XTALDIV_RESET 2'h0 -#define TXPC_MISC_SPARE_MSB 5 -#define TXPC_MISC_SPARE_LSB 0 -#define TXPC_MISC_SPARE_MASK 'h0000003f -#define TXPC_MISC_SPARE_GET(x) (((x) & TXPC_MISC_SPARE_MASK) >> TXPC_MISC_SPARE_LSB) -#define TXPC_MISC_SPARE_SET(x) (((32'd0 | (x)) << TXPC_MISC_SPARE_LSB) & TXPC_MISC_SPARE_MASK) -#define TXPC_MISC_SPARE_RESET 6'h0 -#define TXPC_MISC_RESET (32'h0 | \ - TXPC_MISC_FLIPBMODE_SET(TXPC_MISC_FLIPBMODE_RESET) | \ - TXPC_MISC_LEVEL_SET(TXPC_MISC_LEVEL_RESET) | \ - TXPC_MISC_LDO_TEST_MODE_SET(TXPC_MISC_LDO_TEST_MODE_RESET) | \ - TXPC_MISC_NOTCXODET_SET(TXPC_MISC_NOTCXODET_RESET) | \ - TXPC_MISC_PWDCLKIND_SET(TXPC_MISC_PWDCLKIND_RESET) | \ - TXPC_MISC_PWDXINPAD_SET(TXPC_MISC_PWDXINPAD_RESET) | \ - TXPC_MISC_LOCALBIAS_SET(TXPC_MISC_LOCALBIAS_RESET) | \ - TXPC_MISC_LOCALBIAS2X_SET(TXPC_MISC_LOCALBIAS2X_RESET) | \ - TXPC_MISC_SELTSP_SET(TXPC_MISC_SELTSP_RESET) | \ - TXPC_MISC_SELTSN_SET(TXPC_MISC_SELTSN_RESET) | \ - TXPC_MISC_SPARE_A_SET(TXPC_MISC_SPARE_A_RESET) | \ - TXPC_MISC_DECOUT_SET(TXPC_MISC_DECOUT_RESET) | \ - TXPC_MISC_XTALDIV_SET(TXPC_MISC_XTALDIV_RESET) | \ - TXPC_MISC_SPARE_SET(TXPC_MISC_SPARE_RESET)) -#define TXPC_MISC_HW_MASK (32'h0 | \ - TXPC_MISC_DECOUT_MASK) -#define TXPC_MISC_SW_MASK (32'h0 | \ - TXPC_MISC_FLIPBMODE_MASK | \ - TXPC_MISC_LEVEL_MASK | \ - TXPC_MISC_LDO_TEST_MODE_MASK | \ - TXPC_MISC_NOTCXODET_MASK | \ - TXPC_MISC_PWDCLKIND_MASK | \ - TXPC_MISC_PWDXINPAD_MASK | \ - TXPC_MISC_LOCALBIAS_MASK | \ - TXPC_MISC_LOCALBIAS2X_MASK | \ - TXPC_MISC_SELTSP_MASK | \ - TXPC_MISC_SELTSN_MASK | \ - TXPC_MISC_SPARE_A_MASK | \ - TXPC_MISC_DECOUT_MASK | \ - TXPC_MISC_XTALDIV_MASK | \ - TXPC_MISC_SPARE_MASK) - -#define RXTXBB_RXTXBB1_ADDRESS 'h00000050 -#define RXTXBB_RXTXBB1_SPARE_MSB 31 -#define RXTXBB_RXTXBB1_SPARE_LSB 19 -#define RXTXBB_RXTXBB1_SPARE_MASK 'hfff80000 -#define RXTXBB_RXTXBB1_SPARE_GET(x) (((x) & RXTXBB_RXTXBB1_SPARE_MASK) >> RXTXBB_RXTXBB1_SPARE_LSB) -#define RXTXBB_RXTXBB1_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_SPARE_LSB) & RXTXBB_RXTXBB1_SPARE_MASK) -#define RXTXBB_RXTXBB1_SPARE_RESET 13'h0 -#define RXTXBB_RXTXBB1_FNOTCH_MSB 18 -#define RXTXBB_RXTXBB1_FNOTCH_LSB 17 -#define RXTXBB_RXTXBB1_FNOTCH_MASK 'h00060000 -#define RXTXBB_RXTXBB1_FNOTCH_GET(x) (((x) & RXTXBB_RXTXBB1_FNOTCH_MASK) >> RXTXBB_RXTXBB1_FNOTCH_LSB) -#define RXTXBB_RXTXBB1_FNOTCH_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_FNOTCH_LSB) & RXTXBB_RXTXBB1_FNOTCH_MASK) -#define RXTXBB_RXTXBB1_FNOTCH_RESET 2'h0 -#define RXTXBB_RXTXBB1_SEL_ATB_MSB 16 -#define RXTXBB_RXTXBB1_SEL_ATB_LSB 9 -#define RXTXBB_RXTXBB1_SEL_ATB_MASK 'h0001fe00 -#define RXTXBB_RXTXBB1_SEL_ATB_GET(x) (((x) & RXTXBB_RXTXBB1_SEL_ATB_MASK) >> RXTXBB_RXTXBB1_SEL_ATB_LSB) -#define RXTXBB_RXTXBB1_SEL_ATB_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_SEL_ATB_LSB) & RXTXBB_RXTXBB1_SEL_ATB_MASK) -#define RXTXBB_RXTXBB1_SEL_ATB_RESET 8'h0 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_LSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MASK 'h00000100 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_GET(x) (((x) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) >> RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDV2I_MSB 7 -#define RXTXBB_RXTXBB1_PDV2I_LSB 7 -#define RXTXBB_RXTXBB1_PDV2I_MASK 'h00000080 -#define RXTXBB_RXTXBB1_PDV2I_GET(x) (((x) & RXTXBB_RXTXBB1_PDV2I_MASK) >> RXTXBB_RXTXBB1_PDV2I_LSB) -#define RXTXBB_RXTXBB1_PDV2I_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDV2I_LSB) & RXTXBB_RXTXBB1_PDV2I_MASK) -#define RXTXBB_RXTXBB1_PDV2I_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDI2V_MSB 6 -#define RXTXBB_RXTXBB1_PDI2V_LSB 6 -#define RXTXBB_RXTXBB1_PDI2V_MASK 'h00000040 -#define RXTXBB_RXTXBB1_PDI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDI2V_MASK) >> RXTXBB_RXTXBB1_PDI2V_LSB) -#define RXTXBB_RXTXBB1_PDI2V_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDI2V_LSB) & RXTXBB_RXTXBB1_PDI2V_MASK) -#define RXTXBB_RXTXBB1_PDI2V_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDRXTXBB_MSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_LSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_MASK 'h00000020 -#define RXTXBB_RXTXBB1_PDRXTXBB_GET(x) (((x) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) >> RXTXBB_RXTXBB1_PDRXTXBB_LSB) -#define RXTXBB_RXTXBB1_PDRXTXBB_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDRXTXBB_LSB) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) -#define RXTXBB_RXTXBB1_PDRXTXBB_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK 'h00000010 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK 'h00000008 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_LSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MASK 'h00000004 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) >> RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDLOQ_MSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_LSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_MASK 'h00000002 -#define RXTXBB_RXTXBB1_PDLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDLOQ_MASK) >> RXTXBB_RXTXBB1_PDLOQ_LSB) -#define RXTXBB_RXTXBB1_PDLOQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDLOQ_LSB) & RXTXBB_RXTXBB1_PDLOQ_MASK) -#define RXTXBB_RXTXBB1_PDLOQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDHIQ_MSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_LSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_MASK 'h00000001 -#define RXTXBB_RXTXBB1_PDHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDHIQ_MASK) >> RXTXBB_RXTXBB1_PDHIQ_LSB) -#define RXTXBB_RXTXBB1_PDHIQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDHIQ_LSB) & RXTXBB_RXTXBB1_PDHIQ_MASK) -#define RXTXBB_RXTXBB1_PDHIQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_RESET (32'h0 | \ - RXTXBB_RXTXBB1_SPARE_SET(RXTXBB_RXTXBB1_SPARE_RESET) | \ - RXTXBB_RXTXBB1_FNOTCH_SET(RXTXBB_RXTXBB1_FNOTCH_RESET) | \ - RXTXBB_RXTXBB1_SEL_ATB_SET(RXTXBB_RXTXBB1_SEL_ATB_RESET) | \ - RXTXBB_RXTXBB1_PDDACINTERFACE_SET(RXTXBB_RXTXBB1_PDDACINTERFACE_RESET) | \ - RXTXBB_RXTXBB1_PDV2I_SET(RXTXBB_RXTXBB1_PDV2I_RESET) | \ - RXTXBB_RXTXBB1_PDI2V_SET(RXTXBB_RXTXBB1_PDI2V_RESET) | \ - RXTXBB_RXTXBB1_PDRXTXBB_SET(RXTXBB_RXTXBB1_PDRXTXBB_RESET) | \ - RXTXBB_RXTXBB1_PDOFFSETLOQ_SET(RXTXBB_RXTXBB1_PDOFFSETLOQ_RESET) | \ - RXTXBB_RXTXBB1_PDOFFSETHIQ_SET(RXTXBB_RXTXBB1_PDOFFSETHIQ_RESET) | \ - RXTXBB_RXTXBB1_PDOFFSETI2V_SET(RXTXBB_RXTXBB1_PDOFFSETI2V_RESET) | \ - RXTXBB_RXTXBB1_PDLOQ_SET(RXTXBB_RXTXBB1_PDLOQ_RESET) | \ - RXTXBB_RXTXBB1_PDHIQ_SET(RXTXBB_RXTXBB1_PDHIQ_RESET)) -#define RXTXBB_RXTXBB1_HW_MASK (32'h0) -#define RXTXBB_RXTXBB1_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB1_SPARE_MASK | \ - RXTXBB_RXTXBB1_FNOTCH_MASK | \ - RXTXBB_RXTXBB1_SEL_ATB_MASK | \ - RXTXBB_RXTXBB1_PDDACINTERFACE_MASK | \ - RXTXBB_RXTXBB1_PDV2I_MASK | \ - RXTXBB_RXTXBB1_PDI2V_MASK | \ - RXTXBB_RXTXBB1_PDRXTXBB_MASK | \ - RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK | \ - RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK | \ - RXTXBB_RXTXBB1_PDOFFSETI2V_MASK | \ - RXTXBB_RXTXBB1_PDLOQ_MASK | \ - RXTXBB_RXTXBB1_PDHIQ_MASK) - -#define RXTXBB_RXTXBB2_ADDRESS 'h00000054 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MSB 31 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB 29 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK 'he0000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_RESET 3'h6 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MSB 28 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB 26 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK 'h1c000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_RESET 3'h6 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MSB 25 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB 23 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK 'h03800000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_RESET 3'h6 -#define RXTXBB_RXTXBB2_SPARE_MSB 22 -#define RXTXBB_RXTXBB2_SPARE_LSB 21 -#define RXTXBB_RXTXBB2_SPARE_MASK 'h00600000 -#define RXTXBB_RXTXBB2_SPARE_GET(x) (((x) & RXTXBB_RXTXBB2_SPARE_MASK) >> RXTXBB_RXTXBB2_SPARE_LSB) -#define RXTXBB_RXTXBB2_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SPARE_LSB) & RXTXBB_RXTXBB2_SPARE_MASK) -#define RXTXBB_RXTXBB2_SPARE_RESET 2'h0 -#define RXTXBB_RXTXBB2_SHORTBUFFER_MSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_LSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_MASK 'h00100000 -#define RXTXBB_RXTXBB2_SHORTBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) >> RXTXBB_RXTXBB2_SHORTBUFFER_LSB) -#define RXTXBB_RXTXBB2_SHORTBUFFER_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SHORTBUFFER_LSB) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) -#define RXTXBB_RXTXBB2_SHORTBUFFER_RESET 1'h0 -#define RXTXBB_RXTXBB2_SELBUFFER_MSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_LSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_MASK 'h00080000 -#define RXTXBB_RXTXBB2_SELBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SELBUFFER_MASK) >> RXTXBB_RXTXBB2_SELBUFFER_LSB) -#define RXTXBB_RXTXBB2_SELBUFFER_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SELBUFFER_LSB) & RXTXBB_RXTXBB2_SELBUFFER_MASK) -#define RXTXBB_RXTXBB2_SELBUFFER_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK 'h00040000 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK 'h00020000 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK 'h00010000 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK 'h00008000 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_CMSEL_MSB 14 -#define RXTXBB_RXTXBB2_CMSEL_LSB 13 -#define RXTXBB_RXTXBB2_CMSEL_MASK 'h00006000 -#define RXTXBB_RXTXBB2_CMSEL_GET(x) (((x) & RXTXBB_RXTXBB2_CMSEL_MASK) >> RXTXBB_RXTXBB2_CMSEL_LSB) -#define RXTXBB_RXTXBB2_CMSEL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_CMSEL_LSB) & RXTXBB_RXTXBB2_CMSEL_MASK) -#define RXTXBB_RXTXBB2_CMSEL_RESET 2'h1 -#define RXTXBB_RXTXBB2_FILTERFC_MSB 12 -#define RXTXBB_RXTXBB2_FILTERFC_LSB 8 -#define RXTXBB_RXTXBB2_FILTERFC_MASK 'h00001f00 -#define RXTXBB_RXTXBB2_FILTERFC_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERFC_MASK) >> RXTXBB_RXTXBB2_FILTERFC_LSB) -#define RXTXBB_RXTXBB2_FILTERFC_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_FILTERFC_LSB) & RXTXBB_RXTXBB2_FILTERFC_MASK) -#define RXTXBB_RXTXBB2_FILTERFC_RESET 5'h10 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK 'h00000080 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_GET(x) (((x) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) >> RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_RESET 1'h0 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK 'h00000040 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) >> RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK 'h00000020 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK 'h00000010 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_RESET 1'h1 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK 'h00000008 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK 'h00000004 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK 'h00000002 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_RESET 1'h1 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK 'h00000001 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_GET(x) (((x) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) >> RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_RESET 1'h0 -#define RXTXBB_RXTXBB2_RESET (32'h0 | \ - RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_SET(RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_RESET) | \ - RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_SET(RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_RESET) | \ - RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_SET(RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_RESET) | \ - RXTXBB_RXTXBB2_SPARE_SET(RXTXBB_RXTXBB2_SPARE_RESET) | \ - RXTXBB_RXTXBB2_SHORTBUFFER_SET(RXTXBB_RXTXBB2_SHORTBUFFER_RESET) | \ - RXTXBB_RXTXBB2_SELBUFFER_SET(RXTXBB_RXTXBB2_SELBUFFER_RESET) | \ - RXTXBB_RXTXBB2_SEL_DAC_TEST_SET(RXTXBB_RXTXBB2_SEL_DAC_TEST_RESET) | \ - RXTXBB_RXTXBB2_SEL_LOQ_TEST_SET(RXTXBB_RXTXBB2_SEL_LOQ_TEST_RESET) | \ - RXTXBB_RXTXBB2_SEL_HIQ_TEST_SET(RXTXBB_RXTXBB2_SEL_HIQ_TEST_RESET) | \ - RXTXBB_RXTXBB2_SEL_I2V_TEST_SET(RXTXBB_RXTXBB2_SEL_I2V_TEST_RESET) | \ - RXTXBB_RXTXBB2_CMSEL_SET(RXTXBB_RXTXBB2_CMSEL_RESET) | \ - RXTXBB_RXTXBB2_FILTERFC_SET(RXTXBB_RXTXBB2_FILTERFC_RESET) | \ - RXTXBB_RXTXBB2_LOCALFILTERTUNING_SET(RXTXBB_RXTXBB2_LOCALFILTERTUNING_RESET) | \ - RXTXBB_RXTXBB2_FILTERDOUBLEBW_SET(RXTXBB_RXTXBB2_FILTERDOUBLEBW_RESET) | \ - RXTXBB_RXTXBB2_PATH2HIQ_EN_SET(RXTXBB_RXTXBB2_PATH2HIQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH1HIQ_EN_SET(RXTXBB_RXTXBB2_PATH1HIQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH3LOQ_EN_SET(RXTXBB_RXTXBB2_PATH3LOQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH2LOQ_EN_SET(RXTXBB_RXTXBB2_PATH2LOQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH1LOQ_EN_SET(RXTXBB_RXTXBB2_PATH1LOQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH_OVERRIDE_SET(RXTXBB_RXTXBB2_PATH_OVERRIDE_RESET)) -#define RXTXBB_RXTXBB2_HW_MASK (32'h0 | \ - RXTXBB_RXTXBB2_FILTERFC_MASK) -#define RXTXBB_RXTXBB2_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK | \ - RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK | \ - RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK | \ - RXTXBB_RXTXBB2_SPARE_MASK | \ - RXTXBB_RXTXBB2_SHORTBUFFER_MASK | \ - RXTXBB_RXTXBB2_SELBUFFER_MASK | \ - RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK | \ - RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK | \ - RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK | \ - RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK | \ - RXTXBB_RXTXBB2_CMSEL_MASK | \ - RXTXBB_RXTXBB2_FILTERFC_MASK | \ - RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK | \ - RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK | \ - RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) - -#define RXTXBB_RXTXBB3_ADDRESS 'h00000058 -#define RXTXBB_RXTXBB3_SPARE_MSB 31 -#define RXTXBB_RXTXBB3_SPARE_LSB 27 -#define RXTXBB_RXTXBB3_SPARE_MASK 'hf8000000 -#define RXTXBB_RXTXBB3_SPARE_GET(x) (((x) & RXTXBB_RXTXBB3_SPARE_MASK) >> RXTXBB_RXTXBB3_SPARE_LSB) -#define RXTXBB_RXTXBB3_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_SPARE_LSB) & RXTXBB_RXTXBB3_SPARE_MASK) -#define RXTXBB_RXTXBB3_SPARE_RESET 5'h0 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MSB 26 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB 24 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK 'h07000000 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MSB 23 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB 21 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK 'h00e00000 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MSB 20 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB 18 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK 'h001c0000 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MSB 17 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB 15 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK 'h00038000 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MSB 14 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB 12 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK 'h00007000 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MSB 11 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB 9 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK 'h00000e00 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MSB 8 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB 6 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK 'h000001c0 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MSB 5 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB 3 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK 'h00000038 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) >> RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_RESET 3'h2 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MSB 2 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB 0 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK 'h00000007 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_RESET (32'h0 | \ - RXTXBB_RXTXBB3_SPARE_SET(RXTXBB_RXTXBB3_SPARE_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_SET(RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_SET(RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_RESET)) -#define RXTXBB_RXTXBB3_HW_MASK (32'h0) -#define RXTXBB_RXTXBB3_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB3_SPARE_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) - -#define RXTXBB_RXTXBB4_ADDRESS 'h0000005c -#define RXTXBB_RXTXBB4_SPARE_MSB 31 -#define RXTXBB_RXTXBB4_SPARE_LSB 31 -#define RXTXBB_RXTXBB4_SPARE_MASK 'h80000000 -#define RXTXBB_RXTXBB4_SPARE_GET(x) (((x) & RXTXBB_RXTXBB4_SPARE_MASK) >> RXTXBB_RXTXBB4_SPARE_LSB) -#define RXTXBB_RXTXBB4_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_SPARE_LSB) & RXTXBB_RXTXBB4_SPARE_MASK) -#define RXTXBB_RXTXBB4_SPARE_RESET 1'h0 -#define RXTXBB_RXTXBB4_LOCALOFFSET_MSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_LSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_MASK 'h40000000 -#define RXTXBB_RXTXBB4_LOCALOFFSET_GET(x) (((x) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) >> RXTXBB_RXTXBB4_LOCALOFFSET_LSB) -#define RXTXBB_RXTXBB4_LOCALOFFSET_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_LOCALOFFSET_LSB) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) -#define RXTXBB_RXTXBB4_LOCALOFFSET_RESET 1'h0 -#define RXTXBB_RXTXBB4_OFSTCORRHII_MSB 29 -#define RXTXBB_RXTXBB4_OFSTCORRHII_LSB 25 -#define RXTXBB_RXTXBB4_OFSTCORRHII_MASK 'h3e000000 -#define RXTXBB_RXTXBB4_OFSTCORRHII_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHII_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHII_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRHII_LSB) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHII_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MSB 24 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB 20 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK 'h01f00000 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MSB 19 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_LSB 15 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MASK 'h000f8000 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MSB 14 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB 10 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK 'h00007c00 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MSB 9 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB 5 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK 'h000003e0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MSB 4 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB 0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK 'h0000001f -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_RESET 5'h10 -#define RXTXBB_RXTXBB4_RESET (32'h0 | \ - RXTXBB_RXTXBB4_SPARE_SET(RXTXBB_RXTXBB4_SPARE_RESET) | \ - RXTXBB_RXTXBB4_LOCALOFFSET_SET(RXTXBB_RXTXBB4_LOCALOFFSET_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRHII_SET(RXTXBB_RXTXBB4_OFSTCORRHII_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRHIQ_SET(RXTXBB_RXTXBB4_OFSTCORRHIQ_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRLOI_SET(RXTXBB_RXTXBB4_OFSTCORRLOI_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRLOQ_SET(RXTXBB_RXTXBB4_OFSTCORRLOQ_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRI2VI_SET(RXTXBB_RXTXBB4_OFSTCORRI2VI_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRI2VQ_SET(RXTXBB_RXTXBB4_OFSTCORRI2VQ_RESET)) -#define RXTXBB_RXTXBB4_HW_MASK (32'h0 | \ - RXTXBB_RXTXBB4_OFSTCORRHII_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) -#define RXTXBB_RXTXBB4_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB4_SPARE_MASK | \ - RXTXBB_RXTXBB4_LOCALOFFSET_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRHII_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) - -#define ADDAC_ADDAC1_ADDRESS 'h00000060 -#define ADDAC_ADDAC1_PLL_SVREG_MSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_LSB 31 -#define ADDAC_ADDAC1_PLL_SVREG_MASK 'h80000000 -#define ADDAC_ADDAC1_PLL_SVREG_GET(x) (((x) & ADDAC_ADDAC1_PLL_SVREG_MASK) >> ADDAC_ADDAC1_PLL_SVREG_LSB) -#define ADDAC_ADDAC1_PLL_SVREG_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_SVREG_LSB) & ADDAC_ADDAC1_PLL_SVREG_MASK) -#define ADDAC_ADDAC1_PLL_SVREG_RESET 1'h1 -#define ADDAC_ADDAC1_PLL_SCLAMP_MSB 30 -#define ADDAC_ADDAC1_PLL_SCLAMP_LSB 28 -#define ADDAC_ADDAC1_PLL_SCLAMP_MASK 'h70000000 -#define ADDAC_ADDAC1_PLL_SCLAMP_GET(x) (((x) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) >> ADDAC_ADDAC1_PLL_SCLAMP_LSB) -#define ADDAC_ADDAC1_PLL_SCLAMP_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_SCLAMP_LSB) & ADDAC_ADDAC1_PLL_SCLAMP_MASK) -#define ADDAC_ADDAC1_PLL_SCLAMP_RESET 3'h5 -#define ADDAC_ADDAC1_PLL_ATB_MSB 27 -#define ADDAC_ADDAC1_PLL_ATB_LSB 26 -#define ADDAC_ADDAC1_PLL_ATB_MASK 'h0c000000 -#define ADDAC_ADDAC1_PLL_ATB_GET(x) (((x) & ADDAC_ADDAC1_PLL_ATB_MASK) >> ADDAC_ADDAC1_PLL_ATB_LSB) -#define ADDAC_ADDAC1_PLL_ATB_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_ATB_LSB) & ADDAC_ADDAC1_PLL_ATB_MASK) -#define ADDAC_ADDAC1_PLL_ATB_RESET 2'h0 -#define ADDAC_ADDAC1_PLL_ICP_MSB 25 -#define ADDAC_ADDAC1_PLL_ICP_LSB 23 -#define ADDAC_ADDAC1_PLL_ICP_MASK 'h03800000 -#define ADDAC_ADDAC1_PLL_ICP_GET(x) (((x) & ADDAC_ADDAC1_PLL_ICP_MASK) >> ADDAC_ADDAC1_PLL_ICP_LSB) -#define ADDAC_ADDAC1_PLL_ICP_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_ICP_LSB) & ADDAC_ADDAC1_PLL_ICP_MASK) -#define ADDAC_ADDAC1_PLL_ICP_RESET 3'h0 -#define ADDAC_ADDAC1_PLL_FILTER_MSB 22 -#define ADDAC_ADDAC1_PLL_FILTER_LSB 15 -#define ADDAC_ADDAC1_PLL_FILTER_MASK 'h007f8000 -#define ADDAC_ADDAC1_PLL_FILTER_GET(x) (((x) & ADDAC_ADDAC1_PLL_FILTER_MASK) >> ADDAC_ADDAC1_PLL_FILTER_LSB) -#define ADDAC_ADDAC1_PLL_FILTER_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PLL_FILTER_LSB) & ADDAC_ADDAC1_PLL_FILTER_MASK) -#define ADDAC_ADDAC1_PLL_FILTER_RESET 8'h35 -#define ADDAC_ADDAC1_PWDPLL_MSB 14 -#define ADDAC_ADDAC1_PWDPLL_LSB 14 -#define ADDAC_ADDAC1_PWDPLL_MASK 'h00004000 -#define ADDAC_ADDAC1_PWDPLL_GET(x) (((x) & ADDAC_ADDAC1_PWDPLL_MASK) >> ADDAC_ADDAC1_PWDPLL_LSB) -#define ADDAC_ADDAC1_PWDPLL_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PWDPLL_LSB) & ADDAC_ADDAC1_PWDPLL_MASK) -#define ADDAC_ADDAC1_PWDPLL_RESET 1'h0 -#define ADDAC_ADDAC1_PWDADC_MSB 13 -#define ADDAC_ADDAC1_PWDADC_LSB 13 -#define ADDAC_ADDAC1_PWDADC_MASK 'h00002000 -#define ADDAC_ADDAC1_PWDADC_GET(x) (((x) & ADDAC_ADDAC1_PWDADC_MASK) >> ADDAC_ADDAC1_PWDADC_LSB) -#define ADDAC_ADDAC1_PWDADC_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PWDADC_LSB) & ADDAC_ADDAC1_PWDADC_MASK) -#define ADDAC_ADDAC1_PWDADC_RESET 1'h0 -#define ADDAC_ADDAC1_PWDDAC_MSB 12 -#define ADDAC_ADDAC1_PWDDAC_LSB 12 -#define ADDAC_ADDAC1_PWDDAC_MASK 'h00001000 -#define ADDAC_ADDAC1_PWDDAC_GET(x) (((x) & ADDAC_ADDAC1_PWDDAC_MASK) >> ADDAC_ADDAC1_PWDDAC_LSB) -#define ADDAC_ADDAC1_PWDDAC_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_PWDDAC_LSB) & ADDAC_ADDAC1_PWDDAC_MASK) -#define ADDAC_ADDAC1_PWDDAC_RESET 1'h0 -#define ADDAC_ADDAC1_FORCEMSBLOW_MSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_LSB 11 -#define ADDAC_ADDAC1_FORCEMSBLOW_MASK 'h00000800 -#define ADDAC_ADDAC1_FORCEMSBLOW_GET(x) (((x) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) >> ADDAC_ADDAC1_FORCEMSBLOW_LSB) -#define ADDAC_ADDAC1_FORCEMSBLOW_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_FORCEMSBLOW_LSB) & ADDAC_ADDAC1_FORCEMSBLOW_MASK) -#define ADDAC_ADDAC1_FORCEMSBLOW_RESET 1'h0 -#define ADDAC_ADDAC1_SELMANPWDS_MSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_LSB 10 -#define ADDAC_ADDAC1_SELMANPWDS_MASK 'h00000400 -#define ADDAC_ADDAC1_SELMANPWDS_GET(x) (((x) & ADDAC_ADDAC1_SELMANPWDS_MASK) >> ADDAC_ADDAC1_SELMANPWDS_LSB) -#define ADDAC_ADDAC1_SELMANPWDS_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_SELMANPWDS_LSB) & ADDAC_ADDAC1_SELMANPWDS_MASK) -#define ADDAC_ADDAC1_SELMANPWDS_RESET 1'h0 -#define ADDAC_ADDAC1_INV_CLK160_ADC_MSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_LSB 9 -#define ADDAC_ADDAC1_INV_CLK160_ADC_MASK 'h00000200 -#define ADDAC_ADDAC1_INV_CLK160_ADC_GET(x) (((x) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) >> ADDAC_ADDAC1_INV_CLK160_ADC_LSB) -#define ADDAC_ADDAC1_INV_CLK160_ADC_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_INV_CLK160_ADC_LSB) & ADDAC_ADDAC1_INV_CLK160_ADC_MASK) -#define ADDAC_ADDAC1_INV_CLK160_ADC_RESET 1'h0 -#define ADDAC_ADDAC1_CM_SEL_MSB 8 -#define ADDAC_ADDAC1_CM_SEL_LSB 7 -#define ADDAC_ADDAC1_CM_SEL_MASK 'h00000180 -#define ADDAC_ADDAC1_CM_SEL_GET(x) (((x) & ADDAC_ADDAC1_CM_SEL_MASK) >> ADDAC_ADDAC1_CM_SEL_LSB) -#define ADDAC_ADDAC1_CM_SEL_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_CM_SEL_LSB) & ADDAC_ADDAC1_CM_SEL_MASK) -#define ADDAC_ADDAC1_CM_SEL_RESET 2'h1 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_LSB 6 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_MASK 'h00000040 -#define ADDAC_ADDAC1_DISABLE_DAC_REG_GET(x) (((x) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) >> ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_DISABLE_DAC_REG_LSB) & ADDAC_ADDAC1_DISABLE_DAC_REG_MASK) -#define ADDAC_ADDAC1_DISABLE_DAC_REG_RESET 1'h0 -#define ADDAC_ADDAC1_SPARE_MSB 5 -#define ADDAC_ADDAC1_SPARE_LSB 0 -#define ADDAC_ADDAC1_SPARE_MASK 'h0000003f -#define ADDAC_ADDAC1_SPARE_GET(x) (((x) & ADDAC_ADDAC1_SPARE_MASK) >> ADDAC_ADDAC1_SPARE_LSB) -#define ADDAC_ADDAC1_SPARE_SET(x) (((32'd0 | (x)) << ADDAC_ADDAC1_SPARE_LSB) & ADDAC_ADDAC1_SPARE_MASK) -#define ADDAC_ADDAC1_SPARE_RESET 6'h0 -#define ADDAC_ADDAC1_RESET (32'h0 | \ - ADDAC_ADDAC1_PLL_SVREG_SET(ADDAC_ADDAC1_PLL_SVREG_RESET) | \ - ADDAC_ADDAC1_PLL_SCLAMP_SET(ADDAC_ADDAC1_PLL_SCLAMP_RESET) | \ - ADDAC_ADDAC1_PLL_ATB_SET(ADDAC_ADDAC1_PLL_ATB_RESET) | \ - ADDAC_ADDAC1_PLL_ICP_SET(ADDAC_ADDAC1_PLL_ICP_RESET) | \ - ADDAC_ADDAC1_PLL_FILTER_SET(ADDAC_ADDAC1_PLL_FILTER_RESET) | \ - ADDAC_ADDAC1_PWDPLL_SET(ADDAC_ADDAC1_PWDPLL_RESET) | \ - ADDAC_ADDAC1_PWDADC_SET(ADDAC_ADDAC1_PWDADC_RESET) | \ - ADDAC_ADDAC1_PWDDAC_SET(ADDAC_ADDAC1_PWDDAC_RESET) | \ - ADDAC_ADDAC1_FORCEMSBLOW_SET(ADDAC_ADDAC1_FORCEMSBLOW_RESET) | \ - ADDAC_ADDAC1_SELMANPWDS_SET(ADDAC_ADDAC1_SELMANPWDS_RESET) | \ - ADDAC_ADDAC1_INV_CLK160_ADC_SET(ADDAC_ADDAC1_INV_CLK160_ADC_RESET) | \ - ADDAC_ADDAC1_CM_SEL_SET(ADDAC_ADDAC1_CM_SEL_RESET) | \ - ADDAC_ADDAC1_DISABLE_DAC_REG_SET(ADDAC_ADDAC1_DISABLE_DAC_REG_RESET) | \ - ADDAC_ADDAC1_SPARE_SET(ADDAC_ADDAC1_SPARE_RESET)) -#define ADDAC_ADDAC1_HW_MASK (32'h0) -#define ADDAC_ADDAC1_SW_MASK (32'h0 | \ - ADDAC_ADDAC1_PLL_SVREG_MASK | \ - ADDAC_ADDAC1_PLL_SCLAMP_MASK | \ - ADDAC_ADDAC1_PLL_ATB_MASK | \ - ADDAC_ADDAC1_PLL_ICP_MASK | \ - ADDAC_ADDAC1_PLL_FILTER_MASK | \ - ADDAC_ADDAC1_PWDPLL_MASK | \ - ADDAC_ADDAC1_PWDADC_MASK | \ - ADDAC_ADDAC1_PWDDAC_MASK | \ - ADDAC_ADDAC1_FORCEMSBLOW_MASK | \ - ADDAC_ADDAC1_SELMANPWDS_MASK | \ - ADDAC_ADDAC1_INV_CLK160_ADC_MASK | \ - ADDAC_ADDAC1_CM_SEL_MASK | \ - ADDAC_ADDAC1_DISABLE_DAC_REG_MASK | \ - ADDAC_ADDAC1_SPARE_MASK) - -#define ANALOG_REG_ADDRESS_MSB 6 - -#endif /* _ANALOG_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/apb_map.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/apb_map.h deleted file mode 100644 index f3bf6d6cc82b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/apb_map.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _APB_MAP_H_ -#define _APB_MAP_H_ - -#define RTC_BASE_ADDRESS 0x00004000 -#define VMC_BASE_ADDRESS 0x00008000 -#define UART_BASE_ADDRESS 0x0000c000 -#define SI_BASE_ADDRESS 0x00010000 -#define GPIO_BASE_ADDRESS 0x00014000 -#define MBOX_BASE_ADDRESS 0x00018000 -#define ANALOG_INTF_BASE_ADDRESS 0x0001c000 -#define MAC_BASE_ADDRESS 0x00020000 - -#endif /* _APB_MAP_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/apb_map.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/apb_map.vrh deleted file mode 100644 index 078e022f9d74..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/apb_map.vrh +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _APB_MAP_VRH_ -#define _APB_MAP_VRH_ - -#define RTC_BASE_ADDRESS 'h00004000 -#define RTC_END_ADDRESS 'h000041ff -#define VMC_BASE_ADDRESS 'h00008000 -#define VMC_END_ADDRESS 'h000083ff -#define UART_BASE_ADDRESS 'h0000c000 -#define UART_END_ADDRESS 'h0000c03f -#define SI_BASE_ADDRESS 'h00010000 -#define SI_END_ADDRESS 'h0001001f -#define GPIO_BASE_ADDRESS 'h00014000 -#define GPIO_END_ADDRESS 'h000140ff -#define MBOX_BASE_ADDRESS 'h00018000 -#define MBOX_END_ADDRESS 'h0001bfff -#define ANALOG_INTF_BASE_ADDRESS 'h0001c000 -#define ANALOG_INTF_END_ADDRESS 'h0001c0ff -#define MAC_BASE_ADDRESS 'h00020000 -#define MAC_END_ADDRESS 'h0002ffff - -#endif /* _APB_MAP_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/bias_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/bias_reg.h deleted file mode 100644 index f8ca13152959..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/bias_reg.h +++ /dev/null @@ -1,293 +0,0 @@ -#ifndef _BIAS_REG_REG_H_ -#define _BIAS_REG_REG_H_ - -#define BIAS_BIAS_SEL_ADDRESS 0x00000000 -#define BIAS_BIAS_SEL_OFFSET 0x00000000 -#define BIAS_BIAS_SEL_PADON_MSB 31 -#define BIAS_BIAS_SEL_PADON_LSB 31 -#define BIAS_BIAS_SEL_PADON_MASK 0x80000000 -#define BIAS_BIAS_SEL_PADON_GET(x) (((x) & BIAS_BIAS_SEL_PADON_MASK) >> BIAS_BIAS_SEL_PADON_LSB) -#define BIAS_BIAS_SEL_PADON_SET(x) (((x) << BIAS_BIAS_SEL_PADON_LSB) & BIAS_BIAS_SEL_PADON_MASK) -#define BIAS_BIAS_SEL_SEL_BIAS_MSB 30 -#define BIAS_BIAS_SEL_SEL_BIAS_LSB 25 -#define BIAS_BIAS_SEL_SEL_BIAS_MASK 0x7e000000 -#define BIAS_BIAS_SEL_SEL_BIAS_GET(x) (((x) & BIAS_BIAS_SEL_SEL_BIAS_MASK) >> BIAS_BIAS_SEL_SEL_BIAS_LSB) -#define BIAS_BIAS_SEL_SEL_BIAS_SET(x) (((x) << BIAS_BIAS_SEL_SEL_BIAS_LSB) & BIAS_BIAS_SEL_SEL_BIAS_MASK) -#define BIAS_BIAS_SEL_SEL_SPARE_MSB 24 -#define BIAS_BIAS_SEL_SEL_SPARE_LSB 21 -#define BIAS_BIAS_SEL_SEL_SPARE_MASK 0x01e00000 -#define BIAS_BIAS_SEL_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SEL_SPARE_SET(x) (((x) << BIAS_BIAS_SEL_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_SPARE_MSB 20 -#define BIAS_BIAS_SEL_SPARE_LSB 20 -#define BIAS_BIAS_SEL_SPARE_MASK 0x00100000 -#define BIAS_BIAS_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SPARE_SET(x) (((x) << BIAS_BIAS_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MSB 19 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB 17 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK 0x000e0000 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK 0x00010000 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_SET(x) (((x) << BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK 0x00008000 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_SET(x) (((x) << BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK 0x00004000 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_LSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MASK 0x00002000 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) >> BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MSB 12 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB 10 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK 0x00001c00 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MSB 9 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_LSB 7 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MASK 0x00000380 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) >> BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MSB 6 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_LSB 4 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MASK 0x00000070 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) >> BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MSB 3 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_LSB 1 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MASK 0x0000000e -#define BIAS_BIAS_SEL_PWD_ICTXPC25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) >> BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) -#define BIAS_BIAS_SEL_PWD_ICLDO25_MSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_LSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_MASK 0x00000001 -#define BIAS_BIAS_SEL_PWD_ICLDO25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) >> BIAS_BIAS_SEL_PWD_ICLDO25_LSB) -#define BIAS_BIAS_SEL_PWD_ICLDO25_SET(x) (((x) << BIAS_BIAS_SEL_PWD_ICLDO25_LSB) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) - -#define BIAS_BIAS1_ADDRESS 0x00000004 -#define BIAS_BIAS1_OFFSET 0x00000004 -#define BIAS_BIAS1_PWD_ICDAC2BB25_MSB 31 -#define BIAS_BIAS1_PWD_ICDAC2BB25_LSB 29 -#define BIAS_BIAS1_PWD_ICDAC2BB25_MASK 0xe0000000 -#define BIAS_BIAS1_PWD_ICDAC2BB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) >> BIAS_BIAS1_PWD_ICDAC2BB25_LSB) -#define BIAS_BIAS1_PWD_ICDAC2BB25_SET(x) (((x) << BIAS_BIAS1_PWD_ICDAC2BB25_LSB) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) -#define BIAS_BIAS1_PWD_IC2GVGM25_MSB 28 -#define BIAS_BIAS1_PWD_IC2GVGM25_LSB 26 -#define BIAS_BIAS1_PWD_IC2GVGM25_MASK 0x1c000000 -#define BIAS_BIAS1_PWD_IC2GVGM25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) >> BIAS_BIAS1_PWD_IC2GVGM25_LSB) -#define BIAS_BIAS1_PWD_IC2GVGM25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GVGM25_LSB) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) -#define BIAS_BIAS1_PWD_IC2GRFFE25_MSB 25 -#define BIAS_BIAS1_PWD_IC2GRFFE25_LSB 23 -#define BIAS_BIAS1_PWD_IC2GRFFE25_MASK 0x03800000 -#define BIAS_BIAS1_PWD_IC2GRFFE25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) >> BIAS_BIAS1_PWD_IC2GRFFE25_LSB) -#define BIAS_BIAS1_PWD_IC2GRFFE25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GRFFE25_LSB) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) -#define BIAS_BIAS1_PWD_IC2GLOREG25_MSB 22 -#define BIAS_BIAS1_PWD_IC2GLOREG25_LSB 20 -#define BIAS_BIAS1_PWD_IC2GLOREG25_MASK 0x00700000 -#define BIAS_BIAS1_PWD_IC2GLOREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLOREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLOREG25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GLOREG25_LSB) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MSB 19 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_LSB 17 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MASK 0x000e0000 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_SET(x) (((x) << BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORB25_MSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_LSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_MASK 0x00010000 -#define BIAS_BIAS1_PWD_ICDETECTORB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORB25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORB25_SET(x) (((x) << BIAS_BIAS1_PWD_ICDETECTORB25_LSB) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORA25_MSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_LSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_MASK 0x00008000 -#define BIAS_BIAS1_PWD_ICDETECTORA25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORA25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORA25_SET(x) (((x) << BIAS_BIAS1_PWD_ICDETECTORA25_LSB) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) -#define BIAS_BIAS1_PWD_IC5GRXRF25_MSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_LSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_MASK 0x00004000 -#define BIAS_BIAS1_PWD_IC5GRXRF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) >> BIAS_BIAS1_PWD_IC5GRXRF25_LSB) -#define BIAS_BIAS1_PWD_IC5GRXRF25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GRXRF25_LSB) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXPA25_MSB 13 -#define BIAS_BIAS1_PWD_IC5GTXPA25_LSB 11 -#define BIAS_BIAS1_PWD_IC5GTXPA25_MASK 0x00003800 -#define BIAS_BIAS1_PWD_IC5GTXPA25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) >> BIAS_BIAS1_PWD_IC5GTXPA25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXPA25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GTXPA25_LSB) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MSB 10 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_LSB 8 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MASK 0x00000700 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) >> BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) -#define BIAS_BIAS1_PWD_IC5GQB25_MSB 7 -#define BIAS_BIAS1_PWD_IC5GQB25_LSB 5 -#define BIAS_BIAS1_PWD_IC5GQB25_MASK 0x000000e0 -#define BIAS_BIAS1_PWD_IC5GQB25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GQB25_MASK) >> BIAS_BIAS1_PWD_IC5GQB25_LSB) -#define BIAS_BIAS1_PWD_IC5GQB25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GQB25_LSB) & BIAS_BIAS1_PWD_IC5GQB25_MASK) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MSB 4 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_LSB 2 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MASK 0x0000001c -#define BIAS_BIAS1_PWD_IC5GMIXQ25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) >> BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_SET(x) (((x) << BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) -#define BIAS_BIAS1_SPARE_MSB 1 -#define BIAS_BIAS1_SPARE_LSB 0 -#define BIAS_BIAS1_SPARE_MASK 0x00000003 -#define BIAS_BIAS1_SPARE_GET(x) (((x) & BIAS_BIAS1_SPARE_MASK) >> BIAS_BIAS1_SPARE_LSB) -#define BIAS_BIAS1_SPARE_SET(x) (((x) << BIAS_BIAS1_SPARE_LSB) & BIAS_BIAS1_SPARE_MASK) - -#define BIAS_BIAS2_ADDRESS 0x00000008 -#define BIAS_BIAS2_OFFSET 0x00000008 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MSB 31 -#define BIAS_BIAS2_PWD_IC5GMIXI25_LSB 29 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MASK 0xe0000000 -#define BIAS_BIAS2_PWD_IC5GMIXI25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) >> BIAS_BIAS2_PWD_IC5GMIXI25_LSB) -#define BIAS_BIAS2_PWD_IC5GMIXI25_SET(x) (((x) << BIAS_BIAS2_PWD_IC5GMIXI25_LSB) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) -#define BIAS_BIAS2_PWD_IC5GDIV25_MSB 28 -#define BIAS_BIAS2_PWD_IC5GDIV25_LSB 26 -#define BIAS_BIAS2_PWD_IC5GDIV25_MASK 0x1c000000 -#define BIAS_BIAS2_PWD_IC5GDIV25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) >> BIAS_BIAS2_PWD_IC5GDIV25_LSB) -#define BIAS_BIAS2_PWD_IC5GDIV25_SET(x) (((x) << BIAS_BIAS2_PWD_IC5GDIV25_LSB) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) -#define BIAS_BIAS2_PWD_IC5GLOREG25_MSB 25 -#define BIAS_BIAS2_PWD_IC5GLOREG25_LSB 23 -#define BIAS_BIAS2_PWD_IC5GLOREG25_MASK 0x03800000 -#define BIAS_BIAS2_PWD_IC5GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) >> BIAS_BIAS2_PWD_IC5GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IC5GLOREG25_SET(x) (((x) << BIAS_BIAS2_PWD_IC5GLOREG25_LSB) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IRPLL25_MSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_LSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_MASK 0x00400000 -#define BIAS_BIAS2_PWD_IRPLL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRPLL25_MASK) >> BIAS_BIAS2_PWD_IRPLL25_LSB) -#define BIAS_BIAS2_PWD_IRPLL25_SET(x) (((x) << BIAS_BIAS2_PWD_IRPLL25_LSB) & BIAS_BIAS2_PWD_IRPLL25_MASK) -#define BIAS_BIAS2_PWD_IRXTAL25_MSB 21 -#define BIAS_BIAS2_PWD_IRXTAL25_LSB 19 -#define BIAS_BIAS2_PWD_IRXTAL25_MASK 0x00380000 -#define BIAS_BIAS2_PWD_IRXTAL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRXTAL25_MASK) >> BIAS_BIAS2_PWD_IRXTAL25_LSB) -#define BIAS_BIAS2_PWD_IRXTAL25_SET(x) (((x) << BIAS_BIAS2_PWD_IRXTAL25_LSB) & BIAS_BIAS2_PWD_IRXTAL25_MASK) -#define BIAS_BIAS2_PWD_IRTSENS25_MSB 18 -#define BIAS_BIAS2_PWD_IRTSENS25_LSB 16 -#define BIAS_BIAS2_PWD_IRTSENS25_MASK 0x00070000 -#define BIAS_BIAS2_PWD_IRTSENS25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTSENS25_MASK) >> BIAS_BIAS2_PWD_IRTSENS25_LSB) -#define BIAS_BIAS2_PWD_IRTSENS25_SET(x) (((x) << BIAS_BIAS2_PWD_IRTSENS25_LSB) & BIAS_BIAS2_PWD_IRTSENS25_MASK) -#define BIAS_BIAS2_PWD_IRTXPC25_MSB 15 -#define BIAS_BIAS2_PWD_IRTXPC25_LSB 13 -#define BIAS_BIAS2_PWD_IRTXPC25_MASK 0x0000e000 -#define BIAS_BIAS2_PWD_IRTXPC25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTXPC25_MASK) >> BIAS_BIAS2_PWD_IRTXPC25_LSB) -#define BIAS_BIAS2_PWD_IRTXPC25_SET(x) (((x) << BIAS_BIAS2_PWD_IRTXPC25_LSB) & BIAS_BIAS2_PWD_IRTXPC25_MASK) -#define BIAS_BIAS2_PWD_IRLDO25_MSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_LSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_MASK 0x00001000 -#define BIAS_BIAS2_PWD_IRLDO25_GET(x) (((x) & BIAS_BIAS2_PWD_IRLDO25_MASK) >> BIAS_BIAS2_PWD_IRLDO25_LSB) -#define BIAS_BIAS2_PWD_IRLDO25_SET(x) (((x) << BIAS_BIAS2_PWD_IRLDO25_LSB) & BIAS_BIAS2_PWD_IRLDO25_MASK) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MSB 11 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_LSB 9 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MASK 0x00000e00 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) >> BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_SET(x) (((x) << BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) -#define BIAS_BIAS2_PWD_IR2GLOREG25_MSB 8 -#define BIAS_BIAS2_PWD_IR2GLOREG25_LSB 6 -#define BIAS_BIAS2_PWD_IR2GLOREG25_MASK 0x000001c0 -#define BIAS_BIAS2_PWD_IR2GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLOREG25_SET(x) (((x) << BIAS_BIAS2_PWD_IR2GLOREG25_LSB) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MSB 5 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_LSB 3 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MASK 0x00000038 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_SET(x) (((x) << BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MSB 2 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB 0 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK 0x00000007 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_GET(x) (((x) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) >> BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_SET(x) (((x) << BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) - -#define BIAS_BIAS3_ADDRESS 0x0000000c -#define BIAS_BIAS3_OFFSET 0x0000000c -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MSB 31 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_LSB 29 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MASK 0xe0000000 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) >> BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) -#define BIAS_BIAS3_PWD_IR5GTXMIX25_SET(x) (((x) << BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) -#define BIAS_BIAS3_PWD_IR5GAGC25_MSB 28 -#define BIAS_BIAS3_PWD_IR5GAGC25_LSB 26 -#define BIAS_BIAS3_PWD_IR5GAGC25_MASK 0x1c000000 -#define BIAS_BIAS3_PWD_IR5GAGC25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) >> BIAS_BIAS3_PWD_IR5GAGC25_LSB) -#define BIAS_BIAS3_PWD_IR5GAGC25_SET(x) (((x) << BIAS_BIAS3_PWD_IR5GAGC25_LSB) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) -#define BIAS_BIAS3_PWD_ICDAC50_MSB 25 -#define BIAS_BIAS3_PWD_ICDAC50_LSB 23 -#define BIAS_BIAS3_PWD_ICDAC50_MASK 0x03800000 -#define BIAS_BIAS3_PWD_ICDAC50_GET(x) (((x) & BIAS_BIAS3_PWD_ICDAC50_MASK) >> BIAS_BIAS3_PWD_ICDAC50_LSB) -#define BIAS_BIAS3_PWD_ICDAC50_SET(x) (((x) << BIAS_BIAS3_PWD_ICDAC50_LSB) & BIAS_BIAS3_PWD_ICDAC50_MASK) -#define BIAS_BIAS3_PWD_ICSYNTH50_MSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_LSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_MASK 0x00400000 -#define BIAS_BIAS3_PWD_ICSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) >> BIAS_BIAS3_PWD_ICSYNTH50_LSB) -#define BIAS_BIAS3_PWD_ICSYNTH50_SET(x) (((x) << BIAS_BIAS3_PWD_ICSYNTH50_LSB) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) -#define BIAS_BIAS3_PWD_ICBB50_MSB 21 -#define BIAS_BIAS3_PWD_ICBB50_LSB 21 -#define BIAS_BIAS3_PWD_ICBB50_MASK 0x00200000 -#define BIAS_BIAS3_PWD_ICBB50_GET(x) (((x) & BIAS_BIAS3_PWD_ICBB50_MASK) >> BIAS_BIAS3_PWD_ICBB50_LSB) -#define BIAS_BIAS3_PWD_ICBB50_SET(x) (((x) << BIAS_BIAS3_PWD_ICBB50_LSB) & BIAS_BIAS3_PWD_ICBB50_MASK) -#define BIAS_BIAS3_PWD_IC2GDIV50_MSB 20 -#define BIAS_BIAS3_PWD_IC2GDIV50_LSB 18 -#define BIAS_BIAS3_PWD_IC2GDIV50_MASK 0x001c0000 -#define BIAS_BIAS3_PWD_IC2GDIV50_GET(x) (((x) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) >> BIAS_BIAS3_PWD_IC2GDIV50_LSB) -#define BIAS_BIAS3_PWD_IC2GDIV50_SET(x) (((x) << BIAS_BIAS3_PWD_IC2GDIV50_LSB) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) -#define BIAS_BIAS3_PWD_IRSYNTH50_MSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_LSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_MASK 0x00020000 -#define BIAS_BIAS3_PWD_IRSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) >> BIAS_BIAS3_PWD_IRSYNTH50_LSB) -#define BIAS_BIAS3_PWD_IRSYNTH50_SET(x) (((x) << BIAS_BIAS3_PWD_IRSYNTH50_LSB) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) -#define BIAS_BIAS3_PWD_IRBB50_MSB 16 -#define BIAS_BIAS3_PWD_IRBB50_LSB 16 -#define BIAS_BIAS3_PWD_IRBB50_MASK 0x00010000 -#define BIAS_BIAS3_PWD_IRBB50_GET(x) (((x) & BIAS_BIAS3_PWD_IRBB50_MASK) >> BIAS_BIAS3_PWD_IRBB50_LSB) -#define BIAS_BIAS3_PWD_IRBB50_SET(x) (((x) << BIAS_BIAS3_PWD_IRBB50_LSB) & BIAS_BIAS3_PWD_IRBB50_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE1_MSB 15 -#define BIAS_BIAS3_PWD_IC25SPARE1_LSB 13 -#define BIAS_BIAS3_PWD_IC25SPARE1_MASK 0x0000e000 -#define BIAS_BIAS3_PWD_IC25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) >> BIAS_BIAS3_PWD_IC25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE1_SET(x) (((x) << BIAS_BIAS3_PWD_IC25SPARE1_LSB) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE2_MSB 12 -#define BIAS_BIAS3_PWD_IC25SPARE2_LSB 10 -#define BIAS_BIAS3_PWD_IC25SPARE2_MASK 0x00001c00 -#define BIAS_BIAS3_PWD_IC25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) >> BIAS_BIAS3_PWD_IC25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE2_SET(x) (((x) << BIAS_BIAS3_PWD_IC25SPARE2_LSB) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE1_MSB 9 -#define BIAS_BIAS3_PWD_IR25SPARE1_LSB 7 -#define BIAS_BIAS3_PWD_IR25SPARE1_MASK 0x00000380 -#define BIAS_BIAS3_PWD_IR25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) >> BIAS_BIAS3_PWD_IR25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE1_SET(x) (((x) << BIAS_BIAS3_PWD_IR25SPARE1_LSB) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE2_MSB 6 -#define BIAS_BIAS3_PWD_IR25SPARE2_LSB 4 -#define BIAS_BIAS3_PWD_IR25SPARE2_MASK 0x00000070 -#define BIAS_BIAS3_PWD_IR25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) >> BIAS_BIAS3_PWD_IR25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE2_SET(x) (((x) << BIAS_BIAS3_PWD_IR25SPARE2_LSB) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) -#define BIAS_BIAS3_PWD_ICDACREG12P5_MSB 3 -#define BIAS_BIAS3_PWD_ICDACREG12P5_LSB 1 -#define BIAS_BIAS3_PWD_ICDACREG12P5_MASK 0x0000000e -#define BIAS_BIAS3_PWD_ICDACREG12P5_GET(x) (((x) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) >> BIAS_BIAS3_PWD_ICDACREG12P5_LSB) -#define BIAS_BIAS3_PWD_ICDACREG12P5_SET(x) (((x) << BIAS_BIAS3_PWD_ICDACREG12P5_LSB) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) -#define BIAS_BIAS3_SPARE_MSB 0 -#define BIAS_BIAS3_SPARE_LSB 0 -#define BIAS_BIAS3_SPARE_MASK 0x00000001 -#define BIAS_BIAS3_SPARE_GET(x) (((x) & BIAS_BIAS3_SPARE_MASK) >> BIAS_BIAS3_SPARE_LSB) -#define BIAS_BIAS3_SPARE_SET(x) (((x) << BIAS_BIAS3_SPARE_LSB) & BIAS_BIAS3_SPARE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct bias_reg_reg_s { - volatile unsigned int bias_bias_sel; - volatile unsigned int bias_bias1; - volatile unsigned int bias_bias2; - volatile unsigned int bias_bias3; -} bias_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _BIAS_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/bias_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/bias_reg.vrh deleted file mode 100644 index c5cc4fe95445..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/bias_reg.vrh +++ /dev/null @@ -1,450 +0,0 @@ -#ifndef _BIAS_REG_VRH_ -#define _BIAS_REG_VRH_ - -#define BIAS_BIAS_SEL_ADDRESS 'h00000000 -#define BIAS_BIAS_SEL_PADON_MSB 31 -#define BIAS_BIAS_SEL_PADON_LSB 31 -#define BIAS_BIAS_SEL_PADON_MASK 'h80000000 -#define BIAS_BIAS_SEL_PADON_GET(x) (((x) & BIAS_BIAS_SEL_PADON_MASK) >> BIAS_BIAS_SEL_PADON_LSB) -#define BIAS_BIAS_SEL_PADON_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PADON_LSB) & BIAS_BIAS_SEL_PADON_MASK) -#define BIAS_BIAS_SEL_PADON_RESET 1'h0 -#define BIAS_BIAS_SEL_SEL_BIAS_MSB 30 -#define BIAS_BIAS_SEL_SEL_BIAS_LSB 25 -#define BIAS_BIAS_SEL_SEL_BIAS_MASK 'h7e000000 -#define BIAS_BIAS_SEL_SEL_BIAS_GET(x) (((x) & BIAS_BIAS_SEL_SEL_BIAS_MASK) >> BIAS_BIAS_SEL_SEL_BIAS_LSB) -#define BIAS_BIAS_SEL_SEL_BIAS_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_SEL_BIAS_LSB) & BIAS_BIAS_SEL_SEL_BIAS_MASK) -#define BIAS_BIAS_SEL_SEL_BIAS_RESET 6'h0 -#define BIAS_BIAS_SEL_SEL_SPARE_MSB 24 -#define BIAS_BIAS_SEL_SEL_SPARE_LSB 21 -#define BIAS_BIAS_SEL_SEL_SPARE_MASK 'h01e00000 -#define BIAS_BIAS_SEL_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SEL_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_SEL_SPARE_RESET 4'h0 -#define BIAS_BIAS_SEL_SPARE_MSB 20 -#define BIAS_BIAS_SEL_SPARE_LSB 20 -#define BIAS_BIAS_SEL_SPARE_MASK 'h00100000 -#define BIAS_BIAS_SEL_SPARE_GET(x) (((x) & BIAS_BIAS_SEL_SPARE_MASK) >> BIAS_BIAS_SEL_SPARE_LSB) -#define BIAS_BIAS_SEL_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_SPARE_LSB) & BIAS_BIAS_SEL_SPARE_MASK) -#define BIAS_BIAS_SEL_SPARE_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MSB 19 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB 17 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK 'h000e0000 -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_RESET 3'h6 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB 16 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK 'h00010000 -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_LSB) & BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB 15 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK 'h00008000 -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_GET(x) (((x) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) >> BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_LSB) & BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK) -#define BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB 14 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK 'h00004000 -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_LSB 13 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_MASK 'h00002000 -#define BIAS_BIAS_SEL_PWD_ICCPLL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) >> BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICCPLL25_LSB) & BIAS_BIAS_SEL_PWD_ICCPLL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCPLL25_RESET 1'h0 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MSB 12 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB 10 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK 'h00001c00 -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) >> BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_LSB) & BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MSB 9 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_LSB 7 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_MASK 'h00000380 -#define BIAS_BIAS_SEL_PWD_ICXTAL25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) >> BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICXTAL25_LSB) & BIAS_BIAS_SEL_PWD_ICXTAL25_MASK) -#define BIAS_BIAS_SEL_PWD_ICXTAL25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MSB 6 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_LSB 4 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_MASK 'h00000070 -#define BIAS_BIAS_SEL_PWD_ICTSENS25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) >> BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICTSENS25_LSB) & BIAS_BIAS_SEL_PWD_ICTSENS25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTSENS25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MSB 3 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_LSB 1 -#define BIAS_BIAS_SEL_PWD_ICTXPC25_MASK 'h0000000e -#define BIAS_BIAS_SEL_PWD_ICTXPC25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) >> BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICTXPC25_LSB) & BIAS_BIAS_SEL_PWD_ICTXPC25_MASK) -#define BIAS_BIAS_SEL_PWD_ICTXPC25_RESET 3'h3 -#define BIAS_BIAS_SEL_PWD_ICLDO25_MSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_LSB 0 -#define BIAS_BIAS_SEL_PWD_ICLDO25_MASK 'h00000001 -#define BIAS_BIAS_SEL_PWD_ICLDO25_GET(x) (((x) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) >> BIAS_BIAS_SEL_PWD_ICLDO25_LSB) -#define BIAS_BIAS_SEL_PWD_ICLDO25_SET(x) (((32'd0 | (x)) << BIAS_BIAS_SEL_PWD_ICLDO25_LSB) & BIAS_BIAS_SEL_PWD_ICLDO25_MASK) -#define BIAS_BIAS_SEL_PWD_ICLDO25_RESET 1'h0 -#define BIAS_BIAS_SEL_RESET (32'h0 | \ - BIAS_BIAS_SEL_PADON_SET(BIAS_BIAS_SEL_PADON_RESET) | \ - BIAS_BIAS_SEL_SEL_BIAS_SET(BIAS_BIAS_SEL_SEL_BIAS_RESET) | \ - BIAS_BIAS_SEL_SEL_SPARE_SET(BIAS_BIAS_SEL_SEL_SPARE_RESET) | \ - BIAS_BIAS_SEL_SPARE_SET(BIAS_BIAS_SEL_SPARE_RESET) | \ - BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_SET(BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_RESET) | \ - BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_SET(BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_RESET) | \ - BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_SET(BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_RESET) | \ - BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_SET(BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICCPLL25_SET(BIAS_BIAS_SEL_PWD_ICCPLL25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_SET(BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICXTAL25_SET(BIAS_BIAS_SEL_PWD_ICXTAL25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICTSENS25_SET(BIAS_BIAS_SEL_PWD_ICTSENS25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICTXPC25_SET(BIAS_BIAS_SEL_PWD_ICTXPC25_RESET) | \ - BIAS_BIAS_SEL_PWD_ICLDO25_SET(BIAS_BIAS_SEL_PWD_ICLDO25_RESET)) -#define BIAS_BIAS_SEL_HW_MASK (32'h0) -#define BIAS_BIAS_SEL_SW_MASK (32'h0 | \ - BIAS_BIAS_SEL_PADON_MASK | \ - BIAS_BIAS_SEL_SEL_BIAS_MASK | \ - BIAS_BIAS_SEL_SEL_SPARE_MASK | \ - BIAS_BIAS_SEL_SPARE_MASK | \ - BIAS_BIAS_SEL_PWD_ICREFBUFBIAS12P5_MASK | \ - BIAS_BIAS_SEL_PWD_IRDACREGREF12P5_MASK | \ - BIAS_BIAS_SEL_PWD_IRREFMASTERBIAS12P5_MASK | \ - BIAS_BIAS_SEL_PWD_ICREFOPAMPBIAS25_MASK | \ - BIAS_BIAS_SEL_PWD_ICCPLL25_MASK | \ - BIAS_BIAS_SEL_PWD_ICCOMPBIAS25_MASK | \ - BIAS_BIAS_SEL_PWD_ICXTAL25_MASK | \ - BIAS_BIAS_SEL_PWD_ICTSENS25_MASK | \ - BIAS_BIAS_SEL_PWD_ICTXPC25_MASK | \ - BIAS_BIAS_SEL_PWD_ICLDO25_MASK) - -#define BIAS_BIAS1_ADDRESS 'h00000004 -#define BIAS_BIAS1_PWD_ICDAC2BB25_MSB 31 -#define BIAS_BIAS1_PWD_ICDAC2BB25_LSB 29 -#define BIAS_BIAS1_PWD_ICDAC2BB25_MASK 'he0000000 -#define BIAS_BIAS1_PWD_ICDAC2BB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) >> BIAS_BIAS1_PWD_ICDAC2BB25_LSB) -#define BIAS_BIAS1_PWD_ICDAC2BB25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_ICDAC2BB25_LSB) & BIAS_BIAS1_PWD_ICDAC2BB25_MASK) -#define BIAS_BIAS1_PWD_ICDAC2BB25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GVGM25_MSB 28 -#define BIAS_BIAS1_PWD_IC2GVGM25_LSB 26 -#define BIAS_BIAS1_PWD_IC2GVGM25_MASK 'h1c000000 -#define BIAS_BIAS1_PWD_IC2GVGM25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) >> BIAS_BIAS1_PWD_IC2GVGM25_LSB) -#define BIAS_BIAS1_PWD_IC2GVGM25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GVGM25_LSB) & BIAS_BIAS1_PWD_IC2GVGM25_MASK) -#define BIAS_BIAS1_PWD_IC2GVGM25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GRFFE25_MSB 25 -#define BIAS_BIAS1_PWD_IC2GRFFE25_LSB 23 -#define BIAS_BIAS1_PWD_IC2GRFFE25_MASK 'h03800000 -#define BIAS_BIAS1_PWD_IC2GRFFE25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) >> BIAS_BIAS1_PWD_IC2GRFFE25_LSB) -#define BIAS_BIAS1_PWD_IC2GRFFE25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GRFFE25_LSB) & BIAS_BIAS1_PWD_IC2GRFFE25_MASK) -#define BIAS_BIAS1_PWD_IC2GRFFE25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GLOREG25_MSB 22 -#define BIAS_BIAS1_PWD_IC2GLOREG25_LSB 20 -#define BIAS_BIAS1_PWD_IC2GLOREG25_MASK 'h00700000 -#define BIAS_BIAS1_PWD_IC2GLOREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLOREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLOREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GLOREG25_LSB) & BIAS_BIAS1_PWD_IC2GLOREG25_MASK) -#define BIAS_BIAS1_PWD_IC2GLOREG25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MSB 19 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_LSB 17 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_MASK 'h000e0000 -#define BIAS_BIAS1_PWD_IC2GLNAREG25_GET(x) (((x) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) >> BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC2GLNAREG25_LSB) & BIAS_BIAS1_PWD_IC2GLNAREG25_MASK) -#define BIAS_BIAS1_PWD_IC2GLNAREG25_RESET 3'h3 -#define BIAS_BIAS1_PWD_ICDETECTORB25_MSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_LSB 16 -#define BIAS_BIAS1_PWD_ICDETECTORB25_MASK 'h00010000 -#define BIAS_BIAS1_PWD_ICDETECTORB25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORB25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORB25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_ICDETECTORB25_LSB) & BIAS_BIAS1_PWD_ICDETECTORB25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORB25_RESET 1'h0 -#define BIAS_BIAS1_PWD_ICDETECTORA25_MSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_LSB 15 -#define BIAS_BIAS1_PWD_ICDETECTORA25_MASK 'h00008000 -#define BIAS_BIAS1_PWD_ICDETECTORA25_GET(x) (((x) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) >> BIAS_BIAS1_PWD_ICDETECTORA25_LSB) -#define BIAS_BIAS1_PWD_ICDETECTORA25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_ICDETECTORA25_LSB) & BIAS_BIAS1_PWD_ICDETECTORA25_MASK) -#define BIAS_BIAS1_PWD_ICDETECTORA25_RESET 1'h0 -#define BIAS_BIAS1_PWD_IC5GRXRF25_MSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_LSB 14 -#define BIAS_BIAS1_PWD_IC5GRXRF25_MASK 'h00004000 -#define BIAS_BIAS1_PWD_IC5GRXRF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) >> BIAS_BIAS1_PWD_IC5GRXRF25_LSB) -#define BIAS_BIAS1_PWD_IC5GRXRF25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GRXRF25_LSB) & BIAS_BIAS1_PWD_IC5GRXRF25_MASK) -#define BIAS_BIAS1_PWD_IC5GRXRF25_RESET 1'h0 -#define BIAS_BIAS1_PWD_IC5GTXPA25_MSB 13 -#define BIAS_BIAS1_PWD_IC5GTXPA25_LSB 11 -#define BIAS_BIAS1_PWD_IC5GTXPA25_MASK 'h00003800 -#define BIAS_BIAS1_PWD_IC5GTXPA25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) >> BIAS_BIAS1_PWD_IC5GTXPA25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXPA25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GTXPA25_LSB) & BIAS_BIAS1_PWD_IC5GTXPA25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXPA25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MSB 10 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_LSB 8 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_MASK 'h00000700 -#define BIAS_BIAS1_PWD_IC5GTXBUF25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) >> BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GTXBUF25_LSB) & BIAS_BIAS1_PWD_IC5GTXBUF25_MASK) -#define BIAS_BIAS1_PWD_IC5GTXBUF25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC5GQB25_MSB 7 -#define BIAS_BIAS1_PWD_IC5GQB25_LSB 5 -#define BIAS_BIAS1_PWD_IC5GQB25_MASK 'h000000e0 -#define BIAS_BIAS1_PWD_IC5GQB25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GQB25_MASK) >> BIAS_BIAS1_PWD_IC5GQB25_LSB) -#define BIAS_BIAS1_PWD_IC5GQB25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GQB25_LSB) & BIAS_BIAS1_PWD_IC5GQB25_MASK) -#define BIAS_BIAS1_PWD_IC5GQB25_RESET 3'h3 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MSB 4 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_LSB 2 -#define BIAS_BIAS1_PWD_IC5GMIXQ25_MASK 'h0000001c -#define BIAS_BIAS1_PWD_IC5GMIXQ25_GET(x) (((x) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) >> BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_PWD_IC5GMIXQ25_LSB) & BIAS_BIAS1_PWD_IC5GMIXQ25_MASK) -#define BIAS_BIAS1_PWD_IC5GMIXQ25_RESET 3'h3 -#define BIAS_BIAS1_SPARE_MSB 1 -#define BIAS_BIAS1_SPARE_LSB 0 -#define BIAS_BIAS1_SPARE_MASK 'h00000003 -#define BIAS_BIAS1_SPARE_GET(x) (((x) & BIAS_BIAS1_SPARE_MASK) >> BIAS_BIAS1_SPARE_LSB) -#define BIAS_BIAS1_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS1_SPARE_LSB) & BIAS_BIAS1_SPARE_MASK) -#define BIAS_BIAS1_SPARE_RESET 2'h3 -#define BIAS_BIAS1_RESET (32'h0 | \ - BIAS_BIAS1_PWD_ICDAC2BB25_SET(BIAS_BIAS1_PWD_ICDAC2BB25_RESET) | \ - BIAS_BIAS1_PWD_IC2GVGM25_SET(BIAS_BIAS1_PWD_IC2GVGM25_RESET) | \ - BIAS_BIAS1_PWD_IC2GRFFE25_SET(BIAS_BIAS1_PWD_IC2GRFFE25_RESET) | \ - BIAS_BIAS1_PWD_IC2GLOREG25_SET(BIAS_BIAS1_PWD_IC2GLOREG25_RESET) | \ - BIAS_BIAS1_PWD_IC2GLNAREG25_SET(BIAS_BIAS1_PWD_IC2GLNAREG25_RESET) | \ - BIAS_BIAS1_PWD_ICDETECTORB25_SET(BIAS_BIAS1_PWD_ICDETECTORB25_RESET) | \ - BIAS_BIAS1_PWD_ICDETECTORA25_SET(BIAS_BIAS1_PWD_ICDETECTORA25_RESET) | \ - BIAS_BIAS1_PWD_IC5GRXRF25_SET(BIAS_BIAS1_PWD_IC5GRXRF25_RESET) | \ - BIAS_BIAS1_PWD_IC5GTXPA25_SET(BIAS_BIAS1_PWD_IC5GTXPA25_RESET) | \ - BIAS_BIAS1_PWD_IC5GTXBUF25_SET(BIAS_BIAS1_PWD_IC5GTXBUF25_RESET) | \ - BIAS_BIAS1_PWD_IC5GQB25_SET(BIAS_BIAS1_PWD_IC5GQB25_RESET) | \ - BIAS_BIAS1_PWD_IC5GMIXQ25_SET(BIAS_BIAS1_PWD_IC5GMIXQ25_RESET) | \ - BIAS_BIAS1_SPARE_SET(BIAS_BIAS1_SPARE_RESET)) -#define BIAS_BIAS1_HW_MASK (32'h0) -#define BIAS_BIAS1_SW_MASK (32'h0 | \ - BIAS_BIAS1_PWD_ICDAC2BB25_MASK | \ - BIAS_BIAS1_PWD_IC2GVGM25_MASK | \ - BIAS_BIAS1_PWD_IC2GRFFE25_MASK | \ - BIAS_BIAS1_PWD_IC2GLOREG25_MASK | \ - BIAS_BIAS1_PWD_IC2GLNAREG25_MASK | \ - BIAS_BIAS1_PWD_ICDETECTORB25_MASK | \ - BIAS_BIAS1_PWD_ICDETECTORA25_MASK | \ - BIAS_BIAS1_PWD_IC5GRXRF25_MASK | \ - BIAS_BIAS1_PWD_IC5GTXPA25_MASK | \ - BIAS_BIAS1_PWD_IC5GTXBUF25_MASK | \ - BIAS_BIAS1_PWD_IC5GQB25_MASK | \ - BIAS_BIAS1_PWD_IC5GMIXQ25_MASK | \ - BIAS_BIAS1_SPARE_MASK) - -#define BIAS_BIAS2_ADDRESS 'h00000008 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MSB 31 -#define BIAS_BIAS2_PWD_IC5GMIXI25_LSB 29 -#define BIAS_BIAS2_PWD_IC5GMIXI25_MASK 'he0000000 -#define BIAS_BIAS2_PWD_IC5GMIXI25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) >> BIAS_BIAS2_PWD_IC5GMIXI25_LSB) -#define BIAS_BIAS2_PWD_IC5GMIXI25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IC5GMIXI25_LSB) & BIAS_BIAS2_PWD_IC5GMIXI25_MASK) -#define BIAS_BIAS2_PWD_IC5GMIXI25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IC5GDIV25_MSB 28 -#define BIAS_BIAS2_PWD_IC5GDIV25_LSB 26 -#define BIAS_BIAS2_PWD_IC5GDIV25_MASK 'h1c000000 -#define BIAS_BIAS2_PWD_IC5GDIV25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) >> BIAS_BIAS2_PWD_IC5GDIV25_LSB) -#define BIAS_BIAS2_PWD_IC5GDIV25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IC5GDIV25_LSB) & BIAS_BIAS2_PWD_IC5GDIV25_MASK) -#define BIAS_BIAS2_PWD_IC5GDIV25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IC5GLOREG25_MSB 25 -#define BIAS_BIAS2_PWD_IC5GLOREG25_LSB 23 -#define BIAS_BIAS2_PWD_IC5GLOREG25_MASK 'h03800000 -#define BIAS_BIAS2_PWD_IC5GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) >> BIAS_BIAS2_PWD_IC5GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IC5GLOREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IC5GLOREG25_LSB) & BIAS_BIAS2_PWD_IC5GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IC5GLOREG25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRPLL25_MSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_LSB 22 -#define BIAS_BIAS2_PWD_IRPLL25_MASK 'h00400000 -#define BIAS_BIAS2_PWD_IRPLL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRPLL25_MASK) >> BIAS_BIAS2_PWD_IRPLL25_LSB) -#define BIAS_BIAS2_PWD_IRPLL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRPLL25_LSB) & BIAS_BIAS2_PWD_IRPLL25_MASK) -#define BIAS_BIAS2_PWD_IRPLL25_RESET 1'h0 -#define BIAS_BIAS2_PWD_IRXTAL25_MSB 21 -#define BIAS_BIAS2_PWD_IRXTAL25_LSB 19 -#define BIAS_BIAS2_PWD_IRXTAL25_MASK 'h00380000 -#define BIAS_BIAS2_PWD_IRXTAL25_GET(x) (((x) & BIAS_BIAS2_PWD_IRXTAL25_MASK) >> BIAS_BIAS2_PWD_IRXTAL25_LSB) -#define BIAS_BIAS2_PWD_IRXTAL25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRXTAL25_LSB) & BIAS_BIAS2_PWD_IRXTAL25_MASK) -#define BIAS_BIAS2_PWD_IRXTAL25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRTSENS25_MSB 18 -#define BIAS_BIAS2_PWD_IRTSENS25_LSB 16 -#define BIAS_BIAS2_PWD_IRTSENS25_MASK 'h00070000 -#define BIAS_BIAS2_PWD_IRTSENS25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTSENS25_MASK) >> BIAS_BIAS2_PWD_IRTSENS25_LSB) -#define BIAS_BIAS2_PWD_IRTSENS25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRTSENS25_LSB) & BIAS_BIAS2_PWD_IRTSENS25_MASK) -#define BIAS_BIAS2_PWD_IRTSENS25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRTXPC25_MSB 15 -#define BIAS_BIAS2_PWD_IRTXPC25_LSB 13 -#define BIAS_BIAS2_PWD_IRTXPC25_MASK 'h0000e000 -#define BIAS_BIAS2_PWD_IRTXPC25_GET(x) (((x) & BIAS_BIAS2_PWD_IRTXPC25_MASK) >> BIAS_BIAS2_PWD_IRTXPC25_LSB) -#define BIAS_BIAS2_PWD_IRTXPC25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRTXPC25_LSB) & BIAS_BIAS2_PWD_IRTXPC25_MASK) -#define BIAS_BIAS2_PWD_IRTXPC25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IRLDO25_MSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_LSB 12 -#define BIAS_BIAS2_PWD_IRLDO25_MASK 'h00001000 -#define BIAS_BIAS2_PWD_IRLDO25_GET(x) (((x) & BIAS_BIAS2_PWD_IRLDO25_MASK) >> BIAS_BIAS2_PWD_IRLDO25_LSB) -#define BIAS_BIAS2_PWD_IRLDO25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IRLDO25_LSB) & BIAS_BIAS2_PWD_IRLDO25_MASK) -#define BIAS_BIAS2_PWD_IRLDO25_RESET 1'h0 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MSB 11 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_LSB 9 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_MASK 'h00000e00 -#define BIAS_BIAS2_PWD_IR2GTXMIX25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) >> BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR2GTXMIX25_LSB) & BIAS_BIAS2_PWD_IR2GTXMIX25_MASK) -#define BIAS_BIAS2_PWD_IR2GTXMIX25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IR2GLOREG25_MSB 8 -#define BIAS_BIAS2_PWD_IR2GLOREG25_LSB 6 -#define BIAS_BIAS2_PWD_IR2GLOREG25_MASK 'h000001c0 -#define BIAS_BIAS2_PWD_IR2GLOREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLOREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLOREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR2GLOREG25_LSB) & BIAS_BIAS2_PWD_IR2GLOREG25_MASK) -#define BIAS_BIAS2_PWD_IR2GLOREG25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MSB 5 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_LSB 3 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_MASK 'h00000038 -#define BIAS_BIAS2_PWD_IR2GLNAREG25_GET(x) (((x) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) >> BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR2GLNAREG25_LSB) & BIAS_BIAS2_PWD_IR2GLNAREG25_MASK) -#define BIAS_BIAS2_PWD_IR2GLNAREG25_RESET 3'h3 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MSB 2 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB 0 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK 'h00000007 -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_GET(x) (((x) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) >> BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_SET(x) (((32'd0 | (x)) << BIAS_BIAS2_PWD_IR5GRFVREF2525_LSB) & BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) -#define BIAS_BIAS2_PWD_IR5GRFVREF2525_RESET 3'h3 -#define BIAS_BIAS2_RESET (32'h0 | \ - BIAS_BIAS2_PWD_IC5GMIXI25_SET(BIAS_BIAS2_PWD_IC5GMIXI25_RESET) | \ - BIAS_BIAS2_PWD_IC5GDIV25_SET(BIAS_BIAS2_PWD_IC5GDIV25_RESET) | \ - BIAS_BIAS2_PWD_IC5GLOREG25_SET(BIAS_BIAS2_PWD_IC5GLOREG25_RESET) | \ - BIAS_BIAS2_PWD_IRPLL25_SET(BIAS_BIAS2_PWD_IRPLL25_RESET) | \ - BIAS_BIAS2_PWD_IRXTAL25_SET(BIAS_BIAS2_PWD_IRXTAL25_RESET) | \ - BIAS_BIAS2_PWD_IRTSENS25_SET(BIAS_BIAS2_PWD_IRTSENS25_RESET) | \ - BIAS_BIAS2_PWD_IRTXPC25_SET(BIAS_BIAS2_PWD_IRTXPC25_RESET) | \ - BIAS_BIAS2_PWD_IRLDO25_SET(BIAS_BIAS2_PWD_IRLDO25_RESET) | \ - BIAS_BIAS2_PWD_IR2GTXMIX25_SET(BIAS_BIAS2_PWD_IR2GTXMIX25_RESET) | \ - BIAS_BIAS2_PWD_IR2GLOREG25_SET(BIAS_BIAS2_PWD_IR2GLOREG25_RESET) | \ - BIAS_BIAS2_PWD_IR2GLNAREG25_SET(BIAS_BIAS2_PWD_IR2GLNAREG25_RESET) | \ - BIAS_BIAS2_PWD_IR5GRFVREF2525_SET(BIAS_BIAS2_PWD_IR5GRFVREF2525_RESET)) -#define BIAS_BIAS2_HW_MASK (32'h0) -#define BIAS_BIAS2_SW_MASK (32'h0 | \ - BIAS_BIAS2_PWD_IC5GMIXI25_MASK | \ - BIAS_BIAS2_PWD_IC5GDIV25_MASK | \ - BIAS_BIAS2_PWD_IC5GLOREG25_MASK | \ - BIAS_BIAS2_PWD_IRPLL25_MASK | \ - BIAS_BIAS2_PWD_IRXTAL25_MASK | \ - BIAS_BIAS2_PWD_IRTSENS25_MASK | \ - BIAS_BIAS2_PWD_IRTXPC25_MASK | \ - BIAS_BIAS2_PWD_IRLDO25_MASK | \ - BIAS_BIAS2_PWD_IR2GTXMIX25_MASK | \ - BIAS_BIAS2_PWD_IR2GLOREG25_MASK | \ - BIAS_BIAS2_PWD_IR2GLNAREG25_MASK | \ - BIAS_BIAS2_PWD_IR5GRFVREF2525_MASK) - -#define BIAS_BIAS3_ADDRESS 'h0000000c -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MSB 31 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_LSB 29 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_MASK 'he0000000 -#define BIAS_BIAS3_PWD_IR5GTXMIX25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) >> BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) -#define BIAS_BIAS3_PWD_IR5GTXMIX25_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR5GTXMIX25_LSB) & BIAS_BIAS3_PWD_IR5GTXMIX25_MASK) -#define BIAS_BIAS3_PWD_IR5GTXMIX25_RESET 3'h3 -#define BIAS_BIAS3_PWD_IR5GAGC25_MSB 28 -#define BIAS_BIAS3_PWD_IR5GAGC25_LSB 26 -#define BIAS_BIAS3_PWD_IR5GAGC25_MASK 'h1c000000 -#define BIAS_BIAS3_PWD_IR5GAGC25_GET(x) (((x) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) >> BIAS_BIAS3_PWD_IR5GAGC25_LSB) -#define BIAS_BIAS3_PWD_IR5GAGC25_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR5GAGC25_LSB) & BIAS_BIAS3_PWD_IR5GAGC25_MASK) -#define BIAS_BIAS3_PWD_IR5GAGC25_RESET 3'h3 -#define BIAS_BIAS3_PWD_ICDAC50_MSB 25 -#define BIAS_BIAS3_PWD_ICDAC50_LSB 23 -#define BIAS_BIAS3_PWD_ICDAC50_MASK 'h03800000 -#define BIAS_BIAS3_PWD_ICDAC50_GET(x) (((x) & BIAS_BIAS3_PWD_ICDAC50_MASK) >> BIAS_BIAS3_PWD_ICDAC50_LSB) -#define BIAS_BIAS3_PWD_ICDAC50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICDAC50_LSB) & BIAS_BIAS3_PWD_ICDAC50_MASK) -#define BIAS_BIAS3_PWD_ICDAC50_RESET 3'h3 -#define BIAS_BIAS3_PWD_ICSYNTH50_MSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_LSB 22 -#define BIAS_BIAS3_PWD_ICSYNTH50_MASK 'h00400000 -#define BIAS_BIAS3_PWD_ICSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) >> BIAS_BIAS3_PWD_ICSYNTH50_LSB) -#define BIAS_BIAS3_PWD_ICSYNTH50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICSYNTH50_LSB) & BIAS_BIAS3_PWD_ICSYNTH50_MASK) -#define BIAS_BIAS3_PWD_ICSYNTH50_RESET 1'h0 -#define BIAS_BIAS3_PWD_ICBB50_MSB 21 -#define BIAS_BIAS3_PWD_ICBB50_LSB 21 -#define BIAS_BIAS3_PWD_ICBB50_MASK 'h00200000 -#define BIAS_BIAS3_PWD_ICBB50_GET(x) (((x) & BIAS_BIAS3_PWD_ICBB50_MASK) >> BIAS_BIAS3_PWD_ICBB50_LSB) -#define BIAS_BIAS3_PWD_ICBB50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICBB50_LSB) & BIAS_BIAS3_PWD_ICBB50_MASK) -#define BIAS_BIAS3_PWD_ICBB50_RESET 1'h0 -#define BIAS_BIAS3_PWD_IC2GDIV50_MSB 20 -#define BIAS_BIAS3_PWD_IC2GDIV50_LSB 18 -#define BIAS_BIAS3_PWD_IC2GDIV50_MASK 'h001c0000 -#define BIAS_BIAS3_PWD_IC2GDIV50_GET(x) (((x) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) >> BIAS_BIAS3_PWD_IC2GDIV50_LSB) -#define BIAS_BIAS3_PWD_IC2GDIV50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IC2GDIV50_LSB) & BIAS_BIAS3_PWD_IC2GDIV50_MASK) -#define BIAS_BIAS3_PWD_IC2GDIV50_RESET 3'h3 -#define BIAS_BIAS3_PWD_IRSYNTH50_MSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_LSB 17 -#define BIAS_BIAS3_PWD_IRSYNTH50_MASK 'h00020000 -#define BIAS_BIAS3_PWD_IRSYNTH50_GET(x) (((x) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) >> BIAS_BIAS3_PWD_IRSYNTH50_LSB) -#define BIAS_BIAS3_PWD_IRSYNTH50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IRSYNTH50_LSB) & BIAS_BIAS3_PWD_IRSYNTH50_MASK) -#define BIAS_BIAS3_PWD_IRSYNTH50_RESET 1'h0 -#define BIAS_BIAS3_PWD_IRBB50_MSB 16 -#define BIAS_BIAS3_PWD_IRBB50_LSB 16 -#define BIAS_BIAS3_PWD_IRBB50_MASK 'h00010000 -#define BIAS_BIAS3_PWD_IRBB50_GET(x) (((x) & BIAS_BIAS3_PWD_IRBB50_MASK) >> BIAS_BIAS3_PWD_IRBB50_LSB) -#define BIAS_BIAS3_PWD_IRBB50_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IRBB50_LSB) & BIAS_BIAS3_PWD_IRBB50_MASK) -#define BIAS_BIAS3_PWD_IRBB50_RESET 1'h0 -#define BIAS_BIAS3_PWD_IC25SPARE1_MSB 15 -#define BIAS_BIAS3_PWD_IC25SPARE1_LSB 13 -#define BIAS_BIAS3_PWD_IC25SPARE1_MASK 'h0000e000 -#define BIAS_BIAS3_PWD_IC25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) >> BIAS_BIAS3_PWD_IC25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE1_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IC25SPARE1_LSB) & BIAS_BIAS3_PWD_IC25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE1_RESET 3'h3 -#define BIAS_BIAS3_PWD_IC25SPARE2_MSB 12 -#define BIAS_BIAS3_PWD_IC25SPARE2_LSB 10 -#define BIAS_BIAS3_PWD_IC25SPARE2_MASK 'h00001c00 -#define BIAS_BIAS3_PWD_IC25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) >> BIAS_BIAS3_PWD_IC25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IC25SPARE2_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IC25SPARE2_LSB) & BIAS_BIAS3_PWD_IC25SPARE2_MASK) -#define BIAS_BIAS3_PWD_IC25SPARE2_RESET 3'h3 -#define BIAS_BIAS3_PWD_IR25SPARE1_MSB 9 -#define BIAS_BIAS3_PWD_IR25SPARE1_LSB 7 -#define BIAS_BIAS3_PWD_IR25SPARE1_MASK 'h00000380 -#define BIAS_BIAS3_PWD_IR25SPARE1_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) >> BIAS_BIAS3_PWD_IR25SPARE1_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE1_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR25SPARE1_LSB) & BIAS_BIAS3_PWD_IR25SPARE1_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE1_RESET 3'h3 -#define BIAS_BIAS3_PWD_IR25SPARE2_MSB 6 -#define BIAS_BIAS3_PWD_IR25SPARE2_LSB 4 -#define BIAS_BIAS3_PWD_IR25SPARE2_MASK 'h00000070 -#define BIAS_BIAS3_PWD_IR25SPARE2_GET(x) (((x) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) >> BIAS_BIAS3_PWD_IR25SPARE2_LSB) -#define BIAS_BIAS3_PWD_IR25SPARE2_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_IR25SPARE2_LSB) & BIAS_BIAS3_PWD_IR25SPARE2_MASK) -#define BIAS_BIAS3_PWD_IR25SPARE2_RESET 3'h3 -#define BIAS_BIAS3_PWD_ICDACREG12P5_MSB 3 -#define BIAS_BIAS3_PWD_ICDACREG12P5_LSB 1 -#define BIAS_BIAS3_PWD_ICDACREG12P5_MASK 'h0000000e -#define BIAS_BIAS3_PWD_ICDACREG12P5_GET(x) (((x) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) >> BIAS_BIAS3_PWD_ICDACREG12P5_LSB) -#define BIAS_BIAS3_PWD_ICDACREG12P5_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_PWD_ICDACREG12P5_LSB) & BIAS_BIAS3_PWD_ICDACREG12P5_MASK) -#define BIAS_BIAS3_PWD_ICDACREG12P5_RESET 3'h5 -#define BIAS_BIAS3_SPARE_MSB 0 -#define BIAS_BIAS3_SPARE_LSB 0 -#define BIAS_BIAS3_SPARE_MASK 'h00000001 -#define BIAS_BIAS3_SPARE_GET(x) (((x) & BIAS_BIAS3_SPARE_MASK) >> BIAS_BIAS3_SPARE_LSB) -#define BIAS_BIAS3_SPARE_SET(x) (((32'd0 | (x)) << BIAS_BIAS3_SPARE_LSB) & BIAS_BIAS3_SPARE_MASK) -#define BIAS_BIAS3_SPARE_RESET 1'h0 -#define BIAS_BIAS3_RESET (32'h0 | \ - BIAS_BIAS3_PWD_IR5GTXMIX25_SET(BIAS_BIAS3_PWD_IR5GTXMIX25_RESET) | \ - BIAS_BIAS3_PWD_IR5GAGC25_SET(BIAS_BIAS3_PWD_IR5GAGC25_RESET) | \ - BIAS_BIAS3_PWD_ICDAC50_SET(BIAS_BIAS3_PWD_ICDAC50_RESET) | \ - BIAS_BIAS3_PWD_ICSYNTH50_SET(BIAS_BIAS3_PWD_ICSYNTH50_RESET) | \ - BIAS_BIAS3_PWD_ICBB50_SET(BIAS_BIAS3_PWD_ICBB50_RESET) | \ - BIAS_BIAS3_PWD_IC2GDIV50_SET(BIAS_BIAS3_PWD_IC2GDIV50_RESET) | \ - BIAS_BIAS3_PWD_IRSYNTH50_SET(BIAS_BIAS3_PWD_IRSYNTH50_RESET) | \ - BIAS_BIAS3_PWD_IRBB50_SET(BIAS_BIAS3_PWD_IRBB50_RESET) | \ - BIAS_BIAS3_PWD_IC25SPARE1_SET(BIAS_BIAS3_PWD_IC25SPARE1_RESET) | \ - BIAS_BIAS3_PWD_IC25SPARE2_SET(BIAS_BIAS3_PWD_IC25SPARE2_RESET) | \ - BIAS_BIAS3_PWD_IR25SPARE1_SET(BIAS_BIAS3_PWD_IR25SPARE1_RESET) | \ - BIAS_BIAS3_PWD_IR25SPARE2_SET(BIAS_BIAS3_PWD_IR25SPARE2_RESET) | \ - BIAS_BIAS3_PWD_ICDACREG12P5_SET(BIAS_BIAS3_PWD_ICDACREG12P5_RESET) | \ - BIAS_BIAS3_SPARE_SET(BIAS_BIAS3_SPARE_RESET)) -#define BIAS_BIAS3_HW_MASK (32'h0) -#define BIAS_BIAS3_SW_MASK (32'h0 | \ - BIAS_BIAS3_PWD_IR5GTXMIX25_MASK | \ - BIAS_BIAS3_PWD_IR5GAGC25_MASK | \ - BIAS_BIAS3_PWD_ICDAC50_MASK | \ - BIAS_BIAS3_PWD_ICSYNTH50_MASK | \ - BIAS_BIAS3_PWD_ICBB50_MASK | \ - BIAS_BIAS3_PWD_IC2GDIV50_MASK | \ - BIAS_BIAS3_PWD_IRSYNTH50_MASK | \ - BIAS_BIAS3_PWD_IRBB50_MASK | \ - BIAS_BIAS3_PWD_IC25SPARE1_MASK | \ - BIAS_BIAS3_PWD_IC25SPARE2_MASK | \ - BIAS_BIAS3_PWD_IR25SPARE1_MASK | \ - BIAS_BIAS3_PWD_IR25SPARE2_MASK | \ - BIAS_BIAS3_PWD_ICDACREG12P5_MASK | \ - BIAS_BIAS3_SPARE_MASK) - -#define BIAS_REG_ADDRESS_MSB 3 - -#endif /* _BIAS_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/gpio_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/gpio_reg.h deleted file mode 100644 index 4f2b964b7df3..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/gpio_reg.h +++ /dev/null @@ -1,977 +0,0 @@ -#ifndef _GPIO_REG_REG_H_ -#define _GPIO_REG_REG_H_ - -#define GPIO_OUT_ADDRESS 0x00000000 -#define GPIO_OUT_OFFSET 0x00000000 -#define GPIO_OUT_DATA_MSB 17 -#define GPIO_OUT_DATA_LSB 0 -#define GPIO_OUT_DATA_MASK 0x0003ffff -#define GPIO_OUT_DATA_GET(x) (((x) & GPIO_OUT_DATA_MASK) >> GPIO_OUT_DATA_LSB) -#define GPIO_OUT_DATA_SET(x) (((x) << GPIO_OUT_DATA_LSB) & GPIO_OUT_DATA_MASK) - -#define GPIO_OUT_W1TS_ADDRESS 0x00000004 -#define GPIO_OUT_W1TS_OFFSET 0x00000004 -#define GPIO_OUT_W1TS_DATA_MSB 17 -#define GPIO_OUT_W1TS_DATA_LSB 0 -#define GPIO_OUT_W1TS_DATA_MASK 0x0003ffff -#define GPIO_OUT_W1TS_DATA_GET(x) (((x) & GPIO_OUT_W1TS_DATA_MASK) >> GPIO_OUT_W1TS_DATA_LSB) -#define GPIO_OUT_W1TS_DATA_SET(x) (((x) << GPIO_OUT_W1TS_DATA_LSB) & GPIO_OUT_W1TS_DATA_MASK) - -#define GPIO_OUT_W1TC_ADDRESS 0x00000008 -#define GPIO_OUT_W1TC_OFFSET 0x00000008 -#define GPIO_OUT_W1TC_DATA_MSB 17 -#define GPIO_OUT_W1TC_DATA_LSB 0 -#define GPIO_OUT_W1TC_DATA_MASK 0x0003ffff -#define GPIO_OUT_W1TC_DATA_GET(x) (((x) & GPIO_OUT_W1TC_DATA_MASK) >> GPIO_OUT_W1TC_DATA_LSB) -#define GPIO_OUT_W1TC_DATA_SET(x) (((x) << GPIO_OUT_W1TC_DATA_LSB) & GPIO_OUT_W1TC_DATA_MASK) - -#define GPIO_ENABLE_ADDRESS 0x0000000c -#define GPIO_ENABLE_OFFSET 0x0000000c -#define GPIO_ENABLE_DATA_MSB 17 -#define GPIO_ENABLE_DATA_LSB 0 -#define GPIO_ENABLE_DATA_MASK 0x0003ffff -#define GPIO_ENABLE_DATA_GET(x) (((x) & GPIO_ENABLE_DATA_MASK) >> GPIO_ENABLE_DATA_LSB) -#define GPIO_ENABLE_DATA_SET(x) (((x) << GPIO_ENABLE_DATA_LSB) & GPIO_ENABLE_DATA_MASK) - -#define GPIO_ENABLE_W1TS_ADDRESS 0x00000010 -#define GPIO_ENABLE_W1TS_OFFSET 0x00000010 -#define GPIO_ENABLE_W1TS_DATA_MSB 17 -#define GPIO_ENABLE_W1TS_DATA_LSB 0 -#define GPIO_ENABLE_W1TS_DATA_MASK 0x0003ffff -#define GPIO_ENABLE_W1TS_DATA_GET(x) (((x) & GPIO_ENABLE_W1TS_DATA_MASK) >> GPIO_ENABLE_W1TS_DATA_LSB) -#define GPIO_ENABLE_W1TS_DATA_SET(x) (((x) << GPIO_ENABLE_W1TS_DATA_LSB) & GPIO_ENABLE_W1TS_DATA_MASK) - -#define GPIO_ENABLE_W1TC_ADDRESS 0x00000014 -#define GPIO_ENABLE_W1TC_OFFSET 0x00000014 -#define GPIO_ENABLE_W1TC_DATA_MSB 17 -#define GPIO_ENABLE_W1TC_DATA_LSB 0 -#define GPIO_ENABLE_W1TC_DATA_MASK 0x0003ffff -#define GPIO_ENABLE_W1TC_DATA_GET(x) (((x) & GPIO_ENABLE_W1TC_DATA_MASK) >> GPIO_ENABLE_W1TC_DATA_LSB) -#define GPIO_ENABLE_W1TC_DATA_SET(x) (((x) << GPIO_ENABLE_W1TC_DATA_LSB) & GPIO_ENABLE_W1TC_DATA_MASK) - -#define GPIO_IN_ADDRESS 0x00000018 -#define GPIO_IN_OFFSET 0x00000018 -#define GPIO_IN_DATA_MSB 17 -#define GPIO_IN_DATA_LSB 0 -#define GPIO_IN_DATA_MASK 0x0003ffff -#define GPIO_IN_DATA_GET(x) (((x) & GPIO_IN_DATA_MASK) >> GPIO_IN_DATA_LSB) -#define GPIO_IN_DATA_SET(x) (((x) << GPIO_IN_DATA_LSB) & GPIO_IN_DATA_MASK) - -#define GPIO_STATUS_ADDRESS 0x0000001c -#define GPIO_STATUS_OFFSET 0x0000001c -#define GPIO_STATUS_INTERRUPT_MSB 17 -#define GPIO_STATUS_INTERRUPT_LSB 0 -#define GPIO_STATUS_INTERRUPT_MASK 0x0003ffff -#define GPIO_STATUS_INTERRUPT_GET(x) (((x) & GPIO_STATUS_INTERRUPT_MASK) >> GPIO_STATUS_INTERRUPT_LSB) -#define GPIO_STATUS_INTERRUPT_SET(x) (((x) << GPIO_STATUS_INTERRUPT_LSB) & GPIO_STATUS_INTERRUPT_MASK) - -#define GPIO_STATUS_W1TS_ADDRESS 0x00000020 -#define GPIO_STATUS_W1TS_OFFSET 0x00000020 -#define GPIO_STATUS_W1TS_INTERRUPT_MSB 17 -#define GPIO_STATUS_W1TS_INTERRUPT_LSB 0 -#define GPIO_STATUS_W1TS_INTERRUPT_MASK 0x0003ffff -#define GPIO_STATUS_W1TS_INTERRUPT_GET(x) (((x) & GPIO_STATUS_W1TS_INTERRUPT_MASK) >> GPIO_STATUS_W1TS_INTERRUPT_LSB) -#define GPIO_STATUS_W1TS_INTERRUPT_SET(x) (((x) << GPIO_STATUS_W1TS_INTERRUPT_LSB) & GPIO_STATUS_W1TS_INTERRUPT_MASK) - -#define GPIO_STATUS_W1TC_ADDRESS 0x00000024 -#define GPIO_STATUS_W1TC_OFFSET 0x00000024 -#define GPIO_STATUS_W1TC_INTERRUPT_MSB 17 -#define GPIO_STATUS_W1TC_INTERRUPT_LSB 0 -#define GPIO_STATUS_W1TC_INTERRUPT_MASK 0x0003ffff -#define GPIO_STATUS_W1TC_INTERRUPT_GET(x) (((x) & GPIO_STATUS_W1TC_INTERRUPT_MASK) >> GPIO_STATUS_W1TC_INTERRUPT_LSB) -#define GPIO_STATUS_W1TC_INTERRUPT_SET(x) (((x) << GPIO_STATUS_W1TC_INTERRUPT_LSB) & GPIO_STATUS_W1TC_INTERRUPT_MASK) - -#define GPIO_PIN0_ADDRESS 0x00000028 -#define GPIO_PIN0_OFFSET 0x00000028 -#define GPIO_PIN0_CONFIG_MSB 12 -#define GPIO_PIN0_CONFIG_LSB 11 -#define GPIO_PIN0_CONFIG_MASK 0x00001800 -#define GPIO_PIN0_CONFIG_GET(x) (((x) & GPIO_PIN0_CONFIG_MASK) >> GPIO_PIN0_CONFIG_LSB) -#define GPIO_PIN0_CONFIG_SET(x) (((x) << GPIO_PIN0_CONFIG_LSB) & GPIO_PIN0_CONFIG_MASK) -#define GPIO_PIN0_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN0_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN0_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN0_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN0_WAKEUP_ENABLE_MASK) >> GPIO_PIN0_WAKEUP_ENABLE_LSB) -#define GPIO_PIN0_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN0_WAKEUP_ENABLE_LSB) & GPIO_PIN0_WAKEUP_ENABLE_MASK) -#define GPIO_PIN0_INT_TYPE_MSB 9 -#define GPIO_PIN0_INT_TYPE_LSB 7 -#define GPIO_PIN0_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN0_INT_TYPE_GET(x) (((x) & GPIO_PIN0_INT_TYPE_MASK) >> GPIO_PIN0_INT_TYPE_LSB) -#define GPIO_PIN0_INT_TYPE_SET(x) (((x) << GPIO_PIN0_INT_TYPE_LSB) & GPIO_PIN0_INT_TYPE_MASK) -#define GPIO_PIN0_PAD_DRIVER_MSB 2 -#define GPIO_PIN0_PAD_DRIVER_LSB 2 -#define GPIO_PIN0_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN0_PAD_DRIVER_GET(x) (((x) & GPIO_PIN0_PAD_DRIVER_MASK) >> GPIO_PIN0_PAD_DRIVER_LSB) -#define GPIO_PIN0_PAD_DRIVER_SET(x) (((x) << GPIO_PIN0_PAD_DRIVER_LSB) & GPIO_PIN0_PAD_DRIVER_MASK) -#define GPIO_PIN0_SOURCE_MSB 0 -#define GPIO_PIN0_SOURCE_LSB 0 -#define GPIO_PIN0_SOURCE_MASK 0x00000001 -#define GPIO_PIN0_SOURCE_GET(x) (((x) & GPIO_PIN0_SOURCE_MASK) >> GPIO_PIN0_SOURCE_LSB) -#define GPIO_PIN0_SOURCE_SET(x) (((x) << GPIO_PIN0_SOURCE_LSB) & GPIO_PIN0_SOURCE_MASK) - -#define GPIO_PIN1_ADDRESS 0x0000002c -#define GPIO_PIN1_OFFSET 0x0000002c -#define GPIO_PIN1_CONFIG_MSB 12 -#define GPIO_PIN1_CONFIG_LSB 11 -#define GPIO_PIN1_CONFIG_MASK 0x00001800 -#define GPIO_PIN1_CONFIG_GET(x) (((x) & GPIO_PIN1_CONFIG_MASK) >> GPIO_PIN1_CONFIG_LSB) -#define GPIO_PIN1_CONFIG_SET(x) (((x) << GPIO_PIN1_CONFIG_LSB) & GPIO_PIN1_CONFIG_MASK) -#define GPIO_PIN1_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN1_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN1_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN1_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN1_WAKEUP_ENABLE_MASK) >> GPIO_PIN1_WAKEUP_ENABLE_LSB) -#define GPIO_PIN1_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN1_WAKEUP_ENABLE_LSB) & GPIO_PIN1_WAKEUP_ENABLE_MASK) -#define GPIO_PIN1_INT_TYPE_MSB 9 -#define GPIO_PIN1_INT_TYPE_LSB 7 -#define GPIO_PIN1_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN1_INT_TYPE_GET(x) (((x) & GPIO_PIN1_INT_TYPE_MASK) >> GPIO_PIN1_INT_TYPE_LSB) -#define GPIO_PIN1_INT_TYPE_SET(x) (((x) << GPIO_PIN1_INT_TYPE_LSB) & GPIO_PIN1_INT_TYPE_MASK) -#define GPIO_PIN1_PAD_DRIVER_MSB 2 -#define GPIO_PIN1_PAD_DRIVER_LSB 2 -#define GPIO_PIN1_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN1_PAD_DRIVER_GET(x) (((x) & GPIO_PIN1_PAD_DRIVER_MASK) >> GPIO_PIN1_PAD_DRIVER_LSB) -#define GPIO_PIN1_PAD_DRIVER_SET(x) (((x) << GPIO_PIN1_PAD_DRIVER_LSB) & GPIO_PIN1_PAD_DRIVER_MASK) -#define GPIO_PIN1_SOURCE_MSB 0 -#define GPIO_PIN1_SOURCE_LSB 0 -#define GPIO_PIN1_SOURCE_MASK 0x00000001 -#define GPIO_PIN1_SOURCE_GET(x) (((x) & GPIO_PIN1_SOURCE_MASK) >> GPIO_PIN1_SOURCE_LSB) -#define GPIO_PIN1_SOURCE_SET(x) (((x) << GPIO_PIN1_SOURCE_LSB) & GPIO_PIN1_SOURCE_MASK) - -#define GPIO_PIN2_ADDRESS 0x00000030 -#define GPIO_PIN2_OFFSET 0x00000030 -#define GPIO_PIN2_CONFIG_MSB 12 -#define GPIO_PIN2_CONFIG_LSB 11 -#define GPIO_PIN2_CONFIG_MASK 0x00001800 -#define GPIO_PIN2_CONFIG_GET(x) (((x) & GPIO_PIN2_CONFIG_MASK) >> GPIO_PIN2_CONFIG_LSB) -#define GPIO_PIN2_CONFIG_SET(x) (((x) << GPIO_PIN2_CONFIG_LSB) & GPIO_PIN2_CONFIG_MASK) -#define GPIO_PIN2_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN2_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN2_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN2_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN2_WAKEUP_ENABLE_MASK) >> GPIO_PIN2_WAKEUP_ENABLE_LSB) -#define GPIO_PIN2_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN2_WAKEUP_ENABLE_LSB) & GPIO_PIN2_WAKEUP_ENABLE_MASK) -#define GPIO_PIN2_INT_TYPE_MSB 9 -#define GPIO_PIN2_INT_TYPE_LSB 7 -#define GPIO_PIN2_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN2_INT_TYPE_GET(x) (((x) & GPIO_PIN2_INT_TYPE_MASK) >> GPIO_PIN2_INT_TYPE_LSB) -#define GPIO_PIN2_INT_TYPE_SET(x) (((x) << GPIO_PIN2_INT_TYPE_LSB) & GPIO_PIN2_INT_TYPE_MASK) -#define GPIO_PIN2_PAD_DRIVER_MSB 2 -#define GPIO_PIN2_PAD_DRIVER_LSB 2 -#define GPIO_PIN2_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN2_PAD_DRIVER_GET(x) (((x) & GPIO_PIN2_PAD_DRIVER_MASK) >> GPIO_PIN2_PAD_DRIVER_LSB) -#define GPIO_PIN2_PAD_DRIVER_SET(x) (((x) << GPIO_PIN2_PAD_DRIVER_LSB) & GPIO_PIN2_PAD_DRIVER_MASK) -#define GPIO_PIN2_SOURCE_MSB 0 -#define GPIO_PIN2_SOURCE_LSB 0 -#define GPIO_PIN2_SOURCE_MASK 0x00000001 -#define GPIO_PIN2_SOURCE_GET(x) (((x) & GPIO_PIN2_SOURCE_MASK) >> GPIO_PIN2_SOURCE_LSB) -#define GPIO_PIN2_SOURCE_SET(x) (((x) << GPIO_PIN2_SOURCE_LSB) & GPIO_PIN2_SOURCE_MASK) - -#define GPIO_PIN3_ADDRESS 0x00000034 -#define GPIO_PIN3_OFFSET 0x00000034 -#define GPIO_PIN3_CONFIG_MSB 12 -#define GPIO_PIN3_CONFIG_LSB 11 -#define GPIO_PIN3_CONFIG_MASK 0x00001800 -#define GPIO_PIN3_CONFIG_GET(x) (((x) & GPIO_PIN3_CONFIG_MASK) >> GPIO_PIN3_CONFIG_LSB) -#define GPIO_PIN3_CONFIG_SET(x) (((x) << GPIO_PIN3_CONFIG_LSB) & GPIO_PIN3_CONFIG_MASK) -#define GPIO_PIN3_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN3_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN3_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN3_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN3_WAKEUP_ENABLE_MASK) >> GPIO_PIN3_WAKEUP_ENABLE_LSB) -#define GPIO_PIN3_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN3_WAKEUP_ENABLE_LSB) & GPIO_PIN3_WAKEUP_ENABLE_MASK) -#define GPIO_PIN3_INT_TYPE_MSB 9 -#define GPIO_PIN3_INT_TYPE_LSB 7 -#define GPIO_PIN3_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN3_INT_TYPE_GET(x) (((x) & GPIO_PIN3_INT_TYPE_MASK) >> GPIO_PIN3_INT_TYPE_LSB) -#define GPIO_PIN3_INT_TYPE_SET(x) (((x) << GPIO_PIN3_INT_TYPE_LSB) & GPIO_PIN3_INT_TYPE_MASK) -#define GPIO_PIN3_PAD_DRIVER_MSB 2 -#define GPIO_PIN3_PAD_DRIVER_LSB 2 -#define GPIO_PIN3_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN3_PAD_DRIVER_GET(x) (((x) & GPIO_PIN3_PAD_DRIVER_MASK) >> GPIO_PIN3_PAD_DRIVER_LSB) -#define GPIO_PIN3_PAD_DRIVER_SET(x) (((x) << GPIO_PIN3_PAD_DRIVER_LSB) & GPIO_PIN3_PAD_DRIVER_MASK) -#define GPIO_PIN3_SOURCE_MSB 0 -#define GPIO_PIN3_SOURCE_LSB 0 -#define GPIO_PIN3_SOURCE_MASK 0x00000001 -#define GPIO_PIN3_SOURCE_GET(x) (((x) & GPIO_PIN3_SOURCE_MASK) >> GPIO_PIN3_SOURCE_LSB) -#define GPIO_PIN3_SOURCE_SET(x) (((x) << GPIO_PIN3_SOURCE_LSB) & GPIO_PIN3_SOURCE_MASK) - -#define GPIO_PIN4_ADDRESS 0x00000038 -#define GPIO_PIN4_OFFSET 0x00000038 -#define GPIO_PIN4_CONFIG_MSB 12 -#define GPIO_PIN4_CONFIG_LSB 11 -#define GPIO_PIN4_CONFIG_MASK 0x00001800 -#define GPIO_PIN4_CONFIG_GET(x) (((x) & GPIO_PIN4_CONFIG_MASK) >> GPIO_PIN4_CONFIG_LSB) -#define GPIO_PIN4_CONFIG_SET(x) (((x) << GPIO_PIN4_CONFIG_LSB) & GPIO_PIN4_CONFIG_MASK) -#define GPIO_PIN4_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN4_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN4_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN4_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN4_WAKEUP_ENABLE_MASK) >> GPIO_PIN4_WAKEUP_ENABLE_LSB) -#define GPIO_PIN4_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN4_WAKEUP_ENABLE_LSB) & GPIO_PIN4_WAKEUP_ENABLE_MASK) -#define GPIO_PIN4_INT_TYPE_MSB 9 -#define GPIO_PIN4_INT_TYPE_LSB 7 -#define GPIO_PIN4_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN4_INT_TYPE_GET(x) (((x) & GPIO_PIN4_INT_TYPE_MASK) >> GPIO_PIN4_INT_TYPE_LSB) -#define GPIO_PIN4_INT_TYPE_SET(x) (((x) << GPIO_PIN4_INT_TYPE_LSB) & GPIO_PIN4_INT_TYPE_MASK) -#define GPIO_PIN4_PAD_DRIVER_MSB 2 -#define GPIO_PIN4_PAD_DRIVER_LSB 2 -#define GPIO_PIN4_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN4_PAD_DRIVER_GET(x) (((x) & GPIO_PIN4_PAD_DRIVER_MASK) >> GPIO_PIN4_PAD_DRIVER_LSB) -#define GPIO_PIN4_PAD_DRIVER_SET(x) (((x) << GPIO_PIN4_PAD_DRIVER_LSB) & GPIO_PIN4_PAD_DRIVER_MASK) -#define GPIO_PIN4_SOURCE_MSB 0 -#define GPIO_PIN4_SOURCE_LSB 0 -#define GPIO_PIN4_SOURCE_MASK 0x00000001 -#define GPIO_PIN4_SOURCE_GET(x) (((x) & GPIO_PIN4_SOURCE_MASK) >> GPIO_PIN4_SOURCE_LSB) -#define GPIO_PIN4_SOURCE_SET(x) (((x) << GPIO_PIN4_SOURCE_LSB) & GPIO_PIN4_SOURCE_MASK) - -#define GPIO_PIN5_ADDRESS 0x0000003c -#define GPIO_PIN5_OFFSET 0x0000003c -#define GPIO_PIN5_CONFIG_MSB 12 -#define GPIO_PIN5_CONFIG_LSB 11 -#define GPIO_PIN5_CONFIG_MASK 0x00001800 -#define GPIO_PIN5_CONFIG_GET(x) (((x) & GPIO_PIN5_CONFIG_MASK) >> GPIO_PIN5_CONFIG_LSB) -#define GPIO_PIN5_CONFIG_SET(x) (((x) << GPIO_PIN5_CONFIG_LSB) & GPIO_PIN5_CONFIG_MASK) -#define GPIO_PIN5_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN5_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN5_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN5_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN5_WAKEUP_ENABLE_MASK) >> GPIO_PIN5_WAKEUP_ENABLE_LSB) -#define GPIO_PIN5_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN5_WAKEUP_ENABLE_LSB) & GPIO_PIN5_WAKEUP_ENABLE_MASK) -#define GPIO_PIN5_INT_TYPE_MSB 9 -#define GPIO_PIN5_INT_TYPE_LSB 7 -#define GPIO_PIN5_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN5_INT_TYPE_GET(x) (((x) & GPIO_PIN5_INT_TYPE_MASK) >> GPIO_PIN5_INT_TYPE_LSB) -#define GPIO_PIN5_INT_TYPE_SET(x) (((x) << GPIO_PIN5_INT_TYPE_LSB) & GPIO_PIN5_INT_TYPE_MASK) -#define GPIO_PIN5_PAD_DRIVER_MSB 2 -#define GPIO_PIN5_PAD_DRIVER_LSB 2 -#define GPIO_PIN5_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN5_PAD_DRIVER_GET(x) (((x) & GPIO_PIN5_PAD_DRIVER_MASK) >> GPIO_PIN5_PAD_DRIVER_LSB) -#define GPIO_PIN5_PAD_DRIVER_SET(x) (((x) << GPIO_PIN5_PAD_DRIVER_LSB) & GPIO_PIN5_PAD_DRIVER_MASK) -#define GPIO_PIN5_SOURCE_MSB 0 -#define GPIO_PIN5_SOURCE_LSB 0 -#define GPIO_PIN5_SOURCE_MASK 0x00000001 -#define GPIO_PIN5_SOURCE_GET(x) (((x) & GPIO_PIN5_SOURCE_MASK) >> GPIO_PIN5_SOURCE_LSB) -#define GPIO_PIN5_SOURCE_SET(x) (((x) << GPIO_PIN5_SOURCE_LSB) & GPIO_PIN5_SOURCE_MASK) - -#define GPIO_PIN6_ADDRESS 0x00000040 -#define GPIO_PIN6_OFFSET 0x00000040 -#define GPIO_PIN6_CONFIG_MSB 12 -#define GPIO_PIN6_CONFIG_LSB 11 -#define GPIO_PIN6_CONFIG_MASK 0x00001800 -#define GPIO_PIN6_CONFIG_GET(x) (((x) & GPIO_PIN6_CONFIG_MASK) >> GPIO_PIN6_CONFIG_LSB) -#define GPIO_PIN6_CONFIG_SET(x) (((x) << GPIO_PIN6_CONFIG_LSB) & GPIO_PIN6_CONFIG_MASK) -#define GPIO_PIN6_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN6_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN6_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN6_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN6_WAKEUP_ENABLE_MASK) >> GPIO_PIN6_WAKEUP_ENABLE_LSB) -#define GPIO_PIN6_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN6_WAKEUP_ENABLE_LSB) & GPIO_PIN6_WAKEUP_ENABLE_MASK) -#define GPIO_PIN6_INT_TYPE_MSB 9 -#define GPIO_PIN6_INT_TYPE_LSB 7 -#define GPIO_PIN6_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN6_INT_TYPE_GET(x) (((x) & GPIO_PIN6_INT_TYPE_MASK) >> GPIO_PIN6_INT_TYPE_LSB) -#define GPIO_PIN6_INT_TYPE_SET(x) (((x) << GPIO_PIN6_INT_TYPE_LSB) & GPIO_PIN6_INT_TYPE_MASK) -#define GPIO_PIN6_PAD_DRIVER_MSB 2 -#define GPIO_PIN6_PAD_DRIVER_LSB 2 -#define GPIO_PIN6_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN6_PAD_DRIVER_GET(x) (((x) & GPIO_PIN6_PAD_DRIVER_MASK) >> GPIO_PIN6_PAD_DRIVER_LSB) -#define GPIO_PIN6_PAD_DRIVER_SET(x) (((x) << GPIO_PIN6_PAD_DRIVER_LSB) & GPIO_PIN6_PAD_DRIVER_MASK) -#define GPIO_PIN6_SOURCE_MSB 0 -#define GPIO_PIN6_SOURCE_LSB 0 -#define GPIO_PIN6_SOURCE_MASK 0x00000001 -#define GPIO_PIN6_SOURCE_GET(x) (((x) & GPIO_PIN6_SOURCE_MASK) >> GPIO_PIN6_SOURCE_LSB) -#define GPIO_PIN6_SOURCE_SET(x) (((x) << GPIO_PIN6_SOURCE_LSB) & GPIO_PIN6_SOURCE_MASK) - -#define GPIO_PIN7_ADDRESS 0x00000044 -#define GPIO_PIN7_OFFSET 0x00000044 -#define GPIO_PIN7_CONFIG_MSB 12 -#define GPIO_PIN7_CONFIG_LSB 11 -#define GPIO_PIN7_CONFIG_MASK 0x00001800 -#define GPIO_PIN7_CONFIG_GET(x) (((x) & GPIO_PIN7_CONFIG_MASK) >> GPIO_PIN7_CONFIG_LSB) -#define GPIO_PIN7_CONFIG_SET(x) (((x) << GPIO_PIN7_CONFIG_LSB) & GPIO_PIN7_CONFIG_MASK) -#define GPIO_PIN7_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN7_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN7_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN7_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN7_WAKEUP_ENABLE_MASK) >> GPIO_PIN7_WAKEUP_ENABLE_LSB) -#define GPIO_PIN7_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN7_WAKEUP_ENABLE_LSB) & GPIO_PIN7_WAKEUP_ENABLE_MASK) -#define GPIO_PIN7_INT_TYPE_MSB 9 -#define GPIO_PIN7_INT_TYPE_LSB 7 -#define GPIO_PIN7_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN7_INT_TYPE_GET(x) (((x) & GPIO_PIN7_INT_TYPE_MASK) >> GPIO_PIN7_INT_TYPE_LSB) -#define GPIO_PIN7_INT_TYPE_SET(x) (((x) << GPIO_PIN7_INT_TYPE_LSB) & GPIO_PIN7_INT_TYPE_MASK) -#define GPIO_PIN7_PAD_DRIVER_MSB 2 -#define GPIO_PIN7_PAD_DRIVER_LSB 2 -#define GPIO_PIN7_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN7_PAD_DRIVER_GET(x) (((x) & GPIO_PIN7_PAD_DRIVER_MASK) >> GPIO_PIN7_PAD_DRIVER_LSB) -#define GPIO_PIN7_PAD_DRIVER_SET(x) (((x) << GPIO_PIN7_PAD_DRIVER_LSB) & GPIO_PIN7_PAD_DRIVER_MASK) -#define GPIO_PIN7_SOURCE_MSB 0 -#define GPIO_PIN7_SOURCE_LSB 0 -#define GPIO_PIN7_SOURCE_MASK 0x00000001 -#define GPIO_PIN7_SOURCE_GET(x) (((x) & GPIO_PIN7_SOURCE_MASK) >> GPIO_PIN7_SOURCE_LSB) -#define GPIO_PIN7_SOURCE_SET(x) (((x) << GPIO_PIN7_SOURCE_LSB) & GPIO_PIN7_SOURCE_MASK) - -#define GPIO_PIN8_ADDRESS 0x00000048 -#define GPIO_PIN8_OFFSET 0x00000048 -#define GPIO_PIN8_CONFIG_MSB 12 -#define GPIO_PIN8_CONFIG_LSB 11 -#define GPIO_PIN8_CONFIG_MASK 0x00001800 -#define GPIO_PIN8_CONFIG_GET(x) (((x) & GPIO_PIN8_CONFIG_MASK) >> GPIO_PIN8_CONFIG_LSB) -#define GPIO_PIN8_CONFIG_SET(x) (((x) << GPIO_PIN8_CONFIG_LSB) & GPIO_PIN8_CONFIG_MASK) -#define GPIO_PIN8_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN8_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN8_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN8_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN8_WAKEUP_ENABLE_MASK) >> GPIO_PIN8_WAKEUP_ENABLE_LSB) -#define GPIO_PIN8_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN8_WAKEUP_ENABLE_LSB) & GPIO_PIN8_WAKEUP_ENABLE_MASK) -#define GPIO_PIN8_INT_TYPE_MSB 9 -#define GPIO_PIN8_INT_TYPE_LSB 7 -#define GPIO_PIN8_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN8_INT_TYPE_GET(x) (((x) & GPIO_PIN8_INT_TYPE_MASK) >> GPIO_PIN8_INT_TYPE_LSB) -#define GPIO_PIN8_INT_TYPE_SET(x) (((x) << GPIO_PIN8_INT_TYPE_LSB) & GPIO_PIN8_INT_TYPE_MASK) -#define GPIO_PIN8_PAD_DRIVER_MSB 2 -#define GPIO_PIN8_PAD_DRIVER_LSB 2 -#define GPIO_PIN8_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN8_PAD_DRIVER_GET(x) (((x) & GPIO_PIN8_PAD_DRIVER_MASK) >> GPIO_PIN8_PAD_DRIVER_LSB) -#define GPIO_PIN8_PAD_DRIVER_SET(x) (((x) << GPIO_PIN8_PAD_DRIVER_LSB) & GPIO_PIN8_PAD_DRIVER_MASK) -#define GPIO_PIN8_SOURCE_MSB 0 -#define GPIO_PIN8_SOURCE_LSB 0 -#define GPIO_PIN8_SOURCE_MASK 0x00000001 -#define GPIO_PIN8_SOURCE_GET(x) (((x) & GPIO_PIN8_SOURCE_MASK) >> GPIO_PIN8_SOURCE_LSB) -#define GPIO_PIN8_SOURCE_SET(x) (((x) << GPIO_PIN8_SOURCE_LSB) & GPIO_PIN8_SOURCE_MASK) - -#define GPIO_PIN9_ADDRESS 0x0000004c -#define GPIO_PIN9_OFFSET 0x0000004c -#define GPIO_PIN9_CONFIG_MSB 12 -#define GPIO_PIN9_CONFIG_LSB 11 -#define GPIO_PIN9_CONFIG_MASK 0x00001800 -#define GPIO_PIN9_CONFIG_GET(x) (((x) & GPIO_PIN9_CONFIG_MASK) >> GPIO_PIN9_CONFIG_LSB) -#define GPIO_PIN9_CONFIG_SET(x) (((x) << GPIO_PIN9_CONFIG_LSB) & GPIO_PIN9_CONFIG_MASK) -#define GPIO_PIN9_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN9_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN9_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN9_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN9_WAKEUP_ENABLE_MASK) >> GPIO_PIN9_WAKEUP_ENABLE_LSB) -#define GPIO_PIN9_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN9_WAKEUP_ENABLE_LSB) & GPIO_PIN9_WAKEUP_ENABLE_MASK) -#define GPIO_PIN9_INT_TYPE_MSB 9 -#define GPIO_PIN9_INT_TYPE_LSB 7 -#define GPIO_PIN9_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN9_INT_TYPE_GET(x) (((x) & GPIO_PIN9_INT_TYPE_MASK) >> GPIO_PIN9_INT_TYPE_LSB) -#define GPIO_PIN9_INT_TYPE_SET(x) (((x) << GPIO_PIN9_INT_TYPE_LSB) & GPIO_PIN9_INT_TYPE_MASK) -#define GPIO_PIN9_PAD_DRIVER_MSB 2 -#define GPIO_PIN9_PAD_DRIVER_LSB 2 -#define GPIO_PIN9_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN9_PAD_DRIVER_GET(x) (((x) & GPIO_PIN9_PAD_DRIVER_MASK) >> GPIO_PIN9_PAD_DRIVER_LSB) -#define GPIO_PIN9_PAD_DRIVER_SET(x) (((x) << GPIO_PIN9_PAD_DRIVER_LSB) & GPIO_PIN9_PAD_DRIVER_MASK) -#define GPIO_PIN9_SOURCE_MSB 0 -#define GPIO_PIN9_SOURCE_LSB 0 -#define GPIO_PIN9_SOURCE_MASK 0x00000001 -#define GPIO_PIN9_SOURCE_GET(x) (((x) & GPIO_PIN9_SOURCE_MASK) >> GPIO_PIN9_SOURCE_LSB) -#define GPIO_PIN9_SOURCE_SET(x) (((x) << GPIO_PIN9_SOURCE_LSB) & GPIO_PIN9_SOURCE_MASK) - -#define GPIO_PIN10_ADDRESS 0x00000050 -#define GPIO_PIN10_OFFSET 0x00000050 -#define GPIO_PIN10_CONFIG_MSB 12 -#define GPIO_PIN10_CONFIG_LSB 11 -#define GPIO_PIN10_CONFIG_MASK 0x00001800 -#define GPIO_PIN10_CONFIG_GET(x) (((x) & GPIO_PIN10_CONFIG_MASK) >> GPIO_PIN10_CONFIG_LSB) -#define GPIO_PIN10_CONFIG_SET(x) (((x) << GPIO_PIN10_CONFIG_LSB) & GPIO_PIN10_CONFIG_MASK) -#define GPIO_PIN10_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN10_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN10_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN10_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN10_WAKEUP_ENABLE_MASK) >> GPIO_PIN10_WAKEUP_ENABLE_LSB) -#define GPIO_PIN10_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN10_WAKEUP_ENABLE_LSB) & GPIO_PIN10_WAKEUP_ENABLE_MASK) -#define GPIO_PIN10_INT_TYPE_MSB 9 -#define GPIO_PIN10_INT_TYPE_LSB 7 -#define GPIO_PIN10_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN10_INT_TYPE_GET(x) (((x) & GPIO_PIN10_INT_TYPE_MASK) >> GPIO_PIN10_INT_TYPE_LSB) -#define GPIO_PIN10_INT_TYPE_SET(x) (((x) << GPIO_PIN10_INT_TYPE_LSB) & GPIO_PIN10_INT_TYPE_MASK) -#define GPIO_PIN10_PAD_DRIVER_MSB 2 -#define GPIO_PIN10_PAD_DRIVER_LSB 2 -#define GPIO_PIN10_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN10_PAD_DRIVER_GET(x) (((x) & GPIO_PIN10_PAD_DRIVER_MASK) >> GPIO_PIN10_PAD_DRIVER_LSB) -#define GPIO_PIN10_PAD_DRIVER_SET(x) (((x) << GPIO_PIN10_PAD_DRIVER_LSB) & GPIO_PIN10_PAD_DRIVER_MASK) -#define GPIO_PIN10_SOURCE_MSB 0 -#define GPIO_PIN10_SOURCE_LSB 0 -#define GPIO_PIN10_SOURCE_MASK 0x00000001 -#define GPIO_PIN10_SOURCE_GET(x) (((x) & GPIO_PIN10_SOURCE_MASK) >> GPIO_PIN10_SOURCE_LSB) -#define GPIO_PIN10_SOURCE_SET(x) (((x) << GPIO_PIN10_SOURCE_LSB) & GPIO_PIN10_SOURCE_MASK) - -#define GPIO_PIN11_ADDRESS 0x00000054 -#define GPIO_PIN11_OFFSET 0x00000054 -#define GPIO_PIN11_CONFIG_MSB 12 -#define GPIO_PIN11_CONFIG_LSB 11 -#define GPIO_PIN11_CONFIG_MASK 0x00001800 -#define GPIO_PIN11_CONFIG_GET(x) (((x) & GPIO_PIN11_CONFIG_MASK) >> GPIO_PIN11_CONFIG_LSB) -#define GPIO_PIN11_CONFIG_SET(x) (((x) << GPIO_PIN11_CONFIG_LSB) & GPIO_PIN11_CONFIG_MASK) -#define GPIO_PIN11_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN11_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN11_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN11_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN11_WAKEUP_ENABLE_MASK) >> GPIO_PIN11_WAKEUP_ENABLE_LSB) -#define GPIO_PIN11_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN11_WAKEUP_ENABLE_LSB) & GPIO_PIN11_WAKEUP_ENABLE_MASK) -#define GPIO_PIN11_INT_TYPE_MSB 9 -#define GPIO_PIN11_INT_TYPE_LSB 7 -#define GPIO_PIN11_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN11_INT_TYPE_GET(x) (((x) & GPIO_PIN11_INT_TYPE_MASK) >> GPIO_PIN11_INT_TYPE_LSB) -#define GPIO_PIN11_INT_TYPE_SET(x) (((x) << GPIO_PIN11_INT_TYPE_LSB) & GPIO_PIN11_INT_TYPE_MASK) -#define GPIO_PIN11_PAD_DRIVER_MSB 2 -#define GPIO_PIN11_PAD_DRIVER_LSB 2 -#define GPIO_PIN11_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN11_PAD_DRIVER_GET(x) (((x) & GPIO_PIN11_PAD_DRIVER_MASK) >> GPIO_PIN11_PAD_DRIVER_LSB) -#define GPIO_PIN11_PAD_DRIVER_SET(x) (((x) << GPIO_PIN11_PAD_DRIVER_LSB) & GPIO_PIN11_PAD_DRIVER_MASK) -#define GPIO_PIN11_SOURCE_MSB 0 -#define GPIO_PIN11_SOURCE_LSB 0 -#define GPIO_PIN11_SOURCE_MASK 0x00000001 -#define GPIO_PIN11_SOURCE_GET(x) (((x) & GPIO_PIN11_SOURCE_MASK) >> GPIO_PIN11_SOURCE_LSB) -#define GPIO_PIN11_SOURCE_SET(x) (((x) << GPIO_PIN11_SOURCE_LSB) & GPIO_PIN11_SOURCE_MASK) - -#define GPIO_PIN12_ADDRESS 0x00000058 -#define GPIO_PIN12_OFFSET 0x00000058 -#define GPIO_PIN12_CONFIG_MSB 12 -#define GPIO_PIN12_CONFIG_LSB 11 -#define GPIO_PIN12_CONFIG_MASK 0x00001800 -#define GPIO_PIN12_CONFIG_GET(x) (((x) & GPIO_PIN12_CONFIG_MASK) >> GPIO_PIN12_CONFIG_LSB) -#define GPIO_PIN12_CONFIG_SET(x) (((x) << GPIO_PIN12_CONFIG_LSB) & GPIO_PIN12_CONFIG_MASK) -#define GPIO_PIN12_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN12_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN12_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN12_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN12_WAKEUP_ENABLE_MASK) >> GPIO_PIN12_WAKEUP_ENABLE_LSB) -#define GPIO_PIN12_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN12_WAKEUP_ENABLE_LSB) & GPIO_PIN12_WAKEUP_ENABLE_MASK) -#define GPIO_PIN12_INT_TYPE_MSB 9 -#define GPIO_PIN12_INT_TYPE_LSB 7 -#define GPIO_PIN12_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN12_INT_TYPE_GET(x) (((x) & GPIO_PIN12_INT_TYPE_MASK) >> GPIO_PIN12_INT_TYPE_LSB) -#define GPIO_PIN12_INT_TYPE_SET(x) (((x) << GPIO_PIN12_INT_TYPE_LSB) & GPIO_PIN12_INT_TYPE_MASK) -#define GPIO_PIN12_PAD_DRIVER_MSB 2 -#define GPIO_PIN12_PAD_DRIVER_LSB 2 -#define GPIO_PIN12_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN12_PAD_DRIVER_GET(x) (((x) & GPIO_PIN12_PAD_DRIVER_MASK) >> GPIO_PIN12_PAD_DRIVER_LSB) -#define GPIO_PIN12_PAD_DRIVER_SET(x) (((x) << GPIO_PIN12_PAD_DRIVER_LSB) & GPIO_PIN12_PAD_DRIVER_MASK) -#define GPIO_PIN12_SOURCE_MSB 0 -#define GPIO_PIN12_SOURCE_LSB 0 -#define GPIO_PIN12_SOURCE_MASK 0x00000001 -#define GPIO_PIN12_SOURCE_GET(x) (((x) & GPIO_PIN12_SOURCE_MASK) >> GPIO_PIN12_SOURCE_LSB) -#define GPIO_PIN12_SOURCE_SET(x) (((x) << GPIO_PIN12_SOURCE_LSB) & GPIO_PIN12_SOURCE_MASK) - -#define GPIO_PIN13_ADDRESS 0x0000005c -#define GPIO_PIN13_OFFSET 0x0000005c -#define GPIO_PIN13_CONFIG_MSB 12 -#define GPIO_PIN13_CONFIG_LSB 11 -#define GPIO_PIN13_CONFIG_MASK 0x00001800 -#define GPIO_PIN13_CONFIG_GET(x) (((x) & GPIO_PIN13_CONFIG_MASK) >> GPIO_PIN13_CONFIG_LSB) -#define GPIO_PIN13_CONFIG_SET(x) (((x) << GPIO_PIN13_CONFIG_LSB) & GPIO_PIN13_CONFIG_MASK) -#define GPIO_PIN13_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN13_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN13_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN13_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN13_WAKEUP_ENABLE_MASK) >> GPIO_PIN13_WAKEUP_ENABLE_LSB) -#define GPIO_PIN13_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN13_WAKEUP_ENABLE_LSB) & GPIO_PIN13_WAKEUP_ENABLE_MASK) -#define GPIO_PIN13_INT_TYPE_MSB 9 -#define GPIO_PIN13_INT_TYPE_LSB 7 -#define GPIO_PIN13_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN13_INT_TYPE_GET(x) (((x) & GPIO_PIN13_INT_TYPE_MASK) >> GPIO_PIN13_INT_TYPE_LSB) -#define GPIO_PIN13_INT_TYPE_SET(x) (((x) << GPIO_PIN13_INT_TYPE_LSB) & GPIO_PIN13_INT_TYPE_MASK) -#define GPIO_PIN13_PAD_DRIVER_MSB 2 -#define GPIO_PIN13_PAD_DRIVER_LSB 2 -#define GPIO_PIN13_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN13_PAD_DRIVER_GET(x) (((x) & GPIO_PIN13_PAD_DRIVER_MASK) >> GPIO_PIN13_PAD_DRIVER_LSB) -#define GPIO_PIN13_PAD_DRIVER_SET(x) (((x) << GPIO_PIN13_PAD_DRIVER_LSB) & GPIO_PIN13_PAD_DRIVER_MASK) -#define GPIO_PIN13_SOURCE_MSB 0 -#define GPIO_PIN13_SOURCE_LSB 0 -#define GPIO_PIN13_SOURCE_MASK 0x00000001 -#define GPIO_PIN13_SOURCE_GET(x) (((x) & GPIO_PIN13_SOURCE_MASK) >> GPIO_PIN13_SOURCE_LSB) -#define GPIO_PIN13_SOURCE_SET(x) (((x) << GPIO_PIN13_SOURCE_LSB) & GPIO_PIN13_SOURCE_MASK) - -#define GPIO_PIN14_ADDRESS 0x00000060 -#define GPIO_PIN14_OFFSET 0x00000060 -#define GPIO_PIN14_CONFIG_MSB 12 -#define GPIO_PIN14_CONFIG_LSB 11 -#define GPIO_PIN14_CONFIG_MASK 0x00001800 -#define GPIO_PIN14_CONFIG_GET(x) (((x) & GPIO_PIN14_CONFIG_MASK) >> GPIO_PIN14_CONFIG_LSB) -#define GPIO_PIN14_CONFIG_SET(x) (((x) << GPIO_PIN14_CONFIG_LSB) & GPIO_PIN14_CONFIG_MASK) -#define GPIO_PIN14_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN14_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN14_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN14_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN14_WAKEUP_ENABLE_MASK) >> GPIO_PIN14_WAKEUP_ENABLE_LSB) -#define GPIO_PIN14_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN14_WAKEUP_ENABLE_LSB) & GPIO_PIN14_WAKEUP_ENABLE_MASK) -#define GPIO_PIN14_INT_TYPE_MSB 9 -#define GPIO_PIN14_INT_TYPE_LSB 7 -#define GPIO_PIN14_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN14_INT_TYPE_GET(x) (((x) & GPIO_PIN14_INT_TYPE_MASK) >> GPIO_PIN14_INT_TYPE_LSB) -#define GPIO_PIN14_INT_TYPE_SET(x) (((x) << GPIO_PIN14_INT_TYPE_LSB) & GPIO_PIN14_INT_TYPE_MASK) -#define GPIO_PIN14_PAD_DRIVER_MSB 2 -#define GPIO_PIN14_PAD_DRIVER_LSB 2 -#define GPIO_PIN14_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN14_PAD_DRIVER_GET(x) (((x) & GPIO_PIN14_PAD_DRIVER_MASK) >> GPIO_PIN14_PAD_DRIVER_LSB) -#define GPIO_PIN14_PAD_DRIVER_SET(x) (((x) << GPIO_PIN14_PAD_DRIVER_LSB) & GPIO_PIN14_PAD_DRIVER_MASK) -#define GPIO_PIN14_SOURCE_MSB 0 -#define GPIO_PIN14_SOURCE_LSB 0 -#define GPIO_PIN14_SOURCE_MASK 0x00000001 -#define GPIO_PIN14_SOURCE_GET(x) (((x) & GPIO_PIN14_SOURCE_MASK) >> GPIO_PIN14_SOURCE_LSB) -#define GPIO_PIN14_SOURCE_SET(x) (((x) << GPIO_PIN14_SOURCE_LSB) & GPIO_PIN14_SOURCE_MASK) - -#define GPIO_PIN15_ADDRESS 0x00000064 -#define GPIO_PIN15_OFFSET 0x00000064 -#define GPIO_PIN15_CONFIG_MSB 12 -#define GPIO_PIN15_CONFIG_LSB 11 -#define GPIO_PIN15_CONFIG_MASK 0x00001800 -#define GPIO_PIN15_CONFIG_GET(x) (((x) & GPIO_PIN15_CONFIG_MASK) >> GPIO_PIN15_CONFIG_LSB) -#define GPIO_PIN15_CONFIG_SET(x) (((x) << GPIO_PIN15_CONFIG_LSB) & GPIO_PIN15_CONFIG_MASK) -#define GPIO_PIN15_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN15_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN15_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN15_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN15_WAKEUP_ENABLE_MASK) >> GPIO_PIN15_WAKEUP_ENABLE_LSB) -#define GPIO_PIN15_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN15_WAKEUP_ENABLE_LSB) & GPIO_PIN15_WAKEUP_ENABLE_MASK) -#define GPIO_PIN15_INT_TYPE_MSB 9 -#define GPIO_PIN15_INT_TYPE_LSB 7 -#define GPIO_PIN15_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN15_INT_TYPE_GET(x) (((x) & GPIO_PIN15_INT_TYPE_MASK) >> GPIO_PIN15_INT_TYPE_LSB) -#define GPIO_PIN15_INT_TYPE_SET(x) (((x) << GPIO_PIN15_INT_TYPE_LSB) & GPIO_PIN15_INT_TYPE_MASK) -#define GPIO_PIN15_PAD_DRIVER_MSB 2 -#define GPIO_PIN15_PAD_DRIVER_LSB 2 -#define GPIO_PIN15_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN15_PAD_DRIVER_GET(x) (((x) & GPIO_PIN15_PAD_DRIVER_MASK) >> GPIO_PIN15_PAD_DRIVER_LSB) -#define GPIO_PIN15_PAD_DRIVER_SET(x) (((x) << GPIO_PIN15_PAD_DRIVER_LSB) & GPIO_PIN15_PAD_DRIVER_MASK) -#define GPIO_PIN15_SOURCE_MSB 0 -#define GPIO_PIN15_SOURCE_LSB 0 -#define GPIO_PIN15_SOURCE_MASK 0x00000001 -#define GPIO_PIN15_SOURCE_GET(x) (((x) & GPIO_PIN15_SOURCE_MASK) >> GPIO_PIN15_SOURCE_LSB) -#define GPIO_PIN15_SOURCE_SET(x) (((x) << GPIO_PIN15_SOURCE_LSB) & GPIO_PIN15_SOURCE_MASK) - -#define GPIO_PIN16_ADDRESS 0x00000068 -#define GPIO_PIN16_OFFSET 0x00000068 -#define GPIO_PIN16_CONFIG_MSB 12 -#define GPIO_PIN16_CONFIG_LSB 11 -#define GPIO_PIN16_CONFIG_MASK 0x00001800 -#define GPIO_PIN16_CONFIG_GET(x) (((x) & GPIO_PIN16_CONFIG_MASK) >> GPIO_PIN16_CONFIG_LSB) -#define GPIO_PIN16_CONFIG_SET(x) (((x) << GPIO_PIN16_CONFIG_LSB) & GPIO_PIN16_CONFIG_MASK) -#define GPIO_PIN16_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN16_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN16_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN16_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN16_WAKEUP_ENABLE_MASK) >> GPIO_PIN16_WAKEUP_ENABLE_LSB) -#define GPIO_PIN16_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN16_WAKEUP_ENABLE_LSB) & GPIO_PIN16_WAKEUP_ENABLE_MASK) -#define GPIO_PIN16_INT_TYPE_MSB 9 -#define GPIO_PIN16_INT_TYPE_LSB 7 -#define GPIO_PIN16_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN16_INT_TYPE_GET(x) (((x) & GPIO_PIN16_INT_TYPE_MASK) >> GPIO_PIN16_INT_TYPE_LSB) -#define GPIO_PIN16_INT_TYPE_SET(x) (((x) << GPIO_PIN16_INT_TYPE_LSB) & GPIO_PIN16_INT_TYPE_MASK) -#define GPIO_PIN16_PAD_DRIVER_MSB 2 -#define GPIO_PIN16_PAD_DRIVER_LSB 2 -#define GPIO_PIN16_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN16_PAD_DRIVER_GET(x) (((x) & GPIO_PIN16_PAD_DRIVER_MASK) >> GPIO_PIN16_PAD_DRIVER_LSB) -#define GPIO_PIN16_PAD_DRIVER_SET(x) (((x) << GPIO_PIN16_PAD_DRIVER_LSB) & GPIO_PIN16_PAD_DRIVER_MASK) -#define GPIO_PIN16_SOURCE_MSB 0 -#define GPIO_PIN16_SOURCE_LSB 0 -#define GPIO_PIN16_SOURCE_MASK 0x00000001 -#define GPIO_PIN16_SOURCE_GET(x) (((x) & GPIO_PIN16_SOURCE_MASK) >> GPIO_PIN16_SOURCE_LSB) -#define GPIO_PIN16_SOURCE_SET(x) (((x) << GPIO_PIN16_SOURCE_LSB) & GPIO_PIN16_SOURCE_MASK) - -#define GPIO_PIN17_ADDRESS 0x0000006c -#define GPIO_PIN17_OFFSET 0x0000006c -#define GPIO_PIN17_CONFIG_MSB 12 -#define GPIO_PIN17_CONFIG_LSB 11 -#define GPIO_PIN17_CONFIG_MASK 0x00001800 -#define GPIO_PIN17_CONFIG_GET(x) (((x) & GPIO_PIN17_CONFIG_MASK) >> GPIO_PIN17_CONFIG_LSB) -#define GPIO_PIN17_CONFIG_SET(x) (((x) << GPIO_PIN17_CONFIG_LSB) & GPIO_PIN17_CONFIG_MASK) -#define GPIO_PIN17_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN17_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN17_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN17_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN17_WAKEUP_ENABLE_MASK) >> GPIO_PIN17_WAKEUP_ENABLE_LSB) -#define GPIO_PIN17_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN17_WAKEUP_ENABLE_LSB) & GPIO_PIN17_WAKEUP_ENABLE_MASK) -#define GPIO_PIN17_INT_TYPE_MSB 9 -#define GPIO_PIN17_INT_TYPE_LSB 7 -#define GPIO_PIN17_INT_TYPE_MASK 0x00000380 -#define GPIO_PIN17_INT_TYPE_GET(x) (((x) & GPIO_PIN17_INT_TYPE_MASK) >> GPIO_PIN17_INT_TYPE_LSB) -#define GPIO_PIN17_INT_TYPE_SET(x) (((x) << GPIO_PIN17_INT_TYPE_LSB) & GPIO_PIN17_INT_TYPE_MASK) -#define GPIO_PIN17_PAD_DRIVER_MSB 2 -#define GPIO_PIN17_PAD_DRIVER_LSB 2 -#define GPIO_PIN17_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN17_PAD_DRIVER_GET(x) (((x) & GPIO_PIN17_PAD_DRIVER_MASK) >> GPIO_PIN17_PAD_DRIVER_LSB) -#define GPIO_PIN17_PAD_DRIVER_SET(x) (((x) << GPIO_PIN17_PAD_DRIVER_LSB) & GPIO_PIN17_PAD_DRIVER_MASK) -#define GPIO_PIN17_SOURCE_MSB 0 -#define GPIO_PIN17_SOURCE_LSB 0 -#define GPIO_PIN17_SOURCE_MASK 0x00000001 -#define GPIO_PIN17_SOURCE_GET(x) (((x) & GPIO_PIN17_SOURCE_MASK) >> GPIO_PIN17_SOURCE_LSB) -#define GPIO_PIN17_SOURCE_SET(x) (((x) << GPIO_PIN17_SOURCE_LSB) & GPIO_PIN17_SOURCE_MASK) - -#define SDIO_PIN_ADDRESS 0x00000070 -#define SDIO_PIN_OFFSET 0x00000070 -#define SDIO_PIN_PAD_PULL_MSB 3 -#define SDIO_PIN_PAD_PULL_LSB 2 -#define SDIO_PIN_PAD_PULL_MASK 0x0000000c -#define SDIO_PIN_PAD_PULL_GET(x) (((x) & SDIO_PIN_PAD_PULL_MASK) >> SDIO_PIN_PAD_PULL_LSB) -#define SDIO_PIN_PAD_PULL_SET(x) (((x) << SDIO_PIN_PAD_PULL_LSB) & SDIO_PIN_PAD_PULL_MASK) -#define SDIO_PIN_PAD_STRENGTH_MSB 1 -#define SDIO_PIN_PAD_STRENGTH_LSB 0 -#define SDIO_PIN_PAD_STRENGTH_MASK 0x00000003 -#define SDIO_PIN_PAD_STRENGTH_GET(x) (((x) & SDIO_PIN_PAD_STRENGTH_MASK) >> SDIO_PIN_PAD_STRENGTH_LSB) -#define SDIO_PIN_PAD_STRENGTH_SET(x) (((x) << SDIO_PIN_PAD_STRENGTH_LSB) & SDIO_PIN_PAD_STRENGTH_MASK) - -#define CLK_REQ_PIN_ADDRESS 0x00000074 -#define CLK_REQ_PIN_OFFSET 0x00000074 -#define CLK_REQ_PIN_ATE_OE_L_MSB 4 -#define CLK_REQ_PIN_ATE_OE_L_LSB 4 -#define CLK_REQ_PIN_ATE_OE_L_MASK 0x00000010 -#define CLK_REQ_PIN_ATE_OE_L_GET(x) (((x) & CLK_REQ_PIN_ATE_OE_L_MASK) >> CLK_REQ_PIN_ATE_OE_L_LSB) -#define CLK_REQ_PIN_ATE_OE_L_SET(x) (((x) << CLK_REQ_PIN_ATE_OE_L_LSB) & CLK_REQ_PIN_ATE_OE_L_MASK) -#define CLK_REQ_PIN_PAD_PULL_MSB 3 -#define CLK_REQ_PIN_PAD_PULL_LSB 2 -#define CLK_REQ_PIN_PAD_PULL_MASK 0x0000000c -#define CLK_REQ_PIN_PAD_PULL_GET(x) (((x) & CLK_REQ_PIN_PAD_PULL_MASK) >> CLK_REQ_PIN_PAD_PULL_LSB) -#define CLK_REQ_PIN_PAD_PULL_SET(x) (((x) << CLK_REQ_PIN_PAD_PULL_LSB) & CLK_REQ_PIN_PAD_PULL_MASK) -#define CLK_REQ_PIN_PAD_STRENGTH_MSB 1 -#define CLK_REQ_PIN_PAD_STRENGTH_LSB 0 -#define CLK_REQ_PIN_PAD_STRENGTH_MASK 0x00000003 -#define CLK_REQ_PIN_PAD_STRENGTH_GET(x) (((x) & CLK_REQ_PIN_PAD_STRENGTH_MASK) >> CLK_REQ_PIN_PAD_STRENGTH_LSB) -#define CLK_REQ_PIN_PAD_STRENGTH_SET(x) (((x) << CLK_REQ_PIN_PAD_STRENGTH_LSB) & CLK_REQ_PIN_PAD_STRENGTH_MASK) - -#define SIGMA_DELTA_ADDRESS 0x00000078 -#define SIGMA_DELTA_OFFSET 0x00000078 -#define SIGMA_DELTA_ENABLE_MSB 16 -#define SIGMA_DELTA_ENABLE_LSB 16 -#define SIGMA_DELTA_ENABLE_MASK 0x00010000 -#define SIGMA_DELTA_ENABLE_GET(x) (((x) & SIGMA_DELTA_ENABLE_MASK) >> SIGMA_DELTA_ENABLE_LSB) -#define SIGMA_DELTA_ENABLE_SET(x) (((x) << SIGMA_DELTA_ENABLE_LSB) & SIGMA_DELTA_ENABLE_MASK) -#define SIGMA_DELTA_PRESCALAR_MSB 15 -#define SIGMA_DELTA_PRESCALAR_LSB 8 -#define SIGMA_DELTA_PRESCALAR_MASK 0x0000ff00 -#define SIGMA_DELTA_PRESCALAR_GET(x) (((x) & SIGMA_DELTA_PRESCALAR_MASK) >> SIGMA_DELTA_PRESCALAR_LSB) -#define SIGMA_DELTA_PRESCALAR_SET(x) (((x) << SIGMA_DELTA_PRESCALAR_LSB) & SIGMA_DELTA_PRESCALAR_MASK) -#define SIGMA_DELTA_TARGET_MSB 7 -#define SIGMA_DELTA_TARGET_LSB 0 -#define SIGMA_DELTA_TARGET_MASK 0x000000ff -#define SIGMA_DELTA_TARGET_GET(x) (((x) & SIGMA_DELTA_TARGET_MASK) >> SIGMA_DELTA_TARGET_LSB) -#define SIGMA_DELTA_TARGET_SET(x) (((x) << SIGMA_DELTA_TARGET_LSB) & SIGMA_DELTA_TARGET_MASK) - -#define DEBUG_CONTROL_ADDRESS 0x0000007c -#define DEBUG_CONTROL_OFFSET 0x0000007c -#define DEBUG_CONTROL_OBS_OE_L_MSB 1 -#define DEBUG_CONTROL_OBS_OE_L_LSB 1 -#define DEBUG_CONTROL_OBS_OE_L_MASK 0x00000002 -#define DEBUG_CONTROL_OBS_OE_L_GET(x) (((x) & DEBUG_CONTROL_OBS_OE_L_MASK) >> DEBUG_CONTROL_OBS_OE_L_LSB) -#define DEBUG_CONTROL_OBS_OE_L_SET(x) (((x) << DEBUG_CONTROL_OBS_OE_L_LSB) & DEBUG_CONTROL_OBS_OE_L_MASK) -#define DEBUG_CONTROL_ENABLE_MSB 0 -#define DEBUG_CONTROL_ENABLE_LSB 0 -#define DEBUG_CONTROL_ENABLE_MASK 0x00000001 -#define DEBUG_CONTROL_ENABLE_GET(x) (((x) & DEBUG_CONTROL_ENABLE_MASK) >> DEBUG_CONTROL_ENABLE_LSB) -#define DEBUG_CONTROL_ENABLE_SET(x) (((x) << DEBUG_CONTROL_ENABLE_LSB) & DEBUG_CONTROL_ENABLE_MASK) - -#define DEBUG_INPUT_SEL_ADDRESS 0x00000080 -#define DEBUG_INPUT_SEL_OFFSET 0x00000080 -#define DEBUG_INPUT_SEL_SRC_MSB 3 -#define DEBUG_INPUT_SEL_SRC_LSB 0 -#define DEBUG_INPUT_SEL_SRC_MASK 0x0000000f -#define DEBUG_INPUT_SEL_SRC_GET(x) (((x) & DEBUG_INPUT_SEL_SRC_MASK) >> DEBUG_INPUT_SEL_SRC_LSB) -#define DEBUG_INPUT_SEL_SRC_SET(x) (((x) << DEBUG_INPUT_SEL_SRC_LSB) & DEBUG_INPUT_SEL_SRC_MASK) - -#define DEBUG_OUT_ADDRESS 0x00000084 -#define DEBUG_OUT_OFFSET 0x00000084 -#define DEBUG_OUT_DATA_MSB 17 -#define DEBUG_OUT_DATA_LSB 0 -#define DEBUG_OUT_DATA_MASK 0x0003ffff -#define DEBUG_OUT_DATA_GET(x) (((x) & DEBUG_OUT_DATA_MASK) >> DEBUG_OUT_DATA_LSB) -#define DEBUG_OUT_DATA_SET(x) (((x) << DEBUG_OUT_DATA_LSB) & DEBUG_OUT_DATA_MASK) - -#define LA_CONTROL_ADDRESS 0x00000088 -#define LA_CONTROL_OFFSET 0x00000088 -#define LA_CONTROL_RUN_MSB 1 -#define LA_CONTROL_RUN_LSB 1 -#define LA_CONTROL_RUN_MASK 0x00000002 -#define LA_CONTROL_RUN_GET(x) (((x) & LA_CONTROL_RUN_MASK) >> LA_CONTROL_RUN_LSB) -#define LA_CONTROL_RUN_SET(x) (((x) << LA_CONTROL_RUN_LSB) & LA_CONTROL_RUN_MASK) -#define LA_CONTROL_TRIGGERED_MSB 0 -#define LA_CONTROL_TRIGGERED_LSB 0 -#define LA_CONTROL_TRIGGERED_MASK 0x00000001 -#define LA_CONTROL_TRIGGERED_GET(x) (((x) & LA_CONTROL_TRIGGERED_MASK) >> LA_CONTROL_TRIGGERED_LSB) -#define LA_CONTROL_TRIGGERED_SET(x) (((x) << LA_CONTROL_TRIGGERED_LSB) & LA_CONTROL_TRIGGERED_MASK) - -#define LA_CLOCK_ADDRESS 0x0000008c -#define LA_CLOCK_OFFSET 0x0000008c -#define LA_CLOCK_DIV_MSB 7 -#define LA_CLOCK_DIV_LSB 0 -#define LA_CLOCK_DIV_MASK 0x000000ff -#define LA_CLOCK_DIV_GET(x) (((x) & LA_CLOCK_DIV_MASK) >> LA_CLOCK_DIV_LSB) -#define LA_CLOCK_DIV_SET(x) (((x) << LA_CLOCK_DIV_LSB) & LA_CLOCK_DIV_MASK) - -#define LA_STATUS_ADDRESS 0x00000090 -#define LA_STATUS_OFFSET 0x00000090 -#define LA_STATUS_INTERRUPT_MSB 0 -#define LA_STATUS_INTERRUPT_LSB 0 -#define LA_STATUS_INTERRUPT_MASK 0x00000001 -#define LA_STATUS_INTERRUPT_GET(x) (((x) & LA_STATUS_INTERRUPT_MASK) >> LA_STATUS_INTERRUPT_LSB) -#define LA_STATUS_INTERRUPT_SET(x) (((x) << LA_STATUS_INTERRUPT_LSB) & LA_STATUS_INTERRUPT_MASK) - -#define LA_TRIGGER_SAMPLE_ADDRESS 0x00000094 -#define LA_TRIGGER_SAMPLE_OFFSET 0x00000094 -#define LA_TRIGGER_SAMPLE_COUNT_MSB 15 -#define LA_TRIGGER_SAMPLE_COUNT_LSB 0 -#define LA_TRIGGER_SAMPLE_COUNT_MASK 0x0000ffff -#define LA_TRIGGER_SAMPLE_COUNT_GET(x) (((x) & LA_TRIGGER_SAMPLE_COUNT_MASK) >> LA_TRIGGER_SAMPLE_COUNT_LSB) -#define LA_TRIGGER_SAMPLE_COUNT_SET(x) (((x) << LA_TRIGGER_SAMPLE_COUNT_LSB) & LA_TRIGGER_SAMPLE_COUNT_MASK) - -#define LA_TRIGGER_POSITION_ADDRESS 0x00000098 -#define LA_TRIGGER_POSITION_OFFSET 0x00000098 -#define LA_TRIGGER_POSITION_VALUE_MSB 15 -#define LA_TRIGGER_POSITION_VALUE_LSB 0 -#define LA_TRIGGER_POSITION_VALUE_MASK 0x0000ffff -#define LA_TRIGGER_POSITION_VALUE_GET(x) (((x) & LA_TRIGGER_POSITION_VALUE_MASK) >> LA_TRIGGER_POSITION_VALUE_LSB) -#define LA_TRIGGER_POSITION_VALUE_SET(x) (((x) << LA_TRIGGER_POSITION_VALUE_LSB) & LA_TRIGGER_POSITION_VALUE_MASK) - -#define LA_PRE_TRIGGER_ADDRESS 0x0000009c -#define LA_PRE_TRIGGER_OFFSET 0x0000009c -#define LA_PRE_TRIGGER_COUNT_MSB 15 -#define LA_PRE_TRIGGER_COUNT_LSB 0 -#define LA_PRE_TRIGGER_COUNT_MASK 0x0000ffff -#define LA_PRE_TRIGGER_COUNT_GET(x) (((x) & LA_PRE_TRIGGER_COUNT_MASK) >> LA_PRE_TRIGGER_COUNT_LSB) -#define LA_PRE_TRIGGER_COUNT_SET(x) (((x) << LA_PRE_TRIGGER_COUNT_LSB) & LA_PRE_TRIGGER_COUNT_MASK) - -#define LA_POST_TRIGGER_ADDRESS 0x000000a0 -#define LA_POST_TRIGGER_OFFSET 0x000000a0 -#define LA_POST_TRIGGER_COUNT_MSB 15 -#define LA_POST_TRIGGER_COUNT_LSB 0 -#define LA_POST_TRIGGER_COUNT_MASK 0x0000ffff -#define LA_POST_TRIGGER_COUNT_GET(x) (((x) & LA_POST_TRIGGER_COUNT_MASK) >> LA_POST_TRIGGER_COUNT_LSB) -#define LA_POST_TRIGGER_COUNT_SET(x) (((x) << LA_POST_TRIGGER_COUNT_LSB) & LA_POST_TRIGGER_COUNT_MASK) - -#define LA_FILTER_CONTROL_ADDRESS 0x000000a4 -#define LA_FILTER_CONTROL_OFFSET 0x000000a4 -#define LA_FILTER_CONTROL_DELTA_MSB 0 -#define LA_FILTER_CONTROL_DELTA_LSB 0 -#define LA_FILTER_CONTROL_DELTA_MASK 0x00000001 -#define LA_FILTER_CONTROL_DELTA_GET(x) (((x) & LA_FILTER_CONTROL_DELTA_MASK) >> LA_FILTER_CONTROL_DELTA_LSB) -#define LA_FILTER_CONTROL_DELTA_SET(x) (((x) << LA_FILTER_CONTROL_DELTA_LSB) & LA_FILTER_CONTROL_DELTA_MASK) - -#define LA_FILTER_DATA_ADDRESS 0x000000a8 -#define LA_FILTER_DATA_OFFSET 0x000000a8 -#define LA_FILTER_DATA_MATCH_MSB 17 -#define LA_FILTER_DATA_MATCH_LSB 0 -#define LA_FILTER_DATA_MATCH_MASK 0x0003ffff -#define LA_FILTER_DATA_MATCH_GET(x) (((x) & LA_FILTER_DATA_MATCH_MASK) >> LA_FILTER_DATA_MATCH_LSB) -#define LA_FILTER_DATA_MATCH_SET(x) (((x) << LA_FILTER_DATA_MATCH_LSB) & LA_FILTER_DATA_MATCH_MASK) - -#define LA_FILTER_WILDCARD_ADDRESS 0x000000ac -#define LA_FILTER_WILDCARD_OFFSET 0x000000ac -#define LA_FILTER_WILDCARD_MATCH_MSB 17 -#define LA_FILTER_WILDCARD_MATCH_LSB 0 -#define LA_FILTER_WILDCARD_MATCH_MASK 0x0003ffff -#define LA_FILTER_WILDCARD_MATCH_GET(x) (((x) & LA_FILTER_WILDCARD_MATCH_MASK) >> LA_FILTER_WILDCARD_MATCH_LSB) -#define LA_FILTER_WILDCARD_MATCH_SET(x) (((x) << LA_FILTER_WILDCARD_MATCH_LSB) & LA_FILTER_WILDCARD_MATCH_MASK) - -#define LA_TRIGGERA_DATA_ADDRESS 0x000000b0 -#define LA_TRIGGERA_DATA_OFFSET 0x000000b0 -#define LA_TRIGGERA_DATA_MATCH_MSB 17 -#define LA_TRIGGERA_DATA_MATCH_LSB 0 -#define LA_TRIGGERA_DATA_MATCH_MASK 0x0003ffff -#define LA_TRIGGERA_DATA_MATCH_GET(x) (((x) & LA_TRIGGERA_DATA_MATCH_MASK) >> LA_TRIGGERA_DATA_MATCH_LSB) -#define LA_TRIGGERA_DATA_MATCH_SET(x) (((x) << LA_TRIGGERA_DATA_MATCH_LSB) & LA_TRIGGERA_DATA_MATCH_MASK) - -#define LA_TRIGGERA_WILDCARD_ADDRESS 0x000000b4 -#define LA_TRIGGERA_WILDCARD_OFFSET 0x000000b4 -#define LA_TRIGGERA_WILDCARD_MATCH_MSB 17 -#define LA_TRIGGERA_WILDCARD_MATCH_LSB 0 -#define LA_TRIGGERA_WILDCARD_MATCH_MASK 0x0003ffff -#define LA_TRIGGERA_WILDCARD_MATCH_GET(x) (((x) & LA_TRIGGERA_WILDCARD_MATCH_MASK) >> LA_TRIGGERA_WILDCARD_MATCH_LSB) -#define LA_TRIGGERA_WILDCARD_MATCH_SET(x) (((x) << LA_TRIGGERA_WILDCARD_MATCH_LSB) & LA_TRIGGERA_WILDCARD_MATCH_MASK) - -#define LA_TRIGGERB_DATA_ADDRESS 0x000000b8 -#define LA_TRIGGERB_DATA_OFFSET 0x000000b8 -#define LA_TRIGGERB_DATA_MATCH_MSB 17 -#define LA_TRIGGERB_DATA_MATCH_LSB 0 -#define LA_TRIGGERB_DATA_MATCH_MASK 0x0003ffff -#define LA_TRIGGERB_DATA_MATCH_GET(x) (((x) & LA_TRIGGERB_DATA_MATCH_MASK) >> LA_TRIGGERB_DATA_MATCH_LSB) -#define LA_TRIGGERB_DATA_MATCH_SET(x) (((x) << LA_TRIGGERB_DATA_MATCH_LSB) & LA_TRIGGERB_DATA_MATCH_MASK) - -#define LA_TRIGGERB_WILDCARD_ADDRESS 0x000000bc -#define LA_TRIGGERB_WILDCARD_OFFSET 0x000000bc -#define LA_TRIGGERB_WILDCARD_MATCH_MSB 17 -#define LA_TRIGGERB_WILDCARD_MATCH_LSB 0 -#define LA_TRIGGERB_WILDCARD_MATCH_MASK 0x0003ffff -#define LA_TRIGGERB_WILDCARD_MATCH_GET(x) (((x) & LA_TRIGGERB_WILDCARD_MATCH_MASK) >> LA_TRIGGERB_WILDCARD_MATCH_LSB) -#define LA_TRIGGERB_WILDCARD_MATCH_SET(x) (((x) << LA_TRIGGERB_WILDCARD_MATCH_LSB) & LA_TRIGGERB_WILDCARD_MATCH_MASK) - -#define LA_TRIGGER_ADDRESS 0x000000c0 -#define LA_TRIGGER_OFFSET 0x000000c0 -#define LA_TRIGGER_EVENT_MSB 2 -#define LA_TRIGGER_EVENT_LSB 0 -#define LA_TRIGGER_EVENT_MASK 0x00000007 -#define LA_TRIGGER_EVENT_GET(x) (((x) & LA_TRIGGER_EVENT_MASK) >> LA_TRIGGER_EVENT_LSB) -#define LA_TRIGGER_EVENT_SET(x) (((x) << LA_TRIGGER_EVENT_LSB) & LA_TRIGGER_EVENT_MASK) - -#define LA_FIFO_ADDRESS 0x000000c4 -#define LA_FIFO_OFFSET 0x000000c4 -#define LA_FIFO_FULL_MSB 1 -#define LA_FIFO_FULL_LSB 1 -#define LA_FIFO_FULL_MASK 0x00000002 -#define LA_FIFO_FULL_GET(x) (((x) & LA_FIFO_FULL_MASK) >> LA_FIFO_FULL_LSB) -#define LA_FIFO_FULL_SET(x) (((x) << LA_FIFO_FULL_LSB) & LA_FIFO_FULL_MASK) -#define LA_FIFO_EMPTY_MSB 0 -#define LA_FIFO_EMPTY_LSB 0 -#define LA_FIFO_EMPTY_MASK 0x00000001 -#define LA_FIFO_EMPTY_GET(x) (((x) & LA_FIFO_EMPTY_MASK) >> LA_FIFO_EMPTY_LSB) -#define LA_FIFO_EMPTY_SET(x) (((x) << LA_FIFO_EMPTY_LSB) & LA_FIFO_EMPTY_MASK) - -#define LA_ADDRESS 0x000000c8 -#define LA_OFFSET 0x000000c8 -#define LA_DATA_MSB 17 -#define LA_DATA_LSB 0 -#define LA_DATA_MASK 0x0003ffff -#define LA_DATA_GET(x) (((x) & LA_DATA_MASK) >> LA_DATA_LSB) -#define LA_DATA_SET(x) (((x) << LA_DATA_LSB) & LA_DATA_MASK) - -#define ANT_PIN_ADDRESS 0x000000d0 -#define ANT_PIN_OFFSET 0x000000d0 -#define ANT_PIN_PAD_PULL_MSB 3 -#define ANT_PIN_PAD_PULL_LSB 2 -#define ANT_PIN_PAD_PULL_MASK 0x0000000c -#define ANT_PIN_PAD_PULL_GET(x) (((x) & ANT_PIN_PAD_PULL_MASK) >> ANT_PIN_PAD_PULL_LSB) -#define ANT_PIN_PAD_PULL_SET(x) (((x) << ANT_PIN_PAD_PULL_LSB) & ANT_PIN_PAD_PULL_MASK) -#define ANT_PIN_PAD_STRENGTH_MSB 1 -#define ANT_PIN_PAD_STRENGTH_LSB 0 -#define ANT_PIN_PAD_STRENGTH_MASK 0x00000003 -#define ANT_PIN_PAD_STRENGTH_GET(x) (((x) & ANT_PIN_PAD_STRENGTH_MASK) >> ANT_PIN_PAD_STRENGTH_LSB) -#define ANT_PIN_PAD_STRENGTH_SET(x) (((x) << ANT_PIN_PAD_STRENGTH_LSB) & ANT_PIN_PAD_STRENGTH_MASK) - -#define ANTD_PIN_ADDRESS 0x000000d4 -#define ANTD_PIN_OFFSET 0x000000d4 -#define ANTD_PIN_PAD_PULL_MSB 1 -#define ANTD_PIN_PAD_PULL_LSB 0 -#define ANTD_PIN_PAD_PULL_MASK 0x00000003 -#define ANTD_PIN_PAD_PULL_GET(x) (((x) & ANTD_PIN_PAD_PULL_MASK) >> ANTD_PIN_PAD_PULL_LSB) -#define ANTD_PIN_PAD_PULL_SET(x) (((x) << ANTD_PIN_PAD_PULL_LSB) & ANTD_PIN_PAD_PULL_MASK) - -#define GPIO_PIN_ADDRESS 0x000000d8 -#define GPIO_PIN_OFFSET 0x000000d8 -#define GPIO_PIN_PAD_PULL_MSB 3 -#define GPIO_PIN_PAD_PULL_LSB 2 -#define GPIO_PIN_PAD_PULL_MASK 0x0000000c -#define GPIO_PIN_PAD_PULL_GET(x) (((x) & GPIO_PIN_PAD_PULL_MASK) >> GPIO_PIN_PAD_PULL_LSB) -#define GPIO_PIN_PAD_PULL_SET(x) (((x) << GPIO_PIN_PAD_PULL_LSB) & GPIO_PIN_PAD_PULL_MASK) -#define GPIO_PIN_PAD_STRENGTH_MSB 1 -#define GPIO_PIN_PAD_STRENGTH_LSB 0 -#define GPIO_PIN_PAD_STRENGTH_MASK 0x00000003 -#define GPIO_PIN_PAD_STRENGTH_GET(x) (((x) & GPIO_PIN_PAD_STRENGTH_MASK) >> GPIO_PIN_PAD_STRENGTH_LSB) -#define GPIO_PIN_PAD_STRENGTH_SET(x) (((x) << GPIO_PIN_PAD_STRENGTH_LSB) & GPIO_PIN_PAD_STRENGTH_MASK) - -#define GPIO_H_PIN_ADDRESS 0x000000dc -#define GPIO_H_PIN_OFFSET 0x000000dc -#define GPIO_H_PIN_PAD_PULL_MSB 1 -#define GPIO_H_PIN_PAD_PULL_LSB 0 -#define GPIO_H_PIN_PAD_PULL_MASK 0x00000003 -#define GPIO_H_PIN_PAD_PULL_GET(x) (((x) & GPIO_H_PIN_PAD_PULL_MASK) >> GPIO_H_PIN_PAD_PULL_LSB) -#define GPIO_H_PIN_PAD_PULL_SET(x) (((x) << GPIO_H_PIN_PAD_PULL_LSB) & GPIO_H_PIN_PAD_PULL_MASK) - -#define BT_PIN_ADDRESS 0x000000e0 -#define BT_PIN_OFFSET 0x000000e0 -#define BT_PIN_PAD_PULL_MSB 3 -#define BT_PIN_PAD_PULL_LSB 2 -#define BT_PIN_PAD_PULL_MASK 0x0000000c -#define BT_PIN_PAD_PULL_GET(x) (((x) & BT_PIN_PAD_PULL_MASK) >> BT_PIN_PAD_PULL_LSB) -#define BT_PIN_PAD_PULL_SET(x) (((x) << BT_PIN_PAD_PULL_LSB) & BT_PIN_PAD_PULL_MASK) -#define BT_PIN_PAD_STRENGTH_MSB 1 -#define BT_PIN_PAD_STRENGTH_LSB 0 -#define BT_PIN_PAD_STRENGTH_MASK 0x00000003 -#define BT_PIN_PAD_STRENGTH_GET(x) (((x) & BT_PIN_PAD_STRENGTH_MASK) >> BT_PIN_PAD_STRENGTH_LSB) -#define BT_PIN_PAD_STRENGTH_SET(x) (((x) << BT_PIN_PAD_STRENGTH_LSB) & BT_PIN_PAD_STRENGTH_MASK) - -#define BT_WLAN_PIN_ADDRESS 0x000000e4 -#define BT_WLAN_PIN_OFFSET 0x000000e4 -#define BT_WLAN_PIN_PAD_PULL_MSB 1 -#define BT_WLAN_PIN_PAD_PULL_LSB 0 -#define BT_WLAN_PIN_PAD_PULL_MASK 0x00000003 -#define BT_WLAN_PIN_PAD_PULL_GET(x) (((x) & BT_WLAN_PIN_PAD_PULL_MASK) >> BT_WLAN_PIN_PAD_PULL_LSB) -#define BT_WLAN_PIN_PAD_PULL_SET(x) (((x) << BT_WLAN_PIN_PAD_PULL_LSB) & BT_WLAN_PIN_PAD_PULL_MASK) - -#define SI_UART_PIN_ADDRESS 0x000000e8 -#define SI_UART_PIN_OFFSET 0x000000e8 -#define SI_UART_PIN_PAD_PULL_MSB 3 -#define SI_UART_PIN_PAD_PULL_LSB 2 -#define SI_UART_PIN_PAD_PULL_MASK 0x0000000c -#define SI_UART_PIN_PAD_PULL_GET(x) (((x) & SI_UART_PIN_PAD_PULL_MASK) >> SI_UART_PIN_PAD_PULL_LSB) -#define SI_UART_PIN_PAD_PULL_SET(x) (((x) << SI_UART_PIN_PAD_PULL_LSB) & SI_UART_PIN_PAD_PULL_MASK) -#define SI_UART_PIN_PAD_STRENGTH_MSB 1 -#define SI_UART_PIN_PAD_STRENGTH_LSB 0 -#define SI_UART_PIN_PAD_STRENGTH_MASK 0x00000003 -#define SI_UART_PIN_PAD_STRENGTH_GET(x) (((x) & SI_UART_PIN_PAD_STRENGTH_MASK) >> SI_UART_PIN_PAD_STRENGTH_LSB) -#define SI_UART_PIN_PAD_STRENGTH_SET(x) (((x) << SI_UART_PIN_PAD_STRENGTH_LSB) & SI_UART_PIN_PAD_STRENGTH_MASK) - -#define CLK32K_PIN_ADDRESS 0x000000ec -#define CLK32K_PIN_OFFSET 0x000000ec -#define CLK32K_PIN_PAD_PULL_MSB 1 -#define CLK32K_PIN_PAD_PULL_LSB 0 -#define CLK32K_PIN_PAD_PULL_MASK 0x00000003 -#define CLK32K_PIN_PAD_PULL_GET(x) (((x) & CLK32K_PIN_PAD_PULL_MASK) >> CLK32K_PIN_PAD_PULL_LSB) -#define CLK32K_PIN_PAD_PULL_SET(x) (((x) << CLK32K_PIN_PAD_PULL_LSB) & CLK32K_PIN_PAD_PULL_MASK) - -#define RESET_TUPLE_STATUS_ADDRESS 0x000000f0 -#define RESET_TUPLE_STATUS_OFFSET 0x000000f0 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MSB 11 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB 8 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK 0x00000f00 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_GET(x) (((x) & RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK) >> RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB) -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_SET(x) (((x) << RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB) & RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK) -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MSB 7 -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB 0 -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK 0x000000ff -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_GET(x) (((x) & RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK) >> RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB) -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_SET(x) (((x) << RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB) & RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct gpio_reg_reg_s { - volatile unsigned int gpio_out; - volatile unsigned int gpio_out_w1ts; - volatile unsigned int gpio_out_w1tc; - volatile unsigned int gpio_enable; - volatile unsigned int gpio_enable_w1ts; - volatile unsigned int gpio_enable_w1tc; - volatile unsigned int gpio_in; - volatile unsigned int gpio_status; - volatile unsigned int gpio_status_w1ts; - volatile unsigned int gpio_status_w1tc; - volatile unsigned int gpio_pin0; - volatile unsigned int gpio_pin1; - volatile unsigned int gpio_pin2; - volatile unsigned int gpio_pin3; - volatile unsigned int gpio_pin4; - volatile unsigned int gpio_pin5; - volatile unsigned int gpio_pin6; - volatile unsigned int gpio_pin7; - volatile unsigned int gpio_pin8; - volatile unsigned int gpio_pin9; - volatile unsigned int gpio_pin10; - volatile unsigned int gpio_pin11; - volatile unsigned int gpio_pin12; - volatile unsigned int gpio_pin13; - volatile unsigned int gpio_pin14; - volatile unsigned int gpio_pin15; - volatile unsigned int gpio_pin16; - volatile unsigned int gpio_pin17; - volatile unsigned int sdio_pin; - volatile unsigned int clk_req_pin; - volatile unsigned int sigma_delta; - volatile unsigned int debug_control; - volatile unsigned int debug_input_sel; - volatile unsigned int debug_out; - volatile unsigned int la_control; - volatile unsigned int la_clock; - volatile unsigned int la_status; - volatile unsigned int la_trigger_sample; - volatile unsigned int la_trigger_position; - volatile unsigned int la_pre_trigger; - volatile unsigned int la_post_trigger; - volatile unsigned int la_filter_control; - volatile unsigned int la_filter_data; - volatile unsigned int la_filter_wildcard; - volatile unsigned int la_triggera_data; - volatile unsigned int la_triggera_wildcard; - volatile unsigned int la_triggerb_data; - volatile unsigned int la_triggerb_wildcard; - volatile unsigned int la_trigger; - volatile unsigned int la_fifo; - volatile unsigned int la[2]; - volatile unsigned int ant_pin; - volatile unsigned int antd_pin; - volatile unsigned int gpio_pin; - volatile unsigned int gpio_h_pin; - volatile unsigned int bt_pin; - volatile unsigned int bt_wlan_pin; - volatile unsigned int si_uart_pin; - volatile unsigned int clk32k_pin; - volatile unsigned int reset_tuple_status; -} gpio_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _GPIO_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/gpio_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/gpio_reg.vrh deleted file mode 100644 index 82a4f9a9ca00..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/gpio_reg.vrh +++ /dev/null @@ -1,1471 +0,0 @@ -#ifndef _GPIO_REG_VRH_ -#define _GPIO_REG_VRH_ - -#define GPIO_OUT_ADDRESS 'h00000000 -#define GPIO_OUT_DATA_MSB 17 -#define GPIO_OUT_DATA_LSB 0 -#define GPIO_OUT_DATA_MASK 'h0003ffff -#define GPIO_OUT_DATA_GET(x) (((x) & GPIO_OUT_DATA_MASK) >> GPIO_OUT_DATA_LSB) -#define GPIO_OUT_DATA_SET(x) (((32'd0 | (x)) << GPIO_OUT_DATA_LSB) & GPIO_OUT_DATA_MASK) -#define GPIO_OUT_DATA_RESET 18'h0 -#define GPIO_OUT_RESET (32'h0 | \ - GPIO_OUT_DATA_SET(GPIO_OUT_DATA_RESET)) -#define GPIO_OUT_HW_MASK (32'h0) -#define GPIO_OUT_SW_MASK (32'h0 | \ - GPIO_OUT_DATA_MASK) - -#define GPIO_OUT_W1TS_ADDRESS 'h00000004 -#define GPIO_OUT_W1TS_DATA_MSB 17 -#define GPIO_OUT_W1TS_DATA_LSB 0 -#define GPIO_OUT_W1TS_DATA_MASK 'h0003ffff -#define GPIO_OUT_W1TS_DATA_GET(x) (((x) & GPIO_OUT_W1TS_DATA_MASK) >> GPIO_OUT_W1TS_DATA_LSB) -#define GPIO_OUT_W1TS_DATA_SET(x) (((32'd0 | (x)) << GPIO_OUT_W1TS_DATA_LSB) & GPIO_OUT_W1TS_DATA_MASK) -#define GPIO_OUT_W1TS_DATA_RESET 18'h0 -#define GPIO_OUT_W1TS_RESET (32'h0 | \ - GPIO_OUT_W1TS_DATA_SET(GPIO_OUT_W1TS_DATA_RESET)) -#define GPIO_OUT_W1TS_HW_MASK (32'h0) -#define GPIO_OUT_W1TS_SW_MASK (32'h0 | \ - GPIO_OUT_W1TS_DATA_MASK) - -#define GPIO_OUT_W1TC_ADDRESS 'h00000008 -#define GPIO_OUT_W1TC_DATA_MSB 17 -#define GPIO_OUT_W1TC_DATA_LSB 0 -#define GPIO_OUT_W1TC_DATA_MASK 'h0003ffff -#define GPIO_OUT_W1TC_DATA_GET(x) (((x) & GPIO_OUT_W1TC_DATA_MASK) >> GPIO_OUT_W1TC_DATA_LSB) -#define GPIO_OUT_W1TC_DATA_SET(x) (((32'd0 | (x)) << GPIO_OUT_W1TC_DATA_LSB) & GPIO_OUT_W1TC_DATA_MASK) -#define GPIO_OUT_W1TC_DATA_RESET 18'h0 -#define GPIO_OUT_W1TC_RESET (32'h0 | \ - GPIO_OUT_W1TC_DATA_SET(GPIO_OUT_W1TC_DATA_RESET)) -#define GPIO_OUT_W1TC_HW_MASK (32'h0) -#define GPIO_OUT_W1TC_SW_MASK (32'h0 | \ - GPIO_OUT_W1TC_DATA_MASK) - -#define GPIO_ENABLE_ADDRESS 'h0000000c -#define GPIO_ENABLE_DATA_MSB 17 -#define GPIO_ENABLE_DATA_LSB 0 -#define GPIO_ENABLE_DATA_MASK 'h0003ffff -#define GPIO_ENABLE_DATA_GET(x) (((x) & GPIO_ENABLE_DATA_MASK) >> GPIO_ENABLE_DATA_LSB) -#define GPIO_ENABLE_DATA_SET(x) (((32'd0 | (x)) << GPIO_ENABLE_DATA_LSB) & GPIO_ENABLE_DATA_MASK) -#define GPIO_ENABLE_DATA_RESET 18'h0 -#define GPIO_ENABLE_RESET (32'h0 | \ - GPIO_ENABLE_DATA_SET(GPIO_ENABLE_DATA_RESET)) -#define GPIO_ENABLE_HW_MASK (32'h0) -#define GPIO_ENABLE_SW_MASK (32'h0 | \ - GPIO_ENABLE_DATA_MASK) - -#define GPIO_ENABLE_W1TS_ADDRESS 'h00000010 -#define GPIO_ENABLE_W1TS_DATA_MSB 17 -#define GPIO_ENABLE_W1TS_DATA_LSB 0 -#define GPIO_ENABLE_W1TS_DATA_MASK 'h0003ffff -#define GPIO_ENABLE_W1TS_DATA_GET(x) (((x) & GPIO_ENABLE_W1TS_DATA_MASK) >> GPIO_ENABLE_W1TS_DATA_LSB) -#define GPIO_ENABLE_W1TS_DATA_SET(x) (((32'd0 | (x)) << GPIO_ENABLE_W1TS_DATA_LSB) & GPIO_ENABLE_W1TS_DATA_MASK) -#define GPIO_ENABLE_W1TS_DATA_RESET 18'h0 -#define GPIO_ENABLE_W1TS_RESET (32'h0 | \ - GPIO_ENABLE_W1TS_DATA_SET(GPIO_ENABLE_W1TS_DATA_RESET)) -#define GPIO_ENABLE_W1TS_HW_MASK (32'h0) -#define GPIO_ENABLE_W1TS_SW_MASK (32'h0 | \ - GPIO_ENABLE_W1TS_DATA_MASK) - -#define GPIO_ENABLE_W1TC_ADDRESS 'h00000014 -#define GPIO_ENABLE_W1TC_DATA_MSB 17 -#define GPIO_ENABLE_W1TC_DATA_LSB 0 -#define GPIO_ENABLE_W1TC_DATA_MASK 'h0003ffff -#define GPIO_ENABLE_W1TC_DATA_GET(x) (((x) & GPIO_ENABLE_W1TC_DATA_MASK) >> GPIO_ENABLE_W1TC_DATA_LSB) -#define GPIO_ENABLE_W1TC_DATA_SET(x) (((32'd0 | (x)) << GPIO_ENABLE_W1TC_DATA_LSB) & GPIO_ENABLE_W1TC_DATA_MASK) -#define GPIO_ENABLE_W1TC_DATA_RESET 18'h0 -#define GPIO_ENABLE_W1TC_RESET (32'h0 | \ - GPIO_ENABLE_W1TC_DATA_SET(GPIO_ENABLE_W1TC_DATA_RESET)) -#define GPIO_ENABLE_W1TC_HW_MASK (32'h0) -#define GPIO_ENABLE_W1TC_SW_MASK (32'h0 | \ - GPIO_ENABLE_W1TC_DATA_MASK) - -#define GPIO_IN_ADDRESS 'h00000018 -#define GPIO_IN_DATA_MSB 17 -#define GPIO_IN_DATA_LSB 0 -#define GPIO_IN_DATA_MASK 'h0003ffff -#define GPIO_IN_DATA_GET(x) (((x) & GPIO_IN_DATA_MASK) >> GPIO_IN_DATA_LSB) -#define GPIO_IN_DATA_SET(x) (((32'd0 | (x)) << GPIO_IN_DATA_LSB) & GPIO_IN_DATA_MASK) -#define GPIO_IN_DATA_RESET 18'h0 -#define GPIO_IN_RESET (32'h0 | \ - GPIO_IN_DATA_SET(GPIO_IN_DATA_RESET)) -#define GPIO_IN_HW_MASK (32'h0 | \ - GPIO_IN_DATA_MASK) -#define GPIO_IN_SW_MASK (32'h0) - -#define GPIO_STATUS_ADDRESS 'h0000001c -#define GPIO_STATUS_INTERRUPT_MSB 17 -#define GPIO_STATUS_INTERRUPT_LSB 0 -#define GPIO_STATUS_INTERRUPT_MASK 'h0003ffff -#define GPIO_STATUS_INTERRUPT_GET(x) (((x) & GPIO_STATUS_INTERRUPT_MASK) >> GPIO_STATUS_INTERRUPT_LSB) -#define GPIO_STATUS_INTERRUPT_SET(x) (((32'd0 | (x)) << GPIO_STATUS_INTERRUPT_LSB) & GPIO_STATUS_INTERRUPT_MASK) -#define GPIO_STATUS_INTERRUPT_RESET 18'h0 -#define GPIO_STATUS_RESET (32'h0 | \ - GPIO_STATUS_INTERRUPT_SET(GPIO_STATUS_INTERRUPT_RESET)) -#define GPIO_STATUS_HW_MASK (32'h0 | \ - GPIO_STATUS_INTERRUPT_MASK) -#define GPIO_STATUS_SW_MASK (32'h0 | \ - GPIO_STATUS_INTERRUPT_MASK) - -#define GPIO_STATUS_W1TS_ADDRESS 'h00000020 -#define GPIO_STATUS_W1TS_INTERRUPT_MSB 17 -#define GPIO_STATUS_W1TS_INTERRUPT_LSB 0 -#define GPIO_STATUS_W1TS_INTERRUPT_MASK 'h0003ffff -#define GPIO_STATUS_W1TS_INTERRUPT_GET(x) (((x) & GPIO_STATUS_W1TS_INTERRUPT_MASK) >> GPIO_STATUS_W1TS_INTERRUPT_LSB) -#define GPIO_STATUS_W1TS_INTERRUPT_SET(x) (((32'd0 | (x)) << GPIO_STATUS_W1TS_INTERRUPT_LSB) & GPIO_STATUS_W1TS_INTERRUPT_MASK) -#define GPIO_STATUS_W1TS_INTERRUPT_RESET 18'h0 -#define GPIO_STATUS_W1TS_RESET (32'h0 | \ - GPIO_STATUS_W1TS_INTERRUPT_SET(GPIO_STATUS_W1TS_INTERRUPT_RESET)) -#define GPIO_STATUS_W1TS_HW_MASK (32'h0) -#define GPIO_STATUS_W1TS_SW_MASK (32'h0 | \ - GPIO_STATUS_W1TS_INTERRUPT_MASK) - -#define GPIO_STATUS_W1TC_ADDRESS 'h00000024 -#define GPIO_STATUS_W1TC_INTERRUPT_MSB 17 -#define GPIO_STATUS_W1TC_INTERRUPT_LSB 0 -#define GPIO_STATUS_W1TC_INTERRUPT_MASK 'h0003ffff -#define GPIO_STATUS_W1TC_INTERRUPT_GET(x) (((x) & GPIO_STATUS_W1TC_INTERRUPT_MASK) >> GPIO_STATUS_W1TC_INTERRUPT_LSB) -#define GPIO_STATUS_W1TC_INTERRUPT_SET(x) (((32'd0 | (x)) << GPIO_STATUS_W1TC_INTERRUPT_LSB) & GPIO_STATUS_W1TC_INTERRUPT_MASK) -#define GPIO_STATUS_W1TC_INTERRUPT_RESET 18'h0 -#define GPIO_STATUS_W1TC_RESET (32'h0 | \ - GPIO_STATUS_W1TC_INTERRUPT_SET(GPIO_STATUS_W1TC_INTERRUPT_RESET)) -#define GPIO_STATUS_W1TC_HW_MASK (32'h0) -#define GPIO_STATUS_W1TC_SW_MASK (32'h0 | \ - GPIO_STATUS_W1TC_INTERRUPT_MASK) - -#define GPIO_PIN0_ADDRESS 'h00000028 -#define GPIO_PIN0_CONFIG_MSB 12 -#define GPIO_PIN0_CONFIG_LSB 11 -#define GPIO_PIN0_CONFIG_MASK 'h00001800 -#define GPIO_PIN0_CONFIG_GET(x) (((x) & GPIO_PIN0_CONFIG_MASK) >> GPIO_PIN0_CONFIG_LSB) -#define GPIO_PIN0_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN0_CONFIG_LSB) & GPIO_PIN0_CONFIG_MASK) -#define GPIO_PIN0_CONFIG_RESET 2'h0 -#define GPIO_PIN0_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN0_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN0_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN0_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN0_WAKEUP_ENABLE_MASK) >> GPIO_PIN0_WAKEUP_ENABLE_LSB) -#define GPIO_PIN0_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN0_WAKEUP_ENABLE_LSB) & GPIO_PIN0_WAKEUP_ENABLE_MASK) -#define GPIO_PIN0_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN0_INT_TYPE_MSB 9 -#define GPIO_PIN0_INT_TYPE_LSB 7 -#define GPIO_PIN0_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN0_INT_TYPE_GET(x) (((x) & GPIO_PIN0_INT_TYPE_MASK) >> GPIO_PIN0_INT_TYPE_LSB) -#define GPIO_PIN0_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN0_INT_TYPE_LSB) & GPIO_PIN0_INT_TYPE_MASK) -#define GPIO_PIN0_INT_TYPE_RESET 3'h0 -#define GPIO_PIN0_PAD_DRIVER_MSB 2 -#define GPIO_PIN0_PAD_DRIVER_LSB 2 -#define GPIO_PIN0_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN0_PAD_DRIVER_GET(x) (((x) & GPIO_PIN0_PAD_DRIVER_MASK) >> GPIO_PIN0_PAD_DRIVER_LSB) -#define GPIO_PIN0_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN0_PAD_DRIVER_LSB) & GPIO_PIN0_PAD_DRIVER_MASK) -#define GPIO_PIN0_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN0_SOURCE_MSB 0 -#define GPIO_PIN0_SOURCE_LSB 0 -#define GPIO_PIN0_SOURCE_MASK 'h00000001 -#define GPIO_PIN0_SOURCE_GET(x) (((x) & GPIO_PIN0_SOURCE_MASK) >> GPIO_PIN0_SOURCE_LSB) -#define GPIO_PIN0_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN0_SOURCE_LSB) & GPIO_PIN0_SOURCE_MASK) -#define GPIO_PIN0_SOURCE_RESET 1'h0 -#define GPIO_PIN0_RESET (32'h0 | \ - GPIO_PIN0_CONFIG_SET(GPIO_PIN0_CONFIG_RESET) | \ - GPIO_PIN0_WAKEUP_ENABLE_SET(GPIO_PIN0_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN0_INT_TYPE_SET(GPIO_PIN0_INT_TYPE_RESET) | \ - GPIO_PIN0_PAD_DRIVER_SET(GPIO_PIN0_PAD_DRIVER_RESET) | \ - GPIO_PIN0_SOURCE_SET(GPIO_PIN0_SOURCE_RESET)) -#define GPIO_PIN0_HW_MASK (32'h0) -#define GPIO_PIN0_SW_MASK (32'h0 | \ - GPIO_PIN0_CONFIG_MASK | \ - GPIO_PIN0_WAKEUP_ENABLE_MASK | \ - GPIO_PIN0_INT_TYPE_MASK | \ - GPIO_PIN0_PAD_DRIVER_MASK | \ - GPIO_PIN0_SOURCE_MASK) - -#define GPIO_PIN1_ADDRESS 'h0000002c -#define GPIO_PIN1_CONFIG_MSB 12 -#define GPIO_PIN1_CONFIG_LSB 11 -#define GPIO_PIN1_CONFIG_MASK 'h00001800 -#define GPIO_PIN1_CONFIG_GET(x) (((x) & GPIO_PIN1_CONFIG_MASK) >> GPIO_PIN1_CONFIG_LSB) -#define GPIO_PIN1_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN1_CONFIG_LSB) & GPIO_PIN1_CONFIG_MASK) -#define GPIO_PIN1_CONFIG_RESET 2'h0 -#define GPIO_PIN1_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN1_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN1_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN1_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN1_WAKEUP_ENABLE_MASK) >> GPIO_PIN1_WAKEUP_ENABLE_LSB) -#define GPIO_PIN1_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN1_WAKEUP_ENABLE_LSB) & GPIO_PIN1_WAKEUP_ENABLE_MASK) -#define GPIO_PIN1_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN1_INT_TYPE_MSB 9 -#define GPIO_PIN1_INT_TYPE_LSB 7 -#define GPIO_PIN1_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN1_INT_TYPE_GET(x) (((x) & GPIO_PIN1_INT_TYPE_MASK) >> GPIO_PIN1_INT_TYPE_LSB) -#define GPIO_PIN1_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN1_INT_TYPE_LSB) & GPIO_PIN1_INT_TYPE_MASK) -#define GPIO_PIN1_INT_TYPE_RESET 3'h0 -#define GPIO_PIN1_PAD_DRIVER_MSB 2 -#define GPIO_PIN1_PAD_DRIVER_LSB 2 -#define GPIO_PIN1_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN1_PAD_DRIVER_GET(x) (((x) & GPIO_PIN1_PAD_DRIVER_MASK) >> GPIO_PIN1_PAD_DRIVER_LSB) -#define GPIO_PIN1_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN1_PAD_DRIVER_LSB) & GPIO_PIN1_PAD_DRIVER_MASK) -#define GPIO_PIN1_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN1_SOURCE_MSB 0 -#define GPIO_PIN1_SOURCE_LSB 0 -#define GPIO_PIN1_SOURCE_MASK 'h00000001 -#define GPIO_PIN1_SOURCE_GET(x) (((x) & GPIO_PIN1_SOURCE_MASK) >> GPIO_PIN1_SOURCE_LSB) -#define GPIO_PIN1_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN1_SOURCE_LSB) & GPIO_PIN1_SOURCE_MASK) -#define GPIO_PIN1_SOURCE_RESET 1'h0 -#define GPIO_PIN1_RESET (32'h0 | \ - GPIO_PIN1_CONFIG_SET(GPIO_PIN1_CONFIG_RESET) | \ - GPIO_PIN1_WAKEUP_ENABLE_SET(GPIO_PIN1_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN1_INT_TYPE_SET(GPIO_PIN1_INT_TYPE_RESET) | \ - GPIO_PIN1_PAD_DRIVER_SET(GPIO_PIN1_PAD_DRIVER_RESET) | \ - GPIO_PIN1_SOURCE_SET(GPIO_PIN1_SOURCE_RESET)) -#define GPIO_PIN1_HW_MASK (32'h0) -#define GPIO_PIN1_SW_MASK (32'h0 | \ - GPIO_PIN1_CONFIG_MASK | \ - GPIO_PIN1_WAKEUP_ENABLE_MASK | \ - GPIO_PIN1_INT_TYPE_MASK | \ - GPIO_PIN1_PAD_DRIVER_MASK | \ - GPIO_PIN1_SOURCE_MASK) - -#define GPIO_PIN2_ADDRESS 'h00000030 -#define GPIO_PIN2_CONFIG_MSB 12 -#define GPIO_PIN2_CONFIG_LSB 11 -#define GPIO_PIN2_CONFIG_MASK 'h00001800 -#define GPIO_PIN2_CONFIG_GET(x) (((x) & GPIO_PIN2_CONFIG_MASK) >> GPIO_PIN2_CONFIG_LSB) -#define GPIO_PIN2_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN2_CONFIG_LSB) & GPIO_PIN2_CONFIG_MASK) -#define GPIO_PIN2_CONFIG_RESET 2'h0 -#define GPIO_PIN2_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN2_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN2_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN2_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN2_WAKEUP_ENABLE_MASK) >> GPIO_PIN2_WAKEUP_ENABLE_LSB) -#define GPIO_PIN2_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN2_WAKEUP_ENABLE_LSB) & GPIO_PIN2_WAKEUP_ENABLE_MASK) -#define GPIO_PIN2_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN2_INT_TYPE_MSB 9 -#define GPIO_PIN2_INT_TYPE_LSB 7 -#define GPIO_PIN2_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN2_INT_TYPE_GET(x) (((x) & GPIO_PIN2_INT_TYPE_MASK) >> GPIO_PIN2_INT_TYPE_LSB) -#define GPIO_PIN2_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN2_INT_TYPE_LSB) & GPIO_PIN2_INT_TYPE_MASK) -#define GPIO_PIN2_INT_TYPE_RESET 3'h0 -#define GPIO_PIN2_PAD_DRIVER_MSB 2 -#define GPIO_PIN2_PAD_DRIVER_LSB 2 -#define GPIO_PIN2_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN2_PAD_DRIVER_GET(x) (((x) & GPIO_PIN2_PAD_DRIVER_MASK) >> GPIO_PIN2_PAD_DRIVER_LSB) -#define GPIO_PIN2_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN2_PAD_DRIVER_LSB) & GPIO_PIN2_PAD_DRIVER_MASK) -#define GPIO_PIN2_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN2_SOURCE_MSB 0 -#define GPIO_PIN2_SOURCE_LSB 0 -#define GPIO_PIN2_SOURCE_MASK 'h00000001 -#define GPIO_PIN2_SOURCE_GET(x) (((x) & GPIO_PIN2_SOURCE_MASK) >> GPIO_PIN2_SOURCE_LSB) -#define GPIO_PIN2_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN2_SOURCE_LSB) & GPIO_PIN2_SOURCE_MASK) -#define GPIO_PIN2_SOURCE_RESET 1'h0 -#define GPIO_PIN2_RESET (32'h0 | \ - GPIO_PIN2_CONFIG_SET(GPIO_PIN2_CONFIG_RESET) | \ - GPIO_PIN2_WAKEUP_ENABLE_SET(GPIO_PIN2_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN2_INT_TYPE_SET(GPIO_PIN2_INT_TYPE_RESET) | \ - GPIO_PIN2_PAD_DRIVER_SET(GPIO_PIN2_PAD_DRIVER_RESET) | \ - GPIO_PIN2_SOURCE_SET(GPIO_PIN2_SOURCE_RESET)) -#define GPIO_PIN2_HW_MASK (32'h0) -#define GPIO_PIN2_SW_MASK (32'h0 | \ - GPIO_PIN2_CONFIG_MASK | \ - GPIO_PIN2_WAKEUP_ENABLE_MASK | \ - GPIO_PIN2_INT_TYPE_MASK | \ - GPIO_PIN2_PAD_DRIVER_MASK | \ - GPIO_PIN2_SOURCE_MASK) - -#define GPIO_PIN3_ADDRESS 'h00000034 -#define GPIO_PIN3_CONFIG_MSB 12 -#define GPIO_PIN3_CONFIG_LSB 11 -#define GPIO_PIN3_CONFIG_MASK 'h00001800 -#define GPIO_PIN3_CONFIG_GET(x) (((x) & GPIO_PIN3_CONFIG_MASK) >> GPIO_PIN3_CONFIG_LSB) -#define GPIO_PIN3_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN3_CONFIG_LSB) & GPIO_PIN3_CONFIG_MASK) -#define GPIO_PIN3_CONFIG_RESET 2'h0 -#define GPIO_PIN3_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN3_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN3_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN3_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN3_WAKEUP_ENABLE_MASK) >> GPIO_PIN3_WAKEUP_ENABLE_LSB) -#define GPIO_PIN3_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN3_WAKEUP_ENABLE_LSB) & GPIO_PIN3_WAKEUP_ENABLE_MASK) -#define GPIO_PIN3_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN3_INT_TYPE_MSB 9 -#define GPIO_PIN3_INT_TYPE_LSB 7 -#define GPIO_PIN3_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN3_INT_TYPE_GET(x) (((x) & GPIO_PIN3_INT_TYPE_MASK) >> GPIO_PIN3_INT_TYPE_LSB) -#define GPIO_PIN3_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN3_INT_TYPE_LSB) & GPIO_PIN3_INT_TYPE_MASK) -#define GPIO_PIN3_INT_TYPE_RESET 3'h0 -#define GPIO_PIN3_PAD_DRIVER_MSB 2 -#define GPIO_PIN3_PAD_DRIVER_LSB 2 -#define GPIO_PIN3_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN3_PAD_DRIVER_GET(x) (((x) & GPIO_PIN3_PAD_DRIVER_MASK) >> GPIO_PIN3_PAD_DRIVER_LSB) -#define GPIO_PIN3_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN3_PAD_DRIVER_LSB) & GPIO_PIN3_PAD_DRIVER_MASK) -#define GPIO_PIN3_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN3_SOURCE_MSB 0 -#define GPIO_PIN3_SOURCE_LSB 0 -#define GPIO_PIN3_SOURCE_MASK 'h00000001 -#define GPIO_PIN3_SOURCE_GET(x) (((x) & GPIO_PIN3_SOURCE_MASK) >> GPIO_PIN3_SOURCE_LSB) -#define GPIO_PIN3_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN3_SOURCE_LSB) & GPIO_PIN3_SOURCE_MASK) -#define GPIO_PIN3_SOURCE_RESET 1'h0 -#define GPIO_PIN3_RESET (32'h0 | \ - GPIO_PIN3_CONFIG_SET(GPIO_PIN3_CONFIG_RESET) | \ - GPIO_PIN3_WAKEUP_ENABLE_SET(GPIO_PIN3_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN3_INT_TYPE_SET(GPIO_PIN3_INT_TYPE_RESET) | \ - GPIO_PIN3_PAD_DRIVER_SET(GPIO_PIN3_PAD_DRIVER_RESET) | \ - GPIO_PIN3_SOURCE_SET(GPIO_PIN3_SOURCE_RESET)) -#define GPIO_PIN3_HW_MASK (32'h0) -#define GPIO_PIN3_SW_MASK (32'h0 | \ - GPIO_PIN3_CONFIG_MASK | \ - GPIO_PIN3_WAKEUP_ENABLE_MASK | \ - GPIO_PIN3_INT_TYPE_MASK | \ - GPIO_PIN3_PAD_DRIVER_MASK | \ - GPIO_PIN3_SOURCE_MASK) - -#define GPIO_PIN4_ADDRESS 'h00000038 -#define GPIO_PIN4_CONFIG_MSB 12 -#define GPIO_PIN4_CONFIG_LSB 11 -#define GPIO_PIN4_CONFIG_MASK 'h00001800 -#define GPIO_PIN4_CONFIG_GET(x) (((x) & GPIO_PIN4_CONFIG_MASK) >> GPIO_PIN4_CONFIG_LSB) -#define GPIO_PIN4_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN4_CONFIG_LSB) & GPIO_PIN4_CONFIG_MASK) -#define GPIO_PIN4_CONFIG_RESET 2'h0 -#define GPIO_PIN4_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN4_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN4_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN4_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN4_WAKEUP_ENABLE_MASK) >> GPIO_PIN4_WAKEUP_ENABLE_LSB) -#define GPIO_PIN4_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN4_WAKEUP_ENABLE_LSB) & GPIO_PIN4_WAKEUP_ENABLE_MASK) -#define GPIO_PIN4_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN4_INT_TYPE_MSB 9 -#define GPIO_PIN4_INT_TYPE_LSB 7 -#define GPIO_PIN4_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN4_INT_TYPE_GET(x) (((x) & GPIO_PIN4_INT_TYPE_MASK) >> GPIO_PIN4_INT_TYPE_LSB) -#define GPIO_PIN4_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN4_INT_TYPE_LSB) & GPIO_PIN4_INT_TYPE_MASK) -#define GPIO_PIN4_INT_TYPE_RESET 3'h0 -#define GPIO_PIN4_PAD_DRIVER_MSB 2 -#define GPIO_PIN4_PAD_DRIVER_LSB 2 -#define GPIO_PIN4_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN4_PAD_DRIVER_GET(x) (((x) & GPIO_PIN4_PAD_DRIVER_MASK) >> GPIO_PIN4_PAD_DRIVER_LSB) -#define GPIO_PIN4_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN4_PAD_DRIVER_LSB) & GPIO_PIN4_PAD_DRIVER_MASK) -#define GPIO_PIN4_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN4_SOURCE_MSB 0 -#define GPIO_PIN4_SOURCE_LSB 0 -#define GPIO_PIN4_SOURCE_MASK 'h00000001 -#define GPIO_PIN4_SOURCE_GET(x) (((x) & GPIO_PIN4_SOURCE_MASK) >> GPIO_PIN4_SOURCE_LSB) -#define GPIO_PIN4_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN4_SOURCE_LSB) & GPIO_PIN4_SOURCE_MASK) -#define GPIO_PIN4_SOURCE_RESET 1'h0 -#define GPIO_PIN4_RESET (32'h0 | \ - GPIO_PIN4_CONFIG_SET(GPIO_PIN4_CONFIG_RESET) | \ - GPIO_PIN4_WAKEUP_ENABLE_SET(GPIO_PIN4_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN4_INT_TYPE_SET(GPIO_PIN4_INT_TYPE_RESET) | \ - GPIO_PIN4_PAD_DRIVER_SET(GPIO_PIN4_PAD_DRIVER_RESET) | \ - GPIO_PIN4_SOURCE_SET(GPIO_PIN4_SOURCE_RESET)) -#define GPIO_PIN4_HW_MASK (32'h0) -#define GPIO_PIN4_SW_MASK (32'h0 | \ - GPIO_PIN4_CONFIG_MASK | \ - GPIO_PIN4_WAKEUP_ENABLE_MASK | \ - GPIO_PIN4_INT_TYPE_MASK | \ - GPIO_PIN4_PAD_DRIVER_MASK | \ - GPIO_PIN4_SOURCE_MASK) - -#define GPIO_PIN5_ADDRESS 'h0000003c -#define GPIO_PIN5_CONFIG_MSB 12 -#define GPIO_PIN5_CONFIG_LSB 11 -#define GPIO_PIN5_CONFIG_MASK 'h00001800 -#define GPIO_PIN5_CONFIG_GET(x) (((x) & GPIO_PIN5_CONFIG_MASK) >> GPIO_PIN5_CONFIG_LSB) -#define GPIO_PIN5_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN5_CONFIG_LSB) & GPIO_PIN5_CONFIG_MASK) -#define GPIO_PIN5_CONFIG_RESET 2'h0 -#define GPIO_PIN5_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN5_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN5_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN5_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN5_WAKEUP_ENABLE_MASK) >> GPIO_PIN5_WAKEUP_ENABLE_LSB) -#define GPIO_PIN5_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN5_WAKEUP_ENABLE_LSB) & GPIO_PIN5_WAKEUP_ENABLE_MASK) -#define GPIO_PIN5_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN5_INT_TYPE_MSB 9 -#define GPIO_PIN5_INT_TYPE_LSB 7 -#define GPIO_PIN5_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN5_INT_TYPE_GET(x) (((x) & GPIO_PIN5_INT_TYPE_MASK) >> GPIO_PIN5_INT_TYPE_LSB) -#define GPIO_PIN5_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN5_INT_TYPE_LSB) & GPIO_PIN5_INT_TYPE_MASK) -#define GPIO_PIN5_INT_TYPE_RESET 3'h0 -#define GPIO_PIN5_PAD_DRIVER_MSB 2 -#define GPIO_PIN5_PAD_DRIVER_LSB 2 -#define GPIO_PIN5_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN5_PAD_DRIVER_GET(x) (((x) & GPIO_PIN5_PAD_DRIVER_MASK) >> GPIO_PIN5_PAD_DRIVER_LSB) -#define GPIO_PIN5_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN5_PAD_DRIVER_LSB) & GPIO_PIN5_PAD_DRIVER_MASK) -#define GPIO_PIN5_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN5_SOURCE_MSB 0 -#define GPIO_PIN5_SOURCE_LSB 0 -#define GPIO_PIN5_SOURCE_MASK 'h00000001 -#define GPIO_PIN5_SOURCE_GET(x) (((x) & GPIO_PIN5_SOURCE_MASK) >> GPIO_PIN5_SOURCE_LSB) -#define GPIO_PIN5_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN5_SOURCE_LSB) & GPIO_PIN5_SOURCE_MASK) -#define GPIO_PIN5_SOURCE_RESET 1'h0 -#define GPIO_PIN5_RESET (32'h0 | \ - GPIO_PIN5_CONFIG_SET(GPIO_PIN5_CONFIG_RESET) | \ - GPIO_PIN5_WAKEUP_ENABLE_SET(GPIO_PIN5_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN5_INT_TYPE_SET(GPIO_PIN5_INT_TYPE_RESET) | \ - GPIO_PIN5_PAD_DRIVER_SET(GPIO_PIN5_PAD_DRIVER_RESET) | \ - GPIO_PIN5_SOURCE_SET(GPIO_PIN5_SOURCE_RESET)) -#define GPIO_PIN5_HW_MASK (32'h0) -#define GPIO_PIN5_SW_MASK (32'h0 | \ - GPIO_PIN5_CONFIG_MASK | \ - GPIO_PIN5_WAKEUP_ENABLE_MASK | \ - GPIO_PIN5_INT_TYPE_MASK | \ - GPIO_PIN5_PAD_DRIVER_MASK | \ - GPIO_PIN5_SOURCE_MASK) - -#define GPIO_PIN6_ADDRESS 'h00000040 -#define GPIO_PIN6_CONFIG_MSB 12 -#define GPIO_PIN6_CONFIG_LSB 11 -#define GPIO_PIN6_CONFIG_MASK 'h00001800 -#define GPIO_PIN6_CONFIG_GET(x) (((x) & GPIO_PIN6_CONFIG_MASK) >> GPIO_PIN6_CONFIG_LSB) -#define GPIO_PIN6_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN6_CONFIG_LSB) & GPIO_PIN6_CONFIG_MASK) -#define GPIO_PIN6_CONFIG_RESET 2'h0 -#define GPIO_PIN6_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN6_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN6_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN6_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN6_WAKEUP_ENABLE_MASK) >> GPIO_PIN6_WAKEUP_ENABLE_LSB) -#define GPIO_PIN6_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN6_WAKEUP_ENABLE_LSB) & GPIO_PIN6_WAKEUP_ENABLE_MASK) -#define GPIO_PIN6_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN6_INT_TYPE_MSB 9 -#define GPIO_PIN6_INT_TYPE_LSB 7 -#define GPIO_PIN6_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN6_INT_TYPE_GET(x) (((x) & GPIO_PIN6_INT_TYPE_MASK) >> GPIO_PIN6_INT_TYPE_LSB) -#define GPIO_PIN6_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN6_INT_TYPE_LSB) & GPIO_PIN6_INT_TYPE_MASK) -#define GPIO_PIN6_INT_TYPE_RESET 3'h0 -#define GPIO_PIN6_PAD_DRIVER_MSB 2 -#define GPIO_PIN6_PAD_DRIVER_LSB 2 -#define GPIO_PIN6_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN6_PAD_DRIVER_GET(x) (((x) & GPIO_PIN6_PAD_DRIVER_MASK) >> GPIO_PIN6_PAD_DRIVER_LSB) -#define GPIO_PIN6_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN6_PAD_DRIVER_LSB) & GPIO_PIN6_PAD_DRIVER_MASK) -#define GPIO_PIN6_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN6_SOURCE_MSB 0 -#define GPIO_PIN6_SOURCE_LSB 0 -#define GPIO_PIN6_SOURCE_MASK 'h00000001 -#define GPIO_PIN6_SOURCE_GET(x) (((x) & GPIO_PIN6_SOURCE_MASK) >> GPIO_PIN6_SOURCE_LSB) -#define GPIO_PIN6_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN6_SOURCE_LSB) & GPIO_PIN6_SOURCE_MASK) -#define GPIO_PIN6_SOURCE_RESET 1'h0 -#define GPIO_PIN6_RESET (32'h0 | \ - GPIO_PIN6_CONFIG_SET(GPIO_PIN6_CONFIG_RESET) | \ - GPIO_PIN6_WAKEUP_ENABLE_SET(GPIO_PIN6_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN6_INT_TYPE_SET(GPIO_PIN6_INT_TYPE_RESET) | \ - GPIO_PIN6_PAD_DRIVER_SET(GPIO_PIN6_PAD_DRIVER_RESET) | \ - GPIO_PIN6_SOURCE_SET(GPIO_PIN6_SOURCE_RESET)) -#define GPIO_PIN6_HW_MASK (32'h0) -#define GPIO_PIN6_SW_MASK (32'h0 | \ - GPIO_PIN6_CONFIG_MASK | \ - GPIO_PIN6_WAKEUP_ENABLE_MASK | \ - GPIO_PIN6_INT_TYPE_MASK | \ - GPIO_PIN6_PAD_DRIVER_MASK | \ - GPIO_PIN6_SOURCE_MASK) - -#define GPIO_PIN7_ADDRESS 'h00000044 -#define GPIO_PIN7_CONFIG_MSB 12 -#define GPIO_PIN7_CONFIG_LSB 11 -#define GPIO_PIN7_CONFIG_MASK 'h00001800 -#define GPIO_PIN7_CONFIG_GET(x) (((x) & GPIO_PIN7_CONFIG_MASK) >> GPIO_PIN7_CONFIG_LSB) -#define GPIO_PIN7_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN7_CONFIG_LSB) & GPIO_PIN7_CONFIG_MASK) -#define GPIO_PIN7_CONFIG_RESET 2'h0 -#define GPIO_PIN7_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN7_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN7_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN7_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN7_WAKEUP_ENABLE_MASK) >> GPIO_PIN7_WAKEUP_ENABLE_LSB) -#define GPIO_PIN7_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN7_WAKEUP_ENABLE_LSB) & GPIO_PIN7_WAKEUP_ENABLE_MASK) -#define GPIO_PIN7_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN7_INT_TYPE_MSB 9 -#define GPIO_PIN7_INT_TYPE_LSB 7 -#define GPIO_PIN7_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN7_INT_TYPE_GET(x) (((x) & GPIO_PIN7_INT_TYPE_MASK) >> GPIO_PIN7_INT_TYPE_LSB) -#define GPIO_PIN7_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN7_INT_TYPE_LSB) & GPIO_PIN7_INT_TYPE_MASK) -#define GPIO_PIN7_INT_TYPE_RESET 3'h0 -#define GPIO_PIN7_PAD_DRIVER_MSB 2 -#define GPIO_PIN7_PAD_DRIVER_LSB 2 -#define GPIO_PIN7_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN7_PAD_DRIVER_GET(x) (((x) & GPIO_PIN7_PAD_DRIVER_MASK) >> GPIO_PIN7_PAD_DRIVER_LSB) -#define GPIO_PIN7_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN7_PAD_DRIVER_LSB) & GPIO_PIN7_PAD_DRIVER_MASK) -#define GPIO_PIN7_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN7_SOURCE_MSB 0 -#define GPIO_PIN7_SOURCE_LSB 0 -#define GPIO_PIN7_SOURCE_MASK 'h00000001 -#define GPIO_PIN7_SOURCE_GET(x) (((x) & GPIO_PIN7_SOURCE_MASK) >> GPIO_PIN7_SOURCE_LSB) -#define GPIO_PIN7_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN7_SOURCE_LSB) & GPIO_PIN7_SOURCE_MASK) -#define GPIO_PIN7_SOURCE_RESET 1'h0 -#define GPIO_PIN7_RESET (32'h0 | \ - GPIO_PIN7_CONFIG_SET(GPIO_PIN7_CONFIG_RESET) | \ - GPIO_PIN7_WAKEUP_ENABLE_SET(GPIO_PIN7_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN7_INT_TYPE_SET(GPIO_PIN7_INT_TYPE_RESET) | \ - GPIO_PIN7_PAD_DRIVER_SET(GPIO_PIN7_PAD_DRIVER_RESET) | \ - GPIO_PIN7_SOURCE_SET(GPIO_PIN7_SOURCE_RESET)) -#define GPIO_PIN7_HW_MASK (32'h0) -#define GPIO_PIN7_SW_MASK (32'h0 | \ - GPIO_PIN7_CONFIG_MASK | \ - GPIO_PIN7_WAKEUP_ENABLE_MASK | \ - GPIO_PIN7_INT_TYPE_MASK | \ - GPIO_PIN7_PAD_DRIVER_MASK | \ - GPIO_PIN7_SOURCE_MASK) - -#define GPIO_PIN8_ADDRESS 'h00000048 -#define GPIO_PIN8_CONFIG_MSB 12 -#define GPIO_PIN8_CONFIG_LSB 11 -#define GPIO_PIN8_CONFIG_MASK 'h00001800 -#define GPIO_PIN8_CONFIG_GET(x) (((x) & GPIO_PIN8_CONFIG_MASK) >> GPIO_PIN8_CONFIG_LSB) -#define GPIO_PIN8_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN8_CONFIG_LSB) & GPIO_PIN8_CONFIG_MASK) -#define GPIO_PIN8_CONFIG_RESET 2'h0 -#define GPIO_PIN8_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN8_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN8_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN8_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN8_WAKEUP_ENABLE_MASK) >> GPIO_PIN8_WAKEUP_ENABLE_LSB) -#define GPIO_PIN8_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN8_WAKEUP_ENABLE_LSB) & GPIO_PIN8_WAKEUP_ENABLE_MASK) -#define GPIO_PIN8_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN8_INT_TYPE_MSB 9 -#define GPIO_PIN8_INT_TYPE_LSB 7 -#define GPIO_PIN8_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN8_INT_TYPE_GET(x) (((x) & GPIO_PIN8_INT_TYPE_MASK) >> GPIO_PIN8_INT_TYPE_LSB) -#define GPIO_PIN8_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN8_INT_TYPE_LSB) & GPIO_PIN8_INT_TYPE_MASK) -#define GPIO_PIN8_INT_TYPE_RESET 3'h0 -#define GPIO_PIN8_PAD_DRIVER_MSB 2 -#define GPIO_PIN8_PAD_DRIVER_LSB 2 -#define GPIO_PIN8_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN8_PAD_DRIVER_GET(x) (((x) & GPIO_PIN8_PAD_DRIVER_MASK) >> GPIO_PIN8_PAD_DRIVER_LSB) -#define GPIO_PIN8_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN8_PAD_DRIVER_LSB) & GPIO_PIN8_PAD_DRIVER_MASK) -#define GPIO_PIN8_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN8_SOURCE_MSB 0 -#define GPIO_PIN8_SOURCE_LSB 0 -#define GPIO_PIN8_SOURCE_MASK 'h00000001 -#define GPIO_PIN8_SOURCE_GET(x) (((x) & GPIO_PIN8_SOURCE_MASK) >> GPIO_PIN8_SOURCE_LSB) -#define GPIO_PIN8_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN8_SOURCE_LSB) & GPIO_PIN8_SOURCE_MASK) -#define GPIO_PIN8_SOURCE_RESET 1'h0 -#define GPIO_PIN8_RESET (32'h0 | \ - GPIO_PIN8_CONFIG_SET(GPIO_PIN8_CONFIG_RESET) | \ - GPIO_PIN8_WAKEUP_ENABLE_SET(GPIO_PIN8_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN8_INT_TYPE_SET(GPIO_PIN8_INT_TYPE_RESET) | \ - GPIO_PIN8_PAD_DRIVER_SET(GPIO_PIN8_PAD_DRIVER_RESET) | \ - GPIO_PIN8_SOURCE_SET(GPIO_PIN8_SOURCE_RESET)) -#define GPIO_PIN8_HW_MASK (32'h0) -#define GPIO_PIN8_SW_MASK (32'h0 | \ - GPIO_PIN8_CONFIG_MASK | \ - GPIO_PIN8_WAKEUP_ENABLE_MASK | \ - GPIO_PIN8_INT_TYPE_MASK | \ - GPIO_PIN8_PAD_DRIVER_MASK | \ - GPIO_PIN8_SOURCE_MASK) - -#define GPIO_PIN9_ADDRESS 'h0000004c -#define GPIO_PIN9_CONFIG_MSB 12 -#define GPIO_PIN9_CONFIG_LSB 11 -#define GPIO_PIN9_CONFIG_MASK 'h00001800 -#define GPIO_PIN9_CONFIG_GET(x) (((x) & GPIO_PIN9_CONFIG_MASK) >> GPIO_PIN9_CONFIG_LSB) -#define GPIO_PIN9_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN9_CONFIG_LSB) & GPIO_PIN9_CONFIG_MASK) -#define GPIO_PIN9_CONFIG_RESET 2'h0 -#define GPIO_PIN9_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN9_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN9_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN9_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN9_WAKEUP_ENABLE_MASK) >> GPIO_PIN9_WAKEUP_ENABLE_LSB) -#define GPIO_PIN9_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN9_WAKEUP_ENABLE_LSB) & GPIO_PIN9_WAKEUP_ENABLE_MASK) -#define GPIO_PIN9_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN9_INT_TYPE_MSB 9 -#define GPIO_PIN9_INT_TYPE_LSB 7 -#define GPIO_PIN9_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN9_INT_TYPE_GET(x) (((x) & GPIO_PIN9_INT_TYPE_MASK) >> GPIO_PIN9_INT_TYPE_LSB) -#define GPIO_PIN9_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN9_INT_TYPE_LSB) & GPIO_PIN9_INT_TYPE_MASK) -#define GPIO_PIN9_INT_TYPE_RESET 3'h0 -#define GPIO_PIN9_PAD_DRIVER_MSB 2 -#define GPIO_PIN9_PAD_DRIVER_LSB 2 -#define GPIO_PIN9_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN9_PAD_DRIVER_GET(x) (((x) & GPIO_PIN9_PAD_DRIVER_MASK) >> GPIO_PIN9_PAD_DRIVER_LSB) -#define GPIO_PIN9_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN9_PAD_DRIVER_LSB) & GPIO_PIN9_PAD_DRIVER_MASK) -#define GPIO_PIN9_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN9_SOURCE_MSB 0 -#define GPIO_PIN9_SOURCE_LSB 0 -#define GPIO_PIN9_SOURCE_MASK 'h00000001 -#define GPIO_PIN9_SOURCE_GET(x) (((x) & GPIO_PIN9_SOURCE_MASK) >> GPIO_PIN9_SOURCE_LSB) -#define GPIO_PIN9_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN9_SOURCE_LSB) & GPIO_PIN9_SOURCE_MASK) -#define GPIO_PIN9_SOURCE_RESET 1'h0 -#define GPIO_PIN9_RESET (32'h0 | \ - GPIO_PIN9_CONFIG_SET(GPIO_PIN9_CONFIG_RESET) | \ - GPIO_PIN9_WAKEUP_ENABLE_SET(GPIO_PIN9_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN9_INT_TYPE_SET(GPIO_PIN9_INT_TYPE_RESET) | \ - GPIO_PIN9_PAD_DRIVER_SET(GPIO_PIN9_PAD_DRIVER_RESET) | \ - GPIO_PIN9_SOURCE_SET(GPIO_PIN9_SOURCE_RESET)) -#define GPIO_PIN9_HW_MASK (32'h0) -#define GPIO_PIN9_SW_MASK (32'h0 | \ - GPIO_PIN9_CONFIG_MASK | \ - GPIO_PIN9_WAKEUP_ENABLE_MASK | \ - GPIO_PIN9_INT_TYPE_MASK | \ - GPIO_PIN9_PAD_DRIVER_MASK | \ - GPIO_PIN9_SOURCE_MASK) - -#define GPIO_PIN10_ADDRESS 'h00000050 -#define GPIO_PIN10_CONFIG_MSB 12 -#define GPIO_PIN10_CONFIG_LSB 11 -#define GPIO_PIN10_CONFIG_MASK 'h00001800 -#define GPIO_PIN10_CONFIG_GET(x) (((x) & GPIO_PIN10_CONFIG_MASK) >> GPIO_PIN10_CONFIG_LSB) -#define GPIO_PIN10_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN10_CONFIG_LSB) & GPIO_PIN10_CONFIG_MASK) -#define GPIO_PIN10_CONFIG_RESET 2'h0 -#define GPIO_PIN10_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN10_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN10_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN10_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN10_WAKEUP_ENABLE_MASK) >> GPIO_PIN10_WAKEUP_ENABLE_LSB) -#define GPIO_PIN10_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN10_WAKEUP_ENABLE_LSB) & GPIO_PIN10_WAKEUP_ENABLE_MASK) -#define GPIO_PIN10_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN10_INT_TYPE_MSB 9 -#define GPIO_PIN10_INT_TYPE_LSB 7 -#define GPIO_PIN10_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN10_INT_TYPE_GET(x) (((x) & GPIO_PIN10_INT_TYPE_MASK) >> GPIO_PIN10_INT_TYPE_LSB) -#define GPIO_PIN10_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN10_INT_TYPE_LSB) & GPIO_PIN10_INT_TYPE_MASK) -#define GPIO_PIN10_INT_TYPE_RESET 3'h0 -#define GPIO_PIN10_PAD_DRIVER_MSB 2 -#define GPIO_PIN10_PAD_DRIVER_LSB 2 -#define GPIO_PIN10_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN10_PAD_DRIVER_GET(x) (((x) & GPIO_PIN10_PAD_DRIVER_MASK) >> GPIO_PIN10_PAD_DRIVER_LSB) -#define GPIO_PIN10_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN10_PAD_DRIVER_LSB) & GPIO_PIN10_PAD_DRIVER_MASK) -#define GPIO_PIN10_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN10_SOURCE_MSB 0 -#define GPIO_PIN10_SOURCE_LSB 0 -#define GPIO_PIN10_SOURCE_MASK 'h00000001 -#define GPIO_PIN10_SOURCE_GET(x) (((x) & GPIO_PIN10_SOURCE_MASK) >> GPIO_PIN10_SOURCE_LSB) -#define GPIO_PIN10_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN10_SOURCE_LSB) & GPIO_PIN10_SOURCE_MASK) -#define GPIO_PIN10_SOURCE_RESET 1'h0 -#define GPIO_PIN10_RESET (32'h0 | \ - GPIO_PIN10_CONFIG_SET(GPIO_PIN10_CONFIG_RESET) | \ - GPIO_PIN10_WAKEUP_ENABLE_SET(GPIO_PIN10_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN10_INT_TYPE_SET(GPIO_PIN10_INT_TYPE_RESET) | \ - GPIO_PIN10_PAD_DRIVER_SET(GPIO_PIN10_PAD_DRIVER_RESET) | \ - GPIO_PIN10_SOURCE_SET(GPIO_PIN10_SOURCE_RESET)) -#define GPIO_PIN10_HW_MASK (32'h0) -#define GPIO_PIN10_SW_MASK (32'h0 | \ - GPIO_PIN10_CONFIG_MASK | \ - GPIO_PIN10_WAKEUP_ENABLE_MASK | \ - GPIO_PIN10_INT_TYPE_MASK | \ - GPIO_PIN10_PAD_DRIVER_MASK | \ - GPIO_PIN10_SOURCE_MASK) - -#define GPIO_PIN11_ADDRESS 'h00000054 -#define GPIO_PIN11_CONFIG_MSB 12 -#define GPIO_PIN11_CONFIG_LSB 11 -#define GPIO_PIN11_CONFIG_MASK 'h00001800 -#define GPIO_PIN11_CONFIG_GET(x) (((x) & GPIO_PIN11_CONFIG_MASK) >> GPIO_PIN11_CONFIG_LSB) -#define GPIO_PIN11_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN11_CONFIG_LSB) & GPIO_PIN11_CONFIG_MASK) -#define GPIO_PIN11_CONFIG_RESET 2'h0 -#define GPIO_PIN11_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN11_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN11_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN11_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN11_WAKEUP_ENABLE_MASK) >> GPIO_PIN11_WAKEUP_ENABLE_LSB) -#define GPIO_PIN11_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN11_WAKEUP_ENABLE_LSB) & GPIO_PIN11_WAKEUP_ENABLE_MASK) -#define GPIO_PIN11_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN11_INT_TYPE_MSB 9 -#define GPIO_PIN11_INT_TYPE_LSB 7 -#define GPIO_PIN11_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN11_INT_TYPE_GET(x) (((x) & GPIO_PIN11_INT_TYPE_MASK) >> GPIO_PIN11_INT_TYPE_LSB) -#define GPIO_PIN11_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN11_INT_TYPE_LSB) & GPIO_PIN11_INT_TYPE_MASK) -#define GPIO_PIN11_INT_TYPE_RESET 3'h0 -#define GPIO_PIN11_PAD_DRIVER_MSB 2 -#define GPIO_PIN11_PAD_DRIVER_LSB 2 -#define GPIO_PIN11_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN11_PAD_DRIVER_GET(x) (((x) & GPIO_PIN11_PAD_DRIVER_MASK) >> GPIO_PIN11_PAD_DRIVER_LSB) -#define GPIO_PIN11_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN11_PAD_DRIVER_LSB) & GPIO_PIN11_PAD_DRIVER_MASK) -#define GPIO_PIN11_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN11_SOURCE_MSB 0 -#define GPIO_PIN11_SOURCE_LSB 0 -#define GPIO_PIN11_SOURCE_MASK 'h00000001 -#define GPIO_PIN11_SOURCE_GET(x) (((x) & GPIO_PIN11_SOURCE_MASK) >> GPIO_PIN11_SOURCE_LSB) -#define GPIO_PIN11_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN11_SOURCE_LSB) & GPIO_PIN11_SOURCE_MASK) -#define GPIO_PIN11_SOURCE_RESET 1'h0 -#define GPIO_PIN11_RESET (32'h0 | \ - GPIO_PIN11_CONFIG_SET(GPIO_PIN11_CONFIG_RESET) | \ - GPIO_PIN11_WAKEUP_ENABLE_SET(GPIO_PIN11_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN11_INT_TYPE_SET(GPIO_PIN11_INT_TYPE_RESET) | \ - GPIO_PIN11_PAD_DRIVER_SET(GPIO_PIN11_PAD_DRIVER_RESET) | \ - GPIO_PIN11_SOURCE_SET(GPIO_PIN11_SOURCE_RESET)) -#define GPIO_PIN11_HW_MASK (32'h0) -#define GPIO_PIN11_SW_MASK (32'h0 | \ - GPIO_PIN11_CONFIG_MASK | \ - GPIO_PIN11_WAKEUP_ENABLE_MASK | \ - GPIO_PIN11_INT_TYPE_MASK | \ - GPIO_PIN11_PAD_DRIVER_MASK | \ - GPIO_PIN11_SOURCE_MASK) - -#define GPIO_PIN12_ADDRESS 'h00000058 -#define GPIO_PIN12_CONFIG_MSB 12 -#define GPIO_PIN12_CONFIG_LSB 11 -#define GPIO_PIN12_CONFIG_MASK 'h00001800 -#define GPIO_PIN12_CONFIG_GET(x) (((x) & GPIO_PIN12_CONFIG_MASK) >> GPIO_PIN12_CONFIG_LSB) -#define GPIO_PIN12_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN12_CONFIG_LSB) & GPIO_PIN12_CONFIG_MASK) -#define GPIO_PIN12_CONFIG_RESET 2'h0 -#define GPIO_PIN12_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN12_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN12_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN12_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN12_WAKEUP_ENABLE_MASK) >> GPIO_PIN12_WAKEUP_ENABLE_LSB) -#define GPIO_PIN12_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN12_WAKEUP_ENABLE_LSB) & GPIO_PIN12_WAKEUP_ENABLE_MASK) -#define GPIO_PIN12_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN12_INT_TYPE_MSB 9 -#define GPIO_PIN12_INT_TYPE_LSB 7 -#define GPIO_PIN12_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN12_INT_TYPE_GET(x) (((x) & GPIO_PIN12_INT_TYPE_MASK) >> GPIO_PIN12_INT_TYPE_LSB) -#define GPIO_PIN12_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN12_INT_TYPE_LSB) & GPIO_PIN12_INT_TYPE_MASK) -#define GPIO_PIN12_INT_TYPE_RESET 3'h0 -#define GPIO_PIN12_PAD_DRIVER_MSB 2 -#define GPIO_PIN12_PAD_DRIVER_LSB 2 -#define GPIO_PIN12_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN12_PAD_DRIVER_GET(x) (((x) & GPIO_PIN12_PAD_DRIVER_MASK) >> GPIO_PIN12_PAD_DRIVER_LSB) -#define GPIO_PIN12_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN12_PAD_DRIVER_LSB) & GPIO_PIN12_PAD_DRIVER_MASK) -#define GPIO_PIN12_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN12_SOURCE_MSB 0 -#define GPIO_PIN12_SOURCE_LSB 0 -#define GPIO_PIN12_SOURCE_MASK 'h00000001 -#define GPIO_PIN12_SOURCE_GET(x) (((x) & GPIO_PIN12_SOURCE_MASK) >> GPIO_PIN12_SOURCE_LSB) -#define GPIO_PIN12_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN12_SOURCE_LSB) & GPIO_PIN12_SOURCE_MASK) -#define GPIO_PIN12_SOURCE_RESET 1'h0 -#define GPIO_PIN12_RESET (32'h0 | \ - GPIO_PIN12_CONFIG_SET(GPIO_PIN12_CONFIG_RESET) | \ - GPIO_PIN12_WAKEUP_ENABLE_SET(GPIO_PIN12_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN12_INT_TYPE_SET(GPIO_PIN12_INT_TYPE_RESET) | \ - GPIO_PIN12_PAD_DRIVER_SET(GPIO_PIN12_PAD_DRIVER_RESET) | \ - GPIO_PIN12_SOURCE_SET(GPIO_PIN12_SOURCE_RESET)) -#define GPIO_PIN12_HW_MASK (32'h0) -#define GPIO_PIN12_SW_MASK (32'h0 | \ - GPIO_PIN12_CONFIG_MASK | \ - GPIO_PIN12_WAKEUP_ENABLE_MASK | \ - GPIO_PIN12_INT_TYPE_MASK | \ - GPIO_PIN12_PAD_DRIVER_MASK | \ - GPIO_PIN12_SOURCE_MASK) - -#define GPIO_PIN13_ADDRESS 'h0000005c -#define GPIO_PIN13_CONFIG_MSB 12 -#define GPIO_PIN13_CONFIG_LSB 11 -#define GPIO_PIN13_CONFIG_MASK 'h00001800 -#define GPIO_PIN13_CONFIG_GET(x) (((x) & GPIO_PIN13_CONFIG_MASK) >> GPIO_PIN13_CONFIG_LSB) -#define GPIO_PIN13_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN13_CONFIG_LSB) & GPIO_PIN13_CONFIG_MASK) -#define GPIO_PIN13_CONFIG_RESET 2'h0 -#define GPIO_PIN13_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN13_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN13_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN13_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN13_WAKEUP_ENABLE_MASK) >> GPIO_PIN13_WAKEUP_ENABLE_LSB) -#define GPIO_PIN13_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN13_WAKEUP_ENABLE_LSB) & GPIO_PIN13_WAKEUP_ENABLE_MASK) -#define GPIO_PIN13_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN13_INT_TYPE_MSB 9 -#define GPIO_PIN13_INT_TYPE_LSB 7 -#define GPIO_PIN13_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN13_INT_TYPE_GET(x) (((x) & GPIO_PIN13_INT_TYPE_MASK) >> GPIO_PIN13_INT_TYPE_LSB) -#define GPIO_PIN13_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN13_INT_TYPE_LSB) & GPIO_PIN13_INT_TYPE_MASK) -#define GPIO_PIN13_INT_TYPE_RESET 3'h0 -#define GPIO_PIN13_PAD_DRIVER_MSB 2 -#define GPIO_PIN13_PAD_DRIVER_LSB 2 -#define GPIO_PIN13_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN13_PAD_DRIVER_GET(x) (((x) & GPIO_PIN13_PAD_DRIVER_MASK) >> GPIO_PIN13_PAD_DRIVER_LSB) -#define GPIO_PIN13_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN13_PAD_DRIVER_LSB) & GPIO_PIN13_PAD_DRIVER_MASK) -#define GPIO_PIN13_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN13_SOURCE_MSB 0 -#define GPIO_PIN13_SOURCE_LSB 0 -#define GPIO_PIN13_SOURCE_MASK 'h00000001 -#define GPIO_PIN13_SOURCE_GET(x) (((x) & GPIO_PIN13_SOURCE_MASK) >> GPIO_PIN13_SOURCE_LSB) -#define GPIO_PIN13_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN13_SOURCE_LSB) & GPIO_PIN13_SOURCE_MASK) -#define GPIO_PIN13_SOURCE_RESET 1'h0 -#define GPIO_PIN13_RESET (32'h0 | \ - GPIO_PIN13_CONFIG_SET(GPIO_PIN13_CONFIG_RESET) | \ - GPIO_PIN13_WAKEUP_ENABLE_SET(GPIO_PIN13_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN13_INT_TYPE_SET(GPIO_PIN13_INT_TYPE_RESET) | \ - GPIO_PIN13_PAD_DRIVER_SET(GPIO_PIN13_PAD_DRIVER_RESET) | \ - GPIO_PIN13_SOURCE_SET(GPIO_PIN13_SOURCE_RESET)) -#define GPIO_PIN13_HW_MASK (32'h0) -#define GPIO_PIN13_SW_MASK (32'h0 | \ - GPIO_PIN13_CONFIG_MASK | \ - GPIO_PIN13_WAKEUP_ENABLE_MASK | \ - GPIO_PIN13_INT_TYPE_MASK | \ - GPIO_PIN13_PAD_DRIVER_MASK | \ - GPIO_PIN13_SOURCE_MASK) - -#define GPIO_PIN14_ADDRESS 'h00000060 -#define GPIO_PIN14_CONFIG_MSB 12 -#define GPIO_PIN14_CONFIG_LSB 11 -#define GPIO_PIN14_CONFIG_MASK 'h00001800 -#define GPIO_PIN14_CONFIG_GET(x) (((x) & GPIO_PIN14_CONFIG_MASK) >> GPIO_PIN14_CONFIG_LSB) -#define GPIO_PIN14_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN14_CONFIG_LSB) & GPIO_PIN14_CONFIG_MASK) -#define GPIO_PIN14_CONFIG_RESET 2'h0 -#define GPIO_PIN14_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN14_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN14_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN14_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN14_WAKEUP_ENABLE_MASK) >> GPIO_PIN14_WAKEUP_ENABLE_LSB) -#define GPIO_PIN14_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN14_WAKEUP_ENABLE_LSB) & GPIO_PIN14_WAKEUP_ENABLE_MASK) -#define GPIO_PIN14_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN14_INT_TYPE_MSB 9 -#define GPIO_PIN14_INT_TYPE_LSB 7 -#define GPIO_PIN14_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN14_INT_TYPE_GET(x) (((x) & GPIO_PIN14_INT_TYPE_MASK) >> GPIO_PIN14_INT_TYPE_LSB) -#define GPIO_PIN14_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN14_INT_TYPE_LSB) & GPIO_PIN14_INT_TYPE_MASK) -#define GPIO_PIN14_INT_TYPE_RESET 3'h0 -#define GPIO_PIN14_PAD_DRIVER_MSB 2 -#define GPIO_PIN14_PAD_DRIVER_LSB 2 -#define GPIO_PIN14_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN14_PAD_DRIVER_GET(x) (((x) & GPIO_PIN14_PAD_DRIVER_MASK) >> GPIO_PIN14_PAD_DRIVER_LSB) -#define GPIO_PIN14_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN14_PAD_DRIVER_LSB) & GPIO_PIN14_PAD_DRIVER_MASK) -#define GPIO_PIN14_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN14_SOURCE_MSB 0 -#define GPIO_PIN14_SOURCE_LSB 0 -#define GPIO_PIN14_SOURCE_MASK 'h00000001 -#define GPIO_PIN14_SOURCE_GET(x) (((x) & GPIO_PIN14_SOURCE_MASK) >> GPIO_PIN14_SOURCE_LSB) -#define GPIO_PIN14_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN14_SOURCE_LSB) & GPIO_PIN14_SOURCE_MASK) -#define GPIO_PIN14_SOURCE_RESET 1'h0 -#define GPIO_PIN14_RESET (32'h0 | \ - GPIO_PIN14_CONFIG_SET(GPIO_PIN14_CONFIG_RESET) | \ - GPIO_PIN14_WAKEUP_ENABLE_SET(GPIO_PIN14_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN14_INT_TYPE_SET(GPIO_PIN14_INT_TYPE_RESET) | \ - GPIO_PIN14_PAD_DRIVER_SET(GPIO_PIN14_PAD_DRIVER_RESET) | \ - GPIO_PIN14_SOURCE_SET(GPIO_PIN14_SOURCE_RESET)) -#define GPIO_PIN14_HW_MASK (32'h0) -#define GPIO_PIN14_SW_MASK (32'h0 | \ - GPIO_PIN14_CONFIG_MASK | \ - GPIO_PIN14_WAKEUP_ENABLE_MASK | \ - GPIO_PIN14_INT_TYPE_MASK | \ - GPIO_PIN14_PAD_DRIVER_MASK | \ - GPIO_PIN14_SOURCE_MASK) - -#define GPIO_PIN15_ADDRESS 'h00000064 -#define GPIO_PIN15_CONFIG_MSB 12 -#define GPIO_PIN15_CONFIG_LSB 11 -#define GPIO_PIN15_CONFIG_MASK 'h00001800 -#define GPIO_PIN15_CONFIG_GET(x) (((x) & GPIO_PIN15_CONFIG_MASK) >> GPIO_PIN15_CONFIG_LSB) -#define GPIO_PIN15_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN15_CONFIG_LSB) & GPIO_PIN15_CONFIG_MASK) -#define GPIO_PIN15_CONFIG_RESET 2'h0 -#define GPIO_PIN15_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN15_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN15_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN15_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN15_WAKEUP_ENABLE_MASK) >> GPIO_PIN15_WAKEUP_ENABLE_LSB) -#define GPIO_PIN15_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN15_WAKEUP_ENABLE_LSB) & GPIO_PIN15_WAKEUP_ENABLE_MASK) -#define GPIO_PIN15_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN15_INT_TYPE_MSB 9 -#define GPIO_PIN15_INT_TYPE_LSB 7 -#define GPIO_PIN15_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN15_INT_TYPE_GET(x) (((x) & GPIO_PIN15_INT_TYPE_MASK) >> GPIO_PIN15_INT_TYPE_LSB) -#define GPIO_PIN15_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN15_INT_TYPE_LSB) & GPIO_PIN15_INT_TYPE_MASK) -#define GPIO_PIN15_INT_TYPE_RESET 3'h0 -#define GPIO_PIN15_PAD_DRIVER_MSB 2 -#define GPIO_PIN15_PAD_DRIVER_LSB 2 -#define GPIO_PIN15_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN15_PAD_DRIVER_GET(x) (((x) & GPIO_PIN15_PAD_DRIVER_MASK) >> GPIO_PIN15_PAD_DRIVER_LSB) -#define GPIO_PIN15_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN15_PAD_DRIVER_LSB) & GPIO_PIN15_PAD_DRIVER_MASK) -#define GPIO_PIN15_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN15_SOURCE_MSB 0 -#define GPIO_PIN15_SOURCE_LSB 0 -#define GPIO_PIN15_SOURCE_MASK 'h00000001 -#define GPIO_PIN15_SOURCE_GET(x) (((x) & GPIO_PIN15_SOURCE_MASK) >> GPIO_PIN15_SOURCE_LSB) -#define GPIO_PIN15_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN15_SOURCE_LSB) & GPIO_PIN15_SOURCE_MASK) -#define GPIO_PIN15_SOURCE_RESET 1'h0 -#define GPIO_PIN15_RESET (32'h0 | \ - GPIO_PIN15_CONFIG_SET(GPIO_PIN15_CONFIG_RESET) | \ - GPIO_PIN15_WAKEUP_ENABLE_SET(GPIO_PIN15_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN15_INT_TYPE_SET(GPIO_PIN15_INT_TYPE_RESET) | \ - GPIO_PIN15_PAD_DRIVER_SET(GPIO_PIN15_PAD_DRIVER_RESET) | \ - GPIO_PIN15_SOURCE_SET(GPIO_PIN15_SOURCE_RESET)) -#define GPIO_PIN15_HW_MASK (32'h0) -#define GPIO_PIN15_SW_MASK (32'h0 | \ - GPIO_PIN15_CONFIG_MASK | \ - GPIO_PIN15_WAKEUP_ENABLE_MASK | \ - GPIO_PIN15_INT_TYPE_MASK | \ - GPIO_PIN15_PAD_DRIVER_MASK | \ - GPIO_PIN15_SOURCE_MASK) - -#define GPIO_PIN16_ADDRESS 'h00000068 -#define GPIO_PIN16_CONFIG_MSB 12 -#define GPIO_PIN16_CONFIG_LSB 11 -#define GPIO_PIN16_CONFIG_MASK 'h00001800 -#define GPIO_PIN16_CONFIG_GET(x) (((x) & GPIO_PIN16_CONFIG_MASK) >> GPIO_PIN16_CONFIG_LSB) -#define GPIO_PIN16_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN16_CONFIG_LSB) & GPIO_PIN16_CONFIG_MASK) -#define GPIO_PIN16_CONFIG_RESET 2'h0 -#define GPIO_PIN16_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN16_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN16_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN16_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN16_WAKEUP_ENABLE_MASK) >> GPIO_PIN16_WAKEUP_ENABLE_LSB) -#define GPIO_PIN16_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN16_WAKEUP_ENABLE_LSB) & GPIO_PIN16_WAKEUP_ENABLE_MASK) -#define GPIO_PIN16_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN16_INT_TYPE_MSB 9 -#define GPIO_PIN16_INT_TYPE_LSB 7 -#define GPIO_PIN16_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN16_INT_TYPE_GET(x) (((x) & GPIO_PIN16_INT_TYPE_MASK) >> GPIO_PIN16_INT_TYPE_LSB) -#define GPIO_PIN16_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN16_INT_TYPE_LSB) & GPIO_PIN16_INT_TYPE_MASK) -#define GPIO_PIN16_INT_TYPE_RESET 3'h0 -#define GPIO_PIN16_PAD_DRIVER_MSB 2 -#define GPIO_PIN16_PAD_DRIVER_LSB 2 -#define GPIO_PIN16_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN16_PAD_DRIVER_GET(x) (((x) & GPIO_PIN16_PAD_DRIVER_MASK) >> GPIO_PIN16_PAD_DRIVER_LSB) -#define GPIO_PIN16_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN16_PAD_DRIVER_LSB) & GPIO_PIN16_PAD_DRIVER_MASK) -#define GPIO_PIN16_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN16_SOURCE_MSB 0 -#define GPIO_PIN16_SOURCE_LSB 0 -#define GPIO_PIN16_SOURCE_MASK 'h00000001 -#define GPIO_PIN16_SOURCE_GET(x) (((x) & GPIO_PIN16_SOURCE_MASK) >> GPIO_PIN16_SOURCE_LSB) -#define GPIO_PIN16_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN16_SOURCE_LSB) & GPIO_PIN16_SOURCE_MASK) -#define GPIO_PIN16_SOURCE_RESET 1'h0 -#define GPIO_PIN16_RESET (32'h0 | \ - GPIO_PIN16_CONFIG_SET(GPIO_PIN16_CONFIG_RESET) | \ - GPIO_PIN16_WAKEUP_ENABLE_SET(GPIO_PIN16_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN16_INT_TYPE_SET(GPIO_PIN16_INT_TYPE_RESET) | \ - GPIO_PIN16_PAD_DRIVER_SET(GPIO_PIN16_PAD_DRIVER_RESET) | \ - GPIO_PIN16_SOURCE_SET(GPIO_PIN16_SOURCE_RESET)) -#define GPIO_PIN16_HW_MASK (32'h0) -#define GPIO_PIN16_SW_MASK (32'h0 | \ - GPIO_PIN16_CONFIG_MASK | \ - GPIO_PIN16_WAKEUP_ENABLE_MASK | \ - GPIO_PIN16_INT_TYPE_MASK | \ - GPIO_PIN16_PAD_DRIVER_MASK | \ - GPIO_PIN16_SOURCE_MASK) - -#define GPIO_PIN17_ADDRESS 'h0000006c -#define GPIO_PIN17_CONFIG_MSB 12 -#define GPIO_PIN17_CONFIG_LSB 11 -#define GPIO_PIN17_CONFIG_MASK 'h00001800 -#define GPIO_PIN17_CONFIG_GET(x) (((x) & GPIO_PIN17_CONFIG_MASK) >> GPIO_PIN17_CONFIG_LSB) -#define GPIO_PIN17_CONFIG_SET(x) (((32'd0 | (x)) << GPIO_PIN17_CONFIG_LSB) & GPIO_PIN17_CONFIG_MASK) -#define GPIO_PIN17_CONFIG_RESET 2'h0 -#define GPIO_PIN17_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN17_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN17_WAKEUP_ENABLE_MASK 'h00000400 -#define GPIO_PIN17_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN17_WAKEUP_ENABLE_MASK) >> GPIO_PIN17_WAKEUP_ENABLE_LSB) -#define GPIO_PIN17_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_PIN17_WAKEUP_ENABLE_LSB) & GPIO_PIN17_WAKEUP_ENABLE_MASK) -#define GPIO_PIN17_WAKEUP_ENABLE_RESET 1'h0 -#define GPIO_PIN17_INT_TYPE_MSB 9 -#define GPIO_PIN17_INT_TYPE_LSB 7 -#define GPIO_PIN17_INT_TYPE_MASK 'h00000380 -#define GPIO_PIN17_INT_TYPE_GET(x) (((x) & GPIO_PIN17_INT_TYPE_MASK) >> GPIO_PIN17_INT_TYPE_LSB) -#define GPIO_PIN17_INT_TYPE_SET(x) (((32'd0 | (x)) << GPIO_PIN17_INT_TYPE_LSB) & GPIO_PIN17_INT_TYPE_MASK) -#define GPIO_PIN17_INT_TYPE_RESET 3'h0 -#define GPIO_PIN17_PAD_DRIVER_MSB 2 -#define GPIO_PIN17_PAD_DRIVER_LSB 2 -#define GPIO_PIN17_PAD_DRIVER_MASK 'h00000004 -#define GPIO_PIN17_PAD_DRIVER_GET(x) (((x) & GPIO_PIN17_PAD_DRIVER_MASK) >> GPIO_PIN17_PAD_DRIVER_LSB) -#define GPIO_PIN17_PAD_DRIVER_SET(x) (((32'd0 | (x)) << GPIO_PIN17_PAD_DRIVER_LSB) & GPIO_PIN17_PAD_DRIVER_MASK) -#define GPIO_PIN17_PAD_DRIVER_RESET 1'h0 -#define GPIO_PIN17_SOURCE_MSB 0 -#define GPIO_PIN17_SOURCE_LSB 0 -#define GPIO_PIN17_SOURCE_MASK 'h00000001 -#define GPIO_PIN17_SOURCE_GET(x) (((x) & GPIO_PIN17_SOURCE_MASK) >> GPIO_PIN17_SOURCE_LSB) -#define GPIO_PIN17_SOURCE_SET(x) (((32'd0 | (x)) << GPIO_PIN17_SOURCE_LSB) & GPIO_PIN17_SOURCE_MASK) -#define GPIO_PIN17_SOURCE_RESET 1'h0 -#define GPIO_PIN17_RESET (32'h0 | \ - GPIO_PIN17_CONFIG_SET(GPIO_PIN17_CONFIG_RESET) | \ - GPIO_PIN17_WAKEUP_ENABLE_SET(GPIO_PIN17_WAKEUP_ENABLE_RESET) | \ - GPIO_PIN17_INT_TYPE_SET(GPIO_PIN17_INT_TYPE_RESET) | \ - GPIO_PIN17_PAD_DRIVER_SET(GPIO_PIN17_PAD_DRIVER_RESET) | \ - GPIO_PIN17_SOURCE_SET(GPIO_PIN17_SOURCE_RESET)) -#define GPIO_PIN17_HW_MASK (32'h0) -#define GPIO_PIN17_SW_MASK (32'h0 | \ - GPIO_PIN17_CONFIG_MASK | \ - GPIO_PIN17_WAKEUP_ENABLE_MASK | \ - GPIO_PIN17_INT_TYPE_MASK | \ - GPIO_PIN17_PAD_DRIVER_MASK | \ - GPIO_PIN17_SOURCE_MASK) - -#define SDIO_PIN_ADDRESS 'h00000070 -#define SDIO_PIN_PAD_PULL_MSB 3 -#define SDIO_PIN_PAD_PULL_LSB 2 -#define SDIO_PIN_PAD_PULL_MASK 'h0000000c -#define SDIO_PIN_PAD_PULL_GET(x) (((x) & SDIO_PIN_PAD_PULL_MASK) >> SDIO_PIN_PAD_PULL_LSB) -#define SDIO_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << SDIO_PIN_PAD_PULL_LSB) & SDIO_PIN_PAD_PULL_MASK) -#define SDIO_PIN_PAD_PULL_RESET 2'h1 -#define SDIO_PIN_PAD_STRENGTH_MSB 1 -#define SDIO_PIN_PAD_STRENGTH_LSB 0 -#define SDIO_PIN_PAD_STRENGTH_MASK 'h00000003 -#define SDIO_PIN_PAD_STRENGTH_GET(x) (((x) & SDIO_PIN_PAD_STRENGTH_MASK) >> SDIO_PIN_PAD_STRENGTH_LSB) -#define SDIO_PIN_PAD_STRENGTH_SET(x) (((32'd0 | (x)) << SDIO_PIN_PAD_STRENGTH_LSB) & SDIO_PIN_PAD_STRENGTH_MASK) -#define SDIO_PIN_PAD_STRENGTH_RESET 2'h1 -#define SDIO_PIN_RESET (32'h0 | \ - SDIO_PIN_PAD_PULL_SET(SDIO_PIN_PAD_PULL_RESET) | \ - SDIO_PIN_PAD_STRENGTH_SET(SDIO_PIN_PAD_STRENGTH_RESET)) -#define SDIO_PIN_HW_MASK (32'h0) -#define SDIO_PIN_SW_MASK (32'h0 | \ - SDIO_PIN_PAD_PULL_MASK | \ - SDIO_PIN_PAD_STRENGTH_MASK) - -#define CLK_REQ_PIN_ADDRESS 'h00000074 -#define CLK_REQ_PIN_ATE_OE_L_MSB 4 -#define CLK_REQ_PIN_ATE_OE_L_LSB 4 -#define CLK_REQ_PIN_ATE_OE_L_MASK 'h00000010 -#define CLK_REQ_PIN_ATE_OE_L_GET(x) (((x) & CLK_REQ_PIN_ATE_OE_L_MASK) >> CLK_REQ_PIN_ATE_OE_L_LSB) -#define CLK_REQ_PIN_ATE_OE_L_SET(x) (((32'd0 | (x)) << CLK_REQ_PIN_ATE_OE_L_LSB) & CLK_REQ_PIN_ATE_OE_L_MASK) -#define CLK_REQ_PIN_ATE_OE_L_RESET 1'h0 -#define CLK_REQ_PIN_PAD_PULL_MSB 3 -#define CLK_REQ_PIN_PAD_PULL_LSB 2 -#define CLK_REQ_PIN_PAD_PULL_MASK 'h0000000c -#define CLK_REQ_PIN_PAD_PULL_GET(x) (((x) & CLK_REQ_PIN_PAD_PULL_MASK) >> CLK_REQ_PIN_PAD_PULL_LSB) -#define CLK_REQ_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << CLK_REQ_PIN_PAD_PULL_LSB) & CLK_REQ_PIN_PAD_PULL_MASK) -#define CLK_REQ_PIN_PAD_PULL_RESET 2'h2 -#define CLK_REQ_PIN_PAD_STRENGTH_MSB 1 -#define CLK_REQ_PIN_PAD_STRENGTH_LSB 0 -#define CLK_REQ_PIN_PAD_STRENGTH_MASK 'h00000003 -#define CLK_REQ_PIN_PAD_STRENGTH_GET(x) (((x) & CLK_REQ_PIN_PAD_STRENGTH_MASK) >> CLK_REQ_PIN_PAD_STRENGTH_LSB) -#define CLK_REQ_PIN_PAD_STRENGTH_SET(x) (((32'd0 | (x)) << CLK_REQ_PIN_PAD_STRENGTH_LSB) & CLK_REQ_PIN_PAD_STRENGTH_MASK) -#define CLK_REQ_PIN_PAD_STRENGTH_RESET 2'h1 -#define CLK_REQ_PIN_RESET (32'h0 | \ - CLK_REQ_PIN_ATE_OE_L_SET(CLK_REQ_PIN_ATE_OE_L_RESET) | \ - CLK_REQ_PIN_PAD_PULL_SET(CLK_REQ_PIN_PAD_PULL_RESET) | \ - CLK_REQ_PIN_PAD_STRENGTH_SET(CLK_REQ_PIN_PAD_STRENGTH_RESET)) -#define CLK_REQ_PIN_HW_MASK (32'h0) -#define CLK_REQ_PIN_SW_MASK (32'h0 | \ - CLK_REQ_PIN_ATE_OE_L_MASK | \ - CLK_REQ_PIN_PAD_PULL_MASK | \ - CLK_REQ_PIN_PAD_STRENGTH_MASK) - -#define SIGMA_DELTA_ADDRESS 'h00000078 -#define SIGMA_DELTA_ENABLE_MSB 16 -#define SIGMA_DELTA_ENABLE_LSB 16 -#define SIGMA_DELTA_ENABLE_MASK 'h00010000 -#define SIGMA_DELTA_ENABLE_GET(x) (((x) & SIGMA_DELTA_ENABLE_MASK) >> SIGMA_DELTA_ENABLE_LSB) -#define SIGMA_DELTA_ENABLE_SET(x) (((32'd0 | (x)) << SIGMA_DELTA_ENABLE_LSB) & SIGMA_DELTA_ENABLE_MASK) -#define SIGMA_DELTA_ENABLE_RESET 1'h0 -#define SIGMA_DELTA_PRESCALAR_MSB 15 -#define SIGMA_DELTA_PRESCALAR_LSB 8 -#define SIGMA_DELTA_PRESCALAR_MASK 'h0000ff00 -#define SIGMA_DELTA_PRESCALAR_GET(x) (((x) & SIGMA_DELTA_PRESCALAR_MASK) >> SIGMA_DELTA_PRESCALAR_LSB) -#define SIGMA_DELTA_PRESCALAR_SET(x) (((32'd0 | (x)) << SIGMA_DELTA_PRESCALAR_LSB) & SIGMA_DELTA_PRESCALAR_MASK) -#define SIGMA_DELTA_PRESCALAR_RESET 8'h0 -#define SIGMA_DELTA_TARGET_MSB 7 -#define SIGMA_DELTA_TARGET_LSB 0 -#define SIGMA_DELTA_TARGET_MASK 'h000000ff -#define SIGMA_DELTA_TARGET_GET(x) (((x) & SIGMA_DELTA_TARGET_MASK) >> SIGMA_DELTA_TARGET_LSB) -#define SIGMA_DELTA_TARGET_SET(x) (((32'd0 | (x)) << SIGMA_DELTA_TARGET_LSB) & SIGMA_DELTA_TARGET_MASK) -#define SIGMA_DELTA_TARGET_RESET 8'h0 -#define SIGMA_DELTA_RESET (32'h0 | \ - SIGMA_DELTA_ENABLE_SET(SIGMA_DELTA_ENABLE_RESET) | \ - SIGMA_DELTA_PRESCALAR_SET(SIGMA_DELTA_PRESCALAR_RESET) | \ - SIGMA_DELTA_TARGET_SET(SIGMA_DELTA_TARGET_RESET)) -#define SIGMA_DELTA_HW_MASK (32'h0) -#define SIGMA_DELTA_SW_MASK (32'h0 | \ - SIGMA_DELTA_ENABLE_MASK | \ - SIGMA_DELTA_PRESCALAR_MASK | \ - SIGMA_DELTA_TARGET_MASK) - -#define DEBUG_CONTROL_ADDRESS 'h0000007c -#define DEBUG_CONTROL_OBS_OE_L_MSB 1 -#define DEBUG_CONTROL_OBS_OE_L_LSB 1 -#define DEBUG_CONTROL_OBS_OE_L_MASK 'h00000002 -#define DEBUG_CONTROL_OBS_OE_L_GET(x) (((x) & DEBUG_CONTROL_OBS_OE_L_MASK) >> DEBUG_CONTROL_OBS_OE_L_LSB) -#define DEBUG_CONTROL_OBS_OE_L_SET(x) (((32'd0 | (x)) << DEBUG_CONTROL_OBS_OE_L_LSB) & DEBUG_CONTROL_OBS_OE_L_MASK) -#define DEBUG_CONTROL_OBS_OE_L_RESET 1'h1 -#define DEBUG_CONTROL_ENABLE_MSB 0 -#define DEBUG_CONTROL_ENABLE_LSB 0 -#define DEBUG_CONTROL_ENABLE_MASK 'h00000001 -#define DEBUG_CONTROL_ENABLE_GET(x) (((x) & DEBUG_CONTROL_ENABLE_MASK) >> DEBUG_CONTROL_ENABLE_LSB) -#define DEBUG_CONTROL_ENABLE_SET(x) (((32'd0 | (x)) << DEBUG_CONTROL_ENABLE_LSB) & DEBUG_CONTROL_ENABLE_MASK) -#define DEBUG_CONTROL_ENABLE_RESET 1'h0 -#define DEBUG_CONTROL_RESET (32'h0 | \ - DEBUG_CONTROL_OBS_OE_L_SET(DEBUG_CONTROL_OBS_OE_L_RESET) | \ - DEBUG_CONTROL_ENABLE_SET(DEBUG_CONTROL_ENABLE_RESET)) -#define DEBUG_CONTROL_HW_MASK (32'h0) -#define DEBUG_CONTROL_SW_MASK (32'h0 | \ - DEBUG_CONTROL_OBS_OE_L_MASK | \ - DEBUG_CONTROL_ENABLE_MASK) - -#define DEBUG_INPUT_SEL_ADDRESS 'h00000080 -#define DEBUG_INPUT_SEL_SRC_MSB 3 -#define DEBUG_INPUT_SEL_SRC_LSB 0 -#define DEBUG_INPUT_SEL_SRC_MASK 'h0000000f -#define DEBUG_INPUT_SEL_SRC_GET(x) (((x) & DEBUG_INPUT_SEL_SRC_MASK) >> DEBUG_INPUT_SEL_SRC_LSB) -#define DEBUG_INPUT_SEL_SRC_SET(x) (((32'd0 | (x)) << DEBUG_INPUT_SEL_SRC_LSB) & DEBUG_INPUT_SEL_SRC_MASK) -#define DEBUG_INPUT_SEL_SRC_RESET 4'h0 -#define DEBUG_INPUT_SEL_RESET (32'h0 | \ - DEBUG_INPUT_SEL_SRC_SET(DEBUG_INPUT_SEL_SRC_RESET)) -#define DEBUG_INPUT_SEL_HW_MASK (32'h0) -#define DEBUG_INPUT_SEL_SW_MASK (32'h0 | \ - DEBUG_INPUT_SEL_SRC_MASK) - -#define DEBUG_OUT_ADDRESS 'h00000084 -#define DEBUG_OUT_DATA_MSB 17 -#define DEBUG_OUT_DATA_LSB 0 -#define DEBUG_OUT_DATA_MASK 'h0003ffff -#define DEBUG_OUT_DATA_GET(x) (((x) & DEBUG_OUT_DATA_MASK) >> DEBUG_OUT_DATA_LSB) -#define DEBUG_OUT_DATA_SET(x) (((32'd0 | (x)) << DEBUG_OUT_DATA_LSB) & DEBUG_OUT_DATA_MASK) -#define DEBUG_OUT_DATA_RESET 18'h0 -#define DEBUG_OUT_RESET (32'h0 | \ - DEBUG_OUT_DATA_SET(DEBUG_OUT_DATA_RESET)) -#define DEBUG_OUT_HW_MASK (32'h0 | \ - DEBUG_OUT_DATA_MASK) -#define DEBUG_OUT_SW_MASK (32'h0) - -#define LA_CONTROL_ADDRESS 'h00000088 -#define LA_CONTROL_RUN_MSB 1 -#define LA_CONTROL_RUN_LSB 1 -#define LA_CONTROL_RUN_MASK 'h00000002 -#define LA_CONTROL_RUN_GET(x) (((x) & LA_CONTROL_RUN_MASK) >> LA_CONTROL_RUN_LSB) -#define LA_CONTROL_RUN_SET(x) (((32'd0 | (x)) << LA_CONTROL_RUN_LSB) & LA_CONTROL_RUN_MASK) -#define LA_CONTROL_RUN_RESET 1'h0 -#define LA_CONTROL_TRIGGERED_MSB 0 -#define LA_CONTROL_TRIGGERED_LSB 0 -#define LA_CONTROL_TRIGGERED_MASK 'h00000001 -#define LA_CONTROL_TRIGGERED_GET(x) (((x) & LA_CONTROL_TRIGGERED_MASK) >> LA_CONTROL_TRIGGERED_LSB) -#define LA_CONTROL_TRIGGERED_SET(x) (((32'd0 | (x)) << LA_CONTROL_TRIGGERED_LSB) & LA_CONTROL_TRIGGERED_MASK) -#define LA_CONTROL_TRIGGERED_RESET 1'h0 -#define LA_CONTROL_RESET (32'h0 | \ - LA_CONTROL_RUN_SET(LA_CONTROL_RUN_RESET) | \ - LA_CONTROL_TRIGGERED_SET(LA_CONTROL_TRIGGERED_RESET)) -#define LA_CONTROL_HW_MASK (32'h0 | \ - LA_CONTROL_RUN_MASK | \ - LA_CONTROL_TRIGGERED_MASK) -#define LA_CONTROL_SW_MASK (32'h0 | \ - LA_CONTROL_RUN_MASK) - -#define LA_CLOCK_ADDRESS 'h0000008c -#define LA_CLOCK_DIV_MSB 7 -#define LA_CLOCK_DIV_LSB 0 -#define LA_CLOCK_DIV_MASK 'h000000ff -#define LA_CLOCK_DIV_GET(x) (((x) & LA_CLOCK_DIV_MASK) >> LA_CLOCK_DIV_LSB) -#define LA_CLOCK_DIV_SET(x) (((32'd0 | (x)) << LA_CLOCK_DIV_LSB) & LA_CLOCK_DIV_MASK) -#define LA_CLOCK_DIV_RESET 8'h0 -#define LA_CLOCK_RESET (32'h0 | \ - LA_CLOCK_DIV_SET(LA_CLOCK_DIV_RESET)) -#define LA_CLOCK_HW_MASK (32'h0) -#define LA_CLOCK_SW_MASK (32'h0 | \ - LA_CLOCK_DIV_MASK) - -#define LA_STATUS_ADDRESS 'h00000090 -#define LA_STATUS_INTERRUPT_MSB 0 -#define LA_STATUS_INTERRUPT_LSB 0 -#define LA_STATUS_INTERRUPT_MASK 'h00000001 -#define LA_STATUS_INTERRUPT_GET(x) (((x) & LA_STATUS_INTERRUPT_MASK) >> LA_STATUS_INTERRUPT_LSB) -#define LA_STATUS_INTERRUPT_SET(x) (((32'd0 | (x)) << LA_STATUS_INTERRUPT_LSB) & LA_STATUS_INTERRUPT_MASK) -#define LA_STATUS_INTERRUPT_RESET 1'h0 -#define LA_STATUS_RESET (32'h0 | \ - LA_STATUS_INTERRUPT_SET(LA_STATUS_INTERRUPT_RESET)) -#define LA_STATUS_HW_MASK (32'h0 | \ - LA_STATUS_INTERRUPT_MASK) -#define LA_STATUS_SW_MASK (32'h0 | \ - LA_STATUS_INTERRUPT_MASK) - -#define LA_TRIGGER_SAMPLE_ADDRESS 'h00000094 -#define LA_TRIGGER_SAMPLE_COUNT_MSB 15 -#define LA_TRIGGER_SAMPLE_COUNT_LSB 0 -#define LA_TRIGGER_SAMPLE_COUNT_MASK 'h0000ffff -#define LA_TRIGGER_SAMPLE_COUNT_GET(x) (((x) & LA_TRIGGER_SAMPLE_COUNT_MASK) >> LA_TRIGGER_SAMPLE_COUNT_LSB) -#define LA_TRIGGER_SAMPLE_COUNT_SET(x) (((32'd0 | (x)) << LA_TRIGGER_SAMPLE_COUNT_LSB) & LA_TRIGGER_SAMPLE_COUNT_MASK) -#define LA_TRIGGER_SAMPLE_COUNT_RESET 16'h0 -#define LA_TRIGGER_SAMPLE_RESET (32'h0 | \ - LA_TRIGGER_SAMPLE_COUNT_SET(LA_TRIGGER_SAMPLE_COUNT_RESET)) -#define LA_TRIGGER_SAMPLE_HW_MASK (32'h0) -#define LA_TRIGGER_SAMPLE_SW_MASK (32'h0 | \ - LA_TRIGGER_SAMPLE_COUNT_MASK) - -#define LA_TRIGGER_POSITION_ADDRESS 'h00000098 -#define LA_TRIGGER_POSITION_VALUE_MSB 15 -#define LA_TRIGGER_POSITION_VALUE_LSB 0 -#define LA_TRIGGER_POSITION_VALUE_MASK 'h0000ffff -#define LA_TRIGGER_POSITION_VALUE_GET(x) (((x) & LA_TRIGGER_POSITION_VALUE_MASK) >> LA_TRIGGER_POSITION_VALUE_LSB) -#define LA_TRIGGER_POSITION_VALUE_SET(x) (((32'd0 | (x)) << LA_TRIGGER_POSITION_VALUE_LSB) & LA_TRIGGER_POSITION_VALUE_MASK) -#define LA_TRIGGER_POSITION_VALUE_RESET 16'h1 -#define LA_TRIGGER_POSITION_RESET (32'h0 | \ - LA_TRIGGER_POSITION_VALUE_SET(LA_TRIGGER_POSITION_VALUE_RESET)) -#define LA_TRIGGER_POSITION_HW_MASK (32'h0) -#define LA_TRIGGER_POSITION_SW_MASK (32'h0 | \ - LA_TRIGGER_POSITION_VALUE_MASK) - -#define LA_PRE_TRIGGER_ADDRESS 'h0000009c -#define LA_PRE_TRIGGER_COUNT_MSB 15 -#define LA_PRE_TRIGGER_COUNT_LSB 0 -#define LA_PRE_TRIGGER_COUNT_MASK 'h0000ffff -#define LA_PRE_TRIGGER_COUNT_GET(x) (((x) & LA_PRE_TRIGGER_COUNT_MASK) >> LA_PRE_TRIGGER_COUNT_LSB) -#define LA_PRE_TRIGGER_COUNT_SET(x) (((32'd0 | (x)) << LA_PRE_TRIGGER_COUNT_LSB) & LA_PRE_TRIGGER_COUNT_MASK) -#define LA_PRE_TRIGGER_COUNT_RESET 16'h0 -#define LA_PRE_TRIGGER_RESET (32'h0 | \ - LA_PRE_TRIGGER_COUNT_SET(LA_PRE_TRIGGER_COUNT_RESET)) -#define LA_PRE_TRIGGER_HW_MASK (32'h0 | \ - LA_PRE_TRIGGER_COUNT_MASK) -#define LA_PRE_TRIGGER_SW_MASK (32'h0 | \ - LA_PRE_TRIGGER_COUNT_MASK) - -#define LA_POST_TRIGGER_ADDRESS 'h000000a0 -#define LA_POST_TRIGGER_COUNT_MSB 15 -#define LA_POST_TRIGGER_COUNT_LSB 0 -#define LA_POST_TRIGGER_COUNT_MASK 'h0000ffff -#define LA_POST_TRIGGER_COUNT_GET(x) (((x) & LA_POST_TRIGGER_COUNT_MASK) >> LA_POST_TRIGGER_COUNT_LSB) -#define LA_POST_TRIGGER_COUNT_SET(x) (((32'd0 | (x)) << LA_POST_TRIGGER_COUNT_LSB) & LA_POST_TRIGGER_COUNT_MASK) -#define LA_POST_TRIGGER_COUNT_RESET 16'h0 -#define LA_POST_TRIGGER_RESET (32'h0 | \ - LA_POST_TRIGGER_COUNT_SET(LA_POST_TRIGGER_COUNT_RESET)) -#define LA_POST_TRIGGER_HW_MASK (32'h0 | \ - LA_POST_TRIGGER_COUNT_MASK) -#define LA_POST_TRIGGER_SW_MASK (32'h0 | \ - LA_POST_TRIGGER_COUNT_MASK) - -#define LA_FILTER_CONTROL_ADDRESS 'h000000a4 -#define LA_FILTER_CONTROL_DELTA_MSB 0 -#define LA_FILTER_CONTROL_DELTA_LSB 0 -#define LA_FILTER_CONTROL_DELTA_MASK 'h00000001 -#define LA_FILTER_CONTROL_DELTA_GET(x) (((x) & LA_FILTER_CONTROL_DELTA_MASK) >> LA_FILTER_CONTROL_DELTA_LSB) -#define LA_FILTER_CONTROL_DELTA_SET(x) (((32'd0 | (x)) << LA_FILTER_CONTROL_DELTA_LSB) & LA_FILTER_CONTROL_DELTA_MASK) -#define LA_FILTER_CONTROL_DELTA_RESET 1'h0 -#define LA_FILTER_CONTROL_RESET (32'h0 | \ - LA_FILTER_CONTROL_DELTA_SET(LA_FILTER_CONTROL_DELTA_RESET)) -#define LA_FILTER_CONTROL_HW_MASK (32'h0) -#define LA_FILTER_CONTROL_SW_MASK (32'h0 | \ - LA_FILTER_CONTROL_DELTA_MASK) - -#define LA_FILTER_DATA_ADDRESS 'h000000a8 -#define LA_FILTER_DATA_MATCH_MSB 17 -#define LA_FILTER_DATA_MATCH_LSB 0 -#define LA_FILTER_DATA_MATCH_MASK 'h0003ffff -#define LA_FILTER_DATA_MATCH_GET(x) (((x) & LA_FILTER_DATA_MATCH_MASK) >> LA_FILTER_DATA_MATCH_LSB) -#define LA_FILTER_DATA_MATCH_SET(x) (((32'd0 | (x)) << LA_FILTER_DATA_MATCH_LSB) & LA_FILTER_DATA_MATCH_MASK) -#define LA_FILTER_DATA_MATCH_RESET 18'h0 -#define LA_FILTER_DATA_RESET (32'h0 | \ - LA_FILTER_DATA_MATCH_SET(LA_FILTER_DATA_MATCH_RESET)) -#define LA_FILTER_DATA_HW_MASK (32'h0) -#define LA_FILTER_DATA_SW_MASK (32'h0 | \ - LA_FILTER_DATA_MATCH_MASK) - -#define LA_FILTER_WILDCARD_ADDRESS 'h000000ac -#define LA_FILTER_WILDCARD_MATCH_MSB 17 -#define LA_FILTER_WILDCARD_MATCH_LSB 0 -#define LA_FILTER_WILDCARD_MATCH_MASK 'h0003ffff -#define LA_FILTER_WILDCARD_MATCH_GET(x) (((x) & LA_FILTER_WILDCARD_MATCH_MASK) >> LA_FILTER_WILDCARD_MATCH_LSB) -#define LA_FILTER_WILDCARD_MATCH_SET(x) (((32'd0 | (x)) << LA_FILTER_WILDCARD_MATCH_LSB) & LA_FILTER_WILDCARD_MATCH_MASK) -#define LA_FILTER_WILDCARD_MATCH_RESET 18'h0 -#define LA_FILTER_WILDCARD_RESET (32'h0 | \ - LA_FILTER_WILDCARD_MATCH_SET(LA_FILTER_WILDCARD_MATCH_RESET)) -#define LA_FILTER_WILDCARD_HW_MASK (32'h0) -#define LA_FILTER_WILDCARD_SW_MASK (32'h0 | \ - LA_FILTER_WILDCARD_MATCH_MASK) - -#define LA_TRIGGERA_DATA_ADDRESS 'h000000b0 -#define LA_TRIGGERA_DATA_MATCH_MSB 17 -#define LA_TRIGGERA_DATA_MATCH_LSB 0 -#define LA_TRIGGERA_DATA_MATCH_MASK 'h0003ffff -#define LA_TRIGGERA_DATA_MATCH_GET(x) (((x) & LA_TRIGGERA_DATA_MATCH_MASK) >> LA_TRIGGERA_DATA_MATCH_LSB) -#define LA_TRIGGERA_DATA_MATCH_SET(x) (((32'd0 | (x)) << LA_TRIGGERA_DATA_MATCH_LSB) & LA_TRIGGERA_DATA_MATCH_MASK) -#define LA_TRIGGERA_DATA_MATCH_RESET 18'h0 -#define LA_TRIGGERA_DATA_RESET (32'h0 | \ - LA_TRIGGERA_DATA_MATCH_SET(LA_TRIGGERA_DATA_MATCH_RESET)) -#define LA_TRIGGERA_DATA_HW_MASK (32'h0) -#define LA_TRIGGERA_DATA_SW_MASK (32'h0 | \ - LA_TRIGGERA_DATA_MATCH_MASK) - -#define LA_TRIGGERA_WILDCARD_ADDRESS 'h000000b4 -#define LA_TRIGGERA_WILDCARD_MATCH_MSB 17 -#define LA_TRIGGERA_WILDCARD_MATCH_LSB 0 -#define LA_TRIGGERA_WILDCARD_MATCH_MASK 'h0003ffff -#define LA_TRIGGERA_WILDCARD_MATCH_GET(x) (((x) & LA_TRIGGERA_WILDCARD_MATCH_MASK) >> LA_TRIGGERA_WILDCARD_MATCH_LSB) -#define LA_TRIGGERA_WILDCARD_MATCH_SET(x) (((32'd0 | (x)) << LA_TRIGGERA_WILDCARD_MATCH_LSB) & LA_TRIGGERA_WILDCARD_MATCH_MASK) -#define LA_TRIGGERA_WILDCARD_MATCH_RESET 18'h0 -#define LA_TRIGGERA_WILDCARD_RESET (32'h0 | \ - LA_TRIGGERA_WILDCARD_MATCH_SET(LA_TRIGGERA_WILDCARD_MATCH_RESET)) -#define LA_TRIGGERA_WILDCARD_HW_MASK (32'h0) -#define LA_TRIGGERA_WILDCARD_SW_MASK (32'h0 | \ - LA_TRIGGERA_WILDCARD_MATCH_MASK) - -#define LA_TRIGGERB_DATA_ADDRESS 'h000000b8 -#define LA_TRIGGERB_DATA_MATCH_MSB 17 -#define LA_TRIGGERB_DATA_MATCH_LSB 0 -#define LA_TRIGGERB_DATA_MATCH_MASK 'h0003ffff -#define LA_TRIGGERB_DATA_MATCH_GET(x) (((x) & LA_TRIGGERB_DATA_MATCH_MASK) >> LA_TRIGGERB_DATA_MATCH_LSB) -#define LA_TRIGGERB_DATA_MATCH_SET(x) (((32'd0 | (x)) << LA_TRIGGERB_DATA_MATCH_LSB) & LA_TRIGGERB_DATA_MATCH_MASK) -#define LA_TRIGGERB_DATA_MATCH_RESET 18'h0 -#define LA_TRIGGERB_DATA_RESET (32'h0 | \ - LA_TRIGGERB_DATA_MATCH_SET(LA_TRIGGERB_DATA_MATCH_RESET)) -#define LA_TRIGGERB_DATA_HW_MASK (32'h0) -#define LA_TRIGGERB_DATA_SW_MASK (32'h0 | \ - LA_TRIGGERB_DATA_MATCH_MASK) - -#define LA_TRIGGERB_WILDCARD_ADDRESS 'h000000bc -#define LA_TRIGGERB_WILDCARD_MATCH_MSB 17 -#define LA_TRIGGERB_WILDCARD_MATCH_LSB 0 -#define LA_TRIGGERB_WILDCARD_MATCH_MASK 'h0003ffff -#define LA_TRIGGERB_WILDCARD_MATCH_GET(x) (((x) & LA_TRIGGERB_WILDCARD_MATCH_MASK) >> LA_TRIGGERB_WILDCARD_MATCH_LSB) -#define LA_TRIGGERB_WILDCARD_MATCH_SET(x) (((32'd0 | (x)) << LA_TRIGGERB_WILDCARD_MATCH_LSB) & LA_TRIGGERB_WILDCARD_MATCH_MASK) -#define LA_TRIGGERB_WILDCARD_MATCH_RESET 18'h0 -#define LA_TRIGGERB_WILDCARD_RESET (32'h0 | \ - LA_TRIGGERB_WILDCARD_MATCH_SET(LA_TRIGGERB_WILDCARD_MATCH_RESET)) -#define LA_TRIGGERB_WILDCARD_HW_MASK (32'h0) -#define LA_TRIGGERB_WILDCARD_SW_MASK (32'h0 | \ - LA_TRIGGERB_WILDCARD_MATCH_MASK) - -#define LA_TRIGGER_ADDRESS 'h000000c0 -#define LA_TRIGGER_EVENT_MSB 2 -#define LA_TRIGGER_EVENT_LSB 0 -#define LA_TRIGGER_EVENT_MASK 'h00000007 -#define LA_TRIGGER_EVENT_GET(x) (((x) & LA_TRIGGER_EVENT_MASK) >> LA_TRIGGER_EVENT_LSB) -#define LA_TRIGGER_EVENT_SET(x) (((32'd0 | (x)) << LA_TRIGGER_EVENT_LSB) & LA_TRIGGER_EVENT_MASK) -#define LA_TRIGGER_EVENT_RESET 3'h0 -#define LA_TRIGGER_RESET (32'h0 | \ - LA_TRIGGER_EVENT_SET(LA_TRIGGER_EVENT_RESET)) -#define LA_TRIGGER_HW_MASK (32'h0) -#define LA_TRIGGER_SW_MASK (32'h0 | \ - LA_TRIGGER_EVENT_MASK) - -#define LA_FIFO_ADDRESS 'h000000c4 -#define LA_FIFO_FULL_MSB 1 -#define LA_FIFO_FULL_LSB 1 -#define LA_FIFO_FULL_MASK 'h00000002 -#define LA_FIFO_FULL_GET(x) (((x) & LA_FIFO_FULL_MASK) >> LA_FIFO_FULL_LSB) -#define LA_FIFO_FULL_SET(x) (((32'd0 | (x)) << LA_FIFO_FULL_LSB) & LA_FIFO_FULL_MASK) -#define LA_FIFO_FULL_RESET 1'h0 -#define LA_FIFO_EMPTY_MSB 0 -#define LA_FIFO_EMPTY_LSB 0 -#define LA_FIFO_EMPTY_MASK 'h00000001 -#define LA_FIFO_EMPTY_GET(x) (((x) & LA_FIFO_EMPTY_MASK) >> LA_FIFO_EMPTY_LSB) -#define LA_FIFO_EMPTY_SET(x) (((32'd0 | (x)) << LA_FIFO_EMPTY_LSB) & LA_FIFO_EMPTY_MASK) -#define LA_FIFO_EMPTY_RESET 1'h0 -#define LA_FIFO_RESET (32'h0 | \ - LA_FIFO_FULL_SET(LA_FIFO_FULL_RESET) | \ - LA_FIFO_EMPTY_SET(LA_FIFO_EMPTY_RESET)) -#define LA_FIFO_HW_MASK (32'h0 | \ - LA_FIFO_FULL_MASK | \ - LA_FIFO_EMPTY_MASK) -#define LA_FIFO_SW_MASK (32'h0) - -#define LA_ADDRESS 'h000000c8 -#define LA_DATA_MSB 17 -#define LA_DATA_LSB 0 -#define LA_DATA_MASK 'h0003ffff -#define LA_DATA_GET(x) (((x) & LA_DATA_MASK) >> LA_DATA_LSB) -#define LA_DATA_SET(x) (((32'd0 | (x)) << LA_DATA_LSB) & LA_DATA_MASK) -#define LA_DATA_RESET 18'h0 -#define LA_RESET (32'h0 | \ - LA_DATA_SET(LA_DATA_RESET)) -#define LA_HW_MASK (32'h0 | \ - LA_DATA_MASK) -#define LA_SW_MASK (32'h0) - -#define ANT_PIN_ADDRESS 'h000000d0 -#define ANT_PIN_PAD_PULL_MSB 3 -#define ANT_PIN_PAD_PULL_LSB 2 -#define ANT_PIN_PAD_PULL_MASK 'h0000000c -#define ANT_PIN_PAD_PULL_GET(x) (((x) & ANT_PIN_PAD_PULL_MASK) >> ANT_PIN_PAD_PULL_LSB) -#define ANT_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << ANT_PIN_PAD_PULL_LSB) & ANT_PIN_PAD_PULL_MASK) -#define ANT_PIN_PAD_PULL_RESET 2'h2 -#define ANT_PIN_PAD_STRENGTH_MSB 1 -#define ANT_PIN_PAD_STRENGTH_LSB 0 -#define ANT_PIN_PAD_STRENGTH_MASK 'h00000003 -#define ANT_PIN_PAD_STRENGTH_GET(x) (((x) & ANT_PIN_PAD_STRENGTH_MASK) >> ANT_PIN_PAD_STRENGTH_LSB) -#define ANT_PIN_PAD_STRENGTH_SET(x) (((32'd0 | (x)) << ANT_PIN_PAD_STRENGTH_LSB) & ANT_PIN_PAD_STRENGTH_MASK) -#define ANT_PIN_PAD_STRENGTH_RESET 2'h1 -#define ANT_PIN_RESET (32'h0 | \ - ANT_PIN_PAD_PULL_SET(ANT_PIN_PAD_PULL_RESET) | \ - ANT_PIN_PAD_STRENGTH_SET(ANT_PIN_PAD_STRENGTH_RESET)) -#define ANT_PIN_HW_MASK (32'h0) -#define ANT_PIN_SW_MASK (32'h0 | \ - ANT_PIN_PAD_PULL_MASK | \ - ANT_PIN_PAD_STRENGTH_MASK) - -#define ANTD_PIN_ADDRESS 'h000000d4 -#define ANTD_PIN_PAD_PULL_MSB 1 -#define ANTD_PIN_PAD_PULL_LSB 0 -#define ANTD_PIN_PAD_PULL_MASK 'h00000003 -#define ANTD_PIN_PAD_PULL_GET(x) (((x) & ANTD_PIN_PAD_PULL_MASK) >> ANTD_PIN_PAD_PULL_LSB) -#define ANTD_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << ANTD_PIN_PAD_PULL_LSB) & ANTD_PIN_PAD_PULL_MASK) -#define ANTD_PIN_PAD_PULL_RESET 2'h1 -#define ANTD_PIN_RESET (32'h0 | \ - ANTD_PIN_PAD_PULL_SET(ANTD_PIN_PAD_PULL_RESET)) -#define ANTD_PIN_HW_MASK (32'h0) -#define ANTD_PIN_SW_MASK (32'h0 | \ - ANTD_PIN_PAD_PULL_MASK) - -#define GPIO_PIN_ADDRESS 'h000000d8 -#define GPIO_PIN_PAD_PULL_MSB 3 -#define GPIO_PIN_PAD_PULL_LSB 2 -#define GPIO_PIN_PAD_PULL_MASK 'h0000000c -#define GPIO_PIN_PAD_PULL_GET(x) (((x) & GPIO_PIN_PAD_PULL_MASK) >> GPIO_PIN_PAD_PULL_LSB) -#define GPIO_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << GPIO_PIN_PAD_PULL_LSB) & GPIO_PIN_PAD_PULL_MASK) -#define GPIO_PIN_PAD_PULL_RESET 2'h2 -#define GPIO_PIN_PAD_STRENGTH_MSB 1 -#define GPIO_PIN_PAD_STRENGTH_LSB 0 -#define GPIO_PIN_PAD_STRENGTH_MASK 'h00000003 -#define GPIO_PIN_PAD_STRENGTH_GET(x) (((x) & GPIO_PIN_PAD_STRENGTH_MASK) >> GPIO_PIN_PAD_STRENGTH_LSB) -#define GPIO_PIN_PAD_STRENGTH_SET(x) (((32'd0 | (x)) << GPIO_PIN_PAD_STRENGTH_LSB) & GPIO_PIN_PAD_STRENGTH_MASK) -#define GPIO_PIN_PAD_STRENGTH_RESET 2'h1 -#define GPIO_PIN_RESET (32'h0 | \ - GPIO_PIN_PAD_PULL_SET(GPIO_PIN_PAD_PULL_RESET) | \ - GPIO_PIN_PAD_STRENGTH_SET(GPIO_PIN_PAD_STRENGTH_RESET)) -#define GPIO_PIN_HW_MASK (32'h0) -#define GPIO_PIN_SW_MASK (32'h0 | \ - GPIO_PIN_PAD_PULL_MASK | \ - GPIO_PIN_PAD_STRENGTH_MASK) - -#define GPIO_H_PIN_ADDRESS 'h000000dc -#define GPIO_H_PIN_PAD_PULL_MSB 1 -#define GPIO_H_PIN_PAD_PULL_LSB 0 -#define GPIO_H_PIN_PAD_PULL_MASK 'h00000003 -#define GPIO_H_PIN_PAD_PULL_GET(x) (((x) & GPIO_H_PIN_PAD_PULL_MASK) >> GPIO_H_PIN_PAD_PULL_LSB) -#define GPIO_H_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << GPIO_H_PIN_PAD_PULL_LSB) & GPIO_H_PIN_PAD_PULL_MASK) -#define GPIO_H_PIN_PAD_PULL_RESET 2'h0 -#define GPIO_H_PIN_RESET (32'h0 | \ - GPIO_H_PIN_PAD_PULL_SET(GPIO_H_PIN_PAD_PULL_RESET)) -#define GPIO_H_PIN_HW_MASK (32'h0) -#define GPIO_H_PIN_SW_MASK (32'h0 | \ - GPIO_H_PIN_PAD_PULL_MASK) - -#define BT_PIN_ADDRESS 'h000000e0 -#define BT_PIN_PAD_PULL_MSB 3 -#define BT_PIN_PAD_PULL_LSB 2 -#define BT_PIN_PAD_PULL_MASK 'h0000000c -#define BT_PIN_PAD_PULL_GET(x) (((x) & BT_PIN_PAD_PULL_MASK) >> BT_PIN_PAD_PULL_LSB) -#define BT_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << BT_PIN_PAD_PULL_LSB) & BT_PIN_PAD_PULL_MASK) -#define BT_PIN_PAD_PULL_RESET 2'h0 -#define BT_PIN_PAD_STRENGTH_MSB 1 -#define BT_PIN_PAD_STRENGTH_LSB 0 -#define BT_PIN_PAD_STRENGTH_MASK 'h00000003 -#define BT_PIN_PAD_STRENGTH_GET(x) (((x) & BT_PIN_PAD_STRENGTH_MASK) >> BT_PIN_PAD_STRENGTH_LSB) -#define BT_PIN_PAD_STRENGTH_SET(x) (((32'd0 | (x)) << BT_PIN_PAD_STRENGTH_LSB) & BT_PIN_PAD_STRENGTH_MASK) -#define BT_PIN_PAD_STRENGTH_RESET 2'h1 -#define BT_PIN_RESET (32'h0 | \ - BT_PIN_PAD_PULL_SET(BT_PIN_PAD_PULL_RESET) | \ - BT_PIN_PAD_STRENGTH_SET(BT_PIN_PAD_STRENGTH_RESET)) -#define BT_PIN_HW_MASK (32'h0) -#define BT_PIN_SW_MASK (32'h0 | \ - BT_PIN_PAD_PULL_MASK | \ - BT_PIN_PAD_STRENGTH_MASK) - -#define BT_WLAN_PIN_ADDRESS 'h000000e4 -#define BT_WLAN_PIN_PAD_PULL_MSB 1 -#define BT_WLAN_PIN_PAD_PULL_LSB 0 -#define BT_WLAN_PIN_PAD_PULL_MASK 'h00000003 -#define BT_WLAN_PIN_PAD_PULL_GET(x) (((x) & BT_WLAN_PIN_PAD_PULL_MASK) >> BT_WLAN_PIN_PAD_PULL_LSB) -#define BT_WLAN_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << BT_WLAN_PIN_PAD_PULL_LSB) & BT_WLAN_PIN_PAD_PULL_MASK) -#define BT_WLAN_PIN_PAD_PULL_RESET 2'h2 -#define BT_WLAN_PIN_RESET (32'h0 | \ - BT_WLAN_PIN_PAD_PULL_SET(BT_WLAN_PIN_PAD_PULL_RESET)) -#define BT_WLAN_PIN_HW_MASK (32'h0) -#define BT_WLAN_PIN_SW_MASK (32'h0 | \ - BT_WLAN_PIN_PAD_PULL_MASK) - -#define SI_UART_PIN_ADDRESS 'h000000e8 -#define SI_UART_PIN_PAD_PULL_MSB 3 -#define SI_UART_PIN_PAD_PULL_LSB 2 -#define SI_UART_PIN_PAD_PULL_MASK 'h0000000c -#define SI_UART_PIN_PAD_PULL_GET(x) (((x) & SI_UART_PIN_PAD_PULL_MASK) >> SI_UART_PIN_PAD_PULL_LSB) -#define SI_UART_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << SI_UART_PIN_PAD_PULL_LSB) & SI_UART_PIN_PAD_PULL_MASK) -#define SI_UART_PIN_PAD_PULL_RESET 2'h1 -#define SI_UART_PIN_PAD_STRENGTH_MSB 1 -#define SI_UART_PIN_PAD_STRENGTH_LSB 0 -#define SI_UART_PIN_PAD_STRENGTH_MASK 'h00000003 -#define SI_UART_PIN_PAD_STRENGTH_GET(x) (((x) & SI_UART_PIN_PAD_STRENGTH_MASK) >> SI_UART_PIN_PAD_STRENGTH_LSB) -#define SI_UART_PIN_PAD_STRENGTH_SET(x) (((32'd0 | (x)) << SI_UART_PIN_PAD_STRENGTH_LSB) & SI_UART_PIN_PAD_STRENGTH_MASK) -#define SI_UART_PIN_PAD_STRENGTH_RESET 2'h1 -#define SI_UART_PIN_RESET (32'h0 | \ - SI_UART_PIN_PAD_PULL_SET(SI_UART_PIN_PAD_PULL_RESET) | \ - SI_UART_PIN_PAD_STRENGTH_SET(SI_UART_PIN_PAD_STRENGTH_RESET)) -#define SI_UART_PIN_HW_MASK (32'h0) -#define SI_UART_PIN_SW_MASK (32'h0 | \ - SI_UART_PIN_PAD_PULL_MASK | \ - SI_UART_PIN_PAD_STRENGTH_MASK) - -#define CLK32K_PIN_ADDRESS 'h000000ec -#define CLK32K_PIN_PAD_PULL_MSB 1 -#define CLK32K_PIN_PAD_PULL_LSB 0 -#define CLK32K_PIN_PAD_PULL_MASK 'h00000003 -#define CLK32K_PIN_PAD_PULL_GET(x) (((x) & CLK32K_PIN_PAD_PULL_MASK) >> CLK32K_PIN_PAD_PULL_LSB) -#define CLK32K_PIN_PAD_PULL_SET(x) (((32'd0 | (x)) << CLK32K_PIN_PAD_PULL_LSB) & CLK32K_PIN_PAD_PULL_MASK) -#define CLK32K_PIN_PAD_PULL_RESET 2'h0 -#define CLK32K_PIN_RESET (32'h0 | \ - CLK32K_PIN_PAD_PULL_SET(CLK32K_PIN_PAD_PULL_RESET)) -#define CLK32K_PIN_HW_MASK (32'h0) -#define CLK32K_PIN_SW_MASK (32'h0 | \ - CLK32K_PIN_PAD_PULL_MASK) - -#define RESET_TUPLE_STATUS_ADDRESS 'h000000f0 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MSB 11 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB 8 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK 'h00000f00 -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_GET(x) (((x) & RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK) >> RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB) -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_SET(x) (((32'd0 | (x)) << RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB) & RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK) -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_RESET 4'h0 -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MSB 7 -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB 0 -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK 'h000000ff -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_GET(x) (((x) & RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK) >> RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB) -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_SET(x) (((32'd0 | (x)) << RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB) & RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK) -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_RESET 8'h0 -#define RESET_TUPLE_STATUS_RESET (32'h0 | \ - RESET_TUPLE_STATUS_TEST_RESET_TUPLE_SET(RESET_TUPLE_STATUS_TEST_RESET_TUPLE_RESET) | \ - RESET_TUPLE_STATUS_PIN_RESET_TUPLE_SET(RESET_TUPLE_STATUS_PIN_RESET_TUPLE_RESET)) -#define RESET_TUPLE_STATUS_HW_MASK (32'h0 | \ - RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK | \ - RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK) -#define RESET_TUPLE_STATUS_SW_MASK (32'h0) - -#define GPIO_REG_ADDRESS_MSB 7 - -#endif /* _GPIO_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mac_pcu.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mac_pcu.h deleted file mode 100644 index 6a07583b91b8..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mac_pcu.h +++ /dev/null @@ -1,980 +0,0 @@ -#ifndef _MAC_PCU_H -#define _MAC_PCU_H - -#define FIFO_BOUND 1024 - -#define CLK32_TIMER0 0 -#define CLK32_TIMER1 1 -#define CLK32_TIMER2 2 -#define CLK32_TIMER3 3 -#define CLK32_TSF_L32 4 -#define CLK32_TSF_U32 5 -#define CLK32_SLP1 6 -#define CLK32_SLP2 7 -#define CLK32_SLP3 8 -#define CLK32_QT1 9 -#define CLK32_QT2 10 -//#define CLK32_TSFCAL 11 - -//#define CLK_S_SYNC1 0 -//#define CLK_S_SYNC6 1 -//#define CLK_S_SYNC7 2 -//#define CLK_S_SYNC8 3 - -#define KTYPE_40 0 -#define KTYPE_104 1 -#define KTYPE_TKIP_NO_MIC 2 -#define KTYPE_128 3 -#define KTYPE_TKIP 4 -//#define KTYPE_AES_OCB 5 -#define KTYPE_WAPI 5 -#define KTYPE_AES_CCM 6 -#define KTYPE_NOTHING 7 - -//Frame Type in Descriptor -#define TXDESC_FT_NORMAL 0 -#define TXDESC_FT_ATIM 1 -#define TXDESC_FT_PS_POLL 2 -#define TXDESC_FT_BEACON 3 -#define TXDESC_FT_PROBE_RESP 4 -#define TXDESC_FT_CHIRP 5 -#define TXDESC_FT_GROUP_POLL 6 -#define TXDESC_FT_DIRECT_POLL 7 -//#define TXDESC_FT_SYNC 8 -#define TXDESC_FT_BEACON_NO_TSF_UPDATE 9 - -//Frame Type: Management -#define FTYPE_ASSOCIATION_REQ 0x00 -#define FTYPE_ASSOCIATION_RES 0x04 -#define FTYPE_REASSOCIATION_REQ 0x08 -#define FTYPE_REASSOCIATION_RES 0x0c -#define FTYPE_PBREQ 0x10 // change to TYPE_PROBE_REQ TBD -#define FTYPE_PBRES 0x14 // change to TYPE_PROBE_RES TBD -#define FTYPE_BEACON 0x20 -#define FTYPE_ATIM 0x24 -#define FTYPE_DISASSOCIATE 0x28 -#define FTYPE_AUTHENICATE 0x2c -#define FTYPE_DEAUTHENICATE 0x30 - -//Frame Type: Control -#define FTYPE_PSPOLL 0x29 -#define FTYPE_RTS 0x2d -#define FTYPE_CTS 0x31 -#define FTYPE_ACK 0x35 -#define FTYPE_CFEND 0x39 -#define FTYPE_CFEND_ACK 0x3d // change to FTYPE_CFEND_ACK TBD - -//Frame Type: Data -#define FTYPE_DATA 0x02 -#define FTYPE_DATA_CFACK 0x06 -#define FTYPE_DATA_CFPOLL 0x0a -#define FTYPE_DATA_CFACK_CFPOLL 0x0e -#define FTYPE_NULL 0x12 -#define FTYPE_CFACK 0x16 -#define FTYPE_CFPOLL 0x1a -#define FTYPE_CFACK_CFPOLL 0x1e - -//Frame Control Fields -#define FCTL_TO_DS 8 -#define FCTL_FROM_DS 9 -#define FCTL_MORE_FRAG 10 -#define FCTL_RETRY 11 -#define FCTL_POWER_MGNT 12 -#define FCTL_MORE_DATA 13 -#define FCTL_WEP 14 -#define FCTL_TYPE 3:2 - -//Rate -#define OFDM_RATE_6Mb 0x0b -#define OFDM_RATE_9Mb 0x0f -#define OFDM_RATE_12Mb 0x0a -#define OFDM_RATE_18Mb 0x0e -#define OFDM_RATE_24Mb 0x09 -#define OFDM_RATE_36Mb 0x0d -#define OFDM_RATE_48Mb 0x08 -#define OFDM_RATE_54Mb 0x0c -#define CCK_RATE_1Mb_L 0x1b -#define CCK_RATE_2Mb_L 0x1a -#define CCK_RATE_2Mb_S 0x1e -#define CCK_RATE_5_5Mb_L 0x19 -#define CCK_RATE_5_5Mb_S 0x1d -#define CCK_RATE_11Mb_L 0x18 - -#define CCK_RATE_11Mb_S 0x1c -#define XR_RATE_0_25Mb 0x03 -#define XR_RATE_0_5Mb 0x07 -#define XR_RATE_1Mb 0x02 -#define XR_RATE_2Mb 0x06 -#define XR_RATE_3Mb 0x01 - -//Registers -#define PCU_REG 0x0 -#define KEY_REG 0x1 -#define D2A2_REG 0x3 - -#define REG_STA_ID0 0x0 -#define STA_ADDR_L32 31:0 - -#define REG_STA_ID1 0x1 -#define STA_ADDR_U16 15:0 -#define AP 16 -#define ADHOC 17 -#define PWR_SV 18 -#define NO_KEYSRCH 19 -#define PCF 20 -#define USE_DEF_ANT 21 -#define DEF_ANT_UPDATE 22 -#define RTS_DEF_ANT 23 -#define ACKCTS_6MB 24 -#define RATE_11B 25 -#define SECTOR_SELF_GEN 26 -#define CRPT_MIC_ENABLE 27 -#define KSRCH_MODE 28 -#define PRESERVE_SEQNUM 29 -#define CBCIV_ENDIAN 30 -#define ADHOC_MCAST_SEARCH 31 - -#define REG_BSS_ID0 0x2 -#define BSSID_L32 31:0 - -#define REG_BSS_ID1 0x3 -#define BSSID_U16 15:0 -#define AID 31:16 - -#define MAC_PCU_REG_BCNRSSI_OFFSET 0x4 -#define MAC_PCU_REG_BCNRSSI_BCN_RSSI_AVE_FIELD 11:0 -#define MAC_PCU_REG_BCNRSSI_BCN_RSSI_AVE_RESET 0x800 - -#define REG_TIME_OUT 0x5 -#define ACK_TIME_OUT 15:0 -#define CTS_TIME_OUT 31:16 - -#define MAC_PCU_REG_BCNSIG_OFFSET 0x6 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_LO_THR_FIELD 7:0 -#define MAC_PCU_REG_BCNSIG_BCN_MISS_THR_FIELD 15:8 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_HI_THR_FIELD 23:16 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_WEIGHT_FIELD 28:24 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_RESET_FIELD 29 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_LO_THR_RESET 0 -#define MAC_PCU_REG_BCNSIG_BCN_MISS_THR_RESET 0xFF -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_HI_THR_RESET 0x7F -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_WEIGHT_RESET 0 - -#define REG_USEC 0x7 -#define USEC 6:0 -#define USEC32 13:7 -#define TX_DELAY 18:14 -#define RX_DELAY 24:19 - -#define REG_BEACON 0x8 -#define BEACON_PERIOD 15:0 -#define TIM_OFFSET 22:16 -#define RESET_TSF 24 - -#define REG_CFP_PERIOD 0x9 - -#define REG_TIMER0 0xa - -#define REG_TIMER1 0xb - -#define REG_TIMER2 0xc - -#define REG_TIMER3 0xd - -#define REG_CFP_DUR 0xe - -#define REG_RX_FILTER 0xf -#define UNICAST 0 -#define MULTICAST 1 -#define BROADCAST 2 -#define CONTROL 3 -#define BEACON 4 -#define PROMISCUOUS 5 -#define XR_POLL 6 -#define PROBE_REQ 7 -//#define SYNC 8 -#define MY_BEACON 9 - -#define REG_MCAST_FIL0 0x10 - -#define REG_MCAST_FIL1 0x11 - -#define MAC_PCU_REG_DIAGSW_OFFSET 0x12 -#define MAC_PCU_REG_DIAGSW_DIS_WEP_ACK_FIELD 0 -#define MAC_PCU_REG_DIAGSW_DIS_ACK_FIELD 1 -#define MAC_PCU_REG_DIAGSW_DIS_CTS_FIELD 2 -#define MAC_PCU_REG_DIAGSW_DIS_ENC_FIELD 3 -#define MAC_PCU_REG_DIAGSW_DIS_DEC_FIELD 4 -#define MAC_PCU_REG_DIAGSW_DIS_RX_FIELD 5 -#define MAC_PCU_REG_DIAGSW_LOOP_BACK_FIELD 6 -#define MAC_PCU_REG_DIAGSW_CORR_FCS_FIELD 7 -#define MAC_PCU_REG_DIAGSW_CHAN_INFO_FIELD 8 -#define MAC_PCU_REG_DIAGSW_RESERVED_FIELD 16:9 -#define MAC_PCU_REG_DIAGSW_ACCEPT_NONV0_FIELD 17 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_0_1_FIELD 19:18 -#define MAC_PCU_REG_DIAGSW_RXCLR_HIGH_FIELD 20 -#define MAC_PCU_REG_DIAGSW_IGNORE_NAV_FIELD 21 -#define MAC_PCU_REG_DIAGSW_CHANIDLE_HIGH_FIELD 22 -#define MAC_PCU_REG_DIAGSW_PHYERR_ENABLE_NEW_FIELD 23 -#define MAC_PCU_REG_DIAGSW_DUAL_CHAIN_CHAN_INFO_FIELD 24 -#define MAC_PCU_REG_DIAGSW_FORCE_RX_ABORT_FIELD 25 -#define MAC_PCU_REG_DIAGSW_SATURATE_CYCLE_CNT_FIELD 26 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_2_FIELD 27 -#define MAC_PCU_REG_DIAGSW_DIS_WEP_ACK_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_ACK_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_CTS_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_ENC_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_DEC_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_RX_RESET 0 -#define MAC_PCU_REG_DIAGSW_LOOP_BACK_RESET 0 -#define MAC_PCU_REG_DIAGSW_CORR_FCS_RESET 0 -#define MAC_PCU_REG_DIAGSW_CHAN_INFO_RESET 0 -#define MAC_PCU_REG_DIAGSW_RESERVED_RESET 0 -#define MAC_PCU_REG_DIAGSW_ACCEPT_NONV0_RESET 0 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_0_1_RESET 0 -#define MAC_PCU_REG_DIAGSW_RXCLR_HIGH_RESET 0 -#define MAC_PCU_REG_DIAGSW_IGNORE_NAV_RESET 0 -#define MAC_PCU_REG_DIAGSW_CHANIDLE_HIGH_RESET 0 -#define MAC_PCU_REG_DIAGSW_PHYERR_ENABLE_NEW_RESET 0 -#define MAC_PCU_REG_DIAGSW_DUAL_CHAIN_CHAN_INFO_RESET 0 -#define MAC_PCU_REG_DIAGSW_FORCE_RX_ABORT_RESET 0 -#define MAC_PCU_REG_DIAGSW_SATURATE_CYCLE_CNT_RESET 0 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_2_RESET 0 - -#define REG_TSF_L32 0x13 - -#define REG_TSF_U32 0x14 - -#define REG_TST_ADDAC 0x15 -#define TEST_MODE 0 -#define TEST_LOOP 1 -#define LOOP_LEN 12:2 -#define TEST_UPPER_8B 13 -#define TEST_MSB 14 -#define TEST_CAPTURE 15 - -#define REG_DEF_ANT 0x16 - -#define MAC_PCU_REG_MUTE_MASKS0_OFFSET 0x17 -#define MAC_PCU_REG_MUTE_MASKS0_FC_FIELD 15:0 -#define MAC_PCU_REG_MUTE_MASKS0_QOS_FIELD 31:16 -#define MAC_PCU_REG_MUTE_MASKS0_FC_RESET 0xC7FF -#define MAC_PCU_REG_MUTE_MASKS0_QOS_RESET 0xFFFF - -#define MAC_PCU_REG_MUTE_MASKS1_OFFSET 0x18 -#define MAC_PCU_REG_MUTE_MASKS1_SEQ_FIELD 15:0 -#define MAC_PCU_REG_MUTE_MASKS1_FC_MGMT_FIELD 31:16 -#define MAC_PCU_REG_MUTE_MASKS1_SEQ_RESET 0x000F -#define MAC_PCU_REG_MUTE_MASKS1_FC_MGMT_RESET 0xE7FF - -#define MAC_PCU_REG_GATED_CLKS_OFFSET 0x19 -//#define MAC_PCU_REG_GATED_SYNC_FIELD 0 -#define MAC_PCU_REG_GATED_TX_FIELD 1 -#define MAC_PCU_REG_GATED_RX_FIELD 2 -#define MAC_PCU_REG_GATED_REG_FIELD 3 -//#define MAC_PCU_REG_GATED_SYNC_RESET 0x1 -#define MAC_PCU_REG_GATED_TX_RESET 0x0 -#define MAC_PCU_REG_GATED_RX_RESET 0x0 -#define MAC_PCU_REG_GATED_REG_RESET 0x0 - -#define MAC_PCU_REG_OBS2_OFFSET 0x1a -#define MAC_PCU_REG_OBS2_OBS_BUS_FIELD 17:0 - -#define MAC_PCU_REG_OBS1_OFFSET 0x1b -#define MAC_PCU_REG_OBS1_TX_STATE_FIELD 28:24 -#define MAC_PCU_REG_OBS1_RX_STATE_FIELD 23:20 -#define MAC_PCU_REG_OBS1_WEP_STATE_FIELD 17:12 -#define MAC_PCU_REG_OBS1_RX_CLEAR_FIELD 11 -#define MAC_PCU_REG_OBS1_RX_FRAME_FIELD 10 -#define MAC_PCU_REG_OBS1_TX_FRAME_FIELD 9 -#define MAC_PCU_REG_OBS1_TX_HOLD_FIELD 8 -#define MAC_PCU_REG_OBS1_CHAN_IDLE_FIELD 7 -#define MAC_PCU_REG_OBS1_QUIET_TIME_FIELD 6 -#define MAC_PCU_REG_OBS1_TX_HCF_FIELD 5 -#define MAC_PCU_REG_OBS1_FILTER_PASS_FIELD 4 -#define MAC_PCU_REG_OBS1_RX_MY_BEACON_FIELD 3 -#define MAC_PCU_REG_OBS1_RX_WEP_FIELD 2 -#define MAC_PCU_REG_OBS1_PCU_RX_END_FIELD 1 -#define MAC_PCU_REG_OBS1_PCU_DIRECTED_FIELD 0 - -#define REG_LAST_TSTP 0x20 - -#define REG_NAV 0x21 - -#define REG_RTS_OK 0x22 - -#define REG_RTS_FAIL 0x23 - -#define REG_ACK_FAIL 0x24 - -#define REG_FCS_FAIL 0x25 - -#define REG_BEACON_CNT 0x26 - -#define MAC_PCU_REG_XRMODE_OFFSET 0x30 -#define MAC_PCU_REG_XRMODE_XR_POLL_TYPE_FIELD 5:0 -#define MAC_PCU_REG_XRMODE_XR_WAIT_FOR_POLL_FIELD 7 -#define MAC_PCU_REG_XRMODE_XR_FRAME_HOLD_FIELD 31:20 -#define MAC_PCU_REG_XRMODE_XR_POLL_TYPE_RESET 0x1A -#define MAC_PCU_REG_XRMODE_XR_WAIT_FOR_POLL_RESET 0x0 -#define MAC_PCU_REG_XRMODE_XR_FRAME_HOLD_RESET 680 - -#define MAC_PCU_REG_XRDEL_OFFSET 0x31 -#define MAC_PCU_REG_XRDEL_XR_SLOT_DELAY_FIELD 15:0 -#define MAC_PCU_REG_XRDEL_XR_CHIRP_DATA_DELAY_FIELD 31:16 -#define MAC_PCU_REG_XRDEL_XR_SLOT_DELAY_RESET 360 -#define MAC_PCU_REG_XRDEL_XR_CHIRP_DATA_DELAY_RESET 1680 - -#define MAC_PCU_REG_XRTO_OFFSET 0x32 -#define MAC_PCU_REG_XRTO_XR_CHIRP_TIMEOUT_FIELD 15:0 -#define MAC_PCU_REG_XRTO_XR_POLL_TIMEOUT_FIELD 31:16 -#define MAC_PCU_REG_XRTO_XR_CHIRP_TIMEOUT_RESET 7200 -#define MAC_PCU_REG_XRTO_XR_POLL_TIMEOUT_RESET 5000 - -#define MAC_PCU_REG_XRCRP_OFFSET 0x33 -#define MAC_PCU_REG_XRCRP_XR_SEND_CHIRP_FIELD 0 -#define MAC_PCU_REG_XRCRP_XR_CHIRP_GAP_FIELD 31:16 -#define MAC_PCU_REG_XRCRP_XR_SEND_CHIRP_RESET 0x0 -#define MAC_PCU_REG_XRCRP_XR_CHIRP_GAP_RESET 500 - -#define MAC_PCU_REG_XRSTMP_OFFSET 0x34 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_FIELD 0 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_BSSID_FIELD 1 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_FIELD 2 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_BSSID_FIELD 3 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_DATA_FIELD 4 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_DATA_FIELD 5 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_THRESH_FIELD 15:8 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_THRESH_FIELD 23:16 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_RESET 0x0 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_BSSID_RESET 0x0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_RESET 0x0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_BSSID_RESET 0x0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_DATA_RESET 0x0 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_DATA_RESET 0x0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_THRESH_RESET 0x25 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_THRESH_RESET 0x25 - -#define MAC_PCU_REG_SLP1_OFFSET 0x35 -//#define MAC_PCU_REG_SLP1_NEXT_DTIM_FIELD 18:0 -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_EXT_FIELD 4:0 -#define MAC_PCU_REG_SLP1_ASSUME_DTIM_FIELD 19 -//#define MAC_PCU_REG_SLP1_ENH_SLEEP_ENABLE_FIELD 20 -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_FIELD 31:21 -// #define MAC_PCU_REG_SLP1_NEXT_DTIM_RESET 0x2aaaa -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_EXT_RESET 0x0 -#define MAC_PCU_REG_SLP1_ASSUME_DTIM_RESET 0x0 -//#define MAC_PCU_REG_SLP1_ENH_SLEEP_ENABLE_RESET 0x1 -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_RESET 5 - -#define MAC_PCU_REG_SLP2_OFFSET 0x36 -//#define MAC_PCU_REG_SLP2_NEXT_TIM_FIELD 18:0 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_EXT_FIELD 4:0 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_FIELD 31:21 -//#define MAC_PCU_REG_SLP2_NEXT_TIM_RESET 0x55555 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_EXT_RESET 0x0 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_RESET 2 - -//#define MAC_PCU_REG_SLP3_OFFSET 0x37 -//#define MAC_PCU_REG_SLP3_TIM_PERIOD_FIELD 15:0 -//#define MAC_PCU_REG_SLP3_DTIM_PERIOD_FIELD 31:16 -//#define MAC_PCU_REG_SLP3_TIM_PERIOD_RESET 2 -//#define MAC_PCU_REG_SLP3_DTIM_PERIOD_RESET 3 - -#define MAC_PCU_REG_BSSMSKL_OFFSET 0x38 -#define MAC_PCU_REG_BSSMSKL_BSSID_MASK_L_FIELD 31:0 -#define MAC_PCU_REG_BSSMSKL_BSSID_MASK_L_RESET 0xFFFFFFFF - -#define MAC_PCU_REG_BSSMSKH_OFFSET 0x39 -#define MAC_PCU_REG_BSSMSKH_BSSID_MASK_H_FIELD 15:0 -#define MAC_PCU_REG_BSSMSKH_BSSID_MASK_H_RESET 0xFFFF - -#define MAC_PCU_REG_TPC_OFFSET 0x3A -#define MAC_PCU_REG_TPC_ACK_PWR_FIELD 5:0 -#define MAC_PCU_REG_TPC_CTS_PWR_FIELD 13:8 -#define MAC_PCU_REG_TPC_CHIRP_PWR_FIELD 21:16 -#define MAC_PCU_REG_TPC_ACK_PWR_RESET 0x3f -#define MAC_PCU_REG_TPC_CTS_PWR_RESET 0x3f -#define MAC_PCU_REG_TPC_CHIRP_PWR_RESET 0x3f - -#define MAC_PCU_REG_TFC_OFFSET 0x3B -#define MAC_PCU_REG_TFC_TX_FRAME_CNT_FIELD 31:0 -#define MAC_PCU_REG_TFC_TX_FRAME_CNT_RESET 0 - -#define MAC_PCU_REG_RFC_OFFSET 0x3C -#define MAC_PCU_REG_RFC_RX_FRAME_CNT_FIELD 31:0 -#define MAC_PCU_REG_RFC_RX_FRAME_CNT_RESET 0 - -#define MAC_PCU_REG_RCC_OFFSET 0x3D -#define MAC_PCU_REG_RCC_RX_CLEAR_CNT_FIELD 31:0 -#define MAC_PCU_REG_RCC_RX_CLEAR_CNT_RESET 0 - -#define MAC_PCU_REG_CC_OFFSET 0x3E -#define MAC_PCU_REG_CC_CYCLE_CNT_FIELD 31:0 -#define MAC_PCU_REG_CC_CYCLE_CNT_RESET 0 - -#define MAC_PCU_REG_QT1_OFFSET 0x3F -#define MAC_PCU_REG_QT1_NEXT_QUIET_FIELD 15:0 -#define MAC_PCU_REG_QT1_QUIET_ENABLE_FIELD 16 -#define MAC_PCU_REG_QT1_QUIET_ACK_CTS_ENABLE_FIELD 17 -#define MAC_PCU_REG_QT1_NEXT_QUIET_RESET 0 -#define MAC_PCU_REG_QT1_QUIET_ENABLE_RESET 0x0 -#define MAC_PCU_REG_QT1_QUIET_ACK_CTS_ENABLE_RESET 0x1 - -#define MAC_PCU_REG_QT2_OFFSET 0x40 -#define MAC_PCU_REG_QT2_QUIET_PERIOD_FIELD 15:0 -#define MAC_PCU_REG_QT2_QUIET_DURATION_FIELD 31:16 -#define MAC_PCU_REG_QT2_QUIET_PERIOD_RESET 0002 -#define MAC_PCU_REG_QT2_QUIET_DURATION_RESET 0001 - -#define MAC_PCU_REG_TSF_OFFSET 0x41 -#define MAC_PCU_REG_TSF_INCREMENT_FIELD 7:0 -#define MAC_PCU_REG_TSF_INCREMENT_RESET 0x01 - -#define MAC_PCU_REG_NOACK_OFFSET 0x42 -#define MAC_PCU_REG_NOACK_2_BIT_VALUES_FIELD 3:0 -#define MAC_PCU_REG_NOACK_BIT_OFFSET_FIELD 6:4 -#define MAC_PCU_REG_NOACK_BYTE_OFFSET_FIELD 8:7 -#define MAC_PCU_REG_NOACK_2_BIT_VALUES_RESET 0x2 -#define MAC_PCU_REG_NOACK_BIT_OFFSET_RESET 0x5 -#define MAC_PCU_REG_NOACK_BYTE_OFFSET_RESET 0x0 - -#define MAC_PCU_REG_PHYERR_OFFSET 0x43 -#define MAC_PCU_REG_PHYERR_MASK_FIELD 31:0 -#define MAC_PCU_REG_PHYERR_MASK_RESET 0x0 - -#define MAC_PCU_REG_XRLAT_OFFSET 0x44 -#define MAC_PCU_REG_XRLAT_XR_TX_DELAY_FIELD 11:0 -#define MAC_PCU_REG_XRLAT_XR_TX_DELAY_RESET 0x168 - -#define MAC_PCU_REG_ACKSIFS_OFFSET_RESERVED 0x45 -#define MAC_PCU_REG_ACKSIFS_INCREMENT_FIELD_RESERVED 7:0 -#define MAC_PCU_REG_ACKSIFS_INCREMENT_RESET_RESERVED 0x0 - -#define MAC_PCU_REG_MICQOSCTL_OFFSET 0x46 -#define MAC_PCU_REG_MICQOSCTL_FIELD 15:0 -#define MAC_PCU_REG_MICQOSCTL_ENABLE_FIELD 16 -#define MAC_PCU_REG_MICQOSCTL_RESET 0x00aa -#define MAC_PCU_REG_MICQOSCTL_ENABLE_RESET 0x1 - -#define MAC_PCU_REG_MICQOSSEL_OFFSET 0x47 -#define MAC_PCU_REG_MICQOSSEL_FIELD 31:0 -#define MAC_PCU_REG_MICQOSSEL_RESET 0x00003210 - -#define MAC_PCU_REG_MISCMODE_OFFSET 0x48 -#define MAC_PCU_REG_MISCMODE_BSSID_MATCH_FORCE_FIELD 0 -#define MAC_PCU_REG_MISCMODE_ACKSIFS_MEMORY_FIELD_RESERVED 1 -#define MAC_PCU_REG_MISCMODE_MIC_NEW_LOCATION_FIELD 2 -#define MAC_PCU_REG_MISCMODE_TX_ADD_TSF_FIELD 3 -#define MAC_PCU_REG_MISCMODE_CCK_SIFS_MODE_FIELD 4 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MODE_FIELD_RESERVED 5 -#define MAC_PCU_REG_MISCMODE_BFCOEF_ENABLE_FIELD 6 -#define MAC_PCU_REG_MISCMODE_BFCOEF_UPDATE_SELF_GEN_FIELD 7 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MCAST_FIELD 8 -#define MAC_PCU_REG_MISCMODE_DUAL_CHAIN_ANT_MODE_FIELD 9 -#define MAC_PCU_REG_MISCMODE_FALCON_DESC_MODE_FIELD 10 -#define MAC_PCU_REG_MISCMODE_KC_RX_ANT_UPDATE_FIELD 11 -#define MAC_PCU_REG_MISCMODE_TXOP_TBTT_LIMIT_FIELD 12 -#define MAC_PCU_REG_MISCMODE_FALCON_BB_INTERFACE_FIELD 13 -#define MAC_PCU_REG_MISCMODE_MISS_BEACON_IN_SLEEP_FIELD 14 -#define MAC_PCU_REG_MISCMODE_BUG_12306_FIX_ENABLE_FIELD 17 -#define MAC_PCU_REG_MISCMODE_FORCE_QUIET_COLLISION_FIELD 18 -#define MAC_PCU_REG_MISCMODE_BUG_12549_FORCE_TXBF_FIELD 19 -#define MAC_PCU_REG_MISCMODE_BT_ANT_PREVENTS_RX_FIELD 20 -#define MAC_PCU_REG_MISCMODE_TBTT_PROTECT_FIELD 21 -#define MAC_PCU_REG_MISCMODE_HCF_POLL_CANCELS_NAV_FIELD 22 -#define MAC_PCU_REG_MISCMODE_RX_HCF_POLL_ENABLE_FIELD 23 -#define MAC_PCU_REG_MISCMODE_CLEAR_VMF_FIELD 24 -#define MAC_PCU_REG_MISCMODE_CLEAR_FIRST_HCF_FIELD 25 -#define MAC_PCU_REG_MISCMODE_ADHOC_MCAST_KEYID_ENABLE_FIELD 26 -#define MAC_PCU_REG_MISCMODE_ALLOW_RAC_FIELD 27 -#define MAC_PCU_REG_MISCMODE_BSSID_MATCH_FORCE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_ACKSIFS_MEMORY_RESET_RESERVED 0x0 -#define MAC_PCU_REG_MISCMODE_MIC_NEW_LOCATION_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_TX_ADD_TSF_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_CCK_SIFS_MODE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MODE_RESET_RESERVED 0x0 -#define MAC_PCU_REG_MISCMODE_BFCOEF_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_BFCOEF_UPDATE_SELF_GEN_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MCAST_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_DUAL_CHAIN_ANT_MODE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_FALCON_DESC_MODE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_KC_RX_ANT_UPDATE_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_TXOP_TBTT_LIMIT_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_FALCON_BB_INTERFACE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_MISS_BEACON_IN_SLEEP_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_BUG_12306_FIX_ENABLE_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_FORCE_QUIET_COLLISION_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_BUG_12549_FORCE_TXBF_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_BT_ANT_PREVENTS_RX_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_TBTT_PROTECT_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_HCF_POLL_CANCELS_NAV_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_RX_HCF_POLL_ENABLE_RESET 0x1 -#define MAC_PCU_REG_MISCMODE_CLEAR_VMF_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_CLEAR_FIRST_HCF_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_ADHOC_MCAST_KEYID_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE_ALLOW_RAC_RESET 0x0 - -#define MAC_PCU_REG_FILTOFDM_OFFSET 0x49 -#define MAC_PCU_REG_FILTOFDM_CNT_FIELD 23:0 -#define MAC_PCU_REG_FILTOFDM_CNT_RESET 0x0 - -#define MAC_PCU_REG_FILTCCK_OFFSET 0x4A -#define MAC_PCU_REG_FILTCCK_CNT_FIELD 23:0 -#define MAC_PCU_REG_FILTCCK_CNT_RESET 0x0 - -#define MAC_PCU_REG_PHYCNT1_OFFSET 0x4B -#define MAC_PCU_REG_PHYCNT1_FIELD 23:0 -#define MAC_PCU_REG_PHYCNT1_RESET 0x0 - -#define MAC_PCU_REG_PHYCNTMASK1_OFFSET 0x4C -#define MAC_PCU_REG_PHYCNTMASK1_FIELD 31:0 -#define MAC_PCU_REG_PHYCNTMASK1_RESET 0x0 - -#define MAC_PCU_REG_PHYCNT2_OFFSET 0x4D -#define MAC_PCU_REG_PHYCNT2_FIELD 23:0 -#define MAC_PCU_REG_PHYCNT2_RESET 0x0 - -#define MAC_PCU_REG_PHYCNTMASK2_OFFSET 0x4E -#define MAC_PCU_REG_PHYCNTMASK2_FIELD 31:0 -#define MAC_PCU_REG_PHYCNTMASK2_RESET 0x0 - -#define MAC_PCU_REG_TSFTHRESH_OFFSET 0x4F -#define MAC_PCU_REG_TSFTHRESH_FIELD 15:0 -#define MAC_PCU_REG_TSFTHRESH_RESET 0xFFFF - -//#define MAC_PCU_REG_TSFCAL_OFFSET 0x50 -//#define MAC_PCU_REG_TSFCAL_COUNT_FIELD 3:0 -//#define MAC_PCU_REG_TSFCAL_INTERVAL_FIELD 7:4 -//#define MAC_PCU_REG_TSFCAL_ENABLE_FIELD 8 -//#define MAC_PCU_REG_TSFCAL_AUTO_CAL_FIELD 9 -//#define MAC_PCU_REG_TSFCAL_VALUE_WE_FIELD 10 -//#define MAC_PCU_REG_TSFCAL_VALUE_FIELD 31:16 -//#define MAC_PCU_REG_TSFCAL_COUNT_RESET 0x8 -//#define MAC_PCU_REG_TSFCAL_INTERVAL_RESET 0xa -//#define MAC_PCU_REG_TSFCAL_ENABLE_RESET 0x1 -//#define MAC_PCU_REG_TSFCAL_AUTO_CAL_RESET 0x1 -//#define MAC_PCU_REG_TSFCAL_VALUE_WE_RESET 0x0 -//#define MAC_PCU_REG_TSFCAL_VALUE_RESET 0x8000 - -#define MAC_PCU_REG_PHYERR_EIFS_OFFSET 0x51 -#define MAC_PCU_REG_PHYERR_EIFS_MASK_FIELD 31:0 -#define MAC_PCU_REG_PHYERR_EIFS_MASK_RESET 0x0 - -//#define MAC_PCU_REG_SYNC1_OFFSET 0x52 -//#define MAC_PCU_REG_SYNC1_TIME_FIELD 30:0 -//#define MAC_PCU_REG_SYNC1_TIME_RESET 0x0 - -//#define MAC_PCU_REG_SYNC2_OFFSET 0x53 -//#define MAC_PCU_REG_SYNC2_TIME_OFFSET_FIELD 7:0 -//#define MAC_PCU_REG_SYNC2_MASTER_FIELD 8 -//#define MAC_PCU_REG_SYNC2_REPLACE_FIELD 9 -//#define MAC_PCU_REG_SYNC2_TUNE_FIELD 10 -//#define MAC_PCU_REG_SYNC2_CLEAR_FIELD 11 -//#define MAC_PCU_REG_SYNC2_INTR_THRESH_FIELD 31:16 -//#define MAC_PCU_REG_SYNC2_TIME_OFFSET_RESET 0x0 -//#define MAC_PCU_REG_SYNC2_MASTER_RESET 0x0 -//#define MAC_PCU_REG_SYNC2_REPLACE_RESET 0x0 -//#define MAC_PCU_REG_SYNC2_TUNE_RESET 0x0 -//#define MAC_PCU_REG_SYNC2_CLEAR_RESET 0x0 -//#define MAC_PCU_REG_SYNC2_INTR_THRESH_RESET 0xFFFF - -//#define MAC_PCU_REG_SYNC3_OFFSET 0x54 -//#define MAC_PCU_REG_SYNC3_MCAST_ADDR_L_FIELD 31:0 -//#define MAC_PCU_REG_SYNC3_MCAST_ADDR_L_RESET 0x0 - -//#define MAC_PCU_REG_SYNC4_OFFSET 0x55 -//#define MAC_PCU_REG_SYNC4_MCAST_ADDR_U_FIELD 15:0 -//#define MAC_PCU_REG_SYNC4_MCAST_ADDR_U_RESET 0x0 - -//#define MAC_PCU_REG_SYNC5_OFFSET 0x56 -//#define MAC_PCU_REG_SYNC5_RX_TIME_FIELD 30:0 - -//#define MAC_PCU_REG_SYNC6_OFFSET 0x57 -//#define MAC_PCU_REG_SYNC6_INC_FIELD 31:0 - -//#define MAC_PCU_REG_SYNC7_OFFSET 0x58 -//#define MAC_PCU_REG_SYNC7_LAST_TIME_FIELD 30:0 - -//#define MAC_PCU_REG_SYNC8_OFFSET 0x59 -//#define MAC_PCU_REG_SYNC8_UPDATED_TIME_FIELD 30:0 - -#define MAC_PCU_REG_PHYCNT3_OFFSET 0x5A -#define MAC_PCU_REG_PHYCNT3_FIELD 23:0 -#define MAC_PCU_REG_PHYCNT3_RESET 0x0 - -#define MAC_PCU_REG_PHYCNTMASK3_OFFSET 0x5B -#define MAC_PCU_REG_PHYCNTMASK3_FIELD 31:0 -#define MAC_PCU_REG_PHYCNTMASK3_RESET 0x0 - -#define MAC_PCU_REG_BTMODE_OFFSET 0x5C -#define MAC_PCU_REG_BTMODE_TIME_EXTEND_FIELD 7:0 -#define MAC_PCU_REG_BTMODE_TXSTATE_EXTEND_FIELD 8 -#define MAC_PCU_REG_BTMODE_TX_FRAME_EXTEND_FIELD 9 -#define MAC_PCU_REG_BTMODE_MODE_FIELD 11:10 -#define MAC_PCU_REG_BTMODE_QUIET_FIELD 12 -#define MAC_PCU_REG_BTMODE_QCU_THRESH_FIELD 16:13 -#define MAC_PCU_REG_BTMODE_RX_CLEAR_POLARITY_FIELD 17 -#define MAC_PCU_REG_BTMODE_PRIORITY_TIME_FIELD 23:18 -#define MAC_PCU_REG_BTMODE_FIRST_SLOT_TIME_FIELD 31:24 -#define MAC_PCU_REG_BTMODE_TIME_EXTEND_RESET 0x20 -#define MAC_PCU_REG_BTMODE_TXSTATE_EXTEND_RESET 0x1 -#define MAC_PCU_REG_BTMODE_TX_FRAME_EXTEND_RESET 0x1 -#define MAC_PCU_REG_BTMODE_MODE_RESET 0x3 -#define MAC_PCU_REG_BTMODE_QUIET_RESET 0x1 -#define MAC_PCU_REG_BTMODE_QCU_THRESH_RESET 0x1 -#define MAC_PCU_REG_BTMODE_RX_CLEAR_POLARITY_RESET 0x0 -#define MAC_PCU_REG_BTMODE_PRIORITY_TIME_RESET 0x05 -#define MAC_PCU_REG_BTMODE_FIRST_SLOT_TIME_RESET 0x9B - -#define MAC_PCU_REG_BTWEIGHT_OFFSET 0x5D -#define MAC_PCU_REG_BTWEIGHT_BT_WEIGHT_FIELD 15:0 -#define MAC_PCU_REG_BTWEIGHT_WL_WEIGHT_FIELD 31:16 -#define MAC_PCU_REG_BTWEIGHT_BT_WEIGHT_RESET 0xFA50 -#define MAC_PCU_REG_BTWEIGHT_WL_WEIGHT_RESET 0xFAA4 - -#define MAC_PCU_REG_HCF_OFFSET 0x5E -#define MAC_PCU_REG_HCF_TIMEOUT_FIELD 15:0 -#define MAC_PCU_REG_HCF_TIMEOUT_RESET 0x100 - -#define MAC_PCU_REG_BTMODE2_OFFSET 0x5F -#define MAC_PCU_REG_BTMODE2_BT_BCN_MISS_THRESH_FIELD 7:0 -#define MAC_PCU_REG_BTMODE2_BCN_MISS_CNT_FIELD 15:8 -#define MAC_PCU_REG_BTMODE2_BT_HOLD_RX_CLEAR_FIELD 16 -#define MAC_PCU_REG_BTMODE2_WL_CONTROL_ANT_FIELD 17 -#define MAC_PCU_REG_BTMODE2_RESPOND_TO_BT_ACTIVE_FIELD 18 -#define MAC_PCU_REG_BTMODE2_PROTECT_BT_AFTER_WAKEUP_FIELD 19 -#define MAC_PCU_REG_BTMODE2_DISABLE_BT_ANT_FIELD 20 -#define MAC_PCU_REG_BTMODE2_BT_BCN_MISS_THRESH_RESET 0 -#define MAC_PCU_REG_BTMODE2_BT_HOLD_RX_CLEAR_RESET 0 -#define MAC_PCU_REG_BTMODE2_WL_CONTROL_ANT_RESET 0x0 -#define MAC_PCU_REG_BTMODE2_RESPOND_TO_BT_ACTIVE_RESET 0x0 -#define MAC_PCU_REG_BTMODE2_PROTECT_BT_AFTER_WAKEUP_RESET 0x0 -#define MAC_PCU_REG_BTMODE2_DISABLE_BT_ANT_RESET 0x0 - -#define MAC_PCU_REG_BFCOEF1_OFFSET 0x60 -#define MAC_PCU_REG_BFCOEF1_UPPER_OFFSET 0x67 -#define MAC_PCU_REG_BFCOEF1_KEY_VALID_FIELD 31 -#define MAC_PCU_REG_BFCOEF1_KEYIDX_FIELD 30:24 -#define MAC_PCU_REG_BFCOEF1_TSF_FIELD 23:0 -#define MAC_PCU_REG_BFCOEF1_KEY_VALID_RESET 0x0 - -#define MAC_PCU_REG_BFCOEF2_OFFSET 0x70 -#define MAC_PCU_REG_BFCOEF2_THRESH_FIELD 22:0 -#define MAC_PCU_REG_BFCOEF2_LOCK_FIELD 31:24 -#define MAC_PCU_REG_BFCOEF2_THRESH_RESET 0x0 -#define MAC_PCU_REG_BFCOEF2_LOCK_RESET 0x0 - -#define MAC_PCU_REG_KCMASK_OFFSET 0x71 -#define MAC_PCU_REG_KCMASK_47_32_FIELD 15:0 -#define MAC_PCU_REG_KCMASK_47_32_RESET 0 -#define MAC_PCU_REG_KCMASK_31_0_FIELD 16 -#define MAC_PCU_REG_KCMASK_31_0_RESET 0 - -#define MAC_PCU_REG_TXSIFS_OFFSET 0x74 -#define MAC_PCU_REG_TXSIFS_SIFS_TIME_FIELD 7:0 -#define MAC_PCU_REG_TXSIFS_TX_LATENCY_FIELD 11:8 -#define MAC_PCU_REG_TXSIFS_ACK_SHIFT_FIELD 14:12 -#define MAC_PCU_REG_TXSIFS_SIFS_TIME_RESET 16 -#define MAC_PCU_REG_TXSIFS_TX_LATENCY_RESET 2 -#define MAC_PCU_REG_TXSIFS_ACK_SHIFT_RESET 3 - -#define MAC_PCU_REG_TXOP_X_OFFSET 0x7b -#define MAC_PCU_REG_TXOP_X_FIELD 7:0 -#define MAC_PCU_REG_TXOP_X_RESET 0 - -#define MAC_PCU_REG_TXOP_0_3_OFFSET 0x7c -#define MAC_PCU_REG_TXOP_0_FIELD 7:0 -#define MAC_PCU_REG_TXOP_1_FIELD 15:8 -#define MAC_PCU_REG_TXOP_2_FIELD 23:16 -#define MAC_PCU_REG_TXOP_3_FIELD 31:24 -#define MAC_PCU_REG_TXOP_0_RESET 0 -#define MAC_PCU_REG_TXOP_1_RESET 0 -#define MAC_PCU_REG_TXOP_2_RESET 0 -#define MAC_PCU_REG_TXOP_3_RESET 0 - -#define MAC_PCU_REG_TXOP_4_7_OFFSET 0x7d -#define MAC_PCU_REG_TXOP_4_FIELD 7:0 -#define MAC_PCU_REG_TXOP_5_FIELD 15:8 -#define MAC_PCU_REG_TXOP_6_FIELD 23:16 -#define MAC_PCU_REG_TXOP_7_FIELD 31:24 -#define MAC_PCU_REG_TXOP_4_RESET 0 -#define MAC_PCU_REG_TXOP_5_RESET 0 -#define MAC_PCU_REG_TXOP_6_RESET 0 -#define MAC_PCU_REG_TXOP_7_RESET 0 - -#define MAC_PCU_REG_TXOP_8_11_OFFSET 0x7e -#define MAC_PCU_REG_TXOP_8_FIELD 7:0 -#define MAC_PCU_REG_TXOP_9_FIELD 15:8 -#define MAC_PCU_REG_TXOP_10_FIELD 23:16 -#define MAC_PCU_REG_TXOP_11_FIELD 31:24 -#define MAC_PCU_REG_TXOP_8_RESET 0 -#define MAC_PCU_REG_TXOP_9_RESET 0 -#define MAC_PCU_REG_TXOP_10_RESET 0 -#define MAC_PCU_REG_TXOP_11_RESET 0 - -#define MAC_PCU_REG_TXOP_12_15_OFFSET 0x7f -#define MAC_PCU_REG_TXOP_12_FIELD 7:0 -#define MAC_PCU_REG_TXOP_13_FIELD 15:8 -#define MAC_PCU_REG_TXOP_14_FIELD 23:16 -#define MAC_PCU_REG_TXOP_15_FIELD 31:24 -#define MAC_PCU_REG_TXOP_12_RESET 0 -#define MAC_PCU_REG_TXOP_13_RESET 0 -#define MAC_PCU_REG_TXOP_14_RESET 0 -#define MAC_PCU_REG_TXOP_15_RESET 0 - -#define MAC_PCU_REG_GNRCTMR_N_OFFSET 0x80 -#define MAC_PCU_REG_GNRCTMR_N_UPPER_OFFSET 0x87 -#define MAC_PCU_REG_GNRCTMR_N_FIELD 31:0 - -#define MAC_PCU_REG_GNRCTMR_P_OFFSET 0x88 -#define MAC_PCU_REG_GNRCTMR_P_UPPER_OFFSET 0x8F -#define MAC_PCU_REG_GNRCTMR_P_FIELD 27:0 - -#define MAC_PCU_REG_GNRCTMR_M_OFFSET 0x90 -#define MAC_PCU_REG_GNRCTMR_M_ENABLE_FIELD 7:0 -#define MAC_PCU_REG_GNRCTMR_M_OVERFLOW_INDEX_FIELD 10:8 -#define MAC_PCU_REG_GNRCTMR_M_THRESH_FIELD 31:12 -#define MAC_PCU_REG_GNRCTMR_M_ENABLE_RESET 0x0 -#define MAC_PCU_REG_GNRCTMR_M_THRESH_RESET 0x00100 - -#define MAC_PCU_REG_SLP32_MODE_OFFSET 0x91 -#define MAC_PCU_REG_SLP32_MODE_HALF_CLK_LATENCY_FIELD 19:0 -#define MAC_PCU_REG_SLP32_MODE_ENABLE_FIELD 20 -#define MAC_PCU_REG_SLP32_MODE_TSF_WRITE_STAT_FIELD 21 -#define MAC_PCU_REG_SLP32_MODE_HALF_CLK_LATENCY_RESET 0x0F424 -#define MAC_PCU_REG_SLP32_MODE_ENABLE_RESET 0x1 - -#define MAC_PCU_REG_SLP32_WAKE_OFFSET 0x92 -#define MAC_PCU_REG_SLP32_WAKE_XTL_TIME_FIELD 15:0 -#define MAC_PCU_REG_SLP32_WAKE_XTL_TIME_RESET 0x07EF - -#define MAC_PCU_REG_SLP32_TSF_INC_OFFSET 0x93 -#define MAC_PCU_REG_SLP32_TSF_INC_FIELD 19:0 -#define MAC_PCU_REG_SLP32_TSF_INC_RESET 0x1E848 - -#define MAC_PCU_REG_SLPMIB1_OFFSET 0x94 -#define MAC_PCU_REG_SLPMIB1_SLEEP_CNT_FIELD 31:0 - -#define MAC_PCU_REG_SLPMIB2_OFFSET 0x95 -#define MAC_PCU_REG_SLPMIB2_CYCLE_CNT_FIELD 31:0 - -#define MAC_PCU_REG_SLPMIB3_OFFSET 0x96 -#define MAC_PCU_REG_SLPMIB3_CLR_CNT_FIELD 0 -#define MAC_PCU_REG_SLPMIB3_PEND_FIELD 1 - -#define MAC_PCU_REG_MISCMODE2_OFFSET 0x97 -#define MAC_PCU_REG_MISCMODE2_MGMT_CRYPTO_ENABLE_FIELD 0 -#define MAC_PCU_REG_MISCMODE2_NO_CRYPTO_FOR_NON_DATA_PKT_FIELD 1 -#define MAC_PCU_REG_MISCMODE2_MGMT_QOS_FIELD 15:8 -#define MAC_PCU_REG_MISCMODE2_BC_MC_WAPI_MODE_FIELD 16 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_FOR_1ST_PKT_FIELD 17 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_IF_ZERO_FIELD 18 -#define MAC_PCU_REG_MISCMODE2_MGMT_CRYPTO_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE2_NO_CRYPTO_FOR_NON_DATA_PKT_RESET 0x0 -#define MAC_PCU_REG_MISCMODE2_MGMT_QOS_RESET 0x10 -#define MAC_PCU_REG_MISCMODE2_BC_MC_WAPI_MODE_RESET 0x0 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_FOR_1ST_PKT_RESET 0x0 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_IF_ZERO_RESET 0x0 - -#define MAC_PCU_REG_SLP4_OFFSET 0x98 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_DUR_FIELD 15:0 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_ENABLE_FIELD 16 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_DUR_RESET 0x5 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_ENABLE_RESET 0x0 - -#define MAC_PCU_REG_SLP5_OFFSET 0x99 -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_FIELD 23:0 -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_ENABLE_FIELD 24 -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_RESET 0xff_ffff -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_ENABLE_RESET 0x0 - -#define MAC_PCU_REG_MCICTL_OFFSET 0x9a -#define MAC_PCU_REG_MCICTL_MCI_ENABLE_FIELD 0 -#define MAC_PCU_REG_MCICTL_OLA_ENABLE_FIELD 1 -#define MAC_PCU_REG_MCICTL_PREEMPT_ENABLE_FIELD 2 -#define MAC_PCU_REG_MCICTL_CHANNEL_BUSY_ENABLE_FIELD 3 -#define MAC_PCU_REG_MCICTL_EARLY_NOTIFY_DELAY_FIELD 9:4 -#define MAC_PCU_REG_MCICTL_BMISS_FORCE_WL_FIELD 10 -#define MAC_PCU_REG_MCICTL_SLEEP_FORCE_BT_FIELD 11 -#define MAC_PCU_REG_MCICTL_HP_QCU_STOMP_BT_FIELD 12 -#define MAC_PCU_REG_MCICTL_MCI_BUSY_FIELD 31 -#define MAC_PCU_REG_MCICTL_MCI_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MCICTL_OLA_ENABLE_RESET 0x1 -#define MAC_PCU_REG_MCICTL_PREEMPT_ENABLE_RESET 0x1 -#define MAC_PCU_REG_MCICTL_CHANNEL_BUSY_ENABLE_RESET 0x1 -#define MAC_PCU_REG_MCICTL_EARLY_NOTIFY_DELAY_RESET 0x5 -#define MAC_PCU_REG_MCICTL_BMISS_FORCE_WL_RESET 0x0 -#define MAC_PCU_REG_MCICTL_SLEEP_FORCE_BT_RESET 0x1 -#define MAC_PCU_REG_MCICTL_HP_QCU_STOMP_BT_RESET 0x0 - -#define MAC_PCU_REG_MCIISR_OFFSET 0x9b -#define MAC_PCU_REG_MCIISR_ACT_RPT_RCV_INT_FIELD 0 -#define MAC_PCU_REG_MCIISR_ACT_DEN_RCV_INT_FIELD 1 -#define MAC_PCU_REG_MCIISR_FRQ_RPT_RCV_INT_FIELD 2 -#define MAC_PCU_REG_MCIISR_QOS_RPT_RCV_INT_FIELD 3 -#define MAC_PCU_REG_MCIISR_GEN_RPT_RCV_INT_FIELD 4 -#define MAC_PCU_REG_MCIISR_ACT_RPT_RCV_INT_RESET 0x0 -#define MAC_PCU_REG_MCIISR_ACT_DEN_RCV_INT_RESET 0x0 -#define MAC_PCU_REG_MCIISR_FRQ_RPT_RCV_INT_RESET 0x0 -#define MAC_PCU_REG_MCIISR_QOS_RPT_RCV_INT_RESET 0x0 -#define MAC_PCU_REG_MCIISR_GEN_RPT_RCV_INT_RESET 0x0 - -#define MAC_PCU_REG_MCIIER_OFFSET 0x9c -#define MAC_PCU_REG_MCIIER_ACT_RPT_RCV_INT_ENABLE_FIELD 0 -#define MAC_PCU_REG_MCIIER_ACT_DEN_RCV_INT_ENABLE_FIELD 1 -#define MAC_PCU_REG_MCIIER_FRQ_RPT_RCV_INT_ENABLE_FIELD 2 -#define MAC_PCU_REG_MCIIER_QOS_RPT_RCV_INT_ENABLE_FIELD 3 -#define MAC_PCU_REG_MCIIER_GEN_RPT_RCV_INT_ENABLE_FIELD 4 -#define MAC_PCU_REG_MCIIER_ACT_RPT_RCV_INT_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MCIIER_ACT_DEN_RCV_INT_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MCIIER_FRQ_RPT_RCV_INT_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MCIIER_QOS_RPT_RCV_INT_ENABLE_RESET 0x0 -#define MAC_PCU_REG_MCIIER_GEN_RPT_RCV_INT_ENABLE_RESET 0x0 - -#define MAC_PCU_REG_MCIWLP_OFFSET 0x9d -#define MAC_PCU_REG_MCIWLP_RESET 0x0 - -#define MAC_PCU_REG_MCIARW_OFFSET 0x9e -#define MAC_PCU_REG_MCIARW_RESET 0x0 - -#define MAC_PCU_REG_MCIARR_OFFSET 0x9f - -#define MAC_PCU_REG_MCIADW_OFFSET 0xa0 -#define MAC_PCU_REG_MCIADW_RESET 0x0 - -#define MAC_PCU_REG_MCIADR_OFFSET 0xa1 - -#define MAC_PCU_REG_MCIFRW_OFFSET 0xa2 -#define MAC_PCU_REG_MCIFRW_RESET 0x0 - -#define MAC_PCU_REG_MCIFRR_OFFSET 0xa3 - -#define MAC_PCU_REG_MCIQRW_OFFSET 0xa4 -#define MAC_PCU_REG_MCIQRW_RESET 0x0 - -#define MAC_PCU_REG_MCIQRR_OFFSET 0xa5 - -#define MAC_PCU_REG_MCIGRW_OFFSET 0xa6 -#define MAC_PCU_REG_MCIGRW_RESET 0x0 - -#define MAC_PCU_REG_MCIGRR_OFFSET 0xa7 - -#define MAC_PCU_REG_MCISTAT_OFFSET 0xa8 -#define MAC_PCU_REG_MCISTAT_ACT_RPT_RCV_CNT_FIELD 7:0 -#define MAC_PCU_REG_MCISTAT_QC_CNT_FIELD 15:8 -#define MAC_PCU_REG_MCISTAT_OLA_CNT_FIELD 23:16 -#define MAC_PCU_REG_MCISTAT_PREEMPT_CNT_FIELD 31:24 -#define MAC_PCU_REG_MCISTAT_ACT_RPT_RCV_CNT_RESET 0x0 -#define MAC_PCU_REG_MCISTAT_QC_CNT_RESET 0x0 -#define MAC_PCU_REG_MCISTAT_OLA_CNT_RESET 0x0 -#define MAC_PCU_REG_MCISTAT_PREEMPT_CNT_RESET 0x0 - -#define MAC_PCU_REG_BASIC_RATE_SET0_OFFSET 0xa9 -#define MAC_PCU_REG_BRATE_1MB_L_FIELD 4:0 -#define MAC_PCU_REG_BRATE_2MB_L_FIELD 9:5 -#define MAC_PCU_REG_BRATE_2MB_S_FIELD 14:10 -#define MAC_PCU_REG_BRATE_5_5MB_L_FIELD 19:15 -#define MAC_PCU_REG_BRATE_5_5MB_S_FIELD 24:20 -#define MAC_PCU_REG_BRATE_11MB_L_FIELD 29:25 -#define MAC_PCU_REG_BRATE_1MB_L_RESET #CCK_RATE_1Mb_L -#define MAC_PCU_REG_BRATE_2MB_L_RESET #CCK_RATE_2Mb_L -#define MAC_PCU_REG_BRATE_2MB_S_RESET #CCK_RATE_2Mb_S -#define MAC_PCU_REG_BRATE_5_5MB_L_RESET #CCK_RATE_5_5Mb_L -#define MAC_PCU_REG_BRATE_5_5MB_S_RESET #CCK_RATE_5_5Mb_S -#define MAC_PCU_REG_BRATE_11MB_L_RESET #CCK_RATE_11Mb_L - -#define MAC_PCU_REG_BASIC_RATE_SET1_OFFSET 0xaa -#define MAC_PCU_REG_BRATE_11MB_S_FIELD 4:0 -#define MAC_PCU_REG_BRATE_6MB_FIELD 9:5 -#define MAC_PCU_REG_BRATE_9MB_FIELD 14:10 -#define MAC_PCU_REG_BRATE_12MB_FIELD 19:15 -#define MAC_PCU_REG_BRATE_18MB_FIELD 24:20 -#define MAC_PCU_REG_BRATE_24MB_FIELD 29:25 -#define MAC_PCU_REG_BRATE_11MB_S_RESET #CCK_RATE_11Mb_S -#define MAC_PCU_REG_BRATE_6MB_RESET #OFDM_RATE_6Mb -#define MAC_PCU_REG_BRATE_9MB_RESET #OFDM_RATE_6Mb -#define MAC_PCU_REG_BRATE_12MB_RESET #OFDM_RATE_12Mb -#define MAC_PCU_REG_BRATE_18MB_RESET #OFDM_RATE_12Mb -#define MAC_PCU_REG_BRATE_24MB_RESET #OFDM_RATE_24Mb - -#define MAC_PCU_REG_BASIC_RATE_SET2_OFFSET 0xab -#define MAC_PCU_REG_BRATE_36MB_FIELD 4:0 -#define MAC_PCU_REG_BRATE_48MB_FIELD 9:5 -#define MAC_PCU_REG_BRATE_54MB_FIELD 14:10 -#define MAC_PCU_REG_BRATE_36MB_RESET #OFDM_RATE_24Mb -#define MAC_PCU_REG_BRATE_48MB_RESET #OFDM_RATE_24Mb -#define MAC_PCU_REG_BRATE_54MB_RESET #OFDM_RATE_24Mb - -#define MAC_PCU_REG_SEC_BSSID_L32_OFFSET 0xac -#define MAC_PCU_REG_SEC_BSSID_L32_FIELD 31:0 -#define MAC_PCU_REG_SEC_BSSID_L32_RESET 0x0 - -#define MAC_PCU_REG_SEC_BSSID_U16_OFFSET 0xad -#define MAC_PCU_REG_SEC_BSSID_U16_FIELD 15:0 -#define MAC_PCU_REG_SEC_BSSID_ENABLE_FIELD 16 -#define MAC_PCU_REG_SEC_BSSID_U16_RESET 0x0 -#define MAC_PCU_REG_SEC_BSSID_ENABLE_RESET 0x0 - -#define MAC_PCU_REG_FTYPE_OFFSET 0x140 -#define MAC_PCU_REG_FTYPE_UPPER_OFFSET 0x17F -#define MAC_PCU_REG_FTYPE_BFCOEF_RX_UPDATE_NORMAL_FIELD 0 -#define MAC_PCU_REG_FTYPE_BFCOEF_RX_UPDATE_SELF_GEN_FIELD 1 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_NORMAL_FIELD 2 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_SELF_GEN_FIELD 3 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_GEN_FIELD 4 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_MCAST_FIELD 5 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_ALL_FIELD 6 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_DIRECTED_FIELD 7 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_MCAST_FIELD 8 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_BCAST_FIELD 9 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_MC_BC_BSSID_FIELD 10 - -#define MAC_PCU_REG_ACKSIFSMEM_OFFSET_RESERVED 0x1A0 -#define MAC_PCU_REG_ACKSIFSMEM_UPPER_OFFSET_RESERVED 0x1BF -#define MAC_PCU_REG_ACKSIFSMEM_NORMAL_FIELD_RESERVED 9:0 -#define MAC_PCU_REG_ACKSIFSMEM_TURBO_FIELD_RESERVED 19:10 - -#define MAC_PCU_REG_DUR_OFFSET 0x1C0 -#define MAC_PCU_REG_DUR_UPPER_OFFSET 0x1DF -#define MAC_PCU_REG_DUR_RATE_TO_DURATION_FIELD 15:0 - -#define MAC_PCU_REG_RTD_OFFSET 0x1F0 -#define MAC_PCU_REG_RTD_UPPER_OFFSET 0x1F7 -#define MAC_PCU_REG_RTD_RATE_TO_DB_0_FIELD 4:0 -#define MAC_PCU_REG_RTD_RATE_TO_DB_1_FIELD 12:8 -#define MAC_PCU_REG_RTD_RATE_TO_DB_2_FIELD 20:16 -#define MAC_PCU_REG_RTD_RATE_TO_DB_3_FIELD 28:24 - -#define MAC_PCU_REG_DTR_OFFSET 0x1F8 -#define MAC_PCU_REG_DTR_UPPER_OFFSET 0x1FF -#define MAC_PCU_REG_DTR_DB_TO_RATE_0_FIELD 4:0 -#define MAC_PCU_REG_DTR_DB_TO_RATE_1_FIELD 12:8 -#define MAC_PCU_REG_DTR_DB_TO_RATE_2_FIELD 20:16 -#define MAC_PCU_REG_DTR_DB_TO_RATE_3_FIELD 28:24 - -#define MAC_PCU_REG_KC_OFFSET 0x200 -#define MAC_PCU_REG_KC_UPPER_OFFSET 0x5FF -#define MAC_PCU_REG_KC_KEY_31_0_FIELD 31:0 -#define MAC_PCU_REG_KC_KEY_47_32_FIELD 15:0 -#define MAC_PCU_REG_KC_KEY_79_48_FIELD 31:0 -#define MAC_PCU_REG_KC_KEY_95_80_FIELD 15:0 -#define MAC_PCU_REG_KC_KEY_127_96_FIELD 31:0 -#define MAC_PCU_REG_KC_KEY_TYPE_FIELD 2:0 -#define MAC_PCU_REG_KC_LAST_ANTENNA_FIELD 3 -#define MAC_PCU_REG_KC_ASYNC_ACK_OFFSET_FIELD 8:4 -#define MAC_PCU_REG_KC_UPDATE_BEAM_FORMING_FIELD 9 -#define MAC_PCU_REG_KC_RX_CHAIN_0_ACK_ANT_FIELD 10 -#define MAC_PCU_REG_KC_RX_CHAIN_1_ACK_ANT_FIELD 11 -#define MAC_PCU_REG_KC_TX_CHAIN_0_ANT_SEL_FIELD 12 -#define MAC_PCU_REG_KC_TX_CHAIN_1_ANT_SEL_FIELD 13 -#define MAC_PCU_REG_KC_TX_CHAIN_SEL_FIELD 14 -#define MAC_PCU_REG_KC_ADDR_32_1_FIELD 31:0 -#define MAC_PCU_REG_KC_ADDR_47_33_FIELD 14:0 -#define MAC_PCU_REG_KC_VALID_FIELD 1 - -//Misc -#define ELEM_START 36 -#define CFP_ELEM 4 - -#endif diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mac_pcu.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mac_pcu.vrh deleted file mode 100644 index 0ed8ff6737d0..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mac_pcu.vrh +++ /dev/null @@ -1,979 +0,0 @@ - -#define _MAC_PCU_H - -#define FIFO_BOUND 1024 - -#define CLK32_TIMER0 0 -#define CLK32_TIMER1 1 -#define CLK32_TIMER2 2 -#define CLK32_TIMER3 3 -#define CLK32_TSF_L32 4 -#define CLK32_TSF_U32 5 -#define CLK32_SLP1 6 -#define CLK32_SLP2 7 -#define CLK32_SLP3 8 -#define CLK32_QT1 9 -#define CLK32_QT2 10 -//#define CLK32_TSFCAL 11 - -//#define CLK_S_SYNC1 0 -//#define CLK_S_SYNC6 1 -//#define CLK_S_SYNC7 2 -//#define CLK_S_SYNC8 3 - -#define KTYPE_40 0 -#define KTYPE_104 1 -#define KTYPE_TKIP_NO_MIC 2 -#define KTYPE_128 3 -#define KTYPE_TKIP 4 -//#define KTYPE_AES_OCB 5 -#define KTYPE_WAPI 5 -#define KTYPE_AES_CCM 6 -#define KTYPE_NOTHING 7 - -//Frame Type in Descriptor -#define TXDESC_FT_NORMAL 0 -#define TXDESC_FT_ATIM 1 -#define TXDESC_FT_PS_POLL 2 -#define TXDESC_FT_BEACON 3 -#define TXDESC_FT_PROBE_RESP 4 -#define TXDESC_FT_CHIRP 5 -#define TXDESC_FT_GROUP_POLL 6 -#define TXDESC_FT_DIRECT_POLL 7 -//#define TXDESC_FT_SYNC 8 -#define TXDESC_FT_BEACON_NO_TSF_UPDATE 9 - -//Frame Type: Management -#define FTYPE_ASSOCIATION_REQ 6'b000000 -#define FTYPE_ASSOCIATION_RES 6'b000100 -#define FTYPE_REASSOCIATION_REQ 6'b001000 -#define FTYPE_REASSOCIATION_RES 6'b001100 -#define FTYPE_PBREQ 6'b010000 // change to TYPE_PROBE_REQ TBD -#define FTYPE_PBRES 6'b010100 // change to TYPE_PROBE_RES TBD -#define FTYPE_BEACON 6'b100000 -#define FTYPE_ATIM 6'b100100 -#define FTYPE_DISASSOCIATE 6'b101000 -#define FTYPE_AUTHENICATE 6'b101100 -#define FTYPE_DEAUTHENICATE 6'b110000 - -//Frame Type: Control -#define FTYPE_PSPOLL 6'b101001 -#define FTYPE_RTS 6'b101101 -#define FTYPE_CTS 6'b110001 -#define FTYPE_ACK 6'b110101 -#define FTYPE_CFEND 6'b111001 -#define FTYPE_CFEND_ACK 6'b111101 // change to FTYPE_CFEND_ACK TBD - -//Frame Type: Data -#define FTYPE_DATA 6'b000010 -#define FTYPE_DATA_CFACK 6'b000110 -#define FTYPE_DATA_CFPOLL 6'b001010 -#define FTYPE_DATA_CFACK_CFPOLL 6'b001110 -#define FTYPE_NULL 6'b010010 -#define FTYPE_CFACK 6'b010110 -#define FTYPE_CFPOLL 6'b011010 -#define FTYPE_CFACK_CFPOLL 6'b011110 - -//Frame Control Fields -#define FCTL_TO_DS 8 -#define FCTL_FROM_DS 9 -#define FCTL_MORE_FRAG 10 -#define FCTL_RETRY 11 -#define FCTL_POWER_MGNT 12 -#define FCTL_MORE_DATA 13 -#define FCTL_WEP 14 -#define FCTL_TYPE 3:2 - -//Rate -#define OFDM_RATE_6Mb 5'h0b -#define OFDM_RATE_9Mb 5'h0f -#define OFDM_RATE_12Mb 5'h0a -#define OFDM_RATE_18Mb 5'h0e -#define OFDM_RATE_24Mb 5'h09 -#define OFDM_RATE_36Mb 5'h0d -#define OFDM_RATE_48Mb 5'h08 -#define OFDM_RATE_54Mb 5'h0c -#define CCK_RATE_1Mb_L 5'h1b -#define CCK_RATE_2Mb_L 5'h1a -#define CCK_RATE_2Mb_S 5'h1e -#define CCK_RATE_5_5Mb_L 5'h19 -#define CCK_RATE_5_5Mb_S 5'h1d -#define CCK_RATE_11Mb_L 5'h18 - -#define CCK_RATE_11Mb_S 5'h1c -#define XR_RATE_0_25Mb 5'h03 -#define XR_RATE_0_5Mb 5'h07 -#define XR_RATE_1Mb 5'h02 -#define XR_RATE_2Mb 5'h06 -#define XR_RATE_3Mb 5'h01 - -//Registers -#define PCU_REG 'h0 -#define KEY_REG 'h1 -#define D2A2_REG 'h3 - -#define REG_STA_ID0 'h0 -#define STA_ADDR_L32 31:0 - -#define REG_STA_ID1 'h1 -#define STA_ADDR_U16 15:0 -#define AP 16 -#define ADHOC 17 -#define PWR_SV 18 -#define NO_KEYSRCH 19 -#define PCF 20 -#define USE_DEF_ANT 21 -#define DEF_ANT_UPDATE 22 -#define RTS_DEF_ANT 23 -#define ACKCTS_6MB 24 -#define RATE_11B 25 -#define SECTOR_SELF_GEN 26 -#define CRPT_MIC_ENABLE 27 -#define KSRCH_MODE 28 -#define PRESERVE_SEQNUM 29 -#define CBCIV_ENDIAN 30 -#define ADHOC_MCAST_SEARCH 31 - -#define REG_BSS_ID0 'h2 -#define BSSID_L32 31:0 - -#define REG_BSS_ID1 'h3 -#define BSSID_U16 15:0 -#define AID 31:16 - -#define MAC_PCU_REG_BCNRSSI_OFFSET 'h4 -#define MAC_PCU_REG_BCNRSSI_BCN_RSSI_AVE_FIELD 11:0 -#define MAC_PCU_REG_BCNRSSI_BCN_RSSI_AVE_RESET 12'h800 - -#define REG_TIME_OUT 'h5 -#define ACK_TIME_OUT 15:0 -#define CTS_TIME_OUT 31:16 - -#define MAC_PCU_REG_BCNSIG_OFFSET 'h6 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_LO_THR_FIELD 7:0 -#define MAC_PCU_REG_BCNSIG_BCN_MISS_THR_FIELD 15:8 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_HI_THR_FIELD 23:16 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_WEIGHT_FIELD 28:24 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_RESET_FIELD 29 -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_LO_THR_RESET 0 -#define MAC_PCU_REG_BCNSIG_BCN_MISS_THR_RESET 8'hFF -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_HI_THR_RESET 8'h7F -#define MAC_PCU_REG_BCNSIG_BCN_RSSI_WEIGHT_RESET 0 - -#define REG_USEC 'h7 -#define USEC 6:0 -#define USEC32 13:7 -#define TX_DELAY 18:14 -#define RX_DELAY 24:19 - -#define REG_BEACON 'h8 -#define BEACON_PERIOD 15:0 -#define TIM_OFFSET 22:16 -#define RESET_TSF 24 - -#define REG_CFP_PERIOD 'h9 - -#define REG_TIMER0 'ha - -#define REG_TIMER1 'hb - -#define REG_TIMER2 'hc - -#define REG_TIMER3 'hd - -#define REG_CFP_DUR 'he - -#define REG_RX_FILTER 'hf -#define UNICAST 0 -#define MULTICAST 1 -#define BROADCAST 2 -#define CONTROL 3 -#define BEACON 4 -#define PROMISCUOUS 5 -#define XR_POLL 6 -#define PROBE_REQ 7 -//#define SYNC 8 -#define MY_BEACON 9 - -#define REG_MCAST_FIL0 'h10 - -#define REG_MCAST_FIL1 'h11 - -#define MAC_PCU_REG_DIAGSW_OFFSET 'h12 -#define MAC_PCU_REG_DIAGSW_DIS_WEP_ACK_FIELD 0 -#define MAC_PCU_REG_DIAGSW_DIS_ACK_FIELD 1 -#define MAC_PCU_REG_DIAGSW_DIS_CTS_FIELD 2 -#define MAC_PCU_REG_DIAGSW_DIS_ENC_FIELD 3 -#define MAC_PCU_REG_DIAGSW_DIS_DEC_FIELD 4 -#define MAC_PCU_REG_DIAGSW_DIS_RX_FIELD 5 -#define MAC_PCU_REG_DIAGSW_LOOP_BACK_FIELD 6 -#define MAC_PCU_REG_DIAGSW_CORR_FCS_FIELD 7 -#define MAC_PCU_REG_DIAGSW_CHAN_INFO_FIELD 8 -#define MAC_PCU_REG_DIAGSW_RESERVED_FIELD 16:9 -#define MAC_PCU_REG_DIAGSW_ACCEPT_NONV0_FIELD 17 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_0_1_FIELD 19:18 -#define MAC_PCU_REG_DIAGSW_RXCLR_HIGH_FIELD 20 -#define MAC_PCU_REG_DIAGSW_IGNORE_NAV_FIELD 21 -#define MAC_PCU_REG_DIAGSW_CHANIDLE_HIGH_FIELD 22 -#define MAC_PCU_REG_DIAGSW_PHYERR_ENABLE_NEW_FIELD 23 -#define MAC_PCU_REG_DIAGSW_DUAL_CHAIN_CHAN_INFO_FIELD 24 -#define MAC_PCU_REG_DIAGSW_FORCE_RX_ABORT_FIELD 25 -#define MAC_PCU_REG_DIAGSW_SATURATE_CYCLE_CNT_FIELD 26 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_2_FIELD 27 -#define MAC_PCU_REG_DIAGSW_DIS_WEP_ACK_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_ACK_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_CTS_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_ENC_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_DEC_RESET 0 -#define MAC_PCU_REG_DIAGSW_DIS_RX_RESET 0 -#define MAC_PCU_REG_DIAGSW_LOOP_BACK_RESET 0 -#define MAC_PCU_REG_DIAGSW_CORR_FCS_RESET 0 -#define MAC_PCU_REG_DIAGSW_CHAN_INFO_RESET 0 -#define MAC_PCU_REG_DIAGSW_RESERVED_RESET 0 -#define MAC_PCU_REG_DIAGSW_ACCEPT_NONV0_RESET 0 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_0_1_RESET 0 -#define MAC_PCU_REG_DIAGSW_RXCLR_HIGH_RESET 0 -#define MAC_PCU_REG_DIAGSW_IGNORE_NAV_RESET 0 -#define MAC_PCU_REG_DIAGSW_CHANIDLE_HIGH_RESET 0 -#define MAC_PCU_REG_DIAGSW_PHYERR_ENABLE_NEW_RESET 0 -#define MAC_PCU_REG_DIAGSW_DUAL_CHAIN_CHAN_INFO_RESET 0 -#define MAC_PCU_REG_DIAGSW_FORCE_RX_ABORT_RESET 0 -#define MAC_PCU_REG_DIAGSW_SATURATE_CYCLE_CNT_RESET 0 -#define MAC_PCU_REG_DIAGSW_OBS_SEL_2_RESET 0 - -#define REG_TSF_L32 'h13 - -#define REG_TSF_U32 'h14 - -#define REG_TST_ADDAC 'h15 -#define TEST_MODE 0 -#define TEST_LOOP 1 -#define LOOP_LEN 12:2 -#define TEST_UPPER_8B 13 -#define TEST_MSB 14 -#define TEST_CAPTURE 15 - -#define REG_DEF_ANT 'h16 - -#define MAC_PCU_REG_MUTE_MASKS0_OFFSET 'h17 -#define MAC_PCU_REG_MUTE_MASKS0_FC_FIELD 15:0 -#define MAC_PCU_REG_MUTE_MASKS0_QOS_FIELD 31:16 -#define MAC_PCU_REG_MUTE_MASKS0_FC_RESET 16'hC7FF -#define MAC_PCU_REG_MUTE_MASKS0_QOS_RESET 16'hFFFF - -#define MAC_PCU_REG_MUTE_MASKS1_OFFSET 'h18 -#define MAC_PCU_REG_MUTE_MASKS1_SEQ_FIELD 15:0 -#define MAC_PCU_REG_MUTE_MASKS1_FC_MGMT_FIELD 31:16 -#define MAC_PCU_REG_MUTE_MASKS1_SEQ_RESET 16'h000F -#define MAC_PCU_REG_MUTE_MASKS1_FC_MGMT_RESET 16'hE7FF - -#define MAC_PCU_REG_GATED_CLKS_OFFSET 'h19 -//#define MAC_PCU_REG_GATED_SYNC_FIELD 0 -#define MAC_PCU_REG_GATED_TX_FIELD 1 -#define MAC_PCU_REG_GATED_RX_FIELD 2 -#define MAC_PCU_REG_GATED_REG_FIELD 3 -//#define MAC_PCU_REG_GATED_SYNC_RESET 1'b1 -#define MAC_PCU_REG_GATED_TX_RESET 1'b0 -#define MAC_PCU_REG_GATED_RX_RESET 1'b0 -#define MAC_PCU_REG_GATED_REG_RESET 1'b0 - -#define MAC_PCU_REG_OBS2_OFFSET 'h1a -#define MAC_PCU_REG_OBS2_OBS_BUS_FIELD 17:0 - -#define MAC_PCU_REG_OBS1_OFFSET 'h1b -#define MAC_PCU_REG_OBS1_TX_STATE_FIELD 28:24 -#define MAC_PCU_REG_OBS1_RX_STATE_FIELD 23:20 -#define MAC_PCU_REG_OBS1_WEP_STATE_FIELD 17:12 -#define MAC_PCU_REG_OBS1_RX_CLEAR_FIELD 11 -#define MAC_PCU_REG_OBS1_RX_FRAME_FIELD 10 -#define MAC_PCU_REG_OBS1_TX_FRAME_FIELD 9 -#define MAC_PCU_REG_OBS1_TX_HOLD_FIELD 8 -#define MAC_PCU_REG_OBS1_CHAN_IDLE_FIELD 7 -#define MAC_PCU_REG_OBS1_QUIET_TIME_FIELD 6 -#define MAC_PCU_REG_OBS1_TX_HCF_FIELD 5 -#define MAC_PCU_REG_OBS1_FILTER_PASS_FIELD 4 -#define MAC_PCU_REG_OBS1_RX_MY_BEACON_FIELD 3 -#define MAC_PCU_REG_OBS1_RX_WEP_FIELD 2 -#define MAC_PCU_REG_OBS1_PCU_RX_END_FIELD 1 -#define MAC_PCU_REG_OBS1_PCU_DIRECTED_FIELD 0 - -#define REG_LAST_TSTP 'h20 - -#define REG_NAV 'h21 - -#define REG_RTS_OK 'h22 - -#define REG_RTS_FAIL 'h23 - -#define REG_ACK_FAIL 'h24 - -#define REG_FCS_FAIL 'h25 - -#define REG_BEACON_CNT 'h26 - -#define MAC_PCU_REG_XRMODE_OFFSET 'h30 -#define MAC_PCU_REG_XRMODE_XR_POLL_TYPE_FIELD 5:0 -#define MAC_PCU_REG_XRMODE_XR_WAIT_FOR_POLL_FIELD 7 -#define MAC_PCU_REG_XRMODE_XR_FRAME_HOLD_FIELD 31:20 -#define MAC_PCU_REG_XRMODE_XR_POLL_TYPE_RESET 6'h1A -#define MAC_PCU_REG_XRMODE_XR_WAIT_FOR_POLL_RESET 1'b0 -#define MAC_PCU_REG_XRMODE_XR_FRAME_HOLD_RESET 12'd680 - -#define MAC_PCU_REG_XRDEL_OFFSET 'h31 -#define MAC_PCU_REG_XRDEL_XR_SLOT_DELAY_FIELD 15:0 -#define MAC_PCU_REG_XRDEL_XR_CHIRP_DATA_DELAY_FIELD 31:16 -#define MAC_PCU_REG_XRDEL_XR_SLOT_DELAY_RESET 16'd360 -#define MAC_PCU_REG_XRDEL_XR_CHIRP_DATA_DELAY_RESET 16'd1680 - -#define MAC_PCU_REG_XRTO_OFFSET 'h32 -#define MAC_PCU_REG_XRTO_XR_CHIRP_TIMEOUT_FIELD 15:0 -#define MAC_PCU_REG_XRTO_XR_POLL_TIMEOUT_FIELD 31:16 -#define MAC_PCU_REG_XRTO_XR_CHIRP_TIMEOUT_RESET 16'd7200 -#define MAC_PCU_REG_XRTO_XR_POLL_TIMEOUT_RESET 16'd5000 - -#define MAC_PCU_REG_XRCRP_OFFSET 'h33 -#define MAC_PCU_REG_XRCRP_XR_SEND_CHIRP_FIELD 0 -#define MAC_PCU_REG_XRCRP_XR_CHIRP_GAP_FIELD 31:16 -#define MAC_PCU_REG_XRCRP_XR_SEND_CHIRP_RESET 1'b0 -#define MAC_PCU_REG_XRCRP_XR_CHIRP_GAP_RESET 16'd500 - -#define MAC_PCU_REG_XRSTMP_OFFSET 'h34 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_FIELD 0 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_BSSID_FIELD 1 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_FIELD 2 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_BSSID_FIELD 3 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_DATA_FIELD 4 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_DATA_FIELD 5 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_THRESH_FIELD 15:8 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_THRESH_FIELD 23:16 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_RESET 1'b0 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_BSSID_RESET 1'b0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_RESET 1'b0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_BSSID_RESET 1'b0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_DATA_RESET 1'b0 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_DATA_RESET 1'b0 -#define MAC_PCU_REG_XRSTMP_TX_STOMP_RSSI_THRESH_RESET 8'h25 -#define MAC_PCU_REG_XRSTMP_RX_ABORT_RSSI_THRESH_RESET 8'h25 - -#define MAC_PCU_REG_SLP1_OFFSET 'h35 -//#define MAC_PCU_REG_SLP1_NEXT_DTIM_FIELD 18:0 -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_EXT_FIELD 4:0 -#define MAC_PCU_REG_SLP1_ASSUME_DTIM_FIELD 19 -//#define MAC_PCU_REG_SLP1_ENH_SLEEP_ENABLE_FIELD 20 -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_FIELD 31:21 -// #define MAC_PCU_REG_SLP1_NEXT_DTIM_RESET 19'h2aaaa -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_EXT_RESET 5'h0 -#define MAC_PCU_REG_SLP1_ASSUME_DTIM_RESET 1'b0 -//#define MAC_PCU_REG_SLP1_ENH_SLEEP_ENABLE_RESET 1'b1 -#define MAC_PCU_REG_SLP1_CAB_TIMEOUT_RESET 11'd5 - -#define MAC_PCU_REG_SLP2_OFFSET 'h36 -//#define MAC_PCU_REG_SLP2_NEXT_TIM_FIELD 18:0 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_EXT_FIELD 4:0 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_FIELD 31:21 -//#define MAC_PCU_REG_SLP2_NEXT_TIM_RESET 19'h55555 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_EXT_RESET 5'h0 -#define MAC_PCU_REG_SLP2_BEACON_TIMEOUT_RESET 11'd2 - -//#define MAC_PCU_REG_SLP3_OFFSET 'h37 -//#define MAC_PCU_REG_SLP3_TIM_PERIOD_FIELD 15:0 -//#define MAC_PCU_REG_SLP3_DTIM_PERIOD_FIELD 31:16 -//#define MAC_PCU_REG_SLP3_TIM_PERIOD_RESET 16'd2 -//#define MAC_PCU_REG_SLP3_DTIM_PERIOD_RESET 16'd3 - -#define MAC_PCU_REG_BSSMSKL_OFFSET 'h38 -#define MAC_PCU_REG_BSSMSKL_BSSID_MASK_L_FIELD 31:0 -#define MAC_PCU_REG_BSSMSKL_BSSID_MASK_L_RESET 32'hFFFFFFFF - -#define MAC_PCU_REG_BSSMSKH_OFFSET 'h39 -#define MAC_PCU_REG_BSSMSKH_BSSID_MASK_H_FIELD 15:0 -#define MAC_PCU_REG_BSSMSKH_BSSID_MASK_H_RESET 16'hFFFF - -#define MAC_PCU_REG_TPC_OFFSET 'h3A -#define MAC_PCU_REG_TPC_ACK_PWR_FIELD 5:0 -#define MAC_PCU_REG_TPC_CTS_PWR_FIELD 13:8 -#define MAC_PCU_REG_TPC_CHIRP_PWR_FIELD 21:16 -#define MAC_PCU_REG_TPC_ACK_PWR_RESET 6'h3f -#define MAC_PCU_REG_TPC_CTS_PWR_RESET 6'h3f -#define MAC_PCU_REG_TPC_CHIRP_PWR_RESET 6'h3f - -#define MAC_PCU_REG_TFC_OFFSET 'h3B -#define MAC_PCU_REG_TFC_TX_FRAME_CNT_FIELD 31:0 -#define MAC_PCU_REG_TFC_TX_FRAME_CNT_RESET 0 - -#define MAC_PCU_REG_RFC_OFFSET 'h3C -#define MAC_PCU_REG_RFC_RX_FRAME_CNT_FIELD 31:0 -#define MAC_PCU_REG_RFC_RX_FRAME_CNT_RESET 0 - -#define MAC_PCU_REG_RCC_OFFSET 'h3D -#define MAC_PCU_REG_RCC_RX_CLEAR_CNT_FIELD 31:0 -#define MAC_PCU_REG_RCC_RX_CLEAR_CNT_RESET 0 - -#define MAC_PCU_REG_CC_OFFSET 'h3E -#define MAC_PCU_REG_CC_CYCLE_CNT_FIELD 31:0 -#define MAC_PCU_REG_CC_CYCLE_CNT_RESET 0 - -#define MAC_PCU_REG_QT1_OFFSET 'h3F -#define MAC_PCU_REG_QT1_NEXT_QUIET_FIELD 15:0 -#define MAC_PCU_REG_QT1_QUIET_ENABLE_FIELD 16 -#define MAC_PCU_REG_QT1_QUIET_ACK_CTS_ENABLE_FIELD 17 -#define MAC_PCU_REG_QT1_NEXT_QUIET_RESET 16'd0 -#define MAC_PCU_REG_QT1_QUIET_ENABLE_RESET 1'b0 -#define MAC_PCU_REG_QT1_QUIET_ACK_CTS_ENABLE_RESET 1'b1 - -#define MAC_PCU_REG_QT2_OFFSET 'h40 -#define MAC_PCU_REG_QT2_QUIET_PERIOD_FIELD 15:0 -#define MAC_PCU_REG_QT2_QUIET_DURATION_FIELD 31:16 -#define MAC_PCU_REG_QT2_QUIET_PERIOD_RESET 16'd0002 -#define MAC_PCU_REG_QT2_QUIET_DURATION_RESET 16'd0001 - -#define MAC_PCU_REG_TSF_OFFSET 'h41 -#define MAC_PCU_REG_TSF_INCREMENT_FIELD 7:0 -#define MAC_PCU_REG_TSF_INCREMENT_RESET 8'h01 - -#define MAC_PCU_REG_NOACK_OFFSET 'h42 -#define MAC_PCU_REG_NOACK_2_BIT_VALUES_FIELD 3:0 -#define MAC_PCU_REG_NOACK_BIT_OFFSET_FIELD 6:4 -#define MAC_PCU_REG_NOACK_BYTE_OFFSET_FIELD 8:7 -#define MAC_PCU_REG_NOACK_2_BIT_VALUES_RESET 4'h2 -#define MAC_PCU_REG_NOACK_BIT_OFFSET_RESET 3'h5 -#define MAC_PCU_REG_NOACK_BYTE_OFFSET_RESET 2'h0 - -#define MAC_PCU_REG_PHYERR_OFFSET 'h43 -#define MAC_PCU_REG_PHYERR_MASK_FIELD 31:0 -#define MAC_PCU_REG_PHYERR_MASK_RESET 32'h0 - -#define MAC_PCU_REG_XRLAT_OFFSET 'h44 -#define MAC_PCU_REG_XRLAT_XR_TX_DELAY_FIELD 11:0 -#define MAC_PCU_REG_XRLAT_XR_TX_DELAY_RESET 12'h168 - -#define MAC_PCU_REG_ACKSIFS_OFFSET_RESERVED 'h45 -#define MAC_PCU_REG_ACKSIFS_INCREMENT_FIELD_RESERVED 7:0 -#define MAC_PCU_REG_ACKSIFS_INCREMENT_RESET_RESERVED 8'h0 - -#define MAC_PCU_REG_MICQOSCTL_OFFSET 'h46 -#define MAC_PCU_REG_MICQOSCTL_FIELD 15:0 -#define MAC_PCU_REG_MICQOSCTL_ENABLE_FIELD 16 -#define MAC_PCU_REG_MICQOSCTL_RESET 16'h00aa -#define MAC_PCU_REG_MICQOSCTL_ENABLE_RESET 1'h1 - -#define MAC_PCU_REG_MICQOSSEL_OFFSET 'h47 -#define MAC_PCU_REG_MICQOSSEL_FIELD 31:0 -#define MAC_PCU_REG_MICQOSSEL_RESET 32'h00003210 - -#define MAC_PCU_REG_MISCMODE_OFFSET 'h48 -#define MAC_PCU_REG_MISCMODE_BSSID_MATCH_FORCE_FIELD 0 -#define MAC_PCU_REG_MISCMODE_ACKSIFS_MEMORY_FIELD_RESERVED 1 -#define MAC_PCU_REG_MISCMODE_MIC_NEW_LOCATION_FIELD 2 -#define MAC_PCU_REG_MISCMODE_TX_ADD_TSF_FIELD 3 -#define MAC_PCU_REG_MISCMODE_CCK_SIFS_MODE_FIELD 4 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MODE_FIELD_RESERVED 5 -#define MAC_PCU_REG_MISCMODE_BFCOEF_ENABLE_FIELD 6 -#define MAC_PCU_REG_MISCMODE_BFCOEF_UPDATE_SELF_GEN_FIELD 7 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MCAST_FIELD 8 -#define MAC_PCU_REG_MISCMODE_DUAL_CHAIN_ANT_MODE_FIELD 9 -#define MAC_PCU_REG_MISCMODE_FALCON_DESC_MODE_FIELD 10 -#define MAC_PCU_REG_MISCMODE_KC_RX_ANT_UPDATE_FIELD 11 -#define MAC_PCU_REG_MISCMODE_TXOP_TBTT_LIMIT_FIELD 12 -#define MAC_PCU_REG_MISCMODE_FALCON_BB_INTERFACE_FIELD 13 -#define MAC_PCU_REG_MISCMODE_MISS_BEACON_IN_SLEEP_FIELD 14 -#define MAC_PCU_REG_MISCMODE_BUG_12306_FIX_ENABLE_FIELD 17 -#define MAC_PCU_REG_MISCMODE_FORCE_QUIET_COLLISION_FIELD 18 -#define MAC_PCU_REG_MISCMODE_BUG_12549_FORCE_TXBF_FIELD 19 -#define MAC_PCU_REG_MISCMODE_BT_ANT_PREVENTS_RX_FIELD 20 -#define MAC_PCU_REG_MISCMODE_TBTT_PROTECT_FIELD 21 -#define MAC_PCU_REG_MISCMODE_HCF_POLL_CANCELS_NAV_FIELD 22 -#define MAC_PCU_REG_MISCMODE_RX_HCF_POLL_ENABLE_FIELD 23 -#define MAC_PCU_REG_MISCMODE_CLEAR_VMF_FIELD 24 -#define MAC_PCU_REG_MISCMODE_CLEAR_FIRST_HCF_FIELD 25 -#define MAC_PCU_REG_MISCMODE_ADHOC_MCAST_KEYID_ENABLE_FIELD 26 -#define MAC_PCU_REG_MISCMODE_ALLOW_RAC_FIELD 27 -#define MAC_PCU_REG_MISCMODE_BSSID_MATCH_FORCE_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_ACKSIFS_MEMORY_RESET_RESERVED 1'h0 -#define MAC_PCU_REG_MISCMODE_MIC_NEW_LOCATION_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_TX_ADD_TSF_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_CCK_SIFS_MODE_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MODE_RESET_RESERVED 1'h0 -#define MAC_PCU_REG_MISCMODE_BFCOEF_ENABLE_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_BFCOEF_UPDATE_SELF_GEN_RESET 1'h1 -#define MAC_PCU_REG_MISCMODE_BFCOEF_MCAST_RESET 1'h1 -#define MAC_PCU_REG_MISCMODE_DUAL_CHAIN_ANT_MODE_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_FALCON_DESC_MODE_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_KC_RX_ANT_UPDATE_RESET 1'h1 -#define MAC_PCU_REG_MISCMODE_TXOP_TBTT_LIMIT_RESET 1'b0 -#define MAC_PCU_REG_MISCMODE_FALCON_BB_INTERFACE_RESET 1'b0 -#define MAC_PCU_REG_MISCMODE_MISS_BEACON_IN_SLEEP_RESET 1'h1 -#define MAC_PCU_REG_MISCMODE_BUG_12306_FIX_ENABLE_RESET 1'h1 -#define MAC_PCU_REG_MISCMODE_FORCE_QUIET_COLLISION_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE_BUG_12549_FORCE_TXBF_RESET 1'b0 -#define MAC_PCU_REG_MISCMODE_BT_ANT_PREVENTS_RX_RESET 1'b1 -#define MAC_PCU_REG_MISCMODE_TBTT_PROTECT_RESET 1'b1 -#define MAC_PCU_REG_MISCMODE_HCF_POLL_CANCELS_NAV_RESET 1'b1 -#define MAC_PCU_REG_MISCMODE_RX_HCF_POLL_ENABLE_RESET 1'b1 -#define MAC_PCU_REG_MISCMODE_CLEAR_VMF_RESET 1'b0 -#define MAC_PCU_REG_MISCMODE_CLEAR_FIRST_HCF_RESET 1'b0 -#define MAC_PCU_REG_MISCMODE_ADHOC_MCAST_KEYID_ENABLE_RESET 1'b0 -#define MAC_PCU_REG_MISCMODE_ALLOW_RAC_RESET 1'b0 - -#define MAC_PCU_REG_FILTOFDM_OFFSET 'h49 -#define MAC_PCU_REG_FILTOFDM_CNT_FIELD 23:0 -#define MAC_PCU_REG_FILTOFDM_CNT_RESET 24'h0 - -#define MAC_PCU_REG_FILTCCK_OFFSET 'h4A -#define MAC_PCU_REG_FILTCCK_CNT_FIELD 23:0 -#define MAC_PCU_REG_FILTCCK_CNT_RESET 24'h0 - -#define MAC_PCU_REG_PHYCNT1_OFFSET 'h4B -#define MAC_PCU_REG_PHYCNT1_FIELD 23:0 -#define MAC_PCU_REG_PHYCNT1_RESET 24'h0 - -#define MAC_PCU_REG_PHYCNTMASK1_OFFSET 'h4C -#define MAC_PCU_REG_PHYCNTMASK1_FIELD 31:0 -#define MAC_PCU_REG_PHYCNTMASK1_RESET 32'h0 - -#define MAC_PCU_REG_PHYCNT2_OFFSET 'h4D -#define MAC_PCU_REG_PHYCNT2_FIELD 23:0 -#define MAC_PCU_REG_PHYCNT2_RESET 24'h0 - -#define MAC_PCU_REG_PHYCNTMASK2_OFFSET 'h4E -#define MAC_PCU_REG_PHYCNTMASK2_FIELD 31:0 -#define MAC_PCU_REG_PHYCNTMASK2_RESET 32'h0 - -#define MAC_PCU_REG_TSFTHRESH_OFFSET 'h4F -#define MAC_PCU_REG_TSFTHRESH_FIELD 15:0 -#define MAC_PCU_REG_TSFTHRESH_RESET 16'hFFFF - -//#define MAC_PCU_REG_TSFCAL_OFFSET 'h50 -//#define MAC_PCU_REG_TSFCAL_COUNT_FIELD 3:0 -//#define MAC_PCU_REG_TSFCAL_INTERVAL_FIELD 7:4 -//#define MAC_PCU_REG_TSFCAL_ENABLE_FIELD 8 -//#define MAC_PCU_REG_TSFCAL_AUTO_CAL_FIELD 9 -//#define MAC_PCU_REG_TSFCAL_VALUE_WE_FIELD 10 -//#define MAC_PCU_REG_TSFCAL_VALUE_FIELD 31:16 -//#define MAC_PCU_REG_TSFCAL_COUNT_RESET 'h8 -//#define MAC_PCU_REG_TSFCAL_INTERVAL_RESET 'ha -//#define MAC_PCU_REG_TSFCAL_ENABLE_RESET 'h1 -//#define MAC_PCU_REG_TSFCAL_AUTO_CAL_RESET 'h1 -//#define MAC_PCU_REG_TSFCAL_VALUE_WE_RESET 'h0 -//#define MAC_PCU_REG_TSFCAL_VALUE_RESET 'h8000 - -#define MAC_PCU_REG_PHYERR_EIFS_OFFSET 'h51 -#define MAC_PCU_REG_PHYERR_EIFS_MASK_FIELD 31:0 -#define MAC_PCU_REG_PHYERR_EIFS_MASK_RESET 'h0 - -//#define MAC_PCU_REG_SYNC1_OFFSET 'h52 -//#define MAC_PCU_REG_SYNC1_TIME_FIELD 30:0 -//#define MAC_PCU_REG_SYNC1_TIME_RESET 32'h0 - -//#define MAC_PCU_REG_SYNC2_OFFSET 'h53 -//#define MAC_PCU_REG_SYNC2_TIME_OFFSET_FIELD 7:0 -//#define MAC_PCU_REG_SYNC2_MASTER_FIELD 8 -//#define MAC_PCU_REG_SYNC2_REPLACE_FIELD 9 -//#define MAC_PCU_REG_SYNC2_TUNE_FIELD 10 -//#define MAC_PCU_REG_SYNC2_CLEAR_FIELD 11 -//#define MAC_PCU_REG_SYNC2_INTR_THRESH_FIELD 31:16 -//#define MAC_PCU_REG_SYNC2_TIME_OFFSET_RESET 8'h0 -//#define MAC_PCU_REG_SYNC2_MASTER_RESET 1'h0 -//#define MAC_PCU_REG_SYNC2_REPLACE_RESET 1'h0 -//#define MAC_PCU_REG_SYNC2_TUNE_RESET 1'h0 -//#define MAC_PCU_REG_SYNC2_CLEAR_RESET 1'h0 -//#define MAC_PCU_REG_SYNC2_INTR_THRESH_RESET 16'hFFFF - -//#define MAC_PCU_REG_SYNC3_OFFSET 'h54 -//#define MAC_PCU_REG_SYNC3_MCAST_ADDR_L_FIELD 31:0 -//#define MAC_PCU_REG_SYNC3_MCAST_ADDR_L_RESET 32'h0 - -//#define MAC_PCU_REG_SYNC4_OFFSET 'h55 -//#define MAC_PCU_REG_SYNC4_MCAST_ADDR_U_FIELD 15:0 -//#define MAC_PCU_REG_SYNC4_MCAST_ADDR_U_RESET 16'h0 - -//#define MAC_PCU_REG_SYNC5_OFFSET 'h56 -//#define MAC_PCU_REG_SYNC5_RX_TIME_FIELD 30:0 - -//#define MAC_PCU_REG_SYNC6_OFFSET 'h57 -//#define MAC_PCU_REG_SYNC6_INC_FIELD 31:0 - -//#define MAC_PCU_REG_SYNC7_OFFSET 'h58 -//#define MAC_PCU_REG_SYNC7_LAST_TIME_FIELD 30:0 - -//#define MAC_PCU_REG_SYNC8_OFFSET 'h59 -//#define MAC_PCU_REG_SYNC8_UPDATED_TIME_FIELD 30:0 - -#define MAC_PCU_REG_PHYCNT3_OFFSET 'h5A -#define MAC_PCU_REG_PHYCNT3_FIELD 23:0 -#define MAC_PCU_REG_PHYCNT3_RESET 24'h0 - -#define MAC_PCU_REG_PHYCNTMASK3_OFFSET 'h5B -#define MAC_PCU_REG_PHYCNTMASK3_FIELD 31:0 -#define MAC_PCU_REG_PHYCNTMASK3_RESET 32'h0 - -#define MAC_PCU_REG_BTMODE_OFFSET 'h5C -#define MAC_PCU_REG_BTMODE_TIME_EXTEND_FIELD 7:0 -#define MAC_PCU_REG_BTMODE_TXSTATE_EXTEND_FIELD 8 -#define MAC_PCU_REG_BTMODE_TX_FRAME_EXTEND_FIELD 9 -#define MAC_PCU_REG_BTMODE_MODE_FIELD 11:10 -#define MAC_PCU_REG_BTMODE_QUIET_FIELD 12 -#define MAC_PCU_REG_BTMODE_QCU_THRESH_FIELD 16:13 -#define MAC_PCU_REG_BTMODE_RX_CLEAR_POLARITY_FIELD 17 -#define MAC_PCU_REG_BTMODE_PRIORITY_TIME_FIELD 23:18 -#define MAC_PCU_REG_BTMODE_FIRST_SLOT_TIME_FIELD 31:24 -#define MAC_PCU_REG_BTMODE_TIME_EXTEND_RESET 8'h20 -#define MAC_PCU_REG_BTMODE_TXSTATE_EXTEND_RESET 1'b1 -#define MAC_PCU_REG_BTMODE_TX_FRAME_EXTEND_RESET 1'b1 -#define MAC_PCU_REG_BTMODE_MODE_RESET 2'h3 -#define MAC_PCU_REG_BTMODE_QUIET_RESET 1'b1 -#define MAC_PCU_REG_BTMODE_QCU_THRESH_RESET 4'b0001 -#define MAC_PCU_REG_BTMODE_RX_CLEAR_POLARITY_RESET 1'b0 -#define MAC_PCU_REG_BTMODE_PRIORITY_TIME_RESET 6'h05 -#define MAC_PCU_REG_BTMODE_FIRST_SLOT_TIME_RESET 8'h9B - -#define MAC_PCU_REG_BTWEIGHT_OFFSET 'h5D -#define MAC_PCU_REG_BTWEIGHT_BT_WEIGHT_FIELD 15:0 -#define MAC_PCU_REG_BTWEIGHT_WL_WEIGHT_FIELD 31:16 -#define MAC_PCU_REG_BTWEIGHT_BT_WEIGHT_RESET 16'b11_11_10_10_01_01_00_00 -#define MAC_PCU_REG_BTWEIGHT_WL_WEIGHT_RESET 16'b11_11_10_10_10_10_01_00 - -#define MAC_PCU_REG_HCF_OFFSET 'h5E -#define MAC_PCU_REG_HCF_TIMEOUT_FIELD 15:0 -#define MAC_PCU_REG_HCF_TIMEOUT_RESET 'h100 - -#define MAC_PCU_REG_BTMODE2_OFFSET 'h5F -#define MAC_PCU_REG_BTMODE2_BT_BCN_MISS_THRESH_FIELD 7:0 -#define MAC_PCU_REG_BTMODE2_BCN_MISS_CNT_FIELD 15:8 -#define MAC_PCU_REG_BTMODE2_BT_HOLD_RX_CLEAR_FIELD 16 -#define MAC_PCU_REG_BTMODE2_WL_CONTROL_ANT_FIELD 17 -#define MAC_PCU_REG_BTMODE2_RESPOND_TO_BT_ACTIVE_FIELD 18 -#define MAC_PCU_REG_BTMODE2_PROTECT_BT_AFTER_WAKEUP_FIELD 19 -#define MAC_PCU_REG_BTMODE2_DISABLE_BT_ANT_FIELD 20 -#define MAC_PCU_REG_BTMODE2_BT_BCN_MISS_THRESH_RESET 0 -#define MAC_PCU_REG_BTMODE2_BT_HOLD_RX_CLEAR_RESET 0 -#define MAC_PCU_REG_BTMODE2_WL_CONTROL_ANT_RESET 1'h0 -#define MAC_PCU_REG_BTMODE2_RESPOND_TO_BT_ACTIVE_RESET 1'h0 -#define MAC_PCU_REG_BTMODE2_PROTECT_BT_AFTER_WAKEUP_RESET 1'h0 -#define MAC_PCU_REG_BTMODE2_DISABLE_BT_ANT_RESET 1'h0 - -#define MAC_PCU_REG_BFCOEF1_OFFSET 'h60 -#define MAC_PCU_REG_BFCOEF1_UPPER_OFFSET 'h67 -#define MAC_PCU_REG_BFCOEF1_KEY_VALID_FIELD 31 -#define MAC_PCU_REG_BFCOEF1_KEYIDX_FIELD 30:24 -#define MAC_PCU_REG_BFCOEF1_TSF_FIELD 23:0 -#define MAC_PCU_REG_BFCOEF1_KEY_VALID_RESET 1'b0 - -#define MAC_PCU_REG_BFCOEF2_OFFSET 'h70 -#define MAC_PCU_REG_BFCOEF2_THRESH_FIELD 22:0 -#define MAC_PCU_REG_BFCOEF2_LOCK_FIELD 31:24 -#define MAC_PCU_REG_BFCOEF2_THRESH_RESET 23'b0 -#define MAC_PCU_REG_BFCOEF2_LOCK_RESET 8'b0 - -#define MAC_PCU_REG_KCMASK_OFFSET 'h71 -#define MAC_PCU_REG_KCMASK_47_32_FIELD 15:0 -#define MAC_PCU_REG_KCMASK_47_32_RESET 0 -#define MAC_PCU_REG_KCMASK_31_0_FIELD 16 -#define MAC_PCU_REG_KCMASK_31_0_RESET 0 - -#define MAC_PCU_REG_TXSIFS_OFFSET 'h74 -#define MAC_PCU_REG_TXSIFS_SIFS_TIME_FIELD 7:0 -#define MAC_PCU_REG_TXSIFS_TX_LATENCY_FIELD 11:8 -#define MAC_PCU_REG_TXSIFS_ACK_SHIFT_FIELD 14:12 -#define MAC_PCU_REG_TXSIFS_SIFS_TIME_RESET 16 -#define MAC_PCU_REG_TXSIFS_TX_LATENCY_RESET 2 -#define MAC_PCU_REG_TXSIFS_ACK_SHIFT_RESET 3 - -#define MAC_PCU_REG_TXOP_X_OFFSET 'h7b -#define MAC_PCU_REG_TXOP_X_FIELD 7:0 -#define MAC_PCU_REG_TXOP_X_RESET 0 - -#define MAC_PCU_REG_TXOP_0_3_OFFSET 'h7c -#define MAC_PCU_REG_TXOP_0_FIELD 7:0 -#define MAC_PCU_REG_TXOP_1_FIELD 15:8 -#define MAC_PCU_REG_TXOP_2_FIELD 23:16 -#define MAC_PCU_REG_TXOP_3_FIELD 31:24 -#define MAC_PCU_REG_TXOP_0_RESET 0 -#define MAC_PCU_REG_TXOP_1_RESET 0 -#define MAC_PCU_REG_TXOP_2_RESET 0 -#define MAC_PCU_REG_TXOP_3_RESET 0 - -#define MAC_PCU_REG_TXOP_4_7_OFFSET 'h7d -#define MAC_PCU_REG_TXOP_4_FIELD 7:0 -#define MAC_PCU_REG_TXOP_5_FIELD 15:8 -#define MAC_PCU_REG_TXOP_6_FIELD 23:16 -#define MAC_PCU_REG_TXOP_7_FIELD 31:24 -#define MAC_PCU_REG_TXOP_4_RESET 0 -#define MAC_PCU_REG_TXOP_5_RESET 0 -#define MAC_PCU_REG_TXOP_6_RESET 0 -#define MAC_PCU_REG_TXOP_7_RESET 0 - -#define MAC_PCU_REG_TXOP_8_11_OFFSET 'h7e -#define MAC_PCU_REG_TXOP_8_FIELD 7:0 -#define MAC_PCU_REG_TXOP_9_FIELD 15:8 -#define MAC_PCU_REG_TXOP_10_FIELD 23:16 -#define MAC_PCU_REG_TXOP_11_FIELD 31:24 -#define MAC_PCU_REG_TXOP_8_RESET 0 -#define MAC_PCU_REG_TXOP_9_RESET 0 -#define MAC_PCU_REG_TXOP_10_RESET 0 -#define MAC_PCU_REG_TXOP_11_RESET 0 - -#define MAC_PCU_REG_TXOP_12_15_OFFSET 'h7f -#define MAC_PCU_REG_TXOP_12_FIELD 7:0 -#define MAC_PCU_REG_TXOP_13_FIELD 15:8 -#define MAC_PCU_REG_TXOP_14_FIELD 23:16 -#define MAC_PCU_REG_TXOP_15_FIELD 31:24 -#define MAC_PCU_REG_TXOP_12_RESET 0 -#define MAC_PCU_REG_TXOP_13_RESET 0 -#define MAC_PCU_REG_TXOP_14_RESET 0 -#define MAC_PCU_REG_TXOP_15_RESET 0 - -#define MAC_PCU_REG_GNRCTMR_N_OFFSET 'h80 -#define MAC_PCU_REG_GNRCTMR_N_UPPER_OFFSET 'h87 -#define MAC_PCU_REG_GNRCTMR_N_FIELD 31:0 - -#define MAC_PCU_REG_GNRCTMR_P_OFFSET 'h88 -#define MAC_PCU_REG_GNRCTMR_P_UPPER_OFFSET 'h8F -#define MAC_PCU_REG_GNRCTMR_P_FIELD 27:0 - -#define MAC_PCU_REG_GNRCTMR_M_OFFSET 'h90 -#define MAC_PCU_REG_GNRCTMR_M_ENABLE_FIELD 7:0 -#define MAC_PCU_REG_GNRCTMR_M_OVERFLOW_INDEX_FIELD 10:8 -#define MAC_PCU_REG_GNRCTMR_M_THRESH_FIELD 31:12 -#define MAC_PCU_REG_GNRCTMR_M_ENABLE_RESET 8'h0 -#define MAC_PCU_REG_GNRCTMR_M_THRESH_RESET 20'h00100 - -#define MAC_PCU_REG_SLP32_MODE_OFFSET 'h91 -#define MAC_PCU_REG_SLP32_MODE_HALF_CLK_LATENCY_FIELD 19:0 -#define MAC_PCU_REG_SLP32_MODE_ENABLE_FIELD 20 -#define MAC_PCU_REG_SLP32_MODE_TSF_WRITE_STAT_FIELD 21 -#define MAC_PCU_REG_SLP32_MODE_HALF_CLK_LATENCY_RESET 20'h0F424 -#define MAC_PCU_REG_SLP32_MODE_ENABLE_RESET 1'b1 - -#define MAC_PCU_REG_SLP32_WAKE_OFFSET 'h92 -#define MAC_PCU_REG_SLP32_WAKE_XTL_TIME_FIELD 15:0 -#define MAC_PCU_REG_SLP32_WAKE_XTL_TIME_RESET 16'h07EF - -#define MAC_PCU_REG_SLP32_TSF_INC_OFFSET 'h93 -#define MAC_PCU_REG_SLP32_TSF_INC_FIELD 19:0 -#define MAC_PCU_REG_SLP32_TSF_INC_RESET 20'h1E848 - -#define MAC_PCU_REG_SLPMIB1_OFFSET 'h94 -#define MAC_PCU_REG_SLPMIB1_SLEEP_CNT_FIELD 31:0 - -#define MAC_PCU_REG_SLPMIB2_OFFSET 'h95 -#define MAC_PCU_REG_SLPMIB2_CYCLE_CNT_FIELD 31:0 - -#define MAC_PCU_REG_SLPMIB3_OFFSET 'h96 -#define MAC_PCU_REG_SLPMIB3_CLR_CNT_FIELD 0 -#define MAC_PCU_REG_SLPMIB3_PEND_FIELD 1 - -#define MAC_PCU_REG_MISCMODE2_OFFSET 'h97 -#define MAC_PCU_REG_MISCMODE2_MGMT_CRYPTO_ENABLE_FIELD 0 -#define MAC_PCU_REG_MISCMODE2_NO_CRYPTO_FOR_NON_DATA_PKT_FIELD 1 -#define MAC_PCU_REG_MISCMODE2_MGMT_QOS_FIELD 15:8 -#define MAC_PCU_REG_MISCMODE2_BC_MC_WAPI_MODE_FIELD 16 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_FOR_1ST_PKT_FIELD 17 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_IF_ZERO_FIELD 18 -#define MAC_PCU_REG_MISCMODE2_MGMT_CRYPTO_ENABLE_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE2_NO_CRYPTO_FOR_NON_DATA_PKT_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE2_MGMT_QOS_RESET 8'h10 -#define MAC_PCU_REG_MISCMODE2_BC_MC_WAPI_MODE_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_FOR_1ST_PKT_RESET 1'h0 -#define MAC_PCU_REG_MISCMODE2_IGNORE_TXOP_IF_ZERO_RESET 1'h0 - -#define MAC_PCU_REG_SLP4_OFFSET 'h98 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_DUR_FIELD 15:0 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_ENABLE_FIELD 16 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_DUR_RESET 16'h5 -#define MAC_PCU_REG_SLP4_CAB_AWAKE_ENABLE_RESET 1'h0 - -#define MAC_PCU_REG_SLP5_OFFSET 'h99 -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_FIELD 23:0 -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_ENABLE_FIELD 24 -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_RESET 24'hff_ffff -#define MAC_PCU_REG_SLP5_BMISS_TIMEOUT_ENABLE_RESET 1'h0 - -#define MAC_PCU_REG_MCICTL_OFFSET 'h9a -#define MAC_PCU_REG_MCICTL_MCI_ENABLE_FIELD 0 -#define MAC_PCU_REG_MCICTL_OLA_ENABLE_FIELD 1 -#define MAC_PCU_REG_MCICTL_PREEMPT_ENABLE_FIELD 2 -#define MAC_PCU_REG_MCICTL_CHANNEL_BUSY_ENABLE_FIELD 3 -#define MAC_PCU_REG_MCICTL_EARLY_NOTIFY_DELAY_FIELD 9:4 -#define MAC_PCU_REG_MCICTL_BMISS_FORCE_WL_FIELD 10 -#define MAC_PCU_REG_MCICTL_SLEEP_FORCE_BT_FIELD 11 -#define MAC_PCU_REG_MCICTL_HP_QCU_STOMP_BT_FIELD 12 -#define MAC_PCU_REG_MCICTL_MCI_BUSY_FIELD 31 -#define MAC_PCU_REG_MCICTL_MCI_ENABLE_RESET 1'h0 -#define MAC_PCU_REG_MCICTL_OLA_ENABLE_RESET 1'h1 -#define MAC_PCU_REG_MCICTL_PREEMPT_ENABLE_RESET 1'h1 -#define MAC_PCU_REG_MCICTL_CHANNEL_BUSY_ENABLE_RESET 1'h1 -#define MAC_PCU_REG_MCICTL_EARLY_NOTIFY_DELAY_RESET 6'h5 -#define MAC_PCU_REG_MCICTL_BMISS_FORCE_WL_RESET 1'b0 -#define MAC_PCU_REG_MCICTL_SLEEP_FORCE_BT_RESET 1'b1 -#define MAC_PCU_REG_MCICTL_HP_QCU_STOMP_BT_RESET 1'b0 - -#define MAC_PCU_REG_MCIISR_OFFSET 'h9b -#define MAC_PCU_REG_MCIISR_ACT_RPT_RCV_INT_FIELD 0 -#define MAC_PCU_REG_MCIISR_ACT_DEN_RCV_INT_FIELD 1 -#define MAC_PCU_REG_MCIISR_FRQ_RPT_RCV_INT_FIELD 2 -#define MAC_PCU_REG_MCIISR_QOS_RPT_RCV_INT_FIELD 3 -#define MAC_PCU_REG_MCIISR_GEN_RPT_RCV_INT_FIELD 4 -#define MAC_PCU_REG_MCIISR_ACT_RPT_RCV_INT_RESET 1'b0 -#define MAC_PCU_REG_MCIISR_ACT_DEN_RCV_INT_RESET 1'b0 -#define MAC_PCU_REG_MCIISR_FRQ_RPT_RCV_INT_RESET 1'b0 -#define MAC_PCU_REG_MCIISR_QOS_RPT_RCV_INT_RESET 1'b0 -#define MAC_PCU_REG_MCIISR_GEN_RPT_RCV_INT_RESET 1'b0 - -#define MAC_PCU_REG_MCIIER_OFFSET 'h9c -#define MAC_PCU_REG_MCIIER_ACT_RPT_RCV_INT_ENABLE_FIELD 0 -#define MAC_PCU_REG_MCIIER_ACT_DEN_RCV_INT_ENABLE_FIELD 1 -#define MAC_PCU_REG_MCIIER_FRQ_RPT_RCV_INT_ENABLE_FIELD 2 -#define MAC_PCU_REG_MCIIER_QOS_RPT_RCV_INT_ENABLE_FIELD 3 -#define MAC_PCU_REG_MCIIER_GEN_RPT_RCV_INT_ENABLE_FIELD 4 -#define MAC_PCU_REG_MCIIER_ACT_RPT_RCV_INT_ENABLE_RESET 1'b0 -#define MAC_PCU_REG_MCIIER_ACT_DEN_RCV_INT_ENABLE_RESET 1'b0 -#define MAC_PCU_REG_MCIIER_FRQ_RPT_RCV_INT_ENABLE_RESET 1'b0 -#define MAC_PCU_REG_MCIIER_QOS_RPT_RCV_INT_ENABLE_RESET 1'b0 -#define MAC_PCU_REG_MCIIER_GEN_RPT_RCV_INT_ENABLE_RESET 1'b0 - -#define MAC_PCU_REG_MCIWLP_OFFSET 'h9d -#define MAC_PCU_REG_MCIWLP_RESET 30'h0 - -#define MAC_PCU_REG_MCIARW_OFFSET 'h9e -#define MAC_PCU_REG_MCIARW_RESET 32'h0 - -#define MAC_PCU_REG_MCIARR_OFFSET 'h9f - -#define MAC_PCU_REG_MCIADW_OFFSET 'ha0 -#define MAC_PCU_REG_MCIADW_RESET 32'h0 - -#define MAC_PCU_REG_MCIADR_OFFSET 'ha1 - -#define MAC_PCU_REG_MCIFRW_OFFSET 'ha2 -#define MAC_PCU_REG_MCIFRW_RESET 32'h0 - -#define MAC_PCU_REG_MCIFRR_OFFSET 'ha3 - -#define MAC_PCU_REG_MCIQRW_OFFSET 'ha4 -#define MAC_PCU_REG_MCIQRW_RESET 32'h0 - -#define MAC_PCU_REG_MCIQRR_OFFSET 'ha5 - -#define MAC_PCU_REG_MCIGRW_OFFSET 'ha6 -#define MAC_PCU_REG_MCIGRW_RESET 32'h0 - -#define MAC_PCU_REG_MCIGRR_OFFSET 'ha7 - -#define MAC_PCU_REG_MCISTAT_OFFSET 'ha8 -#define MAC_PCU_REG_MCISTAT_ACT_RPT_RCV_CNT_FIELD 7:0 -#define MAC_PCU_REG_MCISTAT_QC_CNT_FIELD 15:8 -#define MAC_PCU_REG_MCISTAT_OLA_CNT_FIELD 23:16 -#define MAC_PCU_REG_MCISTAT_PREEMPT_CNT_FIELD 31:24 -#define MAC_PCU_REG_MCISTAT_ACT_RPT_RCV_CNT_RESET 8'h0 -#define MAC_PCU_REG_MCISTAT_QC_CNT_RESET 8'h0 -#define MAC_PCU_REG_MCISTAT_OLA_CNT_RESET 8'h0 -#define MAC_PCU_REG_MCISTAT_PREEMPT_CNT_RESET 8'h0 - -#define MAC_PCU_REG_BASIC_RATE_SET0_OFFSET 'ha9 -#define MAC_PCU_REG_BRATE_1MB_L_FIELD 4:0 -#define MAC_PCU_REG_BRATE_2MB_L_FIELD 9:5 -#define MAC_PCU_REG_BRATE_2MB_S_FIELD 14:10 -#define MAC_PCU_REG_BRATE_5_5MB_L_FIELD 19:15 -#define MAC_PCU_REG_BRATE_5_5MB_S_FIELD 24:20 -#define MAC_PCU_REG_BRATE_11MB_L_FIELD 29:25 -#define MAC_PCU_REG_BRATE_1MB_L_RESET #CCK_RATE_1Mb_L -#define MAC_PCU_REG_BRATE_2MB_L_RESET #CCK_RATE_2Mb_L -#define MAC_PCU_REG_BRATE_2MB_S_RESET #CCK_RATE_2Mb_S -#define MAC_PCU_REG_BRATE_5_5MB_L_RESET #CCK_RATE_5_5Mb_L -#define MAC_PCU_REG_BRATE_5_5MB_S_RESET #CCK_RATE_5_5Mb_S -#define MAC_PCU_REG_BRATE_11MB_L_RESET #CCK_RATE_11Mb_L - -#define MAC_PCU_REG_BASIC_RATE_SET1_OFFSET 'haa -#define MAC_PCU_REG_BRATE_11MB_S_FIELD 4:0 -#define MAC_PCU_REG_BRATE_6MB_FIELD 9:5 -#define MAC_PCU_REG_BRATE_9MB_FIELD 14:10 -#define MAC_PCU_REG_BRATE_12MB_FIELD 19:15 -#define MAC_PCU_REG_BRATE_18MB_FIELD 24:20 -#define MAC_PCU_REG_BRATE_24MB_FIELD 29:25 -#define MAC_PCU_REG_BRATE_11MB_S_RESET #CCK_RATE_11Mb_S -#define MAC_PCU_REG_BRATE_6MB_RESET #OFDM_RATE_6Mb -#define MAC_PCU_REG_BRATE_9MB_RESET #OFDM_RATE_6Mb -#define MAC_PCU_REG_BRATE_12MB_RESET #OFDM_RATE_12Mb -#define MAC_PCU_REG_BRATE_18MB_RESET #OFDM_RATE_12Mb -#define MAC_PCU_REG_BRATE_24MB_RESET #OFDM_RATE_24Mb - -#define MAC_PCU_REG_BASIC_RATE_SET2_OFFSET 'hab -#define MAC_PCU_REG_BRATE_36MB_FIELD 4:0 -#define MAC_PCU_REG_BRATE_48MB_FIELD 9:5 -#define MAC_PCU_REG_BRATE_54MB_FIELD 14:10 -#define MAC_PCU_REG_BRATE_36MB_RESET #OFDM_RATE_24Mb -#define MAC_PCU_REG_BRATE_48MB_RESET #OFDM_RATE_24Mb -#define MAC_PCU_REG_BRATE_54MB_RESET #OFDM_RATE_24Mb - -#define MAC_PCU_REG_SEC_BSSID_L32_OFFSET 'hac -#define MAC_PCU_REG_SEC_BSSID_L32_FIELD 31:0 -#define MAC_PCU_REG_SEC_BSSID_L32_RESET 32'h0 - -#define MAC_PCU_REG_SEC_BSSID_U16_OFFSET 'had -#define MAC_PCU_REG_SEC_BSSID_U16_FIELD 15:0 -#define MAC_PCU_REG_SEC_BSSID_ENABLE_FIELD 16 -#define MAC_PCU_REG_SEC_BSSID_U16_RESET 16'h0 -#define MAC_PCU_REG_SEC_BSSID_ENABLE_RESET 1'b0 - -#define MAC_PCU_REG_FTYPE_OFFSET 'h140 -#define MAC_PCU_REG_FTYPE_UPPER_OFFSET 'h17F -#define MAC_PCU_REG_FTYPE_BFCOEF_RX_UPDATE_NORMAL_FIELD 0 -#define MAC_PCU_REG_FTYPE_BFCOEF_RX_UPDATE_SELF_GEN_FIELD 1 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_NORMAL_FIELD 2 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_SELF_GEN_FIELD 3 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_GEN_FIELD 4 -#define MAC_PCU_REG_FTYPE_BFCOEF_TX_ENABLE_MCAST_FIELD 5 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_ALL_FIELD 6 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_DIRECTED_FIELD 7 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_MCAST_FIELD 8 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_IF_BCAST_FIELD 9 -#define MAC_PCU_REG_FTYPE_FILTER_PASS_MC_BC_BSSID_FIELD 10 - -#define MAC_PCU_REG_ACKSIFSMEM_OFFSET_RESERVED 'h1A0 -#define MAC_PCU_REG_ACKSIFSMEM_UPPER_OFFSET_RESERVED 'h1BF -#define MAC_PCU_REG_ACKSIFSMEM_NORMAL_FIELD_RESERVED 9:0 -#define MAC_PCU_REG_ACKSIFSMEM_TURBO_FIELD_RESERVED 19:10 - -#define MAC_PCU_REG_DUR_OFFSET 'h1C0 -#define MAC_PCU_REG_DUR_UPPER_OFFSET 'h1DF -#define MAC_PCU_REG_DUR_RATE_TO_DURATION_FIELD 15:0 - -#define MAC_PCU_REG_RTD_OFFSET 'h1F0 -#define MAC_PCU_REG_RTD_UPPER_OFFSET 'h1F7 -#define MAC_PCU_REG_RTD_RATE_TO_DB_0_FIELD 4:0 -#define MAC_PCU_REG_RTD_RATE_TO_DB_1_FIELD 12:8 -#define MAC_PCU_REG_RTD_RATE_TO_DB_2_FIELD 20:16 -#define MAC_PCU_REG_RTD_RATE_TO_DB_3_FIELD 28:24 - -#define MAC_PCU_REG_DTR_OFFSET 'h1F8 -#define MAC_PCU_REG_DTR_UPPER_OFFSET 'h1FF -#define MAC_PCU_REG_DTR_DB_TO_RATE_0_FIELD 4:0 -#define MAC_PCU_REG_DTR_DB_TO_RATE_1_FIELD 12:8 -#define MAC_PCU_REG_DTR_DB_TO_RATE_2_FIELD 20:16 -#define MAC_PCU_REG_DTR_DB_TO_RATE_3_FIELD 28:24 - -#define MAC_PCU_REG_KC_OFFSET 'h200 -#define MAC_PCU_REG_KC_UPPER_OFFSET 'h5FF -#define MAC_PCU_REG_KC_KEY_31_0_FIELD 31:0 -#define MAC_PCU_REG_KC_KEY_47_32_FIELD 15:0 -#define MAC_PCU_REG_KC_KEY_79_48_FIELD 31:0 -#define MAC_PCU_REG_KC_KEY_95_80_FIELD 15:0 -#define MAC_PCU_REG_KC_KEY_127_96_FIELD 31:0 -#define MAC_PCU_REG_KC_KEY_TYPE_FIELD 2:0 -#define MAC_PCU_REG_KC_LAST_ANTENNA_FIELD 3 -#define MAC_PCU_REG_KC_ASYNC_ACK_OFFSET_FIELD 8:4 -#define MAC_PCU_REG_KC_UPDATE_BEAM_FORMING_FIELD 9 -#define MAC_PCU_REG_KC_RX_CHAIN_0_ACK_ANT_FIELD 10 -#define MAC_PCU_REG_KC_RX_CHAIN_1_ACK_ANT_FIELD 11 -#define MAC_PCU_REG_KC_TX_CHAIN_0_ANT_SEL_FIELD 12 -#define MAC_PCU_REG_KC_TX_CHAIN_1_ANT_SEL_FIELD 13 -#define MAC_PCU_REG_KC_TX_CHAIN_SEL_FIELD 14 -#define MAC_PCU_REG_KC_ADDR_32_1_FIELD 31:0 -#define MAC_PCU_REG_KC_ADDR_47_33_FIELD 14:0 -#define MAC_PCU_REG_KC_VALID_FIELD 1 - -//Misc -#define ELEM_START 36 -#define CFP_ELEM 4 - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_host_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_host_reg.h deleted file mode 100644 index f836ae47a303..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_host_reg.h +++ /dev/null @@ -1,386 +0,0 @@ -#ifndef _MBOX_HOST_REG_REG_H_ -#define _MBOX_HOST_REG_REG_H_ - -#define HOST_INT_STATUS_ADDRESS 0x00000400 -#define HOST_INT_STATUS_OFFSET 0x00000400 -#define HOST_INT_STATUS_ERROR_MSB 7 -#define HOST_INT_STATUS_ERROR_LSB 7 -#define HOST_INT_STATUS_ERROR_MASK 0x00000080 -#define HOST_INT_STATUS_ERROR_GET(x) (((x) & HOST_INT_STATUS_ERROR_MASK) >> HOST_INT_STATUS_ERROR_LSB) -#define HOST_INT_STATUS_ERROR_SET(x) (((x) << HOST_INT_STATUS_ERROR_LSB) & HOST_INT_STATUS_ERROR_MASK) -#define HOST_INT_STATUS_CPU_MSB 6 -#define HOST_INT_STATUS_CPU_LSB 6 -#define HOST_INT_STATUS_CPU_MASK 0x00000040 -#define HOST_INT_STATUS_CPU_GET(x) (((x) & HOST_INT_STATUS_CPU_MASK) >> HOST_INT_STATUS_CPU_LSB) -#define HOST_INT_STATUS_CPU_SET(x) (((x) << HOST_INT_STATUS_CPU_LSB) & HOST_INT_STATUS_CPU_MASK) -#define HOST_INT_STATUS_DRAGON_INT_MSB 5 -#define HOST_INT_STATUS_DRAGON_INT_LSB 5 -#define HOST_INT_STATUS_DRAGON_INT_MASK 0x00000020 -#define HOST_INT_STATUS_DRAGON_INT_GET(x) (((x) & HOST_INT_STATUS_DRAGON_INT_MASK) >> HOST_INT_STATUS_DRAGON_INT_LSB) -#define HOST_INT_STATUS_DRAGON_INT_SET(x) (((x) << HOST_INT_STATUS_DRAGON_INT_LSB) & HOST_INT_STATUS_DRAGON_INT_MASK) -#define HOST_INT_STATUS_COUNTER_MSB 4 -#define HOST_INT_STATUS_COUNTER_LSB 4 -#define HOST_INT_STATUS_COUNTER_MASK 0x00000010 -#define HOST_INT_STATUS_COUNTER_GET(x) (((x) & HOST_INT_STATUS_COUNTER_MASK) >> HOST_INT_STATUS_COUNTER_LSB) -#define HOST_INT_STATUS_COUNTER_SET(x) (((x) << HOST_INT_STATUS_COUNTER_LSB) & HOST_INT_STATUS_COUNTER_MASK) -#define HOST_INT_STATUS_MBOX_DATA_MSB 3 -#define HOST_INT_STATUS_MBOX_DATA_LSB 0 -#define HOST_INT_STATUS_MBOX_DATA_MASK 0x0000000f -#define HOST_INT_STATUS_MBOX_DATA_GET(x) (((x) & HOST_INT_STATUS_MBOX_DATA_MASK) >> HOST_INT_STATUS_MBOX_DATA_LSB) -#define HOST_INT_STATUS_MBOX_DATA_SET(x) (((x) << HOST_INT_STATUS_MBOX_DATA_LSB) & HOST_INT_STATUS_MBOX_DATA_MASK) - -#define CPU_INT_STATUS_ADDRESS 0x00000401 -#define CPU_INT_STATUS_OFFSET 0x00000401 -#define CPU_INT_STATUS_BIT_MSB 7 -#define CPU_INT_STATUS_BIT_LSB 0 -#define CPU_INT_STATUS_BIT_MASK 0x000000ff -#define CPU_INT_STATUS_BIT_GET(x) (((x) & CPU_INT_STATUS_BIT_MASK) >> CPU_INT_STATUS_BIT_LSB) -#define CPU_INT_STATUS_BIT_SET(x) (((x) << CPU_INT_STATUS_BIT_LSB) & CPU_INT_STATUS_BIT_MASK) - -#define ERROR_INT_STATUS_ADDRESS 0x00000402 -#define ERROR_INT_STATUS_OFFSET 0x00000402 -#define ERROR_INT_STATUS_SPI_MSB 3 -#define ERROR_INT_STATUS_SPI_LSB 3 -#define ERROR_INT_STATUS_SPI_MASK 0x00000008 -#define ERROR_INT_STATUS_SPI_GET(x) (((x) & ERROR_INT_STATUS_SPI_MASK) >> ERROR_INT_STATUS_SPI_LSB) -#define ERROR_INT_STATUS_SPI_SET(x) (((x) << ERROR_INT_STATUS_SPI_LSB) & ERROR_INT_STATUS_SPI_MASK) -#define ERROR_INT_STATUS_WAKEUP_MSB 2 -#define ERROR_INT_STATUS_WAKEUP_LSB 2 -#define ERROR_INT_STATUS_WAKEUP_MASK 0x00000004 -#define ERROR_INT_STATUS_WAKEUP_GET(x) (((x) & ERROR_INT_STATUS_WAKEUP_MASK) >> ERROR_INT_STATUS_WAKEUP_LSB) -#define ERROR_INT_STATUS_WAKEUP_SET(x) (((x) << ERROR_INT_STATUS_WAKEUP_LSB) & ERROR_INT_STATUS_WAKEUP_MASK) -#define ERROR_INT_STATUS_RX_UNDERFLOW_MSB 1 -#define ERROR_INT_STATUS_RX_UNDERFLOW_LSB 1 -#define ERROR_INT_STATUS_RX_UNDERFLOW_MASK 0x00000002 -#define ERROR_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) >> ERROR_INT_STATUS_RX_UNDERFLOW_LSB) -#define ERROR_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << ERROR_INT_STATUS_RX_UNDERFLOW_LSB) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) -#define ERROR_INT_STATUS_TX_OVERFLOW_MSB 0 -#define ERROR_INT_STATUS_TX_OVERFLOW_LSB 0 -#define ERROR_INT_STATUS_TX_OVERFLOW_MASK 0x00000001 -#define ERROR_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) >> ERROR_INT_STATUS_TX_OVERFLOW_LSB) -#define ERROR_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << ERROR_INT_STATUS_TX_OVERFLOW_LSB) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) - -#define COUNTER_INT_STATUS_ADDRESS 0x00000403 -#define COUNTER_INT_STATUS_OFFSET 0x00000403 -#define COUNTER_INT_STATUS_COUNTER_MSB 7 -#define COUNTER_INT_STATUS_COUNTER_LSB 0 -#define COUNTER_INT_STATUS_COUNTER_MASK 0x000000ff -#define COUNTER_INT_STATUS_COUNTER_GET(x) (((x) & COUNTER_INT_STATUS_COUNTER_MASK) >> COUNTER_INT_STATUS_COUNTER_LSB) -#define COUNTER_INT_STATUS_COUNTER_SET(x) (((x) << COUNTER_INT_STATUS_COUNTER_LSB) & COUNTER_INT_STATUS_COUNTER_MASK) - -#define MBOX_FRAME_ADDRESS 0x00000404 -#define MBOX_FRAME_OFFSET 0x00000404 -#define MBOX_FRAME_RX_EOM_MSB 7 -#define MBOX_FRAME_RX_EOM_LSB 4 -#define MBOX_FRAME_RX_EOM_MASK 0x000000f0 -#define MBOX_FRAME_RX_EOM_GET(x) (((x) & MBOX_FRAME_RX_EOM_MASK) >> MBOX_FRAME_RX_EOM_LSB) -#define MBOX_FRAME_RX_EOM_SET(x) (((x) << MBOX_FRAME_RX_EOM_LSB) & MBOX_FRAME_RX_EOM_MASK) -#define MBOX_FRAME_RX_SOM_MSB 3 -#define MBOX_FRAME_RX_SOM_LSB 0 -#define MBOX_FRAME_RX_SOM_MASK 0x0000000f -#define MBOX_FRAME_RX_SOM_GET(x) (((x) & MBOX_FRAME_RX_SOM_MASK) >> MBOX_FRAME_RX_SOM_LSB) -#define MBOX_FRAME_RX_SOM_SET(x) (((x) << MBOX_FRAME_RX_SOM_LSB) & MBOX_FRAME_RX_SOM_MASK) - -#define RX_LOOKAHEAD_VALID_ADDRESS 0x00000405 -#define RX_LOOKAHEAD_VALID_OFFSET 0x00000405 -#define RX_LOOKAHEAD_VALID_MBOX_MSB 3 -#define RX_LOOKAHEAD_VALID_MBOX_LSB 0 -#define RX_LOOKAHEAD_VALID_MBOX_MASK 0x0000000f -#define RX_LOOKAHEAD_VALID_MBOX_GET(x) (((x) & RX_LOOKAHEAD_VALID_MBOX_MASK) >> RX_LOOKAHEAD_VALID_MBOX_LSB) -#define RX_LOOKAHEAD_VALID_MBOX_SET(x) (((x) << RX_LOOKAHEAD_VALID_MBOX_LSB) & RX_LOOKAHEAD_VALID_MBOX_MASK) - -#define RX_LOOKAHEAD0_ADDRESS 0x00000408 -#define RX_LOOKAHEAD0_OFFSET 0x00000408 -#define RX_LOOKAHEAD0_DATA_MSB 7 -#define RX_LOOKAHEAD0_DATA_LSB 0 -#define RX_LOOKAHEAD0_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD0_DATA_GET(x) (((x) & RX_LOOKAHEAD0_DATA_MASK) >> RX_LOOKAHEAD0_DATA_LSB) -#define RX_LOOKAHEAD0_DATA_SET(x) (((x) << RX_LOOKAHEAD0_DATA_LSB) & RX_LOOKAHEAD0_DATA_MASK) - -#define RX_LOOKAHEAD1_ADDRESS 0x0000040c -#define RX_LOOKAHEAD1_OFFSET 0x0000040c -#define RX_LOOKAHEAD1_DATA_MSB 7 -#define RX_LOOKAHEAD1_DATA_LSB 0 -#define RX_LOOKAHEAD1_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD1_DATA_GET(x) (((x) & RX_LOOKAHEAD1_DATA_MASK) >> RX_LOOKAHEAD1_DATA_LSB) -#define RX_LOOKAHEAD1_DATA_SET(x) (((x) << RX_LOOKAHEAD1_DATA_LSB) & RX_LOOKAHEAD1_DATA_MASK) - -#define RX_LOOKAHEAD2_ADDRESS 0x00000410 -#define RX_LOOKAHEAD2_OFFSET 0x00000410 -#define RX_LOOKAHEAD2_DATA_MSB 7 -#define RX_LOOKAHEAD2_DATA_LSB 0 -#define RX_LOOKAHEAD2_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD2_DATA_GET(x) (((x) & RX_LOOKAHEAD2_DATA_MASK) >> RX_LOOKAHEAD2_DATA_LSB) -#define RX_LOOKAHEAD2_DATA_SET(x) (((x) << RX_LOOKAHEAD2_DATA_LSB) & RX_LOOKAHEAD2_DATA_MASK) - -#define RX_LOOKAHEAD3_ADDRESS 0x00000414 -#define RX_LOOKAHEAD3_OFFSET 0x00000414 -#define RX_LOOKAHEAD3_DATA_MSB 7 -#define RX_LOOKAHEAD3_DATA_LSB 0 -#define RX_LOOKAHEAD3_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD3_DATA_GET(x) (((x) & RX_LOOKAHEAD3_DATA_MASK) >> RX_LOOKAHEAD3_DATA_LSB) -#define RX_LOOKAHEAD3_DATA_SET(x) (((x) << RX_LOOKAHEAD3_DATA_LSB) & RX_LOOKAHEAD3_DATA_MASK) - -#define INT_STATUS_ENABLE_ADDRESS 0x00000418 -#define INT_STATUS_ENABLE_OFFSET 0x00000418 -#define INT_STATUS_ENABLE_ERROR_MSB 7 -#define INT_STATUS_ENABLE_ERROR_LSB 7 -#define INT_STATUS_ENABLE_ERROR_MASK 0x00000080 -#define INT_STATUS_ENABLE_ERROR_GET(x) (((x) & INT_STATUS_ENABLE_ERROR_MASK) >> INT_STATUS_ENABLE_ERROR_LSB) -#define INT_STATUS_ENABLE_ERROR_SET(x) (((x) << INT_STATUS_ENABLE_ERROR_LSB) & INT_STATUS_ENABLE_ERROR_MASK) -#define INT_STATUS_ENABLE_CPU_MSB 6 -#define INT_STATUS_ENABLE_CPU_LSB 6 -#define INT_STATUS_ENABLE_CPU_MASK 0x00000040 -#define INT_STATUS_ENABLE_CPU_GET(x) (((x) & INT_STATUS_ENABLE_CPU_MASK) >> INT_STATUS_ENABLE_CPU_LSB) -#define INT_STATUS_ENABLE_CPU_SET(x) (((x) << INT_STATUS_ENABLE_CPU_LSB) & INT_STATUS_ENABLE_CPU_MASK) -#define INT_STATUS_ENABLE_DRAGON_INT_MSB 5 -#define INT_STATUS_ENABLE_DRAGON_INT_LSB 5 -#define INT_STATUS_ENABLE_DRAGON_INT_MASK 0x00000020 -#define INT_STATUS_ENABLE_DRAGON_INT_GET(x) (((x) & INT_STATUS_ENABLE_DRAGON_INT_MASK) >> INT_STATUS_ENABLE_DRAGON_INT_LSB) -#define INT_STATUS_ENABLE_DRAGON_INT_SET(x) (((x) << INT_STATUS_ENABLE_DRAGON_INT_LSB) & INT_STATUS_ENABLE_DRAGON_INT_MASK) -#define INT_STATUS_ENABLE_COUNTER_MSB 4 -#define INT_STATUS_ENABLE_COUNTER_LSB 4 -#define INT_STATUS_ENABLE_COUNTER_MASK 0x00000010 -#define INT_STATUS_ENABLE_COUNTER_GET(x) (((x) & INT_STATUS_ENABLE_COUNTER_MASK) >> INT_STATUS_ENABLE_COUNTER_LSB) -#define INT_STATUS_ENABLE_COUNTER_SET(x) (((x) << INT_STATUS_ENABLE_COUNTER_LSB) & INT_STATUS_ENABLE_COUNTER_MASK) -#define INT_STATUS_ENABLE_MBOX_DATA_MSB 3 -#define INT_STATUS_ENABLE_MBOX_DATA_LSB 0 -#define INT_STATUS_ENABLE_MBOX_DATA_MASK 0x0000000f -#define INT_STATUS_ENABLE_MBOX_DATA_GET(x) (((x) & INT_STATUS_ENABLE_MBOX_DATA_MASK) >> INT_STATUS_ENABLE_MBOX_DATA_LSB) -#define INT_STATUS_ENABLE_MBOX_DATA_SET(x) (((x) << INT_STATUS_ENABLE_MBOX_DATA_LSB) & INT_STATUS_ENABLE_MBOX_DATA_MASK) - -#define CPU_INT_STATUS_ENABLE_ADDRESS 0x00000419 -#define CPU_INT_STATUS_ENABLE_OFFSET 0x00000419 -#define CPU_INT_STATUS_ENABLE_BIT_MSB 7 -#define CPU_INT_STATUS_ENABLE_BIT_LSB 0 -#define CPU_INT_STATUS_ENABLE_BIT_MASK 0x000000ff -#define CPU_INT_STATUS_ENABLE_BIT_GET(x) (((x) & CPU_INT_STATUS_ENABLE_BIT_MASK) >> CPU_INT_STATUS_ENABLE_BIT_LSB) -#define CPU_INT_STATUS_ENABLE_BIT_SET(x) (((x) << CPU_INT_STATUS_ENABLE_BIT_LSB) & CPU_INT_STATUS_ENABLE_BIT_MASK) - -#define ERROR_STATUS_ENABLE_ADDRESS 0x0000041a -#define ERROR_STATUS_ENABLE_OFFSET 0x0000041a -#define ERROR_STATUS_ENABLE_WAKEUP_MSB 2 -#define ERROR_STATUS_ENABLE_WAKEUP_LSB 2 -#define ERROR_STATUS_ENABLE_WAKEUP_MASK 0x00000004 -#define ERROR_STATUS_ENABLE_WAKEUP_GET(x) (((x) & ERROR_STATUS_ENABLE_WAKEUP_MASK) >> ERROR_STATUS_ENABLE_WAKEUP_LSB) -#define ERROR_STATUS_ENABLE_WAKEUP_SET(x) (((x) << ERROR_STATUS_ENABLE_WAKEUP_LSB) & ERROR_STATUS_ENABLE_WAKEUP_MASK) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MSB 1 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB 1 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK 0x00000002 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) >> ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MSB 0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB 0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK 0x00000001 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) >> ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) - -#define COUNTER_INT_STATUS_ENABLE_ADDRESS 0x0000041b -#define COUNTER_INT_STATUS_ENABLE_OFFSET 0x0000041b -#define COUNTER_INT_STATUS_ENABLE_BIT_MSB 7 -#define COUNTER_INT_STATUS_ENABLE_BIT_LSB 0 -#define COUNTER_INT_STATUS_ENABLE_BIT_MASK 0x000000ff -#define COUNTER_INT_STATUS_ENABLE_BIT_GET(x) (((x) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) >> COUNTER_INT_STATUS_ENABLE_BIT_LSB) -#define COUNTER_INT_STATUS_ENABLE_BIT_SET(x) (((x) << COUNTER_INT_STATUS_ENABLE_BIT_LSB) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) - -#define COUNT_ADDRESS 0x00000420 -#define COUNT_OFFSET 0x00000420 -#define COUNT_VALUE_MSB 7 -#define COUNT_VALUE_LSB 0 -#define COUNT_VALUE_MASK 0x000000ff -#define COUNT_VALUE_GET(x) (((x) & COUNT_VALUE_MASK) >> COUNT_VALUE_LSB) -#define COUNT_VALUE_SET(x) (((x) << COUNT_VALUE_LSB) & COUNT_VALUE_MASK) - -#define COUNT_DEC_ADDRESS 0x00000440 -#define COUNT_DEC_OFFSET 0x00000440 -#define COUNT_DEC_VALUE_MSB 7 -#define COUNT_DEC_VALUE_LSB 0 -#define COUNT_DEC_VALUE_MASK 0x000000ff -#define COUNT_DEC_VALUE_GET(x) (((x) & COUNT_DEC_VALUE_MASK) >> COUNT_DEC_VALUE_LSB) -#define COUNT_DEC_VALUE_SET(x) (((x) << COUNT_DEC_VALUE_LSB) & COUNT_DEC_VALUE_MASK) - -#define SCRATCH_ADDRESS 0x00000460 -#define SCRATCH_OFFSET 0x00000460 -#define SCRATCH_VALUE_MSB 7 -#define SCRATCH_VALUE_LSB 0 -#define SCRATCH_VALUE_MASK 0x000000ff -#define SCRATCH_VALUE_GET(x) (((x) & SCRATCH_VALUE_MASK) >> SCRATCH_VALUE_LSB) -#define SCRATCH_VALUE_SET(x) (((x) << SCRATCH_VALUE_LSB) & SCRATCH_VALUE_MASK) - -#define FIFO_TIMEOUT_ADDRESS 0x00000468 -#define FIFO_TIMEOUT_OFFSET 0x00000468 -#define FIFO_TIMEOUT_VALUE_MSB 7 -#define FIFO_TIMEOUT_VALUE_LSB 0 -#define FIFO_TIMEOUT_VALUE_MASK 0x000000ff -#define FIFO_TIMEOUT_VALUE_GET(x) (((x) & FIFO_TIMEOUT_VALUE_MASK) >> FIFO_TIMEOUT_VALUE_LSB) -#define FIFO_TIMEOUT_VALUE_SET(x) (((x) << FIFO_TIMEOUT_VALUE_LSB) & FIFO_TIMEOUT_VALUE_MASK) - -#define FIFO_TIMEOUT_ENABLE_ADDRESS 0x00000469 -#define FIFO_TIMEOUT_ENABLE_OFFSET 0x00000469 -#define FIFO_TIMEOUT_ENABLE_SET_MSB 0 -#define FIFO_TIMEOUT_ENABLE_SET_LSB 0 -#define FIFO_TIMEOUT_ENABLE_SET_MASK 0x00000001 -#define FIFO_TIMEOUT_ENABLE_SET_GET(x) (((x) & FIFO_TIMEOUT_ENABLE_SET_MASK) >> FIFO_TIMEOUT_ENABLE_SET_LSB) -#define FIFO_TIMEOUT_ENABLE_SET_SET(x) (((x) << FIFO_TIMEOUT_ENABLE_SET_LSB) & FIFO_TIMEOUT_ENABLE_SET_MASK) - -#define DISABLE_SLEEP_ADDRESS 0x0000046a -#define DISABLE_SLEEP_OFFSET 0x0000046a -#define DISABLE_SLEEP_FOR_INT_MSB 1 -#define DISABLE_SLEEP_FOR_INT_LSB 1 -#define DISABLE_SLEEP_FOR_INT_MASK 0x00000002 -#define DISABLE_SLEEP_FOR_INT_GET(x) (((x) & DISABLE_SLEEP_FOR_INT_MASK) >> DISABLE_SLEEP_FOR_INT_LSB) -#define DISABLE_SLEEP_FOR_INT_SET(x) (((x) << DISABLE_SLEEP_FOR_INT_LSB) & DISABLE_SLEEP_FOR_INT_MASK) -#define DISABLE_SLEEP_ON_MSB 0 -#define DISABLE_SLEEP_ON_LSB 0 -#define DISABLE_SLEEP_ON_MASK 0x00000001 -#define DISABLE_SLEEP_ON_GET(x) (((x) & DISABLE_SLEEP_ON_MASK) >> DISABLE_SLEEP_ON_LSB) -#define DISABLE_SLEEP_ON_SET(x) (((x) << DISABLE_SLEEP_ON_LSB) & DISABLE_SLEEP_ON_MASK) - -#define LOCAL_BUS_ADDRESS 0x00000470 -#define LOCAL_BUS_OFFSET 0x00000470 -#define LOCAL_BUS_STATE_MSB 1 -#define LOCAL_BUS_STATE_LSB 0 -#define LOCAL_BUS_STATE_MASK 0x00000003 -#define LOCAL_BUS_STATE_GET(x) (((x) & LOCAL_BUS_STATE_MASK) >> LOCAL_BUS_STATE_LSB) -#define LOCAL_BUS_STATE_SET(x) (((x) << LOCAL_BUS_STATE_LSB) & LOCAL_BUS_STATE_MASK) - -#define INT_WLAN_ADDRESS 0x00000472 -#define INT_WLAN_OFFSET 0x00000472 -#define INT_WLAN_VECTOR_MSB 7 -#define INT_WLAN_VECTOR_LSB 0 -#define INT_WLAN_VECTOR_MASK 0x000000ff -#define INT_WLAN_VECTOR_GET(x) (((x) & INT_WLAN_VECTOR_MASK) >> INT_WLAN_VECTOR_LSB) -#define INT_WLAN_VECTOR_SET(x) (((x) << INT_WLAN_VECTOR_LSB) & INT_WLAN_VECTOR_MASK) - -#define WINDOW_DATA_ADDRESS 0x00000474 -#define WINDOW_DATA_OFFSET 0x00000474 -#define WINDOW_DATA_DATA_MSB 7 -#define WINDOW_DATA_DATA_LSB 0 -#define WINDOW_DATA_DATA_MASK 0x000000ff -#define WINDOW_DATA_DATA_GET(x) (((x) & WINDOW_DATA_DATA_MASK) >> WINDOW_DATA_DATA_LSB) -#define WINDOW_DATA_DATA_SET(x) (((x) << WINDOW_DATA_DATA_LSB) & WINDOW_DATA_DATA_MASK) - -#define WINDOW_WRITE_ADDR_ADDRESS 0x00000478 -#define WINDOW_WRITE_ADDR_OFFSET 0x00000478 -#define WINDOW_WRITE_ADDR_ADDR_MSB 7 -#define WINDOW_WRITE_ADDR_ADDR_LSB 0 -#define WINDOW_WRITE_ADDR_ADDR_MASK 0x000000ff -#define WINDOW_WRITE_ADDR_ADDR_GET(x) (((x) & WINDOW_WRITE_ADDR_ADDR_MASK) >> WINDOW_WRITE_ADDR_ADDR_LSB) -#define WINDOW_WRITE_ADDR_ADDR_SET(x) (((x) << WINDOW_WRITE_ADDR_ADDR_LSB) & WINDOW_WRITE_ADDR_ADDR_MASK) - -#define WINDOW_READ_ADDR_ADDRESS 0x0000047c -#define WINDOW_READ_ADDR_OFFSET 0x0000047c -#define WINDOW_READ_ADDR_ADDR_MSB 7 -#define WINDOW_READ_ADDR_ADDR_LSB 0 -#define WINDOW_READ_ADDR_ADDR_MASK 0x000000ff -#define WINDOW_READ_ADDR_ADDR_GET(x) (((x) & WINDOW_READ_ADDR_ADDR_MASK) >> WINDOW_READ_ADDR_ADDR_LSB) -#define WINDOW_READ_ADDR_ADDR_SET(x) (((x) << WINDOW_READ_ADDR_ADDR_LSB) & WINDOW_READ_ADDR_ADDR_MASK) - -#define SPI_CONFIG_ADDRESS 0x00000480 -#define SPI_CONFIG_OFFSET 0x00000480 -#define SPI_CONFIG_SPI_RESET_MSB 4 -#define SPI_CONFIG_SPI_RESET_LSB 4 -#define SPI_CONFIG_SPI_RESET_MASK 0x00000010 -#define SPI_CONFIG_SPI_RESET_GET(x) (((x) & SPI_CONFIG_SPI_RESET_MASK) >> SPI_CONFIG_SPI_RESET_LSB) -#define SPI_CONFIG_SPI_RESET_SET(x) (((x) << SPI_CONFIG_SPI_RESET_LSB) & SPI_CONFIG_SPI_RESET_MASK) -#define SPI_CONFIG_INTERRUPT_ENABLE_MSB 3 -#define SPI_CONFIG_INTERRUPT_ENABLE_LSB 3 -#define SPI_CONFIG_INTERRUPT_ENABLE_MASK 0x00000008 -#define SPI_CONFIG_INTERRUPT_ENABLE_GET(x) (((x) & SPI_CONFIG_INTERRUPT_ENABLE_MASK) >> SPI_CONFIG_INTERRUPT_ENABLE_LSB) -#define SPI_CONFIG_INTERRUPT_ENABLE_SET(x) (((x) << SPI_CONFIG_INTERRUPT_ENABLE_LSB) & SPI_CONFIG_INTERRUPT_ENABLE_MASK) -#define SPI_CONFIG_TEST_MODE_MSB 2 -#define SPI_CONFIG_TEST_MODE_LSB 2 -#define SPI_CONFIG_TEST_MODE_MASK 0x00000004 -#define SPI_CONFIG_TEST_MODE_GET(x) (((x) & SPI_CONFIG_TEST_MODE_MASK) >> SPI_CONFIG_TEST_MODE_LSB) -#define SPI_CONFIG_TEST_MODE_SET(x) (((x) << SPI_CONFIG_TEST_MODE_LSB) & SPI_CONFIG_TEST_MODE_MASK) -#define SPI_CONFIG_DATA_SIZE_MSB 1 -#define SPI_CONFIG_DATA_SIZE_LSB 0 -#define SPI_CONFIG_DATA_SIZE_MASK 0x00000003 -#define SPI_CONFIG_DATA_SIZE_GET(x) (((x) & SPI_CONFIG_DATA_SIZE_MASK) >> SPI_CONFIG_DATA_SIZE_LSB) -#define SPI_CONFIG_DATA_SIZE_SET(x) (((x) << SPI_CONFIG_DATA_SIZE_LSB) & SPI_CONFIG_DATA_SIZE_MASK) - -#define SPI_STATUS_ADDRESS 0x00000481 -#define SPI_STATUS_OFFSET 0x00000481 -#define SPI_STATUS_ADDR_ERR_MSB 3 -#define SPI_STATUS_ADDR_ERR_LSB 3 -#define SPI_STATUS_ADDR_ERR_MASK 0x00000008 -#define SPI_STATUS_ADDR_ERR_GET(x) (((x) & SPI_STATUS_ADDR_ERR_MASK) >> SPI_STATUS_ADDR_ERR_LSB) -#define SPI_STATUS_ADDR_ERR_SET(x) (((x) << SPI_STATUS_ADDR_ERR_LSB) & SPI_STATUS_ADDR_ERR_MASK) -#define SPI_STATUS_RD_ERR_MSB 2 -#define SPI_STATUS_RD_ERR_LSB 2 -#define SPI_STATUS_RD_ERR_MASK 0x00000004 -#define SPI_STATUS_RD_ERR_GET(x) (((x) & SPI_STATUS_RD_ERR_MASK) >> SPI_STATUS_RD_ERR_LSB) -#define SPI_STATUS_RD_ERR_SET(x) (((x) << SPI_STATUS_RD_ERR_LSB) & SPI_STATUS_RD_ERR_MASK) -#define SPI_STATUS_WR_ERR_MSB 1 -#define SPI_STATUS_WR_ERR_LSB 1 -#define SPI_STATUS_WR_ERR_MASK 0x00000002 -#define SPI_STATUS_WR_ERR_GET(x) (((x) & SPI_STATUS_WR_ERR_MASK) >> SPI_STATUS_WR_ERR_LSB) -#define SPI_STATUS_WR_ERR_SET(x) (((x) << SPI_STATUS_WR_ERR_LSB) & SPI_STATUS_WR_ERR_MASK) -#define SPI_STATUS_READY_MSB 0 -#define SPI_STATUS_READY_LSB 0 -#define SPI_STATUS_READY_MASK 0x00000001 -#define SPI_STATUS_READY_GET(x) (((x) & SPI_STATUS_READY_MASK) >> SPI_STATUS_READY_LSB) -#define SPI_STATUS_READY_SET(x) (((x) << SPI_STATUS_READY_LSB) & SPI_STATUS_READY_MASK) - -#define NON_ASSOC_SLEEP_EN_ADDRESS 0x00000482 -#define NON_ASSOC_SLEEP_EN_OFFSET 0x00000482 -#define NON_ASSOC_SLEEP_EN_BIT_MSB 0 -#define NON_ASSOC_SLEEP_EN_BIT_LSB 0 -#define NON_ASSOC_SLEEP_EN_BIT_MASK 0x00000001 -#define NON_ASSOC_SLEEP_EN_BIT_GET(x) (((x) & NON_ASSOC_SLEEP_EN_BIT_MASK) >> NON_ASSOC_SLEEP_EN_BIT_LSB) -#define NON_ASSOC_SLEEP_EN_BIT_SET(x) (((x) << NON_ASSOC_SLEEP_EN_BIT_LSB) & NON_ASSOC_SLEEP_EN_BIT_MASK) - -#define CIS_WINDOW_ADDRESS 0x00000600 -#define CIS_WINDOW_OFFSET 0x00000600 -#define CIS_WINDOW_DATA_MSB 7 -#define CIS_WINDOW_DATA_LSB 0 -#define CIS_WINDOW_DATA_MASK 0x000000ff -#define CIS_WINDOW_DATA_GET(x) (((x) & CIS_WINDOW_DATA_MASK) >> CIS_WINDOW_DATA_LSB) -#define CIS_WINDOW_DATA_SET(x) (((x) << CIS_WINDOW_DATA_LSB) & CIS_WINDOW_DATA_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct mbox_host_reg_reg_s { - unsigned char pad0[1024]; /* pad to 0x400 */ - volatile unsigned char host_int_status; - volatile unsigned char cpu_int_status; - volatile unsigned char error_int_status; - volatile unsigned char counter_int_status; - volatile unsigned char mbox_frame; - volatile unsigned char rx_lookahead_valid; - unsigned char pad1[2]; /* pad to 0x408 */ - volatile unsigned char rx_lookahead0[4]; - volatile unsigned char rx_lookahead1[4]; - volatile unsigned char rx_lookahead2[4]; - volatile unsigned char rx_lookahead3[4]; - volatile unsigned char int_status_enable; - volatile unsigned char cpu_int_status_enable; - volatile unsigned char error_status_enable; - volatile unsigned char counter_int_status_enable; - unsigned char pad2[4]; /* pad to 0x420 */ - volatile unsigned char count[8]; - unsigned char pad3[24]; /* pad to 0x440 */ - volatile unsigned char count_dec[32]; - volatile unsigned char scratch[8]; - volatile unsigned char fifo_timeout; - volatile unsigned char fifo_timeout_enable; - volatile unsigned char disable_sleep; - unsigned char pad4[5]; /* pad to 0x470 */ - volatile unsigned char local_bus; - unsigned char pad5[1]; /* pad to 0x472 */ - volatile unsigned char int_wlan; - unsigned char pad6[1]; /* pad to 0x474 */ - volatile unsigned char window_data[4]; - volatile unsigned char window_write_addr[4]; - volatile unsigned char window_read_addr[4]; - volatile unsigned char spi_config; - volatile unsigned char spi_status; - volatile unsigned char non_assoc_sleep_en; - unsigned char pad7[381]; /* pad to 0x600 */ - volatile unsigned char cis_window[512]; -} mbox_host_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _MBOX_HOST_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_host_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_host_reg.vrh deleted file mode 100644 index 3cf45eaa0cee..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_host_reg.vrh +++ /dev/null @@ -1,563 +0,0 @@ -#ifndef _MBOX_HOST_REG_VRH_ -#define _MBOX_HOST_REG_VRH_ - -#define HOST_INT_STATUS_ADDRESS 'h00000400 -#define HOST_INT_STATUS_ERROR_MSB 7 -#define HOST_INT_STATUS_ERROR_LSB 7 -#define HOST_INT_STATUS_ERROR_MASK 'h00000080 -#define HOST_INT_STATUS_ERROR_GET(x) (((x) & HOST_INT_STATUS_ERROR_MASK) >> HOST_INT_STATUS_ERROR_LSB) -#define HOST_INT_STATUS_ERROR_SET(x) (((8'd0 | (x)) << HOST_INT_STATUS_ERROR_LSB) & HOST_INT_STATUS_ERROR_MASK) -#define HOST_INT_STATUS_ERROR_RESET 1'h0 -#define HOST_INT_STATUS_CPU_MSB 6 -#define HOST_INT_STATUS_CPU_LSB 6 -#define HOST_INT_STATUS_CPU_MASK 'h00000040 -#define HOST_INT_STATUS_CPU_GET(x) (((x) & HOST_INT_STATUS_CPU_MASK) >> HOST_INT_STATUS_CPU_LSB) -#define HOST_INT_STATUS_CPU_SET(x) (((8'd0 | (x)) << HOST_INT_STATUS_CPU_LSB) & HOST_INT_STATUS_CPU_MASK) -#define HOST_INT_STATUS_CPU_RESET 1'h0 -#define HOST_INT_STATUS_DRAGON_INT_MSB 5 -#define HOST_INT_STATUS_DRAGON_INT_LSB 5 -#define HOST_INT_STATUS_DRAGON_INT_MASK 'h00000020 -#define HOST_INT_STATUS_DRAGON_INT_GET(x) (((x) & HOST_INT_STATUS_DRAGON_INT_MASK) >> HOST_INT_STATUS_DRAGON_INT_LSB) -#define HOST_INT_STATUS_DRAGON_INT_SET(x) (((8'd0 | (x)) << HOST_INT_STATUS_DRAGON_INT_LSB) & HOST_INT_STATUS_DRAGON_INT_MASK) -#define HOST_INT_STATUS_DRAGON_INT_RESET 1'h0 -#define HOST_INT_STATUS_COUNTER_MSB 4 -#define HOST_INT_STATUS_COUNTER_LSB 4 -#define HOST_INT_STATUS_COUNTER_MASK 'h00000010 -#define HOST_INT_STATUS_COUNTER_GET(x) (((x) & HOST_INT_STATUS_COUNTER_MASK) >> HOST_INT_STATUS_COUNTER_LSB) -#define HOST_INT_STATUS_COUNTER_SET(x) (((8'd0 | (x)) << HOST_INT_STATUS_COUNTER_LSB) & HOST_INT_STATUS_COUNTER_MASK) -#define HOST_INT_STATUS_COUNTER_RESET 1'h0 -#define HOST_INT_STATUS_MBOX_DATA_MSB 3 -#define HOST_INT_STATUS_MBOX_DATA_LSB 0 -#define HOST_INT_STATUS_MBOX_DATA_MASK 'h0000000f -#define HOST_INT_STATUS_MBOX_DATA_GET(x) (((x) & HOST_INT_STATUS_MBOX_DATA_MASK) >> HOST_INT_STATUS_MBOX_DATA_LSB) -#define HOST_INT_STATUS_MBOX_DATA_SET(x) (((8'd0 | (x)) << HOST_INT_STATUS_MBOX_DATA_LSB) & HOST_INT_STATUS_MBOX_DATA_MASK) -#define HOST_INT_STATUS_MBOX_DATA_RESET 4'h0 -#define HOST_INT_STATUS_RESET (8'h0 | \ - HOST_INT_STATUS_ERROR_SET(HOST_INT_STATUS_ERROR_RESET) | \ - HOST_INT_STATUS_CPU_SET(HOST_INT_STATUS_CPU_RESET) | \ - HOST_INT_STATUS_DRAGON_INT_SET(HOST_INT_STATUS_DRAGON_INT_RESET) | \ - HOST_INT_STATUS_COUNTER_SET(HOST_INT_STATUS_COUNTER_RESET) | \ - HOST_INT_STATUS_MBOX_DATA_SET(HOST_INT_STATUS_MBOX_DATA_RESET)) -#define HOST_INT_STATUS_HW_MASK (8'h0 | \ - HOST_INT_STATUS_ERROR_MASK | \ - HOST_INT_STATUS_CPU_MASK | \ - HOST_INT_STATUS_DRAGON_INT_MASK | \ - HOST_INT_STATUS_COUNTER_MASK | \ - HOST_INT_STATUS_MBOX_DATA_MASK) -#define HOST_INT_STATUS_SW_MASK (8'h0) - -#define CPU_INT_STATUS_ADDRESS 'h00000401 -#define CPU_INT_STATUS_BIT_MSB 7 -#define CPU_INT_STATUS_BIT_LSB 0 -#define CPU_INT_STATUS_BIT_MASK 'h000000ff -#define CPU_INT_STATUS_BIT_GET(x) (((x) & CPU_INT_STATUS_BIT_MASK) >> CPU_INT_STATUS_BIT_LSB) -#define CPU_INT_STATUS_BIT_SET(x) (((8'd0 | (x)) << CPU_INT_STATUS_BIT_LSB) & CPU_INT_STATUS_BIT_MASK) -#define CPU_INT_STATUS_BIT_RESET 8'h0 -#define CPU_INT_STATUS_RESET (8'h0 | \ - CPU_INT_STATUS_BIT_SET(CPU_INT_STATUS_BIT_RESET)) -#define CPU_INT_STATUS_HW_MASK (8'h0 | \ - CPU_INT_STATUS_BIT_MASK) -#define CPU_INT_STATUS_SW_MASK (8'h0 | \ - CPU_INT_STATUS_BIT_MASK) - -#define ERROR_INT_STATUS_ADDRESS 'h00000402 -#define ERROR_INT_STATUS_SPI_MSB 3 -#define ERROR_INT_STATUS_SPI_LSB 3 -#define ERROR_INT_STATUS_SPI_MASK 'h00000008 -#define ERROR_INT_STATUS_SPI_GET(x) (((x) & ERROR_INT_STATUS_SPI_MASK) >> ERROR_INT_STATUS_SPI_LSB) -#define ERROR_INT_STATUS_SPI_SET(x) (((8'd0 | (x)) << ERROR_INT_STATUS_SPI_LSB) & ERROR_INT_STATUS_SPI_MASK) -#define ERROR_INT_STATUS_SPI_RESET 1'h0 -#define ERROR_INT_STATUS_WAKEUP_MSB 2 -#define ERROR_INT_STATUS_WAKEUP_LSB 2 -#define ERROR_INT_STATUS_WAKEUP_MASK 'h00000004 -#define ERROR_INT_STATUS_WAKEUP_GET(x) (((x) & ERROR_INT_STATUS_WAKEUP_MASK) >> ERROR_INT_STATUS_WAKEUP_LSB) -#define ERROR_INT_STATUS_WAKEUP_SET(x) (((8'd0 | (x)) << ERROR_INT_STATUS_WAKEUP_LSB) & ERROR_INT_STATUS_WAKEUP_MASK) -#define ERROR_INT_STATUS_WAKEUP_RESET 1'h0 -#define ERROR_INT_STATUS_RX_UNDERFLOW_MSB 1 -#define ERROR_INT_STATUS_RX_UNDERFLOW_LSB 1 -#define ERROR_INT_STATUS_RX_UNDERFLOW_MASK 'h00000002 -#define ERROR_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) >> ERROR_INT_STATUS_RX_UNDERFLOW_LSB) -#define ERROR_INT_STATUS_RX_UNDERFLOW_SET(x) (((8'd0 | (x)) << ERROR_INT_STATUS_RX_UNDERFLOW_LSB) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) -#define ERROR_INT_STATUS_RX_UNDERFLOW_RESET 1'h0 -#define ERROR_INT_STATUS_TX_OVERFLOW_MSB 0 -#define ERROR_INT_STATUS_TX_OVERFLOW_LSB 0 -#define ERROR_INT_STATUS_TX_OVERFLOW_MASK 'h00000001 -#define ERROR_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) >> ERROR_INT_STATUS_TX_OVERFLOW_LSB) -#define ERROR_INT_STATUS_TX_OVERFLOW_SET(x) (((8'd0 | (x)) << ERROR_INT_STATUS_TX_OVERFLOW_LSB) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) -#define ERROR_INT_STATUS_TX_OVERFLOW_RESET 1'h0 -#define ERROR_INT_STATUS_RESET (8'h0 | \ - ERROR_INT_STATUS_SPI_SET(ERROR_INT_STATUS_SPI_RESET) | \ - ERROR_INT_STATUS_WAKEUP_SET(ERROR_INT_STATUS_WAKEUP_RESET) | \ - ERROR_INT_STATUS_RX_UNDERFLOW_SET(ERROR_INT_STATUS_RX_UNDERFLOW_RESET) | \ - ERROR_INT_STATUS_TX_OVERFLOW_SET(ERROR_INT_STATUS_TX_OVERFLOW_RESET)) -#define ERROR_INT_STATUS_HW_MASK (8'h0 | \ - ERROR_INT_STATUS_SPI_MASK | \ - ERROR_INT_STATUS_WAKEUP_MASK | \ - ERROR_INT_STATUS_RX_UNDERFLOW_MASK | \ - ERROR_INT_STATUS_TX_OVERFLOW_MASK) -#define ERROR_INT_STATUS_SW_MASK (8'h0 | \ - ERROR_INT_STATUS_WAKEUP_MASK | \ - ERROR_INT_STATUS_RX_UNDERFLOW_MASK | \ - ERROR_INT_STATUS_TX_OVERFLOW_MASK) - -#define COUNTER_INT_STATUS_ADDRESS 'h00000403 -#define COUNTER_INT_STATUS_COUNTER_MSB 7 -#define COUNTER_INT_STATUS_COUNTER_LSB 0 -#define COUNTER_INT_STATUS_COUNTER_MASK 'h000000ff -#define COUNTER_INT_STATUS_COUNTER_GET(x) (((x) & COUNTER_INT_STATUS_COUNTER_MASK) >> COUNTER_INT_STATUS_COUNTER_LSB) -#define COUNTER_INT_STATUS_COUNTER_SET(x) (((8'd0 | (x)) << COUNTER_INT_STATUS_COUNTER_LSB) & COUNTER_INT_STATUS_COUNTER_MASK) -#define COUNTER_INT_STATUS_COUNTER_RESET 8'h0 -#define COUNTER_INT_STATUS_RESET (8'h0 | \ - COUNTER_INT_STATUS_COUNTER_SET(COUNTER_INT_STATUS_COUNTER_RESET)) -#define COUNTER_INT_STATUS_HW_MASK (8'h0 | \ - COUNTER_INT_STATUS_COUNTER_MASK) -#define COUNTER_INT_STATUS_SW_MASK (8'h0) - -#define MBOX_FRAME_ADDRESS 'h00000404 -#define MBOX_FRAME_RX_EOM_MSB 7 -#define MBOX_FRAME_RX_EOM_LSB 4 -#define MBOX_FRAME_RX_EOM_MASK 'h000000f0 -#define MBOX_FRAME_RX_EOM_GET(x) (((x) & MBOX_FRAME_RX_EOM_MASK) >> MBOX_FRAME_RX_EOM_LSB) -#define MBOX_FRAME_RX_EOM_SET(x) (((8'd0 | (x)) << MBOX_FRAME_RX_EOM_LSB) & MBOX_FRAME_RX_EOM_MASK) -#define MBOX_FRAME_RX_EOM_RESET 4'h0 -#define MBOX_FRAME_RX_SOM_MSB 3 -#define MBOX_FRAME_RX_SOM_LSB 0 -#define MBOX_FRAME_RX_SOM_MASK 'h0000000f -#define MBOX_FRAME_RX_SOM_GET(x) (((x) & MBOX_FRAME_RX_SOM_MASK) >> MBOX_FRAME_RX_SOM_LSB) -#define MBOX_FRAME_RX_SOM_SET(x) (((8'd0 | (x)) << MBOX_FRAME_RX_SOM_LSB) & MBOX_FRAME_RX_SOM_MASK) -#define MBOX_FRAME_RX_SOM_RESET 4'hf -#define MBOX_FRAME_RESET (8'h0 | \ - MBOX_FRAME_RX_EOM_SET(MBOX_FRAME_RX_EOM_RESET) | \ - MBOX_FRAME_RX_SOM_SET(MBOX_FRAME_RX_SOM_RESET)) -#define MBOX_FRAME_HW_MASK (8'h0 | \ - MBOX_FRAME_RX_EOM_MASK | \ - MBOX_FRAME_RX_SOM_MASK) -#define MBOX_FRAME_SW_MASK (8'h0) - -#define RX_LOOKAHEAD_VALID_ADDRESS 'h00000405 -#define RX_LOOKAHEAD_VALID_MBOX_MSB 3 -#define RX_LOOKAHEAD_VALID_MBOX_LSB 0 -#define RX_LOOKAHEAD_VALID_MBOX_MASK 'h0000000f -#define RX_LOOKAHEAD_VALID_MBOX_GET(x) (((x) & RX_LOOKAHEAD_VALID_MBOX_MASK) >> RX_LOOKAHEAD_VALID_MBOX_LSB) -#define RX_LOOKAHEAD_VALID_MBOX_SET(x) (((8'd0 | (x)) << RX_LOOKAHEAD_VALID_MBOX_LSB) & RX_LOOKAHEAD_VALID_MBOX_MASK) -#define RX_LOOKAHEAD_VALID_MBOX_RESET 4'h0 -#define RX_LOOKAHEAD_VALID_RESET (8'h0 | \ - RX_LOOKAHEAD_VALID_MBOX_SET(RX_LOOKAHEAD_VALID_MBOX_RESET)) -#define RX_LOOKAHEAD_VALID_HW_MASK (8'h0 | \ - RX_LOOKAHEAD_VALID_MBOX_MASK) -#define RX_LOOKAHEAD_VALID_SW_MASK (8'h0) - -#define RX_LOOKAHEAD0_ADDRESS 'h00000408 -#define RX_LOOKAHEAD0_DATA_MSB 7 -#define RX_LOOKAHEAD0_DATA_LSB 0 -#define RX_LOOKAHEAD0_DATA_MASK 'h000000ff -#define RX_LOOKAHEAD0_DATA_GET(x) (((x) & RX_LOOKAHEAD0_DATA_MASK) >> RX_LOOKAHEAD0_DATA_LSB) -#define RX_LOOKAHEAD0_DATA_SET(x) (((8'd0 | (x)) << RX_LOOKAHEAD0_DATA_LSB) & RX_LOOKAHEAD0_DATA_MASK) -#define RX_LOOKAHEAD0_DATA_RESET 8'h0 -#define RX_LOOKAHEAD0_RESET (8'h0 | \ - RX_LOOKAHEAD0_DATA_SET(RX_LOOKAHEAD0_DATA_RESET)) -#define RX_LOOKAHEAD0_HW_MASK (8'h0 | \ - RX_LOOKAHEAD0_DATA_MASK) -#define RX_LOOKAHEAD0_SW_MASK (8'h0) - -#define RX_LOOKAHEAD1_ADDRESS 'h0000040c -#define RX_LOOKAHEAD1_DATA_MSB 7 -#define RX_LOOKAHEAD1_DATA_LSB 0 -#define RX_LOOKAHEAD1_DATA_MASK 'h000000ff -#define RX_LOOKAHEAD1_DATA_GET(x) (((x) & RX_LOOKAHEAD1_DATA_MASK) >> RX_LOOKAHEAD1_DATA_LSB) -#define RX_LOOKAHEAD1_DATA_SET(x) (((8'd0 | (x)) << RX_LOOKAHEAD1_DATA_LSB) & RX_LOOKAHEAD1_DATA_MASK) -#define RX_LOOKAHEAD1_DATA_RESET 8'h0 -#define RX_LOOKAHEAD1_RESET (8'h0 | \ - RX_LOOKAHEAD1_DATA_SET(RX_LOOKAHEAD1_DATA_RESET)) -#define RX_LOOKAHEAD1_HW_MASK (8'h0 | \ - RX_LOOKAHEAD1_DATA_MASK) -#define RX_LOOKAHEAD1_SW_MASK (8'h0) - -#define RX_LOOKAHEAD2_ADDRESS 'h00000410 -#define RX_LOOKAHEAD2_DATA_MSB 7 -#define RX_LOOKAHEAD2_DATA_LSB 0 -#define RX_LOOKAHEAD2_DATA_MASK 'h000000ff -#define RX_LOOKAHEAD2_DATA_GET(x) (((x) & RX_LOOKAHEAD2_DATA_MASK) >> RX_LOOKAHEAD2_DATA_LSB) -#define RX_LOOKAHEAD2_DATA_SET(x) (((8'd0 | (x)) << RX_LOOKAHEAD2_DATA_LSB) & RX_LOOKAHEAD2_DATA_MASK) -#define RX_LOOKAHEAD2_DATA_RESET 8'h0 -#define RX_LOOKAHEAD2_RESET (8'h0 | \ - RX_LOOKAHEAD2_DATA_SET(RX_LOOKAHEAD2_DATA_RESET)) -#define RX_LOOKAHEAD2_HW_MASK (8'h0 | \ - RX_LOOKAHEAD2_DATA_MASK) -#define RX_LOOKAHEAD2_SW_MASK (8'h0) - -#define RX_LOOKAHEAD3_ADDRESS 'h00000414 -#define RX_LOOKAHEAD3_DATA_MSB 7 -#define RX_LOOKAHEAD3_DATA_LSB 0 -#define RX_LOOKAHEAD3_DATA_MASK 'h000000ff -#define RX_LOOKAHEAD3_DATA_GET(x) (((x) & RX_LOOKAHEAD3_DATA_MASK) >> RX_LOOKAHEAD3_DATA_LSB) -#define RX_LOOKAHEAD3_DATA_SET(x) (((8'd0 | (x)) << RX_LOOKAHEAD3_DATA_LSB) & RX_LOOKAHEAD3_DATA_MASK) -#define RX_LOOKAHEAD3_DATA_RESET 8'h0 -#define RX_LOOKAHEAD3_RESET (8'h0 | \ - RX_LOOKAHEAD3_DATA_SET(RX_LOOKAHEAD3_DATA_RESET)) -#define RX_LOOKAHEAD3_HW_MASK (8'h0 | \ - RX_LOOKAHEAD3_DATA_MASK) -#define RX_LOOKAHEAD3_SW_MASK (8'h0) - -#define INT_STATUS_ENABLE_ADDRESS 'h00000418 -#define INT_STATUS_ENABLE_ERROR_MSB 7 -#define INT_STATUS_ENABLE_ERROR_LSB 7 -#define INT_STATUS_ENABLE_ERROR_MASK 'h00000080 -#define INT_STATUS_ENABLE_ERROR_GET(x) (((x) & INT_STATUS_ENABLE_ERROR_MASK) >> INT_STATUS_ENABLE_ERROR_LSB) -#define INT_STATUS_ENABLE_ERROR_SET(x) (((8'd0 | (x)) << INT_STATUS_ENABLE_ERROR_LSB) & INT_STATUS_ENABLE_ERROR_MASK) -#define INT_STATUS_ENABLE_ERROR_RESET 1'h1 -#define INT_STATUS_ENABLE_CPU_MSB 6 -#define INT_STATUS_ENABLE_CPU_LSB 6 -#define INT_STATUS_ENABLE_CPU_MASK 'h00000040 -#define INT_STATUS_ENABLE_CPU_GET(x) (((x) & INT_STATUS_ENABLE_CPU_MASK) >> INT_STATUS_ENABLE_CPU_LSB) -#define INT_STATUS_ENABLE_CPU_SET(x) (((8'd0 | (x)) << INT_STATUS_ENABLE_CPU_LSB) & INT_STATUS_ENABLE_CPU_MASK) -#define INT_STATUS_ENABLE_CPU_RESET 1'h1 -#define INT_STATUS_ENABLE_DRAGON_INT_MSB 5 -#define INT_STATUS_ENABLE_DRAGON_INT_LSB 5 -#define INT_STATUS_ENABLE_DRAGON_INT_MASK 'h00000020 -#define INT_STATUS_ENABLE_DRAGON_INT_GET(x) (((x) & INT_STATUS_ENABLE_DRAGON_INT_MASK) >> INT_STATUS_ENABLE_DRAGON_INT_LSB) -#define INT_STATUS_ENABLE_DRAGON_INT_SET(x) (((8'd0 | (x)) << INT_STATUS_ENABLE_DRAGON_INT_LSB) & INT_STATUS_ENABLE_DRAGON_INT_MASK) -#define INT_STATUS_ENABLE_DRAGON_INT_RESET 1'h0 -#define INT_STATUS_ENABLE_COUNTER_MSB 4 -#define INT_STATUS_ENABLE_COUNTER_LSB 4 -#define INT_STATUS_ENABLE_COUNTER_MASK 'h00000010 -#define INT_STATUS_ENABLE_COUNTER_GET(x) (((x) & INT_STATUS_ENABLE_COUNTER_MASK) >> INT_STATUS_ENABLE_COUNTER_LSB) -#define INT_STATUS_ENABLE_COUNTER_SET(x) (((8'd0 | (x)) << INT_STATUS_ENABLE_COUNTER_LSB) & INT_STATUS_ENABLE_COUNTER_MASK) -#define INT_STATUS_ENABLE_COUNTER_RESET 1'h0 -#define INT_STATUS_ENABLE_MBOX_DATA_MSB 3 -#define INT_STATUS_ENABLE_MBOX_DATA_LSB 0 -#define INT_STATUS_ENABLE_MBOX_DATA_MASK 'h0000000f -#define INT_STATUS_ENABLE_MBOX_DATA_GET(x) (((x) & INT_STATUS_ENABLE_MBOX_DATA_MASK) >> INT_STATUS_ENABLE_MBOX_DATA_LSB) -#define INT_STATUS_ENABLE_MBOX_DATA_SET(x) (((8'd0 | (x)) << INT_STATUS_ENABLE_MBOX_DATA_LSB) & INT_STATUS_ENABLE_MBOX_DATA_MASK) -#define INT_STATUS_ENABLE_MBOX_DATA_RESET 4'hf -#define INT_STATUS_ENABLE_RESET (8'h0 | \ - INT_STATUS_ENABLE_ERROR_SET(INT_STATUS_ENABLE_ERROR_RESET) | \ - INT_STATUS_ENABLE_CPU_SET(INT_STATUS_ENABLE_CPU_RESET) | \ - INT_STATUS_ENABLE_DRAGON_INT_SET(INT_STATUS_ENABLE_DRAGON_INT_RESET) | \ - INT_STATUS_ENABLE_COUNTER_SET(INT_STATUS_ENABLE_COUNTER_RESET) | \ - INT_STATUS_ENABLE_MBOX_DATA_SET(INT_STATUS_ENABLE_MBOX_DATA_RESET)) -#define INT_STATUS_ENABLE_HW_MASK (8'h0) -#define INT_STATUS_ENABLE_SW_MASK (8'h0 | \ - INT_STATUS_ENABLE_ERROR_MASK | \ - INT_STATUS_ENABLE_CPU_MASK | \ - INT_STATUS_ENABLE_DRAGON_INT_MASK | \ - INT_STATUS_ENABLE_COUNTER_MASK | \ - INT_STATUS_ENABLE_MBOX_DATA_MASK) - -#define CPU_INT_STATUS_ENABLE_ADDRESS 'h00000419 -#define CPU_INT_STATUS_ENABLE_BIT_MSB 7 -#define CPU_INT_STATUS_ENABLE_BIT_LSB 0 -#define CPU_INT_STATUS_ENABLE_BIT_MASK 'h000000ff -#define CPU_INT_STATUS_ENABLE_BIT_GET(x) (((x) & CPU_INT_STATUS_ENABLE_BIT_MASK) >> CPU_INT_STATUS_ENABLE_BIT_LSB) -#define CPU_INT_STATUS_ENABLE_BIT_SET(x) (((8'd0 | (x)) << CPU_INT_STATUS_ENABLE_BIT_LSB) & CPU_INT_STATUS_ENABLE_BIT_MASK) -#define CPU_INT_STATUS_ENABLE_BIT_RESET 8'hff -#define CPU_INT_STATUS_ENABLE_RESET (8'h0 | \ - CPU_INT_STATUS_ENABLE_BIT_SET(CPU_INT_STATUS_ENABLE_BIT_RESET)) -#define CPU_INT_STATUS_ENABLE_HW_MASK (8'h0) -#define CPU_INT_STATUS_ENABLE_SW_MASK (8'h0 | \ - CPU_INT_STATUS_ENABLE_BIT_MASK) - -#define ERROR_STATUS_ENABLE_ADDRESS 'h0000041a -#define ERROR_STATUS_ENABLE_WAKEUP_MSB 2 -#define ERROR_STATUS_ENABLE_WAKEUP_LSB 2 -#define ERROR_STATUS_ENABLE_WAKEUP_MASK 'h00000004 -#define ERROR_STATUS_ENABLE_WAKEUP_GET(x) (((x) & ERROR_STATUS_ENABLE_WAKEUP_MASK) >> ERROR_STATUS_ENABLE_WAKEUP_LSB) -#define ERROR_STATUS_ENABLE_WAKEUP_SET(x) (((8'd0 | (x)) << ERROR_STATUS_ENABLE_WAKEUP_LSB) & ERROR_STATUS_ENABLE_WAKEUP_MASK) -#define ERROR_STATUS_ENABLE_WAKEUP_RESET 1'h0 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MSB 1 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB 1 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK 'h00000002 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) >> ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_SET(x) (((8'd0 | (x)) << ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_RESET 1'h0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MSB 0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB 0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK 'h00000001 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) >> ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_SET(x) (((8'd0 | (x)) << ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_RESET 1'h0 -#define ERROR_STATUS_ENABLE_RESET (8'h0 | \ - ERROR_STATUS_ENABLE_WAKEUP_SET(ERROR_STATUS_ENABLE_WAKEUP_RESET) | \ - ERROR_STATUS_ENABLE_RX_UNDERFLOW_SET(ERROR_STATUS_ENABLE_RX_UNDERFLOW_RESET) | \ - ERROR_STATUS_ENABLE_TX_OVERFLOW_SET(ERROR_STATUS_ENABLE_TX_OVERFLOW_RESET)) -#define ERROR_STATUS_ENABLE_HW_MASK (8'h0) -#define ERROR_STATUS_ENABLE_SW_MASK (8'h0 | \ - ERROR_STATUS_ENABLE_WAKEUP_MASK | \ - ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK | \ - ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) - -#define COUNTER_INT_STATUS_ENABLE_ADDRESS 'h0000041b -#define COUNTER_INT_STATUS_ENABLE_BIT_MSB 7 -#define COUNTER_INT_STATUS_ENABLE_BIT_LSB 0 -#define COUNTER_INT_STATUS_ENABLE_BIT_MASK 'h000000ff -#define COUNTER_INT_STATUS_ENABLE_BIT_GET(x) (((x) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) >> COUNTER_INT_STATUS_ENABLE_BIT_LSB) -#define COUNTER_INT_STATUS_ENABLE_BIT_SET(x) (((8'd0 | (x)) << COUNTER_INT_STATUS_ENABLE_BIT_LSB) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) -#define COUNTER_INT_STATUS_ENABLE_BIT_RESET 8'hff -#define COUNTER_INT_STATUS_ENABLE_RESET (8'h0 | \ - COUNTER_INT_STATUS_ENABLE_BIT_SET(COUNTER_INT_STATUS_ENABLE_BIT_RESET)) -#define COUNTER_INT_STATUS_ENABLE_HW_MASK (8'h0) -#define COUNTER_INT_STATUS_ENABLE_SW_MASK (8'h0 | \ - COUNTER_INT_STATUS_ENABLE_BIT_MASK) - -#define COUNT_ADDRESS 'h00000420 -#define COUNT_VALUE_MSB 7 -#define COUNT_VALUE_LSB 0 -#define COUNT_VALUE_MASK 'h000000ff -#define COUNT_VALUE_GET(x) (((x) & COUNT_VALUE_MASK) >> COUNT_VALUE_LSB) -#define COUNT_VALUE_SET(x) (((8'd0 | (x)) << COUNT_VALUE_LSB) & COUNT_VALUE_MASK) -#define COUNT_VALUE_RESET 8'h0 -#define COUNT_RESET (8'h0 | \ - COUNT_VALUE_SET(COUNT_VALUE_RESET)) -#define COUNT_HW_MASK (8'h0 | \ - COUNT_VALUE_MASK) -#define COUNT_SW_MASK (8'h0 | \ - COUNT_VALUE_MASK) - -#define COUNT_DEC_ADDRESS 'h00000440 -#define COUNT_DEC_VALUE_MSB 7 -#define COUNT_DEC_VALUE_LSB 0 -#define COUNT_DEC_VALUE_MASK 'h000000ff -#define COUNT_DEC_VALUE_GET(x) (((x) & COUNT_DEC_VALUE_MASK) >> COUNT_DEC_VALUE_LSB) -#define COUNT_DEC_VALUE_SET(x) (((8'd0 | (x)) << COUNT_DEC_VALUE_LSB) & COUNT_DEC_VALUE_MASK) -#define COUNT_DEC_VALUE_RESET 8'h0 -#define COUNT_DEC_RESET (8'h0 | \ - COUNT_DEC_VALUE_SET(COUNT_DEC_VALUE_RESET)) -#define COUNT_DEC_HW_MASK (8'h0 | \ - COUNT_DEC_VALUE_MASK) -#define COUNT_DEC_SW_MASK (8'h0 | \ - COUNT_DEC_VALUE_MASK) - -#define SCRATCH_ADDRESS 'h00000460 -#define SCRATCH_VALUE_MSB 7 -#define SCRATCH_VALUE_LSB 0 -#define SCRATCH_VALUE_MASK 'h000000ff -#define SCRATCH_VALUE_GET(x) (((x) & SCRATCH_VALUE_MASK) >> SCRATCH_VALUE_LSB) -#define SCRATCH_VALUE_SET(x) (((8'd0 | (x)) << SCRATCH_VALUE_LSB) & SCRATCH_VALUE_MASK) -#define SCRATCH_VALUE_RESET 8'h0 -#define SCRATCH_RESET (8'h0 | \ - SCRATCH_VALUE_SET(SCRATCH_VALUE_RESET)) -#define SCRATCH_HW_MASK (8'h0 | \ - SCRATCH_VALUE_MASK) -#define SCRATCH_SW_MASK (8'h0 | \ - SCRATCH_VALUE_MASK) - -#define FIFO_TIMEOUT_ADDRESS 'h00000468 -#define FIFO_TIMEOUT_VALUE_MSB 7 -#define FIFO_TIMEOUT_VALUE_LSB 0 -#define FIFO_TIMEOUT_VALUE_MASK 'h000000ff -#define FIFO_TIMEOUT_VALUE_GET(x) (((x) & FIFO_TIMEOUT_VALUE_MASK) >> FIFO_TIMEOUT_VALUE_LSB) -#define FIFO_TIMEOUT_VALUE_SET(x) (((8'd0 | (x)) << FIFO_TIMEOUT_VALUE_LSB) & FIFO_TIMEOUT_VALUE_MASK) -#define FIFO_TIMEOUT_VALUE_RESET 8'hff -#define FIFO_TIMEOUT_RESET (8'h0 | \ - FIFO_TIMEOUT_VALUE_SET(FIFO_TIMEOUT_VALUE_RESET)) -#define FIFO_TIMEOUT_HW_MASK (8'h0) -#define FIFO_TIMEOUT_SW_MASK (8'h0 | \ - FIFO_TIMEOUT_VALUE_MASK) - -#define FIFO_TIMEOUT_ENABLE_ADDRESS 'h00000469 -#define FIFO_TIMEOUT_ENABLE_SET_MSB 0 -#define FIFO_TIMEOUT_ENABLE_SET_LSB 0 -#define FIFO_TIMEOUT_ENABLE_SET_MASK 'h00000001 -#define FIFO_TIMEOUT_ENABLE_SET_GET(x) (((x) & FIFO_TIMEOUT_ENABLE_SET_MASK) >> FIFO_TIMEOUT_ENABLE_SET_LSB) -#define FIFO_TIMEOUT_ENABLE_SET_SET(x) (((8'd0 | (x)) << FIFO_TIMEOUT_ENABLE_SET_LSB) & FIFO_TIMEOUT_ENABLE_SET_MASK) -#define FIFO_TIMEOUT_ENABLE_SET_RESET 1'h1 -#define FIFO_TIMEOUT_ENABLE_RESET (8'h0 | \ - FIFO_TIMEOUT_ENABLE_SET_SET(FIFO_TIMEOUT_ENABLE_SET_RESET)) -#define FIFO_TIMEOUT_ENABLE_HW_MASK (8'h0) -#define FIFO_TIMEOUT_ENABLE_SW_MASK (8'h0 | \ - FIFO_TIMEOUT_ENABLE_SET_MASK) - -#define DISABLE_SLEEP_ADDRESS 'h0000046a -#define DISABLE_SLEEP_FOR_INT_MSB 1 -#define DISABLE_SLEEP_FOR_INT_LSB 1 -#define DISABLE_SLEEP_FOR_INT_MASK 'h00000002 -#define DISABLE_SLEEP_FOR_INT_GET(x) (((x) & DISABLE_SLEEP_FOR_INT_MASK) >> DISABLE_SLEEP_FOR_INT_LSB) -#define DISABLE_SLEEP_FOR_INT_SET(x) (((8'd0 | (x)) << DISABLE_SLEEP_FOR_INT_LSB) & DISABLE_SLEEP_FOR_INT_MASK) -#define DISABLE_SLEEP_FOR_INT_RESET 1'h0 -#define DISABLE_SLEEP_ON_MSB 0 -#define DISABLE_SLEEP_ON_LSB 0 -#define DISABLE_SLEEP_ON_MASK 'h00000001 -#define DISABLE_SLEEP_ON_GET(x) (((x) & DISABLE_SLEEP_ON_MASK) >> DISABLE_SLEEP_ON_LSB) -#define DISABLE_SLEEP_ON_SET(x) (((8'd0 | (x)) << DISABLE_SLEEP_ON_LSB) & DISABLE_SLEEP_ON_MASK) -#define DISABLE_SLEEP_ON_RESET 1'h0 -#define DISABLE_SLEEP_RESET (8'h0 | \ - DISABLE_SLEEP_FOR_INT_SET(DISABLE_SLEEP_FOR_INT_RESET) | \ - DISABLE_SLEEP_ON_SET(DISABLE_SLEEP_ON_RESET)) -#define DISABLE_SLEEP_HW_MASK (8'h0) -#define DISABLE_SLEEP_SW_MASK (8'h0 | \ - DISABLE_SLEEP_FOR_INT_MASK | \ - DISABLE_SLEEP_ON_MASK) - -#define LOCAL_BUS_ADDRESS 'h00000470 -#define LOCAL_BUS_STATE_MSB 1 -#define LOCAL_BUS_STATE_LSB 0 -#define LOCAL_BUS_STATE_MASK 'h00000003 -#define LOCAL_BUS_STATE_GET(x) (((x) & LOCAL_BUS_STATE_MASK) >> LOCAL_BUS_STATE_LSB) -#define LOCAL_BUS_STATE_SET(x) (((8'd0 | (x)) << LOCAL_BUS_STATE_LSB) & LOCAL_BUS_STATE_MASK) -#define LOCAL_BUS_STATE_RESET 2'h0 -#define LOCAL_BUS_RESET (8'h0 | \ - LOCAL_BUS_STATE_SET(LOCAL_BUS_STATE_RESET)) -#define LOCAL_BUS_HW_MASK (8'h0 | \ - LOCAL_BUS_STATE_MASK) -#define LOCAL_BUS_SW_MASK (8'h0) - -#define INT_WLAN_ADDRESS 'h00000472 -#define INT_WLAN_VECTOR_MSB 7 -#define INT_WLAN_VECTOR_LSB 0 -#define INT_WLAN_VECTOR_MASK 'h000000ff -#define INT_WLAN_VECTOR_GET(x) (((x) & INT_WLAN_VECTOR_MASK) >> INT_WLAN_VECTOR_LSB) -#define INT_WLAN_VECTOR_SET(x) (((8'd0 | (x)) << INT_WLAN_VECTOR_LSB) & INT_WLAN_VECTOR_MASK) -#define INT_WLAN_VECTOR_RESET 8'h0 -#define INT_WLAN_RESET (8'h0 | \ - INT_WLAN_VECTOR_SET(INT_WLAN_VECTOR_RESET)) -#define INT_WLAN_HW_MASK (8'h0 | \ - INT_WLAN_VECTOR_MASK) -#define INT_WLAN_SW_MASK (8'h0 | \ - INT_WLAN_VECTOR_MASK) - -#define WINDOW_DATA_ADDRESS 'h00000474 -#define WINDOW_DATA_DATA_MSB 7 -#define WINDOW_DATA_DATA_LSB 0 -#define WINDOW_DATA_DATA_MASK 'h000000ff -#define WINDOW_DATA_DATA_GET(x) (((x) & WINDOW_DATA_DATA_MASK) >> WINDOW_DATA_DATA_LSB) -#define WINDOW_DATA_DATA_SET(x) (((8'd0 | (x)) << WINDOW_DATA_DATA_LSB) & WINDOW_DATA_DATA_MASK) -#define WINDOW_DATA_DATA_RESET 8'h0 -#define WINDOW_DATA_RESET (8'h0 | \ - WINDOW_DATA_DATA_SET(WINDOW_DATA_DATA_RESET)) -#define WINDOW_DATA_HW_MASK (8'h0 | \ - WINDOW_DATA_DATA_MASK) -#define WINDOW_DATA_SW_MASK (8'h0 | \ - WINDOW_DATA_DATA_MASK) - -#define WINDOW_WRITE_ADDR_ADDRESS 'h00000478 -#define WINDOW_WRITE_ADDR_ADDR_MSB 7 -#define WINDOW_WRITE_ADDR_ADDR_LSB 0 -#define WINDOW_WRITE_ADDR_ADDR_MASK 'h000000ff -#define WINDOW_WRITE_ADDR_ADDR_GET(x) (((x) & WINDOW_WRITE_ADDR_ADDR_MASK) >> WINDOW_WRITE_ADDR_ADDR_LSB) -#define WINDOW_WRITE_ADDR_ADDR_SET(x) (((8'd0 | (x)) << WINDOW_WRITE_ADDR_ADDR_LSB) & WINDOW_WRITE_ADDR_ADDR_MASK) -#define WINDOW_WRITE_ADDR_ADDR_RESET 8'h0 -#define WINDOW_WRITE_ADDR_RESET (8'h0 | \ - WINDOW_WRITE_ADDR_ADDR_SET(WINDOW_WRITE_ADDR_ADDR_RESET)) -#define WINDOW_WRITE_ADDR_HW_MASK (8'h0) -#define WINDOW_WRITE_ADDR_SW_MASK (8'h0 | \ - WINDOW_WRITE_ADDR_ADDR_MASK) - -#define WINDOW_READ_ADDR_ADDRESS 'h0000047c -#define WINDOW_READ_ADDR_ADDR_MSB 7 -#define WINDOW_READ_ADDR_ADDR_LSB 0 -#define WINDOW_READ_ADDR_ADDR_MASK 'h000000ff -#define WINDOW_READ_ADDR_ADDR_GET(x) (((x) & WINDOW_READ_ADDR_ADDR_MASK) >> WINDOW_READ_ADDR_ADDR_LSB) -#define WINDOW_READ_ADDR_ADDR_SET(x) (((8'd0 | (x)) << WINDOW_READ_ADDR_ADDR_LSB) & WINDOW_READ_ADDR_ADDR_MASK) -#define WINDOW_READ_ADDR_ADDR_RESET 8'h0 -#define WINDOW_READ_ADDR_RESET (8'h0 | \ - WINDOW_READ_ADDR_ADDR_SET(WINDOW_READ_ADDR_ADDR_RESET)) -#define WINDOW_READ_ADDR_HW_MASK (8'h0) -#define WINDOW_READ_ADDR_SW_MASK (8'h0 | \ - WINDOW_READ_ADDR_ADDR_MASK) - -#define SPI_CONFIG_ADDRESS 'h00000480 -#define SPI_CONFIG_SPI_RESET_MSB 4 -#define SPI_CONFIG_SPI_RESET_LSB 4 -#define SPI_CONFIG_SPI_RESET_MASK 'h00000010 -#define SPI_CONFIG_SPI_RESET_GET(x) (((x) & SPI_CONFIG_SPI_RESET_MASK) >> SPI_CONFIG_SPI_RESET_LSB) -#define SPI_CONFIG_SPI_RESET_SET(x) (((8'd0 | (x)) << SPI_CONFIG_SPI_RESET_LSB) & SPI_CONFIG_SPI_RESET_MASK) -#define SPI_CONFIG_SPI_RESET_RESET 1'h0 -#define SPI_CONFIG_INTERRUPT_ENABLE_MSB 3 -#define SPI_CONFIG_INTERRUPT_ENABLE_LSB 3 -#define SPI_CONFIG_INTERRUPT_ENABLE_MASK 'h00000008 -#define SPI_CONFIG_INTERRUPT_ENABLE_GET(x) (((x) & SPI_CONFIG_INTERRUPT_ENABLE_MASK) >> SPI_CONFIG_INTERRUPT_ENABLE_LSB) -#define SPI_CONFIG_INTERRUPT_ENABLE_SET(x) (((8'd0 | (x)) << SPI_CONFIG_INTERRUPT_ENABLE_LSB) & SPI_CONFIG_INTERRUPT_ENABLE_MASK) -#define SPI_CONFIG_INTERRUPT_ENABLE_RESET 1'h0 -#define SPI_CONFIG_TEST_MODE_MSB 2 -#define SPI_CONFIG_TEST_MODE_LSB 2 -#define SPI_CONFIG_TEST_MODE_MASK 'h00000004 -#define SPI_CONFIG_TEST_MODE_GET(x) (((x) & SPI_CONFIG_TEST_MODE_MASK) >> SPI_CONFIG_TEST_MODE_LSB) -#define SPI_CONFIG_TEST_MODE_SET(x) (((8'd0 | (x)) << SPI_CONFIG_TEST_MODE_LSB) & SPI_CONFIG_TEST_MODE_MASK) -#define SPI_CONFIG_TEST_MODE_RESET 1'h0 -#define SPI_CONFIG_DATA_SIZE_MSB 1 -#define SPI_CONFIG_DATA_SIZE_LSB 0 -#define SPI_CONFIG_DATA_SIZE_MASK 'h00000003 -#define SPI_CONFIG_DATA_SIZE_GET(x) (((x) & SPI_CONFIG_DATA_SIZE_MASK) >> SPI_CONFIG_DATA_SIZE_LSB) -#define SPI_CONFIG_DATA_SIZE_SET(x) (((8'd0 | (x)) << SPI_CONFIG_DATA_SIZE_LSB) & SPI_CONFIG_DATA_SIZE_MASK) -#define SPI_CONFIG_DATA_SIZE_RESET 2'h2 -#define SPI_CONFIG_RESET (8'h0 | \ - SPI_CONFIG_SPI_RESET_SET(SPI_CONFIG_SPI_RESET_RESET) | \ - SPI_CONFIG_INTERRUPT_ENABLE_SET(SPI_CONFIG_INTERRUPT_ENABLE_RESET) | \ - SPI_CONFIG_TEST_MODE_SET(SPI_CONFIG_TEST_MODE_RESET) | \ - SPI_CONFIG_DATA_SIZE_SET(SPI_CONFIG_DATA_SIZE_RESET)) -#define SPI_CONFIG_HW_MASK (8'h0) -#define SPI_CONFIG_SW_MASK (8'h0 | \ - SPI_CONFIG_SPI_RESET_MASK | \ - SPI_CONFIG_INTERRUPT_ENABLE_MASK | \ - SPI_CONFIG_TEST_MODE_MASK | \ - SPI_CONFIG_DATA_SIZE_MASK) - -#define SPI_STATUS_ADDRESS 'h00000481 -#define SPI_STATUS_ADDR_ERR_MSB 3 -#define SPI_STATUS_ADDR_ERR_LSB 3 -#define SPI_STATUS_ADDR_ERR_MASK 'h00000008 -#define SPI_STATUS_ADDR_ERR_GET(x) (((x) & SPI_STATUS_ADDR_ERR_MASK) >> SPI_STATUS_ADDR_ERR_LSB) -#define SPI_STATUS_ADDR_ERR_SET(x) (((8'd0 | (x)) << SPI_STATUS_ADDR_ERR_LSB) & SPI_STATUS_ADDR_ERR_MASK) -#define SPI_STATUS_ADDR_ERR_RESET 1'h0 -#define SPI_STATUS_RD_ERR_MSB 2 -#define SPI_STATUS_RD_ERR_LSB 2 -#define SPI_STATUS_RD_ERR_MASK 'h00000004 -#define SPI_STATUS_RD_ERR_GET(x) (((x) & SPI_STATUS_RD_ERR_MASK) >> SPI_STATUS_RD_ERR_LSB) -#define SPI_STATUS_RD_ERR_SET(x) (((8'd0 | (x)) << SPI_STATUS_RD_ERR_LSB) & SPI_STATUS_RD_ERR_MASK) -#define SPI_STATUS_RD_ERR_RESET 1'h0 -#define SPI_STATUS_WR_ERR_MSB 1 -#define SPI_STATUS_WR_ERR_LSB 1 -#define SPI_STATUS_WR_ERR_MASK 'h00000002 -#define SPI_STATUS_WR_ERR_GET(x) (((x) & SPI_STATUS_WR_ERR_MASK) >> SPI_STATUS_WR_ERR_LSB) -#define SPI_STATUS_WR_ERR_SET(x) (((8'd0 | (x)) << SPI_STATUS_WR_ERR_LSB) & SPI_STATUS_WR_ERR_MASK) -#define SPI_STATUS_WR_ERR_RESET 1'h0 -#define SPI_STATUS_READY_MSB 0 -#define SPI_STATUS_READY_LSB 0 -#define SPI_STATUS_READY_MASK 'h00000001 -#define SPI_STATUS_READY_GET(x) (((x) & SPI_STATUS_READY_MASK) >> SPI_STATUS_READY_LSB) -#define SPI_STATUS_READY_SET(x) (((8'd0 | (x)) << SPI_STATUS_READY_LSB) & SPI_STATUS_READY_MASK) -#define SPI_STATUS_READY_RESET 1'h1 -#define SPI_STATUS_RESET (8'h0 | \ - SPI_STATUS_ADDR_ERR_SET(SPI_STATUS_ADDR_ERR_RESET) | \ - SPI_STATUS_RD_ERR_SET(SPI_STATUS_RD_ERR_RESET) | \ - SPI_STATUS_WR_ERR_SET(SPI_STATUS_WR_ERR_RESET) | \ - SPI_STATUS_READY_SET(SPI_STATUS_READY_RESET)) -#define SPI_STATUS_HW_MASK (8'h0 | \ - SPI_STATUS_ADDR_ERR_MASK | \ - SPI_STATUS_RD_ERR_MASK | \ - SPI_STATUS_WR_ERR_MASK | \ - SPI_STATUS_READY_MASK) -#define SPI_STATUS_SW_MASK (8'h0 | \ - SPI_STATUS_ADDR_ERR_MASK | \ - SPI_STATUS_RD_ERR_MASK | \ - SPI_STATUS_WR_ERR_MASK) - -#define NON_ASSOC_SLEEP_EN_ADDRESS 'h00000482 -#define NON_ASSOC_SLEEP_EN_BIT_MSB 0 -#define NON_ASSOC_SLEEP_EN_BIT_LSB 0 -#define NON_ASSOC_SLEEP_EN_BIT_MASK 'h00000001 -#define NON_ASSOC_SLEEP_EN_BIT_GET(x) (((x) & NON_ASSOC_SLEEP_EN_BIT_MASK) >> NON_ASSOC_SLEEP_EN_BIT_LSB) -#define NON_ASSOC_SLEEP_EN_BIT_SET(x) (((8'd0 | (x)) << NON_ASSOC_SLEEP_EN_BIT_LSB) & NON_ASSOC_SLEEP_EN_BIT_MASK) -#define NON_ASSOC_SLEEP_EN_BIT_RESET 1'h0 -#define NON_ASSOC_SLEEP_EN_RESET (8'h0 | \ - NON_ASSOC_SLEEP_EN_BIT_SET(NON_ASSOC_SLEEP_EN_BIT_RESET)) -#define NON_ASSOC_SLEEP_EN_HW_MASK (8'h0) -#define NON_ASSOC_SLEEP_EN_SW_MASK (8'h0 | \ - NON_ASSOC_SLEEP_EN_BIT_MASK) - -#define CIS_WINDOW_ADDRESS 'h00000600 -#define CIS_WINDOW_DATA_MSB 7 -#define CIS_WINDOW_DATA_LSB 0 -#define CIS_WINDOW_DATA_MASK 'h000000ff -#define CIS_WINDOW_DATA_GET(x) (((x) & CIS_WINDOW_DATA_MASK) >> CIS_WINDOW_DATA_LSB) -#define CIS_WINDOW_DATA_SET(x) (((8'd0 | (x)) << CIS_WINDOW_DATA_LSB) & CIS_WINDOW_DATA_MASK) -#define CIS_WINDOW_DATA_RESET 8'h0 -#define CIS_WINDOW_RESET (8'h0 | \ - CIS_WINDOW_DATA_SET(CIS_WINDOW_DATA_RESET)) -#define CIS_WINDOW_HW_MASK (8'h0) -#define CIS_WINDOW_SW_MASK (8'h0 | \ - CIS_WINDOW_DATA_MASK) - -#define MBOX_HOST_REG_ADDRESS_MSB 10 - -#endif /* _MBOX_HOST_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_reg.h deleted file mode 100644 index 4e07d2286107..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_reg.h +++ /dev/null @@ -1,481 +0,0 @@ -#ifndef _MBOX_REG_REG_H_ -#define _MBOX_REG_REG_H_ - -#define MBOX_FIFO_ADDRESS 0x00000000 -#define MBOX_FIFO_OFFSET 0x00000000 -#define MBOX_FIFO_DATA_MSB 19 -#define MBOX_FIFO_DATA_LSB 0 -#define MBOX_FIFO_DATA_MASK 0x000fffff -#define MBOX_FIFO_DATA_GET(x) (((x) & MBOX_FIFO_DATA_MASK) >> MBOX_FIFO_DATA_LSB) -#define MBOX_FIFO_DATA_SET(x) (((x) << MBOX_FIFO_DATA_LSB) & MBOX_FIFO_DATA_MASK) - -#define MBOX_FIFO_STATUS_ADDRESS 0x00000010 -#define MBOX_FIFO_STATUS_OFFSET 0x00000010 -#define MBOX_FIFO_STATUS_EMPTY_MSB 19 -#define MBOX_FIFO_STATUS_EMPTY_LSB 16 -#define MBOX_FIFO_STATUS_EMPTY_MASK 0x000f0000 -#define MBOX_FIFO_STATUS_EMPTY_GET(x) (((x) & MBOX_FIFO_STATUS_EMPTY_MASK) >> MBOX_FIFO_STATUS_EMPTY_LSB) -#define MBOX_FIFO_STATUS_EMPTY_SET(x) (((x) << MBOX_FIFO_STATUS_EMPTY_LSB) & MBOX_FIFO_STATUS_EMPTY_MASK) -#define MBOX_FIFO_STATUS_FULL_MSB 15 -#define MBOX_FIFO_STATUS_FULL_LSB 12 -#define MBOX_FIFO_STATUS_FULL_MASK 0x0000f000 -#define MBOX_FIFO_STATUS_FULL_GET(x) (((x) & MBOX_FIFO_STATUS_FULL_MASK) >> MBOX_FIFO_STATUS_FULL_LSB) -#define MBOX_FIFO_STATUS_FULL_SET(x) (((x) << MBOX_FIFO_STATUS_FULL_LSB) & MBOX_FIFO_STATUS_FULL_MASK) - -#define MBOX_DMA_POLICY_ADDRESS 0x00000014 -#define MBOX_DMA_POLICY_OFFSET 0x00000014 -#define MBOX_DMA_POLICY_TX_QUANTUM_MSB 3 -#define MBOX_DMA_POLICY_TX_QUANTUM_LSB 3 -#define MBOX_DMA_POLICY_TX_QUANTUM_MASK 0x00000008 -#define MBOX_DMA_POLICY_TX_QUANTUM_GET(x) (((x) & MBOX_DMA_POLICY_TX_QUANTUM_MASK) >> MBOX_DMA_POLICY_TX_QUANTUM_LSB) -#define MBOX_DMA_POLICY_TX_QUANTUM_SET(x) (((x) << MBOX_DMA_POLICY_TX_QUANTUM_LSB) & MBOX_DMA_POLICY_TX_QUANTUM_MASK) -#define MBOX_DMA_POLICY_TX_ORDER_MSB 2 -#define MBOX_DMA_POLICY_TX_ORDER_LSB 2 -#define MBOX_DMA_POLICY_TX_ORDER_MASK 0x00000004 -#define MBOX_DMA_POLICY_TX_ORDER_GET(x) (((x) & MBOX_DMA_POLICY_TX_ORDER_MASK) >> MBOX_DMA_POLICY_TX_ORDER_LSB) -#define MBOX_DMA_POLICY_TX_ORDER_SET(x) (((x) << MBOX_DMA_POLICY_TX_ORDER_LSB) & MBOX_DMA_POLICY_TX_ORDER_MASK) -#define MBOX_DMA_POLICY_RX_QUANTUM_MSB 1 -#define MBOX_DMA_POLICY_RX_QUANTUM_LSB 1 -#define MBOX_DMA_POLICY_RX_QUANTUM_MASK 0x00000002 -#define MBOX_DMA_POLICY_RX_QUANTUM_GET(x) (((x) & MBOX_DMA_POLICY_RX_QUANTUM_MASK) >> MBOX_DMA_POLICY_RX_QUANTUM_LSB) -#define MBOX_DMA_POLICY_RX_QUANTUM_SET(x) (((x) << MBOX_DMA_POLICY_RX_QUANTUM_LSB) & MBOX_DMA_POLICY_RX_QUANTUM_MASK) -#define MBOX_DMA_POLICY_RX_ORDER_MSB 0 -#define MBOX_DMA_POLICY_RX_ORDER_LSB 0 -#define MBOX_DMA_POLICY_RX_ORDER_MASK 0x00000001 -#define MBOX_DMA_POLICY_RX_ORDER_GET(x) (((x) & MBOX_DMA_POLICY_RX_ORDER_MASK) >> MBOX_DMA_POLICY_RX_ORDER_LSB) -#define MBOX_DMA_POLICY_RX_ORDER_SET(x) (((x) << MBOX_DMA_POLICY_RX_ORDER_LSB) & MBOX_DMA_POLICY_RX_ORDER_MASK) - -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000018 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000018 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX0_DMA_RX_CONTROL_ADDRESS 0x0000001c -#define MBOX0_DMA_RX_CONTROL_OFFSET 0x0000001c -#define MBOX0_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX0_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX0_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX0_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_RESUME_MASK) >> MBOX0_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX0_DMA_RX_CONTROL_RESUME_SET(x) (((x) << MBOX0_DMA_RX_CONTROL_RESUME_LSB) & MBOX0_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX0_DMA_RX_CONTROL_START_MSB 1 -#define MBOX0_DMA_RX_CONTROL_START_LSB 1 -#define MBOX0_DMA_RX_CONTROL_START_MASK 0x00000002 -#define MBOX0_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_START_MASK) >> MBOX0_DMA_RX_CONTROL_START_LSB) -#define MBOX0_DMA_RX_CONTROL_START_SET(x) (((x) << MBOX0_DMA_RX_CONTROL_START_LSB) & MBOX0_DMA_RX_CONTROL_START_MASK) -#define MBOX0_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX0_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX0_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define MBOX0_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_STOP_MASK) >> MBOX0_DMA_RX_CONTROL_STOP_LSB) -#define MBOX0_DMA_RX_CONTROL_STOP_SET(x) (((x) << MBOX0_DMA_RX_CONTROL_STOP_LSB) & MBOX0_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000020 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000020 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX0_DMA_TX_CONTROL_ADDRESS 0x00000024 -#define MBOX0_DMA_TX_CONTROL_OFFSET 0x00000024 -#define MBOX0_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX0_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX0_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX0_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_RESUME_MASK) >> MBOX0_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX0_DMA_TX_CONTROL_RESUME_SET(x) (((x) << MBOX0_DMA_TX_CONTROL_RESUME_LSB) & MBOX0_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX0_DMA_TX_CONTROL_START_MSB 1 -#define MBOX0_DMA_TX_CONTROL_START_LSB 1 -#define MBOX0_DMA_TX_CONTROL_START_MASK 0x00000002 -#define MBOX0_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_START_MASK) >> MBOX0_DMA_TX_CONTROL_START_LSB) -#define MBOX0_DMA_TX_CONTROL_START_SET(x) (((x) << MBOX0_DMA_TX_CONTROL_START_LSB) & MBOX0_DMA_TX_CONTROL_START_MASK) -#define MBOX0_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX0_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX0_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define MBOX0_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_STOP_MASK) >> MBOX0_DMA_TX_CONTROL_STOP_LSB) -#define MBOX0_DMA_TX_CONTROL_STOP_SET(x) (((x) << MBOX0_DMA_TX_CONTROL_STOP_LSB) & MBOX0_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000028 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000028 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX1_DMA_RX_CONTROL_ADDRESS 0x0000002c -#define MBOX1_DMA_RX_CONTROL_OFFSET 0x0000002c -#define MBOX1_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX1_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX1_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX1_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX1_DMA_RX_CONTROL_RESUME_MASK) >> MBOX1_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX1_DMA_RX_CONTROL_RESUME_SET(x) (((x) << MBOX1_DMA_RX_CONTROL_RESUME_LSB) & MBOX1_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX1_DMA_RX_CONTROL_START_MSB 1 -#define MBOX1_DMA_RX_CONTROL_START_LSB 1 -#define MBOX1_DMA_RX_CONTROL_START_MASK 0x00000002 -#define MBOX1_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX1_DMA_RX_CONTROL_START_MASK) >> MBOX1_DMA_RX_CONTROL_START_LSB) -#define MBOX1_DMA_RX_CONTROL_START_SET(x) (((x) << MBOX1_DMA_RX_CONTROL_START_LSB) & MBOX1_DMA_RX_CONTROL_START_MASK) -#define MBOX1_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX1_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX1_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define MBOX1_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX1_DMA_RX_CONTROL_STOP_MASK) >> MBOX1_DMA_RX_CONTROL_STOP_LSB) -#define MBOX1_DMA_RX_CONTROL_STOP_SET(x) (((x) << MBOX1_DMA_RX_CONTROL_STOP_LSB) & MBOX1_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000030 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000030 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX1_DMA_TX_CONTROL_ADDRESS 0x00000034 -#define MBOX1_DMA_TX_CONTROL_OFFSET 0x00000034 -#define MBOX1_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX1_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX1_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX1_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX1_DMA_TX_CONTROL_RESUME_MASK) >> MBOX1_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX1_DMA_TX_CONTROL_RESUME_SET(x) (((x) << MBOX1_DMA_TX_CONTROL_RESUME_LSB) & MBOX1_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX1_DMA_TX_CONTROL_START_MSB 1 -#define MBOX1_DMA_TX_CONTROL_START_LSB 1 -#define MBOX1_DMA_TX_CONTROL_START_MASK 0x00000002 -#define MBOX1_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX1_DMA_TX_CONTROL_START_MASK) >> MBOX1_DMA_TX_CONTROL_START_LSB) -#define MBOX1_DMA_TX_CONTROL_START_SET(x) (((x) << MBOX1_DMA_TX_CONTROL_START_LSB) & MBOX1_DMA_TX_CONTROL_START_MASK) -#define MBOX1_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX1_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX1_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define MBOX1_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX1_DMA_TX_CONTROL_STOP_MASK) >> MBOX1_DMA_TX_CONTROL_STOP_LSB) -#define MBOX1_DMA_TX_CONTROL_STOP_SET(x) (((x) << MBOX1_DMA_TX_CONTROL_STOP_LSB) & MBOX1_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000038 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000038 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX2_DMA_RX_CONTROL_ADDRESS 0x0000003c -#define MBOX2_DMA_RX_CONTROL_OFFSET 0x0000003c -#define MBOX2_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX2_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX2_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX2_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX2_DMA_RX_CONTROL_RESUME_MASK) >> MBOX2_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX2_DMA_RX_CONTROL_RESUME_SET(x) (((x) << MBOX2_DMA_RX_CONTROL_RESUME_LSB) & MBOX2_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX2_DMA_RX_CONTROL_START_MSB 1 -#define MBOX2_DMA_RX_CONTROL_START_LSB 1 -#define MBOX2_DMA_RX_CONTROL_START_MASK 0x00000002 -#define MBOX2_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX2_DMA_RX_CONTROL_START_MASK) >> MBOX2_DMA_RX_CONTROL_START_LSB) -#define MBOX2_DMA_RX_CONTROL_START_SET(x) (((x) << MBOX2_DMA_RX_CONTROL_START_LSB) & MBOX2_DMA_RX_CONTROL_START_MASK) -#define MBOX2_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX2_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX2_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define MBOX2_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX2_DMA_RX_CONTROL_STOP_MASK) >> MBOX2_DMA_RX_CONTROL_STOP_LSB) -#define MBOX2_DMA_RX_CONTROL_STOP_SET(x) (((x) << MBOX2_DMA_RX_CONTROL_STOP_LSB) & MBOX2_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000040 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000040 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX2_DMA_TX_CONTROL_ADDRESS 0x00000044 -#define MBOX2_DMA_TX_CONTROL_OFFSET 0x00000044 -#define MBOX2_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX2_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX2_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX2_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX2_DMA_TX_CONTROL_RESUME_MASK) >> MBOX2_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX2_DMA_TX_CONTROL_RESUME_SET(x) (((x) << MBOX2_DMA_TX_CONTROL_RESUME_LSB) & MBOX2_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX2_DMA_TX_CONTROL_START_MSB 1 -#define MBOX2_DMA_TX_CONTROL_START_LSB 1 -#define MBOX2_DMA_TX_CONTROL_START_MASK 0x00000002 -#define MBOX2_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX2_DMA_TX_CONTROL_START_MASK) >> MBOX2_DMA_TX_CONTROL_START_LSB) -#define MBOX2_DMA_TX_CONTROL_START_SET(x) (((x) << MBOX2_DMA_TX_CONTROL_START_LSB) & MBOX2_DMA_TX_CONTROL_START_MASK) -#define MBOX2_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX2_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX2_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define MBOX2_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX2_DMA_TX_CONTROL_STOP_MASK) >> MBOX2_DMA_TX_CONTROL_STOP_LSB) -#define MBOX2_DMA_TX_CONTROL_STOP_SET(x) (((x) << MBOX2_DMA_TX_CONTROL_STOP_LSB) & MBOX2_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000048 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000048 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX3_DMA_RX_CONTROL_ADDRESS 0x0000004c -#define MBOX3_DMA_RX_CONTROL_OFFSET 0x0000004c -#define MBOX3_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX3_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX3_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX3_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX3_DMA_RX_CONTROL_RESUME_MASK) >> MBOX3_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX3_DMA_RX_CONTROL_RESUME_SET(x) (((x) << MBOX3_DMA_RX_CONTROL_RESUME_LSB) & MBOX3_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX3_DMA_RX_CONTROL_START_MSB 1 -#define MBOX3_DMA_RX_CONTROL_START_LSB 1 -#define MBOX3_DMA_RX_CONTROL_START_MASK 0x00000002 -#define MBOX3_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX3_DMA_RX_CONTROL_START_MASK) >> MBOX3_DMA_RX_CONTROL_START_LSB) -#define MBOX3_DMA_RX_CONTROL_START_SET(x) (((x) << MBOX3_DMA_RX_CONTROL_START_LSB) & MBOX3_DMA_RX_CONTROL_START_MASK) -#define MBOX3_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX3_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX3_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define MBOX3_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX3_DMA_RX_CONTROL_STOP_MASK) >> MBOX3_DMA_RX_CONTROL_STOP_LSB) -#define MBOX3_DMA_RX_CONTROL_STOP_SET(x) (((x) << MBOX3_DMA_RX_CONTROL_STOP_LSB) & MBOX3_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000050 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000050 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX3_DMA_TX_CONTROL_ADDRESS 0x00000054 -#define MBOX3_DMA_TX_CONTROL_OFFSET 0x00000054 -#define MBOX3_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX3_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX3_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX3_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX3_DMA_TX_CONTROL_RESUME_MASK) >> MBOX3_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX3_DMA_TX_CONTROL_RESUME_SET(x) (((x) << MBOX3_DMA_TX_CONTROL_RESUME_LSB) & MBOX3_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX3_DMA_TX_CONTROL_START_MSB 1 -#define MBOX3_DMA_TX_CONTROL_START_LSB 1 -#define MBOX3_DMA_TX_CONTROL_START_MASK 0x00000002 -#define MBOX3_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX3_DMA_TX_CONTROL_START_MASK) >> MBOX3_DMA_TX_CONTROL_START_LSB) -#define MBOX3_DMA_TX_CONTROL_START_SET(x) (((x) << MBOX3_DMA_TX_CONTROL_START_LSB) & MBOX3_DMA_TX_CONTROL_START_MASK) -#define MBOX3_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX3_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX3_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define MBOX3_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX3_DMA_TX_CONTROL_STOP_MASK) >> MBOX3_DMA_TX_CONTROL_STOP_LSB) -#define MBOX3_DMA_TX_CONTROL_STOP_SET(x) (((x) << MBOX3_DMA_TX_CONTROL_STOP_LSB) & MBOX3_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX_INT_STATUS_ADDRESS 0x00000058 -#define MBOX_INT_STATUS_OFFSET 0x00000058 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MSB 31 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB 28 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK 0xf0000000 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) >> MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) & MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB 27 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB 24 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK 0x0f000000 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) >> MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) (((x) << MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) & MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MSB 23 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB 20 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK 0x00f00000 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) >> MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) & MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) -#define MBOX_INT_STATUS_TX_OVERFLOW_MSB 17 -#define MBOX_INT_STATUS_TX_OVERFLOW_LSB 17 -#define MBOX_INT_STATUS_TX_OVERFLOW_MASK 0x00020000 -#define MBOX_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & MBOX_INT_STATUS_TX_OVERFLOW_MASK) >> MBOX_INT_STATUS_TX_OVERFLOW_LSB) -#define MBOX_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << MBOX_INT_STATUS_TX_OVERFLOW_LSB) & MBOX_INT_STATUS_TX_OVERFLOW_MASK) -#define MBOX_INT_STATUS_RX_UNDERFLOW_MSB 16 -#define MBOX_INT_STATUS_RX_UNDERFLOW_LSB 16 -#define MBOX_INT_STATUS_RX_UNDERFLOW_MASK 0x00010000 -#define MBOX_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & MBOX_INT_STATUS_RX_UNDERFLOW_MASK) >> MBOX_INT_STATUS_RX_UNDERFLOW_LSB) -#define MBOX_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << MBOX_INT_STATUS_RX_UNDERFLOW_LSB) & MBOX_INT_STATUS_RX_UNDERFLOW_MASK) -#define MBOX_INT_STATUS_TX_NOT_EMPTY_MSB 15 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_LSB 12 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_MASK 0x0000f000 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) (((x) & MBOX_INT_STATUS_TX_NOT_EMPTY_MASK) >> MBOX_INT_STATUS_TX_NOT_EMPTY_LSB) -#define MBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) (((x) << MBOX_INT_STATUS_TX_NOT_EMPTY_LSB) & MBOX_INT_STATUS_TX_NOT_EMPTY_MASK) -#define MBOX_INT_STATUS_RX_NOT_FULL_MSB 11 -#define MBOX_INT_STATUS_RX_NOT_FULL_LSB 8 -#define MBOX_INT_STATUS_RX_NOT_FULL_MASK 0x00000f00 -#define MBOX_INT_STATUS_RX_NOT_FULL_GET(x) (((x) & MBOX_INT_STATUS_RX_NOT_FULL_MASK) >> MBOX_INT_STATUS_RX_NOT_FULL_LSB) -#define MBOX_INT_STATUS_RX_NOT_FULL_SET(x) (((x) << MBOX_INT_STATUS_RX_NOT_FULL_LSB) & MBOX_INT_STATUS_RX_NOT_FULL_MASK) -#define MBOX_INT_STATUS_HOST_MSB 7 -#define MBOX_INT_STATUS_HOST_LSB 0 -#define MBOX_INT_STATUS_HOST_MASK 0x000000ff -#define MBOX_INT_STATUS_HOST_GET(x) (((x) & MBOX_INT_STATUS_HOST_MASK) >> MBOX_INT_STATUS_HOST_LSB) -#define MBOX_INT_STATUS_HOST_SET(x) (((x) << MBOX_INT_STATUS_HOST_LSB) & MBOX_INT_STATUS_HOST_MASK) - -#define MBOX_INT_ENABLE_ADDRESS 0x0000005c -#define MBOX_INT_ENABLE_OFFSET 0x0000005c -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB 31 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB 28 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK 0xf0000000 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) >> MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) & MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB 27 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB 24 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK 0x0f000000 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) >> MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) (((x) << MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) & MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB 23 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB 20 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK 0x00f00000 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) >> MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) & MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) -#define MBOX_INT_ENABLE_TX_OVERFLOW_MSB 17 -#define MBOX_INT_ENABLE_TX_OVERFLOW_LSB 17 -#define MBOX_INT_ENABLE_TX_OVERFLOW_MASK 0x00020000 -#define MBOX_INT_ENABLE_TX_OVERFLOW_GET(x) (((x) & MBOX_INT_ENABLE_TX_OVERFLOW_MASK) >> MBOX_INT_ENABLE_TX_OVERFLOW_LSB) -#define MBOX_INT_ENABLE_TX_OVERFLOW_SET(x) (((x) << MBOX_INT_ENABLE_TX_OVERFLOW_LSB) & MBOX_INT_ENABLE_TX_OVERFLOW_MASK) -#define MBOX_INT_ENABLE_RX_UNDERFLOW_MSB 16 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_LSB 16 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_MASK 0x00010000 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) (((x) & MBOX_INT_ENABLE_RX_UNDERFLOW_MASK) >> MBOX_INT_ENABLE_RX_UNDERFLOW_LSB) -#define MBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) (((x) << MBOX_INT_ENABLE_RX_UNDERFLOW_LSB) & MBOX_INT_ENABLE_RX_UNDERFLOW_MASK) -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MSB 15 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB 12 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK 0x0000f000 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) (((x) & MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) >> MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) (((x) << MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) & MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) -#define MBOX_INT_ENABLE_RX_NOT_FULL_MSB 11 -#define MBOX_INT_ENABLE_RX_NOT_FULL_LSB 8 -#define MBOX_INT_ENABLE_RX_NOT_FULL_MASK 0x00000f00 -#define MBOX_INT_ENABLE_RX_NOT_FULL_GET(x) (((x) & MBOX_INT_ENABLE_RX_NOT_FULL_MASK) >> MBOX_INT_ENABLE_RX_NOT_FULL_LSB) -#define MBOX_INT_ENABLE_RX_NOT_FULL_SET(x) (((x) << MBOX_INT_ENABLE_RX_NOT_FULL_LSB) & MBOX_INT_ENABLE_RX_NOT_FULL_MASK) -#define MBOX_INT_ENABLE_HOST_MSB 7 -#define MBOX_INT_ENABLE_HOST_LSB 0 -#define MBOX_INT_ENABLE_HOST_MASK 0x000000ff -#define MBOX_INT_ENABLE_HOST_GET(x) (((x) & MBOX_INT_ENABLE_HOST_MASK) >> MBOX_INT_ENABLE_HOST_LSB) -#define MBOX_INT_ENABLE_HOST_SET(x) (((x) << MBOX_INT_ENABLE_HOST_LSB) & MBOX_INT_ENABLE_HOST_MASK) - -#define INT_HOST_ADDRESS 0x00000060 -#define INT_HOST_OFFSET 0x00000060 -#define INT_HOST_VECTOR_MSB 7 -#define INT_HOST_VECTOR_LSB 0 -#define INT_HOST_VECTOR_MASK 0x000000ff -#define INT_HOST_VECTOR_GET(x) (((x) & INT_HOST_VECTOR_MASK) >> INT_HOST_VECTOR_LSB) -#define INT_HOST_VECTOR_SET(x) (((x) << INT_HOST_VECTOR_LSB) & INT_HOST_VECTOR_MASK) - -#define LOCAL_COUNT_ADDRESS 0x00000080 -#define LOCAL_COUNT_OFFSET 0x00000080 -#define LOCAL_COUNT_VALUE_MSB 7 -#define LOCAL_COUNT_VALUE_LSB 0 -#define LOCAL_COUNT_VALUE_MASK 0x000000ff -#define LOCAL_COUNT_VALUE_GET(x) (((x) & LOCAL_COUNT_VALUE_MASK) >> LOCAL_COUNT_VALUE_LSB) -#define LOCAL_COUNT_VALUE_SET(x) (((x) << LOCAL_COUNT_VALUE_LSB) & LOCAL_COUNT_VALUE_MASK) - -#define COUNT_INC_ADDRESS 0x000000a0 -#define COUNT_INC_OFFSET 0x000000a0 -#define COUNT_INC_VALUE_MSB 7 -#define COUNT_INC_VALUE_LSB 0 -#define COUNT_INC_VALUE_MASK 0x000000ff -#define COUNT_INC_VALUE_GET(x) (((x) & COUNT_INC_VALUE_MASK) >> COUNT_INC_VALUE_LSB) -#define COUNT_INC_VALUE_SET(x) (((x) << COUNT_INC_VALUE_LSB) & COUNT_INC_VALUE_MASK) - -#define LOCAL_SCRATCH_ADDRESS 0x000000c0 -#define LOCAL_SCRATCH_OFFSET 0x000000c0 -#define LOCAL_SCRATCH_VALUE_MSB 7 -#define LOCAL_SCRATCH_VALUE_LSB 0 -#define LOCAL_SCRATCH_VALUE_MASK 0x000000ff -#define LOCAL_SCRATCH_VALUE_GET(x) (((x) & LOCAL_SCRATCH_VALUE_MASK) >> LOCAL_SCRATCH_VALUE_LSB) -#define LOCAL_SCRATCH_VALUE_SET(x) (((x) << LOCAL_SCRATCH_VALUE_LSB) & LOCAL_SCRATCH_VALUE_MASK) - -#define USE_LOCAL_BUS_ADDRESS 0x000000e0 -#define USE_LOCAL_BUS_OFFSET 0x000000e0 -#define USE_LOCAL_BUS_PIN_INIT_MSB 0 -#define USE_LOCAL_BUS_PIN_INIT_LSB 0 -#define USE_LOCAL_BUS_PIN_INIT_MASK 0x00000001 -#define USE_LOCAL_BUS_PIN_INIT_GET(x) (((x) & USE_LOCAL_BUS_PIN_INIT_MASK) >> USE_LOCAL_BUS_PIN_INIT_LSB) -#define USE_LOCAL_BUS_PIN_INIT_SET(x) (((x) << USE_LOCAL_BUS_PIN_INIT_LSB) & USE_LOCAL_BUS_PIN_INIT_MASK) - -#define SDIO_CONFIG_ADDRESS 0x000000e4 -#define SDIO_CONFIG_OFFSET 0x000000e4 -#define SDIO_CONFIG_CCCR_IOR1_MSB 0 -#define SDIO_CONFIG_CCCR_IOR1_LSB 0 -#define SDIO_CONFIG_CCCR_IOR1_MASK 0x00000001 -#define SDIO_CONFIG_CCCR_IOR1_GET(x) (((x) & SDIO_CONFIG_CCCR_IOR1_MASK) >> SDIO_CONFIG_CCCR_IOR1_LSB) -#define SDIO_CONFIG_CCCR_IOR1_SET(x) (((x) << SDIO_CONFIG_CCCR_IOR1_LSB) & SDIO_CONFIG_CCCR_IOR1_MASK) - -#define MBOX_DEBUG_ADDRESS 0x000000e8 -#define MBOX_DEBUG_OFFSET 0x000000e8 -#define MBOX_DEBUG_SEL_MSB 2 -#define MBOX_DEBUG_SEL_LSB 0 -#define MBOX_DEBUG_SEL_MASK 0x00000007 -#define MBOX_DEBUG_SEL_GET(x) (((x) & MBOX_DEBUG_SEL_MASK) >> MBOX_DEBUG_SEL_LSB) -#define MBOX_DEBUG_SEL_SET(x) (((x) << MBOX_DEBUG_SEL_LSB) & MBOX_DEBUG_SEL_MASK) - -#define MBOX_FIFO_RESET_ADDRESS 0x000000ec -#define MBOX_FIFO_RESET_OFFSET 0x000000ec -#define MBOX_FIFO_RESET_INIT_MSB 0 -#define MBOX_FIFO_RESET_INIT_LSB 0 -#define MBOX_FIFO_RESET_INIT_MASK 0x00000001 -#define MBOX_FIFO_RESET_INIT_GET(x) (((x) & MBOX_FIFO_RESET_INIT_MASK) >> MBOX_FIFO_RESET_INIT_LSB) -#define MBOX_FIFO_RESET_INIT_SET(x) (((x) << MBOX_FIFO_RESET_INIT_LSB) & MBOX_FIFO_RESET_INIT_MASK) - -#define MBOX_TXFIFO_POP_ADDRESS 0x000000f0 -#define MBOX_TXFIFO_POP_OFFSET 0x000000f0 -#define MBOX_TXFIFO_POP_DATA_MSB 0 -#define MBOX_TXFIFO_POP_DATA_LSB 0 -#define MBOX_TXFIFO_POP_DATA_MASK 0x00000001 -#define MBOX_TXFIFO_POP_DATA_GET(x) (((x) & MBOX_TXFIFO_POP_DATA_MASK) >> MBOX_TXFIFO_POP_DATA_LSB) -#define MBOX_TXFIFO_POP_DATA_SET(x) (((x) << MBOX_TXFIFO_POP_DATA_LSB) & MBOX_TXFIFO_POP_DATA_MASK) - -#define MBOX_RXFIFO_POP_ADDRESS 0x00000100 -#define MBOX_RXFIFO_POP_OFFSET 0x00000100 -#define MBOX_RXFIFO_POP_DATA_MSB 0 -#define MBOX_RXFIFO_POP_DATA_LSB 0 -#define MBOX_RXFIFO_POP_DATA_MASK 0x00000001 -#define MBOX_RXFIFO_POP_DATA_GET(x) (((x) & MBOX_RXFIFO_POP_DATA_MASK) >> MBOX_RXFIFO_POP_DATA_LSB) -#define MBOX_RXFIFO_POP_DATA_SET(x) (((x) << MBOX_RXFIFO_POP_DATA_LSB) & MBOX_RXFIFO_POP_DATA_MASK) - -#define SDIO_DEBUG_ADDRESS 0x00000110 -#define SDIO_DEBUG_OFFSET 0x00000110 -#define SDIO_DEBUG_SEL_MSB 3 -#define SDIO_DEBUG_SEL_LSB 0 -#define SDIO_DEBUG_SEL_MASK 0x0000000f -#define SDIO_DEBUG_SEL_GET(x) (((x) & SDIO_DEBUG_SEL_MASK) >> SDIO_DEBUG_SEL_LSB) -#define SDIO_DEBUG_SEL_SET(x) (((x) << SDIO_DEBUG_SEL_LSB) & SDIO_DEBUG_SEL_MASK) - -#define HOST_IF_WINDOW_ADDRESS 0x00002000 -#define HOST_IF_WINDOW_OFFSET 0x00002000 -#define HOST_IF_WINDOW_DATA_MSB 7 -#define HOST_IF_WINDOW_DATA_LSB 0 -#define HOST_IF_WINDOW_DATA_MASK 0x000000ff -#define HOST_IF_WINDOW_DATA_GET(x) (((x) & HOST_IF_WINDOW_DATA_MASK) >> HOST_IF_WINDOW_DATA_LSB) -#define HOST_IF_WINDOW_DATA_SET(x) (((x) << HOST_IF_WINDOW_DATA_LSB) & HOST_IF_WINDOW_DATA_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct mbox_reg_reg_s { - volatile unsigned int mbox_fifo[4]; - volatile unsigned int mbox_fifo_status; - volatile unsigned int mbox_dma_policy; - volatile unsigned int mbox0_dma_rx_descriptor_base; - volatile unsigned int mbox0_dma_rx_control; - volatile unsigned int mbox0_dma_tx_descriptor_base; - volatile unsigned int mbox0_dma_tx_control; - volatile unsigned int mbox1_dma_rx_descriptor_base; - volatile unsigned int mbox1_dma_rx_control; - volatile unsigned int mbox1_dma_tx_descriptor_base; - volatile unsigned int mbox1_dma_tx_control; - volatile unsigned int mbox2_dma_rx_descriptor_base; - volatile unsigned int mbox2_dma_rx_control; - volatile unsigned int mbox2_dma_tx_descriptor_base; - volatile unsigned int mbox2_dma_tx_control; - volatile unsigned int mbox3_dma_rx_descriptor_base; - volatile unsigned int mbox3_dma_rx_control; - volatile unsigned int mbox3_dma_tx_descriptor_base; - volatile unsigned int mbox3_dma_tx_control; - volatile unsigned int mbox_int_status; - volatile unsigned int mbox_int_enable; - volatile unsigned int int_host; - unsigned char pad0[28]; /* pad to 0x80 */ - volatile unsigned int local_count[8]; - volatile unsigned int count_inc[8]; - volatile unsigned int local_scratch[8]; - volatile unsigned int use_local_bus; - volatile unsigned int sdio_config; - volatile unsigned int mbox_debug; - volatile unsigned int mbox_fifo_reset; - volatile unsigned int mbox_txfifo_pop[4]; - volatile unsigned int mbox_rxfifo_pop[4]; - volatile unsigned int sdio_debug; - unsigned char pad1[7916]; /* pad to 0x2000 */ - volatile unsigned int host_if_window[2048]; -} mbox_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _MBOX_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_reg.vrh deleted file mode 100644 index a6d23e84b9a4..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/mbox_reg.vrh +++ /dev/null @@ -1,746 +0,0 @@ -#ifndef _MBOX_REG_VRH_ -#define _MBOX_REG_VRH_ - -#define MBOX_FIFO_ADDRESS 'h00000000 -#define MBOX_FIFO_DATA_MSB 19 -#define MBOX_FIFO_DATA_LSB 0 -#define MBOX_FIFO_DATA_MASK 'h000fffff -#define MBOX_FIFO_DATA_GET(x) (((x) & MBOX_FIFO_DATA_MASK) >> MBOX_FIFO_DATA_LSB) -#define MBOX_FIFO_DATA_SET(x) (((32'd0 | (x)) << MBOX_FIFO_DATA_LSB) & MBOX_FIFO_DATA_MASK) -#define MBOX_FIFO_DATA_RESET 20'h0 -#define MBOX_FIFO_RESET (32'h0 | \ - MBOX_FIFO_DATA_SET(MBOX_FIFO_DATA_RESET)) -#define MBOX_FIFO_HW_MASK (32'h0 | \ - MBOX_FIFO_DATA_MASK) -#define MBOX_FIFO_SW_MASK (32'h0 | \ - MBOX_FIFO_DATA_MASK) - -#define MBOX_FIFO_STATUS_ADDRESS 'h00000010 -#define MBOX_FIFO_STATUS_EMPTY_MSB 19 -#define MBOX_FIFO_STATUS_EMPTY_LSB 16 -#define MBOX_FIFO_STATUS_EMPTY_MASK 'h000f0000 -#define MBOX_FIFO_STATUS_EMPTY_GET(x) (((x) & MBOX_FIFO_STATUS_EMPTY_MASK) >> MBOX_FIFO_STATUS_EMPTY_LSB) -#define MBOX_FIFO_STATUS_EMPTY_SET(x) (((32'd0 | (x)) << MBOX_FIFO_STATUS_EMPTY_LSB) & MBOX_FIFO_STATUS_EMPTY_MASK) -#define MBOX_FIFO_STATUS_EMPTY_RESET 4'hf -#define MBOX_FIFO_STATUS_FULL_MSB 15 -#define MBOX_FIFO_STATUS_FULL_LSB 12 -#define MBOX_FIFO_STATUS_FULL_MASK 'h0000f000 -#define MBOX_FIFO_STATUS_FULL_GET(x) (((x) & MBOX_FIFO_STATUS_FULL_MASK) >> MBOX_FIFO_STATUS_FULL_LSB) -#define MBOX_FIFO_STATUS_FULL_SET(x) (((32'd0 | (x)) << MBOX_FIFO_STATUS_FULL_LSB) & MBOX_FIFO_STATUS_FULL_MASK) -#define MBOX_FIFO_STATUS_FULL_RESET 4'h0 -#define MBOX_FIFO_STATUS_RESET (32'h0 | \ - MBOX_FIFO_STATUS_EMPTY_SET(MBOX_FIFO_STATUS_EMPTY_RESET) | \ - MBOX_FIFO_STATUS_FULL_SET(MBOX_FIFO_STATUS_FULL_RESET)) -#define MBOX_FIFO_STATUS_HW_MASK (32'h0 | \ - MBOX_FIFO_STATUS_EMPTY_MASK | \ - MBOX_FIFO_STATUS_FULL_MASK) -#define MBOX_FIFO_STATUS_SW_MASK (32'h0) - -#define MBOX_DMA_POLICY_ADDRESS 'h00000014 -#define MBOX_DMA_POLICY_TX_QUANTUM_MSB 3 -#define MBOX_DMA_POLICY_TX_QUANTUM_LSB 3 -#define MBOX_DMA_POLICY_TX_QUANTUM_MASK 'h00000008 -#define MBOX_DMA_POLICY_TX_QUANTUM_GET(x) (((x) & MBOX_DMA_POLICY_TX_QUANTUM_MASK) >> MBOX_DMA_POLICY_TX_QUANTUM_LSB) -#define MBOX_DMA_POLICY_TX_QUANTUM_SET(x) (((32'd0 | (x)) << MBOX_DMA_POLICY_TX_QUANTUM_LSB) & MBOX_DMA_POLICY_TX_QUANTUM_MASK) -#define MBOX_DMA_POLICY_TX_QUANTUM_RESET 1'h0 -#define MBOX_DMA_POLICY_TX_ORDER_MSB 2 -#define MBOX_DMA_POLICY_TX_ORDER_LSB 2 -#define MBOX_DMA_POLICY_TX_ORDER_MASK 'h00000004 -#define MBOX_DMA_POLICY_TX_ORDER_GET(x) (((x) & MBOX_DMA_POLICY_TX_ORDER_MASK) >> MBOX_DMA_POLICY_TX_ORDER_LSB) -#define MBOX_DMA_POLICY_TX_ORDER_SET(x) (((32'd0 | (x)) << MBOX_DMA_POLICY_TX_ORDER_LSB) & MBOX_DMA_POLICY_TX_ORDER_MASK) -#define MBOX_DMA_POLICY_TX_ORDER_RESET 1'h0 -#define MBOX_DMA_POLICY_RX_QUANTUM_MSB 1 -#define MBOX_DMA_POLICY_RX_QUANTUM_LSB 1 -#define MBOX_DMA_POLICY_RX_QUANTUM_MASK 'h00000002 -#define MBOX_DMA_POLICY_RX_QUANTUM_GET(x) (((x) & MBOX_DMA_POLICY_RX_QUANTUM_MASK) >> MBOX_DMA_POLICY_RX_QUANTUM_LSB) -#define MBOX_DMA_POLICY_RX_QUANTUM_SET(x) (((32'd0 | (x)) << MBOX_DMA_POLICY_RX_QUANTUM_LSB) & MBOX_DMA_POLICY_RX_QUANTUM_MASK) -#define MBOX_DMA_POLICY_RX_QUANTUM_RESET 1'h0 -#define MBOX_DMA_POLICY_RX_ORDER_MSB 0 -#define MBOX_DMA_POLICY_RX_ORDER_LSB 0 -#define MBOX_DMA_POLICY_RX_ORDER_MASK 'h00000001 -#define MBOX_DMA_POLICY_RX_ORDER_GET(x) (((x) & MBOX_DMA_POLICY_RX_ORDER_MASK) >> MBOX_DMA_POLICY_RX_ORDER_LSB) -#define MBOX_DMA_POLICY_RX_ORDER_SET(x) (((32'd0 | (x)) << MBOX_DMA_POLICY_RX_ORDER_LSB) & MBOX_DMA_POLICY_RX_ORDER_MASK) -#define MBOX_DMA_POLICY_RX_ORDER_RESET 1'h0 -#define MBOX_DMA_POLICY_RESET (32'h0 | \ - MBOX_DMA_POLICY_TX_QUANTUM_SET(MBOX_DMA_POLICY_TX_QUANTUM_RESET) | \ - MBOX_DMA_POLICY_TX_ORDER_SET(MBOX_DMA_POLICY_TX_ORDER_RESET) | \ - MBOX_DMA_POLICY_RX_QUANTUM_SET(MBOX_DMA_POLICY_RX_QUANTUM_RESET) | \ - MBOX_DMA_POLICY_RX_ORDER_SET(MBOX_DMA_POLICY_RX_ORDER_RESET)) -#define MBOX_DMA_POLICY_HW_MASK (32'h0) -#define MBOX_DMA_POLICY_SW_MASK (32'h0 | \ - MBOX_DMA_POLICY_TX_QUANTUM_MASK | \ - MBOX_DMA_POLICY_TX_ORDER_MASK | \ - MBOX_DMA_POLICY_RX_QUANTUM_MASK | \ - MBOX_DMA_POLICY_RX_ORDER_MASK) - -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS 'h00000018 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX0_DMA_RX_CONTROL_ADDRESS 'h0000001c -#define MBOX0_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX0_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX0_DMA_RX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX0_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_RESUME_MASK) >> MBOX0_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX0_DMA_RX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX0_DMA_RX_CONTROL_RESUME_LSB) & MBOX0_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX0_DMA_RX_CONTROL_RESUME_RESET 1'h0 -#define MBOX0_DMA_RX_CONTROL_START_MSB 1 -#define MBOX0_DMA_RX_CONTROL_START_LSB 1 -#define MBOX0_DMA_RX_CONTROL_START_MASK 'h00000002 -#define MBOX0_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_START_MASK) >> MBOX0_DMA_RX_CONTROL_START_LSB) -#define MBOX0_DMA_RX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX0_DMA_RX_CONTROL_START_LSB) & MBOX0_DMA_RX_CONTROL_START_MASK) -#define MBOX0_DMA_RX_CONTROL_START_RESET 1'h0 -#define MBOX0_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX0_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX0_DMA_RX_CONTROL_STOP_MASK 'h00000001 -#define MBOX0_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_STOP_MASK) >> MBOX0_DMA_RX_CONTROL_STOP_LSB) -#define MBOX0_DMA_RX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX0_DMA_RX_CONTROL_STOP_LSB) & MBOX0_DMA_RX_CONTROL_STOP_MASK) -#define MBOX0_DMA_RX_CONTROL_STOP_RESET 1'h0 -#define MBOX0_DMA_RX_CONTROL_RESET (32'h0 | \ - MBOX0_DMA_RX_CONTROL_RESUME_SET(MBOX0_DMA_RX_CONTROL_RESUME_RESET) | \ - MBOX0_DMA_RX_CONTROL_START_SET(MBOX0_DMA_RX_CONTROL_START_RESET) | \ - MBOX0_DMA_RX_CONTROL_STOP_SET(MBOX0_DMA_RX_CONTROL_STOP_RESET)) -#define MBOX0_DMA_RX_CONTROL_HW_MASK (32'h0 | \ - MBOX0_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX0_DMA_RX_CONTROL_START_MASK | \ - MBOX0_DMA_RX_CONTROL_STOP_MASK) -#define MBOX0_DMA_RX_CONTROL_SW_MASK (32'h0 | \ - MBOX0_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX0_DMA_RX_CONTROL_START_MASK | \ - MBOX0_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS 'h00000020 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX0_DMA_TX_CONTROL_ADDRESS 'h00000024 -#define MBOX0_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX0_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX0_DMA_TX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX0_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_RESUME_MASK) >> MBOX0_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX0_DMA_TX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX0_DMA_TX_CONTROL_RESUME_LSB) & MBOX0_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX0_DMA_TX_CONTROL_RESUME_RESET 1'h0 -#define MBOX0_DMA_TX_CONTROL_START_MSB 1 -#define MBOX0_DMA_TX_CONTROL_START_LSB 1 -#define MBOX0_DMA_TX_CONTROL_START_MASK 'h00000002 -#define MBOX0_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_START_MASK) >> MBOX0_DMA_TX_CONTROL_START_LSB) -#define MBOX0_DMA_TX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX0_DMA_TX_CONTROL_START_LSB) & MBOX0_DMA_TX_CONTROL_START_MASK) -#define MBOX0_DMA_TX_CONTROL_START_RESET 1'h0 -#define MBOX0_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX0_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX0_DMA_TX_CONTROL_STOP_MASK 'h00000001 -#define MBOX0_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_STOP_MASK) >> MBOX0_DMA_TX_CONTROL_STOP_LSB) -#define MBOX0_DMA_TX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX0_DMA_TX_CONTROL_STOP_LSB) & MBOX0_DMA_TX_CONTROL_STOP_MASK) -#define MBOX0_DMA_TX_CONTROL_STOP_RESET 1'h0 -#define MBOX0_DMA_TX_CONTROL_RESET (32'h0 | \ - MBOX0_DMA_TX_CONTROL_RESUME_SET(MBOX0_DMA_TX_CONTROL_RESUME_RESET) | \ - MBOX0_DMA_TX_CONTROL_START_SET(MBOX0_DMA_TX_CONTROL_START_RESET) | \ - MBOX0_DMA_TX_CONTROL_STOP_SET(MBOX0_DMA_TX_CONTROL_STOP_RESET)) -#define MBOX0_DMA_TX_CONTROL_HW_MASK (32'h0 | \ - MBOX0_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX0_DMA_TX_CONTROL_START_MASK | \ - MBOX0_DMA_TX_CONTROL_STOP_MASK) -#define MBOX0_DMA_TX_CONTROL_SW_MASK (32'h0 | \ - MBOX0_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX0_DMA_TX_CONTROL_START_MASK | \ - MBOX0_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS 'h00000028 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX1_DMA_RX_CONTROL_ADDRESS 'h0000002c -#define MBOX1_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX1_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX1_DMA_RX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX1_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX1_DMA_RX_CONTROL_RESUME_MASK) >> MBOX1_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX1_DMA_RX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX1_DMA_RX_CONTROL_RESUME_LSB) & MBOX1_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX1_DMA_RX_CONTROL_RESUME_RESET 1'h0 -#define MBOX1_DMA_RX_CONTROL_START_MSB 1 -#define MBOX1_DMA_RX_CONTROL_START_LSB 1 -#define MBOX1_DMA_RX_CONTROL_START_MASK 'h00000002 -#define MBOX1_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX1_DMA_RX_CONTROL_START_MASK) >> MBOX1_DMA_RX_CONTROL_START_LSB) -#define MBOX1_DMA_RX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX1_DMA_RX_CONTROL_START_LSB) & MBOX1_DMA_RX_CONTROL_START_MASK) -#define MBOX1_DMA_RX_CONTROL_START_RESET 1'h0 -#define MBOX1_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX1_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX1_DMA_RX_CONTROL_STOP_MASK 'h00000001 -#define MBOX1_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX1_DMA_RX_CONTROL_STOP_MASK) >> MBOX1_DMA_RX_CONTROL_STOP_LSB) -#define MBOX1_DMA_RX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX1_DMA_RX_CONTROL_STOP_LSB) & MBOX1_DMA_RX_CONTROL_STOP_MASK) -#define MBOX1_DMA_RX_CONTROL_STOP_RESET 1'h0 -#define MBOX1_DMA_RX_CONTROL_RESET (32'h0 | \ - MBOX1_DMA_RX_CONTROL_RESUME_SET(MBOX1_DMA_RX_CONTROL_RESUME_RESET) | \ - MBOX1_DMA_RX_CONTROL_START_SET(MBOX1_DMA_RX_CONTROL_START_RESET) | \ - MBOX1_DMA_RX_CONTROL_STOP_SET(MBOX1_DMA_RX_CONTROL_STOP_RESET)) -#define MBOX1_DMA_RX_CONTROL_HW_MASK (32'h0 | \ - MBOX1_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX1_DMA_RX_CONTROL_START_MASK | \ - MBOX1_DMA_RX_CONTROL_STOP_MASK) -#define MBOX1_DMA_RX_CONTROL_SW_MASK (32'h0 | \ - MBOX1_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX1_DMA_RX_CONTROL_START_MASK | \ - MBOX1_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS 'h00000030 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX1_DMA_TX_CONTROL_ADDRESS 'h00000034 -#define MBOX1_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX1_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX1_DMA_TX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX1_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX1_DMA_TX_CONTROL_RESUME_MASK) >> MBOX1_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX1_DMA_TX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX1_DMA_TX_CONTROL_RESUME_LSB) & MBOX1_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX1_DMA_TX_CONTROL_RESUME_RESET 1'h0 -#define MBOX1_DMA_TX_CONTROL_START_MSB 1 -#define MBOX1_DMA_TX_CONTROL_START_LSB 1 -#define MBOX1_DMA_TX_CONTROL_START_MASK 'h00000002 -#define MBOX1_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX1_DMA_TX_CONTROL_START_MASK) >> MBOX1_DMA_TX_CONTROL_START_LSB) -#define MBOX1_DMA_TX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX1_DMA_TX_CONTROL_START_LSB) & MBOX1_DMA_TX_CONTROL_START_MASK) -#define MBOX1_DMA_TX_CONTROL_START_RESET 1'h0 -#define MBOX1_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX1_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX1_DMA_TX_CONTROL_STOP_MASK 'h00000001 -#define MBOX1_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX1_DMA_TX_CONTROL_STOP_MASK) >> MBOX1_DMA_TX_CONTROL_STOP_LSB) -#define MBOX1_DMA_TX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX1_DMA_TX_CONTROL_STOP_LSB) & MBOX1_DMA_TX_CONTROL_STOP_MASK) -#define MBOX1_DMA_TX_CONTROL_STOP_RESET 1'h0 -#define MBOX1_DMA_TX_CONTROL_RESET (32'h0 | \ - MBOX1_DMA_TX_CONTROL_RESUME_SET(MBOX1_DMA_TX_CONTROL_RESUME_RESET) | \ - MBOX1_DMA_TX_CONTROL_START_SET(MBOX1_DMA_TX_CONTROL_START_RESET) | \ - MBOX1_DMA_TX_CONTROL_STOP_SET(MBOX1_DMA_TX_CONTROL_STOP_RESET)) -#define MBOX1_DMA_TX_CONTROL_HW_MASK (32'h0 | \ - MBOX1_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX1_DMA_TX_CONTROL_START_MASK | \ - MBOX1_DMA_TX_CONTROL_STOP_MASK) -#define MBOX1_DMA_TX_CONTROL_SW_MASK (32'h0 | \ - MBOX1_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX1_DMA_TX_CONTROL_START_MASK | \ - MBOX1_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS 'h00000038 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX2_DMA_RX_CONTROL_ADDRESS 'h0000003c -#define MBOX2_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX2_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX2_DMA_RX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX2_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX2_DMA_RX_CONTROL_RESUME_MASK) >> MBOX2_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX2_DMA_RX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX2_DMA_RX_CONTROL_RESUME_LSB) & MBOX2_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX2_DMA_RX_CONTROL_RESUME_RESET 1'h0 -#define MBOX2_DMA_RX_CONTROL_START_MSB 1 -#define MBOX2_DMA_RX_CONTROL_START_LSB 1 -#define MBOX2_DMA_RX_CONTROL_START_MASK 'h00000002 -#define MBOX2_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX2_DMA_RX_CONTROL_START_MASK) >> MBOX2_DMA_RX_CONTROL_START_LSB) -#define MBOX2_DMA_RX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX2_DMA_RX_CONTROL_START_LSB) & MBOX2_DMA_RX_CONTROL_START_MASK) -#define MBOX2_DMA_RX_CONTROL_START_RESET 1'h0 -#define MBOX2_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX2_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX2_DMA_RX_CONTROL_STOP_MASK 'h00000001 -#define MBOX2_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX2_DMA_RX_CONTROL_STOP_MASK) >> MBOX2_DMA_RX_CONTROL_STOP_LSB) -#define MBOX2_DMA_RX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX2_DMA_RX_CONTROL_STOP_LSB) & MBOX2_DMA_RX_CONTROL_STOP_MASK) -#define MBOX2_DMA_RX_CONTROL_STOP_RESET 1'h0 -#define MBOX2_DMA_RX_CONTROL_RESET (32'h0 | \ - MBOX2_DMA_RX_CONTROL_RESUME_SET(MBOX2_DMA_RX_CONTROL_RESUME_RESET) | \ - MBOX2_DMA_RX_CONTROL_START_SET(MBOX2_DMA_RX_CONTROL_START_RESET) | \ - MBOX2_DMA_RX_CONTROL_STOP_SET(MBOX2_DMA_RX_CONTROL_STOP_RESET)) -#define MBOX2_DMA_RX_CONTROL_HW_MASK (32'h0 | \ - MBOX2_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX2_DMA_RX_CONTROL_START_MASK | \ - MBOX2_DMA_RX_CONTROL_STOP_MASK) -#define MBOX2_DMA_RX_CONTROL_SW_MASK (32'h0 | \ - MBOX2_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX2_DMA_RX_CONTROL_START_MASK | \ - MBOX2_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS 'h00000040 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX2_DMA_TX_CONTROL_ADDRESS 'h00000044 -#define MBOX2_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX2_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX2_DMA_TX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX2_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX2_DMA_TX_CONTROL_RESUME_MASK) >> MBOX2_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX2_DMA_TX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX2_DMA_TX_CONTROL_RESUME_LSB) & MBOX2_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX2_DMA_TX_CONTROL_RESUME_RESET 1'h0 -#define MBOX2_DMA_TX_CONTROL_START_MSB 1 -#define MBOX2_DMA_TX_CONTROL_START_LSB 1 -#define MBOX2_DMA_TX_CONTROL_START_MASK 'h00000002 -#define MBOX2_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX2_DMA_TX_CONTROL_START_MASK) >> MBOX2_DMA_TX_CONTROL_START_LSB) -#define MBOX2_DMA_TX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX2_DMA_TX_CONTROL_START_LSB) & MBOX2_DMA_TX_CONTROL_START_MASK) -#define MBOX2_DMA_TX_CONTROL_START_RESET 1'h0 -#define MBOX2_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX2_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX2_DMA_TX_CONTROL_STOP_MASK 'h00000001 -#define MBOX2_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX2_DMA_TX_CONTROL_STOP_MASK) >> MBOX2_DMA_TX_CONTROL_STOP_LSB) -#define MBOX2_DMA_TX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX2_DMA_TX_CONTROL_STOP_LSB) & MBOX2_DMA_TX_CONTROL_STOP_MASK) -#define MBOX2_DMA_TX_CONTROL_STOP_RESET 1'h0 -#define MBOX2_DMA_TX_CONTROL_RESET (32'h0 | \ - MBOX2_DMA_TX_CONTROL_RESUME_SET(MBOX2_DMA_TX_CONTROL_RESUME_RESET) | \ - MBOX2_DMA_TX_CONTROL_START_SET(MBOX2_DMA_TX_CONTROL_START_RESET) | \ - MBOX2_DMA_TX_CONTROL_STOP_SET(MBOX2_DMA_TX_CONTROL_STOP_RESET)) -#define MBOX2_DMA_TX_CONTROL_HW_MASK (32'h0 | \ - MBOX2_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX2_DMA_TX_CONTROL_START_MASK | \ - MBOX2_DMA_TX_CONTROL_STOP_MASK) -#define MBOX2_DMA_TX_CONTROL_SW_MASK (32'h0 | \ - MBOX2_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX2_DMA_TX_CONTROL_START_MASK | \ - MBOX2_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS 'h00000048 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX3_DMA_RX_CONTROL_ADDRESS 'h0000004c -#define MBOX3_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX3_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX3_DMA_RX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX3_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX3_DMA_RX_CONTROL_RESUME_MASK) >> MBOX3_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX3_DMA_RX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX3_DMA_RX_CONTROL_RESUME_LSB) & MBOX3_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX3_DMA_RX_CONTROL_RESUME_RESET 1'h0 -#define MBOX3_DMA_RX_CONTROL_START_MSB 1 -#define MBOX3_DMA_RX_CONTROL_START_LSB 1 -#define MBOX3_DMA_RX_CONTROL_START_MASK 'h00000002 -#define MBOX3_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX3_DMA_RX_CONTROL_START_MASK) >> MBOX3_DMA_RX_CONTROL_START_LSB) -#define MBOX3_DMA_RX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX3_DMA_RX_CONTROL_START_LSB) & MBOX3_DMA_RX_CONTROL_START_MASK) -#define MBOX3_DMA_RX_CONTROL_START_RESET 1'h0 -#define MBOX3_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX3_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX3_DMA_RX_CONTROL_STOP_MASK 'h00000001 -#define MBOX3_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX3_DMA_RX_CONTROL_STOP_MASK) >> MBOX3_DMA_RX_CONTROL_STOP_LSB) -#define MBOX3_DMA_RX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX3_DMA_RX_CONTROL_STOP_LSB) & MBOX3_DMA_RX_CONTROL_STOP_MASK) -#define MBOX3_DMA_RX_CONTROL_STOP_RESET 1'h0 -#define MBOX3_DMA_RX_CONTROL_RESET (32'h0 | \ - MBOX3_DMA_RX_CONTROL_RESUME_SET(MBOX3_DMA_RX_CONTROL_RESUME_RESET) | \ - MBOX3_DMA_RX_CONTROL_START_SET(MBOX3_DMA_RX_CONTROL_START_RESET) | \ - MBOX3_DMA_RX_CONTROL_STOP_SET(MBOX3_DMA_RX_CONTROL_STOP_RESET)) -#define MBOX3_DMA_RX_CONTROL_HW_MASK (32'h0 | \ - MBOX3_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX3_DMA_RX_CONTROL_START_MASK | \ - MBOX3_DMA_RX_CONTROL_STOP_MASK) -#define MBOX3_DMA_RX_CONTROL_SW_MASK (32'h0 | \ - MBOX3_DMA_RX_CONTROL_RESUME_MASK | \ - MBOX3_DMA_RX_CONTROL_START_MASK | \ - MBOX3_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS 'h00000050 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 'h0ffffffc -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((32'd0 | (x)) << MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET 26'h0 -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_RESET (32'h0 | \ - MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_RESET)) -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_HW_MASK (32'h0) -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_SW_MASK (32'h0 | \ - MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX3_DMA_TX_CONTROL_ADDRESS 'h00000054 -#define MBOX3_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX3_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX3_DMA_TX_CONTROL_RESUME_MASK 'h00000004 -#define MBOX3_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX3_DMA_TX_CONTROL_RESUME_MASK) >> MBOX3_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX3_DMA_TX_CONTROL_RESUME_SET(x) (((32'd0 | (x)) << MBOX3_DMA_TX_CONTROL_RESUME_LSB) & MBOX3_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX3_DMA_TX_CONTROL_RESUME_RESET 1'h0 -#define MBOX3_DMA_TX_CONTROL_START_MSB 1 -#define MBOX3_DMA_TX_CONTROL_START_LSB 1 -#define MBOX3_DMA_TX_CONTROL_START_MASK 'h00000002 -#define MBOX3_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX3_DMA_TX_CONTROL_START_MASK) >> MBOX3_DMA_TX_CONTROL_START_LSB) -#define MBOX3_DMA_TX_CONTROL_START_SET(x) (((32'd0 | (x)) << MBOX3_DMA_TX_CONTROL_START_LSB) & MBOX3_DMA_TX_CONTROL_START_MASK) -#define MBOX3_DMA_TX_CONTROL_START_RESET 1'h0 -#define MBOX3_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX3_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX3_DMA_TX_CONTROL_STOP_MASK 'h00000001 -#define MBOX3_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX3_DMA_TX_CONTROL_STOP_MASK) >> MBOX3_DMA_TX_CONTROL_STOP_LSB) -#define MBOX3_DMA_TX_CONTROL_STOP_SET(x) (((32'd0 | (x)) << MBOX3_DMA_TX_CONTROL_STOP_LSB) & MBOX3_DMA_TX_CONTROL_STOP_MASK) -#define MBOX3_DMA_TX_CONTROL_STOP_RESET 1'h0 -#define MBOX3_DMA_TX_CONTROL_RESET (32'h0 | \ - MBOX3_DMA_TX_CONTROL_RESUME_SET(MBOX3_DMA_TX_CONTROL_RESUME_RESET) | \ - MBOX3_DMA_TX_CONTROL_START_SET(MBOX3_DMA_TX_CONTROL_START_RESET) | \ - MBOX3_DMA_TX_CONTROL_STOP_SET(MBOX3_DMA_TX_CONTROL_STOP_RESET)) -#define MBOX3_DMA_TX_CONTROL_HW_MASK (32'h0 | \ - MBOX3_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX3_DMA_TX_CONTROL_START_MASK | \ - MBOX3_DMA_TX_CONTROL_STOP_MASK) -#define MBOX3_DMA_TX_CONTROL_SW_MASK (32'h0 | \ - MBOX3_DMA_TX_CONTROL_RESUME_MASK | \ - MBOX3_DMA_TX_CONTROL_START_MASK | \ - MBOX3_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX_INT_STATUS_ADDRESS 'h00000058 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MSB 31 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB 28 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK 'hf0000000 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) >> MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) & MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_RESET 4'h0 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB 27 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB 24 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK 'h0f000000 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) >> MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) & MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_RESET 4'h0 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MSB 23 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB 20 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK 'h00f00000 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) >> MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) & MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_RESET 4'h0 -#define MBOX_INT_STATUS_TX_OVERFLOW_MSB 17 -#define MBOX_INT_STATUS_TX_OVERFLOW_LSB 17 -#define MBOX_INT_STATUS_TX_OVERFLOW_MASK 'h00020000 -#define MBOX_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & MBOX_INT_STATUS_TX_OVERFLOW_MASK) >> MBOX_INT_STATUS_TX_OVERFLOW_LSB) -#define MBOX_INT_STATUS_TX_OVERFLOW_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_TX_OVERFLOW_LSB) & MBOX_INT_STATUS_TX_OVERFLOW_MASK) -#define MBOX_INT_STATUS_TX_OVERFLOW_RESET 1'h0 -#define MBOX_INT_STATUS_RX_UNDERFLOW_MSB 16 -#define MBOX_INT_STATUS_RX_UNDERFLOW_LSB 16 -#define MBOX_INT_STATUS_RX_UNDERFLOW_MASK 'h00010000 -#define MBOX_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & MBOX_INT_STATUS_RX_UNDERFLOW_MASK) >> MBOX_INT_STATUS_RX_UNDERFLOW_LSB) -#define MBOX_INT_STATUS_RX_UNDERFLOW_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_RX_UNDERFLOW_LSB) & MBOX_INT_STATUS_RX_UNDERFLOW_MASK) -#define MBOX_INT_STATUS_RX_UNDERFLOW_RESET 1'h0 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_MSB 15 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_LSB 12 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_MASK 'h0000f000 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) (((x) & MBOX_INT_STATUS_TX_NOT_EMPTY_MASK) >> MBOX_INT_STATUS_TX_NOT_EMPTY_LSB) -#define MBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_TX_NOT_EMPTY_LSB) & MBOX_INT_STATUS_TX_NOT_EMPTY_MASK) -#define MBOX_INT_STATUS_TX_NOT_EMPTY_RESET 4'h0 -#define MBOX_INT_STATUS_RX_NOT_FULL_MSB 11 -#define MBOX_INT_STATUS_RX_NOT_FULL_LSB 8 -#define MBOX_INT_STATUS_RX_NOT_FULL_MASK 'h00000f00 -#define MBOX_INT_STATUS_RX_NOT_FULL_GET(x) (((x) & MBOX_INT_STATUS_RX_NOT_FULL_MASK) >> MBOX_INT_STATUS_RX_NOT_FULL_LSB) -#define MBOX_INT_STATUS_RX_NOT_FULL_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_RX_NOT_FULL_LSB) & MBOX_INT_STATUS_RX_NOT_FULL_MASK) -#define MBOX_INT_STATUS_RX_NOT_FULL_RESET 4'h0 -#define MBOX_INT_STATUS_HOST_MSB 7 -#define MBOX_INT_STATUS_HOST_LSB 0 -#define MBOX_INT_STATUS_HOST_MASK 'h000000ff -#define MBOX_INT_STATUS_HOST_GET(x) (((x) & MBOX_INT_STATUS_HOST_MASK) >> MBOX_INT_STATUS_HOST_LSB) -#define MBOX_INT_STATUS_HOST_SET(x) (((32'd0 | (x)) << MBOX_INT_STATUS_HOST_LSB) & MBOX_INT_STATUS_HOST_MASK) -#define MBOX_INT_STATUS_HOST_RESET 8'h0 -#define MBOX_INT_STATUS_RESET (32'h0 | \ - MBOX_INT_STATUS_RX_DMA_COMPLETE_SET(MBOX_INT_STATUS_RX_DMA_COMPLETE_RESET) | \ - MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_RESET) | \ - MBOX_INT_STATUS_TX_DMA_COMPLETE_SET(MBOX_INT_STATUS_TX_DMA_COMPLETE_RESET) | \ - MBOX_INT_STATUS_TX_OVERFLOW_SET(MBOX_INT_STATUS_TX_OVERFLOW_RESET) | \ - MBOX_INT_STATUS_RX_UNDERFLOW_SET(MBOX_INT_STATUS_RX_UNDERFLOW_RESET) | \ - MBOX_INT_STATUS_TX_NOT_EMPTY_SET(MBOX_INT_STATUS_TX_NOT_EMPTY_RESET) | \ - MBOX_INT_STATUS_RX_NOT_FULL_SET(MBOX_INT_STATUS_RX_NOT_FULL_RESET) | \ - MBOX_INT_STATUS_HOST_SET(MBOX_INT_STATUS_HOST_RESET)) -#define MBOX_INT_STATUS_HW_MASK (32'h0 | \ - MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK | \ - MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK | \ - MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK | \ - MBOX_INT_STATUS_TX_OVERFLOW_MASK | \ - MBOX_INT_STATUS_RX_UNDERFLOW_MASK | \ - MBOX_INT_STATUS_TX_NOT_EMPTY_MASK | \ - MBOX_INT_STATUS_RX_NOT_FULL_MASK | \ - MBOX_INT_STATUS_HOST_MASK) -#define MBOX_INT_STATUS_SW_MASK (32'h0 | \ - MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK | \ - MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK | \ - MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK | \ - MBOX_INT_STATUS_TX_OVERFLOW_MASK | \ - MBOX_INT_STATUS_RX_UNDERFLOW_MASK | \ - MBOX_INT_STATUS_TX_NOT_EMPTY_MASK | \ - MBOX_INT_STATUS_RX_NOT_FULL_MASK | \ - MBOX_INT_STATUS_HOST_MASK) - -#define MBOX_INT_ENABLE_ADDRESS 'h0000005c -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB 31 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB 28 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK 'hf0000000 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) >> MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) & MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_RESET 4'h0 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB 27 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB 24 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK 'h0f000000 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) >> MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) & MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_RESET 4'h0 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB 23 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB 20 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK 'h00f00000 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) >> MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) & MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_RESET 4'h0 -#define MBOX_INT_ENABLE_TX_OVERFLOW_MSB 17 -#define MBOX_INT_ENABLE_TX_OVERFLOW_LSB 17 -#define MBOX_INT_ENABLE_TX_OVERFLOW_MASK 'h00020000 -#define MBOX_INT_ENABLE_TX_OVERFLOW_GET(x) (((x) & MBOX_INT_ENABLE_TX_OVERFLOW_MASK) >> MBOX_INT_ENABLE_TX_OVERFLOW_LSB) -#define MBOX_INT_ENABLE_TX_OVERFLOW_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_TX_OVERFLOW_LSB) & MBOX_INT_ENABLE_TX_OVERFLOW_MASK) -#define MBOX_INT_ENABLE_TX_OVERFLOW_RESET 1'h0 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_MSB 16 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_LSB 16 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_MASK 'h00010000 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) (((x) & MBOX_INT_ENABLE_RX_UNDERFLOW_MASK) >> MBOX_INT_ENABLE_RX_UNDERFLOW_LSB) -#define MBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_RX_UNDERFLOW_LSB) & MBOX_INT_ENABLE_RX_UNDERFLOW_MASK) -#define MBOX_INT_ENABLE_RX_UNDERFLOW_RESET 1'h0 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MSB 15 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB 12 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK 'h0000f000 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) (((x) & MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) >> MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) & MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_RESET 4'h0 -#define MBOX_INT_ENABLE_RX_NOT_FULL_MSB 11 -#define MBOX_INT_ENABLE_RX_NOT_FULL_LSB 8 -#define MBOX_INT_ENABLE_RX_NOT_FULL_MASK 'h00000f00 -#define MBOX_INT_ENABLE_RX_NOT_FULL_GET(x) (((x) & MBOX_INT_ENABLE_RX_NOT_FULL_MASK) >> MBOX_INT_ENABLE_RX_NOT_FULL_LSB) -#define MBOX_INT_ENABLE_RX_NOT_FULL_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_RX_NOT_FULL_LSB) & MBOX_INT_ENABLE_RX_NOT_FULL_MASK) -#define MBOX_INT_ENABLE_RX_NOT_FULL_RESET 4'h0 -#define MBOX_INT_ENABLE_HOST_MSB 7 -#define MBOX_INT_ENABLE_HOST_LSB 0 -#define MBOX_INT_ENABLE_HOST_MASK 'h000000ff -#define MBOX_INT_ENABLE_HOST_GET(x) (((x) & MBOX_INT_ENABLE_HOST_MASK) >> MBOX_INT_ENABLE_HOST_LSB) -#define MBOX_INT_ENABLE_HOST_SET(x) (((32'd0 | (x)) << MBOX_INT_ENABLE_HOST_LSB) & MBOX_INT_ENABLE_HOST_MASK) -#define MBOX_INT_ENABLE_HOST_RESET 8'hff -#define MBOX_INT_ENABLE_RESET (32'h0 | \ - MBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(MBOX_INT_ENABLE_RX_DMA_COMPLETE_RESET) | \ - MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_RESET) | \ - MBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(MBOX_INT_ENABLE_TX_DMA_COMPLETE_RESET) | \ - MBOX_INT_ENABLE_TX_OVERFLOW_SET(MBOX_INT_ENABLE_TX_OVERFLOW_RESET) | \ - MBOX_INT_ENABLE_RX_UNDERFLOW_SET(MBOX_INT_ENABLE_RX_UNDERFLOW_RESET) | \ - MBOX_INT_ENABLE_TX_NOT_EMPTY_SET(MBOX_INT_ENABLE_TX_NOT_EMPTY_RESET) | \ - MBOX_INT_ENABLE_RX_NOT_FULL_SET(MBOX_INT_ENABLE_RX_NOT_FULL_RESET) | \ - MBOX_INT_ENABLE_HOST_SET(MBOX_INT_ENABLE_HOST_RESET)) -#define MBOX_INT_ENABLE_HW_MASK (32'h0) -#define MBOX_INT_ENABLE_SW_MASK (32'h0 | \ - MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK | \ - MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK | \ - MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK | \ - MBOX_INT_ENABLE_TX_OVERFLOW_MASK | \ - MBOX_INT_ENABLE_RX_UNDERFLOW_MASK | \ - MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK | \ - MBOX_INT_ENABLE_RX_NOT_FULL_MASK | \ - MBOX_INT_ENABLE_HOST_MASK) - -#define INT_HOST_ADDRESS 'h00000060 -#define INT_HOST_VECTOR_MSB 7 -#define INT_HOST_VECTOR_LSB 0 -#define INT_HOST_VECTOR_MASK 'h000000ff -#define INT_HOST_VECTOR_GET(x) (((x) & INT_HOST_VECTOR_MASK) >> INT_HOST_VECTOR_LSB) -#define INT_HOST_VECTOR_SET(x) (((32'd0 | (x)) << INT_HOST_VECTOR_LSB) & INT_HOST_VECTOR_MASK) -#define INT_HOST_VECTOR_RESET 8'h0 -#define INT_HOST_RESET (32'h0 | \ - INT_HOST_VECTOR_SET(INT_HOST_VECTOR_RESET)) -#define INT_HOST_HW_MASK (32'h0 | \ - INT_HOST_VECTOR_MASK) -#define INT_HOST_SW_MASK (32'h0 | \ - INT_HOST_VECTOR_MASK) - -#define LOCAL_COUNT_ADDRESS 'h00000080 -#define LOCAL_COUNT_VALUE_MSB 7 -#define LOCAL_COUNT_VALUE_LSB 0 -#define LOCAL_COUNT_VALUE_MASK 'h000000ff -#define LOCAL_COUNT_VALUE_GET(x) (((x) & LOCAL_COUNT_VALUE_MASK) >> LOCAL_COUNT_VALUE_LSB) -#define LOCAL_COUNT_VALUE_SET(x) (((32'd0 | (x)) << LOCAL_COUNT_VALUE_LSB) & LOCAL_COUNT_VALUE_MASK) -#define LOCAL_COUNT_VALUE_RESET 8'h0 -#define LOCAL_COUNT_RESET (32'h0 | \ - LOCAL_COUNT_VALUE_SET(LOCAL_COUNT_VALUE_RESET)) -#define LOCAL_COUNT_HW_MASK (32'h0 | \ - LOCAL_COUNT_VALUE_MASK) -#define LOCAL_COUNT_SW_MASK (32'h0 | \ - LOCAL_COUNT_VALUE_MASK) - -#define COUNT_INC_ADDRESS 'h000000a0 -#define COUNT_INC_VALUE_MSB 7 -#define COUNT_INC_VALUE_LSB 0 -#define COUNT_INC_VALUE_MASK 'h000000ff -#define COUNT_INC_VALUE_GET(x) (((x) & COUNT_INC_VALUE_MASK) >> COUNT_INC_VALUE_LSB) -#define COUNT_INC_VALUE_SET(x) (((32'd0 | (x)) << COUNT_INC_VALUE_LSB) & COUNT_INC_VALUE_MASK) -#define COUNT_INC_VALUE_RESET 8'h0 -#define COUNT_INC_RESET (32'h0 | \ - COUNT_INC_VALUE_SET(COUNT_INC_VALUE_RESET)) -#define COUNT_INC_HW_MASK (32'h0 | \ - COUNT_INC_VALUE_MASK) -#define COUNT_INC_SW_MASK (32'h0 | \ - COUNT_INC_VALUE_MASK) - -#define LOCAL_SCRATCH_ADDRESS 'h000000c0 -#define LOCAL_SCRATCH_VALUE_MSB 7 -#define LOCAL_SCRATCH_VALUE_LSB 0 -#define LOCAL_SCRATCH_VALUE_MASK 'h000000ff -#define LOCAL_SCRATCH_VALUE_GET(x) (((x) & LOCAL_SCRATCH_VALUE_MASK) >> LOCAL_SCRATCH_VALUE_LSB) -#define LOCAL_SCRATCH_VALUE_SET(x) (((32'd0 | (x)) << LOCAL_SCRATCH_VALUE_LSB) & LOCAL_SCRATCH_VALUE_MASK) -#define LOCAL_SCRATCH_VALUE_RESET 8'h0 -#define LOCAL_SCRATCH_RESET (32'h0 | \ - LOCAL_SCRATCH_VALUE_SET(LOCAL_SCRATCH_VALUE_RESET)) -#define LOCAL_SCRATCH_HW_MASK (32'h0 | \ - LOCAL_SCRATCH_VALUE_MASK) -#define LOCAL_SCRATCH_SW_MASK (32'h0 | \ - LOCAL_SCRATCH_VALUE_MASK) - -#define USE_LOCAL_BUS_ADDRESS 'h000000e0 -#define USE_LOCAL_BUS_PIN_INIT_MSB 0 -#define USE_LOCAL_BUS_PIN_INIT_LSB 0 -#define USE_LOCAL_BUS_PIN_INIT_MASK 'h00000001 -#define USE_LOCAL_BUS_PIN_INIT_GET(x) (((x) & USE_LOCAL_BUS_PIN_INIT_MASK) >> USE_LOCAL_BUS_PIN_INIT_LSB) -#define USE_LOCAL_BUS_PIN_INIT_SET(x) (((32'd0 | (x)) << USE_LOCAL_BUS_PIN_INIT_LSB) & USE_LOCAL_BUS_PIN_INIT_MASK) -#define USE_LOCAL_BUS_PIN_INIT_RESET 1'h0 -#define USE_LOCAL_BUS_RESET (32'h0 | \ - USE_LOCAL_BUS_PIN_INIT_SET(USE_LOCAL_BUS_PIN_INIT_RESET)) -#define USE_LOCAL_BUS_HW_MASK (32'h0 | \ - USE_LOCAL_BUS_PIN_INIT_MASK) -#define USE_LOCAL_BUS_SW_MASK (32'h0) - -#define SDIO_CONFIG_ADDRESS 'h000000e4 -#define SDIO_CONFIG_CCCR_IOR1_MSB 0 -#define SDIO_CONFIG_CCCR_IOR1_LSB 0 -#define SDIO_CONFIG_CCCR_IOR1_MASK 'h00000001 -#define SDIO_CONFIG_CCCR_IOR1_GET(x) (((x) & SDIO_CONFIG_CCCR_IOR1_MASK) >> SDIO_CONFIG_CCCR_IOR1_LSB) -#define SDIO_CONFIG_CCCR_IOR1_SET(x) (((32'd0 | (x)) << SDIO_CONFIG_CCCR_IOR1_LSB) & SDIO_CONFIG_CCCR_IOR1_MASK) -#define SDIO_CONFIG_CCCR_IOR1_RESET 1'h0 -#define SDIO_CONFIG_RESET (32'h0 | \ - SDIO_CONFIG_CCCR_IOR1_SET(SDIO_CONFIG_CCCR_IOR1_RESET)) -#define SDIO_CONFIG_HW_MASK (32'h0) -#define SDIO_CONFIG_SW_MASK (32'h0 | \ - SDIO_CONFIG_CCCR_IOR1_MASK) - -#define MBOX_DEBUG_ADDRESS 'h000000e8 -#define MBOX_DEBUG_SEL_MSB 2 -#define MBOX_DEBUG_SEL_LSB 0 -#define MBOX_DEBUG_SEL_MASK 'h00000007 -#define MBOX_DEBUG_SEL_GET(x) (((x) & MBOX_DEBUG_SEL_MASK) >> MBOX_DEBUG_SEL_LSB) -#define MBOX_DEBUG_SEL_SET(x) (((32'd0 | (x)) << MBOX_DEBUG_SEL_LSB) & MBOX_DEBUG_SEL_MASK) -#define MBOX_DEBUG_SEL_RESET 3'h0 -#define MBOX_DEBUG_RESET (32'h0 | \ - MBOX_DEBUG_SEL_SET(MBOX_DEBUG_SEL_RESET)) -#define MBOX_DEBUG_HW_MASK (32'h0) -#define MBOX_DEBUG_SW_MASK (32'h0 | \ - MBOX_DEBUG_SEL_MASK) - -#define MBOX_FIFO_RESET_ADDRESS 'h000000ec -#define MBOX_FIFO_RESET_INIT_MSB 0 -#define MBOX_FIFO_RESET_INIT_LSB 0 -#define MBOX_FIFO_RESET_INIT_MASK 'h00000001 -#define MBOX_FIFO_RESET_INIT_GET(x) (((x) & MBOX_FIFO_RESET_INIT_MASK) >> MBOX_FIFO_RESET_INIT_LSB) -#define MBOX_FIFO_RESET_INIT_SET(x) (((32'd0 | (x)) << MBOX_FIFO_RESET_INIT_LSB) & MBOX_FIFO_RESET_INIT_MASK) -#define MBOX_FIFO_RESET_INIT_RESET 1'h0 -#define MBOX_FIFO_RESET_RESET (32'h0 | \ - MBOX_FIFO_RESET_INIT_SET(MBOX_FIFO_RESET_INIT_RESET)) -#define MBOX_FIFO_RESET_HW_MASK (32'h0 | \ - MBOX_FIFO_RESET_INIT_MASK) -#define MBOX_FIFO_RESET_SW_MASK (32'h0 | \ - MBOX_FIFO_RESET_INIT_MASK) - -#define MBOX_TXFIFO_POP_ADDRESS 'h000000f0 -#define MBOX_TXFIFO_POP_DATA_MSB 0 -#define MBOX_TXFIFO_POP_DATA_LSB 0 -#define MBOX_TXFIFO_POP_DATA_MASK 'h00000001 -#define MBOX_TXFIFO_POP_DATA_GET(x) (((x) & MBOX_TXFIFO_POP_DATA_MASK) >> MBOX_TXFIFO_POP_DATA_LSB) -#define MBOX_TXFIFO_POP_DATA_SET(x) (((32'd0 | (x)) << MBOX_TXFIFO_POP_DATA_LSB) & MBOX_TXFIFO_POP_DATA_MASK) -#define MBOX_TXFIFO_POP_DATA_RESET 1'h0 -#define MBOX_TXFIFO_POP_RESET (32'h0 | \ - MBOX_TXFIFO_POP_DATA_SET(MBOX_TXFIFO_POP_DATA_RESET)) -#define MBOX_TXFIFO_POP_HW_MASK (32'h0) -#define MBOX_TXFIFO_POP_SW_MASK (32'h0 | \ - MBOX_TXFIFO_POP_DATA_MASK) - -#define MBOX_RXFIFO_POP_ADDRESS 'h00000100 -#define MBOX_RXFIFO_POP_DATA_MSB 0 -#define MBOX_RXFIFO_POP_DATA_LSB 0 -#define MBOX_RXFIFO_POP_DATA_MASK 'h00000001 -#define MBOX_RXFIFO_POP_DATA_GET(x) (((x) & MBOX_RXFIFO_POP_DATA_MASK) >> MBOX_RXFIFO_POP_DATA_LSB) -#define MBOX_RXFIFO_POP_DATA_SET(x) (((32'd0 | (x)) << MBOX_RXFIFO_POP_DATA_LSB) & MBOX_RXFIFO_POP_DATA_MASK) -#define MBOX_RXFIFO_POP_DATA_RESET 1'h0 -#define MBOX_RXFIFO_POP_RESET (32'h0 | \ - MBOX_RXFIFO_POP_DATA_SET(MBOX_RXFIFO_POP_DATA_RESET)) -#define MBOX_RXFIFO_POP_HW_MASK (32'h0) -#define MBOX_RXFIFO_POP_SW_MASK (32'h0 | \ - MBOX_RXFIFO_POP_DATA_MASK) - -#define SDIO_DEBUG_ADDRESS 'h00000110 -#define SDIO_DEBUG_SEL_MSB 3 -#define SDIO_DEBUG_SEL_LSB 0 -#define SDIO_DEBUG_SEL_MASK 'h0000000f -#define SDIO_DEBUG_SEL_GET(x) (((x) & SDIO_DEBUG_SEL_MASK) >> SDIO_DEBUG_SEL_LSB) -#define SDIO_DEBUG_SEL_SET(x) (((32'd0 | (x)) << SDIO_DEBUG_SEL_LSB) & SDIO_DEBUG_SEL_MASK) -#define SDIO_DEBUG_SEL_RESET 4'h0 -#define SDIO_DEBUG_RESET (32'h0 | \ - SDIO_DEBUG_SEL_SET(SDIO_DEBUG_SEL_RESET)) -#define SDIO_DEBUG_HW_MASK (32'h0) -#define SDIO_DEBUG_SW_MASK (32'h0 | \ - SDIO_DEBUG_SEL_MASK) - -#define HOST_IF_WINDOW_ADDRESS 'h00002000 -#define HOST_IF_WINDOW_DATA_MSB 7 -#define HOST_IF_WINDOW_DATA_LSB 0 -#define HOST_IF_WINDOW_DATA_MASK 'h000000ff -#define HOST_IF_WINDOW_DATA_GET(x) (((x) & HOST_IF_WINDOW_DATA_MASK) >> HOST_IF_WINDOW_DATA_LSB) -#define HOST_IF_WINDOW_DATA_SET(x) (((32'd0 | (x)) << HOST_IF_WINDOW_DATA_LSB) & HOST_IF_WINDOW_DATA_MASK) -#define HOST_IF_WINDOW_DATA_RESET 8'h0 -#define HOST_IF_WINDOW_RESET (32'h0 | \ - HOST_IF_WINDOW_DATA_SET(HOST_IF_WINDOW_DATA_RESET)) -#define HOST_IF_WINDOW_HW_MASK (32'h0 | \ - HOST_IF_WINDOW_DATA_MASK) -#define HOST_IF_WINDOW_SW_MASK (32'h0 | \ - HOST_IF_WINDOW_DATA_MASK) - -#define MBOX_REG_ADDRESS_MSB 13 - -#endif /* _MBOX_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf2G_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf2G_reg.h deleted file mode 100644 index f214c9c101c3..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf2G_reg.h +++ /dev/null @@ -1,160 +0,0 @@ -#ifndef _RF2G_REG_REG_H_ -#define _RF2G_REG_REG_H_ - -#define RF2G_RF2G1_ADDRESS 0x00000000 -#define RF2G_RF2G1_OFFSET 0x00000000 -#define RF2G_RF2G1_BLNA1_MSB 31 -#define RF2G_RF2G1_BLNA1_LSB 29 -#define RF2G_RF2G1_BLNA1_MASK 0xe0000000 -#define RF2G_RF2G1_BLNA1_GET(x) (((x) & RF2G_RF2G1_BLNA1_MASK) >> RF2G_RF2G1_BLNA1_LSB) -#define RF2G_RF2G1_BLNA1_SET(x) (((x) << RF2G_RF2G1_BLNA1_LSB) & RF2G_RF2G1_BLNA1_MASK) -#define RF2G_RF2G1_BLNA1F_MSB 28 -#define RF2G_RF2G1_BLNA1F_LSB 26 -#define RF2G_RF2G1_BLNA1F_MASK 0x1c000000 -#define RF2G_RF2G1_BLNA1F_GET(x) (((x) & RF2G_RF2G1_BLNA1F_MASK) >> RF2G_RF2G1_BLNA1F_LSB) -#define RF2G_RF2G1_BLNA1F_SET(x) (((x) << RF2G_RF2G1_BLNA1F_LSB) & RF2G_RF2G1_BLNA1F_MASK) -#define RF2G_RF2G1_BLNA1BUF_MSB 25 -#define RF2G_RF2G1_BLNA1BUF_LSB 23 -#define RF2G_RF2G1_BLNA1BUF_MASK 0x03800000 -#define RF2G_RF2G1_BLNA1BUF_GET(x) (((x) & RF2G_RF2G1_BLNA1BUF_MASK) >> RF2G_RF2G1_BLNA1BUF_LSB) -#define RF2G_RF2G1_BLNA1BUF_SET(x) (((x) << RF2G_RF2G1_BLNA1BUF_LSB) & RF2G_RF2G1_BLNA1BUF_MASK) -#define RF2G_RF2G1_BLNA2_MSB 22 -#define RF2G_RF2G1_BLNA2_LSB 20 -#define RF2G_RF2G1_BLNA2_MASK 0x00700000 -#define RF2G_RF2G1_BLNA2_GET(x) (((x) & RF2G_RF2G1_BLNA2_MASK) >> RF2G_RF2G1_BLNA2_LSB) -#define RF2G_RF2G1_BLNA2_SET(x) (((x) << RF2G_RF2G1_BLNA2_LSB) & RF2G_RF2G1_BLNA2_MASK) -#define RF2G_RF2G1_DB_MSB 19 -#define RF2G_RF2G1_DB_LSB 17 -#define RF2G_RF2G1_DB_MASK 0x000e0000 -#define RF2G_RF2G1_DB_GET(x) (((x) & RF2G_RF2G1_DB_MASK) >> RF2G_RF2G1_DB_LSB) -#define RF2G_RF2G1_DB_SET(x) (((x) << RF2G_RF2G1_DB_LSB) & RF2G_RF2G1_DB_MASK) -#define RF2G_RF2G1_OB_MSB 16 -#define RF2G_RF2G1_OB_LSB 14 -#define RF2G_RF2G1_OB_MASK 0x0001c000 -#define RF2G_RF2G1_OB_GET(x) (((x) & RF2G_RF2G1_OB_MASK) >> RF2G_RF2G1_OB_LSB) -#define RF2G_RF2G1_OB_SET(x) (((x) << RF2G_RF2G1_OB_LSB) & RF2G_RF2G1_OB_MASK) -#define RF2G_RF2G1_FE_ATB_SEL_MSB 13 -#define RF2G_RF2G1_FE_ATB_SEL_LSB 11 -#define RF2G_RF2G1_FE_ATB_SEL_MASK 0x00003800 -#define RF2G_RF2G1_FE_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_FE_ATB_SEL_MASK) >> RF2G_RF2G1_FE_ATB_SEL_LSB) -#define RF2G_RF2G1_FE_ATB_SEL_SET(x) (((x) << RF2G_RF2G1_FE_ATB_SEL_LSB) & RF2G_RF2G1_FE_ATB_SEL_MASK) -#define RF2G_RF2G1_RF_ATB_SEL_MSB 10 -#define RF2G_RF2G1_RF_ATB_SEL_LSB 8 -#define RF2G_RF2G1_RF_ATB_SEL_MASK 0x00000700 -#define RF2G_RF2G1_RF_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_RF_ATB_SEL_MASK) >> RF2G_RF2G1_RF_ATB_SEL_LSB) -#define RF2G_RF2G1_RF_ATB_SEL_SET(x) (((x) << RF2G_RF2G1_RF_ATB_SEL_LSB) & RF2G_RF2G1_RF_ATB_SEL_MASK) -#define RF2G_RF2G1_SELLNA_MSB 7 -#define RF2G_RF2G1_SELLNA_LSB 7 -#define RF2G_RF2G1_SELLNA_MASK 0x00000080 -#define RF2G_RF2G1_SELLNA_GET(x) (((x) & RF2G_RF2G1_SELLNA_MASK) >> RF2G_RF2G1_SELLNA_LSB) -#define RF2G_RF2G1_SELLNA_SET(x) (((x) << RF2G_RF2G1_SELLNA_LSB) & RF2G_RF2G1_SELLNA_MASK) -#define RF2G_RF2G1_LOCONTROL_MSB 6 -#define RF2G_RF2G1_LOCONTROL_LSB 6 -#define RF2G_RF2G1_LOCONTROL_MASK 0x00000040 -#define RF2G_RF2G1_LOCONTROL_GET(x) (((x) & RF2G_RF2G1_LOCONTROL_MASK) >> RF2G_RF2G1_LOCONTROL_LSB) -#define RF2G_RF2G1_LOCONTROL_SET(x) (((x) << RF2G_RF2G1_LOCONTROL_LSB) & RF2G_RF2G1_LOCONTROL_MASK) -#define RF2G_RF2G1_SHORTLNA2_MSB 5 -#define RF2G_RF2G1_SHORTLNA2_LSB 5 -#define RF2G_RF2G1_SHORTLNA2_MASK 0x00000020 -#define RF2G_RF2G1_SHORTLNA2_GET(x) (((x) & RF2G_RF2G1_SHORTLNA2_MASK) >> RF2G_RF2G1_SHORTLNA2_LSB) -#define RF2G_RF2G1_SHORTLNA2_SET(x) (((x) << RF2G_RF2G1_SHORTLNA2_LSB) & RF2G_RF2G1_SHORTLNA2_MASK) -#define RF2G_RF2G1_SPARE_MSB 4 -#define RF2G_RF2G1_SPARE_LSB 0 -#define RF2G_RF2G1_SPARE_MASK 0x0000001f -#define RF2G_RF2G1_SPARE_GET(x) (((x) & RF2G_RF2G1_SPARE_MASK) >> RF2G_RF2G1_SPARE_LSB) -#define RF2G_RF2G1_SPARE_SET(x) (((x) << RF2G_RF2G1_SPARE_LSB) & RF2G_RF2G1_SPARE_MASK) - -#define RF2G_RF2G2_ADDRESS 0x00000004 -#define RF2G_RF2G2_OFFSET 0x00000004 -#define RF2G_RF2G2_PDCGLNA_MSB 31 -#define RF2G_RF2G2_PDCGLNA_LSB 31 -#define RF2G_RF2G2_PDCGLNA_MASK 0x80000000 -#define RF2G_RF2G2_PDCGLNA_GET(x) (((x) & RF2G_RF2G2_PDCGLNA_MASK) >> RF2G_RF2G2_PDCGLNA_LSB) -#define RF2G_RF2G2_PDCGLNA_SET(x) (((x) << RF2G_RF2G2_PDCGLNA_LSB) & RF2G_RF2G2_PDCGLNA_MASK) -#define RF2G_RF2G2_PDCGLNABUF_MSB 30 -#define RF2G_RF2G2_PDCGLNABUF_LSB 30 -#define RF2G_RF2G2_PDCGLNABUF_MASK 0x40000000 -#define RF2G_RF2G2_PDCGLNABUF_GET(x) (((x) & RF2G_RF2G2_PDCGLNABUF_MASK) >> RF2G_RF2G2_PDCGLNABUF_LSB) -#define RF2G_RF2G2_PDCGLNABUF_SET(x) (((x) << RF2G_RF2G2_PDCGLNABUF_LSB) & RF2G_RF2G2_PDCGLNABUF_MASK) -#define RF2G_RF2G2_PDCSLNA_MSB 29 -#define RF2G_RF2G2_PDCSLNA_LSB 29 -#define RF2G_RF2G2_PDCSLNA_MASK 0x20000000 -#define RF2G_RF2G2_PDCSLNA_GET(x) (((x) & RF2G_RF2G2_PDCSLNA_MASK) >> RF2G_RF2G2_PDCSLNA_LSB) -#define RF2G_RF2G2_PDCSLNA_SET(x) (((x) << RF2G_RF2G2_PDCSLNA_LSB) & RF2G_RF2G2_PDCSLNA_MASK) -#define RF2G_RF2G2_PDDIV_MSB 28 -#define RF2G_RF2G2_PDDIV_LSB 28 -#define RF2G_RF2G2_PDDIV_MASK 0x10000000 -#define RF2G_RF2G2_PDDIV_GET(x) (((x) & RF2G_RF2G2_PDDIV_MASK) >> RF2G_RF2G2_PDDIV_LSB) -#define RF2G_RF2G2_PDDIV_SET(x) (((x) << RF2G_RF2G2_PDDIV_LSB) & RF2G_RF2G2_PDDIV_MASK) -#define RF2G_RF2G2_PDPADRV_MSB 27 -#define RF2G_RF2G2_PDPADRV_LSB 27 -#define RF2G_RF2G2_PDPADRV_MASK 0x08000000 -#define RF2G_RF2G2_PDPADRV_GET(x) (((x) & RF2G_RF2G2_PDPADRV_MASK) >> RF2G_RF2G2_PDPADRV_LSB) -#define RF2G_RF2G2_PDPADRV_SET(x) (((x) << RF2G_RF2G2_PDPADRV_LSB) & RF2G_RF2G2_PDPADRV_MASK) -#define RF2G_RF2G2_PDPAOUT_MSB 26 -#define RF2G_RF2G2_PDPAOUT_LSB 26 -#define RF2G_RF2G2_PDPAOUT_MASK 0x04000000 -#define RF2G_RF2G2_PDPAOUT_GET(x) (((x) & RF2G_RF2G2_PDPAOUT_MASK) >> RF2G_RF2G2_PDPAOUT_LSB) -#define RF2G_RF2G2_PDPAOUT_SET(x) (((x) << RF2G_RF2G2_PDPAOUT_LSB) & RF2G_RF2G2_PDPAOUT_MASK) -#define RF2G_RF2G2_PDREGLNA_MSB 25 -#define RF2G_RF2G2_PDREGLNA_LSB 25 -#define RF2G_RF2G2_PDREGLNA_MASK 0x02000000 -#define RF2G_RF2G2_PDREGLNA_GET(x) (((x) & RF2G_RF2G2_PDREGLNA_MASK) >> RF2G_RF2G2_PDREGLNA_LSB) -#define RF2G_RF2G2_PDREGLNA_SET(x) (((x) << RF2G_RF2G2_PDREGLNA_LSB) & RF2G_RF2G2_PDREGLNA_MASK) -#define RF2G_RF2G2_PDREGLO_MSB 24 -#define RF2G_RF2G2_PDREGLO_LSB 24 -#define RF2G_RF2G2_PDREGLO_MASK 0x01000000 -#define RF2G_RF2G2_PDREGLO_GET(x) (((x) & RF2G_RF2G2_PDREGLO_MASK) >> RF2G_RF2G2_PDREGLO_LSB) -#define RF2G_RF2G2_PDREGLO_SET(x) (((x) << RF2G_RF2G2_PDREGLO_LSB) & RF2G_RF2G2_PDREGLO_MASK) -#define RF2G_RF2G2_PDRFGM_MSB 23 -#define RF2G_RF2G2_PDRFGM_LSB 23 -#define RF2G_RF2G2_PDRFGM_MASK 0x00800000 -#define RF2G_RF2G2_PDRFGM_GET(x) (((x) & RF2G_RF2G2_PDRFGM_MASK) >> RF2G_RF2G2_PDRFGM_LSB) -#define RF2G_RF2G2_PDRFGM_SET(x) (((x) << RF2G_RF2G2_PDRFGM_LSB) & RF2G_RF2G2_PDRFGM_MASK) -#define RF2G_RF2G2_PDRXLO_MSB 22 -#define RF2G_RF2G2_PDRXLO_LSB 22 -#define RF2G_RF2G2_PDRXLO_MASK 0x00400000 -#define RF2G_RF2G2_PDRXLO_GET(x) (((x) & RF2G_RF2G2_PDRXLO_MASK) >> RF2G_RF2G2_PDRXLO_LSB) -#define RF2G_RF2G2_PDRXLO_SET(x) (((x) << RF2G_RF2G2_PDRXLO_LSB) & RF2G_RF2G2_PDRXLO_MASK) -#define RF2G_RF2G2_PDTXLO_MSB 21 -#define RF2G_RF2G2_PDTXLO_LSB 21 -#define RF2G_RF2G2_PDTXLO_MASK 0x00200000 -#define RF2G_RF2G2_PDTXLO_GET(x) (((x) & RF2G_RF2G2_PDTXLO_MASK) >> RF2G_RF2G2_PDTXLO_LSB) -#define RF2G_RF2G2_PDTXLO_SET(x) (((x) << RF2G_RF2G2_PDTXLO_LSB) & RF2G_RF2G2_PDTXLO_MASK) -#define RF2G_RF2G2_PDTXMIX_MSB 20 -#define RF2G_RF2G2_PDTXMIX_LSB 20 -#define RF2G_RF2G2_PDTXMIX_MASK 0x00100000 -#define RF2G_RF2G2_PDTXMIX_GET(x) (((x) & RF2G_RF2G2_PDTXMIX_MASK) >> RF2G_RF2G2_PDTXMIX_LSB) -#define RF2G_RF2G2_PDTXMIX_SET(x) (((x) << RF2G_RF2G2_PDTXMIX_LSB) & RF2G_RF2G2_PDTXMIX_MASK) -#define RF2G_RF2G2_REGLNA_BYPASS_MSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_LSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_MASK 0x00080000 -#define RF2G_RF2G2_REGLNA_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLNA_BYPASS_MASK) >> RF2G_RF2G2_REGLNA_BYPASS_LSB) -#define RF2G_RF2G2_REGLNA_BYPASS_SET(x) (((x) << RF2G_RF2G2_REGLNA_BYPASS_LSB) & RF2G_RF2G2_REGLNA_BYPASS_MASK) -#define RF2G_RF2G2_REGLO_BYPASS_MSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_LSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_MASK 0x00040000 -#define RF2G_RF2G2_REGLO_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLO_BYPASS_MASK) >> RF2G_RF2G2_REGLO_BYPASS_LSB) -#define RF2G_RF2G2_REGLO_BYPASS_SET(x) (((x) << RF2G_RF2G2_REGLO_BYPASS_LSB) & RF2G_RF2G2_REGLO_BYPASS_MASK) -#define RF2G_RF2G2_ENABLE_PCB_MSB 17 -#define RF2G_RF2G2_ENABLE_PCB_LSB 17 -#define RF2G_RF2G2_ENABLE_PCB_MASK 0x00020000 -#define RF2G_RF2G2_ENABLE_PCB_GET(x) (((x) & RF2G_RF2G2_ENABLE_PCB_MASK) >> RF2G_RF2G2_ENABLE_PCB_LSB) -#define RF2G_RF2G2_ENABLE_PCB_SET(x) (((x) << RF2G_RF2G2_ENABLE_PCB_LSB) & RF2G_RF2G2_ENABLE_PCB_MASK) -#define RF2G_RF2G2_SPARE_MSB 16 -#define RF2G_RF2G2_SPARE_LSB 0 -#define RF2G_RF2G2_SPARE_MASK 0x0001ffff -#define RF2G_RF2G2_SPARE_GET(x) (((x) & RF2G_RF2G2_SPARE_MASK) >> RF2G_RF2G2_SPARE_LSB) -#define RF2G_RF2G2_SPARE_SET(x) (((x) << RF2G_RF2G2_SPARE_LSB) & RF2G_RF2G2_SPARE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct rf2g_reg_reg_s { - volatile unsigned int rf2g_rf2g1; - volatile unsigned int rf2g_rf2g2; -} rf2g_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _RF2G_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf2G_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf2G_reg.vrh deleted file mode 100644 index abcf5f12caf0..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf2G_reg.vrh +++ /dev/null @@ -1,240 +0,0 @@ -#ifndef _RF2G_REG_VRH_ -#define _RF2G_REG_VRH_ - -#define RF2G_RF2G1_ADDRESS 'h00000000 -#define RF2G_RF2G1_BLNA1_MSB 31 -#define RF2G_RF2G1_BLNA1_LSB 29 -#define RF2G_RF2G1_BLNA1_MASK 'he0000000 -#define RF2G_RF2G1_BLNA1_GET(x) (((x) & RF2G_RF2G1_BLNA1_MASK) >> RF2G_RF2G1_BLNA1_LSB) -#define RF2G_RF2G1_BLNA1_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA1_LSB) & RF2G_RF2G1_BLNA1_MASK) -#define RF2G_RF2G1_BLNA1_RESET 3'h3 -#define RF2G_RF2G1_BLNA1F_MSB 28 -#define RF2G_RF2G1_BLNA1F_LSB 26 -#define RF2G_RF2G1_BLNA1F_MASK 'h1c000000 -#define RF2G_RF2G1_BLNA1F_GET(x) (((x) & RF2G_RF2G1_BLNA1F_MASK) >> RF2G_RF2G1_BLNA1F_LSB) -#define RF2G_RF2G1_BLNA1F_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA1F_LSB) & RF2G_RF2G1_BLNA1F_MASK) -#define RF2G_RF2G1_BLNA1F_RESET 3'h0 -#define RF2G_RF2G1_BLNA1BUF_MSB 25 -#define RF2G_RF2G1_BLNA1BUF_LSB 23 -#define RF2G_RF2G1_BLNA1BUF_MASK 'h03800000 -#define RF2G_RF2G1_BLNA1BUF_GET(x) (((x) & RF2G_RF2G1_BLNA1BUF_MASK) >> RF2G_RF2G1_BLNA1BUF_LSB) -#define RF2G_RF2G1_BLNA1BUF_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA1BUF_LSB) & RF2G_RF2G1_BLNA1BUF_MASK) -#define RF2G_RF2G1_BLNA1BUF_RESET 3'h3 -#define RF2G_RF2G1_BLNA2_MSB 22 -#define RF2G_RF2G1_BLNA2_LSB 20 -#define RF2G_RF2G1_BLNA2_MASK 'h00700000 -#define RF2G_RF2G1_BLNA2_GET(x) (((x) & RF2G_RF2G1_BLNA2_MASK) >> RF2G_RF2G1_BLNA2_LSB) -#define RF2G_RF2G1_BLNA2_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_BLNA2_LSB) & RF2G_RF2G1_BLNA2_MASK) -#define RF2G_RF2G1_BLNA2_RESET 3'h3 -#define RF2G_RF2G1_DB_MSB 19 -#define RF2G_RF2G1_DB_LSB 17 -#define RF2G_RF2G1_DB_MASK 'h000e0000 -#define RF2G_RF2G1_DB_GET(x) (((x) & RF2G_RF2G1_DB_MASK) >> RF2G_RF2G1_DB_LSB) -#define RF2G_RF2G1_DB_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_DB_LSB) & RF2G_RF2G1_DB_MASK) -#define RF2G_RF2G1_DB_RESET 3'h3 -#define RF2G_RF2G1_OB_MSB 16 -#define RF2G_RF2G1_OB_LSB 14 -#define RF2G_RF2G1_OB_MASK 'h0001c000 -#define RF2G_RF2G1_OB_GET(x) (((x) & RF2G_RF2G1_OB_MASK) >> RF2G_RF2G1_OB_LSB) -#define RF2G_RF2G1_OB_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_OB_LSB) & RF2G_RF2G1_OB_MASK) -#define RF2G_RF2G1_OB_RESET 3'h3 -#define RF2G_RF2G1_FE_ATB_SEL_MSB 13 -#define RF2G_RF2G1_FE_ATB_SEL_LSB 11 -#define RF2G_RF2G1_FE_ATB_SEL_MASK 'h00003800 -#define RF2G_RF2G1_FE_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_FE_ATB_SEL_MASK) >> RF2G_RF2G1_FE_ATB_SEL_LSB) -#define RF2G_RF2G1_FE_ATB_SEL_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_FE_ATB_SEL_LSB) & RF2G_RF2G1_FE_ATB_SEL_MASK) -#define RF2G_RF2G1_FE_ATB_SEL_RESET 3'h0 -#define RF2G_RF2G1_RF_ATB_SEL_MSB 10 -#define RF2G_RF2G1_RF_ATB_SEL_LSB 8 -#define RF2G_RF2G1_RF_ATB_SEL_MASK 'h00000700 -#define RF2G_RF2G1_RF_ATB_SEL_GET(x) (((x) & RF2G_RF2G1_RF_ATB_SEL_MASK) >> RF2G_RF2G1_RF_ATB_SEL_LSB) -#define RF2G_RF2G1_RF_ATB_SEL_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_RF_ATB_SEL_LSB) & RF2G_RF2G1_RF_ATB_SEL_MASK) -#define RF2G_RF2G1_RF_ATB_SEL_RESET 3'h0 -#define RF2G_RF2G1_SELLNA_MSB 7 -#define RF2G_RF2G1_SELLNA_LSB 7 -#define RF2G_RF2G1_SELLNA_MASK 'h00000080 -#define RF2G_RF2G1_SELLNA_GET(x) (((x) & RF2G_RF2G1_SELLNA_MASK) >> RF2G_RF2G1_SELLNA_LSB) -#define RF2G_RF2G1_SELLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_SELLNA_LSB) & RF2G_RF2G1_SELLNA_MASK) -#define RF2G_RF2G1_SELLNA_RESET 1'h1 -#define RF2G_RF2G1_LOCONTROL_MSB 6 -#define RF2G_RF2G1_LOCONTROL_LSB 6 -#define RF2G_RF2G1_LOCONTROL_MASK 'h00000040 -#define RF2G_RF2G1_LOCONTROL_GET(x) (((x) & RF2G_RF2G1_LOCONTROL_MASK) >> RF2G_RF2G1_LOCONTROL_LSB) -#define RF2G_RF2G1_LOCONTROL_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_LOCONTROL_LSB) & RF2G_RF2G1_LOCONTROL_MASK) -#define RF2G_RF2G1_LOCONTROL_RESET 1'h0 -#define RF2G_RF2G1_SHORTLNA2_MSB 5 -#define RF2G_RF2G1_SHORTLNA2_LSB 5 -#define RF2G_RF2G1_SHORTLNA2_MASK 'h00000020 -#define RF2G_RF2G1_SHORTLNA2_GET(x) (((x) & RF2G_RF2G1_SHORTLNA2_MASK) >> RF2G_RF2G1_SHORTLNA2_LSB) -#define RF2G_RF2G1_SHORTLNA2_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_SHORTLNA2_LSB) & RF2G_RF2G1_SHORTLNA2_MASK) -#define RF2G_RF2G1_SHORTLNA2_RESET 1'h0 -#define RF2G_RF2G1_SPARE_MSB 4 -#define RF2G_RF2G1_SPARE_LSB 0 -#define RF2G_RF2G1_SPARE_MASK 'h0000001f -#define RF2G_RF2G1_SPARE_GET(x) (((x) & RF2G_RF2G1_SPARE_MASK) >> RF2G_RF2G1_SPARE_LSB) -#define RF2G_RF2G1_SPARE_SET(x) (((32'd0 | (x)) << RF2G_RF2G1_SPARE_LSB) & RF2G_RF2G1_SPARE_MASK) -#define RF2G_RF2G1_SPARE_RESET 5'h0 -#define RF2G_RF2G1_RESET (32'h0 | \ - RF2G_RF2G1_BLNA1_SET(RF2G_RF2G1_BLNA1_RESET) | \ - RF2G_RF2G1_BLNA1F_SET(RF2G_RF2G1_BLNA1F_RESET) | \ - RF2G_RF2G1_BLNA1BUF_SET(RF2G_RF2G1_BLNA1BUF_RESET) | \ - RF2G_RF2G1_BLNA2_SET(RF2G_RF2G1_BLNA2_RESET) | \ - RF2G_RF2G1_DB_SET(RF2G_RF2G1_DB_RESET) | \ - RF2G_RF2G1_OB_SET(RF2G_RF2G1_OB_RESET) | \ - RF2G_RF2G1_FE_ATB_SEL_SET(RF2G_RF2G1_FE_ATB_SEL_RESET) | \ - RF2G_RF2G1_RF_ATB_SEL_SET(RF2G_RF2G1_RF_ATB_SEL_RESET) | \ - RF2G_RF2G1_SELLNA_SET(RF2G_RF2G1_SELLNA_RESET) | \ - RF2G_RF2G1_LOCONTROL_SET(RF2G_RF2G1_LOCONTROL_RESET) | \ - RF2G_RF2G1_SHORTLNA2_SET(RF2G_RF2G1_SHORTLNA2_RESET) | \ - RF2G_RF2G1_SPARE_SET(RF2G_RF2G1_SPARE_RESET)) -#define RF2G_RF2G1_HW_MASK (32'h0) -#define RF2G_RF2G1_SW_MASK (32'h0 | \ - RF2G_RF2G1_BLNA1_MASK | \ - RF2G_RF2G1_BLNA1F_MASK | \ - RF2G_RF2G1_BLNA1BUF_MASK | \ - RF2G_RF2G1_BLNA2_MASK | \ - RF2G_RF2G1_DB_MASK | \ - RF2G_RF2G1_OB_MASK | \ - RF2G_RF2G1_FE_ATB_SEL_MASK | \ - RF2G_RF2G1_RF_ATB_SEL_MASK | \ - RF2G_RF2G1_SELLNA_MASK | \ - RF2G_RF2G1_LOCONTROL_MASK | \ - RF2G_RF2G1_SHORTLNA2_MASK | \ - RF2G_RF2G1_SPARE_MASK) - -#define RF2G_RF2G2_ADDRESS 'h00000004 -#define RF2G_RF2G2_PDCGLNA_MSB 31 -#define RF2G_RF2G2_PDCGLNA_LSB 31 -#define RF2G_RF2G2_PDCGLNA_MASK 'h80000000 -#define RF2G_RF2G2_PDCGLNA_GET(x) (((x) & RF2G_RF2G2_PDCGLNA_MASK) >> RF2G_RF2G2_PDCGLNA_LSB) -#define RF2G_RF2G2_PDCGLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDCGLNA_LSB) & RF2G_RF2G2_PDCGLNA_MASK) -#define RF2G_RF2G2_PDCGLNA_RESET 1'h0 -#define RF2G_RF2G2_PDCGLNABUF_MSB 30 -#define RF2G_RF2G2_PDCGLNABUF_LSB 30 -#define RF2G_RF2G2_PDCGLNABUF_MASK 'h40000000 -#define RF2G_RF2G2_PDCGLNABUF_GET(x) (((x) & RF2G_RF2G2_PDCGLNABUF_MASK) >> RF2G_RF2G2_PDCGLNABUF_LSB) -#define RF2G_RF2G2_PDCGLNABUF_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDCGLNABUF_LSB) & RF2G_RF2G2_PDCGLNABUF_MASK) -#define RF2G_RF2G2_PDCGLNABUF_RESET 1'h0 -#define RF2G_RF2G2_PDCSLNA_MSB 29 -#define RF2G_RF2G2_PDCSLNA_LSB 29 -#define RF2G_RF2G2_PDCSLNA_MASK 'h20000000 -#define RF2G_RF2G2_PDCSLNA_GET(x) (((x) & RF2G_RF2G2_PDCSLNA_MASK) >> RF2G_RF2G2_PDCSLNA_LSB) -#define RF2G_RF2G2_PDCSLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDCSLNA_LSB) & RF2G_RF2G2_PDCSLNA_MASK) -#define RF2G_RF2G2_PDCSLNA_RESET 1'h0 -#define RF2G_RF2G2_PDDIV_MSB 28 -#define RF2G_RF2G2_PDDIV_LSB 28 -#define RF2G_RF2G2_PDDIV_MASK 'h10000000 -#define RF2G_RF2G2_PDDIV_GET(x) (((x) & RF2G_RF2G2_PDDIV_MASK) >> RF2G_RF2G2_PDDIV_LSB) -#define RF2G_RF2G2_PDDIV_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDDIV_LSB) & RF2G_RF2G2_PDDIV_MASK) -#define RF2G_RF2G2_PDDIV_RESET 1'h0 -#define RF2G_RF2G2_PDPADRV_MSB 27 -#define RF2G_RF2G2_PDPADRV_LSB 27 -#define RF2G_RF2G2_PDPADRV_MASK 'h08000000 -#define RF2G_RF2G2_PDPADRV_GET(x) (((x) & RF2G_RF2G2_PDPADRV_MASK) >> RF2G_RF2G2_PDPADRV_LSB) -#define RF2G_RF2G2_PDPADRV_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDPADRV_LSB) & RF2G_RF2G2_PDPADRV_MASK) -#define RF2G_RF2G2_PDPADRV_RESET 1'h0 -#define RF2G_RF2G2_PDPAOUT_MSB 26 -#define RF2G_RF2G2_PDPAOUT_LSB 26 -#define RF2G_RF2G2_PDPAOUT_MASK 'h04000000 -#define RF2G_RF2G2_PDPAOUT_GET(x) (((x) & RF2G_RF2G2_PDPAOUT_MASK) >> RF2G_RF2G2_PDPAOUT_LSB) -#define RF2G_RF2G2_PDPAOUT_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDPAOUT_LSB) & RF2G_RF2G2_PDPAOUT_MASK) -#define RF2G_RF2G2_PDPAOUT_RESET 1'h0 -#define RF2G_RF2G2_PDREGLNA_MSB 25 -#define RF2G_RF2G2_PDREGLNA_LSB 25 -#define RF2G_RF2G2_PDREGLNA_MASK 'h02000000 -#define RF2G_RF2G2_PDREGLNA_GET(x) (((x) & RF2G_RF2G2_PDREGLNA_MASK) >> RF2G_RF2G2_PDREGLNA_LSB) -#define RF2G_RF2G2_PDREGLNA_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDREGLNA_LSB) & RF2G_RF2G2_PDREGLNA_MASK) -#define RF2G_RF2G2_PDREGLNA_RESET 1'h0 -#define RF2G_RF2G2_PDREGLO_MSB 24 -#define RF2G_RF2G2_PDREGLO_LSB 24 -#define RF2G_RF2G2_PDREGLO_MASK 'h01000000 -#define RF2G_RF2G2_PDREGLO_GET(x) (((x) & RF2G_RF2G2_PDREGLO_MASK) >> RF2G_RF2G2_PDREGLO_LSB) -#define RF2G_RF2G2_PDREGLO_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDREGLO_LSB) & RF2G_RF2G2_PDREGLO_MASK) -#define RF2G_RF2G2_PDREGLO_RESET 1'h0 -#define RF2G_RF2G2_PDRFGM_MSB 23 -#define RF2G_RF2G2_PDRFGM_LSB 23 -#define RF2G_RF2G2_PDRFGM_MASK 'h00800000 -#define RF2G_RF2G2_PDRFGM_GET(x) (((x) & RF2G_RF2G2_PDRFGM_MASK) >> RF2G_RF2G2_PDRFGM_LSB) -#define RF2G_RF2G2_PDRFGM_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDRFGM_LSB) & RF2G_RF2G2_PDRFGM_MASK) -#define RF2G_RF2G2_PDRFGM_RESET 1'h0 -#define RF2G_RF2G2_PDRXLO_MSB 22 -#define RF2G_RF2G2_PDRXLO_LSB 22 -#define RF2G_RF2G2_PDRXLO_MASK 'h00400000 -#define RF2G_RF2G2_PDRXLO_GET(x) (((x) & RF2G_RF2G2_PDRXLO_MASK) >> RF2G_RF2G2_PDRXLO_LSB) -#define RF2G_RF2G2_PDRXLO_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDRXLO_LSB) & RF2G_RF2G2_PDRXLO_MASK) -#define RF2G_RF2G2_PDRXLO_RESET 1'h0 -#define RF2G_RF2G2_PDTXLO_MSB 21 -#define RF2G_RF2G2_PDTXLO_LSB 21 -#define RF2G_RF2G2_PDTXLO_MASK 'h00200000 -#define RF2G_RF2G2_PDTXLO_GET(x) (((x) & RF2G_RF2G2_PDTXLO_MASK) >> RF2G_RF2G2_PDTXLO_LSB) -#define RF2G_RF2G2_PDTXLO_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDTXLO_LSB) & RF2G_RF2G2_PDTXLO_MASK) -#define RF2G_RF2G2_PDTXLO_RESET 1'h0 -#define RF2G_RF2G2_PDTXMIX_MSB 20 -#define RF2G_RF2G2_PDTXMIX_LSB 20 -#define RF2G_RF2G2_PDTXMIX_MASK 'h00100000 -#define RF2G_RF2G2_PDTXMIX_GET(x) (((x) & RF2G_RF2G2_PDTXMIX_MASK) >> RF2G_RF2G2_PDTXMIX_LSB) -#define RF2G_RF2G2_PDTXMIX_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_PDTXMIX_LSB) & RF2G_RF2G2_PDTXMIX_MASK) -#define RF2G_RF2G2_PDTXMIX_RESET 1'h0 -#define RF2G_RF2G2_REGLNA_BYPASS_MSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_LSB 19 -#define RF2G_RF2G2_REGLNA_BYPASS_MASK 'h00080000 -#define RF2G_RF2G2_REGLNA_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLNA_BYPASS_MASK) >> RF2G_RF2G2_REGLNA_BYPASS_LSB) -#define RF2G_RF2G2_REGLNA_BYPASS_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_REGLNA_BYPASS_LSB) & RF2G_RF2G2_REGLNA_BYPASS_MASK) -#define RF2G_RF2G2_REGLNA_BYPASS_RESET 1'h0 -#define RF2G_RF2G2_REGLO_BYPASS_MSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_LSB 18 -#define RF2G_RF2G2_REGLO_BYPASS_MASK 'h00040000 -#define RF2G_RF2G2_REGLO_BYPASS_GET(x) (((x) & RF2G_RF2G2_REGLO_BYPASS_MASK) >> RF2G_RF2G2_REGLO_BYPASS_LSB) -#define RF2G_RF2G2_REGLO_BYPASS_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_REGLO_BYPASS_LSB) & RF2G_RF2G2_REGLO_BYPASS_MASK) -#define RF2G_RF2G2_REGLO_BYPASS_RESET 1'h0 -#define RF2G_RF2G2_ENABLE_PCB_MSB 17 -#define RF2G_RF2G2_ENABLE_PCB_LSB 17 -#define RF2G_RF2G2_ENABLE_PCB_MASK 'h00020000 -#define RF2G_RF2G2_ENABLE_PCB_GET(x) (((x) & RF2G_RF2G2_ENABLE_PCB_MASK) >> RF2G_RF2G2_ENABLE_PCB_LSB) -#define RF2G_RF2G2_ENABLE_PCB_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_ENABLE_PCB_LSB) & RF2G_RF2G2_ENABLE_PCB_MASK) -#define RF2G_RF2G2_ENABLE_PCB_RESET 1'h0 -#define RF2G_RF2G2_SPARE_MSB 16 -#define RF2G_RF2G2_SPARE_LSB 0 -#define RF2G_RF2G2_SPARE_MASK 'h0001ffff -#define RF2G_RF2G2_SPARE_GET(x) (((x) & RF2G_RF2G2_SPARE_MASK) >> RF2G_RF2G2_SPARE_LSB) -#define RF2G_RF2G2_SPARE_SET(x) (((32'd0 | (x)) << RF2G_RF2G2_SPARE_LSB) & RF2G_RF2G2_SPARE_MASK) -#define RF2G_RF2G2_SPARE_RESET 17'h0 -#define RF2G_RF2G2_RESET (32'h0 | \ - RF2G_RF2G2_PDCGLNA_SET(RF2G_RF2G2_PDCGLNA_RESET) | \ - RF2G_RF2G2_PDCGLNABUF_SET(RF2G_RF2G2_PDCGLNABUF_RESET) | \ - RF2G_RF2G2_PDCSLNA_SET(RF2G_RF2G2_PDCSLNA_RESET) | \ - RF2G_RF2G2_PDDIV_SET(RF2G_RF2G2_PDDIV_RESET) | \ - RF2G_RF2G2_PDPADRV_SET(RF2G_RF2G2_PDPADRV_RESET) | \ - RF2G_RF2G2_PDPAOUT_SET(RF2G_RF2G2_PDPAOUT_RESET) | \ - RF2G_RF2G2_PDREGLNA_SET(RF2G_RF2G2_PDREGLNA_RESET) | \ - RF2G_RF2G2_PDREGLO_SET(RF2G_RF2G2_PDREGLO_RESET) | \ - RF2G_RF2G2_PDRFGM_SET(RF2G_RF2G2_PDRFGM_RESET) | \ - RF2G_RF2G2_PDRXLO_SET(RF2G_RF2G2_PDRXLO_RESET) | \ - RF2G_RF2G2_PDTXLO_SET(RF2G_RF2G2_PDTXLO_RESET) | \ - RF2G_RF2G2_PDTXMIX_SET(RF2G_RF2G2_PDTXMIX_RESET) | \ - RF2G_RF2G2_REGLNA_BYPASS_SET(RF2G_RF2G2_REGLNA_BYPASS_RESET) | \ - RF2G_RF2G2_REGLO_BYPASS_SET(RF2G_RF2G2_REGLO_BYPASS_RESET) | \ - RF2G_RF2G2_ENABLE_PCB_SET(RF2G_RF2G2_ENABLE_PCB_RESET) | \ - RF2G_RF2G2_SPARE_SET(RF2G_RF2G2_SPARE_RESET)) -#define RF2G_RF2G2_HW_MASK (32'h0) -#define RF2G_RF2G2_SW_MASK (32'h0 | \ - RF2G_RF2G2_PDCGLNA_MASK | \ - RF2G_RF2G2_PDCGLNABUF_MASK | \ - RF2G_RF2G2_PDCSLNA_MASK | \ - RF2G_RF2G2_PDDIV_MASK | \ - RF2G_RF2G2_PDPADRV_MASK | \ - RF2G_RF2G2_PDPAOUT_MASK | \ - RF2G_RF2G2_PDREGLNA_MASK | \ - RF2G_RF2G2_PDREGLO_MASK | \ - RF2G_RF2G2_PDRFGM_MASK | \ - RF2G_RF2G2_PDRXLO_MASK | \ - RF2G_RF2G2_PDTXLO_MASK | \ - RF2G_RF2G2_PDTXMIX_MASK | \ - RF2G_RF2G2_REGLNA_BYPASS_MASK | \ - RF2G_RF2G2_REGLO_BYPASS_MASK | \ - RF2G_RF2G2_ENABLE_PCB_MASK | \ - RF2G_RF2G2_SPARE_MASK) - -#define RF2G_REG_ADDRESS_MSB 2 - -#endif /* _RF2G_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf5G_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf5G_reg.h deleted file mode 100644 index 463529e9b62b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf5G_reg.h +++ /dev/null @@ -1,195 +0,0 @@ -#ifndef _RF5G_REG_REG_H_ -#define _RF5G_REG_REG_H_ - -#define RF5G_RF5G1_ADDRESS 0x00000000 -#define RF5G_RF5G1_OFFSET 0x00000000 -#define RF5G_RF5G1_PDTXLO5_MSB 31 -#define RF5G_RF5G1_PDTXLO5_LSB 31 -#define RF5G_RF5G1_PDTXLO5_MASK 0x80000000 -#define RF5G_RF5G1_PDTXLO5_GET(x) (((x) & RF5G_RF5G1_PDTXLO5_MASK) >> RF5G_RF5G1_PDTXLO5_LSB) -#define RF5G_RF5G1_PDTXLO5_SET(x) (((x) << RF5G_RF5G1_PDTXLO5_LSB) & RF5G_RF5G1_PDTXLO5_MASK) -#define RF5G_RF5G1_PDTXMIX5_MSB 30 -#define RF5G_RF5G1_PDTXMIX5_LSB 30 -#define RF5G_RF5G1_PDTXMIX5_MASK 0x40000000 -#define RF5G_RF5G1_PDTXMIX5_GET(x) (((x) & RF5G_RF5G1_PDTXMIX5_MASK) >> RF5G_RF5G1_PDTXMIX5_LSB) -#define RF5G_RF5G1_PDTXMIX5_SET(x) (((x) << RF5G_RF5G1_PDTXMIX5_LSB) & RF5G_RF5G1_PDTXMIX5_MASK) -#define RF5G_RF5G1_PDTXBUF5_MSB 29 -#define RF5G_RF5G1_PDTXBUF5_LSB 29 -#define RF5G_RF5G1_PDTXBUF5_MASK 0x20000000 -#define RF5G_RF5G1_PDTXBUF5_GET(x) (((x) & RF5G_RF5G1_PDTXBUF5_MASK) >> RF5G_RF5G1_PDTXBUF5_LSB) -#define RF5G_RF5G1_PDTXBUF5_SET(x) (((x) << RF5G_RF5G1_PDTXBUF5_LSB) & RF5G_RF5G1_PDTXBUF5_MASK) -#define RF5G_RF5G1_PDPADRV5_MSB 28 -#define RF5G_RF5G1_PDPADRV5_LSB 28 -#define RF5G_RF5G1_PDPADRV5_MASK 0x10000000 -#define RF5G_RF5G1_PDPADRV5_GET(x) (((x) & RF5G_RF5G1_PDPADRV5_MASK) >> RF5G_RF5G1_PDPADRV5_LSB) -#define RF5G_RF5G1_PDPADRV5_SET(x) (((x) << RF5G_RF5G1_PDPADRV5_LSB) & RF5G_RF5G1_PDPADRV5_MASK) -#define RF5G_RF5G1_PDPAOUT5_MSB 27 -#define RF5G_RF5G1_PDPAOUT5_LSB 27 -#define RF5G_RF5G1_PDPAOUT5_MASK 0x08000000 -#define RF5G_RF5G1_PDPAOUT5_GET(x) (((x) & RF5G_RF5G1_PDPAOUT5_MASK) >> RF5G_RF5G1_PDPAOUT5_LSB) -#define RF5G_RF5G1_PDPAOUT5_SET(x) (((x) << RF5G_RF5G1_PDPAOUT5_LSB) & RF5G_RF5G1_PDPAOUT5_MASK) -#define RF5G_RF5G1_TUNE_PADRV5_MSB 26 -#define RF5G_RF5G1_TUNE_PADRV5_LSB 24 -#define RF5G_RF5G1_TUNE_PADRV5_MASK 0x07000000 -#define RF5G_RF5G1_TUNE_PADRV5_GET(x) (((x) & RF5G_RF5G1_TUNE_PADRV5_MASK) >> RF5G_RF5G1_TUNE_PADRV5_LSB) -#define RF5G_RF5G1_TUNE_PADRV5_SET(x) (((x) << RF5G_RF5G1_TUNE_PADRV5_LSB) & RF5G_RF5G1_TUNE_PADRV5_MASK) -#define RF5G_RF5G1_PWDTXPKD_MSB 23 -#define RF5G_RF5G1_PWDTXPKD_LSB 21 -#define RF5G_RF5G1_PWDTXPKD_MASK 0x00e00000 -#define RF5G_RF5G1_PWDTXPKD_GET(x) (((x) & RF5G_RF5G1_PWDTXPKD_MASK) >> RF5G_RF5G1_PWDTXPKD_LSB) -#define RF5G_RF5G1_PWDTXPKD_SET(x) (((x) << RF5G_RF5G1_PWDTXPKD_LSB) & RF5G_RF5G1_PWDTXPKD_MASK) -#define RF5G_RF5G1_DB5_MSB 20 -#define RF5G_RF5G1_DB5_LSB 18 -#define RF5G_RF5G1_DB5_MASK 0x001c0000 -#define RF5G_RF5G1_DB5_GET(x) (((x) & RF5G_RF5G1_DB5_MASK) >> RF5G_RF5G1_DB5_LSB) -#define RF5G_RF5G1_DB5_SET(x) (((x) << RF5G_RF5G1_DB5_LSB) & RF5G_RF5G1_DB5_MASK) -#define RF5G_RF5G1_OB5_MSB 17 -#define RF5G_RF5G1_OB5_LSB 15 -#define RF5G_RF5G1_OB5_MASK 0x00038000 -#define RF5G_RF5G1_OB5_GET(x) (((x) & RF5G_RF5G1_OB5_MASK) >> RF5G_RF5G1_OB5_LSB) -#define RF5G_RF5G1_OB5_SET(x) (((x) << RF5G_RF5G1_OB5_LSB) & RF5G_RF5G1_OB5_MASK) -#define RF5G_RF5G1_TX5_ATB_SEL_MSB 14 -#define RF5G_RF5G1_TX5_ATB_SEL_LSB 12 -#define RF5G_RF5G1_TX5_ATB_SEL_MASK 0x00007000 -#define RF5G_RF5G1_TX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_TX5_ATB_SEL_MASK) >> RF5G_RF5G1_TX5_ATB_SEL_LSB) -#define RF5G_RF5G1_TX5_ATB_SEL_SET(x) (((x) << RF5G_RF5G1_TX5_ATB_SEL_LSB) & RF5G_RF5G1_TX5_ATB_SEL_MASK) -#define RF5G_RF5G1_PDLO5DIV_MSB 11 -#define RF5G_RF5G1_PDLO5DIV_LSB 11 -#define RF5G_RF5G1_PDLO5DIV_MASK 0x00000800 -#define RF5G_RF5G1_PDLO5DIV_GET(x) (((x) & RF5G_RF5G1_PDLO5DIV_MASK) >> RF5G_RF5G1_PDLO5DIV_LSB) -#define RF5G_RF5G1_PDLO5DIV_SET(x) (((x) << RF5G_RF5G1_PDLO5DIV_LSB) & RF5G_RF5G1_PDLO5DIV_MASK) -#define RF5G_RF5G1_PDLO5MIX_MSB 10 -#define RF5G_RF5G1_PDLO5MIX_LSB 10 -#define RF5G_RF5G1_PDLO5MIX_MASK 0x00000400 -#define RF5G_RF5G1_PDLO5MIX_GET(x) (((x) & RF5G_RF5G1_PDLO5MIX_MASK) >> RF5G_RF5G1_PDLO5MIX_LSB) -#define RF5G_RF5G1_PDLO5MIX_SET(x) (((x) << RF5G_RF5G1_PDLO5MIX_LSB) & RF5G_RF5G1_PDLO5MIX_MASK) -#define RF5G_RF5G1_PDQBUF5_MSB 9 -#define RF5G_RF5G1_PDQBUF5_LSB 9 -#define RF5G_RF5G1_PDQBUF5_MASK 0x00000200 -#define RF5G_RF5G1_PDQBUF5_GET(x) (((x) & RF5G_RF5G1_PDQBUF5_MASK) >> RF5G_RF5G1_PDQBUF5_LSB) -#define RF5G_RF5G1_PDQBUF5_SET(x) (((x) << RF5G_RF5G1_PDQBUF5_LSB) & RF5G_RF5G1_PDQBUF5_MASK) -#define RF5G_RF5G1_PDLO5AGC_MSB 8 -#define RF5G_RF5G1_PDLO5AGC_LSB 8 -#define RF5G_RF5G1_PDLO5AGC_MASK 0x00000100 -#define RF5G_RF5G1_PDLO5AGC_GET(x) (((x) & RF5G_RF5G1_PDLO5AGC_MASK) >> RF5G_RF5G1_PDLO5AGC_LSB) -#define RF5G_RF5G1_PDLO5AGC_SET(x) (((x) << RF5G_RF5G1_PDLO5AGC_LSB) & RF5G_RF5G1_PDLO5AGC_MASK) -#define RF5G_RF5G1_PDREGLO5_MSB 7 -#define RF5G_RF5G1_PDREGLO5_LSB 7 -#define RF5G_RF5G1_PDREGLO5_MASK 0x00000080 -#define RF5G_RF5G1_PDREGLO5_GET(x) (((x) & RF5G_RF5G1_PDREGLO5_MASK) >> RF5G_RF5G1_PDREGLO5_LSB) -#define RF5G_RF5G1_PDREGLO5_SET(x) (((x) << RF5G_RF5G1_PDREGLO5_LSB) & RF5G_RF5G1_PDREGLO5_MASK) -#define RF5G_RF5G1_LO5_ATB_SEL_MSB 6 -#define RF5G_RF5G1_LO5_ATB_SEL_LSB 4 -#define RF5G_RF5G1_LO5_ATB_SEL_MASK 0x00000070 -#define RF5G_RF5G1_LO5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_LO5_ATB_SEL_MASK) >> RF5G_RF5G1_LO5_ATB_SEL_LSB) -#define RF5G_RF5G1_LO5_ATB_SEL_SET(x) (((x) << RF5G_RF5G1_LO5_ATB_SEL_LSB) & RF5G_RF5G1_LO5_ATB_SEL_MASK) -#define RF5G_RF5G1_LO5CONTROL_MSB 3 -#define RF5G_RF5G1_LO5CONTROL_LSB 3 -#define RF5G_RF5G1_LO5CONTROL_MASK 0x00000008 -#define RF5G_RF5G1_LO5CONTROL_GET(x) (((x) & RF5G_RF5G1_LO5CONTROL_MASK) >> RF5G_RF5G1_LO5CONTROL_LSB) -#define RF5G_RF5G1_LO5CONTROL_SET(x) (((x) << RF5G_RF5G1_LO5CONTROL_LSB) & RF5G_RF5G1_LO5CONTROL_MASK) -#define RF5G_RF5G1_REGLO_BYPASS5_MSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_LSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_MASK 0x00000004 -#define RF5G_RF5G1_REGLO_BYPASS5_GET(x) (((x) & RF5G_RF5G1_REGLO_BYPASS5_MASK) >> RF5G_RF5G1_REGLO_BYPASS5_LSB) -#define RF5G_RF5G1_REGLO_BYPASS5_SET(x) (((x) << RF5G_RF5G1_REGLO_BYPASS5_LSB) & RF5G_RF5G1_REGLO_BYPASS5_MASK) -#define RF5G_RF5G1_SPARE_MSB 1 -#define RF5G_RF5G1_SPARE_LSB 0 -#define RF5G_RF5G1_SPARE_MASK 0x00000003 -#define RF5G_RF5G1_SPARE_GET(x) (((x) & RF5G_RF5G1_SPARE_MASK) >> RF5G_RF5G1_SPARE_LSB) -#define RF5G_RF5G1_SPARE_SET(x) (((x) << RF5G_RF5G1_SPARE_LSB) & RF5G_RF5G1_SPARE_MASK) - -#define RF5G_RF5G2_ADDRESS 0x00000004 -#define RF5G_RF5G2_OFFSET 0x00000004 -#define RF5G_RF5G2_AGCLO_B_MSB 31 -#define RF5G_RF5G2_AGCLO_B_LSB 29 -#define RF5G_RF5G2_AGCLO_B_MASK 0xe0000000 -#define RF5G_RF5G2_AGCLO_B_GET(x) (((x) & RF5G_RF5G2_AGCLO_B_MASK) >> RF5G_RF5G2_AGCLO_B_LSB) -#define RF5G_RF5G2_AGCLO_B_SET(x) (((x) << RF5G_RF5G2_AGCLO_B_LSB) & RF5G_RF5G2_AGCLO_B_MASK) -#define RF5G_RF5G2_RX5_ATB_SEL_MSB 28 -#define RF5G_RF5G2_RX5_ATB_SEL_LSB 26 -#define RF5G_RF5G2_RX5_ATB_SEL_MASK 0x1c000000 -#define RF5G_RF5G2_RX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G2_RX5_ATB_SEL_MASK) >> RF5G_RF5G2_RX5_ATB_SEL_LSB) -#define RF5G_RF5G2_RX5_ATB_SEL_SET(x) (((x) << RF5G_RF5G2_RX5_ATB_SEL_LSB) & RF5G_RF5G2_RX5_ATB_SEL_MASK) -#define RF5G_RF5G2_PDCMOSLO5_MSB 25 -#define RF5G_RF5G2_PDCMOSLO5_LSB 25 -#define RF5G_RF5G2_PDCMOSLO5_MASK 0x02000000 -#define RF5G_RF5G2_PDCMOSLO5_GET(x) (((x) & RF5G_RF5G2_PDCMOSLO5_MASK) >> RF5G_RF5G2_PDCMOSLO5_LSB) -#define RF5G_RF5G2_PDCMOSLO5_SET(x) (((x) << RF5G_RF5G2_PDCMOSLO5_LSB) & RF5G_RF5G2_PDCMOSLO5_MASK) -#define RF5G_RF5G2_PDVGM5_MSB 24 -#define RF5G_RF5G2_PDVGM5_LSB 24 -#define RF5G_RF5G2_PDVGM5_MASK 0x01000000 -#define RF5G_RF5G2_PDVGM5_GET(x) (((x) & RF5G_RF5G2_PDVGM5_MASK) >> RF5G_RF5G2_PDVGM5_LSB) -#define RF5G_RF5G2_PDVGM5_SET(x) (((x) << RF5G_RF5G2_PDVGM5_LSB) & RF5G_RF5G2_PDVGM5_MASK) -#define RF5G_RF5G2_PDCSLNA5_MSB 23 -#define RF5G_RF5G2_PDCSLNA5_LSB 23 -#define RF5G_RF5G2_PDCSLNA5_MASK 0x00800000 -#define RF5G_RF5G2_PDCSLNA5_GET(x) (((x) & RF5G_RF5G2_PDCSLNA5_MASK) >> RF5G_RF5G2_PDCSLNA5_LSB) -#define RF5G_RF5G2_PDCSLNA5_SET(x) (((x) << RF5G_RF5G2_PDCSLNA5_LSB) & RF5G_RF5G2_PDCSLNA5_MASK) -#define RF5G_RF5G2_PDRFVGA5_MSB 22 -#define RF5G_RF5G2_PDRFVGA5_LSB 22 -#define RF5G_RF5G2_PDRFVGA5_MASK 0x00400000 -#define RF5G_RF5G2_PDRFVGA5_GET(x) (((x) & RF5G_RF5G2_PDRFVGA5_MASK) >> RF5G_RF5G2_PDRFVGA5_LSB) -#define RF5G_RF5G2_PDRFVGA5_SET(x) (((x) << RF5G_RF5G2_PDRFVGA5_LSB) & RF5G_RF5G2_PDRFVGA5_MASK) -#define RF5G_RF5G2_PDREGFE5_MSB 21 -#define RF5G_RF5G2_PDREGFE5_LSB 21 -#define RF5G_RF5G2_PDREGFE5_MASK 0x00200000 -#define RF5G_RF5G2_PDREGFE5_GET(x) (((x) & RF5G_RF5G2_PDREGFE5_MASK) >> RF5G_RF5G2_PDREGFE5_LSB) -#define RF5G_RF5G2_PDREGFE5_SET(x) (((x) << RF5G_RF5G2_PDREGFE5_LSB) & RF5G_RF5G2_PDREGFE5_MASK) -#define RF5G_RF5G2_TUNE_RFVGA5_MSB 20 -#define RF5G_RF5G2_TUNE_RFVGA5_LSB 18 -#define RF5G_RF5G2_TUNE_RFVGA5_MASK 0x001c0000 -#define RF5G_RF5G2_TUNE_RFVGA5_GET(x) (((x) & RF5G_RF5G2_TUNE_RFVGA5_MASK) >> RF5G_RF5G2_TUNE_RFVGA5_LSB) -#define RF5G_RF5G2_TUNE_RFVGA5_SET(x) (((x) << RF5G_RF5G2_TUNE_RFVGA5_LSB) & RF5G_RF5G2_TUNE_RFVGA5_MASK) -#define RF5G_RF5G2_BRFVGA5_MSB 17 -#define RF5G_RF5G2_BRFVGA5_LSB 15 -#define RF5G_RF5G2_BRFVGA5_MASK 0x00038000 -#define RF5G_RF5G2_BRFVGA5_GET(x) (((x) & RF5G_RF5G2_BRFVGA5_MASK) >> RF5G_RF5G2_BRFVGA5_LSB) -#define RF5G_RF5G2_BRFVGA5_SET(x) (((x) << RF5G_RF5G2_BRFVGA5_LSB) & RF5G_RF5G2_BRFVGA5_MASK) -#define RF5G_RF5G2_BCSLNA5_MSB 14 -#define RF5G_RF5G2_BCSLNA5_LSB 12 -#define RF5G_RF5G2_BCSLNA5_MASK 0x00007000 -#define RF5G_RF5G2_BCSLNA5_GET(x) (((x) & RF5G_RF5G2_BCSLNA5_MASK) >> RF5G_RF5G2_BCSLNA5_LSB) -#define RF5G_RF5G2_BCSLNA5_SET(x) (((x) << RF5G_RF5G2_BCSLNA5_LSB) & RF5G_RF5G2_BCSLNA5_MASK) -#define RF5G_RF5G2_BVGM5_MSB 11 -#define RF5G_RF5G2_BVGM5_LSB 9 -#define RF5G_RF5G2_BVGM5_MASK 0x00000e00 -#define RF5G_RF5G2_BVGM5_GET(x) (((x) & RF5G_RF5G2_BVGM5_MASK) >> RF5G_RF5G2_BVGM5_LSB) -#define RF5G_RF5G2_BVGM5_SET(x) (((x) << RF5G_RF5G2_BVGM5_LSB) & RF5G_RF5G2_BVGM5_MASK) -#define RF5G_RF5G2_REGFE_BYPASS5_MSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_LSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_MASK 0x00000100 -#define RF5G_RF5G2_REGFE_BYPASS5_GET(x) (((x) & RF5G_RF5G2_REGFE_BYPASS5_MASK) >> RF5G_RF5G2_REGFE_BYPASS5_LSB) -#define RF5G_RF5G2_REGFE_BYPASS5_SET(x) (((x) << RF5G_RF5G2_REGFE_BYPASS5_LSB) & RF5G_RF5G2_REGFE_BYPASS5_MASK) -#define RF5G_RF5G2_LNA5_ATTENMODE_MSB 7 -#define RF5G_RF5G2_LNA5_ATTENMODE_LSB 6 -#define RF5G_RF5G2_LNA5_ATTENMODE_MASK 0x000000c0 -#define RF5G_RF5G2_LNA5_ATTENMODE_GET(x) (((x) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) >> RF5G_RF5G2_LNA5_ATTENMODE_LSB) -#define RF5G_RF5G2_LNA5_ATTENMODE_SET(x) (((x) << RF5G_RF5G2_LNA5_ATTENMODE_LSB) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) -#define RF5G_RF5G2_ENABLE_PCA_MSB 5 -#define RF5G_RF5G2_ENABLE_PCA_LSB 5 -#define RF5G_RF5G2_ENABLE_PCA_MASK 0x00000020 -#define RF5G_RF5G2_ENABLE_PCA_GET(x) (((x) & RF5G_RF5G2_ENABLE_PCA_MASK) >> RF5G_RF5G2_ENABLE_PCA_LSB) -#define RF5G_RF5G2_ENABLE_PCA_SET(x) (((x) << RF5G_RF5G2_ENABLE_PCA_LSB) & RF5G_RF5G2_ENABLE_PCA_MASK) -#define RF5G_RF5G2_TUNE_LO_MSB 4 -#define RF5G_RF5G2_TUNE_LO_LSB 2 -#define RF5G_RF5G2_TUNE_LO_MASK 0x0000001c -#define RF5G_RF5G2_TUNE_LO_GET(x) (((x) & RF5G_RF5G2_TUNE_LO_MASK) >> RF5G_RF5G2_TUNE_LO_LSB) -#define RF5G_RF5G2_TUNE_LO_SET(x) (((x) << RF5G_RF5G2_TUNE_LO_LSB) & RF5G_RF5G2_TUNE_LO_MASK) -#define RF5G_RF5G2_SPARE_MSB 1 -#define RF5G_RF5G2_SPARE_LSB 0 -#define RF5G_RF5G2_SPARE_MASK 0x00000003 -#define RF5G_RF5G2_SPARE_GET(x) (((x) & RF5G_RF5G2_SPARE_MASK) >> RF5G_RF5G2_SPARE_LSB) -#define RF5G_RF5G2_SPARE_SET(x) (((x) << RF5G_RF5G2_SPARE_LSB) & RF5G_RF5G2_SPARE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct rf5g_reg_reg_s { - volatile unsigned int rf5g_rf5g1; - volatile unsigned int rf5g_rf5g2; -} rf5g_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _RF5G_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf5G_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf5G_reg.vrh deleted file mode 100644 index 6627936f3063..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rf5G_reg.vrh +++ /dev/null @@ -1,296 +0,0 @@ -#ifndef _RF5G_REG_VRH_ -#define _RF5G_REG_VRH_ - -#define RF5G_RF5G1_ADDRESS 'h00000000 -#define RF5G_RF5G1_PDTXLO5_MSB 31 -#define RF5G_RF5G1_PDTXLO5_LSB 31 -#define RF5G_RF5G1_PDTXLO5_MASK 'h80000000 -#define RF5G_RF5G1_PDTXLO5_GET(x) (((x) & RF5G_RF5G1_PDTXLO5_MASK) >> RF5G_RF5G1_PDTXLO5_LSB) -#define RF5G_RF5G1_PDTXLO5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDTXLO5_LSB) & RF5G_RF5G1_PDTXLO5_MASK) -#define RF5G_RF5G1_PDTXLO5_RESET 1'h0 -#define RF5G_RF5G1_PDTXMIX5_MSB 30 -#define RF5G_RF5G1_PDTXMIX5_LSB 30 -#define RF5G_RF5G1_PDTXMIX5_MASK 'h40000000 -#define RF5G_RF5G1_PDTXMIX5_GET(x) (((x) & RF5G_RF5G1_PDTXMIX5_MASK) >> RF5G_RF5G1_PDTXMIX5_LSB) -#define RF5G_RF5G1_PDTXMIX5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDTXMIX5_LSB) & RF5G_RF5G1_PDTXMIX5_MASK) -#define RF5G_RF5G1_PDTXMIX5_RESET 1'h0 -#define RF5G_RF5G1_PDTXBUF5_MSB 29 -#define RF5G_RF5G1_PDTXBUF5_LSB 29 -#define RF5G_RF5G1_PDTXBUF5_MASK 'h20000000 -#define RF5G_RF5G1_PDTXBUF5_GET(x) (((x) & RF5G_RF5G1_PDTXBUF5_MASK) >> RF5G_RF5G1_PDTXBUF5_LSB) -#define RF5G_RF5G1_PDTXBUF5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDTXBUF5_LSB) & RF5G_RF5G1_PDTXBUF5_MASK) -#define RF5G_RF5G1_PDTXBUF5_RESET 1'h0 -#define RF5G_RF5G1_PDPADRV5_MSB 28 -#define RF5G_RF5G1_PDPADRV5_LSB 28 -#define RF5G_RF5G1_PDPADRV5_MASK 'h10000000 -#define RF5G_RF5G1_PDPADRV5_GET(x) (((x) & RF5G_RF5G1_PDPADRV5_MASK) >> RF5G_RF5G1_PDPADRV5_LSB) -#define RF5G_RF5G1_PDPADRV5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDPADRV5_LSB) & RF5G_RF5G1_PDPADRV5_MASK) -#define RF5G_RF5G1_PDPADRV5_RESET 1'h0 -#define RF5G_RF5G1_PDPAOUT5_MSB 27 -#define RF5G_RF5G1_PDPAOUT5_LSB 27 -#define RF5G_RF5G1_PDPAOUT5_MASK 'h08000000 -#define RF5G_RF5G1_PDPAOUT5_GET(x) (((x) & RF5G_RF5G1_PDPAOUT5_MASK) >> RF5G_RF5G1_PDPAOUT5_LSB) -#define RF5G_RF5G1_PDPAOUT5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDPAOUT5_LSB) & RF5G_RF5G1_PDPAOUT5_MASK) -#define RF5G_RF5G1_PDPAOUT5_RESET 1'h0 -#define RF5G_RF5G1_TUNE_PADRV5_MSB 26 -#define RF5G_RF5G1_TUNE_PADRV5_LSB 24 -#define RF5G_RF5G1_TUNE_PADRV5_MASK 'h07000000 -#define RF5G_RF5G1_TUNE_PADRV5_GET(x) (((x) & RF5G_RF5G1_TUNE_PADRV5_MASK) >> RF5G_RF5G1_TUNE_PADRV5_LSB) -#define RF5G_RF5G1_TUNE_PADRV5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_TUNE_PADRV5_LSB) & RF5G_RF5G1_TUNE_PADRV5_MASK) -#define RF5G_RF5G1_TUNE_PADRV5_RESET 3'h0 -#define RF5G_RF5G1_PWDTXPKD_MSB 23 -#define RF5G_RF5G1_PWDTXPKD_LSB 21 -#define RF5G_RF5G1_PWDTXPKD_MASK 'h00e00000 -#define RF5G_RF5G1_PWDTXPKD_GET(x) (((x) & RF5G_RF5G1_PWDTXPKD_MASK) >> RF5G_RF5G1_PWDTXPKD_LSB) -#define RF5G_RF5G1_PWDTXPKD_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PWDTXPKD_LSB) & RF5G_RF5G1_PWDTXPKD_MASK) -#define RF5G_RF5G1_PWDTXPKD_RESET 3'h7 -#define RF5G_RF5G1_DB5_MSB 20 -#define RF5G_RF5G1_DB5_LSB 18 -#define RF5G_RF5G1_DB5_MASK 'h001c0000 -#define RF5G_RF5G1_DB5_GET(x) (((x) & RF5G_RF5G1_DB5_MASK) >> RF5G_RF5G1_DB5_LSB) -#define RF5G_RF5G1_DB5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_DB5_LSB) & RF5G_RF5G1_DB5_MASK) -#define RF5G_RF5G1_DB5_RESET 3'h4 -#define RF5G_RF5G1_OB5_MSB 17 -#define RF5G_RF5G1_OB5_LSB 15 -#define RF5G_RF5G1_OB5_MASK 'h00038000 -#define RF5G_RF5G1_OB5_GET(x) (((x) & RF5G_RF5G1_OB5_MASK) >> RF5G_RF5G1_OB5_LSB) -#define RF5G_RF5G1_OB5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_OB5_LSB) & RF5G_RF5G1_OB5_MASK) -#define RF5G_RF5G1_OB5_RESET 3'h4 -#define RF5G_RF5G1_TX5_ATB_SEL_MSB 14 -#define RF5G_RF5G1_TX5_ATB_SEL_LSB 12 -#define RF5G_RF5G1_TX5_ATB_SEL_MASK 'h00007000 -#define RF5G_RF5G1_TX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_TX5_ATB_SEL_MASK) >> RF5G_RF5G1_TX5_ATB_SEL_LSB) -#define RF5G_RF5G1_TX5_ATB_SEL_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_TX5_ATB_SEL_LSB) & RF5G_RF5G1_TX5_ATB_SEL_MASK) -#define RF5G_RF5G1_TX5_ATB_SEL_RESET 3'h0 -#define RF5G_RF5G1_PDLO5DIV_MSB 11 -#define RF5G_RF5G1_PDLO5DIV_LSB 11 -#define RF5G_RF5G1_PDLO5DIV_MASK 'h00000800 -#define RF5G_RF5G1_PDLO5DIV_GET(x) (((x) & RF5G_RF5G1_PDLO5DIV_MASK) >> RF5G_RF5G1_PDLO5DIV_LSB) -#define RF5G_RF5G1_PDLO5DIV_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDLO5DIV_LSB) & RF5G_RF5G1_PDLO5DIV_MASK) -#define RF5G_RF5G1_PDLO5DIV_RESET 1'h0 -#define RF5G_RF5G1_PDLO5MIX_MSB 10 -#define RF5G_RF5G1_PDLO5MIX_LSB 10 -#define RF5G_RF5G1_PDLO5MIX_MASK 'h00000400 -#define RF5G_RF5G1_PDLO5MIX_GET(x) (((x) & RF5G_RF5G1_PDLO5MIX_MASK) >> RF5G_RF5G1_PDLO5MIX_LSB) -#define RF5G_RF5G1_PDLO5MIX_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDLO5MIX_LSB) & RF5G_RF5G1_PDLO5MIX_MASK) -#define RF5G_RF5G1_PDLO5MIX_RESET 1'h0 -#define RF5G_RF5G1_PDQBUF5_MSB 9 -#define RF5G_RF5G1_PDQBUF5_LSB 9 -#define RF5G_RF5G1_PDQBUF5_MASK 'h00000200 -#define RF5G_RF5G1_PDQBUF5_GET(x) (((x) & RF5G_RF5G1_PDQBUF5_MASK) >> RF5G_RF5G1_PDQBUF5_LSB) -#define RF5G_RF5G1_PDQBUF5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDQBUF5_LSB) & RF5G_RF5G1_PDQBUF5_MASK) -#define RF5G_RF5G1_PDQBUF5_RESET 1'h0 -#define RF5G_RF5G1_PDLO5AGC_MSB 8 -#define RF5G_RF5G1_PDLO5AGC_LSB 8 -#define RF5G_RF5G1_PDLO5AGC_MASK 'h00000100 -#define RF5G_RF5G1_PDLO5AGC_GET(x) (((x) & RF5G_RF5G1_PDLO5AGC_MASK) >> RF5G_RF5G1_PDLO5AGC_LSB) -#define RF5G_RF5G1_PDLO5AGC_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDLO5AGC_LSB) & RF5G_RF5G1_PDLO5AGC_MASK) -#define RF5G_RF5G1_PDLO5AGC_RESET 1'h0 -#define RF5G_RF5G1_PDREGLO5_MSB 7 -#define RF5G_RF5G1_PDREGLO5_LSB 7 -#define RF5G_RF5G1_PDREGLO5_MASK 'h00000080 -#define RF5G_RF5G1_PDREGLO5_GET(x) (((x) & RF5G_RF5G1_PDREGLO5_MASK) >> RF5G_RF5G1_PDREGLO5_LSB) -#define RF5G_RF5G1_PDREGLO5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_PDREGLO5_LSB) & RF5G_RF5G1_PDREGLO5_MASK) -#define RF5G_RF5G1_PDREGLO5_RESET 1'h0 -#define RF5G_RF5G1_LO5_ATB_SEL_MSB 6 -#define RF5G_RF5G1_LO5_ATB_SEL_LSB 4 -#define RF5G_RF5G1_LO5_ATB_SEL_MASK 'h00000070 -#define RF5G_RF5G1_LO5_ATB_SEL_GET(x) (((x) & RF5G_RF5G1_LO5_ATB_SEL_MASK) >> RF5G_RF5G1_LO5_ATB_SEL_LSB) -#define RF5G_RF5G1_LO5_ATB_SEL_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_LO5_ATB_SEL_LSB) & RF5G_RF5G1_LO5_ATB_SEL_MASK) -#define RF5G_RF5G1_LO5_ATB_SEL_RESET 3'h0 -#define RF5G_RF5G1_LO5CONTROL_MSB 3 -#define RF5G_RF5G1_LO5CONTROL_LSB 3 -#define RF5G_RF5G1_LO5CONTROL_MASK 'h00000008 -#define RF5G_RF5G1_LO5CONTROL_GET(x) (((x) & RF5G_RF5G1_LO5CONTROL_MASK) >> RF5G_RF5G1_LO5CONTROL_LSB) -#define RF5G_RF5G1_LO5CONTROL_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_LO5CONTROL_LSB) & RF5G_RF5G1_LO5CONTROL_MASK) -#define RF5G_RF5G1_LO5CONTROL_RESET 1'h0 -#define RF5G_RF5G1_REGLO_BYPASS5_MSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_LSB 2 -#define RF5G_RF5G1_REGLO_BYPASS5_MASK 'h00000004 -#define RF5G_RF5G1_REGLO_BYPASS5_GET(x) (((x) & RF5G_RF5G1_REGLO_BYPASS5_MASK) >> RF5G_RF5G1_REGLO_BYPASS5_LSB) -#define RF5G_RF5G1_REGLO_BYPASS5_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_REGLO_BYPASS5_LSB) & RF5G_RF5G1_REGLO_BYPASS5_MASK) -#define RF5G_RF5G1_REGLO_BYPASS5_RESET 1'h0 -#define RF5G_RF5G1_SPARE_MSB 1 -#define RF5G_RF5G1_SPARE_LSB 0 -#define RF5G_RF5G1_SPARE_MASK 'h00000003 -#define RF5G_RF5G1_SPARE_GET(x) (((x) & RF5G_RF5G1_SPARE_MASK) >> RF5G_RF5G1_SPARE_LSB) -#define RF5G_RF5G1_SPARE_SET(x) (((32'd0 | (x)) << RF5G_RF5G1_SPARE_LSB) & RF5G_RF5G1_SPARE_MASK) -#define RF5G_RF5G1_SPARE_RESET 2'h0 -#define RF5G_RF5G1_RESET (32'h0 | \ - RF5G_RF5G1_PDTXLO5_SET(RF5G_RF5G1_PDTXLO5_RESET) | \ - RF5G_RF5G1_PDTXMIX5_SET(RF5G_RF5G1_PDTXMIX5_RESET) | \ - RF5G_RF5G1_PDTXBUF5_SET(RF5G_RF5G1_PDTXBUF5_RESET) | \ - RF5G_RF5G1_PDPADRV5_SET(RF5G_RF5G1_PDPADRV5_RESET) | \ - RF5G_RF5G1_PDPAOUT5_SET(RF5G_RF5G1_PDPAOUT5_RESET) | \ - RF5G_RF5G1_TUNE_PADRV5_SET(RF5G_RF5G1_TUNE_PADRV5_RESET) | \ - RF5G_RF5G1_PWDTXPKD_SET(RF5G_RF5G1_PWDTXPKD_RESET) | \ - RF5G_RF5G1_DB5_SET(RF5G_RF5G1_DB5_RESET) | \ - RF5G_RF5G1_OB5_SET(RF5G_RF5G1_OB5_RESET) | \ - RF5G_RF5G1_TX5_ATB_SEL_SET(RF5G_RF5G1_TX5_ATB_SEL_RESET) | \ - RF5G_RF5G1_PDLO5DIV_SET(RF5G_RF5G1_PDLO5DIV_RESET) | \ - RF5G_RF5G1_PDLO5MIX_SET(RF5G_RF5G1_PDLO5MIX_RESET) | \ - RF5G_RF5G1_PDQBUF5_SET(RF5G_RF5G1_PDQBUF5_RESET) | \ - RF5G_RF5G1_PDLO5AGC_SET(RF5G_RF5G1_PDLO5AGC_RESET) | \ - RF5G_RF5G1_PDREGLO5_SET(RF5G_RF5G1_PDREGLO5_RESET) | \ - RF5G_RF5G1_LO5_ATB_SEL_SET(RF5G_RF5G1_LO5_ATB_SEL_RESET) | \ - RF5G_RF5G1_LO5CONTROL_SET(RF5G_RF5G1_LO5CONTROL_RESET) | \ - RF5G_RF5G1_REGLO_BYPASS5_SET(RF5G_RF5G1_REGLO_BYPASS5_RESET) | \ - RF5G_RF5G1_SPARE_SET(RF5G_RF5G1_SPARE_RESET)) -#define RF5G_RF5G1_HW_MASK (32'h0) -#define RF5G_RF5G1_SW_MASK (32'h0 | \ - RF5G_RF5G1_PDTXLO5_MASK | \ - RF5G_RF5G1_PDTXMIX5_MASK | \ - RF5G_RF5G1_PDTXBUF5_MASK | \ - RF5G_RF5G1_PDPADRV5_MASK | \ - RF5G_RF5G1_PDPAOUT5_MASK | \ - RF5G_RF5G1_TUNE_PADRV5_MASK | \ - RF5G_RF5G1_PWDTXPKD_MASK | \ - RF5G_RF5G1_DB5_MASK | \ - RF5G_RF5G1_OB5_MASK | \ - RF5G_RF5G1_TX5_ATB_SEL_MASK | \ - RF5G_RF5G1_PDLO5DIV_MASK | \ - RF5G_RF5G1_PDLO5MIX_MASK | \ - RF5G_RF5G1_PDQBUF5_MASK | \ - RF5G_RF5G1_PDLO5AGC_MASK | \ - RF5G_RF5G1_PDREGLO5_MASK | \ - RF5G_RF5G1_LO5_ATB_SEL_MASK | \ - RF5G_RF5G1_LO5CONTROL_MASK | \ - RF5G_RF5G1_REGLO_BYPASS5_MASK | \ - RF5G_RF5G1_SPARE_MASK) - -#define RF5G_RF5G2_ADDRESS 'h00000004 -#define RF5G_RF5G2_AGCLO_B_MSB 31 -#define RF5G_RF5G2_AGCLO_B_LSB 29 -#define RF5G_RF5G2_AGCLO_B_MASK 'he0000000 -#define RF5G_RF5G2_AGCLO_B_GET(x) (((x) & RF5G_RF5G2_AGCLO_B_MASK) >> RF5G_RF5G2_AGCLO_B_LSB) -#define RF5G_RF5G2_AGCLO_B_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_AGCLO_B_LSB) & RF5G_RF5G2_AGCLO_B_MASK) -#define RF5G_RF5G2_AGCLO_B_RESET 3'h4 -#define RF5G_RF5G2_RX5_ATB_SEL_MSB 28 -#define RF5G_RF5G2_RX5_ATB_SEL_LSB 26 -#define RF5G_RF5G2_RX5_ATB_SEL_MASK 'h1c000000 -#define RF5G_RF5G2_RX5_ATB_SEL_GET(x) (((x) & RF5G_RF5G2_RX5_ATB_SEL_MASK) >> RF5G_RF5G2_RX5_ATB_SEL_LSB) -#define RF5G_RF5G2_RX5_ATB_SEL_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_RX5_ATB_SEL_LSB) & RF5G_RF5G2_RX5_ATB_SEL_MASK) -#define RF5G_RF5G2_RX5_ATB_SEL_RESET 3'h0 -#define RF5G_RF5G2_PDCMOSLO5_MSB 25 -#define RF5G_RF5G2_PDCMOSLO5_LSB 25 -#define RF5G_RF5G2_PDCMOSLO5_MASK 'h02000000 -#define RF5G_RF5G2_PDCMOSLO5_GET(x) (((x) & RF5G_RF5G2_PDCMOSLO5_MASK) >> RF5G_RF5G2_PDCMOSLO5_LSB) -#define RF5G_RF5G2_PDCMOSLO5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDCMOSLO5_LSB) & RF5G_RF5G2_PDCMOSLO5_MASK) -#define RF5G_RF5G2_PDCMOSLO5_RESET 1'h0 -#define RF5G_RF5G2_PDVGM5_MSB 24 -#define RF5G_RF5G2_PDVGM5_LSB 24 -#define RF5G_RF5G2_PDVGM5_MASK 'h01000000 -#define RF5G_RF5G2_PDVGM5_GET(x) (((x) & RF5G_RF5G2_PDVGM5_MASK) >> RF5G_RF5G2_PDVGM5_LSB) -#define RF5G_RF5G2_PDVGM5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDVGM5_LSB) & RF5G_RF5G2_PDVGM5_MASK) -#define RF5G_RF5G2_PDVGM5_RESET 1'h0 -#define RF5G_RF5G2_PDCSLNA5_MSB 23 -#define RF5G_RF5G2_PDCSLNA5_LSB 23 -#define RF5G_RF5G2_PDCSLNA5_MASK 'h00800000 -#define RF5G_RF5G2_PDCSLNA5_GET(x) (((x) & RF5G_RF5G2_PDCSLNA5_MASK) >> RF5G_RF5G2_PDCSLNA5_LSB) -#define RF5G_RF5G2_PDCSLNA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDCSLNA5_LSB) & RF5G_RF5G2_PDCSLNA5_MASK) -#define RF5G_RF5G2_PDCSLNA5_RESET 1'h0 -#define RF5G_RF5G2_PDRFVGA5_MSB 22 -#define RF5G_RF5G2_PDRFVGA5_LSB 22 -#define RF5G_RF5G2_PDRFVGA5_MASK 'h00400000 -#define RF5G_RF5G2_PDRFVGA5_GET(x) (((x) & RF5G_RF5G2_PDRFVGA5_MASK) >> RF5G_RF5G2_PDRFVGA5_LSB) -#define RF5G_RF5G2_PDRFVGA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDRFVGA5_LSB) & RF5G_RF5G2_PDRFVGA5_MASK) -#define RF5G_RF5G2_PDRFVGA5_RESET 1'h0 -#define RF5G_RF5G2_PDREGFE5_MSB 21 -#define RF5G_RF5G2_PDREGFE5_LSB 21 -#define RF5G_RF5G2_PDREGFE5_MASK 'h00200000 -#define RF5G_RF5G2_PDREGFE5_GET(x) (((x) & RF5G_RF5G2_PDREGFE5_MASK) >> RF5G_RF5G2_PDREGFE5_LSB) -#define RF5G_RF5G2_PDREGFE5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_PDREGFE5_LSB) & RF5G_RF5G2_PDREGFE5_MASK) -#define RF5G_RF5G2_PDREGFE5_RESET 1'h0 -#define RF5G_RF5G2_TUNE_RFVGA5_MSB 20 -#define RF5G_RF5G2_TUNE_RFVGA5_LSB 18 -#define RF5G_RF5G2_TUNE_RFVGA5_MASK 'h001c0000 -#define RF5G_RF5G2_TUNE_RFVGA5_GET(x) (((x) & RF5G_RF5G2_TUNE_RFVGA5_MASK) >> RF5G_RF5G2_TUNE_RFVGA5_LSB) -#define RF5G_RF5G2_TUNE_RFVGA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_TUNE_RFVGA5_LSB) & RF5G_RF5G2_TUNE_RFVGA5_MASK) -#define RF5G_RF5G2_TUNE_RFVGA5_RESET 3'h0 -#define RF5G_RF5G2_BRFVGA5_MSB 17 -#define RF5G_RF5G2_BRFVGA5_LSB 15 -#define RF5G_RF5G2_BRFVGA5_MASK 'h00038000 -#define RF5G_RF5G2_BRFVGA5_GET(x) (((x) & RF5G_RF5G2_BRFVGA5_MASK) >> RF5G_RF5G2_BRFVGA5_LSB) -#define RF5G_RF5G2_BRFVGA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_BRFVGA5_LSB) & RF5G_RF5G2_BRFVGA5_MASK) -#define RF5G_RF5G2_BRFVGA5_RESET 3'h5 -#define RF5G_RF5G2_BCSLNA5_MSB 14 -#define RF5G_RF5G2_BCSLNA5_LSB 12 -#define RF5G_RF5G2_BCSLNA5_MASK 'h00007000 -#define RF5G_RF5G2_BCSLNA5_GET(x) (((x) & RF5G_RF5G2_BCSLNA5_MASK) >> RF5G_RF5G2_BCSLNA5_LSB) -#define RF5G_RF5G2_BCSLNA5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_BCSLNA5_LSB) & RF5G_RF5G2_BCSLNA5_MASK) -#define RF5G_RF5G2_BCSLNA5_RESET 3'h3 -#define RF5G_RF5G2_BVGM5_MSB 11 -#define RF5G_RF5G2_BVGM5_LSB 9 -#define RF5G_RF5G2_BVGM5_MASK 'h00000e00 -#define RF5G_RF5G2_BVGM5_GET(x) (((x) & RF5G_RF5G2_BVGM5_MASK) >> RF5G_RF5G2_BVGM5_LSB) -#define RF5G_RF5G2_BVGM5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_BVGM5_LSB) & RF5G_RF5G2_BVGM5_MASK) -#define RF5G_RF5G2_BVGM5_RESET 3'h1 -#define RF5G_RF5G2_REGFE_BYPASS5_MSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_LSB 8 -#define RF5G_RF5G2_REGFE_BYPASS5_MASK 'h00000100 -#define RF5G_RF5G2_REGFE_BYPASS5_GET(x) (((x) & RF5G_RF5G2_REGFE_BYPASS5_MASK) >> RF5G_RF5G2_REGFE_BYPASS5_LSB) -#define RF5G_RF5G2_REGFE_BYPASS5_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_REGFE_BYPASS5_LSB) & RF5G_RF5G2_REGFE_BYPASS5_MASK) -#define RF5G_RF5G2_REGFE_BYPASS5_RESET 1'h0 -#define RF5G_RF5G2_LNA5_ATTENMODE_MSB 7 -#define RF5G_RF5G2_LNA5_ATTENMODE_LSB 6 -#define RF5G_RF5G2_LNA5_ATTENMODE_MASK 'h000000c0 -#define RF5G_RF5G2_LNA5_ATTENMODE_GET(x) (((x) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) >> RF5G_RF5G2_LNA5_ATTENMODE_LSB) -#define RF5G_RF5G2_LNA5_ATTENMODE_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_LNA5_ATTENMODE_LSB) & RF5G_RF5G2_LNA5_ATTENMODE_MASK) -#define RF5G_RF5G2_LNA5_ATTENMODE_RESET 2'h0 -#define RF5G_RF5G2_ENABLE_PCA_MSB 5 -#define RF5G_RF5G2_ENABLE_PCA_LSB 5 -#define RF5G_RF5G2_ENABLE_PCA_MASK 'h00000020 -#define RF5G_RF5G2_ENABLE_PCA_GET(x) (((x) & RF5G_RF5G2_ENABLE_PCA_MASK) >> RF5G_RF5G2_ENABLE_PCA_LSB) -#define RF5G_RF5G2_ENABLE_PCA_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_ENABLE_PCA_LSB) & RF5G_RF5G2_ENABLE_PCA_MASK) -#define RF5G_RF5G2_ENABLE_PCA_RESET 1'h0 -#define RF5G_RF5G2_TUNE_LO_MSB 4 -#define RF5G_RF5G2_TUNE_LO_LSB 2 -#define RF5G_RF5G2_TUNE_LO_MASK 'h0000001c -#define RF5G_RF5G2_TUNE_LO_GET(x) (((x) & RF5G_RF5G2_TUNE_LO_MASK) >> RF5G_RF5G2_TUNE_LO_LSB) -#define RF5G_RF5G2_TUNE_LO_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_TUNE_LO_LSB) & RF5G_RF5G2_TUNE_LO_MASK) -#define RF5G_RF5G2_TUNE_LO_RESET 3'h0 -#define RF5G_RF5G2_SPARE_MSB 1 -#define RF5G_RF5G2_SPARE_LSB 0 -#define RF5G_RF5G2_SPARE_MASK 'h00000003 -#define RF5G_RF5G2_SPARE_GET(x) (((x) & RF5G_RF5G2_SPARE_MASK) >> RF5G_RF5G2_SPARE_LSB) -#define RF5G_RF5G2_SPARE_SET(x) (((32'd0 | (x)) << RF5G_RF5G2_SPARE_LSB) & RF5G_RF5G2_SPARE_MASK) -#define RF5G_RF5G2_SPARE_RESET 2'h0 -#define RF5G_RF5G2_RESET (32'h0 | \ - RF5G_RF5G2_AGCLO_B_SET(RF5G_RF5G2_AGCLO_B_RESET) | \ - RF5G_RF5G2_RX5_ATB_SEL_SET(RF5G_RF5G2_RX5_ATB_SEL_RESET) | \ - RF5G_RF5G2_PDCMOSLO5_SET(RF5G_RF5G2_PDCMOSLO5_RESET) | \ - RF5G_RF5G2_PDVGM5_SET(RF5G_RF5G2_PDVGM5_RESET) | \ - RF5G_RF5G2_PDCSLNA5_SET(RF5G_RF5G2_PDCSLNA5_RESET) | \ - RF5G_RF5G2_PDRFVGA5_SET(RF5G_RF5G2_PDRFVGA5_RESET) | \ - RF5G_RF5G2_PDREGFE5_SET(RF5G_RF5G2_PDREGFE5_RESET) | \ - RF5G_RF5G2_TUNE_RFVGA5_SET(RF5G_RF5G2_TUNE_RFVGA5_RESET) | \ - RF5G_RF5G2_BRFVGA5_SET(RF5G_RF5G2_BRFVGA5_RESET) | \ - RF5G_RF5G2_BCSLNA5_SET(RF5G_RF5G2_BCSLNA5_RESET) | \ - RF5G_RF5G2_BVGM5_SET(RF5G_RF5G2_BVGM5_RESET) | \ - RF5G_RF5G2_REGFE_BYPASS5_SET(RF5G_RF5G2_REGFE_BYPASS5_RESET) | \ - RF5G_RF5G2_LNA5_ATTENMODE_SET(RF5G_RF5G2_LNA5_ATTENMODE_RESET) | \ - RF5G_RF5G2_ENABLE_PCA_SET(RF5G_RF5G2_ENABLE_PCA_RESET) | \ - RF5G_RF5G2_TUNE_LO_SET(RF5G_RF5G2_TUNE_LO_RESET) | \ - RF5G_RF5G2_SPARE_SET(RF5G_RF5G2_SPARE_RESET)) -#define RF5G_RF5G2_HW_MASK (32'h0) -#define RF5G_RF5G2_SW_MASK (32'h0 | \ - RF5G_RF5G2_AGCLO_B_MASK | \ - RF5G_RF5G2_RX5_ATB_SEL_MASK | \ - RF5G_RF5G2_PDCMOSLO5_MASK | \ - RF5G_RF5G2_PDVGM5_MASK | \ - RF5G_RF5G2_PDCSLNA5_MASK | \ - RF5G_RF5G2_PDRFVGA5_MASK | \ - RF5G_RF5G2_PDREGFE5_MASK | \ - RF5G_RF5G2_TUNE_RFVGA5_MASK | \ - RF5G_RF5G2_BRFVGA5_MASK | \ - RF5G_RF5G2_BCSLNA5_MASK | \ - RF5G_RF5G2_BVGM5_MASK | \ - RF5G_RF5G2_REGFE_BYPASS5_MASK | \ - RF5G_RF5G2_LNA5_ATTENMODE_MASK | \ - RF5G_RF5G2_ENABLE_PCA_MASK | \ - RF5G_RF5G2_TUNE_LO_MASK | \ - RF5G_RF5G2_SPARE_MASK) - -#define RF5G_REG_ADDRESS_MSB 2 - -#endif /* _RF5G_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rtc_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rtc_reg.h deleted file mode 100644 index 8b3980afb643..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rtc_reg.h +++ /dev/null @@ -1,1163 +0,0 @@ -#ifndef _RTC_REG_REG_H_ -#define _RTC_REG_REG_H_ - -#define RESET_CONTROL_ADDRESS 0x00000000 -#define RESET_CONTROL_OFFSET 0x00000000 -#define RESET_CONTROL_CPU_INIT_RESET_MSB 11 -#define RESET_CONTROL_CPU_INIT_RESET_LSB 11 -#define RESET_CONTROL_CPU_INIT_RESET_MASK 0x00000800 -#define RESET_CONTROL_CPU_INIT_RESET_GET(x) (((x) & RESET_CONTROL_CPU_INIT_RESET_MASK) >> RESET_CONTROL_CPU_INIT_RESET_LSB) -#define RESET_CONTROL_CPU_INIT_RESET_SET(x) (((x) << RESET_CONTROL_CPU_INIT_RESET_LSB) & RESET_CONTROL_CPU_INIT_RESET_MASK) -#define RESET_CONTROL_VMC_REMAP_RESET_MSB 10 -#define RESET_CONTROL_VMC_REMAP_RESET_LSB 10 -#define RESET_CONTROL_VMC_REMAP_RESET_MASK 0x00000400 -#define RESET_CONTROL_VMC_REMAP_RESET_GET(x) (((x) & RESET_CONTROL_VMC_REMAP_RESET_MASK) >> RESET_CONTROL_VMC_REMAP_RESET_LSB) -#define RESET_CONTROL_VMC_REMAP_RESET_SET(x) (((x) << RESET_CONTROL_VMC_REMAP_RESET_LSB) & RESET_CONTROL_VMC_REMAP_RESET_MASK) -#define RESET_CONTROL_RST_OUT_MSB 9 -#define RESET_CONTROL_RST_OUT_LSB 9 -#define RESET_CONTROL_RST_OUT_MASK 0x00000200 -#define RESET_CONTROL_RST_OUT_GET(x) (((x) & RESET_CONTROL_RST_OUT_MASK) >> RESET_CONTROL_RST_OUT_LSB) -#define RESET_CONTROL_RST_OUT_SET(x) (((x) << RESET_CONTROL_RST_OUT_LSB) & RESET_CONTROL_RST_OUT_MASK) -#define RESET_CONTROL_COLD_RST_MSB 8 -#define RESET_CONTROL_COLD_RST_LSB 8 -#define RESET_CONTROL_COLD_RST_MASK 0x00000100 -#define RESET_CONTROL_COLD_RST_GET(x) (((x) & RESET_CONTROL_COLD_RST_MASK) >> RESET_CONTROL_COLD_RST_LSB) -#define RESET_CONTROL_COLD_RST_SET(x) (((x) << RESET_CONTROL_COLD_RST_LSB) & RESET_CONTROL_COLD_RST_MASK) -#define RESET_CONTROL_WARM_RST_MSB 7 -#define RESET_CONTROL_WARM_RST_LSB 7 -#define RESET_CONTROL_WARM_RST_MASK 0x00000080 -#define RESET_CONTROL_WARM_RST_GET(x) (((x) & RESET_CONTROL_WARM_RST_MASK) >> RESET_CONTROL_WARM_RST_LSB) -#define RESET_CONTROL_WARM_RST_SET(x) (((x) << RESET_CONTROL_WARM_RST_LSB) & RESET_CONTROL_WARM_RST_MASK) -#define RESET_CONTROL_CPU_WARM_RST_MSB 6 -#define RESET_CONTROL_CPU_WARM_RST_LSB 6 -#define RESET_CONTROL_CPU_WARM_RST_MASK 0x00000040 -#define RESET_CONTROL_CPU_WARM_RST_GET(x) (((x) & RESET_CONTROL_CPU_WARM_RST_MASK) >> RESET_CONTROL_CPU_WARM_RST_LSB) -#define RESET_CONTROL_CPU_WARM_RST_SET(x) (((x) << RESET_CONTROL_CPU_WARM_RST_LSB) & RESET_CONTROL_CPU_WARM_RST_MASK) -#define RESET_CONTROL_MAC_COLD_RST_MSB 5 -#define RESET_CONTROL_MAC_COLD_RST_LSB 5 -#define RESET_CONTROL_MAC_COLD_RST_MASK 0x00000020 -#define RESET_CONTROL_MAC_COLD_RST_GET(x) (((x) & RESET_CONTROL_MAC_COLD_RST_MASK) >> RESET_CONTROL_MAC_COLD_RST_LSB) -#define RESET_CONTROL_MAC_COLD_RST_SET(x) (((x) << RESET_CONTROL_MAC_COLD_RST_LSB) & RESET_CONTROL_MAC_COLD_RST_MASK) -#define RESET_CONTROL_MAC_WARM_RST_MSB 4 -#define RESET_CONTROL_MAC_WARM_RST_LSB 4 -#define RESET_CONTROL_MAC_WARM_RST_MASK 0x00000010 -#define RESET_CONTROL_MAC_WARM_RST_GET(x) (((x) & RESET_CONTROL_MAC_WARM_RST_MASK) >> RESET_CONTROL_MAC_WARM_RST_LSB) -#define RESET_CONTROL_MAC_WARM_RST_SET(x) (((x) << RESET_CONTROL_MAC_WARM_RST_LSB) & RESET_CONTROL_MAC_WARM_RST_MASK) -#define RESET_CONTROL_MBOX_RST_MSB 2 -#define RESET_CONTROL_MBOX_RST_LSB 2 -#define RESET_CONTROL_MBOX_RST_MASK 0x00000004 -#define RESET_CONTROL_MBOX_RST_GET(x) (((x) & RESET_CONTROL_MBOX_RST_MASK) >> RESET_CONTROL_MBOX_RST_LSB) -#define RESET_CONTROL_MBOX_RST_SET(x) (((x) << RESET_CONTROL_MBOX_RST_LSB) & RESET_CONTROL_MBOX_RST_MASK) -#define RESET_CONTROL_UART_RST_MSB 1 -#define RESET_CONTROL_UART_RST_LSB 1 -#define RESET_CONTROL_UART_RST_MASK 0x00000002 -#define RESET_CONTROL_UART_RST_GET(x) (((x) & RESET_CONTROL_UART_RST_MASK) >> RESET_CONTROL_UART_RST_LSB) -#define RESET_CONTROL_UART_RST_SET(x) (((x) << RESET_CONTROL_UART_RST_LSB) & RESET_CONTROL_UART_RST_MASK) -#define RESET_CONTROL_SI0_RST_MSB 0 -#define RESET_CONTROL_SI0_RST_LSB 0 -#define RESET_CONTROL_SI0_RST_MASK 0x00000001 -#define RESET_CONTROL_SI0_RST_GET(x) (((x) & RESET_CONTROL_SI0_RST_MASK) >> RESET_CONTROL_SI0_RST_LSB) -#define RESET_CONTROL_SI0_RST_SET(x) (((x) << RESET_CONTROL_SI0_RST_LSB) & RESET_CONTROL_SI0_RST_MASK) - -#define XTAL_CONTROL_ADDRESS 0x00000004 -#define XTAL_CONTROL_OFFSET 0x00000004 -#define XTAL_CONTROL_TCXO_MSB 0 -#define XTAL_CONTROL_TCXO_LSB 0 -#define XTAL_CONTROL_TCXO_MASK 0x00000001 -#define XTAL_CONTROL_TCXO_GET(x) (((x) & XTAL_CONTROL_TCXO_MASK) >> XTAL_CONTROL_TCXO_LSB) -#define XTAL_CONTROL_TCXO_SET(x) (((x) << XTAL_CONTROL_TCXO_LSB) & XTAL_CONTROL_TCXO_MASK) - -#define TCXO_DETECT_ADDRESS 0x00000008 -#define TCXO_DETECT_OFFSET 0x00000008 -#define TCXO_DETECT_PRESENT_MSB 0 -#define TCXO_DETECT_PRESENT_LSB 0 -#define TCXO_DETECT_PRESENT_MASK 0x00000001 -#define TCXO_DETECT_PRESENT_GET(x) (((x) & TCXO_DETECT_PRESENT_MASK) >> TCXO_DETECT_PRESENT_LSB) -#define TCXO_DETECT_PRESENT_SET(x) (((x) << TCXO_DETECT_PRESENT_LSB) & TCXO_DETECT_PRESENT_MASK) - -#define XTAL_TEST_ADDRESS 0x0000000c -#define XTAL_TEST_OFFSET 0x0000000c -#define XTAL_TEST_NOTCXODET_MSB 0 -#define XTAL_TEST_NOTCXODET_LSB 0 -#define XTAL_TEST_NOTCXODET_MASK 0x00000001 -#define XTAL_TEST_NOTCXODET_GET(x) (((x) & XTAL_TEST_NOTCXODET_MASK) >> XTAL_TEST_NOTCXODET_LSB) -#define XTAL_TEST_NOTCXODET_SET(x) (((x) << XTAL_TEST_NOTCXODET_LSB) & XTAL_TEST_NOTCXODET_MASK) - -#define QUADRATURE_ADDRESS 0x00000010 -#define QUADRATURE_OFFSET 0x00000010 -#define QUADRATURE_ADC_MSB 5 -#define QUADRATURE_ADC_LSB 4 -#define QUADRATURE_ADC_MASK 0x00000030 -#define QUADRATURE_ADC_GET(x) (((x) & QUADRATURE_ADC_MASK) >> QUADRATURE_ADC_LSB) -#define QUADRATURE_ADC_SET(x) (((x) << QUADRATURE_ADC_LSB) & QUADRATURE_ADC_MASK) -#define QUADRATURE_SEL_MSB 2 -#define QUADRATURE_SEL_LSB 2 -#define QUADRATURE_SEL_MASK 0x00000004 -#define QUADRATURE_SEL_GET(x) (((x) & QUADRATURE_SEL_MASK) >> QUADRATURE_SEL_LSB) -#define QUADRATURE_SEL_SET(x) (((x) << QUADRATURE_SEL_LSB) & QUADRATURE_SEL_MASK) -#define QUADRATURE_DAC_MSB 1 -#define QUADRATURE_DAC_LSB 0 -#define QUADRATURE_DAC_MASK 0x00000003 -#define QUADRATURE_DAC_GET(x) (((x) & QUADRATURE_DAC_MASK) >> QUADRATURE_DAC_LSB) -#define QUADRATURE_DAC_SET(x) (((x) << QUADRATURE_DAC_LSB) & QUADRATURE_DAC_MASK) - -#define PLL_CONTROL_ADDRESS 0x00000014 -#define PLL_CONTROL_OFFSET 0x00000014 -#define PLL_CONTROL_DIG_TEST_CLK_MSB 20 -#define PLL_CONTROL_DIG_TEST_CLK_LSB 20 -#define PLL_CONTROL_DIG_TEST_CLK_MASK 0x00100000 -#define PLL_CONTROL_DIG_TEST_CLK_GET(x) (((x) & PLL_CONTROL_DIG_TEST_CLK_MASK) >> PLL_CONTROL_DIG_TEST_CLK_LSB) -#define PLL_CONTROL_DIG_TEST_CLK_SET(x) (((x) << PLL_CONTROL_DIG_TEST_CLK_LSB) & PLL_CONTROL_DIG_TEST_CLK_MASK) -#define PLL_CONTROL_MAC_OVERRIDE_MSB 19 -#define PLL_CONTROL_MAC_OVERRIDE_LSB 19 -#define PLL_CONTROL_MAC_OVERRIDE_MASK 0x00080000 -#define PLL_CONTROL_MAC_OVERRIDE_GET(x) (((x) & PLL_CONTROL_MAC_OVERRIDE_MASK) >> PLL_CONTROL_MAC_OVERRIDE_LSB) -#define PLL_CONTROL_MAC_OVERRIDE_SET(x) (((x) << PLL_CONTROL_MAC_OVERRIDE_LSB) & PLL_CONTROL_MAC_OVERRIDE_MASK) -#define PLL_CONTROL_NOPWD_MSB 18 -#define PLL_CONTROL_NOPWD_LSB 18 -#define PLL_CONTROL_NOPWD_MASK 0x00040000 -#define PLL_CONTROL_NOPWD_GET(x) (((x) & PLL_CONTROL_NOPWD_MASK) >> PLL_CONTROL_NOPWD_LSB) -#define PLL_CONTROL_NOPWD_SET(x) (((x) << PLL_CONTROL_NOPWD_LSB) & PLL_CONTROL_NOPWD_MASK) -#define PLL_CONTROL_UPDATING_MSB 17 -#define PLL_CONTROL_UPDATING_LSB 17 -#define PLL_CONTROL_UPDATING_MASK 0x00020000 -#define PLL_CONTROL_UPDATING_GET(x) (((x) & PLL_CONTROL_UPDATING_MASK) >> PLL_CONTROL_UPDATING_LSB) -#define PLL_CONTROL_UPDATING_SET(x) (((x) << PLL_CONTROL_UPDATING_LSB) & PLL_CONTROL_UPDATING_MASK) -#define PLL_CONTROL_BYPASS_MSB 16 -#define PLL_CONTROL_BYPASS_LSB 16 -#define PLL_CONTROL_BYPASS_MASK 0x00010000 -#define PLL_CONTROL_BYPASS_GET(x) (((x) & PLL_CONTROL_BYPASS_MASK) >> PLL_CONTROL_BYPASS_LSB) -#define PLL_CONTROL_BYPASS_SET(x) (((x) << PLL_CONTROL_BYPASS_LSB) & PLL_CONTROL_BYPASS_MASK) -#define PLL_CONTROL_REFDIV_MSB 15 -#define PLL_CONTROL_REFDIV_LSB 12 -#define PLL_CONTROL_REFDIV_MASK 0x0000f000 -#define PLL_CONTROL_REFDIV_GET(x) (((x) & PLL_CONTROL_REFDIV_MASK) >> PLL_CONTROL_REFDIV_LSB) -#define PLL_CONTROL_REFDIV_SET(x) (((x) << PLL_CONTROL_REFDIV_LSB) & PLL_CONTROL_REFDIV_MASK) -#define PLL_CONTROL_DIV_MSB 9 -#define PLL_CONTROL_DIV_LSB 0 -#define PLL_CONTROL_DIV_MASK 0x000003ff -#define PLL_CONTROL_DIV_GET(x) (((x) & PLL_CONTROL_DIV_MASK) >> PLL_CONTROL_DIV_LSB) -#define PLL_CONTROL_DIV_SET(x) (((x) << PLL_CONTROL_DIV_LSB) & PLL_CONTROL_DIV_MASK) - -#define PLL_SETTLE_ADDRESS 0x00000018 -#define PLL_SETTLE_OFFSET 0x00000018 -#define PLL_SETTLE_TIME_MSB 11 -#define PLL_SETTLE_TIME_LSB 0 -#define PLL_SETTLE_TIME_MASK 0x00000fff -#define PLL_SETTLE_TIME_GET(x) (((x) & PLL_SETTLE_TIME_MASK) >> PLL_SETTLE_TIME_LSB) -#define PLL_SETTLE_TIME_SET(x) (((x) << PLL_SETTLE_TIME_LSB) & PLL_SETTLE_TIME_MASK) - -#define XTAL_SETTLE_ADDRESS 0x0000001c -#define XTAL_SETTLE_OFFSET 0x0000001c -#define XTAL_SETTLE_TIME_MSB 7 -#define XTAL_SETTLE_TIME_LSB 0 -#define XTAL_SETTLE_TIME_MASK 0x000000ff -#define XTAL_SETTLE_TIME_GET(x) (((x) & XTAL_SETTLE_TIME_MASK) >> XTAL_SETTLE_TIME_LSB) -#define XTAL_SETTLE_TIME_SET(x) (((x) << XTAL_SETTLE_TIME_LSB) & XTAL_SETTLE_TIME_MASK) - -#define CPU_CLOCK_ADDRESS 0x00000020 -#define CPU_CLOCK_OFFSET 0x00000020 -#define CPU_CLOCK_STANDARD_MSB 1 -#define CPU_CLOCK_STANDARD_LSB 0 -#define CPU_CLOCK_STANDARD_MASK 0x00000003 -#define CPU_CLOCK_STANDARD_GET(x) (((x) & CPU_CLOCK_STANDARD_MASK) >> CPU_CLOCK_STANDARD_LSB) -#define CPU_CLOCK_STANDARD_SET(x) (((x) << CPU_CLOCK_STANDARD_LSB) & CPU_CLOCK_STANDARD_MASK) - -#define CLOCK_OUT_ADDRESS 0x00000024 -#define CLOCK_OUT_OFFSET 0x00000024 -#define CLOCK_OUT_SELECT_MSB 3 -#define CLOCK_OUT_SELECT_LSB 0 -#define CLOCK_OUT_SELECT_MASK 0x0000000f -#define CLOCK_OUT_SELECT_GET(x) (((x) & CLOCK_OUT_SELECT_MASK) >> CLOCK_OUT_SELECT_LSB) -#define CLOCK_OUT_SELECT_SET(x) (((x) << CLOCK_OUT_SELECT_LSB) & CLOCK_OUT_SELECT_MASK) - -#define CLOCK_CONTROL_ADDRESS 0x00000028 -#define CLOCK_CONTROL_OFFSET 0x00000028 -#define CLOCK_CONTROL_LF_CLK32_MSB 2 -#define CLOCK_CONTROL_LF_CLK32_LSB 2 -#define CLOCK_CONTROL_LF_CLK32_MASK 0x00000004 -#define CLOCK_CONTROL_LF_CLK32_GET(x) (((x) & CLOCK_CONTROL_LF_CLK32_MASK) >> CLOCK_CONTROL_LF_CLK32_LSB) -#define CLOCK_CONTROL_LF_CLK32_SET(x) (((x) << CLOCK_CONTROL_LF_CLK32_LSB) & CLOCK_CONTROL_LF_CLK32_MASK) -#define CLOCK_CONTROL_UART_CLK_MSB 1 -#define CLOCK_CONTROL_UART_CLK_LSB 1 -#define CLOCK_CONTROL_UART_CLK_MASK 0x00000002 -#define CLOCK_CONTROL_UART_CLK_GET(x) (((x) & CLOCK_CONTROL_UART_CLK_MASK) >> CLOCK_CONTROL_UART_CLK_LSB) -#define CLOCK_CONTROL_UART_CLK_SET(x) (((x) << CLOCK_CONTROL_UART_CLK_LSB) & CLOCK_CONTROL_UART_CLK_MASK) -#define CLOCK_CONTROL_SI0_CLK_MSB 0 -#define CLOCK_CONTROL_SI0_CLK_LSB 0 -#define CLOCK_CONTROL_SI0_CLK_MASK 0x00000001 -#define CLOCK_CONTROL_SI0_CLK_GET(x) (((x) & CLOCK_CONTROL_SI0_CLK_MASK) >> CLOCK_CONTROL_SI0_CLK_LSB) -#define CLOCK_CONTROL_SI0_CLK_SET(x) (((x) << CLOCK_CONTROL_SI0_CLK_LSB) & CLOCK_CONTROL_SI0_CLK_MASK) - -#define BIAS_OVERRIDE_ADDRESS 0x0000002c -#define BIAS_OVERRIDE_OFFSET 0x0000002c -#define BIAS_OVERRIDE_ON_MSB 0 -#define BIAS_OVERRIDE_ON_LSB 0 -#define BIAS_OVERRIDE_ON_MASK 0x00000001 -#define BIAS_OVERRIDE_ON_GET(x) (((x) & BIAS_OVERRIDE_ON_MASK) >> BIAS_OVERRIDE_ON_LSB) -#define BIAS_OVERRIDE_ON_SET(x) (((x) << BIAS_OVERRIDE_ON_LSB) & BIAS_OVERRIDE_ON_MASK) - -#define WDT_CONTROL_ADDRESS 0x00000030 -#define WDT_CONTROL_OFFSET 0x00000030 -#define WDT_CONTROL_ACTION_MSB 2 -#define WDT_CONTROL_ACTION_LSB 0 -#define WDT_CONTROL_ACTION_MASK 0x00000007 -#define WDT_CONTROL_ACTION_GET(x) (((x) & WDT_CONTROL_ACTION_MASK) >> WDT_CONTROL_ACTION_LSB) -#define WDT_CONTROL_ACTION_SET(x) (((x) << WDT_CONTROL_ACTION_LSB) & WDT_CONTROL_ACTION_MASK) - -#define WDT_STATUS_ADDRESS 0x00000034 -#define WDT_STATUS_OFFSET 0x00000034 -#define WDT_STATUS_INTERRUPT_MSB 0 -#define WDT_STATUS_INTERRUPT_LSB 0 -#define WDT_STATUS_INTERRUPT_MASK 0x00000001 -#define WDT_STATUS_INTERRUPT_GET(x) (((x) & WDT_STATUS_INTERRUPT_MASK) >> WDT_STATUS_INTERRUPT_LSB) -#define WDT_STATUS_INTERRUPT_SET(x) (((x) << WDT_STATUS_INTERRUPT_LSB) & WDT_STATUS_INTERRUPT_MASK) - -#define WDT_ADDRESS 0x00000038 -#define WDT_OFFSET 0x00000038 -#define WDT_TARGET_MSB 21 -#define WDT_TARGET_LSB 0 -#define WDT_TARGET_MASK 0x003fffff -#define WDT_TARGET_GET(x) (((x) & WDT_TARGET_MASK) >> WDT_TARGET_LSB) -#define WDT_TARGET_SET(x) (((x) << WDT_TARGET_LSB) & WDT_TARGET_MASK) - -#define WDT_COUNT_ADDRESS 0x0000003c -#define WDT_COUNT_OFFSET 0x0000003c -#define WDT_COUNT_VALUE_MSB 21 -#define WDT_COUNT_VALUE_LSB 0 -#define WDT_COUNT_VALUE_MASK 0x003fffff -#define WDT_COUNT_VALUE_GET(x) (((x) & WDT_COUNT_VALUE_MASK) >> WDT_COUNT_VALUE_LSB) -#define WDT_COUNT_VALUE_SET(x) (((x) << WDT_COUNT_VALUE_LSB) & WDT_COUNT_VALUE_MASK) - -#define WDT_RESET_ADDRESS 0x00000040 -#define WDT_RESET_OFFSET 0x00000040 -#define WDT_RESET_VALUE_MSB 0 -#define WDT_RESET_VALUE_LSB 0 -#define WDT_RESET_VALUE_MASK 0x00000001 -#define WDT_RESET_VALUE_GET(x) (((x) & WDT_RESET_VALUE_MASK) >> WDT_RESET_VALUE_LSB) -#define WDT_RESET_VALUE_SET(x) (((x) << WDT_RESET_VALUE_LSB) & WDT_RESET_VALUE_MASK) - -#define INT_STATUS_ADDRESS 0x00000044 -#define INT_STATUS_OFFSET 0x00000044 -#define INT_STATUS_RTC_POWER_MSB 14 -#define INT_STATUS_RTC_POWER_LSB 14 -#define INT_STATUS_RTC_POWER_MASK 0x00004000 -#define INT_STATUS_RTC_POWER_GET(x) (((x) & INT_STATUS_RTC_POWER_MASK) >> INT_STATUS_RTC_POWER_LSB) -#define INT_STATUS_RTC_POWER_SET(x) (((x) << INT_STATUS_RTC_POWER_LSB) & INT_STATUS_RTC_POWER_MASK) -#define INT_STATUS_MAC_MSB 13 -#define INT_STATUS_MAC_LSB 13 -#define INT_STATUS_MAC_MASK 0x00002000 -#define INT_STATUS_MAC_GET(x) (((x) & INT_STATUS_MAC_MASK) >> INT_STATUS_MAC_LSB) -#define INT_STATUS_MAC_SET(x) (((x) << INT_STATUS_MAC_LSB) & INT_STATUS_MAC_MASK) -#define INT_STATUS_MAILBOX_MSB 12 -#define INT_STATUS_MAILBOX_LSB 12 -#define INT_STATUS_MAILBOX_MASK 0x00001000 -#define INT_STATUS_MAILBOX_GET(x) (((x) & INT_STATUS_MAILBOX_MASK) >> INT_STATUS_MAILBOX_LSB) -#define INT_STATUS_MAILBOX_SET(x) (((x) << INT_STATUS_MAILBOX_LSB) & INT_STATUS_MAILBOX_MASK) -#define INT_STATUS_RTC_ALARM_MSB 11 -#define INT_STATUS_RTC_ALARM_LSB 11 -#define INT_STATUS_RTC_ALARM_MASK 0x00000800 -#define INT_STATUS_RTC_ALARM_GET(x) (((x) & INT_STATUS_RTC_ALARM_MASK) >> INT_STATUS_RTC_ALARM_LSB) -#define INT_STATUS_RTC_ALARM_SET(x) (((x) << INT_STATUS_RTC_ALARM_LSB) & INT_STATUS_RTC_ALARM_MASK) -#define INT_STATUS_HF_TIMER_MSB 10 -#define INT_STATUS_HF_TIMER_LSB 10 -#define INT_STATUS_HF_TIMER_MASK 0x00000400 -#define INT_STATUS_HF_TIMER_GET(x) (((x) & INT_STATUS_HF_TIMER_MASK) >> INT_STATUS_HF_TIMER_LSB) -#define INT_STATUS_HF_TIMER_SET(x) (((x) << INT_STATUS_HF_TIMER_LSB) & INT_STATUS_HF_TIMER_MASK) -#define INT_STATUS_LF_TIMER3_MSB 9 -#define INT_STATUS_LF_TIMER3_LSB 9 -#define INT_STATUS_LF_TIMER3_MASK 0x00000200 -#define INT_STATUS_LF_TIMER3_GET(x) (((x) & INT_STATUS_LF_TIMER3_MASK) >> INT_STATUS_LF_TIMER3_LSB) -#define INT_STATUS_LF_TIMER3_SET(x) (((x) << INT_STATUS_LF_TIMER3_LSB) & INT_STATUS_LF_TIMER3_MASK) -#define INT_STATUS_LF_TIMER2_MSB 8 -#define INT_STATUS_LF_TIMER2_LSB 8 -#define INT_STATUS_LF_TIMER2_MASK 0x00000100 -#define INT_STATUS_LF_TIMER2_GET(x) (((x) & INT_STATUS_LF_TIMER2_MASK) >> INT_STATUS_LF_TIMER2_LSB) -#define INT_STATUS_LF_TIMER2_SET(x) (((x) << INT_STATUS_LF_TIMER2_LSB) & INT_STATUS_LF_TIMER2_MASK) -#define INT_STATUS_LF_TIMER1_MSB 7 -#define INT_STATUS_LF_TIMER1_LSB 7 -#define INT_STATUS_LF_TIMER1_MASK 0x00000080 -#define INT_STATUS_LF_TIMER1_GET(x) (((x) & INT_STATUS_LF_TIMER1_MASK) >> INT_STATUS_LF_TIMER1_LSB) -#define INT_STATUS_LF_TIMER1_SET(x) (((x) << INT_STATUS_LF_TIMER1_LSB) & INT_STATUS_LF_TIMER1_MASK) -#define INT_STATUS_LF_TIMER0_MSB 6 -#define INT_STATUS_LF_TIMER0_LSB 6 -#define INT_STATUS_LF_TIMER0_MASK 0x00000040 -#define INT_STATUS_LF_TIMER0_GET(x) (((x) & INT_STATUS_LF_TIMER0_MASK) >> INT_STATUS_LF_TIMER0_LSB) -#define INT_STATUS_LF_TIMER0_SET(x) (((x) << INT_STATUS_LF_TIMER0_LSB) & INT_STATUS_LF_TIMER0_MASK) -#define INT_STATUS_KEYPAD_MSB 5 -#define INT_STATUS_KEYPAD_LSB 5 -#define INT_STATUS_KEYPAD_MASK 0x00000020 -#define INT_STATUS_KEYPAD_GET(x) (((x) & INT_STATUS_KEYPAD_MASK) >> INT_STATUS_KEYPAD_LSB) -#define INT_STATUS_KEYPAD_SET(x) (((x) << INT_STATUS_KEYPAD_LSB) & INT_STATUS_KEYPAD_MASK) -#define INT_STATUS_SI_MSB 4 -#define INT_STATUS_SI_LSB 4 -#define INT_STATUS_SI_MASK 0x00000010 -#define INT_STATUS_SI_GET(x) (((x) & INT_STATUS_SI_MASK) >> INT_STATUS_SI_LSB) -#define INT_STATUS_SI_SET(x) (((x) << INT_STATUS_SI_LSB) & INT_STATUS_SI_MASK) -#define INT_STATUS_GPIO_MSB 3 -#define INT_STATUS_GPIO_LSB 3 -#define INT_STATUS_GPIO_MASK 0x00000008 -#define INT_STATUS_GPIO_GET(x) (((x) & INT_STATUS_GPIO_MASK) >> INT_STATUS_GPIO_LSB) -#define INT_STATUS_GPIO_SET(x) (((x) << INT_STATUS_GPIO_LSB) & INT_STATUS_GPIO_MASK) -#define INT_STATUS_UART_MSB 2 -#define INT_STATUS_UART_LSB 2 -#define INT_STATUS_UART_MASK 0x00000004 -#define INT_STATUS_UART_GET(x) (((x) & INT_STATUS_UART_MASK) >> INT_STATUS_UART_LSB) -#define INT_STATUS_UART_SET(x) (((x) << INT_STATUS_UART_LSB) & INT_STATUS_UART_MASK) -#define INT_STATUS_ERROR_MSB 1 -#define INT_STATUS_ERROR_LSB 1 -#define INT_STATUS_ERROR_MASK 0x00000002 -#define INT_STATUS_ERROR_GET(x) (((x) & INT_STATUS_ERROR_MASK) >> INT_STATUS_ERROR_LSB) -#define INT_STATUS_ERROR_SET(x) (((x) << INT_STATUS_ERROR_LSB) & INT_STATUS_ERROR_MASK) -#define INT_STATUS_WDT_INT_MSB 0 -#define INT_STATUS_WDT_INT_LSB 0 -#define INT_STATUS_WDT_INT_MASK 0x00000001 -#define INT_STATUS_WDT_INT_GET(x) (((x) & INT_STATUS_WDT_INT_MASK) >> INT_STATUS_WDT_INT_LSB) -#define INT_STATUS_WDT_INT_SET(x) (((x) << INT_STATUS_WDT_INT_LSB) & INT_STATUS_WDT_INT_MASK) - -#define LF_TIMER0_ADDRESS 0x00000048 -#define LF_TIMER0_OFFSET 0x00000048 -#define LF_TIMER0_TARGET_MSB 31 -#define LF_TIMER0_TARGET_LSB 0 -#define LF_TIMER0_TARGET_MASK 0xffffffff -#define LF_TIMER0_TARGET_GET(x) (((x) & LF_TIMER0_TARGET_MASK) >> LF_TIMER0_TARGET_LSB) -#define LF_TIMER0_TARGET_SET(x) (((x) << LF_TIMER0_TARGET_LSB) & LF_TIMER0_TARGET_MASK) - -#define LF_TIMER_COUNT0_ADDRESS 0x0000004c -#define LF_TIMER_COUNT0_OFFSET 0x0000004c -#define LF_TIMER_COUNT0_VALUE_MSB 31 -#define LF_TIMER_COUNT0_VALUE_LSB 0 -#define LF_TIMER_COUNT0_VALUE_MASK 0xffffffff -#define LF_TIMER_COUNT0_VALUE_GET(x) (((x) & LF_TIMER_COUNT0_VALUE_MASK) >> LF_TIMER_COUNT0_VALUE_LSB) -#define LF_TIMER_COUNT0_VALUE_SET(x) (((x) << LF_TIMER_COUNT0_VALUE_LSB) & LF_TIMER_COUNT0_VALUE_MASK) - -#define LF_TIMER_CONTROL0_ADDRESS 0x00000050 -#define LF_TIMER_CONTROL0_OFFSET 0x00000050 -#define LF_TIMER_CONTROL0_ENABLE_MSB 2 -#define LF_TIMER_CONTROL0_ENABLE_LSB 2 -#define LF_TIMER_CONTROL0_ENABLE_MASK 0x00000004 -#define LF_TIMER_CONTROL0_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL0_ENABLE_MASK) >> LF_TIMER_CONTROL0_ENABLE_LSB) -#define LF_TIMER_CONTROL0_ENABLE_SET(x) (((x) << LF_TIMER_CONTROL0_ENABLE_LSB) & LF_TIMER_CONTROL0_ENABLE_MASK) -#define LF_TIMER_CONTROL0_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL0_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL0_AUTO_RESTART_MASK 0x00000002 -#define LF_TIMER_CONTROL0_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL0_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL0_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL0_AUTO_RESTART_SET(x) (((x) << LF_TIMER_CONTROL0_AUTO_RESTART_LSB) & LF_TIMER_CONTROL0_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL0_RESET_MSB 0 -#define LF_TIMER_CONTROL0_RESET_LSB 0 -#define LF_TIMER_CONTROL0_RESET_MASK 0x00000001 -#define LF_TIMER_CONTROL0_RESET_GET(x) (((x) & LF_TIMER_CONTROL0_RESET_MASK) >> LF_TIMER_CONTROL0_RESET_LSB) -#define LF_TIMER_CONTROL0_RESET_SET(x) (((x) << LF_TIMER_CONTROL0_RESET_LSB) & LF_TIMER_CONTROL0_RESET_MASK) - -#define LF_TIMER_STATUS0_ADDRESS 0x00000054 -#define LF_TIMER_STATUS0_OFFSET 0x00000054 -#define LF_TIMER_STATUS0_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS0_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS0_INTERRUPT_MASK 0x00000001 -#define LF_TIMER_STATUS0_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS0_INTERRUPT_MASK) >> LF_TIMER_STATUS0_INTERRUPT_LSB) -#define LF_TIMER_STATUS0_INTERRUPT_SET(x) (((x) << LF_TIMER_STATUS0_INTERRUPT_LSB) & LF_TIMER_STATUS0_INTERRUPT_MASK) - -#define LF_TIMER1_ADDRESS 0x00000058 -#define LF_TIMER1_OFFSET 0x00000058 -#define LF_TIMER1_TARGET_MSB 31 -#define LF_TIMER1_TARGET_LSB 0 -#define LF_TIMER1_TARGET_MASK 0xffffffff -#define LF_TIMER1_TARGET_GET(x) (((x) & LF_TIMER1_TARGET_MASK) >> LF_TIMER1_TARGET_LSB) -#define LF_TIMER1_TARGET_SET(x) (((x) << LF_TIMER1_TARGET_LSB) & LF_TIMER1_TARGET_MASK) - -#define LF_TIMER_COUNT1_ADDRESS 0x0000005c -#define LF_TIMER_COUNT1_OFFSET 0x0000005c -#define LF_TIMER_COUNT1_VALUE_MSB 31 -#define LF_TIMER_COUNT1_VALUE_LSB 0 -#define LF_TIMER_COUNT1_VALUE_MASK 0xffffffff -#define LF_TIMER_COUNT1_VALUE_GET(x) (((x) & LF_TIMER_COUNT1_VALUE_MASK) >> LF_TIMER_COUNT1_VALUE_LSB) -#define LF_TIMER_COUNT1_VALUE_SET(x) (((x) << LF_TIMER_COUNT1_VALUE_LSB) & LF_TIMER_COUNT1_VALUE_MASK) - -#define LF_TIMER_CONTROL1_ADDRESS 0x00000060 -#define LF_TIMER_CONTROL1_OFFSET 0x00000060 -#define LF_TIMER_CONTROL1_ENABLE_MSB 2 -#define LF_TIMER_CONTROL1_ENABLE_LSB 2 -#define LF_TIMER_CONTROL1_ENABLE_MASK 0x00000004 -#define LF_TIMER_CONTROL1_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL1_ENABLE_MASK) >> LF_TIMER_CONTROL1_ENABLE_LSB) -#define LF_TIMER_CONTROL1_ENABLE_SET(x) (((x) << LF_TIMER_CONTROL1_ENABLE_LSB) & LF_TIMER_CONTROL1_ENABLE_MASK) -#define LF_TIMER_CONTROL1_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL1_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL1_AUTO_RESTART_MASK 0x00000002 -#define LF_TIMER_CONTROL1_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL1_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL1_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL1_AUTO_RESTART_SET(x) (((x) << LF_TIMER_CONTROL1_AUTO_RESTART_LSB) & LF_TIMER_CONTROL1_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL1_RESET_MSB 0 -#define LF_TIMER_CONTROL1_RESET_LSB 0 -#define LF_TIMER_CONTROL1_RESET_MASK 0x00000001 -#define LF_TIMER_CONTROL1_RESET_GET(x) (((x) & LF_TIMER_CONTROL1_RESET_MASK) >> LF_TIMER_CONTROL1_RESET_LSB) -#define LF_TIMER_CONTROL1_RESET_SET(x) (((x) << LF_TIMER_CONTROL1_RESET_LSB) & LF_TIMER_CONTROL1_RESET_MASK) - -#define LF_TIMER_STATUS1_ADDRESS 0x00000064 -#define LF_TIMER_STATUS1_OFFSET 0x00000064 -#define LF_TIMER_STATUS1_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS1_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS1_INTERRUPT_MASK 0x00000001 -#define LF_TIMER_STATUS1_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS1_INTERRUPT_MASK) >> LF_TIMER_STATUS1_INTERRUPT_LSB) -#define LF_TIMER_STATUS1_INTERRUPT_SET(x) (((x) << LF_TIMER_STATUS1_INTERRUPT_LSB) & LF_TIMER_STATUS1_INTERRUPT_MASK) - -#define LF_TIMER2_ADDRESS 0x00000068 -#define LF_TIMER2_OFFSET 0x00000068 -#define LF_TIMER2_TARGET_MSB 31 -#define LF_TIMER2_TARGET_LSB 0 -#define LF_TIMER2_TARGET_MASK 0xffffffff -#define LF_TIMER2_TARGET_GET(x) (((x) & LF_TIMER2_TARGET_MASK) >> LF_TIMER2_TARGET_LSB) -#define LF_TIMER2_TARGET_SET(x) (((x) << LF_TIMER2_TARGET_LSB) & LF_TIMER2_TARGET_MASK) - -#define LF_TIMER_COUNT2_ADDRESS 0x0000006c -#define LF_TIMER_COUNT2_OFFSET 0x0000006c -#define LF_TIMER_COUNT2_VALUE_MSB 31 -#define LF_TIMER_COUNT2_VALUE_LSB 0 -#define LF_TIMER_COUNT2_VALUE_MASK 0xffffffff -#define LF_TIMER_COUNT2_VALUE_GET(x) (((x) & LF_TIMER_COUNT2_VALUE_MASK) >> LF_TIMER_COUNT2_VALUE_LSB) -#define LF_TIMER_COUNT2_VALUE_SET(x) (((x) << LF_TIMER_COUNT2_VALUE_LSB) & LF_TIMER_COUNT2_VALUE_MASK) - -#define LF_TIMER_CONTROL2_ADDRESS 0x00000070 -#define LF_TIMER_CONTROL2_OFFSET 0x00000070 -#define LF_TIMER_CONTROL2_ENABLE_MSB 2 -#define LF_TIMER_CONTROL2_ENABLE_LSB 2 -#define LF_TIMER_CONTROL2_ENABLE_MASK 0x00000004 -#define LF_TIMER_CONTROL2_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL2_ENABLE_MASK) >> LF_TIMER_CONTROL2_ENABLE_LSB) -#define LF_TIMER_CONTROL2_ENABLE_SET(x) (((x) << LF_TIMER_CONTROL2_ENABLE_LSB) & LF_TIMER_CONTROL2_ENABLE_MASK) -#define LF_TIMER_CONTROL2_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL2_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL2_AUTO_RESTART_MASK 0x00000002 -#define LF_TIMER_CONTROL2_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL2_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL2_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL2_AUTO_RESTART_SET(x) (((x) << LF_TIMER_CONTROL2_AUTO_RESTART_LSB) & LF_TIMER_CONTROL2_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL2_RESET_MSB 0 -#define LF_TIMER_CONTROL2_RESET_LSB 0 -#define LF_TIMER_CONTROL2_RESET_MASK 0x00000001 -#define LF_TIMER_CONTROL2_RESET_GET(x) (((x) & LF_TIMER_CONTROL2_RESET_MASK) >> LF_TIMER_CONTROL2_RESET_LSB) -#define LF_TIMER_CONTROL2_RESET_SET(x) (((x) << LF_TIMER_CONTROL2_RESET_LSB) & LF_TIMER_CONTROL2_RESET_MASK) - -#define LF_TIMER_STATUS2_ADDRESS 0x00000074 -#define LF_TIMER_STATUS2_OFFSET 0x00000074 -#define LF_TIMER_STATUS2_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS2_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS2_INTERRUPT_MASK 0x00000001 -#define LF_TIMER_STATUS2_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS2_INTERRUPT_MASK) >> LF_TIMER_STATUS2_INTERRUPT_LSB) -#define LF_TIMER_STATUS2_INTERRUPT_SET(x) (((x) << LF_TIMER_STATUS2_INTERRUPT_LSB) & LF_TIMER_STATUS2_INTERRUPT_MASK) - -#define LF_TIMER3_ADDRESS 0x00000078 -#define LF_TIMER3_OFFSET 0x00000078 -#define LF_TIMER3_TARGET_MSB 31 -#define LF_TIMER3_TARGET_LSB 0 -#define LF_TIMER3_TARGET_MASK 0xffffffff -#define LF_TIMER3_TARGET_GET(x) (((x) & LF_TIMER3_TARGET_MASK) >> LF_TIMER3_TARGET_LSB) -#define LF_TIMER3_TARGET_SET(x) (((x) << LF_TIMER3_TARGET_LSB) & LF_TIMER3_TARGET_MASK) - -#define LF_TIMER_COUNT3_ADDRESS 0x0000007c -#define LF_TIMER_COUNT3_OFFSET 0x0000007c -#define LF_TIMER_COUNT3_VALUE_MSB 31 -#define LF_TIMER_COUNT3_VALUE_LSB 0 -#define LF_TIMER_COUNT3_VALUE_MASK 0xffffffff -#define LF_TIMER_COUNT3_VALUE_GET(x) (((x) & LF_TIMER_COUNT3_VALUE_MASK) >> LF_TIMER_COUNT3_VALUE_LSB) -#define LF_TIMER_COUNT3_VALUE_SET(x) (((x) << LF_TIMER_COUNT3_VALUE_LSB) & LF_TIMER_COUNT3_VALUE_MASK) - -#define LF_TIMER_CONTROL3_ADDRESS 0x00000080 -#define LF_TIMER_CONTROL3_OFFSET 0x00000080 -#define LF_TIMER_CONTROL3_ENABLE_MSB 2 -#define LF_TIMER_CONTROL3_ENABLE_LSB 2 -#define LF_TIMER_CONTROL3_ENABLE_MASK 0x00000004 -#define LF_TIMER_CONTROL3_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL3_ENABLE_MASK) >> LF_TIMER_CONTROL3_ENABLE_LSB) -#define LF_TIMER_CONTROL3_ENABLE_SET(x) (((x) << LF_TIMER_CONTROL3_ENABLE_LSB) & LF_TIMER_CONTROL3_ENABLE_MASK) -#define LF_TIMER_CONTROL3_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL3_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL3_AUTO_RESTART_MASK 0x00000002 -#define LF_TIMER_CONTROL3_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL3_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL3_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL3_AUTO_RESTART_SET(x) (((x) << LF_TIMER_CONTROL3_AUTO_RESTART_LSB) & LF_TIMER_CONTROL3_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL3_RESET_MSB 0 -#define LF_TIMER_CONTROL3_RESET_LSB 0 -#define LF_TIMER_CONTROL3_RESET_MASK 0x00000001 -#define LF_TIMER_CONTROL3_RESET_GET(x) (((x) & LF_TIMER_CONTROL3_RESET_MASK) >> LF_TIMER_CONTROL3_RESET_LSB) -#define LF_TIMER_CONTROL3_RESET_SET(x) (((x) << LF_TIMER_CONTROL3_RESET_LSB) & LF_TIMER_CONTROL3_RESET_MASK) - -#define LF_TIMER_STATUS3_ADDRESS 0x00000084 -#define LF_TIMER_STATUS3_OFFSET 0x00000084 -#define LF_TIMER_STATUS3_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS3_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS3_INTERRUPT_MASK 0x00000001 -#define LF_TIMER_STATUS3_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS3_INTERRUPT_MASK) >> LF_TIMER_STATUS3_INTERRUPT_LSB) -#define LF_TIMER_STATUS3_INTERRUPT_SET(x) (((x) << LF_TIMER_STATUS3_INTERRUPT_LSB) & LF_TIMER_STATUS3_INTERRUPT_MASK) - -#define HF_TIMER_ADDRESS 0x00000088 -#define HF_TIMER_OFFSET 0x00000088 -#define HF_TIMER_TARGET_MSB 31 -#define HF_TIMER_TARGET_LSB 12 -#define HF_TIMER_TARGET_MASK 0xfffff000 -#define HF_TIMER_TARGET_GET(x) (((x) & HF_TIMER_TARGET_MASK) >> HF_TIMER_TARGET_LSB) -#define HF_TIMER_TARGET_SET(x) (((x) << HF_TIMER_TARGET_LSB) & HF_TIMER_TARGET_MASK) - -#define HF_TIMER_COUNT_ADDRESS 0x0000008c -#define HF_TIMER_COUNT_OFFSET 0x0000008c -#define HF_TIMER_COUNT_VALUE_MSB 31 -#define HF_TIMER_COUNT_VALUE_LSB 12 -#define HF_TIMER_COUNT_VALUE_MASK 0xfffff000 -#define HF_TIMER_COUNT_VALUE_GET(x) (((x) & HF_TIMER_COUNT_VALUE_MASK) >> HF_TIMER_COUNT_VALUE_LSB) -#define HF_TIMER_COUNT_VALUE_SET(x) (((x) << HF_TIMER_COUNT_VALUE_LSB) & HF_TIMER_COUNT_VALUE_MASK) - -#define HF_LF_COUNT_ADDRESS 0x00000090 -#define HF_LF_COUNT_OFFSET 0x00000090 -#define HF_LF_COUNT_VALUE_MSB 31 -#define HF_LF_COUNT_VALUE_LSB 0 -#define HF_LF_COUNT_VALUE_MASK 0xffffffff -#define HF_LF_COUNT_VALUE_GET(x) (((x) & HF_LF_COUNT_VALUE_MASK) >> HF_LF_COUNT_VALUE_LSB) -#define HF_LF_COUNT_VALUE_SET(x) (((x) << HF_LF_COUNT_VALUE_LSB) & HF_LF_COUNT_VALUE_MASK) - -#define HF_TIMER_CONTROL_ADDRESS 0x00000094 -#define HF_TIMER_CONTROL_OFFSET 0x00000094 -#define HF_TIMER_CONTROL_ENABLE_MSB 3 -#define HF_TIMER_CONTROL_ENABLE_LSB 3 -#define HF_TIMER_CONTROL_ENABLE_MASK 0x00000008 -#define HF_TIMER_CONTROL_ENABLE_GET(x) (((x) & HF_TIMER_CONTROL_ENABLE_MASK) >> HF_TIMER_CONTROL_ENABLE_LSB) -#define HF_TIMER_CONTROL_ENABLE_SET(x) (((x) << HF_TIMER_CONTROL_ENABLE_LSB) & HF_TIMER_CONTROL_ENABLE_MASK) -#define HF_TIMER_CONTROL_ON_MSB 2 -#define HF_TIMER_CONTROL_ON_LSB 2 -#define HF_TIMER_CONTROL_ON_MASK 0x00000004 -#define HF_TIMER_CONTROL_ON_GET(x) (((x) & HF_TIMER_CONTROL_ON_MASK) >> HF_TIMER_CONTROL_ON_LSB) -#define HF_TIMER_CONTROL_ON_SET(x) (((x) << HF_TIMER_CONTROL_ON_LSB) & HF_TIMER_CONTROL_ON_MASK) -#define HF_TIMER_CONTROL_AUTO_RESTART_MSB 1 -#define HF_TIMER_CONTROL_AUTO_RESTART_LSB 1 -#define HF_TIMER_CONTROL_AUTO_RESTART_MASK 0x00000002 -#define HF_TIMER_CONTROL_AUTO_RESTART_GET(x) (((x) & HF_TIMER_CONTROL_AUTO_RESTART_MASK) >> HF_TIMER_CONTROL_AUTO_RESTART_LSB) -#define HF_TIMER_CONTROL_AUTO_RESTART_SET(x) (((x) << HF_TIMER_CONTROL_AUTO_RESTART_LSB) & HF_TIMER_CONTROL_AUTO_RESTART_MASK) -#define HF_TIMER_CONTROL_RESET_MSB 0 -#define HF_TIMER_CONTROL_RESET_LSB 0 -#define HF_TIMER_CONTROL_RESET_MASK 0x00000001 -#define HF_TIMER_CONTROL_RESET_GET(x) (((x) & HF_TIMER_CONTROL_RESET_MASK) >> HF_TIMER_CONTROL_RESET_LSB) -#define HF_TIMER_CONTROL_RESET_SET(x) (((x) << HF_TIMER_CONTROL_RESET_LSB) & HF_TIMER_CONTROL_RESET_MASK) - -#define HF_TIMER_STATUS_ADDRESS 0x00000098 -#define HF_TIMER_STATUS_OFFSET 0x00000098 -#define HF_TIMER_STATUS_INTERRUPT_MSB 0 -#define HF_TIMER_STATUS_INTERRUPT_LSB 0 -#define HF_TIMER_STATUS_INTERRUPT_MASK 0x00000001 -#define HF_TIMER_STATUS_INTERRUPT_GET(x) (((x) & HF_TIMER_STATUS_INTERRUPT_MASK) >> HF_TIMER_STATUS_INTERRUPT_LSB) -#define HF_TIMER_STATUS_INTERRUPT_SET(x) (((x) << HF_TIMER_STATUS_INTERRUPT_LSB) & HF_TIMER_STATUS_INTERRUPT_MASK) - -#define RTC_CONTROL_ADDRESS 0x0000009c -#define RTC_CONTROL_OFFSET 0x0000009c -#define RTC_CONTROL_ENABLE_MSB 2 -#define RTC_CONTROL_ENABLE_LSB 2 -#define RTC_CONTROL_ENABLE_MASK 0x00000004 -#define RTC_CONTROL_ENABLE_GET(x) (((x) & RTC_CONTROL_ENABLE_MASK) >> RTC_CONTROL_ENABLE_LSB) -#define RTC_CONTROL_ENABLE_SET(x) (((x) << RTC_CONTROL_ENABLE_LSB) & RTC_CONTROL_ENABLE_MASK) -#define RTC_CONTROL_LOAD_RTC_MSB 1 -#define RTC_CONTROL_LOAD_RTC_LSB 1 -#define RTC_CONTROL_LOAD_RTC_MASK 0x00000002 -#define RTC_CONTROL_LOAD_RTC_GET(x) (((x) & RTC_CONTROL_LOAD_RTC_MASK) >> RTC_CONTROL_LOAD_RTC_LSB) -#define RTC_CONTROL_LOAD_RTC_SET(x) (((x) << RTC_CONTROL_LOAD_RTC_LSB) & RTC_CONTROL_LOAD_RTC_MASK) -#define RTC_CONTROL_LOAD_ALARM_MSB 0 -#define RTC_CONTROL_LOAD_ALARM_LSB 0 -#define RTC_CONTROL_LOAD_ALARM_MASK 0x00000001 -#define RTC_CONTROL_LOAD_ALARM_GET(x) (((x) & RTC_CONTROL_LOAD_ALARM_MASK) >> RTC_CONTROL_LOAD_ALARM_LSB) -#define RTC_CONTROL_LOAD_ALARM_SET(x) (((x) << RTC_CONTROL_LOAD_ALARM_LSB) & RTC_CONTROL_LOAD_ALARM_MASK) - -#define RTC_TIME_ADDRESS 0x000000a0 -#define RTC_TIME_OFFSET 0x000000a0 -#define RTC_TIME_WEEK_DAY_MSB 26 -#define RTC_TIME_WEEK_DAY_LSB 24 -#define RTC_TIME_WEEK_DAY_MASK 0x07000000 -#define RTC_TIME_WEEK_DAY_GET(x) (((x) & RTC_TIME_WEEK_DAY_MASK) >> RTC_TIME_WEEK_DAY_LSB) -#define RTC_TIME_WEEK_DAY_SET(x) (((x) << RTC_TIME_WEEK_DAY_LSB) & RTC_TIME_WEEK_DAY_MASK) -#define RTC_TIME_HOUR_MSB 21 -#define RTC_TIME_HOUR_LSB 16 -#define RTC_TIME_HOUR_MASK 0x003f0000 -#define RTC_TIME_HOUR_GET(x) (((x) & RTC_TIME_HOUR_MASK) >> RTC_TIME_HOUR_LSB) -#define RTC_TIME_HOUR_SET(x) (((x) << RTC_TIME_HOUR_LSB) & RTC_TIME_HOUR_MASK) -#define RTC_TIME_MINUTE_MSB 14 -#define RTC_TIME_MINUTE_LSB 8 -#define RTC_TIME_MINUTE_MASK 0x00007f00 -#define RTC_TIME_MINUTE_GET(x) (((x) & RTC_TIME_MINUTE_MASK) >> RTC_TIME_MINUTE_LSB) -#define RTC_TIME_MINUTE_SET(x) (((x) << RTC_TIME_MINUTE_LSB) & RTC_TIME_MINUTE_MASK) -#define RTC_TIME_SECOND_MSB 6 -#define RTC_TIME_SECOND_LSB 0 -#define RTC_TIME_SECOND_MASK 0x0000007f -#define RTC_TIME_SECOND_GET(x) (((x) & RTC_TIME_SECOND_MASK) >> RTC_TIME_SECOND_LSB) -#define RTC_TIME_SECOND_SET(x) (((x) << RTC_TIME_SECOND_LSB) & RTC_TIME_SECOND_MASK) - -#define RTC_DATE_ADDRESS 0x000000a4 -#define RTC_DATE_OFFSET 0x000000a4 -#define RTC_DATE_YEAR_MSB 23 -#define RTC_DATE_YEAR_LSB 16 -#define RTC_DATE_YEAR_MASK 0x00ff0000 -#define RTC_DATE_YEAR_GET(x) (((x) & RTC_DATE_YEAR_MASK) >> RTC_DATE_YEAR_LSB) -#define RTC_DATE_YEAR_SET(x) (((x) << RTC_DATE_YEAR_LSB) & RTC_DATE_YEAR_MASK) -#define RTC_DATE_MONTH_MSB 12 -#define RTC_DATE_MONTH_LSB 8 -#define RTC_DATE_MONTH_MASK 0x00001f00 -#define RTC_DATE_MONTH_GET(x) (((x) & RTC_DATE_MONTH_MASK) >> RTC_DATE_MONTH_LSB) -#define RTC_DATE_MONTH_SET(x) (((x) << RTC_DATE_MONTH_LSB) & RTC_DATE_MONTH_MASK) -#define RTC_DATE_MONTH_DAY_MSB 5 -#define RTC_DATE_MONTH_DAY_LSB 0 -#define RTC_DATE_MONTH_DAY_MASK 0x0000003f -#define RTC_DATE_MONTH_DAY_GET(x) (((x) & RTC_DATE_MONTH_DAY_MASK) >> RTC_DATE_MONTH_DAY_LSB) -#define RTC_DATE_MONTH_DAY_SET(x) (((x) << RTC_DATE_MONTH_DAY_LSB) & RTC_DATE_MONTH_DAY_MASK) - -#define RTC_SET_TIME_ADDRESS 0x000000a8 -#define RTC_SET_TIME_OFFSET 0x000000a8 -#define RTC_SET_TIME_WEEK_DAY_MSB 26 -#define RTC_SET_TIME_WEEK_DAY_LSB 24 -#define RTC_SET_TIME_WEEK_DAY_MASK 0x07000000 -#define RTC_SET_TIME_WEEK_DAY_GET(x) (((x) & RTC_SET_TIME_WEEK_DAY_MASK) >> RTC_SET_TIME_WEEK_DAY_LSB) -#define RTC_SET_TIME_WEEK_DAY_SET(x) (((x) << RTC_SET_TIME_WEEK_DAY_LSB) & RTC_SET_TIME_WEEK_DAY_MASK) -#define RTC_SET_TIME_HOUR_MSB 21 -#define RTC_SET_TIME_HOUR_LSB 16 -#define RTC_SET_TIME_HOUR_MASK 0x003f0000 -#define RTC_SET_TIME_HOUR_GET(x) (((x) & RTC_SET_TIME_HOUR_MASK) >> RTC_SET_TIME_HOUR_LSB) -#define RTC_SET_TIME_HOUR_SET(x) (((x) << RTC_SET_TIME_HOUR_LSB) & RTC_SET_TIME_HOUR_MASK) -#define RTC_SET_TIME_MINUTE_MSB 14 -#define RTC_SET_TIME_MINUTE_LSB 8 -#define RTC_SET_TIME_MINUTE_MASK 0x00007f00 -#define RTC_SET_TIME_MINUTE_GET(x) (((x) & RTC_SET_TIME_MINUTE_MASK) >> RTC_SET_TIME_MINUTE_LSB) -#define RTC_SET_TIME_MINUTE_SET(x) (((x) << RTC_SET_TIME_MINUTE_LSB) & RTC_SET_TIME_MINUTE_MASK) -#define RTC_SET_TIME_SECOND_MSB 6 -#define RTC_SET_TIME_SECOND_LSB 0 -#define RTC_SET_TIME_SECOND_MASK 0x0000007f -#define RTC_SET_TIME_SECOND_GET(x) (((x) & RTC_SET_TIME_SECOND_MASK) >> RTC_SET_TIME_SECOND_LSB) -#define RTC_SET_TIME_SECOND_SET(x) (((x) << RTC_SET_TIME_SECOND_LSB) & RTC_SET_TIME_SECOND_MASK) - -#define RTC_SET_DATE_ADDRESS 0x000000ac -#define RTC_SET_DATE_OFFSET 0x000000ac -#define RTC_SET_DATE_YEAR_MSB 23 -#define RTC_SET_DATE_YEAR_LSB 16 -#define RTC_SET_DATE_YEAR_MASK 0x00ff0000 -#define RTC_SET_DATE_YEAR_GET(x) (((x) & RTC_SET_DATE_YEAR_MASK) >> RTC_SET_DATE_YEAR_LSB) -#define RTC_SET_DATE_YEAR_SET(x) (((x) << RTC_SET_DATE_YEAR_LSB) & RTC_SET_DATE_YEAR_MASK) -#define RTC_SET_DATE_MONTH_MSB 12 -#define RTC_SET_DATE_MONTH_LSB 8 -#define RTC_SET_DATE_MONTH_MASK 0x00001f00 -#define RTC_SET_DATE_MONTH_GET(x) (((x) & RTC_SET_DATE_MONTH_MASK) >> RTC_SET_DATE_MONTH_LSB) -#define RTC_SET_DATE_MONTH_SET(x) (((x) << RTC_SET_DATE_MONTH_LSB) & RTC_SET_DATE_MONTH_MASK) -#define RTC_SET_DATE_MONTH_DAY_MSB 5 -#define RTC_SET_DATE_MONTH_DAY_LSB 0 -#define RTC_SET_DATE_MONTH_DAY_MASK 0x0000003f -#define RTC_SET_DATE_MONTH_DAY_GET(x) (((x) & RTC_SET_DATE_MONTH_DAY_MASK) >> RTC_SET_DATE_MONTH_DAY_LSB) -#define RTC_SET_DATE_MONTH_DAY_SET(x) (((x) << RTC_SET_DATE_MONTH_DAY_LSB) & RTC_SET_DATE_MONTH_DAY_MASK) - -#define RTC_SET_ALARM_ADDRESS 0x000000b0 -#define RTC_SET_ALARM_OFFSET 0x000000b0 -#define RTC_SET_ALARM_HOUR_MSB 21 -#define RTC_SET_ALARM_HOUR_LSB 16 -#define RTC_SET_ALARM_HOUR_MASK 0x003f0000 -#define RTC_SET_ALARM_HOUR_GET(x) (((x) & RTC_SET_ALARM_HOUR_MASK) >> RTC_SET_ALARM_HOUR_LSB) -#define RTC_SET_ALARM_HOUR_SET(x) (((x) << RTC_SET_ALARM_HOUR_LSB) & RTC_SET_ALARM_HOUR_MASK) -#define RTC_SET_ALARM_MINUTE_MSB 14 -#define RTC_SET_ALARM_MINUTE_LSB 8 -#define RTC_SET_ALARM_MINUTE_MASK 0x00007f00 -#define RTC_SET_ALARM_MINUTE_GET(x) (((x) & RTC_SET_ALARM_MINUTE_MASK) >> RTC_SET_ALARM_MINUTE_LSB) -#define RTC_SET_ALARM_MINUTE_SET(x) (((x) << RTC_SET_ALARM_MINUTE_LSB) & RTC_SET_ALARM_MINUTE_MASK) -#define RTC_SET_ALARM_SECOND_MSB 6 -#define RTC_SET_ALARM_SECOND_LSB 0 -#define RTC_SET_ALARM_SECOND_MASK 0x0000007f -#define RTC_SET_ALARM_SECOND_GET(x) (((x) & RTC_SET_ALARM_SECOND_MASK) >> RTC_SET_ALARM_SECOND_LSB) -#define RTC_SET_ALARM_SECOND_SET(x) (((x) << RTC_SET_ALARM_SECOND_LSB) & RTC_SET_ALARM_SECOND_MASK) - -#define RTC_CONFIG_ADDRESS 0x000000b4 -#define RTC_CONFIG_OFFSET 0x000000b4 -#define RTC_CONFIG_BCD_MSB 2 -#define RTC_CONFIG_BCD_LSB 2 -#define RTC_CONFIG_BCD_MASK 0x00000004 -#define RTC_CONFIG_BCD_GET(x) (((x) & RTC_CONFIG_BCD_MASK) >> RTC_CONFIG_BCD_LSB) -#define RTC_CONFIG_BCD_SET(x) (((x) << RTC_CONFIG_BCD_LSB) & RTC_CONFIG_BCD_MASK) -#define RTC_CONFIG_TWELVE_HOUR_MSB 1 -#define RTC_CONFIG_TWELVE_HOUR_LSB 1 -#define RTC_CONFIG_TWELVE_HOUR_MASK 0x00000002 -#define RTC_CONFIG_TWELVE_HOUR_GET(x) (((x) & RTC_CONFIG_TWELVE_HOUR_MASK) >> RTC_CONFIG_TWELVE_HOUR_LSB) -#define RTC_CONFIG_TWELVE_HOUR_SET(x) (((x) << RTC_CONFIG_TWELVE_HOUR_LSB) & RTC_CONFIG_TWELVE_HOUR_MASK) -#define RTC_CONFIG_DSE_MSB 0 -#define RTC_CONFIG_DSE_LSB 0 -#define RTC_CONFIG_DSE_MASK 0x00000001 -#define RTC_CONFIG_DSE_GET(x) (((x) & RTC_CONFIG_DSE_MASK) >> RTC_CONFIG_DSE_LSB) -#define RTC_CONFIG_DSE_SET(x) (((x) << RTC_CONFIG_DSE_LSB) & RTC_CONFIG_DSE_MASK) - -#define RTC_ALARM_STATUS_ADDRESS 0x000000b8 -#define RTC_ALARM_STATUS_OFFSET 0x000000b8 -#define RTC_ALARM_STATUS_ENABLE_MSB 1 -#define RTC_ALARM_STATUS_ENABLE_LSB 1 -#define RTC_ALARM_STATUS_ENABLE_MASK 0x00000002 -#define RTC_ALARM_STATUS_ENABLE_GET(x) (((x) & RTC_ALARM_STATUS_ENABLE_MASK) >> RTC_ALARM_STATUS_ENABLE_LSB) -#define RTC_ALARM_STATUS_ENABLE_SET(x) (((x) << RTC_ALARM_STATUS_ENABLE_LSB) & RTC_ALARM_STATUS_ENABLE_MASK) -#define RTC_ALARM_STATUS_INTERRUPT_MSB 0 -#define RTC_ALARM_STATUS_INTERRUPT_LSB 0 -#define RTC_ALARM_STATUS_INTERRUPT_MASK 0x00000001 -#define RTC_ALARM_STATUS_INTERRUPT_GET(x) (((x) & RTC_ALARM_STATUS_INTERRUPT_MASK) >> RTC_ALARM_STATUS_INTERRUPT_LSB) -#define RTC_ALARM_STATUS_INTERRUPT_SET(x) (((x) << RTC_ALARM_STATUS_INTERRUPT_LSB) & RTC_ALARM_STATUS_INTERRUPT_MASK) - -#define UART_WAKEUP_ADDRESS 0x000000bc -#define UART_WAKEUP_OFFSET 0x000000bc -#define UART_WAKEUP_ENABLE_MSB 0 -#define UART_WAKEUP_ENABLE_LSB 0 -#define UART_WAKEUP_ENABLE_MASK 0x00000001 -#define UART_WAKEUP_ENABLE_GET(x) (((x) & UART_WAKEUP_ENABLE_MASK) >> UART_WAKEUP_ENABLE_LSB) -#define UART_WAKEUP_ENABLE_SET(x) (((x) << UART_WAKEUP_ENABLE_LSB) & UART_WAKEUP_ENABLE_MASK) - -#define RESET_CAUSE_ADDRESS 0x000000c0 -#define RESET_CAUSE_OFFSET 0x000000c0 -#define RESET_CAUSE_LAST_MSB 2 -#define RESET_CAUSE_LAST_LSB 0 -#define RESET_CAUSE_LAST_MASK 0x00000007 -#define RESET_CAUSE_LAST_GET(x) (((x) & RESET_CAUSE_LAST_MASK) >> RESET_CAUSE_LAST_LSB) -#define RESET_CAUSE_LAST_SET(x) (((x) << RESET_CAUSE_LAST_LSB) & RESET_CAUSE_LAST_MASK) - -#define SYSTEM_SLEEP_ADDRESS 0x000000c4 -#define SYSTEM_SLEEP_OFFSET 0x000000c4 -#define SYSTEM_SLEEP_HOST_IF_MSB 4 -#define SYSTEM_SLEEP_HOST_IF_LSB 4 -#define SYSTEM_SLEEP_HOST_IF_MASK 0x00000010 -#define SYSTEM_SLEEP_HOST_IF_GET(x) (((x) & SYSTEM_SLEEP_HOST_IF_MASK) >> SYSTEM_SLEEP_HOST_IF_LSB) -#define SYSTEM_SLEEP_HOST_IF_SET(x) (((x) << SYSTEM_SLEEP_HOST_IF_LSB) & SYSTEM_SLEEP_HOST_IF_MASK) -#define SYSTEM_SLEEP_MBOX_MSB 3 -#define SYSTEM_SLEEP_MBOX_LSB 3 -#define SYSTEM_SLEEP_MBOX_MASK 0x00000008 -#define SYSTEM_SLEEP_MBOX_GET(x) (((x) & SYSTEM_SLEEP_MBOX_MASK) >> SYSTEM_SLEEP_MBOX_LSB) -#define SYSTEM_SLEEP_MBOX_SET(x) (((x) << SYSTEM_SLEEP_MBOX_LSB) & SYSTEM_SLEEP_MBOX_MASK) -#define SYSTEM_SLEEP_MAC_IF_MSB 2 -#define SYSTEM_SLEEP_MAC_IF_LSB 2 -#define SYSTEM_SLEEP_MAC_IF_MASK 0x00000004 -#define SYSTEM_SLEEP_MAC_IF_GET(x) (((x) & SYSTEM_SLEEP_MAC_IF_MASK) >> SYSTEM_SLEEP_MAC_IF_LSB) -#define SYSTEM_SLEEP_MAC_IF_SET(x) (((x) << SYSTEM_SLEEP_MAC_IF_LSB) & SYSTEM_SLEEP_MAC_IF_MASK) -#define SYSTEM_SLEEP_LIGHT_MSB 1 -#define SYSTEM_SLEEP_LIGHT_LSB 1 -#define SYSTEM_SLEEP_LIGHT_MASK 0x00000002 -#define SYSTEM_SLEEP_LIGHT_GET(x) (((x) & SYSTEM_SLEEP_LIGHT_MASK) >> SYSTEM_SLEEP_LIGHT_LSB) -#define SYSTEM_SLEEP_LIGHT_SET(x) (((x) << SYSTEM_SLEEP_LIGHT_LSB) & SYSTEM_SLEEP_LIGHT_MASK) -#define SYSTEM_SLEEP_DISABLE_MSB 0 -#define SYSTEM_SLEEP_DISABLE_LSB 0 -#define SYSTEM_SLEEP_DISABLE_MASK 0x00000001 -#define SYSTEM_SLEEP_DISABLE_GET(x) (((x) & SYSTEM_SLEEP_DISABLE_MASK) >> SYSTEM_SLEEP_DISABLE_LSB) -#define SYSTEM_SLEEP_DISABLE_SET(x) (((x) << SYSTEM_SLEEP_DISABLE_LSB) & SYSTEM_SLEEP_DISABLE_MASK) - -#define SDIO_WRAPPER_ADDRESS 0x000000c8 -#define SDIO_WRAPPER_OFFSET 0x000000c8 -#define SDIO_WRAPPER_SLEEP_MSB 3 -#define SDIO_WRAPPER_SLEEP_LSB 3 -#define SDIO_WRAPPER_SLEEP_MASK 0x00000008 -#define SDIO_WRAPPER_SLEEP_GET(x) (((x) & SDIO_WRAPPER_SLEEP_MASK) >> SDIO_WRAPPER_SLEEP_LSB) -#define SDIO_WRAPPER_SLEEP_SET(x) (((x) << SDIO_WRAPPER_SLEEP_LSB) & SDIO_WRAPPER_SLEEP_MASK) -#define SDIO_WRAPPER_WAKEUP_MSB 2 -#define SDIO_WRAPPER_WAKEUP_LSB 2 -#define SDIO_WRAPPER_WAKEUP_MASK 0x00000004 -#define SDIO_WRAPPER_WAKEUP_GET(x) (((x) & SDIO_WRAPPER_WAKEUP_MASK) >> SDIO_WRAPPER_WAKEUP_LSB) -#define SDIO_WRAPPER_WAKEUP_SET(x) (((x) << SDIO_WRAPPER_WAKEUP_LSB) & SDIO_WRAPPER_WAKEUP_MASK) -#define SDIO_WRAPPER_SOC_ON_MSB 1 -#define SDIO_WRAPPER_SOC_ON_LSB 1 -#define SDIO_WRAPPER_SOC_ON_MASK 0x00000002 -#define SDIO_WRAPPER_SOC_ON_GET(x) (((x) & SDIO_WRAPPER_SOC_ON_MASK) >> SDIO_WRAPPER_SOC_ON_LSB) -#define SDIO_WRAPPER_SOC_ON_SET(x) (((x) << SDIO_WRAPPER_SOC_ON_LSB) & SDIO_WRAPPER_SOC_ON_MASK) -#define SDIO_WRAPPER_ON_MSB 0 -#define SDIO_WRAPPER_ON_LSB 0 -#define SDIO_WRAPPER_ON_MASK 0x00000001 -#define SDIO_WRAPPER_ON_GET(x) (((x) & SDIO_WRAPPER_ON_MASK) >> SDIO_WRAPPER_ON_LSB) -#define SDIO_WRAPPER_ON_SET(x) (((x) << SDIO_WRAPPER_ON_LSB) & SDIO_WRAPPER_ON_MASK) - -#define MAC_SLEEP_CONTROL_ADDRESS 0x000000cc -#define MAC_SLEEP_CONTROL_OFFSET 0x000000cc -#define MAC_SLEEP_CONTROL_ENABLE_MSB 1 -#define MAC_SLEEP_CONTROL_ENABLE_LSB 0 -#define MAC_SLEEP_CONTROL_ENABLE_MASK 0x00000003 -#define MAC_SLEEP_CONTROL_ENABLE_GET(x) (((x) & MAC_SLEEP_CONTROL_ENABLE_MASK) >> MAC_SLEEP_CONTROL_ENABLE_LSB) -#define MAC_SLEEP_CONTROL_ENABLE_SET(x) (((x) << MAC_SLEEP_CONTROL_ENABLE_LSB) & MAC_SLEEP_CONTROL_ENABLE_MASK) - -#define KEEP_AWAKE_ADDRESS 0x000000d0 -#define KEEP_AWAKE_OFFSET 0x000000d0 -#define KEEP_AWAKE_COUNT_MSB 7 -#define KEEP_AWAKE_COUNT_LSB 0 -#define KEEP_AWAKE_COUNT_MASK 0x000000ff -#define KEEP_AWAKE_COUNT_GET(x) (((x) & KEEP_AWAKE_COUNT_MASK) >> KEEP_AWAKE_COUNT_LSB) -#define KEEP_AWAKE_COUNT_SET(x) (((x) << KEEP_AWAKE_COUNT_LSB) & KEEP_AWAKE_COUNT_MASK) - -#define LPO_CAL_TIME_ADDRESS 0x000000d4 -#define LPO_CAL_TIME_OFFSET 0x000000d4 -#define LPO_CAL_TIME_LENGTH_MSB 13 -#define LPO_CAL_TIME_LENGTH_LSB 0 -#define LPO_CAL_TIME_LENGTH_MASK 0x00003fff -#define LPO_CAL_TIME_LENGTH_GET(x) (((x) & LPO_CAL_TIME_LENGTH_MASK) >> LPO_CAL_TIME_LENGTH_LSB) -#define LPO_CAL_TIME_LENGTH_SET(x) (((x) << LPO_CAL_TIME_LENGTH_LSB) & LPO_CAL_TIME_LENGTH_MASK) - -#define LPO_INIT_DIVIDEND_INT_ADDRESS 0x000000d8 -#define LPO_INIT_DIVIDEND_INT_OFFSET 0x000000d8 -#define LPO_INIT_DIVIDEND_INT_VALUE_MSB 23 -#define LPO_INIT_DIVIDEND_INT_VALUE_LSB 0 -#define LPO_INIT_DIVIDEND_INT_VALUE_MASK 0x00ffffff -#define LPO_INIT_DIVIDEND_INT_VALUE_GET(x) (((x) & LPO_INIT_DIVIDEND_INT_VALUE_MASK) >> LPO_INIT_DIVIDEND_INT_VALUE_LSB) -#define LPO_INIT_DIVIDEND_INT_VALUE_SET(x) (((x) << LPO_INIT_DIVIDEND_INT_VALUE_LSB) & LPO_INIT_DIVIDEND_INT_VALUE_MASK) - -#define LPO_INIT_DIVIDEND_FRACTION_ADDRESS 0x000000dc -#define LPO_INIT_DIVIDEND_FRACTION_OFFSET 0x000000dc -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_MSB 10 -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB 0 -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK 0x000007ff -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_GET(x) (((x) & LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK) >> LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB) -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_SET(x) (((x) << LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB) & LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK) - -#define LPO_CAL_ADDRESS 0x000000e0 -#define LPO_CAL_OFFSET 0x000000e0 -#define LPO_CAL_ENABLE_MSB 20 -#define LPO_CAL_ENABLE_LSB 20 -#define LPO_CAL_ENABLE_MASK 0x00100000 -#define LPO_CAL_ENABLE_GET(x) (((x) & LPO_CAL_ENABLE_MASK) >> LPO_CAL_ENABLE_LSB) -#define LPO_CAL_ENABLE_SET(x) (((x) << LPO_CAL_ENABLE_LSB) & LPO_CAL_ENABLE_MASK) -#define LPO_CAL_COUNT_MSB 19 -#define LPO_CAL_COUNT_LSB 0 -#define LPO_CAL_COUNT_MASK 0x000fffff -#define LPO_CAL_COUNT_GET(x) (((x) & LPO_CAL_COUNT_MASK) >> LPO_CAL_COUNT_LSB) -#define LPO_CAL_COUNT_SET(x) (((x) << LPO_CAL_COUNT_LSB) & LPO_CAL_COUNT_MASK) - -#define LPO_CAL_TEST_CONTROL_ADDRESS 0x000000e4 -#define LPO_CAL_TEST_CONTROL_OFFSET 0x000000e4 -#define LPO_CAL_TEST_CONTROL_ENABLE_MSB 5 -#define LPO_CAL_TEST_CONTROL_ENABLE_LSB 5 -#define LPO_CAL_TEST_CONTROL_ENABLE_MASK 0x00000020 -#define LPO_CAL_TEST_CONTROL_ENABLE_GET(x) (((x) & LPO_CAL_TEST_CONTROL_ENABLE_MASK) >> LPO_CAL_TEST_CONTROL_ENABLE_LSB) -#define LPO_CAL_TEST_CONTROL_ENABLE_SET(x) (((x) << LPO_CAL_TEST_CONTROL_ENABLE_LSB) & LPO_CAL_TEST_CONTROL_ENABLE_MASK) -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_MSB 4 -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB 0 -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK 0x0000001f -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_GET(x) (((x) & LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK) >> LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB) -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_SET(x) (((x) << LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB) & LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK) - -#define LPO_CAL_TEST_STATUS_ADDRESS 0x000000e8 -#define LPO_CAL_TEST_STATUS_OFFSET 0x000000e8 -#define LPO_CAL_TEST_STATUS_READY_MSB 16 -#define LPO_CAL_TEST_STATUS_READY_LSB 16 -#define LPO_CAL_TEST_STATUS_READY_MASK 0x00010000 -#define LPO_CAL_TEST_STATUS_READY_GET(x) (((x) & LPO_CAL_TEST_STATUS_READY_MASK) >> LPO_CAL_TEST_STATUS_READY_LSB) -#define LPO_CAL_TEST_STATUS_READY_SET(x) (((x) << LPO_CAL_TEST_STATUS_READY_LSB) & LPO_CAL_TEST_STATUS_READY_MASK) -#define LPO_CAL_TEST_STATUS_COUNT_MSB 15 -#define LPO_CAL_TEST_STATUS_COUNT_LSB 0 -#define LPO_CAL_TEST_STATUS_COUNT_MASK 0x0000ffff -#define LPO_CAL_TEST_STATUS_COUNT_GET(x) (((x) & LPO_CAL_TEST_STATUS_COUNT_MASK) >> LPO_CAL_TEST_STATUS_COUNT_LSB) -#define LPO_CAL_TEST_STATUS_COUNT_SET(x) (((x) << LPO_CAL_TEST_STATUS_COUNT_LSB) & LPO_CAL_TEST_STATUS_COUNT_MASK) - -#define CHIP_ID_ADDRESS 0x000000ec -#define CHIP_ID_OFFSET 0x000000ec -#define CHIP_ID_DEVICE_ID_MSB 31 -#define CHIP_ID_DEVICE_ID_LSB 16 -#define CHIP_ID_DEVICE_ID_MASK 0xffff0000 -#define CHIP_ID_DEVICE_ID_GET(x) (((x) & CHIP_ID_DEVICE_ID_MASK) >> CHIP_ID_DEVICE_ID_LSB) -#define CHIP_ID_DEVICE_ID_SET(x) (((x) << CHIP_ID_DEVICE_ID_LSB) & CHIP_ID_DEVICE_ID_MASK) -#define CHIP_ID_CONFIG_ID_MSB 15 -#define CHIP_ID_CONFIG_ID_LSB 4 -#define CHIP_ID_CONFIG_ID_MASK 0x0000fff0 -#define CHIP_ID_CONFIG_ID_GET(x) (((x) & CHIP_ID_CONFIG_ID_MASK) >> CHIP_ID_CONFIG_ID_LSB) -#define CHIP_ID_CONFIG_ID_SET(x) (((x) << CHIP_ID_CONFIG_ID_LSB) & CHIP_ID_CONFIG_ID_MASK) -#define CHIP_ID_VERSION_ID_MSB 3 -#define CHIP_ID_VERSION_ID_LSB 0 -#define CHIP_ID_VERSION_ID_MASK 0x0000000f -#define CHIP_ID_VERSION_ID_GET(x) (((x) & CHIP_ID_VERSION_ID_MASK) >> CHIP_ID_VERSION_ID_LSB) -#define CHIP_ID_VERSION_ID_SET(x) (((x) << CHIP_ID_VERSION_ID_LSB) & CHIP_ID_VERSION_ID_MASK) - -#define DERIVED_RTC_CLK_ADDRESS 0x000000f0 -#define DERIVED_RTC_CLK_OFFSET 0x000000f0 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MSB 20 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB 20 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK 0x00100000 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_GET(x) (((x) & DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK) >> DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_SET(x) (((x) << DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB) & DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_MSB 18 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB 18 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK 0x00040000 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_GET(x) (((x) & DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK) >> DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_SET(x) (((x) << DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB) & DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK) -#define DERIVED_RTC_CLK_FORCE_MSB 17 -#define DERIVED_RTC_CLK_FORCE_LSB 16 -#define DERIVED_RTC_CLK_FORCE_MASK 0x00030000 -#define DERIVED_RTC_CLK_FORCE_GET(x) (((x) & DERIVED_RTC_CLK_FORCE_MASK) >> DERIVED_RTC_CLK_FORCE_LSB) -#define DERIVED_RTC_CLK_FORCE_SET(x) (((x) << DERIVED_RTC_CLK_FORCE_LSB) & DERIVED_RTC_CLK_FORCE_MASK) -#define DERIVED_RTC_CLK_PERIOD_MSB 15 -#define DERIVED_RTC_CLK_PERIOD_LSB 1 -#define DERIVED_RTC_CLK_PERIOD_MASK 0x0000fffe -#define DERIVED_RTC_CLK_PERIOD_GET(x) (((x) & DERIVED_RTC_CLK_PERIOD_MASK) >> DERIVED_RTC_CLK_PERIOD_LSB) -#define DERIVED_RTC_CLK_PERIOD_SET(x) (((x) << DERIVED_RTC_CLK_PERIOD_LSB) & DERIVED_RTC_CLK_PERIOD_MASK) - -#define MAC_PCU_SLP32_MODE_ADDRESS 0x000000f4 -#define MAC_PCU_SLP32_MODE_OFFSET 0x000000f4 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MSB 21 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_LSB 21 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MASK 0x00200000 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_GET(x) (((x) & MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MASK) >> MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_LSB) -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_SET(x) (((x) << MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_LSB) & MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MASK) -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MSB 19 -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB 0 -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK 0x000fffff -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_GET(x) (((x) & MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK) >> MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB) -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_SET(x) (((x) << MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB) & MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK) - -#define MAC_PCU_SLP32_WAKE_ADDRESS 0x000000f8 -#define MAC_PCU_SLP32_WAKE_OFFSET 0x000000f8 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_MSB 15 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_LSB 0 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_MASK 0x0000ffff -#define MAC_PCU_SLP32_WAKE_XTL_TIME_GET(x) (((x) & MAC_PCU_SLP32_WAKE_XTL_TIME_MASK) >> MAC_PCU_SLP32_WAKE_XTL_TIME_LSB) -#define MAC_PCU_SLP32_WAKE_XTL_TIME_SET(x) (((x) << MAC_PCU_SLP32_WAKE_XTL_TIME_LSB) & MAC_PCU_SLP32_WAKE_XTL_TIME_MASK) - -#define MAC_PCU_SLP32_INC_ADDRESS 0x000000fc -#define MAC_PCU_SLP32_INC_OFFSET 0x000000fc -#define MAC_PCU_SLP32_INC_TSF_INC_MSB 19 -#define MAC_PCU_SLP32_INC_TSF_INC_LSB 0 -#define MAC_PCU_SLP32_INC_TSF_INC_MASK 0x000fffff -#define MAC_PCU_SLP32_INC_TSF_INC_GET(x) (((x) & MAC_PCU_SLP32_INC_TSF_INC_MASK) >> MAC_PCU_SLP32_INC_TSF_INC_LSB) -#define MAC_PCU_SLP32_INC_TSF_INC_SET(x) (((x) << MAC_PCU_SLP32_INC_TSF_INC_LSB) & MAC_PCU_SLP32_INC_TSF_INC_MASK) - -#define MAC_PCU_SLP_MIB1_ADDRESS 0x00000100 -#define MAC_PCU_SLP_MIB1_OFFSET 0x00000100 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_MSB 31 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB 0 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK 0xffffffff -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_GET(x) (((x) & MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK) >> MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB) -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_SET(x) (((x) << MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB) & MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK) - -#define MAC_PCU_SLP_MIB2_ADDRESS 0x00000104 -#define MAC_PCU_SLP_MIB2_OFFSET 0x00000104 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_MSB 31 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB 0 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK 0xffffffff -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_GET(x) (((x) & MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK) >> MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB) -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_SET(x) (((x) << MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB) & MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK) - -#define MAC_PCU_SLP_MIB3_ADDRESS 0x00000108 -#define MAC_PCU_SLP_MIB3_OFFSET 0x00000108 -#define MAC_PCU_SLP_MIB3_PENDING_MSB 1 -#define MAC_PCU_SLP_MIB3_PENDING_LSB 1 -#define MAC_PCU_SLP_MIB3_PENDING_MASK 0x00000002 -#define MAC_PCU_SLP_MIB3_PENDING_GET(x) (((x) & MAC_PCU_SLP_MIB3_PENDING_MASK) >> MAC_PCU_SLP_MIB3_PENDING_LSB) -#define MAC_PCU_SLP_MIB3_PENDING_SET(x) (((x) << MAC_PCU_SLP_MIB3_PENDING_LSB) & MAC_PCU_SLP_MIB3_PENDING_MASK) -#define MAC_PCU_SLP_MIB3_CLR_CNT_MSB 0 -#define MAC_PCU_SLP_MIB3_CLR_CNT_LSB 0 -#define MAC_PCU_SLP_MIB3_CLR_CNT_MASK 0x00000001 -#define MAC_PCU_SLP_MIB3_CLR_CNT_GET(x) (((x) & MAC_PCU_SLP_MIB3_CLR_CNT_MASK) >> MAC_PCU_SLP_MIB3_CLR_CNT_LSB) -#define MAC_PCU_SLP_MIB3_CLR_CNT_SET(x) (((x) << MAC_PCU_SLP_MIB3_CLR_CNT_LSB) & MAC_PCU_SLP_MIB3_CLR_CNT_MASK) - -#define MAC_PCU_SLP_BEACON_ADDRESS 0x0000010c -#define MAC_PCU_SLP_BEACON_OFFSET 0x0000010c -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MSB 24 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_LSB 24 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MASK 0x01000000 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_GET(x) (((x) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MASK) >> MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_LSB) -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_SET(x) (((x) << MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_LSB) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MASK) -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MSB 23 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_LSB 0 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MASK 0x00ffffff -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_GET(x) (((x) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MASK) >> MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_LSB) -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_SET(x) (((x) << MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_LSB) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MASK) - -#define POWER_REG_ADDRESS 0x00000110 -#define POWER_REG_OFFSET 0x00000110 -#define POWER_REG_VLVL_MSB 11 -#define POWER_REG_VLVL_LSB 8 -#define POWER_REG_VLVL_MASK 0x00000f00 -#define POWER_REG_VLVL_GET(x) (((x) & POWER_REG_VLVL_MASK) >> POWER_REG_VLVL_LSB) -#define POWER_REG_VLVL_SET(x) (((x) << POWER_REG_VLVL_LSB) & POWER_REG_VLVL_MASK) -#define POWER_REG_CPU_INT_ENABLE_MSB 7 -#define POWER_REG_CPU_INT_ENABLE_LSB 7 -#define POWER_REG_CPU_INT_ENABLE_MASK 0x00000080 -#define POWER_REG_CPU_INT_ENABLE_GET(x) (((x) & POWER_REG_CPU_INT_ENABLE_MASK) >> POWER_REG_CPU_INT_ENABLE_LSB) -#define POWER_REG_CPU_INT_ENABLE_SET(x) (((x) << POWER_REG_CPU_INT_ENABLE_LSB) & POWER_REG_CPU_INT_ENABLE_MASK) -#define POWER_REG_WLAN_ISO_DIS_MSB 6 -#define POWER_REG_WLAN_ISO_DIS_LSB 6 -#define POWER_REG_WLAN_ISO_DIS_MASK 0x00000040 -#define POWER_REG_WLAN_ISO_DIS_GET(x) (((x) & POWER_REG_WLAN_ISO_DIS_MASK) >> POWER_REG_WLAN_ISO_DIS_LSB) -#define POWER_REG_WLAN_ISO_DIS_SET(x) (((x) << POWER_REG_WLAN_ISO_DIS_LSB) & POWER_REG_WLAN_ISO_DIS_MASK) -#define POWER_REG_WLAN_ISO_CNTL_MSB 5 -#define POWER_REG_WLAN_ISO_CNTL_LSB 5 -#define POWER_REG_WLAN_ISO_CNTL_MASK 0x00000020 -#define POWER_REG_WLAN_ISO_CNTL_GET(x) (((x) & POWER_REG_WLAN_ISO_CNTL_MASK) >> POWER_REG_WLAN_ISO_CNTL_LSB) -#define POWER_REG_WLAN_ISO_CNTL_SET(x) (((x) << POWER_REG_WLAN_ISO_CNTL_LSB) & POWER_REG_WLAN_ISO_CNTL_MASK) -#define POWER_REG_RADIO_PWD_EN_MSB 4 -#define POWER_REG_RADIO_PWD_EN_LSB 4 -#define POWER_REG_RADIO_PWD_EN_MASK 0x00000010 -#define POWER_REG_RADIO_PWD_EN_GET(x) (((x) & POWER_REG_RADIO_PWD_EN_MASK) >> POWER_REG_RADIO_PWD_EN_LSB) -#define POWER_REG_RADIO_PWD_EN_SET(x) (((x) << POWER_REG_RADIO_PWD_EN_LSB) & POWER_REG_RADIO_PWD_EN_MASK) -#define POWER_REG_SOC_SCALE_EN_MSB 3 -#define POWER_REG_SOC_SCALE_EN_LSB 3 -#define POWER_REG_SOC_SCALE_EN_MASK 0x00000008 -#define POWER_REG_SOC_SCALE_EN_GET(x) (((x) & POWER_REG_SOC_SCALE_EN_MASK) >> POWER_REG_SOC_SCALE_EN_LSB) -#define POWER_REG_SOC_SCALE_EN_SET(x) (((x) << POWER_REG_SOC_SCALE_EN_LSB) & POWER_REG_SOC_SCALE_EN_MASK) -#define POWER_REG_WLAN_SCALE_EN_MSB 2 -#define POWER_REG_WLAN_SCALE_EN_LSB 2 -#define POWER_REG_WLAN_SCALE_EN_MASK 0x00000004 -#define POWER_REG_WLAN_SCALE_EN_GET(x) (((x) & POWER_REG_WLAN_SCALE_EN_MASK) >> POWER_REG_WLAN_SCALE_EN_LSB) -#define POWER_REG_WLAN_SCALE_EN_SET(x) (((x) << POWER_REG_WLAN_SCALE_EN_LSB) & POWER_REG_WLAN_SCALE_EN_MASK) -#define POWER_REG_WLAN_PWD_EN_MSB 1 -#define POWER_REG_WLAN_PWD_EN_LSB 1 -#define POWER_REG_WLAN_PWD_EN_MASK 0x00000002 -#define POWER_REG_WLAN_PWD_EN_GET(x) (((x) & POWER_REG_WLAN_PWD_EN_MASK) >> POWER_REG_WLAN_PWD_EN_LSB) -#define POWER_REG_WLAN_PWD_EN_SET(x) (((x) << POWER_REG_WLAN_PWD_EN_LSB) & POWER_REG_WLAN_PWD_EN_MASK) -#define POWER_REG_POWER_EN_MSB 0 -#define POWER_REG_POWER_EN_LSB 0 -#define POWER_REG_POWER_EN_MASK 0x00000001 -#define POWER_REG_POWER_EN_GET(x) (((x) & POWER_REG_POWER_EN_MASK) >> POWER_REG_POWER_EN_LSB) -#define POWER_REG_POWER_EN_SET(x) (((x) << POWER_REG_POWER_EN_LSB) & POWER_REG_POWER_EN_MASK) - -#define CORE_CLK_CTRL_ADDRESS 0x00000114 -#define CORE_CLK_CTRL_OFFSET 0x00000114 -#define CORE_CLK_CTRL_DIV_MSB 2 -#define CORE_CLK_CTRL_DIV_LSB 0 -#define CORE_CLK_CTRL_DIV_MASK 0x00000007 -#define CORE_CLK_CTRL_DIV_GET(x) (((x) & CORE_CLK_CTRL_DIV_MASK) >> CORE_CLK_CTRL_DIV_LSB) -#define CORE_CLK_CTRL_DIV_SET(x) (((x) << CORE_CLK_CTRL_DIV_LSB) & CORE_CLK_CTRL_DIV_MASK) - -#define SDIO_SETUP_CIRCUIT_ADDRESS 0x00000120 -#define SDIO_SETUP_CIRCUIT_OFFSET 0x00000120 -#define SDIO_SETUP_CIRCUIT_VECTOR_MSB 7 -#define SDIO_SETUP_CIRCUIT_VECTOR_LSB 0 -#define SDIO_SETUP_CIRCUIT_VECTOR_MASK 0x000000ff -#define SDIO_SETUP_CIRCUIT_VECTOR_GET(x) (((x) & SDIO_SETUP_CIRCUIT_VECTOR_MASK) >> SDIO_SETUP_CIRCUIT_VECTOR_LSB) -#define SDIO_SETUP_CIRCUIT_VECTOR_SET(x) (((x) << SDIO_SETUP_CIRCUIT_VECTOR_LSB) & SDIO_SETUP_CIRCUIT_VECTOR_MASK) - -#define SDIO_SETUP_CONFIG_ADDRESS 0x00000140 -#define SDIO_SETUP_CONFIG_OFFSET 0x00000140 -#define SDIO_SETUP_CONFIG_ENABLE_MSB 1 -#define SDIO_SETUP_CONFIG_ENABLE_LSB 1 -#define SDIO_SETUP_CONFIG_ENABLE_MASK 0x00000002 -#define SDIO_SETUP_CONFIG_ENABLE_GET(x) (((x) & SDIO_SETUP_CONFIG_ENABLE_MASK) >> SDIO_SETUP_CONFIG_ENABLE_LSB) -#define SDIO_SETUP_CONFIG_ENABLE_SET(x) (((x) << SDIO_SETUP_CONFIG_ENABLE_LSB) & SDIO_SETUP_CONFIG_ENABLE_MASK) -#define SDIO_SETUP_CONFIG_CLEAR_MSB 0 -#define SDIO_SETUP_CONFIG_CLEAR_LSB 0 -#define SDIO_SETUP_CONFIG_CLEAR_MASK 0x00000001 -#define SDIO_SETUP_CONFIG_CLEAR_GET(x) (((x) & SDIO_SETUP_CONFIG_CLEAR_MASK) >> SDIO_SETUP_CONFIG_CLEAR_LSB) -#define SDIO_SETUP_CONFIG_CLEAR_SET(x) (((x) << SDIO_SETUP_CONFIG_CLEAR_LSB) & SDIO_SETUP_CONFIG_CLEAR_MASK) - -#define CPU_SETUP_CONFIG_ADDRESS 0x00000144 -#define CPU_SETUP_CONFIG_OFFSET 0x00000144 -#define CPU_SETUP_CONFIG_ENABLE_MSB 1 -#define CPU_SETUP_CONFIG_ENABLE_LSB 1 -#define CPU_SETUP_CONFIG_ENABLE_MASK 0x00000002 -#define CPU_SETUP_CONFIG_ENABLE_GET(x) (((x) & CPU_SETUP_CONFIG_ENABLE_MASK) >> CPU_SETUP_CONFIG_ENABLE_LSB) -#define CPU_SETUP_CONFIG_ENABLE_SET(x) (((x) << CPU_SETUP_CONFIG_ENABLE_LSB) & CPU_SETUP_CONFIG_ENABLE_MASK) -#define CPU_SETUP_CONFIG_CLEAR_MSB 0 -#define CPU_SETUP_CONFIG_CLEAR_LSB 0 -#define CPU_SETUP_CONFIG_CLEAR_MASK 0x00000001 -#define CPU_SETUP_CONFIG_CLEAR_GET(x) (((x) & CPU_SETUP_CONFIG_CLEAR_MASK) >> CPU_SETUP_CONFIG_CLEAR_LSB) -#define CPU_SETUP_CONFIG_CLEAR_SET(x) (((x) << CPU_SETUP_CONFIG_CLEAR_LSB) & CPU_SETUP_CONFIG_CLEAR_MASK) - -#define CPU_SETUP_CIRCUIT_ADDRESS 0x00000160 -#define CPU_SETUP_CIRCUIT_OFFSET 0x00000160 -#define CPU_SETUP_CIRCUIT_VECTOR_MSB 7 -#define CPU_SETUP_CIRCUIT_VECTOR_LSB 0 -#define CPU_SETUP_CIRCUIT_VECTOR_MASK 0x000000ff -#define CPU_SETUP_CIRCUIT_VECTOR_GET(x) (((x) & CPU_SETUP_CIRCUIT_VECTOR_MASK) >> CPU_SETUP_CIRCUIT_VECTOR_LSB) -#define CPU_SETUP_CIRCUIT_VECTOR_SET(x) (((x) << CPU_SETUP_CIRCUIT_VECTOR_LSB) & CPU_SETUP_CIRCUIT_VECTOR_MASK) - -#define BB_SETUP_CONFIG_ADDRESS 0x00000180 -#define BB_SETUP_CONFIG_OFFSET 0x00000180 -#define BB_SETUP_CONFIG_ENABLE_MSB 1 -#define BB_SETUP_CONFIG_ENABLE_LSB 1 -#define BB_SETUP_CONFIG_ENABLE_MASK 0x00000002 -#define BB_SETUP_CONFIG_ENABLE_GET(x) (((x) & BB_SETUP_CONFIG_ENABLE_MASK) >> BB_SETUP_CONFIG_ENABLE_LSB) -#define BB_SETUP_CONFIG_ENABLE_SET(x) (((x) << BB_SETUP_CONFIG_ENABLE_LSB) & BB_SETUP_CONFIG_ENABLE_MASK) -#define BB_SETUP_CONFIG_CLEAR_MSB 0 -#define BB_SETUP_CONFIG_CLEAR_LSB 0 -#define BB_SETUP_CONFIG_CLEAR_MASK 0x00000001 -#define BB_SETUP_CONFIG_CLEAR_GET(x) (((x) & BB_SETUP_CONFIG_CLEAR_MASK) >> BB_SETUP_CONFIG_CLEAR_LSB) -#define BB_SETUP_CONFIG_CLEAR_SET(x) (((x) << BB_SETUP_CONFIG_CLEAR_LSB) & BB_SETUP_CONFIG_CLEAR_MASK) - -#define BB_SETUP_CIRCUIT_ADDRESS 0x000001a0 -#define BB_SETUP_CIRCUIT_OFFSET 0x000001a0 -#define BB_SETUP_CIRCUIT_VECTOR_MSB 7 -#define BB_SETUP_CIRCUIT_VECTOR_LSB 0 -#define BB_SETUP_CIRCUIT_VECTOR_MASK 0x000000ff -#define BB_SETUP_CIRCUIT_VECTOR_GET(x) (((x) & BB_SETUP_CIRCUIT_VECTOR_MASK) >> BB_SETUP_CIRCUIT_VECTOR_LSB) -#define BB_SETUP_CIRCUIT_VECTOR_SET(x) (((x) << BB_SETUP_CIRCUIT_VECTOR_LSB) & BB_SETUP_CIRCUIT_VECTOR_MASK) - -#define GPIO_WAKEUP_CONTROL_ADDRESS 0x000001c0 -#define GPIO_WAKEUP_CONTROL_OFFSET 0x000001c0 -#define GPIO_WAKEUP_CONTROL_ENABLE_MSB 0 -#define GPIO_WAKEUP_CONTROL_ENABLE_LSB 0 -#define GPIO_WAKEUP_CONTROL_ENABLE_MASK 0x00000001 -#define GPIO_WAKEUP_CONTROL_ENABLE_GET(x) (((x) & GPIO_WAKEUP_CONTROL_ENABLE_MASK) >> GPIO_WAKEUP_CONTROL_ENABLE_LSB) -#define GPIO_WAKEUP_CONTROL_ENABLE_SET(x) (((x) << GPIO_WAKEUP_CONTROL_ENABLE_LSB) & GPIO_WAKEUP_CONTROL_ENABLE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct rtc_reg_reg_s { - volatile unsigned int reset_control; - volatile unsigned int xtal_control; - volatile unsigned int tcxo_detect; - volatile unsigned int xtal_test; - volatile unsigned int quadrature; - volatile unsigned int pll_control; - volatile unsigned int pll_settle; - volatile unsigned int xtal_settle; - volatile unsigned int cpu_clock; - volatile unsigned int clock_out; - volatile unsigned int clock_control; - volatile unsigned int bias_override; - volatile unsigned int wdt_control; - volatile unsigned int wdt_status; - volatile unsigned int wdt; - volatile unsigned int wdt_count; - volatile unsigned int wdt_reset; - volatile unsigned int int_status; - volatile unsigned int lf_timer0; - volatile unsigned int lf_timer_count0; - volatile unsigned int lf_timer_control0; - volatile unsigned int lf_timer_status0; - volatile unsigned int lf_timer1; - volatile unsigned int lf_timer_count1; - volatile unsigned int lf_timer_control1; - volatile unsigned int lf_timer_status1; - volatile unsigned int lf_timer2; - volatile unsigned int lf_timer_count2; - volatile unsigned int lf_timer_control2; - volatile unsigned int lf_timer_status2; - volatile unsigned int lf_timer3; - volatile unsigned int lf_timer_count3; - volatile unsigned int lf_timer_control3; - volatile unsigned int lf_timer_status3; - volatile unsigned int hf_timer; - volatile unsigned int hf_timer_count; - volatile unsigned int hf_lf_count; - volatile unsigned int hf_timer_control; - volatile unsigned int hf_timer_status; - volatile unsigned int rtc_control; - volatile unsigned int rtc_time; - volatile unsigned int rtc_date; - volatile unsigned int rtc_set_time; - volatile unsigned int rtc_set_date; - volatile unsigned int rtc_set_alarm; - volatile unsigned int rtc_config; - volatile unsigned int rtc_alarm_status; - volatile unsigned int uart_wakeup; - volatile unsigned int reset_cause; - volatile unsigned int system_sleep; - volatile unsigned int sdio_wrapper; - volatile unsigned int mac_sleep_control; - volatile unsigned int keep_awake; - volatile unsigned int lpo_cal_time; - volatile unsigned int lpo_init_dividend_int; - volatile unsigned int lpo_init_dividend_fraction; - volatile unsigned int lpo_cal; - volatile unsigned int lpo_cal_test_control; - volatile unsigned int lpo_cal_test_status; - volatile unsigned int chip_id; - volatile unsigned int derived_rtc_clk; - volatile unsigned int mac_pcu_slp32_mode; - volatile unsigned int mac_pcu_slp32_wake; - volatile unsigned int mac_pcu_slp32_inc; - volatile unsigned int mac_pcu_slp_mib1; - volatile unsigned int mac_pcu_slp_mib2; - volatile unsigned int mac_pcu_slp_mib3; - volatile unsigned int mac_pcu_slp_beacon; - volatile unsigned int power_reg; - volatile unsigned int core_clk_ctrl; - unsigned char pad0[8]; /* pad to 0x120 */ - volatile unsigned int sdio_setup_circuit[8]; - volatile unsigned int sdio_setup_config; - volatile unsigned int cpu_setup_config; - unsigned char pad1[24]; /* pad to 0x160 */ - volatile unsigned int cpu_setup_circuit[8]; - volatile unsigned int bb_setup_config; - unsigned char pad2[28]; /* pad to 0x1a0 */ - volatile unsigned int bb_setup_circuit[8]; - volatile unsigned int gpio_wakeup_control; -} rtc_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _RTC_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rtc_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rtc_reg.vrh deleted file mode 100644 index a95f3422d38b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rtc_reg.vrh +++ /dev/null @@ -1,1758 +0,0 @@ -#ifndef _RTC_REG_VRH_ -#define _RTC_REG_VRH_ - -#define RESET_CONTROL_ADDRESS 'h00000000 -#define RESET_CONTROL_CPU_INIT_RESET_MSB 11 -#define RESET_CONTROL_CPU_INIT_RESET_LSB 11 -#define RESET_CONTROL_CPU_INIT_RESET_MASK 'h00000800 -#define RESET_CONTROL_CPU_INIT_RESET_GET(x) (((x) & RESET_CONTROL_CPU_INIT_RESET_MASK) >> RESET_CONTROL_CPU_INIT_RESET_LSB) -#define RESET_CONTROL_CPU_INIT_RESET_SET(x) (((32'd0 | (x)) << RESET_CONTROL_CPU_INIT_RESET_LSB) & RESET_CONTROL_CPU_INIT_RESET_MASK) -#define RESET_CONTROL_CPU_INIT_RESET_RESET 1'h1 -#define RESET_CONTROL_VMC_REMAP_RESET_MSB 10 -#define RESET_CONTROL_VMC_REMAP_RESET_LSB 10 -#define RESET_CONTROL_VMC_REMAP_RESET_MASK 'h00000400 -#define RESET_CONTROL_VMC_REMAP_RESET_GET(x) (((x) & RESET_CONTROL_VMC_REMAP_RESET_MASK) >> RESET_CONTROL_VMC_REMAP_RESET_LSB) -#define RESET_CONTROL_VMC_REMAP_RESET_SET(x) (((32'd0 | (x)) << RESET_CONTROL_VMC_REMAP_RESET_LSB) & RESET_CONTROL_VMC_REMAP_RESET_MASK) -#define RESET_CONTROL_VMC_REMAP_RESET_RESET 1'h0 -#define RESET_CONTROL_RST_OUT_MSB 9 -#define RESET_CONTROL_RST_OUT_LSB 9 -#define RESET_CONTROL_RST_OUT_MASK 'h00000200 -#define RESET_CONTROL_RST_OUT_GET(x) (((x) & RESET_CONTROL_RST_OUT_MASK) >> RESET_CONTROL_RST_OUT_LSB) -#define RESET_CONTROL_RST_OUT_SET(x) (((32'd0 | (x)) << RESET_CONTROL_RST_OUT_LSB) & RESET_CONTROL_RST_OUT_MASK) -#define RESET_CONTROL_RST_OUT_RESET 1'h0 -#define RESET_CONTROL_COLD_RST_MSB 8 -#define RESET_CONTROL_COLD_RST_LSB 8 -#define RESET_CONTROL_COLD_RST_MASK 'h00000100 -#define RESET_CONTROL_COLD_RST_GET(x) (((x) & RESET_CONTROL_COLD_RST_MASK) >> RESET_CONTROL_COLD_RST_LSB) -#define RESET_CONTROL_COLD_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_COLD_RST_LSB) & RESET_CONTROL_COLD_RST_MASK) -#define RESET_CONTROL_COLD_RST_RESET 1'h0 -#define RESET_CONTROL_WARM_RST_MSB 7 -#define RESET_CONTROL_WARM_RST_LSB 7 -#define RESET_CONTROL_WARM_RST_MASK 'h00000080 -#define RESET_CONTROL_WARM_RST_GET(x) (((x) & RESET_CONTROL_WARM_RST_MASK) >> RESET_CONTROL_WARM_RST_LSB) -#define RESET_CONTROL_WARM_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_WARM_RST_LSB) & RESET_CONTROL_WARM_RST_MASK) -#define RESET_CONTROL_WARM_RST_RESET 1'h0 -#define RESET_CONTROL_CPU_WARM_RST_MSB 6 -#define RESET_CONTROL_CPU_WARM_RST_LSB 6 -#define RESET_CONTROL_CPU_WARM_RST_MASK 'h00000040 -#define RESET_CONTROL_CPU_WARM_RST_GET(x) (((x) & RESET_CONTROL_CPU_WARM_RST_MASK) >> RESET_CONTROL_CPU_WARM_RST_LSB) -#define RESET_CONTROL_CPU_WARM_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_CPU_WARM_RST_LSB) & RESET_CONTROL_CPU_WARM_RST_MASK) -#define RESET_CONTROL_CPU_WARM_RST_RESET 1'h0 -#define RESET_CONTROL_MAC_COLD_RST_MSB 5 -#define RESET_CONTROL_MAC_COLD_RST_LSB 5 -#define RESET_CONTROL_MAC_COLD_RST_MASK 'h00000020 -#define RESET_CONTROL_MAC_COLD_RST_GET(x) (((x) & RESET_CONTROL_MAC_COLD_RST_MASK) >> RESET_CONTROL_MAC_COLD_RST_LSB) -#define RESET_CONTROL_MAC_COLD_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_MAC_COLD_RST_LSB) & RESET_CONTROL_MAC_COLD_RST_MASK) -#define RESET_CONTROL_MAC_COLD_RST_RESET 1'h1 -#define RESET_CONTROL_MAC_WARM_RST_MSB 4 -#define RESET_CONTROL_MAC_WARM_RST_LSB 4 -#define RESET_CONTROL_MAC_WARM_RST_MASK 'h00000010 -#define RESET_CONTROL_MAC_WARM_RST_GET(x) (((x) & RESET_CONTROL_MAC_WARM_RST_MASK) >> RESET_CONTROL_MAC_WARM_RST_LSB) -#define RESET_CONTROL_MAC_WARM_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_MAC_WARM_RST_LSB) & RESET_CONTROL_MAC_WARM_RST_MASK) -#define RESET_CONTROL_MAC_WARM_RST_RESET 1'h1 -#define RESET_CONTROL_MBOX_RST_MSB 2 -#define RESET_CONTROL_MBOX_RST_LSB 2 -#define RESET_CONTROL_MBOX_RST_MASK 'h00000004 -#define RESET_CONTROL_MBOX_RST_GET(x) (((x) & RESET_CONTROL_MBOX_RST_MASK) >> RESET_CONTROL_MBOX_RST_LSB) -#define RESET_CONTROL_MBOX_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_MBOX_RST_LSB) & RESET_CONTROL_MBOX_RST_MASK) -#define RESET_CONTROL_MBOX_RST_RESET 1'h0 -#define RESET_CONTROL_UART_RST_MSB 1 -#define RESET_CONTROL_UART_RST_LSB 1 -#define RESET_CONTROL_UART_RST_MASK 'h00000002 -#define RESET_CONTROL_UART_RST_GET(x) (((x) & RESET_CONTROL_UART_RST_MASK) >> RESET_CONTROL_UART_RST_LSB) -#define RESET_CONTROL_UART_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_UART_RST_LSB) & RESET_CONTROL_UART_RST_MASK) -#define RESET_CONTROL_UART_RST_RESET 1'h0 -#define RESET_CONTROL_SI0_RST_MSB 0 -#define RESET_CONTROL_SI0_RST_LSB 0 -#define RESET_CONTROL_SI0_RST_MASK 'h00000001 -#define RESET_CONTROL_SI0_RST_GET(x) (((x) & RESET_CONTROL_SI0_RST_MASK) >> RESET_CONTROL_SI0_RST_LSB) -#define RESET_CONTROL_SI0_RST_SET(x) (((32'd0 | (x)) << RESET_CONTROL_SI0_RST_LSB) & RESET_CONTROL_SI0_RST_MASK) -#define RESET_CONTROL_SI0_RST_RESET 1'h0 -#define RESET_CONTROL_RESET (32'h0 | \ - RESET_CONTROL_CPU_INIT_RESET_SET(RESET_CONTROL_CPU_INIT_RESET_RESET) | \ - RESET_CONTROL_VMC_REMAP_RESET_SET(RESET_CONTROL_VMC_REMAP_RESET_RESET) | \ - RESET_CONTROL_RST_OUT_SET(RESET_CONTROL_RST_OUT_RESET) | \ - RESET_CONTROL_COLD_RST_SET(RESET_CONTROL_COLD_RST_RESET) | \ - RESET_CONTROL_WARM_RST_SET(RESET_CONTROL_WARM_RST_RESET) | \ - RESET_CONTROL_CPU_WARM_RST_SET(RESET_CONTROL_CPU_WARM_RST_RESET) | \ - RESET_CONTROL_MAC_COLD_RST_SET(RESET_CONTROL_MAC_COLD_RST_RESET) | \ - RESET_CONTROL_MAC_WARM_RST_SET(RESET_CONTROL_MAC_WARM_RST_RESET) | \ - RESET_CONTROL_MBOX_RST_SET(RESET_CONTROL_MBOX_RST_RESET) | \ - RESET_CONTROL_UART_RST_SET(RESET_CONTROL_UART_RST_RESET) | \ - RESET_CONTROL_SI0_RST_SET(RESET_CONTROL_SI0_RST_RESET)) -#define RESET_CONTROL_HW_MASK (32'h0 | \ - RESET_CONTROL_WARM_RST_MASK | \ - RESET_CONTROL_CPU_WARM_RST_MASK | \ - RESET_CONTROL_MAC_COLD_RST_MASK | \ - RESET_CONTROL_MAC_WARM_RST_MASK) -#define RESET_CONTROL_SW_MASK (32'h0 | \ - RESET_CONTROL_CPU_INIT_RESET_MASK | \ - RESET_CONTROL_VMC_REMAP_RESET_MASK | \ - RESET_CONTROL_RST_OUT_MASK | \ - RESET_CONTROL_COLD_RST_MASK | \ - RESET_CONTROL_WARM_RST_MASK | \ - RESET_CONTROL_CPU_WARM_RST_MASK | \ - RESET_CONTROL_MAC_COLD_RST_MASK | \ - RESET_CONTROL_MAC_WARM_RST_MASK | \ - RESET_CONTROL_MBOX_RST_MASK | \ - RESET_CONTROL_UART_RST_MASK | \ - RESET_CONTROL_SI0_RST_MASK) - -#define XTAL_CONTROL_ADDRESS 'h00000004 -#define XTAL_CONTROL_TCXO_MSB 0 -#define XTAL_CONTROL_TCXO_LSB 0 -#define XTAL_CONTROL_TCXO_MASK 'h00000001 -#define XTAL_CONTROL_TCXO_GET(x) (((x) & XTAL_CONTROL_TCXO_MASK) >> XTAL_CONTROL_TCXO_LSB) -#define XTAL_CONTROL_TCXO_SET(x) (((32'd0 | (x)) << XTAL_CONTROL_TCXO_LSB) & XTAL_CONTROL_TCXO_MASK) -#define XTAL_CONTROL_TCXO_RESET 1'h0 -#define XTAL_CONTROL_RESET (32'h0 | \ - XTAL_CONTROL_TCXO_SET(XTAL_CONTROL_TCXO_RESET)) -#define XTAL_CONTROL_HW_MASK (32'h0) -#define XTAL_CONTROL_SW_MASK (32'h0 | \ - XTAL_CONTROL_TCXO_MASK) - -#define TCXO_DETECT_ADDRESS 'h00000008 -#define TCXO_DETECT_PRESENT_MSB 0 -#define TCXO_DETECT_PRESENT_LSB 0 -#define TCXO_DETECT_PRESENT_MASK 'h00000001 -#define TCXO_DETECT_PRESENT_GET(x) (((x) & TCXO_DETECT_PRESENT_MASK) >> TCXO_DETECT_PRESENT_LSB) -#define TCXO_DETECT_PRESENT_SET(x) (((32'd0 | (x)) << TCXO_DETECT_PRESENT_LSB) & TCXO_DETECT_PRESENT_MASK) -#define TCXO_DETECT_PRESENT_RESET 1'h0 -#define TCXO_DETECT_RESET (32'h0 | \ - TCXO_DETECT_PRESENT_SET(TCXO_DETECT_PRESENT_RESET)) -#define TCXO_DETECT_HW_MASK (32'h0 | \ - TCXO_DETECT_PRESENT_MASK) -#define TCXO_DETECT_SW_MASK (32'h0) - -#define XTAL_TEST_ADDRESS 'h0000000c -#define XTAL_TEST_NOTCXODET_MSB 0 -#define XTAL_TEST_NOTCXODET_LSB 0 -#define XTAL_TEST_NOTCXODET_MASK 'h00000001 -#define XTAL_TEST_NOTCXODET_GET(x) (((x) & XTAL_TEST_NOTCXODET_MASK) >> XTAL_TEST_NOTCXODET_LSB) -#define XTAL_TEST_NOTCXODET_SET(x) (((32'd0 | (x)) << XTAL_TEST_NOTCXODET_LSB) & XTAL_TEST_NOTCXODET_MASK) -#define XTAL_TEST_NOTCXODET_RESET 1'h0 -#define XTAL_TEST_RESET (32'h0 | \ - XTAL_TEST_NOTCXODET_SET(XTAL_TEST_NOTCXODET_RESET)) -#define XTAL_TEST_HW_MASK (32'h0) -#define XTAL_TEST_SW_MASK (32'h0 | \ - XTAL_TEST_NOTCXODET_MASK) - -#define QUADRATURE_ADDRESS 'h00000010 -#define QUADRATURE_ADC_MSB 5 -#define QUADRATURE_ADC_LSB 4 -#define QUADRATURE_ADC_MASK 'h00000030 -#define QUADRATURE_ADC_GET(x) (((x) & QUADRATURE_ADC_MASK) >> QUADRATURE_ADC_LSB) -#define QUADRATURE_ADC_SET(x) (((32'd0 | (x)) << QUADRATURE_ADC_LSB) & QUADRATURE_ADC_MASK) -#define QUADRATURE_ADC_RESET 2'h0 -#define QUADRATURE_SEL_MSB 2 -#define QUADRATURE_SEL_LSB 2 -#define QUADRATURE_SEL_MASK 'h00000004 -#define QUADRATURE_SEL_GET(x) (((x) & QUADRATURE_SEL_MASK) >> QUADRATURE_SEL_LSB) -#define QUADRATURE_SEL_SET(x) (((32'd0 | (x)) << QUADRATURE_SEL_LSB) & QUADRATURE_SEL_MASK) -#define QUADRATURE_SEL_RESET 1'h0 -#define QUADRATURE_DAC_MSB 1 -#define QUADRATURE_DAC_LSB 0 -#define QUADRATURE_DAC_MASK 'h00000003 -#define QUADRATURE_DAC_GET(x) (((x) & QUADRATURE_DAC_MASK) >> QUADRATURE_DAC_LSB) -#define QUADRATURE_DAC_SET(x) (((32'd0 | (x)) << QUADRATURE_DAC_LSB) & QUADRATURE_DAC_MASK) -#define QUADRATURE_DAC_RESET 2'h2 -#define QUADRATURE_RESET (32'h0 | \ - QUADRATURE_ADC_SET(QUADRATURE_ADC_RESET) | \ - QUADRATURE_SEL_SET(QUADRATURE_SEL_RESET) | \ - QUADRATURE_DAC_SET(QUADRATURE_DAC_RESET)) -#define QUADRATURE_HW_MASK (32'h0) -#define QUADRATURE_SW_MASK (32'h0 | \ - QUADRATURE_ADC_MASK | \ - QUADRATURE_SEL_MASK | \ - QUADRATURE_DAC_MASK) - -#define PLL_CONTROL_ADDRESS 'h00000014 -#define PLL_CONTROL_DIG_TEST_CLK_MSB 20 -#define PLL_CONTROL_DIG_TEST_CLK_LSB 20 -#define PLL_CONTROL_DIG_TEST_CLK_MASK 'h00100000 -#define PLL_CONTROL_DIG_TEST_CLK_GET(x) (((x) & PLL_CONTROL_DIG_TEST_CLK_MASK) >> PLL_CONTROL_DIG_TEST_CLK_LSB) -#define PLL_CONTROL_DIG_TEST_CLK_SET(x) (((32'd0 | (x)) << PLL_CONTROL_DIG_TEST_CLK_LSB) & PLL_CONTROL_DIG_TEST_CLK_MASK) -#define PLL_CONTROL_DIG_TEST_CLK_RESET 1'h0 -#define PLL_CONTROL_MAC_OVERRIDE_MSB 19 -#define PLL_CONTROL_MAC_OVERRIDE_LSB 19 -#define PLL_CONTROL_MAC_OVERRIDE_MASK 'h00080000 -#define PLL_CONTROL_MAC_OVERRIDE_GET(x) (((x) & PLL_CONTROL_MAC_OVERRIDE_MASK) >> PLL_CONTROL_MAC_OVERRIDE_LSB) -#define PLL_CONTROL_MAC_OVERRIDE_SET(x) (((32'd0 | (x)) << PLL_CONTROL_MAC_OVERRIDE_LSB) & PLL_CONTROL_MAC_OVERRIDE_MASK) -#define PLL_CONTROL_MAC_OVERRIDE_RESET 1'h0 -#define PLL_CONTROL_NOPWD_MSB 18 -#define PLL_CONTROL_NOPWD_LSB 18 -#define PLL_CONTROL_NOPWD_MASK 'h00040000 -#define PLL_CONTROL_NOPWD_GET(x) (((x) & PLL_CONTROL_NOPWD_MASK) >> PLL_CONTROL_NOPWD_LSB) -#define PLL_CONTROL_NOPWD_SET(x) (((32'd0 | (x)) << PLL_CONTROL_NOPWD_LSB) & PLL_CONTROL_NOPWD_MASK) -#define PLL_CONTROL_NOPWD_RESET 1'h0 -#define PLL_CONTROL_UPDATING_MSB 17 -#define PLL_CONTROL_UPDATING_LSB 17 -#define PLL_CONTROL_UPDATING_MASK 'h00020000 -#define PLL_CONTROL_UPDATING_GET(x) (((x) & PLL_CONTROL_UPDATING_MASK) >> PLL_CONTROL_UPDATING_LSB) -#define PLL_CONTROL_UPDATING_SET(x) (((32'd0 | (x)) << PLL_CONTROL_UPDATING_LSB) & PLL_CONTROL_UPDATING_MASK) -#define PLL_CONTROL_UPDATING_RESET 1'h0 -#define PLL_CONTROL_BYPASS_MSB 16 -#define PLL_CONTROL_BYPASS_LSB 16 -#define PLL_CONTROL_BYPASS_MASK 'h00010000 -#define PLL_CONTROL_BYPASS_GET(x) (((x) & PLL_CONTROL_BYPASS_MASK) >> PLL_CONTROL_BYPASS_LSB) -#define PLL_CONTROL_BYPASS_SET(x) (((32'd0 | (x)) << PLL_CONTROL_BYPASS_LSB) & PLL_CONTROL_BYPASS_MASK) -#define PLL_CONTROL_BYPASS_RESET 1'h1 -#define PLL_CONTROL_REFDIV_MSB 15 -#define PLL_CONTROL_REFDIV_LSB 12 -#define PLL_CONTROL_REFDIV_MASK 'h0000f000 -#define PLL_CONTROL_REFDIV_GET(x) (((x) & PLL_CONTROL_REFDIV_MASK) >> PLL_CONTROL_REFDIV_LSB) -#define PLL_CONTROL_REFDIV_SET(x) (((32'd0 | (x)) << PLL_CONTROL_REFDIV_LSB) & PLL_CONTROL_REFDIV_MASK) -#define PLL_CONTROL_REFDIV_RESET 4'h5 -#define PLL_CONTROL_DIV_MSB 9 -#define PLL_CONTROL_DIV_LSB 0 -#define PLL_CONTROL_DIV_MASK 'h000003ff -#define PLL_CONTROL_DIV_GET(x) (((x) & PLL_CONTROL_DIV_MASK) >> PLL_CONTROL_DIV_LSB) -#define PLL_CONTROL_DIV_SET(x) (((32'd0 | (x)) << PLL_CONTROL_DIV_LSB) & PLL_CONTROL_DIV_MASK) -#define PLL_CONTROL_DIV_RESET 10'h28 -#define PLL_CONTROL_RESET (32'h0 | \ - PLL_CONTROL_DIG_TEST_CLK_SET(PLL_CONTROL_DIG_TEST_CLK_RESET) | \ - PLL_CONTROL_MAC_OVERRIDE_SET(PLL_CONTROL_MAC_OVERRIDE_RESET) | \ - PLL_CONTROL_NOPWD_SET(PLL_CONTROL_NOPWD_RESET) | \ - PLL_CONTROL_UPDATING_SET(PLL_CONTROL_UPDATING_RESET) | \ - PLL_CONTROL_BYPASS_SET(PLL_CONTROL_BYPASS_RESET) | \ - PLL_CONTROL_REFDIV_SET(PLL_CONTROL_REFDIV_RESET) | \ - PLL_CONTROL_DIV_SET(PLL_CONTROL_DIV_RESET)) -#define PLL_CONTROL_HW_MASK (32'h0 | \ - PLL_CONTROL_UPDATING_MASK) -#define PLL_CONTROL_SW_MASK (32'h0 | \ - PLL_CONTROL_DIG_TEST_CLK_MASK | \ - PLL_CONTROL_MAC_OVERRIDE_MASK | \ - PLL_CONTROL_NOPWD_MASK | \ - PLL_CONTROL_BYPASS_MASK | \ - PLL_CONTROL_REFDIV_MASK | \ - PLL_CONTROL_DIV_MASK) - -#define PLL_SETTLE_ADDRESS 'h00000018 -#define PLL_SETTLE_TIME_MSB 11 -#define PLL_SETTLE_TIME_LSB 0 -#define PLL_SETTLE_TIME_MASK 'h00000fff -#define PLL_SETTLE_TIME_GET(x) (((x) & PLL_SETTLE_TIME_MASK) >> PLL_SETTLE_TIME_LSB) -#define PLL_SETTLE_TIME_SET(x) (((32'd0 | (x)) << PLL_SETTLE_TIME_LSB) & PLL_SETTLE_TIME_MASK) -#define PLL_SETTLE_TIME_RESET 12'h400 -#define PLL_SETTLE_RESET (32'h0 | \ - PLL_SETTLE_TIME_SET(PLL_SETTLE_TIME_RESET)) -#define PLL_SETTLE_HW_MASK (32'h0) -#define PLL_SETTLE_SW_MASK (32'h0 | \ - PLL_SETTLE_TIME_MASK) - -#define XTAL_SETTLE_ADDRESS 'h0000001c -#define XTAL_SETTLE_TIME_MSB 7 -#define XTAL_SETTLE_TIME_LSB 0 -#define XTAL_SETTLE_TIME_MASK 'h000000ff -#define XTAL_SETTLE_TIME_GET(x) (((x) & XTAL_SETTLE_TIME_MASK) >> XTAL_SETTLE_TIME_LSB) -#define XTAL_SETTLE_TIME_SET(x) (((32'd0 | (x)) << XTAL_SETTLE_TIME_LSB) & XTAL_SETTLE_TIME_MASK) -#define XTAL_SETTLE_TIME_RESET 8'h7f -#define XTAL_SETTLE_RESET (32'h0 | \ - XTAL_SETTLE_TIME_SET(XTAL_SETTLE_TIME_RESET)) -#define XTAL_SETTLE_HW_MASK (32'h0 | \ - XTAL_SETTLE_TIME_MASK) -#define XTAL_SETTLE_SW_MASK (32'h0 | \ - XTAL_SETTLE_TIME_MASK) - -#define CPU_CLOCK_ADDRESS 'h00000020 -#define CPU_CLOCK_STANDARD_MSB 1 -#define CPU_CLOCK_STANDARD_LSB 0 -#define CPU_CLOCK_STANDARD_MASK 'h00000003 -#define CPU_CLOCK_STANDARD_GET(x) (((x) & CPU_CLOCK_STANDARD_MASK) >> CPU_CLOCK_STANDARD_LSB) -#define CPU_CLOCK_STANDARD_SET(x) (((32'd0 | (x)) << CPU_CLOCK_STANDARD_LSB) & CPU_CLOCK_STANDARD_MASK) -#define CPU_CLOCK_STANDARD_RESET 2'h3 -#define CPU_CLOCK_RESET (32'h0 | \ - CPU_CLOCK_STANDARD_SET(CPU_CLOCK_STANDARD_RESET)) -#define CPU_CLOCK_HW_MASK (32'h0) -#define CPU_CLOCK_SW_MASK (32'h0 | \ - CPU_CLOCK_STANDARD_MASK) - -#define CLOCK_OUT_ADDRESS 'h00000024 -#define CLOCK_OUT_SELECT_MSB 3 -#define CLOCK_OUT_SELECT_LSB 0 -#define CLOCK_OUT_SELECT_MASK 'h0000000f -#define CLOCK_OUT_SELECT_GET(x) (((x) & CLOCK_OUT_SELECT_MASK) >> CLOCK_OUT_SELECT_LSB) -#define CLOCK_OUT_SELECT_SET(x) (((32'd0 | (x)) << CLOCK_OUT_SELECT_LSB) & CLOCK_OUT_SELECT_MASK) -#define CLOCK_OUT_SELECT_RESET 4'hf -#define CLOCK_OUT_RESET (32'h0 | \ - CLOCK_OUT_SELECT_SET(CLOCK_OUT_SELECT_RESET)) -#define CLOCK_OUT_HW_MASK (32'h0) -#define CLOCK_OUT_SW_MASK (32'h0 | \ - CLOCK_OUT_SELECT_MASK) - -#define CLOCK_CONTROL_ADDRESS 'h00000028 -#define CLOCK_CONTROL_LF_CLK32_MSB 2 -#define CLOCK_CONTROL_LF_CLK32_LSB 2 -#define CLOCK_CONTROL_LF_CLK32_MASK 'h00000004 -#define CLOCK_CONTROL_LF_CLK32_GET(x) (((x) & CLOCK_CONTROL_LF_CLK32_MASK) >> CLOCK_CONTROL_LF_CLK32_LSB) -#define CLOCK_CONTROL_LF_CLK32_SET(x) (((32'd0 | (x)) << CLOCK_CONTROL_LF_CLK32_LSB) & CLOCK_CONTROL_LF_CLK32_MASK) -#define CLOCK_CONTROL_LF_CLK32_RESET 1'h0 -#define CLOCK_CONTROL_UART_CLK_MSB 1 -#define CLOCK_CONTROL_UART_CLK_LSB 1 -#define CLOCK_CONTROL_UART_CLK_MASK 'h00000002 -#define CLOCK_CONTROL_UART_CLK_GET(x) (((x) & CLOCK_CONTROL_UART_CLK_MASK) >> CLOCK_CONTROL_UART_CLK_LSB) -#define CLOCK_CONTROL_UART_CLK_SET(x) (((32'd0 | (x)) << CLOCK_CONTROL_UART_CLK_LSB) & CLOCK_CONTROL_UART_CLK_MASK) -#define CLOCK_CONTROL_UART_CLK_RESET 1'h0 -#define CLOCK_CONTROL_SI0_CLK_MSB 0 -#define CLOCK_CONTROL_SI0_CLK_LSB 0 -#define CLOCK_CONTROL_SI0_CLK_MASK 'h00000001 -#define CLOCK_CONTROL_SI0_CLK_GET(x) (((x) & CLOCK_CONTROL_SI0_CLK_MASK) >> CLOCK_CONTROL_SI0_CLK_LSB) -#define CLOCK_CONTROL_SI0_CLK_SET(x) (((32'd0 | (x)) << CLOCK_CONTROL_SI0_CLK_LSB) & CLOCK_CONTROL_SI0_CLK_MASK) -#define CLOCK_CONTROL_SI0_CLK_RESET 1'h1 -#define CLOCK_CONTROL_RESET (32'h0 | \ - CLOCK_CONTROL_LF_CLK32_SET(CLOCK_CONTROL_LF_CLK32_RESET) | \ - CLOCK_CONTROL_UART_CLK_SET(CLOCK_CONTROL_UART_CLK_RESET) | \ - CLOCK_CONTROL_SI0_CLK_SET(CLOCK_CONTROL_SI0_CLK_RESET)) -#define CLOCK_CONTROL_HW_MASK (32'h0) -#define CLOCK_CONTROL_SW_MASK (32'h0 | \ - CLOCK_CONTROL_LF_CLK32_MASK | \ - CLOCK_CONTROL_UART_CLK_MASK | \ - CLOCK_CONTROL_SI0_CLK_MASK) - -#define BIAS_OVERRIDE_ADDRESS 'h0000002c -#define BIAS_OVERRIDE_ON_MSB 0 -#define BIAS_OVERRIDE_ON_LSB 0 -#define BIAS_OVERRIDE_ON_MASK 'h00000001 -#define BIAS_OVERRIDE_ON_GET(x) (((x) & BIAS_OVERRIDE_ON_MASK) >> BIAS_OVERRIDE_ON_LSB) -#define BIAS_OVERRIDE_ON_SET(x) (((32'd0 | (x)) << BIAS_OVERRIDE_ON_LSB) & BIAS_OVERRIDE_ON_MASK) -#define BIAS_OVERRIDE_ON_RESET 1'h0 -#define BIAS_OVERRIDE_RESET (32'h0 | \ - BIAS_OVERRIDE_ON_SET(BIAS_OVERRIDE_ON_RESET)) -#define BIAS_OVERRIDE_HW_MASK (32'h0) -#define BIAS_OVERRIDE_SW_MASK (32'h0 | \ - BIAS_OVERRIDE_ON_MASK) - -#define WDT_CONTROL_ADDRESS 'h00000030 -#define WDT_CONTROL_ACTION_MSB 2 -#define WDT_CONTROL_ACTION_LSB 0 -#define WDT_CONTROL_ACTION_MASK 'h00000007 -#define WDT_CONTROL_ACTION_GET(x) (((x) & WDT_CONTROL_ACTION_MASK) >> WDT_CONTROL_ACTION_LSB) -#define WDT_CONTROL_ACTION_SET(x) (((32'd0 | (x)) << WDT_CONTROL_ACTION_LSB) & WDT_CONTROL_ACTION_MASK) -#define WDT_CONTROL_ACTION_RESET 3'h2 -#define WDT_CONTROL_RESET (32'h0 | \ - WDT_CONTROL_ACTION_SET(WDT_CONTROL_ACTION_RESET)) -#define WDT_CONTROL_HW_MASK (32'h0) -#define WDT_CONTROL_SW_MASK (32'h0 | \ - WDT_CONTROL_ACTION_MASK) - -#define WDT_STATUS_ADDRESS 'h00000034 -#define WDT_STATUS_INTERRUPT_MSB 0 -#define WDT_STATUS_INTERRUPT_LSB 0 -#define WDT_STATUS_INTERRUPT_MASK 'h00000001 -#define WDT_STATUS_INTERRUPT_GET(x) (((x) & WDT_STATUS_INTERRUPT_MASK) >> WDT_STATUS_INTERRUPT_LSB) -#define WDT_STATUS_INTERRUPT_SET(x) (((32'd0 | (x)) << WDT_STATUS_INTERRUPT_LSB) & WDT_STATUS_INTERRUPT_MASK) -#define WDT_STATUS_INTERRUPT_RESET 1'h0 -#define WDT_STATUS_RESET (32'h0 | \ - WDT_STATUS_INTERRUPT_SET(WDT_STATUS_INTERRUPT_RESET)) -#define WDT_STATUS_HW_MASK (32'h0 | \ - WDT_STATUS_INTERRUPT_MASK) -#define WDT_STATUS_SW_MASK (32'h0 | \ - WDT_STATUS_INTERRUPT_MASK) - -#define WDT_ADDRESS 'h00000038 -#define WDT_TARGET_MSB 21 -#define WDT_TARGET_LSB 0 -#define WDT_TARGET_MASK 'h003fffff -#define WDT_TARGET_GET(x) (((x) & WDT_TARGET_MASK) >> WDT_TARGET_LSB) -#define WDT_TARGET_SET(x) (((32'd0 | (x)) << WDT_TARGET_LSB) & WDT_TARGET_MASK) -#define WDT_TARGET_RESET 22'h3fffff -#define WDT_RESET (32'h0 | \ - WDT_TARGET_SET(WDT_TARGET_RESET)) -#define WDT_HW_MASK (32'h0) -#define WDT_SW_MASK (32'h0 | \ - WDT_TARGET_MASK) - -#define WDT_COUNT_ADDRESS 'h0000003c -#define WDT_COUNT_VALUE_MSB 21 -#define WDT_COUNT_VALUE_LSB 0 -#define WDT_COUNT_VALUE_MASK 'h003fffff -#define WDT_COUNT_VALUE_GET(x) (((x) & WDT_COUNT_VALUE_MASK) >> WDT_COUNT_VALUE_LSB) -#define WDT_COUNT_VALUE_SET(x) (((32'd0 | (x)) << WDT_COUNT_VALUE_LSB) & WDT_COUNT_VALUE_MASK) -#define WDT_COUNT_VALUE_RESET 22'h0 -#define WDT_COUNT_RESET (32'h0 | \ - WDT_COUNT_VALUE_SET(WDT_COUNT_VALUE_RESET)) -#define WDT_COUNT_HW_MASK (32'h0 | \ - WDT_COUNT_VALUE_MASK) -#define WDT_COUNT_SW_MASK (32'h0) - -#define WDT_RESET_ADDRESS 'h00000040 -#define WDT_RESET_VALUE_MSB 0 -#define WDT_RESET_VALUE_LSB 0 -#define WDT_RESET_VALUE_MASK 'h00000001 -#define WDT_RESET_VALUE_GET(x) (((x) & WDT_RESET_VALUE_MASK) >> WDT_RESET_VALUE_LSB) -#define WDT_RESET_VALUE_SET(x) (((32'd0 | (x)) << WDT_RESET_VALUE_LSB) & WDT_RESET_VALUE_MASK) -#define WDT_RESET_VALUE_RESET 1'h0 -#define WDT_RESET_RESET (32'h0 | \ - WDT_RESET_VALUE_SET(WDT_RESET_VALUE_RESET)) -#define WDT_RESET_HW_MASK (32'h0 | \ - WDT_RESET_VALUE_MASK) -#define WDT_RESET_SW_MASK (32'h0 | \ - WDT_RESET_VALUE_MASK) - -#define INT_STATUS_ADDRESS 'h00000044 -#define INT_STATUS_RTC_POWER_MSB 14 -#define INT_STATUS_RTC_POWER_LSB 14 -#define INT_STATUS_RTC_POWER_MASK 'h00004000 -#define INT_STATUS_RTC_POWER_GET(x) (((x) & INT_STATUS_RTC_POWER_MASK) >> INT_STATUS_RTC_POWER_LSB) -#define INT_STATUS_RTC_POWER_SET(x) (((32'd0 | (x)) << INT_STATUS_RTC_POWER_LSB) & INT_STATUS_RTC_POWER_MASK) -#define INT_STATUS_RTC_POWER_RESET 1'h0 -#define INT_STATUS_MAC_MSB 13 -#define INT_STATUS_MAC_LSB 13 -#define INT_STATUS_MAC_MASK 'h00002000 -#define INT_STATUS_MAC_GET(x) (((x) & INT_STATUS_MAC_MASK) >> INT_STATUS_MAC_LSB) -#define INT_STATUS_MAC_SET(x) (((32'd0 | (x)) << INT_STATUS_MAC_LSB) & INT_STATUS_MAC_MASK) -#define INT_STATUS_MAC_RESET 1'h0 -#define INT_STATUS_MAILBOX_MSB 12 -#define INT_STATUS_MAILBOX_LSB 12 -#define INT_STATUS_MAILBOX_MASK 'h00001000 -#define INT_STATUS_MAILBOX_GET(x) (((x) & INT_STATUS_MAILBOX_MASK) >> INT_STATUS_MAILBOX_LSB) -#define INT_STATUS_MAILBOX_SET(x) (((32'd0 | (x)) << INT_STATUS_MAILBOX_LSB) & INT_STATUS_MAILBOX_MASK) -#define INT_STATUS_MAILBOX_RESET 1'h0 -#define INT_STATUS_RTC_ALARM_MSB 11 -#define INT_STATUS_RTC_ALARM_LSB 11 -#define INT_STATUS_RTC_ALARM_MASK 'h00000800 -#define INT_STATUS_RTC_ALARM_GET(x) (((x) & INT_STATUS_RTC_ALARM_MASK) >> INT_STATUS_RTC_ALARM_LSB) -#define INT_STATUS_RTC_ALARM_SET(x) (((32'd0 | (x)) << INT_STATUS_RTC_ALARM_LSB) & INT_STATUS_RTC_ALARM_MASK) -#define INT_STATUS_RTC_ALARM_RESET 1'h0 -#define INT_STATUS_HF_TIMER_MSB 10 -#define INT_STATUS_HF_TIMER_LSB 10 -#define INT_STATUS_HF_TIMER_MASK 'h00000400 -#define INT_STATUS_HF_TIMER_GET(x) (((x) & INT_STATUS_HF_TIMER_MASK) >> INT_STATUS_HF_TIMER_LSB) -#define INT_STATUS_HF_TIMER_SET(x) (((32'd0 | (x)) << INT_STATUS_HF_TIMER_LSB) & INT_STATUS_HF_TIMER_MASK) -#define INT_STATUS_HF_TIMER_RESET 1'h0 -#define INT_STATUS_LF_TIMER3_MSB 9 -#define INT_STATUS_LF_TIMER3_LSB 9 -#define INT_STATUS_LF_TIMER3_MASK 'h00000200 -#define INT_STATUS_LF_TIMER3_GET(x) (((x) & INT_STATUS_LF_TIMER3_MASK) >> INT_STATUS_LF_TIMER3_LSB) -#define INT_STATUS_LF_TIMER3_SET(x) (((32'd0 | (x)) << INT_STATUS_LF_TIMER3_LSB) & INT_STATUS_LF_TIMER3_MASK) -#define INT_STATUS_LF_TIMER3_RESET 1'h0 -#define INT_STATUS_LF_TIMER2_MSB 8 -#define INT_STATUS_LF_TIMER2_LSB 8 -#define INT_STATUS_LF_TIMER2_MASK 'h00000100 -#define INT_STATUS_LF_TIMER2_GET(x) (((x) & INT_STATUS_LF_TIMER2_MASK) >> INT_STATUS_LF_TIMER2_LSB) -#define INT_STATUS_LF_TIMER2_SET(x) (((32'd0 | (x)) << INT_STATUS_LF_TIMER2_LSB) & INT_STATUS_LF_TIMER2_MASK) -#define INT_STATUS_LF_TIMER2_RESET 1'h0 -#define INT_STATUS_LF_TIMER1_MSB 7 -#define INT_STATUS_LF_TIMER1_LSB 7 -#define INT_STATUS_LF_TIMER1_MASK 'h00000080 -#define INT_STATUS_LF_TIMER1_GET(x) (((x) & INT_STATUS_LF_TIMER1_MASK) >> INT_STATUS_LF_TIMER1_LSB) -#define INT_STATUS_LF_TIMER1_SET(x) (((32'd0 | (x)) << INT_STATUS_LF_TIMER1_LSB) & INT_STATUS_LF_TIMER1_MASK) -#define INT_STATUS_LF_TIMER1_RESET 1'h0 -#define INT_STATUS_LF_TIMER0_MSB 6 -#define INT_STATUS_LF_TIMER0_LSB 6 -#define INT_STATUS_LF_TIMER0_MASK 'h00000040 -#define INT_STATUS_LF_TIMER0_GET(x) (((x) & INT_STATUS_LF_TIMER0_MASK) >> INT_STATUS_LF_TIMER0_LSB) -#define INT_STATUS_LF_TIMER0_SET(x) (((32'd0 | (x)) << INT_STATUS_LF_TIMER0_LSB) & INT_STATUS_LF_TIMER0_MASK) -#define INT_STATUS_LF_TIMER0_RESET 1'h0 -#define INT_STATUS_KEYPAD_MSB 5 -#define INT_STATUS_KEYPAD_LSB 5 -#define INT_STATUS_KEYPAD_MASK 'h00000020 -#define INT_STATUS_KEYPAD_GET(x) (((x) & INT_STATUS_KEYPAD_MASK) >> INT_STATUS_KEYPAD_LSB) -#define INT_STATUS_KEYPAD_SET(x) (((32'd0 | (x)) << INT_STATUS_KEYPAD_LSB) & INT_STATUS_KEYPAD_MASK) -#define INT_STATUS_KEYPAD_RESET 1'h0 -#define INT_STATUS_SI_MSB 4 -#define INT_STATUS_SI_LSB 4 -#define INT_STATUS_SI_MASK 'h00000010 -#define INT_STATUS_SI_GET(x) (((x) & INT_STATUS_SI_MASK) >> INT_STATUS_SI_LSB) -#define INT_STATUS_SI_SET(x) (((32'd0 | (x)) << INT_STATUS_SI_LSB) & INT_STATUS_SI_MASK) -#define INT_STATUS_SI_RESET 1'h0 -#define INT_STATUS_GPIO_MSB 3 -#define INT_STATUS_GPIO_LSB 3 -#define INT_STATUS_GPIO_MASK 'h00000008 -#define INT_STATUS_GPIO_GET(x) (((x) & INT_STATUS_GPIO_MASK) >> INT_STATUS_GPIO_LSB) -#define INT_STATUS_GPIO_SET(x) (((32'd0 | (x)) << INT_STATUS_GPIO_LSB) & INT_STATUS_GPIO_MASK) -#define INT_STATUS_GPIO_RESET 1'h0 -#define INT_STATUS_UART_MSB 2 -#define INT_STATUS_UART_LSB 2 -#define INT_STATUS_UART_MASK 'h00000004 -#define INT_STATUS_UART_GET(x) (((x) & INT_STATUS_UART_MASK) >> INT_STATUS_UART_LSB) -#define INT_STATUS_UART_SET(x) (((32'd0 | (x)) << INT_STATUS_UART_LSB) & INT_STATUS_UART_MASK) -#define INT_STATUS_UART_RESET 1'h0 -#define INT_STATUS_ERROR_MSB 1 -#define INT_STATUS_ERROR_LSB 1 -#define INT_STATUS_ERROR_MASK 'h00000002 -#define INT_STATUS_ERROR_GET(x) (((x) & INT_STATUS_ERROR_MASK) >> INT_STATUS_ERROR_LSB) -#define INT_STATUS_ERROR_SET(x) (((32'd0 | (x)) << INT_STATUS_ERROR_LSB) & INT_STATUS_ERROR_MASK) -#define INT_STATUS_ERROR_RESET 1'h0 -#define INT_STATUS_WDT_INT_MSB 0 -#define INT_STATUS_WDT_INT_LSB 0 -#define INT_STATUS_WDT_INT_MASK 'h00000001 -#define INT_STATUS_WDT_INT_GET(x) (((x) & INT_STATUS_WDT_INT_MASK) >> INT_STATUS_WDT_INT_LSB) -#define INT_STATUS_WDT_INT_SET(x) (((32'd0 | (x)) << INT_STATUS_WDT_INT_LSB) & INT_STATUS_WDT_INT_MASK) -#define INT_STATUS_WDT_INT_RESET 1'h0 -#define INT_STATUS_RESET (32'h0 | \ - INT_STATUS_RTC_POWER_SET(INT_STATUS_RTC_POWER_RESET) | \ - INT_STATUS_MAC_SET(INT_STATUS_MAC_RESET) | \ - INT_STATUS_MAILBOX_SET(INT_STATUS_MAILBOX_RESET) | \ - INT_STATUS_RTC_ALARM_SET(INT_STATUS_RTC_ALARM_RESET) | \ - INT_STATUS_HF_TIMER_SET(INT_STATUS_HF_TIMER_RESET) | \ - INT_STATUS_LF_TIMER3_SET(INT_STATUS_LF_TIMER3_RESET) | \ - INT_STATUS_LF_TIMER2_SET(INT_STATUS_LF_TIMER2_RESET) | \ - INT_STATUS_LF_TIMER1_SET(INT_STATUS_LF_TIMER1_RESET) | \ - INT_STATUS_LF_TIMER0_SET(INT_STATUS_LF_TIMER0_RESET) | \ - INT_STATUS_KEYPAD_SET(INT_STATUS_KEYPAD_RESET) | \ - INT_STATUS_SI_SET(INT_STATUS_SI_RESET) | \ - INT_STATUS_GPIO_SET(INT_STATUS_GPIO_RESET) | \ - INT_STATUS_UART_SET(INT_STATUS_UART_RESET) | \ - INT_STATUS_ERROR_SET(INT_STATUS_ERROR_RESET) | \ - INT_STATUS_WDT_INT_SET(INT_STATUS_WDT_INT_RESET)) -#define INT_STATUS_HW_MASK (32'h0 | \ - INT_STATUS_RTC_POWER_MASK | \ - INT_STATUS_MAC_MASK | \ - INT_STATUS_MAILBOX_MASK | \ - INT_STATUS_RTC_ALARM_MASK | \ - INT_STATUS_HF_TIMER_MASK | \ - INT_STATUS_LF_TIMER3_MASK | \ - INT_STATUS_LF_TIMER2_MASK | \ - INT_STATUS_LF_TIMER1_MASK | \ - INT_STATUS_LF_TIMER0_MASK | \ - INT_STATUS_KEYPAD_MASK | \ - INT_STATUS_SI_MASK | \ - INT_STATUS_GPIO_MASK | \ - INT_STATUS_UART_MASK | \ - INT_STATUS_ERROR_MASK | \ - INT_STATUS_WDT_INT_MASK) -#define INT_STATUS_SW_MASK (32'h0) - -#define LF_TIMER0_ADDRESS 'h00000048 -#define LF_TIMER0_TARGET_MSB 31 -#define LF_TIMER0_TARGET_LSB 0 -#define LF_TIMER0_TARGET_MASK 'hffffffff -#define LF_TIMER0_TARGET_GET(x) (((x) & LF_TIMER0_TARGET_MASK) >> LF_TIMER0_TARGET_LSB) -#define LF_TIMER0_TARGET_SET(x) (((32'd0 | (x)) << LF_TIMER0_TARGET_LSB) & LF_TIMER0_TARGET_MASK) -#define LF_TIMER0_TARGET_RESET 32'h0 -#define LF_TIMER0_RESET (32'h0 | \ - LF_TIMER0_TARGET_SET(LF_TIMER0_TARGET_RESET)) -#define LF_TIMER0_HW_MASK (32'h0) -#define LF_TIMER0_SW_MASK (32'h0 | \ - LF_TIMER0_TARGET_MASK) - -#define LF_TIMER_COUNT0_ADDRESS 'h0000004c -#define LF_TIMER_COUNT0_VALUE_MSB 31 -#define LF_TIMER_COUNT0_VALUE_LSB 0 -#define LF_TIMER_COUNT0_VALUE_MASK 'hffffffff -#define LF_TIMER_COUNT0_VALUE_GET(x) (((x) & LF_TIMER_COUNT0_VALUE_MASK) >> LF_TIMER_COUNT0_VALUE_LSB) -#define LF_TIMER_COUNT0_VALUE_SET(x) (((32'd0 | (x)) << LF_TIMER_COUNT0_VALUE_LSB) & LF_TIMER_COUNT0_VALUE_MASK) -#define LF_TIMER_COUNT0_VALUE_RESET 32'h0 -#define LF_TIMER_COUNT0_RESET (32'h0 | \ - LF_TIMER_COUNT0_VALUE_SET(LF_TIMER_COUNT0_VALUE_RESET)) -#define LF_TIMER_COUNT0_HW_MASK (32'h0 | \ - LF_TIMER_COUNT0_VALUE_MASK) -#define LF_TIMER_COUNT0_SW_MASK (32'h0) - -#define LF_TIMER_CONTROL0_ADDRESS 'h00000050 -#define LF_TIMER_CONTROL0_ENABLE_MSB 2 -#define LF_TIMER_CONTROL0_ENABLE_LSB 2 -#define LF_TIMER_CONTROL0_ENABLE_MASK 'h00000004 -#define LF_TIMER_CONTROL0_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL0_ENABLE_MASK) >> LF_TIMER_CONTROL0_ENABLE_LSB) -#define LF_TIMER_CONTROL0_ENABLE_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL0_ENABLE_LSB) & LF_TIMER_CONTROL0_ENABLE_MASK) -#define LF_TIMER_CONTROL0_ENABLE_RESET 1'h0 -#define LF_TIMER_CONTROL0_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL0_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL0_AUTO_RESTART_MASK 'h00000002 -#define LF_TIMER_CONTROL0_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL0_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL0_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL0_AUTO_RESTART_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL0_AUTO_RESTART_LSB) & LF_TIMER_CONTROL0_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL0_AUTO_RESTART_RESET 1'h0 -#define LF_TIMER_CONTROL0_RESET_MSB 0 -#define LF_TIMER_CONTROL0_RESET_LSB 0 -#define LF_TIMER_CONTROL0_RESET_MASK 'h00000001 -#define LF_TIMER_CONTROL0_RESET_GET(x) (((x) & LF_TIMER_CONTROL0_RESET_MASK) >> LF_TIMER_CONTROL0_RESET_LSB) -#define LF_TIMER_CONTROL0_RESET_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL0_RESET_LSB) & LF_TIMER_CONTROL0_RESET_MASK) -#define LF_TIMER_CONTROL0_RESET_RESET 1'h0 -#define LF_TIMER_CONTROL0_RESET (32'h0 | \ - LF_TIMER_CONTROL0_ENABLE_SET(LF_TIMER_CONTROL0_ENABLE_RESET) | \ - LF_TIMER_CONTROL0_AUTO_RESTART_SET(LF_TIMER_CONTROL0_AUTO_RESTART_RESET) | \ - LF_TIMER_CONTROL0_RESET_SET(LF_TIMER_CONTROL0_RESET_RESET)) -#define LF_TIMER_CONTROL0_HW_MASK (32'h0 | \ - LF_TIMER_CONTROL0_RESET_MASK) -#define LF_TIMER_CONTROL0_SW_MASK (32'h0 | \ - LF_TIMER_CONTROL0_ENABLE_MASK | \ - LF_TIMER_CONTROL0_AUTO_RESTART_MASK | \ - LF_TIMER_CONTROL0_RESET_MASK) - -#define LF_TIMER_STATUS0_ADDRESS 'h00000054 -#define LF_TIMER_STATUS0_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS0_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS0_INTERRUPT_MASK 'h00000001 -#define LF_TIMER_STATUS0_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS0_INTERRUPT_MASK) >> LF_TIMER_STATUS0_INTERRUPT_LSB) -#define LF_TIMER_STATUS0_INTERRUPT_SET(x) (((32'd0 | (x)) << LF_TIMER_STATUS0_INTERRUPT_LSB) & LF_TIMER_STATUS0_INTERRUPT_MASK) -#define LF_TIMER_STATUS0_INTERRUPT_RESET 1'h0 -#define LF_TIMER_STATUS0_RESET (32'h0 | \ - LF_TIMER_STATUS0_INTERRUPT_SET(LF_TIMER_STATUS0_INTERRUPT_RESET)) -#define LF_TIMER_STATUS0_HW_MASK (32'h0 | \ - LF_TIMER_STATUS0_INTERRUPT_MASK) -#define LF_TIMER_STATUS0_SW_MASK (32'h0 | \ - LF_TIMER_STATUS0_INTERRUPT_MASK) - -#define LF_TIMER1_ADDRESS 'h00000058 -#define LF_TIMER1_TARGET_MSB 31 -#define LF_TIMER1_TARGET_LSB 0 -#define LF_TIMER1_TARGET_MASK 'hffffffff -#define LF_TIMER1_TARGET_GET(x) (((x) & LF_TIMER1_TARGET_MASK) >> LF_TIMER1_TARGET_LSB) -#define LF_TIMER1_TARGET_SET(x) (((32'd0 | (x)) << LF_TIMER1_TARGET_LSB) & LF_TIMER1_TARGET_MASK) -#define LF_TIMER1_TARGET_RESET 32'h0 -#define LF_TIMER1_RESET (32'h0 | \ - LF_TIMER1_TARGET_SET(LF_TIMER1_TARGET_RESET)) -#define LF_TIMER1_HW_MASK (32'h0) -#define LF_TIMER1_SW_MASK (32'h0 | \ - LF_TIMER1_TARGET_MASK) - -#define LF_TIMER_COUNT1_ADDRESS 'h0000005c -#define LF_TIMER_COUNT1_VALUE_MSB 31 -#define LF_TIMER_COUNT1_VALUE_LSB 0 -#define LF_TIMER_COUNT1_VALUE_MASK 'hffffffff -#define LF_TIMER_COUNT1_VALUE_GET(x) (((x) & LF_TIMER_COUNT1_VALUE_MASK) >> LF_TIMER_COUNT1_VALUE_LSB) -#define LF_TIMER_COUNT1_VALUE_SET(x) (((32'd0 | (x)) << LF_TIMER_COUNT1_VALUE_LSB) & LF_TIMER_COUNT1_VALUE_MASK) -#define LF_TIMER_COUNT1_VALUE_RESET 32'h0 -#define LF_TIMER_COUNT1_RESET (32'h0 | \ - LF_TIMER_COUNT1_VALUE_SET(LF_TIMER_COUNT1_VALUE_RESET)) -#define LF_TIMER_COUNT1_HW_MASK (32'h0 | \ - LF_TIMER_COUNT1_VALUE_MASK) -#define LF_TIMER_COUNT1_SW_MASK (32'h0) - -#define LF_TIMER_CONTROL1_ADDRESS 'h00000060 -#define LF_TIMER_CONTROL1_ENABLE_MSB 2 -#define LF_TIMER_CONTROL1_ENABLE_LSB 2 -#define LF_TIMER_CONTROL1_ENABLE_MASK 'h00000004 -#define LF_TIMER_CONTROL1_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL1_ENABLE_MASK) >> LF_TIMER_CONTROL1_ENABLE_LSB) -#define LF_TIMER_CONTROL1_ENABLE_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL1_ENABLE_LSB) & LF_TIMER_CONTROL1_ENABLE_MASK) -#define LF_TIMER_CONTROL1_ENABLE_RESET 1'h0 -#define LF_TIMER_CONTROL1_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL1_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL1_AUTO_RESTART_MASK 'h00000002 -#define LF_TIMER_CONTROL1_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL1_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL1_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL1_AUTO_RESTART_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL1_AUTO_RESTART_LSB) & LF_TIMER_CONTROL1_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL1_AUTO_RESTART_RESET 1'h0 -#define LF_TIMER_CONTROL1_RESET_MSB 0 -#define LF_TIMER_CONTROL1_RESET_LSB 0 -#define LF_TIMER_CONTROL1_RESET_MASK 'h00000001 -#define LF_TIMER_CONTROL1_RESET_GET(x) (((x) & LF_TIMER_CONTROL1_RESET_MASK) >> LF_TIMER_CONTROL1_RESET_LSB) -#define LF_TIMER_CONTROL1_RESET_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL1_RESET_LSB) & LF_TIMER_CONTROL1_RESET_MASK) -#define LF_TIMER_CONTROL1_RESET_RESET 1'h0 -#define LF_TIMER_CONTROL1_RESET (32'h0 | \ - LF_TIMER_CONTROL1_ENABLE_SET(LF_TIMER_CONTROL1_ENABLE_RESET) | \ - LF_TIMER_CONTROL1_AUTO_RESTART_SET(LF_TIMER_CONTROL1_AUTO_RESTART_RESET) | \ - LF_TIMER_CONTROL1_RESET_SET(LF_TIMER_CONTROL1_RESET_RESET)) -#define LF_TIMER_CONTROL1_HW_MASK (32'h0 | \ - LF_TIMER_CONTROL1_RESET_MASK) -#define LF_TIMER_CONTROL1_SW_MASK (32'h0 | \ - LF_TIMER_CONTROL1_ENABLE_MASK | \ - LF_TIMER_CONTROL1_AUTO_RESTART_MASK | \ - LF_TIMER_CONTROL1_RESET_MASK) - -#define LF_TIMER_STATUS1_ADDRESS 'h00000064 -#define LF_TIMER_STATUS1_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS1_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS1_INTERRUPT_MASK 'h00000001 -#define LF_TIMER_STATUS1_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS1_INTERRUPT_MASK) >> LF_TIMER_STATUS1_INTERRUPT_LSB) -#define LF_TIMER_STATUS1_INTERRUPT_SET(x) (((32'd0 | (x)) << LF_TIMER_STATUS1_INTERRUPT_LSB) & LF_TIMER_STATUS1_INTERRUPT_MASK) -#define LF_TIMER_STATUS1_INTERRUPT_RESET 1'h0 -#define LF_TIMER_STATUS1_RESET (32'h0 | \ - LF_TIMER_STATUS1_INTERRUPT_SET(LF_TIMER_STATUS1_INTERRUPT_RESET)) -#define LF_TIMER_STATUS1_HW_MASK (32'h0 | \ - LF_TIMER_STATUS1_INTERRUPT_MASK) -#define LF_TIMER_STATUS1_SW_MASK (32'h0 | \ - LF_TIMER_STATUS1_INTERRUPT_MASK) - -#define LF_TIMER2_ADDRESS 'h00000068 -#define LF_TIMER2_TARGET_MSB 31 -#define LF_TIMER2_TARGET_LSB 0 -#define LF_TIMER2_TARGET_MASK 'hffffffff -#define LF_TIMER2_TARGET_GET(x) (((x) & LF_TIMER2_TARGET_MASK) >> LF_TIMER2_TARGET_LSB) -#define LF_TIMER2_TARGET_SET(x) (((32'd0 | (x)) << LF_TIMER2_TARGET_LSB) & LF_TIMER2_TARGET_MASK) -#define LF_TIMER2_TARGET_RESET 32'h0 -#define LF_TIMER2_RESET (32'h0 | \ - LF_TIMER2_TARGET_SET(LF_TIMER2_TARGET_RESET)) -#define LF_TIMER2_HW_MASK (32'h0) -#define LF_TIMER2_SW_MASK (32'h0 | \ - LF_TIMER2_TARGET_MASK) - -#define LF_TIMER_COUNT2_ADDRESS 'h0000006c -#define LF_TIMER_COUNT2_VALUE_MSB 31 -#define LF_TIMER_COUNT2_VALUE_LSB 0 -#define LF_TIMER_COUNT2_VALUE_MASK 'hffffffff -#define LF_TIMER_COUNT2_VALUE_GET(x) (((x) & LF_TIMER_COUNT2_VALUE_MASK) >> LF_TIMER_COUNT2_VALUE_LSB) -#define LF_TIMER_COUNT2_VALUE_SET(x) (((32'd0 | (x)) << LF_TIMER_COUNT2_VALUE_LSB) & LF_TIMER_COUNT2_VALUE_MASK) -#define LF_TIMER_COUNT2_VALUE_RESET 32'h0 -#define LF_TIMER_COUNT2_RESET (32'h0 | \ - LF_TIMER_COUNT2_VALUE_SET(LF_TIMER_COUNT2_VALUE_RESET)) -#define LF_TIMER_COUNT2_HW_MASK (32'h0 | \ - LF_TIMER_COUNT2_VALUE_MASK) -#define LF_TIMER_COUNT2_SW_MASK (32'h0) - -#define LF_TIMER_CONTROL2_ADDRESS 'h00000070 -#define LF_TIMER_CONTROL2_ENABLE_MSB 2 -#define LF_TIMER_CONTROL2_ENABLE_LSB 2 -#define LF_TIMER_CONTROL2_ENABLE_MASK 'h00000004 -#define LF_TIMER_CONTROL2_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL2_ENABLE_MASK) >> LF_TIMER_CONTROL2_ENABLE_LSB) -#define LF_TIMER_CONTROL2_ENABLE_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL2_ENABLE_LSB) & LF_TIMER_CONTROL2_ENABLE_MASK) -#define LF_TIMER_CONTROL2_ENABLE_RESET 1'h0 -#define LF_TIMER_CONTROL2_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL2_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL2_AUTO_RESTART_MASK 'h00000002 -#define LF_TIMER_CONTROL2_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL2_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL2_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL2_AUTO_RESTART_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL2_AUTO_RESTART_LSB) & LF_TIMER_CONTROL2_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL2_AUTO_RESTART_RESET 1'h0 -#define LF_TIMER_CONTROL2_RESET_MSB 0 -#define LF_TIMER_CONTROL2_RESET_LSB 0 -#define LF_TIMER_CONTROL2_RESET_MASK 'h00000001 -#define LF_TIMER_CONTROL2_RESET_GET(x) (((x) & LF_TIMER_CONTROL2_RESET_MASK) >> LF_TIMER_CONTROL2_RESET_LSB) -#define LF_TIMER_CONTROL2_RESET_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL2_RESET_LSB) & LF_TIMER_CONTROL2_RESET_MASK) -#define LF_TIMER_CONTROL2_RESET_RESET 1'h0 -#define LF_TIMER_CONTROL2_RESET (32'h0 | \ - LF_TIMER_CONTROL2_ENABLE_SET(LF_TIMER_CONTROL2_ENABLE_RESET) | \ - LF_TIMER_CONTROL2_AUTO_RESTART_SET(LF_TIMER_CONTROL2_AUTO_RESTART_RESET) | \ - LF_TIMER_CONTROL2_RESET_SET(LF_TIMER_CONTROL2_RESET_RESET)) -#define LF_TIMER_CONTROL2_HW_MASK (32'h0 | \ - LF_TIMER_CONTROL2_RESET_MASK) -#define LF_TIMER_CONTROL2_SW_MASK (32'h0 | \ - LF_TIMER_CONTROL2_ENABLE_MASK | \ - LF_TIMER_CONTROL2_AUTO_RESTART_MASK | \ - LF_TIMER_CONTROL2_RESET_MASK) - -#define LF_TIMER_STATUS2_ADDRESS 'h00000074 -#define LF_TIMER_STATUS2_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS2_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS2_INTERRUPT_MASK 'h00000001 -#define LF_TIMER_STATUS2_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS2_INTERRUPT_MASK) >> LF_TIMER_STATUS2_INTERRUPT_LSB) -#define LF_TIMER_STATUS2_INTERRUPT_SET(x) (((32'd0 | (x)) << LF_TIMER_STATUS2_INTERRUPT_LSB) & LF_TIMER_STATUS2_INTERRUPT_MASK) -#define LF_TIMER_STATUS2_INTERRUPT_RESET 1'h0 -#define LF_TIMER_STATUS2_RESET (32'h0 | \ - LF_TIMER_STATUS2_INTERRUPT_SET(LF_TIMER_STATUS2_INTERRUPT_RESET)) -#define LF_TIMER_STATUS2_HW_MASK (32'h0 | \ - LF_TIMER_STATUS2_INTERRUPT_MASK) -#define LF_TIMER_STATUS2_SW_MASK (32'h0 | \ - LF_TIMER_STATUS2_INTERRUPT_MASK) - -#define LF_TIMER3_ADDRESS 'h00000078 -#define LF_TIMER3_TARGET_MSB 31 -#define LF_TIMER3_TARGET_LSB 0 -#define LF_TIMER3_TARGET_MASK 'hffffffff -#define LF_TIMER3_TARGET_GET(x) (((x) & LF_TIMER3_TARGET_MASK) >> LF_TIMER3_TARGET_LSB) -#define LF_TIMER3_TARGET_SET(x) (((32'd0 | (x)) << LF_TIMER3_TARGET_LSB) & LF_TIMER3_TARGET_MASK) -#define LF_TIMER3_TARGET_RESET 32'h0 -#define LF_TIMER3_RESET (32'h0 | \ - LF_TIMER3_TARGET_SET(LF_TIMER3_TARGET_RESET)) -#define LF_TIMER3_HW_MASK (32'h0) -#define LF_TIMER3_SW_MASK (32'h0 | \ - LF_TIMER3_TARGET_MASK) - -#define LF_TIMER_COUNT3_ADDRESS 'h0000007c -#define LF_TIMER_COUNT3_VALUE_MSB 31 -#define LF_TIMER_COUNT3_VALUE_LSB 0 -#define LF_TIMER_COUNT3_VALUE_MASK 'hffffffff -#define LF_TIMER_COUNT3_VALUE_GET(x) (((x) & LF_TIMER_COUNT3_VALUE_MASK) >> LF_TIMER_COUNT3_VALUE_LSB) -#define LF_TIMER_COUNT3_VALUE_SET(x) (((32'd0 | (x)) << LF_TIMER_COUNT3_VALUE_LSB) & LF_TIMER_COUNT3_VALUE_MASK) -#define LF_TIMER_COUNT3_VALUE_RESET 32'h0 -#define LF_TIMER_COUNT3_RESET (32'h0 | \ - LF_TIMER_COUNT3_VALUE_SET(LF_TIMER_COUNT3_VALUE_RESET)) -#define LF_TIMER_COUNT3_HW_MASK (32'h0 | \ - LF_TIMER_COUNT3_VALUE_MASK) -#define LF_TIMER_COUNT3_SW_MASK (32'h0) - -#define LF_TIMER_CONTROL3_ADDRESS 'h00000080 -#define LF_TIMER_CONTROL3_ENABLE_MSB 2 -#define LF_TIMER_CONTROL3_ENABLE_LSB 2 -#define LF_TIMER_CONTROL3_ENABLE_MASK 'h00000004 -#define LF_TIMER_CONTROL3_ENABLE_GET(x) (((x) & LF_TIMER_CONTROL3_ENABLE_MASK) >> LF_TIMER_CONTROL3_ENABLE_LSB) -#define LF_TIMER_CONTROL3_ENABLE_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL3_ENABLE_LSB) & LF_TIMER_CONTROL3_ENABLE_MASK) -#define LF_TIMER_CONTROL3_ENABLE_RESET 1'h0 -#define LF_TIMER_CONTROL3_AUTO_RESTART_MSB 1 -#define LF_TIMER_CONTROL3_AUTO_RESTART_LSB 1 -#define LF_TIMER_CONTROL3_AUTO_RESTART_MASK 'h00000002 -#define LF_TIMER_CONTROL3_AUTO_RESTART_GET(x) (((x) & LF_TIMER_CONTROL3_AUTO_RESTART_MASK) >> LF_TIMER_CONTROL3_AUTO_RESTART_LSB) -#define LF_TIMER_CONTROL3_AUTO_RESTART_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL3_AUTO_RESTART_LSB) & LF_TIMER_CONTROL3_AUTO_RESTART_MASK) -#define LF_TIMER_CONTROL3_AUTO_RESTART_RESET 1'h0 -#define LF_TIMER_CONTROL3_RESET_MSB 0 -#define LF_TIMER_CONTROL3_RESET_LSB 0 -#define LF_TIMER_CONTROL3_RESET_MASK 'h00000001 -#define LF_TIMER_CONTROL3_RESET_GET(x) (((x) & LF_TIMER_CONTROL3_RESET_MASK) >> LF_TIMER_CONTROL3_RESET_LSB) -#define LF_TIMER_CONTROL3_RESET_SET(x) (((32'd0 | (x)) << LF_TIMER_CONTROL3_RESET_LSB) & LF_TIMER_CONTROL3_RESET_MASK) -#define LF_TIMER_CONTROL3_RESET_RESET 1'h0 -#define LF_TIMER_CONTROL3_RESET (32'h0 | \ - LF_TIMER_CONTROL3_ENABLE_SET(LF_TIMER_CONTROL3_ENABLE_RESET) | \ - LF_TIMER_CONTROL3_AUTO_RESTART_SET(LF_TIMER_CONTROL3_AUTO_RESTART_RESET) | \ - LF_TIMER_CONTROL3_RESET_SET(LF_TIMER_CONTROL3_RESET_RESET)) -#define LF_TIMER_CONTROL3_HW_MASK (32'h0 | \ - LF_TIMER_CONTROL3_RESET_MASK) -#define LF_TIMER_CONTROL3_SW_MASK (32'h0 | \ - LF_TIMER_CONTROL3_ENABLE_MASK | \ - LF_TIMER_CONTROL3_AUTO_RESTART_MASK | \ - LF_TIMER_CONTROL3_RESET_MASK) - -#define LF_TIMER_STATUS3_ADDRESS 'h00000084 -#define LF_TIMER_STATUS3_INTERRUPT_MSB 0 -#define LF_TIMER_STATUS3_INTERRUPT_LSB 0 -#define LF_TIMER_STATUS3_INTERRUPT_MASK 'h00000001 -#define LF_TIMER_STATUS3_INTERRUPT_GET(x) (((x) & LF_TIMER_STATUS3_INTERRUPT_MASK) >> LF_TIMER_STATUS3_INTERRUPT_LSB) -#define LF_TIMER_STATUS3_INTERRUPT_SET(x) (((32'd0 | (x)) << LF_TIMER_STATUS3_INTERRUPT_LSB) & LF_TIMER_STATUS3_INTERRUPT_MASK) -#define LF_TIMER_STATUS3_INTERRUPT_RESET 1'h0 -#define LF_TIMER_STATUS3_RESET (32'h0 | \ - LF_TIMER_STATUS3_INTERRUPT_SET(LF_TIMER_STATUS3_INTERRUPT_RESET)) -#define LF_TIMER_STATUS3_HW_MASK (32'h0 | \ - LF_TIMER_STATUS3_INTERRUPT_MASK) -#define LF_TIMER_STATUS3_SW_MASK (32'h0 | \ - LF_TIMER_STATUS3_INTERRUPT_MASK) - -#define HF_TIMER_ADDRESS 'h00000088 -#define HF_TIMER_TARGET_MSB 31 -#define HF_TIMER_TARGET_LSB 12 -#define HF_TIMER_TARGET_MASK 'hfffff000 -#define HF_TIMER_TARGET_GET(x) (((x) & HF_TIMER_TARGET_MASK) >> HF_TIMER_TARGET_LSB) -#define HF_TIMER_TARGET_SET(x) (((32'd0 | (x)) << HF_TIMER_TARGET_LSB) & HF_TIMER_TARGET_MASK) -#define HF_TIMER_TARGET_RESET 20'h0 -#define HF_TIMER_RESET (32'h0 | \ - HF_TIMER_TARGET_SET(HF_TIMER_TARGET_RESET)) -#define HF_TIMER_HW_MASK (32'h0) -#define HF_TIMER_SW_MASK (32'h0 | \ - HF_TIMER_TARGET_MASK) - -#define HF_TIMER_COUNT_ADDRESS 'h0000008c -#define HF_TIMER_COUNT_VALUE_MSB 31 -#define HF_TIMER_COUNT_VALUE_LSB 12 -#define HF_TIMER_COUNT_VALUE_MASK 'hfffff000 -#define HF_TIMER_COUNT_VALUE_GET(x) (((x) & HF_TIMER_COUNT_VALUE_MASK) >> HF_TIMER_COUNT_VALUE_LSB) -#define HF_TIMER_COUNT_VALUE_SET(x) (((32'd0 | (x)) << HF_TIMER_COUNT_VALUE_LSB) & HF_TIMER_COUNT_VALUE_MASK) -#define HF_TIMER_COUNT_VALUE_RESET 20'h0 -#define HF_TIMER_COUNT_RESET (32'h0 | \ - HF_TIMER_COUNT_VALUE_SET(HF_TIMER_COUNT_VALUE_RESET)) -#define HF_TIMER_COUNT_HW_MASK (32'h0 | \ - HF_TIMER_COUNT_VALUE_MASK) -#define HF_TIMER_COUNT_SW_MASK (32'h0) - -#define HF_LF_COUNT_ADDRESS 'h00000090 -#define HF_LF_COUNT_VALUE_MSB 31 -#define HF_LF_COUNT_VALUE_LSB 0 -#define HF_LF_COUNT_VALUE_MASK 'hffffffff -#define HF_LF_COUNT_VALUE_GET(x) (((x) & HF_LF_COUNT_VALUE_MASK) >> HF_LF_COUNT_VALUE_LSB) -#define HF_LF_COUNT_VALUE_SET(x) (((32'd0 | (x)) << HF_LF_COUNT_VALUE_LSB) & HF_LF_COUNT_VALUE_MASK) -#define HF_LF_COUNT_VALUE_RESET 32'h0 -#define HF_LF_COUNT_RESET (32'h0 | \ - HF_LF_COUNT_VALUE_SET(HF_LF_COUNT_VALUE_RESET)) -#define HF_LF_COUNT_HW_MASK (32'h0 | \ - HF_LF_COUNT_VALUE_MASK) -#define HF_LF_COUNT_SW_MASK (32'h0) - -#define HF_TIMER_CONTROL_ADDRESS 'h00000094 -#define HF_TIMER_CONTROL_ENABLE_MSB 3 -#define HF_TIMER_CONTROL_ENABLE_LSB 3 -#define HF_TIMER_CONTROL_ENABLE_MASK 'h00000008 -#define HF_TIMER_CONTROL_ENABLE_GET(x) (((x) & HF_TIMER_CONTROL_ENABLE_MASK) >> HF_TIMER_CONTROL_ENABLE_LSB) -#define HF_TIMER_CONTROL_ENABLE_SET(x) (((32'd0 | (x)) << HF_TIMER_CONTROL_ENABLE_LSB) & HF_TIMER_CONTROL_ENABLE_MASK) -#define HF_TIMER_CONTROL_ENABLE_RESET 1'h1 -#define HF_TIMER_CONTROL_ON_MSB 2 -#define HF_TIMER_CONTROL_ON_LSB 2 -#define HF_TIMER_CONTROL_ON_MASK 'h00000004 -#define HF_TIMER_CONTROL_ON_GET(x) (((x) & HF_TIMER_CONTROL_ON_MASK) >> HF_TIMER_CONTROL_ON_LSB) -#define HF_TIMER_CONTROL_ON_SET(x) (((32'd0 | (x)) << HF_TIMER_CONTROL_ON_LSB) & HF_TIMER_CONTROL_ON_MASK) -#define HF_TIMER_CONTROL_ON_RESET 1'h0 -#define HF_TIMER_CONTROL_AUTO_RESTART_MSB 1 -#define HF_TIMER_CONTROL_AUTO_RESTART_LSB 1 -#define HF_TIMER_CONTROL_AUTO_RESTART_MASK 'h00000002 -#define HF_TIMER_CONTROL_AUTO_RESTART_GET(x) (((x) & HF_TIMER_CONTROL_AUTO_RESTART_MASK) >> HF_TIMER_CONTROL_AUTO_RESTART_LSB) -#define HF_TIMER_CONTROL_AUTO_RESTART_SET(x) (((32'd0 | (x)) << HF_TIMER_CONTROL_AUTO_RESTART_LSB) & HF_TIMER_CONTROL_AUTO_RESTART_MASK) -#define HF_TIMER_CONTROL_AUTO_RESTART_RESET 1'h0 -#define HF_TIMER_CONTROL_RESET_MSB 0 -#define HF_TIMER_CONTROL_RESET_LSB 0 -#define HF_TIMER_CONTROL_RESET_MASK 'h00000001 -#define HF_TIMER_CONTROL_RESET_GET(x) (((x) & HF_TIMER_CONTROL_RESET_MASK) >> HF_TIMER_CONTROL_RESET_LSB) -#define HF_TIMER_CONTROL_RESET_SET(x) (((32'd0 | (x)) << HF_TIMER_CONTROL_RESET_LSB) & HF_TIMER_CONTROL_RESET_MASK) -#define HF_TIMER_CONTROL_RESET_RESET 1'h0 -#define HF_TIMER_CONTROL_RESET (32'h0 | \ - HF_TIMER_CONTROL_ENABLE_SET(HF_TIMER_CONTROL_ENABLE_RESET) | \ - HF_TIMER_CONTROL_ON_SET(HF_TIMER_CONTROL_ON_RESET) | \ - HF_TIMER_CONTROL_AUTO_RESTART_SET(HF_TIMER_CONTROL_AUTO_RESTART_RESET) | \ - HF_TIMER_CONTROL_RESET_SET(HF_TIMER_CONTROL_RESET_RESET)) -#define HF_TIMER_CONTROL_HW_MASK (32'h0 | \ - HF_TIMER_CONTROL_RESET_MASK) -#define HF_TIMER_CONTROL_SW_MASK (32'h0 | \ - HF_TIMER_CONTROL_ENABLE_MASK | \ - HF_TIMER_CONTROL_ON_MASK | \ - HF_TIMER_CONTROL_AUTO_RESTART_MASK | \ - HF_TIMER_CONTROL_RESET_MASK) - -#define HF_TIMER_STATUS_ADDRESS 'h00000098 -#define HF_TIMER_STATUS_INTERRUPT_MSB 0 -#define HF_TIMER_STATUS_INTERRUPT_LSB 0 -#define HF_TIMER_STATUS_INTERRUPT_MASK 'h00000001 -#define HF_TIMER_STATUS_INTERRUPT_GET(x) (((x) & HF_TIMER_STATUS_INTERRUPT_MASK) >> HF_TIMER_STATUS_INTERRUPT_LSB) -#define HF_TIMER_STATUS_INTERRUPT_SET(x) (((32'd0 | (x)) << HF_TIMER_STATUS_INTERRUPT_LSB) & HF_TIMER_STATUS_INTERRUPT_MASK) -#define HF_TIMER_STATUS_INTERRUPT_RESET 1'h0 -#define HF_TIMER_STATUS_RESET (32'h0 | \ - HF_TIMER_STATUS_INTERRUPT_SET(HF_TIMER_STATUS_INTERRUPT_RESET)) -#define HF_TIMER_STATUS_HW_MASK (32'h0 | \ - HF_TIMER_STATUS_INTERRUPT_MASK) -#define HF_TIMER_STATUS_SW_MASK (32'h0 | \ - HF_TIMER_STATUS_INTERRUPT_MASK) - -#define RTC_CONTROL_ADDRESS 'h0000009c -#define RTC_CONTROL_ENABLE_MSB 2 -#define RTC_CONTROL_ENABLE_LSB 2 -#define RTC_CONTROL_ENABLE_MASK 'h00000004 -#define RTC_CONTROL_ENABLE_GET(x) (((x) & RTC_CONTROL_ENABLE_MASK) >> RTC_CONTROL_ENABLE_LSB) -#define RTC_CONTROL_ENABLE_SET(x) (((32'd0 | (x)) << RTC_CONTROL_ENABLE_LSB) & RTC_CONTROL_ENABLE_MASK) -#define RTC_CONTROL_ENABLE_RESET 1'h0 -#define RTC_CONTROL_LOAD_RTC_MSB 1 -#define RTC_CONTROL_LOAD_RTC_LSB 1 -#define RTC_CONTROL_LOAD_RTC_MASK 'h00000002 -#define RTC_CONTROL_LOAD_RTC_GET(x) (((x) & RTC_CONTROL_LOAD_RTC_MASK) >> RTC_CONTROL_LOAD_RTC_LSB) -#define RTC_CONTROL_LOAD_RTC_SET(x) (((32'd0 | (x)) << RTC_CONTROL_LOAD_RTC_LSB) & RTC_CONTROL_LOAD_RTC_MASK) -#define RTC_CONTROL_LOAD_RTC_RESET 1'h0 -#define RTC_CONTROL_LOAD_ALARM_MSB 0 -#define RTC_CONTROL_LOAD_ALARM_LSB 0 -#define RTC_CONTROL_LOAD_ALARM_MASK 'h00000001 -#define RTC_CONTROL_LOAD_ALARM_GET(x) (((x) & RTC_CONTROL_LOAD_ALARM_MASK) >> RTC_CONTROL_LOAD_ALARM_LSB) -#define RTC_CONTROL_LOAD_ALARM_SET(x) (((32'd0 | (x)) << RTC_CONTROL_LOAD_ALARM_LSB) & RTC_CONTROL_LOAD_ALARM_MASK) -#define RTC_CONTROL_LOAD_ALARM_RESET 1'h0 -#define RTC_CONTROL_RESET (32'h0 | \ - RTC_CONTROL_ENABLE_SET(RTC_CONTROL_ENABLE_RESET) | \ - RTC_CONTROL_LOAD_RTC_SET(RTC_CONTROL_LOAD_RTC_RESET) | \ - RTC_CONTROL_LOAD_ALARM_SET(RTC_CONTROL_LOAD_ALARM_RESET)) -#define RTC_CONTROL_HW_MASK (32'h0 | \ - RTC_CONTROL_LOAD_RTC_MASK | \ - RTC_CONTROL_LOAD_ALARM_MASK) -#define RTC_CONTROL_SW_MASK (32'h0 | \ - RTC_CONTROL_ENABLE_MASK | \ - RTC_CONTROL_LOAD_RTC_MASK | \ - RTC_CONTROL_LOAD_ALARM_MASK) - -#define RTC_TIME_ADDRESS 'h000000a0 -#define RTC_TIME_WEEK_DAY_MSB 26 -#define RTC_TIME_WEEK_DAY_LSB 24 -#define RTC_TIME_WEEK_DAY_MASK 'h07000000 -#define RTC_TIME_WEEK_DAY_GET(x) (((x) & RTC_TIME_WEEK_DAY_MASK) >> RTC_TIME_WEEK_DAY_LSB) -#define RTC_TIME_WEEK_DAY_SET(x) (((32'd0 | (x)) << RTC_TIME_WEEK_DAY_LSB) & RTC_TIME_WEEK_DAY_MASK) -#define RTC_TIME_WEEK_DAY_RESET 3'h1 -#define RTC_TIME_HOUR_MSB 21 -#define RTC_TIME_HOUR_LSB 16 -#define RTC_TIME_HOUR_MASK 'h003f0000 -#define RTC_TIME_HOUR_GET(x) (((x) & RTC_TIME_HOUR_MASK) >> RTC_TIME_HOUR_LSB) -#define RTC_TIME_HOUR_SET(x) (((32'd0 | (x)) << RTC_TIME_HOUR_LSB) & RTC_TIME_HOUR_MASK) -#define RTC_TIME_HOUR_RESET 6'h12 -#define RTC_TIME_MINUTE_MSB 14 -#define RTC_TIME_MINUTE_LSB 8 -#define RTC_TIME_MINUTE_MASK 'h00007f00 -#define RTC_TIME_MINUTE_GET(x) (((x) & RTC_TIME_MINUTE_MASK) >> RTC_TIME_MINUTE_LSB) -#define RTC_TIME_MINUTE_SET(x) (((32'd0 | (x)) << RTC_TIME_MINUTE_LSB) & RTC_TIME_MINUTE_MASK) -#define RTC_TIME_MINUTE_RESET 7'h0 -#define RTC_TIME_SECOND_MSB 6 -#define RTC_TIME_SECOND_LSB 0 -#define RTC_TIME_SECOND_MASK 'h0000007f -#define RTC_TIME_SECOND_GET(x) (((x) & RTC_TIME_SECOND_MASK) >> RTC_TIME_SECOND_LSB) -#define RTC_TIME_SECOND_SET(x) (((32'd0 | (x)) << RTC_TIME_SECOND_LSB) & RTC_TIME_SECOND_MASK) -#define RTC_TIME_SECOND_RESET 7'h0 -#define RTC_TIME_RESET (32'h0 | \ - RTC_TIME_WEEK_DAY_SET(RTC_TIME_WEEK_DAY_RESET) | \ - RTC_TIME_HOUR_SET(RTC_TIME_HOUR_RESET) | \ - RTC_TIME_MINUTE_SET(RTC_TIME_MINUTE_RESET) | \ - RTC_TIME_SECOND_SET(RTC_TIME_SECOND_RESET)) -#define RTC_TIME_HW_MASK (32'h0 | \ - RTC_TIME_WEEK_DAY_MASK | \ - RTC_TIME_HOUR_MASK | \ - RTC_TIME_MINUTE_MASK | \ - RTC_TIME_SECOND_MASK) -#define RTC_TIME_SW_MASK (32'h0) - -#define RTC_DATE_ADDRESS 'h000000a4 -#define RTC_DATE_YEAR_MSB 23 -#define RTC_DATE_YEAR_LSB 16 -#define RTC_DATE_YEAR_MASK 'h00ff0000 -#define RTC_DATE_YEAR_GET(x) (((x) & RTC_DATE_YEAR_MASK) >> RTC_DATE_YEAR_LSB) -#define RTC_DATE_YEAR_SET(x) (((32'd0 | (x)) << RTC_DATE_YEAR_LSB) & RTC_DATE_YEAR_MASK) -#define RTC_DATE_YEAR_RESET 8'h0 -#define RTC_DATE_MONTH_MSB 12 -#define RTC_DATE_MONTH_LSB 8 -#define RTC_DATE_MONTH_MASK 'h00001f00 -#define RTC_DATE_MONTH_GET(x) (((x) & RTC_DATE_MONTH_MASK) >> RTC_DATE_MONTH_LSB) -#define RTC_DATE_MONTH_SET(x) (((32'd0 | (x)) << RTC_DATE_MONTH_LSB) & RTC_DATE_MONTH_MASK) -#define RTC_DATE_MONTH_RESET 5'h1 -#define RTC_DATE_MONTH_DAY_MSB 5 -#define RTC_DATE_MONTH_DAY_LSB 0 -#define RTC_DATE_MONTH_DAY_MASK 'h0000003f -#define RTC_DATE_MONTH_DAY_GET(x) (((x) & RTC_DATE_MONTH_DAY_MASK) >> RTC_DATE_MONTH_DAY_LSB) -#define RTC_DATE_MONTH_DAY_SET(x) (((32'd0 | (x)) << RTC_DATE_MONTH_DAY_LSB) & RTC_DATE_MONTH_DAY_MASK) -#define RTC_DATE_MONTH_DAY_RESET 6'h1 -#define RTC_DATE_RESET (32'h0 | \ - RTC_DATE_YEAR_SET(RTC_DATE_YEAR_RESET) | \ - RTC_DATE_MONTH_SET(RTC_DATE_MONTH_RESET) | \ - RTC_DATE_MONTH_DAY_SET(RTC_DATE_MONTH_DAY_RESET)) -#define RTC_DATE_HW_MASK (32'h0 | \ - RTC_DATE_YEAR_MASK | \ - RTC_DATE_MONTH_MASK | \ - RTC_DATE_MONTH_DAY_MASK) -#define RTC_DATE_SW_MASK (32'h0) - -#define RTC_SET_TIME_ADDRESS 'h000000a8 -#define RTC_SET_TIME_WEEK_DAY_MSB 26 -#define RTC_SET_TIME_WEEK_DAY_LSB 24 -#define RTC_SET_TIME_WEEK_DAY_MASK 'h07000000 -#define RTC_SET_TIME_WEEK_DAY_GET(x) (((x) & RTC_SET_TIME_WEEK_DAY_MASK) >> RTC_SET_TIME_WEEK_DAY_LSB) -#define RTC_SET_TIME_WEEK_DAY_SET(x) (((32'd0 | (x)) << RTC_SET_TIME_WEEK_DAY_LSB) & RTC_SET_TIME_WEEK_DAY_MASK) -#define RTC_SET_TIME_WEEK_DAY_RESET 3'h1 -#define RTC_SET_TIME_HOUR_MSB 21 -#define RTC_SET_TIME_HOUR_LSB 16 -#define RTC_SET_TIME_HOUR_MASK 'h003f0000 -#define RTC_SET_TIME_HOUR_GET(x) (((x) & RTC_SET_TIME_HOUR_MASK) >> RTC_SET_TIME_HOUR_LSB) -#define RTC_SET_TIME_HOUR_SET(x) (((32'd0 | (x)) << RTC_SET_TIME_HOUR_LSB) & RTC_SET_TIME_HOUR_MASK) -#define RTC_SET_TIME_HOUR_RESET 6'h0 -#define RTC_SET_TIME_MINUTE_MSB 14 -#define RTC_SET_TIME_MINUTE_LSB 8 -#define RTC_SET_TIME_MINUTE_MASK 'h00007f00 -#define RTC_SET_TIME_MINUTE_GET(x) (((x) & RTC_SET_TIME_MINUTE_MASK) >> RTC_SET_TIME_MINUTE_LSB) -#define RTC_SET_TIME_MINUTE_SET(x) (((32'd0 | (x)) << RTC_SET_TIME_MINUTE_LSB) & RTC_SET_TIME_MINUTE_MASK) -#define RTC_SET_TIME_MINUTE_RESET 7'h0 -#define RTC_SET_TIME_SECOND_MSB 6 -#define RTC_SET_TIME_SECOND_LSB 0 -#define RTC_SET_TIME_SECOND_MASK 'h0000007f -#define RTC_SET_TIME_SECOND_GET(x) (((x) & RTC_SET_TIME_SECOND_MASK) >> RTC_SET_TIME_SECOND_LSB) -#define RTC_SET_TIME_SECOND_SET(x) (((32'd0 | (x)) << RTC_SET_TIME_SECOND_LSB) & RTC_SET_TIME_SECOND_MASK) -#define RTC_SET_TIME_SECOND_RESET 7'h0 -#define RTC_SET_TIME_RESET (32'h0 | \ - RTC_SET_TIME_WEEK_DAY_SET(RTC_SET_TIME_WEEK_DAY_RESET) | \ - RTC_SET_TIME_HOUR_SET(RTC_SET_TIME_HOUR_RESET) | \ - RTC_SET_TIME_MINUTE_SET(RTC_SET_TIME_MINUTE_RESET) | \ - RTC_SET_TIME_SECOND_SET(RTC_SET_TIME_SECOND_RESET)) -#define RTC_SET_TIME_HW_MASK (32'h0) -#define RTC_SET_TIME_SW_MASK (32'h0 | \ - RTC_SET_TIME_WEEK_DAY_MASK | \ - RTC_SET_TIME_HOUR_MASK | \ - RTC_SET_TIME_MINUTE_MASK | \ - RTC_SET_TIME_SECOND_MASK) - -#define RTC_SET_DATE_ADDRESS 'h000000ac -#define RTC_SET_DATE_YEAR_MSB 23 -#define RTC_SET_DATE_YEAR_LSB 16 -#define RTC_SET_DATE_YEAR_MASK 'h00ff0000 -#define RTC_SET_DATE_YEAR_GET(x) (((x) & RTC_SET_DATE_YEAR_MASK) >> RTC_SET_DATE_YEAR_LSB) -#define RTC_SET_DATE_YEAR_SET(x) (((32'd0 | (x)) << RTC_SET_DATE_YEAR_LSB) & RTC_SET_DATE_YEAR_MASK) -#define RTC_SET_DATE_YEAR_RESET 8'h0 -#define RTC_SET_DATE_MONTH_MSB 12 -#define RTC_SET_DATE_MONTH_LSB 8 -#define RTC_SET_DATE_MONTH_MASK 'h00001f00 -#define RTC_SET_DATE_MONTH_GET(x) (((x) & RTC_SET_DATE_MONTH_MASK) >> RTC_SET_DATE_MONTH_LSB) -#define RTC_SET_DATE_MONTH_SET(x) (((32'd0 | (x)) << RTC_SET_DATE_MONTH_LSB) & RTC_SET_DATE_MONTH_MASK) -#define RTC_SET_DATE_MONTH_RESET 5'h1 -#define RTC_SET_DATE_MONTH_DAY_MSB 5 -#define RTC_SET_DATE_MONTH_DAY_LSB 0 -#define RTC_SET_DATE_MONTH_DAY_MASK 'h0000003f -#define RTC_SET_DATE_MONTH_DAY_GET(x) (((x) & RTC_SET_DATE_MONTH_DAY_MASK) >> RTC_SET_DATE_MONTH_DAY_LSB) -#define RTC_SET_DATE_MONTH_DAY_SET(x) (((32'd0 | (x)) << RTC_SET_DATE_MONTH_DAY_LSB) & RTC_SET_DATE_MONTH_DAY_MASK) -#define RTC_SET_DATE_MONTH_DAY_RESET 6'h1 -#define RTC_SET_DATE_RESET (32'h0 | \ - RTC_SET_DATE_YEAR_SET(RTC_SET_DATE_YEAR_RESET) | \ - RTC_SET_DATE_MONTH_SET(RTC_SET_DATE_MONTH_RESET) | \ - RTC_SET_DATE_MONTH_DAY_SET(RTC_SET_DATE_MONTH_DAY_RESET)) -#define RTC_SET_DATE_HW_MASK (32'h0) -#define RTC_SET_DATE_SW_MASK (32'h0 | \ - RTC_SET_DATE_YEAR_MASK | \ - RTC_SET_DATE_MONTH_MASK | \ - RTC_SET_DATE_MONTH_DAY_MASK) - -#define RTC_SET_ALARM_ADDRESS 'h000000b0 -#define RTC_SET_ALARM_HOUR_MSB 21 -#define RTC_SET_ALARM_HOUR_LSB 16 -#define RTC_SET_ALARM_HOUR_MASK 'h003f0000 -#define RTC_SET_ALARM_HOUR_GET(x) (((x) & RTC_SET_ALARM_HOUR_MASK) >> RTC_SET_ALARM_HOUR_LSB) -#define RTC_SET_ALARM_HOUR_SET(x) (((32'd0 | (x)) << RTC_SET_ALARM_HOUR_LSB) & RTC_SET_ALARM_HOUR_MASK) -#define RTC_SET_ALARM_HOUR_RESET 6'h0 -#define RTC_SET_ALARM_MINUTE_MSB 14 -#define RTC_SET_ALARM_MINUTE_LSB 8 -#define RTC_SET_ALARM_MINUTE_MASK 'h00007f00 -#define RTC_SET_ALARM_MINUTE_GET(x) (((x) & RTC_SET_ALARM_MINUTE_MASK) >> RTC_SET_ALARM_MINUTE_LSB) -#define RTC_SET_ALARM_MINUTE_SET(x) (((32'd0 | (x)) << RTC_SET_ALARM_MINUTE_LSB) & RTC_SET_ALARM_MINUTE_MASK) -#define RTC_SET_ALARM_MINUTE_RESET 7'h0 -#define RTC_SET_ALARM_SECOND_MSB 6 -#define RTC_SET_ALARM_SECOND_LSB 0 -#define RTC_SET_ALARM_SECOND_MASK 'h0000007f -#define RTC_SET_ALARM_SECOND_GET(x) (((x) & RTC_SET_ALARM_SECOND_MASK) >> RTC_SET_ALARM_SECOND_LSB) -#define RTC_SET_ALARM_SECOND_SET(x) (((32'd0 | (x)) << RTC_SET_ALARM_SECOND_LSB) & RTC_SET_ALARM_SECOND_MASK) -#define RTC_SET_ALARM_SECOND_RESET 7'h0 -#define RTC_SET_ALARM_RESET (32'h0 | \ - RTC_SET_ALARM_HOUR_SET(RTC_SET_ALARM_HOUR_RESET) | \ - RTC_SET_ALARM_MINUTE_SET(RTC_SET_ALARM_MINUTE_RESET) | \ - RTC_SET_ALARM_SECOND_SET(RTC_SET_ALARM_SECOND_RESET)) -#define RTC_SET_ALARM_HW_MASK (32'h0) -#define RTC_SET_ALARM_SW_MASK (32'h0 | \ - RTC_SET_ALARM_HOUR_MASK | \ - RTC_SET_ALARM_MINUTE_MASK | \ - RTC_SET_ALARM_SECOND_MASK) - -#define RTC_CONFIG_ADDRESS 'h000000b4 -#define RTC_CONFIG_BCD_MSB 2 -#define RTC_CONFIG_BCD_LSB 2 -#define RTC_CONFIG_BCD_MASK 'h00000004 -#define RTC_CONFIG_BCD_GET(x) (((x) & RTC_CONFIG_BCD_MASK) >> RTC_CONFIG_BCD_LSB) -#define RTC_CONFIG_BCD_SET(x) (((32'd0 | (x)) << RTC_CONFIG_BCD_LSB) & RTC_CONFIG_BCD_MASK) -#define RTC_CONFIG_BCD_RESET 1'h1 -#define RTC_CONFIG_TWELVE_HOUR_MSB 1 -#define RTC_CONFIG_TWELVE_HOUR_LSB 1 -#define RTC_CONFIG_TWELVE_HOUR_MASK 'h00000002 -#define RTC_CONFIG_TWELVE_HOUR_GET(x) (((x) & RTC_CONFIG_TWELVE_HOUR_MASK) >> RTC_CONFIG_TWELVE_HOUR_LSB) -#define RTC_CONFIG_TWELVE_HOUR_SET(x) (((32'd0 | (x)) << RTC_CONFIG_TWELVE_HOUR_LSB) & RTC_CONFIG_TWELVE_HOUR_MASK) -#define RTC_CONFIG_TWELVE_HOUR_RESET 1'h1 -#define RTC_CONFIG_DSE_MSB 0 -#define RTC_CONFIG_DSE_LSB 0 -#define RTC_CONFIG_DSE_MASK 'h00000001 -#define RTC_CONFIG_DSE_GET(x) (((x) & RTC_CONFIG_DSE_MASK) >> RTC_CONFIG_DSE_LSB) -#define RTC_CONFIG_DSE_SET(x) (((32'd0 | (x)) << RTC_CONFIG_DSE_LSB) & RTC_CONFIG_DSE_MASK) -#define RTC_CONFIG_DSE_RESET 1'h1 -#define RTC_CONFIG_RESET (32'h0 | \ - RTC_CONFIG_BCD_SET(RTC_CONFIG_BCD_RESET) | \ - RTC_CONFIG_TWELVE_HOUR_SET(RTC_CONFIG_TWELVE_HOUR_RESET) | \ - RTC_CONFIG_DSE_SET(RTC_CONFIG_DSE_RESET)) -#define RTC_CONFIG_HW_MASK (32'h0) -#define RTC_CONFIG_SW_MASK (32'h0 | \ - RTC_CONFIG_BCD_MASK | \ - RTC_CONFIG_TWELVE_HOUR_MASK | \ - RTC_CONFIG_DSE_MASK) - -#define RTC_ALARM_STATUS_ADDRESS 'h000000b8 -#define RTC_ALARM_STATUS_ENABLE_MSB 1 -#define RTC_ALARM_STATUS_ENABLE_LSB 1 -#define RTC_ALARM_STATUS_ENABLE_MASK 'h00000002 -#define RTC_ALARM_STATUS_ENABLE_GET(x) (((x) & RTC_ALARM_STATUS_ENABLE_MASK) >> RTC_ALARM_STATUS_ENABLE_LSB) -#define RTC_ALARM_STATUS_ENABLE_SET(x) (((32'd0 | (x)) << RTC_ALARM_STATUS_ENABLE_LSB) & RTC_ALARM_STATUS_ENABLE_MASK) -#define RTC_ALARM_STATUS_ENABLE_RESET 1'h0 -#define RTC_ALARM_STATUS_INTERRUPT_MSB 0 -#define RTC_ALARM_STATUS_INTERRUPT_LSB 0 -#define RTC_ALARM_STATUS_INTERRUPT_MASK 'h00000001 -#define RTC_ALARM_STATUS_INTERRUPT_GET(x) (((x) & RTC_ALARM_STATUS_INTERRUPT_MASK) >> RTC_ALARM_STATUS_INTERRUPT_LSB) -#define RTC_ALARM_STATUS_INTERRUPT_SET(x) (((32'd0 | (x)) << RTC_ALARM_STATUS_INTERRUPT_LSB) & RTC_ALARM_STATUS_INTERRUPT_MASK) -#define RTC_ALARM_STATUS_INTERRUPT_RESET 1'h0 -#define RTC_ALARM_STATUS_RESET (32'h0 | \ - RTC_ALARM_STATUS_ENABLE_SET(RTC_ALARM_STATUS_ENABLE_RESET) | \ - RTC_ALARM_STATUS_INTERRUPT_SET(RTC_ALARM_STATUS_INTERRUPT_RESET)) -#define RTC_ALARM_STATUS_HW_MASK (32'h0 | \ - RTC_ALARM_STATUS_ENABLE_MASK | \ - RTC_ALARM_STATUS_INTERRUPT_MASK) -#define RTC_ALARM_STATUS_SW_MASK (32'h0 | \ - RTC_ALARM_STATUS_ENABLE_MASK | \ - RTC_ALARM_STATUS_INTERRUPT_MASK) - -#define UART_WAKEUP_ADDRESS 'h000000bc -#define UART_WAKEUP_ENABLE_MSB 0 -#define UART_WAKEUP_ENABLE_LSB 0 -#define UART_WAKEUP_ENABLE_MASK 'h00000001 -#define UART_WAKEUP_ENABLE_GET(x) (((x) & UART_WAKEUP_ENABLE_MASK) >> UART_WAKEUP_ENABLE_LSB) -#define UART_WAKEUP_ENABLE_SET(x) (((32'd0 | (x)) << UART_WAKEUP_ENABLE_LSB) & UART_WAKEUP_ENABLE_MASK) -#define UART_WAKEUP_ENABLE_RESET 1'h0 -#define UART_WAKEUP_RESET (32'h0 | \ - UART_WAKEUP_ENABLE_SET(UART_WAKEUP_ENABLE_RESET)) -#define UART_WAKEUP_HW_MASK (32'h0) -#define UART_WAKEUP_SW_MASK (32'h0 | \ - UART_WAKEUP_ENABLE_MASK) - -#define RESET_CAUSE_ADDRESS 'h000000c0 -#define RESET_CAUSE_LAST_MSB 2 -#define RESET_CAUSE_LAST_LSB 0 -#define RESET_CAUSE_LAST_MASK 'h00000007 -#define RESET_CAUSE_LAST_GET(x) (((x) & RESET_CAUSE_LAST_MASK) >> RESET_CAUSE_LAST_LSB) -#define RESET_CAUSE_LAST_SET(x) (((32'd0 | (x)) << RESET_CAUSE_LAST_LSB) & RESET_CAUSE_LAST_MASK) -#define RESET_CAUSE_LAST_RESET 3'h0 -#define RESET_CAUSE_RESET (32'h0 | \ - RESET_CAUSE_LAST_SET(RESET_CAUSE_LAST_RESET)) -#define RESET_CAUSE_HW_MASK (32'h0 | \ - RESET_CAUSE_LAST_MASK) -#define RESET_CAUSE_SW_MASK (32'h0) - -#define SYSTEM_SLEEP_ADDRESS 'h000000c4 -#define SYSTEM_SLEEP_HOST_IF_MSB 4 -#define SYSTEM_SLEEP_HOST_IF_LSB 4 -#define SYSTEM_SLEEP_HOST_IF_MASK 'h00000010 -#define SYSTEM_SLEEP_HOST_IF_GET(x) (((x) & SYSTEM_SLEEP_HOST_IF_MASK) >> SYSTEM_SLEEP_HOST_IF_LSB) -#define SYSTEM_SLEEP_HOST_IF_SET(x) (((32'd0 | (x)) << SYSTEM_SLEEP_HOST_IF_LSB) & SYSTEM_SLEEP_HOST_IF_MASK) -#define SYSTEM_SLEEP_HOST_IF_RESET 1'h1 -#define SYSTEM_SLEEP_MBOX_MSB 3 -#define SYSTEM_SLEEP_MBOX_LSB 3 -#define SYSTEM_SLEEP_MBOX_MASK 'h00000008 -#define SYSTEM_SLEEP_MBOX_GET(x) (((x) & SYSTEM_SLEEP_MBOX_MASK) >> SYSTEM_SLEEP_MBOX_LSB) -#define SYSTEM_SLEEP_MBOX_SET(x) (((32'd0 | (x)) << SYSTEM_SLEEP_MBOX_LSB) & SYSTEM_SLEEP_MBOX_MASK) -#define SYSTEM_SLEEP_MBOX_RESET 1'h1 -#define SYSTEM_SLEEP_MAC_IF_MSB 2 -#define SYSTEM_SLEEP_MAC_IF_LSB 2 -#define SYSTEM_SLEEP_MAC_IF_MASK 'h00000004 -#define SYSTEM_SLEEP_MAC_IF_GET(x) (((x) & SYSTEM_SLEEP_MAC_IF_MASK) >> SYSTEM_SLEEP_MAC_IF_LSB) -#define SYSTEM_SLEEP_MAC_IF_SET(x) (((32'd0 | (x)) << SYSTEM_SLEEP_MAC_IF_LSB) & SYSTEM_SLEEP_MAC_IF_MASK) -#define SYSTEM_SLEEP_MAC_IF_RESET 1'h1 -#define SYSTEM_SLEEP_LIGHT_MSB 1 -#define SYSTEM_SLEEP_LIGHT_LSB 1 -#define SYSTEM_SLEEP_LIGHT_MASK 'h00000002 -#define SYSTEM_SLEEP_LIGHT_GET(x) (((x) & SYSTEM_SLEEP_LIGHT_MASK) >> SYSTEM_SLEEP_LIGHT_LSB) -#define SYSTEM_SLEEP_LIGHT_SET(x) (((32'd0 | (x)) << SYSTEM_SLEEP_LIGHT_LSB) & SYSTEM_SLEEP_LIGHT_MASK) -#define SYSTEM_SLEEP_LIGHT_RESET 1'h0 -#define SYSTEM_SLEEP_DISABLE_MSB 0 -#define SYSTEM_SLEEP_DISABLE_LSB 0 -#define SYSTEM_SLEEP_DISABLE_MASK 'h00000001 -#define SYSTEM_SLEEP_DISABLE_GET(x) (((x) & SYSTEM_SLEEP_DISABLE_MASK) >> SYSTEM_SLEEP_DISABLE_LSB) -#define SYSTEM_SLEEP_DISABLE_SET(x) (((32'd0 | (x)) << SYSTEM_SLEEP_DISABLE_LSB) & SYSTEM_SLEEP_DISABLE_MASK) -#define SYSTEM_SLEEP_DISABLE_RESET 1'h1 -#define SYSTEM_SLEEP_RESET (32'h0 | \ - SYSTEM_SLEEP_HOST_IF_SET(SYSTEM_SLEEP_HOST_IF_RESET) | \ - SYSTEM_SLEEP_MBOX_SET(SYSTEM_SLEEP_MBOX_RESET) | \ - SYSTEM_SLEEP_MAC_IF_SET(SYSTEM_SLEEP_MAC_IF_RESET) | \ - SYSTEM_SLEEP_LIGHT_SET(SYSTEM_SLEEP_LIGHT_RESET) | \ - SYSTEM_SLEEP_DISABLE_SET(SYSTEM_SLEEP_DISABLE_RESET)) -#define SYSTEM_SLEEP_HW_MASK (32'h0 | \ - SYSTEM_SLEEP_HOST_IF_MASK | \ - SYSTEM_SLEEP_MBOX_MASK | \ - SYSTEM_SLEEP_MAC_IF_MASK) -#define SYSTEM_SLEEP_SW_MASK (32'h0 | \ - SYSTEM_SLEEP_LIGHT_MASK | \ - SYSTEM_SLEEP_DISABLE_MASK) - -#define SDIO_WRAPPER_ADDRESS 'h000000c8 -#define SDIO_WRAPPER_SLEEP_MSB 3 -#define SDIO_WRAPPER_SLEEP_LSB 3 -#define SDIO_WRAPPER_SLEEP_MASK 'h00000008 -#define SDIO_WRAPPER_SLEEP_GET(x) (((x) & SDIO_WRAPPER_SLEEP_MASK) >> SDIO_WRAPPER_SLEEP_LSB) -#define SDIO_WRAPPER_SLEEP_SET(x) (((32'd0 | (x)) << SDIO_WRAPPER_SLEEP_LSB) & SDIO_WRAPPER_SLEEP_MASK) -#define SDIO_WRAPPER_SLEEP_RESET 1'h1 -#define SDIO_WRAPPER_WAKEUP_MSB 2 -#define SDIO_WRAPPER_WAKEUP_LSB 2 -#define SDIO_WRAPPER_WAKEUP_MASK 'h00000004 -#define SDIO_WRAPPER_WAKEUP_GET(x) (((x) & SDIO_WRAPPER_WAKEUP_MASK) >> SDIO_WRAPPER_WAKEUP_LSB) -#define SDIO_WRAPPER_WAKEUP_SET(x) (((32'd0 | (x)) << SDIO_WRAPPER_WAKEUP_LSB) & SDIO_WRAPPER_WAKEUP_MASK) -#define SDIO_WRAPPER_WAKEUP_RESET 1'h1 -#define SDIO_WRAPPER_SOC_ON_MSB 1 -#define SDIO_WRAPPER_SOC_ON_LSB 1 -#define SDIO_WRAPPER_SOC_ON_MASK 'h00000002 -#define SDIO_WRAPPER_SOC_ON_GET(x) (((x) & SDIO_WRAPPER_SOC_ON_MASK) >> SDIO_WRAPPER_SOC_ON_LSB) -#define SDIO_WRAPPER_SOC_ON_SET(x) (((32'd0 | (x)) << SDIO_WRAPPER_SOC_ON_LSB) & SDIO_WRAPPER_SOC_ON_MASK) -#define SDIO_WRAPPER_SOC_ON_RESET 1'h1 -#define SDIO_WRAPPER_ON_MSB 0 -#define SDIO_WRAPPER_ON_LSB 0 -#define SDIO_WRAPPER_ON_MASK 'h00000001 -#define SDIO_WRAPPER_ON_GET(x) (((x) & SDIO_WRAPPER_ON_MASK) >> SDIO_WRAPPER_ON_LSB) -#define SDIO_WRAPPER_ON_SET(x) (((32'd0 | (x)) << SDIO_WRAPPER_ON_LSB) & SDIO_WRAPPER_ON_MASK) -#define SDIO_WRAPPER_ON_RESET 1'h1 -#define SDIO_WRAPPER_RESET (32'h0 | \ - SDIO_WRAPPER_SLEEP_SET(SDIO_WRAPPER_SLEEP_RESET) | \ - SDIO_WRAPPER_WAKEUP_SET(SDIO_WRAPPER_WAKEUP_RESET) | \ - SDIO_WRAPPER_SOC_ON_SET(SDIO_WRAPPER_SOC_ON_RESET) | \ - SDIO_WRAPPER_ON_SET(SDIO_WRAPPER_ON_RESET)) -#define SDIO_WRAPPER_HW_MASK (32'h0) -#define SDIO_WRAPPER_SW_MASK (32'h0 | \ - SDIO_WRAPPER_SLEEP_MASK | \ - SDIO_WRAPPER_WAKEUP_MASK | \ - SDIO_WRAPPER_SOC_ON_MASK | \ - SDIO_WRAPPER_ON_MASK) - -#define MAC_SLEEP_CONTROL_ADDRESS 'h000000cc -#define MAC_SLEEP_CONTROL_ENABLE_MSB 1 -#define MAC_SLEEP_CONTROL_ENABLE_LSB 0 -#define MAC_SLEEP_CONTROL_ENABLE_MASK 'h00000003 -#define MAC_SLEEP_CONTROL_ENABLE_GET(x) (((x) & MAC_SLEEP_CONTROL_ENABLE_MASK) >> MAC_SLEEP_CONTROL_ENABLE_LSB) -#define MAC_SLEEP_CONTROL_ENABLE_SET(x) (((32'd0 | (x)) << MAC_SLEEP_CONTROL_ENABLE_LSB) & MAC_SLEEP_CONTROL_ENABLE_MASK) -#define MAC_SLEEP_CONTROL_ENABLE_RESET 2'h1 -#define MAC_SLEEP_CONTROL_RESET (32'h0 | \ - MAC_SLEEP_CONTROL_ENABLE_SET(MAC_SLEEP_CONTROL_ENABLE_RESET)) -#define MAC_SLEEP_CONTROL_HW_MASK (32'h0) -#define MAC_SLEEP_CONTROL_SW_MASK (32'h0 | \ - MAC_SLEEP_CONTROL_ENABLE_MASK) - -#define KEEP_AWAKE_ADDRESS 'h000000d0 -#define KEEP_AWAKE_COUNT_MSB 7 -#define KEEP_AWAKE_COUNT_LSB 0 -#define KEEP_AWAKE_COUNT_MASK 'h000000ff -#define KEEP_AWAKE_COUNT_GET(x) (((x) & KEEP_AWAKE_COUNT_MASK) >> KEEP_AWAKE_COUNT_LSB) -#define KEEP_AWAKE_COUNT_SET(x) (((32'd0 | (x)) << KEEP_AWAKE_COUNT_LSB) & KEEP_AWAKE_COUNT_MASK) -#define KEEP_AWAKE_COUNT_RESET 8'h2 -#define KEEP_AWAKE_RESET (32'h0 | \ - KEEP_AWAKE_COUNT_SET(KEEP_AWAKE_COUNT_RESET)) -#define KEEP_AWAKE_HW_MASK (32'h0) -#define KEEP_AWAKE_SW_MASK (32'h0 | \ - KEEP_AWAKE_COUNT_MASK) - -#define LPO_CAL_TIME_ADDRESS 'h000000d4 -#define LPO_CAL_TIME_LENGTH_MSB 13 -#define LPO_CAL_TIME_LENGTH_LSB 0 -#define LPO_CAL_TIME_LENGTH_MASK 'h00003fff -#define LPO_CAL_TIME_LENGTH_GET(x) (((x) & LPO_CAL_TIME_LENGTH_MASK) >> LPO_CAL_TIME_LENGTH_LSB) -#define LPO_CAL_TIME_LENGTH_SET(x) (((32'd0 | (x)) << LPO_CAL_TIME_LENGTH_LSB) & LPO_CAL_TIME_LENGTH_MASK) -#define LPO_CAL_TIME_LENGTH_RESET 14'h421 -#define LPO_CAL_TIME_RESET (32'h0 | \ - LPO_CAL_TIME_LENGTH_SET(LPO_CAL_TIME_LENGTH_RESET)) -#define LPO_CAL_TIME_HW_MASK (32'h0) -#define LPO_CAL_TIME_SW_MASK (32'h0 | \ - LPO_CAL_TIME_LENGTH_MASK) - -#define LPO_INIT_DIVIDEND_INT_ADDRESS 'h000000d8 -#define LPO_INIT_DIVIDEND_INT_VALUE_MSB 23 -#define LPO_INIT_DIVIDEND_INT_VALUE_LSB 0 -#define LPO_INIT_DIVIDEND_INT_VALUE_MASK 'h00ffffff -#define LPO_INIT_DIVIDEND_INT_VALUE_GET(x) (((x) & LPO_INIT_DIVIDEND_INT_VALUE_MASK) >> LPO_INIT_DIVIDEND_INT_VALUE_LSB) -#define LPO_INIT_DIVIDEND_INT_VALUE_SET(x) (((32'd0 | (x)) << LPO_INIT_DIVIDEND_INT_VALUE_LSB) & LPO_INIT_DIVIDEND_INT_VALUE_MASK) -#define LPO_INIT_DIVIDEND_INT_VALUE_RESET 24'hcce41 -#define LPO_INIT_DIVIDEND_INT_RESET (32'h0 | \ - LPO_INIT_DIVIDEND_INT_VALUE_SET(LPO_INIT_DIVIDEND_INT_VALUE_RESET)) -#define LPO_INIT_DIVIDEND_INT_HW_MASK (32'h0) -#define LPO_INIT_DIVIDEND_INT_SW_MASK (32'h0 | \ - LPO_INIT_DIVIDEND_INT_VALUE_MASK) - -#define LPO_INIT_DIVIDEND_FRACTION_ADDRESS 'h000000dc -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_MSB 10 -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB 0 -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK 'h000007ff -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_GET(x) (((x) & LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK) >> LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB) -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_SET(x) (((32'd0 | (x)) << LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB) & LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK) -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_RESET 11'h330 -#define LPO_INIT_DIVIDEND_FRACTION_RESET (32'h0 | \ - LPO_INIT_DIVIDEND_FRACTION_VALUE_SET(LPO_INIT_DIVIDEND_FRACTION_VALUE_RESET)) -#define LPO_INIT_DIVIDEND_FRACTION_HW_MASK (32'h0) -#define LPO_INIT_DIVIDEND_FRACTION_SW_MASK (32'h0 | \ - LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK) - -#define LPO_CAL_ADDRESS 'h000000e0 -#define LPO_CAL_ENABLE_MSB 20 -#define LPO_CAL_ENABLE_LSB 20 -#define LPO_CAL_ENABLE_MASK 'h00100000 -#define LPO_CAL_ENABLE_GET(x) (((x) & LPO_CAL_ENABLE_MASK) >> LPO_CAL_ENABLE_LSB) -#define LPO_CAL_ENABLE_SET(x) (((32'd0 | (x)) << LPO_CAL_ENABLE_LSB) & LPO_CAL_ENABLE_MASK) -#define LPO_CAL_ENABLE_RESET 1'h0 -#define LPO_CAL_COUNT_MSB 19 -#define LPO_CAL_COUNT_LSB 0 -#define LPO_CAL_COUNT_MASK 'h000fffff -#define LPO_CAL_COUNT_GET(x) (((x) & LPO_CAL_COUNT_MASK) >> LPO_CAL_COUNT_LSB) -#define LPO_CAL_COUNT_SET(x) (((32'd0 | (x)) << LPO_CAL_COUNT_LSB) & LPO_CAL_COUNT_MASK) -#define LPO_CAL_COUNT_RESET 20'h12c00 -#define LPO_CAL_RESET (32'h0 | \ - LPO_CAL_ENABLE_SET(LPO_CAL_ENABLE_RESET) | \ - LPO_CAL_COUNT_SET(LPO_CAL_COUNT_RESET)) -#define LPO_CAL_HW_MASK (32'h0 | \ - LPO_CAL_COUNT_MASK) -#define LPO_CAL_SW_MASK (32'h0 | \ - LPO_CAL_ENABLE_MASK) - -#define LPO_CAL_TEST_CONTROL_ADDRESS 'h000000e4 -#define LPO_CAL_TEST_CONTROL_ENABLE_MSB 5 -#define LPO_CAL_TEST_CONTROL_ENABLE_LSB 5 -#define LPO_CAL_TEST_CONTROL_ENABLE_MASK 'h00000020 -#define LPO_CAL_TEST_CONTROL_ENABLE_GET(x) (((x) & LPO_CAL_TEST_CONTROL_ENABLE_MASK) >> LPO_CAL_TEST_CONTROL_ENABLE_LSB) -#define LPO_CAL_TEST_CONTROL_ENABLE_SET(x) (((32'd0 | (x)) << LPO_CAL_TEST_CONTROL_ENABLE_LSB) & LPO_CAL_TEST_CONTROL_ENABLE_MASK) -#define LPO_CAL_TEST_CONTROL_ENABLE_RESET 1'h0 -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_MSB 4 -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB 0 -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK 'h0000001f -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_GET(x) (((x) & LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK) >> LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB) -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_SET(x) (((32'd0 | (x)) << LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB) & LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK) -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_RESET 5'h0 -#define LPO_CAL_TEST_CONTROL_RESET (32'h0 | \ - LPO_CAL_TEST_CONTROL_ENABLE_SET(LPO_CAL_TEST_CONTROL_ENABLE_RESET) | \ - LPO_CAL_TEST_CONTROL_RTC_CYCLES_SET(LPO_CAL_TEST_CONTROL_RTC_CYCLES_RESET)) -#define LPO_CAL_TEST_CONTROL_HW_MASK (32'h0) -#define LPO_CAL_TEST_CONTROL_SW_MASK (32'h0 | \ - LPO_CAL_TEST_CONTROL_ENABLE_MASK | \ - LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK) - -#define LPO_CAL_TEST_STATUS_ADDRESS 'h000000e8 -#define LPO_CAL_TEST_STATUS_READY_MSB 16 -#define LPO_CAL_TEST_STATUS_READY_LSB 16 -#define LPO_CAL_TEST_STATUS_READY_MASK 'h00010000 -#define LPO_CAL_TEST_STATUS_READY_GET(x) (((x) & LPO_CAL_TEST_STATUS_READY_MASK) >> LPO_CAL_TEST_STATUS_READY_LSB) -#define LPO_CAL_TEST_STATUS_READY_SET(x) (((32'd0 | (x)) << LPO_CAL_TEST_STATUS_READY_LSB) & LPO_CAL_TEST_STATUS_READY_MASK) -#define LPO_CAL_TEST_STATUS_READY_RESET 1'h0 -#define LPO_CAL_TEST_STATUS_COUNT_MSB 15 -#define LPO_CAL_TEST_STATUS_COUNT_LSB 0 -#define LPO_CAL_TEST_STATUS_COUNT_MASK 'h0000ffff -#define LPO_CAL_TEST_STATUS_COUNT_GET(x) (((x) & LPO_CAL_TEST_STATUS_COUNT_MASK) >> LPO_CAL_TEST_STATUS_COUNT_LSB) -#define LPO_CAL_TEST_STATUS_COUNT_SET(x) (((32'd0 | (x)) << LPO_CAL_TEST_STATUS_COUNT_LSB) & LPO_CAL_TEST_STATUS_COUNT_MASK) -#define LPO_CAL_TEST_STATUS_COUNT_RESET 16'h0 -#define LPO_CAL_TEST_STATUS_RESET (32'h0 | \ - LPO_CAL_TEST_STATUS_READY_SET(LPO_CAL_TEST_STATUS_READY_RESET) | \ - LPO_CAL_TEST_STATUS_COUNT_SET(LPO_CAL_TEST_STATUS_COUNT_RESET)) -#define LPO_CAL_TEST_STATUS_HW_MASK (32'h0 | \ - LPO_CAL_TEST_STATUS_READY_MASK | \ - LPO_CAL_TEST_STATUS_COUNT_MASK) -#define LPO_CAL_TEST_STATUS_SW_MASK (32'h0) - -#define CHIP_ID_ADDRESS 'h000000ec -#define CHIP_ID_DEVICE_ID_MSB 31 -#define CHIP_ID_DEVICE_ID_LSB 16 -#define CHIP_ID_DEVICE_ID_MASK 'hffff0000 -#define CHIP_ID_DEVICE_ID_GET(x) (((x) & CHIP_ID_DEVICE_ID_MASK) >> CHIP_ID_DEVICE_ID_LSB) -#define CHIP_ID_DEVICE_ID_SET(x) (((32'd0 | (x)) << CHIP_ID_DEVICE_ID_LSB) & CHIP_ID_DEVICE_ID_MASK) -#define CHIP_ID_DEVICE_ID_RESET 16'h0 -#define CHIP_ID_CONFIG_ID_MSB 15 -#define CHIP_ID_CONFIG_ID_LSB 4 -#define CHIP_ID_CONFIG_ID_MASK 'h0000fff0 -#define CHIP_ID_CONFIG_ID_GET(x) (((x) & CHIP_ID_CONFIG_ID_MASK) >> CHIP_ID_CONFIG_ID_LSB) -#define CHIP_ID_CONFIG_ID_SET(x) (((32'd0 | (x)) << CHIP_ID_CONFIG_ID_LSB) & CHIP_ID_CONFIG_ID_MASK) -#define CHIP_ID_CONFIG_ID_RESET 12'h0 -#define CHIP_ID_VERSION_ID_MSB 3 -#define CHIP_ID_VERSION_ID_LSB 0 -#define CHIP_ID_VERSION_ID_MASK 'h0000000f -#define CHIP_ID_VERSION_ID_GET(x) (((x) & CHIP_ID_VERSION_ID_MASK) >> CHIP_ID_VERSION_ID_LSB) -#define CHIP_ID_VERSION_ID_SET(x) (((32'd0 | (x)) << CHIP_ID_VERSION_ID_LSB) & CHIP_ID_VERSION_ID_MASK) -#define CHIP_ID_VERSION_ID_RESET 4'h1 -#define CHIP_ID_RESET (32'h0 | \ - CHIP_ID_DEVICE_ID_SET(CHIP_ID_DEVICE_ID_RESET) | \ - CHIP_ID_CONFIG_ID_SET(CHIP_ID_CONFIG_ID_RESET) | \ - CHIP_ID_VERSION_ID_SET(CHIP_ID_VERSION_ID_RESET)) -#define CHIP_ID_HW_MASK (32'h0 | \ - CHIP_ID_DEVICE_ID_MASK | \ - CHIP_ID_CONFIG_ID_MASK | \ - CHIP_ID_VERSION_ID_MASK) -#define CHIP_ID_SW_MASK (32'h0) - -#define DERIVED_RTC_CLK_ADDRESS 'h000000f0 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MSB 20 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB 20 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK 'h00100000 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_GET(x) (((x) & DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK) >> DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_SET(x) (((32'd0 | (x)) << DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB) & DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_RESET 1'h0 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_MSB 18 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB 18 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK 'h00040000 -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_GET(x) (((x) & DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK) >> DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_SET(x) (((32'd0 | (x)) << DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB) & DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_RESET 1'h0 -#define DERIVED_RTC_CLK_FORCE_MSB 17 -#define DERIVED_RTC_CLK_FORCE_LSB 16 -#define DERIVED_RTC_CLK_FORCE_MASK 'h00030000 -#define DERIVED_RTC_CLK_FORCE_GET(x) (((x) & DERIVED_RTC_CLK_FORCE_MASK) >> DERIVED_RTC_CLK_FORCE_LSB) -#define DERIVED_RTC_CLK_FORCE_SET(x) (((32'd0 | (x)) << DERIVED_RTC_CLK_FORCE_LSB) & DERIVED_RTC_CLK_FORCE_MASK) -#define DERIVED_RTC_CLK_FORCE_RESET 2'h0 -#define DERIVED_RTC_CLK_PERIOD_MSB 15 -#define DERIVED_RTC_CLK_PERIOD_LSB 1 -#define DERIVED_RTC_CLK_PERIOD_MASK 'h0000fffe -#define DERIVED_RTC_CLK_PERIOD_GET(x) (((x) & DERIVED_RTC_CLK_PERIOD_MASK) >> DERIVED_RTC_CLK_PERIOD_LSB) -#define DERIVED_RTC_CLK_PERIOD_SET(x) (((32'd0 | (x)) << DERIVED_RTC_CLK_PERIOD_LSB) & DERIVED_RTC_CLK_PERIOD_MASK) -#define DERIVED_RTC_CLK_PERIOD_RESET 15'h262 -#define DERIVED_RTC_CLK_RESET (32'h0 | \ - DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_SET(DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_RESET) | \ - DERIVED_RTC_CLK_EXTERNAL_DETECT_SET(DERIVED_RTC_CLK_EXTERNAL_DETECT_RESET) | \ - DERIVED_RTC_CLK_FORCE_SET(DERIVED_RTC_CLK_FORCE_RESET) | \ - DERIVED_RTC_CLK_PERIOD_SET(DERIVED_RTC_CLK_PERIOD_RESET)) -#define DERIVED_RTC_CLK_HW_MASK (32'h0 | \ - DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK) -#define DERIVED_RTC_CLK_SW_MASK (32'h0 | \ - DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK | \ - DERIVED_RTC_CLK_FORCE_MASK | \ - DERIVED_RTC_CLK_PERIOD_MASK) - -#define MAC_PCU_SLP32_MODE_ADDRESS 'h000000f4 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MSB 21 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_LSB 21 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MASK 'h00200000 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_GET(x) (((x) & MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MASK) >> MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_LSB) -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_LSB) & MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MASK) -#define MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_RESET 1'h1 -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MSB 19 -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB 0 -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK 'h000fffff -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_GET(x) (((x) & MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK) >> MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB) -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB) & MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK) -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_RESET 20'hf424 -#define MAC_PCU_SLP32_MODE_RESET (32'h0 | \ - MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_SET(MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_RESET) | \ - MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_SET(MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_RESET)) -#define MAC_PCU_SLP32_MODE_HW_MASK (32'h0 | \ - MAC_PCU_SLP32_MODE_TSF_WRITE_PENDING_MASK) -#define MAC_PCU_SLP32_MODE_SW_MASK (32'h0 | \ - MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK) - -#define MAC_PCU_SLP32_WAKE_ADDRESS 'h000000f8 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_MSB 15 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_LSB 0 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_MASK 'h0000ffff -#define MAC_PCU_SLP32_WAKE_XTL_TIME_GET(x) (((x) & MAC_PCU_SLP32_WAKE_XTL_TIME_MASK) >> MAC_PCU_SLP32_WAKE_XTL_TIME_LSB) -#define MAC_PCU_SLP32_WAKE_XTL_TIME_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP32_WAKE_XTL_TIME_LSB) & MAC_PCU_SLP32_WAKE_XTL_TIME_MASK) -#define MAC_PCU_SLP32_WAKE_XTL_TIME_RESET 16'h100 -#define MAC_PCU_SLP32_WAKE_RESET (32'h0 | \ - MAC_PCU_SLP32_WAKE_XTL_TIME_SET(MAC_PCU_SLP32_WAKE_XTL_TIME_RESET)) -#define MAC_PCU_SLP32_WAKE_HW_MASK (32'h0) -#define MAC_PCU_SLP32_WAKE_SW_MASK (32'h0 | \ - MAC_PCU_SLP32_WAKE_XTL_TIME_MASK) - -#define MAC_PCU_SLP32_INC_ADDRESS 'h000000fc -#define MAC_PCU_SLP32_INC_TSF_INC_MSB 19 -#define MAC_PCU_SLP32_INC_TSF_INC_LSB 0 -#define MAC_PCU_SLP32_INC_TSF_INC_MASK 'h000fffff -#define MAC_PCU_SLP32_INC_TSF_INC_GET(x) (((x) & MAC_PCU_SLP32_INC_TSF_INC_MASK) >> MAC_PCU_SLP32_INC_TSF_INC_LSB) -#define MAC_PCU_SLP32_INC_TSF_INC_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP32_INC_TSF_INC_LSB) & MAC_PCU_SLP32_INC_TSF_INC_MASK) -#define MAC_PCU_SLP32_INC_TSF_INC_RESET 20'h1e848 -#define MAC_PCU_SLP32_INC_RESET (32'h0 | \ - MAC_PCU_SLP32_INC_TSF_INC_SET(MAC_PCU_SLP32_INC_TSF_INC_RESET)) -#define MAC_PCU_SLP32_INC_HW_MASK (32'h0) -#define MAC_PCU_SLP32_INC_SW_MASK (32'h0 | \ - MAC_PCU_SLP32_INC_TSF_INC_MASK) - -#define MAC_PCU_SLP_MIB1_ADDRESS 'h00000100 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_MSB 31 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB 0 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK 'hffffffff -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_GET(x) (((x) & MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK) >> MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB) -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB) & MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK) -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_RESET 32'h0 -#define MAC_PCU_SLP_MIB1_RESET (32'h0 | \ - MAC_PCU_SLP_MIB1_SLEEP_CNT_SET(MAC_PCU_SLP_MIB1_SLEEP_CNT_RESET)) -#define MAC_PCU_SLP_MIB1_HW_MASK (32'h0 | \ - MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK) -#define MAC_PCU_SLP_MIB1_SW_MASK (32'h0 | \ - MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK) - -#define MAC_PCU_SLP_MIB2_ADDRESS 'h00000104 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_MSB 31 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB 0 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK 'hffffffff -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_GET(x) (((x) & MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK) >> MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB) -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB) & MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK) -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_RESET 32'h0 -#define MAC_PCU_SLP_MIB2_RESET (32'h0 | \ - MAC_PCU_SLP_MIB2_CYCLE_CNT_SET(MAC_PCU_SLP_MIB2_CYCLE_CNT_RESET)) -#define MAC_PCU_SLP_MIB2_HW_MASK (32'h0 | \ - MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK) -#define MAC_PCU_SLP_MIB2_SW_MASK (32'h0 | \ - MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK) - -#define MAC_PCU_SLP_MIB3_ADDRESS 'h00000108 -#define MAC_PCU_SLP_MIB3_PENDING_MSB 1 -#define MAC_PCU_SLP_MIB3_PENDING_LSB 1 -#define MAC_PCU_SLP_MIB3_PENDING_MASK 'h00000002 -#define MAC_PCU_SLP_MIB3_PENDING_GET(x) (((x) & MAC_PCU_SLP_MIB3_PENDING_MASK) >> MAC_PCU_SLP_MIB3_PENDING_LSB) -#define MAC_PCU_SLP_MIB3_PENDING_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP_MIB3_PENDING_LSB) & MAC_PCU_SLP_MIB3_PENDING_MASK) -#define MAC_PCU_SLP_MIB3_PENDING_RESET 1'h0 -#define MAC_PCU_SLP_MIB3_CLR_CNT_MSB 0 -#define MAC_PCU_SLP_MIB3_CLR_CNT_LSB 0 -#define MAC_PCU_SLP_MIB3_CLR_CNT_MASK 'h00000001 -#define MAC_PCU_SLP_MIB3_CLR_CNT_GET(x) (((x) & MAC_PCU_SLP_MIB3_CLR_CNT_MASK) >> MAC_PCU_SLP_MIB3_CLR_CNT_LSB) -#define MAC_PCU_SLP_MIB3_CLR_CNT_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP_MIB3_CLR_CNT_LSB) & MAC_PCU_SLP_MIB3_CLR_CNT_MASK) -#define MAC_PCU_SLP_MIB3_CLR_CNT_RESET 1'h0 -#define MAC_PCU_SLP_MIB3_RESET (32'h0 | \ - MAC_PCU_SLP_MIB3_PENDING_SET(MAC_PCU_SLP_MIB3_PENDING_RESET) | \ - MAC_PCU_SLP_MIB3_CLR_CNT_SET(MAC_PCU_SLP_MIB3_CLR_CNT_RESET)) -#define MAC_PCU_SLP_MIB3_HW_MASK (32'h0 | \ - MAC_PCU_SLP_MIB3_PENDING_MASK) -#define MAC_PCU_SLP_MIB3_SW_MASK (32'h0 | \ - MAC_PCU_SLP_MIB3_CLR_CNT_MASK) - -#define MAC_PCU_SLP_BEACON_ADDRESS 'h0000010c -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MSB 24 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_LSB 24 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MASK 'h01000000 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_GET(x) (((x) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MASK) >> MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_LSB) -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_LSB) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MASK) -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_RESET 1'h0 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MSB 23 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_LSB 0 -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MASK 'h00ffffff -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_GET(x) (((x) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MASK) >> MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_LSB) -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_SET(x) (((32'd0 | (x)) << MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_LSB) & MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MASK) -#define MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_RESET 24'hffffff -#define MAC_PCU_SLP_BEACON_RESET (32'h0 | \ - MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_SET(MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_RESET) | \ - MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_SET(MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_RESET)) -#define MAC_PCU_SLP_BEACON_HW_MASK (32'h0) -#define MAC_PCU_SLP_BEACON_SW_MASK (32'h0 | \ - MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_ENABLE_MASK | \ - MAC_PCU_SLP_BEACON_BMISS_TIMEOUT_MASK) - -#define POWER_REG_ADDRESS 'h00000110 -#define POWER_REG_VLVL_MSB 11 -#define POWER_REG_VLVL_LSB 8 -#define POWER_REG_VLVL_MASK 'h00000f00 -#define POWER_REG_VLVL_GET(x) (((x) & POWER_REG_VLVL_MASK) >> POWER_REG_VLVL_LSB) -#define POWER_REG_VLVL_SET(x) (((32'd0 | (x)) << POWER_REG_VLVL_LSB) & POWER_REG_VLVL_MASK) -#define POWER_REG_VLVL_RESET 4'h0 -#define POWER_REG_CPU_INT_ENABLE_MSB 7 -#define POWER_REG_CPU_INT_ENABLE_LSB 7 -#define POWER_REG_CPU_INT_ENABLE_MASK 'h00000080 -#define POWER_REG_CPU_INT_ENABLE_GET(x) (((x) & POWER_REG_CPU_INT_ENABLE_MASK) >> POWER_REG_CPU_INT_ENABLE_LSB) -#define POWER_REG_CPU_INT_ENABLE_SET(x) (((32'd0 | (x)) << POWER_REG_CPU_INT_ENABLE_LSB) & POWER_REG_CPU_INT_ENABLE_MASK) -#define POWER_REG_CPU_INT_ENABLE_RESET 1'h0 -#define POWER_REG_WLAN_ISO_DIS_MSB 6 -#define POWER_REG_WLAN_ISO_DIS_LSB 6 -#define POWER_REG_WLAN_ISO_DIS_MASK 'h00000040 -#define POWER_REG_WLAN_ISO_DIS_GET(x) (((x) & POWER_REG_WLAN_ISO_DIS_MASK) >> POWER_REG_WLAN_ISO_DIS_LSB) -#define POWER_REG_WLAN_ISO_DIS_SET(x) (((32'd0 | (x)) << POWER_REG_WLAN_ISO_DIS_LSB) & POWER_REG_WLAN_ISO_DIS_MASK) -#define POWER_REG_WLAN_ISO_DIS_RESET 1'h0 -#define POWER_REG_WLAN_ISO_CNTL_MSB 5 -#define POWER_REG_WLAN_ISO_CNTL_LSB 5 -#define POWER_REG_WLAN_ISO_CNTL_MASK 'h00000020 -#define POWER_REG_WLAN_ISO_CNTL_GET(x) (((x) & POWER_REG_WLAN_ISO_CNTL_MASK) >> POWER_REG_WLAN_ISO_CNTL_LSB) -#define POWER_REG_WLAN_ISO_CNTL_SET(x) (((32'd0 | (x)) << POWER_REG_WLAN_ISO_CNTL_LSB) & POWER_REG_WLAN_ISO_CNTL_MASK) -#define POWER_REG_WLAN_ISO_CNTL_RESET 1'h0 -#define POWER_REG_RADIO_PWD_EN_MSB 4 -#define POWER_REG_RADIO_PWD_EN_LSB 4 -#define POWER_REG_RADIO_PWD_EN_MASK 'h00000010 -#define POWER_REG_RADIO_PWD_EN_GET(x) (((x) & POWER_REG_RADIO_PWD_EN_MASK) >> POWER_REG_RADIO_PWD_EN_LSB) -#define POWER_REG_RADIO_PWD_EN_SET(x) (((32'd0 | (x)) << POWER_REG_RADIO_PWD_EN_LSB) & POWER_REG_RADIO_PWD_EN_MASK) -#define POWER_REG_RADIO_PWD_EN_RESET 1'h0 -#define POWER_REG_SOC_SCALE_EN_MSB 3 -#define POWER_REG_SOC_SCALE_EN_LSB 3 -#define POWER_REG_SOC_SCALE_EN_MASK 'h00000008 -#define POWER_REG_SOC_SCALE_EN_GET(x) (((x) & POWER_REG_SOC_SCALE_EN_MASK) >> POWER_REG_SOC_SCALE_EN_LSB) -#define POWER_REG_SOC_SCALE_EN_SET(x) (((32'd0 | (x)) << POWER_REG_SOC_SCALE_EN_LSB) & POWER_REG_SOC_SCALE_EN_MASK) -#define POWER_REG_SOC_SCALE_EN_RESET 1'h0 -#define POWER_REG_WLAN_SCALE_EN_MSB 2 -#define POWER_REG_WLAN_SCALE_EN_LSB 2 -#define POWER_REG_WLAN_SCALE_EN_MASK 'h00000004 -#define POWER_REG_WLAN_SCALE_EN_GET(x) (((x) & POWER_REG_WLAN_SCALE_EN_MASK) >> POWER_REG_WLAN_SCALE_EN_LSB) -#define POWER_REG_WLAN_SCALE_EN_SET(x) (((32'd0 | (x)) << POWER_REG_WLAN_SCALE_EN_LSB) & POWER_REG_WLAN_SCALE_EN_MASK) -#define POWER_REG_WLAN_SCALE_EN_RESET 1'h0 -#define POWER_REG_WLAN_PWD_EN_MSB 1 -#define POWER_REG_WLAN_PWD_EN_LSB 1 -#define POWER_REG_WLAN_PWD_EN_MASK 'h00000002 -#define POWER_REG_WLAN_PWD_EN_GET(x) (((x) & POWER_REG_WLAN_PWD_EN_MASK) >> POWER_REG_WLAN_PWD_EN_LSB) -#define POWER_REG_WLAN_PWD_EN_SET(x) (((32'd0 | (x)) << POWER_REG_WLAN_PWD_EN_LSB) & POWER_REG_WLAN_PWD_EN_MASK) -#define POWER_REG_WLAN_PWD_EN_RESET 1'h0 -#define POWER_REG_POWER_EN_MSB 0 -#define POWER_REG_POWER_EN_LSB 0 -#define POWER_REG_POWER_EN_MASK 'h00000001 -#define POWER_REG_POWER_EN_GET(x) (((x) & POWER_REG_POWER_EN_MASK) >> POWER_REG_POWER_EN_LSB) -#define POWER_REG_POWER_EN_SET(x) (((32'd0 | (x)) << POWER_REG_POWER_EN_LSB) & POWER_REG_POWER_EN_MASK) -#define POWER_REG_POWER_EN_RESET 1'h0 -#define POWER_REG_RESET (32'h0 | \ - POWER_REG_VLVL_SET(POWER_REG_VLVL_RESET) | \ - POWER_REG_CPU_INT_ENABLE_SET(POWER_REG_CPU_INT_ENABLE_RESET) | \ - POWER_REG_WLAN_ISO_DIS_SET(POWER_REG_WLAN_ISO_DIS_RESET) | \ - POWER_REG_WLAN_ISO_CNTL_SET(POWER_REG_WLAN_ISO_CNTL_RESET) | \ - POWER_REG_RADIO_PWD_EN_SET(POWER_REG_RADIO_PWD_EN_RESET) | \ - POWER_REG_SOC_SCALE_EN_SET(POWER_REG_SOC_SCALE_EN_RESET) | \ - POWER_REG_WLAN_SCALE_EN_SET(POWER_REG_WLAN_SCALE_EN_RESET) | \ - POWER_REG_WLAN_PWD_EN_SET(POWER_REG_WLAN_PWD_EN_RESET) | \ - POWER_REG_POWER_EN_SET(POWER_REG_POWER_EN_RESET)) -#define POWER_REG_HW_MASK (32'h0) -#define POWER_REG_SW_MASK (32'h0 | \ - POWER_REG_VLVL_MASK | \ - POWER_REG_CPU_INT_ENABLE_MASK | \ - POWER_REG_WLAN_ISO_DIS_MASK | \ - POWER_REG_WLAN_ISO_CNTL_MASK | \ - POWER_REG_RADIO_PWD_EN_MASK | \ - POWER_REG_SOC_SCALE_EN_MASK | \ - POWER_REG_WLAN_SCALE_EN_MASK | \ - POWER_REG_WLAN_PWD_EN_MASK | \ - POWER_REG_POWER_EN_MASK) - -#define CORE_CLK_CTRL_ADDRESS 'h00000114 -#define CORE_CLK_CTRL_DIV_MSB 2 -#define CORE_CLK_CTRL_DIV_LSB 0 -#define CORE_CLK_CTRL_DIV_MASK 'h00000007 -#define CORE_CLK_CTRL_DIV_GET(x) (((x) & CORE_CLK_CTRL_DIV_MASK) >> CORE_CLK_CTRL_DIV_LSB) -#define CORE_CLK_CTRL_DIV_SET(x) (((32'd0 | (x)) << CORE_CLK_CTRL_DIV_LSB) & CORE_CLK_CTRL_DIV_MASK) -#define CORE_CLK_CTRL_DIV_RESET 3'h2 -#define CORE_CLK_CTRL_RESET (32'h0 | \ - CORE_CLK_CTRL_DIV_SET(CORE_CLK_CTRL_DIV_RESET)) -#define CORE_CLK_CTRL_HW_MASK (32'h0) -#define CORE_CLK_CTRL_SW_MASK (32'h0 | \ - CORE_CLK_CTRL_DIV_MASK) - -#define SDIO_SETUP_CIRCUIT_ADDRESS 'h00000120 -#define SDIO_SETUP_CIRCUIT_VECTOR_MSB 7 -#define SDIO_SETUP_CIRCUIT_VECTOR_LSB 0 -#define SDIO_SETUP_CIRCUIT_VECTOR_MASK 'h000000ff -#define SDIO_SETUP_CIRCUIT_VECTOR_GET(x) (((x) & SDIO_SETUP_CIRCUIT_VECTOR_MASK) >> SDIO_SETUP_CIRCUIT_VECTOR_LSB) -#define SDIO_SETUP_CIRCUIT_VECTOR_SET(x) (((32'd0 | (x)) << SDIO_SETUP_CIRCUIT_VECTOR_LSB) & SDIO_SETUP_CIRCUIT_VECTOR_MASK) -#define SDIO_SETUP_CIRCUIT_VECTOR_RESET 8'h0 -#define SDIO_SETUP_CIRCUIT_RESET (32'h0 | \ - SDIO_SETUP_CIRCUIT_VECTOR_SET(SDIO_SETUP_CIRCUIT_VECTOR_RESET)) -#define SDIO_SETUP_CIRCUIT_HW_MASK (32'h0 | \ - SDIO_SETUP_CIRCUIT_VECTOR_MASK) -#define SDIO_SETUP_CIRCUIT_SW_MASK (32'h0) - -#define SDIO_SETUP_CONFIG_ADDRESS 'h00000140 -#define SDIO_SETUP_CONFIG_ENABLE_MSB 1 -#define SDIO_SETUP_CONFIG_ENABLE_LSB 1 -#define SDIO_SETUP_CONFIG_ENABLE_MASK 'h00000002 -#define SDIO_SETUP_CONFIG_ENABLE_GET(x) (((x) & SDIO_SETUP_CONFIG_ENABLE_MASK) >> SDIO_SETUP_CONFIG_ENABLE_LSB) -#define SDIO_SETUP_CONFIG_ENABLE_SET(x) (((32'd0 | (x)) << SDIO_SETUP_CONFIG_ENABLE_LSB) & SDIO_SETUP_CONFIG_ENABLE_MASK) -#define SDIO_SETUP_CONFIG_ENABLE_RESET 1'h0 -#define SDIO_SETUP_CONFIG_CLEAR_MSB 0 -#define SDIO_SETUP_CONFIG_CLEAR_LSB 0 -#define SDIO_SETUP_CONFIG_CLEAR_MASK 'h00000001 -#define SDIO_SETUP_CONFIG_CLEAR_GET(x) (((x) & SDIO_SETUP_CONFIG_CLEAR_MASK) >> SDIO_SETUP_CONFIG_CLEAR_LSB) -#define SDIO_SETUP_CONFIG_CLEAR_SET(x) (((32'd0 | (x)) << SDIO_SETUP_CONFIG_CLEAR_LSB) & SDIO_SETUP_CONFIG_CLEAR_MASK) -#define SDIO_SETUP_CONFIG_CLEAR_RESET 1'h1 -#define SDIO_SETUP_CONFIG_RESET (32'h0 | \ - SDIO_SETUP_CONFIG_ENABLE_SET(SDIO_SETUP_CONFIG_ENABLE_RESET) | \ - SDIO_SETUP_CONFIG_CLEAR_SET(SDIO_SETUP_CONFIG_CLEAR_RESET)) -#define SDIO_SETUP_CONFIG_HW_MASK (32'h0) -#define SDIO_SETUP_CONFIG_SW_MASK (32'h0 | \ - SDIO_SETUP_CONFIG_ENABLE_MASK | \ - SDIO_SETUP_CONFIG_CLEAR_MASK) - -#define CPU_SETUP_CONFIG_ADDRESS 'h00000144 -#define CPU_SETUP_CONFIG_ENABLE_MSB 1 -#define CPU_SETUP_CONFIG_ENABLE_LSB 1 -#define CPU_SETUP_CONFIG_ENABLE_MASK 'h00000002 -#define CPU_SETUP_CONFIG_ENABLE_GET(x) (((x) & CPU_SETUP_CONFIG_ENABLE_MASK) >> CPU_SETUP_CONFIG_ENABLE_LSB) -#define CPU_SETUP_CONFIG_ENABLE_SET(x) (((32'd0 | (x)) << CPU_SETUP_CONFIG_ENABLE_LSB) & CPU_SETUP_CONFIG_ENABLE_MASK) -#define CPU_SETUP_CONFIG_ENABLE_RESET 1'h0 -#define CPU_SETUP_CONFIG_CLEAR_MSB 0 -#define CPU_SETUP_CONFIG_CLEAR_LSB 0 -#define CPU_SETUP_CONFIG_CLEAR_MASK 'h00000001 -#define CPU_SETUP_CONFIG_CLEAR_GET(x) (((x) & CPU_SETUP_CONFIG_CLEAR_MASK) >> CPU_SETUP_CONFIG_CLEAR_LSB) -#define CPU_SETUP_CONFIG_CLEAR_SET(x) (((32'd0 | (x)) << CPU_SETUP_CONFIG_CLEAR_LSB) & CPU_SETUP_CONFIG_CLEAR_MASK) -#define CPU_SETUP_CONFIG_CLEAR_RESET 1'h0 -#define CPU_SETUP_CONFIG_RESET (32'h0 | \ - CPU_SETUP_CONFIG_ENABLE_SET(CPU_SETUP_CONFIG_ENABLE_RESET) | \ - CPU_SETUP_CONFIG_CLEAR_SET(CPU_SETUP_CONFIG_CLEAR_RESET)) -#define CPU_SETUP_CONFIG_HW_MASK (32'h0) -#define CPU_SETUP_CONFIG_SW_MASK (32'h0 | \ - CPU_SETUP_CONFIG_ENABLE_MASK | \ - CPU_SETUP_CONFIG_CLEAR_MASK) - -#define CPU_SETUP_CIRCUIT_ADDRESS 'h00000160 -#define CPU_SETUP_CIRCUIT_VECTOR_MSB 7 -#define CPU_SETUP_CIRCUIT_VECTOR_LSB 0 -#define CPU_SETUP_CIRCUIT_VECTOR_MASK 'h000000ff -#define CPU_SETUP_CIRCUIT_VECTOR_GET(x) (((x) & CPU_SETUP_CIRCUIT_VECTOR_MASK) >> CPU_SETUP_CIRCUIT_VECTOR_LSB) -#define CPU_SETUP_CIRCUIT_VECTOR_SET(x) (((32'd0 | (x)) << CPU_SETUP_CIRCUIT_VECTOR_LSB) & CPU_SETUP_CIRCUIT_VECTOR_MASK) -#define CPU_SETUP_CIRCUIT_VECTOR_RESET 8'h0 -#define CPU_SETUP_CIRCUIT_RESET (32'h0 | \ - CPU_SETUP_CIRCUIT_VECTOR_SET(CPU_SETUP_CIRCUIT_VECTOR_RESET)) -#define CPU_SETUP_CIRCUIT_HW_MASK (32'h0 | \ - CPU_SETUP_CIRCUIT_VECTOR_MASK) -#define CPU_SETUP_CIRCUIT_SW_MASK (32'h0) - -#define BB_SETUP_CONFIG_ADDRESS 'h00000180 -#define BB_SETUP_CONFIG_ENABLE_MSB 1 -#define BB_SETUP_CONFIG_ENABLE_LSB 1 -#define BB_SETUP_CONFIG_ENABLE_MASK 'h00000002 -#define BB_SETUP_CONFIG_ENABLE_GET(x) (((x) & BB_SETUP_CONFIG_ENABLE_MASK) >> BB_SETUP_CONFIG_ENABLE_LSB) -#define BB_SETUP_CONFIG_ENABLE_SET(x) (((32'd0 | (x)) << BB_SETUP_CONFIG_ENABLE_LSB) & BB_SETUP_CONFIG_ENABLE_MASK) -#define BB_SETUP_CONFIG_ENABLE_RESET 1'h0 -#define BB_SETUP_CONFIG_CLEAR_MSB 0 -#define BB_SETUP_CONFIG_CLEAR_LSB 0 -#define BB_SETUP_CONFIG_CLEAR_MASK 'h00000001 -#define BB_SETUP_CONFIG_CLEAR_GET(x) (((x) & BB_SETUP_CONFIG_CLEAR_MASK) >> BB_SETUP_CONFIG_CLEAR_LSB) -#define BB_SETUP_CONFIG_CLEAR_SET(x) (((32'd0 | (x)) << BB_SETUP_CONFIG_CLEAR_LSB) & BB_SETUP_CONFIG_CLEAR_MASK) -#define BB_SETUP_CONFIG_CLEAR_RESET 1'h0 -#define BB_SETUP_CONFIG_RESET (32'h0 | \ - BB_SETUP_CONFIG_ENABLE_SET(BB_SETUP_CONFIG_ENABLE_RESET) | \ - BB_SETUP_CONFIG_CLEAR_SET(BB_SETUP_CONFIG_CLEAR_RESET)) -#define BB_SETUP_CONFIG_HW_MASK (32'h0) -#define BB_SETUP_CONFIG_SW_MASK (32'h0 | \ - BB_SETUP_CONFIG_ENABLE_MASK | \ - BB_SETUP_CONFIG_CLEAR_MASK) - -#define BB_SETUP_CIRCUIT_ADDRESS 'h000001a0 -#define BB_SETUP_CIRCUIT_VECTOR_MSB 7 -#define BB_SETUP_CIRCUIT_VECTOR_LSB 0 -#define BB_SETUP_CIRCUIT_VECTOR_MASK 'h000000ff -#define BB_SETUP_CIRCUIT_VECTOR_GET(x) (((x) & BB_SETUP_CIRCUIT_VECTOR_MASK) >> BB_SETUP_CIRCUIT_VECTOR_LSB) -#define BB_SETUP_CIRCUIT_VECTOR_SET(x) (((32'd0 | (x)) << BB_SETUP_CIRCUIT_VECTOR_LSB) & BB_SETUP_CIRCUIT_VECTOR_MASK) -#define BB_SETUP_CIRCUIT_VECTOR_RESET 8'h0 -#define BB_SETUP_CIRCUIT_RESET (32'h0 | \ - BB_SETUP_CIRCUIT_VECTOR_SET(BB_SETUP_CIRCUIT_VECTOR_RESET)) -#define BB_SETUP_CIRCUIT_HW_MASK (32'h0 | \ - BB_SETUP_CIRCUIT_VECTOR_MASK) -#define BB_SETUP_CIRCUIT_SW_MASK (32'h0) - -#define GPIO_WAKEUP_CONTROL_ADDRESS 'h000001c0 -#define GPIO_WAKEUP_CONTROL_ENABLE_MSB 0 -#define GPIO_WAKEUP_CONTROL_ENABLE_LSB 0 -#define GPIO_WAKEUP_CONTROL_ENABLE_MASK 'h00000001 -#define GPIO_WAKEUP_CONTROL_ENABLE_GET(x) (((x) & GPIO_WAKEUP_CONTROL_ENABLE_MASK) >> GPIO_WAKEUP_CONTROL_ENABLE_LSB) -#define GPIO_WAKEUP_CONTROL_ENABLE_SET(x) (((32'd0 | (x)) << GPIO_WAKEUP_CONTROL_ENABLE_LSB) & GPIO_WAKEUP_CONTROL_ENABLE_MASK) -#define GPIO_WAKEUP_CONTROL_ENABLE_RESET 1'h0 -#define GPIO_WAKEUP_CONTROL_RESET (32'h0 | \ - GPIO_WAKEUP_CONTROL_ENABLE_SET(GPIO_WAKEUP_CONTROL_ENABLE_RESET)) -#define GPIO_WAKEUP_CONTROL_HW_MASK (32'h0) -#define GPIO_WAKEUP_CONTROL_SW_MASK (32'h0 | \ - GPIO_WAKEUP_CONTROL_ENABLE_MASK) - -#define RTC_REG_ADDRESS_MSB 8 - -#endif /* _RTC_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rxtxbb_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rxtxbb_reg.h deleted file mode 100644 index 498d78701818..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rxtxbb_reg.h +++ /dev/null @@ -1,278 +0,0 @@ -#ifndef _RXTXBB_REG_REG_H_ -#define _RXTXBB_REG_REG_H_ - -#define RXTXBB_RXTXBB1_ADDRESS 0x00000000 -#define RXTXBB_RXTXBB1_OFFSET 0x00000000 -#define RXTXBB_RXTXBB1_SPARE_MSB 31 -#define RXTXBB_RXTXBB1_SPARE_LSB 19 -#define RXTXBB_RXTXBB1_SPARE_MASK 0xfff80000 -#define RXTXBB_RXTXBB1_SPARE_GET(x) (((x) & RXTXBB_RXTXBB1_SPARE_MASK) >> RXTXBB_RXTXBB1_SPARE_LSB) -#define RXTXBB_RXTXBB1_SPARE_SET(x) (((x) << RXTXBB_RXTXBB1_SPARE_LSB) & RXTXBB_RXTXBB1_SPARE_MASK) -#define RXTXBB_RXTXBB1_FNOTCH_MSB 18 -#define RXTXBB_RXTXBB1_FNOTCH_LSB 17 -#define RXTXBB_RXTXBB1_FNOTCH_MASK 0x00060000 -#define RXTXBB_RXTXBB1_FNOTCH_GET(x) (((x) & RXTXBB_RXTXBB1_FNOTCH_MASK) >> RXTXBB_RXTXBB1_FNOTCH_LSB) -#define RXTXBB_RXTXBB1_FNOTCH_SET(x) (((x) << RXTXBB_RXTXBB1_FNOTCH_LSB) & RXTXBB_RXTXBB1_FNOTCH_MASK) -#define RXTXBB_RXTXBB1_SEL_ATB_MSB 16 -#define RXTXBB_RXTXBB1_SEL_ATB_LSB 9 -#define RXTXBB_RXTXBB1_SEL_ATB_MASK 0x0001fe00 -#define RXTXBB_RXTXBB1_SEL_ATB_GET(x) (((x) & RXTXBB_RXTXBB1_SEL_ATB_MASK) >> RXTXBB_RXTXBB1_SEL_ATB_LSB) -#define RXTXBB_RXTXBB1_SEL_ATB_SET(x) (((x) << RXTXBB_RXTXBB1_SEL_ATB_LSB) & RXTXBB_RXTXBB1_SEL_ATB_MASK) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_LSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MASK 0x00000100 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_GET(x) (((x) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) >> RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_SET(x) (((x) << RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) -#define RXTXBB_RXTXBB1_PDV2I_MSB 7 -#define RXTXBB_RXTXBB1_PDV2I_LSB 7 -#define RXTXBB_RXTXBB1_PDV2I_MASK 0x00000080 -#define RXTXBB_RXTXBB1_PDV2I_GET(x) (((x) & RXTXBB_RXTXBB1_PDV2I_MASK) >> RXTXBB_RXTXBB1_PDV2I_LSB) -#define RXTXBB_RXTXBB1_PDV2I_SET(x) (((x) << RXTXBB_RXTXBB1_PDV2I_LSB) & RXTXBB_RXTXBB1_PDV2I_MASK) -#define RXTXBB_RXTXBB1_PDI2V_MSB 6 -#define RXTXBB_RXTXBB1_PDI2V_LSB 6 -#define RXTXBB_RXTXBB1_PDI2V_MASK 0x00000040 -#define RXTXBB_RXTXBB1_PDI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDI2V_MASK) >> RXTXBB_RXTXBB1_PDI2V_LSB) -#define RXTXBB_RXTXBB1_PDI2V_SET(x) (((x) << RXTXBB_RXTXBB1_PDI2V_LSB) & RXTXBB_RXTXBB1_PDI2V_MASK) -#define RXTXBB_RXTXBB1_PDRXTXBB_MSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_LSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_MASK 0x00000020 -#define RXTXBB_RXTXBB1_PDRXTXBB_GET(x) (((x) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) >> RXTXBB_RXTXBB1_PDRXTXBB_LSB) -#define RXTXBB_RXTXBB1_PDRXTXBB_SET(x) (((x) << RXTXBB_RXTXBB1_PDRXTXBB_LSB) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK 0x00000010 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK 0x00000008 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_LSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MASK 0x00000004 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) >> RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_SET(x) (((x) << RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) -#define RXTXBB_RXTXBB1_PDLOQ_MSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_LSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_MASK 0x00000002 -#define RXTXBB_RXTXBB1_PDLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDLOQ_MASK) >> RXTXBB_RXTXBB1_PDLOQ_LSB) -#define RXTXBB_RXTXBB1_PDLOQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDLOQ_LSB) & RXTXBB_RXTXBB1_PDLOQ_MASK) -#define RXTXBB_RXTXBB1_PDHIQ_MSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_LSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_MASK 0x00000001 -#define RXTXBB_RXTXBB1_PDHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDHIQ_MASK) >> RXTXBB_RXTXBB1_PDHIQ_LSB) -#define RXTXBB_RXTXBB1_PDHIQ_SET(x) (((x) << RXTXBB_RXTXBB1_PDHIQ_LSB) & RXTXBB_RXTXBB1_PDHIQ_MASK) - -#define RXTXBB_RXTXBB2_ADDRESS 0x00000004 -#define RXTXBB_RXTXBB2_OFFSET 0x00000004 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MSB 31 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB 29 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK 0xe0000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_SET(x) (((x) << RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MSB 28 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB 26 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK 0x1c000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_SET(x) (((x) << RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MSB 25 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB 23 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK 0x03800000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_SET(x) (((x) << RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) -#define RXTXBB_RXTXBB2_SPARE_MSB 22 -#define RXTXBB_RXTXBB2_SPARE_LSB 21 -#define RXTXBB_RXTXBB2_SPARE_MASK 0x00600000 -#define RXTXBB_RXTXBB2_SPARE_GET(x) (((x) & RXTXBB_RXTXBB2_SPARE_MASK) >> RXTXBB_RXTXBB2_SPARE_LSB) -#define RXTXBB_RXTXBB2_SPARE_SET(x) (((x) << RXTXBB_RXTXBB2_SPARE_LSB) & RXTXBB_RXTXBB2_SPARE_MASK) -#define RXTXBB_RXTXBB2_SHORTBUFFER_MSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_LSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_MASK 0x00100000 -#define RXTXBB_RXTXBB2_SHORTBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) >> RXTXBB_RXTXBB2_SHORTBUFFER_LSB) -#define RXTXBB_RXTXBB2_SHORTBUFFER_SET(x) (((x) << RXTXBB_RXTXBB2_SHORTBUFFER_LSB) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) -#define RXTXBB_RXTXBB2_SELBUFFER_MSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_LSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_MASK 0x00080000 -#define RXTXBB_RXTXBB2_SELBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SELBUFFER_MASK) >> RXTXBB_RXTXBB2_SELBUFFER_LSB) -#define RXTXBB_RXTXBB2_SELBUFFER_SET(x) (((x) << RXTXBB_RXTXBB2_SELBUFFER_LSB) & RXTXBB_RXTXBB2_SELBUFFER_MASK) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK 0x00040000 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK 0x00020000 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK 0x00010000 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK 0x00008000 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_SET(x) (((x) << RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) -#define RXTXBB_RXTXBB2_CMSEL_MSB 14 -#define RXTXBB_RXTXBB2_CMSEL_LSB 13 -#define RXTXBB_RXTXBB2_CMSEL_MASK 0x00006000 -#define RXTXBB_RXTXBB2_CMSEL_GET(x) (((x) & RXTXBB_RXTXBB2_CMSEL_MASK) >> RXTXBB_RXTXBB2_CMSEL_LSB) -#define RXTXBB_RXTXBB2_CMSEL_SET(x) (((x) << RXTXBB_RXTXBB2_CMSEL_LSB) & RXTXBB_RXTXBB2_CMSEL_MASK) -#define RXTXBB_RXTXBB2_FILTERFC_MSB 12 -#define RXTXBB_RXTXBB2_FILTERFC_LSB 8 -#define RXTXBB_RXTXBB2_FILTERFC_MASK 0x00001f00 -#define RXTXBB_RXTXBB2_FILTERFC_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERFC_MASK) >> RXTXBB_RXTXBB2_FILTERFC_LSB) -#define RXTXBB_RXTXBB2_FILTERFC_SET(x) (((x) << RXTXBB_RXTXBB2_FILTERFC_LSB) & RXTXBB_RXTXBB2_FILTERFC_MASK) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK 0x00000080 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_GET(x) (((x) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) >> RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_SET(x) (((x) << RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK 0x00000040 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) >> RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_SET(x) (((x) << RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK 0x00000020 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK 0x00000010 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK 0x00000008 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK 0x00000004 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK 0x00000002 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_SET(x) (((x) << RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK 0x00000001 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_GET(x) (((x) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) >> RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_SET(x) (((x) << RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) - -#define RXTXBB_RXTXBB3_ADDRESS 0x00000008 -#define RXTXBB_RXTXBB3_OFFSET 0x00000008 -#define RXTXBB_RXTXBB3_SPARE_MSB 31 -#define RXTXBB_RXTXBB3_SPARE_LSB 27 -#define RXTXBB_RXTXBB3_SPARE_MASK 0xf8000000 -#define RXTXBB_RXTXBB3_SPARE_GET(x) (((x) & RXTXBB_RXTXBB3_SPARE_MASK) >> RXTXBB_RXTXBB3_SPARE_LSB) -#define RXTXBB_RXTXBB3_SPARE_SET(x) (((x) << RXTXBB_RXTXBB3_SPARE_LSB) & RXTXBB_RXTXBB3_SPARE_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MSB 26 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB 24 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK 0x07000000 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MSB 23 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB 21 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK 0x00e00000 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MSB 20 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB 18 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK 0x001c0000 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MSB 17 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB 15 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK 0x00038000 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MSB 14 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB 12 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK 0x00007000 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MSB 11 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB 9 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK 0x00000e00 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MSB 8 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB 6 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK 0x000001c0 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MSB 5 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB 3 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK 0x00000038 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) >> RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MSB 2 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB 0 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK 0x00000007 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_SET(x) (((x) << RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) - -#define RXTXBB_RXTXBB4_ADDRESS 0x0000000c -#define RXTXBB_RXTXBB4_OFFSET 0x0000000c -#define RXTXBB_RXTXBB4_SPARE_MSB 31 -#define RXTXBB_RXTXBB4_SPARE_LSB 31 -#define RXTXBB_RXTXBB4_SPARE_MASK 0x80000000 -#define RXTXBB_RXTXBB4_SPARE_GET(x) (((x) & RXTXBB_RXTXBB4_SPARE_MASK) >> RXTXBB_RXTXBB4_SPARE_LSB) -#define RXTXBB_RXTXBB4_SPARE_SET(x) (((x) << RXTXBB_RXTXBB4_SPARE_LSB) & RXTXBB_RXTXBB4_SPARE_MASK) -#define RXTXBB_RXTXBB4_LOCALOFFSET_MSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_LSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_MASK 0x40000000 -#define RXTXBB_RXTXBB4_LOCALOFFSET_GET(x) (((x) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) >> RXTXBB_RXTXBB4_LOCALOFFSET_LSB) -#define RXTXBB_RXTXBB4_LOCALOFFSET_SET(x) (((x) << RXTXBB_RXTXBB4_LOCALOFFSET_LSB) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHII_MSB 29 -#define RXTXBB_RXTXBB4_OFSTCORRHII_LSB 25 -#define RXTXBB_RXTXBB4_OFSTCORRHII_MASK 0x3e000000 -#define RXTXBB_RXTXBB4_OFSTCORRHII_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHII_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHII_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRHII_LSB) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MSB 24 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB 20 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK 0x01f00000 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MSB 19 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_LSB 15 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MASK 0x000f8000 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MSB 14 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB 10 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK 0x00007c00 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MSB 9 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB 5 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK 0x000003e0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MSB 4 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB 0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK 0x0000001f -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_SET(x) (((x) << RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct rxtxbb_reg_reg_s { - volatile unsigned int rxtxbb_rxtxbb1; - volatile unsigned int rxtxbb_rxtxbb2; - volatile unsigned int rxtxbb_rxtxbb3; - volatile unsigned int rxtxbb_rxtxbb4; -} rxtxbb_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _RXTXBB_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rxtxbb_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rxtxbb_reg.vrh deleted file mode 100644 index 0b15458c4635..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/rxtxbb_reg.vrh +++ /dev/null @@ -1,433 +0,0 @@ -#ifndef _RXTXBB_REG_VRH_ -#define _RXTXBB_REG_VRH_ - -#define RXTXBB_RXTXBB1_ADDRESS 'h00000000 -#define RXTXBB_RXTXBB1_SPARE_MSB 31 -#define RXTXBB_RXTXBB1_SPARE_LSB 19 -#define RXTXBB_RXTXBB1_SPARE_MASK 'hfff80000 -#define RXTXBB_RXTXBB1_SPARE_GET(x) (((x) & RXTXBB_RXTXBB1_SPARE_MASK) >> RXTXBB_RXTXBB1_SPARE_LSB) -#define RXTXBB_RXTXBB1_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_SPARE_LSB) & RXTXBB_RXTXBB1_SPARE_MASK) -#define RXTXBB_RXTXBB1_SPARE_RESET 13'h0 -#define RXTXBB_RXTXBB1_FNOTCH_MSB 18 -#define RXTXBB_RXTXBB1_FNOTCH_LSB 17 -#define RXTXBB_RXTXBB1_FNOTCH_MASK 'h00060000 -#define RXTXBB_RXTXBB1_FNOTCH_GET(x) (((x) & RXTXBB_RXTXBB1_FNOTCH_MASK) >> RXTXBB_RXTXBB1_FNOTCH_LSB) -#define RXTXBB_RXTXBB1_FNOTCH_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_FNOTCH_LSB) & RXTXBB_RXTXBB1_FNOTCH_MASK) -#define RXTXBB_RXTXBB1_FNOTCH_RESET 2'h0 -#define RXTXBB_RXTXBB1_SEL_ATB_MSB 16 -#define RXTXBB_RXTXBB1_SEL_ATB_LSB 9 -#define RXTXBB_RXTXBB1_SEL_ATB_MASK 'h0001fe00 -#define RXTXBB_RXTXBB1_SEL_ATB_GET(x) (((x) & RXTXBB_RXTXBB1_SEL_ATB_MASK) >> RXTXBB_RXTXBB1_SEL_ATB_LSB) -#define RXTXBB_RXTXBB1_SEL_ATB_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_SEL_ATB_LSB) & RXTXBB_RXTXBB1_SEL_ATB_MASK) -#define RXTXBB_RXTXBB1_SEL_ATB_RESET 8'h0 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_LSB 8 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_MASK 'h00000100 -#define RXTXBB_RXTXBB1_PDDACINTERFACE_GET(x) (((x) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) >> RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDDACINTERFACE_LSB) & RXTXBB_RXTXBB1_PDDACINTERFACE_MASK) -#define RXTXBB_RXTXBB1_PDDACINTERFACE_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDV2I_MSB 7 -#define RXTXBB_RXTXBB1_PDV2I_LSB 7 -#define RXTXBB_RXTXBB1_PDV2I_MASK 'h00000080 -#define RXTXBB_RXTXBB1_PDV2I_GET(x) (((x) & RXTXBB_RXTXBB1_PDV2I_MASK) >> RXTXBB_RXTXBB1_PDV2I_LSB) -#define RXTXBB_RXTXBB1_PDV2I_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDV2I_LSB) & RXTXBB_RXTXBB1_PDV2I_MASK) -#define RXTXBB_RXTXBB1_PDV2I_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDI2V_MSB 6 -#define RXTXBB_RXTXBB1_PDI2V_LSB 6 -#define RXTXBB_RXTXBB1_PDI2V_MASK 'h00000040 -#define RXTXBB_RXTXBB1_PDI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDI2V_MASK) >> RXTXBB_RXTXBB1_PDI2V_LSB) -#define RXTXBB_RXTXBB1_PDI2V_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDI2V_LSB) & RXTXBB_RXTXBB1_PDI2V_MASK) -#define RXTXBB_RXTXBB1_PDI2V_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDRXTXBB_MSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_LSB 5 -#define RXTXBB_RXTXBB1_PDRXTXBB_MASK 'h00000020 -#define RXTXBB_RXTXBB1_PDRXTXBB_GET(x) (((x) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) >> RXTXBB_RXTXBB1_PDRXTXBB_LSB) -#define RXTXBB_RXTXBB1_PDRXTXBB_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDRXTXBB_LSB) & RXTXBB_RXTXBB1_PDRXTXBB_MASK) -#define RXTXBB_RXTXBB1_PDRXTXBB_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB 4 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK 'h00000010 -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDOFFSETLOQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETLOQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB 3 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK 'h00000008 -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) >> RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDOFFSETHIQ_LSB) & RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETHIQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_LSB 2 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_MASK 'h00000004 -#define RXTXBB_RXTXBB1_PDOFFSETI2V_GET(x) (((x) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) >> RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDOFFSETI2V_LSB) & RXTXBB_RXTXBB1_PDOFFSETI2V_MASK) -#define RXTXBB_RXTXBB1_PDOFFSETI2V_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDLOQ_MSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_LSB 1 -#define RXTXBB_RXTXBB1_PDLOQ_MASK 'h00000002 -#define RXTXBB_RXTXBB1_PDLOQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDLOQ_MASK) >> RXTXBB_RXTXBB1_PDLOQ_LSB) -#define RXTXBB_RXTXBB1_PDLOQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDLOQ_LSB) & RXTXBB_RXTXBB1_PDLOQ_MASK) -#define RXTXBB_RXTXBB1_PDLOQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_PDHIQ_MSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_LSB 0 -#define RXTXBB_RXTXBB1_PDHIQ_MASK 'h00000001 -#define RXTXBB_RXTXBB1_PDHIQ_GET(x) (((x) & RXTXBB_RXTXBB1_PDHIQ_MASK) >> RXTXBB_RXTXBB1_PDHIQ_LSB) -#define RXTXBB_RXTXBB1_PDHIQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB1_PDHIQ_LSB) & RXTXBB_RXTXBB1_PDHIQ_MASK) -#define RXTXBB_RXTXBB1_PDHIQ_RESET 1'h0 -#define RXTXBB_RXTXBB1_RESET (32'h0 | \ - RXTXBB_RXTXBB1_SPARE_SET(RXTXBB_RXTXBB1_SPARE_RESET) | \ - RXTXBB_RXTXBB1_FNOTCH_SET(RXTXBB_RXTXBB1_FNOTCH_RESET) | \ - RXTXBB_RXTXBB1_SEL_ATB_SET(RXTXBB_RXTXBB1_SEL_ATB_RESET) | \ - RXTXBB_RXTXBB1_PDDACINTERFACE_SET(RXTXBB_RXTXBB1_PDDACINTERFACE_RESET) | \ - RXTXBB_RXTXBB1_PDV2I_SET(RXTXBB_RXTXBB1_PDV2I_RESET) | \ - RXTXBB_RXTXBB1_PDI2V_SET(RXTXBB_RXTXBB1_PDI2V_RESET) | \ - RXTXBB_RXTXBB1_PDRXTXBB_SET(RXTXBB_RXTXBB1_PDRXTXBB_RESET) | \ - RXTXBB_RXTXBB1_PDOFFSETLOQ_SET(RXTXBB_RXTXBB1_PDOFFSETLOQ_RESET) | \ - RXTXBB_RXTXBB1_PDOFFSETHIQ_SET(RXTXBB_RXTXBB1_PDOFFSETHIQ_RESET) | \ - RXTXBB_RXTXBB1_PDOFFSETI2V_SET(RXTXBB_RXTXBB1_PDOFFSETI2V_RESET) | \ - RXTXBB_RXTXBB1_PDLOQ_SET(RXTXBB_RXTXBB1_PDLOQ_RESET) | \ - RXTXBB_RXTXBB1_PDHIQ_SET(RXTXBB_RXTXBB1_PDHIQ_RESET)) -#define RXTXBB_RXTXBB1_HW_MASK (32'h0) -#define RXTXBB_RXTXBB1_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB1_SPARE_MASK | \ - RXTXBB_RXTXBB1_FNOTCH_MASK | \ - RXTXBB_RXTXBB1_SEL_ATB_MASK | \ - RXTXBB_RXTXBB1_PDDACINTERFACE_MASK | \ - RXTXBB_RXTXBB1_PDV2I_MASK | \ - RXTXBB_RXTXBB1_PDI2V_MASK | \ - RXTXBB_RXTXBB1_PDRXTXBB_MASK | \ - RXTXBB_RXTXBB1_PDOFFSETLOQ_MASK | \ - RXTXBB_RXTXBB1_PDOFFSETHIQ_MASK | \ - RXTXBB_RXTXBB1_PDOFFSETI2V_MASK | \ - RXTXBB_RXTXBB1_PDLOQ_MASK | \ - RXTXBB_RXTXBB1_PDHIQ_MASK) - -#define RXTXBB_RXTXBB2_ADDRESS 'h00000004 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MSB 31 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB 29 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK 'he0000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_RESET 3'h6 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MSB 28 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB 26 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK 'h1c000000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_RESET 3'h6 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MSB 25 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB 23 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK 'h03800000 -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) >> RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_LSB) & RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK) -#define RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_RESET 3'h6 -#define RXTXBB_RXTXBB2_SPARE_MSB 22 -#define RXTXBB_RXTXBB2_SPARE_LSB 21 -#define RXTXBB_RXTXBB2_SPARE_MASK 'h00600000 -#define RXTXBB_RXTXBB2_SPARE_GET(x) (((x) & RXTXBB_RXTXBB2_SPARE_MASK) >> RXTXBB_RXTXBB2_SPARE_LSB) -#define RXTXBB_RXTXBB2_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SPARE_LSB) & RXTXBB_RXTXBB2_SPARE_MASK) -#define RXTXBB_RXTXBB2_SPARE_RESET 2'h0 -#define RXTXBB_RXTXBB2_SHORTBUFFER_MSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_LSB 20 -#define RXTXBB_RXTXBB2_SHORTBUFFER_MASK 'h00100000 -#define RXTXBB_RXTXBB2_SHORTBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) >> RXTXBB_RXTXBB2_SHORTBUFFER_LSB) -#define RXTXBB_RXTXBB2_SHORTBUFFER_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SHORTBUFFER_LSB) & RXTXBB_RXTXBB2_SHORTBUFFER_MASK) -#define RXTXBB_RXTXBB2_SHORTBUFFER_RESET 1'h0 -#define RXTXBB_RXTXBB2_SELBUFFER_MSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_LSB 19 -#define RXTXBB_RXTXBB2_SELBUFFER_MASK 'h00080000 -#define RXTXBB_RXTXBB2_SELBUFFER_GET(x) (((x) & RXTXBB_RXTXBB2_SELBUFFER_MASK) >> RXTXBB_RXTXBB2_SELBUFFER_LSB) -#define RXTXBB_RXTXBB2_SELBUFFER_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SELBUFFER_LSB) & RXTXBB_RXTXBB2_SELBUFFER_MASK) -#define RXTXBB_RXTXBB2_SELBUFFER_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB 18 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK 'h00040000 -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_DAC_TEST_LSB) & RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_DAC_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB 17 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK 'h00020000 -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_LOQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_LOQ_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB 16 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK 'h00010000 -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_HIQ_TEST_LSB) & RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_HIQ_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB 15 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK 'h00008000 -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_GET(x) (((x) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) >> RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_SEL_I2V_TEST_LSB) & RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK) -#define RXTXBB_RXTXBB2_SEL_I2V_TEST_RESET 1'h0 -#define RXTXBB_RXTXBB2_CMSEL_MSB 14 -#define RXTXBB_RXTXBB2_CMSEL_LSB 13 -#define RXTXBB_RXTXBB2_CMSEL_MASK 'h00006000 -#define RXTXBB_RXTXBB2_CMSEL_GET(x) (((x) & RXTXBB_RXTXBB2_CMSEL_MASK) >> RXTXBB_RXTXBB2_CMSEL_LSB) -#define RXTXBB_RXTXBB2_CMSEL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_CMSEL_LSB) & RXTXBB_RXTXBB2_CMSEL_MASK) -#define RXTXBB_RXTXBB2_CMSEL_RESET 2'h1 -#define RXTXBB_RXTXBB2_FILTERFC_MSB 12 -#define RXTXBB_RXTXBB2_FILTERFC_LSB 8 -#define RXTXBB_RXTXBB2_FILTERFC_MASK 'h00001f00 -#define RXTXBB_RXTXBB2_FILTERFC_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERFC_MASK) >> RXTXBB_RXTXBB2_FILTERFC_LSB) -#define RXTXBB_RXTXBB2_FILTERFC_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_FILTERFC_LSB) & RXTXBB_RXTXBB2_FILTERFC_MASK) -#define RXTXBB_RXTXBB2_FILTERFC_RESET 5'h10 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB 7 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK 'h00000080 -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_GET(x) (((x) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) >> RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_LOCALFILTERTUNING_LSB) & RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK) -#define RXTXBB_RXTXBB2_LOCALFILTERTUNING_RESET 1'h0 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB 6 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK 'h00000040 -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_GET(x) (((x) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) >> RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_FILTERDOUBLEBW_LSB) & RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK) -#define RXTXBB_RXTXBB2_FILTERDOUBLEBW_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB 5 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK 'h00000020 -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH2HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH2HIQ_EN_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB 4 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK 'h00000010 -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH1HIQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1HIQ_EN_RESET 1'h1 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB 3 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK 'h00000008 -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH3LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH3LOQ_EN_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB 2 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK 'h00000004 -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH2LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH2LOQ_EN_RESET 1'h0 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB 1 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK 'h00000002 -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_GET(x) (((x) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) >> RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH1LOQ_EN_LSB) & RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK) -#define RXTXBB_RXTXBB2_PATH1LOQ_EN_RESET 1'h1 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB 0 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK 'h00000001 -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_GET(x) (((x) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) >> RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB2_PATH_OVERRIDE_LSB) & RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) -#define RXTXBB_RXTXBB2_PATH_OVERRIDE_RESET 1'h0 -#define RXTXBB_RXTXBB2_RESET (32'h0 | \ - RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_SET(RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_RESET) | \ - RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_SET(RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_RESET) | \ - RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_SET(RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_RESET) | \ - RXTXBB_RXTXBB2_SPARE_SET(RXTXBB_RXTXBB2_SPARE_RESET) | \ - RXTXBB_RXTXBB2_SHORTBUFFER_SET(RXTXBB_RXTXBB2_SHORTBUFFER_RESET) | \ - RXTXBB_RXTXBB2_SELBUFFER_SET(RXTXBB_RXTXBB2_SELBUFFER_RESET) | \ - RXTXBB_RXTXBB2_SEL_DAC_TEST_SET(RXTXBB_RXTXBB2_SEL_DAC_TEST_RESET) | \ - RXTXBB_RXTXBB2_SEL_LOQ_TEST_SET(RXTXBB_RXTXBB2_SEL_LOQ_TEST_RESET) | \ - RXTXBB_RXTXBB2_SEL_HIQ_TEST_SET(RXTXBB_RXTXBB2_SEL_HIQ_TEST_RESET) | \ - RXTXBB_RXTXBB2_SEL_I2V_TEST_SET(RXTXBB_RXTXBB2_SEL_I2V_TEST_RESET) | \ - RXTXBB_RXTXBB2_CMSEL_SET(RXTXBB_RXTXBB2_CMSEL_RESET) | \ - RXTXBB_RXTXBB2_FILTERFC_SET(RXTXBB_RXTXBB2_FILTERFC_RESET) | \ - RXTXBB_RXTXBB2_LOCALFILTERTUNING_SET(RXTXBB_RXTXBB2_LOCALFILTERTUNING_RESET) | \ - RXTXBB_RXTXBB2_FILTERDOUBLEBW_SET(RXTXBB_RXTXBB2_FILTERDOUBLEBW_RESET) | \ - RXTXBB_RXTXBB2_PATH2HIQ_EN_SET(RXTXBB_RXTXBB2_PATH2HIQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH1HIQ_EN_SET(RXTXBB_RXTXBB2_PATH1HIQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH3LOQ_EN_SET(RXTXBB_RXTXBB2_PATH3LOQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH2LOQ_EN_SET(RXTXBB_RXTXBB2_PATH2LOQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH1LOQ_EN_SET(RXTXBB_RXTXBB2_PATH1LOQ_EN_RESET) | \ - RXTXBB_RXTXBB2_PATH_OVERRIDE_SET(RXTXBB_RXTXBB2_PATH_OVERRIDE_RESET)) -#define RXTXBB_RXTXBB2_HW_MASK (32'h0 | \ - RXTXBB_RXTXBB2_FILTERFC_MASK) -#define RXTXBB_RXTXBB2_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB2_IBN_37P5_OSHI_CTRL_MASK | \ - RXTXBB_RXTXBB2_IBN_37P5_OSLO_CTRL_MASK | \ - RXTXBB_RXTXBB2_IBN_37P5_OSI2V_CTRL_MASK | \ - RXTXBB_RXTXBB2_SPARE_MASK | \ - RXTXBB_RXTXBB2_SHORTBUFFER_MASK | \ - RXTXBB_RXTXBB2_SELBUFFER_MASK | \ - RXTXBB_RXTXBB2_SEL_DAC_TEST_MASK | \ - RXTXBB_RXTXBB2_SEL_LOQ_TEST_MASK | \ - RXTXBB_RXTXBB2_SEL_HIQ_TEST_MASK | \ - RXTXBB_RXTXBB2_SEL_I2V_TEST_MASK | \ - RXTXBB_RXTXBB2_CMSEL_MASK | \ - RXTXBB_RXTXBB2_FILTERFC_MASK | \ - RXTXBB_RXTXBB2_LOCALFILTERTUNING_MASK | \ - RXTXBB_RXTXBB2_FILTERDOUBLEBW_MASK | \ - RXTXBB_RXTXBB2_PATH2HIQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH1HIQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH3LOQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH2LOQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH1LOQ_EN_MASK | \ - RXTXBB_RXTXBB2_PATH_OVERRIDE_MASK) - -#define RXTXBB_RXTXBB3_ADDRESS 'h00000008 -#define RXTXBB_RXTXBB3_SPARE_MSB 31 -#define RXTXBB_RXTXBB3_SPARE_LSB 27 -#define RXTXBB_RXTXBB3_SPARE_MASK 'hf8000000 -#define RXTXBB_RXTXBB3_SPARE_GET(x) (((x) & RXTXBB_RXTXBB3_SPARE_MASK) >> RXTXBB_RXTXBB3_SPARE_LSB) -#define RXTXBB_RXTXBB3_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_SPARE_LSB) & RXTXBB_RXTXBB3_SPARE_MASK) -#define RXTXBB_RXTXBB3_SPARE_RESET 5'h0 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MSB 26 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB 24 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK 'h07000000 -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MSB 23 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB 21 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK 'h00e00000 -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MSB 20 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB 18 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK 'h001c0000 -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MSB 17 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB 15 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK 'h00038000 -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MSB 14 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB 12 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK 'h00007000 -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MSB 11 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB 9 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK 'h00000e00 -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MSB 8 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB 6 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK 'h000001c0 -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MSB 5 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB 3 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK 'h00000038 -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) >> RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_LSB) & RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_RESET 3'h2 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MSB 2 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB 0 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK 'h00000007 -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_GET(x) (((x) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) >> RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_LSB) & RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) -#define RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_RESET 3'h4 -#define RXTXBB_RXTXBB3_RESET (32'h0 | \ - RXTXBB_RXTXBB3_SPARE_SET(RXTXBB_RXTXBB3_SPARE_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_SET(RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_SET(RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_RESET) | \ - RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_SET(RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_RESET)) -#define RXTXBB_RXTXBB3_HW_MASK (32'h0) -#define RXTXBB_RXTXBB3_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB3_SPARE_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_CM_BUFAMP_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_BKV2I_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_I2V_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_HI1_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_HI2_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_LO1_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_25U_LO2_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBRN_12P5_CM_CTRL_MASK | \ - RXTXBB_RXTXBB3_IBN_100U_TEST_CTRL_MASK) - -#define RXTXBB_RXTXBB4_ADDRESS 'h0000000c -#define RXTXBB_RXTXBB4_SPARE_MSB 31 -#define RXTXBB_RXTXBB4_SPARE_LSB 31 -#define RXTXBB_RXTXBB4_SPARE_MASK 'h80000000 -#define RXTXBB_RXTXBB4_SPARE_GET(x) (((x) & RXTXBB_RXTXBB4_SPARE_MASK) >> RXTXBB_RXTXBB4_SPARE_LSB) -#define RXTXBB_RXTXBB4_SPARE_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_SPARE_LSB) & RXTXBB_RXTXBB4_SPARE_MASK) -#define RXTXBB_RXTXBB4_SPARE_RESET 1'h0 -#define RXTXBB_RXTXBB4_LOCALOFFSET_MSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_LSB 30 -#define RXTXBB_RXTXBB4_LOCALOFFSET_MASK 'h40000000 -#define RXTXBB_RXTXBB4_LOCALOFFSET_GET(x) (((x) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) >> RXTXBB_RXTXBB4_LOCALOFFSET_LSB) -#define RXTXBB_RXTXBB4_LOCALOFFSET_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_LOCALOFFSET_LSB) & RXTXBB_RXTXBB4_LOCALOFFSET_MASK) -#define RXTXBB_RXTXBB4_LOCALOFFSET_RESET 1'h0 -#define RXTXBB_RXTXBB4_OFSTCORRHII_MSB 29 -#define RXTXBB_RXTXBB4_OFSTCORRHII_LSB 25 -#define RXTXBB_RXTXBB4_OFSTCORRHII_MASK 'h3e000000 -#define RXTXBB_RXTXBB4_OFSTCORRHII_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHII_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHII_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRHII_LSB) & RXTXBB_RXTXBB4_OFSTCORRHII_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHII_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MSB 24 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB 20 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK 'h01f00000 -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRHIQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRHIQ_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MSB 19 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_LSB 15 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_MASK 'h000f8000 -#define RXTXBB_RXTXBB4_OFSTCORRLOI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRLOI_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOI_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MSB 14 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB 10 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK 'h00007c00 -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRLOQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRLOQ_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MSB 9 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB 5 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK 'h000003e0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRI2VI_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VI_RESET 5'h10 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MSB 4 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB 0 -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK 'h0000001f -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_GET(x) (((x) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) >> RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_SET(x) (((32'd0 | (x)) << RXTXBB_RXTXBB4_OFSTCORRI2VQ_LSB) & RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) -#define RXTXBB_RXTXBB4_OFSTCORRI2VQ_RESET 5'h10 -#define RXTXBB_RXTXBB4_RESET (32'h0 | \ - RXTXBB_RXTXBB4_SPARE_SET(RXTXBB_RXTXBB4_SPARE_RESET) | \ - RXTXBB_RXTXBB4_LOCALOFFSET_SET(RXTXBB_RXTXBB4_LOCALOFFSET_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRHII_SET(RXTXBB_RXTXBB4_OFSTCORRHII_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRHIQ_SET(RXTXBB_RXTXBB4_OFSTCORRHIQ_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRLOI_SET(RXTXBB_RXTXBB4_OFSTCORRLOI_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRLOQ_SET(RXTXBB_RXTXBB4_OFSTCORRLOQ_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRI2VI_SET(RXTXBB_RXTXBB4_OFSTCORRI2VI_RESET) | \ - RXTXBB_RXTXBB4_OFSTCORRI2VQ_SET(RXTXBB_RXTXBB4_OFSTCORRI2VQ_RESET)) -#define RXTXBB_RXTXBB4_HW_MASK (32'h0 | \ - RXTXBB_RXTXBB4_OFSTCORRHII_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) -#define RXTXBB_RXTXBB4_SW_MASK (32'h0 | \ - RXTXBB_RXTXBB4_SPARE_MASK | \ - RXTXBB_RXTXBB4_LOCALOFFSET_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRHII_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRHIQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRLOQ_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VI_MASK | \ - RXTXBB_RXTXBB4_OFSTCORRI2VQ_MASK) - -#define RXTXBB_REG_ADDRESS_MSB 3 - -#endif /* _RXTXBB_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/si_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/si_reg.h deleted file mode 100644 index 16fb99cfd0b8..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/si_reg.h +++ /dev/null @@ -1,186 +0,0 @@ -#ifndef _SI_REG_REG_H_ -#define _SI_REG_REG_H_ - -#define SI_CONFIG_ADDRESS 0x00000000 -#define SI_CONFIG_OFFSET 0x00000000 -#define SI_CONFIG_ERR_INT_MSB 19 -#define SI_CONFIG_ERR_INT_LSB 19 -#define SI_CONFIG_ERR_INT_MASK 0x00080000 -#define SI_CONFIG_ERR_INT_GET(x) (((x) & SI_CONFIG_ERR_INT_MASK) >> SI_CONFIG_ERR_INT_LSB) -#define SI_CONFIG_ERR_INT_SET(x) (((x) << SI_CONFIG_ERR_INT_LSB) & SI_CONFIG_ERR_INT_MASK) -#define SI_CONFIG_BIDIR_OD_DATA_MSB 18 -#define SI_CONFIG_BIDIR_OD_DATA_LSB 18 -#define SI_CONFIG_BIDIR_OD_DATA_MASK 0x00040000 -#define SI_CONFIG_BIDIR_OD_DATA_GET(x) (((x) & SI_CONFIG_BIDIR_OD_DATA_MASK) >> SI_CONFIG_BIDIR_OD_DATA_LSB) -#define SI_CONFIG_BIDIR_OD_DATA_SET(x) (((x) << SI_CONFIG_BIDIR_OD_DATA_LSB) & SI_CONFIG_BIDIR_OD_DATA_MASK) -#define SI_CONFIG_I2C_MSB 16 -#define SI_CONFIG_I2C_LSB 16 -#define SI_CONFIG_I2C_MASK 0x00010000 -#define SI_CONFIG_I2C_GET(x) (((x) & SI_CONFIG_I2C_MASK) >> SI_CONFIG_I2C_LSB) -#define SI_CONFIG_I2C_SET(x) (((x) << SI_CONFIG_I2C_LSB) & SI_CONFIG_I2C_MASK) -#define SI_CONFIG_POS_SAMPLE_MSB 7 -#define SI_CONFIG_POS_SAMPLE_LSB 7 -#define SI_CONFIG_POS_SAMPLE_MASK 0x00000080 -#define SI_CONFIG_POS_SAMPLE_GET(x) (((x) & SI_CONFIG_POS_SAMPLE_MASK) >> SI_CONFIG_POS_SAMPLE_LSB) -#define SI_CONFIG_POS_SAMPLE_SET(x) (((x) << SI_CONFIG_POS_SAMPLE_LSB) & SI_CONFIG_POS_SAMPLE_MASK) -#define SI_CONFIG_POS_DRIVE_MSB 6 -#define SI_CONFIG_POS_DRIVE_LSB 6 -#define SI_CONFIG_POS_DRIVE_MASK 0x00000040 -#define SI_CONFIG_POS_DRIVE_GET(x) (((x) & SI_CONFIG_POS_DRIVE_MASK) >> SI_CONFIG_POS_DRIVE_LSB) -#define SI_CONFIG_POS_DRIVE_SET(x) (((x) << SI_CONFIG_POS_DRIVE_LSB) & SI_CONFIG_POS_DRIVE_MASK) -#define SI_CONFIG_INACTIVE_DATA_MSB 5 -#define SI_CONFIG_INACTIVE_DATA_LSB 5 -#define SI_CONFIG_INACTIVE_DATA_MASK 0x00000020 -#define SI_CONFIG_INACTIVE_DATA_GET(x) (((x) & SI_CONFIG_INACTIVE_DATA_MASK) >> SI_CONFIG_INACTIVE_DATA_LSB) -#define SI_CONFIG_INACTIVE_DATA_SET(x) (((x) << SI_CONFIG_INACTIVE_DATA_LSB) & SI_CONFIG_INACTIVE_DATA_MASK) -#define SI_CONFIG_INACTIVE_CLK_MSB 4 -#define SI_CONFIG_INACTIVE_CLK_LSB 4 -#define SI_CONFIG_INACTIVE_CLK_MASK 0x00000010 -#define SI_CONFIG_INACTIVE_CLK_GET(x) (((x) & SI_CONFIG_INACTIVE_CLK_MASK) >> SI_CONFIG_INACTIVE_CLK_LSB) -#define SI_CONFIG_INACTIVE_CLK_SET(x) (((x) << SI_CONFIG_INACTIVE_CLK_LSB) & SI_CONFIG_INACTIVE_CLK_MASK) -#define SI_CONFIG_DIVIDER_MSB 3 -#define SI_CONFIG_DIVIDER_LSB 0 -#define SI_CONFIG_DIVIDER_MASK 0x0000000f -#define SI_CONFIG_DIVIDER_GET(x) (((x) & SI_CONFIG_DIVIDER_MASK) >> SI_CONFIG_DIVIDER_LSB) -#define SI_CONFIG_DIVIDER_SET(x) (((x) << SI_CONFIG_DIVIDER_LSB) & SI_CONFIG_DIVIDER_MASK) - -#define SI_CS_ADDRESS 0x00000004 -#define SI_CS_OFFSET 0x00000004 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_MSB 13 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_LSB 11 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_MASK 0x00003800 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_GET(x) (((x) & SI_CS_BIT_CNT_IN_LAST_BYTE_MASK) >> SI_CS_BIT_CNT_IN_LAST_BYTE_LSB) -#define SI_CS_BIT_CNT_IN_LAST_BYTE_SET(x) (((x) << SI_CS_BIT_CNT_IN_LAST_BYTE_LSB) & SI_CS_BIT_CNT_IN_LAST_BYTE_MASK) -#define SI_CS_DONE_ERR_MSB 10 -#define SI_CS_DONE_ERR_LSB 10 -#define SI_CS_DONE_ERR_MASK 0x00000400 -#define SI_CS_DONE_ERR_GET(x) (((x) & SI_CS_DONE_ERR_MASK) >> SI_CS_DONE_ERR_LSB) -#define SI_CS_DONE_ERR_SET(x) (((x) << SI_CS_DONE_ERR_LSB) & SI_CS_DONE_ERR_MASK) -#define SI_CS_DONE_INT_MSB 9 -#define SI_CS_DONE_INT_LSB 9 -#define SI_CS_DONE_INT_MASK 0x00000200 -#define SI_CS_DONE_INT_GET(x) (((x) & SI_CS_DONE_INT_MASK) >> SI_CS_DONE_INT_LSB) -#define SI_CS_DONE_INT_SET(x) (((x) << SI_CS_DONE_INT_LSB) & SI_CS_DONE_INT_MASK) -#define SI_CS_START_MSB 8 -#define SI_CS_START_LSB 8 -#define SI_CS_START_MASK 0x00000100 -#define SI_CS_START_GET(x) (((x) & SI_CS_START_MASK) >> SI_CS_START_LSB) -#define SI_CS_START_SET(x) (((x) << SI_CS_START_LSB) & SI_CS_START_MASK) -#define SI_CS_RX_CNT_MSB 7 -#define SI_CS_RX_CNT_LSB 4 -#define SI_CS_RX_CNT_MASK 0x000000f0 -#define SI_CS_RX_CNT_GET(x) (((x) & SI_CS_RX_CNT_MASK) >> SI_CS_RX_CNT_LSB) -#define SI_CS_RX_CNT_SET(x) (((x) << SI_CS_RX_CNT_LSB) & SI_CS_RX_CNT_MASK) -#define SI_CS_TX_CNT_MSB 3 -#define SI_CS_TX_CNT_LSB 0 -#define SI_CS_TX_CNT_MASK 0x0000000f -#define SI_CS_TX_CNT_GET(x) (((x) & SI_CS_TX_CNT_MASK) >> SI_CS_TX_CNT_LSB) -#define SI_CS_TX_CNT_SET(x) (((x) << SI_CS_TX_CNT_LSB) & SI_CS_TX_CNT_MASK) - -#define SI_TX_DATA0_ADDRESS 0x00000008 -#define SI_TX_DATA0_OFFSET 0x00000008 -#define SI_TX_DATA0_DATA3_MSB 31 -#define SI_TX_DATA0_DATA3_LSB 24 -#define SI_TX_DATA0_DATA3_MASK 0xff000000 -#define SI_TX_DATA0_DATA3_GET(x) (((x) & SI_TX_DATA0_DATA3_MASK) >> SI_TX_DATA0_DATA3_LSB) -#define SI_TX_DATA0_DATA3_SET(x) (((x) << SI_TX_DATA0_DATA3_LSB) & SI_TX_DATA0_DATA3_MASK) -#define SI_TX_DATA0_DATA2_MSB 23 -#define SI_TX_DATA0_DATA2_LSB 16 -#define SI_TX_DATA0_DATA2_MASK 0x00ff0000 -#define SI_TX_DATA0_DATA2_GET(x) (((x) & SI_TX_DATA0_DATA2_MASK) >> SI_TX_DATA0_DATA2_LSB) -#define SI_TX_DATA0_DATA2_SET(x) (((x) << SI_TX_DATA0_DATA2_LSB) & SI_TX_DATA0_DATA2_MASK) -#define SI_TX_DATA0_DATA1_MSB 15 -#define SI_TX_DATA0_DATA1_LSB 8 -#define SI_TX_DATA0_DATA1_MASK 0x0000ff00 -#define SI_TX_DATA0_DATA1_GET(x) (((x) & SI_TX_DATA0_DATA1_MASK) >> SI_TX_DATA0_DATA1_LSB) -#define SI_TX_DATA0_DATA1_SET(x) (((x) << SI_TX_DATA0_DATA1_LSB) & SI_TX_DATA0_DATA1_MASK) -#define SI_TX_DATA0_DATA0_MSB 7 -#define SI_TX_DATA0_DATA0_LSB 0 -#define SI_TX_DATA0_DATA0_MASK 0x000000ff -#define SI_TX_DATA0_DATA0_GET(x) (((x) & SI_TX_DATA0_DATA0_MASK) >> SI_TX_DATA0_DATA0_LSB) -#define SI_TX_DATA0_DATA0_SET(x) (((x) << SI_TX_DATA0_DATA0_LSB) & SI_TX_DATA0_DATA0_MASK) - -#define SI_TX_DATA1_ADDRESS 0x0000000c -#define SI_TX_DATA1_OFFSET 0x0000000c -#define SI_TX_DATA1_DATA7_MSB 31 -#define SI_TX_DATA1_DATA7_LSB 24 -#define SI_TX_DATA1_DATA7_MASK 0xff000000 -#define SI_TX_DATA1_DATA7_GET(x) (((x) & SI_TX_DATA1_DATA7_MASK) >> SI_TX_DATA1_DATA7_LSB) -#define SI_TX_DATA1_DATA7_SET(x) (((x) << SI_TX_DATA1_DATA7_LSB) & SI_TX_DATA1_DATA7_MASK) -#define SI_TX_DATA1_DATA6_MSB 23 -#define SI_TX_DATA1_DATA6_LSB 16 -#define SI_TX_DATA1_DATA6_MASK 0x00ff0000 -#define SI_TX_DATA1_DATA6_GET(x) (((x) & SI_TX_DATA1_DATA6_MASK) >> SI_TX_DATA1_DATA6_LSB) -#define SI_TX_DATA1_DATA6_SET(x) (((x) << SI_TX_DATA1_DATA6_LSB) & SI_TX_DATA1_DATA6_MASK) -#define SI_TX_DATA1_DATA5_MSB 15 -#define SI_TX_DATA1_DATA5_LSB 8 -#define SI_TX_DATA1_DATA5_MASK 0x0000ff00 -#define SI_TX_DATA1_DATA5_GET(x) (((x) & SI_TX_DATA1_DATA5_MASK) >> SI_TX_DATA1_DATA5_LSB) -#define SI_TX_DATA1_DATA5_SET(x) (((x) << SI_TX_DATA1_DATA5_LSB) & SI_TX_DATA1_DATA5_MASK) -#define SI_TX_DATA1_DATA4_MSB 7 -#define SI_TX_DATA1_DATA4_LSB 0 -#define SI_TX_DATA1_DATA4_MASK 0x000000ff -#define SI_TX_DATA1_DATA4_GET(x) (((x) & SI_TX_DATA1_DATA4_MASK) >> SI_TX_DATA1_DATA4_LSB) -#define SI_TX_DATA1_DATA4_SET(x) (((x) << SI_TX_DATA1_DATA4_LSB) & SI_TX_DATA1_DATA4_MASK) - -#define SI_RX_DATA0_ADDRESS 0x00000010 -#define SI_RX_DATA0_OFFSET 0x00000010 -#define SI_RX_DATA0_DATA3_MSB 31 -#define SI_RX_DATA0_DATA3_LSB 24 -#define SI_RX_DATA0_DATA3_MASK 0xff000000 -#define SI_RX_DATA0_DATA3_GET(x) (((x) & SI_RX_DATA0_DATA3_MASK) >> SI_RX_DATA0_DATA3_LSB) -#define SI_RX_DATA0_DATA3_SET(x) (((x) << SI_RX_DATA0_DATA3_LSB) & SI_RX_DATA0_DATA3_MASK) -#define SI_RX_DATA0_DATA2_MSB 23 -#define SI_RX_DATA0_DATA2_LSB 16 -#define SI_RX_DATA0_DATA2_MASK 0x00ff0000 -#define SI_RX_DATA0_DATA2_GET(x) (((x) & SI_RX_DATA0_DATA2_MASK) >> SI_RX_DATA0_DATA2_LSB) -#define SI_RX_DATA0_DATA2_SET(x) (((x) << SI_RX_DATA0_DATA2_LSB) & SI_RX_DATA0_DATA2_MASK) -#define SI_RX_DATA0_DATA1_MSB 15 -#define SI_RX_DATA0_DATA1_LSB 8 -#define SI_RX_DATA0_DATA1_MASK 0x0000ff00 -#define SI_RX_DATA0_DATA1_GET(x) (((x) & SI_RX_DATA0_DATA1_MASK) >> SI_RX_DATA0_DATA1_LSB) -#define SI_RX_DATA0_DATA1_SET(x) (((x) << SI_RX_DATA0_DATA1_LSB) & SI_RX_DATA0_DATA1_MASK) -#define SI_RX_DATA0_DATA0_MSB 7 -#define SI_RX_DATA0_DATA0_LSB 0 -#define SI_RX_DATA0_DATA0_MASK 0x000000ff -#define SI_RX_DATA0_DATA0_GET(x) (((x) & SI_RX_DATA0_DATA0_MASK) >> SI_RX_DATA0_DATA0_LSB) -#define SI_RX_DATA0_DATA0_SET(x) (((x) << SI_RX_DATA0_DATA0_LSB) & SI_RX_DATA0_DATA0_MASK) - -#define SI_RX_DATA1_ADDRESS 0x00000014 -#define SI_RX_DATA1_OFFSET 0x00000014 -#define SI_RX_DATA1_DATA7_MSB 31 -#define SI_RX_DATA1_DATA7_LSB 24 -#define SI_RX_DATA1_DATA7_MASK 0xff000000 -#define SI_RX_DATA1_DATA7_GET(x) (((x) & SI_RX_DATA1_DATA7_MASK) >> SI_RX_DATA1_DATA7_LSB) -#define SI_RX_DATA1_DATA7_SET(x) (((x) << SI_RX_DATA1_DATA7_LSB) & SI_RX_DATA1_DATA7_MASK) -#define SI_RX_DATA1_DATA6_MSB 23 -#define SI_RX_DATA1_DATA6_LSB 16 -#define SI_RX_DATA1_DATA6_MASK 0x00ff0000 -#define SI_RX_DATA1_DATA6_GET(x) (((x) & SI_RX_DATA1_DATA6_MASK) >> SI_RX_DATA1_DATA6_LSB) -#define SI_RX_DATA1_DATA6_SET(x) (((x) << SI_RX_DATA1_DATA6_LSB) & SI_RX_DATA1_DATA6_MASK) -#define SI_RX_DATA1_DATA5_MSB 15 -#define SI_RX_DATA1_DATA5_LSB 8 -#define SI_RX_DATA1_DATA5_MASK 0x0000ff00 -#define SI_RX_DATA1_DATA5_GET(x) (((x) & SI_RX_DATA1_DATA5_MASK) >> SI_RX_DATA1_DATA5_LSB) -#define SI_RX_DATA1_DATA5_SET(x) (((x) << SI_RX_DATA1_DATA5_LSB) & SI_RX_DATA1_DATA5_MASK) -#define SI_RX_DATA1_DATA4_MSB 7 -#define SI_RX_DATA1_DATA4_LSB 0 -#define SI_RX_DATA1_DATA4_MASK 0x000000ff -#define SI_RX_DATA1_DATA4_GET(x) (((x) & SI_RX_DATA1_DATA4_MASK) >> SI_RX_DATA1_DATA4_LSB) -#define SI_RX_DATA1_DATA4_SET(x) (((x) << SI_RX_DATA1_DATA4_LSB) & SI_RX_DATA1_DATA4_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct si_reg_reg_s { - volatile unsigned int si_config; - volatile unsigned int si_cs; - volatile unsigned int si_tx_data0; - volatile unsigned int si_tx_data1; - volatile unsigned int si_rx_data0; - volatile unsigned int si_rx_data1; -} si_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _SI_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/si_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/si_reg.vrh deleted file mode 100644 index 10751ad46f80..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/si_reg.vrh +++ /dev/null @@ -1,278 +0,0 @@ -#ifndef _SI_REG_VRH_ -#define _SI_REG_VRH_ - -#define SI_CONFIG_ADDRESS 'h00000000 -#define SI_CONFIG_ERR_INT_MSB 19 -#define SI_CONFIG_ERR_INT_LSB 19 -#define SI_CONFIG_ERR_INT_MASK 'h00080000 -#define SI_CONFIG_ERR_INT_GET(x) (((x) & SI_CONFIG_ERR_INT_MASK) >> SI_CONFIG_ERR_INT_LSB) -#define SI_CONFIG_ERR_INT_SET(x) (((32'd0 | (x)) << SI_CONFIG_ERR_INT_LSB) & SI_CONFIG_ERR_INT_MASK) -#define SI_CONFIG_ERR_INT_RESET 1'h0 -#define SI_CONFIG_BIDIR_OD_DATA_MSB 18 -#define SI_CONFIG_BIDIR_OD_DATA_LSB 18 -#define SI_CONFIG_BIDIR_OD_DATA_MASK 'h00040000 -#define SI_CONFIG_BIDIR_OD_DATA_GET(x) (((x) & SI_CONFIG_BIDIR_OD_DATA_MASK) >> SI_CONFIG_BIDIR_OD_DATA_LSB) -#define SI_CONFIG_BIDIR_OD_DATA_SET(x) (((32'd0 | (x)) << SI_CONFIG_BIDIR_OD_DATA_LSB) & SI_CONFIG_BIDIR_OD_DATA_MASK) -#define SI_CONFIG_BIDIR_OD_DATA_RESET 1'h1 -#define SI_CONFIG_I2C_MSB 16 -#define SI_CONFIG_I2C_LSB 16 -#define SI_CONFIG_I2C_MASK 'h00010000 -#define SI_CONFIG_I2C_GET(x) (((x) & SI_CONFIG_I2C_MASK) >> SI_CONFIG_I2C_LSB) -#define SI_CONFIG_I2C_SET(x) (((32'd0 | (x)) << SI_CONFIG_I2C_LSB) & SI_CONFIG_I2C_MASK) -#define SI_CONFIG_I2C_RESET 1'h1 -#define SI_CONFIG_POS_SAMPLE_MSB 7 -#define SI_CONFIG_POS_SAMPLE_LSB 7 -#define SI_CONFIG_POS_SAMPLE_MASK 'h00000080 -#define SI_CONFIG_POS_SAMPLE_GET(x) (((x) & SI_CONFIG_POS_SAMPLE_MASK) >> SI_CONFIG_POS_SAMPLE_LSB) -#define SI_CONFIG_POS_SAMPLE_SET(x) (((32'd0 | (x)) << SI_CONFIG_POS_SAMPLE_LSB) & SI_CONFIG_POS_SAMPLE_MASK) -#define SI_CONFIG_POS_SAMPLE_RESET 1'h1 -#define SI_CONFIG_POS_DRIVE_MSB 6 -#define SI_CONFIG_POS_DRIVE_LSB 6 -#define SI_CONFIG_POS_DRIVE_MASK 'h00000040 -#define SI_CONFIG_POS_DRIVE_GET(x) (((x) & SI_CONFIG_POS_DRIVE_MASK) >> SI_CONFIG_POS_DRIVE_LSB) -#define SI_CONFIG_POS_DRIVE_SET(x) (((32'd0 | (x)) << SI_CONFIG_POS_DRIVE_LSB) & SI_CONFIG_POS_DRIVE_MASK) -#define SI_CONFIG_POS_DRIVE_RESET 1'h0 -#define SI_CONFIG_INACTIVE_DATA_MSB 5 -#define SI_CONFIG_INACTIVE_DATA_LSB 5 -#define SI_CONFIG_INACTIVE_DATA_MASK 'h00000020 -#define SI_CONFIG_INACTIVE_DATA_GET(x) (((x) & SI_CONFIG_INACTIVE_DATA_MASK) >> SI_CONFIG_INACTIVE_DATA_LSB) -#define SI_CONFIG_INACTIVE_DATA_SET(x) (((32'd0 | (x)) << SI_CONFIG_INACTIVE_DATA_LSB) & SI_CONFIG_INACTIVE_DATA_MASK) -#define SI_CONFIG_INACTIVE_DATA_RESET 1'h1 -#define SI_CONFIG_INACTIVE_CLK_MSB 4 -#define SI_CONFIG_INACTIVE_CLK_LSB 4 -#define SI_CONFIG_INACTIVE_CLK_MASK 'h00000010 -#define SI_CONFIG_INACTIVE_CLK_GET(x) (((x) & SI_CONFIG_INACTIVE_CLK_MASK) >> SI_CONFIG_INACTIVE_CLK_LSB) -#define SI_CONFIG_INACTIVE_CLK_SET(x) (((32'd0 | (x)) << SI_CONFIG_INACTIVE_CLK_LSB) & SI_CONFIG_INACTIVE_CLK_MASK) -#define SI_CONFIG_INACTIVE_CLK_RESET 1'h1 -#define SI_CONFIG_DIVIDER_MSB 3 -#define SI_CONFIG_DIVIDER_LSB 0 -#define SI_CONFIG_DIVIDER_MASK 'h0000000f -#define SI_CONFIG_DIVIDER_GET(x) (((x) & SI_CONFIG_DIVIDER_MASK) >> SI_CONFIG_DIVIDER_LSB) -#define SI_CONFIG_DIVIDER_SET(x) (((32'd0 | (x)) << SI_CONFIG_DIVIDER_LSB) & SI_CONFIG_DIVIDER_MASK) -#define SI_CONFIG_DIVIDER_RESET 4'h0 -#define SI_CONFIG_RESET (32'h0 | \ - SI_CONFIG_ERR_INT_SET(SI_CONFIG_ERR_INT_RESET) | \ - SI_CONFIG_BIDIR_OD_DATA_SET(SI_CONFIG_BIDIR_OD_DATA_RESET) | \ - SI_CONFIG_I2C_SET(SI_CONFIG_I2C_RESET) | \ - SI_CONFIG_POS_SAMPLE_SET(SI_CONFIG_POS_SAMPLE_RESET) | \ - SI_CONFIG_POS_DRIVE_SET(SI_CONFIG_POS_DRIVE_RESET) | \ - SI_CONFIG_INACTIVE_DATA_SET(SI_CONFIG_INACTIVE_DATA_RESET) | \ - SI_CONFIG_INACTIVE_CLK_SET(SI_CONFIG_INACTIVE_CLK_RESET) | \ - SI_CONFIG_DIVIDER_SET(SI_CONFIG_DIVIDER_RESET)) -#define SI_CONFIG_HW_MASK (32'h0) -#define SI_CONFIG_SW_MASK (32'h0 | \ - SI_CONFIG_ERR_INT_MASK | \ - SI_CONFIG_BIDIR_OD_DATA_MASK | \ - SI_CONFIG_I2C_MASK | \ - SI_CONFIG_POS_SAMPLE_MASK | \ - SI_CONFIG_POS_DRIVE_MASK | \ - SI_CONFIG_INACTIVE_DATA_MASK | \ - SI_CONFIG_INACTIVE_CLK_MASK | \ - SI_CONFIG_DIVIDER_MASK) - -#define SI_CS_ADDRESS 'h00000004 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_MSB 13 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_LSB 11 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_MASK 'h00003800 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_GET(x) (((x) & SI_CS_BIT_CNT_IN_LAST_BYTE_MASK) >> SI_CS_BIT_CNT_IN_LAST_BYTE_LSB) -#define SI_CS_BIT_CNT_IN_LAST_BYTE_SET(x) (((32'd0 | (x)) << SI_CS_BIT_CNT_IN_LAST_BYTE_LSB) & SI_CS_BIT_CNT_IN_LAST_BYTE_MASK) -#define SI_CS_BIT_CNT_IN_LAST_BYTE_RESET 3'h0 -#define SI_CS_DONE_ERR_MSB 10 -#define SI_CS_DONE_ERR_LSB 10 -#define SI_CS_DONE_ERR_MASK 'h00000400 -#define SI_CS_DONE_ERR_GET(x) (((x) & SI_CS_DONE_ERR_MASK) >> SI_CS_DONE_ERR_LSB) -#define SI_CS_DONE_ERR_SET(x) (((32'd0 | (x)) << SI_CS_DONE_ERR_LSB) & SI_CS_DONE_ERR_MASK) -#define SI_CS_DONE_ERR_RESET 1'h0 -#define SI_CS_DONE_INT_MSB 9 -#define SI_CS_DONE_INT_LSB 9 -#define SI_CS_DONE_INT_MASK 'h00000200 -#define SI_CS_DONE_INT_GET(x) (((x) & SI_CS_DONE_INT_MASK) >> SI_CS_DONE_INT_LSB) -#define SI_CS_DONE_INT_SET(x) (((32'd0 | (x)) << SI_CS_DONE_INT_LSB) & SI_CS_DONE_INT_MASK) -#define SI_CS_DONE_INT_RESET 1'h0 -#define SI_CS_START_MSB 8 -#define SI_CS_START_LSB 8 -#define SI_CS_START_MASK 'h00000100 -#define SI_CS_START_GET(x) (((x) & SI_CS_START_MASK) >> SI_CS_START_LSB) -#define SI_CS_START_SET(x) (((32'd0 | (x)) << SI_CS_START_LSB) & SI_CS_START_MASK) -#define SI_CS_START_RESET 1'h0 -#define SI_CS_RX_CNT_MSB 7 -#define SI_CS_RX_CNT_LSB 4 -#define SI_CS_RX_CNT_MASK 'h000000f0 -#define SI_CS_RX_CNT_GET(x) (((x) & SI_CS_RX_CNT_MASK) >> SI_CS_RX_CNT_LSB) -#define SI_CS_RX_CNT_SET(x) (((32'd0 | (x)) << SI_CS_RX_CNT_LSB) & SI_CS_RX_CNT_MASK) -#define SI_CS_RX_CNT_RESET 4'h0 -#define SI_CS_TX_CNT_MSB 3 -#define SI_CS_TX_CNT_LSB 0 -#define SI_CS_TX_CNT_MASK 'h0000000f -#define SI_CS_TX_CNT_GET(x) (((x) & SI_CS_TX_CNT_MASK) >> SI_CS_TX_CNT_LSB) -#define SI_CS_TX_CNT_SET(x) (((32'd0 | (x)) << SI_CS_TX_CNT_LSB) & SI_CS_TX_CNT_MASK) -#define SI_CS_TX_CNT_RESET 4'h0 -#define SI_CS_RESET (32'h0 | \ - SI_CS_BIT_CNT_IN_LAST_BYTE_SET(SI_CS_BIT_CNT_IN_LAST_BYTE_RESET) | \ - SI_CS_DONE_ERR_SET(SI_CS_DONE_ERR_RESET) | \ - SI_CS_DONE_INT_SET(SI_CS_DONE_INT_RESET) | \ - SI_CS_START_SET(SI_CS_START_RESET) | \ - SI_CS_RX_CNT_SET(SI_CS_RX_CNT_RESET) | \ - SI_CS_TX_CNT_SET(SI_CS_TX_CNT_RESET)) -#define SI_CS_HW_MASK (32'h0 | \ - SI_CS_DONE_ERR_MASK | \ - SI_CS_DONE_INT_MASK | \ - SI_CS_START_MASK) -#define SI_CS_SW_MASK (32'h0 | \ - SI_CS_BIT_CNT_IN_LAST_BYTE_MASK | \ - SI_CS_DONE_INT_MASK | \ - SI_CS_START_MASK | \ - SI_CS_RX_CNT_MASK | \ - SI_CS_TX_CNT_MASK) - -#define SI_TX_DATA0_ADDRESS 'h00000008 -#define SI_TX_DATA0_DATA3_MSB 31 -#define SI_TX_DATA0_DATA3_LSB 24 -#define SI_TX_DATA0_DATA3_MASK 'hff000000 -#define SI_TX_DATA0_DATA3_GET(x) (((x) & SI_TX_DATA0_DATA3_MASK) >> SI_TX_DATA0_DATA3_LSB) -#define SI_TX_DATA0_DATA3_SET(x) (((32'd0 | (x)) << SI_TX_DATA0_DATA3_LSB) & SI_TX_DATA0_DATA3_MASK) -#define SI_TX_DATA0_DATA3_RESET 8'h0 -#define SI_TX_DATA0_DATA2_MSB 23 -#define SI_TX_DATA0_DATA2_LSB 16 -#define SI_TX_DATA0_DATA2_MASK 'h00ff0000 -#define SI_TX_DATA0_DATA2_GET(x) (((x) & SI_TX_DATA0_DATA2_MASK) >> SI_TX_DATA0_DATA2_LSB) -#define SI_TX_DATA0_DATA2_SET(x) (((32'd0 | (x)) << SI_TX_DATA0_DATA2_LSB) & SI_TX_DATA0_DATA2_MASK) -#define SI_TX_DATA0_DATA2_RESET 8'h0 -#define SI_TX_DATA0_DATA1_MSB 15 -#define SI_TX_DATA0_DATA1_LSB 8 -#define SI_TX_DATA0_DATA1_MASK 'h0000ff00 -#define SI_TX_DATA0_DATA1_GET(x) (((x) & SI_TX_DATA0_DATA1_MASK) >> SI_TX_DATA0_DATA1_LSB) -#define SI_TX_DATA0_DATA1_SET(x) (((32'd0 | (x)) << SI_TX_DATA0_DATA1_LSB) & SI_TX_DATA0_DATA1_MASK) -#define SI_TX_DATA0_DATA1_RESET 8'h0 -#define SI_TX_DATA0_DATA0_MSB 7 -#define SI_TX_DATA0_DATA0_LSB 0 -#define SI_TX_DATA0_DATA0_MASK 'h000000ff -#define SI_TX_DATA0_DATA0_GET(x) (((x) & SI_TX_DATA0_DATA0_MASK) >> SI_TX_DATA0_DATA0_LSB) -#define SI_TX_DATA0_DATA0_SET(x) (((32'd0 | (x)) << SI_TX_DATA0_DATA0_LSB) & SI_TX_DATA0_DATA0_MASK) -#define SI_TX_DATA0_DATA0_RESET 8'h0 -#define SI_TX_DATA0_RESET (32'h0 | \ - SI_TX_DATA0_DATA3_SET(SI_TX_DATA0_DATA3_RESET) | \ - SI_TX_DATA0_DATA2_SET(SI_TX_DATA0_DATA2_RESET) | \ - SI_TX_DATA0_DATA1_SET(SI_TX_DATA0_DATA1_RESET) | \ - SI_TX_DATA0_DATA0_SET(SI_TX_DATA0_DATA0_RESET)) -#define SI_TX_DATA0_HW_MASK (32'h0) -#define SI_TX_DATA0_SW_MASK (32'h0 | \ - SI_TX_DATA0_DATA3_MASK | \ - SI_TX_DATA0_DATA2_MASK | \ - SI_TX_DATA0_DATA1_MASK | \ - SI_TX_DATA0_DATA0_MASK) - -#define SI_TX_DATA1_ADDRESS 'h0000000c -#define SI_TX_DATA1_DATA7_MSB 31 -#define SI_TX_DATA1_DATA7_LSB 24 -#define SI_TX_DATA1_DATA7_MASK 'hff000000 -#define SI_TX_DATA1_DATA7_GET(x) (((x) & SI_TX_DATA1_DATA7_MASK) >> SI_TX_DATA1_DATA7_LSB) -#define SI_TX_DATA1_DATA7_SET(x) (((32'd0 | (x)) << SI_TX_DATA1_DATA7_LSB) & SI_TX_DATA1_DATA7_MASK) -#define SI_TX_DATA1_DATA7_RESET 8'h0 -#define SI_TX_DATA1_DATA6_MSB 23 -#define SI_TX_DATA1_DATA6_LSB 16 -#define SI_TX_DATA1_DATA6_MASK 'h00ff0000 -#define SI_TX_DATA1_DATA6_GET(x) (((x) & SI_TX_DATA1_DATA6_MASK) >> SI_TX_DATA1_DATA6_LSB) -#define SI_TX_DATA1_DATA6_SET(x) (((32'd0 | (x)) << SI_TX_DATA1_DATA6_LSB) & SI_TX_DATA1_DATA6_MASK) -#define SI_TX_DATA1_DATA6_RESET 8'h0 -#define SI_TX_DATA1_DATA5_MSB 15 -#define SI_TX_DATA1_DATA5_LSB 8 -#define SI_TX_DATA1_DATA5_MASK 'h0000ff00 -#define SI_TX_DATA1_DATA5_GET(x) (((x) & SI_TX_DATA1_DATA5_MASK) >> SI_TX_DATA1_DATA5_LSB) -#define SI_TX_DATA1_DATA5_SET(x) (((32'd0 | (x)) << SI_TX_DATA1_DATA5_LSB) & SI_TX_DATA1_DATA5_MASK) -#define SI_TX_DATA1_DATA5_RESET 8'h0 -#define SI_TX_DATA1_DATA4_MSB 7 -#define SI_TX_DATA1_DATA4_LSB 0 -#define SI_TX_DATA1_DATA4_MASK 'h000000ff -#define SI_TX_DATA1_DATA4_GET(x) (((x) & SI_TX_DATA1_DATA4_MASK) >> SI_TX_DATA1_DATA4_LSB) -#define SI_TX_DATA1_DATA4_SET(x) (((32'd0 | (x)) << SI_TX_DATA1_DATA4_LSB) & SI_TX_DATA1_DATA4_MASK) -#define SI_TX_DATA1_DATA4_RESET 8'h0 -#define SI_TX_DATA1_RESET (32'h0 | \ - SI_TX_DATA1_DATA7_SET(SI_TX_DATA1_DATA7_RESET) | \ - SI_TX_DATA1_DATA6_SET(SI_TX_DATA1_DATA6_RESET) | \ - SI_TX_DATA1_DATA5_SET(SI_TX_DATA1_DATA5_RESET) | \ - SI_TX_DATA1_DATA4_SET(SI_TX_DATA1_DATA4_RESET)) -#define SI_TX_DATA1_HW_MASK (32'h0) -#define SI_TX_DATA1_SW_MASK (32'h0 | \ - SI_TX_DATA1_DATA7_MASK | \ - SI_TX_DATA1_DATA6_MASK | \ - SI_TX_DATA1_DATA5_MASK | \ - SI_TX_DATA1_DATA4_MASK) - -#define SI_RX_DATA0_ADDRESS 'h00000010 -#define SI_RX_DATA0_DATA3_MSB 31 -#define SI_RX_DATA0_DATA3_LSB 24 -#define SI_RX_DATA0_DATA3_MASK 'hff000000 -#define SI_RX_DATA0_DATA3_GET(x) (((x) & SI_RX_DATA0_DATA3_MASK) >> SI_RX_DATA0_DATA3_LSB) -#define SI_RX_DATA0_DATA3_SET(x) (((32'd0 | (x)) << SI_RX_DATA0_DATA3_LSB) & SI_RX_DATA0_DATA3_MASK) -#define SI_RX_DATA0_DATA3_RESET 8'h0 -#define SI_RX_DATA0_DATA2_MSB 23 -#define SI_RX_DATA0_DATA2_LSB 16 -#define SI_RX_DATA0_DATA2_MASK 'h00ff0000 -#define SI_RX_DATA0_DATA2_GET(x) (((x) & SI_RX_DATA0_DATA2_MASK) >> SI_RX_DATA0_DATA2_LSB) -#define SI_RX_DATA0_DATA2_SET(x) (((32'd0 | (x)) << SI_RX_DATA0_DATA2_LSB) & SI_RX_DATA0_DATA2_MASK) -#define SI_RX_DATA0_DATA2_RESET 8'h0 -#define SI_RX_DATA0_DATA1_MSB 15 -#define SI_RX_DATA0_DATA1_LSB 8 -#define SI_RX_DATA0_DATA1_MASK 'h0000ff00 -#define SI_RX_DATA0_DATA1_GET(x) (((x) & SI_RX_DATA0_DATA1_MASK) >> SI_RX_DATA0_DATA1_LSB) -#define SI_RX_DATA0_DATA1_SET(x) (((32'd0 | (x)) << SI_RX_DATA0_DATA1_LSB) & SI_RX_DATA0_DATA1_MASK) -#define SI_RX_DATA0_DATA1_RESET 8'h0 -#define SI_RX_DATA0_DATA0_MSB 7 -#define SI_RX_DATA0_DATA0_LSB 0 -#define SI_RX_DATA0_DATA0_MASK 'h000000ff -#define SI_RX_DATA0_DATA0_GET(x) (((x) & SI_RX_DATA0_DATA0_MASK) >> SI_RX_DATA0_DATA0_LSB) -#define SI_RX_DATA0_DATA0_SET(x) (((32'd0 | (x)) << SI_RX_DATA0_DATA0_LSB) & SI_RX_DATA0_DATA0_MASK) -#define SI_RX_DATA0_DATA0_RESET 8'h0 -#define SI_RX_DATA0_RESET (32'h0 | \ - SI_RX_DATA0_DATA3_SET(SI_RX_DATA0_DATA3_RESET) | \ - SI_RX_DATA0_DATA2_SET(SI_RX_DATA0_DATA2_RESET) | \ - SI_RX_DATA0_DATA1_SET(SI_RX_DATA0_DATA1_RESET) | \ - SI_RX_DATA0_DATA0_SET(SI_RX_DATA0_DATA0_RESET)) -#define SI_RX_DATA0_HW_MASK (32'h0 | \ - SI_RX_DATA0_DATA3_MASK | \ - SI_RX_DATA0_DATA2_MASK | \ - SI_RX_DATA0_DATA1_MASK | \ - SI_RX_DATA0_DATA0_MASK) -#define SI_RX_DATA0_SW_MASK (32'h0) - -#define SI_RX_DATA1_ADDRESS 'h00000014 -#define SI_RX_DATA1_DATA7_MSB 31 -#define SI_RX_DATA1_DATA7_LSB 24 -#define SI_RX_DATA1_DATA7_MASK 'hff000000 -#define SI_RX_DATA1_DATA7_GET(x) (((x) & SI_RX_DATA1_DATA7_MASK) >> SI_RX_DATA1_DATA7_LSB) -#define SI_RX_DATA1_DATA7_SET(x) (((32'd0 | (x)) << SI_RX_DATA1_DATA7_LSB) & SI_RX_DATA1_DATA7_MASK) -#define SI_RX_DATA1_DATA7_RESET 8'h0 -#define SI_RX_DATA1_DATA6_MSB 23 -#define SI_RX_DATA1_DATA6_LSB 16 -#define SI_RX_DATA1_DATA6_MASK 'h00ff0000 -#define SI_RX_DATA1_DATA6_GET(x) (((x) & SI_RX_DATA1_DATA6_MASK) >> SI_RX_DATA1_DATA6_LSB) -#define SI_RX_DATA1_DATA6_SET(x) (((32'd0 | (x)) << SI_RX_DATA1_DATA6_LSB) & SI_RX_DATA1_DATA6_MASK) -#define SI_RX_DATA1_DATA6_RESET 8'h0 -#define SI_RX_DATA1_DATA5_MSB 15 -#define SI_RX_DATA1_DATA5_LSB 8 -#define SI_RX_DATA1_DATA5_MASK 'h0000ff00 -#define SI_RX_DATA1_DATA5_GET(x) (((x) & SI_RX_DATA1_DATA5_MASK) >> SI_RX_DATA1_DATA5_LSB) -#define SI_RX_DATA1_DATA5_SET(x) (((32'd0 | (x)) << SI_RX_DATA1_DATA5_LSB) & SI_RX_DATA1_DATA5_MASK) -#define SI_RX_DATA1_DATA5_RESET 8'h0 -#define SI_RX_DATA1_DATA4_MSB 7 -#define SI_RX_DATA1_DATA4_LSB 0 -#define SI_RX_DATA1_DATA4_MASK 'h000000ff -#define SI_RX_DATA1_DATA4_GET(x) (((x) & SI_RX_DATA1_DATA4_MASK) >> SI_RX_DATA1_DATA4_LSB) -#define SI_RX_DATA1_DATA4_SET(x) (((32'd0 | (x)) << SI_RX_DATA1_DATA4_LSB) & SI_RX_DATA1_DATA4_MASK) -#define SI_RX_DATA1_DATA4_RESET 8'h0 -#define SI_RX_DATA1_RESET (32'h0 | \ - SI_RX_DATA1_DATA7_SET(SI_RX_DATA1_DATA7_RESET) | \ - SI_RX_DATA1_DATA6_SET(SI_RX_DATA1_DATA6_RESET) | \ - SI_RX_DATA1_DATA5_SET(SI_RX_DATA1_DATA5_RESET) | \ - SI_RX_DATA1_DATA4_SET(SI_RX_DATA1_DATA4_RESET)) -#define SI_RX_DATA1_HW_MASK (32'h0 | \ - SI_RX_DATA1_DATA7_MASK | \ - SI_RX_DATA1_DATA6_MASK | \ - SI_RX_DATA1_DATA5_MASK | \ - SI_RX_DATA1_DATA4_MASK) -#define SI_RX_DATA1_SW_MASK (32'h0) - -#define SI_REG_ADDRESS_MSB 4 - -#endif /* _SI_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/synth_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/synth_reg.h deleted file mode 100644 index 2cdbc0d86b82..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/synth_reg.h +++ /dev/null @@ -1,599 +0,0 @@ -#ifndef _SYNTH_REG_REG_H_ -#define _SYNTH_REG_REG_H_ - -#define SYNTH_SYNTH1_ADDRESS 0x00000000 -#define SYNTH_SYNTH1_OFFSET 0x00000000 -#define SYNTH_SYNTH1_PWD_BIAS_MSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_LSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_MASK 0x80000000 -#define SYNTH_SYNTH1_PWD_BIAS_GET(x) (((x) & SYNTH_SYNTH1_PWD_BIAS_MASK) >> SYNTH_SYNTH1_PWD_BIAS_LSB) -#define SYNTH_SYNTH1_PWD_BIAS_SET(x) (((x) << SYNTH_SYNTH1_PWD_BIAS_LSB) & SYNTH_SYNTH1_PWD_BIAS_MASK) -#define SYNTH_SYNTH1_PWD_CP_MSB 30 -#define SYNTH_SYNTH1_PWD_CP_LSB 30 -#define SYNTH_SYNTH1_PWD_CP_MASK 0x40000000 -#define SYNTH_SYNTH1_PWD_CP_GET(x) (((x) & SYNTH_SYNTH1_PWD_CP_MASK) >> SYNTH_SYNTH1_PWD_CP_LSB) -#define SYNTH_SYNTH1_PWD_CP_SET(x) (((x) << SYNTH_SYNTH1_PWD_CP_LSB) & SYNTH_SYNTH1_PWD_CP_MASK) -#define SYNTH_SYNTH1_PWD_VCMON_MSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_LSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_MASK 0x20000000 -#define SYNTH_SYNTH1_PWD_VCMON_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCMON_MASK) >> SYNTH_SYNTH1_PWD_VCMON_LSB) -#define SYNTH_SYNTH1_PWD_VCMON_SET(x) (((x) << SYNTH_SYNTH1_PWD_VCMON_LSB) & SYNTH_SYNTH1_PWD_VCMON_MASK) -#define SYNTH_SYNTH1_PWD_VCO_MSB 28 -#define SYNTH_SYNTH1_PWD_VCO_LSB 28 -#define SYNTH_SYNTH1_PWD_VCO_MASK 0x10000000 -#define SYNTH_SYNTH1_PWD_VCO_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCO_MASK) >> SYNTH_SYNTH1_PWD_VCO_LSB) -#define SYNTH_SYNTH1_PWD_VCO_SET(x) (((x) << SYNTH_SYNTH1_PWD_VCO_LSB) & SYNTH_SYNTH1_PWD_VCO_MASK) -#define SYNTH_SYNTH1_PWD_PRESC_MSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_LSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_MASK 0x08000000 -#define SYNTH_SYNTH1_PWD_PRESC_GET(x) (((x) & SYNTH_SYNTH1_PWD_PRESC_MASK) >> SYNTH_SYNTH1_PWD_PRESC_LSB) -#define SYNTH_SYNTH1_PWD_PRESC_SET(x) (((x) << SYNTH_SYNTH1_PWD_PRESC_LSB) & SYNTH_SYNTH1_PWD_PRESC_MASK) -#define SYNTH_SYNTH1_PWD_LODIV_MSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_LSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_MASK 0x04000000 -#define SYNTH_SYNTH1_PWD_LODIV_GET(x) (((x) & SYNTH_SYNTH1_PWD_LODIV_MASK) >> SYNTH_SYNTH1_PWD_LODIV_LSB) -#define SYNTH_SYNTH1_PWD_LODIV_SET(x) (((x) << SYNTH_SYNTH1_PWD_LODIV_LSB) & SYNTH_SYNTH1_PWD_LODIV_MASK) -#define SYNTH_SYNTH1_PWD_LOMIX_MSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_LSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_MASK 0x02000000 -#define SYNTH_SYNTH1_PWD_LOMIX_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOMIX_MASK) >> SYNTH_SYNTH1_PWD_LOMIX_LSB) -#define SYNTH_SYNTH1_PWD_LOMIX_SET(x) (((x) << SYNTH_SYNTH1_PWD_LOMIX_LSB) & SYNTH_SYNTH1_PWD_LOMIX_MASK) -#define SYNTH_SYNTH1_FORCE_LO_ON_MSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_LSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_MASK 0x01000000 -#define SYNTH_SYNTH1_FORCE_LO_ON_GET(x) (((x) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) >> SYNTH_SYNTH1_FORCE_LO_ON_LSB) -#define SYNTH_SYNTH1_FORCE_LO_ON_SET(x) (((x) << SYNTH_SYNTH1_FORCE_LO_ON_LSB) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) -#define SYNTH_SYNTH1_PWD_LOBUF5G_MSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_LSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_MASK 0x00800000 -#define SYNTH_SYNTH1_PWD_LOBUF5G_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) >> SYNTH_SYNTH1_PWD_LOBUF5G_LSB) -#define SYNTH_SYNTH1_PWD_LOBUF5G_SET(x) (((x) << SYNTH_SYNTH1_PWD_LOBUF5G_LSB) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) -#define SYNTH_SYNTH1_VCOREGBYPASS_MSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_LSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_MASK 0x00400000 -#define SYNTH_SYNTH1_VCOREGBYPASS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) >> SYNTH_SYNTH1_VCOREGBYPASS_LSB) -#define SYNTH_SYNTH1_VCOREGBYPASS_SET(x) (((x) << SYNTH_SYNTH1_VCOREGBYPASS_LSB) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) -#define SYNTH_SYNTH1_VCOREGLEVEL_MSB 21 -#define SYNTH_SYNTH1_VCOREGLEVEL_LSB 20 -#define SYNTH_SYNTH1_VCOREGLEVEL_MASK 0x00300000 -#define SYNTH_SYNTH1_VCOREGLEVEL_GET(x) (((x) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) >> SYNTH_SYNTH1_VCOREGLEVEL_LSB) -#define SYNTH_SYNTH1_VCOREGLEVEL_SET(x) (((x) << SYNTH_SYNTH1_VCOREGLEVEL_LSB) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) -#define SYNTH_SYNTH1_VCOREGBIAS_MSB 19 -#define SYNTH_SYNTH1_VCOREGBIAS_LSB 18 -#define SYNTH_SYNTH1_VCOREGBIAS_MASK 0x000c0000 -#define SYNTH_SYNTH1_VCOREGBIAS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBIAS_MASK) >> SYNTH_SYNTH1_VCOREGBIAS_LSB) -#define SYNTH_SYNTH1_VCOREGBIAS_SET(x) (((x) << SYNTH_SYNTH1_VCOREGBIAS_LSB) & SYNTH_SYNTH1_VCOREGBIAS_MASK) -#define SYNTH_SYNTH1_SLIDINGIF_MSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_LSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_MASK 0x00020000 -#define SYNTH_SYNTH1_SLIDINGIF_GET(x) (((x) & SYNTH_SYNTH1_SLIDINGIF_MASK) >> SYNTH_SYNTH1_SLIDINGIF_LSB) -#define SYNTH_SYNTH1_SLIDINGIF_SET(x) (((x) << SYNTH_SYNTH1_SLIDINGIF_LSB) & SYNTH_SYNTH1_SLIDINGIF_MASK) -#define SYNTH_SYNTH1_SPARE_PWD_MSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_LSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_MASK 0x00010000 -#define SYNTH_SYNTH1_SPARE_PWD_GET(x) (((x) & SYNTH_SYNTH1_SPARE_PWD_MASK) >> SYNTH_SYNTH1_SPARE_PWD_LSB) -#define SYNTH_SYNTH1_SPARE_PWD_SET(x) (((x) << SYNTH_SYNTH1_SPARE_PWD_LSB) & SYNTH_SYNTH1_SPARE_PWD_MASK) -#define SYNTH_SYNTH1_CON_VDDVCOREG_MSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_LSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_MASK 0x00008000 -#define SYNTH_SYNTH1_CON_VDDVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) >> SYNTH_SYNTH1_CON_VDDVCOREG_LSB) -#define SYNTH_SYNTH1_CON_VDDVCOREG_SET(x) (((x) << SYNTH_SYNTH1_CON_VDDVCOREG_LSB) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) -#define SYNTH_SYNTH1_CON_IVCOREG_MSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_LSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_MASK 0x00004000 -#define SYNTH_SYNTH1_CON_IVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOREG_MASK) >> SYNTH_SYNTH1_CON_IVCOREG_LSB) -#define SYNTH_SYNTH1_CON_IVCOREG_SET(x) (((x) << SYNTH_SYNTH1_CON_IVCOREG_LSB) & SYNTH_SYNTH1_CON_IVCOREG_MASK) -#define SYNTH_SYNTH1_CON_IVCOBUF_MSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_LSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_MASK 0x00002000 -#define SYNTH_SYNTH1_CON_IVCOBUF_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) >> SYNTH_SYNTH1_CON_IVCOBUF_LSB) -#define SYNTH_SYNTH1_CON_IVCOBUF_SET(x) (((x) << SYNTH_SYNTH1_CON_IVCOBUF_LSB) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) -#define SYNTH_SYNTH1_SEL_VCMONABUS_MSB 12 -#define SYNTH_SYNTH1_SEL_VCMONABUS_LSB 10 -#define SYNTH_SYNTH1_SEL_VCMONABUS_MASK 0x00001c00 -#define SYNTH_SYNTH1_SEL_VCMONABUS_GET(x) (((x) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) >> SYNTH_SYNTH1_SEL_VCMONABUS_LSB) -#define SYNTH_SYNTH1_SEL_VCMONABUS_SET(x) (((x) << SYNTH_SYNTH1_SEL_VCMONABUS_LSB) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK 0x00000200 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) >> SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_LSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MASK 0x00000100 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) >> SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK 0x00000080 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK 0x00000040 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_SET(x) (((x) << SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_MSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_LSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_MASK 0x00000020 -#define SYNTH_SYNTH1_MONITOR_FB_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_MASK) >> SYNTH_SYNTH1_MONITOR_FB_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_FB_LSB) & SYNTH_SYNTH1_MONITOR_FB_MASK) -#define SYNTH_SYNTH1_MONITOR_REF_MSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_LSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_MASK 0x00000010 -#define SYNTH_SYNTH1_MONITOR_REF_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_REF_MASK) >> SYNTH_SYNTH1_MONITOR_REF_LSB) -#define SYNTH_SYNTH1_MONITOR_REF_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_REF_LSB) & SYNTH_SYNTH1_MONITOR_REF_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK 0x00000008 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) >> SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK 0x00000004 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) >> SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_LSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MASK 0x00000002 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) >> SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK 0x00000001 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) >> SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_SET(x) (((x) << SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) - -#define SYNTH_SYNTH2_ADDRESS 0x00000004 -#define SYNTH_SYNTH2_OFFSET 0x00000004 -#define SYNTH_SYNTH2_VC_CAL_REF_MSB 31 -#define SYNTH_SYNTH2_VC_CAL_REF_LSB 29 -#define SYNTH_SYNTH2_VC_CAL_REF_MASK 0xe0000000 -#define SYNTH_SYNTH2_VC_CAL_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_CAL_REF_MASK) >> SYNTH_SYNTH2_VC_CAL_REF_LSB) -#define SYNTH_SYNTH2_VC_CAL_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_CAL_REF_LSB) & SYNTH_SYNTH2_VC_CAL_REF_MASK) -#define SYNTH_SYNTH2_VC_HI_REF_MSB 28 -#define SYNTH_SYNTH2_VC_HI_REF_LSB 26 -#define SYNTH_SYNTH2_VC_HI_REF_MASK 0x1c000000 -#define SYNTH_SYNTH2_VC_HI_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_HI_REF_MASK) >> SYNTH_SYNTH2_VC_HI_REF_LSB) -#define SYNTH_SYNTH2_VC_HI_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_HI_REF_LSB) & SYNTH_SYNTH2_VC_HI_REF_MASK) -#define SYNTH_SYNTH2_VC_MID_REF_MSB 25 -#define SYNTH_SYNTH2_VC_MID_REF_LSB 23 -#define SYNTH_SYNTH2_VC_MID_REF_MASK 0x03800000 -#define SYNTH_SYNTH2_VC_MID_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_MID_REF_MASK) >> SYNTH_SYNTH2_VC_MID_REF_LSB) -#define SYNTH_SYNTH2_VC_MID_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_MID_REF_LSB) & SYNTH_SYNTH2_VC_MID_REF_MASK) -#define SYNTH_SYNTH2_VC_LOW_REF_MSB 22 -#define SYNTH_SYNTH2_VC_LOW_REF_LSB 20 -#define SYNTH_SYNTH2_VC_LOW_REF_MASK 0x00700000 -#define SYNTH_SYNTH2_VC_LOW_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_LOW_REF_MASK) >> SYNTH_SYNTH2_VC_LOW_REF_LSB) -#define SYNTH_SYNTH2_VC_LOW_REF_SET(x) (((x) << SYNTH_SYNTH2_VC_LOW_REF_LSB) & SYNTH_SYNTH2_VC_LOW_REF_MASK) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MSB 19 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB 15 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK 0x000f8000 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_GET(x) (((x) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) >> SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_SET(x) (((x) << SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) -#define SYNTH_SYNTH2_LOOP_CP_MSB 14 -#define SYNTH_SYNTH2_LOOP_CP_LSB 10 -#define SYNTH_SYNTH2_LOOP_CP_MASK 0x00007c00 -#define SYNTH_SYNTH2_LOOP_CP_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CP_MASK) >> SYNTH_SYNTH2_LOOP_CP_LSB) -#define SYNTH_SYNTH2_LOOP_CP_SET(x) (((x) << SYNTH_SYNTH2_LOOP_CP_LSB) & SYNTH_SYNTH2_LOOP_CP_MASK) -#define SYNTH_SYNTH2_LOOP_RS_MSB 9 -#define SYNTH_SYNTH2_LOOP_RS_LSB 5 -#define SYNTH_SYNTH2_LOOP_RS_MASK 0x000003e0 -#define SYNTH_SYNTH2_LOOP_RS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_RS_MASK) >> SYNTH_SYNTH2_LOOP_RS_LSB) -#define SYNTH_SYNTH2_LOOP_RS_SET(x) (((x) << SYNTH_SYNTH2_LOOP_RS_LSB) & SYNTH_SYNTH2_LOOP_RS_MASK) -#define SYNTH_SYNTH2_LOOP_CS_MSB 4 -#define SYNTH_SYNTH2_LOOP_CS_LSB 3 -#define SYNTH_SYNTH2_LOOP_CS_MASK 0x00000018 -#define SYNTH_SYNTH2_LOOP_CS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CS_MASK) >> SYNTH_SYNTH2_LOOP_CS_LSB) -#define SYNTH_SYNTH2_LOOP_CS_SET(x) (((x) << SYNTH_SYNTH2_LOOP_CS_LSB) & SYNTH_SYNTH2_LOOP_CS_MASK) -#define SYNTH_SYNTH2_SPARE_BITS_MSB 2 -#define SYNTH_SYNTH2_SPARE_BITS_LSB 0 -#define SYNTH_SYNTH2_SPARE_BITS_MASK 0x00000007 -#define SYNTH_SYNTH2_SPARE_BITS_GET(x) (((x) & SYNTH_SYNTH2_SPARE_BITS_MASK) >> SYNTH_SYNTH2_SPARE_BITS_LSB) -#define SYNTH_SYNTH2_SPARE_BITS_SET(x) (((x) << SYNTH_SYNTH2_SPARE_BITS_LSB) & SYNTH_SYNTH2_SPARE_BITS_MASK) - -#define SYNTH_SYNTH3_ADDRESS 0x00000008 -#define SYNTH_SYNTH3_OFFSET 0x00000008 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_LSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MASK 0x80000000 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_GET(x) (((x) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) >> SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) -#define SYNTH_SYNTH3_DIS_CLK_XTAL_SET(x) (((x) << SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_LSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MASK 0x40000000 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_GET(x) (((x) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) >> SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_SET(x) (((x) << SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MSB 29 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB 24 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK 0x3f000000 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_SET(x) (((x) << SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_PWRUP_MSB 23 -#define SYNTH_SYNTH3_WAIT_PWRUP_LSB 18 -#define SYNTH_SYNTH3_WAIT_PWRUP_MASK 0x00fc0000 -#define SYNTH_SYNTH3_WAIT_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_PWRUP_SET(x) (((x) << SYNTH_SYNTH3_WAIT_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MSB 17 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_LSB 12 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MASK 0x0003f000 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_SET(x) (((x) << SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MSB 11 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_LSB 6 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MASK 0x00000fc0 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_SET(x) (((x) << SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MSB 5 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_LSB 0 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MASK 0x0000003f -#define SYNTH_SYNTH3_WAIT_VC_CHECK_GET(x) (((x) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) >> SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_SET(x) (((x) << SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) - -#define SYNTH_SYNTH4_ADDRESS 0x0000000c -#define SYNTH_SYNTH4_OFFSET 0x0000000c -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK 0x80000000 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_GET(x) (((x) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) >> SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_SET(x) (((x) << SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) -#define SYNTH_SYNTH4_DIS_LOSTVC_MSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_LSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_MASK 0x40000000 -#define SYNTH_SYNTH4_DIS_LOSTVC_GET(x) (((x) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) >> SYNTH_SYNTH4_DIS_LOSTVC_LSB) -#define SYNTH_SYNTH4_DIS_LOSTVC_SET(x) (((x) << SYNTH_SYNTH4_DIS_LOSTVC_LSB) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_LSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MASK 0x20000000 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_GET(x) (((x) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) >> SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_SET(x) (((x) << SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK 0x10000000 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_GET(x) (((x) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) >> SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_SET(x) (((x) << SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) -#define SYNTH_SYNTH4_FORCE_PINVC_MSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_LSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_MASK 0x08000000 -#define SYNTH_SYNTH4_FORCE_PINVC_GET(x) (((x) & SYNTH_SYNTH4_FORCE_PINVC_MASK) >> SYNTH_SYNTH4_FORCE_PINVC_LSB) -#define SYNTH_SYNTH4_FORCE_PINVC_SET(x) (((x) << SYNTH_SYNTH4_FORCE_PINVC_LSB) & SYNTH_SYNTH4_FORCE_PINVC_MASK) -#define SYNTH_SYNTH4_FORCE_VCOCAP_MSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_LSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_MASK 0x04000000 -#define SYNTH_SYNTH4_FORCE_VCOCAP_GET(x) (((x) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) >> SYNTH_SYNTH4_FORCE_VCOCAP_LSB) -#define SYNTH_SYNTH4_FORCE_VCOCAP_SET(x) (((x) << SYNTH_SYNTH4_FORCE_VCOCAP_LSB) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) -#define SYNTH_SYNTH4_VCOCAP_OVR_MSB 25 -#define SYNTH_SYNTH4_VCOCAP_OVR_LSB 18 -#define SYNTH_SYNTH4_VCOCAP_OVR_MASK 0x03fc0000 -#define SYNTH_SYNTH4_VCOCAP_OVR_GET(x) (((x) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) >> SYNTH_SYNTH4_VCOCAP_OVR_LSB) -#define SYNTH_SYNTH4_VCOCAP_OVR_SET(x) (((x) << SYNTH_SYNTH4_VCOCAP_OVR_LSB) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) -#define SYNTH_SYNTH4_VCOCAPPULLUP_MSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_LSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_MASK 0x00020000 -#define SYNTH_SYNTH4_VCOCAPPULLUP_GET(x) (((x) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) >> SYNTH_SYNTH4_VCOCAPPULLUP_LSB) -#define SYNTH_SYNTH4_VCOCAPPULLUP_SET(x) (((x) << SYNTH_SYNTH4_VCOCAPPULLUP_LSB) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) -#define SYNTH_SYNTH4_REFDIVSEL_MSB 16 -#define SYNTH_SYNTH4_REFDIVSEL_LSB 15 -#define SYNTH_SYNTH4_REFDIVSEL_MASK 0x00018000 -#define SYNTH_SYNTH4_REFDIVSEL_GET(x) (((x) & SYNTH_SYNTH4_REFDIVSEL_MASK) >> SYNTH_SYNTH4_REFDIVSEL_LSB) -#define SYNTH_SYNTH4_REFDIVSEL_SET(x) (((x) << SYNTH_SYNTH4_REFDIVSEL_LSB) & SYNTH_SYNTH4_REFDIVSEL_MASK) -#define SYNTH_SYNTH4_PFDDELAY_MSB 14 -#define SYNTH_SYNTH4_PFDDELAY_LSB 14 -#define SYNTH_SYNTH4_PFDDELAY_MASK 0x00004000 -#define SYNTH_SYNTH4_PFDDELAY_GET(x) (((x) & SYNTH_SYNTH4_PFDDELAY_MASK) >> SYNTH_SYNTH4_PFDDELAY_LSB) -#define SYNTH_SYNTH4_PFDDELAY_SET(x) (((x) << SYNTH_SYNTH4_PFDDELAY_LSB) & SYNTH_SYNTH4_PFDDELAY_MASK) -#define SYNTH_SYNTH4_PFD_DISABLE_MSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_LSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_MASK 0x00002000 -#define SYNTH_SYNTH4_PFD_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_PFD_DISABLE_MASK) >> SYNTH_SYNTH4_PFD_DISABLE_LSB) -#define SYNTH_SYNTH4_PFD_DISABLE_SET(x) (((x) << SYNTH_SYNTH4_PFD_DISABLE_LSB) & SYNTH_SYNTH4_PFD_DISABLE_MASK) -#define SYNTH_SYNTH4_PRESCSEL_MSB 12 -#define SYNTH_SYNTH4_PRESCSEL_LSB 11 -#define SYNTH_SYNTH4_PRESCSEL_MASK 0x00001800 -#define SYNTH_SYNTH4_PRESCSEL_GET(x) (((x) & SYNTH_SYNTH4_PRESCSEL_MASK) >> SYNTH_SYNTH4_PRESCSEL_LSB) -#define SYNTH_SYNTH4_PRESCSEL_SET(x) (((x) << SYNTH_SYNTH4_PRESCSEL_LSB) & SYNTH_SYNTH4_PRESCSEL_MASK) -#define SYNTH_SYNTH4_RESET_PRESC_MSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_LSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_MASK 0x00000400 -#define SYNTH_SYNTH4_RESET_PRESC_GET(x) (((x) & SYNTH_SYNTH4_RESET_PRESC_MASK) >> SYNTH_SYNTH4_RESET_PRESC_LSB) -#define SYNTH_SYNTH4_RESET_PRESC_SET(x) (((x) << SYNTH_SYNTH4_RESET_PRESC_LSB) & SYNTH_SYNTH4_RESET_PRESC_MASK) -#define SYNTH_SYNTH4_SDM_DISABLE_MSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_LSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_MASK 0x00000200 -#define SYNTH_SYNTH4_SDM_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_SDM_DISABLE_MASK) >> SYNTH_SYNTH4_SDM_DISABLE_LSB) -#define SYNTH_SYNTH4_SDM_DISABLE_SET(x) (((x) << SYNTH_SYNTH4_SDM_DISABLE_LSB) & SYNTH_SYNTH4_SDM_DISABLE_MASK) -#define SYNTH_SYNTH4_SDM_MODE_MSB 8 -#define SYNTH_SYNTH4_SDM_MODE_LSB 8 -#define SYNTH_SYNTH4_SDM_MODE_MASK 0x00000100 -#define SYNTH_SYNTH4_SDM_MODE_GET(x) (((x) & SYNTH_SYNTH4_SDM_MODE_MASK) >> SYNTH_SYNTH4_SDM_MODE_LSB) -#define SYNTH_SYNTH4_SDM_MODE_SET(x) (((x) << SYNTH_SYNTH4_SDM_MODE_LSB) & SYNTH_SYNTH4_SDM_MODE_MASK) -#define SYNTH_SYNTH4_SDM_DITHER_MSB 7 -#define SYNTH_SYNTH4_SDM_DITHER_LSB 6 -#define SYNTH_SYNTH4_SDM_DITHER_MASK 0x000000c0 -#define SYNTH_SYNTH4_SDM_DITHER_GET(x) (((x) & SYNTH_SYNTH4_SDM_DITHER_MASK) >> SYNTH_SYNTH4_SDM_DITHER_LSB) -#define SYNTH_SYNTH4_SDM_DITHER_SET(x) (((x) << SYNTH_SYNTH4_SDM_DITHER_LSB) & SYNTH_SYNTH4_SDM_DITHER_MASK) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK 0x00000020 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_GET(x) (((x) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) >> SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_SET(x) (((x) << SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK 0x00000010 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_GET(x) (((x) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) >> SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_SET(x) (((x) << SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) -#define SYNTH_SYNTH4_SPARE_MISC_MSB 3 -#define SYNTH_SYNTH4_SPARE_MISC_LSB 2 -#define SYNTH_SYNTH4_SPARE_MISC_MASK 0x0000000c -#define SYNTH_SYNTH4_SPARE_MISC_GET(x) (((x) & SYNTH_SYNTH4_SPARE_MISC_MASK) >> SYNTH_SYNTH4_SPARE_MISC_LSB) -#define SYNTH_SYNTH4_SPARE_MISC_SET(x) (((x) << SYNTH_SYNTH4_SPARE_MISC_LSB) & SYNTH_SYNTH4_SPARE_MISC_MASK) -#define SYNTH_SYNTH4_LONGSHIFTSEL_MSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_LSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_MASK 0x00000002 -#define SYNTH_SYNTH4_LONGSHIFTSEL_GET(x) (((x) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) >> SYNTH_SYNTH4_LONGSHIFTSEL_LSB) -#define SYNTH_SYNTH4_LONGSHIFTSEL_SET(x) (((x) << SYNTH_SYNTH4_LONGSHIFTSEL_LSB) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_LSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MASK 0x00000001 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_GET(x) (((x) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) >> SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_SET(x) (((x) << SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) - -#define SYNTH_SYNTH5_ADDRESS 0x00000010 -#define SYNTH_SYNTH5_OFFSET 0x00000010 -#define SYNTH_SYNTH5_LOOP_IP0_MSB 31 -#define SYNTH_SYNTH5_LOOP_IP0_LSB 28 -#define SYNTH_SYNTH5_LOOP_IP0_MASK 0xf0000000 -#define SYNTH_SYNTH5_LOOP_IP0_GET(x) (((x) & SYNTH_SYNTH5_LOOP_IP0_MASK) >> SYNTH_SYNTH5_LOOP_IP0_LSB) -#define SYNTH_SYNTH5_LOOP_IP0_SET(x) (((x) << SYNTH_SYNTH5_LOOP_IP0_LSB) & SYNTH_SYNTH5_LOOP_IP0_MASK) -#define SYNTH_SYNTH5_SLOPE_IP_MSB 27 -#define SYNTH_SYNTH5_SLOPE_IP_LSB 25 -#define SYNTH_SYNTH5_SLOPE_IP_MASK 0x0e000000 -#define SYNTH_SYNTH5_SLOPE_IP_GET(x) (((x) & SYNTH_SYNTH5_SLOPE_IP_MASK) >> SYNTH_SYNTH5_SLOPE_IP_LSB) -#define SYNTH_SYNTH5_SLOPE_IP_SET(x) (((x) << SYNTH_SYNTH5_SLOPE_IP_LSB) & SYNTH_SYNTH5_SLOPE_IP_MASK) -#define SYNTH_SYNTH5_CPBIAS_MSB 24 -#define SYNTH_SYNTH5_CPBIAS_LSB 23 -#define SYNTH_SYNTH5_CPBIAS_MASK 0x01800000 -#define SYNTH_SYNTH5_CPBIAS_GET(x) (((x) & SYNTH_SYNTH5_CPBIAS_MASK) >> SYNTH_SYNTH5_CPBIAS_LSB) -#define SYNTH_SYNTH5_CPBIAS_SET(x) (((x) << SYNTH_SYNTH5_CPBIAS_LSB) & SYNTH_SYNTH5_CPBIAS_MASK) -#define SYNTH_SYNTH5_CPSTEERING_EN_MSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_LSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_MASK 0x00400000 -#define SYNTH_SYNTH5_CPSTEERING_EN_GET(x) (((x) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) >> SYNTH_SYNTH5_CPSTEERING_EN_LSB) -#define SYNTH_SYNTH5_CPSTEERING_EN_SET(x) (((x) << SYNTH_SYNTH5_CPSTEERING_EN_LSB) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) -#define SYNTH_SYNTH5_CPLOWLK_MSB 21 -#define SYNTH_SYNTH5_CPLOWLK_LSB 21 -#define SYNTH_SYNTH5_CPLOWLK_MASK 0x00200000 -#define SYNTH_SYNTH5_CPLOWLK_GET(x) (((x) & SYNTH_SYNTH5_CPLOWLK_MASK) >> SYNTH_SYNTH5_CPLOWLK_LSB) -#define SYNTH_SYNTH5_CPLOWLK_SET(x) (((x) << SYNTH_SYNTH5_CPLOWLK_LSB) & SYNTH_SYNTH5_CPLOWLK_MASK) -#define SYNTH_SYNTH5_LOOPLEAKCUR_MSB 20 -#define SYNTH_SYNTH5_LOOPLEAKCUR_LSB 17 -#define SYNTH_SYNTH5_LOOPLEAKCUR_MASK 0x001e0000 -#define SYNTH_SYNTH5_LOOPLEAKCUR_GET(x) (((x) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) >> SYNTH_SYNTH5_LOOPLEAKCUR_LSB) -#define SYNTH_SYNTH5_LOOPLEAKCUR_SET(x) (((x) << SYNTH_SYNTH5_LOOPLEAKCUR_LSB) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) -#define SYNTH_SYNTH5_CAPRANGE1_MSB 16 -#define SYNTH_SYNTH5_CAPRANGE1_LSB 13 -#define SYNTH_SYNTH5_CAPRANGE1_MASK 0x0001e000 -#define SYNTH_SYNTH5_CAPRANGE1_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE1_MASK) >> SYNTH_SYNTH5_CAPRANGE1_LSB) -#define SYNTH_SYNTH5_CAPRANGE1_SET(x) (((x) << SYNTH_SYNTH5_CAPRANGE1_LSB) & SYNTH_SYNTH5_CAPRANGE1_MASK) -#define SYNTH_SYNTH5_CAPRANGE2_MSB 12 -#define SYNTH_SYNTH5_CAPRANGE2_LSB 9 -#define SYNTH_SYNTH5_CAPRANGE2_MASK 0x00001e00 -#define SYNTH_SYNTH5_CAPRANGE2_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE2_MASK) >> SYNTH_SYNTH5_CAPRANGE2_LSB) -#define SYNTH_SYNTH5_CAPRANGE2_SET(x) (((x) << SYNTH_SYNTH5_CAPRANGE2_LSB) & SYNTH_SYNTH5_CAPRANGE2_MASK) -#define SYNTH_SYNTH5_CAPRANGE3_MSB 8 -#define SYNTH_SYNTH5_CAPRANGE3_LSB 5 -#define SYNTH_SYNTH5_CAPRANGE3_MASK 0x000001e0 -#define SYNTH_SYNTH5_CAPRANGE3_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE3_MASK) >> SYNTH_SYNTH5_CAPRANGE3_LSB) -#define SYNTH_SYNTH5_CAPRANGE3_SET(x) (((x) << SYNTH_SYNTH5_CAPRANGE3_LSB) & SYNTH_SYNTH5_CAPRANGE3_MASK) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK 0x00000010 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_SET(x) (((x) << SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MSB 3 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB 2 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK 0x0000000c -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_GET(x) (((x) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) >> SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_SET(x) (((x) << SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) -#define SYNTH_SYNTH5_SPARE_MSB 1 -#define SYNTH_SYNTH5_SPARE_LSB 0 -#define SYNTH_SYNTH5_SPARE_MASK 0x00000003 -#define SYNTH_SYNTH5_SPARE_GET(x) (((x) & SYNTH_SYNTH5_SPARE_MASK) >> SYNTH_SYNTH5_SPARE_LSB) -#define SYNTH_SYNTH5_SPARE_SET(x) (((x) << SYNTH_SYNTH5_SPARE_LSB) & SYNTH_SYNTH5_SPARE_MASK) - -#define SYNTH_SYNTH6_ADDRESS 0x00000014 -#define SYNTH_SYNTH6_OFFSET 0x00000014 -#define SYNTH_SYNTH6_IRCP_MSB 31 -#define SYNTH_SYNTH6_IRCP_LSB 29 -#define SYNTH_SYNTH6_IRCP_MASK 0xe0000000 -#define SYNTH_SYNTH6_IRCP_GET(x) (((x) & SYNTH_SYNTH6_IRCP_MASK) >> SYNTH_SYNTH6_IRCP_LSB) -#define SYNTH_SYNTH6_IRCP_SET(x) (((x) << SYNTH_SYNTH6_IRCP_LSB) & SYNTH_SYNTH6_IRCP_MASK) -#define SYNTH_SYNTH6_IRVCMON_MSB 28 -#define SYNTH_SYNTH6_IRVCMON_LSB 26 -#define SYNTH_SYNTH6_IRVCMON_MASK 0x1c000000 -#define SYNTH_SYNTH6_IRVCMON_GET(x) (((x) & SYNTH_SYNTH6_IRVCMON_MASK) >> SYNTH_SYNTH6_IRVCMON_LSB) -#define SYNTH_SYNTH6_IRVCMON_SET(x) (((x) << SYNTH_SYNTH6_IRVCMON_LSB) & SYNTH_SYNTH6_IRVCMON_MASK) -#define SYNTH_SYNTH6_IRSPARE_MSB 25 -#define SYNTH_SYNTH6_IRSPARE_LSB 23 -#define SYNTH_SYNTH6_IRSPARE_MASK 0x03800000 -#define SYNTH_SYNTH6_IRSPARE_GET(x) (((x) & SYNTH_SYNTH6_IRSPARE_MASK) >> SYNTH_SYNTH6_IRSPARE_LSB) -#define SYNTH_SYNTH6_IRSPARE_SET(x) (((x) << SYNTH_SYNTH6_IRSPARE_LSB) & SYNTH_SYNTH6_IRSPARE_MASK) -#define SYNTH_SYNTH6_ICPRESC_MSB 22 -#define SYNTH_SYNTH6_ICPRESC_LSB 20 -#define SYNTH_SYNTH6_ICPRESC_MASK 0x00700000 -#define SYNTH_SYNTH6_ICPRESC_GET(x) (((x) & SYNTH_SYNTH6_ICPRESC_MASK) >> SYNTH_SYNTH6_ICPRESC_LSB) -#define SYNTH_SYNTH6_ICPRESC_SET(x) (((x) << SYNTH_SYNTH6_ICPRESC_LSB) & SYNTH_SYNTH6_ICPRESC_MASK) -#define SYNTH_SYNTH6_ICLODIV_MSB 19 -#define SYNTH_SYNTH6_ICLODIV_LSB 17 -#define SYNTH_SYNTH6_ICLODIV_MASK 0x000e0000 -#define SYNTH_SYNTH6_ICLODIV_GET(x) (((x) & SYNTH_SYNTH6_ICLODIV_MASK) >> SYNTH_SYNTH6_ICLODIV_LSB) -#define SYNTH_SYNTH6_ICLODIV_SET(x) (((x) << SYNTH_SYNTH6_ICLODIV_LSB) & SYNTH_SYNTH6_ICLODIV_MASK) -#define SYNTH_SYNTH6_ICLOMIX_MSB 16 -#define SYNTH_SYNTH6_ICLOMIX_LSB 14 -#define SYNTH_SYNTH6_ICLOMIX_MASK 0x0001c000 -#define SYNTH_SYNTH6_ICLOMIX_GET(x) (((x) & SYNTH_SYNTH6_ICLOMIX_MASK) >> SYNTH_SYNTH6_ICLOMIX_LSB) -#define SYNTH_SYNTH6_ICLOMIX_SET(x) (((x) << SYNTH_SYNTH6_ICLOMIX_LSB) & SYNTH_SYNTH6_ICLOMIX_MASK) -#define SYNTH_SYNTH6_ICSPAREA_MSB 13 -#define SYNTH_SYNTH6_ICSPAREA_LSB 11 -#define SYNTH_SYNTH6_ICSPAREA_MASK 0x00003800 -#define SYNTH_SYNTH6_ICSPAREA_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREA_MASK) >> SYNTH_SYNTH6_ICSPAREA_LSB) -#define SYNTH_SYNTH6_ICSPAREA_SET(x) (((x) << SYNTH_SYNTH6_ICSPAREA_LSB) & SYNTH_SYNTH6_ICSPAREA_MASK) -#define SYNTH_SYNTH6_ICSPAREB_MSB 10 -#define SYNTH_SYNTH6_ICSPAREB_LSB 8 -#define SYNTH_SYNTH6_ICSPAREB_MASK 0x00000700 -#define SYNTH_SYNTH6_ICSPAREB_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREB_MASK) >> SYNTH_SYNTH6_ICSPAREB_LSB) -#define SYNTH_SYNTH6_ICSPAREB_SET(x) (((x) << SYNTH_SYNTH6_ICSPAREB_LSB) & SYNTH_SYNTH6_ICSPAREB_MASK) -#define SYNTH_SYNTH6_ICVCO_MSB 7 -#define SYNTH_SYNTH6_ICVCO_LSB 5 -#define SYNTH_SYNTH6_ICVCO_MASK 0x000000e0 -#define SYNTH_SYNTH6_ICVCO_GET(x) (((x) & SYNTH_SYNTH6_ICVCO_MASK) >> SYNTH_SYNTH6_ICVCO_LSB) -#define SYNTH_SYNTH6_ICVCO_SET(x) (((x) << SYNTH_SYNTH6_ICVCO_LSB) & SYNTH_SYNTH6_ICVCO_MASK) -#define SYNTH_SYNTH6_VCOBUFBIAS_MSB 4 -#define SYNTH_SYNTH6_VCOBUFBIAS_LSB 3 -#define SYNTH_SYNTH6_VCOBUFBIAS_MASK 0x00000018 -#define SYNTH_SYNTH6_VCOBUFBIAS_GET(x) (((x) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) >> SYNTH_SYNTH6_VCOBUFBIAS_LSB) -#define SYNTH_SYNTH6_VCOBUFBIAS_SET(x) (((x) << SYNTH_SYNTH6_VCOBUFBIAS_LSB) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) -#define SYNTH_SYNTH6_SPARE_BIAS_MSB 2 -#define SYNTH_SYNTH6_SPARE_BIAS_LSB 0 -#define SYNTH_SYNTH6_SPARE_BIAS_MASK 0x00000007 -#define SYNTH_SYNTH6_SPARE_BIAS_GET(x) (((x) & SYNTH_SYNTH6_SPARE_BIAS_MASK) >> SYNTH_SYNTH6_SPARE_BIAS_LSB) -#define SYNTH_SYNTH6_SPARE_BIAS_SET(x) (((x) << SYNTH_SYNTH6_SPARE_BIAS_LSB) & SYNTH_SYNTH6_SPARE_BIAS_MASK) - -#define SYNTH_SYNTH7_ADDRESS 0x00000018 -#define SYNTH_SYNTH7_OFFSET 0x00000018 -#define SYNTH_SYNTH7_SYNTH_ON_MSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_LSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_MASK 0x80000000 -#define SYNTH_SYNTH7_SYNTH_ON_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_ON_MASK) >> SYNTH_SYNTH7_SYNTH_ON_LSB) -#define SYNTH_SYNTH7_SYNTH_ON_SET(x) (((x) << SYNTH_SYNTH7_SYNTH_ON_LSB) & SYNTH_SYNTH7_SYNTH_ON_MASK) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MSB 30 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_LSB 27 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MASK 0x78000000 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) >> SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_SET(x) (((x) << SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) -#define SYNTH_SYNTH7_CAP_SEARCH_MSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_LSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_MASK 0x04000000 -#define SYNTH_SYNTH7_CAP_SEARCH_GET(x) (((x) & SYNTH_SYNTH7_CAP_SEARCH_MASK) >> SYNTH_SYNTH7_CAP_SEARCH_LSB) -#define SYNTH_SYNTH7_CAP_SEARCH_SET(x) (((x) << SYNTH_SYNTH7_CAP_SEARCH_LSB) & SYNTH_SYNTH7_CAP_SEARCH_MASK) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK 0x02000000 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) >> SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_SET(x) (((x) << SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) -#define SYNTH_SYNTH7_PIN_VC_MSB 24 -#define SYNTH_SYNTH7_PIN_VC_LSB 24 -#define SYNTH_SYNTH7_PIN_VC_MASK 0x01000000 -#define SYNTH_SYNTH7_PIN_VC_GET(x) (((x) & SYNTH_SYNTH7_PIN_VC_MASK) >> SYNTH_SYNTH7_PIN_VC_LSB) -#define SYNTH_SYNTH7_PIN_VC_SET(x) (((x) << SYNTH_SYNTH7_PIN_VC_LSB) & SYNTH_SYNTH7_PIN_VC_MASK) -#define SYNTH_SYNTH7_VCO_CAP_ST_MSB 23 -#define SYNTH_SYNTH7_VCO_CAP_ST_LSB 16 -#define SYNTH_SYNTH7_VCO_CAP_ST_MASK 0x00ff0000 -#define SYNTH_SYNTH7_VCO_CAP_ST_GET(x) (((x) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) >> SYNTH_SYNTH7_VCO_CAP_ST_LSB) -#define SYNTH_SYNTH7_VCO_CAP_ST_SET(x) (((x) << SYNTH_SYNTH7_VCO_CAP_ST_LSB) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) -#define SYNTH_SYNTH7_SHORT_R_MSB 15 -#define SYNTH_SYNTH7_SHORT_R_LSB 15 -#define SYNTH_SYNTH7_SHORT_R_MASK 0x00008000 -#define SYNTH_SYNTH7_SHORT_R_GET(x) (((x) & SYNTH_SYNTH7_SHORT_R_MASK) >> SYNTH_SYNTH7_SHORT_R_LSB) -#define SYNTH_SYNTH7_SHORT_R_SET(x) (((x) << SYNTH_SYNTH7_SHORT_R_LSB) & SYNTH_SYNTH7_SHORT_R_MASK) -#define SYNTH_SYNTH7_RESET_RFD_MSB 14 -#define SYNTH_SYNTH7_RESET_RFD_LSB 14 -#define SYNTH_SYNTH7_RESET_RFD_MASK 0x00004000 -#define SYNTH_SYNTH7_RESET_RFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_RFD_MASK) >> SYNTH_SYNTH7_RESET_RFD_LSB) -#define SYNTH_SYNTH7_RESET_RFD_SET(x) (((x) << SYNTH_SYNTH7_RESET_RFD_LSB) & SYNTH_SYNTH7_RESET_RFD_MASK) -#define SYNTH_SYNTH7_RESET_PFD_MSB 13 -#define SYNTH_SYNTH7_RESET_PFD_LSB 13 -#define SYNTH_SYNTH7_RESET_PFD_MASK 0x00002000 -#define SYNTH_SYNTH7_RESET_PFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_PFD_MASK) >> SYNTH_SYNTH7_RESET_PFD_LSB) -#define SYNTH_SYNTH7_RESET_PFD_SET(x) (((x) << SYNTH_SYNTH7_RESET_PFD_LSB) & SYNTH_SYNTH7_RESET_PFD_MASK) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK 0x00001000 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_GET(x) (((x) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) >> SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_SET(x) (((x) << SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) -#define SYNTH_SYNTH7_RESET_SDM_B_MSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_LSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_MASK 0x00000800 -#define SYNTH_SYNTH7_RESET_SDM_B_GET(x) (((x) & SYNTH_SYNTH7_RESET_SDM_B_MASK) >> SYNTH_SYNTH7_RESET_SDM_B_LSB) -#define SYNTH_SYNTH7_RESET_SDM_B_SET(x) (((x) << SYNTH_SYNTH7_RESET_SDM_B_LSB) & SYNTH_SYNTH7_RESET_SDM_B_MASK) -#define SYNTH_SYNTH7_VC2HIGH_MSB 10 -#define SYNTH_SYNTH7_VC2HIGH_LSB 10 -#define SYNTH_SYNTH7_VC2HIGH_MASK 0x00000400 -#define SYNTH_SYNTH7_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH7_VC2HIGH_MASK) >> SYNTH_SYNTH7_VC2HIGH_LSB) -#define SYNTH_SYNTH7_VC2HIGH_SET(x) (((x) << SYNTH_SYNTH7_VC2HIGH_LSB) & SYNTH_SYNTH7_VC2HIGH_MASK) -#define SYNTH_SYNTH7_VC2LOW_MSB 9 -#define SYNTH_SYNTH7_VC2LOW_LSB 9 -#define SYNTH_SYNTH7_VC2LOW_MASK 0x00000200 -#define SYNTH_SYNTH7_VC2LOW_GET(x) (((x) & SYNTH_SYNTH7_VC2LOW_MASK) >> SYNTH_SYNTH7_VC2LOW_LSB) -#define SYNTH_SYNTH7_VC2LOW_SET(x) (((x) << SYNTH_SYNTH7_VC2LOW_LSB) & SYNTH_SYNTH7_VC2LOW_MASK) -#define SYNTH_SYNTH7_LOOP_IP_MSB 8 -#define SYNTH_SYNTH7_LOOP_IP_LSB 5 -#define SYNTH_SYNTH7_LOOP_IP_MASK 0x000001e0 -#define SYNTH_SYNTH7_LOOP_IP_GET(x) (((x) & SYNTH_SYNTH7_LOOP_IP_MASK) >> SYNTH_SYNTH7_LOOP_IP_LSB) -#define SYNTH_SYNTH7_LOOP_IP_SET(x) (((x) << SYNTH_SYNTH7_LOOP_IP_LSB) & SYNTH_SYNTH7_LOOP_IP_MASK) -#define SYNTH_SYNTH7_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH7_LOBUF5GTUNE_LSB 3 -#define SYNTH_SYNTH7_LOBUF5GTUNE_MASK 0x00000018 -#define SYNTH_SYNTH7_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH7_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH7_LOBUF5GTUNE_SET(x) (((x) << SYNTH_SYNTH7_LOBUF5GTUNE_LSB) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH7_SPARE_READ_MSB 2 -#define SYNTH_SYNTH7_SPARE_READ_LSB 0 -#define SYNTH_SYNTH7_SPARE_READ_MASK 0x00000007 -#define SYNTH_SYNTH7_SPARE_READ_GET(x) (((x) & SYNTH_SYNTH7_SPARE_READ_MASK) >> SYNTH_SYNTH7_SPARE_READ_LSB) -#define SYNTH_SYNTH7_SPARE_READ_SET(x) (((x) << SYNTH_SYNTH7_SPARE_READ_LSB) & SYNTH_SYNTH7_SPARE_READ_MASK) - -#define SYNTH_SYNTH8_ADDRESS 0x0000001c -#define SYNTH_SYNTH8_OFFSET 0x0000001c -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK 0x80000000 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_GET(x) (((x) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) >> SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_SET(x) (((x) << SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) -#define SYNTH_SYNTH8_FRACMODE_MSB 30 -#define SYNTH_SYNTH8_FRACMODE_LSB 30 -#define SYNTH_SYNTH8_FRACMODE_MASK 0x40000000 -#define SYNTH_SYNTH8_FRACMODE_GET(x) (((x) & SYNTH_SYNTH8_FRACMODE_MASK) >> SYNTH_SYNTH8_FRACMODE_LSB) -#define SYNTH_SYNTH8_FRACMODE_SET(x) (((x) << SYNTH_SYNTH8_FRACMODE_LSB) & SYNTH_SYNTH8_FRACMODE_MASK) -#define SYNTH_SYNTH8_AMODEREFSEL_MSB 29 -#define SYNTH_SYNTH8_AMODEREFSEL_LSB 28 -#define SYNTH_SYNTH8_AMODEREFSEL_MASK 0x30000000 -#define SYNTH_SYNTH8_AMODEREFSEL_GET(x) (((x) & SYNTH_SYNTH8_AMODEREFSEL_MASK) >> SYNTH_SYNTH8_AMODEREFSEL_LSB) -#define SYNTH_SYNTH8_AMODEREFSEL_SET(x) (((x) << SYNTH_SYNTH8_AMODEREFSEL_LSB) & SYNTH_SYNTH8_AMODEREFSEL_MASK) -#define SYNTH_SYNTH8_SPARE_MSB 27 -#define SYNTH_SYNTH8_SPARE_LSB 27 -#define SYNTH_SYNTH8_SPARE_MASK 0x08000000 -#define SYNTH_SYNTH8_SPARE_GET(x) (((x) & SYNTH_SYNTH8_SPARE_MASK) >> SYNTH_SYNTH8_SPARE_LSB) -#define SYNTH_SYNTH8_SPARE_SET(x) (((x) << SYNTH_SYNTH8_SPARE_LSB) & SYNTH_SYNTH8_SPARE_MASK) -#define SYNTH_SYNTH8_CHANSEL_MSB 26 -#define SYNTH_SYNTH8_CHANSEL_LSB 18 -#define SYNTH_SYNTH8_CHANSEL_MASK 0x07fc0000 -#define SYNTH_SYNTH8_CHANSEL_GET(x) (((x) & SYNTH_SYNTH8_CHANSEL_MASK) >> SYNTH_SYNTH8_CHANSEL_LSB) -#define SYNTH_SYNTH8_CHANSEL_SET(x) (((x) << SYNTH_SYNTH8_CHANSEL_LSB) & SYNTH_SYNTH8_CHANSEL_MASK) -#define SYNTH_SYNTH8_CHANFRAC_MSB 17 -#define SYNTH_SYNTH8_CHANFRAC_LSB 1 -#define SYNTH_SYNTH8_CHANFRAC_MASK 0x0003fffe -#define SYNTH_SYNTH8_CHANFRAC_GET(x) (((x) & SYNTH_SYNTH8_CHANFRAC_MASK) >> SYNTH_SYNTH8_CHANFRAC_LSB) -#define SYNTH_SYNTH8_CHANFRAC_SET(x) (((x) << SYNTH_SYNTH8_CHANFRAC_LSB) & SYNTH_SYNTH8_CHANFRAC_MASK) -#define SYNTH_SYNTH8_FORCE_FRACLSB_MSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_LSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_MASK 0x00000001 -#define SYNTH_SYNTH8_FORCE_FRACLSB_GET(x) (((x) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) >> SYNTH_SYNTH8_FORCE_FRACLSB_LSB) -#define SYNTH_SYNTH8_FORCE_FRACLSB_SET(x) (((x) << SYNTH_SYNTH8_FORCE_FRACLSB_LSB) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct synth_reg_reg_s { - volatile unsigned int synth_synth1; - volatile unsigned int synth_synth2; - volatile unsigned int synth_synth3; - volatile unsigned int synth_synth4; - volatile unsigned int synth_synth5; - volatile unsigned int synth_synth6; - volatile unsigned int synth_synth7; - volatile unsigned int synth_synth8; -} synth_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _SYNTH_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/synth_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/synth_reg.vrh deleted file mode 100644 index 306c6471becb..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/synth_reg.vrh +++ /dev/null @@ -1,939 +0,0 @@ -#ifndef _SYNTH_REG_VRH_ -#define _SYNTH_REG_VRH_ - -#define SYNTH_SYNTH1_ADDRESS 'h00000000 -#define SYNTH_SYNTH1_PWD_BIAS_MSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_LSB 31 -#define SYNTH_SYNTH1_PWD_BIAS_MASK 'h80000000 -#define SYNTH_SYNTH1_PWD_BIAS_GET(x) (((x) & SYNTH_SYNTH1_PWD_BIAS_MASK) >> SYNTH_SYNTH1_PWD_BIAS_LSB) -#define SYNTH_SYNTH1_PWD_BIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_BIAS_LSB) & SYNTH_SYNTH1_PWD_BIAS_MASK) -#define SYNTH_SYNTH1_PWD_BIAS_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_CP_MSB 30 -#define SYNTH_SYNTH1_PWD_CP_LSB 30 -#define SYNTH_SYNTH1_PWD_CP_MASK 'h40000000 -#define SYNTH_SYNTH1_PWD_CP_GET(x) (((x) & SYNTH_SYNTH1_PWD_CP_MASK) >> SYNTH_SYNTH1_PWD_CP_LSB) -#define SYNTH_SYNTH1_PWD_CP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_CP_LSB) & SYNTH_SYNTH1_PWD_CP_MASK) -#define SYNTH_SYNTH1_PWD_CP_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_VCMON_MSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_LSB 29 -#define SYNTH_SYNTH1_PWD_VCMON_MASK 'h20000000 -#define SYNTH_SYNTH1_PWD_VCMON_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCMON_MASK) >> SYNTH_SYNTH1_PWD_VCMON_LSB) -#define SYNTH_SYNTH1_PWD_VCMON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_VCMON_LSB) & SYNTH_SYNTH1_PWD_VCMON_MASK) -#define SYNTH_SYNTH1_PWD_VCMON_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_VCO_MSB 28 -#define SYNTH_SYNTH1_PWD_VCO_LSB 28 -#define SYNTH_SYNTH1_PWD_VCO_MASK 'h10000000 -#define SYNTH_SYNTH1_PWD_VCO_GET(x) (((x) & SYNTH_SYNTH1_PWD_VCO_MASK) >> SYNTH_SYNTH1_PWD_VCO_LSB) -#define SYNTH_SYNTH1_PWD_VCO_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_VCO_LSB) & SYNTH_SYNTH1_PWD_VCO_MASK) -#define SYNTH_SYNTH1_PWD_VCO_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_PRESC_MSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_LSB 27 -#define SYNTH_SYNTH1_PWD_PRESC_MASK 'h08000000 -#define SYNTH_SYNTH1_PWD_PRESC_GET(x) (((x) & SYNTH_SYNTH1_PWD_PRESC_MASK) >> SYNTH_SYNTH1_PWD_PRESC_LSB) -#define SYNTH_SYNTH1_PWD_PRESC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_PRESC_LSB) & SYNTH_SYNTH1_PWD_PRESC_MASK) -#define SYNTH_SYNTH1_PWD_PRESC_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_LODIV_MSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_LSB 26 -#define SYNTH_SYNTH1_PWD_LODIV_MASK 'h04000000 -#define SYNTH_SYNTH1_PWD_LODIV_GET(x) (((x) & SYNTH_SYNTH1_PWD_LODIV_MASK) >> SYNTH_SYNTH1_PWD_LODIV_LSB) -#define SYNTH_SYNTH1_PWD_LODIV_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_LODIV_LSB) & SYNTH_SYNTH1_PWD_LODIV_MASK) -#define SYNTH_SYNTH1_PWD_LODIV_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_LOMIX_MSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_LSB 25 -#define SYNTH_SYNTH1_PWD_LOMIX_MASK 'h02000000 -#define SYNTH_SYNTH1_PWD_LOMIX_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOMIX_MASK) >> SYNTH_SYNTH1_PWD_LOMIX_LSB) -#define SYNTH_SYNTH1_PWD_LOMIX_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_LOMIX_LSB) & SYNTH_SYNTH1_PWD_LOMIX_MASK) -#define SYNTH_SYNTH1_PWD_LOMIX_RESET 1'h0 -#define SYNTH_SYNTH1_FORCE_LO_ON_MSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_LSB 24 -#define SYNTH_SYNTH1_FORCE_LO_ON_MASK 'h01000000 -#define SYNTH_SYNTH1_FORCE_LO_ON_GET(x) (((x) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) >> SYNTH_SYNTH1_FORCE_LO_ON_LSB) -#define SYNTH_SYNTH1_FORCE_LO_ON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_FORCE_LO_ON_LSB) & SYNTH_SYNTH1_FORCE_LO_ON_MASK) -#define SYNTH_SYNTH1_FORCE_LO_ON_RESET 1'h0 -#define SYNTH_SYNTH1_PWD_LOBUF5G_MSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_LSB 23 -#define SYNTH_SYNTH1_PWD_LOBUF5G_MASK 'h00800000 -#define SYNTH_SYNTH1_PWD_LOBUF5G_GET(x) (((x) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) >> SYNTH_SYNTH1_PWD_LOBUF5G_LSB) -#define SYNTH_SYNTH1_PWD_LOBUF5G_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWD_LOBUF5G_LSB) & SYNTH_SYNTH1_PWD_LOBUF5G_MASK) -#define SYNTH_SYNTH1_PWD_LOBUF5G_RESET 1'h0 -#define SYNTH_SYNTH1_VCOREGBYPASS_MSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_LSB 22 -#define SYNTH_SYNTH1_VCOREGBYPASS_MASK 'h00400000 -#define SYNTH_SYNTH1_VCOREGBYPASS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) >> SYNTH_SYNTH1_VCOREGBYPASS_LSB) -#define SYNTH_SYNTH1_VCOREGBYPASS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_VCOREGBYPASS_LSB) & SYNTH_SYNTH1_VCOREGBYPASS_MASK) -#define SYNTH_SYNTH1_VCOREGBYPASS_RESET 1'h1 -#define SYNTH_SYNTH1_VCOREGLEVEL_MSB 21 -#define SYNTH_SYNTH1_VCOREGLEVEL_LSB 20 -#define SYNTH_SYNTH1_VCOREGLEVEL_MASK 'h00300000 -#define SYNTH_SYNTH1_VCOREGLEVEL_GET(x) (((x) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) >> SYNTH_SYNTH1_VCOREGLEVEL_LSB) -#define SYNTH_SYNTH1_VCOREGLEVEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_VCOREGLEVEL_LSB) & SYNTH_SYNTH1_VCOREGLEVEL_MASK) -#define SYNTH_SYNTH1_VCOREGLEVEL_RESET 2'h1 -#define SYNTH_SYNTH1_VCOREGBIAS_MSB 19 -#define SYNTH_SYNTH1_VCOREGBIAS_LSB 18 -#define SYNTH_SYNTH1_VCOREGBIAS_MASK 'h000c0000 -#define SYNTH_SYNTH1_VCOREGBIAS_GET(x) (((x) & SYNTH_SYNTH1_VCOREGBIAS_MASK) >> SYNTH_SYNTH1_VCOREGBIAS_LSB) -#define SYNTH_SYNTH1_VCOREGBIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_VCOREGBIAS_LSB) & SYNTH_SYNTH1_VCOREGBIAS_MASK) -#define SYNTH_SYNTH1_VCOREGBIAS_RESET 2'h1 -#define SYNTH_SYNTH1_SLIDINGIF_MSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_LSB 17 -#define SYNTH_SYNTH1_SLIDINGIF_MASK 'h00020000 -#define SYNTH_SYNTH1_SLIDINGIF_GET(x) (((x) & SYNTH_SYNTH1_SLIDINGIF_MASK) >> SYNTH_SYNTH1_SLIDINGIF_LSB) -#define SYNTH_SYNTH1_SLIDINGIF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_SLIDINGIF_LSB) & SYNTH_SYNTH1_SLIDINGIF_MASK) -#define SYNTH_SYNTH1_SLIDINGIF_RESET 1'h0 -#define SYNTH_SYNTH1_SPARE_PWD_MSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_LSB 16 -#define SYNTH_SYNTH1_SPARE_PWD_MASK 'h00010000 -#define SYNTH_SYNTH1_SPARE_PWD_GET(x) (((x) & SYNTH_SYNTH1_SPARE_PWD_MASK) >> SYNTH_SYNTH1_SPARE_PWD_LSB) -#define SYNTH_SYNTH1_SPARE_PWD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_SPARE_PWD_LSB) & SYNTH_SYNTH1_SPARE_PWD_MASK) -#define SYNTH_SYNTH1_SPARE_PWD_RESET 1'h0 -#define SYNTH_SYNTH1_CON_VDDVCOREG_MSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_LSB 15 -#define SYNTH_SYNTH1_CON_VDDVCOREG_MASK 'h00008000 -#define SYNTH_SYNTH1_CON_VDDVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) >> SYNTH_SYNTH1_CON_VDDVCOREG_LSB) -#define SYNTH_SYNTH1_CON_VDDVCOREG_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_CON_VDDVCOREG_LSB) & SYNTH_SYNTH1_CON_VDDVCOREG_MASK) -#define SYNTH_SYNTH1_CON_VDDVCOREG_RESET 1'h0 -#define SYNTH_SYNTH1_CON_IVCOREG_MSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_LSB 14 -#define SYNTH_SYNTH1_CON_IVCOREG_MASK 'h00004000 -#define SYNTH_SYNTH1_CON_IVCOREG_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOREG_MASK) >> SYNTH_SYNTH1_CON_IVCOREG_LSB) -#define SYNTH_SYNTH1_CON_IVCOREG_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_CON_IVCOREG_LSB) & SYNTH_SYNTH1_CON_IVCOREG_MASK) -#define SYNTH_SYNTH1_CON_IVCOREG_RESET 1'h0 -#define SYNTH_SYNTH1_CON_IVCOBUF_MSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_LSB 13 -#define SYNTH_SYNTH1_CON_IVCOBUF_MASK 'h00002000 -#define SYNTH_SYNTH1_CON_IVCOBUF_GET(x) (((x) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) >> SYNTH_SYNTH1_CON_IVCOBUF_LSB) -#define SYNTH_SYNTH1_CON_IVCOBUF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_CON_IVCOBUF_LSB) & SYNTH_SYNTH1_CON_IVCOBUF_MASK) -#define SYNTH_SYNTH1_CON_IVCOBUF_RESET 1'h0 -#define SYNTH_SYNTH1_SEL_VCMONABUS_MSB 12 -#define SYNTH_SYNTH1_SEL_VCMONABUS_LSB 10 -#define SYNTH_SYNTH1_SEL_VCMONABUS_MASK 'h00001c00 -#define SYNTH_SYNTH1_SEL_VCMONABUS_GET(x) (((x) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) >> SYNTH_SYNTH1_SEL_VCMONABUS_LSB) -#define SYNTH_SYNTH1_SEL_VCMONABUS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_SEL_VCMONABUS_LSB) & SYNTH_SYNTH1_SEL_VCMONABUS_MASK) -#define SYNTH_SYNTH1_SEL_VCMONABUS_RESET 3'h0 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB 9 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK 'h00000200 -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) >> SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_VCOBUF_PD_LSB) & SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK) -#define SYNTH_SYNTH1_PWUP_VCOBUF_PD_RESET 1'h0 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_LSB 8 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_MASK 'h00000100 -#define SYNTH_SYNTH1_PWUP_LODIV_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) >> SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_LODIV_PD_LSB) & SYNTH_SYNTH1_PWUP_LODIV_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LODIV_PD_RESET 1'h0 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB 7 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK 'h00000080 -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_LOMIX_PD_LSB) & SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOMIX_PD_RESET 1'h0 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB 6 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK 'h00000040 -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_GET(x) (((x) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) >> SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_PWUP_LOBUF5G_PD_LSB) & SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK) -#define SYNTH_SYNTH1_PWUP_LOBUF5G_PD_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_FB_MSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_LSB 5 -#define SYNTH_SYNTH1_MONITOR_FB_MASK 'h00000020 -#define SYNTH_SYNTH1_MONITOR_FB_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_MASK) >> SYNTH_SYNTH1_MONITOR_FB_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_FB_LSB) & SYNTH_SYNTH1_MONITOR_FB_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_REF_MSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_LSB 4 -#define SYNTH_SYNTH1_MONITOR_REF_MASK 'h00000010 -#define SYNTH_SYNTH1_MONITOR_REF_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_REF_MASK) >> SYNTH_SYNTH1_MONITOR_REF_LSB) -#define SYNTH_SYNTH1_MONITOR_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_REF_LSB) & SYNTH_SYNTH1_MONITOR_REF_MASK) -#define SYNTH_SYNTH1_MONITOR_REF_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB 3 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK 'h00000008 -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) >> SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_FB_DIV2_LSB) & SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK) -#define SYNTH_SYNTH1_MONITOR_FB_DIV2_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB 2 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK 'h00000004 -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) >> SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_VC2HIGH_LSB) & SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2HIGH_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_LSB 1 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_MASK 'h00000002 -#define SYNTH_SYNTH1_MONITOR_VC2LOW_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) >> SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_VC2LOW_LSB) & SYNTH_SYNTH1_MONITOR_VC2LOW_MASK) -#define SYNTH_SYNTH1_MONITOR_VC2LOW_RESET 1'h0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB 0 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK 'h00000001 -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_GET(x) (((x) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) >> SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB) & SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) -#define SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_RESET 1'h0 -#define SYNTH_SYNTH1_RESET (32'h0 | \ - SYNTH_SYNTH1_PWD_BIAS_SET(SYNTH_SYNTH1_PWD_BIAS_RESET) | \ - SYNTH_SYNTH1_PWD_CP_SET(SYNTH_SYNTH1_PWD_CP_RESET) | \ - SYNTH_SYNTH1_PWD_VCMON_SET(SYNTH_SYNTH1_PWD_VCMON_RESET) | \ - SYNTH_SYNTH1_PWD_VCO_SET(SYNTH_SYNTH1_PWD_VCO_RESET) | \ - SYNTH_SYNTH1_PWD_PRESC_SET(SYNTH_SYNTH1_PWD_PRESC_RESET) | \ - SYNTH_SYNTH1_PWD_LODIV_SET(SYNTH_SYNTH1_PWD_LODIV_RESET) | \ - SYNTH_SYNTH1_PWD_LOMIX_SET(SYNTH_SYNTH1_PWD_LOMIX_RESET) | \ - SYNTH_SYNTH1_FORCE_LO_ON_SET(SYNTH_SYNTH1_FORCE_LO_ON_RESET) | \ - SYNTH_SYNTH1_PWD_LOBUF5G_SET(SYNTH_SYNTH1_PWD_LOBUF5G_RESET) | \ - SYNTH_SYNTH1_VCOREGBYPASS_SET(SYNTH_SYNTH1_VCOREGBYPASS_RESET) | \ - SYNTH_SYNTH1_VCOREGLEVEL_SET(SYNTH_SYNTH1_VCOREGLEVEL_RESET) | \ - SYNTH_SYNTH1_VCOREGBIAS_SET(SYNTH_SYNTH1_VCOREGBIAS_RESET) | \ - SYNTH_SYNTH1_SLIDINGIF_SET(SYNTH_SYNTH1_SLIDINGIF_RESET) | \ - SYNTH_SYNTH1_SPARE_PWD_SET(SYNTH_SYNTH1_SPARE_PWD_RESET) | \ - SYNTH_SYNTH1_CON_VDDVCOREG_SET(SYNTH_SYNTH1_CON_VDDVCOREG_RESET) | \ - SYNTH_SYNTH1_CON_IVCOREG_SET(SYNTH_SYNTH1_CON_IVCOREG_RESET) | \ - SYNTH_SYNTH1_CON_IVCOBUF_SET(SYNTH_SYNTH1_CON_IVCOBUF_RESET) | \ - SYNTH_SYNTH1_SEL_VCMONABUS_SET(SYNTH_SYNTH1_SEL_VCMONABUS_RESET) | \ - SYNTH_SYNTH1_PWUP_VCOBUF_PD_SET(SYNTH_SYNTH1_PWUP_VCOBUF_PD_RESET) | \ - SYNTH_SYNTH1_PWUP_LODIV_PD_SET(SYNTH_SYNTH1_PWUP_LODIV_PD_RESET) | \ - SYNTH_SYNTH1_PWUP_LOMIX_PD_SET(SYNTH_SYNTH1_PWUP_LOMIX_PD_RESET) | \ - SYNTH_SYNTH1_PWUP_LOBUF5G_PD_SET(SYNTH_SYNTH1_PWUP_LOBUF5G_PD_RESET) | \ - SYNTH_SYNTH1_MONITOR_FB_SET(SYNTH_SYNTH1_MONITOR_FB_RESET) | \ - SYNTH_SYNTH1_MONITOR_REF_SET(SYNTH_SYNTH1_MONITOR_REF_RESET) | \ - SYNTH_SYNTH1_MONITOR_FB_DIV2_SET(SYNTH_SYNTH1_MONITOR_FB_DIV2_RESET) | \ - SYNTH_SYNTH1_MONITOR_VC2HIGH_SET(SYNTH_SYNTH1_MONITOR_VC2HIGH_RESET) | \ - SYNTH_SYNTH1_MONITOR_VC2LOW_SET(SYNTH_SYNTH1_MONITOR_VC2LOW_RESET) | \ - SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_SET(SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_RESET)) -#define SYNTH_SYNTH1_HW_MASK (32'h0) -#define SYNTH_SYNTH1_SW_MASK (32'h0 | \ - SYNTH_SYNTH1_PWD_BIAS_MASK | \ - SYNTH_SYNTH1_PWD_CP_MASK | \ - SYNTH_SYNTH1_PWD_VCMON_MASK | \ - SYNTH_SYNTH1_PWD_VCO_MASK | \ - SYNTH_SYNTH1_PWD_PRESC_MASK | \ - SYNTH_SYNTH1_PWD_LODIV_MASK | \ - SYNTH_SYNTH1_PWD_LOMIX_MASK | \ - SYNTH_SYNTH1_FORCE_LO_ON_MASK | \ - SYNTH_SYNTH1_PWD_LOBUF5G_MASK | \ - SYNTH_SYNTH1_VCOREGBYPASS_MASK | \ - SYNTH_SYNTH1_VCOREGLEVEL_MASK | \ - SYNTH_SYNTH1_VCOREGBIAS_MASK | \ - SYNTH_SYNTH1_SLIDINGIF_MASK | \ - SYNTH_SYNTH1_SPARE_PWD_MASK | \ - SYNTH_SYNTH1_CON_VDDVCOREG_MASK | \ - SYNTH_SYNTH1_CON_IVCOREG_MASK | \ - SYNTH_SYNTH1_CON_IVCOBUF_MASK | \ - SYNTH_SYNTH1_SEL_VCMONABUS_MASK | \ - SYNTH_SYNTH1_PWUP_VCOBUF_PD_MASK | \ - SYNTH_SYNTH1_PWUP_LODIV_PD_MASK | \ - SYNTH_SYNTH1_PWUP_LOMIX_PD_MASK | \ - SYNTH_SYNTH1_PWUP_LOBUF5G_PD_MASK | \ - SYNTH_SYNTH1_MONITOR_FB_MASK | \ - SYNTH_SYNTH1_MONITOR_REF_MASK | \ - SYNTH_SYNTH1_MONITOR_FB_DIV2_MASK | \ - SYNTH_SYNTH1_MONITOR_VC2HIGH_MASK | \ - SYNTH_SYNTH1_MONITOR_VC2LOW_MASK | \ - SYNTH_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK) - -#define SYNTH_SYNTH2_ADDRESS 'h00000004 -#define SYNTH_SYNTH2_VC_CAL_REF_MSB 31 -#define SYNTH_SYNTH2_VC_CAL_REF_LSB 29 -#define SYNTH_SYNTH2_VC_CAL_REF_MASK 'he0000000 -#define SYNTH_SYNTH2_VC_CAL_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_CAL_REF_MASK) >> SYNTH_SYNTH2_VC_CAL_REF_LSB) -#define SYNTH_SYNTH2_VC_CAL_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_CAL_REF_LSB) & SYNTH_SYNTH2_VC_CAL_REF_MASK) -#define SYNTH_SYNTH2_VC_CAL_REF_RESET 3'h0 -#define SYNTH_SYNTH2_VC_HI_REF_MSB 28 -#define SYNTH_SYNTH2_VC_HI_REF_LSB 26 -#define SYNTH_SYNTH2_VC_HI_REF_MASK 'h1c000000 -#define SYNTH_SYNTH2_VC_HI_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_HI_REF_MASK) >> SYNTH_SYNTH2_VC_HI_REF_LSB) -#define SYNTH_SYNTH2_VC_HI_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_HI_REF_LSB) & SYNTH_SYNTH2_VC_HI_REF_MASK) -#define SYNTH_SYNTH2_VC_HI_REF_RESET 3'h3 -#define SYNTH_SYNTH2_VC_MID_REF_MSB 25 -#define SYNTH_SYNTH2_VC_MID_REF_LSB 23 -#define SYNTH_SYNTH2_VC_MID_REF_MASK 'h03800000 -#define SYNTH_SYNTH2_VC_MID_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_MID_REF_MASK) >> SYNTH_SYNTH2_VC_MID_REF_LSB) -#define SYNTH_SYNTH2_VC_MID_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_MID_REF_LSB) & SYNTH_SYNTH2_VC_MID_REF_MASK) -#define SYNTH_SYNTH2_VC_MID_REF_RESET 3'h4 -#define SYNTH_SYNTH2_VC_LOW_REF_MSB 22 -#define SYNTH_SYNTH2_VC_LOW_REF_LSB 20 -#define SYNTH_SYNTH2_VC_LOW_REF_MASK 'h00700000 -#define SYNTH_SYNTH2_VC_LOW_REF_GET(x) (((x) & SYNTH_SYNTH2_VC_LOW_REF_MASK) >> SYNTH_SYNTH2_VC_LOW_REF_LSB) -#define SYNTH_SYNTH2_VC_LOW_REF_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_VC_LOW_REF_LSB) & SYNTH_SYNTH2_VC_LOW_REF_MASK) -#define SYNTH_SYNTH2_VC_LOW_REF_RESET 3'h4 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MSB 19 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB 15 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK 'h000f8000 -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_GET(x) (((x) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) >> SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_3RD_ORDER_R_LSB) & SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK) -#define SYNTH_SYNTH2_LOOP_3RD_ORDER_R_RESET 5'h8 -#define SYNTH_SYNTH2_LOOP_CP_MSB 14 -#define SYNTH_SYNTH2_LOOP_CP_LSB 10 -#define SYNTH_SYNTH2_LOOP_CP_MASK 'h00007c00 -#define SYNTH_SYNTH2_LOOP_CP_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CP_MASK) >> SYNTH_SYNTH2_LOOP_CP_LSB) -#define SYNTH_SYNTH2_LOOP_CP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_CP_LSB) & SYNTH_SYNTH2_LOOP_CP_MASK) -#define SYNTH_SYNTH2_LOOP_CP_RESET 5'h8 -#define SYNTH_SYNTH2_LOOP_RS_MSB 9 -#define SYNTH_SYNTH2_LOOP_RS_LSB 5 -#define SYNTH_SYNTH2_LOOP_RS_MASK 'h000003e0 -#define SYNTH_SYNTH2_LOOP_RS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_RS_MASK) >> SYNTH_SYNTH2_LOOP_RS_LSB) -#define SYNTH_SYNTH2_LOOP_RS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_RS_LSB) & SYNTH_SYNTH2_LOOP_RS_MASK) -#define SYNTH_SYNTH2_LOOP_RS_RESET 5'h5 -#define SYNTH_SYNTH2_LOOP_CS_MSB 4 -#define SYNTH_SYNTH2_LOOP_CS_LSB 3 -#define SYNTH_SYNTH2_LOOP_CS_MASK 'h00000018 -#define SYNTH_SYNTH2_LOOP_CS_GET(x) (((x) & SYNTH_SYNTH2_LOOP_CS_MASK) >> SYNTH_SYNTH2_LOOP_CS_LSB) -#define SYNTH_SYNTH2_LOOP_CS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_LOOP_CS_LSB) & SYNTH_SYNTH2_LOOP_CS_MASK) -#define SYNTH_SYNTH2_LOOP_CS_RESET 2'h3 -#define SYNTH_SYNTH2_SPARE_BITS_MSB 2 -#define SYNTH_SYNTH2_SPARE_BITS_LSB 0 -#define SYNTH_SYNTH2_SPARE_BITS_MASK 'h00000007 -#define SYNTH_SYNTH2_SPARE_BITS_GET(x) (((x) & SYNTH_SYNTH2_SPARE_BITS_MASK) >> SYNTH_SYNTH2_SPARE_BITS_LSB) -#define SYNTH_SYNTH2_SPARE_BITS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH2_SPARE_BITS_LSB) & SYNTH_SYNTH2_SPARE_BITS_MASK) -#define SYNTH_SYNTH2_SPARE_BITS_RESET 3'h0 -#define SYNTH_SYNTH2_RESET (32'h0 | \ - SYNTH_SYNTH2_VC_CAL_REF_SET(SYNTH_SYNTH2_VC_CAL_REF_RESET) | \ - SYNTH_SYNTH2_VC_HI_REF_SET(SYNTH_SYNTH2_VC_HI_REF_RESET) | \ - SYNTH_SYNTH2_VC_MID_REF_SET(SYNTH_SYNTH2_VC_MID_REF_RESET) | \ - SYNTH_SYNTH2_VC_LOW_REF_SET(SYNTH_SYNTH2_VC_LOW_REF_RESET) | \ - SYNTH_SYNTH2_LOOP_3RD_ORDER_R_SET(SYNTH_SYNTH2_LOOP_3RD_ORDER_R_RESET) | \ - SYNTH_SYNTH2_LOOP_CP_SET(SYNTH_SYNTH2_LOOP_CP_RESET) | \ - SYNTH_SYNTH2_LOOP_RS_SET(SYNTH_SYNTH2_LOOP_RS_RESET) | \ - SYNTH_SYNTH2_LOOP_CS_SET(SYNTH_SYNTH2_LOOP_CS_RESET) | \ - SYNTH_SYNTH2_SPARE_BITS_SET(SYNTH_SYNTH2_SPARE_BITS_RESET)) -#define SYNTH_SYNTH2_HW_MASK (32'h0) -#define SYNTH_SYNTH2_SW_MASK (32'h0 | \ - SYNTH_SYNTH2_VC_CAL_REF_MASK | \ - SYNTH_SYNTH2_VC_HI_REF_MASK | \ - SYNTH_SYNTH2_VC_MID_REF_MASK | \ - SYNTH_SYNTH2_VC_LOW_REF_MASK | \ - SYNTH_SYNTH2_LOOP_3RD_ORDER_R_MASK | \ - SYNTH_SYNTH2_LOOP_CP_MASK | \ - SYNTH_SYNTH2_LOOP_RS_MASK | \ - SYNTH_SYNTH2_LOOP_CS_MASK | \ - SYNTH_SYNTH2_SPARE_BITS_MASK) - -#define SYNTH_SYNTH3_ADDRESS 'h00000008 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_LSB 31 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_MASK 'h80000000 -#define SYNTH_SYNTH3_DIS_CLK_XTAL_GET(x) (((x) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) >> SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) -#define SYNTH_SYNTH3_DIS_CLK_XTAL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_DIS_CLK_XTAL_LSB) & SYNTH_SYNTH3_DIS_CLK_XTAL_MASK) -#define SYNTH_SYNTH3_DIS_CLK_XTAL_RESET 1'h0 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_LSB 30 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_MASK 'h40000000 -#define SYNTH_SYNTH3_SEL_CLK_DIV2_GET(x) (((x) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) >> SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_SEL_CLK_DIV2_LSB) & SYNTH_SYNTH3_SEL_CLK_DIV2_MASK) -#define SYNTH_SYNTH3_SEL_CLK_DIV2_RESET 1'h1 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MSB 29 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB 24 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK 'h3f000000 -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_RESET 6'h14 -#define SYNTH_SYNTH3_WAIT_PWRUP_MSB 23 -#define SYNTH_SYNTH3_WAIT_PWRUP_LSB 18 -#define SYNTH_SYNTH3_WAIT_PWRUP_MASK 'h00fc0000 -#define SYNTH_SYNTH3_WAIT_PWRUP_GET(x) (((x) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) >> SYNTH_SYNTH3_WAIT_PWRUP_LSB) -#define SYNTH_SYNTH3_WAIT_PWRUP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_PWRUP_LSB) & SYNTH_SYNTH3_WAIT_PWRUP_MASK) -#define SYNTH_SYNTH3_WAIT_PWRUP_RESET 6'h8 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MSB 17 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_LSB 12 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_MASK 'h0003f000 -#define SYNTH_SYNTH3_WAIT_CAL_BIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_CAL_BIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_BIN_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_BIN_RESET 6'h14 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MSB 11 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_LSB 6 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_MASK 'h00000fc0 -#define SYNTH_SYNTH3_WAIT_CAL_LIN_GET(x) (((x) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) >> SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_CAL_LIN_LSB) & SYNTH_SYNTH3_WAIT_CAL_LIN_MASK) -#define SYNTH_SYNTH3_WAIT_CAL_LIN_RESET 6'h14 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MSB 5 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_LSB 0 -#define SYNTH_SYNTH3_WAIT_VC_CHECK_MASK 'h0000003f -#define SYNTH_SYNTH3_WAIT_VC_CHECK_GET(x) (((x) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) >> SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH3_WAIT_VC_CHECK_LSB) & SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) -#define SYNTH_SYNTH3_WAIT_VC_CHECK_RESET 6'h14 -#define SYNTH_SYNTH3_RESET (32'h0 | \ - SYNTH_SYNTH3_DIS_CLK_XTAL_SET(SYNTH_SYNTH3_DIS_CLK_XTAL_RESET) | \ - SYNTH_SYNTH3_SEL_CLK_DIV2_SET(SYNTH_SYNTH3_SEL_CLK_DIV2_RESET) | \ - SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_SET(SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_RESET) | \ - SYNTH_SYNTH3_WAIT_PWRUP_SET(SYNTH_SYNTH3_WAIT_PWRUP_RESET) | \ - SYNTH_SYNTH3_WAIT_CAL_BIN_SET(SYNTH_SYNTH3_WAIT_CAL_BIN_RESET) | \ - SYNTH_SYNTH3_WAIT_CAL_LIN_SET(SYNTH_SYNTH3_WAIT_CAL_LIN_RESET) | \ - SYNTH_SYNTH3_WAIT_VC_CHECK_SET(SYNTH_SYNTH3_WAIT_VC_CHECK_RESET)) -#define SYNTH_SYNTH3_HW_MASK (32'h0) -#define SYNTH_SYNTH3_SW_MASK (32'h0 | \ - SYNTH_SYNTH3_DIS_CLK_XTAL_MASK | \ - SYNTH_SYNTH3_SEL_CLK_DIV2_MASK | \ - SYNTH_SYNTH3_WAIT_SHORTR_PWRUP_MASK | \ - SYNTH_SYNTH3_WAIT_PWRUP_MASK | \ - SYNTH_SYNTH3_WAIT_CAL_BIN_MASK | \ - SYNTH_SYNTH3_WAIT_CAL_LIN_MASK | \ - SYNTH_SYNTH3_WAIT_VC_CHECK_MASK) - -#define SYNTH_SYNTH4_ADDRESS 'h0000000c -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB 31 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK 'h80000000 -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_GET(x) (((x) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) >> SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_LSB) & SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK) -#define SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_RESET 1'h0 -#define SYNTH_SYNTH4_DIS_LOSTVC_MSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_LSB 30 -#define SYNTH_SYNTH4_DIS_LOSTVC_MASK 'h40000000 -#define SYNTH_SYNTH4_DIS_LOSTVC_GET(x) (((x) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) >> SYNTH_SYNTH4_DIS_LOSTVC_LSB) -#define SYNTH_SYNTH4_DIS_LOSTVC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_DIS_LOSTVC_LSB) & SYNTH_SYNTH4_DIS_LOSTVC_MASK) -#define SYNTH_SYNTH4_DIS_LOSTVC_RESET 1'h0 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_LSB 29 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_MASK 'h20000000 -#define SYNTH_SYNTH4_ALWAYS_SHORTR_GET(x) (((x) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) >> SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_ALWAYS_SHORTR_LSB) & SYNTH_SYNTH4_ALWAYS_SHORTR_MASK) -#define SYNTH_SYNTH4_ALWAYS_SHORTR_RESET 1'h0 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB 28 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK 'h10000000 -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_GET(x) (((x) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) >> SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_LSB) & SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK) -#define SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_RESET 1'h1 -#define SYNTH_SYNTH4_FORCE_PINVC_MSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_LSB 27 -#define SYNTH_SYNTH4_FORCE_PINVC_MASK 'h08000000 -#define SYNTH_SYNTH4_FORCE_PINVC_GET(x) (((x) & SYNTH_SYNTH4_FORCE_PINVC_MASK) >> SYNTH_SYNTH4_FORCE_PINVC_LSB) -#define SYNTH_SYNTH4_FORCE_PINVC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_FORCE_PINVC_LSB) & SYNTH_SYNTH4_FORCE_PINVC_MASK) -#define SYNTH_SYNTH4_FORCE_PINVC_RESET 1'h0 -#define SYNTH_SYNTH4_FORCE_VCOCAP_MSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_LSB 26 -#define SYNTH_SYNTH4_FORCE_VCOCAP_MASK 'h04000000 -#define SYNTH_SYNTH4_FORCE_VCOCAP_GET(x) (((x) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) >> SYNTH_SYNTH4_FORCE_VCOCAP_LSB) -#define SYNTH_SYNTH4_FORCE_VCOCAP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_FORCE_VCOCAP_LSB) & SYNTH_SYNTH4_FORCE_VCOCAP_MASK) -#define SYNTH_SYNTH4_FORCE_VCOCAP_RESET 1'h0 -#define SYNTH_SYNTH4_VCOCAP_OVR_MSB 25 -#define SYNTH_SYNTH4_VCOCAP_OVR_LSB 18 -#define SYNTH_SYNTH4_VCOCAP_OVR_MASK 'h03fc0000 -#define SYNTH_SYNTH4_VCOCAP_OVR_GET(x) (((x) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) >> SYNTH_SYNTH4_VCOCAP_OVR_LSB) -#define SYNTH_SYNTH4_VCOCAP_OVR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_VCOCAP_OVR_LSB) & SYNTH_SYNTH4_VCOCAP_OVR_MASK) -#define SYNTH_SYNTH4_VCOCAP_OVR_RESET 8'h80 -#define SYNTH_SYNTH4_VCOCAPPULLUP_MSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_LSB 17 -#define SYNTH_SYNTH4_VCOCAPPULLUP_MASK 'h00020000 -#define SYNTH_SYNTH4_VCOCAPPULLUP_GET(x) (((x) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) >> SYNTH_SYNTH4_VCOCAPPULLUP_LSB) -#define SYNTH_SYNTH4_VCOCAPPULLUP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_VCOCAPPULLUP_LSB) & SYNTH_SYNTH4_VCOCAPPULLUP_MASK) -#define SYNTH_SYNTH4_VCOCAPPULLUP_RESET 1'h1 -#define SYNTH_SYNTH4_REFDIVSEL_MSB 16 -#define SYNTH_SYNTH4_REFDIVSEL_LSB 15 -#define SYNTH_SYNTH4_REFDIVSEL_MASK 'h00018000 -#define SYNTH_SYNTH4_REFDIVSEL_GET(x) (((x) & SYNTH_SYNTH4_REFDIVSEL_MASK) >> SYNTH_SYNTH4_REFDIVSEL_LSB) -#define SYNTH_SYNTH4_REFDIVSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_REFDIVSEL_LSB) & SYNTH_SYNTH4_REFDIVSEL_MASK) -#define SYNTH_SYNTH4_REFDIVSEL_RESET 2'h0 -#define SYNTH_SYNTH4_PFDDELAY_MSB 14 -#define SYNTH_SYNTH4_PFDDELAY_LSB 14 -#define SYNTH_SYNTH4_PFDDELAY_MASK 'h00004000 -#define SYNTH_SYNTH4_PFDDELAY_GET(x) (((x) & SYNTH_SYNTH4_PFDDELAY_MASK) >> SYNTH_SYNTH4_PFDDELAY_LSB) -#define SYNTH_SYNTH4_PFDDELAY_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PFDDELAY_LSB) & SYNTH_SYNTH4_PFDDELAY_MASK) -#define SYNTH_SYNTH4_PFDDELAY_RESET 1'h1 -#define SYNTH_SYNTH4_PFD_DISABLE_MSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_LSB 13 -#define SYNTH_SYNTH4_PFD_DISABLE_MASK 'h00002000 -#define SYNTH_SYNTH4_PFD_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_PFD_DISABLE_MASK) >> SYNTH_SYNTH4_PFD_DISABLE_LSB) -#define SYNTH_SYNTH4_PFD_DISABLE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PFD_DISABLE_LSB) & SYNTH_SYNTH4_PFD_DISABLE_MASK) -#define SYNTH_SYNTH4_PFD_DISABLE_RESET 1'h0 -#define SYNTH_SYNTH4_PRESCSEL_MSB 12 -#define SYNTH_SYNTH4_PRESCSEL_LSB 11 -#define SYNTH_SYNTH4_PRESCSEL_MASK 'h00001800 -#define SYNTH_SYNTH4_PRESCSEL_GET(x) (((x) & SYNTH_SYNTH4_PRESCSEL_MASK) >> SYNTH_SYNTH4_PRESCSEL_LSB) -#define SYNTH_SYNTH4_PRESCSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PRESCSEL_LSB) & SYNTH_SYNTH4_PRESCSEL_MASK) -#define SYNTH_SYNTH4_PRESCSEL_RESET 2'h3 -#define SYNTH_SYNTH4_RESET_PRESC_MSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_LSB 10 -#define SYNTH_SYNTH4_RESET_PRESC_MASK 'h00000400 -#define SYNTH_SYNTH4_RESET_PRESC_GET(x) (((x) & SYNTH_SYNTH4_RESET_PRESC_MASK) >> SYNTH_SYNTH4_RESET_PRESC_LSB) -#define SYNTH_SYNTH4_RESET_PRESC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_RESET_PRESC_LSB) & SYNTH_SYNTH4_RESET_PRESC_MASK) -#define SYNTH_SYNTH4_RESET_PRESC_RESET 1'h0 -#define SYNTH_SYNTH4_SDM_DISABLE_MSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_LSB 9 -#define SYNTH_SYNTH4_SDM_DISABLE_MASK 'h00000200 -#define SYNTH_SYNTH4_SDM_DISABLE_GET(x) (((x) & SYNTH_SYNTH4_SDM_DISABLE_MASK) >> SYNTH_SYNTH4_SDM_DISABLE_LSB) -#define SYNTH_SYNTH4_SDM_DISABLE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SDM_DISABLE_LSB) & SYNTH_SYNTH4_SDM_DISABLE_MASK) -#define SYNTH_SYNTH4_SDM_DISABLE_RESET 1'h0 -#define SYNTH_SYNTH4_SDM_MODE_MSB 8 -#define SYNTH_SYNTH4_SDM_MODE_LSB 8 -#define SYNTH_SYNTH4_SDM_MODE_MASK 'h00000100 -#define SYNTH_SYNTH4_SDM_MODE_GET(x) (((x) & SYNTH_SYNTH4_SDM_MODE_MASK) >> SYNTH_SYNTH4_SDM_MODE_LSB) -#define SYNTH_SYNTH4_SDM_MODE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SDM_MODE_LSB) & SYNTH_SYNTH4_SDM_MODE_MASK) -#define SYNTH_SYNTH4_SDM_MODE_RESET 1'h0 -#define SYNTH_SYNTH4_SDM_DITHER_MSB 7 -#define SYNTH_SYNTH4_SDM_DITHER_LSB 6 -#define SYNTH_SYNTH4_SDM_DITHER_MASK 'h000000c0 -#define SYNTH_SYNTH4_SDM_DITHER_GET(x) (((x) & SYNTH_SYNTH4_SDM_DITHER_MASK) >> SYNTH_SYNTH4_SDM_DITHER_LSB) -#define SYNTH_SYNTH4_SDM_DITHER_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SDM_DITHER_LSB) & SYNTH_SYNTH4_SDM_DITHER_MASK) -#define SYNTH_SYNTH4_SDM_DITHER_RESET 2'h0 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB 5 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK 'h00000020 -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_GET(x) (((x) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) >> SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_PSCOUNT_FBSEL_LSB) & SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK) -#define SYNTH_SYNTH4_PSCOUNT_FBSEL_RESET 1'h0 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB 4 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK 'h00000010 -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_GET(x) (((x) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) >> SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_LSB) & SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK) -#define SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_RESET 1'h0 -#define SYNTH_SYNTH4_SPARE_MISC_MSB 3 -#define SYNTH_SYNTH4_SPARE_MISC_LSB 2 -#define SYNTH_SYNTH4_SPARE_MISC_MASK 'h0000000c -#define SYNTH_SYNTH4_SPARE_MISC_GET(x) (((x) & SYNTH_SYNTH4_SPARE_MISC_MASK) >> SYNTH_SYNTH4_SPARE_MISC_LSB) -#define SYNTH_SYNTH4_SPARE_MISC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_SPARE_MISC_LSB) & SYNTH_SYNTH4_SPARE_MISC_MASK) -#define SYNTH_SYNTH4_SPARE_MISC_RESET 2'h0 -#define SYNTH_SYNTH4_LONGSHIFTSEL_MSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_LSB 1 -#define SYNTH_SYNTH4_LONGSHIFTSEL_MASK 'h00000002 -#define SYNTH_SYNTH4_LONGSHIFTSEL_GET(x) (((x) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) >> SYNTH_SYNTH4_LONGSHIFTSEL_LSB) -#define SYNTH_SYNTH4_LONGSHIFTSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_LONGSHIFTSEL_LSB) & SYNTH_SYNTH4_LONGSHIFTSEL_MASK) -#define SYNTH_SYNTH4_LONGSHIFTSEL_RESET 1'h0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_LSB 0 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_MASK 'h00000001 -#define SYNTH_SYNTH4_FORCE_SHIFTREG_GET(x) (((x) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) >> SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH4_FORCE_SHIFTREG_LSB) & SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) -#define SYNTH_SYNTH4_FORCE_SHIFTREG_RESET 1'h0 -#define SYNTH_SYNTH4_RESET (32'h0 | \ - SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_SET(SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_RESET) | \ - SYNTH_SYNTH4_DIS_LOSTVC_SET(SYNTH_SYNTH4_DIS_LOSTVC_RESET) | \ - SYNTH_SYNTH4_ALWAYS_SHORTR_SET(SYNTH_SYNTH4_ALWAYS_SHORTR_RESET) | \ - SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_SET(SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_RESET) | \ - SYNTH_SYNTH4_FORCE_PINVC_SET(SYNTH_SYNTH4_FORCE_PINVC_RESET) | \ - SYNTH_SYNTH4_FORCE_VCOCAP_SET(SYNTH_SYNTH4_FORCE_VCOCAP_RESET) | \ - SYNTH_SYNTH4_VCOCAP_OVR_SET(SYNTH_SYNTH4_VCOCAP_OVR_RESET) | \ - SYNTH_SYNTH4_VCOCAPPULLUP_SET(SYNTH_SYNTH4_VCOCAPPULLUP_RESET) | \ - SYNTH_SYNTH4_REFDIVSEL_SET(SYNTH_SYNTH4_REFDIVSEL_RESET) | \ - SYNTH_SYNTH4_PFDDELAY_SET(SYNTH_SYNTH4_PFDDELAY_RESET) | \ - SYNTH_SYNTH4_PFD_DISABLE_SET(SYNTH_SYNTH4_PFD_DISABLE_RESET) | \ - SYNTH_SYNTH4_PRESCSEL_SET(SYNTH_SYNTH4_PRESCSEL_RESET) | \ - SYNTH_SYNTH4_RESET_PRESC_SET(SYNTH_SYNTH4_RESET_PRESC_RESET) | \ - SYNTH_SYNTH4_SDM_DISABLE_SET(SYNTH_SYNTH4_SDM_DISABLE_RESET) | \ - SYNTH_SYNTH4_SDM_MODE_SET(SYNTH_SYNTH4_SDM_MODE_RESET) | \ - SYNTH_SYNTH4_SDM_DITHER_SET(SYNTH_SYNTH4_SDM_DITHER_RESET) | \ - SYNTH_SYNTH4_PSCOUNT_FBSEL_SET(SYNTH_SYNTH4_PSCOUNT_FBSEL_RESET) | \ - SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_SET(SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_RESET) | \ - SYNTH_SYNTH4_SPARE_MISC_SET(SYNTH_SYNTH4_SPARE_MISC_RESET) | \ - SYNTH_SYNTH4_LONGSHIFTSEL_SET(SYNTH_SYNTH4_LONGSHIFTSEL_RESET) | \ - SYNTH_SYNTH4_FORCE_SHIFTREG_SET(SYNTH_SYNTH4_FORCE_SHIFTREG_RESET)) -#define SYNTH_SYNTH4_HW_MASK (32'h0) -#define SYNTH_SYNTH4_SW_MASK (32'h0 | \ - SYNTH_SYNTH4_DIS_LIN_CAPSEARCH_MASK | \ - SYNTH_SYNTH4_DIS_LOSTVC_MASK | \ - SYNTH_SYNTH4_ALWAYS_SHORTR_MASK | \ - SYNTH_SYNTH4_SHORTR_UNTIL_LOCKED_MASK | \ - SYNTH_SYNTH4_FORCE_PINVC_MASK | \ - SYNTH_SYNTH4_FORCE_VCOCAP_MASK | \ - SYNTH_SYNTH4_VCOCAP_OVR_MASK | \ - SYNTH_SYNTH4_VCOCAPPULLUP_MASK | \ - SYNTH_SYNTH4_REFDIVSEL_MASK | \ - SYNTH_SYNTH4_PFDDELAY_MASK | \ - SYNTH_SYNTH4_PFD_DISABLE_MASK | \ - SYNTH_SYNTH4_PRESCSEL_MASK | \ - SYNTH_SYNTH4_RESET_PRESC_MASK | \ - SYNTH_SYNTH4_SDM_DISABLE_MASK | \ - SYNTH_SYNTH4_SDM_MODE_MASK | \ - SYNTH_SYNTH4_SDM_DITHER_MASK | \ - SYNTH_SYNTH4_PSCOUNT_FBSEL_MASK | \ - SYNTH_SYNTH4_SEL_CLKXTAL_EDGE_MASK | \ - SYNTH_SYNTH4_SPARE_MISC_MASK | \ - SYNTH_SYNTH4_LONGSHIFTSEL_MASK | \ - SYNTH_SYNTH4_FORCE_SHIFTREG_MASK) - -#define SYNTH_SYNTH5_ADDRESS 'h00000010 -#define SYNTH_SYNTH5_LOOP_IP0_MSB 31 -#define SYNTH_SYNTH5_LOOP_IP0_LSB 28 -#define SYNTH_SYNTH5_LOOP_IP0_MASK 'hf0000000 -#define SYNTH_SYNTH5_LOOP_IP0_GET(x) (((x) & SYNTH_SYNTH5_LOOP_IP0_MASK) >> SYNTH_SYNTH5_LOOP_IP0_LSB) -#define SYNTH_SYNTH5_LOOP_IP0_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_LOOP_IP0_LSB) & SYNTH_SYNTH5_LOOP_IP0_MASK) -#define SYNTH_SYNTH5_LOOP_IP0_RESET 4'hd -#define SYNTH_SYNTH5_SLOPE_IP_MSB 27 -#define SYNTH_SYNTH5_SLOPE_IP_LSB 25 -#define SYNTH_SYNTH5_SLOPE_IP_MASK 'h0e000000 -#define SYNTH_SYNTH5_SLOPE_IP_GET(x) (((x) & SYNTH_SYNTH5_SLOPE_IP_MASK) >> SYNTH_SYNTH5_SLOPE_IP_LSB) -#define SYNTH_SYNTH5_SLOPE_IP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_SLOPE_IP_LSB) & SYNTH_SYNTH5_SLOPE_IP_MASK) -#define SYNTH_SYNTH5_SLOPE_IP_RESET 3'h0 -#define SYNTH_SYNTH5_CPBIAS_MSB 24 -#define SYNTH_SYNTH5_CPBIAS_LSB 23 -#define SYNTH_SYNTH5_CPBIAS_MASK 'h01800000 -#define SYNTH_SYNTH5_CPBIAS_GET(x) (((x) & SYNTH_SYNTH5_CPBIAS_MASK) >> SYNTH_SYNTH5_CPBIAS_LSB) -#define SYNTH_SYNTH5_CPBIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CPBIAS_LSB) & SYNTH_SYNTH5_CPBIAS_MASK) -#define SYNTH_SYNTH5_CPBIAS_RESET 2'h1 -#define SYNTH_SYNTH5_CPSTEERING_EN_MSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_LSB 22 -#define SYNTH_SYNTH5_CPSTEERING_EN_MASK 'h00400000 -#define SYNTH_SYNTH5_CPSTEERING_EN_GET(x) (((x) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) >> SYNTH_SYNTH5_CPSTEERING_EN_LSB) -#define SYNTH_SYNTH5_CPSTEERING_EN_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CPSTEERING_EN_LSB) & SYNTH_SYNTH5_CPSTEERING_EN_MASK) -#define SYNTH_SYNTH5_CPSTEERING_EN_RESET 1'h0 -#define SYNTH_SYNTH5_CPLOWLK_MSB 21 -#define SYNTH_SYNTH5_CPLOWLK_LSB 21 -#define SYNTH_SYNTH5_CPLOWLK_MASK 'h00200000 -#define SYNTH_SYNTH5_CPLOWLK_GET(x) (((x) & SYNTH_SYNTH5_CPLOWLK_MASK) >> SYNTH_SYNTH5_CPLOWLK_LSB) -#define SYNTH_SYNTH5_CPLOWLK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CPLOWLK_LSB) & SYNTH_SYNTH5_CPLOWLK_MASK) -#define SYNTH_SYNTH5_CPLOWLK_RESET 1'h0 -#define SYNTH_SYNTH5_LOOPLEAKCUR_MSB 20 -#define SYNTH_SYNTH5_LOOPLEAKCUR_LSB 17 -#define SYNTH_SYNTH5_LOOPLEAKCUR_MASK 'h001e0000 -#define SYNTH_SYNTH5_LOOPLEAKCUR_GET(x) (((x) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) >> SYNTH_SYNTH5_LOOPLEAKCUR_LSB) -#define SYNTH_SYNTH5_LOOPLEAKCUR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_LOOPLEAKCUR_LSB) & SYNTH_SYNTH5_LOOPLEAKCUR_MASK) -#define SYNTH_SYNTH5_LOOPLEAKCUR_RESET 4'h0 -#define SYNTH_SYNTH5_CAPRANGE1_MSB 16 -#define SYNTH_SYNTH5_CAPRANGE1_LSB 13 -#define SYNTH_SYNTH5_CAPRANGE1_MASK 'h0001e000 -#define SYNTH_SYNTH5_CAPRANGE1_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE1_MASK) >> SYNTH_SYNTH5_CAPRANGE1_LSB) -#define SYNTH_SYNTH5_CAPRANGE1_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CAPRANGE1_LSB) & SYNTH_SYNTH5_CAPRANGE1_MASK) -#define SYNTH_SYNTH5_CAPRANGE1_RESET 4'h4 -#define SYNTH_SYNTH5_CAPRANGE2_MSB 12 -#define SYNTH_SYNTH5_CAPRANGE2_LSB 9 -#define SYNTH_SYNTH5_CAPRANGE2_MASK 'h00001e00 -#define SYNTH_SYNTH5_CAPRANGE2_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE2_MASK) >> SYNTH_SYNTH5_CAPRANGE2_LSB) -#define SYNTH_SYNTH5_CAPRANGE2_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CAPRANGE2_LSB) & SYNTH_SYNTH5_CAPRANGE2_MASK) -#define SYNTH_SYNTH5_CAPRANGE2_RESET 4'h8 -#define SYNTH_SYNTH5_CAPRANGE3_MSB 8 -#define SYNTH_SYNTH5_CAPRANGE3_LSB 5 -#define SYNTH_SYNTH5_CAPRANGE3_MASK 'h000001e0 -#define SYNTH_SYNTH5_CAPRANGE3_GET(x) (((x) & SYNTH_SYNTH5_CAPRANGE3_MASK) >> SYNTH_SYNTH5_CAPRANGE3_LSB) -#define SYNTH_SYNTH5_CAPRANGE3_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_CAPRANGE3_LSB) & SYNTH_SYNTH5_CAPRANGE3_MASK) -#define SYNTH_SYNTH5_CAPRANGE3_RESET 4'hc -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB 4 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK 'h00000010 -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_LSB) & SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_RESET 1'h0 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MSB 3 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB 2 -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK 'h0000000c -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_GET(x) (((x) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) >> SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_LOBUF5GTUNE_OVR_LSB) & SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK) -#define SYNTH_SYNTH5_LOBUF5GTUNE_OVR_RESET 2'h2 -#define SYNTH_SYNTH5_SPARE_MSB 1 -#define SYNTH_SYNTH5_SPARE_LSB 0 -#define SYNTH_SYNTH5_SPARE_MASK 'h00000003 -#define SYNTH_SYNTH5_SPARE_GET(x) (((x) & SYNTH_SYNTH5_SPARE_MASK) >> SYNTH_SYNTH5_SPARE_LSB) -#define SYNTH_SYNTH5_SPARE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH5_SPARE_LSB) & SYNTH_SYNTH5_SPARE_MASK) -#define SYNTH_SYNTH5_SPARE_RESET 2'h0 -#define SYNTH_SYNTH5_RESET (32'h0 | \ - SYNTH_SYNTH5_LOOP_IP0_SET(SYNTH_SYNTH5_LOOP_IP0_RESET) | \ - SYNTH_SYNTH5_SLOPE_IP_SET(SYNTH_SYNTH5_SLOPE_IP_RESET) | \ - SYNTH_SYNTH5_CPBIAS_SET(SYNTH_SYNTH5_CPBIAS_RESET) | \ - SYNTH_SYNTH5_CPSTEERING_EN_SET(SYNTH_SYNTH5_CPSTEERING_EN_RESET) | \ - SYNTH_SYNTH5_CPLOWLK_SET(SYNTH_SYNTH5_CPLOWLK_RESET) | \ - SYNTH_SYNTH5_LOOPLEAKCUR_SET(SYNTH_SYNTH5_LOOPLEAKCUR_RESET) | \ - SYNTH_SYNTH5_CAPRANGE1_SET(SYNTH_SYNTH5_CAPRANGE1_RESET) | \ - SYNTH_SYNTH5_CAPRANGE2_SET(SYNTH_SYNTH5_CAPRANGE2_RESET) | \ - SYNTH_SYNTH5_CAPRANGE3_SET(SYNTH_SYNTH5_CAPRANGE3_RESET) | \ - SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_SET(SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_RESET) | \ - SYNTH_SYNTH5_LOBUF5GTUNE_OVR_SET(SYNTH_SYNTH5_LOBUF5GTUNE_OVR_RESET) | \ - SYNTH_SYNTH5_SPARE_SET(SYNTH_SYNTH5_SPARE_RESET)) -#define SYNTH_SYNTH5_HW_MASK (32'h0) -#define SYNTH_SYNTH5_SW_MASK (32'h0 | \ - SYNTH_SYNTH5_LOOP_IP0_MASK | \ - SYNTH_SYNTH5_SLOPE_IP_MASK | \ - SYNTH_SYNTH5_CPBIAS_MASK | \ - SYNTH_SYNTH5_CPSTEERING_EN_MASK | \ - SYNTH_SYNTH5_CPLOWLK_MASK | \ - SYNTH_SYNTH5_LOOPLEAKCUR_MASK | \ - SYNTH_SYNTH5_CAPRANGE1_MASK | \ - SYNTH_SYNTH5_CAPRANGE2_MASK | \ - SYNTH_SYNTH5_CAPRANGE3_MASK | \ - SYNTH_SYNTH5_FORCE_LOBUF5GTUNE_MASK | \ - SYNTH_SYNTH5_LOBUF5GTUNE_OVR_MASK | \ - SYNTH_SYNTH5_SPARE_MASK) - -#define SYNTH_SYNTH6_ADDRESS 'h00000014 -#define SYNTH_SYNTH6_IRCP_MSB 31 -#define SYNTH_SYNTH6_IRCP_LSB 29 -#define SYNTH_SYNTH6_IRCP_MASK 'he0000000 -#define SYNTH_SYNTH6_IRCP_GET(x) (((x) & SYNTH_SYNTH6_IRCP_MASK) >> SYNTH_SYNTH6_IRCP_LSB) -#define SYNTH_SYNTH6_IRCP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_IRCP_LSB) & SYNTH_SYNTH6_IRCP_MASK) -#define SYNTH_SYNTH6_IRCP_RESET 3'h4 -#define SYNTH_SYNTH6_IRVCMON_MSB 28 -#define SYNTH_SYNTH6_IRVCMON_LSB 26 -#define SYNTH_SYNTH6_IRVCMON_MASK 'h1c000000 -#define SYNTH_SYNTH6_IRVCMON_GET(x) (((x) & SYNTH_SYNTH6_IRVCMON_MASK) >> SYNTH_SYNTH6_IRVCMON_LSB) -#define SYNTH_SYNTH6_IRVCMON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_IRVCMON_LSB) & SYNTH_SYNTH6_IRVCMON_MASK) -#define SYNTH_SYNTH6_IRVCMON_RESET 3'h4 -#define SYNTH_SYNTH6_IRSPARE_MSB 25 -#define SYNTH_SYNTH6_IRSPARE_LSB 23 -#define SYNTH_SYNTH6_IRSPARE_MASK 'h03800000 -#define SYNTH_SYNTH6_IRSPARE_GET(x) (((x) & SYNTH_SYNTH6_IRSPARE_MASK) >> SYNTH_SYNTH6_IRSPARE_LSB) -#define SYNTH_SYNTH6_IRSPARE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_IRSPARE_LSB) & SYNTH_SYNTH6_IRSPARE_MASK) -#define SYNTH_SYNTH6_IRSPARE_RESET 3'h4 -#define SYNTH_SYNTH6_ICPRESC_MSB 22 -#define SYNTH_SYNTH6_ICPRESC_LSB 20 -#define SYNTH_SYNTH6_ICPRESC_MASK 'h00700000 -#define SYNTH_SYNTH6_ICPRESC_GET(x) (((x) & SYNTH_SYNTH6_ICPRESC_MASK) >> SYNTH_SYNTH6_ICPRESC_LSB) -#define SYNTH_SYNTH6_ICPRESC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICPRESC_LSB) & SYNTH_SYNTH6_ICPRESC_MASK) -#define SYNTH_SYNTH6_ICPRESC_RESET 3'h4 -#define SYNTH_SYNTH6_ICLODIV_MSB 19 -#define SYNTH_SYNTH6_ICLODIV_LSB 17 -#define SYNTH_SYNTH6_ICLODIV_MASK 'h000e0000 -#define SYNTH_SYNTH6_ICLODIV_GET(x) (((x) & SYNTH_SYNTH6_ICLODIV_MASK) >> SYNTH_SYNTH6_ICLODIV_LSB) -#define SYNTH_SYNTH6_ICLODIV_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICLODIV_LSB) & SYNTH_SYNTH6_ICLODIV_MASK) -#define SYNTH_SYNTH6_ICLODIV_RESET 3'h4 -#define SYNTH_SYNTH6_ICLOMIX_MSB 16 -#define SYNTH_SYNTH6_ICLOMIX_LSB 14 -#define SYNTH_SYNTH6_ICLOMIX_MASK 'h0001c000 -#define SYNTH_SYNTH6_ICLOMIX_GET(x) (((x) & SYNTH_SYNTH6_ICLOMIX_MASK) >> SYNTH_SYNTH6_ICLOMIX_LSB) -#define SYNTH_SYNTH6_ICLOMIX_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICLOMIX_LSB) & SYNTH_SYNTH6_ICLOMIX_MASK) -#define SYNTH_SYNTH6_ICLOMIX_RESET 3'h4 -#define SYNTH_SYNTH6_ICSPAREA_MSB 13 -#define SYNTH_SYNTH6_ICSPAREA_LSB 11 -#define SYNTH_SYNTH6_ICSPAREA_MASK 'h00003800 -#define SYNTH_SYNTH6_ICSPAREA_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREA_MASK) >> SYNTH_SYNTH6_ICSPAREA_LSB) -#define SYNTH_SYNTH6_ICSPAREA_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICSPAREA_LSB) & SYNTH_SYNTH6_ICSPAREA_MASK) -#define SYNTH_SYNTH6_ICSPAREA_RESET 3'h4 -#define SYNTH_SYNTH6_ICSPAREB_MSB 10 -#define SYNTH_SYNTH6_ICSPAREB_LSB 8 -#define SYNTH_SYNTH6_ICSPAREB_MASK 'h00000700 -#define SYNTH_SYNTH6_ICSPAREB_GET(x) (((x) & SYNTH_SYNTH6_ICSPAREB_MASK) >> SYNTH_SYNTH6_ICSPAREB_LSB) -#define SYNTH_SYNTH6_ICSPAREB_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICSPAREB_LSB) & SYNTH_SYNTH6_ICSPAREB_MASK) -#define SYNTH_SYNTH6_ICSPAREB_RESET 3'h4 -#define SYNTH_SYNTH6_ICVCO_MSB 7 -#define SYNTH_SYNTH6_ICVCO_LSB 5 -#define SYNTH_SYNTH6_ICVCO_MASK 'h000000e0 -#define SYNTH_SYNTH6_ICVCO_GET(x) (((x) & SYNTH_SYNTH6_ICVCO_MASK) >> SYNTH_SYNTH6_ICVCO_LSB) -#define SYNTH_SYNTH6_ICVCO_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_ICVCO_LSB) & SYNTH_SYNTH6_ICVCO_MASK) -#define SYNTH_SYNTH6_ICVCO_RESET 3'h4 -#define SYNTH_SYNTH6_VCOBUFBIAS_MSB 4 -#define SYNTH_SYNTH6_VCOBUFBIAS_LSB 3 -#define SYNTH_SYNTH6_VCOBUFBIAS_MASK 'h00000018 -#define SYNTH_SYNTH6_VCOBUFBIAS_GET(x) (((x) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) >> SYNTH_SYNTH6_VCOBUFBIAS_LSB) -#define SYNTH_SYNTH6_VCOBUFBIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_VCOBUFBIAS_LSB) & SYNTH_SYNTH6_VCOBUFBIAS_MASK) -#define SYNTH_SYNTH6_VCOBUFBIAS_RESET 2'h2 -#define SYNTH_SYNTH6_SPARE_BIAS_MSB 2 -#define SYNTH_SYNTH6_SPARE_BIAS_LSB 0 -#define SYNTH_SYNTH6_SPARE_BIAS_MASK 'h00000007 -#define SYNTH_SYNTH6_SPARE_BIAS_GET(x) (((x) & SYNTH_SYNTH6_SPARE_BIAS_MASK) >> SYNTH_SYNTH6_SPARE_BIAS_LSB) -#define SYNTH_SYNTH6_SPARE_BIAS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH6_SPARE_BIAS_LSB) & SYNTH_SYNTH6_SPARE_BIAS_MASK) -#define SYNTH_SYNTH6_SPARE_BIAS_RESET 3'h0 -#define SYNTH_SYNTH6_RESET (32'h0 | \ - SYNTH_SYNTH6_IRCP_SET(SYNTH_SYNTH6_IRCP_RESET) | \ - SYNTH_SYNTH6_IRVCMON_SET(SYNTH_SYNTH6_IRVCMON_RESET) | \ - SYNTH_SYNTH6_IRSPARE_SET(SYNTH_SYNTH6_IRSPARE_RESET) | \ - SYNTH_SYNTH6_ICPRESC_SET(SYNTH_SYNTH6_ICPRESC_RESET) | \ - SYNTH_SYNTH6_ICLODIV_SET(SYNTH_SYNTH6_ICLODIV_RESET) | \ - SYNTH_SYNTH6_ICLOMIX_SET(SYNTH_SYNTH6_ICLOMIX_RESET) | \ - SYNTH_SYNTH6_ICSPAREA_SET(SYNTH_SYNTH6_ICSPAREA_RESET) | \ - SYNTH_SYNTH6_ICSPAREB_SET(SYNTH_SYNTH6_ICSPAREB_RESET) | \ - SYNTH_SYNTH6_ICVCO_SET(SYNTH_SYNTH6_ICVCO_RESET) | \ - SYNTH_SYNTH6_VCOBUFBIAS_SET(SYNTH_SYNTH6_VCOBUFBIAS_RESET) | \ - SYNTH_SYNTH6_SPARE_BIAS_SET(SYNTH_SYNTH6_SPARE_BIAS_RESET)) -#define SYNTH_SYNTH6_HW_MASK (32'h0) -#define SYNTH_SYNTH6_SW_MASK (32'h0 | \ - SYNTH_SYNTH6_IRCP_MASK | \ - SYNTH_SYNTH6_IRVCMON_MASK | \ - SYNTH_SYNTH6_IRSPARE_MASK | \ - SYNTH_SYNTH6_ICPRESC_MASK | \ - SYNTH_SYNTH6_ICLODIV_MASK | \ - SYNTH_SYNTH6_ICLOMIX_MASK | \ - SYNTH_SYNTH6_ICSPAREA_MASK | \ - SYNTH_SYNTH6_ICSPAREB_MASK | \ - SYNTH_SYNTH6_ICVCO_MASK | \ - SYNTH_SYNTH6_VCOBUFBIAS_MASK | \ - SYNTH_SYNTH6_SPARE_BIAS_MASK) - -#define SYNTH_SYNTH7_ADDRESS 'h00000018 -#define SYNTH_SYNTH7_SYNTH_ON_MSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_LSB 31 -#define SYNTH_SYNTH7_SYNTH_ON_MASK 'h80000000 -#define SYNTH_SYNTH7_SYNTH_ON_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_ON_MASK) >> SYNTH_SYNTH7_SYNTH_ON_LSB) -#define SYNTH_SYNTH7_SYNTH_ON_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SYNTH_ON_LSB) & SYNTH_SYNTH7_SYNTH_ON_MASK) -#define SYNTH_SYNTH7_SYNTH_ON_RESET 1'h0 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MSB 30 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_LSB 27 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_MASK 'h78000000 -#define SYNTH_SYNTH7_SYNTH_SM_STATE_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) >> SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SYNTH_SM_STATE_LSB) & SYNTH_SYNTH7_SYNTH_SM_STATE_MASK) -#define SYNTH_SYNTH7_SYNTH_SM_STATE_RESET 4'h0 -#define SYNTH_SYNTH7_CAP_SEARCH_MSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_LSB 26 -#define SYNTH_SYNTH7_CAP_SEARCH_MASK 'h04000000 -#define SYNTH_SYNTH7_CAP_SEARCH_GET(x) (((x) & SYNTH_SYNTH7_CAP_SEARCH_MASK) >> SYNTH_SYNTH7_CAP_SEARCH_LSB) -#define SYNTH_SYNTH7_CAP_SEARCH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_CAP_SEARCH_LSB) & SYNTH_SYNTH7_CAP_SEARCH_MASK) -#define SYNTH_SYNTH7_CAP_SEARCH_RESET 1'h0 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB 25 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK 'h02000000 -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_GET(x) (((x) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) >> SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_LSB) & SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK) -#define SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_RESET 1'h0 -#define SYNTH_SYNTH7_PIN_VC_MSB 24 -#define SYNTH_SYNTH7_PIN_VC_LSB 24 -#define SYNTH_SYNTH7_PIN_VC_MASK 'h01000000 -#define SYNTH_SYNTH7_PIN_VC_GET(x) (((x) & SYNTH_SYNTH7_PIN_VC_MASK) >> SYNTH_SYNTH7_PIN_VC_LSB) -#define SYNTH_SYNTH7_PIN_VC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_PIN_VC_LSB) & SYNTH_SYNTH7_PIN_VC_MASK) -#define SYNTH_SYNTH7_PIN_VC_RESET 1'h0 -#define SYNTH_SYNTH7_VCO_CAP_ST_MSB 23 -#define SYNTH_SYNTH7_VCO_CAP_ST_LSB 16 -#define SYNTH_SYNTH7_VCO_CAP_ST_MASK 'h00ff0000 -#define SYNTH_SYNTH7_VCO_CAP_ST_GET(x) (((x) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) >> SYNTH_SYNTH7_VCO_CAP_ST_LSB) -#define SYNTH_SYNTH7_VCO_CAP_ST_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_VCO_CAP_ST_LSB) & SYNTH_SYNTH7_VCO_CAP_ST_MASK) -#define SYNTH_SYNTH7_VCO_CAP_ST_RESET 8'h0 -#define SYNTH_SYNTH7_SHORT_R_MSB 15 -#define SYNTH_SYNTH7_SHORT_R_LSB 15 -#define SYNTH_SYNTH7_SHORT_R_MASK 'h00008000 -#define SYNTH_SYNTH7_SHORT_R_GET(x) (((x) & SYNTH_SYNTH7_SHORT_R_MASK) >> SYNTH_SYNTH7_SHORT_R_LSB) -#define SYNTH_SYNTH7_SHORT_R_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SHORT_R_LSB) & SYNTH_SYNTH7_SHORT_R_MASK) -#define SYNTH_SYNTH7_SHORT_R_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_RFD_MSB 14 -#define SYNTH_SYNTH7_RESET_RFD_LSB 14 -#define SYNTH_SYNTH7_RESET_RFD_MASK 'h00004000 -#define SYNTH_SYNTH7_RESET_RFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_RFD_MASK) >> SYNTH_SYNTH7_RESET_RFD_LSB) -#define SYNTH_SYNTH7_RESET_RFD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_RFD_LSB) & SYNTH_SYNTH7_RESET_RFD_MASK) -#define SYNTH_SYNTH7_RESET_RFD_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_PFD_MSB 13 -#define SYNTH_SYNTH7_RESET_PFD_LSB 13 -#define SYNTH_SYNTH7_RESET_PFD_MASK 'h00002000 -#define SYNTH_SYNTH7_RESET_PFD_GET(x) (((x) & SYNTH_SYNTH7_RESET_PFD_MASK) >> SYNTH_SYNTH7_RESET_PFD_LSB) -#define SYNTH_SYNTH7_RESET_PFD_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_PFD_LSB) & SYNTH_SYNTH7_RESET_PFD_MASK) -#define SYNTH_SYNTH7_RESET_PFD_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB 12 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK 'h00001000 -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_GET(x) (((x) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) >> SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_PSCOUNTERS_LSB) & SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK) -#define SYNTH_SYNTH7_RESET_PSCOUNTERS_RESET 1'h0 -#define SYNTH_SYNTH7_RESET_SDM_B_MSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_LSB 11 -#define SYNTH_SYNTH7_RESET_SDM_B_MASK 'h00000800 -#define SYNTH_SYNTH7_RESET_SDM_B_GET(x) (((x) & SYNTH_SYNTH7_RESET_SDM_B_MASK) >> SYNTH_SYNTH7_RESET_SDM_B_LSB) -#define SYNTH_SYNTH7_RESET_SDM_B_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_RESET_SDM_B_LSB) & SYNTH_SYNTH7_RESET_SDM_B_MASK) -#define SYNTH_SYNTH7_RESET_SDM_B_RESET 1'h0 -#define SYNTH_SYNTH7_VC2HIGH_MSB 10 -#define SYNTH_SYNTH7_VC2HIGH_LSB 10 -#define SYNTH_SYNTH7_VC2HIGH_MASK 'h00000400 -#define SYNTH_SYNTH7_VC2HIGH_GET(x) (((x) & SYNTH_SYNTH7_VC2HIGH_MASK) >> SYNTH_SYNTH7_VC2HIGH_LSB) -#define SYNTH_SYNTH7_VC2HIGH_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_VC2HIGH_LSB) & SYNTH_SYNTH7_VC2HIGH_MASK) -#define SYNTH_SYNTH7_VC2HIGH_RESET 1'h0 -#define SYNTH_SYNTH7_VC2LOW_MSB 9 -#define SYNTH_SYNTH7_VC2LOW_LSB 9 -#define SYNTH_SYNTH7_VC2LOW_MASK 'h00000200 -#define SYNTH_SYNTH7_VC2LOW_GET(x) (((x) & SYNTH_SYNTH7_VC2LOW_MASK) >> SYNTH_SYNTH7_VC2LOW_LSB) -#define SYNTH_SYNTH7_VC2LOW_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_VC2LOW_LSB) & SYNTH_SYNTH7_VC2LOW_MASK) -#define SYNTH_SYNTH7_VC2LOW_RESET 1'h0 -#define SYNTH_SYNTH7_LOOP_IP_MSB 8 -#define SYNTH_SYNTH7_LOOP_IP_LSB 5 -#define SYNTH_SYNTH7_LOOP_IP_MASK 'h000001e0 -#define SYNTH_SYNTH7_LOOP_IP_GET(x) (((x) & SYNTH_SYNTH7_LOOP_IP_MASK) >> SYNTH_SYNTH7_LOOP_IP_LSB) -#define SYNTH_SYNTH7_LOOP_IP_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_LOOP_IP_LSB) & SYNTH_SYNTH7_LOOP_IP_MASK) -#define SYNTH_SYNTH7_LOOP_IP_RESET 4'h0 -#define SYNTH_SYNTH7_LOBUF5GTUNE_MSB 4 -#define SYNTH_SYNTH7_LOBUF5GTUNE_LSB 3 -#define SYNTH_SYNTH7_LOBUF5GTUNE_MASK 'h00000018 -#define SYNTH_SYNTH7_LOBUF5GTUNE_GET(x) (((x) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) >> SYNTH_SYNTH7_LOBUF5GTUNE_LSB) -#define SYNTH_SYNTH7_LOBUF5GTUNE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_LOBUF5GTUNE_LSB) & SYNTH_SYNTH7_LOBUF5GTUNE_MASK) -#define SYNTH_SYNTH7_LOBUF5GTUNE_RESET 2'h0 -#define SYNTH_SYNTH7_SPARE_READ_MSB 2 -#define SYNTH_SYNTH7_SPARE_READ_LSB 0 -#define SYNTH_SYNTH7_SPARE_READ_MASK 'h00000007 -#define SYNTH_SYNTH7_SPARE_READ_GET(x) (((x) & SYNTH_SYNTH7_SPARE_READ_MASK) >> SYNTH_SYNTH7_SPARE_READ_LSB) -#define SYNTH_SYNTH7_SPARE_READ_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH7_SPARE_READ_LSB) & SYNTH_SYNTH7_SPARE_READ_MASK) -#define SYNTH_SYNTH7_SPARE_READ_RESET 3'h0 -#define SYNTH_SYNTH7_RESET (32'h0 | \ - SYNTH_SYNTH7_SYNTH_ON_SET(SYNTH_SYNTH7_SYNTH_ON_RESET) | \ - SYNTH_SYNTH7_SYNTH_SM_STATE_SET(SYNTH_SYNTH7_SYNTH_SM_STATE_RESET) | \ - SYNTH_SYNTH7_CAP_SEARCH_SET(SYNTH_SYNTH7_CAP_SEARCH_RESET) | \ - SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_SET(SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_RESET) | \ - SYNTH_SYNTH7_PIN_VC_SET(SYNTH_SYNTH7_PIN_VC_RESET) | \ - SYNTH_SYNTH7_VCO_CAP_ST_SET(SYNTH_SYNTH7_VCO_CAP_ST_RESET) | \ - SYNTH_SYNTH7_SHORT_R_SET(SYNTH_SYNTH7_SHORT_R_RESET) | \ - SYNTH_SYNTH7_RESET_RFD_SET(SYNTH_SYNTH7_RESET_RFD_RESET) | \ - SYNTH_SYNTH7_RESET_PFD_SET(SYNTH_SYNTH7_RESET_PFD_RESET) | \ - SYNTH_SYNTH7_RESET_PSCOUNTERS_SET(SYNTH_SYNTH7_RESET_PSCOUNTERS_RESET) | \ - SYNTH_SYNTH7_RESET_SDM_B_SET(SYNTH_SYNTH7_RESET_SDM_B_RESET) | \ - SYNTH_SYNTH7_VC2HIGH_SET(SYNTH_SYNTH7_VC2HIGH_RESET) | \ - SYNTH_SYNTH7_VC2LOW_SET(SYNTH_SYNTH7_VC2LOW_RESET) | \ - SYNTH_SYNTH7_LOOP_IP_SET(SYNTH_SYNTH7_LOOP_IP_RESET) | \ - SYNTH_SYNTH7_LOBUF5GTUNE_SET(SYNTH_SYNTH7_LOBUF5GTUNE_RESET) | \ - SYNTH_SYNTH7_SPARE_READ_SET(SYNTH_SYNTH7_SPARE_READ_RESET)) -#define SYNTH_SYNTH7_HW_MASK (32'h0 | \ - SYNTH_SYNTH7_SYNTH_ON_MASK | \ - SYNTH_SYNTH7_SYNTH_SM_STATE_MASK | \ - SYNTH_SYNTH7_CAP_SEARCH_MASK | \ - SYNTH_SYNTH7_SYNTH_LOCK_VC_OK_MASK | \ - SYNTH_SYNTH7_PIN_VC_MASK | \ - SYNTH_SYNTH7_VCO_CAP_ST_MASK | \ - SYNTH_SYNTH7_SHORT_R_MASK | \ - SYNTH_SYNTH7_RESET_RFD_MASK | \ - SYNTH_SYNTH7_RESET_PFD_MASK | \ - SYNTH_SYNTH7_RESET_PSCOUNTERS_MASK | \ - SYNTH_SYNTH7_RESET_SDM_B_MASK | \ - SYNTH_SYNTH7_VC2HIGH_MASK | \ - SYNTH_SYNTH7_VC2LOW_MASK | \ - SYNTH_SYNTH7_LOOP_IP_MASK | \ - SYNTH_SYNTH7_LOBUF5GTUNE_MASK | \ - SYNTH_SYNTH7_SPARE_READ_MASK) -#define SYNTH_SYNTH7_SW_MASK (32'h0) - -#define SYNTH_SYNTH8_ADDRESS 'h0000001c -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB 31 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK 'h80000000 -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_GET(x) (((x) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) >> SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_LOADSYNTHCHANNEL_LSB) & SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK) -#define SYNTH_SYNTH8_LOADSYNTHCHANNEL_RESET 1'h0 -#define SYNTH_SYNTH8_FRACMODE_MSB 30 -#define SYNTH_SYNTH8_FRACMODE_LSB 30 -#define SYNTH_SYNTH8_FRACMODE_MASK 'h40000000 -#define SYNTH_SYNTH8_FRACMODE_GET(x) (((x) & SYNTH_SYNTH8_FRACMODE_MASK) >> SYNTH_SYNTH8_FRACMODE_LSB) -#define SYNTH_SYNTH8_FRACMODE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_FRACMODE_LSB) & SYNTH_SYNTH8_FRACMODE_MASK) -#define SYNTH_SYNTH8_FRACMODE_RESET 1'h0 -#define SYNTH_SYNTH8_AMODEREFSEL_MSB 29 -#define SYNTH_SYNTH8_AMODEREFSEL_LSB 28 -#define SYNTH_SYNTH8_AMODEREFSEL_MASK 'h30000000 -#define SYNTH_SYNTH8_AMODEREFSEL_GET(x) (((x) & SYNTH_SYNTH8_AMODEREFSEL_MASK) >> SYNTH_SYNTH8_AMODEREFSEL_LSB) -#define SYNTH_SYNTH8_AMODEREFSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_AMODEREFSEL_LSB) & SYNTH_SYNTH8_AMODEREFSEL_MASK) -#define SYNTH_SYNTH8_AMODEREFSEL_RESET 2'h0 -#define SYNTH_SYNTH8_SPARE_MSB 27 -#define SYNTH_SYNTH8_SPARE_LSB 27 -#define SYNTH_SYNTH8_SPARE_MASK 'h08000000 -#define SYNTH_SYNTH8_SPARE_GET(x) (((x) & SYNTH_SYNTH8_SPARE_MASK) >> SYNTH_SYNTH8_SPARE_LSB) -#define SYNTH_SYNTH8_SPARE_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_SPARE_LSB) & SYNTH_SYNTH8_SPARE_MASK) -#define SYNTH_SYNTH8_SPARE_RESET 1'h0 -#define SYNTH_SYNTH8_CHANSEL_MSB 26 -#define SYNTH_SYNTH8_CHANSEL_LSB 18 -#define SYNTH_SYNTH8_CHANSEL_MASK 'h07fc0000 -#define SYNTH_SYNTH8_CHANSEL_GET(x) (((x) & SYNTH_SYNTH8_CHANSEL_MASK) >> SYNTH_SYNTH8_CHANSEL_LSB) -#define SYNTH_SYNTH8_CHANSEL_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_CHANSEL_LSB) & SYNTH_SYNTH8_CHANSEL_MASK) -#define SYNTH_SYNTH8_CHANSEL_RESET 9'h0 -#define SYNTH_SYNTH8_CHANFRAC_MSB 17 -#define SYNTH_SYNTH8_CHANFRAC_LSB 1 -#define SYNTH_SYNTH8_CHANFRAC_MASK 'h0003fffe -#define SYNTH_SYNTH8_CHANFRAC_GET(x) (((x) & SYNTH_SYNTH8_CHANFRAC_MASK) >> SYNTH_SYNTH8_CHANFRAC_LSB) -#define SYNTH_SYNTH8_CHANFRAC_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_CHANFRAC_LSB) & SYNTH_SYNTH8_CHANFRAC_MASK) -#define SYNTH_SYNTH8_CHANFRAC_RESET 17'h0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_MSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_LSB 0 -#define SYNTH_SYNTH8_FORCE_FRACLSB_MASK 'h00000001 -#define SYNTH_SYNTH8_FORCE_FRACLSB_GET(x) (((x) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) >> SYNTH_SYNTH8_FORCE_FRACLSB_LSB) -#define SYNTH_SYNTH8_FORCE_FRACLSB_SET(x) (((32'd0 | (x)) << SYNTH_SYNTH8_FORCE_FRACLSB_LSB) & SYNTH_SYNTH8_FORCE_FRACLSB_MASK) -#define SYNTH_SYNTH8_FORCE_FRACLSB_RESET 1'h0 -#define SYNTH_SYNTH8_RESET (32'h0 | \ - SYNTH_SYNTH8_LOADSYNTHCHANNEL_SET(SYNTH_SYNTH8_LOADSYNTHCHANNEL_RESET) | \ - SYNTH_SYNTH8_FRACMODE_SET(SYNTH_SYNTH8_FRACMODE_RESET) | \ - SYNTH_SYNTH8_AMODEREFSEL_SET(SYNTH_SYNTH8_AMODEREFSEL_RESET) | \ - SYNTH_SYNTH8_SPARE_SET(SYNTH_SYNTH8_SPARE_RESET) | \ - SYNTH_SYNTH8_CHANSEL_SET(SYNTH_SYNTH8_CHANSEL_RESET) | \ - SYNTH_SYNTH8_CHANFRAC_SET(SYNTH_SYNTH8_CHANFRAC_RESET) | \ - SYNTH_SYNTH8_FORCE_FRACLSB_SET(SYNTH_SYNTH8_FORCE_FRACLSB_RESET)) -#define SYNTH_SYNTH8_HW_MASK (32'h0 | \ - SYNTH_SYNTH8_FRACMODE_MASK | \ - SYNTH_SYNTH8_AMODEREFSEL_MASK | \ - SYNTH_SYNTH8_SPARE_MASK | \ - SYNTH_SYNTH8_CHANSEL_MASK | \ - SYNTH_SYNTH8_CHANFRAC_MASK) -#define SYNTH_SYNTH8_SW_MASK (32'h0 | \ - SYNTH_SYNTH8_LOADSYNTHCHANNEL_MASK | \ - SYNTH_SYNTH8_FRACMODE_MASK | \ - SYNTH_SYNTH8_AMODEREFSEL_MASK | \ - SYNTH_SYNTH8_SPARE_MASK | \ - SYNTH_SYNTH8_CHANSEL_MASK | \ - SYNTH_SYNTH8_CHANFRAC_MASK | \ - SYNTH_SYNTH8_FORCE_FRACLSB_MASK) - -#define SYNTH_REG_ADDRESS_MSB 4 - -#endif /* _SYNTH_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/top_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/top_reg.h deleted file mode 100644 index 14ed9bfdcb6d..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/top_reg.h +++ /dev/null @@ -1,235 +0,0 @@ -#ifndef _TOP_REG_REG_H_ -#define _TOP_REG_REG_H_ - -#define TOP_GAIN_ADDRESS 0x00000000 -#define TOP_GAIN_OFFSET 0x00000000 -#define TOP_GAIN_TX6DBLOQGAIN_MSB 31 -#define TOP_GAIN_TX6DBLOQGAIN_LSB 30 -#define TOP_GAIN_TX6DBLOQGAIN_MASK 0xc0000000 -#define TOP_GAIN_TX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX6DBLOQGAIN_MASK) >> TOP_GAIN_TX6DBLOQGAIN_LSB) -#define TOP_GAIN_TX6DBLOQGAIN_SET(x) (((x) << TOP_GAIN_TX6DBLOQGAIN_LSB) & TOP_GAIN_TX6DBLOQGAIN_MASK) -#define TOP_GAIN_TX1DBLOQGAIN_MSB 29 -#define TOP_GAIN_TX1DBLOQGAIN_LSB 27 -#define TOP_GAIN_TX1DBLOQGAIN_MASK 0x38000000 -#define TOP_GAIN_TX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX1DBLOQGAIN_MASK) >> TOP_GAIN_TX1DBLOQGAIN_LSB) -#define TOP_GAIN_TX1DBLOQGAIN_SET(x) (((x) << TOP_GAIN_TX1DBLOQGAIN_LSB) & TOP_GAIN_TX1DBLOQGAIN_MASK) -#define TOP_GAIN_TXV2IGAIN_MSB 26 -#define TOP_GAIN_TXV2IGAIN_LSB 25 -#define TOP_GAIN_TXV2IGAIN_MASK 0x06000000 -#define TOP_GAIN_TXV2IGAIN_GET(x) (((x) & TOP_GAIN_TXV2IGAIN_MASK) >> TOP_GAIN_TXV2IGAIN_LSB) -#define TOP_GAIN_TXV2IGAIN_SET(x) (((x) << TOP_GAIN_TXV2IGAIN_LSB) & TOP_GAIN_TXV2IGAIN_MASK) -#define TOP_GAIN_PABUF5GN_MSB 24 -#define TOP_GAIN_PABUF5GN_LSB 24 -#define TOP_GAIN_PABUF5GN_MASK 0x01000000 -#define TOP_GAIN_PABUF5GN_GET(x) (((x) & TOP_GAIN_PABUF5GN_MASK) >> TOP_GAIN_PABUF5GN_LSB) -#define TOP_GAIN_PABUF5GN_SET(x) (((x) << TOP_GAIN_PABUF5GN_LSB) & TOP_GAIN_PABUF5GN_MASK) -#define TOP_GAIN_PADRVGN_MSB 23 -#define TOP_GAIN_PADRVGN_LSB 21 -#define TOP_GAIN_PADRVGN_MASK 0x00e00000 -#define TOP_GAIN_PADRVGN_GET(x) (((x) & TOP_GAIN_PADRVGN_MASK) >> TOP_GAIN_PADRVGN_LSB) -#define TOP_GAIN_PADRVGN_SET(x) (((x) << TOP_GAIN_PADRVGN_LSB) & TOP_GAIN_PADRVGN_MASK) -#define TOP_GAIN_PAOUT2GN_MSB 20 -#define TOP_GAIN_PAOUT2GN_LSB 18 -#define TOP_GAIN_PAOUT2GN_MASK 0x001c0000 -#define TOP_GAIN_PAOUT2GN_GET(x) (((x) & TOP_GAIN_PAOUT2GN_MASK) >> TOP_GAIN_PAOUT2GN_LSB) -#define TOP_GAIN_PAOUT2GN_SET(x) (((x) << TOP_GAIN_PAOUT2GN_LSB) & TOP_GAIN_PAOUT2GN_MASK) -#define TOP_GAIN_LNAON_MSB 17 -#define TOP_GAIN_LNAON_LSB 17 -#define TOP_GAIN_LNAON_MASK 0x00020000 -#define TOP_GAIN_LNAON_GET(x) (((x) & TOP_GAIN_LNAON_MASK) >> TOP_GAIN_LNAON_LSB) -#define TOP_GAIN_LNAON_SET(x) (((x) << TOP_GAIN_LNAON_LSB) & TOP_GAIN_LNAON_MASK) -#define TOP_GAIN_LNAGAIN_MSB 16 -#define TOP_GAIN_LNAGAIN_LSB 13 -#define TOP_GAIN_LNAGAIN_MASK 0x0001e000 -#define TOP_GAIN_LNAGAIN_GET(x) (((x) & TOP_GAIN_LNAGAIN_MASK) >> TOP_GAIN_LNAGAIN_LSB) -#define TOP_GAIN_LNAGAIN_SET(x) (((x) << TOP_GAIN_LNAGAIN_LSB) & TOP_GAIN_LNAGAIN_MASK) -#define TOP_GAIN_RFVGA5GAIN_MSB 12 -#define TOP_GAIN_RFVGA5GAIN_LSB 11 -#define TOP_GAIN_RFVGA5GAIN_MASK 0x00001800 -#define TOP_GAIN_RFVGA5GAIN_GET(x) (((x) & TOP_GAIN_RFVGA5GAIN_MASK) >> TOP_GAIN_RFVGA5GAIN_LSB) -#define TOP_GAIN_RFVGA5GAIN_SET(x) (((x) << TOP_GAIN_RFVGA5GAIN_LSB) & TOP_GAIN_RFVGA5GAIN_MASK) -#define TOP_GAIN_RFGMGN_MSB 10 -#define TOP_GAIN_RFGMGN_LSB 8 -#define TOP_GAIN_RFGMGN_MASK 0x00000700 -#define TOP_GAIN_RFGMGN_GET(x) (((x) & TOP_GAIN_RFGMGN_MASK) >> TOP_GAIN_RFGMGN_LSB) -#define TOP_GAIN_RFGMGN_SET(x) (((x) << TOP_GAIN_RFGMGN_LSB) & TOP_GAIN_RFGMGN_MASK) -#define TOP_GAIN_RX6DBLOQGAIN_MSB 7 -#define TOP_GAIN_RX6DBLOQGAIN_LSB 6 -#define TOP_GAIN_RX6DBLOQGAIN_MASK 0x000000c0 -#define TOP_GAIN_RX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBLOQGAIN_MASK) >> TOP_GAIN_RX6DBLOQGAIN_LSB) -#define TOP_GAIN_RX6DBLOQGAIN_SET(x) (((x) << TOP_GAIN_RX6DBLOQGAIN_LSB) & TOP_GAIN_RX6DBLOQGAIN_MASK) -#define TOP_GAIN_RX1DBLOQGAIN_MSB 5 -#define TOP_GAIN_RX1DBLOQGAIN_LSB 3 -#define TOP_GAIN_RX1DBLOQGAIN_MASK 0x00000038 -#define TOP_GAIN_RX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX1DBLOQGAIN_MASK) >> TOP_GAIN_RX1DBLOQGAIN_LSB) -#define TOP_GAIN_RX1DBLOQGAIN_SET(x) (((x) << TOP_GAIN_RX1DBLOQGAIN_LSB) & TOP_GAIN_RX1DBLOQGAIN_MASK) -#define TOP_GAIN_RX6DBHIQGAIN_MSB 2 -#define TOP_GAIN_RX6DBHIQGAIN_LSB 1 -#define TOP_GAIN_RX6DBHIQGAIN_MASK 0x00000006 -#define TOP_GAIN_RX6DBHIQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBHIQGAIN_MASK) >> TOP_GAIN_RX6DBHIQGAIN_LSB) -#define TOP_GAIN_RX6DBHIQGAIN_SET(x) (((x) << TOP_GAIN_RX6DBHIQGAIN_LSB) & TOP_GAIN_RX6DBHIQGAIN_MASK) -#define TOP_GAIN_SPARE_MSB 0 -#define TOP_GAIN_SPARE_LSB 0 -#define TOP_GAIN_SPARE_MASK 0x00000001 -#define TOP_GAIN_SPARE_GET(x) (((x) & TOP_GAIN_SPARE_MASK) >> TOP_GAIN_SPARE_LSB) -#define TOP_GAIN_SPARE_SET(x) (((x) << TOP_GAIN_SPARE_LSB) & TOP_GAIN_SPARE_MASK) - -#define TOP_TOP_ADDRESS 0x00000004 -#define TOP_TOP_OFFSET 0x00000004 -#define TOP_TOP_LOCALTXGAIN_MSB 31 -#define TOP_TOP_LOCALTXGAIN_LSB 31 -#define TOP_TOP_LOCALTXGAIN_MASK 0x80000000 -#define TOP_TOP_LOCALTXGAIN_GET(x) (((x) & TOP_TOP_LOCALTXGAIN_MASK) >> TOP_TOP_LOCALTXGAIN_LSB) -#define TOP_TOP_LOCALTXGAIN_SET(x) (((x) << TOP_TOP_LOCALTXGAIN_LSB) & TOP_TOP_LOCALTXGAIN_MASK) -#define TOP_TOP_LOCALRXGAIN_MSB 30 -#define TOP_TOP_LOCALRXGAIN_LSB 30 -#define TOP_TOP_LOCALRXGAIN_MASK 0x40000000 -#define TOP_TOP_LOCALRXGAIN_GET(x) (((x) & TOP_TOP_LOCALRXGAIN_MASK) >> TOP_TOP_LOCALRXGAIN_LSB) -#define TOP_TOP_LOCALRXGAIN_SET(x) (((x) << TOP_TOP_LOCALRXGAIN_LSB) & TOP_TOP_LOCALRXGAIN_MASK) -#define TOP_TOP_LOCALMODE_MSB 29 -#define TOP_TOP_LOCALMODE_LSB 29 -#define TOP_TOP_LOCALMODE_MASK 0x20000000 -#define TOP_TOP_LOCALMODE_GET(x) (((x) & TOP_TOP_LOCALMODE_MASK) >> TOP_TOP_LOCALMODE_LSB) -#define TOP_TOP_LOCALMODE_SET(x) (((x) << TOP_TOP_LOCALMODE_LSB) & TOP_TOP_LOCALMODE_MASK) -#define TOP_TOP_CALFC_MSB 28 -#define TOP_TOP_CALFC_LSB 28 -#define TOP_TOP_CALFC_MASK 0x10000000 -#define TOP_TOP_CALFC_GET(x) (((x) & TOP_TOP_CALFC_MASK) >> TOP_TOP_CALFC_LSB) -#define TOP_TOP_CALFC_SET(x) (((x) << TOP_TOP_CALFC_LSB) & TOP_TOP_CALFC_MASK) -#define TOP_TOP_CALDC_MSB 27 -#define TOP_TOP_CALDC_LSB 27 -#define TOP_TOP_CALDC_MASK 0x08000000 -#define TOP_TOP_CALDC_GET(x) (((x) & TOP_TOP_CALDC_MASK) >> TOP_TOP_CALDC_LSB) -#define TOP_TOP_CALDC_SET(x) (((x) << TOP_TOP_CALDC_LSB) & TOP_TOP_CALDC_MASK) -#define TOP_TOP_CAL_RESIDUE_MSB 26 -#define TOP_TOP_CAL_RESIDUE_LSB 26 -#define TOP_TOP_CAL_RESIDUE_MASK 0x04000000 -#define TOP_TOP_CAL_RESIDUE_GET(x) (((x) & TOP_TOP_CAL_RESIDUE_MASK) >> TOP_TOP_CAL_RESIDUE_LSB) -#define TOP_TOP_CAL_RESIDUE_SET(x) (((x) << TOP_TOP_CAL_RESIDUE_LSB) & TOP_TOP_CAL_RESIDUE_MASK) -#define TOP_TOP_BMODE_MSB 25 -#define TOP_TOP_BMODE_LSB 25 -#define TOP_TOP_BMODE_MASK 0x02000000 -#define TOP_TOP_BMODE_GET(x) (((x) & TOP_TOP_BMODE_MASK) >> TOP_TOP_BMODE_LSB) -#define TOP_TOP_BMODE_SET(x) (((x) << TOP_TOP_BMODE_LSB) & TOP_TOP_BMODE_MASK) -#define TOP_TOP_SYNTHON_MSB 24 -#define TOP_TOP_SYNTHON_LSB 24 -#define TOP_TOP_SYNTHON_MASK 0x01000000 -#define TOP_TOP_SYNTHON_GET(x) (((x) & TOP_TOP_SYNTHON_MASK) >> TOP_TOP_SYNTHON_LSB) -#define TOP_TOP_SYNTHON_SET(x) (((x) << TOP_TOP_SYNTHON_LSB) & TOP_TOP_SYNTHON_MASK) -#define TOP_TOP_RXON_MSB 23 -#define TOP_TOP_RXON_LSB 23 -#define TOP_TOP_RXON_MASK 0x00800000 -#define TOP_TOP_RXON_GET(x) (((x) & TOP_TOP_RXON_MASK) >> TOP_TOP_RXON_LSB) -#define TOP_TOP_RXON_SET(x) (((x) << TOP_TOP_RXON_LSB) & TOP_TOP_RXON_MASK) -#define TOP_TOP_TXON_MSB 22 -#define TOP_TOP_TXON_LSB 22 -#define TOP_TOP_TXON_MASK 0x00400000 -#define TOP_TOP_TXON_GET(x) (((x) & TOP_TOP_TXON_MASK) >> TOP_TOP_TXON_LSB) -#define TOP_TOP_TXON_SET(x) (((x) << TOP_TOP_TXON_LSB) & TOP_TOP_TXON_MASK) -#define TOP_TOP_PAON_MSB 21 -#define TOP_TOP_PAON_LSB 21 -#define TOP_TOP_PAON_MASK 0x00200000 -#define TOP_TOP_PAON_GET(x) (((x) & TOP_TOP_PAON_MASK) >> TOP_TOP_PAON_LSB) -#define TOP_TOP_PAON_SET(x) (((x) << TOP_TOP_PAON_LSB) & TOP_TOP_PAON_MASK) -#define TOP_TOP_CALTX_MSB 20 -#define TOP_TOP_CALTX_LSB 20 -#define TOP_TOP_CALTX_MASK 0x00100000 -#define TOP_TOP_CALTX_GET(x) (((x) & TOP_TOP_CALTX_MASK) >> TOP_TOP_CALTX_LSB) -#define TOP_TOP_CALTX_SET(x) (((x) << TOP_TOP_CALTX_LSB) & TOP_TOP_CALTX_MASK) -#define TOP_TOP_LOCALADDAC_MSB 19 -#define TOP_TOP_LOCALADDAC_LSB 19 -#define TOP_TOP_LOCALADDAC_MASK 0x00080000 -#define TOP_TOP_LOCALADDAC_GET(x) (((x) & TOP_TOP_LOCALADDAC_MASK) >> TOP_TOP_LOCALADDAC_LSB) -#define TOP_TOP_LOCALADDAC_SET(x) (((x) << TOP_TOP_LOCALADDAC_LSB) & TOP_TOP_LOCALADDAC_MASK) -#define TOP_TOP_PWDPLL_MSB 18 -#define TOP_TOP_PWDPLL_LSB 18 -#define TOP_TOP_PWDPLL_MASK 0x00040000 -#define TOP_TOP_PWDPLL_GET(x) (((x) & TOP_TOP_PWDPLL_MASK) >> TOP_TOP_PWDPLL_LSB) -#define TOP_TOP_PWDPLL_SET(x) (((x) << TOP_TOP_PWDPLL_LSB) & TOP_TOP_PWDPLL_MASK) -#define TOP_TOP_PWDADC_MSB 17 -#define TOP_TOP_PWDADC_LSB 17 -#define TOP_TOP_PWDADC_MASK 0x00020000 -#define TOP_TOP_PWDADC_GET(x) (((x) & TOP_TOP_PWDADC_MASK) >> TOP_TOP_PWDADC_LSB) -#define TOP_TOP_PWDADC_SET(x) (((x) << TOP_TOP_PWDADC_LSB) & TOP_TOP_PWDADC_MASK) -#define TOP_TOP_PWDDAC_MSB 16 -#define TOP_TOP_PWDDAC_LSB 16 -#define TOP_TOP_PWDDAC_MASK 0x00010000 -#define TOP_TOP_PWDDAC_GET(x) (((x) & TOP_TOP_PWDDAC_MASK) >> TOP_TOP_PWDDAC_LSB) -#define TOP_TOP_PWDDAC_SET(x) (((x) << TOP_TOP_PWDDAC_LSB) & TOP_TOP_PWDDAC_MASK) -#define TOP_TOP_LOCALXTAL_MSB 15 -#define TOP_TOP_LOCALXTAL_LSB 15 -#define TOP_TOP_LOCALXTAL_MASK 0x00008000 -#define TOP_TOP_LOCALXTAL_GET(x) (((x) & TOP_TOP_LOCALXTAL_MASK) >> TOP_TOP_LOCALXTAL_LSB) -#define TOP_TOP_LOCALXTAL_SET(x) (((x) << TOP_TOP_LOCALXTAL_LSB) & TOP_TOP_LOCALXTAL_MASK) -#define TOP_TOP_PWDCLKIN_MSB 14 -#define TOP_TOP_PWDCLKIN_LSB 14 -#define TOP_TOP_PWDCLKIN_MASK 0x00004000 -#define TOP_TOP_PWDCLKIN_GET(x) (((x) & TOP_TOP_PWDCLKIN_MASK) >> TOP_TOP_PWDCLKIN_LSB) -#define TOP_TOP_PWDCLKIN_SET(x) (((x) << TOP_TOP_PWDCLKIN_LSB) & TOP_TOP_PWDCLKIN_MASK) -#define TOP_TOP_OSCON_MSB 13 -#define TOP_TOP_OSCON_LSB 13 -#define TOP_TOP_OSCON_MASK 0x00002000 -#define TOP_TOP_OSCON_GET(x) (((x) & TOP_TOP_OSCON_MASK) >> TOP_TOP_OSCON_LSB) -#define TOP_TOP_OSCON_SET(x) (((x) << TOP_TOP_OSCON_LSB) & TOP_TOP_OSCON_MASK) -#define TOP_TOP_SCLKEN_FORCE_MSB 12 -#define TOP_TOP_SCLKEN_FORCE_LSB 12 -#define TOP_TOP_SCLKEN_FORCE_MASK 0x00001000 -#define TOP_TOP_SCLKEN_FORCE_GET(x) (((x) & TOP_TOP_SCLKEN_FORCE_MASK) >> TOP_TOP_SCLKEN_FORCE_LSB) -#define TOP_TOP_SCLKEN_FORCE_SET(x) (((x) << TOP_TOP_SCLKEN_FORCE_LSB) & TOP_TOP_SCLKEN_FORCE_MASK) -#define TOP_TOP_SYNTHON_FORCE_MSB 11 -#define TOP_TOP_SYNTHON_FORCE_LSB 11 -#define TOP_TOP_SYNTHON_FORCE_MASK 0x00000800 -#define TOP_TOP_SYNTHON_FORCE_GET(x) (((x) & TOP_TOP_SYNTHON_FORCE_MASK) >> TOP_TOP_SYNTHON_FORCE_LSB) -#define TOP_TOP_SYNTHON_FORCE_SET(x) (((x) << TOP_TOP_SYNTHON_FORCE_LSB) & TOP_TOP_SYNTHON_FORCE_MASK) -#define TOP_TOP_PDBIAS_MSB 10 -#define TOP_TOP_PDBIAS_LSB 10 -#define TOP_TOP_PDBIAS_MASK 0x00000400 -#define TOP_TOP_PDBIAS_GET(x) (((x) & TOP_TOP_PDBIAS_MASK) >> TOP_TOP_PDBIAS_LSB) -#define TOP_TOP_PDBIAS_SET(x) (((x) << TOP_TOP_PDBIAS_LSB) & TOP_TOP_PDBIAS_MASK) -#define TOP_TOP_DATAOUTSEL_MSB 9 -#define TOP_TOP_DATAOUTSEL_LSB 8 -#define TOP_TOP_DATAOUTSEL_MASK 0x00000300 -#define TOP_TOP_DATAOUTSEL_GET(x) (((x) & TOP_TOP_DATAOUTSEL_MASK) >> TOP_TOP_DATAOUTSEL_LSB) -#define TOP_TOP_DATAOUTSEL_SET(x) (((x) << TOP_TOP_DATAOUTSEL_LSB) & TOP_TOP_DATAOUTSEL_MASK) -#define TOP_TOP_REVID_MSB 7 -#define TOP_TOP_REVID_LSB 5 -#define TOP_TOP_REVID_MASK 0x000000e0 -#define TOP_TOP_REVID_GET(x) (((x) & TOP_TOP_REVID_MASK) >> TOP_TOP_REVID_LSB) -#define TOP_TOP_REVID_SET(x) (((x) << TOP_TOP_REVID_LSB) & TOP_TOP_REVID_MASK) -#define TOP_TOP_INT2PAD_MSB 4 -#define TOP_TOP_INT2PAD_LSB 4 -#define TOP_TOP_INT2PAD_MASK 0x00000010 -#define TOP_TOP_INT2PAD_GET(x) (((x) & TOP_TOP_INT2PAD_MASK) >> TOP_TOP_INT2PAD_LSB) -#define TOP_TOP_INT2PAD_SET(x) (((x) << TOP_TOP_INT2PAD_LSB) & TOP_TOP_INT2PAD_MASK) -#define TOP_TOP_INTH2PAD_MSB 3 -#define TOP_TOP_INTH2PAD_LSB 3 -#define TOP_TOP_INTH2PAD_MASK 0x00000008 -#define TOP_TOP_INTH2PAD_GET(x) (((x) & TOP_TOP_INTH2PAD_MASK) >> TOP_TOP_INTH2PAD_LSB) -#define TOP_TOP_INTH2PAD_SET(x) (((x) << TOP_TOP_INTH2PAD_LSB) & TOP_TOP_INTH2PAD_MASK) -#define TOP_TOP_PAD2GND_MSB 2 -#define TOP_TOP_PAD2GND_LSB 2 -#define TOP_TOP_PAD2GND_MASK 0x00000004 -#define TOP_TOP_PAD2GND_GET(x) (((x) & TOP_TOP_PAD2GND_MASK) >> TOP_TOP_PAD2GND_LSB) -#define TOP_TOP_PAD2GND_SET(x) (((x) << TOP_TOP_PAD2GND_LSB) & TOP_TOP_PAD2GND_MASK) -#define TOP_TOP_INT2GND_MSB 1 -#define TOP_TOP_INT2GND_LSB 1 -#define TOP_TOP_INT2GND_MASK 0x00000002 -#define TOP_TOP_INT2GND_GET(x) (((x) & TOP_TOP_INT2GND_MASK) >> TOP_TOP_INT2GND_LSB) -#define TOP_TOP_INT2GND_SET(x) (((x) << TOP_TOP_INT2GND_LSB) & TOP_TOP_INT2GND_MASK) -#define TOP_TOP_FORCE_XPAON_MSB 0 -#define TOP_TOP_FORCE_XPAON_LSB 0 -#define TOP_TOP_FORCE_XPAON_MASK 0x00000001 -#define TOP_TOP_FORCE_XPAON_GET(x) (((x) & TOP_TOP_FORCE_XPAON_MASK) >> TOP_TOP_FORCE_XPAON_LSB) -#define TOP_TOP_FORCE_XPAON_SET(x) (((x) << TOP_TOP_FORCE_XPAON_LSB) & TOP_TOP_FORCE_XPAON_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct top_reg_reg_s { - volatile unsigned int top_gain; - volatile unsigned int top_top; -} top_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _TOP_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/top_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/top_reg.vrh deleted file mode 100644 index 8641cc058ea1..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/top_reg.vrh +++ /dev/null @@ -1,388 +0,0 @@ -#ifndef _TOP_REG_VRH_ -#define _TOP_REG_VRH_ - -#define TOP_GAIN_ADDRESS 'h00000000 -#define TOP_GAIN_TX6DBLOQGAIN_MSB 31 -#define TOP_GAIN_TX6DBLOQGAIN_LSB 30 -#define TOP_GAIN_TX6DBLOQGAIN_MASK 'hc0000000 -#define TOP_GAIN_TX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX6DBLOQGAIN_MASK) >> TOP_GAIN_TX6DBLOQGAIN_LSB) -#define TOP_GAIN_TX6DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_TX6DBLOQGAIN_LSB) & TOP_GAIN_TX6DBLOQGAIN_MASK) -#define TOP_GAIN_TX6DBLOQGAIN_RESET 2'h3 -#define TOP_GAIN_TX1DBLOQGAIN_MSB 29 -#define TOP_GAIN_TX1DBLOQGAIN_LSB 27 -#define TOP_GAIN_TX1DBLOQGAIN_MASK 'h38000000 -#define TOP_GAIN_TX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_TX1DBLOQGAIN_MASK) >> TOP_GAIN_TX1DBLOQGAIN_LSB) -#define TOP_GAIN_TX1DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_TX1DBLOQGAIN_LSB) & TOP_GAIN_TX1DBLOQGAIN_MASK) -#define TOP_GAIN_TX1DBLOQGAIN_RESET 3'h6 -#define TOP_GAIN_TXV2IGAIN_MSB 26 -#define TOP_GAIN_TXV2IGAIN_LSB 25 -#define TOP_GAIN_TXV2IGAIN_MASK 'h06000000 -#define TOP_GAIN_TXV2IGAIN_GET(x) (((x) & TOP_GAIN_TXV2IGAIN_MASK) >> TOP_GAIN_TXV2IGAIN_LSB) -#define TOP_GAIN_TXV2IGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_TXV2IGAIN_LSB) & TOP_GAIN_TXV2IGAIN_MASK) -#define TOP_GAIN_TXV2IGAIN_RESET 2'h3 -#define TOP_GAIN_PABUF5GN_MSB 24 -#define TOP_GAIN_PABUF5GN_LSB 24 -#define TOP_GAIN_PABUF5GN_MASK 'h01000000 -#define TOP_GAIN_PABUF5GN_GET(x) (((x) & TOP_GAIN_PABUF5GN_MASK) >> TOP_GAIN_PABUF5GN_LSB) -#define TOP_GAIN_PABUF5GN_SET(x) (((32'd0 | (x)) << TOP_GAIN_PABUF5GN_LSB) & TOP_GAIN_PABUF5GN_MASK) -#define TOP_GAIN_PABUF5GN_RESET 1'h1 -#define TOP_GAIN_PADRVGN_MSB 23 -#define TOP_GAIN_PADRVGN_LSB 21 -#define TOP_GAIN_PADRVGN_MASK 'h00e00000 -#define TOP_GAIN_PADRVGN_GET(x) (((x) & TOP_GAIN_PADRVGN_MASK) >> TOP_GAIN_PADRVGN_LSB) -#define TOP_GAIN_PADRVGN_SET(x) (((32'd0 | (x)) << TOP_GAIN_PADRVGN_LSB) & TOP_GAIN_PADRVGN_MASK) -#define TOP_GAIN_PADRVGN_RESET 3'h7 -#define TOP_GAIN_PAOUT2GN_MSB 20 -#define TOP_GAIN_PAOUT2GN_LSB 18 -#define TOP_GAIN_PAOUT2GN_MASK 'h001c0000 -#define TOP_GAIN_PAOUT2GN_GET(x) (((x) & TOP_GAIN_PAOUT2GN_MASK) >> TOP_GAIN_PAOUT2GN_LSB) -#define TOP_GAIN_PAOUT2GN_SET(x) (((32'd0 | (x)) << TOP_GAIN_PAOUT2GN_LSB) & TOP_GAIN_PAOUT2GN_MASK) -#define TOP_GAIN_PAOUT2GN_RESET 3'h7 -#define TOP_GAIN_LNAON_MSB 17 -#define TOP_GAIN_LNAON_LSB 17 -#define TOP_GAIN_LNAON_MASK 'h00020000 -#define TOP_GAIN_LNAON_GET(x) (((x) & TOP_GAIN_LNAON_MASK) >> TOP_GAIN_LNAON_LSB) -#define TOP_GAIN_LNAON_SET(x) (((32'd0 | (x)) << TOP_GAIN_LNAON_LSB) & TOP_GAIN_LNAON_MASK) -#define TOP_GAIN_LNAON_RESET 1'h1 -#define TOP_GAIN_LNAGAIN_MSB 16 -#define TOP_GAIN_LNAGAIN_LSB 13 -#define TOP_GAIN_LNAGAIN_MASK 'h0001e000 -#define TOP_GAIN_LNAGAIN_GET(x) (((x) & TOP_GAIN_LNAGAIN_MASK) >> TOP_GAIN_LNAGAIN_LSB) -#define TOP_GAIN_LNAGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_LNAGAIN_LSB) & TOP_GAIN_LNAGAIN_MASK) -#define TOP_GAIN_LNAGAIN_RESET 4'hf -#define TOP_GAIN_RFVGA5GAIN_MSB 12 -#define TOP_GAIN_RFVGA5GAIN_LSB 11 -#define TOP_GAIN_RFVGA5GAIN_MASK 'h00001800 -#define TOP_GAIN_RFVGA5GAIN_GET(x) (((x) & TOP_GAIN_RFVGA5GAIN_MASK) >> TOP_GAIN_RFVGA5GAIN_LSB) -#define TOP_GAIN_RFVGA5GAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RFVGA5GAIN_LSB) & TOP_GAIN_RFVGA5GAIN_MASK) -#define TOP_GAIN_RFVGA5GAIN_RESET 2'h3 -#define TOP_GAIN_RFGMGN_MSB 10 -#define TOP_GAIN_RFGMGN_LSB 8 -#define TOP_GAIN_RFGMGN_MASK 'h00000700 -#define TOP_GAIN_RFGMGN_GET(x) (((x) & TOP_GAIN_RFGMGN_MASK) >> TOP_GAIN_RFGMGN_LSB) -#define TOP_GAIN_RFGMGN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RFGMGN_LSB) & TOP_GAIN_RFGMGN_MASK) -#define TOP_GAIN_RFGMGN_RESET 3'h7 -#define TOP_GAIN_RX6DBLOQGAIN_MSB 7 -#define TOP_GAIN_RX6DBLOQGAIN_LSB 6 -#define TOP_GAIN_RX6DBLOQGAIN_MASK 'h000000c0 -#define TOP_GAIN_RX6DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBLOQGAIN_MASK) >> TOP_GAIN_RX6DBLOQGAIN_LSB) -#define TOP_GAIN_RX6DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RX6DBLOQGAIN_LSB) & TOP_GAIN_RX6DBLOQGAIN_MASK) -#define TOP_GAIN_RX6DBLOQGAIN_RESET 2'h3 -#define TOP_GAIN_RX1DBLOQGAIN_MSB 5 -#define TOP_GAIN_RX1DBLOQGAIN_LSB 3 -#define TOP_GAIN_RX1DBLOQGAIN_MASK 'h00000038 -#define TOP_GAIN_RX1DBLOQGAIN_GET(x) (((x) & TOP_GAIN_RX1DBLOQGAIN_MASK) >> TOP_GAIN_RX1DBLOQGAIN_LSB) -#define TOP_GAIN_RX1DBLOQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RX1DBLOQGAIN_LSB) & TOP_GAIN_RX1DBLOQGAIN_MASK) -#define TOP_GAIN_RX1DBLOQGAIN_RESET 3'h6 -#define TOP_GAIN_RX6DBHIQGAIN_MSB 2 -#define TOP_GAIN_RX6DBHIQGAIN_LSB 1 -#define TOP_GAIN_RX6DBHIQGAIN_MASK 'h00000006 -#define TOP_GAIN_RX6DBHIQGAIN_GET(x) (((x) & TOP_GAIN_RX6DBHIQGAIN_MASK) >> TOP_GAIN_RX6DBHIQGAIN_LSB) -#define TOP_GAIN_RX6DBHIQGAIN_SET(x) (((32'd0 | (x)) << TOP_GAIN_RX6DBHIQGAIN_LSB) & TOP_GAIN_RX6DBHIQGAIN_MASK) -#define TOP_GAIN_RX6DBHIQGAIN_RESET 2'h3 -#define TOP_GAIN_SPARE_MSB 0 -#define TOP_GAIN_SPARE_LSB 0 -#define TOP_GAIN_SPARE_MASK 'h00000001 -#define TOP_GAIN_SPARE_GET(x) (((x) & TOP_GAIN_SPARE_MASK) >> TOP_GAIN_SPARE_LSB) -#define TOP_GAIN_SPARE_SET(x) (((32'd0 | (x)) << TOP_GAIN_SPARE_LSB) & TOP_GAIN_SPARE_MASK) -#define TOP_GAIN_SPARE_RESET 1'h0 -#define TOP_GAIN_RESET (32'h0 | \ - TOP_GAIN_TX6DBLOQGAIN_SET(TOP_GAIN_TX6DBLOQGAIN_RESET) | \ - TOP_GAIN_TX1DBLOQGAIN_SET(TOP_GAIN_TX1DBLOQGAIN_RESET) | \ - TOP_GAIN_TXV2IGAIN_SET(TOP_GAIN_TXV2IGAIN_RESET) | \ - TOP_GAIN_PABUF5GN_SET(TOP_GAIN_PABUF5GN_RESET) | \ - TOP_GAIN_PADRVGN_SET(TOP_GAIN_PADRVGN_RESET) | \ - TOP_GAIN_PAOUT2GN_SET(TOP_GAIN_PAOUT2GN_RESET) | \ - TOP_GAIN_LNAON_SET(TOP_GAIN_LNAON_RESET) | \ - TOP_GAIN_LNAGAIN_SET(TOP_GAIN_LNAGAIN_RESET) | \ - TOP_GAIN_RFVGA5GAIN_SET(TOP_GAIN_RFVGA5GAIN_RESET) | \ - TOP_GAIN_RFGMGN_SET(TOP_GAIN_RFGMGN_RESET) | \ - TOP_GAIN_RX6DBLOQGAIN_SET(TOP_GAIN_RX6DBLOQGAIN_RESET) | \ - TOP_GAIN_RX1DBLOQGAIN_SET(TOP_GAIN_RX1DBLOQGAIN_RESET) | \ - TOP_GAIN_RX6DBHIQGAIN_SET(TOP_GAIN_RX6DBHIQGAIN_RESET) | \ - TOP_GAIN_SPARE_SET(TOP_GAIN_SPARE_RESET)) -#define TOP_GAIN_HW_MASK (32'h0 | \ - TOP_GAIN_TX6DBLOQGAIN_MASK | \ - TOP_GAIN_TX1DBLOQGAIN_MASK | \ - TOP_GAIN_TXV2IGAIN_MASK | \ - TOP_GAIN_PABUF5GN_MASK | \ - TOP_GAIN_PADRVGN_MASK | \ - TOP_GAIN_PAOUT2GN_MASK | \ - TOP_GAIN_LNAON_MASK | \ - TOP_GAIN_LNAGAIN_MASK | \ - TOP_GAIN_RFVGA5GAIN_MASK | \ - TOP_GAIN_RFGMGN_MASK | \ - TOP_GAIN_RX6DBLOQGAIN_MASK | \ - TOP_GAIN_RX1DBLOQGAIN_MASK | \ - TOP_GAIN_RX6DBHIQGAIN_MASK | \ - TOP_GAIN_SPARE_MASK) -#define TOP_GAIN_SW_MASK (32'h0 | \ - TOP_GAIN_TX6DBLOQGAIN_MASK | \ - TOP_GAIN_TX1DBLOQGAIN_MASK | \ - TOP_GAIN_TXV2IGAIN_MASK | \ - TOP_GAIN_PABUF5GN_MASK | \ - TOP_GAIN_PADRVGN_MASK | \ - TOP_GAIN_PAOUT2GN_MASK | \ - TOP_GAIN_LNAON_MASK | \ - TOP_GAIN_LNAGAIN_MASK | \ - TOP_GAIN_RFVGA5GAIN_MASK | \ - TOP_GAIN_RFGMGN_MASK | \ - TOP_GAIN_RX6DBLOQGAIN_MASK | \ - TOP_GAIN_RX1DBLOQGAIN_MASK | \ - TOP_GAIN_RX6DBHIQGAIN_MASK | \ - TOP_GAIN_SPARE_MASK) - -#define TOP_TOP_ADDRESS 'h00000004 -#define TOP_TOP_LOCALTXGAIN_MSB 31 -#define TOP_TOP_LOCALTXGAIN_LSB 31 -#define TOP_TOP_LOCALTXGAIN_MASK 'h80000000 -#define TOP_TOP_LOCALTXGAIN_GET(x) (((x) & TOP_TOP_LOCALTXGAIN_MASK) >> TOP_TOP_LOCALTXGAIN_LSB) -#define TOP_TOP_LOCALTXGAIN_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALTXGAIN_LSB) & TOP_TOP_LOCALTXGAIN_MASK) -#define TOP_TOP_LOCALTXGAIN_RESET 1'h0 -#define TOP_TOP_LOCALRXGAIN_MSB 30 -#define TOP_TOP_LOCALRXGAIN_LSB 30 -#define TOP_TOP_LOCALRXGAIN_MASK 'h40000000 -#define TOP_TOP_LOCALRXGAIN_GET(x) (((x) & TOP_TOP_LOCALRXGAIN_MASK) >> TOP_TOP_LOCALRXGAIN_LSB) -#define TOP_TOP_LOCALRXGAIN_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALRXGAIN_LSB) & TOP_TOP_LOCALRXGAIN_MASK) -#define TOP_TOP_LOCALRXGAIN_RESET 1'h0 -#define TOP_TOP_LOCALMODE_MSB 29 -#define TOP_TOP_LOCALMODE_LSB 29 -#define TOP_TOP_LOCALMODE_MASK 'h20000000 -#define TOP_TOP_LOCALMODE_GET(x) (((x) & TOP_TOP_LOCALMODE_MASK) >> TOP_TOP_LOCALMODE_LSB) -#define TOP_TOP_LOCALMODE_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALMODE_LSB) & TOP_TOP_LOCALMODE_MASK) -#define TOP_TOP_LOCALMODE_RESET 1'h0 -#define TOP_TOP_CALFC_MSB 28 -#define TOP_TOP_CALFC_LSB 28 -#define TOP_TOP_CALFC_MASK 'h10000000 -#define TOP_TOP_CALFC_GET(x) (((x) & TOP_TOP_CALFC_MASK) >> TOP_TOP_CALFC_LSB) -#define TOP_TOP_CALFC_SET(x) (((32'd0 | (x)) << TOP_TOP_CALFC_LSB) & TOP_TOP_CALFC_MASK) -#define TOP_TOP_CALFC_RESET 1'h0 -#define TOP_TOP_CALDC_MSB 27 -#define TOP_TOP_CALDC_LSB 27 -#define TOP_TOP_CALDC_MASK 'h08000000 -#define TOP_TOP_CALDC_GET(x) (((x) & TOP_TOP_CALDC_MASK) >> TOP_TOP_CALDC_LSB) -#define TOP_TOP_CALDC_SET(x) (((32'd0 | (x)) << TOP_TOP_CALDC_LSB) & TOP_TOP_CALDC_MASK) -#define TOP_TOP_CALDC_RESET 1'h0 -#define TOP_TOP_CAL_RESIDUE_MSB 26 -#define TOP_TOP_CAL_RESIDUE_LSB 26 -#define TOP_TOP_CAL_RESIDUE_MASK 'h04000000 -#define TOP_TOP_CAL_RESIDUE_GET(x) (((x) & TOP_TOP_CAL_RESIDUE_MASK) >> TOP_TOP_CAL_RESIDUE_LSB) -#define TOP_TOP_CAL_RESIDUE_SET(x) (((32'd0 | (x)) << TOP_TOP_CAL_RESIDUE_LSB) & TOP_TOP_CAL_RESIDUE_MASK) -#define TOP_TOP_CAL_RESIDUE_RESET 1'h0 -#define TOP_TOP_BMODE_MSB 25 -#define TOP_TOP_BMODE_LSB 25 -#define TOP_TOP_BMODE_MASK 'h02000000 -#define TOP_TOP_BMODE_GET(x) (((x) & TOP_TOP_BMODE_MASK) >> TOP_TOP_BMODE_LSB) -#define TOP_TOP_BMODE_SET(x) (((32'd0 | (x)) << TOP_TOP_BMODE_LSB) & TOP_TOP_BMODE_MASK) -#define TOP_TOP_BMODE_RESET 1'h1 -#define TOP_TOP_SYNTHON_MSB 24 -#define TOP_TOP_SYNTHON_LSB 24 -#define TOP_TOP_SYNTHON_MASK 'h01000000 -#define TOP_TOP_SYNTHON_GET(x) (((x) & TOP_TOP_SYNTHON_MASK) >> TOP_TOP_SYNTHON_LSB) -#define TOP_TOP_SYNTHON_SET(x) (((32'd0 | (x)) << TOP_TOP_SYNTHON_LSB) & TOP_TOP_SYNTHON_MASK) -#define TOP_TOP_SYNTHON_RESET 1'h0 -#define TOP_TOP_RXON_MSB 23 -#define TOP_TOP_RXON_LSB 23 -#define TOP_TOP_RXON_MASK 'h00800000 -#define TOP_TOP_RXON_GET(x) (((x) & TOP_TOP_RXON_MASK) >> TOP_TOP_RXON_LSB) -#define TOP_TOP_RXON_SET(x) (((32'd0 | (x)) << TOP_TOP_RXON_LSB) & TOP_TOP_RXON_MASK) -#define TOP_TOP_RXON_RESET 1'h0 -#define TOP_TOP_TXON_MSB 22 -#define TOP_TOP_TXON_LSB 22 -#define TOP_TOP_TXON_MASK 'h00400000 -#define TOP_TOP_TXON_GET(x) (((x) & TOP_TOP_TXON_MASK) >> TOP_TOP_TXON_LSB) -#define TOP_TOP_TXON_SET(x) (((32'd0 | (x)) << TOP_TOP_TXON_LSB) & TOP_TOP_TXON_MASK) -#define TOP_TOP_TXON_RESET 1'h0 -#define TOP_TOP_PAON_MSB 21 -#define TOP_TOP_PAON_LSB 21 -#define TOP_TOP_PAON_MASK 'h00200000 -#define TOP_TOP_PAON_GET(x) (((x) & TOP_TOP_PAON_MASK) >> TOP_TOP_PAON_LSB) -#define TOP_TOP_PAON_SET(x) (((32'd0 | (x)) << TOP_TOP_PAON_LSB) & TOP_TOP_PAON_MASK) -#define TOP_TOP_PAON_RESET 1'h0 -#define TOP_TOP_CALTX_MSB 20 -#define TOP_TOP_CALTX_LSB 20 -#define TOP_TOP_CALTX_MASK 'h00100000 -#define TOP_TOP_CALTX_GET(x) (((x) & TOP_TOP_CALTX_MASK) >> TOP_TOP_CALTX_LSB) -#define TOP_TOP_CALTX_SET(x) (((32'd0 | (x)) << TOP_TOP_CALTX_LSB) & TOP_TOP_CALTX_MASK) -#define TOP_TOP_CALTX_RESET 1'h0 -#define TOP_TOP_LOCALADDAC_MSB 19 -#define TOP_TOP_LOCALADDAC_LSB 19 -#define TOP_TOP_LOCALADDAC_MASK 'h00080000 -#define TOP_TOP_LOCALADDAC_GET(x) (((x) & TOP_TOP_LOCALADDAC_MASK) >> TOP_TOP_LOCALADDAC_LSB) -#define TOP_TOP_LOCALADDAC_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALADDAC_LSB) & TOP_TOP_LOCALADDAC_MASK) -#define TOP_TOP_LOCALADDAC_RESET 1'h0 -#define TOP_TOP_PWDPLL_MSB 18 -#define TOP_TOP_PWDPLL_LSB 18 -#define TOP_TOP_PWDPLL_MASK 'h00040000 -#define TOP_TOP_PWDPLL_GET(x) (((x) & TOP_TOP_PWDPLL_MASK) >> TOP_TOP_PWDPLL_LSB) -#define TOP_TOP_PWDPLL_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDPLL_LSB) & TOP_TOP_PWDPLL_MASK) -#define TOP_TOP_PWDPLL_RESET 1'h0 -#define TOP_TOP_PWDADC_MSB 17 -#define TOP_TOP_PWDADC_LSB 17 -#define TOP_TOP_PWDADC_MASK 'h00020000 -#define TOP_TOP_PWDADC_GET(x) (((x) & TOP_TOP_PWDADC_MASK) >> TOP_TOP_PWDADC_LSB) -#define TOP_TOP_PWDADC_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDADC_LSB) & TOP_TOP_PWDADC_MASK) -#define TOP_TOP_PWDADC_RESET 1'h0 -#define TOP_TOP_PWDDAC_MSB 16 -#define TOP_TOP_PWDDAC_LSB 16 -#define TOP_TOP_PWDDAC_MASK 'h00010000 -#define TOP_TOP_PWDDAC_GET(x) (((x) & TOP_TOP_PWDDAC_MASK) >> TOP_TOP_PWDDAC_LSB) -#define TOP_TOP_PWDDAC_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDDAC_LSB) & TOP_TOP_PWDDAC_MASK) -#define TOP_TOP_PWDDAC_RESET 1'h0 -#define TOP_TOP_LOCALXTAL_MSB 15 -#define TOP_TOP_LOCALXTAL_LSB 15 -#define TOP_TOP_LOCALXTAL_MASK 'h00008000 -#define TOP_TOP_LOCALXTAL_GET(x) (((x) & TOP_TOP_LOCALXTAL_MASK) >> TOP_TOP_LOCALXTAL_LSB) -#define TOP_TOP_LOCALXTAL_SET(x) (((32'd0 | (x)) << TOP_TOP_LOCALXTAL_LSB) & TOP_TOP_LOCALXTAL_MASK) -#define TOP_TOP_LOCALXTAL_RESET 1'h0 -#define TOP_TOP_PWDCLKIN_MSB 14 -#define TOP_TOP_PWDCLKIN_LSB 14 -#define TOP_TOP_PWDCLKIN_MASK 'h00004000 -#define TOP_TOP_PWDCLKIN_GET(x) (((x) & TOP_TOP_PWDCLKIN_MASK) >> TOP_TOP_PWDCLKIN_LSB) -#define TOP_TOP_PWDCLKIN_SET(x) (((32'd0 | (x)) << TOP_TOP_PWDCLKIN_LSB) & TOP_TOP_PWDCLKIN_MASK) -#define TOP_TOP_PWDCLKIN_RESET 1'h0 -#define TOP_TOP_OSCON_MSB 13 -#define TOP_TOP_OSCON_LSB 13 -#define TOP_TOP_OSCON_MASK 'h00002000 -#define TOP_TOP_OSCON_GET(x) (((x) & TOP_TOP_OSCON_MASK) >> TOP_TOP_OSCON_LSB) -#define TOP_TOP_OSCON_SET(x) (((32'd0 | (x)) << TOP_TOP_OSCON_LSB) & TOP_TOP_OSCON_MASK) -#define TOP_TOP_OSCON_RESET 1'h1 -#define TOP_TOP_SCLKEN_FORCE_MSB 12 -#define TOP_TOP_SCLKEN_FORCE_LSB 12 -#define TOP_TOP_SCLKEN_FORCE_MASK 'h00001000 -#define TOP_TOP_SCLKEN_FORCE_GET(x) (((x) & TOP_TOP_SCLKEN_FORCE_MASK) >> TOP_TOP_SCLKEN_FORCE_LSB) -#define TOP_TOP_SCLKEN_FORCE_SET(x) (((32'd0 | (x)) << TOP_TOP_SCLKEN_FORCE_LSB) & TOP_TOP_SCLKEN_FORCE_MASK) -#define TOP_TOP_SCLKEN_FORCE_RESET 1'h0 -#define TOP_TOP_SYNTHON_FORCE_MSB 11 -#define TOP_TOP_SYNTHON_FORCE_LSB 11 -#define TOP_TOP_SYNTHON_FORCE_MASK 'h00000800 -#define TOP_TOP_SYNTHON_FORCE_GET(x) (((x) & TOP_TOP_SYNTHON_FORCE_MASK) >> TOP_TOP_SYNTHON_FORCE_LSB) -#define TOP_TOP_SYNTHON_FORCE_SET(x) (((32'd0 | (x)) << TOP_TOP_SYNTHON_FORCE_LSB) & TOP_TOP_SYNTHON_FORCE_MASK) -#define TOP_TOP_SYNTHON_FORCE_RESET 1'h0 -#define TOP_TOP_PDBIAS_MSB 10 -#define TOP_TOP_PDBIAS_LSB 10 -#define TOP_TOP_PDBIAS_MASK 'h00000400 -#define TOP_TOP_PDBIAS_GET(x) (((x) & TOP_TOP_PDBIAS_MASK) >> TOP_TOP_PDBIAS_LSB) -#define TOP_TOP_PDBIAS_SET(x) (((32'd0 | (x)) << TOP_TOP_PDBIAS_LSB) & TOP_TOP_PDBIAS_MASK) -#define TOP_TOP_PDBIAS_RESET 1'h0 -#define TOP_TOP_DATAOUTSEL_MSB 9 -#define TOP_TOP_DATAOUTSEL_LSB 8 -#define TOP_TOP_DATAOUTSEL_MASK 'h00000300 -#define TOP_TOP_DATAOUTSEL_GET(x) (((x) & TOP_TOP_DATAOUTSEL_MASK) >> TOP_TOP_DATAOUTSEL_LSB) -#define TOP_TOP_DATAOUTSEL_SET(x) (((32'd0 | (x)) << TOP_TOP_DATAOUTSEL_LSB) & TOP_TOP_DATAOUTSEL_MASK) -#define TOP_TOP_DATAOUTSEL_RESET 2'h3 -#define TOP_TOP_REVID_MSB 7 -#define TOP_TOP_REVID_LSB 5 -#define TOP_TOP_REVID_MASK 'h000000e0 -#define TOP_TOP_REVID_GET(x) (((x) & TOP_TOP_REVID_MASK) >> TOP_TOP_REVID_LSB) -#define TOP_TOP_REVID_SET(x) (((32'd0 | (x)) << TOP_TOP_REVID_LSB) & TOP_TOP_REVID_MASK) -#define TOP_TOP_REVID_RESET 3'h0 -#define TOP_TOP_INT2PAD_MSB 4 -#define TOP_TOP_INT2PAD_LSB 4 -#define TOP_TOP_INT2PAD_MASK 'h00000010 -#define TOP_TOP_INT2PAD_GET(x) (((x) & TOP_TOP_INT2PAD_MASK) >> TOP_TOP_INT2PAD_LSB) -#define TOP_TOP_INT2PAD_SET(x) (((32'd0 | (x)) << TOP_TOP_INT2PAD_LSB) & TOP_TOP_INT2PAD_MASK) -#define TOP_TOP_INT2PAD_RESET 1'h0 -#define TOP_TOP_INTH2PAD_MSB 3 -#define TOP_TOP_INTH2PAD_LSB 3 -#define TOP_TOP_INTH2PAD_MASK 'h00000008 -#define TOP_TOP_INTH2PAD_GET(x) (((x) & TOP_TOP_INTH2PAD_MASK) >> TOP_TOP_INTH2PAD_LSB) -#define TOP_TOP_INTH2PAD_SET(x) (((32'd0 | (x)) << TOP_TOP_INTH2PAD_LSB) & TOP_TOP_INTH2PAD_MASK) -#define TOP_TOP_INTH2PAD_RESET 1'h0 -#define TOP_TOP_PAD2GND_MSB 2 -#define TOP_TOP_PAD2GND_LSB 2 -#define TOP_TOP_PAD2GND_MASK 'h00000004 -#define TOP_TOP_PAD2GND_GET(x) (((x) & TOP_TOP_PAD2GND_MASK) >> TOP_TOP_PAD2GND_LSB) -#define TOP_TOP_PAD2GND_SET(x) (((32'd0 | (x)) << TOP_TOP_PAD2GND_LSB) & TOP_TOP_PAD2GND_MASK) -#define TOP_TOP_PAD2GND_RESET 1'h0 -#define TOP_TOP_INT2GND_MSB 1 -#define TOP_TOP_INT2GND_LSB 1 -#define TOP_TOP_INT2GND_MASK 'h00000002 -#define TOP_TOP_INT2GND_GET(x) (((x) & TOP_TOP_INT2GND_MASK) >> TOP_TOP_INT2GND_LSB) -#define TOP_TOP_INT2GND_SET(x) (((32'd0 | (x)) << TOP_TOP_INT2GND_LSB) & TOP_TOP_INT2GND_MASK) -#define TOP_TOP_INT2GND_RESET 1'h0 -#define TOP_TOP_FORCE_XPAON_MSB 0 -#define TOP_TOP_FORCE_XPAON_LSB 0 -#define TOP_TOP_FORCE_XPAON_MASK 'h00000001 -#define TOP_TOP_FORCE_XPAON_GET(x) (((x) & TOP_TOP_FORCE_XPAON_MASK) >> TOP_TOP_FORCE_XPAON_LSB) -#define TOP_TOP_FORCE_XPAON_SET(x) (((32'd0 | (x)) << TOP_TOP_FORCE_XPAON_LSB) & TOP_TOP_FORCE_XPAON_MASK) -#define TOP_TOP_FORCE_XPAON_RESET 1'h0 -#define TOP_TOP_RESET (32'h0 | \ - TOP_TOP_LOCALTXGAIN_SET(TOP_TOP_LOCALTXGAIN_RESET) | \ - TOP_TOP_LOCALRXGAIN_SET(TOP_TOP_LOCALRXGAIN_RESET) | \ - TOP_TOP_LOCALMODE_SET(TOP_TOP_LOCALMODE_RESET) | \ - TOP_TOP_CALFC_SET(TOP_TOP_CALFC_RESET) | \ - TOP_TOP_CALDC_SET(TOP_TOP_CALDC_RESET) | \ - TOP_TOP_CAL_RESIDUE_SET(TOP_TOP_CAL_RESIDUE_RESET) | \ - TOP_TOP_BMODE_SET(TOP_TOP_BMODE_RESET) | \ - TOP_TOP_SYNTHON_SET(TOP_TOP_SYNTHON_RESET) | \ - TOP_TOP_RXON_SET(TOP_TOP_RXON_RESET) | \ - TOP_TOP_TXON_SET(TOP_TOP_TXON_RESET) | \ - TOP_TOP_PAON_SET(TOP_TOP_PAON_RESET) | \ - TOP_TOP_CALTX_SET(TOP_TOP_CALTX_RESET) | \ - TOP_TOP_LOCALADDAC_SET(TOP_TOP_LOCALADDAC_RESET) | \ - TOP_TOP_PWDPLL_SET(TOP_TOP_PWDPLL_RESET) | \ - TOP_TOP_PWDADC_SET(TOP_TOP_PWDADC_RESET) | \ - TOP_TOP_PWDDAC_SET(TOP_TOP_PWDDAC_RESET) | \ - TOP_TOP_LOCALXTAL_SET(TOP_TOP_LOCALXTAL_RESET) | \ - TOP_TOP_PWDCLKIN_SET(TOP_TOP_PWDCLKIN_RESET) | \ - TOP_TOP_OSCON_SET(TOP_TOP_OSCON_RESET) | \ - TOP_TOP_SCLKEN_FORCE_SET(TOP_TOP_SCLKEN_FORCE_RESET) | \ - TOP_TOP_SYNTHON_FORCE_SET(TOP_TOP_SYNTHON_FORCE_RESET) | \ - TOP_TOP_PDBIAS_SET(TOP_TOP_PDBIAS_RESET) | \ - TOP_TOP_DATAOUTSEL_SET(TOP_TOP_DATAOUTSEL_RESET) | \ - TOP_TOP_REVID_SET(TOP_TOP_REVID_RESET) | \ - TOP_TOP_INT2PAD_SET(TOP_TOP_INT2PAD_RESET) | \ - TOP_TOP_INTH2PAD_SET(TOP_TOP_INTH2PAD_RESET) | \ - TOP_TOP_PAD2GND_SET(TOP_TOP_PAD2GND_RESET) | \ - TOP_TOP_INT2GND_SET(TOP_TOP_INT2GND_RESET) | \ - TOP_TOP_FORCE_XPAON_SET(TOP_TOP_FORCE_XPAON_RESET)) -#define TOP_TOP_HW_MASK (32'h0 | \ - TOP_TOP_CALFC_MASK | \ - TOP_TOP_CALDC_MASK | \ - TOP_TOP_CAL_RESIDUE_MASK | \ - TOP_TOP_BMODE_MASK | \ - TOP_TOP_SYNTHON_MASK | \ - TOP_TOP_RXON_MASK | \ - TOP_TOP_TXON_MASK | \ - TOP_TOP_PAON_MASK | \ - TOP_TOP_CALTX_MASK | \ - TOP_TOP_PWDPLL_MASK | \ - TOP_TOP_PWDADC_MASK | \ - TOP_TOP_PWDDAC_MASK | \ - TOP_TOP_PWDCLKIN_MASK | \ - TOP_TOP_OSCON_MASK | \ - TOP_TOP_REVID_MASK) -#define TOP_TOP_SW_MASK (32'h0 | \ - TOP_TOP_LOCALTXGAIN_MASK | \ - TOP_TOP_LOCALRXGAIN_MASK | \ - TOP_TOP_LOCALMODE_MASK | \ - TOP_TOP_CALFC_MASK | \ - TOP_TOP_CALDC_MASK | \ - TOP_TOP_CAL_RESIDUE_MASK | \ - TOP_TOP_BMODE_MASK | \ - TOP_TOP_SYNTHON_MASK | \ - TOP_TOP_RXON_MASK | \ - TOP_TOP_TXON_MASK | \ - TOP_TOP_PAON_MASK | \ - TOP_TOP_CALTX_MASK | \ - TOP_TOP_LOCALADDAC_MASK | \ - TOP_TOP_PWDPLL_MASK | \ - TOP_TOP_PWDADC_MASK | \ - TOP_TOP_PWDDAC_MASK | \ - TOP_TOP_LOCALXTAL_MASK | \ - TOP_TOP_PWDCLKIN_MASK | \ - TOP_TOP_OSCON_MASK | \ - TOP_TOP_SCLKEN_FORCE_MASK | \ - TOP_TOP_SYNTHON_FORCE_MASK | \ - TOP_TOP_PDBIAS_MASK | \ - TOP_TOP_DATAOUTSEL_MASK | \ - TOP_TOP_INT2PAD_MASK | \ - TOP_TOP_INTH2PAD_MASK | \ - TOP_TOP_PAD2GND_MASK | \ - TOP_TOP_INT2GND_MASK | \ - TOP_TOP_FORCE_XPAON_MASK) - -#define TOP_REG_ADDRESS_MSB 2 - -#endif /* _TOP_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/txpc_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/txpc_reg.h deleted file mode 100644 index ed2b1260464d..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/txpc_reg.h +++ /dev/null @@ -1,170 +0,0 @@ -#ifndef _TXPC_REG_REG_H_ -#define _TXPC_REG_REG_H_ - -#define TXPC_TXPC_ADDRESS 0x00000000 -#define TXPC_TXPC_OFFSET 0x00000000 -#define TXPC_TXPC_SELINTPD_MSB 31 -#define TXPC_TXPC_SELINTPD_LSB 31 -#define TXPC_TXPC_SELINTPD_MASK 0x80000000 -#define TXPC_TXPC_SELINTPD_GET(x) (((x) & TXPC_TXPC_SELINTPD_MASK) >> TXPC_TXPC_SELINTPD_LSB) -#define TXPC_TXPC_SELINTPD_SET(x) (((x) << TXPC_TXPC_SELINTPD_LSB) & TXPC_TXPC_SELINTPD_MASK) -#define TXPC_TXPC_TEST_MSB 30 -#define TXPC_TXPC_TEST_LSB 30 -#define TXPC_TXPC_TEST_MASK 0x40000000 -#define TXPC_TXPC_TEST_GET(x) (((x) & TXPC_TXPC_TEST_MASK) >> TXPC_TXPC_TEST_LSB) -#define TXPC_TXPC_TEST_SET(x) (((x) << TXPC_TXPC_TEST_LSB) & TXPC_TXPC_TEST_MASK) -#define TXPC_TXPC_TESTGAIN_MSB 29 -#define TXPC_TXPC_TESTGAIN_LSB 28 -#define TXPC_TXPC_TESTGAIN_MASK 0x30000000 -#define TXPC_TXPC_TESTGAIN_GET(x) (((x) & TXPC_TXPC_TESTGAIN_MASK) >> TXPC_TXPC_TESTGAIN_LSB) -#define TXPC_TXPC_TESTGAIN_SET(x) (((x) << TXPC_TXPC_TESTGAIN_LSB) & TXPC_TXPC_TESTGAIN_MASK) -#define TXPC_TXPC_TESTDAC_MSB 27 -#define TXPC_TXPC_TESTDAC_LSB 22 -#define TXPC_TXPC_TESTDAC_MASK 0x0fc00000 -#define TXPC_TXPC_TESTDAC_GET(x) (((x) & TXPC_TXPC_TESTDAC_MASK) >> TXPC_TXPC_TESTDAC_LSB) -#define TXPC_TXPC_TESTDAC_SET(x) (((x) << TXPC_TXPC_TESTDAC_LSB) & TXPC_TXPC_TESTDAC_MASK) -#define TXPC_TXPC_TESTPWDPC_MSB 21 -#define TXPC_TXPC_TESTPWDPC_LSB 21 -#define TXPC_TXPC_TESTPWDPC_MASK 0x00200000 -#define TXPC_TXPC_TESTPWDPC_GET(x) (((x) & TXPC_TXPC_TESTPWDPC_MASK) >> TXPC_TXPC_TESTPWDPC_LSB) -#define TXPC_TXPC_TESTPWDPC_SET(x) (((x) << TXPC_TXPC_TESTPWDPC_LSB) & TXPC_TXPC_TESTPWDPC_MASK) -#define TXPC_TXPC_CURHALF_MSB 20 -#define TXPC_TXPC_CURHALF_LSB 20 -#define TXPC_TXPC_CURHALF_MASK 0x00100000 -#define TXPC_TXPC_CURHALF_GET(x) (((x) & TXPC_TXPC_CURHALF_MASK) >> TXPC_TXPC_CURHALF_LSB) -#define TXPC_TXPC_CURHALF_SET(x) (((x) << TXPC_TXPC_CURHALF_LSB) & TXPC_TXPC_CURHALF_MASK) -#define TXPC_TXPC_NEGOUT_MSB 19 -#define TXPC_TXPC_NEGOUT_LSB 19 -#define TXPC_TXPC_NEGOUT_MASK 0x00080000 -#define TXPC_TXPC_NEGOUT_GET(x) (((x) & TXPC_TXPC_NEGOUT_MASK) >> TXPC_TXPC_NEGOUT_LSB) -#define TXPC_TXPC_NEGOUT_SET(x) (((x) << TXPC_TXPC_NEGOUT_LSB) & TXPC_TXPC_NEGOUT_MASK) -#define TXPC_TXPC_CLKDELAY_MSB 18 -#define TXPC_TXPC_CLKDELAY_LSB 18 -#define TXPC_TXPC_CLKDELAY_MASK 0x00040000 -#define TXPC_TXPC_CLKDELAY_GET(x) (((x) & TXPC_TXPC_CLKDELAY_MASK) >> TXPC_TXPC_CLKDELAY_LSB) -#define TXPC_TXPC_CLKDELAY_SET(x) (((x) << TXPC_TXPC_CLKDELAY_LSB) & TXPC_TXPC_CLKDELAY_MASK) -#define TXPC_TXPC_SELMODREF_MSB 17 -#define TXPC_TXPC_SELMODREF_LSB 17 -#define TXPC_TXPC_SELMODREF_MASK 0x00020000 -#define TXPC_TXPC_SELMODREF_GET(x) (((x) & TXPC_TXPC_SELMODREF_MASK) >> TXPC_TXPC_SELMODREF_LSB) -#define TXPC_TXPC_SELMODREF_SET(x) (((x) << TXPC_TXPC_SELMODREF_LSB) & TXPC_TXPC_SELMODREF_MASK) -#define TXPC_TXPC_SELCMOUT_MSB 16 -#define TXPC_TXPC_SELCMOUT_LSB 16 -#define TXPC_TXPC_SELCMOUT_MASK 0x00010000 -#define TXPC_TXPC_SELCMOUT_GET(x) (((x) & TXPC_TXPC_SELCMOUT_MASK) >> TXPC_TXPC_SELCMOUT_LSB) -#define TXPC_TXPC_SELCMOUT_SET(x) (((x) << TXPC_TXPC_SELCMOUT_LSB) & TXPC_TXPC_SELCMOUT_MASK) -#define TXPC_TXPC_TSMODE_MSB 15 -#define TXPC_TXPC_TSMODE_LSB 14 -#define TXPC_TXPC_TSMODE_MASK 0x0000c000 -#define TXPC_TXPC_TSMODE_GET(x) (((x) & TXPC_TXPC_TSMODE_MASK) >> TXPC_TXPC_TSMODE_LSB) -#define TXPC_TXPC_TSMODE_SET(x) (((x) << TXPC_TXPC_TSMODE_LSB) & TXPC_TXPC_TSMODE_MASK) -#define TXPC_TXPC_N_MSB 13 -#define TXPC_TXPC_N_LSB 6 -#define TXPC_TXPC_N_MASK 0x00003fc0 -#define TXPC_TXPC_N_GET(x) (((x) & TXPC_TXPC_N_MASK) >> TXPC_TXPC_N_LSB) -#define TXPC_TXPC_N_SET(x) (((x) << TXPC_TXPC_N_LSB) & TXPC_TXPC_N_MASK) -#define TXPC_TXPC_ON1STSYNTHON_MSB 5 -#define TXPC_TXPC_ON1STSYNTHON_LSB 5 -#define TXPC_TXPC_ON1STSYNTHON_MASK 0x00000020 -#define TXPC_TXPC_ON1STSYNTHON_GET(x) (((x) & TXPC_TXPC_ON1STSYNTHON_MASK) >> TXPC_TXPC_ON1STSYNTHON_LSB) -#define TXPC_TXPC_ON1STSYNTHON_SET(x) (((x) << TXPC_TXPC_ON1STSYNTHON_LSB) & TXPC_TXPC_ON1STSYNTHON_MASK) -#define TXPC_TXPC_SELINIT_MSB 4 -#define TXPC_TXPC_SELINIT_LSB 3 -#define TXPC_TXPC_SELINIT_MASK 0x00000018 -#define TXPC_TXPC_SELINIT_GET(x) (((x) & TXPC_TXPC_SELINIT_MASK) >> TXPC_TXPC_SELINIT_LSB) -#define TXPC_TXPC_SELINIT_SET(x) (((x) << TXPC_TXPC_SELINIT_LSB) & TXPC_TXPC_SELINIT_MASK) -#define TXPC_TXPC_SELCOUNT_MSB 2 -#define TXPC_TXPC_SELCOUNT_LSB 2 -#define TXPC_TXPC_SELCOUNT_MASK 0x00000004 -#define TXPC_TXPC_SELCOUNT_GET(x) (((x) & TXPC_TXPC_SELCOUNT_MASK) >> TXPC_TXPC_SELCOUNT_LSB) -#define TXPC_TXPC_SELCOUNT_SET(x) (((x) << TXPC_TXPC_SELCOUNT_LSB) & TXPC_TXPC_SELCOUNT_MASK) -#define TXPC_TXPC_ATBSEL_MSB 1 -#define TXPC_TXPC_ATBSEL_LSB 0 -#define TXPC_TXPC_ATBSEL_MASK 0x00000003 -#define TXPC_TXPC_ATBSEL_GET(x) (((x) & TXPC_TXPC_ATBSEL_MASK) >> TXPC_TXPC_ATBSEL_LSB) -#define TXPC_TXPC_ATBSEL_SET(x) (((x) << TXPC_TXPC_ATBSEL_LSB) & TXPC_TXPC_ATBSEL_MASK) - -#define TXPC_MISC_ADDRESS 0x00000004 -#define TXPC_MISC_OFFSET 0x00000004 -#define TXPC_MISC_FLIPBMODE_MSB 31 -#define TXPC_MISC_FLIPBMODE_LSB 31 -#define TXPC_MISC_FLIPBMODE_MASK 0x80000000 -#define TXPC_MISC_FLIPBMODE_GET(x) (((x) & TXPC_MISC_FLIPBMODE_MASK) >> TXPC_MISC_FLIPBMODE_LSB) -#define TXPC_MISC_FLIPBMODE_SET(x) (((x) << TXPC_MISC_FLIPBMODE_LSB) & TXPC_MISC_FLIPBMODE_MASK) -#define TXPC_MISC_LEVEL_MSB 30 -#define TXPC_MISC_LEVEL_LSB 29 -#define TXPC_MISC_LEVEL_MASK 0x60000000 -#define TXPC_MISC_LEVEL_GET(x) (((x) & TXPC_MISC_LEVEL_MASK) >> TXPC_MISC_LEVEL_LSB) -#define TXPC_MISC_LEVEL_SET(x) (((x) << TXPC_MISC_LEVEL_LSB) & TXPC_MISC_LEVEL_MASK) -#define TXPC_MISC_LDO_TEST_MODE_MSB 28 -#define TXPC_MISC_LDO_TEST_MODE_LSB 28 -#define TXPC_MISC_LDO_TEST_MODE_MASK 0x10000000 -#define TXPC_MISC_LDO_TEST_MODE_GET(x) (((x) & TXPC_MISC_LDO_TEST_MODE_MASK) >> TXPC_MISC_LDO_TEST_MODE_LSB) -#define TXPC_MISC_LDO_TEST_MODE_SET(x) (((x) << TXPC_MISC_LDO_TEST_MODE_LSB) & TXPC_MISC_LDO_TEST_MODE_MASK) -#define TXPC_MISC_NOTCXODET_MSB 27 -#define TXPC_MISC_NOTCXODET_LSB 27 -#define TXPC_MISC_NOTCXODET_MASK 0x08000000 -#define TXPC_MISC_NOTCXODET_GET(x) (((x) & TXPC_MISC_NOTCXODET_MASK) >> TXPC_MISC_NOTCXODET_LSB) -#define TXPC_MISC_NOTCXODET_SET(x) (((x) << TXPC_MISC_NOTCXODET_LSB) & TXPC_MISC_NOTCXODET_MASK) -#define TXPC_MISC_PWDCLKIND_MSB 26 -#define TXPC_MISC_PWDCLKIND_LSB 26 -#define TXPC_MISC_PWDCLKIND_MASK 0x04000000 -#define TXPC_MISC_PWDCLKIND_GET(x) (((x) & TXPC_MISC_PWDCLKIND_MASK) >> TXPC_MISC_PWDCLKIND_LSB) -#define TXPC_MISC_PWDCLKIND_SET(x) (((x) << TXPC_MISC_PWDCLKIND_LSB) & TXPC_MISC_PWDCLKIND_MASK) -#define TXPC_MISC_PWDXINPAD_MSB 25 -#define TXPC_MISC_PWDXINPAD_LSB 25 -#define TXPC_MISC_PWDXINPAD_MASK 0x02000000 -#define TXPC_MISC_PWDXINPAD_GET(x) (((x) & TXPC_MISC_PWDXINPAD_MASK) >> TXPC_MISC_PWDXINPAD_LSB) -#define TXPC_MISC_PWDXINPAD_SET(x) (((x) << TXPC_MISC_PWDXINPAD_LSB) & TXPC_MISC_PWDXINPAD_MASK) -#define TXPC_MISC_LOCALBIAS_MSB 24 -#define TXPC_MISC_LOCALBIAS_LSB 24 -#define TXPC_MISC_LOCALBIAS_MASK 0x01000000 -#define TXPC_MISC_LOCALBIAS_GET(x) (((x) & TXPC_MISC_LOCALBIAS_MASK) >> TXPC_MISC_LOCALBIAS_LSB) -#define TXPC_MISC_LOCALBIAS_SET(x) (((x) << TXPC_MISC_LOCALBIAS_LSB) & TXPC_MISC_LOCALBIAS_MASK) -#define TXPC_MISC_LOCALBIAS2X_MSB 23 -#define TXPC_MISC_LOCALBIAS2X_LSB 23 -#define TXPC_MISC_LOCALBIAS2X_MASK 0x00800000 -#define TXPC_MISC_LOCALBIAS2X_GET(x) (((x) & TXPC_MISC_LOCALBIAS2X_MASK) >> TXPC_MISC_LOCALBIAS2X_LSB) -#define TXPC_MISC_LOCALBIAS2X_SET(x) (((x) << TXPC_MISC_LOCALBIAS2X_LSB) & TXPC_MISC_LOCALBIAS2X_MASK) -#define TXPC_MISC_SELTSP_MSB 22 -#define TXPC_MISC_SELTSP_LSB 22 -#define TXPC_MISC_SELTSP_MASK 0x00400000 -#define TXPC_MISC_SELTSP_GET(x) (((x) & TXPC_MISC_SELTSP_MASK) >> TXPC_MISC_SELTSP_LSB) -#define TXPC_MISC_SELTSP_SET(x) (((x) << TXPC_MISC_SELTSP_LSB) & TXPC_MISC_SELTSP_MASK) -#define TXPC_MISC_SELTSN_MSB 21 -#define TXPC_MISC_SELTSN_LSB 21 -#define TXPC_MISC_SELTSN_MASK 0x00200000 -#define TXPC_MISC_SELTSN_GET(x) (((x) & TXPC_MISC_SELTSN_MASK) >> TXPC_MISC_SELTSN_LSB) -#define TXPC_MISC_SELTSN_SET(x) (((x) << TXPC_MISC_SELTSN_LSB) & TXPC_MISC_SELTSN_MASK) -#define TXPC_MISC_SPARE_A_MSB 20 -#define TXPC_MISC_SPARE_A_LSB 18 -#define TXPC_MISC_SPARE_A_MASK 0x001c0000 -#define TXPC_MISC_SPARE_A_GET(x) (((x) & TXPC_MISC_SPARE_A_MASK) >> TXPC_MISC_SPARE_A_LSB) -#define TXPC_MISC_SPARE_A_SET(x) (((x) << TXPC_MISC_SPARE_A_LSB) & TXPC_MISC_SPARE_A_MASK) -#define TXPC_MISC_DECOUT_MSB 17 -#define TXPC_MISC_DECOUT_LSB 8 -#define TXPC_MISC_DECOUT_MASK 0x0003ff00 -#define TXPC_MISC_DECOUT_GET(x) (((x) & TXPC_MISC_DECOUT_MASK) >> TXPC_MISC_DECOUT_LSB) -#define TXPC_MISC_DECOUT_SET(x) (((x) << TXPC_MISC_DECOUT_LSB) & TXPC_MISC_DECOUT_MASK) -#define TXPC_MISC_XTALDIV_MSB 7 -#define TXPC_MISC_XTALDIV_LSB 6 -#define TXPC_MISC_XTALDIV_MASK 0x000000c0 -#define TXPC_MISC_XTALDIV_GET(x) (((x) & TXPC_MISC_XTALDIV_MASK) >> TXPC_MISC_XTALDIV_LSB) -#define TXPC_MISC_XTALDIV_SET(x) (((x) << TXPC_MISC_XTALDIV_LSB) & TXPC_MISC_XTALDIV_MASK) -#define TXPC_MISC_SPARE_MSB 5 -#define TXPC_MISC_SPARE_LSB 0 -#define TXPC_MISC_SPARE_MASK 0x0000003f -#define TXPC_MISC_SPARE_GET(x) (((x) & TXPC_MISC_SPARE_MASK) >> TXPC_MISC_SPARE_LSB) -#define TXPC_MISC_SPARE_SET(x) (((x) << TXPC_MISC_SPARE_LSB) & TXPC_MISC_SPARE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct txpc_reg_reg_s { - volatile unsigned int txpc_txpc; - volatile unsigned int txpc_misc; -} txpc_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _TXPC_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/txpc_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/txpc_reg.vrh deleted file mode 100644 index 0b5423f0805a..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/txpc_reg.vrh +++ /dev/null @@ -1,257 +0,0 @@ -#ifndef _TXPC_REG_VRH_ -#define _TXPC_REG_VRH_ - -#define TXPC_TXPC_ADDRESS 'h00000000 -#define TXPC_TXPC_SELINTPD_MSB 31 -#define TXPC_TXPC_SELINTPD_LSB 31 -#define TXPC_TXPC_SELINTPD_MASK 'h80000000 -#define TXPC_TXPC_SELINTPD_GET(x) (((x) & TXPC_TXPC_SELINTPD_MASK) >> TXPC_TXPC_SELINTPD_LSB) -#define TXPC_TXPC_SELINTPD_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELINTPD_LSB) & TXPC_TXPC_SELINTPD_MASK) -#define TXPC_TXPC_SELINTPD_RESET 1'h0 -#define TXPC_TXPC_TEST_MSB 30 -#define TXPC_TXPC_TEST_LSB 30 -#define TXPC_TXPC_TEST_MASK 'h40000000 -#define TXPC_TXPC_TEST_GET(x) (((x) & TXPC_TXPC_TEST_MASK) >> TXPC_TXPC_TEST_LSB) -#define TXPC_TXPC_TEST_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TEST_LSB) & TXPC_TXPC_TEST_MASK) -#define TXPC_TXPC_TEST_RESET 1'h0 -#define TXPC_TXPC_TESTGAIN_MSB 29 -#define TXPC_TXPC_TESTGAIN_LSB 28 -#define TXPC_TXPC_TESTGAIN_MASK 'h30000000 -#define TXPC_TXPC_TESTGAIN_GET(x) (((x) & TXPC_TXPC_TESTGAIN_MASK) >> TXPC_TXPC_TESTGAIN_LSB) -#define TXPC_TXPC_TESTGAIN_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TESTGAIN_LSB) & TXPC_TXPC_TESTGAIN_MASK) -#define TXPC_TXPC_TESTGAIN_RESET 2'h0 -#define TXPC_TXPC_TESTDAC_MSB 27 -#define TXPC_TXPC_TESTDAC_LSB 22 -#define TXPC_TXPC_TESTDAC_MASK 'h0fc00000 -#define TXPC_TXPC_TESTDAC_GET(x) (((x) & TXPC_TXPC_TESTDAC_MASK) >> TXPC_TXPC_TESTDAC_LSB) -#define TXPC_TXPC_TESTDAC_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TESTDAC_LSB) & TXPC_TXPC_TESTDAC_MASK) -#define TXPC_TXPC_TESTDAC_RESET 6'h20 -#define TXPC_TXPC_TESTPWDPC_MSB 21 -#define TXPC_TXPC_TESTPWDPC_LSB 21 -#define TXPC_TXPC_TESTPWDPC_MASK 'h00200000 -#define TXPC_TXPC_TESTPWDPC_GET(x) (((x) & TXPC_TXPC_TESTPWDPC_MASK) >> TXPC_TXPC_TESTPWDPC_LSB) -#define TXPC_TXPC_TESTPWDPC_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TESTPWDPC_LSB) & TXPC_TXPC_TESTPWDPC_MASK) -#define TXPC_TXPC_TESTPWDPC_RESET 1'h0 -#define TXPC_TXPC_CURHALF_MSB 20 -#define TXPC_TXPC_CURHALF_LSB 20 -#define TXPC_TXPC_CURHALF_MASK 'h00100000 -#define TXPC_TXPC_CURHALF_GET(x) (((x) & TXPC_TXPC_CURHALF_MASK) >> TXPC_TXPC_CURHALF_LSB) -#define TXPC_TXPC_CURHALF_SET(x) (((32'd0 | (x)) << TXPC_TXPC_CURHALF_LSB) & TXPC_TXPC_CURHALF_MASK) -#define TXPC_TXPC_CURHALF_RESET 1'h1 -#define TXPC_TXPC_NEGOUT_MSB 19 -#define TXPC_TXPC_NEGOUT_LSB 19 -#define TXPC_TXPC_NEGOUT_MASK 'h00080000 -#define TXPC_TXPC_NEGOUT_GET(x) (((x) & TXPC_TXPC_NEGOUT_MASK) >> TXPC_TXPC_NEGOUT_LSB) -#define TXPC_TXPC_NEGOUT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_NEGOUT_LSB) & TXPC_TXPC_NEGOUT_MASK) -#define TXPC_TXPC_NEGOUT_RESET 1'h0 -#define TXPC_TXPC_CLKDELAY_MSB 18 -#define TXPC_TXPC_CLKDELAY_LSB 18 -#define TXPC_TXPC_CLKDELAY_MASK 'h00040000 -#define TXPC_TXPC_CLKDELAY_GET(x) (((x) & TXPC_TXPC_CLKDELAY_MASK) >> TXPC_TXPC_CLKDELAY_LSB) -#define TXPC_TXPC_CLKDELAY_SET(x) (((32'd0 | (x)) << TXPC_TXPC_CLKDELAY_LSB) & TXPC_TXPC_CLKDELAY_MASK) -#define TXPC_TXPC_CLKDELAY_RESET 1'h0 -#define TXPC_TXPC_SELMODREF_MSB 17 -#define TXPC_TXPC_SELMODREF_LSB 17 -#define TXPC_TXPC_SELMODREF_MASK 'h00020000 -#define TXPC_TXPC_SELMODREF_GET(x) (((x) & TXPC_TXPC_SELMODREF_MASK) >> TXPC_TXPC_SELMODREF_LSB) -#define TXPC_TXPC_SELMODREF_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELMODREF_LSB) & TXPC_TXPC_SELMODREF_MASK) -#define TXPC_TXPC_SELMODREF_RESET 1'h0 -#define TXPC_TXPC_SELCMOUT_MSB 16 -#define TXPC_TXPC_SELCMOUT_LSB 16 -#define TXPC_TXPC_SELCMOUT_MASK 'h00010000 -#define TXPC_TXPC_SELCMOUT_GET(x) (((x) & TXPC_TXPC_SELCMOUT_MASK) >> TXPC_TXPC_SELCMOUT_LSB) -#define TXPC_TXPC_SELCMOUT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELCMOUT_LSB) & TXPC_TXPC_SELCMOUT_MASK) -#define TXPC_TXPC_SELCMOUT_RESET 1'h0 -#define TXPC_TXPC_TSMODE_MSB 15 -#define TXPC_TXPC_TSMODE_LSB 14 -#define TXPC_TXPC_TSMODE_MASK 'h0000c000 -#define TXPC_TXPC_TSMODE_GET(x) (((x) & TXPC_TXPC_TSMODE_MASK) >> TXPC_TXPC_TSMODE_LSB) -#define TXPC_TXPC_TSMODE_SET(x) (((32'd0 | (x)) << TXPC_TXPC_TSMODE_LSB) & TXPC_TXPC_TSMODE_MASK) -#define TXPC_TXPC_TSMODE_RESET 2'h0 -#define TXPC_TXPC_N_MSB 13 -#define TXPC_TXPC_N_LSB 6 -#define TXPC_TXPC_N_MASK 'h00003fc0 -#define TXPC_TXPC_N_GET(x) (((x) & TXPC_TXPC_N_MASK) >> TXPC_TXPC_N_LSB) -#define TXPC_TXPC_N_SET(x) (((32'd0 | (x)) << TXPC_TXPC_N_LSB) & TXPC_TXPC_N_MASK) -#define TXPC_TXPC_N_RESET 8'h80 -#define TXPC_TXPC_ON1STSYNTHON_MSB 5 -#define TXPC_TXPC_ON1STSYNTHON_LSB 5 -#define TXPC_TXPC_ON1STSYNTHON_MASK 'h00000020 -#define TXPC_TXPC_ON1STSYNTHON_GET(x) (((x) & TXPC_TXPC_ON1STSYNTHON_MASK) >> TXPC_TXPC_ON1STSYNTHON_LSB) -#define TXPC_TXPC_ON1STSYNTHON_SET(x) (((32'd0 | (x)) << TXPC_TXPC_ON1STSYNTHON_LSB) & TXPC_TXPC_ON1STSYNTHON_MASK) -#define TXPC_TXPC_ON1STSYNTHON_RESET 1'h1 -#define TXPC_TXPC_SELINIT_MSB 4 -#define TXPC_TXPC_SELINIT_LSB 3 -#define TXPC_TXPC_SELINIT_MASK 'h00000018 -#define TXPC_TXPC_SELINIT_GET(x) (((x) & TXPC_TXPC_SELINIT_MASK) >> TXPC_TXPC_SELINIT_LSB) -#define TXPC_TXPC_SELINIT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELINIT_LSB) & TXPC_TXPC_SELINIT_MASK) -#define TXPC_TXPC_SELINIT_RESET 2'h3 -#define TXPC_TXPC_SELCOUNT_MSB 2 -#define TXPC_TXPC_SELCOUNT_LSB 2 -#define TXPC_TXPC_SELCOUNT_MASK 'h00000004 -#define TXPC_TXPC_SELCOUNT_GET(x) (((x) & TXPC_TXPC_SELCOUNT_MASK) >> TXPC_TXPC_SELCOUNT_LSB) -#define TXPC_TXPC_SELCOUNT_SET(x) (((32'd0 | (x)) << TXPC_TXPC_SELCOUNT_LSB) & TXPC_TXPC_SELCOUNT_MASK) -#define TXPC_TXPC_SELCOUNT_RESET 1'h1 -#define TXPC_TXPC_ATBSEL_MSB 1 -#define TXPC_TXPC_ATBSEL_LSB 0 -#define TXPC_TXPC_ATBSEL_MASK 'h00000003 -#define TXPC_TXPC_ATBSEL_GET(x) (((x) & TXPC_TXPC_ATBSEL_MASK) >> TXPC_TXPC_ATBSEL_LSB) -#define TXPC_TXPC_ATBSEL_SET(x) (((32'd0 | (x)) << TXPC_TXPC_ATBSEL_LSB) & TXPC_TXPC_ATBSEL_MASK) -#define TXPC_TXPC_ATBSEL_RESET 2'h0 -#define TXPC_TXPC_RESET (32'h0 | \ - TXPC_TXPC_SELINTPD_SET(TXPC_TXPC_SELINTPD_RESET) | \ - TXPC_TXPC_TEST_SET(TXPC_TXPC_TEST_RESET) | \ - TXPC_TXPC_TESTGAIN_SET(TXPC_TXPC_TESTGAIN_RESET) | \ - TXPC_TXPC_TESTDAC_SET(TXPC_TXPC_TESTDAC_RESET) | \ - TXPC_TXPC_TESTPWDPC_SET(TXPC_TXPC_TESTPWDPC_RESET) | \ - TXPC_TXPC_CURHALF_SET(TXPC_TXPC_CURHALF_RESET) | \ - TXPC_TXPC_NEGOUT_SET(TXPC_TXPC_NEGOUT_RESET) | \ - TXPC_TXPC_CLKDELAY_SET(TXPC_TXPC_CLKDELAY_RESET) | \ - TXPC_TXPC_SELMODREF_SET(TXPC_TXPC_SELMODREF_RESET) | \ - TXPC_TXPC_SELCMOUT_SET(TXPC_TXPC_SELCMOUT_RESET) | \ - TXPC_TXPC_TSMODE_SET(TXPC_TXPC_TSMODE_RESET) | \ - TXPC_TXPC_N_SET(TXPC_TXPC_N_RESET) | \ - TXPC_TXPC_ON1STSYNTHON_SET(TXPC_TXPC_ON1STSYNTHON_RESET) | \ - TXPC_TXPC_SELINIT_SET(TXPC_TXPC_SELINIT_RESET) | \ - TXPC_TXPC_SELCOUNT_SET(TXPC_TXPC_SELCOUNT_RESET) | \ - TXPC_TXPC_ATBSEL_SET(TXPC_TXPC_ATBSEL_RESET)) -#define TXPC_TXPC_HW_MASK (32'h0) -#define TXPC_TXPC_SW_MASK (32'h0 | \ - TXPC_TXPC_SELINTPD_MASK | \ - TXPC_TXPC_TEST_MASK | \ - TXPC_TXPC_TESTGAIN_MASK | \ - TXPC_TXPC_TESTDAC_MASK | \ - TXPC_TXPC_TESTPWDPC_MASK | \ - TXPC_TXPC_CURHALF_MASK | \ - TXPC_TXPC_NEGOUT_MASK | \ - TXPC_TXPC_CLKDELAY_MASK | \ - TXPC_TXPC_SELMODREF_MASK | \ - TXPC_TXPC_SELCMOUT_MASK | \ - TXPC_TXPC_TSMODE_MASK | \ - TXPC_TXPC_N_MASK | \ - TXPC_TXPC_ON1STSYNTHON_MASK | \ - TXPC_TXPC_SELINIT_MASK | \ - TXPC_TXPC_SELCOUNT_MASK | \ - TXPC_TXPC_ATBSEL_MASK) - -#define TXPC_MISC_ADDRESS 'h00000004 -#define TXPC_MISC_FLIPBMODE_MSB 31 -#define TXPC_MISC_FLIPBMODE_LSB 31 -#define TXPC_MISC_FLIPBMODE_MASK 'h80000000 -#define TXPC_MISC_FLIPBMODE_GET(x) (((x) & TXPC_MISC_FLIPBMODE_MASK) >> TXPC_MISC_FLIPBMODE_LSB) -#define TXPC_MISC_FLIPBMODE_SET(x) (((32'd0 | (x)) << TXPC_MISC_FLIPBMODE_LSB) & TXPC_MISC_FLIPBMODE_MASK) -#define TXPC_MISC_FLIPBMODE_RESET 1'h0 -#define TXPC_MISC_LEVEL_MSB 30 -#define TXPC_MISC_LEVEL_LSB 29 -#define TXPC_MISC_LEVEL_MASK 'h60000000 -#define TXPC_MISC_LEVEL_GET(x) (((x) & TXPC_MISC_LEVEL_MASK) >> TXPC_MISC_LEVEL_LSB) -#define TXPC_MISC_LEVEL_SET(x) (((32'd0 | (x)) << TXPC_MISC_LEVEL_LSB) & TXPC_MISC_LEVEL_MASK) -#define TXPC_MISC_LEVEL_RESET 2'h0 -#define TXPC_MISC_LDO_TEST_MODE_MSB 28 -#define TXPC_MISC_LDO_TEST_MODE_LSB 28 -#define TXPC_MISC_LDO_TEST_MODE_MASK 'h10000000 -#define TXPC_MISC_LDO_TEST_MODE_GET(x) (((x) & TXPC_MISC_LDO_TEST_MODE_MASK) >> TXPC_MISC_LDO_TEST_MODE_LSB) -#define TXPC_MISC_LDO_TEST_MODE_SET(x) (((32'd0 | (x)) << TXPC_MISC_LDO_TEST_MODE_LSB) & TXPC_MISC_LDO_TEST_MODE_MASK) -#define TXPC_MISC_LDO_TEST_MODE_RESET 1'h0 -#define TXPC_MISC_NOTCXODET_MSB 27 -#define TXPC_MISC_NOTCXODET_LSB 27 -#define TXPC_MISC_NOTCXODET_MASK 'h08000000 -#define TXPC_MISC_NOTCXODET_GET(x) (((x) & TXPC_MISC_NOTCXODET_MASK) >> TXPC_MISC_NOTCXODET_LSB) -#define TXPC_MISC_NOTCXODET_SET(x) (((32'd0 | (x)) << TXPC_MISC_NOTCXODET_LSB) & TXPC_MISC_NOTCXODET_MASK) -#define TXPC_MISC_NOTCXODET_RESET 1'h0 -#define TXPC_MISC_PWDCLKIND_MSB 26 -#define TXPC_MISC_PWDCLKIND_LSB 26 -#define TXPC_MISC_PWDCLKIND_MASK 'h04000000 -#define TXPC_MISC_PWDCLKIND_GET(x) (((x) & TXPC_MISC_PWDCLKIND_MASK) >> TXPC_MISC_PWDCLKIND_LSB) -#define TXPC_MISC_PWDCLKIND_SET(x) (((32'd0 | (x)) << TXPC_MISC_PWDCLKIND_LSB) & TXPC_MISC_PWDCLKIND_MASK) -#define TXPC_MISC_PWDCLKIND_RESET 1'h0 -#define TXPC_MISC_PWDXINPAD_MSB 25 -#define TXPC_MISC_PWDXINPAD_LSB 25 -#define TXPC_MISC_PWDXINPAD_MASK 'h02000000 -#define TXPC_MISC_PWDXINPAD_GET(x) (((x) & TXPC_MISC_PWDXINPAD_MASK) >> TXPC_MISC_PWDXINPAD_LSB) -#define TXPC_MISC_PWDXINPAD_SET(x) (((32'd0 | (x)) << TXPC_MISC_PWDXINPAD_LSB) & TXPC_MISC_PWDXINPAD_MASK) -#define TXPC_MISC_PWDXINPAD_RESET 1'h0 -#define TXPC_MISC_LOCALBIAS_MSB 24 -#define TXPC_MISC_LOCALBIAS_LSB 24 -#define TXPC_MISC_LOCALBIAS_MASK 'h01000000 -#define TXPC_MISC_LOCALBIAS_GET(x) (((x) & TXPC_MISC_LOCALBIAS_MASK) >> TXPC_MISC_LOCALBIAS_LSB) -#define TXPC_MISC_LOCALBIAS_SET(x) (((32'd0 | (x)) << TXPC_MISC_LOCALBIAS_LSB) & TXPC_MISC_LOCALBIAS_MASK) -#define TXPC_MISC_LOCALBIAS_RESET 1'h1 -#define TXPC_MISC_LOCALBIAS2X_MSB 23 -#define TXPC_MISC_LOCALBIAS2X_LSB 23 -#define TXPC_MISC_LOCALBIAS2X_MASK 'h00800000 -#define TXPC_MISC_LOCALBIAS2X_GET(x) (((x) & TXPC_MISC_LOCALBIAS2X_MASK) >> TXPC_MISC_LOCALBIAS2X_LSB) -#define TXPC_MISC_LOCALBIAS2X_SET(x) (((32'd0 | (x)) << TXPC_MISC_LOCALBIAS2X_LSB) & TXPC_MISC_LOCALBIAS2X_MASK) -#define TXPC_MISC_LOCALBIAS2X_RESET 1'h0 -#define TXPC_MISC_SELTSP_MSB 22 -#define TXPC_MISC_SELTSP_LSB 22 -#define TXPC_MISC_SELTSP_MASK 'h00400000 -#define TXPC_MISC_SELTSP_GET(x) (((x) & TXPC_MISC_SELTSP_MASK) >> TXPC_MISC_SELTSP_LSB) -#define TXPC_MISC_SELTSP_SET(x) (((32'd0 | (x)) << TXPC_MISC_SELTSP_LSB) & TXPC_MISC_SELTSP_MASK) -#define TXPC_MISC_SELTSP_RESET 1'h0 -#define TXPC_MISC_SELTSN_MSB 21 -#define TXPC_MISC_SELTSN_LSB 21 -#define TXPC_MISC_SELTSN_MASK 'h00200000 -#define TXPC_MISC_SELTSN_GET(x) (((x) & TXPC_MISC_SELTSN_MASK) >> TXPC_MISC_SELTSN_LSB) -#define TXPC_MISC_SELTSN_SET(x) (((32'd0 | (x)) << TXPC_MISC_SELTSN_LSB) & TXPC_MISC_SELTSN_MASK) -#define TXPC_MISC_SELTSN_RESET 1'h0 -#define TXPC_MISC_SPARE_A_MSB 20 -#define TXPC_MISC_SPARE_A_LSB 18 -#define TXPC_MISC_SPARE_A_MASK 'h001c0000 -#define TXPC_MISC_SPARE_A_GET(x) (((x) & TXPC_MISC_SPARE_A_MASK) >> TXPC_MISC_SPARE_A_LSB) -#define TXPC_MISC_SPARE_A_SET(x) (((32'd0 | (x)) << TXPC_MISC_SPARE_A_LSB) & TXPC_MISC_SPARE_A_MASK) -#define TXPC_MISC_SPARE_A_RESET 3'h0 -#define TXPC_MISC_DECOUT_MSB 17 -#define TXPC_MISC_DECOUT_LSB 8 -#define TXPC_MISC_DECOUT_MASK 'h0003ff00 -#define TXPC_MISC_DECOUT_GET(x) (((x) & TXPC_MISC_DECOUT_MASK) >> TXPC_MISC_DECOUT_LSB) -#define TXPC_MISC_DECOUT_SET(x) (((32'd0 | (x)) << TXPC_MISC_DECOUT_LSB) & TXPC_MISC_DECOUT_MASK) -#define TXPC_MISC_DECOUT_RESET 10'h0 -#define TXPC_MISC_XTALDIV_MSB 7 -#define TXPC_MISC_XTALDIV_LSB 6 -#define TXPC_MISC_XTALDIV_MASK 'h000000c0 -#define TXPC_MISC_XTALDIV_GET(x) (((x) & TXPC_MISC_XTALDIV_MASK) >> TXPC_MISC_XTALDIV_LSB) -#define TXPC_MISC_XTALDIV_SET(x) (((32'd0 | (x)) << TXPC_MISC_XTALDIV_LSB) & TXPC_MISC_XTALDIV_MASK) -#define TXPC_MISC_XTALDIV_RESET 2'h0 -#define TXPC_MISC_SPARE_MSB 5 -#define TXPC_MISC_SPARE_LSB 0 -#define TXPC_MISC_SPARE_MASK 'h0000003f -#define TXPC_MISC_SPARE_GET(x) (((x) & TXPC_MISC_SPARE_MASK) >> TXPC_MISC_SPARE_LSB) -#define TXPC_MISC_SPARE_SET(x) (((32'd0 | (x)) << TXPC_MISC_SPARE_LSB) & TXPC_MISC_SPARE_MASK) -#define TXPC_MISC_SPARE_RESET 6'h0 -#define TXPC_MISC_RESET (32'h0 | \ - TXPC_MISC_FLIPBMODE_SET(TXPC_MISC_FLIPBMODE_RESET) | \ - TXPC_MISC_LEVEL_SET(TXPC_MISC_LEVEL_RESET) | \ - TXPC_MISC_LDO_TEST_MODE_SET(TXPC_MISC_LDO_TEST_MODE_RESET) | \ - TXPC_MISC_NOTCXODET_SET(TXPC_MISC_NOTCXODET_RESET) | \ - TXPC_MISC_PWDCLKIND_SET(TXPC_MISC_PWDCLKIND_RESET) | \ - TXPC_MISC_PWDXINPAD_SET(TXPC_MISC_PWDXINPAD_RESET) | \ - TXPC_MISC_LOCALBIAS_SET(TXPC_MISC_LOCALBIAS_RESET) | \ - TXPC_MISC_LOCALBIAS2X_SET(TXPC_MISC_LOCALBIAS2X_RESET) | \ - TXPC_MISC_SELTSP_SET(TXPC_MISC_SELTSP_RESET) | \ - TXPC_MISC_SELTSN_SET(TXPC_MISC_SELTSN_RESET) | \ - TXPC_MISC_SPARE_A_SET(TXPC_MISC_SPARE_A_RESET) | \ - TXPC_MISC_DECOUT_SET(TXPC_MISC_DECOUT_RESET) | \ - TXPC_MISC_XTALDIV_SET(TXPC_MISC_XTALDIV_RESET) | \ - TXPC_MISC_SPARE_SET(TXPC_MISC_SPARE_RESET)) -#define TXPC_MISC_HW_MASK (32'h0 | \ - TXPC_MISC_DECOUT_MASK) -#define TXPC_MISC_SW_MASK (32'h0 | \ - TXPC_MISC_FLIPBMODE_MASK | \ - TXPC_MISC_LEVEL_MASK | \ - TXPC_MISC_LDO_TEST_MODE_MASK | \ - TXPC_MISC_NOTCXODET_MASK | \ - TXPC_MISC_PWDCLKIND_MASK | \ - TXPC_MISC_PWDXINPAD_MASK | \ - TXPC_MISC_LOCALBIAS_MASK | \ - TXPC_MISC_LOCALBIAS2X_MASK | \ - TXPC_MISC_SELTSP_MASK | \ - TXPC_MISC_SELTSN_MASK | \ - TXPC_MISC_SPARE_A_MASK | \ - TXPC_MISC_DECOUT_MASK | \ - TXPC_MISC_XTALDIV_MASK | \ - TXPC_MISC_SPARE_MASK) - -#define TXPC_REG_ADDRESS_MSB 2 - -#endif /* _TXPC_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/uart_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/uart_reg.h deleted file mode 100644 index 5db321b72b2c..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/uart_reg.h +++ /dev/null @@ -1,327 +0,0 @@ -#ifndef _UART_REG_REG_H_ -#define _UART_REG_REG_H_ - -#define RBR_ADDRESS 0x00000000 -#define RBR_OFFSET 0x00000000 -#define RBR_RBR_MSB 7 -#define RBR_RBR_LSB 0 -#define RBR_RBR_MASK 0x000000ff -#define RBR_RBR_GET(x) (((x) & RBR_RBR_MASK) >> RBR_RBR_LSB) -#define RBR_RBR_SET(x) (((x) << RBR_RBR_LSB) & RBR_RBR_MASK) - -#define THR_ADDRESS 0x00000000 -#define THR_OFFSET 0x00000000 -#define THR_THR_MSB 7 -#define THR_THR_LSB 0 -#define THR_THR_MASK 0x000000ff -#define THR_THR_GET(x) (((x) & THR_THR_MASK) >> THR_THR_LSB) -#define THR_THR_SET(x) (((x) << THR_THR_LSB) & THR_THR_MASK) - -#define DLL_ADDRESS 0x00000000 -#define DLL_OFFSET 0x00000000 -#define DLL_DLL_MSB 7 -#define DLL_DLL_LSB 0 -#define DLL_DLL_MASK 0x000000ff -#define DLL_DLL_GET(x) (((x) & DLL_DLL_MASK) >> DLL_DLL_LSB) -#define DLL_DLL_SET(x) (((x) << DLL_DLL_LSB) & DLL_DLL_MASK) - -#define DLH_ADDRESS 0x00000004 -#define DLH_OFFSET 0x00000004 -#define DLH_DLH_MSB 7 -#define DLH_DLH_LSB 0 -#define DLH_DLH_MASK 0x000000ff -#define DLH_DLH_GET(x) (((x) & DLH_DLH_MASK) >> DLH_DLH_LSB) -#define DLH_DLH_SET(x) (((x) << DLH_DLH_LSB) & DLH_DLH_MASK) - -#define IER_ADDRESS 0x00000004 -#define IER_OFFSET 0x00000004 -#define IER_EDDSI_MSB 3 -#define IER_EDDSI_LSB 3 -#define IER_EDDSI_MASK 0x00000008 -#define IER_EDDSI_GET(x) (((x) & IER_EDDSI_MASK) >> IER_EDDSI_LSB) -#define IER_EDDSI_SET(x) (((x) << IER_EDDSI_LSB) & IER_EDDSI_MASK) -#define IER_ELSI_MSB 2 -#define IER_ELSI_LSB 2 -#define IER_ELSI_MASK 0x00000004 -#define IER_ELSI_GET(x) (((x) & IER_ELSI_MASK) >> IER_ELSI_LSB) -#define IER_ELSI_SET(x) (((x) << IER_ELSI_LSB) & IER_ELSI_MASK) -#define IER_ETBEI_MSB 1 -#define IER_ETBEI_LSB 1 -#define IER_ETBEI_MASK 0x00000002 -#define IER_ETBEI_GET(x) (((x) & IER_ETBEI_MASK) >> IER_ETBEI_LSB) -#define IER_ETBEI_SET(x) (((x) << IER_ETBEI_LSB) & IER_ETBEI_MASK) -#define IER_ERBFI_MSB 0 -#define IER_ERBFI_LSB 0 -#define IER_ERBFI_MASK 0x00000001 -#define IER_ERBFI_GET(x) (((x) & IER_ERBFI_MASK) >> IER_ERBFI_LSB) -#define IER_ERBFI_SET(x) (((x) << IER_ERBFI_LSB) & IER_ERBFI_MASK) - -#define IIR_ADDRESS 0x00000008 -#define IIR_OFFSET 0x00000008 -#define IIR_FIFO_STATUS_MSB 7 -#define IIR_FIFO_STATUS_LSB 6 -#define IIR_FIFO_STATUS_MASK 0x000000c0 -#define IIR_FIFO_STATUS_GET(x) (((x) & IIR_FIFO_STATUS_MASK) >> IIR_FIFO_STATUS_LSB) -#define IIR_FIFO_STATUS_SET(x) (((x) << IIR_FIFO_STATUS_LSB) & IIR_FIFO_STATUS_MASK) -#define IIR_IID_MSB 3 -#define IIR_IID_LSB 0 -#define IIR_IID_MASK 0x0000000f -#define IIR_IID_GET(x) (((x) & IIR_IID_MASK) >> IIR_IID_LSB) -#define IIR_IID_SET(x) (((x) << IIR_IID_LSB) & IIR_IID_MASK) - -#define FCR_ADDRESS 0x00000008 -#define FCR_OFFSET 0x00000008 -#define FCR_RCVR_TRIG_MSB 7 -#define FCR_RCVR_TRIG_LSB 6 -#define FCR_RCVR_TRIG_MASK 0x000000c0 -#define FCR_RCVR_TRIG_GET(x) (((x) & FCR_RCVR_TRIG_MASK) >> FCR_RCVR_TRIG_LSB) -#define FCR_RCVR_TRIG_SET(x) (((x) << FCR_RCVR_TRIG_LSB) & FCR_RCVR_TRIG_MASK) -#define FCR_DMA_MODE_MSB 3 -#define FCR_DMA_MODE_LSB 3 -#define FCR_DMA_MODE_MASK 0x00000008 -#define FCR_DMA_MODE_GET(x) (((x) & FCR_DMA_MODE_MASK) >> FCR_DMA_MODE_LSB) -#define FCR_DMA_MODE_SET(x) (((x) << FCR_DMA_MODE_LSB) & FCR_DMA_MODE_MASK) -#define FCR_XMIT_FIFO_RST_MSB 2 -#define FCR_XMIT_FIFO_RST_LSB 2 -#define FCR_XMIT_FIFO_RST_MASK 0x00000004 -#define FCR_XMIT_FIFO_RST_GET(x) (((x) & FCR_XMIT_FIFO_RST_MASK) >> FCR_XMIT_FIFO_RST_LSB) -#define FCR_XMIT_FIFO_RST_SET(x) (((x) << FCR_XMIT_FIFO_RST_LSB) & FCR_XMIT_FIFO_RST_MASK) -#define FCR_RCVR_FIFO_RST_MSB 1 -#define FCR_RCVR_FIFO_RST_LSB 1 -#define FCR_RCVR_FIFO_RST_MASK 0x00000002 -#define FCR_RCVR_FIFO_RST_GET(x) (((x) & FCR_RCVR_FIFO_RST_MASK) >> FCR_RCVR_FIFO_RST_LSB) -#define FCR_RCVR_FIFO_RST_SET(x) (((x) << FCR_RCVR_FIFO_RST_LSB) & FCR_RCVR_FIFO_RST_MASK) -#define FCR_FIFO_EN_MSB 0 -#define FCR_FIFO_EN_LSB 0 -#define FCR_FIFO_EN_MASK 0x00000001 -#define FCR_FIFO_EN_GET(x) (((x) & FCR_FIFO_EN_MASK) >> FCR_FIFO_EN_LSB) -#define FCR_FIFO_EN_SET(x) (((x) << FCR_FIFO_EN_LSB) & FCR_FIFO_EN_MASK) - -#define LCR_ADDRESS 0x0000000c -#define LCR_OFFSET 0x0000000c -#define LCR_DLAB_MSB 7 -#define LCR_DLAB_LSB 7 -#define LCR_DLAB_MASK 0x00000080 -#define LCR_DLAB_GET(x) (((x) & LCR_DLAB_MASK) >> LCR_DLAB_LSB) -#define LCR_DLAB_SET(x) (((x) << LCR_DLAB_LSB) & LCR_DLAB_MASK) -#define LCR_BREAK_MSB 6 -#define LCR_BREAK_LSB 6 -#define LCR_BREAK_MASK 0x00000040 -#define LCR_BREAK_GET(x) (((x) & LCR_BREAK_MASK) >> LCR_BREAK_LSB) -#define LCR_BREAK_SET(x) (((x) << LCR_BREAK_LSB) & LCR_BREAK_MASK) -#define LCR_EPS_MSB 4 -#define LCR_EPS_LSB 4 -#define LCR_EPS_MASK 0x00000010 -#define LCR_EPS_GET(x) (((x) & LCR_EPS_MASK) >> LCR_EPS_LSB) -#define LCR_EPS_SET(x) (((x) << LCR_EPS_LSB) & LCR_EPS_MASK) -#define LCR_PEN_MSB 3 -#define LCR_PEN_LSB 3 -#define LCR_PEN_MASK 0x00000008 -#define LCR_PEN_GET(x) (((x) & LCR_PEN_MASK) >> LCR_PEN_LSB) -#define LCR_PEN_SET(x) (((x) << LCR_PEN_LSB) & LCR_PEN_MASK) -#define LCR_STOP_MSB 2 -#define LCR_STOP_LSB 2 -#define LCR_STOP_MASK 0x00000004 -#define LCR_STOP_GET(x) (((x) & LCR_STOP_MASK) >> LCR_STOP_LSB) -#define LCR_STOP_SET(x) (((x) << LCR_STOP_LSB) & LCR_STOP_MASK) -#define LCR_CLS_MSB 1 -#define LCR_CLS_LSB 0 -#define LCR_CLS_MASK 0x00000003 -#define LCR_CLS_GET(x) (((x) & LCR_CLS_MASK) >> LCR_CLS_LSB) -#define LCR_CLS_SET(x) (((x) << LCR_CLS_LSB) & LCR_CLS_MASK) - -#define MCR_ADDRESS 0x00000010 -#define MCR_OFFSET 0x00000010 -#define MCR_LOOPBACK_MSB 5 -#define MCR_LOOPBACK_LSB 5 -#define MCR_LOOPBACK_MASK 0x00000020 -#define MCR_LOOPBACK_GET(x) (((x) & MCR_LOOPBACK_MASK) >> MCR_LOOPBACK_LSB) -#define MCR_LOOPBACK_SET(x) (((x) << MCR_LOOPBACK_LSB) & MCR_LOOPBACK_MASK) -#define MCR_OUT2_MSB 3 -#define MCR_OUT2_LSB 3 -#define MCR_OUT2_MASK 0x00000008 -#define MCR_OUT2_GET(x) (((x) & MCR_OUT2_MASK) >> MCR_OUT2_LSB) -#define MCR_OUT2_SET(x) (((x) << MCR_OUT2_LSB) & MCR_OUT2_MASK) -#define MCR_OUT1_MSB 2 -#define MCR_OUT1_LSB 2 -#define MCR_OUT1_MASK 0x00000004 -#define MCR_OUT1_GET(x) (((x) & MCR_OUT1_MASK) >> MCR_OUT1_LSB) -#define MCR_OUT1_SET(x) (((x) << MCR_OUT1_LSB) & MCR_OUT1_MASK) -#define MCR_RTS_MSB 1 -#define MCR_RTS_LSB 1 -#define MCR_RTS_MASK 0x00000002 -#define MCR_RTS_GET(x) (((x) & MCR_RTS_MASK) >> MCR_RTS_LSB) -#define MCR_RTS_SET(x) (((x) << MCR_RTS_LSB) & MCR_RTS_MASK) -#define MCR_DTR_MSB 0 -#define MCR_DTR_LSB 0 -#define MCR_DTR_MASK 0x00000001 -#define MCR_DTR_GET(x) (((x) & MCR_DTR_MASK) >> MCR_DTR_LSB) -#define MCR_DTR_SET(x) (((x) << MCR_DTR_LSB) & MCR_DTR_MASK) - -#define LSR_ADDRESS 0x00000014 -#define LSR_OFFSET 0x00000014 -#define LSR_FERR_MSB 7 -#define LSR_FERR_LSB 7 -#define LSR_FERR_MASK 0x00000080 -#define LSR_FERR_GET(x) (((x) & LSR_FERR_MASK) >> LSR_FERR_LSB) -#define LSR_FERR_SET(x) (((x) << LSR_FERR_LSB) & LSR_FERR_MASK) -#define LSR_TEMT_MSB 6 -#define LSR_TEMT_LSB 6 -#define LSR_TEMT_MASK 0x00000040 -#define LSR_TEMT_GET(x) (((x) & LSR_TEMT_MASK) >> LSR_TEMT_LSB) -#define LSR_TEMT_SET(x) (((x) << LSR_TEMT_LSB) & LSR_TEMT_MASK) -#define LSR_THRE_MSB 5 -#define LSR_THRE_LSB 5 -#define LSR_THRE_MASK 0x00000020 -#define LSR_THRE_GET(x) (((x) & LSR_THRE_MASK) >> LSR_THRE_LSB) -#define LSR_THRE_SET(x) (((x) << LSR_THRE_LSB) & LSR_THRE_MASK) -#define LSR_BI_MSB 4 -#define LSR_BI_LSB 4 -#define LSR_BI_MASK 0x00000010 -#define LSR_BI_GET(x) (((x) & LSR_BI_MASK) >> LSR_BI_LSB) -#define LSR_BI_SET(x) (((x) << LSR_BI_LSB) & LSR_BI_MASK) -#define LSR_FE_MSB 3 -#define LSR_FE_LSB 3 -#define LSR_FE_MASK 0x00000008 -#define LSR_FE_GET(x) (((x) & LSR_FE_MASK) >> LSR_FE_LSB) -#define LSR_FE_SET(x) (((x) << LSR_FE_LSB) & LSR_FE_MASK) -#define LSR_PE_MSB 2 -#define LSR_PE_LSB 2 -#define LSR_PE_MASK 0x00000004 -#define LSR_PE_GET(x) (((x) & LSR_PE_MASK) >> LSR_PE_LSB) -#define LSR_PE_SET(x) (((x) << LSR_PE_LSB) & LSR_PE_MASK) -#define LSR_OE_MSB 1 -#define LSR_OE_LSB 1 -#define LSR_OE_MASK 0x00000002 -#define LSR_OE_GET(x) (((x) & LSR_OE_MASK) >> LSR_OE_LSB) -#define LSR_OE_SET(x) (((x) << LSR_OE_LSB) & LSR_OE_MASK) -#define LSR_DR_MSB 0 -#define LSR_DR_LSB 0 -#define LSR_DR_MASK 0x00000001 -#define LSR_DR_GET(x) (((x) & LSR_DR_MASK) >> LSR_DR_LSB) -#define LSR_DR_SET(x) (((x) << LSR_DR_LSB) & LSR_DR_MASK) - -#define MSR_ADDRESS 0x00000018 -#define MSR_OFFSET 0x00000018 -#define MSR_DCD_MSB 7 -#define MSR_DCD_LSB 7 -#define MSR_DCD_MASK 0x00000080 -#define MSR_DCD_GET(x) (((x) & MSR_DCD_MASK) >> MSR_DCD_LSB) -#define MSR_DCD_SET(x) (((x) << MSR_DCD_LSB) & MSR_DCD_MASK) -#define MSR_RI_MSB 6 -#define MSR_RI_LSB 6 -#define MSR_RI_MASK 0x00000040 -#define MSR_RI_GET(x) (((x) & MSR_RI_MASK) >> MSR_RI_LSB) -#define MSR_RI_SET(x) (((x) << MSR_RI_LSB) & MSR_RI_MASK) -#define MSR_DSR_MSB 5 -#define MSR_DSR_LSB 5 -#define MSR_DSR_MASK 0x00000020 -#define MSR_DSR_GET(x) (((x) & MSR_DSR_MASK) >> MSR_DSR_LSB) -#define MSR_DSR_SET(x) (((x) << MSR_DSR_LSB) & MSR_DSR_MASK) -#define MSR_CTS_MSB 4 -#define MSR_CTS_LSB 4 -#define MSR_CTS_MASK 0x00000010 -#define MSR_CTS_GET(x) (((x) & MSR_CTS_MASK) >> MSR_CTS_LSB) -#define MSR_CTS_SET(x) (((x) << MSR_CTS_LSB) & MSR_CTS_MASK) -#define MSR_DDCD_MSB 3 -#define MSR_DDCD_LSB 3 -#define MSR_DDCD_MASK 0x00000008 -#define MSR_DDCD_GET(x) (((x) & MSR_DDCD_MASK) >> MSR_DDCD_LSB) -#define MSR_DDCD_SET(x) (((x) << MSR_DDCD_LSB) & MSR_DDCD_MASK) -#define MSR_TERI_MSB 2 -#define MSR_TERI_LSB 2 -#define MSR_TERI_MASK 0x00000004 -#define MSR_TERI_GET(x) (((x) & MSR_TERI_MASK) >> MSR_TERI_LSB) -#define MSR_TERI_SET(x) (((x) << MSR_TERI_LSB) & MSR_TERI_MASK) -#define MSR_DDSR_MSB 1 -#define MSR_DDSR_LSB 1 -#define MSR_DDSR_MASK 0x00000002 -#define MSR_DDSR_GET(x) (((x) & MSR_DDSR_MASK) >> MSR_DDSR_LSB) -#define MSR_DDSR_SET(x) (((x) << MSR_DDSR_LSB) & MSR_DDSR_MASK) -#define MSR_DCTS_MSB 0 -#define MSR_DCTS_LSB 0 -#define MSR_DCTS_MASK 0x00000001 -#define MSR_DCTS_GET(x) (((x) & MSR_DCTS_MASK) >> MSR_DCTS_LSB) -#define MSR_DCTS_SET(x) (((x) << MSR_DCTS_LSB) & MSR_DCTS_MASK) - -#define SCR_ADDRESS 0x0000001c -#define SCR_OFFSET 0x0000001c -#define SCR_SCR_MSB 7 -#define SCR_SCR_LSB 0 -#define SCR_SCR_MASK 0x000000ff -#define SCR_SCR_GET(x) (((x) & SCR_SCR_MASK) >> SCR_SCR_LSB) -#define SCR_SCR_SET(x) (((x) << SCR_SCR_LSB) & SCR_SCR_MASK) - -#define SRBR_ADDRESS 0x00000020 -#define SRBR_OFFSET 0x00000020 -#define SRBR_SRBR_MSB 7 -#define SRBR_SRBR_LSB 0 -#define SRBR_SRBR_MASK 0x000000ff -#define SRBR_SRBR_GET(x) (((x) & SRBR_SRBR_MASK) >> SRBR_SRBR_LSB) -#define SRBR_SRBR_SET(x) (((x) << SRBR_SRBR_LSB) & SRBR_SRBR_MASK) - -#define SIIR_ADDRESS 0x00000028 -#define SIIR_OFFSET 0x00000028 -#define SIIR_SIIR_MSB 7 -#define SIIR_SIIR_LSB 0 -#define SIIR_SIIR_MASK 0x000000ff -#define SIIR_SIIR_GET(x) (((x) & SIIR_SIIR_MASK) >> SIIR_SIIR_LSB) -#define SIIR_SIIR_SET(x) (((x) << SIIR_SIIR_LSB) & SIIR_SIIR_MASK) - -#define MWR_ADDRESS 0x0000002c -#define MWR_OFFSET 0x0000002c -#define MWR_MWR_MSB 31 -#define MWR_MWR_LSB 0 -#define MWR_MWR_MASK 0xffffffff -#define MWR_MWR_GET(x) (((x) & MWR_MWR_MASK) >> MWR_MWR_LSB) -#define MWR_MWR_SET(x) (((x) << MWR_MWR_LSB) & MWR_MWR_MASK) - -#define SLSR_ADDRESS 0x00000034 -#define SLSR_OFFSET 0x00000034 -#define SLSR_SLSR_MSB 7 -#define SLSR_SLSR_LSB 0 -#define SLSR_SLSR_MASK 0x000000ff -#define SLSR_SLSR_GET(x) (((x) & SLSR_SLSR_MASK) >> SLSR_SLSR_LSB) -#define SLSR_SLSR_SET(x) (((x) << SLSR_SLSR_LSB) & SLSR_SLSR_MASK) - -#define SMSR_ADDRESS 0x00000038 -#define SMSR_OFFSET 0x00000038 -#define SMSR_SMSR_MSB 7 -#define SMSR_SMSR_LSB 0 -#define SMSR_SMSR_MASK 0x000000ff -#define SMSR_SMSR_GET(x) (((x) & SMSR_SMSR_MASK) >> SMSR_SMSR_LSB) -#define SMSR_SMSR_SET(x) (((x) << SMSR_SMSR_LSB) & SMSR_SMSR_MASK) - -#define MRR_ADDRESS 0x0000003c -#define MRR_OFFSET 0x0000003c -#define MRR_MRR_MSB 31 -#define MRR_MRR_LSB 0 -#define MRR_MRR_MASK 0xffffffff -#define MRR_MRR_GET(x) (((x) & MRR_MRR_MASK) >> MRR_MRR_LSB) -#define MRR_MRR_SET(x) (((x) << MRR_MRR_LSB) & MRR_MRR_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct uart_reg_reg_s { - volatile unsigned int rbr; - volatile unsigned int dlh; - volatile unsigned int iir; - volatile unsigned int lcr; - volatile unsigned int mcr; - volatile unsigned int lsr; - volatile unsigned int msr; - volatile unsigned int scr; - volatile unsigned int srbr; - unsigned char pad0[4]; /* pad to 0x28 */ - volatile unsigned int siir; - volatile unsigned int mwr; - unsigned char pad1[4]; /* pad to 0x34 */ - volatile unsigned int slsr; - volatile unsigned int smsr; - volatile unsigned int mrr; -} uart_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _UART_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/uart_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/uart_reg.vrh deleted file mode 100644 index fe59c18daa3f..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/uart_reg.vrh +++ /dev/null @@ -1,488 +0,0 @@ -#ifndef _UART_REG_VRH_ -#define _UART_REG_VRH_ - -#define RBR_ADDRESS 'h00000000 -#define RBR_RBR_MSB 7 -#define RBR_RBR_LSB 0 -#define RBR_RBR_MASK 'h000000ff -#define RBR_RBR_GET(x) (((x) & RBR_RBR_MASK) >> RBR_RBR_LSB) -#define RBR_RBR_SET(x) (((32'd0 | (x)) << RBR_RBR_LSB) & RBR_RBR_MASK) -#define RBR_RBR_RESET 8'h0 -#define RBR_RESET (32'h0 | \ - RBR_RBR_SET(RBR_RBR_RESET)) -#define RBR_HW_MASK (32'h0 | \ - RBR_RBR_MASK) -#define RBR_SW_MASK (32'h0) - -#define THR_ADDRESS 'h00000000 -#define THR_THR_MSB 7 -#define THR_THR_LSB 0 -#define THR_THR_MASK 'h000000ff -#define THR_THR_GET(x) (((x) & THR_THR_MASK) >> THR_THR_LSB) -#define THR_THR_SET(x) (((32'd0 | (x)) << THR_THR_LSB) & THR_THR_MASK) -#define THR_THR_RESET 8'h0 -#define THR_RESET (32'h0 | \ - THR_THR_SET(THR_THR_RESET)) -#define THR_HW_MASK (32'h0) -#define THR_SW_MASK (32'h0 | \ - THR_THR_MASK) - -#define DLL_ADDRESS 'h00000000 -#define DLL_DLL_MSB 7 -#define DLL_DLL_LSB 0 -#define DLL_DLL_MASK 'h000000ff -#define DLL_DLL_GET(x) (((x) & DLL_DLL_MASK) >> DLL_DLL_LSB) -#define DLL_DLL_SET(x) (((32'd0 | (x)) << DLL_DLL_LSB) & DLL_DLL_MASK) -#define DLL_DLL_RESET 8'h0 -#define DLL_RESET (32'h0 | \ - DLL_DLL_SET(DLL_DLL_RESET)) -#define DLL_HW_MASK (32'h0) -#define DLL_SW_MASK (32'h0 | \ - DLL_DLL_MASK) - -#define DLH_ADDRESS 'h00000004 -#define DLH_DLH_MSB 7 -#define DLH_DLH_LSB 0 -#define DLH_DLH_MASK 'h000000ff -#define DLH_DLH_GET(x) (((x) & DLH_DLH_MASK) >> DLH_DLH_LSB) -#define DLH_DLH_SET(x) (((32'd0 | (x)) << DLH_DLH_LSB) & DLH_DLH_MASK) -#define DLH_DLH_RESET 8'h0 -#define DLH_RESET (32'h0 | \ - DLH_DLH_SET(DLH_DLH_RESET)) -#define DLH_HW_MASK (32'h0) -#define DLH_SW_MASK (32'h0 | \ - DLH_DLH_MASK) - -#define IER_ADDRESS 'h00000004 -#define IER_EDDSI_MSB 3 -#define IER_EDDSI_LSB 3 -#define IER_EDDSI_MASK 'h00000008 -#define IER_EDDSI_GET(x) (((x) & IER_EDDSI_MASK) >> IER_EDDSI_LSB) -#define IER_EDDSI_SET(x) (((32'd0 | (x)) << IER_EDDSI_LSB) & IER_EDDSI_MASK) -#define IER_EDDSI_RESET 1'h0 -#define IER_ELSI_MSB 2 -#define IER_ELSI_LSB 2 -#define IER_ELSI_MASK 'h00000004 -#define IER_ELSI_GET(x) (((x) & IER_ELSI_MASK) >> IER_ELSI_LSB) -#define IER_ELSI_SET(x) (((32'd0 | (x)) << IER_ELSI_LSB) & IER_ELSI_MASK) -#define IER_ELSI_RESET 1'h0 -#define IER_ETBEI_MSB 1 -#define IER_ETBEI_LSB 1 -#define IER_ETBEI_MASK 'h00000002 -#define IER_ETBEI_GET(x) (((x) & IER_ETBEI_MASK) >> IER_ETBEI_LSB) -#define IER_ETBEI_SET(x) (((32'd0 | (x)) << IER_ETBEI_LSB) & IER_ETBEI_MASK) -#define IER_ETBEI_RESET 1'h0 -#define IER_ERBFI_MSB 0 -#define IER_ERBFI_LSB 0 -#define IER_ERBFI_MASK 'h00000001 -#define IER_ERBFI_GET(x) (((x) & IER_ERBFI_MASK) >> IER_ERBFI_LSB) -#define IER_ERBFI_SET(x) (((32'd0 | (x)) << IER_ERBFI_LSB) & IER_ERBFI_MASK) -#define IER_ERBFI_RESET 1'h0 -#define IER_RESET (32'h0 | \ - IER_EDDSI_SET(IER_EDDSI_RESET) | \ - IER_ELSI_SET(IER_ELSI_RESET) | \ - IER_ETBEI_SET(IER_ETBEI_RESET) | \ - IER_ERBFI_SET(IER_ERBFI_RESET)) -#define IER_HW_MASK (32'h0) -#define IER_SW_MASK (32'h0 | \ - IER_EDDSI_MASK | \ - IER_ELSI_MASK | \ - IER_ETBEI_MASK | \ - IER_ERBFI_MASK) - -#define IIR_ADDRESS 'h00000008 -#define IIR_FIFO_STATUS_MSB 7 -#define IIR_FIFO_STATUS_LSB 6 -#define IIR_FIFO_STATUS_MASK 'h000000c0 -#define IIR_FIFO_STATUS_GET(x) (((x) & IIR_FIFO_STATUS_MASK) >> IIR_FIFO_STATUS_LSB) -#define IIR_FIFO_STATUS_SET(x) (((32'd0 | (x)) << IIR_FIFO_STATUS_LSB) & IIR_FIFO_STATUS_MASK) -#define IIR_FIFO_STATUS_RESET 2'h0 -#define IIR_IID_MSB 3 -#define IIR_IID_LSB 0 -#define IIR_IID_MASK 'h0000000f -#define IIR_IID_GET(x) (((x) & IIR_IID_MASK) >> IIR_IID_LSB) -#define IIR_IID_SET(x) (((32'd0 | (x)) << IIR_IID_LSB) & IIR_IID_MASK) -#define IIR_IID_RESET 4'h0 -#define IIR_RESET (32'h0 | \ - IIR_FIFO_STATUS_SET(IIR_FIFO_STATUS_RESET) | \ - IIR_IID_SET(IIR_IID_RESET)) -#define IIR_HW_MASK (32'h0 | \ - IIR_FIFO_STATUS_MASK | \ - IIR_IID_MASK) -#define IIR_SW_MASK (32'h0) - -#define FCR_ADDRESS 'h00000008 -#define FCR_RCVR_TRIG_MSB 7 -#define FCR_RCVR_TRIG_LSB 6 -#define FCR_RCVR_TRIG_MASK 'h000000c0 -#define FCR_RCVR_TRIG_GET(x) (((x) & FCR_RCVR_TRIG_MASK) >> FCR_RCVR_TRIG_LSB) -#define FCR_RCVR_TRIG_SET(x) (((32'd0 | (x)) << FCR_RCVR_TRIG_LSB) & FCR_RCVR_TRIG_MASK) -#define FCR_RCVR_TRIG_RESET 2'h0 -#define FCR_DMA_MODE_MSB 3 -#define FCR_DMA_MODE_LSB 3 -#define FCR_DMA_MODE_MASK 'h00000008 -#define FCR_DMA_MODE_GET(x) (((x) & FCR_DMA_MODE_MASK) >> FCR_DMA_MODE_LSB) -#define FCR_DMA_MODE_SET(x) (((32'd0 | (x)) << FCR_DMA_MODE_LSB) & FCR_DMA_MODE_MASK) -#define FCR_DMA_MODE_RESET 1'h0 -#define FCR_XMIT_FIFO_RST_MSB 2 -#define FCR_XMIT_FIFO_RST_LSB 2 -#define FCR_XMIT_FIFO_RST_MASK 'h00000004 -#define FCR_XMIT_FIFO_RST_GET(x) (((x) & FCR_XMIT_FIFO_RST_MASK) >> FCR_XMIT_FIFO_RST_LSB) -#define FCR_XMIT_FIFO_RST_SET(x) (((32'd0 | (x)) << FCR_XMIT_FIFO_RST_LSB) & FCR_XMIT_FIFO_RST_MASK) -#define FCR_XMIT_FIFO_RST_RESET 1'h0 -#define FCR_RCVR_FIFO_RST_MSB 1 -#define FCR_RCVR_FIFO_RST_LSB 1 -#define FCR_RCVR_FIFO_RST_MASK 'h00000002 -#define FCR_RCVR_FIFO_RST_GET(x) (((x) & FCR_RCVR_FIFO_RST_MASK) >> FCR_RCVR_FIFO_RST_LSB) -#define FCR_RCVR_FIFO_RST_SET(x) (((32'd0 | (x)) << FCR_RCVR_FIFO_RST_LSB) & FCR_RCVR_FIFO_RST_MASK) -#define FCR_RCVR_FIFO_RST_RESET 1'h0 -#define FCR_FIFO_EN_MSB 0 -#define FCR_FIFO_EN_LSB 0 -#define FCR_FIFO_EN_MASK 'h00000001 -#define FCR_FIFO_EN_GET(x) (((x) & FCR_FIFO_EN_MASK) >> FCR_FIFO_EN_LSB) -#define FCR_FIFO_EN_SET(x) (((32'd0 | (x)) << FCR_FIFO_EN_LSB) & FCR_FIFO_EN_MASK) -#define FCR_FIFO_EN_RESET 1'h0 -#define FCR_RESET (32'h0 | \ - FCR_RCVR_TRIG_SET(FCR_RCVR_TRIG_RESET) | \ - FCR_DMA_MODE_SET(FCR_DMA_MODE_RESET) | \ - FCR_XMIT_FIFO_RST_SET(FCR_XMIT_FIFO_RST_RESET) | \ - FCR_RCVR_FIFO_RST_SET(FCR_RCVR_FIFO_RST_RESET) | \ - FCR_FIFO_EN_SET(FCR_FIFO_EN_RESET)) -#define FCR_HW_MASK (32'h0) -#define FCR_SW_MASK (32'h0 | \ - FCR_RCVR_TRIG_MASK | \ - FCR_DMA_MODE_MASK | \ - FCR_XMIT_FIFO_RST_MASK | \ - FCR_RCVR_FIFO_RST_MASK | \ - FCR_FIFO_EN_MASK) - -#define LCR_ADDRESS 'h0000000c -#define LCR_DLAB_MSB 7 -#define LCR_DLAB_LSB 7 -#define LCR_DLAB_MASK 'h00000080 -#define LCR_DLAB_GET(x) (((x) & LCR_DLAB_MASK) >> LCR_DLAB_LSB) -#define LCR_DLAB_SET(x) (((32'd0 | (x)) << LCR_DLAB_LSB) & LCR_DLAB_MASK) -#define LCR_DLAB_RESET 1'h0 -#define LCR_BREAK_MSB 6 -#define LCR_BREAK_LSB 6 -#define LCR_BREAK_MASK 'h00000040 -#define LCR_BREAK_GET(x) (((x) & LCR_BREAK_MASK) >> LCR_BREAK_LSB) -#define LCR_BREAK_SET(x) (((32'd0 | (x)) << LCR_BREAK_LSB) & LCR_BREAK_MASK) -#define LCR_BREAK_RESET 1'h0 -#define LCR_EPS_MSB 4 -#define LCR_EPS_LSB 4 -#define LCR_EPS_MASK 'h00000010 -#define LCR_EPS_GET(x) (((x) & LCR_EPS_MASK) >> LCR_EPS_LSB) -#define LCR_EPS_SET(x) (((32'd0 | (x)) << LCR_EPS_LSB) & LCR_EPS_MASK) -#define LCR_EPS_RESET 1'h0 -#define LCR_PEN_MSB 3 -#define LCR_PEN_LSB 3 -#define LCR_PEN_MASK 'h00000008 -#define LCR_PEN_GET(x) (((x) & LCR_PEN_MASK) >> LCR_PEN_LSB) -#define LCR_PEN_SET(x) (((32'd0 | (x)) << LCR_PEN_LSB) & LCR_PEN_MASK) -#define LCR_PEN_RESET 1'h0 -#define LCR_STOP_MSB 2 -#define LCR_STOP_LSB 2 -#define LCR_STOP_MASK 'h00000004 -#define LCR_STOP_GET(x) (((x) & LCR_STOP_MASK) >> LCR_STOP_LSB) -#define LCR_STOP_SET(x) (((32'd0 | (x)) << LCR_STOP_LSB) & LCR_STOP_MASK) -#define LCR_STOP_RESET 1'h0 -#define LCR_CLS_MSB 1 -#define LCR_CLS_LSB 0 -#define LCR_CLS_MASK 'h00000003 -#define LCR_CLS_GET(x) (((x) & LCR_CLS_MASK) >> LCR_CLS_LSB) -#define LCR_CLS_SET(x) (((32'd0 | (x)) << LCR_CLS_LSB) & LCR_CLS_MASK) -#define LCR_CLS_RESET 2'h0 -#define LCR_RESET (32'h0 | \ - LCR_DLAB_SET(LCR_DLAB_RESET) | \ - LCR_BREAK_SET(LCR_BREAK_RESET) | \ - LCR_EPS_SET(LCR_EPS_RESET) | \ - LCR_PEN_SET(LCR_PEN_RESET) | \ - LCR_STOP_SET(LCR_STOP_RESET) | \ - LCR_CLS_SET(LCR_CLS_RESET)) -#define LCR_HW_MASK (32'h0) -#define LCR_SW_MASK (32'h0 | \ - LCR_DLAB_MASK | \ - LCR_BREAK_MASK | \ - LCR_EPS_MASK | \ - LCR_PEN_MASK | \ - LCR_STOP_MASK | \ - LCR_CLS_MASK) - -#define MCR_ADDRESS 'h00000010 -#define MCR_LOOPBACK_MSB 5 -#define MCR_LOOPBACK_LSB 5 -#define MCR_LOOPBACK_MASK 'h00000020 -#define MCR_LOOPBACK_GET(x) (((x) & MCR_LOOPBACK_MASK) >> MCR_LOOPBACK_LSB) -#define MCR_LOOPBACK_SET(x) (((32'd0 | (x)) << MCR_LOOPBACK_LSB) & MCR_LOOPBACK_MASK) -#define MCR_LOOPBACK_RESET 1'h1 -#define MCR_OUT2_MSB 3 -#define MCR_OUT2_LSB 3 -#define MCR_OUT2_MASK 'h00000008 -#define MCR_OUT2_GET(x) (((x) & MCR_OUT2_MASK) >> MCR_OUT2_LSB) -#define MCR_OUT2_SET(x) (((32'd0 | (x)) << MCR_OUT2_LSB) & MCR_OUT2_MASK) -#define MCR_OUT2_RESET 1'h1 -#define MCR_OUT1_MSB 2 -#define MCR_OUT1_LSB 2 -#define MCR_OUT1_MASK 'h00000004 -#define MCR_OUT1_GET(x) (((x) & MCR_OUT1_MASK) >> MCR_OUT1_LSB) -#define MCR_OUT1_SET(x) (((32'd0 | (x)) << MCR_OUT1_LSB) & MCR_OUT1_MASK) -#define MCR_OUT1_RESET 1'h1 -#define MCR_RTS_MSB 1 -#define MCR_RTS_LSB 1 -#define MCR_RTS_MASK 'h00000002 -#define MCR_RTS_GET(x) (((x) & MCR_RTS_MASK) >> MCR_RTS_LSB) -#define MCR_RTS_SET(x) (((32'd0 | (x)) << MCR_RTS_LSB) & MCR_RTS_MASK) -#define MCR_RTS_RESET 1'h1 -#define MCR_DTR_MSB 0 -#define MCR_DTR_LSB 0 -#define MCR_DTR_MASK 'h00000001 -#define MCR_DTR_GET(x) (((x) & MCR_DTR_MASK) >> MCR_DTR_LSB) -#define MCR_DTR_SET(x) (((32'd0 | (x)) << MCR_DTR_LSB) & MCR_DTR_MASK) -#define MCR_DTR_RESET 1'h1 -#define MCR_RESET (32'h0 | \ - MCR_LOOPBACK_SET(MCR_LOOPBACK_RESET) | \ - MCR_OUT2_SET(MCR_OUT2_RESET) | \ - MCR_OUT1_SET(MCR_OUT1_RESET) | \ - MCR_RTS_SET(MCR_RTS_RESET) | \ - MCR_DTR_SET(MCR_DTR_RESET)) -#define MCR_HW_MASK (32'h0) -#define MCR_SW_MASK (32'h0 | \ - MCR_LOOPBACK_MASK | \ - MCR_OUT2_MASK | \ - MCR_OUT1_MASK | \ - MCR_RTS_MASK | \ - MCR_DTR_MASK) - -#define LSR_ADDRESS 'h00000014 -#define LSR_FERR_MSB 7 -#define LSR_FERR_LSB 7 -#define LSR_FERR_MASK 'h00000080 -#define LSR_FERR_GET(x) (((x) & LSR_FERR_MASK) >> LSR_FERR_LSB) -#define LSR_FERR_SET(x) (((32'd0 | (x)) << LSR_FERR_LSB) & LSR_FERR_MASK) -#define LSR_FERR_RESET 1'h0 -#define LSR_TEMT_MSB 6 -#define LSR_TEMT_LSB 6 -#define LSR_TEMT_MASK 'h00000040 -#define LSR_TEMT_GET(x) (((x) & LSR_TEMT_MASK) >> LSR_TEMT_LSB) -#define LSR_TEMT_SET(x) (((32'd0 | (x)) << LSR_TEMT_LSB) & LSR_TEMT_MASK) -#define LSR_TEMT_RESET 1'h0 -#define LSR_THRE_MSB 5 -#define LSR_THRE_LSB 5 -#define LSR_THRE_MASK 'h00000020 -#define LSR_THRE_GET(x) (((x) & LSR_THRE_MASK) >> LSR_THRE_LSB) -#define LSR_THRE_SET(x) (((32'd0 | (x)) << LSR_THRE_LSB) & LSR_THRE_MASK) -#define LSR_THRE_RESET 1'h0 -#define LSR_BI_MSB 4 -#define LSR_BI_LSB 4 -#define LSR_BI_MASK 'h00000010 -#define LSR_BI_GET(x) (((x) & LSR_BI_MASK) >> LSR_BI_LSB) -#define LSR_BI_SET(x) (((32'd0 | (x)) << LSR_BI_LSB) & LSR_BI_MASK) -#define LSR_BI_RESET 1'h0 -#define LSR_FE_MSB 3 -#define LSR_FE_LSB 3 -#define LSR_FE_MASK 'h00000008 -#define LSR_FE_GET(x) (((x) & LSR_FE_MASK) >> LSR_FE_LSB) -#define LSR_FE_SET(x) (((32'd0 | (x)) << LSR_FE_LSB) & LSR_FE_MASK) -#define LSR_FE_RESET 1'h0 -#define LSR_PE_MSB 2 -#define LSR_PE_LSB 2 -#define LSR_PE_MASK 'h00000004 -#define LSR_PE_GET(x) (((x) & LSR_PE_MASK) >> LSR_PE_LSB) -#define LSR_PE_SET(x) (((32'd0 | (x)) << LSR_PE_LSB) & LSR_PE_MASK) -#define LSR_PE_RESET 1'h0 -#define LSR_OE_MSB 1 -#define LSR_OE_LSB 1 -#define LSR_OE_MASK 'h00000002 -#define LSR_OE_GET(x) (((x) & LSR_OE_MASK) >> LSR_OE_LSB) -#define LSR_OE_SET(x) (((32'd0 | (x)) << LSR_OE_LSB) & LSR_OE_MASK) -#define LSR_OE_RESET 1'h0 -#define LSR_DR_MSB 0 -#define LSR_DR_LSB 0 -#define LSR_DR_MASK 'h00000001 -#define LSR_DR_GET(x) (((x) & LSR_DR_MASK) >> LSR_DR_LSB) -#define LSR_DR_SET(x) (((32'd0 | (x)) << LSR_DR_LSB) & LSR_DR_MASK) -#define LSR_DR_RESET 1'h0 -#define LSR_RESET (32'h0 | \ - LSR_FERR_SET(LSR_FERR_RESET) | \ - LSR_TEMT_SET(LSR_TEMT_RESET) | \ - LSR_THRE_SET(LSR_THRE_RESET) | \ - LSR_BI_SET(LSR_BI_RESET) | \ - LSR_FE_SET(LSR_FE_RESET) | \ - LSR_PE_SET(LSR_PE_RESET) | \ - LSR_OE_SET(LSR_OE_RESET) | \ - LSR_DR_SET(LSR_DR_RESET)) -#define LSR_HW_MASK (32'h0) -#define LSR_SW_MASK (32'h0 | \ - LSR_FERR_MASK | \ - LSR_TEMT_MASK | \ - LSR_THRE_MASK | \ - LSR_BI_MASK | \ - LSR_FE_MASK | \ - LSR_PE_MASK | \ - LSR_OE_MASK | \ - LSR_DR_MASK) - -#define MSR_ADDRESS 'h00000018 -#define MSR_DCD_MSB 7 -#define MSR_DCD_LSB 7 -#define MSR_DCD_MASK 'h00000080 -#define MSR_DCD_GET(x) (((x) & MSR_DCD_MASK) >> MSR_DCD_LSB) -#define MSR_DCD_SET(x) (((32'd0 | (x)) << MSR_DCD_LSB) & MSR_DCD_MASK) -#define MSR_DCD_RESET 1'h0 -#define MSR_RI_MSB 6 -#define MSR_RI_LSB 6 -#define MSR_RI_MASK 'h00000040 -#define MSR_RI_GET(x) (((x) & MSR_RI_MASK) >> MSR_RI_LSB) -#define MSR_RI_SET(x) (((32'd0 | (x)) << MSR_RI_LSB) & MSR_RI_MASK) -#define MSR_RI_RESET 1'h0 -#define MSR_DSR_MSB 5 -#define MSR_DSR_LSB 5 -#define MSR_DSR_MASK 'h00000020 -#define MSR_DSR_GET(x) (((x) & MSR_DSR_MASK) >> MSR_DSR_LSB) -#define MSR_DSR_SET(x) (((32'd0 | (x)) << MSR_DSR_LSB) & MSR_DSR_MASK) -#define MSR_DSR_RESET 1'h0 -#define MSR_CTS_MSB 4 -#define MSR_CTS_LSB 4 -#define MSR_CTS_MASK 'h00000010 -#define MSR_CTS_GET(x) (((x) & MSR_CTS_MASK) >> MSR_CTS_LSB) -#define MSR_CTS_SET(x) (((32'd0 | (x)) << MSR_CTS_LSB) & MSR_CTS_MASK) -#define MSR_CTS_RESET 1'h0 -#define MSR_DDCD_MSB 3 -#define MSR_DDCD_LSB 3 -#define MSR_DDCD_MASK 'h00000008 -#define MSR_DDCD_GET(x) (((x) & MSR_DDCD_MASK) >> MSR_DDCD_LSB) -#define MSR_DDCD_SET(x) (((32'd0 | (x)) << MSR_DDCD_LSB) & MSR_DDCD_MASK) -#define MSR_DDCD_RESET 1'h0 -#define MSR_TERI_MSB 2 -#define MSR_TERI_LSB 2 -#define MSR_TERI_MASK 'h00000004 -#define MSR_TERI_GET(x) (((x) & MSR_TERI_MASK) >> MSR_TERI_LSB) -#define MSR_TERI_SET(x) (((32'd0 | (x)) << MSR_TERI_LSB) & MSR_TERI_MASK) -#define MSR_TERI_RESET 1'h0 -#define MSR_DDSR_MSB 1 -#define MSR_DDSR_LSB 1 -#define MSR_DDSR_MASK 'h00000002 -#define MSR_DDSR_GET(x) (((x) & MSR_DDSR_MASK) >> MSR_DDSR_LSB) -#define MSR_DDSR_SET(x) (((32'd0 | (x)) << MSR_DDSR_LSB) & MSR_DDSR_MASK) -#define MSR_DDSR_RESET 1'h0 -#define MSR_DCTS_MSB 0 -#define MSR_DCTS_LSB 0 -#define MSR_DCTS_MASK 'h00000001 -#define MSR_DCTS_GET(x) (((x) & MSR_DCTS_MASK) >> MSR_DCTS_LSB) -#define MSR_DCTS_SET(x) (((32'd0 | (x)) << MSR_DCTS_LSB) & MSR_DCTS_MASK) -#define MSR_DCTS_RESET 1'h0 -#define MSR_RESET (32'h0 | \ - MSR_DCD_SET(MSR_DCD_RESET) | \ - MSR_RI_SET(MSR_RI_RESET) | \ - MSR_DSR_SET(MSR_DSR_RESET) | \ - MSR_CTS_SET(MSR_CTS_RESET) | \ - MSR_DDCD_SET(MSR_DDCD_RESET) | \ - MSR_TERI_SET(MSR_TERI_RESET) | \ - MSR_DDSR_SET(MSR_DDSR_RESET) | \ - MSR_DCTS_SET(MSR_DCTS_RESET)) -#define MSR_HW_MASK (32'h0) -#define MSR_SW_MASK (32'h0 | \ - MSR_DCD_MASK | \ - MSR_RI_MASK | \ - MSR_DSR_MASK | \ - MSR_CTS_MASK | \ - MSR_DDCD_MASK | \ - MSR_TERI_MASK | \ - MSR_DDSR_MASK | \ - MSR_DCTS_MASK) - -#define SCR_ADDRESS 'h0000001c -#define SCR_SCR_MSB 7 -#define SCR_SCR_LSB 0 -#define SCR_SCR_MASK 'h000000ff -#define SCR_SCR_GET(x) (((x) & SCR_SCR_MASK) >> SCR_SCR_LSB) -#define SCR_SCR_SET(x) (((32'd0 | (x)) << SCR_SCR_LSB) & SCR_SCR_MASK) -#define SCR_SCR_RESET 8'h0 -#define SCR_RESET (32'h0 | \ - SCR_SCR_SET(SCR_SCR_RESET)) -#define SCR_HW_MASK (32'h0) -#define SCR_SW_MASK (32'h0 | \ - SCR_SCR_MASK) - -#define SRBR_ADDRESS 'h00000020 -#define SRBR_SRBR_MSB 7 -#define SRBR_SRBR_LSB 0 -#define SRBR_SRBR_MASK 'h000000ff -#define SRBR_SRBR_GET(x) (((x) & SRBR_SRBR_MASK) >> SRBR_SRBR_LSB) -#define SRBR_SRBR_SET(x) (((32'd0 | (x)) << SRBR_SRBR_LSB) & SRBR_SRBR_MASK) -#define SRBR_SRBR_RESET 8'h0 -#define SRBR_RESET (32'h0 | \ - SRBR_SRBR_SET(SRBR_SRBR_RESET)) -#define SRBR_HW_MASK (32'h0) -#define SRBR_SW_MASK (32'h0 | \ - SRBR_SRBR_MASK) - -#define SIIR_ADDRESS 'h00000028 -#define SIIR_SIIR_MSB 7 -#define SIIR_SIIR_LSB 0 -#define SIIR_SIIR_MASK 'h000000ff -#define SIIR_SIIR_GET(x) (((x) & SIIR_SIIR_MASK) >> SIIR_SIIR_LSB) -#define SIIR_SIIR_SET(x) (((32'd0 | (x)) << SIIR_SIIR_LSB) & SIIR_SIIR_MASK) -#define SIIR_SIIR_RESET 8'h0 -#define SIIR_RESET (32'h0 | \ - SIIR_SIIR_SET(SIIR_SIIR_RESET)) -#define SIIR_HW_MASK (32'h0) -#define SIIR_SW_MASK (32'h0 | \ - SIIR_SIIR_MASK) - -#define MWR_ADDRESS 'h0000002c -#define MWR_MWR_MSB 31 -#define MWR_MWR_LSB 0 -#define MWR_MWR_MASK 'hffffffff -#define MWR_MWR_GET(x) (((x) & MWR_MWR_MASK) >> MWR_MWR_LSB) -#define MWR_MWR_SET(x) (((32'd0 | (x)) << MWR_MWR_LSB) & MWR_MWR_MASK) -#define MWR_MWR_RESET 32'h0 -#define MWR_RESET (32'h0 | \ - MWR_MWR_SET(MWR_MWR_RESET)) -#define MWR_HW_MASK (32'h0) -#define MWR_SW_MASK (32'h0 | \ - MWR_MWR_MASK) - -#define SLSR_ADDRESS 'h00000034 -#define SLSR_SLSR_MSB 7 -#define SLSR_SLSR_LSB 0 -#define SLSR_SLSR_MASK 'h000000ff -#define SLSR_SLSR_GET(x) (((x) & SLSR_SLSR_MASK) >> SLSR_SLSR_LSB) -#define SLSR_SLSR_SET(x) (((32'd0 | (x)) << SLSR_SLSR_LSB) & SLSR_SLSR_MASK) -#define SLSR_SLSR_RESET 8'h0 -#define SLSR_RESET (32'h0 | \ - SLSR_SLSR_SET(SLSR_SLSR_RESET)) -#define SLSR_HW_MASK (32'h0) -#define SLSR_SW_MASK (32'h0 | \ - SLSR_SLSR_MASK) - -#define SMSR_ADDRESS 'h00000038 -#define SMSR_SMSR_MSB 7 -#define SMSR_SMSR_LSB 0 -#define SMSR_SMSR_MASK 'h000000ff -#define SMSR_SMSR_GET(x) (((x) & SMSR_SMSR_MASK) >> SMSR_SMSR_LSB) -#define SMSR_SMSR_SET(x) (((32'd0 | (x)) << SMSR_SMSR_LSB) & SMSR_SMSR_MASK) -#define SMSR_SMSR_RESET 8'h0 -#define SMSR_RESET (32'h0 | \ - SMSR_SMSR_SET(SMSR_SMSR_RESET)) -#define SMSR_HW_MASK (32'h0) -#define SMSR_SW_MASK (32'h0 | \ - SMSR_SMSR_MASK) - -#define MRR_ADDRESS 'h0000003c -#define MRR_MRR_MSB 31 -#define MRR_MRR_LSB 0 -#define MRR_MRR_MASK 'hffffffff -#define MRR_MRR_GET(x) (((x) & MRR_MRR_MASK) >> MRR_MRR_LSB) -#define MRR_MRR_SET(x) (((32'd0 | (x)) << MRR_MRR_LSB) & MRR_MRR_MASK) -#define MRR_MRR_RESET 32'h0 -#define MRR_RESET (32'h0 | \ - MRR_MRR_SET(MRR_MRR_RESET)) -#define MRR_HW_MASK (32'h0) -#define MRR_SW_MASK (32'h0 | \ - MRR_MRR_MASK) - -#define UART_REG_ADDRESS_MSB 5 - -#endif /* _UART_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/vmc_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/vmc_reg.h deleted file mode 100644 index 932ec510d26b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/vmc_reg.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef _VMC_REG_REG_H_ -#define _VMC_REG_REG_H_ - -#define MC_TCAM_VALID_ADDRESS 0x00000000 -#define MC_TCAM_VALID_OFFSET 0x00000000 -#define MC_TCAM_VALID_BIT_MSB 0 -#define MC_TCAM_VALID_BIT_LSB 0 -#define MC_TCAM_VALID_BIT_MASK 0x00000001 -#define MC_TCAM_VALID_BIT_GET(x) (((x) & MC_TCAM_VALID_BIT_MASK) >> MC_TCAM_VALID_BIT_LSB) -#define MC_TCAM_VALID_BIT_SET(x) (((x) << MC_TCAM_VALID_BIT_LSB) & MC_TCAM_VALID_BIT_MASK) - -#define MC_TCAM_MASK_ADDRESS 0x00000080 -#define MC_TCAM_MASK_OFFSET 0x00000080 -#define MC_TCAM_MASK_SIZE_MSB 2 -#define MC_TCAM_MASK_SIZE_LSB 0 -#define MC_TCAM_MASK_SIZE_MASK 0x00000007 -#define MC_TCAM_MASK_SIZE_GET(x) (((x) & MC_TCAM_MASK_SIZE_MASK) >> MC_TCAM_MASK_SIZE_LSB) -#define MC_TCAM_MASK_SIZE_SET(x) (((x) << MC_TCAM_MASK_SIZE_LSB) & MC_TCAM_MASK_SIZE_MASK) - -#define MC_TCAM_COMPARE_ADDRESS 0x00000100 -#define MC_TCAM_COMPARE_OFFSET 0x00000100 -#define MC_TCAM_COMPARE_KEY_MSB 21 -#define MC_TCAM_COMPARE_KEY_LSB 5 -#define MC_TCAM_COMPARE_KEY_MASK 0x003fffe0 -#define MC_TCAM_COMPARE_KEY_GET(x) (((x) & MC_TCAM_COMPARE_KEY_MASK) >> MC_TCAM_COMPARE_KEY_LSB) -#define MC_TCAM_COMPARE_KEY_SET(x) (((x) << MC_TCAM_COMPARE_KEY_LSB) & MC_TCAM_COMPARE_KEY_MASK) - -#define MC_TCAM_TARGET_ADDRESS 0x00000180 -#define MC_TCAM_TARGET_OFFSET 0x00000180 -#define MC_TCAM_TARGET_ADDR_MSB 21 -#define MC_TCAM_TARGET_ADDR_LSB 5 -#define MC_TCAM_TARGET_ADDR_MASK 0x003fffe0 -#define MC_TCAM_TARGET_ADDR_GET(x) (((x) & MC_TCAM_TARGET_ADDR_MASK) >> MC_TCAM_TARGET_ADDR_LSB) -#define MC_TCAM_TARGET_ADDR_SET(x) (((x) << MC_TCAM_TARGET_ADDR_LSB) & MC_TCAM_TARGET_ADDR_MASK) - -#define ADDR_ERROR_CONTROL_ADDRESS 0x00000200 -#define ADDR_ERROR_CONTROL_OFFSET 0x00000200 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_MSB 1 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB 1 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK 0x00000002 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_GET(x) (((x) & ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK) >> ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB) -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_SET(x) (((x) << ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB) & ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK) -#define ADDR_ERROR_CONTROL_ENABLE_MSB 0 -#define ADDR_ERROR_CONTROL_ENABLE_LSB 0 -#define ADDR_ERROR_CONTROL_ENABLE_MASK 0x00000001 -#define ADDR_ERROR_CONTROL_ENABLE_GET(x) (((x) & ADDR_ERROR_CONTROL_ENABLE_MASK) >> ADDR_ERROR_CONTROL_ENABLE_LSB) -#define ADDR_ERROR_CONTROL_ENABLE_SET(x) (((x) << ADDR_ERROR_CONTROL_ENABLE_LSB) & ADDR_ERROR_CONTROL_ENABLE_MASK) - -#define ADDR_ERROR_STATUS_ADDRESS 0x00000204 -#define ADDR_ERROR_STATUS_OFFSET 0x00000204 -#define ADDR_ERROR_STATUS_WRITE_MSB 25 -#define ADDR_ERROR_STATUS_WRITE_LSB 25 -#define ADDR_ERROR_STATUS_WRITE_MASK 0x02000000 -#define ADDR_ERROR_STATUS_WRITE_GET(x) (((x) & ADDR_ERROR_STATUS_WRITE_MASK) >> ADDR_ERROR_STATUS_WRITE_LSB) -#define ADDR_ERROR_STATUS_WRITE_SET(x) (((x) << ADDR_ERROR_STATUS_WRITE_LSB) & ADDR_ERROR_STATUS_WRITE_MASK) -#define ADDR_ERROR_STATUS_ADDRESS_MSB 24 -#define ADDR_ERROR_STATUS_ADDRESS_LSB 0 -#define ADDR_ERROR_STATUS_ADDRESS_MASK 0x01ffffff -#define ADDR_ERROR_STATUS_ADDRESS_GET(x) (((x) & ADDR_ERROR_STATUS_ADDRESS_MASK) >> ADDR_ERROR_STATUS_ADDRESS_LSB) -#define ADDR_ERROR_STATUS_ADDRESS_SET(x) (((x) << ADDR_ERROR_STATUS_ADDRESS_LSB) & ADDR_ERROR_STATUS_ADDRESS_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct vmc_reg_reg_s { - volatile unsigned int mc_tcam_valid[32]; - volatile unsigned int mc_tcam_mask[32]; - volatile unsigned int mc_tcam_compare[32]; - volatile unsigned int mc_tcam_target[32]; - volatile unsigned int addr_error_control; - volatile unsigned int addr_error_status; -} vmc_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _VMC_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/vmc_reg.vrh b/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/vmc_reg.vrh deleted file mode 100644 index cd9b7e599390..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw2.0/hw/vmc_reg.vrh +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef _VMC_REG_VRH_ -#define _VMC_REG_VRH_ - -#define MC_TCAM_VALID_ADDRESS 'h00000000 -#define MC_TCAM_VALID_BIT_MSB 0 -#define MC_TCAM_VALID_BIT_LSB 0 -#define MC_TCAM_VALID_BIT_MASK 'h00000001 -#define MC_TCAM_VALID_BIT_GET(x) (((x) & MC_TCAM_VALID_BIT_MASK) >> MC_TCAM_VALID_BIT_LSB) -#define MC_TCAM_VALID_BIT_SET(x) (((32'd0 | (x)) << MC_TCAM_VALID_BIT_LSB) & MC_TCAM_VALID_BIT_MASK) -#define MC_TCAM_VALID_BIT_RESET 1'h0 -#define MC_TCAM_VALID_RESET (32'h0 | \ - MC_TCAM_VALID_BIT_SET(MC_TCAM_VALID_BIT_RESET)) -#define MC_TCAM_VALID_HW_MASK (32'h0) -#define MC_TCAM_VALID_SW_MASK (32'h0 | \ - MC_TCAM_VALID_BIT_MASK) - -#define MC_TCAM_MASK_ADDRESS 'h00000080 -#define MC_TCAM_MASK_SIZE_MSB 2 -#define MC_TCAM_MASK_SIZE_LSB 0 -#define MC_TCAM_MASK_SIZE_MASK 'h00000007 -#define MC_TCAM_MASK_SIZE_GET(x) (((x) & MC_TCAM_MASK_SIZE_MASK) >> MC_TCAM_MASK_SIZE_LSB) -#define MC_TCAM_MASK_SIZE_SET(x) (((32'd0 | (x)) << MC_TCAM_MASK_SIZE_LSB) & MC_TCAM_MASK_SIZE_MASK) -#define MC_TCAM_MASK_SIZE_RESET 3'h0 -#define MC_TCAM_MASK_RESET (32'h0 | \ - MC_TCAM_MASK_SIZE_SET(MC_TCAM_MASK_SIZE_RESET)) -#define MC_TCAM_MASK_HW_MASK (32'h0) -#define MC_TCAM_MASK_SW_MASK (32'h0 | \ - MC_TCAM_MASK_SIZE_MASK) - -#define MC_TCAM_COMPARE_ADDRESS 'h00000100 -#define MC_TCAM_COMPARE_KEY_MSB 21 -#define MC_TCAM_COMPARE_KEY_LSB 5 -#define MC_TCAM_COMPARE_KEY_MASK 'h003fffe0 -#define MC_TCAM_COMPARE_KEY_GET(x) (((x) & MC_TCAM_COMPARE_KEY_MASK) >> MC_TCAM_COMPARE_KEY_LSB) -#define MC_TCAM_COMPARE_KEY_SET(x) (((32'd0 | (x)) << MC_TCAM_COMPARE_KEY_LSB) & MC_TCAM_COMPARE_KEY_MASK) -#define MC_TCAM_COMPARE_KEY_RESET 17'h0 -#define MC_TCAM_COMPARE_RESET (32'h0 | \ - MC_TCAM_COMPARE_KEY_SET(MC_TCAM_COMPARE_KEY_RESET)) -#define MC_TCAM_COMPARE_HW_MASK (32'h0) -#define MC_TCAM_COMPARE_SW_MASK (32'h0 | \ - MC_TCAM_COMPARE_KEY_MASK) - -#define MC_TCAM_TARGET_ADDRESS 'h00000180 -#define MC_TCAM_TARGET_ADDR_MSB 21 -#define MC_TCAM_TARGET_ADDR_LSB 5 -#define MC_TCAM_TARGET_ADDR_MASK 'h003fffe0 -#define MC_TCAM_TARGET_ADDR_GET(x) (((x) & MC_TCAM_TARGET_ADDR_MASK) >> MC_TCAM_TARGET_ADDR_LSB) -#define MC_TCAM_TARGET_ADDR_SET(x) (((32'd0 | (x)) << MC_TCAM_TARGET_ADDR_LSB) & MC_TCAM_TARGET_ADDR_MASK) -#define MC_TCAM_TARGET_ADDR_RESET 17'h0 -#define MC_TCAM_TARGET_RESET (32'h0 | \ - MC_TCAM_TARGET_ADDR_SET(MC_TCAM_TARGET_ADDR_RESET)) -#define MC_TCAM_TARGET_HW_MASK (32'h0) -#define MC_TCAM_TARGET_SW_MASK (32'h0 | \ - MC_TCAM_TARGET_ADDR_MASK) - -#define ADDR_ERROR_CONTROL_ADDRESS 'h00000200 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_MSB 1 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB 1 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK 'h00000002 -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_GET(x) (((x) & ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK) >> ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB) -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_SET(x) (((32'd0 | (x)) << ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB) & ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK) -#define ADDR_ERROR_CONTROL_QUAL_ENABLE_RESET 1'h0 -#define ADDR_ERROR_CONTROL_ENABLE_MSB 0 -#define ADDR_ERROR_CONTROL_ENABLE_LSB 0 -#define ADDR_ERROR_CONTROL_ENABLE_MASK 'h00000001 -#define ADDR_ERROR_CONTROL_ENABLE_GET(x) (((x) & ADDR_ERROR_CONTROL_ENABLE_MASK) >> ADDR_ERROR_CONTROL_ENABLE_LSB) -#define ADDR_ERROR_CONTROL_ENABLE_SET(x) (((32'd0 | (x)) << ADDR_ERROR_CONTROL_ENABLE_LSB) & ADDR_ERROR_CONTROL_ENABLE_MASK) -#define ADDR_ERROR_CONTROL_ENABLE_RESET 1'h0 -#define ADDR_ERROR_CONTROL_RESET (32'h0 | \ - ADDR_ERROR_CONTROL_QUAL_ENABLE_SET(ADDR_ERROR_CONTROL_QUAL_ENABLE_RESET) | \ - ADDR_ERROR_CONTROL_ENABLE_SET(ADDR_ERROR_CONTROL_ENABLE_RESET)) -#define ADDR_ERROR_CONTROL_HW_MASK (32'h0) -#define ADDR_ERROR_CONTROL_SW_MASK (32'h0 | \ - ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK | \ - ADDR_ERROR_CONTROL_ENABLE_MASK) - -#define ADDR_ERROR_STATUS_ADDRESS 'h00000204 -#define ADDR_ERROR_STATUS_WRITE_MSB 25 -#define ADDR_ERROR_STATUS_WRITE_LSB 25 -#define ADDR_ERROR_STATUS_WRITE_MASK 'h02000000 -#define ADDR_ERROR_STATUS_WRITE_GET(x) (((x) & ADDR_ERROR_STATUS_WRITE_MASK) >> ADDR_ERROR_STATUS_WRITE_LSB) -#define ADDR_ERROR_STATUS_WRITE_SET(x) (((32'd0 | (x)) << ADDR_ERROR_STATUS_WRITE_LSB) & ADDR_ERROR_STATUS_WRITE_MASK) -#define ADDR_ERROR_STATUS_WRITE_RESET 1'h0 -#define ADDR_ERROR_STATUS_ADDRESS_MSB 24 -#define ADDR_ERROR_STATUS_ADDRESS_LSB 0 -#define ADDR_ERROR_STATUS_ADDRESS_MASK 'h01ffffff -#define ADDR_ERROR_STATUS_ADDRESS_GET(x) (((x) & ADDR_ERROR_STATUS_ADDRESS_MASK) >> ADDR_ERROR_STATUS_ADDRESS_LSB) -#define ADDR_ERROR_STATUS_ADDRESS_SET(x) (((32'd0 | (x)) << ADDR_ERROR_STATUS_ADDRESS_LSB) & ADDR_ERROR_STATUS_ADDRESS_MASK) -#define ADDR_ERROR_STATUS_ADDRESS_RESET 25'h0 -#define ADDR_ERROR_STATUS_RESET (32'h0 | \ - ADDR_ERROR_STATUS_WRITE_SET(ADDR_ERROR_STATUS_WRITE_RESET) | \ - ADDR_ERROR_STATUS_ADDRESS_SET(ADDR_ERROR_STATUS_ADDRESS_RESET)) -#define ADDR_ERROR_STATUS_HW_MASK (32'h0 | \ - ADDR_ERROR_STATUS_WRITE_MASK | \ - ADDR_ERROR_STATUS_ADDRESS_MASK) -#define ADDR_ERROR_STATUS_SW_MASK (32'h0) - -#define VMC_REG_ADDRESS_MSB 9 - -#endif /* _VMC_REG_VRH_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/analog_intf_ares_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/analog_intf_ares_reg.h deleted file mode 100644 index e504319412b9..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/analog_intf_ares_reg.h +++ /dev/null @@ -1,3291 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2009 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _ANALOG_INTF_ARES_REG_REG_H_ -#define _ANALOG_INTF_ARES_REG_REG_H_ - - -/* macros for RXRF_BIAS1 */ -#define PHY_ANALOG_RXRF_BIAS1_ADDRESS 0x00000000 -#define PHY_ANALOG_RXRF_BIAS1_OFFSET 0x00000000 -#define PHY_ANALOG_RXRF_BIAS1_SPARE_MSB 0 -#define PHY_ANALOG_RXRF_BIAS1_SPARE_LSB 0 -#define PHY_ANALOG_RXRF_BIAS1_SPARE_MASK 0x00000001 -#define PHY_ANALOG_RXRF_BIAS1_SPARE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXRF_BIAS1_SPARE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25SPARE_MSB 3 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25SPARE_LSB 1 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25SPARE_MASK 0x0000000e -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25SPARE_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25SPARE_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO18_MSB 6 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO18_LSB 4 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO18_MASK 0x00000070 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO18_GET(x) (((x) & 0x00000070) >> 4) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO18_SET(x) (((x) << 4) & 0x00000070) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25LO36_MSB 9 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25LO36_LSB 7 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25LO36_MASK 0x00000380 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25LO36_GET(x) (((x) & 0x00000380) >> 7) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25LO36_SET(x) (((x) << 7) & 0x00000380) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2_5GH_MSB 12 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2_5GH_LSB 10 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2_5GH_MASK 0x00001c00 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2_5GH_GET(x) (((x) & 0x00001c00) >> 10) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2_5GH_SET(x) (((x) << 10) & 0x00001c00) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR5GH_MSB 15 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR5GH_LSB 13 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR5GH_MASK 0x0000e000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR5GH_GET(x) (((x) & 0x0000e000) >> 13) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR5GH_SET(x) (((x) << 13) & 0x0000e000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25VGA5G_MSB 18 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25VGA5G_LSB 16 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25VGA5G_MASK 0x00070000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25VGA5G_GET(x) (((x) & 0x00070000) >> 16) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25VGA5G_SET(x) (((x) << 16) & 0x00070000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA5G_MSB 21 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA5G_LSB 19 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA5G_MASK 0x00380000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA5G_GET(x) (((x) & 0x00380000) >> 19) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA5G_SET(x) (((x) << 19) & 0x00380000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO24_MSB 24 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO24_LSB 22 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO24_MASK 0x01c00000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO24_GET(x) (((x) & 0x01c00000) >> 22) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO24_SET(x) (((x) << 22) & 0x01c00000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2GH_MSB 27 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2GH_LSB 25 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2GH_MASK 0x0e000000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2GH_GET(x) (((x) & 0x0e000000) >> 25) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2GH_SET(x) (((x) << 25) & 0x0e000000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA2G_MSB 30 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA2G_LSB 28 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA2G_MASK 0x70000000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA2G_GET(x) (((x) & 0x70000000) >> 28) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA2G_SET(x) (((x) << 28) & 0x70000000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_BIAS_MSB 31 -#define PHY_ANALOG_RXRF_BIAS1_PWD_BIAS_LSB 31 -#define PHY_ANALOG_RXRF_BIAS1_PWD_BIAS_MASK 0x80000000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_BIAS_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_RXRF_BIAS1_PWD_BIAS_SET(x) (((x) << 31) & 0x80000000) - -/* macros for RXRF_BIAS2 */ -#define PHY_ANALOG_RXRF_BIAS2_ADDRESS 0x00000004 -#define PHY_ANALOG_RXRF_BIAS2_OFFSET 0x00000004 -#define PHY_ANALOG_RXRF_BIAS2_SPARE_MSB 0 -#define PHY_ANALOG_RXRF_BIAS2_SPARE_LSB 0 -#define PHY_ANALOG_RXRF_BIAS2_SPARE_MASK 0x00000001 -#define PHY_ANALOG_RXRF_BIAS2_SPARE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXRF_BIAS2_SPARE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXRF_BIAS2_PKEN_MSB 3 -#define PHY_ANALOG_RXRF_BIAS2_PKEN_LSB 1 -#define PHY_ANALOG_RXRF_BIAS2_PKEN_MASK 0x0000000e -#define PHY_ANALOG_RXRF_BIAS2_PKEN_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_ANALOG_RXRF_BIAS2_PKEN_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_ANALOG_RXRF_BIAS2_VCMVALUE_MSB 6 -#define PHY_ANALOG_RXRF_BIAS2_VCMVALUE_LSB 4 -#define PHY_ANALOG_RXRF_BIAS2_VCMVALUE_MASK 0x00000070 -#define PHY_ANALOG_RXRF_BIAS2_VCMVALUE_GET(x) (((x) & 0x00000070) >> 4) -#define PHY_ANALOG_RXRF_BIAS2_VCMVALUE_SET(x) (((x) << 4) & 0x00000070) -#define PHY_ANALOG_RXRF_BIAS2_PWD_VCMBUF_MSB 7 -#define PHY_ANALOG_RXRF_BIAS2_PWD_VCMBUF_LSB 7 -#define PHY_ANALOG_RXRF_BIAS2_PWD_VCMBUF_MASK 0x00000080 -#define PHY_ANALOG_RXRF_BIAS2_PWD_VCMBUF_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RXRF_BIAS2_PWD_VCMBUF_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC5GH_MSB 10 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC5GH_LSB 8 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC5GH_MASK 0x00000700 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC5GH_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC5GH_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC5G_MSB 13 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC5G_LSB 11 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC5G_MASK 0x00003800 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC5G_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC5G_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC5G_MSB 16 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC5G_LSB 14 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC5G_MASK 0x0001c000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC5G_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC5G_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC2GH_MSB 19 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC2GH_LSB 17 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC2GH_MASK 0x000e0000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC2GH_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC2GH_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC2G_MSB 22 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC2G_LSB 20 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC2G_MASK 0x00700000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC2G_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC2G_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC2G_MSB 25 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC2G_LSB 23 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC2G_MASK 0x03800000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC2G_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC2G_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25VCMBUF_MSB 28 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25VCMBUF_LSB 26 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25VCMBUF_MASK 0x1c000000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25VCMBUF_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25VCMBUF_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25VCM_MSB 31 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25VCM_LSB 29 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25VCM_MASK 0xe0000000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25VCM_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25VCM_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for RXRF_GAINSTAGES */ -#define PHY_ANALOG_RXRF_GAINSTAGES_ADDRESS 0x00000008 -#define PHY_ANALOG_RXRF_GAINSTAGES_OFFSET 0x00000008 -#define PHY_ANALOG_RXRF_GAINSTAGES_SPARE_MSB 0 -#define PHY_ANALOG_RXRF_GAINSTAGES_SPARE_LSB 0 -#define PHY_ANALOG_RXRF_GAINSTAGES_SPARE_MASK 0x00000001 -#define PHY_ANALOG_RXRF_GAINSTAGES_SPARE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXRF_GAINSTAGES_SPARE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNAON_CALDC_MSB 1 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNAON_CALDC_LSB 1 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNAON_CALDC_MASK 0x00000002 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNAON_CALDC_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNAON_CALDC_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_CAP_MSB 3 -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_CAP_LSB 2 -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_CAP_MASK 0x0000000c -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_CAP_GET(x) (((x) & 0x0000000c) >> 2) -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_CAP_SET(x) (((x) << 2) & 0x0000000c) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_CAP_MSB 5 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_CAP_LSB 4 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_CAP_MASK 0x00000030 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_CAP_GET(x) (((x) & 0x00000030) >> 4) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_CAP_SET(x) (((x) << 4) & 0x00000030) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_SHORTINP_MSB 6 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_SHORTINP_LSB 6 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_SHORTINP_MASK 0x00000040 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_SHORTINP_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_SHORTINP_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO5G_MSB 7 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO5G_LSB 7 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO5G_MASK 0x00000080 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO5G_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO5G_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_VGA5G_MSB 8 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_VGA5G_LSB 8 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_VGA5G_MASK 0x00000100 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_VGA5G_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_VGA5G_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR5G_MSB 9 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR5G_LSB 9 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR5G_MASK 0x00000200 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR5G_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR5G_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA5G_MSB 10 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA5G_LSB 10 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA5G_MASK 0x00000400 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA5G_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA5G_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_CAP_MSB 12 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_CAP_LSB 11 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_CAP_MASK 0x00001800 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_CAP_GET(x) (((x) & 0x00001800) >> 11) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_CAP_SET(x) (((x) << 11) & 0x00001800) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_SHORTINP_MSB 13 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_SHORTINP_LSB 13 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_SHORTINP_MASK 0x00002000 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_SHORTINP_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_SHORTINP_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_LP_MSB 14 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_LP_LSB 14 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_LP_MASK 0x00004000 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_LP_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_LP_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO2G_MSB 15 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO2G_LSB 15 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO2G_MASK 0x00008000 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO2G_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO2G_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR2G_MSB 16 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR2G_LSB 16 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR2G_MASK 0x00010000 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR2G_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR2G_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA2G_MSB 17 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA2G_LSB 17 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA2G_MASK 0x00020000 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA2G_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA2G_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR5G_GAIN_OVR_MSB 19 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR5G_GAIN_OVR_LSB 18 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR5G_GAIN_OVR_MASK 0x000c0000 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR5G_GAIN_OVR_GET(x) (((x) & 0x000c0000) >> 18) -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR5G_GAIN_OVR_SET(x) (((x) << 18) & 0x000c0000) -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_GAIN_OVR_MSB 22 -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_GAIN_OVR_LSB 20 -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_GAIN_OVR_MASK 0x00700000 -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_GAIN_OVR_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_GAIN_OVR_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_MSB 25 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_LSB 23 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_MASK 0x03800000 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR2G_GAIN_OVR_MSB 27 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR2G_GAIN_OVR_LSB 26 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR2G_GAIN_OVR_MASK 0x0c000000 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR2G_GAIN_OVR_GET(x) (((x) & 0x0c000000) >> 26) -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR2G_GAIN_OVR_SET(x) (((x) << 26) & 0x0c000000) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_MSB 30 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_LSB 28 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_MASK 0x70000000 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_GET(x) (((x) & 0x70000000) >> 28) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_SET(x) (((x) << 28) & 0x70000000) -#define PHY_ANALOG_RXRF_GAINSTAGES_RX_OVERRIDE_MSB 31 -#define PHY_ANALOG_RXRF_GAINSTAGES_RX_OVERRIDE_LSB 31 -#define PHY_ANALOG_RXRF_GAINSTAGES_RX_OVERRIDE_MASK 0x80000000 -#define PHY_ANALOG_RXRF_GAINSTAGES_RX_OVERRIDE_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_RXRF_GAINSTAGES_RX_OVERRIDE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for RXRF_AGC */ -#define PHY_ANALOG_RXRF_AGC_ADDRESS 0x0000000c -#define PHY_ANALOG_RXRF_AGC_OFFSET 0x0000000c -#define PHY_ANALOG_RXRF_AGC_SPARE_MSB 5 -#define PHY_ANALOG_RXRF_AGC_SPARE_LSB 0 -#define PHY_ANALOG_RXRF_AGC_SPARE_MASK 0x0000003f -#define PHY_ANALOG_RXRF_AGC_SPARE_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_ANALOG_RXRF_AGC_SPARE_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_ANALOG_RXRF_AGC_AGC_FALL_CTRL_MSB 8 -#define PHY_ANALOG_RXRF_AGC_AGC_FALL_CTRL_LSB 6 -#define PHY_ANALOG_RXRF_AGC_AGC_FALL_CTRL_MASK 0x000001c0 -#define PHY_ANALOG_RXRF_AGC_AGC_FALL_CTRL_GET(x) (((x) & 0x000001c0) >> 6) -#define PHY_ANALOG_RXRF_AGC_AGC_FALL_CTRL_SET(x) (((x) << 6) & 0x000001c0) -#define PHY_ANALOG_RXRF_AGC_AGC5G_CALDAC_OVR_MSB 14 -#define PHY_ANALOG_RXRF_AGC_AGC5G_CALDAC_OVR_LSB 9 -#define PHY_ANALOG_RXRF_AGC_AGC5G_CALDAC_OVR_MASK 0x00007e00 -#define PHY_ANALOG_RXRF_AGC_AGC5G_CALDAC_OVR_GET(x) (((x) & 0x00007e00) >> 9) -#define PHY_ANALOG_RXRF_AGC_AGC5G_CALDAC_OVR_SET(x) (((x) << 9) & 0x00007e00) -#define PHY_ANALOG_RXRF_AGC_AGC5G_DBDAC_OVR_MSB 18 -#define PHY_ANALOG_RXRF_AGC_AGC5G_DBDAC_OVR_LSB 15 -#define PHY_ANALOG_RXRF_AGC_AGC5G_DBDAC_OVR_MASK 0x00078000 -#define PHY_ANALOG_RXRF_AGC_AGC5G_DBDAC_OVR_GET(x) (((x) & 0x00078000) >> 15) -#define PHY_ANALOG_RXRF_AGC_AGC5G_DBDAC_OVR_SET(x) (((x) << 15) & 0x00078000) -#define PHY_ANALOG_RXRF_AGC_AGC2G_CALDAC_OVR_MSB 24 -#define PHY_ANALOG_RXRF_AGC_AGC2G_CALDAC_OVR_LSB 19 -#define PHY_ANALOG_RXRF_AGC_AGC2G_CALDAC_OVR_MASK 0x01f80000 -#define PHY_ANALOG_RXRF_AGC_AGC2G_CALDAC_OVR_GET(x) (((x) & 0x01f80000) >> 19) -#define PHY_ANALOG_RXRF_AGC_AGC2G_CALDAC_OVR_SET(x) (((x) << 19) & 0x01f80000) -#define PHY_ANALOG_RXRF_AGC_AGC2G_DBDAC_OVR_MSB 28 -#define PHY_ANALOG_RXRF_AGC_AGC2G_DBDAC_OVR_LSB 25 -#define PHY_ANALOG_RXRF_AGC_AGC2G_DBDAC_OVR_MASK 0x1e000000 -#define PHY_ANALOG_RXRF_AGC_AGC2G_DBDAC_OVR_GET(x) (((x) & 0x1e000000) >> 25) -#define PHY_ANALOG_RXRF_AGC_AGC2G_DBDAC_OVR_SET(x) (((x) << 25) & 0x1e000000) -#define PHY_ANALOG_RXRF_AGC_AGC_CAL_OVR_MSB 29 -#define PHY_ANALOG_RXRF_AGC_AGC_CAL_OVR_LSB 29 -#define PHY_ANALOG_RXRF_AGC_AGC_CAL_OVR_MASK 0x20000000 -#define PHY_ANALOG_RXRF_AGC_AGC_CAL_OVR_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_RXRF_AGC_AGC_CAL_OVR_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_RXRF_AGC_AGC_ON_OVR_MSB 30 -#define PHY_ANALOG_RXRF_AGC_AGC_ON_OVR_LSB 30 -#define PHY_ANALOG_RXRF_AGC_AGC_ON_OVR_MASK 0x40000000 -#define PHY_ANALOG_RXRF_AGC_AGC_ON_OVR_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_RXRF_AGC_AGC_ON_OVR_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_RXRF_AGC_AGC_OVERRIDE_MSB 31 -#define PHY_ANALOG_RXRF_AGC_AGC_OVERRIDE_LSB 31 -#define PHY_ANALOG_RXRF_AGC_AGC_OVERRIDE_MASK 0x80000000 -#define PHY_ANALOG_RXRF_AGC_AGC_OVERRIDE_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_RXRF_AGC_AGC_OVERRIDE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for TXRF1 */ -#define PHY_ANALOG_TXRF1_ADDRESS 0x00000040 -#define PHY_ANALOG_TXRF1_OFFSET 0x00000040 -#define PHY_ANALOG_TXRF1_DCAS2G_MSB 2 -#define PHY_ANALOG_TXRF1_DCAS2G_LSB 0 -#define PHY_ANALOG_TXRF1_DCAS2G_MASK 0x00000007 -#define PHY_ANALOG_TXRF1_DCAS2G_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_TXRF1_DCAS2G_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_TXRF1_OB2G_PALOFF_MSB 5 -#define PHY_ANALOG_TXRF1_OB2G_PALOFF_LSB 3 -#define PHY_ANALOG_TXRF1_OB2G_PALOFF_MASK 0x00000038 -#define PHY_ANALOG_TXRF1_OB2G_PALOFF_GET(x) (((x) & 0x00000038) >> 3) -#define PHY_ANALOG_TXRF1_OB2G_PALOFF_SET(x) (((x) << 3) & 0x00000038) -#define PHY_ANALOG_TXRF1_OB2G_QAM_MSB 8 -#define PHY_ANALOG_TXRF1_OB2G_QAM_LSB 6 -#define PHY_ANALOG_TXRF1_OB2G_QAM_MASK 0x000001c0 -#define PHY_ANALOG_TXRF1_OB2G_QAM_GET(x) (((x) & 0x000001c0) >> 6) -#define PHY_ANALOG_TXRF1_OB2G_QAM_SET(x) (((x) << 6) & 0x000001c0) -#define PHY_ANALOG_TXRF1_OB2G_PSK_MSB 11 -#define PHY_ANALOG_TXRF1_OB2G_PSK_LSB 9 -#define PHY_ANALOG_TXRF1_OB2G_PSK_MASK 0x00000e00 -#define PHY_ANALOG_TXRF1_OB2G_PSK_GET(x) (((x) & 0x00000e00) >> 9) -#define PHY_ANALOG_TXRF1_OB2G_PSK_SET(x) (((x) << 9) & 0x00000e00) -#define PHY_ANALOG_TXRF1_OB2G_CCK_MSB 14 -#define PHY_ANALOG_TXRF1_OB2G_CCK_LSB 12 -#define PHY_ANALOG_TXRF1_OB2G_CCK_MASK 0x00007000 -#define PHY_ANALOG_TXRF1_OB2G_CCK_GET(x) (((x) & 0x00007000) >> 12) -#define PHY_ANALOG_TXRF1_OB2G_CCK_SET(x) (((x) << 12) & 0x00007000) -#define PHY_ANALOG_TXRF1_DB2G_MSB 17 -#define PHY_ANALOG_TXRF1_DB2G_LSB 15 -#define PHY_ANALOG_TXRF1_DB2G_MASK 0x00038000 -#define PHY_ANALOG_TXRF1_DB2G_GET(x) (((x) & 0x00038000) >> 15) -#define PHY_ANALOG_TXRF1_DB2G_SET(x) (((x) << 15) & 0x00038000) -#define PHY_ANALOG_TXRF1_PDOUT2G_MSB 18 -#define PHY_ANALOG_TXRF1_PDOUT2G_LSB 18 -#define PHY_ANALOG_TXRF1_PDOUT2G_MASK 0x00040000 -#define PHY_ANALOG_TXRF1_PDOUT2G_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_TXRF1_PDOUT2G_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_TXRF1_PDDR2G_MSB 19 -#define PHY_ANALOG_TXRF1_PDDR2G_LSB 19 -#define PHY_ANALOG_TXRF1_PDDR2G_MASK 0x00080000 -#define PHY_ANALOG_TXRF1_PDDR2G_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_ANALOG_TXRF1_PDDR2G_SET(x) (((x) << 19) & 0x00080000) -#define PHY_ANALOG_TXRF1_PDMXR2G_MSB 20 -#define PHY_ANALOG_TXRF1_PDMXR2G_LSB 20 -#define PHY_ANALOG_TXRF1_PDMXR2G_MASK 0x00100000 -#define PHY_ANALOG_TXRF1_PDMXR2G_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_TXRF1_PDMXR2G_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_TXRF1_PDLO2G_MSB 21 -#define PHY_ANALOG_TXRF1_PDLO2G_LSB 21 -#define PHY_ANALOG_TXRF1_PDLO2G_MASK 0x00200000 -#define PHY_ANALOG_TXRF1_PDLO2G_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_TXRF1_PDLO2G_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_TXRF1_LOBUF2GFORCED_MSB 22 -#define PHY_ANALOG_TXRF1_LOBUF2GFORCED_LSB 22 -#define PHY_ANALOG_TXRF1_LOBUF2GFORCED_MASK 0x00400000 -#define PHY_ANALOG_TXRF1_LOBUF2GFORCED_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_TXRF1_LOBUF2GFORCED_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_TXRF1_LODIV2GFORCED_MSB 23 -#define PHY_ANALOG_TXRF1_LODIV2GFORCED_LSB 23 -#define PHY_ANALOG_TXRF1_LODIV2GFORCED_MASK 0x00800000 -#define PHY_ANALOG_TXRF1_LODIV2GFORCED_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_TXRF1_LODIV2GFORCED_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_TXRF1_PADRVGN2G_MSB 30 -#define PHY_ANALOG_TXRF1_PADRVGN2G_LSB 24 -#define PHY_ANALOG_TXRF1_PADRVGN2G_MASK 0x7f000000 -#define PHY_ANALOG_TXRF1_PADRVGN2G_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_ANALOG_TXRF1_PADRVGN2G_SET(x) (((x) << 24) & 0x7f000000) -#define PHY_ANALOG_TXRF1_LOCALTXGAIN2G_MSB 31 -#define PHY_ANALOG_TXRF1_LOCALTXGAIN2G_LSB 31 -#define PHY_ANALOG_TXRF1_LOCALTXGAIN2G_MASK 0x80000000 -#define PHY_ANALOG_TXRF1_LOCALTXGAIN2G_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_TXRF1_LOCALTXGAIN2G_SET(x) (((x) << 31) & 0x80000000) - -/* macros for TXRF2 */ -#define PHY_ANALOG_TXRF2_ADDRESS 0x00000044 -#define PHY_ANALOG_TXRF2_OFFSET 0x00000044 -#define PHY_ANALOG_TXRF2_SPARE2_MSB 0 -#define PHY_ANALOG_TXRF2_SPARE2_LSB 0 -#define PHY_ANALOG_TXRF2_SPARE2_MASK 0x00000001 -#define PHY_ANALOG_TXRF2_SPARE2_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_TXRF2_SPARE2_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_TXRF2_D3B5G_MSB 3 -#define PHY_ANALOG_TXRF2_D3B5G_LSB 1 -#define PHY_ANALOG_TXRF2_D3B5G_MASK 0x0000000e -#define PHY_ANALOG_TXRF2_D3B5G_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_ANALOG_TXRF2_D3B5G_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_ANALOG_TXRF2_D4B5G_MSB 6 -#define PHY_ANALOG_TXRF2_D4B5G_LSB 4 -#define PHY_ANALOG_TXRF2_D4B5G_MASK 0x00000070 -#define PHY_ANALOG_TXRF2_D4B5G_GET(x) (((x) & 0x00000070) >> 4) -#define PHY_ANALOG_TXRF2_D4B5G_SET(x) (((x) << 4) & 0x00000070) -#define PHY_ANALOG_TXRF2_PDOUT5G_MSB 10 -#define PHY_ANALOG_TXRF2_PDOUT5G_LSB 7 -#define PHY_ANALOG_TXRF2_PDOUT5G_MASK 0x00000780 -#define PHY_ANALOG_TXRF2_PDOUT5G_GET(x) (((x) & 0x00000780) >> 7) -#define PHY_ANALOG_TXRF2_PDOUT5G_SET(x) (((x) << 7) & 0x00000780) -#define PHY_ANALOG_TXRF2_PDMXR5G_MSB 11 -#define PHY_ANALOG_TXRF2_PDMXR5G_LSB 11 -#define PHY_ANALOG_TXRF2_PDMXR5G_MASK 0x00000800 -#define PHY_ANALOG_TXRF2_PDMXR5G_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_TXRF2_PDMXR5G_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_TXRF2_PDLOBUF5G_MSB 12 -#define PHY_ANALOG_TXRF2_PDLOBUF5G_LSB 12 -#define PHY_ANALOG_TXRF2_PDLOBUF5G_MASK 0x00001000 -#define PHY_ANALOG_TXRF2_PDLOBUF5G_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_TXRF2_PDLOBUF5G_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_TXRF2_PDLODIV5G_MSB 13 -#define PHY_ANALOG_TXRF2_PDLODIV5G_LSB 13 -#define PHY_ANALOG_TXRF2_PDLODIV5G_MASK 0x00002000 -#define PHY_ANALOG_TXRF2_PDLODIV5G_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_TXRF2_PDLODIV5G_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_TXRF2_LOBUF5GFORCED_MSB 14 -#define PHY_ANALOG_TXRF2_LOBUF5GFORCED_LSB 14 -#define PHY_ANALOG_TXRF2_LOBUF5GFORCED_MASK 0x00004000 -#define PHY_ANALOG_TXRF2_LOBUF5GFORCED_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_TXRF2_LOBUF5GFORCED_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_TXRF2_LODIV5GFORCED_MSB 15 -#define PHY_ANALOG_TXRF2_LODIV5GFORCED_LSB 15 -#define PHY_ANALOG_TXRF2_LODIV5GFORCED_MASK 0x00008000 -#define PHY_ANALOG_TXRF2_LODIV5GFORCED_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_TXRF2_LODIV5GFORCED_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_TXRF2_PADRV2GN5G_MSB 19 -#define PHY_ANALOG_TXRF2_PADRV2GN5G_LSB 16 -#define PHY_ANALOG_TXRF2_PADRV2GN5G_MASK 0x000f0000 -#define PHY_ANALOG_TXRF2_PADRV2GN5G_GET(x) (((x) & 0x000f0000) >> 16) -#define PHY_ANALOG_TXRF2_PADRV2GN5G_SET(x) (((x) << 16) & 0x000f0000) -#define PHY_ANALOG_TXRF2_PADRV3GN5G_MSB 23 -#define PHY_ANALOG_TXRF2_PADRV3GN5G_LSB 20 -#define PHY_ANALOG_TXRF2_PADRV3GN5G_MASK 0x00f00000 -#define PHY_ANALOG_TXRF2_PADRV3GN5G_GET(x) (((x) & 0x00f00000) >> 20) -#define PHY_ANALOG_TXRF2_PADRV3GN5G_SET(x) (((x) << 20) & 0x00f00000) -#define PHY_ANALOG_TXRF2_PADRV4GN5G_MSB 27 -#define PHY_ANALOG_TXRF2_PADRV4GN5G_LSB 24 -#define PHY_ANALOG_TXRF2_PADRV4GN5G_MASK 0x0f000000 -#define PHY_ANALOG_TXRF2_PADRV4GN5G_GET(x) (((x) & 0x0f000000) >> 24) -#define PHY_ANALOG_TXRF2_PADRV4GN5G_SET(x) (((x) << 24) & 0x0f000000) -#define PHY_ANALOG_TXRF2_LOCALTXGAIN5G_MSB 28 -#define PHY_ANALOG_TXRF2_LOCALTXGAIN5G_LSB 28 -#define PHY_ANALOG_TXRF2_LOCALTXGAIN5G_MASK 0x10000000 -#define PHY_ANALOG_TXRF2_LOCALTXGAIN5G_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_TXRF2_LOCALTXGAIN5G_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_TXRF2_OCAS2G_MSB 31 -#define PHY_ANALOG_TXRF2_OCAS2G_LSB 29 -#define PHY_ANALOG_TXRF2_OCAS2G_MASK 0xe0000000 -#define PHY_ANALOG_TXRF2_OCAS2G_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_TXRF2_OCAS2G_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for TXRF3 */ -#define PHY_ANALOG_TXRF3_ADDRESS 0x00000048 -#define PHY_ANALOG_TXRF3_OFFSET 0x00000048 -#define PHY_ANALOG_TXRF3_SPARE3_MSB 22 -#define PHY_ANALOG_TXRF3_SPARE3_LSB 0 -#define PHY_ANALOG_TXRF3_SPARE3_MASK 0x007fffff -#define PHY_ANALOG_TXRF3_SPARE3_GET(x) (((x) & 0x007fffff) >> 0) -#define PHY_ANALOG_TXRF3_SPARE3_SET(x) (((x) << 0) & 0x007fffff) -#define PHY_ANALOG_TXRF3_CAS5G_MSB 25 -#define PHY_ANALOG_TXRF3_CAS5G_LSB 23 -#define PHY_ANALOG_TXRF3_CAS5G_MASK 0x03800000 -#define PHY_ANALOG_TXRF3_CAS5G_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_TXRF3_CAS5G_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_TXRF3_OB5G_MSB 28 -#define PHY_ANALOG_TXRF3_OB5G_LSB 26 -#define PHY_ANALOG_TXRF3_OB5G_MASK 0x1c000000 -#define PHY_ANALOG_TXRF3_OB5G_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_TXRF3_OB5G_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_TXRF3_D2B5G_MSB 31 -#define PHY_ANALOG_TXRF3_D2B5G_LSB 29 -#define PHY_ANALOG_TXRF3_D2B5G_MASK 0xe0000000 -#define PHY_ANALOG_TXRF3_D2B5G_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_TXRF3_D2B5G_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for TXRF4 */ -#define PHY_ANALOG_TXRF4_ADDRESS 0x0000004c -#define PHY_ANALOG_TXRF4_OFFSET 0x0000004c -#define PHY_ANALOG_TXRF4_COMP2G_PSK_MSB 2 -#define PHY_ANALOG_TXRF4_COMP2G_PSK_LSB 0 -#define PHY_ANALOG_TXRF4_COMP2G_PSK_MASK 0x00000007 -#define PHY_ANALOG_TXRF4_COMP2G_PSK_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_TXRF4_COMP2G_PSK_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_TXRF4_COMP2G_CCK_MSB 5 -#define PHY_ANALOG_TXRF4_COMP2G_CCK_LSB 3 -#define PHY_ANALOG_TXRF4_COMP2G_CCK_MASK 0x00000038 -#define PHY_ANALOG_TXRF4_COMP2G_CCK_GET(x) (((x) & 0x00000038) >> 3) -#define PHY_ANALOG_TXRF4_COMP2G_CCK_SET(x) (((x) << 3) & 0x00000038) -#define PHY_ANALOG_TXRF4_AMP2B2G_QAM_MSB 8 -#define PHY_ANALOG_TXRF4_AMP2B2G_QAM_LSB 6 -#define PHY_ANALOG_TXRF4_AMP2B2G_QAM_MASK 0x000001c0 -#define PHY_ANALOG_TXRF4_AMP2B2G_QAM_GET(x) (((x) & 0x000001c0) >> 6) -#define PHY_ANALOG_TXRF4_AMP2B2G_QAM_SET(x) (((x) << 6) & 0x000001c0) -#define PHY_ANALOG_TXRF4_AMP2B2G_PSK_MSB 11 -#define PHY_ANALOG_TXRF4_AMP2B2G_PSK_LSB 9 -#define PHY_ANALOG_TXRF4_AMP2B2G_PSK_MASK 0x00000e00 -#define PHY_ANALOG_TXRF4_AMP2B2G_PSK_GET(x) (((x) & 0x00000e00) >> 9) -#define PHY_ANALOG_TXRF4_AMP2B2G_PSK_SET(x) (((x) << 9) & 0x00000e00) -#define PHY_ANALOG_TXRF4_AMP2B2G_CCK_MSB 14 -#define PHY_ANALOG_TXRF4_AMP2B2G_CCK_LSB 12 -#define PHY_ANALOG_TXRF4_AMP2B2G_CCK_MASK 0x00007000 -#define PHY_ANALOG_TXRF4_AMP2B2G_CCK_GET(x) (((x) & 0x00007000) >> 12) -#define PHY_ANALOG_TXRF4_AMP2B2G_CCK_SET(x) (((x) << 12) & 0x00007000) -#define PHY_ANALOG_TXRF4_AMP2CAS2G_MSB 17 -#define PHY_ANALOG_TXRF4_AMP2CAS2G_LSB 15 -#define PHY_ANALOG_TXRF4_AMP2CAS2G_MASK 0x00038000 -#define PHY_ANALOG_TXRF4_AMP2CAS2G_GET(x) (((x) & 0x00038000) >> 15) -#define PHY_ANALOG_TXRF4_AMP2CAS2G_SET(x) (((x) << 15) & 0x00038000) -#define PHY_ANALOG_TXRF4_FILTR2G_MSB 19 -#define PHY_ANALOG_TXRF4_FILTR2G_LSB 18 -#define PHY_ANALOG_TXRF4_FILTR2G_MASK 0x000c0000 -#define PHY_ANALOG_TXRF4_FILTR2G_GET(x) (((x) & 0x000c0000) >> 18) -#define PHY_ANALOG_TXRF4_FILTR2G_SET(x) (((x) << 18) & 0x000c0000) -#define PHY_ANALOG_TXRF4_PWDFB2_2G_MSB 20 -#define PHY_ANALOG_TXRF4_PWDFB2_2G_LSB 20 -#define PHY_ANALOG_TXRF4_PWDFB2_2G_MASK 0x00100000 -#define PHY_ANALOG_TXRF4_PWDFB2_2G_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_TXRF4_PWDFB2_2G_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_TXRF4_PWDFB1_2G_MSB 21 -#define PHY_ANALOG_TXRF4_PWDFB1_2G_LSB 21 -#define PHY_ANALOG_TXRF4_PWDFB1_2G_MASK 0x00200000 -#define PHY_ANALOG_TXRF4_PWDFB1_2G_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_TXRF4_PWDFB1_2G_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_TXRF4_PDFB2G_MSB 22 -#define PHY_ANALOG_TXRF4_PDFB2G_LSB 22 -#define PHY_ANALOG_TXRF4_PDFB2G_MASK 0x00400000 -#define PHY_ANALOG_TXRF4_PDFB2G_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_TXRF4_PDFB2G_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_TXRF4_RDIV5G_MSB 24 -#define PHY_ANALOG_TXRF4_RDIV5G_LSB 23 -#define PHY_ANALOG_TXRF4_RDIV5G_MASK 0x01800000 -#define PHY_ANALOG_TXRF4_RDIV5G_GET(x) (((x) & 0x01800000) >> 23) -#define PHY_ANALOG_TXRF4_RDIV5G_SET(x) (((x) << 23) & 0x01800000) -#define PHY_ANALOG_TXRF4_CAPDIV5G_MSB 27 -#define PHY_ANALOG_TXRF4_CAPDIV5G_LSB 25 -#define PHY_ANALOG_TXRF4_CAPDIV5G_MASK 0x0e000000 -#define PHY_ANALOG_TXRF4_CAPDIV5G_GET(x) (((x) & 0x0e000000) >> 25) -#define PHY_ANALOG_TXRF4_CAPDIV5G_SET(x) (((x) << 25) & 0x0e000000) -#define PHY_ANALOG_TXRF4_PDPREDIST5G_MSB 28 -#define PHY_ANALOG_TXRF4_PDPREDIST5G_LSB 28 -#define PHY_ANALOG_TXRF4_PDPREDIST5G_MASK 0x10000000 -#define PHY_ANALOG_TXRF4_PDPREDIST5G_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_TXRF4_PDPREDIST5G_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_TXRF4_RDIV2G_MSB 30 -#define PHY_ANALOG_TXRF4_RDIV2G_LSB 29 -#define PHY_ANALOG_TXRF4_RDIV2G_MASK 0x60000000 -#define PHY_ANALOG_TXRF4_RDIV2G_GET(x) (((x) & 0x60000000) >> 29) -#define PHY_ANALOG_TXRF4_RDIV2G_SET(x) (((x) << 29) & 0x60000000) -#define PHY_ANALOG_TXRF4_PDPREDIST2G_MSB 31 -#define PHY_ANALOG_TXRF4_PDPREDIST2G_LSB 31 -#define PHY_ANALOG_TXRF4_PDPREDIST2G_MASK 0x80000000 -#define PHY_ANALOG_TXRF4_PDPREDIST2G_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_TXRF4_PDPREDIST2G_SET(x) (((x) << 31) & 0x80000000) - -/* macros for TXRF5 */ -#define PHY_ANALOG_TXRF5_ADDRESS 0x00000050 -#define PHY_ANALOG_TXRF5_OFFSET 0x00000050 -#define PHY_ANALOG_TXRF5_FBHI2G_MSB 0 -#define PHY_ANALOG_TXRF5_FBHI2G_LSB 0 -#define PHY_ANALOG_TXRF5_FBHI2G_MASK 0x00000001 -#define PHY_ANALOG_TXRF5_FBHI2G_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_TXRF5_FBLO2G_MSB 1 -#define PHY_ANALOG_TXRF5_FBLO2G_LSB 1 -#define PHY_ANALOG_TXRF5_FBLO2G_MASK 0x00000002 -#define PHY_ANALOG_TXRF5_FBLO2G_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_TXRF5_REFHI2G_MSB 4 -#define PHY_ANALOG_TXRF5_REFHI2G_LSB 2 -#define PHY_ANALOG_TXRF5_REFHI2G_MASK 0x0000001c -#define PHY_ANALOG_TXRF5_REFHI2G_GET(x) (((x) & 0x0000001c) >> 2) -#define PHY_ANALOG_TXRF5_REFHI2G_SET(x) (((x) << 2) & 0x0000001c) -#define PHY_ANALOG_TXRF5_REFLO2G_MSB 7 -#define PHY_ANALOG_TXRF5_REFLO2G_LSB 5 -#define PHY_ANALOG_TXRF5_REFLO2G_MASK 0x000000e0 -#define PHY_ANALOG_TXRF5_REFLO2G_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_TXRF5_REFLO2G_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_TXRF5_PK2B2G_QAM_MSB 9 -#define PHY_ANALOG_TXRF5_PK2B2G_QAM_LSB 8 -#define PHY_ANALOG_TXRF5_PK2B2G_QAM_MASK 0x00000300 -#define PHY_ANALOG_TXRF5_PK2B2G_QAM_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_ANALOG_TXRF5_PK2B2G_QAM_SET(x) (((x) << 8) & 0x00000300) -#define PHY_ANALOG_TXRF5_PK2B2G_PSK_MSB 11 -#define PHY_ANALOG_TXRF5_PK2B2G_PSK_LSB 10 -#define PHY_ANALOG_TXRF5_PK2B2G_PSK_MASK 0x00000c00 -#define PHY_ANALOG_TXRF5_PK2B2G_PSK_GET(x) (((x) & 0x00000c00) >> 10) -#define PHY_ANALOG_TXRF5_PK2B2G_PSK_SET(x) (((x) << 10) & 0x00000c00) -#define PHY_ANALOG_TXRF5_PK2B2G_CCK_MSB 13 -#define PHY_ANALOG_TXRF5_PK2B2G_CCK_LSB 12 -#define PHY_ANALOG_TXRF5_PK2B2G_CCK_MASK 0x00003000 -#define PHY_ANALOG_TXRF5_PK2B2G_CCK_GET(x) (((x) & 0x00003000) >> 12) -#define PHY_ANALOG_TXRF5_PK2B2G_CCK_SET(x) (((x) << 12) & 0x00003000) -#define PHY_ANALOG_TXRF5_PK1B2G_QAM_MSB 15 -#define PHY_ANALOG_TXRF5_PK1B2G_QAM_LSB 14 -#define PHY_ANALOG_TXRF5_PK1B2G_QAM_MASK 0x0000c000 -#define PHY_ANALOG_TXRF5_PK1B2G_QAM_GET(x) (((x) & 0x0000c000) >> 14) -#define PHY_ANALOG_TXRF5_PK1B2G_QAM_SET(x) (((x) << 14) & 0x0000c000) -#define PHY_ANALOG_TXRF5_PK1B2G_PSK_MSB 17 -#define PHY_ANALOG_TXRF5_PK1B2G_PSK_LSB 16 -#define PHY_ANALOG_TXRF5_PK1B2G_PSK_MASK 0x00030000 -#define PHY_ANALOG_TXRF5_PK1B2G_PSK_GET(x) (((x) & 0x00030000) >> 16) -#define PHY_ANALOG_TXRF5_PK1B2G_PSK_SET(x) (((x) << 16) & 0x00030000) -#define PHY_ANALOG_TXRF5_PK1B2G_CCK_MSB 19 -#define PHY_ANALOG_TXRF5_PK1B2G_CCK_LSB 18 -#define PHY_ANALOG_TXRF5_PK1B2G_CCK_MASK 0x000c0000 -#define PHY_ANALOG_TXRF5_PK1B2G_CCK_GET(x) (((x) & 0x000c0000) >> 18) -#define PHY_ANALOG_TXRF5_PK1B2G_CCK_SET(x) (((x) << 18) & 0x000c0000) -#define PHY_ANALOG_TXRF5_MIOB2G_QAM_MSB 22 -#define PHY_ANALOG_TXRF5_MIOB2G_QAM_LSB 20 -#define PHY_ANALOG_TXRF5_MIOB2G_QAM_MASK 0x00700000 -#define PHY_ANALOG_TXRF5_MIOB2G_QAM_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_TXRF5_MIOB2G_QAM_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_TXRF5_MIOB2G_PSK_MSB 25 -#define PHY_ANALOG_TXRF5_MIOB2G_PSK_LSB 23 -#define PHY_ANALOG_TXRF5_MIOB2G_PSK_MASK 0x03800000 -#define PHY_ANALOG_TXRF5_MIOB2G_PSK_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_TXRF5_MIOB2G_PSK_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_TXRF5_MIOB2G_CCK_MSB 28 -#define PHY_ANALOG_TXRF5_MIOB2G_CCK_LSB 26 -#define PHY_ANALOG_TXRF5_MIOB2G_CCK_MASK 0x1c000000 -#define PHY_ANALOG_TXRF5_MIOB2G_CCK_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_TXRF5_MIOB2G_CCK_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_TXRF5_COMP2G_QAM_MSB 31 -#define PHY_ANALOG_TXRF5_COMP2G_QAM_LSB 29 -#define PHY_ANALOG_TXRF5_COMP2G_QAM_MASK 0xe0000000 -#define PHY_ANALOG_TXRF5_COMP2G_QAM_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_TXRF5_COMP2G_QAM_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for TXRF6 */ -#define PHY_ANALOG_TXRF6_ADDRESS 0x00000054 -#define PHY_ANALOG_TXRF6_OFFSET 0x00000054 -#define PHY_ANALOG_TXRF6_SPARE6_MSB 0 -#define PHY_ANALOG_TXRF6_SPARE6_LSB 0 -#define PHY_ANALOG_TXRF6_SPARE6_MASK 0x00000001 -#define PHY_ANALOG_TXRF6_SPARE6_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_TXRF6_SPARE6_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_TXRF6_PAL_LOCKED_MSB 1 -#define PHY_ANALOG_TXRF6_PAL_LOCKED_LSB 1 -#define PHY_ANALOG_TXRF6_PAL_LOCKED_MASK 0x00000002 -#define PHY_ANALOG_TXRF6_PAL_LOCKED_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_TXRF6_PADRVGN2G_SMOUT_MSB 7 -#define PHY_ANALOG_TXRF6_PADRVGN2G_SMOUT_LSB 2 -#define PHY_ANALOG_TXRF6_PADRVGN2G_SMOUT_MASK 0x000000fc -#define PHY_ANALOG_TXRF6_PADRVGN2G_SMOUT_GET(x) (((x) & 0x000000fc) >> 2) -#define PHY_ANALOG_TXRF6_GAINSTEP2G_MSB 10 -#define PHY_ANALOG_TXRF6_GAINSTEP2G_LSB 8 -#define PHY_ANALOG_TXRF6_GAINSTEP2G_MASK 0x00000700 -#define PHY_ANALOG_TXRF6_GAINSTEP2G_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_TXRF6_GAINSTEP2G_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_TXRF6_USE_GAIN_DELTA2G_MSB 11 -#define PHY_ANALOG_TXRF6_USE_GAIN_DELTA2G_LSB 11 -#define PHY_ANALOG_TXRF6_USE_GAIN_DELTA2G_MASK 0x00000800 -#define PHY_ANALOG_TXRF6_USE_GAIN_DELTA2G_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_TXRF6_USE_GAIN_DELTA2G_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_TXRF6_PADRVGN_INDEX_I2G_MSB 15 -#define PHY_ANALOG_TXRF6_PADRVGN_INDEX_I2G_LSB 12 -#define PHY_ANALOG_TXRF6_PADRVGN_INDEX_I2G_MASK 0x0000f000 -#define PHY_ANALOG_TXRF6_PADRVGN_INDEX_I2G_GET(x) (((x) & 0x0000f000) >> 12) -#define PHY_ANALOG_TXRF6_PADRVGN_INDEX_I2G_SET(x) (((x) << 12) & 0x0000f000) -#define PHY_ANALOG_TXRF6_VCMONDELAY2G_MSB 18 -#define PHY_ANALOG_TXRF6_VCMONDELAY2G_LSB 16 -#define PHY_ANALOG_TXRF6_VCMONDELAY2G_MASK 0x00070000 -#define PHY_ANALOG_TXRF6_VCMONDELAY2G_GET(x) (((x) & 0x00070000) >> 16) -#define PHY_ANALOG_TXRF6_VCMONDELAY2G_SET(x) (((x) << 16) & 0x00070000) -#define PHY_ANALOG_TXRF6_CAPDIV2G_MSB 21 -#define PHY_ANALOG_TXRF6_CAPDIV2G_LSB 19 -#define PHY_ANALOG_TXRF6_CAPDIV2G_MASK 0x00380000 -#define PHY_ANALOG_TXRF6_CAPDIV2G_GET(x) (((x) & 0x00380000) >> 19) -#define PHY_ANALOG_TXRF6_CAPDIV2G_SET(x) (((x) << 19) & 0x00380000) -#define PHY_ANALOG_TXRF6_CAPDIV2GOVR_MSB 22 -#define PHY_ANALOG_TXRF6_CAPDIV2GOVR_LSB 22 -#define PHY_ANALOG_TXRF6_CAPDIV2GOVR_MASK 0x00400000 -#define PHY_ANALOG_TXRF6_CAPDIV2GOVR_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_TXRF6_CAPDIV2GOVR_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_TXRF6_ENPACAL2G_MSB 23 -#define PHY_ANALOG_TXRF6_ENPACAL2G_LSB 23 -#define PHY_ANALOG_TXRF6_ENPACAL2G_MASK 0x00800000 -#define PHY_ANALOG_TXRF6_ENPACAL2G_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_TXRF6_ENPACAL2G_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_TXRF6_OFFSET2G_MSB 30 -#define PHY_ANALOG_TXRF6_OFFSET2G_LSB 24 -#define PHY_ANALOG_TXRF6_OFFSET2G_MASK 0x7f000000 -#define PHY_ANALOG_TXRF6_OFFSET2G_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_ANALOG_TXRF6_OFFSET2G_SET(x) (((x) << 24) & 0x7f000000) -#define PHY_ANALOG_TXRF6_ENOFFSETCAL2G_MSB 31 -#define PHY_ANALOG_TXRF6_ENOFFSETCAL2G_LSB 31 -#define PHY_ANALOG_TXRF6_ENOFFSETCAL2G_MASK 0x80000000 -#define PHY_ANALOG_TXRF6_ENOFFSETCAL2G_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_TXRF6_ENOFFSETCAL2G_SET(x) (((x) << 31) & 0x80000000) - -/* macros for TXRF7 */ -#define PHY_ANALOG_TXRF7_ADDRESS 0x00000058 -#define PHY_ANALOG_TXRF7_OFFSET 0x00000058 -#define PHY_ANALOG_TXRF7_SPARE7_MSB 1 -#define PHY_ANALOG_TXRF7_SPARE7_LSB 0 -#define PHY_ANALOG_TXRF7_SPARE7_MASK 0x00000003 -#define PHY_ANALOG_TXRF7_SPARE7_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF7_SPARE7_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_4_MSB 7 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_4_LSB 2 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_4_MASK 0x000000fc -#define PHY_ANALOG_TXRF7_PADRVGNTAB_4_GET(x) (((x) & 0x000000fc) >> 2) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_4_SET(x) (((x) << 2) & 0x000000fc) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_3_MSB 13 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_3_LSB 8 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_3_MASK 0x00003f00 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_3_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_3_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_2_MSB 19 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_2_LSB 14 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_2_MASK 0x000fc000 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_2_GET(x) (((x) & 0x000fc000) >> 14) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_2_SET(x) (((x) << 14) & 0x000fc000) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_1_MSB 25 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_1_LSB 20 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_1_MASK 0x03f00000 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_1_GET(x) (((x) & 0x03f00000) >> 20) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_1_SET(x) (((x) << 20) & 0x03f00000) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_0_MSB 31 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_0_LSB 26 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_0_MASK 0xfc000000 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_0_GET(x) (((x) & 0xfc000000) >> 26) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_0_SET(x) (((x) << 26) & 0xfc000000) - -/* macros for TXRF8 */ -#define PHY_ANALOG_TXRF8_ADDRESS 0x0000005c -#define PHY_ANALOG_TXRF8_OFFSET 0x0000005c -#define PHY_ANALOG_TXRF8_SPARE8_MSB 1 -#define PHY_ANALOG_TXRF8_SPARE8_LSB 0 -#define PHY_ANALOG_TXRF8_SPARE8_MASK 0x00000003 -#define PHY_ANALOG_TXRF8_SPARE8_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF8_SPARE8_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_9_MSB 7 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_9_LSB 2 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_9_MASK 0x000000fc -#define PHY_ANALOG_TXRF8_PADRVGNTAB_9_GET(x) (((x) & 0x000000fc) >> 2) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_9_SET(x) (((x) << 2) & 0x000000fc) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_8_MSB 13 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_8_LSB 8 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_8_MASK 0x00003f00 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_8_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_8_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_7_MSB 19 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_7_LSB 14 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_7_MASK 0x000fc000 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_7_GET(x) (((x) & 0x000fc000) >> 14) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_7_SET(x) (((x) << 14) & 0x000fc000) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_6_MSB 25 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_6_LSB 20 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_6_MASK 0x03f00000 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_6_GET(x) (((x) & 0x03f00000) >> 20) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_6_SET(x) (((x) << 20) & 0x03f00000) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_5_MSB 31 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_5_LSB 26 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_5_MASK 0xfc000000 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_5_GET(x) (((x) & 0xfc000000) >> 26) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_5_SET(x) (((x) << 26) & 0xfc000000) - -/* macros for TXRF9 */ -#define PHY_ANALOG_TXRF9_ADDRESS 0x00000060 -#define PHY_ANALOG_TXRF9_OFFSET 0x00000060 -#define PHY_ANALOG_TXRF9_SPARE9_MSB 1 -#define PHY_ANALOG_TXRF9_SPARE9_LSB 0 -#define PHY_ANALOG_TXRF9_SPARE9_MASK 0x00000003 -#define PHY_ANALOG_TXRF9_SPARE9_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF9_SPARE9_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_14_MSB 7 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_14_LSB 2 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_14_MASK 0x000000fc -#define PHY_ANALOG_TXRF9_PADRVGNTAB_14_GET(x) (((x) & 0x000000fc) >> 2) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_14_SET(x) (((x) << 2) & 0x000000fc) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_13_MSB 13 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_13_LSB 8 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_13_MASK 0x00003f00 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_13_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_13_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_12_MSB 19 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_12_LSB 14 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_12_MASK 0x000fc000 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_12_GET(x) (((x) & 0x000fc000) >> 14) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_12_SET(x) (((x) << 14) & 0x000fc000) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_11_MSB 25 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_11_LSB 20 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_11_MASK 0x03f00000 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_11_GET(x) (((x) & 0x03f00000) >> 20) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_11_SET(x) (((x) << 20) & 0x03f00000) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_10_MSB 31 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_10_LSB 26 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_10_MASK 0xfc000000 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_10_GET(x) (((x) & 0xfc000000) >> 26) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_10_SET(x) (((x) << 26) & 0xfc000000) - -/* macros for TXRF10 */ -#define PHY_ANALOG_TXRF10_ADDRESS 0x00000064 -#define PHY_ANALOG_TXRF10_OFFSET 0x00000064 -#define PHY_ANALOG_TXRF10_SPARE10_MSB 12 -#define PHY_ANALOG_TXRF10_SPARE10_LSB 0 -#define PHY_ANALOG_TXRF10_SPARE10_MASK 0x00001fff -#define PHY_ANALOG_TXRF10_SPARE10_GET(x) (((x) & 0x00001fff) >> 0) -#define PHY_ANALOG_TXRF10_SPARE10_SET(x) (((x) << 0) & 0x00001fff) -#define PHY_ANALOG_TXRF10_PDOUT5G_3CALTX_MSB 13 -#define PHY_ANALOG_TXRF10_PDOUT5G_3CALTX_LSB 13 -#define PHY_ANALOG_TXRF10_PDOUT5G_3CALTX_MASK 0x00002000 -#define PHY_ANALOG_TXRF10_PDOUT5G_3CALTX_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_TXRF10_PDOUT5G_3CALTX_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_TXRF10_D3B5GCALTX_MSB 16 -#define PHY_ANALOG_TXRF10_D3B5GCALTX_LSB 14 -#define PHY_ANALOG_TXRF10_D3B5GCALTX_MASK 0x0001c000 -#define PHY_ANALOG_TXRF10_D3B5GCALTX_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_TXRF10_D3B5GCALTX_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_TXRF10_D4B5GCALTX_MSB 19 -#define PHY_ANALOG_TXRF10_D4B5GCALTX_LSB 17 -#define PHY_ANALOG_TXRF10_D4B5GCALTX_MASK 0x000e0000 -#define PHY_ANALOG_TXRF10_D4B5GCALTX_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_TXRF10_D4B5GCALTX_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_TXRF10_PADRVGN2GCALTX_MSB 26 -#define PHY_ANALOG_TXRF10_PADRVGN2GCALTX_LSB 20 -#define PHY_ANALOG_TXRF10_PADRVGN2GCALTX_MASK 0x07f00000 -#define PHY_ANALOG_TXRF10_PADRVGN2GCALTX_GET(x) (((x) & 0x07f00000) >> 20) -#define PHY_ANALOG_TXRF10_PADRVGN2GCALTX_SET(x) (((x) << 20) & 0x07f00000) -#define PHY_ANALOG_TXRF10_DB2GCALTX_MSB 29 -#define PHY_ANALOG_TXRF10_DB2GCALTX_LSB 27 -#define PHY_ANALOG_TXRF10_DB2GCALTX_MASK 0x38000000 -#define PHY_ANALOG_TXRF10_DB2GCALTX_GET(x) (((x) & 0x38000000) >> 27) -#define PHY_ANALOG_TXRF10_DB2GCALTX_SET(x) (((x) << 27) & 0x38000000) -#define PHY_ANALOG_TXRF10_CALTXSHIFT_MSB 30 -#define PHY_ANALOG_TXRF10_CALTXSHIFT_LSB 30 -#define PHY_ANALOG_TXRF10_CALTXSHIFT_MASK 0x40000000 -#define PHY_ANALOG_TXRF10_CALTXSHIFT_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_TXRF10_CALTXSHIFT_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_TXRF10_CALTXSHIFTOVR_MSB 31 -#define PHY_ANALOG_TXRF10_CALTXSHIFTOVR_LSB 31 -#define PHY_ANALOG_TXRF10_CALTXSHIFTOVR_MASK 0x80000000 -#define PHY_ANALOG_TXRF10_CALTXSHIFTOVR_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_TXRF10_CALTXSHIFTOVR_SET(x) (((x) << 31) & 0x80000000) - -/* macros for TXRF11 */ -#define PHY_ANALOG_TXRF11_ADDRESS 0x00000068 -#define PHY_ANALOG_TXRF11_OFFSET 0x00000068 -#define PHY_ANALOG_TXRF11_SPARE11_MSB 1 -#define PHY_ANALOG_TXRF11_SPARE11_LSB 0 -#define PHY_ANALOG_TXRF11_SPARE11_MASK 0x00000003 -#define PHY_ANALOG_TXRF11_SPARE11_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF11_SPARE11_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS5G_MSB 4 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS5G_LSB 2 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS5G_MASK 0x0000001c -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS5G_GET(x) (((x) & 0x0000001c) >> 2) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS5G_SET(x) (((x) << 2) & 0x0000001c) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV5G_MSB 7 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV5G_LSB 5 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV5G_MASK 0x000000e0 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV5G_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV5G_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_TXRF11_PWD_IR25PA2G_MSB 10 -#define PHY_ANALOG_TXRF11_PWD_IR25PA2G_LSB 8 -#define PHY_ANALOG_TXRF11_PWD_IR25PA2G_MASK 0x00000700 -#define PHY_ANALOG_TXRF11_PWD_IR25PA2G_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_TXRF11_PWD_IR25PA2G_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS2G_MSB 13 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS2G_LSB 11 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS2G_MASK 0x00003800 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS2G_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS2G_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV2G_MSB 16 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV2G_LSB 14 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV2G_MASK 0x0001c000 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV2G_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV2G_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_TXRF11_PWD_ICSPARE_MSB 19 -#define PHY_ANALOG_TXRF11_PWD_ICSPARE_LSB 17 -#define PHY_ANALOG_TXRF11_PWD_ICSPARE_MASK 0x000e0000 -#define PHY_ANALOG_TXRF11_PWD_ICSPARE_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_TXRF11_PWD_ICSPARE_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G2_MSB 22 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G2_LSB 20 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G2_MASK 0x00700000 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G2_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G2_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G1_MSB 25 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G1_LSB 23 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G1_MASK 0x03800000 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G1_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G1_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_TXRF11_PWD_IC25MIXBUF5G_MSB 28 -#define PHY_ANALOG_TXRF11_PWD_IC25MIXBUF5G_LSB 26 -#define PHY_ANALOG_TXRF11_PWD_IC25MIXBUF5G_MASK 0x1c000000 -#define PHY_ANALOG_TXRF11_PWD_IC25MIXBUF5G_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_TXRF11_PWD_IC25MIXBUF5G_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_TXRF11_PWD_IC25PA2G_MSB 31 -#define PHY_ANALOG_TXRF11_PWD_IC25PA2G_LSB 29 -#define PHY_ANALOG_TXRF11_PWD_IC25PA2G_MASK 0xe0000000 -#define PHY_ANALOG_TXRF11_PWD_IC25PA2G_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_TXRF11_PWD_IC25PA2G_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for TXRF12 */ -#define PHY_ANALOG_TXRF12_ADDRESS 0x0000006c -#define PHY_ANALOG_TXRF12_OFFSET 0x0000006c -#define PHY_ANALOG_TXRF12_SPARE12_2_MSB 7 -#define PHY_ANALOG_TXRF12_SPARE12_2_LSB 0 -#define PHY_ANALOG_TXRF12_SPARE12_2_MASK 0x000000ff -#define PHY_ANALOG_TXRF12_SPARE12_2_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_ANALOG_TXRF12_SPARE12_1_MSB 15 -#define PHY_ANALOG_TXRF12_SPARE12_1_LSB 8 -#define PHY_ANALOG_TXRF12_SPARE12_1_MASK 0x0000ff00 -#define PHY_ANALOG_TXRF12_SPARE12_1_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_ANALOG_TXRF12_SPARE12_1_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_ANALOG_TXRF12_ATBSEL5G_MSB 19 -#define PHY_ANALOG_TXRF12_ATBSEL5G_LSB 16 -#define PHY_ANALOG_TXRF12_ATBSEL5G_MASK 0x000f0000 -#define PHY_ANALOG_TXRF12_ATBSEL5G_GET(x) (((x) & 0x000f0000) >> 16) -#define PHY_ANALOG_TXRF12_ATBSEL5G_SET(x) (((x) << 16) & 0x000f0000) -#define PHY_ANALOG_TXRF12_ATBSEL2G_MSB 22 -#define PHY_ANALOG_TXRF12_ATBSEL2G_LSB 20 -#define PHY_ANALOG_TXRF12_ATBSEL2G_MASK 0x00700000 -#define PHY_ANALOG_TXRF12_ATBSEL2G_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_TXRF12_ATBSEL2G_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_TXRF12_PWD_IRSPARE_MSB 25 -#define PHY_ANALOG_TXRF12_PWD_IRSPARE_LSB 23 -#define PHY_ANALOG_TXRF12_PWD_IRSPARE_MASK 0x03800000 -#define PHY_ANALOG_TXRF12_PWD_IRSPARE_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_TXRF12_PWD_IRSPARE_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G2_MSB 28 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G2_LSB 26 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G2_MASK 0x1c000000 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G2_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G2_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G1_MSB 31 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G1_LSB 29 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G1_MASK 0xe0000000 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G1_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G1_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for SYNTH1 */ -#define PHY_ANALOG_SYNTH1_ADDRESS 0x00000080 -#define PHY_ANALOG_SYNTH1_OFFSET 0x00000080 -#define PHY_ANALOG_SYNTH1_SEL_VCMONABUS_MSB 2 -#define PHY_ANALOG_SYNTH1_SEL_VCMONABUS_LSB 0 -#define PHY_ANALOG_SYNTH1_SEL_VCMONABUS_MASK 0x00000007 -#define PHY_ANALOG_SYNTH1_SEL_VCMONABUS_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_SYNTH1_SEL_VCMONABUS_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_SYNTH1_SEL_VCOABUS_MSB 5 -#define PHY_ANALOG_SYNTH1_SEL_VCOABUS_LSB 3 -#define PHY_ANALOG_SYNTH1_SEL_VCOABUS_MASK 0x00000038 -#define PHY_ANALOG_SYNTH1_SEL_VCOABUS_GET(x) (((x) & 0x00000038) >> 3) -#define PHY_ANALOG_SYNTH1_SEL_VCOABUS_SET(x) (((x) << 3) & 0x00000038) -#define PHY_ANALOG_SYNTH1_MONITOR_SYNTHLOCKVCOK_MSB 6 -#define PHY_ANALOG_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB 6 -#define PHY_ANALOG_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK 0x00000040 -#define PHY_ANALOG_SYNTH1_MONITOR_SYNTHLOCKVCOK_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_SYNTH1_MONITOR_SYNTHLOCKVCOK_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_SYNTH1_MONITOR_VC2LOW_MSB 7 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2LOW_LSB 7 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2LOW_MASK 0x00000080 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2LOW_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_SYNTH1_MONITOR_VC2LOW_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_SYNTH1_MONITOR_VC2HIGH_MSB 8 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2HIGH_LSB 8 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2HIGH_MASK 0x00000100 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2HIGH_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_SYNTH1_MONITOR_VC2HIGH_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_SYNTH1_MONITOR_FB_DIV2_MSB 9 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_DIV2_LSB 9 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_DIV2_MASK 0x00000200 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_DIV2_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_SYNTH1_MONITOR_FB_DIV2_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_SYNTH1_MONITOR_REF_MSB 10 -#define PHY_ANALOG_SYNTH1_MONITOR_REF_LSB 10 -#define PHY_ANALOG_SYNTH1_MONITOR_REF_MASK 0x00000400 -#define PHY_ANALOG_SYNTH1_MONITOR_REF_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_SYNTH1_MONITOR_REF_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_SYNTH1_MONITOR_FB_MSB 11 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_LSB 11 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_MASK 0x00000800 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_SYNTH1_MONITOR_FB_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_SYNTH1_SEVENBITVCOCAP_MSB 12 -#define PHY_ANALOG_SYNTH1_SEVENBITVCOCAP_LSB 12 -#define PHY_ANALOG_SYNTH1_SEVENBITVCOCAP_MASK 0x00001000 -#define PHY_ANALOG_SYNTH1_SEVENBITVCOCAP_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_SYNTH1_SEVENBITVCOCAP_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_SYNTH1_PWUP_PD_MSB 15 -#define PHY_ANALOG_SYNTH1_PWUP_PD_LSB 13 -#define PHY_ANALOG_SYNTH1_PWUP_PD_MASK 0x0000e000 -#define PHY_ANALOG_SYNTH1_PWUP_PD_GET(x) (((x) & 0x0000e000) >> 13) -#define PHY_ANALOG_SYNTH1_PWUP_PD_SET(x) (((x) << 13) & 0x0000e000) -#define PHY_ANALOG_SYNTH1_PWD_VCOBUF_MSB 16 -#define PHY_ANALOG_SYNTH1_PWD_VCOBUF_LSB 16 -#define PHY_ANALOG_SYNTH1_PWD_VCOBUF_MASK 0x00010000 -#define PHY_ANALOG_SYNTH1_PWD_VCOBUF_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_SYNTH1_PWD_VCOBUF_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_SYNTH1_VCOBUFGAIN_MSB 18 -#define PHY_ANALOG_SYNTH1_VCOBUFGAIN_LSB 17 -#define PHY_ANALOG_SYNTH1_VCOBUFGAIN_MASK 0x00060000 -#define PHY_ANALOG_SYNTH1_VCOBUFGAIN_GET(x) (((x) & 0x00060000) >> 17) -#define PHY_ANALOG_SYNTH1_VCOBUFGAIN_SET(x) (((x) << 17) & 0x00060000) -#define PHY_ANALOG_SYNTH1_VCOREGLEVEL_MSB 20 -#define PHY_ANALOG_SYNTH1_VCOREGLEVEL_LSB 19 -#define PHY_ANALOG_SYNTH1_VCOREGLEVEL_MASK 0x00180000 -#define PHY_ANALOG_SYNTH1_VCOREGLEVEL_GET(x) (((x) & 0x00180000) >> 19) -#define PHY_ANALOG_SYNTH1_VCOREGLEVEL_SET(x) (((x) << 19) & 0x00180000) -#define PHY_ANALOG_SYNTH1_VCOREGBYPASS_MSB 21 -#define PHY_ANALOG_SYNTH1_VCOREGBYPASS_LSB 21 -#define PHY_ANALOG_SYNTH1_VCOREGBYPASS_MASK 0x00200000 -#define PHY_ANALOG_SYNTH1_VCOREGBYPASS_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_SYNTH1_VCOREGBYPASS_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_SYNTH1_PWUP_LOREF_MSB 22 -#define PHY_ANALOG_SYNTH1_PWUP_LOREF_LSB 22 -#define PHY_ANALOG_SYNTH1_PWUP_LOREF_MASK 0x00400000 -#define PHY_ANALOG_SYNTH1_PWUP_LOREF_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_SYNTH1_PWUP_LOREF_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_SYNTH1_PWD_LOMIX_MSB 23 -#define PHY_ANALOG_SYNTH1_PWD_LOMIX_LSB 23 -#define PHY_ANALOG_SYNTH1_PWD_LOMIX_MASK 0x00800000 -#define PHY_ANALOG_SYNTH1_PWD_LOMIX_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_SYNTH1_PWD_LOMIX_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_SYNTH1_PWD_LODIV_MSB 24 -#define PHY_ANALOG_SYNTH1_PWD_LODIV_LSB 24 -#define PHY_ANALOG_SYNTH1_PWD_LODIV_MASK 0x01000000 -#define PHY_ANALOG_SYNTH1_PWD_LODIV_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_ANALOG_SYNTH1_PWD_LODIV_SET(x) (((x) << 24) & 0x01000000) -#define PHY_ANALOG_SYNTH1_PWD_LOBUF5G_MSB 25 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF5G_LSB 25 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF5G_MASK 0x02000000 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF5G_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_ANALOG_SYNTH1_PWD_LOBUF5G_SET(x) (((x) << 25) & 0x02000000) -#define PHY_ANALOG_SYNTH1_PWD_LOBUF2G_MSB 26 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF2G_LSB 26 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF2G_MASK 0x04000000 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF2G_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_SYNTH1_PWD_LOBUF2G_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_SYNTH1_PWD_PRESC_MSB 27 -#define PHY_ANALOG_SYNTH1_PWD_PRESC_LSB 27 -#define PHY_ANALOG_SYNTH1_PWD_PRESC_MASK 0x08000000 -#define PHY_ANALOG_SYNTH1_PWD_PRESC_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_SYNTH1_PWD_PRESC_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_SYNTH1_PWD_VCO_MSB 28 -#define PHY_ANALOG_SYNTH1_PWD_VCO_LSB 28 -#define PHY_ANALOG_SYNTH1_PWD_VCO_MASK 0x10000000 -#define PHY_ANALOG_SYNTH1_PWD_VCO_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_SYNTH1_PWD_VCO_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_SYNTH1_PWD_VCMON_MSB 29 -#define PHY_ANALOG_SYNTH1_PWD_VCMON_LSB 29 -#define PHY_ANALOG_SYNTH1_PWD_VCMON_MASK 0x20000000 -#define PHY_ANALOG_SYNTH1_PWD_VCMON_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_SYNTH1_PWD_VCMON_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_SYNTH1_PWD_CP_MSB 30 -#define PHY_ANALOG_SYNTH1_PWD_CP_LSB 30 -#define PHY_ANALOG_SYNTH1_PWD_CP_MASK 0x40000000 -#define PHY_ANALOG_SYNTH1_PWD_CP_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_SYNTH1_PWD_CP_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_SYNTH1_PWD_BIAS_MSB 31 -#define PHY_ANALOG_SYNTH1_PWD_BIAS_LSB 31 -#define PHY_ANALOG_SYNTH1_PWD_BIAS_MASK 0x80000000 -#define PHY_ANALOG_SYNTH1_PWD_BIAS_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_SYNTH1_PWD_BIAS_SET(x) (((x) << 31) & 0x80000000) - -/* macros for SYNTH2 */ -#define PHY_ANALOG_SYNTH2_ADDRESS 0x00000084 -#define PHY_ANALOG_SYNTH2_OFFSET 0x00000084 -#define PHY_ANALOG_SYNTH2_CAPRANGE3_MSB 3 -#define PHY_ANALOG_SYNTH2_CAPRANGE3_LSB 0 -#define PHY_ANALOG_SYNTH2_CAPRANGE3_MASK 0x0000000f -#define PHY_ANALOG_SYNTH2_CAPRANGE3_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_SYNTH2_CAPRANGE3_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_ANALOG_SYNTH2_CAPRANGE2_MSB 7 -#define PHY_ANALOG_SYNTH2_CAPRANGE2_LSB 4 -#define PHY_ANALOG_SYNTH2_CAPRANGE2_MASK 0x000000f0 -#define PHY_ANALOG_SYNTH2_CAPRANGE2_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_ANALOG_SYNTH2_CAPRANGE2_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_ANALOG_SYNTH2_CAPRANGE1_MSB 11 -#define PHY_ANALOG_SYNTH2_CAPRANGE1_LSB 8 -#define PHY_ANALOG_SYNTH2_CAPRANGE1_MASK 0x00000f00 -#define PHY_ANALOG_SYNTH2_CAPRANGE1_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_SYNTH2_CAPRANGE1_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_SYNTH2_LOOPLEAKCUR_MSB 15 -#define PHY_ANALOG_SYNTH2_LOOPLEAKCUR_LSB 12 -#define PHY_ANALOG_SYNTH2_LOOPLEAKCUR_MASK 0x0000f000 -#define PHY_ANALOG_SYNTH2_LOOPLEAKCUR_GET(x) (((x) & 0x0000f000) >> 12) -#define PHY_ANALOG_SYNTH2_LOOPLEAKCUR_SET(x) (((x) << 12) & 0x0000f000) -#define PHY_ANALOG_SYNTH2_CPLOWLK_MSB 16 -#define PHY_ANALOG_SYNTH2_CPLOWLK_LSB 16 -#define PHY_ANALOG_SYNTH2_CPLOWLK_MASK 0x00010000 -#define PHY_ANALOG_SYNTH2_CPLOWLK_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_SYNTH2_CPLOWLK_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_SYNTH2_CPSTEERING_EN_INTN_MSB 17 -#define PHY_ANALOG_SYNTH2_CPSTEERING_EN_INTN_LSB 17 -#define PHY_ANALOG_SYNTH2_CPSTEERING_EN_INTN_MASK 0x00020000 -#define PHY_ANALOG_SYNTH2_CPSTEERING_EN_INTN_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_SYNTH2_CPSTEERING_EN_INTN_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_SYNTH2_CPBIAS_MSB 19 -#define PHY_ANALOG_SYNTH2_CPBIAS_LSB 18 -#define PHY_ANALOG_SYNTH2_CPBIAS_MASK 0x000c0000 -#define PHY_ANALOG_SYNTH2_CPBIAS_GET(x) (((x) & 0x000c0000) >> 18) -#define PHY_ANALOG_SYNTH2_CPBIAS_SET(x) (((x) << 18) & 0x000c0000) -#define PHY_ANALOG_SYNTH2_VC_LOW_REF_MSB 22 -#define PHY_ANALOG_SYNTH2_VC_LOW_REF_LSB 20 -#define PHY_ANALOG_SYNTH2_VC_LOW_REF_MASK 0x00700000 -#define PHY_ANALOG_SYNTH2_VC_LOW_REF_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_SYNTH2_VC_LOW_REF_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_SYNTH2_VC_MID_REF_MSB 25 -#define PHY_ANALOG_SYNTH2_VC_MID_REF_LSB 23 -#define PHY_ANALOG_SYNTH2_VC_MID_REF_MASK 0x03800000 -#define PHY_ANALOG_SYNTH2_VC_MID_REF_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_SYNTH2_VC_MID_REF_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_SYNTH2_VC_HI_REF_MSB 28 -#define PHY_ANALOG_SYNTH2_VC_HI_REF_LSB 26 -#define PHY_ANALOG_SYNTH2_VC_HI_REF_MASK 0x1c000000 -#define PHY_ANALOG_SYNTH2_VC_HI_REF_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_SYNTH2_VC_HI_REF_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_SYNTH2_VC_CAL_REF_MSB 31 -#define PHY_ANALOG_SYNTH2_VC_CAL_REF_LSB 29 -#define PHY_ANALOG_SYNTH2_VC_CAL_REF_MASK 0xe0000000 -#define PHY_ANALOG_SYNTH2_VC_CAL_REF_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_SYNTH2_VC_CAL_REF_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for SYNTH3 */ -#define PHY_ANALOG_SYNTH3_ADDRESS 0x00000088 -#define PHY_ANALOG_SYNTH3_OFFSET 0x00000088 -#define PHY_ANALOG_SYNTH3_WAIT_VC_CHECK_MSB 5 -#define PHY_ANALOG_SYNTH3_WAIT_VC_CHECK_LSB 0 -#define PHY_ANALOG_SYNTH3_WAIT_VC_CHECK_MASK 0x0000003f -#define PHY_ANALOG_SYNTH3_WAIT_VC_CHECK_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_ANALOG_SYNTH3_WAIT_VC_CHECK_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_ANALOG_SYNTH3_WAIT_CAL_LIN_MSB 11 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_LIN_LSB 6 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_LIN_MASK 0x00000fc0 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_LIN_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_ANALOG_SYNTH3_WAIT_CAL_LIN_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_ANALOG_SYNTH3_WAIT_CAL_BIN_MSB 17 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_BIN_LSB 12 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_BIN_MASK 0x0003f000 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_BIN_GET(x) (((x) & 0x0003f000) >> 12) -#define PHY_ANALOG_SYNTH3_WAIT_CAL_BIN_SET(x) (((x) << 12) & 0x0003f000) -#define PHY_ANALOG_SYNTH3_WAIT_PWRUP_MSB 23 -#define PHY_ANALOG_SYNTH3_WAIT_PWRUP_LSB 18 -#define PHY_ANALOG_SYNTH3_WAIT_PWRUP_MASK 0x00fc0000 -#define PHY_ANALOG_SYNTH3_WAIT_PWRUP_GET(x) (((x) & 0x00fc0000) >> 18) -#define PHY_ANALOG_SYNTH3_WAIT_PWRUP_SET(x) (((x) << 18) & 0x00fc0000) -#define PHY_ANALOG_SYNTH3_WAIT_SHORTR_PWRUP_MSB 29 -#define PHY_ANALOG_SYNTH3_WAIT_SHORTR_PWRUP_LSB 24 -#define PHY_ANALOG_SYNTH3_WAIT_SHORTR_PWRUP_MASK 0x3f000000 -#define PHY_ANALOG_SYNTH3_WAIT_SHORTR_PWRUP_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_ANALOG_SYNTH3_WAIT_SHORTR_PWRUP_SET(x) (((x) << 24) & 0x3f000000) -#define PHY_ANALOG_SYNTH3_SEL_CLK_DIV2_MSB 30 -#define PHY_ANALOG_SYNTH3_SEL_CLK_DIV2_LSB 30 -#define PHY_ANALOG_SYNTH3_SEL_CLK_DIV2_MASK 0x40000000 -#define PHY_ANALOG_SYNTH3_SEL_CLK_DIV2_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_SYNTH3_SEL_CLK_DIV2_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_SYNTH3_DIS_CLK_XTAL_MSB 31 -#define PHY_ANALOG_SYNTH3_DIS_CLK_XTAL_LSB 31 -#define PHY_ANALOG_SYNTH3_DIS_CLK_XTAL_MASK 0x80000000 -#define PHY_ANALOG_SYNTH3_DIS_CLK_XTAL_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_SYNTH3_DIS_CLK_XTAL_SET(x) (((x) << 31) & 0x80000000) - -/* macros for SYNTH4 */ -#define PHY_ANALOG_SYNTH4_ADDRESS 0x0000008c -#define PHY_ANALOG_SYNTH4_OFFSET 0x0000008c -#define PHY_ANALOG_SYNTH4_PS_SINGLE_PULSE_MSB 0 -#define PHY_ANALOG_SYNTH4_PS_SINGLE_PULSE_LSB 0 -#define PHY_ANALOG_SYNTH4_PS_SINGLE_PULSE_MASK 0x00000001 -#define PHY_ANALOG_SYNTH4_PS_SINGLE_PULSE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_SYNTH4_PS_SINGLE_PULSE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_SYNTH4_LONGSHIFTSEL_MSB 1 -#define PHY_ANALOG_SYNTH4_LONGSHIFTSEL_LSB 1 -#define PHY_ANALOG_SYNTH4_LONGSHIFTSEL_MASK 0x00000002 -#define PHY_ANALOG_SYNTH4_LONGSHIFTSEL_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_SYNTH4_LONGSHIFTSEL_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_SYNTH4_LOBUF5GTUNE_OVR_MSB 3 -#define PHY_ANALOG_SYNTH4_LOBUF5GTUNE_OVR_LSB 2 -#define PHY_ANALOG_SYNTH4_LOBUF5GTUNE_OVR_MASK 0x0000000c -#define PHY_ANALOG_SYNTH4_LOBUF5GTUNE_OVR_GET(x) (((x) & 0x0000000c) >> 2) -#define PHY_ANALOG_SYNTH4_LOBUF5GTUNE_OVR_SET(x) (((x) << 2) & 0x0000000c) -#define PHY_ANALOG_SYNTH4_FORCE_LOBUF5GTUNE_MSB 4 -#define PHY_ANALOG_SYNTH4_FORCE_LOBUF5GTUNE_LSB 4 -#define PHY_ANALOG_SYNTH4_FORCE_LOBUF5GTUNE_MASK 0x00000010 -#define PHY_ANALOG_SYNTH4_FORCE_LOBUF5GTUNE_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_SYNTH4_FORCE_LOBUF5GTUNE_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_SYNTH4_PSCOUNT_FBSEL_MSB 5 -#define PHY_ANALOG_SYNTH4_PSCOUNT_FBSEL_LSB 5 -#define PHY_ANALOG_SYNTH4_PSCOUNT_FBSEL_MASK 0x00000020 -#define PHY_ANALOG_SYNTH4_PSCOUNT_FBSEL_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_SYNTH4_PSCOUNT_FBSEL_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_SYNTH4_SDM_DITHER_MSB 7 -#define PHY_ANALOG_SYNTH4_SDM_DITHER_LSB 6 -#define PHY_ANALOG_SYNTH4_SDM_DITHER_MASK 0x000000c0 -#define PHY_ANALOG_SYNTH4_SDM_DITHER_GET(x) (((x) & 0x000000c0) >> 6) -#define PHY_ANALOG_SYNTH4_SDM_DITHER_SET(x) (((x) << 6) & 0x000000c0) -#define PHY_ANALOG_SYNTH4_SDM_MODE_MSB 8 -#define PHY_ANALOG_SYNTH4_SDM_MODE_LSB 8 -#define PHY_ANALOG_SYNTH4_SDM_MODE_MASK 0x00000100 -#define PHY_ANALOG_SYNTH4_SDM_MODE_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_SYNTH4_SDM_MODE_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_SYNTH4_SDM_DISABLE_MSB 9 -#define PHY_ANALOG_SYNTH4_SDM_DISABLE_LSB 9 -#define PHY_ANALOG_SYNTH4_SDM_DISABLE_MASK 0x00000200 -#define PHY_ANALOG_SYNTH4_SDM_DISABLE_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_SYNTH4_SDM_DISABLE_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_SYNTH4_RESET_PRESC_MSB 10 -#define PHY_ANALOG_SYNTH4_RESET_PRESC_LSB 10 -#define PHY_ANALOG_SYNTH4_RESET_PRESC_MASK 0x00000400 -#define PHY_ANALOG_SYNTH4_RESET_PRESC_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_SYNTH4_RESET_PRESC_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_SYNTH4_PRESCSEL_MSB 12 -#define PHY_ANALOG_SYNTH4_PRESCSEL_LSB 11 -#define PHY_ANALOG_SYNTH4_PRESCSEL_MASK 0x00001800 -#define PHY_ANALOG_SYNTH4_PRESCSEL_GET(x) (((x) & 0x00001800) >> 11) -#define PHY_ANALOG_SYNTH4_PRESCSEL_SET(x) (((x) << 11) & 0x00001800) -#define PHY_ANALOG_SYNTH4_PFD_DISABLE_MSB 13 -#define PHY_ANALOG_SYNTH4_PFD_DISABLE_LSB 13 -#define PHY_ANALOG_SYNTH4_PFD_DISABLE_MASK 0x00002000 -#define PHY_ANALOG_SYNTH4_PFD_DISABLE_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_SYNTH4_PFD_DISABLE_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_SYNTH4_PFDDELAY_FRACN_MSB 14 -#define PHY_ANALOG_SYNTH4_PFDDELAY_FRACN_LSB 14 -#define PHY_ANALOG_SYNTH4_PFDDELAY_FRACN_MASK 0x00004000 -#define PHY_ANALOG_SYNTH4_PFDDELAY_FRACN_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_SYNTH4_PFDDELAY_FRACN_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_SYNTH4_FORCE_LO_ON_MSB 15 -#define PHY_ANALOG_SYNTH4_FORCE_LO_ON_LSB 15 -#define PHY_ANALOG_SYNTH4_FORCE_LO_ON_MASK 0x00008000 -#define PHY_ANALOG_SYNTH4_FORCE_LO_ON_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_SYNTH4_FORCE_LO_ON_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_SYNTH4_CLKXTAL_EDGE_SEL_MSB 16 -#define PHY_ANALOG_SYNTH4_CLKXTAL_EDGE_SEL_LSB 16 -#define PHY_ANALOG_SYNTH4_CLKXTAL_EDGE_SEL_MASK 0x00010000 -#define PHY_ANALOG_SYNTH4_CLKXTAL_EDGE_SEL_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_SYNTH4_CLKXTAL_EDGE_SEL_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_SYNTH4_VCOCAPPULLUP_MSB 17 -#define PHY_ANALOG_SYNTH4_VCOCAPPULLUP_LSB 17 -#define PHY_ANALOG_SYNTH4_VCOCAPPULLUP_MASK 0x00020000 -#define PHY_ANALOG_SYNTH4_VCOCAPPULLUP_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_SYNTH4_VCOCAPPULLUP_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_SYNTH4_VCOCAP_OVR_MSB 25 -#define PHY_ANALOG_SYNTH4_VCOCAP_OVR_LSB 18 -#define PHY_ANALOG_SYNTH4_VCOCAP_OVR_MASK 0x03fc0000 -#define PHY_ANALOG_SYNTH4_VCOCAP_OVR_GET(x) (((x) & 0x03fc0000) >> 18) -#define PHY_ANALOG_SYNTH4_VCOCAP_OVR_SET(x) (((x) << 18) & 0x03fc0000) -#define PHY_ANALOG_SYNTH4_FORCE_VCOCAP_MSB 26 -#define PHY_ANALOG_SYNTH4_FORCE_VCOCAP_LSB 26 -#define PHY_ANALOG_SYNTH4_FORCE_VCOCAP_MASK 0x04000000 -#define PHY_ANALOG_SYNTH4_FORCE_VCOCAP_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_SYNTH4_FORCE_VCOCAP_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_SYNTH4_FORCE_PINVC_MSB 27 -#define PHY_ANALOG_SYNTH4_FORCE_PINVC_LSB 27 -#define PHY_ANALOG_SYNTH4_FORCE_PINVC_MASK 0x08000000 -#define PHY_ANALOG_SYNTH4_FORCE_PINVC_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_SYNTH4_FORCE_PINVC_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_SYNTH4_SHORTR_UNTIL_LOCKED_MSB 28 -#define PHY_ANALOG_SYNTH4_SHORTR_UNTIL_LOCKED_LSB 28 -#define PHY_ANALOG_SYNTH4_SHORTR_UNTIL_LOCKED_MASK 0x10000000 -#define PHY_ANALOG_SYNTH4_SHORTR_UNTIL_LOCKED_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_SYNTH4_SHORTR_UNTIL_LOCKED_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_SYNTH4_ALWAYS_SHORTR_MSB 29 -#define PHY_ANALOG_SYNTH4_ALWAYS_SHORTR_LSB 29 -#define PHY_ANALOG_SYNTH4_ALWAYS_SHORTR_MASK 0x20000000 -#define PHY_ANALOG_SYNTH4_ALWAYS_SHORTR_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_SYNTH4_ALWAYS_SHORTR_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_SYNTH4_DIS_LOSTVC_MSB 30 -#define PHY_ANALOG_SYNTH4_DIS_LOSTVC_LSB 30 -#define PHY_ANALOG_SYNTH4_DIS_LOSTVC_MASK 0x40000000 -#define PHY_ANALOG_SYNTH4_DIS_LOSTVC_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_SYNTH4_DIS_LOSTVC_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_SYNTH4_DIS_LIN_CAPSEARCH_MSB 31 -#define PHY_ANALOG_SYNTH4_DIS_LIN_CAPSEARCH_LSB 31 -#define PHY_ANALOG_SYNTH4_DIS_LIN_CAPSEARCH_MASK 0x80000000 -#define PHY_ANALOG_SYNTH4_DIS_LIN_CAPSEARCH_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_SYNTH4_DIS_LIN_CAPSEARCH_SET(x) (((x) << 31) & 0x80000000) - -/* macros for SYNTH5 */ -#define PHY_ANALOG_SYNTH5_ADDRESS 0x00000090 -#define PHY_ANALOG_SYNTH5_OFFSET 0x00000090 -#define PHY_ANALOG_SYNTH5_VCOBIAS_MSB 1 -#define PHY_ANALOG_SYNTH5_VCOBIAS_LSB 0 -#define PHY_ANALOG_SYNTH5_VCOBIAS_MASK 0x00000003 -#define PHY_ANALOG_SYNTH5_VCOBIAS_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_SYNTH5_VCOBIAS_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF5G50_MSB 4 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF5G50_LSB 2 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF5G50_MASK 0x0000001c -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF5G50_GET(x) (((x) & 0x0000001c) >> 2) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF5G50_SET(x) (((x) << 2) & 0x0000001c) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF2G50_MSB 7 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF2G50_LSB 5 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF2G50_MASK 0x000000e0 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF2G50_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF2G50_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_SYNTH5_PWDB_ICVCO25_MSB 10 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCO25_LSB 8 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCO25_MASK 0x00000700 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCO25_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_SYNTH5_PWDB_ICVCO25_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_SYNTH5_PWDB_ICVCOREG25_MSB 13 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCOREG25_LSB 11 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCOREG25_MASK 0x00003800 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCOREG25_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_SYNTH5_PWDB_ICVCOREG25_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_SYNTH5_PWDB_IRVCOREG50_MSB 14 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCOREG50_LSB 14 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCOREG50_MASK 0x00004000 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCOREG50_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_SYNTH5_PWDB_IRVCOREG50_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOMIX_MSB 17 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOMIX_LSB 15 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOMIX_MASK 0x00038000 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOMIX_GET(x) (((x) & 0x00038000) >> 15) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOMIX_SET(x) (((x) << 15) & 0x00038000) -#define PHY_ANALOG_SYNTH5_PWDB_ICLODIV50_MSB 20 -#define PHY_ANALOG_SYNTH5_PWDB_ICLODIV50_LSB 18 -#define PHY_ANALOG_SYNTH5_PWDB_ICLODIV50_MASK 0x001c0000 -#define PHY_ANALOG_SYNTH5_PWDB_ICLODIV50_GET(x) (((x) & 0x001c0000) >> 18) -#define PHY_ANALOG_SYNTH5_PWDB_ICLODIV50_SET(x) (((x) << 18) & 0x001c0000) -#define PHY_ANALOG_SYNTH5_PWDB_ICPRESC50_MSB 23 -#define PHY_ANALOG_SYNTH5_PWDB_ICPRESC50_LSB 21 -#define PHY_ANALOG_SYNTH5_PWDB_ICPRESC50_MASK 0x00e00000 -#define PHY_ANALOG_SYNTH5_PWDB_ICPRESC50_GET(x) (((x) & 0x00e00000) >> 21) -#define PHY_ANALOG_SYNTH5_PWDB_ICPRESC50_SET(x) (((x) << 21) & 0x00e00000) -#define PHY_ANALOG_SYNTH5_PWDB_IRVCMON25_MSB 26 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCMON25_LSB 24 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCMON25_MASK 0x07000000 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCMON25_GET(x) (((x) & 0x07000000) >> 24) -#define PHY_ANALOG_SYNTH5_PWDB_IRVCMON25_SET(x) (((x) << 24) & 0x07000000) -#define PHY_ANALOG_SYNTH5_PWDB_IRPFDCP_MSB 29 -#define PHY_ANALOG_SYNTH5_PWDB_IRPFDCP_LSB 27 -#define PHY_ANALOG_SYNTH5_PWDB_IRPFDCP_MASK 0x38000000 -#define PHY_ANALOG_SYNTH5_PWDB_IRPFDCP_GET(x) (((x) & 0x38000000) >> 27) -#define PHY_ANALOG_SYNTH5_PWDB_IRPFDCP_SET(x) (((x) << 27) & 0x38000000) -#define PHY_ANALOG_SYNTH5_SPARE5A_MSB 31 -#define PHY_ANALOG_SYNTH5_SPARE5A_LSB 30 -#define PHY_ANALOG_SYNTH5_SPARE5A_MASK 0xc0000000 -#define PHY_ANALOG_SYNTH5_SPARE5A_GET(x) (((x) & 0xc0000000) >> 30) -#define PHY_ANALOG_SYNTH5_SPARE5A_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for SYNTH6 */ -#define PHY_ANALOG_SYNTH6_ADDRESS 0x00000094 -#define PHY_ANALOG_SYNTH6_OFFSET 0x00000094 -#define PHY_ANALOG_SYNTH6_LOBUF5GTUNE_MSB 1 -#define PHY_ANALOG_SYNTH6_LOBUF5GTUNE_LSB 0 -#define PHY_ANALOG_SYNTH6_LOBUF5GTUNE_MASK 0x00000003 -#define PHY_ANALOG_SYNTH6_LOBUF5GTUNE_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_SYNTH6_LOOP_IP_MSB 8 -#define PHY_ANALOG_SYNTH6_LOOP_IP_LSB 2 -#define PHY_ANALOG_SYNTH6_LOOP_IP_MASK 0x000001fc -#define PHY_ANALOG_SYNTH6_LOOP_IP_GET(x) (((x) & 0x000001fc) >> 2) -#define PHY_ANALOG_SYNTH6_VC2LOW_MSB 9 -#define PHY_ANALOG_SYNTH6_VC2LOW_LSB 9 -#define PHY_ANALOG_SYNTH6_VC2LOW_MASK 0x00000200 -#define PHY_ANALOG_SYNTH6_VC2LOW_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_SYNTH6_VC2HIGH_MSB 10 -#define PHY_ANALOG_SYNTH6_VC2HIGH_LSB 10 -#define PHY_ANALOG_SYNTH6_VC2HIGH_MASK 0x00000400 -#define PHY_ANALOG_SYNTH6_VC2HIGH_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_SYNTH6_RESET_SDM_B_MSB 11 -#define PHY_ANALOG_SYNTH6_RESET_SDM_B_LSB 11 -#define PHY_ANALOG_SYNTH6_RESET_SDM_B_MASK 0x00000800 -#define PHY_ANALOG_SYNTH6_RESET_SDM_B_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_SYNTH6_RESET_PSCOUNTERS_MSB 12 -#define PHY_ANALOG_SYNTH6_RESET_PSCOUNTERS_LSB 12 -#define PHY_ANALOG_SYNTH6_RESET_PSCOUNTERS_MASK 0x00001000 -#define PHY_ANALOG_SYNTH6_RESET_PSCOUNTERS_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_SYNTH6_RESET_PFD_MSB 13 -#define PHY_ANALOG_SYNTH6_RESET_PFD_LSB 13 -#define PHY_ANALOG_SYNTH6_RESET_PFD_MASK 0x00002000 -#define PHY_ANALOG_SYNTH6_RESET_PFD_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_SYNTH6_RESET_RFD_MSB 14 -#define PHY_ANALOG_SYNTH6_RESET_RFD_LSB 14 -#define PHY_ANALOG_SYNTH6_RESET_RFD_MASK 0x00004000 -#define PHY_ANALOG_SYNTH6_RESET_RFD_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_SYNTH6_SHORT_R_MSB 15 -#define PHY_ANALOG_SYNTH6_SHORT_R_LSB 15 -#define PHY_ANALOG_SYNTH6_SHORT_R_MASK 0x00008000 -#define PHY_ANALOG_SYNTH6_SHORT_R_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_SYNTH6_VCO_CAP_ST_MSB 23 -#define PHY_ANALOG_SYNTH6_VCO_CAP_ST_LSB 16 -#define PHY_ANALOG_SYNTH6_VCO_CAP_ST_MASK 0x00ff0000 -#define PHY_ANALOG_SYNTH6_VCO_CAP_ST_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_ANALOG_SYNTH6_PIN_VC_MSB 24 -#define PHY_ANALOG_SYNTH6_PIN_VC_LSB 24 -#define PHY_ANALOG_SYNTH6_PIN_VC_MASK 0x01000000 -#define PHY_ANALOG_SYNTH6_PIN_VC_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_ANALOG_SYNTH6_SYNTH_LOCK_VC_OK_MSB 25 -#define PHY_ANALOG_SYNTH6_SYNTH_LOCK_VC_OK_LSB 25 -#define PHY_ANALOG_SYNTH6_SYNTH_LOCK_VC_OK_MASK 0x02000000 -#define PHY_ANALOG_SYNTH6_SYNTH_LOCK_VC_OK_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_ANALOG_SYNTH6_CAP_SEARCH_MSB 26 -#define PHY_ANALOG_SYNTH6_CAP_SEARCH_LSB 26 -#define PHY_ANALOG_SYNTH6_CAP_SEARCH_MASK 0x04000000 -#define PHY_ANALOG_SYNTH6_CAP_SEARCH_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_SYNTH6_SYNTH_SM_STATE_MSB 30 -#define PHY_ANALOG_SYNTH6_SYNTH_SM_STATE_LSB 27 -#define PHY_ANALOG_SYNTH6_SYNTH_SM_STATE_MASK 0x78000000 -#define PHY_ANALOG_SYNTH6_SYNTH_SM_STATE_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_ANALOG_SYNTH6_SYNTH_ON_MSB 31 -#define PHY_ANALOG_SYNTH6_SYNTH_ON_LSB 31 -#define PHY_ANALOG_SYNTH6_SYNTH_ON_MASK 0x80000000 -#define PHY_ANALOG_SYNTH6_SYNTH_ON_GET(x) (((x) & 0x80000000) >> 31) - -/* macros for SYNTH7 */ -#define PHY_ANALOG_SYNTH7_ADDRESS 0x00000098 -#define PHY_ANALOG_SYNTH7_OFFSET 0x00000098 -#define PHY_ANALOG_SYNTH7_OVRCHANDECODER_MSB 0 -#define PHY_ANALOG_SYNTH7_OVRCHANDECODER_LSB 0 -#define PHY_ANALOG_SYNTH7_OVRCHANDECODER_MASK 0x00000001 -#define PHY_ANALOG_SYNTH7_OVRCHANDECODER_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_SYNTH7_OVRCHANDECODER_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_SYNTH7_FORCE_FRACLSB_MSB 1 -#define PHY_ANALOG_SYNTH7_FORCE_FRACLSB_LSB 1 -#define PHY_ANALOG_SYNTH7_FORCE_FRACLSB_MASK 0x00000002 -#define PHY_ANALOG_SYNTH7_FORCE_FRACLSB_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_SYNTH7_FORCE_FRACLSB_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_SYNTH7_CHANFRAC_MSB 18 -#define PHY_ANALOG_SYNTH7_CHANFRAC_LSB 2 -#define PHY_ANALOG_SYNTH7_CHANFRAC_MASK 0x0007fffc -#define PHY_ANALOG_SYNTH7_CHANFRAC_GET(x) (((x) & 0x0007fffc) >> 2) -#define PHY_ANALOG_SYNTH7_CHANFRAC_SET(x) (((x) << 2) & 0x0007fffc) -#define PHY_ANALOG_SYNTH7_CHANSEL_MSB 27 -#define PHY_ANALOG_SYNTH7_CHANSEL_LSB 19 -#define PHY_ANALOG_SYNTH7_CHANSEL_MASK 0x0ff80000 -#define PHY_ANALOG_SYNTH7_CHANSEL_GET(x) (((x) & 0x0ff80000) >> 19) -#define PHY_ANALOG_SYNTH7_CHANSEL_SET(x) (((x) << 19) & 0x0ff80000) -#define PHY_ANALOG_SYNTH7_AMODEREFSEL_MSB 29 -#define PHY_ANALOG_SYNTH7_AMODEREFSEL_LSB 28 -#define PHY_ANALOG_SYNTH7_AMODEREFSEL_MASK 0x30000000 -#define PHY_ANALOG_SYNTH7_AMODEREFSEL_GET(x) (((x) & 0x30000000) >> 28) -#define PHY_ANALOG_SYNTH7_AMODEREFSEL_SET(x) (((x) << 28) & 0x30000000) -#define PHY_ANALOG_SYNTH7_FRACMODE_MSB 30 -#define PHY_ANALOG_SYNTH7_FRACMODE_LSB 30 -#define PHY_ANALOG_SYNTH7_FRACMODE_MASK 0x40000000 -#define PHY_ANALOG_SYNTH7_FRACMODE_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_SYNTH7_FRACMODE_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_SYNTH7_LOADSYNTHCHANNEL_MSB 31 -#define PHY_ANALOG_SYNTH7_LOADSYNTHCHANNEL_LSB 31 -#define PHY_ANALOG_SYNTH7_LOADSYNTHCHANNEL_MASK 0x80000000 -#define PHY_ANALOG_SYNTH7_LOADSYNTHCHANNEL_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_SYNTH7_LOADSYNTHCHANNEL_SET(x) (((x) << 31) & 0x80000000) - -/* macros for SYNTH8 */ -#define PHY_ANALOG_SYNTH8_ADDRESS 0x0000009c -#define PHY_ANALOG_SYNTH8_OFFSET 0x0000009c -#define PHY_ANALOG_SYNTH8_CPSTEERING_EN_FRACN_MSB 0 -#define PHY_ANALOG_SYNTH8_CPSTEERING_EN_FRACN_LSB 0 -#define PHY_ANALOG_SYNTH8_CPSTEERING_EN_FRACN_MASK 0x00000001 -#define PHY_ANALOG_SYNTH8_CPSTEERING_EN_FRACN_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_SYNTH8_CPSTEERING_EN_FRACN_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_SYNTH8_LOOP_ICPB_MSB 7 -#define PHY_ANALOG_SYNTH8_LOOP_ICPB_LSB 1 -#define PHY_ANALOG_SYNTH8_LOOP_ICPB_MASK 0x000000fe -#define PHY_ANALOG_SYNTH8_LOOP_ICPB_GET(x) (((x) & 0x000000fe) >> 1) -#define PHY_ANALOG_SYNTH8_LOOP_ICPB_SET(x) (((x) << 1) & 0x000000fe) -#define PHY_ANALOG_SYNTH8_LOOP_CSB_MSB 11 -#define PHY_ANALOG_SYNTH8_LOOP_CSB_LSB 8 -#define PHY_ANALOG_SYNTH8_LOOP_CSB_MASK 0x00000f00 -#define PHY_ANALOG_SYNTH8_LOOP_CSB_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_SYNTH8_LOOP_CSB_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_SYNTH8_LOOP_RSB_MSB 16 -#define PHY_ANALOG_SYNTH8_LOOP_RSB_LSB 12 -#define PHY_ANALOG_SYNTH8_LOOP_RSB_MASK 0x0001f000 -#define PHY_ANALOG_SYNTH8_LOOP_RSB_GET(x) (((x) & 0x0001f000) >> 12) -#define PHY_ANALOG_SYNTH8_LOOP_RSB_SET(x) (((x) << 12) & 0x0001f000) -#define PHY_ANALOG_SYNTH8_LOOP_CPB_MSB 21 -#define PHY_ANALOG_SYNTH8_LOOP_CPB_LSB 17 -#define PHY_ANALOG_SYNTH8_LOOP_CPB_MASK 0x003e0000 -#define PHY_ANALOG_SYNTH8_LOOP_CPB_GET(x) (((x) & 0x003e0000) >> 17) -#define PHY_ANALOG_SYNTH8_LOOP_CPB_SET(x) (((x) << 17) & 0x003e0000) -#define PHY_ANALOG_SYNTH8_LOOP_3RD_ORDER_RB_MSB 26 -#define PHY_ANALOG_SYNTH8_LOOP_3RD_ORDER_RB_LSB 22 -#define PHY_ANALOG_SYNTH8_LOOP_3RD_ORDER_RB_MASK 0x07c00000 -#define PHY_ANALOG_SYNTH8_LOOP_3RD_ORDER_RB_GET(x) (((x) & 0x07c00000) >> 22) -#define PHY_ANALOG_SYNTH8_LOOP_3RD_ORDER_RB_SET(x) (((x) << 22) & 0x07c00000) -#define PHY_ANALOG_SYNTH8_REFDIVB_MSB 31 -#define PHY_ANALOG_SYNTH8_REFDIVB_LSB 27 -#define PHY_ANALOG_SYNTH8_REFDIVB_MASK 0xf8000000 -#define PHY_ANALOG_SYNTH8_REFDIVB_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_SYNTH8_REFDIVB_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for SYNTH9 */ -#define PHY_ANALOG_SYNTH9_ADDRESS 0x000000a0 -#define PHY_ANALOG_SYNTH9_OFFSET 0x000000a0 -#define PHY_ANALOG_SYNTH9_PFDDELAY_INTN_MSB 0 -#define PHY_ANALOG_SYNTH9_PFDDELAY_INTN_LSB 0 -#define PHY_ANALOG_SYNTH9_PFDDELAY_INTN_MASK 0x00000001 -#define PHY_ANALOG_SYNTH9_PFDDELAY_INTN_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_SYNTH9_PFDDELAY_INTN_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_SYNTH9_SLOPE_ICPA0_MSB 3 -#define PHY_ANALOG_SYNTH9_SLOPE_ICPA0_LSB 1 -#define PHY_ANALOG_SYNTH9_SLOPE_ICPA0_MASK 0x0000000e -#define PHY_ANALOG_SYNTH9_SLOPE_ICPA0_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_ANALOG_SYNTH9_SLOPE_ICPA0_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_ANALOG_SYNTH9_LOOP_ICPA0_MSB 7 -#define PHY_ANALOG_SYNTH9_LOOP_ICPA0_LSB 4 -#define PHY_ANALOG_SYNTH9_LOOP_ICPA0_MASK 0x000000f0 -#define PHY_ANALOG_SYNTH9_LOOP_ICPA0_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_ANALOG_SYNTH9_LOOP_ICPA0_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_ANALOG_SYNTH9_LOOP_CSA0_MSB 11 -#define PHY_ANALOG_SYNTH9_LOOP_CSA0_LSB 8 -#define PHY_ANALOG_SYNTH9_LOOP_CSA0_MASK 0x00000f00 -#define PHY_ANALOG_SYNTH9_LOOP_CSA0_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_SYNTH9_LOOP_CSA0_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_SYNTH9_LOOP_RSA0_MSB 16 -#define PHY_ANALOG_SYNTH9_LOOP_RSA0_LSB 12 -#define PHY_ANALOG_SYNTH9_LOOP_RSA0_MASK 0x0001f000 -#define PHY_ANALOG_SYNTH9_LOOP_RSA0_GET(x) (((x) & 0x0001f000) >> 12) -#define PHY_ANALOG_SYNTH9_LOOP_RSA0_SET(x) (((x) << 12) & 0x0001f000) -#define PHY_ANALOG_SYNTH9_LOOP_CPA0_MSB 21 -#define PHY_ANALOG_SYNTH9_LOOP_CPA0_LSB 17 -#define PHY_ANALOG_SYNTH9_LOOP_CPA0_MASK 0x003e0000 -#define PHY_ANALOG_SYNTH9_LOOP_CPA0_GET(x) (((x) & 0x003e0000) >> 17) -#define PHY_ANALOG_SYNTH9_LOOP_CPA0_SET(x) (((x) << 17) & 0x003e0000) -#define PHY_ANALOG_SYNTH9_LOOP_3RD_ORDER_RA_MSB 26 -#define PHY_ANALOG_SYNTH9_LOOP_3RD_ORDER_RA_LSB 22 -#define PHY_ANALOG_SYNTH9_LOOP_3RD_ORDER_RA_MASK 0x07c00000 -#define PHY_ANALOG_SYNTH9_LOOP_3RD_ORDER_RA_GET(x) (((x) & 0x07c00000) >> 22) -#define PHY_ANALOG_SYNTH9_LOOP_3RD_ORDER_RA_SET(x) (((x) << 22) & 0x07c00000) -#define PHY_ANALOG_SYNTH9_REFDIVA_MSB 31 -#define PHY_ANALOG_SYNTH9_REFDIVA_LSB 27 -#define PHY_ANALOG_SYNTH9_REFDIVA_MASK 0xf8000000 -#define PHY_ANALOG_SYNTH9_REFDIVA_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_SYNTH9_REFDIVA_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for SYNTH10 */ -#define PHY_ANALOG_SYNTH10_ADDRESS 0x000000a4 -#define PHY_ANALOG_SYNTH10_OFFSET 0x000000a4 -#define PHY_ANALOG_SYNTH10_SPARE10A_MSB 0 -#define PHY_ANALOG_SYNTH10_SPARE10A_LSB 0 -#define PHY_ANALOG_SYNTH10_SPARE10A_MASK 0x00000001 -#define PHY_ANALOG_SYNTH10_SPARE10A_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_SYNTH10_SPARE10A_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_SYNTH10_PWDB_ICLOBIAS50_MSB 3 -#define PHY_ANALOG_SYNTH10_PWDB_ICLOBIAS50_LSB 1 -#define PHY_ANALOG_SYNTH10_PWDB_ICLOBIAS50_MASK 0x0000000e -#define PHY_ANALOG_SYNTH10_PWDB_ICLOBIAS50_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_ANALOG_SYNTH10_PWDB_ICLOBIAS50_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_ANALOG_SYNTH10_EN_2X_LOOPFILT_MSB 4 -#define PHY_ANALOG_SYNTH10_EN_2X_LOOPFILT_LSB 4 -#define PHY_ANALOG_SYNTH10_EN_2X_LOOPFILT_MASK 0x00000010 -#define PHY_ANALOG_SYNTH10_EN_2X_LOOPFILT_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_SYNTH10_EN_2X_LOOPFILT_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_SYNTH10_PWDB_IRSPARE25_MSB 7 -#define PHY_ANALOG_SYNTH10_PWDB_IRSPARE25_LSB 5 -#define PHY_ANALOG_SYNTH10_PWDB_IRSPARE25_MASK 0x000000e0 -#define PHY_ANALOG_SYNTH10_PWDB_IRSPARE25_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_SYNTH10_PWDB_IRSPARE25_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_SYNTH10_PWDB_ICSPARE25_MSB 10 -#define PHY_ANALOG_SYNTH10_PWDB_ICSPARE25_LSB 8 -#define PHY_ANALOG_SYNTH10_PWDB_ICSPARE25_MASK 0x00000700 -#define PHY_ANALOG_SYNTH10_PWDB_ICSPARE25_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_SYNTH10_PWDB_ICSPARE25_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_SYNTH10_SLOPE_ICPA1_MSB 13 -#define PHY_ANALOG_SYNTH10_SLOPE_ICPA1_LSB 11 -#define PHY_ANALOG_SYNTH10_SLOPE_ICPA1_MASK 0x00003800 -#define PHY_ANALOG_SYNTH10_SLOPE_ICPA1_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_SYNTH10_SLOPE_ICPA1_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_SYNTH10_LOOP_ICPA1_MSB 17 -#define PHY_ANALOG_SYNTH10_LOOP_ICPA1_LSB 14 -#define PHY_ANALOG_SYNTH10_LOOP_ICPA1_MASK 0x0003c000 -#define PHY_ANALOG_SYNTH10_LOOP_ICPA1_GET(x) (((x) & 0x0003c000) >> 14) -#define PHY_ANALOG_SYNTH10_LOOP_ICPA1_SET(x) (((x) << 14) & 0x0003c000) -#define PHY_ANALOG_SYNTH10_LOOP_CSA1_MSB 21 -#define PHY_ANALOG_SYNTH10_LOOP_CSA1_LSB 18 -#define PHY_ANALOG_SYNTH10_LOOP_CSA1_MASK 0x003c0000 -#define PHY_ANALOG_SYNTH10_LOOP_CSA1_GET(x) (((x) & 0x003c0000) >> 18) -#define PHY_ANALOG_SYNTH10_LOOP_CSA1_SET(x) (((x) << 18) & 0x003c0000) -#define PHY_ANALOG_SYNTH10_LOOP_RSA1_MSB 26 -#define PHY_ANALOG_SYNTH10_LOOP_RSA1_LSB 22 -#define PHY_ANALOG_SYNTH10_LOOP_RSA1_MASK 0x07c00000 -#define PHY_ANALOG_SYNTH10_LOOP_RSA1_GET(x) (((x) & 0x07c00000) >> 22) -#define PHY_ANALOG_SYNTH10_LOOP_RSA1_SET(x) (((x) << 22) & 0x07c00000) -#define PHY_ANALOG_SYNTH10_LOOP_CPA1_MSB 31 -#define PHY_ANALOG_SYNTH10_LOOP_CPA1_LSB 27 -#define PHY_ANALOG_SYNTH10_LOOP_CPA1_MASK 0xf8000000 -#define PHY_ANALOG_SYNTH10_LOOP_CPA1_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_SYNTH10_LOOP_CPA1_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for SYNTH11 */ -#define PHY_ANALOG_SYNTH11_ADDRESS 0x000000a8 -#define PHY_ANALOG_SYNTH11_OFFSET 0x000000a8 -#define PHY_ANALOG_SYNTH11_SPARE11A_MSB 4 -#define PHY_ANALOG_SYNTH11_SPARE11A_LSB 0 -#define PHY_ANALOG_SYNTH11_SPARE11A_MASK 0x0000001f -#define PHY_ANALOG_SYNTH11_SPARE11A_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_ANALOG_SYNTH11_SPARE11A_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_ANALOG_SYNTH11_FORCE_LOBUF5G_ON_MSB 5 -#define PHY_ANALOG_SYNTH11_FORCE_LOBUF5G_ON_LSB 5 -#define PHY_ANALOG_SYNTH11_FORCE_LOBUF5G_ON_MASK 0x00000020 -#define PHY_ANALOG_SYNTH11_FORCE_LOBUF5G_ON_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_SYNTH11_FORCE_LOBUF5G_ON_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_SYNTH11_LOREFSEL_MSB 7 -#define PHY_ANALOG_SYNTH11_LOREFSEL_LSB 6 -#define PHY_ANALOG_SYNTH11_LOREFSEL_MASK 0x000000c0 -#define PHY_ANALOG_SYNTH11_LOREFSEL_GET(x) (((x) & 0x000000c0) >> 6) -#define PHY_ANALOG_SYNTH11_LOREFSEL_SET(x) (((x) << 6) & 0x000000c0) -#define PHY_ANALOG_SYNTH11_LOBUF2GTUNE_MSB 9 -#define PHY_ANALOG_SYNTH11_LOBUF2GTUNE_LSB 8 -#define PHY_ANALOG_SYNTH11_LOBUF2GTUNE_MASK 0x00000300 -#define PHY_ANALOG_SYNTH11_LOBUF2GTUNE_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_ANALOG_SYNTH11_LOBUF2GTUNE_SET(x) (((x) << 8) & 0x00000300) -#define PHY_ANALOG_SYNTH11_CPSTEERING_MODE_MSB 10 -#define PHY_ANALOG_SYNTH11_CPSTEERING_MODE_LSB 10 -#define PHY_ANALOG_SYNTH11_CPSTEERING_MODE_MASK 0x00000400 -#define PHY_ANALOG_SYNTH11_CPSTEERING_MODE_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_SYNTH11_CPSTEERING_MODE_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_SYNTH11_SLOPE_ICPA2_MSB 13 -#define PHY_ANALOG_SYNTH11_SLOPE_ICPA2_LSB 11 -#define PHY_ANALOG_SYNTH11_SLOPE_ICPA2_MASK 0x00003800 -#define PHY_ANALOG_SYNTH11_SLOPE_ICPA2_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_SYNTH11_SLOPE_ICPA2_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_SYNTH11_LOOP_ICPA2_MSB 17 -#define PHY_ANALOG_SYNTH11_LOOP_ICPA2_LSB 14 -#define PHY_ANALOG_SYNTH11_LOOP_ICPA2_MASK 0x0003c000 -#define PHY_ANALOG_SYNTH11_LOOP_ICPA2_GET(x) (((x) & 0x0003c000) >> 14) -#define PHY_ANALOG_SYNTH11_LOOP_ICPA2_SET(x) (((x) << 14) & 0x0003c000) -#define PHY_ANALOG_SYNTH11_LOOP_CSA2_MSB 21 -#define PHY_ANALOG_SYNTH11_LOOP_CSA2_LSB 18 -#define PHY_ANALOG_SYNTH11_LOOP_CSA2_MASK 0x003c0000 -#define PHY_ANALOG_SYNTH11_LOOP_CSA2_GET(x) (((x) & 0x003c0000) >> 18) -#define PHY_ANALOG_SYNTH11_LOOP_CSA2_SET(x) (((x) << 18) & 0x003c0000) -#define PHY_ANALOG_SYNTH11_LOOP_RSA2_MSB 26 -#define PHY_ANALOG_SYNTH11_LOOP_RSA2_LSB 22 -#define PHY_ANALOG_SYNTH11_LOOP_RSA2_MASK 0x07c00000 -#define PHY_ANALOG_SYNTH11_LOOP_RSA2_GET(x) (((x) & 0x07c00000) >> 22) -#define PHY_ANALOG_SYNTH11_LOOP_RSA2_SET(x) (((x) << 22) & 0x07c00000) -#define PHY_ANALOG_SYNTH11_LOOP_CPA2_MSB 31 -#define PHY_ANALOG_SYNTH11_LOOP_CPA2_LSB 27 -#define PHY_ANALOG_SYNTH11_LOOP_CPA2_MASK 0xf8000000 -#define PHY_ANALOG_SYNTH11_LOOP_CPA2_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_SYNTH11_LOOP_CPA2_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for SYNTH12 */ -#define PHY_ANALOG_SYNTH12_ADDRESS 0x000000ac -#define PHY_ANALOG_SYNTH12_OFFSET 0x000000ac -#define PHY_ANALOG_SYNTH12_SPARE12A_MSB 17 -#define PHY_ANALOG_SYNTH12_SPARE12A_LSB 0 -#define PHY_ANALOG_SYNTH12_SPARE12A_MASK 0x0003ffff -#define PHY_ANALOG_SYNTH12_SPARE12A_GET(x) (((x) & 0x0003ffff) >> 0) -#define PHY_ANALOG_SYNTH12_SPARE12A_SET(x) (((x) << 0) & 0x0003ffff) -#define PHY_ANALOG_SYNTH12_STRCONT_MSB 18 -#define PHY_ANALOG_SYNTH12_STRCONT_LSB 18 -#define PHY_ANALOG_SYNTH12_STRCONT_MASK 0x00040000 -#define PHY_ANALOG_SYNTH12_STRCONT_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_SYNTH12_STRCONT_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_SYNTH12_VREFMUL3_MSB 22 -#define PHY_ANALOG_SYNTH12_VREFMUL3_LSB 19 -#define PHY_ANALOG_SYNTH12_VREFMUL3_MASK 0x00780000 -#define PHY_ANALOG_SYNTH12_VREFMUL3_GET(x) (((x) & 0x00780000) >> 19) -#define PHY_ANALOG_SYNTH12_VREFMUL3_SET(x) (((x) << 19) & 0x00780000) -#define PHY_ANALOG_SYNTH12_VREFMUL2_MSB 26 -#define PHY_ANALOG_SYNTH12_VREFMUL2_LSB 23 -#define PHY_ANALOG_SYNTH12_VREFMUL2_MASK 0x07800000 -#define PHY_ANALOG_SYNTH12_VREFMUL2_GET(x) (((x) & 0x07800000) >> 23) -#define PHY_ANALOG_SYNTH12_VREFMUL2_SET(x) (((x) << 23) & 0x07800000) -#define PHY_ANALOG_SYNTH12_VREFMUL1_MSB 30 -#define PHY_ANALOG_SYNTH12_VREFMUL1_LSB 27 -#define PHY_ANALOG_SYNTH12_VREFMUL1_MASK 0x78000000 -#define PHY_ANALOG_SYNTH12_VREFMUL1_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_ANALOG_SYNTH12_VREFMUL1_SET(x) (((x) << 27) & 0x78000000) -#define PHY_ANALOG_SYNTH12_CLK_DOUBLER_EN_MSB 31 -#define PHY_ANALOG_SYNTH12_CLK_DOUBLER_EN_LSB 31 -#define PHY_ANALOG_SYNTH12_CLK_DOUBLER_EN_MASK 0x80000000 -#define PHY_ANALOG_SYNTH12_CLK_DOUBLER_EN_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_SYNTH12_CLK_DOUBLER_EN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BIAS1 */ -#define PHY_ANALOG_BIAS1_ADDRESS 0x000000c0 -#define PHY_ANALOG_BIAS1_OFFSET 0x000000c0 -#define PHY_ANALOG_BIAS1_SPARE1_MSB 6 -#define PHY_ANALOG_BIAS1_SPARE1_LSB 0 -#define PHY_ANALOG_BIAS1_SPARE1_MASK 0x0000007f -#define PHY_ANALOG_BIAS1_SPARE1_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_ANALOG_BIAS1_SPARE1_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_ANALOG_BIAS1_PWD_IC25V2IQ_MSB 9 -#define PHY_ANALOG_BIAS1_PWD_IC25V2IQ_LSB 7 -#define PHY_ANALOG_BIAS1_PWD_IC25V2IQ_MASK 0x00000380 -#define PHY_ANALOG_BIAS1_PWD_IC25V2IQ_GET(x) (((x) & 0x00000380) >> 7) -#define PHY_ANALOG_BIAS1_PWD_IC25V2IQ_SET(x) (((x) << 7) & 0x00000380) -#define PHY_ANALOG_BIAS1_PWD_IC25V2II_MSB 12 -#define PHY_ANALOG_BIAS1_PWD_IC25V2II_LSB 10 -#define PHY_ANALOG_BIAS1_PWD_IC25V2II_MASK 0x00001c00 -#define PHY_ANALOG_BIAS1_PWD_IC25V2II_GET(x) (((x) & 0x00001c00) >> 10) -#define PHY_ANALOG_BIAS1_PWD_IC25V2II_SET(x) (((x) << 10) & 0x00001c00) -#define PHY_ANALOG_BIAS1_PWD_IC25BB_MSB 15 -#define PHY_ANALOG_BIAS1_PWD_IC25BB_LSB 13 -#define PHY_ANALOG_BIAS1_PWD_IC25BB_MASK 0x0000e000 -#define PHY_ANALOG_BIAS1_PWD_IC25BB_GET(x) (((x) & 0x0000e000) >> 13) -#define PHY_ANALOG_BIAS1_PWD_IC25BB_SET(x) (((x) << 13) & 0x0000e000) -#define PHY_ANALOG_BIAS1_PWD_IC25DAC_MSB 18 -#define PHY_ANALOG_BIAS1_PWD_IC25DAC_LSB 16 -#define PHY_ANALOG_BIAS1_PWD_IC25DAC_MASK 0x00070000 -#define PHY_ANALOG_BIAS1_PWD_IC25DAC_GET(x) (((x) & 0x00070000) >> 16) -#define PHY_ANALOG_BIAS1_PWD_IC25DAC_SET(x) (((x) << 16) & 0x00070000) -#define PHY_ANALOG_BIAS1_PWD_IC25FIR_MSB 21 -#define PHY_ANALOG_BIAS1_PWD_IC25FIR_LSB 19 -#define PHY_ANALOG_BIAS1_PWD_IC25FIR_MASK 0x00380000 -#define PHY_ANALOG_BIAS1_PWD_IC25FIR_GET(x) (((x) & 0x00380000) >> 19) -#define PHY_ANALOG_BIAS1_PWD_IC25FIR_SET(x) (((x) << 19) & 0x00380000) -#define PHY_ANALOG_BIAS1_PWD_IC25ADC_MSB 24 -#define PHY_ANALOG_BIAS1_PWD_IC25ADC_LSB 22 -#define PHY_ANALOG_BIAS1_PWD_IC25ADC_MASK 0x01c00000 -#define PHY_ANALOG_BIAS1_PWD_IC25ADC_GET(x) (((x) & 0x01c00000) >> 22) -#define PHY_ANALOG_BIAS1_PWD_IC25ADC_SET(x) (((x) << 22) & 0x01c00000) -#define PHY_ANALOG_BIAS1_BIAS_SEL_MSB 31 -#define PHY_ANALOG_BIAS1_BIAS_SEL_LSB 25 -#define PHY_ANALOG_BIAS1_BIAS_SEL_MASK 0xfe000000 -#define PHY_ANALOG_BIAS1_BIAS_SEL_GET(x) (((x) & 0xfe000000) >> 25) -#define PHY_ANALOG_BIAS1_BIAS_SEL_SET(x) (((x) << 25) & 0xfe000000) - -/* macros for BIAS2 */ -#define PHY_ANALOG_BIAS2_ADDRESS 0x000000c4 -#define PHY_ANALOG_BIAS2_OFFSET 0x000000c4 -#define PHY_ANALOG_BIAS2_SPARE2_MSB 4 -#define PHY_ANALOG_BIAS2_SPARE2_LSB 0 -#define PHY_ANALOG_BIAS2_SPARE2_MASK 0x0000001f -#define PHY_ANALOG_BIAS2_SPARE2_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_ANALOG_BIAS2_SPARE2_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_ANALOG_BIAS2_PWD_IC25XTALREG_MSB 7 -#define PHY_ANALOG_BIAS2_PWD_IC25XTALREG_LSB 5 -#define PHY_ANALOG_BIAS2_PWD_IC25XTALREG_MASK 0x000000e0 -#define PHY_ANALOG_BIAS2_PWD_IC25XTALREG_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_BIAS2_PWD_IC25XTALREG_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_BIAS2_PWD_IC25XTAL_MSB 10 -#define PHY_ANALOG_BIAS2_PWD_IC25XTAL_LSB 8 -#define PHY_ANALOG_BIAS2_PWD_IC25XTAL_MASK 0x00000700 -#define PHY_ANALOG_BIAS2_PWD_IC25XTAL_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_BIAS2_PWD_IC25XTAL_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_BIAS2_PWD_IC25TXRF_MSB 13 -#define PHY_ANALOG_BIAS2_PWD_IC25TXRF_LSB 11 -#define PHY_ANALOG_BIAS2_PWD_IC25TXRF_MASK 0x00003800 -#define PHY_ANALOG_BIAS2_PWD_IC25TXRF_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_BIAS2_PWD_IC25TXRF_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_BIAS2_PWD_IC25RXRF_MSB 16 -#define PHY_ANALOG_BIAS2_PWD_IC25RXRF_LSB 14 -#define PHY_ANALOG_BIAS2_PWD_IC25RXRF_MASK 0x0001c000 -#define PHY_ANALOG_BIAS2_PWD_IC25RXRF_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_BIAS2_PWD_IC25RXRF_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_BIAS2_PWD_IC50SYNTH_MSB 19 -#define PHY_ANALOG_BIAS2_PWD_IC50SYNTH_LSB 17 -#define PHY_ANALOG_BIAS2_PWD_IC50SYNTH_MASK 0x000e0000 -#define PHY_ANALOG_BIAS2_PWD_IC50SYNTH_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_BIAS2_PWD_IC50SYNTH_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLREG_MSB 22 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLREG_LSB 20 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLREG_MASK 0x00700000 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLREG_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLREG_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP2_MSB 25 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP2_LSB 23 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP2_MASK 0x03800000 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP2_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP2_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP_MSB 28 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP_LSB 26 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP_MASK 0x1c000000 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLGM_MSB 31 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLGM_LSB 29 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLGM_MASK 0xe0000000 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLGM_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLGM_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for BIAS3 */ -#define PHY_ANALOG_BIAS3_ADDRESS 0x000000c8 -#define PHY_ANALOG_BIAS3_OFFSET 0x000000c8 -#define PHY_ANALOG_BIAS3_SPARE3_MSB 1 -#define PHY_ANALOG_BIAS3_SPARE3_LSB 0 -#define PHY_ANALOG_BIAS3_SPARE3_MASK 0x00000003 -#define PHY_ANALOG_BIAS3_SPARE3_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_BIAS3_SPARE3_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_BIAS3_PWD_IR25XTALREG_MSB 4 -#define PHY_ANALOG_BIAS3_PWD_IR25XTALREG_LSB 2 -#define PHY_ANALOG_BIAS3_PWD_IR25XTALREG_MASK 0x0000001c -#define PHY_ANALOG_BIAS3_PWD_IR25XTALREG_GET(x) (((x) & 0x0000001c) >> 2) -#define PHY_ANALOG_BIAS3_PWD_IR25XTALREG_SET(x) (((x) << 2) & 0x0000001c) -#define PHY_ANALOG_BIAS3_PWD_IR25TXRF_MSB 7 -#define PHY_ANALOG_BIAS3_PWD_IR25TXRF_LSB 5 -#define PHY_ANALOG_BIAS3_PWD_IR25TXRF_MASK 0x000000e0 -#define PHY_ANALOG_BIAS3_PWD_IR25TXRF_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_BIAS3_PWD_IR25TXRF_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_BIAS3_PWD_IR25RXRF_MSB 10 -#define PHY_ANALOG_BIAS3_PWD_IR25RXRF_LSB 8 -#define PHY_ANALOG_BIAS3_PWD_IR25RXRF_MASK 0x00000700 -#define PHY_ANALOG_BIAS3_PWD_IR25RXRF_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_BIAS3_PWD_IR25RXRF_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_BIAS3_PWD_IR50SYNTH_MSB 13 -#define PHY_ANALOG_BIAS3_PWD_IR50SYNTH_LSB 11 -#define PHY_ANALOG_BIAS3_PWD_IR50SYNTH_MASK 0x00003800 -#define PHY_ANALOG_BIAS3_PWD_IR50SYNTH_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_BIAS3_PWD_IR50SYNTH_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_BIAS3_PWD_IR25PLLREG_MSB 16 -#define PHY_ANALOG_BIAS3_PWD_IR25PLLREG_LSB 14 -#define PHY_ANALOG_BIAS3_PWD_IR25PLLREG_MASK 0x0001c000 -#define PHY_ANALOG_BIAS3_PWD_IR25PLLREG_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_BIAS3_PWD_IR25PLLREG_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_BIAS3_PWD_IR25BB_MSB 19 -#define PHY_ANALOG_BIAS3_PWD_IR25BB_LSB 17 -#define PHY_ANALOG_BIAS3_PWD_IR25BB_MASK 0x000e0000 -#define PHY_ANALOG_BIAS3_PWD_IR25BB_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_BIAS3_PWD_IR25BB_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_BIAS3_PWD_IR50DAC_MSB 22 -#define PHY_ANALOG_BIAS3_PWD_IR50DAC_LSB 20 -#define PHY_ANALOG_BIAS3_PWD_IR50DAC_MASK 0x00700000 -#define PHY_ANALOG_BIAS3_PWD_IR50DAC_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_BIAS3_PWD_IR50DAC_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_BIAS3_PWD_IR25DAC_MSB 25 -#define PHY_ANALOG_BIAS3_PWD_IR25DAC_LSB 23 -#define PHY_ANALOG_BIAS3_PWD_IR25DAC_MASK 0x03800000 -#define PHY_ANALOG_BIAS3_PWD_IR25DAC_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_BIAS3_PWD_IR25DAC_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_BIAS3_PWD_IR25FIR_MSB 28 -#define PHY_ANALOG_BIAS3_PWD_IR25FIR_LSB 26 -#define PHY_ANALOG_BIAS3_PWD_IR25FIR_MASK 0x1c000000 -#define PHY_ANALOG_BIAS3_PWD_IR25FIR_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_BIAS3_PWD_IR25FIR_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_BIAS3_PWD_IR50ADC_MSB 31 -#define PHY_ANALOG_BIAS3_PWD_IR50ADC_LSB 29 -#define PHY_ANALOG_BIAS3_PWD_IR50ADC_MASK 0xe0000000 -#define PHY_ANALOG_BIAS3_PWD_IR50ADC_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_BIAS3_PWD_IR50ADC_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for BIAS4 */ -#define PHY_ANALOG_BIAS4_ADDRESS 0x000000cc -#define PHY_ANALOG_BIAS4_OFFSET 0x000000cc -#define PHY_ANALOG_BIAS4_SPARE4_MSB 13 -#define PHY_ANALOG_BIAS4_SPARE4_LSB 0 -#define PHY_ANALOG_BIAS4_SPARE4_MASK 0x00003fff -#define PHY_ANALOG_BIAS4_SPARE4_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_ANALOG_BIAS4_SPARE4_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREC_MSB 16 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREC_LSB 14 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREC_MASK 0x0001c000 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREC_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREC_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREB_MSB 19 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREB_LSB 17 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREB_MASK 0x000e0000 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREB_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREB_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREA_MSB 22 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREA_LSB 20 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREA_MASK 0x00700000 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREA_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREA_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREC_MSB 25 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREC_LSB 23 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREC_MASK 0x03800000 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREC_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREC_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREB_MSB 28 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREB_LSB 26 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREB_MASK 0x1c000000 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREB_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREB_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREA_MSB 31 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREA_LSB 29 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREA_MASK 0xe0000000 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREA_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREA_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for RXTX1 */ -#define PHY_ANALOG_RXTX1_ADDRESS 0x00000100 -#define PHY_ANALOG_RXTX1_OFFSET 0x00000100 -#define PHY_ANALOG_RXTX1_SCFIR_GAIN_MSB 0 -#define PHY_ANALOG_RXTX1_SCFIR_GAIN_LSB 0 -#define PHY_ANALOG_RXTX1_SCFIR_GAIN_MASK 0x00000001 -#define PHY_ANALOG_RXTX1_SCFIR_GAIN_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXTX1_SCFIR_GAIN_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXTX1_MANRXGAIN_MSB 1 -#define PHY_ANALOG_RXTX1_MANRXGAIN_LSB 1 -#define PHY_ANALOG_RXTX1_MANRXGAIN_MASK 0x00000002 -#define PHY_ANALOG_RXTX1_MANRXGAIN_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_RXTX1_MANRXGAIN_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_RXTX1_AGC_DBDAC_MSB 5 -#define PHY_ANALOG_RXTX1_AGC_DBDAC_LSB 2 -#define PHY_ANALOG_RXTX1_AGC_DBDAC_MASK 0x0000003c -#define PHY_ANALOG_RXTX1_AGC_DBDAC_GET(x) (((x) & 0x0000003c) >> 2) -#define PHY_ANALOG_RXTX1_AGC_DBDAC_SET(x) (((x) << 2) & 0x0000003c) -#define PHY_ANALOG_RXTX1_OVR_AGC_DBDAC_MSB 6 -#define PHY_ANALOG_RXTX1_OVR_AGC_DBDAC_LSB 6 -#define PHY_ANALOG_RXTX1_OVR_AGC_DBDAC_MASK 0x00000040 -#define PHY_ANALOG_RXTX1_OVR_AGC_DBDAC_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_RXTX1_OVR_AGC_DBDAC_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_RXTX1_ENABLE_PAL_MSB 7 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_LSB 7 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_MASK 0x00000080 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RXTX1_ENABLE_PAL_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RXTX1_ENABLE_PAL_OVR_MSB 8 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_OVR_LSB 8 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_OVR_MASK 0x00000100 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_OVR_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_RXTX1_ENABLE_PAL_OVR_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_RXTX1_TX1DB_BIQUAD_MSB 11 -#define PHY_ANALOG_RXTX1_TX1DB_BIQUAD_LSB 9 -#define PHY_ANALOG_RXTX1_TX1DB_BIQUAD_MASK 0x00000e00 -#define PHY_ANALOG_RXTX1_TX1DB_BIQUAD_GET(x) (((x) & 0x00000e00) >> 9) -#define PHY_ANALOG_RXTX1_TX1DB_BIQUAD_SET(x) (((x) << 9) & 0x00000e00) -#define PHY_ANALOG_RXTX1_TX6DB_BIQUAD_MSB 13 -#define PHY_ANALOG_RXTX1_TX6DB_BIQUAD_LSB 12 -#define PHY_ANALOG_RXTX1_TX6DB_BIQUAD_MASK 0x00003000 -#define PHY_ANALOG_RXTX1_TX6DB_BIQUAD_GET(x) (((x) & 0x00003000) >> 12) -#define PHY_ANALOG_RXTX1_TX6DB_BIQUAD_SET(x) (((x) << 12) & 0x00003000) -#define PHY_ANALOG_RXTX1_PADRVHALFGN2G_MSB 14 -#define PHY_ANALOG_RXTX1_PADRVHALFGN2G_LSB 14 -#define PHY_ANALOG_RXTX1_PADRVHALFGN2G_MASK 0x00004000 -#define PHY_ANALOG_RXTX1_PADRVHALFGN2G_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_RXTX1_PADRVHALFGN2G_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_RXTX1_PADRV2GN_MSB 18 -#define PHY_ANALOG_RXTX1_PADRV2GN_LSB 15 -#define PHY_ANALOG_RXTX1_PADRV2GN_MASK 0x00078000 -#define PHY_ANALOG_RXTX1_PADRV2GN_GET(x) (((x) & 0x00078000) >> 15) -#define PHY_ANALOG_RXTX1_PADRV2GN_SET(x) (((x) << 15) & 0x00078000) -#define PHY_ANALOG_RXTX1_PADRV3GN5G_MSB 22 -#define PHY_ANALOG_RXTX1_PADRV3GN5G_LSB 19 -#define PHY_ANALOG_RXTX1_PADRV3GN5G_MASK 0x00780000 -#define PHY_ANALOG_RXTX1_PADRV3GN5G_GET(x) (((x) & 0x00780000) >> 19) -#define PHY_ANALOG_RXTX1_PADRV3GN5G_SET(x) (((x) << 19) & 0x00780000) -#define PHY_ANALOG_RXTX1_PADRV4GN5G_MSB 26 -#define PHY_ANALOG_RXTX1_PADRV4GN5G_LSB 23 -#define PHY_ANALOG_RXTX1_PADRV4GN5G_MASK 0x07800000 -#define PHY_ANALOG_RXTX1_PADRV4GN5G_GET(x) (((x) & 0x07800000) >> 23) -#define PHY_ANALOG_RXTX1_PADRV4GN5G_SET(x) (((x) << 23) & 0x07800000) -#define PHY_ANALOG_RXTX1_TXBB_GC_MSB 30 -#define PHY_ANALOG_RXTX1_TXBB_GC_LSB 27 -#define PHY_ANALOG_RXTX1_TXBB_GC_MASK 0x78000000 -#define PHY_ANALOG_RXTX1_TXBB_GC_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_ANALOG_RXTX1_TXBB_GC_SET(x) (((x) << 27) & 0x78000000) -#define PHY_ANALOG_RXTX1_MANTXGAIN_MSB 31 -#define PHY_ANALOG_RXTX1_MANTXGAIN_LSB 31 -#define PHY_ANALOG_RXTX1_MANTXGAIN_MASK 0x80000000 -#define PHY_ANALOG_RXTX1_MANTXGAIN_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_RXTX1_MANTXGAIN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for RXTX2 */ -#define PHY_ANALOG_RXTX2_ADDRESS 0x00000104 -#define PHY_ANALOG_RXTX2_OFFSET 0x00000104 -#define PHY_ANALOG_RXTX2_BMODE_MSB 0 -#define PHY_ANALOG_RXTX2_BMODE_LSB 0 -#define PHY_ANALOG_RXTX2_BMODE_MASK 0x00000001 -#define PHY_ANALOG_RXTX2_BMODE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXTX2_BMODE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXTX2_BMODE_OVR_MSB 1 -#define PHY_ANALOG_RXTX2_BMODE_OVR_LSB 1 -#define PHY_ANALOG_RXTX2_BMODE_OVR_MASK 0x00000002 -#define PHY_ANALOG_RXTX2_BMODE_OVR_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_RXTX2_BMODE_OVR_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_RXTX2_SYNTHON_MSB 2 -#define PHY_ANALOG_RXTX2_SYNTHON_LSB 2 -#define PHY_ANALOG_RXTX2_SYNTHON_MASK 0x00000004 -#define PHY_ANALOG_RXTX2_SYNTHON_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_RXTX2_SYNTHON_SET(x) (((x) << 2) & 0x00000004) -#define PHY_ANALOG_RXTX2_SYNTHON_OVR_MSB 3 -#define PHY_ANALOG_RXTX2_SYNTHON_OVR_LSB 3 -#define PHY_ANALOG_RXTX2_SYNTHON_OVR_MASK 0x00000008 -#define PHY_ANALOG_RXTX2_SYNTHON_OVR_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_RXTX2_SYNTHON_OVR_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_RXTX2_BW_ST_MSB 5 -#define PHY_ANALOG_RXTX2_BW_ST_LSB 4 -#define PHY_ANALOG_RXTX2_BW_ST_MASK 0x00000030 -#define PHY_ANALOG_RXTX2_BW_ST_GET(x) (((x) & 0x00000030) >> 4) -#define PHY_ANALOG_RXTX2_BW_ST_SET(x) (((x) << 4) & 0x00000030) -#define PHY_ANALOG_RXTX2_BW_ST_OVR_MSB 6 -#define PHY_ANALOG_RXTX2_BW_ST_OVR_LSB 6 -#define PHY_ANALOG_RXTX2_BW_ST_OVR_MASK 0x00000040 -#define PHY_ANALOG_RXTX2_BW_ST_OVR_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_RXTX2_BW_ST_OVR_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_RXTX2_TXON_MSB 7 -#define PHY_ANALOG_RXTX2_TXON_LSB 7 -#define PHY_ANALOG_RXTX2_TXON_MASK 0x00000080 -#define PHY_ANALOG_RXTX2_TXON_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RXTX2_TXON_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RXTX2_TXON_OVR_MSB 8 -#define PHY_ANALOG_RXTX2_TXON_OVR_LSB 8 -#define PHY_ANALOG_RXTX2_TXON_OVR_MASK 0x00000100 -#define PHY_ANALOG_RXTX2_TXON_OVR_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_RXTX2_TXON_OVR_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_RXTX2_PAON_MSB 9 -#define PHY_ANALOG_RXTX2_PAON_LSB 9 -#define PHY_ANALOG_RXTX2_PAON_MASK 0x00000200 -#define PHY_ANALOG_RXTX2_PAON_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_RXTX2_PAON_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_RXTX2_PAON_OVR_MSB 10 -#define PHY_ANALOG_RXTX2_PAON_OVR_LSB 10 -#define PHY_ANALOG_RXTX2_PAON_OVR_MASK 0x00000400 -#define PHY_ANALOG_RXTX2_PAON_OVR_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_RXTX2_PAON_OVR_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_RXTX2_RXON_MSB 11 -#define PHY_ANALOG_RXTX2_RXON_LSB 11 -#define PHY_ANALOG_RXTX2_RXON_MASK 0x00000800 -#define PHY_ANALOG_RXTX2_RXON_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_RXTX2_RXON_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_RXTX2_RXON_OVR_MSB 12 -#define PHY_ANALOG_RXTX2_RXON_OVR_LSB 12 -#define PHY_ANALOG_RXTX2_RXON_OVR_MASK 0x00001000 -#define PHY_ANALOG_RXTX2_RXON_OVR_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_RXTX2_RXON_OVR_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_RXTX2_AGCON_MSB 13 -#define PHY_ANALOG_RXTX2_AGCON_LSB 13 -#define PHY_ANALOG_RXTX2_AGCON_MASK 0x00002000 -#define PHY_ANALOG_RXTX2_AGCON_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_RXTX2_AGCON_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_RXTX2_AGCON_OVR_MSB 14 -#define PHY_ANALOG_RXTX2_AGCON_OVR_LSB 14 -#define PHY_ANALOG_RXTX2_AGCON_OVR_MASK 0x00004000 -#define PHY_ANALOG_RXTX2_AGCON_OVR_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_RXTX2_AGCON_OVR_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_RXTX2_TXMOD_MSB 17 -#define PHY_ANALOG_RXTX2_TXMOD_LSB 15 -#define PHY_ANALOG_RXTX2_TXMOD_MASK 0x00038000 -#define PHY_ANALOG_RXTX2_TXMOD_GET(x) (((x) & 0x00038000) >> 15) -#define PHY_ANALOG_RXTX2_TXMOD_SET(x) (((x) << 15) & 0x00038000) -#define PHY_ANALOG_RXTX2_TXMOD_OVR_MSB 18 -#define PHY_ANALOG_RXTX2_TXMOD_OVR_LSB 18 -#define PHY_ANALOG_RXTX2_TXMOD_OVR_MASK 0x00040000 -#define PHY_ANALOG_RXTX2_TXMOD_OVR_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_RXTX2_TXMOD_OVR_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_RXTX2_RX1DB_BIQUAD_MSB 21 -#define PHY_ANALOG_RXTX2_RX1DB_BIQUAD_LSB 19 -#define PHY_ANALOG_RXTX2_RX1DB_BIQUAD_MASK 0x00380000 -#define PHY_ANALOG_RXTX2_RX1DB_BIQUAD_GET(x) (((x) & 0x00380000) >> 19) -#define PHY_ANALOG_RXTX2_RX1DB_BIQUAD_SET(x) (((x) << 19) & 0x00380000) -#define PHY_ANALOG_RXTX2_RX6DB_BIQUAD_MSB 23 -#define PHY_ANALOG_RXTX2_RX6DB_BIQUAD_LSB 22 -#define PHY_ANALOG_RXTX2_RX6DB_BIQUAD_MASK 0x00c00000 -#define PHY_ANALOG_RXTX2_RX6DB_BIQUAD_GET(x) (((x) & 0x00c00000) >> 22) -#define PHY_ANALOG_RXTX2_RX6DB_BIQUAD_SET(x) (((x) << 22) & 0x00c00000) -#define PHY_ANALOG_RXTX2_MXRGAIN_MSB 25 -#define PHY_ANALOG_RXTX2_MXRGAIN_LSB 24 -#define PHY_ANALOG_RXTX2_MXRGAIN_MASK 0x03000000 -#define PHY_ANALOG_RXTX2_MXRGAIN_GET(x) (((x) & 0x03000000) >> 24) -#define PHY_ANALOG_RXTX2_MXRGAIN_SET(x) (((x) << 24) & 0x03000000) -#define PHY_ANALOG_RXTX2_VGAGAIN_MSB 28 -#define PHY_ANALOG_RXTX2_VGAGAIN_LSB 26 -#define PHY_ANALOG_RXTX2_VGAGAIN_MASK 0x1c000000 -#define PHY_ANALOG_RXTX2_VGAGAIN_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_RXTX2_VGAGAIN_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_RXTX2_LNAGAIN_MSB 31 -#define PHY_ANALOG_RXTX2_LNAGAIN_LSB 29 -#define PHY_ANALOG_RXTX2_LNAGAIN_MASK 0xe0000000 -#define PHY_ANALOG_RXTX2_LNAGAIN_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_RXTX2_LNAGAIN_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for RXTX3 */ -#define PHY_ANALOG_RXTX3_ADDRESS 0x00000108 -#define PHY_ANALOG_RXTX3_OFFSET 0x00000108 -#define PHY_ANALOG_RXTX3_SPARE3_MSB 2 -#define PHY_ANALOG_RXTX3_SPARE3_LSB 0 -#define PHY_ANALOG_RXTX3_SPARE3_MASK 0x00000007 -#define PHY_ANALOG_RXTX3_SPARE3_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_RXTX3_SPARE3_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_RXTX3_DACFULLSCALE_MSB 3 -#define PHY_ANALOG_RXTX3_DACFULLSCALE_LSB 3 -#define PHY_ANALOG_RXTX3_DACFULLSCALE_MASK 0x00000008 -#define PHY_ANALOG_RXTX3_DACFULLSCALE_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_RXTX3_DACFULLSCALE_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_RXTX3_DACRSTB_MSB 4 -#define PHY_ANALOG_RXTX3_DACRSTB_LSB 4 -#define PHY_ANALOG_RXTX3_DACRSTB_MASK 0x00000010 -#define PHY_ANALOG_RXTX3_DACRSTB_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_RXTX3_DACRSTB_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_RXTX3_ADDACLOOPBACK_MSB 5 -#define PHY_ANALOG_RXTX3_ADDACLOOPBACK_LSB 5 -#define PHY_ANALOG_RXTX3_ADDACLOOPBACK_MASK 0x00000020 -#define PHY_ANALOG_RXTX3_ADDACLOOPBACK_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_RXTX3_ADDACLOOPBACK_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_RXTX3_ADCSHORT_MSB 6 -#define PHY_ANALOG_RXTX3_ADCSHORT_LSB 6 -#define PHY_ANALOG_RXTX3_ADCSHORT_MASK 0x00000040 -#define PHY_ANALOG_RXTX3_ADCSHORT_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_RXTX3_ADCSHORT_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_RXTX3_DACPWD_MSB 7 -#define PHY_ANALOG_RXTX3_DACPWD_LSB 7 -#define PHY_ANALOG_RXTX3_DACPWD_MASK 0x00000080 -#define PHY_ANALOG_RXTX3_DACPWD_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RXTX3_DACPWD_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RXTX3_DACPWD_OVR_MSB 8 -#define PHY_ANALOG_RXTX3_DACPWD_OVR_LSB 8 -#define PHY_ANALOG_RXTX3_DACPWD_OVR_MASK 0x00000100 -#define PHY_ANALOG_RXTX3_DACPWD_OVR_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_RXTX3_DACPWD_OVR_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_RXTX3_ADCPWD_MSB 9 -#define PHY_ANALOG_RXTX3_ADCPWD_LSB 9 -#define PHY_ANALOG_RXTX3_ADCPWD_MASK 0x00000200 -#define PHY_ANALOG_RXTX3_ADCPWD_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_RXTX3_ADCPWD_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_RXTX3_ADCPWD_OVR_MSB 10 -#define PHY_ANALOG_RXTX3_ADCPWD_OVR_LSB 10 -#define PHY_ANALOG_RXTX3_ADCPWD_OVR_MASK 0x00000400 -#define PHY_ANALOG_RXTX3_ADCPWD_OVR_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_RXTX3_ADCPWD_OVR_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_RXTX3_AGC_CALDAC_MSB 16 -#define PHY_ANALOG_RXTX3_AGC_CALDAC_LSB 11 -#define PHY_ANALOG_RXTX3_AGC_CALDAC_MASK 0x0001f800 -#define PHY_ANALOG_RXTX3_AGC_CALDAC_GET(x) (((x) & 0x0001f800) >> 11) -#define PHY_ANALOG_RXTX3_AGC_CALDAC_SET(x) (((x) << 11) & 0x0001f800) -#define PHY_ANALOG_RXTX3_AGC_CAL_MSB 17 -#define PHY_ANALOG_RXTX3_AGC_CAL_LSB 17 -#define PHY_ANALOG_RXTX3_AGC_CAL_MASK 0x00020000 -#define PHY_ANALOG_RXTX3_AGC_CAL_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_RXTX3_AGC_CAL_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_RXTX3_AGC_CAL_OVR_MSB 18 -#define PHY_ANALOG_RXTX3_AGC_CAL_OVR_LSB 18 -#define PHY_ANALOG_RXTX3_AGC_CAL_OVR_MASK 0x00040000 -#define PHY_ANALOG_RXTX3_AGC_CAL_OVR_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_RXTX3_AGC_CAL_OVR_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_RXTX3_LOFORCEDON_MSB 19 -#define PHY_ANALOG_RXTX3_LOFORCEDON_LSB 19 -#define PHY_ANALOG_RXTX3_LOFORCEDON_MASK 0x00080000 -#define PHY_ANALOG_RXTX3_LOFORCEDON_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_ANALOG_RXTX3_LOFORCEDON_SET(x) (((x) << 19) & 0x00080000) -#define PHY_ANALOG_RXTX3_CALRESIDUE_MSB 20 -#define PHY_ANALOG_RXTX3_CALRESIDUE_LSB 20 -#define PHY_ANALOG_RXTX3_CALRESIDUE_MASK 0x00100000 -#define PHY_ANALOG_RXTX3_CALRESIDUE_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_RXTX3_CALRESIDUE_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_RXTX3_CALRESIDUE_OVR_MSB 21 -#define PHY_ANALOG_RXTX3_CALRESIDUE_OVR_LSB 21 -#define PHY_ANALOG_RXTX3_CALRESIDUE_OVR_MASK 0x00200000 -#define PHY_ANALOG_RXTX3_CALRESIDUE_OVR_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_RXTX3_CALRESIDUE_OVR_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_RXTX3_CALFC_MSB 22 -#define PHY_ANALOG_RXTX3_CALFC_LSB 22 -#define PHY_ANALOG_RXTX3_CALFC_MASK 0x00400000 -#define PHY_ANALOG_RXTX3_CALFC_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_RXTX3_CALFC_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_RXTX3_CALFC_OVR_MSB 23 -#define PHY_ANALOG_RXTX3_CALFC_OVR_LSB 23 -#define PHY_ANALOG_RXTX3_CALFC_OVR_MASK 0x00800000 -#define PHY_ANALOG_RXTX3_CALFC_OVR_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_RXTX3_CALFC_OVR_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_RXTX3_CALTX_MSB 24 -#define PHY_ANALOG_RXTX3_CALTX_LSB 24 -#define PHY_ANALOG_RXTX3_CALTX_MASK 0x01000000 -#define PHY_ANALOG_RXTX3_CALTX_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_ANALOG_RXTX3_CALTX_SET(x) (((x) << 24) & 0x01000000) -#define PHY_ANALOG_RXTX3_CALTX_OVR_MSB 25 -#define PHY_ANALOG_RXTX3_CALTX_OVR_LSB 25 -#define PHY_ANALOG_RXTX3_CALTX_OVR_MASK 0x02000000 -#define PHY_ANALOG_RXTX3_CALTX_OVR_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_ANALOG_RXTX3_CALTX_OVR_SET(x) (((x) << 25) & 0x02000000) -#define PHY_ANALOG_RXTX3_CALTXSHIFT_MSB 26 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_LSB 26 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_MASK 0x04000000 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_RXTX3_CALTXSHIFT_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_RXTX3_CALTXSHIFT_OVR_MSB 27 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_OVR_LSB 27 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_OVR_MASK 0x08000000 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_OVR_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_RXTX3_CALTXSHIFT_OVR_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_RXTX3_CALPA_MSB 28 -#define PHY_ANALOG_RXTX3_CALPA_LSB 28 -#define PHY_ANALOG_RXTX3_CALPA_MASK 0x10000000 -#define PHY_ANALOG_RXTX3_CALPA_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_RXTX3_CALPA_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_RXTX3_CALPA_OVR_MSB 29 -#define PHY_ANALOG_RXTX3_CALPA_OVR_LSB 29 -#define PHY_ANALOG_RXTX3_CALPA_OVR_MASK 0x20000000 -#define PHY_ANALOG_RXTX3_CALPA_OVR_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_RXTX3_CALPA_OVR_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_RXTX3_SPURON_MSB 30 -#define PHY_ANALOG_RXTX3_SPURON_LSB 30 -#define PHY_ANALOG_RXTX3_SPURON_MASK 0x40000000 -#define PHY_ANALOG_RXTX3_SPURON_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_RXTX3_SPURON_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_RXTX3_SPURON_OVR_MSB 31 -#define PHY_ANALOG_RXTX3_SPURON_OVR_LSB 31 -#define PHY_ANALOG_RXTX3_SPURON_OVR_MASK 0x80000000 -#define PHY_ANALOG_RXTX3_SPURON_OVR_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_RXTX3_SPURON_OVR_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB1 */ -#define PHY_ANALOG_BB1_ADDRESS 0x00000140 -#define PHY_ANALOG_BB1_OFFSET 0x00000140 -#define PHY_ANALOG_BB1_I2V_CURR2X_MSB 0 -#define PHY_ANALOG_BB1_I2V_CURR2X_LSB 0 -#define PHY_ANALOG_BB1_I2V_CURR2X_MASK 0x00000001 -#define PHY_ANALOG_BB1_I2V_CURR2X_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_BB1_I2V_CURR2X_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_BB1_ENABLE_LOQ_MSB 1 -#define PHY_ANALOG_BB1_ENABLE_LOQ_LSB 1 -#define PHY_ANALOG_BB1_ENABLE_LOQ_MASK 0x00000002 -#define PHY_ANALOG_BB1_ENABLE_LOQ_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_BB1_ENABLE_LOQ_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_BB1_FORCE_LOQ_MSB 2 -#define PHY_ANALOG_BB1_FORCE_LOQ_LSB 2 -#define PHY_ANALOG_BB1_FORCE_LOQ_MASK 0x00000004 -#define PHY_ANALOG_BB1_FORCE_LOQ_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_BB1_FORCE_LOQ_SET(x) (((x) << 2) & 0x00000004) -#define PHY_ANALOG_BB1_ENABLE_NOTCH_MSB 3 -#define PHY_ANALOG_BB1_ENABLE_NOTCH_LSB 3 -#define PHY_ANALOG_BB1_ENABLE_NOTCH_MASK 0x00000008 -#define PHY_ANALOG_BB1_ENABLE_NOTCH_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_BB1_ENABLE_NOTCH_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_BB1_FORCE_NOTCH_MSB 4 -#define PHY_ANALOG_BB1_FORCE_NOTCH_LSB 4 -#define PHY_ANALOG_BB1_FORCE_NOTCH_MASK 0x00000010 -#define PHY_ANALOG_BB1_FORCE_NOTCH_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_BB1_FORCE_NOTCH_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_BB1_ENABLE_BIQUAD_MSB 5 -#define PHY_ANALOG_BB1_ENABLE_BIQUAD_LSB 5 -#define PHY_ANALOG_BB1_ENABLE_BIQUAD_MASK 0x00000020 -#define PHY_ANALOG_BB1_ENABLE_BIQUAD_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_BB1_ENABLE_BIQUAD_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_BB1_FORCE_BIQUAD_MSB 6 -#define PHY_ANALOG_BB1_FORCE_BIQUAD_LSB 6 -#define PHY_ANALOG_BB1_FORCE_BIQUAD_MASK 0x00000040 -#define PHY_ANALOG_BB1_FORCE_BIQUAD_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_BB1_FORCE_BIQUAD_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_BB1_ENABLE_OSDAC_MSB 7 -#define PHY_ANALOG_BB1_ENABLE_OSDAC_LSB 7 -#define PHY_ANALOG_BB1_ENABLE_OSDAC_MASK 0x00000080 -#define PHY_ANALOG_BB1_ENABLE_OSDAC_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_BB1_ENABLE_OSDAC_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_BB1_FORCE_OSDAC_MSB 8 -#define PHY_ANALOG_BB1_FORCE_OSDAC_LSB 8 -#define PHY_ANALOG_BB1_FORCE_OSDAC_MASK 0x00000100 -#define PHY_ANALOG_BB1_FORCE_OSDAC_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_BB1_FORCE_OSDAC_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_BB1_ENABLE_V2I_MSB 9 -#define PHY_ANALOG_BB1_ENABLE_V2I_LSB 9 -#define PHY_ANALOG_BB1_ENABLE_V2I_MASK 0x00000200 -#define PHY_ANALOG_BB1_ENABLE_V2I_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_BB1_ENABLE_V2I_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_BB1_FORCE_V2I_MSB 10 -#define PHY_ANALOG_BB1_FORCE_V2I_LSB 10 -#define PHY_ANALOG_BB1_FORCE_V2I_MASK 0x00000400 -#define PHY_ANALOG_BB1_FORCE_V2I_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_BB1_FORCE_V2I_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_BB1_ENABLE_I2V_MSB 11 -#define PHY_ANALOG_BB1_ENABLE_I2V_LSB 11 -#define PHY_ANALOG_BB1_ENABLE_I2V_MASK 0x00000800 -#define PHY_ANALOG_BB1_ENABLE_I2V_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_BB1_ENABLE_I2V_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_BB1_FORCE_I2V_MSB 12 -#define PHY_ANALOG_BB1_FORCE_I2V_LSB 12 -#define PHY_ANALOG_BB1_FORCE_I2V_MASK 0x00001000 -#define PHY_ANALOG_BB1_FORCE_I2V_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_BB1_FORCE_I2V_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_BB1_CMSEL_MSB 15 -#define PHY_ANALOG_BB1_CMSEL_LSB 13 -#define PHY_ANALOG_BB1_CMSEL_MASK 0x0000e000 -#define PHY_ANALOG_BB1_CMSEL_GET(x) (((x) & 0x0000e000) >> 13) -#define PHY_ANALOG_BB1_CMSEL_SET(x) (((x) << 13) & 0x0000e000) -#define PHY_ANALOG_BB1_ATBSEL_MSB 17 -#define PHY_ANALOG_BB1_ATBSEL_LSB 16 -#define PHY_ANALOG_BB1_ATBSEL_MASK 0x00030000 -#define PHY_ANALOG_BB1_ATBSEL_GET(x) (((x) & 0x00030000) >> 16) -#define PHY_ANALOG_BB1_ATBSEL_SET(x) (((x) << 16) & 0x00030000) -#define PHY_ANALOG_BB1_PD_OSDAC_CALTX_CALPA_MSB 18 -#define PHY_ANALOG_BB1_PD_OSDAC_CALTX_CALPA_LSB 18 -#define PHY_ANALOG_BB1_PD_OSDAC_CALTX_CALPA_MASK 0x00040000 -#define PHY_ANALOG_BB1_PD_OSDAC_CALTX_CALPA_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_BB1_PD_OSDAC_CALTX_CALPA_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_BB1_OFSTCORRI2VQ_MSB 23 -#define PHY_ANALOG_BB1_OFSTCORRI2VQ_LSB 19 -#define PHY_ANALOG_BB1_OFSTCORRI2VQ_MASK 0x00f80000 -#define PHY_ANALOG_BB1_OFSTCORRI2VQ_GET(x) (((x) & 0x00f80000) >> 19) -#define PHY_ANALOG_BB1_OFSTCORRI2VQ_SET(x) (((x) << 19) & 0x00f80000) -#define PHY_ANALOG_BB1_OFSTCORRI2VI_MSB 28 -#define PHY_ANALOG_BB1_OFSTCORRI2VI_LSB 24 -#define PHY_ANALOG_BB1_OFSTCORRI2VI_MASK 0x1f000000 -#define PHY_ANALOG_BB1_OFSTCORRI2VI_GET(x) (((x) & 0x1f000000) >> 24) -#define PHY_ANALOG_BB1_OFSTCORRI2VI_SET(x) (((x) << 24) & 0x1f000000) -#define PHY_ANALOG_BB1_LOCALOFFSET_MSB 29 -#define PHY_ANALOG_BB1_LOCALOFFSET_LSB 29 -#define PHY_ANALOG_BB1_LOCALOFFSET_MASK 0x20000000 -#define PHY_ANALOG_BB1_LOCALOFFSET_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_BB1_LOCALOFFSET_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_BB1_RANGE_OSDAC_MSB 31 -#define PHY_ANALOG_BB1_RANGE_OSDAC_LSB 30 -#define PHY_ANALOG_BB1_RANGE_OSDAC_MASK 0xc0000000 -#define PHY_ANALOG_BB1_RANGE_OSDAC_GET(x) (((x) & 0xc0000000) >> 30) -#define PHY_ANALOG_BB1_RANGE_OSDAC_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for BB2 */ -#define PHY_ANALOG_BB2_ADDRESS 0x00000144 -#define PHY_ANALOG_BB2_OFFSET 0x00000144 -#define PHY_ANALOG_BB2_SPARE_MSB 6 -#define PHY_ANALOG_BB2_SPARE_LSB 0 -#define PHY_ANALOG_BB2_SPARE_MASK 0x0000007f -#define PHY_ANALOG_BB2_SPARE_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_ANALOG_BB2_SPARE_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_ANALOG_BB2_SEL_TEST_MSB 9 -#define PHY_ANALOG_BB2_SEL_TEST_LSB 7 -#define PHY_ANALOG_BB2_SEL_TEST_MASK 0x00000380 -#define PHY_ANALOG_BB2_SEL_TEST_GET(x) (((x) & 0x00000380) >> 7) -#define PHY_ANALOG_BB2_SEL_TEST_SET(x) (((x) << 7) & 0x00000380) -#define PHY_ANALOG_BB2_SCFIR_CAP_MSB 14 -#define PHY_ANALOG_BB2_SCFIR_CAP_LSB 10 -#define PHY_ANALOG_BB2_SCFIR_CAP_MASK 0x00007c00 -#define PHY_ANALOG_BB2_SCFIR_CAP_GET(x) (((x) & 0x00007c00) >> 10) -#define PHY_ANALOG_BB2_SCFIR_CAP_SET(x) (((x) << 10) & 0x00007c00) -#define PHY_ANALOG_BB2_OVERRIDE_SCFIR_CAP_MSB 15 -#define PHY_ANALOG_BB2_OVERRIDE_SCFIR_CAP_LSB 15 -#define PHY_ANALOG_BB2_OVERRIDE_SCFIR_CAP_MASK 0x00008000 -#define PHY_ANALOG_BB2_OVERRIDE_SCFIR_CAP_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_BB2_OVERRIDE_SCFIR_CAP_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_BB2_FNOTCH_MSB 19 -#define PHY_ANALOG_BB2_FNOTCH_LSB 16 -#define PHY_ANALOG_BB2_FNOTCH_MASK 0x000f0000 -#define PHY_ANALOG_BB2_FNOTCH_GET(x) (((x) & 0x000f0000) >> 16) -#define PHY_ANALOG_BB2_FNOTCH_SET(x) (((x) << 16) & 0x000f0000) -#define PHY_ANALOG_BB2_OVERRIDE_FNOTCH_MSB 20 -#define PHY_ANALOG_BB2_OVERRIDE_FNOTCH_LSB 20 -#define PHY_ANALOG_BB2_OVERRIDE_FNOTCH_MASK 0x00100000 -#define PHY_ANALOG_BB2_OVERRIDE_FNOTCH_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_BB2_OVERRIDE_FNOTCH_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_BB2_FILTERFC_MSB 25 -#define PHY_ANALOG_BB2_FILTERFC_LSB 21 -#define PHY_ANALOG_BB2_FILTERFC_MASK 0x03e00000 -#define PHY_ANALOG_BB2_FILTERFC_GET(x) (((x) & 0x03e00000) >> 21) -#define PHY_ANALOG_BB2_FILTERFC_SET(x) (((x) << 21) & 0x03e00000) -#define PHY_ANALOG_BB2_OVERRIDE_FILTERFC_MSB 26 -#define PHY_ANALOG_BB2_OVERRIDE_FILTERFC_LSB 26 -#define PHY_ANALOG_BB2_OVERRIDE_FILTERFC_MASK 0x04000000 -#define PHY_ANALOG_BB2_OVERRIDE_FILTERFC_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_BB2_OVERRIDE_FILTERFC_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_BB2_I2V2RXOUT_EN_MSB 27 -#define PHY_ANALOG_BB2_I2V2RXOUT_EN_LSB 27 -#define PHY_ANALOG_BB2_I2V2RXOUT_EN_MASK 0x08000000 -#define PHY_ANALOG_BB2_I2V2RXOUT_EN_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_BB2_I2V2RXOUT_EN_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_BB2_BQ2RXOUT_EN_MSB 28 -#define PHY_ANALOG_BB2_BQ2RXOUT_EN_LSB 28 -#define PHY_ANALOG_BB2_BQ2RXOUT_EN_MASK 0x10000000 -#define PHY_ANALOG_BB2_BQ2RXOUT_EN_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_BB2_BQ2RXOUT_EN_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_BB2_RXIN2I2V_EN_MSB 29 -#define PHY_ANALOG_BB2_RXIN2I2V_EN_LSB 29 -#define PHY_ANALOG_BB2_RXIN2I2V_EN_MASK 0x20000000 -#define PHY_ANALOG_BB2_RXIN2I2V_EN_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_BB2_RXIN2I2V_EN_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_BB2_RXIN2BQ_EN_MSB 30 -#define PHY_ANALOG_BB2_RXIN2BQ_EN_LSB 30 -#define PHY_ANALOG_BB2_RXIN2BQ_EN_MASK 0x40000000 -#define PHY_ANALOG_BB2_RXIN2BQ_EN_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_BB2_RXIN2BQ_EN_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_BB2_SWITCH_OVERRIDE_MSB 31 -#define PHY_ANALOG_BB2_SWITCH_OVERRIDE_LSB 31 -#define PHY_ANALOG_BB2_SWITCH_OVERRIDE_MASK 0x80000000 -#define PHY_ANALOG_BB2_SWITCH_OVERRIDE_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_BB2_SWITCH_OVERRIDE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for TOP1 */ -#define PHY_ANALOG_TOP1_ADDRESS 0x00000280 -#define PHY_ANALOG_TOP1_OFFSET 0x00000280 -#define PHY_ANALOG_TOP1_SEL_KVCO_MSB 1 -#define PHY_ANALOG_TOP1_SEL_KVCO_LSB 0 -#define PHY_ANALOG_TOP1_SEL_KVCO_MASK 0x00000003 -#define PHY_ANALOG_TOP1_SEL_KVCO_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TOP1_SEL_KVCO_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TOP1_PLLATB_MSB 3 -#define PHY_ANALOG_TOP1_PLLATB_LSB 2 -#define PHY_ANALOG_TOP1_PLLATB_MASK 0x0000000c -#define PHY_ANALOG_TOP1_PLLATB_GET(x) (((x) & 0x0000000c) >> 2) -#define PHY_ANALOG_TOP1_PLLATB_SET(x) (((x) << 2) & 0x0000000c) -#define PHY_ANALOG_TOP1_PLL_SVREG_MSB 4 -#define PHY_ANALOG_TOP1_PLL_SVREG_LSB 4 -#define PHY_ANALOG_TOP1_PLL_SVREG_MASK 0x00000010 -#define PHY_ANALOG_TOP1_PLL_SVREG_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_TOP1_PLL_SVREG_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_TOP1_HI_FREQ_EN_MSB 5 -#define PHY_ANALOG_TOP1_HI_FREQ_EN_LSB 5 -#define PHY_ANALOG_TOP1_HI_FREQ_EN_MASK 0x00000020 -#define PHY_ANALOG_TOP1_HI_FREQ_EN_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_TOP1_HI_FREQ_EN_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_TOP1_PWDPLL_MSB 6 -#define PHY_ANALOG_TOP1_PWDPLL_LSB 6 -#define PHY_ANALOG_TOP1_PWDPLL_MASK 0x00000040 -#define PHY_ANALOG_TOP1_PWDPLL_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_TOP1_PWDPLL_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_TOP1_PWDEXTCLKBUF_MSB 7 -#define PHY_ANALOG_TOP1_PWDEXTCLKBUF_LSB 7 -#define PHY_ANALOG_TOP1_PWDEXTCLKBUF_MASK 0x00000080 -#define PHY_ANALOG_TOP1_PWDEXTCLKBUF_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_TOP1_PWDEXTCLKBUF_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_TOP1_ADCPWD_PHASE_MSB 9 -#define PHY_ANALOG_TOP1_ADCPWD_PHASE_LSB 8 -#define PHY_ANALOG_TOP1_ADCPWD_PHASE_MASK 0x00000300 -#define PHY_ANALOG_TOP1_ADCPWD_PHASE_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_ANALOG_TOP1_ADCPWD_PHASE_SET(x) (((x) << 8) & 0x00000300) -#define PHY_ANALOG_TOP1_ADCCLK_PHASE_MSB 11 -#define PHY_ANALOG_TOP1_ADCCLK_PHASE_LSB 10 -#define PHY_ANALOG_TOP1_ADCCLK_PHASE_MASK 0x00000c00 -#define PHY_ANALOG_TOP1_ADCCLK_PHASE_GET(x) (((x) & 0x00000c00) >> 10) -#define PHY_ANALOG_TOP1_ADCCLK_PHASE_SET(x) (((x) << 10) & 0x00000c00) -#define PHY_ANALOG_TOP1_DAC_CLK_SEL_MSB 13 -#define PHY_ANALOG_TOP1_DAC_CLK_SEL_LSB 12 -#define PHY_ANALOG_TOP1_DAC_CLK_SEL_MASK 0x00003000 -#define PHY_ANALOG_TOP1_DAC_CLK_SEL_GET(x) (((x) & 0x00003000) >> 12) -#define PHY_ANALOG_TOP1_DAC_CLK_SEL_SET(x) (((x) << 12) & 0x00003000) -#define PHY_ANALOG_TOP1_ADC_CLK_SEL_MSB 15 -#define PHY_ANALOG_TOP1_ADC_CLK_SEL_LSB 14 -#define PHY_ANALOG_TOP1_ADC_CLK_SEL_MASK 0x0000c000 -#define PHY_ANALOG_TOP1_ADC_CLK_SEL_GET(x) (((x) & 0x0000c000) >> 14) -#define PHY_ANALOG_TOP1_ADC_CLK_SEL_SET(x) (((x) << 14) & 0x0000c000) -#define PHY_ANALOG_TOP1_REFDIV_MSB 19 -#define PHY_ANALOG_TOP1_REFDIV_LSB 16 -#define PHY_ANALOG_TOP1_REFDIV_MASK 0x000f0000 -#define PHY_ANALOG_TOP1_REFDIV_GET(x) (((x) & 0x000f0000) >> 16) -#define PHY_ANALOG_TOP1_REFDIV_SET(x) (((x) << 16) & 0x000f0000) -#define PHY_ANALOG_TOP1_DIV_MSB 29 -#define PHY_ANALOG_TOP1_DIV_LSB 20 -#define PHY_ANALOG_TOP1_DIV_MASK 0x3ff00000 -#define PHY_ANALOG_TOP1_DIV_GET(x) (((x) & 0x3ff00000) >> 20) -#define PHY_ANALOG_TOP1_DIV_SET(x) (((x) << 20) & 0x3ff00000) -#define PHY_ANALOG_TOP1_PLLBYPASS_MSB 30 -#define PHY_ANALOG_TOP1_PLLBYPASS_LSB 30 -#define PHY_ANALOG_TOP1_PLLBYPASS_MASK 0x40000000 -#define PHY_ANALOG_TOP1_PLLBYPASS_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_TOP1_PLLBYPASS_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_TOP1_CLKMOD_RSTB_MSB 31 -#define PHY_ANALOG_TOP1_CLKMOD_RSTB_LSB 31 -#define PHY_ANALOG_TOP1_CLKMOD_RSTB_MASK 0x80000000 -#define PHY_ANALOG_TOP1_CLKMOD_RSTB_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_TOP1_CLKMOD_RSTB_SET(x) (((x) << 31) & 0x80000000) - -/* macros for TOP2 */ -#define PHY_ANALOG_TOP2_ADDRESS 0x00000284 -#define PHY_ANALOG_TOP2_OFFSET 0x00000284 -#define PHY_ANALOG_TOP2_PLL_LOWLEAK_MSB 0 -#define PHY_ANALOG_TOP2_PLL_LOWLEAK_LSB 0 -#define PHY_ANALOG_TOP2_PLL_LOWLEAK_MASK 0x00000001 -#define PHY_ANALOG_TOP2_PLL_LOWLEAK_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_TOP2_PLL_LOWLEAK_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_TOP2_PLL_LEAK_MSB 4 -#define PHY_ANALOG_TOP2_PLL_LEAK_LSB 1 -#define PHY_ANALOG_TOP2_PLL_LEAK_MASK 0x0000001e -#define PHY_ANALOG_TOP2_PLL_LEAK_GET(x) (((x) & 0x0000001e) >> 1) -#define PHY_ANALOG_TOP2_PLL_LEAK_SET(x) (((x) << 1) & 0x0000001e) -#define PHY_ANALOG_TOP2_PLLFRAC_MSB 19 -#define PHY_ANALOG_TOP2_PLLFRAC_LSB 5 -#define PHY_ANALOG_TOP2_PLLFRAC_MASK 0x000fffe0 -#define PHY_ANALOG_TOP2_PLLFRAC_GET(x) (((x) & 0x000fffe0) >> 5) -#define PHY_ANALOG_TOP2_PLLFRAC_SET(x) (((x) << 5) & 0x000fffe0) -#define PHY_ANALOG_TOP2_PWD_PLLSDM_MSB 20 -#define PHY_ANALOG_TOP2_PWD_PLLSDM_LSB 20 -#define PHY_ANALOG_TOP2_PWD_PLLSDM_MASK 0x00100000 -#define PHY_ANALOG_TOP2_PWD_PLLSDM_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_TOP2_PWD_PLLSDM_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_TOP2_PLLICP_MSB 23 -#define PHY_ANALOG_TOP2_PLLICP_LSB 21 -#define PHY_ANALOG_TOP2_PLLICP_MASK 0x00e00000 -#define PHY_ANALOG_TOP2_PLLICP_GET(x) (((x) & 0x00e00000) >> 21) -#define PHY_ANALOG_TOP2_PLLICP_SET(x) (((x) << 21) & 0x00e00000) -#define PHY_ANALOG_TOP2_PLLFILTER_MSB 31 -#define PHY_ANALOG_TOP2_PLLFILTER_LSB 24 -#define PHY_ANALOG_TOP2_PLLFILTER_MASK 0xff000000 -#define PHY_ANALOG_TOP2_PLLFILTER_GET(x) (((x) & 0xff000000) >> 24) -#define PHY_ANALOG_TOP2_PLLFILTER_SET(x) (((x) << 24) & 0xff000000) - -/* macros for TOP3 */ -#define PHY_ANALOG_TOP3_ADDRESS 0x00000288 -#define PHY_ANALOG_TOP3_OFFSET 0x00000288 -#define PHY_ANALOG_TOP3_INT2GND_MSB 0 -#define PHY_ANALOG_TOP3_INT2GND_LSB 0 -#define PHY_ANALOG_TOP3_INT2GND_MASK 0x00000001 -#define PHY_ANALOG_TOP3_INT2GND_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_TOP3_INT2GND_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_TOP3_PWDPALCLK_MSB 1 -#define PHY_ANALOG_TOP3_PWDPALCLK_LSB 1 -#define PHY_ANALOG_TOP3_PWDPALCLK_MASK 0x00000002 -#define PHY_ANALOG_TOP3_PWDPALCLK_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_TOP3_PWDPALCLK_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_TOP3_PWDAGCCLK_MSB 2 -#define PHY_ANALOG_TOP3_PWDAGCCLK_LSB 2 -#define PHY_ANALOG_TOP3_PWDAGCCLK_MASK 0x00000004 -#define PHY_ANALOG_TOP3_PWDAGCCLK_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_TOP3_PWDAGCCLK_SET(x) (((x) << 2) & 0x00000004) -#define PHY_ANALOG_TOP3_PWDV2I_MSB 3 -#define PHY_ANALOG_TOP3_PWDV2I_LSB 3 -#define PHY_ANALOG_TOP3_PWDV2I_MASK 0x00000008 -#define PHY_ANALOG_TOP3_PWDV2I_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_TOP3_PWDV2I_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_TOP3_PWDBIAS_MSB 4 -#define PHY_ANALOG_TOP3_PWDBIAS_LSB 4 -#define PHY_ANALOG_TOP3_PWDBIAS_MASK 0x00000010 -#define PHY_ANALOG_TOP3_PWDBIAS_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_TOP3_PWDBIAS_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_TOP3_PWDBG_MSB 5 -#define PHY_ANALOG_TOP3_PWDBG_LSB 5 -#define PHY_ANALOG_TOP3_PWDBG_MASK 0x00000020 -#define PHY_ANALOG_TOP3_PWDBG_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_TOP3_PWDBG_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_TOP3_XTAL_SELVREG_MSB 6 -#define PHY_ANALOG_TOP3_XTAL_SELVREG_LSB 6 -#define PHY_ANALOG_TOP3_XTAL_SELVREG_MASK 0x00000040 -#define PHY_ANALOG_TOP3_XTAL_SELVREG_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_TOP3_XTAL_SELVREG_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_TOP3_XTAL_PWDREG_MSB 7 -#define PHY_ANALOG_TOP3_XTAL_PWDREG_LSB 7 -#define PHY_ANALOG_TOP3_XTAL_PWDREG_MASK 0x00000080 -#define PHY_ANALOG_TOP3_XTAL_PWDREG_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_TOP3_XTAL_PWDREG_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_TOP3_XTAL_PWDCLKIN_MSB 8 -#define PHY_ANALOG_TOP3_XTAL_PWDCLKIN_LSB 8 -#define PHY_ANALOG_TOP3_XTAL_PWDCLKIN_MASK 0x00000100 -#define PHY_ANALOG_TOP3_XTAL_PWDCLKIN_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_TOP3_XTAL_PWDCLKIN_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_TOP3_XTAL_PWDCLKD_MSB 9 -#define PHY_ANALOG_TOP3_XTAL_PWDCLKD_LSB 9 -#define PHY_ANALOG_TOP3_XTAL_PWDCLKD_MASK 0x00000200 -#define PHY_ANALOG_TOP3_XTAL_PWDCLKD_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_TOP3_XTAL_PWDCLKD_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_TOP3_XTAL_OSCON_MSB 10 -#define PHY_ANALOG_TOP3_XTAL_OSCON_LSB 10 -#define PHY_ANALOG_TOP3_XTAL_OSCON_MASK 0x00000400 -#define PHY_ANALOG_TOP3_XTAL_OSCON_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_TOP3_XTAL_OSCON_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_TOP3_XTAL_NOTCXODET_MSB 11 -#define PHY_ANALOG_TOP3_XTAL_NOTCXODET_LSB 11 -#define PHY_ANALOG_TOP3_XTAL_NOTCXODET_MASK 0x00000800 -#define PHY_ANALOG_TOP3_XTAL_NOTCXODET_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_TOP3_XTAL_NOTCXODET_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_TOP3_XTAL_LOCALBIAS_MSB 12 -#define PHY_ANALOG_TOP3_XTAL_LOCALBIAS_LSB 12 -#define PHY_ANALOG_TOP3_XTAL_LOCALBIAS_MASK 0x00001000 -#define PHY_ANALOG_TOP3_XTAL_LOCALBIAS_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_TOP3_XTAL_LOCALBIAS_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_TOP3_XTAL_HIGHZ_MSB 13 -#define PHY_ANALOG_TOP3_XTAL_HIGHZ_LSB 13 -#define PHY_ANALOG_TOP3_XTAL_HIGHZ_MASK 0x00002000 -#define PHY_ANALOG_TOP3_XTAL_HIGHZ_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_TOP3_XTAL_HIGHZ_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_TOP3_XTAL_DRVPNR_MSB 15 -#define PHY_ANALOG_TOP3_XTAL_DRVPNR_LSB 14 -#define PHY_ANALOG_TOP3_XTAL_DRVPNR_MASK 0x0000c000 -#define PHY_ANALOG_TOP3_XTAL_DRVPNR_GET(x) (((x) & 0x0000c000) >> 14) -#define PHY_ANALOG_TOP3_XTAL_DRVPNR_SET(x) (((x) << 14) & 0x0000c000) -#define PHY_ANALOG_TOP3_XTALCAPOUTDAC_MSB 22 -#define PHY_ANALOG_TOP3_XTALCAPOUTDAC_LSB 16 -#define PHY_ANALOG_TOP3_XTALCAPOUTDAC_MASK 0x007f0000 -#define PHY_ANALOG_TOP3_XTALCAPOUTDAC_GET(x) (((x) & 0x007f0000) >> 16) -#define PHY_ANALOG_TOP3_XTALCAPOUTDAC_SET(x) (((x) << 16) & 0x007f0000) -#define PHY_ANALOG_TOP3_XTAL_CAPINDAC_MSB 29 -#define PHY_ANALOG_TOP3_XTAL_CAPINDAC_LSB 23 -#define PHY_ANALOG_TOP3_XTAL_CAPINDAC_MASK 0x3f800000 -#define PHY_ANALOG_TOP3_XTAL_CAPINDAC_GET(x) (((x) & 0x3f800000) >> 23) -#define PHY_ANALOG_TOP3_XTAL_CAPINDAC_SET(x) (((x) << 23) & 0x3f800000) -#define PHY_ANALOG_TOP3_XTAL_BIAS2X_MSB 30 -#define PHY_ANALOG_TOP3_XTAL_BIAS2X_LSB 30 -#define PHY_ANALOG_TOP3_XTAL_BIAS2X_MASK 0x40000000 -#define PHY_ANALOG_TOP3_XTAL_BIAS2X_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_TOP3_XTAL_BIAS2X_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_TOP3_TCXODET_MSB 31 -#define PHY_ANALOG_TOP3_TCXODET_LSB 31 -#define PHY_ANALOG_TOP3_TCXODET_MASK 0x80000000 -#define PHY_ANALOG_TOP3_TCXODET_GET(x) (((x) & 0x80000000) >> 31) - -/* macros for TOP4 */ -#define PHY_ANALOG_TOP4_ADDRESS 0x0000028c -#define PHY_ANALOG_TOP4_OFFSET 0x0000028c -#define PHY_ANALOG_TOP4_SPARE4_MSB 19 -#define PHY_ANALOG_TOP4_SPARE4_LSB 0 -#define PHY_ANALOG_TOP4_SPARE4_MASK 0x000fffff -#define PHY_ANALOG_TOP4_SPARE4_GET(x) (((x) & 0x000fffff) >> 0) -#define PHY_ANALOG_TOP4_SPARE4_SET(x) (((x) << 0) & 0x000fffff) -#define PHY_ANALOG_TOP4_SEL_TEMPSENSOR_MSB 20 -#define PHY_ANALOG_TOP4_SEL_TEMPSENSOR_LSB 20 -#define PHY_ANALOG_TOP4_SEL_TEMPSENSOR_MASK 0x00100000 -#define PHY_ANALOG_TOP4_SEL_TEMPSENSOR_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_TOP4_SEL_TEMPSENSOR_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_TOP4_ADCPWD_OVR_MSB 21 -#define PHY_ANALOG_TOP4_ADCPWD_OVR_LSB 21 -#define PHY_ANALOG_TOP4_ADCPWD_OVR_MASK 0x00200000 -#define PHY_ANALOG_TOP4_ADCPWD_OVR_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_TOP4_ADCPWD_OVR_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_TOP4_ADCPWD_INT_MSB 22 -#define PHY_ANALOG_TOP4_ADCPWD_INT_LSB 22 -#define PHY_ANALOG_TOP4_ADCPWD_INT_MASK 0x00400000 -#define PHY_ANALOG_TOP4_ADCPWD_INT_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_TOP4_ADCPWD_INT_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_TOP4_TESTIQ_OFF_MSB 23 -#define PHY_ANALOG_TOP4_TESTIQ_OFF_LSB 23 -#define PHY_ANALOG_TOP4_TESTIQ_OFF_MASK 0x00800000 -#define PHY_ANALOG_TOP4_TESTIQ_OFF_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_TOP4_TESTIQ_OFF_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_TOP4_TESTIQ_BUFEN_MSB 24 -#define PHY_ANALOG_TOP4_TESTIQ_BUFEN_LSB 24 -#define PHY_ANALOG_TOP4_TESTIQ_BUFEN_MASK 0x01000000 -#define PHY_ANALOG_TOP4_TESTIQ_BUFEN_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_ANALOG_TOP4_TESTIQ_BUFEN_SET(x) (((x) << 24) & 0x01000000) -#define PHY_ANALOG_TOP4_PAL_LOCKEDEN_MSB 25 -#define PHY_ANALOG_TOP4_PAL_LOCKEDEN_LSB 25 -#define PHY_ANALOG_TOP4_PAL_LOCKEDEN_MASK 0x02000000 -#define PHY_ANALOG_TOP4_PAL_LOCKEDEN_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_ANALOG_TOP4_PAL_LOCKEDEN_SET(x) (((x) << 25) & 0x02000000) -#define PHY_ANALOG_TOP4_SYNTHDIGOUTEN_MSB 26 -#define PHY_ANALOG_TOP4_SYNTHDIGOUTEN_LSB 26 -#define PHY_ANALOG_TOP4_SYNTHDIGOUTEN_MASK 0x04000000 -#define PHY_ANALOG_TOP4_SYNTHDIGOUTEN_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_TOP4_SYNTHDIGOUTEN_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_TOP4_ENBTCLK_MSB 27 -#define PHY_ANALOG_TOP4_ENBTCLK_LSB 27 -#define PHY_ANALOG_TOP4_ENBTCLK_MASK 0x08000000 -#define PHY_ANALOG_TOP4_ENBTCLK_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_TOP4_ENBTCLK_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_TOP4_PAD2GND_MSB 28 -#define PHY_ANALOG_TOP4_PAD2GND_LSB 28 -#define PHY_ANALOG_TOP4_PAD2GND_MASK 0x10000000 -#define PHY_ANALOG_TOP4_PAD2GND_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_TOP4_PAD2GND_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_TOP4_INTH2PAD_MSB 29 -#define PHY_ANALOG_TOP4_INTH2PAD_LSB 29 -#define PHY_ANALOG_TOP4_INTH2PAD_MASK 0x20000000 -#define PHY_ANALOG_TOP4_INTH2PAD_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_TOP4_INTH2PAD_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_TOP4_INTH2GND_MSB 30 -#define PHY_ANALOG_TOP4_INTH2GND_LSB 30 -#define PHY_ANALOG_TOP4_INTH2GND_MASK 0x40000000 -#define PHY_ANALOG_TOP4_INTH2GND_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_TOP4_INTH2GND_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_TOP4_INT2PAD_MSB 31 -#define PHY_ANALOG_TOP4_INT2PAD_LSB 31 -#define PHY_ANALOG_TOP4_INT2PAD_MASK 0x80000000 -#define PHY_ANALOG_TOP4_INT2PAD_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_TOP4_INT2PAD_SET(x) (((x) << 31) & 0x80000000) - -/* macros for rbist_cntrl */ -#define PHY_ANALOG_RBIST_CNTRL_ADDRESS 0x00000380 -#define PHY_ANALOG_RBIST_CNTRL_OFFSET 0x00000380 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_DC_ENABLE_MSB 0 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_DC_ENABLE_LSB 0 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_DC_ENABLE_MASK 0x00000001 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_DC_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_DC_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE0_ENABLE_MSB 1 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE0_ENABLE_LSB 1 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE0_ENABLE_MASK 0x00000002 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE0_ENABLE_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE0_ENABLE_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE1_ENABLE_MSB 2 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE1_ENABLE_LSB 2 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE1_ENABLE_MASK 0x00000004 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE1_ENABLE_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE1_ENABLE_SET(x) (((x) << 2) & 0x00000004) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LFTONE0_ENABLE_MSB 3 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LFTONE0_ENABLE_LSB 3 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LFTONE0_ENABLE_MASK 0x00000008 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LFTONE0_ENABLE_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LFTONE0_ENABLE_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_I_MSB 4 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_I_LSB 4 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_I_MASK 0x00000010 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_I_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_I_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_Q_MSB 5 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_Q_LSB 5 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_Q_MASK 0x00000020 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_Q_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_Q_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_I_MSB 6 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_I_LSB 6 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_I_MASK 0x00000040 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_I_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_I_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_Q_MSB 7 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_Q_LSB 7 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_Q_MASK 0x00000080 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_Q_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_Q_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_WRITE_TO_CANCEL_MSB 8 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_WRITE_TO_CANCEL_LSB 8 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_WRITE_TO_CANCEL_MASK 0x00000100 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_WRITE_TO_CANCEL_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_WRITE_TO_CANCEL_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_ENABLE_MSB 9 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_ENABLE_LSB 9 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_ENABLE_MASK 0x00000200 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_ENABLE_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_ENABLE_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_CORR_ENABLE_MSB 10 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_CORR_ENABLE_LSB 10 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_CORR_ENABLE_MASK 0x00000400 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_CORR_ENABLE_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_CORR_ENABLE_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_ENABLE_MSB 11 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_ENABLE_LSB 11 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_ENABLE_MASK 0x00000800 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_ENABLE_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_ENABLE_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_IQ_ENABLE_MSB 12 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_IQ_ENABLE_LSB 12 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_IQ_ENABLE_MASK 0x00001000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_IQ_ENABLE_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_IQ_ENABLE_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_I2Q2_ENABLE_MSB 13 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_I2Q2_ENABLE_LSB 13 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_I2Q2_ENABLE_MASK 0x00002000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_I2Q2_ENABLE_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_I2Q2_ENABLE_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_HPF_ENABLE_MSB 14 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_HPF_ENABLE_LSB 14 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_HPF_ENABLE_MASK 0x00004000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_HPF_ENABLE_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_HPF_ENABLE_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_RBIST_CNTRL_ATE_RXDAC_CALIBRATE_MSB 15 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RXDAC_CALIBRATE_LSB 15 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RXDAC_CALIBRATE_MASK 0x00008000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RXDAC_CALIBRATE_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_RBIST_CNTRL_ATE_RXDAC_CALIBRATE_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_RBIST_CNTRL_ATE_RBIST_ENABLE_MSB 16 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RBIST_ENABLE_LSB 16 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RBIST_ENABLE_MASK 0x00010000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RBIST_ENABLE_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_RBIST_CNTRL_ATE_RBIST_ENABLE_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_RBIST_CNTRL_ATE_ADC_CLK_INVERT_MSB 17 -#define PHY_ANALOG_RBIST_CNTRL_ATE_ADC_CLK_INVERT_LSB 17 -#define PHY_ANALOG_RBIST_CNTRL_ATE_ADC_CLK_INVERT_MASK 0x00020000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_ADC_CLK_INVERT_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_RBIST_CNTRL_ATE_ADC_CLK_INVERT_SET(x) (((x) << 17) & 0x00020000) - -/* macros for tx_dc_offset */ -#define PHY_ANALOG_TX_DC_OFFSET_ADDRESS 0x00000384 -#define PHY_ANALOG_TX_DC_OFFSET_OFFSET 0x00000384 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_I_MSB 10 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_I_LSB 0 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_I_MASK 0x000007ff -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_I_GET(x) (((x) & 0x000007ff) >> 0) -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_I_SET(x) (((x) << 0) & 0x000007ff) -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_Q_MSB 26 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_Q_LSB 16 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_Q_MASK 0x07ff0000 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_Q_GET(x) (((x) & 0x07ff0000) >> 16) -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_Q_SET(x) (((x) << 16) & 0x07ff0000) - -/* macros for tx_tonegen0 */ -#define PHY_ANALOG_TX_TONEGEN0_ADDRESS 0x00000388 -#define PHY_ANALOG_TX_TONEGEN0_OFFSET 0x00000388 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_FREQ_MSB 6 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_FREQ_LSB 0 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_FREQ_MASK 0x0000007f -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_FREQ_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_FREQ_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_EXP_MSB 11 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_EXP_LSB 8 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_EXP_MASK 0x00000f00 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_EXP_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_EXP_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_MAN_MSB 23 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_MAN_LSB 16 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_MAN_MASK 0x00ff0000 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_MAN_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_MAN_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_TAU_K_MSB 30 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_TAU_K_LSB 24 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_TAU_K_MASK 0x7f000000 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_TAU_K_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_TAU_K_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for tx_tonegen1 */ -#define PHY_ANALOG_TX_TONEGEN1_ADDRESS 0x0000038c -#define PHY_ANALOG_TX_TONEGEN1_OFFSET 0x0000038c -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_FREQ_MSB 6 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_FREQ_LSB 0 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_FREQ_MASK 0x0000007f -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_FREQ_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_FREQ_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_EXP_MSB 11 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_EXP_LSB 8 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_EXP_MASK 0x00000f00 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_EXP_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_EXP_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_MAN_MSB 23 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_MAN_LSB 16 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_MAN_MASK 0x00ff0000 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_MAN_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_MAN_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_TAU_K_MSB 30 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_TAU_K_LSB 24 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_TAU_K_MASK 0x7f000000 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_TAU_K_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_TAU_K_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for tx_lftonegen0 */ -#define PHY_ANALOG_TX_LFTONEGEN0_ADDRESS 0x00000390 -#define PHY_ANALOG_TX_LFTONEGEN0_OFFSET 0x00000390 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_FREQ_MSB 6 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_FREQ_LSB 0 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_FREQ_MASK 0x0000007f -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_FREQ_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_FREQ_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_EXP_MSB 11 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_EXP_LSB 8 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_EXP_MASK 0x00000f00 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_EXP_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_EXP_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_MAN_MSB 23 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_MAN_LSB 16 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_MAN_MASK 0x00ff0000 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_MAN_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_MAN_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_TAU_K_MSB 30 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_TAU_K_LSB 24 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_TAU_K_MASK 0x7f000000 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_TAU_K_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_TAU_K_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for tx_linear_ramp_i */ -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ADDRESS 0x00000394 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_OFFSET 0x00000394 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_INIT_MSB 10 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_INIT_LSB 0 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_INIT_MASK 0x000007ff -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_INIT_GET(x) (((x) & 0x000007ff) >> 0) -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_INIT_SET(x) (((x) << 0) & 0x000007ff) -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_DWELL_MSB 21 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_DWELL_LSB 12 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_DWELL_MASK 0x003ff000 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_DWELL_GET(x) (((x) & 0x003ff000) >> 12) -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_DWELL_SET(x) (((x) << 12) & 0x003ff000) -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_STEP_MSB 29 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_STEP_LSB 24 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_STEP_MASK 0x3f000000 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_STEP_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_STEP_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for tx_linear_ramp_q */ -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ADDRESS 0x00000398 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_OFFSET 0x00000398 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_INIT_MSB 10 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_INIT_LSB 0 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_INIT_MASK 0x000007ff -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_INIT_GET(x) (((x) & 0x000007ff) >> 0) -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_INIT_SET(x) (((x) << 0) & 0x000007ff) -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_DWELL_MSB 21 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_DWELL_LSB 12 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_DWELL_MASK 0x003ff000 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_DWELL_GET(x) (((x) & 0x003ff000) >> 12) -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_DWELL_SET(x) (((x) << 12) & 0x003ff000) -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_STEP_MSB 29 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_STEP_LSB 24 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_STEP_MASK 0x3f000000 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_STEP_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_STEP_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for tx_prbs_mag */ -#define PHY_ANALOG_TX_PRBS_MAG_ADDRESS 0x0000039c -#define PHY_ANALOG_TX_PRBS_MAG_OFFSET 0x0000039c -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_I_MSB 9 -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_I_LSB 0 -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_I_MASK 0x000003ff -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_I_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_I_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_Q_MSB 25 -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_Q_LSB 16 -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_Q_MASK 0x03ff0000 -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_Q_GET(x) (((x) & 0x03ff0000) >> 16) -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_Q_SET(x) (((x) << 16) & 0x03ff0000) - -/* macros for tx_prbs_seed_i */ -#define PHY_ANALOG_TX_PRBS_SEED_I_ADDRESS 0x000003a0 -#define PHY_ANALOG_TX_PRBS_SEED_I_OFFSET 0x000003a0 -#define PHY_ANALOG_TX_PRBS_SEED_I_ATE_TONEGEN_PRBS_SEED_MSB 30 -#define PHY_ANALOG_TX_PRBS_SEED_I_ATE_TONEGEN_PRBS_SEED_LSB 0 -#define PHY_ANALOG_TX_PRBS_SEED_I_ATE_TONEGEN_PRBS_SEED_MASK 0x7fffffff -#define PHY_ANALOG_TX_PRBS_SEED_I_ATE_TONEGEN_PRBS_SEED_GET(x) (((x) & 0x7fffffff) >> 0) -#define PHY_ANALOG_TX_PRBS_SEED_I_ATE_TONEGEN_PRBS_SEED_SET(x) (((x) << 0) & 0x7fffffff) - -/* macros for tx_prbs_seed_q */ -#define PHY_ANALOG_TX_PRBS_SEED_Q_ADDRESS 0x000003a4 -#define PHY_ANALOG_TX_PRBS_SEED_Q_OFFSET 0x000003a4 -#define PHY_ANALOG_TX_PRBS_SEED_Q_ATE_TONEGEN_PRBS_SEED_MSB 30 -#define PHY_ANALOG_TX_PRBS_SEED_Q_ATE_TONEGEN_PRBS_SEED_LSB 0 -#define PHY_ANALOG_TX_PRBS_SEED_Q_ATE_TONEGEN_PRBS_SEED_MASK 0x7fffffff -#define PHY_ANALOG_TX_PRBS_SEED_Q_ATE_TONEGEN_PRBS_SEED_GET(x) (((x) & 0x7fffffff) >> 0) -#define PHY_ANALOG_TX_PRBS_SEED_Q_ATE_TONEGEN_PRBS_SEED_SET(x) (((x) << 0) & 0x7fffffff) - -/* macros for cmac_dc_cancel */ -#define PHY_ANALOG_CMAC_DC_CANCEL_ADDRESS 0x000003a8 -#define PHY_ANALOG_CMAC_DC_CANCEL_OFFSET 0x000003a8 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_I_MSB 9 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_I_LSB 0 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_I_MASK 0x000003ff -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_I_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_I_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_Q_MSB 25 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_Q_LSB 16 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_Q_MASK 0x03ff0000 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_Q_GET(x) (((x) & 0x03ff0000) >> 16) -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_Q_SET(x) (((x) << 16) & 0x03ff0000) - -/* macros for cmac_dc_offset */ -#define PHY_ANALOG_CMAC_DC_OFFSET_ADDRESS 0x000003ac -#define PHY_ANALOG_CMAC_DC_OFFSET_OFFSET 0x000003ac -#define PHY_ANALOG_CMAC_DC_OFFSET_ATE_CMAC_DC_CYCLES_MSB 3 -#define PHY_ANALOG_CMAC_DC_OFFSET_ATE_CMAC_DC_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_DC_OFFSET_ATE_CMAC_DC_CYCLES_MASK 0x0000000f -#define PHY_ANALOG_CMAC_DC_OFFSET_ATE_CMAC_DC_CYCLES_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_CMAC_DC_OFFSET_ATE_CMAC_DC_CYCLES_SET(x) (((x) << 0) & 0x0000000f) - -/* macros for cmac_corr */ -#define PHY_ANALOG_CMAC_CORR_ADDRESS 0x000003b0 -#define PHY_ANALOG_CMAC_CORR_OFFSET 0x000003b0 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_CYCLES_MSB 4 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_CYCLES_MASK 0x0000001f -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_CYCLES_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_CYCLES_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_FREQ_MSB 13 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_FREQ_LSB 8 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_FREQ_MASK 0x00003f00 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_FREQ_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_FREQ_SET(x) (((x) << 8) & 0x00003f00) - -/* macros for cmac_power */ -#define PHY_ANALOG_CMAC_POWER_ADDRESS 0x000003b4 -#define PHY_ANALOG_CMAC_POWER_OFFSET 0x000003b4 -#define PHY_ANALOG_CMAC_POWER_ATE_CMAC_POWER_CYCLES_MSB 3 -#define PHY_ANALOG_CMAC_POWER_ATE_CMAC_POWER_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_POWER_ATE_CMAC_POWER_CYCLES_MASK 0x0000000f -#define PHY_ANALOG_CMAC_POWER_ATE_CMAC_POWER_CYCLES_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_CMAC_POWER_ATE_CMAC_POWER_CYCLES_SET(x) (((x) << 0) & 0x0000000f) - -/* macros for cmac_cross_corr */ -#define PHY_ANALOG_CMAC_CROSS_CORR_ADDRESS 0x000003b8 -#define PHY_ANALOG_CMAC_CROSS_CORR_OFFSET 0x000003b8 -#define PHY_ANALOG_CMAC_CROSS_CORR_ATE_CMAC_IQ_CYCLES_MSB 3 -#define PHY_ANALOG_CMAC_CROSS_CORR_ATE_CMAC_IQ_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_CROSS_CORR_ATE_CMAC_IQ_CYCLES_MASK 0x0000000f -#define PHY_ANALOG_CMAC_CROSS_CORR_ATE_CMAC_IQ_CYCLES_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_CMAC_CROSS_CORR_ATE_CMAC_IQ_CYCLES_SET(x) (((x) << 0) & 0x0000000f) - -/* macros for cmac_i2q2 */ -#define PHY_ANALOG_CMAC_I2Q2_ADDRESS 0x000003bc -#define PHY_ANALOG_CMAC_I2Q2_OFFSET 0x000003bc -#define PHY_ANALOG_CMAC_I2Q2_ATE_CMAC_I2Q2_CYCLES_MSB 3 -#define PHY_ANALOG_CMAC_I2Q2_ATE_CMAC_I2Q2_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_I2Q2_ATE_CMAC_I2Q2_CYCLES_MASK 0x0000000f -#define PHY_ANALOG_CMAC_I2Q2_ATE_CMAC_I2Q2_CYCLES_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_CMAC_I2Q2_ATE_CMAC_I2Q2_CYCLES_SET(x) (((x) << 0) & 0x0000000f) - -/* macros for cmac_power_hpf */ -#define PHY_ANALOG_CMAC_POWER_HPF_ADDRESS 0x000003c0 -#define PHY_ANALOG_CMAC_POWER_HPF_OFFSET 0x000003c0 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_CYCLES_MSB 3 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_CYCLES_MASK 0x0000000f -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_CYCLES_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_CYCLES_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_WAIT_MSB 7 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_WAIT_LSB 4 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_WAIT_MASK 0x000000f0 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_WAIT_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_WAIT_SET(x) (((x) << 4) & 0x000000f0) - -/* macros for rxdac_set1 */ -#define PHY_ANALOG_RXDAC_SET1_ADDRESS 0x000003c4 -#define PHY_ANALOG_RXDAC_SET1_OFFSET 0x000003c4 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_MUX_MSB 1 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_MUX_LSB 0 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_MUX_MASK 0x00000003 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_MUX_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_MUX_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_HI_GAIN_MSB 4 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_HI_GAIN_LSB 4 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_HI_GAIN_MASK 0x00000010 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_HI_GAIN_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_HI_GAIN_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_WAIT_MSB 13 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_WAIT_LSB 8 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_WAIT_MASK 0x00003f00 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_WAIT_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_WAIT_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_MEASURE_TIME_MSB 19 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_MEASURE_TIME_LSB 16 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_MEASURE_TIME_MASK 0x000f0000 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_MEASURE_TIME_GET(x) (((x) & 0x000f0000) >> 16) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_MEASURE_TIME_SET(x) (((x) << 16) & 0x000f0000) - -/* macros for rxdac_set2 */ -#define PHY_ANALOG_RXDAC_SET2_ADDRESS 0x000003c8 -#define PHY_ANALOG_RXDAC_SET2_OFFSET 0x000003c8 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_HI_MSB 4 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_HI_LSB 0 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_HI_MASK 0x0000001f -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_HI_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_HI_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_HI_MSB 12 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_HI_LSB 8 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_HI_MASK 0x00001f00 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_HI_GET(x) (((x) & 0x00001f00) >> 8) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_HI_SET(x) (((x) << 8) & 0x00001f00) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_LOW_MSB 20 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_LOW_LSB 16 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_LOW_MASK 0x001f0000 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_LOW_GET(x) (((x) & 0x001f0000) >> 16) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_LOW_SET(x) (((x) << 16) & 0x001f0000) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_LOW_MSB 28 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_LOW_LSB 24 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_LOW_MASK 0x1f000000 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_LOW_GET(x) (((x) & 0x1f000000) >> 24) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_LOW_SET(x) (((x) << 24) & 0x1f000000) - -/* macros for rxdac_long_shift */ -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ADDRESS 0x000003cc -#define PHY_ANALOG_RXDAC_LONG_SHIFT_OFFSET 0x000003cc -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_I_STATIC_MSB 4 -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_I_STATIC_LSB 0 -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_I_STATIC_MASK 0x0000001f -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_I_STATIC_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_I_STATIC_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_Q_STATIC_MSB 12 -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_Q_STATIC_LSB 8 -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_Q_STATIC_MASK 0x00001f00 -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_Q_STATIC_GET(x) (((x) & 0x00001f00) >> 8) -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_Q_STATIC_SET(x) (((x) << 8) & 0x00001f00) - -/* macros for cmac_results_i */ -#define PHY_ANALOG_CMAC_RESULTS_I_ADDRESS 0x000003d0 -#define PHY_ANALOG_CMAC_RESULTS_I_OFFSET 0x000003d0 -#define PHY_ANALOG_CMAC_RESULTS_I_ATE_CMAC_RESULTS_MSB 31 -#define PHY_ANALOG_CMAC_RESULTS_I_ATE_CMAC_RESULTS_LSB 0 -#define PHY_ANALOG_CMAC_RESULTS_I_ATE_CMAC_RESULTS_MASK 0xffffffff -#define PHY_ANALOG_CMAC_RESULTS_I_ATE_CMAC_RESULTS_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_ANALOG_CMAC_RESULTS_I_ATE_CMAC_RESULTS_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for cmac_results_q */ -#define PHY_ANALOG_CMAC_RESULTS_Q_ADDRESS 0x000003d4 -#define PHY_ANALOG_CMAC_RESULTS_Q_OFFSET 0x000003d4 -#define PHY_ANALOG_CMAC_RESULTS_Q_ATE_CMAC_RESULTS_MSB 31 -#define PHY_ANALOG_CMAC_RESULTS_Q_ATE_CMAC_RESULTS_LSB 0 -#define PHY_ANALOG_CMAC_RESULTS_Q_ATE_CMAC_RESULTS_MASK 0xffffffff -#define PHY_ANALOG_CMAC_RESULTS_Q_ATE_CMAC_RESULTS_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_ANALOG_CMAC_RESULTS_Q_ATE_CMAC_RESULTS_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for PMU1 */ -#define PHY_ANALOG_PMU1_ADDRESS 0x00000740 -#define PHY_ANALOG_PMU1_OFFSET 0x00000740 -#define PHY_ANALOG_PMU1_SPARE_MSB 10 -#define PHY_ANALOG_PMU1_SPARE_LSB 0 -#define PHY_ANALOG_PMU1_SPARE_MASK 0x000007ff -#define PHY_ANALOG_PMU1_SPARE_GET(x) (((x) & 0x000007ff) >> 0) -#define PHY_ANALOG_PMU1_SPARE_SET(x) (((x) << 0) & 0x000007ff) -#define PHY_ANALOG_PMU1_OTP_V25_PWD_MSB 11 -#define PHY_ANALOG_PMU1_OTP_V25_PWD_LSB 11 -#define PHY_ANALOG_PMU1_OTP_V25_PWD_MASK 0x00000800 -#define PHY_ANALOG_PMU1_OTP_V25_PWD_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_PMU1_OTP_V25_PWD_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_PMU1_PAREGON_MAN_MSB 12 -#define PHY_ANALOG_PMU1_PAREGON_MAN_LSB 12 -#define PHY_ANALOG_PMU1_PAREGON_MAN_MASK 0x00001000 -#define PHY_ANALOG_PMU1_PAREGON_MAN_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_PMU1_PAREGON_MAN_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_PMU1_OTPREGON_MAN_MSB 13 -#define PHY_ANALOG_PMU1_OTPREGON_MAN_LSB 13 -#define PHY_ANALOG_PMU1_OTPREGON_MAN_MASK 0x00002000 -#define PHY_ANALOG_PMU1_OTPREGON_MAN_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_PMU1_OTPREGON_MAN_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_PMU1_DREGON_MAN_MSB 14 -#define PHY_ANALOG_PMU1_DREGON_MAN_LSB 14 -#define PHY_ANALOG_PMU1_DREGON_MAN_MASK 0x00004000 -#define PHY_ANALOG_PMU1_DREGON_MAN_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_PMU1_DREGON_MAN_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_PMU1_DISCONTMODEEN_MSB 15 -#define PHY_ANALOG_PMU1_DISCONTMODEEN_LSB 15 -#define PHY_ANALOG_PMU1_DISCONTMODEEN_MASK 0x00008000 -#define PHY_ANALOG_PMU1_DISCONTMODEEN_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_PMU1_DISCONTMODEEN_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_PMU1_SWREGON_MAN_MSB 16 -#define PHY_ANALOG_PMU1_SWREGON_MAN_LSB 16 -#define PHY_ANALOG_PMU1_SWREGON_MAN_MASK 0x00010000 -#define PHY_ANALOG_PMU1_SWREGON_MAN_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_PMU1_SWREGON_MAN_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_PMU1_SWREG_FREQCUR_MSB 18 -#define PHY_ANALOG_PMU1_SWREG_FREQCUR_LSB 17 -#define PHY_ANALOG_PMU1_SWREG_FREQCUR_MASK 0x00060000 -#define PHY_ANALOG_PMU1_SWREG_FREQCUR_GET(x) (((x) & 0x00060000) >> 17) -#define PHY_ANALOG_PMU1_SWREG_FREQCUR_SET(x) (((x) << 17) & 0x00060000) -#define PHY_ANALOG_PMU1_SWREG_FREQCAP_MSB 21 -#define PHY_ANALOG_PMU1_SWREG_FREQCAP_LSB 19 -#define PHY_ANALOG_PMU1_SWREG_FREQCAP_MASK 0x00380000 -#define PHY_ANALOG_PMU1_SWREG_FREQCAP_GET(x) (((x) & 0x00380000) >> 19) -#define PHY_ANALOG_PMU1_SWREG_FREQCAP_SET(x) (((x) << 19) & 0x00380000) -#define PHY_ANALOG_PMU1_SWREG_LVLCTR_MSB 23 -#define PHY_ANALOG_PMU1_SWREG_LVLCTR_LSB 22 -#define PHY_ANALOG_PMU1_SWREG_LVLCTR_MASK 0x00c00000 -#define PHY_ANALOG_PMU1_SWREG_LVLCTR_GET(x) (((x) & 0x00c00000) >> 22) -#define PHY_ANALOG_PMU1_SWREG_LVLCTR_SET(x) (((x) << 22) & 0x00c00000) -#define PHY_ANALOG_PMU1_SREG_LVLCTR_MSB 25 -#define PHY_ANALOG_PMU1_SREG_LVLCTR_LSB 24 -#define PHY_ANALOG_PMU1_SREG_LVLCTR_MASK 0x03000000 -#define PHY_ANALOG_PMU1_SREG_LVLCTR_GET(x) (((x) & 0x03000000) >> 24) -#define PHY_ANALOG_PMU1_SREG_LVLCTR_SET(x) (((x) << 24) & 0x03000000) -#define PHY_ANALOG_PMU1_DREG_LVLCTR_MSB 27 -#define PHY_ANALOG_PMU1_DREG_LVLCTR_LSB 26 -#define PHY_ANALOG_PMU1_DREG_LVLCTR_MASK 0x0c000000 -#define PHY_ANALOG_PMU1_DREG_LVLCTR_GET(x) (((x) & 0x0c000000) >> 26) -#define PHY_ANALOG_PMU1_DREG_LVLCTR_SET(x) (((x) << 26) & 0x0c000000) -#define PHY_ANALOG_PMU1_PAREG_XPNP_MSB 28 -#define PHY_ANALOG_PMU1_PAREG_XPNP_LSB 28 -#define PHY_ANALOG_PMU1_PAREG_XPNP_MASK 0x10000000 -#define PHY_ANALOG_PMU1_PAREG_XPNP_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_PMU1_PAREG_XPNP_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_PMU1_PAREG_LVLCTR_MSB 31 -#define PHY_ANALOG_PMU1_PAREG_LVLCTR_LSB 29 -#define PHY_ANALOG_PMU1_PAREG_LVLCTR_MASK 0xe0000000 -#define PHY_ANALOG_PMU1_PAREG_LVLCTR_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_PMU1_PAREG_LVLCTR_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for PMU2 */ -#define PHY_ANALOG_PMU2_ADDRESS 0x00000744 -#define PHY_ANALOG_PMU2_OFFSET 0x00000744 -#define PHY_ANALOG_PMU2_SPARE_MSB 7 -#define PHY_ANALOG_PMU2_SPARE_LSB 0 -#define PHY_ANALOG_PMU2_SPARE_MASK 0x000000ff -#define PHY_ANALOG_PMU2_SPARE_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_ANALOG_PMU2_SPARE_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_ANALOG_PMU2_VBATT_1_3TOATB_MSB 8 -#define PHY_ANALOG_PMU2_VBATT_1_3TOATB_LSB 8 -#define PHY_ANALOG_PMU2_VBATT_1_3TOATB_MASK 0x00000100 -#define PHY_ANALOG_PMU2_VBATT_1_3TOATB_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_PMU2_VBATT_1_3TOATB_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_PMU2_VBATT_1_2TOATB_MSB 9 -#define PHY_ANALOG_PMU2_VBATT_1_2TOATB_LSB 9 -#define PHY_ANALOG_PMU2_VBATT_1_2TOATB_MASK 0x00000200 -#define PHY_ANALOG_PMU2_VBATT_1_2TOATB_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_PMU2_VBATT_1_2TOATB_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_PMU2_VBATT_2_3TOATB_MSB 10 -#define PHY_ANALOG_PMU2_VBATT_2_3TOATB_LSB 10 -#define PHY_ANALOG_PMU2_VBATT_2_3TOATB_MASK 0x00000400 -#define PHY_ANALOG_PMU2_VBATT_2_3TOATB_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_PMU2_VBATT_2_3TOATB_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_PMU2_PWD_BANDGAP_MAN_MSB 11 -#define PHY_ANALOG_PMU2_PWD_BANDGAP_MAN_LSB 11 -#define PHY_ANALOG_PMU2_PWD_BANDGAP_MAN_MASK 0x00000800 -#define PHY_ANALOG_PMU2_PWD_BANDGAP_MAN_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_PMU2_PWD_BANDGAP_MAN_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_PMU2_PWD_LFO_MAN_MSB 12 -#define PHY_ANALOG_PMU2_PWD_LFO_MAN_LSB 12 -#define PHY_ANALOG_PMU2_PWD_LFO_MAN_MASK 0x00001000 -#define PHY_ANALOG_PMU2_PWD_LFO_MAN_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_PMU2_PWD_LFO_MAN_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_PMU2_VBATT_LT_3P2_MSB 13 -#define PHY_ANALOG_PMU2_VBATT_LT_3P2_LSB 13 -#define PHY_ANALOG_PMU2_VBATT_LT_3P2_MASK 0x00002000 -#define PHY_ANALOG_PMU2_VBATT_LT_3P2_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_PMU2_VBATT_LT_3P2_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_PMU2_VBATT_LT_2P8_MSB 14 -#define PHY_ANALOG_PMU2_VBATT_LT_2P8_LSB 14 -#define PHY_ANALOG_PMU2_VBATT_LT_2P8_MASK 0x00004000 -#define PHY_ANALOG_PMU2_VBATT_LT_2P8_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_PMU2_VBATT_LT_2P8_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_PMU2_VBATT_GT_4P2_MSB 15 -#define PHY_ANALOG_PMU2_VBATT_GT_4P2_LSB 15 -#define PHY_ANALOG_PMU2_VBATT_GT_4P2_MASK 0x00008000 -#define PHY_ANALOG_PMU2_VBATT_GT_4P2_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_PMU2_VBATT_GT_4P2_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_PMU2_PMU_MAN_OVERRIDE_EN_MSB 16 -#define PHY_ANALOG_PMU2_PMU_MAN_OVERRIDE_EN_LSB 16 -#define PHY_ANALOG_PMU2_PMU_MAN_OVERRIDE_EN_MASK 0x00010000 -#define PHY_ANALOG_PMU2_PMU_MAN_OVERRIDE_EN_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_PMU2_PMU_MAN_OVERRIDE_EN_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_PMU2_VBATT_GT_LVLCTR_MSB 18 -#define PHY_ANALOG_PMU2_VBATT_GT_LVLCTR_LSB 17 -#define PHY_ANALOG_PMU2_VBATT_GT_LVLCTR_MASK 0x00060000 -#define PHY_ANALOG_PMU2_VBATT_GT_LVLCTR_GET(x) (((x) & 0x00060000) >> 17) -#define PHY_ANALOG_PMU2_VBATT_GT_LVLCTR_SET(x) (((x) << 17) & 0x00060000) -#define PHY_ANALOG_PMU2_SWREGVSSL2ATB_MSB 19 -#define PHY_ANALOG_PMU2_SWREGVSSL2ATB_LSB 19 -#define PHY_ANALOG_PMU2_SWREGVSSL2ATB_MASK 0x00080000 -#define PHY_ANALOG_PMU2_SWREGVSSL2ATB_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_ANALOG_PMU2_SWREGVSSL2ATB_SET(x) (((x) << 19) & 0x00080000) -#define PHY_ANALOG_PMU2_SWREGVSSL_LVLCTR_MSB 21 -#define PHY_ANALOG_PMU2_SWREGVSSL_LVLCTR_LSB 20 -#define PHY_ANALOG_PMU2_SWREGVSSL_LVLCTR_MASK 0x00300000 -#define PHY_ANALOG_PMU2_SWREGVSSL_LVLCTR_GET(x) (((x) & 0x00300000) >> 20) -#define PHY_ANALOG_PMU2_SWREGVSSL_LVLCTR_SET(x) (((x) << 20) & 0x00300000) -#define PHY_ANALOG_PMU2_SWREGVDDH2ATB_MSB 22 -#define PHY_ANALOG_PMU2_SWREGVDDH2ATB_LSB 22 -#define PHY_ANALOG_PMU2_SWREGVDDH2ATB_MASK 0x00400000 -#define PHY_ANALOG_PMU2_SWREGVDDH2ATB_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_PMU2_SWREGVDDH2ATB_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_PMU2_SWREGVDDH_LVLCTR_MSB 24 -#define PHY_ANALOG_PMU2_SWREGVDDH_LVLCTR_LSB 23 -#define PHY_ANALOG_PMU2_SWREGVDDH_LVLCTR_MASK 0x01800000 -#define PHY_ANALOG_PMU2_SWREGVDDH_LVLCTR_GET(x) (((x) & 0x01800000) >> 23) -#define PHY_ANALOG_PMU2_SWREGVDDH_LVLCTR_SET(x) (((x) << 23) & 0x01800000) -#define PHY_ANALOG_PMU2_SWREG2ATB_MSB 27 -#define PHY_ANALOG_PMU2_SWREG2ATB_LSB 25 -#define PHY_ANALOG_PMU2_SWREG2ATB_MASK 0x0e000000 -#define PHY_ANALOG_PMU2_SWREG2ATB_GET(x) (((x) & 0x0e000000) >> 25) -#define PHY_ANALOG_PMU2_SWREG2ATB_SET(x) (((x) << 25) & 0x0e000000) -#define PHY_ANALOG_PMU2_OTPREG2ATB_MSB 28 -#define PHY_ANALOG_PMU2_OTPREG2ATB_LSB 28 -#define PHY_ANALOG_PMU2_OTPREG2ATB_MASK 0x10000000 -#define PHY_ANALOG_PMU2_OTPREG2ATB_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_PMU2_OTPREG2ATB_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_MSB 30 -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_LSB 29 -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_MASK 0x60000000 -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_GET(x) (((x) & 0x60000000) >> 29) -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_SET(x) (((x) << 29) & 0x60000000) -#define PHY_ANALOG_PMU2_DREG_LVLCTR_MANOVR_EN_MSB 31 -#define PHY_ANALOG_PMU2_DREG_LVLCTR_MANOVR_EN_LSB 31 -#define PHY_ANALOG_PMU2_DREG_LVLCTR_MANOVR_EN_MASK 0x80000000 -#define PHY_ANALOG_PMU2_DREG_LVLCTR_MANOVR_EN_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_PMU2_DREG_LVLCTR_MANOVR_EN_SET(x) (((x) << 31) & 0x80000000) - - -#ifndef __ASSEMBLER__ - -typedef struct analog_intf_ares_reg_reg_s { - volatile unsigned int RXRF_BIAS1; /* 0x0 - 0x4 */ - volatile unsigned int RXRF_BIAS2; /* 0x4 - 0x8 */ - volatile unsigned int RXRF_GAINSTAGES; /* 0x8 - 0xc */ - volatile unsigned int RXRF_AGC; /* 0xc - 0x10 */ - volatile char pad__0[0x30]; /* 0x10 - 0x40 */ - volatile unsigned int TXRF1; /* 0x40 - 0x44 */ - volatile unsigned int TXRF2; /* 0x44 - 0x48 */ - volatile unsigned int TXRF3; /* 0x48 - 0x4c */ - volatile unsigned int TXRF4; /* 0x4c - 0x50 */ - volatile unsigned int TXRF5; /* 0x50 - 0x54 */ - volatile unsigned int TXRF6; /* 0x54 - 0x58 */ - volatile unsigned int TXRF7; /* 0x58 - 0x5c */ - volatile unsigned int TXRF8; /* 0x5c - 0x60 */ - volatile unsigned int TXRF9; /* 0x60 - 0x64 */ - volatile unsigned int TXRF10; /* 0x64 - 0x68 */ - volatile unsigned int TXRF11; /* 0x68 - 0x6c */ - volatile unsigned int TXRF12; /* 0x6c - 0x70 */ - volatile char pad__1[0x10]; /* 0x70 - 0x80 */ - volatile unsigned int SYNTH1; /* 0x80 - 0x84 */ - volatile unsigned int SYNTH2; /* 0x84 - 0x88 */ - volatile unsigned int SYNTH3; /* 0x88 - 0x8c */ - volatile unsigned int SYNTH4; /* 0x8c - 0x90 */ - volatile unsigned int SYNTH5; /* 0x90 - 0x94 */ - volatile unsigned int SYNTH6; /* 0x94 - 0x98 */ - volatile unsigned int SYNTH7; /* 0x98 - 0x9c */ - volatile unsigned int SYNTH8; /* 0x9c - 0xa0 */ - volatile unsigned int SYNTH9; /* 0xa0 - 0xa4 */ - volatile unsigned int SYNTH10; /* 0xa4 - 0xa8 */ - volatile unsigned int SYNTH11; /* 0xa8 - 0xac */ - volatile unsigned int SYNTH12; /* 0xac - 0xb0 */ - volatile char pad__2[0x10]; /* 0xb0 - 0xc0 */ - volatile unsigned int BIAS1; /* 0xc0 - 0xc4 */ - volatile unsigned int BIAS2; /* 0xc4 - 0xc8 */ - volatile unsigned int BIAS3; /* 0xc8 - 0xcc */ - volatile unsigned int BIAS4; /* 0xcc - 0xd0 */ - volatile char pad__3[0x30]; /* 0xd0 - 0x100 */ - volatile unsigned int RXTX1; /* 0x100 - 0x104 */ - volatile unsigned int RXTX2; /* 0x104 - 0x108 */ - volatile unsigned int RXTX3; /* 0x108 - 0x10c */ - volatile char pad__4[0x34]; /* 0x10c - 0x140 */ - volatile unsigned int BB1; /* 0x140 - 0x144 */ - volatile unsigned int BB2; /* 0x144 - 0x148 */ - volatile char pad__5[0x138]; /* 0x148 - 0x280 */ - volatile unsigned int TOP1; /* 0x280 - 0x284 */ - volatile unsigned int TOP2; /* 0x284 - 0x288 */ - volatile unsigned int TOP3; /* 0x288 - 0x28c */ - volatile unsigned int TOP4; /* 0x28c - 0x290 */ - volatile char pad__6[0xf0]; /* 0x290 - 0x380 */ - volatile unsigned int rbist_cntrl; /* 0x380 - 0x384 */ - volatile unsigned int tx_dc_offset; /* 0x384 - 0x388 */ - volatile unsigned int tx_tonegen0; /* 0x388 - 0x38c */ - volatile unsigned int tx_tonegen1; /* 0x38c - 0x390 */ - volatile unsigned int tx_lftonegen0; /* 0x390 - 0x394 */ - volatile unsigned int tx_linear_ramp_i; /* 0x394 - 0x398 */ - volatile unsigned int tx_linear_ramp_q; /* 0x398 - 0x39c */ - volatile unsigned int tx_prbs_mag; /* 0x39c - 0x3a0 */ - volatile unsigned int tx_prbs_seed_i; /* 0x3a0 - 0x3a4 */ - volatile unsigned int tx_prbs_seed_q; /* 0x3a4 - 0x3a8 */ - volatile unsigned int cmac_dc_cancel; /* 0x3a8 - 0x3ac */ - volatile unsigned int cmac_dc_offset; /* 0x3ac - 0x3b0 */ - volatile unsigned int cmac_corr; /* 0x3b0 - 0x3b4 */ - volatile unsigned int cmac_power; /* 0x3b4 - 0x3b8 */ - volatile unsigned int cmac_cross_corr; /* 0x3b8 - 0x3bc */ - volatile unsigned int cmac_i2q2; /* 0x3bc - 0x3c0 */ - volatile unsigned int cmac_power_hpf; /* 0x3c0 - 0x3c4 */ - volatile unsigned int rxdac_set1; /* 0x3c4 - 0x3c8 */ - volatile unsigned int rxdac_set2; /* 0x3c8 - 0x3cc */ - volatile unsigned int rxdac_long_shift; /* 0x3cc - 0x3d0 */ - volatile unsigned int cmac_results_i; /* 0x3d0 - 0x3d4 */ - volatile unsigned int cmac_results_q; /* 0x3d4 - 0x3d8 */ - volatile char pad__7[0x368]; /* 0x3d8 - 0x740 */ - volatile unsigned int PMU1; /* 0x740 - 0x744 */ - volatile unsigned int PMU2; /* 0x744 - 0x748 */ -} analog_intf_ares_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _ANALOG_INTF_ARES_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/analog_intf_athr_wlan_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/analog_intf_athr_wlan_reg.h deleted file mode 100644 index e51497987972..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/analog_intf_athr_wlan_reg.h +++ /dev/null @@ -1,3674 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2009 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _ANALOG_INTF_ATHR_WLAN_REG_REG_H_ -#define _ANALOG_INTF_ATHR_WLAN_REG_REG_H_ - - -/* macros for RXRF_BIAS1 */ -#define PHY_ANALOG_RXRF_BIAS1_ADDRESS 0x00000000 -#define PHY_ANALOG_RXRF_BIAS1_OFFSET 0x00000000 -#define PHY_ANALOG_RXRF_BIAS1_SPARE_MSB 0 -#define PHY_ANALOG_RXRF_BIAS1_SPARE_LSB 0 -#define PHY_ANALOG_RXRF_BIAS1_SPARE_MASK 0x00000001 -#define PHY_ANALOG_RXRF_BIAS1_SPARE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXRF_BIAS1_SPARE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25SPARE_MSB 3 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25SPARE_LSB 1 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25SPARE_MASK 0x0000000e -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25SPARE_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25SPARE_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO18_MSB 6 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO18_LSB 4 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO18_MASK 0x00000070 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO18_GET(x) (((x) & 0x00000070) >> 4) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO18_SET(x) (((x) << 4) & 0x00000070) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25LO36_MSB 9 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25LO36_LSB 7 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25LO36_MASK 0x00000380 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25LO36_GET(x) (((x) & 0x00000380) >> 7) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25LO36_SET(x) (((x) << 7) & 0x00000380) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2_5GH_MSB 12 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2_5GH_LSB 10 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2_5GH_MASK 0x00001c00 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2_5GH_GET(x) (((x) & 0x00001c00) >> 10) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2_5GH_SET(x) (((x) << 10) & 0x00001c00) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR5GH_MSB 15 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR5GH_LSB 13 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR5GH_MASK 0x0000e000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR5GH_GET(x) (((x) & 0x0000e000) >> 13) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR5GH_SET(x) (((x) << 13) & 0x0000e000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25VGA5G_MSB 18 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25VGA5G_LSB 16 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25VGA5G_MASK 0x00070000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25VGA5G_GET(x) (((x) & 0x00070000) >> 16) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25VGA5G_SET(x) (((x) << 16) & 0x00070000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA5G_MSB 21 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA5G_LSB 19 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA5G_MASK 0x00380000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA5G_GET(x) (((x) & 0x00380000) >> 19) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA5G_SET(x) (((x) << 19) & 0x00380000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO24_MSB 24 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO24_LSB 22 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO24_MASK 0x01c00000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO24_GET(x) (((x) & 0x01c00000) >> 22) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO24_SET(x) (((x) << 22) & 0x01c00000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2GH_MSB 27 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2GH_LSB 25 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2GH_MASK 0x0e000000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2GH_GET(x) (((x) & 0x0e000000) >> 25) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2GH_SET(x) (((x) << 25) & 0x0e000000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA2G_MSB 30 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA2G_LSB 28 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA2G_MASK 0x70000000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA2G_GET(x) (((x) & 0x70000000) >> 28) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA2G_SET(x) (((x) << 28) & 0x70000000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_BIAS_MSB 31 -#define PHY_ANALOG_RXRF_BIAS1_PWD_BIAS_LSB 31 -#define PHY_ANALOG_RXRF_BIAS1_PWD_BIAS_MASK 0x80000000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_BIAS_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_RXRF_BIAS1_PWD_BIAS_SET(x) (((x) << 31) & 0x80000000) - -/* macros for RXRF_BIAS2 */ -#define PHY_ANALOG_RXRF_BIAS2_ADDRESS 0x00000004 -#define PHY_ANALOG_RXRF_BIAS2_OFFSET 0x00000004 -#define PHY_ANALOG_RXRF_BIAS2_SPARE_MSB 0 -#define PHY_ANALOG_RXRF_BIAS2_SPARE_LSB 0 -#define PHY_ANALOG_RXRF_BIAS2_SPARE_MASK 0x00000001 -#define PHY_ANALOG_RXRF_BIAS2_SPARE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXRF_BIAS2_SPARE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXRF_BIAS2_PKEN_MSB 3 -#define PHY_ANALOG_RXRF_BIAS2_PKEN_LSB 1 -#define PHY_ANALOG_RXRF_BIAS2_PKEN_MASK 0x0000000e -#define PHY_ANALOG_RXRF_BIAS2_PKEN_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_ANALOG_RXRF_BIAS2_PKEN_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_ANALOG_RXRF_BIAS2_VCMVALUE_MSB 6 -#define PHY_ANALOG_RXRF_BIAS2_VCMVALUE_LSB 4 -#define PHY_ANALOG_RXRF_BIAS2_VCMVALUE_MASK 0x00000070 -#define PHY_ANALOG_RXRF_BIAS2_VCMVALUE_GET(x) (((x) & 0x00000070) >> 4) -#define PHY_ANALOG_RXRF_BIAS2_VCMVALUE_SET(x) (((x) << 4) & 0x00000070) -#define PHY_ANALOG_RXRF_BIAS2_PWD_VCMBUF_MSB 7 -#define PHY_ANALOG_RXRF_BIAS2_PWD_VCMBUF_LSB 7 -#define PHY_ANALOG_RXRF_BIAS2_PWD_VCMBUF_MASK 0x00000080 -#define PHY_ANALOG_RXRF_BIAS2_PWD_VCMBUF_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RXRF_BIAS2_PWD_VCMBUF_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPAREH_MSB 10 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPAREH_LSB 8 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPAREH_MASK 0x00000700 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPAREH_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPAREH_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPARE_MSB 13 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPARE_LSB 11 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPARE_MASK 0x00003800 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPARE_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPARE_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25LNABUF_MSB 16 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25LNABUF_LSB 14 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25LNABUF_MASK 0x0001c000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25LNABUF_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25LNABUF_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGCH_MSB 19 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGCH_LSB 17 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGCH_MASK 0x000e0000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGCH_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGCH_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC_MSB 22 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC_LSB 20 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC_MASK 0x00700000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC_MSB 25 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC_LSB 23 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC_MASK 0x03800000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25VCMBUF_MSB 28 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25VCMBUF_LSB 26 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25VCMBUF_MASK 0x1c000000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25VCMBUF_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25VCMBUF_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25VCM_MSB 31 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25VCM_LSB 29 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25VCM_MASK 0xe0000000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25VCM_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25VCM_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for RXRF_GAINSTAGES */ -#define PHY_ANALOG_RXRF_GAINSTAGES_ADDRESS 0x00000008 -#define PHY_ANALOG_RXRF_GAINSTAGES_OFFSET 0x00000008 -#define PHY_ANALOG_RXRF_GAINSTAGES_SPARE_MSB 0 -#define PHY_ANALOG_RXRF_GAINSTAGES_SPARE_LSB 0 -#define PHY_ANALOG_RXRF_GAINSTAGES_SPARE_MASK 0x00000001 -#define PHY_ANALOG_RXRF_GAINSTAGES_SPARE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXRF_GAINSTAGES_SPARE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNAON_CALDC_MSB 1 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNAON_CALDC_LSB 1 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNAON_CALDC_MASK 0x00000002 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNAON_CALDC_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNAON_CALDC_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_CAP_MSB 3 -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_CAP_LSB 2 -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_CAP_MASK 0x0000000c -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_CAP_GET(x) (((x) & 0x0000000c) >> 2) -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_CAP_SET(x) (((x) << 2) & 0x0000000c) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_CAP_MSB 5 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_CAP_LSB 4 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_CAP_MASK 0x00000030 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_CAP_GET(x) (((x) & 0x00000030) >> 4) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_CAP_SET(x) (((x) << 4) & 0x00000030) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_SHORTINP_MSB 6 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_SHORTINP_LSB 6 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_SHORTINP_MASK 0x00000040 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_SHORTINP_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_SHORTINP_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO5G_MSB 7 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO5G_LSB 7 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO5G_MASK 0x00000080 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO5G_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO5G_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_VGA5G_MSB 8 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_VGA5G_LSB 8 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_VGA5G_MASK 0x00000100 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_VGA5G_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_VGA5G_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR5G_MSB 9 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR5G_LSB 9 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR5G_MASK 0x00000200 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR5G_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR5G_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA5G_MSB 10 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA5G_LSB 10 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA5G_MASK 0x00000400 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA5G_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA5G_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_CAP_MSB 12 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_CAP_LSB 11 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_CAP_MASK 0x00001800 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_CAP_GET(x) (((x) & 0x00001800) >> 11) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_CAP_SET(x) (((x) << 11) & 0x00001800) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_SHORTINP_MSB 13 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_SHORTINP_LSB 13 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_SHORTINP_MASK 0x00002000 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_SHORTINP_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_SHORTINP_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_LP_MSB 14 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_LP_LSB 14 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_LP_MASK 0x00004000 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_LP_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_LP_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO2G_MSB 15 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO2G_LSB 15 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO2G_MASK 0x00008000 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO2G_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO2G_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR2G_MSB 16 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR2G_LSB 16 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR2G_MASK 0x00010000 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR2G_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR2G_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA2G_MSB 17 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA2G_LSB 17 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA2G_MASK 0x00020000 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA2G_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA2G_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR5G_GAIN_OVR_MSB 19 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR5G_GAIN_OVR_LSB 18 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR5G_GAIN_OVR_MASK 0x000c0000 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR5G_GAIN_OVR_GET(x) (((x) & 0x000c0000) >> 18) -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR5G_GAIN_OVR_SET(x) (((x) << 18) & 0x000c0000) -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_GAIN_OVR_MSB 22 -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_GAIN_OVR_LSB 20 -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_GAIN_OVR_MASK 0x00700000 -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_GAIN_OVR_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_GAIN_OVR_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_MSB 25 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_LSB 23 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_MASK 0x03800000 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR2G_GAIN_OVR_MSB 27 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR2G_GAIN_OVR_LSB 26 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR2G_GAIN_OVR_MASK 0x0c000000 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR2G_GAIN_OVR_GET(x) (((x) & 0x0c000000) >> 26) -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR2G_GAIN_OVR_SET(x) (((x) << 26) & 0x0c000000) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_MSB 30 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_LSB 28 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_MASK 0x70000000 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_GET(x) (((x) & 0x70000000) >> 28) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_SET(x) (((x) << 28) & 0x70000000) -#define PHY_ANALOG_RXRF_GAINSTAGES_RX_OVERRIDE_MSB 31 -#define PHY_ANALOG_RXRF_GAINSTAGES_RX_OVERRIDE_LSB 31 -#define PHY_ANALOG_RXRF_GAINSTAGES_RX_OVERRIDE_MASK 0x80000000 -#define PHY_ANALOG_RXRF_GAINSTAGES_RX_OVERRIDE_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_RXRF_GAINSTAGES_RX_OVERRIDE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for RXRF_AGC */ -#define PHY_ANALOG_RXRF_AGC_ADDRESS 0x0000000c -#define PHY_ANALOG_RXRF_AGC_OFFSET 0x0000000c -#define PHY_ANALOG_RXRF_AGC_RF5G_ON_DURING_CALPA_MSB 0 -#define PHY_ANALOG_RXRF_AGC_RF5G_ON_DURING_CALPA_LSB 0 -#define PHY_ANALOG_RXRF_AGC_RF5G_ON_DURING_CALPA_MASK 0x00000001 -#define PHY_ANALOG_RXRF_AGC_RF5G_ON_DURING_CALPA_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXRF_AGC_RF5G_ON_DURING_CALPA_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXRF_AGC_RF2G_ON_DURING_CALPA_MSB 1 -#define PHY_ANALOG_RXRF_AGC_RF2G_ON_DURING_CALPA_LSB 1 -#define PHY_ANALOG_RXRF_AGC_RF2G_ON_DURING_CALPA_MASK 0x00000002 -#define PHY_ANALOG_RXRF_AGC_RF2G_ON_DURING_CALPA_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_RXRF_AGC_RF2G_ON_DURING_CALPA_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_RXRF_AGC_AGC_OUT_MSB 2 -#define PHY_ANALOG_RXRF_AGC_AGC_OUT_LSB 2 -#define PHY_ANALOG_RXRF_AGC_AGC_OUT_MASK 0x00000004 -#define PHY_ANALOG_RXRF_AGC_AGC_OUT_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_RXRF_AGC_LNABUFGAIN2X_MSB 3 -#define PHY_ANALOG_RXRF_AGC_LNABUFGAIN2X_LSB 3 -#define PHY_ANALOG_RXRF_AGC_LNABUFGAIN2X_MASK 0x00000008 -#define PHY_ANALOG_RXRF_AGC_LNABUFGAIN2X_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_RXRF_AGC_LNABUFGAIN2X_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_RXRF_AGC_LNABUF_PWD_OVR_MSB 4 -#define PHY_ANALOG_RXRF_AGC_LNABUF_PWD_OVR_LSB 4 -#define PHY_ANALOG_RXRF_AGC_LNABUF_PWD_OVR_MASK 0x00000010 -#define PHY_ANALOG_RXRF_AGC_LNABUF_PWD_OVR_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_RXRF_AGC_LNABUF_PWD_OVR_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_RXRF_AGC_PWD_LNABUF_MSB 5 -#define PHY_ANALOG_RXRF_AGC_PWD_LNABUF_LSB 5 -#define PHY_ANALOG_RXRF_AGC_PWD_LNABUF_MASK 0x00000020 -#define PHY_ANALOG_RXRF_AGC_PWD_LNABUF_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_RXRF_AGC_PWD_LNABUF_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_RXRF_AGC_AGC_FALL_CTRL_MSB 8 -#define PHY_ANALOG_RXRF_AGC_AGC_FALL_CTRL_LSB 6 -#define PHY_ANALOG_RXRF_AGC_AGC_FALL_CTRL_MASK 0x000001c0 -#define PHY_ANALOG_RXRF_AGC_AGC_FALL_CTRL_GET(x) (((x) & 0x000001c0) >> 6) -#define PHY_ANALOG_RXRF_AGC_AGC_FALL_CTRL_SET(x) (((x) << 6) & 0x000001c0) -#define PHY_ANALOG_RXRF_AGC_AGC5G_CALDAC_OVR_MSB 14 -#define PHY_ANALOG_RXRF_AGC_AGC5G_CALDAC_OVR_LSB 9 -#define PHY_ANALOG_RXRF_AGC_AGC5G_CALDAC_OVR_MASK 0x00007e00 -#define PHY_ANALOG_RXRF_AGC_AGC5G_CALDAC_OVR_GET(x) (((x) & 0x00007e00) >> 9) -#define PHY_ANALOG_RXRF_AGC_AGC5G_CALDAC_OVR_SET(x) (((x) << 9) & 0x00007e00) -#define PHY_ANALOG_RXRF_AGC_AGC5G_DBDAC_OVR_MSB 18 -#define PHY_ANALOG_RXRF_AGC_AGC5G_DBDAC_OVR_LSB 15 -#define PHY_ANALOG_RXRF_AGC_AGC5G_DBDAC_OVR_MASK 0x00078000 -#define PHY_ANALOG_RXRF_AGC_AGC5G_DBDAC_OVR_GET(x) (((x) & 0x00078000) >> 15) -#define PHY_ANALOG_RXRF_AGC_AGC5G_DBDAC_OVR_SET(x) (((x) << 15) & 0x00078000) -#define PHY_ANALOG_RXRF_AGC_AGC2G_CALDAC_OVR_MSB 24 -#define PHY_ANALOG_RXRF_AGC_AGC2G_CALDAC_OVR_LSB 19 -#define PHY_ANALOG_RXRF_AGC_AGC2G_CALDAC_OVR_MASK 0x01f80000 -#define PHY_ANALOG_RXRF_AGC_AGC2G_CALDAC_OVR_GET(x) (((x) & 0x01f80000) >> 19) -#define PHY_ANALOG_RXRF_AGC_AGC2G_CALDAC_OVR_SET(x) (((x) << 19) & 0x01f80000) -#define PHY_ANALOG_RXRF_AGC_AGC2G_DBDAC_OVR_MSB 28 -#define PHY_ANALOG_RXRF_AGC_AGC2G_DBDAC_OVR_LSB 25 -#define PHY_ANALOG_RXRF_AGC_AGC2G_DBDAC_OVR_MASK 0x1e000000 -#define PHY_ANALOG_RXRF_AGC_AGC2G_DBDAC_OVR_GET(x) (((x) & 0x1e000000) >> 25) -#define PHY_ANALOG_RXRF_AGC_AGC2G_DBDAC_OVR_SET(x) (((x) << 25) & 0x1e000000) -#define PHY_ANALOG_RXRF_AGC_AGC_CAL_OVR_MSB 29 -#define PHY_ANALOG_RXRF_AGC_AGC_CAL_OVR_LSB 29 -#define PHY_ANALOG_RXRF_AGC_AGC_CAL_OVR_MASK 0x20000000 -#define PHY_ANALOG_RXRF_AGC_AGC_CAL_OVR_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_RXRF_AGC_AGC_CAL_OVR_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_RXRF_AGC_AGC_ON_OVR_MSB 30 -#define PHY_ANALOG_RXRF_AGC_AGC_ON_OVR_LSB 30 -#define PHY_ANALOG_RXRF_AGC_AGC_ON_OVR_MASK 0x40000000 -#define PHY_ANALOG_RXRF_AGC_AGC_ON_OVR_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_RXRF_AGC_AGC_ON_OVR_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_RXRF_AGC_AGC_OVERRIDE_MSB 31 -#define PHY_ANALOG_RXRF_AGC_AGC_OVERRIDE_LSB 31 -#define PHY_ANALOG_RXRF_AGC_AGC_OVERRIDE_MASK 0x80000000 -#define PHY_ANALOG_RXRF_AGC_AGC_OVERRIDE_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_RXRF_AGC_AGC_OVERRIDE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for TXRF1 */ -#define PHY_ANALOG_TXRF1_ADDRESS 0x00000040 -#define PHY_ANALOG_TXRF1_OFFSET 0x00000040 -#define PHY_ANALOG_TXRF1_PDLOBUF5G_MSB 0 -#define PHY_ANALOG_TXRF1_PDLOBUF5G_LSB 0 -#define PHY_ANALOG_TXRF1_PDLOBUF5G_MASK 0x00000001 -#define PHY_ANALOG_TXRF1_PDLOBUF5G_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_TXRF1_PDLOBUF5G_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_TXRF1_PDLODIV5G_MSB 1 -#define PHY_ANALOG_TXRF1_PDLODIV5G_LSB 1 -#define PHY_ANALOG_TXRF1_PDLODIV5G_MASK 0x00000002 -#define PHY_ANALOG_TXRF1_PDLODIV5G_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_TXRF1_PDLODIV5G_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_TXRF1_LOBUF5GFORCED_MSB 2 -#define PHY_ANALOG_TXRF1_LOBUF5GFORCED_LSB 2 -#define PHY_ANALOG_TXRF1_LOBUF5GFORCED_MASK 0x00000004 -#define PHY_ANALOG_TXRF1_LOBUF5GFORCED_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_TXRF1_LOBUF5GFORCED_SET(x) (((x) << 2) & 0x00000004) -#define PHY_ANALOG_TXRF1_LODIV5GFORCED_MSB 3 -#define PHY_ANALOG_TXRF1_LODIV5GFORCED_LSB 3 -#define PHY_ANALOG_TXRF1_LODIV5GFORCED_MASK 0x00000008 -#define PHY_ANALOG_TXRF1_LODIV5GFORCED_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_TXRF1_LODIV5GFORCED_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_TXRF1_PADRV2GN5G_MSB 7 -#define PHY_ANALOG_TXRF1_PADRV2GN5G_LSB 4 -#define PHY_ANALOG_TXRF1_PADRV2GN5G_MASK 0x000000f0 -#define PHY_ANALOG_TXRF1_PADRV2GN5G_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_ANALOG_TXRF1_PADRV2GN5G_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_ANALOG_TXRF1_PADRV3GN5G_MSB 11 -#define PHY_ANALOG_TXRF1_PADRV3GN5G_LSB 8 -#define PHY_ANALOG_TXRF1_PADRV3GN5G_MASK 0x00000f00 -#define PHY_ANALOG_TXRF1_PADRV3GN5G_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_TXRF1_PADRV3GN5G_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_TXRF1_PADRV4GN5G_MSB 15 -#define PHY_ANALOG_TXRF1_PADRV4GN5G_LSB 12 -#define PHY_ANALOG_TXRF1_PADRV4GN5G_MASK 0x0000f000 -#define PHY_ANALOG_TXRF1_PADRV4GN5G_GET(x) (((x) & 0x0000f000) >> 12) -#define PHY_ANALOG_TXRF1_PADRV4GN5G_SET(x) (((x) << 12) & 0x0000f000) -#define PHY_ANALOG_TXRF1_LOCALTXGAIN5G_MSB 16 -#define PHY_ANALOG_TXRF1_LOCALTXGAIN5G_LSB 16 -#define PHY_ANALOG_TXRF1_LOCALTXGAIN5G_MASK 0x00010000 -#define PHY_ANALOG_TXRF1_LOCALTXGAIN5G_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_TXRF1_LOCALTXGAIN5G_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_TXRF1_PDOUT2G_MSB 17 -#define PHY_ANALOG_TXRF1_PDOUT2G_LSB 17 -#define PHY_ANALOG_TXRF1_PDOUT2G_MASK 0x00020000 -#define PHY_ANALOG_TXRF1_PDOUT2G_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_TXRF1_PDOUT2G_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_TXRF1_PDDR2G_MSB 18 -#define PHY_ANALOG_TXRF1_PDDR2G_LSB 18 -#define PHY_ANALOG_TXRF1_PDDR2G_MASK 0x00040000 -#define PHY_ANALOG_TXRF1_PDDR2G_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_TXRF1_PDDR2G_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_TXRF1_PDMXR2G_MSB 19 -#define PHY_ANALOG_TXRF1_PDMXR2G_LSB 19 -#define PHY_ANALOG_TXRF1_PDMXR2G_MASK 0x00080000 -#define PHY_ANALOG_TXRF1_PDMXR2G_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_ANALOG_TXRF1_PDMXR2G_SET(x) (((x) << 19) & 0x00080000) -#define PHY_ANALOG_TXRF1_PDLOBUF2G_MSB 20 -#define PHY_ANALOG_TXRF1_PDLOBUF2G_LSB 20 -#define PHY_ANALOG_TXRF1_PDLOBUF2G_MASK 0x00100000 -#define PHY_ANALOG_TXRF1_PDLOBUF2G_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_TXRF1_PDLOBUF2G_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_TXRF1_PDLODIV2G_MSB 21 -#define PHY_ANALOG_TXRF1_PDLODIV2G_LSB 21 -#define PHY_ANALOG_TXRF1_PDLODIV2G_MASK 0x00200000 -#define PHY_ANALOG_TXRF1_PDLODIV2G_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_TXRF1_PDLODIV2G_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_TXRF1_LOBUF2GFORCED_MSB 22 -#define PHY_ANALOG_TXRF1_LOBUF2GFORCED_LSB 22 -#define PHY_ANALOG_TXRF1_LOBUF2GFORCED_MASK 0x00400000 -#define PHY_ANALOG_TXRF1_LOBUF2GFORCED_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_TXRF1_LOBUF2GFORCED_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_TXRF1_LODIV2GFORCED_MSB 23 -#define PHY_ANALOG_TXRF1_LODIV2GFORCED_LSB 23 -#define PHY_ANALOG_TXRF1_LODIV2GFORCED_MASK 0x00800000 -#define PHY_ANALOG_TXRF1_LODIV2GFORCED_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_TXRF1_LODIV2GFORCED_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_TXRF1_PADRVGN2G_MSB 30 -#define PHY_ANALOG_TXRF1_PADRVGN2G_LSB 24 -#define PHY_ANALOG_TXRF1_PADRVGN2G_MASK 0x7f000000 -#define PHY_ANALOG_TXRF1_PADRVGN2G_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_ANALOG_TXRF1_PADRVGN2G_SET(x) (((x) << 24) & 0x7f000000) -#define PHY_ANALOG_TXRF1_LOCALTXGAIN2G_MSB 31 -#define PHY_ANALOG_TXRF1_LOCALTXGAIN2G_LSB 31 -#define PHY_ANALOG_TXRF1_LOCALTXGAIN2G_MASK 0x80000000 -#define PHY_ANALOG_TXRF1_LOCALTXGAIN2G_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_TXRF1_LOCALTXGAIN2G_SET(x) (((x) << 31) & 0x80000000) - -/* macros for TXRF2 */ -#define PHY_ANALOG_TXRF2_ADDRESS 0x00000044 -#define PHY_ANALOG_TXRF2_OFFSET 0x00000044 -#define PHY_ANALOG_TXRF2_D3B5G_MSB 2 -#define PHY_ANALOG_TXRF2_D3B5G_LSB 0 -#define PHY_ANALOG_TXRF2_D3B5G_MASK 0x00000007 -#define PHY_ANALOG_TXRF2_D3B5G_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_TXRF2_D3B5G_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_TXRF2_D4B5G_MSB 5 -#define PHY_ANALOG_TXRF2_D4B5G_LSB 3 -#define PHY_ANALOG_TXRF2_D4B5G_MASK 0x00000038 -#define PHY_ANALOG_TXRF2_D4B5G_GET(x) (((x) & 0x00000038) >> 3) -#define PHY_ANALOG_TXRF2_D4B5G_SET(x) (((x) << 3) & 0x00000038) -#define PHY_ANALOG_TXRF2_OCAS2G_MSB 8 -#define PHY_ANALOG_TXRF2_OCAS2G_LSB 6 -#define PHY_ANALOG_TXRF2_OCAS2G_MASK 0x000001c0 -#define PHY_ANALOG_TXRF2_OCAS2G_GET(x) (((x) & 0x000001c0) >> 6) -#define PHY_ANALOG_TXRF2_OCAS2G_SET(x) (((x) << 6) & 0x000001c0) -#define PHY_ANALOG_TXRF2_DCAS2G_MSB 11 -#define PHY_ANALOG_TXRF2_DCAS2G_LSB 9 -#define PHY_ANALOG_TXRF2_DCAS2G_MASK 0x00000e00 -#define PHY_ANALOG_TXRF2_DCAS2G_GET(x) (((x) & 0x00000e00) >> 9) -#define PHY_ANALOG_TXRF2_DCAS2G_SET(x) (((x) << 9) & 0x00000e00) -#define PHY_ANALOG_TXRF2_OB2G_PALOFF_MSB 14 -#define PHY_ANALOG_TXRF2_OB2G_PALOFF_LSB 12 -#define PHY_ANALOG_TXRF2_OB2G_PALOFF_MASK 0x00007000 -#define PHY_ANALOG_TXRF2_OB2G_PALOFF_GET(x) (((x) & 0x00007000) >> 12) -#define PHY_ANALOG_TXRF2_OB2G_PALOFF_SET(x) (((x) << 12) & 0x00007000) -#define PHY_ANALOG_TXRF2_OB2G_QAM_MSB 17 -#define PHY_ANALOG_TXRF2_OB2G_QAM_LSB 15 -#define PHY_ANALOG_TXRF2_OB2G_QAM_MASK 0x00038000 -#define PHY_ANALOG_TXRF2_OB2G_QAM_GET(x) (((x) & 0x00038000) >> 15) -#define PHY_ANALOG_TXRF2_OB2G_QAM_SET(x) (((x) << 15) & 0x00038000) -#define PHY_ANALOG_TXRF2_OB2G_PSK_MSB 20 -#define PHY_ANALOG_TXRF2_OB2G_PSK_LSB 18 -#define PHY_ANALOG_TXRF2_OB2G_PSK_MASK 0x001c0000 -#define PHY_ANALOG_TXRF2_OB2G_PSK_GET(x) (((x) & 0x001c0000) >> 18) -#define PHY_ANALOG_TXRF2_OB2G_PSK_SET(x) (((x) << 18) & 0x001c0000) -#define PHY_ANALOG_TXRF2_OB2G_CCK_MSB 23 -#define PHY_ANALOG_TXRF2_OB2G_CCK_LSB 21 -#define PHY_ANALOG_TXRF2_OB2G_CCK_MASK 0x00e00000 -#define PHY_ANALOG_TXRF2_OB2G_CCK_GET(x) (((x) & 0x00e00000) >> 21) -#define PHY_ANALOG_TXRF2_OB2G_CCK_SET(x) (((x) << 21) & 0x00e00000) -#define PHY_ANALOG_TXRF2_DB2G_MSB 26 -#define PHY_ANALOG_TXRF2_DB2G_LSB 24 -#define PHY_ANALOG_TXRF2_DB2G_MASK 0x07000000 -#define PHY_ANALOG_TXRF2_DB2G_GET(x) (((x) & 0x07000000) >> 24) -#define PHY_ANALOG_TXRF2_DB2G_SET(x) (((x) << 24) & 0x07000000) -#define PHY_ANALOG_TXRF2_PDOUT5G_MSB 30 -#define PHY_ANALOG_TXRF2_PDOUT5G_LSB 27 -#define PHY_ANALOG_TXRF2_PDOUT5G_MASK 0x78000000 -#define PHY_ANALOG_TXRF2_PDOUT5G_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_ANALOG_TXRF2_PDOUT5G_SET(x) (((x) << 27) & 0x78000000) -#define PHY_ANALOG_TXRF2_PDMXR5G_MSB 31 -#define PHY_ANALOG_TXRF2_PDMXR5G_LSB 31 -#define PHY_ANALOG_TXRF2_PDMXR5G_MASK 0x80000000 -#define PHY_ANALOG_TXRF2_PDMXR5G_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_TXRF2_PDMXR5G_SET(x) (((x) << 31) & 0x80000000) - -/* macros for TXRF3 */ -#define PHY_ANALOG_TXRF3_ADDRESS 0x00000048 -#define PHY_ANALOG_TXRF3_OFFSET 0x00000048 -#define PHY_ANALOG_TXRF3_FILTR2G_MSB 1 -#define PHY_ANALOG_TXRF3_FILTR2G_LSB 0 -#define PHY_ANALOG_TXRF3_FILTR2G_MASK 0x00000003 -#define PHY_ANALOG_TXRF3_FILTR2G_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF3_FILTR2G_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF3_PWDFB2_2G_MSB 2 -#define PHY_ANALOG_TXRF3_PWDFB2_2G_LSB 2 -#define PHY_ANALOG_TXRF3_PWDFB2_2G_MASK 0x00000004 -#define PHY_ANALOG_TXRF3_PWDFB2_2G_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_TXRF3_PWDFB2_2G_SET(x) (((x) << 2) & 0x00000004) -#define PHY_ANALOG_TXRF3_PWDFB1_2G_MSB 3 -#define PHY_ANALOG_TXRF3_PWDFB1_2G_LSB 3 -#define PHY_ANALOG_TXRF3_PWDFB1_2G_MASK 0x00000008 -#define PHY_ANALOG_TXRF3_PWDFB1_2G_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_TXRF3_PWDFB1_2G_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_TXRF3_PDFB2G_MSB 4 -#define PHY_ANALOG_TXRF3_PDFB2G_LSB 4 -#define PHY_ANALOG_TXRF3_PDFB2G_MASK 0x00000010 -#define PHY_ANALOG_TXRF3_PDFB2G_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_TXRF3_PDFB2G_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_TXRF3_RDIV5G_MSB 6 -#define PHY_ANALOG_TXRF3_RDIV5G_LSB 5 -#define PHY_ANALOG_TXRF3_RDIV5G_MASK 0x00000060 -#define PHY_ANALOG_TXRF3_RDIV5G_GET(x) (((x) & 0x00000060) >> 5) -#define PHY_ANALOG_TXRF3_RDIV5G_SET(x) (((x) << 5) & 0x00000060) -#define PHY_ANALOG_TXRF3_CAPDIV5G_MSB 9 -#define PHY_ANALOG_TXRF3_CAPDIV5G_LSB 7 -#define PHY_ANALOG_TXRF3_CAPDIV5G_MASK 0x00000380 -#define PHY_ANALOG_TXRF3_CAPDIV5G_GET(x) (((x) & 0x00000380) >> 7) -#define PHY_ANALOG_TXRF3_CAPDIV5G_SET(x) (((x) << 7) & 0x00000380) -#define PHY_ANALOG_TXRF3_PDPREDIST5G_MSB 10 -#define PHY_ANALOG_TXRF3_PDPREDIST5G_LSB 10 -#define PHY_ANALOG_TXRF3_PDPREDIST5G_MASK 0x00000400 -#define PHY_ANALOG_TXRF3_PDPREDIST5G_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_TXRF3_PDPREDIST5G_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_TXRF3_RDIV2G_MSB 12 -#define PHY_ANALOG_TXRF3_RDIV2G_LSB 11 -#define PHY_ANALOG_TXRF3_RDIV2G_MASK 0x00001800 -#define PHY_ANALOG_TXRF3_RDIV2G_GET(x) (((x) & 0x00001800) >> 11) -#define PHY_ANALOG_TXRF3_RDIV2G_SET(x) (((x) << 11) & 0x00001800) -#define PHY_ANALOG_TXRF3_PDPREDIST2G_MSB 13 -#define PHY_ANALOG_TXRF3_PDPREDIST2G_LSB 13 -#define PHY_ANALOG_TXRF3_PDPREDIST2G_MASK 0x00002000 -#define PHY_ANALOG_TXRF3_PDPREDIST2G_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_TXRF3_PDPREDIST2G_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_TXRF3_OCAS5G_MSB 16 -#define PHY_ANALOG_TXRF3_OCAS5G_LSB 14 -#define PHY_ANALOG_TXRF3_OCAS5G_MASK 0x0001c000 -#define PHY_ANALOG_TXRF3_OCAS5G_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_TXRF3_OCAS5G_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_TXRF3_D2CAS5G_MSB 19 -#define PHY_ANALOG_TXRF3_D2CAS5G_LSB 17 -#define PHY_ANALOG_TXRF3_D2CAS5G_MASK 0x000e0000 -#define PHY_ANALOG_TXRF3_D2CAS5G_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_TXRF3_D2CAS5G_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_TXRF3_D3CAS5G_MSB 22 -#define PHY_ANALOG_TXRF3_D3CAS5G_LSB 20 -#define PHY_ANALOG_TXRF3_D3CAS5G_MASK 0x00700000 -#define PHY_ANALOG_TXRF3_D3CAS5G_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_TXRF3_D3CAS5G_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_TXRF3_D4CAS5G_MSB 25 -#define PHY_ANALOG_TXRF3_D4CAS5G_LSB 23 -#define PHY_ANALOG_TXRF3_D4CAS5G_MASK 0x03800000 -#define PHY_ANALOG_TXRF3_D4CAS5G_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_TXRF3_D4CAS5G_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_TXRF3_OB5G_MSB 28 -#define PHY_ANALOG_TXRF3_OB5G_LSB 26 -#define PHY_ANALOG_TXRF3_OB5G_MASK 0x1c000000 -#define PHY_ANALOG_TXRF3_OB5G_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_TXRF3_OB5G_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_TXRF3_D2B5G_MSB 31 -#define PHY_ANALOG_TXRF3_D2B5G_LSB 29 -#define PHY_ANALOG_TXRF3_D2B5G_MASK 0xe0000000 -#define PHY_ANALOG_TXRF3_D2B5G_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_TXRF3_D2B5G_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for TXRF4 */ -#define PHY_ANALOG_TXRF4_ADDRESS 0x0000004c -#define PHY_ANALOG_TXRF4_OFFSET 0x0000004c -#define PHY_ANALOG_TXRF4_PK1B2G_CCK_MSB 1 -#define PHY_ANALOG_TXRF4_PK1B2G_CCK_LSB 0 -#define PHY_ANALOG_TXRF4_PK1B2G_CCK_MASK 0x00000003 -#define PHY_ANALOG_TXRF4_PK1B2G_CCK_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF4_PK1B2G_CCK_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF4_MIOB2G_QAM_MSB 4 -#define PHY_ANALOG_TXRF4_MIOB2G_QAM_LSB 2 -#define PHY_ANALOG_TXRF4_MIOB2G_QAM_MASK 0x0000001c -#define PHY_ANALOG_TXRF4_MIOB2G_QAM_GET(x) (((x) & 0x0000001c) >> 2) -#define PHY_ANALOG_TXRF4_MIOB2G_QAM_SET(x) (((x) << 2) & 0x0000001c) -#define PHY_ANALOG_TXRF4_MIOB2G_PSK_MSB 7 -#define PHY_ANALOG_TXRF4_MIOB2G_PSK_LSB 5 -#define PHY_ANALOG_TXRF4_MIOB2G_PSK_MASK 0x000000e0 -#define PHY_ANALOG_TXRF4_MIOB2G_PSK_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_TXRF4_MIOB2G_PSK_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_TXRF4_MIOB2G_CCK_MSB 10 -#define PHY_ANALOG_TXRF4_MIOB2G_CCK_LSB 8 -#define PHY_ANALOG_TXRF4_MIOB2G_CCK_MASK 0x00000700 -#define PHY_ANALOG_TXRF4_MIOB2G_CCK_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_TXRF4_MIOB2G_CCK_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_TXRF4_COMP2G_QAM_MSB 13 -#define PHY_ANALOG_TXRF4_COMP2G_QAM_LSB 11 -#define PHY_ANALOG_TXRF4_COMP2G_QAM_MASK 0x00003800 -#define PHY_ANALOG_TXRF4_COMP2G_QAM_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_TXRF4_COMP2G_QAM_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_TXRF4_COMP2G_PSK_MSB 16 -#define PHY_ANALOG_TXRF4_COMP2G_PSK_LSB 14 -#define PHY_ANALOG_TXRF4_COMP2G_PSK_MASK 0x0001c000 -#define PHY_ANALOG_TXRF4_COMP2G_PSK_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_TXRF4_COMP2G_PSK_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_TXRF4_COMP2G_CCK_MSB 19 -#define PHY_ANALOG_TXRF4_COMP2G_CCK_LSB 17 -#define PHY_ANALOG_TXRF4_COMP2G_CCK_MASK 0x000e0000 -#define PHY_ANALOG_TXRF4_COMP2G_CCK_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_TXRF4_COMP2G_CCK_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_TXRF4_AMP2B2G_QAM_MSB 22 -#define PHY_ANALOG_TXRF4_AMP2B2G_QAM_LSB 20 -#define PHY_ANALOG_TXRF4_AMP2B2G_QAM_MASK 0x00700000 -#define PHY_ANALOG_TXRF4_AMP2B2G_QAM_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_TXRF4_AMP2B2G_QAM_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_TXRF4_AMP2B2G_PSK_MSB 25 -#define PHY_ANALOG_TXRF4_AMP2B2G_PSK_LSB 23 -#define PHY_ANALOG_TXRF4_AMP2B2G_PSK_MASK 0x03800000 -#define PHY_ANALOG_TXRF4_AMP2B2G_PSK_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_TXRF4_AMP2B2G_PSK_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_TXRF4_AMP2B2G_CCK_MSB 28 -#define PHY_ANALOG_TXRF4_AMP2B2G_CCK_LSB 26 -#define PHY_ANALOG_TXRF4_AMP2B2G_CCK_MASK 0x1c000000 -#define PHY_ANALOG_TXRF4_AMP2B2G_CCK_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_TXRF4_AMP2B2G_CCK_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_TXRF4_AMP2CAS2G_MSB 31 -#define PHY_ANALOG_TXRF4_AMP2CAS2G_LSB 29 -#define PHY_ANALOG_TXRF4_AMP2CAS2G_MASK 0xe0000000 -#define PHY_ANALOG_TXRF4_AMP2CAS2G_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_TXRF4_AMP2CAS2G_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for TXRF5 */ -#define PHY_ANALOG_TXRF5_ADDRESS 0x00000050 -#define PHY_ANALOG_TXRF5_OFFSET 0x00000050 -#define PHY_ANALOG_TXRF5_SPARE5_MSB 0 -#define PHY_ANALOG_TXRF5_SPARE5_LSB 0 -#define PHY_ANALOG_TXRF5_SPARE5_MASK 0x00000001 -#define PHY_ANALOG_TXRF5_SPARE5_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_TXRF5_SPARE5_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_TXRF5_PAL_LOCKED_MSB 1 -#define PHY_ANALOG_TXRF5_PAL_LOCKED_LSB 1 -#define PHY_ANALOG_TXRF5_PAL_LOCKED_MASK 0x00000002 -#define PHY_ANALOG_TXRF5_PAL_LOCKED_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_TXRF5_FBHI2G_MSB 2 -#define PHY_ANALOG_TXRF5_FBHI2G_LSB 2 -#define PHY_ANALOG_TXRF5_FBHI2G_MASK 0x00000004 -#define PHY_ANALOG_TXRF5_FBHI2G_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_TXRF5_FBLO2G_MSB 3 -#define PHY_ANALOG_TXRF5_FBLO2G_LSB 3 -#define PHY_ANALOG_TXRF5_FBLO2G_MASK 0x00000008 -#define PHY_ANALOG_TXRF5_FBLO2G_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_TXRF5_NOPALGAIN2G_MSB 4 -#define PHY_ANALOG_TXRF5_NOPALGAIN2G_LSB 4 -#define PHY_ANALOG_TXRF5_NOPALGAIN2G_MASK 0x00000010 -#define PHY_ANALOG_TXRF5_NOPALGAIN2G_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_TXRF5_NOPALGAIN2G_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_TXRF5_ENPACAL2G_MSB 5 -#define PHY_ANALOG_TXRF5_ENPACAL2G_LSB 5 -#define PHY_ANALOG_TXRF5_ENPACAL2G_MASK 0x00000020 -#define PHY_ANALOG_TXRF5_ENPACAL2G_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_TXRF5_ENPACAL2G_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_TXRF5_OFFSET2G_MSB 12 -#define PHY_ANALOG_TXRF5_OFFSET2G_LSB 6 -#define PHY_ANALOG_TXRF5_OFFSET2G_MASK 0x00001fc0 -#define PHY_ANALOG_TXRF5_OFFSET2G_GET(x) (((x) & 0x00001fc0) >> 6) -#define PHY_ANALOG_TXRF5_OFFSET2G_SET(x) (((x) << 6) & 0x00001fc0) -#define PHY_ANALOG_TXRF5_ENOFFSETCAL2G_MSB 13 -#define PHY_ANALOG_TXRF5_ENOFFSETCAL2G_LSB 13 -#define PHY_ANALOG_TXRF5_ENOFFSETCAL2G_MASK 0x00002000 -#define PHY_ANALOG_TXRF5_ENOFFSETCAL2G_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_TXRF5_ENOFFSETCAL2G_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_TXRF5_REFHI2G_MSB 16 -#define PHY_ANALOG_TXRF5_REFHI2G_LSB 14 -#define PHY_ANALOG_TXRF5_REFHI2G_MASK 0x0001c000 -#define PHY_ANALOG_TXRF5_REFHI2G_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_TXRF5_REFHI2G_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_TXRF5_REFLO2G_MSB 19 -#define PHY_ANALOG_TXRF5_REFLO2G_LSB 17 -#define PHY_ANALOG_TXRF5_REFLO2G_MASK 0x000e0000 -#define PHY_ANALOG_TXRF5_REFLO2G_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_TXRF5_REFLO2G_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_TXRF5_PALCLAMP2G_MSB 21 -#define PHY_ANALOG_TXRF5_PALCLAMP2G_LSB 20 -#define PHY_ANALOG_TXRF5_PALCLAMP2G_MASK 0x00300000 -#define PHY_ANALOG_TXRF5_PALCLAMP2G_GET(x) (((x) & 0x00300000) >> 20) -#define PHY_ANALOG_TXRF5_PALCLAMP2G_SET(x) (((x) << 20) & 0x00300000) -#define PHY_ANALOG_TXRF5_PK2B2G_QAM_MSB 23 -#define PHY_ANALOG_TXRF5_PK2B2G_QAM_LSB 22 -#define PHY_ANALOG_TXRF5_PK2B2G_QAM_MASK 0x00c00000 -#define PHY_ANALOG_TXRF5_PK2B2G_QAM_GET(x) (((x) & 0x00c00000) >> 22) -#define PHY_ANALOG_TXRF5_PK2B2G_QAM_SET(x) (((x) << 22) & 0x00c00000) -#define PHY_ANALOG_TXRF5_PK2B2G_PSK_MSB 25 -#define PHY_ANALOG_TXRF5_PK2B2G_PSK_LSB 24 -#define PHY_ANALOG_TXRF5_PK2B2G_PSK_MASK 0x03000000 -#define PHY_ANALOG_TXRF5_PK2B2G_PSK_GET(x) (((x) & 0x03000000) >> 24) -#define PHY_ANALOG_TXRF5_PK2B2G_PSK_SET(x) (((x) << 24) & 0x03000000) -#define PHY_ANALOG_TXRF5_PK2B2G_CCK_MSB 27 -#define PHY_ANALOG_TXRF5_PK2B2G_CCK_LSB 26 -#define PHY_ANALOG_TXRF5_PK2B2G_CCK_MASK 0x0c000000 -#define PHY_ANALOG_TXRF5_PK2B2G_CCK_GET(x) (((x) & 0x0c000000) >> 26) -#define PHY_ANALOG_TXRF5_PK2B2G_CCK_SET(x) (((x) << 26) & 0x0c000000) -#define PHY_ANALOG_TXRF5_PK1B2G_QAM_MSB 29 -#define PHY_ANALOG_TXRF5_PK1B2G_QAM_LSB 28 -#define PHY_ANALOG_TXRF5_PK1B2G_QAM_MASK 0x30000000 -#define PHY_ANALOG_TXRF5_PK1B2G_QAM_GET(x) (((x) & 0x30000000) >> 28) -#define PHY_ANALOG_TXRF5_PK1B2G_QAM_SET(x) (((x) << 28) & 0x30000000) -#define PHY_ANALOG_TXRF5_PK1B2G_PSK_MSB 31 -#define PHY_ANALOG_TXRF5_PK1B2G_PSK_LSB 30 -#define PHY_ANALOG_TXRF5_PK1B2G_PSK_MASK 0xc0000000 -#define PHY_ANALOG_TXRF5_PK1B2G_PSK_GET(x) (((x) & 0xc0000000) >> 30) -#define PHY_ANALOG_TXRF5_PK1B2G_PSK_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for TXRF6 */ -#define PHY_ANALOG_TXRF6_ADDRESS 0x00000054 -#define PHY_ANALOG_TXRF6_OFFSET 0x00000054 -#define PHY_ANALOG_TXRF6_PALCLKGATE2G_MSB 0 -#define PHY_ANALOG_TXRF6_PALCLKGATE2G_LSB 0 -#define PHY_ANALOG_TXRF6_PALCLKGATE2G_MASK 0x00000001 -#define PHY_ANALOG_TXRF6_PALCLKGATE2G_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_TXRF6_PALCLKGATE2G_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_TXRF6_PALFLUCTCOUNT2G_MSB 8 -#define PHY_ANALOG_TXRF6_PALFLUCTCOUNT2G_LSB 1 -#define PHY_ANALOG_TXRF6_PALFLUCTCOUNT2G_MASK 0x000001fe -#define PHY_ANALOG_TXRF6_PALFLUCTCOUNT2G_GET(x) (((x) & 0x000001fe) >> 1) -#define PHY_ANALOG_TXRF6_PALFLUCTCOUNT2G_SET(x) (((x) << 1) & 0x000001fe) -#define PHY_ANALOG_TXRF6_PALFLUCTGAIN2G_MSB 10 -#define PHY_ANALOG_TXRF6_PALFLUCTGAIN2G_LSB 9 -#define PHY_ANALOG_TXRF6_PALFLUCTGAIN2G_MASK 0x00000600 -#define PHY_ANALOG_TXRF6_PALFLUCTGAIN2G_GET(x) (((x) & 0x00000600) >> 9) -#define PHY_ANALOG_TXRF6_PALFLUCTGAIN2G_SET(x) (((x) << 9) & 0x00000600) -#define PHY_ANALOG_TXRF6_PALNOFLUCT2G_MSB 11 -#define PHY_ANALOG_TXRF6_PALNOFLUCT2G_LSB 11 -#define PHY_ANALOG_TXRF6_PALNOFLUCT2G_MASK 0x00000800 -#define PHY_ANALOG_TXRF6_PALNOFLUCT2G_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_TXRF6_PALNOFLUCT2G_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_TXRF6_GAINSTEP2G_MSB 14 -#define PHY_ANALOG_TXRF6_GAINSTEP2G_LSB 12 -#define PHY_ANALOG_TXRF6_GAINSTEP2G_MASK 0x00007000 -#define PHY_ANALOG_TXRF6_GAINSTEP2G_GET(x) (((x) & 0x00007000) >> 12) -#define PHY_ANALOG_TXRF6_GAINSTEP2G_SET(x) (((x) << 12) & 0x00007000) -#define PHY_ANALOG_TXRF6_USE_GAIN_DELTA2G_MSB 15 -#define PHY_ANALOG_TXRF6_USE_GAIN_DELTA2G_LSB 15 -#define PHY_ANALOG_TXRF6_USE_GAIN_DELTA2G_MASK 0x00008000 -#define PHY_ANALOG_TXRF6_USE_GAIN_DELTA2G_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_TXRF6_USE_GAIN_DELTA2G_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_TXRF6_CAPDIV_I2G_MSB 19 -#define PHY_ANALOG_TXRF6_CAPDIV_I2G_LSB 16 -#define PHY_ANALOG_TXRF6_CAPDIV_I2G_MASK 0x000f0000 -#define PHY_ANALOG_TXRF6_CAPDIV_I2G_GET(x) (((x) & 0x000f0000) >> 16) -#define PHY_ANALOG_TXRF6_CAPDIV_I2G_SET(x) (((x) << 16) & 0x000f0000) -#define PHY_ANALOG_TXRF6_PADRVGN_INDEX_I2G_MSB 23 -#define PHY_ANALOG_TXRF6_PADRVGN_INDEX_I2G_LSB 20 -#define PHY_ANALOG_TXRF6_PADRVGN_INDEX_I2G_MASK 0x00f00000 -#define PHY_ANALOG_TXRF6_PADRVGN_INDEX_I2G_GET(x) (((x) & 0x00f00000) >> 20) -#define PHY_ANALOG_TXRF6_PADRVGN_INDEX_I2G_SET(x) (((x) << 20) & 0x00f00000) -#define PHY_ANALOG_TXRF6_VCMONDELAY2G_MSB 26 -#define PHY_ANALOG_TXRF6_VCMONDELAY2G_LSB 24 -#define PHY_ANALOG_TXRF6_VCMONDELAY2G_MASK 0x07000000 -#define PHY_ANALOG_TXRF6_VCMONDELAY2G_GET(x) (((x) & 0x07000000) >> 24) -#define PHY_ANALOG_TXRF6_VCMONDELAY2G_SET(x) (((x) << 24) & 0x07000000) -#define PHY_ANALOG_TXRF6_CAPDIV2G_MSB 30 -#define PHY_ANALOG_TXRF6_CAPDIV2G_LSB 27 -#define PHY_ANALOG_TXRF6_CAPDIV2G_MASK 0x78000000 -#define PHY_ANALOG_TXRF6_CAPDIV2G_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_ANALOG_TXRF6_CAPDIV2G_SET(x) (((x) << 27) & 0x78000000) -#define PHY_ANALOG_TXRF6_CAPDIV2GOVR_MSB 31 -#define PHY_ANALOG_TXRF6_CAPDIV2GOVR_LSB 31 -#define PHY_ANALOG_TXRF6_CAPDIV2GOVR_MASK 0x80000000 -#define PHY_ANALOG_TXRF6_CAPDIV2GOVR_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_TXRF6_CAPDIV2GOVR_SET(x) (((x) << 31) & 0x80000000) - -/* macros for TXRF7 */ -#define PHY_ANALOG_TXRF7_ADDRESS 0x00000058 -#define PHY_ANALOG_TXRF7_OFFSET 0x00000058 -#define PHY_ANALOG_TXRF7_SPARE7_MSB 1 -#define PHY_ANALOG_TXRF7_SPARE7_LSB 0 -#define PHY_ANALOG_TXRF7_SPARE7_MASK 0x00000003 -#define PHY_ANALOG_TXRF7_SPARE7_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF7_SPARE7_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_4_MSB 7 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_4_LSB 2 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_4_MASK 0x000000fc -#define PHY_ANALOG_TXRF7_PADRVGNTAB_4_GET(x) (((x) & 0x000000fc) >> 2) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_4_SET(x) (((x) << 2) & 0x000000fc) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_3_MSB 13 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_3_LSB 8 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_3_MASK 0x00003f00 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_3_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_3_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_2_MSB 19 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_2_LSB 14 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_2_MASK 0x000fc000 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_2_GET(x) (((x) & 0x000fc000) >> 14) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_2_SET(x) (((x) << 14) & 0x000fc000) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_1_MSB 25 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_1_LSB 20 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_1_MASK 0x03f00000 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_1_GET(x) (((x) & 0x03f00000) >> 20) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_1_SET(x) (((x) << 20) & 0x03f00000) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_0_MSB 31 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_0_LSB 26 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_0_MASK 0xfc000000 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_0_GET(x) (((x) & 0xfc000000) >> 26) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_0_SET(x) (((x) << 26) & 0xfc000000) - -/* macros for TXRF8 */ -#define PHY_ANALOG_TXRF8_ADDRESS 0x0000005c -#define PHY_ANALOG_TXRF8_OFFSET 0x0000005c -#define PHY_ANALOG_TXRF8_SPARE8_MSB 1 -#define PHY_ANALOG_TXRF8_SPARE8_LSB 0 -#define PHY_ANALOG_TXRF8_SPARE8_MASK 0x00000003 -#define PHY_ANALOG_TXRF8_SPARE8_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF8_SPARE8_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_9_MSB 7 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_9_LSB 2 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_9_MASK 0x000000fc -#define PHY_ANALOG_TXRF8_PADRVGNTAB_9_GET(x) (((x) & 0x000000fc) >> 2) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_9_SET(x) (((x) << 2) & 0x000000fc) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_8_MSB 13 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_8_LSB 8 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_8_MASK 0x00003f00 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_8_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_8_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_7_MSB 19 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_7_LSB 14 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_7_MASK 0x000fc000 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_7_GET(x) (((x) & 0x000fc000) >> 14) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_7_SET(x) (((x) << 14) & 0x000fc000) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_6_MSB 25 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_6_LSB 20 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_6_MASK 0x03f00000 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_6_GET(x) (((x) & 0x03f00000) >> 20) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_6_SET(x) (((x) << 20) & 0x03f00000) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_5_MSB 31 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_5_LSB 26 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_5_MASK 0xfc000000 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_5_GET(x) (((x) & 0xfc000000) >> 26) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_5_SET(x) (((x) << 26) & 0xfc000000) - -/* macros for TXRF9 */ -#define PHY_ANALOG_TXRF9_ADDRESS 0x00000060 -#define PHY_ANALOG_TXRF9_OFFSET 0x00000060 -#define PHY_ANALOG_TXRF9_SPARE9_MSB 1 -#define PHY_ANALOG_TXRF9_SPARE9_LSB 0 -#define PHY_ANALOG_TXRF9_SPARE9_MASK 0x00000003 -#define PHY_ANALOG_TXRF9_SPARE9_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF9_SPARE9_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_14_MSB 7 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_14_LSB 2 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_14_MASK 0x000000fc -#define PHY_ANALOG_TXRF9_PADRVGNTAB_14_GET(x) (((x) & 0x000000fc) >> 2) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_14_SET(x) (((x) << 2) & 0x000000fc) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_13_MSB 13 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_13_LSB 8 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_13_MASK 0x00003f00 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_13_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_13_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_12_MSB 19 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_12_LSB 14 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_12_MASK 0x000fc000 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_12_GET(x) (((x) & 0x000fc000) >> 14) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_12_SET(x) (((x) << 14) & 0x000fc000) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_11_MSB 25 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_11_LSB 20 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_11_MASK 0x03f00000 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_11_GET(x) (((x) & 0x03f00000) >> 20) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_11_SET(x) (((x) << 20) & 0x03f00000) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_10_MSB 31 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_10_LSB 26 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_10_MASK 0xfc000000 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_10_GET(x) (((x) & 0xfc000000) >> 26) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_10_SET(x) (((x) << 26) & 0xfc000000) - -/* macros for TXRF10 */ -#define PHY_ANALOG_TXRF10_ADDRESS 0x00000064 -#define PHY_ANALOG_TXRF10_OFFSET 0x00000064 -#define PHY_ANALOG_TXRF10_SPARE10_MSB 2 -#define PHY_ANALOG_TXRF10_SPARE10_LSB 0 -#define PHY_ANALOG_TXRF10_SPARE10_MASK 0x00000007 -#define PHY_ANALOG_TXRF10_SPARE10_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_TXRF10_SPARE10_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_TXRF10_PDOUT5G_3CALTX_MSB 3 -#define PHY_ANALOG_TXRF10_PDOUT5G_3CALTX_LSB 3 -#define PHY_ANALOG_TXRF10_PDOUT5G_3CALTX_MASK 0x00000008 -#define PHY_ANALOG_TXRF10_PDOUT5G_3CALTX_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_TXRF10_PDOUT5G_3CALTX_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_TXRF10_D3B5GCALTX_MSB 6 -#define PHY_ANALOG_TXRF10_D3B5GCALTX_LSB 4 -#define PHY_ANALOG_TXRF10_D3B5GCALTX_MASK 0x00000070 -#define PHY_ANALOG_TXRF10_D3B5GCALTX_GET(x) (((x) & 0x00000070) >> 4) -#define PHY_ANALOG_TXRF10_D3B5GCALTX_SET(x) (((x) << 4) & 0x00000070) -#define PHY_ANALOG_TXRF10_D4B5GCALTX_MSB 9 -#define PHY_ANALOG_TXRF10_D4B5GCALTX_LSB 7 -#define PHY_ANALOG_TXRF10_D4B5GCALTX_MASK 0x00000380 -#define PHY_ANALOG_TXRF10_D4B5GCALTX_GET(x) (((x) & 0x00000380) >> 7) -#define PHY_ANALOG_TXRF10_D4B5GCALTX_SET(x) (((x) << 7) & 0x00000380) -#define PHY_ANALOG_TXRF10_PADRVGN2GCALTX_MSB 16 -#define PHY_ANALOG_TXRF10_PADRVGN2GCALTX_LSB 10 -#define PHY_ANALOG_TXRF10_PADRVGN2GCALTX_MASK 0x0001fc00 -#define PHY_ANALOG_TXRF10_PADRVGN2GCALTX_GET(x) (((x) & 0x0001fc00) >> 10) -#define PHY_ANALOG_TXRF10_PADRVGN2GCALTX_SET(x) (((x) << 10) & 0x0001fc00) -#define PHY_ANALOG_TXRF10_DB2GCALTX_MSB 19 -#define PHY_ANALOG_TXRF10_DB2GCALTX_LSB 17 -#define PHY_ANALOG_TXRF10_DB2GCALTX_MASK 0x000e0000 -#define PHY_ANALOG_TXRF10_DB2GCALTX_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_TXRF10_DB2GCALTX_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_TXRF10_CALTXSHIFT_MSB 20 -#define PHY_ANALOG_TXRF10_CALTXSHIFT_LSB 20 -#define PHY_ANALOG_TXRF10_CALTXSHIFT_MASK 0x00100000 -#define PHY_ANALOG_TXRF10_CALTXSHIFT_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_TXRF10_CALTXSHIFT_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_TXRF10_CALTXSHIFTOVR_MSB 21 -#define PHY_ANALOG_TXRF10_CALTXSHIFTOVR_LSB 21 -#define PHY_ANALOG_TXRF10_CALTXSHIFTOVR_MASK 0x00200000 -#define PHY_ANALOG_TXRF10_CALTXSHIFTOVR_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_TXRF10_CALTXSHIFTOVR_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_TXRF10_PADRVGN2G_SMOUT_MSB 27 -#define PHY_ANALOG_TXRF10_PADRVGN2G_SMOUT_LSB 22 -#define PHY_ANALOG_TXRF10_PADRVGN2G_SMOUT_MASK 0x0fc00000 -#define PHY_ANALOG_TXRF10_PADRVGN2G_SMOUT_GET(x) (((x) & 0x0fc00000) >> 22) -#define PHY_ANALOG_TXRF10_PADRVGN_INDEX2G_SMOUT_MSB 31 -#define PHY_ANALOG_TXRF10_PADRVGN_INDEX2G_SMOUT_LSB 28 -#define PHY_ANALOG_TXRF10_PADRVGN_INDEX2G_SMOUT_MASK 0xf0000000 -#define PHY_ANALOG_TXRF10_PADRVGN_INDEX2G_SMOUT_GET(x) (((x) & 0xf0000000) >> 28) - -/* macros for TXRF11 */ -#define PHY_ANALOG_TXRF11_ADDRESS 0x00000068 -#define PHY_ANALOG_TXRF11_OFFSET 0x00000068 -#define PHY_ANALOG_TXRF11_SPARE11_MSB 1 -#define PHY_ANALOG_TXRF11_SPARE11_LSB 0 -#define PHY_ANALOG_TXRF11_SPARE11_MASK 0x00000003 -#define PHY_ANALOG_TXRF11_SPARE11_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF11_SPARE11_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV5G_MSB 4 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV5G_LSB 2 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV5G_MASK 0x0000001c -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV5G_GET(x) (((x) & 0x0000001c) >> 2) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV5G_SET(x) (((x) << 2) & 0x0000001c) -#define PHY_ANALOG_TXRF11_PWD_IR25PA2G_MSB 7 -#define PHY_ANALOG_TXRF11_PWD_IR25PA2G_LSB 5 -#define PHY_ANALOG_TXRF11_PWD_IR25PA2G_MASK 0x000000e0 -#define PHY_ANALOG_TXRF11_PWD_IR25PA2G_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_TXRF11_PWD_IR25PA2G_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS2G_MSB 10 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS2G_LSB 8 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS2G_MASK 0x00000700 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS2G_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS2G_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV2G_MSB 13 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV2G_LSB 11 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV2G_MASK 0x00003800 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV2G_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV2G_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_TXRF11_PWD_ICSPARE_MSB 16 -#define PHY_ANALOG_TXRF11_PWD_ICSPARE_LSB 14 -#define PHY_ANALOG_TXRF11_PWD_ICSPARE_MASK 0x0001c000 -#define PHY_ANALOG_TXRF11_PWD_ICSPARE_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_TXRF11_PWD_ICSPARE_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_TXRF11_PWD_IC25TEMPSEN_MSB 19 -#define PHY_ANALOG_TXRF11_PWD_IC25TEMPSEN_LSB 17 -#define PHY_ANALOG_TXRF11_PWD_IC25TEMPSEN_MASK 0x000e0000 -#define PHY_ANALOG_TXRF11_PWD_IC25TEMPSEN_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_TXRF11_PWD_IC25TEMPSEN_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G2_MSB 22 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G2_LSB 20 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G2_MASK 0x00700000 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G2_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G2_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G1_MSB 25 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G1_LSB 23 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G1_MASK 0x03800000 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G1_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G1_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_TXRF11_PWD_IC25MIXBUF5G_MSB 28 -#define PHY_ANALOG_TXRF11_PWD_IC25MIXBUF5G_LSB 26 -#define PHY_ANALOG_TXRF11_PWD_IC25MIXBUF5G_MASK 0x1c000000 -#define PHY_ANALOG_TXRF11_PWD_IC25MIXBUF5G_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_TXRF11_PWD_IC25MIXBUF5G_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_TXRF11_PWD_IC25PA2G_MSB 31 -#define PHY_ANALOG_TXRF11_PWD_IC25PA2G_LSB 29 -#define PHY_ANALOG_TXRF11_PWD_IC25PA2G_MASK 0xe0000000 -#define PHY_ANALOG_TXRF11_PWD_IC25PA2G_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_TXRF11_PWD_IC25PA2G_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for TXRF12 */ -#define PHY_ANALOG_TXRF12_ADDRESS 0x0000006c -#define PHY_ANALOG_TXRF12_OFFSET 0x0000006c -#define PHY_ANALOG_TXRF12_SPARE12_2_MSB 7 -#define PHY_ANALOG_TXRF12_SPARE12_2_LSB 0 -#define PHY_ANALOG_TXRF12_SPARE12_2_MASK 0x000000ff -#define PHY_ANALOG_TXRF12_SPARE12_2_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_ANALOG_TXRF12_SPARE12_1_MSB 9 -#define PHY_ANALOG_TXRF12_SPARE12_1_LSB 8 -#define PHY_ANALOG_TXRF12_SPARE12_1_MASK 0x00000300 -#define PHY_ANALOG_TXRF12_SPARE12_1_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_ANALOG_TXRF12_SPARE12_1_SET(x) (((x) << 8) & 0x00000300) -#define PHY_ANALOG_TXRF12_ATBSEL5G_MSB 13 -#define PHY_ANALOG_TXRF12_ATBSEL5G_LSB 10 -#define PHY_ANALOG_TXRF12_ATBSEL5G_MASK 0x00003c00 -#define PHY_ANALOG_TXRF12_ATBSEL5G_GET(x) (((x) & 0x00003c00) >> 10) -#define PHY_ANALOG_TXRF12_ATBSEL5G_SET(x) (((x) << 10) & 0x00003c00) -#define PHY_ANALOG_TXRF12_ATBSEL2G_MSB 16 -#define PHY_ANALOG_TXRF12_ATBSEL2G_LSB 14 -#define PHY_ANALOG_TXRF12_ATBSEL2G_MASK 0x0001c000 -#define PHY_ANALOG_TXRF12_ATBSEL2G_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_TXRF12_ATBSEL2G_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_TXRF12_PWD_IRSPARE_MSB 19 -#define PHY_ANALOG_TXRF12_PWD_IRSPARE_LSB 17 -#define PHY_ANALOG_TXRF12_PWD_IRSPARE_MASK 0x000e0000 -#define PHY_ANALOG_TXRF12_PWD_IRSPARE_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_TXRF12_PWD_IRSPARE_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_TXRF12_PWD_IR25TEMPSEN_MSB 22 -#define PHY_ANALOG_TXRF12_PWD_IR25TEMPSEN_LSB 20 -#define PHY_ANALOG_TXRF12_PWD_IR25TEMPSEN_MASK 0x00700000 -#define PHY_ANALOG_TXRF12_PWD_IR25TEMPSEN_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_TXRF12_PWD_IR25TEMPSEN_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G2_MSB 25 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G2_LSB 23 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G2_MASK 0x03800000 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G2_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G2_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G1_MSB 28 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G1_LSB 26 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G1_MASK 0x1c000000 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G1_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G1_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_TXRF12_PWD_IR25MIXBIAS5G_MSB 31 -#define PHY_ANALOG_TXRF12_PWD_IR25MIXBIAS5G_LSB 29 -#define PHY_ANALOG_TXRF12_PWD_IR25MIXBIAS5G_MASK 0xe0000000 -#define PHY_ANALOG_TXRF12_PWD_IR25MIXBIAS5G_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_TXRF12_PWD_IR25MIXBIAS5G_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for SYNTH1 */ -#define PHY_ANALOG_SYNTH1_ADDRESS 0x00000080 -#define PHY_ANALOG_SYNTH1_OFFSET 0x00000080 -#define PHY_ANALOG_SYNTH1_SEL_VCMONABUS_MSB 2 -#define PHY_ANALOG_SYNTH1_SEL_VCMONABUS_LSB 0 -#define PHY_ANALOG_SYNTH1_SEL_VCMONABUS_MASK 0x00000007 -#define PHY_ANALOG_SYNTH1_SEL_VCMONABUS_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_SYNTH1_SEL_VCMONABUS_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_SYNTH1_SEL_VCOABUS_MSB 5 -#define PHY_ANALOG_SYNTH1_SEL_VCOABUS_LSB 3 -#define PHY_ANALOG_SYNTH1_SEL_VCOABUS_MASK 0x00000038 -#define PHY_ANALOG_SYNTH1_SEL_VCOABUS_GET(x) (((x) & 0x00000038) >> 3) -#define PHY_ANALOG_SYNTH1_SEL_VCOABUS_SET(x) (((x) << 3) & 0x00000038) -#define PHY_ANALOG_SYNTH1_MONITOR_SYNTHLOCKVCOK_MSB 6 -#define PHY_ANALOG_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB 6 -#define PHY_ANALOG_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK 0x00000040 -#define PHY_ANALOG_SYNTH1_MONITOR_SYNTHLOCKVCOK_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_SYNTH1_MONITOR_SYNTHLOCKVCOK_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_SYNTH1_MONITOR_VC2LOW_MSB 7 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2LOW_LSB 7 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2LOW_MASK 0x00000080 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2LOW_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_SYNTH1_MONITOR_VC2LOW_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_SYNTH1_MONITOR_VC2HIGH_MSB 8 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2HIGH_LSB 8 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2HIGH_MASK 0x00000100 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2HIGH_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_SYNTH1_MONITOR_VC2HIGH_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_SYNTH1_MONITOR_FB_DIV2_MSB 9 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_DIV2_LSB 9 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_DIV2_MASK 0x00000200 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_DIV2_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_SYNTH1_MONITOR_FB_DIV2_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_SYNTH1_MONITOR_REF_MSB 10 -#define PHY_ANALOG_SYNTH1_MONITOR_REF_LSB 10 -#define PHY_ANALOG_SYNTH1_MONITOR_REF_MASK 0x00000400 -#define PHY_ANALOG_SYNTH1_MONITOR_REF_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_SYNTH1_MONITOR_REF_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_SYNTH1_MONITOR_FB_MSB 11 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_LSB 11 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_MASK 0x00000800 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_SYNTH1_MONITOR_FB_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_SYNTH1_SEVENBITVCOCAP_MSB 12 -#define PHY_ANALOG_SYNTH1_SEVENBITVCOCAP_LSB 12 -#define PHY_ANALOG_SYNTH1_SEVENBITVCOCAP_MASK 0x00001000 -#define PHY_ANALOG_SYNTH1_SEVENBITVCOCAP_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_SYNTH1_SEVENBITVCOCAP_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_SYNTH1_PWUP_PD_MSB 15 -#define PHY_ANALOG_SYNTH1_PWUP_PD_LSB 13 -#define PHY_ANALOG_SYNTH1_PWUP_PD_MASK 0x0000e000 -#define PHY_ANALOG_SYNTH1_PWUP_PD_GET(x) (((x) & 0x0000e000) >> 13) -#define PHY_ANALOG_SYNTH1_PWUP_PD_SET(x) (((x) << 13) & 0x0000e000) -#define PHY_ANALOG_SYNTH1_PWD_VCOBUF_MSB 16 -#define PHY_ANALOG_SYNTH1_PWD_VCOBUF_LSB 16 -#define PHY_ANALOG_SYNTH1_PWD_VCOBUF_MASK 0x00010000 -#define PHY_ANALOG_SYNTH1_PWD_VCOBUF_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_SYNTH1_PWD_VCOBUF_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_SYNTH1_VCOBUFGAIN_MSB 18 -#define PHY_ANALOG_SYNTH1_VCOBUFGAIN_LSB 17 -#define PHY_ANALOG_SYNTH1_VCOBUFGAIN_MASK 0x00060000 -#define PHY_ANALOG_SYNTH1_VCOBUFGAIN_GET(x) (((x) & 0x00060000) >> 17) -#define PHY_ANALOG_SYNTH1_VCOBUFGAIN_SET(x) (((x) << 17) & 0x00060000) -#define PHY_ANALOG_SYNTH1_VCOREGLEVEL_MSB 20 -#define PHY_ANALOG_SYNTH1_VCOREGLEVEL_LSB 19 -#define PHY_ANALOG_SYNTH1_VCOREGLEVEL_MASK 0x00180000 -#define PHY_ANALOG_SYNTH1_VCOREGLEVEL_GET(x) (((x) & 0x00180000) >> 19) -#define PHY_ANALOG_SYNTH1_VCOREGLEVEL_SET(x) (((x) << 19) & 0x00180000) -#define PHY_ANALOG_SYNTH1_VCOREGBYPASS_MSB 21 -#define PHY_ANALOG_SYNTH1_VCOREGBYPASS_LSB 21 -#define PHY_ANALOG_SYNTH1_VCOREGBYPASS_MASK 0x00200000 -#define PHY_ANALOG_SYNTH1_VCOREGBYPASS_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_SYNTH1_VCOREGBYPASS_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_SYNTH1_PWUP_LOREF_MSB 22 -#define PHY_ANALOG_SYNTH1_PWUP_LOREF_LSB 22 -#define PHY_ANALOG_SYNTH1_PWUP_LOREF_MASK 0x00400000 -#define PHY_ANALOG_SYNTH1_PWUP_LOREF_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_SYNTH1_PWUP_LOREF_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_SYNTH1_PWD_LOMIX_MSB 23 -#define PHY_ANALOG_SYNTH1_PWD_LOMIX_LSB 23 -#define PHY_ANALOG_SYNTH1_PWD_LOMIX_MASK 0x00800000 -#define PHY_ANALOG_SYNTH1_PWD_LOMIX_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_SYNTH1_PWD_LOMIX_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_SYNTH1_PWD_LODIV_MSB 24 -#define PHY_ANALOG_SYNTH1_PWD_LODIV_LSB 24 -#define PHY_ANALOG_SYNTH1_PWD_LODIV_MASK 0x01000000 -#define PHY_ANALOG_SYNTH1_PWD_LODIV_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_ANALOG_SYNTH1_PWD_LODIV_SET(x) (((x) << 24) & 0x01000000) -#define PHY_ANALOG_SYNTH1_PWD_LOBUF5G_MSB 25 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF5G_LSB 25 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF5G_MASK 0x02000000 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF5G_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_ANALOG_SYNTH1_PWD_LOBUF5G_SET(x) (((x) << 25) & 0x02000000) -#define PHY_ANALOG_SYNTH1_PWD_LOBUF2G_MSB 26 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF2G_LSB 26 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF2G_MASK 0x04000000 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF2G_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_SYNTH1_PWD_LOBUF2G_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_SYNTH1_PWD_PRESC_MSB 27 -#define PHY_ANALOG_SYNTH1_PWD_PRESC_LSB 27 -#define PHY_ANALOG_SYNTH1_PWD_PRESC_MASK 0x08000000 -#define PHY_ANALOG_SYNTH1_PWD_PRESC_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_SYNTH1_PWD_PRESC_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_SYNTH1_PWD_VCO_MSB 28 -#define PHY_ANALOG_SYNTH1_PWD_VCO_LSB 28 -#define PHY_ANALOG_SYNTH1_PWD_VCO_MASK 0x10000000 -#define PHY_ANALOG_SYNTH1_PWD_VCO_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_SYNTH1_PWD_VCO_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_SYNTH1_PWD_VCMON_MSB 29 -#define PHY_ANALOG_SYNTH1_PWD_VCMON_LSB 29 -#define PHY_ANALOG_SYNTH1_PWD_VCMON_MASK 0x20000000 -#define PHY_ANALOG_SYNTH1_PWD_VCMON_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_SYNTH1_PWD_VCMON_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_SYNTH1_PWD_CP_MSB 30 -#define PHY_ANALOG_SYNTH1_PWD_CP_LSB 30 -#define PHY_ANALOG_SYNTH1_PWD_CP_MASK 0x40000000 -#define PHY_ANALOG_SYNTH1_PWD_CP_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_SYNTH1_PWD_CP_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_SYNTH1_PWD_BIAS_MSB 31 -#define PHY_ANALOG_SYNTH1_PWD_BIAS_LSB 31 -#define PHY_ANALOG_SYNTH1_PWD_BIAS_MASK 0x80000000 -#define PHY_ANALOG_SYNTH1_PWD_BIAS_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_SYNTH1_PWD_BIAS_SET(x) (((x) << 31) & 0x80000000) - -/* macros for SYNTH2 */ -#define PHY_ANALOG_SYNTH2_ADDRESS 0x00000084 -#define PHY_ANALOG_SYNTH2_OFFSET 0x00000084 -#define PHY_ANALOG_SYNTH2_CAPRANGE3_MSB 3 -#define PHY_ANALOG_SYNTH2_CAPRANGE3_LSB 0 -#define PHY_ANALOG_SYNTH2_CAPRANGE3_MASK 0x0000000f -#define PHY_ANALOG_SYNTH2_CAPRANGE3_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_SYNTH2_CAPRANGE3_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_ANALOG_SYNTH2_CAPRANGE2_MSB 7 -#define PHY_ANALOG_SYNTH2_CAPRANGE2_LSB 4 -#define PHY_ANALOG_SYNTH2_CAPRANGE2_MASK 0x000000f0 -#define PHY_ANALOG_SYNTH2_CAPRANGE2_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_ANALOG_SYNTH2_CAPRANGE2_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_ANALOG_SYNTH2_CAPRANGE1_MSB 11 -#define PHY_ANALOG_SYNTH2_CAPRANGE1_LSB 8 -#define PHY_ANALOG_SYNTH2_CAPRANGE1_MASK 0x00000f00 -#define PHY_ANALOG_SYNTH2_CAPRANGE1_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_SYNTH2_CAPRANGE1_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_SYNTH2_LOOPLEAKCUR_INTN_MSB 15 -#define PHY_ANALOG_SYNTH2_LOOPLEAKCUR_INTN_LSB 12 -#define PHY_ANALOG_SYNTH2_LOOPLEAKCUR_INTN_MASK 0x0000f000 -#define PHY_ANALOG_SYNTH2_LOOPLEAKCUR_INTN_GET(x) (((x) & 0x0000f000) >> 12) -#define PHY_ANALOG_SYNTH2_LOOPLEAKCUR_INTN_SET(x) (((x) << 12) & 0x0000f000) -#define PHY_ANALOG_SYNTH2_CPLOWLK_INTN_MSB 16 -#define PHY_ANALOG_SYNTH2_CPLOWLK_INTN_LSB 16 -#define PHY_ANALOG_SYNTH2_CPLOWLK_INTN_MASK 0x00010000 -#define PHY_ANALOG_SYNTH2_CPLOWLK_INTN_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_SYNTH2_CPLOWLK_INTN_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_SYNTH2_CPSTEERING_EN_INTN_MSB 17 -#define PHY_ANALOG_SYNTH2_CPSTEERING_EN_INTN_LSB 17 -#define PHY_ANALOG_SYNTH2_CPSTEERING_EN_INTN_MASK 0x00020000 -#define PHY_ANALOG_SYNTH2_CPSTEERING_EN_INTN_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_SYNTH2_CPSTEERING_EN_INTN_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_SYNTH2_CPBIAS_INTN_MSB 19 -#define PHY_ANALOG_SYNTH2_CPBIAS_INTN_LSB 18 -#define PHY_ANALOG_SYNTH2_CPBIAS_INTN_MASK 0x000c0000 -#define PHY_ANALOG_SYNTH2_CPBIAS_INTN_GET(x) (((x) & 0x000c0000) >> 18) -#define PHY_ANALOG_SYNTH2_CPBIAS_INTN_SET(x) (((x) << 18) & 0x000c0000) -#define PHY_ANALOG_SYNTH2_VC_LOW_REF_MSB 22 -#define PHY_ANALOG_SYNTH2_VC_LOW_REF_LSB 20 -#define PHY_ANALOG_SYNTH2_VC_LOW_REF_MASK 0x00700000 -#define PHY_ANALOG_SYNTH2_VC_LOW_REF_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_SYNTH2_VC_LOW_REF_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_SYNTH2_VC_MID_REF_MSB 25 -#define PHY_ANALOG_SYNTH2_VC_MID_REF_LSB 23 -#define PHY_ANALOG_SYNTH2_VC_MID_REF_MASK 0x03800000 -#define PHY_ANALOG_SYNTH2_VC_MID_REF_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_SYNTH2_VC_MID_REF_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_SYNTH2_VC_HI_REF_MSB 28 -#define PHY_ANALOG_SYNTH2_VC_HI_REF_LSB 26 -#define PHY_ANALOG_SYNTH2_VC_HI_REF_MASK 0x1c000000 -#define PHY_ANALOG_SYNTH2_VC_HI_REF_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_SYNTH2_VC_HI_REF_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_SYNTH2_VC_CAL_REF_MSB 31 -#define PHY_ANALOG_SYNTH2_VC_CAL_REF_LSB 29 -#define PHY_ANALOG_SYNTH2_VC_CAL_REF_MASK 0xe0000000 -#define PHY_ANALOG_SYNTH2_VC_CAL_REF_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_SYNTH2_VC_CAL_REF_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for SYNTH3 */ -#define PHY_ANALOG_SYNTH3_ADDRESS 0x00000088 -#define PHY_ANALOG_SYNTH3_OFFSET 0x00000088 -#define PHY_ANALOG_SYNTH3_WAIT_VC_CHECK_MSB 5 -#define PHY_ANALOG_SYNTH3_WAIT_VC_CHECK_LSB 0 -#define PHY_ANALOG_SYNTH3_WAIT_VC_CHECK_MASK 0x0000003f -#define PHY_ANALOG_SYNTH3_WAIT_VC_CHECK_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_ANALOG_SYNTH3_WAIT_VC_CHECK_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_ANALOG_SYNTH3_WAIT_CAL_LIN_MSB 11 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_LIN_LSB 6 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_LIN_MASK 0x00000fc0 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_LIN_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_ANALOG_SYNTH3_WAIT_CAL_LIN_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_ANALOG_SYNTH3_WAIT_CAL_BIN_MSB 17 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_BIN_LSB 12 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_BIN_MASK 0x0003f000 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_BIN_GET(x) (((x) & 0x0003f000) >> 12) -#define PHY_ANALOG_SYNTH3_WAIT_CAL_BIN_SET(x) (((x) << 12) & 0x0003f000) -#define PHY_ANALOG_SYNTH3_WAIT_PWRUP_MSB 23 -#define PHY_ANALOG_SYNTH3_WAIT_PWRUP_LSB 18 -#define PHY_ANALOG_SYNTH3_WAIT_PWRUP_MASK 0x00fc0000 -#define PHY_ANALOG_SYNTH3_WAIT_PWRUP_GET(x) (((x) & 0x00fc0000) >> 18) -#define PHY_ANALOG_SYNTH3_WAIT_PWRUP_SET(x) (((x) << 18) & 0x00fc0000) -#define PHY_ANALOG_SYNTH3_WAIT_SHORTR_PWRUP_MSB 29 -#define PHY_ANALOG_SYNTH3_WAIT_SHORTR_PWRUP_LSB 24 -#define PHY_ANALOG_SYNTH3_WAIT_SHORTR_PWRUP_MASK 0x3f000000 -#define PHY_ANALOG_SYNTH3_WAIT_SHORTR_PWRUP_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_ANALOG_SYNTH3_WAIT_SHORTR_PWRUP_SET(x) (((x) << 24) & 0x3f000000) -#define PHY_ANALOG_SYNTH3_SEL_CLK_DIV2_MSB 30 -#define PHY_ANALOG_SYNTH3_SEL_CLK_DIV2_LSB 30 -#define PHY_ANALOG_SYNTH3_SEL_CLK_DIV2_MASK 0x40000000 -#define PHY_ANALOG_SYNTH3_SEL_CLK_DIV2_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_SYNTH3_SEL_CLK_DIV2_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_SYNTH3_DIS_CLK_XTAL_MSB 31 -#define PHY_ANALOG_SYNTH3_DIS_CLK_XTAL_LSB 31 -#define PHY_ANALOG_SYNTH3_DIS_CLK_XTAL_MASK 0x80000000 -#define PHY_ANALOG_SYNTH3_DIS_CLK_XTAL_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_SYNTH3_DIS_CLK_XTAL_SET(x) (((x) << 31) & 0x80000000) - -/* macros for SYNTH4 */ -#define PHY_ANALOG_SYNTH4_ADDRESS 0x0000008c -#define PHY_ANALOG_SYNTH4_OFFSET 0x0000008c -#define PHY_ANALOG_SYNTH4_PS_SINGLE_PULSE_MSB 0 -#define PHY_ANALOG_SYNTH4_PS_SINGLE_PULSE_LSB 0 -#define PHY_ANALOG_SYNTH4_PS_SINGLE_PULSE_MASK 0x00000001 -#define PHY_ANALOG_SYNTH4_PS_SINGLE_PULSE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_SYNTH4_PS_SINGLE_PULSE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_SYNTH4_LONGSHIFTSEL_MSB 1 -#define PHY_ANALOG_SYNTH4_LONGSHIFTSEL_LSB 1 -#define PHY_ANALOG_SYNTH4_LONGSHIFTSEL_MASK 0x00000002 -#define PHY_ANALOG_SYNTH4_LONGSHIFTSEL_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_SYNTH4_LONGSHIFTSEL_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_SYNTH4_LOBUF5GTUNE_OVR_MSB 3 -#define PHY_ANALOG_SYNTH4_LOBUF5GTUNE_OVR_LSB 2 -#define PHY_ANALOG_SYNTH4_LOBUF5GTUNE_OVR_MASK 0x0000000c -#define PHY_ANALOG_SYNTH4_LOBUF5GTUNE_OVR_GET(x) (((x) & 0x0000000c) >> 2) -#define PHY_ANALOG_SYNTH4_LOBUF5GTUNE_OVR_SET(x) (((x) << 2) & 0x0000000c) -#define PHY_ANALOG_SYNTH4_FORCE_LOBUF5GTUNE_MSB 4 -#define PHY_ANALOG_SYNTH4_FORCE_LOBUF5GTUNE_LSB 4 -#define PHY_ANALOG_SYNTH4_FORCE_LOBUF5GTUNE_MASK 0x00000010 -#define PHY_ANALOG_SYNTH4_FORCE_LOBUF5GTUNE_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_SYNTH4_FORCE_LOBUF5GTUNE_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_SYNTH4_PSCOUNT_FBSEL_MSB 5 -#define PHY_ANALOG_SYNTH4_PSCOUNT_FBSEL_LSB 5 -#define PHY_ANALOG_SYNTH4_PSCOUNT_FBSEL_MASK 0x00000020 -#define PHY_ANALOG_SYNTH4_PSCOUNT_FBSEL_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_SYNTH4_PSCOUNT_FBSEL_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_SYNTH4_SDM_DITHER1_MSB 7 -#define PHY_ANALOG_SYNTH4_SDM_DITHER1_LSB 6 -#define PHY_ANALOG_SYNTH4_SDM_DITHER1_MASK 0x000000c0 -#define PHY_ANALOG_SYNTH4_SDM_DITHER1_GET(x) (((x) & 0x000000c0) >> 6) -#define PHY_ANALOG_SYNTH4_SDM_DITHER1_SET(x) (((x) << 6) & 0x000000c0) -#define PHY_ANALOG_SYNTH4_SDM_MODE_MSB 8 -#define PHY_ANALOG_SYNTH4_SDM_MODE_LSB 8 -#define PHY_ANALOG_SYNTH4_SDM_MODE_MASK 0x00000100 -#define PHY_ANALOG_SYNTH4_SDM_MODE_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_SYNTH4_SDM_MODE_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_SYNTH4_SDM_DISABLE_MSB 9 -#define PHY_ANALOG_SYNTH4_SDM_DISABLE_LSB 9 -#define PHY_ANALOG_SYNTH4_SDM_DISABLE_MASK 0x00000200 -#define PHY_ANALOG_SYNTH4_SDM_DISABLE_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_SYNTH4_SDM_DISABLE_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_SYNTH4_RESET_PRESC_MSB 10 -#define PHY_ANALOG_SYNTH4_RESET_PRESC_LSB 10 -#define PHY_ANALOG_SYNTH4_RESET_PRESC_MASK 0x00000400 -#define PHY_ANALOG_SYNTH4_RESET_PRESC_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_SYNTH4_RESET_PRESC_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_SYNTH4_PRESCSEL_MSB 12 -#define PHY_ANALOG_SYNTH4_PRESCSEL_LSB 11 -#define PHY_ANALOG_SYNTH4_PRESCSEL_MASK 0x00001800 -#define PHY_ANALOG_SYNTH4_PRESCSEL_GET(x) (((x) & 0x00001800) >> 11) -#define PHY_ANALOG_SYNTH4_PRESCSEL_SET(x) (((x) << 11) & 0x00001800) -#define PHY_ANALOG_SYNTH4_PFD_DISABLE_MSB 13 -#define PHY_ANALOG_SYNTH4_PFD_DISABLE_LSB 13 -#define PHY_ANALOG_SYNTH4_PFD_DISABLE_MASK 0x00002000 -#define PHY_ANALOG_SYNTH4_PFD_DISABLE_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_SYNTH4_PFD_DISABLE_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_SYNTH4_PFDDELAY_FRACN_MSB 14 -#define PHY_ANALOG_SYNTH4_PFDDELAY_FRACN_LSB 14 -#define PHY_ANALOG_SYNTH4_PFDDELAY_FRACN_MASK 0x00004000 -#define PHY_ANALOG_SYNTH4_PFDDELAY_FRACN_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_SYNTH4_PFDDELAY_FRACN_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_SYNTH4_FORCE_LO_ON_MSB 15 -#define PHY_ANALOG_SYNTH4_FORCE_LO_ON_LSB 15 -#define PHY_ANALOG_SYNTH4_FORCE_LO_ON_MASK 0x00008000 -#define PHY_ANALOG_SYNTH4_FORCE_LO_ON_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_SYNTH4_FORCE_LO_ON_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_SYNTH4_CLKXTAL_EDGE_SEL_MSB 16 -#define PHY_ANALOG_SYNTH4_CLKXTAL_EDGE_SEL_LSB 16 -#define PHY_ANALOG_SYNTH4_CLKXTAL_EDGE_SEL_MASK 0x00010000 -#define PHY_ANALOG_SYNTH4_CLKXTAL_EDGE_SEL_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_SYNTH4_CLKXTAL_EDGE_SEL_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_SYNTH4_VCOCAPPULLUP_MSB 17 -#define PHY_ANALOG_SYNTH4_VCOCAPPULLUP_LSB 17 -#define PHY_ANALOG_SYNTH4_VCOCAPPULLUP_MASK 0x00020000 -#define PHY_ANALOG_SYNTH4_VCOCAPPULLUP_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_SYNTH4_VCOCAPPULLUP_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_SYNTH4_VCOCAP_OVR_MSB 25 -#define PHY_ANALOG_SYNTH4_VCOCAP_OVR_LSB 18 -#define PHY_ANALOG_SYNTH4_VCOCAP_OVR_MASK 0x03fc0000 -#define PHY_ANALOG_SYNTH4_VCOCAP_OVR_GET(x) (((x) & 0x03fc0000) >> 18) -#define PHY_ANALOG_SYNTH4_VCOCAP_OVR_SET(x) (((x) << 18) & 0x03fc0000) -#define PHY_ANALOG_SYNTH4_FORCE_VCOCAP_MSB 26 -#define PHY_ANALOG_SYNTH4_FORCE_VCOCAP_LSB 26 -#define PHY_ANALOG_SYNTH4_FORCE_VCOCAP_MASK 0x04000000 -#define PHY_ANALOG_SYNTH4_FORCE_VCOCAP_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_SYNTH4_FORCE_VCOCAP_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_SYNTH4_FORCE_PINVC_MSB 27 -#define PHY_ANALOG_SYNTH4_FORCE_PINVC_LSB 27 -#define PHY_ANALOG_SYNTH4_FORCE_PINVC_MASK 0x08000000 -#define PHY_ANALOG_SYNTH4_FORCE_PINVC_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_SYNTH4_FORCE_PINVC_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_SYNTH4_SHORTR_UNTIL_LOCKED_MSB 28 -#define PHY_ANALOG_SYNTH4_SHORTR_UNTIL_LOCKED_LSB 28 -#define PHY_ANALOG_SYNTH4_SHORTR_UNTIL_LOCKED_MASK 0x10000000 -#define PHY_ANALOG_SYNTH4_SHORTR_UNTIL_LOCKED_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_SYNTH4_SHORTR_UNTIL_LOCKED_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_SYNTH4_ALWAYS_SHORTR_MSB 29 -#define PHY_ANALOG_SYNTH4_ALWAYS_SHORTR_LSB 29 -#define PHY_ANALOG_SYNTH4_ALWAYS_SHORTR_MASK 0x20000000 -#define PHY_ANALOG_SYNTH4_ALWAYS_SHORTR_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_SYNTH4_ALWAYS_SHORTR_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_SYNTH4_DIS_LOSTVC_MSB 30 -#define PHY_ANALOG_SYNTH4_DIS_LOSTVC_LSB 30 -#define PHY_ANALOG_SYNTH4_DIS_LOSTVC_MASK 0x40000000 -#define PHY_ANALOG_SYNTH4_DIS_LOSTVC_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_SYNTH4_DIS_LOSTVC_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_SYNTH4_DIS_LIN_CAPSEARCH_MSB 31 -#define PHY_ANALOG_SYNTH4_DIS_LIN_CAPSEARCH_LSB 31 -#define PHY_ANALOG_SYNTH4_DIS_LIN_CAPSEARCH_MASK 0x80000000 -#define PHY_ANALOG_SYNTH4_DIS_LIN_CAPSEARCH_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_SYNTH4_DIS_LIN_CAPSEARCH_SET(x) (((x) << 31) & 0x80000000) - -/* macros for SYNTH5 */ -#define PHY_ANALOG_SYNTH5_ADDRESS 0x00000090 -#define PHY_ANALOG_SYNTH5_OFFSET 0x00000090 -#define PHY_ANALOG_SYNTH5_VCOBIAS_MSB 1 -#define PHY_ANALOG_SYNTH5_VCOBIAS_LSB 0 -#define PHY_ANALOG_SYNTH5_VCOBIAS_MASK 0x00000003 -#define PHY_ANALOG_SYNTH5_VCOBIAS_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_SYNTH5_VCOBIAS_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF5G50_MSB 4 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF5G50_LSB 2 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF5G50_MASK 0x0000001c -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF5G50_GET(x) (((x) & 0x0000001c) >> 2) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF5G50_SET(x) (((x) << 2) & 0x0000001c) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF2G50_MSB 7 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF2G50_LSB 5 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF2G50_MASK 0x000000e0 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF2G50_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF2G50_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_SYNTH5_PWDB_ICVCO25_MSB 10 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCO25_LSB 8 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCO25_MASK 0x00000700 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCO25_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_SYNTH5_PWDB_ICVCO25_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_SYNTH5_PWDB_ICVCOREG25_MSB 13 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCOREG25_LSB 11 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCOREG25_MASK 0x00003800 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCOREG25_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_SYNTH5_PWDB_ICVCOREG25_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_SYNTH5_PWDB_IRVCOREG50_MSB 14 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCOREG50_LSB 14 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCOREG50_MASK 0x00004000 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCOREG50_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_SYNTH5_PWDB_IRVCOREG50_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOMIX_MSB 17 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOMIX_LSB 15 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOMIX_MASK 0x00038000 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOMIX_GET(x) (((x) & 0x00038000) >> 15) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOMIX_SET(x) (((x) << 15) & 0x00038000) -#define PHY_ANALOG_SYNTH5_PWDB_ICLODIV50_MSB 20 -#define PHY_ANALOG_SYNTH5_PWDB_ICLODIV50_LSB 18 -#define PHY_ANALOG_SYNTH5_PWDB_ICLODIV50_MASK 0x001c0000 -#define PHY_ANALOG_SYNTH5_PWDB_ICLODIV50_GET(x) (((x) & 0x001c0000) >> 18) -#define PHY_ANALOG_SYNTH5_PWDB_ICLODIV50_SET(x) (((x) << 18) & 0x001c0000) -#define PHY_ANALOG_SYNTH5_PWDB_ICPRESC50_MSB 23 -#define PHY_ANALOG_SYNTH5_PWDB_ICPRESC50_LSB 21 -#define PHY_ANALOG_SYNTH5_PWDB_ICPRESC50_MASK 0x00e00000 -#define PHY_ANALOG_SYNTH5_PWDB_ICPRESC50_GET(x) (((x) & 0x00e00000) >> 21) -#define PHY_ANALOG_SYNTH5_PWDB_ICPRESC50_SET(x) (((x) << 21) & 0x00e00000) -#define PHY_ANALOG_SYNTH5_PWDB_IRVCMON25_MSB 26 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCMON25_LSB 24 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCMON25_MASK 0x07000000 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCMON25_GET(x) (((x) & 0x07000000) >> 24) -#define PHY_ANALOG_SYNTH5_PWDB_IRVCMON25_SET(x) (((x) << 24) & 0x07000000) -#define PHY_ANALOG_SYNTH5_PWDB_IRPFDCP_MSB 29 -#define PHY_ANALOG_SYNTH5_PWDB_IRPFDCP_LSB 27 -#define PHY_ANALOG_SYNTH5_PWDB_IRPFDCP_MASK 0x38000000 -#define PHY_ANALOG_SYNTH5_PWDB_IRPFDCP_GET(x) (((x) & 0x38000000) >> 27) -#define PHY_ANALOG_SYNTH5_PWDB_IRPFDCP_SET(x) (((x) << 27) & 0x38000000) -#define PHY_ANALOG_SYNTH5_SDM_DITHER2_MSB 31 -#define PHY_ANALOG_SYNTH5_SDM_DITHER2_LSB 30 -#define PHY_ANALOG_SYNTH5_SDM_DITHER2_MASK 0xc0000000 -#define PHY_ANALOG_SYNTH5_SDM_DITHER2_GET(x) (((x) & 0xc0000000) >> 30) -#define PHY_ANALOG_SYNTH5_SDM_DITHER2_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for SYNTH6 */ -#define PHY_ANALOG_SYNTH6_ADDRESS 0x00000094 -#define PHY_ANALOG_SYNTH6_OFFSET 0x00000094 -#define PHY_ANALOG_SYNTH6_LOBUF5GTUNE_MSB 1 -#define PHY_ANALOG_SYNTH6_LOBUF5GTUNE_LSB 0 -#define PHY_ANALOG_SYNTH6_LOBUF5GTUNE_MASK 0x00000003 -#define PHY_ANALOG_SYNTH6_LOBUF5GTUNE_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_SYNTH6_LOOP_IP_MSB 8 -#define PHY_ANALOG_SYNTH6_LOOP_IP_LSB 2 -#define PHY_ANALOG_SYNTH6_LOOP_IP_MASK 0x000001fc -#define PHY_ANALOG_SYNTH6_LOOP_IP_GET(x) (((x) & 0x000001fc) >> 2) -#define PHY_ANALOG_SYNTH6_VC2LOW_MSB 9 -#define PHY_ANALOG_SYNTH6_VC2LOW_LSB 9 -#define PHY_ANALOG_SYNTH6_VC2LOW_MASK 0x00000200 -#define PHY_ANALOG_SYNTH6_VC2LOW_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_SYNTH6_VC2HIGH_MSB 10 -#define PHY_ANALOG_SYNTH6_VC2HIGH_LSB 10 -#define PHY_ANALOG_SYNTH6_VC2HIGH_MASK 0x00000400 -#define PHY_ANALOG_SYNTH6_VC2HIGH_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_SYNTH6_RESET_SDM_B_MSB 11 -#define PHY_ANALOG_SYNTH6_RESET_SDM_B_LSB 11 -#define PHY_ANALOG_SYNTH6_RESET_SDM_B_MASK 0x00000800 -#define PHY_ANALOG_SYNTH6_RESET_SDM_B_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_SYNTH6_RESET_PSCOUNTERS_MSB 12 -#define PHY_ANALOG_SYNTH6_RESET_PSCOUNTERS_LSB 12 -#define PHY_ANALOG_SYNTH6_RESET_PSCOUNTERS_MASK 0x00001000 -#define PHY_ANALOG_SYNTH6_RESET_PSCOUNTERS_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_SYNTH6_RESET_PFD_MSB 13 -#define PHY_ANALOG_SYNTH6_RESET_PFD_LSB 13 -#define PHY_ANALOG_SYNTH6_RESET_PFD_MASK 0x00002000 -#define PHY_ANALOG_SYNTH6_RESET_PFD_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_SYNTH6_RESET_RFD_MSB 14 -#define PHY_ANALOG_SYNTH6_RESET_RFD_LSB 14 -#define PHY_ANALOG_SYNTH6_RESET_RFD_MASK 0x00004000 -#define PHY_ANALOG_SYNTH6_RESET_RFD_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_SYNTH6_SHORT_R_MSB 15 -#define PHY_ANALOG_SYNTH6_SHORT_R_LSB 15 -#define PHY_ANALOG_SYNTH6_SHORT_R_MASK 0x00008000 -#define PHY_ANALOG_SYNTH6_SHORT_R_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_SYNTH6_VCO_CAP_ST_MSB 23 -#define PHY_ANALOG_SYNTH6_VCO_CAP_ST_LSB 16 -#define PHY_ANALOG_SYNTH6_VCO_CAP_ST_MASK 0x00ff0000 -#define PHY_ANALOG_SYNTH6_VCO_CAP_ST_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_ANALOG_SYNTH6_PIN_VC_MSB 24 -#define PHY_ANALOG_SYNTH6_PIN_VC_LSB 24 -#define PHY_ANALOG_SYNTH6_PIN_VC_MASK 0x01000000 -#define PHY_ANALOG_SYNTH6_PIN_VC_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_ANALOG_SYNTH6_SYNTH_LOCK_VC_OK_MSB 25 -#define PHY_ANALOG_SYNTH6_SYNTH_LOCK_VC_OK_LSB 25 -#define PHY_ANALOG_SYNTH6_SYNTH_LOCK_VC_OK_MASK 0x02000000 -#define PHY_ANALOG_SYNTH6_SYNTH_LOCK_VC_OK_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_ANALOG_SYNTH6_CAP_SEARCH_MSB 26 -#define PHY_ANALOG_SYNTH6_CAP_SEARCH_LSB 26 -#define PHY_ANALOG_SYNTH6_CAP_SEARCH_MASK 0x04000000 -#define PHY_ANALOG_SYNTH6_CAP_SEARCH_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_SYNTH6_SYNTH_SM_STATE_MSB 30 -#define PHY_ANALOG_SYNTH6_SYNTH_SM_STATE_LSB 27 -#define PHY_ANALOG_SYNTH6_SYNTH_SM_STATE_MASK 0x78000000 -#define PHY_ANALOG_SYNTH6_SYNTH_SM_STATE_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_ANALOG_SYNTH6_SYNTH_ON_MSB 31 -#define PHY_ANALOG_SYNTH6_SYNTH_ON_LSB 31 -#define PHY_ANALOG_SYNTH6_SYNTH_ON_MASK 0x80000000 -#define PHY_ANALOG_SYNTH6_SYNTH_ON_GET(x) (((x) & 0x80000000) >> 31) - -/* macros for SYNTH7 */ -#define PHY_ANALOG_SYNTH7_ADDRESS 0x00000098 -#define PHY_ANALOG_SYNTH7_OFFSET 0x00000098 -#define PHY_ANALOG_SYNTH7_OVRCHANDECODER_MSB 0 -#define PHY_ANALOG_SYNTH7_OVRCHANDECODER_LSB 0 -#define PHY_ANALOG_SYNTH7_OVRCHANDECODER_MASK 0x00000001 -#define PHY_ANALOG_SYNTH7_OVRCHANDECODER_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_SYNTH7_OVRCHANDECODER_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_SYNTH7_FORCE_FRACLSB_MSB 1 -#define PHY_ANALOG_SYNTH7_FORCE_FRACLSB_LSB 1 -#define PHY_ANALOG_SYNTH7_FORCE_FRACLSB_MASK 0x00000002 -#define PHY_ANALOG_SYNTH7_FORCE_FRACLSB_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_SYNTH7_FORCE_FRACLSB_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_SYNTH7_CHANFRAC_MSB 18 -#define PHY_ANALOG_SYNTH7_CHANFRAC_LSB 2 -#define PHY_ANALOG_SYNTH7_CHANFRAC_MASK 0x0007fffc -#define PHY_ANALOG_SYNTH7_CHANFRAC_GET(x) (((x) & 0x0007fffc) >> 2) -#define PHY_ANALOG_SYNTH7_CHANFRAC_SET(x) (((x) << 2) & 0x0007fffc) -#define PHY_ANALOG_SYNTH7_CHANSEL_MSB 27 -#define PHY_ANALOG_SYNTH7_CHANSEL_LSB 19 -#define PHY_ANALOG_SYNTH7_CHANSEL_MASK 0x0ff80000 -#define PHY_ANALOG_SYNTH7_CHANSEL_GET(x) (((x) & 0x0ff80000) >> 19) -#define PHY_ANALOG_SYNTH7_CHANSEL_SET(x) (((x) << 19) & 0x0ff80000) -#define PHY_ANALOG_SYNTH7_AMODEREFSEL_MSB 29 -#define PHY_ANALOG_SYNTH7_AMODEREFSEL_LSB 28 -#define PHY_ANALOG_SYNTH7_AMODEREFSEL_MASK 0x30000000 -#define PHY_ANALOG_SYNTH7_AMODEREFSEL_GET(x) (((x) & 0x30000000) >> 28) -#define PHY_ANALOG_SYNTH7_AMODEREFSEL_SET(x) (((x) << 28) & 0x30000000) -#define PHY_ANALOG_SYNTH7_FRACMODE_MSB 30 -#define PHY_ANALOG_SYNTH7_FRACMODE_LSB 30 -#define PHY_ANALOG_SYNTH7_FRACMODE_MASK 0x40000000 -#define PHY_ANALOG_SYNTH7_FRACMODE_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_SYNTH7_FRACMODE_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_SYNTH7_LOADSYNTHCHANNEL_MSB 31 -#define PHY_ANALOG_SYNTH7_LOADSYNTHCHANNEL_LSB 31 -#define PHY_ANALOG_SYNTH7_LOADSYNTHCHANNEL_MASK 0x80000000 -#define PHY_ANALOG_SYNTH7_LOADSYNTHCHANNEL_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_SYNTH7_LOADSYNTHCHANNEL_SET(x) (((x) << 31) & 0x80000000) - -/* macros for SYNTH8 */ -#define PHY_ANALOG_SYNTH8_ADDRESS 0x0000009c -#define PHY_ANALOG_SYNTH8_OFFSET 0x0000009c -#define PHY_ANALOG_SYNTH8_CPSTEERING_EN_FRACN_MSB 0 -#define PHY_ANALOG_SYNTH8_CPSTEERING_EN_FRACN_LSB 0 -#define PHY_ANALOG_SYNTH8_CPSTEERING_EN_FRACN_MASK 0x00000001 -#define PHY_ANALOG_SYNTH8_CPSTEERING_EN_FRACN_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_SYNTH8_CPSTEERING_EN_FRACN_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_SYNTH8_LOOP_ICPB_MSB 7 -#define PHY_ANALOG_SYNTH8_LOOP_ICPB_LSB 1 -#define PHY_ANALOG_SYNTH8_LOOP_ICPB_MASK 0x000000fe -#define PHY_ANALOG_SYNTH8_LOOP_ICPB_GET(x) (((x) & 0x000000fe) >> 1) -#define PHY_ANALOG_SYNTH8_LOOP_ICPB_SET(x) (((x) << 1) & 0x000000fe) -#define PHY_ANALOG_SYNTH8_LOOP_CSB_MSB 11 -#define PHY_ANALOG_SYNTH8_LOOP_CSB_LSB 8 -#define PHY_ANALOG_SYNTH8_LOOP_CSB_MASK 0x00000f00 -#define PHY_ANALOG_SYNTH8_LOOP_CSB_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_SYNTH8_LOOP_CSB_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_SYNTH8_LOOP_RSB_MSB 16 -#define PHY_ANALOG_SYNTH8_LOOP_RSB_LSB 12 -#define PHY_ANALOG_SYNTH8_LOOP_RSB_MASK 0x0001f000 -#define PHY_ANALOG_SYNTH8_LOOP_RSB_GET(x) (((x) & 0x0001f000) >> 12) -#define PHY_ANALOG_SYNTH8_LOOP_RSB_SET(x) (((x) << 12) & 0x0001f000) -#define PHY_ANALOG_SYNTH8_LOOP_CPB_MSB 21 -#define PHY_ANALOG_SYNTH8_LOOP_CPB_LSB 17 -#define PHY_ANALOG_SYNTH8_LOOP_CPB_MASK 0x003e0000 -#define PHY_ANALOG_SYNTH8_LOOP_CPB_GET(x) (((x) & 0x003e0000) >> 17) -#define PHY_ANALOG_SYNTH8_LOOP_CPB_SET(x) (((x) << 17) & 0x003e0000) -#define PHY_ANALOG_SYNTH8_LOOP_3RD_ORDER_RB_MSB 26 -#define PHY_ANALOG_SYNTH8_LOOP_3RD_ORDER_RB_LSB 22 -#define PHY_ANALOG_SYNTH8_LOOP_3RD_ORDER_RB_MASK 0x07c00000 -#define PHY_ANALOG_SYNTH8_LOOP_3RD_ORDER_RB_GET(x) (((x) & 0x07c00000) >> 22) -#define PHY_ANALOG_SYNTH8_LOOP_3RD_ORDER_RB_SET(x) (((x) << 22) & 0x07c00000) -#define PHY_ANALOG_SYNTH8_REFDIVB_MSB 31 -#define PHY_ANALOG_SYNTH8_REFDIVB_LSB 27 -#define PHY_ANALOG_SYNTH8_REFDIVB_MASK 0xf8000000 -#define PHY_ANALOG_SYNTH8_REFDIVB_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_SYNTH8_REFDIVB_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for SYNTH9 */ -#define PHY_ANALOG_SYNTH9_ADDRESS 0x000000a0 -#define PHY_ANALOG_SYNTH9_OFFSET 0x000000a0 -#define PHY_ANALOG_SYNTH9_PFDDELAY_INTN_MSB 0 -#define PHY_ANALOG_SYNTH9_PFDDELAY_INTN_LSB 0 -#define PHY_ANALOG_SYNTH9_PFDDELAY_INTN_MASK 0x00000001 -#define PHY_ANALOG_SYNTH9_PFDDELAY_INTN_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_SYNTH9_PFDDELAY_INTN_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_SYNTH9_SLOPE_ICPA0_MSB 3 -#define PHY_ANALOG_SYNTH9_SLOPE_ICPA0_LSB 1 -#define PHY_ANALOG_SYNTH9_SLOPE_ICPA0_MASK 0x0000000e -#define PHY_ANALOG_SYNTH9_SLOPE_ICPA0_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_ANALOG_SYNTH9_SLOPE_ICPA0_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_ANALOG_SYNTH9_LOOP_ICPA0_MSB 7 -#define PHY_ANALOG_SYNTH9_LOOP_ICPA0_LSB 4 -#define PHY_ANALOG_SYNTH9_LOOP_ICPA0_MASK 0x000000f0 -#define PHY_ANALOG_SYNTH9_LOOP_ICPA0_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_ANALOG_SYNTH9_LOOP_ICPA0_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_ANALOG_SYNTH9_LOOP_CSA0_MSB 11 -#define PHY_ANALOG_SYNTH9_LOOP_CSA0_LSB 8 -#define PHY_ANALOG_SYNTH9_LOOP_CSA0_MASK 0x00000f00 -#define PHY_ANALOG_SYNTH9_LOOP_CSA0_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_SYNTH9_LOOP_CSA0_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_SYNTH9_LOOP_RSA0_MSB 16 -#define PHY_ANALOG_SYNTH9_LOOP_RSA0_LSB 12 -#define PHY_ANALOG_SYNTH9_LOOP_RSA0_MASK 0x0001f000 -#define PHY_ANALOG_SYNTH9_LOOP_RSA0_GET(x) (((x) & 0x0001f000) >> 12) -#define PHY_ANALOG_SYNTH9_LOOP_RSA0_SET(x) (((x) << 12) & 0x0001f000) -#define PHY_ANALOG_SYNTH9_LOOP_CPA0_MSB 21 -#define PHY_ANALOG_SYNTH9_LOOP_CPA0_LSB 17 -#define PHY_ANALOG_SYNTH9_LOOP_CPA0_MASK 0x003e0000 -#define PHY_ANALOG_SYNTH9_LOOP_CPA0_GET(x) (((x) & 0x003e0000) >> 17) -#define PHY_ANALOG_SYNTH9_LOOP_CPA0_SET(x) (((x) << 17) & 0x003e0000) -#define PHY_ANALOG_SYNTH9_LOOP_3RD_ORDER_RA_MSB 26 -#define PHY_ANALOG_SYNTH9_LOOP_3RD_ORDER_RA_LSB 22 -#define PHY_ANALOG_SYNTH9_LOOP_3RD_ORDER_RA_MASK 0x07c00000 -#define PHY_ANALOG_SYNTH9_LOOP_3RD_ORDER_RA_GET(x) (((x) & 0x07c00000) >> 22) -#define PHY_ANALOG_SYNTH9_LOOP_3RD_ORDER_RA_SET(x) (((x) << 22) & 0x07c00000) -#define PHY_ANALOG_SYNTH9_REFDIVA_MSB 31 -#define PHY_ANALOG_SYNTH9_REFDIVA_LSB 27 -#define PHY_ANALOG_SYNTH9_REFDIVA_MASK 0xf8000000 -#define PHY_ANALOG_SYNTH9_REFDIVA_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_SYNTH9_REFDIVA_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for SYNTH10 */ -#define PHY_ANALOG_SYNTH10_ADDRESS 0x000000a4 -#define PHY_ANALOG_SYNTH10_OFFSET 0x000000a4 -#define PHY_ANALOG_SYNTH10_SPARE10A_MSB 1 -#define PHY_ANALOG_SYNTH10_SPARE10A_LSB 0 -#define PHY_ANALOG_SYNTH10_SPARE10A_MASK 0x00000003 -#define PHY_ANALOG_SYNTH10_SPARE10A_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_SYNTH10_SPARE10A_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_SYNTH10_PWDB_ICLOBIAS50_MSB 4 -#define PHY_ANALOG_SYNTH10_PWDB_ICLOBIAS50_LSB 2 -#define PHY_ANALOG_SYNTH10_PWDB_ICLOBIAS50_MASK 0x0000001c -#define PHY_ANALOG_SYNTH10_PWDB_ICLOBIAS50_GET(x) (((x) & 0x0000001c) >> 2) -#define PHY_ANALOG_SYNTH10_PWDB_ICLOBIAS50_SET(x) (((x) << 2) & 0x0000001c) -#define PHY_ANALOG_SYNTH10_PWDB_IRSPARE25_MSB 7 -#define PHY_ANALOG_SYNTH10_PWDB_IRSPARE25_LSB 5 -#define PHY_ANALOG_SYNTH10_PWDB_IRSPARE25_MASK 0x000000e0 -#define PHY_ANALOG_SYNTH10_PWDB_IRSPARE25_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_SYNTH10_PWDB_IRSPARE25_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_SYNTH10_PWDB_ICSPARE25_MSB 10 -#define PHY_ANALOG_SYNTH10_PWDB_ICSPARE25_LSB 8 -#define PHY_ANALOG_SYNTH10_PWDB_ICSPARE25_MASK 0x00000700 -#define PHY_ANALOG_SYNTH10_PWDB_ICSPARE25_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_SYNTH10_PWDB_ICSPARE25_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_SYNTH10_SLOPE_ICPA1_MSB 13 -#define PHY_ANALOG_SYNTH10_SLOPE_ICPA1_LSB 11 -#define PHY_ANALOG_SYNTH10_SLOPE_ICPA1_MASK 0x00003800 -#define PHY_ANALOG_SYNTH10_SLOPE_ICPA1_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_SYNTH10_SLOPE_ICPA1_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_SYNTH10_LOOP_ICPA1_MSB 17 -#define PHY_ANALOG_SYNTH10_LOOP_ICPA1_LSB 14 -#define PHY_ANALOG_SYNTH10_LOOP_ICPA1_MASK 0x0003c000 -#define PHY_ANALOG_SYNTH10_LOOP_ICPA1_GET(x) (((x) & 0x0003c000) >> 14) -#define PHY_ANALOG_SYNTH10_LOOP_ICPA1_SET(x) (((x) << 14) & 0x0003c000) -#define PHY_ANALOG_SYNTH10_LOOP_CSA1_MSB 21 -#define PHY_ANALOG_SYNTH10_LOOP_CSA1_LSB 18 -#define PHY_ANALOG_SYNTH10_LOOP_CSA1_MASK 0x003c0000 -#define PHY_ANALOG_SYNTH10_LOOP_CSA1_GET(x) (((x) & 0x003c0000) >> 18) -#define PHY_ANALOG_SYNTH10_LOOP_CSA1_SET(x) (((x) << 18) & 0x003c0000) -#define PHY_ANALOG_SYNTH10_LOOP_RSA1_MSB 26 -#define PHY_ANALOG_SYNTH10_LOOP_RSA1_LSB 22 -#define PHY_ANALOG_SYNTH10_LOOP_RSA1_MASK 0x07c00000 -#define PHY_ANALOG_SYNTH10_LOOP_RSA1_GET(x) (((x) & 0x07c00000) >> 22) -#define PHY_ANALOG_SYNTH10_LOOP_RSA1_SET(x) (((x) << 22) & 0x07c00000) -#define PHY_ANALOG_SYNTH10_LOOP_CPA1_MSB 31 -#define PHY_ANALOG_SYNTH10_LOOP_CPA1_LSB 27 -#define PHY_ANALOG_SYNTH10_LOOP_CPA1_MASK 0xf8000000 -#define PHY_ANALOG_SYNTH10_LOOP_CPA1_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_SYNTH10_LOOP_CPA1_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for SYNTH11 */ -#define PHY_ANALOG_SYNTH11_ADDRESS 0x000000a8 -#define PHY_ANALOG_SYNTH11_OFFSET 0x000000a8 -#define PHY_ANALOG_SYNTH11_SPARE11A_MSB 4 -#define PHY_ANALOG_SYNTH11_SPARE11A_LSB 0 -#define PHY_ANALOG_SYNTH11_SPARE11A_MASK 0x0000001f -#define PHY_ANALOG_SYNTH11_SPARE11A_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_ANALOG_SYNTH11_SPARE11A_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_ANALOG_SYNTH11_FORCE_LOBUF5G_ON_MSB 5 -#define PHY_ANALOG_SYNTH11_FORCE_LOBUF5G_ON_LSB 5 -#define PHY_ANALOG_SYNTH11_FORCE_LOBUF5G_ON_MASK 0x00000020 -#define PHY_ANALOG_SYNTH11_FORCE_LOBUF5G_ON_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_SYNTH11_FORCE_LOBUF5G_ON_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_SYNTH11_LOREFSEL_MSB 7 -#define PHY_ANALOG_SYNTH11_LOREFSEL_LSB 6 -#define PHY_ANALOG_SYNTH11_LOREFSEL_MASK 0x000000c0 -#define PHY_ANALOG_SYNTH11_LOREFSEL_GET(x) (((x) & 0x000000c0) >> 6) -#define PHY_ANALOG_SYNTH11_LOREFSEL_SET(x) (((x) << 6) & 0x000000c0) -#define PHY_ANALOG_SYNTH11_LOBUF2GTUNE_MSB 9 -#define PHY_ANALOG_SYNTH11_LOBUF2GTUNE_LSB 8 -#define PHY_ANALOG_SYNTH11_LOBUF2GTUNE_MASK 0x00000300 -#define PHY_ANALOG_SYNTH11_LOBUF2GTUNE_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_ANALOG_SYNTH11_LOBUF2GTUNE_SET(x) (((x) << 8) & 0x00000300) -#define PHY_ANALOG_SYNTH11_CPSTEERING_MODE_MSB 10 -#define PHY_ANALOG_SYNTH11_CPSTEERING_MODE_LSB 10 -#define PHY_ANALOG_SYNTH11_CPSTEERING_MODE_MASK 0x00000400 -#define PHY_ANALOG_SYNTH11_CPSTEERING_MODE_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_SYNTH11_CPSTEERING_MODE_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_SYNTH11_SLOPE_ICPA2_MSB 13 -#define PHY_ANALOG_SYNTH11_SLOPE_ICPA2_LSB 11 -#define PHY_ANALOG_SYNTH11_SLOPE_ICPA2_MASK 0x00003800 -#define PHY_ANALOG_SYNTH11_SLOPE_ICPA2_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_SYNTH11_SLOPE_ICPA2_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_SYNTH11_LOOP_ICPA2_MSB 17 -#define PHY_ANALOG_SYNTH11_LOOP_ICPA2_LSB 14 -#define PHY_ANALOG_SYNTH11_LOOP_ICPA2_MASK 0x0003c000 -#define PHY_ANALOG_SYNTH11_LOOP_ICPA2_GET(x) (((x) & 0x0003c000) >> 14) -#define PHY_ANALOG_SYNTH11_LOOP_ICPA2_SET(x) (((x) << 14) & 0x0003c000) -#define PHY_ANALOG_SYNTH11_LOOP_CSA2_MSB 21 -#define PHY_ANALOG_SYNTH11_LOOP_CSA2_LSB 18 -#define PHY_ANALOG_SYNTH11_LOOP_CSA2_MASK 0x003c0000 -#define PHY_ANALOG_SYNTH11_LOOP_CSA2_GET(x) (((x) & 0x003c0000) >> 18) -#define PHY_ANALOG_SYNTH11_LOOP_CSA2_SET(x) (((x) << 18) & 0x003c0000) -#define PHY_ANALOG_SYNTH11_LOOP_RSA2_MSB 26 -#define PHY_ANALOG_SYNTH11_LOOP_RSA2_LSB 22 -#define PHY_ANALOG_SYNTH11_LOOP_RSA2_MASK 0x07c00000 -#define PHY_ANALOG_SYNTH11_LOOP_RSA2_GET(x) (((x) & 0x07c00000) >> 22) -#define PHY_ANALOG_SYNTH11_LOOP_RSA2_SET(x) (((x) << 22) & 0x07c00000) -#define PHY_ANALOG_SYNTH11_LOOP_CPA2_MSB 31 -#define PHY_ANALOG_SYNTH11_LOOP_CPA2_LSB 27 -#define PHY_ANALOG_SYNTH11_LOOP_CPA2_MASK 0xf8000000 -#define PHY_ANALOG_SYNTH11_LOOP_CPA2_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_SYNTH11_LOOP_CPA2_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for SYNTH12 */ -#define PHY_ANALOG_SYNTH12_ADDRESS 0x000000ac -#define PHY_ANALOG_SYNTH12_OFFSET 0x000000ac -#define PHY_ANALOG_SYNTH12_SPARE12A_MSB 9 -#define PHY_ANALOG_SYNTH12_SPARE12A_LSB 0 -#define PHY_ANALOG_SYNTH12_SPARE12A_MASK 0x000003ff -#define PHY_ANALOG_SYNTH12_SPARE12A_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_ANALOG_SYNTH12_SPARE12A_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_ANALOG_SYNTH12_LOOPLEAKCUR_FRACN_MSB 13 -#define PHY_ANALOG_SYNTH12_LOOPLEAKCUR_FRACN_LSB 10 -#define PHY_ANALOG_SYNTH12_LOOPLEAKCUR_FRACN_MASK 0x00003c00 -#define PHY_ANALOG_SYNTH12_LOOPLEAKCUR_FRACN_GET(x) (((x) & 0x00003c00) >> 10) -#define PHY_ANALOG_SYNTH12_LOOPLEAKCUR_FRACN_SET(x) (((x) << 10) & 0x00003c00) -#define PHY_ANALOG_SYNTH12_CPLOWLK_FRACN_MSB 14 -#define PHY_ANALOG_SYNTH12_CPLOWLK_FRACN_LSB 14 -#define PHY_ANALOG_SYNTH12_CPLOWLK_FRACN_MASK 0x00004000 -#define PHY_ANALOG_SYNTH12_CPLOWLK_FRACN_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_SYNTH12_CPLOWLK_FRACN_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_SYNTH12_CPBIAS_FRACN_MSB 16 -#define PHY_ANALOG_SYNTH12_CPBIAS_FRACN_LSB 15 -#define PHY_ANALOG_SYNTH12_CPBIAS_FRACN_MASK 0x00018000 -#define PHY_ANALOG_SYNTH12_CPBIAS_FRACN_GET(x) (((x) & 0x00018000) >> 15) -#define PHY_ANALOG_SYNTH12_CPBIAS_FRACN_SET(x) (((x) << 15) & 0x00018000) -#define PHY_ANALOG_SYNTH12_SYNTHDIGOUTEN_MSB 17 -#define PHY_ANALOG_SYNTH12_SYNTHDIGOUTEN_LSB 17 -#define PHY_ANALOG_SYNTH12_SYNTHDIGOUTEN_MASK 0x00020000 -#define PHY_ANALOG_SYNTH12_SYNTHDIGOUTEN_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_SYNTH12_SYNTHDIGOUTEN_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_SYNTH12_STRCONT_MSB 18 -#define PHY_ANALOG_SYNTH12_STRCONT_LSB 18 -#define PHY_ANALOG_SYNTH12_STRCONT_MASK 0x00040000 -#define PHY_ANALOG_SYNTH12_STRCONT_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_SYNTH12_STRCONT_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_SYNTH12_VREFMUL3_MSB 22 -#define PHY_ANALOG_SYNTH12_VREFMUL3_LSB 19 -#define PHY_ANALOG_SYNTH12_VREFMUL3_MASK 0x00780000 -#define PHY_ANALOG_SYNTH12_VREFMUL3_GET(x) (((x) & 0x00780000) >> 19) -#define PHY_ANALOG_SYNTH12_VREFMUL3_SET(x) (((x) << 19) & 0x00780000) -#define PHY_ANALOG_SYNTH12_VREFMUL2_MSB 26 -#define PHY_ANALOG_SYNTH12_VREFMUL2_LSB 23 -#define PHY_ANALOG_SYNTH12_VREFMUL2_MASK 0x07800000 -#define PHY_ANALOG_SYNTH12_VREFMUL2_GET(x) (((x) & 0x07800000) >> 23) -#define PHY_ANALOG_SYNTH12_VREFMUL2_SET(x) (((x) << 23) & 0x07800000) -#define PHY_ANALOG_SYNTH12_VREFMUL1_MSB 30 -#define PHY_ANALOG_SYNTH12_VREFMUL1_LSB 27 -#define PHY_ANALOG_SYNTH12_VREFMUL1_MASK 0x78000000 -#define PHY_ANALOG_SYNTH12_VREFMUL1_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_ANALOG_SYNTH12_VREFMUL1_SET(x) (((x) << 27) & 0x78000000) -#define PHY_ANALOG_SYNTH12_CLK_DOUBLER_EN_MSB 31 -#define PHY_ANALOG_SYNTH12_CLK_DOUBLER_EN_LSB 31 -#define PHY_ANALOG_SYNTH12_CLK_DOUBLER_EN_MASK 0x80000000 -#define PHY_ANALOG_SYNTH12_CLK_DOUBLER_EN_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_SYNTH12_CLK_DOUBLER_EN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for SYNTH13 */ -#define PHY_ANALOG_SYNTH13_ADDRESS 0x000000b0 -#define PHY_ANALOG_SYNTH13_OFFSET 0x000000b0 -#define PHY_ANALOG_SYNTH13_SPARE13A_MSB 0 -#define PHY_ANALOG_SYNTH13_SPARE13A_LSB 0 -#define PHY_ANALOG_SYNTH13_SPARE13A_MASK 0x00000001 -#define PHY_ANALOG_SYNTH13_SPARE13A_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_SYNTH13_SPARE13A_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_SYNTH13_SLOPE_ICPA_FRACN_MSB 3 -#define PHY_ANALOG_SYNTH13_SLOPE_ICPA_FRACN_LSB 1 -#define PHY_ANALOG_SYNTH13_SLOPE_ICPA_FRACN_MASK 0x0000000e -#define PHY_ANALOG_SYNTH13_SLOPE_ICPA_FRACN_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_ANALOG_SYNTH13_SLOPE_ICPA_FRACN_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_ANALOG_SYNTH13_LOOP_ICPA_FRACN_MSB 7 -#define PHY_ANALOG_SYNTH13_LOOP_ICPA_FRACN_LSB 4 -#define PHY_ANALOG_SYNTH13_LOOP_ICPA_FRACN_MASK 0x000000f0 -#define PHY_ANALOG_SYNTH13_LOOP_ICPA_FRACN_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_ANALOG_SYNTH13_LOOP_ICPA_FRACN_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_ANALOG_SYNTH13_LOOP_CSA_FRACN_MSB 11 -#define PHY_ANALOG_SYNTH13_LOOP_CSA_FRACN_LSB 8 -#define PHY_ANALOG_SYNTH13_LOOP_CSA_FRACN_MASK 0x00000f00 -#define PHY_ANALOG_SYNTH13_LOOP_CSA_FRACN_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_SYNTH13_LOOP_CSA_FRACN_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_SYNTH13_LOOP_RSA_FRACN_MSB 16 -#define PHY_ANALOG_SYNTH13_LOOP_RSA_FRACN_LSB 12 -#define PHY_ANALOG_SYNTH13_LOOP_RSA_FRACN_MASK 0x0001f000 -#define PHY_ANALOG_SYNTH13_LOOP_RSA_FRACN_GET(x) (((x) & 0x0001f000) >> 12) -#define PHY_ANALOG_SYNTH13_LOOP_RSA_FRACN_SET(x) (((x) << 12) & 0x0001f000) -#define PHY_ANALOG_SYNTH13_LOOP_CPA_FRACN_MSB 21 -#define PHY_ANALOG_SYNTH13_LOOP_CPA_FRACN_LSB 17 -#define PHY_ANALOG_SYNTH13_LOOP_CPA_FRACN_MASK 0x003e0000 -#define PHY_ANALOG_SYNTH13_LOOP_CPA_FRACN_GET(x) (((x) & 0x003e0000) >> 17) -#define PHY_ANALOG_SYNTH13_LOOP_CPA_FRACN_SET(x) (((x) << 17) & 0x003e0000) -#define PHY_ANALOG_SYNTH13_LOOP_3RD_ORDER_RA_FRACN_MSB 26 -#define PHY_ANALOG_SYNTH13_LOOP_3RD_ORDER_RA_FRACN_LSB 22 -#define PHY_ANALOG_SYNTH13_LOOP_3RD_ORDER_RA_FRACN_MASK 0x07c00000 -#define PHY_ANALOG_SYNTH13_LOOP_3RD_ORDER_RA_FRACN_GET(x) (((x) & 0x07c00000) >> 22) -#define PHY_ANALOG_SYNTH13_LOOP_3RD_ORDER_RA_FRACN_SET(x) (((x) << 22) & 0x07c00000) -#define PHY_ANALOG_SYNTH13_REFDIVA_FRACN_MSB 31 -#define PHY_ANALOG_SYNTH13_REFDIVA_FRACN_LSB 27 -#define PHY_ANALOG_SYNTH13_REFDIVA_FRACN_MASK 0xf8000000 -#define PHY_ANALOG_SYNTH13_REFDIVA_FRACN_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_SYNTH13_REFDIVA_FRACN_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for SYNTH14 */ -#define PHY_ANALOG_SYNTH14_ADDRESS 0x000000b4 -#define PHY_ANALOG_SYNTH14_OFFSET 0x000000b4 -#define PHY_ANALOG_SYNTH14_SPARE14A_MSB 1 -#define PHY_ANALOG_SYNTH14_SPARE14A_LSB 0 -#define PHY_ANALOG_SYNTH14_SPARE14A_MASK 0x00000003 -#define PHY_ANALOG_SYNTH14_SPARE14A_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_SYNTH14_SPARE14A_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_3_MSB 3 -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_3_LSB 2 -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_3_MASK 0x0000000c -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_3_GET(x) (((x) & 0x0000000c) >> 2) -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_3_SET(x) (((x) << 2) & 0x0000000c) -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_3_MSB 5 -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_3_LSB 4 -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_3_MASK 0x00000030 -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_3_GET(x) (((x) & 0x00000030) >> 4) -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_3_SET(x) (((x) << 4) & 0x00000030) -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_2_MSB 7 -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_2_LSB 6 -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_2_MASK 0x000000c0 -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_2_GET(x) (((x) & 0x000000c0) >> 6) -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_2_SET(x) (((x) << 6) & 0x000000c0) -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_2_MSB 9 -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_2_LSB 8 -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_2_MASK 0x00000300 -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_2_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_2_SET(x) (((x) << 8) & 0x00000300) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_3_MSB 10 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_3_LSB 10 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_3_MASK 0x00000400 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_3_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_3_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_3_MSB 11 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_3_LSB 11 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_3_MASK 0x00000800 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_3_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_3_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_2_MSB 12 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_2_LSB 12 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_2_MASK 0x00001000 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_2_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_2_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_2_MSB 13 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_2_LSB 13 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_2_MASK 0x00002000 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_2_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_2_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_SYNTH14_PWUPLO23_PD_MSB 16 -#define PHY_ANALOG_SYNTH14_PWUPLO23_PD_LSB 14 -#define PHY_ANALOG_SYNTH14_PWUPLO23_PD_MASK 0x0001c000 -#define PHY_ANALOG_SYNTH14_PWUPLO23_PD_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_SYNTH14_PWUPLO23_PD_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_3_MSB 19 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_3_LSB 17 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_3_MASK 0x000e0000 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_3_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_3_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_3_MSB 22 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_3_LSB 20 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_3_MASK 0x00700000 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_3_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_3_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_2_MSB 25 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_2_LSB 23 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_2_MASK 0x03800000 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_2_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_2_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_2_MSB 28 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_2_LSB 26 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_2_MASK 0x1c000000 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_2_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_2_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_SYNTH14_PWDB_ICLVLSHFT_MSB 31 -#define PHY_ANALOG_SYNTH14_PWDB_ICLVLSHFT_LSB 29 -#define PHY_ANALOG_SYNTH14_PWDB_ICLVLSHFT_MASK 0xe0000000 -#define PHY_ANALOG_SYNTH14_PWDB_ICLVLSHFT_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_SYNTH14_PWDB_ICLVLSHFT_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for BIAS1 */ -#define PHY_ANALOG_BIAS1_ADDRESS 0x000000c0 -#define PHY_ANALOG_BIAS1_OFFSET 0x000000c0 -#define PHY_ANALOG_BIAS1_SPARE1_MSB 6 -#define PHY_ANALOG_BIAS1_SPARE1_LSB 0 -#define PHY_ANALOG_BIAS1_SPARE1_MASK 0x0000007f -#define PHY_ANALOG_BIAS1_SPARE1_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_ANALOG_BIAS1_SPARE1_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_ANALOG_BIAS1_PWD_IC25V2IQ_MSB 9 -#define PHY_ANALOG_BIAS1_PWD_IC25V2IQ_LSB 7 -#define PHY_ANALOG_BIAS1_PWD_IC25V2IQ_MASK 0x00000380 -#define PHY_ANALOG_BIAS1_PWD_IC25V2IQ_GET(x) (((x) & 0x00000380) >> 7) -#define PHY_ANALOG_BIAS1_PWD_IC25V2IQ_SET(x) (((x) << 7) & 0x00000380) -#define PHY_ANALOG_BIAS1_PWD_IC25V2II_MSB 12 -#define PHY_ANALOG_BIAS1_PWD_IC25V2II_LSB 10 -#define PHY_ANALOG_BIAS1_PWD_IC25V2II_MASK 0x00001c00 -#define PHY_ANALOG_BIAS1_PWD_IC25V2II_GET(x) (((x) & 0x00001c00) >> 10) -#define PHY_ANALOG_BIAS1_PWD_IC25V2II_SET(x) (((x) << 10) & 0x00001c00) -#define PHY_ANALOG_BIAS1_PWD_IC25BB_MSB 15 -#define PHY_ANALOG_BIAS1_PWD_IC25BB_LSB 13 -#define PHY_ANALOG_BIAS1_PWD_IC25BB_MASK 0x0000e000 -#define PHY_ANALOG_BIAS1_PWD_IC25BB_GET(x) (((x) & 0x0000e000) >> 13) -#define PHY_ANALOG_BIAS1_PWD_IC25BB_SET(x) (((x) << 13) & 0x0000e000) -#define PHY_ANALOG_BIAS1_PWD_IC25DAC_MSB 18 -#define PHY_ANALOG_BIAS1_PWD_IC25DAC_LSB 16 -#define PHY_ANALOG_BIAS1_PWD_IC25DAC_MASK 0x00070000 -#define PHY_ANALOG_BIAS1_PWD_IC25DAC_GET(x) (((x) & 0x00070000) >> 16) -#define PHY_ANALOG_BIAS1_PWD_IC25DAC_SET(x) (((x) << 16) & 0x00070000) -#define PHY_ANALOG_BIAS1_PWD_IC25FIR_MSB 21 -#define PHY_ANALOG_BIAS1_PWD_IC25FIR_LSB 19 -#define PHY_ANALOG_BIAS1_PWD_IC25FIR_MASK 0x00380000 -#define PHY_ANALOG_BIAS1_PWD_IC25FIR_GET(x) (((x) & 0x00380000) >> 19) -#define PHY_ANALOG_BIAS1_PWD_IC25FIR_SET(x) (((x) << 19) & 0x00380000) -#define PHY_ANALOG_BIAS1_PWD_IC25ADC_MSB 24 -#define PHY_ANALOG_BIAS1_PWD_IC25ADC_LSB 22 -#define PHY_ANALOG_BIAS1_PWD_IC25ADC_MASK 0x01c00000 -#define PHY_ANALOG_BIAS1_PWD_IC25ADC_GET(x) (((x) & 0x01c00000) >> 22) -#define PHY_ANALOG_BIAS1_PWD_IC25ADC_SET(x) (((x) << 22) & 0x01c00000) -#define PHY_ANALOG_BIAS1_BIAS_SEL_MSB 31 -#define PHY_ANALOG_BIAS1_BIAS_SEL_LSB 25 -#define PHY_ANALOG_BIAS1_BIAS_SEL_MASK 0xfe000000 -#define PHY_ANALOG_BIAS1_BIAS_SEL_GET(x) (((x) & 0xfe000000) >> 25) -#define PHY_ANALOG_BIAS1_BIAS_SEL_SET(x) (((x) << 25) & 0xfe000000) - -/* macros for BIAS2 */ -#define PHY_ANALOG_BIAS2_ADDRESS 0x000000c4 -#define PHY_ANALOG_BIAS2_OFFSET 0x000000c4 -#define PHY_ANALOG_BIAS2_SPARE2_MSB 4 -#define PHY_ANALOG_BIAS2_SPARE2_LSB 0 -#define PHY_ANALOG_BIAS2_SPARE2_MASK 0x0000001f -#define PHY_ANALOG_BIAS2_SPARE2_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_ANALOG_BIAS2_SPARE2_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_ANALOG_BIAS2_PWD_IC25XPA_MSB 7 -#define PHY_ANALOG_BIAS2_PWD_IC25XPA_LSB 5 -#define PHY_ANALOG_BIAS2_PWD_IC25XPA_MASK 0x000000e0 -#define PHY_ANALOG_BIAS2_PWD_IC25XPA_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_BIAS2_PWD_IC25XPA_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_BIAS2_PWD_IC25XTAL_MSB 10 -#define PHY_ANALOG_BIAS2_PWD_IC25XTAL_LSB 8 -#define PHY_ANALOG_BIAS2_PWD_IC25XTAL_MASK 0x00000700 -#define PHY_ANALOG_BIAS2_PWD_IC25XTAL_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_BIAS2_PWD_IC25XTAL_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_BIAS2_PWD_IC25TXRF_MSB 13 -#define PHY_ANALOG_BIAS2_PWD_IC25TXRF_LSB 11 -#define PHY_ANALOG_BIAS2_PWD_IC25TXRF_MASK 0x00003800 -#define PHY_ANALOG_BIAS2_PWD_IC25TXRF_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_BIAS2_PWD_IC25TXRF_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_BIAS2_PWD_IC25RXRF_MSB 16 -#define PHY_ANALOG_BIAS2_PWD_IC25RXRF_LSB 14 -#define PHY_ANALOG_BIAS2_PWD_IC25RXRF_MASK 0x0001c000 -#define PHY_ANALOG_BIAS2_PWD_IC25RXRF_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_BIAS2_PWD_IC25RXRF_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_BIAS2_PWD_IC25SYNTH_MSB 19 -#define PHY_ANALOG_BIAS2_PWD_IC25SYNTH_LSB 17 -#define PHY_ANALOG_BIAS2_PWD_IC25SYNTH_MASK 0x000e0000 -#define PHY_ANALOG_BIAS2_PWD_IC25SYNTH_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_BIAS2_PWD_IC25SYNTH_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLREG_MSB 22 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLREG_LSB 20 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLREG_MASK 0x00700000 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLREG_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLREG_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP2_MSB 25 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP2_LSB 23 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP2_MASK 0x03800000 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP2_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP2_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP_MSB 28 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP_LSB 26 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP_MASK 0x1c000000 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLGM_MSB 31 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLGM_LSB 29 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLGM_MASK 0xe0000000 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLGM_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLGM_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for BIAS3 */ -#define PHY_ANALOG_BIAS3_ADDRESS 0x000000c8 -#define PHY_ANALOG_BIAS3_OFFSET 0x000000c8 -#define PHY_ANALOG_BIAS3_SPARE3_MSB 1 -#define PHY_ANALOG_BIAS3_SPARE3_LSB 0 -#define PHY_ANALOG_BIAS3_SPARE3_MASK 0x00000003 -#define PHY_ANALOG_BIAS3_SPARE3_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_BIAS3_SPARE3_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_BIAS3_PWD_IR25SAR_MSB 4 -#define PHY_ANALOG_BIAS3_PWD_IR25SAR_LSB 2 -#define PHY_ANALOG_BIAS3_PWD_IR25SAR_MASK 0x0000001c -#define PHY_ANALOG_BIAS3_PWD_IR25SAR_GET(x) (((x) & 0x0000001c) >> 2) -#define PHY_ANALOG_BIAS3_PWD_IR25SAR_SET(x) (((x) << 2) & 0x0000001c) -#define PHY_ANALOG_BIAS3_PWD_IR25TXRF_MSB 7 -#define PHY_ANALOG_BIAS3_PWD_IR25TXRF_LSB 5 -#define PHY_ANALOG_BIAS3_PWD_IR25TXRF_MASK 0x000000e0 -#define PHY_ANALOG_BIAS3_PWD_IR25TXRF_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_BIAS3_PWD_IR25TXRF_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_BIAS3_PWD_IR25RXRF_MSB 10 -#define PHY_ANALOG_BIAS3_PWD_IR25RXRF_LSB 8 -#define PHY_ANALOG_BIAS3_PWD_IR25RXRF_MASK 0x00000700 -#define PHY_ANALOG_BIAS3_PWD_IR25RXRF_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_BIAS3_PWD_IR25RXRF_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_BIAS3_PWD_IR25SYNTH_MSB 13 -#define PHY_ANALOG_BIAS3_PWD_IR25SYNTH_LSB 11 -#define PHY_ANALOG_BIAS3_PWD_IR25SYNTH_MASK 0x00003800 -#define PHY_ANALOG_BIAS3_PWD_IR25SYNTH_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_BIAS3_PWD_IR25SYNTH_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_BIAS3_PWD_IR25PLLREG_MSB 16 -#define PHY_ANALOG_BIAS3_PWD_IR25PLLREG_LSB 14 -#define PHY_ANALOG_BIAS3_PWD_IR25PLLREG_MASK 0x0001c000 -#define PHY_ANALOG_BIAS3_PWD_IR25PLLREG_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_BIAS3_PWD_IR25PLLREG_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_BIAS3_PWD_IR25BB_MSB 19 -#define PHY_ANALOG_BIAS3_PWD_IR25BB_LSB 17 -#define PHY_ANALOG_BIAS3_PWD_IR25BB_MASK 0x000e0000 -#define PHY_ANALOG_BIAS3_PWD_IR25BB_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_BIAS3_PWD_IR25BB_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_BIAS3_PWD_IR50DAC_MSB 22 -#define PHY_ANALOG_BIAS3_PWD_IR50DAC_LSB 20 -#define PHY_ANALOG_BIAS3_PWD_IR50DAC_MASK 0x00700000 -#define PHY_ANALOG_BIAS3_PWD_IR50DAC_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_BIAS3_PWD_IR50DAC_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_BIAS3_PWD_IR25DAC_MSB 25 -#define PHY_ANALOG_BIAS3_PWD_IR25DAC_LSB 23 -#define PHY_ANALOG_BIAS3_PWD_IR25DAC_MASK 0x03800000 -#define PHY_ANALOG_BIAS3_PWD_IR25DAC_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_BIAS3_PWD_IR25DAC_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_BIAS3_PWD_IR25FIR_MSB 28 -#define PHY_ANALOG_BIAS3_PWD_IR25FIR_LSB 26 -#define PHY_ANALOG_BIAS3_PWD_IR25FIR_MASK 0x1c000000 -#define PHY_ANALOG_BIAS3_PWD_IR25FIR_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_BIAS3_PWD_IR25FIR_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_BIAS3_PWD_IR50ADC_MSB 31 -#define PHY_ANALOG_BIAS3_PWD_IR50ADC_LSB 29 -#define PHY_ANALOG_BIAS3_PWD_IR50ADC_MASK 0xe0000000 -#define PHY_ANALOG_BIAS3_PWD_IR50ADC_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_BIAS3_PWD_IR50ADC_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for BIAS4 */ -#define PHY_ANALOG_BIAS4_ADDRESS 0x000000cc -#define PHY_ANALOG_BIAS4_OFFSET 0x000000cc -#define PHY_ANALOG_BIAS4_SPARE4_MSB 10 -#define PHY_ANALOG_BIAS4_SPARE4_LSB 0 -#define PHY_ANALOG_BIAS4_SPARE4_MASK 0x000007ff -#define PHY_ANALOG_BIAS4_SPARE4_GET(x) (((x) & 0x000007ff) >> 0) -#define PHY_ANALOG_BIAS4_SPARE4_SET(x) (((x) << 0) & 0x000007ff) -#define PHY_ANALOG_BIAS4_PWD_IR25SPARED_MSB 13 -#define PHY_ANALOG_BIAS4_PWD_IR25SPARED_LSB 11 -#define PHY_ANALOG_BIAS4_PWD_IR25SPARED_MASK 0x00003800 -#define PHY_ANALOG_BIAS4_PWD_IR25SPARED_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_BIAS4_PWD_IR25SPARED_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREC_MSB 16 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREC_LSB 14 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREC_MASK 0x0001c000 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREC_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREC_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREB_MSB 19 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREB_LSB 17 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREB_MASK 0x000e0000 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREB_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREB_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_BIAS4_PWD_IR25XPA_MSB 22 -#define PHY_ANALOG_BIAS4_PWD_IR25XPA_LSB 20 -#define PHY_ANALOG_BIAS4_PWD_IR25XPA_MASK 0x00700000 -#define PHY_ANALOG_BIAS4_PWD_IR25XPA_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_BIAS4_PWD_IR25XPA_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREC_MSB 25 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREC_LSB 23 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREC_MASK 0x03800000 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREC_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREC_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREB_MSB 28 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREB_LSB 26 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREB_MASK 0x1c000000 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREB_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREB_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREA_MSB 31 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREA_LSB 29 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREA_MASK 0xe0000000 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREA_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREA_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for RXTX1 */ -#define PHY_ANALOG_RXTX1_ADDRESS 0x00000100 -#define PHY_ANALOG_RXTX1_OFFSET 0x00000100 -#define PHY_ANALOG_RXTX1_SCFIR_GAIN_MSB 0 -#define PHY_ANALOG_RXTX1_SCFIR_GAIN_LSB 0 -#define PHY_ANALOG_RXTX1_SCFIR_GAIN_MASK 0x00000001 -#define PHY_ANALOG_RXTX1_SCFIR_GAIN_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXTX1_SCFIR_GAIN_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXTX1_MANRXGAIN_MSB 1 -#define PHY_ANALOG_RXTX1_MANRXGAIN_LSB 1 -#define PHY_ANALOG_RXTX1_MANRXGAIN_MASK 0x00000002 -#define PHY_ANALOG_RXTX1_MANRXGAIN_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_RXTX1_MANRXGAIN_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_RXTX1_AGC_DBDAC_MSB 5 -#define PHY_ANALOG_RXTX1_AGC_DBDAC_LSB 2 -#define PHY_ANALOG_RXTX1_AGC_DBDAC_MASK 0x0000003c -#define PHY_ANALOG_RXTX1_AGC_DBDAC_GET(x) (((x) & 0x0000003c) >> 2) -#define PHY_ANALOG_RXTX1_AGC_DBDAC_SET(x) (((x) << 2) & 0x0000003c) -#define PHY_ANALOG_RXTX1_OVR_AGC_DBDAC_MSB 6 -#define PHY_ANALOG_RXTX1_OVR_AGC_DBDAC_LSB 6 -#define PHY_ANALOG_RXTX1_OVR_AGC_DBDAC_MASK 0x00000040 -#define PHY_ANALOG_RXTX1_OVR_AGC_DBDAC_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_RXTX1_OVR_AGC_DBDAC_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_RXTX1_ENABLE_PAL_MSB 7 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_LSB 7 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_MASK 0x00000080 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RXTX1_ENABLE_PAL_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RXTX1_ENABLE_PAL_OVR_MSB 8 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_OVR_LSB 8 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_OVR_MASK 0x00000100 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_OVR_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_RXTX1_ENABLE_PAL_OVR_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_RXTX1_TX1DB_BIQUAD_MSB 11 -#define PHY_ANALOG_RXTX1_TX1DB_BIQUAD_LSB 9 -#define PHY_ANALOG_RXTX1_TX1DB_BIQUAD_MASK 0x00000e00 -#define PHY_ANALOG_RXTX1_TX1DB_BIQUAD_GET(x) (((x) & 0x00000e00) >> 9) -#define PHY_ANALOG_RXTX1_TX1DB_BIQUAD_SET(x) (((x) << 9) & 0x00000e00) -#define PHY_ANALOG_RXTX1_TX6DB_BIQUAD_MSB 13 -#define PHY_ANALOG_RXTX1_TX6DB_BIQUAD_LSB 12 -#define PHY_ANALOG_RXTX1_TX6DB_BIQUAD_MASK 0x00003000 -#define PHY_ANALOG_RXTX1_TX6DB_BIQUAD_GET(x) (((x) & 0x00003000) >> 12) -#define PHY_ANALOG_RXTX1_TX6DB_BIQUAD_SET(x) (((x) << 12) & 0x00003000) -#define PHY_ANALOG_RXTX1_PADRVHALFGN2G_MSB 14 -#define PHY_ANALOG_RXTX1_PADRVHALFGN2G_LSB 14 -#define PHY_ANALOG_RXTX1_PADRVHALFGN2G_MASK 0x00004000 -#define PHY_ANALOG_RXTX1_PADRVHALFGN2G_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_RXTX1_PADRVHALFGN2G_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_RXTX1_PADRV2GN_MSB 18 -#define PHY_ANALOG_RXTX1_PADRV2GN_LSB 15 -#define PHY_ANALOG_RXTX1_PADRV2GN_MASK 0x00078000 -#define PHY_ANALOG_RXTX1_PADRV2GN_GET(x) (((x) & 0x00078000) >> 15) -#define PHY_ANALOG_RXTX1_PADRV2GN_SET(x) (((x) << 15) & 0x00078000) -#define PHY_ANALOG_RXTX1_PADRV3GN5G_MSB 22 -#define PHY_ANALOG_RXTX1_PADRV3GN5G_LSB 19 -#define PHY_ANALOG_RXTX1_PADRV3GN5G_MASK 0x00780000 -#define PHY_ANALOG_RXTX1_PADRV3GN5G_GET(x) (((x) & 0x00780000) >> 19) -#define PHY_ANALOG_RXTX1_PADRV3GN5G_SET(x) (((x) << 19) & 0x00780000) -#define PHY_ANALOG_RXTX1_PADRV4GN5G_MSB 26 -#define PHY_ANALOG_RXTX1_PADRV4GN5G_LSB 23 -#define PHY_ANALOG_RXTX1_PADRV4GN5G_MASK 0x07800000 -#define PHY_ANALOG_RXTX1_PADRV4GN5G_GET(x) (((x) & 0x07800000) >> 23) -#define PHY_ANALOG_RXTX1_PADRV4GN5G_SET(x) (((x) << 23) & 0x07800000) -#define PHY_ANALOG_RXTX1_TXBB_GC_MSB 30 -#define PHY_ANALOG_RXTX1_TXBB_GC_LSB 27 -#define PHY_ANALOG_RXTX1_TXBB_GC_MASK 0x78000000 -#define PHY_ANALOG_RXTX1_TXBB_GC_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_ANALOG_RXTX1_TXBB_GC_SET(x) (((x) << 27) & 0x78000000) -#define PHY_ANALOG_RXTX1_MANTXGAIN_MSB 31 -#define PHY_ANALOG_RXTX1_MANTXGAIN_LSB 31 -#define PHY_ANALOG_RXTX1_MANTXGAIN_MASK 0x80000000 -#define PHY_ANALOG_RXTX1_MANTXGAIN_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_RXTX1_MANTXGAIN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for RXTX2 */ -#define PHY_ANALOG_RXTX2_ADDRESS 0x00000104 -#define PHY_ANALOG_RXTX2_OFFSET 0x00000104 -#define PHY_ANALOG_RXTX2_BMODE_MSB 0 -#define PHY_ANALOG_RXTX2_BMODE_LSB 0 -#define PHY_ANALOG_RXTX2_BMODE_MASK 0x00000001 -#define PHY_ANALOG_RXTX2_BMODE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXTX2_BMODE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXTX2_BMODE_OVR_MSB 1 -#define PHY_ANALOG_RXTX2_BMODE_OVR_LSB 1 -#define PHY_ANALOG_RXTX2_BMODE_OVR_MASK 0x00000002 -#define PHY_ANALOG_RXTX2_BMODE_OVR_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_RXTX2_BMODE_OVR_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_RXTX2_SYNTHON_MSB 2 -#define PHY_ANALOG_RXTX2_SYNTHON_LSB 2 -#define PHY_ANALOG_RXTX2_SYNTHON_MASK 0x00000004 -#define PHY_ANALOG_RXTX2_SYNTHON_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_RXTX2_SYNTHON_SET(x) (((x) << 2) & 0x00000004) -#define PHY_ANALOG_RXTX2_SYNTHON_OVR_MSB 3 -#define PHY_ANALOG_RXTX2_SYNTHON_OVR_LSB 3 -#define PHY_ANALOG_RXTX2_SYNTHON_OVR_MASK 0x00000008 -#define PHY_ANALOG_RXTX2_SYNTHON_OVR_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_RXTX2_SYNTHON_OVR_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_RXTX2_BW_ST_MSB 5 -#define PHY_ANALOG_RXTX2_BW_ST_LSB 4 -#define PHY_ANALOG_RXTX2_BW_ST_MASK 0x00000030 -#define PHY_ANALOG_RXTX2_BW_ST_GET(x) (((x) & 0x00000030) >> 4) -#define PHY_ANALOG_RXTX2_BW_ST_SET(x) (((x) << 4) & 0x00000030) -#define PHY_ANALOG_RXTX2_BW_ST_OVR_MSB 6 -#define PHY_ANALOG_RXTX2_BW_ST_OVR_LSB 6 -#define PHY_ANALOG_RXTX2_BW_ST_OVR_MASK 0x00000040 -#define PHY_ANALOG_RXTX2_BW_ST_OVR_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_RXTX2_BW_ST_OVR_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_RXTX2_TXON_MSB 7 -#define PHY_ANALOG_RXTX2_TXON_LSB 7 -#define PHY_ANALOG_RXTX2_TXON_MASK 0x00000080 -#define PHY_ANALOG_RXTX2_TXON_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RXTX2_TXON_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RXTX2_TXON_OVR_MSB 8 -#define PHY_ANALOG_RXTX2_TXON_OVR_LSB 8 -#define PHY_ANALOG_RXTX2_TXON_OVR_MASK 0x00000100 -#define PHY_ANALOG_RXTX2_TXON_OVR_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_RXTX2_TXON_OVR_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_RXTX2_PAON_MSB 9 -#define PHY_ANALOG_RXTX2_PAON_LSB 9 -#define PHY_ANALOG_RXTX2_PAON_MASK 0x00000200 -#define PHY_ANALOG_RXTX2_PAON_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_RXTX2_PAON_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_RXTX2_PAON_OVR_MSB 10 -#define PHY_ANALOG_RXTX2_PAON_OVR_LSB 10 -#define PHY_ANALOG_RXTX2_PAON_OVR_MASK 0x00000400 -#define PHY_ANALOG_RXTX2_PAON_OVR_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_RXTX2_PAON_OVR_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_RXTX2_RXON_MSB 11 -#define PHY_ANALOG_RXTX2_RXON_LSB 11 -#define PHY_ANALOG_RXTX2_RXON_MASK 0x00000800 -#define PHY_ANALOG_RXTX2_RXON_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_RXTX2_RXON_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_RXTX2_RXON_OVR_MSB 12 -#define PHY_ANALOG_RXTX2_RXON_OVR_LSB 12 -#define PHY_ANALOG_RXTX2_RXON_OVR_MASK 0x00001000 -#define PHY_ANALOG_RXTX2_RXON_OVR_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_RXTX2_RXON_OVR_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_RXTX2_AGCON_MSB 13 -#define PHY_ANALOG_RXTX2_AGCON_LSB 13 -#define PHY_ANALOG_RXTX2_AGCON_MASK 0x00002000 -#define PHY_ANALOG_RXTX2_AGCON_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_RXTX2_AGCON_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_RXTX2_AGCON_OVR_MSB 14 -#define PHY_ANALOG_RXTX2_AGCON_OVR_LSB 14 -#define PHY_ANALOG_RXTX2_AGCON_OVR_MASK 0x00004000 -#define PHY_ANALOG_RXTX2_AGCON_OVR_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_RXTX2_AGCON_OVR_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_RXTX2_TXMOD_MSB 17 -#define PHY_ANALOG_RXTX2_TXMOD_LSB 15 -#define PHY_ANALOG_RXTX2_TXMOD_MASK 0x00038000 -#define PHY_ANALOG_RXTX2_TXMOD_GET(x) (((x) & 0x00038000) >> 15) -#define PHY_ANALOG_RXTX2_TXMOD_SET(x) (((x) << 15) & 0x00038000) -#define PHY_ANALOG_RXTX2_TXMOD_OVR_MSB 18 -#define PHY_ANALOG_RXTX2_TXMOD_OVR_LSB 18 -#define PHY_ANALOG_RXTX2_TXMOD_OVR_MASK 0x00040000 -#define PHY_ANALOG_RXTX2_TXMOD_OVR_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_RXTX2_TXMOD_OVR_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_RXTX2_RX1DB_BIQUAD_MSB 21 -#define PHY_ANALOG_RXTX2_RX1DB_BIQUAD_LSB 19 -#define PHY_ANALOG_RXTX2_RX1DB_BIQUAD_MASK 0x00380000 -#define PHY_ANALOG_RXTX2_RX1DB_BIQUAD_GET(x) (((x) & 0x00380000) >> 19) -#define PHY_ANALOG_RXTX2_RX1DB_BIQUAD_SET(x) (((x) << 19) & 0x00380000) -#define PHY_ANALOG_RXTX2_RX6DB_BIQUAD_MSB 23 -#define PHY_ANALOG_RXTX2_RX6DB_BIQUAD_LSB 22 -#define PHY_ANALOG_RXTX2_RX6DB_BIQUAD_MASK 0x00c00000 -#define PHY_ANALOG_RXTX2_RX6DB_BIQUAD_GET(x) (((x) & 0x00c00000) >> 22) -#define PHY_ANALOG_RXTX2_RX6DB_BIQUAD_SET(x) (((x) << 22) & 0x00c00000) -#define PHY_ANALOG_RXTX2_MXRGAIN_MSB 25 -#define PHY_ANALOG_RXTX2_MXRGAIN_LSB 24 -#define PHY_ANALOG_RXTX2_MXRGAIN_MASK 0x03000000 -#define PHY_ANALOG_RXTX2_MXRGAIN_GET(x) (((x) & 0x03000000) >> 24) -#define PHY_ANALOG_RXTX2_MXRGAIN_SET(x) (((x) << 24) & 0x03000000) -#define PHY_ANALOG_RXTX2_VGAGAIN_MSB 28 -#define PHY_ANALOG_RXTX2_VGAGAIN_LSB 26 -#define PHY_ANALOG_RXTX2_VGAGAIN_MASK 0x1c000000 -#define PHY_ANALOG_RXTX2_VGAGAIN_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_RXTX2_VGAGAIN_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_RXTX2_LNAGAIN_MSB 31 -#define PHY_ANALOG_RXTX2_LNAGAIN_LSB 29 -#define PHY_ANALOG_RXTX2_LNAGAIN_MASK 0xe0000000 -#define PHY_ANALOG_RXTX2_LNAGAIN_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_RXTX2_LNAGAIN_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for RXTX3 */ -#define PHY_ANALOG_RXTX3_ADDRESS 0x00000108 -#define PHY_ANALOG_RXTX3_OFFSET 0x00000108 -#define PHY_ANALOG_RXTX3_SPARE3_MSB 2 -#define PHY_ANALOG_RXTX3_SPARE3_LSB 0 -#define PHY_ANALOG_RXTX3_SPARE3_MASK 0x00000007 -#define PHY_ANALOG_RXTX3_SPARE3_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_RXTX3_SPARE3_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_RXTX3_SPURON_MSB 3 -#define PHY_ANALOG_RXTX3_SPURON_LSB 3 -#define PHY_ANALOG_RXTX3_SPURON_MASK 0x00000008 -#define PHY_ANALOG_RXTX3_SPURON_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_RXTX3_SPURON_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_RXTX3_PAL_LOCKEDEN_MSB 4 -#define PHY_ANALOG_RXTX3_PAL_LOCKEDEN_LSB 4 -#define PHY_ANALOG_RXTX3_PAL_LOCKEDEN_MASK 0x00000010 -#define PHY_ANALOG_RXTX3_PAL_LOCKEDEN_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_RXTX3_PAL_LOCKEDEN_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_RXTX3_DACFULLSCALE_MSB 5 -#define PHY_ANALOG_RXTX3_DACFULLSCALE_LSB 5 -#define PHY_ANALOG_RXTX3_DACFULLSCALE_MASK 0x00000020 -#define PHY_ANALOG_RXTX3_DACFULLSCALE_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_RXTX3_DACFULLSCALE_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_RXTX3_ADCSHORT_MSB 6 -#define PHY_ANALOG_RXTX3_ADCSHORT_LSB 6 -#define PHY_ANALOG_RXTX3_ADCSHORT_MASK 0x00000040 -#define PHY_ANALOG_RXTX3_ADCSHORT_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_RXTX3_ADCSHORT_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_RXTX3_DACPWD_MSB 7 -#define PHY_ANALOG_RXTX3_DACPWD_LSB 7 -#define PHY_ANALOG_RXTX3_DACPWD_MASK 0x00000080 -#define PHY_ANALOG_RXTX3_DACPWD_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RXTX3_DACPWD_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RXTX3_DACPWD_OVR_MSB 8 -#define PHY_ANALOG_RXTX3_DACPWD_OVR_LSB 8 -#define PHY_ANALOG_RXTX3_DACPWD_OVR_MASK 0x00000100 -#define PHY_ANALOG_RXTX3_DACPWD_OVR_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_RXTX3_DACPWD_OVR_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_RXTX3_ADCPWD_MSB 9 -#define PHY_ANALOG_RXTX3_ADCPWD_LSB 9 -#define PHY_ANALOG_RXTX3_ADCPWD_MASK 0x00000200 -#define PHY_ANALOG_RXTX3_ADCPWD_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_RXTX3_ADCPWD_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_RXTX3_ADCPWD_OVR_MSB 10 -#define PHY_ANALOG_RXTX3_ADCPWD_OVR_LSB 10 -#define PHY_ANALOG_RXTX3_ADCPWD_OVR_MASK 0x00000400 -#define PHY_ANALOG_RXTX3_ADCPWD_OVR_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_RXTX3_ADCPWD_OVR_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_RXTX3_AGC_CALDAC_MSB 16 -#define PHY_ANALOG_RXTX3_AGC_CALDAC_LSB 11 -#define PHY_ANALOG_RXTX3_AGC_CALDAC_MASK 0x0001f800 -#define PHY_ANALOG_RXTX3_AGC_CALDAC_GET(x) (((x) & 0x0001f800) >> 11) -#define PHY_ANALOG_RXTX3_AGC_CALDAC_SET(x) (((x) << 11) & 0x0001f800) -#define PHY_ANALOG_RXTX3_AGC_CAL_MSB 17 -#define PHY_ANALOG_RXTX3_AGC_CAL_LSB 17 -#define PHY_ANALOG_RXTX3_AGC_CAL_MASK 0x00020000 -#define PHY_ANALOG_RXTX3_AGC_CAL_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_RXTX3_AGC_CAL_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_RXTX3_AGC_CAL_OVR_MSB 18 -#define PHY_ANALOG_RXTX3_AGC_CAL_OVR_LSB 18 -#define PHY_ANALOG_RXTX3_AGC_CAL_OVR_MASK 0x00040000 -#define PHY_ANALOG_RXTX3_AGC_CAL_OVR_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_RXTX3_AGC_CAL_OVR_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_RXTX3_LOFORCEDON_MSB 19 -#define PHY_ANALOG_RXTX3_LOFORCEDON_LSB 19 -#define PHY_ANALOG_RXTX3_LOFORCEDON_MASK 0x00080000 -#define PHY_ANALOG_RXTX3_LOFORCEDON_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_ANALOG_RXTX3_LOFORCEDON_SET(x) (((x) << 19) & 0x00080000) -#define PHY_ANALOG_RXTX3_CALRESIDUE_MSB 20 -#define PHY_ANALOG_RXTX3_CALRESIDUE_LSB 20 -#define PHY_ANALOG_RXTX3_CALRESIDUE_MASK 0x00100000 -#define PHY_ANALOG_RXTX3_CALRESIDUE_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_RXTX3_CALRESIDUE_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_RXTX3_CALRESIDUE_OVR_MSB 21 -#define PHY_ANALOG_RXTX3_CALRESIDUE_OVR_LSB 21 -#define PHY_ANALOG_RXTX3_CALRESIDUE_OVR_MASK 0x00200000 -#define PHY_ANALOG_RXTX3_CALRESIDUE_OVR_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_RXTX3_CALRESIDUE_OVR_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_RXTX3_CALFC_MSB 22 -#define PHY_ANALOG_RXTX3_CALFC_LSB 22 -#define PHY_ANALOG_RXTX3_CALFC_MASK 0x00400000 -#define PHY_ANALOG_RXTX3_CALFC_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_RXTX3_CALFC_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_RXTX3_CALFC_OVR_MSB 23 -#define PHY_ANALOG_RXTX3_CALFC_OVR_LSB 23 -#define PHY_ANALOG_RXTX3_CALFC_OVR_MASK 0x00800000 -#define PHY_ANALOG_RXTX3_CALFC_OVR_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_RXTX3_CALFC_OVR_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_RXTX3_CALTX_MSB 24 -#define PHY_ANALOG_RXTX3_CALTX_LSB 24 -#define PHY_ANALOG_RXTX3_CALTX_MASK 0x01000000 -#define PHY_ANALOG_RXTX3_CALTX_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_ANALOG_RXTX3_CALTX_SET(x) (((x) << 24) & 0x01000000) -#define PHY_ANALOG_RXTX3_CALTX_OVR_MSB 25 -#define PHY_ANALOG_RXTX3_CALTX_OVR_LSB 25 -#define PHY_ANALOG_RXTX3_CALTX_OVR_MASK 0x02000000 -#define PHY_ANALOG_RXTX3_CALTX_OVR_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_ANALOG_RXTX3_CALTX_OVR_SET(x) (((x) << 25) & 0x02000000) -#define PHY_ANALOG_RXTX3_CALTXSHIFT_MSB 26 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_LSB 26 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_MASK 0x04000000 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_RXTX3_CALTXSHIFT_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_RXTX3_CALTXSHIFT_OVR_MSB 27 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_OVR_LSB 27 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_OVR_MASK 0x08000000 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_OVR_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_RXTX3_CALTXSHIFT_OVR_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_RXTX3_CALPA_MSB 28 -#define PHY_ANALOG_RXTX3_CALPA_LSB 28 -#define PHY_ANALOG_RXTX3_CALPA_MASK 0x10000000 -#define PHY_ANALOG_RXTX3_CALPA_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_RXTX3_CALPA_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_RXTX3_CALPA_OVR_MSB 29 -#define PHY_ANALOG_RXTX3_CALPA_OVR_LSB 29 -#define PHY_ANALOG_RXTX3_CALPA_OVR_MASK 0x20000000 -#define PHY_ANALOG_RXTX3_CALPA_OVR_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_RXTX3_CALPA_OVR_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_RXTX3_TURBOADC_MSB 30 -#define PHY_ANALOG_RXTX3_TURBOADC_LSB 30 -#define PHY_ANALOG_RXTX3_TURBOADC_MASK 0x40000000 -#define PHY_ANALOG_RXTX3_TURBOADC_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_RXTX3_TURBOADC_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_RXTX3_TURBOADC_OVR_MSB 31 -#define PHY_ANALOG_RXTX3_TURBOADC_OVR_LSB 31 -#define PHY_ANALOG_RXTX3_TURBOADC_OVR_MASK 0x80000000 -#define PHY_ANALOG_RXTX3_TURBOADC_OVR_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_RXTX3_TURBOADC_OVR_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB1 */ -#define PHY_ANALOG_BB1_ADDRESS 0x00000140 -#define PHY_ANALOG_BB1_OFFSET 0x00000140 -#define PHY_ANALOG_BB1_I2V_CURR2X_MSB 0 -#define PHY_ANALOG_BB1_I2V_CURR2X_LSB 0 -#define PHY_ANALOG_BB1_I2V_CURR2X_MASK 0x00000001 -#define PHY_ANALOG_BB1_I2V_CURR2X_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_BB1_I2V_CURR2X_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_BB1_ENABLE_LOQ_MSB 1 -#define PHY_ANALOG_BB1_ENABLE_LOQ_LSB 1 -#define PHY_ANALOG_BB1_ENABLE_LOQ_MASK 0x00000002 -#define PHY_ANALOG_BB1_ENABLE_LOQ_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_BB1_ENABLE_LOQ_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_BB1_FORCE_LOQ_MSB 2 -#define PHY_ANALOG_BB1_FORCE_LOQ_LSB 2 -#define PHY_ANALOG_BB1_FORCE_LOQ_MASK 0x00000004 -#define PHY_ANALOG_BB1_FORCE_LOQ_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_BB1_FORCE_LOQ_SET(x) (((x) << 2) & 0x00000004) -#define PHY_ANALOG_BB1_ENABLE_NOTCH_MSB 3 -#define PHY_ANALOG_BB1_ENABLE_NOTCH_LSB 3 -#define PHY_ANALOG_BB1_ENABLE_NOTCH_MASK 0x00000008 -#define PHY_ANALOG_BB1_ENABLE_NOTCH_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_BB1_ENABLE_NOTCH_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_BB1_FORCE_NOTCH_MSB 4 -#define PHY_ANALOG_BB1_FORCE_NOTCH_LSB 4 -#define PHY_ANALOG_BB1_FORCE_NOTCH_MASK 0x00000010 -#define PHY_ANALOG_BB1_FORCE_NOTCH_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_BB1_FORCE_NOTCH_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_BB1_ENABLE_BIQUAD_MSB 5 -#define PHY_ANALOG_BB1_ENABLE_BIQUAD_LSB 5 -#define PHY_ANALOG_BB1_ENABLE_BIQUAD_MASK 0x00000020 -#define PHY_ANALOG_BB1_ENABLE_BIQUAD_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_BB1_ENABLE_BIQUAD_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_BB1_FORCE_BIQUAD_MSB 6 -#define PHY_ANALOG_BB1_FORCE_BIQUAD_LSB 6 -#define PHY_ANALOG_BB1_FORCE_BIQUAD_MASK 0x00000040 -#define PHY_ANALOG_BB1_FORCE_BIQUAD_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_BB1_FORCE_BIQUAD_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_BB1_ENABLE_OSDAC_MSB 7 -#define PHY_ANALOG_BB1_ENABLE_OSDAC_LSB 7 -#define PHY_ANALOG_BB1_ENABLE_OSDAC_MASK 0x00000080 -#define PHY_ANALOG_BB1_ENABLE_OSDAC_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_BB1_ENABLE_OSDAC_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_BB1_FORCE_OSDAC_MSB 8 -#define PHY_ANALOG_BB1_FORCE_OSDAC_LSB 8 -#define PHY_ANALOG_BB1_FORCE_OSDAC_MASK 0x00000100 -#define PHY_ANALOG_BB1_FORCE_OSDAC_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_BB1_FORCE_OSDAC_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_BB1_ENABLE_V2I_MSB 9 -#define PHY_ANALOG_BB1_ENABLE_V2I_LSB 9 -#define PHY_ANALOG_BB1_ENABLE_V2I_MASK 0x00000200 -#define PHY_ANALOG_BB1_ENABLE_V2I_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_BB1_ENABLE_V2I_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_BB1_FORCE_V2I_MSB 10 -#define PHY_ANALOG_BB1_FORCE_V2I_LSB 10 -#define PHY_ANALOG_BB1_FORCE_V2I_MASK 0x00000400 -#define PHY_ANALOG_BB1_FORCE_V2I_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_BB1_FORCE_V2I_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_BB1_ENABLE_I2V_MSB 11 -#define PHY_ANALOG_BB1_ENABLE_I2V_LSB 11 -#define PHY_ANALOG_BB1_ENABLE_I2V_MASK 0x00000800 -#define PHY_ANALOG_BB1_ENABLE_I2V_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_BB1_ENABLE_I2V_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_BB1_FORCE_I2V_MSB 12 -#define PHY_ANALOG_BB1_FORCE_I2V_LSB 12 -#define PHY_ANALOG_BB1_FORCE_I2V_MASK 0x00001000 -#define PHY_ANALOG_BB1_FORCE_I2V_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_BB1_FORCE_I2V_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_BB1_CMSEL_MSB 15 -#define PHY_ANALOG_BB1_CMSEL_LSB 13 -#define PHY_ANALOG_BB1_CMSEL_MASK 0x0000e000 -#define PHY_ANALOG_BB1_CMSEL_GET(x) (((x) & 0x0000e000) >> 13) -#define PHY_ANALOG_BB1_CMSEL_SET(x) (((x) << 13) & 0x0000e000) -#define PHY_ANALOG_BB1_ATBSEL_MSB 17 -#define PHY_ANALOG_BB1_ATBSEL_LSB 16 -#define PHY_ANALOG_BB1_ATBSEL_MASK 0x00030000 -#define PHY_ANALOG_BB1_ATBSEL_GET(x) (((x) & 0x00030000) >> 16) -#define PHY_ANALOG_BB1_ATBSEL_SET(x) (((x) << 16) & 0x00030000) -#define PHY_ANALOG_BB1_PD_OSDAC_CALTX_CALPA_MSB 18 -#define PHY_ANALOG_BB1_PD_OSDAC_CALTX_CALPA_LSB 18 -#define PHY_ANALOG_BB1_PD_OSDAC_CALTX_CALPA_MASK 0x00040000 -#define PHY_ANALOG_BB1_PD_OSDAC_CALTX_CALPA_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_BB1_PD_OSDAC_CALTX_CALPA_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_BB1_OFSTCORRI2VQ_MSB 23 -#define PHY_ANALOG_BB1_OFSTCORRI2VQ_LSB 19 -#define PHY_ANALOG_BB1_OFSTCORRI2VQ_MASK 0x00f80000 -#define PHY_ANALOG_BB1_OFSTCORRI2VQ_GET(x) (((x) & 0x00f80000) >> 19) -#define PHY_ANALOG_BB1_OFSTCORRI2VQ_SET(x) (((x) << 19) & 0x00f80000) -#define PHY_ANALOG_BB1_OFSTCORRI2VI_MSB 28 -#define PHY_ANALOG_BB1_OFSTCORRI2VI_LSB 24 -#define PHY_ANALOG_BB1_OFSTCORRI2VI_MASK 0x1f000000 -#define PHY_ANALOG_BB1_OFSTCORRI2VI_GET(x) (((x) & 0x1f000000) >> 24) -#define PHY_ANALOG_BB1_OFSTCORRI2VI_SET(x) (((x) << 24) & 0x1f000000) -#define PHY_ANALOG_BB1_LOCALOFFSET_MSB 29 -#define PHY_ANALOG_BB1_LOCALOFFSET_LSB 29 -#define PHY_ANALOG_BB1_LOCALOFFSET_MASK 0x20000000 -#define PHY_ANALOG_BB1_LOCALOFFSET_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_BB1_LOCALOFFSET_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_BB1_RANGE_OSDAC_MSB 31 -#define PHY_ANALOG_BB1_RANGE_OSDAC_LSB 30 -#define PHY_ANALOG_BB1_RANGE_OSDAC_MASK 0xc0000000 -#define PHY_ANALOG_BB1_RANGE_OSDAC_GET(x) (((x) & 0xc0000000) >> 30) -#define PHY_ANALOG_BB1_RANGE_OSDAC_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for BB2 */ -#define PHY_ANALOG_BB2_ADDRESS 0x00000144 -#define PHY_ANALOG_BB2_OFFSET 0x00000144 -#define PHY_ANALOG_BB2_SPARE_MSB 3 -#define PHY_ANALOG_BB2_SPARE_LSB 0 -#define PHY_ANALOG_BB2_SPARE_MASK 0x0000000f -#define PHY_ANALOG_BB2_SPARE_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_BB2_SPARE_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_ANALOG_BB2_MXR_HIGHGAINMASK_MSB 7 -#define PHY_ANALOG_BB2_MXR_HIGHGAINMASK_LSB 4 -#define PHY_ANALOG_BB2_MXR_HIGHGAINMASK_MASK 0x000000f0 -#define PHY_ANALOG_BB2_MXR_HIGHGAINMASK_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_ANALOG_BB2_MXR_HIGHGAINMASK_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_ANALOG_BB2_SEL_TEST_MSB 9 -#define PHY_ANALOG_BB2_SEL_TEST_LSB 8 -#define PHY_ANALOG_BB2_SEL_TEST_MASK 0x00000300 -#define PHY_ANALOG_BB2_SEL_TEST_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_ANALOG_BB2_SEL_TEST_SET(x) (((x) << 8) & 0x00000300) -#define PHY_ANALOG_BB2_RCFILTER_CAP_MSB 14 -#define PHY_ANALOG_BB2_RCFILTER_CAP_LSB 10 -#define PHY_ANALOG_BB2_RCFILTER_CAP_MASK 0x00007c00 -#define PHY_ANALOG_BB2_RCFILTER_CAP_GET(x) (((x) & 0x00007c00) >> 10) -#define PHY_ANALOG_BB2_RCFILTER_CAP_SET(x) (((x) << 10) & 0x00007c00) -#define PHY_ANALOG_BB2_OVERRIDE_RCFILTER_CAP_MSB 15 -#define PHY_ANALOG_BB2_OVERRIDE_RCFILTER_CAP_LSB 15 -#define PHY_ANALOG_BB2_OVERRIDE_RCFILTER_CAP_MASK 0x00008000 -#define PHY_ANALOG_BB2_OVERRIDE_RCFILTER_CAP_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_BB2_OVERRIDE_RCFILTER_CAP_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_BB2_FNOTCH_MSB 19 -#define PHY_ANALOG_BB2_FNOTCH_LSB 16 -#define PHY_ANALOG_BB2_FNOTCH_MASK 0x000f0000 -#define PHY_ANALOG_BB2_FNOTCH_GET(x) (((x) & 0x000f0000) >> 16) -#define PHY_ANALOG_BB2_FNOTCH_SET(x) (((x) << 16) & 0x000f0000) -#define PHY_ANALOG_BB2_OVERRIDE_FNOTCH_MSB 20 -#define PHY_ANALOG_BB2_OVERRIDE_FNOTCH_LSB 20 -#define PHY_ANALOG_BB2_OVERRIDE_FNOTCH_MASK 0x00100000 -#define PHY_ANALOG_BB2_OVERRIDE_FNOTCH_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_BB2_OVERRIDE_FNOTCH_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_BB2_FILTERFC_MSB 25 -#define PHY_ANALOG_BB2_FILTERFC_LSB 21 -#define PHY_ANALOG_BB2_FILTERFC_MASK 0x03e00000 -#define PHY_ANALOG_BB2_FILTERFC_GET(x) (((x) & 0x03e00000) >> 21) -#define PHY_ANALOG_BB2_FILTERFC_SET(x) (((x) << 21) & 0x03e00000) -#define PHY_ANALOG_BB2_OVERRIDE_FILTERFC_MSB 26 -#define PHY_ANALOG_BB2_OVERRIDE_FILTERFC_LSB 26 -#define PHY_ANALOG_BB2_OVERRIDE_FILTERFC_MASK 0x04000000 -#define PHY_ANALOG_BB2_OVERRIDE_FILTERFC_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_BB2_OVERRIDE_FILTERFC_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_BB2_I2V2RXOUT_EN_MSB 27 -#define PHY_ANALOG_BB2_I2V2RXOUT_EN_LSB 27 -#define PHY_ANALOG_BB2_I2V2RXOUT_EN_MASK 0x08000000 -#define PHY_ANALOG_BB2_I2V2RXOUT_EN_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_BB2_I2V2RXOUT_EN_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_BB2_BQ2RXOUT_EN_MSB 28 -#define PHY_ANALOG_BB2_BQ2RXOUT_EN_LSB 28 -#define PHY_ANALOG_BB2_BQ2RXOUT_EN_MASK 0x10000000 -#define PHY_ANALOG_BB2_BQ2RXOUT_EN_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_BB2_BQ2RXOUT_EN_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_BB2_RXIN2I2V_EN_MSB 29 -#define PHY_ANALOG_BB2_RXIN2I2V_EN_LSB 29 -#define PHY_ANALOG_BB2_RXIN2I2V_EN_MASK 0x20000000 -#define PHY_ANALOG_BB2_RXIN2I2V_EN_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_BB2_RXIN2I2V_EN_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_BB2_RXIN2BQ_EN_MSB 30 -#define PHY_ANALOG_BB2_RXIN2BQ_EN_LSB 30 -#define PHY_ANALOG_BB2_RXIN2BQ_EN_MASK 0x40000000 -#define PHY_ANALOG_BB2_RXIN2BQ_EN_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_BB2_RXIN2BQ_EN_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_BB2_SWITCH_OVERRIDE_MSB 31 -#define PHY_ANALOG_BB2_SWITCH_OVERRIDE_LSB 31 -#define PHY_ANALOG_BB2_SWITCH_OVERRIDE_MASK 0x80000000 -#define PHY_ANALOG_BB2_SWITCH_OVERRIDE_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_BB2_SWITCH_OVERRIDE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB3 */ -#define PHY_ANALOG_BB3_ADDRESS 0x00000148 -#define PHY_ANALOG_BB3_OFFSET 0x00000148 -#define PHY_ANALOG_BB3_SPARE_MSB 15 -#define PHY_ANALOG_BB3_SPARE_LSB 0 -#define PHY_ANALOG_BB3_SPARE_MASK 0x0000ffff -#define PHY_ANALOG_BB3_SPARE_GET(x) (((x) & 0x0000ffff) >> 0) -#define PHY_ANALOG_BB3_SPARE_SET(x) (((x) << 0) & 0x0000ffff) -#define PHY_ANALOG_BB3_FILTERFC_MSB 20 -#define PHY_ANALOG_BB3_FILTERFC_LSB 16 -#define PHY_ANALOG_BB3_FILTERFC_MASK 0x001f0000 -#define PHY_ANALOG_BB3_FILTERFC_GET(x) (((x) & 0x001f0000) >> 16) -#define PHY_ANALOG_BB3_OFSTCORRI2VQ_MSB 25 -#define PHY_ANALOG_BB3_OFSTCORRI2VQ_LSB 21 -#define PHY_ANALOG_BB3_OFSTCORRI2VQ_MASK 0x03e00000 -#define PHY_ANALOG_BB3_OFSTCORRI2VQ_GET(x) (((x) & 0x03e00000) >> 21) -#define PHY_ANALOG_BB3_OFSTCORRI2VI_MSB 30 -#define PHY_ANALOG_BB3_OFSTCORRI2VI_LSB 26 -#define PHY_ANALOG_BB3_OFSTCORRI2VI_MASK 0x7c000000 -#define PHY_ANALOG_BB3_OFSTCORRI2VI_GET(x) (((x) & 0x7c000000) >> 26) -#define PHY_ANALOG_BB3_EN_TXBBCONSTCUR_MSB 31 -#define PHY_ANALOG_BB3_EN_TXBBCONSTCUR_LSB 31 -#define PHY_ANALOG_BB3_EN_TXBBCONSTCUR_MASK 0x80000000 -#define PHY_ANALOG_BB3_EN_TXBBCONSTCUR_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_BB3_EN_TXBBCONSTCUR_SET(x) (((x) << 31) & 0x80000000) - -/* macros for PLLCLKMODA */ -#define PHY_ANALOG_PLLCLKMODA_ADDRESS 0x00000280 -#define PHY_ANALOG_PLLCLKMODA_OFFSET 0x00000280 -#define PHY_ANALOG_PLLCLKMODA_PWD_PLLSDM_MSB 0 -#define PHY_ANALOG_PLLCLKMODA_PWD_PLLSDM_LSB 0 -#define PHY_ANALOG_PLLCLKMODA_PWD_PLLSDM_MASK 0x00000001 -#define PHY_ANALOG_PLLCLKMODA_PWD_PLLSDM_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_PLLCLKMODA_PWD_PLLSDM_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_PLLCLKMODA_PWDPLL_MSB 1 -#define PHY_ANALOG_PLLCLKMODA_PWDPLL_LSB 1 -#define PHY_ANALOG_PLLCLKMODA_PWDPLL_MASK 0x00000002 -#define PHY_ANALOG_PLLCLKMODA_PWDPLL_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_PLLCLKMODA_PWDPLL_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_PLLCLKMODA_PLLFRAC_MSB 16 -#define PHY_ANALOG_PLLCLKMODA_PLLFRAC_LSB 2 -#define PHY_ANALOG_PLLCLKMODA_PLLFRAC_MASK 0x0001fffc -#define PHY_ANALOG_PLLCLKMODA_PLLFRAC_GET(x) (((x) & 0x0001fffc) >> 2) -#define PHY_ANALOG_PLLCLKMODA_PLLFRAC_SET(x) (((x) << 2) & 0x0001fffc) -#define PHY_ANALOG_PLLCLKMODA_REFDIV_MSB 20 -#define PHY_ANALOG_PLLCLKMODA_REFDIV_LSB 17 -#define PHY_ANALOG_PLLCLKMODA_REFDIV_MASK 0x001e0000 -#define PHY_ANALOG_PLLCLKMODA_REFDIV_GET(x) (((x) & 0x001e0000) >> 17) -#define PHY_ANALOG_PLLCLKMODA_REFDIV_SET(x) (((x) << 17) & 0x001e0000) -#define PHY_ANALOG_PLLCLKMODA_DIV_MSB 30 -#define PHY_ANALOG_PLLCLKMODA_DIV_LSB 21 -#define PHY_ANALOG_PLLCLKMODA_DIV_MASK 0x7fe00000 -#define PHY_ANALOG_PLLCLKMODA_DIV_GET(x) (((x) & 0x7fe00000) >> 21) -#define PHY_ANALOG_PLLCLKMODA_DIV_SET(x) (((x) << 21) & 0x7fe00000) -#define PHY_ANALOG_PLLCLKMODA_LOCAL_PLL_MSB 31 -#define PHY_ANALOG_PLLCLKMODA_LOCAL_PLL_LSB 31 -#define PHY_ANALOG_PLLCLKMODA_LOCAL_PLL_MASK 0x80000000 -#define PHY_ANALOG_PLLCLKMODA_LOCAL_PLL_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_PLLCLKMODA_LOCAL_PLL_SET(x) (((x) << 31) & 0x80000000) - -/* macros for PLLCLKMODA2 */ -#define PHY_ANALOG_PLLCLKMODA2_ADDRESS 0x00000284 -#define PHY_ANALOG_PLLCLKMODA2_OFFSET 0x00000284 -#define PHY_ANALOG_PLLCLKMODA2_SPARE_MSB 3 -#define PHY_ANALOG_PLLCLKMODA2_SPARE_LSB 0 -#define PHY_ANALOG_PLLCLKMODA2_SPARE_MASK 0x0000000f -#define PHY_ANALOG_PLLCLKMODA2_SPARE_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_PLLCLKMODA2_SPARE_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_ANALOG_PLLCLKMODA2_DACPWD_MSB 4 -#define PHY_ANALOG_PLLCLKMODA2_DACPWD_LSB 4 -#define PHY_ANALOG_PLLCLKMODA2_DACPWD_MASK 0x00000010 -#define PHY_ANALOG_PLLCLKMODA2_DACPWD_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_PLLCLKMODA2_DACPWD_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_PLLCLKMODA2_ADCPWD_MSB 5 -#define PHY_ANALOG_PLLCLKMODA2_ADCPWD_LSB 5 -#define PHY_ANALOG_PLLCLKMODA2_ADCPWD_MASK 0x00000020 -#define PHY_ANALOG_PLLCLKMODA2_ADCPWD_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_PLLCLKMODA2_ADCPWD_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_ADDAC_MSB 6 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_ADDAC_LSB 6 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_ADDAC_MASK 0x00000040 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_ADDAC_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_ADDAC_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_PLLCLKMODA2_DAC_CLK_SEL_MSB 8 -#define PHY_ANALOG_PLLCLKMODA2_DAC_CLK_SEL_LSB 7 -#define PHY_ANALOG_PLLCLKMODA2_DAC_CLK_SEL_MASK 0x00000180 -#define PHY_ANALOG_PLLCLKMODA2_DAC_CLK_SEL_GET(x) (((x) & 0x00000180) >> 7) -#define PHY_ANALOG_PLLCLKMODA2_DAC_CLK_SEL_SET(x) (((x) << 7) & 0x00000180) -#define PHY_ANALOG_PLLCLKMODA2_ADC_CLK_SEL_MSB 12 -#define PHY_ANALOG_PLLCLKMODA2_ADC_CLK_SEL_LSB 9 -#define PHY_ANALOG_PLLCLKMODA2_ADC_CLK_SEL_MASK 0x00001e00 -#define PHY_ANALOG_PLLCLKMODA2_ADC_CLK_SEL_GET(x) (((x) & 0x00001e00) >> 9) -#define PHY_ANALOG_PLLCLKMODA2_ADC_CLK_SEL_SET(x) (((x) << 9) & 0x00001e00) -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_CLKMODA_MSB 13 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_CLKMODA_LSB 13 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_CLKMODA_MASK 0x00002000 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_CLKMODA_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_CLKMODA_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_PLLCLKMODA2_PLLBYPASS_MSB 14 -#define PHY_ANALOG_PLLCLKMODA2_PLLBYPASS_LSB 14 -#define PHY_ANALOG_PLLCLKMODA2_PLLBYPASS_MASK 0x00004000 -#define PHY_ANALOG_PLLCLKMODA2_PLLBYPASS_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_PLLCLKMODA2_PLLBYPASS_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_PLLBYPASS_MSB 15 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_PLLBYPASS_LSB 15 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_PLLBYPASS_MASK 0x00008000 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_PLLBYPASS_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_PLLBYPASS_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_PLLCLKMODA2_PLLATB_MSB 17 -#define PHY_ANALOG_PLLCLKMODA2_PLLATB_LSB 16 -#define PHY_ANALOG_PLLCLKMODA2_PLLATB_MASK 0x00030000 -#define PHY_ANALOG_PLLCLKMODA2_PLLATB_GET(x) (((x) & 0x00030000) >> 16) -#define PHY_ANALOG_PLLCLKMODA2_PLLATB_SET(x) (((x) << 16) & 0x00030000) -#define PHY_ANALOG_PLLCLKMODA2_PLL_SVREG_MSB 18 -#define PHY_ANALOG_PLLCLKMODA2_PLL_SVREG_LSB 18 -#define PHY_ANALOG_PLLCLKMODA2_PLL_SVREG_MASK 0x00040000 -#define PHY_ANALOG_PLLCLKMODA2_PLL_SVREG_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_PLLCLKMODA2_PLL_SVREG_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_PLLCLKMODA2_HI_FREQ_EN_MSB 19 -#define PHY_ANALOG_PLLCLKMODA2_HI_FREQ_EN_LSB 19 -#define PHY_ANALOG_PLLCLKMODA2_HI_FREQ_EN_MASK 0x00080000 -#define PHY_ANALOG_PLLCLKMODA2_HI_FREQ_EN_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_ANALOG_PLLCLKMODA2_HI_FREQ_EN_SET(x) (((x) << 19) & 0x00080000) -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_INT_L_MSB 20 -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_INT_L_LSB 20 -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_INT_L_MASK 0x00100000 -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_INT_L_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_INT_L_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_OVR_MSB 21 -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_OVR_LSB 21 -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_OVR_MASK 0x00200000 -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_OVR_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_OVR_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_PLLCLKMODA2_PLL_KVCO_MSB 23 -#define PHY_ANALOG_PLLCLKMODA2_PLL_KVCO_LSB 22 -#define PHY_ANALOG_PLLCLKMODA2_PLL_KVCO_MASK 0x00c00000 -#define PHY_ANALOG_PLLCLKMODA2_PLL_KVCO_GET(x) (((x) & 0x00c00000) >> 22) -#define PHY_ANALOG_PLLCLKMODA2_PLL_KVCO_SET(x) (((x) << 22) & 0x00c00000) -#define PHY_ANALOG_PLLCLKMODA2_PLLICP_MSB 26 -#define PHY_ANALOG_PLLCLKMODA2_PLLICP_LSB 24 -#define PHY_ANALOG_PLLCLKMODA2_PLLICP_MASK 0x07000000 -#define PHY_ANALOG_PLLCLKMODA2_PLLICP_GET(x) (((x) & 0x07000000) >> 24) -#define PHY_ANALOG_PLLCLKMODA2_PLLICP_SET(x) (((x) << 24) & 0x07000000) -#define PHY_ANALOG_PLLCLKMODA2_PLLFILTER_MSB 31 -#define PHY_ANALOG_PLLCLKMODA2_PLLFILTER_LSB 27 -#define PHY_ANALOG_PLLCLKMODA2_PLLFILTER_MASK 0xf8000000 -#define PHY_ANALOG_PLLCLKMODA2_PLLFILTER_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_PLLCLKMODA2_PLLFILTER_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for TOP */ -#define PHY_ANALOG_TOP_ADDRESS 0x00000288 -#define PHY_ANALOG_TOP_OFFSET 0x00000288 -#define PHY_ANALOG_TOP_SPARE_MSB 2 -#define PHY_ANALOG_TOP_SPARE_LSB 0 -#define PHY_ANALOG_TOP_SPARE_MASK 0x00000007 -#define PHY_ANALOG_TOP_SPARE_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_TOP_SPARE_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_TOP_PWDBIAS_MSB 3 -#define PHY_ANALOG_TOP_PWDBIAS_LSB 3 -#define PHY_ANALOG_TOP_PWDBIAS_MASK 0x00000008 -#define PHY_ANALOG_TOP_PWDBIAS_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_TOP_PWDBIAS_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_TOP_FLIP_XPABIAS_MSB 4 -#define PHY_ANALOG_TOP_FLIP_XPABIAS_LSB 4 -#define PHY_ANALOG_TOP_FLIP_XPABIAS_MASK 0x00000010 -#define PHY_ANALOG_TOP_FLIP_XPABIAS_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_TOP_FLIP_XPABIAS_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_TOP_XPAON2_MSB 5 -#define PHY_ANALOG_TOP_XPAON2_LSB 5 -#define PHY_ANALOG_TOP_XPAON2_MASK 0x00000020 -#define PHY_ANALOG_TOP_XPAON2_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_TOP_XPAON2_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_TOP_XPAON5_MSB 6 -#define PHY_ANALOG_TOP_XPAON5_LSB 6 -#define PHY_ANALOG_TOP_XPAON5_MASK 0x00000040 -#define PHY_ANALOG_TOP_XPAON5_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_TOP_XPAON5_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_TOP_XPASHORT2GND_MSB 7 -#define PHY_ANALOG_TOP_XPASHORT2GND_LSB 7 -#define PHY_ANALOG_TOP_XPASHORT2GND_MASK 0x00000080 -#define PHY_ANALOG_TOP_XPASHORT2GND_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_TOP_XPASHORT2GND_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_TOP_XPABIASLVL_MSB 11 -#define PHY_ANALOG_TOP_XPABIASLVL_LSB 8 -#define PHY_ANALOG_TOP_XPABIASLVL_MASK 0x00000f00 -#define PHY_ANALOG_TOP_XPABIASLVL_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_TOP_XPABIASLVL_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_TOP_XPABIAS_EN_MSB 12 -#define PHY_ANALOG_TOP_XPABIAS_EN_LSB 12 -#define PHY_ANALOG_TOP_XPABIAS_EN_MASK 0x00001000 -#define PHY_ANALOG_TOP_XPABIAS_EN_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_TOP_XPABIAS_EN_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_TOP_ATBSELECT_MSB 13 -#define PHY_ANALOG_TOP_ATBSELECT_LSB 13 -#define PHY_ANALOG_TOP_ATBSELECT_MASK 0x00002000 -#define PHY_ANALOG_TOP_ATBSELECT_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_TOP_ATBSELECT_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_TOP_LOCAL_XPA_MSB 14 -#define PHY_ANALOG_TOP_LOCAL_XPA_LSB 14 -#define PHY_ANALOG_TOP_LOCAL_XPA_MASK 0x00004000 -#define PHY_ANALOG_TOP_LOCAL_XPA_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_TOP_LOCAL_XPA_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_TOP_XPABIAS_BYPASS_MSB 15 -#define PHY_ANALOG_TOP_XPABIAS_BYPASS_LSB 15 -#define PHY_ANALOG_TOP_XPABIAS_BYPASS_MASK 0x00008000 -#define PHY_ANALOG_TOP_XPABIAS_BYPASS_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_TOP_XPABIAS_BYPASS_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_TOP_TEST_PADQ_EN_MSB 16 -#define PHY_ANALOG_TOP_TEST_PADQ_EN_LSB 16 -#define PHY_ANALOG_TOP_TEST_PADQ_EN_MASK 0x00010000 -#define PHY_ANALOG_TOP_TEST_PADQ_EN_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_TOP_TEST_PADQ_EN_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_TOP_TEST_PADI_EN_MSB 17 -#define PHY_ANALOG_TOP_TEST_PADI_EN_LSB 17 -#define PHY_ANALOG_TOP_TEST_PADI_EN_MASK 0x00020000 -#define PHY_ANALOG_TOP_TEST_PADI_EN_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_TOP_TEST_PADI_EN_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_TOP_TESTIQ_RSEL_MSB 18 -#define PHY_ANALOG_TOP_TESTIQ_RSEL_LSB 18 -#define PHY_ANALOG_TOP_TESTIQ_RSEL_MASK 0x00040000 -#define PHY_ANALOG_TOP_TESTIQ_RSEL_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_TOP_TESTIQ_RSEL_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_TOP_TESTIQ_BUFEN_MSB 19 -#define PHY_ANALOG_TOP_TESTIQ_BUFEN_LSB 19 -#define PHY_ANALOG_TOP_TESTIQ_BUFEN_MASK 0x00080000 -#define PHY_ANALOG_TOP_TESTIQ_BUFEN_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_ANALOG_TOP_TESTIQ_BUFEN_SET(x) (((x) << 19) & 0x00080000) -#define PHY_ANALOG_TOP_PAD2GND_MSB 20 -#define PHY_ANALOG_TOP_PAD2GND_LSB 20 -#define PHY_ANALOG_TOP_PAD2GND_MASK 0x00100000 -#define PHY_ANALOG_TOP_PAD2GND_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_TOP_PAD2GND_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_TOP_INTH2PAD_MSB 21 -#define PHY_ANALOG_TOP_INTH2PAD_LSB 21 -#define PHY_ANALOG_TOP_INTH2PAD_MASK 0x00200000 -#define PHY_ANALOG_TOP_INTH2PAD_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_TOP_INTH2PAD_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_TOP_INTH2GND_MSB 22 -#define PHY_ANALOG_TOP_INTH2GND_LSB 22 -#define PHY_ANALOG_TOP_INTH2GND_MASK 0x00400000 -#define PHY_ANALOG_TOP_INTH2GND_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_TOP_INTH2GND_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_TOP_INT2PAD_MSB 23 -#define PHY_ANALOG_TOP_INT2PAD_LSB 23 -#define PHY_ANALOG_TOP_INT2PAD_MASK 0x00800000 -#define PHY_ANALOG_TOP_INT2PAD_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_TOP_INT2PAD_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_TOP_INT2GND_MSB 24 -#define PHY_ANALOG_TOP_INT2GND_LSB 24 -#define PHY_ANALOG_TOP_INT2GND_MASK 0x01000000 -#define PHY_ANALOG_TOP_INT2GND_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_ANALOG_TOP_INT2GND_SET(x) (((x) << 24) & 0x01000000) -#define PHY_ANALOG_TOP_PWDPALCLK_MSB 25 -#define PHY_ANALOG_TOP_PWDPALCLK_LSB 25 -#define PHY_ANALOG_TOP_PWDPALCLK_MASK 0x02000000 -#define PHY_ANALOG_TOP_PWDPALCLK_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_ANALOG_TOP_PWDPALCLK_SET(x) (((x) << 25) & 0x02000000) -#define PHY_ANALOG_TOP_INV_CLK320_ADC_MSB 26 -#define PHY_ANALOG_TOP_INV_CLK320_ADC_LSB 26 -#define PHY_ANALOG_TOP_INV_CLK320_ADC_MASK 0x04000000 -#define PHY_ANALOG_TOP_INV_CLK320_ADC_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_TOP_INV_CLK320_ADC_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_TOP_FLIP_REFCLK40_MSB 27 -#define PHY_ANALOG_TOP_FLIP_REFCLK40_LSB 27 -#define PHY_ANALOG_TOP_FLIP_REFCLK40_MASK 0x08000000 -#define PHY_ANALOG_TOP_FLIP_REFCLK40_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_TOP_FLIP_REFCLK40_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_TOP_FLIP_PLLCLK320_MSB 28 -#define PHY_ANALOG_TOP_FLIP_PLLCLK320_LSB 28 -#define PHY_ANALOG_TOP_FLIP_PLLCLK320_MASK 0x10000000 -#define PHY_ANALOG_TOP_FLIP_PLLCLK320_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_TOP_FLIP_PLLCLK320_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_TOP_FLIP_PLLCLK160_MSB 29 -#define PHY_ANALOG_TOP_FLIP_PLLCLK160_LSB 29 -#define PHY_ANALOG_TOP_FLIP_PLLCLK160_MASK 0x20000000 -#define PHY_ANALOG_TOP_FLIP_PLLCLK160_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_TOP_FLIP_PLLCLK160_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_TOP_CLK_SEL_MSB 31 -#define PHY_ANALOG_TOP_CLK_SEL_LSB 30 -#define PHY_ANALOG_TOP_CLK_SEL_MASK 0xc0000000 -#define PHY_ANALOG_TOP_CLK_SEL_GET(x) (((x) & 0xc0000000) >> 30) -#define PHY_ANALOG_TOP_CLK_SEL_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for THERM */ -#define PHY_ANALOG_THERM_ADDRESS 0x0000028c -#define PHY_ANALOG_THERM_OFFSET 0x0000028c -#define PHY_ANALOG_THERM_LOREG_LVL_MSB 2 -#define PHY_ANALOG_THERM_LOREG_LVL_LSB 0 -#define PHY_ANALOG_THERM_LOREG_LVL_MASK 0x00000007 -#define PHY_ANALOG_THERM_LOREG_LVL_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_THERM_LOREG_LVL_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_THERM_RFREG_LVL_MSB 5 -#define PHY_ANALOG_THERM_RFREG_LVL_LSB 3 -#define PHY_ANALOG_THERM_RFREG_LVL_MASK 0x00000038 -#define PHY_ANALOG_THERM_RFREG_LVL_GET(x) (((x) & 0x00000038) >> 3) -#define PHY_ANALOG_THERM_RFREG_LVL_SET(x) (((x) << 3) & 0x00000038) -#define PHY_ANALOG_THERM_SAR_ADC_DONE_MSB 6 -#define PHY_ANALOG_THERM_SAR_ADC_DONE_LSB 6 -#define PHY_ANALOG_THERM_SAR_ADC_DONE_MASK 0x00000040 -#define PHY_ANALOG_THERM_SAR_ADC_DONE_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_THERM_SAR_ADC_OUT_MSB 14 -#define PHY_ANALOG_THERM_SAR_ADC_OUT_LSB 7 -#define PHY_ANALOG_THERM_SAR_ADC_OUT_MASK 0x00007f80 -#define PHY_ANALOG_THERM_SAR_ADC_OUT_GET(x) (((x) & 0x00007f80) >> 7) -#define PHY_ANALOG_THERM_SAR_DACTEST_CODE_MSB 22 -#define PHY_ANALOG_THERM_SAR_DACTEST_CODE_LSB 15 -#define PHY_ANALOG_THERM_SAR_DACTEST_CODE_MASK 0x007f8000 -#define PHY_ANALOG_THERM_SAR_DACTEST_CODE_GET(x) (((x) & 0x007f8000) >> 15) -#define PHY_ANALOG_THERM_SAR_DACTEST_CODE_SET(x) (((x) << 15) & 0x007f8000) -#define PHY_ANALOG_THERM_SAR_DACTEST_EN_MSB 23 -#define PHY_ANALOG_THERM_SAR_DACTEST_EN_LSB 23 -#define PHY_ANALOG_THERM_SAR_DACTEST_EN_MASK 0x00800000 -#define PHY_ANALOG_THERM_SAR_DACTEST_EN_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_THERM_SAR_DACTEST_EN_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_THERM_SAR_ADCCAL_EN_MSB 24 -#define PHY_ANALOG_THERM_SAR_ADCCAL_EN_LSB 24 -#define PHY_ANALOG_THERM_SAR_ADCCAL_EN_MASK 0x01000000 -#define PHY_ANALOG_THERM_SAR_ADCCAL_EN_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_ANALOG_THERM_SAR_ADCCAL_EN_SET(x) (((x) << 24) & 0x01000000) -#define PHY_ANALOG_THERM_THERMSEL_MSB 26 -#define PHY_ANALOG_THERM_THERMSEL_LSB 25 -#define PHY_ANALOG_THERM_THERMSEL_MASK 0x06000000 -#define PHY_ANALOG_THERM_THERMSEL_GET(x) (((x) & 0x06000000) >> 25) -#define PHY_ANALOG_THERM_THERMSEL_SET(x) (((x) << 25) & 0x06000000) -#define PHY_ANALOG_THERM_SAR_SLOW_EN_MSB 27 -#define PHY_ANALOG_THERM_SAR_SLOW_EN_LSB 27 -#define PHY_ANALOG_THERM_SAR_SLOW_EN_MASK 0x08000000 -#define PHY_ANALOG_THERM_SAR_SLOW_EN_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_THERM_SAR_SLOW_EN_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_THERM_THERMSTART_MSB 28 -#define PHY_ANALOG_THERM_THERMSTART_LSB 28 -#define PHY_ANALOG_THERM_THERMSTART_MASK 0x10000000 -#define PHY_ANALOG_THERM_THERMSTART_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_THERM_THERMSTART_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_THERM_SAR_AUTOPWD_EN_MSB 29 -#define PHY_ANALOG_THERM_SAR_AUTOPWD_EN_LSB 29 -#define PHY_ANALOG_THERM_SAR_AUTOPWD_EN_MASK 0x20000000 -#define PHY_ANALOG_THERM_SAR_AUTOPWD_EN_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_THERM_SAR_AUTOPWD_EN_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_THERM_THERMON_MSB 30 -#define PHY_ANALOG_THERM_THERMON_LSB 30 -#define PHY_ANALOG_THERM_THERMON_MASK 0x40000000 -#define PHY_ANALOG_THERM_THERMON_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_THERM_THERMON_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_THERM_LOCAL_THERM_MSB 31 -#define PHY_ANALOG_THERM_LOCAL_THERM_LSB 31 -#define PHY_ANALOG_THERM_LOCAL_THERM_MASK 0x80000000 -#define PHY_ANALOG_THERM_LOCAL_THERM_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_THERM_LOCAL_THERM_SET(x) (((x) << 31) & 0x80000000) - -/* macros for XTAL */ -#define PHY_ANALOG_XTAL_ADDRESS 0x00000290 -#define PHY_ANALOG_XTAL_OFFSET 0x00000290 -#define PHY_ANALOG_XTAL_SPARE_MSB 5 -#define PHY_ANALOG_XTAL_SPARE_LSB 0 -#define PHY_ANALOG_XTAL_SPARE_MASK 0x0000003f -#define PHY_ANALOG_XTAL_SPARE_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_ANALOG_XTAL_SPARE_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_ANALOG_XTAL_XTAL_NOTCXODET_MSB 6 -#define PHY_ANALOG_XTAL_XTAL_NOTCXODET_LSB 6 -#define PHY_ANALOG_XTAL_XTAL_NOTCXODET_MASK 0x00000040 -#define PHY_ANALOG_XTAL_XTAL_NOTCXODET_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_XTAL_XTAL_NOTCXODET_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_XTAL_LOCALBIAS2X_MSB 7 -#define PHY_ANALOG_XTAL_LOCALBIAS2X_LSB 7 -#define PHY_ANALOG_XTAL_LOCALBIAS2X_MASK 0x00000080 -#define PHY_ANALOG_XTAL_LOCALBIAS2X_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_XTAL_LOCALBIAS2X_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_XTAL_LOCAL_XTAL_MSB 8 -#define PHY_ANALOG_XTAL_LOCAL_XTAL_LSB 8 -#define PHY_ANALOG_XTAL_LOCAL_XTAL_MASK 0x00000100 -#define PHY_ANALOG_XTAL_LOCAL_XTAL_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_XTAL_LOCAL_XTAL_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_XTAL_XTAL_PWDCLKIN_MSB 9 -#define PHY_ANALOG_XTAL_XTAL_PWDCLKIN_LSB 9 -#define PHY_ANALOG_XTAL_XTAL_PWDCLKIN_MASK 0x00000200 -#define PHY_ANALOG_XTAL_XTAL_PWDCLKIN_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_XTAL_XTAL_PWDCLKIN_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_XTAL_XTAL_OSCON_MSB 10 -#define PHY_ANALOG_XTAL_XTAL_OSCON_LSB 10 -#define PHY_ANALOG_XTAL_XTAL_OSCON_MASK 0x00000400 -#define PHY_ANALOG_XTAL_XTAL_OSCON_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_XTAL_XTAL_OSCON_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_XTAL_XTAL_PWDCLKD_MSB 11 -#define PHY_ANALOG_XTAL_XTAL_PWDCLKD_LSB 11 -#define PHY_ANALOG_XTAL_XTAL_PWDCLKD_MASK 0x00000800 -#define PHY_ANALOG_XTAL_XTAL_PWDCLKD_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_XTAL_XTAL_PWDCLKD_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_XTAL_XTAL_LOCALBIAS_MSB 12 -#define PHY_ANALOG_XTAL_XTAL_LOCALBIAS_LSB 12 -#define PHY_ANALOG_XTAL_XTAL_LOCALBIAS_MASK 0x00001000 -#define PHY_ANALOG_XTAL_XTAL_LOCALBIAS_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_XTAL_XTAL_LOCALBIAS_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_XTAL_XTAL_SHRTXIN_MSB 13 -#define PHY_ANALOG_XTAL_XTAL_SHRTXIN_LSB 13 -#define PHY_ANALOG_XTAL_XTAL_SHRTXIN_MASK 0x00002000 -#define PHY_ANALOG_XTAL_XTAL_SHRTXIN_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_XTAL_XTAL_SHRTXIN_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_XTAL_XTAL_DRVSTR_MSB 15 -#define PHY_ANALOG_XTAL_XTAL_DRVSTR_LSB 14 -#define PHY_ANALOG_XTAL_XTAL_DRVSTR_MASK 0x0000c000 -#define PHY_ANALOG_XTAL_XTAL_DRVSTR_GET(x) (((x) & 0x0000c000) >> 14) -#define PHY_ANALOG_XTAL_XTAL_DRVSTR_SET(x) (((x) << 14) & 0x0000c000) -#define PHY_ANALOG_XTAL_XTAL_CAPOUTDAC_MSB 22 -#define PHY_ANALOG_XTAL_XTAL_CAPOUTDAC_LSB 16 -#define PHY_ANALOG_XTAL_XTAL_CAPOUTDAC_MASK 0x007f0000 -#define PHY_ANALOG_XTAL_XTAL_CAPOUTDAC_GET(x) (((x) & 0x007f0000) >> 16) -#define PHY_ANALOG_XTAL_XTAL_CAPOUTDAC_SET(x) (((x) << 16) & 0x007f0000) -#define PHY_ANALOG_XTAL_XTAL_CAPINDAC_MSB 29 -#define PHY_ANALOG_XTAL_XTAL_CAPINDAC_LSB 23 -#define PHY_ANALOG_XTAL_XTAL_CAPINDAC_MASK 0x3f800000 -#define PHY_ANALOG_XTAL_XTAL_CAPINDAC_GET(x) (((x) & 0x3f800000) >> 23) -#define PHY_ANALOG_XTAL_XTAL_CAPINDAC_SET(x) (((x) << 23) & 0x3f800000) -#define PHY_ANALOG_XTAL_XTAL_BIAS2X_MSB 30 -#define PHY_ANALOG_XTAL_XTAL_BIAS2X_LSB 30 -#define PHY_ANALOG_XTAL_XTAL_BIAS2X_MASK 0x40000000 -#define PHY_ANALOG_XTAL_XTAL_BIAS2X_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_XTAL_XTAL_BIAS2X_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_XTAL_TCXODET_MSB 31 -#define PHY_ANALOG_XTAL_TCXODET_LSB 31 -#define PHY_ANALOG_XTAL_TCXODET_MASK 0x80000000 -#define PHY_ANALOG_XTAL_TCXODET_GET(x) (((x) & 0x80000000) >> 31) - -/* macros for rbist_cntrl */ -#define PHY_ANALOG_RBIST_CNTRL_ADDRESS 0x00000380 -#define PHY_ANALOG_RBIST_CNTRL_OFFSET 0x00000380 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_DC_ENABLE_MSB 0 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_DC_ENABLE_LSB 0 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_DC_ENABLE_MASK 0x00000001 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_DC_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_DC_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE0_ENABLE_MSB 1 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE0_ENABLE_LSB 1 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE0_ENABLE_MASK 0x00000002 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE0_ENABLE_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE0_ENABLE_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE1_ENABLE_MSB 2 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE1_ENABLE_LSB 2 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE1_ENABLE_MASK 0x00000004 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE1_ENABLE_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE1_ENABLE_SET(x) (((x) << 2) & 0x00000004) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LFTONE0_ENABLE_MSB 3 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LFTONE0_ENABLE_LSB 3 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LFTONE0_ENABLE_MASK 0x00000008 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LFTONE0_ENABLE_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LFTONE0_ENABLE_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_I_MSB 4 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_I_LSB 4 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_I_MASK 0x00000010 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_I_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_I_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_Q_MSB 5 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_Q_LSB 5 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_Q_MASK 0x00000020 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_Q_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_Q_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_I_MSB 6 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_I_LSB 6 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_I_MASK 0x00000040 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_I_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_I_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_Q_MSB 7 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_Q_LSB 7 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_Q_MASK 0x00000080 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_Q_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_Q_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_WRITE_TO_CANCEL_MSB 8 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_WRITE_TO_CANCEL_LSB 8 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_WRITE_TO_CANCEL_MASK 0x00000100 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_WRITE_TO_CANCEL_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_WRITE_TO_CANCEL_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_ENABLE_MSB 9 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_ENABLE_LSB 9 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_ENABLE_MASK 0x00000200 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_ENABLE_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_ENABLE_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_CORR_ENABLE_MSB 10 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_CORR_ENABLE_LSB 10 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_CORR_ENABLE_MASK 0x00000400 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_CORR_ENABLE_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_CORR_ENABLE_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_ENABLE_MSB 11 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_ENABLE_LSB 11 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_ENABLE_MASK 0x00000800 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_ENABLE_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_ENABLE_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_IQ_ENABLE_MSB 12 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_IQ_ENABLE_LSB 12 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_IQ_ENABLE_MASK 0x00001000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_IQ_ENABLE_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_IQ_ENABLE_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_I2Q2_ENABLE_MSB 13 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_I2Q2_ENABLE_LSB 13 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_I2Q2_ENABLE_MASK 0x00002000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_I2Q2_ENABLE_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_I2Q2_ENABLE_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_HPF_ENABLE_MSB 14 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_HPF_ENABLE_LSB 14 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_HPF_ENABLE_MASK 0x00004000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_HPF_ENABLE_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_HPF_ENABLE_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_RBIST_CNTRL_ATE_RXDAC_CALIBRATE_MSB 15 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RXDAC_CALIBRATE_LSB 15 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RXDAC_CALIBRATE_MASK 0x00008000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RXDAC_CALIBRATE_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_RBIST_CNTRL_ATE_RXDAC_CALIBRATE_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_RBIST_CNTRL_ATE_RBIST_ENABLE_MSB 16 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RBIST_ENABLE_LSB 16 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RBIST_ENABLE_MASK 0x00010000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RBIST_ENABLE_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_RBIST_CNTRL_ATE_RBIST_ENABLE_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_RBIST_CNTRL_ATE_ADC_CLK_INVERT_MSB 17 -#define PHY_ANALOG_RBIST_CNTRL_ATE_ADC_CLK_INVERT_LSB 17 -#define PHY_ANALOG_RBIST_CNTRL_ATE_ADC_CLK_INVERT_MASK 0x00020000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_ADC_CLK_INVERT_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_RBIST_CNTRL_ATE_ADC_CLK_INVERT_SET(x) (((x) << 17) & 0x00020000) - -/* macros for tx_dc_offset */ -#define PHY_ANALOG_TX_DC_OFFSET_ADDRESS 0x00000384 -#define PHY_ANALOG_TX_DC_OFFSET_OFFSET 0x00000384 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_I_MSB 10 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_I_LSB 0 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_I_MASK 0x000007ff -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_I_GET(x) (((x) & 0x000007ff) >> 0) -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_I_SET(x) (((x) << 0) & 0x000007ff) -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_Q_MSB 26 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_Q_LSB 16 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_Q_MASK 0x07ff0000 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_Q_GET(x) (((x) & 0x07ff0000) >> 16) -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_Q_SET(x) (((x) << 16) & 0x07ff0000) - -/* macros for tx_tonegen0 */ -#define PHY_ANALOG_TX_TONEGEN0_ADDRESS 0x00000388 -#define PHY_ANALOG_TX_TONEGEN0_OFFSET 0x00000388 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_FREQ_MSB 6 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_FREQ_LSB 0 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_FREQ_MASK 0x0000007f -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_FREQ_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_FREQ_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_EXP_MSB 11 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_EXP_LSB 8 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_EXP_MASK 0x00000f00 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_EXP_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_EXP_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_MAN_MSB 23 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_MAN_LSB 16 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_MAN_MASK 0x00ff0000 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_MAN_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_MAN_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_TAU_K_MSB 30 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_TAU_K_LSB 24 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_TAU_K_MASK 0x7f000000 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_TAU_K_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_TAU_K_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for tx_tonegen1 */ -#define PHY_ANALOG_TX_TONEGEN1_ADDRESS 0x0000038c -#define PHY_ANALOG_TX_TONEGEN1_OFFSET 0x0000038c -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_FREQ_MSB 6 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_FREQ_LSB 0 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_FREQ_MASK 0x0000007f -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_FREQ_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_FREQ_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_EXP_MSB 11 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_EXP_LSB 8 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_EXP_MASK 0x00000f00 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_EXP_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_EXP_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_MAN_MSB 23 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_MAN_LSB 16 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_MAN_MASK 0x00ff0000 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_MAN_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_MAN_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_TAU_K_MSB 30 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_TAU_K_LSB 24 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_TAU_K_MASK 0x7f000000 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_TAU_K_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_TAU_K_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for tx_lftonegen0 */ -#define PHY_ANALOG_TX_LFTONEGEN0_ADDRESS 0x00000390 -#define PHY_ANALOG_TX_LFTONEGEN0_OFFSET 0x00000390 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_FREQ_MSB 6 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_FREQ_LSB 0 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_FREQ_MASK 0x0000007f -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_FREQ_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_FREQ_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_EXP_MSB 11 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_EXP_LSB 8 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_EXP_MASK 0x00000f00 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_EXP_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_EXP_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_MAN_MSB 23 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_MAN_LSB 16 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_MAN_MASK 0x00ff0000 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_MAN_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_MAN_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_TAU_K_MSB 30 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_TAU_K_LSB 24 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_TAU_K_MASK 0x7f000000 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_TAU_K_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_TAU_K_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for tx_linear_ramp_i */ -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ADDRESS 0x00000394 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_OFFSET 0x00000394 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_INIT_MSB 10 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_INIT_LSB 0 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_INIT_MASK 0x000007ff -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_INIT_GET(x) (((x) & 0x000007ff) >> 0) -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_INIT_SET(x) (((x) << 0) & 0x000007ff) -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_DWELL_MSB 21 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_DWELL_LSB 12 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_DWELL_MASK 0x003ff000 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_DWELL_GET(x) (((x) & 0x003ff000) >> 12) -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_DWELL_SET(x) (((x) << 12) & 0x003ff000) -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_STEP_MSB 29 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_STEP_LSB 24 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_STEP_MASK 0x3f000000 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_STEP_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_STEP_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for tx_linear_ramp_q */ -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ADDRESS 0x00000398 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_OFFSET 0x00000398 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_INIT_MSB 10 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_INIT_LSB 0 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_INIT_MASK 0x000007ff -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_INIT_GET(x) (((x) & 0x000007ff) >> 0) -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_INIT_SET(x) (((x) << 0) & 0x000007ff) -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_DWELL_MSB 21 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_DWELL_LSB 12 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_DWELL_MASK 0x003ff000 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_DWELL_GET(x) (((x) & 0x003ff000) >> 12) -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_DWELL_SET(x) (((x) << 12) & 0x003ff000) -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_STEP_MSB 29 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_STEP_LSB 24 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_STEP_MASK 0x3f000000 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_STEP_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_STEP_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for tx_prbs_mag */ -#define PHY_ANALOG_TX_PRBS_MAG_ADDRESS 0x0000039c -#define PHY_ANALOG_TX_PRBS_MAG_OFFSET 0x0000039c -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_I_MSB 9 -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_I_LSB 0 -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_I_MASK 0x000003ff -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_I_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_I_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_Q_MSB 25 -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_Q_LSB 16 -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_Q_MASK 0x03ff0000 -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_Q_GET(x) (((x) & 0x03ff0000) >> 16) -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_Q_SET(x) (((x) << 16) & 0x03ff0000) - -/* macros for tx_prbs_seed_i */ -#define PHY_ANALOG_TX_PRBS_SEED_I_ADDRESS 0x000003a0 -#define PHY_ANALOG_TX_PRBS_SEED_I_OFFSET 0x000003a0 -#define PHY_ANALOG_TX_PRBS_SEED_I_ATE_TONEGEN_PRBS_SEED_MSB 30 -#define PHY_ANALOG_TX_PRBS_SEED_I_ATE_TONEGEN_PRBS_SEED_LSB 0 -#define PHY_ANALOG_TX_PRBS_SEED_I_ATE_TONEGEN_PRBS_SEED_MASK 0x7fffffff -#define PHY_ANALOG_TX_PRBS_SEED_I_ATE_TONEGEN_PRBS_SEED_GET(x) (((x) & 0x7fffffff) >> 0) -#define PHY_ANALOG_TX_PRBS_SEED_I_ATE_TONEGEN_PRBS_SEED_SET(x) (((x) << 0) & 0x7fffffff) - -/* macros for tx_prbs_seed_q */ -#define PHY_ANALOG_TX_PRBS_SEED_Q_ADDRESS 0x000003a4 -#define PHY_ANALOG_TX_PRBS_SEED_Q_OFFSET 0x000003a4 -#define PHY_ANALOG_TX_PRBS_SEED_Q_ATE_TONEGEN_PRBS_SEED_MSB 30 -#define PHY_ANALOG_TX_PRBS_SEED_Q_ATE_TONEGEN_PRBS_SEED_LSB 0 -#define PHY_ANALOG_TX_PRBS_SEED_Q_ATE_TONEGEN_PRBS_SEED_MASK 0x7fffffff -#define PHY_ANALOG_TX_PRBS_SEED_Q_ATE_TONEGEN_PRBS_SEED_GET(x) (((x) & 0x7fffffff) >> 0) -#define PHY_ANALOG_TX_PRBS_SEED_Q_ATE_TONEGEN_PRBS_SEED_SET(x) (((x) << 0) & 0x7fffffff) - -/* macros for cmac_dc_cancel */ -#define PHY_ANALOG_CMAC_DC_CANCEL_ADDRESS 0x000003a8 -#define PHY_ANALOG_CMAC_DC_CANCEL_OFFSET 0x000003a8 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_I_MSB 9 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_I_LSB 0 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_I_MASK 0x000003ff -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_I_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_I_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_Q_MSB 25 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_Q_LSB 16 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_Q_MASK 0x03ff0000 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_Q_GET(x) (((x) & 0x03ff0000) >> 16) -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_Q_SET(x) (((x) << 16) & 0x03ff0000) - -/* macros for cmac_dc_offset */ -#define PHY_ANALOG_CMAC_DC_OFFSET_ADDRESS 0x000003ac -#define PHY_ANALOG_CMAC_DC_OFFSET_OFFSET 0x000003ac -#define PHY_ANALOG_CMAC_DC_OFFSET_ATE_CMAC_DC_CYCLES_MSB 3 -#define PHY_ANALOG_CMAC_DC_OFFSET_ATE_CMAC_DC_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_DC_OFFSET_ATE_CMAC_DC_CYCLES_MASK 0x0000000f -#define PHY_ANALOG_CMAC_DC_OFFSET_ATE_CMAC_DC_CYCLES_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_CMAC_DC_OFFSET_ATE_CMAC_DC_CYCLES_SET(x) (((x) << 0) & 0x0000000f) - -/* macros for cmac_corr */ -#define PHY_ANALOG_CMAC_CORR_ADDRESS 0x000003b0 -#define PHY_ANALOG_CMAC_CORR_OFFSET 0x000003b0 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_CYCLES_MSB 4 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_CYCLES_MASK 0x0000001f -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_CYCLES_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_CYCLES_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_FREQ_MSB 13 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_FREQ_LSB 8 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_FREQ_MASK 0x00003f00 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_FREQ_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_FREQ_SET(x) (((x) << 8) & 0x00003f00) - -/* macros for cmac_power */ -#define PHY_ANALOG_CMAC_POWER_ADDRESS 0x000003b4 -#define PHY_ANALOG_CMAC_POWER_OFFSET 0x000003b4 -#define PHY_ANALOG_CMAC_POWER_ATE_CMAC_POWER_CYCLES_MSB 3 -#define PHY_ANALOG_CMAC_POWER_ATE_CMAC_POWER_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_POWER_ATE_CMAC_POWER_CYCLES_MASK 0x0000000f -#define PHY_ANALOG_CMAC_POWER_ATE_CMAC_POWER_CYCLES_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_CMAC_POWER_ATE_CMAC_POWER_CYCLES_SET(x) (((x) << 0) & 0x0000000f) - -/* macros for cmac_cross_corr */ -#define PHY_ANALOG_CMAC_CROSS_CORR_ADDRESS 0x000003b8 -#define PHY_ANALOG_CMAC_CROSS_CORR_OFFSET 0x000003b8 -#define PHY_ANALOG_CMAC_CROSS_CORR_ATE_CMAC_IQ_CYCLES_MSB 3 -#define PHY_ANALOG_CMAC_CROSS_CORR_ATE_CMAC_IQ_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_CROSS_CORR_ATE_CMAC_IQ_CYCLES_MASK 0x0000000f -#define PHY_ANALOG_CMAC_CROSS_CORR_ATE_CMAC_IQ_CYCLES_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_CMAC_CROSS_CORR_ATE_CMAC_IQ_CYCLES_SET(x) (((x) << 0) & 0x0000000f) - -/* macros for cmac_i2q2 */ -#define PHY_ANALOG_CMAC_I2Q2_ADDRESS 0x000003bc -#define PHY_ANALOG_CMAC_I2Q2_OFFSET 0x000003bc -#define PHY_ANALOG_CMAC_I2Q2_ATE_CMAC_I2Q2_CYCLES_MSB 3 -#define PHY_ANALOG_CMAC_I2Q2_ATE_CMAC_I2Q2_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_I2Q2_ATE_CMAC_I2Q2_CYCLES_MASK 0x0000000f -#define PHY_ANALOG_CMAC_I2Q2_ATE_CMAC_I2Q2_CYCLES_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_CMAC_I2Q2_ATE_CMAC_I2Q2_CYCLES_SET(x) (((x) << 0) & 0x0000000f) - -/* macros for cmac_power_hpf */ -#define PHY_ANALOG_CMAC_POWER_HPF_ADDRESS 0x000003c0 -#define PHY_ANALOG_CMAC_POWER_HPF_OFFSET 0x000003c0 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_CYCLES_MSB 3 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_CYCLES_MASK 0x0000000f -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_CYCLES_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_CYCLES_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_WAIT_MSB 7 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_WAIT_LSB 4 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_WAIT_MASK 0x000000f0 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_WAIT_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_WAIT_SET(x) (((x) << 4) & 0x000000f0) - -/* macros for rxdac_set1 */ -#define PHY_ANALOG_RXDAC_SET1_ADDRESS 0x000003c4 -#define PHY_ANALOG_RXDAC_SET1_OFFSET 0x000003c4 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_MUX_MSB 1 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_MUX_LSB 0 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_MUX_MASK 0x00000003 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_MUX_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_MUX_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_HI_GAIN_MSB 4 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_HI_GAIN_LSB 4 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_HI_GAIN_MASK 0x00000010 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_HI_GAIN_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_HI_GAIN_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_WAIT_MSB 13 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_WAIT_LSB 8 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_WAIT_MASK 0x00003f00 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_WAIT_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_WAIT_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_MEASURE_TIME_MSB 19 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_MEASURE_TIME_LSB 16 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_MEASURE_TIME_MASK 0x000f0000 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_MEASURE_TIME_GET(x) (((x) & 0x000f0000) >> 16) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_MEASURE_TIME_SET(x) (((x) << 16) & 0x000f0000) - -/* macros for rxdac_set2 */ -#define PHY_ANALOG_RXDAC_SET2_ADDRESS 0x000003c8 -#define PHY_ANALOG_RXDAC_SET2_OFFSET 0x000003c8 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_HI_MSB 4 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_HI_LSB 0 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_HI_MASK 0x0000001f -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_HI_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_HI_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_HI_MSB 12 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_HI_LSB 8 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_HI_MASK 0x00001f00 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_HI_GET(x) (((x) & 0x00001f00) >> 8) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_HI_SET(x) (((x) << 8) & 0x00001f00) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_LOW_MSB 20 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_LOW_LSB 16 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_LOW_MASK 0x001f0000 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_LOW_GET(x) (((x) & 0x001f0000) >> 16) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_LOW_SET(x) (((x) << 16) & 0x001f0000) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_LOW_MSB 28 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_LOW_LSB 24 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_LOW_MASK 0x1f000000 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_LOW_GET(x) (((x) & 0x1f000000) >> 24) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_LOW_SET(x) (((x) << 24) & 0x1f000000) - -/* macros for rxdac_long_shift */ -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ADDRESS 0x000003cc -#define PHY_ANALOG_RXDAC_LONG_SHIFT_OFFSET 0x000003cc -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_I_STATIC_MSB 4 -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_I_STATIC_LSB 0 -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_I_STATIC_MASK 0x0000001f -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_I_STATIC_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_I_STATIC_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_Q_STATIC_MSB 12 -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_Q_STATIC_LSB 8 -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_Q_STATIC_MASK 0x00001f00 -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_Q_STATIC_GET(x) (((x) & 0x00001f00) >> 8) -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_Q_STATIC_SET(x) (((x) << 8) & 0x00001f00) - -/* macros for cmac_results_i */ -#define PHY_ANALOG_CMAC_RESULTS_I_ADDRESS 0x000003d0 -#define PHY_ANALOG_CMAC_RESULTS_I_OFFSET 0x000003d0 -#define PHY_ANALOG_CMAC_RESULTS_I_ATE_CMAC_RESULTS_MSB 31 -#define PHY_ANALOG_CMAC_RESULTS_I_ATE_CMAC_RESULTS_LSB 0 -#define PHY_ANALOG_CMAC_RESULTS_I_ATE_CMAC_RESULTS_MASK 0xffffffff -#define PHY_ANALOG_CMAC_RESULTS_I_ATE_CMAC_RESULTS_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_ANALOG_CMAC_RESULTS_I_ATE_CMAC_RESULTS_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for cmac_results_q */ -#define PHY_ANALOG_CMAC_RESULTS_Q_ADDRESS 0x000003d4 -#define PHY_ANALOG_CMAC_RESULTS_Q_OFFSET 0x000003d4 -#define PHY_ANALOG_CMAC_RESULTS_Q_ATE_CMAC_RESULTS_MSB 31 -#define PHY_ANALOG_CMAC_RESULTS_Q_ATE_CMAC_RESULTS_LSB 0 -#define PHY_ANALOG_CMAC_RESULTS_Q_ATE_CMAC_RESULTS_MASK 0xffffffff -#define PHY_ANALOG_CMAC_RESULTS_Q_ATE_CMAC_RESULTS_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_ANALOG_CMAC_RESULTS_Q_ATE_CMAC_RESULTS_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for PMU1 */ -#define PHY_ANALOG_PMU1_ADDRESS 0x00000740 -#define PHY_ANALOG_PMU1_OFFSET 0x00000740 -#define PHY_ANALOG_PMU1_SPARE_MSB 10 -#define PHY_ANALOG_PMU1_SPARE_LSB 0 -#define PHY_ANALOG_PMU1_SPARE_MASK 0x000007ff -#define PHY_ANALOG_PMU1_SPARE_GET(x) (((x) & 0x000007ff) >> 0) -#define PHY_ANALOG_PMU1_SPARE_SET(x) (((x) << 0) & 0x000007ff) -#define PHY_ANALOG_PMU1_OTP_V25_PWD_MSB 11 -#define PHY_ANALOG_PMU1_OTP_V25_PWD_LSB 11 -#define PHY_ANALOG_PMU1_OTP_V25_PWD_MASK 0x00000800 -#define PHY_ANALOG_PMU1_OTP_V25_PWD_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_PMU1_OTP_V25_PWD_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_PMU1_PAREGON_MAN_MSB 12 -#define PHY_ANALOG_PMU1_PAREGON_MAN_LSB 12 -#define PHY_ANALOG_PMU1_PAREGON_MAN_MASK 0x00001000 -#define PHY_ANALOG_PMU1_PAREGON_MAN_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_PMU1_PAREGON_MAN_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_PMU1_OTPREGON_MAN_MSB 13 -#define PHY_ANALOG_PMU1_OTPREGON_MAN_LSB 13 -#define PHY_ANALOG_PMU1_OTPREGON_MAN_MASK 0x00002000 -#define PHY_ANALOG_PMU1_OTPREGON_MAN_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_PMU1_OTPREGON_MAN_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_PMU1_DREGON_MAN_MSB 14 -#define PHY_ANALOG_PMU1_DREGON_MAN_LSB 14 -#define PHY_ANALOG_PMU1_DREGON_MAN_MASK 0x00004000 -#define PHY_ANALOG_PMU1_DREGON_MAN_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_PMU1_DREGON_MAN_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_PMU1_DISCONTMODEEN_MSB 15 -#define PHY_ANALOG_PMU1_DISCONTMODEEN_LSB 15 -#define PHY_ANALOG_PMU1_DISCONTMODEEN_MASK 0x00008000 -#define PHY_ANALOG_PMU1_DISCONTMODEEN_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_PMU1_DISCONTMODEEN_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_PMU1_SWREGON_MAN_MSB 16 -#define PHY_ANALOG_PMU1_SWREGON_MAN_LSB 16 -#define PHY_ANALOG_PMU1_SWREGON_MAN_MASK 0x00010000 -#define PHY_ANALOG_PMU1_SWREGON_MAN_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_PMU1_SWREGON_MAN_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_PMU1_SWREG_FREQCUR_MSB 18 -#define PHY_ANALOG_PMU1_SWREG_FREQCUR_LSB 17 -#define PHY_ANALOG_PMU1_SWREG_FREQCUR_MASK 0x00060000 -#define PHY_ANALOG_PMU1_SWREG_FREQCUR_GET(x) (((x) & 0x00060000) >> 17) -#define PHY_ANALOG_PMU1_SWREG_FREQCUR_SET(x) (((x) << 17) & 0x00060000) -#define PHY_ANALOG_PMU1_SWREG_FREQCAP_MSB 21 -#define PHY_ANALOG_PMU1_SWREG_FREQCAP_LSB 19 -#define PHY_ANALOG_PMU1_SWREG_FREQCAP_MASK 0x00380000 -#define PHY_ANALOG_PMU1_SWREG_FREQCAP_GET(x) (((x) & 0x00380000) >> 19) -#define PHY_ANALOG_PMU1_SWREG_FREQCAP_SET(x) (((x) << 19) & 0x00380000) -#define PHY_ANALOG_PMU1_SWREG_LVLCTR_MSB 23 -#define PHY_ANALOG_PMU1_SWREG_LVLCTR_LSB 22 -#define PHY_ANALOG_PMU1_SWREG_LVLCTR_MASK 0x00c00000 -#define PHY_ANALOG_PMU1_SWREG_LVLCTR_GET(x) (((x) & 0x00c00000) >> 22) -#define PHY_ANALOG_PMU1_SWREG_LVLCTR_SET(x) (((x) << 22) & 0x00c00000) -#define PHY_ANALOG_PMU1_SREG_LVLCTR_MSB 25 -#define PHY_ANALOG_PMU1_SREG_LVLCTR_LSB 24 -#define PHY_ANALOG_PMU1_SREG_LVLCTR_MASK 0x03000000 -#define PHY_ANALOG_PMU1_SREG_LVLCTR_GET(x) (((x) & 0x03000000) >> 24) -#define PHY_ANALOG_PMU1_SREG_LVLCTR_SET(x) (((x) << 24) & 0x03000000) -#define PHY_ANALOG_PMU1_DREG_LVLCTR_MSB 27 -#define PHY_ANALOG_PMU1_DREG_LVLCTR_LSB 26 -#define PHY_ANALOG_PMU1_DREG_LVLCTR_MASK 0x0c000000 -#define PHY_ANALOG_PMU1_DREG_LVLCTR_GET(x) (((x) & 0x0c000000) >> 26) -#define PHY_ANALOG_PMU1_DREG_LVLCTR_SET(x) (((x) << 26) & 0x0c000000) -#define PHY_ANALOG_PMU1_PAREG_XPNP_MSB 28 -#define PHY_ANALOG_PMU1_PAREG_XPNP_LSB 28 -#define PHY_ANALOG_PMU1_PAREG_XPNP_MASK 0x10000000 -#define PHY_ANALOG_PMU1_PAREG_XPNP_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_PMU1_PAREG_XPNP_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_PMU1_PAREG_LVLCTR_MSB 31 -#define PHY_ANALOG_PMU1_PAREG_LVLCTR_LSB 29 -#define PHY_ANALOG_PMU1_PAREG_LVLCTR_MASK 0xe0000000 -#define PHY_ANALOG_PMU1_PAREG_LVLCTR_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_PMU1_PAREG_LVLCTR_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for PMU2 */ -#define PHY_ANALOG_PMU2_ADDRESS 0x00000744 -#define PHY_ANALOG_PMU2_OFFSET 0x00000744 -#define PHY_ANALOG_PMU2_SPARE_MSB 7 -#define PHY_ANALOG_PMU2_SPARE_LSB 0 -#define PHY_ANALOG_PMU2_SPARE_MASK 0x000000ff -#define PHY_ANALOG_PMU2_SPARE_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_ANALOG_PMU2_SPARE_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_ANALOG_PMU2_VBATT_1_3TOATB_MSB 8 -#define PHY_ANALOG_PMU2_VBATT_1_3TOATB_LSB 8 -#define PHY_ANALOG_PMU2_VBATT_1_3TOATB_MASK 0x00000100 -#define PHY_ANALOG_PMU2_VBATT_1_3TOATB_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_PMU2_VBATT_1_3TOATB_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_PMU2_VBATT_1_2TOATB_MSB 9 -#define PHY_ANALOG_PMU2_VBATT_1_2TOATB_LSB 9 -#define PHY_ANALOG_PMU2_VBATT_1_2TOATB_MASK 0x00000200 -#define PHY_ANALOG_PMU2_VBATT_1_2TOATB_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_PMU2_VBATT_1_2TOATB_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_PMU2_VBATT_2_3TOATB_MSB 10 -#define PHY_ANALOG_PMU2_VBATT_2_3TOATB_LSB 10 -#define PHY_ANALOG_PMU2_VBATT_2_3TOATB_MASK 0x00000400 -#define PHY_ANALOG_PMU2_VBATT_2_3TOATB_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_PMU2_VBATT_2_3TOATB_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_PMU2_PWD_BANDGAP_MAN_MSB 11 -#define PHY_ANALOG_PMU2_PWD_BANDGAP_MAN_LSB 11 -#define PHY_ANALOG_PMU2_PWD_BANDGAP_MAN_MASK 0x00000800 -#define PHY_ANALOG_PMU2_PWD_BANDGAP_MAN_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_PMU2_PWD_BANDGAP_MAN_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_PMU2_PWD_LFO_MAN_MSB 12 -#define PHY_ANALOG_PMU2_PWD_LFO_MAN_LSB 12 -#define PHY_ANALOG_PMU2_PWD_LFO_MAN_MASK 0x00001000 -#define PHY_ANALOG_PMU2_PWD_LFO_MAN_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_PMU2_PWD_LFO_MAN_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_PMU2_VBATT_LT_3P2_MSB 13 -#define PHY_ANALOG_PMU2_VBATT_LT_3P2_LSB 13 -#define PHY_ANALOG_PMU2_VBATT_LT_3P2_MASK 0x00002000 -#define PHY_ANALOG_PMU2_VBATT_LT_3P2_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_PMU2_VBATT_LT_3P2_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_PMU2_VBATT_LT_2P8_MSB 14 -#define PHY_ANALOG_PMU2_VBATT_LT_2P8_LSB 14 -#define PHY_ANALOG_PMU2_VBATT_LT_2P8_MASK 0x00004000 -#define PHY_ANALOG_PMU2_VBATT_LT_2P8_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_PMU2_VBATT_LT_2P8_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_PMU2_VBATT_GT_4P2_MSB 15 -#define PHY_ANALOG_PMU2_VBATT_GT_4P2_LSB 15 -#define PHY_ANALOG_PMU2_VBATT_GT_4P2_MASK 0x00008000 -#define PHY_ANALOG_PMU2_VBATT_GT_4P2_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_PMU2_VBATT_GT_4P2_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_PMU2_PMU_MAN_OVERRIDE_EN_MSB 16 -#define PHY_ANALOG_PMU2_PMU_MAN_OVERRIDE_EN_LSB 16 -#define PHY_ANALOG_PMU2_PMU_MAN_OVERRIDE_EN_MASK 0x00010000 -#define PHY_ANALOG_PMU2_PMU_MAN_OVERRIDE_EN_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_PMU2_PMU_MAN_OVERRIDE_EN_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_PMU2_VBATT_GT_LVLCTR_MSB 18 -#define PHY_ANALOG_PMU2_VBATT_GT_LVLCTR_LSB 17 -#define PHY_ANALOG_PMU2_VBATT_GT_LVLCTR_MASK 0x00060000 -#define PHY_ANALOG_PMU2_VBATT_GT_LVLCTR_GET(x) (((x) & 0x00060000) >> 17) -#define PHY_ANALOG_PMU2_VBATT_GT_LVLCTR_SET(x) (((x) << 17) & 0x00060000) -#define PHY_ANALOG_PMU2_SWREGVSSL2ATB_MSB 19 -#define PHY_ANALOG_PMU2_SWREGVSSL2ATB_LSB 19 -#define PHY_ANALOG_PMU2_SWREGVSSL2ATB_MASK 0x00080000 -#define PHY_ANALOG_PMU2_SWREGVSSL2ATB_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_ANALOG_PMU2_SWREGVSSL2ATB_SET(x) (((x) << 19) & 0x00080000) -#define PHY_ANALOG_PMU2_SWREGVSSL_LVLCTR_MSB 21 -#define PHY_ANALOG_PMU2_SWREGVSSL_LVLCTR_LSB 20 -#define PHY_ANALOG_PMU2_SWREGVSSL_LVLCTR_MASK 0x00300000 -#define PHY_ANALOG_PMU2_SWREGVSSL_LVLCTR_GET(x) (((x) & 0x00300000) >> 20) -#define PHY_ANALOG_PMU2_SWREGVSSL_LVLCTR_SET(x) (((x) << 20) & 0x00300000) -#define PHY_ANALOG_PMU2_SWREGVDDH2ATB_MSB 22 -#define PHY_ANALOG_PMU2_SWREGVDDH2ATB_LSB 22 -#define PHY_ANALOG_PMU2_SWREGVDDH2ATB_MASK 0x00400000 -#define PHY_ANALOG_PMU2_SWREGVDDH2ATB_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_PMU2_SWREGVDDH2ATB_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_PMU2_SWREGVDDH_LVLCTR_MSB 24 -#define PHY_ANALOG_PMU2_SWREGVDDH_LVLCTR_LSB 23 -#define PHY_ANALOG_PMU2_SWREGVDDH_LVLCTR_MASK 0x01800000 -#define PHY_ANALOG_PMU2_SWREGVDDH_LVLCTR_GET(x) (((x) & 0x01800000) >> 23) -#define PHY_ANALOG_PMU2_SWREGVDDH_LVLCTR_SET(x) (((x) << 23) & 0x01800000) -#define PHY_ANALOG_PMU2_SWREG2ATB_MSB 27 -#define PHY_ANALOG_PMU2_SWREG2ATB_LSB 25 -#define PHY_ANALOG_PMU2_SWREG2ATB_MASK 0x0e000000 -#define PHY_ANALOG_PMU2_SWREG2ATB_GET(x) (((x) & 0x0e000000) >> 25) -#define PHY_ANALOG_PMU2_SWREG2ATB_SET(x) (((x) << 25) & 0x0e000000) -#define PHY_ANALOG_PMU2_OTPREG2ATB_MSB 28 -#define PHY_ANALOG_PMU2_OTPREG2ATB_LSB 28 -#define PHY_ANALOG_PMU2_OTPREG2ATB_MASK 0x10000000 -#define PHY_ANALOG_PMU2_OTPREG2ATB_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_PMU2_OTPREG2ATB_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_MSB 30 -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_LSB 29 -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_MASK 0x60000000 -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_GET(x) (((x) & 0x60000000) >> 29) -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_SET(x) (((x) << 29) & 0x60000000) -#define PHY_ANALOG_PMU2_DREG_LVLCTR_MANOVR_EN_MSB 31 -#define PHY_ANALOG_PMU2_DREG_LVLCTR_MANOVR_EN_LSB 31 -#define PHY_ANALOG_PMU2_DREG_LVLCTR_MANOVR_EN_MASK 0x80000000 -#define PHY_ANALOG_PMU2_DREG_LVLCTR_MANOVR_EN_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_PMU2_DREG_LVLCTR_MANOVR_EN_SET(x) (((x) << 31) & 0x80000000) - - -#ifndef __ASSEMBLER__ - -typedef struct analog_intf_athr_wlan_reg_reg_s { - volatile unsigned int RXRF_BIAS1; /* 0x0 - 0x4 */ - volatile unsigned int RXRF_BIAS2; /* 0x4 - 0x8 */ - volatile unsigned int RXRF_GAINSTAGES; /* 0x8 - 0xc */ - volatile unsigned int RXRF_AGC; /* 0xc - 0x10 */ - volatile char pad__0[0x30]; /* 0x10 - 0x40 */ - volatile unsigned int TXRF1; /* 0x40 - 0x44 */ - volatile unsigned int TXRF2; /* 0x44 - 0x48 */ - volatile unsigned int TXRF3; /* 0x48 - 0x4c */ - volatile unsigned int TXRF4; /* 0x4c - 0x50 */ - volatile unsigned int TXRF5; /* 0x50 - 0x54 */ - volatile unsigned int TXRF6; /* 0x54 - 0x58 */ - volatile unsigned int TXRF7; /* 0x58 - 0x5c */ - volatile unsigned int TXRF8; /* 0x5c - 0x60 */ - volatile unsigned int TXRF9; /* 0x60 - 0x64 */ - volatile unsigned int TXRF10; /* 0x64 - 0x68 */ - volatile unsigned int TXRF11; /* 0x68 - 0x6c */ - volatile unsigned int TXRF12; /* 0x6c - 0x70 */ - volatile char pad__1[0x10]; /* 0x70 - 0x80 */ - volatile unsigned int SYNTH1; /* 0x80 - 0x84 */ - volatile unsigned int SYNTH2; /* 0x84 - 0x88 */ - volatile unsigned int SYNTH3; /* 0x88 - 0x8c */ - volatile unsigned int SYNTH4; /* 0x8c - 0x90 */ - volatile unsigned int SYNTH5; /* 0x90 - 0x94 */ - volatile unsigned int SYNTH6; /* 0x94 - 0x98 */ - volatile unsigned int SYNTH7; /* 0x98 - 0x9c */ - volatile unsigned int SYNTH8; /* 0x9c - 0xa0 */ - volatile unsigned int SYNTH9; /* 0xa0 - 0xa4 */ - volatile unsigned int SYNTH10; /* 0xa4 - 0xa8 */ - volatile unsigned int SYNTH11; /* 0xa8 - 0xac */ - volatile unsigned int SYNTH12; /* 0xac - 0xb0 */ - volatile unsigned int SYNTH13; /* 0xb0 - 0xb4 */ - volatile unsigned int SYNTH14; /* 0xb4 - 0xb8 */ - volatile char pad__2[0x8]; /* 0xb8 - 0xc0 */ - volatile unsigned int BIAS1; /* 0xc0 - 0xc4 */ - volatile unsigned int BIAS2; /* 0xc4 - 0xc8 */ - volatile unsigned int BIAS3; /* 0xc8 - 0xcc */ - volatile unsigned int BIAS4; /* 0xcc - 0xd0 */ - volatile char pad__3[0x30]; /* 0xd0 - 0x100 */ - volatile unsigned int RXTX1; /* 0x100 - 0x104 */ - volatile unsigned int RXTX2; /* 0x104 - 0x108 */ - volatile unsigned int RXTX3; /* 0x108 - 0x10c */ - volatile char pad__4[0x34]; /* 0x10c - 0x140 */ - volatile unsigned int BB1; /* 0x140 - 0x144 */ - volatile unsigned int BB2; /* 0x144 - 0x148 */ - volatile unsigned int BB3; /* 0x148 - 0x14c */ - volatile char pad__5[0x134]; /* 0x14c - 0x280 */ - volatile unsigned int PLLCLKMODA; /* 0x280 - 0x284 */ - volatile unsigned int PLLCLKMODA2; /* 0x284 - 0x288 */ - volatile unsigned int TOP; /* 0x288 - 0x28c */ - volatile unsigned int THERM; /* 0x28c - 0x290 */ - volatile unsigned int XTAL; /* 0x290 - 0x294 */ - volatile char pad__6[0xec]; /* 0x294 - 0x380 */ - volatile unsigned int rbist_cntrl; /* 0x380 - 0x384 */ - volatile unsigned int tx_dc_offset; /* 0x384 - 0x388 */ - volatile unsigned int tx_tonegen0; /* 0x388 - 0x38c */ - volatile unsigned int tx_tonegen1; /* 0x38c - 0x390 */ - volatile unsigned int tx_lftonegen0; /* 0x390 - 0x394 */ - volatile unsigned int tx_linear_ramp_i; /* 0x394 - 0x398 */ - volatile unsigned int tx_linear_ramp_q; /* 0x398 - 0x39c */ - volatile unsigned int tx_prbs_mag; /* 0x39c - 0x3a0 */ - volatile unsigned int tx_prbs_seed_i; /* 0x3a0 - 0x3a4 */ - volatile unsigned int tx_prbs_seed_q; /* 0x3a4 - 0x3a8 */ - volatile unsigned int cmac_dc_cancel; /* 0x3a8 - 0x3ac */ - volatile unsigned int cmac_dc_offset; /* 0x3ac - 0x3b0 */ - volatile unsigned int cmac_corr; /* 0x3b0 - 0x3b4 */ - volatile unsigned int cmac_power; /* 0x3b4 - 0x3b8 */ - volatile unsigned int cmac_cross_corr; /* 0x3b8 - 0x3bc */ - volatile unsigned int cmac_i2q2; /* 0x3bc - 0x3c0 */ - volatile unsigned int cmac_power_hpf; /* 0x3c0 - 0x3c4 */ - volatile unsigned int rxdac_set1; /* 0x3c4 - 0x3c8 */ - volatile unsigned int rxdac_set2; /* 0x3c8 - 0x3cc */ - volatile unsigned int rxdac_long_shift; /* 0x3cc - 0x3d0 */ - volatile unsigned int cmac_results_i; /* 0x3d0 - 0x3d4 */ - volatile unsigned int cmac_results_q; /* 0x3d4 - 0x3d8 */ - volatile char pad__7[0x368]; /* 0x3d8 - 0x740 */ - volatile unsigned int PMU1; /* 0x740 - 0x744 */ - volatile unsigned int PMU2; /* 0x744 - 0x748 */ -} analog_intf_athr_wlan_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _ANALOG_INTF_ATHR_WLAN_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/analog_intf_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/analog_intf_reg.h deleted file mode 100644 index ab3e163e857f..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/analog_intf_reg.h +++ /dev/null @@ -1,37 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "analog_intf_athr_wlan_reg.h" - - -#ifndef BT_HEADERS - - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/apb_athr_wlan_map.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/apb_athr_wlan_map.h deleted file mode 100644 index 4eebb1f0285d..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/apb_athr_wlan_map.h +++ /dev/null @@ -1,40 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _APB_ATHR_WLAN_MAP_H_ -#define _APB_ATHR_WLAN_MAP_H_ - -#define WLAN_RTC_BASE_ADDRESS 0x00004000 -#define WLAN_VMC_BASE_ADDRESS 0x00008000 -#define WLAN_UART_BASE_ADDRESS 0x0000c000 -#define WLAN_DBG_UART_BASE_ADDRESS 0x0000d000 -#define WLAN_UMBOX_BASE_ADDRESS 0x0000e000 -#define WLAN_SI_BASE_ADDRESS 0x00010000 -#define WLAN_GPIO_BASE_ADDRESS 0x00014000 -#define WLAN_MBOX_BASE_ADDRESS 0x00018000 -#define WLAN_ANALOG_INTF_BASE_ADDRESS 0x0001c000 -#define WLAN_MAC_BASE_ADDRESS 0x00020000 -#define WLAN_RDMA_BASE_ADDRESS 0x00030100 -#define EFUSE_BASE_ADDRESS 0x00031000 - -#endif /* _APB_ATHR_WLAN_MAP_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/apb_map.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/apb_map.h deleted file mode 100644 index d267d8aeedbc..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/apb_map.h +++ /dev/null @@ -1,48 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "apb_athr_wlan_map.h" - - -#ifndef BT_HEADERS - -#define RTC_BASE_ADDRESS WLAN_RTC_BASE_ADDRESS -#define VMC_BASE_ADDRESS WLAN_VMC_BASE_ADDRESS -#define UART_BASE_ADDRESS WLAN_UART_BASE_ADDRESS -#define DBG_UART_BASE_ADDRESS WLAN_DBG_UART_BASE_ADDRESS -#define UMBOX_BASE_ADDRESS WLAN_UMBOX_BASE_ADDRESS -#define SI_BASE_ADDRESS WLAN_SI_BASE_ADDRESS -#define GPIO_BASE_ADDRESS WLAN_GPIO_BASE_ADDRESS -#define MBOX_BASE_ADDRESS WLAN_MBOX_BASE_ADDRESS -#define ANALOG_INTF_BASE_ADDRESS WLAN_ANALOG_INTF_BASE_ADDRESS -#define MAC_BASE_ADDRESS WLAN_MAC_BASE_ADDRESS -#define RDMA_BASE_ADDRESS WLAN_RDMA_BASE_ADDRESS - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/bb_lc_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/bb_lc_reg.h deleted file mode 100644 index f68edbcd761b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/bb_lc_reg.h +++ /dev/null @@ -1,7076 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2009 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _BB_LC_REG_REG_H_ -#define _BB_LC_REG_REG_H_ - - -/* macros for BB_test_controls */ -#define PHY_BB_TEST_CONTROLS_ADDRESS 0x00009800 -#define PHY_BB_TEST_CONTROLS_OFFSET 0x00009800 -#define PHY_BB_TEST_CONTROLS_CF_TSTTRIG_SEL_MSB 3 -#define PHY_BB_TEST_CONTROLS_CF_TSTTRIG_SEL_LSB 0 -#define PHY_BB_TEST_CONTROLS_CF_TSTTRIG_SEL_MASK 0x0000000f -#define PHY_BB_TEST_CONTROLS_CF_TSTTRIG_SEL_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_BB_TEST_CONTROLS_CF_TSTTRIG_SEL_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_BB_TEST_CONTROLS_CF_TSTTRIG_MSB 4 -#define PHY_BB_TEST_CONTROLS_CF_TSTTRIG_LSB 4 -#define PHY_BB_TEST_CONTROLS_CF_TSTTRIG_MASK 0x00000010 -#define PHY_BB_TEST_CONTROLS_CF_TSTTRIG_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_BB_TEST_CONTROLS_CF_TSTTRIG_SET(x) (((x) << 4) & 0x00000010) -#define PHY_BB_TEST_CONTROLS_CF_RFSHIFT_SEL_MSB 6 -#define PHY_BB_TEST_CONTROLS_CF_RFSHIFT_SEL_LSB 5 -#define PHY_BB_TEST_CONTROLS_CF_RFSHIFT_SEL_MASK 0x00000060 -#define PHY_BB_TEST_CONTROLS_CF_RFSHIFT_SEL_GET(x) (((x) & 0x00000060) >> 5) -#define PHY_BB_TEST_CONTROLS_CF_RFSHIFT_SEL_SET(x) (((x) << 5) & 0x00000060) -#define PHY_BB_TEST_CONTROLS_CARDBUS_MODE_MSB 9 -#define PHY_BB_TEST_CONTROLS_CARDBUS_MODE_LSB 8 -#define PHY_BB_TEST_CONTROLS_CARDBUS_MODE_MASK 0x00000300 -#define PHY_BB_TEST_CONTROLS_CARDBUS_MODE_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_BB_TEST_CONTROLS_CARDBUS_MODE_SET(x) (((x) << 8) & 0x00000300) -#define PHY_BB_TEST_CONTROLS_CLKOUT_IS_CLK32_MSB 10 -#define PHY_BB_TEST_CONTROLS_CLKOUT_IS_CLK32_LSB 10 -#define PHY_BB_TEST_CONTROLS_CLKOUT_IS_CLK32_MASK 0x00000400 -#define PHY_BB_TEST_CONTROLS_CLKOUT_IS_CLK32_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_BB_TEST_CONTROLS_CLKOUT_IS_CLK32_SET(x) (((x) << 10) & 0x00000400) -#define PHY_BB_TEST_CONTROLS_ENABLE_RFSILENT_BB_MSB 13 -#define PHY_BB_TEST_CONTROLS_ENABLE_RFSILENT_BB_LSB 13 -#define PHY_BB_TEST_CONTROLS_ENABLE_RFSILENT_BB_MASK 0x00002000 -#define PHY_BB_TEST_CONTROLS_ENABLE_RFSILENT_BB_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_BB_TEST_CONTROLS_ENABLE_RFSILENT_BB_SET(x) (((x) << 13) & 0x00002000) -#define PHY_BB_TEST_CONTROLS_ENABLE_MINI_OBS_MSB 15 -#define PHY_BB_TEST_CONTROLS_ENABLE_MINI_OBS_LSB 15 -#define PHY_BB_TEST_CONTROLS_ENABLE_MINI_OBS_MASK 0x00008000 -#define PHY_BB_TEST_CONTROLS_ENABLE_MINI_OBS_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_BB_TEST_CONTROLS_ENABLE_MINI_OBS_SET(x) (((x) << 15) & 0x00008000) -#define PHY_BB_TEST_CONTROLS_SLOW_CLK160_MSB 17 -#define PHY_BB_TEST_CONTROLS_SLOW_CLK160_LSB 17 -#define PHY_BB_TEST_CONTROLS_SLOW_CLK160_MASK 0x00020000 -#define PHY_BB_TEST_CONTROLS_SLOW_CLK160_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_BB_TEST_CONTROLS_SLOW_CLK160_SET(x) (((x) << 17) & 0x00020000) -#define PHY_BB_TEST_CONTROLS_AGC_OBS_SEL_3_MSB 18 -#define PHY_BB_TEST_CONTROLS_AGC_OBS_SEL_3_LSB 18 -#define PHY_BB_TEST_CONTROLS_AGC_OBS_SEL_3_MASK 0x00040000 -#define PHY_BB_TEST_CONTROLS_AGC_OBS_SEL_3_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_BB_TEST_CONTROLS_AGC_OBS_SEL_3_SET(x) (((x) << 18) & 0x00040000) -#define PHY_BB_TEST_CONTROLS_CF_BBB_OBS_SEL_MSB 22 -#define PHY_BB_TEST_CONTROLS_CF_BBB_OBS_SEL_LSB 19 -#define PHY_BB_TEST_CONTROLS_CF_BBB_OBS_SEL_MASK 0x00780000 -#define PHY_BB_TEST_CONTROLS_CF_BBB_OBS_SEL_GET(x) (((x) & 0x00780000) >> 19) -#define PHY_BB_TEST_CONTROLS_CF_BBB_OBS_SEL_SET(x) (((x) << 19) & 0x00780000) -#define PHY_BB_TEST_CONTROLS_RX_OBS_SEL_5TH_BIT_MSB 23 -#define PHY_BB_TEST_CONTROLS_RX_OBS_SEL_5TH_BIT_LSB 23 -#define PHY_BB_TEST_CONTROLS_RX_OBS_SEL_5TH_BIT_MASK 0x00800000 -#define PHY_BB_TEST_CONTROLS_RX_OBS_SEL_5TH_BIT_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_BB_TEST_CONTROLS_RX_OBS_SEL_5TH_BIT_SET(x) (((x) << 23) & 0x00800000) -#define PHY_BB_TEST_CONTROLS_AGC_OBS_SEL_4_MSB 24 -#define PHY_BB_TEST_CONTROLS_AGC_OBS_SEL_4_LSB 24 -#define PHY_BB_TEST_CONTROLS_AGC_OBS_SEL_4_MASK 0x01000000 -#define PHY_BB_TEST_CONTROLS_AGC_OBS_SEL_4_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_BB_TEST_CONTROLS_AGC_OBS_SEL_4_SET(x) (((x) << 24) & 0x01000000) -#define PHY_BB_TEST_CONTROLS_FORCE_AGC_CLEAR_MSB 28 -#define PHY_BB_TEST_CONTROLS_FORCE_AGC_CLEAR_LSB 28 -#define PHY_BB_TEST_CONTROLS_FORCE_AGC_CLEAR_MASK 0x10000000 -#define PHY_BB_TEST_CONTROLS_FORCE_AGC_CLEAR_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_BB_TEST_CONTROLS_FORCE_AGC_CLEAR_SET(x) (((x) << 28) & 0x10000000) -#define PHY_BB_TEST_CONTROLS_TSTDAC_OUT_SEL_MSB 31 -#define PHY_BB_TEST_CONTROLS_TSTDAC_OUT_SEL_LSB 30 -#define PHY_BB_TEST_CONTROLS_TSTDAC_OUT_SEL_MASK 0xc0000000 -#define PHY_BB_TEST_CONTROLS_TSTDAC_OUT_SEL_GET(x) (((x) & 0xc0000000) >> 30) -#define PHY_BB_TEST_CONTROLS_TSTDAC_OUT_SEL_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for BB_gen_controls */ -#define PHY_BB_GEN_CONTROLS_ADDRESS 0x00009804 -#define PHY_BB_GEN_CONTROLS_OFFSET 0x00009804 -#define PHY_BB_GEN_CONTROLS_TURBO_MSB 0 -#define PHY_BB_GEN_CONTROLS_TURBO_LSB 0 -#define PHY_BB_GEN_CONTROLS_TURBO_MASK 0x00000001 -#define PHY_BB_GEN_CONTROLS_TURBO_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_GEN_CONTROLS_TURBO_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_GEN_CONTROLS_CF_SHORT20_MSB 1 -#define PHY_BB_GEN_CONTROLS_CF_SHORT20_LSB 1 -#define PHY_BB_GEN_CONTROLS_CF_SHORT20_MASK 0x00000002 -#define PHY_BB_GEN_CONTROLS_CF_SHORT20_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_GEN_CONTROLS_CF_SHORT20_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_GEN_CONTROLS_DYN_20_40_MSB 2 -#define PHY_BB_GEN_CONTROLS_DYN_20_40_LSB 2 -#define PHY_BB_GEN_CONTROLS_DYN_20_40_MASK 0x00000004 -#define PHY_BB_GEN_CONTROLS_DYN_20_40_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_BB_GEN_CONTROLS_DYN_20_40_SET(x) (((x) << 2) & 0x00000004) -#define PHY_BB_GEN_CONTROLS_DYN_20_40_PRI_ONLY_MSB 3 -#define PHY_BB_GEN_CONTROLS_DYN_20_40_PRI_ONLY_LSB 3 -#define PHY_BB_GEN_CONTROLS_DYN_20_40_PRI_ONLY_MASK 0x00000008 -#define PHY_BB_GEN_CONTROLS_DYN_20_40_PRI_ONLY_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_BB_GEN_CONTROLS_DYN_20_40_PRI_ONLY_SET(x) (((x) << 3) & 0x00000008) -#define PHY_BB_GEN_CONTROLS_DYN_20_40_PRI_CHN_MSB 4 -#define PHY_BB_GEN_CONTROLS_DYN_20_40_PRI_CHN_LSB 4 -#define PHY_BB_GEN_CONTROLS_DYN_20_40_PRI_CHN_MASK 0x00000010 -#define PHY_BB_GEN_CONTROLS_DYN_20_40_PRI_CHN_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_BB_GEN_CONTROLS_DYN_20_40_PRI_CHN_SET(x) (((x) << 4) & 0x00000010) -#define PHY_BB_GEN_CONTROLS_DYN_20_40_EXT_CHN_MSB 5 -#define PHY_BB_GEN_CONTROLS_DYN_20_40_EXT_CHN_LSB 5 -#define PHY_BB_GEN_CONTROLS_DYN_20_40_EXT_CHN_MASK 0x00000020 -#define PHY_BB_GEN_CONTROLS_DYN_20_40_EXT_CHN_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_BB_GEN_CONTROLS_DYN_20_40_EXT_CHN_SET(x) (((x) << 5) & 0x00000020) -#define PHY_BB_GEN_CONTROLS_HT_ENABLE_MSB 6 -#define PHY_BB_GEN_CONTROLS_HT_ENABLE_LSB 6 -#define PHY_BB_GEN_CONTROLS_HT_ENABLE_MASK 0x00000040 -#define PHY_BB_GEN_CONTROLS_HT_ENABLE_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_BB_GEN_CONTROLS_HT_ENABLE_SET(x) (((x) << 6) & 0x00000040) -#define PHY_BB_GEN_CONTROLS_ALLOW_SHORT_GI_MSB 7 -#define PHY_BB_GEN_CONTROLS_ALLOW_SHORT_GI_LSB 7 -#define PHY_BB_GEN_CONTROLS_ALLOW_SHORT_GI_MASK 0x00000080 -#define PHY_BB_GEN_CONTROLS_ALLOW_SHORT_GI_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_BB_GEN_CONTROLS_ALLOW_SHORT_GI_SET(x) (((x) << 7) & 0x00000080) -#define PHY_BB_GEN_CONTROLS_CF_2_CHAINS_USE_WALSH_MSB 8 -#define PHY_BB_GEN_CONTROLS_CF_2_CHAINS_USE_WALSH_LSB 8 -#define PHY_BB_GEN_CONTROLS_CF_2_CHAINS_USE_WALSH_MASK 0x00000100 -#define PHY_BB_GEN_CONTROLS_CF_2_CHAINS_USE_WALSH_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_BB_GEN_CONTROLS_CF_2_CHAINS_USE_WALSH_SET(x) (((x) << 8) & 0x00000100) -#define PHY_BB_GEN_CONTROLS_CF_SINGLE_HT_LTF1_MSB 9 -#define PHY_BB_GEN_CONTROLS_CF_SINGLE_HT_LTF1_LSB 9 -#define PHY_BB_GEN_CONTROLS_CF_SINGLE_HT_LTF1_MASK 0x00000200 -#define PHY_BB_GEN_CONTROLS_CF_SINGLE_HT_LTF1_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_BB_GEN_CONTROLS_CF_SINGLE_HT_LTF1_SET(x) (((x) << 9) & 0x00000200) -#define PHY_BB_GEN_CONTROLS_GF_ENABLE_MSB 10 -#define PHY_BB_GEN_CONTROLS_GF_ENABLE_LSB 10 -#define PHY_BB_GEN_CONTROLS_GF_ENABLE_MASK 0x00000400 -#define PHY_BB_GEN_CONTROLS_GF_ENABLE_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_BB_GEN_CONTROLS_GF_ENABLE_SET(x) (((x) << 10) & 0x00000400) -#define PHY_BB_GEN_CONTROLS_BYPASS_DAC_FIFO_N_MSB 11 -#define PHY_BB_GEN_CONTROLS_BYPASS_DAC_FIFO_N_LSB 11 -#define PHY_BB_GEN_CONTROLS_BYPASS_DAC_FIFO_N_MASK 0x00000800 -#define PHY_BB_GEN_CONTROLS_BYPASS_DAC_FIFO_N_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_BB_GEN_CONTROLS_BYPASS_DAC_FIFO_N_SET(x) (((x) << 11) & 0x00000800) - -/* macros for BB_test_controls_status */ -#define PHY_BB_TEST_CONTROLS_STATUS_ADDRESS 0x00009808 -#define PHY_BB_TEST_CONTROLS_STATUS_OFFSET 0x00009808 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TSTDAC_EN_MSB 0 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TSTDAC_EN_LSB 0 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TSTDAC_EN_MASK 0x00000001 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TSTDAC_EN_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TSTDAC_EN_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_SRC_IS_TSTDAC_MSB 1 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_SRC_IS_TSTDAC_LSB 1 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_SRC_IS_TSTDAC_MASK 0x00000002 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_SRC_IS_TSTDAC_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_SRC_IS_TSTDAC_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_OBS_SEL_MSB 4 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_OBS_SEL_LSB 2 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_OBS_SEL_MASK 0x0000001c -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_OBS_SEL_GET(x) (((x) & 0x0000001c) >> 2) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_OBS_SEL_SET(x) (((x) << 2) & 0x0000001c) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_OBS_MUX_SEL_MSB 6 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_OBS_MUX_SEL_LSB 5 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_OBS_MUX_SEL_MASK 0x00000060 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_OBS_MUX_SEL_GET(x) (((x) & 0x00000060) >> 5) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_OBS_MUX_SEL_SET(x) (((x) << 5) & 0x00000060) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_SRC_ALTERNATE_MSB 7 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_SRC_ALTERNATE_LSB 7 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_SRC_ALTERNATE_MASK 0x00000080 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_SRC_ALTERNATE_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TX_SRC_ALTERNATE_SET(x) (((x) << 7) & 0x00000080) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TSTADC_EN_MSB 8 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TSTADC_EN_LSB 8 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TSTADC_EN_MASK 0x00000100 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TSTADC_EN_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_TSTADC_EN_SET(x) (((x) << 8) & 0x00000100) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_RX_SRC_IS_TSTADC_MSB 9 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_RX_SRC_IS_TSTADC_LSB 9 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_RX_SRC_IS_TSTADC_MASK 0x00000200 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_RX_SRC_IS_TSTADC_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_RX_SRC_IS_TSTADC_SET(x) (((x) << 9) & 0x00000200) -#define PHY_BB_TEST_CONTROLS_STATUS_RX_OBS_SEL_MSB 13 -#define PHY_BB_TEST_CONTROLS_STATUS_RX_OBS_SEL_LSB 10 -#define PHY_BB_TEST_CONTROLS_STATUS_RX_OBS_SEL_MASK 0x00003c00 -#define PHY_BB_TEST_CONTROLS_STATUS_RX_OBS_SEL_GET(x) (((x) & 0x00003c00) >> 10) -#define PHY_BB_TEST_CONTROLS_STATUS_RX_OBS_SEL_SET(x) (((x) << 10) & 0x00003c00) -#define PHY_BB_TEST_CONTROLS_STATUS_DISABLE_A2_WARM_RESET_MSB 14 -#define PHY_BB_TEST_CONTROLS_STATUS_DISABLE_A2_WARM_RESET_LSB 14 -#define PHY_BB_TEST_CONTROLS_STATUS_DISABLE_A2_WARM_RESET_MASK 0x00004000 -#define PHY_BB_TEST_CONTROLS_STATUS_DISABLE_A2_WARM_RESET_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_BB_TEST_CONTROLS_STATUS_DISABLE_A2_WARM_RESET_SET(x) (((x) << 14) & 0x00004000) -#define PHY_BB_TEST_CONTROLS_STATUS_RESET_A2_MSB 15 -#define PHY_BB_TEST_CONTROLS_STATUS_RESET_A2_LSB 15 -#define PHY_BB_TEST_CONTROLS_STATUS_RESET_A2_MASK 0x00008000 -#define PHY_BB_TEST_CONTROLS_STATUS_RESET_A2_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_BB_TEST_CONTROLS_STATUS_RESET_A2_SET(x) (((x) << 15) & 0x00008000) -#define PHY_BB_TEST_CONTROLS_STATUS_AGC_OBS_SEL_MSB 18 -#define PHY_BB_TEST_CONTROLS_STATUS_AGC_OBS_SEL_LSB 16 -#define PHY_BB_TEST_CONTROLS_STATUS_AGC_OBS_SEL_MASK 0x00070000 -#define PHY_BB_TEST_CONTROLS_STATUS_AGC_OBS_SEL_GET(x) (((x) & 0x00070000) >> 16) -#define PHY_BB_TEST_CONTROLS_STATUS_AGC_OBS_SEL_SET(x) (((x) << 16) & 0x00070000) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_ENABLE_FFT_DUMP_MSB 19 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_ENABLE_FFT_DUMP_LSB 19 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_ENABLE_FFT_DUMP_MASK 0x00080000 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_ENABLE_FFT_DUMP_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_ENABLE_FFT_DUMP_SET(x) (((x) << 19) & 0x00080000) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_IN_MSB 23 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_IN_LSB 23 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_IN_MASK 0x00800000 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_IN_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_IN_SET(x) (((x) << 23) & 0x00800000) -#define PHY_BB_TEST_CONTROLS_STATUS_DISABLE_AGC_TO_A2_MSB 27 -#define PHY_BB_TEST_CONTROLS_STATUS_DISABLE_AGC_TO_A2_LSB 27 -#define PHY_BB_TEST_CONTROLS_STATUS_DISABLE_AGC_TO_A2_MASK 0x08000000 -#define PHY_BB_TEST_CONTROLS_STATUS_DISABLE_AGC_TO_A2_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_BB_TEST_CONTROLS_STATUS_DISABLE_AGC_TO_A2_SET(x) (((x) << 27) & 0x08000000) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_EN_MSB 28 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_EN_LSB 28 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_EN_MASK 0x10000000 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_EN_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_EN_SET(x) (((x) << 28) & 0x10000000) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_SEL_MSB 30 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_SEL_LSB 29 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_SEL_MASK 0x60000000 -#define PHY_BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_SEL_GET(x) (((x) & 0x60000000) >> 29) -#define PHY_BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_SEL_SET(x) (((x) << 29) & 0x60000000) - -/* macros for BB_timing_controls_1 */ -#define PHY_BB_TIMING_CONTROLS_1_ADDRESS 0x0000980c -#define PHY_BB_TIMING_CONTROLS_1_OFFSET 0x0000980c -#define PHY_BB_TIMING_CONTROLS_1_STE_THR_MSB 6 -#define PHY_BB_TIMING_CONTROLS_1_STE_THR_LSB 0 -#define PHY_BB_TIMING_CONTROLS_1_STE_THR_MASK 0x0000007f -#define PHY_BB_TIMING_CONTROLS_1_STE_THR_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_BB_TIMING_CONTROLS_1_STE_THR_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_BB_TIMING_CONTROLS_1_STE_TO_LONG1_MSB 12 -#define PHY_BB_TIMING_CONTROLS_1_STE_TO_LONG1_LSB 7 -#define PHY_BB_TIMING_CONTROLS_1_STE_TO_LONG1_MASK 0x00001f80 -#define PHY_BB_TIMING_CONTROLS_1_STE_TO_LONG1_GET(x) (((x) & 0x00001f80) >> 7) -#define PHY_BB_TIMING_CONTROLS_1_STE_TO_LONG1_SET(x) (((x) << 7) & 0x00001f80) -#define PHY_BB_TIMING_CONTROLS_1_TIMING_BACKOFF_MSB 16 -#define PHY_BB_TIMING_CONTROLS_1_TIMING_BACKOFF_LSB 13 -#define PHY_BB_TIMING_CONTROLS_1_TIMING_BACKOFF_MASK 0x0001e000 -#define PHY_BB_TIMING_CONTROLS_1_TIMING_BACKOFF_GET(x) (((x) & 0x0001e000) >> 13) -#define PHY_BB_TIMING_CONTROLS_1_TIMING_BACKOFF_SET(x) (((x) << 13) & 0x0001e000) -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_HT_FINE_PPM_MSB 17 -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_HT_FINE_PPM_LSB 17 -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_HT_FINE_PPM_MASK 0x00020000 -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_HT_FINE_PPM_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_HT_FINE_PPM_SET(x) (((x) << 17) & 0x00020000) -#define PHY_BB_TIMING_CONTROLS_1_HT_FINE_PPM_STREAM_MSB 19 -#define PHY_BB_TIMING_CONTROLS_1_HT_FINE_PPM_STREAM_LSB 18 -#define PHY_BB_TIMING_CONTROLS_1_HT_FINE_PPM_STREAM_MASK 0x000c0000 -#define PHY_BB_TIMING_CONTROLS_1_HT_FINE_PPM_STREAM_GET(x) (((x) & 0x000c0000) >> 18) -#define PHY_BB_TIMING_CONTROLS_1_HT_FINE_PPM_STREAM_SET(x) (((x) << 18) & 0x000c0000) -#define PHY_BB_TIMING_CONTROLS_1_HT_FINE_PPM_QAM_MSB 21 -#define PHY_BB_TIMING_CONTROLS_1_HT_FINE_PPM_QAM_LSB 20 -#define PHY_BB_TIMING_CONTROLS_1_HT_FINE_PPM_QAM_MASK 0x00300000 -#define PHY_BB_TIMING_CONTROLS_1_HT_FINE_PPM_QAM_GET(x) (((x) & 0x00300000) >> 20) -#define PHY_BB_TIMING_CONTROLS_1_HT_FINE_PPM_QAM_SET(x) (((x) << 20) & 0x00300000) -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_LONG_CHANFIL_MSB 22 -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_LONG_CHANFIL_LSB 22 -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_LONG_CHANFIL_MASK 0x00400000 -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_LONG_CHANFIL_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_LONG_CHANFIL_SET(x) (((x) << 22) & 0x00400000) -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_RX_STBC_MSB 23 -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_RX_STBC_LSB 23 -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_RX_STBC_MASK 0x00800000 -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_RX_STBC_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_RX_STBC_SET(x) (((x) << 23) & 0x00800000) -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_CHANNEL_FILTER_MSB 24 -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_CHANNEL_FILTER_LSB 24 -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_CHANNEL_FILTER_MASK 0x01000000 -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_CHANNEL_FILTER_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_CHANNEL_FILTER_SET(x) (((x) << 24) & 0x01000000) -#define PHY_BB_TIMING_CONTROLS_1_FALSE_ALARM_MSB 26 -#define PHY_BB_TIMING_CONTROLS_1_FALSE_ALARM_LSB 25 -#define PHY_BB_TIMING_CONTROLS_1_FALSE_ALARM_MASK 0x06000000 -#define PHY_BB_TIMING_CONTROLS_1_FALSE_ALARM_GET(x) (((x) & 0x06000000) >> 25) -#define PHY_BB_TIMING_CONTROLS_1_FALSE_ALARM_SET(x) (((x) << 25) & 0x06000000) -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_LONG_RESCALE_MSB 27 -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_LONG_RESCALE_LSB 27 -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_LONG_RESCALE_MASK 0x08000000 -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_LONG_RESCALE_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_BB_TIMING_CONTROLS_1_ENABLE_LONG_RESCALE_SET(x) (((x) << 27) & 0x08000000) -#define PHY_BB_TIMING_CONTROLS_1_TIMING_LEAK_ENABLE_MSB 28 -#define PHY_BB_TIMING_CONTROLS_1_TIMING_LEAK_ENABLE_LSB 28 -#define PHY_BB_TIMING_CONTROLS_1_TIMING_LEAK_ENABLE_MASK 0x10000000 -#define PHY_BB_TIMING_CONTROLS_1_TIMING_LEAK_ENABLE_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_BB_TIMING_CONTROLS_1_TIMING_LEAK_ENABLE_SET(x) (((x) << 28) & 0x10000000) -#define PHY_BB_TIMING_CONTROLS_1_COARSE_PPM_SELECT_MSB 30 -#define PHY_BB_TIMING_CONTROLS_1_COARSE_PPM_SELECT_LSB 29 -#define PHY_BB_TIMING_CONTROLS_1_COARSE_PPM_SELECT_MASK 0x60000000 -#define PHY_BB_TIMING_CONTROLS_1_COARSE_PPM_SELECT_GET(x) (((x) & 0x60000000) >> 29) -#define PHY_BB_TIMING_CONTROLS_1_COARSE_PPM_SELECT_SET(x) (((x) << 29) & 0x60000000) -#define PHY_BB_TIMING_CONTROLS_1_FFT_SCALING_MSB 31 -#define PHY_BB_TIMING_CONTROLS_1_FFT_SCALING_LSB 31 -#define PHY_BB_TIMING_CONTROLS_1_FFT_SCALING_MASK 0x80000000 -#define PHY_BB_TIMING_CONTROLS_1_FFT_SCALING_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_TIMING_CONTROLS_1_FFT_SCALING_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_timing_controls_2 */ -#define PHY_BB_TIMING_CONTROLS_2_ADDRESS 0x00009810 -#define PHY_BB_TIMING_CONTROLS_2_OFFSET 0x00009810 -#define PHY_BB_TIMING_CONTROLS_2_FORCED_DELTA_PHI_SYMBOL_MSB 11 -#define PHY_BB_TIMING_CONTROLS_2_FORCED_DELTA_PHI_SYMBOL_LSB 0 -#define PHY_BB_TIMING_CONTROLS_2_FORCED_DELTA_PHI_SYMBOL_MASK 0x00000fff -#define PHY_BB_TIMING_CONTROLS_2_FORCED_DELTA_PHI_SYMBOL_GET(x) (((x) & 0x00000fff) >> 0) -#define PHY_BB_TIMING_CONTROLS_2_FORCED_DELTA_PHI_SYMBOL_SET(x) (((x) << 0) & 0x00000fff) -#define PHY_BB_TIMING_CONTROLS_2_FORCE_DELTA_PHI_SYMBOL_MSB 12 -#define PHY_BB_TIMING_CONTROLS_2_FORCE_DELTA_PHI_SYMBOL_LSB 12 -#define PHY_BB_TIMING_CONTROLS_2_FORCE_DELTA_PHI_SYMBOL_MASK 0x00001000 -#define PHY_BB_TIMING_CONTROLS_2_FORCE_DELTA_PHI_SYMBOL_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_BB_TIMING_CONTROLS_2_FORCE_DELTA_PHI_SYMBOL_SET(x) (((x) << 12) & 0x00001000) -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_MAGNITUDE_TRACK_MSB 13 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_MAGNITUDE_TRACK_LSB 13 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_MAGNITUDE_TRACK_MASK 0x00002000 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_MAGNITUDE_TRACK_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_MAGNITUDE_TRACK_SET(x) (((x) << 13) & 0x00002000) -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_SLOPE_FILTER_MSB 14 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_SLOPE_FILTER_LSB 14 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_SLOPE_FILTER_MASK 0x00004000 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_SLOPE_FILTER_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_SLOPE_FILTER_SET(x) (((x) << 14) & 0x00004000) -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_OFFSET_FILTER_MSB 15 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_OFFSET_FILTER_LSB 15 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_OFFSET_FILTER_MASK 0x00008000 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_OFFSET_FILTER_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_OFFSET_FILTER_SET(x) (((x) << 15) & 0x00008000) -#define PHY_BB_TIMING_CONTROLS_2_DC_OFF_DELTAF_THRES_MSB 22 -#define PHY_BB_TIMING_CONTROLS_2_DC_OFF_DELTAF_THRES_LSB 16 -#define PHY_BB_TIMING_CONTROLS_2_DC_OFF_DELTAF_THRES_MASK 0x007f0000 -#define PHY_BB_TIMING_CONTROLS_2_DC_OFF_DELTAF_THRES_GET(x) (((x) & 0x007f0000) >> 16) -#define PHY_BB_TIMING_CONTROLS_2_DC_OFF_DELTAF_THRES_SET(x) (((x) << 16) & 0x007f0000) -#define PHY_BB_TIMING_CONTROLS_2_DC_OFF_TIM_CONST_MSB 26 -#define PHY_BB_TIMING_CONTROLS_2_DC_OFF_TIM_CONST_LSB 24 -#define PHY_BB_TIMING_CONTROLS_2_DC_OFF_TIM_CONST_MASK 0x07000000 -#define PHY_BB_TIMING_CONTROLS_2_DC_OFF_TIM_CONST_GET(x) (((x) & 0x07000000) >> 24) -#define PHY_BB_TIMING_CONTROLS_2_DC_OFF_TIM_CONST_SET(x) (((x) << 24) & 0x07000000) -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_MSB 27 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_LSB 27 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_MASK 0x08000000 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_SET(x) (((x) << 27) & 0x08000000) -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_TRACK_MSB 28 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_TRACK_LSB 28 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_TRACK_MASK 0x10000000 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_TRACK_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_TRACK_SET(x) (((x) << 28) & 0x10000000) -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_WEIGHTING_MSB 29 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_WEIGHTING_LSB 29 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_WEIGHTING_MASK 0x20000000 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_WEIGHTING_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_WEIGHTING_SET(x) (((x) << 29) & 0x20000000) -#define PHY_BB_TIMING_CONTROLS_2_TRACEBACK128_MSB 30 -#define PHY_BB_TIMING_CONTROLS_2_TRACEBACK128_LSB 30 -#define PHY_BB_TIMING_CONTROLS_2_TRACEBACK128_MASK 0x40000000 -#define PHY_BB_TIMING_CONTROLS_2_TRACEBACK128_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_BB_TIMING_CONTROLS_2_TRACEBACK128_SET(x) (((x) << 30) & 0x40000000) -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_HT_FINE_TIMING_MSB 31 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_HT_FINE_TIMING_LSB 31 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_HT_FINE_TIMING_MASK 0x80000000 -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_HT_FINE_TIMING_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_TIMING_CONTROLS_2_ENABLE_HT_FINE_TIMING_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_timing_controls_3 */ -#define PHY_BB_TIMING_CONTROLS_3_ADDRESS 0x00009814 -#define PHY_BB_TIMING_CONTROLS_3_OFFSET 0x00009814 -#define PHY_BB_TIMING_CONTROLS_3_PPM_RESCUE_INTERVAL_MSB 7 -#define PHY_BB_TIMING_CONTROLS_3_PPM_RESCUE_INTERVAL_LSB 0 -#define PHY_BB_TIMING_CONTROLS_3_PPM_RESCUE_INTERVAL_MASK 0x000000ff -#define PHY_BB_TIMING_CONTROLS_3_PPM_RESCUE_INTERVAL_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_TIMING_CONTROLS_3_PPM_RESCUE_INTERVAL_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_PPM_RESCUE_MSB 8 -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_PPM_RESCUE_LSB 8 -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_PPM_RESCUE_MASK 0x00000100 -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_PPM_RESCUE_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_PPM_RESCUE_SET(x) (((x) << 8) & 0x00000100) -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_FINE_PPM_MSB 9 -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_FINE_PPM_LSB 9 -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_FINE_PPM_MASK 0x00000200 -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_FINE_PPM_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_FINE_PPM_SET(x) (((x) << 9) & 0x00000200) -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_FINE_INTERP_MSB 10 -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_FINE_INTERP_LSB 10 -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_FINE_INTERP_MASK 0x00000400 -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_FINE_INTERP_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_FINE_INTERP_SET(x) (((x) << 10) & 0x00000400) -#define PHY_BB_TIMING_CONTROLS_3_CONTINUOUS_PPM_RESCUE_MSB 11 -#define PHY_BB_TIMING_CONTROLS_3_CONTINUOUS_PPM_RESCUE_LSB 11 -#define PHY_BB_TIMING_CONTROLS_3_CONTINUOUS_PPM_RESCUE_MASK 0x00000800 -#define PHY_BB_TIMING_CONTROLS_3_CONTINUOUS_PPM_RESCUE_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_BB_TIMING_CONTROLS_3_CONTINUOUS_PPM_RESCUE_SET(x) (((x) << 11) & 0x00000800) -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_DF_CHANEST_MSB 12 -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_DF_CHANEST_LSB 12 -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_DF_CHANEST_MASK 0x00001000 -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_DF_CHANEST_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_BB_TIMING_CONTROLS_3_ENABLE_DF_CHANEST_SET(x) (((x) << 12) & 0x00001000) -#define PHY_BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_EXP_MSB 16 -#define PHY_BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_EXP_LSB 13 -#define PHY_BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_EXP_MASK 0x0001e000 -#define PHY_BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_EXP_GET(x) (((x) & 0x0001e000) >> 13) -#define PHY_BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_EXP_SET(x) (((x) << 13) & 0x0001e000) -#define PHY_BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_MAN_MSB 31 -#define PHY_BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_MAN_LSB 17 -#define PHY_BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_MAN_MASK 0xfffe0000 -#define PHY_BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_MAN_GET(x) (((x) & 0xfffe0000) >> 17) -#define PHY_BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_MAN_SET(x) (((x) << 17) & 0xfffe0000) - -/* macros for BB_D2_chip_id */ -#define PHY_BB_D2_CHIP_ID_ADDRESS 0x00009818 -#define PHY_BB_D2_CHIP_ID_OFFSET 0x00009818 -#define PHY_BB_D2_CHIP_ID_OLD_ID_MSB 7 -#define PHY_BB_D2_CHIP_ID_OLD_ID_LSB 0 -#define PHY_BB_D2_CHIP_ID_OLD_ID_MASK 0x000000ff -#define PHY_BB_D2_CHIP_ID_OLD_ID_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_D2_CHIP_ID_ID_MSB 31 -#define PHY_BB_D2_CHIP_ID_ID_LSB 8 -#define PHY_BB_D2_CHIP_ID_ID_MASK 0xffffff00 -#define PHY_BB_D2_CHIP_ID_ID_GET(x) (((x) & 0xffffff00) >> 8) - -/* macros for BB_active */ -#define PHY_BB_ACTIVE_ADDRESS 0x0000981c -#define PHY_BB_ACTIVE_OFFSET 0x0000981c -#define PHY_BB_ACTIVE_CF_ACTIVE_MSB 0 -#define PHY_BB_ACTIVE_CF_ACTIVE_LSB 0 -#define PHY_BB_ACTIVE_CF_ACTIVE_MASK 0x00000001 -#define PHY_BB_ACTIVE_CF_ACTIVE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_ACTIVE_CF_ACTIVE_SET(x) (((x) << 0) & 0x00000001) - -/* macros for BB_tx_timing_1 */ -#define PHY_BB_TX_TIMING_1_ADDRESS 0x00009820 -#define PHY_BB_TX_TIMING_1_OFFSET 0x00009820 -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_ADC_OFF_MSB 7 -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_ADC_OFF_LSB 0 -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_ADC_OFF_MASK 0x000000ff -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_ADC_OFF_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_ADC_OFF_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_A2_RX_OFF_MSB 15 -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_A2_RX_OFF_LSB 8 -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_A2_RX_OFF_MASK 0x0000ff00 -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_A2_RX_OFF_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_A2_RX_OFF_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_DAC_ON_MSB 23 -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_DAC_ON_LSB 16 -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_DAC_ON_MASK 0x00ff0000 -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_DAC_ON_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_DAC_ON_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_A2_TX_ON_MSB 31 -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_A2_TX_ON_LSB 24 -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_A2_TX_ON_MASK 0xff000000 -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_A2_TX_ON_GET(x) (((x) & 0xff000000) >> 24) -#define PHY_BB_TX_TIMING_1_TX_FRAME_TO_A2_TX_ON_SET(x) (((x) << 24) & 0xff000000) - -/* macros for BB_tx_timing_2 */ -#define PHY_BB_TX_TIMING_2_ADDRESS 0x00009824 -#define PHY_BB_TX_TIMING_2_OFFSET 0x00009824 -#define PHY_BB_TX_TIMING_2_TX_FRAME_TO_TX_D_START_MSB 7 -#define PHY_BB_TX_TIMING_2_TX_FRAME_TO_TX_D_START_LSB 0 -#define PHY_BB_TX_TIMING_2_TX_FRAME_TO_TX_D_START_MASK 0x000000ff -#define PHY_BB_TX_TIMING_2_TX_FRAME_TO_TX_D_START_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_TX_TIMING_2_TX_FRAME_TO_TX_D_START_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_TX_TIMING_2_TX_FRAME_TO_PA_ON_MSB 15 -#define PHY_BB_TX_TIMING_2_TX_FRAME_TO_PA_ON_LSB 8 -#define PHY_BB_TX_TIMING_2_TX_FRAME_TO_PA_ON_MASK 0x0000ff00 -#define PHY_BB_TX_TIMING_2_TX_FRAME_TO_PA_ON_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_TX_TIMING_2_TX_FRAME_TO_PA_ON_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_TX_TIMING_2_TX_END_TO_PA_OFF_MSB 23 -#define PHY_BB_TX_TIMING_2_TX_END_TO_PA_OFF_LSB 16 -#define PHY_BB_TX_TIMING_2_TX_END_TO_PA_OFF_MASK 0x00ff0000 -#define PHY_BB_TX_TIMING_2_TX_END_TO_PA_OFF_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_BB_TX_TIMING_2_TX_END_TO_PA_OFF_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_BB_TX_TIMING_2_TX_END_TO_A2_TX_OFF_MSB 31 -#define PHY_BB_TX_TIMING_2_TX_END_TO_A2_TX_OFF_LSB 24 -#define PHY_BB_TX_TIMING_2_TX_END_TO_A2_TX_OFF_MASK 0xff000000 -#define PHY_BB_TX_TIMING_2_TX_END_TO_A2_TX_OFF_GET(x) (((x) & 0xff000000) >> 24) -#define PHY_BB_TX_TIMING_2_TX_END_TO_A2_TX_OFF_SET(x) (((x) << 24) & 0xff000000) - -/* macros for BB_tx_timing_3 */ -#define PHY_BB_TX_TIMING_3_ADDRESS 0x00009828 -#define PHY_BB_TX_TIMING_3_OFFSET 0x00009828 -#define PHY_BB_TX_TIMING_3_TX_END_TO_DAC_OFF_MSB 7 -#define PHY_BB_TX_TIMING_3_TX_END_TO_DAC_OFF_LSB 0 -#define PHY_BB_TX_TIMING_3_TX_END_TO_DAC_OFF_MASK 0x000000ff -#define PHY_BB_TX_TIMING_3_TX_END_TO_DAC_OFF_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_TX_TIMING_3_TX_END_TO_DAC_OFF_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_TX_TIMING_3_TX_FRAME_TO_THERM_CHAIN_ON_MSB 15 -#define PHY_BB_TX_TIMING_3_TX_FRAME_TO_THERM_CHAIN_ON_LSB 8 -#define PHY_BB_TX_TIMING_3_TX_FRAME_TO_THERM_CHAIN_ON_MASK 0x0000ff00 -#define PHY_BB_TX_TIMING_3_TX_FRAME_TO_THERM_CHAIN_ON_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_TX_TIMING_3_TX_FRAME_TO_THERM_CHAIN_ON_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_TX_TIMING_3_TX_END_TO_A2_RX_ON_MSB 23 -#define PHY_BB_TX_TIMING_3_TX_END_TO_A2_RX_ON_LSB 16 -#define PHY_BB_TX_TIMING_3_TX_END_TO_A2_RX_ON_MASK 0x00ff0000 -#define PHY_BB_TX_TIMING_3_TX_END_TO_A2_RX_ON_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_BB_TX_TIMING_3_TX_END_TO_A2_RX_ON_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_BB_TX_TIMING_3_TX_END_TO_ADC_ON_MSB 31 -#define PHY_BB_TX_TIMING_3_TX_END_TO_ADC_ON_LSB 24 -#define PHY_BB_TX_TIMING_3_TX_END_TO_ADC_ON_MASK 0xff000000 -#define PHY_BB_TX_TIMING_3_TX_END_TO_ADC_ON_GET(x) (((x) & 0xff000000) >> 24) -#define PHY_BB_TX_TIMING_3_TX_END_TO_ADC_ON_SET(x) (((x) << 24) & 0xff000000) - -/* macros for BB_addac_parallel_control */ -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ADDRESS 0x0000982c -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFFSET 0x0000982c -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFF_DACLPMODE_MSB 12 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFF_DACLPMODE_LSB 12 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFF_DACLPMODE_MASK 0x00001000 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFF_DACLPMODE_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFF_DACLPMODE_SET(x) (((x) << 12) & 0x00001000) -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFF_PWDDAC_MSB 13 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFF_PWDDAC_LSB 13 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFF_PWDDAC_MASK 0x00002000 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFF_PWDDAC_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFF_PWDDAC_SET(x) (((x) << 13) & 0x00002000) -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFF_PWDADC_MSB 15 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFF_PWDADC_LSB 15 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFF_PWDADC_MASK 0x00008000 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFF_PWDADC_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_BB_ADDAC_PARALLEL_CONTROL_OFF_PWDADC_SET(x) (((x) << 15) & 0x00008000) -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ON_DACLPMODE_MSB 28 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ON_DACLPMODE_LSB 28 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ON_DACLPMODE_MASK 0x10000000 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ON_DACLPMODE_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ON_DACLPMODE_SET(x) (((x) << 28) & 0x10000000) -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ON_PWDDAC_MSB 29 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ON_PWDDAC_LSB 29 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ON_PWDDAC_MASK 0x20000000 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ON_PWDDAC_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ON_PWDDAC_SET(x) (((x) << 29) & 0x20000000) -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ON_PWDADC_MSB 31 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ON_PWDADC_LSB 31 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ON_PWDADC_MASK 0x80000000 -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ON_PWDADC_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_ADDAC_PARALLEL_CONTROL_ON_PWDADC_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_xpa_timing_control */ -#define PHY_BB_XPA_TIMING_CONTROL_ADDRESS 0x00009834 -#define PHY_BB_XPA_TIMING_CONTROL_OFFSET 0x00009834 -#define PHY_BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAA_ON_MSB 7 -#define PHY_BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAA_ON_LSB 0 -#define PHY_BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAA_ON_MASK 0x000000ff -#define PHY_BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAA_ON_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAA_ON_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAB_ON_MSB 15 -#define PHY_BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAB_ON_LSB 8 -#define PHY_BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAB_ON_MASK 0x0000ff00 -#define PHY_BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAB_ON_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAB_ON_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_XPA_TIMING_CONTROL_TX_END_TO_XPAA_OFF_MSB 23 -#define PHY_BB_XPA_TIMING_CONTROL_TX_END_TO_XPAA_OFF_LSB 16 -#define PHY_BB_XPA_TIMING_CONTROL_TX_END_TO_XPAA_OFF_MASK 0x00ff0000 -#define PHY_BB_XPA_TIMING_CONTROL_TX_END_TO_XPAA_OFF_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_BB_XPA_TIMING_CONTROL_TX_END_TO_XPAA_OFF_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_BB_XPA_TIMING_CONTROL_TX_END_TO_XPAB_OFF_MSB 31 -#define PHY_BB_XPA_TIMING_CONTROL_TX_END_TO_XPAB_OFF_LSB 24 -#define PHY_BB_XPA_TIMING_CONTROL_TX_END_TO_XPAB_OFF_MASK 0xff000000 -#define PHY_BB_XPA_TIMING_CONTROL_TX_END_TO_XPAB_OFF_GET(x) (((x) & 0xff000000) >> 24) -#define PHY_BB_XPA_TIMING_CONTROL_TX_END_TO_XPAB_OFF_SET(x) (((x) << 24) & 0xff000000) - -/* macros for BB_misc_pa_control */ -#define PHY_BB_MISC_PA_CONTROL_ADDRESS 0x00009838 -#define PHY_BB_MISC_PA_CONTROL_OFFSET 0x00009838 -#define PHY_BB_MISC_PA_CONTROL_XPAA_ACTIVE_HIGH_MSB 0 -#define PHY_BB_MISC_PA_CONTROL_XPAA_ACTIVE_HIGH_LSB 0 -#define PHY_BB_MISC_PA_CONTROL_XPAA_ACTIVE_HIGH_MASK 0x00000001 -#define PHY_BB_MISC_PA_CONTROL_XPAA_ACTIVE_HIGH_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_MISC_PA_CONTROL_XPAA_ACTIVE_HIGH_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_MISC_PA_CONTROL_XPAB_ACTIVE_HIGH_MSB 1 -#define PHY_BB_MISC_PA_CONTROL_XPAB_ACTIVE_HIGH_LSB 1 -#define PHY_BB_MISC_PA_CONTROL_XPAB_ACTIVE_HIGH_MASK 0x00000002 -#define PHY_BB_MISC_PA_CONTROL_XPAB_ACTIVE_HIGH_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_MISC_PA_CONTROL_XPAB_ACTIVE_HIGH_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_MISC_PA_CONTROL_ENABLE_XPAA_MSB 2 -#define PHY_BB_MISC_PA_CONTROL_ENABLE_XPAA_LSB 2 -#define PHY_BB_MISC_PA_CONTROL_ENABLE_XPAA_MASK 0x00000004 -#define PHY_BB_MISC_PA_CONTROL_ENABLE_XPAA_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_BB_MISC_PA_CONTROL_ENABLE_XPAA_SET(x) (((x) << 2) & 0x00000004) -#define PHY_BB_MISC_PA_CONTROL_ENABLE_XPAB_MSB 3 -#define PHY_BB_MISC_PA_CONTROL_ENABLE_XPAB_LSB 3 -#define PHY_BB_MISC_PA_CONTROL_ENABLE_XPAB_MASK 0x00000008 -#define PHY_BB_MISC_PA_CONTROL_ENABLE_XPAB_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_BB_MISC_PA_CONTROL_ENABLE_XPAB_SET(x) (((x) << 3) & 0x00000008) - -/* macros for BB_tstdac_constant */ -#define PHY_BB_TSTDAC_CONSTANT_ADDRESS 0x0000983c -#define PHY_BB_TSTDAC_CONSTANT_OFFSET 0x0000983c -#define PHY_BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_I_MSB 10 -#define PHY_BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_I_LSB 0 -#define PHY_BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_I_MASK 0x000007ff -#define PHY_BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_I_GET(x) (((x) & 0x000007ff) >> 0) -#define PHY_BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_I_SET(x) (((x) << 0) & 0x000007ff) -#define PHY_BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_Q_MSB 21 -#define PHY_BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_Q_LSB 11 -#define PHY_BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_Q_MASK 0x003ff800 -#define PHY_BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_Q_GET(x) (((x) & 0x003ff800) >> 11) -#define PHY_BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_Q_SET(x) (((x) << 11) & 0x003ff800) - -/* macros for BB_find_signal_low */ -#define PHY_BB_FIND_SIGNAL_LOW_ADDRESS 0x00009840 -#define PHY_BB_FIND_SIGNAL_LOW_OFFSET 0x00009840 -#define PHY_BB_FIND_SIGNAL_LOW_RELSTEP_LOW_MSB 5 -#define PHY_BB_FIND_SIGNAL_LOW_RELSTEP_LOW_LSB 0 -#define PHY_BB_FIND_SIGNAL_LOW_RELSTEP_LOW_MASK 0x0000003f -#define PHY_BB_FIND_SIGNAL_LOW_RELSTEP_LOW_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_FIND_SIGNAL_LOW_RELSTEP_LOW_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_FIND_SIGNAL_LOW_FIRSTEP_LOW_MSB 11 -#define PHY_BB_FIND_SIGNAL_LOW_FIRSTEP_LOW_LSB 6 -#define PHY_BB_FIND_SIGNAL_LOW_FIRSTEP_LOW_MASK 0x00000fc0 -#define PHY_BB_FIND_SIGNAL_LOW_FIRSTEP_LOW_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_FIND_SIGNAL_LOW_FIRSTEP_LOW_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_FIND_SIGNAL_LOW_FIRPWR_LOW_MSB 19 -#define PHY_BB_FIND_SIGNAL_LOW_FIRPWR_LOW_LSB 12 -#define PHY_BB_FIND_SIGNAL_LOW_FIRPWR_LOW_MASK 0x000ff000 -#define PHY_BB_FIND_SIGNAL_LOW_FIRPWR_LOW_GET(x) (((x) & 0x000ff000) >> 12) -#define PHY_BB_FIND_SIGNAL_LOW_FIRPWR_LOW_SET(x) (((x) << 12) & 0x000ff000) -#define PHY_BB_FIND_SIGNAL_LOW_YCOK_MAX_LOW_MSB 23 -#define PHY_BB_FIND_SIGNAL_LOW_YCOK_MAX_LOW_LSB 20 -#define PHY_BB_FIND_SIGNAL_LOW_YCOK_MAX_LOW_MASK 0x00f00000 -#define PHY_BB_FIND_SIGNAL_LOW_YCOK_MAX_LOW_GET(x) (((x) & 0x00f00000) >> 20) -#define PHY_BB_FIND_SIGNAL_LOW_YCOK_MAX_LOW_SET(x) (((x) << 20) & 0x00f00000) -#define PHY_BB_FIND_SIGNAL_LOW_LONG_SC_THRESH_MSB 30 -#define PHY_BB_FIND_SIGNAL_LOW_LONG_SC_THRESH_LSB 24 -#define PHY_BB_FIND_SIGNAL_LOW_LONG_SC_THRESH_MASK 0x7f000000 -#define PHY_BB_FIND_SIGNAL_LOW_LONG_SC_THRESH_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_BB_FIND_SIGNAL_LOW_LONG_SC_THRESH_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for BB_settling_time */ -#define PHY_BB_SETTLING_TIME_ADDRESS 0x00009844 -#define PHY_BB_SETTLING_TIME_OFFSET 0x00009844 -#define PHY_BB_SETTLING_TIME_AGC_SETTLING_MSB 6 -#define PHY_BB_SETTLING_TIME_AGC_SETTLING_LSB 0 -#define PHY_BB_SETTLING_TIME_AGC_SETTLING_MASK 0x0000007f -#define PHY_BB_SETTLING_TIME_AGC_SETTLING_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_BB_SETTLING_TIME_AGC_SETTLING_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_BB_SETTLING_TIME_SWITCH_SETTLING_MSB 13 -#define PHY_BB_SETTLING_TIME_SWITCH_SETTLING_LSB 7 -#define PHY_BB_SETTLING_TIME_SWITCH_SETTLING_MASK 0x00003f80 -#define PHY_BB_SETTLING_TIME_SWITCH_SETTLING_GET(x) (((x) & 0x00003f80) >> 7) -#define PHY_BB_SETTLING_TIME_SWITCH_SETTLING_SET(x) (((x) << 7) & 0x00003f80) -#define PHY_BB_SETTLING_TIME_ADCSAT_THRL_MSB 19 -#define PHY_BB_SETTLING_TIME_ADCSAT_THRL_LSB 14 -#define PHY_BB_SETTLING_TIME_ADCSAT_THRL_MASK 0x000fc000 -#define PHY_BB_SETTLING_TIME_ADCSAT_THRL_GET(x) (((x) & 0x000fc000) >> 14) -#define PHY_BB_SETTLING_TIME_ADCSAT_THRL_SET(x) (((x) << 14) & 0x000fc000) -#define PHY_BB_SETTLING_TIME_ADCSAT_THRH_MSB 25 -#define PHY_BB_SETTLING_TIME_ADCSAT_THRH_LSB 20 -#define PHY_BB_SETTLING_TIME_ADCSAT_THRH_MASK 0x03f00000 -#define PHY_BB_SETTLING_TIME_ADCSAT_THRH_GET(x) (((x) & 0x03f00000) >> 20) -#define PHY_BB_SETTLING_TIME_ADCSAT_THRH_SET(x) (((x) << 20) & 0x03f00000) -#define PHY_BB_SETTLING_TIME_LBRESET_ADVANCE_MSB 29 -#define PHY_BB_SETTLING_TIME_LBRESET_ADVANCE_LSB 26 -#define PHY_BB_SETTLING_TIME_LBRESET_ADVANCE_MASK 0x3c000000 -#define PHY_BB_SETTLING_TIME_LBRESET_ADVANCE_GET(x) (((x) & 0x3c000000) >> 26) -#define PHY_BB_SETTLING_TIME_LBRESET_ADVANCE_SET(x) (((x) << 26) & 0x3c000000) - -/* macros for BB_gain_force_max_gains_b0 */ -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_ADDRESS 0x00009848 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_OFFSET 0x00009848 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN1_HYST_MARGIN_0_MSB 13 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN1_HYST_MARGIN_0_LSB 7 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN1_HYST_MARGIN_0_MASK 0x00003f80 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN1_HYST_MARGIN_0_GET(x) (((x) & 0x00003f80) >> 7) -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN1_HYST_MARGIN_0_SET(x) (((x) << 7) & 0x00003f80) -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN2_HYST_MARGIN_0_MSB 20 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN2_HYST_MARGIN_0_LSB 14 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN2_HYST_MARGIN_0_MASK 0x001fc000 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN2_HYST_MARGIN_0_GET(x) (((x) & 0x001fc000) >> 14) -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN2_HYST_MARGIN_0_SET(x) (((x) << 14) & 0x001fc000) -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_GAIN_FORCE_MSB 21 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_GAIN_FORCE_LSB 21 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_GAIN_FORCE_MASK 0x00200000 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_GAIN_FORCE_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_GAIN_FORCE_SET(x) (((x) << 21) & 0x00200000) -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_ENABLE_SHARED_RX_MSB 31 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_ENABLE_SHARED_RX_LSB 31 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_ENABLE_SHARED_RX_MASK 0x80000000 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_ENABLE_SHARED_RX_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B0_ENABLE_SHARED_RX_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_gains_min_offsets_b0 */ -#define PHY_BB_GAINS_MIN_OFFSETS_B0_ADDRESS 0x0000984c -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSET 0x0000984c -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSETC1_MSB 6 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSETC1_LSB 0 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSETC1_MASK 0x0000007f -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSETC1_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSETC1_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSETC2_MSB 11 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSETC2_LSB 7 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSETC2_MASK 0x00000f80 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSETC2_GET(x) (((x) & 0x00000f80) >> 7) -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSETC2_SET(x) (((x) << 7) & 0x00000f80) -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSETC3_MSB 16 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSETC3_LSB 12 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSETC3_MASK 0x0001f000 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSETC3_GET(x) (((x) & 0x0001f000) >> 12) -#define PHY_BB_GAINS_MIN_OFFSETS_B0_OFFSETC3_SET(x) (((x) << 12) & 0x0001f000) -#define PHY_BB_GAINS_MIN_OFFSETS_B0_RF_GAIN_F_0_MSB 24 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_RF_GAIN_F_0_LSB 17 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_RF_GAIN_F_0_MASK 0x01fe0000 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_RF_GAIN_F_0_GET(x) (((x) & 0x01fe0000) >> 17) -#define PHY_BB_GAINS_MIN_OFFSETS_B0_RF_GAIN_F_0_SET(x) (((x) << 17) & 0x01fe0000) -#define PHY_BB_GAINS_MIN_OFFSETS_B0_XATTEN1_SW_F_0_MSB 25 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_XATTEN1_SW_F_0_LSB 25 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_XATTEN1_SW_F_0_MASK 0x02000000 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_XATTEN1_SW_F_0_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_BB_GAINS_MIN_OFFSETS_B0_XATTEN1_SW_F_0_SET(x) (((x) << 25) & 0x02000000) -#define PHY_BB_GAINS_MIN_OFFSETS_B0_XATTEN2_SW_F_0_MSB 26 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_XATTEN2_SW_F_0_LSB 26 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_XATTEN2_SW_F_0_MASK 0x04000000 -#define PHY_BB_GAINS_MIN_OFFSETS_B0_XATTEN2_SW_F_0_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_BB_GAINS_MIN_OFFSETS_B0_XATTEN2_SW_F_0_SET(x) (((x) << 26) & 0x04000000) - -/* macros for BB_desired_sigsize */ -#define PHY_BB_DESIRED_SIGSIZE_ADDRESS 0x00009850 -#define PHY_BB_DESIRED_SIGSIZE_OFFSET 0x00009850 -#define PHY_BB_DESIRED_SIGSIZE_ADC_DESIRED_SIZE_MSB 7 -#define PHY_BB_DESIRED_SIGSIZE_ADC_DESIRED_SIZE_LSB 0 -#define PHY_BB_DESIRED_SIGSIZE_ADC_DESIRED_SIZE_MASK 0x000000ff -#define PHY_BB_DESIRED_SIGSIZE_ADC_DESIRED_SIZE_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_DESIRED_SIGSIZE_ADC_DESIRED_SIZE_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_DESIRED_SIGSIZE_TOTAL_DESIRED_MSB 27 -#define PHY_BB_DESIRED_SIGSIZE_TOTAL_DESIRED_LSB 20 -#define PHY_BB_DESIRED_SIGSIZE_TOTAL_DESIRED_MASK 0x0ff00000 -#define PHY_BB_DESIRED_SIGSIZE_TOTAL_DESIRED_GET(x) (((x) & 0x0ff00000) >> 20) -#define PHY_BB_DESIRED_SIGSIZE_TOTAL_DESIRED_SET(x) (((x) << 20) & 0x0ff00000) -#define PHY_BB_DESIRED_SIGSIZE_INIT_GC_COUNT_MAX_MSB 29 -#define PHY_BB_DESIRED_SIGSIZE_INIT_GC_COUNT_MAX_LSB 28 -#define PHY_BB_DESIRED_SIGSIZE_INIT_GC_COUNT_MAX_MASK 0x30000000 -#define PHY_BB_DESIRED_SIGSIZE_INIT_GC_COUNT_MAX_GET(x) (((x) & 0x30000000) >> 28) -#define PHY_BB_DESIRED_SIGSIZE_INIT_GC_COUNT_MAX_SET(x) (((x) << 28) & 0x30000000) -#define PHY_BB_DESIRED_SIGSIZE_REDUCE_INIT_GC_COUNT_MSB 30 -#define PHY_BB_DESIRED_SIGSIZE_REDUCE_INIT_GC_COUNT_LSB 30 -#define PHY_BB_DESIRED_SIGSIZE_REDUCE_INIT_GC_COUNT_MASK 0x40000000 -#define PHY_BB_DESIRED_SIGSIZE_REDUCE_INIT_GC_COUNT_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_BB_DESIRED_SIGSIZE_REDUCE_INIT_GC_COUNT_SET(x) (((x) << 30) & 0x40000000) -#define PHY_BB_DESIRED_SIGSIZE_ENA_INIT_GAIN_MSB 31 -#define PHY_BB_DESIRED_SIGSIZE_ENA_INIT_GAIN_LSB 31 -#define PHY_BB_DESIRED_SIGSIZE_ENA_INIT_GAIN_MASK 0x80000000 -#define PHY_BB_DESIRED_SIGSIZE_ENA_INIT_GAIN_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_DESIRED_SIGSIZE_ENA_INIT_GAIN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_timing_control_3a */ -#define PHY_BB_TIMING_CONTROL_3A_ADDRESS 0x00009854 -#define PHY_BB_TIMING_CONTROL_3A_OFFSET 0x00009854 -#define PHY_BB_TIMING_CONTROL_3A_STE_THR_HI_RSSI_MSB 6 -#define PHY_BB_TIMING_CONTROL_3A_STE_THR_HI_RSSI_LSB 0 -#define PHY_BB_TIMING_CONTROL_3A_STE_THR_HI_RSSI_MASK 0x0000007f -#define PHY_BB_TIMING_CONTROL_3A_STE_THR_HI_RSSI_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_BB_TIMING_CONTROL_3A_STE_THR_HI_RSSI_SET(x) (((x) << 0) & 0x0000007f) - -/* macros for BB_find_signal */ -#define PHY_BB_FIND_SIGNAL_ADDRESS 0x00009858 -#define PHY_BB_FIND_SIGNAL_OFFSET 0x00009858 -#define PHY_BB_FIND_SIGNAL_RELSTEP_MSB 5 -#define PHY_BB_FIND_SIGNAL_RELSTEP_LSB 0 -#define PHY_BB_FIND_SIGNAL_RELSTEP_MASK 0x0000003f -#define PHY_BB_FIND_SIGNAL_RELSTEP_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_FIND_SIGNAL_RELSTEP_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_FIND_SIGNAL_RELPWR_MSB 11 -#define PHY_BB_FIND_SIGNAL_RELPWR_LSB 6 -#define PHY_BB_FIND_SIGNAL_RELPWR_MASK 0x00000fc0 -#define PHY_BB_FIND_SIGNAL_RELPWR_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_FIND_SIGNAL_RELPWR_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_FIND_SIGNAL_FIRSTEP_MSB 17 -#define PHY_BB_FIND_SIGNAL_FIRSTEP_LSB 12 -#define PHY_BB_FIND_SIGNAL_FIRSTEP_MASK 0x0003f000 -#define PHY_BB_FIND_SIGNAL_FIRSTEP_GET(x) (((x) & 0x0003f000) >> 12) -#define PHY_BB_FIND_SIGNAL_FIRSTEP_SET(x) (((x) << 12) & 0x0003f000) -#define PHY_BB_FIND_SIGNAL_FIRPWR_MSB 25 -#define PHY_BB_FIND_SIGNAL_FIRPWR_LSB 18 -#define PHY_BB_FIND_SIGNAL_FIRPWR_MASK 0x03fc0000 -#define PHY_BB_FIND_SIGNAL_FIRPWR_GET(x) (((x) & 0x03fc0000) >> 18) -#define PHY_BB_FIND_SIGNAL_FIRPWR_SET(x) (((x) << 18) & 0x03fc0000) -#define PHY_BB_FIND_SIGNAL_M1COUNT_MAX_MSB 31 -#define PHY_BB_FIND_SIGNAL_M1COUNT_MAX_LSB 26 -#define PHY_BB_FIND_SIGNAL_M1COUNT_MAX_MASK 0xfc000000 -#define PHY_BB_FIND_SIGNAL_M1COUNT_MAX_GET(x) (((x) & 0xfc000000) >> 26) -#define PHY_BB_FIND_SIGNAL_M1COUNT_MAX_SET(x) (((x) << 26) & 0xfc000000) - -/* macros for BB_agc */ -#define PHY_BB_AGC_ADDRESS 0x0000985c -#define PHY_BB_AGC_OFFSET 0x0000985c -#define PHY_BB_AGC_COARSEPWR_CONST_MSB 6 -#define PHY_BB_AGC_COARSEPWR_CONST_LSB 0 -#define PHY_BB_AGC_COARSEPWR_CONST_MASK 0x0000007f -#define PHY_BB_AGC_COARSEPWR_CONST_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_BB_AGC_COARSEPWR_CONST_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_BB_AGC_COARSE_LOW_MSB 14 -#define PHY_BB_AGC_COARSE_LOW_LSB 7 -#define PHY_BB_AGC_COARSE_LOW_MASK 0x00007f80 -#define PHY_BB_AGC_COARSE_LOW_GET(x) (((x) & 0x00007f80) >> 7) -#define PHY_BB_AGC_COARSE_LOW_SET(x) (((x) << 7) & 0x00007f80) -#define PHY_BB_AGC_COARSE_HIGH_MSB 21 -#define PHY_BB_AGC_COARSE_HIGH_LSB 15 -#define PHY_BB_AGC_COARSE_HIGH_MASK 0x003f8000 -#define PHY_BB_AGC_COARSE_HIGH_GET(x) (((x) & 0x003f8000) >> 15) -#define PHY_BB_AGC_COARSE_HIGH_SET(x) (((x) << 15) & 0x003f8000) -#define PHY_BB_AGC_QUICK_DROP_MSB 29 -#define PHY_BB_AGC_QUICK_DROP_LSB 22 -#define PHY_BB_AGC_QUICK_DROP_MASK 0x3fc00000 -#define PHY_BB_AGC_QUICK_DROP_GET(x) (((x) & 0x3fc00000) >> 22) -#define PHY_BB_AGC_QUICK_DROP_SET(x) (((x) << 22) & 0x3fc00000) -#define PHY_BB_AGC_RSSI_OUT_SELECT_MSB 31 -#define PHY_BB_AGC_RSSI_OUT_SELECT_LSB 30 -#define PHY_BB_AGC_RSSI_OUT_SELECT_MASK 0xc0000000 -#define PHY_BB_AGC_RSSI_OUT_SELECT_GET(x) (((x) & 0xc0000000) >> 30) -#define PHY_BB_AGC_RSSI_OUT_SELECT_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for BB_agc_control */ -#define PHY_BB_AGC_CONTROL_ADDRESS 0x00009860 -#define PHY_BB_AGC_CONTROL_OFFSET 0x00009860 -#define PHY_BB_AGC_CONTROL_DO_CALIBRATE_MSB 0 -#define PHY_BB_AGC_CONTROL_DO_CALIBRATE_LSB 0 -#define PHY_BB_AGC_CONTROL_DO_CALIBRATE_MASK 0x00000001 -#define PHY_BB_AGC_CONTROL_DO_CALIBRATE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_AGC_CONTROL_DO_CALIBRATE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_AGC_CONTROL_DO_NOISEFLOOR_MSB 1 -#define PHY_BB_AGC_CONTROL_DO_NOISEFLOOR_LSB 1 -#define PHY_BB_AGC_CONTROL_DO_NOISEFLOOR_MASK 0x00000002 -#define PHY_BB_AGC_CONTROL_DO_NOISEFLOOR_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_AGC_CONTROL_DO_NOISEFLOOR_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_AGC_CONTROL_MIN_NUM_GAIN_CHANGE_MSB 5 -#define PHY_BB_AGC_CONTROL_MIN_NUM_GAIN_CHANGE_LSB 3 -#define PHY_BB_AGC_CONTROL_MIN_NUM_GAIN_CHANGE_MASK 0x00000038 -#define PHY_BB_AGC_CONTROL_MIN_NUM_GAIN_CHANGE_GET(x) (((x) & 0x00000038) >> 3) -#define PHY_BB_AGC_CONTROL_MIN_NUM_GAIN_CHANGE_SET(x) (((x) << 3) & 0x00000038) -#define PHY_BB_AGC_CONTROL_YCOK_MAX_MSB 9 -#define PHY_BB_AGC_CONTROL_YCOK_MAX_LSB 6 -#define PHY_BB_AGC_CONTROL_YCOK_MAX_MASK 0x000003c0 -#define PHY_BB_AGC_CONTROL_YCOK_MAX_GET(x) (((x) & 0x000003c0) >> 6) -#define PHY_BB_AGC_CONTROL_YCOK_MAX_SET(x) (((x) << 6) & 0x000003c0) -#define PHY_BB_AGC_CONTROL_LEAKY_BUCKET_ENABLE_MSB 10 -#define PHY_BB_AGC_CONTROL_LEAKY_BUCKET_ENABLE_LSB 10 -#define PHY_BB_AGC_CONTROL_LEAKY_BUCKET_ENABLE_MASK 0x00000400 -#define PHY_BB_AGC_CONTROL_LEAKY_BUCKET_ENABLE_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_BB_AGC_CONTROL_LEAKY_BUCKET_ENABLE_SET(x) (((x) << 10) & 0x00000400) -#define PHY_BB_AGC_CONTROL_CAL_ENABLE_MSB 11 -#define PHY_BB_AGC_CONTROL_CAL_ENABLE_LSB 11 -#define PHY_BB_AGC_CONTROL_CAL_ENABLE_MASK 0x00000800 -#define PHY_BB_AGC_CONTROL_CAL_ENABLE_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_BB_AGC_CONTROL_CAL_ENABLE_SET(x) (((x) << 11) & 0x00000800) -#define PHY_BB_AGC_CONTROL_USE_TABLE_SEED_MSB 12 -#define PHY_BB_AGC_CONTROL_USE_TABLE_SEED_LSB 12 -#define PHY_BB_AGC_CONTROL_USE_TABLE_SEED_MASK 0x00001000 -#define PHY_BB_AGC_CONTROL_USE_TABLE_SEED_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_BB_AGC_CONTROL_USE_TABLE_SEED_SET(x) (((x) << 12) & 0x00001000) -#define PHY_BB_AGC_CONTROL_AGC_UPDATE_TABLE_SEED_MSB 13 -#define PHY_BB_AGC_CONTROL_AGC_UPDATE_TABLE_SEED_LSB 13 -#define PHY_BB_AGC_CONTROL_AGC_UPDATE_TABLE_SEED_MASK 0x00002000 -#define PHY_BB_AGC_CONTROL_AGC_UPDATE_TABLE_SEED_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_BB_AGC_CONTROL_AGC_UPDATE_TABLE_SEED_SET(x) (((x) << 13) & 0x00002000) -#define PHY_BB_AGC_CONTROL_ENABLE_NOISEFLOOR_MSB 15 -#define PHY_BB_AGC_CONTROL_ENABLE_NOISEFLOOR_LSB 15 -#define PHY_BB_AGC_CONTROL_ENABLE_NOISEFLOOR_MASK 0x00008000 -#define PHY_BB_AGC_CONTROL_ENABLE_NOISEFLOOR_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_BB_AGC_CONTROL_ENABLE_NOISEFLOOR_SET(x) (((x) << 15) & 0x00008000) -#define PHY_BB_AGC_CONTROL_ENABLE_FLTR_CAL_MSB 16 -#define PHY_BB_AGC_CONTROL_ENABLE_FLTR_CAL_LSB 16 -#define PHY_BB_AGC_CONTROL_ENABLE_FLTR_CAL_MASK 0x00010000 -#define PHY_BB_AGC_CONTROL_ENABLE_FLTR_CAL_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_BB_AGC_CONTROL_ENABLE_FLTR_CAL_SET(x) (((x) << 16) & 0x00010000) -#define PHY_BB_AGC_CONTROL_NO_UPDATE_NOISEFLOOR_MSB 17 -#define PHY_BB_AGC_CONTROL_NO_UPDATE_NOISEFLOOR_LSB 17 -#define PHY_BB_AGC_CONTROL_NO_UPDATE_NOISEFLOOR_MASK 0x00020000 -#define PHY_BB_AGC_CONTROL_NO_UPDATE_NOISEFLOOR_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_BB_AGC_CONTROL_NO_UPDATE_NOISEFLOOR_SET(x) (((x) << 17) & 0x00020000) -#define PHY_BB_AGC_CONTROL_EXTEND_NF_PWR_MEAS_MSB 18 -#define PHY_BB_AGC_CONTROL_EXTEND_NF_PWR_MEAS_LSB 18 -#define PHY_BB_AGC_CONTROL_EXTEND_NF_PWR_MEAS_MASK 0x00040000 -#define PHY_BB_AGC_CONTROL_EXTEND_NF_PWR_MEAS_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_BB_AGC_CONTROL_EXTEND_NF_PWR_MEAS_SET(x) (((x) << 18) & 0x00040000) -#define PHY_BB_AGC_CONTROL_CLC_SUCCESS_MSB 19 -#define PHY_BB_AGC_CONTROL_CLC_SUCCESS_LSB 19 -#define PHY_BB_AGC_CONTROL_CLC_SUCCESS_MASK 0x00080000 -#define PHY_BB_AGC_CONTROL_CLC_SUCCESS_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_BB_AGC_CONTROL_ENABLE_PKDET_CAL_MSB 20 -#define PHY_BB_AGC_CONTROL_ENABLE_PKDET_CAL_LSB 20 -#define PHY_BB_AGC_CONTROL_ENABLE_PKDET_CAL_MASK 0x00100000 -#define PHY_BB_AGC_CONTROL_ENABLE_PKDET_CAL_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_BB_AGC_CONTROL_ENABLE_PKDET_CAL_SET(x) (((x) << 20) & 0x00100000) - -/* macros for BB_cca_b0 */ -#define PHY_BB_CCA_B0_ADDRESS 0x00009864 -#define PHY_BB_CCA_B0_OFFSET 0x00009864 -#define PHY_BB_CCA_B0_CF_MAXCCAPWR_0_MSB 8 -#define PHY_BB_CCA_B0_CF_MAXCCAPWR_0_LSB 0 -#define PHY_BB_CCA_B0_CF_MAXCCAPWR_0_MASK 0x000001ff -#define PHY_BB_CCA_B0_CF_MAXCCAPWR_0_GET(x) (((x) & 0x000001ff) >> 0) -#define PHY_BB_CCA_B0_CF_MAXCCAPWR_0_SET(x) (((x) << 0) & 0x000001ff) -#define PHY_BB_CCA_B0_CF_CCA_COUNT_MAXC_MSB 11 -#define PHY_BB_CCA_B0_CF_CCA_COUNT_MAXC_LSB 9 -#define PHY_BB_CCA_B0_CF_CCA_COUNT_MAXC_MASK 0x00000e00 -#define PHY_BB_CCA_B0_CF_CCA_COUNT_MAXC_GET(x) (((x) & 0x00000e00) >> 9) -#define PHY_BB_CCA_B0_CF_CCA_COUNT_MAXC_SET(x) (((x) << 9) & 0x00000e00) -#define PHY_BB_CCA_B0_CF_THRESH62_MSB 19 -#define PHY_BB_CCA_B0_CF_THRESH62_LSB 12 -#define PHY_BB_CCA_B0_CF_THRESH62_MASK 0x000ff000 -#define PHY_BB_CCA_B0_CF_THRESH62_GET(x) (((x) & 0x000ff000) >> 12) -#define PHY_BB_CCA_B0_CF_THRESH62_SET(x) (((x) << 12) & 0x000ff000) -#define PHY_BB_CCA_B0_MINCCAPWR_0_MSB 28 -#define PHY_BB_CCA_B0_MINCCAPWR_0_LSB 20 -#define PHY_BB_CCA_B0_MINCCAPWR_0_MASK 0x1ff00000 -#define PHY_BB_CCA_B0_MINCCAPWR_0_GET(x) (((x) & 0x1ff00000) >> 20) - -/* macros for BB_sfcorr */ -#define PHY_BB_SFCORR_ADDRESS 0x00009868 -#define PHY_BB_SFCORR_OFFSET 0x00009868 -#define PHY_BB_SFCORR_M2COUNT_THR_MSB 4 -#define PHY_BB_SFCORR_M2COUNT_THR_LSB 0 -#define PHY_BB_SFCORR_M2COUNT_THR_MASK 0x0000001f -#define PHY_BB_SFCORR_M2COUNT_THR_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_SFCORR_M2COUNT_THR_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_SFCORR_ADCSAT_THRESH_MSB 10 -#define PHY_BB_SFCORR_ADCSAT_THRESH_LSB 5 -#define PHY_BB_SFCORR_ADCSAT_THRESH_MASK 0x000007e0 -#define PHY_BB_SFCORR_ADCSAT_THRESH_GET(x) (((x) & 0x000007e0) >> 5) -#define PHY_BB_SFCORR_ADCSAT_THRESH_SET(x) (((x) << 5) & 0x000007e0) -#define PHY_BB_SFCORR_ADCSAT_ICOUNT_MSB 16 -#define PHY_BB_SFCORR_ADCSAT_ICOUNT_LSB 11 -#define PHY_BB_SFCORR_ADCSAT_ICOUNT_MASK 0x0001f800 -#define PHY_BB_SFCORR_ADCSAT_ICOUNT_GET(x) (((x) & 0x0001f800) >> 11) -#define PHY_BB_SFCORR_ADCSAT_ICOUNT_SET(x) (((x) << 11) & 0x0001f800) -#define PHY_BB_SFCORR_M1_THRES_MSB 23 -#define PHY_BB_SFCORR_M1_THRES_LSB 17 -#define PHY_BB_SFCORR_M1_THRES_MASK 0x00fe0000 -#define PHY_BB_SFCORR_M1_THRES_GET(x) (((x) & 0x00fe0000) >> 17) -#define PHY_BB_SFCORR_M1_THRES_SET(x) (((x) << 17) & 0x00fe0000) -#define PHY_BB_SFCORR_M2_THRES_MSB 30 -#define PHY_BB_SFCORR_M2_THRES_LSB 24 -#define PHY_BB_SFCORR_M2_THRES_MASK 0x7f000000 -#define PHY_BB_SFCORR_M2_THRES_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_BB_SFCORR_M2_THRES_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for BB_self_corr_low */ -#define PHY_BB_SELF_CORR_LOW_ADDRESS 0x0000986c -#define PHY_BB_SELF_CORR_LOW_OFFSET 0x0000986c -#define PHY_BB_SELF_CORR_LOW_USE_SELF_CORR_LOW_MSB 0 -#define PHY_BB_SELF_CORR_LOW_USE_SELF_CORR_LOW_LSB 0 -#define PHY_BB_SELF_CORR_LOW_USE_SELF_CORR_LOW_MASK 0x00000001 -#define PHY_BB_SELF_CORR_LOW_USE_SELF_CORR_LOW_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_SELF_CORR_LOW_USE_SELF_CORR_LOW_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_SELF_CORR_LOW_M1COUNT_MAX_LOW_MSB 7 -#define PHY_BB_SELF_CORR_LOW_M1COUNT_MAX_LOW_LSB 1 -#define PHY_BB_SELF_CORR_LOW_M1COUNT_MAX_LOW_MASK 0x000000fe -#define PHY_BB_SELF_CORR_LOW_M1COUNT_MAX_LOW_GET(x) (((x) & 0x000000fe) >> 1) -#define PHY_BB_SELF_CORR_LOW_M1COUNT_MAX_LOW_SET(x) (((x) << 1) & 0x000000fe) -#define PHY_BB_SELF_CORR_LOW_M2COUNT_THR_LOW_MSB 13 -#define PHY_BB_SELF_CORR_LOW_M2COUNT_THR_LOW_LSB 8 -#define PHY_BB_SELF_CORR_LOW_M2COUNT_THR_LOW_MASK 0x00003f00 -#define PHY_BB_SELF_CORR_LOW_M2COUNT_THR_LOW_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_BB_SELF_CORR_LOW_M2COUNT_THR_LOW_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_BB_SELF_CORR_LOW_M1_THRESH_LOW_MSB 20 -#define PHY_BB_SELF_CORR_LOW_M1_THRESH_LOW_LSB 14 -#define PHY_BB_SELF_CORR_LOW_M1_THRESH_LOW_MASK 0x001fc000 -#define PHY_BB_SELF_CORR_LOW_M1_THRESH_LOW_GET(x) (((x) & 0x001fc000) >> 14) -#define PHY_BB_SELF_CORR_LOW_M1_THRESH_LOW_SET(x) (((x) << 14) & 0x001fc000) -#define PHY_BB_SELF_CORR_LOW_M2_THRESH_LOW_MSB 27 -#define PHY_BB_SELF_CORR_LOW_M2_THRESH_LOW_LSB 21 -#define PHY_BB_SELF_CORR_LOW_M2_THRESH_LOW_MASK 0x0fe00000 -#define PHY_BB_SELF_CORR_LOW_M2_THRESH_LOW_GET(x) (((x) & 0x0fe00000) >> 21) -#define PHY_BB_SELF_CORR_LOW_M2_THRESH_LOW_SET(x) (((x) << 21) & 0x0fe00000) - -/* macros for BB_synth_control */ -#define PHY_BB_SYNTH_CONTROL_ADDRESS 0x00009874 -#define PHY_BB_SYNTH_CONTROL_OFFSET 0x00009874 -#define PHY_BB_SYNTH_CONTROL_RFCHANFRAC_MSB 16 -#define PHY_BB_SYNTH_CONTROL_RFCHANFRAC_LSB 0 -#define PHY_BB_SYNTH_CONTROL_RFCHANFRAC_MASK 0x0001ffff -#define PHY_BB_SYNTH_CONTROL_RFCHANFRAC_GET(x) (((x) & 0x0001ffff) >> 0) -#define PHY_BB_SYNTH_CONTROL_RFCHANFRAC_SET(x) (((x) << 0) & 0x0001ffff) -#define PHY_BB_SYNTH_CONTROL_RFCHANNEL_MSB 25 -#define PHY_BB_SYNTH_CONTROL_RFCHANNEL_LSB 17 -#define PHY_BB_SYNTH_CONTROL_RFCHANNEL_MASK 0x03fe0000 -#define PHY_BB_SYNTH_CONTROL_RFCHANNEL_GET(x) (((x) & 0x03fe0000) >> 17) -#define PHY_BB_SYNTH_CONTROL_RFCHANNEL_SET(x) (((x) << 17) & 0x03fe0000) -#define PHY_BB_SYNTH_CONTROL_RFAMODEREFSEL_MSB 27 -#define PHY_BB_SYNTH_CONTROL_RFAMODEREFSEL_LSB 26 -#define PHY_BB_SYNTH_CONTROL_RFAMODEREFSEL_MASK 0x0c000000 -#define PHY_BB_SYNTH_CONTROL_RFAMODEREFSEL_GET(x) (((x) & 0x0c000000) >> 26) -#define PHY_BB_SYNTH_CONTROL_RFAMODEREFSEL_SET(x) (((x) << 26) & 0x0c000000) -#define PHY_BB_SYNTH_CONTROL_RFFRACMODE_MSB 28 -#define PHY_BB_SYNTH_CONTROL_RFFRACMODE_LSB 28 -#define PHY_BB_SYNTH_CONTROL_RFFRACMODE_MASK 0x10000000 -#define PHY_BB_SYNTH_CONTROL_RFFRACMODE_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_BB_SYNTH_CONTROL_RFFRACMODE_SET(x) (((x) << 28) & 0x10000000) -#define PHY_BB_SYNTH_CONTROL_RFBMODE_MSB 29 -#define PHY_BB_SYNTH_CONTROL_RFBMODE_LSB 29 -#define PHY_BB_SYNTH_CONTROL_RFBMODE_MASK 0x20000000 -#define PHY_BB_SYNTH_CONTROL_RFBMODE_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_BB_SYNTH_CONTROL_RFBMODE_SET(x) (((x) << 29) & 0x20000000) -#define PHY_BB_SYNTH_CONTROL_RFSYNTH_CTRL_SSHIFT_MSB 30 -#define PHY_BB_SYNTH_CONTROL_RFSYNTH_CTRL_SSHIFT_LSB 30 -#define PHY_BB_SYNTH_CONTROL_RFSYNTH_CTRL_SSHIFT_MASK 0x40000000 -#define PHY_BB_SYNTH_CONTROL_RFSYNTH_CTRL_SSHIFT_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_BB_SYNTH_CONTROL_RFSYNTH_CTRL_SSHIFT_SET(x) (((x) << 30) & 0x40000000) - -/* macros for BB_addac_clk_select */ -#define PHY_BB_ADDAC_CLK_SELECT_ADDRESS 0x00009878 -#define PHY_BB_ADDAC_CLK_SELECT_OFFSET 0x00009878 -#define PHY_BB_ADDAC_CLK_SELECT_BB_DAC_CLK_SELECT_MSB 3 -#define PHY_BB_ADDAC_CLK_SELECT_BB_DAC_CLK_SELECT_LSB 2 -#define PHY_BB_ADDAC_CLK_SELECT_BB_DAC_CLK_SELECT_MASK 0x0000000c -#define PHY_BB_ADDAC_CLK_SELECT_BB_DAC_CLK_SELECT_GET(x) (((x) & 0x0000000c) >> 2) -#define PHY_BB_ADDAC_CLK_SELECT_BB_DAC_CLK_SELECT_SET(x) (((x) << 2) & 0x0000000c) -#define PHY_BB_ADDAC_CLK_SELECT_BB_ADC_CLK_SELECT_MSB 5 -#define PHY_BB_ADDAC_CLK_SELECT_BB_ADC_CLK_SELECT_LSB 4 -#define PHY_BB_ADDAC_CLK_SELECT_BB_ADC_CLK_SELECT_MASK 0x00000030 -#define PHY_BB_ADDAC_CLK_SELECT_BB_ADC_CLK_SELECT_GET(x) (((x) & 0x00000030) >> 4) -#define PHY_BB_ADDAC_CLK_SELECT_BB_ADC_CLK_SELECT_SET(x) (((x) << 4) & 0x00000030) - -/* macros for BB_pll_cntl */ -#define PHY_BB_PLL_CNTL_ADDRESS 0x0000987c -#define PHY_BB_PLL_CNTL_OFFSET 0x0000987c -#define PHY_BB_PLL_CNTL_BB_PLL_DIV_MSB 9 -#define PHY_BB_PLL_CNTL_BB_PLL_DIV_LSB 0 -#define PHY_BB_PLL_CNTL_BB_PLL_DIV_MASK 0x000003ff -#define PHY_BB_PLL_CNTL_BB_PLL_DIV_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_BB_PLL_CNTL_BB_PLL_DIV_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_BB_PLL_CNTL_BB_PLL_REFDIV_MSB 13 -#define PHY_BB_PLL_CNTL_BB_PLL_REFDIV_LSB 10 -#define PHY_BB_PLL_CNTL_BB_PLL_REFDIV_MASK 0x00003c00 -#define PHY_BB_PLL_CNTL_BB_PLL_REFDIV_GET(x) (((x) & 0x00003c00) >> 10) -#define PHY_BB_PLL_CNTL_BB_PLL_REFDIV_SET(x) (((x) << 10) & 0x00003c00) -#define PHY_BB_PLL_CNTL_BB_PLL_CLK_SEL_MSB 15 -#define PHY_BB_PLL_CNTL_BB_PLL_CLK_SEL_LSB 14 -#define PHY_BB_PLL_CNTL_BB_PLL_CLK_SEL_MASK 0x0000c000 -#define PHY_BB_PLL_CNTL_BB_PLL_CLK_SEL_GET(x) (((x) & 0x0000c000) >> 14) -#define PHY_BB_PLL_CNTL_BB_PLL_CLK_SEL_SET(x) (((x) << 14) & 0x0000c000) -#define PHY_BB_PLL_CNTL_BB_PLLBYPASS_MSB 16 -#define PHY_BB_PLL_CNTL_BB_PLLBYPASS_LSB 16 -#define PHY_BB_PLL_CNTL_BB_PLLBYPASS_MASK 0x00010000 -#define PHY_BB_PLL_CNTL_BB_PLLBYPASS_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_BB_PLL_CNTL_BB_PLLBYPASS_SET(x) (((x) << 16) & 0x00010000) -#define PHY_BB_PLL_CNTL_BB_PLL_SETTLE_TIME_MSB 27 -#define PHY_BB_PLL_CNTL_BB_PLL_SETTLE_TIME_LSB 17 -#define PHY_BB_PLL_CNTL_BB_PLL_SETTLE_TIME_MASK 0x0ffe0000 -#define PHY_BB_PLL_CNTL_BB_PLL_SETTLE_TIME_GET(x) (((x) & 0x0ffe0000) >> 17) -#define PHY_BB_PLL_CNTL_BB_PLL_SETTLE_TIME_SET(x) (((x) << 17) & 0x0ffe0000) - -/* macros for BB_vit_spur_mask_A */ -#define PHY_BB_VIT_SPUR_MASK_A_ADDRESS 0x00009900 -#define PHY_BB_VIT_SPUR_MASK_A_OFFSET 0x00009900 -#define PHY_BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_A_MSB 9 -#define PHY_BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_A_LSB 0 -#define PHY_BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_A_MASK 0x000003ff -#define PHY_BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_A_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_A_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_IDX_A_MSB 16 -#define PHY_BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_IDX_A_LSB 10 -#define PHY_BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_IDX_A_MASK 0x0001fc00 -#define PHY_BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_IDX_A_GET(x) (((x) & 0x0001fc00) >> 10) -#define PHY_BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_IDX_A_SET(x) (((x) << 10) & 0x0001fc00) - -/* macros for BB_vit_spur_mask_B */ -#define PHY_BB_VIT_SPUR_MASK_B_ADDRESS 0x00009904 -#define PHY_BB_VIT_SPUR_MASK_B_OFFSET 0x00009904 -#define PHY_BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_B_MSB 9 -#define PHY_BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_B_LSB 0 -#define PHY_BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_B_MASK 0x000003ff -#define PHY_BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_B_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_B_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_IDX_B_MSB 16 -#define PHY_BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_IDX_B_LSB 10 -#define PHY_BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_IDX_B_MASK 0x0001fc00 -#define PHY_BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_IDX_B_GET(x) (((x) & 0x0001fc00) >> 10) -#define PHY_BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_IDX_B_SET(x) (((x) << 10) & 0x0001fc00) - -/* macros for BB_pilot_spur_mask */ -#define PHY_BB_PILOT_SPUR_MASK_ADDRESS 0x00009908 -#define PHY_BB_PILOT_SPUR_MASK_OFFSET 0x00009908 -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_A_MSB 4 -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_A_LSB 0 -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_A_MASK 0x0000001f -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_A_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_A_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A_MSB 11 -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A_LSB 5 -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A_MASK 0x00000fe0 -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A_GET(x) (((x) & 0x00000fe0) >> 5) -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A_SET(x) (((x) << 5) & 0x00000fe0) -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_B_MSB 16 -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_B_LSB 12 -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_B_MASK 0x0001f000 -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_B_GET(x) (((x) & 0x0001f000) >> 12) -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_B_SET(x) (((x) << 12) & 0x0001f000) -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_B_MSB 23 -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_B_LSB 17 -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_B_MASK 0x00fe0000 -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_B_GET(x) (((x) & 0x00fe0000) >> 17) -#define PHY_BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_B_SET(x) (((x) << 17) & 0x00fe0000) - -/* macros for BB_chan_spur_mask */ -#define PHY_BB_CHAN_SPUR_MASK_ADDRESS 0x0000990c -#define PHY_BB_CHAN_SPUR_MASK_OFFSET 0x0000990c -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_A_MSB 4 -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_A_LSB 0 -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_A_MASK 0x0000001f -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_A_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_A_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A_MSB 11 -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A_LSB 5 -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A_MASK 0x00000fe0 -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A_GET(x) (((x) & 0x00000fe0) >> 5) -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A_SET(x) (((x) << 5) & 0x00000fe0) -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_B_MSB 16 -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_B_LSB 12 -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_B_MASK 0x0001f000 -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_B_GET(x) (((x) & 0x0001f000) >> 12) -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_B_SET(x) (((x) << 12) & 0x0001f000) -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_B_MSB 23 -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_B_LSB 17 -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_B_MASK 0x00fe0000 -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_B_GET(x) (((x) & 0x00fe0000) >> 17) -#define PHY_BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_B_SET(x) (((x) << 17) & 0x00fe0000) - -/* macros for BB_spectral_scan */ -#define PHY_BB_SPECTRAL_SCAN_ADDRESS 0x00009910 -#define PHY_BB_SPECTRAL_SCAN_OFFSET 0x00009910 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ENA_MSB 0 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ENA_LSB 0 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ENA_MASK 0x00000001 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ENA_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ENA_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ACTIVE_MSB 1 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ACTIVE_LSB 1 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ACTIVE_MASK 0x00000002 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ACTIVE_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ACTIVE_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_SPECTRAL_SCAN_DISABLE_RADAR_TCTL_RST_MSB 2 -#define PHY_BB_SPECTRAL_SCAN_DISABLE_RADAR_TCTL_RST_LSB 2 -#define PHY_BB_SPECTRAL_SCAN_DISABLE_RADAR_TCTL_RST_MASK 0x00000004 -#define PHY_BB_SPECTRAL_SCAN_DISABLE_RADAR_TCTL_RST_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_BB_SPECTRAL_SCAN_DISABLE_RADAR_TCTL_RST_SET(x) (((x) << 2) & 0x00000004) -#define PHY_BB_SPECTRAL_SCAN_DISABLE_PULSE_COARSE_LOW_MSB 3 -#define PHY_BB_SPECTRAL_SCAN_DISABLE_PULSE_COARSE_LOW_LSB 3 -#define PHY_BB_SPECTRAL_SCAN_DISABLE_PULSE_COARSE_LOW_MASK 0x00000008 -#define PHY_BB_SPECTRAL_SCAN_DISABLE_PULSE_COARSE_LOW_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_BB_SPECTRAL_SCAN_DISABLE_PULSE_COARSE_LOW_SET(x) (((x) << 3) & 0x00000008) -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_FFT_PERIOD_MSB 7 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_FFT_PERIOD_LSB 4 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_FFT_PERIOD_MASK 0x000000f0 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_FFT_PERIOD_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_FFT_PERIOD_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PERIOD_MSB 15 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PERIOD_LSB 8 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PERIOD_MASK 0x0000ff00 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PERIOD_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PERIOD_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_COUNT_MSB 27 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_COUNT_LSB 16 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_COUNT_MASK 0x0fff0000 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_COUNT_GET(x) (((x) & 0x0fff0000) >> 16) -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_COUNT_SET(x) (((x) << 16) & 0x0fff0000) -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_SHORT_RPT_MSB 28 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_SHORT_RPT_LSB 28 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_SHORT_RPT_MASK 0x10000000 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_SHORT_RPT_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_SHORT_RPT_SET(x) (((x) << 28) & 0x10000000) -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PRIORITY_MSB 29 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PRIORITY_LSB 29 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PRIORITY_MASK 0x20000000 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PRIORITY_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PRIORITY_SET(x) (((x) << 29) & 0x20000000) -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_USE_ERR5_MSB 30 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_USE_ERR5_LSB 30 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_USE_ERR5_MASK 0x40000000 -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_USE_ERR5_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_BB_SPECTRAL_SCAN_SPECTRAL_SCAN_USE_ERR5_SET(x) (((x) << 30) & 0x40000000) - -/* macros for BB_analog_power_on_time */ -#define PHY_BB_ANALOG_POWER_ON_TIME_ADDRESS 0x00009914 -#define PHY_BB_ANALOG_POWER_ON_TIME_OFFSET 0x00009914 -#define PHY_BB_ANALOG_POWER_ON_TIME_ACTIVE_TO_RECEIVE_MSB 13 -#define PHY_BB_ANALOG_POWER_ON_TIME_ACTIVE_TO_RECEIVE_LSB 0 -#define PHY_BB_ANALOG_POWER_ON_TIME_ACTIVE_TO_RECEIVE_MASK 0x00003fff -#define PHY_BB_ANALOG_POWER_ON_TIME_ACTIVE_TO_RECEIVE_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_ANALOG_POWER_ON_TIME_ACTIVE_TO_RECEIVE_SET(x) (((x) << 0) & 0x00003fff) - -/* macros for BB_search_start_delay */ -#define PHY_BB_SEARCH_START_DELAY_ADDRESS 0x00009918 -#define PHY_BB_SEARCH_START_DELAY_OFFSET 0x00009918 -#define PHY_BB_SEARCH_START_DELAY_SEARCH_START_DELAY_MSB 11 -#define PHY_BB_SEARCH_START_DELAY_SEARCH_START_DELAY_LSB 0 -#define PHY_BB_SEARCH_START_DELAY_SEARCH_START_DELAY_MASK 0x00000fff -#define PHY_BB_SEARCH_START_DELAY_SEARCH_START_DELAY_GET(x) (((x) & 0x00000fff) >> 0) -#define PHY_BB_SEARCH_START_DELAY_SEARCH_START_DELAY_SET(x) (((x) << 0) & 0x00000fff) -#define PHY_BB_SEARCH_START_DELAY_ENABLE_FLT_SVD_MSB 12 -#define PHY_BB_SEARCH_START_DELAY_ENABLE_FLT_SVD_LSB 12 -#define PHY_BB_SEARCH_START_DELAY_ENABLE_FLT_SVD_MASK 0x00001000 -#define PHY_BB_SEARCH_START_DELAY_ENABLE_FLT_SVD_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_BB_SEARCH_START_DELAY_ENABLE_FLT_SVD_SET(x) (((x) << 12) & 0x00001000) -#define PHY_BB_SEARCH_START_DELAY_ENABLE_SEND_CHAN_MSB 13 -#define PHY_BB_SEARCH_START_DELAY_ENABLE_SEND_CHAN_LSB 13 -#define PHY_BB_SEARCH_START_DELAY_ENABLE_SEND_CHAN_MASK 0x00002000 -#define PHY_BB_SEARCH_START_DELAY_ENABLE_SEND_CHAN_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_BB_SEARCH_START_DELAY_ENABLE_SEND_CHAN_SET(x) (((x) << 13) & 0x00002000) - -/* macros for BB_max_rx_length */ -#define PHY_BB_MAX_RX_LENGTH_ADDRESS 0x0000991c -#define PHY_BB_MAX_RX_LENGTH_OFFSET 0x0000991c -#define PHY_BB_MAX_RX_LENGTH_MAX_RX_LENGTH_MSB 11 -#define PHY_BB_MAX_RX_LENGTH_MAX_RX_LENGTH_LSB 0 -#define PHY_BB_MAX_RX_LENGTH_MAX_RX_LENGTH_MASK 0x00000fff -#define PHY_BB_MAX_RX_LENGTH_MAX_RX_LENGTH_GET(x) (((x) & 0x00000fff) >> 0) -#define PHY_BB_MAX_RX_LENGTH_MAX_RX_LENGTH_SET(x) (((x) << 0) & 0x00000fff) -#define PHY_BB_MAX_RX_LENGTH_MAX_HT_LENGTH_MSB 29 -#define PHY_BB_MAX_RX_LENGTH_MAX_HT_LENGTH_LSB 12 -#define PHY_BB_MAX_RX_LENGTH_MAX_HT_LENGTH_MASK 0x3ffff000 -#define PHY_BB_MAX_RX_LENGTH_MAX_HT_LENGTH_GET(x) (((x) & 0x3ffff000) >> 12) -#define PHY_BB_MAX_RX_LENGTH_MAX_HT_LENGTH_SET(x) (((x) << 12) & 0x3ffff000) - -/* macros for BB_timing_control_4 */ -#define PHY_BB_TIMING_CONTROL_4_ADDRESS 0x00009920 -#define PHY_BB_TIMING_CONTROL_4_OFFSET 0x00009920 -#define PHY_BB_TIMING_CONTROL_4_CAL_LG_COUNT_MAX_MSB 15 -#define PHY_BB_TIMING_CONTROL_4_CAL_LG_COUNT_MAX_LSB 12 -#define PHY_BB_TIMING_CONTROL_4_CAL_LG_COUNT_MAX_MASK 0x0000f000 -#define PHY_BB_TIMING_CONTROL_4_CAL_LG_COUNT_MAX_GET(x) (((x) & 0x0000f000) >> 12) -#define PHY_BB_TIMING_CONTROL_4_CAL_LG_COUNT_MAX_SET(x) (((x) << 12) & 0x0000f000) -#define PHY_BB_TIMING_CONTROL_4_DO_GAIN_DC_IQ_CAL_MSB 16 -#define PHY_BB_TIMING_CONTROL_4_DO_GAIN_DC_IQ_CAL_LSB 16 -#define PHY_BB_TIMING_CONTROL_4_DO_GAIN_DC_IQ_CAL_MASK 0x00010000 -#define PHY_BB_TIMING_CONTROL_4_DO_GAIN_DC_IQ_CAL_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_BB_TIMING_CONTROL_4_DO_GAIN_DC_IQ_CAL_SET(x) (((x) << 16) & 0x00010000) -#define PHY_BB_TIMING_CONTROL_4_USE_PILOT_TRACK_DF_MSB 20 -#define PHY_BB_TIMING_CONTROL_4_USE_PILOT_TRACK_DF_LSB 17 -#define PHY_BB_TIMING_CONTROL_4_USE_PILOT_TRACK_DF_MASK 0x001e0000 -#define PHY_BB_TIMING_CONTROL_4_USE_PILOT_TRACK_DF_GET(x) (((x) & 0x001e0000) >> 17) -#define PHY_BB_TIMING_CONTROL_4_USE_PILOT_TRACK_DF_SET(x) (((x) << 17) & 0x001e0000) -#define PHY_BB_TIMING_CONTROL_4_EARLY_TRIGGER_THR_MSB 27 -#define PHY_BB_TIMING_CONTROL_4_EARLY_TRIGGER_THR_LSB 21 -#define PHY_BB_TIMING_CONTROL_4_EARLY_TRIGGER_THR_MASK 0x0fe00000 -#define PHY_BB_TIMING_CONTROL_4_EARLY_TRIGGER_THR_GET(x) (((x) & 0x0fe00000) >> 21) -#define PHY_BB_TIMING_CONTROL_4_EARLY_TRIGGER_THR_SET(x) (((x) << 21) & 0x0fe00000) -#define PHY_BB_TIMING_CONTROL_4_ENABLE_PILOT_MASK_MSB 28 -#define PHY_BB_TIMING_CONTROL_4_ENABLE_PILOT_MASK_LSB 28 -#define PHY_BB_TIMING_CONTROL_4_ENABLE_PILOT_MASK_MASK 0x10000000 -#define PHY_BB_TIMING_CONTROL_4_ENABLE_PILOT_MASK_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_BB_TIMING_CONTROL_4_ENABLE_PILOT_MASK_SET(x) (((x) << 28) & 0x10000000) -#define PHY_BB_TIMING_CONTROL_4_ENABLE_CHAN_MASK_MSB 29 -#define PHY_BB_TIMING_CONTROL_4_ENABLE_CHAN_MASK_LSB 29 -#define PHY_BB_TIMING_CONTROL_4_ENABLE_CHAN_MASK_MASK 0x20000000 -#define PHY_BB_TIMING_CONTROL_4_ENABLE_CHAN_MASK_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_BB_TIMING_CONTROL_4_ENABLE_CHAN_MASK_SET(x) (((x) << 29) & 0x20000000) -#define PHY_BB_TIMING_CONTROL_4_ENABLE_SPUR_FILTER_MSB 30 -#define PHY_BB_TIMING_CONTROL_4_ENABLE_SPUR_FILTER_LSB 30 -#define PHY_BB_TIMING_CONTROL_4_ENABLE_SPUR_FILTER_MASK 0x40000000 -#define PHY_BB_TIMING_CONTROL_4_ENABLE_SPUR_FILTER_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_BB_TIMING_CONTROL_4_ENABLE_SPUR_FILTER_SET(x) (((x) << 30) & 0x40000000) -#define PHY_BB_TIMING_CONTROL_4_ENABLE_SPUR_RSSI_MSB 31 -#define PHY_BB_TIMING_CONTROL_4_ENABLE_SPUR_RSSI_LSB 31 -#define PHY_BB_TIMING_CONTROL_4_ENABLE_SPUR_RSSI_MASK 0x80000000 -#define PHY_BB_TIMING_CONTROL_4_ENABLE_SPUR_RSSI_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_TIMING_CONTROL_4_ENABLE_SPUR_RSSI_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_timing_control_5 */ -#define PHY_BB_TIMING_CONTROL_5_ADDRESS 0x00009924 -#define PHY_BB_TIMING_CONTROL_5_OFFSET 0x00009924 -#define PHY_BB_TIMING_CONTROL_5_ENABLE_CYCPWR_THR1_MSB 0 -#define PHY_BB_TIMING_CONTROL_5_ENABLE_CYCPWR_THR1_LSB 0 -#define PHY_BB_TIMING_CONTROL_5_ENABLE_CYCPWR_THR1_MASK 0x00000001 -#define PHY_BB_TIMING_CONTROL_5_ENABLE_CYCPWR_THR1_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_TIMING_CONTROL_5_ENABLE_CYCPWR_THR1_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_TIMING_CONTROL_5_CYCPWR_THR1_MSB 7 -#define PHY_BB_TIMING_CONTROL_5_CYCPWR_THR1_LSB 1 -#define PHY_BB_TIMING_CONTROL_5_CYCPWR_THR1_MASK 0x000000fe -#define PHY_BB_TIMING_CONTROL_5_CYCPWR_THR1_GET(x) (((x) & 0x000000fe) >> 1) -#define PHY_BB_TIMING_CONTROL_5_CYCPWR_THR1_SET(x) (((x) << 1) & 0x000000fe) -#define PHY_BB_TIMING_CONTROL_5_ENABLE_RSSI_THR1A_MSB 15 -#define PHY_BB_TIMING_CONTROL_5_ENABLE_RSSI_THR1A_LSB 15 -#define PHY_BB_TIMING_CONTROL_5_ENABLE_RSSI_THR1A_MASK 0x00008000 -#define PHY_BB_TIMING_CONTROL_5_ENABLE_RSSI_THR1A_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_BB_TIMING_CONTROL_5_ENABLE_RSSI_THR1A_SET(x) (((x) << 15) & 0x00008000) -#define PHY_BB_TIMING_CONTROL_5_RSSI_THR1A_MSB 22 -#define PHY_BB_TIMING_CONTROL_5_RSSI_THR1A_LSB 16 -#define PHY_BB_TIMING_CONTROL_5_RSSI_THR1A_MASK 0x007f0000 -#define PHY_BB_TIMING_CONTROL_5_RSSI_THR1A_GET(x) (((x) & 0x007f0000) >> 16) -#define PHY_BB_TIMING_CONTROL_5_RSSI_THR1A_SET(x) (((x) << 16) & 0x007f0000) -#define PHY_BB_TIMING_CONTROL_5_LONG_SC_THRESH_HI_RSSI_MSB 29 -#define PHY_BB_TIMING_CONTROL_5_LONG_SC_THRESH_HI_RSSI_LSB 23 -#define PHY_BB_TIMING_CONTROL_5_LONG_SC_THRESH_HI_RSSI_MASK 0x3f800000 -#define PHY_BB_TIMING_CONTROL_5_LONG_SC_THRESH_HI_RSSI_GET(x) (((x) & 0x3f800000) >> 23) -#define PHY_BB_TIMING_CONTROL_5_LONG_SC_THRESH_HI_RSSI_SET(x) (((x) << 23) & 0x3f800000) -#define PHY_BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_MSB 30 -#define PHY_BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_LSB 30 -#define PHY_BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_MASK 0x40000000 -#define PHY_BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_SET(x) (((x) << 30) & 0x40000000) -#define PHY_BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_EN_MSB 31 -#define PHY_BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_EN_LSB 31 -#define PHY_BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_EN_MASK 0x80000000 -#define PHY_BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_EN_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_EN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_phyonly_warm_reset */ -#define PHY_BB_PHYONLY_WARM_RESET_ADDRESS 0x00009928 -#define PHY_BB_PHYONLY_WARM_RESET_OFFSET 0x00009928 -#define PHY_BB_PHYONLY_WARM_RESET_PHYONLY_RST_WARM_L_MSB 0 -#define PHY_BB_PHYONLY_WARM_RESET_PHYONLY_RST_WARM_L_LSB 0 -#define PHY_BB_PHYONLY_WARM_RESET_PHYONLY_RST_WARM_L_MASK 0x00000001 -#define PHY_BB_PHYONLY_WARM_RESET_PHYONLY_RST_WARM_L_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_PHYONLY_WARM_RESET_PHYONLY_RST_WARM_L_SET(x) (((x) << 0) & 0x00000001) - -/* macros for BB_phyonly_control */ -#define PHY_BB_PHYONLY_CONTROL_ADDRESS 0x0000992c -#define PHY_BB_PHYONLY_CONTROL_OFFSET 0x0000992c -#define PHY_BB_PHYONLY_CONTROL_RX_DRAIN_RATE_MSB 0 -#define PHY_BB_PHYONLY_CONTROL_RX_DRAIN_RATE_LSB 0 -#define PHY_BB_PHYONLY_CONTROL_RX_DRAIN_RATE_MASK 0x00000001 -#define PHY_BB_PHYONLY_CONTROL_RX_DRAIN_RATE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_PHYONLY_CONTROL_RX_DRAIN_RATE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_PHYONLY_CONTROL_LATE_TX_SIGNAL_SYMBOL_MSB 1 -#define PHY_BB_PHYONLY_CONTROL_LATE_TX_SIGNAL_SYMBOL_LSB 1 -#define PHY_BB_PHYONLY_CONTROL_LATE_TX_SIGNAL_SYMBOL_MASK 0x00000002 -#define PHY_BB_PHYONLY_CONTROL_LATE_TX_SIGNAL_SYMBOL_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_PHYONLY_CONTROL_LATE_TX_SIGNAL_SYMBOL_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_PHYONLY_CONTROL_GENERATE_SCRAMBLER_MSB 2 -#define PHY_BB_PHYONLY_CONTROL_GENERATE_SCRAMBLER_LSB 2 -#define PHY_BB_PHYONLY_CONTROL_GENERATE_SCRAMBLER_MASK 0x00000004 -#define PHY_BB_PHYONLY_CONTROL_GENERATE_SCRAMBLER_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_BB_PHYONLY_CONTROL_GENERATE_SCRAMBLER_SET(x) (((x) << 2) & 0x00000004) -#define PHY_BB_PHYONLY_CONTROL_TX_ANTENNA_SELECT_MSB 3 -#define PHY_BB_PHYONLY_CONTROL_TX_ANTENNA_SELECT_LSB 3 -#define PHY_BB_PHYONLY_CONTROL_TX_ANTENNA_SELECT_MASK 0x00000008 -#define PHY_BB_PHYONLY_CONTROL_TX_ANTENNA_SELECT_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_BB_PHYONLY_CONTROL_TX_ANTENNA_SELECT_SET(x) (((x) << 3) & 0x00000008) -#define PHY_BB_PHYONLY_CONTROL_STATIC_TX_ANTENNA_MSB 4 -#define PHY_BB_PHYONLY_CONTROL_STATIC_TX_ANTENNA_LSB 4 -#define PHY_BB_PHYONLY_CONTROL_STATIC_TX_ANTENNA_MASK 0x00000010 -#define PHY_BB_PHYONLY_CONTROL_STATIC_TX_ANTENNA_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_BB_PHYONLY_CONTROL_STATIC_TX_ANTENNA_SET(x) (((x) << 4) & 0x00000010) -#define PHY_BB_PHYONLY_CONTROL_RX_ANTENNA_SELECT_MSB 5 -#define PHY_BB_PHYONLY_CONTROL_RX_ANTENNA_SELECT_LSB 5 -#define PHY_BB_PHYONLY_CONTROL_RX_ANTENNA_SELECT_MASK 0x00000020 -#define PHY_BB_PHYONLY_CONTROL_RX_ANTENNA_SELECT_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_BB_PHYONLY_CONTROL_RX_ANTENNA_SELECT_SET(x) (((x) << 5) & 0x00000020) -#define PHY_BB_PHYONLY_CONTROL_STATIC_RX_ANTENNA_MSB 6 -#define PHY_BB_PHYONLY_CONTROL_STATIC_RX_ANTENNA_LSB 6 -#define PHY_BB_PHYONLY_CONTROL_STATIC_RX_ANTENNA_MASK 0x00000040 -#define PHY_BB_PHYONLY_CONTROL_STATIC_RX_ANTENNA_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_BB_PHYONLY_CONTROL_STATIC_RX_ANTENNA_SET(x) (((x) << 6) & 0x00000040) -#define PHY_BB_PHYONLY_CONTROL_EN_LOW_FREQ_SLEEP_MSB 7 -#define PHY_BB_PHYONLY_CONTROL_EN_LOW_FREQ_SLEEP_LSB 7 -#define PHY_BB_PHYONLY_CONTROL_EN_LOW_FREQ_SLEEP_MASK 0x00000080 -#define PHY_BB_PHYONLY_CONTROL_EN_LOW_FREQ_SLEEP_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_BB_PHYONLY_CONTROL_EN_LOW_FREQ_SLEEP_SET(x) (((x) << 7) & 0x00000080) - -/* macros for BB_powertx_rate1 */ -#define PHY_BB_POWERTX_RATE1_ADDRESS 0x00009934 -#define PHY_BB_POWERTX_RATE1_OFFSET 0x00009934 -#define PHY_BB_POWERTX_RATE1_POWERTX_0_MSB 5 -#define PHY_BB_POWERTX_RATE1_POWERTX_0_LSB 0 -#define PHY_BB_POWERTX_RATE1_POWERTX_0_MASK 0x0000003f -#define PHY_BB_POWERTX_RATE1_POWERTX_0_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_POWERTX_RATE1_POWERTX_0_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_POWERTX_RATE1_POWERTX_1_MSB 13 -#define PHY_BB_POWERTX_RATE1_POWERTX_1_LSB 8 -#define PHY_BB_POWERTX_RATE1_POWERTX_1_MASK 0x00003f00 -#define PHY_BB_POWERTX_RATE1_POWERTX_1_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_BB_POWERTX_RATE1_POWERTX_1_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_BB_POWERTX_RATE1_POWERTX_2_MSB 21 -#define PHY_BB_POWERTX_RATE1_POWERTX_2_LSB 16 -#define PHY_BB_POWERTX_RATE1_POWERTX_2_MASK 0x003f0000 -#define PHY_BB_POWERTX_RATE1_POWERTX_2_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_POWERTX_RATE1_POWERTX_2_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_POWERTX_RATE1_POWERTX_3_MSB 29 -#define PHY_BB_POWERTX_RATE1_POWERTX_3_LSB 24 -#define PHY_BB_POWERTX_RATE1_POWERTX_3_MASK 0x3f000000 -#define PHY_BB_POWERTX_RATE1_POWERTX_3_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_BB_POWERTX_RATE1_POWERTX_3_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for BB_powertx_rate2 */ -#define PHY_BB_POWERTX_RATE2_ADDRESS 0x00009938 -#define PHY_BB_POWERTX_RATE2_OFFSET 0x00009938 -#define PHY_BB_POWERTX_RATE2_POWERTX_4_MSB 5 -#define PHY_BB_POWERTX_RATE2_POWERTX_4_LSB 0 -#define PHY_BB_POWERTX_RATE2_POWERTX_4_MASK 0x0000003f -#define PHY_BB_POWERTX_RATE2_POWERTX_4_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_POWERTX_RATE2_POWERTX_4_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_POWERTX_RATE2_POWERTX_5_MSB 13 -#define PHY_BB_POWERTX_RATE2_POWERTX_5_LSB 8 -#define PHY_BB_POWERTX_RATE2_POWERTX_5_MASK 0x00003f00 -#define PHY_BB_POWERTX_RATE2_POWERTX_5_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_BB_POWERTX_RATE2_POWERTX_5_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_BB_POWERTX_RATE2_POWERTX_6_MSB 21 -#define PHY_BB_POWERTX_RATE2_POWERTX_6_LSB 16 -#define PHY_BB_POWERTX_RATE2_POWERTX_6_MASK 0x003f0000 -#define PHY_BB_POWERTX_RATE2_POWERTX_6_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_POWERTX_RATE2_POWERTX_6_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_POWERTX_RATE2_POWERTX_7_MSB 29 -#define PHY_BB_POWERTX_RATE2_POWERTX_7_LSB 24 -#define PHY_BB_POWERTX_RATE2_POWERTX_7_MASK 0x3f000000 -#define PHY_BB_POWERTX_RATE2_POWERTX_7_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_BB_POWERTX_RATE2_POWERTX_7_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for BB_powertx_max */ -#define PHY_BB_POWERTX_MAX_ADDRESS 0x0000993c -#define PHY_BB_POWERTX_MAX_OFFSET 0x0000993c -#define PHY_BB_POWERTX_MAX_USE_PER_PACKET_POWERTX_MAX_MSB 6 -#define PHY_BB_POWERTX_MAX_USE_PER_PACKET_POWERTX_MAX_LSB 6 -#define PHY_BB_POWERTX_MAX_USE_PER_PACKET_POWERTX_MAX_MASK 0x00000040 -#define PHY_BB_POWERTX_MAX_USE_PER_PACKET_POWERTX_MAX_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_BB_POWERTX_MAX_USE_PER_PACKET_POWERTX_MAX_SET(x) (((x) << 6) & 0x00000040) - -/* macros for BB_extension_radar */ -#define PHY_BB_EXTENSION_RADAR_ADDRESS 0x00009940 -#define PHY_BB_EXTENSION_RADAR_OFFSET 0x00009940 -#define PHY_BB_EXTENSION_RADAR_BLOCKER40_MAX_RADAR_MSB 13 -#define PHY_BB_EXTENSION_RADAR_BLOCKER40_MAX_RADAR_LSB 8 -#define PHY_BB_EXTENSION_RADAR_BLOCKER40_MAX_RADAR_MASK 0x00003f00 -#define PHY_BB_EXTENSION_RADAR_BLOCKER40_MAX_RADAR_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_BB_EXTENSION_RADAR_BLOCKER40_MAX_RADAR_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_BB_EXTENSION_RADAR_ENABLE_EXT_RADAR_MSB 14 -#define PHY_BB_EXTENSION_RADAR_ENABLE_EXT_RADAR_LSB 14 -#define PHY_BB_EXTENSION_RADAR_ENABLE_EXT_RADAR_MASK 0x00004000 -#define PHY_BB_EXTENSION_RADAR_ENABLE_EXT_RADAR_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_BB_EXTENSION_RADAR_ENABLE_EXT_RADAR_SET(x) (((x) << 14) & 0x00004000) -#define PHY_BB_EXTENSION_RADAR_RADAR_DC_PWR_THRESH_MSB 22 -#define PHY_BB_EXTENSION_RADAR_RADAR_DC_PWR_THRESH_LSB 15 -#define PHY_BB_EXTENSION_RADAR_RADAR_DC_PWR_THRESH_MASK 0x007f8000 -#define PHY_BB_EXTENSION_RADAR_RADAR_DC_PWR_THRESH_GET(x) (((x) & 0x007f8000) >> 15) -#define PHY_BB_EXTENSION_RADAR_RADAR_DC_PWR_THRESH_SET(x) (((x) << 15) & 0x007f8000) -#define PHY_BB_EXTENSION_RADAR_RADAR_LB_DC_CAP_MSB 30 -#define PHY_BB_EXTENSION_RADAR_RADAR_LB_DC_CAP_LSB 23 -#define PHY_BB_EXTENSION_RADAR_RADAR_LB_DC_CAP_MASK 0x7f800000 -#define PHY_BB_EXTENSION_RADAR_RADAR_LB_DC_CAP_GET(x) (((x) & 0x7f800000) >> 23) -#define PHY_BB_EXTENSION_RADAR_RADAR_LB_DC_CAP_SET(x) (((x) << 23) & 0x7f800000) -#define PHY_BB_EXTENSION_RADAR_DISABLE_ADCSAT_HOLD_MSB 31 -#define PHY_BB_EXTENSION_RADAR_DISABLE_ADCSAT_HOLD_LSB 31 -#define PHY_BB_EXTENSION_RADAR_DISABLE_ADCSAT_HOLD_MASK 0x80000000 -#define PHY_BB_EXTENSION_RADAR_DISABLE_ADCSAT_HOLD_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_EXTENSION_RADAR_DISABLE_ADCSAT_HOLD_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_frame_control */ -#define PHY_BB_FRAME_CONTROL_ADDRESS 0x00009944 -#define PHY_BB_FRAME_CONTROL_OFFSET 0x00009944 -#define PHY_BB_FRAME_CONTROL_CF_OVERLAP_WINDOW_MSB 1 -#define PHY_BB_FRAME_CONTROL_CF_OVERLAP_WINDOW_LSB 0 -#define PHY_BB_FRAME_CONTROL_CF_OVERLAP_WINDOW_MASK 0x00000003 -#define PHY_BB_FRAME_CONTROL_CF_OVERLAP_WINDOW_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_BB_FRAME_CONTROL_CF_OVERLAP_WINDOW_SET(x) (((x) << 0) & 0x00000003) -#define PHY_BB_FRAME_CONTROL_CF_SCALE_SHORT_MSB 2 -#define PHY_BB_FRAME_CONTROL_CF_SCALE_SHORT_LSB 2 -#define PHY_BB_FRAME_CONTROL_CF_SCALE_SHORT_MASK 0x00000004 -#define PHY_BB_FRAME_CONTROL_CF_SCALE_SHORT_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_BB_FRAME_CONTROL_CF_SCALE_SHORT_SET(x) (((x) << 2) & 0x00000004) -#define PHY_BB_FRAME_CONTROL_CF_TX_CLIP_MSB 5 -#define PHY_BB_FRAME_CONTROL_CF_TX_CLIP_LSB 3 -#define PHY_BB_FRAME_CONTROL_CF_TX_CLIP_MASK 0x00000038 -#define PHY_BB_FRAME_CONTROL_CF_TX_CLIP_GET(x) (((x) & 0x00000038) >> 3) -#define PHY_BB_FRAME_CONTROL_CF_TX_CLIP_SET(x) (((x) << 3) & 0x00000038) -#define PHY_BB_FRAME_CONTROL_CF_TX_DOUBLESAMP_DAC_MSB 7 -#define PHY_BB_FRAME_CONTROL_CF_TX_DOUBLESAMP_DAC_LSB 6 -#define PHY_BB_FRAME_CONTROL_CF_TX_DOUBLESAMP_DAC_MASK 0x000000c0 -#define PHY_BB_FRAME_CONTROL_CF_TX_DOUBLESAMP_DAC_GET(x) (((x) & 0x000000c0) >> 6) -#define PHY_BB_FRAME_CONTROL_CF_TX_DOUBLESAMP_DAC_SET(x) (((x) << 6) & 0x000000c0) -#define PHY_BB_FRAME_CONTROL_TX_END_ADJUST_MSB 15 -#define PHY_BB_FRAME_CONTROL_TX_END_ADJUST_LSB 8 -#define PHY_BB_FRAME_CONTROL_TX_END_ADJUST_MASK 0x0000ff00 -#define PHY_BB_FRAME_CONTROL_TX_END_ADJUST_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_FRAME_CONTROL_TX_END_ADJUST_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_FRAME_CONTROL_PREPEND_CHAN_INFO_MSB 16 -#define PHY_BB_FRAME_CONTROL_PREPEND_CHAN_INFO_LSB 16 -#define PHY_BB_FRAME_CONTROL_PREPEND_CHAN_INFO_MASK 0x00010000 -#define PHY_BB_FRAME_CONTROL_PREPEND_CHAN_INFO_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_BB_FRAME_CONTROL_PREPEND_CHAN_INFO_SET(x) (((x) << 16) & 0x00010000) -#define PHY_BB_FRAME_CONTROL_SHORT_HIGH_PAR_NORM_MSB 17 -#define PHY_BB_FRAME_CONTROL_SHORT_HIGH_PAR_NORM_LSB 17 -#define PHY_BB_FRAME_CONTROL_SHORT_HIGH_PAR_NORM_MASK 0x00020000 -#define PHY_BB_FRAME_CONTROL_SHORT_HIGH_PAR_NORM_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_BB_FRAME_CONTROL_SHORT_HIGH_PAR_NORM_SET(x) (((x) << 17) & 0x00020000) -#define PHY_BB_FRAME_CONTROL_EN_ERR_GREEN_FIELD_MSB 18 -#define PHY_BB_FRAME_CONTROL_EN_ERR_GREEN_FIELD_LSB 18 -#define PHY_BB_FRAME_CONTROL_EN_ERR_GREEN_FIELD_MASK 0x00040000 -#define PHY_BB_FRAME_CONTROL_EN_ERR_GREEN_FIELD_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_BB_FRAME_CONTROL_EN_ERR_GREEN_FIELD_SET(x) (((x) << 18) & 0x00040000) -#define PHY_BB_FRAME_CONTROL_EN_ERR_XR_POWER_RATIO_MSB 19 -#define PHY_BB_FRAME_CONTROL_EN_ERR_XR_POWER_RATIO_LSB 19 -#define PHY_BB_FRAME_CONTROL_EN_ERR_XR_POWER_RATIO_MASK 0x00080000 -#define PHY_BB_FRAME_CONTROL_EN_ERR_XR_POWER_RATIO_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_BB_FRAME_CONTROL_EN_ERR_XR_POWER_RATIO_SET(x) (((x) << 19) & 0x00080000) -#define PHY_BB_FRAME_CONTROL_EN_ERR_OFDM_XCORR_MSB 20 -#define PHY_BB_FRAME_CONTROL_EN_ERR_OFDM_XCORR_LSB 20 -#define PHY_BB_FRAME_CONTROL_EN_ERR_OFDM_XCORR_MASK 0x00100000 -#define PHY_BB_FRAME_CONTROL_EN_ERR_OFDM_XCORR_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_BB_FRAME_CONTROL_EN_ERR_OFDM_XCORR_SET(x) (((x) << 20) & 0x00100000) -#define PHY_BB_FRAME_CONTROL_EN_ERR_LONG_SC_THR_MSB 21 -#define PHY_BB_FRAME_CONTROL_EN_ERR_LONG_SC_THR_LSB 21 -#define PHY_BB_FRAME_CONTROL_EN_ERR_LONG_SC_THR_MASK 0x00200000 -#define PHY_BB_FRAME_CONTROL_EN_ERR_LONG_SC_THR_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_BB_FRAME_CONTROL_EN_ERR_LONG_SC_THR_SET(x) (((x) << 21) & 0x00200000) -#define PHY_BB_FRAME_CONTROL_EN_ERR_TIM_LONG1_MSB 22 -#define PHY_BB_FRAME_CONTROL_EN_ERR_TIM_LONG1_LSB 22 -#define PHY_BB_FRAME_CONTROL_EN_ERR_TIM_LONG1_MASK 0x00400000 -#define PHY_BB_FRAME_CONTROL_EN_ERR_TIM_LONG1_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_BB_FRAME_CONTROL_EN_ERR_TIM_LONG1_SET(x) (((x) << 22) & 0x00400000) -#define PHY_BB_FRAME_CONTROL_EN_ERR_TIM_EARLY_TRIG_MSB 23 -#define PHY_BB_FRAME_CONTROL_EN_ERR_TIM_EARLY_TRIG_LSB 23 -#define PHY_BB_FRAME_CONTROL_EN_ERR_TIM_EARLY_TRIG_MASK 0x00800000 -#define PHY_BB_FRAME_CONTROL_EN_ERR_TIM_EARLY_TRIG_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_BB_FRAME_CONTROL_EN_ERR_TIM_EARLY_TRIG_SET(x) (((x) << 23) & 0x00800000) -#define PHY_BB_FRAME_CONTROL_EN_ERR_TIM_TIMEOUT_MSB 24 -#define PHY_BB_FRAME_CONTROL_EN_ERR_TIM_TIMEOUT_LSB 24 -#define PHY_BB_FRAME_CONTROL_EN_ERR_TIM_TIMEOUT_MASK 0x01000000 -#define PHY_BB_FRAME_CONTROL_EN_ERR_TIM_TIMEOUT_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_BB_FRAME_CONTROL_EN_ERR_TIM_TIMEOUT_SET(x) (((x) << 24) & 0x01000000) -#define PHY_BB_FRAME_CONTROL_EN_ERR_SIGNAL_PARITY_MSB 25 -#define PHY_BB_FRAME_CONTROL_EN_ERR_SIGNAL_PARITY_LSB 25 -#define PHY_BB_FRAME_CONTROL_EN_ERR_SIGNAL_PARITY_MASK 0x02000000 -#define PHY_BB_FRAME_CONTROL_EN_ERR_SIGNAL_PARITY_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_BB_FRAME_CONTROL_EN_ERR_SIGNAL_PARITY_SET(x) (((x) << 25) & 0x02000000) -#define PHY_BB_FRAME_CONTROL_EN_ERR_RATE_ILLEGAL_MSB 26 -#define PHY_BB_FRAME_CONTROL_EN_ERR_RATE_ILLEGAL_LSB 26 -#define PHY_BB_FRAME_CONTROL_EN_ERR_RATE_ILLEGAL_MASK 0x04000000 -#define PHY_BB_FRAME_CONTROL_EN_ERR_RATE_ILLEGAL_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_BB_FRAME_CONTROL_EN_ERR_RATE_ILLEGAL_SET(x) (((x) << 26) & 0x04000000) -#define PHY_BB_FRAME_CONTROL_EN_ERR_LENGTH_ILLEGAL_MSB 27 -#define PHY_BB_FRAME_CONTROL_EN_ERR_LENGTH_ILLEGAL_LSB 27 -#define PHY_BB_FRAME_CONTROL_EN_ERR_LENGTH_ILLEGAL_MASK 0x08000000 -#define PHY_BB_FRAME_CONTROL_EN_ERR_LENGTH_ILLEGAL_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_BB_FRAME_CONTROL_EN_ERR_LENGTH_ILLEGAL_SET(x) (((x) << 27) & 0x08000000) -#define PHY_BB_FRAME_CONTROL_EN_ERR_HT_SERVICE_MSB 28 -#define PHY_BB_FRAME_CONTROL_EN_ERR_HT_SERVICE_LSB 28 -#define PHY_BB_FRAME_CONTROL_EN_ERR_HT_SERVICE_MASK 0x10000000 -#define PHY_BB_FRAME_CONTROL_EN_ERR_HT_SERVICE_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_BB_FRAME_CONTROL_EN_ERR_HT_SERVICE_SET(x) (((x) << 28) & 0x10000000) -#define PHY_BB_FRAME_CONTROL_EN_ERR_SERVICE_MSB 29 -#define PHY_BB_FRAME_CONTROL_EN_ERR_SERVICE_LSB 29 -#define PHY_BB_FRAME_CONTROL_EN_ERR_SERVICE_MASK 0x20000000 -#define PHY_BB_FRAME_CONTROL_EN_ERR_SERVICE_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_BB_FRAME_CONTROL_EN_ERR_SERVICE_SET(x) (((x) << 29) & 0x20000000) -#define PHY_BB_FRAME_CONTROL_EN_ERR_TX_UNDERRUN_MSB 30 -#define PHY_BB_FRAME_CONTROL_EN_ERR_TX_UNDERRUN_LSB 30 -#define PHY_BB_FRAME_CONTROL_EN_ERR_TX_UNDERRUN_MASK 0x40000000 -#define PHY_BB_FRAME_CONTROL_EN_ERR_TX_UNDERRUN_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_BB_FRAME_CONTROL_EN_ERR_TX_UNDERRUN_SET(x) (((x) << 30) & 0x40000000) -#define PHY_BB_FRAME_CONTROL_EN_ERR_RX_ABORT_MSB 31 -#define PHY_BB_FRAME_CONTROL_EN_ERR_RX_ABORT_LSB 31 -#define PHY_BB_FRAME_CONTROL_EN_ERR_RX_ABORT_MASK 0x80000000 -#define PHY_BB_FRAME_CONTROL_EN_ERR_RX_ABORT_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_FRAME_CONTROL_EN_ERR_RX_ABORT_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_timing_control_6 */ -#define PHY_BB_TIMING_CONTROL_6_ADDRESS 0x00009948 -#define PHY_BB_TIMING_CONTROL_6_OFFSET 0x00009948 -#define PHY_BB_TIMING_CONTROL_6_HI_RSSI_THRESH_MSB 7 -#define PHY_BB_TIMING_CONTROL_6_HI_RSSI_THRESH_LSB 0 -#define PHY_BB_TIMING_CONTROL_6_HI_RSSI_THRESH_MASK 0x000000ff -#define PHY_BB_TIMING_CONTROL_6_HI_RSSI_THRESH_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_TIMING_CONTROL_6_HI_RSSI_THRESH_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_TIMING_CONTROL_6_EARLY_TRIGGER_THR_HI_RSSI_MSB 14 -#define PHY_BB_TIMING_CONTROL_6_EARLY_TRIGGER_THR_HI_RSSI_LSB 8 -#define PHY_BB_TIMING_CONTROL_6_EARLY_TRIGGER_THR_HI_RSSI_MASK 0x00007f00 -#define PHY_BB_TIMING_CONTROL_6_EARLY_TRIGGER_THR_HI_RSSI_GET(x) (((x) & 0x00007f00) >> 8) -#define PHY_BB_TIMING_CONTROL_6_EARLY_TRIGGER_THR_HI_RSSI_SET(x) (((x) << 8) & 0x00007f00) -#define PHY_BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_MSB 20 -#define PHY_BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_LSB 15 -#define PHY_BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_MASK 0x001f8000 -#define PHY_BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_GET(x) (((x) & 0x001f8000) >> 15) -#define PHY_BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_SET(x) (((x) << 15) & 0x001f8000) -#define PHY_BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_HI_RSSI_MSB 27 -#define PHY_BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_HI_RSSI_LSB 21 -#define PHY_BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_HI_RSSI_MASK 0x0fe00000 -#define PHY_BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_HI_RSSI_GET(x) (((x) & 0x0fe00000) >> 21) -#define PHY_BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_HI_RSSI_SET(x) (((x) << 21) & 0x0fe00000) -#define PHY_BB_TIMING_CONTROL_6_LONG_MEDIUM_RATIO_THR_MSB 31 -#define PHY_BB_TIMING_CONTROL_6_LONG_MEDIUM_RATIO_THR_LSB 28 -#define PHY_BB_TIMING_CONTROL_6_LONG_MEDIUM_RATIO_THR_MASK 0xf0000000 -#define PHY_BB_TIMING_CONTROL_6_LONG_MEDIUM_RATIO_THR_GET(x) (((x) & 0xf0000000) >> 28) -#define PHY_BB_TIMING_CONTROL_6_LONG_MEDIUM_RATIO_THR_SET(x) (((x) << 28) & 0xf0000000) - -/* macros for BB_spur_mask_controls */ -#define PHY_BB_SPUR_MASK_CONTROLS_ADDRESS 0x0000994c -#define PHY_BB_SPUR_MASK_CONTROLS_OFFSET 0x0000994c -#define PHY_BB_SPUR_MASK_CONTROLS_SPUR_RSSI_THRESH_MSB 7 -#define PHY_BB_SPUR_MASK_CONTROLS_SPUR_RSSI_THRESH_LSB 0 -#define PHY_BB_SPUR_MASK_CONTROLS_SPUR_RSSI_THRESH_MASK 0x000000ff -#define PHY_BB_SPUR_MASK_CONTROLS_SPUR_RSSI_THRESH_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_SPUR_MASK_CONTROLS_SPUR_RSSI_THRESH_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_SPUR_MASK_CONTROLS_EN_VIT_SPUR_RSSI_MSB 8 -#define PHY_BB_SPUR_MASK_CONTROLS_EN_VIT_SPUR_RSSI_LSB 8 -#define PHY_BB_SPUR_MASK_CONTROLS_EN_VIT_SPUR_RSSI_MASK 0x00000100 -#define PHY_BB_SPUR_MASK_CONTROLS_EN_VIT_SPUR_RSSI_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_BB_SPUR_MASK_CONTROLS_EN_VIT_SPUR_RSSI_SET(x) (((x) << 8) & 0x00000100) -#define PHY_BB_SPUR_MASK_CONTROLS_ENABLE_MASK_PPM_MSB 17 -#define PHY_BB_SPUR_MASK_CONTROLS_ENABLE_MASK_PPM_LSB 17 -#define PHY_BB_SPUR_MASK_CONTROLS_ENABLE_MASK_PPM_MASK 0x00020000 -#define PHY_BB_SPUR_MASK_CONTROLS_ENABLE_MASK_PPM_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_BB_SPUR_MASK_CONTROLS_ENABLE_MASK_PPM_SET(x) (((x) << 17) & 0x00020000) -#define PHY_BB_SPUR_MASK_CONTROLS_MASK_RATE_CNTL_MSB 25 -#define PHY_BB_SPUR_MASK_CONTROLS_MASK_RATE_CNTL_LSB 18 -#define PHY_BB_SPUR_MASK_CONTROLS_MASK_RATE_CNTL_MASK 0x03fc0000 -#define PHY_BB_SPUR_MASK_CONTROLS_MASK_RATE_CNTL_GET(x) (((x) & 0x03fc0000) >> 18) -#define PHY_BB_SPUR_MASK_CONTROLS_MASK_RATE_CNTL_SET(x) (((x) << 18) & 0x03fc0000) - -/* macros for BB_rx_iq_corr_b0 */ -#define PHY_BB_RX_IQ_CORR_B0_ADDRESS 0x00009950 -#define PHY_BB_RX_IQ_CORR_B0_OFFSET 0x00009950 -#define PHY_BB_RX_IQ_CORR_B0_RX_IQCORR_Q_Q_COFF_0_MSB 6 -#define PHY_BB_RX_IQ_CORR_B0_RX_IQCORR_Q_Q_COFF_0_LSB 0 -#define PHY_BB_RX_IQ_CORR_B0_RX_IQCORR_Q_Q_COFF_0_MASK 0x0000007f -#define PHY_BB_RX_IQ_CORR_B0_RX_IQCORR_Q_Q_COFF_0_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_BB_RX_IQ_CORR_B0_RX_IQCORR_Q_Q_COFF_0_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_BB_RX_IQ_CORR_B0_RX_IQCORR_Q_I_COFF_0_MSB 13 -#define PHY_BB_RX_IQ_CORR_B0_RX_IQCORR_Q_I_COFF_0_LSB 7 -#define PHY_BB_RX_IQ_CORR_B0_RX_IQCORR_Q_I_COFF_0_MASK 0x00003f80 -#define PHY_BB_RX_IQ_CORR_B0_RX_IQCORR_Q_I_COFF_0_GET(x) (((x) & 0x00003f80) >> 7) -#define PHY_BB_RX_IQ_CORR_B0_RX_IQCORR_Q_I_COFF_0_SET(x) (((x) << 7) & 0x00003f80) -#define PHY_BB_RX_IQ_CORR_B0_RX_IQCORR_ENABLE_MSB 14 -#define PHY_BB_RX_IQ_CORR_B0_RX_IQCORR_ENABLE_LSB 14 -#define PHY_BB_RX_IQ_CORR_B0_RX_IQCORR_ENABLE_MASK 0x00004000 -#define PHY_BB_RX_IQ_CORR_B0_RX_IQCORR_ENABLE_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_BB_RX_IQ_CORR_B0_RX_IQCORR_ENABLE_SET(x) (((x) << 14) & 0x00004000) -#define PHY_BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_Q_COFF_0_MSB 21 -#define PHY_BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_Q_COFF_0_LSB 15 -#define PHY_BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_Q_COFF_0_MASK 0x003f8000 -#define PHY_BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_Q_COFF_0_GET(x) (((x) & 0x003f8000) >> 15) -#define PHY_BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_Q_COFF_0_SET(x) (((x) << 15) & 0x003f8000) -#define PHY_BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_I_COFF_0_MSB 28 -#define PHY_BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_I_COFF_0_LSB 22 -#define PHY_BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_I_COFF_0_MASK 0x1fc00000 -#define PHY_BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_I_COFF_0_GET(x) (((x) & 0x1fc00000) >> 22) -#define PHY_BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_I_COFF_0_SET(x) (((x) << 22) & 0x1fc00000) -#define PHY_BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_ENABLE_MSB 29 -#define PHY_BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_ENABLE_LSB 29 -#define PHY_BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_ENABLE_MASK 0x20000000 -#define PHY_BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_ENABLE_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_ENABLE_SET(x) (((x) << 29) & 0x20000000) - -/* macros for BB_radar_detection */ -#define PHY_BB_RADAR_DETECTION_ADDRESS 0x00009954 -#define PHY_BB_RADAR_DETECTION_OFFSET 0x00009954 -#define PHY_BB_RADAR_DETECTION_PULSE_DETECT_ENABLE_MSB 0 -#define PHY_BB_RADAR_DETECTION_PULSE_DETECT_ENABLE_LSB 0 -#define PHY_BB_RADAR_DETECTION_PULSE_DETECT_ENABLE_MASK 0x00000001 -#define PHY_BB_RADAR_DETECTION_PULSE_DETECT_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_RADAR_DETECTION_PULSE_DETECT_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_RADAR_DETECTION_PULSE_IN_BAND_THRESH_MSB 5 -#define PHY_BB_RADAR_DETECTION_PULSE_IN_BAND_THRESH_LSB 1 -#define PHY_BB_RADAR_DETECTION_PULSE_IN_BAND_THRESH_MASK 0x0000003e -#define PHY_BB_RADAR_DETECTION_PULSE_IN_BAND_THRESH_GET(x) (((x) & 0x0000003e) >> 1) -#define PHY_BB_RADAR_DETECTION_PULSE_IN_BAND_THRESH_SET(x) (((x) << 1) & 0x0000003e) -#define PHY_BB_RADAR_DETECTION_PULSE_RSSI_THRESH_MSB 11 -#define PHY_BB_RADAR_DETECTION_PULSE_RSSI_THRESH_LSB 6 -#define PHY_BB_RADAR_DETECTION_PULSE_RSSI_THRESH_MASK 0x00000fc0 -#define PHY_BB_RADAR_DETECTION_PULSE_RSSI_THRESH_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_RADAR_DETECTION_PULSE_RSSI_THRESH_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_RADAR_DETECTION_PULSE_HEIGHT_THRESH_MSB 17 -#define PHY_BB_RADAR_DETECTION_PULSE_HEIGHT_THRESH_LSB 12 -#define PHY_BB_RADAR_DETECTION_PULSE_HEIGHT_THRESH_MASK 0x0003f000 -#define PHY_BB_RADAR_DETECTION_PULSE_HEIGHT_THRESH_GET(x) (((x) & 0x0003f000) >> 12) -#define PHY_BB_RADAR_DETECTION_PULSE_HEIGHT_THRESH_SET(x) (((x) << 12) & 0x0003f000) -#define PHY_BB_RADAR_DETECTION_RADAR_RSSI_THRESH_MSB 23 -#define PHY_BB_RADAR_DETECTION_RADAR_RSSI_THRESH_LSB 18 -#define PHY_BB_RADAR_DETECTION_RADAR_RSSI_THRESH_MASK 0x00fc0000 -#define PHY_BB_RADAR_DETECTION_RADAR_RSSI_THRESH_GET(x) (((x) & 0x00fc0000) >> 18) -#define PHY_BB_RADAR_DETECTION_RADAR_RSSI_THRESH_SET(x) (((x) << 18) & 0x00fc0000) -#define PHY_BB_RADAR_DETECTION_RADAR_FIRPWR_THRESH_MSB 30 -#define PHY_BB_RADAR_DETECTION_RADAR_FIRPWR_THRESH_LSB 24 -#define PHY_BB_RADAR_DETECTION_RADAR_FIRPWR_THRESH_MASK 0x7f000000 -#define PHY_BB_RADAR_DETECTION_RADAR_FIRPWR_THRESH_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_BB_RADAR_DETECTION_RADAR_FIRPWR_THRESH_SET(x) (((x) << 24) & 0x7f000000) -#define PHY_BB_RADAR_DETECTION_ENABLE_RADAR_FFT_MSB 31 -#define PHY_BB_RADAR_DETECTION_ENABLE_RADAR_FFT_LSB 31 -#define PHY_BB_RADAR_DETECTION_ENABLE_RADAR_FFT_MASK 0x80000000 -#define PHY_BB_RADAR_DETECTION_ENABLE_RADAR_FFT_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_RADAR_DETECTION_ENABLE_RADAR_FFT_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_radar_detection_2 */ -#define PHY_BB_RADAR_DETECTION_2_ADDRESS 0x00009958 -#define PHY_BB_RADAR_DETECTION_2_OFFSET 0x00009958 -#define PHY_BB_RADAR_DETECTION_2_RADAR_LENGTH_MAX_MSB 7 -#define PHY_BB_RADAR_DETECTION_2_RADAR_LENGTH_MAX_LSB 0 -#define PHY_BB_RADAR_DETECTION_2_RADAR_LENGTH_MAX_MASK 0x000000ff -#define PHY_BB_RADAR_DETECTION_2_RADAR_LENGTH_MAX_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_RADAR_DETECTION_2_RADAR_LENGTH_MAX_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_RADAR_DETECTION_2_PULSE_RELSTEP_THRESH_MSB 12 -#define PHY_BB_RADAR_DETECTION_2_PULSE_RELSTEP_THRESH_LSB 8 -#define PHY_BB_RADAR_DETECTION_2_PULSE_RELSTEP_THRESH_MASK 0x00001f00 -#define PHY_BB_RADAR_DETECTION_2_PULSE_RELSTEP_THRESH_GET(x) (((x) & 0x00001f00) >> 8) -#define PHY_BB_RADAR_DETECTION_2_PULSE_RELSTEP_THRESH_SET(x) (((x) << 8) & 0x00001f00) -#define PHY_BB_RADAR_DETECTION_2_ENABLE_PULSE_RELSTEP_CHECK_MSB 13 -#define PHY_BB_RADAR_DETECTION_2_ENABLE_PULSE_RELSTEP_CHECK_LSB 13 -#define PHY_BB_RADAR_DETECTION_2_ENABLE_PULSE_RELSTEP_CHECK_MASK 0x00002000 -#define PHY_BB_RADAR_DETECTION_2_ENABLE_PULSE_RELSTEP_CHECK_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_BB_RADAR_DETECTION_2_ENABLE_PULSE_RELSTEP_CHECK_SET(x) (((x) << 13) & 0x00002000) -#define PHY_BB_RADAR_DETECTION_2_ENABLE_MAX_RADAR_RSSI_MSB 14 -#define PHY_BB_RADAR_DETECTION_2_ENABLE_MAX_RADAR_RSSI_LSB 14 -#define PHY_BB_RADAR_DETECTION_2_ENABLE_MAX_RADAR_RSSI_MASK 0x00004000 -#define PHY_BB_RADAR_DETECTION_2_ENABLE_MAX_RADAR_RSSI_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_BB_RADAR_DETECTION_2_ENABLE_MAX_RADAR_RSSI_SET(x) (((x) << 14) & 0x00004000) -#define PHY_BB_RADAR_DETECTION_2_ENABLE_BLOCK_RADAR_CHECK_MSB 15 -#define PHY_BB_RADAR_DETECTION_2_ENABLE_BLOCK_RADAR_CHECK_LSB 15 -#define PHY_BB_RADAR_DETECTION_2_ENABLE_BLOCK_RADAR_CHECK_MASK 0x00008000 -#define PHY_BB_RADAR_DETECTION_2_ENABLE_BLOCK_RADAR_CHECK_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_BB_RADAR_DETECTION_2_ENABLE_BLOCK_RADAR_CHECK_SET(x) (((x) << 15) & 0x00008000) -#define PHY_BB_RADAR_DETECTION_2_RADAR_RELPWR_THRESH_MSB 21 -#define PHY_BB_RADAR_DETECTION_2_RADAR_RELPWR_THRESH_LSB 16 -#define PHY_BB_RADAR_DETECTION_2_RADAR_RELPWR_THRESH_MASK 0x003f0000 -#define PHY_BB_RADAR_DETECTION_2_RADAR_RELPWR_THRESH_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_RADAR_DETECTION_2_RADAR_RELPWR_THRESH_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_RADAR_DETECTION_2_RADAR_USE_FIRPWR_128_MSB 22 -#define PHY_BB_RADAR_DETECTION_2_RADAR_USE_FIRPWR_128_LSB 22 -#define PHY_BB_RADAR_DETECTION_2_RADAR_USE_FIRPWR_128_MASK 0x00400000 -#define PHY_BB_RADAR_DETECTION_2_RADAR_USE_FIRPWR_128_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_BB_RADAR_DETECTION_2_RADAR_USE_FIRPWR_128_SET(x) (((x) << 22) & 0x00400000) -#define PHY_BB_RADAR_DETECTION_2_ENABLE_RADAR_RELPWR_CHECK_MSB 23 -#define PHY_BB_RADAR_DETECTION_2_ENABLE_RADAR_RELPWR_CHECK_LSB 23 -#define PHY_BB_RADAR_DETECTION_2_ENABLE_RADAR_RELPWR_CHECK_MASK 0x00800000 -#define PHY_BB_RADAR_DETECTION_2_ENABLE_RADAR_RELPWR_CHECK_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_BB_RADAR_DETECTION_2_ENABLE_RADAR_RELPWR_CHECK_SET(x) (((x) << 23) & 0x00800000) -#define PHY_BB_RADAR_DETECTION_2_CF_RADAR_BIN_THRESH_SEL_MSB 26 -#define PHY_BB_RADAR_DETECTION_2_CF_RADAR_BIN_THRESH_SEL_LSB 24 -#define PHY_BB_RADAR_DETECTION_2_CF_RADAR_BIN_THRESH_SEL_MASK 0x07000000 -#define PHY_BB_RADAR_DETECTION_2_CF_RADAR_BIN_THRESH_SEL_GET(x) (((x) & 0x07000000) >> 24) -#define PHY_BB_RADAR_DETECTION_2_CF_RADAR_BIN_THRESH_SEL_SET(x) (((x) << 24) & 0x07000000) -#define PHY_BB_RADAR_DETECTION_2_ENABLE_PULSE_GC_COUNT_CHECK_MSB 27 -#define PHY_BB_RADAR_DETECTION_2_ENABLE_PULSE_GC_COUNT_CHECK_LSB 27 -#define PHY_BB_RADAR_DETECTION_2_ENABLE_PULSE_GC_COUNT_CHECK_MASK 0x08000000 -#define PHY_BB_RADAR_DETECTION_2_ENABLE_PULSE_GC_COUNT_CHECK_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_BB_RADAR_DETECTION_2_ENABLE_PULSE_GC_COUNT_CHECK_SET(x) (((x) << 27) & 0x08000000) - -/* macros for BB_tx_phase_ramp_b0 */ -#define PHY_BB_TX_PHASE_RAMP_B0_ADDRESS 0x0000995c -#define PHY_BB_TX_PHASE_RAMP_B0_OFFSET 0x0000995c -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ENABLE_0_MSB 0 -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ENABLE_0_LSB 0 -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ENABLE_0_MASK 0x00000001 -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ENABLE_0_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ENABLE_0_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_BIAS_0_MSB 6 -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_BIAS_0_LSB 1 -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_BIAS_0_MASK 0x0000007e -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_BIAS_0_GET(x) (((x) & 0x0000007e) >> 1) -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_BIAS_0_SET(x) (((x) << 1) & 0x0000007e) -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_INIT_0_MSB 16 -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_INIT_0_LSB 7 -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_INIT_0_MASK 0x0001ff80 -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_INIT_0_GET(x) (((x) & 0x0001ff80) >> 7) -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_INIT_0_SET(x) (((x) << 7) & 0x0001ff80) -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ALPHA_0_MSB 24 -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ALPHA_0_LSB 17 -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ALPHA_0_MASK 0x01fe0000 -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ALPHA_0_GET(x) (((x) & 0x01fe0000) >> 17) -#define PHY_BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ALPHA_0_SET(x) (((x) << 17) & 0x01fe0000) - -/* macros for BB_switch_table_chn_b0 */ -#define PHY_BB_SWITCH_TABLE_CHN_B0_ADDRESS 0x00009960 -#define PHY_BB_SWITCH_TABLE_CHN_B0_OFFSET 0x00009960 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_IDLE_0_MSB 1 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_IDLE_0_LSB 0 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_IDLE_0_MASK 0x00000003 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_IDLE_0_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_IDLE_0_SET(x) (((x) << 0) & 0x00000003) -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_T_0_MSB 3 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_T_0_LSB 2 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_T_0_MASK 0x0000000c -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_T_0_GET(x) (((x) & 0x0000000c) >> 2) -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_T_0_SET(x) (((x) << 2) & 0x0000000c) -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_R_0_MSB 5 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_R_0_LSB 4 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_R_0_MASK 0x00000030 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_R_0_GET(x) (((x) & 0x00000030) >> 4) -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_R_0_SET(x) (((x) << 4) & 0x00000030) -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX1_0_MSB 7 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX1_0_LSB 6 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX1_0_MASK 0x000000c0 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX1_0_GET(x) (((x) & 0x000000c0) >> 6) -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX1_0_SET(x) (((x) << 6) & 0x000000c0) -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX12_0_MSB 9 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX12_0_LSB 8 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX12_0_MASK 0x00000300 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX12_0_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX12_0_SET(x) (((x) << 8) & 0x00000300) -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_B_0_MSB 11 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_B_0_LSB 10 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_B_0_MASK 0x00000c00 -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_B_0_GET(x) (((x) & 0x00000c00) >> 10) -#define PHY_BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_B_0_SET(x) (((x) << 10) & 0x00000c00) - -/* macros for BB_switch_table_com1 */ -#define PHY_BB_SWITCH_TABLE_COM1_ADDRESS 0x00009964 -#define PHY_BB_SWITCH_TABLE_COM1_OFFSET 0x00009964 -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_IDLE_MSB 3 -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_IDLE_LSB 0 -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_IDLE_MASK 0x0000000f -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_IDLE_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_IDLE_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T1_MSB 7 -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T1_LSB 4 -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T1_MASK 0x000000f0 -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T1_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T1_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T2_MSB 11 -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T2_LSB 8 -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T2_MASK 0x00000f00 -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T2_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T2_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_B_MSB 15 -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_B_LSB 12 -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_B_MASK 0x0000f000 -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_B_GET(x) (((x) & 0x0000f000) >> 12) -#define PHY_BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_B_SET(x) (((x) << 12) & 0x0000f000) - -/* macros for BB_cca_ctrl_2_b0 */ -#define PHY_BB_CCA_CTRL_2_B0_ADDRESS 0x00009968 -#define PHY_BB_CCA_CTRL_2_B0_OFFSET 0x00009968 -#define PHY_BB_CCA_CTRL_2_B0_MINCCAPWR_THR_0_MSB 8 -#define PHY_BB_CCA_CTRL_2_B0_MINCCAPWR_THR_0_LSB 0 -#define PHY_BB_CCA_CTRL_2_B0_MINCCAPWR_THR_0_MASK 0x000001ff -#define PHY_BB_CCA_CTRL_2_B0_MINCCAPWR_THR_0_GET(x) (((x) & 0x000001ff) >> 0) -#define PHY_BB_CCA_CTRL_2_B0_MINCCAPWR_THR_0_SET(x) (((x) << 0) & 0x000001ff) -#define PHY_BB_CCA_CTRL_2_B0_ENABLE_MINCCAPWR_THR_MSB 9 -#define PHY_BB_CCA_CTRL_2_B0_ENABLE_MINCCAPWR_THR_LSB 9 -#define PHY_BB_CCA_CTRL_2_B0_ENABLE_MINCCAPWR_THR_MASK 0x00000200 -#define PHY_BB_CCA_CTRL_2_B0_ENABLE_MINCCAPWR_THR_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_BB_CCA_CTRL_2_B0_ENABLE_MINCCAPWR_THR_SET(x) (((x) << 9) & 0x00000200) -#define PHY_BB_CCA_CTRL_2_B0_NF_GAIN_COMP_0_MSB 17 -#define PHY_BB_CCA_CTRL_2_B0_NF_GAIN_COMP_0_LSB 10 -#define PHY_BB_CCA_CTRL_2_B0_NF_GAIN_COMP_0_MASK 0x0003fc00 -#define PHY_BB_CCA_CTRL_2_B0_NF_GAIN_COMP_0_GET(x) (((x) & 0x0003fc00) >> 10) -#define PHY_BB_CCA_CTRL_2_B0_NF_GAIN_COMP_0_SET(x) (((x) << 10) & 0x0003fc00) -#define PHY_BB_CCA_CTRL_2_B0_THRESH62_MODE_MSB 18 -#define PHY_BB_CCA_CTRL_2_B0_THRESH62_MODE_LSB 18 -#define PHY_BB_CCA_CTRL_2_B0_THRESH62_MODE_MASK 0x00040000 -#define PHY_BB_CCA_CTRL_2_B0_THRESH62_MODE_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_BB_CCA_CTRL_2_B0_THRESH62_MODE_SET(x) (((x) << 18) & 0x00040000) - -/* macros for BB_switch_table_com2 */ -#define PHY_BB_SWITCH_TABLE_COM2_ADDRESS 0x0000996c -#define PHY_BB_SWITCH_TABLE_COM2_OFFSET 0x0000996c -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1NXAL1_MSB 3 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1NXAL1_LSB 0 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1NXAL1_MASK 0x0000000f -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1NXAL1_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1NXAL1_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2NXAL1_MSB 7 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2NXAL1_LSB 4 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2NXAL1_MASK 0x000000f0 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2NXAL1_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2NXAL1_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1XAL1_MSB 11 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1XAL1_LSB 8 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1XAL1_MASK 0x00000f00 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1XAL1_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1XAL1_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2XAL1_MSB 15 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2XAL1_LSB 12 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2XAL1_MASK 0x0000f000 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2XAL1_GET(x) (((x) & 0x0000f000) >> 12) -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2XAL1_SET(x) (((x) << 12) & 0x0000f000) -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1NXAL2_MSB 19 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1NXAL2_LSB 16 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1NXAL2_MASK 0x000f0000 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1NXAL2_GET(x) (((x) & 0x000f0000) >> 16) -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1NXAL2_SET(x) (((x) << 16) & 0x000f0000) -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2NXAL2_MSB 23 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2NXAL2_LSB 20 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2NXAL2_MASK 0x00f00000 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2NXAL2_GET(x) (((x) & 0x00f00000) >> 20) -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2NXAL2_SET(x) (((x) << 20) & 0x00f00000) -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1XAL2_MSB 27 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1XAL2_LSB 24 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1XAL2_MASK 0x0f000000 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1XAL2_GET(x) (((x) & 0x0f000000) >> 24) -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1XAL2_SET(x) (((x) << 24) & 0x0f000000) -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2XAL2_MSB 31 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2XAL2_LSB 28 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2XAL2_MASK 0xf0000000 -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2XAL2_GET(x) (((x) & 0xf0000000) >> 28) -#define PHY_BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2XAL2_SET(x) (((x) << 28) & 0xf0000000) - -/* macros for BB_restart */ -#define PHY_BB_RESTART_ADDRESS 0x00009970 -#define PHY_BB_RESTART_OFFSET 0x00009970 -#define PHY_BB_RESTART_ENABLE_RESTART_MSB 0 -#define PHY_BB_RESTART_ENABLE_RESTART_LSB 0 -#define PHY_BB_RESTART_ENABLE_RESTART_MASK 0x00000001 -#define PHY_BB_RESTART_ENABLE_RESTART_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_RESTART_ENABLE_RESTART_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_RESTART_RESTART_LGFIRPWR_DELTA_MSB 5 -#define PHY_BB_RESTART_RESTART_LGFIRPWR_DELTA_LSB 1 -#define PHY_BB_RESTART_RESTART_LGFIRPWR_DELTA_MASK 0x0000003e -#define PHY_BB_RESTART_RESTART_LGFIRPWR_DELTA_GET(x) (((x) & 0x0000003e) >> 1) -#define PHY_BB_RESTART_RESTART_LGFIRPWR_DELTA_SET(x) (((x) << 1) & 0x0000003e) -#define PHY_BB_RESTART_ENABLE_PWR_DROP_ERR_MSB 6 -#define PHY_BB_RESTART_ENABLE_PWR_DROP_ERR_LSB 6 -#define PHY_BB_RESTART_ENABLE_PWR_DROP_ERR_MASK 0x00000040 -#define PHY_BB_RESTART_ENABLE_PWR_DROP_ERR_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_BB_RESTART_ENABLE_PWR_DROP_ERR_SET(x) (((x) << 6) & 0x00000040) -#define PHY_BB_RESTART_PWRDROP_LGFIRPWR_DELTA_MSB 11 -#define PHY_BB_RESTART_PWRDROP_LGFIRPWR_DELTA_LSB 7 -#define PHY_BB_RESTART_PWRDROP_LGFIRPWR_DELTA_MASK 0x00000f80 -#define PHY_BB_RESTART_PWRDROP_LGFIRPWR_DELTA_GET(x) (((x) & 0x00000f80) >> 7) -#define PHY_BB_RESTART_PWRDROP_LGFIRPWR_DELTA_SET(x) (((x) << 7) & 0x00000f80) -#define PHY_BB_RESTART_OFDM_CCK_RSSI_BIAS_MSB 17 -#define PHY_BB_RESTART_OFDM_CCK_RSSI_BIAS_LSB 12 -#define PHY_BB_RESTART_OFDM_CCK_RSSI_BIAS_MASK 0x0003f000 -#define PHY_BB_RESTART_OFDM_CCK_RSSI_BIAS_GET(x) (((x) & 0x0003f000) >> 12) -#define PHY_BB_RESTART_OFDM_CCK_RSSI_BIAS_SET(x) (((x) << 12) & 0x0003f000) -#define PHY_BB_RESTART_ANT_FAST_DIV_GC_LIMIT_MSB 20 -#define PHY_BB_RESTART_ANT_FAST_DIV_GC_LIMIT_LSB 18 -#define PHY_BB_RESTART_ANT_FAST_DIV_GC_LIMIT_MASK 0x001c0000 -#define PHY_BB_RESTART_ANT_FAST_DIV_GC_LIMIT_GET(x) (((x) & 0x001c0000) >> 18) -#define PHY_BB_RESTART_ANT_FAST_DIV_GC_LIMIT_SET(x) (((x) << 18) & 0x001c0000) -#define PHY_BB_RESTART_ENABLE_ANT_FAST_DIV_M2FLAG_MSB 21 -#define PHY_BB_RESTART_ENABLE_ANT_FAST_DIV_M2FLAG_LSB 21 -#define PHY_BB_RESTART_ENABLE_ANT_FAST_DIV_M2FLAG_MASK 0x00200000 -#define PHY_BB_RESTART_ENABLE_ANT_FAST_DIV_M2FLAG_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_BB_RESTART_ENABLE_ANT_FAST_DIV_M2FLAG_SET(x) (((x) << 21) & 0x00200000) -#define PHY_BB_RESTART_WEAK_RSSI_VOTE_THR_MSB 28 -#define PHY_BB_RESTART_WEAK_RSSI_VOTE_THR_LSB 22 -#define PHY_BB_RESTART_WEAK_RSSI_VOTE_THR_MASK 0x1fc00000 -#define PHY_BB_RESTART_WEAK_RSSI_VOTE_THR_GET(x) (((x) & 0x1fc00000) >> 22) -#define PHY_BB_RESTART_WEAK_RSSI_VOTE_THR_SET(x) (((x) << 22) & 0x1fc00000) -#define PHY_BB_RESTART_ENABLE_PWR_DROP_ERR_CCK_MSB 29 -#define PHY_BB_RESTART_ENABLE_PWR_DROP_ERR_CCK_LSB 29 -#define PHY_BB_RESTART_ENABLE_PWR_DROP_ERR_CCK_MASK 0x20000000 -#define PHY_BB_RESTART_ENABLE_PWR_DROP_ERR_CCK_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_BB_RESTART_ENABLE_PWR_DROP_ERR_CCK_SET(x) (((x) << 29) & 0x20000000) -#define PHY_BB_RESTART_DISABLE_DC_RESTART_MSB 30 -#define PHY_BB_RESTART_DISABLE_DC_RESTART_LSB 30 -#define PHY_BB_RESTART_DISABLE_DC_RESTART_MASK 0x40000000 -#define PHY_BB_RESTART_DISABLE_DC_RESTART_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_BB_RESTART_DISABLE_DC_RESTART_SET(x) (((x) << 30) & 0x40000000) -#define PHY_BB_RESTART_RESTART_MODE_BW40_MSB 31 -#define PHY_BB_RESTART_RESTART_MODE_BW40_LSB 31 -#define PHY_BB_RESTART_RESTART_MODE_BW40_MASK 0x80000000 -#define PHY_BB_RESTART_RESTART_MODE_BW40_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_RESTART_RESTART_MODE_BW40_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_scrambler_seed */ -#define PHY_BB_SCRAMBLER_SEED_ADDRESS 0x00009978 -#define PHY_BB_SCRAMBLER_SEED_OFFSET 0x00009978 -#define PHY_BB_SCRAMBLER_SEED_FIXED_SCRAMBLER_SEED_MSB 6 -#define PHY_BB_SCRAMBLER_SEED_FIXED_SCRAMBLER_SEED_LSB 0 -#define PHY_BB_SCRAMBLER_SEED_FIXED_SCRAMBLER_SEED_MASK 0x0000007f -#define PHY_BB_SCRAMBLER_SEED_FIXED_SCRAMBLER_SEED_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_BB_SCRAMBLER_SEED_FIXED_SCRAMBLER_SEED_SET(x) (((x) << 0) & 0x0000007f) - -/* macros for BB_rfbus_request */ -#define PHY_BB_RFBUS_REQUEST_ADDRESS 0x0000997c -#define PHY_BB_RFBUS_REQUEST_OFFSET 0x0000997c -#define PHY_BB_RFBUS_REQUEST_RFBUS_REQUEST_MSB 0 -#define PHY_BB_RFBUS_REQUEST_RFBUS_REQUEST_LSB 0 -#define PHY_BB_RFBUS_REQUEST_RFBUS_REQUEST_MASK 0x00000001 -#define PHY_BB_RFBUS_REQUEST_RFBUS_REQUEST_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_RFBUS_REQUEST_RFBUS_REQUEST_SET(x) (((x) << 0) & 0x00000001) - -/* macros for BB_timing_control_11 */ -#define PHY_BB_TIMING_CONTROL_11_ADDRESS 0x000099a0 -#define PHY_BB_TIMING_CONTROL_11_OFFSET 0x000099a0 -#define PHY_BB_TIMING_CONTROL_11_SPUR_DELTA_PHASE_MSB 19 -#define PHY_BB_TIMING_CONTROL_11_SPUR_DELTA_PHASE_LSB 0 -#define PHY_BB_TIMING_CONTROL_11_SPUR_DELTA_PHASE_MASK 0x000fffff -#define PHY_BB_TIMING_CONTROL_11_SPUR_DELTA_PHASE_GET(x) (((x) & 0x000fffff) >> 0) -#define PHY_BB_TIMING_CONTROL_11_SPUR_DELTA_PHASE_SET(x) (((x) << 0) & 0x000fffff) -#define PHY_BB_TIMING_CONTROL_11_SPUR_FREQ_SD_MSB 29 -#define PHY_BB_TIMING_CONTROL_11_SPUR_FREQ_SD_LSB 20 -#define PHY_BB_TIMING_CONTROL_11_SPUR_FREQ_SD_MASK 0x3ff00000 -#define PHY_BB_TIMING_CONTROL_11_SPUR_FREQ_SD_GET(x) (((x) & 0x3ff00000) >> 20) -#define PHY_BB_TIMING_CONTROL_11_SPUR_FREQ_SD_SET(x) (((x) << 20) & 0x3ff00000) -#define PHY_BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_AGC_MSB 30 -#define PHY_BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_AGC_LSB 30 -#define PHY_BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_AGC_MASK 0x40000000 -#define PHY_BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_AGC_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_AGC_SET(x) (((x) << 30) & 0x40000000) -#define PHY_BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_SELFCOR_MSB 31 -#define PHY_BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_SELFCOR_LSB 31 -#define PHY_BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_SELFCOR_MASK 0x80000000 -#define PHY_BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_SELFCOR_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_SELFCOR_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_multichain_enable */ -#define PHY_BB_MULTICHAIN_ENABLE_ADDRESS 0x000099a4 -#define PHY_BB_MULTICHAIN_ENABLE_OFFSET 0x000099a4 -#define PHY_BB_MULTICHAIN_ENABLE_RX_CHAIN_MASK_MSB 2 -#define PHY_BB_MULTICHAIN_ENABLE_RX_CHAIN_MASK_LSB 0 -#define PHY_BB_MULTICHAIN_ENABLE_RX_CHAIN_MASK_MASK 0x00000007 -#define PHY_BB_MULTICHAIN_ENABLE_RX_CHAIN_MASK_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_BB_MULTICHAIN_ENABLE_RX_CHAIN_MASK_SET(x) (((x) << 0) & 0x00000007) - -/* macros for BB_multichain_control */ -#define PHY_BB_MULTICHAIN_CONTROL_ADDRESS 0x000099a8 -#define PHY_BB_MULTICHAIN_CONTROL_OFFSET 0x000099a8 -#define PHY_BB_MULTICHAIN_CONTROL_FORCE_ANALOG_GAIN_DIFF_MSB 0 -#define PHY_BB_MULTICHAIN_CONTROL_FORCE_ANALOG_GAIN_DIFF_LSB 0 -#define PHY_BB_MULTICHAIN_CONTROL_FORCE_ANALOG_GAIN_DIFF_MASK 0x00000001 -#define PHY_BB_MULTICHAIN_CONTROL_FORCE_ANALOG_GAIN_DIFF_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_MULTICHAIN_CONTROL_FORCE_ANALOG_GAIN_DIFF_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_01_MSB 7 -#define PHY_BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_01_LSB 1 -#define PHY_BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_01_MASK 0x000000fe -#define PHY_BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_01_GET(x) (((x) & 0x000000fe) >> 1) -#define PHY_BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_01_SET(x) (((x) << 1) & 0x000000fe) -#define PHY_BB_MULTICHAIN_CONTROL_SYNC_SYNTHON_MSB 8 -#define PHY_BB_MULTICHAIN_CONTROL_SYNC_SYNTHON_LSB 8 -#define PHY_BB_MULTICHAIN_CONTROL_SYNC_SYNTHON_MASK 0x00000100 -#define PHY_BB_MULTICHAIN_CONTROL_SYNC_SYNTHON_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_BB_MULTICHAIN_CONTROL_SYNC_SYNTHON_SET(x) (((x) << 8) & 0x00000100) -#define PHY_BB_MULTICHAIN_CONTROL_USE_POSEDGE_REFCLK_MSB 9 -#define PHY_BB_MULTICHAIN_CONTROL_USE_POSEDGE_REFCLK_LSB 9 -#define PHY_BB_MULTICHAIN_CONTROL_USE_POSEDGE_REFCLK_MASK 0x00000200 -#define PHY_BB_MULTICHAIN_CONTROL_USE_POSEDGE_REFCLK_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_BB_MULTICHAIN_CONTROL_USE_POSEDGE_REFCLK_SET(x) (((x) << 9) & 0x00000200) -#define PHY_BB_MULTICHAIN_CONTROL_CF_SHORT_SAT_MSB 20 -#define PHY_BB_MULTICHAIN_CONTROL_CF_SHORT_SAT_LSB 10 -#define PHY_BB_MULTICHAIN_CONTROL_CF_SHORT_SAT_MASK 0x001ffc00 -#define PHY_BB_MULTICHAIN_CONTROL_CF_SHORT_SAT_GET(x) (((x) & 0x001ffc00) >> 10) -#define PHY_BB_MULTICHAIN_CONTROL_CF_SHORT_SAT_SET(x) (((x) << 10) & 0x001ffc00) -#define PHY_BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_02_MSB 28 -#define PHY_BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_02_LSB 22 -#define PHY_BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_02_MASK 0x1fc00000 -#define PHY_BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_02_GET(x) (((x) & 0x1fc00000) >> 22) -#define PHY_BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_02_SET(x) (((x) << 22) & 0x1fc00000) -#define PHY_BB_MULTICHAIN_CONTROL_FORCE_SIGMA_ZERO_MSB 29 -#define PHY_BB_MULTICHAIN_CONTROL_FORCE_SIGMA_ZERO_LSB 29 -#define PHY_BB_MULTICHAIN_CONTROL_FORCE_SIGMA_ZERO_MASK 0x20000000 -#define PHY_BB_MULTICHAIN_CONTROL_FORCE_SIGMA_ZERO_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_BB_MULTICHAIN_CONTROL_FORCE_SIGMA_ZERO_SET(x) (((x) << 29) & 0x20000000) - -/* macros for BB_multichain_gain_ctrl */ -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ADDRESS 0x000099ac -#define PHY_BB_MULTICHAIN_GAIN_CTRL_OFFSET 0x000099ac -#define PHY_BB_MULTICHAIN_GAIN_CTRL_QUICKDROP_LOW_MSB 7 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_QUICKDROP_LOW_LSB 0 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_QUICKDROP_LOW_MASK 0x000000ff -#define PHY_BB_MULTICHAIN_GAIN_CTRL_QUICKDROP_LOW_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_QUICKDROP_LOW_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ENABLE_CHECK_STRONG_ANT_MSB 8 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ENABLE_CHECK_STRONG_ANT_LSB 8 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ENABLE_CHECK_STRONG_ANT_MASK 0x00000100 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ENABLE_CHECK_STRONG_ANT_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ENABLE_CHECK_STRONG_ANT_SET(x) (((x) << 8) & 0x00000100) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_FAST_DIV_BIAS_MSB 14 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_FAST_DIV_BIAS_LSB 9 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_FAST_DIV_BIAS_MASK 0x00007e00 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_FAST_DIV_BIAS_GET(x) (((x) & 0x00007e00) >> 9) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_FAST_DIV_BIAS_SET(x) (((x) << 9) & 0x00007e00) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_SNR_MSB 20 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_SNR_LSB 15 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_SNR_MASK 0x001f8000 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_SNR_GET(x) (((x) & 0x001f8000) >> 15) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_SNR_SET(x) (((x) << 15) & 0x001f8000) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_ENA_MSB 21 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_ENA_LSB 21 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_ENA_MASK 0x00200000 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_ENA_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_ENA_SET(x) (((x) << 21) & 0x00200000) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_MODE_MSB 22 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_MODE_LSB 22 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_MODE_MASK 0x00400000 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_MODE_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_MODE_SET(x) (((x) << 22) & 0x00400000) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_SW_RX_PROT_MSB 23 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_SW_RX_PROT_LSB 23 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_SW_RX_PROT_MASK 0x00800000 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_SW_RX_PROT_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_SW_RX_PROT_SET(x) (((x) << 23) & 0x00800000) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_DIV_LNADIV_MSB 24 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_DIV_LNADIV_LSB 24 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_DIV_LNADIV_MASK 0x01000000 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_DIV_LNADIV_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_DIV_LNADIV_SET(x) (((x) << 24) & 0x01000000) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_LNACONF_MSB 26 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_LNACONF_LSB 25 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_LNACONF_MASK 0x06000000 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_LNACONF_GET(x) (((x) & 0x06000000) >> 25) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_LNACONF_SET(x) (((x) << 25) & 0x06000000) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_LNACONF_MSB 28 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_LNACONF_LSB 27 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_LNACONF_MASK 0x18000000 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_LNACONF_GET(x) (((x) & 0x18000000) >> 27) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_LNACONF_SET(x) (((x) << 27) & 0x18000000) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_GAINTB_MSB 29 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_GAINTB_LSB 29 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_GAINTB_MASK 0x20000000 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_GAINTB_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_GAINTB_SET(x) (((x) << 29) & 0x20000000) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_GAINTB_MSB 30 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_GAINTB_LSB 30 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_GAINTB_MASK 0x40000000 -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_GAINTB_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_GAINTB_SET(x) (((x) << 30) & 0x40000000) - -/* macros for BB_adc_gain_dc_corr_b0 */ -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADDRESS 0x000099b4 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_OFFSET 0x000099b4 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_Q_COEFF_0_MSB 5 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_Q_COEFF_0_LSB 0 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_Q_COEFF_0_MASK 0x0000003f -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_Q_COEFF_0_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_Q_COEFF_0_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_I_COEFF_0_MSB 11 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_I_COEFF_0_LSB 6 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_I_COEFF_0_MASK 0x00000fc0 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_I_COEFF_0_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_I_COEFF_0_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_Q_COEFF_0_MSB 20 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_Q_COEFF_0_LSB 12 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_Q_COEFF_0_MASK 0x001ff000 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_Q_COEFF_0_GET(x) (((x) & 0x001ff000) >> 12) -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_Q_COEFF_0_SET(x) (((x) << 12) & 0x001ff000) -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_I_COEFF_0_MSB 29 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_I_COEFF_0_LSB 21 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_I_COEFF_0_MASK 0x3fe00000 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_I_COEFF_0_GET(x) (((x) & 0x3fe00000) >> 21) -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_I_COEFF_0_SET(x) (((x) << 21) & 0x3fe00000) -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_ENABLE_MSB 30 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_ENABLE_LSB 30 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_ENABLE_MASK 0x40000000 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_ENABLE_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_ENABLE_SET(x) (((x) << 30) & 0x40000000) -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_ENABLE_MSB 31 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_ENABLE_LSB 31 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_ENABLE_MASK 0x80000000 -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_ENABLE_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_ENABLE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_ext_chan_pwr_thr_1 */ -#define PHY_BB_EXT_CHAN_PWR_THR_1_ADDRESS 0x000099b8 -#define PHY_BB_EXT_CHAN_PWR_THR_1_OFFSET 0x000099b8 -#define PHY_BB_EXT_CHAN_PWR_THR_1_THRESH62_EXT_MSB 7 -#define PHY_BB_EXT_CHAN_PWR_THR_1_THRESH62_EXT_LSB 0 -#define PHY_BB_EXT_CHAN_PWR_THR_1_THRESH62_EXT_MASK 0x000000ff -#define PHY_BB_EXT_CHAN_PWR_THR_1_THRESH62_EXT_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_EXT_CHAN_PWR_THR_1_THRESH62_EXT_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_MINGAINIDX_MSB 15 -#define PHY_BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_MINGAINIDX_LSB 8 -#define PHY_BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_MINGAINIDX_MASK 0x0000ff00 -#define PHY_BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_MINGAINIDX_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_MINGAINIDX_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTAGAINIDX_MSB 20 -#define PHY_BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTAGAINIDX_LSB 16 -#define PHY_BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTAGAINIDX_MASK 0x001f0000 -#define PHY_BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTAGAINIDX_GET(x) (((x) & 0x001f0000) >> 16) -#define PHY_BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTAGAINIDX_SET(x) (((x) << 16) & 0x001f0000) -#define PHY_BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTANF_MSB 26 -#define PHY_BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTANF_LSB 21 -#define PHY_BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTANF_MASK 0x07e00000 -#define PHY_BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTANF_GET(x) (((x) & 0x07e00000) >> 21) -#define PHY_BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTANF_SET(x) (((x) << 21) & 0x07e00000) - -/* macros for BB_ext_chan_pwr_thr_2_b0 */ -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_ADDRESS 0x000099bc -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_OFFSET 0x000099bc -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_CF_MAXCCAPWR_EXT_0_MSB 8 -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_CF_MAXCCAPWR_EXT_0_LSB 0 -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_CF_MAXCCAPWR_EXT_0_MASK 0x000001ff -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_CF_MAXCCAPWR_EXT_0_GET(x) (((x) & 0x000001ff) >> 0) -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_CF_MAXCCAPWR_EXT_0_SET(x) (((x) << 0) & 0x000001ff) -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_CYCPWR_THR1_EXT_MSB 15 -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_CYCPWR_THR1_EXT_LSB 9 -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_CYCPWR_THR1_EXT_MASK 0x0000fe00 -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_CYCPWR_THR1_EXT_GET(x) (((x) & 0x0000fe00) >> 9) -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_CYCPWR_THR1_EXT_SET(x) (((x) << 9) & 0x0000fe00) -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_MINCCAPWR_EXT_0_MSB 24 -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_MINCCAPWR_EXT_0_LSB 16 -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_MINCCAPWR_EXT_0_MASK 0x01ff0000 -#define PHY_BB_EXT_CHAN_PWR_THR_2_B0_MINCCAPWR_EXT_0_GET(x) (((x) & 0x01ff0000) >> 16) - -/* macros for BB_ext_chan_scorr_thr */ -#define PHY_BB_EXT_CHAN_SCORR_THR_ADDRESS 0x000099c0 -#define PHY_BB_EXT_CHAN_SCORR_THR_OFFSET 0x000099c0 -#define PHY_BB_EXT_CHAN_SCORR_THR_M1_THRES_EXT_MSB 6 -#define PHY_BB_EXT_CHAN_SCORR_THR_M1_THRES_EXT_LSB 0 -#define PHY_BB_EXT_CHAN_SCORR_THR_M1_THRES_EXT_MASK 0x0000007f -#define PHY_BB_EXT_CHAN_SCORR_THR_M1_THRES_EXT_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_BB_EXT_CHAN_SCORR_THR_M1_THRES_EXT_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_BB_EXT_CHAN_SCORR_THR_M2_THRES_EXT_MSB 13 -#define PHY_BB_EXT_CHAN_SCORR_THR_M2_THRES_EXT_LSB 7 -#define PHY_BB_EXT_CHAN_SCORR_THR_M2_THRES_EXT_MASK 0x00003f80 -#define PHY_BB_EXT_CHAN_SCORR_THR_M2_THRES_EXT_GET(x) (((x) & 0x00003f80) >> 7) -#define PHY_BB_EXT_CHAN_SCORR_THR_M2_THRES_EXT_SET(x) (((x) << 7) & 0x00003f80) -#define PHY_BB_EXT_CHAN_SCORR_THR_M1_THRES_LOW_EXT_MSB 20 -#define PHY_BB_EXT_CHAN_SCORR_THR_M1_THRES_LOW_EXT_LSB 14 -#define PHY_BB_EXT_CHAN_SCORR_THR_M1_THRES_LOW_EXT_MASK 0x001fc000 -#define PHY_BB_EXT_CHAN_SCORR_THR_M1_THRES_LOW_EXT_GET(x) (((x) & 0x001fc000) >> 14) -#define PHY_BB_EXT_CHAN_SCORR_THR_M1_THRES_LOW_EXT_SET(x) (((x) << 14) & 0x001fc000) -#define PHY_BB_EXT_CHAN_SCORR_THR_M2_THRES_LOW_EXT_MSB 27 -#define PHY_BB_EXT_CHAN_SCORR_THR_M2_THRES_LOW_EXT_LSB 21 -#define PHY_BB_EXT_CHAN_SCORR_THR_M2_THRES_LOW_EXT_MASK 0x0fe00000 -#define PHY_BB_EXT_CHAN_SCORR_THR_M2_THRES_LOW_EXT_GET(x) (((x) & 0x0fe00000) >> 21) -#define PHY_BB_EXT_CHAN_SCORR_THR_M2_THRES_LOW_EXT_SET(x) (((x) << 21) & 0x0fe00000) -#define PHY_BB_EXT_CHAN_SCORR_THR_SPUR_SUBCHANNEL_SD_MSB 28 -#define PHY_BB_EXT_CHAN_SCORR_THR_SPUR_SUBCHANNEL_SD_LSB 28 -#define PHY_BB_EXT_CHAN_SCORR_THR_SPUR_SUBCHANNEL_SD_MASK 0x10000000 -#define PHY_BB_EXT_CHAN_SCORR_THR_SPUR_SUBCHANNEL_SD_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_BB_EXT_CHAN_SCORR_THR_SPUR_SUBCHANNEL_SD_SET(x) (((x) << 28) & 0x10000000) - -/* macros for BB_ext_chan_detect_win */ -#define PHY_BB_EXT_CHAN_DETECT_WIN_ADDRESS 0x000099c4 -#define PHY_BB_EXT_CHAN_DETECT_WIN_OFFSET 0x000099c4 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_MSB 3 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_LSB 0 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_MASK 0x0000000f -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_LOW_MSB 7 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_LOW_LSB 4 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_LOW_MASK 0x000000f0 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_LOW_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_LOW_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_CCK_MSB 12 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_CCK_LSB 8 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_CCK_MASK 0x00001f00 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_CCK_GET(x) (((x) & 0x00001f00) >> 8) -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_CCK_SET(x) (((x) << 8) & 0x00001f00) -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_20H_COUNT_MSB 15 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_20H_COUNT_LSB 13 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_20H_COUNT_MASK 0x0000e000 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_20H_COUNT_GET(x) (((x) & 0x0000e000) >> 13) -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_20H_COUNT_SET(x) (((x) << 13) & 0x0000e000) -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_EXT_BLK_COUNT_MSB 18 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_EXT_BLK_COUNT_LSB 16 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_EXT_BLK_COUNT_MASK 0x00070000 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_EXT_BLK_COUNT_GET(x) (((x) & 0x00070000) >> 16) -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_EXT_BLK_COUNT_SET(x) (((x) << 16) & 0x00070000) -#define PHY_BB_EXT_CHAN_DETECT_WIN_WEAK_SIG_THR_CCK_EXT_MSB 24 -#define PHY_BB_EXT_CHAN_DETECT_WIN_WEAK_SIG_THR_CCK_EXT_LSB 19 -#define PHY_BB_EXT_CHAN_DETECT_WIN_WEAK_SIG_THR_CCK_EXT_MASK 0x01f80000 -#define PHY_BB_EXT_CHAN_DETECT_WIN_WEAK_SIG_THR_CCK_EXT_GET(x) (((x) & 0x01f80000) >> 19) -#define PHY_BB_EXT_CHAN_DETECT_WIN_WEAK_SIG_THR_CCK_EXT_SET(x) (((x) << 19) & 0x01f80000) -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_THRESH_MSB 28 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_THRESH_LSB 25 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_THRESH_MASK 0x1e000000 -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_THRESH_GET(x) (((x) & 0x1e000000) >> 25) -#define PHY_BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_THRESH_SET(x) (((x) << 25) & 0x1e000000) - -/* macros for BB_pwr_thr_20_40_det */ -#define PHY_BB_PWR_THR_20_40_DET_ADDRESS 0x000099c8 -#define PHY_BB_PWR_THR_20_40_DET_OFFSET 0x000099c8 -#define PHY_BB_PWR_THR_20_40_DET_PWRDIFF40_THRSTR_MSB 4 -#define PHY_BB_PWR_THR_20_40_DET_PWRDIFF40_THRSTR_LSB 0 -#define PHY_BB_PWR_THR_20_40_DET_PWRDIFF40_THRSTR_MASK 0x0000001f -#define PHY_BB_PWR_THR_20_40_DET_PWRDIFF40_THRSTR_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_PWR_THR_20_40_DET_PWRDIFF40_THRSTR_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_PWR_THR_20_40_DET_BLOCKER40_MAX_MSB 10 -#define PHY_BB_PWR_THR_20_40_DET_BLOCKER40_MAX_LSB 5 -#define PHY_BB_PWR_THR_20_40_DET_BLOCKER40_MAX_MASK 0x000007e0 -#define PHY_BB_PWR_THR_20_40_DET_BLOCKER40_MAX_GET(x) (((x) & 0x000007e0) >> 5) -#define PHY_BB_PWR_THR_20_40_DET_BLOCKER40_MAX_SET(x) (((x) << 5) & 0x000007e0) -#define PHY_BB_PWR_THR_20_40_DET_DET40_PWRSTEP_MAX_MSB 15 -#define PHY_BB_PWR_THR_20_40_DET_DET40_PWRSTEP_MAX_LSB 11 -#define PHY_BB_PWR_THR_20_40_DET_DET40_PWRSTEP_MAX_MASK 0x0000f800 -#define PHY_BB_PWR_THR_20_40_DET_DET40_PWRSTEP_MAX_GET(x) (((x) & 0x0000f800) >> 11) -#define PHY_BB_PWR_THR_20_40_DET_DET40_PWRSTEP_MAX_SET(x) (((x) << 11) & 0x0000f800) -#define PHY_BB_PWR_THR_20_40_DET_DET40_THR_SNR_MSB 23 -#define PHY_BB_PWR_THR_20_40_DET_DET40_THR_SNR_LSB 16 -#define PHY_BB_PWR_THR_20_40_DET_DET40_THR_SNR_MASK 0x00ff0000 -#define PHY_BB_PWR_THR_20_40_DET_DET40_THR_SNR_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_BB_PWR_THR_20_40_DET_DET40_THR_SNR_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_BB_PWR_THR_20_40_DET_DET40_PRI_BIAS_MSB 28 -#define PHY_BB_PWR_THR_20_40_DET_DET40_PRI_BIAS_LSB 24 -#define PHY_BB_PWR_THR_20_40_DET_DET40_PRI_BIAS_MASK 0x1f000000 -#define PHY_BB_PWR_THR_20_40_DET_DET40_PRI_BIAS_GET(x) (((x) & 0x1f000000) >> 24) -#define PHY_BB_PWR_THR_20_40_DET_DET40_PRI_BIAS_SET(x) (((x) << 24) & 0x1f000000) -#define PHY_BB_PWR_THR_20_40_DET_PWRSTEP40_ENA_MSB 29 -#define PHY_BB_PWR_THR_20_40_DET_PWRSTEP40_ENA_LSB 29 -#define PHY_BB_PWR_THR_20_40_DET_PWRSTEP40_ENA_MASK 0x20000000 -#define PHY_BB_PWR_THR_20_40_DET_PWRSTEP40_ENA_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_BB_PWR_THR_20_40_DET_PWRSTEP40_ENA_SET(x) (((x) << 29) & 0x20000000) -#define PHY_BB_PWR_THR_20_40_DET_LOWSNR40_ENA_MSB 30 -#define PHY_BB_PWR_THR_20_40_DET_LOWSNR40_ENA_LSB 30 -#define PHY_BB_PWR_THR_20_40_DET_LOWSNR40_ENA_MASK 0x40000000 -#define PHY_BB_PWR_THR_20_40_DET_LOWSNR40_ENA_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_BB_PWR_THR_20_40_DET_LOWSNR40_ENA_SET(x) (((x) << 30) & 0x40000000) - -/* macros for BB_short_gi_delta_slope */ -#define PHY_BB_SHORT_GI_DELTA_SLOPE_ADDRESS 0x000099d0 -#define PHY_BB_SHORT_GI_DELTA_SLOPE_OFFSET 0x000099d0 -#define PHY_BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_EXP_SHORT_GI_MSB 3 -#define PHY_BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_EXP_SHORT_GI_LSB 0 -#define PHY_BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_EXP_SHORT_GI_MASK 0x0000000f -#define PHY_BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_EXP_SHORT_GI_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_EXP_SHORT_GI_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_MAN_SHORT_GI_MSB 18 -#define PHY_BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_MAN_SHORT_GI_LSB 4 -#define PHY_BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_MAN_SHORT_GI_MASK 0x0007fff0 -#define PHY_BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_MAN_SHORT_GI_GET(x) (((x) & 0x0007fff0) >> 4) -#define PHY_BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_MAN_SHORT_GI_SET(x) (((x) << 4) & 0x0007fff0) - -/* macros for BB_chaninfo_ctrl */ -#define PHY_BB_CHANINFO_CTRL_ADDRESS 0x000099dc -#define PHY_BB_CHANINFO_CTRL_OFFSET 0x000099dc -#define PHY_BB_CHANINFO_CTRL_CAPTURE_CHAN_INFO_MSB 0 -#define PHY_BB_CHANINFO_CTRL_CAPTURE_CHAN_INFO_LSB 0 -#define PHY_BB_CHANINFO_CTRL_CAPTURE_CHAN_INFO_MASK 0x00000001 -#define PHY_BB_CHANINFO_CTRL_CAPTURE_CHAN_INFO_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_CHANINFO_CTRL_CAPTURE_CHAN_INFO_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_CHANINFO_CTRL_DISABLE_CHANINFOMEM_MSB 1 -#define PHY_BB_CHANINFO_CTRL_DISABLE_CHANINFOMEM_LSB 1 -#define PHY_BB_CHANINFO_CTRL_DISABLE_CHANINFOMEM_MASK 0x00000002 -#define PHY_BB_CHANINFO_CTRL_DISABLE_CHANINFOMEM_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_CHANINFO_CTRL_DISABLE_CHANINFOMEM_SET(x) (((x) << 1) & 0x00000002) - -/* macros for BB_heavy_clip_ctrl */ -#define PHY_BB_HEAVY_CLIP_CTRL_ADDRESS 0x000099e0 -#define PHY_BB_HEAVY_CLIP_CTRL_OFFSET 0x000099e0 -#define PHY_BB_HEAVY_CLIP_CTRL_CF_HEAVY_CLIP_ENABLE_MSB 8 -#define PHY_BB_HEAVY_CLIP_CTRL_CF_HEAVY_CLIP_ENABLE_LSB 0 -#define PHY_BB_HEAVY_CLIP_CTRL_CF_HEAVY_CLIP_ENABLE_MASK 0x000001ff -#define PHY_BB_HEAVY_CLIP_CTRL_CF_HEAVY_CLIP_ENABLE_GET(x) (((x) & 0x000001ff) >> 0) -#define PHY_BB_HEAVY_CLIP_CTRL_CF_HEAVY_CLIP_ENABLE_SET(x) (((x) << 0) & 0x000001ff) -#define PHY_BB_HEAVY_CLIP_CTRL_PRE_EMP_HT40_ENABLE_MSB 9 -#define PHY_BB_HEAVY_CLIP_CTRL_PRE_EMP_HT40_ENABLE_LSB 9 -#define PHY_BB_HEAVY_CLIP_CTRL_PRE_EMP_HT40_ENABLE_MASK 0x00000200 -#define PHY_BB_HEAVY_CLIP_CTRL_PRE_EMP_HT40_ENABLE_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_BB_HEAVY_CLIP_CTRL_PRE_EMP_HT40_ENABLE_SET(x) (((x) << 9) & 0x00000200) - -/* macros for BB_heavy_clip_20 */ -#define PHY_BB_HEAVY_CLIP_20_ADDRESS 0x000099e4 -#define PHY_BB_HEAVY_CLIP_20_OFFSET 0x000099e4 -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_0_MSB 7 -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_0_LSB 0 -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_0_MASK 0x000000ff -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_0_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_0_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_1_MSB 15 -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_1_LSB 8 -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_1_MASK 0x0000ff00 -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_1_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_1_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_2_MSB 23 -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_2_LSB 16 -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_2_MASK 0x00ff0000 -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_2_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_2_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_3_MSB 31 -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_3_LSB 24 -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_3_MASK 0xff000000 -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_3_GET(x) (((x) & 0xff000000) >> 24) -#define PHY_BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_3_SET(x) (((x) << 24) & 0xff000000) - -/* macros for BB_heavy_clip_40 */ -#define PHY_BB_HEAVY_CLIP_40_ADDRESS 0x000099e8 -#define PHY_BB_HEAVY_CLIP_40_OFFSET 0x000099e8 -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_4_MSB 7 -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_4_LSB 0 -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_4_MASK 0x000000ff -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_4_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_4_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_5_MSB 15 -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_5_LSB 8 -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_5_MASK 0x0000ff00 -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_5_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_5_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_6_MSB 23 -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_6_LSB 16 -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_6_MASK 0x00ff0000 -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_6_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_6_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_7_MSB 31 -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_7_LSB 24 -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_7_MASK 0xff000000 -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_7_GET(x) (((x) & 0xff000000) >> 24) -#define PHY_BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_7_SET(x) (((x) << 24) & 0xff000000) - -/* macros for BB_rifs_srch */ -#define PHY_BB_RIFS_SRCH_ADDRESS 0x000099ec -#define PHY_BB_RIFS_SRCH_OFFSET 0x000099ec -#define PHY_BB_RIFS_SRCH_HEAVY_CLIP_FACTOR_XR_MSB 7 -#define PHY_BB_RIFS_SRCH_HEAVY_CLIP_FACTOR_XR_LSB 0 -#define PHY_BB_RIFS_SRCH_HEAVY_CLIP_FACTOR_XR_MASK 0x000000ff -#define PHY_BB_RIFS_SRCH_HEAVY_CLIP_FACTOR_XR_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_RIFS_SRCH_HEAVY_CLIP_FACTOR_XR_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_RIFS_SRCH_INIT_GAIN_DB_OFFSET_MSB 15 -#define PHY_BB_RIFS_SRCH_INIT_GAIN_DB_OFFSET_LSB 8 -#define PHY_BB_RIFS_SRCH_INIT_GAIN_DB_OFFSET_MASK 0x0000ff00 -#define PHY_BB_RIFS_SRCH_INIT_GAIN_DB_OFFSET_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_RIFS_SRCH_INIT_GAIN_DB_OFFSET_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_RIFS_SRCH_RIFS_INIT_DELAY_MSB 25 -#define PHY_BB_RIFS_SRCH_RIFS_INIT_DELAY_LSB 16 -#define PHY_BB_RIFS_SRCH_RIFS_INIT_DELAY_MASK 0x03ff0000 -#define PHY_BB_RIFS_SRCH_RIFS_INIT_DELAY_GET(x) (((x) & 0x03ff0000) >> 16) -#define PHY_BB_RIFS_SRCH_RIFS_INIT_DELAY_SET(x) (((x) << 16) & 0x03ff0000) -#define PHY_BB_RIFS_SRCH_RIFS_DISABLE_PWRLOW_GC_MSB 26 -#define PHY_BB_RIFS_SRCH_RIFS_DISABLE_PWRLOW_GC_LSB 26 -#define PHY_BB_RIFS_SRCH_RIFS_DISABLE_PWRLOW_GC_MASK 0x04000000 -#define PHY_BB_RIFS_SRCH_RIFS_DISABLE_PWRLOW_GC_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_BB_RIFS_SRCH_RIFS_DISABLE_PWRLOW_GC_SET(x) (((x) << 26) & 0x04000000) -#define PHY_BB_RIFS_SRCH_RIFS_DISABLE_CCK_DET_MSB 27 -#define PHY_BB_RIFS_SRCH_RIFS_DISABLE_CCK_DET_LSB 27 -#define PHY_BB_RIFS_SRCH_RIFS_DISABLE_CCK_DET_MASK 0x08000000 -#define PHY_BB_RIFS_SRCH_RIFS_DISABLE_CCK_DET_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_BB_RIFS_SRCH_RIFS_DISABLE_CCK_DET_SET(x) (((x) << 27) & 0x08000000) - -/* macros for BB_iq_adc_cal_mode */ -#define PHY_BB_IQ_ADC_CAL_MODE_ADDRESS 0x000099f0 -#define PHY_BB_IQ_ADC_CAL_MODE_OFFSET 0x000099f0 -#define PHY_BB_IQ_ADC_CAL_MODE_GAIN_DC_IQ_CAL_MODE_MSB 1 -#define PHY_BB_IQ_ADC_CAL_MODE_GAIN_DC_IQ_CAL_MODE_LSB 0 -#define PHY_BB_IQ_ADC_CAL_MODE_GAIN_DC_IQ_CAL_MODE_MASK 0x00000003 -#define PHY_BB_IQ_ADC_CAL_MODE_GAIN_DC_IQ_CAL_MODE_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_BB_IQ_ADC_CAL_MODE_GAIN_DC_IQ_CAL_MODE_SET(x) (((x) << 0) & 0x00000003) -#define PHY_BB_IQ_ADC_CAL_MODE_TEST_CALADCOFF_MSB 2 -#define PHY_BB_IQ_ADC_CAL_MODE_TEST_CALADCOFF_LSB 2 -#define PHY_BB_IQ_ADC_CAL_MODE_TEST_CALADCOFF_MASK 0x00000004 -#define PHY_BB_IQ_ADC_CAL_MODE_TEST_CALADCOFF_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_BB_IQ_ADC_CAL_MODE_TEST_CALADCOFF_SET(x) (((x) << 2) & 0x00000004) - -/* macros for BB_per_chain_csd */ -#define PHY_BB_PER_CHAIN_CSD_ADDRESS 0x000099fc -#define PHY_BB_PER_CHAIN_CSD_OFFSET 0x000099fc -#define PHY_BB_PER_CHAIN_CSD_CSD_CHN1_2CHAINS_MSB 4 -#define PHY_BB_PER_CHAIN_CSD_CSD_CHN1_2CHAINS_LSB 0 -#define PHY_BB_PER_CHAIN_CSD_CSD_CHN1_2CHAINS_MASK 0x0000001f -#define PHY_BB_PER_CHAIN_CSD_CSD_CHN1_2CHAINS_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_PER_CHAIN_CSD_CSD_CHN1_2CHAINS_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_PER_CHAIN_CSD_CSD_CHN1_3CHAINS_MSB 9 -#define PHY_BB_PER_CHAIN_CSD_CSD_CHN1_3CHAINS_LSB 5 -#define PHY_BB_PER_CHAIN_CSD_CSD_CHN1_3CHAINS_MASK 0x000003e0 -#define PHY_BB_PER_CHAIN_CSD_CSD_CHN1_3CHAINS_GET(x) (((x) & 0x000003e0) >> 5) -#define PHY_BB_PER_CHAIN_CSD_CSD_CHN1_3CHAINS_SET(x) (((x) << 5) & 0x000003e0) -#define PHY_BB_PER_CHAIN_CSD_CSD_CHN2_3CHAINS_MSB 14 -#define PHY_BB_PER_CHAIN_CSD_CSD_CHN2_3CHAINS_LSB 10 -#define PHY_BB_PER_CHAIN_CSD_CSD_CHN2_3CHAINS_MASK 0x00007c00 -#define PHY_BB_PER_CHAIN_CSD_CSD_CHN2_3CHAINS_GET(x) (((x) & 0x00007c00) >> 10) -#define PHY_BB_PER_CHAIN_CSD_CSD_CHN2_3CHAINS_SET(x) (((x) << 10) & 0x00007c00) - -/* macros for BB_rx_ocgain */ -#define PHY_BB_RX_OCGAIN_ADDRESS 0x00009a00 -#define PHY_BB_RX_OCGAIN_OFFSET 0x00009a00 -#define PHY_BB_RX_OCGAIN_GAIN_ENTRY_MSB 31 -#define PHY_BB_RX_OCGAIN_GAIN_ENTRY_LSB 0 -#define PHY_BB_RX_OCGAIN_GAIN_ENTRY_MASK 0xffffffff -#define PHY_BB_RX_OCGAIN_GAIN_ENTRY_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_crc */ -#define PHY_BB_TX_CRC_ADDRESS 0x00009c00 -#define PHY_BB_TX_CRC_OFFSET 0x00009c00 -#define PHY_BB_TX_CRC_TX_CRC_MSB 15 -#define PHY_BB_TX_CRC_TX_CRC_LSB 0 -#define PHY_BB_TX_CRC_TX_CRC_MASK 0x0000ffff -#define PHY_BB_TX_CRC_TX_CRC_GET(x) (((x) & 0x0000ffff) >> 0) - -/* macros for BB_iq_adc_meas_0_b0 */ -#define PHY_BB_IQ_ADC_MEAS_0_B0_ADDRESS 0x00009c10 -#define PHY_BB_IQ_ADC_MEAS_0_B0_OFFSET 0x00009c10 -#define PHY_BB_IQ_ADC_MEAS_0_B0_GAIN_DC_IQ_CAL_MEAS_0_0_MSB 31 -#define PHY_BB_IQ_ADC_MEAS_0_B0_GAIN_DC_IQ_CAL_MEAS_0_0_LSB 0 -#define PHY_BB_IQ_ADC_MEAS_0_B0_GAIN_DC_IQ_CAL_MEAS_0_0_MASK 0xffffffff -#define PHY_BB_IQ_ADC_MEAS_0_B0_GAIN_DC_IQ_CAL_MEAS_0_0_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for BB_iq_adc_meas_1_b0 */ -#define PHY_BB_IQ_ADC_MEAS_1_B0_ADDRESS 0x00009c14 -#define PHY_BB_IQ_ADC_MEAS_1_B0_OFFSET 0x00009c14 -#define PHY_BB_IQ_ADC_MEAS_1_B0_GAIN_DC_IQ_CAL_MEAS_1_0_MSB 31 -#define PHY_BB_IQ_ADC_MEAS_1_B0_GAIN_DC_IQ_CAL_MEAS_1_0_LSB 0 -#define PHY_BB_IQ_ADC_MEAS_1_B0_GAIN_DC_IQ_CAL_MEAS_1_0_MASK 0xffffffff -#define PHY_BB_IQ_ADC_MEAS_1_B0_GAIN_DC_IQ_CAL_MEAS_1_0_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for BB_iq_adc_meas_2_b0 */ -#define PHY_BB_IQ_ADC_MEAS_2_B0_ADDRESS 0x00009c18 -#define PHY_BB_IQ_ADC_MEAS_2_B0_OFFSET 0x00009c18 -#define PHY_BB_IQ_ADC_MEAS_2_B0_GAIN_DC_IQ_CAL_MEAS_2_0_MSB 31 -#define PHY_BB_IQ_ADC_MEAS_2_B0_GAIN_DC_IQ_CAL_MEAS_2_0_LSB 0 -#define PHY_BB_IQ_ADC_MEAS_2_B0_GAIN_DC_IQ_CAL_MEAS_2_0_MASK 0xffffffff -#define PHY_BB_IQ_ADC_MEAS_2_B0_GAIN_DC_IQ_CAL_MEAS_2_0_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for BB_iq_adc_meas_3_b0 */ -#define PHY_BB_IQ_ADC_MEAS_3_B0_ADDRESS 0x00009c1c -#define PHY_BB_IQ_ADC_MEAS_3_B0_OFFSET 0x00009c1c -#define PHY_BB_IQ_ADC_MEAS_3_B0_GAIN_DC_IQ_CAL_MEAS_3_0_MSB 31 -#define PHY_BB_IQ_ADC_MEAS_3_B0_GAIN_DC_IQ_CAL_MEAS_3_0_LSB 0 -#define PHY_BB_IQ_ADC_MEAS_3_B0_GAIN_DC_IQ_CAL_MEAS_3_0_MASK 0xffffffff -#define PHY_BB_IQ_ADC_MEAS_3_B0_GAIN_DC_IQ_CAL_MEAS_3_0_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for BB_rfbus_grant */ -#define PHY_BB_RFBUS_GRANT_ADDRESS 0x00009c20 -#define PHY_BB_RFBUS_GRANT_OFFSET 0x00009c20 -#define PHY_BB_RFBUS_GRANT_RFBUS_GRANT_MSB 0 -#define PHY_BB_RFBUS_GRANT_RFBUS_GRANT_LSB 0 -#define PHY_BB_RFBUS_GRANT_RFBUS_GRANT_MASK 0x00000001 -#define PHY_BB_RFBUS_GRANT_RFBUS_GRANT_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_RFBUS_GRANT_BT_ANT_MSB 1 -#define PHY_BB_RFBUS_GRANT_BT_ANT_LSB 1 -#define PHY_BB_RFBUS_GRANT_BT_ANT_MASK 0x00000002 -#define PHY_BB_RFBUS_GRANT_BT_ANT_GET(x) (((x) & 0x00000002) >> 1) - -/* macros for BB_tstadc */ -#define PHY_BB_TSTADC_ADDRESS 0x00009c24 -#define PHY_BB_TSTADC_OFFSET 0x00009c24 -#define PHY_BB_TSTADC_TSTADC_OUT_Q_MSB 9 -#define PHY_BB_TSTADC_TSTADC_OUT_Q_LSB 0 -#define PHY_BB_TSTADC_TSTADC_OUT_Q_MASK 0x000003ff -#define PHY_BB_TSTADC_TSTADC_OUT_Q_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_BB_TSTADC_TSTADC_OUT_I_MSB 19 -#define PHY_BB_TSTADC_TSTADC_OUT_I_LSB 10 -#define PHY_BB_TSTADC_TSTADC_OUT_I_MASK 0x000ffc00 -#define PHY_BB_TSTADC_TSTADC_OUT_I_GET(x) (((x) & 0x000ffc00) >> 10) - -/* macros for BB_tstdac */ -#define PHY_BB_TSTDAC_ADDRESS 0x00009c28 -#define PHY_BB_TSTDAC_OFFSET 0x00009c28 -#define PHY_BB_TSTDAC_TSTDAC_OUT_Q_MSB 9 -#define PHY_BB_TSTDAC_TSTDAC_OUT_Q_LSB 0 -#define PHY_BB_TSTDAC_TSTDAC_OUT_Q_MASK 0x000003ff -#define PHY_BB_TSTDAC_TSTDAC_OUT_Q_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_BB_TSTDAC_TSTDAC_OUT_I_MSB 19 -#define PHY_BB_TSTDAC_TSTDAC_OUT_I_LSB 10 -#define PHY_BB_TSTDAC_TSTDAC_OUT_I_MASK 0x000ffc00 -#define PHY_BB_TSTDAC_TSTDAC_OUT_I_GET(x) (((x) & 0x000ffc00) >> 10) - -/* macros for BB_illegal_tx_rate */ -#define PHY_BB_ILLEGAL_TX_RATE_ADDRESS 0x00009c30 -#define PHY_BB_ILLEGAL_TX_RATE_OFFSET 0x00009c30 -#define PHY_BB_ILLEGAL_TX_RATE_ILLEGAL_TX_RATE_MSB 0 -#define PHY_BB_ILLEGAL_TX_RATE_ILLEGAL_TX_RATE_LSB 0 -#define PHY_BB_ILLEGAL_TX_RATE_ILLEGAL_TX_RATE_MASK 0x00000001 -#define PHY_BB_ILLEGAL_TX_RATE_ILLEGAL_TX_RATE_GET(x) (((x) & 0x00000001) >> 0) - -/* macros for BB_spur_report_b0 */ -#define PHY_BB_SPUR_REPORT_B0_ADDRESS 0x00009c34 -#define PHY_BB_SPUR_REPORT_B0_OFFSET 0x00009c34 -#define PHY_BB_SPUR_REPORT_B0_SPUR_EST_I_0_MSB 7 -#define PHY_BB_SPUR_REPORT_B0_SPUR_EST_I_0_LSB 0 -#define PHY_BB_SPUR_REPORT_B0_SPUR_EST_I_0_MASK 0x000000ff -#define PHY_BB_SPUR_REPORT_B0_SPUR_EST_I_0_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_SPUR_REPORT_B0_SPUR_EST_Q_0_MSB 15 -#define PHY_BB_SPUR_REPORT_B0_SPUR_EST_Q_0_LSB 8 -#define PHY_BB_SPUR_REPORT_B0_SPUR_EST_Q_0_MASK 0x0000ff00 -#define PHY_BB_SPUR_REPORT_B0_SPUR_EST_Q_0_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_SPUR_REPORT_B0_POWER_WITH_SPUR_REMOVED_0_MSB 31 -#define PHY_BB_SPUR_REPORT_B0_POWER_WITH_SPUR_REMOVED_0_LSB 16 -#define PHY_BB_SPUR_REPORT_B0_POWER_WITH_SPUR_REMOVED_0_MASK 0xffff0000 -#define PHY_BB_SPUR_REPORT_B0_POWER_WITH_SPUR_REMOVED_0_GET(x) (((x) & 0xffff0000) >> 16) - -/* macros for BB_channel_status */ -#define PHY_BB_CHANNEL_STATUS_ADDRESS 0x00009c38 -#define PHY_BB_CHANNEL_STATUS_OFFSET 0x00009c38 -#define PHY_BB_CHANNEL_STATUS_BT_ACTIVE_MSB 0 -#define PHY_BB_CHANNEL_STATUS_BT_ACTIVE_LSB 0 -#define PHY_BB_CHANNEL_STATUS_BT_ACTIVE_MASK 0x00000001 -#define PHY_BB_CHANNEL_STATUS_BT_ACTIVE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_CHANNEL_STATUS_RX_CLEAR_RAW_MSB 1 -#define PHY_BB_CHANNEL_STATUS_RX_CLEAR_RAW_LSB 1 -#define PHY_BB_CHANNEL_STATUS_RX_CLEAR_RAW_MASK 0x00000002 -#define PHY_BB_CHANNEL_STATUS_RX_CLEAR_RAW_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_CHANNEL_STATUS_RX_CLEAR_MAC_MSB 2 -#define PHY_BB_CHANNEL_STATUS_RX_CLEAR_MAC_LSB 2 -#define PHY_BB_CHANNEL_STATUS_RX_CLEAR_MAC_MASK 0x00000004 -#define PHY_BB_CHANNEL_STATUS_RX_CLEAR_MAC_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_BB_CHANNEL_STATUS_RX_CLEAR_PAD_MSB 3 -#define PHY_BB_CHANNEL_STATUS_RX_CLEAR_PAD_LSB 3 -#define PHY_BB_CHANNEL_STATUS_RX_CLEAR_PAD_MASK 0x00000008 -#define PHY_BB_CHANNEL_STATUS_RX_CLEAR_PAD_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_BB_CHANNEL_STATUS_BB_SW_OUT_0_MSB 5 -#define PHY_BB_CHANNEL_STATUS_BB_SW_OUT_0_LSB 4 -#define PHY_BB_CHANNEL_STATUS_BB_SW_OUT_0_MASK 0x00000030 -#define PHY_BB_CHANNEL_STATUS_BB_SW_OUT_0_GET(x) (((x) & 0x00000030) >> 4) -#define PHY_BB_CHANNEL_STATUS_BB_SW_OUT_1_MSB 7 -#define PHY_BB_CHANNEL_STATUS_BB_SW_OUT_1_LSB 6 -#define PHY_BB_CHANNEL_STATUS_BB_SW_OUT_1_MASK 0x000000c0 -#define PHY_BB_CHANNEL_STATUS_BB_SW_OUT_1_GET(x) (((x) & 0x000000c0) >> 6) -#define PHY_BB_CHANNEL_STATUS_BB_SW_OUT_2_MSB 9 -#define PHY_BB_CHANNEL_STATUS_BB_SW_OUT_2_LSB 8 -#define PHY_BB_CHANNEL_STATUS_BB_SW_OUT_2_MASK 0x00000300 -#define PHY_BB_CHANNEL_STATUS_BB_SW_OUT_2_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_BB_CHANNEL_STATUS_BB_SW_COM_OUT_MSB 13 -#define PHY_BB_CHANNEL_STATUS_BB_SW_COM_OUT_LSB 10 -#define PHY_BB_CHANNEL_STATUS_BB_SW_COM_OUT_MASK 0x00003c00 -#define PHY_BB_CHANNEL_STATUS_BB_SW_COM_OUT_GET(x) (((x) & 0x00003c00) >> 10) -#define PHY_BB_CHANNEL_STATUS_ANT_DIV_CFG_USED_MSB 16 -#define PHY_BB_CHANNEL_STATUS_ANT_DIV_CFG_USED_LSB 14 -#define PHY_BB_CHANNEL_STATUS_ANT_DIV_CFG_USED_MASK 0x0001c000 -#define PHY_BB_CHANNEL_STATUS_ANT_DIV_CFG_USED_GET(x) (((x) & 0x0001c000) >> 14) - -/* macros for BB_rssi_b0 */ -#define PHY_BB_RSSI_B0_ADDRESS 0x00009c3c -#define PHY_BB_RSSI_B0_OFFSET 0x00009c3c -#define PHY_BB_RSSI_B0_RSSI_0_MSB 7 -#define PHY_BB_RSSI_B0_RSSI_0_LSB 0 -#define PHY_BB_RSSI_B0_RSSI_0_MASK 0x000000ff -#define PHY_BB_RSSI_B0_RSSI_0_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_RSSI_B0_RSSI_EXT_0_MSB 15 -#define PHY_BB_RSSI_B0_RSSI_EXT_0_LSB 8 -#define PHY_BB_RSSI_B0_RSSI_EXT_0_MASK 0x0000ff00 -#define PHY_BB_RSSI_B0_RSSI_EXT_0_GET(x) (((x) & 0x0000ff00) >> 8) - -/* macros for BB_spur_est_cck_report_b0 */ -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_ADDRESS 0x00009c40 -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_OFFSET 0x00009c40 -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_I_0_CCK_MSB 7 -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_I_0_CCK_LSB 0 -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_I_0_CCK_MASK 0x000000ff -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_I_0_CCK_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_Q_0_CCK_MSB 15 -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_Q_0_CCK_LSB 8 -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_Q_0_CCK_MASK 0x0000ff00 -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_Q_0_CCK_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_I_0_CCK_MSB 23 -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_I_0_CCK_LSB 16 -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_I_0_CCK_MASK 0x00ff0000 -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_I_0_CCK_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_Q_0_CCK_MSB 31 -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_Q_0_CCK_LSB 24 -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_Q_0_CCK_MASK 0xff000000 -#define PHY_BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_Q_0_CCK_GET(x) (((x) & 0xff000000) >> 24) - -/* macros for BB_chan_info_noise_pwr */ -#define PHY_BB_CHAN_INFO_NOISE_PWR_ADDRESS 0x00009cac -#define PHY_BB_CHAN_INFO_NOISE_PWR_OFFSET 0x00009cac -#define PHY_BB_CHAN_INFO_NOISE_PWR_NOISE_POWER_MSB 11 -#define PHY_BB_CHAN_INFO_NOISE_PWR_NOISE_POWER_LSB 0 -#define PHY_BB_CHAN_INFO_NOISE_PWR_NOISE_POWER_MASK 0x00000fff -#define PHY_BB_CHAN_INFO_NOISE_PWR_NOISE_POWER_GET(x) (((x) & 0x00000fff) >> 0) - -/* macros for BB_chan_info_gain_diff */ -#define PHY_BB_CHAN_INFO_GAIN_DIFF_ADDRESS 0x00009cb0 -#define PHY_BB_CHAN_INFO_GAIN_DIFF_OFFSET 0x00009cb0 -#define PHY_BB_CHAN_INFO_GAIN_DIFF_FINE_PPM_MSB 11 -#define PHY_BB_CHAN_INFO_GAIN_DIFF_FINE_PPM_LSB 0 -#define PHY_BB_CHAN_INFO_GAIN_DIFF_FINE_PPM_MASK 0x00000fff -#define PHY_BB_CHAN_INFO_GAIN_DIFF_FINE_PPM_GET(x) (((x) & 0x00000fff) >> 0) - -/* macros for BB_chan_info_fine_timing */ -#define PHY_BB_CHAN_INFO_FINE_TIMING_ADDRESS 0x00009cb4 -#define PHY_BB_CHAN_INFO_FINE_TIMING_OFFSET 0x00009cb4 -#define PHY_BB_CHAN_INFO_FINE_TIMING_COARSE_PPM_MSB 11 -#define PHY_BB_CHAN_INFO_FINE_TIMING_COARSE_PPM_LSB 0 -#define PHY_BB_CHAN_INFO_FINE_TIMING_COARSE_PPM_MASK 0x00000fff -#define PHY_BB_CHAN_INFO_FINE_TIMING_COARSE_PPM_GET(x) (((x) & 0x00000fff) >> 0) -#define PHY_BB_CHAN_INFO_FINE_TIMING_FINE_TIMING_MSB 21 -#define PHY_BB_CHAN_INFO_FINE_TIMING_FINE_TIMING_LSB 12 -#define PHY_BB_CHAN_INFO_FINE_TIMING_FINE_TIMING_MASK 0x003ff000 -#define PHY_BB_CHAN_INFO_FINE_TIMING_FINE_TIMING_GET(x) (((x) & 0x003ff000) >> 12) - -/* macros for BB_chan_info_gain_b0 */ -#define PHY_BB_CHAN_INFO_GAIN_B0_ADDRESS 0x00009cb8 -#define PHY_BB_CHAN_INFO_GAIN_B0_OFFSET 0x00009cb8 -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RSSI_0_MSB 7 -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RSSI_0_LSB 0 -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RSSI_0_MASK 0x000000ff -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RSSI_0_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RF_GAIN_0_MSB 15 -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RF_GAIN_0_LSB 8 -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RF_GAIN_0_MASK 0x0000ff00 -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RF_GAIN_0_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN1_SW_0_MSB 16 -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN1_SW_0_LSB 16 -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN1_SW_0_MASK 0x00010000 -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN1_SW_0_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN2_SW_0_MSB 17 -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN2_SW_0_LSB 17 -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN2_SW_0_MASK 0x00020000 -#define PHY_BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN2_SW_0_GET(x) (((x) & 0x00020000) >> 17) - -/* macros for BB_chan_info_chan_tab_b0 */ -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_ADDRESS 0x00009cbc -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_OFFSET 0x00009cbc -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_Q_0_MSB 5 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_Q_0_LSB 0 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_Q_0_MASK 0x0000003f -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_Q_0_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_I_0_MSB 11 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_I_0_LSB 6 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_I_0_MASK 0x00000fc0 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_I_0_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_EXP_0_MSB 15 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_EXP_0_LSB 12 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_EXP_0_MASK 0x0000f000 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_EXP_0_GET(x) (((x) & 0x0000f000) >> 12) -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_Q_1_MSB 21 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_Q_1_LSB 16 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_Q_1_MASK 0x003f0000 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_Q_1_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_I_1_MSB 27 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_I_1_LSB 22 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_I_1_MASK 0x0fc00000 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_MAN_I_1_GET(x) (((x) & 0x0fc00000) >> 22) -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_EXP_1_MSB 31 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_EXP_1_LSB 28 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_EXP_1_MASK 0xf0000000 -#define PHY_BB_CHAN_INFO_CHAN_TAB_B0_EXP_1_GET(x) (((x) & 0xf0000000) >> 28) - -/* macros for BB_paprd_am2am_mask */ -#define PHY_BB_PAPRD_AM2AM_MASK_ADDRESS 0x00009de4 -#define PHY_BB_PAPRD_AM2AM_MASK_OFFSET 0x00009de4 -#define PHY_BB_PAPRD_AM2AM_MASK_PAPRD_AM2AM_MASK_MSB 24 -#define PHY_BB_PAPRD_AM2AM_MASK_PAPRD_AM2AM_MASK_LSB 0 -#define PHY_BB_PAPRD_AM2AM_MASK_PAPRD_AM2AM_MASK_MASK 0x01ffffff -#define PHY_BB_PAPRD_AM2AM_MASK_PAPRD_AM2AM_MASK_GET(x) (((x) & 0x01ffffff) >> 0) -#define PHY_BB_PAPRD_AM2AM_MASK_PAPRD_AM2AM_MASK_SET(x) (((x) << 0) & 0x01ffffff) - -/* macros for BB_paprd_am2pm_mask */ -#define PHY_BB_PAPRD_AM2PM_MASK_ADDRESS 0x00009de8 -#define PHY_BB_PAPRD_AM2PM_MASK_OFFSET 0x00009de8 -#define PHY_BB_PAPRD_AM2PM_MASK_PAPRD_AM2PM_MASK_MSB 24 -#define PHY_BB_PAPRD_AM2PM_MASK_PAPRD_AM2PM_MASK_LSB 0 -#define PHY_BB_PAPRD_AM2PM_MASK_PAPRD_AM2PM_MASK_MASK 0x01ffffff -#define PHY_BB_PAPRD_AM2PM_MASK_PAPRD_AM2PM_MASK_GET(x) (((x) & 0x01ffffff) >> 0) -#define PHY_BB_PAPRD_AM2PM_MASK_PAPRD_AM2PM_MASK_SET(x) (((x) << 0) & 0x01ffffff) - -/* macros for BB_paprd_ht40_mask */ -#define PHY_BB_PAPRD_HT40_MASK_ADDRESS 0x00009dec -#define PHY_BB_PAPRD_HT40_MASK_OFFSET 0x00009dec -#define PHY_BB_PAPRD_HT40_MASK_PAPRD_HT40_MASK_MSB 24 -#define PHY_BB_PAPRD_HT40_MASK_PAPRD_HT40_MASK_LSB 0 -#define PHY_BB_PAPRD_HT40_MASK_PAPRD_HT40_MASK_MASK 0x01ffffff -#define PHY_BB_PAPRD_HT40_MASK_PAPRD_HT40_MASK_GET(x) (((x) & 0x01ffffff) >> 0) -#define PHY_BB_PAPRD_HT40_MASK_PAPRD_HT40_MASK_SET(x) (((x) << 0) & 0x01ffffff) - -/* macros for BB_paprd_ctrl0 */ -#define PHY_BB_PAPRD_CTRL0_ADDRESS 0x00009df0 -#define PHY_BB_PAPRD_CTRL0_OFFSET 0x00009df0 -#define PHY_BB_PAPRD_CTRL0_PAPRD_ENABLE_MSB 0 -#define PHY_BB_PAPRD_CTRL0_PAPRD_ENABLE_LSB 0 -#define PHY_BB_PAPRD_CTRL0_PAPRD_ENABLE_MASK 0x00000001 -#define PHY_BB_PAPRD_CTRL0_PAPRD_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_PAPRD_CTRL0_PAPRD_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_PAPRD_CTRL0_PAPRD_ADAPTIVE_USE_SINGLE_TABLE_MSB 1 -#define PHY_BB_PAPRD_CTRL0_PAPRD_ADAPTIVE_USE_SINGLE_TABLE_LSB 1 -#define PHY_BB_PAPRD_CTRL0_PAPRD_ADAPTIVE_USE_SINGLE_TABLE_MASK 0x00000002 -#define PHY_BB_PAPRD_CTRL0_PAPRD_ADAPTIVE_USE_SINGLE_TABLE_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_PAPRD_CTRL0_PAPRD_ADAPTIVE_USE_SINGLE_TABLE_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_PAPRD_CTRL0_PAPRD_VALID_GAIN_MSB 26 -#define PHY_BB_PAPRD_CTRL0_PAPRD_VALID_GAIN_LSB 2 -#define PHY_BB_PAPRD_CTRL0_PAPRD_VALID_GAIN_MASK 0x07fffffc -#define PHY_BB_PAPRD_CTRL0_PAPRD_VALID_GAIN_GET(x) (((x) & 0x07fffffc) >> 2) -#define PHY_BB_PAPRD_CTRL0_PAPRD_VALID_GAIN_SET(x) (((x) << 2) & 0x07fffffc) -#define PHY_BB_PAPRD_CTRL0_PAPRD_MAG_THRSH_MSB 31 -#define PHY_BB_PAPRD_CTRL0_PAPRD_MAG_THRSH_LSB 27 -#define PHY_BB_PAPRD_CTRL0_PAPRD_MAG_THRSH_MASK 0xf8000000 -#define PHY_BB_PAPRD_CTRL0_PAPRD_MAG_THRSH_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_BB_PAPRD_CTRL0_PAPRD_MAG_THRSH_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for BB_paprd_ctrl1 */ -#define PHY_BB_PAPRD_CTRL1_ADDRESS 0x00009df4 -#define PHY_BB_PAPRD_CTRL1_OFFSET 0x00009df4 -#define PHY_BB_PAPRD_CTRL1_PAPRD_ADAPTIVE_SCALING_ENABLE_MSB 0 -#define PHY_BB_PAPRD_CTRL1_PAPRD_ADAPTIVE_SCALING_ENABLE_LSB 0 -#define PHY_BB_PAPRD_CTRL1_PAPRD_ADAPTIVE_SCALING_ENABLE_MASK 0x00000001 -#define PHY_BB_PAPRD_CTRL1_PAPRD_ADAPTIVE_SCALING_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_PAPRD_CTRL1_PAPRD_ADAPTIVE_SCALING_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_PAPRD_CTRL1_PAPRD_ADAPTIVE_AM2AM_ENABLE_MSB 1 -#define PHY_BB_PAPRD_CTRL1_PAPRD_ADAPTIVE_AM2AM_ENABLE_LSB 1 -#define PHY_BB_PAPRD_CTRL1_PAPRD_ADAPTIVE_AM2AM_ENABLE_MASK 0x00000002 -#define PHY_BB_PAPRD_CTRL1_PAPRD_ADAPTIVE_AM2AM_ENABLE_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_PAPRD_CTRL1_PAPRD_ADAPTIVE_AM2AM_ENABLE_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_PAPRD_CTRL1_PAPRD_ADAPTIVE_AM2PM_ENABLE_MSB 2 -#define PHY_BB_PAPRD_CTRL1_PAPRD_ADAPTIVE_AM2PM_ENABLE_LSB 2 -#define PHY_BB_PAPRD_CTRL1_PAPRD_ADAPTIVE_AM2PM_ENABLE_MASK 0x00000004 -#define PHY_BB_PAPRD_CTRL1_PAPRD_ADAPTIVE_AM2PM_ENABLE_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_BB_PAPRD_CTRL1_PAPRD_ADAPTIVE_AM2PM_ENABLE_SET(x) (((x) << 2) & 0x00000004) -#define PHY_BB_PAPRD_CTRL1_PAPRD_POWER_AT_AM2AM_CAL_MSB 8 -#define PHY_BB_PAPRD_CTRL1_PAPRD_POWER_AT_AM2AM_CAL_LSB 3 -#define PHY_BB_PAPRD_CTRL1_PAPRD_POWER_AT_AM2AM_CAL_MASK 0x000001f8 -#define PHY_BB_PAPRD_CTRL1_PAPRD_POWER_AT_AM2AM_CAL_GET(x) (((x) & 0x000001f8) >> 3) -#define PHY_BB_PAPRD_CTRL1_PAPRD_POWER_AT_AM2AM_CAL_SET(x) (((x) << 3) & 0x000001f8) -#define PHY_BB_PAPRD_CTRL1_PA_GAIN_SCALE_FACTOR_MSB 16 -#define PHY_BB_PAPRD_CTRL1_PA_GAIN_SCALE_FACTOR_LSB 9 -#define PHY_BB_PAPRD_CTRL1_PA_GAIN_SCALE_FACTOR_MASK 0x0001fe00 -#define PHY_BB_PAPRD_CTRL1_PA_GAIN_SCALE_FACTOR_GET(x) (((x) & 0x0001fe00) >> 9) -#define PHY_BB_PAPRD_CTRL1_PA_GAIN_SCALE_FACTOR_SET(x) (((x) << 9) & 0x0001fe00) -#define PHY_BB_PAPRD_CTRL1_PAPRD_MAG_SCALE_FACTOR_MSB 26 -#define PHY_BB_PAPRD_CTRL1_PAPRD_MAG_SCALE_FACTOR_LSB 17 -#define PHY_BB_PAPRD_CTRL1_PAPRD_MAG_SCALE_FACTOR_MASK 0x07fe0000 -#define PHY_BB_PAPRD_CTRL1_PAPRD_MAG_SCALE_FACTOR_GET(x) (((x) & 0x07fe0000) >> 17) -#define PHY_BB_PAPRD_CTRL1_PAPRD_MAG_SCALE_FACTOR_SET(x) (((x) << 17) & 0x07fe0000) -#define PHY_BB_PAPRD_CTRL1_PAPRD_TRAINER_IANDQ_SEL_MSB 27 -#define PHY_BB_PAPRD_CTRL1_PAPRD_TRAINER_IANDQ_SEL_LSB 27 -#define PHY_BB_PAPRD_CTRL1_PAPRD_TRAINER_IANDQ_SEL_MASK 0x08000000 -#define PHY_BB_PAPRD_CTRL1_PAPRD_TRAINER_IANDQ_SEL_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_BB_PAPRD_CTRL1_PAPRD_TRAINER_IANDQ_SEL_SET(x) (((x) << 27) & 0x08000000) - -/* macros for BB_pa_gain123 */ -#define PHY_BB_PA_GAIN123_ADDRESS 0x00009df8 -#define PHY_BB_PA_GAIN123_OFFSET 0x00009df8 -#define PHY_BB_PA_GAIN123_PA_GAIN1_MSB 9 -#define PHY_BB_PA_GAIN123_PA_GAIN1_LSB 0 -#define PHY_BB_PA_GAIN123_PA_GAIN1_MASK 0x000003ff -#define PHY_BB_PA_GAIN123_PA_GAIN1_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_BB_PA_GAIN123_PA_GAIN1_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_BB_PA_GAIN123_PA_GAIN2_MSB 19 -#define PHY_BB_PA_GAIN123_PA_GAIN2_LSB 10 -#define PHY_BB_PA_GAIN123_PA_GAIN2_MASK 0x000ffc00 -#define PHY_BB_PA_GAIN123_PA_GAIN2_GET(x) (((x) & 0x000ffc00) >> 10) -#define PHY_BB_PA_GAIN123_PA_GAIN2_SET(x) (((x) << 10) & 0x000ffc00) -#define PHY_BB_PA_GAIN123_PA_GAIN3_MSB 29 -#define PHY_BB_PA_GAIN123_PA_GAIN3_LSB 20 -#define PHY_BB_PA_GAIN123_PA_GAIN3_MASK 0x3ff00000 -#define PHY_BB_PA_GAIN123_PA_GAIN3_GET(x) (((x) & 0x3ff00000) >> 20) -#define PHY_BB_PA_GAIN123_PA_GAIN3_SET(x) (((x) << 20) & 0x3ff00000) - -/* macros for BB_pa_gain45 */ -#define PHY_BB_PA_GAIN45_ADDRESS 0x00009dfc -#define PHY_BB_PA_GAIN45_OFFSET 0x00009dfc -#define PHY_BB_PA_GAIN45_PA_GAIN4_MSB 9 -#define PHY_BB_PA_GAIN45_PA_GAIN4_LSB 0 -#define PHY_BB_PA_GAIN45_PA_GAIN4_MASK 0x000003ff -#define PHY_BB_PA_GAIN45_PA_GAIN4_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_BB_PA_GAIN45_PA_GAIN4_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_BB_PA_GAIN45_PA_GAIN5_MSB 19 -#define PHY_BB_PA_GAIN45_PA_GAIN5_LSB 10 -#define PHY_BB_PA_GAIN45_PA_GAIN5_MASK 0x000ffc00 -#define PHY_BB_PA_GAIN45_PA_GAIN5_GET(x) (((x) & 0x000ffc00) >> 10) -#define PHY_BB_PA_GAIN45_PA_GAIN5_SET(x) (((x) << 10) & 0x000ffc00) -#define PHY_BB_PA_GAIN45_PAPRD_ADAPTIVE_TABLE_VALID_MSB 24 -#define PHY_BB_PA_GAIN45_PAPRD_ADAPTIVE_TABLE_VALID_LSB 20 -#define PHY_BB_PA_GAIN45_PAPRD_ADAPTIVE_TABLE_VALID_MASK 0x01f00000 -#define PHY_BB_PA_GAIN45_PAPRD_ADAPTIVE_TABLE_VALID_GET(x) (((x) & 0x01f00000) >> 20) -#define PHY_BB_PA_GAIN45_PAPRD_ADAPTIVE_TABLE_VALID_SET(x) (((x) << 20) & 0x01f00000) - -/* macros for BB_paprd_pre_post_scale_0 */ -#define PHY_BB_PAPRD_PRE_POST_SCALE_0_ADDRESS 0x00009e00 -#define PHY_BB_PAPRD_PRE_POST_SCALE_0_OFFSET 0x00009e00 -#define PHY_BB_PAPRD_PRE_POST_SCALE_0_PAPRD_PRE_POST_SCALING_0_MSB 17 -#define PHY_BB_PAPRD_PRE_POST_SCALE_0_PAPRD_PRE_POST_SCALING_0_LSB 0 -#define PHY_BB_PAPRD_PRE_POST_SCALE_0_PAPRD_PRE_POST_SCALING_0_MASK 0x0003ffff -#define PHY_BB_PAPRD_PRE_POST_SCALE_0_PAPRD_PRE_POST_SCALING_0_GET(x) (((x) & 0x0003ffff) >> 0) -#define PHY_BB_PAPRD_PRE_POST_SCALE_0_PAPRD_PRE_POST_SCALING_0_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for BB_paprd_pre_post_scale_1 */ -#define PHY_BB_PAPRD_PRE_POST_SCALE_1_ADDRESS 0x00009e04 -#define PHY_BB_PAPRD_PRE_POST_SCALE_1_OFFSET 0x00009e04 -#define PHY_BB_PAPRD_PRE_POST_SCALE_1_PAPRD_PRE_POST_SCALING_1_MSB 17 -#define PHY_BB_PAPRD_PRE_POST_SCALE_1_PAPRD_PRE_POST_SCALING_1_LSB 0 -#define PHY_BB_PAPRD_PRE_POST_SCALE_1_PAPRD_PRE_POST_SCALING_1_MASK 0x0003ffff -#define PHY_BB_PAPRD_PRE_POST_SCALE_1_PAPRD_PRE_POST_SCALING_1_GET(x) (((x) & 0x0003ffff) >> 0) -#define PHY_BB_PAPRD_PRE_POST_SCALE_1_PAPRD_PRE_POST_SCALING_1_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for BB_paprd_pre_post_scale_2 */ -#define PHY_BB_PAPRD_PRE_POST_SCALE_2_ADDRESS 0x00009e08 -#define PHY_BB_PAPRD_PRE_POST_SCALE_2_OFFSET 0x00009e08 -#define PHY_BB_PAPRD_PRE_POST_SCALE_2_PAPRD_PRE_POST_SCALING_2_MSB 17 -#define PHY_BB_PAPRD_PRE_POST_SCALE_2_PAPRD_PRE_POST_SCALING_2_LSB 0 -#define PHY_BB_PAPRD_PRE_POST_SCALE_2_PAPRD_PRE_POST_SCALING_2_MASK 0x0003ffff -#define PHY_BB_PAPRD_PRE_POST_SCALE_2_PAPRD_PRE_POST_SCALING_2_GET(x) (((x) & 0x0003ffff) >> 0) -#define PHY_BB_PAPRD_PRE_POST_SCALE_2_PAPRD_PRE_POST_SCALING_2_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for BB_paprd_pre_post_scale_3 */ -#define PHY_BB_PAPRD_PRE_POST_SCALE_3_ADDRESS 0x00009e0c -#define PHY_BB_PAPRD_PRE_POST_SCALE_3_OFFSET 0x00009e0c -#define PHY_BB_PAPRD_PRE_POST_SCALE_3_PAPRD_PRE_POST_SCALING_3_MSB 17 -#define PHY_BB_PAPRD_PRE_POST_SCALE_3_PAPRD_PRE_POST_SCALING_3_LSB 0 -#define PHY_BB_PAPRD_PRE_POST_SCALE_3_PAPRD_PRE_POST_SCALING_3_MASK 0x0003ffff -#define PHY_BB_PAPRD_PRE_POST_SCALE_3_PAPRD_PRE_POST_SCALING_3_GET(x) (((x) & 0x0003ffff) >> 0) -#define PHY_BB_PAPRD_PRE_POST_SCALE_3_PAPRD_PRE_POST_SCALING_3_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for BB_paprd_pre_post_scale_4 */ -#define PHY_BB_PAPRD_PRE_POST_SCALE_4_ADDRESS 0x00009e10 -#define PHY_BB_PAPRD_PRE_POST_SCALE_4_OFFSET 0x00009e10 -#define PHY_BB_PAPRD_PRE_POST_SCALE_4_PAPRD_PRE_POST_SCALING_4_MSB 17 -#define PHY_BB_PAPRD_PRE_POST_SCALE_4_PAPRD_PRE_POST_SCALING_4_LSB 0 -#define PHY_BB_PAPRD_PRE_POST_SCALE_4_PAPRD_PRE_POST_SCALING_4_MASK 0x0003ffff -#define PHY_BB_PAPRD_PRE_POST_SCALE_4_PAPRD_PRE_POST_SCALING_4_GET(x) (((x) & 0x0003ffff) >> 0) -#define PHY_BB_PAPRD_PRE_POST_SCALE_4_PAPRD_PRE_POST_SCALING_4_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for BB_paprd_pre_post_scale_5 */ -#define PHY_BB_PAPRD_PRE_POST_SCALE_5_ADDRESS 0x00009e14 -#define PHY_BB_PAPRD_PRE_POST_SCALE_5_OFFSET 0x00009e14 -#define PHY_BB_PAPRD_PRE_POST_SCALE_5_PAPRD_PRE_POST_SCALING_5_MSB 17 -#define PHY_BB_PAPRD_PRE_POST_SCALE_5_PAPRD_PRE_POST_SCALING_5_LSB 0 -#define PHY_BB_PAPRD_PRE_POST_SCALE_5_PAPRD_PRE_POST_SCALING_5_MASK 0x0003ffff -#define PHY_BB_PAPRD_PRE_POST_SCALE_5_PAPRD_PRE_POST_SCALING_5_GET(x) (((x) & 0x0003ffff) >> 0) -#define PHY_BB_PAPRD_PRE_POST_SCALE_5_PAPRD_PRE_POST_SCALING_5_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for BB_paprd_pre_post_scale_6 */ -#define PHY_BB_PAPRD_PRE_POST_SCALE_6_ADDRESS 0x00009e18 -#define PHY_BB_PAPRD_PRE_POST_SCALE_6_OFFSET 0x00009e18 -#define PHY_BB_PAPRD_PRE_POST_SCALE_6_PAPRD_PRE_POST_SCALING_6_MSB 17 -#define PHY_BB_PAPRD_PRE_POST_SCALE_6_PAPRD_PRE_POST_SCALING_6_LSB 0 -#define PHY_BB_PAPRD_PRE_POST_SCALE_6_PAPRD_PRE_POST_SCALING_6_MASK 0x0003ffff -#define PHY_BB_PAPRD_PRE_POST_SCALE_6_PAPRD_PRE_POST_SCALING_6_GET(x) (((x) & 0x0003ffff) >> 0) -#define PHY_BB_PAPRD_PRE_POST_SCALE_6_PAPRD_PRE_POST_SCALING_6_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for BB_paprd_pre_post_scale_7 */ -#define PHY_BB_PAPRD_PRE_POST_SCALE_7_ADDRESS 0x00009e1c -#define PHY_BB_PAPRD_PRE_POST_SCALE_7_OFFSET 0x00009e1c -#define PHY_BB_PAPRD_PRE_POST_SCALE_7_PAPRD_PRE_POST_SCALING_7_MSB 17 -#define PHY_BB_PAPRD_PRE_POST_SCALE_7_PAPRD_PRE_POST_SCALING_7_LSB 0 -#define PHY_BB_PAPRD_PRE_POST_SCALE_7_PAPRD_PRE_POST_SCALING_7_MASK 0x0003ffff -#define PHY_BB_PAPRD_PRE_POST_SCALE_7_PAPRD_PRE_POST_SCALING_7_GET(x) (((x) & 0x0003ffff) >> 0) -#define PHY_BB_PAPRD_PRE_POST_SCALE_7_PAPRD_PRE_POST_SCALING_7_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for BB_paprd_mem_tab */ -#define PHY_BB_PAPRD_MEM_TAB_ADDRESS 0x00009e20 -#define PHY_BB_PAPRD_MEM_TAB_OFFSET 0x00009e20 -#define PHY_BB_PAPRD_MEM_TAB_PAPRD_MEM_MSB 21 -#define PHY_BB_PAPRD_MEM_TAB_PAPRD_MEM_LSB 0 -#define PHY_BB_PAPRD_MEM_TAB_PAPRD_MEM_MASK 0x003fffff -#define PHY_BB_PAPRD_MEM_TAB_PAPRD_MEM_GET(x) (((x) & 0x003fffff) >> 0) -#define PHY_BB_PAPRD_MEM_TAB_PAPRD_MEM_SET(x) (((x) << 0) & 0x003fffff) - -/* macros for BB_peak_det_ctrl_1 */ -#define PHY_BB_PEAK_DET_CTRL_1_ADDRESS 0x0000a000 -#define PHY_BB_PEAK_DET_CTRL_1_OFFSET 0x0000a000 -#define PHY_BB_PEAK_DET_CTRL_1_USE_OC_GAIN_TABLE_MSB 0 -#define PHY_BB_PEAK_DET_CTRL_1_USE_OC_GAIN_TABLE_LSB 0 -#define PHY_BB_PEAK_DET_CTRL_1_USE_OC_GAIN_TABLE_MASK 0x00000001 -#define PHY_BB_PEAK_DET_CTRL_1_USE_OC_GAIN_TABLE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_PEAK_DET_CTRL_1_USE_OC_GAIN_TABLE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_PEAK_DET_CTRL_1_USE_PEAK_DET_MSB 1 -#define PHY_BB_PEAK_DET_CTRL_1_USE_PEAK_DET_LSB 1 -#define PHY_BB_PEAK_DET_CTRL_1_USE_PEAK_DET_MASK 0x00000002 -#define PHY_BB_PEAK_DET_CTRL_1_USE_PEAK_DET_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_PEAK_DET_CTRL_1_USE_PEAK_DET_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_WIN_LEN_MSB 7 -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_WIN_LEN_LSB 2 -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_WIN_LEN_MASK 0x000000fc -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_WIN_LEN_GET(x) (((x) & 0x000000fc) >> 2) -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_WIN_LEN_SET(x) (((x) << 2) & 0x000000fc) -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_LOW_MSB 12 -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_LOW_LSB 8 -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_LOW_MASK 0x00001f00 -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_LOW_GET(x) (((x) & 0x00001f00) >> 8) -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_LOW_SET(x) (((x) << 8) & 0x00001f00) -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_MED_MSB 17 -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_MED_LSB 13 -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_MED_MASK 0x0003e000 -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_MED_GET(x) (((x) & 0x0003e000) >> 13) -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_MED_SET(x) (((x) << 13) & 0x0003e000) -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_HIGH_MSB 22 -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_HIGH_LSB 18 -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_HIGH_MASK 0x007c0000 -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_HIGH_GET(x) (((x) & 0x007c0000) >> 18) -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_HIGH_SET(x) (((x) << 18) & 0x007c0000) -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_SETTLING_MSB 29 -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_SETTLING_LSB 23 -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_SETTLING_MASK 0x3f800000 -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_SETTLING_GET(x) (((x) & 0x3f800000) >> 23) -#define PHY_BB_PEAK_DET_CTRL_1_PEAK_DET_SETTLING_SET(x) (((x) << 23) & 0x3f800000) -#define PHY_BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_CAL_MSB 30 -#define PHY_BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_CAL_LSB 30 -#define PHY_BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_CAL_MASK 0x40000000 -#define PHY_BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_CAL_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_CAL_SET(x) (((x) << 30) & 0x40000000) -#define PHY_BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_RX_MSB 31 -#define PHY_BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_RX_LSB 31 -#define PHY_BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_RX_MASK 0x80000000 -#define PHY_BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_RX_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_RX_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_peak_det_ctrl_2 */ -#define PHY_BB_PEAK_DET_CTRL_2_ADDRESS 0x0000a004 -#define PHY_BB_PEAK_DET_CTRL_2_OFFSET 0x0000a004 -#define PHY_BB_PEAK_DET_CTRL_2_RFSAT_2_ADD_RFGAIN_DEL_MSB 9 -#define PHY_BB_PEAK_DET_CTRL_2_RFSAT_2_ADD_RFGAIN_DEL_LSB 0 -#define PHY_BB_PEAK_DET_CTRL_2_RFSAT_2_ADD_RFGAIN_DEL_MASK 0x000003ff -#define PHY_BB_PEAK_DET_CTRL_2_RFSAT_2_ADD_RFGAIN_DEL_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_BB_PEAK_DET_CTRL_2_RFSAT_2_ADD_RFGAIN_DEL_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_LOW_MSB 14 -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_LOW_LSB 10 -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_LOW_MASK 0x00007c00 -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_LOW_GET(x) (((x) & 0x00007c00) >> 10) -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_LOW_SET(x) (((x) << 10) & 0x00007c00) -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_MED_MSB 19 -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_MED_LSB 15 -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_MED_MASK 0x000f8000 -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_MED_GET(x) (((x) & 0x000f8000) >> 15) -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_MED_SET(x) (((x) << 15) & 0x000f8000) -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_HIGH_MSB 24 -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_HIGH_LSB 20 -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_HIGH_MASK 0x01f00000 -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_HIGH_GET(x) (((x) & 0x01f00000) >> 20) -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_HIGH_SET(x) (((x) << 20) & 0x01f00000) -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_NON_MSB 29 -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_NON_LSB 25 -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_NON_MASK 0x3e000000 -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_NON_GET(x) (((x) & 0x3e000000) >> 25) -#define PHY_BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_NON_SET(x) (((x) << 25) & 0x3e000000) - -/* macros for BB_rx_gain_bounds_1 */ -#define PHY_BB_RX_GAIN_BOUNDS_1_ADDRESS 0x0000a008 -#define PHY_BB_RX_GAIN_BOUNDS_1_OFFSET 0x0000a008 -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_MAX_MB_GAIN_MSB 7 -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_MAX_MB_GAIN_LSB 0 -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_MAX_MB_GAIN_MASK 0x000000ff -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_MAX_MB_GAIN_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_MAX_MB_GAIN_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_REF_MSB 15 -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_REF_LSB 8 -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_REF_MASK 0x0000ff00 -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_REF_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_REF_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_MSB 23 -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_LSB 16 -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_MASK 0x00ff0000 -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_2G_MSB 24 -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_2G_LSB 24 -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_2G_MASK 0x01000000 -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_2G_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_2G_SET(x) (((x) << 24) & 0x01000000) -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_5G_MSB 25 -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_5G_LSB 25 -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_5G_MASK 0x02000000 -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_5G_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_5G_SET(x) (((x) << 25) & 0x02000000) - -/* macros for BB_rx_gain_bounds_2 */ -#define PHY_BB_RX_GAIN_BOUNDS_2_ADDRESS 0x0000a00c -#define PHY_BB_RX_GAIN_BOUNDS_2_OFFSET 0x0000a00c -#define PHY_BB_RX_GAIN_BOUNDS_2_GC_RSSI_LOW_DB_MSB 7 -#define PHY_BB_RX_GAIN_BOUNDS_2_GC_RSSI_LOW_DB_LSB 0 -#define PHY_BB_RX_GAIN_BOUNDS_2_GC_RSSI_LOW_DB_MASK 0x000000ff -#define PHY_BB_RX_GAIN_BOUNDS_2_GC_RSSI_LOW_DB_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_RX_GAIN_BOUNDS_2_GC_RSSI_LOW_DB_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_RX_GAIN_BOUNDS_2_RF_GAIN_REF_BASE_ADDR_MSB 15 -#define PHY_BB_RX_GAIN_BOUNDS_2_RF_GAIN_REF_BASE_ADDR_LSB 8 -#define PHY_BB_RX_GAIN_BOUNDS_2_RF_GAIN_REF_BASE_ADDR_MASK 0x0000ff00 -#define PHY_BB_RX_GAIN_BOUNDS_2_RF_GAIN_REF_BASE_ADDR_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_RX_GAIN_BOUNDS_2_RF_GAIN_REF_BASE_ADDR_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_RX_GAIN_BOUNDS_2_RF_GAIN_BASE_ADDR_MSB 23 -#define PHY_BB_RX_GAIN_BOUNDS_2_RF_GAIN_BASE_ADDR_LSB 16 -#define PHY_BB_RX_GAIN_BOUNDS_2_RF_GAIN_BASE_ADDR_MASK 0x00ff0000 -#define PHY_BB_RX_GAIN_BOUNDS_2_RF_GAIN_BASE_ADDR_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_BB_RX_GAIN_BOUNDS_2_RF_GAIN_BASE_ADDR_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_BB_RX_GAIN_BOUNDS_2_RF_GAIN_DIV_BASE_ADDR_MSB 31 -#define PHY_BB_RX_GAIN_BOUNDS_2_RF_GAIN_DIV_BASE_ADDR_LSB 24 -#define PHY_BB_RX_GAIN_BOUNDS_2_RF_GAIN_DIV_BASE_ADDR_MASK 0xff000000 -#define PHY_BB_RX_GAIN_BOUNDS_2_RF_GAIN_DIV_BASE_ADDR_GET(x) (((x) & 0xff000000) >> 24) -#define PHY_BB_RX_GAIN_BOUNDS_2_RF_GAIN_DIV_BASE_ADDR_SET(x) (((x) << 24) & 0xff000000) - -/* macros for BB_peak_det_cal_ctrl */ -#define PHY_BB_PEAK_DET_CAL_CTRL_ADDRESS 0x0000a010 -#define PHY_BB_PEAK_DET_CAL_CTRL_OFFSET 0x0000a010 -#define PHY_BB_PEAK_DET_CAL_CTRL_PKDET_CAL_WIN_THR_MSB 5 -#define PHY_BB_PEAK_DET_CAL_CTRL_PKDET_CAL_WIN_THR_LSB 0 -#define PHY_BB_PEAK_DET_CAL_CTRL_PKDET_CAL_WIN_THR_MASK 0x0000003f -#define PHY_BB_PEAK_DET_CAL_CTRL_PKDET_CAL_WIN_THR_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_PEAK_DET_CAL_CTRL_PKDET_CAL_WIN_THR_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_PEAK_DET_CAL_CTRL_PKDET_CAL_BIAS_MSB 11 -#define PHY_BB_PEAK_DET_CAL_CTRL_PKDET_CAL_BIAS_LSB 6 -#define PHY_BB_PEAK_DET_CAL_CTRL_PKDET_CAL_BIAS_MASK 0x00000fc0 -#define PHY_BB_PEAK_DET_CAL_CTRL_PKDET_CAL_BIAS_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_PEAK_DET_CAL_CTRL_PKDET_CAL_BIAS_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_PEAK_DET_CAL_CTRL_PKDET_CAL_MEAS_TIME_SEL_MSB 13 -#define PHY_BB_PEAK_DET_CAL_CTRL_PKDET_CAL_MEAS_TIME_SEL_LSB 12 -#define PHY_BB_PEAK_DET_CAL_CTRL_PKDET_CAL_MEAS_TIME_SEL_MASK 0x00003000 -#define PHY_BB_PEAK_DET_CAL_CTRL_PKDET_CAL_MEAS_TIME_SEL_GET(x) (((x) & 0x00003000) >> 12) -#define PHY_BB_PEAK_DET_CAL_CTRL_PKDET_CAL_MEAS_TIME_SEL_SET(x) (((x) << 12) & 0x00003000) - -/* macros for BB_agc_dig_dc_ctrl */ -#define PHY_BB_AGC_DIG_DC_CTRL_ADDRESS 0x0000a014 -#define PHY_BB_AGC_DIG_DC_CTRL_OFFSET 0x0000a014 -#define PHY_BB_AGC_DIG_DC_CTRL_USE_DIG_DC_MSB 0 -#define PHY_BB_AGC_DIG_DC_CTRL_USE_DIG_DC_LSB 0 -#define PHY_BB_AGC_DIG_DC_CTRL_USE_DIG_DC_MASK 0x00000001 -#define PHY_BB_AGC_DIG_DC_CTRL_USE_DIG_DC_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_AGC_DIG_DC_CTRL_USE_DIG_DC_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_AGC_DIG_DC_CTRL_DIG_DC_SCALE_BIAS_MSB 3 -#define PHY_BB_AGC_DIG_DC_CTRL_DIG_DC_SCALE_BIAS_LSB 1 -#define PHY_BB_AGC_DIG_DC_CTRL_DIG_DC_SCALE_BIAS_MASK 0x0000000e -#define PHY_BB_AGC_DIG_DC_CTRL_DIG_DC_SCALE_BIAS_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_BB_AGC_DIG_DC_CTRL_DIG_DC_SCALE_BIAS_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_BB_AGC_DIG_DC_CTRL_DIG_DC_CORRECT_CAP_MSB 9 -#define PHY_BB_AGC_DIG_DC_CTRL_DIG_DC_CORRECT_CAP_LSB 4 -#define PHY_BB_AGC_DIG_DC_CTRL_DIG_DC_CORRECT_CAP_MASK 0x000003f0 -#define PHY_BB_AGC_DIG_DC_CTRL_DIG_DC_CORRECT_CAP_GET(x) (((x) & 0x000003f0) >> 4) -#define PHY_BB_AGC_DIG_DC_CTRL_DIG_DC_CORRECT_CAP_SET(x) (((x) << 4) & 0x000003f0) -#define PHY_BB_AGC_DIG_DC_CTRL_DIG_DC_MIXER_SEL_MASK_MSB 31 -#define PHY_BB_AGC_DIG_DC_CTRL_DIG_DC_MIXER_SEL_MASK_LSB 16 -#define PHY_BB_AGC_DIG_DC_CTRL_DIG_DC_MIXER_SEL_MASK_MASK 0xffff0000 -#define PHY_BB_AGC_DIG_DC_CTRL_DIG_DC_MIXER_SEL_MASK_GET(x) (((x) & 0xffff0000) >> 16) -#define PHY_BB_AGC_DIG_DC_CTRL_DIG_DC_MIXER_SEL_MASK_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for BB_agc_dig_dc_status_i_b0 */ -#define PHY_BB_AGC_DIG_DC_STATUS_I_B0_ADDRESS 0x0000a018 -#define PHY_BB_AGC_DIG_DC_STATUS_I_B0_OFFSET 0x0000a018 -#define PHY_BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C1_RES_I_0_MSB 8 -#define PHY_BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C1_RES_I_0_LSB 0 -#define PHY_BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C1_RES_I_0_MASK 0x000001ff -#define PHY_BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C1_RES_I_0_GET(x) (((x) & 0x000001ff) >> 0) -#define PHY_BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C2_RES_I_0_MSB 17 -#define PHY_BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C2_RES_I_0_LSB 9 -#define PHY_BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C2_RES_I_0_MASK 0x0003fe00 -#define PHY_BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C2_RES_I_0_GET(x) (((x) & 0x0003fe00) >> 9) -#define PHY_BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C3_RES_I_0_MSB 26 -#define PHY_BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C3_RES_I_0_LSB 18 -#define PHY_BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C3_RES_I_0_MASK 0x07fc0000 -#define PHY_BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C3_RES_I_0_GET(x) (((x) & 0x07fc0000) >> 18) - -/* macros for BB_agc_dig_dc_status_q_b0 */ -#define PHY_BB_AGC_DIG_DC_STATUS_Q_B0_ADDRESS 0x0000a01c -#define PHY_BB_AGC_DIG_DC_STATUS_Q_B0_OFFSET 0x0000a01c -#define PHY_BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C1_RES_Q_0_MSB 8 -#define PHY_BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C1_RES_Q_0_LSB 0 -#define PHY_BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C1_RES_Q_0_MASK 0x000001ff -#define PHY_BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C1_RES_Q_0_GET(x) (((x) & 0x000001ff) >> 0) -#define PHY_BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C2_RES_Q_0_MSB 17 -#define PHY_BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C2_RES_Q_0_LSB 9 -#define PHY_BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C2_RES_Q_0_MASK 0x0003fe00 -#define PHY_BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C2_RES_Q_0_GET(x) (((x) & 0x0003fe00) >> 9) -#define PHY_BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C3_RES_Q_0_MSB 26 -#define PHY_BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C3_RES_Q_0_LSB 18 -#define PHY_BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C3_RES_Q_0_MASK 0x07fc0000 -#define PHY_BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C3_RES_Q_0_GET(x) (((x) & 0x07fc0000) >> 18) - -/* macros for BB_bbb_txfir_0 */ -#define PHY_BB_BBB_TXFIR_0_ADDRESS 0x0000a1f4 -#define PHY_BB_BBB_TXFIR_0_OFFSET 0x0000a1f4 -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H0_MSB 3 -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H0_LSB 0 -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H0_MASK 0x0000000f -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H0_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H0_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H1_MSB 11 -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H1_LSB 8 -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H1_MASK 0x00000f00 -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H1_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H1_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H2_MSB 20 -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H2_LSB 16 -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H2_MASK 0x001f0000 -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H2_GET(x) (((x) & 0x001f0000) >> 16) -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H2_SET(x) (((x) << 16) & 0x001f0000) -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H3_MSB 28 -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H3_LSB 24 -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H3_MASK 0x1f000000 -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H3_GET(x) (((x) & 0x1f000000) >> 24) -#define PHY_BB_BBB_TXFIR_0_TXFIR_COEFF_H3_SET(x) (((x) << 24) & 0x1f000000) - -/* macros for BB_bbb_txfir_1 */ -#define PHY_BB_BBB_TXFIR_1_ADDRESS 0x0000a1f8 -#define PHY_BB_BBB_TXFIR_1_OFFSET 0x0000a1f8 -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H4_MSB 5 -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H4_LSB 0 -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H4_MASK 0x0000003f -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H4_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H4_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H5_MSB 13 -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H5_LSB 8 -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H5_MASK 0x00003f00 -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H5_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H5_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H6_MSB 22 -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H6_LSB 16 -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H6_MASK 0x007f0000 -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H6_GET(x) (((x) & 0x007f0000) >> 16) -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H6_SET(x) (((x) << 16) & 0x007f0000) -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H7_MSB 30 -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H7_LSB 24 -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H7_MASK 0x7f000000 -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H7_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_BB_BBB_TXFIR_1_TXFIR_COEFF_H7_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for BB_bbb_txfir_2 */ -#define PHY_BB_BBB_TXFIR_2_ADDRESS 0x0000a1fc -#define PHY_BB_BBB_TXFIR_2_OFFSET 0x0000a1fc -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H8_MSB 7 -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H8_LSB 0 -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H8_MASK 0x000000ff -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H8_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H8_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H9_MSB 15 -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H9_LSB 8 -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H9_MASK 0x0000ff00 -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H9_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H9_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H10_MSB 23 -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H10_LSB 16 -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H10_MASK 0x00ff0000 -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H10_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H10_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H11_MSB 31 -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H11_LSB 24 -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H11_MASK 0xff000000 -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H11_GET(x) (((x) & 0xff000000) >> 24) -#define PHY_BB_BBB_TXFIR_2_TXFIR_COEFF_H11_SET(x) (((x) << 24) & 0xff000000) - -/* macros for BB_modes_select */ -#define PHY_BB_MODES_SELECT_ADDRESS 0x0000a200 -#define PHY_BB_MODES_SELECT_OFFSET 0x0000a200 -#define PHY_BB_MODES_SELECT_CCK_MODE_MSB 0 -#define PHY_BB_MODES_SELECT_CCK_MODE_LSB 0 -#define PHY_BB_MODES_SELECT_CCK_MODE_MASK 0x00000001 -#define PHY_BB_MODES_SELECT_CCK_MODE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_MODES_SELECT_CCK_MODE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_MODES_SELECT_DYN_OFDM_CCK_MODE_MSB 2 -#define PHY_BB_MODES_SELECT_DYN_OFDM_CCK_MODE_LSB 2 -#define PHY_BB_MODES_SELECT_DYN_OFDM_CCK_MODE_MASK 0x00000004 -#define PHY_BB_MODES_SELECT_DYN_OFDM_CCK_MODE_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_BB_MODES_SELECT_DYN_OFDM_CCK_MODE_SET(x) (((x) << 2) & 0x00000004) -#define PHY_BB_MODES_SELECT_HALF_RATE_MODE_MSB 5 -#define PHY_BB_MODES_SELECT_HALF_RATE_MODE_LSB 5 -#define PHY_BB_MODES_SELECT_HALF_RATE_MODE_MASK 0x00000020 -#define PHY_BB_MODES_SELECT_HALF_RATE_MODE_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_BB_MODES_SELECT_HALF_RATE_MODE_SET(x) (((x) << 5) & 0x00000020) -#define PHY_BB_MODES_SELECT_QUARTER_RATE_MODE_MSB 6 -#define PHY_BB_MODES_SELECT_QUARTER_RATE_MODE_LSB 6 -#define PHY_BB_MODES_SELECT_QUARTER_RATE_MODE_MASK 0x00000040 -#define PHY_BB_MODES_SELECT_QUARTER_RATE_MODE_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_BB_MODES_SELECT_QUARTER_RATE_MODE_SET(x) (((x) << 6) & 0x00000040) -#define PHY_BB_MODES_SELECT_MAC_CLK_MODE_MSB 7 -#define PHY_BB_MODES_SELECT_MAC_CLK_MODE_LSB 7 -#define PHY_BB_MODES_SELECT_MAC_CLK_MODE_MASK 0x00000080 -#define PHY_BB_MODES_SELECT_MAC_CLK_MODE_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_BB_MODES_SELECT_MAC_CLK_MODE_SET(x) (((x) << 7) & 0x00000080) -#define PHY_BB_MODES_SELECT_DISABLE_DYN_CCK_DET_MSB 8 -#define PHY_BB_MODES_SELECT_DISABLE_DYN_CCK_DET_LSB 8 -#define PHY_BB_MODES_SELECT_DISABLE_DYN_CCK_DET_MASK 0x00000100 -#define PHY_BB_MODES_SELECT_DISABLE_DYN_CCK_DET_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_BB_MODES_SELECT_DISABLE_DYN_CCK_DET_SET(x) (((x) << 8) & 0x00000100) - -/* macros for BB_bbb_tx_ctrl */ -#define PHY_BB_BBB_TX_CTRL_ADDRESS 0x0000a204 -#define PHY_BB_BBB_TX_CTRL_OFFSET 0x0000a204 -#define PHY_BB_BBB_TX_CTRL_DISABLE_SCRAMBLER_MSB 0 -#define PHY_BB_BBB_TX_CTRL_DISABLE_SCRAMBLER_LSB 0 -#define PHY_BB_BBB_TX_CTRL_DISABLE_SCRAMBLER_MASK 0x00000001 -#define PHY_BB_BBB_TX_CTRL_DISABLE_SCRAMBLER_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_BBB_TX_CTRL_DISABLE_SCRAMBLER_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_BBB_TX_CTRL_USE_SCRAMBLER_SEED_MSB 1 -#define PHY_BB_BBB_TX_CTRL_USE_SCRAMBLER_SEED_LSB 1 -#define PHY_BB_BBB_TX_CTRL_USE_SCRAMBLER_SEED_MASK 0x00000002 -#define PHY_BB_BBB_TX_CTRL_USE_SCRAMBLER_SEED_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_BBB_TX_CTRL_USE_SCRAMBLER_SEED_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_BBB_TX_CTRL_TX_DAC_SCALE_CCK_MSB 3 -#define PHY_BB_BBB_TX_CTRL_TX_DAC_SCALE_CCK_LSB 2 -#define PHY_BB_BBB_TX_CTRL_TX_DAC_SCALE_CCK_MASK 0x0000000c -#define PHY_BB_BBB_TX_CTRL_TX_DAC_SCALE_CCK_GET(x) (((x) & 0x0000000c) >> 2) -#define PHY_BB_BBB_TX_CTRL_TX_DAC_SCALE_CCK_SET(x) (((x) << 2) & 0x0000000c) -#define PHY_BB_BBB_TX_CTRL_TXFIR_JAPAN_CCK_MSB 4 -#define PHY_BB_BBB_TX_CTRL_TXFIR_JAPAN_CCK_LSB 4 -#define PHY_BB_BBB_TX_CTRL_TXFIR_JAPAN_CCK_MASK 0x00000010 -#define PHY_BB_BBB_TX_CTRL_TXFIR_JAPAN_CCK_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_BB_BBB_TX_CTRL_TXFIR_JAPAN_CCK_SET(x) (((x) << 4) & 0x00000010) -#define PHY_BB_BBB_TX_CTRL_ALLOW_1MBPS_SHORT_MSB 5 -#define PHY_BB_BBB_TX_CTRL_ALLOW_1MBPS_SHORT_LSB 5 -#define PHY_BB_BBB_TX_CTRL_ALLOW_1MBPS_SHORT_MASK 0x00000020 -#define PHY_BB_BBB_TX_CTRL_ALLOW_1MBPS_SHORT_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_BB_BBB_TX_CTRL_ALLOW_1MBPS_SHORT_SET(x) (((x) << 5) & 0x00000020) -#define PHY_BB_BBB_TX_CTRL_TX_CCK_DELAY_1_MSB 8 -#define PHY_BB_BBB_TX_CTRL_TX_CCK_DELAY_1_LSB 6 -#define PHY_BB_BBB_TX_CTRL_TX_CCK_DELAY_1_MASK 0x000001c0 -#define PHY_BB_BBB_TX_CTRL_TX_CCK_DELAY_1_GET(x) (((x) & 0x000001c0) >> 6) -#define PHY_BB_BBB_TX_CTRL_TX_CCK_DELAY_1_SET(x) (((x) << 6) & 0x000001c0) -#define PHY_BB_BBB_TX_CTRL_TX_CCK_DELAY_2_MSB 11 -#define PHY_BB_BBB_TX_CTRL_TX_CCK_DELAY_2_LSB 9 -#define PHY_BB_BBB_TX_CTRL_TX_CCK_DELAY_2_MASK 0x00000e00 -#define PHY_BB_BBB_TX_CTRL_TX_CCK_DELAY_2_GET(x) (((x) & 0x00000e00) >> 9) -#define PHY_BB_BBB_TX_CTRL_TX_CCK_DELAY_2_SET(x) (((x) << 9) & 0x00000e00) - -/* macros for BB_bbb_sig_detect */ -#define PHY_BB_BBB_SIG_DETECT_ADDRESS 0x0000a208 -#define PHY_BB_BBB_SIG_DETECT_OFFSET 0x0000a208 -#define PHY_BB_BBB_SIG_DETECT_WEAK_SIG_THR_CCK_MSB 5 -#define PHY_BB_BBB_SIG_DETECT_WEAK_SIG_THR_CCK_LSB 0 -#define PHY_BB_BBB_SIG_DETECT_WEAK_SIG_THR_CCK_MASK 0x0000003f -#define PHY_BB_BBB_SIG_DETECT_WEAK_SIG_THR_CCK_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_BBB_SIG_DETECT_WEAK_SIG_THR_CCK_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_BBB_SIG_DETECT_ANT_SWITCH_TIME_MSB 12 -#define PHY_BB_BBB_SIG_DETECT_ANT_SWITCH_TIME_LSB 6 -#define PHY_BB_BBB_SIG_DETECT_ANT_SWITCH_TIME_MASK 0x00001fc0 -#define PHY_BB_BBB_SIG_DETECT_ANT_SWITCH_TIME_GET(x) (((x) & 0x00001fc0) >> 6) -#define PHY_BB_BBB_SIG_DETECT_ANT_SWITCH_TIME_SET(x) (((x) << 6) & 0x00001fc0) -#define PHY_BB_BBB_SIG_DETECT_ENABLE_ANT_FAST_DIV_MSB 13 -#define PHY_BB_BBB_SIG_DETECT_ENABLE_ANT_FAST_DIV_LSB 13 -#define PHY_BB_BBB_SIG_DETECT_ENABLE_ANT_FAST_DIV_MASK 0x00002000 -#define PHY_BB_BBB_SIG_DETECT_ENABLE_ANT_FAST_DIV_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_BB_BBB_SIG_DETECT_ENABLE_ANT_FAST_DIV_SET(x) (((x) << 13) & 0x00002000) -#define PHY_BB_BBB_SIG_DETECT_LB_ALPHA_128_CCK_MSB 14 -#define PHY_BB_BBB_SIG_DETECT_LB_ALPHA_128_CCK_LSB 14 -#define PHY_BB_BBB_SIG_DETECT_LB_ALPHA_128_CCK_MASK 0x00004000 -#define PHY_BB_BBB_SIG_DETECT_LB_ALPHA_128_CCK_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_BB_BBB_SIG_DETECT_LB_ALPHA_128_CCK_SET(x) (((x) << 14) & 0x00004000) -#define PHY_BB_BBB_SIG_DETECT_LB_RX_ENABLE_CCK_MSB 15 -#define PHY_BB_BBB_SIG_DETECT_LB_RX_ENABLE_CCK_LSB 15 -#define PHY_BB_BBB_SIG_DETECT_LB_RX_ENABLE_CCK_MASK 0x00008000 -#define PHY_BB_BBB_SIG_DETECT_LB_RX_ENABLE_CCK_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_BB_BBB_SIG_DETECT_LB_RX_ENABLE_CCK_SET(x) (((x) << 15) & 0x00008000) -#define PHY_BB_BBB_SIG_DETECT_CYC32_COARSE_DC_EST_CCK_MSB 16 -#define PHY_BB_BBB_SIG_DETECT_CYC32_COARSE_DC_EST_CCK_LSB 16 -#define PHY_BB_BBB_SIG_DETECT_CYC32_COARSE_DC_EST_CCK_MASK 0x00010000 -#define PHY_BB_BBB_SIG_DETECT_CYC32_COARSE_DC_EST_CCK_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_BB_BBB_SIG_DETECT_CYC32_COARSE_DC_EST_CCK_SET(x) (((x) << 16) & 0x00010000) -#define PHY_BB_BBB_SIG_DETECT_CYC64_COARSE_DC_EST_CCK_MSB 17 -#define PHY_BB_BBB_SIG_DETECT_CYC64_COARSE_DC_EST_CCK_LSB 17 -#define PHY_BB_BBB_SIG_DETECT_CYC64_COARSE_DC_EST_CCK_MASK 0x00020000 -#define PHY_BB_BBB_SIG_DETECT_CYC64_COARSE_DC_EST_CCK_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_BB_BBB_SIG_DETECT_CYC64_COARSE_DC_EST_CCK_SET(x) (((x) << 17) & 0x00020000) -#define PHY_BB_BBB_SIG_DETECT_ENABLE_COARSE_DC_CCK_MSB 18 -#define PHY_BB_BBB_SIG_DETECT_ENABLE_COARSE_DC_CCK_LSB 18 -#define PHY_BB_BBB_SIG_DETECT_ENABLE_COARSE_DC_CCK_MASK 0x00040000 -#define PHY_BB_BBB_SIG_DETECT_ENABLE_COARSE_DC_CCK_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_BB_BBB_SIG_DETECT_ENABLE_COARSE_DC_CCK_SET(x) (((x) << 18) & 0x00040000) -#define PHY_BB_BBB_SIG_DETECT_CYC256_FINE_DC_EST_CCK_MSB 19 -#define PHY_BB_BBB_SIG_DETECT_CYC256_FINE_DC_EST_CCK_LSB 19 -#define PHY_BB_BBB_SIG_DETECT_CYC256_FINE_DC_EST_CCK_MASK 0x00080000 -#define PHY_BB_BBB_SIG_DETECT_CYC256_FINE_DC_EST_CCK_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_BB_BBB_SIG_DETECT_CYC256_FINE_DC_EST_CCK_SET(x) (((x) << 19) & 0x00080000) -#define PHY_BB_BBB_SIG_DETECT_ENABLE_FINE_DC_CCK_MSB 20 -#define PHY_BB_BBB_SIG_DETECT_ENABLE_FINE_DC_CCK_LSB 20 -#define PHY_BB_BBB_SIG_DETECT_ENABLE_FINE_DC_CCK_MASK 0x00100000 -#define PHY_BB_BBB_SIG_DETECT_ENABLE_FINE_DC_CCK_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_BB_BBB_SIG_DETECT_ENABLE_FINE_DC_CCK_SET(x) (((x) << 20) & 0x00100000) -#define PHY_BB_BBB_SIG_DETECT_DELAY_START_SYNC_CCK_MSB 21 -#define PHY_BB_BBB_SIG_DETECT_DELAY_START_SYNC_CCK_LSB 21 -#define PHY_BB_BBB_SIG_DETECT_DELAY_START_SYNC_CCK_MASK 0x00200000 -#define PHY_BB_BBB_SIG_DETECT_DELAY_START_SYNC_CCK_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_BB_BBB_SIG_DETECT_DELAY_START_SYNC_CCK_SET(x) (((x) << 21) & 0x00200000) -#define PHY_BB_BBB_SIG_DETECT_USE_DC_EST_DURING_SRCH_MSB 22 -#define PHY_BB_BBB_SIG_DETECT_USE_DC_EST_DURING_SRCH_LSB 22 -#define PHY_BB_BBB_SIG_DETECT_USE_DC_EST_DURING_SRCH_MASK 0x00400000 -#define PHY_BB_BBB_SIG_DETECT_USE_DC_EST_DURING_SRCH_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_BB_BBB_SIG_DETECT_USE_DC_EST_DURING_SRCH_SET(x) (((x) << 22) & 0x00400000) -#define PHY_BB_BBB_SIG_DETECT_ENABLE_BARKER_TWO_PHASE_MSB 31 -#define PHY_BB_BBB_SIG_DETECT_ENABLE_BARKER_TWO_PHASE_LSB 31 -#define PHY_BB_BBB_SIG_DETECT_ENABLE_BARKER_TWO_PHASE_MASK 0x80000000 -#define PHY_BB_BBB_SIG_DETECT_ENABLE_BARKER_TWO_PHASE_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_BBB_SIG_DETECT_ENABLE_BARKER_TWO_PHASE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_ext_atten_switch_ctl_b0 */ -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_ADDRESS 0x0000a20c -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_OFFSET 0x0000a20c -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_DB_0_MSB 5 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_DB_0_LSB 0 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_DB_0_MASK 0x0000003f -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_DB_0_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_DB_0_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_DB_0_MSB 11 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_DB_0_LSB 6 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_DB_0_MASK 0x00000fc0 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_DB_0_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_DB_0_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_MARGIN_0_MSB 16 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_MARGIN_0_LSB 12 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_MARGIN_0_MASK 0x0001f000 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_MARGIN_0_GET(x) (((x) & 0x0001f000) >> 12) -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_MARGIN_0_SET(x) (((x) << 12) & 0x0001f000) -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_MARGIN_0_MSB 21 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_MARGIN_0_LSB 17 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_MARGIN_0_MASK 0x003e0000 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_MARGIN_0_GET(x) (((x) & 0x003e0000) >> 17) -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_MARGIN_0_SET(x) (((x) << 17) & 0x003e0000) - -/* macros for BB_bbb_rx_ctrl_1 */ -#define PHY_BB_BBB_RX_CTRL_1_ADDRESS 0x0000a210 -#define PHY_BB_BBB_RX_CTRL_1_OFFSET 0x0000a210 -#define PHY_BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_2_MSB 2 -#define PHY_BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_2_LSB 0 -#define PHY_BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_2_MASK 0x00000007 -#define PHY_BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_2_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_2_SET(x) (((x) << 0) & 0x00000007) -#define PHY_BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_MSB 7 -#define PHY_BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_LSB 3 -#define PHY_BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_MASK 0x000000f8 -#define PHY_BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_GET(x) (((x) & 0x000000f8) >> 3) -#define PHY_BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_SET(x) (((x) << 3) & 0x000000f8) -#define PHY_BB_BBB_RX_CTRL_1_COARSE_TIM_N_SYNC_MSB 10 -#define PHY_BB_BBB_RX_CTRL_1_COARSE_TIM_N_SYNC_LSB 8 -#define PHY_BB_BBB_RX_CTRL_1_COARSE_TIM_N_SYNC_MASK 0x00000700 -#define PHY_BB_BBB_RX_CTRL_1_COARSE_TIM_N_SYNC_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_BB_BBB_RX_CTRL_1_COARSE_TIM_N_SYNC_SET(x) (((x) << 8) & 0x00000700) -#define PHY_BB_BBB_RX_CTRL_1_MAX_BAL_LONG_MSB 15 -#define PHY_BB_BBB_RX_CTRL_1_MAX_BAL_LONG_LSB 11 -#define PHY_BB_BBB_RX_CTRL_1_MAX_BAL_LONG_MASK 0x0000f800 -#define PHY_BB_BBB_RX_CTRL_1_MAX_BAL_LONG_GET(x) (((x) & 0x0000f800) >> 11) -#define PHY_BB_BBB_RX_CTRL_1_MAX_BAL_LONG_SET(x) (((x) << 11) & 0x0000f800) -#define PHY_BB_BBB_RX_CTRL_1_MAX_BAL_SHORT_MSB 20 -#define PHY_BB_BBB_RX_CTRL_1_MAX_BAL_SHORT_LSB 16 -#define PHY_BB_BBB_RX_CTRL_1_MAX_BAL_SHORT_MASK 0x001f0000 -#define PHY_BB_BBB_RX_CTRL_1_MAX_BAL_SHORT_GET(x) (((x) & 0x001f0000) >> 16) -#define PHY_BB_BBB_RX_CTRL_1_MAX_BAL_SHORT_SET(x) (((x) << 16) & 0x001f0000) -#define PHY_BB_BBB_RX_CTRL_1_RECON_LMS_STEP_MSB 23 -#define PHY_BB_BBB_RX_CTRL_1_RECON_LMS_STEP_LSB 21 -#define PHY_BB_BBB_RX_CTRL_1_RECON_LMS_STEP_MASK 0x00e00000 -#define PHY_BB_BBB_RX_CTRL_1_RECON_LMS_STEP_GET(x) (((x) & 0x00e00000) >> 21) -#define PHY_BB_BBB_RX_CTRL_1_RECON_LMS_STEP_SET(x) (((x) << 21) & 0x00e00000) -#define PHY_BB_BBB_RX_CTRL_1_SB_CHECK_WIN_MSB 30 -#define PHY_BB_BBB_RX_CTRL_1_SB_CHECK_WIN_LSB 24 -#define PHY_BB_BBB_RX_CTRL_1_SB_CHECK_WIN_MASK 0x7f000000 -#define PHY_BB_BBB_RX_CTRL_1_SB_CHECK_WIN_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_BB_BBB_RX_CTRL_1_SB_CHECK_WIN_SET(x) (((x) << 24) & 0x7f000000) -#define PHY_BB_BBB_RX_CTRL_1_EN_RX_ABORT_CCK_MSB 31 -#define PHY_BB_BBB_RX_CTRL_1_EN_RX_ABORT_CCK_LSB 31 -#define PHY_BB_BBB_RX_CTRL_1_EN_RX_ABORT_CCK_MASK 0x80000000 -#define PHY_BB_BBB_RX_CTRL_1_EN_RX_ABORT_CCK_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_BBB_RX_CTRL_1_EN_RX_ABORT_CCK_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_bbb_rx_ctrl_2 */ -#define PHY_BB_BBB_RX_CTRL_2_ADDRESS 0x0000a214 -#define PHY_BB_BBB_RX_CTRL_2_OFFSET 0x0000a214 -#define PHY_BB_BBB_RX_CTRL_2_FREQ_EST_N_AVG_LONG_MSB 5 -#define PHY_BB_BBB_RX_CTRL_2_FREQ_EST_N_AVG_LONG_LSB 0 -#define PHY_BB_BBB_RX_CTRL_2_FREQ_EST_N_AVG_LONG_MASK 0x0000003f -#define PHY_BB_BBB_RX_CTRL_2_FREQ_EST_N_AVG_LONG_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_BBB_RX_CTRL_2_FREQ_EST_N_AVG_LONG_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_BBB_RX_CTRL_2_CHAN_AVG_LONG_MSB 11 -#define PHY_BB_BBB_RX_CTRL_2_CHAN_AVG_LONG_LSB 6 -#define PHY_BB_BBB_RX_CTRL_2_CHAN_AVG_LONG_MASK 0x00000fc0 -#define PHY_BB_BBB_RX_CTRL_2_CHAN_AVG_LONG_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_BBB_RX_CTRL_2_CHAN_AVG_LONG_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_BBB_RX_CTRL_2_COARSE_TIM_THRESHOLD_3_MSB 16 -#define PHY_BB_BBB_RX_CTRL_2_COARSE_TIM_THRESHOLD_3_LSB 12 -#define PHY_BB_BBB_RX_CTRL_2_COARSE_TIM_THRESHOLD_3_MASK 0x0001f000 -#define PHY_BB_BBB_RX_CTRL_2_COARSE_TIM_THRESHOLD_3_GET(x) (((x) & 0x0001f000) >> 12) -#define PHY_BB_BBB_RX_CTRL_2_COARSE_TIM_THRESHOLD_3_SET(x) (((x) << 12) & 0x0001f000) -#define PHY_BB_BBB_RX_CTRL_2_FREQ_TRACK_UPDATE_PERIOD_MSB 21 -#define PHY_BB_BBB_RX_CTRL_2_FREQ_TRACK_UPDATE_PERIOD_LSB 17 -#define PHY_BB_BBB_RX_CTRL_2_FREQ_TRACK_UPDATE_PERIOD_MASK 0x003e0000 -#define PHY_BB_BBB_RX_CTRL_2_FREQ_TRACK_UPDATE_PERIOD_GET(x) (((x) & 0x003e0000) >> 17) -#define PHY_BB_BBB_RX_CTRL_2_FREQ_TRACK_UPDATE_PERIOD_SET(x) (((x) << 17) & 0x003e0000) -#define PHY_BB_BBB_RX_CTRL_2_FREQ_EST_SCALING_PERIOD_MSB 25 -#define PHY_BB_BBB_RX_CTRL_2_FREQ_EST_SCALING_PERIOD_LSB 22 -#define PHY_BB_BBB_RX_CTRL_2_FREQ_EST_SCALING_PERIOD_MASK 0x03c00000 -#define PHY_BB_BBB_RX_CTRL_2_FREQ_EST_SCALING_PERIOD_GET(x) (((x) & 0x03c00000) >> 22) -#define PHY_BB_BBB_RX_CTRL_2_FREQ_EST_SCALING_PERIOD_SET(x) (((x) << 22) & 0x03c00000) -#define PHY_BB_BBB_RX_CTRL_2_LOOP_COEF_DPSK_C2_DATA_MSB 31 -#define PHY_BB_BBB_RX_CTRL_2_LOOP_COEF_DPSK_C2_DATA_LSB 26 -#define PHY_BB_BBB_RX_CTRL_2_LOOP_COEF_DPSK_C2_DATA_MASK 0xfc000000 -#define PHY_BB_BBB_RX_CTRL_2_LOOP_COEF_DPSK_C2_DATA_GET(x) (((x) & 0xfc000000) >> 26) -#define PHY_BB_BBB_RX_CTRL_2_LOOP_COEF_DPSK_C2_DATA_SET(x) (((x) << 26) & 0xfc000000) - -/* macros for BB_bbb_rx_ctrl_3 */ -#define PHY_BB_BBB_RX_CTRL_3_ADDRESS 0x0000a218 -#define PHY_BB_BBB_RX_CTRL_3_OFFSET 0x0000a218 -#define PHY_BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_DPSK_MSB 7 -#define PHY_BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_DPSK_LSB 0 -#define PHY_BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_DPSK_MASK 0x000000ff -#define PHY_BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_DPSK_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_DPSK_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_CCK_MSB 15 -#define PHY_BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_CCK_LSB 8 -#define PHY_BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_CCK_MASK 0x0000ff00 -#define PHY_BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_CCK_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_CCK_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_BBB_RX_CTRL_3_TIMER_N_SFD_MSB 23 -#define PHY_BB_BBB_RX_CTRL_3_TIMER_N_SFD_LSB 16 -#define PHY_BB_BBB_RX_CTRL_3_TIMER_N_SFD_MASK 0x00ff0000 -#define PHY_BB_BBB_RX_CTRL_3_TIMER_N_SFD_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_BB_BBB_RX_CTRL_3_TIMER_N_SFD_SET(x) (((x) << 16) & 0x00ff0000) - -/* macros for BB_bbb_rx_ctrl_4 */ -#define PHY_BB_BBB_RX_CTRL_4_ADDRESS 0x0000a21c -#define PHY_BB_BBB_RX_CTRL_4_OFFSET 0x0000a21c -#define PHY_BB_BBB_RX_CTRL_4_TIMER_N_SYNC_MSB 3 -#define PHY_BB_BBB_RX_CTRL_4_TIMER_N_SYNC_LSB 0 -#define PHY_BB_BBB_RX_CTRL_4_TIMER_N_SYNC_MASK 0x0000000f -#define PHY_BB_BBB_RX_CTRL_4_TIMER_N_SYNC_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_BB_BBB_RX_CTRL_4_TIMER_N_SYNC_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_BB_BBB_RX_CTRL_4_TIM_ADJUST_TIMER_EXP_MSB 15 -#define PHY_BB_BBB_RX_CTRL_4_TIM_ADJUST_TIMER_EXP_LSB 4 -#define PHY_BB_BBB_RX_CTRL_4_TIM_ADJUST_TIMER_EXP_MASK 0x0000fff0 -#define PHY_BB_BBB_RX_CTRL_4_TIM_ADJUST_TIMER_EXP_GET(x) (((x) & 0x0000fff0) >> 4) -#define PHY_BB_BBB_RX_CTRL_4_TIM_ADJUST_TIMER_EXP_SET(x) (((x) << 4) & 0x0000fff0) -#define PHY_BB_BBB_RX_CTRL_4_FORCE_UNLOCKED_CLOCKS_MSB 16 -#define PHY_BB_BBB_RX_CTRL_4_FORCE_UNLOCKED_CLOCKS_LSB 16 -#define PHY_BB_BBB_RX_CTRL_4_FORCE_UNLOCKED_CLOCKS_MASK 0x00010000 -#define PHY_BB_BBB_RX_CTRL_4_FORCE_UNLOCKED_CLOCKS_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_BB_BBB_RX_CTRL_4_FORCE_UNLOCKED_CLOCKS_SET(x) (((x) << 16) & 0x00010000) -#define PHY_BB_BBB_RX_CTRL_4_DYNAMIC_PREAM_SEL_MSB 17 -#define PHY_BB_BBB_RX_CTRL_4_DYNAMIC_PREAM_SEL_LSB 17 -#define PHY_BB_BBB_RX_CTRL_4_DYNAMIC_PREAM_SEL_MASK 0x00020000 -#define PHY_BB_BBB_RX_CTRL_4_DYNAMIC_PREAM_SEL_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_BB_BBB_RX_CTRL_4_DYNAMIC_PREAM_SEL_SET(x) (((x) << 17) & 0x00020000) -#define PHY_BB_BBB_RX_CTRL_4_SHORT_PREAMBLE_MSB 18 -#define PHY_BB_BBB_RX_CTRL_4_SHORT_PREAMBLE_LSB 18 -#define PHY_BB_BBB_RX_CTRL_4_SHORT_PREAMBLE_MASK 0x00040000 -#define PHY_BB_BBB_RX_CTRL_4_SHORT_PREAMBLE_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_BB_BBB_RX_CTRL_4_SHORT_PREAMBLE_SET(x) (((x) << 18) & 0x00040000) -#define PHY_BB_BBB_RX_CTRL_4_FREQ_EST_N_AVG_SHORT_MSB 24 -#define PHY_BB_BBB_RX_CTRL_4_FREQ_EST_N_AVG_SHORT_LSB 19 -#define PHY_BB_BBB_RX_CTRL_4_FREQ_EST_N_AVG_SHORT_MASK 0x01f80000 -#define PHY_BB_BBB_RX_CTRL_4_FREQ_EST_N_AVG_SHORT_GET(x) (((x) & 0x01f80000) >> 19) -#define PHY_BB_BBB_RX_CTRL_4_FREQ_EST_N_AVG_SHORT_SET(x) (((x) << 19) & 0x01f80000) -#define PHY_BB_BBB_RX_CTRL_4_CHAN_AVG_SHORT_MSB 30 -#define PHY_BB_BBB_RX_CTRL_4_CHAN_AVG_SHORT_LSB 25 -#define PHY_BB_BBB_RX_CTRL_4_CHAN_AVG_SHORT_MASK 0x7e000000 -#define PHY_BB_BBB_RX_CTRL_4_CHAN_AVG_SHORT_GET(x) (((x) & 0x7e000000) >> 25) -#define PHY_BB_BBB_RX_CTRL_4_CHAN_AVG_SHORT_SET(x) (((x) << 25) & 0x7e000000) - -/* macros for BB_bbb_rx_ctrl_5 */ -#define PHY_BB_BBB_RX_CTRL_5_ADDRESS 0x0000a220 -#define PHY_BB_BBB_RX_CTRL_5_OFFSET 0x0000a220 -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_DATA_MSB 4 -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_DATA_LSB 0 -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_DATA_MASK 0x0000001f -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_DATA_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_DATA_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_HEAD_MSB 9 -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_HEAD_LSB 5 -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_HEAD_MASK 0x000003e0 -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_HEAD_GET(x) (((x) & 0x000003e0) >> 5) -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_HEAD_SET(x) (((x) << 5) & 0x000003e0) -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C2_HEAD_MSB 15 -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C2_HEAD_LSB 10 -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C2_HEAD_MASK 0x0000fc00 -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C2_HEAD_GET(x) (((x) & 0x0000fc00) >> 10) -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C2_HEAD_SET(x) (((x) << 10) & 0x0000fc00) -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C1_MSB 20 -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C1_LSB 16 -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C1_MASK 0x001f0000 -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C1_GET(x) (((x) & 0x001f0000) >> 16) -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C1_SET(x) (((x) << 16) & 0x001f0000) -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C2_MSB 26 -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C2_LSB 21 -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C2_MASK 0x07e00000 -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C2_GET(x) (((x) & 0x07e00000) >> 21) -#define PHY_BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C2_SET(x) (((x) << 21) & 0x07e00000) - -/* macros for BB_bbb_rx_ctrl_6 */ -#define PHY_BB_BBB_RX_CTRL_6_ADDRESS 0x0000a224 -#define PHY_BB_BBB_RX_CTRL_6_OFFSET 0x0000a224 -#define PHY_BB_BBB_RX_CTRL_6_SYNC_START_DELAY_MSB 9 -#define PHY_BB_BBB_RX_CTRL_6_SYNC_START_DELAY_LSB 0 -#define PHY_BB_BBB_RX_CTRL_6_SYNC_START_DELAY_MASK 0x000003ff -#define PHY_BB_BBB_RX_CTRL_6_SYNC_START_DELAY_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_BB_BBB_RX_CTRL_6_SYNC_START_DELAY_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_BB_BBB_RX_CTRL_6_MAP_1S_TO_2S_MSB 10 -#define PHY_BB_BBB_RX_CTRL_6_MAP_1S_TO_2S_LSB 10 -#define PHY_BB_BBB_RX_CTRL_6_MAP_1S_TO_2S_MASK 0x00000400 -#define PHY_BB_BBB_RX_CTRL_6_MAP_1S_TO_2S_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_BB_BBB_RX_CTRL_6_MAP_1S_TO_2S_SET(x) (((x) << 10) & 0x00000400) -#define PHY_BB_BBB_RX_CTRL_6_START_IIR_DELAY_MSB 20 -#define PHY_BB_BBB_RX_CTRL_6_START_IIR_DELAY_LSB 11 -#define PHY_BB_BBB_RX_CTRL_6_START_IIR_DELAY_MASK 0x001ff800 -#define PHY_BB_BBB_RX_CTRL_6_START_IIR_DELAY_GET(x) (((x) & 0x001ff800) >> 11) -#define PHY_BB_BBB_RX_CTRL_6_START_IIR_DELAY_SET(x) (((x) << 11) & 0x001ff800) - -/* macros for BB_bbb_dagc_ctrl */ -#define PHY_BB_BBB_DAGC_CTRL_ADDRESS 0x0000a228 -#define PHY_BB_BBB_DAGC_CTRL_OFFSET 0x0000a228 -#define PHY_BB_BBB_DAGC_CTRL_ENABLE_DAGC_CCK_MSB 0 -#define PHY_BB_BBB_DAGC_CTRL_ENABLE_DAGC_CCK_LSB 0 -#define PHY_BB_BBB_DAGC_CTRL_ENABLE_DAGC_CCK_MASK 0x00000001 -#define PHY_BB_BBB_DAGC_CTRL_ENABLE_DAGC_CCK_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_BBB_DAGC_CTRL_ENABLE_DAGC_CCK_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_BBB_DAGC_CTRL_DAGC_TARGET_PWR_CCK_MSB 8 -#define PHY_BB_BBB_DAGC_CTRL_DAGC_TARGET_PWR_CCK_LSB 1 -#define PHY_BB_BBB_DAGC_CTRL_DAGC_TARGET_PWR_CCK_MASK 0x000001fe -#define PHY_BB_BBB_DAGC_CTRL_DAGC_TARGET_PWR_CCK_GET(x) (((x) & 0x000001fe) >> 1) -#define PHY_BB_BBB_DAGC_CTRL_DAGC_TARGET_PWR_CCK_SET(x) (((x) << 1) & 0x000001fe) -#define PHY_BB_BBB_DAGC_CTRL_ENABLE_BARKER_RSSI_THR_MSB 9 -#define PHY_BB_BBB_DAGC_CTRL_ENABLE_BARKER_RSSI_THR_LSB 9 -#define PHY_BB_BBB_DAGC_CTRL_ENABLE_BARKER_RSSI_THR_MASK 0x00000200 -#define PHY_BB_BBB_DAGC_CTRL_ENABLE_BARKER_RSSI_THR_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_BB_BBB_DAGC_CTRL_ENABLE_BARKER_RSSI_THR_SET(x) (((x) << 9) & 0x00000200) -#define PHY_BB_BBB_DAGC_CTRL_BARKER_RSSI_THR_MSB 16 -#define PHY_BB_BBB_DAGC_CTRL_BARKER_RSSI_THR_LSB 10 -#define PHY_BB_BBB_DAGC_CTRL_BARKER_RSSI_THR_MASK 0x0001fc00 -#define PHY_BB_BBB_DAGC_CTRL_BARKER_RSSI_THR_GET(x) (((x) & 0x0001fc00) >> 10) -#define PHY_BB_BBB_DAGC_CTRL_BARKER_RSSI_THR_SET(x) (((x) << 10) & 0x0001fc00) -#define PHY_BB_BBB_DAGC_CTRL_ENABLE_FIRSTEP_SEL_MSB 17 -#define PHY_BB_BBB_DAGC_CTRL_ENABLE_FIRSTEP_SEL_LSB 17 -#define PHY_BB_BBB_DAGC_CTRL_ENABLE_FIRSTEP_SEL_MASK 0x00020000 -#define PHY_BB_BBB_DAGC_CTRL_ENABLE_FIRSTEP_SEL_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_BB_BBB_DAGC_CTRL_ENABLE_FIRSTEP_SEL_SET(x) (((x) << 17) & 0x00020000) -#define PHY_BB_BBB_DAGC_CTRL_FIRSTEP_2_MSB 23 -#define PHY_BB_BBB_DAGC_CTRL_FIRSTEP_2_LSB 18 -#define PHY_BB_BBB_DAGC_CTRL_FIRSTEP_2_MASK 0x00fc0000 -#define PHY_BB_BBB_DAGC_CTRL_FIRSTEP_2_GET(x) (((x) & 0x00fc0000) >> 18) -#define PHY_BB_BBB_DAGC_CTRL_FIRSTEP_2_SET(x) (((x) << 18) & 0x00fc0000) -#define PHY_BB_BBB_DAGC_CTRL_FIRSTEP_COUNT_LGMAX_MSB 27 -#define PHY_BB_BBB_DAGC_CTRL_FIRSTEP_COUNT_LGMAX_LSB 24 -#define PHY_BB_BBB_DAGC_CTRL_FIRSTEP_COUNT_LGMAX_MASK 0x0f000000 -#define PHY_BB_BBB_DAGC_CTRL_FIRSTEP_COUNT_LGMAX_GET(x) (((x) & 0x0f000000) >> 24) -#define PHY_BB_BBB_DAGC_CTRL_FIRSTEP_COUNT_LGMAX_SET(x) (((x) << 24) & 0x0f000000) - -/* macros for BB_force_clken_cck */ -#define PHY_BB_FORCE_CLKEN_CCK_ADDRESS 0x0000a22c -#define PHY_BB_FORCE_CLKEN_CCK_OFFSET 0x0000a22c -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE0_MSB 0 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE0_LSB 0 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE0_MASK 0x00000001 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE0_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE0_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE1_MSB 1 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE1_LSB 1 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE1_MASK 0x00000002 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE1_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE1_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE2_MSB 2 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE2_LSB 2 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE2_MASK 0x00000004 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE2_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE2_SET(x) (((x) << 2) & 0x00000004) -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE3_MSB 3 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE3_LSB 3 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE3_MASK 0x00000008 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE3_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE3_SET(x) (((x) << 3) & 0x00000008) -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ALWAYS_MSB 4 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ALWAYS_LSB 4 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ALWAYS_MASK 0x00000010 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ALWAYS_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_RX_ALWAYS_SET(x) (((x) << 4) & 0x00000010) -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_TXSM_CLKEN_MSB 5 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_TXSM_CLKEN_LSB 5 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_TXSM_CLKEN_MASK 0x00000020 -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_TXSM_CLKEN_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_BB_FORCE_CLKEN_CCK_FORCE_TXSM_CLKEN_SET(x) (((x) << 5) & 0x00000020) - -/* macros for BB_rx_clear_delay */ -#define PHY_BB_RX_CLEAR_DELAY_ADDRESS 0x0000a230 -#define PHY_BB_RX_CLEAR_DELAY_OFFSET 0x0000a230 -#define PHY_BB_RX_CLEAR_DELAY_OFDM_XR_RX_CLEAR_DELAY_MSB 9 -#define PHY_BB_RX_CLEAR_DELAY_OFDM_XR_RX_CLEAR_DELAY_LSB 0 -#define PHY_BB_RX_CLEAR_DELAY_OFDM_XR_RX_CLEAR_DELAY_MASK 0x000003ff -#define PHY_BB_RX_CLEAR_DELAY_OFDM_XR_RX_CLEAR_DELAY_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_BB_RX_CLEAR_DELAY_OFDM_XR_RX_CLEAR_DELAY_SET(x) (((x) << 0) & 0x000003ff) - -/* macros for BB_powertx_rate3 */ -#define PHY_BB_POWERTX_RATE3_ADDRESS 0x0000a234 -#define PHY_BB_POWERTX_RATE3_OFFSET 0x0000a234 -#define PHY_BB_POWERTX_RATE3_POWERTX_1L_MSB 5 -#define PHY_BB_POWERTX_RATE3_POWERTX_1L_LSB 0 -#define PHY_BB_POWERTX_RATE3_POWERTX_1L_MASK 0x0000003f -#define PHY_BB_POWERTX_RATE3_POWERTX_1L_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_POWERTX_RATE3_POWERTX_1L_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_POWERTX_RATE3_POWERTX_2L_MSB 21 -#define PHY_BB_POWERTX_RATE3_POWERTX_2L_LSB 16 -#define PHY_BB_POWERTX_RATE3_POWERTX_2L_MASK 0x003f0000 -#define PHY_BB_POWERTX_RATE3_POWERTX_2L_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_POWERTX_RATE3_POWERTX_2L_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_POWERTX_RATE3_POWERTX_2S_MSB 29 -#define PHY_BB_POWERTX_RATE3_POWERTX_2S_LSB 24 -#define PHY_BB_POWERTX_RATE3_POWERTX_2S_MASK 0x3f000000 -#define PHY_BB_POWERTX_RATE3_POWERTX_2S_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_BB_POWERTX_RATE3_POWERTX_2S_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for BB_powertx_rate4 */ -#define PHY_BB_POWERTX_RATE4_ADDRESS 0x0000a238 -#define PHY_BB_POWERTX_RATE4_OFFSET 0x0000a238 -#define PHY_BB_POWERTX_RATE4_POWERTX_55L_MSB 5 -#define PHY_BB_POWERTX_RATE4_POWERTX_55L_LSB 0 -#define PHY_BB_POWERTX_RATE4_POWERTX_55L_MASK 0x0000003f -#define PHY_BB_POWERTX_RATE4_POWERTX_55L_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_POWERTX_RATE4_POWERTX_55L_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_POWERTX_RATE4_POWERTX_55S_MSB 13 -#define PHY_BB_POWERTX_RATE4_POWERTX_55S_LSB 8 -#define PHY_BB_POWERTX_RATE4_POWERTX_55S_MASK 0x00003f00 -#define PHY_BB_POWERTX_RATE4_POWERTX_55S_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_BB_POWERTX_RATE4_POWERTX_55S_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_BB_POWERTX_RATE4_POWERTX_11L_MSB 21 -#define PHY_BB_POWERTX_RATE4_POWERTX_11L_LSB 16 -#define PHY_BB_POWERTX_RATE4_POWERTX_11L_MASK 0x003f0000 -#define PHY_BB_POWERTX_RATE4_POWERTX_11L_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_POWERTX_RATE4_POWERTX_11L_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_POWERTX_RATE4_POWERTX_11S_MSB 29 -#define PHY_BB_POWERTX_RATE4_POWERTX_11S_LSB 24 -#define PHY_BB_POWERTX_RATE4_POWERTX_11S_MASK 0x3f000000 -#define PHY_BB_POWERTX_RATE4_POWERTX_11S_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_BB_POWERTX_RATE4_POWERTX_11S_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for BB_cck_spur_mit */ -#define PHY_BB_CCK_SPUR_MIT_ADDRESS 0x0000a240 -#define PHY_BB_CCK_SPUR_MIT_OFFSET 0x0000a240 -#define PHY_BB_CCK_SPUR_MIT_USE_CCK_SPUR_MIT_MSB 0 -#define PHY_BB_CCK_SPUR_MIT_USE_CCK_SPUR_MIT_LSB 0 -#define PHY_BB_CCK_SPUR_MIT_USE_CCK_SPUR_MIT_MASK 0x00000001 -#define PHY_BB_CCK_SPUR_MIT_USE_CCK_SPUR_MIT_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_CCK_SPUR_MIT_USE_CCK_SPUR_MIT_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_CCK_SPUR_MIT_SPUR_RSSI_THR_MSB 8 -#define PHY_BB_CCK_SPUR_MIT_SPUR_RSSI_THR_LSB 1 -#define PHY_BB_CCK_SPUR_MIT_SPUR_RSSI_THR_MASK 0x000001fe -#define PHY_BB_CCK_SPUR_MIT_SPUR_RSSI_THR_GET(x) (((x) & 0x000001fe) >> 1) -#define PHY_BB_CCK_SPUR_MIT_SPUR_RSSI_THR_SET(x) (((x) << 1) & 0x000001fe) -#define PHY_BB_CCK_SPUR_MIT_CCK_SPUR_FREQ_MSB 28 -#define PHY_BB_CCK_SPUR_MIT_CCK_SPUR_FREQ_LSB 9 -#define PHY_BB_CCK_SPUR_MIT_CCK_SPUR_FREQ_MASK 0x1ffffe00 -#define PHY_BB_CCK_SPUR_MIT_CCK_SPUR_FREQ_GET(x) (((x) & 0x1ffffe00) >> 9) -#define PHY_BB_CCK_SPUR_MIT_CCK_SPUR_FREQ_SET(x) (((x) << 9) & 0x1ffffe00) -#define PHY_BB_CCK_SPUR_MIT_SPUR_FILTER_TYPE_MSB 30 -#define PHY_BB_CCK_SPUR_MIT_SPUR_FILTER_TYPE_LSB 29 -#define PHY_BB_CCK_SPUR_MIT_SPUR_FILTER_TYPE_MASK 0x60000000 -#define PHY_BB_CCK_SPUR_MIT_SPUR_FILTER_TYPE_GET(x) (((x) & 0x60000000) >> 29) -#define PHY_BB_CCK_SPUR_MIT_SPUR_FILTER_TYPE_SET(x) (((x) << 29) & 0x60000000) - -/* macros for BB_panic_watchdog_status */ -#define PHY_BB_PANIC_WATCHDOG_STATUS_ADDRESS 0x0000a244 -#define PHY_BB_PANIC_WATCHDOG_STATUS_OFFSET 0x0000a244 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_1_MSB 2 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_1_LSB 0 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_1_MASK 0x00000007 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_1_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_1_SET(x) (((x) << 0) & 0x00000007) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_DET_HANG_MSB 3 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_DET_HANG_LSB 3 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_DET_HANG_MASK 0x00000008 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_DET_HANG_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_DET_HANG_SET(x) (((x) << 3) & 0x00000008) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_2_MSB 7 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_2_LSB 4 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_2_MASK 0x000000f0 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_2_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_2_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_3_MSB 11 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_3_LSB 8 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_3_MASK 0x00000f00 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_3_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_3_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_4_MSB 15 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_4_LSB 12 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_4_MASK 0x0000f000 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_4_GET(x) (((x) & 0x0000f000) >> 12) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_4_SET(x) (((x) << 12) & 0x0000f000) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_5_MSB 19 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_5_LSB 16 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_5_MASK 0x000f0000 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_5_GET(x) (((x) & 0x000f0000) >> 16) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_5_SET(x) (((x) << 16) & 0x000f0000) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_6_MSB 23 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_6_LSB 20 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_6_MASK 0x00f00000 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_6_GET(x) (((x) & 0x00f00000) >> 20) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_6_SET(x) (((x) << 20) & 0x00f00000) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_7_MSB 27 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_7_LSB 24 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_7_MASK 0x0f000000 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_7_GET(x) (((x) & 0x0f000000) >> 24) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_7_SET(x) (((x) << 24) & 0x0f000000) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_8_MSB 31 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_8_LSB 28 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_8_MASK 0xf0000000 -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_8_GET(x) (((x) & 0xf0000000) >> 28) -#define PHY_BB_PANIC_WATCHDOG_STATUS_PANIC_WATCHDOG_STATUS_8_SET(x) (((x) << 28) & 0xf0000000) - -/* macros for BB_panic_watchdog_ctrl_1 */ -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_ADDRESS 0x0000a248 -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_OFFSET 0x0000a248 -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_ENABLE_PANIC_WATCHDOG_NON_IDLE_MSB 0 -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_ENABLE_PANIC_WATCHDOG_NON_IDLE_LSB 0 -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_ENABLE_PANIC_WATCHDOG_NON_IDLE_MASK 0x00000001 -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_ENABLE_PANIC_WATCHDOG_NON_IDLE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_ENABLE_PANIC_WATCHDOG_NON_IDLE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_ENABLE_PANIC_WATCHDOG_IDLE_MSB 1 -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_ENABLE_PANIC_WATCHDOG_IDLE_LSB 1 -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_ENABLE_PANIC_WATCHDOG_IDLE_MASK 0x00000002 -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_ENABLE_PANIC_WATCHDOG_IDLE_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_ENABLE_PANIC_WATCHDOG_IDLE_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_PANIC_WATCHDOG_NON_IDLE_LIMIT_MSB 15 -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_PANIC_WATCHDOG_NON_IDLE_LIMIT_LSB 2 -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_PANIC_WATCHDOG_NON_IDLE_LIMIT_MASK 0x0000fffc -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_PANIC_WATCHDOG_NON_IDLE_LIMIT_GET(x) (((x) & 0x0000fffc) >> 2) -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_PANIC_WATCHDOG_NON_IDLE_LIMIT_SET(x) (((x) << 2) & 0x0000fffc) -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_PANIC_WATCHDOG_IDLE_LIMIT_MSB 31 -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_PANIC_WATCHDOG_IDLE_LIMIT_LSB 16 -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_PANIC_WATCHDOG_IDLE_LIMIT_MASK 0xffff0000 -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_PANIC_WATCHDOG_IDLE_LIMIT_GET(x) (((x) & 0xffff0000) >> 16) -#define PHY_BB_PANIC_WATCHDOG_CTRL_1_PANIC_WATCHDOG_IDLE_LIMIT_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for BB_panic_watchdog_ctrl_2 */ -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_ADDRESS 0x0000a24c -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_OFFSET 0x0000a24c -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_FORCE_FAST_ADC_CLK_MSB 0 -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_FORCE_FAST_ADC_CLK_LSB 0 -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_FORCE_FAST_ADC_CLK_MASK 0x00000001 -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_FORCE_FAST_ADC_CLK_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_FORCE_FAST_ADC_CLK_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_PANIC_WATCHDOG_RESET_ENA_MSB 1 -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_PANIC_WATCHDOG_RESET_ENA_LSB 1 -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_PANIC_WATCHDOG_RESET_ENA_MASK 0x00000002 -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_PANIC_WATCHDOG_RESET_ENA_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_PANIC_WATCHDOG_RESET_ENA_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_PANIC_WATCHDOG_IRQ_ENA_MSB 2 -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_PANIC_WATCHDOG_IRQ_ENA_LSB 2 -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_PANIC_WATCHDOG_IRQ_ENA_MASK 0x00000004 -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_PANIC_WATCHDOG_IRQ_ENA_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_BB_PANIC_WATCHDOG_CTRL_2_PANIC_WATCHDOG_IRQ_ENA_SET(x) (((x) << 2) & 0x00000004) - -/* macros for BB_iqcorr_ctrl_cck */ -#define PHY_BB_IQCORR_CTRL_CCK_ADDRESS 0x0000a250 -#define PHY_BB_IQCORR_CTRL_CCK_OFFSET 0x0000a250 -#define PHY_BB_IQCORR_CTRL_CCK_IQCORR_Q_Q_COFF_CCK_MSB 4 -#define PHY_BB_IQCORR_CTRL_CCK_IQCORR_Q_Q_COFF_CCK_LSB 0 -#define PHY_BB_IQCORR_CTRL_CCK_IQCORR_Q_Q_COFF_CCK_MASK 0x0000001f -#define PHY_BB_IQCORR_CTRL_CCK_IQCORR_Q_Q_COFF_CCK_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_IQCORR_CTRL_CCK_IQCORR_Q_Q_COFF_CCK_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_IQCORR_CTRL_CCK_IQCORR_Q_I_COFF_CCK_MSB 10 -#define PHY_BB_IQCORR_CTRL_CCK_IQCORR_Q_I_COFF_CCK_LSB 5 -#define PHY_BB_IQCORR_CTRL_CCK_IQCORR_Q_I_COFF_CCK_MASK 0x000007e0 -#define PHY_BB_IQCORR_CTRL_CCK_IQCORR_Q_I_COFF_CCK_GET(x) (((x) & 0x000007e0) >> 5) -#define PHY_BB_IQCORR_CTRL_CCK_IQCORR_Q_I_COFF_CCK_SET(x) (((x) << 5) & 0x000007e0) -#define PHY_BB_IQCORR_CTRL_CCK_ENABLE_IQCORR_CCK_MSB 11 -#define PHY_BB_IQCORR_CTRL_CCK_ENABLE_IQCORR_CCK_LSB 11 -#define PHY_BB_IQCORR_CTRL_CCK_ENABLE_IQCORR_CCK_MASK 0x00000800 -#define PHY_BB_IQCORR_CTRL_CCK_ENABLE_IQCORR_CCK_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_BB_IQCORR_CTRL_CCK_ENABLE_IQCORR_CCK_SET(x) (((x) << 11) & 0x00000800) -#define PHY_BB_IQCORR_CTRL_CCK_RXCAL_MEAS_TIME_SEL_MSB 13 -#define PHY_BB_IQCORR_CTRL_CCK_RXCAL_MEAS_TIME_SEL_LSB 12 -#define PHY_BB_IQCORR_CTRL_CCK_RXCAL_MEAS_TIME_SEL_MASK 0x00003000 -#define PHY_BB_IQCORR_CTRL_CCK_RXCAL_MEAS_TIME_SEL_GET(x) (((x) & 0x00003000) >> 12) -#define PHY_BB_IQCORR_CTRL_CCK_RXCAL_MEAS_TIME_SEL_SET(x) (((x) << 12) & 0x00003000) -#define PHY_BB_IQCORR_CTRL_CCK_CLCAL_MEAS_TIME_SEL_MSB 15 -#define PHY_BB_IQCORR_CTRL_CCK_CLCAL_MEAS_TIME_SEL_LSB 14 -#define PHY_BB_IQCORR_CTRL_CCK_CLCAL_MEAS_TIME_SEL_MASK 0x0000c000 -#define PHY_BB_IQCORR_CTRL_CCK_CLCAL_MEAS_TIME_SEL_GET(x) (((x) & 0x0000c000) >> 14) -#define PHY_BB_IQCORR_CTRL_CCK_CLCAL_MEAS_TIME_SEL_SET(x) (((x) << 14) & 0x0000c000) -#define PHY_BB_IQCORR_CTRL_CCK_CF_CLC_INIT_RFGAIN_MSB 20 -#define PHY_BB_IQCORR_CTRL_CCK_CF_CLC_INIT_RFGAIN_LSB 16 -#define PHY_BB_IQCORR_CTRL_CCK_CF_CLC_INIT_RFGAIN_MASK 0x001f0000 -#define PHY_BB_IQCORR_CTRL_CCK_CF_CLC_INIT_RFGAIN_GET(x) (((x) & 0x001f0000) >> 16) -#define PHY_BB_IQCORR_CTRL_CCK_CF_CLC_INIT_RFGAIN_SET(x) (((x) << 16) & 0x001f0000) -#define PHY_BB_IQCORR_CTRL_CCK_CF_CLC_PAL_MODE_MSB 21 -#define PHY_BB_IQCORR_CTRL_CCK_CF_CLC_PAL_MODE_LSB 21 -#define PHY_BB_IQCORR_CTRL_CCK_CF_CLC_PAL_MODE_MASK 0x00200000 -#define PHY_BB_IQCORR_CTRL_CCK_CF_CLC_PAL_MODE_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_BB_IQCORR_CTRL_CCK_CF_CLC_PAL_MODE_SET(x) (((x) << 21) & 0x00200000) - -/* macros for BB_bluetooth_cntl */ -#define PHY_BB_BLUETOOTH_CNTL_ADDRESS 0x0000a254 -#define PHY_BB_BLUETOOTH_CNTL_OFFSET 0x0000a254 -#define PHY_BB_BLUETOOTH_CNTL_BT_BREAK_CCK_EN_MSB 0 -#define PHY_BB_BLUETOOTH_CNTL_BT_BREAK_CCK_EN_LSB 0 -#define PHY_BB_BLUETOOTH_CNTL_BT_BREAK_CCK_EN_MASK 0x00000001 -#define PHY_BB_BLUETOOTH_CNTL_BT_BREAK_CCK_EN_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_BLUETOOTH_CNTL_BT_BREAK_CCK_EN_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_BLUETOOTH_CNTL_BT_ANT_HALT_WLAN_MSB 1 -#define PHY_BB_BLUETOOTH_CNTL_BT_ANT_HALT_WLAN_LSB 1 -#define PHY_BB_BLUETOOTH_CNTL_BT_ANT_HALT_WLAN_MASK 0x00000002 -#define PHY_BB_BLUETOOTH_CNTL_BT_ANT_HALT_WLAN_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_BLUETOOTH_CNTL_BT_ANT_HALT_WLAN_SET(x) (((x) << 1) & 0x00000002) - -/* macros for BB_tpc_1 */ -#define PHY_BB_TPC_1_ADDRESS 0x0000a258 -#define PHY_BB_TPC_1_OFFSET 0x0000a258 -#define PHY_BB_TPC_1_FORCE_DAC_GAIN_MSB 0 -#define PHY_BB_TPC_1_FORCE_DAC_GAIN_LSB 0 -#define PHY_BB_TPC_1_FORCE_DAC_GAIN_MASK 0x00000001 -#define PHY_BB_TPC_1_FORCE_DAC_GAIN_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_TPC_1_FORCE_DAC_GAIN_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_TPC_1_FORCED_DAC_GAIN_MSB 5 -#define PHY_BB_TPC_1_FORCED_DAC_GAIN_LSB 1 -#define PHY_BB_TPC_1_FORCED_DAC_GAIN_MASK 0x0000003e -#define PHY_BB_TPC_1_FORCED_DAC_GAIN_GET(x) (((x) & 0x0000003e) >> 1) -#define PHY_BB_TPC_1_FORCED_DAC_GAIN_SET(x) (((x) << 1) & 0x0000003e) -#define PHY_BB_TPC_1_PD_DC_OFFSET_TARGET_MSB 13 -#define PHY_BB_TPC_1_PD_DC_OFFSET_TARGET_LSB 6 -#define PHY_BB_TPC_1_PD_DC_OFFSET_TARGET_MASK 0x00003fc0 -#define PHY_BB_TPC_1_PD_DC_OFFSET_TARGET_GET(x) (((x) & 0x00003fc0) >> 6) -#define PHY_BB_TPC_1_PD_DC_OFFSET_TARGET_SET(x) (((x) << 6) & 0x00003fc0) -#define PHY_BB_TPC_1_NUM_PD_GAIN_MSB 15 -#define PHY_BB_TPC_1_NUM_PD_GAIN_LSB 14 -#define PHY_BB_TPC_1_NUM_PD_GAIN_MASK 0x0000c000 -#define PHY_BB_TPC_1_NUM_PD_GAIN_GET(x) (((x) & 0x0000c000) >> 14) -#define PHY_BB_TPC_1_NUM_PD_GAIN_SET(x) (((x) << 14) & 0x0000c000) -#define PHY_BB_TPC_1_PD_GAIN_SETTING1_MSB 17 -#define PHY_BB_TPC_1_PD_GAIN_SETTING1_LSB 16 -#define PHY_BB_TPC_1_PD_GAIN_SETTING1_MASK 0x00030000 -#define PHY_BB_TPC_1_PD_GAIN_SETTING1_GET(x) (((x) & 0x00030000) >> 16) -#define PHY_BB_TPC_1_PD_GAIN_SETTING1_SET(x) (((x) << 16) & 0x00030000) -#define PHY_BB_TPC_1_PD_GAIN_SETTING2_MSB 19 -#define PHY_BB_TPC_1_PD_GAIN_SETTING2_LSB 18 -#define PHY_BB_TPC_1_PD_GAIN_SETTING2_MASK 0x000c0000 -#define PHY_BB_TPC_1_PD_GAIN_SETTING2_GET(x) (((x) & 0x000c0000) >> 18) -#define PHY_BB_TPC_1_PD_GAIN_SETTING2_SET(x) (((x) << 18) & 0x000c0000) -#define PHY_BB_TPC_1_PD_GAIN_SETTING3_MSB 21 -#define PHY_BB_TPC_1_PD_GAIN_SETTING3_LSB 20 -#define PHY_BB_TPC_1_PD_GAIN_SETTING3_MASK 0x00300000 -#define PHY_BB_TPC_1_PD_GAIN_SETTING3_GET(x) (((x) & 0x00300000) >> 20) -#define PHY_BB_TPC_1_PD_GAIN_SETTING3_SET(x) (((x) << 20) & 0x00300000) -#define PHY_BB_TPC_1_ENABLE_PD_CALIBRATE_MSB 22 -#define PHY_BB_TPC_1_ENABLE_PD_CALIBRATE_LSB 22 -#define PHY_BB_TPC_1_ENABLE_PD_CALIBRATE_MASK 0x00400000 -#define PHY_BB_TPC_1_ENABLE_PD_CALIBRATE_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_BB_TPC_1_ENABLE_PD_CALIBRATE_SET(x) (((x) << 22) & 0x00400000) -#define PHY_BB_TPC_1_PD_CALIBRATE_WAIT_MSB 28 -#define PHY_BB_TPC_1_PD_CALIBRATE_WAIT_LSB 23 -#define PHY_BB_TPC_1_PD_CALIBRATE_WAIT_MASK 0x1f800000 -#define PHY_BB_TPC_1_PD_CALIBRATE_WAIT_GET(x) (((x) & 0x1f800000) >> 23) -#define PHY_BB_TPC_1_PD_CALIBRATE_WAIT_SET(x) (((x) << 23) & 0x1f800000) -#define PHY_BB_TPC_1_FORCE_PDADC_GAIN_MSB 29 -#define PHY_BB_TPC_1_FORCE_PDADC_GAIN_LSB 29 -#define PHY_BB_TPC_1_FORCE_PDADC_GAIN_MASK 0x20000000 -#define PHY_BB_TPC_1_FORCE_PDADC_GAIN_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_BB_TPC_1_FORCE_PDADC_GAIN_SET(x) (((x) << 29) & 0x20000000) -#define PHY_BB_TPC_1_FORCED_PDADC_GAIN_MSB 31 -#define PHY_BB_TPC_1_FORCED_PDADC_GAIN_LSB 30 -#define PHY_BB_TPC_1_FORCED_PDADC_GAIN_MASK 0xc0000000 -#define PHY_BB_TPC_1_FORCED_PDADC_GAIN_GET(x) (((x) & 0xc0000000) >> 30) -#define PHY_BB_TPC_1_FORCED_PDADC_GAIN_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for BB_tpc_2 */ -#define PHY_BB_TPC_2_ADDRESS 0x0000a25c -#define PHY_BB_TPC_2_OFFSET 0x0000a25c -#define PHY_BB_TPC_2_TX_FRAME_TO_PDADC_ON_MSB 7 -#define PHY_BB_TPC_2_TX_FRAME_TO_PDADC_ON_LSB 0 -#define PHY_BB_TPC_2_TX_FRAME_TO_PDADC_ON_MASK 0x000000ff -#define PHY_BB_TPC_2_TX_FRAME_TO_PDADC_ON_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_TPC_2_TX_FRAME_TO_PDADC_ON_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_TPC_2_TX_FRAME_TO_PD_ACC_OFDM_MSB 15 -#define PHY_BB_TPC_2_TX_FRAME_TO_PD_ACC_OFDM_LSB 8 -#define PHY_BB_TPC_2_TX_FRAME_TO_PD_ACC_OFDM_MASK 0x0000ff00 -#define PHY_BB_TPC_2_TX_FRAME_TO_PD_ACC_OFDM_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_TPC_2_TX_FRAME_TO_PD_ACC_OFDM_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_TPC_2_TX_FRAME_TO_PD_ACC_CCK_MSB 23 -#define PHY_BB_TPC_2_TX_FRAME_TO_PD_ACC_CCK_LSB 16 -#define PHY_BB_TPC_2_TX_FRAME_TO_PD_ACC_CCK_MASK 0x00ff0000 -#define PHY_BB_TPC_2_TX_FRAME_TO_PD_ACC_CCK_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_BB_TPC_2_TX_FRAME_TO_PD_ACC_CCK_SET(x) (((x) << 16) & 0x00ff0000) - -/* macros for BB_tpc_3 */ -#define PHY_BB_TPC_3_ADDRESS 0x0000a260 -#define PHY_BB_TPC_3_OFFSET 0x0000a260 -#define PHY_BB_TPC_3_TX_END_TO_PDADC_ON_MSB 7 -#define PHY_BB_TPC_3_TX_END_TO_PDADC_ON_LSB 0 -#define PHY_BB_TPC_3_TX_END_TO_PDADC_ON_MASK 0x000000ff -#define PHY_BB_TPC_3_TX_END_TO_PDADC_ON_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_TPC_3_TX_END_TO_PDADC_ON_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_TPC_3_TX_END_TO_PD_ACC_ON_MSB 15 -#define PHY_BB_TPC_3_TX_END_TO_PD_ACC_ON_LSB 8 -#define PHY_BB_TPC_3_TX_END_TO_PD_ACC_ON_MASK 0x0000ff00 -#define PHY_BB_TPC_3_TX_END_TO_PD_ACC_ON_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_TPC_3_TX_END_TO_PD_ACC_ON_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_TPC_3_PD_ACC_WINDOW_DC_OFF_MSB 18 -#define PHY_BB_TPC_3_PD_ACC_WINDOW_DC_OFF_LSB 16 -#define PHY_BB_TPC_3_PD_ACC_WINDOW_DC_OFF_MASK 0x00070000 -#define PHY_BB_TPC_3_PD_ACC_WINDOW_DC_OFF_GET(x) (((x) & 0x00070000) >> 16) -#define PHY_BB_TPC_3_PD_ACC_WINDOW_DC_OFF_SET(x) (((x) << 16) & 0x00070000) -#define PHY_BB_TPC_3_PD_ACC_WINDOW_CAL_MSB 21 -#define PHY_BB_TPC_3_PD_ACC_WINDOW_CAL_LSB 19 -#define PHY_BB_TPC_3_PD_ACC_WINDOW_CAL_MASK 0x00380000 -#define PHY_BB_TPC_3_PD_ACC_WINDOW_CAL_GET(x) (((x) & 0x00380000) >> 19) -#define PHY_BB_TPC_3_PD_ACC_WINDOW_CAL_SET(x) (((x) << 19) & 0x00380000) -#define PHY_BB_TPC_3_PD_ACC_WINDOW_OFDM_MSB 24 -#define PHY_BB_TPC_3_PD_ACC_WINDOW_OFDM_LSB 22 -#define PHY_BB_TPC_3_PD_ACC_WINDOW_OFDM_MASK 0x01c00000 -#define PHY_BB_TPC_3_PD_ACC_WINDOW_OFDM_GET(x) (((x) & 0x01c00000) >> 22) -#define PHY_BB_TPC_3_PD_ACC_WINDOW_OFDM_SET(x) (((x) << 22) & 0x01c00000) -#define PHY_BB_TPC_3_PD_ACC_WINDOW_CCK_MSB 27 -#define PHY_BB_TPC_3_PD_ACC_WINDOW_CCK_LSB 25 -#define PHY_BB_TPC_3_PD_ACC_WINDOW_CCK_MASK 0x0e000000 -#define PHY_BB_TPC_3_PD_ACC_WINDOW_CCK_GET(x) (((x) & 0x0e000000) >> 25) -#define PHY_BB_TPC_3_PD_ACC_WINDOW_CCK_SET(x) (((x) << 25) & 0x0e000000) -#define PHY_BB_TPC_3_TPC_CLK_GATE_ENABLE_MSB 31 -#define PHY_BB_TPC_3_TPC_CLK_GATE_ENABLE_LSB 31 -#define PHY_BB_TPC_3_TPC_CLK_GATE_ENABLE_MASK 0x80000000 -#define PHY_BB_TPC_3_TPC_CLK_GATE_ENABLE_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_TPC_3_TPC_CLK_GATE_ENABLE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_tpc_4_b0 */ -#define PHY_BB_TPC_4_B0_ADDRESS 0x0000a264 -#define PHY_BB_TPC_4_B0_OFFSET 0x0000a264 -#define PHY_BB_TPC_4_B0_PD_AVG_VALID_0_MSB 0 -#define PHY_BB_TPC_4_B0_PD_AVG_VALID_0_LSB 0 -#define PHY_BB_TPC_4_B0_PD_AVG_VALID_0_MASK 0x00000001 -#define PHY_BB_TPC_4_B0_PD_AVG_VALID_0_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_TPC_4_B0_PD_AVG_OUT_0_MSB 8 -#define PHY_BB_TPC_4_B0_PD_AVG_OUT_0_LSB 1 -#define PHY_BB_TPC_4_B0_PD_AVG_OUT_0_MASK 0x000001fe -#define PHY_BB_TPC_4_B0_PD_AVG_OUT_0_GET(x) (((x) & 0x000001fe) >> 1) -#define PHY_BB_TPC_4_B0_DAC_GAIN_0_MSB 13 -#define PHY_BB_TPC_4_B0_DAC_GAIN_0_LSB 9 -#define PHY_BB_TPC_4_B0_DAC_GAIN_0_MASK 0x00003e00 -#define PHY_BB_TPC_4_B0_DAC_GAIN_0_GET(x) (((x) & 0x00003e00) >> 9) -#define PHY_BB_TPC_4_B0_TX_GAIN_SETTING_0_MSB 19 -#define PHY_BB_TPC_4_B0_TX_GAIN_SETTING_0_LSB 14 -#define PHY_BB_TPC_4_B0_TX_GAIN_SETTING_0_MASK 0x000fc000 -#define PHY_BB_TPC_4_B0_TX_GAIN_SETTING_0_GET(x) (((x) & 0x000fc000) >> 14) -#define PHY_BB_TPC_4_B0_RATE_SENT_0_MSB 24 -#define PHY_BB_TPC_4_B0_RATE_SENT_0_LSB 20 -#define PHY_BB_TPC_4_B0_RATE_SENT_0_MASK 0x01f00000 -#define PHY_BB_TPC_4_B0_RATE_SENT_0_GET(x) (((x) & 0x01f00000) >> 20) -#define PHY_BB_TPC_4_B0_ERROR_EST_UPDATE_POWER_THRESH_MSB 30 -#define PHY_BB_TPC_4_B0_ERROR_EST_UPDATE_POWER_THRESH_LSB 25 -#define PHY_BB_TPC_4_B0_ERROR_EST_UPDATE_POWER_THRESH_MASK 0x7e000000 -#define PHY_BB_TPC_4_B0_ERROR_EST_UPDATE_POWER_THRESH_GET(x) (((x) & 0x7e000000) >> 25) -#define PHY_BB_TPC_4_B0_ERROR_EST_UPDATE_POWER_THRESH_SET(x) (((x) << 25) & 0x7e000000) - -/* macros for BB_analog_swap */ -#define PHY_BB_ANALOG_SWAP_ADDRESS 0x0000a268 -#define PHY_BB_ANALOG_SWAP_OFFSET 0x0000a268 -#define PHY_BB_ANALOG_SWAP_ANALOG_RX_SWAP_CNTL_MSB 2 -#define PHY_BB_ANALOG_SWAP_ANALOG_RX_SWAP_CNTL_LSB 0 -#define PHY_BB_ANALOG_SWAP_ANALOG_RX_SWAP_CNTL_MASK 0x00000007 -#define PHY_BB_ANALOG_SWAP_ANALOG_RX_SWAP_CNTL_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_BB_ANALOG_SWAP_ANALOG_RX_SWAP_CNTL_SET(x) (((x) << 0) & 0x00000007) -#define PHY_BB_ANALOG_SWAP_ANALOG_TX_SWAP_CNTL_MSB 5 -#define PHY_BB_ANALOG_SWAP_ANALOG_TX_SWAP_CNTL_LSB 3 -#define PHY_BB_ANALOG_SWAP_ANALOG_TX_SWAP_CNTL_MASK 0x00000038 -#define PHY_BB_ANALOG_SWAP_ANALOG_TX_SWAP_CNTL_GET(x) (((x) & 0x00000038) >> 3) -#define PHY_BB_ANALOG_SWAP_ANALOG_TX_SWAP_CNTL_SET(x) (((x) << 3) & 0x00000038) -#define PHY_BB_ANALOG_SWAP_SWAP_ALT_CHN_MSB 6 -#define PHY_BB_ANALOG_SWAP_SWAP_ALT_CHN_LSB 6 -#define PHY_BB_ANALOG_SWAP_SWAP_ALT_CHN_MASK 0x00000040 -#define PHY_BB_ANALOG_SWAP_SWAP_ALT_CHN_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_BB_ANALOG_SWAP_SWAP_ALT_CHN_SET(x) (((x) << 6) & 0x00000040) -#define PHY_BB_ANALOG_SWAP_ANALOG_DC_DAC_POLARITY_MSB 7 -#define PHY_BB_ANALOG_SWAP_ANALOG_DC_DAC_POLARITY_LSB 7 -#define PHY_BB_ANALOG_SWAP_ANALOG_DC_DAC_POLARITY_MASK 0x00000080 -#define PHY_BB_ANALOG_SWAP_ANALOG_DC_DAC_POLARITY_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_BB_ANALOG_SWAP_ANALOG_DC_DAC_POLARITY_SET(x) (((x) << 7) & 0x00000080) -#define PHY_BB_ANALOG_SWAP_ANALOG_PKDET_DAC_POLARITY_MSB 8 -#define PHY_BB_ANALOG_SWAP_ANALOG_PKDET_DAC_POLARITY_LSB 8 -#define PHY_BB_ANALOG_SWAP_ANALOG_PKDET_DAC_POLARITY_MASK 0x00000100 -#define PHY_BB_ANALOG_SWAP_ANALOG_PKDET_DAC_POLARITY_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_BB_ANALOG_SWAP_ANALOG_PKDET_DAC_POLARITY_SET(x) (((x) << 8) & 0x00000100) - -/* macros for BB_tpc_5_b0 */ -#define PHY_BB_TPC_5_B0_ADDRESS 0x0000a26c -#define PHY_BB_TPC_5_B0_OFFSET 0x0000a26c -#define PHY_BB_TPC_5_B0_PD_GAIN_OVERLAP_MSB 3 -#define PHY_BB_TPC_5_B0_PD_GAIN_OVERLAP_LSB 0 -#define PHY_BB_TPC_5_B0_PD_GAIN_OVERLAP_MASK 0x0000000f -#define PHY_BB_TPC_5_B0_PD_GAIN_OVERLAP_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_BB_TPC_5_B0_PD_GAIN_OVERLAP_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_1_0_MSB 9 -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_1_0_LSB 4 -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_1_0_MASK 0x000003f0 -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_1_0_GET(x) (((x) & 0x000003f0) >> 4) -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_1_0_SET(x) (((x) << 4) & 0x000003f0) -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_2_0_MSB 15 -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_2_0_LSB 10 -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_2_0_MASK 0x0000fc00 -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_2_0_GET(x) (((x) & 0x0000fc00) >> 10) -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_2_0_SET(x) (((x) << 10) & 0x0000fc00) -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_3_0_MSB 21 -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_3_0_LSB 16 -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_3_0_MASK 0x003f0000 -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_3_0_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_3_0_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_4_0_MSB 27 -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_4_0_LSB 22 -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_4_0_MASK 0x0fc00000 -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_4_0_GET(x) (((x) & 0x0fc00000) >> 22) -#define PHY_BB_TPC_5_B0_PD_GAIN_BOUNDARY_4_0_SET(x) (((x) << 22) & 0x0fc00000) - -/* macros for BB_tpc_6_b0 */ -#define PHY_BB_TPC_6_B0_ADDRESS 0x0000a270 -#define PHY_BB_TPC_6_B0_OFFSET 0x0000a270 -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_1_0_MSB 5 -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_1_0_LSB 0 -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_1_0_MASK 0x0000003f -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_1_0_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_1_0_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_2_0_MSB 11 -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_2_0_LSB 6 -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_2_0_MASK 0x00000fc0 -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_2_0_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_2_0_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_3_0_MSB 17 -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_3_0_LSB 12 -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_3_0_MASK 0x0003f000 -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_3_0_GET(x) (((x) & 0x0003f000) >> 12) -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_3_0_SET(x) (((x) << 12) & 0x0003f000) -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_4_0_MSB 23 -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_4_0_LSB 18 -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_4_0_MASK 0x00fc0000 -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_4_0_GET(x) (((x) & 0x00fc0000) >> 18) -#define PHY_BB_TPC_6_B0_PD_DAC_SETTING_4_0_SET(x) (((x) << 18) & 0x00fc0000) -#define PHY_BB_TPC_6_B0_ERROR_EST_MODE_MSB 25 -#define PHY_BB_TPC_6_B0_ERROR_EST_MODE_LSB 24 -#define PHY_BB_TPC_6_B0_ERROR_EST_MODE_MASK 0x03000000 -#define PHY_BB_TPC_6_B0_ERROR_EST_MODE_GET(x) (((x) & 0x03000000) >> 24) -#define PHY_BB_TPC_6_B0_ERROR_EST_MODE_SET(x) (((x) << 24) & 0x03000000) -#define PHY_BB_TPC_6_B0_ERROR_EST_FILTER_COEFF_MSB 28 -#define PHY_BB_TPC_6_B0_ERROR_EST_FILTER_COEFF_LSB 26 -#define PHY_BB_TPC_6_B0_ERROR_EST_FILTER_COEFF_MASK 0x1c000000 -#define PHY_BB_TPC_6_B0_ERROR_EST_FILTER_COEFF_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_BB_TPC_6_B0_ERROR_EST_FILTER_COEFF_SET(x) (((x) << 26) & 0x1c000000) - -/* macros for BB_tpc_7 */ -#define PHY_BB_TPC_7_ADDRESS 0x0000a274 -#define PHY_BB_TPC_7_OFFSET 0x0000a274 -#define PHY_BB_TPC_7_TX_GAIN_TABLE_MAX_MSB 5 -#define PHY_BB_TPC_7_TX_GAIN_TABLE_MAX_LSB 0 -#define PHY_BB_TPC_7_TX_GAIN_TABLE_MAX_MASK 0x0000003f -#define PHY_BB_TPC_7_TX_GAIN_TABLE_MAX_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_TPC_7_TX_GAIN_TABLE_MAX_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_TPC_7_INIT_TX_GAIN_SETTING_MSB 11 -#define PHY_BB_TPC_7_INIT_TX_GAIN_SETTING_LSB 6 -#define PHY_BB_TPC_7_INIT_TX_GAIN_SETTING_MASK 0x00000fc0 -#define PHY_BB_TPC_7_INIT_TX_GAIN_SETTING_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_TPC_7_INIT_TX_GAIN_SETTING_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_TPC_7_EN_CL_GAIN_MOD_MSB 12 -#define PHY_BB_TPC_7_EN_CL_GAIN_MOD_LSB 12 -#define PHY_BB_TPC_7_EN_CL_GAIN_MOD_MASK 0x00001000 -#define PHY_BB_TPC_7_EN_CL_GAIN_MOD_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_BB_TPC_7_EN_CL_GAIN_MOD_SET(x) (((x) << 12) & 0x00001000) -#define PHY_BB_TPC_7_USE_TX_PD_IN_XPA_MSB 13 -#define PHY_BB_TPC_7_USE_TX_PD_IN_XPA_LSB 13 -#define PHY_BB_TPC_7_USE_TX_PD_IN_XPA_MASK 0x00002000 -#define PHY_BB_TPC_7_USE_TX_PD_IN_XPA_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_BB_TPC_7_USE_TX_PD_IN_XPA_SET(x) (((x) << 13) & 0x00002000) -#define PHY_BB_TPC_7_EXTEND_TX_FRAME_FOR_TPC_MSB 14 -#define PHY_BB_TPC_7_EXTEND_TX_FRAME_FOR_TPC_LSB 14 -#define PHY_BB_TPC_7_EXTEND_TX_FRAME_FOR_TPC_MASK 0x00004000 -#define PHY_BB_TPC_7_EXTEND_TX_FRAME_FOR_TPC_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_BB_TPC_7_EXTEND_TX_FRAME_FOR_TPC_SET(x) (((x) << 14) & 0x00004000) -#define PHY_BB_TPC_7_USE_INIT_TX_GAIN_SETTING_AFTER_WARM_RESET_MSB 15 -#define PHY_BB_TPC_7_USE_INIT_TX_GAIN_SETTING_AFTER_WARM_RESET_LSB 15 -#define PHY_BB_TPC_7_USE_INIT_TX_GAIN_SETTING_AFTER_WARM_RESET_MASK 0x00008000 -#define PHY_BB_TPC_7_USE_INIT_TX_GAIN_SETTING_AFTER_WARM_RESET_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_BB_TPC_7_USE_INIT_TX_GAIN_SETTING_AFTER_WARM_RESET_SET(x) (((x) << 15) & 0x00008000) - -/* macros for BB_tpc_8 */ -#define PHY_BB_TPC_8_ADDRESS 0x0000a278 -#define PHY_BB_TPC_8_OFFSET 0x0000a278 -#define PHY_BB_TPC_8_DESIRED_SCALE_0_MSB 4 -#define PHY_BB_TPC_8_DESIRED_SCALE_0_LSB 0 -#define PHY_BB_TPC_8_DESIRED_SCALE_0_MASK 0x0000001f -#define PHY_BB_TPC_8_DESIRED_SCALE_0_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_TPC_8_DESIRED_SCALE_0_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_TPC_8_DESIRED_SCALE_1_MSB 9 -#define PHY_BB_TPC_8_DESIRED_SCALE_1_LSB 5 -#define PHY_BB_TPC_8_DESIRED_SCALE_1_MASK 0x000003e0 -#define PHY_BB_TPC_8_DESIRED_SCALE_1_GET(x) (((x) & 0x000003e0) >> 5) -#define PHY_BB_TPC_8_DESIRED_SCALE_1_SET(x) (((x) << 5) & 0x000003e0) -#define PHY_BB_TPC_8_DESIRED_SCALE_2_MSB 14 -#define PHY_BB_TPC_8_DESIRED_SCALE_2_LSB 10 -#define PHY_BB_TPC_8_DESIRED_SCALE_2_MASK 0x00007c00 -#define PHY_BB_TPC_8_DESIRED_SCALE_2_GET(x) (((x) & 0x00007c00) >> 10) -#define PHY_BB_TPC_8_DESIRED_SCALE_2_SET(x) (((x) << 10) & 0x00007c00) -#define PHY_BB_TPC_8_DESIRED_SCALE_3_MSB 19 -#define PHY_BB_TPC_8_DESIRED_SCALE_3_LSB 15 -#define PHY_BB_TPC_8_DESIRED_SCALE_3_MASK 0x000f8000 -#define PHY_BB_TPC_8_DESIRED_SCALE_3_GET(x) (((x) & 0x000f8000) >> 15) -#define PHY_BB_TPC_8_DESIRED_SCALE_3_SET(x) (((x) << 15) & 0x000f8000) -#define PHY_BB_TPC_8_DESIRED_SCALE_4_MSB 24 -#define PHY_BB_TPC_8_DESIRED_SCALE_4_LSB 20 -#define PHY_BB_TPC_8_DESIRED_SCALE_4_MASK 0x01f00000 -#define PHY_BB_TPC_8_DESIRED_SCALE_4_GET(x) (((x) & 0x01f00000) >> 20) -#define PHY_BB_TPC_8_DESIRED_SCALE_4_SET(x) (((x) << 20) & 0x01f00000) -#define PHY_BB_TPC_8_DESIRED_SCALE_5_MSB 29 -#define PHY_BB_TPC_8_DESIRED_SCALE_5_LSB 25 -#define PHY_BB_TPC_8_DESIRED_SCALE_5_MASK 0x3e000000 -#define PHY_BB_TPC_8_DESIRED_SCALE_5_GET(x) (((x) & 0x3e000000) >> 25) -#define PHY_BB_TPC_8_DESIRED_SCALE_5_SET(x) (((x) << 25) & 0x3e000000) - -/* macros for BB_tpc_9 */ -#define PHY_BB_TPC_9_ADDRESS 0x0000a27c -#define PHY_BB_TPC_9_OFFSET 0x0000a27c -#define PHY_BB_TPC_9_DESIRED_SCALE_6_MSB 4 -#define PHY_BB_TPC_9_DESIRED_SCALE_6_LSB 0 -#define PHY_BB_TPC_9_DESIRED_SCALE_6_MASK 0x0000001f -#define PHY_BB_TPC_9_DESIRED_SCALE_6_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_TPC_9_DESIRED_SCALE_6_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_TPC_9_DESIRED_SCALE_7_MSB 9 -#define PHY_BB_TPC_9_DESIRED_SCALE_7_LSB 5 -#define PHY_BB_TPC_9_DESIRED_SCALE_7_MASK 0x000003e0 -#define PHY_BB_TPC_9_DESIRED_SCALE_7_GET(x) (((x) & 0x000003e0) >> 5) -#define PHY_BB_TPC_9_DESIRED_SCALE_7_SET(x) (((x) << 5) & 0x000003e0) -#define PHY_BB_TPC_9_DESIRED_SCALE_CCK_MSB 14 -#define PHY_BB_TPC_9_DESIRED_SCALE_CCK_LSB 10 -#define PHY_BB_TPC_9_DESIRED_SCALE_CCK_MASK 0x00007c00 -#define PHY_BB_TPC_9_DESIRED_SCALE_CCK_GET(x) (((x) & 0x00007c00) >> 10) -#define PHY_BB_TPC_9_DESIRED_SCALE_CCK_SET(x) (((x) << 10) & 0x00007c00) -#define PHY_BB_TPC_9_EN_PD_DC_OFFSET_THR_MSB 20 -#define PHY_BB_TPC_9_EN_PD_DC_OFFSET_THR_LSB 20 -#define PHY_BB_TPC_9_EN_PD_DC_OFFSET_THR_MASK 0x00100000 -#define PHY_BB_TPC_9_EN_PD_DC_OFFSET_THR_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_BB_TPC_9_EN_PD_DC_OFFSET_THR_SET(x) (((x) << 20) & 0x00100000) -#define PHY_BB_TPC_9_PD_DC_OFFSET_THR_MSB 26 -#define PHY_BB_TPC_9_PD_DC_OFFSET_THR_LSB 21 -#define PHY_BB_TPC_9_PD_DC_OFFSET_THR_MASK 0x07e00000 -#define PHY_BB_TPC_9_PD_DC_OFFSET_THR_GET(x) (((x) & 0x07e00000) >> 21) -#define PHY_BB_TPC_9_PD_DC_OFFSET_THR_SET(x) (((x) << 21) & 0x07e00000) -#define PHY_BB_TPC_9_WAIT_CALTX_SETTLE_MSB 30 -#define PHY_BB_TPC_9_WAIT_CALTX_SETTLE_LSB 27 -#define PHY_BB_TPC_9_WAIT_CALTX_SETTLE_MASK 0x78000000 -#define PHY_BB_TPC_9_WAIT_CALTX_SETTLE_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_BB_TPC_9_WAIT_CALTX_SETTLE_SET(x) (((x) << 27) & 0x78000000) -#define PHY_BB_TPC_9_DISABLE_PDADC_RESIDUAL_DC_REMOVAL_MSB 31 -#define PHY_BB_TPC_9_DISABLE_PDADC_RESIDUAL_DC_REMOVAL_LSB 31 -#define PHY_BB_TPC_9_DISABLE_PDADC_RESIDUAL_DC_REMOVAL_MASK 0x80000000 -#define PHY_BB_TPC_9_DISABLE_PDADC_RESIDUAL_DC_REMOVAL_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_TPC_9_DISABLE_PDADC_RESIDUAL_DC_REMOVAL_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_pdadc_tab_b0 */ -#define PHY_BB_PDADC_TAB_B0_ADDRESS 0x0000a280 -#define PHY_BB_PDADC_TAB_B0_OFFSET 0x0000a280 -#define PHY_BB_PDADC_TAB_B0_TAB_ENTRY_MSB 31 -#define PHY_BB_PDADC_TAB_B0_TAB_ENTRY_LSB 0 -#define PHY_BB_PDADC_TAB_B0_TAB_ENTRY_MASK 0xffffffff -#define PHY_BB_PDADC_TAB_B0_TAB_ENTRY_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_cl_tab_b0 */ -#define PHY_BB_CL_TAB_B0_ADDRESS 0x0000a300 -#define PHY_BB_CL_TAB_B0_OFFSET 0x0000a300 -#define PHY_BB_CL_TAB_B0_CL_GAIN_MOD_MSB 4 -#define PHY_BB_CL_TAB_B0_CL_GAIN_MOD_LSB 0 -#define PHY_BB_CL_TAB_B0_CL_GAIN_MOD_MASK 0x0000001f -#define PHY_BB_CL_TAB_B0_CL_GAIN_MOD_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_CL_TAB_B0_CL_GAIN_MOD_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_CL_TAB_B0_CARR_LK_DC_ADD_Q_MSB 15 -#define PHY_BB_CL_TAB_B0_CARR_LK_DC_ADD_Q_LSB 5 -#define PHY_BB_CL_TAB_B0_CARR_LK_DC_ADD_Q_MASK 0x0000ffe0 -#define PHY_BB_CL_TAB_B0_CARR_LK_DC_ADD_Q_GET(x) (((x) & 0x0000ffe0) >> 5) -#define PHY_BB_CL_TAB_B0_CARR_LK_DC_ADD_Q_SET(x) (((x) << 5) & 0x0000ffe0) -#define PHY_BB_CL_TAB_B0_CARR_LK_DC_ADD_I_MSB 26 -#define PHY_BB_CL_TAB_B0_CARR_LK_DC_ADD_I_LSB 16 -#define PHY_BB_CL_TAB_B0_CARR_LK_DC_ADD_I_MASK 0x07ff0000 -#define PHY_BB_CL_TAB_B0_CARR_LK_DC_ADD_I_GET(x) (((x) & 0x07ff0000) >> 16) -#define PHY_BB_CL_TAB_B0_CARR_LK_DC_ADD_I_SET(x) (((x) << 16) & 0x07ff0000) -#define PHY_BB_CL_TAB_B0_BB_GAIN_MSB 30 -#define PHY_BB_CL_TAB_B0_BB_GAIN_LSB 27 -#define PHY_BB_CL_TAB_B0_BB_GAIN_MASK 0x78000000 -#define PHY_BB_CL_TAB_B0_BB_GAIN_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_BB_CL_TAB_B0_BB_GAIN_SET(x) (((x) << 27) & 0x78000000) - -/* macros for BB_cl_map_0_b0 */ -#define PHY_BB_CL_MAP_0_B0_ADDRESS 0x0000a340 -#define PHY_BB_CL_MAP_0_B0_OFFSET 0x0000a340 -#define PHY_BB_CL_MAP_0_B0_CL_MAP_0_MSB 31 -#define PHY_BB_CL_MAP_0_B0_CL_MAP_0_LSB 0 -#define PHY_BB_CL_MAP_0_B0_CL_MAP_0_MASK 0xffffffff -#define PHY_BB_CL_MAP_0_B0_CL_MAP_0_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_CL_MAP_0_B0_CL_MAP_0_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_cl_map_1_b0 */ -#define PHY_BB_CL_MAP_1_B0_ADDRESS 0x0000a344 -#define PHY_BB_CL_MAP_1_B0_OFFSET 0x0000a344 -#define PHY_BB_CL_MAP_1_B0_CL_MAP_1_MSB 31 -#define PHY_BB_CL_MAP_1_B0_CL_MAP_1_LSB 0 -#define PHY_BB_CL_MAP_1_B0_CL_MAP_1_MASK 0xffffffff -#define PHY_BB_CL_MAP_1_B0_CL_MAP_1_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_CL_MAP_1_B0_CL_MAP_1_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_cl_map_2_b0 */ -#define PHY_BB_CL_MAP_2_B0_ADDRESS 0x0000a348 -#define PHY_BB_CL_MAP_2_B0_OFFSET 0x0000a348 -#define PHY_BB_CL_MAP_2_B0_CL_MAP_2_MSB 31 -#define PHY_BB_CL_MAP_2_B0_CL_MAP_2_LSB 0 -#define PHY_BB_CL_MAP_2_B0_CL_MAP_2_MASK 0xffffffff -#define PHY_BB_CL_MAP_2_B0_CL_MAP_2_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_CL_MAP_2_B0_CL_MAP_2_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_cl_map_3_b0 */ -#define PHY_BB_CL_MAP_3_B0_ADDRESS 0x0000a34c -#define PHY_BB_CL_MAP_3_B0_OFFSET 0x0000a34c -#define PHY_BB_CL_MAP_3_B0_CL_MAP_3_MSB 31 -#define PHY_BB_CL_MAP_3_B0_CL_MAP_3_LSB 0 -#define PHY_BB_CL_MAP_3_B0_CL_MAP_3_MASK 0xffffffff -#define PHY_BB_CL_MAP_3_B0_CL_MAP_3_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_CL_MAP_3_B0_CL_MAP_3_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_cl_cal_ctrl */ -#define PHY_BB_CL_CAL_CTRL_ADDRESS 0x0000a358 -#define PHY_BB_CL_CAL_CTRL_OFFSET 0x0000a358 -#define PHY_BB_CL_CAL_CTRL_ENABLE_PARALLEL_CAL_MSB 0 -#define PHY_BB_CL_CAL_CTRL_ENABLE_PARALLEL_CAL_LSB 0 -#define PHY_BB_CL_CAL_CTRL_ENABLE_PARALLEL_CAL_MASK 0x00000001 -#define PHY_BB_CL_CAL_CTRL_ENABLE_PARALLEL_CAL_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_CL_CAL_CTRL_ENABLE_PARALLEL_CAL_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_CL_CAL_CTRL_ENABLE_CL_CALIBRATE_MSB 1 -#define PHY_BB_CL_CAL_CTRL_ENABLE_CL_CALIBRATE_LSB 1 -#define PHY_BB_CL_CAL_CTRL_ENABLE_CL_CALIBRATE_MASK 0x00000002 -#define PHY_BB_CL_CAL_CTRL_ENABLE_CL_CALIBRATE_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_CL_CAL_CTRL_ENABLE_CL_CALIBRATE_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_CL_CAL_CTRL_CF_CLC_TEST_POINT_MSB 3 -#define PHY_BB_CL_CAL_CTRL_CF_CLC_TEST_POINT_LSB 2 -#define PHY_BB_CL_CAL_CTRL_CF_CLC_TEST_POINT_MASK 0x0000000c -#define PHY_BB_CL_CAL_CTRL_CF_CLC_TEST_POINT_GET(x) (((x) & 0x0000000c) >> 2) -#define PHY_BB_CL_CAL_CTRL_CF_CLC_TEST_POINT_SET(x) (((x) << 2) & 0x0000000c) -#define PHY_BB_CL_CAL_CTRL_CF_CLC_FORCED_PAGAIN_MSB 7 -#define PHY_BB_CL_CAL_CTRL_CF_CLC_FORCED_PAGAIN_LSB 4 -#define PHY_BB_CL_CAL_CTRL_CF_CLC_FORCED_PAGAIN_MASK 0x000000f0 -#define PHY_BB_CL_CAL_CTRL_CF_CLC_FORCED_PAGAIN_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_BB_CL_CAL_CTRL_CF_CLC_FORCED_PAGAIN_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_BB_CL_CAL_CTRL_CARR_LEAK_MAX_OFFSET_MSB 15 -#define PHY_BB_CL_CAL_CTRL_CARR_LEAK_MAX_OFFSET_LSB 8 -#define PHY_BB_CL_CAL_CTRL_CARR_LEAK_MAX_OFFSET_MASK 0x0000ff00 -#define PHY_BB_CL_CAL_CTRL_CARR_LEAK_MAX_OFFSET_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_CL_CAL_CTRL_CARR_LEAK_MAX_OFFSET_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_CL_CAL_CTRL_CF_CLC_INIT_BBGAIN_MSB 21 -#define PHY_BB_CL_CAL_CTRL_CF_CLC_INIT_BBGAIN_LSB 16 -#define PHY_BB_CL_CAL_CTRL_CF_CLC_INIT_BBGAIN_MASK 0x003f0000 -#define PHY_BB_CL_CAL_CTRL_CF_CLC_INIT_BBGAIN_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_CL_CAL_CTRL_CF_CLC_INIT_BBGAIN_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_CL_CAL_CTRL_CF_ADC_BOUND_MSB 29 -#define PHY_BB_CL_CAL_CTRL_CF_ADC_BOUND_LSB 22 -#define PHY_BB_CL_CAL_CTRL_CF_ADC_BOUND_MASK 0x3fc00000 -#define PHY_BB_CL_CAL_CTRL_CF_ADC_BOUND_GET(x) (((x) & 0x3fc00000) >> 22) -#define PHY_BB_CL_CAL_CTRL_CF_ADC_BOUND_SET(x) (((x) << 22) & 0x3fc00000) -#define PHY_BB_CL_CAL_CTRL_USE_DAC_CL_CORRECTION_MSB 30 -#define PHY_BB_CL_CAL_CTRL_USE_DAC_CL_CORRECTION_LSB 30 -#define PHY_BB_CL_CAL_CTRL_USE_DAC_CL_CORRECTION_MASK 0x40000000 -#define PHY_BB_CL_CAL_CTRL_USE_DAC_CL_CORRECTION_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_BB_CL_CAL_CTRL_USE_DAC_CL_CORRECTION_SET(x) (((x) << 30) & 0x40000000) -#define PHY_BB_CL_CAL_CTRL_CL_MAP_HW_GEN_MSB 31 -#define PHY_BB_CL_CAL_CTRL_CL_MAP_HW_GEN_LSB 31 -#define PHY_BB_CL_CAL_CTRL_CL_MAP_HW_GEN_MASK 0x80000000 -#define PHY_BB_CL_CAL_CTRL_CL_MAP_HW_GEN_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_CL_CAL_CTRL_CL_MAP_HW_GEN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_cl_map_pal_0_b0 */ -#define PHY_BB_CL_MAP_PAL_0_B0_ADDRESS 0x0000a35c -#define PHY_BB_CL_MAP_PAL_0_B0_OFFSET 0x0000a35c -#define PHY_BB_CL_MAP_PAL_0_B0_CL_MAP_0_MSB 31 -#define PHY_BB_CL_MAP_PAL_0_B0_CL_MAP_0_LSB 0 -#define PHY_BB_CL_MAP_PAL_0_B0_CL_MAP_0_MASK 0xffffffff -#define PHY_BB_CL_MAP_PAL_0_B0_CL_MAP_0_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_CL_MAP_PAL_0_B0_CL_MAP_0_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_cl_map_pal_1_b0 */ -#define PHY_BB_CL_MAP_PAL_1_B0_ADDRESS 0x0000a360 -#define PHY_BB_CL_MAP_PAL_1_B0_OFFSET 0x0000a360 -#define PHY_BB_CL_MAP_PAL_1_B0_CL_MAP_1_MSB 31 -#define PHY_BB_CL_MAP_PAL_1_B0_CL_MAP_1_LSB 0 -#define PHY_BB_CL_MAP_PAL_1_B0_CL_MAP_1_MASK 0xffffffff -#define PHY_BB_CL_MAP_PAL_1_B0_CL_MAP_1_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_CL_MAP_PAL_1_B0_CL_MAP_1_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_cl_map_pal_2_b0 */ -#define PHY_BB_CL_MAP_PAL_2_B0_ADDRESS 0x0000a364 -#define PHY_BB_CL_MAP_PAL_2_B0_OFFSET 0x0000a364 -#define PHY_BB_CL_MAP_PAL_2_B0_CL_MAP_2_MSB 31 -#define PHY_BB_CL_MAP_PAL_2_B0_CL_MAP_2_LSB 0 -#define PHY_BB_CL_MAP_PAL_2_B0_CL_MAP_2_MASK 0xffffffff -#define PHY_BB_CL_MAP_PAL_2_B0_CL_MAP_2_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_CL_MAP_PAL_2_B0_CL_MAP_2_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_cl_map_pal_3_b0 */ -#define PHY_BB_CL_MAP_PAL_3_B0_ADDRESS 0x0000a368 -#define PHY_BB_CL_MAP_PAL_3_B0_OFFSET 0x0000a368 -#define PHY_BB_CL_MAP_PAL_3_B0_CL_MAP_3_MSB 31 -#define PHY_BB_CL_MAP_PAL_3_B0_CL_MAP_3_LSB 0 -#define PHY_BB_CL_MAP_PAL_3_B0_CL_MAP_3_MASK 0xffffffff -#define PHY_BB_CL_MAP_PAL_3_B0_CL_MAP_3_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_CL_MAP_PAL_3_B0_CL_MAP_3_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_rifs */ -#define PHY_BB_RIFS_ADDRESS 0x0000a388 -#define PHY_BB_RIFS_OFFSET 0x0000a388 -#define PHY_BB_RIFS_DISABLE_FCC_FIX_MSB 25 -#define PHY_BB_RIFS_DISABLE_FCC_FIX_LSB 25 -#define PHY_BB_RIFS_DISABLE_FCC_FIX_MASK 0x02000000 -#define PHY_BB_RIFS_DISABLE_FCC_FIX_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_BB_RIFS_DISABLE_FCC_FIX_SET(x) (((x) << 25) & 0x02000000) -#define PHY_BB_RIFS_ENABLE_RESET_TDOMAIN_MSB 26 -#define PHY_BB_RIFS_ENABLE_RESET_TDOMAIN_LSB 26 -#define PHY_BB_RIFS_ENABLE_RESET_TDOMAIN_MASK 0x04000000 -#define PHY_BB_RIFS_ENABLE_RESET_TDOMAIN_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_BB_RIFS_ENABLE_RESET_TDOMAIN_SET(x) (((x) << 26) & 0x04000000) -#define PHY_BB_RIFS_DISABLE_FCC_FIX2_MSB 27 -#define PHY_BB_RIFS_DISABLE_FCC_FIX2_LSB 27 -#define PHY_BB_RIFS_DISABLE_FCC_FIX2_MASK 0x08000000 -#define PHY_BB_RIFS_DISABLE_FCC_FIX2_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_BB_RIFS_DISABLE_FCC_FIX2_SET(x) (((x) << 27) & 0x08000000) -#define PHY_BB_RIFS_DISABLE_RIFS_CCK_FIX_MSB 28 -#define PHY_BB_RIFS_DISABLE_RIFS_CCK_FIX_LSB 28 -#define PHY_BB_RIFS_DISABLE_RIFS_CCK_FIX_MASK 0x10000000 -#define PHY_BB_RIFS_DISABLE_RIFS_CCK_FIX_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_BB_RIFS_DISABLE_RIFS_CCK_FIX_SET(x) (((x) << 28) & 0x10000000) -#define PHY_BB_RIFS_DISABLE_ERROR_RESET_FIX_MSB 29 -#define PHY_BB_RIFS_DISABLE_ERROR_RESET_FIX_LSB 29 -#define PHY_BB_RIFS_DISABLE_ERROR_RESET_FIX_MASK 0x20000000 -#define PHY_BB_RIFS_DISABLE_ERROR_RESET_FIX_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_BB_RIFS_DISABLE_ERROR_RESET_FIX_SET(x) (((x) << 29) & 0x20000000) -#define PHY_BB_RIFS_RADAR_USE_FDOMAIN_RESET_MSB 30 -#define PHY_BB_RIFS_RADAR_USE_FDOMAIN_RESET_LSB 30 -#define PHY_BB_RIFS_RADAR_USE_FDOMAIN_RESET_MASK 0x40000000 -#define PHY_BB_RIFS_RADAR_USE_FDOMAIN_RESET_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_BB_RIFS_RADAR_USE_FDOMAIN_RESET_SET(x) (((x) << 30) & 0x40000000) - -/* macros for BB_powertx_rate5 */ -#define PHY_BB_POWERTX_RATE5_ADDRESS 0x0000a38c -#define PHY_BB_POWERTX_RATE5_OFFSET 0x0000a38c -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_0_MSB 5 -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_0_LSB 0 -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_0_MASK 0x0000003f -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_0_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_0_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_1_MSB 13 -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_1_LSB 8 -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_1_MASK 0x00003f00 -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_1_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_1_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_2_MSB 21 -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_2_LSB 16 -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_2_MASK 0x003f0000 -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_2_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_2_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_3_MSB 29 -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_3_LSB 24 -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_3_MASK 0x3f000000 -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_3_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_BB_POWERTX_RATE5_POWERTXHT20_3_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for BB_powertx_rate6 */ -#define PHY_BB_POWERTX_RATE6_ADDRESS 0x0000a390 -#define PHY_BB_POWERTX_RATE6_OFFSET 0x0000a390 -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_4_MSB 5 -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_4_LSB 0 -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_4_MASK 0x0000003f -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_4_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_4_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_5_MSB 13 -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_5_LSB 8 -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_5_MASK 0x00003f00 -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_5_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_5_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_6_MSB 21 -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_6_LSB 16 -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_6_MASK 0x003f0000 -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_6_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_6_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_7_MSB 29 -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_7_LSB 24 -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_7_MASK 0x3f000000 -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_7_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_BB_POWERTX_RATE6_POWERTXHT20_7_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for BB_tpc_10 */ -#define PHY_BB_TPC_10_ADDRESS 0x0000a394 -#define PHY_BB_TPC_10_OFFSET 0x0000a394 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_0_MSB 4 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_0_LSB 0 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_0_MASK 0x0000001f -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_0_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_0_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_1_MSB 9 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_1_LSB 5 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_1_MASK 0x000003e0 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_1_GET(x) (((x) & 0x000003e0) >> 5) -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_1_SET(x) (((x) << 5) & 0x000003e0) -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_2_MSB 14 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_2_LSB 10 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_2_MASK 0x00007c00 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_2_GET(x) (((x) & 0x00007c00) >> 10) -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_2_SET(x) (((x) << 10) & 0x00007c00) -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_3_MSB 19 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_3_LSB 15 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_3_MASK 0x000f8000 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_3_GET(x) (((x) & 0x000f8000) >> 15) -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_3_SET(x) (((x) << 15) & 0x000f8000) -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_4_MSB 24 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_4_LSB 20 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_4_MASK 0x01f00000 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_4_GET(x) (((x) & 0x01f00000) >> 20) -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_4_SET(x) (((x) << 20) & 0x01f00000) -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_5_MSB 29 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_5_LSB 25 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_5_MASK 0x3e000000 -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_5_GET(x) (((x) & 0x3e000000) >> 25) -#define PHY_BB_TPC_10_DESIRED_SCALE_HT20_5_SET(x) (((x) << 25) & 0x3e000000) - -/* macros for BB_tpc_11_b0 */ -#define PHY_BB_TPC_11_B0_ADDRESS 0x0000a398 -#define PHY_BB_TPC_11_B0_OFFSET 0x0000a398 -#define PHY_BB_TPC_11_B0_DESIRED_SCALE_HT20_6_MSB 4 -#define PHY_BB_TPC_11_B0_DESIRED_SCALE_HT20_6_LSB 0 -#define PHY_BB_TPC_11_B0_DESIRED_SCALE_HT20_6_MASK 0x0000001f -#define PHY_BB_TPC_11_B0_DESIRED_SCALE_HT20_6_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_TPC_11_B0_DESIRED_SCALE_HT20_6_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_TPC_11_B0_DESIRED_SCALE_HT20_7_MSB 9 -#define PHY_BB_TPC_11_B0_DESIRED_SCALE_HT20_7_LSB 5 -#define PHY_BB_TPC_11_B0_DESIRED_SCALE_HT20_7_MASK 0x000003e0 -#define PHY_BB_TPC_11_B0_DESIRED_SCALE_HT20_7_GET(x) (((x) & 0x000003e0) >> 5) -#define PHY_BB_TPC_11_B0_DESIRED_SCALE_HT20_7_SET(x) (((x) << 5) & 0x000003e0) -#define PHY_BB_TPC_11_B0_OLPC_GAIN_DELTA_0_MSB 23 -#define PHY_BB_TPC_11_B0_OLPC_GAIN_DELTA_0_LSB 16 -#define PHY_BB_TPC_11_B0_OLPC_GAIN_DELTA_0_MASK 0x00ff0000 -#define PHY_BB_TPC_11_B0_OLPC_GAIN_DELTA_0_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_BB_TPC_11_B0_OLPC_GAIN_DELTA_0_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_BB_TPC_11_B0_OLPC_GAIN_DELTA_0_PAL_ON_MSB 31 -#define PHY_BB_TPC_11_B0_OLPC_GAIN_DELTA_0_PAL_ON_LSB 24 -#define PHY_BB_TPC_11_B0_OLPC_GAIN_DELTA_0_PAL_ON_MASK 0xff000000 -#define PHY_BB_TPC_11_B0_OLPC_GAIN_DELTA_0_PAL_ON_GET(x) (((x) & 0xff000000) >> 24) -#define PHY_BB_TPC_11_B0_OLPC_GAIN_DELTA_0_PAL_ON_SET(x) (((x) << 24) & 0xff000000) - -/* macros for BB_cal_chain_mask */ -#define PHY_BB_CAL_CHAIN_MASK_ADDRESS 0x0000a39c -#define PHY_BB_CAL_CHAIN_MASK_OFFSET 0x0000a39c -#define PHY_BB_CAL_CHAIN_MASK_CAL_CHAIN_MASK_MSB 2 -#define PHY_BB_CAL_CHAIN_MASK_CAL_CHAIN_MASK_LSB 0 -#define PHY_BB_CAL_CHAIN_MASK_CAL_CHAIN_MASK_MASK 0x00000007 -#define PHY_BB_CAL_CHAIN_MASK_CAL_CHAIN_MASK_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_BB_CAL_CHAIN_MASK_CAL_CHAIN_MASK_SET(x) (((x) << 0) & 0x00000007) - -/* macros for BB_powertx_sub */ -#define PHY_BB_POWERTX_SUB_ADDRESS 0x0000a3bc -#define PHY_BB_POWERTX_SUB_OFFSET 0x0000a3bc -#define PHY_BB_POWERTX_SUB_POWERTX_SUB_FOR_2CHAIN_MSB 5 -#define PHY_BB_POWERTX_SUB_POWERTX_SUB_FOR_2CHAIN_LSB 0 -#define PHY_BB_POWERTX_SUB_POWERTX_SUB_FOR_2CHAIN_MASK 0x0000003f -#define PHY_BB_POWERTX_SUB_POWERTX_SUB_FOR_2CHAIN_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_POWERTX_SUB_POWERTX_SUB_FOR_2CHAIN_SET(x) (((x) << 0) & 0x0000003f) - -/* macros for BB_powertx_rate7 */ -#define PHY_BB_POWERTX_RATE7_ADDRESS 0x0000a3c0 -#define PHY_BB_POWERTX_RATE7_OFFSET 0x0000a3c0 -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_0_MSB 5 -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_0_LSB 0 -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_0_MASK 0x0000003f -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_0_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_0_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_1_MSB 13 -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_1_LSB 8 -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_1_MASK 0x00003f00 -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_1_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_1_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_2_MSB 21 -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_2_LSB 16 -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_2_MASK 0x003f0000 -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_2_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_2_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_3_MSB 29 -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_3_LSB 24 -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_3_MASK 0x3f000000 -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_3_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_BB_POWERTX_RATE7_POWERTXHT40_3_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for BB_powertx_rate8 */ -#define PHY_BB_POWERTX_RATE8_ADDRESS 0x0000a3c4 -#define PHY_BB_POWERTX_RATE8_OFFSET 0x0000a3c4 -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_4_MSB 5 -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_4_LSB 0 -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_4_MASK 0x0000003f -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_4_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_4_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_5_MSB 13 -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_5_LSB 8 -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_5_MASK 0x00003f00 -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_5_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_5_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_6_MSB 21 -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_6_LSB 16 -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_6_MASK 0x003f0000 -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_6_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_6_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_7_MSB 29 -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_7_LSB 24 -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_7_MASK 0x3f000000 -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_7_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_BB_POWERTX_RATE8_POWERTXHT40_7_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for BB_powertx_rate9 */ -#define PHY_BB_POWERTX_RATE9_ADDRESS 0x0000a3c8 -#define PHY_BB_POWERTX_RATE9_OFFSET 0x0000a3c8 -#define PHY_BB_POWERTX_RATE9_POWERTX_DUP40_CCK_MSB 5 -#define PHY_BB_POWERTX_RATE9_POWERTX_DUP40_CCK_LSB 0 -#define PHY_BB_POWERTX_RATE9_POWERTX_DUP40_CCK_MASK 0x0000003f -#define PHY_BB_POWERTX_RATE9_POWERTX_DUP40_CCK_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_POWERTX_RATE9_POWERTX_DUP40_CCK_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_POWERTX_RATE9_POWERTX_DUP40_OFDM_MSB 13 -#define PHY_BB_POWERTX_RATE9_POWERTX_DUP40_OFDM_LSB 8 -#define PHY_BB_POWERTX_RATE9_POWERTX_DUP40_OFDM_MASK 0x00003f00 -#define PHY_BB_POWERTX_RATE9_POWERTX_DUP40_OFDM_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_BB_POWERTX_RATE9_POWERTX_DUP40_OFDM_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_BB_POWERTX_RATE9_POWERTX_EXT20_CCK_MSB 21 -#define PHY_BB_POWERTX_RATE9_POWERTX_EXT20_CCK_LSB 16 -#define PHY_BB_POWERTX_RATE9_POWERTX_EXT20_CCK_MASK 0x003f0000 -#define PHY_BB_POWERTX_RATE9_POWERTX_EXT20_CCK_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_POWERTX_RATE9_POWERTX_EXT20_CCK_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_POWERTX_RATE9_POWERTX_EXT20_OFDM_MSB 29 -#define PHY_BB_POWERTX_RATE9_POWERTX_EXT20_OFDM_LSB 24 -#define PHY_BB_POWERTX_RATE9_POWERTX_EXT20_OFDM_MASK 0x3f000000 -#define PHY_BB_POWERTX_RATE9_POWERTX_EXT20_OFDM_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_BB_POWERTX_RATE9_POWERTX_EXT20_OFDM_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for BB_powertx_rate10 */ -#define PHY_BB_POWERTX_RATE10_ADDRESS 0x0000a3cc -#define PHY_BB_POWERTX_RATE10_OFFSET 0x0000a3cc -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_8_MSB 5 -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_8_LSB 0 -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_8_MASK 0x0000003f -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_8_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_8_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_9_MSB 13 -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_9_LSB 8 -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_9_MASK 0x00003f00 -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_9_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_9_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_10_MSB 21 -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_10_LSB 16 -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_10_MASK 0x003f0000 -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_10_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_10_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_11_MSB 29 -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_11_LSB 24 -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_11_MASK 0x3f000000 -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_11_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_BB_POWERTX_RATE10_POWERTXHT20_11_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for BB_powertx_rate11 */ -#define PHY_BB_POWERTX_RATE11_ADDRESS 0x0000a3d0 -#define PHY_BB_POWERTX_RATE11_OFFSET 0x0000a3d0 -#define PHY_BB_POWERTX_RATE11_POWERTXHT20_12_MSB 5 -#define PHY_BB_POWERTX_RATE11_POWERTXHT20_12_LSB 0 -#define PHY_BB_POWERTX_RATE11_POWERTXHT20_12_MASK 0x0000003f -#define PHY_BB_POWERTX_RATE11_POWERTXHT20_12_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_POWERTX_RATE11_POWERTXHT20_12_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_POWERTX_RATE11_POWERTXHT20_13_MSB 13 -#define PHY_BB_POWERTX_RATE11_POWERTXHT20_13_LSB 8 -#define PHY_BB_POWERTX_RATE11_POWERTXHT20_13_MASK 0x00003f00 -#define PHY_BB_POWERTX_RATE11_POWERTXHT20_13_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_BB_POWERTX_RATE11_POWERTXHT20_13_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_BB_POWERTX_RATE11_POWERTXHT40_12_MSB 21 -#define PHY_BB_POWERTX_RATE11_POWERTXHT40_12_LSB 16 -#define PHY_BB_POWERTX_RATE11_POWERTXHT40_12_MASK 0x003f0000 -#define PHY_BB_POWERTX_RATE11_POWERTXHT40_12_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_POWERTX_RATE11_POWERTXHT40_12_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_POWERTX_RATE11_POWERTXHT40_13_MSB 29 -#define PHY_BB_POWERTX_RATE11_POWERTXHT40_13_LSB 24 -#define PHY_BB_POWERTX_RATE11_POWERTXHT40_13_MASK 0x3f000000 -#define PHY_BB_POWERTX_RATE11_POWERTXHT40_13_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_BB_POWERTX_RATE11_POWERTXHT40_13_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for BB_powertx_rate12 */ -#define PHY_BB_POWERTX_RATE12_ADDRESS 0x0000a3d4 -#define PHY_BB_POWERTX_RATE12_OFFSET 0x0000a3d4 -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_8_MSB 5 -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_8_LSB 0 -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_8_MASK 0x0000003f -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_8_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_8_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_9_MSB 13 -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_9_LSB 8 -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_9_MASK 0x00003f00 -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_9_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_9_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_10_MSB 21 -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_10_LSB 16 -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_10_MASK 0x003f0000 -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_10_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_10_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_11_MSB 29 -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_11_LSB 24 -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_11_MASK 0x3f000000 -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_11_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_BB_POWERTX_RATE12_POWERTXHT40_11_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for BB_force_analog */ -#define PHY_BB_FORCE_ANALOG_ADDRESS 0x0000a3d8 -#define PHY_BB_FORCE_ANALOG_OFFSET 0x0000a3d8 -#define PHY_BB_FORCE_ANALOG_FORCE_XPAON_MSB 0 -#define PHY_BB_FORCE_ANALOG_FORCE_XPAON_LSB 0 -#define PHY_BB_FORCE_ANALOG_FORCE_XPAON_MASK 0x00000001 -#define PHY_BB_FORCE_ANALOG_FORCE_XPAON_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_FORCE_ANALOG_FORCE_XPAON_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_FORCE_ANALOG_FORCED_XPAON_MSB 3 -#define PHY_BB_FORCE_ANALOG_FORCED_XPAON_LSB 1 -#define PHY_BB_FORCE_ANALOG_FORCED_XPAON_MASK 0x0000000e -#define PHY_BB_FORCE_ANALOG_FORCED_XPAON_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_BB_FORCE_ANALOG_FORCED_XPAON_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_BB_FORCE_ANALOG_FORCE_PDADC_PWD_MSB 4 -#define PHY_BB_FORCE_ANALOG_FORCE_PDADC_PWD_LSB 4 -#define PHY_BB_FORCE_ANALOG_FORCE_PDADC_PWD_MASK 0x00000010 -#define PHY_BB_FORCE_ANALOG_FORCE_PDADC_PWD_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_BB_FORCE_ANALOG_FORCE_PDADC_PWD_SET(x) (((x) << 4) & 0x00000010) -#define PHY_BB_FORCE_ANALOG_FORCED_PDADC_PWD_MSB 7 -#define PHY_BB_FORCE_ANALOG_FORCED_PDADC_PWD_LSB 5 -#define PHY_BB_FORCE_ANALOG_FORCED_PDADC_PWD_MASK 0x000000e0 -#define PHY_BB_FORCE_ANALOG_FORCED_PDADC_PWD_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_BB_FORCE_ANALOG_FORCED_PDADC_PWD_SET(x) (((x) << 5) & 0x000000e0) - -/* macros for BB_tpc_12 */ -#define PHY_BB_TPC_12_ADDRESS 0x0000a3dc -#define PHY_BB_TPC_12_OFFSET 0x0000a3dc -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_0_MSB 4 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_0_LSB 0 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_0_MASK 0x0000001f -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_0_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_0_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_1_MSB 9 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_1_LSB 5 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_1_MASK 0x000003e0 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_1_GET(x) (((x) & 0x000003e0) >> 5) -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_1_SET(x) (((x) << 5) & 0x000003e0) -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_2_MSB 14 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_2_LSB 10 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_2_MASK 0x00007c00 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_2_GET(x) (((x) & 0x00007c00) >> 10) -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_2_SET(x) (((x) << 10) & 0x00007c00) -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_3_MSB 19 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_3_LSB 15 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_3_MASK 0x000f8000 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_3_GET(x) (((x) & 0x000f8000) >> 15) -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_3_SET(x) (((x) << 15) & 0x000f8000) -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_4_MSB 24 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_4_LSB 20 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_4_MASK 0x01f00000 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_4_GET(x) (((x) & 0x01f00000) >> 20) -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_4_SET(x) (((x) << 20) & 0x01f00000) -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_5_MSB 29 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_5_LSB 25 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_5_MASK 0x3e000000 -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_5_GET(x) (((x) & 0x3e000000) >> 25) -#define PHY_BB_TPC_12_DESIRED_SCALE_HT40_5_SET(x) (((x) << 25) & 0x3e000000) - -/* macros for BB_tpc_13 */ -#define PHY_BB_TPC_13_ADDRESS 0x0000a3e0 -#define PHY_BB_TPC_13_OFFSET 0x0000a3e0 -#define PHY_BB_TPC_13_DESIRED_SCALE_HT40_6_MSB 4 -#define PHY_BB_TPC_13_DESIRED_SCALE_HT40_6_LSB 0 -#define PHY_BB_TPC_13_DESIRED_SCALE_HT40_6_MASK 0x0000001f -#define PHY_BB_TPC_13_DESIRED_SCALE_HT40_6_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_TPC_13_DESIRED_SCALE_HT40_6_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_TPC_13_DESIRED_SCALE_HT40_7_MSB 9 -#define PHY_BB_TPC_13_DESIRED_SCALE_HT40_7_LSB 5 -#define PHY_BB_TPC_13_DESIRED_SCALE_HT40_7_MASK 0x000003e0 -#define PHY_BB_TPC_13_DESIRED_SCALE_HT40_7_GET(x) (((x) & 0x000003e0) >> 5) -#define PHY_BB_TPC_13_DESIRED_SCALE_HT40_7_SET(x) (((x) << 5) & 0x000003e0) - -/* macros for BB_tpc_14 */ -#define PHY_BB_TPC_14_ADDRESS 0x0000a3e4 -#define PHY_BB_TPC_14_OFFSET 0x0000a3e4 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_8_MSB 4 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_8_LSB 0 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_8_MASK 0x0000001f -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_8_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_8_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_9_MSB 9 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_9_LSB 5 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_9_MASK 0x000003e0 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_9_GET(x) (((x) & 0x000003e0) >> 5) -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_9_SET(x) (((x) << 5) & 0x000003e0) -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_10_MSB 14 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_10_LSB 10 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_10_MASK 0x00007c00 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_10_GET(x) (((x) & 0x00007c00) >> 10) -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_10_SET(x) (((x) << 10) & 0x00007c00) -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_11_MSB 19 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_11_LSB 15 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_11_MASK 0x000f8000 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_11_GET(x) (((x) & 0x000f8000) >> 15) -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_11_SET(x) (((x) << 15) & 0x000f8000) -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_12_MSB 24 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_12_LSB 20 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_12_MASK 0x01f00000 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_12_GET(x) (((x) & 0x01f00000) >> 20) -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_12_SET(x) (((x) << 20) & 0x01f00000) -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_13_MSB 29 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_13_LSB 25 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_13_MASK 0x3e000000 -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_13_GET(x) (((x) & 0x3e000000) >> 25) -#define PHY_BB_TPC_14_DESIRED_SCALE_HT20_13_SET(x) (((x) << 25) & 0x3e000000) - -/* macros for BB_tpc_15 */ -#define PHY_BB_TPC_15_ADDRESS 0x0000a3e8 -#define PHY_BB_TPC_15_OFFSET 0x0000a3e8 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_8_MSB 4 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_8_LSB 0 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_8_MASK 0x0000001f -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_8_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_8_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_9_MSB 9 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_9_LSB 5 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_9_MASK 0x000003e0 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_9_GET(x) (((x) & 0x000003e0) >> 5) -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_9_SET(x) (((x) << 5) & 0x000003e0) -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_10_MSB 14 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_10_LSB 10 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_10_MASK 0x00007c00 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_10_GET(x) (((x) & 0x00007c00) >> 10) -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_10_SET(x) (((x) << 10) & 0x00007c00) -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_11_MSB 19 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_11_LSB 15 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_11_MASK 0x000f8000 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_11_GET(x) (((x) & 0x000f8000) >> 15) -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_11_SET(x) (((x) << 15) & 0x000f8000) -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_12_MSB 24 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_12_LSB 20 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_12_MASK 0x01f00000 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_12_GET(x) (((x) & 0x01f00000) >> 20) -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_12_SET(x) (((x) << 20) & 0x01f00000) -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_13_MSB 29 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_13_LSB 25 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_13_MASK 0x3e000000 -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_13_GET(x) (((x) & 0x3e000000) >> 25) -#define PHY_BB_TPC_15_DESIRED_SCALE_HT40_13_SET(x) (((x) << 25) & 0x3e000000) - -/* macros for BB_tpc_16 */ -#define PHY_BB_TPC_16_ADDRESS 0x0000a3ec -#define PHY_BB_TPC_16_OFFSET 0x0000a3ec -#define PHY_BB_TPC_16_PDADC_PAR_CORR_CCK_MSB 13 -#define PHY_BB_TPC_16_PDADC_PAR_CORR_CCK_LSB 8 -#define PHY_BB_TPC_16_PDADC_PAR_CORR_CCK_MASK 0x00003f00 -#define PHY_BB_TPC_16_PDADC_PAR_CORR_CCK_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_BB_TPC_16_PDADC_PAR_CORR_CCK_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_BB_TPC_16_PDADC_PAR_CORR_OFDM_MSB 21 -#define PHY_BB_TPC_16_PDADC_PAR_CORR_OFDM_LSB 16 -#define PHY_BB_TPC_16_PDADC_PAR_CORR_OFDM_MASK 0x003f0000 -#define PHY_BB_TPC_16_PDADC_PAR_CORR_OFDM_GET(x) (((x) & 0x003f0000) >> 16) -#define PHY_BB_TPC_16_PDADC_PAR_CORR_OFDM_SET(x) (((x) << 16) & 0x003f0000) -#define PHY_BB_TPC_16_PDADC_PAR_CORR_HT40_MSB 29 -#define PHY_BB_TPC_16_PDADC_PAR_CORR_HT40_LSB 24 -#define PHY_BB_TPC_16_PDADC_PAR_CORR_HT40_MASK 0x3f000000 -#define PHY_BB_TPC_16_PDADC_PAR_CORR_HT40_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_BB_TPC_16_PDADC_PAR_CORR_HT40_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for BB_tpc_17 */ -#define PHY_BB_TPC_17_ADDRESS 0x0000a3f0 -#define PHY_BB_TPC_17_OFFSET 0x0000a3f0 -#define PHY_BB_TPC_17_ENABLE_PAL_MSB 0 -#define PHY_BB_TPC_17_ENABLE_PAL_LSB 0 -#define PHY_BB_TPC_17_ENABLE_PAL_MASK 0x00000001 -#define PHY_BB_TPC_17_ENABLE_PAL_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_TPC_17_ENABLE_PAL_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_TPC_17_ENABLE_PAL_CCK_MSB 1 -#define PHY_BB_TPC_17_ENABLE_PAL_CCK_LSB 1 -#define PHY_BB_TPC_17_ENABLE_PAL_CCK_MASK 0x00000002 -#define PHY_BB_TPC_17_ENABLE_PAL_CCK_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_TPC_17_ENABLE_PAL_CCK_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_TPC_17_ENABLE_PAL_OFDM_20_MSB 2 -#define PHY_BB_TPC_17_ENABLE_PAL_OFDM_20_LSB 2 -#define PHY_BB_TPC_17_ENABLE_PAL_OFDM_20_MASK 0x00000004 -#define PHY_BB_TPC_17_ENABLE_PAL_OFDM_20_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_BB_TPC_17_ENABLE_PAL_OFDM_20_SET(x) (((x) << 2) & 0x00000004) -#define PHY_BB_TPC_17_ENABLE_PAL_OFDM_40_MSB 3 -#define PHY_BB_TPC_17_ENABLE_PAL_OFDM_40_LSB 3 -#define PHY_BB_TPC_17_ENABLE_PAL_OFDM_40_MASK 0x00000008 -#define PHY_BB_TPC_17_ENABLE_PAL_OFDM_40_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_BB_TPC_17_ENABLE_PAL_OFDM_40_SET(x) (((x) << 3) & 0x00000008) -#define PHY_BB_TPC_17_PAL_POWER_THRESHOLD_MSB 9 -#define PHY_BB_TPC_17_PAL_POWER_THRESHOLD_LSB 4 -#define PHY_BB_TPC_17_PAL_POWER_THRESHOLD_MASK 0x000003f0 -#define PHY_BB_TPC_17_PAL_POWER_THRESHOLD_GET(x) (((x) & 0x000003f0) >> 4) -#define PHY_BB_TPC_17_PAL_POWER_THRESHOLD_SET(x) (((x) << 4) & 0x000003f0) -#define PHY_BB_TPC_17_FORCE_PAL_LOCKED_MSB 10 -#define PHY_BB_TPC_17_FORCE_PAL_LOCKED_LSB 10 -#define PHY_BB_TPC_17_FORCE_PAL_LOCKED_MASK 0x00000400 -#define PHY_BB_TPC_17_FORCE_PAL_LOCKED_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_BB_TPC_17_FORCE_PAL_LOCKED_SET(x) (((x) << 10) & 0x00000400) -#define PHY_BB_TPC_17_INIT_TX_GAIN_SETTING_PAL_ON_MSB 16 -#define PHY_BB_TPC_17_INIT_TX_GAIN_SETTING_PAL_ON_LSB 11 -#define PHY_BB_TPC_17_INIT_TX_GAIN_SETTING_PAL_ON_MASK 0x0001f800 -#define PHY_BB_TPC_17_INIT_TX_GAIN_SETTING_PAL_ON_GET(x) (((x) & 0x0001f800) >> 11) -#define PHY_BB_TPC_17_INIT_TX_GAIN_SETTING_PAL_ON_SET(x) (((x) << 11) & 0x0001f800) - -/* macros for BB_tpc_18 */ -#define PHY_BB_TPC_18_ADDRESS 0x0000a3f4 -#define PHY_BB_TPC_18_OFFSET 0x0000a3f4 -#define PHY_BB_TPC_18_THERM_CAL_VALUE_MSB 7 -#define PHY_BB_TPC_18_THERM_CAL_VALUE_LSB 0 -#define PHY_BB_TPC_18_THERM_CAL_VALUE_MASK 0x000000ff -#define PHY_BB_TPC_18_THERM_CAL_VALUE_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_TPC_18_THERM_CAL_VALUE_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_TPC_18_VOLT_CAL_VALUE_MSB 15 -#define PHY_BB_TPC_18_VOLT_CAL_VALUE_LSB 8 -#define PHY_BB_TPC_18_VOLT_CAL_VALUE_MASK 0x0000ff00 -#define PHY_BB_TPC_18_VOLT_CAL_VALUE_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_TPC_18_VOLT_CAL_VALUE_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_TPC_18_USE_LEGACY_TPC_MSB 16 -#define PHY_BB_TPC_18_USE_LEGACY_TPC_LSB 16 -#define PHY_BB_TPC_18_USE_LEGACY_TPC_MASK 0x00010000 -#define PHY_BB_TPC_18_USE_LEGACY_TPC_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_BB_TPC_18_USE_LEGACY_TPC_SET(x) (((x) << 16) & 0x00010000) - -/* macros for BB_tpc_19 */ -#define PHY_BB_TPC_19_ADDRESS 0x0000a3f8 -#define PHY_BB_TPC_19_OFFSET 0x0000a3f8 -#define PHY_BB_TPC_19_ALPHA_THERM_MSB 7 -#define PHY_BB_TPC_19_ALPHA_THERM_LSB 0 -#define PHY_BB_TPC_19_ALPHA_THERM_MASK 0x000000ff -#define PHY_BB_TPC_19_ALPHA_THERM_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_TPC_19_ALPHA_THERM_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_TPC_19_ALPHA_THERM_PAL_ON_MSB 15 -#define PHY_BB_TPC_19_ALPHA_THERM_PAL_ON_LSB 8 -#define PHY_BB_TPC_19_ALPHA_THERM_PAL_ON_MASK 0x0000ff00 -#define PHY_BB_TPC_19_ALPHA_THERM_PAL_ON_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_TPC_19_ALPHA_THERM_PAL_ON_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_TPC_19_ALPHA_VOLT_MSB 20 -#define PHY_BB_TPC_19_ALPHA_VOLT_LSB 16 -#define PHY_BB_TPC_19_ALPHA_VOLT_MASK 0x001f0000 -#define PHY_BB_TPC_19_ALPHA_VOLT_GET(x) (((x) & 0x001f0000) >> 16) -#define PHY_BB_TPC_19_ALPHA_VOLT_SET(x) (((x) << 16) & 0x001f0000) -#define PHY_BB_TPC_19_ALPHA_VOLT_PAL_ON_MSB 25 -#define PHY_BB_TPC_19_ALPHA_VOLT_PAL_ON_LSB 21 -#define PHY_BB_TPC_19_ALPHA_VOLT_PAL_ON_MASK 0x03e00000 -#define PHY_BB_TPC_19_ALPHA_VOLT_PAL_ON_GET(x) (((x) & 0x03e00000) >> 21) -#define PHY_BB_TPC_19_ALPHA_VOLT_PAL_ON_SET(x) (((x) << 21) & 0x03e00000) - -/* macros for BB_tpc_20 */ -#define PHY_BB_TPC_20_ADDRESS 0x0000a3fc -#define PHY_BB_TPC_20_OFFSET 0x0000a3fc -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_0_MSB 0 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_0_LSB 0 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_0_MASK 0x00000001 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_0_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_0_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_1_MSB 1 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_1_LSB 1 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_1_MASK 0x00000002 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_1_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_1_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_2_MSB 2 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_2_LSB 2 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_2_MASK 0x00000004 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_2_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_2_SET(x) (((x) << 2) & 0x00000004) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_3_MSB 3 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_3_LSB 3 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_3_MASK 0x00000008 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_3_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_3_SET(x) (((x) << 3) & 0x00000008) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_4_MSB 4 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_4_LSB 4 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_4_MASK 0x00000010 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_4_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_4_SET(x) (((x) << 4) & 0x00000010) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_5_MSB 5 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_5_LSB 5 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_5_MASK 0x00000020 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_5_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_5_SET(x) (((x) << 5) & 0x00000020) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_6_MSB 6 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_6_LSB 6 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_6_MASK 0x00000040 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_6_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_6_SET(x) (((x) << 6) & 0x00000040) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_7_MSB 7 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_7_LSB 7 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_7_MASK 0x00000080 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_7_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_7_SET(x) (((x) << 7) & 0x00000080) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_8_MSB 8 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_8_LSB 8 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_8_MASK 0x00000100 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_8_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_8_SET(x) (((x) << 8) & 0x00000100) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_9_MSB 9 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_9_LSB 9 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_9_MASK 0x00000200 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_9_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_9_SET(x) (((x) << 9) & 0x00000200) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_10_MSB 10 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_10_LSB 10 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_10_MASK 0x00000400 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_10_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_10_SET(x) (((x) << 10) & 0x00000400) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_11_MSB 11 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_11_LSB 11 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_11_MASK 0x00000800 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_11_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_11_SET(x) (((x) << 11) & 0x00000800) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_12_MSB 12 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_12_LSB 12 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_12_MASK 0x00001000 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_12_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_12_SET(x) (((x) << 12) & 0x00001000) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_13_MSB 13 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_13_LSB 13 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_13_MASK 0x00002000 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_13_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_13_SET(x) (((x) << 13) & 0x00002000) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_14_MSB 14 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_14_LSB 14 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_14_MASK 0x00004000 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_14_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_14_SET(x) (((x) << 14) & 0x00004000) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_15_MSB 15 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_15_LSB 15 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_15_MASK 0x00008000 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_15_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_15_SET(x) (((x) << 15) & 0x00008000) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_16_MSB 16 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_16_LSB 16 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_16_MASK 0x00010000 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_16_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_16_SET(x) (((x) << 16) & 0x00010000) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_17_MSB 17 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_17_LSB 17 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_17_MASK 0x00020000 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_17_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_17_SET(x) (((x) << 17) & 0x00020000) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_18_MSB 18 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_18_LSB 18 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_18_MASK 0x00040000 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_18_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_18_SET(x) (((x) << 18) & 0x00040000) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_19_MSB 19 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_19_LSB 19 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_19_MASK 0x00080000 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_19_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_19_SET(x) (((x) << 19) & 0x00080000) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_20_MSB 20 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_20_LSB 20 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_20_MASK 0x00100000 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_20_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_20_SET(x) (((x) << 20) & 0x00100000) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_21_MSB 21 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_21_LSB 21 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_21_MASK 0x00200000 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_21_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_21_SET(x) (((x) << 21) & 0x00200000) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_22_MSB 22 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_22_LSB 22 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_22_MASK 0x00400000 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_22_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_22_SET(x) (((x) << 22) & 0x00400000) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_23_MSB 23 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_23_LSB 23 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_23_MASK 0x00800000 -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_23_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_BB_TPC_20_ENABLE_PAL_MCS_23_SET(x) (((x) << 23) & 0x00800000) - -/* macros for BB_tx_gain_tab_1 */ -#define PHY_BB_TX_GAIN_TAB_1_ADDRESS 0x0000a400 -#define PHY_BB_TX_GAIN_TAB_1_OFFSET 0x0000a400 -#define PHY_BB_TX_GAIN_TAB_1_TG_TABLE1_MSB 31 -#define PHY_BB_TX_GAIN_TAB_1_TG_TABLE1_LSB 0 -#define PHY_BB_TX_GAIN_TAB_1_TG_TABLE1_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_1_TG_TABLE1_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_1_TG_TABLE1_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_2 */ -#define PHY_BB_TX_GAIN_TAB_2_ADDRESS 0x0000a404 -#define PHY_BB_TX_GAIN_TAB_2_OFFSET 0x0000a404 -#define PHY_BB_TX_GAIN_TAB_2_TG_TABLE2_MSB 31 -#define PHY_BB_TX_GAIN_TAB_2_TG_TABLE2_LSB 0 -#define PHY_BB_TX_GAIN_TAB_2_TG_TABLE2_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_2_TG_TABLE2_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_2_TG_TABLE2_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_3 */ -#define PHY_BB_TX_GAIN_TAB_3_ADDRESS 0x0000a408 -#define PHY_BB_TX_GAIN_TAB_3_OFFSET 0x0000a408 -#define PHY_BB_TX_GAIN_TAB_3_TG_TABLE3_MSB 31 -#define PHY_BB_TX_GAIN_TAB_3_TG_TABLE3_LSB 0 -#define PHY_BB_TX_GAIN_TAB_3_TG_TABLE3_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_3_TG_TABLE3_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_3_TG_TABLE3_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_4 */ -#define PHY_BB_TX_GAIN_TAB_4_ADDRESS 0x0000a40c -#define PHY_BB_TX_GAIN_TAB_4_OFFSET 0x0000a40c -#define PHY_BB_TX_GAIN_TAB_4_TG_TABLE4_MSB 31 -#define PHY_BB_TX_GAIN_TAB_4_TG_TABLE4_LSB 0 -#define PHY_BB_TX_GAIN_TAB_4_TG_TABLE4_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_4_TG_TABLE4_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_4_TG_TABLE4_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_5 */ -#define PHY_BB_TX_GAIN_TAB_5_ADDRESS 0x0000a410 -#define PHY_BB_TX_GAIN_TAB_5_OFFSET 0x0000a410 -#define PHY_BB_TX_GAIN_TAB_5_TG_TABLE5_MSB 31 -#define PHY_BB_TX_GAIN_TAB_5_TG_TABLE5_LSB 0 -#define PHY_BB_TX_GAIN_TAB_5_TG_TABLE5_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_5_TG_TABLE5_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_5_TG_TABLE5_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_6 */ -#define PHY_BB_TX_GAIN_TAB_6_ADDRESS 0x0000a414 -#define PHY_BB_TX_GAIN_TAB_6_OFFSET 0x0000a414 -#define PHY_BB_TX_GAIN_TAB_6_TG_TABLE6_MSB 31 -#define PHY_BB_TX_GAIN_TAB_6_TG_TABLE6_LSB 0 -#define PHY_BB_TX_GAIN_TAB_6_TG_TABLE6_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_6_TG_TABLE6_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_6_TG_TABLE6_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_7 */ -#define PHY_BB_TX_GAIN_TAB_7_ADDRESS 0x0000a418 -#define PHY_BB_TX_GAIN_TAB_7_OFFSET 0x0000a418 -#define PHY_BB_TX_GAIN_TAB_7_TG_TABLE7_MSB 31 -#define PHY_BB_TX_GAIN_TAB_7_TG_TABLE7_LSB 0 -#define PHY_BB_TX_GAIN_TAB_7_TG_TABLE7_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_7_TG_TABLE7_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_7_TG_TABLE7_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_8 */ -#define PHY_BB_TX_GAIN_TAB_8_ADDRESS 0x0000a41c -#define PHY_BB_TX_GAIN_TAB_8_OFFSET 0x0000a41c -#define PHY_BB_TX_GAIN_TAB_8_TG_TABLE8_MSB 31 -#define PHY_BB_TX_GAIN_TAB_8_TG_TABLE8_LSB 0 -#define PHY_BB_TX_GAIN_TAB_8_TG_TABLE8_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_8_TG_TABLE8_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_8_TG_TABLE8_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_9 */ -#define PHY_BB_TX_GAIN_TAB_9_ADDRESS 0x0000a420 -#define PHY_BB_TX_GAIN_TAB_9_OFFSET 0x0000a420 -#define PHY_BB_TX_GAIN_TAB_9_TG_TABLE9_MSB 31 -#define PHY_BB_TX_GAIN_TAB_9_TG_TABLE9_LSB 0 -#define PHY_BB_TX_GAIN_TAB_9_TG_TABLE9_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_9_TG_TABLE9_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_9_TG_TABLE9_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_10 */ -#define PHY_BB_TX_GAIN_TAB_10_ADDRESS 0x0000a424 -#define PHY_BB_TX_GAIN_TAB_10_OFFSET 0x0000a424 -#define PHY_BB_TX_GAIN_TAB_10_TG_TABLE10_MSB 31 -#define PHY_BB_TX_GAIN_TAB_10_TG_TABLE10_LSB 0 -#define PHY_BB_TX_GAIN_TAB_10_TG_TABLE10_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_10_TG_TABLE10_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_10_TG_TABLE10_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_11 */ -#define PHY_BB_TX_GAIN_TAB_11_ADDRESS 0x0000a428 -#define PHY_BB_TX_GAIN_TAB_11_OFFSET 0x0000a428 -#define PHY_BB_TX_GAIN_TAB_11_TG_TABLE11_MSB 31 -#define PHY_BB_TX_GAIN_TAB_11_TG_TABLE11_LSB 0 -#define PHY_BB_TX_GAIN_TAB_11_TG_TABLE11_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_11_TG_TABLE11_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_11_TG_TABLE11_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_12 */ -#define PHY_BB_TX_GAIN_TAB_12_ADDRESS 0x0000a42c -#define PHY_BB_TX_GAIN_TAB_12_OFFSET 0x0000a42c -#define PHY_BB_TX_GAIN_TAB_12_TG_TABLE12_MSB 31 -#define PHY_BB_TX_GAIN_TAB_12_TG_TABLE12_LSB 0 -#define PHY_BB_TX_GAIN_TAB_12_TG_TABLE12_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_12_TG_TABLE12_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_12_TG_TABLE12_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_13 */ -#define PHY_BB_TX_GAIN_TAB_13_ADDRESS 0x0000a430 -#define PHY_BB_TX_GAIN_TAB_13_OFFSET 0x0000a430 -#define PHY_BB_TX_GAIN_TAB_13_TG_TABLE13_MSB 31 -#define PHY_BB_TX_GAIN_TAB_13_TG_TABLE13_LSB 0 -#define PHY_BB_TX_GAIN_TAB_13_TG_TABLE13_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_13_TG_TABLE13_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_13_TG_TABLE13_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_14 */ -#define PHY_BB_TX_GAIN_TAB_14_ADDRESS 0x0000a434 -#define PHY_BB_TX_GAIN_TAB_14_OFFSET 0x0000a434 -#define PHY_BB_TX_GAIN_TAB_14_TG_TABLE14_MSB 31 -#define PHY_BB_TX_GAIN_TAB_14_TG_TABLE14_LSB 0 -#define PHY_BB_TX_GAIN_TAB_14_TG_TABLE14_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_14_TG_TABLE14_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_14_TG_TABLE14_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_15 */ -#define PHY_BB_TX_GAIN_TAB_15_ADDRESS 0x0000a438 -#define PHY_BB_TX_GAIN_TAB_15_OFFSET 0x0000a438 -#define PHY_BB_TX_GAIN_TAB_15_TG_TABLE15_MSB 31 -#define PHY_BB_TX_GAIN_TAB_15_TG_TABLE15_LSB 0 -#define PHY_BB_TX_GAIN_TAB_15_TG_TABLE15_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_15_TG_TABLE15_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_15_TG_TABLE15_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_16 */ -#define PHY_BB_TX_GAIN_TAB_16_ADDRESS 0x0000a43c -#define PHY_BB_TX_GAIN_TAB_16_OFFSET 0x0000a43c -#define PHY_BB_TX_GAIN_TAB_16_TG_TABLE16_MSB 31 -#define PHY_BB_TX_GAIN_TAB_16_TG_TABLE16_LSB 0 -#define PHY_BB_TX_GAIN_TAB_16_TG_TABLE16_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_16_TG_TABLE16_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_16_TG_TABLE16_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_17 */ -#define PHY_BB_TX_GAIN_TAB_17_ADDRESS 0x0000a440 -#define PHY_BB_TX_GAIN_TAB_17_OFFSET 0x0000a440 -#define PHY_BB_TX_GAIN_TAB_17_TG_TABLE17_MSB 31 -#define PHY_BB_TX_GAIN_TAB_17_TG_TABLE17_LSB 0 -#define PHY_BB_TX_GAIN_TAB_17_TG_TABLE17_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_17_TG_TABLE17_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_17_TG_TABLE17_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_18 */ -#define PHY_BB_TX_GAIN_TAB_18_ADDRESS 0x0000a444 -#define PHY_BB_TX_GAIN_TAB_18_OFFSET 0x0000a444 -#define PHY_BB_TX_GAIN_TAB_18_TG_TABLE18_MSB 31 -#define PHY_BB_TX_GAIN_TAB_18_TG_TABLE18_LSB 0 -#define PHY_BB_TX_GAIN_TAB_18_TG_TABLE18_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_18_TG_TABLE18_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_18_TG_TABLE18_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_19 */ -#define PHY_BB_TX_GAIN_TAB_19_ADDRESS 0x0000a448 -#define PHY_BB_TX_GAIN_TAB_19_OFFSET 0x0000a448 -#define PHY_BB_TX_GAIN_TAB_19_TG_TABLE19_MSB 31 -#define PHY_BB_TX_GAIN_TAB_19_TG_TABLE19_LSB 0 -#define PHY_BB_TX_GAIN_TAB_19_TG_TABLE19_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_19_TG_TABLE19_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_19_TG_TABLE19_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_20 */ -#define PHY_BB_TX_GAIN_TAB_20_ADDRESS 0x0000a44c -#define PHY_BB_TX_GAIN_TAB_20_OFFSET 0x0000a44c -#define PHY_BB_TX_GAIN_TAB_20_TG_TABLE20_MSB 31 -#define PHY_BB_TX_GAIN_TAB_20_TG_TABLE20_LSB 0 -#define PHY_BB_TX_GAIN_TAB_20_TG_TABLE20_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_20_TG_TABLE20_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_20_TG_TABLE20_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_21 */ -#define PHY_BB_TX_GAIN_TAB_21_ADDRESS 0x0000a450 -#define PHY_BB_TX_GAIN_TAB_21_OFFSET 0x0000a450 -#define PHY_BB_TX_GAIN_TAB_21_TG_TABLE21_MSB 31 -#define PHY_BB_TX_GAIN_TAB_21_TG_TABLE21_LSB 0 -#define PHY_BB_TX_GAIN_TAB_21_TG_TABLE21_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_21_TG_TABLE21_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_21_TG_TABLE21_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_22 */ -#define PHY_BB_TX_GAIN_TAB_22_ADDRESS 0x0000a454 -#define PHY_BB_TX_GAIN_TAB_22_OFFSET 0x0000a454 -#define PHY_BB_TX_GAIN_TAB_22_TG_TABLE22_MSB 31 -#define PHY_BB_TX_GAIN_TAB_22_TG_TABLE22_LSB 0 -#define PHY_BB_TX_GAIN_TAB_22_TG_TABLE22_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_22_TG_TABLE22_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_22_TG_TABLE22_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_23 */ -#define PHY_BB_TX_GAIN_TAB_23_ADDRESS 0x0000a458 -#define PHY_BB_TX_GAIN_TAB_23_OFFSET 0x0000a458 -#define PHY_BB_TX_GAIN_TAB_23_TG_TABLE23_MSB 31 -#define PHY_BB_TX_GAIN_TAB_23_TG_TABLE23_LSB 0 -#define PHY_BB_TX_GAIN_TAB_23_TG_TABLE23_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_23_TG_TABLE23_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_23_TG_TABLE23_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_24 */ -#define PHY_BB_TX_GAIN_TAB_24_ADDRESS 0x0000a45c -#define PHY_BB_TX_GAIN_TAB_24_OFFSET 0x0000a45c -#define PHY_BB_TX_GAIN_TAB_24_TG_TABLE24_MSB 31 -#define PHY_BB_TX_GAIN_TAB_24_TG_TABLE24_LSB 0 -#define PHY_BB_TX_GAIN_TAB_24_TG_TABLE24_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_24_TG_TABLE24_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_24_TG_TABLE24_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_25 */ -#define PHY_BB_TX_GAIN_TAB_25_ADDRESS 0x0000a460 -#define PHY_BB_TX_GAIN_TAB_25_OFFSET 0x0000a460 -#define PHY_BB_TX_GAIN_TAB_25_TG_TABLE25_MSB 31 -#define PHY_BB_TX_GAIN_TAB_25_TG_TABLE25_LSB 0 -#define PHY_BB_TX_GAIN_TAB_25_TG_TABLE25_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_25_TG_TABLE25_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_25_TG_TABLE25_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_26 */ -#define PHY_BB_TX_GAIN_TAB_26_ADDRESS 0x0000a464 -#define PHY_BB_TX_GAIN_TAB_26_OFFSET 0x0000a464 -#define PHY_BB_TX_GAIN_TAB_26_TG_TABLE26_MSB 31 -#define PHY_BB_TX_GAIN_TAB_26_TG_TABLE26_LSB 0 -#define PHY_BB_TX_GAIN_TAB_26_TG_TABLE26_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_26_TG_TABLE26_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_26_TG_TABLE26_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_27 */ -#define PHY_BB_TX_GAIN_TAB_27_ADDRESS 0x0000a468 -#define PHY_BB_TX_GAIN_TAB_27_OFFSET 0x0000a468 -#define PHY_BB_TX_GAIN_TAB_27_TG_TABLE27_MSB 31 -#define PHY_BB_TX_GAIN_TAB_27_TG_TABLE27_LSB 0 -#define PHY_BB_TX_GAIN_TAB_27_TG_TABLE27_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_27_TG_TABLE27_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_27_TG_TABLE27_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_28 */ -#define PHY_BB_TX_GAIN_TAB_28_ADDRESS 0x0000a46c -#define PHY_BB_TX_GAIN_TAB_28_OFFSET 0x0000a46c -#define PHY_BB_TX_GAIN_TAB_28_TG_TABLE28_MSB 31 -#define PHY_BB_TX_GAIN_TAB_28_TG_TABLE28_LSB 0 -#define PHY_BB_TX_GAIN_TAB_28_TG_TABLE28_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_28_TG_TABLE28_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_28_TG_TABLE28_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_29 */ -#define PHY_BB_TX_GAIN_TAB_29_ADDRESS 0x0000a470 -#define PHY_BB_TX_GAIN_TAB_29_OFFSET 0x0000a470 -#define PHY_BB_TX_GAIN_TAB_29_TG_TABLE29_MSB 31 -#define PHY_BB_TX_GAIN_TAB_29_TG_TABLE29_LSB 0 -#define PHY_BB_TX_GAIN_TAB_29_TG_TABLE29_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_29_TG_TABLE29_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_29_TG_TABLE29_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_30 */ -#define PHY_BB_TX_GAIN_TAB_30_ADDRESS 0x0000a474 -#define PHY_BB_TX_GAIN_TAB_30_OFFSET 0x0000a474 -#define PHY_BB_TX_GAIN_TAB_30_TG_TABLE30_MSB 31 -#define PHY_BB_TX_GAIN_TAB_30_TG_TABLE30_LSB 0 -#define PHY_BB_TX_GAIN_TAB_30_TG_TABLE30_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_30_TG_TABLE30_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_30_TG_TABLE30_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_31 */ -#define PHY_BB_TX_GAIN_TAB_31_ADDRESS 0x0000a478 -#define PHY_BB_TX_GAIN_TAB_31_OFFSET 0x0000a478 -#define PHY_BB_TX_GAIN_TAB_31_TG_TABLE31_MSB 31 -#define PHY_BB_TX_GAIN_TAB_31_TG_TABLE31_LSB 0 -#define PHY_BB_TX_GAIN_TAB_31_TG_TABLE31_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_31_TG_TABLE31_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_31_TG_TABLE31_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_32 */ -#define PHY_BB_TX_GAIN_TAB_32_ADDRESS 0x0000a47c -#define PHY_BB_TX_GAIN_TAB_32_OFFSET 0x0000a47c -#define PHY_BB_TX_GAIN_TAB_32_TG_TABLE32_MSB 31 -#define PHY_BB_TX_GAIN_TAB_32_TG_TABLE32_LSB 0 -#define PHY_BB_TX_GAIN_TAB_32_TG_TABLE32_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_32_TG_TABLE32_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_32_TG_TABLE32_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_1 */ -#define PHY_BB_TX_GAIN_TAB_PAL_1_ADDRESS 0x0000a480 -#define PHY_BB_TX_GAIN_TAB_PAL_1_OFFSET 0x0000a480 -#define PHY_BB_TX_GAIN_TAB_PAL_1_TG_TABLE1_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_1_TG_TABLE1_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_1_TG_TABLE1_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_1_TG_TABLE1_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_1_TG_TABLE1_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_2 */ -#define PHY_BB_TX_GAIN_TAB_PAL_2_ADDRESS 0x0000a484 -#define PHY_BB_TX_GAIN_TAB_PAL_2_OFFSET 0x0000a484 -#define PHY_BB_TX_GAIN_TAB_PAL_2_TG_TABLE2_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_2_TG_TABLE2_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_2_TG_TABLE2_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_2_TG_TABLE2_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_2_TG_TABLE2_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_3 */ -#define PHY_BB_TX_GAIN_TAB_PAL_3_ADDRESS 0x0000a488 -#define PHY_BB_TX_GAIN_TAB_PAL_3_OFFSET 0x0000a488 -#define PHY_BB_TX_GAIN_TAB_PAL_3_TG_TABLE3_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_3_TG_TABLE3_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_3_TG_TABLE3_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_3_TG_TABLE3_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_3_TG_TABLE3_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_4 */ -#define PHY_BB_TX_GAIN_TAB_PAL_4_ADDRESS 0x0000a48c -#define PHY_BB_TX_GAIN_TAB_PAL_4_OFFSET 0x0000a48c -#define PHY_BB_TX_GAIN_TAB_PAL_4_TG_TABLE4_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_4_TG_TABLE4_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_4_TG_TABLE4_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_4_TG_TABLE4_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_4_TG_TABLE4_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_5 */ -#define PHY_BB_TX_GAIN_TAB_PAL_5_ADDRESS 0x0000a490 -#define PHY_BB_TX_GAIN_TAB_PAL_5_OFFSET 0x0000a490 -#define PHY_BB_TX_GAIN_TAB_PAL_5_TG_TABLE5_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_5_TG_TABLE5_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_5_TG_TABLE5_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_5_TG_TABLE5_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_5_TG_TABLE5_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_6 */ -#define PHY_BB_TX_GAIN_TAB_PAL_6_ADDRESS 0x0000a494 -#define PHY_BB_TX_GAIN_TAB_PAL_6_OFFSET 0x0000a494 -#define PHY_BB_TX_GAIN_TAB_PAL_6_TG_TABLE6_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_6_TG_TABLE6_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_6_TG_TABLE6_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_6_TG_TABLE6_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_6_TG_TABLE6_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_7 */ -#define PHY_BB_TX_GAIN_TAB_PAL_7_ADDRESS 0x0000a498 -#define PHY_BB_TX_GAIN_TAB_PAL_7_OFFSET 0x0000a498 -#define PHY_BB_TX_GAIN_TAB_PAL_7_TG_TABLE7_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_7_TG_TABLE7_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_7_TG_TABLE7_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_7_TG_TABLE7_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_7_TG_TABLE7_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_8 */ -#define PHY_BB_TX_GAIN_TAB_PAL_8_ADDRESS 0x0000a49c -#define PHY_BB_TX_GAIN_TAB_PAL_8_OFFSET 0x0000a49c -#define PHY_BB_TX_GAIN_TAB_PAL_8_TG_TABLE8_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_8_TG_TABLE8_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_8_TG_TABLE8_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_8_TG_TABLE8_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_8_TG_TABLE8_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_9 */ -#define PHY_BB_TX_GAIN_TAB_PAL_9_ADDRESS 0x0000a4a0 -#define PHY_BB_TX_GAIN_TAB_PAL_9_OFFSET 0x0000a4a0 -#define PHY_BB_TX_GAIN_TAB_PAL_9_TG_TABLE9_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_9_TG_TABLE9_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_9_TG_TABLE9_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_9_TG_TABLE9_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_9_TG_TABLE9_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_10 */ -#define PHY_BB_TX_GAIN_TAB_PAL_10_ADDRESS 0x0000a4a4 -#define PHY_BB_TX_GAIN_TAB_PAL_10_OFFSET 0x0000a4a4 -#define PHY_BB_TX_GAIN_TAB_PAL_10_TG_TABLE10_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_10_TG_TABLE10_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_10_TG_TABLE10_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_10_TG_TABLE10_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_10_TG_TABLE10_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_11 */ -#define PHY_BB_TX_GAIN_TAB_PAL_11_ADDRESS 0x0000a4a8 -#define PHY_BB_TX_GAIN_TAB_PAL_11_OFFSET 0x0000a4a8 -#define PHY_BB_TX_GAIN_TAB_PAL_11_TG_TABLE11_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_11_TG_TABLE11_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_11_TG_TABLE11_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_11_TG_TABLE11_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_11_TG_TABLE11_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_12 */ -#define PHY_BB_TX_GAIN_TAB_PAL_12_ADDRESS 0x0000a4ac -#define PHY_BB_TX_GAIN_TAB_PAL_12_OFFSET 0x0000a4ac -#define PHY_BB_TX_GAIN_TAB_PAL_12_TG_TABLE12_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_12_TG_TABLE12_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_12_TG_TABLE12_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_12_TG_TABLE12_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_12_TG_TABLE12_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_13 */ -#define PHY_BB_TX_GAIN_TAB_PAL_13_ADDRESS 0x0000a4b0 -#define PHY_BB_TX_GAIN_TAB_PAL_13_OFFSET 0x0000a4b0 -#define PHY_BB_TX_GAIN_TAB_PAL_13_TG_TABLE13_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_13_TG_TABLE13_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_13_TG_TABLE13_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_13_TG_TABLE13_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_13_TG_TABLE13_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_14 */ -#define PHY_BB_TX_GAIN_TAB_PAL_14_ADDRESS 0x0000a4b4 -#define PHY_BB_TX_GAIN_TAB_PAL_14_OFFSET 0x0000a4b4 -#define PHY_BB_TX_GAIN_TAB_PAL_14_TG_TABLE14_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_14_TG_TABLE14_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_14_TG_TABLE14_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_14_TG_TABLE14_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_14_TG_TABLE14_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_15 */ -#define PHY_BB_TX_GAIN_TAB_PAL_15_ADDRESS 0x0000a4b8 -#define PHY_BB_TX_GAIN_TAB_PAL_15_OFFSET 0x0000a4b8 -#define PHY_BB_TX_GAIN_TAB_PAL_15_TG_TABLE15_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_15_TG_TABLE15_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_15_TG_TABLE15_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_15_TG_TABLE15_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_15_TG_TABLE15_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_16 */ -#define PHY_BB_TX_GAIN_TAB_PAL_16_ADDRESS 0x0000a4bc -#define PHY_BB_TX_GAIN_TAB_PAL_16_OFFSET 0x0000a4bc -#define PHY_BB_TX_GAIN_TAB_PAL_16_TG_TABLE16_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_16_TG_TABLE16_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_16_TG_TABLE16_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_16_TG_TABLE16_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_16_TG_TABLE16_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_17 */ -#define PHY_BB_TX_GAIN_TAB_PAL_17_ADDRESS 0x0000a4c0 -#define PHY_BB_TX_GAIN_TAB_PAL_17_OFFSET 0x0000a4c0 -#define PHY_BB_TX_GAIN_TAB_PAL_17_TG_TABLE17_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_17_TG_TABLE17_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_17_TG_TABLE17_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_17_TG_TABLE17_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_17_TG_TABLE17_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_18 */ -#define PHY_BB_TX_GAIN_TAB_PAL_18_ADDRESS 0x0000a4c4 -#define PHY_BB_TX_GAIN_TAB_PAL_18_OFFSET 0x0000a4c4 -#define PHY_BB_TX_GAIN_TAB_PAL_18_TG_TABLE18_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_18_TG_TABLE18_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_18_TG_TABLE18_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_18_TG_TABLE18_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_18_TG_TABLE18_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_19 */ -#define PHY_BB_TX_GAIN_TAB_PAL_19_ADDRESS 0x0000a4c8 -#define PHY_BB_TX_GAIN_TAB_PAL_19_OFFSET 0x0000a4c8 -#define PHY_BB_TX_GAIN_TAB_PAL_19_TG_TABLE19_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_19_TG_TABLE19_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_19_TG_TABLE19_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_19_TG_TABLE19_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_19_TG_TABLE19_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_20 */ -#define PHY_BB_TX_GAIN_TAB_PAL_20_ADDRESS 0x0000a4cc -#define PHY_BB_TX_GAIN_TAB_PAL_20_OFFSET 0x0000a4cc -#define PHY_BB_TX_GAIN_TAB_PAL_20_TG_TABLE20_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_20_TG_TABLE20_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_20_TG_TABLE20_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_20_TG_TABLE20_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_20_TG_TABLE20_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_21 */ -#define PHY_BB_TX_GAIN_TAB_PAL_21_ADDRESS 0x0000a4d0 -#define PHY_BB_TX_GAIN_TAB_PAL_21_OFFSET 0x0000a4d0 -#define PHY_BB_TX_GAIN_TAB_PAL_21_TG_TABLE21_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_21_TG_TABLE21_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_21_TG_TABLE21_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_21_TG_TABLE21_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_21_TG_TABLE21_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_22 */ -#define PHY_BB_TX_GAIN_TAB_PAL_22_ADDRESS 0x0000a4d4 -#define PHY_BB_TX_GAIN_TAB_PAL_22_OFFSET 0x0000a4d4 -#define PHY_BB_TX_GAIN_TAB_PAL_22_TG_TABLE22_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_22_TG_TABLE22_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_22_TG_TABLE22_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_22_TG_TABLE22_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_22_TG_TABLE22_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_23 */ -#define PHY_BB_TX_GAIN_TAB_PAL_23_ADDRESS 0x0000a4d8 -#define PHY_BB_TX_GAIN_TAB_PAL_23_OFFSET 0x0000a4d8 -#define PHY_BB_TX_GAIN_TAB_PAL_23_TG_TABLE23_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_23_TG_TABLE23_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_23_TG_TABLE23_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_23_TG_TABLE23_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_23_TG_TABLE23_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_24 */ -#define PHY_BB_TX_GAIN_TAB_PAL_24_ADDRESS 0x0000a4dc -#define PHY_BB_TX_GAIN_TAB_PAL_24_OFFSET 0x0000a4dc -#define PHY_BB_TX_GAIN_TAB_PAL_24_TG_TABLE24_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_24_TG_TABLE24_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_24_TG_TABLE24_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_24_TG_TABLE24_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_24_TG_TABLE24_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_25 */ -#define PHY_BB_TX_GAIN_TAB_PAL_25_ADDRESS 0x0000a4e0 -#define PHY_BB_TX_GAIN_TAB_PAL_25_OFFSET 0x0000a4e0 -#define PHY_BB_TX_GAIN_TAB_PAL_25_TG_TABLE25_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_25_TG_TABLE25_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_25_TG_TABLE25_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_25_TG_TABLE25_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_25_TG_TABLE25_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_26 */ -#define PHY_BB_TX_GAIN_TAB_PAL_26_ADDRESS 0x0000a4e4 -#define PHY_BB_TX_GAIN_TAB_PAL_26_OFFSET 0x0000a4e4 -#define PHY_BB_TX_GAIN_TAB_PAL_26_TG_TABLE26_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_26_TG_TABLE26_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_26_TG_TABLE26_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_26_TG_TABLE26_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_26_TG_TABLE26_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_27 */ -#define PHY_BB_TX_GAIN_TAB_PAL_27_ADDRESS 0x0000a4e8 -#define PHY_BB_TX_GAIN_TAB_PAL_27_OFFSET 0x0000a4e8 -#define PHY_BB_TX_GAIN_TAB_PAL_27_TG_TABLE27_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_27_TG_TABLE27_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_27_TG_TABLE27_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_27_TG_TABLE27_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_27_TG_TABLE27_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_28 */ -#define PHY_BB_TX_GAIN_TAB_PAL_28_ADDRESS 0x0000a4ec -#define PHY_BB_TX_GAIN_TAB_PAL_28_OFFSET 0x0000a4ec -#define PHY_BB_TX_GAIN_TAB_PAL_28_TG_TABLE28_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_28_TG_TABLE28_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_28_TG_TABLE28_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_28_TG_TABLE28_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_28_TG_TABLE28_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_29 */ -#define PHY_BB_TX_GAIN_TAB_PAL_29_ADDRESS 0x0000a4f0 -#define PHY_BB_TX_GAIN_TAB_PAL_29_OFFSET 0x0000a4f0 -#define PHY_BB_TX_GAIN_TAB_PAL_29_TG_TABLE29_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_29_TG_TABLE29_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_29_TG_TABLE29_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_29_TG_TABLE29_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_29_TG_TABLE29_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_30 */ -#define PHY_BB_TX_GAIN_TAB_PAL_30_ADDRESS 0x0000a4f4 -#define PHY_BB_TX_GAIN_TAB_PAL_30_OFFSET 0x0000a4f4 -#define PHY_BB_TX_GAIN_TAB_PAL_30_TG_TABLE30_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_30_TG_TABLE30_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_30_TG_TABLE30_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_30_TG_TABLE30_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_30_TG_TABLE30_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_31 */ -#define PHY_BB_TX_GAIN_TAB_PAL_31_ADDRESS 0x0000a4f8 -#define PHY_BB_TX_GAIN_TAB_PAL_31_OFFSET 0x0000a4f8 -#define PHY_BB_TX_GAIN_TAB_PAL_31_TG_TABLE31_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_31_TG_TABLE31_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_31_TG_TABLE31_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_31_TG_TABLE31_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_31_TG_TABLE31_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_tx_gain_tab_pal_32 */ -#define PHY_BB_TX_GAIN_TAB_PAL_32_ADDRESS 0x0000a4fc -#define PHY_BB_TX_GAIN_TAB_PAL_32_OFFSET 0x0000a4fc -#define PHY_BB_TX_GAIN_TAB_PAL_32_TG_TABLE32_PAL_ON_MSB 31 -#define PHY_BB_TX_GAIN_TAB_PAL_32_TG_TABLE32_PAL_ON_LSB 0 -#define PHY_BB_TX_GAIN_TAB_PAL_32_TG_TABLE32_PAL_ON_MASK 0xffffffff -#define PHY_BB_TX_GAIN_TAB_PAL_32_TG_TABLE32_PAL_ON_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_TX_GAIN_TAB_PAL_32_TG_TABLE32_PAL_ON_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_caltx_gain_set_0 */ -#define PHY_BB_CALTX_GAIN_SET_0_ADDRESS 0x0000a518 -#define PHY_BB_CALTX_GAIN_SET_0_OFFSET 0x0000a518 -#define PHY_BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_0_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_0_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_0_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_0_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_0_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_1_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_1_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_1_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_1_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_1_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_caltx_gain_set_2 */ -#define PHY_BB_CALTX_GAIN_SET_2_ADDRESS 0x0000a51c -#define PHY_BB_CALTX_GAIN_SET_2_OFFSET 0x0000a51c -#define PHY_BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_2_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_2_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_2_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_2_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_2_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_3_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_3_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_3_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_3_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_3_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_caltx_gain_set_4 */ -#define PHY_BB_CALTX_GAIN_SET_4_ADDRESS 0x0000a520 -#define PHY_BB_CALTX_GAIN_SET_4_OFFSET 0x0000a520 -#define PHY_BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_4_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_4_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_4_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_4_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_4_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_5_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_5_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_5_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_5_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_5_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_caltx_gain_set_6 */ -#define PHY_BB_CALTX_GAIN_SET_6_ADDRESS 0x0000a524 -#define PHY_BB_CALTX_GAIN_SET_6_OFFSET 0x0000a524 -#define PHY_BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_6_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_6_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_6_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_6_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_6_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_7_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_7_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_7_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_7_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_7_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_caltx_gain_set_8 */ -#define PHY_BB_CALTX_GAIN_SET_8_ADDRESS 0x0000a528 -#define PHY_BB_CALTX_GAIN_SET_8_OFFSET 0x0000a528 -#define PHY_BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_8_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_8_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_8_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_8_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_8_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_9_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_9_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_9_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_9_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_9_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_caltx_gain_set_10 */ -#define PHY_BB_CALTX_GAIN_SET_10_ADDRESS 0x0000a52c -#define PHY_BB_CALTX_GAIN_SET_10_OFFSET 0x0000a52c -#define PHY_BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_10_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_10_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_10_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_10_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_10_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_11_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_11_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_11_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_11_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_11_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_caltx_gain_set_12 */ -#define PHY_BB_CALTX_GAIN_SET_12_ADDRESS 0x0000a530 -#define PHY_BB_CALTX_GAIN_SET_12_OFFSET 0x0000a530 -#define PHY_BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_12_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_12_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_12_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_12_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_12_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_13_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_13_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_13_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_13_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_13_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_caltx_gain_set_14 */ -#define PHY_BB_CALTX_GAIN_SET_14_ADDRESS 0x0000a534 -#define PHY_BB_CALTX_GAIN_SET_14_OFFSET 0x0000a534 -#define PHY_BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_14_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_14_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_14_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_14_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_14_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_15_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_15_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_15_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_15_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_15_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_caltx_gain_set_16 */ -#define PHY_BB_CALTX_GAIN_SET_16_ADDRESS 0x0000a538 -#define PHY_BB_CALTX_GAIN_SET_16_OFFSET 0x0000a538 -#define PHY_BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_16_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_16_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_16_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_16_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_16_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_17_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_17_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_17_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_17_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_17_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_caltx_gain_set_18 */ -#define PHY_BB_CALTX_GAIN_SET_18_ADDRESS 0x0000a53c -#define PHY_BB_CALTX_GAIN_SET_18_OFFSET 0x0000a53c -#define PHY_BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_18_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_18_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_18_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_18_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_18_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_19_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_19_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_19_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_19_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_19_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_caltx_gain_set_20 */ -#define PHY_BB_CALTX_GAIN_SET_20_ADDRESS 0x0000a540 -#define PHY_BB_CALTX_GAIN_SET_20_OFFSET 0x0000a540 -#define PHY_BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_20_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_20_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_20_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_20_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_20_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_21_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_21_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_21_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_21_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_21_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_caltx_gain_set_22 */ -#define PHY_BB_CALTX_GAIN_SET_22_ADDRESS 0x0000a544 -#define PHY_BB_CALTX_GAIN_SET_22_OFFSET 0x0000a544 -#define PHY_BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_22_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_22_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_22_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_22_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_22_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_23_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_23_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_23_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_23_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_23_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_caltx_gain_set_24 */ -#define PHY_BB_CALTX_GAIN_SET_24_ADDRESS 0x0000a548 -#define PHY_BB_CALTX_GAIN_SET_24_OFFSET 0x0000a548 -#define PHY_BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_24_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_24_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_24_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_24_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_24_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_25_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_25_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_25_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_25_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_25_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_caltx_gain_set_26 */ -#define PHY_BB_CALTX_GAIN_SET_26_ADDRESS 0x0000a54c -#define PHY_BB_CALTX_GAIN_SET_26_OFFSET 0x0000a54c -#define PHY_BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_26_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_26_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_26_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_26_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_26_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_27_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_27_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_27_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_27_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_27_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_caltx_gain_set_28 */ -#define PHY_BB_CALTX_GAIN_SET_28_ADDRESS 0x0000a550 -#define PHY_BB_CALTX_GAIN_SET_28_OFFSET 0x0000a550 -#define PHY_BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_28_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_28_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_28_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_28_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_28_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_29_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_29_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_29_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_29_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_29_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_caltx_gain_set_30 */ -#define PHY_BB_CALTX_GAIN_SET_30_ADDRESS 0x0000a554 -#define PHY_BB_CALTX_GAIN_SET_30_OFFSET 0x0000a554 -#define PHY_BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_30_MSB 13 -#define PHY_BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_30_LSB 0 -#define PHY_BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_30_MASK 0x00003fff -#define PHY_BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_30_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_30_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_31_MSB 27 -#define PHY_BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_31_LSB 14 -#define PHY_BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_31_MASK 0x0fffc000 -#define PHY_BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_31_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_31_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_txiqcal_meas_b0 */ -#define PHY_BB_TXIQCAL_MEAS_B0_ADDRESS 0x0000a558 -#define PHY_BB_TXIQCAL_MEAS_B0_OFFSET 0x0000a558 -#define PHY_BB_TXIQCAL_MEAS_B0_TXIQC_MEAS_DATA0_0_MSB 11 -#define PHY_BB_TXIQCAL_MEAS_B0_TXIQC_MEAS_DATA0_0_LSB 0 -#define PHY_BB_TXIQCAL_MEAS_B0_TXIQC_MEAS_DATA0_0_MASK 0x00000fff -#define PHY_BB_TXIQCAL_MEAS_B0_TXIQC_MEAS_DATA0_0_GET(x) (((x) & 0x00000fff) >> 0) -#define PHY_BB_TXIQCAL_MEAS_B0_TXIQC_MEAS_DATA1_0_MSB 23 -#define PHY_BB_TXIQCAL_MEAS_B0_TXIQC_MEAS_DATA1_0_LSB 12 -#define PHY_BB_TXIQCAL_MEAS_B0_TXIQC_MEAS_DATA1_0_MASK 0x00fff000 -#define PHY_BB_TXIQCAL_MEAS_B0_TXIQC_MEAS_DATA1_0_GET(x) (((x) & 0x00fff000) >> 12) - -/* macros for BB_txiqcal_start */ -#define PHY_BB_TXIQCAL_START_ADDRESS 0x0000a6d8 -#define PHY_BB_TXIQCAL_START_OFFSET 0x0000a6d8 -#define PHY_BB_TXIQCAL_START_DO_TX_IQCAL_MSB 0 -#define PHY_BB_TXIQCAL_START_DO_TX_IQCAL_LSB 0 -#define PHY_BB_TXIQCAL_START_DO_TX_IQCAL_MASK 0x00000001 -#define PHY_BB_TXIQCAL_START_DO_TX_IQCAL_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_TXIQCAL_START_DO_TX_IQCAL_SET(x) (((x) << 0) & 0x00000001) - -/* macros for BB_txiqcal_control_0 */ -#define PHY_BB_TXIQCAL_CONTROL_0_ADDRESS 0x0000a6dc -#define PHY_BB_TXIQCAL_CONTROL_0_OFFSET 0x0000a6dc -#define PHY_BB_TXIQCAL_CONTROL_0_IQC_TX_TABLE_SEL_MSB 0 -#define PHY_BB_TXIQCAL_CONTROL_0_IQC_TX_TABLE_SEL_LSB 0 -#define PHY_BB_TXIQCAL_CONTROL_0_IQC_TX_TABLE_SEL_MASK 0x00000001 -#define PHY_BB_TXIQCAL_CONTROL_0_IQC_TX_TABLE_SEL_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_TXIQCAL_CONTROL_0_IQC_TX_TABLE_SEL_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_TXIQCAL_CONTROL_0_BASE_TX_TONE_DB_MSB 6 -#define PHY_BB_TXIQCAL_CONTROL_0_BASE_TX_TONE_DB_LSB 1 -#define PHY_BB_TXIQCAL_CONTROL_0_BASE_TX_TONE_DB_MASK 0x0000007e -#define PHY_BB_TXIQCAL_CONTROL_0_BASE_TX_TONE_DB_GET(x) (((x) & 0x0000007e) >> 1) -#define PHY_BB_TXIQCAL_CONTROL_0_BASE_TX_TONE_DB_SET(x) (((x) << 1) & 0x0000007e) -#define PHY_BB_TXIQCAL_CONTROL_0_MAX_TX_TONE_GAIN_MSB 12 -#define PHY_BB_TXIQCAL_CONTROL_0_MAX_TX_TONE_GAIN_LSB 7 -#define PHY_BB_TXIQCAL_CONTROL_0_MAX_TX_TONE_GAIN_MASK 0x00001f80 -#define PHY_BB_TXIQCAL_CONTROL_0_MAX_TX_TONE_GAIN_GET(x) (((x) & 0x00001f80) >> 7) -#define PHY_BB_TXIQCAL_CONTROL_0_MAX_TX_TONE_GAIN_SET(x) (((x) << 7) & 0x00001f80) -#define PHY_BB_TXIQCAL_CONTROL_0_MIN_TX_TONE_GAIN_MSB 18 -#define PHY_BB_TXIQCAL_CONTROL_0_MIN_TX_TONE_GAIN_LSB 13 -#define PHY_BB_TXIQCAL_CONTROL_0_MIN_TX_TONE_GAIN_MASK 0x0007e000 -#define PHY_BB_TXIQCAL_CONTROL_0_MIN_TX_TONE_GAIN_GET(x) (((x) & 0x0007e000) >> 13) -#define PHY_BB_TXIQCAL_CONTROL_0_MIN_TX_TONE_GAIN_SET(x) (((x) << 13) & 0x0007e000) -#define PHY_BB_TXIQCAL_CONTROL_0_CALTXSHIFT_DELAY_MSB 22 -#define PHY_BB_TXIQCAL_CONTROL_0_CALTXSHIFT_DELAY_LSB 19 -#define PHY_BB_TXIQCAL_CONTROL_0_CALTXSHIFT_DELAY_MASK 0x00780000 -#define PHY_BB_TXIQCAL_CONTROL_0_CALTXSHIFT_DELAY_GET(x) (((x) & 0x00780000) >> 19) -#define PHY_BB_TXIQCAL_CONTROL_0_CALTXSHIFT_DELAY_SET(x) (((x) << 19) & 0x00780000) -#define PHY_BB_TXIQCAL_CONTROL_0_LOOPBACK_DELAY_MSB 29 -#define PHY_BB_TXIQCAL_CONTROL_0_LOOPBACK_DELAY_LSB 23 -#define PHY_BB_TXIQCAL_CONTROL_0_LOOPBACK_DELAY_MASK 0x3f800000 -#define PHY_BB_TXIQCAL_CONTROL_0_LOOPBACK_DELAY_GET(x) (((x) & 0x3f800000) >> 23) -#define PHY_BB_TXIQCAL_CONTROL_0_LOOPBACK_DELAY_SET(x) (((x) << 23) & 0x3f800000) - -/* macros for BB_txiqcal_control_1 */ -#define PHY_BB_TXIQCAL_CONTROL_1_ADDRESS 0x0000a6e0 -#define PHY_BB_TXIQCAL_CONTROL_1_OFFSET 0x0000a6e0 -#define PHY_BB_TXIQCAL_CONTROL_1_RX_INIT_GAIN_DB_MSB 5 -#define PHY_BB_TXIQCAL_CONTROL_1_RX_INIT_GAIN_DB_LSB 0 -#define PHY_BB_TXIQCAL_CONTROL_1_RX_INIT_GAIN_DB_MASK 0x0000003f -#define PHY_BB_TXIQCAL_CONTROL_1_RX_INIT_GAIN_DB_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_TXIQCAL_CONTROL_1_RX_INIT_GAIN_DB_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_TXIQCAL_CONTROL_1_MAX_RX_GAIN_DB_MSB 11 -#define PHY_BB_TXIQCAL_CONTROL_1_MAX_RX_GAIN_DB_LSB 6 -#define PHY_BB_TXIQCAL_CONTROL_1_MAX_RX_GAIN_DB_MASK 0x00000fc0 -#define PHY_BB_TXIQCAL_CONTROL_1_MAX_RX_GAIN_DB_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_TXIQCAL_CONTROL_1_MAX_RX_GAIN_DB_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_TXIQCAL_CONTROL_1_MIN_RX_GAIN_DB_MSB 17 -#define PHY_BB_TXIQCAL_CONTROL_1_MIN_RX_GAIN_DB_LSB 12 -#define PHY_BB_TXIQCAL_CONTROL_1_MIN_RX_GAIN_DB_MASK 0x0003f000 -#define PHY_BB_TXIQCAL_CONTROL_1_MIN_RX_GAIN_DB_GET(x) (((x) & 0x0003f000) >> 12) -#define PHY_BB_TXIQCAL_CONTROL_1_MIN_RX_GAIN_DB_SET(x) (((x) << 12) & 0x0003f000) -#define PHY_BB_TXIQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT_MSB 24 -#define PHY_BB_TXIQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT_LSB 18 -#define PHY_BB_TXIQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT_MASK 0x01fc0000 -#define PHY_BB_TXIQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT_GET(x) (((x) & 0x01fc0000) >> 18) -#define PHY_BB_TXIQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT_SET(x) (((x) << 18) & 0x01fc0000) - -/* macros for BB_txiqcal_control_2 */ -#define PHY_BB_TXIQCAL_CONTROL_2_ADDRESS 0x0000a6e4 -#define PHY_BB_TXIQCAL_CONTROL_2_OFFSET 0x0000a6e4 -#define PHY_BB_TXIQCAL_CONTROL_2_IQC_FORCED_PAGAIN_MSB 3 -#define PHY_BB_TXIQCAL_CONTROL_2_IQC_FORCED_PAGAIN_LSB 0 -#define PHY_BB_TXIQCAL_CONTROL_2_IQC_FORCED_PAGAIN_MASK 0x0000000f -#define PHY_BB_TXIQCAL_CONTROL_2_IQC_FORCED_PAGAIN_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_BB_TXIQCAL_CONTROL_2_IQC_FORCED_PAGAIN_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_BB_TXIQCAL_CONTROL_2_IQCAL_MIN_TX_GAIN_MSB 8 -#define PHY_BB_TXIQCAL_CONTROL_2_IQCAL_MIN_TX_GAIN_LSB 4 -#define PHY_BB_TXIQCAL_CONTROL_2_IQCAL_MIN_TX_GAIN_MASK 0x000001f0 -#define PHY_BB_TXIQCAL_CONTROL_2_IQCAL_MIN_TX_GAIN_GET(x) (((x) & 0x000001f0) >> 4) -#define PHY_BB_TXIQCAL_CONTROL_2_IQCAL_MIN_TX_GAIN_SET(x) (((x) << 4) & 0x000001f0) -#define PHY_BB_TXIQCAL_CONTROL_2_IQCAL_MAX_TX_GAIN_MSB 13 -#define PHY_BB_TXIQCAL_CONTROL_2_IQCAL_MAX_TX_GAIN_LSB 9 -#define PHY_BB_TXIQCAL_CONTROL_2_IQCAL_MAX_TX_GAIN_MASK 0x00003e00 -#define PHY_BB_TXIQCAL_CONTROL_2_IQCAL_MAX_TX_GAIN_GET(x) (((x) & 0x00003e00) >> 9) -#define PHY_BB_TXIQCAL_CONTROL_2_IQCAL_MAX_TX_GAIN_SET(x) (((x) << 9) & 0x00003e00) - -/* macros for BB_txiqcal_control_3 */ -#define PHY_BB_TXIQCAL_CONTROL_3_ADDRESS 0x0000a6e8 -#define PHY_BB_TXIQCAL_CONTROL_3_OFFSET 0x0000a6e8 -#define PHY_BB_TXIQCAL_CONTROL_3_PWR_HIGH_DB_MSB 5 -#define PHY_BB_TXIQCAL_CONTROL_3_PWR_HIGH_DB_LSB 0 -#define PHY_BB_TXIQCAL_CONTROL_3_PWR_HIGH_DB_MASK 0x0000003f -#define PHY_BB_TXIQCAL_CONTROL_3_PWR_HIGH_DB_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_TXIQCAL_CONTROL_3_PWR_HIGH_DB_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_TXIQCAL_CONTROL_3_PWR_LOW_DB_MSB 11 -#define PHY_BB_TXIQCAL_CONTROL_3_PWR_LOW_DB_LSB 6 -#define PHY_BB_TXIQCAL_CONTROL_3_PWR_LOW_DB_MASK 0x00000fc0 -#define PHY_BB_TXIQCAL_CONTROL_3_PWR_LOW_DB_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_TXIQCAL_CONTROL_3_PWR_LOW_DB_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_TXIQCAL_CONTROL_3_IQCAL_TONE_PHS_STEP_MSB 21 -#define PHY_BB_TXIQCAL_CONTROL_3_IQCAL_TONE_PHS_STEP_LSB 12 -#define PHY_BB_TXIQCAL_CONTROL_3_IQCAL_TONE_PHS_STEP_MASK 0x003ff000 -#define PHY_BB_TXIQCAL_CONTROL_3_IQCAL_TONE_PHS_STEP_GET(x) (((x) & 0x003ff000) >> 12) -#define PHY_BB_TXIQCAL_CONTROL_3_IQCAL_TONE_PHS_STEP_SET(x) (((x) << 12) & 0x003ff000) -#define PHY_BB_TXIQCAL_CONTROL_3_DC_EST_LEN_MSB 23 -#define PHY_BB_TXIQCAL_CONTROL_3_DC_EST_LEN_LSB 22 -#define PHY_BB_TXIQCAL_CONTROL_3_DC_EST_LEN_MASK 0x00c00000 -#define PHY_BB_TXIQCAL_CONTROL_3_DC_EST_LEN_GET(x) (((x) & 0x00c00000) >> 22) -#define PHY_BB_TXIQCAL_CONTROL_3_DC_EST_LEN_SET(x) (((x) << 22) & 0x00c00000) -#define PHY_BB_TXIQCAL_CONTROL_3_ADC_SAT_LEN_MSB 24 -#define PHY_BB_TXIQCAL_CONTROL_3_ADC_SAT_LEN_LSB 24 -#define PHY_BB_TXIQCAL_CONTROL_3_ADC_SAT_LEN_MASK 0x01000000 -#define PHY_BB_TXIQCAL_CONTROL_3_ADC_SAT_LEN_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_BB_TXIQCAL_CONTROL_3_ADC_SAT_LEN_SET(x) (((x) << 24) & 0x01000000) -#define PHY_BB_TXIQCAL_CONTROL_3_ADC_SAT_SEL_MSB 26 -#define PHY_BB_TXIQCAL_CONTROL_3_ADC_SAT_SEL_LSB 25 -#define PHY_BB_TXIQCAL_CONTROL_3_ADC_SAT_SEL_MASK 0x06000000 -#define PHY_BB_TXIQCAL_CONTROL_3_ADC_SAT_SEL_GET(x) (((x) & 0x06000000) >> 25) -#define PHY_BB_TXIQCAL_CONTROL_3_ADC_SAT_SEL_SET(x) (((x) << 25) & 0x06000000) -#define PHY_BB_TXIQCAL_CONTROL_3_IQCAL_MEAS_LEN_MSB 28 -#define PHY_BB_TXIQCAL_CONTROL_3_IQCAL_MEAS_LEN_LSB 27 -#define PHY_BB_TXIQCAL_CONTROL_3_IQCAL_MEAS_LEN_MASK 0x18000000 -#define PHY_BB_TXIQCAL_CONTROL_3_IQCAL_MEAS_LEN_GET(x) (((x) & 0x18000000) >> 27) -#define PHY_BB_TXIQCAL_CONTROL_3_IQCAL_MEAS_LEN_SET(x) (((x) << 27) & 0x18000000) -#define PHY_BB_TXIQCAL_CONTROL_3_DESIRED_SIZE_DB_MSB 30 -#define PHY_BB_TXIQCAL_CONTROL_3_DESIRED_SIZE_DB_LSB 29 -#define PHY_BB_TXIQCAL_CONTROL_3_DESIRED_SIZE_DB_MASK 0x60000000 -#define PHY_BB_TXIQCAL_CONTROL_3_DESIRED_SIZE_DB_GET(x) (((x) & 0x60000000) >> 29) -#define PHY_BB_TXIQCAL_CONTROL_3_DESIRED_SIZE_DB_SET(x) (((x) << 29) & 0x60000000) -#define PHY_BB_TXIQCAL_CONTROL_3_TX_IQCORR_EN_MSB 31 -#define PHY_BB_TXIQCAL_CONTROL_3_TX_IQCORR_EN_LSB 31 -#define PHY_BB_TXIQCAL_CONTROL_3_TX_IQCORR_EN_MASK 0x80000000 -#define PHY_BB_TXIQCAL_CONTROL_3_TX_IQCORR_EN_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_BB_TXIQCAL_CONTROL_3_TX_IQCORR_EN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB_txiq_corr_coeff_01_b0 */ -#define PHY_BB_TXIQ_CORR_COEFF_01_B0_ADDRESS 0x0000a6ec -#define PHY_BB_TXIQ_CORR_COEFF_01_B0_OFFSET 0x0000a6ec -#define PHY_BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_0_0_MSB 13 -#define PHY_BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_0_0_LSB 0 -#define PHY_BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_0_0_MASK 0x00003fff -#define PHY_BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_0_0_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_0_0_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_1_0_MSB 27 -#define PHY_BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_1_0_LSB 14 -#define PHY_BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_1_0_MASK 0x0fffc000 -#define PHY_BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_1_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_1_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_txiq_corr_coeff_23_b0 */ -#define PHY_BB_TXIQ_CORR_COEFF_23_B0_ADDRESS 0x0000a6f0 -#define PHY_BB_TXIQ_CORR_COEFF_23_B0_OFFSET 0x0000a6f0 -#define PHY_BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_2_0_MSB 13 -#define PHY_BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_2_0_LSB 0 -#define PHY_BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_2_0_MASK 0x00003fff -#define PHY_BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_2_0_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_2_0_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_3_0_MSB 27 -#define PHY_BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_3_0_LSB 14 -#define PHY_BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_3_0_MASK 0x0fffc000 -#define PHY_BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_3_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_3_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_txiq_corr_coeff_45_b0 */ -#define PHY_BB_TXIQ_CORR_COEFF_45_B0_ADDRESS 0x0000a6f4 -#define PHY_BB_TXIQ_CORR_COEFF_45_B0_OFFSET 0x0000a6f4 -#define PHY_BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_4_0_MSB 13 -#define PHY_BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_4_0_LSB 0 -#define PHY_BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_4_0_MASK 0x00003fff -#define PHY_BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_4_0_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_4_0_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_5_0_MSB 27 -#define PHY_BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_5_0_LSB 14 -#define PHY_BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_5_0_MASK 0x0fffc000 -#define PHY_BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_5_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_5_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_txiq_corr_coeff_67_b0 */ -#define PHY_BB_TXIQ_CORR_COEFF_67_B0_ADDRESS 0x0000a6f8 -#define PHY_BB_TXIQ_CORR_COEFF_67_B0_OFFSET 0x0000a6f8 -#define PHY_BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_6_0_MSB 13 -#define PHY_BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_6_0_LSB 0 -#define PHY_BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_6_0_MASK 0x00003fff -#define PHY_BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_6_0_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_6_0_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_7_0_MSB 27 -#define PHY_BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_7_0_LSB 14 -#define PHY_BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_7_0_MASK 0x0fffc000 -#define PHY_BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_7_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_7_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_txiq_corr_coeff_89_b0 */ -#define PHY_BB_TXIQ_CORR_COEFF_89_B0_ADDRESS 0x0000a6fc -#define PHY_BB_TXIQ_CORR_COEFF_89_B0_OFFSET 0x0000a6fc -#define PHY_BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_8_0_MSB 13 -#define PHY_BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_8_0_LSB 0 -#define PHY_BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_8_0_MASK 0x00003fff -#define PHY_BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_8_0_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_8_0_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_9_0_MSB 27 -#define PHY_BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_9_0_LSB 14 -#define PHY_BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_9_0_MASK 0x0fffc000 -#define PHY_BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_9_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_9_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_txiq_corr_coeff_ab_b0 */ -#define PHY_BB_TXIQ_CORR_COEFF_AB_B0_ADDRESS 0x0000a700 -#define PHY_BB_TXIQ_CORR_COEFF_AB_B0_OFFSET 0x0000a700 -#define PHY_BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_A_0_MSB 13 -#define PHY_BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_A_0_LSB 0 -#define PHY_BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_A_0_MASK 0x00003fff -#define PHY_BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_A_0_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_A_0_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_B_0_MSB 27 -#define PHY_BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_B_0_LSB 14 -#define PHY_BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_B_0_MASK 0x0fffc000 -#define PHY_BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_B_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_B_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_txiq_corr_coeff_cd_b0 */ -#define PHY_BB_TXIQ_CORR_COEFF_CD_B0_ADDRESS 0x0000a704 -#define PHY_BB_TXIQ_CORR_COEFF_CD_B0_OFFSET 0x0000a704 -#define PHY_BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_C_0_MSB 13 -#define PHY_BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_C_0_LSB 0 -#define PHY_BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_C_0_MASK 0x00003fff -#define PHY_BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_C_0_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_C_0_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_D_0_MSB 27 -#define PHY_BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_D_0_LSB 14 -#define PHY_BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_D_0_MASK 0x0fffc000 -#define PHY_BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_D_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_D_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_txiq_corr_coeff_ef_b0 */ -#define PHY_BB_TXIQ_CORR_COEFF_EF_B0_ADDRESS 0x0000a708 -#define PHY_BB_TXIQ_CORR_COEFF_EF_B0_OFFSET 0x0000a708 -#define PHY_BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_E_0_MSB 13 -#define PHY_BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_E_0_LSB 0 -#define PHY_BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_E_0_MASK 0x00003fff -#define PHY_BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_E_0_GET(x) (((x) & 0x00003fff) >> 0) -#define PHY_BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_E_0_SET(x) (((x) << 0) & 0x00003fff) -#define PHY_BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_F_0_MSB 27 -#define PHY_BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_F_0_LSB 14 -#define PHY_BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_F_0_MASK 0x0fffc000 -#define PHY_BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_F_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define PHY_BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_F_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for BB_cal_rxbb_gain_tbl_0 */ -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_ADDRESS 0x0000a70c -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_OFFSET 0x0000a70c -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_0_MSB 5 -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_0_LSB 0 -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_0_MASK 0x0000003f -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_0_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_0_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_1_MSB 11 -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_1_LSB 6 -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_1_MASK 0x00000fc0 -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_1_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_1_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_2_MSB 17 -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_2_LSB 12 -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_2_MASK 0x0003f000 -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_2_GET(x) (((x) & 0x0003f000) >> 12) -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_2_SET(x) (((x) << 12) & 0x0003f000) -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_3_MSB 23 -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_3_LSB 18 -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_3_MASK 0x00fc0000 -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_3_GET(x) (((x) & 0x00fc0000) >> 18) -#define PHY_BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_3_SET(x) (((x) << 18) & 0x00fc0000) - -/* macros for BB_cal_rxbb_gain_tbl_4 */ -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_ADDRESS 0x0000a710 -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_OFFSET 0x0000a710 -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_4_MSB 5 -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_4_LSB 0 -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_4_MASK 0x0000003f -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_4_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_4_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_5_MSB 11 -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_5_LSB 6 -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_5_MASK 0x00000fc0 -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_5_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_5_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_6_MSB 17 -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_6_LSB 12 -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_6_MASK 0x0003f000 -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_6_GET(x) (((x) & 0x0003f000) >> 12) -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_6_SET(x) (((x) << 12) & 0x0003f000) -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_7_MSB 23 -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_7_LSB 18 -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_7_MASK 0x00fc0000 -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_7_GET(x) (((x) & 0x00fc0000) >> 18) -#define PHY_BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_7_SET(x) (((x) << 18) & 0x00fc0000) - -/* macros for BB_cal_rxbb_gain_tbl_8 */ -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_ADDRESS 0x0000a714 -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_OFFSET 0x0000a714 -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_8_MSB 5 -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_8_LSB 0 -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_8_MASK 0x0000003f -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_8_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_8_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_9_MSB 11 -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_9_LSB 6 -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_9_MASK 0x00000fc0 -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_9_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_9_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_10_MSB 17 -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_10_LSB 12 -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_10_MASK 0x0003f000 -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_10_GET(x) (((x) & 0x0003f000) >> 12) -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_10_SET(x) (((x) << 12) & 0x0003f000) -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_11_MSB 23 -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_11_LSB 18 -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_11_MASK 0x00fc0000 -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_11_GET(x) (((x) & 0x00fc0000) >> 18) -#define PHY_BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_11_SET(x) (((x) << 18) & 0x00fc0000) - -/* macros for BB_cal_rxbb_gain_tbl_12 */ -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_ADDRESS 0x0000a718 -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_OFFSET 0x0000a718 -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_12_MSB 5 -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_12_LSB 0 -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_12_MASK 0x0000003f -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_12_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_12_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_13_MSB 11 -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_13_LSB 6 -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_13_MASK 0x00000fc0 -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_13_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_13_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_14_MSB 17 -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_14_LSB 12 -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_14_MASK 0x0003f000 -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_14_GET(x) (((x) & 0x0003f000) >> 12) -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_14_SET(x) (((x) << 12) & 0x0003f000) -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_15_MSB 23 -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_15_LSB 18 -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_15_MASK 0x00fc0000 -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_15_GET(x) (((x) & 0x00fc0000) >> 18) -#define PHY_BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_15_SET(x) (((x) << 18) & 0x00fc0000) - -/* macros for BB_cal_rxbb_gain_tbl_16 */ -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_ADDRESS 0x0000a71c -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_OFFSET 0x0000a71c -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_16_MSB 5 -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_16_LSB 0 -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_16_MASK 0x0000003f -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_16_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_16_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_17_MSB 11 -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_17_LSB 6 -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_17_MASK 0x00000fc0 -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_17_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_17_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_18_MSB 17 -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_18_LSB 12 -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_18_MASK 0x0003f000 -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_18_GET(x) (((x) & 0x0003f000) >> 12) -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_18_SET(x) (((x) << 12) & 0x0003f000) -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_19_MSB 23 -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_19_LSB 18 -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_19_MASK 0x00fc0000 -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_19_GET(x) (((x) & 0x00fc0000) >> 18) -#define PHY_BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_19_SET(x) (((x) << 18) & 0x00fc0000) - -/* macros for BB_cal_rxbb_gain_tbl_20 */ -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_ADDRESS 0x0000a720 -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_OFFSET 0x0000a720 -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_20_MSB 5 -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_20_LSB 0 -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_20_MASK 0x0000003f -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_20_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_20_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_21_MSB 11 -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_21_LSB 6 -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_21_MASK 0x00000fc0 -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_21_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_21_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_22_MSB 17 -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_22_LSB 12 -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_22_MASK 0x0003f000 -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_22_GET(x) (((x) & 0x0003f000) >> 12) -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_22_SET(x) (((x) << 12) & 0x0003f000) -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_23_MSB 23 -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_23_LSB 18 -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_23_MASK 0x00fc0000 -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_23_GET(x) (((x) & 0x00fc0000) >> 18) -#define PHY_BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_23_SET(x) (((x) << 18) & 0x00fc0000) - -/* macros for BB_cal_rxbb_gain_tbl_24 */ -#define PHY_BB_CAL_RXBB_GAIN_TBL_24_ADDRESS 0x0000a724 -#define PHY_BB_CAL_RXBB_GAIN_TBL_24_OFFSET 0x0000a724 -#define PHY_BB_CAL_RXBB_GAIN_TBL_24_TXCAL_RX_BB_GAIN_TABLE_24_MSB 5 -#define PHY_BB_CAL_RXBB_GAIN_TBL_24_TXCAL_RX_BB_GAIN_TABLE_24_LSB 0 -#define PHY_BB_CAL_RXBB_GAIN_TBL_24_TXCAL_RX_BB_GAIN_TABLE_24_MASK 0x0000003f -#define PHY_BB_CAL_RXBB_GAIN_TBL_24_TXCAL_RX_BB_GAIN_TABLE_24_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_CAL_RXBB_GAIN_TBL_24_TXCAL_RX_BB_GAIN_TABLE_24_SET(x) (((x) << 0) & 0x0000003f) - -/* macros for BB_txiqcal_status_b0 */ -#define PHY_BB_TXIQCAL_STATUS_B0_ADDRESS 0x0000a728 -#define PHY_BB_TXIQCAL_STATUS_B0_OFFSET 0x0000a728 -#define PHY_BB_TXIQCAL_STATUS_B0_TXIQCAL_FAILED_0_MSB 0 -#define PHY_BB_TXIQCAL_STATUS_B0_TXIQCAL_FAILED_0_LSB 0 -#define PHY_BB_TXIQCAL_STATUS_B0_TXIQCAL_FAILED_0_MASK 0x00000001 -#define PHY_BB_TXIQCAL_STATUS_B0_TXIQCAL_FAILED_0_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_TXIQCAL_STATUS_B0_CALIBRATED_GAINS_0_MSB 5 -#define PHY_BB_TXIQCAL_STATUS_B0_CALIBRATED_GAINS_0_LSB 1 -#define PHY_BB_TXIQCAL_STATUS_B0_CALIBRATED_GAINS_0_MASK 0x0000003e -#define PHY_BB_TXIQCAL_STATUS_B0_CALIBRATED_GAINS_0_GET(x) (((x) & 0x0000003e) >> 1) -#define PHY_BB_TXIQCAL_STATUS_B0_TONE_GAIN_USED_0_MSB 11 -#define PHY_BB_TXIQCAL_STATUS_B0_TONE_GAIN_USED_0_LSB 6 -#define PHY_BB_TXIQCAL_STATUS_B0_TONE_GAIN_USED_0_MASK 0x00000fc0 -#define PHY_BB_TXIQCAL_STATUS_B0_TONE_GAIN_USED_0_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_TXIQCAL_STATUS_B0_RX_GAIN_USED_0_MSB 17 -#define PHY_BB_TXIQCAL_STATUS_B0_RX_GAIN_USED_0_LSB 12 -#define PHY_BB_TXIQCAL_STATUS_B0_RX_GAIN_USED_0_MASK 0x0003f000 -#define PHY_BB_TXIQCAL_STATUS_B0_RX_GAIN_USED_0_GET(x) (((x) & 0x0003f000) >> 12) -#define PHY_BB_TXIQCAL_STATUS_B0_LAST_MEAS_ADDR_0_MSB 24 -#define PHY_BB_TXIQCAL_STATUS_B0_LAST_MEAS_ADDR_0_LSB 18 -#define PHY_BB_TXIQCAL_STATUS_B0_LAST_MEAS_ADDR_0_MASK 0x01fc0000 -#define PHY_BB_TXIQCAL_STATUS_B0_LAST_MEAS_ADDR_0_GET(x) (((x) & 0x01fc0000) >> 18) - -/* macros for BB_paprd_trainer_cntl1 */ -#define PHY_BB_PAPRD_TRAINER_CNTL1_ADDRESS 0x0000a72c -#define PHY_BB_PAPRD_TRAINER_CNTL1_OFFSET 0x0000a72c -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TRAIN_ENABLE_MSB 0 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TRAIN_ENABLE_LSB 0 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TRAIN_ENABLE_MASK 0x00000001 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TRAIN_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TRAIN_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING_MSB 7 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING_LSB 1 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING_MASK 0x000000fe -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING_GET(x) (((x) & 0x000000fe) >> 1) -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING_SET(x) (((x) << 1) & 0x000000fe) -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_IQCORR_ENABLE_MSB 8 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_IQCORR_ENABLE_LSB 8 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_IQCORR_ENABLE_MASK 0x00000100 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_IQCORR_ENABLE_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_IQCORR_ENABLE_SET(x) (((x) << 8) & 0x00000100) -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_RX_BB_GAIN_FORCE_MSB 9 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_RX_BB_GAIN_FORCE_LSB 9 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_RX_BB_GAIN_FORCE_MASK 0x00000200 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_RX_BB_GAIN_FORCE_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_RX_BB_GAIN_FORCE_SET(x) (((x) << 9) & 0x00000200) -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TX_GAIN_FORCE_MSB 10 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TX_GAIN_FORCE_LSB 10 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TX_GAIN_FORCE_MASK 0x00000400 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TX_GAIN_FORCE_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TX_GAIN_FORCE_SET(x) (((x) << 10) & 0x00000400) -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_ENABLE_MSB 11 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_ENABLE_LSB 11 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_ENABLE_MASK 0x00000800 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_ENABLE_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_ENABLE_SET(x) (((x) << 11) & 0x00000800) -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP_MSB 18 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP_LSB 12 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP_MASK 0x0007f000 -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP_GET(x) (((x) & 0x0007f000) >> 12) -#define PHY_BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP_SET(x) (((x) << 12) & 0x0007f000) - -/* macros for BB_paprd_trainer_cntl2 */ -#define PHY_BB_PAPRD_TRAINER_CNTL2_ADDRESS 0x0000a730 -#define PHY_BB_PAPRD_TRAINER_CNTL2_OFFSET 0x0000a730 -#define PHY_BB_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN_MSB 31 -#define PHY_BB_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN_LSB 0 -#define PHY_BB_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN_MASK 0xffffffff -#define PHY_BB_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_BB_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_paprd_trainer_cntl3 */ -#define PHY_BB_PAPRD_TRAINER_CNTL3_ADDRESS 0x0000a734 -#define PHY_BB_PAPRD_TRAINER_CNTL3_OFFSET 0x0000a734 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE_MSB 5 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE_LSB 0 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE_MASK 0x0000003f -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP_MSB 11 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP_LSB 6 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP_MASK 0x00000fc0 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_MIN_LOOPBACK_DEL_MSB 16 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_MIN_LOOPBACK_DEL_LSB 12 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_MIN_LOOPBACK_DEL_MASK 0x0001f000 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_MIN_LOOPBACK_DEL_GET(x) (((x) & 0x0001f000) >> 12) -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_MIN_LOOPBACK_DEL_SET(x) (((x) << 12) & 0x0001f000) -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_NUM_CORR_STAGES_MSB 19 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_NUM_CORR_STAGES_LSB 17 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_NUM_CORR_STAGES_MASK 0x000e0000 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_NUM_CORR_STAGES_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_NUM_CORR_STAGES_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_COARSE_CORR_LEN_MSB 23 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_COARSE_CORR_LEN_LSB 20 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_COARSE_CORR_LEN_MASK 0x00f00000 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_COARSE_CORR_LEN_GET(x) (((x) & 0x00f00000) >> 20) -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_COARSE_CORR_LEN_SET(x) (((x) << 20) & 0x00f00000) -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_FINE_CORR_LEN_MSB 27 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_FINE_CORR_LEN_LSB 24 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_FINE_CORR_LEN_MASK 0x0f000000 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_FINE_CORR_LEN_GET(x) (((x) & 0x0f000000) >> 24) -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_FINE_CORR_LEN_SET(x) (((x) << 24) & 0x0f000000) -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE_MSB 28 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE_LSB 28 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE_MASK 0x10000000 -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE_SET(x) (((x) << 28) & 0x10000000) - -/* macros for BB_paprd_trainer_cntl4 */ -#define PHY_BB_PAPRD_TRAINER_CNTL4_ADDRESS 0x0000a738 -#define PHY_BB_PAPRD_TRAINER_CNTL4_OFFSET 0x0000a738 -#define PHY_BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_MIN_CORR_MSB 11 -#define PHY_BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_MIN_CORR_LSB 0 -#define PHY_BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_MIN_CORR_MASK 0x00000fff -#define PHY_BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_MIN_CORR_GET(x) (((x) & 0x00000fff) >> 0) -#define PHY_BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_MIN_CORR_SET(x) (((x) << 0) & 0x00000fff) -#define PHY_BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_SAFETY_DELTA_MSB 15 -#define PHY_BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_SAFETY_DELTA_LSB 12 -#define PHY_BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_SAFETY_DELTA_MASK 0x0000f000 -#define PHY_BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_SAFETY_DELTA_GET(x) (((x) & 0x0000f000) >> 12) -#define PHY_BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_SAFETY_DELTA_SET(x) (((x) << 12) & 0x0000f000) -#define PHY_BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES_MSB 25 -#define PHY_BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES_LSB 16 -#define PHY_BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES_MASK 0x03ff0000 -#define PHY_BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES_GET(x) (((x) & 0x03ff0000) >> 16) -#define PHY_BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES_SET(x) (((x) << 16) & 0x03ff0000) - -/* macros for BB_paprd_trainer_stat1 */ -#define PHY_BB_PAPRD_TRAINER_STAT1_ADDRESS 0x0000a73c -#define PHY_BB_PAPRD_TRAINER_STAT1_OFFSET 0x0000a73c -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE_MSB 0 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE_LSB 0 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE_MASK 0x00000001 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_INCOMPLETE_MSB 1 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_INCOMPLETE_LSB 1 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_INCOMPLETE_MASK 0x00000002 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_INCOMPLETE_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_CORR_ERR_MSB 2 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_CORR_ERR_LSB 2 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_CORR_ERR_MASK 0x00000004 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_CORR_ERR_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_ACTIVE_MSB 3 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_ACTIVE_LSB 3 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_ACTIVE_MASK 0x00000008 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_ACTIVE_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_RX_GAIN_IDX_MSB 8 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_RX_GAIN_IDX_LSB 4 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_RX_GAIN_IDX_MASK 0x000001f0 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_RX_GAIN_IDX_GET(x) (((x) & 0x000001f0) >> 4) -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_AGC2_PWR_MSB 16 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_AGC2_PWR_LSB 9 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_AGC2_PWR_MASK 0x0001fe00 -#define PHY_BB_PAPRD_TRAINER_STAT1_PAPRD_AGC2_PWR_GET(x) (((x) & 0x0001fe00) >> 9) - -/* macros for BB_paprd_trainer_stat2 */ -#define PHY_BB_PAPRD_TRAINER_STAT2_ADDRESS 0x0000a740 -#define PHY_BB_PAPRD_TRAINER_STAT2_OFFSET 0x0000a740 -#define PHY_BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_VAL_MSB 15 -#define PHY_BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_VAL_LSB 0 -#define PHY_BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_VAL_MASK 0x0000ffff -#define PHY_BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_VAL_GET(x) (((x) & 0x0000ffff) >> 0) -#define PHY_BB_PAPRD_TRAINER_STAT2_PAPRD_COARSE_IDX_MSB 20 -#define PHY_BB_PAPRD_TRAINER_STAT2_PAPRD_COARSE_IDX_LSB 16 -#define PHY_BB_PAPRD_TRAINER_STAT2_PAPRD_COARSE_IDX_MASK 0x001f0000 -#define PHY_BB_PAPRD_TRAINER_STAT2_PAPRD_COARSE_IDX_GET(x) (((x) & 0x001f0000) >> 16) -#define PHY_BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_IDX_MSB 22 -#define PHY_BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_IDX_LSB 21 -#define PHY_BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_IDX_MASK 0x00600000 -#define PHY_BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_IDX_GET(x) (((x) & 0x00600000) >> 21) - -/* macros for BB_paprd_trainer_stat3 */ -#define PHY_BB_PAPRD_TRAINER_STAT3_ADDRESS 0x0000a744 -#define PHY_BB_PAPRD_TRAINER_STAT3_OFFSET 0x0000a744 -#define PHY_BB_PAPRD_TRAINER_STAT3_PAPRD_TRAIN_SAMPLES_CNT_MSB 19 -#define PHY_BB_PAPRD_TRAINER_STAT3_PAPRD_TRAIN_SAMPLES_CNT_LSB 0 -#define PHY_BB_PAPRD_TRAINER_STAT3_PAPRD_TRAIN_SAMPLES_CNT_MASK 0x000fffff -#define PHY_BB_PAPRD_TRAINER_STAT3_PAPRD_TRAIN_SAMPLES_CNT_GET(x) (((x) & 0x000fffff) >> 0) - -/* macros for BB_fcal_1 */ -#define PHY_BB_FCAL_1_ADDRESS 0x0000a7d8 -#define PHY_BB_FCAL_1_OFFSET 0x0000a7d8 -#define PHY_BB_FCAL_1_FLC_PB_FSTEP_MSB 9 -#define PHY_BB_FCAL_1_FLC_PB_FSTEP_LSB 0 -#define PHY_BB_FCAL_1_FLC_PB_FSTEP_MASK 0x000003ff -#define PHY_BB_FCAL_1_FLC_PB_FSTEP_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_BB_FCAL_1_FLC_PB_FSTEP_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_BB_FCAL_1_FLC_SB_FSTEP_MSB 19 -#define PHY_BB_FCAL_1_FLC_SB_FSTEP_LSB 10 -#define PHY_BB_FCAL_1_FLC_SB_FSTEP_MASK 0x000ffc00 -#define PHY_BB_FCAL_1_FLC_SB_FSTEP_GET(x) (((x) & 0x000ffc00) >> 10) -#define PHY_BB_FCAL_1_FLC_SB_FSTEP_SET(x) (((x) << 10) & 0x000ffc00) -#define PHY_BB_FCAL_1_FLC_PB_ATTEN_MSB 24 -#define PHY_BB_FCAL_1_FLC_PB_ATTEN_LSB 20 -#define PHY_BB_FCAL_1_FLC_PB_ATTEN_MASK 0x01f00000 -#define PHY_BB_FCAL_1_FLC_PB_ATTEN_GET(x) (((x) & 0x01f00000) >> 20) -#define PHY_BB_FCAL_1_FLC_PB_ATTEN_SET(x) (((x) << 20) & 0x01f00000) -#define PHY_BB_FCAL_1_FLC_SB_ATTEN_MSB 29 -#define PHY_BB_FCAL_1_FLC_SB_ATTEN_LSB 25 -#define PHY_BB_FCAL_1_FLC_SB_ATTEN_MASK 0x3e000000 -#define PHY_BB_FCAL_1_FLC_SB_ATTEN_GET(x) (((x) & 0x3e000000) >> 25) -#define PHY_BB_FCAL_1_FLC_SB_ATTEN_SET(x) (((x) << 25) & 0x3e000000) - -/* macros for BB_fcal_2_b0 */ -#define PHY_BB_FCAL_2_B0_ADDRESS 0x0000a7dc -#define PHY_BB_FCAL_2_B0_OFFSET 0x0000a7dc -#define PHY_BB_FCAL_2_B0_FLC_PWR_THRESH_MSB 2 -#define PHY_BB_FCAL_2_B0_FLC_PWR_THRESH_LSB 0 -#define PHY_BB_FCAL_2_B0_FLC_PWR_THRESH_MASK 0x00000007 -#define PHY_BB_FCAL_2_B0_FLC_PWR_THRESH_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_BB_FCAL_2_B0_FLC_PWR_THRESH_SET(x) (((x) << 0) & 0x00000007) -#define PHY_BB_FCAL_2_B0_FLC_SW_CAP_VAL_0_MSB 7 -#define PHY_BB_FCAL_2_B0_FLC_SW_CAP_VAL_0_LSB 3 -#define PHY_BB_FCAL_2_B0_FLC_SW_CAP_VAL_0_MASK 0x000000f8 -#define PHY_BB_FCAL_2_B0_FLC_SW_CAP_VAL_0_GET(x) (((x) & 0x000000f8) >> 3) -#define PHY_BB_FCAL_2_B0_FLC_SW_CAP_VAL_0_SET(x) (((x) << 3) & 0x000000f8) -#define PHY_BB_FCAL_2_B0_FLC_BBMISCGAIN_MSB 9 -#define PHY_BB_FCAL_2_B0_FLC_BBMISCGAIN_LSB 8 -#define PHY_BB_FCAL_2_B0_FLC_BBMISCGAIN_MASK 0x00000300 -#define PHY_BB_FCAL_2_B0_FLC_BBMISCGAIN_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_BB_FCAL_2_B0_FLC_BBMISCGAIN_SET(x) (((x) << 8) & 0x00000300) -#define PHY_BB_FCAL_2_B0_FLC_BB1DBGAIN_MSB 12 -#define PHY_BB_FCAL_2_B0_FLC_BB1DBGAIN_LSB 10 -#define PHY_BB_FCAL_2_B0_FLC_BB1DBGAIN_MASK 0x00001c00 -#define PHY_BB_FCAL_2_B0_FLC_BB1DBGAIN_GET(x) (((x) & 0x00001c00) >> 10) -#define PHY_BB_FCAL_2_B0_FLC_BB1DBGAIN_SET(x) (((x) << 10) & 0x00001c00) -#define PHY_BB_FCAL_2_B0_FLC_BB6DBGAIN_MSB 14 -#define PHY_BB_FCAL_2_B0_FLC_BB6DBGAIN_LSB 13 -#define PHY_BB_FCAL_2_B0_FLC_BB6DBGAIN_MASK 0x00006000 -#define PHY_BB_FCAL_2_B0_FLC_BB6DBGAIN_GET(x) (((x) & 0x00006000) >> 13) -#define PHY_BB_FCAL_2_B0_FLC_BB6DBGAIN_SET(x) (((x) << 13) & 0x00006000) -#define PHY_BB_FCAL_2_B0_FLC_SW_CAP_SET_MSB 15 -#define PHY_BB_FCAL_2_B0_FLC_SW_CAP_SET_LSB 15 -#define PHY_BB_FCAL_2_B0_FLC_SW_CAP_SET_MASK 0x00008000 -#define PHY_BB_FCAL_2_B0_FLC_SW_CAP_SET_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_BB_FCAL_2_B0_FLC_SW_CAP_SET_SET(x) (((x) << 15) & 0x00008000) -#define PHY_BB_FCAL_2_B0_FLC_MEAS_WIN_MSB 18 -#define PHY_BB_FCAL_2_B0_FLC_MEAS_WIN_LSB 16 -#define PHY_BB_FCAL_2_B0_FLC_MEAS_WIN_MASK 0x00070000 -#define PHY_BB_FCAL_2_B0_FLC_MEAS_WIN_GET(x) (((x) & 0x00070000) >> 16) -#define PHY_BB_FCAL_2_B0_FLC_MEAS_WIN_SET(x) (((x) << 16) & 0x00070000) -#define PHY_BB_FCAL_2_B0_FLC_CAP_VAL_STATUS_0_MSB 24 -#define PHY_BB_FCAL_2_B0_FLC_CAP_VAL_STATUS_0_LSB 20 -#define PHY_BB_FCAL_2_B0_FLC_CAP_VAL_STATUS_0_MASK 0x01f00000 -#define PHY_BB_FCAL_2_B0_FLC_CAP_VAL_STATUS_0_GET(x) (((x) & 0x01f00000) >> 20) - -/* macros for BB_radar_bw_filter */ -#define PHY_BB_RADAR_BW_FILTER_ADDRESS 0x0000a7e0 -#define PHY_BB_RADAR_BW_FILTER_OFFSET 0x0000a7e0 -#define PHY_BB_RADAR_BW_FILTER_RADAR_AVG_BW_CHECK_MSB 0 -#define PHY_BB_RADAR_BW_FILTER_RADAR_AVG_BW_CHECK_LSB 0 -#define PHY_BB_RADAR_BW_FILTER_RADAR_AVG_BW_CHECK_MASK 0x00000001 -#define PHY_BB_RADAR_BW_FILTER_RADAR_AVG_BW_CHECK_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_RADAR_BW_FILTER_RADAR_AVG_BW_CHECK_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_RADAR_BW_FILTER_RADAR_DC_SRC_SEL_MSB 1 -#define PHY_BB_RADAR_BW_FILTER_RADAR_DC_SRC_SEL_LSB 1 -#define PHY_BB_RADAR_BW_FILTER_RADAR_DC_SRC_SEL_MASK 0x00000002 -#define PHY_BB_RADAR_BW_FILTER_RADAR_DC_SRC_SEL_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_BB_RADAR_BW_FILTER_RADAR_DC_SRC_SEL_SET(x) (((x) << 1) & 0x00000002) -#define PHY_BB_RADAR_BW_FILTER_RADAR_FIRPWR_SEL_MSB 3 -#define PHY_BB_RADAR_BW_FILTER_RADAR_FIRPWR_SEL_LSB 2 -#define PHY_BB_RADAR_BW_FILTER_RADAR_FIRPWR_SEL_MASK 0x0000000c -#define PHY_BB_RADAR_BW_FILTER_RADAR_FIRPWR_SEL_GET(x) (((x) & 0x0000000c) >> 2) -#define PHY_BB_RADAR_BW_FILTER_RADAR_FIRPWR_SEL_SET(x) (((x) << 2) & 0x0000000c) -#define PHY_BB_RADAR_BW_FILTER_RADAR_PULSE_WIDTH_SEL_MSB 5 -#define PHY_BB_RADAR_BW_FILTER_RADAR_PULSE_WIDTH_SEL_LSB 4 -#define PHY_BB_RADAR_BW_FILTER_RADAR_PULSE_WIDTH_SEL_MASK 0x00000030 -#define PHY_BB_RADAR_BW_FILTER_RADAR_PULSE_WIDTH_SEL_GET(x) (((x) & 0x00000030) >> 4) -#define PHY_BB_RADAR_BW_FILTER_RADAR_PULSE_WIDTH_SEL_SET(x) (((x) << 4) & 0x00000030) -#define PHY_BB_RADAR_BW_FILTER_RADAR_DC_FIRPWR_THRESH_MSB 14 -#define PHY_BB_RADAR_BW_FILTER_RADAR_DC_FIRPWR_THRESH_LSB 8 -#define PHY_BB_RADAR_BW_FILTER_RADAR_DC_FIRPWR_THRESH_MASK 0x00007f00 -#define PHY_BB_RADAR_BW_FILTER_RADAR_DC_FIRPWR_THRESH_GET(x) (((x) & 0x00007f00) >> 8) -#define PHY_BB_RADAR_BW_FILTER_RADAR_DC_FIRPWR_THRESH_SET(x) (((x) << 8) & 0x00007f00) -#define PHY_BB_RADAR_BW_FILTER_RADAR_DC_PWR_BIAS_MSB 20 -#define PHY_BB_RADAR_BW_FILTER_RADAR_DC_PWR_BIAS_LSB 15 -#define PHY_BB_RADAR_BW_FILTER_RADAR_DC_PWR_BIAS_MASK 0x001f8000 -#define PHY_BB_RADAR_BW_FILTER_RADAR_DC_PWR_BIAS_GET(x) (((x) & 0x001f8000) >> 15) -#define PHY_BB_RADAR_BW_FILTER_RADAR_DC_PWR_BIAS_SET(x) (((x) << 15) & 0x001f8000) -#define PHY_BB_RADAR_BW_FILTER_RADAR_BIN_MAX_BW_MSB 26 -#define PHY_BB_RADAR_BW_FILTER_RADAR_BIN_MAX_BW_LSB 21 -#define PHY_BB_RADAR_BW_FILTER_RADAR_BIN_MAX_BW_MASK 0x07e00000 -#define PHY_BB_RADAR_BW_FILTER_RADAR_BIN_MAX_BW_GET(x) (((x) & 0x07e00000) >> 21) -#define PHY_BB_RADAR_BW_FILTER_RADAR_BIN_MAX_BW_SET(x) (((x) << 21) & 0x07e00000) - -/* macros for BB_dft_tone_ctrl_b0 */ -#define PHY_BB_DFT_TONE_CTRL_B0_ADDRESS 0x0000a7e4 -#define PHY_BB_DFT_TONE_CTRL_B0_OFFSET 0x0000a7e4 -#define PHY_BB_DFT_TONE_CTRL_B0_DFT_TONE_EN_0_MSB 0 -#define PHY_BB_DFT_TONE_CTRL_B0_DFT_TONE_EN_0_LSB 0 -#define PHY_BB_DFT_TONE_CTRL_B0_DFT_TONE_EN_0_MASK 0x00000001 -#define PHY_BB_DFT_TONE_CTRL_B0_DFT_TONE_EN_0_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_DFT_TONE_CTRL_B0_DFT_TONE_EN_0_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_DFT_TONE_CTRL_B0_DFT_TONE_AMP_SEL_0_MSB 3 -#define PHY_BB_DFT_TONE_CTRL_B0_DFT_TONE_AMP_SEL_0_LSB 2 -#define PHY_BB_DFT_TONE_CTRL_B0_DFT_TONE_AMP_SEL_0_MASK 0x0000000c -#define PHY_BB_DFT_TONE_CTRL_B0_DFT_TONE_AMP_SEL_0_GET(x) (((x) & 0x0000000c) >> 2) -#define PHY_BB_DFT_TONE_CTRL_B0_DFT_TONE_AMP_SEL_0_SET(x) (((x) << 2) & 0x0000000c) -#define PHY_BB_DFT_TONE_CTRL_B0_DFT_TONE_FREQ_ANG_0_MSB 12 -#define PHY_BB_DFT_TONE_CTRL_B0_DFT_TONE_FREQ_ANG_0_LSB 4 -#define PHY_BB_DFT_TONE_CTRL_B0_DFT_TONE_FREQ_ANG_0_MASK 0x00001ff0 -#define PHY_BB_DFT_TONE_CTRL_B0_DFT_TONE_FREQ_ANG_0_GET(x) (((x) & 0x00001ff0) >> 4) -#define PHY_BB_DFT_TONE_CTRL_B0_DFT_TONE_FREQ_ANG_0_SET(x) (((x) << 4) & 0x00001ff0) - -/* macros for BB_therm_adc_1 */ -#define PHY_BB_THERM_ADC_1_ADDRESS 0x0000a7e8 -#define PHY_BB_THERM_ADC_1_OFFSET 0x0000a7e8 -#define PHY_BB_THERM_ADC_1_INIT_THERM_SETTING_MSB 7 -#define PHY_BB_THERM_ADC_1_INIT_THERM_SETTING_LSB 0 -#define PHY_BB_THERM_ADC_1_INIT_THERM_SETTING_MASK 0x000000ff -#define PHY_BB_THERM_ADC_1_INIT_THERM_SETTING_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_THERM_ADC_1_INIT_THERM_SETTING_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_THERM_ADC_1_INIT_VOLT_SETTING_MSB 15 -#define PHY_BB_THERM_ADC_1_INIT_VOLT_SETTING_LSB 8 -#define PHY_BB_THERM_ADC_1_INIT_VOLT_SETTING_MASK 0x0000ff00 -#define PHY_BB_THERM_ADC_1_INIT_VOLT_SETTING_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_THERM_ADC_1_INIT_VOLT_SETTING_SET(x) (((x) << 8) & 0x0000ff00) -#define PHY_BB_THERM_ADC_1_INIT_ATB_SETTING_MSB 23 -#define PHY_BB_THERM_ADC_1_INIT_ATB_SETTING_LSB 16 -#define PHY_BB_THERM_ADC_1_INIT_ATB_SETTING_MASK 0x00ff0000 -#define PHY_BB_THERM_ADC_1_INIT_ATB_SETTING_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_BB_THERM_ADC_1_INIT_ATB_SETTING_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_BB_THERM_ADC_1_SAMPLES_CNT_CODING_MSB 25 -#define PHY_BB_THERM_ADC_1_SAMPLES_CNT_CODING_LSB 24 -#define PHY_BB_THERM_ADC_1_SAMPLES_CNT_CODING_MASK 0x03000000 -#define PHY_BB_THERM_ADC_1_SAMPLES_CNT_CODING_GET(x) (((x) & 0x03000000) >> 24) -#define PHY_BB_THERM_ADC_1_SAMPLES_CNT_CODING_SET(x) (((x) << 24) & 0x03000000) -#define PHY_BB_THERM_ADC_1_USE_INIT_THERM_VOLT_ATB_AFTER_WARM_RESET_MSB 26 -#define PHY_BB_THERM_ADC_1_USE_INIT_THERM_VOLT_ATB_AFTER_WARM_RESET_LSB 26 -#define PHY_BB_THERM_ADC_1_USE_INIT_THERM_VOLT_ATB_AFTER_WARM_RESET_MASK 0x04000000 -#define PHY_BB_THERM_ADC_1_USE_INIT_THERM_VOLT_ATB_AFTER_WARM_RESET_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_BB_THERM_ADC_1_USE_INIT_THERM_VOLT_ATB_AFTER_WARM_RESET_SET(x) (((x) << 26) & 0x04000000) -#define PHY_BB_THERM_ADC_1_FORCE_THERM_VOLT_ATB_TO_INIT_SETTINGS_MSB 27 -#define PHY_BB_THERM_ADC_1_FORCE_THERM_VOLT_ATB_TO_INIT_SETTINGS_LSB 27 -#define PHY_BB_THERM_ADC_1_FORCE_THERM_VOLT_ATB_TO_INIT_SETTINGS_MASK 0x08000000 -#define PHY_BB_THERM_ADC_1_FORCE_THERM_VOLT_ATB_TO_INIT_SETTINGS_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_BB_THERM_ADC_1_FORCE_THERM_VOLT_ATB_TO_INIT_SETTINGS_SET(x) (((x) << 27) & 0x08000000) - -/* macros for BB_therm_adc_2 */ -#define PHY_BB_THERM_ADC_2_ADDRESS 0x0000a7ec -#define PHY_BB_THERM_ADC_2_OFFSET 0x0000a7ec -#define PHY_BB_THERM_ADC_2_MEASURE_THERM_FREQ_MSB 11 -#define PHY_BB_THERM_ADC_2_MEASURE_THERM_FREQ_LSB 0 -#define PHY_BB_THERM_ADC_2_MEASURE_THERM_FREQ_MASK 0x00000fff -#define PHY_BB_THERM_ADC_2_MEASURE_THERM_FREQ_GET(x) (((x) & 0x00000fff) >> 0) -#define PHY_BB_THERM_ADC_2_MEASURE_THERM_FREQ_SET(x) (((x) << 0) & 0x00000fff) -#define PHY_BB_THERM_ADC_2_MEASURE_VOLT_FREQ_MSB 21 -#define PHY_BB_THERM_ADC_2_MEASURE_VOLT_FREQ_LSB 12 -#define PHY_BB_THERM_ADC_2_MEASURE_VOLT_FREQ_MASK 0x003ff000 -#define PHY_BB_THERM_ADC_2_MEASURE_VOLT_FREQ_GET(x) (((x) & 0x003ff000) >> 12) -#define PHY_BB_THERM_ADC_2_MEASURE_VOLT_FREQ_SET(x) (((x) << 12) & 0x003ff000) -#define PHY_BB_THERM_ADC_2_MEASURE_ATB_FREQ_MSB 31 -#define PHY_BB_THERM_ADC_2_MEASURE_ATB_FREQ_LSB 22 -#define PHY_BB_THERM_ADC_2_MEASURE_ATB_FREQ_MASK 0xffc00000 -#define PHY_BB_THERM_ADC_2_MEASURE_ATB_FREQ_GET(x) (((x) & 0xffc00000) >> 22) -#define PHY_BB_THERM_ADC_2_MEASURE_ATB_FREQ_SET(x) (((x) << 22) & 0xffc00000) - -/* macros for BB_therm_adc_3 */ -#define PHY_BB_THERM_ADC_3_ADDRESS 0x0000a7f0 -#define PHY_BB_THERM_ADC_3_OFFSET 0x0000a7f0 -#define PHY_BB_THERM_ADC_3_THERM_ADC_OFFSET_MSB 7 -#define PHY_BB_THERM_ADC_3_THERM_ADC_OFFSET_LSB 0 -#define PHY_BB_THERM_ADC_3_THERM_ADC_OFFSET_MASK 0x000000ff -#define PHY_BB_THERM_ADC_3_THERM_ADC_OFFSET_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_THERM_ADC_3_THERM_ADC_OFFSET_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_BB_THERM_ADC_3_THERM_ADC_SCALED_GAIN_MSB 16 -#define PHY_BB_THERM_ADC_3_THERM_ADC_SCALED_GAIN_LSB 8 -#define PHY_BB_THERM_ADC_3_THERM_ADC_SCALED_GAIN_MASK 0x0001ff00 -#define PHY_BB_THERM_ADC_3_THERM_ADC_SCALED_GAIN_GET(x) (((x) & 0x0001ff00) >> 8) -#define PHY_BB_THERM_ADC_3_THERM_ADC_SCALED_GAIN_SET(x) (((x) << 8) & 0x0001ff00) -#define PHY_BB_THERM_ADC_3_ADC_INTERVAL_MSB 29 -#define PHY_BB_THERM_ADC_3_ADC_INTERVAL_LSB 17 -#define PHY_BB_THERM_ADC_3_ADC_INTERVAL_MASK 0x3ffe0000 -#define PHY_BB_THERM_ADC_3_ADC_INTERVAL_GET(x) (((x) & 0x3ffe0000) >> 17) -#define PHY_BB_THERM_ADC_3_ADC_INTERVAL_SET(x) (((x) << 17) & 0x3ffe0000) - -/* macros for BB_therm_adc_4 */ -#define PHY_BB_THERM_ADC_4_ADDRESS 0x0000a7f4 -#define PHY_BB_THERM_ADC_4_OFFSET 0x0000a7f4 -#define PHY_BB_THERM_ADC_4_LATEST_THERM_VALUE_MSB 7 -#define PHY_BB_THERM_ADC_4_LATEST_THERM_VALUE_LSB 0 -#define PHY_BB_THERM_ADC_4_LATEST_THERM_VALUE_MASK 0x000000ff -#define PHY_BB_THERM_ADC_4_LATEST_THERM_VALUE_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_THERM_ADC_4_LATEST_VOLT_VALUE_MSB 15 -#define PHY_BB_THERM_ADC_4_LATEST_VOLT_VALUE_LSB 8 -#define PHY_BB_THERM_ADC_4_LATEST_VOLT_VALUE_MASK 0x0000ff00 -#define PHY_BB_THERM_ADC_4_LATEST_VOLT_VALUE_GET(x) (((x) & 0x0000ff00) >> 8) -#define PHY_BB_THERM_ADC_4_LATEST_ATB_VALUE_MSB 23 -#define PHY_BB_THERM_ADC_4_LATEST_ATB_VALUE_LSB 16 -#define PHY_BB_THERM_ADC_4_LATEST_ATB_VALUE_MASK 0x00ff0000 -#define PHY_BB_THERM_ADC_4_LATEST_ATB_VALUE_GET(x) (((x) & 0x00ff0000) >> 16) - -/* macros for BB_tx_forced_gain */ -#define PHY_BB_TX_FORCED_GAIN_ADDRESS 0x0000a7f8 -#define PHY_BB_TX_FORCED_GAIN_OFFSET 0x0000a7f8 -#define PHY_BB_TX_FORCED_GAIN_FORCE_TX_GAIN_MSB 0 -#define PHY_BB_TX_FORCED_GAIN_FORCE_TX_GAIN_LSB 0 -#define PHY_BB_TX_FORCED_GAIN_FORCE_TX_GAIN_MASK 0x00000001 -#define PHY_BB_TX_FORCED_GAIN_FORCE_TX_GAIN_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_BB_TX_FORCED_GAIN_FORCE_TX_GAIN_SET(x) (((x) << 0) & 0x00000001) -#define PHY_BB_TX_FORCED_GAIN_FORCED_TXBB1DBGAIN_MSB 3 -#define PHY_BB_TX_FORCED_GAIN_FORCED_TXBB1DBGAIN_LSB 1 -#define PHY_BB_TX_FORCED_GAIN_FORCED_TXBB1DBGAIN_MASK 0x0000000e -#define PHY_BB_TX_FORCED_GAIN_FORCED_TXBB1DBGAIN_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_BB_TX_FORCED_GAIN_FORCED_TXBB1DBGAIN_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_BB_TX_FORCED_GAIN_FORCED_TXBB6DBGAIN_MSB 5 -#define PHY_BB_TX_FORCED_GAIN_FORCED_TXBB6DBGAIN_LSB 4 -#define PHY_BB_TX_FORCED_GAIN_FORCED_TXBB6DBGAIN_MASK 0x00000030 -#define PHY_BB_TX_FORCED_GAIN_FORCED_TXBB6DBGAIN_GET(x) (((x) & 0x00000030) >> 4) -#define PHY_BB_TX_FORCED_GAIN_FORCED_TXBB6DBGAIN_SET(x) (((x) << 4) & 0x00000030) -#define PHY_BB_TX_FORCED_GAIN_FORCED_TXMXRGAIN_MSB 9 -#define PHY_BB_TX_FORCED_GAIN_FORCED_TXMXRGAIN_LSB 6 -#define PHY_BB_TX_FORCED_GAIN_FORCED_TXMXRGAIN_MASK 0x000003c0 -#define PHY_BB_TX_FORCED_GAIN_FORCED_TXMXRGAIN_GET(x) (((x) & 0x000003c0) >> 6) -#define PHY_BB_TX_FORCED_GAIN_FORCED_TXMXRGAIN_SET(x) (((x) << 6) & 0x000003c0) -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGNA_MSB 13 -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGNA_LSB 10 -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGNA_MASK 0x00003c00 -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGNA_GET(x) (((x) & 0x00003c00) >> 10) -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGNA_SET(x) (((x) << 10) & 0x00003c00) -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGNB_MSB 17 -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGNB_LSB 14 -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGNB_MASK 0x0003c000 -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGNB_GET(x) (((x) & 0x0003c000) >> 14) -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGNB_SET(x) (((x) << 14) & 0x0003c000) -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGNC_MSB 21 -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGNC_LSB 18 -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGNC_MASK 0x003c0000 -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGNC_GET(x) (((x) & 0x003c0000) >> 18) -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGNC_SET(x) (((x) << 18) & 0x003c0000) -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGND_MSB 23 -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGND_LSB 22 -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGND_MASK 0x00c00000 -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGND_GET(x) (((x) & 0x00c00000) >> 22) -#define PHY_BB_TX_FORCED_GAIN_FORCED_PADRVGND_SET(x) (((x) << 22) & 0x00c00000) -#define PHY_BB_TX_FORCED_GAIN_FORCED_ENABLE_PAL_MSB 24 -#define PHY_BB_TX_FORCED_GAIN_FORCED_ENABLE_PAL_LSB 24 -#define PHY_BB_TX_FORCED_GAIN_FORCED_ENABLE_PAL_MASK 0x01000000 -#define PHY_BB_TX_FORCED_GAIN_FORCED_ENABLE_PAL_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_BB_TX_FORCED_GAIN_FORCED_ENABLE_PAL_SET(x) (((x) << 24) & 0x01000000) - -/* macros for BB_eco_ctrl */ -#define PHY_BB_ECO_CTRL_ADDRESS 0x0000a7fc -#define PHY_BB_ECO_CTRL_OFFSET 0x0000a7fc -#define PHY_BB_ECO_CTRL_ECO_CTRL_MSB 7 -#define PHY_BB_ECO_CTRL_ECO_CTRL_LSB 0 -#define PHY_BB_ECO_CTRL_ECO_CTRL_MASK 0x000000ff -#define PHY_BB_ECO_CTRL_ECO_CTRL_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_BB_ECO_CTRL_ECO_CTRL_SET(x) (((x) << 0) & 0x000000ff) - -/* macros for BB_gain_force_max_gains_b1 */ -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B1_ADDRESS 0x0000a848 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B1_OFFSET 0x0000a848 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN1_HYST_MARGIN_1_MSB 13 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN1_HYST_MARGIN_1_LSB 7 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN1_HYST_MARGIN_1_MASK 0x00003f80 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN1_HYST_MARGIN_1_GET(x) (((x) & 0x00003f80) >> 7) -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN1_HYST_MARGIN_1_SET(x) (((x) << 7) & 0x00003f80) -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN2_HYST_MARGIN_1_MSB 20 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN2_HYST_MARGIN_1_LSB 14 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN2_HYST_MARGIN_1_MASK 0x001fc000 -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN2_HYST_MARGIN_1_GET(x) (((x) & 0x001fc000) >> 14) -#define PHY_BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN2_HYST_MARGIN_1_SET(x) (((x) << 14) & 0x001fc000) - -/* macros for BB_gains_min_offsets_b1 */ -#define PHY_BB_GAINS_MIN_OFFSETS_B1_ADDRESS 0x0000a84c -#define PHY_BB_GAINS_MIN_OFFSETS_B1_OFFSET 0x0000a84c -#define PHY_BB_GAINS_MIN_OFFSETS_B1_RF_GAIN_F_1_MSB 24 -#define PHY_BB_GAINS_MIN_OFFSETS_B1_RF_GAIN_F_1_LSB 17 -#define PHY_BB_GAINS_MIN_OFFSETS_B1_RF_GAIN_F_1_MASK 0x01fe0000 -#define PHY_BB_GAINS_MIN_OFFSETS_B1_RF_GAIN_F_1_GET(x) (((x) & 0x01fe0000) >> 17) -#define PHY_BB_GAINS_MIN_OFFSETS_B1_RF_GAIN_F_1_SET(x) (((x) << 17) & 0x01fe0000) -#define PHY_BB_GAINS_MIN_OFFSETS_B1_XATTEN1_SW_F_1_MSB 25 -#define PHY_BB_GAINS_MIN_OFFSETS_B1_XATTEN1_SW_F_1_LSB 25 -#define PHY_BB_GAINS_MIN_OFFSETS_B1_XATTEN1_SW_F_1_MASK 0x02000000 -#define PHY_BB_GAINS_MIN_OFFSETS_B1_XATTEN1_SW_F_1_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_BB_GAINS_MIN_OFFSETS_B1_XATTEN1_SW_F_1_SET(x) (((x) << 25) & 0x02000000) -#define PHY_BB_GAINS_MIN_OFFSETS_B1_XATTEN2_SW_F_1_MSB 26 -#define PHY_BB_GAINS_MIN_OFFSETS_B1_XATTEN2_SW_F_1_LSB 26 -#define PHY_BB_GAINS_MIN_OFFSETS_B1_XATTEN2_SW_F_1_MASK 0x04000000 -#define PHY_BB_GAINS_MIN_OFFSETS_B1_XATTEN2_SW_F_1_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_BB_GAINS_MIN_OFFSETS_B1_XATTEN2_SW_F_1_SET(x) (((x) << 26) & 0x04000000) - -/* macros for BB_rx_ocgain2 */ -#define PHY_BB_RX_OCGAIN2_ADDRESS 0x0000aa00 -#define PHY_BB_RX_OCGAIN2_OFFSET 0x0000aa00 -#define PHY_BB_RX_OCGAIN2_GAIN_ENTRY2_MSB 31 -#define PHY_BB_RX_OCGAIN2_GAIN_ENTRY2_LSB 0 -#define PHY_BB_RX_OCGAIN2_GAIN_ENTRY2_MASK 0xffffffff -#define PHY_BB_RX_OCGAIN2_GAIN_ENTRY2_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_ext_atten_switch_ctl_b1 */ -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_ADDRESS 0x0000b20c -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_OFFSET 0x0000b20c -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_DB_1_MSB 5 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_DB_1_LSB 0 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_DB_1_MASK 0x0000003f -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_DB_1_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_DB_1_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_DB_1_MSB 11 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_DB_1_LSB 6 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_DB_1_MASK 0x00000fc0 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_DB_1_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_DB_1_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_MARGIN_1_MSB 16 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_MARGIN_1_LSB 12 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_MARGIN_1_MASK 0x0001f000 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_MARGIN_1_GET(x) (((x) & 0x0001f000) >> 12) -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_MARGIN_1_SET(x) (((x) << 12) & 0x0001f000) -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_MARGIN_1_MSB 21 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_MARGIN_1_LSB 17 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_MARGIN_1_MASK 0x003e0000 -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_MARGIN_1_GET(x) (((x) & 0x003e0000) >> 17) -#define PHY_BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_MARGIN_1_SET(x) (((x) << 17) & 0x003e0000) - - -#ifndef __ASSEMBLER__ - -typedef struct bb_lc_reg_reg_s { - volatile char pad__0[0x9800]; /* 0x0 - 0x9800 */ - volatile unsigned int BB_test_controls; /* 0x9800 - 0x9804 */ - volatile unsigned int BB_gen_controls; /* 0x9804 - 0x9808 */ - volatile unsigned int BB_test_controls_status; /* 0x9808 - 0x980c */ - volatile unsigned int BB_timing_controls_1; /* 0x980c - 0x9810 */ - volatile unsigned int BB_timing_controls_2; /* 0x9810 - 0x9814 */ - volatile unsigned int BB_timing_controls_3; /* 0x9814 - 0x9818 */ - volatile unsigned int BB_D2_chip_id; /* 0x9818 - 0x981c */ - volatile unsigned int BB_active; /* 0x981c - 0x9820 */ - volatile unsigned int BB_tx_timing_1; /* 0x9820 - 0x9824 */ - volatile unsigned int BB_tx_timing_2; /* 0x9824 - 0x9828 */ - volatile unsigned int BB_tx_timing_3; /* 0x9828 - 0x982c */ - volatile unsigned int BB_addac_parallel_control; /* 0x982c - 0x9830 */ - volatile char pad__1[0x4]; /* 0x9830 - 0x9834 */ - volatile unsigned int BB_xpa_timing_control; /* 0x9834 - 0x9838 */ - volatile unsigned int BB_misc_pa_control; /* 0x9838 - 0x983c */ - volatile unsigned int BB_tstdac_constant; /* 0x983c - 0x9840 */ - volatile unsigned int BB_find_signal_low; /* 0x9840 - 0x9844 */ - volatile unsigned int BB_settling_time; /* 0x9844 - 0x9848 */ - volatile unsigned int BB_gain_force_max_gains_b0; /* 0x9848 - 0x984c */ - volatile unsigned int BB_gains_min_offsets_b0; /* 0x984c - 0x9850 */ - volatile unsigned int BB_desired_sigsize; /* 0x9850 - 0x9854 */ - volatile unsigned int BB_timing_control_3a; /* 0x9854 - 0x9858 */ - volatile unsigned int BB_find_signal; /* 0x9858 - 0x985c */ - volatile unsigned int BB_agc; /* 0x985c - 0x9860 */ - volatile unsigned int BB_agc_control; /* 0x9860 - 0x9864 */ - volatile unsigned int BB_cca_b0; /* 0x9864 - 0x9868 */ - volatile unsigned int BB_sfcorr; /* 0x9868 - 0x986c */ - volatile unsigned int BB_self_corr_low; /* 0x986c - 0x9870 */ - volatile char pad__2[0x4]; /* 0x9870 - 0x9874 */ - volatile unsigned int BB_synth_control; /* 0x9874 - 0x9878 */ - volatile unsigned int BB_addac_clk_select; /* 0x9878 - 0x987c */ - volatile unsigned int BB_pll_cntl; /* 0x987c - 0x9880 */ - volatile char pad__3[0x80]; /* 0x9880 - 0x9900 */ - volatile unsigned int BB_vit_spur_mask_A; /* 0x9900 - 0x9904 */ - volatile unsigned int BB_vit_spur_mask_B; /* 0x9904 - 0x9908 */ - volatile unsigned int BB_pilot_spur_mask; /* 0x9908 - 0x990c */ - volatile unsigned int BB_chan_spur_mask; /* 0x990c - 0x9910 */ - volatile unsigned int BB_spectral_scan; /* 0x9910 - 0x9914 */ - volatile unsigned int BB_analog_power_on_time; /* 0x9914 - 0x9918 */ - volatile unsigned int BB_search_start_delay; /* 0x9918 - 0x991c */ - volatile unsigned int BB_max_rx_length; /* 0x991c - 0x9920 */ - volatile unsigned int BB_timing_control_4; /* 0x9920 - 0x9924 */ - volatile unsigned int BB_timing_control_5; /* 0x9924 - 0x9928 */ - volatile unsigned int BB_phyonly_warm_reset; /* 0x9928 - 0x992c */ - volatile unsigned int BB_phyonly_control; /* 0x992c - 0x9930 */ - volatile char pad__4[0x4]; /* 0x9930 - 0x9934 */ - volatile unsigned int BB_powertx_rate1; /* 0x9934 - 0x9938 */ - volatile unsigned int BB_powertx_rate2; /* 0x9938 - 0x993c */ - volatile unsigned int BB_powertx_max; /* 0x993c - 0x9940 */ - volatile unsigned int BB_extension_radar; /* 0x9940 - 0x9944 */ - volatile unsigned int BB_frame_control; /* 0x9944 - 0x9948 */ - volatile unsigned int BB_timing_control_6; /* 0x9948 - 0x994c */ - volatile unsigned int BB_spur_mask_controls; /* 0x994c - 0x9950 */ - volatile unsigned int BB_rx_iq_corr_b0; /* 0x9950 - 0x9954 */ - volatile unsigned int BB_radar_detection; /* 0x9954 - 0x9958 */ - volatile unsigned int BB_radar_detection_2; /* 0x9958 - 0x995c */ - volatile unsigned int BB_tx_phase_ramp_b0; /* 0x995c - 0x9960 */ - volatile unsigned int BB_switch_table_chn_b0; /* 0x9960 - 0x9964 */ - volatile unsigned int BB_switch_table_com1; /* 0x9964 - 0x9968 */ - volatile unsigned int BB_cca_ctrl_2_b0; /* 0x9968 - 0x996c */ - volatile unsigned int BB_switch_table_com2; /* 0x996c - 0x9970 */ - volatile unsigned int BB_restart; /* 0x9970 - 0x9974 */ - volatile char pad__5[0x4]; /* 0x9974 - 0x9978 */ - volatile unsigned int BB_scrambler_seed; /* 0x9978 - 0x997c */ - volatile unsigned int BB_rfbus_request; /* 0x997c - 0x9980 */ - volatile char pad__6[0x20]; /* 0x9980 - 0x99a0 */ - volatile unsigned int BB_timing_control_11; /* 0x99a0 - 0x99a4 */ - volatile unsigned int BB_multichain_enable; /* 0x99a4 - 0x99a8 */ - volatile unsigned int BB_multichain_control; /* 0x99a8 - 0x99ac */ - volatile unsigned int BB_multichain_gain_ctrl; /* 0x99ac - 0x99b0 */ - volatile char pad__7[0x4]; /* 0x99b0 - 0x99b4 */ - volatile unsigned int BB_adc_gain_dc_corr_b0; /* 0x99b4 - 0x99b8 */ - volatile unsigned int BB_ext_chan_pwr_thr_1; /* 0x99b8 - 0x99bc */ - volatile unsigned int BB_ext_chan_pwr_thr_2_b0; /* 0x99bc - 0x99c0 */ - volatile unsigned int BB_ext_chan_scorr_thr; /* 0x99c0 - 0x99c4 */ - volatile unsigned int BB_ext_chan_detect_win; /* 0x99c4 - 0x99c8 */ - volatile unsigned int BB_pwr_thr_20_40_det; /* 0x99c8 - 0x99cc */ - volatile char pad__8[0x4]; /* 0x99cc - 0x99d0 */ - volatile unsigned int BB_short_gi_delta_slope; /* 0x99d0 - 0x99d4 */ - volatile char pad__9[0x8]; /* 0x99d4 - 0x99dc */ - volatile unsigned int BB_chaninfo_ctrl; /* 0x99dc - 0x99e0 */ - volatile unsigned int BB_heavy_clip_ctrl; /* 0x99e0 - 0x99e4 */ - volatile unsigned int BB_heavy_clip_20; /* 0x99e4 - 0x99e8 */ - volatile unsigned int BB_heavy_clip_40; /* 0x99e8 - 0x99ec */ - volatile unsigned int BB_rifs_srch; /* 0x99ec - 0x99f0 */ - volatile unsigned int BB_iq_adc_cal_mode; /* 0x99f0 - 0x99f4 */ - volatile char pad__10[0x8]; /* 0x99f4 - 0x99fc */ - volatile unsigned int BB_per_chain_csd; /* 0x99fc - 0x9a00 */ - volatile unsigned int BB_rx_ocgain[128]; /* 0x9a00 - 0x9c00 */ - volatile unsigned int BB_tx_crc; /* 0x9c00 - 0x9c04 */ - volatile char pad__11[0xc]; /* 0x9c04 - 0x9c10 */ - volatile unsigned int BB_iq_adc_meas_0_b0; /* 0x9c10 - 0x9c14 */ - volatile unsigned int BB_iq_adc_meas_1_b0; /* 0x9c14 - 0x9c18 */ - volatile unsigned int BB_iq_adc_meas_2_b0; /* 0x9c18 - 0x9c1c */ - volatile unsigned int BB_iq_adc_meas_3_b0; /* 0x9c1c - 0x9c20 */ - volatile unsigned int BB_rfbus_grant; /* 0x9c20 - 0x9c24 */ - volatile unsigned int BB_tstadc; /* 0x9c24 - 0x9c28 */ - volatile unsigned int BB_tstdac; /* 0x9c28 - 0x9c2c */ - volatile char pad__12[0x4]; /* 0x9c2c - 0x9c30 */ - volatile unsigned int BB_illegal_tx_rate; /* 0x9c30 - 0x9c34 */ - volatile unsigned int BB_spur_report_b0; /* 0x9c34 - 0x9c38 */ - volatile unsigned int BB_channel_status; /* 0x9c38 - 0x9c3c */ - volatile unsigned int BB_rssi_b0; /* 0x9c3c - 0x9c40 */ - volatile unsigned int BB_spur_est_cck_report_b0; /* 0x9c40 - 0x9c44 */ - volatile char pad__13[0x68]; /* 0x9c44 - 0x9cac */ - volatile unsigned int BB_chan_info_noise_pwr; /* 0x9cac - 0x9cb0 */ - volatile unsigned int BB_chan_info_gain_diff; /* 0x9cb0 - 0x9cb4 */ - volatile unsigned int BB_chan_info_fine_timing; /* 0x9cb4 - 0x9cb8 */ - volatile unsigned int BB_chan_info_gain_b0; /* 0x9cb8 - 0x9cbc */ - volatile unsigned int BB_chan_info_chan_tab_b0[60]; /* 0x9cbc - 0x9dac */ - volatile char pad__14[0x38]; /* 0x9dac - 0x9de4 */ - volatile unsigned int BB_paprd_am2am_mask; /* 0x9de4 - 0x9de8 */ - volatile unsigned int BB_paprd_am2pm_mask; /* 0x9de8 - 0x9dec */ - volatile unsigned int BB_paprd_ht40_mask; /* 0x9dec - 0x9df0 */ - volatile unsigned int BB_paprd_ctrl0; /* 0x9df0 - 0x9df4 */ - volatile unsigned int BB_paprd_ctrl1; /* 0x9df4 - 0x9df8 */ - volatile unsigned int BB_pa_gain123; /* 0x9df8 - 0x9dfc */ - volatile unsigned int BB_pa_gain45; /* 0x9dfc - 0x9e00 */ - volatile unsigned int BB_paprd_pre_post_scale_0; /* 0x9e00 - 0x9e04 */ - volatile unsigned int BB_paprd_pre_post_scale_1; /* 0x9e04 - 0x9e08 */ - volatile unsigned int BB_paprd_pre_post_scale_2; /* 0x9e08 - 0x9e0c */ - volatile unsigned int BB_paprd_pre_post_scale_3; /* 0x9e0c - 0x9e10 */ - volatile unsigned int BB_paprd_pre_post_scale_4; /* 0x9e10 - 0x9e14 */ - volatile unsigned int BB_paprd_pre_post_scale_5; /* 0x9e14 - 0x9e18 */ - volatile unsigned int BB_paprd_pre_post_scale_6; /* 0x9e18 - 0x9e1c */ - volatile unsigned int BB_paprd_pre_post_scale_7; /* 0x9e1c - 0x9e20 */ - volatile unsigned int BB_paprd_mem_tab[120]; /* 0x9e20 - 0xa000 */ - volatile unsigned int BB_peak_det_ctrl_1; /* 0xa000 - 0xa004 */ - volatile unsigned int BB_peak_det_ctrl_2; /* 0xa004 - 0xa008 */ - volatile unsigned int BB_rx_gain_bounds_1; /* 0xa008 - 0xa00c */ - volatile unsigned int BB_rx_gain_bounds_2; /* 0xa00c - 0xa010 */ - volatile unsigned int BB_peak_det_cal_ctrl; /* 0xa010 - 0xa014 */ - volatile unsigned int BB_agc_dig_dc_ctrl; /* 0xa014 - 0xa018 */ - volatile unsigned int BB_agc_dig_dc_status_i_b0; /* 0xa018 - 0xa01c */ - volatile unsigned int BB_agc_dig_dc_status_q_b0; /* 0xa01c - 0xa020 */ - volatile char pad__15[0x1d4]; /* 0xa020 - 0xa1f4 */ - volatile unsigned int BB_bbb_txfir_0; /* 0xa1f4 - 0xa1f8 */ - volatile unsigned int BB_bbb_txfir_1; /* 0xa1f8 - 0xa1fc */ - volatile unsigned int BB_bbb_txfir_2; /* 0xa1fc - 0xa200 */ - volatile unsigned int BB_modes_select; /* 0xa200 - 0xa204 */ - volatile unsigned int BB_bbb_tx_ctrl; /* 0xa204 - 0xa208 */ - volatile unsigned int BB_bbb_sig_detect; /* 0xa208 - 0xa20c */ - volatile unsigned int BB_ext_atten_switch_ctl_b0; /* 0xa20c - 0xa210 */ - volatile unsigned int BB_bbb_rx_ctrl_1; /* 0xa210 - 0xa214 */ - volatile unsigned int BB_bbb_rx_ctrl_2; /* 0xa214 - 0xa218 */ - volatile unsigned int BB_bbb_rx_ctrl_3; /* 0xa218 - 0xa21c */ - volatile unsigned int BB_bbb_rx_ctrl_4; /* 0xa21c - 0xa220 */ - volatile unsigned int BB_bbb_rx_ctrl_5; /* 0xa220 - 0xa224 */ - volatile unsigned int BB_bbb_rx_ctrl_6; /* 0xa224 - 0xa228 */ - volatile unsigned int BB_bbb_dagc_ctrl; /* 0xa228 - 0xa22c */ - volatile unsigned int BB_force_clken_cck; /* 0xa22c - 0xa230 */ - volatile unsigned int BB_rx_clear_delay; /* 0xa230 - 0xa234 */ - volatile unsigned int BB_powertx_rate3; /* 0xa234 - 0xa238 */ - volatile unsigned int BB_powertx_rate4; /* 0xa238 - 0xa23c */ - volatile char pad__16[0x4]; /* 0xa23c - 0xa240 */ - volatile unsigned int BB_cck_spur_mit; /* 0xa240 - 0xa244 */ - volatile unsigned int BB_panic_watchdog_status; /* 0xa244 - 0xa248 */ - volatile unsigned int BB_panic_watchdog_ctrl_1; /* 0xa248 - 0xa24c */ - volatile unsigned int BB_panic_watchdog_ctrl_2; /* 0xa24c - 0xa250 */ - volatile unsigned int BB_iqcorr_ctrl_cck; /* 0xa250 - 0xa254 */ - volatile unsigned int BB_bluetooth_cntl; /* 0xa254 - 0xa258 */ - volatile unsigned int BB_tpc_1; /* 0xa258 - 0xa25c */ - volatile unsigned int BB_tpc_2; /* 0xa25c - 0xa260 */ - volatile unsigned int BB_tpc_3; /* 0xa260 - 0xa264 */ - volatile unsigned int BB_tpc_4_b0; /* 0xa264 - 0xa268 */ - volatile unsigned int BB_analog_swap; /* 0xa268 - 0xa26c */ - volatile unsigned int BB_tpc_5_b0; /* 0xa26c - 0xa270 */ - volatile unsigned int BB_tpc_6_b0; /* 0xa270 - 0xa274 */ - volatile unsigned int BB_tpc_7; /* 0xa274 - 0xa278 */ - volatile unsigned int BB_tpc_8; /* 0xa278 - 0xa27c */ - volatile unsigned int BB_tpc_9; /* 0xa27c - 0xa280 */ - volatile unsigned int BB_pdadc_tab_b0[32]; /* 0xa280 - 0xa300 */ - volatile unsigned int BB_cl_tab_b0[16]; /* 0xa300 - 0xa340 */ - volatile unsigned int BB_cl_map_0_b0; /* 0xa340 - 0xa344 */ - volatile unsigned int BB_cl_map_1_b0; /* 0xa344 - 0xa348 */ - volatile unsigned int BB_cl_map_2_b0; /* 0xa348 - 0xa34c */ - volatile unsigned int BB_cl_map_3_b0; /* 0xa34c - 0xa350 */ - volatile char pad__17[0x8]; /* 0xa350 - 0xa358 */ - volatile unsigned int BB_cl_cal_ctrl; /* 0xa358 - 0xa35c */ - volatile unsigned int BB_cl_map_pal_0_b0; /* 0xa35c - 0xa360 */ - volatile unsigned int BB_cl_map_pal_1_b0; /* 0xa360 - 0xa364 */ - volatile unsigned int BB_cl_map_pal_2_b0; /* 0xa364 - 0xa368 */ - volatile unsigned int BB_cl_map_pal_3_b0; /* 0xa368 - 0xa36c */ - volatile char pad__18[0x1c]; /* 0xa36c - 0xa388 */ - volatile unsigned int BB_rifs; /* 0xa388 - 0xa38c */ - volatile unsigned int BB_powertx_rate5; /* 0xa38c - 0xa390 */ - volatile unsigned int BB_powertx_rate6; /* 0xa390 - 0xa394 */ - volatile unsigned int BB_tpc_10; /* 0xa394 - 0xa398 */ - volatile unsigned int BB_tpc_11_b0; /* 0xa398 - 0xa39c */ - volatile unsigned int BB_cal_chain_mask; /* 0xa39c - 0xa3a0 */ - volatile char pad__19[0x1c]; /* 0xa3a0 - 0xa3bc */ - volatile unsigned int BB_powertx_sub; /* 0xa3bc - 0xa3c0 */ - volatile unsigned int BB_powertx_rate7; /* 0xa3c0 - 0xa3c4 */ - volatile unsigned int BB_powertx_rate8; /* 0xa3c4 - 0xa3c8 */ - volatile unsigned int BB_powertx_rate9; /* 0xa3c8 - 0xa3cc */ - volatile unsigned int BB_powertx_rate10; /* 0xa3cc - 0xa3d0 */ - volatile unsigned int BB_powertx_rate11; /* 0xa3d0 - 0xa3d4 */ - volatile unsigned int BB_powertx_rate12; /* 0xa3d4 - 0xa3d8 */ - volatile unsigned int BB_force_analog; /* 0xa3d8 - 0xa3dc */ - volatile unsigned int BB_tpc_12; /* 0xa3dc - 0xa3e0 */ - volatile unsigned int BB_tpc_13; /* 0xa3e0 - 0xa3e4 */ - volatile unsigned int BB_tpc_14; /* 0xa3e4 - 0xa3e8 */ - volatile unsigned int BB_tpc_15; /* 0xa3e8 - 0xa3ec */ - volatile unsigned int BB_tpc_16; /* 0xa3ec - 0xa3f0 */ - volatile unsigned int BB_tpc_17; /* 0xa3f0 - 0xa3f4 */ - volatile unsigned int BB_tpc_18; /* 0xa3f4 - 0xa3f8 */ - volatile unsigned int BB_tpc_19; /* 0xa3f8 - 0xa3fc */ - volatile unsigned int BB_tpc_20; /* 0xa3fc - 0xa400 */ - volatile unsigned int BB_tx_gain_tab_1; /* 0xa400 - 0xa404 */ - volatile unsigned int BB_tx_gain_tab_2; /* 0xa404 - 0xa408 */ - volatile unsigned int BB_tx_gain_tab_3; /* 0xa408 - 0xa40c */ - volatile unsigned int BB_tx_gain_tab_4; /* 0xa40c - 0xa410 */ - volatile unsigned int BB_tx_gain_tab_5; /* 0xa410 - 0xa414 */ - volatile unsigned int BB_tx_gain_tab_6; /* 0xa414 - 0xa418 */ - volatile unsigned int BB_tx_gain_tab_7; /* 0xa418 - 0xa41c */ - volatile unsigned int BB_tx_gain_tab_8; /* 0xa41c - 0xa420 */ - volatile unsigned int BB_tx_gain_tab_9; /* 0xa420 - 0xa424 */ - volatile unsigned int BB_tx_gain_tab_10; /* 0xa424 - 0xa428 */ - volatile unsigned int BB_tx_gain_tab_11; /* 0xa428 - 0xa42c */ - volatile unsigned int BB_tx_gain_tab_12; /* 0xa42c - 0xa430 */ - volatile unsigned int BB_tx_gain_tab_13; /* 0xa430 - 0xa434 */ - volatile unsigned int BB_tx_gain_tab_14; /* 0xa434 - 0xa438 */ - volatile unsigned int BB_tx_gain_tab_15; /* 0xa438 - 0xa43c */ - volatile unsigned int BB_tx_gain_tab_16; /* 0xa43c - 0xa440 */ - volatile unsigned int BB_tx_gain_tab_17; /* 0xa440 - 0xa444 */ - volatile unsigned int BB_tx_gain_tab_18; /* 0xa444 - 0xa448 */ - volatile unsigned int BB_tx_gain_tab_19; /* 0xa448 - 0xa44c */ - volatile unsigned int BB_tx_gain_tab_20; /* 0xa44c - 0xa450 */ - volatile unsigned int BB_tx_gain_tab_21; /* 0xa450 - 0xa454 */ - volatile unsigned int BB_tx_gain_tab_22; /* 0xa454 - 0xa458 */ - volatile unsigned int BB_tx_gain_tab_23; /* 0xa458 - 0xa45c */ - volatile unsigned int BB_tx_gain_tab_24; /* 0xa45c - 0xa460 */ - volatile unsigned int BB_tx_gain_tab_25; /* 0xa460 - 0xa464 */ - volatile unsigned int BB_tx_gain_tab_26; /* 0xa464 - 0xa468 */ - volatile unsigned int BB_tx_gain_tab_27; /* 0xa468 - 0xa46c */ - volatile unsigned int BB_tx_gain_tab_28; /* 0xa46c - 0xa470 */ - volatile unsigned int BB_tx_gain_tab_29; /* 0xa470 - 0xa474 */ - volatile unsigned int BB_tx_gain_tab_30; /* 0xa474 - 0xa478 */ - volatile unsigned int BB_tx_gain_tab_31; /* 0xa478 - 0xa47c */ - volatile unsigned int BB_tx_gain_tab_32; /* 0xa47c - 0xa480 */ - volatile unsigned int BB_tx_gain_tab_pal_1; /* 0xa480 - 0xa484 */ - volatile unsigned int BB_tx_gain_tab_pal_2; /* 0xa484 - 0xa488 */ - volatile unsigned int BB_tx_gain_tab_pal_3; /* 0xa488 - 0xa48c */ - volatile unsigned int BB_tx_gain_tab_pal_4; /* 0xa48c - 0xa490 */ - volatile unsigned int BB_tx_gain_tab_pal_5; /* 0xa490 - 0xa494 */ - volatile unsigned int BB_tx_gain_tab_pal_6; /* 0xa494 - 0xa498 */ - volatile unsigned int BB_tx_gain_tab_pal_7; /* 0xa498 - 0xa49c */ - volatile unsigned int BB_tx_gain_tab_pal_8; /* 0xa49c - 0xa4a0 */ - volatile unsigned int BB_tx_gain_tab_pal_9; /* 0xa4a0 - 0xa4a4 */ - volatile unsigned int BB_tx_gain_tab_pal_10; /* 0xa4a4 - 0xa4a8 */ - volatile unsigned int BB_tx_gain_tab_pal_11; /* 0xa4a8 - 0xa4ac */ - volatile unsigned int BB_tx_gain_tab_pal_12; /* 0xa4ac - 0xa4b0 */ - volatile unsigned int BB_tx_gain_tab_pal_13; /* 0xa4b0 - 0xa4b4 */ - volatile unsigned int BB_tx_gain_tab_pal_14; /* 0xa4b4 - 0xa4b8 */ - volatile unsigned int BB_tx_gain_tab_pal_15; /* 0xa4b8 - 0xa4bc */ - volatile unsigned int BB_tx_gain_tab_pal_16; /* 0xa4bc - 0xa4c0 */ - volatile unsigned int BB_tx_gain_tab_pal_17; /* 0xa4c0 - 0xa4c4 */ - volatile unsigned int BB_tx_gain_tab_pal_18; /* 0xa4c4 - 0xa4c8 */ - volatile unsigned int BB_tx_gain_tab_pal_19; /* 0xa4c8 - 0xa4cc */ - volatile unsigned int BB_tx_gain_tab_pal_20; /* 0xa4cc - 0xa4d0 */ - volatile unsigned int BB_tx_gain_tab_pal_21; /* 0xa4d0 - 0xa4d4 */ - volatile unsigned int BB_tx_gain_tab_pal_22; /* 0xa4d4 - 0xa4d8 */ - volatile unsigned int BB_tx_gain_tab_pal_23; /* 0xa4d8 - 0xa4dc */ - volatile unsigned int BB_tx_gain_tab_pal_24; /* 0xa4dc - 0xa4e0 */ - volatile unsigned int BB_tx_gain_tab_pal_25; /* 0xa4e0 - 0xa4e4 */ - volatile unsigned int BB_tx_gain_tab_pal_26; /* 0xa4e4 - 0xa4e8 */ - volatile unsigned int BB_tx_gain_tab_pal_27; /* 0xa4e8 - 0xa4ec */ - volatile unsigned int BB_tx_gain_tab_pal_28; /* 0xa4ec - 0xa4f0 */ - volatile unsigned int BB_tx_gain_tab_pal_29; /* 0xa4f0 - 0xa4f4 */ - volatile unsigned int BB_tx_gain_tab_pal_30; /* 0xa4f4 - 0xa4f8 */ - volatile unsigned int BB_tx_gain_tab_pal_31; /* 0xa4f8 - 0xa4fc */ - volatile unsigned int BB_tx_gain_tab_pal_32; /* 0xa4fc - 0xa500 */ - volatile char pad__20[0x18]; /* 0xa500 - 0xa518 */ - volatile unsigned int BB_caltx_gain_set_0; /* 0xa518 - 0xa51c */ - volatile unsigned int BB_caltx_gain_set_2; /* 0xa51c - 0xa520 */ - volatile unsigned int BB_caltx_gain_set_4; /* 0xa520 - 0xa524 */ - volatile unsigned int BB_caltx_gain_set_6; /* 0xa524 - 0xa528 */ - volatile unsigned int BB_caltx_gain_set_8; /* 0xa528 - 0xa52c */ - volatile unsigned int BB_caltx_gain_set_10; /* 0xa52c - 0xa530 */ - volatile unsigned int BB_caltx_gain_set_12; /* 0xa530 - 0xa534 */ - volatile unsigned int BB_caltx_gain_set_14; /* 0xa534 - 0xa538 */ - volatile unsigned int BB_caltx_gain_set_16; /* 0xa538 - 0xa53c */ - volatile unsigned int BB_caltx_gain_set_18; /* 0xa53c - 0xa540 */ - volatile unsigned int BB_caltx_gain_set_20; /* 0xa540 - 0xa544 */ - volatile unsigned int BB_caltx_gain_set_22; /* 0xa544 - 0xa548 */ - volatile unsigned int BB_caltx_gain_set_24; /* 0xa548 - 0xa54c */ - volatile unsigned int BB_caltx_gain_set_26; /* 0xa54c - 0xa550 */ - volatile unsigned int BB_caltx_gain_set_28; /* 0xa550 - 0xa554 */ - volatile unsigned int BB_caltx_gain_set_30; /* 0xa554 - 0xa558 */ - volatile unsigned int BB_txiqcal_meas_b0[96]; /* 0xa558 - 0xa6d8 */ - volatile unsigned int BB_txiqcal_start; /* 0xa6d8 - 0xa6dc */ - volatile unsigned int BB_txiqcal_control_0; /* 0xa6dc - 0xa6e0 */ - volatile unsigned int BB_txiqcal_control_1; /* 0xa6e0 - 0xa6e4 */ - volatile unsigned int BB_txiqcal_control_2; /* 0xa6e4 - 0xa6e8 */ - volatile unsigned int BB_txiqcal_control_3; /* 0xa6e8 - 0xa6ec */ - volatile unsigned int BB_txiq_corr_coeff_01_b0; /* 0xa6ec - 0xa6f0 */ - volatile unsigned int BB_txiq_corr_coeff_23_b0; /* 0xa6f0 - 0xa6f4 */ - volatile unsigned int BB_txiq_corr_coeff_45_b0; /* 0xa6f4 - 0xa6f8 */ - volatile unsigned int BB_txiq_corr_coeff_67_b0; /* 0xa6f8 - 0xa6fc */ - volatile unsigned int BB_txiq_corr_coeff_89_b0; /* 0xa6fc - 0xa700 */ - volatile unsigned int BB_txiq_corr_coeff_ab_b0; /* 0xa700 - 0xa704 */ - volatile unsigned int BB_txiq_corr_coeff_cd_b0; /* 0xa704 - 0xa708 */ - volatile unsigned int BB_txiq_corr_coeff_ef_b0; /* 0xa708 - 0xa70c */ - volatile unsigned int BB_cal_rxbb_gain_tbl_0; /* 0xa70c - 0xa710 */ - volatile unsigned int BB_cal_rxbb_gain_tbl_4; /* 0xa710 - 0xa714 */ - volatile unsigned int BB_cal_rxbb_gain_tbl_8; /* 0xa714 - 0xa718 */ - volatile unsigned int BB_cal_rxbb_gain_tbl_12; /* 0xa718 - 0xa71c */ - volatile unsigned int BB_cal_rxbb_gain_tbl_16; /* 0xa71c - 0xa720 */ - volatile unsigned int BB_cal_rxbb_gain_tbl_20; /* 0xa720 - 0xa724 */ - volatile unsigned int BB_cal_rxbb_gain_tbl_24; /* 0xa724 - 0xa728 */ - volatile unsigned int BB_txiqcal_status_b0; /* 0xa728 - 0xa72c */ - volatile unsigned int BB_paprd_trainer_cntl1; /* 0xa72c - 0xa730 */ - volatile unsigned int BB_paprd_trainer_cntl2; /* 0xa730 - 0xa734 */ - volatile unsigned int BB_paprd_trainer_cntl3; /* 0xa734 - 0xa738 */ - volatile unsigned int BB_paprd_trainer_cntl4; /* 0xa738 - 0xa73c */ - volatile unsigned int BB_paprd_trainer_stat1; /* 0xa73c - 0xa740 */ - volatile unsigned int BB_paprd_trainer_stat2; /* 0xa740 - 0xa744 */ - volatile unsigned int BB_paprd_trainer_stat3; /* 0xa744 - 0xa748 */ - volatile char pad__21[0x90]; /* 0xa748 - 0xa7d8 */ - volatile unsigned int BB_fcal_1; /* 0xa7d8 - 0xa7dc */ - volatile unsigned int BB_fcal_2_b0; /* 0xa7dc - 0xa7e0 */ - volatile unsigned int BB_radar_bw_filter; /* 0xa7e0 - 0xa7e4 */ - volatile unsigned int BB_dft_tone_ctrl_b0; /* 0xa7e4 - 0xa7e8 */ - volatile unsigned int BB_therm_adc_1; /* 0xa7e8 - 0xa7ec */ - volatile unsigned int BB_therm_adc_2; /* 0xa7ec - 0xa7f0 */ - volatile unsigned int BB_therm_adc_3; /* 0xa7f0 - 0xa7f4 */ - volatile unsigned int BB_therm_adc_4; /* 0xa7f4 - 0xa7f8 */ - volatile unsigned int BB_tx_forced_gain; /* 0xa7f8 - 0xa7fc */ - volatile unsigned int BB_eco_ctrl; /* 0xa7fc - 0xa800 */ - volatile char pad__22[0x48]; /* 0xa800 - 0xa848 */ - volatile unsigned int BB_gain_force_max_gains_b1; /* 0xa848 - 0xa84c */ - volatile unsigned int BB_gains_min_offsets_b1; /* 0xa84c - 0xa850 */ - volatile char pad__23[0x1b0]; /* 0xa850 - 0xaa00 */ - volatile unsigned int BB_rx_ocgain2[128]; /* 0xaa00 - 0xac00 */ - volatile char pad__24[0x60c]; /* 0xac00 - 0xb20c */ - volatile unsigned int BB_ext_atten_switch_ctl_b1; /* 0xb20c - 0xb210 */ -} bb_lc_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _BB_LC_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/efuse_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/efuse_reg.h deleted file mode 100644 index d0fe104ca5ef..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/efuse_reg.h +++ /dev/null @@ -1,108 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _EFUSE_REG_REG_H_ -#define _EFUSE_REG_REG_H_ - -#define EFUSE_WR_ENABLE_REG_ADDRESS 0x00000000 -#define EFUSE_WR_ENABLE_REG_OFFSET 0x00000000 -#define EFUSE_WR_ENABLE_REG_V_MSB 0 -#define EFUSE_WR_ENABLE_REG_V_LSB 0 -#define EFUSE_WR_ENABLE_REG_V_MASK 0x00000001 -#define EFUSE_WR_ENABLE_REG_V_GET(x) (((x) & EFUSE_WR_ENABLE_REG_V_MASK) >> EFUSE_WR_ENABLE_REG_V_LSB) -#define EFUSE_WR_ENABLE_REG_V_SET(x) (((x) << EFUSE_WR_ENABLE_REG_V_LSB) & EFUSE_WR_ENABLE_REG_V_MASK) - -#define EFUSE_INT_ENABLE_REG_ADDRESS 0x00000004 -#define EFUSE_INT_ENABLE_REG_OFFSET 0x00000004 -#define EFUSE_INT_ENABLE_REG_V_MSB 0 -#define EFUSE_INT_ENABLE_REG_V_LSB 0 -#define EFUSE_INT_ENABLE_REG_V_MASK 0x00000001 -#define EFUSE_INT_ENABLE_REG_V_GET(x) (((x) & EFUSE_INT_ENABLE_REG_V_MASK) >> EFUSE_INT_ENABLE_REG_V_LSB) -#define EFUSE_INT_ENABLE_REG_V_SET(x) (((x) << EFUSE_INT_ENABLE_REG_V_LSB) & EFUSE_INT_ENABLE_REG_V_MASK) - -#define EFUSE_INT_STATUS_REG_ADDRESS 0x00000008 -#define EFUSE_INT_STATUS_REG_OFFSET 0x00000008 -#define EFUSE_INT_STATUS_REG_V_MSB 0 -#define EFUSE_INT_STATUS_REG_V_LSB 0 -#define EFUSE_INT_STATUS_REG_V_MASK 0x00000001 -#define EFUSE_INT_STATUS_REG_V_GET(x) (((x) & EFUSE_INT_STATUS_REG_V_MASK) >> EFUSE_INT_STATUS_REG_V_LSB) -#define EFUSE_INT_STATUS_REG_V_SET(x) (((x) << EFUSE_INT_STATUS_REG_V_LSB) & EFUSE_INT_STATUS_REG_V_MASK) - -#define BITMASK_WR_REG_ADDRESS 0x0000000c -#define BITMASK_WR_REG_OFFSET 0x0000000c -#define BITMASK_WR_REG_V_MSB 31 -#define BITMASK_WR_REG_V_LSB 0 -#define BITMASK_WR_REG_V_MASK 0xffffffff -#define BITMASK_WR_REG_V_GET(x) (((x) & BITMASK_WR_REG_V_MASK) >> BITMASK_WR_REG_V_LSB) -#define BITMASK_WR_REG_V_SET(x) (((x) << BITMASK_WR_REG_V_LSB) & BITMASK_WR_REG_V_MASK) - -#define VDDQ_SETTLE_TIME_REG_ADDRESS 0x00000010 -#define VDDQ_SETTLE_TIME_REG_OFFSET 0x00000010 -#define VDDQ_SETTLE_TIME_REG_V_MSB 31 -#define VDDQ_SETTLE_TIME_REG_V_LSB 0 -#define VDDQ_SETTLE_TIME_REG_V_MASK 0xffffffff -#define VDDQ_SETTLE_TIME_REG_V_GET(x) (((x) & VDDQ_SETTLE_TIME_REG_V_MASK) >> VDDQ_SETTLE_TIME_REG_V_LSB) -#define VDDQ_SETTLE_TIME_REG_V_SET(x) (((x) << VDDQ_SETTLE_TIME_REG_V_LSB) & VDDQ_SETTLE_TIME_REG_V_MASK) - -#define RD_STROBE_PW_REG_ADDRESS 0x00000014 -#define RD_STROBE_PW_REG_OFFSET 0x00000014 -#define RD_STROBE_PW_REG_V_MSB 31 -#define RD_STROBE_PW_REG_V_LSB 0 -#define RD_STROBE_PW_REG_V_MASK 0xffffffff -#define RD_STROBE_PW_REG_V_GET(x) (((x) & RD_STROBE_PW_REG_V_MASK) >> RD_STROBE_PW_REG_V_LSB) -#define RD_STROBE_PW_REG_V_SET(x) (((x) << RD_STROBE_PW_REG_V_LSB) & RD_STROBE_PW_REG_V_MASK) - -#define PG_STROBE_PW_REG_ADDRESS 0x00000018 -#define PG_STROBE_PW_REG_OFFSET 0x00000018 -#define PG_STROBE_PW_REG_V_MSB 31 -#define PG_STROBE_PW_REG_V_LSB 0 -#define PG_STROBE_PW_REG_V_MASK 0xffffffff -#define PG_STROBE_PW_REG_V_GET(x) (((x) & PG_STROBE_PW_REG_V_MASK) >> PG_STROBE_PW_REG_V_LSB) -#define PG_STROBE_PW_REG_V_SET(x) (((x) << PG_STROBE_PW_REG_V_LSB) & PG_STROBE_PW_REG_V_MASK) - -#define EFUSE_INTF_ADDRESS 0x00000800 -#define EFUSE_INTF_OFFSET 0x00000800 -#define EFUSE_INTF_R_MSB 31 -#define EFUSE_INTF_R_LSB 0 -#define EFUSE_INTF_R_MASK 0xffffffff -#define EFUSE_INTF_R_GET(x) (((x) & EFUSE_INTF_R_MASK) >> EFUSE_INTF_R_LSB) -#define EFUSE_INTF_R_SET(x) (((x) << EFUSE_INTF_R_LSB) & EFUSE_INTF_R_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct efuse_reg_reg_s { - volatile unsigned int efuse_wr_enable_reg; - volatile unsigned int efuse_int_enable_reg; - volatile unsigned int efuse_int_status_reg; - volatile unsigned int bitmask_wr_reg; - volatile unsigned int vddq_settle_time_reg; - volatile unsigned int rd_strobe_pw_reg; - volatile unsigned int pg_strobe_pw_reg; - unsigned char pad0[2020]; /* pad to 0x800 */ - volatile unsigned int efuse_intf[512]; -} efuse_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _EFUSE_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/gpio_athr_wlan_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/gpio_athr_wlan_reg.h deleted file mode 100644 index 99e28885f337..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/gpio_athr_wlan_reg.h +++ /dev/null @@ -1,1253 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _GPIO_ATHR_WLAN_REG_REG_H_ -#define _GPIO_ATHR_WLAN_REG_REG_H_ - -#define WLAN_GPIO_OUT_ADDRESS 0x00000000 -#define WLAN_GPIO_OUT_OFFSET 0x00000000 -#define WLAN_GPIO_OUT_DATA_MSB 25 -#define WLAN_GPIO_OUT_DATA_LSB 0 -#define WLAN_GPIO_OUT_DATA_MASK 0x03ffffff -#define WLAN_GPIO_OUT_DATA_GET(x) (((x) & WLAN_GPIO_OUT_DATA_MASK) >> WLAN_GPIO_OUT_DATA_LSB) -#define WLAN_GPIO_OUT_DATA_SET(x) (((x) << WLAN_GPIO_OUT_DATA_LSB) & WLAN_GPIO_OUT_DATA_MASK) - -#define WLAN_GPIO_OUT_W1TS_ADDRESS 0x00000004 -#define WLAN_GPIO_OUT_W1TS_OFFSET 0x00000004 -#define WLAN_GPIO_OUT_W1TS_DATA_MSB 25 -#define WLAN_GPIO_OUT_W1TS_DATA_LSB 0 -#define WLAN_GPIO_OUT_W1TS_DATA_MASK 0x03ffffff -#define WLAN_GPIO_OUT_W1TS_DATA_GET(x) (((x) & WLAN_GPIO_OUT_W1TS_DATA_MASK) >> WLAN_GPIO_OUT_W1TS_DATA_LSB) -#define WLAN_GPIO_OUT_W1TS_DATA_SET(x) (((x) << WLAN_GPIO_OUT_W1TS_DATA_LSB) & WLAN_GPIO_OUT_W1TS_DATA_MASK) - -#define WLAN_GPIO_OUT_W1TC_ADDRESS 0x00000008 -#define WLAN_GPIO_OUT_W1TC_OFFSET 0x00000008 -#define WLAN_GPIO_OUT_W1TC_DATA_MSB 25 -#define WLAN_GPIO_OUT_W1TC_DATA_LSB 0 -#define WLAN_GPIO_OUT_W1TC_DATA_MASK 0x03ffffff -#define WLAN_GPIO_OUT_W1TC_DATA_GET(x) (((x) & WLAN_GPIO_OUT_W1TC_DATA_MASK) >> WLAN_GPIO_OUT_W1TC_DATA_LSB) -#define WLAN_GPIO_OUT_W1TC_DATA_SET(x) (((x) << WLAN_GPIO_OUT_W1TC_DATA_LSB) & WLAN_GPIO_OUT_W1TC_DATA_MASK) - -#define WLAN_GPIO_ENABLE_ADDRESS 0x0000000c -#define WLAN_GPIO_ENABLE_OFFSET 0x0000000c -#define WLAN_GPIO_ENABLE_DATA_MSB 25 -#define WLAN_GPIO_ENABLE_DATA_LSB 0 -#define WLAN_GPIO_ENABLE_DATA_MASK 0x03ffffff -#define WLAN_GPIO_ENABLE_DATA_GET(x) (((x) & WLAN_GPIO_ENABLE_DATA_MASK) >> WLAN_GPIO_ENABLE_DATA_LSB) -#define WLAN_GPIO_ENABLE_DATA_SET(x) (((x) << WLAN_GPIO_ENABLE_DATA_LSB) & WLAN_GPIO_ENABLE_DATA_MASK) - -#define WLAN_GPIO_ENABLE_W1TS_ADDRESS 0x00000010 -#define WLAN_GPIO_ENABLE_W1TS_OFFSET 0x00000010 -#define WLAN_GPIO_ENABLE_W1TS_DATA_MSB 25 -#define WLAN_GPIO_ENABLE_W1TS_DATA_LSB 0 -#define WLAN_GPIO_ENABLE_W1TS_DATA_MASK 0x03ffffff -#define WLAN_GPIO_ENABLE_W1TS_DATA_GET(x) (((x) & WLAN_GPIO_ENABLE_W1TS_DATA_MASK) >> WLAN_GPIO_ENABLE_W1TS_DATA_LSB) -#define WLAN_GPIO_ENABLE_W1TS_DATA_SET(x) (((x) << WLAN_GPIO_ENABLE_W1TS_DATA_LSB) & WLAN_GPIO_ENABLE_W1TS_DATA_MASK) - -#define WLAN_GPIO_ENABLE_W1TC_ADDRESS 0x00000014 -#define WLAN_GPIO_ENABLE_W1TC_OFFSET 0x00000014 -#define WLAN_GPIO_ENABLE_W1TC_DATA_MSB 25 -#define WLAN_GPIO_ENABLE_W1TC_DATA_LSB 0 -#define WLAN_GPIO_ENABLE_W1TC_DATA_MASK 0x03ffffff -#define WLAN_GPIO_ENABLE_W1TC_DATA_GET(x) (((x) & WLAN_GPIO_ENABLE_W1TC_DATA_MASK) >> WLAN_GPIO_ENABLE_W1TC_DATA_LSB) -#define WLAN_GPIO_ENABLE_W1TC_DATA_SET(x) (((x) << WLAN_GPIO_ENABLE_W1TC_DATA_LSB) & WLAN_GPIO_ENABLE_W1TC_DATA_MASK) - -#define WLAN_GPIO_IN_ADDRESS 0x00000018 -#define WLAN_GPIO_IN_OFFSET 0x00000018 -#define WLAN_GPIO_IN_DATA_MSB 25 -#define WLAN_GPIO_IN_DATA_LSB 0 -#define WLAN_GPIO_IN_DATA_MASK 0x03ffffff -#define WLAN_GPIO_IN_DATA_GET(x) (((x) & WLAN_GPIO_IN_DATA_MASK) >> WLAN_GPIO_IN_DATA_LSB) -#define WLAN_GPIO_IN_DATA_SET(x) (((x) << WLAN_GPIO_IN_DATA_LSB) & WLAN_GPIO_IN_DATA_MASK) - -#define WLAN_GPIO_STATUS_ADDRESS 0x0000001c -#define WLAN_GPIO_STATUS_OFFSET 0x0000001c -#define WLAN_GPIO_STATUS_INTERRUPT_MSB 25 -#define WLAN_GPIO_STATUS_INTERRUPT_LSB 0 -#define WLAN_GPIO_STATUS_INTERRUPT_MASK 0x03ffffff -#define WLAN_GPIO_STATUS_INTERRUPT_GET(x) (((x) & WLAN_GPIO_STATUS_INTERRUPT_MASK) >> WLAN_GPIO_STATUS_INTERRUPT_LSB) -#define WLAN_GPIO_STATUS_INTERRUPT_SET(x) (((x) << WLAN_GPIO_STATUS_INTERRUPT_LSB) & WLAN_GPIO_STATUS_INTERRUPT_MASK) - -#define WLAN_GPIO_STATUS_W1TS_ADDRESS 0x00000020 -#define WLAN_GPIO_STATUS_W1TS_OFFSET 0x00000020 -#define WLAN_GPIO_STATUS_W1TS_INTERRUPT_MSB 25 -#define WLAN_GPIO_STATUS_W1TS_INTERRUPT_LSB 0 -#define WLAN_GPIO_STATUS_W1TS_INTERRUPT_MASK 0x03ffffff -#define WLAN_GPIO_STATUS_W1TS_INTERRUPT_GET(x) (((x) & WLAN_GPIO_STATUS_W1TS_INTERRUPT_MASK) >> WLAN_GPIO_STATUS_W1TS_INTERRUPT_LSB) -#define WLAN_GPIO_STATUS_W1TS_INTERRUPT_SET(x) (((x) << WLAN_GPIO_STATUS_W1TS_INTERRUPT_LSB) & WLAN_GPIO_STATUS_W1TS_INTERRUPT_MASK) - -#define WLAN_GPIO_STATUS_W1TC_ADDRESS 0x00000024 -#define WLAN_GPIO_STATUS_W1TC_OFFSET 0x00000024 -#define WLAN_GPIO_STATUS_W1TC_INTERRUPT_MSB 25 -#define WLAN_GPIO_STATUS_W1TC_INTERRUPT_LSB 0 -#define WLAN_GPIO_STATUS_W1TC_INTERRUPT_MASK 0x03ffffff -#define WLAN_GPIO_STATUS_W1TC_INTERRUPT_GET(x) (((x) & WLAN_GPIO_STATUS_W1TC_INTERRUPT_MASK) >> WLAN_GPIO_STATUS_W1TC_INTERRUPT_LSB) -#define WLAN_GPIO_STATUS_W1TC_INTERRUPT_SET(x) (((x) << WLAN_GPIO_STATUS_W1TC_INTERRUPT_LSB) & WLAN_GPIO_STATUS_W1TC_INTERRUPT_MASK) - -#define WLAN_GPIO_PIN0_ADDRESS 0x00000028 -#define WLAN_GPIO_PIN0_OFFSET 0x00000028 -#define WLAN_GPIO_PIN0_CONFIG_MSB 13 -#define WLAN_GPIO_PIN0_CONFIG_LSB 11 -#define WLAN_GPIO_PIN0_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN0_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN0_CONFIG_MASK) >> WLAN_GPIO_PIN0_CONFIG_LSB) -#define WLAN_GPIO_PIN0_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN0_CONFIG_LSB) & WLAN_GPIO_PIN0_CONFIG_MASK) -#define WLAN_GPIO_PIN0_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN0_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN0_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN0_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN0_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN0_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN0_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN0_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN0_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN0_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN0_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN0_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN0_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN0_INT_TYPE_MASK) >> WLAN_GPIO_PIN0_INT_TYPE_LSB) -#define WLAN_GPIO_PIN0_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN0_INT_TYPE_LSB) & WLAN_GPIO_PIN0_INT_TYPE_MASK) -#define WLAN_GPIO_PIN0_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN0_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN0_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN0_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN0_PAD_PULL_MASK) >> WLAN_GPIO_PIN0_PAD_PULL_LSB) -#define WLAN_GPIO_PIN0_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN0_PAD_PULL_LSB) & WLAN_GPIO_PIN0_PAD_PULL_MASK) -#define WLAN_GPIO_PIN0_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN0_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN0_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN0_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN0_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN0_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN0_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN0_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN0_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN0_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN0_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN0_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN0_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN0_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN0_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN0_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN0_PAD_DRIVER_LSB) & WLAN_GPIO_PIN0_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN0_SOURCE_MSB 0 -#define WLAN_GPIO_PIN0_SOURCE_LSB 0 -#define WLAN_GPIO_PIN0_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN0_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN0_SOURCE_MASK) >> WLAN_GPIO_PIN0_SOURCE_LSB) -#define WLAN_GPIO_PIN0_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN0_SOURCE_LSB) & WLAN_GPIO_PIN0_SOURCE_MASK) - -#define WLAN_GPIO_PIN1_ADDRESS 0x0000002c -#define WLAN_GPIO_PIN1_OFFSET 0x0000002c -#define WLAN_GPIO_PIN1_CONFIG_MSB 13 -#define WLAN_GPIO_PIN1_CONFIG_LSB 11 -#define WLAN_GPIO_PIN1_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN1_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN1_CONFIG_MASK) >> WLAN_GPIO_PIN1_CONFIG_LSB) -#define WLAN_GPIO_PIN1_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN1_CONFIG_LSB) & WLAN_GPIO_PIN1_CONFIG_MASK) -#define WLAN_GPIO_PIN1_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN1_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN1_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN1_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN1_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN1_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN1_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN1_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN1_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN1_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN1_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN1_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN1_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN1_INT_TYPE_MASK) >> WLAN_GPIO_PIN1_INT_TYPE_LSB) -#define WLAN_GPIO_PIN1_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN1_INT_TYPE_LSB) & WLAN_GPIO_PIN1_INT_TYPE_MASK) -#define WLAN_GPIO_PIN1_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN1_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN1_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN1_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN1_PAD_PULL_MASK) >> WLAN_GPIO_PIN1_PAD_PULL_LSB) -#define WLAN_GPIO_PIN1_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN1_PAD_PULL_LSB) & WLAN_GPIO_PIN1_PAD_PULL_MASK) -#define WLAN_GPIO_PIN1_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN1_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN1_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN1_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN1_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN1_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN1_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN1_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN1_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN1_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN1_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN1_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN1_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN1_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN1_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN1_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN1_PAD_DRIVER_LSB) & WLAN_GPIO_PIN1_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN1_SOURCE_MSB 0 -#define WLAN_GPIO_PIN1_SOURCE_LSB 0 -#define WLAN_GPIO_PIN1_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN1_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN1_SOURCE_MASK) >> WLAN_GPIO_PIN1_SOURCE_LSB) -#define WLAN_GPIO_PIN1_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN1_SOURCE_LSB) & WLAN_GPIO_PIN1_SOURCE_MASK) - -#define WLAN_GPIO_PIN2_ADDRESS 0x00000030 -#define WLAN_GPIO_PIN2_OFFSET 0x00000030 -#define WLAN_GPIO_PIN2_CONFIG_MSB 13 -#define WLAN_GPIO_PIN2_CONFIG_LSB 11 -#define WLAN_GPIO_PIN2_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN2_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN2_CONFIG_MASK) >> WLAN_GPIO_PIN2_CONFIG_LSB) -#define WLAN_GPIO_PIN2_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN2_CONFIG_LSB) & WLAN_GPIO_PIN2_CONFIG_MASK) -#define WLAN_GPIO_PIN2_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN2_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN2_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN2_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN2_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN2_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN2_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN2_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN2_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN2_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN2_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN2_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN2_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN2_INT_TYPE_MASK) >> WLAN_GPIO_PIN2_INT_TYPE_LSB) -#define WLAN_GPIO_PIN2_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN2_INT_TYPE_LSB) & WLAN_GPIO_PIN2_INT_TYPE_MASK) -#define WLAN_GPIO_PIN2_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN2_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN2_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN2_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN2_PAD_PULL_MASK) >> WLAN_GPIO_PIN2_PAD_PULL_LSB) -#define WLAN_GPIO_PIN2_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN2_PAD_PULL_LSB) & WLAN_GPIO_PIN2_PAD_PULL_MASK) -#define WLAN_GPIO_PIN2_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN2_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN2_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN2_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN2_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN2_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN2_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN2_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN2_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN2_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN2_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN2_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN2_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN2_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN2_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN2_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN2_PAD_DRIVER_LSB) & WLAN_GPIO_PIN2_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN2_SOURCE_MSB 0 -#define WLAN_GPIO_PIN2_SOURCE_LSB 0 -#define WLAN_GPIO_PIN2_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN2_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN2_SOURCE_MASK) >> WLAN_GPIO_PIN2_SOURCE_LSB) -#define WLAN_GPIO_PIN2_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN2_SOURCE_LSB) & WLAN_GPIO_PIN2_SOURCE_MASK) - -#define WLAN_GPIO_PIN3_ADDRESS 0x00000034 -#define WLAN_GPIO_PIN3_OFFSET 0x00000034 -#define WLAN_GPIO_PIN3_CONFIG_MSB 13 -#define WLAN_GPIO_PIN3_CONFIG_LSB 11 -#define WLAN_GPIO_PIN3_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN3_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN3_CONFIG_MASK) >> WLAN_GPIO_PIN3_CONFIG_LSB) -#define WLAN_GPIO_PIN3_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN3_CONFIG_LSB) & WLAN_GPIO_PIN3_CONFIG_MASK) -#define WLAN_GPIO_PIN3_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN3_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN3_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN3_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN3_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN3_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN3_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN3_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN3_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN3_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN3_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN3_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN3_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN3_INT_TYPE_MASK) >> WLAN_GPIO_PIN3_INT_TYPE_LSB) -#define WLAN_GPIO_PIN3_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN3_INT_TYPE_LSB) & WLAN_GPIO_PIN3_INT_TYPE_MASK) -#define WLAN_GPIO_PIN3_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN3_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN3_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN3_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN3_PAD_PULL_MASK) >> WLAN_GPIO_PIN3_PAD_PULL_LSB) -#define WLAN_GPIO_PIN3_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN3_PAD_PULL_LSB) & WLAN_GPIO_PIN3_PAD_PULL_MASK) -#define WLAN_GPIO_PIN3_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN3_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN3_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN3_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN3_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN3_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN3_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN3_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN3_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN3_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN3_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN3_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN3_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN3_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN3_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN3_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN3_PAD_DRIVER_LSB) & WLAN_GPIO_PIN3_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN3_SOURCE_MSB 0 -#define WLAN_GPIO_PIN3_SOURCE_LSB 0 -#define WLAN_GPIO_PIN3_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN3_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN3_SOURCE_MASK) >> WLAN_GPIO_PIN3_SOURCE_LSB) -#define WLAN_GPIO_PIN3_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN3_SOURCE_LSB) & WLAN_GPIO_PIN3_SOURCE_MASK) - -#define WLAN_GPIO_PIN4_ADDRESS 0x00000038 -#define WLAN_GPIO_PIN4_OFFSET 0x00000038 -#define WLAN_GPIO_PIN4_CONFIG_MSB 13 -#define WLAN_GPIO_PIN4_CONFIG_LSB 11 -#define WLAN_GPIO_PIN4_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN4_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN4_CONFIG_MASK) >> WLAN_GPIO_PIN4_CONFIG_LSB) -#define WLAN_GPIO_PIN4_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN4_CONFIG_LSB) & WLAN_GPIO_PIN4_CONFIG_MASK) -#define WLAN_GPIO_PIN4_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN4_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN4_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN4_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN4_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN4_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN4_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN4_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN4_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN4_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN4_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN4_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN4_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN4_INT_TYPE_MASK) >> WLAN_GPIO_PIN4_INT_TYPE_LSB) -#define WLAN_GPIO_PIN4_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN4_INT_TYPE_LSB) & WLAN_GPIO_PIN4_INT_TYPE_MASK) -#define WLAN_GPIO_PIN4_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN4_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN4_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN4_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN4_PAD_PULL_MASK) >> WLAN_GPIO_PIN4_PAD_PULL_LSB) -#define WLAN_GPIO_PIN4_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN4_PAD_PULL_LSB) & WLAN_GPIO_PIN4_PAD_PULL_MASK) -#define WLAN_GPIO_PIN4_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN4_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN4_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN4_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN4_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN4_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN4_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN4_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN4_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN4_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN4_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN4_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN4_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN4_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN4_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN4_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN4_PAD_DRIVER_LSB) & WLAN_GPIO_PIN4_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN4_SOURCE_MSB 0 -#define WLAN_GPIO_PIN4_SOURCE_LSB 0 -#define WLAN_GPIO_PIN4_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN4_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN4_SOURCE_MASK) >> WLAN_GPIO_PIN4_SOURCE_LSB) -#define WLAN_GPIO_PIN4_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN4_SOURCE_LSB) & WLAN_GPIO_PIN4_SOURCE_MASK) - -#define WLAN_GPIO_PIN5_ADDRESS 0x0000003c -#define WLAN_GPIO_PIN5_OFFSET 0x0000003c -#define WLAN_GPIO_PIN5_CONFIG_MSB 13 -#define WLAN_GPIO_PIN5_CONFIG_LSB 11 -#define WLAN_GPIO_PIN5_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN5_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN5_CONFIG_MASK) >> WLAN_GPIO_PIN5_CONFIG_LSB) -#define WLAN_GPIO_PIN5_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN5_CONFIG_LSB) & WLAN_GPIO_PIN5_CONFIG_MASK) -#define WLAN_GPIO_PIN5_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN5_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN5_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN5_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN5_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN5_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN5_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN5_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN5_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN5_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN5_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN5_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN5_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN5_INT_TYPE_MASK) >> WLAN_GPIO_PIN5_INT_TYPE_LSB) -#define WLAN_GPIO_PIN5_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN5_INT_TYPE_LSB) & WLAN_GPIO_PIN5_INT_TYPE_MASK) -#define WLAN_GPIO_PIN5_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN5_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN5_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN5_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN5_PAD_PULL_MASK) >> WLAN_GPIO_PIN5_PAD_PULL_LSB) -#define WLAN_GPIO_PIN5_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN5_PAD_PULL_LSB) & WLAN_GPIO_PIN5_PAD_PULL_MASK) -#define WLAN_GPIO_PIN5_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN5_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN5_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN5_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN5_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN5_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN5_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN5_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN5_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN5_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN5_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN5_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN5_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN5_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN5_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN5_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN5_PAD_DRIVER_LSB) & WLAN_GPIO_PIN5_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN5_SOURCE_MSB 0 -#define WLAN_GPIO_PIN5_SOURCE_LSB 0 -#define WLAN_GPIO_PIN5_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN5_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN5_SOURCE_MASK) >> WLAN_GPIO_PIN5_SOURCE_LSB) -#define WLAN_GPIO_PIN5_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN5_SOURCE_LSB) & WLAN_GPIO_PIN5_SOURCE_MASK) - -#define WLAN_GPIO_PIN6_ADDRESS 0x00000040 -#define WLAN_GPIO_PIN6_OFFSET 0x00000040 -#define WLAN_GPIO_PIN6_CONFIG_MSB 13 -#define WLAN_GPIO_PIN6_CONFIG_LSB 11 -#define WLAN_GPIO_PIN6_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN6_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN6_CONFIG_MASK) >> WLAN_GPIO_PIN6_CONFIG_LSB) -#define WLAN_GPIO_PIN6_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN6_CONFIG_LSB) & WLAN_GPIO_PIN6_CONFIG_MASK) -#define WLAN_GPIO_PIN6_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN6_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN6_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN6_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN6_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN6_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN6_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN6_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN6_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN6_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN6_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN6_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN6_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN6_INT_TYPE_MASK) >> WLAN_GPIO_PIN6_INT_TYPE_LSB) -#define WLAN_GPIO_PIN6_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN6_INT_TYPE_LSB) & WLAN_GPIO_PIN6_INT_TYPE_MASK) -#define WLAN_GPIO_PIN6_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN6_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN6_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN6_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN6_PAD_PULL_MASK) >> WLAN_GPIO_PIN6_PAD_PULL_LSB) -#define WLAN_GPIO_PIN6_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN6_PAD_PULL_LSB) & WLAN_GPIO_PIN6_PAD_PULL_MASK) -#define WLAN_GPIO_PIN6_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN6_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN6_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN6_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN6_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN6_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN6_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN6_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN6_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN6_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN6_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN6_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN6_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN6_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN6_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN6_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN6_PAD_DRIVER_LSB) & WLAN_GPIO_PIN6_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN6_SOURCE_MSB 0 -#define WLAN_GPIO_PIN6_SOURCE_LSB 0 -#define WLAN_GPIO_PIN6_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN6_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN6_SOURCE_MASK) >> WLAN_GPIO_PIN6_SOURCE_LSB) -#define WLAN_GPIO_PIN6_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN6_SOURCE_LSB) & WLAN_GPIO_PIN6_SOURCE_MASK) - -#define WLAN_GPIO_PIN7_ADDRESS 0x00000044 -#define WLAN_GPIO_PIN7_OFFSET 0x00000044 -#define WLAN_GPIO_PIN7_CONFIG_MSB 13 -#define WLAN_GPIO_PIN7_CONFIG_LSB 11 -#define WLAN_GPIO_PIN7_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN7_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN7_CONFIG_MASK) >> WLAN_GPIO_PIN7_CONFIG_LSB) -#define WLAN_GPIO_PIN7_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN7_CONFIG_LSB) & WLAN_GPIO_PIN7_CONFIG_MASK) -#define WLAN_GPIO_PIN7_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN7_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN7_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN7_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN7_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN7_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN7_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN7_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN7_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN7_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN7_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN7_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN7_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN7_INT_TYPE_MASK) >> WLAN_GPIO_PIN7_INT_TYPE_LSB) -#define WLAN_GPIO_PIN7_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN7_INT_TYPE_LSB) & WLAN_GPIO_PIN7_INT_TYPE_MASK) -#define WLAN_GPIO_PIN7_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN7_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN7_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN7_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN7_PAD_PULL_MASK) >> WLAN_GPIO_PIN7_PAD_PULL_LSB) -#define WLAN_GPIO_PIN7_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN7_PAD_PULL_LSB) & WLAN_GPIO_PIN7_PAD_PULL_MASK) -#define WLAN_GPIO_PIN7_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN7_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN7_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN7_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN7_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN7_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN7_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN7_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN7_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN7_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN7_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN7_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN7_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN7_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN7_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN7_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN7_PAD_DRIVER_LSB) & WLAN_GPIO_PIN7_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN7_SOURCE_MSB 0 -#define WLAN_GPIO_PIN7_SOURCE_LSB 0 -#define WLAN_GPIO_PIN7_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN7_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN7_SOURCE_MASK) >> WLAN_GPIO_PIN7_SOURCE_LSB) -#define WLAN_GPIO_PIN7_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN7_SOURCE_LSB) & WLAN_GPIO_PIN7_SOURCE_MASK) - -#define WLAN_GPIO_PIN8_ADDRESS 0x00000048 -#define WLAN_GPIO_PIN8_OFFSET 0x00000048 -#define WLAN_GPIO_PIN8_CONFIG_MSB 13 -#define WLAN_GPIO_PIN8_CONFIG_LSB 11 -#define WLAN_GPIO_PIN8_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN8_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN8_CONFIG_MASK) >> WLAN_GPIO_PIN8_CONFIG_LSB) -#define WLAN_GPIO_PIN8_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN8_CONFIG_LSB) & WLAN_GPIO_PIN8_CONFIG_MASK) -#define WLAN_GPIO_PIN8_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN8_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN8_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN8_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN8_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN8_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN8_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN8_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN8_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN8_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN8_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN8_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN8_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN8_INT_TYPE_MASK) >> WLAN_GPIO_PIN8_INT_TYPE_LSB) -#define WLAN_GPIO_PIN8_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN8_INT_TYPE_LSB) & WLAN_GPIO_PIN8_INT_TYPE_MASK) -#define WLAN_GPIO_PIN8_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN8_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN8_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN8_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN8_PAD_PULL_MASK) >> WLAN_GPIO_PIN8_PAD_PULL_LSB) -#define WLAN_GPIO_PIN8_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN8_PAD_PULL_LSB) & WLAN_GPIO_PIN8_PAD_PULL_MASK) -#define WLAN_GPIO_PIN8_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN8_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN8_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN8_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN8_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN8_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN8_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN8_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN8_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN8_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN8_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN8_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN8_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN8_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN8_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN8_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN8_PAD_DRIVER_LSB) & WLAN_GPIO_PIN8_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN8_SOURCE_MSB 0 -#define WLAN_GPIO_PIN8_SOURCE_LSB 0 -#define WLAN_GPIO_PIN8_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN8_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN8_SOURCE_MASK) >> WLAN_GPIO_PIN8_SOURCE_LSB) -#define WLAN_GPIO_PIN8_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN8_SOURCE_LSB) & WLAN_GPIO_PIN8_SOURCE_MASK) - -#define WLAN_GPIO_PIN9_ADDRESS 0x0000004c -#define WLAN_GPIO_PIN9_OFFSET 0x0000004c -#define WLAN_GPIO_PIN9_CONFIG_MSB 13 -#define WLAN_GPIO_PIN9_CONFIG_LSB 11 -#define WLAN_GPIO_PIN9_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN9_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN9_CONFIG_MASK) >> WLAN_GPIO_PIN9_CONFIG_LSB) -#define WLAN_GPIO_PIN9_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN9_CONFIG_LSB) & WLAN_GPIO_PIN9_CONFIG_MASK) -#define WLAN_GPIO_PIN9_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN9_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN9_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN9_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN9_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN9_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN9_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN9_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN9_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN9_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN9_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN9_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN9_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN9_INT_TYPE_MASK) >> WLAN_GPIO_PIN9_INT_TYPE_LSB) -#define WLAN_GPIO_PIN9_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN9_INT_TYPE_LSB) & WLAN_GPIO_PIN9_INT_TYPE_MASK) -#define WLAN_GPIO_PIN9_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN9_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN9_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN9_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN9_PAD_PULL_MASK) >> WLAN_GPIO_PIN9_PAD_PULL_LSB) -#define WLAN_GPIO_PIN9_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN9_PAD_PULL_LSB) & WLAN_GPIO_PIN9_PAD_PULL_MASK) -#define WLAN_GPIO_PIN9_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN9_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN9_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN9_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN9_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN9_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN9_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN9_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN9_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN9_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN9_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN9_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN9_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN9_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN9_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN9_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN9_PAD_DRIVER_LSB) & WLAN_GPIO_PIN9_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN9_SOURCE_MSB 0 -#define WLAN_GPIO_PIN9_SOURCE_LSB 0 -#define WLAN_GPIO_PIN9_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN9_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN9_SOURCE_MASK) >> WLAN_GPIO_PIN9_SOURCE_LSB) -#define WLAN_GPIO_PIN9_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN9_SOURCE_LSB) & WLAN_GPIO_PIN9_SOURCE_MASK) - -#define WLAN_GPIO_PIN10_ADDRESS 0x00000050 -#define WLAN_GPIO_PIN10_OFFSET 0x00000050 -#define WLAN_GPIO_PIN10_CONFIG_MSB 13 -#define WLAN_GPIO_PIN10_CONFIG_LSB 11 -#define WLAN_GPIO_PIN10_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN10_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN10_CONFIG_MASK) >> WLAN_GPIO_PIN10_CONFIG_LSB) -#define WLAN_GPIO_PIN10_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN10_CONFIG_LSB) & WLAN_GPIO_PIN10_CONFIG_MASK) -#define WLAN_GPIO_PIN10_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN10_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN10_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN10_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN10_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN10_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN10_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN10_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN10_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN10_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN10_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN10_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN10_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN10_INT_TYPE_MASK) >> WLAN_GPIO_PIN10_INT_TYPE_LSB) -#define WLAN_GPIO_PIN10_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN10_INT_TYPE_LSB) & WLAN_GPIO_PIN10_INT_TYPE_MASK) -#define WLAN_GPIO_PIN10_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN10_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN10_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN10_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN10_PAD_PULL_MASK) >> WLAN_GPIO_PIN10_PAD_PULL_LSB) -#define WLAN_GPIO_PIN10_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN10_PAD_PULL_LSB) & WLAN_GPIO_PIN10_PAD_PULL_MASK) -#define WLAN_GPIO_PIN10_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN10_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN10_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN10_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN10_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN10_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN10_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN10_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN10_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN10_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN10_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN10_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN10_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN10_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN10_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN10_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN10_PAD_DRIVER_LSB) & WLAN_GPIO_PIN10_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN10_SOURCE_MSB 0 -#define WLAN_GPIO_PIN10_SOURCE_LSB 0 -#define WLAN_GPIO_PIN10_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN10_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN10_SOURCE_MASK) >> WLAN_GPIO_PIN10_SOURCE_LSB) -#define WLAN_GPIO_PIN10_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN10_SOURCE_LSB) & WLAN_GPIO_PIN10_SOURCE_MASK) - -#define WLAN_GPIO_PIN11_ADDRESS 0x00000054 -#define WLAN_GPIO_PIN11_OFFSET 0x00000054 -#define WLAN_GPIO_PIN11_CONFIG_MSB 13 -#define WLAN_GPIO_PIN11_CONFIG_LSB 11 -#define WLAN_GPIO_PIN11_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN11_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN11_CONFIG_MASK) >> WLAN_GPIO_PIN11_CONFIG_LSB) -#define WLAN_GPIO_PIN11_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN11_CONFIG_LSB) & WLAN_GPIO_PIN11_CONFIG_MASK) -#define WLAN_GPIO_PIN11_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN11_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN11_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN11_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN11_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN11_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN11_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN11_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN11_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN11_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN11_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN11_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN11_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN11_INT_TYPE_MASK) >> WLAN_GPIO_PIN11_INT_TYPE_LSB) -#define WLAN_GPIO_PIN11_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN11_INT_TYPE_LSB) & WLAN_GPIO_PIN11_INT_TYPE_MASK) -#define WLAN_GPIO_PIN11_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN11_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN11_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN11_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN11_PAD_PULL_MASK) >> WLAN_GPIO_PIN11_PAD_PULL_LSB) -#define WLAN_GPIO_PIN11_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN11_PAD_PULL_LSB) & WLAN_GPIO_PIN11_PAD_PULL_MASK) -#define WLAN_GPIO_PIN11_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN11_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN11_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN11_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN11_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN11_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN11_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN11_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN11_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN11_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN11_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN11_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN11_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN11_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN11_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN11_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN11_PAD_DRIVER_LSB) & WLAN_GPIO_PIN11_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN11_SOURCE_MSB 0 -#define WLAN_GPIO_PIN11_SOURCE_LSB 0 -#define WLAN_GPIO_PIN11_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN11_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN11_SOURCE_MASK) >> WLAN_GPIO_PIN11_SOURCE_LSB) -#define WLAN_GPIO_PIN11_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN11_SOURCE_LSB) & WLAN_GPIO_PIN11_SOURCE_MASK) - -#define WLAN_GPIO_PIN12_ADDRESS 0x00000058 -#define WLAN_GPIO_PIN12_OFFSET 0x00000058 -#define WLAN_GPIO_PIN12_CONFIG_MSB 13 -#define WLAN_GPIO_PIN12_CONFIG_LSB 11 -#define WLAN_GPIO_PIN12_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN12_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN12_CONFIG_MASK) >> WLAN_GPIO_PIN12_CONFIG_LSB) -#define WLAN_GPIO_PIN12_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN12_CONFIG_LSB) & WLAN_GPIO_PIN12_CONFIG_MASK) -#define WLAN_GPIO_PIN12_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN12_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN12_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN12_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN12_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN12_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN12_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN12_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN12_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN12_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN12_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN12_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN12_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN12_INT_TYPE_MASK) >> WLAN_GPIO_PIN12_INT_TYPE_LSB) -#define WLAN_GPIO_PIN12_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN12_INT_TYPE_LSB) & WLAN_GPIO_PIN12_INT_TYPE_MASK) -#define WLAN_GPIO_PIN12_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN12_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN12_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN12_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN12_PAD_PULL_MASK) >> WLAN_GPIO_PIN12_PAD_PULL_LSB) -#define WLAN_GPIO_PIN12_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN12_PAD_PULL_LSB) & WLAN_GPIO_PIN12_PAD_PULL_MASK) -#define WLAN_GPIO_PIN12_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN12_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN12_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN12_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN12_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN12_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN12_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN12_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN12_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN12_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN12_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN12_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN12_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN12_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN12_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN12_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN12_PAD_DRIVER_LSB) & WLAN_GPIO_PIN12_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN12_SOURCE_MSB 0 -#define WLAN_GPIO_PIN12_SOURCE_LSB 0 -#define WLAN_GPIO_PIN12_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN12_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN12_SOURCE_MASK) >> WLAN_GPIO_PIN12_SOURCE_LSB) -#define WLAN_GPIO_PIN12_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN12_SOURCE_LSB) & WLAN_GPIO_PIN12_SOURCE_MASK) - -#define WLAN_GPIO_PIN13_ADDRESS 0x0000005c -#define WLAN_GPIO_PIN13_OFFSET 0x0000005c -#define WLAN_GPIO_PIN13_CONFIG_MSB 13 -#define WLAN_GPIO_PIN13_CONFIG_LSB 11 -#define WLAN_GPIO_PIN13_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN13_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN13_CONFIG_MASK) >> WLAN_GPIO_PIN13_CONFIG_LSB) -#define WLAN_GPIO_PIN13_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN13_CONFIG_LSB) & WLAN_GPIO_PIN13_CONFIG_MASK) -#define WLAN_GPIO_PIN13_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN13_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN13_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN13_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN13_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN13_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN13_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN13_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN13_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN13_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN13_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN13_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN13_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN13_INT_TYPE_MASK) >> WLAN_GPIO_PIN13_INT_TYPE_LSB) -#define WLAN_GPIO_PIN13_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN13_INT_TYPE_LSB) & WLAN_GPIO_PIN13_INT_TYPE_MASK) -#define WLAN_GPIO_PIN13_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN13_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN13_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN13_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN13_PAD_PULL_MASK) >> WLAN_GPIO_PIN13_PAD_PULL_LSB) -#define WLAN_GPIO_PIN13_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN13_PAD_PULL_LSB) & WLAN_GPIO_PIN13_PAD_PULL_MASK) -#define WLAN_GPIO_PIN13_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN13_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN13_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN13_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN13_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN13_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN13_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN13_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN13_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN13_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN13_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN13_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN13_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN13_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN13_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN13_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN13_PAD_DRIVER_LSB) & WLAN_GPIO_PIN13_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN13_SOURCE_MSB 0 -#define WLAN_GPIO_PIN13_SOURCE_LSB 0 -#define WLAN_GPIO_PIN13_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN13_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN13_SOURCE_MASK) >> WLAN_GPIO_PIN13_SOURCE_LSB) -#define WLAN_GPIO_PIN13_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN13_SOURCE_LSB) & WLAN_GPIO_PIN13_SOURCE_MASK) - -#define WLAN_GPIO_PIN14_ADDRESS 0x00000060 -#define WLAN_GPIO_PIN14_OFFSET 0x00000060 -#define WLAN_GPIO_PIN14_CONFIG_MSB 13 -#define WLAN_GPIO_PIN14_CONFIG_LSB 11 -#define WLAN_GPIO_PIN14_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN14_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN14_CONFIG_MASK) >> WLAN_GPIO_PIN14_CONFIG_LSB) -#define WLAN_GPIO_PIN14_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN14_CONFIG_LSB) & WLAN_GPIO_PIN14_CONFIG_MASK) -#define WLAN_GPIO_PIN14_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN14_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN14_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN14_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN14_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN14_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN14_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN14_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN14_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN14_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN14_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN14_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN14_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN14_INT_TYPE_MASK) >> WLAN_GPIO_PIN14_INT_TYPE_LSB) -#define WLAN_GPIO_PIN14_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN14_INT_TYPE_LSB) & WLAN_GPIO_PIN14_INT_TYPE_MASK) -#define WLAN_GPIO_PIN14_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN14_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN14_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN14_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN14_PAD_PULL_MASK) >> WLAN_GPIO_PIN14_PAD_PULL_LSB) -#define WLAN_GPIO_PIN14_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN14_PAD_PULL_LSB) & WLAN_GPIO_PIN14_PAD_PULL_MASK) -#define WLAN_GPIO_PIN14_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN14_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN14_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN14_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN14_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN14_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN14_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN14_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN14_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN14_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN14_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN14_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN14_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN14_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN14_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN14_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN14_PAD_DRIVER_LSB) & WLAN_GPIO_PIN14_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN14_SOURCE_MSB 0 -#define WLAN_GPIO_PIN14_SOURCE_LSB 0 -#define WLAN_GPIO_PIN14_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN14_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN14_SOURCE_MASK) >> WLAN_GPIO_PIN14_SOURCE_LSB) -#define WLAN_GPIO_PIN14_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN14_SOURCE_LSB) & WLAN_GPIO_PIN14_SOURCE_MASK) - -#define WLAN_GPIO_PIN15_ADDRESS 0x00000064 -#define WLAN_GPIO_PIN15_OFFSET 0x00000064 -#define WLAN_GPIO_PIN15_CONFIG_MSB 13 -#define WLAN_GPIO_PIN15_CONFIG_LSB 11 -#define WLAN_GPIO_PIN15_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN15_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN15_CONFIG_MASK) >> WLAN_GPIO_PIN15_CONFIG_LSB) -#define WLAN_GPIO_PIN15_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN15_CONFIG_LSB) & WLAN_GPIO_PIN15_CONFIG_MASK) -#define WLAN_GPIO_PIN15_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN15_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN15_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN15_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN15_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN15_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN15_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN15_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN15_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN15_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN15_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN15_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN15_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN15_INT_TYPE_MASK) >> WLAN_GPIO_PIN15_INT_TYPE_LSB) -#define WLAN_GPIO_PIN15_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN15_INT_TYPE_LSB) & WLAN_GPIO_PIN15_INT_TYPE_MASK) -#define WLAN_GPIO_PIN15_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN15_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN15_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN15_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN15_PAD_PULL_MASK) >> WLAN_GPIO_PIN15_PAD_PULL_LSB) -#define WLAN_GPIO_PIN15_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN15_PAD_PULL_LSB) & WLAN_GPIO_PIN15_PAD_PULL_MASK) -#define WLAN_GPIO_PIN15_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN15_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN15_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN15_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN15_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN15_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN15_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN15_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN15_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN15_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN15_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN15_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN15_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN15_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN15_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN15_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN15_PAD_DRIVER_LSB) & WLAN_GPIO_PIN15_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN15_SOURCE_MSB 0 -#define WLAN_GPIO_PIN15_SOURCE_LSB 0 -#define WLAN_GPIO_PIN15_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN15_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN15_SOURCE_MASK) >> WLAN_GPIO_PIN15_SOURCE_LSB) -#define WLAN_GPIO_PIN15_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN15_SOURCE_LSB) & WLAN_GPIO_PIN15_SOURCE_MASK) - -#define WLAN_GPIO_PIN16_ADDRESS 0x00000068 -#define WLAN_GPIO_PIN16_OFFSET 0x00000068 -#define WLAN_GPIO_PIN16_CONFIG_MSB 13 -#define WLAN_GPIO_PIN16_CONFIG_LSB 11 -#define WLAN_GPIO_PIN16_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN16_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN16_CONFIG_MASK) >> WLAN_GPIO_PIN16_CONFIG_LSB) -#define WLAN_GPIO_PIN16_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN16_CONFIG_LSB) & WLAN_GPIO_PIN16_CONFIG_MASK) -#define WLAN_GPIO_PIN16_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN16_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN16_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN16_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN16_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN16_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN16_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN16_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN16_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN16_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN16_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN16_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN16_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN16_INT_TYPE_MASK) >> WLAN_GPIO_PIN16_INT_TYPE_LSB) -#define WLAN_GPIO_PIN16_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN16_INT_TYPE_LSB) & WLAN_GPIO_PIN16_INT_TYPE_MASK) -#define WLAN_GPIO_PIN16_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN16_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN16_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN16_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN16_PAD_PULL_MASK) >> WLAN_GPIO_PIN16_PAD_PULL_LSB) -#define WLAN_GPIO_PIN16_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN16_PAD_PULL_LSB) & WLAN_GPIO_PIN16_PAD_PULL_MASK) -#define WLAN_GPIO_PIN16_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN16_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN16_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN16_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN16_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN16_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN16_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN16_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN16_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN16_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN16_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN16_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN16_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN16_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN16_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN16_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN16_PAD_DRIVER_LSB) & WLAN_GPIO_PIN16_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN16_SOURCE_MSB 0 -#define WLAN_GPIO_PIN16_SOURCE_LSB 0 -#define WLAN_GPIO_PIN16_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN16_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN16_SOURCE_MASK) >> WLAN_GPIO_PIN16_SOURCE_LSB) -#define WLAN_GPIO_PIN16_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN16_SOURCE_LSB) & WLAN_GPIO_PIN16_SOURCE_MASK) - -#define WLAN_GPIO_PIN17_ADDRESS 0x0000006c -#define WLAN_GPIO_PIN17_OFFSET 0x0000006c -#define WLAN_GPIO_PIN17_CONFIG_MSB 13 -#define WLAN_GPIO_PIN17_CONFIG_LSB 11 -#define WLAN_GPIO_PIN17_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN17_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN17_CONFIG_MASK) >> WLAN_GPIO_PIN17_CONFIG_LSB) -#define WLAN_GPIO_PIN17_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN17_CONFIG_LSB) & WLAN_GPIO_PIN17_CONFIG_MASK) -#define WLAN_GPIO_PIN17_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN17_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN17_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN17_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN17_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN17_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN17_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN17_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN17_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN17_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN17_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN17_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN17_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN17_INT_TYPE_MASK) >> WLAN_GPIO_PIN17_INT_TYPE_LSB) -#define WLAN_GPIO_PIN17_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN17_INT_TYPE_LSB) & WLAN_GPIO_PIN17_INT_TYPE_MASK) -#define WLAN_GPIO_PIN17_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN17_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN17_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN17_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN17_PAD_PULL_MASK) >> WLAN_GPIO_PIN17_PAD_PULL_LSB) -#define WLAN_GPIO_PIN17_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN17_PAD_PULL_LSB) & WLAN_GPIO_PIN17_PAD_PULL_MASK) -#define WLAN_GPIO_PIN17_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN17_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN17_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN17_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN17_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN17_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN17_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN17_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN17_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN17_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN17_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN17_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN17_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN17_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN17_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN17_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN17_PAD_DRIVER_LSB) & WLAN_GPIO_PIN17_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN17_SOURCE_MSB 0 -#define WLAN_GPIO_PIN17_SOURCE_LSB 0 -#define WLAN_GPIO_PIN17_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN17_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN17_SOURCE_MASK) >> WLAN_GPIO_PIN17_SOURCE_LSB) -#define WLAN_GPIO_PIN17_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN17_SOURCE_LSB) & WLAN_GPIO_PIN17_SOURCE_MASK) - -#define WLAN_GPIO_PIN18_ADDRESS 0x00000070 -#define WLAN_GPIO_PIN18_OFFSET 0x00000070 -#define WLAN_GPIO_PIN18_CONFIG_MSB 13 -#define WLAN_GPIO_PIN18_CONFIG_LSB 11 -#define WLAN_GPIO_PIN18_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN18_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN18_CONFIG_MASK) >> WLAN_GPIO_PIN18_CONFIG_LSB) -#define WLAN_GPIO_PIN18_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN18_CONFIG_LSB) & WLAN_GPIO_PIN18_CONFIG_MASK) -#define WLAN_GPIO_PIN18_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN18_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN18_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN18_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN18_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN18_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN18_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN18_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN18_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN18_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN18_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN18_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN18_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN18_INT_TYPE_MASK) >> WLAN_GPIO_PIN18_INT_TYPE_LSB) -#define WLAN_GPIO_PIN18_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN18_INT_TYPE_LSB) & WLAN_GPIO_PIN18_INT_TYPE_MASK) -#define WLAN_GPIO_PIN18_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN18_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN18_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN18_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN18_PAD_PULL_MASK) >> WLAN_GPIO_PIN18_PAD_PULL_LSB) -#define WLAN_GPIO_PIN18_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN18_PAD_PULL_LSB) & WLAN_GPIO_PIN18_PAD_PULL_MASK) -#define WLAN_GPIO_PIN18_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN18_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN18_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN18_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN18_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN18_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN18_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN18_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN18_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN18_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN18_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN18_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN18_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN18_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN18_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN18_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN18_PAD_DRIVER_LSB) & WLAN_GPIO_PIN18_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN18_SOURCE_MSB 0 -#define WLAN_GPIO_PIN18_SOURCE_LSB 0 -#define WLAN_GPIO_PIN18_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN18_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN18_SOURCE_MASK) >> WLAN_GPIO_PIN18_SOURCE_LSB) -#define WLAN_GPIO_PIN18_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN18_SOURCE_LSB) & WLAN_GPIO_PIN18_SOURCE_MASK) - -#define WLAN_GPIO_PIN19_ADDRESS 0x00000074 -#define WLAN_GPIO_PIN19_OFFSET 0x00000074 -#define WLAN_GPIO_PIN19_CONFIG_MSB 13 -#define WLAN_GPIO_PIN19_CONFIG_LSB 11 -#define WLAN_GPIO_PIN19_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN19_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN19_CONFIG_MASK) >> WLAN_GPIO_PIN19_CONFIG_LSB) -#define WLAN_GPIO_PIN19_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN19_CONFIG_LSB) & WLAN_GPIO_PIN19_CONFIG_MASK) -#define WLAN_GPIO_PIN19_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN19_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN19_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN19_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN19_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN19_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN19_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN19_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN19_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN19_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN19_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN19_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN19_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN19_INT_TYPE_MASK) >> WLAN_GPIO_PIN19_INT_TYPE_LSB) -#define WLAN_GPIO_PIN19_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN19_INT_TYPE_LSB) & WLAN_GPIO_PIN19_INT_TYPE_MASK) -#define WLAN_GPIO_PIN19_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN19_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN19_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN19_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN19_PAD_PULL_MASK) >> WLAN_GPIO_PIN19_PAD_PULL_LSB) -#define WLAN_GPIO_PIN19_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN19_PAD_PULL_LSB) & WLAN_GPIO_PIN19_PAD_PULL_MASK) -#define WLAN_GPIO_PIN19_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN19_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN19_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN19_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN19_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN19_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN19_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN19_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN19_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN19_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN19_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN19_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN19_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN19_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN19_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN19_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN19_PAD_DRIVER_LSB) & WLAN_GPIO_PIN19_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN19_SOURCE_MSB 0 -#define WLAN_GPIO_PIN19_SOURCE_LSB 0 -#define WLAN_GPIO_PIN19_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN19_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN19_SOURCE_MASK) >> WLAN_GPIO_PIN19_SOURCE_LSB) -#define WLAN_GPIO_PIN19_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN19_SOURCE_LSB) & WLAN_GPIO_PIN19_SOURCE_MASK) - -#define WLAN_GPIO_PIN20_ADDRESS 0x00000078 -#define WLAN_GPIO_PIN20_OFFSET 0x00000078 -#define WLAN_GPIO_PIN20_CONFIG_MSB 13 -#define WLAN_GPIO_PIN20_CONFIG_LSB 11 -#define WLAN_GPIO_PIN20_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN20_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN20_CONFIG_MASK) >> WLAN_GPIO_PIN20_CONFIG_LSB) -#define WLAN_GPIO_PIN20_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN20_CONFIG_LSB) & WLAN_GPIO_PIN20_CONFIG_MASK) -#define WLAN_GPIO_PIN20_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN20_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN20_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN20_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN20_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN20_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN20_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN20_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN20_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN20_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN20_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN20_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN20_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN20_INT_TYPE_MASK) >> WLAN_GPIO_PIN20_INT_TYPE_LSB) -#define WLAN_GPIO_PIN20_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN20_INT_TYPE_LSB) & WLAN_GPIO_PIN20_INT_TYPE_MASK) -#define WLAN_GPIO_PIN20_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN20_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN20_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN20_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN20_PAD_PULL_MASK) >> WLAN_GPIO_PIN20_PAD_PULL_LSB) -#define WLAN_GPIO_PIN20_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN20_PAD_PULL_LSB) & WLAN_GPIO_PIN20_PAD_PULL_MASK) -#define WLAN_GPIO_PIN20_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN20_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN20_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN20_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN20_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN20_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN20_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN20_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN20_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN20_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN20_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN20_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN20_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN20_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN20_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN20_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN20_PAD_DRIVER_LSB) & WLAN_GPIO_PIN20_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN20_SOURCE_MSB 0 -#define WLAN_GPIO_PIN20_SOURCE_LSB 0 -#define WLAN_GPIO_PIN20_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN20_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN20_SOURCE_MASK) >> WLAN_GPIO_PIN20_SOURCE_LSB) -#define WLAN_GPIO_PIN20_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN20_SOURCE_LSB) & WLAN_GPIO_PIN20_SOURCE_MASK) - -#define WLAN_GPIO_PIN21_ADDRESS 0x0000007c -#define WLAN_GPIO_PIN21_OFFSET 0x0000007c -#define WLAN_GPIO_PIN21_CONFIG_MSB 13 -#define WLAN_GPIO_PIN21_CONFIG_LSB 11 -#define WLAN_GPIO_PIN21_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN21_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN21_CONFIG_MASK) >> WLAN_GPIO_PIN21_CONFIG_LSB) -#define WLAN_GPIO_PIN21_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN21_CONFIG_LSB) & WLAN_GPIO_PIN21_CONFIG_MASK) -#define WLAN_GPIO_PIN21_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN21_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN21_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN21_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN21_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN21_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN21_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN21_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN21_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN21_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN21_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN21_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN21_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN21_INT_TYPE_MASK) >> WLAN_GPIO_PIN21_INT_TYPE_LSB) -#define WLAN_GPIO_PIN21_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN21_INT_TYPE_LSB) & WLAN_GPIO_PIN21_INT_TYPE_MASK) -#define WLAN_GPIO_PIN21_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN21_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN21_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN21_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN21_PAD_PULL_MASK) >> WLAN_GPIO_PIN21_PAD_PULL_LSB) -#define WLAN_GPIO_PIN21_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN21_PAD_PULL_LSB) & WLAN_GPIO_PIN21_PAD_PULL_MASK) -#define WLAN_GPIO_PIN21_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN21_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN21_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN21_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN21_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN21_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN21_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN21_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN21_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN21_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN21_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN21_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN21_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN21_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN21_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN21_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN21_PAD_DRIVER_LSB) & WLAN_GPIO_PIN21_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN21_SOURCE_MSB 0 -#define WLAN_GPIO_PIN21_SOURCE_LSB 0 -#define WLAN_GPIO_PIN21_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN21_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN21_SOURCE_MASK) >> WLAN_GPIO_PIN21_SOURCE_LSB) -#define WLAN_GPIO_PIN21_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN21_SOURCE_LSB) & WLAN_GPIO_PIN21_SOURCE_MASK) - -#define WLAN_GPIO_PIN22_ADDRESS 0x00000080 -#define WLAN_GPIO_PIN22_OFFSET 0x00000080 -#define WLAN_GPIO_PIN22_CONFIG_MSB 13 -#define WLAN_GPIO_PIN22_CONFIG_LSB 11 -#define WLAN_GPIO_PIN22_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN22_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN22_CONFIG_MASK) >> WLAN_GPIO_PIN22_CONFIG_LSB) -#define WLAN_GPIO_PIN22_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN22_CONFIG_LSB) & WLAN_GPIO_PIN22_CONFIG_MASK) -#define WLAN_GPIO_PIN22_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN22_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN22_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN22_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN22_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN22_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN22_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN22_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN22_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN22_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN22_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN22_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN22_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN22_INT_TYPE_MASK) >> WLAN_GPIO_PIN22_INT_TYPE_LSB) -#define WLAN_GPIO_PIN22_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN22_INT_TYPE_LSB) & WLAN_GPIO_PIN22_INT_TYPE_MASK) -#define WLAN_GPIO_PIN22_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN22_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN22_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN22_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN22_PAD_PULL_MASK) >> WLAN_GPIO_PIN22_PAD_PULL_LSB) -#define WLAN_GPIO_PIN22_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN22_PAD_PULL_LSB) & WLAN_GPIO_PIN22_PAD_PULL_MASK) -#define WLAN_GPIO_PIN22_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN22_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN22_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN22_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN22_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN22_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN22_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN22_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN22_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN22_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN22_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN22_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN22_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN22_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN22_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN22_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN22_PAD_DRIVER_LSB) & WLAN_GPIO_PIN22_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN22_SOURCE_MSB 0 -#define WLAN_GPIO_PIN22_SOURCE_LSB 0 -#define WLAN_GPIO_PIN22_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN22_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN22_SOURCE_MASK) >> WLAN_GPIO_PIN22_SOURCE_LSB) -#define WLAN_GPIO_PIN22_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN22_SOURCE_LSB) & WLAN_GPIO_PIN22_SOURCE_MASK) - -#define WLAN_GPIO_PIN23_ADDRESS 0x00000084 -#define WLAN_GPIO_PIN23_OFFSET 0x00000084 -#define WLAN_GPIO_PIN23_CONFIG_MSB 13 -#define WLAN_GPIO_PIN23_CONFIG_LSB 11 -#define WLAN_GPIO_PIN23_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN23_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN23_CONFIG_MASK) >> WLAN_GPIO_PIN23_CONFIG_LSB) -#define WLAN_GPIO_PIN23_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN23_CONFIG_LSB) & WLAN_GPIO_PIN23_CONFIG_MASK) -#define WLAN_GPIO_PIN23_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN23_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN23_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN23_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN23_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN23_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN23_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN23_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN23_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN23_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN23_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN23_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN23_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN23_INT_TYPE_MASK) >> WLAN_GPIO_PIN23_INT_TYPE_LSB) -#define WLAN_GPIO_PIN23_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN23_INT_TYPE_LSB) & WLAN_GPIO_PIN23_INT_TYPE_MASK) -#define WLAN_GPIO_PIN23_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN23_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN23_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN23_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN23_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN23_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN23_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN23_PAD_DRIVER_LSB) & WLAN_GPIO_PIN23_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN23_SOURCE_MSB 0 -#define WLAN_GPIO_PIN23_SOURCE_LSB 0 -#define WLAN_GPIO_PIN23_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN23_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN23_SOURCE_MASK) >> WLAN_GPIO_PIN23_SOURCE_LSB) -#define WLAN_GPIO_PIN23_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN23_SOURCE_LSB) & WLAN_GPIO_PIN23_SOURCE_MASK) - -#define WLAN_GPIO_PIN24_ADDRESS 0x00000088 -#define WLAN_GPIO_PIN24_OFFSET 0x00000088 -#define WLAN_GPIO_PIN24_CONFIG_MSB 13 -#define WLAN_GPIO_PIN24_CONFIG_LSB 11 -#define WLAN_GPIO_PIN24_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN24_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN24_CONFIG_MASK) >> WLAN_GPIO_PIN24_CONFIG_LSB) -#define WLAN_GPIO_PIN24_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN24_CONFIG_LSB) & WLAN_GPIO_PIN24_CONFIG_MASK) -#define WLAN_GPIO_PIN24_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN24_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN24_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN24_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN24_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN24_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN24_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN24_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN24_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN24_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN24_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN24_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN24_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN24_INT_TYPE_MASK) >> WLAN_GPIO_PIN24_INT_TYPE_LSB) -#define WLAN_GPIO_PIN24_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN24_INT_TYPE_LSB) & WLAN_GPIO_PIN24_INT_TYPE_MASK) -#define WLAN_GPIO_PIN24_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN24_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN24_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN24_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN24_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN24_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN24_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN24_PAD_DRIVER_LSB) & WLAN_GPIO_PIN24_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN24_SOURCE_MSB 0 -#define WLAN_GPIO_PIN24_SOURCE_LSB 0 -#define WLAN_GPIO_PIN24_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN24_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN24_SOURCE_MASK) >> WLAN_GPIO_PIN24_SOURCE_LSB) -#define WLAN_GPIO_PIN24_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN24_SOURCE_LSB) & WLAN_GPIO_PIN24_SOURCE_MASK) - -#define WLAN_GPIO_PIN25_ADDRESS 0x0000008c -#define WLAN_GPIO_PIN25_OFFSET 0x0000008c -#define WLAN_GPIO_PIN25_CONFIG_MSB 13 -#define WLAN_GPIO_PIN25_CONFIG_LSB 11 -#define WLAN_GPIO_PIN25_CONFIG_MASK 0x00003800 -#define WLAN_GPIO_PIN25_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN25_CONFIG_MASK) >> WLAN_GPIO_PIN25_CONFIG_LSB) -#define WLAN_GPIO_PIN25_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN25_CONFIG_LSB) & WLAN_GPIO_PIN25_CONFIG_MASK) -#define WLAN_GPIO_PIN25_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN25_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN25_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN25_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN25_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN25_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN25_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN25_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN25_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN25_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN25_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN25_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN25_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN25_INT_TYPE_MASK) >> WLAN_GPIO_PIN25_INT_TYPE_LSB) -#define WLAN_GPIO_PIN25_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN25_INT_TYPE_LSB) & WLAN_GPIO_PIN25_INT_TYPE_MASK) -#define WLAN_GPIO_PIN25_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN25_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN25_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN25_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN25_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN25_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN25_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN25_PAD_DRIVER_LSB) & WLAN_GPIO_PIN25_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN25_SOURCE_MSB 0 -#define WLAN_GPIO_PIN25_SOURCE_LSB 0 -#define WLAN_GPIO_PIN25_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN25_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN25_SOURCE_MASK) >> WLAN_GPIO_PIN25_SOURCE_LSB) -#define WLAN_GPIO_PIN25_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN25_SOURCE_LSB) & WLAN_GPIO_PIN25_SOURCE_MASK) - -#define SDIO_ADDRESS 0x00000090 -#define SDIO_OFFSET 0x00000090 -#define SDIO_PINS_EN_MSB 0 -#define SDIO_PINS_EN_LSB 0 -#define SDIO_PINS_EN_MASK 0x00000001 -#define SDIO_PINS_EN_GET(x) (((x) & SDIO_PINS_EN_MASK) >> SDIO_PINS_EN_LSB) -#define SDIO_PINS_EN_SET(x) (((x) << SDIO_PINS_EN_LSB) & SDIO_PINS_EN_MASK) - -#define FUNC_BUS_ADDRESS 0x00000094 -#define FUNC_BUS_OFFSET 0x00000094 -#define FUNC_BUS_GPIO_MODE_MSB 22 -#define FUNC_BUS_GPIO_MODE_LSB 22 -#define FUNC_BUS_GPIO_MODE_MASK 0x00400000 -#define FUNC_BUS_GPIO_MODE_GET(x) (((x) & FUNC_BUS_GPIO_MODE_MASK) >> FUNC_BUS_GPIO_MODE_LSB) -#define FUNC_BUS_GPIO_MODE_SET(x) (((x) << FUNC_BUS_GPIO_MODE_LSB) & FUNC_BUS_GPIO_MODE_MASK) -#define FUNC_BUS_OE_L_MSB 21 -#define FUNC_BUS_OE_L_LSB 0 -#define FUNC_BUS_OE_L_MASK 0x003fffff -#define FUNC_BUS_OE_L_GET(x) (((x) & FUNC_BUS_OE_L_MASK) >> FUNC_BUS_OE_L_LSB) -#define FUNC_BUS_OE_L_SET(x) (((x) << FUNC_BUS_OE_L_LSB) & FUNC_BUS_OE_L_MASK) - -#define WL_SOC_APB_ADDRESS 0x00000098 -#define WL_SOC_APB_OFFSET 0x00000098 -#define WL_SOC_APB_TOGGLE_MSB 0 -#define WL_SOC_APB_TOGGLE_LSB 0 -#define WL_SOC_APB_TOGGLE_MASK 0x00000001 -#define WL_SOC_APB_TOGGLE_GET(x) (((x) & WL_SOC_APB_TOGGLE_MASK) >> WL_SOC_APB_TOGGLE_LSB) -#define WL_SOC_APB_TOGGLE_SET(x) (((x) << WL_SOC_APB_TOGGLE_LSB) & WL_SOC_APB_TOGGLE_MASK) - -#define WLAN_SIGMA_DELTA_ADDRESS 0x0000009c -#define WLAN_SIGMA_DELTA_OFFSET 0x0000009c -#define WLAN_SIGMA_DELTA_ENABLE_MSB 16 -#define WLAN_SIGMA_DELTA_ENABLE_LSB 16 -#define WLAN_SIGMA_DELTA_ENABLE_MASK 0x00010000 -#define WLAN_SIGMA_DELTA_ENABLE_GET(x) (((x) & WLAN_SIGMA_DELTA_ENABLE_MASK) >> WLAN_SIGMA_DELTA_ENABLE_LSB) -#define WLAN_SIGMA_DELTA_ENABLE_SET(x) (((x) << WLAN_SIGMA_DELTA_ENABLE_LSB) & WLAN_SIGMA_DELTA_ENABLE_MASK) -#define WLAN_SIGMA_DELTA_PRESCALAR_MSB 15 -#define WLAN_SIGMA_DELTA_PRESCALAR_LSB 8 -#define WLAN_SIGMA_DELTA_PRESCALAR_MASK 0x0000ff00 -#define WLAN_SIGMA_DELTA_PRESCALAR_GET(x) (((x) & WLAN_SIGMA_DELTA_PRESCALAR_MASK) >> WLAN_SIGMA_DELTA_PRESCALAR_LSB) -#define WLAN_SIGMA_DELTA_PRESCALAR_SET(x) (((x) << WLAN_SIGMA_DELTA_PRESCALAR_LSB) & WLAN_SIGMA_DELTA_PRESCALAR_MASK) -#define WLAN_SIGMA_DELTA_TARGET_MSB 7 -#define WLAN_SIGMA_DELTA_TARGET_LSB 0 -#define WLAN_SIGMA_DELTA_TARGET_MASK 0x000000ff -#define WLAN_SIGMA_DELTA_TARGET_GET(x) (((x) & WLAN_SIGMA_DELTA_TARGET_MASK) >> WLAN_SIGMA_DELTA_TARGET_LSB) -#define WLAN_SIGMA_DELTA_TARGET_SET(x) (((x) << WLAN_SIGMA_DELTA_TARGET_LSB) & WLAN_SIGMA_DELTA_TARGET_MASK) - -#define WL_BOOTSTRAP_ADDRESS 0x000000a0 -#define WL_BOOTSTRAP_OFFSET 0x000000a0 -#define WL_BOOTSTRAP_STATUS_MSB 22 -#define WL_BOOTSTRAP_STATUS_LSB 0 -#define WL_BOOTSTRAP_STATUS_MASK 0x007fffff -#define WL_BOOTSTRAP_STATUS_GET(x) (((x) & WL_BOOTSTRAP_STATUS_MASK) >> WL_BOOTSTRAP_STATUS_LSB) -#define WL_BOOTSTRAP_STATUS_SET(x) (((x) << WL_BOOTSTRAP_STATUS_LSB) & WL_BOOTSTRAP_STATUS_MASK) - -#define CLOCK_GPIO_ADDRESS 0x000000a4 -#define CLOCK_GPIO_OFFSET 0x000000a4 -#define CLOCK_GPIO_CLK_REQ_OUT_EN_MSB 2 -#define CLOCK_GPIO_CLK_REQ_OUT_EN_LSB 2 -#define CLOCK_GPIO_CLK_REQ_OUT_EN_MASK 0x00000004 -#define CLOCK_GPIO_CLK_REQ_OUT_EN_GET(x) (((x) & CLOCK_GPIO_CLK_REQ_OUT_EN_MASK) >> CLOCK_GPIO_CLK_REQ_OUT_EN_LSB) -#define CLOCK_GPIO_CLK_REQ_OUT_EN_SET(x) (((x) << CLOCK_GPIO_CLK_REQ_OUT_EN_LSB) & CLOCK_GPIO_CLK_REQ_OUT_EN_MASK) -#define CLOCK_GPIO_BT_CLK_REQ_EN_MSB 1 -#define CLOCK_GPIO_BT_CLK_REQ_EN_LSB 1 -#define CLOCK_GPIO_BT_CLK_REQ_EN_MASK 0x00000002 -#define CLOCK_GPIO_BT_CLK_REQ_EN_GET(x) (((x) & CLOCK_GPIO_BT_CLK_REQ_EN_MASK) >> CLOCK_GPIO_BT_CLK_REQ_EN_LSB) -#define CLOCK_GPIO_BT_CLK_REQ_EN_SET(x) (((x) << CLOCK_GPIO_BT_CLK_REQ_EN_LSB) & CLOCK_GPIO_BT_CLK_REQ_EN_MASK) -#define CLOCK_GPIO_BT_CLK_OUT_EN_MSB 0 -#define CLOCK_GPIO_BT_CLK_OUT_EN_LSB 0 -#define CLOCK_GPIO_BT_CLK_OUT_EN_MASK 0x00000001 -#define CLOCK_GPIO_BT_CLK_OUT_EN_GET(x) (((x) & CLOCK_GPIO_BT_CLK_OUT_EN_MASK) >> CLOCK_GPIO_BT_CLK_OUT_EN_LSB) -#define CLOCK_GPIO_BT_CLK_OUT_EN_SET(x) (((x) << CLOCK_GPIO_BT_CLK_OUT_EN_LSB) & CLOCK_GPIO_BT_CLK_OUT_EN_MASK) - -#define WLAN_DEBUG_CONTROL_ADDRESS 0x000000a8 -#define WLAN_DEBUG_CONTROL_OFFSET 0x000000a8 -#define WLAN_DEBUG_CONTROL_ENABLE_MSB 0 -#define WLAN_DEBUG_CONTROL_ENABLE_LSB 0 -#define WLAN_DEBUG_CONTROL_ENABLE_MASK 0x00000001 -#define WLAN_DEBUG_CONTROL_ENABLE_GET(x) (((x) & WLAN_DEBUG_CONTROL_ENABLE_MASK) >> WLAN_DEBUG_CONTROL_ENABLE_LSB) -#define WLAN_DEBUG_CONTROL_ENABLE_SET(x) (((x) << WLAN_DEBUG_CONTROL_ENABLE_LSB) & WLAN_DEBUG_CONTROL_ENABLE_MASK) - -#define WLAN_DEBUG_INPUT_SEL_ADDRESS 0x000000ac -#define WLAN_DEBUG_INPUT_SEL_OFFSET 0x000000ac -#define WLAN_DEBUG_INPUT_SEL_SHIFT_MSB 5 -#define WLAN_DEBUG_INPUT_SEL_SHIFT_LSB 4 -#define WLAN_DEBUG_INPUT_SEL_SHIFT_MASK 0x00000030 -#define WLAN_DEBUG_INPUT_SEL_SHIFT_GET(x) (((x) & WLAN_DEBUG_INPUT_SEL_SHIFT_MASK) >> WLAN_DEBUG_INPUT_SEL_SHIFT_LSB) -#define WLAN_DEBUG_INPUT_SEL_SHIFT_SET(x) (((x) << WLAN_DEBUG_INPUT_SEL_SHIFT_LSB) & WLAN_DEBUG_INPUT_SEL_SHIFT_MASK) -#define WLAN_DEBUG_INPUT_SEL_SRC_MSB 3 -#define WLAN_DEBUG_INPUT_SEL_SRC_LSB 0 -#define WLAN_DEBUG_INPUT_SEL_SRC_MASK 0x0000000f -#define WLAN_DEBUG_INPUT_SEL_SRC_GET(x) (((x) & WLAN_DEBUG_INPUT_SEL_SRC_MASK) >> WLAN_DEBUG_INPUT_SEL_SRC_LSB) -#define WLAN_DEBUG_INPUT_SEL_SRC_SET(x) (((x) << WLAN_DEBUG_INPUT_SEL_SRC_LSB) & WLAN_DEBUG_INPUT_SEL_SRC_MASK) - -#define WLAN_DEBUG_OUT_ADDRESS 0x000000b0 -#define WLAN_DEBUG_OUT_OFFSET 0x000000b0 -#define WLAN_DEBUG_OUT_DATA_MSB 17 -#define WLAN_DEBUG_OUT_DATA_LSB 0 -#define WLAN_DEBUG_OUT_DATA_MASK 0x0003ffff -#define WLAN_DEBUG_OUT_DATA_GET(x) (((x) & WLAN_DEBUG_OUT_DATA_MASK) >> WLAN_DEBUG_OUT_DATA_LSB) -#define WLAN_DEBUG_OUT_DATA_SET(x) (((x) << WLAN_DEBUG_OUT_DATA_LSB) & WLAN_DEBUG_OUT_DATA_MASK) - -#define WLAN_RESET_TUPLE_STATUS_ADDRESS 0x000000b4 -#define WLAN_RESET_TUPLE_STATUS_OFFSET 0x000000b4 -#define WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MSB 11 -#define WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB 8 -#define WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK 0x00000f00 -#define WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_GET(x) (((x) & WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK) >> WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB) -#define WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_SET(x) (((x) << WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB) & WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK) -#define WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MSB 7 -#define WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB 0 -#define WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK 0x000000ff -#define WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_GET(x) (((x) & WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK) >> WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB) -#define WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_SET(x) (((x) << WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB) & WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK) - -#define ANTENNA_SLEEP_CONTROL_ADDRESS 0x000000b8 -#define ANTENNA_SLEEP_CONTROL_OFFSET 0x000000b8 -#define ANTENNA_SLEEP_CONTROL_OVERRIDE_MSB 14 -#define ANTENNA_SLEEP_CONTROL_OVERRIDE_LSB 10 -#define ANTENNA_SLEEP_CONTROL_OVERRIDE_MASK 0x00007c00 -#define ANTENNA_SLEEP_CONTROL_OVERRIDE_GET(x) (((x) & ANTENNA_SLEEP_CONTROL_OVERRIDE_MASK) >> ANTENNA_SLEEP_CONTROL_OVERRIDE_LSB) -#define ANTENNA_SLEEP_CONTROL_OVERRIDE_SET(x) (((x) << ANTENNA_SLEEP_CONTROL_OVERRIDE_LSB) & ANTENNA_SLEEP_CONTROL_OVERRIDE_MASK) -#define ANTENNA_SLEEP_CONTROL_VALUE_MSB 9 -#define ANTENNA_SLEEP_CONTROL_VALUE_LSB 5 -#define ANTENNA_SLEEP_CONTROL_VALUE_MASK 0x000003e0 -#define ANTENNA_SLEEP_CONTROL_VALUE_GET(x) (((x) & ANTENNA_SLEEP_CONTROL_VALUE_MASK) >> ANTENNA_SLEEP_CONTROL_VALUE_LSB) -#define ANTENNA_SLEEP_CONTROL_VALUE_SET(x) (((x) << ANTENNA_SLEEP_CONTROL_VALUE_LSB) & ANTENNA_SLEEP_CONTROL_VALUE_MASK) -#define ANTENNA_SLEEP_CONTROL_ENABLE_MSB 4 -#define ANTENNA_SLEEP_CONTROL_ENABLE_LSB 0 -#define ANTENNA_SLEEP_CONTROL_ENABLE_MASK 0x0000001f -#define ANTENNA_SLEEP_CONTROL_ENABLE_GET(x) (((x) & ANTENNA_SLEEP_CONTROL_ENABLE_MASK) >> ANTENNA_SLEEP_CONTROL_ENABLE_LSB) -#define ANTENNA_SLEEP_CONTROL_ENABLE_SET(x) (((x) << ANTENNA_SLEEP_CONTROL_ENABLE_LSB) & ANTENNA_SLEEP_CONTROL_ENABLE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct gpio_athr_wlan_reg_reg_s { - volatile unsigned int wlan_gpio_out; - volatile unsigned int wlan_gpio_out_w1ts; - volatile unsigned int wlan_gpio_out_w1tc; - volatile unsigned int wlan_gpio_enable; - volatile unsigned int wlan_gpio_enable_w1ts; - volatile unsigned int wlan_gpio_enable_w1tc; - volatile unsigned int wlan_gpio_in; - volatile unsigned int wlan_gpio_status; - volatile unsigned int wlan_gpio_status_w1ts; - volatile unsigned int wlan_gpio_status_w1tc; - volatile unsigned int wlan_gpio_pin0; - volatile unsigned int wlan_gpio_pin1; - volatile unsigned int wlan_gpio_pin2; - volatile unsigned int wlan_gpio_pin3; - volatile unsigned int wlan_gpio_pin4; - volatile unsigned int wlan_gpio_pin5; - volatile unsigned int wlan_gpio_pin6; - volatile unsigned int wlan_gpio_pin7; - volatile unsigned int wlan_gpio_pin8; - volatile unsigned int wlan_gpio_pin9; - volatile unsigned int wlan_gpio_pin10; - volatile unsigned int wlan_gpio_pin11; - volatile unsigned int wlan_gpio_pin12; - volatile unsigned int wlan_gpio_pin13; - volatile unsigned int wlan_gpio_pin14; - volatile unsigned int wlan_gpio_pin15; - volatile unsigned int wlan_gpio_pin16; - volatile unsigned int wlan_gpio_pin17; - volatile unsigned int wlan_gpio_pin18; - volatile unsigned int wlan_gpio_pin19; - volatile unsigned int wlan_gpio_pin20; - volatile unsigned int wlan_gpio_pin21; - volatile unsigned int wlan_gpio_pin22; - volatile unsigned int wlan_gpio_pin23; - volatile unsigned int wlan_gpio_pin24; - volatile unsigned int wlan_gpio_pin25; - volatile unsigned int sdio; - volatile unsigned int func_bus; - volatile unsigned int wl_soc_apb; - volatile unsigned int wlan_sigma_delta; - volatile unsigned int wl_bootstrap; - volatile unsigned int clock_gpio; - volatile unsigned int wlan_debug_control; - volatile unsigned int wlan_debug_input_sel; - volatile unsigned int wlan_debug_out; - volatile unsigned int wlan_reset_tuple_status; - volatile unsigned int antenna_sleep_control; -} gpio_athr_wlan_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _GPIO_ATHR_WLAN_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/gpio_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/gpio_reg.h deleted file mode 100644 index b204f1d43933..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/gpio_reg.h +++ /dev/null @@ -1,1094 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "gpio_athr_wlan_reg.h" - - -#ifndef BT_HEADERS - -#define GPIO_OUT_ADDRESS WLAN_GPIO_OUT_ADDRESS -#define GPIO_OUT_OFFSET WLAN_GPIO_OUT_OFFSET -#define GPIO_OUT_DATA_MSB WLAN_GPIO_OUT_DATA_MSB -#define GPIO_OUT_DATA_LSB WLAN_GPIO_OUT_DATA_LSB -#define GPIO_OUT_DATA_MASK WLAN_GPIO_OUT_DATA_MASK -#define GPIO_OUT_DATA_GET(x) WLAN_GPIO_OUT_DATA_GET(x) -#define GPIO_OUT_DATA_SET(x) WLAN_GPIO_OUT_DATA_SET(x) -#define GPIO_OUT_W1TS_ADDRESS WLAN_GPIO_OUT_W1TS_ADDRESS -#define GPIO_OUT_W1TS_OFFSET WLAN_GPIO_OUT_W1TS_OFFSET -#define GPIO_OUT_W1TS_DATA_MSB WLAN_GPIO_OUT_W1TS_DATA_MSB -#define GPIO_OUT_W1TS_DATA_LSB WLAN_GPIO_OUT_W1TS_DATA_LSB -#define GPIO_OUT_W1TS_DATA_MASK WLAN_GPIO_OUT_W1TS_DATA_MASK -#define GPIO_OUT_W1TS_DATA_GET(x) WLAN_GPIO_OUT_W1TS_DATA_GET(x) -#define GPIO_OUT_W1TS_DATA_SET(x) WLAN_GPIO_OUT_W1TS_DATA_SET(x) -#define GPIO_OUT_W1TC_ADDRESS WLAN_GPIO_OUT_W1TC_ADDRESS -#define GPIO_OUT_W1TC_OFFSET WLAN_GPIO_OUT_W1TC_OFFSET -#define GPIO_OUT_W1TC_DATA_MSB WLAN_GPIO_OUT_W1TC_DATA_MSB -#define GPIO_OUT_W1TC_DATA_LSB WLAN_GPIO_OUT_W1TC_DATA_LSB -#define GPIO_OUT_W1TC_DATA_MASK WLAN_GPIO_OUT_W1TC_DATA_MASK -#define GPIO_OUT_W1TC_DATA_GET(x) WLAN_GPIO_OUT_W1TC_DATA_GET(x) -#define GPIO_OUT_W1TC_DATA_SET(x) WLAN_GPIO_OUT_W1TC_DATA_SET(x) -#define GPIO_ENABLE_ADDRESS WLAN_GPIO_ENABLE_ADDRESS -#define GPIO_ENABLE_OFFSET WLAN_GPIO_ENABLE_OFFSET -#define GPIO_ENABLE_DATA_MSB WLAN_GPIO_ENABLE_DATA_MSB -#define GPIO_ENABLE_DATA_LSB WLAN_GPIO_ENABLE_DATA_LSB -#define GPIO_ENABLE_DATA_MASK WLAN_GPIO_ENABLE_DATA_MASK -#define GPIO_ENABLE_DATA_GET(x) WLAN_GPIO_ENABLE_DATA_GET(x) -#define GPIO_ENABLE_DATA_SET(x) WLAN_GPIO_ENABLE_DATA_SET(x) -#define GPIO_ENABLE_W1TS_ADDRESS WLAN_GPIO_ENABLE_W1TS_ADDRESS -#define GPIO_ENABLE_W1TS_OFFSET WLAN_GPIO_ENABLE_W1TS_OFFSET -#define GPIO_ENABLE_W1TS_DATA_MSB WLAN_GPIO_ENABLE_W1TS_DATA_MSB -#define GPIO_ENABLE_W1TS_DATA_LSB WLAN_GPIO_ENABLE_W1TS_DATA_LSB -#define GPIO_ENABLE_W1TS_DATA_MASK WLAN_GPIO_ENABLE_W1TS_DATA_MASK -#define GPIO_ENABLE_W1TS_DATA_GET(x) WLAN_GPIO_ENABLE_W1TS_DATA_GET(x) -#define GPIO_ENABLE_W1TS_DATA_SET(x) WLAN_GPIO_ENABLE_W1TS_DATA_SET(x) -#define GPIO_ENABLE_W1TC_ADDRESS WLAN_GPIO_ENABLE_W1TC_ADDRESS -#define GPIO_ENABLE_W1TC_OFFSET WLAN_GPIO_ENABLE_W1TC_OFFSET -#define GPIO_ENABLE_W1TC_DATA_MSB WLAN_GPIO_ENABLE_W1TC_DATA_MSB -#define GPIO_ENABLE_W1TC_DATA_LSB WLAN_GPIO_ENABLE_W1TC_DATA_LSB -#define GPIO_ENABLE_W1TC_DATA_MASK WLAN_GPIO_ENABLE_W1TC_DATA_MASK -#define GPIO_ENABLE_W1TC_DATA_GET(x) WLAN_GPIO_ENABLE_W1TC_DATA_GET(x) -#define GPIO_ENABLE_W1TC_DATA_SET(x) WLAN_GPIO_ENABLE_W1TC_DATA_SET(x) -#define GPIO_IN_ADDRESS WLAN_GPIO_IN_ADDRESS -#define GPIO_IN_OFFSET WLAN_GPIO_IN_OFFSET -#define GPIO_IN_DATA_MSB WLAN_GPIO_IN_DATA_MSB -#define GPIO_IN_DATA_LSB WLAN_GPIO_IN_DATA_LSB -#define GPIO_IN_DATA_MASK WLAN_GPIO_IN_DATA_MASK -#define GPIO_IN_DATA_GET(x) WLAN_GPIO_IN_DATA_GET(x) -#define GPIO_IN_DATA_SET(x) WLAN_GPIO_IN_DATA_SET(x) -#define GPIO_STATUS_ADDRESS WLAN_GPIO_STATUS_ADDRESS -#define GPIO_STATUS_OFFSET WLAN_GPIO_STATUS_OFFSET -#define GPIO_STATUS_INTERRUPT_MSB WLAN_GPIO_STATUS_INTERRUPT_MSB -#define GPIO_STATUS_INTERRUPT_LSB WLAN_GPIO_STATUS_INTERRUPT_LSB -#define GPIO_STATUS_INTERRUPT_MASK WLAN_GPIO_STATUS_INTERRUPT_MASK -#define GPIO_STATUS_INTERRUPT_GET(x) WLAN_GPIO_STATUS_INTERRUPT_GET(x) -#define GPIO_STATUS_INTERRUPT_SET(x) WLAN_GPIO_STATUS_INTERRUPT_SET(x) -#define GPIO_STATUS_W1TS_ADDRESS WLAN_GPIO_STATUS_W1TS_ADDRESS -#define GPIO_STATUS_W1TS_OFFSET WLAN_GPIO_STATUS_W1TS_OFFSET -#define GPIO_STATUS_W1TS_INTERRUPT_MSB WLAN_GPIO_STATUS_W1TS_INTERRUPT_MSB -#define GPIO_STATUS_W1TS_INTERRUPT_LSB WLAN_GPIO_STATUS_W1TS_INTERRUPT_LSB -#define GPIO_STATUS_W1TS_INTERRUPT_MASK WLAN_GPIO_STATUS_W1TS_INTERRUPT_MASK -#define GPIO_STATUS_W1TS_INTERRUPT_GET(x) WLAN_GPIO_STATUS_W1TS_INTERRUPT_GET(x) -#define GPIO_STATUS_W1TS_INTERRUPT_SET(x) WLAN_GPIO_STATUS_W1TS_INTERRUPT_SET(x) -#define GPIO_STATUS_W1TC_ADDRESS WLAN_GPIO_STATUS_W1TC_ADDRESS -#define GPIO_STATUS_W1TC_OFFSET WLAN_GPIO_STATUS_W1TC_OFFSET -#define GPIO_STATUS_W1TC_INTERRUPT_MSB WLAN_GPIO_STATUS_W1TC_INTERRUPT_MSB -#define GPIO_STATUS_W1TC_INTERRUPT_LSB WLAN_GPIO_STATUS_W1TC_INTERRUPT_LSB -#define GPIO_STATUS_W1TC_INTERRUPT_MASK WLAN_GPIO_STATUS_W1TC_INTERRUPT_MASK -#define GPIO_STATUS_W1TC_INTERRUPT_GET(x) WLAN_GPIO_STATUS_W1TC_INTERRUPT_GET(x) -#define GPIO_STATUS_W1TC_INTERRUPT_SET(x) WLAN_GPIO_STATUS_W1TC_INTERRUPT_SET(x) -#define GPIO_PIN0_ADDRESS WLAN_GPIO_PIN0_ADDRESS -#define GPIO_PIN0_OFFSET WLAN_GPIO_PIN0_OFFSET -#define GPIO_PIN0_CONFIG_MSB WLAN_GPIO_PIN0_CONFIG_MSB -#define GPIO_PIN0_CONFIG_LSB WLAN_GPIO_PIN0_CONFIG_LSB -#define GPIO_PIN0_CONFIG_MASK WLAN_GPIO_PIN0_CONFIG_MASK -#define GPIO_PIN0_CONFIG_GET(x) WLAN_GPIO_PIN0_CONFIG_GET(x) -#define GPIO_PIN0_CONFIG_SET(x) WLAN_GPIO_PIN0_CONFIG_SET(x) -#define GPIO_PIN0_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN0_WAKEUP_ENABLE_MSB -#define GPIO_PIN0_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN0_WAKEUP_ENABLE_LSB -#define GPIO_PIN0_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN0_WAKEUP_ENABLE_MASK -#define GPIO_PIN0_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN0_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN0_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN0_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN0_INT_TYPE_MSB WLAN_GPIO_PIN0_INT_TYPE_MSB -#define GPIO_PIN0_INT_TYPE_LSB WLAN_GPIO_PIN0_INT_TYPE_LSB -#define GPIO_PIN0_INT_TYPE_MASK WLAN_GPIO_PIN0_INT_TYPE_MASK -#define GPIO_PIN0_INT_TYPE_GET(x) WLAN_GPIO_PIN0_INT_TYPE_GET(x) -#define GPIO_PIN0_INT_TYPE_SET(x) WLAN_GPIO_PIN0_INT_TYPE_SET(x) -#define GPIO_PIN0_PAD_PULL_MSB WLAN_GPIO_PIN0_PAD_PULL_MSB -#define GPIO_PIN0_PAD_PULL_LSB WLAN_GPIO_PIN0_PAD_PULL_LSB -#define GPIO_PIN0_PAD_PULL_MASK WLAN_GPIO_PIN0_PAD_PULL_MASK -#define GPIO_PIN0_PAD_PULL_GET(x) WLAN_GPIO_PIN0_PAD_PULL_GET(x) -#define GPIO_PIN0_PAD_PULL_SET(x) WLAN_GPIO_PIN0_PAD_PULL_SET(x) -#define GPIO_PIN0_PAD_STRENGTH_MSB WLAN_GPIO_PIN0_PAD_STRENGTH_MSB -#define GPIO_PIN0_PAD_STRENGTH_LSB WLAN_GPIO_PIN0_PAD_STRENGTH_LSB -#define GPIO_PIN0_PAD_STRENGTH_MASK WLAN_GPIO_PIN0_PAD_STRENGTH_MASK -#define GPIO_PIN0_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN0_PAD_STRENGTH_GET(x) -#define GPIO_PIN0_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN0_PAD_STRENGTH_SET(x) -#define GPIO_PIN0_PAD_DRIVER_MSB WLAN_GPIO_PIN0_PAD_DRIVER_MSB -#define GPIO_PIN0_PAD_DRIVER_LSB WLAN_GPIO_PIN0_PAD_DRIVER_LSB -#define GPIO_PIN0_PAD_DRIVER_MASK WLAN_GPIO_PIN0_PAD_DRIVER_MASK -#define GPIO_PIN0_PAD_DRIVER_GET(x) WLAN_GPIO_PIN0_PAD_DRIVER_GET(x) -#define GPIO_PIN0_PAD_DRIVER_SET(x) WLAN_GPIO_PIN0_PAD_DRIVER_SET(x) -#define GPIO_PIN0_SOURCE_MSB WLAN_GPIO_PIN0_SOURCE_MSB -#define GPIO_PIN0_SOURCE_LSB WLAN_GPIO_PIN0_SOURCE_LSB -#define GPIO_PIN0_SOURCE_MASK WLAN_GPIO_PIN0_SOURCE_MASK -#define GPIO_PIN0_SOURCE_GET(x) WLAN_GPIO_PIN0_SOURCE_GET(x) -#define GPIO_PIN0_SOURCE_SET(x) WLAN_GPIO_PIN0_SOURCE_SET(x) -#define GPIO_PIN1_ADDRESS WLAN_GPIO_PIN1_ADDRESS -#define GPIO_PIN1_OFFSET WLAN_GPIO_PIN1_OFFSET -#define GPIO_PIN1_CONFIG_MSB WLAN_GPIO_PIN1_CONFIG_MSB -#define GPIO_PIN1_CONFIG_LSB WLAN_GPIO_PIN1_CONFIG_LSB -#define GPIO_PIN1_CONFIG_MASK WLAN_GPIO_PIN1_CONFIG_MASK -#define GPIO_PIN1_CONFIG_GET(x) WLAN_GPIO_PIN1_CONFIG_GET(x) -#define GPIO_PIN1_CONFIG_SET(x) WLAN_GPIO_PIN1_CONFIG_SET(x) -#define GPIO_PIN1_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN1_WAKEUP_ENABLE_MSB -#define GPIO_PIN1_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN1_WAKEUP_ENABLE_LSB -#define GPIO_PIN1_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN1_WAKEUP_ENABLE_MASK -#define GPIO_PIN1_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN1_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN1_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN1_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN1_INT_TYPE_MSB WLAN_GPIO_PIN1_INT_TYPE_MSB -#define GPIO_PIN1_INT_TYPE_LSB WLAN_GPIO_PIN1_INT_TYPE_LSB -#define GPIO_PIN1_INT_TYPE_MASK WLAN_GPIO_PIN1_INT_TYPE_MASK -#define GPIO_PIN1_INT_TYPE_GET(x) WLAN_GPIO_PIN1_INT_TYPE_GET(x) -#define GPIO_PIN1_INT_TYPE_SET(x) WLAN_GPIO_PIN1_INT_TYPE_SET(x) -#define GPIO_PIN1_PAD_PULL_MSB WLAN_GPIO_PIN1_PAD_PULL_MSB -#define GPIO_PIN1_PAD_PULL_LSB WLAN_GPIO_PIN1_PAD_PULL_LSB -#define GPIO_PIN1_PAD_PULL_MASK WLAN_GPIO_PIN1_PAD_PULL_MASK -#define GPIO_PIN1_PAD_PULL_GET(x) WLAN_GPIO_PIN1_PAD_PULL_GET(x) -#define GPIO_PIN1_PAD_PULL_SET(x) WLAN_GPIO_PIN1_PAD_PULL_SET(x) -#define GPIO_PIN1_PAD_STRENGTH_MSB WLAN_GPIO_PIN1_PAD_STRENGTH_MSB -#define GPIO_PIN1_PAD_STRENGTH_LSB WLAN_GPIO_PIN1_PAD_STRENGTH_LSB -#define GPIO_PIN1_PAD_STRENGTH_MASK WLAN_GPIO_PIN1_PAD_STRENGTH_MASK -#define GPIO_PIN1_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN1_PAD_STRENGTH_GET(x) -#define GPIO_PIN1_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN1_PAD_STRENGTH_SET(x) -#define GPIO_PIN1_PAD_DRIVER_MSB WLAN_GPIO_PIN1_PAD_DRIVER_MSB -#define GPIO_PIN1_PAD_DRIVER_LSB WLAN_GPIO_PIN1_PAD_DRIVER_LSB -#define GPIO_PIN1_PAD_DRIVER_MASK WLAN_GPIO_PIN1_PAD_DRIVER_MASK -#define GPIO_PIN1_PAD_DRIVER_GET(x) WLAN_GPIO_PIN1_PAD_DRIVER_GET(x) -#define GPIO_PIN1_PAD_DRIVER_SET(x) WLAN_GPIO_PIN1_PAD_DRIVER_SET(x) -#define GPIO_PIN1_SOURCE_MSB WLAN_GPIO_PIN1_SOURCE_MSB -#define GPIO_PIN1_SOURCE_LSB WLAN_GPIO_PIN1_SOURCE_LSB -#define GPIO_PIN1_SOURCE_MASK WLAN_GPIO_PIN1_SOURCE_MASK -#define GPIO_PIN1_SOURCE_GET(x) WLAN_GPIO_PIN1_SOURCE_GET(x) -#define GPIO_PIN1_SOURCE_SET(x) WLAN_GPIO_PIN1_SOURCE_SET(x) -#define GPIO_PIN2_ADDRESS WLAN_GPIO_PIN2_ADDRESS -#define GPIO_PIN2_OFFSET WLAN_GPIO_PIN2_OFFSET -#define GPIO_PIN2_CONFIG_MSB WLAN_GPIO_PIN2_CONFIG_MSB -#define GPIO_PIN2_CONFIG_LSB WLAN_GPIO_PIN2_CONFIG_LSB -#define GPIO_PIN2_CONFIG_MASK WLAN_GPIO_PIN2_CONFIG_MASK -#define GPIO_PIN2_CONFIG_GET(x) WLAN_GPIO_PIN2_CONFIG_GET(x) -#define GPIO_PIN2_CONFIG_SET(x) WLAN_GPIO_PIN2_CONFIG_SET(x) -#define GPIO_PIN2_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN2_WAKEUP_ENABLE_MSB -#define GPIO_PIN2_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN2_WAKEUP_ENABLE_LSB -#define GPIO_PIN2_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN2_WAKEUP_ENABLE_MASK -#define GPIO_PIN2_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN2_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN2_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN2_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN2_INT_TYPE_MSB WLAN_GPIO_PIN2_INT_TYPE_MSB -#define GPIO_PIN2_INT_TYPE_LSB WLAN_GPIO_PIN2_INT_TYPE_LSB -#define GPIO_PIN2_INT_TYPE_MASK WLAN_GPIO_PIN2_INT_TYPE_MASK -#define GPIO_PIN2_INT_TYPE_GET(x) WLAN_GPIO_PIN2_INT_TYPE_GET(x) -#define GPIO_PIN2_INT_TYPE_SET(x) WLAN_GPIO_PIN2_INT_TYPE_SET(x) -#define GPIO_PIN2_PAD_PULL_MSB WLAN_GPIO_PIN2_PAD_PULL_MSB -#define GPIO_PIN2_PAD_PULL_LSB WLAN_GPIO_PIN2_PAD_PULL_LSB -#define GPIO_PIN2_PAD_PULL_MASK WLAN_GPIO_PIN2_PAD_PULL_MASK -#define GPIO_PIN2_PAD_PULL_GET(x) WLAN_GPIO_PIN2_PAD_PULL_GET(x) -#define GPIO_PIN2_PAD_PULL_SET(x) WLAN_GPIO_PIN2_PAD_PULL_SET(x) -#define GPIO_PIN2_PAD_STRENGTH_MSB WLAN_GPIO_PIN2_PAD_STRENGTH_MSB -#define GPIO_PIN2_PAD_STRENGTH_LSB WLAN_GPIO_PIN2_PAD_STRENGTH_LSB -#define GPIO_PIN2_PAD_STRENGTH_MASK WLAN_GPIO_PIN2_PAD_STRENGTH_MASK -#define GPIO_PIN2_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN2_PAD_STRENGTH_GET(x) -#define GPIO_PIN2_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN2_PAD_STRENGTH_SET(x) -#define GPIO_PIN2_PAD_DRIVER_MSB WLAN_GPIO_PIN2_PAD_DRIVER_MSB -#define GPIO_PIN2_PAD_DRIVER_LSB WLAN_GPIO_PIN2_PAD_DRIVER_LSB -#define GPIO_PIN2_PAD_DRIVER_MASK WLAN_GPIO_PIN2_PAD_DRIVER_MASK -#define GPIO_PIN2_PAD_DRIVER_GET(x) WLAN_GPIO_PIN2_PAD_DRIVER_GET(x) -#define GPIO_PIN2_PAD_DRIVER_SET(x) WLAN_GPIO_PIN2_PAD_DRIVER_SET(x) -#define GPIO_PIN2_SOURCE_MSB WLAN_GPIO_PIN2_SOURCE_MSB -#define GPIO_PIN2_SOURCE_LSB WLAN_GPIO_PIN2_SOURCE_LSB -#define GPIO_PIN2_SOURCE_MASK WLAN_GPIO_PIN2_SOURCE_MASK -#define GPIO_PIN2_SOURCE_GET(x) WLAN_GPIO_PIN2_SOURCE_GET(x) -#define GPIO_PIN2_SOURCE_SET(x) WLAN_GPIO_PIN2_SOURCE_SET(x) -#define GPIO_PIN3_ADDRESS WLAN_GPIO_PIN3_ADDRESS -#define GPIO_PIN3_OFFSET WLAN_GPIO_PIN3_OFFSET -#define GPIO_PIN3_CONFIG_MSB WLAN_GPIO_PIN3_CONFIG_MSB -#define GPIO_PIN3_CONFIG_LSB WLAN_GPIO_PIN3_CONFIG_LSB -#define GPIO_PIN3_CONFIG_MASK WLAN_GPIO_PIN3_CONFIG_MASK -#define GPIO_PIN3_CONFIG_GET(x) WLAN_GPIO_PIN3_CONFIG_GET(x) -#define GPIO_PIN3_CONFIG_SET(x) WLAN_GPIO_PIN3_CONFIG_SET(x) -#define GPIO_PIN3_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN3_WAKEUP_ENABLE_MSB -#define GPIO_PIN3_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN3_WAKEUP_ENABLE_LSB -#define GPIO_PIN3_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN3_WAKEUP_ENABLE_MASK -#define GPIO_PIN3_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN3_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN3_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN3_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN3_INT_TYPE_MSB WLAN_GPIO_PIN3_INT_TYPE_MSB -#define GPIO_PIN3_INT_TYPE_LSB WLAN_GPIO_PIN3_INT_TYPE_LSB -#define GPIO_PIN3_INT_TYPE_MASK WLAN_GPIO_PIN3_INT_TYPE_MASK -#define GPIO_PIN3_INT_TYPE_GET(x) WLAN_GPIO_PIN3_INT_TYPE_GET(x) -#define GPIO_PIN3_INT_TYPE_SET(x) WLAN_GPIO_PIN3_INT_TYPE_SET(x) -#define GPIO_PIN3_PAD_PULL_MSB WLAN_GPIO_PIN3_PAD_PULL_MSB -#define GPIO_PIN3_PAD_PULL_LSB WLAN_GPIO_PIN3_PAD_PULL_LSB -#define GPIO_PIN3_PAD_PULL_MASK WLAN_GPIO_PIN3_PAD_PULL_MASK -#define GPIO_PIN3_PAD_PULL_GET(x) WLAN_GPIO_PIN3_PAD_PULL_GET(x) -#define GPIO_PIN3_PAD_PULL_SET(x) WLAN_GPIO_PIN3_PAD_PULL_SET(x) -#define GPIO_PIN3_PAD_STRENGTH_MSB WLAN_GPIO_PIN3_PAD_STRENGTH_MSB -#define GPIO_PIN3_PAD_STRENGTH_LSB WLAN_GPIO_PIN3_PAD_STRENGTH_LSB -#define GPIO_PIN3_PAD_STRENGTH_MASK WLAN_GPIO_PIN3_PAD_STRENGTH_MASK -#define GPIO_PIN3_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN3_PAD_STRENGTH_GET(x) -#define GPIO_PIN3_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN3_PAD_STRENGTH_SET(x) -#define GPIO_PIN3_PAD_DRIVER_MSB WLAN_GPIO_PIN3_PAD_DRIVER_MSB -#define GPIO_PIN3_PAD_DRIVER_LSB WLAN_GPIO_PIN3_PAD_DRIVER_LSB -#define GPIO_PIN3_PAD_DRIVER_MASK WLAN_GPIO_PIN3_PAD_DRIVER_MASK -#define GPIO_PIN3_PAD_DRIVER_GET(x) WLAN_GPIO_PIN3_PAD_DRIVER_GET(x) -#define GPIO_PIN3_PAD_DRIVER_SET(x) WLAN_GPIO_PIN3_PAD_DRIVER_SET(x) -#define GPIO_PIN3_SOURCE_MSB WLAN_GPIO_PIN3_SOURCE_MSB -#define GPIO_PIN3_SOURCE_LSB WLAN_GPIO_PIN3_SOURCE_LSB -#define GPIO_PIN3_SOURCE_MASK WLAN_GPIO_PIN3_SOURCE_MASK -#define GPIO_PIN3_SOURCE_GET(x) WLAN_GPIO_PIN3_SOURCE_GET(x) -#define GPIO_PIN3_SOURCE_SET(x) WLAN_GPIO_PIN3_SOURCE_SET(x) -#define GPIO_PIN4_ADDRESS WLAN_GPIO_PIN4_ADDRESS -#define GPIO_PIN4_OFFSET WLAN_GPIO_PIN4_OFFSET -#define GPIO_PIN4_CONFIG_MSB WLAN_GPIO_PIN4_CONFIG_MSB -#define GPIO_PIN4_CONFIG_LSB WLAN_GPIO_PIN4_CONFIG_LSB -#define GPIO_PIN4_CONFIG_MASK WLAN_GPIO_PIN4_CONFIG_MASK -#define GPIO_PIN4_CONFIG_GET(x) WLAN_GPIO_PIN4_CONFIG_GET(x) -#define GPIO_PIN4_CONFIG_SET(x) WLAN_GPIO_PIN4_CONFIG_SET(x) -#define GPIO_PIN4_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN4_WAKEUP_ENABLE_MSB -#define GPIO_PIN4_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN4_WAKEUP_ENABLE_LSB -#define GPIO_PIN4_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN4_WAKEUP_ENABLE_MASK -#define GPIO_PIN4_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN4_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN4_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN4_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN4_INT_TYPE_MSB WLAN_GPIO_PIN4_INT_TYPE_MSB -#define GPIO_PIN4_INT_TYPE_LSB WLAN_GPIO_PIN4_INT_TYPE_LSB -#define GPIO_PIN4_INT_TYPE_MASK WLAN_GPIO_PIN4_INT_TYPE_MASK -#define GPIO_PIN4_INT_TYPE_GET(x) WLAN_GPIO_PIN4_INT_TYPE_GET(x) -#define GPIO_PIN4_INT_TYPE_SET(x) WLAN_GPIO_PIN4_INT_TYPE_SET(x) -#define GPIO_PIN4_PAD_PULL_MSB WLAN_GPIO_PIN4_PAD_PULL_MSB -#define GPIO_PIN4_PAD_PULL_LSB WLAN_GPIO_PIN4_PAD_PULL_LSB -#define GPIO_PIN4_PAD_PULL_MASK WLAN_GPIO_PIN4_PAD_PULL_MASK -#define GPIO_PIN4_PAD_PULL_GET(x) WLAN_GPIO_PIN4_PAD_PULL_GET(x) -#define GPIO_PIN4_PAD_PULL_SET(x) WLAN_GPIO_PIN4_PAD_PULL_SET(x) -#define GPIO_PIN4_PAD_STRENGTH_MSB WLAN_GPIO_PIN4_PAD_STRENGTH_MSB -#define GPIO_PIN4_PAD_STRENGTH_LSB WLAN_GPIO_PIN4_PAD_STRENGTH_LSB -#define GPIO_PIN4_PAD_STRENGTH_MASK WLAN_GPIO_PIN4_PAD_STRENGTH_MASK -#define GPIO_PIN4_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN4_PAD_STRENGTH_GET(x) -#define GPIO_PIN4_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN4_PAD_STRENGTH_SET(x) -#define GPIO_PIN4_PAD_DRIVER_MSB WLAN_GPIO_PIN4_PAD_DRIVER_MSB -#define GPIO_PIN4_PAD_DRIVER_LSB WLAN_GPIO_PIN4_PAD_DRIVER_LSB -#define GPIO_PIN4_PAD_DRIVER_MASK WLAN_GPIO_PIN4_PAD_DRIVER_MASK -#define GPIO_PIN4_PAD_DRIVER_GET(x) WLAN_GPIO_PIN4_PAD_DRIVER_GET(x) -#define GPIO_PIN4_PAD_DRIVER_SET(x) WLAN_GPIO_PIN4_PAD_DRIVER_SET(x) -#define GPIO_PIN4_SOURCE_MSB WLAN_GPIO_PIN4_SOURCE_MSB -#define GPIO_PIN4_SOURCE_LSB WLAN_GPIO_PIN4_SOURCE_LSB -#define GPIO_PIN4_SOURCE_MASK WLAN_GPIO_PIN4_SOURCE_MASK -#define GPIO_PIN4_SOURCE_GET(x) WLAN_GPIO_PIN4_SOURCE_GET(x) -#define GPIO_PIN4_SOURCE_SET(x) WLAN_GPIO_PIN4_SOURCE_SET(x) -#define GPIO_PIN5_ADDRESS WLAN_GPIO_PIN5_ADDRESS -#define GPIO_PIN5_OFFSET WLAN_GPIO_PIN5_OFFSET -#define GPIO_PIN5_CONFIG_MSB WLAN_GPIO_PIN5_CONFIG_MSB -#define GPIO_PIN5_CONFIG_LSB WLAN_GPIO_PIN5_CONFIG_LSB -#define GPIO_PIN5_CONFIG_MASK WLAN_GPIO_PIN5_CONFIG_MASK -#define GPIO_PIN5_CONFIG_GET(x) WLAN_GPIO_PIN5_CONFIG_GET(x) -#define GPIO_PIN5_CONFIG_SET(x) WLAN_GPIO_PIN5_CONFIG_SET(x) -#define GPIO_PIN5_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN5_WAKEUP_ENABLE_MSB -#define GPIO_PIN5_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN5_WAKEUP_ENABLE_LSB -#define GPIO_PIN5_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN5_WAKEUP_ENABLE_MASK -#define GPIO_PIN5_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN5_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN5_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN5_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN5_INT_TYPE_MSB WLAN_GPIO_PIN5_INT_TYPE_MSB -#define GPIO_PIN5_INT_TYPE_LSB WLAN_GPIO_PIN5_INT_TYPE_LSB -#define GPIO_PIN5_INT_TYPE_MASK WLAN_GPIO_PIN5_INT_TYPE_MASK -#define GPIO_PIN5_INT_TYPE_GET(x) WLAN_GPIO_PIN5_INT_TYPE_GET(x) -#define GPIO_PIN5_INT_TYPE_SET(x) WLAN_GPIO_PIN5_INT_TYPE_SET(x) -#define GPIO_PIN5_PAD_PULL_MSB WLAN_GPIO_PIN5_PAD_PULL_MSB -#define GPIO_PIN5_PAD_PULL_LSB WLAN_GPIO_PIN5_PAD_PULL_LSB -#define GPIO_PIN5_PAD_PULL_MASK WLAN_GPIO_PIN5_PAD_PULL_MASK -#define GPIO_PIN5_PAD_PULL_GET(x) WLAN_GPIO_PIN5_PAD_PULL_GET(x) -#define GPIO_PIN5_PAD_PULL_SET(x) WLAN_GPIO_PIN5_PAD_PULL_SET(x) -#define GPIO_PIN5_PAD_STRENGTH_MSB WLAN_GPIO_PIN5_PAD_STRENGTH_MSB -#define GPIO_PIN5_PAD_STRENGTH_LSB WLAN_GPIO_PIN5_PAD_STRENGTH_LSB -#define GPIO_PIN5_PAD_STRENGTH_MASK WLAN_GPIO_PIN5_PAD_STRENGTH_MASK -#define GPIO_PIN5_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN5_PAD_STRENGTH_GET(x) -#define GPIO_PIN5_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN5_PAD_STRENGTH_SET(x) -#define GPIO_PIN5_PAD_DRIVER_MSB WLAN_GPIO_PIN5_PAD_DRIVER_MSB -#define GPIO_PIN5_PAD_DRIVER_LSB WLAN_GPIO_PIN5_PAD_DRIVER_LSB -#define GPIO_PIN5_PAD_DRIVER_MASK WLAN_GPIO_PIN5_PAD_DRIVER_MASK -#define GPIO_PIN5_PAD_DRIVER_GET(x) WLAN_GPIO_PIN5_PAD_DRIVER_GET(x) -#define GPIO_PIN5_PAD_DRIVER_SET(x) WLAN_GPIO_PIN5_PAD_DRIVER_SET(x) -#define GPIO_PIN5_SOURCE_MSB WLAN_GPIO_PIN5_SOURCE_MSB -#define GPIO_PIN5_SOURCE_LSB WLAN_GPIO_PIN5_SOURCE_LSB -#define GPIO_PIN5_SOURCE_MASK WLAN_GPIO_PIN5_SOURCE_MASK -#define GPIO_PIN5_SOURCE_GET(x) WLAN_GPIO_PIN5_SOURCE_GET(x) -#define GPIO_PIN5_SOURCE_SET(x) WLAN_GPIO_PIN5_SOURCE_SET(x) -#define GPIO_PIN6_ADDRESS WLAN_GPIO_PIN6_ADDRESS -#define GPIO_PIN6_OFFSET WLAN_GPIO_PIN6_OFFSET -#define GPIO_PIN6_CONFIG_MSB WLAN_GPIO_PIN6_CONFIG_MSB -#define GPIO_PIN6_CONFIG_LSB WLAN_GPIO_PIN6_CONFIG_LSB -#define GPIO_PIN6_CONFIG_MASK WLAN_GPIO_PIN6_CONFIG_MASK -#define GPIO_PIN6_CONFIG_GET(x) WLAN_GPIO_PIN6_CONFIG_GET(x) -#define GPIO_PIN6_CONFIG_SET(x) WLAN_GPIO_PIN6_CONFIG_SET(x) -#define GPIO_PIN6_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN6_WAKEUP_ENABLE_MSB -#define GPIO_PIN6_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN6_WAKEUP_ENABLE_LSB -#define GPIO_PIN6_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN6_WAKEUP_ENABLE_MASK -#define GPIO_PIN6_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN6_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN6_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN6_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN6_INT_TYPE_MSB WLAN_GPIO_PIN6_INT_TYPE_MSB -#define GPIO_PIN6_INT_TYPE_LSB WLAN_GPIO_PIN6_INT_TYPE_LSB -#define GPIO_PIN6_INT_TYPE_MASK WLAN_GPIO_PIN6_INT_TYPE_MASK -#define GPIO_PIN6_INT_TYPE_GET(x) WLAN_GPIO_PIN6_INT_TYPE_GET(x) -#define GPIO_PIN6_INT_TYPE_SET(x) WLAN_GPIO_PIN6_INT_TYPE_SET(x) -#define GPIO_PIN6_PAD_PULL_MSB WLAN_GPIO_PIN6_PAD_PULL_MSB -#define GPIO_PIN6_PAD_PULL_LSB WLAN_GPIO_PIN6_PAD_PULL_LSB -#define GPIO_PIN6_PAD_PULL_MASK WLAN_GPIO_PIN6_PAD_PULL_MASK -#define GPIO_PIN6_PAD_PULL_GET(x) WLAN_GPIO_PIN6_PAD_PULL_GET(x) -#define GPIO_PIN6_PAD_PULL_SET(x) WLAN_GPIO_PIN6_PAD_PULL_SET(x) -#define GPIO_PIN6_PAD_STRENGTH_MSB WLAN_GPIO_PIN6_PAD_STRENGTH_MSB -#define GPIO_PIN6_PAD_STRENGTH_LSB WLAN_GPIO_PIN6_PAD_STRENGTH_LSB -#define GPIO_PIN6_PAD_STRENGTH_MASK WLAN_GPIO_PIN6_PAD_STRENGTH_MASK -#define GPIO_PIN6_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN6_PAD_STRENGTH_GET(x) -#define GPIO_PIN6_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN6_PAD_STRENGTH_SET(x) -#define GPIO_PIN6_PAD_DRIVER_MSB WLAN_GPIO_PIN6_PAD_DRIVER_MSB -#define GPIO_PIN6_PAD_DRIVER_LSB WLAN_GPIO_PIN6_PAD_DRIVER_LSB -#define GPIO_PIN6_PAD_DRIVER_MASK WLAN_GPIO_PIN6_PAD_DRIVER_MASK -#define GPIO_PIN6_PAD_DRIVER_GET(x) WLAN_GPIO_PIN6_PAD_DRIVER_GET(x) -#define GPIO_PIN6_PAD_DRIVER_SET(x) WLAN_GPIO_PIN6_PAD_DRIVER_SET(x) -#define GPIO_PIN6_SOURCE_MSB WLAN_GPIO_PIN6_SOURCE_MSB -#define GPIO_PIN6_SOURCE_LSB WLAN_GPIO_PIN6_SOURCE_LSB -#define GPIO_PIN6_SOURCE_MASK WLAN_GPIO_PIN6_SOURCE_MASK -#define GPIO_PIN6_SOURCE_GET(x) WLAN_GPIO_PIN6_SOURCE_GET(x) -#define GPIO_PIN6_SOURCE_SET(x) WLAN_GPIO_PIN6_SOURCE_SET(x) -#define GPIO_PIN7_ADDRESS WLAN_GPIO_PIN7_ADDRESS -#define GPIO_PIN7_OFFSET WLAN_GPIO_PIN7_OFFSET -#define GPIO_PIN7_CONFIG_MSB WLAN_GPIO_PIN7_CONFIG_MSB -#define GPIO_PIN7_CONFIG_LSB WLAN_GPIO_PIN7_CONFIG_LSB -#define GPIO_PIN7_CONFIG_MASK WLAN_GPIO_PIN7_CONFIG_MASK -#define GPIO_PIN7_CONFIG_GET(x) WLAN_GPIO_PIN7_CONFIG_GET(x) -#define GPIO_PIN7_CONFIG_SET(x) WLAN_GPIO_PIN7_CONFIG_SET(x) -#define GPIO_PIN7_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN7_WAKEUP_ENABLE_MSB -#define GPIO_PIN7_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN7_WAKEUP_ENABLE_LSB -#define GPIO_PIN7_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN7_WAKEUP_ENABLE_MASK -#define GPIO_PIN7_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN7_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN7_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN7_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN7_INT_TYPE_MSB WLAN_GPIO_PIN7_INT_TYPE_MSB -#define GPIO_PIN7_INT_TYPE_LSB WLAN_GPIO_PIN7_INT_TYPE_LSB -#define GPIO_PIN7_INT_TYPE_MASK WLAN_GPIO_PIN7_INT_TYPE_MASK -#define GPIO_PIN7_INT_TYPE_GET(x) WLAN_GPIO_PIN7_INT_TYPE_GET(x) -#define GPIO_PIN7_INT_TYPE_SET(x) WLAN_GPIO_PIN7_INT_TYPE_SET(x) -#define GPIO_PIN7_PAD_PULL_MSB WLAN_GPIO_PIN7_PAD_PULL_MSB -#define GPIO_PIN7_PAD_PULL_LSB WLAN_GPIO_PIN7_PAD_PULL_LSB -#define GPIO_PIN7_PAD_PULL_MASK WLAN_GPIO_PIN7_PAD_PULL_MASK -#define GPIO_PIN7_PAD_PULL_GET(x) WLAN_GPIO_PIN7_PAD_PULL_GET(x) -#define GPIO_PIN7_PAD_PULL_SET(x) WLAN_GPIO_PIN7_PAD_PULL_SET(x) -#define GPIO_PIN7_PAD_STRENGTH_MSB WLAN_GPIO_PIN7_PAD_STRENGTH_MSB -#define GPIO_PIN7_PAD_STRENGTH_LSB WLAN_GPIO_PIN7_PAD_STRENGTH_LSB -#define GPIO_PIN7_PAD_STRENGTH_MASK WLAN_GPIO_PIN7_PAD_STRENGTH_MASK -#define GPIO_PIN7_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN7_PAD_STRENGTH_GET(x) -#define GPIO_PIN7_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN7_PAD_STRENGTH_SET(x) -#define GPIO_PIN7_PAD_DRIVER_MSB WLAN_GPIO_PIN7_PAD_DRIVER_MSB -#define GPIO_PIN7_PAD_DRIVER_LSB WLAN_GPIO_PIN7_PAD_DRIVER_LSB -#define GPIO_PIN7_PAD_DRIVER_MASK WLAN_GPIO_PIN7_PAD_DRIVER_MASK -#define GPIO_PIN7_PAD_DRIVER_GET(x) WLAN_GPIO_PIN7_PAD_DRIVER_GET(x) -#define GPIO_PIN7_PAD_DRIVER_SET(x) WLAN_GPIO_PIN7_PAD_DRIVER_SET(x) -#define GPIO_PIN7_SOURCE_MSB WLAN_GPIO_PIN7_SOURCE_MSB -#define GPIO_PIN7_SOURCE_LSB WLAN_GPIO_PIN7_SOURCE_LSB -#define GPIO_PIN7_SOURCE_MASK WLAN_GPIO_PIN7_SOURCE_MASK -#define GPIO_PIN7_SOURCE_GET(x) WLAN_GPIO_PIN7_SOURCE_GET(x) -#define GPIO_PIN7_SOURCE_SET(x) WLAN_GPIO_PIN7_SOURCE_SET(x) -#define GPIO_PIN8_ADDRESS WLAN_GPIO_PIN8_ADDRESS -#define GPIO_PIN8_OFFSET WLAN_GPIO_PIN8_OFFSET -#define GPIO_PIN8_CONFIG_MSB WLAN_GPIO_PIN8_CONFIG_MSB -#define GPIO_PIN8_CONFIG_LSB WLAN_GPIO_PIN8_CONFIG_LSB -#define GPIO_PIN8_CONFIG_MASK WLAN_GPIO_PIN8_CONFIG_MASK -#define GPIO_PIN8_CONFIG_GET(x) WLAN_GPIO_PIN8_CONFIG_GET(x) -#define GPIO_PIN8_CONFIG_SET(x) WLAN_GPIO_PIN8_CONFIG_SET(x) -#define GPIO_PIN8_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN8_WAKEUP_ENABLE_MSB -#define GPIO_PIN8_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN8_WAKEUP_ENABLE_LSB -#define GPIO_PIN8_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN8_WAKEUP_ENABLE_MASK -#define GPIO_PIN8_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN8_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN8_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN8_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN8_INT_TYPE_MSB WLAN_GPIO_PIN8_INT_TYPE_MSB -#define GPIO_PIN8_INT_TYPE_LSB WLAN_GPIO_PIN8_INT_TYPE_LSB -#define GPIO_PIN8_INT_TYPE_MASK WLAN_GPIO_PIN8_INT_TYPE_MASK -#define GPIO_PIN8_INT_TYPE_GET(x) WLAN_GPIO_PIN8_INT_TYPE_GET(x) -#define GPIO_PIN8_INT_TYPE_SET(x) WLAN_GPIO_PIN8_INT_TYPE_SET(x) -#define GPIO_PIN8_PAD_PULL_MSB WLAN_GPIO_PIN8_PAD_PULL_MSB -#define GPIO_PIN8_PAD_PULL_LSB WLAN_GPIO_PIN8_PAD_PULL_LSB -#define GPIO_PIN8_PAD_PULL_MASK WLAN_GPIO_PIN8_PAD_PULL_MASK -#define GPIO_PIN8_PAD_PULL_GET(x) WLAN_GPIO_PIN8_PAD_PULL_GET(x) -#define GPIO_PIN8_PAD_PULL_SET(x) WLAN_GPIO_PIN8_PAD_PULL_SET(x) -#define GPIO_PIN8_PAD_STRENGTH_MSB WLAN_GPIO_PIN8_PAD_STRENGTH_MSB -#define GPIO_PIN8_PAD_STRENGTH_LSB WLAN_GPIO_PIN8_PAD_STRENGTH_LSB -#define GPIO_PIN8_PAD_STRENGTH_MASK WLAN_GPIO_PIN8_PAD_STRENGTH_MASK -#define GPIO_PIN8_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN8_PAD_STRENGTH_GET(x) -#define GPIO_PIN8_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN8_PAD_STRENGTH_SET(x) -#define GPIO_PIN8_PAD_DRIVER_MSB WLAN_GPIO_PIN8_PAD_DRIVER_MSB -#define GPIO_PIN8_PAD_DRIVER_LSB WLAN_GPIO_PIN8_PAD_DRIVER_LSB -#define GPIO_PIN8_PAD_DRIVER_MASK WLAN_GPIO_PIN8_PAD_DRIVER_MASK -#define GPIO_PIN8_PAD_DRIVER_GET(x) WLAN_GPIO_PIN8_PAD_DRIVER_GET(x) -#define GPIO_PIN8_PAD_DRIVER_SET(x) WLAN_GPIO_PIN8_PAD_DRIVER_SET(x) -#define GPIO_PIN8_SOURCE_MSB WLAN_GPIO_PIN8_SOURCE_MSB -#define GPIO_PIN8_SOURCE_LSB WLAN_GPIO_PIN8_SOURCE_LSB -#define GPIO_PIN8_SOURCE_MASK WLAN_GPIO_PIN8_SOURCE_MASK -#define GPIO_PIN8_SOURCE_GET(x) WLAN_GPIO_PIN8_SOURCE_GET(x) -#define GPIO_PIN8_SOURCE_SET(x) WLAN_GPIO_PIN8_SOURCE_SET(x) -#define GPIO_PIN9_ADDRESS WLAN_GPIO_PIN9_ADDRESS -#define GPIO_PIN9_OFFSET WLAN_GPIO_PIN9_OFFSET -#define GPIO_PIN9_CONFIG_MSB WLAN_GPIO_PIN9_CONFIG_MSB -#define GPIO_PIN9_CONFIG_LSB WLAN_GPIO_PIN9_CONFIG_LSB -#define GPIO_PIN9_CONFIG_MASK WLAN_GPIO_PIN9_CONFIG_MASK -#define GPIO_PIN9_CONFIG_GET(x) WLAN_GPIO_PIN9_CONFIG_GET(x) -#define GPIO_PIN9_CONFIG_SET(x) WLAN_GPIO_PIN9_CONFIG_SET(x) -#define GPIO_PIN9_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN9_WAKEUP_ENABLE_MSB -#define GPIO_PIN9_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN9_WAKEUP_ENABLE_LSB -#define GPIO_PIN9_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN9_WAKEUP_ENABLE_MASK -#define GPIO_PIN9_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN9_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN9_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN9_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN9_INT_TYPE_MSB WLAN_GPIO_PIN9_INT_TYPE_MSB -#define GPIO_PIN9_INT_TYPE_LSB WLAN_GPIO_PIN9_INT_TYPE_LSB -#define GPIO_PIN9_INT_TYPE_MASK WLAN_GPIO_PIN9_INT_TYPE_MASK -#define GPIO_PIN9_INT_TYPE_GET(x) WLAN_GPIO_PIN9_INT_TYPE_GET(x) -#define GPIO_PIN9_INT_TYPE_SET(x) WLAN_GPIO_PIN9_INT_TYPE_SET(x) -#define GPIO_PIN9_PAD_PULL_MSB WLAN_GPIO_PIN9_PAD_PULL_MSB -#define GPIO_PIN9_PAD_PULL_LSB WLAN_GPIO_PIN9_PAD_PULL_LSB -#define GPIO_PIN9_PAD_PULL_MASK WLAN_GPIO_PIN9_PAD_PULL_MASK -#define GPIO_PIN9_PAD_PULL_GET(x) WLAN_GPIO_PIN9_PAD_PULL_GET(x) -#define GPIO_PIN9_PAD_PULL_SET(x) WLAN_GPIO_PIN9_PAD_PULL_SET(x) -#define GPIO_PIN9_PAD_STRENGTH_MSB WLAN_GPIO_PIN9_PAD_STRENGTH_MSB -#define GPIO_PIN9_PAD_STRENGTH_LSB WLAN_GPIO_PIN9_PAD_STRENGTH_LSB -#define GPIO_PIN9_PAD_STRENGTH_MASK WLAN_GPIO_PIN9_PAD_STRENGTH_MASK -#define GPIO_PIN9_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN9_PAD_STRENGTH_GET(x) -#define GPIO_PIN9_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN9_PAD_STRENGTH_SET(x) -#define GPIO_PIN9_PAD_DRIVER_MSB WLAN_GPIO_PIN9_PAD_DRIVER_MSB -#define GPIO_PIN9_PAD_DRIVER_LSB WLAN_GPIO_PIN9_PAD_DRIVER_LSB -#define GPIO_PIN9_PAD_DRIVER_MASK WLAN_GPIO_PIN9_PAD_DRIVER_MASK -#define GPIO_PIN9_PAD_DRIVER_GET(x) WLAN_GPIO_PIN9_PAD_DRIVER_GET(x) -#define GPIO_PIN9_PAD_DRIVER_SET(x) WLAN_GPIO_PIN9_PAD_DRIVER_SET(x) -#define GPIO_PIN9_SOURCE_MSB WLAN_GPIO_PIN9_SOURCE_MSB -#define GPIO_PIN9_SOURCE_LSB WLAN_GPIO_PIN9_SOURCE_LSB -#define GPIO_PIN9_SOURCE_MASK WLAN_GPIO_PIN9_SOURCE_MASK -#define GPIO_PIN9_SOURCE_GET(x) WLAN_GPIO_PIN9_SOURCE_GET(x) -#define GPIO_PIN9_SOURCE_SET(x) WLAN_GPIO_PIN9_SOURCE_SET(x) -#define GPIO_PIN10_ADDRESS WLAN_GPIO_PIN10_ADDRESS -#define GPIO_PIN10_OFFSET WLAN_GPIO_PIN10_OFFSET -#define GPIO_PIN10_CONFIG_MSB WLAN_GPIO_PIN10_CONFIG_MSB -#define GPIO_PIN10_CONFIG_LSB WLAN_GPIO_PIN10_CONFIG_LSB -#define GPIO_PIN10_CONFIG_MASK WLAN_GPIO_PIN10_CONFIG_MASK -#define GPIO_PIN10_CONFIG_GET(x) WLAN_GPIO_PIN10_CONFIG_GET(x) -#define GPIO_PIN10_CONFIG_SET(x) WLAN_GPIO_PIN10_CONFIG_SET(x) -#define GPIO_PIN10_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN10_WAKEUP_ENABLE_MSB -#define GPIO_PIN10_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN10_WAKEUP_ENABLE_LSB -#define GPIO_PIN10_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN10_WAKEUP_ENABLE_MASK -#define GPIO_PIN10_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN10_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN10_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN10_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN10_INT_TYPE_MSB WLAN_GPIO_PIN10_INT_TYPE_MSB -#define GPIO_PIN10_INT_TYPE_LSB WLAN_GPIO_PIN10_INT_TYPE_LSB -#define GPIO_PIN10_INT_TYPE_MASK WLAN_GPIO_PIN10_INT_TYPE_MASK -#define GPIO_PIN10_INT_TYPE_GET(x) WLAN_GPIO_PIN10_INT_TYPE_GET(x) -#define GPIO_PIN10_INT_TYPE_SET(x) WLAN_GPIO_PIN10_INT_TYPE_SET(x) -#define GPIO_PIN10_PAD_PULL_MSB WLAN_GPIO_PIN10_PAD_PULL_MSB -#define GPIO_PIN10_PAD_PULL_LSB WLAN_GPIO_PIN10_PAD_PULL_LSB -#define GPIO_PIN10_PAD_PULL_MASK WLAN_GPIO_PIN10_PAD_PULL_MASK -#define GPIO_PIN10_PAD_PULL_GET(x) WLAN_GPIO_PIN10_PAD_PULL_GET(x) -#define GPIO_PIN10_PAD_PULL_SET(x) WLAN_GPIO_PIN10_PAD_PULL_SET(x) -#define GPIO_PIN10_PAD_STRENGTH_MSB WLAN_GPIO_PIN10_PAD_STRENGTH_MSB -#define GPIO_PIN10_PAD_STRENGTH_LSB WLAN_GPIO_PIN10_PAD_STRENGTH_LSB -#define GPIO_PIN10_PAD_STRENGTH_MASK WLAN_GPIO_PIN10_PAD_STRENGTH_MASK -#define GPIO_PIN10_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN10_PAD_STRENGTH_GET(x) -#define GPIO_PIN10_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN10_PAD_STRENGTH_SET(x) -#define GPIO_PIN10_PAD_DRIVER_MSB WLAN_GPIO_PIN10_PAD_DRIVER_MSB -#define GPIO_PIN10_PAD_DRIVER_LSB WLAN_GPIO_PIN10_PAD_DRIVER_LSB -#define GPIO_PIN10_PAD_DRIVER_MASK WLAN_GPIO_PIN10_PAD_DRIVER_MASK -#define GPIO_PIN10_PAD_DRIVER_GET(x) WLAN_GPIO_PIN10_PAD_DRIVER_GET(x) -#define GPIO_PIN10_PAD_DRIVER_SET(x) WLAN_GPIO_PIN10_PAD_DRIVER_SET(x) -#define GPIO_PIN10_SOURCE_MSB WLAN_GPIO_PIN10_SOURCE_MSB -#define GPIO_PIN10_SOURCE_LSB WLAN_GPIO_PIN10_SOURCE_LSB -#define GPIO_PIN10_SOURCE_MASK WLAN_GPIO_PIN10_SOURCE_MASK -#define GPIO_PIN10_SOURCE_GET(x) WLAN_GPIO_PIN10_SOURCE_GET(x) -#define GPIO_PIN10_SOURCE_SET(x) WLAN_GPIO_PIN10_SOURCE_SET(x) -#define GPIO_PIN11_ADDRESS WLAN_GPIO_PIN11_ADDRESS -#define GPIO_PIN11_OFFSET WLAN_GPIO_PIN11_OFFSET -#define GPIO_PIN11_CONFIG_MSB WLAN_GPIO_PIN11_CONFIG_MSB -#define GPIO_PIN11_CONFIG_LSB WLAN_GPIO_PIN11_CONFIG_LSB -#define GPIO_PIN11_CONFIG_MASK WLAN_GPIO_PIN11_CONFIG_MASK -#define GPIO_PIN11_CONFIG_GET(x) WLAN_GPIO_PIN11_CONFIG_GET(x) -#define GPIO_PIN11_CONFIG_SET(x) WLAN_GPIO_PIN11_CONFIG_SET(x) -#define GPIO_PIN11_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN11_WAKEUP_ENABLE_MSB -#define GPIO_PIN11_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN11_WAKEUP_ENABLE_LSB -#define GPIO_PIN11_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN11_WAKEUP_ENABLE_MASK -#define GPIO_PIN11_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN11_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN11_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN11_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN11_INT_TYPE_MSB WLAN_GPIO_PIN11_INT_TYPE_MSB -#define GPIO_PIN11_INT_TYPE_LSB WLAN_GPIO_PIN11_INT_TYPE_LSB -#define GPIO_PIN11_INT_TYPE_MASK WLAN_GPIO_PIN11_INT_TYPE_MASK -#define GPIO_PIN11_INT_TYPE_GET(x) WLAN_GPIO_PIN11_INT_TYPE_GET(x) -#define GPIO_PIN11_INT_TYPE_SET(x) WLAN_GPIO_PIN11_INT_TYPE_SET(x) -#define GPIO_PIN11_PAD_PULL_MSB WLAN_GPIO_PIN11_PAD_PULL_MSB -#define GPIO_PIN11_PAD_PULL_LSB WLAN_GPIO_PIN11_PAD_PULL_LSB -#define GPIO_PIN11_PAD_PULL_MASK WLAN_GPIO_PIN11_PAD_PULL_MASK -#define GPIO_PIN11_PAD_PULL_GET(x) WLAN_GPIO_PIN11_PAD_PULL_GET(x) -#define GPIO_PIN11_PAD_PULL_SET(x) WLAN_GPIO_PIN11_PAD_PULL_SET(x) -#define GPIO_PIN11_PAD_STRENGTH_MSB WLAN_GPIO_PIN11_PAD_STRENGTH_MSB -#define GPIO_PIN11_PAD_STRENGTH_LSB WLAN_GPIO_PIN11_PAD_STRENGTH_LSB -#define GPIO_PIN11_PAD_STRENGTH_MASK WLAN_GPIO_PIN11_PAD_STRENGTH_MASK -#define GPIO_PIN11_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN11_PAD_STRENGTH_GET(x) -#define GPIO_PIN11_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN11_PAD_STRENGTH_SET(x) -#define GPIO_PIN11_PAD_DRIVER_MSB WLAN_GPIO_PIN11_PAD_DRIVER_MSB -#define GPIO_PIN11_PAD_DRIVER_LSB WLAN_GPIO_PIN11_PAD_DRIVER_LSB -#define GPIO_PIN11_PAD_DRIVER_MASK WLAN_GPIO_PIN11_PAD_DRIVER_MASK -#define GPIO_PIN11_PAD_DRIVER_GET(x) WLAN_GPIO_PIN11_PAD_DRIVER_GET(x) -#define GPIO_PIN11_PAD_DRIVER_SET(x) WLAN_GPIO_PIN11_PAD_DRIVER_SET(x) -#define GPIO_PIN11_SOURCE_MSB WLAN_GPIO_PIN11_SOURCE_MSB -#define GPIO_PIN11_SOURCE_LSB WLAN_GPIO_PIN11_SOURCE_LSB -#define GPIO_PIN11_SOURCE_MASK WLAN_GPIO_PIN11_SOURCE_MASK -#define GPIO_PIN11_SOURCE_GET(x) WLAN_GPIO_PIN11_SOURCE_GET(x) -#define GPIO_PIN11_SOURCE_SET(x) WLAN_GPIO_PIN11_SOURCE_SET(x) -#define GPIO_PIN12_ADDRESS WLAN_GPIO_PIN12_ADDRESS -#define GPIO_PIN12_OFFSET WLAN_GPIO_PIN12_OFFSET -#define GPIO_PIN12_CONFIG_MSB WLAN_GPIO_PIN12_CONFIG_MSB -#define GPIO_PIN12_CONFIG_LSB WLAN_GPIO_PIN12_CONFIG_LSB -#define GPIO_PIN12_CONFIG_MASK WLAN_GPIO_PIN12_CONFIG_MASK -#define GPIO_PIN12_CONFIG_GET(x) WLAN_GPIO_PIN12_CONFIG_GET(x) -#define GPIO_PIN12_CONFIG_SET(x) WLAN_GPIO_PIN12_CONFIG_SET(x) -#define GPIO_PIN12_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN12_WAKEUP_ENABLE_MSB -#define GPIO_PIN12_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN12_WAKEUP_ENABLE_LSB -#define GPIO_PIN12_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN12_WAKEUP_ENABLE_MASK -#define GPIO_PIN12_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN12_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN12_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN12_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN12_INT_TYPE_MSB WLAN_GPIO_PIN12_INT_TYPE_MSB -#define GPIO_PIN12_INT_TYPE_LSB WLAN_GPIO_PIN12_INT_TYPE_LSB -#define GPIO_PIN12_INT_TYPE_MASK WLAN_GPIO_PIN12_INT_TYPE_MASK -#define GPIO_PIN12_INT_TYPE_GET(x) WLAN_GPIO_PIN12_INT_TYPE_GET(x) -#define GPIO_PIN12_INT_TYPE_SET(x) WLAN_GPIO_PIN12_INT_TYPE_SET(x) -#define GPIO_PIN12_PAD_PULL_MSB WLAN_GPIO_PIN12_PAD_PULL_MSB -#define GPIO_PIN12_PAD_PULL_LSB WLAN_GPIO_PIN12_PAD_PULL_LSB -#define GPIO_PIN12_PAD_PULL_MASK WLAN_GPIO_PIN12_PAD_PULL_MASK -#define GPIO_PIN12_PAD_PULL_GET(x) WLAN_GPIO_PIN12_PAD_PULL_GET(x) -#define GPIO_PIN12_PAD_PULL_SET(x) WLAN_GPIO_PIN12_PAD_PULL_SET(x) -#define GPIO_PIN12_PAD_STRENGTH_MSB WLAN_GPIO_PIN12_PAD_STRENGTH_MSB -#define GPIO_PIN12_PAD_STRENGTH_LSB WLAN_GPIO_PIN12_PAD_STRENGTH_LSB -#define GPIO_PIN12_PAD_STRENGTH_MASK WLAN_GPIO_PIN12_PAD_STRENGTH_MASK -#define GPIO_PIN12_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN12_PAD_STRENGTH_GET(x) -#define GPIO_PIN12_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN12_PAD_STRENGTH_SET(x) -#define GPIO_PIN12_PAD_DRIVER_MSB WLAN_GPIO_PIN12_PAD_DRIVER_MSB -#define GPIO_PIN12_PAD_DRIVER_LSB WLAN_GPIO_PIN12_PAD_DRIVER_LSB -#define GPIO_PIN12_PAD_DRIVER_MASK WLAN_GPIO_PIN12_PAD_DRIVER_MASK -#define GPIO_PIN12_PAD_DRIVER_GET(x) WLAN_GPIO_PIN12_PAD_DRIVER_GET(x) -#define GPIO_PIN12_PAD_DRIVER_SET(x) WLAN_GPIO_PIN12_PAD_DRIVER_SET(x) -#define GPIO_PIN12_SOURCE_MSB WLAN_GPIO_PIN12_SOURCE_MSB -#define GPIO_PIN12_SOURCE_LSB WLAN_GPIO_PIN12_SOURCE_LSB -#define GPIO_PIN12_SOURCE_MASK WLAN_GPIO_PIN12_SOURCE_MASK -#define GPIO_PIN12_SOURCE_GET(x) WLAN_GPIO_PIN12_SOURCE_GET(x) -#define GPIO_PIN12_SOURCE_SET(x) WLAN_GPIO_PIN12_SOURCE_SET(x) -#define GPIO_PIN13_ADDRESS WLAN_GPIO_PIN13_ADDRESS -#define GPIO_PIN13_OFFSET WLAN_GPIO_PIN13_OFFSET -#define GPIO_PIN13_CONFIG_MSB WLAN_GPIO_PIN13_CONFIG_MSB -#define GPIO_PIN13_CONFIG_LSB WLAN_GPIO_PIN13_CONFIG_LSB -#define GPIO_PIN13_CONFIG_MASK WLAN_GPIO_PIN13_CONFIG_MASK -#define GPIO_PIN13_CONFIG_GET(x) WLAN_GPIO_PIN13_CONFIG_GET(x) -#define GPIO_PIN13_CONFIG_SET(x) WLAN_GPIO_PIN13_CONFIG_SET(x) -#define GPIO_PIN13_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN13_WAKEUP_ENABLE_MSB -#define GPIO_PIN13_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN13_WAKEUP_ENABLE_LSB -#define GPIO_PIN13_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN13_WAKEUP_ENABLE_MASK -#define GPIO_PIN13_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN13_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN13_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN13_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN13_INT_TYPE_MSB WLAN_GPIO_PIN13_INT_TYPE_MSB -#define GPIO_PIN13_INT_TYPE_LSB WLAN_GPIO_PIN13_INT_TYPE_LSB -#define GPIO_PIN13_INT_TYPE_MASK WLAN_GPIO_PIN13_INT_TYPE_MASK -#define GPIO_PIN13_INT_TYPE_GET(x) WLAN_GPIO_PIN13_INT_TYPE_GET(x) -#define GPIO_PIN13_INT_TYPE_SET(x) WLAN_GPIO_PIN13_INT_TYPE_SET(x) -#define GPIO_PIN13_PAD_PULL_MSB WLAN_GPIO_PIN13_PAD_PULL_MSB -#define GPIO_PIN13_PAD_PULL_LSB WLAN_GPIO_PIN13_PAD_PULL_LSB -#define GPIO_PIN13_PAD_PULL_MASK WLAN_GPIO_PIN13_PAD_PULL_MASK -#define GPIO_PIN13_PAD_PULL_GET(x) WLAN_GPIO_PIN13_PAD_PULL_GET(x) -#define GPIO_PIN13_PAD_PULL_SET(x) WLAN_GPIO_PIN13_PAD_PULL_SET(x) -#define GPIO_PIN13_PAD_STRENGTH_MSB WLAN_GPIO_PIN13_PAD_STRENGTH_MSB -#define GPIO_PIN13_PAD_STRENGTH_LSB WLAN_GPIO_PIN13_PAD_STRENGTH_LSB -#define GPIO_PIN13_PAD_STRENGTH_MASK WLAN_GPIO_PIN13_PAD_STRENGTH_MASK -#define GPIO_PIN13_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN13_PAD_STRENGTH_GET(x) -#define GPIO_PIN13_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN13_PAD_STRENGTH_SET(x) -#define GPIO_PIN13_PAD_DRIVER_MSB WLAN_GPIO_PIN13_PAD_DRIVER_MSB -#define GPIO_PIN13_PAD_DRIVER_LSB WLAN_GPIO_PIN13_PAD_DRIVER_LSB -#define GPIO_PIN13_PAD_DRIVER_MASK WLAN_GPIO_PIN13_PAD_DRIVER_MASK -#define GPIO_PIN13_PAD_DRIVER_GET(x) WLAN_GPIO_PIN13_PAD_DRIVER_GET(x) -#define GPIO_PIN13_PAD_DRIVER_SET(x) WLAN_GPIO_PIN13_PAD_DRIVER_SET(x) -#define GPIO_PIN13_SOURCE_MSB WLAN_GPIO_PIN13_SOURCE_MSB -#define GPIO_PIN13_SOURCE_LSB WLAN_GPIO_PIN13_SOURCE_LSB -#define GPIO_PIN13_SOURCE_MASK WLAN_GPIO_PIN13_SOURCE_MASK -#define GPIO_PIN13_SOURCE_GET(x) WLAN_GPIO_PIN13_SOURCE_GET(x) -#define GPIO_PIN13_SOURCE_SET(x) WLAN_GPIO_PIN13_SOURCE_SET(x) -#define GPIO_PIN14_ADDRESS WLAN_GPIO_PIN14_ADDRESS -#define GPIO_PIN14_OFFSET WLAN_GPIO_PIN14_OFFSET -#define GPIO_PIN14_CONFIG_MSB WLAN_GPIO_PIN14_CONFIG_MSB -#define GPIO_PIN14_CONFIG_LSB WLAN_GPIO_PIN14_CONFIG_LSB -#define GPIO_PIN14_CONFIG_MASK WLAN_GPIO_PIN14_CONFIG_MASK -#define GPIO_PIN14_CONFIG_GET(x) WLAN_GPIO_PIN14_CONFIG_GET(x) -#define GPIO_PIN14_CONFIG_SET(x) WLAN_GPIO_PIN14_CONFIG_SET(x) -#define GPIO_PIN14_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN14_WAKEUP_ENABLE_MSB -#define GPIO_PIN14_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN14_WAKEUP_ENABLE_LSB -#define GPIO_PIN14_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN14_WAKEUP_ENABLE_MASK -#define GPIO_PIN14_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN14_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN14_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN14_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN14_INT_TYPE_MSB WLAN_GPIO_PIN14_INT_TYPE_MSB -#define GPIO_PIN14_INT_TYPE_LSB WLAN_GPIO_PIN14_INT_TYPE_LSB -#define GPIO_PIN14_INT_TYPE_MASK WLAN_GPIO_PIN14_INT_TYPE_MASK -#define GPIO_PIN14_INT_TYPE_GET(x) WLAN_GPIO_PIN14_INT_TYPE_GET(x) -#define GPIO_PIN14_INT_TYPE_SET(x) WLAN_GPIO_PIN14_INT_TYPE_SET(x) -#define GPIO_PIN14_PAD_PULL_MSB WLAN_GPIO_PIN14_PAD_PULL_MSB -#define GPIO_PIN14_PAD_PULL_LSB WLAN_GPIO_PIN14_PAD_PULL_LSB -#define GPIO_PIN14_PAD_PULL_MASK WLAN_GPIO_PIN14_PAD_PULL_MASK -#define GPIO_PIN14_PAD_PULL_GET(x) WLAN_GPIO_PIN14_PAD_PULL_GET(x) -#define GPIO_PIN14_PAD_PULL_SET(x) WLAN_GPIO_PIN14_PAD_PULL_SET(x) -#define GPIO_PIN14_PAD_STRENGTH_MSB WLAN_GPIO_PIN14_PAD_STRENGTH_MSB -#define GPIO_PIN14_PAD_STRENGTH_LSB WLAN_GPIO_PIN14_PAD_STRENGTH_LSB -#define GPIO_PIN14_PAD_STRENGTH_MASK WLAN_GPIO_PIN14_PAD_STRENGTH_MASK -#define GPIO_PIN14_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN14_PAD_STRENGTH_GET(x) -#define GPIO_PIN14_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN14_PAD_STRENGTH_SET(x) -#define GPIO_PIN14_PAD_DRIVER_MSB WLAN_GPIO_PIN14_PAD_DRIVER_MSB -#define GPIO_PIN14_PAD_DRIVER_LSB WLAN_GPIO_PIN14_PAD_DRIVER_LSB -#define GPIO_PIN14_PAD_DRIVER_MASK WLAN_GPIO_PIN14_PAD_DRIVER_MASK -#define GPIO_PIN14_PAD_DRIVER_GET(x) WLAN_GPIO_PIN14_PAD_DRIVER_GET(x) -#define GPIO_PIN14_PAD_DRIVER_SET(x) WLAN_GPIO_PIN14_PAD_DRIVER_SET(x) -#define GPIO_PIN14_SOURCE_MSB WLAN_GPIO_PIN14_SOURCE_MSB -#define GPIO_PIN14_SOURCE_LSB WLAN_GPIO_PIN14_SOURCE_LSB -#define GPIO_PIN14_SOURCE_MASK WLAN_GPIO_PIN14_SOURCE_MASK -#define GPIO_PIN14_SOURCE_GET(x) WLAN_GPIO_PIN14_SOURCE_GET(x) -#define GPIO_PIN14_SOURCE_SET(x) WLAN_GPIO_PIN14_SOURCE_SET(x) -#define GPIO_PIN15_ADDRESS WLAN_GPIO_PIN15_ADDRESS -#define GPIO_PIN15_OFFSET WLAN_GPIO_PIN15_OFFSET -#define GPIO_PIN15_CONFIG_MSB WLAN_GPIO_PIN15_CONFIG_MSB -#define GPIO_PIN15_CONFIG_LSB WLAN_GPIO_PIN15_CONFIG_LSB -#define GPIO_PIN15_CONFIG_MASK WLAN_GPIO_PIN15_CONFIG_MASK -#define GPIO_PIN15_CONFIG_GET(x) WLAN_GPIO_PIN15_CONFIG_GET(x) -#define GPIO_PIN15_CONFIG_SET(x) WLAN_GPIO_PIN15_CONFIG_SET(x) -#define GPIO_PIN15_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN15_WAKEUP_ENABLE_MSB -#define GPIO_PIN15_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN15_WAKEUP_ENABLE_LSB -#define GPIO_PIN15_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN15_WAKEUP_ENABLE_MASK -#define GPIO_PIN15_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN15_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN15_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN15_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN15_INT_TYPE_MSB WLAN_GPIO_PIN15_INT_TYPE_MSB -#define GPIO_PIN15_INT_TYPE_LSB WLAN_GPIO_PIN15_INT_TYPE_LSB -#define GPIO_PIN15_INT_TYPE_MASK WLAN_GPIO_PIN15_INT_TYPE_MASK -#define GPIO_PIN15_INT_TYPE_GET(x) WLAN_GPIO_PIN15_INT_TYPE_GET(x) -#define GPIO_PIN15_INT_TYPE_SET(x) WLAN_GPIO_PIN15_INT_TYPE_SET(x) -#define GPIO_PIN15_PAD_PULL_MSB WLAN_GPIO_PIN15_PAD_PULL_MSB -#define GPIO_PIN15_PAD_PULL_LSB WLAN_GPIO_PIN15_PAD_PULL_LSB -#define GPIO_PIN15_PAD_PULL_MASK WLAN_GPIO_PIN15_PAD_PULL_MASK -#define GPIO_PIN15_PAD_PULL_GET(x) WLAN_GPIO_PIN15_PAD_PULL_GET(x) -#define GPIO_PIN15_PAD_PULL_SET(x) WLAN_GPIO_PIN15_PAD_PULL_SET(x) -#define GPIO_PIN15_PAD_STRENGTH_MSB WLAN_GPIO_PIN15_PAD_STRENGTH_MSB -#define GPIO_PIN15_PAD_STRENGTH_LSB WLAN_GPIO_PIN15_PAD_STRENGTH_LSB -#define GPIO_PIN15_PAD_STRENGTH_MASK WLAN_GPIO_PIN15_PAD_STRENGTH_MASK -#define GPIO_PIN15_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN15_PAD_STRENGTH_GET(x) -#define GPIO_PIN15_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN15_PAD_STRENGTH_SET(x) -#define GPIO_PIN15_PAD_DRIVER_MSB WLAN_GPIO_PIN15_PAD_DRIVER_MSB -#define GPIO_PIN15_PAD_DRIVER_LSB WLAN_GPIO_PIN15_PAD_DRIVER_LSB -#define GPIO_PIN15_PAD_DRIVER_MASK WLAN_GPIO_PIN15_PAD_DRIVER_MASK -#define GPIO_PIN15_PAD_DRIVER_GET(x) WLAN_GPIO_PIN15_PAD_DRIVER_GET(x) -#define GPIO_PIN15_PAD_DRIVER_SET(x) WLAN_GPIO_PIN15_PAD_DRIVER_SET(x) -#define GPIO_PIN15_SOURCE_MSB WLAN_GPIO_PIN15_SOURCE_MSB -#define GPIO_PIN15_SOURCE_LSB WLAN_GPIO_PIN15_SOURCE_LSB -#define GPIO_PIN15_SOURCE_MASK WLAN_GPIO_PIN15_SOURCE_MASK -#define GPIO_PIN15_SOURCE_GET(x) WLAN_GPIO_PIN15_SOURCE_GET(x) -#define GPIO_PIN15_SOURCE_SET(x) WLAN_GPIO_PIN15_SOURCE_SET(x) -#define GPIO_PIN16_ADDRESS WLAN_GPIO_PIN16_ADDRESS -#define GPIO_PIN16_OFFSET WLAN_GPIO_PIN16_OFFSET -#define GPIO_PIN16_CONFIG_MSB WLAN_GPIO_PIN16_CONFIG_MSB -#define GPIO_PIN16_CONFIG_LSB WLAN_GPIO_PIN16_CONFIG_LSB -#define GPIO_PIN16_CONFIG_MASK WLAN_GPIO_PIN16_CONFIG_MASK -#define GPIO_PIN16_CONFIG_GET(x) WLAN_GPIO_PIN16_CONFIG_GET(x) -#define GPIO_PIN16_CONFIG_SET(x) WLAN_GPIO_PIN16_CONFIG_SET(x) -#define GPIO_PIN16_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN16_WAKEUP_ENABLE_MSB -#define GPIO_PIN16_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN16_WAKEUP_ENABLE_LSB -#define GPIO_PIN16_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN16_WAKEUP_ENABLE_MASK -#define GPIO_PIN16_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN16_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN16_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN16_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN16_INT_TYPE_MSB WLAN_GPIO_PIN16_INT_TYPE_MSB -#define GPIO_PIN16_INT_TYPE_LSB WLAN_GPIO_PIN16_INT_TYPE_LSB -#define GPIO_PIN16_INT_TYPE_MASK WLAN_GPIO_PIN16_INT_TYPE_MASK -#define GPIO_PIN16_INT_TYPE_GET(x) WLAN_GPIO_PIN16_INT_TYPE_GET(x) -#define GPIO_PIN16_INT_TYPE_SET(x) WLAN_GPIO_PIN16_INT_TYPE_SET(x) -#define GPIO_PIN16_PAD_PULL_MSB WLAN_GPIO_PIN16_PAD_PULL_MSB -#define GPIO_PIN16_PAD_PULL_LSB WLAN_GPIO_PIN16_PAD_PULL_LSB -#define GPIO_PIN16_PAD_PULL_MASK WLAN_GPIO_PIN16_PAD_PULL_MASK -#define GPIO_PIN16_PAD_PULL_GET(x) WLAN_GPIO_PIN16_PAD_PULL_GET(x) -#define GPIO_PIN16_PAD_PULL_SET(x) WLAN_GPIO_PIN16_PAD_PULL_SET(x) -#define GPIO_PIN16_PAD_STRENGTH_MSB WLAN_GPIO_PIN16_PAD_STRENGTH_MSB -#define GPIO_PIN16_PAD_STRENGTH_LSB WLAN_GPIO_PIN16_PAD_STRENGTH_LSB -#define GPIO_PIN16_PAD_STRENGTH_MASK WLAN_GPIO_PIN16_PAD_STRENGTH_MASK -#define GPIO_PIN16_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN16_PAD_STRENGTH_GET(x) -#define GPIO_PIN16_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN16_PAD_STRENGTH_SET(x) -#define GPIO_PIN16_PAD_DRIVER_MSB WLAN_GPIO_PIN16_PAD_DRIVER_MSB -#define GPIO_PIN16_PAD_DRIVER_LSB WLAN_GPIO_PIN16_PAD_DRIVER_LSB -#define GPIO_PIN16_PAD_DRIVER_MASK WLAN_GPIO_PIN16_PAD_DRIVER_MASK -#define GPIO_PIN16_PAD_DRIVER_GET(x) WLAN_GPIO_PIN16_PAD_DRIVER_GET(x) -#define GPIO_PIN16_PAD_DRIVER_SET(x) WLAN_GPIO_PIN16_PAD_DRIVER_SET(x) -#define GPIO_PIN16_SOURCE_MSB WLAN_GPIO_PIN16_SOURCE_MSB -#define GPIO_PIN16_SOURCE_LSB WLAN_GPIO_PIN16_SOURCE_LSB -#define GPIO_PIN16_SOURCE_MASK WLAN_GPIO_PIN16_SOURCE_MASK -#define GPIO_PIN16_SOURCE_GET(x) WLAN_GPIO_PIN16_SOURCE_GET(x) -#define GPIO_PIN16_SOURCE_SET(x) WLAN_GPIO_PIN16_SOURCE_SET(x) -#define GPIO_PIN17_ADDRESS WLAN_GPIO_PIN17_ADDRESS -#define GPIO_PIN17_OFFSET WLAN_GPIO_PIN17_OFFSET -#define GPIO_PIN17_CONFIG_MSB WLAN_GPIO_PIN17_CONFIG_MSB -#define GPIO_PIN17_CONFIG_LSB WLAN_GPIO_PIN17_CONFIG_LSB -#define GPIO_PIN17_CONFIG_MASK WLAN_GPIO_PIN17_CONFIG_MASK -#define GPIO_PIN17_CONFIG_GET(x) WLAN_GPIO_PIN17_CONFIG_GET(x) -#define GPIO_PIN17_CONFIG_SET(x) WLAN_GPIO_PIN17_CONFIG_SET(x) -#define GPIO_PIN17_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN17_WAKEUP_ENABLE_MSB -#define GPIO_PIN17_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN17_WAKEUP_ENABLE_LSB -#define GPIO_PIN17_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN17_WAKEUP_ENABLE_MASK -#define GPIO_PIN17_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN17_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN17_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN17_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN17_INT_TYPE_MSB WLAN_GPIO_PIN17_INT_TYPE_MSB -#define GPIO_PIN17_INT_TYPE_LSB WLAN_GPIO_PIN17_INT_TYPE_LSB -#define GPIO_PIN17_INT_TYPE_MASK WLAN_GPIO_PIN17_INT_TYPE_MASK -#define GPIO_PIN17_INT_TYPE_GET(x) WLAN_GPIO_PIN17_INT_TYPE_GET(x) -#define GPIO_PIN17_INT_TYPE_SET(x) WLAN_GPIO_PIN17_INT_TYPE_SET(x) -#define GPIO_PIN17_PAD_PULL_MSB WLAN_GPIO_PIN17_PAD_PULL_MSB -#define GPIO_PIN17_PAD_PULL_LSB WLAN_GPIO_PIN17_PAD_PULL_LSB -#define GPIO_PIN17_PAD_PULL_MASK WLAN_GPIO_PIN17_PAD_PULL_MASK -#define GPIO_PIN17_PAD_PULL_GET(x) WLAN_GPIO_PIN17_PAD_PULL_GET(x) -#define GPIO_PIN17_PAD_PULL_SET(x) WLAN_GPIO_PIN17_PAD_PULL_SET(x) -#define GPIO_PIN17_PAD_STRENGTH_MSB WLAN_GPIO_PIN17_PAD_STRENGTH_MSB -#define GPIO_PIN17_PAD_STRENGTH_LSB WLAN_GPIO_PIN17_PAD_STRENGTH_LSB -#define GPIO_PIN17_PAD_STRENGTH_MASK WLAN_GPIO_PIN17_PAD_STRENGTH_MASK -#define GPIO_PIN17_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN17_PAD_STRENGTH_GET(x) -#define GPIO_PIN17_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN17_PAD_STRENGTH_SET(x) -#define GPIO_PIN17_PAD_DRIVER_MSB WLAN_GPIO_PIN17_PAD_DRIVER_MSB -#define GPIO_PIN17_PAD_DRIVER_LSB WLAN_GPIO_PIN17_PAD_DRIVER_LSB -#define GPIO_PIN17_PAD_DRIVER_MASK WLAN_GPIO_PIN17_PAD_DRIVER_MASK -#define GPIO_PIN17_PAD_DRIVER_GET(x) WLAN_GPIO_PIN17_PAD_DRIVER_GET(x) -#define GPIO_PIN17_PAD_DRIVER_SET(x) WLAN_GPIO_PIN17_PAD_DRIVER_SET(x) -#define GPIO_PIN17_SOURCE_MSB WLAN_GPIO_PIN17_SOURCE_MSB -#define GPIO_PIN17_SOURCE_LSB WLAN_GPIO_PIN17_SOURCE_LSB -#define GPIO_PIN17_SOURCE_MASK WLAN_GPIO_PIN17_SOURCE_MASK -#define GPIO_PIN17_SOURCE_GET(x) WLAN_GPIO_PIN17_SOURCE_GET(x) -#define GPIO_PIN17_SOURCE_SET(x) WLAN_GPIO_PIN17_SOURCE_SET(x) -#define GPIO_PIN18_ADDRESS WLAN_GPIO_PIN18_ADDRESS -#define GPIO_PIN18_OFFSET WLAN_GPIO_PIN18_OFFSET -#define GPIO_PIN18_CONFIG_MSB WLAN_GPIO_PIN18_CONFIG_MSB -#define GPIO_PIN18_CONFIG_LSB WLAN_GPIO_PIN18_CONFIG_LSB -#define GPIO_PIN18_CONFIG_MASK WLAN_GPIO_PIN18_CONFIG_MASK -#define GPIO_PIN18_CONFIG_GET(x) WLAN_GPIO_PIN18_CONFIG_GET(x) -#define GPIO_PIN18_CONFIG_SET(x) WLAN_GPIO_PIN18_CONFIG_SET(x) -#define GPIO_PIN18_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN18_WAKEUP_ENABLE_MSB -#define GPIO_PIN18_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN18_WAKEUP_ENABLE_LSB -#define GPIO_PIN18_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN18_WAKEUP_ENABLE_MASK -#define GPIO_PIN18_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN18_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN18_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN18_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN18_INT_TYPE_MSB WLAN_GPIO_PIN18_INT_TYPE_MSB -#define GPIO_PIN18_INT_TYPE_LSB WLAN_GPIO_PIN18_INT_TYPE_LSB -#define GPIO_PIN18_INT_TYPE_MASK WLAN_GPIO_PIN18_INT_TYPE_MASK -#define GPIO_PIN18_INT_TYPE_GET(x) WLAN_GPIO_PIN18_INT_TYPE_GET(x) -#define GPIO_PIN18_INT_TYPE_SET(x) WLAN_GPIO_PIN18_INT_TYPE_SET(x) -#define GPIO_PIN18_PAD_PULL_MSB WLAN_GPIO_PIN18_PAD_PULL_MSB -#define GPIO_PIN18_PAD_PULL_LSB WLAN_GPIO_PIN18_PAD_PULL_LSB -#define GPIO_PIN18_PAD_PULL_MASK WLAN_GPIO_PIN18_PAD_PULL_MASK -#define GPIO_PIN18_PAD_PULL_GET(x) WLAN_GPIO_PIN18_PAD_PULL_GET(x) -#define GPIO_PIN18_PAD_PULL_SET(x) WLAN_GPIO_PIN18_PAD_PULL_SET(x) -#define GPIO_PIN18_PAD_STRENGTH_MSB WLAN_GPIO_PIN18_PAD_STRENGTH_MSB -#define GPIO_PIN18_PAD_STRENGTH_LSB WLAN_GPIO_PIN18_PAD_STRENGTH_LSB -#define GPIO_PIN18_PAD_STRENGTH_MASK WLAN_GPIO_PIN18_PAD_STRENGTH_MASK -#define GPIO_PIN18_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN18_PAD_STRENGTH_GET(x) -#define GPIO_PIN18_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN18_PAD_STRENGTH_SET(x) -#define GPIO_PIN18_PAD_DRIVER_MSB WLAN_GPIO_PIN18_PAD_DRIVER_MSB -#define GPIO_PIN18_PAD_DRIVER_LSB WLAN_GPIO_PIN18_PAD_DRIVER_LSB -#define GPIO_PIN18_PAD_DRIVER_MASK WLAN_GPIO_PIN18_PAD_DRIVER_MASK -#define GPIO_PIN18_PAD_DRIVER_GET(x) WLAN_GPIO_PIN18_PAD_DRIVER_GET(x) -#define GPIO_PIN18_PAD_DRIVER_SET(x) WLAN_GPIO_PIN18_PAD_DRIVER_SET(x) -#define GPIO_PIN18_SOURCE_MSB WLAN_GPIO_PIN18_SOURCE_MSB -#define GPIO_PIN18_SOURCE_LSB WLAN_GPIO_PIN18_SOURCE_LSB -#define GPIO_PIN18_SOURCE_MASK WLAN_GPIO_PIN18_SOURCE_MASK -#define GPIO_PIN18_SOURCE_GET(x) WLAN_GPIO_PIN18_SOURCE_GET(x) -#define GPIO_PIN18_SOURCE_SET(x) WLAN_GPIO_PIN18_SOURCE_SET(x) -#define GPIO_PIN19_ADDRESS WLAN_GPIO_PIN19_ADDRESS -#define GPIO_PIN19_OFFSET WLAN_GPIO_PIN19_OFFSET -#define GPIO_PIN19_CONFIG_MSB WLAN_GPIO_PIN19_CONFIG_MSB -#define GPIO_PIN19_CONFIG_LSB WLAN_GPIO_PIN19_CONFIG_LSB -#define GPIO_PIN19_CONFIG_MASK WLAN_GPIO_PIN19_CONFIG_MASK -#define GPIO_PIN19_CONFIG_GET(x) WLAN_GPIO_PIN19_CONFIG_GET(x) -#define GPIO_PIN19_CONFIG_SET(x) WLAN_GPIO_PIN19_CONFIG_SET(x) -#define GPIO_PIN19_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN19_WAKEUP_ENABLE_MSB -#define GPIO_PIN19_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN19_WAKEUP_ENABLE_LSB -#define GPIO_PIN19_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN19_WAKEUP_ENABLE_MASK -#define GPIO_PIN19_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN19_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN19_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN19_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN19_INT_TYPE_MSB WLAN_GPIO_PIN19_INT_TYPE_MSB -#define GPIO_PIN19_INT_TYPE_LSB WLAN_GPIO_PIN19_INT_TYPE_LSB -#define GPIO_PIN19_INT_TYPE_MASK WLAN_GPIO_PIN19_INT_TYPE_MASK -#define GPIO_PIN19_INT_TYPE_GET(x) WLAN_GPIO_PIN19_INT_TYPE_GET(x) -#define GPIO_PIN19_INT_TYPE_SET(x) WLAN_GPIO_PIN19_INT_TYPE_SET(x) -#define GPIO_PIN19_PAD_PULL_MSB WLAN_GPIO_PIN19_PAD_PULL_MSB -#define GPIO_PIN19_PAD_PULL_LSB WLAN_GPIO_PIN19_PAD_PULL_LSB -#define GPIO_PIN19_PAD_PULL_MASK WLAN_GPIO_PIN19_PAD_PULL_MASK -#define GPIO_PIN19_PAD_PULL_GET(x) WLAN_GPIO_PIN19_PAD_PULL_GET(x) -#define GPIO_PIN19_PAD_PULL_SET(x) WLAN_GPIO_PIN19_PAD_PULL_SET(x) -#define GPIO_PIN19_PAD_STRENGTH_MSB WLAN_GPIO_PIN19_PAD_STRENGTH_MSB -#define GPIO_PIN19_PAD_STRENGTH_LSB WLAN_GPIO_PIN19_PAD_STRENGTH_LSB -#define GPIO_PIN19_PAD_STRENGTH_MASK WLAN_GPIO_PIN19_PAD_STRENGTH_MASK -#define GPIO_PIN19_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN19_PAD_STRENGTH_GET(x) -#define GPIO_PIN19_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN19_PAD_STRENGTH_SET(x) -#define GPIO_PIN19_PAD_DRIVER_MSB WLAN_GPIO_PIN19_PAD_DRIVER_MSB -#define GPIO_PIN19_PAD_DRIVER_LSB WLAN_GPIO_PIN19_PAD_DRIVER_LSB -#define GPIO_PIN19_PAD_DRIVER_MASK WLAN_GPIO_PIN19_PAD_DRIVER_MASK -#define GPIO_PIN19_PAD_DRIVER_GET(x) WLAN_GPIO_PIN19_PAD_DRIVER_GET(x) -#define GPIO_PIN19_PAD_DRIVER_SET(x) WLAN_GPIO_PIN19_PAD_DRIVER_SET(x) -#define GPIO_PIN19_SOURCE_MSB WLAN_GPIO_PIN19_SOURCE_MSB -#define GPIO_PIN19_SOURCE_LSB WLAN_GPIO_PIN19_SOURCE_LSB -#define GPIO_PIN19_SOURCE_MASK WLAN_GPIO_PIN19_SOURCE_MASK -#define GPIO_PIN19_SOURCE_GET(x) WLAN_GPIO_PIN19_SOURCE_GET(x) -#define GPIO_PIN19_SOURCE_SET(x) WLAN_GPIO_PIN19_SOURCE_SET(x) -#define GPIO_PIN20_ADDRESS WLAN_GPIO_PIN20_ADDRESS -#define GPIO_PIN20_OFFSET WLAN_GPIO_PIN20_OFFSET -#define GPIO_PIN20_CONFIG_MSB WLAN_GPIO_PIN20_CONFIG_MSB -#define GPIO_PIN20_CONFIG_LSB WLAN_GPIO_PIN20_CONFIG_LSB -#define GPIO_PIN20_CONFIG_MASK WLAN_GPIO_PIN20_CONFIG_MASK -#define GPIO_PIN20_CONFIG_GET(x) WLAN_GPIO_PIN20_CONFIG_GET(x) -#define GPIO_PIN20_CONFIG_SET(x) WLAN_GPIO_PIN20_CONFIG_SET(x) -#define GPIO_PIN20_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN20_WAKEUP_ENABLE_MSB -#define GPIO_PIN20_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN20_WAKEUP_ENABLE_LSB -#define GPIO_PIN20_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN20_WAKEUP_ENABLE_MASK -#define GPIO_PIN20_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN20_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN20_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN20_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN20_INT_TYPE_MSB WLAN_GPIO_PIN20_INT_TYPE_MSB -#define GPIO_PIN20_INT_TYPE_LSB WLAN_GPIO_PIN20_INT_TYPE_LSB -#define GPIO_PIN20_INT_TYPE_MASK WLAN_GPIO_PIN20_INT_TYPE_MASK -#define GPIO_PIN20_INT_TYPE_GET(x) WLAN_GPIO_PIN20_INT_TYPE_GET(x) -#define GPIO_PIN20_INT_TYPE_SET(x) WLAN_GPIO_PIN20_INT_TYPE_SET(x) -#define GPIO_PIN20_PAD_PULL_MSB WLAN_GPIO_PIN20_PAD_PULL_MSB -#define GPIO_PIN20_PAD_PULL_LSB WLAN_GPIO_PIN20_PAD_PULL_LSB -#define GPIO_PIN20_PAD_PULL_MASK WLAN_GPIO_PIN20_PAD_PULL_MASK -#define GPIO_PIN20_PAD_PULL_GET(x) WLAN_GPIO_PIN20_PAD_PULL_GET(x) -#define GPIO_PIN20_PAD_PULL_SET(x) WLAN_GPIO_PIN20_PAD_PULL_SET(x) -#define GPIO_PIN20_PAD_STRENGTH_MSB WLAN_GPIO_PIN20_PAD_STRENGTH_MSB -#define GPIO_PIN20_PAD_STRENGTH_LSB WLAN_GPIO_PIN20_PAD_STRENGTH_LSB -#define GPIO_PIN20_PAD_STRENGTH_MASK WLAN_GPIO_PIN20_PAD_STRENGTH_MASK -#define GPIO_PIN20_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN20_PAD_STRENGTH_GET(x) -#define GPIO_PIN20_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN20_PAD_STRENGTH_SET(x) -#define GPIO_PIN20_PAD_DRIVER_MSB WLAN_GPIO_PIN20_PAD_DRIVER_MSB -#define GPIO_PIN20_PAD_DRIVER_LSB WLAN_GPIO_PIN20_PAD_DRIVER_LSB -#define GPIO_PIN20_PAD_DRIVER_MASK WLAN_GPIO_PIN20_PAD_DRIVER_MASK -#define GPIO_PIN20_PAD_DRIVER_GET(x) WLAN_GPIO_PIN20_PAD_DRIVER_GET(x) -#define GPIO_PIN20_PAD_DRIVER_SET(x) WLAN_GPIO_PIN20_PAD_DRIVER_SET(x) -#define GPIO_PIN20_SOURCE_MSB WLAN_GPIO_PIN20_SOURCE_MSB -#define GPIO_PIN20_SOURCE_LSB WLAN_GPIO_PIN20_SOURCE_LSB -#define GPIO_PIN20_SOURCE_MASK WLAN_GPIO_PIN20_SOURCE_MASK -#define GPIO_PIN20_SOURCE_GET(x) WLAN_GPIO_PIN20_SOURCE_GET(x) -#define GPIO_PIN20_SOURCE_SET(x) WLAN_GPIO_PIN20_SOURCE_SET(x) -#define GPIO_PIN21_ADDRESS WLAN_GPIO_PIN21_ADDRESS -#define GPIO_PIN21_OFFSET WLAN_GPIO_PIN21_OFFSET -#define GPIO_PIN21_CONFIG_MSB WLAN_GPIO_PIN21_CONFIG_MSB -#define GPIO_PIN21_CONFIG_LSB WLAN_GPIO_PIN21_CONFIG_LSB -#define GPIO_PIN21_CONFIG_MASK WLAN_GPIO_PIN21_CONFIG_MASK -#define GPIO_PIN21_CONFIG_GET(x) WLAN_GPIO_PIN21_CONFIG_GET(x) -#define GPIO_PIN21_CONFIG_SET(x) WLAN_GPIO_PIN21_CONFIG_SET(x) -#define GPIO_PIN21_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN21_WAKEUP_ENABLE_MSB -#define GPIO_PIN21_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN21_WAKEUP_ENABLE_LSB -#define GPIO_PIN21_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN21_WAKEUP_ENABLE_MASK -#define GPIO_PIN21_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN21_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN21_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN21_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN21_INT_TYPE_MSB WLAN_GPIO_PIN21_INT_TYPE_MSB -#define GPIO_PIN21_INT_TYPE_LSB WLAN_GPIO_PIN21_INT_TYPE_LSB -#define GPIO_PIN21_INT_TYPE_MASK WLAN_GPIO_PIN21_INT_TYPE_MASK -#define GPIO_PIN21_INT_TYPE_GET(x) WLAN_GPIO_PIN21_INT_TYPE_GET(x) -#define GPIO_PIN21_INT_TYPE_SET(x) WLAN_GPIO_PIN21_INT_TYPE_SET(x) -#define GPIO_PIN21_PAD_PULL_MSB WLAN_GPIO_PIN21_PAD_PULL_MSB -#define GPIO_PIN21_PAD_PULL_LSB WLAN_GPIO_PIN21_PAD_PULL_LSB -#define GPIO_PIN21_PAD_PULL_MASK WLAN_GPIO_PIN21_PAD_PULL_MASK -#define GPIO_PIN21_PAD_PULL_GET(x) WLAN_GPIO_PIN21_PAD_PULL_GET(x) -#define GPIO_PIN21_PAD_PULL_SET(x) WLAN_GPIO_PIN21_PAD_PULL_SET(x) -#define GPIO_PIN21_PAD_STRENGTH_MSB WLAN_GPIO_PIN21_PAD_STRENGTH_MSB -#define GPIO_PIN21_PAD_STRENGTH_LSB WLAN_GPIO_PIN21_PAD_STRENGTH_LSB -#define GPIO_PIN21_PAD_STRENGTH_MASK WLAN_GPIO_PIN21_PAD_STRENGTH_MASK -#define GPIO_PIN21_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN21_PAD_STRENGTH_GET(x) -#define GPIO_PIN21_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN21_PAD_STRENGTH_SET(x) -#define GPIO_PIN21_PAD_DRIVER_MSB WLAN_GPIO_PIN21_PAD_DRIVER_MSB -#define GPIO_PIN21_PAD_DRIVER_LSB WLAN_GPIO_PIN21_PAD_DRIVER_LSB -#define GPIO_PIN21_PAD_DRIVER_MASK WLAN_GPIO_PIN21_PAD_DRIVER_MASK -#define GPIO_PIN21_PAD_DRIVER_GET(x) WLAN_GPIO_PIN21_PAD_DRIVER_GET(x) -#define GPIO_PIN21_PAD_DRIVER_SET(x) WLAN_GPIO_PIN21_PAD_DRIVER_SET(x) -#define GPIO_PIN21_SOURCE_MSB WLAN_GPIO_PIN21_SOURCE_MSB -#define GPIO_PIN21_SOURCE_LSB WLAN_GPIO_PIN21_SOURCE_LSB -#define GPIO_PIN21_SOURCE_MASK WLAN_GPIO_PIN21_SOURCE_MASK -#define GPIO_PIN21_SOURCE_GET(x) WLAN_GPIO_PIN21_SOURCE_GET(x) -#define GPIO_PIN21_SOURCE_SET(x) WLAN_GPIO_PIN21_SOURCE_SET(x) -#define GPIO_PIN22_ADDRESS WLAN_GPIO_PIN22_ADDRESS -#define GPIO_PIN22_OFFSET WLAN_GPIO_PIN22_OFFSET -#define GPIO_PIN22_CONFIG_MSB WLAN_GPIO_PIN22_CONFIG_MSB -#define GPIO_PIN22_CONFIG_LSB WLAN_GPIO_PIN22_CONFIG_LSB -#define GPIO_PIN22_CONFIG_MASK WLAN_GPIO_PIN22_CONFIG_MASK -#define GPIO_PIN22_CONFIG_GET(x) WLAN_GPIO_PIN22_CONFIG_GET(x) -#define GPIO_PIN22_CONFIG_SET(x) WLAN_GPIO_PIN22_CONFIG_SET(x) -#define GPIO_PIN22_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN22_WAKEUP_ENABLE_MSB -#define GPIO_PIN22_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN22_WAKEUP_ENABLE_LSB -#define GPIO_PIN22_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN22_WAKEUP_ENABLE_MASK -#define GPIO_PIN22_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN22_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN22_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN22_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN22_INT_TYPE_MSB WLAN_GPIO_PIN22_INT_TYPE_MSB -#define GPIO_PIN22_INT_TYPE_LSB WLAN_GPIO_PIN22_INT_TYPE_LSB -#define GPIO_PIN22_INT_TYPE_MASK WLAN_GPIO_PIN22_INT_TYPE_MASK -#define GPIO_PIN22_INT_TYPE_GET(x) WLAN_GPIO_PIN22_INT_TYPE_GET(x) -#define GPIO_PIN22_INT_TYPE_SET(x) WLAN_GPIO_PIN22_INT_TYPE_SET(x) -#define GPIO_PIN22_PAD_PULL_MSB WLAN_GPIO_PIN22_PAD_PULL_MSB -#define GPIO_PIN22_PAD_PULL_LSB WLAN_GPIO_PIN22_PAD_PULL_LSB -#define GPIO_PIN22_PAD_PULL_MASK WLAN_GPIO_PIN22_PAD_PULL_MASK -#define GPIO_PIN22_PAD_PULL_GET(x) WLAN_GPIO_PIN22_PAD_PULL_GET(x) -#define GPIO_PIN22_PAD_PULL_SET(x) WLAN_GPIO_PIN22_PAD_PULL_SET(x) -#define GPIO_PIN22_PAD_STRENGTH_MSB WLAN_GPIO_PIN22_PAD_STRENGTH_MSB -#define GPIO_PIN22_PAD_STRENGTH_LSB WLAN_GPIO_PIN22_PAD_STRENGTH_LSB -#define GPIO_PIN22_PAD_STRENGTH_MASK WLAN_GPIO_PIN22_PAD_STRENGTH_MASK -#define GPIO_PIN22_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN22_PAD_STRENGTH_GET(x) -#define GPIO_PIN22_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN22_PAD_STRENGTH_SET(x) -#define GPIO_PIN22_PAD_DRIVER_MSB WLAN_GPIO_PIN22_PAD_DRIVER_MSB -#define GPIO_PIN22_PAD_DRIVER_LSB WLAN_GPIO_PIN22_PAD_DRIVER_LSB -#define GPIO_PIN22_PAD_DRIVER_MASK WLAN_GPIO_PIN22_PAD_DRIVER_MASK -#define GPIO_PIN22_PAD_DRIVER_GET(x) WLAN_GPIO_PIN22_PAD_DRIVER_GET(x) -#define GPIO_PIN22_PAD_DRIVER_SET(x) WLAN_GPIO_PIN22_PAD_DRIVER_SET(x) -#define GPIO_PIN22_SOURCE_MSB WLAN_GPIO_PIN22_SOURCE_MSB -#define GPIO_PIN22_SOURCE_LSB WLAN_GPIO_PIN22_SOURCE_LSB -#define GPIO_PIN22_SOURCE_MASK WLAN_GPIO_PIN22_SOURCE_MASK -#define GPIO_PIN22_SOURCE_GET(x) WLAN_GPIO_PIN22_SOURCE_GET(x) -#define GPIO_PIN22_SOURCE_SET(x) WLAN_GPIO_PIN22_SOURCE_SET(x) -#define GPIO_PIN23_ADDRESS WLAN_GPIO_PIN23_ADDRESS -#define GPIO_PIN23_OFFSET WLAN_GPIO_PIN23_OFFSET -#define GPIO_PIN23_CONFIG_MSB WLAN_GPIO_PIN23_CONFIG_MSB -#define GPIO_PIN23_CONFIG_LSB WLAN_GPIO_PIN23_CONFIG_LSB -#define GPIO_PIN23_CONFIG_MASK WLAN_GPIO_PIN23_CONFIG_MASK -#define GPIO_PIN23_CONFIG_GET(x) WLAN_GPIO_PIN23_CONFIG_GET(x) -#define GPIO_PIN23_CONFIG_SET(x) WLAN_GPIO_PIN23_CONFIG_SET(x) -#define GPIO_PIN23_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN23_WAKEUP_ENABLE_MSB -#define GPIO_PIN23_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN23_WAKEUP_ENABLE_LSB -#define GPIO_PIN23_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN23_WAKEUP_ENABLE_MASK -#define GPIO_PIN23_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN23_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN23_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN23_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN23_INT_TYPE_MSB WLAN_GPIO_PIN23_INT_TYPE_MSB -#define GPIO_PIN23_INT_TYPE_LSB WLAN_GPIO_PIN23_INT_TYPE_LSB -#define GPIO_PIN23_INT_TYPE_MASK WLAN_GPIO_PIN23_INT_TYPE_MASK -#define GPIO_PIN23_INT_TYPE_GET(x) WLAN_GPIO_PIN23_INT_TYPE_GET(x) -#define GPIO_PIN23_INT_TYPE_SET(x) WLAN_GPIO_PIN23_INT_TYPE_SET(x) -#define GPIO_PIN23_PAD_DRIVER_MSB WLAN_GPIO_PIN23_PAD_DRIVER_MSB -#define GPIO_PIN23_PAD_DRIVER_LSB WLAN_GPIO_PIN23_PAD_DRIVER_LSB -#define GPIO_PIN23_PAD_DRIVER_MASK WLAN_GPIO_PIN23_PAD_DRIVER_MASK -#define GPIO_PIN23_PAD_DRIVER_GET(x) WLAN_GPIO_PIN23_PAD_DRIVER_GET(x) -#define GPIO_PIN23_PAD_DRIVER_SET(x) WLAN_GPIO_PIN23_PAD_DRIVER_SET(x) -#define GPIO_PIN23_SOURCE_MSB WLAN_GPIO_PIN23_SOURCE_MSB -#define GPIO_PIN23_SOURCE_LSB WLAN_GPIO_PIN23_SOURCE_LSB -#define GPIO_PIN23_SOURCE_MASK WLAN_GPIO_PIN23_SOURCE_MASK -#define GPIO_PIN23_SOURCE_GET(x) WLAN_GPIO_PIN23_SOURCE_GET(x) -#define GPIO_PIN23_SOURCE_SET(x) WLAN_GPIO_PIN23_SOURCE_SET(x) -#define GPIO_PIN24_ADDRESS WLAN_GPIO_PIN24_ADDRESS -#define GPIO_PIN24_OFFSET WLAN_GPIO_PIN24_OFFSET -#define GPIO_PIN24_CONFIG_MSB WLAN_GPIO_PIN24_CONFIG_MSB -#define GPIO_PIN24_CONFIG_LSB WLAN_GPIO_PIN24_CONFIG_LSB -#define GPIO_PIN24_CONFIG_MASK WLAN_GPIO_PIN24_CONFIG_MASK -#define GPIO_PIN24_CONFIG_GET(x) WLAN_GPIO_PIN24_CONFIG_GET(x) -#define GPIO_PIN24_CONFIG_SET(x) WLAN_GPIO_PIN24_CONFIG_SET(x) -#define GPIO_PIN24_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN24_WAKEUP_ENABLE_MSB -#define GPIO_PIN24_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN24_WAKEUP_ENABLE_LSB -#define GPIO_PIN24_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN24_WAKEUP_ENABLE_MASK -#define GPIO_PIN24_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN24_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN24_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN24_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN24_INT_TYPE_MSB WLAN_GPIO_PIN24_INT_TYPE_MSB -#define GPIO_PIN24_INT_TYPE_LSB WLAN_GPIO_PIN24_INT_TYPE_LSB -#define GPIO_PIN24_INT_TYPE_MASK WLAN_GPIO_PIN24_INT_TYPE_MASK -#define GPIO_PIN24_INT_TYPE_GET(x) WLAN_GPIO_PIN24_INT_TYPE_GET(x) -#define GPIO_PIN24_INT_TYPE_SET(x) WLAN_GPIO_PIN24_INT_TYPE_SET(x) -#define GPIO_PIN24_PAD_DRIVER_MSB WLAN_GPIO_PIN24_PAD_DRIVER_MSB -#define GPIO_PIN24_PAD_DRIVER_LSB WLAN_GPIO_PIN24_PAD_DRIVER_LSB -#define GPIO_PIN24_PAD_DRIVER_MASK WLAN_GPIO_PIN24_PAD_DRIVER_MASK -#define GPIO_PIN24_PAD_DRIVER_GET(x) WLAN_GPIO_PIN24_PAD_DRIVER_GET(x) -#define GPIO_PIN24_PAD_DRIVER_SET(x) WLAN_GPIO_PIN24_PAD_DRIVER_SET(x) -#define GPIO_PIN24_SOURCE_MSB WLAN_GPIO_PIN24_SOURCE_MSB -#define GPIO_PIN24_SOURCE_LSB WLAN_GPIO_PIN24_SOURCE_LSB -#define GPIO_PIN24_SOURCE_MASK WLAN_GPIO_PIN24_SOURCE_MASK -#define GPIO_PIN24_SOURCE_GET(x) WLAN_GPIO_PIN24_SOURCE_GET(x) -#define GPIO_PIN24_SOURCE_SET(x) WLAN_GPIO_PIN24_SOURCE_SET(x) -#define GPIO_PIN25_ADDRESS WLAN_GPIO_PIN25_ADDRESS -#define GPIO_PIN25_OFFSET WLAN_GPIO_PIN25_OFFSET -#define GPIO_PIN25_CONFIG_MSB WLAN_GPIO_PIN25_CONFIG_MSB -#define GPIO_PIN25_CONFIG_LSB WLAN_GPIO_PIN25_CONFIG_LSB -#define GPIO_PIN25_CONFIG_MASK WLAN_GPIO_PIN25_CONFIG_MASK -#define GPIO_PIN25_CONFIG_GET(x) WLAN_GPIO_PIN25_CONFIG_GET(x) -#define GPIO_PIN25_CONFIG_SET(x) WLAN_GPIO_PIN25_CONFIG_SET(x) -#define GPIO_PIN25_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN25_WAKEUP_ENABLE_MSB -#define GPIO_PIN25_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN25_WAKEUP_ENABLE_LSB -#define GPIO_PIN25_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN25_WAKEUP_ENABLE_MASK -#define GPIO_PIN25_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN25_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN25_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN25_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN25_INT_TYPE_MSB WLAN_GPIO_PIN25_INT_TYPE_MSB -#define GPIO_PIN25_INT_TYPE_LSB WLAN_GPIO_PIN25_INT_TYPE_LSB -#define GPIO_PIN25_INT_TYPE_MASK WLAN_GPIO_PIN25_INT_TYPE_MASK -#define GPIO_PIN25_INT_TYPE_GET(x) WLAN_GPIO_PIN25_INT_TYPE_GET(x) -#define GPIO_PIN25_INT_TYPE_SET(x) WLAN_GPIO_PIN25_INT_TYPE_SET(x) -#define GPIO_PIN25_PAD_DRIVER_MSB WLAN_GPIO_PIN25_PAD_DRIVER_MSB -#define GPIO_PIN25_PAD_DRIVER_LSB WLAN_GPIO_PIN25_PAD_DRIVER_LSB -#define GPIO_PIN25_PAD_DRIVER_MASK WLAN_GPIO_PIN25_PAD_DRIVER_MASK -#define GPIO_PIN25_PAD_DRIVER_GET(x) WLAN_GPIO_PIN25_PAD_DRIVER_GET(x) -#define GPIO_PIN25_PAD_DRIVER_SET(x) WLAN_GPIO_PIN25_PAD_DRIVER_SET(x) -#define GPIO_PIN25_SOURCE_MSB WLAN_GPIO_PIN25_SOURCE_MSB -#define GPIO_PIN25_SOURCE_LSB WLAN_GPIO_PIN25_SOURCE_LSB -#define GPIO_PIN25_SOURCE_MASK WLAN_GPIO_PIN25_SOURCE_MASK -#define GPIO_PIN25_SOURCE_GET(x) WLAN_GPIO_PIN25_SOURCE_GET(x) -#define GPIO_PIN25_SOURCE_SET(x) WLAN_GPIO_PIN25_SOURCE_SET(x) -#define SIGMA_DELTA_ADDRESS WLAN_SIGMA_DELTA_ADDRESS -#define SIGMA_DELTA_OFFSET WLAN_SIGMA_DELTA_OFFSET -#define SIGMA_DELTA_ENABLE_MSB WLAN_SIGMA_DELTA_ENABLE_MSB -#define SIGMA_DELTA_ENABLE_LSB WLAN_SIGMA_DELTA_ENABLE_LSB -#define SIGMA_DELTA_ENABLE_MASK WLAN_SIGMA_DELTA_ENABLE_MASK -#define SIGMA_DELTA_ENABLE_GET(x) WLAN_SIGMA_DELTA_ENABLE_GET(x) -#define SIGMA_DELTA_ENABLE_SET(x) WLAN_SIGMA_DELTA_ENABLE_SET(x) -#define SIGMA_DELTA_PRESCALAR_MSB WLAN_SIGMA_DELTA_PRESCALAR_MSB -#define SIGMA_DELTA_PRESCALAR_LSB WLAN_SIGMA_DELTA_PRESCALAR_LSB -#define SIGMA_DELTA_PRESCALAR_MASK WLAN_SIGMA_DELTA_PRESCALAR_MASK -#define SIGMA_DELTA_PRESCALAR_GET(x) WLAN_SIGMA_DELTA_PRESCALAR_GET(x) -#define SIGMA_DELTA_PRESCALAR_SET(x) WLAN_SIGMA_DELTA_PRESCALAR_SET(x) -#define SIGMA_DELTA_TARGET_MSB WLAN_SIGMA_DELTA_TARGET_MSB -#define SIGMA_DELTA_TARGET_LSB WLAN_SIGMA_DELTA_TARGET_LSB -#define SIGMA_DELTA_TARGET_MASK WLAN_SIGMA_DELTA_TARGET_MASK -#define SIGMA_DELTA_TARGET_GET(x) WLAN_SIGMA_DELTA_TARGET_GET(x) -#define SIGMA_DELTA_TARGET_SET(x) WLAN_SIGMA_DELTA_TARGET_SET(x) -#define DEBUG_CONTROL_ADDRESS WLAN_DEBUG_CONTROL_ADDRESS -#define DEBUG_CONTROL_OFFSET WLAN_DEBUG_CONTROL_OFFSET -#define DEBUG_CONTROL_ENABLE_MSB WLAN_DEBUG_CONTROL_ENABLE_MSB -#define DEBUG_CONTROL_ENABLE_LSB WLAN_DEBUG_CONTROL_ENABLE_LSB -#define DEBUG_CONTROL_ENABLE_MASK WLAN_DEBUG_CONTROL_ENABLE_MASK -#define DEBUG_CONTROL_ENABLE_GET(x) WLAN_DEBUG_CONTROL_ENABLE_GET(x) -#define DEBUG_CONTROL_ENABLE_SET(x) WLAN_DEBUG_CONTROL_ENABLE_SET(x) -#define DEBUG_INPUT_SEL_ADDRESS WLAN_DEBUG_INPUT_SEL_ADDRESS -#define DEBUG_INPUT_SEL_OFFSET WLAN_DEBUG_INPUT_SEL_OFFSET -#define DEBUG_INPUT_SEL_SHIFT_MSB WLAN_DEBUG_INPUT_SEL_SHIFT_MSB -#define DEBUG_INPUT_SEL_SHIFT_LSB WLAN_DEBUG_INPUT_SEL_SHIFT_LSB -#define DEBUG_INPUT_SEL_SHIFT_MASK WLAN_DEBUG_INPUT_SEL_SHIFT_MASK -#define DEBUG_INPUT_SEL_SHIFT_GET(x) WLAN_DEBUG_INPUT_SEL_SHIFT_GET(x) -#define DEBUG_INPUT_SEL_SHIFT_SET(x) WLAN_DEBUG_INPUT_SEL_SHIFT_SET(x) -#define DEBUG_INPUT_SEL_SRC_MSB WLAN_DEBUG_INPUT_SEL_SRC_MSB -#define DEBUG_INPUT_SEL_SRC_LSB WLAN_DEBUG_INPUT_SEL_SRC_LSB -#define DEBUG_INPUT_SEL_SRC_MASK WLAN_DEBUG_INPUT_SEL_SRC_MASK -#define DEBUG_INPUT_SEL_SRC_GET(x) WLAN_DEBUG_INPUT_SEL_SRC_GET(x) -#define DEBUG_INPUT_SEL_SRC_SET(x) WLAN_DEBUG_INPUT_SEL_SRC_SET(x) -#define DEBUG_OUT_ADDRESS WLAN_DEBUG_OUT_ADDRESS -#define DEBUG_OUT_OFFSET WLAN_DEBUG_OUT_OFFSET -#define DEBUG_OUT_DATA_MSB WLAN_DEBUG_OUT_DATA_MSB -#define DEBUG_OUT_DATA_LSB WLAN_DEBUG_OUT_DATA_LSB -#define DEBUG_OUT_DATA_MASK WLAN_DEBUG_OUT_DATA_MASK -#define DEBUG_OUT_DATA_GET(x) WLAN_DEBUG_OUT_DATA_GET(x) -#define DEBUG_OUT_DATA_SET(x) WLAN_DEBUG_OUT_DATA_SET(x) -#define RESET_TUPLE_STATUS_ADDRESS WLAN_RESET_TUPLE_STATUS_ADDRESS -#define RESET_TUPLE_STATUS_OFFSET WLAN_RESET_TUPLE_STATUS_OFFSET -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MSB WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MSB -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_GET(x) WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_GET(x) -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_SET(x) WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_SET(x) -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MSB WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MSB -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_GET(x) WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_GET(x) -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_SET(x) WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_SET(x) - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mac_dma_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mac_dma_reg.h deleted file mode 100644 index d8d67f5c1c39..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mac_dma_reg.h +++ /dev/null @@ -1,601 +0,0 @@ -// -// Copyright (c) 2002-2009 Atheros Communications Inc. -// All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// - -/*****************************************************************************/ -/* AR6003 WLAN MAC DMA register definitions */ -/*****************************************************************************/ - -#ifndef _AR6000_DMAREG_H_ -#define _AR6000_DMAREG_H_ - -/* - * Definitions for the Atheros AR6003 chipset. - */ - -/* DMA Control and Interrupt Registers */ -#define MAC_DMA_CR_ADDRESS 0x00000008 /* MAC control register */ -#define MAC_DMA_CR_RXE_MASK 0x00000004 /* Receive enable */ -#define MAC_DMA_CR_RXD_MASK 0x00000020 /* Receive disable */ -#define MAC_DMA_CR_SWI_MASK 0x00000040 /* One-shot software interrupt */ - -#define MAC_DMA_RXDP_ADDRESS 0x0000000C /* MAC receive queue descriptor pointer */ - -#define MAC_DMA_CFG_ADDRESS 0x00000014 /* MAC configuration and status register */ -#define MAC_DMA_CFG_SWTD_MASK 0x00000001 /* byteswap tx descriptor words */ -#define MAC_DMA_CFG_SWTB_MASK 0x00000002 /* byteswap tx data buffer words */ -#define MAC_DMA_CFG_SWRD_MASK 0x00000004 /* byteswap rx descriptor words */ -#define MAC_DMA_CFG_SWRB_MASK 0x00000008 /* byteswap rx data buffer words */ -#define MAC_DMA_CFG_SWRG_MASK 0x00000010 /* byteswap register access data words */ -#define MAC_DMA_CFG_AP_ADHOC_INDICATION_MASK 0x00000020 /* AP/adhoc indication (0-AP, 1-Adhoc) */ -#define MAC_DMA_CFG_PHOK_MASK 0x00000100 /* PHY OK status */ -#define MAC_DMA_CFG_CLK_GATE_DIS_MASK 0x00000400 /* Clock gating disable */ - -#define MAC_DMA_MIRT_ADDRESS 0x00000020 /* Maximum rate threshold register */ -#define MAC_DMA_MIRT_THRESH_MASK 0x0000FFFF - -#define MAC_DMA_IER_ADDRESS 0x00000024 /* MAC Interrupt enable register */ -#define MAC_DMA_IER_ENABLE_MASK 0x00000001 /* Global interrupt enable */ -#define MAC_DMA_IER_DISABLE_MASK 0x00000000 /* Global interrupt disable */ - -#define MAC_DMA_TIMT_ADDRESS 0x00000028 /* Transmit Interrupt Mitigation Threshold */ -#define MAC_DMA_TIMT_LAST_PACKER_THRESH_MASK 0x0000FFFF /* Last packet threshold mask */ -#define MAC_DMA_TIMT_FIRST_PACKER_THRESH_MASK 0xFFFF0000 /* First packet threshold mask */ - -#define MAC_DMA_RIMT_ADDRESS 0x0000002C /* Receive Interrupt Mitigation Threshold */ -#define MAC_DMA_RIMT_LAST_PACKER_THRESH_MASK 0x0000FFFF /* Last packet threshold mask */ -#define MAC_DMA_RIMT_FIRST_PACKER_THRESH_MASK 0xFFFF0000 /* First packet threshold mask */ - -#define MAC_DMA_TXCFG_ADDRESS 0x00000030 /* MAC tx DMA size config register */ -#define MAC_DMA_FTRIG_MASK 0x000003F0 /* Mask for Frame trigger level */ -#define MAC_DMA_FTRIG_LSB 4 /* Shift for Frame trigger level */ -#define MAC_DMA_FTRIG_IMMED 0x00000000 /* bytes in PCU TX FIFO before air */ -#define MAC_DMA_FTRIG_64B 0x00000010 /* default */ -#define MAC_DMA_FTRIG_128B 0x00000020 -#define MAC_DMA_FTRIG_192B 0x00000030 -#define MAC_DMA_FTRIG_256B 0x00000040 /* 5 bits total */ -#define MAC_DMA_TXCFG_ADHOC_BEACON_ATIM_TX_POLICY_MASK 0x00000800 - -#define MAC_DMA_RXCFG_ADDRESS 0x00000034 /* MAC rx DMA size config register */ -#define MAC_DMA_RXCFG_ZLFDMA_MASK 0x00000010 /* Enable DMA of zero-length frame */ -#define MAC_DMA_RXCFG_DMASIZE_4B 0x00000000 /* DMA size 4 bytes (TXCFG + RXCFG) */ -#define MAC_DMA_RXCFG_DMASIZE_8B 0x00000001 /* DMA size 8 bytes */ -#define MAC_DMA_RXCFG_DMASIZE_16B 0x00000002 /* DMA size 16 bytes */ -#define MAC_DMA_RXCFG_DMASIZE_32B 0x00000003 /* DMA size 32 bytes */ -#define MAC_DMA_RXCFG_DMASIZE_64B 0x00000004 /* DMA size 64 bytes */ -#define MAC_DMA_RXCFG_DMASIZE_128B 0x00000005 /* DMA size 128 bytes */ -#define MAC_DMA_RXCFG_DMASIZE_256B 0x00000006 /* DMA size 256 bytes */ -#define MAC_DMA_RXCFG_DMASIZE_512B 0x00000007 /* DMA size 512 bytes */ - -#define MAC_DMA_MIBC_ADDRESS 0x00000040 /* MAC MIB control register */ -#define MAC_DMA_MIBC_COW_MASK 0x00000001 /* counter overflow warning */ -#define MAC_DMA_MIBC_FMC_MASK 0x00000002 /* freeze MIB counters */ -#define MAC_DMA_MIBC_CMC_MASK 0x00000004 /* clear MIB counters */ -#define MAC_DMA_MIBC_MCS_MASK 0x00000008 /* MIB counter strobe, increment all */ - -#define MAC_DMA_TOPS_ADDRESS 0x00000044 /* MAC timeout prescale count */ -#define MAC_DMA_TOPS_MASK 0x0000FFFF /* Mask for timeout prescale */ - -#define MAC_DMA_RXNPTO_ADDRESS 0x00000048 /* MAC no frame received timeout */ -#define MAC_DMA_RXNPTO_MASK 0x000003FF /* Mask for no frame received timeout */ - -#define MAC_DMA_TXNPTO_ADDRESS 0x0000004C /* MAC no frame trasmitted timeout */ -#define MAC_DMA_TXNPTO_MASK 0x000003FF /* Mask for no frame transmitted timeout */ -#define MAC_DMA_TXNPTO_QCU_MASK 0x000FFC00 /* Mask indicating the set of QCUs */ - /* for which frame completions will cause */ - /* a reset of the no frame xmit'd timeout */ - -#define MAC_DMA_RPGTO_ADDRESS 0x00000050 /* MAC receive frame gap timeout */ -#define MAC_DMA_RPGTO_MASK 0x000003FF /* Mask for receive frame gap timeout */ - -#define MAC_DMA_RPCNT_ADDRESS 0x00000054 /* MAC receive frame count limit */ -#define MAC_DMA_RPCNT_MASK 0x0000001F /* Mask for receive frame count limit */ - -#define MAC_DMA_MACMISC_ADDRESS 0x00000058 /* MAC miscellaneous control/status register */ -#define MAC_DMA_MACMISC_DMA_OBS_MASK 0x000001E0 /* Mask for DMA observation bus mux select */ -#define MAC_DMA_MACMISC_DMA_OBS_LSB 5 /* Shift for DMA observation bus mux select */ -#define MAC_DMA_MACMISC_MISC_OBS 0x00000E00 /* Mask for MISC observation bus mux select */ -#define MAC_DMA_MACMISC_MISC_OBS_LSB 9 /* Shift for MISC observation bus mux select */ -#define MAC_DMA_MACMISC_MAC_OBS_BUS_LSB 0x00007000 /* Mask for MAC observation bus mux select (lsb) */ -#define MAC_DMA_MACMISC_MAC_OBS_BUS_LSB_LSB 12 /* Shift for MAC observation bus mux select (lsb) */ -#define MAC_DMA_MACMISC_MAC_OBS_BUS_MSB 0x00038000 /* Mask for MAC observation bus mux select (msb) */ -#define MAC_DMA_MACMISC_MAC_OBS_BUS_MSB_LSB 15 /* Shift for MAC observation bus mux select (msb) */ - - -#define MAC_DMA_ISR_ADDRESS 0x00000080 /* MAC Primary interrupt status register */ -/* - * Interrupt Status Registers - * - * Only the bits in the ISR_P register and the IMR_P registers - * control whether the MAC's INTA# output is asserted. The bits in - * the secondary interrupt status/mask registers control what bits - * are set in the primary interrupt status register; however the - * IMR_S* registers DO NOT determine whether INTA# is asserted. - * That is INTA# is asserted only when the logical AND of ISR_P - * and IMR_P is non-zero. The secondary interrupt mask/status - * registers affect what bits are set in ISR_P but they do not - * directly affect whether INTA# is asserted. - */ -#define MAC_DMA_ISR_RXOK_MASK 0x00000001 /* At least one frame received sans errors */ -#define MAC_DMA_ISR_RXDESC_MASK 0x00000002 /* Receive interrupt request */ -#define MAC_DMA_ISR_RXERR_MASK 0x00000004 /* Receive error interrupt */ -#define MAC_DMA_ISR_RXNOPKT_MASK 0x00000008 /* No frame received within timeout clock */ -#define MAC_DMA_ISR_RXEOL_MASK 0x00000010 /* Received descriptor empty interrupt */ -#define MAC_DMA_ISR_RXORN_MASK 0x00000020 /* Receive FIFO overrun interrupt */ -#define MAC_DMA_ISR_TXOK_MASK 0x00000040 /* Transmit okay interrupt */ -#define MAC_DMA_ISR_TXDESC_MASK 0x00000080 /* Transmit interrupt request */ -#define MAC_DMA_ISR_TXERR_MASK 0x00000100 /* Transmit error interrupt */ -#define MAC_DMA_ISR_TXNOPKT_MASK 0x00000200 /* No frame transmitted interrupt */ -#define MAC_DMA_ISR_TXEOL_MASK 0x00000400 /* Transmit descriptor empty interrupt */ -#define MAC_DMA_ISR_TXURN_MASK 0x00000800 /* Transmit FIFO underrun interrupt */ -#define MAC_DMA_ISR_MIB_MASK 0x00001000 /* MIB interrupt - see MIBC */ -#define MAC_DMA_ISR_SWI_MASK 0x00002000 /* Software interrupt */ -#define MAC_DMA_ISR_RXPHY_MASK 0x00004000 /* PHY receive error interrupt */ -#define MAC_DMA_ISR_RXKCM_MASK 0x00008000 /* Key-cache miss interrupt */ -#define MAC_DMA_ISR_BRSSI_HI_MASK 0x00010000 /* Beacon rssi high threshold interrupt */ -#define MAC_DMA_ISR_BRSSI_LO_MASK 0x00020000 /* Beacon threshold interrupt */ -#define MAC_DMA_ISR_BMISS_MASK 0x00040000 /* Beacon missed interrupt */ -#define MAC_DMA_ISR_TXMINTR_MASK 0x00080000 /* Maximum transmit interrupt rate */ -#define MAC_DMA_ISR_BNR_MASK 0x00100000 /* Beacon not ready interrupt */ -#define MAC_DMA_ISR_HIUERR_MASK 0x00200000 /* An unexpected bus error has occurred */ -#define MAC_DMA_ISR_BCNMISC_MASK 0x00800000 /* 'or' of TIM, CABEND, DTIMSYNC, BCNTO */ -#define MAC_DMA_ISR_RXMINTR_MASK 0x01000000 /* Maximum receive interrupt rate */ -#define MAC_DMA_ISR_QCBROVF_MASK 0x02000000 /* QCU CBR overflow interrupt */ -#define MAC_DMA_ISR_QCBRURN_MASK 0x04000000 /* QCU CBR underrun interrupt */ -#define MAC_DMA_ISR_QTRIG_MASK 0x08000000 /* QCU scheduling trigger interrupt */ -#define MAC_DMA_ISR_TIMER_MASK 0x10000000 /* GENTMR interrupt */ -#define MAC_DMA_ISR_HCFTO_MASK 0x20000000 /* HCFTO interrupt */ -#define MAC_DMA_ISR_TXINTM_MASK 0x40000000 /* Transmit completion mitigation interrupt */ -#define MAC_DMA_ISR_RXINTM_MASK 0x80000000 /* Receive completion mitigation interrupt */ - -#define MAC_DMA_ISR_S0_ADDRESS 0x00000084 /* MAC Secondary interrupt status register 0 */ -#define MAC_DMA_ISR_S0_QCU_TXOK_MASK 0x000003FF /* Mask for TXOK (QCU 0-9) */ -#define MAC_DMA_ISR_S0_QCU_TXOK_LSB 0 -#define MAC_DMA_ISR_S0_QCU_TXDESC_MASK 0x03FF0000 /* Mask for TXDESC (QCU 0-9) */ -#define MAC_DMA_ISR_S0_QCU_TXDESC_LSB 16 - -#define MAC_DMA_ISR_S1_ADDRESS 0x00000088 /* MAC Secondary interrupt status register 1 */ -#define MAC_DMA_ISR_S1_QCU_TXERR_MASK 0x000003FF /* Mask for TXERR (QCU 0-9) */ -#define MAC_DMA_ISR_S1_QCU_TXERR_LSB 0 -#define MAC_DMA_ISR_S1_QCU_TXEOL_MASK 0x03FF0000 /* Mask for TXEOL (QCU 0-9) */ -#define MAC_DMA_ISR_S1_QCU_TXEOL_LSB 16 - -#define MAC_DMA_ISR_S2_ADDRESS 0x0000008c /* MAC Secondary interrupt status register 2 */ -#define MAC_DMA_ISR_S2_QCU_TXURN_MASK 0x000003FF /* Mask for TXURN (QCU 0-9) */ -#define MAC_DMA_ISR_S2_QCU_TXURN_LSB 0 /* Shift for TXURN (QCU 0-9) */ -#define MAC_DMA_ISR_S2_RX_INT_MASK 0x00000800 -#define MAC_DMA_ISR_S2_WL_STOMPED_MASK 0x00001000 -#define MAC_DMA_ISR_S2_RX_PTR_BAD_MASK 0x00002000 -#define MAC_DMA_ISR_S2_BT_LOW_PRIORITY_RISING_MASK 0x00004000 -#define MAC_DMA_ISR_S2_BT_LOW_PRIORITY_FALLING_MASK 0x00008000 -#define MAC_DMA_ISR_S2_BB_PANIC_IRQ_MASK 0x00010000 -#define MAC_DMA_ISR_S2_BT_STOMPED_MASK 0x00020000 -#define MAC_DMA_ISR_S2_BT_ACTIVE_RISING_MASK 0x00040000 -#define MAC_DMA_ISR_S2_BT_ACTIVE_FALLING_MASK 0x00080000 -#define MAC_DMA_ISR_S2_BT_PRIORITY_RISING_MASK 0x00100000 -#define MAC_DMA_ISR_S2_BT_PRIORITY_FALLING_MASK 0x00200000 -#define MAC_DMA_ISR_S2_CST_MASK 0x00400000 -#define MAC_DMA_ISR_S2_GTT_MASK 0x00800000 -#define MAC_DMA_ISR_S2_TIM_MASK 0x01000000 /* TIM */ -#define MAC_DMA_ISR_S2_CABEND_MASK 0x02000000 /* CABEND */ -#define MAC_DMA_ISR_S2_DTIMSYNC_MASK 0x04000000 /* DTIMSYNC */ -#define MAC_DMA_ISR_S2_BCNTO_MASK 0x08000000 /* BCNTO */ -#define MAC_DMA_ISR_S2_CABTO_MASK 0x10000000 /* CABTO */ -#define MAC_DMA_ISR_S2_DTIM_MASK 0x20000000 /* DTIM */ -#define MAC_DMA_ISR_S2_TSFOOR_MASK 0x40000000 /* TSFOOR */ - -#define MAC_DMA_ISR_S3_ADDRESS 0x00000090 /* MAC Secondary interrupt status register 3 */ -#define MAC_DMA_ISR_S3_QCU_QCBROVF_MASK 0x000003FF /* Mask for QCBROVF (QCU 0-9) */ -#define MAC_DMA_ISR_S3_QCU_QCBRURN_MASK 0x03FF0000 /* Mask for QCBRURN (QCU 0-9) */ - -#define MAC_DMA_ISR_S4_ADDRESS 0x00000094 /* MAC Secondary interrupt status register 4 */ -#define MAC_DMA_ISR_S4_QCU_QTRIG_MASK 0x000003FF /* Mask for QTRIG (QCU 0-9) */ - -#define MAC_DMA_ISR_S5_ADDRESS 0x00000098 /* MAC Secondary interrupt status register 5 */ -#define MAC_DMA_ISR_S5_TBTT_TIMER_TRIGGER_MASK 0x00000001 -#define MAC_DMA_ISR_S5_DBA_TIMER_TRIGGER_MASK 0x00000002 -#define MAC_DMA_ISR_S5_SBA_TIMER_TRIGGER_MASK 0x00000004 -#define MAC_DMA_ISR_S5_HCF_TIMER_TRIGGER_MASK 0x00000008 -#define MAC_DMA_ISR_S5_TIM_TIMER_TRIGGER_MASK 0x00000010 -#define MAC_DMA_ISR_S5_DTIM_TIMER_TRIGGER_MASK 0x00000020 -#define MAC_DMA_ISR_S5_QUIET_TIMER_TRIGGER_MASK 0x00000040 -#define MAC_DMA_ISR_S5_NDP_TIMER_TRIGGER_MASK 0x00000080 -#define MAC_DMA_ISR_S5_GENERIC_TIMER2_TRIGGER_MASK 0x0000FF00 -#define MAC_DMA_ISR_S5_GENERIC_TIMER2_TRIGGER_LSB 8 -#define MAC_DMA_ISR_S5_GENERIC_TIMER2_TRIGGER(_i) (0x00000100 << (_i)) -#define MAC_DMA_ISR_S5_TIMER_OVERFLOW_MASK 0x00010000 -#define MAC_DMA_ISR_S5_DBA_TIMER_THRESHOLD_MASK 0x00020000 -#define MAC_DMA_ISR_S5_SBA_TIMER_THRESHOLD_MASK 0x00040000 -#define MAC_DMA_ISR_S5_HCF_TIMER_THRESHOLD_MASK 0x00080000 -#define MAC_DMA_ISR_S5_TIM_TIMER_THRESHOLD_MASK 0x00100000 -#define MAC_DMA_ISR_S5_DTIM_TIMER_THRESHOLD_MASK 0x00200000 -#define MAC_DMA_ISR_S5_QUIET_TIMER_THRESHOLD_MASK 0x00400000 -#define MAC_DMA_ISR_S5_NDP_TIMER_THRESHOLD_MASK 0x00800000 -#define MAC_DMA_IMR_S5_GENERIC_TIMER2_THRESHOLD_MASK 0xFF000000 -#define MAC_DMA_IMR_S5_GENERIC_TIMER2_THRESHOLD_LSB 24 -#define MAC_DMA_IMR_S5_GENERIC_TIMER2_THRESHOLD(_i) (0x01000000 << (_i)) - -#define MAC_DMA_IMR_ADDRESS 0x000000A0 /* MAC Primary interrupt mask register */ -/* - * Interrupt Mask Registers - * - * Only the bits in the IMR control whether the MAC's INTA# - * output will be asserted. The bits in the secondary interrupt - * mask registers control what bits get set in the primary - * interrupt status register; however the IMR_S* registers - * DO NOT determine whether INTA# is asserted. - */ -#define MAC_DMA_IMR_RXOK_MASK 0x00000001 /* At least one frame received sans errors */ -#define MAC_DMA_IMR_RXDESC_MASK 0x00000002 /* Receive interrupt request */ -#define MAC_DMA_IMR_RXERR_MASK 0x00000004 /* Receive error interrupt */ -#define MAC_DMA_IMR_RXNOPKT_MASK 0x00000008 /* No frame received within timeout clock */ -#define MAC_DMA_IMR_RXEOL_MASK 0x00000010 /* Received descriptor empty interrupt */ -#define MAC_DMA_IMR_RXORN_MASK 0x00000020 /* Receive FIFO overrun interrupt */ -#define MAC_DMA_IMR_TXOK_MASK 0x00000040 /* Transmit okay interrupt */ -#define MAC_DMA_IMR_TXDESC_MASK 0x00000080 /* Transmit interrupt request */ -#define MAC_DMA_IMR_TXERR_MASK 0x00000100 /* Transmit error interrupt */ -#define MAC_DMA_IMR_TXNOPKT_MASK 0x00000200 /* No frame transmitted interrupt */ -#define MAC_DMA_IMR_TXEOL_MASK 0x00000400 /* Transmit descriptor empty interrupt */ -#define MAC_DMA_IMR_TXURN_MASK 0x00000800 /* Transmit FIFO underrun interrupt */ -#define MAC_DMA_IMR_MIB_MASK 0x00001000 /* MIB interrupt - see MIBC */ -#define MAC_DMA_IMR_SWI_MASK 0x00002000 /* Software interrupt */ -#define MAC_DMA_IMR_RXPHY_MASK 0x00004000 /* PHY receive error interrupt */ -#define MAC_DMA_IMR_RXKCM_MASK 0x00008000 /* Key-cache miss interrupt */ -#define MAC_DMA_IMR_BRSSI_HI_MASK 0x00010000 /* Beacon rssi hi threshold interrupt */ -#define MAC_DMA_IMR_BRSSI_LO_MASK 0x00020000 /* Beacon rssi lo threshold interrupt */ -#define MAC_DMA_IMR_BMISS_MASK 0x00040000 /* Beacon missed interrupt */ -#define MAC_DMA_IMR_TXMINTR_MASK 0x00080000 /* Maximum transmit interrupt rate */ -#define MAC_DMA_IMR_BNR_MASK 0x00100000 /* BNR interrupt */ -#define MAC_DMA_IMR_HIUERR_MASK 0x00200000 /* An unexpected bus error has occurred */ -#define MAC_DMA_IMR_BCNMISC_MASK 0x00800000 /* Beacon Misc */ -#define MAC_DMA_IMR_RXMINTR_MASK 0x01000000 /* Maximum receive interrupt rate */ -#define MAC_DMA_IMR_QCBROVF_MASK 0x02000000 /* QCU CBR overflow interrupt */ -#define MAC_DMA_IMR_QCBRURN_MASK 0x04000000 /* QCU CBR underrun interrupt */ -#define MAC_DMA_IMR_QTRIG_MASK 0x08000000 /* QCU scheduling trigger interrupt */ -#define MAC_DMA_IMR_TIMER_MASK 0x10000000 /* GENTMR interrupt */ -#define MAC_DMA_IMR_HCFTO_MASK 0x20000000 /* HCFTO interrupt*/ -#define MAC_DMA_IMR_TXINTM_MASK 0x40000000 /* Transmit completion mitigation interrupt */ -#define MAC_DMA_IMR_RXINTM_MASK 0x80000000 /* Receive completion mitigation interrupt */ - -#define MAC_DMA_IMR_S0_ADDRESS 0x000000A4 /* MAC Secondary interrupt mask register 0 */ -#define MAC_DMA_IMR_S0_QCU_TXOK_MASK 0x000003FF /* TXOK (QCU 0-9) */ -#define MAC_DMA_IMR_S0_QCU_TXOK_LSB 0 -#define MAC_DMA_IMR_S0_QCU_TXDESC_MASK 0x03FF0000 /* TXDESC (QCU 0-9) */ -#define MAC_DMA_IMR_S0_QCU_TXDESC_LSB 16 - -#define MAC_DMA_IMR_S1_ADDRESS 0x000000A8 /* MAC Secondary interrupt mask register 1 */ -#define MAC_DMA_IMR_S1_QCU_TXERR_MASK 0x000003FF /* TXERR (QCU 0-9) */ -#define MAC_DMA_IMR_S1_QCU_TXERR_LSB 0 -#define MAC_DMA_IMR_S1_QCU_TXEOL_MASK 0x03FF0000 /* TXEOL (QCU 0-9) */ -#define MAC_DMA_IMR_S1_QCU_TXEOL_LSB 16 - -#define MAC_DMA_IMR_S2_ADDRESS 0x000000AC /* MAC Secondary interrupt mask register 2 */ -#define MAC_DMA_IMR_S2_QCU_TXURN_MASK 0x000003FF /* Mask for TXURN (QCU 0-9) */ -#define MAC_DMA_IMR_S2_QCU_TXURN_LSB 0 -#define MAC_DMA_IMR_S2_RX_INT_MASK 0x00000800 -#define MAC_DMA_IMR_S2_WL_STOMPED_MASK 0x00001000 -#define MAC_DMA_IMR_S2_RX_PTR_BAD_MASK 0x00002000 -#define MAC_DMA_IMR_S2_BT_LOW_PRIORITY_RISING_MASK 0x00004000 -#define MAC_DMA_IMR_S2_BT_LOW_PRIORITY_FALLING_MASK 0x00008000 -#define MAC_DMA_IMR_S2_BB_PANIC_IRQ_MASK 0x00010000 -#define MAC_DMA_IMR_S2_BT_STOMPED_MASK 0x00020000 -#define MAC_DMA_IMR_S2_BT_ACTIVE_RISING_MASK 0x00040000 -#define MAC_DMA_IMR_S2_BT_ACTIVE_FALLING_MASK 0x00080000 -#define MAC_DMA_IMR_S2_BT_PRIORITY_RISING_MASK 0x00100000 -#define MAC_DMA_IMR_S2_BT_PRIORITY_FALLING_MASK 0x00200000 -#define MAC_DMA_IMR_S2_CST_MASK 0x00400000 -#define MAC_DMA_IMR_S2_GTT_MASK 0x00800000 -#define MAC_DMA_IMR_S2_TIM_MASK 0x01000000 /* TIM */ -#define MAC_DMA_IMR_S2_CABEND_MASK 0x02000000 /* CABEND */ -#define MAC_DMA_IMR_S2_DTIMSYNC_MASK 0x04000000 /* DTIMSYNC */ -#define MAC_DMA_IMR_S2_BCNTO_MASK 0x08000000 /* BCNTO */ -#define MAC_DMA_IMR_S2_CABTO_MASK 0x10000000 /* CABTO */ -#define MAC_DMA_IMR_S2_DTIM_MASK 0x20000000 /* DTIM */ -#define MAC_DMA_IMR_S2_TSFOOR_MASK 0x40000000 /* TSFOOR */ - -#define MAC_DMA_IMR_S3_ADDRESS 0x000000B0 /* MAC Secondary interrupt mask register 3 */ -#define MAC_DMA_IMR_S3_QCU_QCBROVF_MASK 0x000003FF /* Mask for QCBROVF (QCU 0-9) */ -#define MAC_DMA_IMR_S3_QCU_QCBRURN_MASK 0x03FF0000 /* Mask for QCBRURN (QCU 0-9) */ -#define MAC_DMA_IMR_S3_QCU_QCBRURN_LSB 16 - -#define MAC_DMA_IMR_S4_ADDRESS 0x000000B4 /* MAC Secondary interrupt mask register 4 */ -#define MAC_DMA_IMR_S4_QCU_QTRIG_MASK 0x000003FF /* Mask for QTRIG (QCU 0-9) */ - -#define MAC_DMA_IMR_S5_ADDRESS 0x000000B8 /* MAC Secondary interrupt mask register 5 */ -#define MAC_DMA_IMR_S5_TBTT_TIMER_TRIGGER_MASK 0x00000001 -#define MAC_DMA_IMR_S5_DBA_TIMER_TRIGGER_MASK 0x00000002 -#define MAC_DMA_IMR_S5_SBA_TIMER_TRIGGER_MASK 0x00000004 -#define MAC_DMA_IMR_S5_HCF_TIMER_TRIGGER_MASK 0x00000008 -#define MAC_DMA_IMR_S5_TIM_TIMER_TRIGGER_MASK 0x00000010 -#define MAC_DMA_IMR_S5_DTIM_TIMER_TRIGGER_MASK 0x00000020 -#define MAC_DMA_IMR_S5_QUIET_TIMER_TRIGGER_MASK 0x00000040 -#define MAC_DMA_IMR_S5_NDP_TIMER_TRIGGER_MASK 0x00000080 -#define MAC_DMA_IMR_S5_GENERIC_TIMER2_TRIGGER_MASK 0x0000FF00 -#define MAC_DMA_IMR_S5_GENERIC_TIMER2_TRIGGER_LSB 8 -#define MAC_DMA_IMR_S5_GENERIC_TIMER2_TRIGGER(_i) (0x100 << (_i)) -#define MAC_DMA_IMR_S5_TIMER_OVERFLOW_MASK 0x00010000 -#define MAC_DMA_IMR_S5_DBA_TIMER_THRESHOLD_MASK 0x00020000 -#define MAC_DMA_IMR_S5_SBA_TIMER_THRESHOLD_MASK 0x00040000 -#define MAC_DMA_IMR_S5_HCF_TIMER_THRESHOLD_MASK 0x00080000 -#define MAC_DMA_IMR_S5_TIM_TIMER_THRESHOLD_MASK 0x00100000 -#define MAC_DMA_IMR_S5_DTIM_TIMER_THRESHOLD_MASK 0x00200000 -#define MAC_DMA_IMR_S5_QUIET_TIMER_THRESHOLD_MASK 0000400000 -#define MAC_DMA_IMR_S5_NDP_TIMER_THRESHOLD_MASK 0x00800000 -#define MAC_DMA_IMR_S5_GENERIC_TIMER2_THRESHOLD_MASK 0xFF000000 -#define MAC_DMA_IMR_S5_GENERIC_TIMER2_THRESHOLD_LSB 24 -#define MAC_DMA_IMR_S5_GENERIC_TIMER2_THRESHOLD(_i) (0x01000000 << (_i)) - -#define MAC_DMA_ISR_RAC_ADDRESS 0x000000C0 /* ISR read-and-clear access */ - -/* Shadow copies with read-and-clear access */ -#define MAC_DMA_ISR_S0_S_ADDRESS 0x000000C4 /* ISR_S0 shadow copy */ -#define MAC_DMA_ISR_S1_S_ADDRESS 0x000000C8 /* ISR_S1 shadow copy */ -#define MAC_DMA_ISR_S2_S_ADDRESS 0x000000Cc /* ISR_S2 shadow copy */ -#define MAC_DMA_ISR_S3_S_ADDRESS 0x000000D0 /* ISR_S3 shadow copy */ -#define MAC_DMA_ISR_S4_S_ADDRESS 0x000000D4 /* ISR_S4 shadow copy */ -#define MAC_DMA_ISR_S5_S_ADDRESS 0x000000D8 /* ISR_S5 shadow copy */ - -#define MAC_DMA_Q0_TXDP_ADDRESS 0x00000800 /* MAC Transmit Queue descriptor pointer */ -#define MAC_DMA_Q1_TXDP_ADDRESS 0x00000804 /* MAC Transmit Queue descriptor pointer */ -#define MAC_DMA_Q2_TXDP_ADDRESS 0x00000808 /* MAC Transmit Queue descriptor pointer */ -#define MAC_DMA_Q3_TXDP_ADDRESS 0x0000080C /* MAC Transmit Queue descriptor pointer */ -#define MAC_DMA_Q4_TXDP_ADDRESS 0x00000810 /* MAC Transmit Queue descriptor pointer */ -#define MAC_DMA_Q5_TXDP_ADDRESS 0x00000814 /* MAC Transmit Queue descriptor pointer */ -#define MAC_DMA_Q6_TXDP_ADDRESS 0x00000818 /* MAC Transmit Queue descriptor pointer */ -#define MAC_DMA_Q7_TXDP_ADDRESS 0x0000081C /* MAC Transmit Queue descriptor pointer */ -#define MAC_DMA_Q8_TXDP_ADDRESS 0x00000820 /* MAC Transmit Queue descriptor pointer */ -#define MAC_DMA_Q9_TXDP_ADDRESS 0x00000824 /* MAC Transmit Queue descriptor pointer */ -#define MAC_DMA_QTXDP_ADDRESS(_i) (MAC_DMA_Q0_TXDP_ADDRESS + ((_i)<<2)) - -#define MAC_DMA_Q_TXE_ADDRESS 0x00000840 /* MAC Transmit Queue enable */ -#define MAC_DMA_Q_TXD_ADDRESS 0x00000880 /* MAC Transmit Queue disable */ -/* QCU registers */ - -#define MAC_DMA_Q0_CBRCFG_ADDRESS 0x000008C0 /* MAC CBR configuration */ -#define MAC_DMA_Q1_CBRCFG_ADDRESS 0x000008C4 /* MAC CBR configuration */ -#define MAC_DMA_Q2_CBRCFG_ADDRESS 0x000008C8 /* MAC CBR configuration */ -#define MAC_DMA_Q3_CBRCFG_ADDRESS 0x000008CC /* MAC CBR configuration */ -#define MAC_DMA_Q4_CBRCFG_ADDRESS 0x000008D0 /* MAC CBR configuration */ -#define MAC_DMA_Q5_CBRCFG_ADDRESS 0x000008D4 /* MAC CBR configuration */ -#define MAC_DMA_Q6_CBRCFG_ADDRESS 0x000008D8 /* MAC CBR configuration */ -#define MAC_DMA_Q7_CBRCFG_ADDRESS 0x000008DC /* MAC CBR configuration */ -#define MAC_DMA_Q8_CBRCFG_ADDRESS 0x000008E0 /* MAC CBR configuration */ -#define MAC_DMA_Q9_CBRCFG_ADDRESS 0x000008E4 /* MAC CBR configuration */ -#define MAC_DMA_QCBRCFG_ADDRESS(_i) (MAC_DMA_Q0_CBRCFG_ADDRESS + ((_i)<<2)) - -#define MAC_DMA_Q_CBRCFG_CBR_INTERVAL_MASK 0x00FFFFFF /* Mask for CBR interval (us) */ -#define MAC_DMA_Q_CBRCFG_CBR_INTERVAL_LSB 0 /* Shift for CBR interval */ -#define MAC_DMA_Q_CBRCFG_CBR_OVF_THRESH_MASK 0xFF000000 /* Mask for CBR overflow threshold */ -#define MAC_DMA_Q_CBRCFG_CBR_OVF_THRESH_LSB 24 /* Shift for CBR overflow thresh */ - - -#define MAC_DMA_Q0_RDYTIMECFG_ADDRESS 0x00000900 /* MAC ReadyTime configuration */ -#define MAC_DMA_Q1_RDYTIMECFG_ADDRESS 0x00000904 /* MAC ReadyTime configuration */ -#define MAC_DMA_Q2_RDYTIMECFG_ADDRESS 0x00000908 /* MAC ReadyTime configuration */ -#define MAC_DMA_Q3_RDYTIMECFG_ADDRESS 0x0000090C /* MAC ReadyTime configuration */ -#define MAC_DMA_Q4_RDYTIMECFG_ADDRESS 0x00000910 /* MAC ReadyTime configuration */ -#define MAC_DMA_Q5_RDYTIMECFG_ADDRESS 0x00000914 /* MAC ReadyTime configuration */ -#define MAC_DMA_Q6_RDYTIMECFG_ADDRESS 0x00000918 /* MAC ReadyTime configuration */ -#define MAC_DMA_Q7_RDYTIMECFG_ADDRESS 0x0000091C /* MAC ReadyTime configuration */ -#define MAC_DMA_Q8_RDYTIMECFG_ADDRESS 0x00000920 /* MAC ReadyTime configuration */ -#define MAC_DMA_Q9_RDYTIMECFG_ADDRESS 0x00000924 /* MAC ReadyTime configuration */ -#define MAC_DMA_QRDYTIMECFG_ADDRESS(_i) (MAC_DMA_Q0_RDYTIMECFG_ADDRESS + ((_i)<<2)) - -#define MAC_DMA_Q_RDYTIMECFG_INT_MASK 0x00FFFFFF /* CBR interval (us) */ -#define MAC_DMA_Q_RDYTIMECFG_INT_LSB 0 /* Shift for ReadyTime Interval (us) */ -#define MAC_DMA_Q_RDYTIMECFG_ENA_MASK 0x01000000 /* CBR enable */ - -#define MAC_DMA_Q_ONESHOTMAC_DMAM_SC_ADDRESS 0x00000940 /* MAC OneShotArm set control */ -#define MAC_DMA_Q_ONESHOTMAC_DMAM_CC_ADDRESS 0x00000980 /* MAC OneShotArm clear control */ - -#define MAC_DMA_Q0_MISC_ADDRESS 0x000009C0 /* MAC Miscellaneous QCU settings */ -#define MAC_DMA_Q1_MISC_ADDRESS 0x000009C4 /* MAC Miscellaneous QCU settings */ -#define MAC_DMA_Q2_MISC_ADDRESS 0x000009C8 /* MAC Miscellaneous QCU settings */ -#define MAC_DMA_Q3_MISC_ADDRESS 0x000009CC /* MAC Miscellaneous QCU settings */ -#define MAC_DMA_Q4_MISC_ADDRESS 0x000009D0 /* MAC Miscellaneous QCU settings */ -#define MAC_DMA_Q5_MISC_ADDRESS 0x000009D4 /* MAC Miscellaneous QCU settings */ -#define MAC_DMA_Q6_MISC_ADDRESS 0x000009D8 /* MAC Miscellaneous QCU settings */ -#define MAC_DMA_Q7_MISC_ADDRESS 0x000009DC /* MAC Miscellaneous QCU settings */ -#define MAC_DMA_Q8_MISC_ADDRESS 0x000009E0 /* MAC Miscellaneous QCU settings */ -#define MAC_DMA_Q9_MISC_ADDRESS 0x000009E4 /* MAC Miscellaneous QCU settings */ -#define MAC_DMA_QMISC_ADDRESS(_i) (MAC_DMA_Q0_MISC_ADDRESS + ((_i)<<2)) - -#define MAC_DMA_Q_MISC_FSP_MASK 0x0000000F /* Frame Scheduling Policy mask */ -#define MAC_DMA_Q_MISC_FSP_ASAP 0 /* ASAP */ -#define MAC_DMA_Q_MISC_FSP_CBR 1 /* CBR */ -#define MAC_DMA_Q_MISC_FSP_DBA_GATED 2 /* DMA Beacon Alert gated */ -#define MAC_DMA_Q_MISC_FSP_TIM_GATED 3 /* TIM gated */ -#define MAC_DMA_Q_MISC_FSP_BEACON_SENT_GATED 4 /* Beacon-sent-gated */ -#define MAC_DMA_Q_MISC_ONE_SHOT_EN_MASK 0x00000010 /* OneShot enable */ -#define MAC_DMA_Q_MISC_CBR_INCR_DIS1_MASK 0x00000020 /* Disable CBR expired counter incr - (empty q) */ -#define MAC_DMA_Q_MISC_CBR_INCR_DIS0_MASK 0x00000040 /* Disable CBR expired counter incr - (empty beacon q) */ -#define MAC_DMA_Q_MISC_BEACON_USE_MASK 0x00000080 /* Beacon use indication */ -#define MAC_DMA_Q_MISC_CBR_EXP_CNTR_LIMIT_MASK 0x00000100 /* CBR expired counter limit enable */ -#define MAC_DMA_Q_MISC_RDYTIME_EXP_POLICY_MASK 0x00000200 /* Enable TXE cleared on ReadyTime expired or VEOL */ -#define MAC_DMA_Q_MISC_RESET_CBR_EXP_CTR_MASK 0x00000400 /* Reset CBR expired counter */ -#define MAC_DMA_Q_MISC_DCU_EARLY_TERM_REQ_MASK 0x00000800 /* DCU frame early termination request control */ - -#define MAC_DMA_Q0_STS_ADDRESS 0x00000A00 /* MAC Miscellaneous QCU status */ -#define MAC_DMA_Q1_STS_ADDRESS 0x00000A04 /* MAC Miscellaneous QCU status */ -#define MAC_DMA_Q2_STS_ADDRESS 0x00000A08 /* MAC Miscellaneous QCU status */ -#define MAC_DMA_Q3_STS_ADDRESS 0x00000A0C /* MAC Miscellaneous QCU status */ -#define MAC_DMA_Q4_STS_ADDRESS 0x00000A10 /* MAC Miscellaneous QCU status */ -#define MAC_DMA_Q5_STS_ADDRESS 0x00000A14 /* MAC Miscellaneous QCU status */ -#define MAC_DMA_Q6_STS_ADDRESS 0x00000A18 /* MAC Miscellaneous QCU status */ -#define MAC_DMA_Q7_STS_ADDRESS 0x00000A1C /* MAC Miscellaneous QCU status */ -#define MAC_DMA_Q8_STS_ADDRESS 0x00000A20 /* MAC Miscellaneous QCU status */ -#define MAC_DMA_Q9_STS_ADDRESS 0x00000A24 /* MAC Miscellaneous QCU status */ -#define MAC_DMA_QSTS_ADDRESS(_i) (MAC_DMA_Q0_STS_ADDRESS + ((_i)<<2)) - -#define MAC_DMA_Q_STS_PEND_FR_CNT_MASK 0x00000003 /* Mask for Pending Frame Count */ -#define MAC_DMA_Q_STS_CBR_EXP_CNT_MASK 0x0000FF00 /* Mask for CBR expired counter */ - -#define MAC_DMA_Q_RDYTIMESHDN_ADDRESS 0x00000A40 /* MAC ReadyTimeShutdown status */ - -/* DCU registers */ - -#define MAC_DMA_D0_QCUMASK_ADDRESS 0x00001000 /* MAC QCU Mask */ -#define MAC_DMA_D1_QCUMASK_ADDRESS 0x00001004 /* MAC QCU Mask */ -#define MAC_DMA_D2_QCUMASK_ADDRESS 0x00001008 /* MAC QCU Mask */ -#define MAC_DMA_D3_QCUMASK_ADDRESS 0x0000100C /* MAC QCU Mask */ -#define MAC_DMA_D4_QCUMASK_ADDRESS 0x00001010 /* MAC QCU Mask */ -#define MAC_DMA_D5_QCUMASK_ADDRESS 0x00001014 /* MAC QCU Mask */ -#define MAC_DMA_D6_QCUMASK_ADDRESS 0x00001018 /* MAC QCU Mask */ -#define MAC_DMA_D7_QCUMASK_ADDRESS 0x0000101C /* MAC QCU Mask */ -#define MAC_DMA_D8_QCUMASK_ADDRESS 0x00001020 /* MAC QCU Mask */ -#define MAC_DMA_D9_QCUMASK_ADDRESS 0x00001024 /* MAC QCU Mask */ -#define MAC_DMA_DQCUMASK_ADDRESS(_i) (MAC_DMA_D0_QCUMASK_ADDRESS + ((_i)<<2)) - -#define MAC_DMA_D_QCUMASK_MASK 0x000003FF /* Mask for QCU Mask (QCU 0-9) */ - -#define MAC_DMA_D_GBL_IFS_SIFS_ADDRESS 0x00001030 /* DCU global SIFS settings */ - - -#define MAC_DMA_D0_LCL_IFS_ADDRESS 0x00001040 /* MAC DCU-specific IFS settings */ -#define MAC_DMA_D1_LCL_IFS_ADDRESS 0x00001044 /* MAC DCU-specific IFS settings */ -#define MAC_DMA_D2_LCL_IFS_ADDRESS 0x00001048 /* MAC DCU-specific IFS settings */ -#define MAC_DMA_D3_LCL_IFS_ADDRESS 0x0000104C /* MAC DCU-specific IFS settings */ -#define MAC_DMA_D4_LCL_IFS_ADDRESS 0x00001050 /* MAC DCU-specific IFS settings */ -#define MAC_DMA_D5_LCL_IFS_ADDRESS 0x00001054 /* MAC DCU-specific IFS settings */ -#define MAC_DMA_D6_LCL_IFS_ADDRESS 0x00001058 /* MAC DCU-specific IFS settings */ -#define MAC_DMA_D7_LCL_IFS_ADDRESS 0x0000105C /* MAC DCU-specific IFS settings */ -#define MAC_DMA_D8_LCL_IFS_ADDRESS 0x00001060 /* MAC DCU-specific IFS settings */ -#define MAC_DMA_D9_LCL_IFS_ADDRESS 0x00001064 /* MAC DCU-specific IFS settings */ -#define MAC_DMA_DLCL_IFS_ADDRESS(_i) (MAC_DMA_D0_LCL_IFS_ADDRESS + ((_i)<<2)) -#define MAC_DMA_D_LCL_IFS_CWMIN_MASK 0x000003FF /* Mask for CW_MIN */ -#define MAC_DMA_D_LCL_IFS_CWMIN_LSB 0 -#define MAC_DMA_D_LCL_IFS_CWMAX_MASK 0x000FFC00 /* Mask for CW_MAX */ -#define MAC_DMA_D_LCL_IFS_CWMAX_LSB 10 -#define MAC_DMA_D_LCL_IFS_AIFS_MASK 0x0FF00000 /* Mask for AIFS */ -#define MAC_DMA_D_LCL_IFS_AIFS_LSB 20 -/* - * Note: even though this field is 8 bits wide the - * maximum supported AIFS value is 0xFc. Setting the AIFS value - * to 0xFd 0xFe, or 0xFf will not work correctly and will cause - * the DCU to hang. - */ -#define MAC_DMA_D_GBL_IFS_SLOT_ADDRESS 0x00001070 /* DC global slot interval */ - -#define MAC_DMA_D0_RETRY_LIMIT_ADDRESS 0x00001080 /* MAC Retry limits */ -#define MAC_DMA_D1_RETRY_LIMIT_ADDRESS 0x00001084 /* MAC Retry limits */ -#define MAC_DMA_D2_RETRY_LIMIT_ADDRESS 0x00001088 /* MAC Retry limits */ -#define MAC_DMA_D3_RETRY_LIMIT_ADDRESS 0x0000108C /* MAC Retry limits */ -#define MAC_DMA_D4_RETRY_LIMIT_ADDRESS 0x00001090 /* MAC Retry limits */ -#define MAC_DMA_D5_RETRY_LIMIT_ADDRESS 0x00001094 /* MAC Retry limits */ -#define MAC_DMA_D6_RETRY_LIMIT_ADDRESS 0x00001098 /* MAC Retry limits */ -#define MAC_DMA_D7_RETRY_LIMIT_ADDRESS 0x0000109C /* MAC Retry limits */ -#define MAC_DMA_D8_RETRY_LIMIT_ADDRESS 0x000010A0 /* MAC Retry limits */ -#define MAC_DMA_D9_RETRY_LIMIT_ADDRESS 0x000010A4 /* MAC Retry limits */ -#define MAC_DMA_DRETRY_LIMIT_ADDRESS(_i) (MAC_DMA_D0_RETRY_LIMIT_ADDRESS + ((_i)<<2)) - -#define MAC_DMA_D_RETRY_LIMIT_FR_RTS_MASK 0x0000000F /* frame RTS failure limit */ -#define MAC_DMA_D_RETRY_LIMIT_FR_RTS_LSB 0 -#define MAC_DMA_D_RETRY_LIMIT_STA_RTS_MASK 0x00003F00 /* station RTS failure limit */ -#define MAC_DMA_D_RETRY_LIMIT_STA_RTS_LSB 8 -#define MAC_DMA_D_RETRY_LIMIT_STA_DATA_MASK 0x000FC000 /* station short retry limit */ -#define MAC_DMA_D_RETRY_LIMIT_STA_DATA_LSB 14 - -#define MAC_DMA_D_GBL_IFS_EIFS_ADDRESS 0x000010B0 /* DCU global EIFS setting */ - -#define MAC_DMA_D0_CHNTIME_ADDRESS 0x000010C0 /* MAC ChannelTime settings */ -#define MAC_DMA_D1_CHNTIME_ADDRESS 0x000010C4 /* MAC ChannelTime settings */ -#define MAC_DMA_D2_CHNTIME_ADDRESS 0x000010C8 /* MAC ChannelTime settings */ -#define MAC_DMA_D3_CHNTIME_ADDRESS 0x000010CC /* MAC ChannelTime settings */ -#define MAC_DMA_D4_CHNTIME_ADDRESS 0x000010D0 /* MAC ChannelTime settings */ -#define MAC_DMA_D5_CHNTIME_ADDRESS 0x000010D4 /* MAC ChannelTime settings */ -#define MAC_DMA_D6_CHNTIME_ADDRESS 0x000010D8 /* MAC ChannelTime settings */ -#define MAC_DMA_D7_CHNTIME_ADDRESS 0x000010DC /* MAC ChannelTime settings */ -#define MAC_DMA_D8_CHNTIME_ADDRESS 0x000010E0 /* MAC ChannelTime settings */ -#define MAC_DMA_D9_CHNTIME_ADDRESS 0x000010E4 /* MAC ChannelTime settings */ -#define MAC_DMA_DCHNTIME_ADDRESS(_i) (MAC_DMA_D0_CHNTIME_ADDRESS + ((_i)<<2)) - -#define MAC_DMA_D_CHNTIME_DUR_MASK 0x000FFFFF /* ChannelTime duration (us) */ -#define MAC_DMA_D_CHNTIME_DUR_LSB 0 /* Shift for ChannelTime duration */ -#define MAC_DMA_D_CHNTIME_EN_MASK 0x00100000 /* ChannelTime enable */ - -#define MAC_DMA_D_GBL_IFS_MISC_ADDRESS 0x000010f0 /* DCU global misc. IFS settings */ -#define MAC_DMA_D_GBL_IFS_MISC_LFSR_SLICE_SEL_MASK 0x00000007 /* LFSR slice select */ -#define MAC_DMA_D_GBL_IFS_MISC_TURBO_MODE_MASK 0x00000008 /* Turbo mode indication */ -#define MAC_DMA_D_GBL_IFS_MISC_DCU_ARBITER_DLY_MASK 0x00300000 /* DCU arbiter delay */ -#define MAC_DMA_D_GBL_IFS_IGNORE_BACKOFF_MASK 0x10000000 - -#define MAC_DMA_D0_MISC_ADDRESS 0x00001100 /* MAC Miscellaneous DCU-specific settings */ -#define MAC_DMA_D1_MISC_ADDRESS 0x00001104 /* MAC Miscellaneous DCU-specific settings */ -#define MAC_DMA_D2_MISC_ADDRESS 0x00001108 /* MAC Miscellaneous DCU-specific settings */ -#define MAC_DMA_D3_MISC_ADDRESS 0x0000110C /* MAC Miscellaneous DCU-specific settings */ -#define MAC_DMA_D4_MISC_ADDRESS 0x00001110 /* MAC Miscellaneous DCU-specific settings */ -#define MAC_DMA_D5_MISC_ADDRESS 0x00001114 /* MAC Miscellaneous DCU-specific settings */ -#define MAC_DMA_D6_MISC_ADDRESS 0x00001118 /* MAC Miscellaneous DCU-specific settings */ -#define MAC_DMA_D7_MISC_ADDRESS 0x0000111C /* MAC Miscellaneous DCU-specific settings */ -#define MAC_DMA_D8_MISC_ADDRESS 0x00001120 /* MAC Miscellaneous DCU-specific settings */ -#define MAC_DMA_D9_MISC_ADDRESS 0x00001124 /* MAC Miscellaneous DCU-specific settings */ -#define MAC_DMA_DMISC_ADDRESS(_i) (MAC_DMA_D0_MISC_ADDRESS + ((_i)<<2)) - -#define MAC_DMA_D0_EOL_ADDRESS 0x00001180 -#define MAC_DMA_D1_EOL_ADDRESS 0x00001184 -#define MAC_DMA_D2_EOL_ADDRESS 0x00001188 -#define MAC_DMA_D3_EOL_ADDRESS 0x0000118C -#define MAC_DMA_D4_EOL_ADDRESS 0x00001190 -#define MAC_DMA_D5_EOL_ADDRESS 0x00001194 -#define MAC_DMA_D6_EOL_ADDRESS 0x00001198 -#define MAC_DMA_D7_EOL_ADDRESS 0x0000119C -#define MAC_DMA_D8_EOL_ADDRESS 0x00001200 -#define MAC_DMA_D9_EOL_ADDRESS 0x00001204 -#define MAC_DMA_DEOL_ADDRESS(_i) (MAC_DMA_D0_EOL_ADDRESS + ((_i)<<2)) - -#define MAC_DMA_D_MISC_BKOFF_THRESH_MASK 0x0000003F /* Backoff threshold */ -#define MAC_DMA_D_MISC_BACK_OFF_THRESH_LSB 0 -#define MAC_DMA_D_MISC_ETS_RTS_MASK 0x00000040 /* End of transmission series - station RTS/data failure - count reset policy */ -#define MAC_DMA_D_MISC_ETS_CW_MASK 0x00000080 /* End of transmission series - CW reset policy */ -#define MAC_DMA_D_MISC_FRAG_WAIT_EN_MASK 0x00000100 /* Fragment Starvation Policy */ - -#define MAC_DMA_D_MISC_FRAG_BKOFF_EN_MASK 0x00000200 /* Backoff during a frag burst */ -#define MAC_DMA_D_MISC_HCF_POLL_EN_MASK 0x00000800 /* HFC poll enable */ -#define MAC_DMA_D_MISC_BKOFF_PERSISTENCE_MASK 0x00001000 /* Backoff persistence factor - setting */ -#define MAC_DMA_D_MISC_VIR_COL_HANDLING_MASK 0x0000C000 /* Mask for Virtual collision - handling policy */ -#define MAC_DMA_D_MISC_VIR_COL_HANDLING_LSB 14 -#define MAC_DMA_D_MISC_VIR_COL_HANDLING_DEFAULT 0 /* Normal */ -#define MAC_DMA_D_MISC_VIR_COL_HANDLING_IGNORE 1 /* Ignore */ -#define MAC_DMA_D_MISC_BEACON_USE_MASK 0x00010000 /* Beacon use indication */ -#define MAC_DMA_D_MISC_ARB_LOCKOUT_CNTRL_MASK 0x00060000 /* Mask for DCU arbiter lockout control */ -#define MAC_DMA_D_MISC_ARB_LOCKOUT_CNTRL_LSB 17 -#define MAC_DMA_D_MISC_ARB_LOCKOUT_CNTRL_NONE 0 /* No lockout*/ -#define MAC_DMA_D_MISC_ARB_LOCKOUT_CNTRL_INTRA_FR 1 /* Intra-frame*/ -#define MAC_DMA_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL 2 /* Global */ -#define MAC_DMA_D_MISC_ARB_LOCKOUT_IGNORE_MASK 0x00080000 /* DCU arbiter lockout ignore control */ -#define MAC_DMA_D_MISC_SEQ_NUM_INCR_DIS_MASK 0x00100000 /* Sequence number increment disable */ -#define MAC_DMA_D_MISC_POST_FR_BKOFF_DIS_MASK 0x00200000 /* Post-frame backoff disable */ -#define MAC_DMA_D_MISC_VIRT_COLL_POLICY_MASK 0x00400000 /* Virtual coll. handling policy */ -#define MAC_DMA_D_MISC_BLOWN_IFS_POLICY_MASK 0x00800000 /* Blown IFS handling policy */ - -#define MAC_DMA_D_SEQNUM_ADDRESS 0x00001140 /* MAC Frame sequence number */ - - - -#define MAC_DMA_D_FPCTL_ADDRESS 0x00001230 /* DCU frame prefetch settings */ -#define MAC_DMA_D_TXPSE_ADDRESS 0x00001270 /* DCU transmit pause control/status */ - -#endif /* _AR6000_DMMAEG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mac_pcu_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mac_pcu_reg.h deleted file mode 100644 index 0d039bb4c994..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mac_pcu_reg.h +++ /dev/null @@ -1,3065 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _MAC_PCU_REG_H_ -#define _MAC_PCU_REG_H_ - -#define MAC_PCU_STA_ADDR_L32_ADDRESS 0x00008000 -#define MAC_PCU_STA_ADDR_L32_OFFSET 0x00000000 -#define MAC_PCU_STA_ADDR_L32_ADDR_31_0_MSB 31 -#define MAC_PCU_STA_ADDR_L32_ADDR_31_0_LSB 0 -#define MAC_PCU_STA_ADDR_L32_ADDR_31_0_MASK 0xffffffff -#define MAC_PCU_STA_ADDR_L32_ADDR_31_0_GET(x) (((x) & MAC_PCU_STA_ADDR_L32_ADDR_31_0_MASK) >> MAC_PCU_STA_ADDR_L32_ADDR_31_0_LSB) -#define MAC_PCU_STA_ADDR_L32_ADDR_31_0_SET(x) (((x) << MAC_PCU_STA_ADDR_L32_ADDR_31_0_LSB) & MAC_PCU_STA_ADDR_L32_ADDR_31_0_MASK) - -#define MAC_PCU_STA_ADDR_U16_ADDRESS 0x00008004 -#define MAC_PCU_STA_ADDR_U16_OFFSET 0x00000004 -#define MAC_PCU_STA_ADDR_U16_ADHOC_MCAST_SEARCH_MSB 31 -#define MAC_PCU_STA_ADDR_U16_ADHOC_MCAST_SEARCH_LSB 31 -#define MAC_PCU_STA_ADDR_U16_ADHOC_MCAST_SEARCH_MASK 0x80000000 -#define MAC_PCU_STA_ADDR_U16_ADHOC_MCAST_SEARCH_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_ADHOC_MCAST_SEARCH_MASK) >> MAC_PCU_STA_ADDR_U16_ADHOC_MCAST_SEARCH_LSB) -#define MAC_PCU_STA_ADDR_U16_ADHOC_MCAST_SEARCH_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_ADHOC_MCAST_SEARCH_LSB) & MAC_PCU_STA_ADDR_U16_ADHOC_MCAST_SEARCH_MASK) -#define MAC_PCU_STA_ADDR_U16_CBCIV_ENDIAN_MSB 30 -#define MAC_PCU_STA_ADDR_U16_CBCIV_ENDIAN_LSB 30 -#define MAC_PCU_STA_ADDR_U16_CBCIV_ENDIAN_MASK 0x40000000 -#define MAC_PCU_STA_ADDR_U16_CBCIV_ENDIAN_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_CBCIV_ENDIAN_MASK) >> MAC_PCU_STA_ADDR_U16_CBCIV_ENDIAN_LSB) -#define MAC_PCU_STA_ADDR_U16_CBCIV_ENDIAN_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_CBCIV_ENDIAN_LSB) & MAC_PCU_STA_ADDR_U16_CBCIV_ENDIAN_MASK) -#define MAC_PCU_STA_ADDR_U16_PRESERVE_SEQNUM_MSB 29 -#define MAC_PCU_STA_ADDR_U16_PRESERVE_SEQNUM_LSB 29 -#define MAC_PCU_STA_ADDR_U16_PRESERVE_SEQNUM_MASK 0x20000000 -#define MAC_PCU_STA_ADDR_U16_PRESERVE_SEQNUM_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_PRESERVE_SEQNUM_MASK) >> MAC_PCU_STA_ADDR_U16_PRESERVE_SEQNUM_LSB) -#define MAC_PCU_STA_ADDR_U16_PRESERVE_SEQNUM_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_PRESERVE_SEQNUM_LSB) & MAC_PCU_STA_ADDR_U16_PRESERVE_SEQNUM_MASK) -#define MAC_PCU_STA_ADDR_U16_KSRCH_MODE_MSB 28 -#define MAC_PCU_STA_ADDR_U16_KSRCH_MODE_LSB 28 -#define MAC_PCU_STA_ADDR_U16_KSRCH_MODE_MASK 0x10000000 -#define MAC_PCU_STA_ADDR_U16_KSRCH_MODE_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_KSRCH_MODE_MASK) >> MAC_PCU_STA_ADDR_U16_KSRCH_MODE_LSB) -#define MAC_PCU_STA_ADDR_U16_KSRCH_MODE_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_KSRCH_MODE_LSB) & MAC_PCU_STA_ADDR_U16_KSRCH_MODE_MASK) -#define MAC_PCU_STA_ADDR_U16_CRPT_MIC_ENABLE_MSB 27 -#define MAC_PCU_STA_ADDR_U16_CRPT_MIC_ENABLE_LSB 27 -#define MAC_PCU_STA_ADDR_U16_CRPT_MIC_ENABLE_MASK 0x08000000 -#define MAC_PCU_STA_ADDR_U16_CRPT_MIC_ENABLE_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_CRPT_MIC_ENABLE_MASK) >> MAC_PCU_STA_ADDR_U16_CRPT_MIC_ENABLE_LSB) -#define MAC_PCU_STA_ADDR_U16_CRPT_MIC_ENABLE_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_CRPT_MIC_ENABLE_LSB) & MAC_PCU_STA_ADDR_U16_CRPT_MIC_ENABLE_MASK) -#define MAC_PCU_STA_ADDR_U16_SECTOR_SELF_GEN_MSB 26 -#define MAC_PCU_STA_ADDR_U16_SECTOR_SELF_GEN_LSB 26 -#define MAC_PCU_STA_ADDR_U16_SECTOR_SELF_GEN_MASK 0x04000000 -#define MAC_PCU_STA_ADDR_U16_SECTOR_SELF_GEN_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_SECTOR_SELF_GEN_MASK) >> MAC_PCU_STA_ADDR_U16_SECTOR_SELF_GEN_LSB) -#define MAC_PCU_STA_ADDR_U16_SECTOR_SELF_GEN_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_SECTOR_SELF_GEN_LSB) & MAC_PCU_STA_ADDR_U16_SECTOR_SELF_GEN_MASK) -#define MAC_PCU_STA_ADDR_U16_BASE_RATE_11B_MSB 25 -#define MAC_PCU_STA_ADDR_U16_BASE_RATE_11B_LSB 25 -#define MAC_PCU_STA_ADDR_U16_BASE_RATE_11B_MASK 0x02000000 -#define MAC_PCU_STA_ADDR_U16_BASE_RATE_11B_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_BASE_RATE_11B_MASK) >> MAC_PCU_STA_ADDR_U16_BASE_RATE_11B_LSB) -#define MAC_PCU_STA_ADDR_U16_BASE_RATE_11B_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_BASE_RATE_11B_LSB) & MAC_PCU_STA_ADDR_U16_BASE_RATE_11B_MASK) -#define MAC_PCU_STA_ADDR_U16_ACKCTS_6MB_MSB 24 -#define MAC_PCU_STA_ADDR_U16_ACKCTS_6MB_LSB 24 -#define MAC_PCU_STA_ADDR_U16_ACKCTS_6MB_MASK 0x01000000 -#define MAC_PCU_STA_ADDR_U16_ACKCTS_6MB_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_ACKCTS_6MB_MASK) >> MAC_PCU_STA_ADDR_U16_ACKCTS_6MB_LSB) -#define MAC_PCU_STA_ADDR_U16_ACKCTS_6MB_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_ACKCTS_6MB_LSB) & MAC_PCU_STA_ADDR_U16_ACKCTS_6MB_MASK) -#define MAC_PCU_STA_ADDR_U16_RTS_USE_DEF_MSB 23 -#define MAC_PCU_STA_ADDR_U16_RTS_USE_DEF_LSB 23 -#define MAC_PCU_STA_ADDR_U16_RTS_USE_DEF_MASK 0x00800000 -#define MAC_PCU_STA_ADDR_U16_RTS_USE_DEF_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_RTS_USE_DEF_MASK) >> MAC_PCU_STA_ADDR_U16_RTS_USE_DEF_LSB) -#define MAC_PCU_STA_ADDR_U16_RTS_USE_DEF_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_RTS_USE_DEF_LSB) & MAC_PCU_STA_ADDR_U16_RTS_USE_DEF_MASK) -#define MAC_PCU_STA_ADDR_U16_DEFANT_UPDATE_MSB 22 -#define MAC_PCU_STA_ADDR_U16_DEFANT_UPDATE_LSB 22 -#define MAC_PCU_STA_ADDR_U16_DEFANT_UPDATE_MASK 0x00400000 -#define MAC_PCU_STA_ADDR_U16_DEFANT_UPDATE_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_DEFANT_UPDATE_MASK) >> MAC_PCU_STA_ADDR_U16_DEFANT_UPDATE_LSB) -#define MAC_PCU_STA_ADDR_U16_DEFANT_UPDATE_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_DEFANT_UPDATE_LSB) & MAC_PCU_STA_ADDR_U16_DEFANT_UPDATE_MASK) -#define MAC_PCU_STA_ADDR_U16_USE_DEFANT_MSB 21 -#define MAC_PCU_STA_ADDR_U16_USE_DEFANT_LSB 21 -#define MAC_PCU_STA_ADDR_U16_USE_DEFANT_MASK 0x00200000 -#define MAC_PCU_STA_ADDR_U16_USE_DEFANT_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_USE_DEFANT_MASK) >> MAC_PCU_STA_ADDR_U16_USE_DEFANT_LSB) -#define MAC_PCU_STA_ADDR_U16_USE_DEFANT_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_USE_DEFANT_LSB) & MAC_PCU_STA_ADDR_U16_USE_DEFANT_MASK) -#define MAC_PCU_STA_ADDR_U16_PCF_MSB 20 -#define MAC_PCU_STA_ADDR_U16_PCF_LSB 20 -#define MAC_PCU_STA_ADDR_U16_PCF_MASK 0x00100000 -#define MAC_PCU_STA_ADDR_U16_PCF_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_PCF_MASK) >> MAC_PCU_STA_ADDR_U16_PCF_LSB) -#define MAC_PCU_STA_ADDR_U16_PCF_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_PCF_LSB) & MAC_PCU_STA_ADDR_U16_PCF_MASK) -#define MAC_PCU_STA_ADDR_U16_KEYSRCH_DIS_MSB 19 -#define MAC_PCU_STA_ADDR_U16_KEYSRCH_DIS_LSB 19 -#define MAC_PCU_STA_ADDR_U16_KEYSRCH_DIS_MASK 0x00080000 -#define MAC_PCU_STA_ADDR_U16_KEYSRCH_DIS_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_KEYSRCH_DIS_MASK) >> MAC_PCU_STA_ADDR_U16_KEYSRCH_DIS_LSB) -#define MAC_PCU_STA_ADDR_U16_KEYSRCH_DIS_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_KEYSRCH_DIS_LSB) & MAC_PCU_STA_ADDR_U16_KEYSRCH_DIS_MASK) -#define MAC_PCU_STA_ADDR_U16_PW_SAVE_MSB 18 -#define MAC_PCU_STA_ADDR_U16_PW_SAVE_LSB 18 -#define MAC_PCU_STA_ADDR_U16_PW_SAVE_MASK 0x00040000 -#define MAC_PCU_STA_ADDR_U16_PW_SAVE_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_PW_SAVE_MASK) >> MAC_PCU_STA_ADDR_U16_PW_SAVE_LSB) -#define MAC_PCU_STA_ADDR_U16_PW_SAVE_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_PW_SAVE_LSB) & MAC_PCU_STA_ADDR_U16_PW_SAVE_MASK) -#define MAC_PCU_STA_ADDR_U16_ADHOC_MSB 17 -#define MAC_PCU_STA_ADDR_U16_ADHOC_LSB 17 -#define MAC_PCU_STA_ADDR_U16_ADHOC_MASK 0x00020000 -#define MAC_PCU_STA_ADDR_U16_ADHOC_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_ADHOC_MASK) >> MAC_PCU_STA_ADDR_U16_ADHOC_LSB) -#define MAC_PCU_STA_ADDR_U16_ADHOC_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_ADHOC_LSB) & MAC_PCU_STA_ADDR_U16_ADHOC_MASK) -#define MAC_PCU_STA_ADDR_U16_STA_AP_MSB 16 -#define MAC_PCU_STA_ADDR_U16_STA_AP_LSB 16 -#define MAC_PCU_STA_ADDR_U16_STA_AP_MASK 0x00010000 -#define MAC_PCU_STA_ADDR_U16_STA_AP_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_STA_AP_MASK) >> MAC_PCU_STA_ADDR_U16_STA_AP_LSB) -#define MAC_PCU_STA_ADDR_U16_STA_AP_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_STA_AP_LSB) & MAC_PCU_STA_ADDR_U16_STA_AP_MASK) -#define MAC_PCU_STA_ADDR_U16_ADDR_47_32_MSB 15 -#define MAC_PCU_STA_ADDR_U16_ADDR_47_32_LSB 0 -#define MAC_PCU_STA_ADDR_U16_ADDR_47_32_MASK 0x0000ffff -#define MAC_PCU_STA_ADDR_U16_ADDR_47_32_GET(x) (((x) & MAC_PCU_STA_ADDR_U16_ADDR_47_32_MASK) >> MAC_PCU_STA_ADDR_U16_ADDR_47_32_LSB) -#define MAC_PCU_STA_ADDR_U16_ADDR_47_32_SET(x) (((x) << MAC_PCU_STA_ADDR_U16_ADDR_47_32_LSB) & MAC_PCU_STA_ADDR_U16_ADDR_47_32_MASK) - -#define MAC_PCU_BSSID_L32_ADDRESS 0x00008008 -#define MAC_PCU_BSSID_L32_OFFSET 0x00000008 -#define MAC_PCU_BSSID_L32_ADDR_MSB 31 -#define MAC_PCU_BSSID_L32_ADDR_LSB 0 -#define MAC_PCU_BSSID_L32_ADDR_MASK 0xffffffff -#define MAC_PCU_BSSID_L32_ADDR_GET(x) (((x) & MAC_PCU_BSSID_L32_ADDR_MASK) >> MAC_PCU_BSSID_L32_ADDR_LSB) -#define MAC_PCU_BSSID_L32_ADDR_SET(x) (((x) << MAC_PCU_BSSID_L32_ADDR_LSB) & MAC_PCU_BSSID_L32_ADDR_MASK) - -#define MAC_PCU_BSSID_U16_ADDRESS 0x0000800c -#define MAC_PCU_BSSID_U16_OFFSET 0x0000000c -#define MAC_PCU_BSSID_U16_AID_MSB 26 -#define MAC_PCU_BSSID_U16_AID_LSB 16 -#define MAC_PCU_BSSID_U16_AID_MASK 0x07ff0000 -#define MAC_PCU_BSSID_U16_AID_GET(x) (((x) & MAC_PCU_BSSID_U16_AID_MASK) >> MAC_PCU_BSSID_U16_AID_LSB) -#define MAC_PCU_BSSID_U16_AID_SET(x) (((x) << MAC_PCU_BSSID_U16_AID_LSB) & MAC_PCU_BSSID_U16_AID_MASK) -#define MAC_PCU_BSSID_U16_ADDR_MSB 15 -#define MAC_PCU_BSSID_U16_ADDR_LSB 0 -#define MAC_PCU_BSSID_U16_ADDR_MASK 0x0000ffff -#define MAC_PCU_BSSID_U16_ADDR_GET(x) (((x) & MAC_PCU_BSSID_U16_ADDR_MASK) >> MAC_PCU_BSSID_U16_ADDR_LSB) -#define MAC_PCU_BSSID_U16_ADDR_SET(x) (((x) << MAC_PCU_BSSID_U16_ADDR_LSB) & MAC_PCU_BSSID_U16_ADDR_MASK) - -#define MAC_PCU_BCN_RSSI_AVE_ADDRESS 0x00008010 -#define MAC_PCU_BCN_RSSI_AVE_OFFSET 0x00000010 -#define MAC_PCU_BCN_RSSI_AVE_VALUE_MSB 11 -#define MAC_PCU_BCN_RSSI_AVE_VALUE_LSB 0 -#define MAC_PCU_BCN_RSSI_AVE_VALUE_MASK 0x00000fff -#define MAC_PCU_BCN_RSSI_AVE_VALUE_GET(x) (((x) & MAC_PCU_BCN_RSSI_AVE_VALUE_MASK) >> MAC_PCU_BCN_RSSI_AVE_VALUE_LSB) -#define MAC_PCU_BCN_RSSI_AVE_VALUE_SET(x) (((x) << MAC_PCU_BCN_RSSI_AVE_VALUE_LSB) & MAC_PCU_BCN_RSSI_AVE_VALUE_MASK) - -#define MAC_PCU_ACK_CTS_TIMEOUT_ADDRESS 0x00008014 -#define MAC_PCU_ACK_CTS_TIMEOUT_OFFSET 0x00000014 -#define MAC_PCU_ACK_CTS_TIMEOUT_CTS_TIMEOUT_MSB 29 -#define MAC_PCU_ACK_CTS_TIMEOUT_CTS_TIMEOUT_LSB 16 -#define MAC_PCU_ACK_CTS_TIMEOUT_CTS_TIMEOUT_MASK 0x3fff0000 -#define MAC_PCU_ACK_CTS_TIMEOUT_CTS_TIMEOUT_GET(x) (((x) & MAC_PCU_ACK_CTS_TIMEOUT_CTS_TIMEOUT_MASK) >> MAC_PCU_ACK_CTS_TIMEOUT_CTS_TIMEOUT_LSB) -#define MAC_PCU_ACK_CTS_TIMEOUT_CTS_TIMEOUT_SET(x) (((x) << MAC_PCU_ACK_CTS_TIMEOUT_CTS_TIMEOUT_LSB) & MAC_PCU_ACK_CTS_TIMEOUT_CTS_TIMEOUT_MASK) -#define MAC_PCU_ACK_CTS_TIMEOUT_ACK_TIMEOUT_MSB 13 -#define MAC_PCU_ACK_CTS_TIMEOUT_ACK_TIMEOUT_LSB 0 -#define MAC_PCU_ACK_CTS_TIMEOUT_ACK_TIMEOUT_MASK 0x00003fff -#define MAC_PCU_ACK_CTS_TIMEOUT_ACK_TIMEOUT_GET(x) (((x) & MAC_PCU_ACK_CTS_TIMEOUT_ACK_TIMEOUT_MASK) >> MAC_PCU_ACK_CTS_TIMEOUT_ACK_TIMEOUT_LSB) -#define MAC_PCU_ACK_CTS_TIMEOUT_ACK_TIMEOUT_SET(x) (((x) << MAC_PCU_ACK_CTS_TIMEOUT_ACK_TIMEOUT_LSB) & MAC_PCU_ACK_CTS_TIMEOUT_ACK_TIMEOUT_MASK) - -#define MAC_PCU_BCN_RSSI_CTL_ADDRESS 0x00008018 -#define MAC_PCU_BCN_RSSI_CTL_OFFSET 0x00000018 -#define MAC_PCU_BCN_RSSI_CTL_RESET_MSB 29 -#define MAC_PCU_BCN_RSSI_CTL_RESET_LSB 29 -#define MAC_PCU_BCN_RSSI_CTL_RESET_MASK 0x20000000 -#define MAC_PCU_BCN_RSSI_CTL_RESET_GET(x) (((x) & MAC_PCU_BCN_RSSI_CTL_RESET_MASK) >> MAC_PCU_BCN_RSSI_CTL_RESET_LSB) -#define MAC_PCU_BCN_RSSI_CTL_RESET_SET(x) (((x) << MAC_PCU_BCN_RSSI_CTL_RESET_LSB) & MAC_PCU_BCN_RSSI_CTL_RESET_MASK) -#define MAC_PCU_BCN_RSSI_CTL_WEIGHT_MSB 28 -#define MAC_PCU_BCN_RSSI_CTL_WEIGHT_LSB 24 -#define MAC_PCU_BCN_RSSI_CTL_WEIGHT_MASK 0x1f000000 -#define MAC_PCU_BCN_RSSI_CTL_WEIGHT_GET(x) (((x) & MAC_PCU_BCN_RSSI_CTL_WEIGHT_MASK) >> MAC_PCU_BCN_RSSI_CTL_WEIGHT_LSB) -#define MAC_PCU_BCN_RSSI_CTL_WEIGHT_SET(x) (((x) << MAC_PCU_BCN_RSSI_CTL_WEIGHT_LSB) & MAC_PCU_BCN_RSSI_CTL_WEIGHT_MASK) -#define MAC_PCU_BCN_RSSI_CTL_RSSI_HIGH_THRESH_MSB 23 -#define MAC_PCU_BCN_RSSI_CTL_RSSI_HIGH_THRESH_LSB 16 -#define MAC_PCU_BCN_RSSI_CTL_RSSI_HIGH_THRESH_MASK 0x00ff0000 -#define MAC_PCU_BCN_RSSI_CTL_RSSI_HIGH_THRESH_GET(x) (((x) & MAC_PCU_BCN_RSSI_CTL_RSSI_HIGH_THRESH_MASK) >> MAC_PCU_BCN_RSSI_CTL_RSSI_HIGH_THRESH_LSB) -#define MAC_PCU_BCN_RSSI_CTL_RSSI_HIGH_THRESH_SET(x) (((x) << MAC_PCU_BCN_RSSI_CTL_RSSI_HIGH_THRESH_LSB) & MAC_PCU_BCN_RSSI_CTL_RSSI_HIGH_THRESH_MASK) -#define MAC_PCU_BCN_RSSI_CTL_MISS_THRESH_MSB 15 -#define MAC_PCU_BCN_RSSI_CTL_MISS_THRESH_LSB 8 -#define MAC_PCU_BCN_RSSI_CTL_MISS_THRESH_MASK 0x0000ff00 -#define MAC_PCU_BCN_RSSI_CTL_MISS_THRESH_GET(x) (((x) & MAC_PCU_BCN_RSSI_CTL_MISS_THRESH_MASK) >> MAC_PCU_BCN_RSSI_CTL_MISS_THRESH_LSB) -#define MAC_PCU_BCN_RSSI_CTL_MISS_THRESH_SET(x) (((x) << MAC_PCU_BCN_RSSI_CTL_MISS_THRESH_LSB) & MAC_PCU_BCN_RSSI_CTL_MISS_THRESH_MASK) -#define MAC_PCU_BCN_RSSI_CTL_RSSI_LOW_THRESH_MSB 7 -#define MAC_PCU_BCN_RSSI_CTL_RSSI_LOW_THRESH_LSB 0 -#define MAC_PCU_BCN_RSSI_CTL_RSSI_LOW_THRESH_MASK 0x000000ff -#define MAC_PCU_BCN_RSSI_CTL_RSSI_LOW_THRESH_GET(x) (((x) & MAC_PCU_BCN_RSSI_CTL_RSSI_LOW_THRESH_MASK) >> MAC_PCU_BCN_RSSI_CTL_RSSI_LOW_THRESH_LSB) -#define MAC_PCU_BCN_RSSI_CTL_RSSI_LOW_THRESH_SET(x) (((x) << MAC_PCU_BCN_RSSI_CTL_RSSI_LOW_THRESH_LSB) & MAC_PCU_BCN_RSSI_CTL_RSSI_LOW_THRESH_MASK) - -#define MAC_PCU_USEC_LATENCY_ADDRESS 0x0000801c -#define MAC_PCU_USEC_LATENCY_OFFSET 0x0000001c -#define MAC_PCU_USEC_LATENCY_RX_LATENCY_MSB 28 -#define MAC_PCU_USEC_LATENCY_RX_LATENCY_LSB 23 -#define MAC_PCU_USEC_LATENCY_RX_LATENCY_MASK 0x1f800000 -#define MAC_PCU_USEC_LATENCY_RX_LATENCY_GET(x) (((x) & MAC_PCU_USEC_LATENCY_RX_LATENCY_MASK) >> MAC_PCU_USEC_LATENCY_RX_LATENCY_LSB) -#define MAC_PCU_USEC_LATENCY_RX_LATENCY_SET(x) (((x) << MAC_PCU_USEC_LATENCY_RX_LATENCY_LSB) & MAC_PCU_USEC_LATENCY_RX_LATENCY_MASK) -#define MAC_PCU_USEC_LATENCY_TX_LATENCY_MSB 22 -#define MAC_PCU_USEC_LATENCY_TX_LATENCY_LSB 14 -#define MAC_PCU_USEC_LATENCY_TX_LATENCY_MASK 0x007fc000 -#define MAC_PCU_USEC_LATENCY_TX_LATENCY_GET(x) (((x) & MAC_PCU_USEC_LATENCY_TX_LATENCY_MASK) >> MAC_PCU_USEC_LATENCY_TX_LATENCY_LSB) -#define MAC_PCU_USEC_LATENCY_TX_LATENCY_SET(x) (((x) << MAC_PCU_USEC_LATENCY_TX_LATENCY_LSB) & MAC_PCU_USEC_LATENCY_TX_LATENCY_MASK) -#define MAC_PCU_USEC_LATENCY_USEC_MSB 7 -#define MAC_PCU_USEC_LATENCY_USEC_LSB 0 -#define MAC_PCU_USEC_LATENCY_USEC_MASK 0x000000ff -#define MAC_PCU_USEC_LATENCY_USEC_GET(x) (((x) & MAC_PCU_USEC_LATENCY_USEC_MASK) >> MAC_PCU_USEC_LATENCY_USEC_LSB) -#define MAC_PCU_USEC_LATENCY_USEC_SET(x) (((x) << MAC_PCU_USEC_LATENCY_USEC_LSB) & MAC_PCU_USEC_LATENCY_USEC_MASK) - -#define PCU_MAX_CFP_DUR_ADDRESS 0x00008020 -#define PCU_MAX_CFP_DUR_OFFSET 0x00000020 -#define PCU_MAX_CFP_DUR_VALUE_MSB 15 -#define PCU_MAX_CFP_DUR_VALUE_LSB 0 -#define PCU_MAX_CFP_DUR_VALUE_MASK 0x0000ffff -#define PCU_MAX_CFP_DUR_VALUE_GET(x) (((x) & PCU_MAX_CFP_DUR_VALUE_MASK) >> PCU_MAX_CFP_DUR_VALUE_LSB) -#define PCU_MAX_CFP_DUR_VALUE_SET(x) (((x) << PCU_MAX_CFP_DUR_VALUE_LSB) & PCU_MAX_CFP_DUR_VALUE_MASK) - -#define MAC_PCU_RX_FILTER_ADDRESS 0x00008024 -#define MAC_PCU_RX_FILTER_OFFSET 0x00000024 -#define MAC_PCU_RX_FILTER_GENERIC_FILTER_MSB 25 -#define MAC_PCU_RX_FILTER_GENERIC_FILTER_LSB 24 -#define MAC_PCU_RX_FILTER_GENERIC_FILTER_MASK 0x03000000 -#define MAC_PCU_RX_FILTER_GENERIC_FILTER_GET(x) (((x) & MAC_PCU_RX_FILTER_GENERIC_FILTER_MASK) >> MAC_PCU_RX_FILTER_GENERIC_FILTER_LSB) -#define MAC_PCU_RX_FILTER_GENERIC_FILTER_SET(x) (((x) << MAC_PCU_RX_FILTER_GENERIC_FILTER_LSB) & MAC_PCU_RX_FILTER_GENERIC_FILTER_MASK) -#define MAC_PCU_RX_FILTER_GENERIC_FTYPE_MSB 23 -#define MAC_PCU_RX_FILTER_GENERIC_FTYPE_LSB 18 -#define MAC_PCU_RX_FILTER_GENERIC_FTYPE_MASK 0x00fc0000 -#define MAC_PCU_RX_FILTER_GENERIC_FTYPE_GET(x) (((x) & MAC_PCU_RX_FILTER_GENERIC_FTYPE_MASK) >> MAC_PCU_RX_FILTER_GENERIC_FTYPE_LSB) -#define MAC_PCU_RX_FILTER_GENERIC_FTYPE_SET(x) (((x) << MAC_PCU_RX_FILTER_GENERIC_FTYPE_LSB) & MAC_PCU_RX_FILTER_GENERIC_FTYPE_MASK) -#define MAC_PCU_RX_FILTER_FROM_TO_DS_MSB 17 -#define MAC_PCU_RX_FILTER_FROM_TO_DS_LSB 17 -#define MAC_PCU_RX_FILTER_FROM_TO_DS_MASK 0x00020000 -#define MAC_PCU_RX_FILTER_FROM_TO_DS_GET(x) (((x) & MAC_PCU_RX_FILTER_FROM_TO_DS_MASK) >> MAC_PCU_RX_FILTER_FROM_TO_DS_LSB) -#define MAC_PCU_RX_FILTER_FROM_TO_DS_SET(x) (((x) << MAC_PCU_RX_FILTER_FROM_TO_DS_LSB) & MAC_PCU_RX_FILTER_FROM_TO_DS_MASK) -#define MAC_PCU_RX_FILTER_RST_DLMTR_CNT_DISABLE_MSB 16 -#define MAC_PCU_RX_FILTER_RST_DLMTR_CNT_DISABLE_LSB 16 -#define MAC_PCU_RX_FILTER_RST_DLMTR_CNT_DISABLE_MASK 0x00010000 -#define MAC_PCU_RX_FILTER_RST_DLMTR_CNT_DISABLE_GET(x) (((x) & MAC_PCU_RX_FILTER_RST_DLMTR_CNT_DISABLE_MASK) >> MAC_PCU_RX_FILTER_RST_DLMTR_CNT_DISABLE_LSB) -#define MAC_PCU_RX_FILTER_RST_DLMTR_CNT_DISABLE_SET(x) (((x) << MAC_PCU_RX_FILTER_RST_DLMTR_CNT_DISABLE_LSB) & MAC_PCU_RX_FILTER_RST_DLMTR_CNT_DISABLE_MASK) -#define MAC_PCU_RX_FILTER_MCAST_BCAST_ALL_MSB 15 -#define MAC_PCU_RX_FILTER_MCAST_BCAST_ALL_LSB 15 -#define MAC_PCU_RX_FILTER_MCAST_BCAST_ALL_MASK 0x00008000 -#define MAC_PCU_RX_FILTER_MCAST_BCAST_ALL_GET(x) (((x) & MAC_PCU_RX_FILTER_MCAST_BCAST_ALL_MASK) >> MAC_PCU_RX_FILTER_MCAST_BCAST_ALL_LSB) -#define MAC_PCU_RX_FILTER_MCAST_BCAST_ALL_SET(x) (((x) << MAC_PCU_RX_FILTER_MCAST_BCAST_ALL_LSB) & MAC_PCU_RX_FILTER_MCAST_BCAST_ALL_MASK) -#define MAC_PCU_RX_FILTER_PS_POLL_MSB 14 -#define MAC_PCU_RX_FILTER_PS_POLL_LSB 14 -#define MAC_PCU_RX_FILTER_PS_POLL_MASK 0x00004000 -#define MAC_PCU_RX_FILTER_PS_POLL_GET(x) (((x) & MAC_PCU_RX_FILTER_PS_POLL_MASK) >> MAC_PCU_RX_FILTER_PS_POLL_LSB) -#define MAC_PCU_RX_FILTER_PS_POLL_SET(x) (((x) << MAC_PCU_RX_FILTER_PS_POLL_LSB) & MAC_PCU_RX_FILTER_PS_POLL_MASK) -#define MAC_PCU_RX_FILTER_ASSUME_RADAR_MSB 13 -#define MAC_PCU_RX_FILTER_ASSUME_RADAR_LSB 13 -#define MAC_PCU_RX_FILTER_ASSUME_RADAR_MASK 0x00002000 -#define MAC_PCU_RX_FILTER_ASSUME_RADAR_GET(x) (((x) & MAC_PCU_RX_FILTER_ASSUME_RADAR_MASK) >> MAC_PCU_RX_FILTER_ASSUME_RADAR_LSB) -#define MAC_PCU_RX_FILTER_ASSUME_RADAR_SET(x) (((x) << MAC_PCU_RX_FILTER_ASSUME_RADAR_LSB) & MAC_PCU_RX_FILTER_ASSUME_RADAR_MASK) -#define MAC_PCU_RX_FILTER_UNCOMPRESSED_BA_BAR_MSB 12 -#define MAC_PCU_RX_FILTER_UNCOMPRESSED_BA_BAR_LSB 12 -#define MAC_PCU_RX_FILTER_UNCOMPRESSED_BA_BAR_MASK 0x00001000 -#define MAC_PCU_RX_FILTER_UNCOMPRESSED_BA_BAR_GET(x) (((x) & MAC_PCU_RX_FILTER_UNCOMPRESSED_BA_BAR_MASK) >> MAC_PCU_RX_FILTER_UNCOMPRESSED_BA_BAR_LSB) -#define MAC_PCU_RX_FILTER_UNCOMPRESSED_BA_BAR_SET(x) (((x) << MAC_PCU_RX_FILTER_UNCOMPRESSED_BA_BAR_LSB) & MAC_PCU_RX_FILTER_UNCOMPRESSED_BA_BAR_MASK) -#define MAC_PCU_RX_FILTER_COMPRESSED_BA_MSB 11 -#define MAC_PCU_RX_FILTER_COMPRESSED_BA_LSB 11 -#define MAC_PCU_RX_FILTER_COMPRESSED_BA_MASK 0x00000800 -#define MAC_PCU_RX_FILTER_COMPRESSED_BA_GET(x) (((x) & MAC_PCU_RX_FILTER_COMPRESSED_BA_MASK) >> MAC_PCU_RX_FILTER_COMPRESSED_BA_LSB) -#define MAC_PCU_RX_FILTER_COMPRESSED_BA_SET(x) (((x) << MAC_PCU_RX_FILTER_COMPRESSED_BA_LSB) & MAC_PCU_RX_FILTER_COMPRESSED_BA_MASK) -#define MAC_PCU_RX_FILTER_COMPRESSED_BAR_MSB 10 -#define MAC_PCU_RX_FILTER_COMPRESSED_BAR_LSB 10 -#define MAC_PCU_RX_FILTER_COMPRESSED_BAR_MASK 0x00000400 -#define MAC_PCU_RX_FILTER_COMPRESSED_BAR_GET(x) (((x) & MAC_PCU_RX_FILTER_COMPRESSED_BAR_MASK) >> MAC_PCU_RX_FILTER_COMPRESSED_BAR_LSB) -#define MAC_PCU_RX_FILTER_COMPRESSED_BAR_SET(x) (((x) << MAC_PCU_RX_FILTER_COMPRESSED_BAR_LSB) & MAC_PCU_RX_FILTER_COMPRESSED_BAR_MASK) -#define MAC_PCU_RX_FILTER_MY_BEACON_MSB 9 -#define MAC_PCU_RX_FILTER_MY_BEACON_LSB 9 -#define MAC_PCU_RX_FILTER_MY_BEACON_MASK 0x00000200 -#define MAC_PCU_RX_FILTER_MY_BEACON_GET(x) (((x) & MAC_PCU_RX_FILTER_MY_BEACON_MASK) >> MAC_PCU_RX_FILTER_MY_BEACON_LSB) -#define MAC_PCU_RX_FILTER_MY_BEACON_SET(x) (((x) << MAC_PCU_RX_FILTER_MY_BEACON_LSB) & MAC_PCU_RX_FILTER_MY_BEACON_MASK) -#define MAC_PCU_RX_FILTER_SYNC_FRAME_MSB 8 -#define MAC_PCU_RX_FILTER_SYNC_FRAME_LSB 8 -#define MAC_PCU_RX_FILTER_SYNC_FRAME_MASK 0x00000100 -#define MAC_PCU_RX_FILTER_SYNC_FRAME_GET(x) (((x) & MAC_PCU_RX_FILTER_SYNC_FRAME_MASK) >> MAC_PCU_RX_FILTER_SYNC_FRAME_LSB) -#define MAC_PCU_RX_FILTER_SYNC_FRAME_SET(x) (((x) << MAC_PCU_RX_FILTER_SYNC_FRAME_LSB) & MAC_PCU_RX_FILTER_SYNC_FRAME_MASK) -#define MAC_PCU_RX_FILTER_PROBE_REQ_MSB 7 -#define MAC_PCU_RX_FILTER_PROBE_REQ_LSB 7 -#define MAC_PCU_RX_FILTER_PROBE_REQ_MASK 0x00000080 -#define MAC_PCU_RX_FILTER_PROBE_REQ_GET(x) (((x) & MAC_PCU_RX_FILTER_PROBE_REQ_MASK) >> MAC_PCU_RX_FILTER_PROBE_REQ_LSB) -#define MAC_PCU_RX_FILTER_PROBE_REQ_SET(x) (((x) << MAC_PCU_RX_FILTER_PROBE_REQ_LSB) & MAC_PCU_RX_FILTER_PROBE_REQ_MASK) -#define MAC_PCU_RX_FILTER_XR_POLL_MSB 6 -#define MAC_PCU_RX_FILTER_XR_POLL_LSB 6 -#define MAC_PCU_RX_FILTER_XR_POLL_MASK 0x00000040 -#define MAC_PCU_RX_FILTER_XR_POLL_GET(x) (((x) & MAC_PCU_RX_FILTER_XR_POLL_MASK) >> MAC_PCU_RX_FILTER_XR_POLL_LSB) -#define MAC_PCU_RX_FILTER_XR_POLL_SET(x) (((x) << MAC_PCU_RX_FILTER_XR_POLL_LSB) & MAC_PCU_RX_FILTER_XR_POLL_MASK) -#define MAC_PCU_RX_FILTER_PROMISCUOUS_MSB 5 -#define MAC_PCU_RX_FILTER_PROMISCUOUS_LSB 5 -#define MAC_PCU_RX_FILTER_PROMISCUOUS_MASK 0x00000020 -#define MAC_PCU_RX_FILTER_PROMISCUOUS_GET(x) (((x) & MAC_PCU_RX_FILTER_PROMISCUOUS_MASK) >> MAC_PCU_RX_FILTER_PROMISCUOUS_LSB) -#define MAC_PCU_RX_FILTER_PROMISCUOUS_SET(x) (((x) << MAC_PCU_RX_FILTER_PROMISCUOUS_LSB) & MAC_PCU_RX_FILTER_PROMISCUOUS_MASK) -#define MAC_PCU_RX_FILTER_BEACON_MSB 4 -#define MAC_PCU_RX_FILTER_BEACON_LSB 4 -#define MAC_PCU_RX_FILTER_BEACON_MASK 0x00000010 -#define MAC_PCU_RX_FILTER_BEACON_GET(x) (((x) & MAC_PCU_RX_FILTER_BEACON_MASK) >> MAC_PCU_RX_FILTER_BEACON_LSB) -#define MAC_PCU_RX_FILTER_BEACON_SET(x) (((x) << MAC_PCU_RX_FILTER_BEACON_LSB) & MAC_PCU_RX_FILTER_BEACON_MASK) -#define MAC_PCU_RX_FILTER_CONTROL_MSB 3 -#define MAC_PCU_RX_FILTER_CONTROL_LSB 3 -#define MAC_PCU_RX_FILTER_CONTROL_MASK 0x00000008 -#define MAC_PCU_RX_FILTER_CONTROL_GET(x) (((x) & MAC_PCU_RX_FILTER_CONTROL_MASK) >> MAC_PCU_RX_FILTER_CONTROL_LSB) -#define MAC_PCU_RX_FILTER_CONTROL_SET(x) (((x) << MAC_PCU_RX_FILTER_CONTROL_LSB) & MAC_PCU_RX_FILTER_CONTROL_MASK) -#define MAC_PCU_RX_FILTER_BROADCAST_MSB 2 -#define MAC_PCU_RX_FILTER_BROADCAST_LSB 2 -#define MAC_PCU_RX_FILTER_BROADCAST_MASK 0x00000004 -#define MAC_PCU_RX_FILTER_BROADCAST_GET(x) (((x) & MAC_PCU_RX_FILTER_BROADCAST_MASK) >> MAC_PCU_RX_FILTER_BROADCAST_LSB) -#define MAC_PCU_RX_FILTER_BROADCAST_SET(x) (((x) << MAC_PCU_RX_FILTER_BROADCAST_LSB) & MAC_PCU_RX_FILTER_BROADCAST_MASK) -#define MAC_PCU_RX_FILTER_MULTICAST_MSB 1 -#define MAC_PCU_RX_FILTER_MULTICAST_LSB 1 -#define MAC_PCU_RX_FILTER_MULTICAST_MASK 0x00000002 -#define MAC_PCU_RX_FILTER_MULTICAST_GET(x) (((x) & MAC_PCU_RX_FILTER_MULTICAST_MASK) >> MAC_PCU_RX_FILTER_MULTICAST_LSB) -#define MAC_PCU_RX_FILTER_MULTICAST_SET(x) (((x) << MAC_PCU_RX_FILTER_MULTICAST_LSB) & MAC_PCU_RX_FILTER_MULTICAST_MASK) -#define MAC_PCU_RX_FILTER_UNICAST_MSB 0 -#define MAC_PCU_RX_FILTER_UNICAST_LSB 0 -#define MAC_PCU_RX_FILTER_UNICAST_MASK 0x00000001 -#define MAC_PCU_RX_FILTER_UNICAST_GET(x) (((x) & MAC_PCU_RX_FILTER_UNICAST_MASK) >> MAC_PCU_RX_FILTER_UNICAST_LSB) -#define MAC_PCU_RX_FILTER_UNICAST_SET(x) (((x) << MAC_PCU_RX_FILTER_UNICAST_LSB) & MAC_PCU_RX_FILTER_UNICAST_MASK) - -#define MAC_PCU_MCAST_FILTER_L32_ADDRESS 0x00008028 -#define MAC_PCU_MCAST_FILTER_L32_OFFSET 0x00000028 -#define MAC_PCU_MCAST_FILTER_L32_VALUE_MSB 31 -#define MAC_PCU_MCAST_FILTER_L32_VALUE_LSB 0 -#define MAC_PCU_MCAST_FILTER_L32_VALUE_MASK 0xffffffff -#define MAC_PCU_MCAST_FILTER_L32_VALUE_GET(x) (((x) & MAC_PCU_MCAST_FILTER_L32_VALUE_MASK) >> MAC_PCU_MCAST_FILTER_L32_VALUE_LSB) -#define MAC_PCU_MCAST_FILTER_L32_VALUE_SET(x) (((x) << MAC_PCU_MCAST_FILTER_L32_VALUE_LSB) & MAC_PCU_MCAST_FILTER_L32_VALUE_MASK) - -#define MAC_PCU_MCAST_FILTER_U32_ADDRESS 0x0000802c -#define MAC_PCU_MCAST_FILTER_U32_OFFSET 0x0000002c -#define MAC_PCU_MCAST_FILTER_U32_VALUE_MSB 31 -#define MAC_PCU_MCAST_FILTER_U32_VALUE_LSB 0 -#define MAC_PCU_MCAST_FILTER_U32_VALUE_MASK 0xffffffff -#define MAC_PCU_MCAST_FILTER_U32_VALUE_GET(x) (((x) & MAC_PCU_MCAST_FILTER_U32_VALUE_MASK) >> MAC_PCU_MCAST_FILTER_U32_VALUE_LSB) -#define MAC_PCU_MCAST_FILTER_U32_VALUE_SET(x) (((x) << MAC_PCU_MCAST_FILTER_U32_VALUE_LSB) & MAC_PCU_MCAST_FILTER_U32_VALUE_MASK) - -#define MAC_PCU_DIAG_SW_ADDRESS 0x00008030 -#define MAC_PCU_DIAG_SW_OFFSET 0x00000030 -#define MAC_PCU_DIAG_SW_DEBUG_MODE_MSB 31 -#define MAC_PCU_DIAG_SW_DEBUG_MODE_LSB 30 -#define MAC_PCU_DIAG_SW_DEBUG_MODE_MASK 0xc0000000 -#define MAC_PCU_DIAG_SW_DEBUG_MODE_GET(x) (((x) & MAC_PCU_DIAG_SW_DEBUG_MODE_MASK) >> MAC_PCU_DIAG_SW_DEBUG_MODE_LSB) -#define MAC_PCU_DIAG_SW_DEBUG_MODE_SET(x) (((x) << MAC_PCU_DIAG_SW_DEBUG_MODE_LSB) & MAC_PCU_DIAG_SW_DEBUG_MODE_MASK) -#define MAC_PCU_DIAG_SW_RX_CLEAR_EXT_LOW_MSB 29 -#define MAC_PCU_DIAG_SW_RX_CLEAR_EXT_LOW_LSB 29 -#define MAC_PCU_DIAG_SW_RX_CLEAR_EXT_LOW_MASK 0x20000000 -#define MAC_PCU_DIAG_SW_RX_CLEAR_EXT_LOW_GET(x) (((x) & MAC_PCU_DIAG_SW_RX_CLEAR_EXT_LOW_MASK) >> MAC_PCU_DIAG_SW_RX_CLEAR_EXT_LOW_LSB) -#define MAC_PCU_DIAG_SW_RX_CLEAR_EXT_LOW_SET(x) (((x) << MAC_PCU_DIAG_SW_RX_CLEAR_EXT_LOW_LSB) & MAC_PCU_DIAG_SW_RX_CLEAR_EXT_LOW_MASK) -#define MAC_PCU_DIAG_SW_RX_CLEAR_CTL_LOW_MSB 28 -#define MAC_PCU_DIAG_SW_RX_CLEAR_CTL_LOW_LSB 28 -#define MAC_PCU_DIAG_SW_RX_CLEAR_CTL_LOW_MASK 0x10000000 -#define MAC_PCU_DIAG_SW_RX_CLEAR_CTL_LOW_GET(x) (((x) & MAC_PCU_DIAG_SW_RX_CLEAR_CTL_LOW_MASK) >> MAC_PCU_DIAG_SW_RX_CLEAR_CTL_LOW_LSB) -#define MAC_PCU_DIAG_SW_RX_CLEAR_CTL_LOW_SET(x) (((x) << MAC_PCU_DIAG_SW_RX_CLEAR_CTL_LOW_LSB) & MAC_PCU_DIAG_SW_RX_CLEAR_CTL_LOW_MASK) -#define MAC_PCU_DIAG_SW_OBS_SEL_2_MSB 27 -#define MAC_PCU_DIAG_SW_OBS_SEL_2_LSB 27 -#define MAC_PCU_DIAG_SW_OBS_SEL_2_MASK 0x08000000 -#define MAC_PCU_DIAG_SW_OBS_SEL_2_GET(x) (((x) & MAC_PCU_DIAG_SW_OBS_SEL_2_MASK) >> MAC_PCU_DIAG_SW_OBS_SEL_2_LSB) -#define MAC_PCU_DIAG_SW_OBS_SEL_2_SET(x) (((x) << MAC_PCU_DIAG_SW_OBS_SEL_2_LSB) & MAC_PCU_DIAG_SW_OBS_SEL_2_MASK) -#define MAC_PCU_DIAG_SW_SATURATE_CYCLE_CNT_MSB 26 -#define MAC_PCU_DIAG_SW_SATURATE_CYCLE_CNT_LSB 26 -#define MAC_PCU_DIAG_SW_SATURATE_CYCLE_CNT_MASK 0x04000000 -#define MAC_PCU_DIAG_SW_SATURATE_CYCLE_CNT_GET(x) (((x) & MAC_PCU_DIAG_SW_SATURATE_CYCLE_CNT_MASK) >> MAC_PCU_DIAG_SW_SATURATE_CYCLE_CNT_LSB) -#define MAC_PCU_DIAG_SW_SATURATE_CYCLE_CNT_SET(x) (((x) << MAC_PCU_DIAG_SW_SATURATE_CYCLE_CNT_LSB) & MAC_PCU_DIAG_SW_SATURATE_CYCLE_CNT_MASK) -#define MAC_PCU_DIAG_SW_FORCE_RX_ABORT_MSB 25 -#define MAC_PCU_DIAG_SW_FORCE_RX_ABORT_LSB 25 -#define MAC_PCU_DIAG_SW_FORCE_RX_ABORT_MASK 0x02000000 -#define MAC_PCU_DIAG_SW_FORCE_RX_ABORT_GET(x) (((x) & MAC_PCU_DIAG_SW_FORCE_RX_ABORT_MASK) >> MAC_PCU_DIAG_SW_FORCE_RX_ABORT_LSB) -#define MAC_PCU_DIAG_SW_FORCE_RX_ABORT_SET(x) (((x) << MAC_PCU_DIAG_SW_FORCE_RX_ABORT_LSB) & MAC_PCU_DIAG_SW_FORCE_RX_ABORT_MASK) -#define MAC_PCU_DIAG_SW_DUAL_CHAIN_CHAN_INFO_MSB 24 -#define MAC_PCU_DIAG_SW_DUAL_CHAIN_CHAN_INFO_LSB 24 -#define MAC_PCU_DIAG_SW_DUAL_CHAIN_CHAN_INFO_MASK 0x01000000 -#define MAC_PCU_DIAG_SW_DUAL_CHAIN_CHAN_INFO_GET(x) (((x) & MAC_PCU_DIAG_SW_DUAL_CHAIN_CHAN_INFO_MASK) >> MAC_PCU_DIAG_SW_DUAL_CHAIN_CHAN_INFO_LSB) -#define MAC_PCU_DIAG_SW_DUAL_CHAIN_CHAN_INFO_SET(x) (((x) << MAC_PCU_DIAG_SW_DUAL_CHAIN_CHAN_INFO_LSB) & MAC_PCU_DIAG_SW_DUAL_CHAIN_CHAN_INFO_MASK) -#define MAC_PCU_DIAG_SW_PHYERR_ENABLE_EIFS_CTL_MSB 23 -#define MAC_PCU_DIAG_SW_PHYERR_ENABLE_EIFS_CTL_LSB 23 -#define MAC_PCU_DIAG_SW_PHYERR_ENABLE_EIFS_CTL_MASK 0x00800000 -#define MAC_PCU_DIAG_SW_PHYERR_ENABLE_EIFS_CTL_GET(x) (((x) & MAC_PCU_DIAG_SW_PHYERR_ENABLE_EIFS_CTL_MASK) >> MAC_PCU_DIAG_SW_PHYERR_ENABLE_EIFS_CTL_LSB) -#define MAC_PCU_DIAG_SW_PHYERR_ENABLE_EIFS_CTL_SET(x) (((x) << MAC_PCU_DIAG_SW_PHYERR_ENABLE_EIFS_CTL_LSB) & MAC_PCU_DIAG_SW_PHYERR_ENABLE_EIFS_CTL_MASK) -#define MAC_PCU_DIAG_SW_CHAN_IDLE_HIGH_MSB 22 -#define MAC_PCU_DIAG_SW_CHAN_IDLE_HIGH_LSB 22 -#define MAC_PCU_DIAG_SW_CHAN_IDLE_HIGH_MASK 0x00400000 -#define MAC_PCU_DIAG_SW_CHAN_IDLE_HIGH_GET(x) (((x) & MAC_PCU_DIAG_SW_CHAN_IDLE_HIGH_MASK) >> MAC_PCU_DIAG_SW_CHAN_IDLE_HIGH_LSB) -#define MAC_PCU_DIAG_SW_CHAN_IDLE_HIGH_SET(x) (((x) << MAC_PCU_DIAG_SW_CHAN_IDLE_HIGH_LSB) & MAC_PCU_DIAG_SW_CHAN_IDLE_HIGH_MASK) -#define MAC_PCU_DIAG_SW_IGNORE_NAV_MSB 21 -#define MAC_PCU_DIAG_SW_IGNORE_NAV_LSB 21 -#define MAC_PCU_DIAG_SW_IGNORE_NAV_MASK 0x00200000 -#define MAC_PCU_DIAG_SW_IGNORE_NAV_GET(x) (((x) & MAC_PCU_DIAG_SW_IGNORE_NAV_MASK) >> MAC_PCU_DIAG_SW_IGNORE_NAV_LSB) -#define MAC_PCU_DIAG_SW_IGNORE_NAV_SET(x) (((x) << MAC_PCU_DIAG_SW_IGNORE_NAV_LSB) & MAC_PCU_DIAG_SW_IGNORE_NAV_MASK) -#define MAC_PCU_DIAG_SW_RX_CLEAR_HIGH_MSB 20 -#define MAC_PCU_DIAG_SW_RX_CLEAR_HIGH_LSB 20 -#define MAC_PCU_DIAG_SW_RX_CLEAR_HIGH_MASK 0x00100000 -#define MAC_PCU_DIAG_SW_RX_CLEAR_HIGH_GET(x) (((x) & MAC_PCU_DIAG_SW_RX_CLEAR_HIGH_MASK) >> MAC_PCU_DIAG_SW_RX_CLEAR_HIGH_LSB) -#define MAC_PCU_DIAG_SW_RX_CLEAR_HIGH_SET(x) (((x) << MAC_PCU_DIAG_SW_RX_CLEAR_HIGH_LSB) & MAC_PCU_DIAG_SW_RX_CLEAR_HIGH_MASK) -#define MAC_PCU_DIAG_SW_OBS_SEL_1_0_MSB 19 -#define MAC_PCU_DIAG_SW_OBS_SEL_1_0_LSB 18 -#define MAC_PCU_DIAG_SW_OBS_SEL_1_0_MASK 0x000c0000 -#define MAC_PCU_DIAG_SW_OBS_SEL_1_0_GET(x) (((x) & MAC_PCU_DIAG_SW_OBS_SEL_1_0_MASK) >> MAC_PCU_DIAG_SW_OBS_SEL_1_0_LSB) -#define MAC_PCU_DIAG_SW_OBS_SEL_1_0_SET(x) (((x) << MAC_PCU_DIAG_SW_OBS_SEL_1_0_LSB) & MAC_PCU_DIAG_SW_OBS_SEL_1_0_MASK) -#define MAC_PCU_DIAG_SW_ACCEPT_NON_V0_MSB 17 -#define MAC_PCU_DIAG_SW_ACCEPT_NON_V0_LSB 17 -#define MAC_PCU_DIAG_SW_ACCEPT_NON_V0_MASK 0x00020000 -#define MAC_PCU_DIAG_SW_ACCEPT_NON_V0_GET(x) (((x) & MAC_PCU_DIAG_SW_ACCEPT_NON_V0_MASK) >> MAC_PCU_DIAG_SW_ACCEPT_NON_V0_LSB) -#define MAC_PCU_DIAG_SW_ACCEPT_NON_V0_SET(x) (((x) << MAC_PCU_DIAG_SW_ACCEPT_NON_V0_LSB) & MAC_PCU_DIAG_SW_ACCEPT_NON_V0_MASK) -#define MAC_PCU_DIAG_SW_DUMP_CHAN_INFO_MSB 8 -#define MAC_PCU_DIAG_SW_DUMP_CHAN_INFO_LSB 8 -#define MAC_PCU_DIAG_SW_DUMP_CHAN_INFO_MASK 0x00000100 -#define MAC_PCU_DIAG_SW_DUMP_CHAN_INFO_GET(x) (((x) & MAC_PCU_DIAG_SW_DUMP_CHAN_INFO_MASK) >> MAC_PCU_DIAG_SW_DUMP_CHAN_INFO_LSB) -#define MAC_PCU_DIAG_SW_DUMP_CHAN_INFO_SET(x) (((x) << MAC_PCU_DIAG_SW_DUMP_CHAN_INFO_LSB) & MAC_PCU_DIAG_SW_DUMP_CHAN_INFO_MASK) -#define MAC_PCU_DIAG_SW_CORRUPT_FCS_MSB 7 -#define MAC_PCU_DIAG_SW_CORRUPT_FCS_LSB 7 -#define MAC_PCU_DIAG_SW_CORRUPT_FCS_MASK 0x00000080 -#define MAC_PCU_DIAG_SW_CORRUPT_FCS_GET(x) (((x) & MAC_PCU_DIAG_SW_CORRUPT_FCS_MASK) >> MAC_PCU_DIAG_SW_CORRUPT_FCS_LSB) -#define MAC_PCU_DIAG_SW_CORRUPT_FCS_SET(x) (((x) << MAC_PCU_DIAG_SW_CORRUPT_FCS_LSB) & MAC_PCU_DIAG_SW_CORRUPT_FCS_MASK) -#define MAC_PCU_DIAG_SW_LOOP_BACK_MSB 6 -#define MAC_PCU_DIAG_SW_LOOP_BACK_LSB 6 -#define MAC_PCU_DIAG_SW_LOOP_BACK_MASK 0x00000040 -#define MAC_PCU_DIAG_SW_LOOP_BACK_GET(x) (((x) & MAC_PCU_DIAG_SW_LOOP_BACK_MASK) >> MAC_PCU_DIAG_SW_LOOP_BACK_LSB) -#define MAC_PCU_DIAG_SW_LOOP_BACK_SET(x) (((x) << MAC_PCU_DIAG_SW_LOOP_BACK_LSB) & MAC_PCU_DIAG_SW_LOOP_BACK_MASK) -#define MAC_PCU_DIAG_SW_HALT_RX_MSB 5 -#define MAC_PCU_DIAG_SW_HALT_RX_LSB 5 -#define MAC_PCU_DIAG_SW_HALT_RX_MASK 0x00000020 -#define MAC_PCU_DIAG_SW_HALT_RX_GET(x) (((x) & MAC_PCU_DIAG_SW_HALT_RX_MASK) >> MAC_PCU_DIAG_SW_HALT_RX_LSB) -#define MAC_PCU_DIAG_SW_HALT_RX_SET(x) (((x) << MAC_PCU_DIAG_SW_HALT_RX_LSB) & MAC_PCU_DIAG_SW_HALT_RX_MASK) -#define MAC_PCU_DIAG_SW_NO_DECRYPT_MSB 4 -#define MAC_PCU_DIAG_SW_NO_DECRYPT_LSB 4 -#define MAC_PCU_DIAG_SW_NO_DECRYPT_MASK 0x00000010 -#define MAC_PCU_DIAG_SW_NO_DECRYPT_GET(x) (((x) & MAC_PCU_DIAG_SW_NO_DECRYPT_MASK) >> MAC_PCU_DIAG_SW_NO_DECRYPT_LSB) -#define MAC_PCU_DIAG_SW_NO_DECRYPT_SET(x) (((x) << MAC_PCU_DIAG_SW_NO_DECRYPT_LSB) & MAC_PCU_DIAG_SW_NO_DECRYPT_MASK) -#define MAC_PCU_DIAG_SW_NO_ENCRYPT_MSB 3 -#define MAC_PCU_DIAG_SW_NO_ENCRYPT_LSB 3 -#define MAC_PCU_DIAG_SW_NO_ENCRYPT_MASK 0x00000008 -#define MAC_PCU_DIAG_SW_NO_ENCRYPT_GET(x) (((x) & MAC_PCU_DIAG_SW_NO_ENCRYPT_MASK) >> MAC_PCU_DIAG_SW_NO_ENCRYPT_LSB) -#define MAC_PCU_DIAG_SW_NO_ENCRYPT_SET(x) (((x) << MAC_PCU_DIAG_SW_NO_ENCRYPT_LSB) & MAC_PCU_DIAG_SW_NO_ENCRYPT_MASK) -#define MAC_PCU_DIAG_SW_NO_CTS_MSB 2 -#define MAC_PCU_DIAG_SW_NO_CTS_LSB 2 -#define MAC_PCU_DIAG_SW_NO_CTS_MASK 0x00000004 -#define MAC_PCU_DIAG_SW_NO_CTS_GET(x) (((x) & MAC_PCU_DIAG_SW_NO_CTS_MASK) >> MAC_PCU_DIAG_SW_NO_CTS_LSB) -#define MAC_PCU_DIAG_SW_NO_CTS_SET(x) (((x) << MAC_PCU_DIAG_SW_NO_CTS_LSB) & MAC_PCU_DIAG_SW_NO_CTS_MASK) -#define MAC_PCU_DIAG_SW_NO_ACK_MSB 1 -#define MAC_PCU_DIAG_SW_NO_ACK_LSB 1 -#define MAC_PCU_DIAG_SW_NO_ACK_MASK 0x00000002 -#define MAC_PCU_DIAG_SW_NO_ACK_GET(x) (((x) & MAC_PCU_DIAG_SW_NO_ACK_MASK) >> MAC_PCU_DIAG_SW_NO_ACK_LSB) -#define MAC_PCU_DIAG_SW_NO_ACK_SET(x) (((x) << MAC_PCU_DIAG_SW_NO_ACK_LSB) & MAC_PCU_DIAG_SW_NO_ACK_MASK) -#define MAC_PCU_DIAG_SW_INVALID_KEY_NO_ACK_MSB 0 -#define MAC_PCU_DIAG_SW_INVALID_KEY_NO_ACK_LSB 0 -#define MAC_PCU_DIAG_SW_INVALID_KEY_NO_ACK_MASK 0x00000001 -#define MAC_PCU_DIAG_SW_INVALID_KEY_NO_ACK_GET(x) (((x) & MAC_PCU_DIAG_SW_INVALID_KEY_NO_ACK_MASK) >> MAC_PCU_DIAG_SW_INVALID_KEY_NO_ACK_LSB) -#define MAC_PCU_DIAG_SW_INVALID_KEY_NO_ACK_SET(x) (((x) << MAC_PCU_DIAG_SW_INVALID_KEY_NO_ACK_LSB) & MAC_PCU_DIAG_SW_INVALID_KEY_NO_ACK_MASK) - -#define MAC_PCU_TST_ADDAC_ADDRESS 0x00008034 -#define MAC_PCU_TST_ADDAC_OFFSET 0x00000034 -#define MAC_PCU_TST_ADDAC_TEST_ARM_MSB 20 -#define MAC_PCU_TST_ADDAC_TEST_ARM_LSB 20 -#define MAC_PCU_TST_ADDAC_TEST_ARM_MASK 0x00100000 -#define MAC_PCU_TST_ADDAC_TEST_ARM_GET(x) (((x) & MAC_PCU_TST_ADDAC_TEST_ARM_MASK) >> MAC_PCU_TST_ADDAC_TEST_ARM_LSB) -#define MAC_PCU_TST_ADDAC_TEST_ARM_SET(x) (((x) << MAC_PCU_TST_ADDAC_TEST_ARM_LSB) & MAC_PCU_TST_ADDAC_TEST_ARM_MASK) -#define MAC_PCU_TST_ADDAC_TEST_CAPTURE_MSB 19 -#define MAC_PCU_TST_ADDAC_TEST_CAPTURE_LSB 19 -#define MAC_PCU_TST_ADDAC_TEST_CAPTURE_MASK 0x00080000 -#define MAC_PCU_TST_ADDAC_TEST_CAPTURE_GET(x) (((x) & MAC_PCU_TST_ADDAC_TEST_CAPTURE_MASK) >> MAC_PCU_TST_ADDAC_TEST_CAPTURE_LSB) -#define MAC_PCU_TST_ADDAC_TEST_CAPTURE_SET(x) (((x) << MAC_PCU_TST_ADDAC_TEST_CAPTURE_LSB) & MAC_PCU_TST_ADDAC_TEST_CAPTURE_MASK) -#define MAC_PCU_TST_ADDAC_CONT_TEST_MSB 18 -#define MAC_PCU_TST_ADDAC_CONT_TEST_LSB 18 -#define MAC_PCU_TST_ADDAC_CONT_TEST_MASK 0x00040000 -#define MAC_PCU_TST_ADDAC_CONT_TEST_GET(x) (((x) & MAC_PCU_TST_ADDAC_CONT_TEST_MASK) >> MAC_PCU_TST_ADDAC_CONT_TEST_LSB) -#define MAC_PCU_TST_ADDAC_CONT_TEST_SET(x) (((x) << MAC_PCU_TST_ADDAC_CONT_TEST_LSB) & MAC_PCU_TST_ADDAC_CONT_TEST_MASK) -#define MAC_PCU_TST_ADDAC_TRIG_POLARITY_MSB 17 -#define MAC_PCU_TST_ADDAC_TRIG_POLARITY_LSB 17 -#define MAC_PCU_TST_ADDAC_TRIG_POLARITY_MASK 0x00020000 -#define MAC_PCU_TST_ADDAC_TRIG_POLARITY_GET(x) (((x) & MAC_PCU_TST_ADDAC_TRIG_POLARITY_MASK) >> MAC_PCU_TST_ADDAC_TRIG_POLARITY_LSB) -#define MAC_PCU_TST_ADDAC_TRIG_POLARITY_SET(x) (((x) << MAC_PCU_TST_ADDAC_TRIG_POLARITY_LSB) & MAC_PCU_TST_ADDAC_TRIG_POLARITY_MASK) -#define MAC_PCU_TST_ADDAC_TRIG_SEL_MSB 16 -#define MAC_PCU_TST_ADDAC_TRIG_SEL_LSB 16 -#define MAC_PCU_TST_ADDAC_TRIG_SEL_MASK 0x00010000 -#define MAC_PCU_TST_ADDAC_TRIG_SEL_GET(x) (((x) & MAC_PCU_TST_ADDAC_TRIG_SEL_MASK) >> MAC_PCU_TST_ADDAC_TRIG_SEL_LSB) -#define MAC_PCU_TST_ADDAC_TRIG_SEL_SET(x) (((x) << MAC_PCU_TST_ADDAC_TRIG_SEL_LSB) & MAC_PCU_TST_ADDAC_TRIG_SEL_MASK) -#define MAC_PCU_TST_ADDAC_UPPER_8B_MSB 14 -#define MAC_PCU_TST_ADDAC_UPPER_8B_LSB 14 -#define MAC_PCU_TST_ADDAC_UPPER_8B_MASK 0x00004000 -#define MAC_PCU_TST_ADDAC_UPPER_8B_GET(x) (((x) & MAC_PCU_TST_ADDAC_UPPER_8B_MASK) >> MAC_PCU_TST_ADDAC_UPPER_8B_LSB) -#define MAC_PCU_TST_ADDAC_UPPER_8B_SET(x) (((x) << MAC_PCU_TST_ADDAC_UPPER_8B_LSB) & MAC_PCU_TST_ADDAC_UPPER_8B_MASK) -#define MAC_PCU_TST_ADDAC_LOOP_LEN_MSB 13 -#define MAC_PCU_TST_ADDAC_LOOP_LEN_LSB 3 -#define MAC_PCU_TST_ADDAC_LOOP_LEN_MASK 0x00003ff8 -#define MAC_PCU_TST_ADDAC_LOOP_LEN_GET(x) (((x) & MAC_PCU_TST_ADDAC_LOOP_LEN_MASK) >> MAC_PCU_TST_ADDAC_LOOP_LEN_LSB) -#define MAC_PCU_TST_ADDAC_LOOP_LEN_SET(x) (((x) << MAC_PCU_TST_ADDAC_LOOP_LEN_LSB) & MAC_PCU_TST_ADDAC_LOOP_LEN_MASK) -#define MAC_PCU_TST_ADDAC_LOOP_MSB 2 -#define MAC_PCU_TST_ADDAC_LOOP_LSB 2 -#define MAC_PCU_TST_ADDAC_LOOP_MASK 0x00000004 -#define MAC_PCU_TST_ADDAC_LOOP_GET(x) (((x) & MAC_PCU_TST_ADDAC_LOOP_MASK) >> MAC_PCU_TST_ADDAC_LOOP_LSB) -#define MAC_PCU_TST_ADDAC_LOOP_SET(x) (((x) << MAC_PCU_TST_ADDAC_LOOP_LSB) & MAC_PCU_TST_ADDAC_LOOP_MASK) -#define MAC_PCU_TST_ADDAC_TESTMODE_MSB 1 -#define MAC_PCU_TST_ADDAC_TESTMODE_LSB 1 -#define MAC_PCU_TST_ADDAC_TESTMODE_MASK 0x00000002 -#define MAC_PCU_TST_ADDAC_TESTMODE_GET(x) (((x) & MAC_PCU_TST_ADDAC_TESTMODE_MASK) >> MAC_PCU_TST_ADDAC_TESTMODE_LSB) -#define MAC_PCU_TST_ADDAC_TESTMODE_SET(x) (((x) << MAC_PCU_TST_ADDAC_TESTMODE_LSB) & MAC_PCU_TST_ADDAC_TESTMODE_MASK) -#define MAC_PCU_TST_ADDAC_CONT_TX_MSB 0 -#define MAC_PCU_TST_ADDAC_CONT_TX_LSB 0 -#define MAC_PCU_TST_ADDAC_CONT_TX_MASK 0x00000001 -#define MAC_PCU_TST_ADDAC_CONT_TX_GET(x) (((x) & MAC_PCU_TST_ADDAC_CONT_TX_MASK) >> MAC_PCU_TST_ADDAC_CONT_TX_LSB) -#define MAC_PCU_TST_ADDAC_CONT_TX_SET(x) (((x) << MAC_PCU_TST_ADDAC_CONT_TX_LSB) & MAC_PCU_TST_ADDAC_CONT_TX_MASK) - -#define MAC_PCU_DEF_ANTENNA_ADDRESS 0x00008038 -#define MAC_PCU_DEF_ANTENNA_OFFSET 0x00000038 -#define MAC_PCU_DEF_ANTENNA_RX_LNA_CONFIG_SEL_MSB 28 -#define MAC_PCU_DEF_ANTENNA_RX_LNA_CONFIG_SEL_LSB 28 -#define MAC_PCU_DEF_ANTENNA_RX_LNA_CONFIG_SEL_MASK 0x10000000 -#define MAC_PCU_DEF_ANTENNA_RX_LNA_CONFIG_SEL_GET(x) (((x) & MAC_PCU_DEF_ANTENNA_RX_LNA_CONFIG_SEL_MASK) >> MAC_PCU_DEF_ANTENNA_RX_LNA_CONFIG_SEL_LSB) -#define MAC_PCU_DEF_ANTENNA_RX_LNA_CONFIG_SEL_SET(x) (((x) << MAC_PCU_DEF_ANTENNA_RX_LNA_CONFIG_SEL_LSB) & MAC_PCU_DEF_ANTENNA_RX_LNA_CONFIG_SEL_MASK) -#define MAC_PCU_DEF_ANTENNA_TX_DEF_ANT_SEL_MSB 24 -#define MAC_PCU_DEF_ANTENNA_TX_DEF_ANT_SEL_LSB 24 -#define MAC_PCU_DEF_ANTENNA_TX_DEF_ANT_SEL_MASK 0x01000000 -#define MAC_PCU_DEF_ANTENNA_TX_DEF_ANT_SEL_GET(x) (((x) & MAC_PCU_DEF_ANTENNA_TX_DEF_ANT_SEL_MASK) >> MAC_PCU_DEF_ANTENNA_TX_DEF_ANT_SEL_LSB) -#define MAC_PCU_DEF_ANTENNA_TX_DEF_ANT_SEL_SET(x) (((x) << MAC_PCU_DEF_ANTENNA_TX_DEF_ANT_SEL_LSB) & MAC_PCU_DEF_ANTENNA_TX_DEF_ANT_SEL_MASK) -#define MAC_PCU_DEF_ANTENNA_VALUE_MSB 23 -#define MAC_PCU_DEF_ANTENNA_VALUE_LSB 0 -#define MAC_PCU_DEF_ANTENNA_VALUE_MASK 0x00ffffff -#define MAC_PCU_DEF_ANTENNA_VALUE_GET(x) (((x) & MAC_PCU_DEF_ANTENNA_VALUE_MASK) >> MAC_PCU_DEF_ANTENNA_VALUE_LSB) -#define MAC_PCU_DEF_ANTENNA_VALUE_SET(x) (((x) << MAC_PCU_DEF_ANTENNA_VALUE_LSB) & MAC_PCU_DEF_ANTENNA_VALUE_MASK) - -#define MAC_PCU_AES_MUTE_MASK_0_ADDRESS 0x0000803c -#define MAC_PCU_AES_MUTE_MASK_0_OFFSET 0x0000003c -#define MAC_PCU_AES_MUTE_MASK_0_QOS_MSB 31 -#define MAC_PCU_AES_MUTE_MASK_0_QOS_LSB 16 -#define MAC_PCU_AES_MUTE_MASK_0_QOS_MASK 0xffff0000 -#define MAC_PCU_AES_MUTE_MASK_0_QOS_GET(x) (((x) & MAC_PCU_AES_MUTE_MASK_0_QOS_MASK) >> MAC_PCU_AES_MUTE_MASK_0_QOS_LSB) -#define MAC_PCU_AES_MUTE_MASK_0_QOS_SET(x) (((x) << MAC_PCU_AES_MUTE_MASK_0_QOS_LSB) & MAC_PCU_AES_MUTE_MASK_0_QOS_MASK) -#define MAC_PCU_AES_MUTE_MASK_0_FC_MSB 15 -#define MAC_PCU_AES_MUTE_MASK_0_FC_LSB 0 -#define MAC_PCU_AES_MUTE_MASK_0_FC_MASK 0x0000ffff -#define MAC_PCU_AES_MUTE_MASK_0_FC_GET(x) (((x) & MAC_PCU_AES_MUTE_MASK_0_FC_MASK) >> MAC_PCU_AES_MUTE_MASK_0_FC_LSB) -#define MAC_PCU_AES_MUTE_MASK_0_FC_SET(x) (((x) << MAC_PCU_AES_MUTE_MASK_0_FC_LSB) & MAC_PCU_AES_MUTE_MASK_0_FC_MASK) - -#define MAC_PCU_AES_MUTE_MASK_1_ADDRESS 0x00008040 -#define MAC_PCU_AES_MUTE_MASK_1_OFFSET 0x00000040 -#define MAC_PCU_AES_MUTE_MASK_1_FC_MGMT_MSB 31 -#define MAC_PCU_AES_MUTE_MASK_1_FC_MGMT_LSB 16 -#define MAC_PCU_AES_MUTE_MASK_1_FC_MGMT_MASK 0xffff0000 -#define MAC_PCU_AES_MUTE_MASK_1_FC_MGMT_GET(x) (((x) & MAC_PCU_AES_MUTE_MASK_1_FC_MGMT_MASK) >> MAC_PCU_AES_MUTE_MASK_1_FC_MGMT_LSB) -#define MAC_PCU_AES_MUTE_MASK_1_FC_MGMT_SET(x) (((x) << MAC_PCU_AES_MUTE_MASK_1_FC_MGMT_LSB) & MAC_PCU_AES_MUTE_MASK_1_FC_MGMT_MASK) -#define MAC_PCU_AES_MUTE_MASK_1_SEQ_MSB 15 -#define MAC_PCU_AES_MUTE_MASK_1_SEQ_LSB 0 -#define MAC_PCU_AES_MUTE_MASK_1_SEQ_MASK 0x0000ffff -#define MAC_PCU_AES_MUTE_MASK_1_SEQ_GET(x) (((x) & MAC_PCU_AES_MUTE_MASK_1_SEQ_MASK) >> MAC_PCU_AES_MUTE_MASK_1_SEQ_LSB) -#define MAC_PCU_AES_MUTE_MASK_1_SEQ_SET(x) (((x) << MAC_PCU_AES_MUTE_MASK_1_SEQ_LSB) & MAC_PCU_AES_MUTE_MASK_1_SEQ_MASK) - -#define MAC_PCU_GATED_CLKS_ADDRESS 0x00008044 -#define MAC_PCU_GATED_CLKS_OFFSET 0x00000044 -#define MAC_PCU_GATED_CLKS_GATED_REG_MSB 3 -#define MAC_PCU_GATED_CLKS_GATED_REG_LSB 3 -#define MAC_PCU_GATED_CLKS_GATED_REG_MASK 0x00000008 -#define MAC_PCU_GATED_CLKS_GATED_REG_GET(x) (((x) & MAC_PCU_GATED_CLKS_GATED_REG_MASK) >> MAC_PCU_GATED_CLKS_GATED_REG_LSB) -#define MAC_PCU_GATED_CLKS_GATED_REG_SET(x) (((x) << MAC_PCU_GATED_CLKS_GATED_REG_LSB) & MAC_PCU_GATED_CLKS_GATED_REG_MASK) -#define MAC_PCU_GATED_CLKS_GATED_RX_MSB 2 -#define MAC_PCU_GATED_CLKS_GATED_RX_LSB 2 -#define MAC_PCU_GATED_CLKS_GATED_RX_MASK 0x00000004 -#define MAC_PCU_GATED_CLKS_GATED_RX_GET(x) (((x) & MAC_PCU_GATED_CLKS_GATED_RX_MASK) >> MAC_PCU_GATED_CLKS_GATED_RX_LSB) -#define MAC_PCU_GATED_CLKS_GATED_RX_SET(x) (((x) << MAC_PCU_GATED_CLKS_GATED_RX_LSB) & MAC_PCU_GATED_CLKS_GATED_RX_MASK) -#define MAC_PCU_GATED_CLKS_GATED_TX_MSB 1 -#define MAC_PCU_GATED_CLKS_GATED_TX_LSB 1 -#define MAC_PCU_GATED_CLKS_GATED_TX_MASK 0x00000002 -#define MAC_PCU_GATED_CLKS_GATED_TX_GET(x) (((x) & MAC_PCU_GATED_CLKS_GATED_TX_MASK) >> MAC_PCU_GATED_CLKS_GATED_TX_LSB) -#define MAC_PCU_GATED_CLKS_GATED_TX_SET(x) (((x) << MAC_PCU_GATED_CLKS_GATED_TX_LSB) & MAC_PCU_GATED_CLKS_GATED_TX_MASK) - -#define MAC_PCU_OBS_BUS_2_ADDRESS 0x00008048 -#define MAC_PCU_OBS_BUS_2_OFFSET 0x00000048 -#define MAC_PCU_OBS_BUS_2_VALUE_MSB 17 -#define MAC_PCU_OBS_BUS_2_VALUE_LSB 0 -#define MAC_PCU_OBS_BUS_2_VALUE_MASK 0x0003ffff -#define MAC_PCU_OBS_BUS_2_VALUE_GET(x) (((x) & MAC_PCU_OBS_BUS_2_VALUE_MASK) >> MAC_PCU_OBS_BUS_2_VALUE_LSB) -#define MAC_PCU_OBS_BUS_2_VALUE_SET(x) (((x) << MAC_PCU_OBS_BUS_2_VALUE_LSB) & MAC_PCU_OBS_BUS_2_VALUE_MASK) - -#define MAC_PCU_OBS_BUS_1_ADDRESS 0x0000804c -#define MAC_PCU_OBS_BUS_1_OFFSET 0x0000004c -#define MAC_PCU_OBS_BUS_1_TX_STATE_MSB 30 -#define MAC_PCU_OBS_BUS_1_TX_STATE_LSB 25 -#define MAC_PCU_OBS_BUS_1_TX_STATE_MASK 0x7e000000 -#define MAC_PCU_OBS_BUS_1_TX_STATE_GET(x) (((x) & MAC_PCU_OBS_BUS_1_TX_STATE_MASK) >> MAC_PCU_OBS_BUS_1_TX_STATE_LSB) -#define MAC_PCU_OBS_BUS_1_TX_STATE_SET(x) (((x) << MAC_PCU_OBS_BUS_1_TX_STATE_LSB) & MAC_PCU_OBS_BUS_1_TX_STATE_MASK) -#define MAC_PCU_OBS_BUS_1_RX_STATE_MSB 24 -#define MAC_PCU_OBS_BUS_1_RX_STATE_LSB 20 -#define MAC_PCU_OBS_BUS_1_RX_STATE_MASK 0x01f00000 -#define MAC_PCU_OBS_BUS_1_RX_STATE_GET(x) (((x) & MAC_PCU_OBS_BUS_1_RX_STATE_MASK) >> MAC_PCU_OBS_BUS_1_RX_STATE_LSB) -#define MAC_PCU_OBS_BUS_1_RX_STATE_SET(x) (((x) << MAC_PCU_OBS_BUS_1_RX_STATE_LSB) & MAC_PCU_OBS_BUS_1_RX_STATE_MASK) -#define MAC_PCU_OBS_BUS_1_WEP_STATE_MSB 17 -#define MAC_PCU_OBS_BUS_1_WEP_STATE_LSB 12 -#define MAC_PCU_OBS_BUS_1_WEP_STATE_MASK 0x0003f000 -#define MAC_PCU_OBS_BUS_1_WEP_STATE_GET(x) (((x) & MAC_PCU_OBS_BUS_1_WEP_STATE_MASK) >> MAC_PCU_OBS_BUS_1_WEP_STATE_LSB) -#define MAC_PCU_OBS_BUS_1_WEP_STATE_SET(x) (((x) << MAC_PCU_OBS_BUS_1_WEP_STATE_LSB) & MAC_PCU_OBS_BUS_1_WEP_STATE_MASK) -#define MAC_PCU_OBS_BUS_1_RX_CLEAR_MSB 11 -#define MAC_PCU_OBS_BUS_1_RX_CLEAR_LSB 11 -#define MAC_PCU_OBS_BUS_1_RX_CLEAR_MASK 0x00000800 -#define MAC_PCU_OBS_BUS_1_RX_CLEAR_GET(x) (((x) & MAC_PCU_OBS_BUS_1_RX_CLEAR_MASK) >> MAC_PCU_OBS_BUS_1_RX_CLEAR_LSB) -#define MAC_PCU_OBS_BUS_1_RX_CLEAR_SET(x) (((x) << MAC_PCU_OBS_BUS_1_RX_CLEAR_LSB) & MAC_PCU_OBS_BUS_1_RX_CLEAR_MASK) -#define MAC_PCU_OBS_BUS_1_RX_FRAME_MSB 10 -#define MAC_PCU_OBS_BUS_1_RX_FRAME_LSB 10 -#define MAC_PCU_OBS_BUS_1_RX_FRAME_MASK 0x00000400 -#define MAC_PCU_OBS_BUS_1_RX_FRAME_GET(x) (((x) & MAC_PCU_OBS_BUS_1_RX_FRAME_MASK) >> MAC_PCU_OBS_BUS_1_RX_FRAME_LSB) -#define MAC_PCU_OBS_BUS_1_RX_FRAME_SET(x) (((x) << MAC_PCU_OBS_BUS_1_RX_FRAME_LSB) & MAC_PCU_OBS_BUS_1_RX_FRAME_MASK) -#define MAC_PCU_OBS_BUS_1_TX_FRAME_MSB 9 -#define MAC_PCU_OBS_BUS_1_TX_FRAME_LSB 9 -#define MAC_PCU_OBS_BUS_1_TX_FRAME_MASK 0x00000200 -#define MAC_PCU_OBS_BUS_1_TX_FRAME_GET(x) (((x) & MAC_PCU_OBS_BUS_1_TX_FRAME_MASK) >> MAC_PCU_OBS_BUS_1_TX_FRAME_LSB) -#define MAC_PCU_OBS_BUS_1_TX_FRAME_SET(x) (((x) << MAC_PCU_OBS_BUS_1_TX_FRAME_LSB) & MAC_PCU_OBS_BUS_1_TX_FRAME_MASK) -#define MAC_PCU_OBS_BUS_1_TX_HOLD_MSB 8 -#define MAC_PCU_OBS_BUS_1_TX_HOLD_LSB 8 -#define MAC_PCU_OBS_BUS_1_TX_HOLD_MASK 0x00000100 -#define MAC_PCU_OBS_BUS_1_TX_HOLD_GET(x) (((x) & MAC_PCU_OBS_BUS_1_TX_HOLD_MASK) >> MAC_PCU_OBS_BUS_1_TX_HOLD_LSB) -#define MAC_PCU_OBS_BUS_1_TX_HOLD_SET(x) (((x) << MAC_PCU_OBS_BUS_1_TX_HOLD_LSB) & MAC_PCU_OBS_BUS_1_TX_HOLD_MASK) -#define MAC_PCU_OBS_BUS_1_PCU_CHANNEL_IDLE_MSB 7 -#define MAC_PCU_OBS_BUS_1_PCU_CHANNEL_IDLE_LSB 7 -#define MAC_PCU_OBS_BUS_1_PCU_CHANNEL_IDLE_MASK 0x00000080 -#define MAC_PCU_OBS_BUS_1_PCU_CHANNEL_IDLE_GET(x) (((x) & MAC_PCU_OBS_BUS_1_PCU_CHANNEL_IDLE_MASK) >> MAC_PCU_OBS_BUS_1_PCU_CHANNEL_IDLE_LSB) -#define MAC_PCU_OBS_BUS_1_PCU_CHANNEL_IDLE_SET(x) (((x) << MAC_PCU_OBS_BUS_1_PCU_CHANNEL_IDLE_LSB) & MAC_PCU_OBS_BUS_1_PCU_CHANNEL_IDLE_MASK) -#define MAC_PCU_OBS_BUS_1_TM_QUIET_TIME_MSB 6 -#define MAC_PCU_OBS_BUS_1_TM_QUIET_TIME_LSB 6 -#define MAC_PCU_OBS_BUS_1_TM_QUIET_TIME_MASK 0x00000040 -#define MAC_PCU_OBS_BUS_1_TM_QUIET_TIME_GET(x) (((x) & MAC_PCU_OBS_BUS_1_TM_QUIET_TIME_MASK) >> MAC_PCU_OBS_BUS_1_TM_QUIET_TIME_LSB) -#define MAC_PCU_OBS_BUS_1_TM_QUIET_TIME_SET(x) (((x) << MAC_PCU_OBS_BUS_1_TM_QUIET_TIME_LSB) & MAC_PCU_OBS_BUS_1_TM_QUIET_TIME_MASK) -#define MAC_PCU_OBS_BUS_1_TX_HCF_MSB 5 -#define MAC_PCU_OBS_BUS_1_TX_HCF_LSB 5 -#define MAC_PCU_OBS_BUS_1_TX_HCF_MASK 0x00000020 -#define MAC_PCU_OBS_BUS_1_TX_HCF_GET(x) (((x) & MAC_PCU_OBS_BUS_1_TX_HCF_MASK) >> MAC_PCU_OBS_BUS_1_TX_HCF_LSB) -#define MAC_PCU_OBS_BUS_1_TX_HCF_SET(x) (((x) << MAC_PCU_OBS_BUS_1_TX_HCF_LSB) & MAC_PCU_OBS_BUS_1_TX_HCF_MASK) -#define MAC_PCU_OBS_BUS_1_FILTER_PASS_MSB 4 -#define MAC_PCU_OBS_BUS_1_FILTER_PASS_LSB 4 -#define MAC_PCU_OBS_BUS_1_FILTER_PASS_MASK 0x00000010 -#define MAC_PCU_OBS_BUS_1_FILTER_PASS_GET(x) (((x) & MAC_PCU_OBS_BUS_1_FILTER_PASS_MASK) >> MAC_PCU_OBS_BUS_1_FILTER_PASS_LSB) -#define MAC_PCU_OBS_BUS_1_FILTER_PASS_SET(x) (((x) << MAC_PCU_OBS_BUS_1_FILTER_PASS_LSB) & MAC_PCU_OBS_BUS_1_FILTER_PASS_MASK) -#define MAC_PCU_OBS_BUS_1_RX_MY_BEACON_MSB 3 -#define MAC_PCU_OBS_BUS_1_RX_MY_BEACON_LSB 3 -#define MAC_PCU_OBS_BUS_1_RX_MY_BEACON_MASK 0x00000008 -#define MAC_PCU_OBS_BUS_1_RX_MY_BEACON_GET(x) (((x) & MAC_PCU_OBS_BUS_1_RX_MY_BEACON_MASK) >> MAC_PCU_OBS_BUS_1_RX_MY_BEACON_LSB) -#define MAC_PCU_OBS_BUS_1_RX_MY_BEACON_SET(x) (((x) << MAC_PCU_OBS_BUS_1_RX_MY_BEACON_LSB) & MAC_PCU_OBS_BUS_1_RX_MY_BEACON_MASK) -#define MAC_PCU_OBS_BUS_1_RX_WEP_MSB 2 -#define MAC_PCU_OBS_BUS_1_RX_WEP_LSB 2 -#define MAC_PCU_OBS_BUS_1_RX_WEP_MASK 0x00000004 -#define MAC_PCU_OBS_BUS_1_RX_WEP_GET(x) (((x) & MAC_PCU_OBS_BUS_1_RX_WEP_MASK) >> MAC_PCU_OBS_BUS_1_RX_WEP_LSB) -#define MAC_PCU_OBS_BUS_1_RX_WEP_SET(x) (((x) << MAC_PCU_OBS_BUS_1_RX_WEP_LSB) & MAC_PCU_OBS_BUS_1_RX_WEP_MASK) -#define MAC_PCU_OBS_BUS_1_PCU_RX_END_MSB 1 -#define MAC_PCU_OBS_BUS_1_PCU_RX_END_LSB 1 -#define MAC_PCU_OBS_BUS_1_PCU_RX_END_MASK 0x00000002 -#define MAC_PCU_OBS_BUS_1_PCU_RX_END_GET(x) (((x) & MAC_PCU_OBS_BUS_1_PCU_RX_END_MASK) >> MAC_PCU_OBS_BUS_1_PCU_RX_END_LSB) -#define MAC_PCU_OBS_BUS_1_PCU_RX_END_SET(x) (((x) << MAC_PCU_OBS_BUS_1_PCU_RX_END_LSB) & MAC_PCU_OBS_BUS_1_PCU_RX_END_MASK) -#define MAC_PCU_OBS_BUS_1_PCU_DIRECTED_MSB 0 -#define MAC_PCU_OBS_BUS_1_PCU_DIRECTED_LSB 0 -#define MAC_PCU_OBS_BUS_1_PCU_DIRECTED_MASK 0x00000001 -#define MAC_PCU_OBS_BUS_1_PCU_DIRECTED_GET(x) (((x) & MAC_PCU_OBS_BUS_1_PCU_DIRECTED_MASK) >> MAC_PCU_OBS_BUS_1_PCU_DIRECTED_LSB) -#define MAC_PCU_OBS_BUS_1_PCU_DIRECTED_SET(x) (((x) << MAC_PCU_OBS_BUS_1_PCU_DIRECTED_LSB) & MAC_PCU_OBS_BUS_1_PCU_DIRECTED_MASK) - -#define MAC_PCU_DYM_MIMO_PWR_SAVE_ADDRESS 0x00008050 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_OFFSET 0x00000050 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HI_PWR_CHAIN_MASK_MSB 10 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HI_PWR_CHAIN_MASK_LSB 8 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HI_PWR_CHAIN_MASK_MASK 0x00000700 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HI_PWR_CHAIN_MASK_GET(x) (((x) & MAC_PCU_DYM_MIMO_PWR_SAVE_HI_PWR_CHAIN_MASK_MASK) >> MAC_PCU_DYM_MIMO_PWR_SAVE_HI_PWR_CHAIN_MASK_LSB) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HI_PWR_CHAIN_MASK_SET(x) (((x) << MAC_PCU_DYM_MIMO_PWR_SAVE_HI_PWR_CHAIN_MASK_LSB) & MAC_PCU_DYM_MIMO_PWR_SAVE_HI_PWR_CHAIN_MASK_MASK) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_LOW_PWR_CHAIN_MASK_MSB 6 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_LOW_PWR_CHAIN_MASK_LSB 4 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_LOW_PWR_CHAIN_MASK_MASK 0x00000070 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_LOW_PWR_CHAIN_MASK_GET(x) (((x) & MAC_PCU_DYM_MIMO_PWR_SAVE_LOW_PWR_CHAIN_MASK_MASK) >> MAC_PCU_DYM_MIMO_PWR_SAVE_LOW_PWR_CHAIN_MASK_LSB) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_LOW_PWR_CHAIN_MASK_SET(x) (((x) << MAC_PCU_DYM_MIMO_PWR_SAVE_LOW_PWR_CHAIN_MASK_LSB) & MAC_PCU_DYM_MIMO_PWR_SAVE_LOW_PWR_CHAIN_MASK_MASK) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_SW_CHAIN_MASK_SEL_MSB 2 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_SW_CHAIN_MASK_SEL_LSB 2 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_SW_CHAIN_MASK_SEL_MASK 0x00000004 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_SW_CHAIN_MASK_SEL_GET(x) (((x) & MAC_PCU_DYM_MIMO_PWR_SAVE_SW_CHAIN_MASK_SEL_MASK) >> MAC_PCU_DYM_MIMO_PWR_SAVE_SW_CHAIN_MASK_SEL_LSB) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_SW_CHAIN_MASK_SEL_SET(x) (((x) << MAC_PCU_DYM_MIMO_PWR_SAVE_SW_CHAIN_MASK_SEL_LSB) & MAC_PCU_DYM_MIMO_PWR_SAVE_SW_CHAIN_MASK_SEL_MASK) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HW_CTRL_EN_MSB 1 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HW_CTRL_EN_LSB 1 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HW_CTRL_EN_MASK 0x00000002 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HW_CTRL_EN_GET(x) (((x) & MAC_PCU_DYM_MIMO_PWR_SAVE_HW_CTRL_EN_MASK) >> MAC_PCU_DYM_MIMO_PWR_SAVE_HW_CTRL_EN_LSB) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HW_CTRL_EN_SET(x) (((x) << MAC_PCU_DYM_MIMO_PWR_SAVE_HW_CTRL_EN_LSB) & MAC_PCU_DYM_MIMO_PWR_SAVE_HW_CTRL_EN_MASK) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_USE_MAC_CTRL_MSB 0 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_USE_MAC_CTRL_LSB 0 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_USE_MAC_CTRL_MASK 0x00000001 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_USE_MAC_CTRL_GET(x) (((x) & MAC_PCU_DYM_MIMO_PWR_SAVE_USE_MAC_CTRL_MASK) >> MAC_PCU_DYM_MIMO_PWR_SAVE_USE_MAC_CTRL_LSB) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_USE_MAC_CTRL_SET(x) (((x) << MAC_PCU_DYM_MIMO_PWR_SAVE_USE_MAC_CTRL_LSB) & MAC_PCU_DYM_MIMO_PWR_SAVE_USE_MAC_CTRL_MASK) - -#define MAC_PCU_LAST_BEACON_TSF_ADDRESS 0x00008054 -#define MAC_PCU_LAST_BEACON_TSF_OFFSET 0x00000054 -#define MAC_PCU_LAST_BEACON_TSF_VALUE_MSB 31 -#define MAC_PCU_LAST_BEACON_TSF_VALUE_LSB 0 -#define MAC_PCU_LAST_BEACON_TSF_VALUE_MASK 0xffffffff -#define MAC_PCU_LAST_BEACON_TSF_VALUE_GET(x) (((x) & MAC_PCU_LAST_BEACON_TSF_VALUE_MASK) >> MAC_PCU_LAST_BEACON_TSF_VALUE_LSB) -#define MAC_PCU_LAST_BEACON_TSF_VALUE_SET(x) (((x) << MAC_PCU_LAST_BEACON_TSF_VALUE_LSB) & MAC_PCU_LAST_BEACON_TSF_VALUE_MASK) - -#define MAC_PCU_NAV_ADDRESS 0x00008058 -#define MAC_PCU_NAV_OFFSET 0x00000058 -#define MAC_PCU_NAV_VALUE_MSB 25 -#define MAC_PCU_NAV_VALUE_LSB 0 -#define MAC_PCU_NAV_VALUE_MASK 0x03ffffff -#define MAC_PCU_NAV_VALUE_GET(x) (((x) & MAC_PCU_NAV_VALUE_MASK) >> MAC_PCU_NAV_VALUE_LSB) -#define MAC_PCU_NAV_VALUE_SET(x) (((x) << MAC_PCU_NAV_VALUE_LSB) & MAC_PCU_NAV_VALUE_MASK) - -#define MAC_PCU_RTS_SUCCESS_CNT_ADDRESS 0x0000805c -#define MAC_PCU_RTS_SUCCESS_CNT_OFFSET 0x0000005c -#define MAC_PCU_RTS_SUCCESS_CNT_VALUE_MSB 15 -#define MAC_PCU_RTS_SUCCESS_CNT_VALUE_LSB 0 -#define MAC_PCU_RTS_SUCCESS_CNT_VALUE_MASK 0x0000ffff -#define MAC_PCU_RTS_SUCCESS_CNT_VALUE_GET(x) (((x) & MAC_PCU_RTS_SUCCESS_CNT_VALUE_MASK) >> MAC_PCU_RTS_SUCCESS_CNT_VALUE_LSB) -#define MAC_PCU_RTS_SUCCESS_CNT_VALUE_SET(x) (((x) << MAC_PCU_RTS_SUCCESS_CNT_VALUE_LSB) & MAC_PCU_RTS_SUCCESS_CNT_VALUE_MASK) - -#define MAC_PCU_RTS_FAIL_CNT_ADDRESS 0x00008060 -#define MAC_PCU_RTS_FAIL_CNT_OFFSET 0x00000060 -#define MAC_PCU_RTS_FAIL_CNT_VALUE_MSB 15 -#define MAC_PCU_RTS_FAIL_CNT_VALUE_LSB 0 -#define MAC_PCU_RTS_FAIL_CNT_VALUE_MASK 0x0000ffff -#define MAC_PCU_RTS_FAIL_CNT_VALUE_GET(x) (((x) & MAC_PCU_RTS_FAIL_CNT_VALUE_MASK) >> MAC_PCU_RTS_FAIL_CNT_VALUE_LSB) -#define MAC_PCU_RTS_FAIL_CNT_VALUE_SET(x) (((x) << MAC_PCU_RTS_FAIL_CNT_VALUE_LSB) & MAC_PCU_RTS_FAIL_CNT_VALUE_MASK) - -#define MAC_PCU_ACK_FAIL_CNT_ADDRESS 0x00008064 -#define MAC_PCU_ACK_FAIL_CNT_OFFSET 0x00000064 -#define MAC_PCU_ACK_FAIL_CNT_VALUE_MSB 15 -#define MAC_PCU_ACK_FAIL_CNT_VALUE_LSB 0 -#define MAC_PCU_ACK_FAIL_CNT_VALUE_MASK 0x0000ffff -#define MAC_PCU_ACK_FAIL_CNT_VALUE_GET(x) (((x) & MAC_PCU_ACK_FAIL_CNT_VALUE_MASK) >> MAC_PCU_ACK_FAIL_CNT_VALUE_LSB) -#define MAC_PCU_ACK_FAIL_CNT_VALUE_SET(x) (((x) << MAC_PCU_ACK_FAIL_CNT_VALUE_LSB) & MAC_PCU_ACK_FAIL_CNT_VALUE_MASK) - -#define MAC_PCU_FCS_FAIL_CNT_ADDRESS 0x00008068 -#define MAC_PCU_FCS_FAIL_CNT_OFFSET 0x00000068 -#define MAC_PCU_FCS_FAIL_CNT_VALUE_MSB 15 -#define MAC_PCU_FCS_FAIL_CNT_VALUE_LSB 0 -#define MAC_PCU_FCS_FAIL_CNT_VALUE_MASK 0x0000ffff -#define MAC_PCU_FCS_FAIL_CNT_VALUE_GET(x) (((x) & MAC_PCU_FCS_FAIL_CNT_VALUE_MASK) >> MAC_PCU_FCS_FAIL_CNT_VALUE_LSB) -#define MAC_PCU_FCS_FAIL_CNT_VALUE_SET(x) (((x) << MAC_PCU_FCS_FAIL_CNT_VALUE_LSB) & MAC_PCU_FCS_FAIL_CNT_VALUE_MASK) - -#define MAC_PCU_BEACON_CNT_ADDRESS 0x0000806c -#define MAC_PCU_BEACON_CNT_OFFSET 0x0000006c -#define MAC_PCU_BEACON_CNT_VALUE_MSB 15 -#define MAC_PCU_BEACON_CNT_VALUE_LSB 0 -#define MAC_PCU_BEACON_CNT_VALUE_MASK 0x0000ffff -#define MAC_PCU_BEACON_CNT_VALUE_GET(x) (((x) & MAC_PCU_BEACON_CNT_VALUE_MASK) >> MAC_PCU_BEACON_CNT_VALUE_LSB) -#define MAC_PCU_BEACON_CNT_VALUE_SET(x) (((x) << MAC_PCU_BEACON_CNT_VALUE_LSB) & MAC_PCU_BEACON_CNT_VALUE_MASK) - -#define MAC_PCU_XRMODE_ADDRESS 0x00008070 -#define MAC_PCU_XRMODE_OFFSET 0x00000070 -#define MAC_PCU_XRMODE_FRAME_HOLD_MSB 31 -#define MAC_PCU_XRMODE_FRAME_HOLD_LSB 20 -#define MAC_PCU_XRMODE_FRAME_HOLD_MASK 0xfff00000 -#define MAC_PCU_XRMODE_FRAME_HOLD_GET(x) (((x) & MAC_PCU_XRMODE_FRAME_HOLD_MASK) >> MAC_PCU_XRMODE_FRAME_HOLD_LSB) -#define MAC_PCU_XRMODE_FRAME_HOLD_SET(x) (((x) << MAC_PCU_XRMODE_FRAME_HOLD_LSB) & MAC_PCU_XRMODE_FRAME_HOLD_MASK) -#define MAC_PCU_XRMODE_WAIT_FOR_POLL_MSB 7 -#define MAC_PCU_XRMODE_WAIT_FOR_POLL_LSB 7 -#define MAC_PCU_XRMODE_WAIT_FOR_POLL_MASK 0x00000080 -#define MAC_PCU_XRMODE_WAIT_FOR_POLL_GET(x) (((x) & MAC_PCU_XRMODE_WAIT_FOR_POLL_MASK) >> MAC_PCU_XRMODE_WAIT_FOR_POLL_LSB) -#define MAC_PCU_XRMODE_WAIT_FOR_POLL_SET(x) (((x) << MAC_PCU_XRMODE_WAIT_FOR_POLL_LSB) & MAC_PCU_XRMODE_WAIT_FOR_POLL_MASK) -#define MAC_PCU_XRMODE_POLL_TYPE_MSB 5 -#define MAC_PCU_XRMODE_POLL_TYPE_LSB 0 -#define MAC_PCU_XRMODE_POLL_TYPE_MASK 0x0000003f -#define MAC_PCU_XRMODE_POLL_TYPE_GET(x) (((x) & MAC_PCU_XRMODE_POLL_TYPE_MASK) >> MAC_PCU_XRMODE_POLL_TYPE_LSB) -#define MAC_PCU_XRMODE_POLL_TYPE_SET(x) (((x) << MAC_PCU_XRMODE_POLL_TYPE_LSB) & MAC_PCU_XRMODE_POLL_TYPE_MASK) - -#define MAC_PCU_XRDEL_ADDRESS 0x00008074 -#define MAC_PCU_XRDEL_OFFSET 0x00000074 -#define MAC_PCU_XRDEL_CHIRP_DATA_DELAY_MSB 31 -#define MAC_PCU_XRDEL_CHIRP_DATA_DELAY_LSB 16 -#define MAC_PCU_XRDEL_CHIRP_DATA_DELAY_MASK 0xffff0000 -#define MAC_PCU_XRDEL_CHIRP_DATA_DELAY_GET(x) (((x) & MAC_PCU_XRDEL_CHIRP_DATA_DELAY_MASK) >> MAC_PCU_XRDEL_CHIRP_DATA_DELAY_LSB) -#define MAC_PCU_XRDEL_CHIRP_DATA_DELAY_SET(x) (((x) << MAC_PCU_XRDEL_CHIRP_DATA_DELAY_LSB) & MAC_PCU_XRDEL_CHIRP_DATA_DELAY_MASK) -#define MAC_PCU_XRDEL_SLOT_DELAY_MSB 15 -#define MAC_PCU_XRDEL_SLOT_DELAY_LSB 0 -#define MAC_PCU_XRDEL_SLOT_DELAY_MASK 0x0000ffff -#define MAC_PCU_XRDEL_SLOT_DELAY_GET(x) (((x) & MAC_PCU_XRDEL_SLOT_DELAY_MASK) >> MAC_PCU_XRDEL_SLOT_DELAY_LSB) -#define MAC_PCU_XRDEL_SLOT_DELAY_SET(x) (((x) << MAC_PCU_XRDEL_SLOT_DELAY_LSB) & MAC_PCU_XRDEL_SLOT_DELAY_MASK) - -#define MAC_PCU_XRTO_ADDRESS 0x00008078 -#define MAC_PCU_XRTO_OFFSET 0x00000078 -#define MAC_PCU_XRTO_POLL_TIMEOUT_MSB 31 -#define MAC_PCU_XRTO_POLL_TIMEOUT_LSB 16 -#define MAC_PCU_XRTO_POLL_TIMEOUT_MASK 0xffff0000 -#define MAC_PCU_XRTO_POLL_TIMEOUT_GET(x) (((x) & MAC_PCU_XRTO_POLL_TIMEOUT_MASK) >> MAC_PCU_XRTO_POLL_TIMEOUT_LSB) -#define MAC_PCU_XRTO_POLL_TIMEOUT_SET(x) (((x) << MAC_PCU_XRTO_POLL_TIMEOUT_LSB) & MAC_PCU_XRTO_POLL_TIMEOUT_MASK) -#define MAC_PCU_XRTO_CHIRP_TIMEOUT_MSB 15 -#define MAC_PCU_XRTO_CHIRP_TIMEOUT_LSB 0 -#define MAC_PCU_XRTO_CHIRP_TIMEOUT_MASK 0x0000ffff -#define MAC_PCU_XRTO_CHIRP_TIMEOUT_GET(x) (((x) & MAC_PCU_XRTO_CHIRP_TIMEOUT_MASK) >> MAC_PCU_XRTO_CHIRP_TIMEOUT_LSB) -#define MAC_PCU_XRTO_CHIRP_TIMEOUT_SET(x) (((x) << MAC_PCU_XRTO_CHIRP_TIMEOUT_LSB) & MAC_PCU_XRTO_CHIRP_TIMEOUT_MASK) - -#define MAC_PCU_XRCRP_ADDRESS 0x0000807c -#define MAC_PCU_XRCRP_OFFSET 0x0000007c -#define MAC_PCU_XRCRP_CHIRP_GAP_MSB 31 -#define MAC_PCU_XRCRP_CHIRP_GAP_LSB 16 -#define MAC_PCU_XRCRP_CHIRP_GAP_MASK 0xffff0000 -#define MAC_PCU_XRCRP_CHIRP_GAP_GET(x) (((x) & MAC_PCU_XRCRP_CHIRP_GAP_MASK) >> MAC_PCU_XRCRP_CHIRP_GAP_LSB) -#define MAC_PCU_XRCRP_CHIRP_GAP_SET(x) (((x) << MAC_PCU_XRCRP_CHIRP_GAP_LSB) & MAC_PCU_XRCRP_CHIRP_GAP_MASK) -#define MAC_PCU_XRCRP_SEND_CHIRP_MSB 0 -#define MAC_PCU_XRCRP_SEND_CHIRP_LSB 0 -#define MAC_PCU_XRCRP_SEND_CHIRP_MASK 0x00000001 -#define MAC_PCU_XRCRP_SEND_CHIRP_GET(x) (((x) & MAC_PCU_XRCRP_SEND_CHIRP_MASK) >> MAC_PCU_XRCRP_SEND_CHIRP_LSB) -#define MAC_PCU_XRCRP_SEND_CHIRP_SET(x) (((x) << MAC_PCU_XRCRP_SEND_CHIRP_LSB) & MAC_PCU_XRCRP_SEND_CHIRP_MASK) - -#define MAC_PCU_XRSTMP_ADDRESS 0x00008080 -#define MAC_PCU_XRSTMP_OFFSET 0x00000080 -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_THRESH_MSB 23 -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_THRESH_LSB 16 -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_THRESH_MASK 0x00ff0000 -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_THRESH_GET(x) (((x) & MAC_PCU_XRSTMP_RX_ABORT_RSSI_THRESH_MASK) >> MAC_PCU_XRSTMP_RX_ABORT_RSSI_THRESH_LSB) -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_THRESH_SET(x) (((x) << MAC_PCU_XRSTMP_RX_ABORT_RSSI_THRESH_LSB) & MAC_PCU_XRSTMP_RX_ABORT_RSSI_THRESH_MASK) -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_THRESH_MSB 15 -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_THRESH_LSB 8 -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_THRESH_MASK 0x0000ff00 -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_THRESH_GET(x) (((x) & MAC_PCU_XRSTMP_TX_STOMP_RSSI_THRESH_MASK) >> MAC_PCU_XRSTMP_TX_STOMP_RSSI_THRESH_LSB) -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_THRESH_SET(x) (((x) << MAC_PCU_XRSTMP_TX_STOMP_RSSI_THRESH_LSB) & MAC_PCU_XRSTMP_TX_STOMP_RSSI_THRESH_MASK) -#define MAC_PCU_XRSTMP_RX_ABORT_DATA_MSB 5 -#define MAC_PCU_XRSTMP_RX_ABORT_DATA_LSB 5 -#define MAC_PCU_XRSTMP_RX_ABORT_DATA_MASK 0x00000020 -#define MAC_PCU_XRSTMP_RX_ABORT_DATA_GET(x) (((x) & MAC_PCU_XRSTMP_RX_ABORT_DATA_MASK) >> MAC_PCU_XRSTMP_RX_ABORT_DATA_LSB) -#define MAC_PCU_XRSTMP_RX_ABORT_DATA_SET(x) (((x) << MAC_PCU_XRSTMP_RX_ABORT_DATA_LSB) & MAC_PCU_XRSTMP_RX_ABORT_DATA_MASK) -#define MAC_PCU_XRSTMP_TX_STOMP_DATA_MSB 4 -#define MAC_PCU_XRSTMP_TX_STOMP_DATA_LSB 4 -#define MAC_PCU_XRSTMP_TX_STOMP_DATA_MASK 0x00000010 -#define MAC_PCU_XRSTMP_TX_STOMP_DATA_GET(x) (((x) & MAC_PCU_XRSTMP_TX_STOMP_DATA_MASK) >> MAC_PCU_XRSTMP_TX_STOMP_DATA_LSB) -#define MAC_PCU_XRSTMP_TX_STOMP_DATA_SET(x) (((x) << MAC_PCU_XRSTMP_TX_STOMP_DATA_LSB) & MAC_PCU_XRSTMP_TX_STOMP_DATA_MASK) -#define MAC_PCU_XRSTMP_TX_STOMP_BSSID_MSB 3 -#define MAC_PCU_XRSTMP_TX_STOMP_BSSID_LSB 3 -#define MAC_PCU_XRSTMP_TX_STOMP_BSSID_MASK 0x00000008 -#define MAC_PCU_XRSTMP_TX_STOMP_BSSID_GET(x) (((x) & MAC_PCU_XRSTMP_TX_STOMP_BSSID_MASK) >> MAC_PCU_XRSTMP_TX_STOMP_BSSID_LSB) -#define MAC_PCU_XRSTMP_TX_STOMP_BSSID_SET(x) (((x) << MAC_PCU_XRSTMP_TX_STOMP_BSSID_LSB) & MAC_PCU_XRSTMP_TX_STOMP_BSSID_MASK) -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_MSB 2 -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_LSB 2 -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_MASK 0x00000004 -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_GET(x) (((x) & MAC_PCU_XRSTMP_TX_STOMP_RSSI_MASK) >> MAC_PCU_XRSTMP_TX_STOMP_RSSI_LSB) -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_SET(x) (((x) << MAC_PCU_XRSTMP_TX_STOMP_RSSI_LSB) & MAC_PCU_XRSTMP_TX_STOMP_RSSI_MASK) -#define MAC_PCU_XRSTMP_RX_ABORT_BSSID_MSB 1 -#define MAC_PCU_XRSTMP_RX_ABORT_BSSID_LSB 1 -#define MAC_PCU_XRSTMP_RX_ABORT_BSSID_MASK 0x00000002 -#define MAC_PCU_XRSTMP_RX_ABORT_BSSID_GET(x) (((x) & MAC_PCU_XRSTMP_RX_ABORT_BSSID_MASK) >> MAC_PCU_XRSTMP_RX_ABORT_BSSID_LSB) -#define MAC_PCU_XRSTMP_RX_ABORT_BSSID_SET(x) (((x) << MAC_PCU_XRSTMP_RX_ABORT_BSSID_LSB) & MAC_PCU_XRSTMP_RX_ABORT_BSSID_MASK) -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_MSB 0 -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_LSB 0 -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_MASK 0x00000001 -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_GET(x) (((x) & MAC_PCU_XRSTMP_RX_ABORT_RSSI_MASK) >> MAC_PCU_XRSTMP_RX_ABORT_RSSI_LSB) -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_SET(x) (((x) << MAC_PCU_XRSTMP_RX_ABORT_RSSI_LSB) & MAC_PCU_XRSTMP_RX_ABORT_RSSI_MASK) - -#define MAC_PCU_ADDR1_MASK_L32_ADDRESS 0x00008084 -#define MAC_PCU_ADDR1_MASK_L32_OFFSET 0x00000084 -#define MAC_PCU_ADDR1_MASK_L32_VALUE_MSB 31 -#define MAC_PCU_ADDR1_MASK_L32_VALUE_LSB 0 -#define MAC_PCU_ADDR1_MASK_L32_VALUE_MASK 0xffffffff -#define MAC_PCU_ADDR1_MASK_L32_VALUE_GET(x) (((x) & MAC_PCU_ADDR1_MASK_L32_VALUE_MASK) >> MAC_PCU_ADDR1_MASK_L32_VALUE_LSB) -#define MAC_PCU_ADDR1_MASK_L32_VALUE_SET(x) (((x) << MAC_PCU_ADDR1_MASK_L32_VALUE_LSB) & MAC_PCU_ADDR1_MASK_L32_VALUE_MASK) - -#define MAC_PCU_ADDR1_MASK_U16_ADDRESS 0x00008088 -#define MAC_PCU_ADDR1_MASK_U16_OFFSET 0x00000088 -#define MAC_PCU_ADDR1_MASK_U16_VALUE_MSB 15 -#define MAC_PCU_ADDR1_MASK_U16_VALUE_LSB 0 -#define MAC_PCU_ADDR1_MASK_U16_VALUE_MASK 0x0000ffff -#define MAC_PCU_ADDR1_MASK_U16_VALUE_GET(x) (((x) & MAC_PCU_ADDR1_MASK_U16_VALUE_MASK) >> MAC_PCU_ADDR1_MASK_U16_VALUE_LSB) -#define MAC_PCU_ADDR1_MASK_U16_VALUE_SET(x) (((x) << MAC_PCU_ADDR1_MASK_U16_VALUE_LSB) & MAC_PCU_ADDR1_MASK_U16_VALUE_MASK) - -#define MAC_PCU_TPC_ADDRESS 0x0000808c -#define MAC_PCU_TPC_OFFSET 0x0000008c -#define MAC_PCU_TPC_CHIRP_PWR_MSB 21 -#define MAC_PCU_TPC_CHIRP_PWR_LSB 16 -#define MAC_PCU_TPC_CHIRP_PWR_MASK 0x003f0000 -#define MAC_PCU_TPC_CHIRP_PWR_GET(x) (((x) & MAC_PCU_TPC_CHIRP_PWR_MASK) >> MAC_PCU_TPC_CHIRP_PWR_LSB) -#define MAC_PCU_TPC_CHIRP_PWR_SET(x) (((x) << MAC_PCU_TPC_CHIRP_PWR_LSB) & MAC_PCU_TPC_CHIRP_PWR_MASK) -#define MAC_PCU_TPC_CTS_PWR_MSB 13 -#define MAC_PCU_TPC_CTS_PWR_LSB 8 -#define MAC_PCU_TPC_CTS_PWR_MASK 0x00003f00 -#define MAC_PCU_TPC_CTS_PWR_GET(x) (((x) & MAC_PCU_TPC_CTS_PWR_MASK) >> MAC_PCU_TPC_CTS_PWR_LSB) -#define MAC_PCU_TPC_CTS_PWR_SET(x) (((x) << MAC_PCU_TPC_CTS_PWR_LSB) & MAC_PCU_TPC_CTS_PWR_MASK) -#define MAC_PCU_TPC_ACK_PWR_MSB 5 -#define MAC_PCU_TPC_ACK_PWR_LSB 0 -#define MAC_PCU_TPC_ACK_PWR_MASK 0x0000003f -#define MAC_PCU_TPC_ACK_PWR_GET(x) (((x) & MAC_PCU_TPC_ACK_PWR_MASK) >> MAC_PCU_TPC_ACK_PWR_LSB) -#define MAC_PCU_TPC_ACK_PWR_SET(x) (((x) << MAC_PCU_TPC_ACK_PWR_LSB) & MAC_PCU_TPC_ACK_PWR_MASK) - -#define MAC_PCU_TX_FRAME_CNT_ADDRESS 0x00008090 -#define MAC_PCU_TX_FRAME_CNT_OFFSET 0x00000090 -#define MAC_PCU_TX_FRAME_CNT_VALUE_MSB 31 -#define MAC_PCU_TX_FRAME_CNT_VALUE_LSB 0 -#define MAC_PCU_TX_FRAME_CNT_VALUE_MASK 0xffffffff -#define MAC_PCU_TX_FRAME_CNT_VALUE_GET(x) (((x) & MAC_PCU_TX_FRAME_CNT_VALUE_MASK) >> MAC_PCU_TX_FRAME_CNT_VALUE_LSB) -#define MAC_PCU_TX_FRAME_CNT_VALUE_SET(x) (((x) << MAC_PCU_TX_FRAME_CNT_VALUE_LSB) & MAC_PCU_TX_FRAME_CNT_VALUE_MASK) - -#define MAC_PCU_RX_FRAME_CNT_ADDRESS 0x00008094 -#define MAC_PCU_RX_FRAME_CNT_OFFSET 0x00000094 -#define MAC_PCU_RX_FRAME_CNT_VALUE_MSB 31 -#define MAC_PCU_RX_FRAME_CNT_VALUE_LSB 0 -#define MAC_PCU_RX_FRAME_CNT_VALUE_MASK 0xffffffff -#define MAC_PCU_RX_FRAME_CNT_VALUE_GET(x) (((x) & MAC_PCU_RX_FRAME_CNT_VALUE_MASK) >> MAC_PCU_RX_FRAME_CNT_VALUE_LSB) -#define MAC_PCU_RX_FRAME_CNT_VALUE_SET(x) (((x) << MAC_PCU_RX_FRAME_CNT_VALUE_LSB) & MAC_PCU_RX_FRAME_CNT_VALUE_MASK) - -#define MAC_PCU_RX_CLEAR_CNT_ADDRESS 0x00008098 -#define MAC_PCU_RX_CLEAR_CNT_OFFSET 0x00000098 -#define MAC_PCU_RX_CLEAR_CNT_VALUE_MSB 31 -#define MAC_PCU_RX_CLEAR_CNT_VALUE_LSB 0 -#define MAC_PCU_RX_CLEAR_CNT_VALUE_MASK 0xffffffff -#define MAC_PCU_RX_CLEAR_CNT_VALUE_GET(x) (((x) & MAC_PCU_RX_CLEAR_CNT_VALUE_MASK) >> MAC_PCU_RX_CLEAR_CNT_VALUE_LSB) -#define MAC_PCU_RX_CLEAR_CNT_VALUE_SET(x) (((x) << MAC_PCU_RX_CLEAR_CNT_VALUE_LSB) & MAC_PCU_RX_CLEAR_CNT_VALUE_MASK) - -#define MAC_PCU_CYCLE_CNT_ADDRESS 0x0000809c -#define MAC_PCU_CYCLE_CNT_OFFSET 0x0000009c -#define MAC_PCU_CYCLE_CNT_VALUE_MSB 31 -#define MAC_PCU_CYCLE_CNT_VALUE_LSB 0 -#define MAC_PCU_CYCLE_CNT_VALUE_MASK 0xffffffff -#define MAC_PCU_CYCLE_CNT_VALUE_GET(x) (((x) & MAC_PCU_CYCLE_CNT_VALUE_MASK) >> MAC_PCU_CYCLE_CNT_VALUE_LSB) -#define MAC_PCU_CYCLE_CNT_VALUE_SET(x) (((x) << MAC_PCU_CYCLE_CNT_VALUE_LSB) & MAC_PCU_CYCLE_CNT_VALUE_MASK) - -#define MAC_PCU_QUIET_TIME_1_ADDRESS 0x000080a0 -#define MAC_PCU_QUIET_TIME_1_OFFSET 0x000000a0 -#define MAC_PCU_QUIET_TIME_1_ACK_CTS_ENABLE_MSB 17 -#define MAC_PCU_QUIET_TIME_1_ACK_CTS_ENABLE_LSB 17 -#define MAC_PCU_QUIET_TIME_1_ACK_CTS_ENABLE_MASK 0x00020000 -#define MAC_PCU_QUIET_TIME_1_ACK_CTS_ENABLE_GET(x) (((x) & MAC_PCU_QUIET_TIME_1_ACK_CTS_ENABLE_MASK) >> MAC_PCU_QUIET_TIME_1_ACK_CTS_ENABLE_LSB) -#define MAC_PCU_QUIET_TIME_1_ACK_CTS_ENABLE_SET(x) (((x) << MAC_PCU_QUIET_TIME_1_ACK_CTS_ENABLE_LSB) & MAC_PCU_QUIET_TIME_1_ACK_CTS_ENABLE_MASK) - -#define MAC_PCU_QUIET_TIME_2_ADDRESS 0x000080a4 -#define MAC_PCU_QUIET_TIME_2_OFFSET 0x000000a4 -#define MAC_PCU_QUIET_TIME_2_DURATION_MSB 31 -#define MAC_PCU_QUIET_TIME_2_DURATION_LSB 16 -#define MAC_PCU_QUIET_TIME_2_DURATION_MASK 0xffff0000 -#define MAC_PCU_QUIET_TIME_2_DURATION_GET(x) (((x) & MAC_PCU_QUIET_TIME_2_DURATION_MASK) >> MAC_PCU_QUIET_TIME_2_DURATION_LSB) -#define MAC_PCU_QUIET_TIME_2_DURATION_SET(x) (((x) << MAC_PCU_QUIET_TIME_2_DURATION_LSB) & MAC_PCU_QUIET_TIME_2_DURATION_MASK) - -#define MAC_PCU_QOS_NO_ACK_ADDRESS 0x000080a8 -#define MAC_PCU_QOS_NO_ACK_OFFSET 0x000000a8 -#define MAC_PCU_QOS_NO_ACK_BYTE_OFFSET_MSB 8 -#define MAC_PCU_QOS_NO_ACK_BYTE_OFFSET_LSB 7 -#define MAC_PCU_QOS_NO_ACK_BYTE_OFFSET_MASK 0x00000180 -#define MAC_PCU_QOS_NO_ACK_BYTE_OFFSET_GET(x) (((x) & MAC_PCU_QOS_NO_ACK_BYTE_OFFSET_MASK) >> MAC_PCU_QOS_NO_ACK_BYTE_OFFSET_LSB) -#define MAC_PCU_QOS_NO_ACK_BYTE_OFFSET_SET(x) (((x) << MAC_PCU_QOS_NO_ACK_BYTE_OFFSET_LSB) & MAC_PCU_QOS_NO_ACK_BYTE_OFFSET_MASK) -#define MAC_PCU_QOS_NO_ACK_BIT_OFFSET_MSB 6 -#define MAC_PCU_QOS_NO_ACK_BIT_OFFSET_LSB 4 -#define MAC_PCU_QOS_NO_ACK_BIT_OFFSET_MASK 0x00000070 -#define MAC_PCU_QOS_NO_ACK_BIT_OFFSET_GET(x) (((x) & MAC_PCU_QOS_NO_ACK_BIT_OFFSET_MASK) >> MAC_PCU_QOS_NO_ACK_BIT_OFFSET_LSB) -#define MAC_PCU_QOS_NO_ACK_BIT_OFFSET_SET(x) (((x) << MAC_PCU_QOS_NO_ACK_BIT_OFFSET_LSB) & MAC_PCU_QOS_NO_ACK_BIT_OFFSET_MASK) -#define MAC_PCU_QOS_NO_ACK_TWO_BIT_VALUES_MSB 3 -#define MAC_PCU_QOS_NO_ACK_TWO_BIT_VALUES_LSB 0 -#define MAC_PCU_QOS_NO_ACK_TWO_BIT_VALUES_MASK 0x0000000f -#define MAC_PCU_QOS_NO_ACK_TWO_BIT_VALUES_GET(x) (((x) & MAC_PCU_QOS_NO_ACK_TWO_BIT_VALUES_MASK) >> MAC_PCU_QOS_NO_ACK_TWO_BIT_VALUES_LSB) -#define MAC_PCU_QOS_NO_ACK_TWO_BIT_VALUES_SET(x) (((x) << MAC_PCU_QOS_NO_ACK_TWO_BIT_VALUES_LSB) & MAC_PCU_QOS_NO_ACK_TWO_BIT_VALUES_MASK) - -#define MAC_PCU_PHY_ERROR_MASK_ADDRESS 0x000080ac -#define MAC_PCU_PHY_ERROR_MASK_OFFSET 0x000000ac -#define MAC_PCU_PHY_ERROR_MASK_VALUE_MSB 31 -#define MAC_PCU_PHY_ERROR_MASK_VALUE_LSB 0 -#define MAC_PCU_PHY_ERROR_MASK_VALUE_MASK 0xffffffff -#define MAC_PCU_PHY_ERROR_MASK_VALUE_GET(x) (((x) & MAC_PCU_PHY_ERROR_MASK_VALUE_MASK) >> MAC_PCU_PHY_ERROR_MASK_VALUE_LSB) -#define MAC_PCU_PHY_ERROR_MASK_VALUE_SET(x) (((x) << MAC_PCU_PHY_ERROR_MASK_VALUE_LSB) & MAC_PCU_PHY_ERROR_MASK_VALUE_MASK) - -#define MAC_PCU_XRLAT_ADDRESS 0x000080b0 -#define MAC_PCU_XRLAT_OFFSET 0x000000b0 -#define MAC_PCU_XRLAT_VALUE_MSB 11 -#define MAC_PCU_XRLAT_VALUE_LSB 0 -#define MAC_PCU_XRLAT_VALUE_MASK 0x00000fff -#define MAC_PCU_XRLAT_VALUE_GET(x) (((x) & MAC_PCU_XRLAT_VALUE_MASK) >> MAC_PCU_XRLAT_VALUE_LSB) -#define MAC_PCU_XRLAT_VALUE_SET(x) (((x) << MAC_PCU_XRLAT_VALUE_LSB) & MAC_PCU_XRLAT_VALUE_MASK) - -#define MAC_PCU_RXBUF_ADDRESS 0x000080b4 -#define MAC_PCU_RXBUF_OFFSET 0x000000b4 -#define MAC_PCU_RXBUF_REG_RD_ENABLE_MSB 11 -#define MAC_PCU_RXBUF_REG_RD_ENABLE_LSB 11 -#define MAC_PCU_RXBUF_REG_RD_ENABLE_MASK 0x00000800 -#define MAC_PCU_RXBUF_REG_RD_ENABLE_GET(x) (((x) & MAC_PCU_RXBUF_REG_RD_ENABLE_MASK) >> MAC_PCU_RXBUF_REG_RD_ENABLE_LSB) -#define MAC_PCU_RXBUF_REG_RD_ENABLE_SET(x) (((x) << MAC_PCU_RXBUF_REG_RD_ENABLE_LSB) & MAC_PCU_RXBUF_REG_RD_ENABLE_MASK) -#define MAC_PCU_RXBUF_HIGH_PRIORITY_THRSHD_MSB 10 -#define MAC_PCU_RXBUF_HIGH_PRIORITY_THRSHD_LSB 0 -#define MAC_PCU_RXBUF_HIGH_PRIORITY_THRSHD_MASK 0x000007ff -#define MAC_PCU_RXBUF_HIGH_PRIORITY_THRSHD_GET(x) (((x) & MAC_PCU_RXBUF_HIGH_PRIORITY_THRSHD_MASK) >> MAC_PCU_RXBUF_HIGH_PRIORITY_THRSHD_LSB) -#define MAC_PCU_RXBUF_HIGH_PRIORITY_THRSHD_SET(x) (((x) << MAC_PCU_RXBUF_HIGH_PRIORITY_THRSHD_LSB) & MAC_PCU_RXBUF_HIGH_PRIORITY_THRSHD_MASK) - -#define MAC_PCU_MIC_QOS_CONTROL_ADDRESS 0x000080b8 -#define MAC_PCU_MIC_QOS_CONTROL_OFFSET 0x000000b8 -#define MAC_PCU_MIC_QOS_CONTROL_ENABLE_MSB 16 -#define MAC_PCU_MIC_QOS_CONTROL_ENABLE_LSB 16 -#define MAC_PCU_MIC_QOS_CONTROL_ENABLE_MASK 0x00010000 -#define MAC_PCU_MIC_QOS_CONTROL_ENABLE_GET(x) (((x) & MAC_PCU_MIC_QOS_CONTROL_ENABLE_MASK) >> MAC_PCU_MIC_QOS_CONTROL_ENABLE_LSB) -#define MAC_PCU_MIC_QOS_CONTROL_ENABLE_SET(x) (((x) << MAC_PCU_MIC_QOS_CONTROL_ENABLE_LSB) & MAC_PCU_MIC_QOS_CONTROL_ENABLE_MASK) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_7_MSB 15 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_7_LSB 14 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_7_MASK 0x0000c000 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_7_GET(x) (((x) & MAC_PCU_MIC_QOS_CONTROL_VALUE_7_MASK) >> MAC_PCU_MIC_QOS_CONTROL_VALUE_7_LSB) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_7_SET(x) (((x) << MAC_PCU_MIC_QOS_CONTROL_VALUE_7_LSB) & MAC_PCU_MIC_QOS_CONTROL_VALUE_7_MASK) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_6_MSB 13 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_6_LSB 12 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_6_MASK 0x00003000 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_6_GET(x) (((x) & MAC_PCU_MIC_QOS_CONTROL_VALUE_6_MASK) >> MAC_PCU_MIC_QOS_CONTROL_VALUE_6_LSB) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_6_SET(x) (((x) << MAC_PCU_MIC_QOS_CONTROL_VALUE_6_LSB) & MAC_PCU_MIC_QOS_CONTROL_VALUE_6_MASK) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_5_MSB 11 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_5_LSB 10 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_5_MASK 0x00000c00 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_5_GET(x) (((x) & MAC_PCU_MIC_QOS_CONTROL_VALUE_5_MASK) >> MAC_PCU_MIC_QOS_CONTROL_VALUE_5_LSB) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_5_SET(x) (((x) << MAC_PCU_MIC_QOS_CONTROL_VALUE_5_LSB) & MAC_PCU_MIC_QOS_CONTROL_VALUE_5_MASK) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_4_MSB 9 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_4_LSB 8 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_4_MASK 0x00000300 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_4_GET(x) (((x) & MAC_PCU_MIC_QOS_CONTROL_VALUE_4_MASK) >> MAC_PCU_MIC_QOS_CONTROL_VALUE_4_LSB) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_4_SET(x) (((x) << MAC_PCU_MIC_QOS_CONTROL_VALUE_4_LSB) & MAC_PCU_MIC_QOS_CONTROL_VALUE_4_MASK) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_3_MSB 7 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_3_LSB 6 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_3_MASK 0x000000c0 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_3_GET(x) (((x) & MAC_PCU_MIC_QOS_CONTROL_VALUE_3_MASK) >> MAC_PCU_MIC_QOS_CONTROL_VALUE_3_LSB) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_3_SET(x) (((x) << MAC_PCU_MIC_QOS_CONTROL_VALUE_3_LSB) & MAC_PCU_MIC_QOS_CONTROL_VALUE_3_MASK) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_2_MSB 5 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_2_LSB 4 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_2_MASK 0x00000030 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_2_GET(x) (((x) & MAC_PCU_MIC_QOS_CONTROL_VALUE_2_MASK) >> MAC_PCU_MIC_QOS_CONTROL_VALUE_2_LSB) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_2_SET(x) (((x) << MAC_PCU_MIC_QOS_CONTROL_VALUE_2_LSB) & MAC_PCU_MIC_QOS_CONTROL_VALUE_2_MASK) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_1_MSB 3 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_1_LSB 2 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_1_MASK 0x0000000c -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_1_GET(x) (((x) & MAC_PCU_MIC_QOS_CONTROL_VALUE_1_MASK) >> MAC_PCU_MIC_QOS_CONTROL_VALUE_1_LSB) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_1_SET(x) (((x) << MAC_PCU_MIC_QOS_CONTROL_VALUE_1_LSB) & MAC_PCU_MIC_QOS_CONTROL_VALUE_1_MASK) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_0_MSB 1 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_0_LSB 0 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_0_MASK 0x00000003 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_0_GET(x) (((x) & MAC_PCU_MIC_QOS_CONTROL_VALUE_0_MASK) >> MAC_PCU_MIC_QOS_CONTROL_VALUE_0_LSB) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_0_SET(x) (((x) << MAC_PCU_MIC_QOS_CONTROL_VALUE_0_LSB) & MAC_PCU_MIC_QOS_CONTROL_VALUE_0_MASK) - -#define MAC_PCU_MIC_QOS_SELECT_ADDRESS 0x000080bc -#define MAC_PCU_MIC_QOS_SELECT_OFFSET 0x000000bc -#define MAC_PCU_MIC_QOS_SELECT_VALUE_7_MSB 31 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_7_LSB 28 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_7_MASK 0xf0000000 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_7_GET(x) (((x) & MAC_PCU_MIC_QOS_SELECT_VALUE_7_MASK) >> MAC_PCU_MIC_QOS_SELECT_VALUE_7_LSB) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_7_SET(x) (((x) << MAC_PCU_MIC_QOS_SELECT_VALUE_7_LSB) & MAC_PCU_MIC_QOS_SELECT_VALUE_7_MASK) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_6_MSB 27 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_6_LSB 24 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_6_MASK 0x0f000000 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_6_GET(x) (((x) & MAC_PCU_MIC_QOS_SELECT_VALUE_6_MASK) >> MAC_PCU_MIC_QOS_SELECT_VALUE_6_LSB) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_6_SET(x) (((x) << MAC_PCU_MIC_QOS_SELECT_VALUE_6_LSB) & MAC_PCU_MIC_QOS_SELECT_VALUE_6_MASK) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_5_MSB 23 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_5_LSB 20 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_5_MASK 0x00f00000 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_5_GET(x) (((x) & MAC_PCU_MIC_QOS_SELECT_VALUE_5_MASK) >> MAC_PCU_MIC_QOS_SELECT_VALUE_5_LSB) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_5_SET(x) (((x) << MAC_PCU_MIC_QOS_SELECT_VALUE_5_LSB) & MAC_PCU_MIC_QOS_SELECT_VALUE_5_MASK) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_4_MSB 19 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_4_LSB 16 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_4_MASK 0x000f0000 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_4_GET(x) (((x) & MAC_PCU_MIC_QOS_SELECT_VALUE_4_MASK) >> MAC_PCU_MIC_QOS_SELECT_VALUE_4_LSB) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_4_SET(x) (((x) << MAC_PCU_MIC_QOS_SELECT_VALUE_4_LSB) & MAC_PCU_MIC_QOS_SELECT_VALUE_4_MASK) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_3_MSB 15 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_3_LSB 12 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_3_MASK 0x0000f000 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_3_GET(x) (((x) & MAC_PCU_MIC_QOS_SELECT_VALUE_3_MASK) >> MAC_PCU_MIC_QOS_SELECT_VALUE_3_LSB) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_3_SET(x) (((x) << MAC_PCU_MIC_QOS_SELECT_VALUE_3_LSB) & MAC_PCU_MIC_QOS_SELECT_VALUE_3_MASK) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_2_MSB 11 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_2_LSB 8 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_2_MASK 0x00000f00 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_2_GET(x) (((x) & MAC_PCU_MIC_QOS_SELECT_VALUE_2_MASK) >> MAC_PCU_MIC_QOS_SELECT_VALUE_2_LSB) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_2_SET(x) (((x) << MAC_PCU_MIC_QOS_SELECT_VALUE_2_LSB) & MAC_PCU_MIC_QOS_SELECT_VALUE_2_MASK) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_1_MSB 7 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_1_LSB 4 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_1_MASK 0x000000f0 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_1_GET(x) (((x) & MAC_PCU_MIC_QOS_SELECT_VALUE_1_MASK) >> MAC_PCU_MIC_QOS_SELECT_VALUE_1_LSB) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_1_SET(x) (((x) << MAC_PCU_MIC_QOS_SELECT_VALUE_1_LSB) & MAC_PCU_MIC_QOS_SELECT_VALUE_1_MASK) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_0_MSB 3 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_0_LSB 0 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_0_MASK 0x0000000f -#define MAC_PCU_MIC_QOS_SELECT_VALUE_0_GET(x) (((x) & MAC_PCU_MIC_QOS_SELECT_VALUE_0_MASK) >> MAC_PCU_MIC_QOS_SELECT_VALUE_0_LSB) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_0_SET(x) (((x) << MAC_PCU_MIC_QOS_SELECT_VALUE_0_LSB) & MAC_PCU_MIC_QOS_SELECT_VALUE_0_MASK) - -#define MAC_PCU_MISC_MODE_ADDRESS 0x000080c0 -#define MAC_PCU_MISC_MODE_OFFSET 0x000000c0 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_MSB 31 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_LSB 30 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_MASK 0xc0000000 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_GET(x) (((x) & MAC_PCU_MISC_MODE_DEBUG_MODE_MASK) >> MAC_PCU_MISC_MODE_DEBUG_MODE_LSB) -#define MAC_PCU_MISC_MODE_DEBUG_MODE_SET(x) (((x) << MAC_PCU_MISC_MODE_DEBUG_MODE_LSB) & MAC_PCU_MISC_MODE_DEBUG_MODE_MASK) -#define MAC_PCU_MISC_MODE_USE_EOP_PTR_FOR_DMA_WR_MSB 29 -#define MAC_PCU_MISC_MODE_USE_EOP_PTR_FOR_DMA_WR_LSB 29 -#define MAC_PCU_MISC_MODE_USE_EOP_PTR_FOR_DMA_WR_MASK 0x20000000 -#define MAC_PCU_MISC_MODE_USE_EOP_PTR_FOR_DMA_WR_GET(x) (((x) & MAC_PCU_MISC_MODE_USE_EOP_PTR_FOR_DMA_WR_MASK) >> MAC_PCU_MISC_MODE_USE_EOP_PTR_FOR_DMA_WR_LSB) -#define MAC_PCU_MISC_MODE_USE_EOP_PTR_FOR_DMA_WR_SET(x) (((x) << MAC_PCU_MISC_MODE_USE_EOP_PTR_FOR_DMA_WR_LSB) & MAC_PCU_MISC_MODE_USE_EOP_PTR_FOR_DMA_WR_MASK) -#define MAC_PCU_MISC_MODE_ALWAYS_PERFORM_KEY_SEARCH_MSB 28 -#define MAC_PCU_MISC_MODE_ALWAYS_PERFORM_KEY_SEARCH_LSB 28 -#define MAC_PCU_MISC_MODE_ALWAYS_PERFORM_KEY_SEARCH_MASK 0x10000000 -#define MAC_PCU_MISC_MODE_ALWAYS_PERFORM_KEY_SEARCH_GET(x) (((x) & MAC_PCU_MISC_MODE_ALWAYS_PERFORM_KEY_SEARCH_MASK) >> MAC_PCU_MISC_MODE_ALWAYS_PERFORM_KEY_SEARCH_LSB) -#define MAC_PCU_MISC_MODE_ALWAYS_PERFORM_KEY_SEARCH_SET(x) (((x) << MAC_PCU_MISC_MODE_ALWAYS_PERFORM_KEY_SEARCH_LSB) & MAC_PCU_MISC_MODE_ALWAYS_PERFORM_KEY_SEARCH_MASK) -#define MAC_PCU_MISC_MODE_SEL_EVM_MSB 27 -#define MAC_PCU_MISC_MODE_SEL_EVM_LSB 27 -#define MAC_PCU_MISC_MODE_SEL_EVM_MASK 0x08000000 -#define MAC_PCU_MISC_MODE_SEL_EVM_GET(x) (((x) & MAC_PCU_MISC_MODE_SEL_EVM_MASK) >> MAC_PCU_MISC_MODE_SEL_EVM_LSB) -#define MAC_PCU_MISC_MODE_SEL_EVM_SET(x) (((x) << MAC_PCU_MISC_MODE_SEL_EVM_LSB) & MAC_PCU_MISC_MODE_SEL_EVM_MASK) -#define MAC_PCU_MISC_MODE_CLEAR_BA_VALID_MSB 26 -#define MAC_PCU_MISC_MODE_CLEAR_BA_VALID_LSB 26 -#define MAC_PCU_MISC_MODE_CLEAR_BA_VALID_MASK 0x04000000 -#define MAC_PCU_MISC_MODE_CLEAR_BA_VALID_GET(x) (((x) & MAC_PCU_MISC_MODE_CLEAR_BA_VALID_MASK) >> MAC_PCU_MISC_MODE_CLEAR_BA_VALID_LSB) -#define MAC_PCU_MISC_MODE_CLEAR_BA_VALID_SET(x) (((x) << MAC_PCU_MISC_MODE_CLEAR_BA_VALID_LSB) & MAC_PCU_MISC_MODE_CLEAR_BA_VALID_MASK) -#define MAC_PCU_MISC_MODE_CLEAR_FIRST_HCF_MSB 25 -#define MAC_PCU_MISC_MODE_CLEAR_FIRST_HCF_LSB 25 -#define MAC_PCU_MISC_MODE_CLEAR_FIRST_HCF_MASK 0x02000000 -#define MAC_PCU_MISC_MODE_CLEAR_FIRST_HCF_GET(x) (((x) & MAC_PCU_MISC_MODE_CLEAR_FIRST_HCF_MASK) >> MAC_PCU_MISC_MODE_CLEAR_FIRST_HCF_LSB) -#define MAC_PCU_MISC_MODE_CLEAR_FIRST_HCF_SET(x) (((x) << MAC_PCU_MISC_MODE_CLEAR_FIRST_HCF_LSB) & MAC_PCU_MISC_MODE_CLEAR_FIRST_HCF_MASK) -#define MAC_PCU_MISC_MODE_CLEAR_VMF_MSB 24 -#define MAC_PCU_MISC_MODE_CLEAR_VMF_LSB 24 -#define MAC_PCU_MISC_MODE_CLEAR_VMF_MASK 0x01000000 -#define MAC_PCU_MISC_MODE_CLEAR_VMF_GET(x) (((x) & MAC_PCU_MISC_MODE_CLEAR_VMF_MASK) >> MAC_PCU_MISC_MODE_CLEAR_VMF_LSB) -#define MAC_PCU_MISC_MODE_CLEAR_VMF_SET(x) (((x) << MAC_PCU_MISC_MODE_CLEAR_VMF_LSB) & MAC_PCU_MISC_MODE_CLEAR_VMF_MASK) -#define MAC_PCU_MISC_MODE_RX_HCF_POLL_ENABLE_MSB 23 -#define MAC_PCU_MISC_MODE_RX_HCF_POLL_ENABLE_LSB 23 -#define MAC_PCU_MISC_MODE_RX_HCF_POLL_ENABLE_MASK 0x00800000 -#define MAC_PCU_MISC_MODE_RX_HCF_POLL_ENABLE_GET(x) (((x) & MAC_PCU_MISC_MODE_RX_HCF_POLL_ENABLE_MASK) >> MAC_PCU_MISC_MODE_RX_HCF_POLL_ENABLE_LSB) -#define MAC_PCU_MISC_MODE_RX_HCF_POLL_ENABLE_SET(x) (((x) << MAC_PCU_MISC_MODE_RX_HCF_POLL_ENABLE_LSB) & MAC_PCU_MISC_MODE_RX_HCF_POLL_ENABLE_MASK) -#define MAC_PCU_MISC_MODE_HCF_POLL_CANCELS_NAV_MSB 22 -#define MAC_PCU_MISC_MODE_HCF_POLL_CANCELS_NAV_LSB 22 -#define MAC_PCU_MISC_MODE_HCF_POLL_CANCELS_NAV_MASK 0x00400000 -#define MAC_PCU_MISC_MODE_HCF_POLL_CANCELS_NAV_GET(x) (((x) & MAC_PCU_MISC_MODE_HCF_POLL_CANCELS_NAV_MASK) >> MAC_PCU_MISC_MODE_HCF_POLL_CANCELS_NAV_LSB) -#define MAC_PCU_MISC_MODE_HCF_POLL_CANCELS_NAV_SET(x) (((x) << MAC_PCU_MISC_MODE_HCF_POLL_CANCELS_NAV_LSB) & MAC_PCU_MISC_MODE_HCF_POLL_CANCELS_NAV_MASK) -#define MAC_PCU_MISC_MODE_TBTT_PROTECT_MSB 21 -#define MAC_PCU_MISC_MODE_TBTT_PROTECT_LSB 21 -#define MAC_PCU_MISC_MODE_TBTT_PROTECT_MASK 0x00200000 -#define MAC_PCU_MISC_MODE_TBTT_PROTECT_GET(x) (((x) & MAC_PCU_MISC_MODE_TBTT_PROTECT_MASK) >> MAC_PCU_MISC_MODE_TBTT_PROTECT_LSB) -#define MAC_PCU_MISC_MODE_TBTT_PROTECT_SET(x) (((x) << MAC_PCU_MISC_MODE_TBTT_PROTECT_LSB) & MAC_PCU_MISC_MODE_TBTT_PROTECT_MASK) -#define MAC_PCU_MISC_MODE_BT_ANT_PREVENTS_RX_MSB 20 -#define MAC_PCU_MISC_MODE_BT_ANT_PREVENTS_RX_LSB 20 -#define MAC_PCU_MISC_MODE_BT_ANT_PREVENTS_RX_MASK 0x00100000 -#define MAC_PCU_MISC_MODE_BT_ANT_PREVENTS_RX_GET(x) (((x) & MAC_PCU_MISC_MODE_BT_ANT_PREVENTS_RX_MASK) >> MAC_PCU_MISC_MODE_BT_ANT_PREVENTS_RX_LSB) -#define MAC_PCU_MISC_MODE_BT_ANT_PREVENTS_RX_SET(x) (((x) << MAC_PCU_MISC_MODE_BT_ANT_PREVENTS_RX_LSB) & MAC_PCU_MISC_MODE_BT_ANT_PREVENTS_RX_MASK) -#define MAC_PCU_MISC_MODE_FORCE_QUIET_COLLISION_MSB 18 -#define MAC_PCU_MISC_MODE_FORCE_QUIET_COLLISION_LSB 18 -#define MAC_PCU_MISC_MODE_FORCE_QUIET_COLLISION_MASK 0x00040000 -#define MAC_PCU_MISC_MODE_FORCE_QUIET_COLLISION_GET(x) (((x) & MAC_PCU_MISC_MODE_FORCE_QUIET_COLLISION_MASK) >> MAC_PCU_MISC_MODE_FORCE_QUIET_COLLISION_LSB) -#define MAC_PCU_MISC_MODE_FORCE_QUIET_COLLISION_SET(x) (((x) << MAC_PCU_MISC_MODE_FORCE_QUIET_COLLISION_LSB) & MAC_PCU_MISC_MODE_FORCE_QUIET_COLLISION_MASK) -#define MAC_PCU_MISC_MODE_MISS_BEACON_IN_SLEEP_MSB 14 -#define MAC_PCU_MISC_MODE_MISS_BEACON_IN_SLEEP_LSB 14 -#define MAC_PCU_MISC_MODE_MISS_BEACON_IN_SLEEP_MASK 0x00004000 -#define MAC_PCU_MISC_MODE_MISS_BEACON_IN_SLEEP_GET(x) (((x) & MAC_PCU_MISC_MODE_MISS_BEACON_IN_SLEEP_MASK) >> MAC_PCU_MISC_MODE_MISS_BEACON_IN_SLEEP_LSB) -#define MAC_PCU_MISC_MODE_MISS_BEACON_IN_SLEEP_SET(x) (((x) << MAC_PCU_MISC_MODE_MISS_BEACON_IN_SLEEP_LSB) & MAC_PCU_MISC_MODE_MISS_BEACON_IN_SLEEP_MASK) -#define MAC_PCU_MISC_MODE_TXOP_TBTT_LIMIT_ENABLE_MSB 12 -#define MAC_PCU_MISC_MODE_TXOP_TBTT_LIMIT_ENABLE_LSB 12 -#define MAC_PCU_MISC_MODE_TXOP_TBTT_LIMIT_ENABLE_MASK 0x00001000 -#define MAC_PCU_MISC_MODE_TXOP_TBTT_LIMIT_ENABLE_GET(x) (((x) & MAC_PCU_MISC_MODE_TXOP_TBTT_LIMIT_ENABLE_MASK) >> MAC_PCU_MISC_MODE_TXOP_TBTT_LIMIT_ENABLE_LSB) -#define MAC_PCU_MISC_MODE_TXOP_TBTT_LIMIT_ENABLE_SET(x) (((x) << MAC_PCU_MISC_MODE_TXOP_TBTT_LIMIT_ENABLE_LSB) & MAC_PCU_MISC_MODE_TXOP_TBTT_LIMIT_ENABLE_MASK) -#define MAC_PCU_MISC_MODE_KC_RX_ANT_UPDATE_MSB 11 -#define MAC_PCU_MISC_MODE_KC_RX_ANT_UPDATE_LSB 11 -#define MAC_PCU_MISC_MODE_KC_RX_ANT_UPDATE_MASK 0x00000800 -#define MAC_PCU_MISC_MODE_KC_RX_ANT_UPDATE_GET(x) (((x) & MAC_PCU_MISC_MODE_KC_RX_ANT_UPDATE_MASK) >> MAC_PCU_MISC_MODE_KC_RX_ANT_UPDATE_LSB) -#define MAC_PCU_MISC_MODE_KC_RX_ANT_UPDATE_SET(x) (((x) << MAC_PCU_MISC_MODE_KC_RX_ANT_UPDATE_LSB) & MAC_PCU_MISC_MODE_KC_RX_ANT_UPDATE_MASK) -#define MAC_PCU_MISC_MODE_DEBUG_MODE_SIFS_MSB 10 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_SIFS_LSB 10 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_SIFS_MASK 0x00000400 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_SIFS_GET(x) (((x) & MAC_PCU_MISC_MODE_DEBUG_MODE_SIFS_MASK) >> MAC_PCU_MISC_MODE_DEBUG_MODE_SIFS_LSB) -#define MAC_PCU_MISC_MODE_DEBUG_MODE_SIFS_SET(x) (((x) << MAC_PCU_MISC_MODE_DEBUG_MODE_SIFS_LSB) & MAC_PCU_MISC_MODE_DEBUG_MODE_SIFS_MASK) -#define MAC_PCU_MISC_MODE_DEBUG_MODE_BA_BITMAP_MSB 9 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_BA_BITMAP_LSB 9 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_BA_BITMAP_MASK 0x00000200 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_BA_BITMAP_GET(x) (((x) & MAC_PCU_MISC_MODE_DEBUG_MODE_BA_BITMAP_MASK) >> MAC_PCU_MISC_MODE_DEBUG_MODE_BA_BITMAP_LSB) -#define MAC_PCU_MISC_MODE_DEBUG_MODE_BA_BITMAP_SET(x) (((x) << MAC_PCU_MISC_MODE_DEBUG_MODE_BA_BITMAP_LSB) & MAC_PCU_MISC_MODE_DEBUG_MODE_BA_BITMAP_MASK) -#define MAC_PCU_MISC_MODE_CCK_SIFS_MODE_MSB 4 -#define MAC_PCU_MISC_MODE_CCK_SIFS_MODE_LSB 4 -#define MAC_PCU_MISC_MODE_CCK_SIFS_MODE_MASK 0x00000010 -#define MAC_PCU_MISC_MODE_CCK_SIFS_MODE_GET(x) (((x) & MAC_PCU_MISC_MODE_CCK_SIFS_MODE_MASK) >> MAC_PCU_MISC_MODE_CCK_SIFS_MODE_LSB) -#define MAC_PCU_MISC_MODE_CCK_SIFS_MODE_SET(x) (((x) << MAC_PCU_MISC_MODE_CCK_SIFS_MODE_LSB) & MAC_PCU_MISC_MODE_CCK_SIFS_MODE_MASK) -#define MAC_PCU_MISC_MODE_TX_ADD_TSF_MSB 3 -#define MAC_PCU_MISC_MODE_TX_ADD_TSF_LSB 3 -#define MAC_PCU_MISC_MODE_TX_ADD_TSF_MASK 0x00000008 -#define MAC_PCU_MISC_MODE_TX_ADD_TSF_GET(x) (((x) & MAC_PCU_MISC_MODE_TX_ADD_TSF_MASK) >> MAC_PCU_MISC_MODE_TX_ADD_TSF_LSB) -#define MAC_PCU_MISC_MODE_TX_ADD_TSF_SET(x) (((x) << MAC_PCU_MISC_MODE_TX_ADD_TSF_LSB) & MAC_PCU_MISC_MODE_TX_ADD_TSF_MASK) -#define MAC_PCU_MISC_MODE_MIC_NEW_LOCATION_ENABLE_MSB 2 -#define MAC_PCU_MISC_MODE_MIC_NEW_LOCATION_ENABLE_LSB 2 -#define MAC_PCU_MISC_MODE_MIC_NEW_LOCATION_ENABLE_MASK 0x00000004 -#define MAC_PCU_MISC_MODE_MIC_NEW_LOCATION_ENABLE_GET(x) (((x) & MAC_PCU_MISC_MODE_MIC_NEW_LOCATION_ENABLE_MASK) >> MAC_PCU_MISC_MODE_MIC_NEW_LOCATION_ENABLE_LSB) -#define MAC_PCU_MISC_MODE_MIC_NEW_LOCATION_ENABLE_SET(x) (((x) << MAC_PCU_MISC_MODE_MIC_NEW_LOCATION_ENABLE_LSB) & MAC_PCU_MISC_MODE_MIC_NEW_LOCATION_ENABLE_MASK) -#define MAC_PCU_MISC_MODE_DEBUG_MODE_AD_MSB 1 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_AD_LSB 1 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_AD_MASK 0x00000002 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_AD_GET(x) (((x) & MAC_PCU_MISC_MODE_DEBUG_MODE_AD_MASK) >> MAC_PCU_MISC_MODE_DEBUG_MODE_AD_LSB) -#define MAC_PCU_MISC_MODE_DEBUG_MODE_AD_SET(x) (((x) << MAC_PCU_MISC_MODE_DEBUG_MODE_AD_LSB) & MAC_PCU_MISC_MODE_DEBUG_MODE_AD_MASK) -#define MAC_PCU_MISC_MODE_BSSID_MATCH_FORCE_MSB 0 -#define MAC_PCU_MISC_MODE_BSSID_MATCH_FORCE_LSB 0 -#define MAC_PCU_MISC_MODE_BSSID_MATCH_FORCE_MASK 0x00000001 -#define MAC_PCU_MISC_MODE_BSSID_MATCH_FORCE_GET(x) (((x) & MAC_PCU_MISC_MODE_BSSID_MATCH_FORCE_MASK) >> MAC_PCU_MISC_MODE_BSSID_MATCH_FORCE_LSB) -#define MAC_PCU_MISC_MODE_BSSID_MATCH_FORCE_SET(x) (((x) << MAC_PCU_MISC_MODE_BSSID_MATCH_FORCE_LSB) & MAC_PCU_MISC_MODE_BSSID_MATCH_FORCE_MASK) - -#define MAC_PCU_FILTER_OFDM_CNT_ADDRESS 0x000080c4 -#define MAC_PCU_FILTER_OFDM_CNT_OFFSET 0x000000c4 -#define MAC_PCU_FILTER_OFDM_CNT_VALUE_MSB 23 -#define MAC_PCU_FILTER_OFDM_CNT_VALUE_LSB 0 -#define MAC_PCU_FILTER_OFDM_CNT_VALUE_MASK 0x00ffffff -#define MAC_PCU_FILTER_OFDM_CNT_VALUE_GET(x) (((x) & MAC_PCU_FILTER_OFDM_CNT_VALUE_MASK) >> MAC_PCU_FILTER_OFDM_CNT_VALUE_LSB) -#define MAC_PCU_FILTER_OFDM_CNT_VALUE_SET(x) (((x) << MAC_PCU_FILTER_OFDM_CNT_VALUE_LSB) & MAC_PCU_FILTER_OFDM_CNT_VALUE_MASK) - -#define MAC_PCU_FILTER_CCK_CNT_ADDRESS 0x000080c8 -#define MAC_PCU_FILTER_CCK_CNT_OFFSET 0x000000c8 -#define MAC_PCU_FILTER_CCK_CNT_VALUE_MSB 23 -#define MAC_PCU_FILTER_CCK_CNT_VALUE_LSB 0 -#define MAC_PCU_FILTER_CCK_CNT_VALUE_MASK 0x00ffffff -#define MAC_PCU_FILTER_CCK_CNT_VALUE_GET(x) (((x) & MAC_PCU_FILTER_CCK_CNT_VALUE_MASK) >> MAC_PCU_FILTER_CCK_CNT_VALUE_LSB) -#define MAC_PCU_FILTER_CCK_CNT_VALUE_SET(x) (((x) << MAC_PCU_FILTER_CCK_CNT_VALUE_LSB) & MAC_PCU_FILTER_CCK_CNT_VALUE_MASK) - -#define MAC_PCU_PHY_ERR_CNT_1_ADDRESS 0x000080cc -#define MAC_PCU_PHY_ERR_CNT_1_OFFSET 0x000000cc -#define MAC_PCU_PHY_ERR_CNT_1_VALUE_MSB 23 -#define MAC_PCU_PHY_ERR_CNT_1_VALUE_LSB 0 -#define MAC_PCU_PHY_ERR_CNT_1_VALUE_MASK 0x00ffffff -#define MAC_PCU_PHY_ERR_CNT_1_VALUE_GET(x) (((x) & MAC_PCU_PHY_ERR_CNT_1_VALUE_MASK) >> MAC_PCU_PHY_ERR_CNT_1_VALUE_LSB) -#define MAC_PCU_PHY_ERR_CNT_1_VALUE_SET(x) (((x) << MAC_PCU_PHY_ERR_CNT_1_VALUE_LSB) & MAC_PCU_PHY_ERR_CNT_1_VALUE_MASK) - -#define MAC_PCU_PHY_ERR_CNT_1_MASK_ADDRESS 0x000080d0 -#define MAC_PCU_PHY_ERR_CNT_1_MASK_OFFSET 0x000000d0 -#define MAC_PCU_PHY_ERR_CNT_1_MASK_VALUE_MSB 31 -#define MAC_PCU_PHY_ERR_CNT_1_MASK_VALUE_LSB 0 -#define MAC_PCU_PHY_ERR_CNT_1_MASK_VALUE_MASK 0xffffffff -#define MAC_PCU_PHY_ERR_CNT_1_MASK_VALUE_GET(x) (((x) & MAC_PCU_PHY_ERR_CNT_1_MASK_VALUE_MASK) >> MAC_PCU_PHY_ERR_CNT_1_MASK_VALUE_LSB) -#define MAC_PCU_PHY_ERR_CNT_1_MASK_VALUE_SET(x) (((x) << MAC_PCU_PHY_ERR_CNT_1_MASK_VALUE_LSB) & MAC_PCU_PHY_ERR_CNT_1_MASK_VALUE_MASK) - -#define MAC_PCU_PHY_ERR_CNT_2_ADDRESS 0x000080d4 -#define MAC_PCU_PHY_ERR_CNT_2_OFFSET 0x000000d4 -#define MAC_PCU_PHY_ERR_CNT_2_VALUE_MSB 23 -#define MAC_PCU_PHY_ERR_CNT_2_VALUE_LSB 0 -#define MAC_PCU_PHY_ERR_CNT_2_VALUE_MASK 0x00ffffff -#define MAC_PCU_PHY_ERR_CNT_2_VALUE_GET(x) (((x) & MAC_PCU_PHY_ERR_CNT_2_VALUE_MASK) >> MAC_PCU_PHY_ERR_CNT_2_VALUE_LSB) -#define MAC_PCU_PHY_ERR_CNT_2_VALUE_SET(x) (((x) << MAC_PCU_PHY_ERR_CNT_2_VALUE_LSB) & MAC_PCU_PHY_ERR_CNT_2_VALUE_MASK) - -#define MAC_PCU_PHY_ERR_CNT_2_MASK_ADDRESS 0x000080d8 -#define MAC_PCU_PHY_ERR_CNT_2_MASK_OFFSET 0x000000d8 -#define MAC_PCU_PHY_ERR_CNT_2_MASK_VALUE_MSB 31 -#define MAC_PCU_PHY_ERR_CNT_2_MASK_VALUE_LSB 0 -#define MAC_PCU_PHY_ERR_CNT_2_MASK_VALUE_MASK 0xffffffff -#define MAC_PCU_PHY_ERR_CNT_2_MASK_VALUE_GET(x) (((x) & MAC_PCU_PHY_ERR_CNT_2_MASK_VALUE_MASK) >> MAC_PCU_PHY_ERR_CNT_2_MASK_VALUE_LSB) -#define MAC_PCU_PHY_ERR_CNT_2_MASK_VALUE_SET(x) (((x) << MAC_PCU_PHY_ERR_CNT_2_MASK_VALUE_LSB) & MAC_PCU_PHY_ERR_CNT_2_MASK_VALUE_MASK) - -#define MAC_PCU_TSF_THRESHOLD_ADDRESS 0x000080dc -#define MAC_PCU_TSF_THRESHOLD_OFFSET 0x000000dc -#define MAC_PCU_TSF_THRESHOLD_VALUE_MSB 15 -#define MAC_PCU_TSF_THRESHOLD_VALUE_LSB 0 -#define MAC_PCU_TSF_THRESHOLD_VALUE_MASK 0x0000ffff -#define MAC_PCU_TSF_THRESHOLD_VALUE_GET(x) (((x) & MAC_PCU_TSF_THRESHOLD_VALUE_MASK) >> MAC_PCU_TSF_THRESHOLD_VALUE_LSB) -#define MAC_PCU_TSF_THRESHOLD_VALUE_SET(x) (((x) << MAC_PCU_TSF_THRESHOLD_VALUE_LSB) & MAC_PCU_TSF_THRESHOLD_VALUE_MASK) - -#define MAC_PCU_PHY_ERROR_EIFS_MASK_ADDRESS 0x000080e0 -#define MAC_PCU_PHY_ERROR_EIFS_MASK_OFFSET 0x000000e0 -#define MAC_PCU_PHY_ERROR_EIFS_MASK_VALUE_MSB 31 -#define MAC_PCU_PHY_ERROR_EIFS_MASK_VALUE_LSB 0 -#define MAC_PCU_PHY_ERROR_EIFS_MASK_VALUE_MASK 0xffffffff -#define MAC_PCU_PHY_ERROR_EIFS_MASK_VALUE_GET(x) (((x) & MAC_PCU_PHY_ERROR_EIFS_MASK_VALUE_MASK) >> MAC_PCU_PHY_ERROR_EIFS_MASK_VALUE_LSB) -#define MAC_PCU_PHY_ERROR_EIFS_MASK_VALUE_SET(x) (((x) << MAC_PCU_PHY_ERROR_EIFS_MASK_VALUE_LSB) & MAC_PCU_PHY_ERROR_EIFS_MASK_VALUE_MASK) - -#define MAC_PCU_PHY_ERR_CNT_3_ADDRESS 0x000080e4 -#define MAC_PCU_PHY_ERR_CNT_3_OFFSET 0x000000e4 -#define MAC_PCU_PHY_ERR_CNT_3_VALUE_MSB 23 -#define MAC_PCU_PHY_ERR_CNT_3_VALUE_LSB 0 -#define MAC_PCU_PHY_ERR_CNT_3_VALUE_MASK 0x00ffffff -#define MAC_PCU_PHY_ERR_CNT_3_VALUE_GET(x) (((x) & MAC_PCU_PHY_ERR_CNT_3_VALUE_MASK) >> MAC_PCU_PHY_ERR_CNT_3_VALUE_LSB) -#define MAC_PCU_PHY_ERR_CNT_3_VALUE_SET(x) (((x) << MAC_PCU_PHY_ERR_CNT_3_VALUE_LSB) & MAC_PCU_PHY_ERR_CNT_3_VALUE_MASK) - -#define MAC_PCU_PHY_ERR_CNT_3_MASK_ADDRESS 0x000080e8 -#define MAC_PCU_PHY_ERR_CNT_3_MASK_OFFSET 0x000000e8 -#define MAC_PCU_PHY_ERR_CNT_3_MASK_VALUE_MSB 31 -#define MAC_PCU_PHY_ERR_CNT_3_MASK_VALUE_LSB 0 -#define MAC_PCU_PHY_ERR_CNT_3_MASK_VALUE_MASK 0xffffffff -#define MAC_PCU_PHY_ERR_CNT_3_MASK_VALUE_GET(x) (((x) & MAC_PCU_PHY_ERR_CNT_3_MASK_VALUE_MASK) >> MAC_PCU_PHY_ERR_CNT_3_MASK_VALUE_LSB) -#define MAC_PCU_PHY_ERR_CNT_3_MASK_VALUE_SET(x) (((x) << MAC_PCU_PHY_ERR_CNT_3_MASK_VALUE_LSB) & MAC_PCU_PHY_ERR_CNT_3_MASK_VALUE_MASK) - -#define MAC_PCU_BLUETOOTH_MODE_ADDRESS 0x000080ec -#define MAC_PCU_BLUETOOTH_MODE_OFFSET 0x000000ec -#define MAC_PCU_BLUETOOTH_MODE_FIRST_SLOT_TIME_MSB 31 -#define MAC_PCU_BLUETOOTH_MODE_FIRST_SLOT_TIME_LSB 24 -#define MAC_PCU_BLUETOOTH_MODE_FIRST_SLOT_TIME_MASK 0xff000000 -#define MAC_PCU_BLUETOOTH_MODE_FIRST_SLOT_TIME_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE_FIRST_SLOT_TIME_MASK) >> MAC_PCU_BLUETOOTH_MODE_FIRST_SLOT_TIME_LSB) -#define MAC_PCU_BLUETOOTH_MODE_FIRST_SLOT_TIME_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE_FIRST_SLOT_TIME_LSB) & MAC_PCU_BLUETOOTH_MODE_FIRST_SLOT_TIME_MASK) -#define MAC_PCU_BLUETOOTH_MODE_PRIORITY_TIME_MSB 23 -#define MAC_PCU_BLUETOOTH_MODE_PRIORITY_TIME_LSB 18 -#define MAC_PCU_BLUETOOTH_MODE_PRIORITY_TIME_MASK 0x00fc0000 -#define MAC_PCU_BLUETOOTH_MODE_PRIORITY_TIME_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE_PRIORITY_TIME_MASK) >> MAC_PCU_BLUETOOTH_MODE_PRIORITY_TIME_LSB) -#define MAC_PCU_BLUETOOTH_MODE_PRIORITY_TIME_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE_PRIORITY_TIME_LSB) & MAC_PCU_BLUETOOTH_MODE_PRIORITY_TIME_MASK) -#define MAC_PCU_BLUETOOTH_MODE_RX_CLEAR_POLARITY_MSB 17 -#define MAC_PCU_BLUETOOTH_MODE_RX_CLEAR_POLARITY_LSB 17 -#define MAC_PCU_BLUETOOTH_MODE_RX_CLEAR_POLARITY_MASK 0x00020000 -#define MAC_PCU_BLUETOOTH_MODE_RX_CLEAR_POLARITY_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE_RX_CLEAR_POLARITY_MASK) >> MAC_PCU_BLUETOOTH_MODE_RX_CLEAR_POLARITY_LSB) -#define MAC_PCU_BLUETOOTH_MODE_RX_CLEAR_POLARITY_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE_RX_CLEAR_POLARITY_LSB) & MAC_PCU_BLUETOOTH_MODE_RX_CLEAR_POLARITY_MASK) -#define MAC_PCU_BLUETOOTH_MODE_QCU_THRESH_MSB 16 -#define MAC_PCU_BLUETOOTH_MODE_QCU_THRESH_LSB 13 -#define MAC_PCU_BLUETOOTH_MODE_QCU_THRESH_MASK 0x0001e000 -#define MAC_PCU_BLUETOOTH_MODE_QCU_THRESH_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE_QCU_THRESH_MASK) >> MAC_PCU_BLUETOOTH_MODE_QCU_THRESH_LSB) -#define MAC_PCU_BLUETOOTH_MODE_QCU_THRESH_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE_QCU_THRESH_LSB) & MAC_PCU_BLUETOOTH_MODE_QCU_THRESH_MASK) -#define MAC_PCU_BLUETOOTH_MODE_QUIET_MSB 12 -#define MAC_PCU_BLUETOOTH_MODE_QUIET_LSB 12 -#define MAC_PCU_BLUETOOTH_MODE_QUIET_MASK 0x00001000 -#define MAC_PCU_BLUETOOTH_MODE_QUIET_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE_QUIET_MASK) >> MAC_PCU_BLUETOOTH_MODE_QUIET_LSB) -#define MAC_PCU_BLUETOOTH_MODE_QUIET_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE_QUIET_LSB) & MAC_PCU_BLUETOOTH_MODE_QUIET_MASK) -#define MAC_PCU_BLUETOOTH_MODE_MODE_MSB 11 -#define MAC_PCU_BLUETOOTH_MODE_MODE_LSB 10 -#define MAC_PCU_BLUETOOTH_MODE_MODE_MASK 0x00000c00 -#define MAC_PCU_BLUETOOTH_MODE_MODE_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE_MODE_MASK) >> MAC_PCU_BLUETOOTH_MODE_MODE_LSB) -#define MAC_PCU_BLUETOOTH_MODE_MODE_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE_MODE_LSB) & MAC_PCU_BLUETOOTH_MODE_MODE_MASK) -#define MAC_PCU_BLUETOOTH_MODE_TX_FRAME_EXTEND_MSB 9 -#define MAC_PCU_BLUETOOTH_MODE_TX_FRAME_EXTEND_LSB 9 -#define MAC_PCU_BLUETOOTH_MODE_TX_FRAME_EXTEND_MASK 0x00000200 -#define MAC_PCU_BLUETOOTH_MODE_TX_FRAME_EXTEND_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE_TX_FRAME_EXTEND_MASK) >> MAC_PCU_BLUETOOTH_MODE_TX_FRAME_EXTEND_LSB) -#define MAC_PCU_BLUETOOTH_MODE_TX_FRAME_EXTEND_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE_TX_FRAME_EXTEND_LSB) & MAC_PCU_BLUETOOTH_MODE_TX_FRAME_EXTEND_MASK) -#define MAC_PCU_BLUETOOTH_MODE_TX_STATE_EXTEND_MSB 8 -#define MAC_PCU_BLUETOOTH_MODE_TX_STATE_EXTEND_LSB 8 -#define MAC_PCU_BLUETOOTH_MODE_TX_STATE_EXTEND_MASK 0x00000100 -#define MAC_PCU_BLUETOOTH_MODE_TX_STATE_EXTEND_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE_TX_STATE_EXTEND_MASK) >> MAC_PCU_BLUETOOTH_MODE_TX_STATE_EXTEND_LSB) -#define MAC_PCU_BLUETOOTH_MODE_TX_STATE_EXTEND_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE_TX_STATE_EXTEND_LSB) & MAC_PCU_BLUETOOTH_MODE_TX_STATE_EXTEND_MASK) -#define MAC_PCU_BLUETOOTH_MODE_TIME_EXTEND_MSB 7 -#define MAC_PCU_BLUETOOTH_MODE_TIME_EXTEND_LSB 0 -#define MAC_PCU_BLUETOOTH_MODE_TIME_EXTEND_MASK 0x000000ff -#define MAC_PCU_BLUETOOTH_MODE_TIME_EXTEND_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE_TIME_EXTEND_MASK) >> MAC_PCU_BLUETOOTH_MODE_TIME_EXTEND_LSB) -#define MAC_PCU_BLUETOOTH_MODE_TIME_EXTEND_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE_TIME_EXTEND_LSB) & MAC_PCU_BLUETOOTH_MODE_TIME_EXTEND_MASK) - -#define MAC_PCU_BLUETOOTH_WEIGHTS_ADDRESS 0x000080f0 -#define MAC_PCU_BLUETOOTH_WEIGHTS_OFFSET 0x000000f0 -#define MAC_PCU_BLUETOOTH_WEIGHTS_WL_WEIGHT_MSB 31 -#define MAC_PCU_BLUETOOTH_WEIGHTS_WL_WEIGHT_LSB 16 -#define MAC_PCU_BLUETOOTH_WEIGHTS_WL_WEIGHT_MASK 0xffff0000 -#define MAC_PCU_BLUETOOTH_WEIGHTS_WL_WEIGHT_GET(x) (((x) & MAC_PCU_BLUETOOTH_WEIGHTS_WL_WEIGHT_MASK) >> MAC_PCU_BLUETOOTH_WEIGHTS_WL_WEIGHT_LSB) -#define MAC_PCU_BLUETOOTH_WEIGHTS_WL_WEIGHT_SET(x) (((x) << MAC_PCU_BLUETOOTH_WEIGHTS_WL_WEIGHT_LSB) & MAC_PCU_BLUETOOTH_WEIGHTS_WL_WEIGHT_MASK) -#define MAC_PCU_BLUETOOTH_WEIGHTS_BT_WEIGHT_MSB 15 -#define MAC_PCU_BLUETOOTH_WEIGHTS_BT_WEIGHT_LSB 0 -#define MAC_PCU_BLUETOOTH_WEIGHTS_BT_WEIGHT_MASK 0x0000ffff -#define MAC_PCU_BLUETOOTH_WEIGHTS_BT_WEIGHT_GET(x) (((x) & MAC_PCU_BLUETOOTH_WEIGHTS_BT_WEIGHT_MASK) >> MAC_PCU_BLUETOOTH_WEIGHTS_BT_WEIGHT_LSB) -#define MAC_PCU_BLUETOOTH_WEIGHTS_BT_WEIGHT_SET(x) (((x) << MAC_PCU_BLUETOOTH_WEIGHTS_BT_WEIGHT_LSB) & MAC_PCU_BLUETOOTH_WEIGHTS_BT_WEIGHT_MASK) - -#define MAC_PCU_BLUETOOTH_MODE2_ADDRESS 0x000080f4 -#define MAC_PCU_BLUETOOTH_MODE2_OFFSET 0x000000f4 -#define MAC_PCU_BLUETOOTH_MODE2_PHY_ERR_BT_COLL_ENABLE_MSB 31 -#define MAC_PCU_BLUETOOTH_MODE2_PHY_ERR_BT_COLL_ENABLE_LSB 31 -#define MAC_PCU_BLUETOOTH_MODE2_PHY_ERR_BT_COLL_ENABLE_MASK 0x80000000 -#define MAC_PCU_BLUETOOTH_MODE2_PHY_ERR_BT_COLL_ENABLE_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE2_PHY_ERR_BT_COLL_ENABLE_MASK) >> MAC_PCU_BLUETOOTH_MODE2_PHY_ERR_BT_COLL_ENABLE_LSB) -#define MAC_PCU_BLUETOOTH_MODE2_PHY_ERR_BT_COLL_ENABLE_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE2_PHY_ERR_BT_COLL_ENABLE_LSB) & MAC_PCU_BLUETOOTH_MODE2_PHY_ERR_BT_COLL_ENABLE_MASK) -#define MAC_PCU_BLUETOOTH_MODE2_INTERRUPT_ENABLE_MSB 30 -#define MAC_PCU_BLUETOOTH_MODE2_INTERRUPT_ENABLE_LSB 30 -#define MAC_PCU_BLUETOOTH_MODE2_INTERRUPT_ENABLE_MASK 0x40000000 -#define MAC_PCU_BLUETOOTH_MODE2_INTERRUPT_ENABLE_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE2_INTERRUPT_ENABLE_MASK) >> MAC_PCU_BLUETOOTH_MODE2_INTERRUPT_ENABLE_LSB) -#define MAC_PCU_BLUETOOTH_MODE2_INTERRUPT_ENABLE_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE2_INTERRUPT_ENABLE_LSB) & MAC_PCU_BLUETOOTH_MODE2_INTERRUPT_ENABLE_MASK) -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_PRIORITY_CTRL_MSB 29 -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_PRIORITY_CTRL_LSB 28 -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_PRIORITY_CTRL_MASK 0x30000000 -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_PRIORITY_CTRL_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE2_TSF_BT_PRIORITY_CTRL_MASK) >> MAC_PCU_BLUETOOTH_MODE2_TSF_BT_PRIORITY_CTRL_LSB) -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_PRIORITY_CTRL_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE2_TSF_BT_PRIORITY_CTRL_LSB) & MAC_PCU_BLUETOOTH_MODE2_TSF_BT_PRIORITY_CTRL_MASK) -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_ACTIVE_CTRL_MSB 27 -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_ACTIVE_CTRL_LSB 26 -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_ACTIVE_CTRL_MASK 0x0c000000 -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_ACTIVE_CTRL_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE2_TSF_BT_ACTIVE_CTRL_MASK) >> MAC_PCU_BLUETOOTH_MODE2_TSF_BT_ACTIVE_CTRL_LSB) -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_ACTIVE_CTRL_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE2_TSF_BT_ACTIVE_CTRL_LSB) & MAC_PCU_BLUETOOTH_MODE2_TSF_BT_ACTIVE_CTRL_MASK) -#define MAC_PCU_BLUETOOTH_MODE2_RS_DISCARD_EXTEND_MSB 25 -#define MAC_PCU_BLUETOOTH_MODE2_RS_DISCARD_EXTEND_LSB 25 -#define MAC_PCU_BLUETOOTH_MODE2_RS_DISCARD_EXTEND_MASK 0x02000000 -#define MAC_PCU_BLUETOOTH_MODE2_RS_DISCARD_EXTEND_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE2_RS_DISCARD_EXTEND_MASK) >> MAC_PCU_BLUETOOTH_MODE2_RS_DISCARD_EXTEND_LSB) -#define MAC_PCU_BLUETOOTH_MODE2_RS_DISCARD_EXTEND_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE2_RS_DISCARD_EXTEND_LSB) & MAC_PCU_BLUETOOTH_MODE2_RS_DISCARD_EXTEND_MASK) -#define MAC_PCU_BLUETOOTH_MODE2_WL_TXRX_SEPARATE_MSB 24 -#define MAC_PCU_BLUETOOTH_MODE2_WL_TXRX_SEPARATE_LSB 24 -#define MAC_PCU_BLUETOOTH_MODE2_WL_TXRX_SEPARATE_MASK 0x01000000 -#define MAC_PCU_BLUETOOTH_MODE2_WL_TXRX_SEPARATE_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE2_WL_TXRX_SEPARATE_MASK) >> MAC_PCU_BLUETOOTH_MODE2_WL_TXRX_SEPARATE_LSB) -#define MAC_PCU_BLUETOOTH_MODE2_WL_TXRX_SEPARATE_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE2_WL_TXRX_SEPARATE_LSB) & MAC_PCU_BLUETOOTH_MODE2_WL_TXRX_SEPARATE_MASK) -#define MAC_PCU_BLUETOOTH_MODE2_WL_ACTIVE_MODE_MSB 23 -#define MAC_PCU_BLUETOOTH_MODE2_WL_ACTIVE_MODE_LSB 22 -#define MAC_PCU_BLUETOOTH_MODE2_WL_ACTIVE_MODE_MASK 0x00c00000 -#define MAC_PCU_BLUETOOTH_MODE2_WL_ACTIVE_MODE_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE2_WL_ACTIVE_MODE_MASK) >> MAC_PCU_BLUETOOTH_MODE2_WL_ACTIVE_MODE_LSB) -#define MAC_PCU_BLUETOOTH_MODE2_WL_ACTIVE_MODE_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE2_WL_ACTIVE_MODE_LSB) & MAC_PCU_BLUETOOTH_MODE2_WL_ACTIVE_MODE_MASK) -#define MAC_PCU_BLUETOOTH_MODE2_QUIET_2_WIRE_MSB 21 -#define MAC_PCU_BLUETOOTH_MODE2_QUIET_2_WIRE_LSB 21 -#define MAC_PCU_BLUETOOTH_MODE2_QUIET_2_WIRE_MASK 0x00200000 -#define MAC_PCU_BLUETOOTH_MODE2_QUIET_2_WIRE_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE2_QUIET_2_WIRE_MASK) >> MAC_PCU_BLUETOOTH_MODE2_QUIET_2_WIRE_LSB) -#define MAC_PCU_BLUETOOTH_MODE2_QUIET_2_WIRE_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE2_QUIET_2_WIRE_LSB) & MAC_PCU_BLUETOOTH_MODE2_QUIET_2_WIRE_MASK) -#define MAC_PCU_BLUETOOTH_MODE2_DISABLE_BT_ANT_MSB 20 -#define MAC_PCU_BLUETOOTH_MODE2_DISABLE_BT_ANT_LSB 20 -#define MAC_PCU_BLUETOOTH_MODE2_DISABLE_BT_ANT_MASK 0x00100000 -#define MAC_PCU_BLUETOOTH_MODE2_DISABLE_BT_ANT_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE2_DISABLE_BT_ANT_MASK) >> MAC_PCU_BLUETOOTH_MODE2_DISABLE_BT_ANT_LSB) -#define MAC_PCU_BLUETOOTH_MODE2_DISABLE_BT_ANT_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE2_DISABLE_BT_ANT_LSB) & MAC_PCU_BLUETOOTH_MODE2_DISABLE_BT_ANT_MASK) -#define MAC_PCU_BLUETOOTH_MODE2_PROTECT_BT_AFTER_WAKEUP_MSB 19 -#define MAC_PCU_BLUETOOTH_MODE2_PROTECT_BT_AFTER_WAKEUP_LSB 19 -#define MAC_PCU_BLUETOOTH_MODE2_PROTECT_BT_AFTER_WAKEUP_MASK 0x00080000 -#define MAC_PCU_BLUETOOTH_MODE2_PROTECT_BT_AFTER_WAKEUP_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE2_PROTECT_BT_AFTER_WAKEUP_MASK) >> MAC_PCU_BLUETOOTH_MODE2_PROTECT_BT_AFTER_WAKEUP_LSB) -#define MAC_PCU_BLUETOOTH_MODE2_PROTECT_BT_AFTER_WAKEUP_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE2_PROTECT_BT_AFTER_WAKEUP_LSB) & MAC_PCU_BLUETOOTH_MODE2_PROTECT_BT_AFTER_WAKEUP_MASK) -#define MAC_PCU_BLUETOOTH_MODE2_SLEEP_ALLOW_BT_ACCESS_MSB 17 -#define MAC_PCU_BLUETOOTH_MODE2_SLEEP_ALLOW_BT_ACCESS_LSB 17 -#define MAC_PCU_BLUETOOTH_MODE2_SLEEP_ALLOW_BT_ACCESS_MASK 0x00020000 -#define MAC_PCU_BLUETOOTH_MODE2_SLEEP_ALLOW_BT_ACCESS_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE2_SLEEP_ALLOW_BT_ACCESS_MASK) >> MAC_PCU_BLUETOOTH_MODE2_SLEEP_ALLOW_BT_ACCESS_LSB) -#define MAC_PCU_BLUETOOTH_MODE2_SLEEP_ALLOW_BT_ACCESS_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE2_SLEEP_ALLOW_BT_ACCESS_LSB) & MAC_PCU_BLUETOOTH_MODE2_SLEEP_ALLOW_BT_ACCESS_MASK) -#define MAC_PCU_BLUETOOTH_MODE2_HOLD_RX_CLEAR_MSB 16 -#define MAC_PCU_BLUETOOTH_MODE2_HOLD_RX_CLEAR_LSB 16 -#define MAC_PCU_BLUETOOTH_MODE2_HOLD_RX_CLEAR_MASK 0x00010000 -#define MAC_PCU_BLUETOOTH_MODE2_HOLD_RX_CLEAR_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE2_HOLD_RX_CLEAR_MASK) >> MAC_PCU_BLUETOOTH_MODE2_HOLD_RX_CLEAR_LSB) -#define MAC_PCU_BLUETOOTH_MODE2_HOLD_RX_CLEAR_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE2_HOLD_RX_CLEAR_LSB) & MAC_PCU_BLUETOOTH_MODE2_HOLD_RX_CLEAR_MASK) -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_CNT_MSB 15 -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_CNT_LSB 8 -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_CNT_MASK 0x0000ff00 -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_CNT_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_CNT_MASK) >> MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_CNT_LSB) -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_CNT_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_CNT_LSB) & MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_CNT_MASK) -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_THRESH_MSB 7 -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_THRESH_LSB 0 -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_THRESH_MASK 0x000000ff -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_THRESH_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_THRESH_MASK) >> MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_THRESH_LSB) -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_THRESH_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_THRESH_LSB) & MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_THRESH_MASK) - -#define MAC_PCU_TXSIFS_ADDRESS 0x000080f8 -#define MAC_PCU_TXSIFS_OFFSET 0x000000f8 -#define MAC_PCU_TXSIFS_ACK_SHIFT_MSB 14 -#define MAC_PCU_TXSIFS_ACK_SHIFT_LSB 12 -#define MAC_PCU_TXSIFS_ACK_SHIFT_MASK 0x00007000 -#define MAC_PCU_TXSIFS_ACK_SHIFT_GET(x) (((x) & MAC_PCU_TXSIFS_ACK_SHIFT_MASK) >> MAC_PCU_TXSIFS_ACK_SHIFT_LSB) -#define MAC_PCU_TXSIFS_ACK_SHIFT_SET(x) (((x) << MAC_PCU_TXSIFS_ACK_SHIFT_LSB) & MAC_PCU_TXSIFS_ACK_SHIFT_MASK) -#define MAC_PCU_TXSIFS_TX_LATENCY_MSB 11 -#define MAC_PCU_TXSIFS_TX_LATENCY_LSB 8 -#define MAC_PCU_TXSIFS_TX_LATENCY_MASK 0x00000f00 -#define MAC_PCU_TXSIFS_TX_LATENCY_GET(x) (((x) & MAC_PCU_TXSIFS_TX_LATENCY_MASK) >> MAC_PCU_TXSIFS_TX_LATENCY_LSB) -#define MAC_PCU_TXSIFS_TX_LATENCY_SET(x) (((x) << MAC_PCU_TXSIFS_TX_LATENCY_LSB) & MAC_PCU_TXSIFS_TX_LATENCY_MASK) -#define MAC_PCU_TXSIFS_SIFS_TIME_MSB 7 -#define MAC_PCU_TXSIFS_SIFS_TIME_LSB 0 -#define MAC_PCU_TXSIFS_SIFS_TIME_MASK 0x000000ff -#define MAC_PCU_TXSIFS_SIFS_TIME_GET(x) (((x) & MAC_PCU_TXSIFS_SIFS_TIME_MASK) >> MAC_PCU_TXSIFS_SIFS_TIME_LSB) -#define MAC_PCU_TXSIFS_SIFS_TIME_SET(x) (((x) << MAC_PCU_TXSIFS_SIFS_TIME_LSB) & MAC_PCU_TXSIFS_SIFS_TIME_MASK) - -#define MAC_PCU_TXOP_X_ADDRESS 0x000080fc -#define MAC_PCU_TXOP_X_OFFSET 0x000000fc -#define MAC_PCU_TXOP_X_VALUE_MSB 7 -#define MAC_PCU_TXOP_X_VALUE_LSB 0 -#define MAC_PCU_TXOP_X_VALUE_MASK 0x000000ff -#define MAC_PCU_TXOP_X_VALUE_GET(x) (((x) & MAC_PCU_TXOP_X_VALUE_MASK) >> MAC_PCU_TXOP_X_VALUE_LSB) -#define MAC_PCU_TXOP_X_VALUE_SET(x) (((x) << MAC_PCU_TXOP_X_VALUE_LSB) & MAC_PCU_TXOP_X_VALUE_MASK) - -#define MAC_PCU_TXOP_0_3_ADDRESS 0x00008100 -#define MAC_PCU_TXOP_0_3_OFFSET 0x00000100 -#define MAC_PCU_TXOP_0_3_VALUE_3_MSB 31 -#define MAC_PCU_TXOP_0_3_VALUE_3_LSB 24 -#define MAC_PCU_TXOP_0_3_VALUE_3_MASK 0xff000000 -#define MAC_PCU_TXOP_0_3_VALUE_3_GET(x) (((x) & MAC_PCU_TXOP_0_3_VALUE_3_MASK) >> MAC_PCU_TXOP_0_3_VALUE_3_LSB) -#define MAC_PCU_TXOP_0_3_VALUE_3_SET(x) (((x) << MAC_PCU_TXOP_0_3_VALUE_3_LSB) & MAC_PCU_TXOP_0_3_VALUE_3_MASK) -#define MAC_PCU_TXOP_0_3_VALUE_2_MSB 23 -#define MAC_PCU_TXOP_0_3_VALUE_2_LSB 16 -#define MAC_PCU_TXOP_0_3_VALUE_2_MASK 0x00ff0000 -#define MAC_PCU_TXOP_0_3_VALUE_2_GET(x) (((x) & MAC_PCU_TXOP_0_3_VALUE_2_MASK) >> MAC_PCU_TXOP_0_3_VALUE_2_LSB) -#define MAC_PCU_TXOP_0_3_VALUE_2_SET(x) (((x) << MAC_PCU_TXOP_0_3_VALUE_2_LSB) & MAC_PCU_TXOP_0_3_VALUE_2_MASK) -#define MAC_PCU_TXOP_0_3_VALUE_1_MSB 15 -#define MAC_PCU_TXOP_0_3_VALUE_1_LSB 8 -#define MAC_PCU_TXOP_0_3_VALUE_1_MASK 0x0000ff00 -#define MAC_PCU_TXOP_0_3_VALUE_1_GET(x) (((x) & MAC_PCU_TXOP_0_3_VALUE_1_MASK) >> MAC_PCU_TXOP_0_3_VALUE_1_LSB) -#define MAC_PCU_TXOP_0_3_VALUE_1_SET(x) (((x) << MAC_PCU_TXOP_0_3_VALUE_1_LSB) & MAC_PCU_TXOP_0_3_VALUE_1_MASK) -#define MAC_PCU_TXOP_0_3_VALUE_0_MSB 7 -#define MAC_PCU_TXOP_0_3_VALUE_0_LSB 0 -#define MAC_PCU_TXOP_0_3_VALUE_0_MASK 0x000000ff -#define MAC_PCU_TXOP_0_3_VALUE_0_GET(x) (((x) & MAC_PCU_TXOP_0_3_VALUE_0_MASK) >> MAC_PCU_TXOP_0_3_VALUE_0_LSB) -#define MAC_PCU_TXOP_0_3_VALUE_0_SET(x) (((x) << MAC_PCU_TXOP_0_3_VALUE_0_LSB) & MAC_PCU_TXOP_0_3_VALUE_0_MASK) - -#define MAC_PCU_TXOP_4_7_ADDRESS 0x00008104 -#define MAC_PCU_TXOP_4_7_OFFSET 0x00000104 -#define MAC_PCU_TXOP_4_7_VALUE_7_MSB 31 -#define MAC_PCU_TXOP_4_7_VALUE_7_LSB 24 -#define MAC_PCU_TXOP_4_7_VALUE_7_MASK 0xff000000 -#define MAC_PCU_TXOP_4_7_VALUE_7_GET(x) (((x) & MAC_PCU_TXOP_4_7_VALUE_7_MASK) >> MAC_PCU_TXOP_4_7_VALUE_7_LSB) -#define MAC_PCU_TXOP_4_7_VALUE_7_SET(x) (((x) << MAC_PCU_TXOP_4_7_VALUE_7_LSB) & MAC_PCU_TXOP_4_7_VALUE_7_MASK) -#define MAC_PCU_TXOP_4_7_VALUE_6_MSB 23 -#define MAC_PCU_TXOP_4_7_VALUE_6_LSB 16 -#define MAC_PCU_TXOP_4_7_VALUE_6_MASK 0x00ff0000 -#define MAC_PCU_TXOP_4_7_VALUE_6_GET(x) (((x) & MAC_PCU_TXOP_4_7_VALUE_6_MASK) >> MAC_PCU_TXOP_4_7_VALUE_6_LSB) -#define MAC_PCU_TXOP_4_7_VALUE_6_SET(x) (((x) << MAC_PCU_TXOP_4_7_VALUE_6_LSB) & MAC_PCU_TXOP_4_7_VALUE_6_MASK) -#define MAC_PCU_TXOP_4_7_VALUE_5_MSB 15 -#define MAC_PCU_TXOP_4_7_VALUE_5_LSB 8 -#define MAC_PCU_TXOP_4_7_VALUE_5_MASK 0x0000ff00 -#define MAC_PCU_TXOP_4_7_VALUE_5_GET(x) (((x) & MAC_PCU_TXOP_4_7_VALUE_5_MASK) >> MAC_PCU_TXOP_4_7_VALUE_5_LSB) -#define MAC_PCU_TXOP_4_7_VALUE_5_SET(x) (((x) << MAC_PCU_TXOP_4_7_VALUE_5_LSB) & MAC_PCU_TXOP_4_7_VALUE_5_MASK) -#define MAC_PCU_TXOP_4_7_VALUE_4_MSB 7 -#define MAC_PCU_TXOP_4_7_VALUE_4_LSB 0 -#define MAC_PCU_TXOP_4_7_VALUE_4_MASK 0x000000ff -#define MAC_PCU_TXOP_4_7_VALUE_4_GET(x) (((x) & MAC_PCU_TXOP_4_7_VALUE_4_MASK) >> MAC_PCU_TXOP_4_7_VALUE_4_LSB) -#define MAC_PCU_TXOP_4_7_VALUE_4_SET(x) (((x) << MAC_PCU_TXOP_4_7_VALUE_4_LSB) & MAC_PCU_TXOP_4_7_VALUE_4_MASK) - -#define MAC_PCU_TXOP_8_11_ADDRESS 0x00008108 -#define MAC_PCU_TXOP_8_11_OFFSET 0x00000108 -#define MAC_PCU_TXOP_8_11_VALUE_11_MSB 31 -#define MAC_PCU_TXOP_8_11_VALUE_11_LSB 24 -#define MAC_PCU_TXOP_8_11_VALUE_11_MASK 0xff000000 -#define MAC_PCU_TXOP_8_11_VALUE_11_GET(x) (((x) & MAC_PCU_TXOP_8_11_VALUE_11_MASK) >> MAC_PCU_TXOP_8_11_VALUE_11_LSB) -#define MAC_PCU_TXOP_8_11_VALUE_11_SET(x) (((x) << MAC_PCU_TXOP_8_11_VALUE_11_LSB) & MAC_PCU_TXOP_8_11_VALUE_11_MASK) -#define MAC_PCU_TXOP_8_11_VALUE_10_MSB 23 -#define MAC_PCU_TXOP_8_11_VALUE_10_LSB 16 -#define MAC_PCU_TXOP_8_11_VALUE_10_MASK 0x00ff0000 -#define MAC_PCU_TXOP_8_11_VALUE_10_GET(x) (((x) & MAC_PCU_TXOP_8_11_VALUE_10_MASK) >> MAC_PCU_TXOP_8_11_VALUE_10_LSB) -#define MAC_PCU_TXOP_8_11_VALUE_10_SET(x) (((x) << MAC_PCU_TXOP_8_11_VALUE_10_LSB) & MAC_PCU_TXOP_8_11_VALUE_10_MASK) -#define MAC_PCU_TXOP_8_11_VALUE_9_MSB 15 -#define MAC_PCU_TXOP_8_11_VALUE_9_LSB 8 -#define MAC_PCU_TXOP_8_11_VALUE_9_MASK 0x0000ff00 -#define MAC_PCU_TXOP_8_11_VALUE_9_GET(x) (((x) & MAC_PCU_TXOP_8_11_VALUE_9_MASK) >> MAC_PCU_TXOP_8_11_VALUE_9_LSB) -#define MAC_PCU_TXOP_8_11_VALUE_9_SET(x) (((x) << MAC_PCU_TXOP_8_11_VALUE_9_LSB) & MAC_PCU_TXOP_8_11_VALUE_9_MASK) -#define MAC_PCU_TXOP_8_11_VALUE_8_MSB 7 -#define MAC_PCU_TXOP_8_11_VALUE_8_LSB 0 -#define MAC_PCU_TXOP_8_11_VALUE_8_MASK 0x000000ff -#define MAC_PCU_TXOP_8_11_VALUE_8_GET(x) (((x) & MAC_PCU_TXOP_8_11_VALUE_8_MASK) >> MAC_PCU_TXOP_8_11_VALUE_8_LSB) -#define MAC_PCU_TXOP_8_11_VALUE_8_SET(x) (((x) << MAC_PCU_TXOP_8_11_VALUE_8_LSB) & MAC_PCU_TXOP_8_11_VALUE_8_MASK) - -#define MAC_PCU_TXOP_12_15_ADDRESS 0x0000810c -#define MAC_PCU_TXOP_12_15_OFFSET 0x0000010c -#define MAC_PCU_TXOP_12_15_VALUE_15_MSB 31 -#define MAC_PCU_TXOP_12_15_VALUE_15_LSB 24 -#define MAC_PCU_TXOP_12_15_VALUE_15_MASK 0xff000000 -#define MAC_PCU_TXOP_12_15_VALUE_15_GET(x) (((x) & MAC_PCU_TXOP_12_15_VALUE_15_MASK) >> MAC_PCU_TXOP_12_15_VALUE_15_LSB) -#define MAC_PCU_TXOP_12_15_VALUE_15_SET(x) (((x) << MAC_PCU_TXOP_12_15_VALUE_15_LSB) & MAC_PCU_TXOP_12_15_VALUE_15_MASK) -#define MAC_PCU_TXOP_12_15_VALUE_14_MSB 23 -#define MAC_PCU_TXOP_12_15_VALUE_14_LSB 16 -#define MAC_PCU_TXOP_12_15_VALUE_14_MASK 0x00ff0000 -#define MAC_PCU_TXOP_12_15_VALUE_14_GET(x) (((x) & MAC_PCU_TXOP_12_15_VALUE_14_MASK) >> MAC_PCU_TXOP_12_15_VALUE_14_LSB) -#define MAC_PCU_TXOP_12_15_VALUE_14_SET(x) (((x) << MAC_PCU_TXOP_12_15_VALUE_14_LSB) & MAC_PCU_TXOP_12_15_VALUE_14_MASK) -#define MAC_PCU_TXOP_12_15_VALUE_13_MSB 15 -#define MAC_PCU_TXOP_12_15_VALUE_13_LSB 8 -#define MAC_PCU_TXOP_12_15_VALUE_13_MASK 0x0000ff00 -#define MAC_PCU_TXOP_12_15_VALUE_13_GET(x) (((x) & MAC_PCU_TXOP_12_15_VALUE_13_MASK) >> MAC_PCU_TXOP_12_15_VALUE_13_LSB) -#define MAC_PCU_TXOP_12_15_VALUE_13_SET(x) (((x) << MAC_PCU_TXOP_12_15_VALUE_13_LSB) & MAC_PCU_TXOP_12_15_VALUE_13_MASK) -#define MAC_PCU_TXOP_12_15_VALUE_12_MSB 7 -#define MAC_PCU_TXOP_12_15_VALUE_12_LSB 0 -#define MAC_PCU_TXOP_12_15_VALUE_12_MASK 0x000000ff -#define MAC_PCU_TXOP_12_15_VALUE_12_GET(x) (((x) & MAC_PCU_TXOP_12_15_VALUE_12_MASK) >> MAC_PCU_TXOP_12_15_VALUE_12_LSB) -#define MAC_PCU_TXOP_12_15_VALUE_12_SET(x) (((x) << MAC_PCU_TXOP_12_15_VALUE_12_LSB) & MAC_PCU_TXOP_12_15_VALUE_12_MASK) - -#define MAC_PCU_LOGIC_ANALYZER_ADDRESS 0x00008110 -#define MAC_PCU_LOGIC_ANALYZER_OFFSET 0x00000110 -#define MAC_PCU_LOGIC_ANALYZER_DIAG_MODE_MSB 31 -#define MAC_PCU_LOGIC_ANALYZER_DIAG_MODE_LSB 18 -#define MAC_PCU_LOGIC_ANALYZER_DIAG_MODE_MASK 0xfffc0000 -#define MAC_PCU_LOGIC_ANALYZER_DIAG_MODE_GET(x) (((x) & MAC_PCU_LOGIC_ANALYZER_DIAG_MODE_MASK) >> MAC_PCU_LOGIC_ANALYZER_DIAG_MODE_LSB) -#define MAC_PCU_LOGIC_ANALYZER_DIAG_MODE_SET(x) (((x) << MAC_PCU_LOGIC_ANALYZER_DIAG_MODE_LSB) & MAC_PCU_LOGIC_ANALYZER_DIAG_MODE_MASK) -#define MAC_PCU_LOGIC_ANALYZER_INT_ADDR_MSB 17 -#define MAC_PCU_LOGIC_ANALYZER_INT_ADDR_LSB 8 -#define MAC_PCU_LOGIC_ANALYZER_INT_ADDR_MASK 0x0003ff00 -#define MAC_PCU_LOGIC_ANALYZER_INT_ADDR_GET(x) (((x) & MAC_PCU_LOGIC_ANALYZER_INT_ADDR_MASK) >> MAC_PCU_LOGIC_ANALYZER_INT_ADDR_LSB) -#define MAC_PCU_LOGIC_ANALYZER_INT_ADDR_SET(x) (((x) << MAC_PCU_LOGIC_ANALYZER_INT_ADDR_LSB) & MAC_PCU_LOGIC_ANALYZER_INT_ADDR_MASK) -#define MAC_PCU_LOGIC_ANALYZER_QCU_SEL_MSB 7 -#define MAC_PCU_LOGIC_ANALYZER_QCU_SEL_LSB 4 -#define MAC_PCU_LOGIC_ANALYZER_QCU_SEL_MASK 0x000000f0 -#define MAC_PCU_LOGIC_ANALYZER_QCU_SEL_GET(x) (((x) & MAC_PCU_LOGIC_ANALYZER_QCU_SEL_MASK) >> MAC_PCU_LOGIC_ANALYZER_QCU_SEL_LSB) -#define MAC_PCU_LOGIC_ANALYZER_QCU_SEL_SET(x) (((x) << MAC_PCU_LOGIC_ANALYZER_QCU_SEL_LSB) & MAC_PCU_LOGIC_ANALYZER_QCU_SEL_MASK) -#define MAC_PCU_LOGIC_ANALYZER_ENABLE_MSB 3 -#define MAC_PCU_LOGIC_ANALYZER_ENABLE_LSB 3 -#define MAC_PCU_LOGIC_ANALYZER_ENABLE_MASK 0x00000008 -#define MAC_PCU_LOGIC_ANALYZER_ENABLE_GET(x) (((x) & MAC_PCU_LOGIC_ANALYZER_ENABLE_MASK) >> MAC_PCU_LOGIC_ANALYZER_ENABLE_LSB) -#define MAC_PCU_LOGIC_ANALYZER_ENABLE_SET(x) (((x) << MAC_PCU_LOGIC_ANALYZER_ENABLE_LSB) & MAC_PCU_LOGIC_ANALYZER_ENABLE_MASK) -#define MAC_PCU_LOGIC_ANALYZER_STATE_MSB 2 -#define MAC_PCU_LOGIC_ANALYZER_STATE_LSB 2 -#define MAC_PCU_LOGIC_ANALYZER_STATE_MASK 0x00000004 -#define MAC_PCU_LOGIC_ANALYZER_STATE_GET(x) (((x) & MAC_PCU_LOGIC_ANALYZER_STATE_MASK) >> MAC_PCU_LOGIC_ANALYZER_STATE_LSB) -#define MAC_PCU_LOGIC_ANALYZER_STATE_SET(x) (((x) << MAC_PCU_LOGIC_ANALYZER_STATE_LSB) & MAC_PCU_LOGIC_ANALYZER_STATE_MASK) -#define MAC_PCU_LOGIC_ANALYZER_CLEAR_MSB 1 -#define MAC_PCU_LOGIC_ANALYZER_CLEAR_LSB 1 -#define MAC_PCU_LOGIC_ANALYZER_CLEAR_MASK 0x00000002 -#define MAC_PCU_LOGIC_ANALYZER_CLEAR_GET(x) (((x) & MAC_PCU_LOGIC_ANALYZER_CLEAR_MASK) >> MAC_PCU_LOGIC_ANALYZER_CLEAR_LSB) -#define MAC_PCU_LOGIC_ANALYZER_CLEAR_SET(x) (((x) << MAC_PCU_LOGIC_ANALYZER_CLEAR_LSB) & MAC_PCU_LOGIC_ANALYZER_CLEAR_MASK) -#define MAC_PCU_LOGIC_ANALYZER_HOLD_MSB 0 -#define MAC_PCU_LOGIC_ANALYZER_HOLD_LSB 0 -#define MAC_PCU_LOGIC_ANALYZER_HOLD_MASK 0x00000001 -#define MAC_PCU_LOGIC_ANALYZER_HOLD_GET(x) (((x) & MAC_PCU_LOGIC_ANALYZER_HOLD_MASK) >> MAC_PCU_LOGIC_ANALYZER_HOLD_LSB) -#define MAC_PCU_LOGIC_ANALYZER_HOLD_SET(x) (((x) << MAC_PCU_LOGIC_ANALYZER_HOLD_LSB) & MAC_PCU_LOGIC_ANALYZER_HOLD_MASK) - -#define MAC_PCU_LOGIC_ANALYZER_32L_ADDRESS 0x00008114 -#define MAC_PCU_LOGIC_ANALYZER_32L_OFFSET 0x00000114 -#define MAC_PCU_LOGIC_ANALYZER_32L_MASK_MSB 31 -#define MAC_PCU_LOGIC_ANALYZER_32L_MASK_LSB 0 -#define MAC_PCU_LOGIC_ANALYZER_32L_MASK_MASK 0xffffffff -#define MAC_PCU_LOGIC_ANALYZER_32L_MASK_GET(x) (((x) & MAC_PCU_LOGIC_ANALYZER_32L_MASK_MASK) >> MAC_PCU_LOGIC_ANALYZER_32L_MASK_LSB) -#define MAC_PCU_LOGIC_ANALYZER_32L_MASK_SET(x) (((x) << MAC_PCU_LOGIC_ANALYZER_32L_MASK_LSB) & MAC_PCU_LOGIC_ANALYZER_32L_MASK_MASK) - -#define MAC_PCU_LOGIC_ANALYZER_16U_ADDRESS 0x00008118 -#define MAC_PCU_LOGIC_ANALYZER_16U_OFFSET 0x00000118 -#define MAC_PCU_LOGIC_ANALYZER_16U_MASK_MSB 15 -#define MAC_PCU_LOGIC_ANALYZER_16U_MASK_LSB 0 -#define MAC_PCU_LOGIC_ANALYZER_16U_MASK_MASK 0x0000ffff -#define MAC_PCU_LOGIC_ANALYZER_16U_MASK_GET(x) (((x) & MAC_PCU_LOGIC_ANALYZER_16U_MASK_MASK) >> MAC_PCU_LOGIC_ANALYZER_16U_MASK_LSB) -#define MAC_PCU_LOGIC_ANALYZER_16U_MASK_SET(x) (((x) << MAC_PCU_LOGIC_ANALYZER_16U_MASK_LSB) & MAC_PCU_LOGIC_ANALYZER_16U_MASK_MASK) - -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_ADDRESS 0x0000811c -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_OFFSET 0x0000011c -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK3_MSB 23 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK3_LSB 16 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK3_MASK 0x00ff0000 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK3_GET(x) (((x) & MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK3_MASK) >> MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK3_LSB) -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK3_SET(x) (((x) << MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK3_LSB) & MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK3_MASK) -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK2_MSB 15 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK2_LSB 8 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK2_MASK 0x0000ff00 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK2_GET(x) (((x) & MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK2_MASK) >> MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK2_LSB) -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK2_SET(x) (((x) << MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK2_LSB) & MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK2_MASK) -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK1_MSB 7 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK1_LSB 0 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK1_MASK 0x000000ff -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK1_GET(x) (((x) & MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK1_MASK) >> MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK1_LSB) -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK1_SET(x) (((x) << MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK1_LSB) & MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK1_MASK) - -#define MAC_PCU_AZIMUTH_MODE_ADDRESS 0x00008120 -#define MAC_PCU_AZIMUTH_MODE_OFFSET 0x00000120 -#define MAC_PCU_AZIMUTH_MODE_BA_USES_AD1_MSB 7 -#define MAC_PCU_AZIMUTH_MODE_BA_USES_AD1_LSB 7 -#define MAC_PCU_AZIMUTH_MODE_BA_USES_AD1_MASK 0x00000080 -#define MAC_PCU_AZIMUTH_MODE_BA_USES_AD1_GET(x) (((x) & MAC_PCU_AZIMUTH_MODE_BA_USES_AD1_MASK) >> MAC_PCU_AZIMUTH_MODE_BA_USES_AD1_LSB) -#define MAC_PCU_AZIMUTH_MODE_BA_USES_AD1_SET(x) (((x) << MAC_PCU_AZIMUTH_MODE_BA_USES_AD1_LSB) & MAC_PCU_AZIMUTH_MODE_BA_USES_AD1_MASK) -#define MAC_PCU_AZIMUTH_MODE_ACK_CTS_MATCH_TX_AD2_MSB 6 -#define MAC_PCU_AZIMUTH_MODE_ACK_CTS_MATCH_TX_AD2_LSB 6 -#define MAC_PCU_AZIMUTH_MODE_ACK_CTS_MATCH_TX_AD2_MASK 0x00000040 -#define MAC_PCU_AZIMUTH_MODE_ACK_CTS_MATCH_TX_AD2_GET(x) (((x) & MAC_PCU_AZIMUTH_MODE_ACK_CTS_MATCH_TX_AD2_MASK) >> MAC_PCU_AZIMUTH_MODE_ACK_CTS_MATCH_TX_AD2_LSB) -#define MAC_PCU_AZIMUTH_MODE_ACK_CTS_MATCH_TX_AD2_SET(x) (((x) << MAC_PCU_AZIMUTH_MODE_ACK_CTS_MATCH_TX_AD2_LSB) & MAC_PCU_AZIMUTH_MODE_ACK_CTS_MATCH_TX_AD2_MASK) -#define MAC_PCU_AZIMUTH_MODE_TX_DESC_EN_MSB 5 -#define MAC_PCU_AZIMUTH_MODE_TX_DESC_EN_LSB 5 -#define MAC_PCU_AZIMUTH_MODE_TX_DESC_EN_MASK 0x00000020 -#define MAC_PCU_AZIMUTH_MODE_TX_DESC_EN_GET(x) (((x) & MAC_PCU_AZIMUTH_MODE_TX_DESC_EN_MASK) >> MAC_PCU_AZIMUTH_MODE_TX_DESC_EN_LSB) -#define MAC_PCU_AZIMUTH_MODE_TX_DESC_EN_SET(x) (((x) << MAC_PCU_AZIMUTH_MODE_TX_DESC_EN_LSB) & MAC_PCU_AZIMUTH_MODE_TX_DESC_EN_MASK) -#define MAC_PCU_AZIMUTH_MODE_CLK_EN_MSB 4 -#define MAC_PCU_AZIMUTH_MODE_CLK_EN_LSB 4 -#define MAC_PCU_AZIMUTH_MODE_CLK_EN_MASK 0x00000010 -#define MAC_PCU_AZIMUTH_MODE_CLK_EN_GET(x) (((x) & MAC_PCU_AZIMUTH_MODE_CLK_EN_MASK) >> MAC_PCU_AZIMUTH_MODE_CLK_EN_LSB) -#define MAC_PCU_AZIMUTH_MODE_CLK_EN_SET(x) (((x) << MAC_PCU_AZIMUTH_MODE_CLK_EN_LSB) & MAC_PCU_AZIMUTH_MODE_CLK_EN_MASK) -#define MAC_PCU_AZIMUTH_MODE_RX_TSF_STATUS_SEL_MSB 3 -#define MAC_PCU_AZIMUTH_MODE_RX_TSF_STATUS_SEL_LSB 3 -#define MAC_PCU_AZIMUTH_MODE_RX_TSF_STATUS_SEL_MASK 0x00000008 -#define MAC_PCU_AZIMUTH_MODE_RX_TSF_STATUS_SEL_GET(x) (((x) & MAC_PCU_AZIMUTH_MODE_RX_TSF_STATUS_SEL_MASK) >> MAC_PCU_AZIMUTH_MODE_RX_TSF_STATUS_SEL_LSB) -#define MAC_PCU_AZIMUTH_MODE_RX_TSF_STATUS_SEL_SET(x) (((x) << MAC_PCU_AZIMUTH_MODE_RX_TSF_STATUS_SEL_LSB) & MAC_PCU_AZIMUTH_MODE_RX_TSF_STATUS_SEL_MASK) -#define MAC_PCU_AZIMUTH_MODE_TX_TSF_STATUS_SEL_MSB 2 -#define MAC_PCU_AZIMUTH_MODE_TX_TSF_STATUS_SEL_LSB 2 -#define MAC_PCU_AZIMUTH_MODE_TX_TSF_STATUS_SEL_MASK 0x00000004 -#define MAC_PCU_AZIMUTH_MODE_TX_TSF_STATUS_SEL_GET(x) (((x) & MAC_PCU_AZIMUTH_MODE_TX_TSF_STATUS_SEL_MASK) >> MAC_PCU_AZIMUTH_MODE_TX_TSF_STATUS_SEL_LSB) -#define MAC_PCU_AZIMUTH_MODE_TX_TSF_STATUS_SEL_SET(x) (((x) << MAC_PCU_AZIMUTH_MODE_TX_TSF_STATUS_SEL_LSB) & MAC_PCU_AZIMUTH_MODE_TX_TSF_STATUS_SEL_MASK) -#define MAC_PCU_AZIMUTH_MODE_KEY_SEARCH_AD1_MSB 1 -#define MAC_PCU_AZIMUTH_MODE_KEY_SEARCH_AD1_LSB 1 -#define MAC_PCU_AZIMUTH_MODE_KEY_SEARCH_AD1_MASK 0x00000002 -#define MAC_PCU_AZIMUTH_MODE_KEY_SEARCH_AD1_GET(x) (((x) & MAC_PCU_AZIMUTH_MODE_KEY_SEARCH_AD1_MASK) >> MAC_PCU_AZIMUTH_MODE_KEY_SEARCH_AD1_LSB) -#define MAC_PCU_AZIMUTH_MODE_KEY_SEARCH_AD1_SET(x) (((x) << MAC_PCU_AZIMUTH_MODE_KEY_SEARCH_AD1_LSB) & MAC_PCU_AZIMUTH_MODE_KEY_SEARCH_AD1_MASK) -#define MAC_PCU_AZIMUTH_MODE_DISABLE_TSF_UPDATE_MSB 0 -#define MAC_PCU_AZIMUTH_MODE_DISABLE_TSF_UPDATE_LSB 0 -#define MAC_PCU_AZIMUTH_MODE_DISABLE_TSF_UPDATE_MASK 0x00000001 -#define MAC_PCU_AZIMUTH_MODE_DISABLE_TSF_UPDATE_GET(x) (((x) & MAC_PCU_AZIMUTH_MODE_DISABLE_TSF_UPDATE_MASK) >> MAC_PCU_AZIMUTH_MODE_DISABLE_TSF_UPDATE_LSB) -#define MAC_PCU_AZIMUTH_MODE_DISABLE_TSF_UPDATE_SET(x) (((x) << MAC_PCU_AZIMUTH_MODE_DISABLE_TSF_UPDATE_LSB) & MAC_PCU_AZIMUTH_MODE_DISABLE_TSF_UPDATE_MASK) - -#define MAC_PCU_20_40_MODE_ADDRESS 0x00008124 -#define MAC_PCU_20_40_MODE_OFFSET 0x00000124 -#define MAC_PCU_20_40_MODE_PIFS_CYCLES_MSB 15 -#define MAC_PCU_20_40_MODE_PIFS_CYCLES_LSB 4 -#define MAC_PCU_20_40_MODE_PIFS_CYCLES_MASK 0x0000fff0 -#define MAC_PCU_20_40_MODE_PIFS_CYCLES_GET(x) (((x) & MAC_PCU_20_40_MODE_PIFS_CYCLES_MASK) >> MAC_PCU_20_40_MODE_PIFS_CYCLES_LSB) -#define MAC_PCU_20_40_MODE_PIFS_CYCLES_SET(x) (((x) << MAC_PCU_20_40_MODE_PIFS_CYCLES_LSB) & MAC_PCU_20_40_MODE_PIFS_CYCLES_MASK) -#define MAC_PCU_20_40_MODE_SWAMPED_FORCES_RX_CLEAR_CTL_IDLE_MSB 3 -#define MAC_PCU_20_40_MODE_SWAMPED_FORCES_RX_CLEAR_CTL_IDLE_LSB 3 -#define MAC_PCU_20_40_MODE_SWAMPED_FORCES_RX_CLEAR_CTL_IDLE_MASK 0x00000008 -#define MAC_PCU_20_40_MODE_SWAMPED_FORCES_RX_CLEAR_CTL_IDLE_GET(x) (((x) & MAC_PCU_20_40_MODE_SWAMPED_FORCES_RX_CLEAR_CTL_IDLE_MASK) >> MAC_PCU_20_40_MODE_SWAMPED_FORCES_RX_CLEAR_CTL_IDLE_LSB) -#define MAC_PCU_20_40_MODE_SWAMPED_FORCES_RX_CLEAR_CTL_IDLE_SET(x) (((x) << MAC_PCU_20_40_MODE_SWAMPED_FORCES_RX_CLEAR_CTL_IDLE_LSB) & MAC_PCU_20_40_MODE_SWAMPED_FORCES_RX_CLEAR_CTL_IDLE_MASK) -#define MAC_PCU_20_40_MODE_TX_HT20_ON_EXT_BUSY_MSB 2 -#define MAC_PCU_20_40_MODE_TX_HT20_ON_EXT_BUSY_LSB 2 -#define MAC_PCU_20_40_MODE_TX_HT20_ON_EXT_BUSY_MASK 0x00000004 -#define MAC_PCU_20_40_MODE_TX_HT20_ON_EXT_BUSY_GET(x) (((x) & MAC_PCU_20_40_MODE_TX_HT20_ON_EXT_BUSY_MASK) >> MAC_PCU_20_40_MODE_TX_HT20_ON_EXT_BUSY_LSB) -#define MAC_PCU_20_40_MODE_TX_HT20_ON_EXT_BUSY_SET(x) (((x) << MAC_PCU_20_40_MODE_TX_HT20_ON_EXT_BUSY_LSB) & MAC_PCU_20_40_MODE_TX_HT20_ON_EXT_BUSY_MASK) -#define MAC_PCU_20_40_MODE_EXT_PIFS_ENABLE_MSB 1 -#define MAC_PCU_20_40_MODE_EXT_PIFS_ENABLE_LSB 1 -#define MAC_PCU_20_40_MODE_EXT_PIFS_ENABLE_MASK 0x00000002 -#define MAC_PCU_20_40_MODE_EXT_PIFS_ENABLE_GET(x) (((x) & MAC_PCU_20_40_MODE_EXT_PIFS_ENABLE_MASK) >> MAC_PCU_20_40_MODE_EXT_PIFS_ENABLE_LSB) -#define MAC_PCU_20_40_MODE_EXT_PIFS_ENABLE_SET(x) (((x) << MAC_PCU_20_40_MODE_EXT_PIFS_ENABLE_LSB) & MAC_PCU_20_40_MODE_EXT_PIFS_ENABLE_MASK) -#define MAC_PCU_20_40_MODE_JOINED_RX_CLEAR_MSB 0 -#define MAC_PCU_20_40_MODE_JOINED_RX_CLEAR_LSB 0 -#define MAC_PCU_20_40_MODE_JOINED_RX_CLEAR_MASK 0x00000001 -#define MAC_PCU_20_40_MODE_JOINED_RX_CLEAR_GET(x) (((x) & MAC_PCU_20_40_MODE_JOINED_RX_CLEAR_MASK) >> MAC_PCU_20_40_MODE_JOINED_RX_CLEAR_LSB) -#define MAC_PCU_20_40_MODE_JOINED_RX_CLEAR_SET(x) (((x) << MAC_PCU_20_40_MODE_JOINED_RX_CLEAR_LSB) & MAC_PCU_20_40_MODE_JOINED_RX_CLEAR_MASK) - -#define MAC_PCU_RX_CLEAR_DIFF_CNT_ADDRESS 0x00008128 -#define MAC_PCU_RX_CLEAR_DIFF_CNT_OFFSET 0x00000128 -#define MAC_PCU_RX_CLEAR_DIFF_CNT_VALUE_MSB 31 -#define MAC_PCU_RX_CLEAR_DIFF_CNT_VALUE_LSB 0 -#define MAC_PCU_RX_CLEAR_DIFF_CNT_VALUE_MASK 0xffffffff -#define MAC_PCU_RX_CLEAR_DIFF_CNT_VALUE_GET(x) (((x) & MAC_PCU_RX_CLEAR_DIFF_CNT_VALUE_MASK) >> MAC_PCU_RX_CLEAR_DIFF_CNT_VALUE_LSB) -#define MAC_PCU_RX_CLEAR_DIFF_CNT_VALUE_SET(x) (((x) << MAC_PCU_RX_CLEAR_DIFF_CNT_VALUE_LSB) & MAC_PCU_RX_CLEAR_DIFF_CNT_VALUE_MASK) - -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_ADDRESS 0x0000812c -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_OFFSET 0x0000012c -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_VALUE_MSB 2 -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_VALUE_LSB 0 -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_VALUE_MASK 0x00000007 -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_VALUE_GET(x) (((x) & MAC_PCU_SELF_GEN_ANTENNA_MASK_VALUE_MASK) >> MAC_PCU_SELF_GEN_ANTENNA_MASK_VALUE_LSB) -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_VALUE_SET(x) (((x) << MAC_PCU_SELF_GEN_ANTENNA_MASK_VALUE_LSB) & MAC_PCU_SELF_GEN_ANTENNA_MASK_VALUE_MASK) - -#define MAC_PCU_BA_BAR_CONTROL_ADDRESS 0x00008130 -#define MAC_PCU_BA_BAR_CONTROL_OFFSET 0x00000130 -#define MAC_PCU_BA_BAR_CONTROL_UPDATE_BA_BITMAP_QOS_NULL_MSB 12 -#define MAC_PCU_BA_BAR_CONTROL_UPDATE_BA_BITMAP_QOS_NULL_LSB 12 -#define MAC_PCU_BA_BAR_CONTROL_UPDATE_BA_BITMAP_QOS_NULL_MASK 0x00001000 -#define MAC_PCU_BA_BAR_CONTROL_UPDATE_BA_BITMAP_QOS_NULL_GET(x) (((x) & MAC_PCU_BA_BAR_CONTROL_UPDATE_BA_BITMAP_QOS_NULL_MASK) >> MAC_PCU_BA_BAR_CONTROL_UPDATE_BA_BITMAP_QOS_NULL_LSB) -#define MAC_PCU_BA_BAR_CONTROL_UPDATE_BA_BITMAP_QOS_NULL_SET(x) (((x) << MAC_PCU_BA_BAR_CONTROL_UPDATE_BA_BITMAP_QOS_NULL_LSB) & MAC_PCU_BA_BAR_CONTROL_UPDATE_BA_BITMAP_QOS_NULL_MASK) -#define MAC_PCU_BA_BAR_CONTROL_TX_BA_CLEAR_BA_VALID_MSB 11 -#define MAC_PCU_BA_BAR_CONTROL_TX_BA_CLEAR_BA_VALID_LSB 11 -#define MAC_PCU_BA_BAR_CONTROL_TX_BA_CLEAR_BA_VALID_MASK 0x00000800 -#define MAC_PCU_BA_BAR_CONTROL_TX_BA_CLEAR_BA_VALID_GET(x) (((x) & MAC_PCU_BA_BAR_CONTROL_TX_BA_CLEAR_BA_VALID_MASK) >> MAC_PCU_BA_BAR_CONTROL_TX_BA_CLEAR_BA_VALID_LSB) -#define MAC_PCU_BA_BAR_CONTROL_TX_BA_CLEAR_BA_VALID_SET(x) (((x) << MAC_PCU_BA_BAR_CONTROL_TX_BA_CLEAR_BA_VALID_LSB) & MAC_PCU_BA_BAR_CONTROL_TX_BA_CLEAR_BA_VALID_MASK) -#define MAC_PCU_BA_BAR_CONTROL_FORCE_NO_MATCH_MSB 10 -#define MAC_PCU_BA_BAR_CONTROL_FORCE_NO_MATCH_LSB 10 -#define MAC_PCU_BA_BAR_CONTROL_FORCE_NO_MATCH_MASK 0x00000400 -#define MAC_PCU_BA_BAR_CONTROL_FORCE_NO_MATCH_GET(x) (((x) & MAC_PCU_BA_BAR_CONTROL_FORCE_NO_MATCH_MASK) >> MAC_PCU_BA_BAR_CONTROL_FORCE_NO_MATCH_LSB) -#define MAC_PCU_BA_BAR_CONTROL_FORCE_NO_MATCH_SET(x) (((x) << MAC_PCU_BA_BAR_CONTROL_FORCE_NO_MATCH_LSB) & MAC_PCU_BA_BAR_CONTROL_FORCE_NO_MATCH_MASK) -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_VALUE_MSB 9 -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_VALUE_LSB 9 -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_VALUE_MASK 0x00000200 -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_VALUE_GET(x) (((x) & MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_VALUE_MASK) >> MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_VALUE_LSB) -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_VALUE_SET(x) (((x) << MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_VALUE_LSB) & MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_VALUE_MASK) -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_VALUE_MSB 8 -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_VALUE_LSB 8 -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_VALUE_MASK 0x00000100 -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_VALUE_GET(x) (((x) & MAC_PCU_BA_BAR_CONTROL_COMPRESSED_VALUE_MASK) >> MAC_PCU_BA_BAR_CONTROL_COMPRESSED_VALUE_LSB) -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_VALUE_SET(x) (((x) << MAC_PCU_BA_BAR_CONTROL_COMPRESSED_VALUE_LSB) & MAC_PCU_BA_BAR_CONTROL_COMPRESSED_VALUE_MASK) -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_OFFSET_MSB 7 -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_OFFSET_LSB 4 -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_OFFSET_MASK 0x000000f0 -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_OFFSET_GET(x) (((x) & MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_OFFSET_MASK) >> MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_OFFSET_LSB) -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_OFFSET_SET(x) (((x) << MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_OFFSET_LSB) & MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_OFFSET_MASK) -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_OFFSET_MSB 3 -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_OFFSET_LSB 0 -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_OFFSET_MASK 0x0000000f -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_OFFSET_GET(x) (((x) & MAC_PCU_BA_BAR_CONTROL_COMPRESSED_OFFSET_MASK) >> MAC_PCU_BA_BAR_CONTROL_COMPRESSED_OFFSET_LSB) -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_OFFSET_SET(x) (((x) << MAC_PCU_BA_BAR_CONTROL_COMPRESSED_OFFSET_LSB) & MAC_PCU_BA_BAR_CONTROL_COMPRESSED_OFFSET_MASK) - -#define MAC_PCU_LEGACY_PLCP_SPOOF_ADDRESS 0x00008134 -#define MAC_PCU_LEGACY_PLCP_SPOOF_OFFSET 0x00000134 -#define MAC_PCU_LEGACY_PLCP_SPOOF_MIN_LENGTH_MSB 12 -#define MAC_PCU_LEGACY_PLCP_SPOOF_MIN_LENGTH_LSB 8 -#define MAC_PCU_LEGACY_PLCP_SPOOF_MIN_LENGTH_MASK 0x00001f00 -#define MAC_PCU_LEGACY_PLCP_SPOOF_MIN_LENGTH_GET(x) (((x) & MAC_PCU_LEGACY_PLCP_SPOOF_MIN_LENGTH_MASK) >> MAC_PCU_LEGACY_PLCP_SPOOF_MIN_LENGTH_LSB) -#define MAC_PCU_LEGACY_PLCP_SPOOF_MIN_LENGTH_SET(x) (((x) << MAC_PCU_LEGACY_PLCP_SPOOF_MIN_LENGTH_LSB) & MAC_PCU_LEGACY_PLCP_SPOOF_MIN_LENGTH_MASK) -#define MAC_PCU_LEGACY_PLCP_SPOOF_EIFS_MINUS_DIFS_MSB 7 -#define MAC_PCU_LEGACY_PLCP_SPOOF_EIFS_MINUS_DIFS_LSB 0 -#define MAC_PCU_LEGACY_PLCP_SPOOF_EIFS_MINUS_DIFS_MASK 0x000000ff -#define MAC_PCU_LEGACY_PLCP_SPOOF_EIFS_MINUS_DIFS_GET(x) (((x) & MAC_PCU_LEGACY_PLCP_SPOOF_EIFS_MINUS_DIFS_MASK) >> MAC_PCU_LEGACY_PLCP_SPOOF_EIFS_MINUS_DIFS_LSB) -#define MAC_PCU_LEGACY_PLCP_SPOOF_EIFS_MINUS_DIFS_SET(x) (((x) << MAC_PCU_LEGACY_PLCP_SPOOF_EIFS_MINUS_DIFS_LSB) & MAC_PCU_LEGACY_PLCP_SPOOF_EIFS_MINUS_DIFS_MASK) - -#define MAC_PCU_PHY_ERROR_MASK_CONT_ADDRESS 0x00008138 -#define MAC_PCU_PHY_ERROR_MASK_CONT_OFFSET 0x00000138 -#define MAC_PCU_PHY_ERROR_MASK_CONT_EIFS_VALUE_MSB 23 -#define MAC_PCU_PHY_ERROR_MASK_CONT_EIFS_VALUE_LSB 16 -#define MAC_PCU_PHY_ERROR_MASK_CONT_EIFS_VALUE_MASK 0x00ff0000 -#define MAC_PCU_PHY_ERROR_MASK_CONT_EIFS_VALUE_GET(x) (((x) & MAC_PCU_PHY_ERROR_MASK_CONT_EIFS_VALUE_MASK) >> MAC_PCU_PHY_ERROR_MASK_CONT_EIFS_VALUE_LSB) -#define MAC_PCU_PHY_ERROR_MASK_CONT_EIFS_VALUE_SET(x) (((x) << MAC_PCU_PHY_ERROR_MASK_CONT_EIFS_VALUE_LSB) & MAC_PCU_PHY_ERROR_MASK_CONT_EIFS_VALUE_MASK) -#define MAC_PCU_PHY_ERROR_MASK_CONT_MASK_VALUE_MSB 7 -#define MAC_PCU_PHY_ERROR_MASK_CONT_MASK_VALUE_LSB 0 -#define MAC_PCU_PHY_ERROR_MASK_CONT_MASK_VALUE_MASK 0x000000ff -#define MAC_PCU_PHY_ERROR_MASK_CONT_MASK_VALUE_GET(x) (((x) & MAC_PCU_PHY_ERROR_MASK_CONT_MASK_VALUE_MASK) >> MAC_PCU_PHY_ERROR_MASK_CONT_MASK_VALUE_LSB) -#define MAC_PCU_PHY_ERROR_MASK_CONT_MASK_VALUE_SET(x) (((x) << MAC_PCU_PHY_ERROR_MASK_CONT_MASK_VALUE_LSB) & MAC_PCU_PHY_ERROR_MASK_CONT_MASK_VALUE_MASK) - -#define MAC_PCU_TX_TIMER_ADDRESS 0x0000813c -#define MAC_PCU_TX_TIMER_OFFSET 0x0000013c -#define MAC_PCU_TX_TIMER_QUIET_TIMER_ENABLE_MSB 25 -#define MAC_PCU_TX_TIMER_QUIET_TIMER_ENABLE_LSB 25 -#define MAC_PCU_TX_TIMER_QUIET_TIMER_ENABLE_MASK 0x02000000 -#define MAC_PCU_TX_TIMER_QUIET_TIMER_ENABLE_GET(x) (((x) & MAC_PCU_TX_TIMER_QUIET_TIMER_ENABLE_MASK) >> MAC_PCU_TX_TIMER_QUIET_TIMER_ENABLE_LSB) -#define MAC_PCU_TX_TIMER_QUIET_TIMER_ENABLE_SET(x) (((x) << MAC_PCU_TX_TIMER_QUIET_TIMER_ENABLE_LSB) & MAC_PCU_TX_TIMER_QUIET_TIMER_ENABLE_MASK) -#define MAC_PCU_TX_TIMER_QUIET_TIMER_MSB 24 -#define MAC_PCU_TX_TIMER_QUIET_TIMER_LSB 20 -#define MAC_PCU_TX_TIMER_QUIET_TIMER_MASK 0x01f00000 -#define MAC_PCU_TX_TIMER_QUIET_TIMER_GET(x) (((x) & MAC_PCU_TX_TIMER_QUIET_TIMER_MASK) >> MAC_PCU_TX_TIMER_QUIET_TIMER_LSB) -#define MAC_PCU_TX_TIMER_QUIET_TIMER_SET(x) (((x) << MAC_PCU_TX_TIMER_QUIET_TIMER_LSB) & MAC_PCU_TX_TIMER_QUIET_TIMER_MASK) -#define MAC_PCU_TX_TIMER_RIFS_TIMER_MSB 19 -#define MAC_PCU_TX_TIMER_RIFS_TIMER_LSB 16 -#define MAC_PCU_TX_TIMER_RIFS_TIMER_MASK 0x000f0000 -#define MAC_PCU_TX_TIMER_RIFS_TIMER_GET(x) (((x) & MAC_PCU_TX_TIMER_RIFS_TIMER_MASK) >> MAC_PCU_TX_TIMER_RIFS_TIMER_LSB) -#define MAC_PCU_TX_TIMER_RIFS_TIMER_SET(x) (((x) << MAC_PCU_TX_TIMER_RIFS_TIMER_LSB) & MAC_PCU_TX_TIMER_RIFS_TIMER_MASK) -#define MAC_PCU_TX_TIMER_TX_TIMER_ENABLE_MSB 15 -#define MAC_PCU_TX_TIMER_TX_TIMER_ENABLE_LSB 15 -#define MAC_PCU_TX_TIMER_TX_TIMER_ENABLE_MASK 0x00008000 -#define MAC_PCU_TX_TIMER_TX_TIMER_ENABLE_GET(x) (((x) & MAC_PCU_TX_TIMER_TX_TIMER_ENABLE_MASK) >> MAC_PCU_TX_TIMER_TX_TIMER_ENABLE_LSB) -#define MAC_PCU_TX_TIMER_TX_TIMER_ENABLE_SET(x) (((x) << MAC_PCU_TX_TIMER_TX_TIMER_ENABLE_LSB) & MAC_PCU_TX_TIMER_TX_TIMER_ENABLE_MASK) -#define MAC_PCU_TX_TIMER_TX_TIMER_MSB 14 -#define MAC_PCU_TX_TIMER_TX_TIMER_LSB 0 -#define MAC_PCU_TX_TIMER_TX_TIMER_MASK 0x00007fff -#define MAC_PCU_TX_TIMER_TX_TIMER_GET(x) (((x) & MAC_PCU_TX_TIMER_TX_TIMER_MASK) >> MAC_PCU_TX_TIMER_TX_TIMER_LSB) -#define MAC_PCU_TX_TIMER_TX_TIMER_SET(x) (((x) << MAC_PCU_TX_TIMER_TX_TIMER_LSB) & MAC_PCU_TX_TIMER_TX_TIMER_MASK) - -#define MAC_PCU_TXBUF_CTRL_ADDRESS 0x00008140 -#define MAC_PCU_TXBUF_CTRL_OFFSET 0x00000140 -#define MAC_PCU_TXBUF_CTRL_TX_FIFO_WRAP_ENABLE_MSB 16 -#define MAC_PCU_TXBUF_CTRL_TX_FIFO_WRAP_ENABLE_LSB 16 -#define MAC_PCU_TXBUF_CTRL_TX_FIFO_WRAP_ENABLE_MASK 0x00010000 -#define MAC_PCU_TXBUF_CTRL_TX_FIFO_WRAP_ENABLE_GET(x) (((x) & MAC_PCU_TXBUF_CTRL_TX_FIFO_WRAP_ENABLE_MASK) >> MAC_PCU_TXBUF_CTRL_TX_FIFO_WRAP_ENABLE_LSB) -#define MAC_PCU_TXBUF_CTRL_TX_FIFO_WRAP_ENABLE_SET(x) (((x) << MAC_PCU_TXBUF_CTRL_TX_FIFO_WRAP_ENABLE_LSB) & MAC_PCU_TXBUF_CTRL_TX_FIFO_WRAP_ENABLE_MASK) -#define MAC_PCU_TXBUF_CTRL_USABLE_ENTRIES_MSB 11 -#define MAC_PCU_TXBUF_CTRL_USABLE_ENTRIES_LSB 0 -#define MAC_PCU_TXBUF_CTRL_USABLE_ENTRIES_MASK 0x00000fff -#define MAC_PCU_TXBUF_CTRL_USABLE_ENTRIES_GET(x) (((x) & MAC_PCU_TXBUF_CTRL_USABLE_ENTRIES_MASK) >> MAC_PCU_TXBUF_CTRL_USABLE_ENTRIES_LSB) -#define MAC_PCU_TXBUF_CTRL_USABLE_ENTRIES_SET(x) (((x) << MAC_PCU_TXBUF_CTRL_USABLE_ENTRIES_LSB) & MAC_PCU_TXBUF_CTRL_USABLE_ENTRIES_MASK) - -#define MAC_PCU_MISC_MODE2_ADDRESS 0x00008144 -#define MAC_PCU_MISC_MODE2_OFFSET 0x00000144 -#define MAC_PCU_MISC_MODE2_RESERVED_1_MSB 31 -#define MAC_PCU_MISC_MODE2_RESERVED_1_LSB 28 -#define MAC_PCU_MISC_MODE2_RESERVED_1_MASK 0xf0000000 -#define MAC_PCU_MISC_MODE2_RESERVED_1_GET(x) (((x) & MAC_PCU_MISC_MODE2_RESERVED_1_MASK) >> MAC_PCU_MISC_MODE2_RESERVED_1_LSB) -#define MAC_PCU_MISC_MODE2_RESERVED_1_SET(x) (((x) << MAC_PCU_MISC_MODE2_RESERVED_1_LSB) & MAC_PCU_MISC_MODE2_RESERVED_1_MASK) -#define MAC_PCU_MISC_MODE2_RCV_TIMESTAMP_FIX_MSB 27 -#define MAC_PCU_MISC_MODE2_RCV_TIMESTAMP_FIX_LSB 27 -#define MAC_PCU_MISC_MODE2_RCV_TIMESTAMP_FIX_MASK 0x08000000 -#define MAC_PCU_MISC_MODE2_RCV_TIMESTAMP_FIX_GET(x) (((x) & MAC_PCU_MISC_MODE2_RCV_TIMESTAMP_FIX_MASK) >> MAC_PCU_MISC_MODE2_RCV_TIMESTAMP_FIX_LSB) -#define MAC_PCU_MISC_MODE2_RCV_TIMESTAMP_FIX_SET(x) (((x) << MAC_PCU_MISC_MODE2_RCV_TIMESTAMP_FIX_LSB) & MAC_PCU_MISC_MODE2_RCV_TIMESTAMP_FIX_MASK) -#define MAC_PCU_MISC_MODE2_BEACON_FROM_TO_DS_MSB 26 -#define MAC_PCU_MISC_MODE2_BEACON_FROM_TO_DS_LSB 26 -#define MAC_PCU_MISC_MODE2_BEACON_FROM_TO_DS_MASK 0x04000000 -#define MAC_PCU_MISC_MODE2_BEACON_FROM_TO_DS_GET(x) (((x) & MAC_PCU_MISC_MODE2_BEACON_FROM_TO_DS_MASK) >> MAC_PCU_MISC_MODE2_BEACON_FROM_TO_DS_LSB) -#define MAC_PCU_MISC_MODE2_BEACON_FROM_TO_DS_SET(x) (((x) << MAC_PCU_MISC_MODE2_BEACON_FROM_TO_DS_LSB) & MAC_PCU_MISC_MODE2_BEACON_FROM_TO_DS_MASK) -#define MAC_PCU_MISC_MODE2_PM_FIELD_FOR_MGMT_MSB 25 -#define MAC_PCU_MISC_MODE2_PM_FIELD_FOR_MGMT_LSB 25 -#define MAC_PCU_MISC_MODE2_PM_FIELD_FOR_MGMT_MASK 0x02000000 -#define MAC_PCU_MISC_MODE2_PM_FIELD_FOR_MGMT_GET(x) (((x) & MAC_PCU_MISC_MODE2_PM_FIELD_FOR_MGMT_MASK) >> MAC_PCU_MISC_MODE2_PM_FIELD_FOR_MGMT_LSB) -#define MAC_PCU_MISC_MODE2_PM_FIELD_FOR_MGMT_SET(x) (((x) << MAC_PCU_MISC_MODE2_PM_FIELD_FOR_MGMT_LSB) & MAC_PCU_MISC_MODE2_PM_FIELD_FOR_MGMT_MASK) -#define MAC_PCU_MISC_MODE2_PM_FIELD_FOR_DAT_MSB 24 -#define MAC_PCU_MISC_MODE2_PM_FIELD_FOR_DAT_LSB 24 -#define MAC_PCU_MISC_MODE2_PM_FIELD_FOR_DAT_MASK 0x01000000 -#define MAC_PCU_MISC_MODE2_PM_FIELD_FOR_DAT_GET(x) (((x) & MAC_PCU_MISC_MODE2_PM_FIELD_FOR_DAT_MASK) >> MAC_PCU_MISC_MODE2_PM_FIELD_FOR_DAT_LSB) -#define MAC_PCU_MISC_MODE2_PM_FIELD_FOR_DAT_SET(x) (((x) << MAC_PCU_MISC_MODE2_PM_FIELD_FOR_DAT_LSB) & MAC_PCU_MISC_MODE2_PM_FIELD_FOR_DAT_MASK) -#define MAC_PCU_MISC_MODE2_IGNORE_TXOP_IF_ZERO_MSB 23 -#define MAC_PCU_MISC_MODE2_IGNORE_TXOP_IF_ZERO_LSB 23 -#define MAC_PCU_MISC_MODE2_IGNORE_TXOP_IF_ZERO_MASK 0x00800000 -#define MAC_PCU_MISC_MODE2_IGNORE_TXOP_IF_ZERO_GET(x) (((x) & MAC_PCU_MISC_MODE2_IGNORE_TXOP_IF_ZERO_MASK) >> MAC_PCU_MISC_MODE2_IGNORE_TXOP_IF_ZERO_LSB) -#define MAC_PCU_MISC_MODE2_IGNORE_TXOP_IF_ZERO_SET(x) (((x) << MAC_PCU_MISC_MODE2_IGNORE_TXOP_IF_ZERO_LSB) & MAC_PCU_MISC_MODE2_IGNORE_TXOP_IF_ZERO_MASK) -#define MAC_PCU_MISC_MODE2_IGNORE_TXOP_1ST_PKT_MSB 22 -#define MAC_PCU_MISC_MODE2_IGNORE_TXOP_1ST_PKT_LSB 22 -#define MAC_PCU_MISC_MODE2_IGNORE_TXOP_1ST_PKT_MASK 0x00400000 -#define MAC_PCU_MISC_MODE2_IGNORE_TXOP_1ST_PKT_GET(x) (((x) & MAC_PCU_MISC_MODE2_IGNORE_TXOP_1ST_PKT_MASK) >> MAC_PCU_MISC_MODE2_IGNORE_TXOP_1ST_PKT_LSB) -#define MAC_PCU_MISC_MODE2_IGNORE_TXOP_1ST_PKT_SET(x) (((x) << MAC_PCU_MISC_MODE2_IGNORE_TXOP_1ST_PKT_LSB) & MAC_PCU_MISC_MODE2_IGNORE_TXOP_1ST_PKT_MASK) -#define MAC_PCU_MISC_MODE2_CLEAR_MORE_FRAG_MSB 21 -#define MAC_PCU_MISC_MODE2_CLEAR_MORE_FRAG_LSB 21 -#define MAC_PCU_MISC_MODE2_CLEAR_MORE_FRAG_MASK 0x00200000 -#define MAC_PCU_MISC_MODE2_CLEAR_MORE_FRAG_GET(x) (((x) & MAC_PCU_MISC_MODE2_CLEAR_MORE_FRAG_MASK) >> MAC_PCU_MISC_MODE2_CLEAR_MORE_FRAG_LSB) -#define MAC_PCU_MISC_MODE2_CLEAR_MORE_FRAG_SET(x) (((x) << MAC_PCU_MISC_MODE2_CLEAR_MORE_FRAG_LSB) & MAC_PCU_MISC_MODE2_CLEAR_MORE_FRAG_MASK) -#define MAC_PCU_MISC_MODE2_BUG_28676_MSB 20 -#define MAC_PCU_MISC_MODE2_BUG_28676_LSB 20 -#define MAC_PCU_MISC_MODE2_BUG_28676_MASK 0x00100000 -#define MAC_PCU_MISC_MODE2_BUG_28676_GET(x) (((x) & MAC_PCU_MISC_MODE2_BUG_28676_MASK) >> MAC_PCU_MISC_MODE2_BUG_28676_LSB) -#define MAC_PCU_MISC_MODE2_BUG_28676_SET(x) (((x) << MAC_PCU_MISC_MODE2_BUG_28676_LSB) & MAC_PCU_MISC_MODE2_BUG_28676_MASK) -#define MAC_PCU_MISC_MODE2_DUR_ACCOUNT_BY_BA_MSB 19 -#define MAC_PCU_MISC_MODE2_DUR_ACCOUNT_BY_BA_LSB 19 -#define MAC_PCU_MISC_MODE2_DUR_ACCOUNT_BY_BA_MASK 0x00080000 -#define MAC_PCU_MISC_MODE2_DUR_ACCOUNT_BY_BA_GET(x) (((x) & MAC_PCU_MISC_MODE2_DUR_ACCOUNT_BY_BA_MASK) >> MAC_PCU_MISC_MODE2_DUR_ACCOUNT_BY_BA_LSB) -#define MAC_PCU_MISC_MODE2_DUR_ACCOUNT_BY_BA_SET(x) (((x) << MAC_PCU_MISC_MODE2_DUR_ACCOUNT_BY_BA_LSB) & MAC_PCU_MISC_MODE2_DUR_ACCOUNT_BY_BA_MASK) -#define MAC_PCU_MISC_MODE2_BC_MC_WAPI_MODE_MSB 18 -#define MAC_PCU_MISC_MODE2_BC_MC_WAPI_MODE_LSB 18 -#define MAC_PCU_MISC_MODE2_BC_MC_WAPI_MODE_MASK 0x00040000 -#define MAC_PCU_MISC_MODE2_BC_MC_WAPI_MODE_GET(x) (((x) & MAC_PCU_MISC_MODE2_BC_MC_WAPI_MODE_MASK) >> MAC_PCU_MISC_MODE2_BC_MC_WAPI_MODE_LSB) -#define MAC_PCU_MISC_MODE2_BC_MC_WAPI_MODE_SET(x) (((x) << MAC_PCU_MISC_MODE2_BC_MC_WAPI_MODE_LSB) & MAC_PCU_MISC_MODE2_BC_MC_WAPI_MODE_MASK) -#define MAC_PCU_MISC_MODE2_AGG_WEP_MSB 17 -#define MAC_PCU_MISC_MODE2_AGG_WEP_LSB 17 -#define MAC_PCU_MISC_MODE2_AGG_WEP_MASK 0x00020000 -#define MAC_PCU_MISC_MODE2_AGG_WEP_GET(x) (((x) & MAC_PCU_MISC_MODE2_AGG_WEP_MASK) >> MAC_PCU_MISC_MODE2_AGG_WEP_LSB) -#define MAC_PCU_MISC_MODE2_AGG_WEP_SET(x) (((x) << MAC_PCU_MISC_MODE2_AGG_WEP_LSB) & MAC_PCU_MISC_MODE2_AGG_WEP_MASK) -#define MAC_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION_MSB 16 -#define MAC_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION_LSB 16 -#define MAC_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION_MASK 0x00010000 -#define MAC_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION_GET(x) (((x) & MAC_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION_MASK) >> MAC_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION_LSB) -#define MAC_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION_SET(x) (((x) << MAC_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION_LSB) & MAC_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION_MASK) -#define MAC_PCU_MISC_MODE2_MGMT_QOS_MSB 15 -#define MAC_PCU_MISC_MODE2_MGMT_QOS_LSB 8 -#define MAC_PCU_MISC_MODE2_MGMT_QOS_MASK 0x0000ff00 -#define MAC_PCU_MISC_MODE2_MGMT_QOS_GET(x) (((x) & MAC_PCU_MISC_MODE2_MGMT_QOS_MASK) >> MAC_PCU_MISC_MODE2_MGMT_QOS_LSB) -#define MAC_PCU_MISC_MODE2_MGMT_QOS_SET(x) (((x) << MAC_PCU_MISC_MODE2_MGMT_QOS_LSB) & MAC_PCU_MISC_MODE2_MGMT_QOS_MASK) -#define MAC_PCU_MISC_MODE2_CFP_IGNORE_MSB 7 -#define MAC_PCU_MISC_MODE2_CFP_IGNORE_LSB 7 -#define MAC_PCU_MISC_MODE2_CFP_IGNORE_MASK 0x00000080 -#define MAC_PCU_MISC_MODE2_CFP_IGNORE_GET(x) (((x) & MAC_PCU_MISC_MODE2_CFP_IGNORE_MASK) >> MAC_PCU_MISC_MODE2_CFP_IGNORE_LSB) -#define MAC_PCU_MISC_MODE2_CFP_IGNORE_SET(x) (((x) << MAC_PCU_MISC_MODE2_CFP_IGNORE_LSB) & MAC_PCU_MISC_MODE2_CFP_IGNORE_MASK) -#define MAC_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE_MSB 6 -#define MAC_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE_LSB 6 -#define MAC_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE_MASK 0x00000040 -#define MAC_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE_GET(x) (((x) & MAC_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE_MASK) >> MAC_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE_LSB) -#define MAC_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE_SET(x) (((x) << MAC_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE_LSB) & MAC_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE_MASK) -#define MAC_PCU_MISC_MODE2_RESERVED_2_MSB 5 -#define MAC_PCU_MISC_MODE2_RESERVED_2_LSB 5 -#define MAC_PCU_MISC_MODE2_RESERVED_2_MASK 0x00000020 -#define MAC_PCU_MISC_MODE2_RESERVED_2_GET(x) (((x) & MAC_PCU_MISC_MODE2_RESERVED_2_MASK) >> MAC_PCU_MISC_MODE2_RESERVED_2_LSB) -#define MAC_PCU_MISC_MODE2_RESERVED_2_SET(x) (((x) << MAC_PCU_MISC_MODE2_RESERVED_2_LSB) & MAC_PCU_MISC_MODE2_RESERVED_2_MASK) -#define MAC_PCU_MISC_MODE2_BUG_58057_FIX_ENABLE_MSB 4 -#define MAC_PCU_MISC_MODE2_BUG_58057_FIX_ENABLE_LSB 4 -#define MAC_PCU_MISC_MODE2_BUG_58057_FIX_ENABLE_MASK 0x00000010 -#define MAC_PCU_MISC_MODE2_BUG_58057_FIX_ENABLE_GET(x) (((x) & MAC_PCU_MISC_MODE2_BUG_58057_FIX_ENABLE_MASK) >> MAC_PCU_MISC_MODE2_BUG_58057_FIX_ENABLE_LSB) -#define MAC_PCU_MISC_MODE2_BUG_58057_FIX_ENABLE_SET(x) (((x) << MAC_PCU_MISC_MODE2_BUG_58057_FIX_ENABLE_LSB) & MAC_PCU_MISC_MODE2_BUG_58057_FIX_ENABLE_MASK) -#define MAC_PCU_MISC_MODE2_RESERVED_0_MSB 3 -#define MAC_PCU_MISC_MODE2_RESERVED_0_LSB 3 -#define MAC_PCU_MISC_MODE2_RESERVED_0_MASK 0x00000008 -#define MAC_PCU_MISC_MODE2_RESERVED_0_GET(x) (((x) & MAC_PCU_MISC_MODE2_RESERVED_0_MASK) >> MAC_PCU_MISC_MODE2_RESERVED_0_LSB) -#define MAC_PCU_MISC_MODE2_RESERVED_0_SET(x) (((x) << MAC_PCU_MISC_MODE2_RESERVED_0_LSB) & MAC_PCU_MISC_MODE2_RESERVED_0_MASK) -#define MAC_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT_MSB 2 -#define MAC_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT_LSB 2 -#define MAC_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT_MASK 0x00000004 -#define MAC_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT_GET(x) (((x) & MAC_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT_MASK) >> MAC_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT_LSB) -#define MAC_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT_SET(x) (((x) << MAC_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT_LSB) & MAC_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT_MASK) -#define MAC_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE_MSB 1 -#define MAC_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE_LSB 1 -#define MAC_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE_MASK 0x00000002 -#define MAC_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE_GET(x) (((x) & MAC_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE_MASK) >> MAC_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE_LSB) -#define MAC_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE_SET(x) (((x) << MAC_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE_LSB) & MAC_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE_MASK) -#define MAC_PCU_MISC_MODE2_BUG_21532_FIX_ENABLE_MSB 0 -#define MAC_PCU_MISC_MODE2_BUG_21532_FIX_ENABLE_LSB 0 -#define MAC_PCU_MISC_MODE2_BUG_21532_FIX_ENABLE_MASK 0x00000001 -#define MAC_PCU_MISC_MODE2_BUG_21532_FIX_ENABLE_GET(x) (((x) & MAC_PCU_MISC_MODE2_BUG_21532_FIX_ENABLE_MASK) >> MAC_PCU_MISC_MODE2_BUG_21532_FIX_ENABLE_LSB) -#define MAC_PCU_MISC_MODE2_BUG_21532_FIX_ENABLE_SET(x) (((x) << MAC_PCU_MISC_MODE2_BUG_21532_FIX_ENABLE_LSB) & MAC_PCU_MISC_MODE2_BUG_21532_FIX_ENABLE_MASK) - -#define MAC_PCU_ALT_AES_MUTE_MASK_ADDRESS 0x00008148 -#define MAC_PCU_ALT_AES_MUTE_MASK_OFFSET 0x00000148 -#define MAC_PCU_ALT_AES_MUTE_MASK_QOS_MSB 31 -#define MAC_PCU_ALT_AES_MUTE_MASK_QOS_LSB 16 -#define MAC_PCU_ALT_AES_MUTE_MASK_QOS_MASK 0xffff0000 -#define MAC_PCU_ALT_AES_MUTE_MASK_QOS_GET(x) (((x) & MAC_PCU_ALT_AES_MUTE_MASK_QOS_MASK) >> MAC_PCU_ALT_AES_MUTE_MASK_QOS_LSB) -#define MAC_PCU_ALT_AES_MUTE_MASK_QOS_SET(x) (((x) << MAC_PCU_ALT_AES_MUTE_MASK_QOS_LSB) & MAC_PCU_ALT_AES_MUTE_MASK_QOS_MASK) - -#define MAC_PCU_AZIMUTH_TIME_STAMP_ADDRESS 0x0000814c -#define MAC_PCU_AZIMUTH_TIME_STAMP_OFFSET 0x0000014c -#define MAC_PCU_AZIMUTH_TIME_STAMP_VALUE_MSB 31 -#define MAC_PCU_AZIMUTH_TIME_STAMP_VALUE_LSB 0 -#define MAC_PCU_AZIMUTH_TIME_STAMP_VALUE_MASK 0xffffffff -#define MAC_PCU_AZIMUTH_TIME_STAMP_VALUE_GET(x) (((x) & MAC_PCU_AZIMUTH_TIME_STAMP_VALUE_MASK) >> MAC_PCU_AZIMUTH_TIME_STAMP_VALUE_LSB) -#define MAC_PCU_AZIMUTH_TIME_STAMP_VALUE_SET(x) (((x) << MAC_PCU_AZIMUTH_TIME_STAMP_VALUE_LSB) & MAC_PCU_AZIMUTH_TIME_STAMP_VALUE_MASK) - -#define MAC_PCU_MAX_CFP_DUR_ADDRESS 0x00008150 -#define MAC_PCU_MAX_CFP_DUR_OFFSET 0x00000150 -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_DENOMINATOR_MSB 7 -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_DENOMINATOR_LSB 4 -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_DENOMINATOR_MASK 0x000000f0 -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_DENOMINATOR_GET(x) (((x) & MAC_PCU_MAX_CFP_DUR_USEC_FRAC_DENOMINATOR_MASK) >> MAC_PCU_MAX_CFP_DUR_USEC_FRAC_DENOMINATOR_LSB) -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_DENOMINATOR_SET(x) (((x) << MAC_PCU_MAX_CFP_DUR_USEC_FRAC_DENOMINATOR_LSB) & MAC_PCU_MAX_CFP_DUR_USEC_FRAC_DENOMINATOR_MASK) -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_NUMERATOR_MSB 3 -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_NUMERATOR_LSB 0 -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_NUMERATOR_MASK 0x0000000f -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_NUMERATOR_GET(x) (((x) & MAC_PCU_MAX_CFP_DUR_USEC_FRAC_NUMERATOR_MASK) >> MAC_PCU_MAX_CFP_DUR_USEC_FRAC_NUMERATOR_LSB) -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_NUMERATOR_SET(x) (((x) << MAC_PCU_MAX_CFP_DUR_USEC_FRAC_NUMERATOR_LSB) & MAC_PCU_MAX_CFP_DUR_USEC_FRAC_NUMERATOR_MASK) - -#define MAC_PCU_HCF_TIMEOUT_ADDRESS 0x00008154 -#define MAC_PCU_HCF_TIMEOUT_OFFSET 0x00000154 -#define MAC_PCU_HCF_TIMEOUT_VALUE_MSB 15 -#define MAC_PCU_HCF_TIMEOUT_VALUE_LSB 0 -#define MAC_PCU_HCF_TIMEOUT_VALUE_MASK 0x0000ffff -#define MAC_PCU_HCF_TIMEOUT_VALUE_GET(x) (((x) & MAC_PCU_HCF_TIMEOUT_VALUE_MASK) >> MAC_PCU_HCF_TIMEOUT_VALUE_LSB) -#define MAC_PCU_HCF_TIMEOUT_VALUE_SET(x) (((x) << MAC_PCU_HCF_TIMEOUT_VALUE_LSB) & MAC_PCU_HCF_TIMEOUT_VALUE_MASK) - -#define MAC_PCU_BLUETOOTH_WEIGHTS2_ADDRESS 0x00008158 -#define MAC_PCU_BLUETOOTH_WEIGHTS2_OFFSET 0x00000158 -#define MAC_PCU_BLUETOOTH_WEIGHTS2_WL_WEIGHT_CONTD_MSB 31 -#define MAC_PCU_BLUETOOTH_WEIGHTS2_WL_WEIGHT_CONTD_LSB 16 -#define MAC_PCU_BLUETOOTH_WEIGHTS2_WL_WEIGHT_CONTD_MASK 0xffff0000 -#define MAC_PCU_BLUETOOTH_WEIGHTS2_WL_WEIGHT_CONTD_GET(x) (((x) & MAC_PCU_BLUETOOTH_WEIGHTS2_WL_WEIGHT_CONTD_MASK) >> MAC_PCU_BLUETOOTH_WEIGHTS2_WL_WEIGHT_CONTD_LSB) -#define MAC_PCU_BLUETOOTH_WEIGHTS2_WL_WEIGHT_CONTD_SET(x) (((x) << MAC_PCU_BLUETOOTH_WEIGHTS2_WL_WEIGHT_CONTD_LSB) & MAC_PCU_BLUETOOTH_WEIGHTS2_WL_WEIGHT_CONTD_MASK) - -#define MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_ADDRESS 0x0000815c -#define MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_OFFSET 0x0000015c -#define MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_VALUE_MSB 31 -#define MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_VALUE_LSB 0 -#define MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_VALUE_MASK 0xffffffff -#define MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_VALUE_GET(x) (((x) & MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_VALUE_MASK) >> MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_VALUE_LSB) -#define MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_VALUE_SET(x) (((x) << MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_VALUE_LSB) & MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_VALUE_MASK) - -#define MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_ADDRESS 0x00008160 -#define MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_OFFSET 0x00000160 -#define MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_VALUE_MSB 31 -#define MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_VALUE_LSB 0 -#define MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_VALUE_MASK 0xffffffff -#define MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_VALUE_GET(x) (((x) & MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_VALUE_MASK) >> MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_VALUE_LSB) -#define MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_VALUE_SET(x) (((x) << MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_VALUE_LSB) & MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_VALUE_MASK) - -#define MAC_PCU_BLUETOOTH_MODE3_ADDRESS 0x00008164 -#define MAC_PCU_BLUETOOTH_MODE3_OFFSET 0x00000164 -#define MAC_PCU_BLUETOOTH_MODE3_BT_PRIORITY_EXTEND_THRES_MSB 31 -#define MAC_PCU_BLUETOOTH_MODE3_BT_PRIORITY_EXTEND_THRES_LSB 28 -#define MAC_PCU_BLUETOOTH_MODE3_BT_PRIORITY_EXTEND_THRES_MASK 0xf0000000 -#define MAC_PCU_BLUETOOTH_MODE3_BT_PRIORITY_EXTEND_THRES_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE3_BT_PRIORITY_EXTEND_THRES_MASK) >> MAC_PCU_BLUETOOTH_MODE3_BT_PRIORITY_EXTEND_THRES_LSB) -#define MAC_PCU_BLUETOOTH_MODE3_BT_PRIORITY_EXTEND_THRES_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE3_BT_PRIORITY_EXTEND_THRES_LSB) & MAC_PCU_BLUETOOTH_MODE3_BT_PRIORITY_EXTEND_THRES_MASK) -#define MAC_PCU_BLUETOOTH_MODE3_BT_TX_ON_EN_MSB 27 -#define MAC_PCU_BLUETOOTH_MODE3_BT_TX_ON_EN_LSB 27 -#define MAC_PCU_BLUETOOTH_MODE3_BT_TX_ON_EN_MASK 0x08000000 -#define MAC_PCU_BLUETOOTH_MODE3_BT_TX_ON_EN_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE3_BT_TX_ON_EN_MASK) >> MAC_PCU_BLUETOOTH_MODE3_BT_TX_ON_EN_LSB) -#define MAC_PCU_BLUETOOTH_MODE3_BT_TX_ON_EN_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE3_BT_TX_ON_EN_LSB) & MAC_PCU_BLUETOOTH_MODE3_BT_TX_ON_EN_MASK) -#define MAC_PCU_BLUETOOTH_MODE3_SLOT_SLOP_MSB 26 -#define MAC_PCU_BLUETOOTH_MODE3_SLOT_SLOP_LSB 25 -#define MAC_PCU_BLUETOOTH_MODE3_SLOT_SLOP_MASK 0x06000000 -#define MAC_PCU_BLUETOOTH_MODE3_SLOT_SLOP_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE3_SLOT_SLOP_MASK) >> MAC_PCU_BLUETOOTH_MODE3_SLOT_SLOP_LSB) -#define MAC_PCU_BLUETOOTH_MODE3_SLOT_SLOP_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE3_SLOT_SLOP_LSB) & MAC_PCU_BLUETOOTH_MODE3_SLOT_SLOP_MASK) -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_TOGGLE_WLA_EN_MSB 24 -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_TOGGLE_WLA_EN_LSB 24 -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_TOGGLE_WLA_EN_MASK 0x01000000 -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_TOGGLE_WLA_EN_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_TOGGLE_WLA_EN_MASK) >> MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_TOGGLE_WLA_EN_LSB) -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_TOGGLE_WLA_EN_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_TOGGLE_WLA_EN_LSB) & MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_TOGGLE_WLA_EN_MASK) -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_PRI_EN_MSB 23 -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_PRI_EN_LSB 23 -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_PRI_EN_MASK 0x00800000 -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_PRI_EN_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_PRI_EN_MASK) >> MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_PRI_EN_LSB) -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_PRI_EN_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_PRI_EN_LSB) & MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_PRI_EN_MASK) -#define MAC_PCU_BLUETOOTH_MODE3_RFGAIN_LOCK_SRC_MSB 22 -#define MAC_PCU_BLUETOOTH_MODE3_RFGAIN_LOCK_SRC_LSB 22 -#define MAC_PCU_BLUETOOTH_MODE3_RFGAIN_LOCK_SRC_MASK 0x00400000 -#define MAC_PCU_BLUETOOTH_MODE3_RFGAIN_LOCK_SRC_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE3_RFGAIN_LOCK_SRC_MASK) >> MAC_PCU_BLUETOOTH_MODE3_RFGAIN_LOCK_SRC_LSB) -#define MAC_PCU_BLUETOOTH_MODE3_RFGAIN_LOCK_SRC_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE3_RFGAIN_LOCK_SRC_LSB) & MAC_PCU_BLUETOOTH_MODE3_RFGAIN_LOCK_SRC_MASK) -#define MAC_PCU_BLUETOOTH_MODE3_WL_PRIORITY_OFFSET_EN_MSB 21 -#define MAC_PCU_BLUETOOTH_MODE3_WL_PRIORITY_OFFSET_EN_LSB 21 -#define MAC_PCU_BLUETOOTH_MODE3_WL_PRIORITY_OFFSET_EN_MASK 0x00200000 -#define MAC_PCU_BLUETOOTH_MODE3_WL_PRIORITY_OFFSET_EN_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE3_WL_PRIORITY_OFFSET_EN_MASK) >> MAC_PCU_BLUETOOTH_MODE3_WL_PRIORITY_OFFSET_EN_LSB) -#define MAC_PCU_BLUETOOTH_MODE3_WL_PRIORITY_OFFSET_EN_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE3_WL_PRIORITY_OFFSET_EN_LSB) & MAC_PCU_BLUETOOTH_MODE3_WL_PRIORITY_OFFSET_EN_MASK) -#define MAC_PCU_BLUETOOTH_MODE3_SHARED_RX_MSB 20 -#define MAC_PCU_BLUETOOTH_MODE3_SHARED_RX_LSB 20 -#define MAC_PCU_BLUETOOTH_MODE3_SHARED_RX_MASK 0x00100000 -#define MAC_PCU_BLUETOOTH_MODE3_SHARED_RX_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE3_SHARED_RX_MASK) >> MAC_PCU_BLUETOOTH_MODE3_SHARED_RX_LSB) -#define MAC_PCU_BLUETOOTH_MODE3_SHARED_RX_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE3_SHARED_RX_LSB) & MAC_PCU_BLUETOOTH_MODE3_SHARED_RX_MASK) -#define MAC_PCU_BLUETOOTH_MODE3_ALLOW_CONCURRENT_ACCESS_MSB 19 -#define MAC_PCU_BLUETOOTH_MODE3_ALLOW_CONCURRENT_ACCESS_LSB 16 -#define MAC_PCU_BLUETOOTH_MODE3_ALLOW_CONCURRENT_ACCESS_MASK 0x000f0000 -#define MAC_PCU_BLUETOOTH_MODE3_ALLOW_CONCURRENT_ACCESS_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE3_ALLOW_CONCURRENT_ACCESS_MASK) >> MAC_PCU_BLUETOOTH_MODE3_ALLOW_CONCURRENT_ACCESS_LSB) -#define MAC_PCU_BLUETOOTH_MODE3_ALLOW_CONCURRENT_ACCESS_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE3_ALLOW_CONCURRENT_ACCESS_LSB) & MAC_PCU_BLUETOOTH_MODE3_ALLOW_CONCURRENT_ACCESS_MASK) -#define MAC_PCU_BLUETOOTH_MODE3_WL_QC_TIME_MSB 15 -#define MAC_PCU_BLUETOOTH_MODE3_WL_QC_TIME_LSB 8 -#define MAC_PCU_BLUETOOTH_MODE3_WL_QC_TIME_MASK 0x0000ff00 -#define MAC_PCU_BLUETOOTH_MODE3_WL_QC_TIME_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE3_WL_QC_TIME_MASK) >> MAC_PCU_BLUETOOTH_MODE3_WL_QC_TIME_LSB) -#define MAC_PCU_BLUETOOTH_MODE3_WL_QC_TIME_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE3_WL_QC_TIME_LSB) & MAC_PCU_BLUETOOTH_MODE3_WL_QC_TIME_MASK) -#define MAC_PCU_BLUETOOTH_MODE3_WL_ACTIVE_TIME_MSB 7 -#define MAC_PCU_BLUETOOTH_MODE3_WL_ACTIVE_TIME_LSB 0 -#define MAC_PCU_BLUETOOTH_MODE3_WL_ACTIVE_TIME_MASK 0x000000ff -#define MAC_PCU_BLUETOOTH_MODE3_WL_ACTIVE_TIME_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE3_WL_ACTIVE_TIME_MASK) >> MAC_PCU_BLUETOOTH_MODE3_WL_ACTIVE_TIME_LSB) -#define MAC_PCU_BLUETOOTH_MODE3_WL_ACTIVE_TIME_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE3_WL_ACTIVE_TIME_LSB) & MAC_PCU_BLUETOOTH_MODE3_WL_ACTIVE_TIME_MASK) - -#define MAC_PCU_BLUETOOTH_MODE4_ADDRESS 0x00008168 -#define MAC_PCU_BLUETOOTH_MODE4_OFFSET 0x00000168 -#define MAC_PCU_BLUETOOTH_MODE4_BT_PRIORITY_EXTEND_MSB 31 -#define MAC_PCU_BLUETOOTH_MODE4_BT_PRIORITY_EXTEND_LSB 16 -#define MAC_PCU_BLUETOOTH_MODE4_BT_PRIORITY_EXTEND_MASK 0xffff0000 -#define MAC_PCU_BLUETOOTH_MODE4_BT_PRIORITY_EXTEND_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE4_BT_PRIORITY_EXTEND_MASK) >> MAC_PCU_BLUETOOTH_MODE4_BT_PRIORITY_EXTEND_LSB) -#define MAC_PCU_BLUETOOTH_MODE4_BT_PRIORITY_EXTEND_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE4_BT_PRIORITY_EXTEND_LSB) & MAC_PCU_BLUETOOTH_MODE4_BT_PRIORITY_EXTEND_MASK) -#define MAC_PCU_BLUETOOTH_MODE4_BT_ACTIVE_EXTEND_MSB 15 -#define MAC_PCU_BLUETOOTH_MODE4_BT_ACTIVE_EXTEND_LSB 0 -#define MAC_PCU_BLUETOOTH_MODE4_BT_ACTIVE_EXTEND_MASK 0x0000ffff -#define MAC_PCU_BLUETOOTH_MODE4_BT_ACTIVE_EXTEND_GET(x) (((x) & MAC_PCU_BLUETOOTH_MODE4_BT_ACTIVE_EXTEND_MASK) >> MAC_PCU_BLUETOOTH_MODE4_BT_ACTIVE_EXTEND_LSB) -#define MAC_PCU_BLUETOOTH_MODE4_BT_ACTIVE_EXTEND_SET(x) (((x) << MAC_PCU_BLUETOOTH_MODE4_BT_ACTIVE_EXTEND_LSB) & MAC_PCU_BLUETOOTH_MODE4_BT_ACTIVE_EXTEND_MASK) - -#define MAC_PCU_BT_BT_ADDRESS 0x00008200 -#define MAC_PCU_BT_BT_OFFSET 0x00000200 -#define MAC_PCU_BT_BT_WEIGHT_MSB 31 -#define MAC_PCU_BT_BT_WEIGHT_LSB 0 -#define MAC_PCU_BT_BT_WEIGHT_MASK 0xffffffff -#define MAC_PCU_BT_BT_WEIGHT_GET(x) (((x) & MAC_PCU_BT_BT_WEIGHT_MASK) >> MAC_PCU_BT_BT_WEIGHT_LSB) -#define MAC_PCU_BT_BT_WEIGHT_SET(x) (((x) << MAC_PCU_BT_BT_WEIGHT_LSB) & MAC_PCU_BT_BT_WEIGHT_MASK) - -#define MAC_PCU_BT_BT_ASYNC_ADDRESS 0x00008300 -#define MAC_PCU_BT_BT_ASYNC_OFFSET 0x00000300 -#define MAC_PCU_BT_BT_ASYNC_RXLP_WEIGHT_MSB 15 -#define MAC_PCU_BT_BT_ASYNC_RXLP_WEIGHT_LSB 12 -#define MAC_PCU_BT_BT_ASYNC_RXLP_WEIGHT_MASK 0x0000f000 -#define MAC_PCU_BT_BT_ASYNC_RXLP_WEIGHT_GET(x) (((x) & MAC_PCU_BT_BT_ASYNC_RXLP_WEIGHT_MASK) >> MAC_PCU_BT_BT_ASYNC_RXLP_WEIGHT_LSB) -#define MAC_PCU_BT_BT_ASYNC_RXLP_WEIGHT_SET(x) (((x) << MAC_PCU_BT_BT_ASYNC_RXLP_WEIGHT_LSB) & MAC_PCU_BT_BT_ASYNC_RXLP_WEIGHT_MASK) -#define MAC_PCU_BT_BT_ASYNC_RXHP_WEIGHT_MSB 11 -#define MAC_PCU_BT_BT_ASYNC_RXHP_WEIGHT_LSB 8 -#define MAC_PCU_BT_BT_ASYNC_RXHP_WEIGHT_MASK 0x00000f00 -#define MAC_PCU_BT_BT_ASYNC_RXHP_WEIGHT_GET(x) (((x) & MAC_PCU_BT_BT_ASYNC_RXHP_WEIGHT_MASK) >> MAC_PCU_BT_BT_ASYNC_RXHP_WEIGHT_LSB) -#define MAC_PCU_BT_BT_ASYNC_RXHP_WEIGHT_SET(x) (((x) << MAC_PCU_BT_BT_ASYNC_RXHP_WEIGHT_LSB) & MAC_PCU_BT_BT_ASYNC_RXHP_WEIGHT_MASK) -#define MAC_PCU_BT_BT_ASYNC_TXLP_WEIGHT_MSB 7 -#define MAC_PCU_BT_BT_ASYNC_TXLP_WEIGHT_LSB 4 -#define MAC_PCU_BT_BT_ASYNC_TXLP_WEIGHT_MASK 0x000000f0 -#define MAC_PCU_BT_BT_ASYNC_TXLP_WEIGHT_GET(x) (((x) & MAC_PCU_BT_BT_ASYNC_TXLP_WEIGHT_MASK) >> MAC_PCU_BT_BT_ASYNC_TXLP_WEIGHT_LSB) -#define MAC_PCU_BT_BT_ASYNC_TXLP_WEIGHT_SET(x) (((x) << MAC_PCU_BT_BT_ASYNC_TXLP_WEIGHT_LSB) & MAC_PCU_BT_BT_ASYNC_TXLP_WEIGHT_MASK) -#define MAC_PCU_BT_BT_ASYNC_TXHP_WEIGHT_MSB 3 -#define MAC_PCU_BT_BT_ASYNC_TXHP_WEIGHT_LSB 0 -#define MAC_PCU_BT_BT_ASYNC_TXHP_WEIGHT_MASK 0x0000000f -#define MAC_PCU_BT_BT_ASYNC_TXHP_WEIGHT_GET(x) (((x) & MAC_PCU_BT_BT_ASYNC_TXHP_WEIGHT_MASK) >> MAC_PCU_BT_BT_ASYNC_TXHP_WEIGHT_LSB) -#define MAC_PCU_BT_BT_ASYNC_TXHP_WEIGHT_SET(x) (((x) << MAC_PCU_BT_BT_ASYNC_TXHP_WEIGHT_LSB) & MAC_PCU_BT_BT_ASYNC_TXHP_WEIGHT_MASK) - -#define MAC_PCU_BT_WL_1_ADDRESS 0x00008304 -#define MAC_PCU_BT_WL_1_OFFSET 0x00000304 -#define MAC_PCU_BT_WL_1_WEIGHT_MSB 31 -#define MAC_PCU_BT_WL_1_WEIGHT_LSB 0 -#define MAC_PCU_BT_WL_1_WEIGHT_MASK 0xffffffff -#define MAC_PCU_BT_WL_1_WEIGHT_GET(x) (((x) & MAC_PCU_BT_WL_1_WEIGHT_MASK) >> MAC_PCU_BT_WL_1_WEIGHT_LSB) -#define MAC_PCU_BT_WL_1_WEIGHT_SET(x) (((x) << MAC_PCU_BT_WL_1_WEIGHT_LSB) & MAC_PCU_BT_WL_1_WEIGHT_MASK) - -#define MAC_PCU_BT_WL_2_ADDRESS 0x00008308 -#define MAC_PCU_BT_WL_2_OFFSET 0x00000308 -#define MAC_PCU_BT_WL_2_WEIGHT_MSB 31 -#define MAC_PCU_BT_WL_2_WEIGHT_LSB 0 -#define MAC_PCU_BT_WL_2_WEIGHT_MASK 0xffffffff -#define MAC_PCU_BT_WL_2_WEIGHT_GET(x) (((x) & MAC_PCU_BT_WL_2_WEIGHT_MASK) >> MAC_PCU_BT_WL_2_WEIGHT_LSB) -#define MAC_PCU_BT_WL_2_WEIGHT_SET(x) (((x) << MAC_PCU_BT_WL_2_WEIGHT_LSB) & MAC_PCU_BT_WL_2_WEIGHT_MASK) - -#define MAC_PCU_BT_WL_3_ADDRESS 0x0000830c -#define MAC_PCU_BT_WL_3_OFFSET 0x0000030c -#define MAC_PCU_BT_WL_3_WEIGHT_MSB 31 -#define MAC_PCU_BT_WL_3_WEIGHT_LSB 0 -#define MAC_PCU_BT_WL_3_WEIGHT_MASK 0xffffffff -#define MAC_PCU_BT_WL_3_WEIGHT_GET(x) (((x) & MAC_PCU_BT_WL_3_WEIGHT_MASK) >> MAC_PCU_BT_WL_3_WEIGHT_LSB) -#define MAC_PCU_BT_WL_3_WEIGHT_SET(x) (((x) << MAC_PCU_BT_WL_3_WEIGHT_LSB) & MAC_PCU_BT_WL_3_WEIGHT_MASK) - -#define MAC_PCU_BT_WL_4_ADDRESS 0x00008310 -#define MAC_PCU_BT_WL_4_OFFSET 0x00000310 -#define MAC_PCU_BT_WL_4_WEIGHT_MSB 31 -#define MAC_PCU_BT_WL_4_WEIGHT_LSB 0 -#define MAC_PCU_BT_WL_4_WEIGHT_MASK 0xffffffff -#define MAC_PCU_BT_WL_4_WEIGHT_GET(x) (((x) & MAC_PCU_BT_WL_4_WEIGHT_MASK) >> MAC_PCU_BT_WL_4_WEIGHT_LSB) -#define MAC_PCU_BT_WL_4_WEIGHT_SET(x) (((x) << MAC_PCU_BT_WL_4_WEIGHT_LSB) & MAC_PCU_BT_WL_4_WEIGHT_MASK) - -#define MAC_PCU_COEX_EPTA_ADDRESS 0x00008314 -#define MAC_PCU_COEX_EPTA_OFFSET 0x00000314 -#define MAC_PCU_COEX_EPTA_WT_IDX_MSB 12 -#define MAC_PCU_COEX_EPTA_WT_IDX_LSB 6 -#define MAC_PCU_COEX_EPTA_WT_IDX_MASK 0x00001fc0 -#define MAC_PCU_COEX_EPTA_WT_IDX_GET(x) (((x) & MAC_PCU_COEX_EPTA_WT_IDX_MASK) >> MAC_PCU_COEX_EPTA_WT_IDX_LSB) -#define MAC_PCU_COEX_EPTA_WT_IDX_SET(x) (((x) << MAC_PCU_COEX_EPTA_WT_IDX_LSB) & MAC_PCU_COEX_EPTA_WT_IDX_MASK) -#define MAC_PCU_COEX_EPTA_LINKID_MSB 5 -#define MAC_PCU_COEX_EPTA_LINKID_LSB 0 -#define MAC_PCU_COEX_EPTA_LINKID_MASK 0x0000003f -#define MAC_PCU_COEX_EPTA_LINKID_GET(x) (((x) & MAC_PCU_COEX_EPTA_LINKID_MASK) >> MAC_PCU_COEX_EPTA_LINKID_LSB) -#define MAC_PCU_COEX_EPTA_LINKID_SET(x) (((x) << MAC_PCU_COEX_EPTA_LINKID_LSB) & MAC_PCU_COEX_EPTA_LINKID_MASK) - -#define MAC_PCU_COEX_LNAMAXGAIN1_ADDRESS 0x00008318 -#define MAC_PCU_COEX_LNAMAXGAIN1_OFFSET 0x00000318 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN4_MSB 31 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN4_LSB 24 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN4_MASK 0xff000000 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN4_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN4_MASK) >> MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN4_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN4_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN4_LSB) & MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN4_MASK) -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN3_MSB 23 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN3_LSB 16 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN3_MASK 0x00ff0000 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN3_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN3_MASK) >> MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN3_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN3_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN3_LSB) & MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN3_MASK) -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN2_MSB 15 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN2_LSB 8 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN2_MASK 0x0000ff00 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN2_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN2_MASK) >> MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN2_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN2_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN2_LSB) & MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN2_MASK) -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN1_MSB 7 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN1_LSB 0 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN1_MASK 0x000000ff -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN1_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN1_MASK) >> MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN1_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN1_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN1_LSB) & MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN1_MASK) - -#define MAC_PCU_COEX_LNAMAXGAIN2_ADDRESS 0x0000831c -#define MAC_PCU_COEX_LNAMAXGAIN2_OFFSET 0x0000031c -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN4_MSB 31 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN4_LSB 24 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN4_MASK 0xff000000 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN4_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN4_MASK) >> MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN4_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN4_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN4_LSB) & MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN4_MASK) -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN3_MSB 23 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN3_LSB 16 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN3_MASK 0x00ff0000 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN3_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN3_MASK) >> MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN3_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN3_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN3_LSB) & MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN3_MASK) -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN2_MSB 15 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN2_LSB 8 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN2_MASK 0x0000ff00 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN2_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN2_MASK) >> MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN2_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN2_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN2_LSB) & MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN2_MASK) -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN1_MSB 7 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN1_LSB 0 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN1_MASK 0x000000ff -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN1_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN1_MASK) >> MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN1_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN1_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN1_LSB) & MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN1_MASK) - -#define MAC_PCU_COEX_LNAMAXGAIN3_ADDRESS 0x00008320 -#define MAC_PCU_COEX_LNAMAXGAIN3_OFFSET 0x00000320 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN4_MSB 31 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN4_LSB 24 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN4_MASK 0xff000000 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN4_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN4_MASK) >> MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN4_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN4_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN4_LSB) & MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN4_MASK) -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN3_MSB 23 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN3_LSB 16 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN3_MASK 0x00ff0000 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN3_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN3_MASK) >> MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN3_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN3_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN3_LSB) & MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN3_MASK) -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN2_MSB 15 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN2_LSB 8 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN2_MASK 0x0000ff00 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN2_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN2_MASK) >> MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN2_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN2_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN2_LSB) & MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN2_MASK) -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN1_MSB 7 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN1_LSB 0 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN1_MASK 0x000000ff -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN1_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN1_MASK) >> MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN1_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN1_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN1_LSB) & MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN1_MASK) - -#define MAC_PCU_COEX_LNAMAXGAIN4_ADDRESS 0x00008324 -#define MAC_PCU_COEX_LNAMAXGAIN4_OFFSET 0x00000324 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN4_MSB 31 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN4_LSB 24 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN4_MASK 0xff000000 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN4_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN4_MASK) >> MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN4_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN4_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN4_LSB) & MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN4_MASK) -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN3_MSB 23 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN3_LSB 16 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN3_MASK 0x00ff0000 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN3_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN3_MASK) >> MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN3_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN3_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN3_LSB) & MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN3_MASK) -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN2_MSB 15 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN2_LSB 8 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN2_MASK 0x0000ff00 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN2_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN2_MASK) >> MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN2_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN2_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN2_LSB) & MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN2_MASK) -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN1_MSB 7 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN1_LSB 0 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN1_MASK 0x000000ff -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN1_GET(x) (((x) & MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN1_MASK) >> MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN1_LSB) -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN1_SET(x) (((x) << MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN1_LSB) & MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN1_MASK) - -#define MAC_PCU_BASIC_RATE_SET0_ADDRESS 0x00008328 -#define MAC_PCU_BASIC_RATE_SET0_OFFSET 0x00000328 -#define MAC_PCU_BASIC_RATE_SET0_VALUE_MSB 29 -#define MAC_PCU_BASIC_RATE_SET0_VALUE_LSB 0 -#define MAC_PCU_BASIC_RATE_SET0_VALUE_MASK 0x3fffffff -#define MAC_PCU_BASIC_RATE_SET0_VALUE_GET(x) (((x) & MAC_PCU_BASIC_RATE_SET0_VALUE_MASK) >> MAC_PCU_BASIC_RATE_SET0_VALUE_LSB) -#define MAC_PCU_BASIC_RATE_SET0_VALUE_SET(x) (((x) << MAC_PCU_BASIC_RATE_SET0_VALUE_LSB) & MAC_PCU_BASIC_RATE_SET0_VALUE_MASK) - -#define MAC_PCU_BASIC_RATE_SET1_ADDRESS 0x0000832c -#define MAC_PCU_BASIC_RATE_SET1_OFFSET 0x0000032c -#define MAC_PCU_BASIC_RATE_SET1_VALUE_MSB 29 -#define MAC_PCU_BASIC_RATE_SET1_VALUE_LSB 0 -#define MAC_PCU_BASIC_RATE_SET1_VALUE_MASK 0x3fffffff -#define MAC_PCU_BASIC_RATE_SET1_VALUE_GET(x) (((x) & MAC_PCU_BASIC_RATE_SET1_VALUE_MASK) >> MAC_PCU_BASIC_RATE_SET1_VALUE_LSB) -#define MAC_PCU_BASIC_RATE_SET1_VALUE_SET(x) (((x) << MAC_PCU_BASIC_RATE_SET1_VALUE_LSB) & MAC_PCU_BASIC_RATE_SET1_VALUE_MASK) - -#define MAC_PCU_BASIC_RATE_SET2_ADDRESS 0x00008330 -#define MAC_PCU_BASIC_RATE_SET2_OFFSET 0x00000330 -#define MAC_PCU_BASIC_RATE_SET2_VALUE_MSB 29 -#define MAC_PCU_BASIC_RATE_SET2_VALUE_LSB 0 -#define MAC_PCU_BASIC_RATE_SET2_VALUE_MASK 0x3fffffff -#define MAC_PCU_BASIC_RATE_SET2_VALUE_GET(x) (((x) & MAC_PCU_BASIC_RATE_SET2_VALUE_MASK) >> MAC_PCU_BASIC_RATE_SET2_VALUE_LSB) -#define MAC_PCU_BASIC_RATE_SET2_VALUE_SET(x) (((x) << MAC_PCU_BASIC_RATE_SET2_VALUE_LSB) & MAC_PCU_BASIC_RATE_SET2_VALUE_MASK) - -#define MAC_PCU_BASIC_RATE_SET3_ADDRESS 0x00008334 -#define MAC_PCU_BASIC_RATE_SET3_OFFSET 0x00000334 -#define MAC_PCU_BASIC_RATE_SET3_VALUE_MSB 24 -#define MAC_PCU_BASIC_RATE_SET3_VALUE_LSB 0 -#define MAC_PCU_BASIC_RATE_SET3_VALUE_MASK 0x01ffffff -#define MAC_PCU_BASIC_RATE_SET3_VALUE_GET(x) (((x) & MAC_PCU_BASIC_RATE_SET3_VALUE_MASK) >> MAC_PCU_BASIC_RATE_SET3_VALUE_LSB) -#define MAC_PCU_BASIC_RATE_SET3_VALUE_SET(x) (((x) << MAC_PCU_BASIC_RATE_SET3_VALUE_LSB) & MAC_PCU_BASIC_RATE_SET3_VALUE_MASK) - -#define MAC_PCU_RX_INT_STATUS0_ADDRESS 0x00008338 -#define MAC_PCU_RX_INT_STATUS0_OFFSET 0x00000338 -#define MAC_PCU_RX_INT_STATUS0_DURATION_H_MSB 31 -#define MAC_PCU_RX_INT_STATUS0_DURATION_H_LSB 24 -#define MAC_PCU_RX_INT_STATUS0_DURATION_H_MASK 0xff000000 -#define MAC_PCU_RX_INT_STATUS0_DURATION_H_GET(x) (((x) & MAC_PCU_RX_INT_STATUS0_DURATION_H_MASK) >> MAC_PCU_RX_INT_STATUS0_DURATION_H_LSB) -#define MAC_PCU_RX_INT_STATUS0_DURATION_H_SET(x) (((x) << MAC_PCU_RX_INT_STATUS0_DURATION_H_LSB) & MAC_PCU_RX_INT_STATUS0_DURATION_H_MASK) -#define MAC_PCU_RX_INT_STATUS0_DURATION_L_MSB 23 -#define MAC_PCU_RX_INT_STATUS0_DURATION_L_LSB 16 -#define MAC_PCU_RX_INT_STATUS0_DURATION_L_MASK 0x00ff0000 -#define MAC_PCU_RX_INT_STATUS0_DURATION_L_GET(x) (((x) & MAC_PCU_RX_INT_STATUS0_DURATION_L_MASK) >> MAC_PCU_RX_INT_STATUS0_DURATION_L_LSB) -#define MAC_PCU_RX_INT_STATUS0_DURATION_L_SET(x) (((x) << MAC_PCU_RX_INT_STATUS0_DURATION_L_LSB) & MAC_PCU_RX_INT_STATUS0_DURATION_L_MASK) -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_H_MSB 15 -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_H_LSB 8 -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_H_MASK 0x0000ff00 -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_H_GET(x) (((x) & MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_H_MASK) >> MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_H_LSB) -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_H_SET(x) (((x) << MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_H_LSB) & MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_H_MASK) -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_L_MSB 7 -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_L_LSB 0 -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_L_MASK 0x000000ff -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_L_GET(x) (((x) & MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_L_MASK) >> MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_L_LSB) -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_L_SET(x) (((x) << MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_L_LSB) & MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_L_MASK) - -#define MAC_PCU_RX_INT_STATUS1_ADDRESS 0x0000833c -#define MAC_PCU_RX_INT_STATUS1_OFFSET 0x0000033c -#define MAC_PCU_RX_INT_STATUS1_VALUE_MSB 17 -#define MAC_PCU_RX_INT_STATUS1_VALUE_LSB 0 -#define MAC_PCU_RX_INT_STATUS1_VALUE_MASK 0x0003ffff -#define MAC_PCU_RX_INT_STATUS1_VALUE_GET(x) (((x) & MAC_PCU_RX_INT_STATUS1_VALUE_MASK) >> MAC_PCU_RX_INT_STATUS1_VALUE_LSB) -#define MAC_PCU_RX_INT_STATUS1_VALUE_SET(x) (((x) << MAC_PCU_RX_INT_STATUS1_VALUE_LSB) & MAC_PCU_RX_INT_STATUS1_VALUE_MASK) - -#define MAC_PCU_RX_INT_STATUS2_ADDRESS 0x00008340 -#define MAC_PCU_RX_INT_STATUS2_OFFSET 0x00000340 -#define MAC_PCU_RX_INT_STATUS2_VALUE_MSB 26 -#define MAC_PCU_RX_INT_STATUS2_VALUE_LSB 0 -#define MAC_PCU_RX_INT_STATUS2_VALUE_MASK 0x07ffffff -#define MAC_PCU_RX_INT_STATUS2_VALUE_GET(x) (((x) & MAC_PCU_RX_INT_STATUS2_VALUE_MASK) >> MAC_PCU_RX_INT_STATUS2_VALUE_LSB) -#define MAC_PCU_RX_INT_STATUS2_VALUE_SET(x) (((x) << MAC_PCU_RX_INT_STATUS2_VALUE_LSB) & MAC_PCU_RX_INT_STATUS2_VALUE_MASK) - -#define MAC_PCU_RX_INT_STATUS3_ADDRESS 0x00008344 -#define MAC_PCU_RX_INT_STATUS3_OFFSET 0x00000344 -#define MAC_PCU_RX_INT_STATUS3_VALUE_MSB 23 -#define MAC_PCU_RX_INT_STATUS3_VALUE_LSB 0 -#define MAC_PCU_RX_INT_STATUS3_VALUE_MASK 0x00ffffff -#define MAC_PCU_RX_INT_STATUS3_VALUE_GET(x) (((x) & MAC_PCU_RX_INT_STATUS3_VALUE_MASK) >> MAC_PCU_RX_INT_STATUS3_VALUE_LSB) -#define MAC_PCU_RX_INT_STATUS3_VALUE_SET(x) (((x) << MAC_PCU_RX_INT_STATUS3_VALUE_LSB) & MAC_PCU_RX_INT_STATUS3_VALUE_MASK) - -#define HT_HALF_GI_RATE1_ADDRESS 0x00008348 -#define HT_HALF_GI_RATE1_OFFSET 0x00000348 -#define HT_HALF_GI_RATE1_MCS3_MSB 31 -#define HT_HALF_GI_RATE1_MCS3_LSB 24 -#define HT_HALF_GI_RATE1_MCS3_MASK 0xff000000 -#define HT_HALF_GI_RATE1_MCS3_GET(x) (((x) & HT_HALF_GI_RATE1_MCS3_MASK) >> HT_HALF_GI_RATE1_MCS3_LSB) -#define HT_HALF_GI_RATE1_MCS3_SET(x) (((x) << HT_HALF_GI_RATE1_MCS3_LSB) & HT_HALF_GI_RATE1_MCS3_MASK) -#define HT_HALF_GI_RATE1_MCS2_MSB 23 -#define HT_HALF_GI_RATE1_MCS2_LSB 16 -#define HT_HALF_GI_RATE1_MCS2_MASK 0x00ff0000 -#define HT_HALF_GI_RATE1_MCS2_GET(x) (((x) & HT_HALF_GI_RATE1_MCS2_MASK) >> HT_HALF_GI_RATE1_MCS2_LSB) -#define HT_HALF_GI_RATE1_MCS2_SET(x) (((x) << HT_HALF_GI_RATE1_MCS2_LSB) & HT_HALF_GI_RATE1_MCS2_MASK) -#define HT_HALF_GI_RATE1_MCS1_MSB 15 -#define HT_HALF_GI_RATE1_MCS1_LSB 8 -#define HT_HALF_GI_RATE1_MCS1_MASK 0x0000ff00 -#define HT_HALF_GI_RATE1_MCS1_GET(x) (((x) & HT_HALF_GI_RATE1_MCS1_MASK) >> HT_HALF_GI_RATE1_MCS1_LSB) -#define HT_HALF_GI_RATE1_MCS1_SET(x) (((x) << HT_HALF_GI_RATE1_MCS1_LSB) & HT_HALF_GI_RATE1_MCS1_MASK) -#define HT_HALF_GI_RATE1_MCS0_MSB 7 -#define HT_HALF_GI_RATE1_MCS0_LSB 0 -#define HT_HALF_GI_RATE1_MCS0_MASK 0x000000ff -#define HT_HALF_GI_RATE1_MCS0_GET(x) (((x) & HT_HALF_GI_RATE1_MCS0_MASK) >> HT_HALF_GI_RATE1_MCS0_LSB) -#define HT_HALF_GI_RATE1_MCS0_SET(x) (((x) << HT_HALF_GI_RATE1_MCS0_LSB) & HT_HALF_GI_RATE1_MCS0_MASK) - -#define HT_HALF_GI_RATE2_ADDRESS 0x0000834c -#define HT_HALF_GI_RATE2_OFFSET 0x0000034c -#define HT_HALF_GI_RATE2_MCS7_MSB 31 -#define HT_HALF_GI_RATE2_MCS7_LSB 24 -#define HT_HALF_GI_RATE2_MCS7_MASK 0xff000000 -#define HT_HALF_GI_RATE2_MCS7_GET(x) (((x) & HT_HALF_GI_RATE2_MCS7_MASK) >> HT_HALF_GI_RATE2_MCS7_LSB) -#define HT_HALF_GI_RATE2_MCS7_SET(x) (((x) << HT_HALF_GI_RATE2_MCS7_LSB) & HT_HALF_GI_RATE2_MCS7_MASK) -#define HT_HALF_GI_RATE2_MCS6_MSB 23 -#define HT_HALF_GI_RATE2_MCS6_LSB 16 -#define HT_HALF_GI_RATE2_MCS6_MASK 0x00ff0000 -#define HT_HALF_GI_RATE2_MCS6_GET(x) (((x) & HT_HALF_GI_RATE2_MCS6_MASK) >> HT_HALF_GI_RATE2_MCS6_LSB) -#define HT_HALF_GI_RATE2_MCS6_SET(x) (((x) << HT_HALF_GI_RATE2_MCS6_LSB) & HT_HALF_GI_RATE2_MCS6_MASK) -#define HT_HALF_GI_RATE2_MCS5_MSB 15 -#define HT_HALF_GI_RATE2_MCS5_LSB 8 -#define HT_HALF_GI_RATE2_MCS5_MASK 0x0000ff00 -#define HT_HALF_GI_RATE2_MCS5_GET(x) (((x) & HT_HALF_GI_RATE2_MCS5_MASK) >> HT_HALF_GI_RATE2_MCS5_LSB) -#define HT_HALF_GI_RATE2_MCS5_SET(x) (((x) << HT_HALF_GI_RATE2_MCS5_LSB) & HT_HALF_GI_RATE2_MCS5_MASK) -#define HT_HALF_GI_RATE2_MCS4_MSB 7 -#define HT_HALF_GI_RATE2_MCS4_LSB 0 -#define HT_HALF_GI_RATE2_MCS4_MASK 0x000000ff -#define HT_HALF_GI_RATE2_MCS4_GET(x) (((x) & HT_HALF_GI_RATE2_MCS4_MASK) >> HT_HALF_GI_RATE2_MCS4_LSB) -#define HT_HALF_GI_RATE2_MCS4_SET(x) (((x) << HT_HALF_GI_RATE2_MCS4_LSB) & HT_HALF_GI_RATE2_MCS4_MASK) - -#define HT_FULL_GI_RATE1_ADDRESS 0x00008350 -#define HT_FULL_GI_RATE1_OFFSET 0x00000350 -#define HT_FULL_GI_RATE1_MCS3_MSB 31 -#define HT_FULL_GI_RATE1_MCS3_LSB 24 -#define HT_FULL_GI_RATE1_MCS3_MASK 0xff000000 -#define HT_FULL_GI_RATE1_MCS3_GET(x) (((x) & HT_FULL_GI_RATE1_MCS3_MASK) >> HT_FULL_GI_RATE1_MCS3_LSB) -#define HT_FULL_GI_RATE1_MCS3_SET(x) (((x) << HT_FULL_GI_RATE1_MCS3_LSB) & HT_FULL_GI_RATE1_MCS3_MASK) -#define HT_FULL_GI_RATE1_MCS2_MSB 23 -#define HT_FULL_GI_RATE1_MCS2_LSB 16 -#define HT_FULL_GI_RATE1_MCS2_MASK 0x00ff0000 -#define HT_FULL_GI_RATE1_MCS2_GET(x) (((x) & HT_FULL_GI_RATE1_MCS2_MASK) >> HT_FULL_GI_RATE1_MCS2_LSB) -#define HT_FULL_GI_RATE1_MCS2_SET(x) (((x) << HT_FULL_GI_RATE1_MCS2_LSB) & HT_FULL_GI_RATE1_MCS2_MASK) -#define HT_FULL_GI_RATE1_MCS1_MSB 15 -#define HT_FULL_GI_RATE1_MCS1_LSB 8 -#define HT_FULL_GI_RATE1_MCS1_MASK 0x0000ff00 -#define HT_FULL_GI_RATE1_MCS1_GET(x) (((x) & HT_FULL_GI_RATE1_MCS1_MASK) >> HT_FULL_GI_RATE1_MCS1_LSB) -#define HT_FULL_GI_RATE1_MCS1_SET(x) (((x) << HT_FULL_GI_RATE1_MCS1_LSB) & HT_FULL_GI_RATE1_MCS1_MASK) -#define HT_FULL_GI_RATE1_MCS0_MSB 7 -#define HT_FULL_GI_RATE1_MCS0_LSB 0 -#define HT_FULL_GI_RATE1_MCS0_MASK 0x000000ff -#define HT_FULL_GI_RATE1_MCS0_GET(x) (((x) & HT_FULL_GI_RATE1_MCS0_MASK) >> HT_FULL_GI_RATE1_MCS0_LSB) -#define HT_FULL_GI_RATE1_MCS0_SET(x) (((x) << HT_FULL_GI_RATE1_MCS0_LSB) & HT_FULL_GI_RATE1_MCS0_MASK) - -#define HT_FULL_GI_RATE2_ADDRESS 0x00008354 -#define HT_FULL_GI_RATE2_OFFSET 0x00000354 -#define HT_FULL_GI_RATE2_MCS7_MSB 31 -#define HT_FULL_GI_RATE2_MCS7_LSB 24 -#define HT_FULL_GI_RATE2_MCS7_MASK 0xff000000 -#define HT_FULL_GI_RATE2_MCS7_GET(x) (((x) & HT_FULL_GI_RATE2_MCS7_MASK) >> HT_FULL_GI_RATE2_MCS7_LSB) -#define HT_FULL_GI_RATE2_MCS7_SET(x) (((x) << HT_FULL_GI_RATE2_MCS7_LSB) & HT_FULL_GI_RATE2_MCS7_MASK) -#define HT_FULL_GI_RATE2_MCS6_MSB 23 -#define HT_FULL_GI_RATE2_MCS6_LSB 16 -#define HT_FULL_GI_RATE2_MCS6_MASK 0x00ff0000 -#define HT_FULL_GI_RATE2_MCS6_GET(x) (((x) & HT_FULL_GI_RATE2_MCS6_MASK) >> HT_FULL_GI_RATE2_MCS6_LSB) -#define HT_FULL_GI_RATE2_MCS6_SET(x) (((x) << HT_FULL_GI_RATE2_MCS6_LSB) & HT_FULL_GI_RATE2_MCS6_MASK) -#define HT_FULL_GI_RATE2_MCS5_MSB 15 -#define HT_FULL_GI_RATE2_MCS5_LSB 8 -#define HT_FULL_GI_RATE2_MCS5_MASK 0x0000ff00 -#define HT_FULL_GI_RATE2_MCS5_GET(x) (((x) & HT_FULL_GI_RATE2_MCS5_MASK) >> HT_FULL_GI_RATE2_MCS5_LSB) -#define HT_FULL_GI_RATE2_MCS5_SET(x) (((x) << HT_FULL_GI_RATE2_MCS5_LSB) & HT_FULL_GI_RATE2_MCS5_MASK) -#define HT_FULL_GI_RATE2_MCS4_MSB 7 -#define HT_FULL_GI_RATE2_MCS4_LSB 0 -#define HT_FULL_GI_RATE2_MCS4_MASK 0x000000ff -#define HT_FULL_GI_RATE2_MCS4_GET(x) (((x) & HT_FULL_GI_RATE2_MCS4_MASK) >> HT_FULL_GI_RATE2_MCS4_LSB) -#define HT_FULL_GI_RATE2_MCS4_SET(x) (((x) << HT_FULL_GI_RATE2_MCS4_LSB) & HT_FULL_GI_RATE2_MCS4_MASK) - -#define LEGACY_RATE1_ADDRESS 0x00008358 -#define LEGACY_RATE1_OFFSET 0x00000358 -#define LEGACY_RATE1_RATE12_MSB 29 -#define LEGACY_RATE1_RATE12_LSB 24 -#define LEGACY_RATE1_RATE12_MASK 0x3f000000 -#define LEGACY_RATE1_RATE12_GET(x) (((x) & LEGACY_RATE1_RATE12_MASK) >> LEGACY_RATE1_RATE12_LSB) -#define LEGACY_RATE1_RATE12_SET(x) (((x) << LEGACY_RATE1_RATE12_LSB) & LEGACY_RATE1_RATE12_MASK) -#define LEGACY_RATE1_RATE11_MSB 23 -#define LEGACY_RATE1_RATE11_LSB 18 -#define LEGACY_RATE1_RATE11_MASK 0x00fc0000 -#define LEGACY_RATE1_RATE11_GET(x) (((x) & LEGACY_RATE1_RATE11_MASK) >> LEGACY_RATE1_RATE11_LSB) -#define LEGACY_RATE1_RATE11_SET(x) (((x) << LEGACY_RATE1_RATE11_LSB) & LEGACY_RATE1_RATE11_MASK) -#define LEGACY_RATE1_RATE10_MSB 17 -#define LEGACY_RATE1_RATE10_LSB 12 -#define LEGACY_RATE1_RATE10_MASK 0x0003f000 -#define LEGACY_RATE1_RATE10_GET(x) (((x) & LEGACY_RATE1_RATE10_MASK) >> LEGACY_RATE1_RATE10_LSB) -#define LEGACY_RATE1_RATE10_SET(x) (((x) << LEGACY_RATE1_RATE10_LSB) & LEGACY_RATE1_RATE10_MASK) -#define LEGACY_RATE1_RATE9_MSB 11 -#define LEGACY_RATE1_RATE9_LSB 6 -#define LEGACY_RATE1_RATE9_MASK 0x00000fc0 -#define LEGACY_RATE1_RATE9_GET(x) (((x) & LEGACY_RATE1_RATE9_MASK) >> LEGACY_RATE1_RATE9_LSB) -#define LEGACY_RATE1_RATE9_SET(x) (((x) << LEGACY_RATE1_RATE9_LSB) & LEGACY_RATE1_RATE9_MASK) -#define LEGACY_RATE1_RATE8_MSB 5 -#define LEGACY_RATE1_RATE8_LSB 0 -#define LEGACY_RATE1_RATE8_MASK 0x0000003f -#define LEGACY_RATE1_RATE8_GET(x) (((x) & LEGACY_RATE1_RATE8_MASK) >> LEGACY_RATE1_RATE8_LSB) -#define LEGACY_RATE1_RATE8_SET(x) (((x) << LEGACY_RATE1_RATE8_LSB) & LEGACY_RATE1_RATE8_MASK) - -#define LEGACY_RATE2_ADDRESS 0x0000835c -#define LEGACY_RATE2_OFFSET 0x0000035c -#define LEGACY_RATE2_RATE25_MSB 29 -#define LEGACY_RATE2_RATE25_LSB 24 -#define LEGACY_RATE2_RATE25_MASK 0x3f000000 -#define LEGACY_RATE2_RATE25_GET(x) (((x) & LEGACY_RATE2_RATE25_MASK) >> LEGACY_RATE2_RATE25_LSB) -#define LEGACY_RATE2_RATE25_SET(x) (((x) << LEGACY_RATE2_RATE25_LSB) & LEGACY_RATE2_RATE25_MASK) -#define LEGACY_RATE2_RATE24_MSB 23 -#define LEGACY_RATE2_RATE24_LSB 18 -#define LEGACY_RATE2_RATE24_MASK 0x00fc0000 -#define LEGACY_RATE2_RATE24_GET(x) (((x) & LEGACY_RATE2_RATE24_MASK) >> LEGACY_RATE2_RATE24_LSB) -#define LEGACY_RATE2_RATE24_SET(x) (((x) << LEGACY_RATE2_RATE24_LSB) & LEGACY_RATE2_RATE24_MASK) -#define LEGACY_RATE2_RATE15_MSB 17 -#define LEGACY_RATE2_RATE15_LSB 12 -#define LEGACY_RATE2_RATE15_MASK 0x0003f000 -#define LEGACY_RATE2_RATE15_GET(x) (((x) & LEGACY_RATE2_RATE15_MASK) >> LEGACY_RATE2_RATE15_LSB) -#define LEGACY_RATE2_RATE15_SET(x) (((x) << LEGACY_RATE2_RATE15_LSB) & LEGACY_RATE2_RATE15_MASK) -#define LEGACY_RATE2_RATE14_MSB 11 -#define LEGACY_RATE2_RATE14_LSB 6 -#define LEGACY_RATE2_RATE14_MASK 0x00000fc0 -#define LEGACY_RATE2_RATE14_GET(x) (((x) & LEGACY_RATE2_RATE14_MASK) >> LEGACY_RATE2_RATE14_LSB) -#define LEGACY_RATE2_RATE14_SET(x) (((x) << LEGACY_RATE2_RATE14_LSB) & LEGACY_RATE2_RATE14_MASK) -#define LEGACY_RATE2_RATE13_MSB 5 -#define LEGACY_RATE2_RATE13_LSB 0 -#define LEGACY_RATE2_RATE13_MASK 0x0000003f -#define LEGACY_RATE2_RATE13_GET(x) (((x) & LEGACY_RATE2_RATE13_MASK) >> LEGACY_RATE2_RATE13_LSB) -#define LEGACY_RATE2_RATE13_SET(x) (((x) << LEGACY_RATE2_RATE13_LSB) & LEGACY_RATE2_RATE13_MASK) - -#define LEGACY_RATE3_ADDRESS 0x00008360 -#define LEGACY_RATE3_OFFSET 0x00000360 -#define LEGACY_RATE3_RATE30_MSB 29 -#define LEGACY_RATE3_RATE30_LSB 24 -#define LEGACY_RATE3_RATE30_MASK 0x3f000000 -#define LEGACY_RATE3_RATE30_GET(x) (((x) & LEGACY_RATE3_RATE30_MASK) >> LEGACY_RATE3_RATE30_LSB) -#define LEGACY_RATE3_RATE30_SET(x) (((x) << LEGACY_RATE3_RATE30_LSB) & LEGACY_RATE3_RATE30_MASK) -#define LEGACY_RATE3_RATE29_MSB 23 -#define LEGACY_RATE3_RATE29_LSB 18 -#define LEGACY_RATE3_RATE29_MASK 0x00fc0000 -#define LEGACY_RATE3_RATE29_GET(x) (((x) & LEGACY_RATE3_RATE29_MASK) >> LEGACY_RATE3_RATE29_LSB) -#define LEGACY_RATE3_RATE29_SET(x) (((x) << LEGACY_RATE3_RATE29_LSB) & LEGACY_RATE3_RATE29_MASK) -#define LEGACY_RATE3_RATE28_MSB 17 -#define LEGACY_RATE3_RATE28_LSB 12 -#define LEGACY_RATE3_RATE28_MASK 0x0003f000 -#define LEGACY_RATE3_RATE28_GET(x) (((x) & LEGACY_RATE3_RATE28_MASK) >> LEGACY_RATE3_RATE28_LSB) -#define LEGACY_RATE3_RATE28_SET(x) (((x) << LEGACY_RATE3_RATE28_LSB) & LEGACY_RATE3_RATE28_MASK) -#define LEGACY_RATE3_RATE27_MSB 11 -#define LEGACY_RATE3_RATE27_LSB 6 -#define LEGACY_RATE3_RATE27_MASK 0x00000fc0 -#define LEGACY_RATE3_RATE27_GET(x) (((x) & LEGACY_RATE3_RATE27_MASK) >> LEGACY_RATE3_RATE27_LSB) -#define LEGACY_RATE3_RATE27_SET(x) (((x) << LEGACY_RATE3_RATE27_LSB) & LEGACY_RATE3_RATE27_MASK) -#define LEGACY_RATE3_RATE26_MSB 5 -#define LEGACY_RATE3_RATE26_LSB 0 -#define LEGACY_RATE3_RATE26_MASK 0x0000003f -#define LEGACY_RATE3_RATE26_GET(x) (((x) & LEGACY_RATE3_RATE26_MASK) >> LEGACY_RATE3_RATE26_LSB) -#define LEGACY_RATE3_RATE26_SET(x) (((x) << LEGACY_RATE3_RATE26_LSB) & LEGACY_RATE3_RATE26_MASK) - -#define RX_INT_FILTER_ADDRESS 0x00008364 -#define RX_INT_FILTER_OFFSET 0x00000364 -#define RX_INT_FILTER_BEACON_MSB 17 -#define RX_INT_FILTER_BEACON_LSB 17 -#define RX_INT_FILTER_BEACON_MASK 0x00020000 -#define RX_INT_FILTER_BEACON_GET(x) (((x) & RX_INT_FILTER_BEACON_MASK) >> RX_INT_FILTER_BEACON_LSB) -#define RX_INT_FILTER_BEACON_SET(x) (((x) << RX_INT_FILTER_BEACON_LSB) & RX_INT_FILTER_BEACON_MASK) -#define RX_INT_FILTER_AMPDU_MSB 16 -#define RX_INT_FILTER_AMPDU_LSB 16 -#define RX_INT_FILTER_AMPDU_MASK 0x00010000 -#define RX_INT_FILTER_AMPDU_GET(x) (((x) & RX_INT_FILTER_AMPDU_MASK) >> RX_INT_FILTER_AMPDU_LSB) -#define RX_INT_FILTER_AMPDU_SET(x) (((x) << RX_INT_FILTER_AMPDU_LSB) & RX_INT_FILTER_AMPDU_MASK) -#define RX_INT_FILTER_EOSP_MSB 15 -#define RX_INT_FILTER_EOSP_LSB 15 -#define RX_INT_FILTER_EOSP_MASK 0x00008000 -#define RX_INT_FILTER_EOSP_GET(x) (((x) & RX_INT_FILTER_EOSP_MASK) >> RX_INT_FILTER_EOSP_LSB) -#define RX_INT_FILTER_EOSP_SET(x) (((x) << RX_INT_FILTER_EOSP_LSB) & RX_INT_FILTER_EOSP_MASK) -#define RX_INT_FILTER_LENGTH_LOW_MSB 14 -#define RX_INT_FILTER_LENGTH_LOW_LSB 14 -#define RX_INT_FILTER_LENGTH_LOW_MASK 0x00004000 -#define RX_INT_FILTER_LENGTH_LOW_GET(x) (((x) & RX_INT_FILTER_LENGTH_LOW_MASK) >> RX_INT_FILTER_LENGTH_LOW_LSB) -#define RX_INT_FILTER_LENGTH_LOW_SET(x) (((x) << RX_INT_FILTER_LENGTH_LOW_LSB) & RX_INT_FILTER_LENGTH_LOW_MASK) -#define RX_INT_FILTER_LENGTH_HIGH_MSB 13 -#define RX_INT_FILTER_LENGTH_HIGH_LSB 13 -#define RX_INT_FILTER_LENGTH_HIGH_MASK 0x00002000 -#define RX_INT_FILTER_LENGTH_HIGH_GET(x) (((x) & RX_INT_FILTER_LENGTH_HIGH_MASK) >> RX_INT_FILTER_LENGTH_HIGH_LSB) -#define RX_INT_FILTER_LENGTH_HIGH_SET(x) (((x) << RX_INT_FILTER_LENGTH_HIGH_LSB) & RX_INT_FILTER_LENGTH_HIGH_MASK) -#define RX_INT_FILTER_RSSI_MSB 12 -#define RX_INT_FILTER_RSSI_LSB 12 -#define RX_INT_FILTER_RSSI_MASK 0x00001000 -#define RX_INT_FILTER_RSSI_GET(x) (((x) & RX_INT_FILTER_RSSI_MASK) >> RX_INT_FILTER_RSSI_LSB) -#define RX_INT_FILTER_RSSI_SET(x) (((x) << RX_INT_FILTER_RSSI_LSB) & RX_INT_FILTER_RSSI_MASK) -#define RX_INT_FILTER_RATE_LOW_MSB 11 -#define RX_INT_FILTER_RATE_LOW_LSB 11 -#define RX_INT_FILTER_RATE_LOW_MASK 0x00000800 -#define RX_INT_FILTER_RATE_LOW_GET(x) (((x) & RX_INT_FILTER_RATE_LOW_MASK) >> RX_INT_FILTER_RATE_LOW_LSB) -#define RX_INT_FILTER_RATE_LOW_SET(x) (((x) << RX_INT_FILTER_RATE_LOW_LSB) & RX_INT_FILTER_RATE_LOW_MASK) -#define RX_INT_FILTER_RATE_HIGH_MSB 10 -#define RX_INT_FILTER_RATE_HIGH_LSB 10 -#define RX_INT_FILTER_RATE_HIGH_MASK 0x00000400 -#define RX_INT_FILTER_RATE_HIGH_GET(x) (((x) & RX_INT_FILTER_RATE_HIGH_MASK) >> RX_INT_FILTER_RATE_HIGH_LSB) -#define RX_INT_FILTER_RATE_HIGH_SET(x) (((x) << RX_INT_FILTER_RATE_HIGH_LSB) & RX_INT_FILTER_RATE_HIGH_MASK) -#define RX_INT_FILTER_MORE_FRAG_MSB 9 -#define RX_INT_FILTER_MORE_FRAG_LSB 9 -#define RX_INT_FILTER_MORE_FRAG_MASK 0x00000200 -#define RX_INT_FILTER_MORE_FRAG_GET(x) (((x) & RX_INT_FILTER_MORE_FRAG_MASK) >> RX_INT_FILTER_MORE_FRAG_LSB) -#define RX_INT_FILTER_MORE_FRAG_SET(x) (((x) << RX_INT_FILTER_MORE_FRAG_LSB) & RX_INT_FILTER_MORE_FRAG_MASK) -#define RX_INT_FILTER_MORE_DATA_MSB 8 -#define RX_INT_FILTER_MORE_DATA_LSB 8 -#define RX_INT_FILTER_MORE_DATA_MASK 0x00000100 -#define RX_INT_FILTER_MORE_DATA_GET(x) (((x) & RX_INT_FILTER_MORE_DATA_MASK) >> RX_INT_FILTER_MORE_DATA_LSB) -#define RX_INT_FILTER_MORE_DATA_SET(x) (((x) << RX_INT_FILTER_MORE_DATA_LSB) & RX_INT_FILTER_MORE_DATA_MASK) -#define RX_INT_FILTER_RETRY_MSB 7 -#define RX_INT_FILTER_RETRY_LSB 7 -#define RX_INT_FILTER_RETRY_MASK 0x00000080 -#define RX_INT_FILTER_RETRY_GET(x) (((x) & RX_INT_FILTER_RETRY_MASK) >> RX_INT_FILTER_RETRY_LSB) -#define RX_INT_FILTER_RETRY_SET(x) (((x) << RX_INT_FILTER_RETRY_LSB) & RX_INT_FILTER_RETRY_MASK) -#define RX_INT_FILTER_CTS_MSB 6 -#define RX_INT_FILTER_CTS_LSB 6 -#define RX_INT_FILTER_CTS_MASK 0x00000040 -#define RX_INT_FILTER_CTS_GET(x) (((x) & RX_INT_FILTER_CTS_MASK) >> RX_INT_FILTER_CTS_LSB) -#define RX_INT_FILTER_CTS_SET(x) (((x) << RX_INT_FILTER_CTS_LSB) & RX_INT_FILTER_CTS_MASK) -#define RX_INT_FILTER_ACK_MSB 5 -#define RX_INT_FILTER_ACK_LSB 5 -#define RX_INT_FILTER_ACK_MASK 0x00000020 -#define RX_INT_FILTER_ACK_GET(x) (((x) & RX_INT_FILTER_ACK_MASK) >> RX_INT_FILTER_ACK_LSB) -#define RX_INT_FILTER_ACK_SET(x) (((x) << RX_INT_FILTER_ACK_LSB) & RX_INT_FILTER_ACK_MASK) -#define RX_INT_FILTER_RTS_MSB 4 -#define RX_INT_FILTER_RTS_LSB 4 -#define RX_INT_FILTER_RTS_MASK 0x00000010 -#define RX_INT_FILTER_RTS_GET(x) (((x) & RX_INT_FILTER_RTS_MASK) >> RX_INT_FILTER_RTS_LSB) -#define RX_INT_FILTER_RTS_SET(x) (((x) << RX_INT_FILTER_RTS_LSB) & RX_INT_FILTER_RTS_MASK) -#define RX_INT_FILTER_MCAST_MSB 3 -#define RX_INT_FILTER_MCAST_LSB 3 -#define RX_INT_FILTER_MCAST_MASK 0x00000008 -#define RX_INT_FILTER_MCAST_GET(x) (((x) & RX_INT_FILTER_MCAST_MASK) >> RX_INT_FILTER_MCAST_LSB) -#define RX_INT_FILTER_MCAST_SET(x) (((x) << RX_INT_FILTER_MCAST_LSB) & RX_INT_FILTER_MCAST_MASK) -#define RX_INT_FILTER_BCAST_MSB 2 -#define RX_INT_FILTER_BCAST_LSB 2 -#define RX_INT_FILTER_BCAST_MASK 0x00000004 -#define RX_INT_FILTER_BCAST_GET(x) (((x) & RX_INT_FILTER_BCAST_MASK) >> RX_INT_FILTER_BCAST_LSB) -#define RX_INT_FILTER_BCAST_SET(x) (((x) << RX_INT_FILTER_BCAST_LSB) & RX_INT_FILTER_BCAST_MASK) -#define RX_INT_FILTER_DIRECTED_MSB 1 -#define RX_INT_FILTER_DIRECTED_LSB 1 -#define RX_INT_FILTER_DIRECTED_MASK 0x00000002 -#define RX_INT_FILTER_DIRECTED_GET(x) (((x) & RX_INT_FILTER_DIRECTED_MASK) >> RX_INT_FILTER_DIRECTED_LSB) -#define RX_INT_FILTER_DIRECTED_SET(x) (((x) << RX_INT_FILTER_DIRECTED_LSB) & RX_INT_FILTER_DIRECTED_MASK) -#define RX_INT_FILTER_ENABLE_MSB 0 -#define RX_INT_FILTER_ENABLE_LSB 0 -#define RX_INT_FILTER_ENABLE_MASK 0x00000001 -#define RX_INT_FILTER_ENABLE_GET(x) (((x) & RX_INT_FILTER_ENABLE_MASK) >> RX_INT_FILTER_ENABLE_LSB) -#define RX_INT_FILTER_ENABLE_SET(x) (((x) << RX_INT_FILTER_ENABLE_LSB) & RX_INT_FILTER_ENABLE_MASK) - -#define RX_INT_OVERFLOW_ADDRESS 0x00008368 -#define RX_INT_OVERFLOW_OFFSET 0x00000368 -#define RX_INT_OVERFLOW_STATUS_MSB 0 -#define RX_INT_OVERFLOW_STATUS_LSB 0 -#define RX_INT_OVERFLOW_STATUS_MASK 0x00000001 -#define RX_INT_OVERFLOW_STATUS_GET(x) (((x) & RX_INT_OVERFLOW_STATUS_MASK) >> RX_INT_OVERFLOW_STATUS_LSB) -#define RX_INT_OVERFLOW_STATUS_SET(x) (((x) << RX_INT_OVERFLOW_STATUS_LSB) & RX_INT_OVERFLOW_STATUS_MASK) - -#define RX_FILTER_THRESH_ADDRESS 0x0000836c -#define RX_FILTER_THRESH_OFFSET 0x0000036c -#define RX_FILTER_THRESH_RSSI_LOW_MSB 23 -#define RX_FILTER_THRESH_RSSI_LOW_LSB 16 -#define RX_FILTER_THRESH_RSSI_LOW_MASK 0x00ff0000 -#define RX_FILTER_THRESH_RSSI_LOW_GET(x) (((x) & RX_FILTER_THRESH_RSSI_LOW_MASK) >> RX_FILTER_THRESH_RSSI_LOW_LSB) -#define RX_FILTER_THRESH_RSSI_LOW_SET(x) (((x) << RX_FILTER_THRESH_RSSI_LOW_LSB) & RX_FILTER_THRESH_RSSI_LOW_MASK) -#define RX_FILTER_THRESH_RATE_LOW_MSB 15 -#define RX_FILTER_THRESH_RATE_LOW_LSB 8 -#define RX_FILTER_THRESH_RATE_LOW_MASK 0x0000ff00 -#define RX_FILTER_THRESH_RATE_LOW_GET(x) (((x) & RX_FILTER_THRESH_RATE_LOW_MASK) >> RX_FILTER_THRESH_RATE_LOW_LSB) -#define RX_FILTER_THRESH_RATE_LOW_SET(x) (((x) << RX_FILTER_THRESH_RATE_LOW_LSB) & RX_FILTER_THRESH_RATE_LOW_MASK) -#define RX_FILTER_THRESH_RATE_HIGH_MSB 7 -#define RX_FILTER_THRESH_RATE_HIGH_LSB 0 -#define RX_FILTER_THRESH_RATE_HIGH_MASK 0x000000ff -#define RX_FILTER_THRESH_RATE_HIGH_GET(x) (((x) & RX_FILTER_THRESH_RATE_HIGH_MASK) >> RX_FILTER_THRESH_RATE_HIGH_LSB) -#define RX_FILTER_THRESH_RATE_HIGH_SET(x) (((x) << RX_FILTER_THRESH_RATE_HIGH_LSB) & RX_FILTER_THRESH_RATE_HIGH_MASK) - -#define RX_FILTER_THRESH1_ADDRESS 0x00008370 -#define RX_FILTER_THRESH1_OFFSET 0x00000370 -#define RX_FILTER_THRESH1_LENGTH_LOW_MSB 23 -#define RX_FILTER_THRESH1_LENGTH_LOW_LSB 12 -#define RX_FILTER_THRESH1_LENGTH_LOW_MASK 0x00fff000 -#define RX_FILTER_THRESH1_LENGTH_LOW_GET(x) (((x) & RX_FILTER_THRESH1_LENGTH_LOW_MASK) >> RX_FILTER_THRESH1_LENGTH_LOW_LSB) -#define RX_FILTER_THRESH1_LENGTH_LOW_SET(x) (((x) << RX_FILTER_THRESH1_LENGTH_LOW_LSB) & RX_FILTER_THRESH1_LENGTH_LOW_MASK) -#define RX_FILTER_THRESH1_LENGTH_HIGH_MSB 11 -#define RX_FILTER_THRESH1_LENGTH_HIGH_LSB 0 -#define RX_FILTER_THRESH1_LENGTH_HIGH_MASK 0x00000fff -#define RX_FILTER_THRESH1_LENGTH_HIGH_GET(x) (((x) & RX_FILTER_THRESH1_LENGTH_HIGH_MASK) >> RX_FILTER_THRESH1_LENGTH_HIGH_LSB) -#define RX_FILTER_THRESH1_LENGTH_HIGH_SET(x) (((x) << RX_FILTER_THRESH1_LENGTH_HIGH_LSB) & RX_FILTER_THRESH1_LENGTH_HIGH_MASK) - -#define RX_PRIORITY_THRESH0_ADDRESS 0x00008374 -#define RX_PRIORITY_THRESH0_OFFSET 0x00000374 -#define RX_PRIORITY_THRESH0_RSSI_LOW_MSB 31 -#define RX_PRIORITY_THRESH0_RSSI_LOW_LSB 24 -#define RX_PRIORITY_THRESH0_RSSI_LOW_MASK 0xff000000 -#define RX_PRIORITY_THRESH0_RSSI_LOW_GET(x) (((x) & RX_PRIORITY_THRESH0_RSSI_LOW_MASK) >> RX_PRIORITY_THRESH0_RSSI_LOW_LSB) -#define RX_PRIORITY_THRESH0_RSSI_LOW_SET(x) (((x) << RX_PRIORITY_THRESH0_RSSI_LOW_LSB) & RX_PRIORITY_THRESH0_RSSI_LOW_MASK) -#define RX_PRIORITY_THRESH0_RSSI_HIGH_MSB 23 -#define RX_PRIORITY_THRESH0_RSSI_HIGH_LSB 16 -#define RX_PRIORITY_THRESH0_RSSI_HIGH_MASK 0x00ff0000 -#define RX_PRIORITY_THRESH0_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_THRESH0_RSSI_HIGH_MASK) >> RX_PRIORITY_THRESH0_RSSI_HIGH_LSB) -#define RX_PRIORITY_THRESH0_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_THRESH0_RSSI_HIGH_LSB) & RX_PRIORITY_THRESH0_RSSI_HIGH_MASK) -#define RX_PRIORITY_THRESH0_RATE_LOW_MSB 15 -#define RX_PRIORITY_THRESH0_RATE_LOW_LSB 8 -#define RX_PRIORITY_THRESH0_RATE_LOW_MASK 0x0000ff00 -#define RX_PRIORITY_THRESH0_RATE_LOW_GET(x) (((x) & RX_PRIORITY_THRESH0_RATE_LOW_MASK) >> RX_PRIORITY_THRESH0_RATE_LOW_LSB) -#define RX_PRIORITY_THRESH0_RATE_LOW_SET(x) (((x) << RX_PRIORITY_THRESH0_RATE_LOW_LSB) & RX_PRIORITY_THRESH0_RATE_LOW_MASK) -#define RX_PRIORITY_THRESH0_RATE_HIGH_MSB 7 -#define RX_PRIORITY_THRESH0_RATE_HIGH_LSB 0 -#define RX_PRIORITY_THRESH0_RATE_HIGH_MASK 0x000000ff -#define RX_PRIORITY_THRESH0_RATE_HIGH_GET(x) (((x) & RX_PRIORITY_THRESH0_RATE_HIGH_MASK) >> RX_PRIORITY_THRESH0_RATE_HIGH_LSB) -#define RX_PRIORITY_THRESH0_RATE_HIGH_SET(x) (((x) << RX_PRIORITY_THRESH0_RATE_HIGH_LSB) & RX_PRIORITY_THRESH0_RATE_HIGH_MASK) - -#define RX_PRIORITY_THRESH1_ADDRESS 0x00008378 -#define RX_PRIORITY_THRESH1_OFFSET 0x00000378 -#define RX_PRIORITY_THRESH1_XCAST_RSSI_HIGH_MSB 31 -#define RX_PRIORITY_THRESH1_XCAST_RSSI_HIGH_LSB 24 -#define RX_PRIORITY_THRESH1_XCAST_RSSI_HIGH_MASK 0xff000000 -#define RX_PRIORITY_THRESH1_XCAST_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_THRESH1_XCAST_RSSI_HIGH_MASK) >> RX_PRIORITY_THRESH1_XCAST_RSSI_HIGH_LSB) -#define RX_PRIORITY_THRESH1_XCAST_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_THRESH1_XCAST_RSSI_HIGH_LSB) & RX_PRIORITY_THRESH1_XCAST_RSSI_HIGH_MASK) -#define RX_PRIORITY_THRESH1_LENGTH_LOW_MSB 23 -#define RX_PRIORITY_THRESH1_LENGTH_LOW_LSB 12 -#define RX_PRIORITY_THRESH1_LENGTH_LOW_MASK 0x00fff000 -#define RX_PRIORITY_THRESH1_LENGTH_LOW_GET(x) (((x) & RX_PRIORITY_THRESH1_LENGTH_LOW_MASK) >> RX_PRIORITY_THRESH1_LENGTH_LOW_LSB) -#define RX_PRIORITY_THRESH1_LENGTH_LOW_SET(x) (((x) << RX_PRIORITY_THRESH1_LENGTH_LOW_LSB) & RX_PRIORITY_THRESH1_LENGTH_LOW_MASK) -#define RX_PRIORITY_THRESH1_LENGTH_HIGH_MSB 11 -#define RX_PRIORITY_THRESH1_LENGTH_HIGH_LSB 0 -#define RX_PRIORITY_THRESH1_LENGTH_HIGH_MASK 0x00000fff -#define RX_PRIORITY_THRESH1_LENGTH_HIGH_GET(x) (((x) & RX_PRIORITY_THRESH1_LENGTH_HIGH_MASK) >> RX_PRIORITY_THRESH1_LENGTH_HIGH_LSB) -#define RX_PRIORITY_THRESH1_LENGTH_HIGH_SET(x) (((x) << RX_PRIORITY_THRESH1_LENGTH_HIGH_LSB) & RX_PRIORITY_THRESH1_LENGTH_HIGH_MASK) - -#define RX_PRIORITY_THRESH2_ADDRESS 0x0000837c -#define RX_PRIORITY_THRESH2_OFFSET 0x0000037c -#define RX_PRIORITY_THRESH2_NULL_RSSI_HIGH_MSB 31 -#define RX_PRIORITY_THRESH2_NULL_RSSI_HIGH_LSB 24 -#define RX_PRIORITY_THRESH2_NULL_RSSI_HIGH_MASK 0xff000000 -#define RX_PRIORITY_THRESH2_NULL_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_THRESH2_NULL_RSSI_HIGH_MASK) >> RX_PRIORITY_THRESH2_NULL_RSSI_HIGH_LSB) -#define RX_PRIORITY_THRESH2_NULL_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_THRESH2_NULL_RSSI_HIGH_LSB) & RX_PRIORITY_THRESH2_NULL_RSSI_HIGH_MASK) -#define RX_PRIORITY_THRESH2_BEACON_RSSI_HIGH_MSB 23 -#define RX_PRIORITY_THRESH2_BEACON_RSSI_HIGH_LSB 16 -#define RX_PRIORITY_THRESH2_BEACON_RSSI_HIGH_MASK 0x00ff0000 -#define RX_PRIORITY_THRESH2_BEACON_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_THRESH2_BEACON_RSSI_HIGH_MASK) >> RX_PRIORITY_THRESH2_BEACON_RSSI_HIGH_LSB) -#define RX_PRIORITY_THRESH2_BEACON_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_THRESH2_BEACON_RSSI_HIGH_LSB) & RX_PRIORITY_THRESH2_BEACON_RSSI_HIGH_MASK) -#define RX_PRIORITY_THRESH2_MGMT_RSSI_HIGH_MSB 15 -#define RX_PRIORITY_THRESH2_MGMT_RSSI_HIGH_LSB 8 -#define RX_PRIORITY_THRESH2_MGMT_RSSI_HIGH_MASK 0x0000ff00 -#define RX_PRIORITY_THRESH2_MGMT_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_THRESH2_MGMT_RSSI_HIGH_MASK) >> RX_PRIORITY_THRESH2_MGMT_RSSI_HIGH_LSB) -#define RX_PRIORITY_THRESH2_MGMT_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_THRESH2_MGMT_RSSI_HIGH_LSB) & RX_PRIORITY_THRESH2_MGMT_RSSI_HIGH_MASK) -#define RX_PRIORITY_THRESH2_PRESP_RSSI_HIGH_MSB 7 -#define RX_PRIORITY_THRESH2_PRESP_RSSI_HIGH_LSB 0 -#define RX_PRIORITY_THRESH2_PRESP_RSSI_HIGH_MASK 0x000000ff -#define RX_PRIORITY_THRESH2_PRESP_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_THRESH2_PRESP_RSSI_HIGH_MASK) >> RX_PRIORITY_THRESH2_PRESP_RSSI_HIGH_LSB) -#define RX_PRIORITY_THRESH2_PRESP_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_THRESH2_PRESP_RSSI_HIGH_LSB) & RX_PRIORITY_THRESH2_PRESP_RSSI_HIGH_MASK) - -#define RX_PRIORITY_THRESH3_ADDRESS 0x00008380 -#define RX_PRIORITY_THRESH3_OFFSET 0x00000380 -#define RX_PRIORITY_THRESH3_PS_POLL_RSSI_HIGH_MSB 15 -#define RX_PRIORITY_THRESH3_PS_POLL_RSSI_HIGH_LSB 8 -#define RX_PRIORITY_THRESH3_PS_POLL_RSSI_HIGH_MASK 0x0000ff00 -#define RX_PRIORITY_THRESH3_PS_POLL_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_THRESH3_PS_POLL_RSSI_HIGH_MASK) >> RX_PRIORITY_THRESH3_PS_POLL_RSSI_HIGH_LSB) -#define RX_PRIORITY_THRESH3_PS_POLL_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_THRESH3_PS_POLL_RSSI_HIGH_LSB) & RX_PRIORITY_THRESH3_PS_POLL_RSSI_HIGH_MASK) -#define RX_PRIORITY_THRESH3_PREQ_RSSI_HIGH_MSB 7 -#define RX_PRIORITY_THRESH3_PREQ_RSSI_HIGH_LSB 0 -#define RX_PRIORITY_THRESH3_PREQ_RSSI_HIGH_MASK 0x000000ff -#define RX_PRIORITY_THRESH3_PREQ_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_THRESH3_PREQ_RSSI_HIGH_MASK) >> RX_PRIORITY_THRESH3_PREQ_RSSI_HIGH_LSB) -#define RX_PRIORITY_THRESH3_PREQ_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_THRESH3_PREQ_RSSI_HIGH_LSB) & RX_PRIORITY_THRESH3_PREQ_RSSI_HIGH_MASK) - -#define RX_PRIORITY_OFFSET0_ADDRESS 0x00008384 -#define RX_PRIORITY_OFFSET0_OFFSET 0x00000384 -#define RX_PRIORITY_OFFSET0_XCAST_RSSI_HIGH_MSB 29 -#define RX_PRIORITY_OFFSET0_XCAST_RSSI_HIGH_LSB 24 -#define RX_PRIORITY_OFFSET0_XCAST_RSSI_HIGH_MASK 0x3f000000 -#define RX_PRIORITY_OFFSET0_XCAST_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_OFFSET0_XCAST_RSSI_HIGH_MASK) >> RX_PRIORITY_OFFSET0_XCAST_RSSI_HIGH_LSB) -#define RX_PRIORITY_OFFSET0_XCAST_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_OFFSET0_XCAST_RSSI_HIGH_LSB) & RX_PRIORITY_OFFSET0_XCAST_RSSI_HIGH_MASK) -#define RX_PRIORITY_OFFSET0_RSSI_LOW_MSB 23 -#define RX_PRIORITY_OFFSET0_RSSI_LOW_LSB 18 -#define RX_PRIORITY_OFFSET0_RSSI_LOW_MASK 0x00fc0000 -#define RX_PRIORITY_OFFSET0_RSSI_LOW_GET(x) (((x) & RX_PRIORITY_OFFSET0_RSSI_LOW_MASK) >> RX_PRIORITY_OFFSET0_RSSI_LOW_LSB) -#define RX_PRIORITY_OFFSET0_RSSI_LOW_SET(x) (((x) << RX_PRIORITY_OFFSET0_RSSI_LOW_LSB) & RX_PRIORITY_OFFSET0_RSSI_LOW_MASK) -#define RX_PRIORITY_OFFSET0_RSSI_HIGH_MSB 17 -#define RX_PRIORITY_OFFSET0_RSSI_HIGH_LSB 12 -#define RX_PRIORITY_OFFSET0_RSSI_HIGH_MASK 0x0003f000 -#define RX_PRIORITY_OFFSET0_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_OFFSET0_RSSI_HIGH_MASK) >> RX_PRIORITY_OFFSET0_RSSI_HIGH_LSB) -#define RX_PRIORITY_OFFSET0_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_OFFSET0_RSSI_HIGH_LSB) & RX_PRIORITY_OFFSET0_RSSI_HIGH_MASK) -#define RX_PRIORITY_OFFSET0_PHY_RATE_LOW_MSB 11 -#define RX_PRIORITY_OFFSET0_PHY_RATE_LOW_LSB 6 -#define RX_PRIORITY_OFFSET0_PHY_RATE_LOW_MASK 0x00000fc0 -#define RX_PRIORITY_OFFSET0_PHY_RATE_LOW_GET(x) (((x) & RX_PRIORITY_OFFSET0_PHY_RATE_LOW_MASK) >> RX_PRIORITY_OFFSET0_PHY_RATE_LOW_LSB) -#define RX_PRIORITY_OFFSET0_PHY_RATE_LOW_SET(x) (((x) << RX_PRIORITY_OFFSET0_PHY_RATE_LOW_LSB) & RX_PRIORITY_OFFSET0_PHY_RATE_LOW_MASK) -#define RX_PRIORITY_OFFSET0_PHY_RATE_HIGH_MSB 5 -#define RX_PRIORITY_OFFSET0_PHY_RATE_HIGH_LSB 0 -#define RX_PRIORITY_OFFSET0_PHY_RATE_HIGH_MASK 0x0000003f -#define RX_PRIORITY_OFFSET0_PHY_RATE_HIGH_GET(x) (((x) & RX_PRIORITY_OFFSET0_PHY_RATE_HIGH_MASK) >> RX_PRIORITY_OFFSET0_PHY_RATE_HIGH_LSB) -#define RX_PRIORITY_OFFSET0_PHY_RATE_HIGH_SET(x) (((x) << RX_PRIORITY_OFFSET0_PHY_RATE_HIGH_LSB) & RX_PRIORITY_OFFSET0_PHY_RATE_HIGH_MASK) - -#define RX_PRIORITY_OFFSET1_ADDRESS 0x00008388 -#define RX_PRIORITY_OFFSET1_OFFSET 0x00000388 -#define RX_PRIORITY_OFFSET1_RTS_MSB 29 -#define RX_PRIORITY_OFFSET1_RTS_LSB 24 -#define RX_PRIORITY_OFFSET1_RTS_MASK 0x3f000000 -#define RX_PRIORITY_OFFSET1_RTS_GET(x) (((x) & RX_PRIORITY_OFFSET1_RTS_MASK) >> RX_PRIORITY_OFFSET1_RTS_LSB) -#define RX_PRIORITY_OFFSET1_RTS_SET(x) (((x) << RX_PRIORITY_OFFSET1_RTS_LSB) & RX_PRIORITY_OFFSET1_RTS_MASK) -#define RX_PRIORITY_OFFSET1_RETX_MSB 23 -#define RX_PRIORITY_OFFSET1_RETX_LSB 18 -#define RX_PRIORITY_OFFSET1_RETX_MASK 0x00fc0000 -#define RX_PRIORITY_OFFSET1_RETX_GET(x) (((x) & RX_PRIORITY_OFFSET1_RETX_MASK) >> RX_PRIORITY_OFFSET1_RETX_LSB) -#define RX_PRIORITY_OFFSET1_RETX_SET(x) (((x) << RX_PRIORITY_OFFSET1_RETX_LSB) & RX_PRIORITY_OFFSET1_RETX_MASK) -#define RX_PRIORITY_OFFSET1_PRESP_RSSI_HIGH_MSB 17 -#define RX_PRIORITY_OFFSET1_PRESP_RSSI_HIGH_LSB 12 -#define RX_PRIORITY_OFFSET1_PRESP_RSSI_HIGH_MASK 0x0003f000 -#define RX_PRIORITY_OFFSET1_PRESP_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_OFFSET1_PRESP_RSSI_HIGH_MASK) >> RX_PRIORITY_OFFSET1_PRESP_RSSI_HIGH_LSB) -#define RX_PRIORITY_OFFSET1_PRESP_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_OFFSET1_PRESP_RSSI_HIGH_LSB) & RX_PRIORITY_OFFSET1_PRESP_RSSI_HIGH_MASK) -#define RX_PRIORITY_OFFSET1_LENGTH_LOW_MSB 11 -#define RX_PRIORITY_OFFSET1_LENGTH_LOW_LSB 6 -#define RX_PRIORITY_OFFSET1_LENGTH_LOW_MASK 0x00000fc0 -#define RX_PRIORITY_OFFSET1_LENGTH_LOW_GET(x) (((x) & RX_PRIORITY_OFFSET1_LENGTH_LOW_MASK) >> RX_PRIORITY_OFFSET1_LENGTH_LOW_LSB) -#define RX_PRIORITY_OFFSET1_LENGTH_LOW_SET(x) (((x) << RX_PRIORITY_OFFSET1_LENGTH_LOW_LSB) & RX_PRIORITY_OFFSET1_LENGTH_LOW_MASK) -#define RX_PRIORITY_OFFSET1_LENGTH_HIGH_MSB 5 -#define RX_PRIORITY_OFFSET1_LENGTH_HIGH_LSB 0 -#define RX_PRIORITY_OFFSET1_LENGTH_HIGH_MASK 0x0000003f -#define RX_PRIORITY_OFFSET1_LENGTH_HIGH_GET(x) (((x) & RX_PRIORITY_OFFSET1_LENGTH_HIGH_MASK) >> RX_PRIORITY_OFFSET1_LENGTH_HIGH_LSB) -#define RX_PRIORITY_OFFSET1_LENGTH_HIGH_SET(x) (((x) << RX_PRIORITY_OFFSET1_LENGTH_HIGH_LSB) & RX_PRIORITY_OFFSET1_LENGTH_HIGH_MASK) - -#define RX_PRIORITY_OFFSET2_ADDRESS 0x0000838c -#define RX_PRIORITY_OFFSET2_OFFSET 0x0000038c -#define RX_PRIORITY_OFFSET2_BEACON_MSB 29 -#define RX_PRIORITY_OFFSET2_BEACON_LSB 24 -#define RX_PRIORITY_OFFSET2_BEACON_MASK 0x3f000000 -#define RX_PRIORITY_OFFSET2_BEACON_GET(x) (((x) & RX_PRIORITY_OFFSET2_BEACON_MASK) >> RX_PRIORITY_OFFSET2_BEACON_LSB) -#define RX_PRIORITY_OFFSET2_BEACON_SET(x) (((x) << RX_PRIORITY_OFFSET2_BEACON_LSB) & RX_PRIORITY_OFFSET2_BEACON_MASK) -#define RX_PRIORITY_OFFSET2_MGMT_MSB 23 -#define RX_PRIORITY_OFFSET2_MGMT_LSB 18 -#define RX_PRIORITY_OFFSET2_MGMT_MASK 0x00fc0000 -#define RX_PRIORITY_OFFSET2_MGMT_GET(x) (((x) & RX_PRIORITY_OFFSET2_MGMT_MASK) >> RX_PRIORITY_OFFSET2_MGMT_LSB) -#define RX_PRIORITY_OFFSET2_MGMT_SET(x) (((x) << RX_PRIORITY_OFFSET2_MGMT_LSB) & RX_PRIORITY_OFFSET2_MGMT_MASK) -#define RX_PRIORITY_OFFSET2_ATIM_MSB 17 -#define RX_PRIORITY_OFFSET2_ATIM_LSB 12 -#define RX_PRIORITY_OFFSET2_ATIM_MASK 0x0003f000 -#define RX_PRIORITY_OFFSET2_ATIM_GET(x) (((x) & RX_PRIORITY_OFFSET2_ATIM_MASK) >> RX_PRIORITY_OFFSET2_ATIM_LSB) -#define RX_PRIORITY_OFFSET2_ATIM_SET(x) (((x) << RX_PRIORITY_OFFSET2_ATIM_LSB) & RX_PRIORITY_OFFSET2_ATIM_MASK) -#define RX_PRIORITY_OFFSET2_PRESP_MSB 11 -#define RX_PRIORITY_OFFSET2_PRESP_LSB 6 -#define RX_PRIORITY_OFFSET2_PRESP_MASK 0x00000fc0 -#define RX_PRIORITY_OFFSET2_PRESP_GET(x) (((x) & RX_PRIORITY_OFFSET2_PRESP_MASK) >> RX_PRIORITY_OFFSET2_PRESP_LSB) -#define RX_PRIORITY_OFFSET2_PRESP_SET(x) (((x) << RX_PRIORITY_OFFSET2_PRESP_LSB) & RX_PRIORITY_OFFSET2_PRESP_MASK) -#define RX_PRIORITY_OFFSET2_XCAST_MSB 5 -#define RX_PRIORITY_OFFSET2_XCAST_LSB 0 -#define RX_PRIORITY_OFFSET2_XCAST_MASK 0x0000003f -#define RX_PRIORITY_OFFSET2_XCAST_GET(x) (((x) & RX_PRIORITY_OFFSET2_XCAST_MASK) >> RX_PRIORITY_OFFSET2_XCAST_LSB) -#define RX_PRIORITY_OFFSET2_XCAST_SET(x) (((x) << RX_PRIORITY_OFFSET2_XCAST_LSB) & RX_PRIORITY_OFFSET2_XCAST_MASK) - -#define RX_PRIORITY_OFFSET3_ADDRESS 0x00008390 -#define RX_PRIORITY_OFFSET3_OFFSET 0x00000390 -#define RX_PRIORITY_OFFSET3_PS_POLL_MSB 29 -#define RX_PRIORITY_OFFSET3_PS_POLL_LSB 24 -#define RX_PRIORITY_OFFSET3_PS_POLL_MASK 0x3f000000 -#define RX_PRIORITY_OFFSET3_PS_POLL_GET(x) (((x) & RX_PRIORITY_OFFSET3_PS_POLL_MASK) >> RX_PRIORITY_OFFSET3_PS_POLL_LSB) -#define RX_PRIORITY_OFFSET3_PS_POLL_SET(x) (((x) << RX_PRIORITY_OFFSET3_PS_POLL_LSB) & RX_PRIORITY_OFFSET3_PS_POLL_MASK) -#define RX_PRIORITY_OFFSET3_AMSDU_MSB 23 -#define RX_PRIORITY_OFFSET3_AMSDU_LSB 18 -#define RX_PRIORITY_OFFSET3_AMSDU_MASK 0x00fc0000 -#define RX_PRIORITY_OFFSET3_AMSDU_GET(x) (((x) & RX_PRIORITY_OFFSET3_AMSDU_MASK) >> RX_PRIORITY_OFFSET3_AMSDU_LSB) -#define RX_PRIORITY_OFFSET3_AMSDU_SET(x) (((x) << RX_PRIORITY_OFFSET3_AMSDU_LSB) & RX_PRIORITY_OFFSET3_AMSDU_MASK) -#define RX_PRIORITY_OFFSET3_AMPDU_MSB 17 -#define RX_PRIORITY_OFFSET3_AMPDU_LSB 12 -#define RX_PRIORITY_OFFSET3_AMPDU_MASK 0x0003f000 -#define RX_PRIORITY_OFFSET3_AMPDU_GET(x) (((x) & RX_PRIORITY_OFFSET3_AMPDU_MASK) >> RX_PRIORITY_OFFSET3_AMPDU_LSB) -#define RX_PRIORITY_OFFSET3_AMPDU_SET(x) (((x) << RX_PRIORITY_OFFSET3_AMPDU_LSB) & RX_PRIORITY_OFFSET3_AMPDU_MASK) -#define RX_PRIORITY_OFFSET3_EOSP_MSB 11 -#define RX_PRIORITY_OFFSET3_EOSP_LSB 6 -#define RX_PRIORITY_OFFSET3_EOSP_MASK 0x00000fc0 -#define RX_PRIORITY_OFFSET3_EOSP_GET(x) (((x) & RX_PRIORITY_OFFSET3_EOSP_MASK) >> RX_PRIORITY_OFFSET3_EOSP_LSB) -#define RX_PRIORITY_OFFSET3_EOSP_SET(x) (((x) << RX_PRIORITY_OFFSET3_EOSP_LSB) & RX_PRIORITY_OFFSET3_EOSP_MASK) -#define RX_PRIORITY_OFFSET3_MORE_MSB 5 -#define RX_PRIORITY_OFFSET3_MORE_LSB 0 -#define RX_PRIORITY_OFFSET3_MORE_MASK 0x0000003f -#define RX_PRIORITY_OFFSET3_MORE_GET(x) (((x) & RX_PRIORITY_OFFSET3_MORE_MASK) >> RX_PRIORITY_OFFSET3_MORE_LSB) -#define RX_PRIORITY_OFFSET3_MORE_SET(x) (((x) << RX_PRIORITY_OFFSET3_MORE_LSB) & RX_PRIORITY_OFFSET3_MORE_MASK) - -#define RX_PRIORITY_OFFSET4_ADDRESS 0x00008394 -#define RX_PRIORITY_OFFSET4_OFFSET 0x00000394 -#define RX_PRIORITY_OFFSET4_BEACON_RSSI_HIGH_MSB 29 -#define RX_PRIORITY_OFFSET4_BEACON_RSSI_HIGH_LSB 24 -#define RX_PRIORITY_OFFSET4_BEACON_RSSI_HIGH_MASK 0x3f000000 -#define RX_PRIORITY_OFFSET4_BEACON_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_OFFSET4_BEACON_RSSI_HIGH_MASK) >> RX_PRIORITY_OFFSET4_BEACON_RSSI_HIGH_LSB) -#define RX_PRIORITY_OFFSET4_BEACON_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_OFFSET4_BEACON_RSSI_HIGH_LSB) & RX_PRIORITY_OFFSET4_BEACON_RSSI_HIGH_MASK) -#define RX_PRIORITY_OFFSET4_MGMT_RSSI_HIGH_MSB 23 -#define RX_PRIORITY_OFFSET4_MGMT_RSSI_HIGH_LSB 18 -#define RX_PRIORITY_OFFSET4_MGMT_RSSI_HIGH_MASK 0x00fc0000 -#define RX_PRIORITY_OFFSET4_MGMT_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_OFFSET4_MGMT_RSSI_HIGH_MASK) >> RX_PRIORITY_OFFSET4_MGMT_RSSI_HIGH_LSB) -#define RX_PRIORITY_OFFSET4_MGMT_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_OFFSET4_MGMT_RSSI_HIGH_LSB) & RX_PRIORITY_OFFSET4_MGMT_RSSI_HIGH_MASK) -#define RX_PRIORITY_OFFSET4_BEACON_SSID_MSB 17 -#define RX_PRIORITY_OFFSET4_BEACON_SSID_LSB 12 -#define RX_PRIORITY_OFFSET4_BEACON_SSID_MASK 0x0003f000 -#define RX_PRIORITY_OFFSET4_BEACON_SSID_GET(x) (((x) & RX_PRIORITY_OFFSET4_BEACON_SSID_MASK) >> RX_PRIORITY_OFFSET4_BEACON_SSID_LSB) -#define RX_PRIORITY_OFFSET4_BEACON_SSID_SET(x) (((x) << RX_PRIORITY_OFFSET4_BEACON_SSID_LSB) & RX_PRIORITY_OFFSET4_BEACON_SSID_MASK) -#define RX_PRIORITY_OFFSET4_NULL_MSB 11 -#define RX_PRIORITY_OFFSET4_NULL_LSB 6 -#define RX_PRIORITY_OFFSET4_NULL_MASK 0x00000fc0 -#define RX_PRIORITY_OFFSET4_NULL_GET(x) (((x) & RX_PRIORITY_OFFSET4_NULL_MASK) >> RX_PRIORITY_OFFSET4_NULL_LSB) -#define RX_PRIORITY_OFFSET4_NULL_SET(x) (((x) << RX_PRIORITY_OFFSET4_NULL_LSB) & RX_PRIORITY_OFFSET4_NULL_MASK) -#define RX_PRIORITY_OFFSET4_PREQ_MSB 5 -#define RX_PRIORITY_OFFSET4_PREQ_LSB 0 -#define RX_PRIORITY_OFFSET4_PREQ_MASK 0x0000003f -#define RX_PRIORITY_OFFSET4_PREQ_GET(x) (((x) & RX_PRIORITY_OFFSET4_PREQ_MASK) >> RX_PRIORITY_OFFSET4_PREQ_LSB) -#define RX_PRIORITY_OFFSET4_PREQ_SET(x) (((x) << RX_PRIORITY_OFFSET4_PREQ_LSB) & RX_PRIORITY_OFFSET4_PREQ_MASK) - -#define RX_PRIORITY_OFFSET5_ADDRESS 0x00008398 -#define RX_PRIORITY_OFFSET5_OFFSET 0x00000398 -#define RX_PRIORITY_OFFSET5_PS_POLL_RSSI_HIGH_MSB 17 -#define RX_PRIORITY_OFFSET5_PS_POLL_RSSI_HIGH_LSB 12 -#define RX_PRIORITY_OFFSET5_PS_POLL_RSSI_HIGH_MASK 0x0003f000 -#define RX_PRIORITY_OFFSET5_PS_POLL_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_OFFSET5_PS_POLL_RSSI_HIGH_MASK) >> RX_PRIORITY_OFFSET5_PS_POLL_RSSI_HIGH_LSB) -#define RX_PRIORITY_OFFSET5_PS_POLL_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_OFFSET5_PS_POLL_RSSI_HIGH_LSB) & RX_PRIORITY_OFFSET5_PS_POLL_RSSI_HIGH_MASK) -#define RX_PRIORITY_OFFSET5_PREQ_RSSI_HIGH_MSB 11 -#define RX_PRIORITY_OFFSET5_PREQ_RSSI_HIGH_LSB 6 -#define RX_PRIORITY_OFFSET5_PREQ_RSSI_HIGH_MASK 0x00000fc0 -#define RX_PRIORITY_OFFSET5_PREQ_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_OFFSET5_PREQ_RSSI_HIGH_MASK) >> RX_PRIORITY_OFFSET5_PREQ_RSSI_HIGH_LSB) -#define RX_PRIORITY_OFFSET5_PREQ_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_OFFSET5_PREQ_RSSI_HIGH_LSB) & RX_PRIORITY_OFFSET5_PREQ_RSSI_HIGH_MASK) -#define RX_PRIORITY_OFFSET5_NULL_RSSI_HIGH_MSB 5 -#define RX_PRIORITY_OFFSET5_NULL_RSSI_HIGH_LSB 0 -#define RX_PRIORITY_OFFSET5_NULL_RSSI_HIGH_MASK 0x0000003f -#define RX_PRIORITY_OFFSET5_NULL_RSSI_HIGH_GET(x) (((x) & RX_PRIORITY_OFFSET5_NULL_RSSI_HIGH_MASK) >> RX_PRIORITY_OFFSET5_NULL_RSSI_HIGH_LSB) -#define RX_PRIORITY_OFFSET5_NULL_RSSI_HIGH_SET(x) (((x) << RX_PRIORITY_OFFSET5_NULL_RSSI_HIGH_LSB) & RX_PRIORITY_OFFSET5_NULL_RSSI_HIGH_MASK) - -#define MAC_PCU_BSSID2_L32_ADDRESS 0x0000839c -#define MAC_PCU_BSSID2_L32_OFFSET 0x0000039c -#define MAC_PCU_BSSID2_L32_ADDR_MSB 31 -#define MAC_PCU_BSSID2_L32_ADDR_LSB 0 -#define MAC_PCU_BSSID2_L32_ADDR_MASK 0xffffffff -#define MAC_PCU_BSSID2_L32_ADDR_GET(x) (((x) & MAC_PCU_BSSID2_L32_ADDR_MASK) >> MAC_PCU_BSSID2_L32_ADDR_LSB) -#define MAC_PCU_BSSID2_L32_ADDR_SET(x) (((x) << MAC_PCU_BSSID2_L32_ADDR_LSB) & MAC_PCU_BSSID2_L32_ADDR_MASK) - -#define MAC_PCU_BSSID2_U16_ADDRESS 0x000083a0 -#define MAC_PCU_BSSID2_U16_OFFSET 0x000003a0 -#define MAC_PCU_BSSID2_U16_ENABLE_MSB 16 -#define MAC_PCU_BSSID2_U16_ENABLE_LSB 16 -#define MAC_PCU_BSSID2_U16_ENABLE_MASK 0x00010000 -#define MAC_PCU_BSSID2_U16_ENABLE_GET(x) (((x) & MAC_PCU_BSSID2_U16_ENABLE_MASK) >> MAC_PCU_BSSID2_U16_ENABLE_LSB) -#define MAC_PCU_BSSID2_U16_ENABLE_SET(x) (((x) << MAC_PCU_BSSID2_U16_ENABLE_LSB) & MAC_PCU_BSSID2_U16_ENABLE_MASK) -#define MAC_PCU_BSSID2_U16_ADDR_MSB 15 -#define MAC_PCU_BSSID2_U16_ADDR_LSB 0 -#define MAC_PCU_BSSID2_U16_ADDR_MASK 0x0000ffff -#define MAC_PCU_BSSID2_U16_ADDR_GET(x) (((x) & MAC_PCU_BSSID2_U16_ADDR_MASK) >> MAC_PCU_BSSID2_U16_ADDR_LSB) -#define MAC_PCU_BSSID2_U16_ADDR_SET(x) (((x) << MAC_PCU_BSSID2_U16_ADDR_LSB) & MAC_PCU_BSSID2_U16_ADDR_MASK) - -#define MAC_PCU_TSF1_STATUS_L32_ADDRESS 0x000083a4 -#define MAC_PCU_TSF1_STATUS_L32_OFFSET 0x000003a4 -#define MAC_PCU_TSF1_STATUS_L32_VALUE_MSB 31 -#define MAC_PCU_TSF1_STATUS_L32_VALUE_LSB 0 -#define MAC_PCU_TSF1_STATUS_L32_VALUE_MASK 0xffffffff -#define MAC_PCU_TSF1_STATUS_L32_VALUE_GET(x) (((x) & MAC_PCU_TSF1_STATUS_L32_VALUE_MASK) >> MAC_PCU_TSF1_STATUS_L32_VALUE_LSB) -#define MAC_PCU_TSF1_STATUS_L32_VALUE_SET(x) (((x) << MAC_PCU_TSF1_STATUS_L32_VALUE_LSB) & MAC_PCU_TSF1_STATUS_L32_VALUE_MASK) - -#define MAC_PCU_TSF1_STATUS_U32_ADDRESS 0x000083a8 -#define MAC_PCU_TSF1_STATUS_U32_OFFSET 0x000003a8 -#define MAC_PCU_TSF1_STATUS_U32_VALUE_MSB 31 -#define MAC_PCU_TSF1_STATUS_U32_VALUE_LSB 0 -#define MAC_PCU_TSF1_STATUS_U32_VALUE_MASK 0xffffffff -#define MAC_PCU_TSF1_STATUS_U32_VALUE_GET(x) (((x) & MAC_PCU_TSF1_STATUS_U32_VALUE_MASK) >> MAC_PCU_TSF1_STATUS_U32_VALUE_LSB) -#define MAC_PCU_TSF1_STATUS_U32_VALUE_SET(x) (((x) << MAC_PCU_TSF1_STATUS_U32_VALUE_LSB) & MAC_PCU_TSF1_STATUS_U32_VALUE_MASK) - -#define MAC_PCU_TSF2_STATUS_L32_ADDRESS 0x000083ac -#define MAC_PCU_TSF2_STATUS_L32_OFFSET 0x000003ac -#define MAC_PCU_TSF2_STATUS_L32_VALUE_MSB 31 -#define MAC_PCU_TSF2_STATUS_L32_VALUE_LSB 0 -#define MAC_PCU_TSF2_STATUS_L32_VALUE_MASK 0xffffffff -#define MAC_PCU_TSF2_STATUS_L32_VALUE_GET(x) (((x) & MAC_PCU_TSF2_STATUS_L32_VALUE_MASK) >> MAC_PCU_TSF2_STATUS_L32_VALUE_LSB) -#define MAC_PCU_TSF2_STATUS_L32_VALUE_SET(x) (((x) << MAC_PCU_TSF2_STATUS_L32_VALUE_LSB) & MAC_PCU_TSF2_STATUS_L32_VALUE_MASK) - -#define MAC_PCU_TSF2_STATUS_U32_ADDRESS 0x000083b0 -#define MAC_PCU_TSF2_STATUS_U32_OFFSET 0x000003b0 -#define MAC_PCU_TSF2_STATUS_U32_VALUE_MSB 31 -#define MAC_PCU_TSF2_STATUS_U32_VALUE_LSB 0 -#define MAC_PCU_TSF2_STATUS_U32_VALUE_MASK 0xffffffff -#define MAC_PCU_TSF2_STATUS_U32_VALUE_GET(x) (((x) & MAC_PCU_TSF2_STATUS_U32_VALUE_MASK) >> MAC_PCU_TSF2_STATUS_U32_VALUE_LSB) -#define MAC_PCU_TSF2_STATUS_U32_VALUE_SET(x) (((x) << MAC_PCU_TSF2_STATUS_U32_VALUE_LSB) & MAC_PCU_TSF2_STATUS_U32_VALUE_MASK) - -#define MAC_PCU_TXBUF_BA_ADDRESS 0x00008400 -#define MAC_PCU_TXBUF_BA_OFFSET 0x00000400 -#define MAC_PCU_TXBUF_BA_DATA_MSB 31 -#define MAC_PCU_TXBUF_BA_DATA_LSB 0 -#define MAC_PCU_TXBUF_BA_DATA_MASK 0xffffffff -#define MAC_PCU_TXBUF_BA_DATA_GET(x) (((x) & MAC_PCU_TXBUF_BA_DATA_MASK) >> MAC_PCU_TXBUF_BA_DATA_LSB) -#define MAC_PCU_TXBUF_BA_DATA_SET(x) (((x) << MAC_PCU_TXBUF_BA_DATA_LSB) & MAC_PCU_TXBUF_BA_DATA_MASK) - -#define MAC_PCU_KEY_CACHE_1_ADDRESS 0x00008800 -#define MAC_PCU_KEY_CACHE_1_OFFSET 0x00000800 -#define MAC_PCU_KEY_CACHE_1_DATA_MSB 31 -#define MAC_PCU_KEY_CACHE_1_DATA_LSB 0 -#define MAC_PCU_KEY_CACHE_1_DATA_MASK 0xffffffff -#define MAC_PCU_KEY_CACHE_1_DATA_GET(x) (((x) & MAC_PCU_KEY_CACHE_1_DATA_MASK) >> MAC_PCU_KEY_CACHE_1_DATA_LSB) -#define MAC_PCU_KEY_CACHE_1_DATA_SET(x) (((x) << MAC_PCU_KEY_CACHE_1_DATA_LSB) & MAC_PCU_KEY_CACHE_1_DATA_MASK) - -#define MAC_PCU_BASEBAND_0_ADDRESS 0x00009800 -#define MAC_PCU_BASEBAND_0_OFFSET 0x00001800 -#define MAC_PCU_BASEBAND_0_DATA_MSB 31 -#define MAC_PCU_BASEBAND_0_DATA_LSB 0 -#define MAC_PCU_BASEBAND_0_DATA_MASK 0xffffffff -#define MAC_PCU_BASEBAND_0_DATA_GET(x) (((x) & MAC_PCU_BASEBAND_0_DATA_MASK) >> MAC_PCU_BASEBAND_0_DATA_LSB) -#define MAC_PCU_BASEBAND_0_DATA_SET(x) (((x) << MAC_PCU_BASEBAND_0_DATA_LSB) & MAC_PCU_BASEBAND_0_DATA_MASK) - -#define MAC_PCU_BASEBAND_1_ADDRESS 0x0000a000 -#define MAC_PCU_BASEBAND_1_OFFSET 0x00002000 -#define MAC_PCU_BASEBAND_1_DATA_MSB 31 -#define MAC_PCU_BASEBAND_1_DATA_LSB 0 -#define MAC_PCU_BASEBAND_1_DATA_MASK 0xffffffff -#define MAC_PCU_BASEBAND_1_DATA_GET(x) (((x) & MAC_PCU_BASEBAND_1_DATA_MASK) >> MAC_PCU_BASEBAND_1_DATA_LSB) -#define MAC_PCU_BASEBAND_1_DATA_SET(x) (((x) << MAC_PCU_BASEBAND_1_DATA_LSB) & MAC_PCU_BASEBAND_1_DATA_MASK) - -#define MAC_PCU_BASEBAND_2_ADDRESS 0x0000c000 -#define MAC_PCU_BASEBAND_2_OFFSET 0x00004000 -#define MAC_PCU_BASEBAND_2_DATA_MSB 31 -#define MAC_PCU_BASEBAND_2_DATA_LSB 0 -#define MAC_PCU_BASEBAND_2_DATA_MASK 0xffffffff -#define MAC_PCU_BASEBAND_2_DATA_GET(x) (((x) & MAC_PCU_BASEBAND_2_DATA_MASK) >> MAC_PCU_BASEBAND_2_DATA_LSB) -#define MAC_PCU_BASEBAND_2_DATA_SET(x) (((x) << MAC_PCU_BASEBAND_2_DATA_LSB) & MAC_PCU_BASEBAND_2_DATA_MASK) - -#define MAC_PCU_BASEBAND_3_ADDRESS 0x0000d000 -#define MAC_PCU_BASEBAND_3_OFFSET 0x00005000 -#define MAC_PCU_BASEBAND_3_DATA_MSB 31 -#define MAC_PCU_BASEBAND_3_DATA_LSB 0 -#define MAC_PCU_BASEBAND_3_DATA_MASK 0xffffffff -#define MAC_PCU_BASEBAND_3_DATA_GET(x) (((x) & MAC_PCU_BASEBAND_3_DATA_MASK) >> MAC_PCU_BASEBAND_3_DATA_LSB) -#define MAC_PCU_BASEBAND_3_DATA_SET(x) (((x) << MAC_PCU_BASEBAND_3_DATA_LSB) & MAC_PCU_BASEBAND_3_DATA_MASK) - -#define MAC_PCU_BUF_ADDRESS 0x0000e000 -#define MAC_PCU_BUF_OFFSET 0x00006000 -#define MAC_PCU_BUF_DATA_MSB 31 -#define MAC_PCU_BUF_DATA_LSB 0 -#define MAC_PCU_BUF_DATA_MASK 0xffffffff -#define MAC_PCU_BUF_DATA_GET(x) (((x) & MAC_PCU_BUF_DATA_MASK) >> MAC_PCU_BUF_DATA_LSB) -#define MAC_PCU_BUF_DATA_SET(x) (((x) << MAC_PCU_BUF_DATA_LSB) & MAC_PCU_BUF_DATA_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct mac_pcu_reg_s { - volatile unsigned int mac_pcu_sta_addr_l32; - volatile unsigned int mac_pcu_sta_addr_u16; - volatile unsigned int mac_pcu_bssid_l32; - volatile unsigned int mac_pcu_bssid_u16; - volatile unsigned int mac_pcu_bcn_rssi_ave; - volatile unsigned int mac_pcu_ack_cts_timeout; - volatile unsigned int mac_pcu_bcn_rssi_ctl; - volatile unsigned int mac_pcu_usec_latency; - volatile unsigned int pcu_max_cfp_dur; - volatile unsigned int mac_pcu_rx_filter; - volatile unsigned int mac_pcu_mcast_filter_l32; - volatile unsigned int mac_pcu_mcast_filter_u32; - volatile unsigned int mac_pcu_diag_sw; - volatile unsigned int mac_pcu_tst_addac; - volatile unsigned int mac_pcu_def_antenna; - volatile unsigned int mac_pcu_aes_mute_mask_0; - volatile unsigned int mac_pcu_aes_mute_mask_1; - volatile unsigned int mac_pcu_gated_clks; - volatile unsigned int mac_pcu_obs_bus_2; - volatile unsigned int mac_pcu_obs_bus_1; - volatile unsigned int mac_pcu_dym_mimo_pwr_save; - volatile unsigned int mac_pcu_last_beacon_tsf; - volatile unsigned int mac_pcu_nav; - volatile unsigned int mac_pcu_rts_success_cnt; - volatile unsigned int mac_pcu_rts_fail_cnt; - volatile unsigned int mac_pcu_ack_fail_cnt; - volatile unsigned int mac_pcu_fcs_fail_cnt; - volatile unsigned int mac_pcu_beacon_cnt; - volatile unsigned int mac_pcu_xrmode; - volatile unsigned int mac_pcu_xrdel; - volatile unsigned int mac_pcu_xrto; - volatile unsigned int mac_pcu_xrcrp; - volatile unsigned int mac_pcu_xrstmp; - volatile unsigned int mac_pcu_addr1_mask_l32; - volatile unsigned int mac_pcu_addr1_mask_u16; - volatile unsigned int mac_pcu_tpc; - volatile unsigned int mac_pcu_tx_frame_cnt; - volatile unsigned int mac_pcu_rx_frame_cnt; - volatile unsigned int mac_pcu_rx_clear_cnt; - volatile unsigned int mac_pcu_cycle_cnt; - volatile unsigned int mac_pcu_quiet_time_1; - volatile unsigned int mac_pcu_quiet_time_2; - volatile unsigned int mac_pcu_qos_no_ack; - volatile unsigned int mac_pcu_phy_error_mask; - volatile unsigned int mac_pcu_xrlat; - volatile unsigned int mac_pcu_rxbuf; - volatile unsigned int mac_pcu_mic_qos_control; - volatile unsigned int mac_pcu_mic_qos_select; - volatile unsigned int mac_pcu_misc_mode; - volatile unsigned int mac_pcu_filter_ofdm_cnt; - volatile unsigned int mac_pcu_filter_cck_cnt; - volatile unsigned int mac_pcu_phy_err_cnt_1; - volatile unsigned int mac_pcu_phy_err_cnt_1_mask; - volatile unsigned int mac_pcu_phy_err_cnt_2; - volatile unsigned int mac_pcu_phy_err_cnt_2_mask; - volatile unsigned int mac_pcu_tsf_threshold; - volatile unsigned int mac_pcu_phy_error_eifs_mask; - volatile unsigned int mac_pcu_phy_err_cnt_3; - volatile unsigned int mac_pcu_phy_err_cnt_3_mask; - volatile unsigned int mac_pcu_bluetooth_mode; - volatile unsigned int mac_pcu_bluetooth_weights; - volatile unsigned int mac_pcu_bluetooth_mode2; - volatile unsigned int mac_pcu_txsifs; - volatile unsigned int mac_pcu_txop_x; - volatile unsigned int mac_pcu_txop_0_3; - volatile unsigned int mac_pcu_txop_4_7; - volatile unsigned int mac_pcu_txop_8_11; - volatile unsigned int mac_pcu_txop_12_15; - volatile unsigned int mac_pcu_logic_analyzer; - volatile unsigned int mac_pcu_logic_analyzer_32l; - volatile unsigned int mac_pcu_logic_analyzer_16u; - volatile unsigned int mac_pcu_phy_err_cnt_mask_cont; - volatile unsigned int mac_pcu_azimuth_mode; - volatile unsigned int mac_pcu_20_40_mode; - volatile unsigned int mac_pcu_rx_clear_diff_cnt; - volatile unsigned int mac_pcu_self_gen_antenna_mask; - volatile unsigned int mac_pcu_ba_bar_control; - volatile unsigned int mac_pcu_legacy_plcp_spoof; - volatile unsigned int mac_pcu_phy_error_mask_cont; - volatile unsigned int mac_pcu_tx_timer; - volatile unsigned int mac_pcu_txbuf_ctrl; - volatile unsigned int mac_pcu_misc_mode2; - volatile unsigned int mac_pcu_alt_aes_mute_mask; - volatile unsigned int mac_pcu_azimuth_time_stamp; - volatile unsigned int mac_pcu_max_cfp_dur; - volatile unsigned int mac_pcu_hcf_timeout; - volatile unsigned int mac_pcu_bluetooth_weights2; - volatile unsigned int mac_pcu_bluetooth_tsf_bt_active; - volatile unsigned int mac_pcu_bluetooth_tsf_bt_priority; - volatile unsigned int mac_pcu_bluetooth_mode3; - volatile unsigned int mac_pcu_bluetooth_mode4; - unsigned char pad0[148]; /* pad to 0x200 */ - volatile unsigned int mac_pcu_bt_bt[64]; - volatile unsigned int mac_pcu_bt_bt_async; - volatile unsigned int mac_pcu_bt_wl_1; - volatile unsigned int mac_pcu_bt_wl_2; - volatile unsigned int mac_pcu_bt_wl_3; - volatile unsigned int mac_pcu_bt_wl_4; - volatile unsigned int mac_pcu_coex_epta; - volatile unsigned int mac_pcu_coex_lnamaxgain1; - volatile unsigned int mac_pcu_coex_lnamaxgain2; - volatile unsigned int mac_pcu_coex_lnamaxgain3; - volatile unsigned int mac_pcu_coex_lnamaxgain4; - volatile unsigned int mac_pcu_basic_rate_set0; - volatile unsigned int mac_pcu_basic_rate_set1; - volatile unsigned int mac_pcu_basic_rate_set2; - volatile unsigned int mac_pcu_basic_rate_set3; - volatile unsigned int mac_pcu_rx_int_status0; - volatile unsigned int mac_pcu_rx_int_status1; - volatile unsigned int mac_pcu_rx_int_status2; - volatile unsigned int mac_pcu_rx_int_status3; - volatile unsigned int ht_half_gi_rate1; - volatile unsigned int ht_half_gi_rate2; - volatile unsigned int ht_full_gi_rate1; - volatile unsigned int ht_full_gi_rate2; - volatile unsigned int legacy_rate1; - volatile unsigned int legacy_rate2; - volatile unsigned int legacy_rate3; - volatile unsigned int rx_int_filter; - volatile unsigned int rx_int_overflow; - volatile unsigned int rx_filter_thresh; - volatile unsigned int rx_filter_thresh1; - volatile unsigned int rx_priority_thresh0; - volatile unsigned int rx_priority_thresh1; - volatile unsigned int rx_priority_thresh2; - volatile unsigned int rx_priority_thresh3; - volatile unsigned int rx_priority_offset0; - volatile unsigned int rx_priority_offset1; - volatile unsigned int rx_priority_offset2; - volatile unsigned int rx_priority_offset3; - volatile unsigned int rx_priority_offset4; - volatile unsigned int rx_priority_offset5; - volatile unsigned int mac_pcu_bssid2_l32; - volatile unsigned int mac_pcu_bssid2_u16; - volatile unsigned int mac_pcu_tsf1_status_l32; - volatile unsigned int mac_pcu_tsf1_status_u32; - volatile unsigned int mac_pcu_tsf2_status_l32; - volatile unsigned int mac_pcu_tsf2_status_u32; - unsigned char pad1[76]; /* pad to 0x400 */ - volatile unsigned int mac_pcu_txbuf_ba[64]; - unsigned char pad2[768]; /* pad to 0x800 */ - volatile unsigned int mac_pcu_key_cache_1[256]; - unsigned char pad3[3072]; /* pad to 0x1800 */ - volatile unsigned int mac_pcu_baseband_0[512]; - volatile unsigned int mac_pcu_baseband_1[2048]; - volatile unsigned int mac_pcu_baseband_2[1024]; - volatile unsigned int mac_pcu_baseband_3[1024]; - volatile unsigned int mac_pcu_buf[512]; -} mac_pcu_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _MAC_PCU_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_host_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_host_reg.h deleted file mode 100644 index 7460d94fa39e..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_host_reg.h +++ /dev/null @@ -1,37 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "mbox_wlan_host_reg.h" - - -#ifndef BT_HEADERS - - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_reg.h deleted file mode 100644 index 22bd7d795d09..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_reg.h +++ /dev/null @@ -1,560 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "mbox_wlan_reg.h" - - -#ifndef BT_HEADERS - -#define MBOX_FIFO_ADDRESS WLAN_MBOX_FIFO_ADDRESS -#define MBOX_FIFO_OFFSET WLAN_MBOX_FIFO_OFFSET -#define MBOX_FIFO_DATA_MSB WLAN_MBOX_FIFO_DATA_MSB -#define MBOX_FIFO_DATA_LSB WLAN_MBOX_FIFO_DATA_LSB -#define MBOX_FIFO_DATA_MASK WLAN_MBOX_FIFO_DATA_MASK -#define MBOX_FIFO_DATA_GET(x) WLAN_MBOX_FIFO_DATA_GET(x) -#define MBOX_FIFO_DATA_SET(x) WLAN_MBOX_FIFO_DATA_SET(x) -#define MBOX_FIFO_STATUS_ADDRESS WLAN_MBOX_FIFO_STATUS_ADDRESS -#define MBOX_FIFO_STATUS_OFFSET WLAN_MBOX_FIFO_STATUS_OFFSET -#define MBOX_FIFO_STATUS_EMPTY_MSB WLAN_MBOX_FIFO_STATUS_EMPTY_MSB -#define MBOX_FIFO_STATUS_EMPTY_LSB WLAN_MBOX_FIFO_STATUS_EMPTY_LSB -#define MBOX_FIFO_STATUS_EMPTY_MASK WLAN_MBOX_FIFO_STATUS_EMPTY_MASK -#define MBOX_FIFO_STATUS_EMPTY_GET(x) WLAN_MBOX_FIFO_STATUS_EMPTY_GET(x) -#define MBOX_FIFO_STATUS_EMPTY_SET(x) WLAN_MBOX_FIFO_STATUS_EMPTY_SET(x) -#define MBOX_FIFO_STATUS_FULL_MSB WLAN_MBOX_FIFO_STATUS_FULL_MSB -#define MBOX_FIFO_STATUS_FULL_LSB WLAN_MBOX_FIFO_STATUS_FULL_LSB -#define MBOX_FIFO_STATUS_FULL_MASK WLAN_MBOX_FIFO_STATUS_FULL_MASK -#define MBOX_FIFO_STATUS_FULL_GET(x) WLAN_MBOX_FIFO_STATUS_FULL_GET(x) -#define MBOX_FIFO_STATUS_FULL_SET(x) WLAN_MBOX_FIFO_STATUS_FULL_SET(x) -#define MBOX_DMA_POLICY_ADDRESS WLAN_MBOX_DMA_POLICY_ADDRESS -#define MBOX_DMA_POLICY_OFFSET WLAN_MBOX_DMA_POLICY_OFFSET -#define MBOX_DMA_POLICY_TX_QUANTUM_MSB WLAN_MBOX_DMA_POLICY_TX_QUANTUM_MSB -#define MBOX_DMA_POLICY_TX_QUANTUM_LSB WLAN_MBOX_DMA_POLICY_TX_QUANTUM_LSB -#define MBOX_DMA_POLICY_TX_QUANTUM_MASK WLAN_MBOX_DMA_POLICY_TX_QUANTUM_MASK -#define MBOX_DMA_POLICY_TX_QUANTUM_GET(x) WLAN_MBOX_DMA_POLICY_TX_QUANTUM_GET(x) -#define MBOX_DMA_POLICY_TX_QUANTUM_SET(x) WLAN_MBOX_DMA_POLICY_TX_QUANTUM_SET(x) -#define MBOX_DMA_POLICY_TX_ORDER_MSB WLAN_MBOX_DMA_POLICY_TX_ORDER_MSB -#define MBOX_DMA_POLICY_TX_ORDER_LSB WLAN_MBOX_DMA_POLICY_TX_ORDER_LSB -#define MBOX_DMA_POLICY_TX_ORDER_MASK WLAN_MBOX_DMA_POLICY_TX_ORDER_MASK -#define MBOX_DMA_POLICY_TX_ORDER_GET(x) WLAN_MBOX_DMA_POLICY_TX_ORDER_GET(x) -#define MBOX_DMA_POLICY_TX_ORDER_SET(x) WLAN_MBOX_DMA_POLICY_TX_ORDER_SET(x) -#define MBOX_DMA_POLICY_RX_QUANTUM_MSB WLAN_MBOX_DMA_POLICY_RX_QUANTUM_MSB -#define MBOX_DMA_POLICY_RX_QUANTUM_LSB WLAN_MBOX_DMA_POLICY_RX_QUANTUM_LSB -#define MBOX_DMA_POLICY_RX_QUANTUM_MASK WLAN_MBOX_DMA_POLICY_RX_QUANTUM_MASK -#define MBOX_DMA_POLICY_RX_QUANTUM_GET(x) WLAN_MBOX_DMA_POLICY_RX_QUANTUM_GET(x) -#define MBOX_DMA_POLICY_RX_QUANTUM_SET(x) WLAN_MBOX_DMA_POLICY_RX_QUANTUM_SET(x) -#define MBOX_DMA_POLICY_RX_ORDER_MSB WLAN_MBOX_DMA_POLICY_RX_ORDER_MSB -#define MBOX_DMA_POLICY_RX_ORDER_LSB WLAN_MBOX_DMA_POLICY_RX_ORDER_LSB -#define MBOX_DMA_POLICY_RX_ORDER_MASK WLAN_MBOX_DMA_POLICY_RX_ORDER_MASK -#define MBOX_DMA_POLICY_RX_ORDER_GET(x) WLAN_MBOX_DMA_POLICY_RX_ORDER_GET(x) -#define MBOX_DMA_POLICY_RX_ORDER_SET(x) WLAN_MBOX_DMA_POLICY_RX_ORDER_SET(x) -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX0_DMA_RX_CONTROL_ADDRESS WLAN_MBOX0_DMA_RX_CONTROL_ADDRESS -#define MBOX0_DMA_RX_CONTROL_OFFSET WLAN_MBOX0_DMA_RX_CONTROL_OFFSET -#define MBOX0_DMA_RX_CONTROL_RESUME_MSB WLAN_MBOX0_DMA_RX_CONTROL_RESUME_MSB -#define MBOX0_DMA_RX_CONTROL_RESUME_LSB WLAN_MBOX0_DMA_RX_CONTROL_RESUME_LSB -#define MBOX0_DMA_RX_CONTROL_RESUME_MASK WLAN_MBOX0_DMA_RX_CONTROL_RESUME_MASK -#define MBOX0_DMA_RX_CONTROL_RESUME_GET(x) WLAN_MBOX0_DMA_RX_CONTROL_RESUME_GET(x) -#define MBOX0_DMA_RX_CONTROL_RESUME_SET(x) WLAN_MBOX0_DMA_RX_CONTROL_RESUME_SET(x) -#define MBOX0_DMA_RX_CONTROL_START_MSB WLAN_MBOX0_DMA_RX_CONTROL_START_MSB -#define MBOX0_DMA_RX_CONTROL_START_LSB WLAN_MBOX0_DMA_RX_CONTROL_START_LSB -#define MBOX0_DMA_RX_CONTROL_START_MASK WLAN_MBOX0_DMA_RX_CONTROL_START_MASK -#define MBOX0_DMA_RX_CONTROL_START_GET(x) WLAN_MBOX0_DMA_RX_CONTROL_START_GET(x) -#define MBOX0_DMA_RX_CONTROL_START_SET(x) WLAN_MBOX0_DMA_RX_CONTROL_START_SET(x) -#define MBOX0_DMA_RX_CONTROL_STOP_MSB WLAN_MBOX0_DMA_RX_CONTROL_STOP_MSB -#define MBOX0_DMA_RX_CONTROL_STOP_LSB WLAN_MBOX0_DMA_RX_CONTROL_STOP_LSB -#define MBOX0_DMA_RX_CONTROL_STOP_MASK WLAN_MBOX0_DMA_RX_CONTROL_STOP_MASK -#define MBOX0_DMA_RX_CONTROL_STOP_GET(x) WLAN_MBOX0_DMA_RX_CONTROL_STOP_GET(x) -#define MBOX0_DMA_RX_CONTROL_STOP_SET(x) WLAN_MBOX0_DMA_RX_CONTROL_STOP_SET(x) -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX0_DMA_TX_CONTROL_ADDRESS WLAN_MBOX0_DMA_TX_CONTROL_ADDRESS -#define MBOX0_DMA_TX_CONTROL_OFFSET WLAN_MBOX0_DMA_TX_CONTROL_OFFSET -#define MBOX0_DMA_TX_CONTROL_RESUME_MSB WLAN_MBOX0_DMA_TX_CONTROL_RESUME_MSB -#define MBOX0_DMA_TX_CONTROL_RESUME_LSB WLAN_MBOX0_DMA_TX_CONTROL_RESUME_LSB -#define MBOX0_DMA_TX_CONTROL_RESUME_MASK WLAN_MBOX0_DMA_TX_CONTROL_RESUME_MASK -#define MBOX0_DMA_TX_CONTROL_RESUME_GET(x) WLAN_MBOX0_DMA_TX_CONTROL_RESUME_GET(x) -#define MBOX0_DMA_TX_CONTROL_RESUME_SET(x) WLAN_MBOX0_DMA_TX_CONTROL_RESUME_SET(x) -#define MBOX0_DMA_TX_CONTROL_START_MSB WLAN_MBOX0_DMA_TX_CONTROL_START_MSB -#define MBOX0_DMA_TX_CONTROL_START_LSB WLAN_MBOX0_DMA_TX_CONTROL_START_LSB -#define MBOX0_DMA_TX_CONTROL_START_MASK WLAN_MBOX0_DMA_TX_CONTROL_START_MASK -#define MBOX0_DMA_TX_CONTROL_START_GET(x) WLAN_MBOX0_DMA_TX_CONTROL_START_GET(x) -#define MBOX0_DMA_TX_CONTROL_START_SET(x) WLAN_MBOX0_DMA_TX_CONTROL_START_SET(x) -#define MBOX0_DMA_TX_CONTROL_STOP_MSB WLAN_MBOX0_DMA_TX_CONTROL_STOP_MSB -#define MBOX0_DMA_TX_CONTROL_STOP_LSB WLAN_MBOX0_DMA_TX_CONTROL_STOP_LSB -#define MBOX0_DMA_TX_CONTROL_STOP_MASK WLAN_MBOX0_DMA_TX_CONTROL_STOP_MASK -#define MBOX0_DMA_TX_CONTROL_STOP_GET(x) WLAN_MBOX0_DMA_TX_CONTROL_STOP_GET(x) -#define MBOX0_DMA_TX_CONTROL_STOP_SET(x) WLAN_MBOX0_DMA_TX_CONTROL_STOP_SET(x) -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_OFFSET -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX1_DMA_RX_CONTROL_ADDRESS WLAN_MBOX1_DMA_RX_CONTROL_ADDRESS -#define MBOX1_DMA_RX_CONTROL_OFFSET WLAN_MBOX1_DMA_RX_CONTROL_OFFSET -#define MBOX1_DMA_RX_CONTROL_RESUME_MSB WLAN_MBOX1_DMA_RX_CONTROL_RESUME_MSB -#define MBOX1_DMA_RX_CONTROL_RESUME_LSB WLAN_MBOX1_DMA_RX_CONTROL_RESUME_LSB -#define MBOX1_DMA_RX_CONTROL_RESUME_MASK WLAN_MBOX1_DMA_RX_CONTROL_RESUME_MASK -#define MBOX1_DMA_RX_CONTROL_RESUME_GET(x) WLAN_MBOX1_DMA_RX_CONTROL_RESUME_GET(x) -#define MBOX1_DMA_RX_CONTROL_RESUME_SET(x) WLAN_MBOX1_DMA_RX_CONTROL_RESUME_SET(x) -#define MBOX1_DMA_RX_CONTROL_START_MSB WLAN_MBOX1_DMA_RX_CONTROL_START_MSB -#define MBOX1_DMA_RX_CONTROL_START_LSB WLAN_MBOX1_DMA_RX_CONTROL_START_LSB -#define MBOX1_DMA_RX_CONTROL_START_MASK WLAN_MBOX1_DMA_RX_CONTROL_START_MASK -#define MBOX1_DMA_RX_CONTROL_START_GET(x) WLAN_MBOX1_DMA_RX_CONTROL_START_GET(x) -#define MBOX1_DMA_RX_CONTROL_START_SET(x) WLAN_MBOX1_DMA_RX_CONTROL_START_SET(x) -#define MBOX1_DMA_RX_CONTROL_STOP_MSB WLAN_MBOX1_DMA_RX_CONTROL_STOP_MSB -#define MBOX1_DMA_RX_CONTROL_STOP_LSB WLAN_MBOX1_DMA_RX_CONTROL_STOP_LSB -#define MBOX1_DMA_RX_CONTROL_STOP_MASK WLAN_MBOX1_DMA_RX_CONTROL_STOP_MASK -#define MBOX1_DMA_RX_CONTROL_STOP_GET(x) WLAN_MBOX1_DMA_RX_CONTROL_STOP_GET(x) -#define MBOX1_DMA_RX_CONTROL_STOP_SET(x) WLAN_MBOX1_DMA_RX_CONTROL_STOP_SET(x) -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_OFFSET -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX1_DMA_TX_CONTROL_ADDRESS WLAN_MBOX1_DMA_TX_CONTROL_ADDRESS -#define MBOX1_DMA_TX_CONTROL_OFFSET WLAN_MBOX1_DMA_TX_CONTROL_OFFSET -#define MBOX1_DMA_TX_CONTROL_RESUME_MSB WLAN_MBOX1_DMA_TX_CONTROL_RESUME_MSB -#define MBOX1_DMA_TX_CONTROL_RESUME_LSB WLAN_MBOX1_DMA_TX_CONTROL_RESUME_LSB -#define MBOX1_DMA_TX_CONTROL_RESUME_MASK WLAN_MBOX1_DMA_TX_CONTROL_RESUME_MASK -#define MBOX1_DMA_TX_CONTROL_RESUME_GET(x) WLAN_MBOX1_DMA_TX_CONTROL_RESUME_GET(x) -#define MBOX1_DMA_TX_CONTROL_RESUME_SET(x) WLAN_MBOX1_DMA_TX_CONTROL_RESUME_SET(x) -#define MBOX1_DMA_TX_CONTROL_START_MSB WLAN_MBOX1_DMA_TX_CONTROL_START_MSB -#define MBOX1_DMA_TX_CONTROL_START_LSB WLAN_MBOX1_DMA_TX_CONTROL_START_LSB -#define MBOX1_DMA_TX_CONTROL_START_MASK WLAN_MBOX1_DMA_TX_CONTROL_START_MASK -#define MBOX1_DMA_TX_CONTROL_START_GET(x) WLAN_MBOX1_DMA_TX_CONTROL_START_GET(x) -#define MBOX1_DMA_TX_CONTROL_START_SET(x) WLAN_MBOX1_DMA_TX_CONTROL_START_SET(x) -#define MBOX1_DMA_TX_CONTROL_STOP_MSB WLAN_MBOX1_DMA_TX_CONTROL_STOP_MSB -#define MBOX1_DMA_TX_CONTROL_STOP_LSB WLAN_MBOX1_DMA_TX_CONTROL_STOP_LSB -#define MBOX1_DMA_TX_CONTROL_STOP_MASK WLAN_MBOX1_DMA_TX_CONTROL_STOP_MASK -#define MBOX1_DMA_TX_CONTROL_STOP_GET(x) WLAN_MBOX1_DMA_TX_CONTROL_STOP_GET(x) -#define MBOX1_DMA_TX_CONTROL_STOP_SET(x) WLAN_MBOX1_DMA_TX_CONTROL_STOP_SET(x) -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_OFFSET -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX2_DMA_RX_CONTROL_ADDRESS WLAN_MBOX2_DMA_RX_CONTROL_ADDRESS -#define MBOX2_DMA_RX_CONTROL_OFFSET WLAN_MBOX2_DMA_RX_CONTROL_OFFSET -#define MBOX2_DMA_RX_CONTROL_RESUME_MSB WLAN_MBOX2_DMA_RX_CONTROL_RESUME_MSB -#define MBOX2_DMA_RX_CONTROL_RESUME_LSB WLAN_MBOX2_DMA_RX_CONTROL_RESUME_LSB -#define MBOX2_DMA_RX_CONTROL_RESUME_MASK WLAN_MBOX2_DMA_RX_CONTROL_RESUME_MASK -#define MBOX2_DMA_RX_CONTROL_RESUME_GET(x) WLAN_MBOX2_DMA_RX_CONTROL_RESUME_GET(x) -#define MBOX2_DMA_RX_CONTROL_RESUME_SET(x) WLAN_MBOX2_DMA_RX_CONTROL_RESUME_SET(x) -#define MBOX2_DMA_RX_CONTROL_START_MSB WLAN_MBOX2_DMA_RX_CONTROL_START_MSB -#define MBOX2_DMA_RX_CONTROL_START_LSB WLAN_MBOX2_DMA_RX_CONTROL_START_LSB -#define MBOX2_DMA_RX_CONTROL_START_MASK WLAN_MBOX2_DMA_RX_CONTROL_START_MASK -#define MBOX2_DMA_RX_CONTROL_START_GET(x) WLAN_MBOX2_DMA_RX_CONTROL_START_GET(x) -#define MBOX2_DMA_RX_CONTROL_START_SET(x) WLAN_MBOX2_DMA_RX_CONTROL_START_SET(x) -#define MBOX2_DMA_RX_CONTROL_STOP_MSB WLAN_MBOX2_DMA_RX_CONTROL_STOP_MSB -#define MBOX2_DMA_RX_CONTROL_STOP_LSB WLAN_MBOX2_DMA_RX_CONTROL_STOP_LSB -#define MBOX2_DMA_RX_CONTROL_STOP_MASK WLAN_MBOX2_DMA_RX_CONTROL_STOP_MASK -#define MBOX2_DMA_RX_CONTROL_STOP_GET(x) WLAN_MBOX2_DMA_RX_CONTROL_STOP_GET(x) -#define MBOX2_DMA_RX_CONTROL_STOP_SET(x) WLAN_MBOX2_DMA_RX_CONTROL_STOP_SET(x) -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_OFFSET -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX2_DMA_TX_CONTROL_ADDRESS WLAN_MBOX2_DMA_TX_CONTROL_ADDRESS -#define MBOX2_DMA_TX_CONTROL_OFFSET WLAN_MBOX2_DMA_TX_CONTROL_OFFSET -#define MBOX2_DMA_TX_CONTROL_RESUME_MSB WLAN_MBOX2_DMA_TX_CONTROL_RESUME_MSB -#define MBOX2_DMA_TX_CONTROL_RESUME_LSB WLAN_MBOX2_DMA_TX_CONTROL_RESUME_LSB -#define MBOX2_DMA_TX_CONTROL_RESUME_MASK WLAN_MBOX2_DMA_TX_CONTROL_RESUME_MASK -#define MBOX2_DMA_TX_CONTROL_RESUME_GET(x) WLAN_MBOX2_DMA_TX_CONTROL_RESUME_GET(x) -#define MBOX2_DMA_TX_CONTROL_RESUME_SET(x) WLAN_MBOX2_DMA_TX_CONTROL_RESUME_SET(x) -#define MBOX2_DMA_TX_CONTROL_START_MSB WLAN_MBOX2_DMA_TX_CONTROL_START_MSB -#define MBOX2_DMA_TX_CONTROL_START_LSB WLAN_MBOX2_DMA_TX_CONTROL_START_LSB -#define MBOX2_DMA_TX_CONTROL_START_MASK WLAN_MBOX2_DMA_TX_CONTROL_START_MASK -#define MBOX2_DMA_TX_CONTROL_START_GET(x) WLAN_MBOX2_DMA_TX_CONTROL_START_GET(x) -#define MBOX2_DMA_TX_CONTROL_START_SET(x) WLAN_MBOX2_DMA_TX_CONTROL_START_SET(x) -#define MBOX2_DMA_TX_CONTROL_STOP_MSB WLAN_MBOX2_DMA_TX_CONTROL_STOP_MSB -#define MBOX2_DMA_TX_CONTROL_STOP_LSB WLAN_MBOX2_DMA_TX_CONTROL_STOP_LSB -#define MBOX2_DMA_TX_CONTROL_STOP_MASK WLAN_MBOX2_DMA_TX_CONTROL_STOP_MASK -#define MBOX2_DMA_TX_CONTROL_STOP_GET(x) WLAN_MBOX2_DMA_TX_CONTROL_STOP_GET(x) -#define MBOX2_DMA_TX_CONTROL_STOP_SET(x) WLAN_MBOX2_DMA_TX_CONTROL_STOP_SET(x) -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_OFFSET -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX3_DMA_RX_CONTROL_ADDRESS WLAN_MBOX3_DMA_RX_CONTROL_ADDRESS -#define MBOX3_DMA_RX_CONTROL_OFFSET WLAN_MBOX3_DMA_RX_CONTROL_OFFSET -#define MBOX3_DMA_RX_CONTROL_RESUME_MSB WLAN_MBOX3_DMA_RX_CONTROL_RESUME_MSB -#define MBOX3_DMA_RX_CONTROL_RESUME_LSB WLAN_MBOX3_DMA_RX_CONTROL_RESUME_LSB -#define MBOX3_DMA_RX_CONTROL_RESUME_MASK WLAN_MBOX3_DMA_RX_CONTROL_RESUME_MASK -#define MBOX3_DMA_RX_CONTROL_RESUME_GET(x) WLAN_MBOX3_DMA_RX_CONTROL_RESUME_GET(x) -#define MBOX3_DMA_RX_CONTROL_RESUME_SET(x) WLAN_MBOX3_DMA_RX_CONTROL_RESUME_SET(x) -#define MBOX3_DMA_RX_CONTROL_START_MSB WLAN_MBOX3_DMA_RX_CONTROL_START_MSB -#define MBOX3_DMA_RX_CONTROL_START_LSB WLAN_MBOX3_DMA_RX_CONTROL_START_LSB -#define MBOX3_DMA_RX_CONTROL_START_MASK WLAN_MBOX3_DMA_RX_CONTROL_START_MASK -#define MBOX3_DMA_RX_CONTROL_START_GET(x) WLAN_MBOX3_DMA_RX_CONTROL_START_GET(x) -#define MBOX3_DMA_RX_CONTROL_START_SET(x) WLAN_MBOX3_DMA_RX_CONTROL_START_SET(x) -#define MBOX3_DMA_RX_CONTROL_STOP_MSB WLAN_MBOX3_DMA_RX_CONTROL_STOP_MSB -#define MBOX3_DMA_RX_CONTROL_STOP_LSB WLAN_MBOX3_DMA_RX_CONTROL_STOP_LSB -#define MBOX3_DMA_RX_CONTROL_STOP_MASK WLAN_MBOX3_DMA_RX_CONTROL_STOP_MASK -#define MBOX3_DMA_RX_CONTROL_STOP_GET(x) WLAN_MBOX3_DMA_RX_CONTROL_STOP_GET(x) -#define MBOX3_DMA_RX_CONTROL_STOP_SET(x) WLAN_MBOX3_DMA_RX_CONTROL_STOP_SET(x) -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_OFFSET -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX3_DMA_TX_CONTROL_ADDRESS WLAN_MBOX3_DMA_TX_CONTROL_ADDRESS -#define MBOX3_DMA_TX_CONTROL_OFFSET WLAN_MBOX3_DMA_TX_CONTROL_OFFSET -#define MBOX3_DMA_TX_CONTROL_RESUME_MSB WLAN_MBOX3_DMA_TX_CONTROL_RESUME_MSB -#define MBOX3_DMA_TX_CONTROL_RESUME_LSB WLAN_MBOX3_DMA_TX_CONTROL_RESUME_LSB -#define MBOX3_DMA_TX_CONTROL_RESUME_MASK WLAN_MBOX3_DMA_TX_CONTROL_RESUME_MASK -#define MBOX3_DMA_TX_CONTROL_RESUME_GET(x) WLAN_MBOX3_DMA_TX_CONTROL_RESUME_GET(x) -#define MBOX3_DMA_TX_CONTROL_RESUME_SET(x) WLAN_MBOX3_DMA_TX_CONTROL_RESUME_SET(x) -#define MBOX3_DMA_TX_CONTROL_START_MSB WLAN_MBOX3_DMA_TX_CONTROL_START_MSB -#define MBOX3_DMA_TX_CONTROL_START_LSB WLAN_MBOX3_DMA_TX_CONTROL_START_LSB -#define MBOX3_DMA_TX_CONTROL_START_MASK WLAN_MBOX3_DMA_TX_CONTROL_START_MASK -#define MBOX3_DMA_TX_CONTROL_START_GET(x) WLAN_MBOX3_DMA_TX_CONTROL_START_GET(x) -#define MBOX3_DMA_TX_CONTROL_START_SET(x) WLAN_MBOX3_DMA_TX_CONTROL_START_SET(x) -#define MBOX3_DMA_TX_CONTROL_STOP_MSB WLAN_MBOX3_DMA_TX_CONTROL_STOP_MSB -#define MBOX3_DMA_TX_CONTROL_STOP_LSB WLAN_MBOX3_DMA_TX_CONTROL_STOP_LSB -#define MBOX3_DMA_TX_CONTROL_STOP_MASK WLAN_MBOX3_DMA_TX_CONTROL_STOP_MASK -#define MBOX3_DMA_TX_CONTROL_STOP_GET(x) WLAN_MBOX3_DMA_TX_CONTROL_STOP_GET(x) -#define MBOX3_DMA_TX_CONTROL_STOP_SET(x) WLAN_MBOX3_DMA_TX_CONTROL_STOP_SET(x) -#define MBOX_INT_STATUS_ADDRESS WLAN_MBOX_INT_STATUS_ADDRESS -#define MBOX_INT_STATUS_OFFSET WLAN_MBOX_INT_STATUS_OFFSET -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MSB WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_MSB -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MSB WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_MSB -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) -#define MBOX_INT_STATUS_TX_OVERFLOW_MSB WLAN_MBOX_INT_STATUS_TX_OVERFLOW_MSB -#define MBOX_INT_STATUS_TX_OVERFLOW_LSB WLAN_MBOX_INT_STATUS_TX_OVERFLOW_LSB -#define MBOX_INT_STATUS_TX_OVERFLOW_MASK WLAN_MBOX_INT_STATUS_TX_OVERFLOW_MASK -#define MBOX_INT_STATUS_TX_OVERFLOW_GET(x) WLAN_MBOX_INT_STATUS_TX_OVERFLOW_GET(x) -#define MBOX_INT_STATUS_TX_OVERFLOW_SET(x) WLAN_MBOX_INT_STATUS_TX_OVERFLOW_SET(x) -#define MBOX_INT_STATUS_RX_UNDERFLOW_MSB WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_MSB -#define MBOX_INT_STATUS_RX_UNDERFLOW_LSB WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_LSB -#define MBOX_INT_STATUS_RX_UNDERFLOW_MASK WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_MASK -#define MBOX_INT_STATUS_RX_UNDERFLOW_GET(x) WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_GET(x) -#define MBOX_INT_STATUS_RX_UNDERFLOW_SET(x) WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_SET(x) -#define MBOX_INT_STATUS_TX_NOT_EMPTY_MSB WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_MSB -#define MBOX_INT_STATUS_TX_NOT_EMPTY_LSB WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_LSB -#define MBOX_INT_STATUS_TX_NOT_EMPTY_MASK WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_MASK -#define MBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) -#define MBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) -#define MBOX_INT_STATUS_RX_NOT_FULL_MSB WLAN_MBOX_INT_STATUS_RX_NOT_FULL_MSB -#define MBOX_INT_STATUS_RX_NOT_FULL_LSB WLAN_MBOX_INT_STATUS_RX_NOT_FULL_LSB -#define MBOX_INT_STATUS_RX_NOT_FULL_MASK WLAN_MBOX_INT_STATUS_RX_NOT_FULL_MASK -#define MBOX_INT_STATUS_RX_NOT_FULL_GET(x) WLAN_MBOX_INT_STATUS_RX_NOT_FULL_GET(x) -#define MBOX_INT_STATUS_RX_NOT_FULL_SET(x) WLAN_MBOX_INT_STATUS_RX_NOT_FULL_SET(x) -#define MBOX_INT_STATUS_HOST_MSB WLAN_MBOX_INT_STATUS_HOST_MSB -#define MBOX_INT_STATUS_HOST_LSB WLAN_MBOX_INT_STATUS_HOST_LSB -#define MBOX_INT_STATUS_HOST_MASK WLAN_MBOX_INT_STATUS_HOST_MASK -#define MBOX_INT_STATUS_HOST_GET(x) WLAN_MBOX_INT_STATUS_HOST_GET(x) -#define MBOX_INT_STATUS_HOST_SET(x) WLAN_MBOX_INT_STATUS_HOST_SET(x) -#define MBOX_INT_ENABLE_ADDRESS WLAN_MBOX_INT_ENABLE_ADDRESS -#define MBOX_INT_ENABLE_OFFSET WLAN_MBOX_INT_ENABLE_OFFSET -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) -#define MBOX_INT_ENABLE_TX_OVERFLOW_MSB WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_MSB -#define MBOX_INT_ENABLE_TX_OVERFLOW_LSB WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_LSB -#define MBOX_INT_ENABLE_TX_OVERFLOW_MASK WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_MASK -#define MBOX_INT_ENABLE_TX_OVERFLOW_GET(x) WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_GET(x) -#define MBOX_INT_ENABLE_TX_OVERFLOW_SET(x) WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_SET(x) -#define MBOX_INT_ENABLE_RX_UNDERFLOW_MSB WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_MSB -#define MBOX_INT_ENABLE_RX_UNDERFLOW_LSB WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_LSB -#define MBOX_INT_ENABLE_RX_UNDERFLOW_MASK WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_MASK -#define MBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) -#define MBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MSB WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_MSB -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) -#define MBOX_INT_ENABLE_RX_NOT_FULL_MSB WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_MSB -#define MBOX_INT_ENABLE_RX_NOT_FULL_LSB WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_LSB -#define MBOX_INT_ENABLE_RX_NOT_FULL_MASK WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_MASK -#define MBOX_INT_ENABLE_RX_NOT_FULL_GET(x) WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_GET(x) -#define MBOX_INT_ENABLE_RX_NOT_FULL_SET(x) WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_SET(x) -#define MBOX_INT_ENABLE_HOST_MSB WLAN_MBOX_INT_ENABLE_HOST_MSB -#define MBOX_INT_ENABLE_HOST_LSB WLAN_MBOX_INT_ENABLE_HOST_LSB -#define MBOX_INT_ENABLE_HOST_MASK WLAN_MBOX_INT_ENABLE_HOST_MASK -#define MBOX_INT_ENABLE_HOST_GET(x) WLAN_MBOX_INT_ENABLE_HOST_GET(x) -#define MBOX_INT_ENABLE_HOST_SET(x) WLAN_MBOX_INT_ENABLE_HOST_SET(x) -#define INT_HOST_ADDRESS WLAN_INT_HOST_ADDRESS -#define INT_HOST_OFFSET WLAN_INT_HOST_OFFSET -#define INT_HOST_VECTOR_MSB WLAN_INT_HOST_VECTOR_MSB -#define INT_HOST_VECTOR_LSB WLAN_INT_HOST_VECTOR_LSB -#define INT_HOST_VECTOR_MASK WLAN_INT_HOST_VECTOR_MASK -#define INT_HOST_VECTOR_GET(x) WLAN_INT_HOST_VECTOR_GET(x) -#define INT_HOST_VECTOR_SET(x) WLAN_INT_HOST_VECTOR_SET(x) -#define LOCAL_COUNT_ADDRESS WLAN_LOCAL_COUNT_ADDRESS -#define LOCAL_COUNT_OFFSET WLAN_LOCAL_COUNT_OFFSET -#define LOCAL_COUNT_VALUE_MSB WLAN_LOCAL_COUNT_VALUE_MSB -#define LOCAL_COUNT_VALUE_LSB WLAN_LOCAL_COUNT_VALUE_LSB -#define LOCAL_COUNT_VALUE_MASK WLAN_LOCAL_COUNT_VALUE_MASK -#define LOCAL_COUNT_VALUE_GET(x) WLAN_LOCAL_COUNT_VALUE_GET(x) -#define LOCAL_COUNT_VALUE_SET(x) WLAN_LOCAL_COUNT_VALUE_SET(x) -#define COUNT_INC_ADDRESS WLAN_COUNT_INC_ADDRESS -#define COUNT_INC_OFFSET WLAN_COUNT_INC_OFFSET -#define COUNT_INC_VALUE_MSB WLAN_COUNT_INC_VALUE_MSB -#define COUNT_INC_VALUE_LSB WLAN_COUNT_INC_VALUE_LSB -#define COUNT_INC_VALUE_MASK WLAN_COUNT_INC_VALUE_MASK -#define COUNT_INC_VALUE_GET(x) WLAN_COUNT_INC_VALUE_GET(x) -#define COUNT_INC_VALUE_SET(x) WLAN_COUNT_INC_VALUE_SET(x) -#define LOCAL_SCRATCH_ADDRESS WLAN_LOCAL_SCRATCH_ADDRESS -#define LOCAL_SCRATCH_OFFSET WLAN_LOCAL_SCRATCH_OFFSET -#define LOCAL_SCRATCH_VALUE_MSB WLAN_LOCAL_SCRATCH_VALUE_MSB -#define LOCAL_SCRATCH_VALUE_LSB WLAN_LOCAL_SCRATCH_VALUE_LSB -#define LOCAL_SCRATCH_VALUE_MASK WLAN_LOCAL_SCRATCH_VALUE_MASK -#define LOCAL_SCRATCH_VALUE_GET(x) WLAN_LOCAL_SCRATCH_VALUE_GET(x) -#define LOCAL_SCRATCH_VALUE_SET(x) WLAN_LOCAL_SCRATCH_VALUE_SET(x) -#define USE_LOCAL_BUS_ADDRESS WLAN_USE_LOCAL_BUS_ADDRESS -#define USE_LOCAL_BUS_OFFSET WLAN_USE_LOCAL_BUS_OFFSET -#define USE_LOCAL_BUS_PIN_INIT_MSB WLAN_USE_LOCAL_BUS_PIN_INIT_MSB -#define USE_LOCAL_BUS_PIN_INIT_LSB WLAN_USE_LOCAL_BUS_PIN_INIT_LSB -#define USE_LOCAL_BUS_PIN_INIT_MASK WLAN_USE_LOCAL_BUS_PIN_INIT_MASK -#define USE_LOCAL_BUS_PIN_INIT_GET(x) WLAN_USE_LOCAL_BUS_PIN_INIT_GET(x) -#define USE_LOCAL_BUS_PIN_INIT_SET(x) WLAN_USE_LOCAL_BUS_PIN_INIT_SET(x) -#define SDIO_CONFIG_ADDRESS WLAN_SDIO_CONFIG_ADDRESS -#define SDIO_CONFIG_OFFSET WLAN_SDIO_CONFIG_OFFSET -#define SDIO_CONFIG_CCCR_IOR1_MSB WLAN_SDIO_CONFIG_CCCR_IOR1_MSB -#define SDIO_CONFIG_CCCR_IOR1_LSB WLAN_SDIO_CONFIG_CCCR_IOR1_LSB -#define SDIO_CONFIG_CCCR_IOR1_MASK WLAN_SDIO_CONFIG_CCCR_IOR1_MASK -#define SDIO_CONFIG_CCCR_IOR1_GET(x) WLAN_SDIO_CONFIG_CCCR_IOR1_GET(x) -#define SDIO_CONFIG_CCCR_IOR1_SET(x) WLAN_SDIO_CONFIG_CCCR_IOR1_SET(x) -#define MBOX_DEBUG_ADDRESS WLAN_MBOX_DEBUG_ADDRESS -#define MBOX_DEBUG_OFFSET WLAN_MBOX_DEBUG_OFFSET -#define MBOX_DEBUG_SEL_MSB WLAN_MBOX_DEBUG_SEL_MSB -#define MBOX_DEBUG_SEL_LSB WLAN_MBOX_DEBUG_SEL_LSB -#define MBOX_DEBUG_SEL_MASK WLAN_MBOX_DEBUG_SEL_MASK -#define MBOX_DEBUG_SEL_GET(x) WLAN_MBOX_DEBUG_SEL_GET(x) -#define MBOX_DEBUG_SEL_SET(x) WLAN_MBOX_DEBUG_SEL_SET(x) -#define MBOX_FIFO_RESET_ADDRESS WLAN_MBOX_FIFO_RESET_ADDRESS -#define MBOX_FIFO_RESET_OFFSET WLAN_MBOX_FIFO_RESET_OFFSET -#define MBOX_FIFO_RESET_INIT_MSB WLAN_MBOX_FIFO_RESET_INIT_MSB -#define MBOX_FIFO_RESET_INIT_LSB WLAN_MBOX_FIFO_RESET_INIT_LSB -#define MBOX_FIFO_RESET_INIT_MASK WLAN_MBOX_FIFO_RESET_INIT_MASK -#define MBOX_FIFO_RESET_INIT_GET(x) WLAN_MBOX_FIFO_RESET_INIT_GET(x) -#define MBOX_FIFO_RESET_INIT_SET(x) WLAN_MBOX_FIFO_RESET_INIT_SET(x) -#define MBOX_TXFIFO_POP_ADDRESS WLAN_MBOX_TXFIFO_POP_ADDRESS -#define MBOX_TXFIFO_POP_OFFSET WLAN_MBOX_TXFIFO_POP_OFFSET -#define MBOX_TXFIFO_POP_DATA_MSB WLAN_MBOX_TXFIFO_POP_DATA_MSB -#define MBOX_TXFIFO_POP_DATA_LSB WLAN_MBOX_TXFIFO_POP_DATA_LSB -#define MBOX_TXFIFO_POP_DATA_MASK WLAN_MBOX_TXFIFO_POP_DATA_MASK -#define MBOX_TXFIFO_POP_DATA_GET(x) WLAN_MBOX_TXFIFO_POP_DATA_GET(x) -#define MBOX_TXFIFO_POP_DATA_SET(x) WLAN_MBOX_TXFIFO_POP_DATA_SET(x) -#define MBOX_RXFIFO_POP_ADDRESS WLAN_MBOX_RXFIFO_POP_ADDRESS -#define MBOX_RXFIFO_POP_OFFSET WLAN_MBOX_RXFIFO_POP_OFFSET -#define MBOX_RXFIFO_POP_DATA_MSB WLAN_MBOX_RXFIFO_POP_DATA_MSB -#define MBOX_RXFIFO_POP_DATA_LSB WLAN_MBOX_RXFIFO_POP_DATA_LSB -#define MBOX_RXFIFO_POP_DATA_MASK WLAN_MBOX_RXFIFO_POP_DATA_MASK -#define MBOX_RXFIFO_POP_DATA_GET(x) WLAN_MBOX_RXFIFO_POP_DATA_GET(x) -#define MBOX_RXFIFO_POP_DATA_SET(x) WLAN_MBOX_RXFIFO_POP_DATA_SET(x) -#define SDIO_DEBUG_ADDRESS WLAN_SDIO_DEBUG_ADDRESS -#define SDIO_DEBUG_OFFSET WLAN_SDIO_DEBUG_OFFSET -#define SDIO_DEBUG_SEL_MSB WLAN_SDIO_DEBUG_SEL_MSB -#define SDIO_DEBUG_SEL_LSB WLAN_SDIO_DEBUG_SEL_LSB -#define SDIO_DEBUG_SEL_MASK WLAN_SDIO_DEBUG_SEL_MASK -#define SDIO_DEBUG_SEL_GET(x) WLAN_SDIO_DEBUG_SEL_GET(x) -#define SDIO_DEBUG_SEL_SET(x) WLAN_SDIO_DEBUG_SEL_SET(x) -#define GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS -#define GMBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET -#define GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB -#define GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB -#define GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK -#define GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define GMBOX0_DMA_RX_CONTROL_ADDRESS WLAN_GMBOX0_DMA_RX_CONTROL_ADDRESS -#define GMBOX0_DMA_RX_CONTROL_OFFSET WLAN_GMBOX0_DMA_RX_CONTROL_OFFSET -#define GMBOX0_DMA_RX_CONTROL_RESUME_MSB WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_MSB -#define GMBOX0_DMA_RX_CONTROL_RESUME_LSB WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_LSB -#define GMBOX0_DMA_RX_CONTROL_RESUME_MASK WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_MASK -#define GMBOX0_DMA_RX_CONTROL_RESUME_GET(x) WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_GET(x) -#define GMBOX0_DMA_RX_CONTROL_RESUME_SET(x) WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_SET(x) -#define GMBOX0_DMA_RX_CONTROL_START_MSB WLAN_GMBOX0_DMA_RX_CONTROL_START_MSB -#define GMBOX0_DMA_RX_CONTROL_START_LSB WLAN_GMBOX0_DMA_RX_CONTROL_START_LSB -#define GMBOX0_DMA_RX_CONTROL_START_MASK WLAN_GMBOX0_DMA_RX_CONTROL_START_MASK -#define GMBOX0_DMA_RX_CONTROL_START_GET(x) WLAN_GMBOX0_DMA_RX_CONTROL_START_GET(x) -#define GMBOX0_DMA_RX_CONTROL_START_SET(x) WLAN_GMBOX0_DMA_RX_CONTROL_START_SET(x) -#define GMBOX0_DMA_RX_CONTROL_STOP_MSB WLAN_GMBOX0_DMA_RX_CONTROL_STOP_MSB -#define GMBOX0_DMA_RX_CONTROL_STOP_LSB WLAN_GMBOX0_DMA_RX_CONTROL_STOP_LSB -#define GMBOX0_DMA_RX_CONTROL_STOP_MASK WLAN_GMBOX0_DMA_RX_CONTROL_STOP_MASK -#define GMBOX0_DMA_RX_CONTROL_STOP_GET(x) WLAN_GMBOX0_DMA_RX_CONTROL_STOP_GET(x) -#define GMBOX0_DMA_RX_CONTROL_STOP_SET(x) WLAN_GMBOX0_DMA_RX_CONTROL_STOP_SET(x) -#define GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS -#define GMBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET -#define GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB -#define GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB -#define GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK -#define GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define GMBOX0_DMA_TX_CONTROL_ADDRESS WLAN_GMBOX0_DMA_TX_CONTROL_ADDRESS -#define GMBOX0_DMA_TX_CONTROL_OFFSET WLAN_GMBOX0_DMA_TX_CONTROL_OFFSET -#define GMBOX0_DMA_TX_CONTROL_RESUME_MSB WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_MSB -#define GMBOX0_DMA_TX_CONTROL_RESUME_LSB WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_LSB -#define GMBOX0_DMA_TX_CONTROL_RESUME_MASK WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_MASK -#define GMBOX0_DMA_TX_CONTROL_RESUME_GET(x) WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_GET(x) -#define GMBOX0_DMA_TX_CONTROL_RESUME_SET(x) WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_SET(x) -#define GMBOX0_DMA_TX_CONTROL_START_MSB WLAN_GMBOX0_DMA_TX_CONTROL_START_MSB -#define GMBOX0_DMA_TX_CONTROL_START_LSB WLAN_GMBOX0_DMA_TX_CONTROL_START_LSB -#define GMBOX0_DMA_TX_CONTROL_START_MASK WLAN_GMBOX0_DMA_TX_CONTROL_START_MASK -#define GMBOX0_DMA_TX_CONTROL_START_GET(x) WLAN_GMBOX0_DMA_TX_CONTROL_START_GET(x) -#define GMBOX0_DMA_TX_CONTROL_START_SET(x) WLAN_GMBOX0_DMA_TX_CONTROL_START_SET(x) -#define GMBOX0_DMA_TX_CONTROL_STOP_MSB WLAN_GMBOX0_DMA_TX_CONTROL_STOP_MSB -#define GMBOX0_DMA_TX_CONTROL_STOP_LSB WLAN_GMBOX0_DMA_TX_CONTROL_STOP_LSB -#define GMBOX0_DMA_TX_CONTROL_STOP_MASK WLAN_GMBOX0_DMA_TX_CONTROL_STOP_MASK -#define GMBOX0_DMA_TX_CONTROL_STOP_GET(x) WLAN_GMBOX0_DMA_TX_CONTROL_STOP_GET(x) -#define GMBOX0_DMA_TX_CONTROL_STOP_SET(x) WLAN_GMBOX0_DMA_TX_CONTROL_STOP_SET(x) -#define GMBOX_INT_STATUS_ADDRESS WLAN_GMBOX_INT_STATUS_ADDRESS -#define GMBOX_INT_STATUS_OFFSET WLAN_GMBOX_INT_STATUS_OFFSET -#define GMBOX_INT_STATUS_TX_OVERFLOW_MSB WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_MSB -#define GMBOX_INT_STATUS_TX_OVERFLOW_LSB WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_LSB -#define GMBOX_INT_STATUS_TX_OVERFLOW_MASK WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_MASK -#define GMBOX_INT_STATUS_TX_OVERFLOW_GET(x) WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_GET(x) -#define GMBOX_INT_STATUS_TX_OVERFLOW_SET(x) WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_SET(x) -#define GMBOX_INT_STATUS_RX_UNDERFLOW_MSB WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_MSB -#define GMBOX_INT_STATUS_RX_UNDERFLOW_LSB WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_LSB -#define GMBOX_INT_STATUS_RX_UNDERFLOW_MASK WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_MASK -#define GMBOX_INT_STATUS_RX_UNDERFLOW_GET(x) WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_GET(x) -#define GMBOX_INT_STATUS_RX_UNDERFLOW_SET(x) WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_SET(x) -#define GMBOX_INT_STATUS_RX_DMA_COMPLETE_MSB WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_MSB -#define GMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB -#define GMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK -#define GMBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) -#define GMBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) -#define GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB -#define GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB -#define GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK -#define GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) -#define GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) -#define GMBOX_INT_STATUS_TX_DMA_COMPLETE_MSB WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_MSB -#define GMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB -#define GMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK -#define GMBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) -#define GMBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) -#define GMBOX_INT_STATUS_TX_NOT_EMPTY_MSB WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_MSB -#define GMBOX_INT_STATUS_TX_NOT_EMPTY_LSB WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_LSB -#define GMBOX_INT_STATUS_TX_NOT_EMPTY_MASK WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_MASK -#define GMBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) -#define GMBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) -#define GMBOX_INT_STATUS_RX_NOT_FULL_MSB WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_MSB -#define GMBOX_INT_STATUS_RX_NOT_FULL_LSB WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_LSB -#define GMBOX_INT_STATUS_RX_NOT_FULL_MASK WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_MASK -#define GMBOX_INT_STATUS_RX_NOT_FULL_GET(x) WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_GET(x) -#define GMBOX_INT_STATUS_RX_NOT_FULL_SET(x) WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_SET(x) -#define GMBOX_INT_ENABLE_ADDRESS WLAN_GMBOX_INT_ENABLE_ADDRESS -#define GMBOX_INT_ENABLE_OFFSET WLAN_GMBOX_INT_ENABLE_OFFSET -#define GMBOX_INT_ENABLE_TX_OVERFLOW_MSB WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_MSB -#define GMBOX_INT_ENABLE_TX_OVERFLOW_LSB WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_LSB -#define GMBOX_INT_ENABLE_TX_OVERFLOW_MASK WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_MASK -#define GMBOX_INT_ENABLE_TX_OVERFLOW_GET(x) WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_GET(x) -#define GMBOX_INT_ENABLE_TX_OVERFLOW_SET(x) WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_SET(x) -#define GMBOX_INT_ENABLE_RX_UNDERFLOW_MSB WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_MSB -#define GMBOX_INT_ENABLE_RX_UNDERFLOW_LSB WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_LSB -#define GMBOX_INT_ENABLE_RX_UNDERFLOW_MASK WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_MASK -#define GMBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) -#define GMBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) -#define GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB -#define GMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB -#define GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK -#define GMBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) -#define GMBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) -#define GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB -#define GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB -#define GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK -#define GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) -#define GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) -#define GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB -#define GMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB -#define GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK -#define GMBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) -#define GMBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) -#define GMBOX_INT_ENABLE_TX_NOT_EMPTY_MSB WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_MSB -#define GMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB -#define GMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK -#define GMBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) -#define GMBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) -#define GMBOX_INT_ENABLE_RX_NOT_FULL_MSB WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_MSB -#define GMBOX_INT_ENABLE_RX_NOT_FULL_LSB WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_LSB -#define GMBOX_INT_ENABLE_RX_NOT_FULL_MASK WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_MASK -#define GMBOX_INT_ENABLE_RX_NOT_FULL_GET(x) WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_GET(x) -#define GMBOX_INT_ENABLE_RX_NOT_FULL_SET(x) WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_SET(x) -#define HOST_IF_WINDOW_ADDRESS WLAN_HOST_IF_WINDOW_ADDRESS -#define HOST_IF_WINDOW_OFFSET WLAN_HOST_IF_WINDOW_OFFSET -#define HOST_IF_WINDOW_DATA_MSB WLAN_HOST_IF_WINDOW_DATA_MSB -#define HOST_IF_WINDOW_DATA_LSB WLAN_HOST_IF_WINDOW_DATA_LSB -#define HOST_IF_WINDOW_DATA_MASK WLAN_HOST_IF_WINDOW_DATA_MASK -#define HOST_IF_WINDOW_DATA_GET(x) WLAN_HOST_IF_WINDOW_DATA_GET(x) -#define HOST_IF_WINDOW_DATA_SET(x) WLAN_HOST_IF_WINDOW_DATA_SET(x) - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_wlan_host_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_wlan_host_reg.h deleted file mode 100644 index ba03a4876cd7..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_wlan_host_reg.h +++ /dev/null @@ -1,522 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _MBOX_WLAN_HOST_REG_REG_H_ -#define _MBOX_WLAN_HOST_REG_REG_H_ - -#define HOST_INT_STATUS_ADDRESS 0x00000400 -#define HOST_INT_STATUS_OFFSET 0x00000400 -#define HOST_INT_STATUS_ERROR_MSB 7 -#define HOST_INT_STATUS_ERROR_LSB 7 -#define HOST_INT_STATUS_ERROR_MASK 0x00000080 -#define HOST_INT_STATUS_ERROR_GET(x) (((x) & HOST_INT_STATUS_ERROR_MASK) >> HOST_INT_STATUS_ERROR_LSB) -#define HOST_INT_STATUS_ERROR_SET(x) (((x) << HOST_INT_STATUS_ERROR_LSB) & HOST_INT_STATUS_ERROR_MASK) -#define HOST_INT_STATUS_CPU_MSB 6 -#define HOST_INT_STATUS_CPU_LSB 6 -#define HOST_INT_STATUS_CPU_MASK 0x00000040 -#define HOST_INT_STATUS_CPU_GET(x) (((x) & HOST_INT_STATUS_CPU_MASK) >> HOST_INT_STATUS_CPU_LSB) -#define HOST_INT_STATUS_CPU_SET(x) (((x) << HOST_INT_STATUS_CPU_LSB) & HOST_INT_STATUS_CPU_MASK) -#define HOST_INT_STATUS_INT_MSB 5 -#define HOST_INT_STATUS_INT_LSB 5 -#define HOST_INT_STATUS_INT_MASK 0x00000020 -#define HOST_INT_STATUS_INT_GET(x) (((x) & HOST_INT_STATUS_INT_MASK) >> HOST_INT_STATUS_INT_LSB) -#define HOST_INT_STATUS_INT_SET(x) (((x) << HOST_INT_STATUS_INT_LSB) & HOST_INT_STATUS_INT_MASK) -#define HOST_INT_STATUS_COUNTER_MSB 4 -#define HOST_INT_STATUS_COUNTER_LSB 4 -#define HOST_INT_STATUS_COUNTER_MASK 0x00000010 -#define HOST_INT_STATUS_COUNTER_GET(x) (((x) & HOST_INT_STATUS_COUNTER_MASK) >> HOST_INT_STATUS_COUNTER_LSB) -#define HOST_INT_STATUS_COUNTER_SET(x) (((x) << HOST_INT_STATUS_COUNTER_LSB) & HOST_INT_STATUS_COUNTER_MASK) -#define HOST_INT_STATUS_MBOX_DATA_MSB 3 -#define HOST_INT_STATUS_MBOX_DATA_LSB 0 -#define HOST_INT_STATUS_MBOX_DATA_MASK 0x0000000f -#define HOST_INT_STATUS_MBOX_DATA_GET(x) (((x) & HOST_INT_STATUS_MBOX_DATA_MASK) >> HOST_INT_STATUS_MBOX_DATA_LSB) -#define HOST_INT_STATUS_MBOX_DATA_SET(x) (((x) << HOST_INT_STATUS_MBOX_DATA_LSB) & HOST_INT_STATUS_MBOX_DATA_MASK) - -#define CPU_INT_STATUS_ADDRESS 0x00000401 -#define CPU_INT_STATUS_OFFSET 0x00000401 -#define CPU_INT_STATUS_BIT_MSB 7 -#define CPU_INT_STATUS_BIT_LSB 0 -#define CPU_INT_STATUS_BIT_MASK 0x000000ff -#define CPU_INT_STATUS_BIT_GET(x) (((x) & CPU_INT_STATUS_BIT_MASK) >> CPU_INT_STATUS_BIT_LSB) -#define CPU_INT_STATUS_BIT_SET(x) (((x) << CPU_INT_STATUS_BIT_LSB) & CPU_INT_STATUS_BIT_MASK) - -#define ERROR_INT_STATUS_ADDRESS 0x00000402 -#define ERROR_INT_STATUS_OFFSET 0x00000402 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_MSB 6 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_LSB 6 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_MASK 0x00000040 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_GET(x) (((x) & ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_MASK) >> ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_LSB) -#define ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_SET(x) (((x) << ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_LSB) & ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_MASK) -#define ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_MSB 5 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_LSB 5 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_MASK 0x00000020 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_GET(x) (((x) & ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_MASK) >> ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_LSB) -#define ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_SET(x) (((x) << ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_LSB) & ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_MASK) -#define ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_MSB 4 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_LSB 4 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_MASK 0x00000010 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_GET(x) (((x) & ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_MASK) >> ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_LSB) -#define ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_SET(x) (((x) << ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_LSB) & ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_MASK) -#define ERROR_INT_STATUS_SPI_MSB 3 -#define ERROR_INT_STATUS_SPI_LSB 3 -#define ERROR_INT_STATUS_SPI_MASK 0x00000008 -#define ERROR_INT_STATUS_SPI_GET(x) (((x) & ERROR_INT_STATUS_SPI_MASK) >> ERROR_INT_STATUS_SPI_LSB) -#define ERROR_INT_STATUS_SPI_SET(x) (((x) << ERROR_INT_STATUS_SPI_LSB) & ERROR_INT_STATUS_SPI_MASK) -#define ERROR_INT_STATUS_WAKEUP_MSB 2 -#define ERROR_INT_STATUS_WAKEUP_LSB 2 -#define ERROR_INT_STATUS_WAKEUP_MASK 0x00000004 -#define ERROR_INT_STATUS_WAKEUP_GET(x) (((x) & ERROR_INT_STATUS_WAKEUP_MASK) >> ERROR_INT_STATUS_WAKEUP_LSB) -#define ERROR_INT_STATUS_WAKEUP_SET(x) (((x) << ERROR_INT_STATUS_WAKEUP_LSB) & ERROR_INT_STATUS_WAKEUP_MASK) -#define ERROR_INT_STATUS_RX_UNDERFLOW_MSB 1 -#define ERROR_INT_STATUS_RX_UNDERFLOW_LSB 1 -#define ERROR_INT_STATUS_RX_UNDERFLOW_MASK 0x00000002 -#define ERROR_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) >> ERROR_INT_STATUS_RX_UNDERFLOW_LSB) -#define ERROR_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << ERROR_INT_STATUS_RX_UNDERFLOW_LSB) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) -#define ERROR_INT_STATUS_TX_OVERFLOW_MSB 0 -#define ERROR_INT_STATUS_TX_OVERFLOW_LSB 0 -#define ERROR_INT_STATUS_TX_OVERFLOW_MASK 0x00000001 -#define ERROR_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) >> ERROR_INT_STATUS_TX_OVERFLOW_LSB) -#define ERROR_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << ERROR_INT_STATUS_TX_OVERFLOW_LSB) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) - -#define COUNTER_INT_STATUS_ADDRESS 0x00000403 -#define COUNTER_INT_STATUS_OFFSET 0x00000403 -#define COUNTER_INT_STATUS_COUNTER_MSB 7 -#define COUNTER_INT_STATUS_COUNTER_LSB 0 -#define COUNTER_INT_STATUS_COUNTER_MASK 0x000000ff -#define COUNTER_INT_STATUS_COUNTER_GET(x) (((x) & COUNTER_INT_STATUS_COUNTER_MASK) >> COUNTER_INT_STATUS_COUNTER_LSB) -#define COUNTER_INT_STATUS_COUNTER_SET(x) (((x) << COUNTER_INT_STATUS_COUNTER_LSB) & COUNTER_INT_STATUS_COUNTER_MASK) - -#define MBOX_FRAME_ADDRESS 0x00000404 -#define MBOX_FRAME_OFFSET 0x00000404 -#define MBOX_FRAME_RX_EOM_MSB 7 -#define MBOX_FRAME_RX_EOM_LSB 4 -#define MBOX_FRAME_RX_EOM_MASK 0x000000f0 -#define MBOX_FRAME_RX_EOM_GET(x) (((x) & MBOX_FRAME_RX_EOM_MASK) >> MBOX_FRAME_RX_EOM_LSB) -#define MBOX_FRAME_RX_EOM_SET(x) (((x) << MBOX_FRAME_RX_EOM_LSB) & MBOX_FRAME_RX_EOM_MASK) -#define MBOX_FRAME_RX_SOM_MSB 3 -#define MBOX_FRAME_RX_SOM_LSB 0 -#define MBOX_FRAME_RX_SOM_MASK 0x0000000f -#define MBOX_FRAME_RX_SOM_GET(x) (((x) & MBOX_FRAME_RX_SOM_MASK) >> MBOX_FRAME_RX_SOM_LSB) -#define MBOX_FRAME_RX_SOM_SET(x) (((x) << MBOX_FRAME_RX_SOM_LSB) & MBOX_FRAME_RX_SOM_MASK) - -#define RX_LOOKAHEAD_VALID_ADDRESS 0x00000405 -#define RX_LOOKAHEAD_VALID_OFFSET 0x00000405 -#define RX_LOOKAHEAD_VALID_MBOX_MSB 3 -#define RX_LOOKAHEAD_VALID_MBOX_LSB 0 -#define RX_LOOKAHEAD_VALID_MBOX_MASK 0x0000000f -#define RX_LOOKAHEAD_VALID_MBOX_GET(x) (((x) & RX_LOOKAHEAD_VALID_MBOX_MASK) >> RX_LOOKAHEAD_VALID_MBOX_LSB) -#define RX_LOOKAHEAD_VALID_MBOX_SET(x) (((x) << RX_LOOKAHEAD_VALID_MBOX_LSB) & RX_LOOKAHEAD_VALID_MBOX_MASK) - -#define HOST_INT_STATUS2_ADDRESS 0x00000406 -#define HOST_INT_STATUS2_OFFSET 0x00000406 -#define HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_MSB 2 -#define HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_LSB 2 -#define HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_MASK 0x00000004 -#define HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_GET(x) (((x) & HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_MASK) >> HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_LSB) -#define HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_SET(x) (((x) << HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_LSB) & HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_MASK) -#define HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_MSB 1 -#define HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_LSB 1 -#define HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_MASK 0x00000002 -#define HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_GET(x) (((x) & HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_MASK) >> HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_LSB) -#define HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_SET(x) (((x) << HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_LSB) & HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_MASK) -#define HOST_INT_STATUS2_GMBOX_DATA_MSB 0 -#define HOST_INT_STATUS2_GMBOX_DATA_LSB 0 -#define HOST_INT_STATUS2_GMBOX_DATA_MASK 0x00000001 -#define HOST_INT_STATUS2_GMBOX_DATA_GET(x) (((x) & HOST_INT_STATUS2_GMBOX_DATA_MASK) >> HOST_INT_STATUS2_GMBOX_DATA_LSB) -#define HOST_INT_STATUS2_GMBOX_DATA_SET(x) (((x) << HOST_INT_STATUS2_GMBOX_DATA_LSB) & HOST_INT_STATUS2_GMBOX_DATA_MASK) - -#define GMBOX_RX_AVAIL_ADDRESS 0x00000407 -#define GMBOX_RX_AVAIL_OFFSET 0x00000407 -#define GMBOX_RX_AVAIL_BYTE_MSB 6 -#define GMBOX_RX_AVAIL_BYTE_LSB 0 -#define GMBOX_RX_AVAIL_BYTE_MASK 0x0000007f -#define GMBOX_RX_AVAIL_BYTE_GET(x) (((x) & GMBOX_RX_AVAIL_BYTE_MASK) >> GMBOX_RX_AVAIL_BYTE_LSB) -#define GMBOX_RX_AVAIL_BYTE_SET(x) (((x) << GMBOX_RX_AVAIL_BYTE_LSB) & GMBOX_RX_AVAIL_BYTE_MASK) - -#define RX_LOOKAHEAD0_ADDRESS 0x00000408 -#define RX_LOOKAHEAD0_OFFSET 0x00000408 -#define RX_LOOKAHEAD0_DATA_MSB 7 -#define RX_LOOKAHEAD0_DATA_LSB 0 -#define RX_LOOKAHEAD0_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD0_DATA_GET(x) (((x) & RX_LOOKAHEAD0_DATA_MASK) >> RX_LOOKAHEAD0_DATA_LSB) -#define RX_LOOKAHEAD0_DATA_SET(x) (((x) << RX_LOOKAHEAD0_DATA_LSB) & RX_LOOKAHEAD0_DATA_MASK) - -#define RX_LOOKAHEAD1_ADDRESS 0x0000040c -#define RX_LOOKAHEAD1_OFFSET 0x0000040c -#define RX_LOOKAHEAD1_DATA_MSB 7 -#define RX_LOOKAHEAD1_DATA_LSB 0 -#define RX_LOOKAHEAD1_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD1_DATA_GET(x) (((x) & RX_LOOKAHEAD1_DATA_MASK) >> RX_LOOKAHEAD1_DATA_LSB) -#define RX_LOOKAHEAD1_DATA_SET(x) (((x) << RX_LOOKAHEAD1_DATA_LSB) & RX_LOOKAHEAD1_DATA_MASK) - -#define RX_LOOKAHEAD2_ADDRESS 0x00000410 -#define RX_LOOKAHEAD2_OFFSET 0x00000410 -#define RX_LOOKAHEAD2_DATA_MSB 7 -#define RX_LOOKAHEAD2_DATA_LSB 0 -#define RX_LOOKAHEAD2_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD2_DATA_GET(x) (((x) & RX_LOOKAHEAD2_DATA_MASK) >> RX_LOOKAHEAD2_DATA_LSB) -#define RX_LOOKAHEAD2_DATA_SET(x) (((x) << RX_LOOKAHEAD2_DATA_LSB) & RX_LOOKAHEAD2_DATA_MASK) - -#define RX_LOOKAHEAD3_ADDRESS 0x00000414 -#define RX_LOOKAHEAD3_OFFSET 0x00000414 -#define RX_LOOKAHEAD3_DATA_MSB 7 -#define RX_LOOKAHEAD3_DATA_LSB 0 -#define RX_LOOKAHEAD3_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD3_DATA_GET(x) (((x) & RX_LOOKAHEAD3_DATA_MASK) >> RX_LOOKAHEAD3_DATA_LSB) -#define RX_LOOKAHEAD3_DATA_SET(x) (((x) << RX_LOOKAHEAD3_DATA_LSB) & RX_LOOKAHEAD3_DATA_MASK) - -#define INT_STATUS_ENABLE_ADDRESS 0x00000418 -#define INT_STATUS_ENABLE_OFFSET 0x00000418 -#define INT_STATUS_ENABLE_ERROR_MSB 7 -#define INT_STATUS_ENABLE_ERROR_LSB 7 -#define INT_STATUS_ENABLE_ERROR_MASK 0x00000080 -#define INT_STATUS_ENABLE_ERROR_GET(x) (((x) & INT_STATUS_ENABLE_ERROR_MASK) >> INT_STATUS_ENABLE_ERROR_LSB) -#define INT_STATUS_ENABLE_ERROR_SET(x) (((x) << INT_STATUS_ENABLE_ERROR_LSB) & INT_STATUS_ENABLE_ERROR_MASK) -#define INT_STATUS_ENABLE_CPU_MSB 6 -#define INT_STATUS_ENABLE_CPU_LSB 6 -#define INT_STATUS_ENABLE_CPU_MASK 0x00000040 -#define INT_STATUS_ENABLE_CPU_GET(x) (((x) & INT_STATUS_ENABLE_CPU_MASK) >> INT_STATUS_ENABLE_CPU_LSB) -#define INT_STATUS_ENABLE_CPU_SET(x) (((x) << INT_STATUS_ENABLE_CPU_LSB) & INT_STATUS_ENABLE_CPU_MASK) -#define INT_STATUS_ENABLE_INT_MSB 5 -#define INT_STATUS_ENABLE_INT_LSB 5 -#define INT_STATUS_ENABLE_INT_MASK 0x00000020 -#define INT_STATUS_ENABLE_INT_GET(x) (((x) & INT_STATUS_ENABLE_INT_MASK) >> INT_STATUS_ENABLE_INT_LSB) -#define INT_STATUS_ENABLE_INT_SET(x) (((x) << INT_STATUS_ENABLE_INT_LSB) & INT_STATUS_ENABLE_INT_MASK) -#define INT_STATUS_ENABLE_COUNTER_MSB 4 -#define INT_STATUS_ENABLE_COUNTER_LSB 4 -#define INT_STATUS_ENABLE_COUNTER_MASK 0x00000010 -#define INT_STATUS_ENABLE_COUNTER_GET(x) (((x) & INT_STATUS_ENABLE_COUNTER_MASK) >> INT_STATUS_ENABLE_COUNTER_LSB) -#define INT_STATUS_ENABLE_COUNTER_SET(x) (((x) << INT_STATUS_ENABLE_COUNTER_LSB) & INT_STATUS_ENABLE_COUNTER_MASK) -#define INT_STATUS_ENABLE_MBOX_DATA_MSB 3 -#define INT_STATUS_ENABLE_MBOX_DATA_LSB 0 -#define INT_STATUS_ENABLE_MBOX_DATA_MASK 0x0000000f -#define INT_STATUS_ENABLE_MBOX_DATA_GET(x) (((x) & INT_STATUS_ENABLE_MBOX_DATA_MASK) >> INT_STATUS_ENABLE_MBOX_DATA_LSB) -#define INT_STATUS_ENABLE_MBOX_DATA_SET(x) (((x) << INT_STATUS_ENABLE_MBOX_DATA_LSB) & INT_STATUS_ENABLE_MBOX_DATA_MASK) - -#define CPU_INT_STATUS_ENABLE_ADDRESS 0x00000419 -#define CPU_INT_STATUS_ENABLE_OFFSET 0x00000419 -#define CPU_INT_STATUS_ENABLE_BIT_MSB 7 -#define CPU_INT_STATUS_ENABLE_BIT_LSB 0 -#define CPU_INT_STATUS_ENABLE_BIT_MASK 0x000000ff -#define CPU_INT_STATUS_ENABLE_BIT_GET(x) (((x) & CPU_INT_STATUS_ENABLE_BIT_MASK) >> CPU_INT_STATUS_ENABLE_BIT_LSB) -#define CPU_INT_STATUS_ENABLE_BIT_SET(x) (((x) << CPU_INT_STATUS_ENABLE_BIT_LSB) & CPU_INT_STATUS_ENABLE_BIT_MASK) - -#define ERROR_STATUS_ENABLE_ADDRESS 0x0000041a -#define ERROR_STATUS_ENABLE_OFFSET 0x0000041a -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_MSB 6 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_LSB 6 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_MASK 0x00000040 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_GET(x) (((x) & ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_MASK) >> ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_LSB) -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_SET(x) (((x) << ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_LSB) & ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_MASK) -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_MSB 5 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_LSB 5 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_MASK 0x00000020 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_MASK) >> ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_LSB) -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_LSB) & ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_MASK) -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_MSB 4 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_LSB 4 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_MASK 0x00000010 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_MASK) >> ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_LSB) -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_LSB) & ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_MASK) -#define ERROR_STATUS_ENABLE_WAKEUP_MSB 2 -#define ERROR_STATUS_ENABLE_WAKEUP_LSB 2 -#define ERROR_STATUS_ENABLE_WAKEUP_MASK 0x00000004 -#define ERROR_STATUS_ENABLE_WAKEUP_GET(x) (((x) & ERROR_STATUS_ENABLE_WAKEUP_MASK) >> ERROR_STATUS_ENABLE_WAKEUP_LSB) -#define ERROR_STATUS_ENABLE_WAKEUP_SET(x) (((x) << ERROR_STATUS_ENABLE_WAKEUP_LSB) & ERROR_STATUS_ENABLE_WAKEUP_MASK) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MSB 1 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB 1 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK 0x00000002 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) >> ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MSB 0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB 0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK 0x00000001 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) >> ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) - -#define COUNTER_INT_STATUS_ENABLE_ADDRESS 0x0000041b -#define COUNTER_INT_STATUS_ENABLE_OFFSET 0x0000041b -#define COUNTER_INT_STATUS_ENABLE_BIT_MSB 7 -#define COUNTER_INT_STATUS_ENABLE_BIT_LSB 0 -#define COUNTER_INT_STATUS_ENABLE_BIT_MASK 0x000000ff -#define COUNTER_INT_STATUS_ENABLE_BIT_GET(x) (((x) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) >> COUNTER_INT_STATUS_ENABLE_BIT_LSB) -#define COUNTER_INT_STATUS_ENABLE_BIT_SET(x) (((x) << COUNTER_INT_STATUS_ENABLE_BIT_LSB) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) - -#define COUNT_ADDRESS 0x00000420 -#define COUNT_OFFSET 0x00000420 -#define COUNT_VALUE_MSB 7 -#define COUNT_VALUE_LSB 0 -#define COUNT_VALUE_MASK 0x000000ff -#define COUNT_VALUE_GET(x) (((x) & COUNT_VALUE_MASK) >> COUNT_VALUE_LSB) -#define COUNT_VALUE_SET(x) (((x) << COUNT_VALUE_LSB) & COUNT_VALUE_MASK) - -#define COUNT_DEC_ADDRESS 0x00000440 -#define COUNT_DEC_OFFSET 0x00000440 -#define COUNT_DEC_VALUE_MSB 7 -#define COUNT_DEC_VALUE_LSB 0 -#define COUNT_DEC_VALUE_MASK 0x000000ff -#define COUNT_DEC_VALUE_GET(x) (((x) & COUNT_DEC_VALUE_MASK) >> COUNT_DEC_VALUE_LSB) -#define COUNT_DEC_VALUE_SET(x) (((x) << COUNT_DEC_VALUE_LSB) & COUNT_DEC_VALUE_MASK) - -#define SCRATCH_ADDRESS 0x00000460 -#define SCRATCH_OFFSET 0x00000460 -#define SCRATCH_VALUE_MSB 7 -#define SCRATCH_VALUE_LSB 0 -#define SCRATCH_VALUE_MASK 0x000000ff -#define SCRATCH_VALUE_GET(x) (((x) & SCRATCH_VALUE_MASK) >> SCRATCH_VALUE_LSB) -#define SCRATCH_VALUE_SET(x) (((x) << SCRATCH_VALUE_LSB) & SCRATCH_VALUE_MASK) - -#define FIFO_TIMEOUT_ADDRESS 0x00000468 -#define FIFO_TIMEOUT_OFFSET 0x00000468 -#define FIFO_TIMEOUT_VALUE_MSB 7 -#define FIFO_TIMEOUT_VALUE_LSB 0 -#define FIFO_TIMEOUT_VALUE_MASK 0x000000ff -#define FIFO_TIMEOUT_VALUE_GET(x) (((x) & FIFO_TIMEOUT_VALUE_MASK) >> FIFO_TIMEOUT_VALUE_LSB) -#define FIFO_TIMEOUT_VALUE_SET(x) (((x) << FIFO_TIMEOUT_VALUE_LSB) & FIFO_TIMEOUT_VALUE_MASK) - -#define FIFO_TIMEOUT_ENABLE_ADDRESS 0x00000469 -#define FIFO_TIMEOUT_ENABLE_OFFSET 0x00000469 -#define FIFO_TIMEOUT_ENABLE_SET_MSB 0 -#define FIFO_TIMEOUT_ENABLE_SET_LSB 0 -#define FIFO_TIMEOUT_ENABLE_SET_MASK 0x00000001 -#define FIFO_TIMEOUT_ENABLE_SET_GET(x) (((x) & FIFO_TIMEOUT_ENABLE_SET_MASK) >> FIFO_TIMEOUT_ENABLE_SET_LSB) -#define FIFO_TIMEOUT_ENABLE_SET_SET(x) (((x) << FIFO_TIMEOUT_ENABLE_SET_LSB) & FIFO_TIMEOUT_ENABLE_SET_MASK) - -#define DISABLE_SLEEP_ADDRESS 0x0000046a -#define DISABLE_SLEEP_OFFSET 0x0000046a -#define DISABLE_SLEEP_FOR_INT_MSB 1 -#define DISABLE_SLEEP_FOR_INT_LSB 1 -#define DISABLE_SLEEP_FOR_INT_MASK 0x00000002 -#define DISABLE_SLEEP_FOR_INT_GET(x) (((x) & DISABLE_SLEEP_FOR_INT_MASK) >> DISABLE_SLEEP_FOR_INT_LSB) -#define DISABLE_SLEEP_FOR_INT_SET(x) (((x) << DISABLE_SLEEP_FOR_INT_LSB) & DISABLE_SLEEP_FOR_INT_MASK) -#define DISABLE_SLEEP_ON_MSB 0 -#define DISABLE_SLEEP_ON_LSB 0 -#define DISABLE_SLEEP_ON_MASK 0x00000001 -#define DISABLE_SLEEP_ON_GET(x) (((x) & DISABLE_SLEEP_ON_MASK) >> DISABLE_SLEEP_ON_LSB) -#define DISABLE_SLEEP_ON_SET(x) (((x) << DISABLE_SLEEP_ON_LSB) & DISABLE_SLEEP_ON_MASK) - -#define LOCAL_BUS_ADDRESS 0x00000470 -#define LOCAL_BUS_OFFSET 0x00000470 -#define LOCAL_BUS_STATE_MSB 1 -#define LOCAL_BUS_STATE_LSB 0 -#define LOCAL_BUS_STATE_MASK 0x00000003 -#define LOCAL_BUS_STATE_GET(x) (((x) & LOCAL_BUS_STATE_MASK) >> LOCAL_BUS_STATE_LSB) -#define LOCAL_BUS_STATE_SET(x) (((x) << LOCAL_BUS_STATE_LSB) & LOCAL_BUS_STATE_MASK) - -#define INT_WLAN_ADDRESS 0x00000472 -#define INT_WLAN_OFFSET 0x00000472 -#define INT_WLAN_VECTOR_MSB 7 -#define INT_WLAN_VECTOR_LSB 0 -#define INT_WLAN_VECTOR_MASK 0x000000ff -#define INT_WLAN_VECTOR_GET(x) (((x) & INT_WLAN_VECTOR_MASK) >> INT_WLAN_VECTOR_LSB) -#define INT_WLAN_VECTOR_SET(x) (((x) << INT_WLAN_VECTOR_LSB) & INT_WLAN_VECTOR_MASK) - -#define WINDOW_DATA_ADDRESS 0x00000474 -#define WINDOW_DATA_OFFSET 0x00000474 -#define WINDOW_DATA_DATA_MSB 7 -#define WINDOW_DATA_DATA_LSB 0 -#define WINDOW_DATA_DATA_MASK 0x000000ff -#define WINDOW_DATA_DATA_GET(x) (((x) & WINDOW_DATA_DATA_MASK) >> WINDOW_DATA_DATA_LSB) -#define WINDOW_DATA_DATA_SET(x) (((x) << WINDOW_DATA_DATA_LSB) & WINDOW_DATA_DATA_MASK) - -#define WINDOW_WRITE_ADDR_ADDRESS 0x00000478 -#define WINDOW_WRITE_ADDR_OFFSET 0x00000478 -#define WINDOW_WRITE_ADDR_ADDR_MSB 7 -#define WINDOW_WRITE_ADDR_ADDR_LSB 0 -#define WINDOW_WRITE_ADDR_ADDR_MASK 0x000000ff -#define WINDOW_WRITE_ADDR_ADDR_GET(x) (((x) & WINDOW_WRITE_ADDR_ADDR_MASK) >> WINDOW_WRITE_ADDR_ADDR_LSB) -#define WINDOW_WRITE_ADDR_ADDR_SET(x) (((x) << WINDOW_WRITE_ADDR_ADDR_LSB) & WINDOW_WRITE_ADDR_ADDR_MASK) - -#define WINDOW_READ_ADDR_ADDRESS 0x0000047c -#define WINDOW_READ_ADDR_OFFSET 0x0000047c -#define WINDOW_READ_ADDR_ADDR_MSB 7 -#define WINDOW_READ_ADDR_ADDR_LSB 0 -#define WINDOW_READ_ADDR_ADDR_MASK 0x000000ff -#define WINDOW_READ_ADDR_ADDR_GET(x) (((x) & WINDOW_READ_ADDR_ADDR_MASK) >> WINDOW_READ_ADDR_ADDR_LSB) -#define WINDOW_READ_ADDR_ADDR_SET(x) (((x) << WINDOW_READ_ADDR_ADDR_LSB) & WINDOW_READ_ADDR_ADDR_MASK) - -#define HOST_CTRL_SPI_CONFIG_ADDRESS 0x00000480 -#define HOST_CTRL_SPI_CONFIG_OFFSET 0x00000480 -#define HOST_CTRL_SPI_CONFIG_SPI_RESET_MSB 4 -#define HOST_CTRL_SPI_CONFIG_SPI_RESET_LSB 4 -#define HOST_CTRL_SPI_CONFIG_SPI_RESET_MASK 0x00000010 -#define HOST_CTRL_SPI_CONFIG_SPI_RESET_GET(x) (((x) & HOST_CTRL_SPI_CONFIG_SPI_RESET_MASK) >> HOST_CTRL_SPI_CONFIG_SPI_RESET_LSB) -#define HOST_CTRL_SPI_CONFIG_SPI_RESET_SET(x) (((x) << HOST_CTRL_SPI_CONFIG_SPI_RESET_LSB) & HOST_CTRL_SPI_CONFIG_SPI_RESET_MASK) -#define HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_MSB 3 -#define HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_LSB 3 -#define HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_MASK 0x00000008 -#define HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_GET(x) (((x) & HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_MASK) >> HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_LSB) -#define HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_SET(x) (((x) << HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_LSB) & HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_MASK) -#define HOST_CTRL_SPI_CONFIG_TEST_MODE_MSB 2 -#define HOST_CTRL_SPI_CONFIG_TEST_MODE_LSB 2 -#define HOST_CTRL_SPI_CONFIG_TEST_MODE_MASK 0x00000004 -#define HOST_CTRL_SPI_CONFIG_TEST_MODE_GET(x) (((x) & HOST_CTRL_SPI_CONFIG_TEST_MODE_MASK) >> HOST_CTRL_SPI_CONFIG_TEST_MODE_LSB) -#define HOST_CTRL_SPI_CONFIG_TEST_MODE_SET(x) (((x) << HOST_CTRL_SPI_CONFIG_TEST_MODE_LSB) & HOST_CTRL_SPI_CONFIG_TEST_MODE_MASK) -#define HOST_CTRL_SPI_CONFIG_DATA_SIZE_MSB 1 -#define HOST_CTRL_SPI_CONFIG_DATA_SIZE_LSB 0 -#define HOST_CTRL_SPI_CONFIG_DATA_SIZE_MASK 0x00000003 -#define HOST_CTRL_SPI_CONFIG_DATA_SIZE_GET(x) (((x) & HOST_CTRL_SPI_CONFIG_DATA_SIZE_MASK) >> HOST_CTRL_SPI_CONFIG_DATA_SIZE_LSB) -#define HOST_CTRL_SPI_CONFIG_DATA_SIZE_SET(x) (((x) << HOST_CTRL_SPI_CONFIG_DATA_SIZE_LSB) & HOST_CTRL_SPI_CONFIG_DATA_SIZE_MASK) - -#define HOST_CTRL_SPI_STATUS_ADDRESS 0x00000481 -#define HOST_CTRL_SPI_STATUS_OFFSET 0x00000481 -#define HOST_CTRL_SPI_STATUS_ADDR_ERR_MSB 3 -#define HOST_CTRL_SPI_STATUS_ADDR_ERR_LSB 3 -#define HOST_CTRL_SPI_STATUS_ADDR_ERR_MASK 0x00000008 -#define HOST_CTRL_SPI_STATUS_ADDR_ERR_GET(x) (((x) & HOST_CTRL_SPI_STATUS_ADDR_ERR_MASK) >> HOST_CTRL_SPI_STATUS_ADDR_ERR_LSB) -#define HOST_CTRL_SPI_STATUS_ADDR_ERR_SET(x) (((x) << HOST_CTRL_SPI_STATUS_ADDR_ERR_LSB) & HOST_CTRL_SPI_STATUS_ADDR_ERR_MASK) -#define HOST_CTRL_SPI_STATUS_RD_ERR_MSB 2 -#define HOST_CTRL_SPI_STATUS_RD_ERR_LSB 2 -#define HOST_CTRL_SPI_STATUS_RD_ERR_MASK 0x00000004 -#define HOST_CTRL_SPI_STATUS_RD_ERR_GET(x) (((x) & HOST_CTRL_SPI_STATUS_RD_ERR_MASK) >> HOST_CTRL_SPI_STATUS_RD_ERR_LSB) -#define HOST_CTRL_SPI_STATUS_RD_ERR_SET(x) (((x) << HOST_CTRL_SPI_STATUS_RD_ERR_LSB) & HOST_CTRL_SPI_STATUS_RD_ERR_MASK) -#define HOST_CTRL_SPI_STATUS_WR_ERR_MSB 1 -#define HOST_CTRL_SPI_STATUS_WR_ERR_LSB 1 -#define HOST_CTRL_SPI_STATUS_WR_ERR_MASK 0x00000002 -#define HOST_CTRL_SPI_STATUS_WR_ERR_GET(x) (((x) & HOST_CTRL_SPI_STATUS_WR_ERR_MASK) >> HOST_CTRL_SPI_STATUS_WR_ERR_LSB) -#define HOST_CTRL_SPI_STATUS_WR_ERR_SET(x) (((x) << HOST_CTRL_SPI_STATUS_WR_ERR_LSB) & HOST_CTRL_SPI_STATUS_WR_ERR_MASK) -#define HOST_CTRL_SPI_STATUS_READY_MSB 0 -#define HOST_CTRL_SPI_STATUS_READY_LSB 0 -#define HOST_CTRL_SPI_STATUS_READY_MASK 0x00000001 -#define HOST_CTRL_SPI_STATUS_READY_GET(x) (((x) & HOST_CTRL_SPI_STATUS_READY_MASK) >> HOST_CTRL_SPI_STATUS_READY_LSB) -#define HOST_CTRL_SPI_STATUS_READY_SET(x) (((x) << HOST_CTRL_SPI_STATUS_READY_LSB) & HOST_CTRL_SPI_STATUS_READY_MASK) - -#define NON_ASSOC_SLEEP_EN_ADDRESS 0x00000482 -#define NON_ASSOC_SLEEP_EN_OFFSET 0x00000482 -#define NON_ASSOC_SLEEP_EN_BIT_MSB 0 -#define NON_ASSOC_SLEEP_EN_BIT_LSB 0 -#define NON_ASSOC_SLEEP_EN_BIT_MASK 0x00000001 -#define NON_ASSOC_SLEEP_EN_BIT_GET(x) (((x) & NON_ASSOC_SLEEP_EN_BIT_MASK) >> NON_ASSOC_SLEEP_EN_BIT_LSB) -#define NON_ASSOC_SLEEP_EN_BIT_SET(x) (((x) << NON_ASSOC_SLEEP_EN_BIT_LSB) & NON_ASSOC_SLEEP_EN_BIT_MASK) - -#define CPU_DBG_SEL_ADDRESS 0x00000483 -#define CPU_DBG_SEL_OFFSET 0x00000483 -#define CPU_DBG_SEL_BIT_MSB 5 -#define CPU_DBG_SEL_BIT_LSB 0 -#define CPU_DBG_SEL_BIT_MASK 0x0000003f -#define CPU_DBG_SEL_BIT_GET(x) (((x) & CPU_DBG_SEL_BIT_MASK) >> CPU_DBG_SEL_BIT_LSB) -#define CPU_DBG_SEL_BIT_SET(x) (((x) << CPU_DBG_SEL_BIT_LSB) & CPU_DBG_SEL_BIT_MASK) - -#define CPU_DBG_ADDRESS 0x00000484 -#define CPU_DBG_OFFSET 0x00000484 -#define CPU_DBG_DATA_MSB 7 -#define CPU_DBG_DATA_LSB 0 -#define CPU_DBG_DATA_MASK 0x000000ff -#define CPU_DBG_DATA_GET(x) (((x) & CPU_DBG_DATA_MASK) >> CPU_DBG_DATA_LSB) -#define CPU_DBG_DATA_SET(x) (((x) << CPU_DBG_DATA_LSB) & CPU_DBG_DATA_MASK) - -#define INT_STATUS2_ENABLE_ADDRESS 0x00000488 -#define INT_STATUS2_ENABLE_OFFSET 0x00000488 -#define INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_MSB 2 -#define INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_LSB 2 -#define INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_MASK 0x00000004 -#define INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_GET(x) (((x) & INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_MASK) >> INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_LSB) -#define INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_SET(x) (((x) << INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_LSB) & INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_MASK) -#define INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_MSB 1 -#define INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_LSB 1 -#define INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_MASK 0x00000002 -#define INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_GET(x) (((x) & INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_MASK) >> INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_LSB) -#define INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_SET(x) (((x) << INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_LSB) & INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_MASK) -#define INT_STATUS2_ENABLE_GMBOX_DATA_MSB 0 -#define INT_STATUS2_ENABLE_GMBOX_DATA_LSB 0 -#define INT_STATUS2_ENABLE_GMBOX_DATA_MASK 0x00000001 -#define INT_STATUS2_ENABLE_GMBOX_DATA_GET(x) (((x) & INT_STATUS2_ENABLE_GMBOX_DATA_MASK) >> INT_STATUS2_ENABLE_GMBOX_DATA_LSB) -#define INT_STATUS2_ENABLE_GMBOX_DATA_SET(x) (((x) << INT_STATUS2_ENABLE_GMBOX_DATA_LSB) & INT_STATUS2_ENABLE_GMBOX_DATA_MASK) - -#define GMBOX_RX_LOOKAHEAD_ADDRESS 0x00000490 -#define GMBOX_RX_LOOKAHEAD_OFFSET 0x00000490 -#define GMBOX_RX_LOOKAHEAD_DATA_MSB 7 -#define GMBOX_RX_LOOKAHEAD_DATA_LSB 0 -#define GMBOX_RX_LOOKAHEAD_DATA_MASK 0x000000ff -#define GMBOX_RX_LOOKAHEAD_DATA_GET(x) (((x) & GMBOX_RX_LOOKAHEAD_DATA_MASK) >> GMBOX_RX_LOOKAHEAD_DATA_LSB) -#define GMBOX_RX_LOOKAHEAD_DATA_SET(x) (((x) << GMBOX_RX_LOOKAHEAD_DATA_LSB) & GMBOX_RX_LOOKAHEAD_DATA_MASK) - -#define GMBOX_RX_LOOKAHEAD_MUX_ADDRESS 0x00000498 -#define GMBOX_RX_LOOKAHEAD_MUX_OFFSET 0x00000498 -#define GMBOX_RX_LOOKAHEAD_MUX_SEL_MSB 0 -#define GMBOX_RX_LOOKAHEAD_MUX_SEL_LSB 0 -#define GMBOX_RX_LOOKAHEAD_MUX_SEL_MASK 0x00000001 -#define GMBOX_RX_LOOKAHEAD_MUX_SEL_GET(x) (((x) & GMBOX_RX_LOOKAHEAD_MUX_SEL_MASK) >> GMBOX_RX_LOOKAHEAD_MUX_SEL_LSB) -#define GMBOX_RX_LOOKAHEAD_MUX_SEL_SET(x) (((x) << GMBOX_RX_LOOKAHEAD_MUX_SEL_LSB) & GMBOX_RX_LOOKAHEAD_MUX_SEL_MASK) - -#define CIS_WINDOW_ADDRESS 0x00000600 -#define CIS_WINDOW_OFFSET 0x00000600 -#define CIS_WINDOW_DATA_MSB 7 -#define CIS_WINDOW_DATA_LSB 0 -#define CIS_WINDOW_DATA_MASK 0x000000ff -#define CIS_WINDOW_DATA_GET(x) (((x) & CIS_WINDOW_DATA_MASK) >> CIS_WINDOW_DATA_LSB) -#define CIS_WINDOW_DATA_SET(x) (((x) << CIS_WINDOW_DATA_LSB) & CIS_WINDOW_DATA_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct mbox_wlan_host_reg_reg_s { - unsigned char pad0[1024]; /* pad to 0x400 */ - volatile unsigned char host_int_status; - volatile unsigned char cpu_int_status; - volatile unsigned char error_int_status; - volatile unsigned char counter_int_status; - volatile unsigned char mbox_frame; - volatile unsigned char rx_lookahead_valid; - volatile unsigned char host_int_status2; - volatile unsigned char gmbox_rx_avail; - volatile unsigned char rx_lookahead0[4]; - volatile unsigned char rx_lookahead1[4]; - volatile unsigned char rx_lookahead2[4]; - volatile unsigned char rx_lookahead3[4]; - volatile unsigned char int_status_enable; - volatile unsigned char cpu_int_status_enable; - volatile unsigned char error_status_enable; - volatile unsigned char counter_int_status_enable; - unsigned char pad1[4]; /* pad to 0x420 */ - volatile unsigned char count[8]; - unsigned char pad2[24]; /* pad to 0x440 */ - volatile unsigned char count_dec[32]; - volatile unsigned char scratch[8]; - volatile unsigned char fifo_timeout; - volatile unsigned char fifo_timeout_enable; - volatile unsigned char disable_sleep; - unsigned char pad3[5]; /* pad to 0x470 */ - volatile unsigned char local_bus; - unsigned char pad4[1]; /* pad to 0x472 */ - volatile unsigned char int_wlan; - unsigned char pad5[1]; /* pad to 0x474 */ - volatile unsigned char window_data[4]; - volatile unsigned char window_write_addr[4]; - volatile unsigned char window_read_addr[4]; - volatile unsigned char host_ctrl_spi_config; - volatile unsigned char host_ctrl_spi_status; - volatile unsigned char non_assoc_sleep_en; - volatile unsigned char cpu_dbg_sel; - volatile unsigned char cpu_dbg[4]; - volatile unsigned char int_status2_enable; - unsigned char pad6[7]; /* pad to 0x490 */ - volatile unsigned char gmbox_rx_lookahead[8]; - volatile unsigned char gmbox_rx_lookahead_mux; - unsigned char pad7[359]; /* pad to 0x600 */ - volatile unsigned char cis_window[512]; -} mbox_wlan_host_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _MBOX_WLAN_HOST_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_wlan_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_wlan_reg.h deleted file mode 100644 index dc66a171c8c1..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/mbox_wlan_reg.h +++ /dev/null @@ -1,638 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _MBOX_WLAN_REG_REG_H_ -#define _MBOX_WLAN_REG_REG_H_ - -#define WLAN_MBOX_FIFO_ADDRESS 0x00000000 -#define WLAN_MBOX_FIFO_OFFSET 0x00000000 -#define WLAN_MBOX_FIFO_DATA_MSB 19 -#define WLAN_MBOX_FIFO_DATA_LSB 0 -#define WLAN_MBOX_FIFO_DATA_MASK 0x000fffff -#define WLAN_MBOX_FIFO_DATA_GET(x) (((x) & WLAN_MBOX_FIFO_DATA_MASK) >> WLAN_MBOX_FIFO_DATA_LSB) -#define WLAN_MBOX_FIFO_DATA_SET(x) (((x) << WLAN_MBOX_FIFO_DATA_LSB) & WLAN_MBOX_FIFO_DATA_MASK) - -#define WLAN_MBOX_FIFO_STATUS_ADDRESS 0x00000010 -#define WLAN_MBOX_FIFO_STATUS_OFFSET 0x00000010 -#define WLAN_MBOX_FIFO_STATUS_EMPTY_MSB 19 -#define WLAN_MBOX_FIFO_STATUS_EMPTY_LSB 16 -#define WLAN_MBOX_FIFO_STATUS_EMPTY_MASK 0x000f0000 -#define WLAN_MBOX_FIFO_STATUS_EMPTY_GET(x) (((x) & WLAN_MBOX_FIFO_STATUS_EMPTY_MASK) >> WLAN_MBOX_FIFO_STATUS_EMPTY_LSB) -#define WLAN_MBOX_FIFO_STATUS_EMPTY_SET(x) (((x) << WLAN_MBOX_FIFO_STATUS_EMPTY_LSB) & WLAN_MBOX_FIFO_STATUS_EMPTY_MASK) -#define WLAN_MBOX_FIFO_STATUS_FULL_MSB 15 -#define WLAN_MBOX_FIFO_STATUS_FULL_LSB 12 -#define WLAN_MBOX_FIFO_STATUS_FULL_MASK 0x0000f000 -#define WLAN_MBOX_FIFO_STATUS_FULL_GET(x) (((x) & WLAN_MBOX_FIFO_STATUS_FULL_MASK) >> WLAN_MBOX_FIFO_STATUS_FULL_LSB) -#define WLAN_MBOX_FIFO_STATUS_FULL_SET(x) (((x) << WLAN_MBOX_FIFO_STATUS_FULL_LSB) & WLAN_MBOX_FIFO_STATUS_FULL_MASK) - -#define WLAN_MBOX_DMA_POLICY_ADDRESS 0x00000014 -#define WLAN_MBOX_DMA_POLICY_OFFSET 0x00000014 -#define WLAN_MBOX_DMA_POLICY_TX_QUANTUM_MSB 3 -#define WLAN_MBOX_DMA_POLICY_TX_QUANTUM_LSB 3 -#define WLAN_MBOX_DMA_POLICY_TX_QUANTUM_MASK 0x00000008 -#define WLAN_MBOX_DMA_POLICY_TX_QUANTUM_GET(x) (((x) & WLAN_MBOX_DMA_POLICY_TX_QUANTUM_MASK) >> WLAN_MBOX_DMA_POLICY_TX_QUANTUM_LSB) -#define WLAN_MBOX_DMA_POLICY_TX_QUANTUM_SET(x) (((x) << WLAN_MBOX_DMA_POLICY_TX_QUANTUM_LSB) & WLAN_MBOX_DMA_POLICY_TX_QUANTUM_MASK) -#define WLAN_MBOX_DMA_POLICY_TX_ORDER_MSB 2 -#define WLAN_MBOX_DMA_POLICY_TX_ORDER_LSB 2 -#define WLAN_MBOX_DMA_POLICY_TX_ORDER_MASK 0x00000004 -#define WLAN_MBOX_DMA_POLICY_TX_ORDER_GET(x) (((x) & WLAN_MBOX_DMA_POLICY_TX_ORDER_MASK) >> WLAN_MBOX_DMA_POLICY_TX_ORDER_LSB) -#define WLAN_MBOX_DMA_POLICY_TX_ORDER_SET(x) (((x) << WLAN_MBOX_DMA_POLICY_TX_ORDER_LSB) & WLAN_MBOX_DMA_POLICY_TX_ORDER_MASK) -#define WLAN_MBOX_DMA_POLICY_RX_QUANTUM_MSB 1 -#define WLAN_MBOX_DMA_POLICY_RX_QUANTUM_LSB 1 -#define WLAN_MBOX_DMA_POLICY_RX_QUANTUM_MASK 0x00000002 -#define WLAN_MBOX_DMA_POLICY_RX_QUANTUM_GET(x) (((x) & WLAN_MBOX_DMA_POLICY_RX_QUANTUM_MASK) >> WLAN_MBOX_DMA_POLICY_RX_QUANTUM_LSB) -#define WLAN_MBOX_DMA_POLICY_RX_QUANTUM_SET(x) (((x) << WLAN_MBOX_DMA_POLICY_RX_QUANTUM_LSB) & WLAN_MBOX_DMA_POLICY_RX_QUANTUM_MASK) -#define WLAN_MBOX_DMA_POLICY_RX_ORDER_MSB 0 -#define WLAN_MBOX_DMA_POLICY_RX_ORDER_LSB 0 -#define WLAN_MBOX_DMA_POLICY_RX_ORDER_MASK 0x00000001 -#define WLAN_MBOX_DMA_POLICY_RX_ORDER_GET(x) (((x) & WLAN_MBOX_DMA_POLICY_RX_ORDER_MASK) >> WLAN_MBOX_DMA_POLICY_RX_ORDER_LSB) -#define WLAN_MBOX_DMA_POLICY_RX_ORDER_SET(x) (((x) << WLAN_MBOX_DMA_POLICY_RX_ORDER_LSB) & WLAN_MBOX_DMA_POLICY_RX_ORDER_MASK) - -#define WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000018 -#define WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000018 -#define WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX0_DMA_RX_CONTROL_ADDRESS 0x0000001c -#define WLAN_MBOX0_DMA_RX_CONTROL_OFFSET 0x0000001c -#define WLAN_MBOX0_DMA_RX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX0_DMA_RX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX0_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX0_DMA_RX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX0_DMA_RX_CONTROL_RESUME_MASK) >> WLAN_MBOX0_DMA_RX_CONTROL_RESUME_LSB) -#define WLAN_MBOX0_DMA_RX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX0_DMA_RX_CONTROL_RESUME_LSB) & WLAN_MBOX0_DMA_RX_CONTROL_RESUME_MASK) -#define WLAN_MBOX0_DMA_RX_CONTROL_START_MSB 1 -#define WLAN_MBOX0_DMA_RX_CONTROL_START_LSB 1 -#define WLAN_MBOX0_DMA_RX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX0_DMA_RX_CONTROL_START_GET(x) (((x) & WLAN_MBOX0_DMA_RX_CONTROL_START_MASK) >> WLAN_MBOX0_DMA_RX_CONTROL_START_LSB) -#define WLAN_MBOX0_DMA_RX_CONTROL_START_SET(x) (((x) << WLAN_MBOX0_DMA_RX_CONTROL_START_LSB) & WLAN_MBOX0_DMA_RX_CONTROL_START_MASK) -#define WLAN_MBOX0_DMA_RX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX0_DMA_RX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX0_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX0_DMA_RX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX0_DMA_RX_CONTROL_STOP_MASK) >> WLAN_MBOX0_DMA_RX_CONTROL_STOP_LSB) -#define WLAN_MBOX0_DMA_RX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX0_DMA_RX_CONTROL_STOP_LSB) & WLAN_MBOX0_DMA_RX_CONTROL_STOP_MASK) - -#define WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000020 -#define WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000020 -#define WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX0_DMA_TX_CONTROL_ADDRESS 0x00000024 -#define WLAN_MBOX0_DMA_TX_CONTROL_OFFSET 0x00000024 -#define WLAN_MBOX0_DMA_TX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX0_DMA_TX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX0_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX0_DMA_TX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX0_DMA_TX_CONTROL_RESUME_MASK) >> WLAN_MBOX0_DMA_TX_CONTROL_RESUME_LSB) -#define WLAN_MBOX0_DMA_TX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX0_DMA_TX_CONTROL_RESUME_LSB) & WLAN_MBOX0_DMA_TX_CONTROL_RESUME_MASK) -#define WLAN_MBOX0_DMA_TX_CONTROL_START_MSB 1 -#define WLAN_MBOX0_DMA_TX_CONTROL_START_LSB 1 -#define WLAN_MBOX0_DMA_TX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX0_DMA_TX_CONTROL_START_GET(x) (((x) & WLAN_MBOX0_DMA_TX_CONTROL_START_MASK) >> WLAN_MBOX0_DMA_TX_CONTROL_START_LSB) -#define WLAN_MBOX0_DMA_TX_CONTROL_START_SET(x) (((x) << WLAN_MBOX0_DMA_TX_CONTROL_START_LSB) & WLAN_MBOX0_DMA_TX_CONTROL_START_MASK) -#define WLAN_MBOX0_DMA_TX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX0_DMA_TX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX0_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX0_DMA_TX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX0_DMA_TX_CONTROL_STOP_MASK) >> WLAN_MBOX0_DMA_TX_CONTROL_STOP_LSB) -#define WLAN_MBOX0_DMA_TX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX0_DMA_TX_CONTROL_STOP_LSB) & WLAN_MBOX0_DMA_TX_CONTROL_STOP_MASK) - -#define WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000028 -#define WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000028 -#define WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX1_DMA_RX_CONTROL_ADDRESS 0x0000002c -#define WLAN_MBOX1_DMA_RX_CONTROL_OFFSET 0x0000002c -#define WLAN_MBOX1_DMA_RX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX1_DMA_RX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX1_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX1_DMA_RX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX1_DMA_RX_CONTROL_RESUME_MASK) >> WLAN_MBOX1_DMA_RX_CONTROL_RESUME_LSB) -#define WLAN_MBOX1_DMA_RX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX1_DMA_RX_CONTROL_RESUME_LSB) & WLAN_MBOX1_DMA_RX_CONTROL_RESUME_MASK) -#define WLAN_MBOX1_DMA_RX_CONTROL_START_MSB 1 -#define WLAN_MBOX1_DMA_RX_CONTROL_START_LSB 1 -#define WLAN_MBOX1_DMA_RX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX1_DMA_RX_CONTROL_START_GET(x) (((x) & WLAN_MBOX1_DMA_RX_CONTROL_START_MASK) >> WLAN_MBOX1_DMA_RX_CONTROL_START_LSB) -#define WLAN_MBOX1_DMA_RX_CONTROL_START_SET(x) (((x) << WLAN_MBOX1_DMA_RX_CONTROL_START_LSB) & WLAN_MBOX1_DMA_RX_CONTROL_START_MASK) -#define WLAN_MBOX1_DMA_RX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX1_DMA_RX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX1_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX1_DMA_RX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX1_DMA_RX_CONTROL_STOP_MASK) >> WLAN_MBOX1_DMA_RX_CONTROL_STOP_LSB) -#define WLAN_MBOX1_DMA_RX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX1_DMA_RX_CONTROL_STOP_LSB) & WLAN_MBOX1_DMA_RX_CONTROL_STOP_MASK) - -#define WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000030 -#define WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000030 -#define WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX1_DMA_TX_CONTROL_ADDRESS 0x00000034 -#define WLAN_MBOX1_DMA_TX_CONTROL_OFFSET 0x00000034 -#define WLAN_MBOX1_DMA_TX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX1_DMA_TX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX1_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX1_DMA_TX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX1_DMA_TX_CONTROL_RESUME_MASK) >> WLAN_MBOX1_DMA_TX_CONTROL_RESUME_LSB) -#define WLAN_MBOX1_DMA_TX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX1_DMA_TX_CONTROL_RESUME_LSB) & WLAN_MBOX1_DMA_TX_CONTROL_RESUME_MASK) -#define WLAN_MBOX1_DMA_TX_CONTROL_START_MSB 1 -#define WLAN_MBOX1_DMA_TX_CONTROL_START_LSB 1 -#define WLAN_MBOX1_DMA_TX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX1_DMA_TX_CONTROL_START_GET(x) (((x) & WLAN_MBOX1_DMA_TX_CONTROL_START_MASK) >> WLAN_MBOX1_DMA_TX_CONTROL_START_LSB) -#define WLAN_MBOX1_DMA_TX_CONTROL_START_SET(x) (((x) << WLAN_MBOX1_DMA_TX_CONTROL_START_LSB) & WLAN_MBOX1_DMA_TX_CONTROL_START_MASK) -#define WLAN_MBOX1_DMA_TX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX1_DMA_TX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX1_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX1_DMA_TX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX1_DMA_TX_CONTROL_STOP_MASK) >> WLAN_MBOX1_DMA_TX_CONTROL_STOP_LSB) -#define WLAN_MBOX1_DMA_TX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX1_DMA_TX_CONTROL_STOP_LSB) & WLAN_MBOX1_DMA_TX_CONTROL_STOP_MASK) - -#define WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000038 -#define WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000038 -#define WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX2_DMA_RX_CONTROL_ADDRESS 0x0000003c -#define WLAN_MBOX2_DMA_RX_CONTROL_OFFSET 0x0000003c -#define WLAN_MBOX2_DMA_RX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX2_DMA_RX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX2_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX2_DMA_RX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX2_DMA_RX_CONTROL_RESUME_MASK) >> WLAN_MBOX2_DMA_RX_CONTROL_RESUME_LSB) -#define WLAN_MBOX2_DMA_RX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX2_DMA_RX_CONTROL_RESUME_LSB) & WLAN_MBOX2_DMA_RX_CONTROL_RESUME_MASK) -#define WLAN_MBOX2_DMA_RX_CONTROL_START_MSB 1 -#define WLAN_MBOX2_DMA_RX_CONTROL_START_LSB 1 -#define WLAN_MBOX2_DMA_RX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX2_DMA_RX_CONTROL_START_GET(x) (((x) & WLAN_MBOX2_DMA_RX_CONTROL_START_MASK) >> WLAN_MBOX2_DMA_RX_CONTROL_START_LSB) -#define WLAN_MBOX2_DMA_RX_CONTROL_START_SET(x) (((x) << WLAN_MBOX2_DMA_RX_CONTROL_START_LSB) & WLAN_MBOX2_DMA_RX_CONTROL_START_MASK) -#define WLAN_MBOX2_DMA_RX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX2_DMA_RX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX2_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX2_DMA_RX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX2_DMA_RX_CONTROL_STOP_MASK) >> WLAN_MBOX2_DMA_RX_CONTROL_STOP_LSB) -#define WLAN_MBOX2_DMA_RX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX2_DMA_RX_CONTROL_STOP_LSB) & WLAN_MBOX2_DMA_RX_CONTROL_STOP_MASK) - -#define WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000040 -#define WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000040 -#define WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX2_DMA_TX_CONTROL_ADDRESS 0x00000044 -#define WLAN_MBOX2_DMA_TX_CONTROL_OFFSET 0x00000044 -#define WLAN_MBOX2_DMA_TX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX2_DMA_TX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX2_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX2_DMA_TX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX2_DMA_TX_CONTROL_RESUME_MASK) >> WLAN_MBOX2_DMA_TX_CONTROL_RESUME_LSB) -#define WLAN_MBOX2_DMA_TX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX2_DMA_TX_CONTROL_RESUME_LSB) & WLAN_MBOX2_DMA_TX_CONTROL_RESUME_MASK) -#define WLAN_MBOX2_DMA_TX_CONTROL_START_MSB 1 -#define WLAN_MBOX2_DMA_TX_CONTROL_START_LSB 1 -#define WLAN_MBOX2_DMA_TX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX2_DMA_TX_CONTROL_START_GET(x) (((x) & WLAN_MBOX2_DMA_TX_CONTROL_START_MASK) >> WLAN_MBOX2_DMA_TX_CONTROL_START_LSB) -#define WLAN_MBOX2_DMA_TX_CONTROL_START_SET(x) (((x) << WLAN_MBOX2_DMA_TX_CONTROL_START_LSB) & WLAN_MBOX2_DMA_TX_CONTROL_START_MASK) -#define WLAN_MBOX2_DMA_TX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX2_DMA_TX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX2_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX2_DMA_TX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX2_DMA_TX_CONTROL_STOP_MASK) >> WLAN_MBOX2_DMA_TX_CONTROL_STOP_LSB) -#define WLAN_MBOX2_DMA_TX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX2_DMA_TX_CONTROL_STOP_LSB) & WLAN_MBOX2_DMA_TX_CONTROL_STOP_MASK) - -#define WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000048 -#define WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000048 -#define WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX3_DMA_RX_CONTROL_ADDRESS 0x0000004c -#define WLAN_MBOX3_DMA_RX_CONTROL_OFFSET 0x0000004c -#define WLAN_MBOX3_DMA_RX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX3_DMA_RX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX3_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX3_DMA_RX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX3_DMA_RX_CONTROL_RESUME_MASK) >> WLAN_MBOX3_DMA_RX_CONTROL_RESUME_LSB) -#define WLAN_MBOX3_DMA_RX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX3_DMA_RX_CONTROL_RESUME_LSB) & WLAN_MBOX3_DMA_RX_CONTROL_RESUME_MASK) -#define WLAN_MBOX3_DMA_RX_CONTROL_START_MSB 1 -#define WLAN_MBOX3_DMA_RX_CONTROL_START_LSB 1 -#define WLAN_MBOX3_DMA_RX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX3_DMA_RX_CONTROL_START_GET(x) (((x) & WLAN_MBOX3_DMA_RX_CONTROL_START_MASK) >> WLAN_MBOX3_DMA_RX_CONTROL_START_LSB) -#define WLAN_MBOX3_DMA_RX_CONTROL_START_SET(x) (((x) << WLAN_MBOX3_DMA_RX_CONTROL_START_LSB) & WLAN_MBOX3_DMA_RX_CONTROL_START_MASK) -#define WLAN_MBOX3_DMA_RX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX3_DMA_RX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX3_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX3_DMA_RX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX3_DMA_RX_CONTROL_STOP_MASK) >> WLAN_MBOX3_DMA_RX_CONTROL_STOP_LSB) -#define WLAN_MBOX3_DMA_RX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX3_DMA_RX_CONTROL_STOP_LSB) & WLAN_MBOX3_DMA_RX_CONTROL_STOP_MASK) - -#define WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000050 -#define WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000050 -#define WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX3_DMA_TX_CONTROL_ADDRESS 0x00000054 -#define WLAN_MBOX3_DMA_TX_CONTROL_OFFSET 0x00000054 -#define WLAN_MBOX3_DMA_TX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX3_DMA_TX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX3_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX3_DMA_TX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX3_DMA_TX_CONTROL_RESUME_MASK) >> WLAN_MBOX3_DMA_TX_CONTROL_RESUME_LSB) -#define WLAN_MBOX3_DMA_TX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX3_DMA_TX_CONTROL_RESUME_LSB) & WLAN_MBOX3_DMA_TX_CONTROL_RESUME_MASK) -#define WLAN_MBOX3_DMA_TX_CONTROL_START_MSB 1 -#define WLAN_MBOX3_DMA_TX_CONTROL_START_LSB 1 -#define WLAN_MBOX3_DMA_TX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX3_DMA_TX_CONTROL_START_GET(x) (((x) & WLAN_MBOX3_DMA_TX_CONTROL_START_MASK) >> WLAN_MBOX3_DMA_TX_CONTROL_START_LSB) -#define WLAN_MBOX3_DMA_TX_CONTROL_START_SET(x) (((x) << WLAN_MBOX3_DMA_TX_CONTROL_START_LSB) & WLAN_MBOX3_DMA_TX_CONTROL_START_MASK) -#define WLAN_MBOX3_DMA_TX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX3_DMA_TX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX3_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX3_DMA_TX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX3_DMA_TX_CONTROL_STOP_MASK) >> WLAN_MBOX3_DMA_TX_CONTROL_STOP_LSB) -#define WLAN_MBOX3_DMA_TX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX3_DMA_TX_CONTROL_STOP_LSB) & WLAN_MBOX3_DMA_TX_CONTROL_STOP_MASK) - -#define WLAN_MBOX_INT_STATUS_ADDRESS 0x00000058 -#define WLAN_MBOX_INT_STATUS_OFFSET 0x00000058 -#define WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_MSB 31 -#define WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB 28 -#define WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK 0xf0000000 -#define WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) (((x) & WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) >> WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) -#define WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) (((x) << WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) & WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) -#define WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB 27 -#define WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB 24 -#define WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK 0x0f000000 -#define WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) (((x) & WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) >> WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) -#define WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) (((x) << WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) & WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) -#define WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_MSB 23 -#define WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB 20 -#define WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK 0x00f00000 -#define WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) (((x) & WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) >> WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) -#define WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) (((x) << WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) & WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) -#define WLAN_MBOX_INT_STATUS_TX_OVERFLOW_MSB 17 -#define WLAN_MBOX_INT_STATUS_TX_OVERFLOW_LSB 17 -#define WLAN_MBOX_INT_STATUS_TX_OVERFLOW_MASK 0x00020000 -#define WLAN_MBOX_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & WLAN_MBOX_INT_STATUS_TX_OVERFLOW_MASK) >> WLAN_MBOX_INT_STATUS_TX_OVERFLOW_LSB) -#define WLAN_MBOX_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << WLAN_MBOX_INT_STATUS_TX_OVERFLOW_LSB) & WLAN_MBOX_INT_STATUS_TX_OVERFLOW_MASK) -#define WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_MSB 16 -#define WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_LSB 16 -#define WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_MASK 0x00010000 -#define WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_MASK) >> WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_LSB) -#define WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_LSB) & WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_MASK) -#define WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_MSB 15 -#define WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_LSB 12 -#define WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_MASK 0x0000f000 -#define WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) (((x) & WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_MASK) >> WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_LSB) -#define WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) (((x) << WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_LSB) & WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_MASK) -#define WLAN_MBOX_INT_STATUS_RX_NOT_FULL_MSB 11 -#define WLAN_MBOX_INT_STATUS_RX_NOT_FULL_LSB 8 -#define WLAN_MBOX_INT_STATUS_RX_NOT_FULL_MASK 0x00000f00 -#define WLAN_MBOX_INT_STATUS_RX_NOT_FULL_GET(x) (((x) & WLAN_MBOX_INT_STATUS_RX_NOT_FULL_MASK) >> WLAN_MBOX_INT_STATUS_RX_NOT_FULL_LSB) -#define WLAN_MBOX_INT_STATUS_RX_NOT_FULL_SET(x) (((x) << WLAN_MBOX_INT_STATUS_RX_NOT_FULL_LSB) & WLAN_MBOX_INT_STATUS_RX_NOT_FULL_MASK) -#define WLAN_MBOX_INT_STATUS_HOST_MSB 7 -#define WLAN_MBOX_INT_STATUS_HOST_LSB 0 -#define WLAN_MBOX_INT_STATUS_HOST_MASK 0x000000ff -#define WLAN_MBOX_INT_STATUS_HOST_GET(x) (((x) & WLAN_MBOX_INT_STATUS_HOST_MASK) >> WLAN_MBOX_INT_STATUS_HOST_LSB) -#define WLAN_MBOX_INT_STATUS_HOST_SET(x) (((x) << WLAN_MBOX_INT_STATUS_HOST_LSB) & WLAN_MBOX_INT_STATUS_HOST_MASK) - -#define WLAN_MBOX_INT_ENABLE_ADDRESS 0x0000005c -#define WLAN_MBOX_INT_ENABLE_OFFSET 0x0000005c -#define WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB 31 -#define WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB 28 -#define WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK 0xf0000000 -#define WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) >> WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) -#define WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) & WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) -#define WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB 27 -#define WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB 24 -#define WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK 0x0f000000 -#define WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) >> WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) -#define WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) & WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) -#define WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB 23 -#define WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB 20 -#define WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK 0x00f00000 -#define WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) >> WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) -#define WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) & WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) -#define WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_MSB 17 -#define WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_LSB 17 -#define WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_MASK 0x00020000 -#define WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_MASK) >> WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_LSB) -#define WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_LSB) & WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_MASK) -#define WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_MSB 16 -#define WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_LSB 16 -#define WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_MASK 0x00010000 -#define WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_MASK) >> WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_LSB) -#define WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_LSB) & WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_MASK) -#define WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_MSB 15 -#define WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB 12 -#define WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK 0x0000f000 -#define WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) >> WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) -#define WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) & WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) -#define WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_MSB 11 -#define WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_LSB 8 -#define WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_MASK 0x00000f00 -#define WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_MASK) >> WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_LSB) -#define WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_LSB) & WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_MASK) -#define WLAN_MBOX_INT_ENABLE_HOST_MSB 7 -#define WLAN_MBOX_INT_ENABLE_HOST_LSB 0 -#define WLAN_MBOX_INT_ENABLE_HOST_MASK 0x000000ff -#define WLAN_MBOX_INT_ENABLE_HOST_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_HOST_MASK) >> WLAN_MBOX_INT_ENABLE_HOST_LSB) -#define WLAN_MBOX_INT_ENABLE_HOST_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_HOST_LSB) & WLAN_MBOX_INT_ENABLE_HOST_MASK) - -#define WLAN_INT_HOST_ADDRESS 0x00000060 -#define WLAN_INT_HOST_OFFSET 0x00000060 -#define WLAN_INT_HOST_VECTOR_MSB 7 -#define WLAN_INT_HOST_VECTOR_LSB 0 -#define WLAN_INT_HOST_VECTOR_MASK 0x000000ff -#define WLAN_INT_HOST_VECTOR_GET(x) (((x) & WLAN_INT_HOST_VECTOR_MASK) >> WLAN_INT_HOST_VECTOR_LSB) -#define WLAN_INT_HOST_VECTOR_SET(x) (((x) << WLAN_INT_HOST_VECTOR_LSB) & WLAN_INT_HOST_VECTOR_MASK) - -#define WLAN_LOCAL_COUNT_ADDRESS 0x00000080 -#define WLAN_LOCAL_COUNT_OFFSET 0x00000080 -#define WLAN_LOCAL_COUNT_VALUE_MSB 7 -#define WLAN_LOCAL_COUNT_VALUE_LSB 0 -#define WLAN_LOCAL_COUNT_VALUE_MASK 0x000000ff -#define WLAN_LOCAL_COUNT_VALUE_GET(x) (((x) & WLAN_LOCAL_COUNT_VALUE_MASK) >> WLAN_LOCAL_COUNT_VALUE_LSB) -#define WLAN_LOCAL_COUNT_VALUE_SET(x) (((x) << WLAN_LOCAL_COUNT_VALUE_LSB) & WLAN_LOCAL_COUNT_VALUE_MASK) - -#define WLAN_COUNT_INC_ADDRESS 0x000000a0 -#define WLAN_COUNT_INC_OFFSET 0x000000a0 -#define WLAN_COUNT_INC_VALUE_MSB 7 -#define WLAN_COUNT_INC_VALUE_LSB 0 -#define WLAN_COUNT_INC_VALUE_MASK 0x000000ff -#define WLAN_COUNT_INC_VALUE_GET(x) (((x) & WLAN_COUNT_INC_VALUE_MASK) >> WLAN_COUNT_INC_VALUE_LSB) -#define WLAN_COUNT_INC_VALUE_SET(x) (((x) << WLAN_COUNT_INC_VALUE_LSB) & WLAN_COUNT_INC_VALUE_MASK) - -#define WLAN_LOCAL_SCRATCH_ADDRESS 0x000000c0 -#define WLAN_LOCAL_SCRATCH_OFFSET 0x000000c0 -#define WLAN_LOCAL_SCRATCH_VALUE_MSB 7 -#define WLAN_LOCAL_SCRATCH_VALUE_LSB 0 -#define WLAN_LOCAL_SCRATCH_VALUE_MASK 0x000000ff -#define WLAN_LOCAL_SCRATCH_VALUE_GET(x) (((x) & WLAN_LOCAL_SCRATCH_VALUE_MASK) >> WLAN_LOCAL_SCRATCH_VALUE_LSB) -#define WLAN_LOCAL_SCRATCH_VALUE_SET(x) (((x) << WLAN_LOCAL_SCRATCH_VALUE_LSB) & WLAN_LOCAL_SCRATCH_VALUE_MASK) - -#define WLAN_USE_LOCAL_BUS_ADDRESS 0x000000e0 -#define WLAN_USE_LOCAL_BUS_OFFSET 0x000000e0 -#define WLAN_USE_LOCAL_BUS_PIN_INIT_MSB 0 -#define WLAN_USE_LOCAL_BUS_PIN_INIT_LSB 0 -#define WLAN_USE_LOCAL_BUS_PIN_INIT_MASK 0x00000001 -#define WLAN_USE_LOCAL_BUS_PIN_INIT_GET(x) (((x) & WLAN_USE_LOCAL_BUS_PIN_INIT_MASK) >> WLAN_USE_LOCAL_BUS_PIN_INIT_LSB) -#define WLAN_USE_LOCAL_BUS_PIN_INIT_SET(x) (((x) << WLAN_USE_LOCAL_BUS_PIN_INIT_LSB) & WLAN_USE_LOCAL_BUS_PIN_INIT_MASK) - -#define WLAN_SDIO_CONFIG_ADDRESS 0x000000e4 -#define WLAN_SDIO_CONFIG_OFFSET 0x000000e4 -#define WLAN_SDIO_CONFIG_CCCR_IOR1_MSB 0 -#define WLAN_SDIO_CONFIG_CCCR_IOR1_LSB 0 -#define WLAN_SDIO_CONFIG_CCCR_IOR1_MASK 0x00000001 -#define WLAN_SDIO_CONFIG_CCCR_IOR1_GET(x) (((x) & WLAN_SDIO_CONFIG_CCCR_IOR1_MASK) >> WLAN_SDIO_CONFIG_CCCR_IOR1_LSB) -#define WLAN_SDIO_CONFIG_CCCR_IOR1_SET(x) (((x) << WLAN_SDIO_CONFIG_CCCR_IOR1_LSB) & WLAN_SDIO_CONFIG_CCCR_IOR1_MASK) - -#define WLAN_MBOX_DEBUG_ADDRESS 0x000000e8 -#define WLAN_MBOX_DEBUG_OFFSET 0x000000e8 -#define WLAN_MBOX_DEBUG_SEL_MSB 2 -#define WLAN_MBOX_DEBUG_SEL_LSB 0 -#define WLAN_MBOX_DEBUG_SEL_MASK 0x00000007 -#define WLAN_MBOX_DEBUG_SEL_GET(x) (((x) & WLAN_MBOX_DEBUG_SEL_MASK) >> WLAN_MBOX_DEBUG_SEL_LSB) -#define WLAN_MBOX_DEBUG_SEL_SET(x) (((x) << WLAN_MBOX_DEBUG_SEL_LSB) & WLAN_MBOX_DEBUG_SEL_MASK) - -#define WLAN_MBOX_FIFO_RESET_ADDRESS 0x000000ec -#define WLAN_MBOX_FIFO_RESET_OFFSET 0x000000ec -#define WLAN_MBOX_FIFO_RESET_INIT_MSB 0 -#define WLAN_MBOX_FIFO_RESET_INIT_LSB 0 -#define WLAN_MBOX_FIFO_RESET_INIT_MASK 0x00000001 -#define WLAN_MBOX_FIFO_RESET_INIT_GET(x) (((x) & WLAN_MBOX_FIFO_RESET_INIT_MASK) >> WLAN_MBOX_FIFO_RESET_INIT_LSB) -#define WLAN_MBOX_FIFO_RESET_INIT_SET(x) (((x) << WLAN_MBOX_FIFO_RESET_INIT_LSB) & WLAN_MBOX_FIFO_RESET_INIT_MASK) - -#define WLAN_MBOX_TXFIFO_POP_ADDRESS 0x000000f0 -#define WLAN_MBOX_TXFIFO_POP_OFFSET 0x000000f0 -#define WLAN_MBOX_TXFIFO_POP_DATA_MSB 0 -#define WLAN_MBOX_TXFIFO_POP_DATA_LSB 0 -#define WLAN_MBOX_TXFIFO_POP_DATA_MASK 0x00000001 -#define WLAN_MBOX_TXFIFO_POP_DATA_GET(x) (((x) & WLAN_MBOX_TXFIFO_POP_DATA_MASK) >> WLAN_MBOX_TXFIFO_POP_DATA_LSB) -#define WLAN_MBOX_TXFIFO_POP_DATA_SET(x) (((x) << WLAN_MBOX_TXFIFO_POP_DATA_LSB) & WLAN_MBOX_TXFIFO_POP_DATA_MASK) - -#define WLAN_MBOX_RXFIFO_POP_ADDRESS 0x00000100 -#define WLAN_MBOX_RXFIFO_POP_OFFSET 0x00000100 -#define WLAN_MBOX_RXFIFO_POP_DATA_MSB 0 -#define WLAN_MBOX_RXFIFO_POP_DATA_LSB 0 -#define WLAN_MBOX_RXFIFO_POP_DATA_MASK 0x00000001 -#define WLAN_MBOX_RXFIFO_POP_DATA_GET(x) (((x) & WLAN_MBOX_RXFIFO_POP_DATA_MASK) >> WLAN_MBOX_RXFIFO_POP_DATA_LSB) -#define WLAN_MBOX_RXFIFO_POP_DATA_SET(x) (((x) << WLAN_MBOX_RXFIFO_POP_DATA_LSB) & WLAN_MBOX_RXFIFO_POP_DATA_MASK) - -#define WLAN_SDIO_DEBUG_ADDRESS 0x00000110 -#define WLAN_SDIO_DEBUG_OFFSET 0x00000110 -#define WLAN_SDIO_DEBUG_SEL_MSB 3 -#define WLAN_SDIO_DEBUG_SEL_LSB 0 -#define WLAN_SDIO_DEBUG_SEL_MASK 0x0000000f -#define WLAN_SDIO_DEBUG_SEL_GET(x) (((x) & WLAN_SDIO_DEBUG_SEL_MASK) >> WLAN_SDIO_DEBUG_SEL_LSB) -#define WLAN_SDIO_DEBUG_SEL_SET(x) (((x) << WLAN_SDIO_DEBUG_SEL_LSB) & WLAN_SDIO_DEBUG_SEL_MASK) - -#define WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000114 -#define WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000114 -#define WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_GMBOX0_DMA_RX_CONTROL_ADDRESS 0x00000118 -#define WLAN_GMBOX0_DMA_RX_CONTROL_OFFSET 0x00000118 -#define WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_MSB 2 -#define WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_LSB 2 -#define WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_GET(x) (((x) & WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_MASK) >> WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_LSB) -#define WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_SET(x) (((x) << WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_LSB) & WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_MASK) -#define WLAN_GMBOX0_DMA_RX_CONTROL_START_MSB 1 -#define WLAN_GMBOX0_DMA_RX_CONTROL_START_LSB 1 -#define WLAN_GMBOX0_DMA_RX_CONTROL_START_MASK 0x00000002 -#define WLAN_GMBOX0_DMA_RX_CONTROL_START_GET(x) (((x) & WLAN_GMBOX0_DMA_RX_CONTROL_START_MASK) >> WLAN_GMBOX0_DMA_RX_CONTROL_START_LSB) -#define WLAN_GMBOX0_DMA_RX_CONTROL_START_SET(x) (((x) << WLAN_GMBOX0_DMA_RX_CONTROL_START_LSB) & WLAN_GMBOX0_DMA_RX_CONTROL_START_MASK) -#define WLAN_GMBOX0_DMA_RX_CONTROL_STOP_MSB 0 -#define WLAN_GMBOX0_DMA_RX_CONTROL_STOP_LSB 0 -#define WLAN_GMBOX0_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_GMBOX0_DMA_RX_CONTROL_STOP_GET(x) (((x) & WLAN_GMBOX0_DMA_RX_CONTROL_STOP_MASK) >> WLAN_GMBOX0_DMA_RX_CONTROL_STOP_LSB) -#define WLAN_GMBOX0_DMA_RX_CONTROL_STOP_SET(x) (((x) << WLAN_GMBOX0_DMA_RX_CONTROL_STOP_LSB) & WLAN_GMBOX0_DMA_RX_CONTROL_STOP_MASK) - -#define WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x0000011c -#define WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x0000011c -#define WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_GMBOX0_DMA_TX_CONTROL_ADDRESS 0x00000120 -#define WLAN_GMBOX0_DMA_TX_CONTROL_OFFSET 0x00000120 -#define WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_MSB 2 -#define WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_LSB 2 -#define WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_GET(x) (((x) & WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_MASK) >> WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_LSB) -#define WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_SET(x) (((x) << WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_LSB) & WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_MASK) -#define WLAN_GMBOX0_DMA_TX_CONTROL_START_MSB 1 -#define WLAN_GMBOX0_DMA_TX_CONTROL_START_LSB 1 -#define WLAN_GMBOX0_DMA_TX_CONTROL_START_MASK 0x00000002 -#define WLAN_GMBOX0_DMA_TX_CONTROL_START_GET(x) (((x) & WLAN_GMBOX0_DMA_TX_CONTROL_START_MASK) >> WLAN_GMBOX0_DMA_TX_CONTROL_START_LSB) -#define WLAN_GMBOX0_DMA_TX_CONTROL_START_SET(x) (((x) << WLAN_GMBOX0_DMA_TX_CONTROL_START_LSB) & WLAN_GMBOX0_DMA_TX_CONTROL_START_MASK) -#define WLAN_GMBOX0_DMA_TX_CONTROL_STOP_MSB 0 -#define WLAN_GMBOX0_DMA_TX_CONTROL_STOP_LSB 0 -#define WLAN_GMBOX0_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_GMBOX0_DMA_TX_CONTROL_STOP_GET(x) (((x) & WLAN_GMBOX0_DMA_TX_CONTROL_STOP_MASK) >> WLAN_GMBOX0_DMA_TX_CONTROL_STOP_LSB) -#define WLAN_GMBOX0_DMA_TX_CONTROL_STOP_SET(x) (((x) << WLAN_GMBOX0_DMA_TX_CONTROL_STOP_LSB) & WLAN_GMBOX0_DMA_TX_CONTROL_STOP_MASK) - -#define WLAN_GMBOX_INT_STATUS_ADDRESS 0x00000124 -#define WLAN_GMBOX_INT_STATUS_OFFSET 0x00000124 -#define WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_MSB 6 -#define WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_LSB 6 -#define WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_MASK 0x00000040 -#define WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_MASK) >> WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_LSB) -#define WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_LSB) & WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_MASK) -#define WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_MSB 5 -#define WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_LSB 5 -#define WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_MASK 0x00000020 -#define WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_MASK) >> WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_LSB) -#define WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_LSB) & WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_MASK) -#define WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_MSB 4 -#define WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB 4 -#define WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK 0x00000010 -#define WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) (((x) & WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) >> WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) -#define WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) (((x) << WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) & WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) -#define WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB 3 -#define WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB 3 -#define WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK 0x00000008 -#define WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) (((x) & WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) >> WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) -#define WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) (((x) << WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) & WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) -#define WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_MSB 2 -#define WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB 2 -#define WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK 0x00000004 -#define WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) (((x) & WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) >> WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) -#define WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) (((x) << WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) & WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) -#define WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_MSB 1 -#define WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_LSB 1 -#define WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_MASK 0x00000002 -#define WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) (((x) & WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_MASK) >> WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_LSB) -#define WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) (((x) << WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_LSB) & WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_MASK) -#define WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_MSB 0 -#define WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_LSB 0 -#define WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_MASK 0x00000001 -#define WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_GET(x) (((x) & WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_MASK) >> WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_LSB) -#define WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_SET(x) (((x) << WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_LSB) & WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_MASK) - -#define WLAN_GMBOX_INT_ENABLE_ADDRESS 0x00000128 -#define WLAN_GMBOX_INT_ENABLE_OFFSET 0x00000128 -#define WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_MSB 6 -#define WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_LSB 6 -#define WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_MASK 0x00000040 -#define WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_GET(x) (((x) & WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_MASK) >> WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_LSB) -#define WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_SET(x) (((x) << WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_LSB) & WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_MASK) -#define WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_MSB 5 -#define WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_LSB 5 -#define WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_MASK 0x00000020 -#define WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) (((x) & WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_MASK) >> WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_LSB) -#define WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) (((x) << WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_LSB) & WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_MASK) -#define WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB 4 -#define WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB 4 -#define WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK 0x00000010 -#define WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) (((x) & WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) >> WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) -#define WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) (((x) << WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) & WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB 3 -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB 3 -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK 0x00000008 -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) (((x) & WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) >> WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) (((x) << WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) & WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB 2 -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB 2 -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK 0x00000004 -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) (((x) & WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) >> WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) (((x) << WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) & WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) -#define WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_MSB 1 -#define WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB 1 -#define WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK 0x00000002 -#define WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) (((x) & WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) >> WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) -#define WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) (((x) << WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) & WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) -#define WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_MSB 0 -#define WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_LSB 0 -#define WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_MASK 0x00000001 -#define WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_GET(x) (((x) & WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_MASK) >> WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_LSB) -#define WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_SET(x) (((x) << WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_LSB) & WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_MASK) - -#define WLAN_HOST_IF_WINDOW_ADDRESS 0x00002000 -#define WLAN_HOST_IF_WINDOW_OFFSET 0x00002000 -#define WLAN_HOST_IF_WINDOW_DATA_MSB 7 -#define WLAN_HOST_IF_WINDOW_DATA_LSB 0 -#define WLAN_HOST_IF_WINDOW_DATA_MASK 0x000000ff -#define WLAN_HOST_IF_WINDOW_DATA_GET(x) (((x) & WLAN_HOST_IF_WINDOW_DATA_MASK) >> WLAN_HOST_IF_WINDOW_DATA_LSB) -#define WLAN_HOST_IF_WINDOW_DATA_SET(x) (((x) << WLAN_HOST_IF_WINDOW_DATA_LSB) & WLAN_HOST_IF_WINDOW_DATA_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct mbox_wlan_reg_reg_s { - volatile unsigned int wlan_mbox_fifo[4]; - volatile unsigned int wlan_mbox_fifo_status; - volatile unsigned int wlan_mbox_dma_policy; - volatile unsigned int wlan_mbox0_dma_rx_descriptor_base; - volatile unsigned int wlan_mbox0_dma_rx_control; - volatile unsigned int wlan_mbox0_dma_tx_descriptor_base; - volatile unsigned int wlan_mbox0_dma_tx_control; - volatile unsigned int wlan_mbox1_dma_rx_descriptor_base; - volatile unsigned int wlan_mbox1_dma_rx_control; - volatile unsigned int wlan_mbox1_dma_tx_descriptor_base; - volatile unsigned int wlan_mbox1_dma_tx_control; - volatile unsigned int wlan_mbox2_dma_rx_descriptor_base; - volatile unsigned int wlan_mbox2_dma_rx_control; - volatile unsigned int wlan_mbox2_dma_tx_descriptor_base; - volatile unsigned int wlan_mbox2_dma_tx_control; - volatile unsigned int wlan_mbox3_dma_rx_descriptor_base; - volatile unsigned int wlan_mbox3_dma_rx_control; - volatile unsigned int wlan_mbox3_dma_tx_descriptor_base; - volatile unsigned int wlan_mbox3_dma_tx_control; - volatile unsigned int wlan_mbox_int_status; - volatile unsigned int wlan_mbox_int_enable; - volatile unsigned int wlan_int_host; - unsigned char pad0[28]; /* pad to 0x80 */ - volatile unsigned int wlan_local_count[8]; - volatile unsigned int wlan_count_inc[8]; - volatile unsigned int wlan_local_scratch[8]; - volatile unsigned int wlan_use_local_bus; - volatile unsigned int wlan_sdio_config; - volatile unsigned int wlan_mbox_debug; - volatile unsigned int wlan_mbox_fifo_reset; - volatile unsigned int wlan_mbox_txfifo_pop[4]; - volatile unsigned int wlan_mbox_rxfifo_pop[4]; - volatile unsigned int wlan_sdio_debug; - volatile unsigned int wlan_gmbox0_dma_rx_descriptor_base; - volatile unsigned int wlan_gmbox0_dma_rx_control; - volatile unsigned int wlan_gmbox0_dma_tx_descriptor_base; - volatile unsigned int wlan_gmbox0_dma_tx_control; - volatile unsigned int wlan_gmbox_int_status; - volatile unsigned int wlan_gmbox_int_enable; - unsigned char pad1[7892]; /* pad to 0x2000 */ - volatile unsigned int wlan_host_if_window[2048]; -} mbox_wlan_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _MBOX_WLAN_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/rdma_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/rdma_reg.h deleted file mode 100644 index a169a6cc9136..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/rdma_reg.h +++ /dev/null @@ -1,564 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _RDMA_REG_REG_H_ -#define _RDMA_REG_REG_H_ - -#define DMA_CONFIG_ADDRESS 0x00000000 -#define DMA_CONFIG_OFFSET 0x00000000 -#define DMA_CONFIG_WLBB_PWD_EN_MSB 4 -#define DMA_CONFIG_WLBB_PWD_EN_LSB 4 -#define DMA_CONFIG_WLBB_PWD_EN_MASK 0x00000010 -#define DMA_CONFIG_WLBB_PWD_EN_GET(x) (((x) & DMA_CONFIG_WLBB_PWD_EN_MASK) >> DMA_CONFIG_WLBB_PWD_EN_LSB) -#define DMA_CONFIG_WLBB_PWD_EN_SET(x) (((x) << DMA_CONFIG_WLBB_PWD_EN_LSB) & DMA_CONFIG_WLBB_PWD_EN_MASK) -#define DMA_CONFIG_WLMAC_PWD_EN_MSB 3 -#define DMA_CONFIG_WLMAC_PWD_EN_LSB 3 -#define DMA_CONFIG_WLMAC_PWD_EN_MASK 0x00000008 -#define DMA_CONFIG_WLMAC_PWD_EN_GET(x) (((x) & DMA_CONFIG_WLMAC_PWD_EN_MASK) >> DMA_CONFIG_WLMAC_PWD_EN_LSB) -#define DMA_CONFIG_WLMAC_PWD_EN_SET(x) (((x) << DMA_CONFIG_WLMAC_PWD_EN_LSB) & DMA_CONFIG_WLMAC_PWD_EN_MASK) -#define DMA_CONFIG_ENABLE_RETENTION_MSB 2 -#define DMA_CONFIG_ENABLE_RETENTION_LSB 2 -#define DMA_CONFIG_ENABLE_RETENTION_MASK 0x00000004 -#define DMA_CONFIG_ENABLE_RETENTION_GET(x) (((x) & DMA_CONFIG_ENABLE_RETENTION_MASK) >> DMA_CONFIG_ENABLE_RETENTION_LSB) -#define DMA_CONFIG_ENABLE_RETENTION_SET(x) (((x) << DMA_CONFIG_ENABLE_RETENTION_LSB) & DMA_CONFIG_ENABLE_RETENTION_MASK) -#define DMA_CONFIG_RTC_PRIORITY_MSB 1 -#define DMA_CONFIG_RTC_PRIORITY_LSB 1 -#define DMA_CONFIG_RTC_PRIORITY_MASK 0x00000002 -#define DMA_CONFIG_RTC_PRIORITY_GET(x) (((x) & DMA_CONFIG_RTC_PRIORITY_MASK) >> DMA_CONFIG_RTC_PRIORITY_LSB) -#define DMA_CONFIG_RTC_PRIORITY_SET(x) (((x) << DMA_CONFIG_RTC_PRIORITY_LSB) & DMA_CONFIG_RTC_PRIORITY_MASK) -#define DMA_CONFIG_DMA_TYPE_MSB 0 -#define DMA_CONFIG_DMA_TYPE_LSB 0 -#define DMA_CONFIG_DMA_TYPE_MASK 0x00000001 -#define DMA_CONFIG_DMA_TYPE_GET(x) (((x) & DMA_CONFIG_DMA_TYPE_MASK) >> DMA_CONFIG_DMA_TYPE_LSB) -#define DMA_CONFIG_DMA_TYPE_SET(x) (((x) << DMA_CONFIG_DMA_TYPE_LSB) & DMA_CONFIG_DMA_TYPE_MASK) - -#define DMA_CONTROL_ADDRESS 0x00000004 -#define DMA_CONTROL_OFFSET 0x00000004 -#define DMA_CONTROL_START_MSB 1 -#define DMA_CONTROL_START_LSB 1 -#define DMA_CONTROL_START_MASK 0x00000002 -#define DMA_CONTROL_START_GET(x) (((x) & DMA_CONTROL_START_MASK) >> DMA_CONTROL_START_LSB) -#define DMA_CONTROL_START_SET(x) (((x) << DMA_CONTROL_START_LSB) & DMA_CONTROL_START_MASK) -#define DMA_CONTROL_STOP_MSB 0 -#define DMA_CONTROL_STOP_LSB 0 -#define DMA_CONTROL_STOP_MASK 0x00000001 -#define DMA_CONTROL_STOP_GET(x) (((x) & DMA_CONTROL_STOP_MASK) >> DMA_CONTROL_STOP_LSB) -#define DMA_CONTROL_STOP_SET(x) (((x) << DMA_CONTROL_STOP_LSB) & DMA_CONTROL_STOP_MASK) - -#define DMA_SRC_ADDRESS 0x00000008 -#define DMA_SRC_OFFSET 0x00000008 -#define DMA_SRC_ADDR_MSB 31 -#define DMA_SRC_ADDR_LSB 2 -#define DMA_SRC_ADDR_MASK 0xfffffffc -#define DMA_SRC_ADDR_GET(x) (((x) & DMA_SRC_ADDR_MASK) >> DMA_SRC_ADDR_LSB) -#define DMA_SRC_ADDR_SET(x) (((x) << DMA_SRC_ADDR_LSB) & DMA_SRC_ADDR_MASK) - -#define DMA_DEST_ADDRESS 0x0000000c -#define DMA_DEST_OFFSET 0x0000000c -#define DMA_DEST_ADDR_MSB 31 -#define DMA_DEST_ADDR_LSB 2 -#define DMA_DEST_ADDR_MASK 0xfffffffc -#define DMA_DEST_ADDR_GET(x) (((x) & DMA_DEST_ADDR_MASK) >> DMA_DEST_ADDR_LSB) -#define DMA_DEST_ADDR_SET(x) (((x) << DMA_DEST_ADDR_LSB) & DMA_DEST_ADDR_MASK) - -#define DMA_LENGTH_ADDRESS 0x00000010 -#define DMA_LENGTH_OFFSET 0x00000010 -#define DMA_LENGTH_WORDS_MSB 11 -#define DMA_LENGTH_WORDS_LSB 0 -#define DMA_LENGTH_WORDS_MASK 0x00000fff -#define DMA_LENGTH_WORDS_GET(x) (((x) & DMA_LENGTH_WORDS_MASK) >> DMA_LENGTH_WORDS_LSB) -#define DMA_LENGTH_WORDS_SET(x) (((x) << DMA_LENGTH_WORDS_LSB) & DMA_LENGTH_WORDS_MASK) - -#define VMC_BASE_ADDRESS 0x00000014 -#define VMC_BASE_OFFSET 0x00000014 -#define VMC_BASE_ADDR_MSB 31 -#define VMC_BASE_ADDR_LSB 2 -#define VMC_BASE_ADDR_MASK 0xfffffffc -#define VMC_BASE_ADDR_GET(x) (((x) & VMC_BASE_ADDR_MASK) >> VMC_BASE_ADDR_LSB) -#define VMC_BASE_ADDR_SET(x) (((x) << VMC_BASE_ADDR_LSB) & VMC_BASE_ADDR_MASK) - -#define INDIRECT_REG_ADDRESS 0x00000018 -#define INDIRECT_REG_OFFSET 0x00000018 -#define INDIRECT_REG_ID_MSB 31 -#define INDIRECT_REG_ID_LSB 2 -#define INDIRECT_REG_ID_MASK 0xfffffffc -#define INDIRECT_REG_ID_GET(x) (((x) & INDIRECT_REG_ID_MASK) >> INDIRECT_REG_ID_LSB) -#define INDIRECT_REG_ID_SET(x) (((x) << INDIRECT_REG_ID_LSB) & INDIRECT_REG_ID_MASK) - -#define INDIRECT_RETURN_ADDRESS 0x0000001c -#define INDIRECT_RETURN_OFFSET 0x0000001c -#define INDIRECT_RETURN_ADDR_MSB 31 -#define INDIRECT_RETURN_ADDR_LSB 2 -#define INDIRECT_RETURN_ADDR_MASK 0xfffffffc -#define INDIRECT_RETURN_ADDR_GET(x) (((x) & INDIRECT_RETURN_ADDR_MASK) >> INDIRECT_RETURN_ADDR_LSB) -#define INDIRECT_RETURN_ADDR_SET(x) (((x) << INDIRECT_RETURN_ADDR_LSB) & INDIRECT_RETURN_ADDR_MASK) - -#define RDMA_REGION_0__ADDRESS 0x00000020 -#define RDMA_REGION_0__OFFSET 0x00000020 -#define RDMA_REGION_0__ADDR_MSB 31 -#define RDMA_REGION_0__ADDR_LSB 13 -#define RDMA_REGION_0__ADDR_MASK 0xffffe000 -#define RDMA_REGION_0__ADDR_GET(x) (((x) & RDMA_REGION_0__ADDR_MASK) >> RDMA_REGION_0__ADDR_LSB) -#define RDMA_REGION_0__ADDR_SET(x) (((x) << RDMA_REGION_0__ADDR_LSB) & RDMA_REGION_0__ADDR_MASK) -#define RDMA_REGION_0__LENGTH_MSB 12 -#define RDMA_REGION_0__LENGTH_LSB 2 -#define RDMA_REGION_0__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_0__LENGTH_GET(x) (((x) & RDMA_REGION_0__LENGTH_MASK) >> RDMA_REGION_0__LENGTH_LSB) -#define RDMA_REGION_0__LENGTH_SET(x) (((x) << RDMA_REGION_0__LENGTH_LSB) & RDMA_REGION_0__LENGTH_MASK) -#define RDMA_REGION_0__INDI_MSB 1 -#define RDMA_REGION_0__INDI_LSB 1 -#define RDMA_REGION_0__INDI_MASK 0x00000002 -#define RDMA_REGION_0__INDI_GET(x) (((x) & RDMA_REGION_0__INDI_MASK) >> RDMA_REGION_0__INDI_LSB) -#define RDMA_REGION_0__INDI_SET(x) (((x) << RDMA_REGION_0__INDI_LSB) & RDMA_REGION_0__INDI_MASK) -#define RDMA_REGION_0__NEXT_MSB 0 -#define RDMA_REGION_0__NEXT_LSB 0 -#define RDMA_REGION_0__NEXT_MASK 0x00000001 -#define RDMA_REGION_0__NEXT_GET(x) (((x) & RDMA_REGION_0__NEXT_MASK) >> RDMA_REGION_0__NEXT_LSB) -#define RDMA_REGION_0__NEXT_SET(x) (((x) << RDMA_REGION_0__NEXT_LSB) & RDMA_REGION_0__NEXT_MASK) - -#define RDMA_REGION_1__ADDRESS 0x00000024 -#define RDMA_REGION_1__OFFSET 0x00000024 -#define RDMA_REGION_1__ADDR_MSB 31 -#define RDMA_REGION_1__ADDR_LSB 13 -#define RDMA_REGION_1__ADDR_MASK 0xffffe000 -#define RDMA_REGION_1__ADDR_GET(x) (((x) & RDMA_REGION_1__ADDR_MASK) >> RDMA_REGION_1__ADDR_LSB) -#define RDMA_REGION_1__ADDR_SET(x) (((x) << RDMA_REGION_1__ADDR_LSB) & RDMA_REGION_1__ADDR_MASK) -#define RDMA_REGION_1__LENGTH_MSB 12 -#define RDMA_REGION_1__LENGTH_LSB 2 -#define RDMA_REGION_1__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_1__LENGTH_GET(x) (((x) & RDMA_REGION_1__LENGTH_MASK) >> RDMA_REGION_1__LENGTH_LSB) -#define RDMA_REGION_1__LENGTH_SET(x) (((x) << RDMA_REGION_1__LENGTH_LSB) & RDMA_REGION_1__LENGTH_MASK) -#define RDMA_REGION_1__INDI_MSB 1 -#define RDMA_REGION_1__INDI_LSB 1 -#define RDMA_REGION_1__INDI_MASK 0x00000002 -#define RDMA_REGION_1__INDI_GET(x) (((x) & RDMA_REGION_1__INDI_MASK) >> RDMA_REGION_1__INDI_LSB) -#define RDMA_REGION_1__INDI_SET(x) (((x) << RDMA_REGION_1__INDI_LSB) & RDMA_REGION_1__INDI_MASK) -#define RDMA_REGION_1__NEXT_MSB 0 -#define RDMA_REGION_1__NEXT_LSB 0 -#define RDMA_REGION_1__NEXT_MASK 0x00000001 -#define RDMA_REGION_1__NEXT_GET(x) (((x) & RDMA_REGION_1__NEXT_MASK) >> RDMA_REGION_1__NEXT_LSB) -#define RDMA_REGION_1__NEXT_SET(x) (((x) << RDMA_REGION_1__NEXT_LSB) & RDMA_REGION_1__NEXT_MASK) - -#define RDMA_REGION_2__ADDRESS 0x00000028 -#define RDMA_REGION_2__OFFSET 0x00000028 -#define RDMA_REGION_2__ADDR_MSB 31 -#define RDMA_REGION_2__ADDR_LSB 13 -#define RDMA_REGION_2__ADDR_MASK 0xffffe000 -#define RDMA_REGION_2__ADDR_GET(x) (((x) & RDMA_REGION_2__ADDR_MASK) >> RDMA_REGION_2__ADDR_LSB) -#define RDMA_REGION_2__ADDR_SET(x) (((x) << RDMA_REGION_2__ADDR_LSB) & RDMA_REGION_2__ADDR_MASK) -#define RDMA_REGION_2__LENGTH_MSB 12 -#define RDMA_REGION_2__LENGTH_LSB 2 -#define RDMA_REGION_2__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_2__LENGTH_GET(x) (((x) & RDMA_REGION_2__LENGTH_MASK) >> RDMA_REGION_2__LENGTH_LSB) -#define RDMA_REGION_2__LENGTH_SET(x) (((x) << RDMA_REGION_2__LENGTH_LSB) & RDMA_REGION_2__LENGTH_MASK) -#define RDMA_REGION_2__INDI_MSB 1 -#define RDMA_REGION_2__INDI_LSB 1 -#define RDMA_REGION_2__INDI_MASK 0x00000002 -#define RDMA_REGION_2__INDI_GET(x) (((x) & RDMA_REGION_2__INDI_MASK) >> RDMA_REGION_2__INDI_LSB) -#define RDMA_REGION_2__INDI_SET(x) (((x) << RDMA_REGION_2__INDI_LSB) & RDMA_REGION_2__INDI_MASK) -#define RDMA_REGION_2__NEXT_MSB 0 -#define RDMA_REGION_2__NEXT_LSB 0 -#define RDMA_REGION_2__NEXT_MASK 0x00000001 -#define RDMA_REGION_2__NEXT_GET(x) (((x) & RDMA_REGION_2__NEXT_MASK) >> RDMA_REGION_2__NEXT_LSB) -#define RDMA_REGION_2__NEXT_SET(x) (((x) << RDMA_REGION_2__NEXT_LSB) & RDMA_REGION_2__NEXT_MASK) - -#define RDMA_REGION_3__ADDRESS 0x0000002c -#define RDMA_REGION_3__OFFSET 0x0000002c -#define RDMA_REGION_3__ADDR_MSB 31 -#define RDMA_REGION_3__ADDR_LSB 13 -#define RDMA_REGION_3__ADDR_MASK 0xffffe000 -#define RDMA_REGION_3__ADDR_GET(x) (((x) & RDMA_REGION_3__ADDR_MASK) >> RDMA_REGION_3__ADDR_LSB) -#define RDMA_REGION_3__ADDR_SET(x) (((x) << RDMA_REGION_3__ADDR_LSB) & RDMA_REGION_3__ADDR_MASK) -#define RDMA_REGION_3__LENGTH_MSB 12 -#define RDMA_REGION_3__LENGTH_LSB 2 -#define RDMA_REGION_3__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_3__LENGTH_GET(x) (((x) & RDMA_REGION_3__LENGTH_MASK) >> RDMA_REGION_3__LENGTH_LSB) -#define RDMA_REGION_3__LENGTH_SET(x) (((x) << RDMA_REGION_3__LENGTH_LSB) & RDMA_REGION_3__LENGTH_MASK) -#define RDMA_REGION_3__INDI_MSB 1 -#define RDMA_REGION_3__INDI_LSB 1 -#define RDMA_REGION_3__INDI_MASK 0x00000002 -#define RDMA_REGION_3__INDI_GET(x) (((x) & RDMA_REGION_3__INDI_MASK) >> RDMA_REGION_3__INDI_LSB) -#define RDMA_REGION_3__INDI_SET(x) (((x) << RDMA_REGION_3__INDI_LSB) & RDMA_REGION_3__INDI_MASK) -#define RDMA_REGION_3__NEXT_MSB 0 -#define RDMA_REGION_3__NEXT_LSB 0 -#define RDMA_REGION_3__NEXT_MASK 0x00000001 -#define RDMA_REGION_3__NEXT_GET(x) (((x) & RDMA_REGION_3__NEXT_MASK) >> RDMA_REGION_3__NEXT_LSB) -#define RDMA_REGION_3__NEXT_SET(x) (((x) << RDMA_REGION_3__NEXT_LSB) & RDMA_REGION_3__NEXT_MASK) - -#define RDMA_REGION_4__ADDRESS 0x00000030 -#define RDMA_REGION_4__OFFSET 0x00000030 -#define RDMA_REGION_4__ADDR_MSB 31 -#define RDMA_REGION_4__ADDR_LSB 13 -#define RDMA_REGION_4__ADDR_MASK 0xffffe000 -#define RDMA_REGION_4__ADDR_GET(x) (((x) & RDMA_REGION_4__ADDR_MASK) >> RDMA_REGION_4__ADDR_LSB) -#define RDMA_REGION_4__ADDR_SET(x) (((x) << RDMA_REGION_4__ADDR_LSB) & RDMA_REGION_4__ADDR_MASK) -#define RDMA_REGION_4__LENGTH_MSB 12 -#define RDMA_REGION_4__LENGTH_LSB 2 -#define RDMA_REGION_4__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_4__LENGTH_GET(x) (((x) & RDMA_REGION_4__LENGTH_MASK) >> RDMA_REGION_4__LENGTH_LSB) -#define RDMA_REGION_4__LENGTH_SET(x) (((x) << RDMA_REGION_4__LENGTH_LSB) & RDMA_REGION_4__LENGTH_MASK) -#define RDMA_REGION_4__INDI_MSB 1 -#define RDMA_REGION_4__INDI_LSB 1 -#define RDMA_REGION_4__INDI_MASK 0x00000002 -#define RDMA_REGION_4__INDI_GET(x) (((x) & RDMA_REGION_4__INDI_MASK) >> RDMA_REGION_4__INDI_LSB) -#define RDMA_REGION_4__INDI_SET(x) (((x) << RDMA_REGION_4__INDI_LSB) & RDMA_REGION_4__INDI_MASK) -#define RDMA_REGION_4__NEXT_MSB 0 -#define RDMA_REGION_4__NEXT_LSB 0 -#define RDMA_REGION_4__NEXT_MASK 0x00000001 -#define RDMA_REGION_4__NEXT_GET(x) (((x) & RDMA_REGION_4__NEXT_MASK) >> RDMA_REGION_4__NEXT_LSB) -#define RDMA_REGION_4__NEXT_SET(x) (((x) << RDMA_REGION_4__NEXT_LSB) & RDMA_REGION_4__NEXT_MASK) - -#define RDMA_REGION_5__ADDRESS 0x00000034 -#define RDMA_REGION_5__OFFSET 0x00000034 -#define RDMA_REGION_5__ADDR_MSB 31 -#define RDMA_REGION_5__ADDR_LSB 13 -#define RDMA_REGION_5__ADDR_MASK 0xffffe000 -#define RDMA_REGION_5__ADDR_GET(x) (((x) & RDMA_REGION_5__ADDR_MASK) >> RDMA_REGION_5__ADDR_LSB) -#define RDMA_REGION_5__ADDR_SET(x) (((x) << RDMA_REGION_5__ADDR_LSB) & RDMA_REGION_5__ADDR_MASK) -#define RDMA_REGION_5__LENGTH_MSB 12 -#define RDMA_REGION_5__LENGTH_LSB 2 -#define RDMA_REGION_5__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_5__LENGTH_GET(x) (((x) & RDMA_REGION_5__LENGTH_MASK) >> RDMA_REGION_5__LENGTH_LSB) -#define RDMA_REGION_5__LENGTH_SET(x) (((x) << RDMA_REGION_5__LENGTH_LSB) & RDMA_REGION_5__LENGTH_MASK) -#define RDMA_REGION_5__INDI_MSB 1 -#define RDMA_REGION_5__INDI_LSB 1 -#define RDMA_REGION_5__INDI_MASK 0x00000002 -#define RDMA_REGION_5__INDI_GET(x) (((x) & RDMA_REGION_5__INDI_MASK) >> RDMA_REGION_5__INDI_LSB) -#define RDMA_REGION_5__INDI_SET(x) (((x) << RDMA_REGION_5__INDI_LSB) & RDMA_REGION_5__INDI_MASK) -#define RDMA_REGION_5__NEXT_MSB 0 -#define RDMA_REGION_5__NEXT_LSB 0 -#define RDMA_REGION_5__NEXT_MASK 0x00000001 -#define RDMA_REGION_5__NEXT_GET(x) (((x) & RDMA_REGION_5__NEXT_MASK) >> RDMA_REGION_5__NEXT_LSB) -#define RDMA_REGION_5__NEXT_SET(x) (((x) << RDMA_REGION_5__NEXT_LSB) & RDMA_REGION_5__NEXT_MASK) - -#define RDMA_REGION_6__ADDRESS 0x00000038 -#define RDMA_REGION_6__OFFSET 0x00000038 -#define RDMA_REGION_6__ADDR_MSB 31 -#define RDMA_REGION_6__ADDR_LSB 13 -#define RDMA_REGION_6__ADDR_MASK 0xffffe000 -#define RDMA_REGION_6__ADDR_GET(x) (((x) & RDMA_REGION_6__ADDR_MASK) >> RDMA_REGION_6__ADDR_LSB) -#define RDMA_REGION_6__ADDR_SET(x) (((x) << RDMA_REGION_6__ADDR_LSB) & RDMA_REGION_6__ADDR_MASK) -#define RDMA_REGION_6__LENGTH_MSB 12 -#define RDMA_REGION_6__LENGTH_LSB 2 -#define RDMA_REGION_6__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_6__LENGTH_GET(x) (((x) & RDMA_REGION_6__LENGTH_MASK) >> RDMA_REGION_6__LENGTH_LSB) -#define RDMA_REGION_6__LENGTH_SET(x) (((x) << RDMA_REGION_6__LENGTH_LSB) & RDMA_REGION_6__LENGTH_MASK) -#define RDMA_REGION_6__INDI_MSB 1 -#define RDMA_REGION_6__INDI_LSB 1 -#define RDMA_REGION_6__INDI_MASK 0x00000002 -#define RDMA_REGION_6__INDI_GET(x) (((x) & RDMA_REGION_6__INDI_MASK) >> RDMA_REGION_6__INDI_LSB) -#define RDMA_REGION_6__INDI_SET(x) (((x) << RDMA_REGION_6__INDI_LSB) & RDMA_REGION_6__INDI_MASK) -#define RDMA_REGION_6__NEXT_MSB 0 -#define RDMA_REGION_6__NEXT_LSB 0 -#define RDMA_REGION_6__NEXT_MASK 0x00000001 -#define RDMA_REGION_6__NEXT_GET(x) (((x) & RDMA_REGION_6__NEXT_MASK) >> RDMA_REGION_6__NEXT_LSB) -#define RDMA_REGION_6__NEXT_SET(x) (((x) << RDMA_REGION_6__NEXT_LSB) & RDMA_REGION_6__NEXT_MASK) - -#define RDMA_REGION_7__ADDRESS 0x0000003c -#define RDMA_REGION_7__OFFSET 0x0000003c -#define RDMA_REGION_7__ADDR_MSB 31 -#define RDMA_REGION_7__ADDR_LSB 13 -#define RDMA_REGION_7__ADDR_MASK 0xffffe000 -#define RDMA_REGION_7__ADDR_GET(x) (((x) & RDMA_REGION_7__ADDR_MASK) >> RDMA_REGION_7__ADDR_LSB) -#define RDMA_REGION_7__ADDR_SET(x) (((x) << RDMA_REGION_7__ADDR_LSB) & RDMA_REGION_7__ADDR_MASK) -#define RDMA_REGION_7__LENGTH_MSB 12 -#define RDMA_REGION_7__LENGTH_LSB 2 -#define RDMA_REGION_7__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_7__LENGTH_GET(x) (((x) & RDMA_REGION_7__LENGTH_MASK) >> RDMA_REGION_7__LENGTH_LSB) -#define RDMA_REGION_7__LENGTH_SET(x) (((x) << RDMA_REGION_7__LENGTH_LSB) & RDMA_REGION_7__LENGTH_MASK) -#define RDMA_REGION_7__INDI_MSB 1 -#define RDMA_REGION_7__INDI_LSB 1 -#define RDMA_REGION_7__INDI_MASK 0x00000002 -#define RDMA_REGION_7__INDI_GET(x) (((x) & RDMA_REGION_7__INDI_MASK) >> RDMA_REGION_7__INDI_LSB) -#define RDMA_REGION_7__INDI_SET(x) (((x) << RDMA_REGION_7__INDI_LSB) & RDMA_REGION_7__INDI_MASK) -#define RDMA_REGION_7__NEXT_MSB 0 -#define RDMA_REGION_7__NEXT_LSB 0 -#define RDMA_REGION_7__NEXT_MASK 0x00000001 -#define RDMA_REGION_7__NEXT_GET(x) (((x) & RDMA_REGION_7__NEXT_MASK) >> RDMA_REGION_7__NEXT_LSB) -#define RDMA_REGION_7__NEXT_SET(x) (((x) << RDMA_REGION_7__NEXT_LSB) & RDMA_REGION_7__NEXT_MASK) - -#define RDMA_REGION_8__ADDRESS 0x00000040 -#define RDMA_REGION_8__OFFSET 0x00000040 -#define RDMA_REGION_8__ADDR_MSB 31 -#define RDMA_REGION_8__ADDR_LSB 13 -#define RDMA_REGION_8__ADDR_MASK 0xffffe000 -#define RDMA_REGION_8__ADDR_GET(x) (((x) & RDMA_REGION_8__ADDR_MASK) >> RDMA_REGION_8__ADDR_LSB) -#define RDMA_REGION_8__ADDR_SET(x) (((x) << RDMA_REGION_8__ADDR_LSB) & RDMA_REGION_8__ADDR_MASK) -#define RDMA_REGION_8__LENGTH_MSB 12 -#define RDMA_REGION_8__LENGTH_LSB 2 -#define RDMA_REGION_8__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_8__LENGTH_GET(x) (((x) & RDMA_REGION_8__LENGTH_MASK) >> RDMA_REGION_8__LENGTH_LSB) -#define RDMA_REGION_8__LENGTH_SET(x) (((x) << RDMA_REGION_8__LENGTH_LSB) & RDMA_REGION_8__LENGTH_MASK) -#define RDMA_REGION_8__INDI_MSB 1 -#define RDMA_REGION_8__INDI_LSB 1 -#define RDMA_REGION_8__INDI_MASK 0x00000002 -#define RDMA_REGION_8__INDI_GET(x) (((x) & RDMA_REGION_8__INDI_MASK) >> RDMA_REGION_8__INDI_LSB) -#define RDMA_REGION_8__INDI_SET(x) (((x) << RDMA_REGION_8__INDI_LSB) & RDMA_REGION_8__INDI_MASK) -#define RDMA_REGION_8__NEXT_MSB 0 -#define RDMA_REGION_8__NEXT_LSB 0 -#define RDMA_REGION_8__NEXT_MASK 0x00000001 -#define RDMA_REGION_8__NEXT_GET(x) (((x) & RDMA_REGION_8__NEXT_MASK) >> RDMA_REGION_8__NEXT_LSB) -#define RDMA_REGION_8__NEXT_SET(x) (((x) << RDMA_REGION_8__NEXT_LSB) & RDMA_REGION_8__NEXT_MASK) - -#define RDMA_REGION_9__ADDRESS 0x00000044 -#define RDMA_REGION_9__OFFSET 0x00000044 -#define RDMA_REGION_9__ADDR_MSB 31 -#define RDMA_REGION_9__ADDR_LSB 13 -#define RDMA_REGION_9__ADDR_MASK 0xffffe000 -#define RDMA_REGION_9__ADDR_GET(x) (((x) & RDMA_REGION_9__ADDR_MASK) >> RDMA_REGION_9__ADDR_LSB) -#define RDMA_REGION_9__ADDR_SET(x) (((x) << RDMA_REGION_9__ADDR_LSB) & RDMA_REGION_9__ADDR_MASK) -#define RDMA_REGION_9__LENGTH_MSB 12 -#define RDMA_REGION_9__LENGTH_LSB 2 -#define RDMA_REGION_9__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_9__LENGTH_GET(x) (((x) & RDMA_REGION_9__LENGTH_MASK) >> RDMA_REGION_9__LENGTH_LSB) -#define RDMA_REGION_9__LENGTH_SET(x) (((x) << RDMA_REGION_9__LENGTH_LSB) & RDMA_REGION_9__LENGTH_MASK) -#define RDMA_REGION_9__INDI_MSB 1 -#define RDMA_REGION_9__INDI_LSB 1 -#define RDMA_REGION_9__INDI_MASK 0x00000002 -#define RDMA_REGION_9__INDI_GET(x) (((x) & RDMA_REGION_9__INDI_MASK) >> RDMA_REGION_9__INDI_LSB) -#define RDMA_REGION_9__INDI_SET(x) (((x) << RDMA_REGION_9__INDI_LSB) & RDMA_REGION_9__INDI_MASK) -#define RDMA_REGION_9__NEXT_MSB 0 -#define RDMA_REGION_9__NEXT_LSB 0 -#define RDMA_REGION_9__NEXT_MASK 0x00000001 -#define RDMA_REGION_9__NEXT_GET(x) (((x) & RDMA_REGION_9__NEXT_MASK) >> RDMA_REGION_9__NEXT_LSB) -#define RDMA_REGION_9__NEXT_SET(x) (((x) << RDMA_REGION_9__NEXT_LSB) & RDMA_REGION_9__NEXT_MASK) - -#define RDMA_REGION_10__ADDRESS 0x00000048 -#define RDMA_REGION_10__OFFSET 0x00000048 -#define RDMA_REGION_10__ADDR_MSB 31 -#define RDMA_REGION_10__ADDR_LSB 13 -#define RDMA_REGION_10__ADDR_MASK 0xffffe000 -#define RDMA_REGION_10__ADDR_GET(x) (((x) & RDMA_REGION_10__ADDR_MASK) >> RDMA_REGION_10__ADDR_LSB) -#define RDMA_REGION_10__ADDR_SET(x) (((x) << RDMA_REGION_10__ADDR_LSB) & RDMA_REGION_10__ADDR_MASK) -#define RDMA_REGION_10__LENGTH_MSB 12 -#define RDMA_REGION_10__LENGTH_LSB 2 -#define RDMA_REGION_10__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_10__LENGTH_GET(x) (((x) & RDMA_REGION_10__LENGTH_MASK) >> RDMA_REGION_10__LENGTH_LSB) -#define RDMA_REGION_10__LENGTH_SET(x) (((x) << RDMA_REGION_10__LENGTH_LSB) & RDMA_REGION_10__LENGTH_MASK) -#define RDMA_REGION_10__INDI_MSB 1 -#define RDMA_REGION_10__INDI_LSB 1 -#define RDMA_REGION_10__INDI_MASK 0x00000002 -#define RDMA_REGION_10__INDI_GET(x) (((x) & RDMA_REGION_10__INDI_MASK) >> RDMA_REGION_10__INDI_LSB) -#define RDMA_REGION_10__INDI_SET(x) (((x) << RDMA_REGION_10__INDI_LSB) & RDMA_REGION_10__INDI_MASK) -#define RDMA_REGION_10__NEXT_MSB 0 -#define RDMA_REGION_10__NEXT_LSB 0 -#define RDMA_REGION_10__NEXT_MASK 0x00000001 -#define RDMA_REGION_10__NEXT_GET(x) (((x) & RDMA_REGION_10__NEXT_MASK) >> RDMA_REGION_10__NEXT_LSB) -#define RDMA_REGION_10__NEXT_SET(x) (((x) << RDMA_REGION_10__NEXT_LSB) & RDMA_REGION_10__NEXT_MASK) - -#define RDMA_REGION_11__ADDRESS 0x0000004c -#define RDMA_REGION_11__OFFSET 0x0000004c -#define RDMA_REGION_11__ADDR_MSB 31 -#define RDMA_REGION_11__ADDR_LSB 13 -#define RDMA_REGION_11__ADDR_MASK 0xffffe000 -#define RDMA_REGION_11__ADDR_GET(x) (((x) & RDMA_REGION_11__ADDR_MASK) >> RDMA_REGION_11__ADDR_LSB) -#define RDMA_REGION_11__ADDR_SET(x) (((x) << RDMA_REGION_11__ADDR_LSB) & RDMA_REGION_11__ADDR_MASK) -#define RDMA_REGION_11__LENGTH_MSB 12 -#define RDMA_REGION_11__LENGTH_LSB 2 -#define RDMA_REGION_11__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_11__LENGTH_GET(x) (((x) & RDMA_REGION_11__LENGTH_MASK) >> RDMA_REGION_11__LENGTH_LSB) -#define RDMA_REGION_11__LENGTH_SET(x) (((x) << RDMA_REGION_11__LENGTH_LSB) & RDMA_REGION_11__LENGTH_MASK) -#define RDMA_REGION_11__INDI_MSB 1 -#define RDMA_REGION_11__INDI_LSB 1 -#define RDMA_REGION_11__INDI_MASK 0x00000002 -#define RDMA_REGION_11__INDI_GET(x) (((x) & RDMA_REGION_11__INDI_MASK) >> RDMA_REGION_11__INDI_LSB) -#define RDMA_REGION_11__INDI_SET(x) (((x) << RDMA_REGION_11__INDI_LSB) & RDMA_REGION_11__INDI_MASK) -#define RDMA_REGION_11__NEXT_MSB 0 -#define RDMA_REGION_11__NEXT_LSB 0 -#define RDMA_REGION_11__NEXT_MASK 0x00000001 -#define RDMA_REGION_11__NEXT_GET(x) (((x) & RDMA_REGION_11__NEXT_MASK) >> RDMA_REGION_11__NEXT_LSB) -#define RDMA_REGION_11__NEXT_SET(x) (((x) << RDMA_REGION_11__NEXT_LSB) & RDMA_REGION_11__NEXT_MASK) - -#define RDMA_REGION_12__ADDRESS 0x00000050 -#define RDMA_REGION_12__OFFSET 0x00000050 -#define RDMA_REGION_12__ADDR_MSB 31 -#define RDMA_REGION_12__ADDR_LSB 13 -#define RDMA_REGION_12__ADDR_MASK 0xffffe000 -#define RDMA_REGION_12__ADDR_GET(x) (((x) & RDMA_REGION_12__ADDR_MASK) >> RDMA_REGION_12__ADDR_LSB) -#define RDMA_REGION_12__ADDR_SET(x) (((x) << RDMA_REGION_12__ADDR_LSB) & RDMA_REGION_12__ADDR_MASK) -#define RDMA_REGION_12__LENGTH_MSB 12 -#define RDMA_REGION_12__LENGTH_LSB 2 -#define RDMA_REGION_12__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_12__LENGTH_GET(x) (((x) & RDMA_REGION_12__LENGTH_MASK) >> RDMA_REGION_12__LENGTH_LSB) -#define RDMA_REGION_12__LENGTH_SET(x) (((x) << RDMA_REGION_12__LENGTH_LSB) & RDMA_REGION_12__LENGTH_MASK) -#define RDMA_REGION_12__INDI_MSB 1 -#define RDMA_REGION_12__INDI_LSB 1 -#define RDMA_REGION_12__INDI_MASK 0x00000002 -#define RDMA_REGION_12__INDI_GET(x) (((x) & RDMA_REGION_12__INDI_MASK) >> RDMA_REGION_12__INDI_LSB) -#define RDMA_REGION_12__INDI_SET(x) (((x) << RDMA_REGION_12__INDI_LSB) & RDMA_REGION_12__INDI_MASK) -#define RDMA_REGION_12__NEXT_MSB 0 -#define RDMA_REGION_12__NEXT_LSB 0 -#define RDMA_REGION_12__NEXT_MASK 0x00000001 -#define RDMA_REGION_12__NEXT_GET(x) (((x) & RDMA_REGION_12__NEXT_MASK) >> RDMA_REGION_12__NEXT_LSB) -#define RDMA_REGION_12__NEXT_SET(x) (((x) << RDMA_REGION_12__NEXT_LSB) & RDMA_REGION_12__NEXT_MASK) - -#define RDMA_REGION_13__ADDRESS 0x00000054 -#define RDMA_REGION_13__OFFSET 0x00000054 -#define RDMA_REGION_13__ADDR_MSB 31 -#define RDMA_REGION_13__ADDR_LSB 13 -#define RDMA_REGION_13__ADDR_MASK 0xffffe000 -#define RDMA_REGION_13__ADDR_GET(x) (((x) & RDMA_REGION_13__ADDR_MASK) >> RDMA_REGION_13__ADDR_LSB) -#define RDMA_REGION_13__ADDR_SET(x) (((x) << RDMA_REGION_13__ADDR_LSB) & RDMA_REGION_13__ADDR_MASK) -#define RDMA_REGION_13__LENGTH_MSB 12 -#define RDMA_REGION_13__LENGTH_LSB 2 -#define RDMA_REGION_13__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_13__LENGTH_GET(x) (((x) & RDMA_REGION_13__LENGTH_MASK) >> RDMA_REGION_13__LENGTH_LSB) -#define RDMA_REGION_13__LENGTH_SET(x) (((x) << RDMA_REGION_13__LENGTH_LSB) & RDMA_REGION_13__LENGTH_MASK) -#define RDMA_REGION_13__INDI_MSB 1 -#define RDMA_REGION_13__INDI_LSB 1 -#define RDMA_REGION_13__INDI_MASK 0x00000002 -#define RDMA_REGION_13__INDI_GET(x) (((x) & RDMA_REGION_13__INDI_MASK) >> RDMA_REGION_13__INDI_LSB) -#define RDMA_REGION_13__INDI_SET(x) (((x) << RDMA_REGION_13__INDI_LSB) & RDMA_REGION_13__INDI_MASK) -#define RDMA_REGION_13__NEXT_MSB 0 -#define RDMA_REGION_13__NEXT_LSB 0 -#define RDMA_REGION_13__NEXT_MASK 0x00000001 -#define RDMA_REGION_13__NEXT_GET(x) (((x) & RDMA_REGION_13__NEXT_MASK) >> RDMA_REGION_13__NEXT_LSB) -#define RDMA_REGION_13__NEXT_SET(x) (((x) << RDMA_REGION_13__NEXT_LSB) & RDMA_REGION_13__NEXT_MASK) - -#define RDMA_REGION_14__ADDRESS 0x00000058 -#define RDMA_REGION_14__OFFSET 0x00000058 -#define RDMA_REGION_14__ADDR_MSB 31 -#define RDMA_REGION_14__ADDR_LSB 13 -#define RDMA_REGION_14__ADDR_MASK 0xffffe000 -#define RDMA_REGION_14__ADDR_GET(x) (((x) & RDMA_REGION_14__ADDR_MASK) >> RDMA_REGION_14__ADDR_LSB) -#define RDMA_REGION_14__ADDR_SET(x) (((x) << RDMA_REGION_14__ADDR_LSB) & RDMA_REGION_14__ADDR_MASK) -#define RDMA_REGION_14__LENGTH_MSB 12 -#define RDMA_REGION_14__LENGTH_LSB 2 -#define RDMA_REGION_14__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_14__LENGTH_GET(x) (((x) & RDMA_REGION_14__LENGTH_MASK) >> RDMA_REGION_14__LENGTH_LSB) -#define RDMA_REGION_14__LENGTH_SET(x) (((x) << RDMA_REGION_14__LENGTH_LSB) & RDMA_REGION_14__LENGTH_MASK) -#define RDMA_REGION_14__INDI_MSB 1 -#define RDMA_REGION_14__INDI_LSB 1 -#define RDMA_REGION_14__INDI_MASK 0x00000002 -#define RDMA_REGION_14__INDI_GET(x) (((x) & RDMA_REGION_14__INDI_MASK) >> RDMA_REGION_14__INDI_LSB) -#define RDMA_REGION_14__INDI_SET(x) (((x) << RDMA_REGION_14__INDI_LSB) & RDMA_REGION_14__INDI_MASK) -#define RDMA_REGION_14__NEXT_MSB 0 -#define RDMA_REGION_14__NEXT_LSB 0 -#define RDMA_REGION_14__NEXT_MASK 0x00000001 -#define RDMA_REGION_14__NEXT_GET(x) (((x) & RDMA_REGION_14__NEXT_MASK) >> RDMA_REGION_14__NEXT_LSB) -#define RDMA_REGION_14__NEXT_SET(x) (((x) << RDMA_REGION_14__NEXT_LSB) & RDMA_REGION_14__NEXT_MASK) - -#define RDMA_REGION_15__ADDRESS 0x0000005c -#define RDMA_REGION_15__OFFSET 0x0000005c -#define RDMA_REGION_15__ADDR_MSB 31 -#define RDMA_REGION_15__ADDR_LSB 13 -#define RDMA_REGION_15__ADDR_MASK 0xffffe000 -#define RDMA_REGION_15__ADDR_GET(x) (((x) & RDMA_REGION_15__ADDR_MASK) >> RDMA_REGION_15__ADDR_LSB) -#define RDMA_REGION_15__ADDR_SET(x) (((x) << RDMA_REGION_15__ADDR_LSB) & RDMA_REGION_15__ADDR_MASK) -#define RDMA_REGION_15__LENGTH_MSB 12 -#define RDMA_REGION_15__LENGTH_LSB 2 -#define RDMA_REGION_15__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_15__LENGTH_GET(x) (((x) & RDMA_REGION_15__LENGTH_MASK) >> RDMA_REGION_15__LENGTH_LSB) -#define RDMA_REGION_15__LENGTH_SET(x) (((x) << RDMA_REGION_15__LENGTH_LSB) & RDMA_REGION_15__LENGTH_MASK) -#define RDMA_REGION_15__INDI_MSB 1 -#define RDMA_REGION_15__INDI_LSB 1 -#define RDMA_REGION_15__INDI_MASK 0x00000002 -#define RDMA_REGION_15__INDI_GET(x) (((x) & RDMA_REGION_15__INDI_MASK) >> RDMA_REGION_15__INDI_LSB) -#define RDMA_REGION_15__INDI_SET(x) (((x) << RDMA_REGION_15__INDI_LSB) & RDMA_REGION_15__INDI_MASK) -#define RDMA_REGION_15__NEXT_MSB 0 -#define RDMA_REGION_15__NEXT_LSB 0 -#define RDMA_REGION_15__NEXT_MASK 0x00000001 -#define RDMA_REGION_15__NEXT_GET(x) (((x) & RDMA_REGION_15__NEXT_MASK) >> RDMA_REGION_15__NEXT_LSB) -#define RDMA_REGION_15__NEXT_SET(x) (((x) << RDMA_REGION_15__NEXT_LSB) & RDMA_REGION_15__NEXT_MASK) - -#define DMA_STATUS_ADDRESS 0x00000060 -#define DMA_STATUS_OFFSET 0x00000060 -#define DMA_STATUS_ERROR_CODE_MSB 14 -#define DMA_STATUS_ERROR_CODE_LSB 4 -#define DMA_STATUS_ERROR_CODE_MASK 0x00007ff0 -#define DMA_STATUS_ERROR_CODE_GET(x) (((x) & DMA_STATUS_ERROR_CODE_MASK) >> DMA_STATUS_ERROR_CODE_LSB) -#define DMA_STATUS_ERROR_CODE_SET(x) (((x) << DMA_STATUS_ERROR_CODE_LSB) & DMA_STATUS_ERROR_CODE_MASK) -#define DMA_STATUS_ERROR_MSB 3 -#define DMA_STATUS_ERROR_LSB 3 -#define DMA_STATUS_ERROR_MASK 0x00000008 -#define DMA_STATUS_ERROR_GET(x) (((x) & DMA_STATUS_ERROR_MASK) >> DMA_STATUS_ERROR_LSB) -#define DMA_STATUS_ERROR_SET(x) (((x) << DMA_STATUS_ERROR_LSB) & DMA_STATUS_ERROR_MASK) -#define DMA_STATUS_DONE_MSB 2 -#define DMA_STATUS_DONE_LSB 2 -#define DMA_STATUS_DONE_MASK 0x00000004 -#define DMA_STATUS_DONE_GET(x) (((x) & DMA_STATUS_DONE_MASK) >> DMA_STATUS_DONE_LSB) -#define DMA_STATUS_DONE_SET(x) (((x) << DMA_STATUS_DONE_LSB) & DMA_STATUS_DONE_MASK) -#define DMA_STATUS_STOPPED_MSB 1 -#define DMA_STATUS_STOPPED_LSB 1 -#define DMA_STATUS_STOPPED_MASK 0x00000002 -#define DMA_STATUS_STOPPED_GET(x) (((x) & DMA_STATUS_STOPPED_MASK) >> DMA_STATUS_STOPPED_LSB) -#define DMA_STATUS_STOPPED_SET(x) (((x) << DMA_STATUS_STOPPED_LSB) & DMA_STATUS_STOPPED_MASK) -#define DMA_STATUS_RUNNING_MSB 0 -#define DMA_STATUS_RUNNING_LSB 0 -#define DMA_STATUS_RUNNING_MASK 0x00000001 -#define DMA_STATUS_RUNNING_GET(x) (((x) & DMA_STATUS_RUNNING_MASK) >> DMA_STATUS_RUNNING_LSB) -#define DMA_STATUS_RUNNING_SET(x) (((x) << DMA_STATUS_RUNNING_LSB) & DMA_STATUS_RUNNING_MASK) - -#define DMA_INT_EN_ADDRESS 0x00000064 -#define DMA_INT_EN_OFFSET 0x00000064 -#define DMA_INT_EN_ERROR_ENA_MSB 3 -#define DMA_INT_EN_ERROR_ENA_LSB 3 -#define DMA_INT_EN_ERROR_ENA_MASK 0x00000008 -#define DMA_INT_EN_ERROR_ENA_GET(x) (((x) & DMA_INT_EN_ERROR_ENA_MASK) >> DMA_INT_EN_ERROR_ENA_LSB) -#define DMA_INT_EN_ERROR_ENA_SET(x) (((x) << DMA_INT_EN_ERROR_ENA_LSB) & DMA_INT_EN_ERROR_ENA_MASK) -#define DMA_INT_EN_DONE_ENA_MSB 2 -#define DMA_INT_EN_DONE_ENA_LSB 2 -#define DMA_INT_EN_DONE_ENA_MASK 0x00000004 -#define DMA_INT_EN_DONE_ENA_GET(x) (((x) & DMA_INT_EN_DONE_ENA_MASK) >> DMA_INT_EN_DONE_ENA_LSB) -#define DMA_INT_EN_DONE_ENA_SET(x) (((x) << DMA_INT_EN_DONE_ENA_LSB) & DMA_INT_EN_DONE_ENA_MASK) -#define DMA_INT_EN_STOPPED_ENA_MSB 1 -#define DMA_INT_EN_STOPPED_ENA_LSB 1 -#define DMA_INT_EN_STOPPED_ENA_MASK 0x00000002 -#define DMA_INT_EN_STOPPED_ENA_GET(x) (((x) & DMA_INT_EN_STOPPED_ENA_MASK) >> DMA_INT_EN_STOPPED_ENA_LSB) -#define DMA_INT_EN_STOPPED_ENA_SET(x) (((x) << DMA_INT_EN_STOPPED_ENA_LSB) & DMA_INT_EN_STOPPED_ENA_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct rdma_reg_reg_s { - volatile unsigned int dma_config; - volatile unsigned int dma_control; - volatile unsigned int dma_src; - volatile unsigned int dma_dest; - volatile unsigned int dma_length; - volatile unsigned int vmc_base; - volatile unsigned int indirect_reg; - volatile unsigned int indirect_return; - volatile unsigned int rdma_region_0_; - volatile unsigned int rdma_region_1_; - volatile unsigned int rdma_region_2_; - volatile unsigned int rdma_region_3_; - volatile unsigned int rdma_region_4_; - volatile unsigned int rdma_region_5_; - volatile unsigned int rdma_region_6_; - volatile unsigned int rdma_region_7_; - volatile unsigned int rdma_region_8_; - volatile unsigned int rdma_region_9_; - volatile unsigned int rdma_region_10_; - volatile unsigned int rdma_region_11_; - volatile unsigned int rdma_region_12_; - volatile unsigned int rdma_region_13_; - volatile unsigned int rdma_region_14_; - volatile unsigned int rdma_region_15_; - volatile unsigned int dma_status; - volatile unsigned int dma_int_en; -} rdma_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _RDMA_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/rtc_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/rtc_reg.h deleted file mode 100644 index 7067fcea3c9c..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/rtc_reg.h +++ /dev/null @@ -1,975 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "rtc_wlan_reg.h" - - -#ifndef BT_HEADERS - -#define RESET_CONTROL_ADDRESS WLAN_RESET_CONTROL_ADDRESS -#define RESET_CONTROL_OFFSET WLAN_RESET_CONTROL_OFFSET -#define RESET_CONTROL_DEBUG_UART_RST_MSB WLAN_RESET_CONTROL_DEBUG_UART_RST_MSB -#define RESET_CONTROL_DEBUG_UART_RST_LSB WLAN_RESET_CONTROL_DEBUG_UART_RST_LSB -#define RESET_CONTROL_DEBUG_UART_RST_MASK WLAN_RESET_CONTROL_DEBUG_UART_RST_MASK -#define RESET_CONTROL_DEBUG_UART_RST_GET(x) WLAN_RESET_CONTROL_DEBUG_UART_RST_GET(x) -#define RESET_CONTROL_DEBUG_UART_RST_SET(x) WLAN_RESET_CONTROL_DEBUG_UART_RST_SET(x) -#define RESET_CONTROL_BB_COLD_RST_MSB WLAN_RESET_CONTROL_BB_COLD_RST_MSB -#define RESET_CONTROL_BB_COLD_RST_LSB WLAN_RESET_CONTROL_BB_COLD_RST_LSB -#define RESET_CONTROL_BB_COLD_RST_MASK WLAN_RESET_CONTROL_BB_COLD_RST_MASK -#define RESET_CONTROL_BB_COLD_RST_GET(x) WLAN_RESET_CONTROL_BB_COLD_RST_GET(x) -#define RESET_CONTROL_BB_COLD_RST_SET(x) WLAN_RESET_CONTROL_BB_COLD_RST_SET(x) -#define RESET_CONTROL_BB_WARM_RST_MSB WLAN_RESET_CONTROL_BB_WARM_RST_MSB -#define RESET_CONTROL_BB_WARM_RST_LSB WLAN_RESET_CONTROL_BB_WARM_RST_LSB -#define RESET_CONTROL_BB_WARM_RST_MASK WLAN_RESET_CONTROL_BB_WARM_RST_MASK -#define RESET_CONTROL_BB_WARM_RST_GET(x) WLAN_RESET_CONTROL_BB_WARM_RST_GET(x) -#define RESET_CONTROL_BB_WARM_RST_SET(x) WLAN_RESET_CONTROL_BB_WARM_RST_SET(x) -#define RESET_CONTROL_CPU_INIT_RESET_MSB WLAN_RESET_CONTROL_CPU_INIT_RESET_MSB -#define RESET_CONTROL_CPU_INIT_RESET_LSB WLAN_RESET_CONTROL_CPU_INIT_RESET_LSB -#define RESET_CONTROL_CPU_INIT_RESET_MASK WLAN_RESET_CONTROL_CPU_INIT_RESET_MASK -#define RESET_CONTROL_CPU_INIT_RESET_GET(x) WLAN_RESET_CONTROL_CPU_INIT_RESET_GET(x) -#define RESET_CONTROL_CPU_INIT_RESET_SET(x) WLAN_RESET_CONTROL_CPU_INIT_RESET_SET(x) -#define RESET_CONTROL_VMC_REMAP_RESET_MSB WLAN_RESET_CONTROL_VMC_REMAP_RESET_MSB -#define RESET_CONTROL_VMC_REMAP_RESET_LSB WLAN_RESET_CONTROL_VMC_REMAP_RESET_LSB -#define RESET_CONTROL_VMC_REMAP_RESET_MASK WLAN_RESET_CONTROL_VMC_REMAP_RESET_MASK -#define RESET_CONTROL_VMC_REMAP_RESET_GET(x) WLAN_RESET_CONTROL_VMC_REMAP_RESET_GET(x) -#define RESET_CONTROL_VMC_REMAP_RESET_SET(x) WLAN_RESET_CONTROL_VMC_REMAP_RESET_SET(x) -#define RESET_CONTROL_RST_OUT_MSB WLAN_RESET_CONTROL_RST_OUT_MSB -#define RESET_CONTROL_RST_OUT_LSB WLAN_RESET_CONTROL_RST_OUT_LSB -#define RESET_CONTROL_RST_OUT_MASK WLAN_RESET_CONTROL_RST_OUT_MASK -#define RESET_CONTROL_RST_OUT_GET(x) WLAN_RESET_CONTROL_RST_OUT_GET(x) -#define RESET_CONTROL_RST_OUT_SET(x) WLAN_RESET_CONTROL_RST_OUT_SET(x) -#define RESET_CONTROL_COLD_RST_MSB WLAN_RESET_CONTROL_COLD_RST_MSB -#define RESET_CONTROL_COLD_RST_LSB WLAN_RESET_CONTROL_COLD_RST_LSB -#define RESET_CONTROL_COLD_RST_MASK WLAN_RESET_CONTROL_COLD_RST_MASK -#define RESET_CONTROL_COLD_RST_GET(x) WLAN_RESET_CONTROL_COLD_RST_GET(x) -#define RESET_CONTROL_COLD_RST_SET(x) WLAN_RESET_CONTROL_COLD_RST_SET(x) -#define RESET_CONTROL_WARM_RST_MSB WLAN_RESET_CONTROL_WARM_RST_MSB -#define RESET_CONTROL_WARM_RST_LSB WLAN_RESET_CONTROL_WARM_RST_LSB -#define RESET_CONTROL_WARM_RST_MASK WLAN_RESET_CONTROL_WARM_RST_MASK -#define RESET_CONTROL_WARM_RST_GET(x) WLAN_RESET_CONTROL_WARM_RST_GET(x) -#define RESET_CONTROL_WARM_RST_SET(x) WLAN_RESET_CONTROL_WARM_RST_SET(x) -#define RESET_CONTROL_CPU_WARM_RST_MSB WLAN_RESET_CONTROL_CPU_WARM_RST_MSB -#define RESET_CONTROL_CPU_WARM_RST_LSB WLAN_RESET_CONTROL_CPU_WARM_RST_LSB -#define RESET_CONTROL_CPU_WARM_RST_MASK WLAN_RESET_CONTROL_CPU_WARM_RST_MASK -#define RESET_CONTROL_CPU_WARM_RST_GET(x) WLAN_RESET_CONTROL_CPU_WARM_RST_GET(x) -#define RESET_CONTROL_CPU_WARM_RST_SET(x) WLAN_RESET_CONTROL_CPU_WARM_RST_SET(x) -#define RESET_CONTROL_MAC_COLD_RST_MSB WLAN_RESET_CONTROL_MAC_COLD_RST_MSB -#define RESET_CONTROL_MAC_COLD_RST_LSB WLAN_RESET_CONTROL_MAC_COLD_RST_LSB -#define RESET_CONTROL_MAC_COLD_RST_MASK WLAN_RESET_CONTROL_MAC_COLD_RST_MASK -#define RESET_CONTROL_MAC_COLD_RST_GET(x) WLAN_RESET_CONTROL_MAC_COLD_RST_GET(x) -#define RESET_CONTROL_MAC_COLD_RST_SET(x) WLAN_RESET_CONTROL_MAC_COLD_RST_SET(x) -#define RESET_CONTROL_MAC_WARM_RST_MSB WLAN_RESET_CONTROL_MAC_WARM_RST_MSB -#define RESET_CONTROL_MAC_WARM_RST_LSB WLAN_RESET_CONTROL_MAC_WARM_RST_LSB -#define RESET_CONTROL_MAC_WARM_RST_MASK WLAN_RESET_CONTROL_MAC_WARM_RST_MASK -#define RESET_CONTROL_MAC_WARM_RST_GET(x) WLAN_RESET_CONTROL_MAC_WARM_RST_GET(x) -#define RESET_CONTROL_MAC_WARM_RST_SET(x) WLAN_RESET_CONTROL_MAC_WARM_RST_SET(x) -#define RESET_CONTROL_MBOX_RST_MSB WLAN_RESET_CONTROL_MBOX_RST_MSB -#define RESET_CONTROL_MBOX_RST_LSB WLAN_RESET_CONTROL_MBOX_RST_LSB -#define RESET_CONTROL_MBOX_RST_MASK WLAN_RESET_CONTROL_MBOX_RST_MASK -#define RESET_CONTROL_MBOX_RST_GET(x) WLAN_RESET_CONTROL_MBOX_RST_GET(x) -#define RESET_CONTROL_MBOX_RST_SET(x) WLAN_RESET_CONTROL_MBOX_RST_SET(x) -#define RESET_CONTROL_UART_RST_MSB WLAN_RESET_CONTROL_UART_RST_MSB -#define RESET_CONTROL_UART_RST_LSB WLAN_RESET_CONTROL_UART_RST_LSB -#define RESET_CONTROL_UART_RST_MASK WLAN_RESET_CONTROL_UART_RST_MASK -#define RESET_CONTROL_UART_RST_GET(x) WLAN_RESET_CONTROL_UART_RST_GET(x) -#define RESET_CONTROL_UART_RST_SET(x) WLAN_RESET_CONTROL_UART_RST_SET(x) -#define RESET_CONTROL_SI0_RST_MSB WLAN_RESET_CONTROL_SI0_RST_MSB -#define RESET_CONTROL_SI0_RST_LSB WLAN_RESET_CONTROL_SI0_RST_LSB -#define RESET_CONTROL_SI0_RST_MASK WLAN_RESET_CONTROL_SI0_RST_MASK -#define RESET_CONTROL_SI0_RST_GET(x) WLAN_RESET_CONTROL_SI0_RST_GET(x) -#define RESET_CONTROL_SI0_RST_SET(x) WLAN_RESET_CONTROL_SI0_RST_SET(x) -#define XTAL_CONTROL_ADDRESS WLAN_XTAL_CONTROL_ADDRESS -#define XTAL_CONTROL_OFFSET WLAN_XTAL_CONTROL_OFFSET -#define XTAL_CONTROL_TCXO_MSB WLAN_XTAL_CONTROL_TCXO_MSB -#define XTAL_CONTROL_TCXO_LSB WLAN_XTAL_CONTROL_TCXO_LSB -#define XTAL_CONTROL_TCXO_MASK WLAN_XTAL_CONTROL_TCXO_MASK -#define XTAL_CONTROL_TCXO_GET(x) WLAN_XTAL_CONTROL_TCXO_GET(x) -#define XTAL_CONTROL_TCXO_SET(x) WLAN_XTAL_CONTROL_TCXO_SET(x) -#define TCXO_DETECT_ADDRESS WLAN_TCXO_DETECT_ADDRESS -#define TCXO_DETECT_OFFSET WLAN_TCXO_DETECT_OFFSET -#define TCXO_DETECT_PRESENT_MSB WLAN_TCXO_DETECT_PRESENT_MSB -#define TCXO_DETECT_PRESENT_LSB WLAN_TCXO_DETECT_PRESENT_LSB -#define TCXO_DETECT_PRESENT_MASK WLAN_TCXO_DETECT_PRESENT_MASK -#define TCXO_DETECT_PRESENT_GET(x) WLAN_TCXO_DETECT_PRESENT_GET(x) -#define TCXO_DETECT_PRESENT_SET(x) WLAN_TCXO_DETECT_PRESENT_SET(x) -#define XTAL_TEST_ADDRESS WLAN_XTAL_TEST_ADDRESS -#define XTAL_TEST_OFFSET WLAN_XTAL_TEST_OFFSET -#define XTAL_TEST_NOTCXODET_MSB WLAN_XTAL_TEST_NOTCXODET_MSB -#define XTAL_TEST_NOTCXODET_LSB WLAN_XTAL_TEST_NOTCXODET_LSB -#define XTAL_TEST_NOTCXODET_MASK WLAN_XTAL_TEST_NOTCXODET_MASK -#define XTAL_TEST_NOTCXODET_GET(x) WLAN_XTAL_TEST_NOTCXODET_GET(x) -#define XTAL_TEST_NOTCXODET_SET(x) WLAN_XTAL_TEST_NOTCXODET_SET(x) -#define QUADRATURE_ADDRESS WLAN_QUADRATURE_ADDRESS -#define QUADRATURE_OFFSET WLAN_QUADRATURE_OFFSET -#define QUADRATURE_ADC_MSB WLAN_QUADRATURE_ADC_MSB -#define QUADRATURE_ADC_LSB WLAN_QUADRATURE_ADC_LSB -#define QUADRATURE_ADC_MASK WLAN_QUADRATURE_ADC_MASK -#define QUADRATURE_ADC_GET(x) WLAN_QUADRATURE_ADC_GET(x) -#define QUADRATURE_ADC_SET(x) WLAN_QUADRATURE_ADC_SET(x) -#define QUADRATURE_SEL_MSB WLAN_QUADRATURE_SEL_MSB -#define QUADRATURE_SEL_LSB WLAN_QUADRATURE_SEL_LSB -#define QUADRATURE_SEL_MASK WLAN_QUADRATURE_SEL_MASK -#define QUADRATURE_SEL_GET(x) WLAN_QUADRATURE_SEL_GET(x) -#define QUADRATURE_SEL_SET(x) WLAN_QUADRATURE_SEL_SET(x) -#define QUADRATURE_DAC_MSB WLAN_QUADRATURE_DAC_MSB -#define QUADRATURE_DAC_LSB WLAN_QUADRATURE_DAC_LSB -#define QUADRATURE_DAC_MASK WLAN_QUADRATURE_DAC_MASK -#define QUADRATURE_DAC_GET(x) WLAN_QUADRATURE_DAC_GET(x) -#define QUADRATURE_DAC_SET(x) WLAN_QUADRATURE_DAC_SET(x) -#define PLL_CONTROL_ADDRESS WLAN_PLL_CONTROL_ADDRESS -#define PLL_CONTROL_OFFSET WLAN_PLL_CONTROL_OFFSET -#define PLL_CONTROL_DIG_TEST_CLK_MSB WLAN_PLL_CONTROL_DIG_TEST_CLK_MSB -#define PLL_CONTROL_DIG_TEST_CLK_LSB WLAN_PLL_CONTROL_DIG_TEST_CLK_LSB -#define PLL_CONTROL_DIG_TEST_CLK_MASK WLAN_PLL_CONTROL_DIG_TEST_CLK_MASK -#define PLL_CONTROL_DIG_TEST_CLK_GET(x) WLAN_PLL_CONTROL_DIG_TEST_CLK_GET(x) -#define PLL_CONTROL_DIG_TEST_CLK_SET(x) WLAN_PLL_CONTROL_DIG_TEST_CLK_SET(x) -#define PLL_CONTROL_MAC_OVERRIDE_MSB WLAN_PLL_CONTROL_MAC_OVERRIDE_MSB -#define PLL_CONTROL_MAC_OVERRIDE_LSB WLAN_PLL_CONTROL_MAC_OVERRIDE_LSB -#define PLL_CONTROL_MAC_OVERRIDE_MASK WLAN_PLL_CONTROL_MAC_OVERRIDE_MASK -#define PLL_CONTROL_MAC_OVERRIDE_GET(x) WLAN_PLL_CONTROL_MAC_OVERRIDE_GET(x) -#define PLL_CONTROL_MAC_OVERRIDE_SET(x) WLAN_PLL_CONTROL_MAC_OVERRIDE_SET(x) -#define PLL_CONTROL_NOPWD_MSB WLAN_PLL_CONTROL_NOPWD_MSB -#define PLL_CONTROL_NOPWD_LSB WLAN_PLL_CONTROL_NOPWD_LSB -#define PLL_CONTROL_NOPWD_MASK WLAN_PLL_CONTROL_NOPWD_MASK -#define PLL_CONTROL_NOPWD_GET(x) WLAN_PLL_CONTROL_NOPWD_GET(x) -#define PLL_CONTROL_NOPWD_SET(x) WLAN_PLL_CONTROL_NOPWD_SET(x) -#define PLL_CONTROL_UPDATING_MSB WLAN_PLL_CONTROL_UPDATING_MSB -#define PLL_CONTROL_UPDATING_LSB WLAN_PLL_CONTROL_UPDATING_LSB -#define PLL_CONTROL_UPDATING_MASK WLAN_PLL_CONTROL_UPDATING_MASK -#define PLL_CONTROL_UPDATING_GET(x) WLAN_PLL_CONTROL_UPDATING_GET(x) -#define PLL_CONTROL_UPDATING_SET(x) WLAN_PLL_CONTROL_UPDATING_SET(x) -#define PLL_CONTROL_BYPASS_MSB WLAN_PLL_CONTROL_BYPASS_MSB -#define PLL_CONTROL_BYPASS_LSB WLAN_PLL_CONTROL_BYPASS_LSB -#define PLL_CONTROL_BYPASS_MASK WLAN_PLL_CONTROL_BYPASS_MASK -#define PLL_CONTROL_BYPASS_GET(x) WLAN_PLL_CONTROL_BYPASS_GET(x) -#define PLL_CONTROL_BYPASS_SET(x) WLAN_PLL_CONTROL_BYPASS_SET(x) -#define PLL_CONTROL_REFDIV_MSB WLAN_PLL_CONTROL_REFDIV_MSB -#define PLL_CONTROL_REFDIV_LSB WLAN_PLL_CONTROL_REFDIV_LSB -#define PLL_CONTROL_REFDIV_MASK WLAN_PLL_CONTROL_REFDIV_MASK -#define PLL_CONTROL_REFDIV_GET(x) WLAN_PLL_CONTROL_REFDIV_GET(x) -#define PLL_CONTROL_REFDIV_SET(x) WLAN_PLL_CONTROL_REFDIV_SET(x) -#define PLL_CONTROL_DIV_MSB WLAN_PLL_CONTROL_DIV_MSB -#define PLL_CONTROL_DIV_LSB WLAN_PLL_CONTROL_DIV_LSB -#define PLL_CONTROL_DIV_MASK WLAN_PLL_CONTROL_DIV_MASK -#define PLL_CONTROL_DIV_GET(x) WLAN_PLL_CONTROL_DIV_GET(x) -#define PLL_CONTROL_DIV_SET(x) WLAN_PLL_CONTROL_DIV_SET(x) -#define PLL_SETTLE_ADDRESS WLAN_PLL_SETTLE_ADDRESS -#define PLL_SETTLE_OFFSET WLAN_PLL_SETTLE_OFFSET -#define PLL_SETTLE_TIME_MSB WLAN_PLL_SETTLE_TIME_MSB -#define PLL_SETTLE_TIME_LSB WLAN_PLL_SETTLE_TIME_LSB -#define PLL_SETTLE_TIME_MASK WLAN_PLL_SETTLE_TIME_MASK -#define PLL_SETTLE_TIME_GET(x) WLAN_PLL_SETTLE_TIME_GET(x) -#define PLL_SETTLE_TIME_SET(x) WLAN_PLL_SETTLE_TIME_SET(x) -#define XTAL_SETTLE_ADDRESS WLAN_XTAL_SETTLE_ADDRESS -#define XTAL_SETTLE_OFFSET WLAN_XTAL_SETTLE_OFFSET -#define XTAL_SETTLE_TIME_MSB WLAN_XTAL_SETTLE_TIME_MSB -#define XTAL_SETTLE_TIME_LSB WLAN_XTAL_SETTLE_TIME_LSB -#define XTAL_SETTLE_TIME_MASK WLAN_XTAL_SETTLE_TIME_MASK -#define XTAL_SETTLE_TIME_GET(x) WLAN_XTAL_SETTLE_TIME_GET(x) -#define XTAL_SETTLE_TIME_SET(x) WLAN_XTAL_SETTLE_TIME_SET(x) -#define CPU_CLOCK_ADDRESS WLAN_CPU_CLOCK_ADDRESS -#define CPU_CLOCK_OFFSET WLAN_CPU_CLOCK_OFFSET -#define CPU_CLOCK_STANDARD_MSB WLAN_CPU_CLOCK_STANDARD_MSB -#define CPU_CLOCK_STANDARD_LSB WLAN_CPU_CLOCK_STANDARD_LSB -#define CPU_CLOCK_STANDARD_MASK WLAN_CPU_CLOCK_STANDARD_MASK -#define CPU_CLOCK_STANDARD_GET(x) WLAN_CPU_CLOCK_STANDARD_GET(x) -#define CPU_CLOCK_STANDARD_SET(x) WLAN_CPU_CLOCK_STANDARD_SET(x) -#define CLOCK_OUT_ADDRESS WLAN_CLOCK_OUT_ADDRESS -#define CLOCK_OUT_OFFSET WLAN_CLOCK_OUT_OFFSET -#define CLOCK_OUT_SELECT_MSB WLAN_CLOCK_OUT_SELECT_MSB -#define CLOCK_OUT_SELECT_LSB WLAN_CLOCK_OUT_SELECT_LSB -#define CLOCK_OUT_SELECT_MASK WLAN_CLOCK_OUT_SELECT_MASK -#define CLOCK_OUT_SELECT_GET(x) WLAN_CLOCK_OUT_SELECT_GET(x) -#define CLOCK_OUT_SELECT_SET(x) WLAN_CLOCK_OUT_SELECT_SET(x) -#define CLOCK_CONTROL_ADDRESS WLAN_CLOCK_CONTROL_ADDRESS -#define CLOCK_CONTROL_OFFSET WLAN_CLOCK_CONTROL_OFFSET -#define CLOCK_CONTROL_LF_CLK32_MSB WLAN_CLOCK_CONTROL_LF_CLK32_MSB -#define CLOCK_CONTROL_LF_CLK32_LSB WLAN_CLOCK_CONTROL_LF_CLK32_LSB -#define CLOCK_CONTROL_LF_CLK32_MASK WLAN_CLOCK_CONTROL_LF_CLK32_MASK -#define CLOCK_CONTROL_LF_CLK32_GET(x) WLAN_CLOCK_CONTROL_LF_CLK32_GET(x) -#define CLOCK_CONTROL_LF_CLK32_SET(x) WLAN_CLOCK_CONTROL_LF_CLK32_SET(x) -#define CLOCK_CONTROL_SI0_CLK_MSB WLAN_CLOCK_CONTROL_SI0_CLK_MSB -#define CLOCK_CONTROL_SI0_CLK_LSB WLAN_CLOCK_CONTROL_SI0_CLK_LSB -#define CLOCK_CONTROL_SI0_CLK_MASK WLAN_CLOCK_CONTROL_SI0_CLK_MASK -#define CLOCK_CONTROL_SI0_CLK_GET(x) WLAN_CLOCK_CONTROL_SI0_CLK_GET(x) -#define CLOCK_CONTROL_SI0_CLK_SET(x) WLAN_CLOCK_CONTROL_SI0_CLK_SET(x) -#define BIAS_OVERRIDE_ADDRESS WLAN_BIAS_OVERRIDE_ADDRESS -#define BIAS_OVERRIDE_OFFSET WLAN_BIAS_OVERRIDE_OFFSET -#define BIAS_OVERRIDE_ON_MSB WLAN_BIAS_OVERRIDE_ON_MSB -#define BIAS_OVERRIDE_ON_LSB WLAN_BIAS_OVERRIDE_ON_LSB -#define BIAS_OVERRIDE_ON_MASK WLAN_BIAS_OVERRIDE_ON_MASK -#define BIAS_OVERRIDE_ON_GET(x) WLAN_BIAS_OVERRIDE_ON_GET(x) -#define BIAS_OVERRIDE_ON_SET(x) WLAN_BIAS_OVERRIDE_ON_SET(x) -#define WDT_CONTROL_ADDRESS WLAN_WDT_CONTROL_ADDRESS -#define WDT_CONTROL_OFFSET WLAN_WDT_CONTROL_OFFSET -#define WDT_CONTROL_ACTION_MSB WLAN_WDT_CONTROL_ACTION_MSB -#define WDT_CONTROL_ACTION_LSB WLAN_WDT_CONTROL_ACTION_LSB -#define WDT_CONTROL_ACTION_MASK WLAN_WDT_CONTROL_ACTION_MASK -#define WDT_CONTROL_ACTION_GET(x) WLAN_WDT_CONTROL_ACTION_GET(x) -#define WDT_CONTROL_ACTION_SET(x) WLAN_WDT_CONTROL_ACTION_SET(x) -#define WDT_STATUS_ADDRESS WLAN_WDT_STATUS_ADDRESS -#define WDT_STATUS_OFFSET WLAN_WDT_STATUS_OFFSET -#define WDT_STATUS_INTERRUPT_MSB WLAN_WDT_STATUS_INTERRUPT_MSB -#define WDT_STATUS_INTERRUPT_LSB WLAN_WDT_STATUS_INTERRUPT_LSB -#define WDT_STATUS_INTERRUPT_MASK WLAN_WDT_STATUS_INTERRUPT_MASK -#define WDT_STATUS_INTERRUPT_GET(x) WLAN_WDT_STATUS_INTERRUPT_GET(x) -#define WDT_STATUS_INTERRUPT_SET(x) WLAN_WDT_STATUS_INTERRUPT_SET(x) -#define WDT_ADDRESS WLAN_WDT_ADDRESS -#define WDT_OFFSET WLAN_WDT_OFFSET -#define WDT_TARGET_MSB WLAN_WDT_TARGET_MSB -#define WDT_TARGET_LSB WLAN_WDT_TARGET_LSB -#define WDT_TARGET_MASK WLAN_WDT_TARGET_MASK -#define WDT_TARGET_GET(x) WLAN_WDT_TARGET_GET(x) -#define WDT_TARGET_SET(x) WLAN_WDT_TARGET_SET(x) -#define WDT_COUNT_ADDRESS WLAN_WDT_COUNT_ADDRESS -#define WDT_COUNT_OFFSET WLAN_WDT_COUNT_OFFSET -#define WDT_COUNT_VALUE_MSB WLAN_WDT_COUNT_VALUE_MSB -#define WDT_COUNT_VALUE_LSB WLAN_WDT_COUNT_VALUE_LSB -#define WDT_COUNT_VALUE_MASK WLAN_WDT_COUNT_VALUE_MASK -#define WDT_COUNT_VALUE_GET(x) WLAN_WDT_COUNT_VALUE_GET(x) -#define WDT_COUNT_VALUE_SET(x) WLAN_WDT_COUNT_VALUE_SET(x) -#define WDT_RESET_ADDRESS WLAN_WDT_RESET_ADDRESS -#define WDT_RESET_OFFSET WLAN_WDT_RESET_OFFSET -#define WDT_RESET_VALUE_MSB WLAN_WDT_RESET_VALUE_MSB -#define WDT_RESET_VALUE_LSB WLAN_WDT_RESET_VALUE_LSB -#define WDT_RESET_VALUE_MASK WLAN_WDT_RESET_VALUE_MASK -#define WDT_RESET_VALUE_GET(x) WLAN_WDT_RESET_VALUE_GET(x) -#define WDT_RESET_VALUE_SET(x) WLAN_WDT_RESET_VALUE_SET(x) -#define INT_STATUS_ADDRESS WLAN_INT_STATUS_ADDRESS -#define INT_STATUS_OFFSET WLAN_INT_STATUS_OFFSET -#define INT_STATUS_HCI_UART_MSB WLAN_INT_STATUS_HCI_UART_MSB -#define INT_STATUS_HCI_UART_LSB WLAN_INT_STATUS_HCI_UART_LSB -#define INT_STATUS_HCI_UART_MASK WLAN_INT_STATUS_HCI_UART_MASK -#define INT_STATUS_HCI_UART_GET(x) WLAN_INT_STATUS_HCI_UART_GET(x) -#define INT_STATUS_HCI_UART_SET(x) WLAN_INT_STATUS_HCI_UART_SET(x) -#define INT_STATUS_THERM_MSB WLAN_INT_STATUS_THERM_MSB -#define INT_STATUS_THERM_LSB WLAN_INT_STATUS_THERM_LSB -#define INT_STATUS_THERM_MASK WLAN_INT_STATUS_THERM_MASK -#define INT_STATUS_THERM_GET(x) WLAN_INT_STATUS_THERM_GET(x) -#define INT_STATUS_THERM_SET(x) WLAN_INT_STATUS_THERM_SET(x) -#define INT_STATUS_EFUSE_OVERWRITE_MSB WLAN_INT_STATUS_EFUSE_OVERWRITE_MSB -#define INT_STATUS_EFUSE_OVERWRITE_LSB WLAN_INT_STATUS_EFUSE_OVERWRITE_LSB -#define INT_STATUS_EFUSE_OVERWRITE_MASK WLAN_INT_STATUS_EFUSE_OVERWRITE_MASK -#define INT_STATUS_EFUSE_OVERWRITE_GET(x) WLAN_INT_STATUS_EFUSE_OVERWRITE_GET(x) -#define INT_STATUS_EFUSE_OVERWRITE_SET(x) WLAN_INT_STATUS_EFUSE_OVERWRITE_SET(x) -#define INT_STATUS_UART_MBOX_MSB WLAN_INT_STATUS_UART_MBOX_MSB -#define INT_STATUS_UART_MBOX_LSB WLAN_INT_STATUS_UART_MBOX_LSB -#define INT_STATUS_UART_MBOX_MASK WLAN_INT_STATUS_UART_MBOX_MASK -#define INT_STATUS_UART_MBOX_GET(x) WLAN_INT_STATUS_UART_MBOX_GET(x) -#define INT_STATUS_UART_MBOX_SET(x) WLAN_INT_STATUS_UART_MBOX_SET(x) -#define INT_STATUS_GENERIC_MBOX_MSB WLAN_INT_STATUS_GENERIC_MBOX_MSB -#define INT_STATUS_GENERIC_MBOX_LSB WLAN_INT_STATUS_GENERIC_MBOX_LSB -#define INT_STATUS_GENERIC_MBOX_MASK WLAN_INT_STATUS_GENERIC_MBOX_MASK -#define INT_STATUS_GENERIC_MBOX_GET(x) WLAN_INT_STATUS_GENERIC_MBOX_GET(x) -#define INT_STATUS_GENERIC_MBOX_SET(x) WLAN_INT_STATUS_GENERIC_MBOX_SET(x) -#define INT_STATUS_RDMA_MSB WLAN_INT_STATUS_RDMA_MSB -#define INT_STATUS_RDMA_LSB WLAN_INT_STATUS_RDMA_LSB -#define INT_STATUS_RDMA_MASK WLAN_INT_STATUS_RDMA_MASK -#define INT_STATUS_RDMA_GET(x) WLAN_INT_STATUS_RDMA_GET(x) -#define INT_STATUS_RDMA_SET(x) WLAN_INT_STATUS_RDMA_SET(x) -#define INT_STATUS_BTCOEX_MSB WLAN_INT_STATUS_BTCOEX_MSB -#define INT_STATUS_BTCOEX_LSB WLAN_INT_STATUS_BTCOEX_LSB -#define INT_STATUS_BTCOEX_MASK WLAN_INT_STATUS_BTCOEX_MASK -#define INT_STATUS_BTCOEX_GET(x) WLAN_INT_STATUS_BTCOEX_GET(x) -#define INT_STATUS_BTCOEX_SET(x) WLAN_INT_STATUS_BTCOEX_SET(x) -#define INT_STATUS_RTC_POWER_MSB WLAN_INT_STATUS_RTC_POWER_MSB -#define INT_STATUS_RTC_POWER_LSB WLAN_INT_STATUS_RTC_POWER_LSB -#define INT_STATUS_RTC_POWER_MASK WLAN_INT_STATUS_RTC_POWER_MASK -#define INT_STATUS_RTC_POWER_GET(x) WLAN_INT_STATUS_RTC_POWER_GET(x) -#define INT_STATUS_RTC_POWER_SET(x) WLAN_INT_STATUS_RTC_POWER_SET(x) -#define INT_STATUS_MAC_MSB WLAN_INT_STATUS_MAC_MSB -#define INT_STATUS_MAC_LSB WLAN_INT_STATUS_MAC_LSB -#define INT_STATUS_MAC_MASK WLAN_INT_STATUS_MAC_MASK -#define INT_STATUS_MAC_GET(x) WLAN_INT_STATUS_MAC_GET(x) -#define INT_STATUS_MAC_SET(x) WLAN_INT_STATUS_MAC_SET(x) -#define INT_STATUS_MAILBOX_MSB WLAN_INT_STATUS_MAILBOX_MSB -#define INT_STATUS_MAILBOX_LSB WLAN_INT_STATUS_MAILBOX_LSB -#define INT_STATUS_MAILBOX_MASK WLAN_INT_STATUS_MAILBOX_MASK -#define INT_STATUS_MAILBOX_GET(x) WLAN_INT_STATUS_MAILBOX_GET(x) -#define INT_STATUS_MAILBOX_SET(x) WLAN_INT_STATUS_MAILBOX_SET(x) -#define INT_STATUS_RTC_ALARM_MSB WLAN_INT_STATUS_RTC_ALARM_MSB -#define INT_STATUS_RTC_ALARM_LSB WLAN_INT_STATUS_RTC_ALARM_LSB -#define INT_STATUS_RTC_ALARM_MASK WLAN_INT_STATUS_RTC_ALARM_MASK -#define INT_STATUS_RTC_ALARM_GET(x) WLAN_INT_STATUS_RTC_ALARM_GET(x) -#define INT_STATUS_RTC_ALARM_SET(x) WLAN_INT_STATUS_RTC_ALARM_SET(x) -#define INT_STATUS_HF_TIMER_MSB WLAN_INT_STATUS_HF_TIMER_MSB -#define INT_STATUS_HF_TIMER_LSB WLAN_INT_STATUS_HF_TIMER_LSB -#define INT_STATUS_HF_TIMER_MASK WLAN_INT_STATUS_HF_TIMER_MASK -#define INT_STATUS_HF_TIMER_GET(x) WLAN_INT_STATUS_HF_TIMER_GET(x) -#define INT_STATUS_HF_TIMER_SET(x) WLAN_INT_STATUS_HF_TIMER_SET(x) -#define INT_STATUS_LF_TIMER3_MSB WLAN_INT_STATUS_LF_TIMER3_MSB -#define INT_STATUS_LF_TIMER3_LSB WLAN_INT_STATUS_LF_TIMER3_LSB -#define INT_STATUS_LF_TIMER3_MASK WLAN_INT_STATUS_LF_TIMER3_MASK -#define INT_STATUS_LF_TIMER3_GET(x) WLAN_INT_STATUS_LF_TIMER3_GET(x) -#define INT_STATUS_LF_TIMER3_SET(x) WLAN_INT_STATUS_LF_TIMER3_SET(x) -#define INT_STATUS_LF_TIMER2_MSB WLAN_INT_STATUS_LF_TIMER2_MSB -#define INT_STATUS_LF_TIMER2_LSB WLAN_INT_STATUS_LF_TIMER2_LSB -#define INT_STATUS_LF_TIMER2_MASK WLAN_INT_STATUS_LF_TIMER2_MASK -#define INT_STATUS_LF_TIMER2_GET(x) WLAN_INT_STATUS_LF_TIMER2_GET(x) -#define INT_STATUS_LF_TIMER2_SET(x) WLAN_INT_STATUS_LF_TIMER2_SET(x) -#define INT_STATUS_LF_TIMER1_MSB WLAN_INT_STATUS_LF_TIMER1_MSB -#define INT_STATUS_LF_TIMER1_LSB WLAN_INT_STATUS_LF_TIMER1_LSB -#define INT_STATUS_LF_TIMER1_MASK WLAN_INT_STATUS_LF_TIMER1_MASK -#define INT_STATUS_LF_TIMER1_GET(x) WLAN_INT_STATUS_LF_TIMER1_GET(x) -#define INT_STATUS_LF_TIMER1_SET(x) WLAN_INT_STATUS_LF_TIMER1_SET(x) -#define INT_STATUS_LF_TIMER0_MSB WLAN_INT_STATUS_LF_TIMER0_MSB -#define INT_STATUS_LF_TIMER0_LSB WLAN_INT_STATUS_LF_TIMER0_LSB -#define INT_STATUS_LF_TIMER0_MASK WLAN_INT_STATUS_LF_TIMER0_MASK -#define INT_STATUS_LF_TIMER0_GET(x) WLAN_INT_STATUS_LF_TIMER0_GET(x) -#define INT_STATUS_LF_TIMER0_SET(x) WLAN_INT_STATUS_LF_TIMER0_SET(x) -#define INT_STATUS_KEYPAD_MSB WLAN_INT_STATUS_KEYPAD_MSB -#define INT_STATUS_KEYPAD_LSB WLAN_INT_STATUS_KEYPAD_LSB -#define INT_STATUS_KEYPAD_MASK WLAN_INT_STATUS_KEYPAD_MASK -#define INT_STATUS_KEYPAD_GET(x) WLAN_INT_STATUS_KEYPAD_GET(x) -#define INT_STATUS_KEYPAD_SET(x) WLAN_INT_STATUS_KEYPAD_SET(x) -#define INT_STATUS_SI_MSB WLAN_INT_STATUS_SI_MSB -#define INT_STATUS_SI_LSB WLAN_INT_STATUS_SI_LSB -#define INT_STATUS_SI_MASK WLAN_INT_STATUS_SI_MASK -#define INT_STATUS_SI_GET(x) WLAN_INT_STATUS_SI_GET(x) -#define INT_STATUS_SI_SET(x) WLAN_INT_STATUS_SI_SET(x) -#define INT_STATUS_GPIO_MSB WLAN_INT_STATUS_GPIO_MSB -#define INT_STATUS_GPIO_LSB WLAN_INT_STATUS_GPIO_LSB -#define INT_STATUS_GPIO_MASK WLAN_INT_STATUS_GPIO_MASK -#define INT_STATUS_GPIO_GET(x) WLAN_INT_STATUS_GPIO_GET(x) -#define INT_STATUS_GPIO_SET(x) WLAN_INT_STATUS_GPIO_SET(x) -#define INT_STATUS_UART_MSB WLAN_INT_STATUS_UART_MSB -#define INT_STATUS_UART_LSB WLAN_INT_STATUS_UART_LSB -#define INT_STATUS_UART_MASK WLAN_INT_STATUS_UART_MASK -#define INT_STATUS_UART_GET(x) WLAN_INT_STATUS_UART_GET(x) -#define INT_STATUS_UART_SET(x) WLAN_INT_STATUS_UART_SET(x) -#define INT_STATUS_ERROR_MSB WLAN_INT_STATUS_ERROR_MSB -#define INT_STATUS_ERROR_LSB WLAN_INT_STATUS_ERROR_LSB -#define INT_STATUS_ERROR_MASK WLAN_INT_STATUS_ERROR_MASK -#define INT_STATUS_ERROR_GET(x) WLAN_INT_STATUS_ERROR_GET(x) -#define INT_STATUS_ERROR_SET(x) WLAN_INT_STATUS_ERROR_SET(x) -#define INT_STATUS_WDT_INT_MSB WLAN_INT_STATUS_WDT_INT_MSB -#define INT_STATUS_WDT_INT_LSB WLAN_INT_STATUS_WDT_INT_LSB -#define INT_STATUS_WDT_INT_MASK WLAN_INT_STATUS_WDT_INT_MASK -#define INT_STATUS_WDT_INT_GET(x) WLAN_INT_STATUS_WDT_INT_GET(x) -#define INT_STATUS_WDT_INT_SET(x) WLAN_INT_STATUS_WDT_INT_SET(x) -#define LF_TIMER0_ADDRESS WLAN_LF_TIMER0_ADDRESS -#define LF_TIMER0_OFFSET WLAN_LF_TIMER0_OFFSET -#define LF_TIMER0_TARGET_MSB WLAN_LF_TIMER0_TARGET_MSB -#define LF_TIMER0_TARGET_LSB WLAN_LF_TIMER0_TARGET_LSB -#define LF_TIMER0_TARGET_MASK WLAN_LF_TIMER0_TARGET_MASK -#define LF_TIMER0_TARGET_GET(x) WLAN_LF_TIMER0_TARGET_GET(x) -#define LF_TIMER0_TARGET_SET(x) WLAN_LF_TIMER0_TARGET_SET(x) -#define LF_TIMER_COUNT0_ADDRESS WLAN_LF_TIMER_COUNT0_ADDRESS -#define LF_TIMER_COUNT0_OFFSET WLAN_LF_TIMER_COUNT0_OFFSET -#define LF_TIMER_COUNT0_VALUE_MSB WLAN_LF_TIMER_COUNT0_VALUE_MSB -#define LF_TIMER_COUNT0_VALUE_LSB WLAN_LF_TIMER_COUNT0_VALUE_LSB -#define LF_TIMER_COUNT0_VALUE_MASK WLAN_LF_TIMER_COUNT0_VALUE_MASK -#define LF_TIMER_COUNT0_VALUE_GET(x) WLAN_LF_TIMER_COUNT0_VALUE_GET(x) -#define LF_TIMER_COUNT0_VALUE_SET(x) WLAN_LF_TIMER_COUNT0_VALUE_SET(x) -#define LF_TIMER_CONTROL0_ADDRESS WLAN_LF_TIMER_CONTROL0_ADDRESS -#define LF_TIMER_CONTROL0_OFFSET WLAN_LF_TIMER_CONTROL0_OFFSET -#define LF_TIMER_CONTROL0_ENABLE_MSB WLAN_LF_TIMER_CONTROL0_ENABLE_MSB -#define LF_TIMER_CONTROL0_ENABLE_LSB WLAN_LF_TIMER_CONTROL0_ENABLE_LSB -#define LF_TIMER_CONTROL0_ENABLE_MASK WLAN_LF_TIMER_CONTROL0_ENABLE_MASK -#define LF_TIMER_CONTROL0_ENABLE_GET(x) WLAN_LF_TIMER_CONTROL0_ENABLE_GET(x) -#define LF_TIMER_CONTROL0_ENABLE_SET(x) WLAN_LF_TIMER_CONTROL0_ENABLE_SET(x) -#define LF_TIMER_CONTROL0_AUTO_RESTART_MSB WLAN_LF_TIMER_CONTROL0_AUTO_RESTART_MSB -#define LF_TIMER_CONTROL0_AUTO_RESTART_LSB WLAN_LF_TIMER_CONTROL0_AUTO_RESTART_LSB -#define LF_TIMER_CONTROL0_AUTO_RESTART_MASK WLAN_LF_TIMER_CONTROL0_AUTO_RESTART_MASK -#define LF_TIMER_CONTROL0_AUTO_RESTART_GET(x) WLAN_LF_TIMER_CONTROL0_AUTO_RESTART_GET(x) -#define LF_TIMER_CONTROL0_AUTO_RESTART_SET(x) WLAN_LF_TIMER_CONTROL0_AUTO_RESTART_SET(x) -#define LF_TIMER_CONTROL0_RESET_MSB WLAN_LF_TIMER_CONTROL0_RESET_MSB -#define LF_TIMER_CONTROL0_RESET_LSB WLAN_LF_TIMER_CONTROL0_RESET_LSB -#define LF_TIMER_CONTROL0_RESET_MASK WLAN_LF_TIMER_CONTROL0_RESET_MASK -#define LF_TIMER_CONTROL0_RESET_GET(x) WLAN_LF_TIMER_CONTROL0_RESET_GET(x) -#define LF_TIMER_CONTROL0_RESET_SET(x) WLAN_LF_TIMER_CONTROL0_RESET_SET(x) -#define LF_TIMER_STATUS0_ADDRESS WLAN_LF_TIMER_STATUS0_ADDRESS -#define LF_TIMER_STATUS0_OFFSET WLAN_LF_TIMER_STATUS0_OFFSET -#define LF_TIMER_STATUS0_INTERRUPT_MSB WLAN_LF_TIMER_STATUS0_INTERRUPT_MSB -#define LF_TIMER_STATUS0_INTERRUPT_LSB WLAN_LF_TIMER_STATUS0_INTERRUPT_LSB -#define LF_TIMER_STATUS0_INTERRUPT_MASK WLAN_LF_TIMER_STATUS0_INTERRUPT_MASK -#define LF_TIMER_STATUS0_INTERRUPT_GET(x) WLAN_LF_TIMER_STATUS0_INTERRUPT_GET(x) -#define LF_TIMER_STATUS0_INTERRUPT_SET(x) WLAN_LF_TIMER_STATUS0_INTERRUPT_SET(x) -#define LF_TIMER1_ADDRESS WLAN_LF_TIMER1_ADDRESS -#define LF_TIMER1_OFFSET WLAN_LF_TIMER1_OFFSET -#define LF_TIMER1_TARGET_MSB WLAN_LF_TIMER1_TARGET_MSB -#define LF_TIMER1_TARGET_LSB WLAN_LF_TIMER1_TARGET_LSB -#define LF_TIMER1_TARGET_MASK WLAN_LF_TIMER1_TARGET_MASK -#define LF_TIMER1_TARGET_GET(x) WLAN_LF_TIMER1_TARGET_GET(x) -#define LF_TIMER1_TARGET_SET(x) WLAN_LF_TIMER1_TARGET_SET(x) -#define LF_TIMER_COUNT1_ADDRESS WLAN_LF_TIMER_COUNT1_ADDRESS -#define LF_TIMER_COUNT1_OFFSET WLAN_LF_TIMER_COUNT1_OFFSET -#define LF_TIMER_COUNT1_VALUE_MSB WLAN_LF_TIMER_COUNT1_VALUE_MSB -#define LF_TIMER_COUNT1_VALUE_LSB WLAN_LF_TIMER_COUNT1_VALUE_LSB -#define LF_TIMER_COUNT1_VALUE_MASK WLAN_LF_TIMER_COUNT1_VALUE_MASK -#define LF_TIMER_COUNT1_VALUE_GET(x) WLAN_LF_TIMER_COUNT1_VALUE_GET(x) -#define LF_TIMER_COUNT1_VALUE_SET(x) WLAN_LF_TIMER_COUNT1_VALUE_SET(x) -#define LF_TIMER_CONTROL1_ADDRESS WLAN_LF_TIMER_CONTROL1_ADDRESS -#define LF_TIMER_CONTROL1_OFFSET WLAN_LF_TIMER_CONTROL1_OFFSET -#define LF_TIMER_CONTROL1_ENABLE_MSB WLAN_LF_TIMER_CONTROL1_ENABLE_MSB -#define LF_TIMER_CONTROL1_ENABLE_LSB WLAN_LF_TIMER_CONTROL1_ENABLE_LSB -#define LF_TIMER_CONTROL1_ENABLE_MASK WLAN_LF_TIMER_CONTROL1_ENABLE_MASK -#define LF_TIMER_CONTROL1_ENABLE_GET(x) WLAN_LF_TIMER_CONTROL1_ENABLE_GET(x) -#define LF_TIMER_CONTROL1_ENABLE_SET(x) WLAN_LF_TIMER_CONTROL1_ENABLE_SET(x) -#define LF_TIMER_CONTROL1_AUTO_RESTART_MSB WLAN_LF_TIMER_CONTROL1_AUTO_RESTART_MSB -#define LF_TIMER_CONTROL1_AUTO_RESTART_LSB WLAN_LF_TIMER_CONTROL1_AUTO_RESTART_LSB -#define LF_TIMER_CONTROL1_AUTO_RESTART_MASK WLAN_LF_TIMER_CONTROL1_AUTO_RESTART_MASK -#define LF_TIMER_CONTROL1_AUTO_RESTART_GET(x) WLAN_LF_TIMER_CONTROL1_AUTO_RESTART_GET(x) -#define LF_TIMER_CONTROL1_AUTO_RESTART_SET(x) WLAN_LF_TIMER_CONTROL1_AUTO_RESTART_SET(x) -#define LF_TIMER_CONTROL1_RESET_MSB WLAN_LF_TIMER_CONTROL1_RESET_MSB -#define LF_TIMER_CONTROL1_RESET_LSB WLAN_LF_TIMER_CONTROL1_RESET_LSB -#define LF_TIMER_CONTROL1_RESET_MASK WLAN_LF_TIMER_CONTROL1_RESET_MASK -#define LF_TIMER_CONTROL1_RESET_GET(x) WLAN_LF_TIMER_CONTROL1_RESET_GET(x) -#define LF_TIMER_CONTROL1_RESET_SET(x) WLAN_LF_TIMER_CONTROL1_RESET_SET(x) -#define LF_TIMER_STATUS1_ADDRESS WLAN_LF_TIMER_STATUS1_ADDRESS -#define LF_TIMER_STATUS1_OFFSET WLAN_LF_TIMER_STATUS1_OFFSET -#define LF_TIMER_STATUS1_INTERRUPT_MSB WLAN_LF_TIMER_STATUS1_INTERRUPT_MSB -#define LF_TIMER_STATUS1_INTERRUPT_LSB WLAN_LF_TIMER_STATUS1_INTERRUPT_LSB -#define LF_TIMER_STATUS1_INTERRUPT_MASK WLAN_LF_TIMER_STATUS1_INTERRUPT_MASK -#define LF_TIMER_STATUS1_INTERRUPT_GET(x) WLAN_LF_TIMER_STATUS1_INTERRUPT_GET(x) -#define LF_TIMER_STATUS1_INTERRUPT_SET(x) WLAN_LF_TIMER_STATUS1_INTERRUPT_SET(x) -#define LF_TIMER2_ADDRESS WLAN_LF_TIMER2_ADDRESS -#define LF_TIMER2_OFFSET WLAN_LF_TIMER2_OFFSET -#define LF_TIMER2_TARGET_MSB WLAN_LF_TIMER2_TARGET_MSB -#define LF_TIMER2_TARGET_LSB WLAN_LF_TIMER2_TARGET_LSB -#define LF_TIMER2_TARGET_MASK WLAN_LF_TIMER2_TARGET_MASK -#define LF_TIMER2_TARGET_GET(x) WLAN_LF_TIMER2_TARGET_GET(x) -#define LF_TIMER2_TARGET_SET(x) WLAN_LF_TIMER2_TARGET_SET(x) -#define LF_TIMER_COUNT2_ADDRESS WLAN_LF_TIMER_COUNT2_ADDRESS -#define LF_TIMER_COUNT2_OFFSET WLAN_LF_TIMER_COUNT2_OFFSET -#define LF_TIMER_COUNT2_VALUE_MSB WLAN_LF_TIMER_COUNT2_VALUE_MSB -#define LF_TIMER_COUNT2_VALUE_LSB WLAN_LF_TIMER_COUNT2_VALUE_LSB -#define LF_TIMER_COUNT2_VALUE_MASK WLAN_LF_TIMER_COUNT2_VALUE_MASK -#define LF_TIMER_COUNT2_VALUE_GET(x) WLAN_LF_TIMER_COUNT2_VALUE_GET(x) -#define LF_TIMER_COUNT2_VALUE_SET(x) WLAN_LF_TIMER_COUNT2_VALUE_SET(x) -#define LF_TIMER_CONTROL2_ADDRESS WLAN_LF_TIMER_CONTROL2_ADDRESS -#define LF_TIMER_CONTROL2_OFFSET WLAN_LF_TIMER_CONTROL2_OFFSET -#define LF_TIMER_CONTROL2_ENABLE_MSB WLAN_LF_TIMER_CONTROL2_ENABLE_MSB -#define LF_TIMER_CONTROL2_ENABLE_LSB WLAN_LF_TIMER_CONTROL2_ENABLE_LSB -#define LF_TIMER_CONTROL2_ENABLE_MASK WLAN_LF_TIMER_CONTROL2_ENABLE_MASK -#define LF_TIMER_CONTROL2_ENABLE_GET(x) WLAN_LF_TIMER_CONTROL2_ENABLE_GET(x) -#define LF_TIMER_CONTROL2_ENABLE_SET(x) WLAN_LF_TIMER_CONTROL2_ENABLE_SET(x) -#define LF_TIMER_CONTROL2_AUTO_RESTART_MSB WLAN_LF_TIMER_CONTROL2_AUTO_RESTART_MSB -#define LF_TIMER_CONTROL2_AUTO_RESTART_LSB WLAN_LF_TIMER_CONTROL2_AUTO_RESTART_LSB -#define LF_TIMER_CONTROL2_AUTO_RESTART_MASK WLAN_LF_TIMER_CONTROL2_AUTO_RESTART_MASK -#define LF_TIMER_CONTROL2_AUTO_RESTART_GET(x) WLAN_LF_TIMER_CONTROL2_AUTO_RESTART_GET(x) -#define LF_TIMER_CONTROL2_AUTO_RESTART_SET(x) WLAN_LF_TIMER_CONTROL2_AUTO_RESTART_SET(x) -#define LF_TIMER_CONTROL2_RESET_MSB WLAN_LF_TIMER_CONTROL2_RESET_MSB -#define LF_TIMER_CONTROL2_RESET_LSB WLAN_LF_TIMER_CONTROL2_RESET_LSB -#define LF_TIMER_CONTROL2_RESET_MASK WLAN_LF_TIMER_CONTROL2_RESET_MASK -#define LF_TIMER_CONTROL2_RESET_GET(x) WLAN_LF_TIMER_CONTROL2_RESET_GET(x) -#define LF_TIMER_CONTROL2_RESET_SET(x) WLAN_LF_TIMER_CONTROL2_RESET_SET(x) -#define LF_TIMER_STATUS2_ADDRESS WLAN_LF_TIMER_STATUS2_ADDRESS -#define LF_TIMER_STATUS2_OFFSET WLAN_LF_TIMER_STATUS2_OFFSET -#define LF_TIMER_STATUS2_INTERRUPT_MSB WLAN_LF_TIMER_STATUS2_INTERRUPT_MSB -#define LF_TIMER_STATUS2_INTERRUPT_LSB WLAN_LF_TIMER_STATUS2_INTERRUPT_LSB -#define LF_TIMER_STATUS2_INTERRUPT_MASK WLAN_LF_TIMER_STATUS2_INTERRUPT_MASK -#define LF_TIMER_STATUS2_INTERRUPT_GET(x) WLAN_LF_TIMER_STATUS2_INTERRUPT_GET(x) -#define LF_TIMER_STATUS2_INTERRUPT_SET(x) WLAN_LF_TIMER_STATUS2_INTERRUPT_SET(x) -#define LF_TIMER3_ADDRESS WLAN_LF_TIMER3_ADDRESS -#define LF_TIMER3_OFFSET WLAN_LF_TIMER3_OFFSET -#define LF_TIMER3_TARGET_MSB WLAN_LF_TIMER3_TARGET_MSB -#define LF_TIMER3_TARGET_LSB WLAN_LF_TIMER3_TARGET_LSB -#define LF_TIMER3_TARGET_MASK WLAN_LF_TIMER3_TARGET_MASK -#define LF_TIMER3_TARGET_GET(x) WLAN_LF_TIMER3_TARGET_GET(x) -#define LF_TIMER3_TARGET_SET(x) WLAN_LF_TIMER3_TARGET_SET(x) -#define LF_TIMER_COUNT3_ADDRESS WLAN_LF_TIMER_COUNT3_ADDRESS -#define LF_TIMER_COUNT3_OFFSET WLAN_LF_TIMER_COUNT3_OFFSET -#define LF_TIMER_COUNT3_VALUE_MSB WLAN_LF_TIMER_COUNT3_VALUE_MSB -#define LF_TIMER_COUNT3_VALUE_LSB WLAN_LF_TIMER_COUNT3_VALUE_LSB -#define LF_TIMER_COUNT3_VALUE_MASK WLAN_LF_TIMER_COUNT3_VALUE_MASK -#define LF_TIMER_COUNT3_VALUE_GET(x) WLAN_LF_TIMER_COUNT3_VALUE_GET(x) -#define LF_TIMER_COUNT3_VALUE_SET(x) WLAN_LF_TIMER_COUNT3_VALUE_SET(x) -#define LF_TIMER_CONTROL3_ADDRESS WLAN_LF_TIMER_CONTROL3_ADDRESS -#define LF_TIMER_CONTROL3_OFFSET WLAN_LF_TIMER_CONTROL3_OFFSET -#define LF_TIMER_CONTROL3_ENABLE_MSB WLAN_LF_TIMER_CONTROL3_ENABLE_MSB -#define LF_TIMER_CONTROL3_ENABLE_LSB WLAN_LF_TIMER_CONTROL3_ENABLE_LSB -#define LF_TIMER_CONTROL3_ENABLE_MASK WLAN_LF_TIMER_CONTROL3_ENABLE_MASK -#define LF_TIMER_CONTROL3_ENABLE_GET(x) WLAN_LF_TIMER_CONTROL3_ENABLE_GET(x) -#define LF_TIMER_CONTROL3_ENABLE_SET(x) WLAN_LF_TIMER_CONTROL3_ENABLE_SET(x) -#define LF_TIMER_CONTROL3_AUTO_RESTART_MSB WLAN_LF_TIMER_CONTROL3_AUTO_RESTART_MSB -#define LF_TIMER_CONTROL3_AUTO_RESTART_LSB WLAN_LF_TIMER_CONTROL3_AUTO_RESTART_LSB -#define LF_TIMER_CONTROL3_AUTO_RESTART_MASK WLAN_LF_TIMER_CONTROL3_AUTO_RESTART_MASK -#define LF_TIMER_CONTROL3_AUTO_RESTART_GET(x) WLAN_LF_TIMER_CONTROL3_AUTO_RESTART_GET(x) -#define LF_TIMER_CONTROL3_AUTO_RESTART_SET(x) WLAN_LF_TIMER_CONTROL3_AUTO_RESTART_SET(x) -#define LF_TIMER_CONTROL3_RESET_MSB WLAN_LF_TIMER_CONTROL3_RESET_MSB -#define LF_TIMER_CONTROL3_RESET_LSB WLAN_LF_TIMER_CONTROL3_RESET_LSB -#define LF_TIMER_CONTROL3_RESET_MASK WLAN_LF_TIMER_CONTROL3_RESET_MASK -#define LF_TIMER_CONTROL3_RESET_GET(x) WLAN_LF_TIMER_CONTROL3_RESET_GET(x) -#define LF_TIMER_CONTROL3_RESET_SET(x) WLAN_LF_TIMER_CONTROL3_RESET_SET(x) -#define LF_TIMER_STATUS3_ADDRESS WLAN_LF_TIMER_STATUS3_ADDRESS -#define LF_TIMER_STATUS3_OFFSET WLAN_LF_TIMER_STATUS3_OFFSET -#define LF_TIMER_STATUS3_INTERRUPT_MSB WLAN_LF_TIMER_STATUS3_INTERRUPT_MSB -#define LF_TIMER_STATUS3_INTERRUPT_LSB WLAN_LF_TIMER_STATUS3_INTERRUPT_LSB -#define LF_TIMER_STATUS3_INTERRUPT_MASK WLAN_LF_TIMER_STATUS3_INTERRUPT_MASK -#define LF_TIMER_STATUS3_INTERRUPT_GET(x) WLAN_LF_TIMER_STATUS3_INTERRUPT_GET(x) -#define LF_TIMER_STATUS3_INTERRUPT_SET(x) WLAN_LF_TIMER_STATUS3_INTERRUPT_SET(x) -#define HF_TIMER_ADDRESS WLAN_HF_TIMER_ADDRESS -#define HF_TIMER_OFFSET WLAN_HF_TIMER_OFFSET -#define HF_TIMER_TARGET_MSB WLAN_HF_TIMER_TARGET_MSB -#define HF_TIMER_TARGET_LSB WLAN_HF_TIMER_TARGET_LSB -#define HF_TIMER_TARGET_MASK WLAN_HF_TIMER_TARGET_MASK -#define HF_TIMER_TARGET_GET(x) WLAN_HF_TIMER_TARGET_GET(x) -#define HF_TIMER_TARGET_SET(x) WLAN_HF_TIMER_TARGET_SET(x) -#define HF_TIMER_COUNT_ADDRESS WLAN_HF_TIMER_COUNT_ADDRESS -#define HF_TIMER_COUNT_OFFSET WLAN_HF_TIMER_COUNT_OFFSET -#define HF_TIMER_COUNT_VALUE_MSB WLAN_HF_TIMER_COUNT_VALUE_MSB -#define HF_TIMER_COUNT_VALUE_LSB WLAN_HF_TIMER_COUNT_VALUE_LSB -#define HF_TIMER_COUNT_VALUE_MASK WLAN_HF_TIMER_COUNT_VALUE_MASK -#define HF_TIMER_COUNT_VALUE_GET(x) WLAN_HF_TIMER_COUNT_VALUE_GET(x) -#define HF_TIMER_COUNT_VALUE_SET(x) WLAN_HF_TIMER_COUNT_VALUE_SET(x) -#define HF_LF_COUNT_ADDRESS WLAN_HF_LF_COUNT_ADDRESS -#define HF_LF_COUNT_OFFSET WLAN_HF_LF_COUNT_OFFSET -#define HF_LF_COUNT_VALUE_MSB WLAN_HF_LF_COUNT_VALUE_MSB -#define HF_LF_COUNT_VALUE_LSB WLAN_HF_LF_COUNT_VALUE_LSB -#define HF_LF_COUNT_VALUE_MASK WLAN_HF_LF_COUNT_VALUE_MASK -#define HF_LF_COUNT_VALUE_GET(x) WLAN_HF_LF_COUNT_VALUE_GET(x) -#define HF_LF_COUNT_VALUE_SET(x) WLAN_HF_LF_COUNT_VALUE_SET(x) -#define HF_TIMER_CONTROL_ADDRESS WLAN_HF_TIMER_CONTROL_ADDRESS -#define HF_TIMER_CONTROL_OFFSET WLAN_HF_TIMER_CONTROL_OFFSET -#define HF_TIMER_CONTROL_ENABLE_MSB WLAN_HF_TIMER_CONTROL_ENABLE_MSB -#define HF_TIMER_CONTROL_ENABLE_LSB WLAN_HF_TIMER_CONTROL_ENABLE_LSB -#define HF_TIMER_CONTROL_ENABLE_MASK WLAN_HF_TIMER_CONTROL_ENABLE_MASK -#define HF_TIMER_CONTROL_ENABLE_GET(x) WLAN_HF_TIMER_CONTROL_ENABLE_GET(x) -#define HF_TIMER_CONTROL_ENABLE_SET(x) WLAN_HF_TIMER_CONTROL_ENABLE_SET(x) -#define HF_TIMER_CONTROL_ON_MSB WLAN_HF_TIMER_CONTROL_ON_MSB -#define HF_TIMER_CONTROL_ON_LSB WLAN_HF_TIMER_CONTROL_ON_LSB -#define HF_TIMER_CONTROL_ON_MASK WLAN_HF_TIMER_CONTROL_ON_MASK -#define HF_TIMER_CONTROL_ON_GET(x) WLAN_HF_TIMER_CONTROL_ON_GET(x) -#define HF_TIMER_CONTROL_ON_SET(x) WLAN_HF_TIMER_CONTROL_ON_SET(x) -#define HF_TIMER_CONTROL_AUTO_RESTART_MSB WLAN_HF_TIMER_CONTROL_AUTO_RESTART_MSB -#define HF_TIMER_CONTROL_AUTO_RESTART_LSB WLAN_HF_TIMER_CONTROL_AUTO_RESTART_LSB -#define HF_TIMER_CONTROL_AUTO_RESTART_MASK WLAN_HF_TIMER_CONTROL_AUTO_RESTART_MASK -#define HF_TIMER_CONTROL_AUTO_RESTART_GET(x) WLAN_HF_TIMER_CONTROL_AUTO_RESTART_GET(x) -#define HF_TIMER_CONTROL_AUTO_RESTART_SET(x) WLAN_HF_TIMER_CONTROL_AUTO_RESTART_SET(x) -#define HF_TIMER_CONTROL_RESET_MSB WLAN_HF_TIMER_CONTROL_RESET_MSB -#define HF_TIMER_CONTROL_RESET_LSB WLAN_HF_TIMER_CONTROL_RESET_LSB -#define HF_TIMER_CONTROL_RESET_MASK WLAN_HF_TIMER_CONTROL_RESET_MASK -#define HF_TIMER_CONTROL_RESET_GET(x) WLAN_HF_TIMER_CONTROL_RESET_GET(x) -#define HF_TIMER_CONTROL_RESET_SET(x) WLAN_HF_TIMER_CONTROL_RESET_SET(x) -#define HF_TIMER_STATUS_ADDRESS WLAN_HF_TIMER_STATUS_ADDRESS -#define HF_TIMER_STATUS_OFFSET WLAN_HF_TIMER_STATUS_OFFSET -#define HF_TIMER_STATUS_INTERRUPT_MSB WLAN_HF_TIMER_STATUS_INTERRUPT_MSB -#define HF_TIMER_STATUS_INTERRUPT_LSB WLAN_HF_TIMER_STATUS_INTERRUPT_LSB -#define HF_TIMER_STATUS_INTERRUPT_MASK WLAN_HF_TIMER_STATUS_INTERRUPT_MASK -#define HF_TIMER_STATUS_INTERRUPT_GET(x) WLAN_HF_TIMER_STATUS_INTERRUPT_GET(x) -#define HF_TIMER_STATUS_INTERRUPT_SET(x) WLAN_HF_TIMER_STATUS_INTERRUPT_SET(x) -#define RTC_CONTROL_ADDRESS WLAN_RTC_CONTROL_ADDRESS -#define RTC_CONTROL_OFFSET WLAN_RTC_CONTROL_OFFSET -#define RTC_CONTROL_ENABLE_MSB WLAN_RTC_CONTROL_ENABLE_MSB -#define RTC_CONTROL_ENABLE_LSB WLAN_RTC_CONTROL_ENABLE_LSB -#define RTC_CONTROL_ENABLE_MASK WLAN_RTC_CONTROL_ENABLE_MASK -#define RTC_CONTROL_ENABLE_GET(x) WLAN_RTC_CONTROL_ENABLE_GET(x) -#define RTC_CONTROL_ENABLE_SET(x) WLAN_RTC_CONTROL_ENABLE_SET(x) -#define RTC_CONTROL_LOAD_RTC_MSB WLAN_RTC_CONTROL_LOAD_RTC_MSB -#define RTC_CONTROL_LOAD_RTC_LSB WLAN_RTC_CONTROL_LOAD_RTC_LSB -#define RTC_CONTROL_LOAD_RTC_MASK WLAN_RTC_CONTROL_LOAD_RTC_MASK -#define RTC_CONTROL_LOAD_RTC_GET(x) WLAN_RTC_CONTROL_LOAD_RTC_GET(x) -#define RTC_CONTROL_LOAD_RTC_SET(x) WLAN_RTC_CONTROL_LOAD_RTC_SET(x) -#define RTC_CONTROL_LOAD_ALARM_MSB WLAN_RTC_CONTROL_LOAD_ALARM_MSB -#define RTC_CONTROL_LOAD_ALARM_LSB WLAN_RTC_CONTROL_LOAD_ALARM_LSB -#define RTC_CONTROL_LOAD_ALARM_MASK WLAN_RTC_CONTROL_LOAD_ALARM_MASK -#define RTC_CONTROL_LOAD_ALARM_GET(x) WLAN_RTC_CONTROL_LOAD_ALARM_GET(x) -#define RTC_CONTROL_LOAD_ALARM_SET(x) WLAN_RTC_CONTROL_LOAD_ALARM_SET(x) -#define RTC_TIME_ADDRESS WLAN_RTC_TIME_ADDRESS -#define RTC_TIME_OFFSET WLAN_RTC_TIME_OFFSET -#define RTC_TIME_WEEK_DAY_MSB WLAN_RTC_TIME_WEEK_DAY_MSB -#define RTC_TIME_WEEK_DAY_LSB WLAN_RTC_TIME_WEEK_DAY_LSB -#define RTC_TIME_WEEK_DAY_MASK WLAN_RTC_TIME_WEEK_DAY_MASK -#define RTC_TIME_WEEK_DAY_GET(x) WLAN_RTC_TIME_WEEK_DAY_GET(x) -#define RTC_TIME_WEEK_DAY_SET(x) WLAN_RTC_TIME_WEEK_DAY_SET(x) -#define RTC_TIME_HOUR_MSB WLAN_RTC_TIME_HOUR_MSB -#define RTC_TIME_HOUR_LSB WLAN_RTC_TIME_HOUR_LSB -#define RTC_TIME_HOUR_MASK WLAN_RTC_TIME_HOUR_MASK -#define RTC_TIME_HOUR_GET(x) WLAN_RTC_TIME_HOUR_GET(x) -#define RTC_TIME_HOUR_SET(x) WLAN_RTC_TIME_HOUR_SET(x) -#define RTC_TIME_MINUTE_MSB WLAN_RTC_TIME_MINUTE_MSB -#define RTC_TIME_MINUTE_LSB WLAN_RTC_TIME_MINUTE_LSB -#define RTC_TIME_MINUTE_MASK WLAN_RTC_TIME_MINUTE_MASK -#define RTC_TIME_MINUTE_GET(x) WLAN_RTC_TIME_MINUTE_GET(x) -#define RTC_TIME_MINUTE_SET(x) WLAN_RTC_TIME_MINUTE_SET(x) -#define RTC_TIME_SECOND_MSB WLAN_RTC_TIME_SECOND_MSB -#define RTC_TIME_SECOND_LSB WLAN_RTC_TIME_SECOND_LSB -#define RTC_TIME_SECOND_MASK WLAN_RTC_TIME_SECOND_MASK -#define RTC_TIME_SECOND_GET(x) WLAN_RTC_TIME_SECOND_GET(x) -#define RTC_TIME_SECOND_SET(x) WLAN_RTC_TIME_SECOND_SET(x) -#define RTC_DATE_ADDRESS WLAN_RTC_DATE_ADDRESS -#define RTC_DATE_OFFSET WLAN_RTC_DATE_OFFSET -#define RTC_DATE_YEAR_MSB WLAN_RTC_DATE_YEAR_MSB -#define RTC_DATE_YEAR_LSB WLAN_RTC_DATE_YEAR_LSB -#define RTC_DATE_YEAR_MASK WLAN_RTC_DATE_YEAR_MASK -#define RTC_DATE_YEAR_GET(x) WLAN_RTC_DATE_YEAR_GET(x) -#define RTC_DATE_YEAR_SET(x) WLAN_RTC_DATE_YEAR_SET(x) -#define RTC_DATE_MONTH_MSB WLAN_RTC_DATE_MONTH_MSB -#define RTC_DATE_MONTH_LSB WLAN_RTC_DATE_MONTH_LSB -#define RTC_DATE_MONTH_MASK WLAN_RTC_DATE_MONTH_MASK -#define RTC_DATE_MONTH_GET(x) WLAN_RTC_DATE_MONTH_GET(x) -#define RTC_DATE_MONTH_SET(x) WLAN_RTC_DATE_MONTH_SET(x) -#define RTC_DATE_MONTH_DAY_MSB WLAN_RTC_DATE_MONTH_DAY_MSB -#define RTC_DATE_MONTH_DAY_LSB WLAN_RTC_DATE_MONTH_DAY_LSB -#define RTC_DATE_MONTH_DAY_MASK WLAN_RTC_DATE_MONTH_DAY_MASK -#define RTC_DATE_MONTH_DAY_GET(x) WLAN_RTC_DATE_MONTH_DAY_GET(x) -#define RTC_DATE_MONTH_DAY_SET(x) WLAN_RTC_DATE_MONTH_DAY_SET(x) -#define RTC_SET_TIME_ADDRESS WLAN_RTC_SET_TIME_ADDRESS -#define RTC_SET_TIME_OFFSET WLAN_RTC_SET_TIME_OFFSET -#define RTC_SET_TIME_WEEK_DAY_MSB WLAN_RTC_SET_TIME_WEEK_DAY_MSB -#define RTC_SET_TIME_WEEK_DAY_LSB WLAN_RTC_SET_TIME_WEEK_DAY_LSB -#define RTC_SET_TIME_WEEK_DAY_MASK WLAN_RTC_SET_TIME_WEEK_DAY_MASK -#define RTC_SET_TIME_WEEK_DAY_GET(x) WLAN_RTC_SET_TIME_WEEK_DAY_GET(x) -#define RTC_SET_TIME_WEEK_DAY_SET(x) WLAN_RTC_SET_TIME_WEEK_DAY_SET(x) -#define RTC_SET_TIME_HOUR_MSB WLAN_RTC_SET_TIME_HOUR_MSB -#define RTC_SET_TIME_HOUR_LSB WLAN_RTC_SET_TIME_HOUR_LSB -#define RTC_SET_TIME_HOUR_MASK WLAN_RTC_SET_TIME_HOUR_MASK -#define RTC_SET_TIME_HOUR_GET(x) WLAN_RTC_SET_TIME_HOUR_GET(x) -#define RTC_SET_TIME_HOUR_SET(x) WLAN_RTC_SET_TIME_HOUR_SET(x) -#define RTC_SET_TIME_MINUTE_MSB WLAN_RTC_SET_TIME_MINUTE_MSB -#define RTC_SET_TIME_MINUTE_LSB WLAN_RTC_SET_TIME_MINUTE_LSB -#define RTC_SET_TIME_MINUTE_MASK WLAN_RTC_SET_TIME_MINUTE_MASK -#define RTC_SET_TIME_MINUTE_GET(x) WLAN_RTC_SET_TIME_MINUTE_GET(x) -#define RTC_SET_TIME_MINUTE_SET(x) WLAN_RTC_SET_TIME_MINUTE_SET(x) -#define RTC_SET_TIME_SECOND_MSB WLAN_RTC_SET_TIME_SECOND_MSB -#define RTC_SET_TIME_SECOND_LSB WLAN_RTC_SET_TIME_SECOND_LSB -#define RTC_SET_TIME_SECOND_MASK WLAN_RTC_SET_TIME_SECOND_MASK -#define RTC_SET_TIME_SECOND_GET(x) WLAN_RTC_SET_TIME_SECOND_GET(x) -#define RTC_SET_TIME_SECOND_SET(x) WLAN_RTC_SET_TIME_SECOND_SET(x) -#define RTC_SET_DATE_ADDRESS WLAN_RTC_SET_DATE_ADDRESS -#define RTC_SET_DATE_OFFSET WLAN_RTC_SET_DATE_OFFSET -#define RTC_SET_DATE_YEAR_MSB WLAN_RTC_SET_DATE_YEAR_MSB -#define RTC_SET_DATE_YEAR_LSB WLAN_RTC_SET_DATE_YEAR_LSB -#define RTC_SET_DATE_YEAR_MASK WLAN_RTC_SET_DATE_YEAR_MASK -#define RTC_SET_DATE_YEAR_GET(x) WLAN_RTC_SET_DATE_YEAR_GET(x) -#define RTC_SET_DATE_YEAR_SET(x) WLAN_RTC_SET_DATE_YEAR_SET(x) -#define RTC_SET_DATE_MONTH_MSB WLAN_RTC_SET_DATE_MONTH_MSB -#define RTC_SET_DATE_MONTH_LSB WLAN_RTC_SET_DATE_MONTH_LSB -#define RTC_SET_DATE_MONTH_MASK WLAN_RTC_SET_DATE_MONTH_MASK -#define RTC_SET_DATE_MONTH_GET(x) WLAN_RTC_SET_DATE_MONTH_GET(x) -#define RTC_SET_DATE_MONTH_SET(x) WLAN_RTC_SET_DATE_MONTH_SET(x) -#define RTC_SET_DATE_MONTH_DAY_MSB WLAN_RTC_SET_DATE_MONTH_DAY_MSB -#define RTC_SET_DATE_MONTH_DAY_LSB WLAN_RTC_SET_DATE_MONTH_DAY_LSB -#define RTC_SET_DATE_MONTH_DAY_MASK WLAN_RTC_SET_DATE_MONTH_DAY_MASK -#define RTC_SET_DATE_MONTH_DAY_GET(x) WLAN_RTC_SET_DATE_MONTH_DAY_GET(x) -#define RTC_SET_DATE_MONTH_DAY_SET(x) WLAN_RTC_SET_DATE_MONTH_DAY_SET(x) -#define RTC_SET_ALARM_ADDRESS WLAN_RTC_SET_ALARM_ADDRESS -#define RTC_SET_ALARM_OFFSET WLAN_RTC_SET_ALARM_OFFSET -#define RTC_SET_ALARM_HOUR_MSB WLAN_RTC_SET_ALARM_HOUR_MSB -#define RTC_SET_ALARM_HOUR_LSB WLAN_RTC_SET_ALARM_HOUR_LSB -#define RTC_SET_ALARM_HOUR_MASK WLAN_RTC_SET_ALARM_HOUR_MASK -#define RTC_SET_ALARM_HOUR_GET(x) WLAN_RTC_SET_ALARM_HOUR_GET(x) -#define RTC_SET_ALARM_HOUR_SET(x) WLAN_RTC_SET_ALARM_HOUR_SET(x) -#define RTC_SET_ALARM_MINUTE_MSB WLAN_RTC_SET_ALARM_MINUTE_MSB -#define RTC_SET_ALARM_MINUTE_LSB WLAN_RTC_SET_ALARM_MINUTE_LSB -#define RTC_SET_ALARM_MINUTE_MASK WLAN_RTC_SET_ALARM_MINUTE_MASK -#define RTC_SET_ALARM_MINUTE_GET(x) WLAN_RTC_SET_ALARM_MINUTE_GET(x) -#define RTC_SET_ALARM_MINUTE_SET(x) WLAN_RTC_SET_ALARM_MINUTE_SET(x) -#define RTC_SET_ALARM_SECOND_MSB WLAN_RTC_SET_ALARM_SECOND_MSB -#define RTC_SET_ALARM_SECOND_LSB WLAN_RTC_SET_ALARM_SECOND_LSB -#define RTC_SET_ALARM_SECOND_MASK WLAN_RTC_SET_ALARM_SECOND_MASK -#define RTC_SET_ALARM_SECOND_GET(x) WLAN_RTC_SET_ALARM_SECOND_GET(x) -#define RTC_SET_ALARM_SECOND_SET(x) WLAN_RTC_SET_ALARM_SECOND_SET(x) -#define RTC_CONFIG_ADDRESS WLAN_RTC_CONFIG_ADDRESS -#define RTC_CONFIG_OFFSET WLAN_RTC_CONFIG_OFFSET -#define RTC_CONFIG_BCD_MSB WLAN_RTC_CONFIG_BCD_MSB -#define RTC_CONFIG_BCD_LSB WLAN_RTC_CONFIG_BCD_LSB -#define RTC_CONFIG_BCD_MASK WLAN_RTC_CONFIG_BCD_MASK -#define RTC_CONFIG_BCD_GET(x) WLAN_RTC_CONFIG_BCD_GET(x) -#define RTC_CONFIG_BCD_SET(x) WLAN_RTC_CONFIG_BCD_SET(x) -#define RTC_CONFIG_TWELVE_HOUR_MSB WLAN_RTC_CONFIG_TWELVE_HOUR_MSB -#define RTC_CONFIG_TWELVE_HOUR_LSB WLAN_RTC_CONFIG_TWELVE_HOUR_LSB -#define RTC_CONFIG_TWELVE_HOUR_MASK WLAN_RTC_CONFIG_TWELVE_HOUR_MASK -#define RTC_CONFIG_TWELVE_HOUR_GET(x) WLAN_RTC_CONFIG_TWELVE_HOUR_GET(x) -#define RTC_CONFIG_TWELVE_HOUR_SET(x) WLAN_RTC_CONFIG_TWELVE_HOUR_SET(x) -#define RTC_CONFIG_DSE_MSB WLAN_RTC_CONFIG_DSE_MSB -#define RTC_CONFIG_DSE_LSB WLAN_RTC_CONFIG_DSE_LSB -#define RTC_CONFIG_DSE_MASK WLAN_RTC_CONFIG_DSE_MASK -#define RTC_CONFIG_DSE_GET(x) WLAN_RTC_CONFIG_DSE_GET(x) -#define RTC_CONFIG_DSE_SET(x) WLAN_RTC_CONFIG_DSE_SET(x) -#define RTC_ALARM_STATUS_ADDRESS WLAN_RTC_ALARM_STATUS_ADDRESS -#define RTC_ALARM_STATUS_OFFSET WLAN_RTC_ALARM_STATUS_OFFSET -#define RTC_ALARM_STATUS_ENABLE_MSB WLAN_RTC_ALARM_STATUS_ENABLE_MSB -#define RTC_ALARM_STATUS_ENABLE_LSB WLAN_RTC_ALARM_STATUS_ENABLE_LSB -#define RTC_ALARM_STATUS_ENABLE_MASK WLAN_RTC_ALARM_STATUS_ENABLE_MASK -#define RTC_ALARM_STATUS_ENABLE_GET(x) WLAN_RTC_ALARM_STATUS_ENABLE_GET(x) -#define RTC_ALARM_STATUS_ENABLE_SET(x) WLAN_RTC_ALARM_STATUS_ENABLE_SET(x) -#define RTC_ALARM_STATUS_INTERRUPT_MSB WLAN_RTC_ALARM_STATUS_INTERRUPT_MSB -#define RTC_ALARM_STATUS_INTERRUPT_LSB WLAN_RTC_ALARM_STATUS_INTERRUPT_LSB -#define RTC_ALARM_STATUS_INTERRUPT_MASK WLAN_RTC_ALARM_STATUS_INTERRUPT_MASK -#define RTC_ALARM_STATUS_INTERRUPT_GET(x) WLAN_RTC_ALARM_STATUS_INTERRUPT_GET(x) -#define RTC_ALARM_STATUS_INTERRUPT_SET(x) WLAN_RTC_ALARM_STATUS_INTERRUPT_SET(x) -#define UART_WAKEUP_ADDRESS WLAN_UART_WAKEUP_ADDRESS -#define UART_WAKEUP_OFFSET WLAN_UART_WAKEUP_OFFSET -#define UART_WAKEUP_ENABLE_MSB WLAN_UART_WAKEUP_ENABLE_MSB -#define UART_WAKEUP_ENABLE_LSB WLAN_UART_WAKEUP_ENABLE_LSB -#define UART_WAKEUP_ENABLE_MASK WLAN_UART_WAKEUP_ENABLE_MASK -#define UART_WAKEUP_ENABLE_GET(x) WLAN_UART_WAKEUP_ENABLE_GET(x) -#define UART_WAKEUP_ENABLE_SET(x) WLAN_UART_WAKEUP_ENABLE_SET(x) -#define RESET_CAUSE_ADDRESS WLAN_RESET_CAUSE_ADDRESS -#define RESET_CAUSE_OFFSET WLAN_RESET_CAUSE_OFFSET -#define RESET_CAUSE_LAST_MSB WLAN_RESET_CAUSE_LAST_MSB -#define RESET_CAUSE_LAST_LSB WLAN_RESET_CAUSE_LAST_LSB -#define RESET_CAUSE_LAST_MASK WLAN_RESET_CAUSE_LAST_MASK -#define RESET_CAUSE_LAST_GET(x) WLAN_RESET_CAUSE_LAST_GET(x) -#define RESET_CAUSE_LAST_SET(x) WLAN_RESET_CAUSE_LAST_SET(x) -#define SYSTEM_SLEEP_ADDRESS WLAN_SYSTEM_SLEEP_ADDRESS -#define SYSTEM_SLEEP_OFFSET WLAN_SYSTEM_SLEEP_OFFSET -#define SYSTEM_SLEEP_HOST_IF_MSB WLAN_SYSTEM_SLEEP_HOST_IF_MSB -#define SYSTEM_SLEEP_HOST_IF_LSB WLAN_SYSTEM_SLEEP_HOST_IF_LSB -#define SYSTEM_SLEEP_HOST_IF_MASK WLAN_SYSTEM_SLEEP_HOST_IF_MASK -#define SYSTEM_SLEEP_HOST_IF_GET(x) WLAN_SYSTEM_SLEEP_HOST_IF_GET(x) -#define SYSTEM_SLEEP_HOST_IF_SET(x) WLAN_SYSTEM_SLEEP_HOST_IF_SET(x) -#define SYSTEM_SLEEP_MBOX_MSB WLAN_SYSTEM_SLEEP_MBOX_MSB -#define SYSTEM_SLEEP_MBOX_LSB WLAN_SYSTEM_SLEEP_MBOX_LSB -#define SYSTEM_SLEEP_MBOX_MASK WLAN_SYSTEM_SLEEP_MBOX_MASK -#define SYSTEM_SLEEP_MBOX_GET(x) WLAN_SYSTEM_SLEEP_MBOX_GET(x) -#define SYSTEM_SLEEP_MBOX_SET(x) WLAN_SYSTEM_SLEEP_MBOX_SET(x) -#define SYSTEM_SLEEP_MAC_IF_MSB WLAN_SYSTEM_SLEEP_MAC_IF_MSB -#define SYSTEM_SLEEP_MAC_IF_LSB WLAN_SYSTEM_SLEEP_MAC_IF_LSB -#define SYSTEM_SLEEP_MAC_IF_MASK WLAN_SYSTEM_SLEEP_MAC_IF_MASK -#define SYSTEM_SLEEP_MAC_IF_GET(x) WLAN_SYSTEM_SLEEP_MAC_IF_GET(x) -#define SYSTEM_SLEEP_MAC_IF_SET(x) WLAN_SYSTEM_SLEEP_MAC_IF_SET(x) -#define SYSTEM_SLEEP_LIGHT_MSB WLAN_SYSTEM_SLEEP_LIGHT_MSB -#define SYSTEM_SLEEP_LIGHT_LSB WLAN_SYSTEM_SLEEP_LIGHT_LSB -#define SYSTEM_SLEEP_LIGHT_MASK WLAN_SYSTEM_SLEEP_LIGHT_MASK -#define SYSTEM_SLEEP_LIGHT_GET(x) WLAN_SYSTEM_SLEEP_LIGHT_GET(x) -#define SYSTEM_SLEEP_LIGHT_SET(x) WLAN_SYSTEM_SLEEP_LIGHT_SET(x) -#define SYSTEM_SLEEP_DISABLE_MSB WLAN_SYSTEM_SLEEP_DISABLE_MSB -#define SYSTEM_SLEEP_DISABLE_LSB WLAN_SYSTEM_SLEEP_DISABLE_LSB -#define SYSTEM_SLEEP_DISABLE_MASK WLAN_SYSTEM_SLEEP_DISABLE_MASK -#define SYSTEM_SLEEP_DISABLE_GET(x) WLAN_SYSTEM_SLEEP_DISABLE_GET(x) -#define SYSTEM_SLEEP_DISABLE_SET(x) WLAN_SYSTEM_SLEEP_DISABLE_SET(x) -#define SDIO_WRAPPER_ADDRESS WLAN_SDIO_WRAPPER_ADDRESS -#define SDIO_WRAPPER_OFFSET WLAN_SDIO_WRAPPER_OFFSET -#define SDIO_WRAPPER_SLEEP_MSB WLAN_SDIO_WRAPPER_SLEEP_MSB -#define SDIO_WRAPPER_SLEEP_LSB WLAN_SDIO_WRAPPER_SLEEP_LSB -#define SDIO_WRAPPER_SLEEP_MASK WLAN_SDIO_WRAPPER_SLEEP_MASK -#define SDIO_WRAPPER_SLEEP_GET(x) WLAN_SDIO_WRAPPER_SLEEP_GET(x) -#define SDIO_WRAPPER_SLEEP_SET(x) WLAN_SDIO_WRAPPER_SLEEP_SET(x) -#define SDIO_WRAPPER_WAKEUP_MSB WLAN_SDIO_WRAPPER_WAKEUP_MSB -#define SDIO_WRAPPER_WAKEUP_LSB WLAN_SDIO_WRAPPER_WAKEUP_LSB -#define SDIO_WRAPPER_WAKEUP_MASK WLAN_SDIO_WRAPPER_WAKEUP_MASK -#define SDIO_WRAPPER_WAKEUP_GET(x) WLAN_SDIO_WRAPPER_WAKEUP_GET(x) -#define SDIO_WRAPPER_WAKEUP_SET(x) WLAN_SDIO_WRAPPER_WAKEUP_SET(x) -#define SDIO_WRAPPER_SOC_ON_MSB WLAN_SDIO_WRAPPER_SOC_ON_MSB -#define SDIO_WRAPPER_SOC_ON_LSB WLAN_SDIO_WRAPPER_SOC_ON_LSB -#define SDIO_WRAPPER_SOC_ON_MASK WLAN_SDIO_WRAPPER_SOC_ON_MASK -#define SDIO_WRAPPER_SOC_ON_GET(x) WLAN_SDIO_WRAPPER_SOC_ON_GET(x) -#define SDIO_WRAPPER_SOC_ON_SET(x) WLAN_SDIO_WRAPPER_SOC_ON_SET(x) -#define SDIO_WRAPPER_ON_MSB WLAN_SDIO_WRAPPER_ON_MSB -#define SDIO_WRAPPER_ON_LSB WLAN_SDIO_WRAPPER_ON_LSB -#define SDIO_WRAPPER_ON_MASK WLAN_SDIO_WRAPPER_ON_MASK -#define SDIO_WRAPPER_ON_GET(x) WLAN_SDIO_WRAPPER_ON_GET(x) -#define SDIO_WRAPPER_ON_SET(x) WLAN_SDIO_WRAPPER_ON_SET(x) -#define MAC_SLEEP_CONTROL_ADDRESS WLAN_MAC_SLEEP_CONTROL_ADDRESS -#define MAC_SLEEP_CONTROL_OFFSET WLAN_MAC_SLEEP_CONTROL_OFFSET -#define MAC_SLEEP_CONTROL_ENABLE_MSB WLAN_MAC_SLEEP_CONTROL_ENABLE_MSB -#define MAC_SLEEP_CONTROL_ENABLE_LSB WLAN_MAC_SLEEP_CONTROL_ENABLE_LSB -#define MAC_SLEEP_CONTROL_ENABLE_MASK WLAN_MAC_SLEEP_CONTROL_ENABLE_MASK -#define MAC_SLEEP_CONTROL_ENABLE_GET(x) WLAN_MAC_SLEEP_CONTROL_ENABLE_GET(x) -#define MAC_SLEEP_CONTROL_ENABLE_SET(x) WLAN_MAC_SLEEP_CONTROL_ENABLE_SET(x) -#define KEEP_AWAKE_ADDRESS WLAN_KEEP_AWAKE_ADDRESS -#define KEEP_AWAKE_OFFSET WLAN_KEEP_AWAKE_OFFSET -#define KEEP_AWAKE_COUNT_MSB WLAN_KEEP_AWAKE_COUNT_MSB -#define KEEP_AWAKE_COUNT_LSB WLAN_KEEP_AWAKE_COUNT_LSB -#define KEEP_AWAKE_COUNT_MASK WLAN_KEEP_AWAKE_COUNT_MASK -#define KEEP_AWAKE_COUNT_GET(x) WLAN_KEEP_AWAKE_COUNT_GET(x) -#define KEEP_AWAKE_COUNT_SET(x) WLAN_KEEP_AWAKE_COUNT_SET(x) -#define LPO_CAL_TIME_ADDRESS WLAN_LPO_CAL_TIME_ADDRESS -#define LPO_CAL_TIME_OFFSET WLAN_LPO_CAL_TIME_OFFSET -#define LPO_CAL_TIME_LENGTH_MSB WLAN_LPO_CAL_TIME_LENGTH_MSB -#define LPO_CAL_TIME_LENGTH_LSB WLAN_LPO_CAL_TIME_LENGTH_LSB -#define LPO_CAL_TIME_LENGTH_MASK WLAN_LPO_CAL_TIME_LENGTH_MASK -#define LPO_CAL_TIME_LENGTH_GET(x) WLAN_LPO_CAL_TIME_LENGTH_GET(x) -#define LPO_CAL_TIME_LENGTH_SET(x) WLAN_LPO_CAL_TIME_LENGTH_SET(x) -#define LPO_INIT_DIVIDEND_INT_ADDRESS WLAN_LPO_INIT_DIVIDEND_INT_ADDRESS -#define LPO_INIT_DIVIDEND_INT_OFFSET WLAN_LPO_INIT_DIVIDEND_INT_OFFSET -#define LPO_INIT_DIVIDEND_INT_VALUE_MSB WLAN_LPO_INIT_DIVIDEND_INT_VALUE_MSB -#define LPO_INIT_DIVIDEND_INT_VALUE_LSB WLAN_LPO_INIT_DIVIDEND_INT_VALUE_LSB -#define LPO_INIT_DIVIDEND_INT_VALUE_MASK WLAN_LPO_INIT_DIVIDEND_INT_VALUE_MASK -#define LPO_INIT_DIVIDEND_INT_VALUE_GET(x) WLAN_LPO_INIT_DIVIDEND_INT_VALUE_GET(x) -#define LPO_INIT_DIVIDEND_INT_VALUE_SET(x) WLAN_LPO_INIT_DIVIDEND_INT_VALUE_SET(x) -#define LPO_INIT_DIVIDEND_FRACTION_ADDRESS WLAN_LPO_INIT_DIVIDEND_FRACTION_ADDRESS -#define LPO_INIT_DIVIDEND_FRACTION_OFFSET WLAN_LPO_INIT_DIVIDEND_FRACTION_OFFSET -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_MSB WLAN_LPO_INIT_DIVIDEND_FRACTION_VALUE_MSB -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB WLAN_LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK WLAN_LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_GET(x) WLAN_LPO_INIT_DIVIDEND_FRACTION_VALUE_GET(x) -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_SET(x) WLAN_LPO_INIT_DIVIDEND_FRACTION_VALUE_SET(x) -#define LPO_CAL_ADDRESS WLAN_LPO_CAL_ADDRESS -#define LPO_CAL_OFFSET WLAN_LPO_CAL_OFFSET -#define LPO_CAL_ENABLE_MSB WLAN_LPO_CAL_ENABLE_MSB -#define LPO_CAL_ENABLE_LSB WLAN_LPO_CAL_ENABLE_LSB -#define LPO_CAL_ENABLE_MASK WLAN_LPO_CAL_ENABLE_MASK -#define LPO_CAL_ENABLE_GET(x) WLAN_LPO_CAL_ENABLE_GET(x) -#define LPO_CAL_ENABLE_SET(x) WLAN_LPO_CAL_ENABLE_SET(x) -#define LPO_CAL_COUNT_MSB WLAN_LPO_CAL_COUNT_MSB -#define LPO_CAL_COUNT_LSB WLAN_LPO_CAL_COUNT_LSB -#define LPO_CAL_COUNT_MASK WLAN_LPO_CAL_COUNT_MASK -#define LPO_CAL_COUNT_GET(x) WLAN_LPO_CAL_COUNT_GET(x) -#define LPO_CAL_COUNT_SET(x) WLAN_LPO_CAL_COUNT_SET(x) -#define LPO_CAL_TEST_CONTROL_ADDRESS WLAN_LPO_CAL_TEST_CONTROL_ADDRESS -#define LPO_CAL_TEST_CONTROL_OFFSET WLAN_LPO_CAL_TEST_CONTROL_OFFSET -#define LPO_CAL_TEST_CONTROL_ENABLE_MSB WLAN_LPO_CAL_TEST_CONTROL_ENABLE_MSB -#define LPO_CAL_TEST_CONTROL_ENABLE_LSB WLAN_LPO_CAL_TEST_CONTROL_ENABLE_LSB -#define LPO_CAL_TEST_CONTROL_ENABLE_MASK WLAN_LPO_CAL_TEST_CONTROL_ENABLE_MASK -#define LPO_CAL_TEST_CONTROL_ENABLE_GET(x) WLAN_LPO_CAL_TEST_CONTROL_ENABLE_GET(x) -#define LPO_CAL_TEST_CONTROL_ENABLE_SET(x) WLAN_LPO_CAL_TEST_CONTROL_ENABLE_SET(x) -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_MSB WLAN_LPO_CAL_TEST_CONTROL_RTC_CYCLES_MSB -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB WLAN_LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK WLAN_LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_GET(x) WLAN_LPO_CAL_TEST_CONTROL_RTC_CYCLES_GET(x) -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_SET(x) WLAN_LPO_CAL_TEST_CONTROL_RTC_CYCLES_SET(x) -#define LPO_CAL_TEST_STATUS_ADDRESS WLAN_LPO_CAL_TEST_STATUS_ADDRESS -#define LPO_CAL_TEST_STATUS_OFFSET WLAN_LPO_CAL_TEST_STATUS_OFFSET -#define LPO_CAL_TEST_STATUS_READY_MSB WLAN_LPO_CAL_TEST_STATUS_READY_MSB -#define LPO_CAL_TEST_STATUS_READY_LSB WLAN_LPO_CAL_TEST_STATUS_READY_LSB -#define LPO_CAL_TEST_STATUS_READY_MASK WLAN_LPO_CAL_TEST_STATUS_READY_MASK -#define LPO_CAL_TEST_STATUS_READY_GET(x) WLAN_LPO_CAL_TEST_STATUS_READY_GET(x) -#define LPO_CAL_TEST_STATUS_READY_SET(x) WLAN_LPO_CAL_TEST_STATUS_READY_SET(x) -#define LPO_CAL_TEST_STATUS_COUNT_MSB WLAN_LPO_CAL_TEST_STATUS_COUNT_MSB -#define LPO_CAL_TEST_STATUS_COUNT_LSB WLAN_LPO_CAL_TEST_STATUS_COUNT_LSB -#define LPO_CAL_TEST_STATUS_COUNT_MASK WLAN_LPO_CAL_TEST_STATUS_COUNT_MASK -#define LPO_CAL_TEST_STATUS_COUNT_GET(x) WLAN_LPO_CAL_TEST_STATUS_COUNT_GET(x) -#define LPO_CAL_TEST_STATUS_COUNT_SET(x) WLAN_LPO_CAL_TEST_STATUS_COUNT_SET(x) -#define CHIP_ID_ADDRESS WLAN_CHIP_ID_ADDRESS -#define CHIP_ID_OFFSET WLAN_CHIP_ID_OFFSET -#define CHIP_ID_DEVICE_ID_MSB WLAN_CHIP_ID_DEVICE_ID_MSB -#define CHIP_ID_DEVICE_ID_LSB WLAN_CHIP_ID_DEVICE_ID_LSB -#define CHIP_ID_DEVICE_ID_MASK WLAN_CHIP_ID_DEVICE_ID_MASK -#define CHIP_ID_DEVICE_ID_GET(x) WLAN_CHIP_ID_DEVICE_ID_GET(x) -#define CHIP_ID_DEVICE_ID_SET(x) WLAN_CHIP_ID_DEVICE_ID_SET(x) -#define CHIP_ID_CONFIG_ID_MSB WLAN_CHIP_ID_CONFIG_ID_MSB -#define CHIP_ID_CONFIG_ID_LSB WLAN_CHIP_ID_CONFIG_ID_LSB -#define CHIP_ID_CONFIG_ID_MASK WLAN_CHIP_ID_CONFIG_ID_MASK -#define CHIP_ID_CONFIG_ID_GET(x) WLAN_CHIP_ID_CONFIG_ID_GET(x) -#define CHIP_ID_CONFIG_ID_SET(x) WLAN_CHIP_ID_CONFIG_ID_SET(x) -#define CHIP_ID_VERSION_ID_MSB WLAN_CHIP_ID_VERSION_ID_MSB -#define CHIP_ID_VERSION_ID_LSB WLAN_CHIP_ID_VERSION_ID_LSB -#define CHIP_ID_VERSION_ID_MASK WLAN_CHIP_ID_VERSION_ID_MASK -#define CHIP_ID_VERSION_ID_GET(x) WLAN_CHIP_ID_VERSION_ID_GET(x) -#define CHIP_ID_VERSION_ID_SET(x) WLAN_CHIP_ID_VERSION_ID_SET(x) -#define DERIVED_RTC_CLK_ADDRESS WLAN_DERIVED_RTC_CLK_ADDRESS -#define DERIVED_RTC_CLK_OFFSET WLAN_DERIVED_RTC_CLK_OFFSET -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MSB WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MSB -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_GET(x) WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_GET(x) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_SET(x) WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_SET(x) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_MSB WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_MSB -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_GET(x) WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_GET(x) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_SET(x) WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_SET(x) -#define DERIVED_RTC_CLK_FORCE_MSB WLAN_DERIVED_RTC_CLK_FORCE_MSB -#define DERIVED_RTC_CLK_FORCE_LSB WLAN_DERIVED_RTC_CLK_FORCE_LSB -#define DERIVED_RTC_CLK_FORCE_MASK WLAN_DERIVED_RTC_CLK_FORCE_MASK -#define DERIVED_RTC_CLK_FORCE_GET(x) WLAN_DERIVED_RTC_CLK_FORCE_GET(x) -#define DERIVED_RTC_CLK_FORCE_SET(x) WLAN_DERIVED_RTC_CLK_FORCE_SET(x) -#define DERIVED_RTC_CLK_PERIOD_MSB WLAN_DERIVED_RTC_CLK_PERIOD_MSB -#define DERIVED_RTC_CLK_PERIOD_LSB WLAN_DERIVED_RTC_CLK_PERIOD_LSB -#define DERIVED_RTC_CLK_PERIOD_MASK WLAN_DERIVED_RTC_CLK_PERIOD_MASK -#define DERIVED_RTC_CLK_PERIOD_GET(x) WLAN_DERIVED_RTC_CLK_PERIOD_GET(x) -#define DERIVED_RTC_CLK_PERIOD_SET(x) WLAN_DERIVED_RTC_CLK_PERIOD_SET(x) -#define POWER_REG_ADDRESS WLAN_POWER_REG_ADDRESS -#define POWER_REG_OFFSET WLAN_POWER_REG_OFFSET -#define POWER_REG_SLEEP_MAKE_N_BREAK_EN_MSB WLAN_POWER_REG_SLEEP_MAKE_N_BREAK_EN_MSB -#define POWER_REG_SLEEP_MAKE_N_BREAK_EN_LSB WLAN_POWER_REG_SLEEP_MAKE_N_BREAK_EN_LSB -#define POWER_REG_SLEEP_MAKE_N_BREAK_EN_MASK WLAN_POWER_REG_SLEEP_MAKE_N_BREAK_EN_MASK -#define POWER_REG_SLEEP_MAKE_N_BREAK_EN_GET(x) WLAN_POWER_REG_SLEEP_MAKE_N_BREAK_EN_GET(x) -#define POWER_REG_SLEEP_MAKE_N_BREAK_EN_SET(x) WLAN_POWER_REG_SLEEP_MAKE_N_BREAK_EN_SET(x) -#define POWER_REG_DEBUG_EN_MSB WLAN_POWER_REG_DEBUG_EN_MSB -#define POWER_REG_DEBUG_EN_LSB WLAN_POWER_REG_DEBUG_EN_LSB -#define POWER_REG_DEBUG_EN_MASK WLAN_POWER_REG_DEBUG_EN_MASK -#define POWER_REG_DEBUG_EN_GET(x) WLAN_POWER_REG_DEBUG_EN_GET(x) -#define POWER_REG_DEBUG_EN_SET(x) WLAN_POWER_REG_DEBUG_EN_SET(x) -#define POWER_REG_WLAN_BB_PWD_EN_MSB WLAN_POWER_REG_WLAN_BB_PWD_EN_MSB -#define POWER_REG_WLAN_BB_PWD_EN_LSB WLAN_POWER_REG_WLAN_BB_PWD_EN_LSB -#define POWER_REG_WLAN_BB_PWD_EN_MASK WLAN_POWER_REG_WLAN_BB_PWD_EN_MASK -#define POWER_REG_WLAN_BB_PWD_EN_GET(x) WLAN_POWER_REG_WLAN_BB_PWD_EN_GET(x) -#define POWER_REG_WLAN_BB_PWD_EN_SET(x) WLAN_POWER_REG_WLAN_BB_PWD_EN_SET(x) -#define POWER_REG_WLAN_MAC_PWD_EN_MSB WLAN_POWER_REG_WLAN_MAC_PWD_EN_MSB -#define POWER_REG_WLAN_MAC_PWD_EN_LSB WLAN_POWER_REG_WLAN_MAC_PWD_EN_LSB -#define POWER_REG_WLAN_MAC_PWD_EN_MASK WLAN_POWER_REG_WLAN_MAC_PWD_EN_MASK -#define POWER_REG_WLAN_MAC_PWD_EN_GET(x) WLAN_POWER_REG_WLAN_MAC_PWD_EN_GET(x) -#define POWER_REG_WLAN_MAC_PWD_EN_SET(x) WLAN_POWER_REG_WLAN_MAC_PWD_EN_SET(x) -#define POWER_REG_VLVL_MSB WLAN_POWER_REG_VLVL_MSB -#define POWER_REG_VLVL_LSB WLAN_POWER_REG_VLVL_LSB -#define POWER_REG_VLVL_MASK WLAN_POWER_REG_VLVL_MASK -#define POWER_REG_VLVL_GET(x) WLAN_POWER_REG_VLVL_GET(x) -#define POWER_REG_VLVL_SET(x) WLAN_POWER_REG_VLVL_SET(x) -#define POWER_REG_CPU_INT_ENABLE_MSB WLAN_POWER_REG_CPU_INT_ENABLE_MSB -#define POWER_REG_CPU_INT_ENABLE_LSB WLAN_POWER_REG_CPU_INT_ENABLE_LSB -#define POWER_REG_CPU_INT_ENABLE_MASK WLAN_POWER_REG_CPU_INT_ENABLE_MASK -#define POWER_REG_CPU_INT_ENABLE_GET(x) WLAN_POWER_REG_CPU_INT_ENABLE_GET(x) -#define POWER_REG_CPU_INT_ENABLE_SET(x) WLAN_POWER_REG_CPU_INT_ENABLE_SET(x) -#define POWER_REG_WLAN_ISO_DIS_MSB WLAN_POWER_REG_WLAN_ISO_DIS_MSB -#define POWER_REG_WLAN_ISO_DIS_LSB WLAN_POWER_REG_WLAN_ISO_DIS_LSB -#define POWER_REG_WLAN_ISO_DIS_MASK WLAN_POWER_REG_WLAN_ISO_DIS_MASK -#define POWER_REG_WLAN_ISO_DIS_GET(x) WLAN_POWER_REG_WLAN_ISO_DIS_GET(x) -#define POWER_REG_WLAN_ISO_DIS_SET(x) WLAN_POWER_REG_WLAN_ISO_DIS_SET(x) -#define POWER_REG_WLAN_ISO_CNTL_MSB WLAN_POWER_REG_WLAN_ISO_CNTL_MSB -#define POWER_REG_WLAN_ISO_CNTL_LSB WLAN_POWER_REG_WLAN_ISO_CNTL_LSB -#define POWER_REG_WLAN_ISO_CNTL_MASK WLAN_POWER_REG_WLAN_ISO_CNTL_MASK -#define POWER_REG_WLAN_ISO_CNTL_GET(x) WLAN_POWER_REG_WLAN_ISO_CNTL_GET(x) -#define POWER_REG_WLAN_ISO_CNTL_SET(x) WLAN_POWER_REG_WLAN_ISO_CNTL_SET(x) -#define POWER_REG_RADIO_PWD_EN_MSB WLAN_POWER_REG_RADIO_PWD_EN_MSB -#define POWER_REG_RADIO_PWD_EN_LSB WLAN_POWER_REG_RADIO_PWD_EN_LSB -#define POWER_REG_RADIO_PWD_EN_MASK WLAN_POWER_REG_RADIO_PWD_EN_MASK -#define POWER_REG_RADIO_PWD_EN_GET(x) WLAN_POWER_REG_RADIO_PWD_EN_GET(x) -#define POWER_REG_RADIO_PWD_EN_SET(x) WLAN_POWER_REG_RADIO_PWD_EN_SET(x) -#define POWER_REG_SOC_ISO_EN_MSB WLAN_POWER_REG_SOC_ISO_EN_MSB -#define POWER_REG_SOC_ISO_EN_LSB WLAN_POWER_REG_SOC_ISO_EN_LSB -#define POWER_REG_SOC_ISO_EN_MASK WLAN_POWER_REG_SOC_ISO_EN_MASK -#define POWER_REG_SOC_ISO_EN_GET(x) WLAN_POWER_REG_SOC_ISO_EN_GET(x) -#define POWER_REG_SOC_ISO_EN_SET(x) WLAN_POWER_REG_SOC_ISO_EN_SET(x) -#define POWER_REG_WLAN_ISO_EN_MSB WLAN_POWER_REG_WLAN_ISO_EN_MSB -#define POWER_REG_WLAN_ISO_EN_LSB WLAN_POWER_REG_WLAN_ISO_EN_LSB -#define POWER_REG_WLAN_ISO_EN_MASK WLAN_POWER_REG_WLAN_ISO_EN_MASK -#define POWER_REG_WLAN_ISO_EN_GET(x) WLAN_POWER_REG_WLAN_ISO_EN_GET(x) -#define POWER_REG_WLAN_ISO_EN_SET(x) WLAN_POWER_REG_WLAN_ISO_EN_SET(x) -#define POWER_REG_WLAN_PWD_EN_MSB WLAN_POWER_REG_WLAN_PWD_EN_MSB -#define POWER_REG_WLAN_PWD_EN_LSB WLAN_POWER_REG_WLAN_PWD_EN_LSB -#define POWER_REG_WLAN_PWD_EN_MASK WLAN_POWER_REG_WLAN_PWD_EN_MASK -#define POWER_REG_WLAN_PWD_EN_GET(x) WLAN_POWER_REG_WLAN_PWD_EN_GET(x) -#define POWER_REG_WLAN_PWD_EN_SET(x) WLAN_POWER_REG_WLAN_PWD_EN_SET(x) -#define POWER_REG_POWER_EN_MSB WLAN_POWER_REG_POWER_EN_MSB -#define POWER_REG_POWER_EN_LSB WLAN_POWER_REG_POWER_EN_LSB -#define POWER_REG_POWER_EN_MASK WLAN_POWER_REG_POWER_EN_MASK -#define POWER_REG_POWER_EN_GET(x) WLAN_POWER_REG_POWER_EN_GET(x) -#define POWER_REG_POWER_EN_SET(x) WLAN_POWER_REG_POWER_EN_SET(x) -#define CORE_CLK_CTRL_ADDRESS WLAN_CORE_CLK_CTRL_ADDRESS -#define CORE_CLK_CTRL_OFFSET WLAN_CORE_CLK_CTRL_OFFSET -#define CORE_CLK_CTRL_DIV_MSB WLAN_CORE_CLK_CTRL_DIV_MSB -#define CORE_CLK_CTRL_DIV_LSB WLAN_CORE_CLK_CTRL_DIV_LSB -#define CORE_CLK_CTRL_DIV_MASK WLAN_CORE_CLK_CTRL_DIV_MASK -#define CORE_CLK_CTRL_DIV_GET(x) WLAN_CORE_CLK_CTRL_DIV_GET(x) -#define CORE_CLK_CTRL_DIV_SET(x) WLAN_CORE_CLK_CTRL_DIV_SET(x) -#define GPIO_WAKEUP_CONTROL_ADDRESS WLAN_GPIO_WAKEUP_CONTROL_ADDRESS -#define GPIO_WAKEUP_CONTROL_OFFSET WLAN_GPIO_WAKEUP_CONTROL_OFFSET -#define GPIO_WAKEUP_CONTROL_ENABLE_MSB WLAN_GPIO_WAKEUP_CONTROL_ENABLE_MSB -#define GPIO_WAKEUP_CONTROL_ENABLE_LSB WLAN_GPIO_WAKEUP_CONTROL_ENABLE_LSB -#define GPIO_WAKEUP_CONTROL_ENABLE_MASK WLAN_GPIO_WAKEUP_CONTROL_ENABLE_MASK -#define GPIO_WAKEUP_CONTROL_ENABLE_GET(x) WLAN_GPIO_WAKEUP_CONTROL_ENABLE_GET(x) -#define GPIO_WAKEUP_CONTROL_ENABLE_SET(x) WLAN_GPIO_WAKEUP_CONTROL_ENABLE_SET(x) - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/rtc_wlan_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/rtc_wlan_reg.h deleted file mode 100644 index b7eb62d255fd..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/rtc_wlan_reg.h +++ /dev/null @@ -1,2065 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _RTC_WLAN_REG_REG_H_ -#define _RTC_WLAN_REG_REG_H_ - -#define WLAN_RESET_CONTROL_ADDRESS 0x00000000 -#define WLAN_RESET_CONTROL_OFFSET 0x00000000 -#define WLAN_RESET_CONTROL_DEBUG_UART_RST_MSB 14 -#define WLAN_RESET_CONTROL_DEBUG_UART_RST_LSB 14 -#define WLAN_RESET_CONTROL_DEBUG_UART_RST_MASK 0x00004000 -#define WLAN_RESET_CONTROL_DEBUG_UART_RST_GET(x) (((x) & WLAN_RESET_CONTROL_DEBUG_UART_RST_MASK) >> WLAN_RESET_CONTROL_DEBUG_UART_RST_LSB) -#define WLAN_RESET_CONTROL_DEBUG_UART_RST_SET(x) (((x) << WLAN_RESET_CONTROL_DEBUG_UART_RST_LSB) & WLAN_RESET_CONTROL_DEBUG_UART_RST_MASK) -#define WLAN_RESET_CONTROL_BB_COLD_RST_MSB 13 -#define WLAN_RESET_CONTROL_BB_COLD_RST_LSB 13 -#define WLAN_RESET_CONTROL_BB_COLD_RST_MASK 0x00002000 -#define WLAN_RESET_CONTROL_BB_COLD_RST_GET(x) (((x) & WLAN_RESET_CONTROL_BB_COLD_RST_MASK) >> WLAN_RESET_CONTROL_BB_COLD_RST_LSB) -#define WLAN_RESET_CONTROL_BB_COLD_RST_SET(x) (((x) << WLAN_RESET_CONTROL_BB_COLD_RST_LSB) & WLAN_RESET_CONTROL_BB_COLD_RST_MASK) -#define WLAN_RESET_CONTROL_BB_WARM_RST_MSB 12 -#define WLAN_RESET_CONTROL_BB_WARM_RST_LSB 12 -#define WLAN_RESET_CONTROL_BB_WARM_RST_MASK 0x00001000 -#define WLAN_RESET_CONTROL_BB_WARM_RST_GET(x) (((x) & WLAN_RESET_CONTROL_BB_WARM_RST_MASK) >> WLAN_RESET_CONTROL_BB_WARM_RST_LSB) -#define WLAN_RESET_CONTROL_BB_WARM_RST_SET(x) (((x) << WLAN_RESET_CONTROL_BB_WARM_RST_LSB) & WLAN_RESET_CONTROL_BB_WARM_RST_MASK) -#define WLAN_RESET_CONTROL_CPU_INIT_RESET_MSB 11 -#define WLAN_RESET_CONTROL_CPU_INIT_RESET_LSB 11 -#define WLAN_RESET_CONTROL_CPU_INIT_RESET_MASK 0x00000800 -#define WLAN_RESET_CONTROL_CPU_INIT_RESET_GET(x) (((x) & WLAN_RESET_CONTROL_CPU_INIT_RESET_MASK) >> WLAN_RESET_CONTROL_CPU_INIT_RESET_LSB) -#define WLAN_RESET_CONTROL_CPU_INIT_RESET_SET(x) (((x) << WLAN_RESET_CONTROL_CPU_INIT_RESET_LSB) & WLAN_RESET_CONTROL_CPU_INIT_RESET_MASK) -#define WLAN_RESET_CONTROL_VMC_REMAP_RESET_MSB 10 -#define WLAN_RESET_CONTROL_VMC_REMAP_RESET_LSB 10 -#define WLAN_RESET_CONTROL_VMC_REMAP_RESET_MASK 0x00000400 -#define WLAN_RESET_CONTROL_VMC_REMAP_RESET_GET(x) (((x) & WLAN_RESET_CONTROL_VMC_REMAP_RESET_MASK) >> WLAN_RESET_CONTROL_VMC_REMAP_RESET_LSB) -#define WLAN_RESET_CONTROL_VMC_REMAP_RESET_SET(x) (((x) << WLAN_RESET_CONTROL_VMC_REMAP_RESET_LSB) & WLAN_RESET_CONTROL_VMC_REMAP_RESET_MASK) -#define WLAN_RESET_CONTROL_RST_OUT_MSB 9 -#define WLAN_RESET_CONTROL_RST_OUT_LSB 9 -#define WLAN_RESET_CONTROL_RST_OUT_MASK 0x00000200 -#define WLAN_RESET_CONTROL_RST_OUT_GET(x) (((x) & WLAN_RESET_CONTROL_RST_OUT_MASK) >> WLAN_RESET_CONTROL_RST_OUT_LSB) -#define WLAN_RESET_CONTROL_RST_OUT_SET(x) (((x) << WLAN_RESET_CONTROL_RST_OUT_LSB) & WLAN_RESET_CONTROL_RST_OUT_MASK) -#define WLAN_RESET_CONTROL_COLD_RST_MSB 8 -#define WLAN_RESET_CONTROL_COLD_RST_LSB 8 -#define WLAN_RESET_CONTROL_COLD_RST_MASK 0x00000100 -#define WLAN_RESET_CONTROL_COLD_RST_GET(x) (((x) & WLAN_RESET_CONTROL_COLD_RST_MASK) >> WLAN_RESET_CONTROL_COLD_RST_LSB) -#define WLAN_RESET_CONTROL_COLD_RST_SET(x) (((x) << WLAN_RESET_CONTROL_COLD_RST_LSB) & WLAN_RESET_CONTROL_COLD_RST_MASK) -#define WLAN_RESET_CONTROL_WARM_RST_MSB 7 -#define WLAN_RESET_CONTROL_WARM_RST_LSB 7 -#define WLAN_RESET_CONTROL_WARM_RST_MASK 0x00000080 -#define WLAN_RESET_CONTROL_WARM_RST_GET(x) (((x) & WLAN_RESET_CONTROL_WARM_RST_MASK) >> WLAN_RESET_CONTROL_WARM_RST_LSB) -#define WLAN_RESET_CONTROL_WARM_RST_SET(x) (((x) << WLAN_RESET_CONTROL_WARM_RST_LSB) & WLAN_RESET_CONTROL_WARM_RST_MASK) -#define WLAN_RESET_CONTROL_CPU_WARM_RST_MSB 6 -#define WLAN_RESET_CONTROL_CPU_WARM_RST_LSB 6 -#define WLAN_RESET_CONTROL_CPU_WARM_RST_MASK 0x00000040 -#define WLAN_RESET_CONTROL_CPU_WARM_RST_GET(x) (((x) & WLAN_RESET_CONTROL_CPU_WARM_RST_MASK) >> WLAN_RESET_CONTROL_CPU_WARM_RST_LSB) -#define WLAN_RESET_CONTROL_CPU_WARM_RST_SET(x) (((x) << WLAN_RESET_CONTROL_CPU_WARM_RST_LSB) & WLAN_RESET_CONTROL_CPU_WARM_RST_MASK) -#define WLAN_RESET_CONTROL_MAC_COLD_RST_MSB 5 -#define WLAN_RESET_CONTROL_MAC_COLD_RST_LSB 5 -#define WLAN_RESET_CONTROL_MAC_COLD_RST_MASK 0x00000020 -#define WLAN_RESET_CONTROL_MAC_COLD_RST_GET(x) (((x) & WLAN_RESET_CONTROL_MAC_COLD_RST_MASK) >> WLAN_RESET_CONTROL_MAC_COLD_RST_LSB) -#define WLAN_RESET_CONTROL_MAC_COLD_RST_SET(x) (((x) << WLAN_RESET_CONTROL_MAC_COLD_RST_LSB) & WLAN_RESET_CONTROL_MAC_COLD_RST_MASK) -#define WLAN_RESET_CONTROL_MAC_WARM_RST_MSB 4 -#define WLAN_RESET_CONTROL_MAC_WARM_RST_LSB 4 -#define WLAN_RESET_CONTROL_MAC_WARM_RST_MASK 0x00000010 -#define WLAN_RESET_CONTROL_MAC_WARM_RST_GET(x) (((x) & WLAN_RESET_CONTROL_MAC_WARM_RST_MASK) >> WLAN_RESET_CONTROL_MAC_WARM_RST_LSB) -#define WLAN_RESET_CONTROL_MAC_WARM_RST_SET(x) (((x) << WLAN_RESET_CONTROL_MAC_WARM_RST_LSB) & WLAN_RESET_CONTROL_MAC_WARM_RST_MASK) -#define WLAN_RESET_CONTROL_MBOX_RST_MSB 2 -#define WLAN_RESET_CONTROL_MBOX_RST_LSB 2 -#define WLAN_RESET_CONTROL_MBOX_RST_MASK 0x00000004 -#define WLAN_RESET_CONTROL_MBOX_RST_GET(x) (((x) & WLAN_RESET_CONTROL_MBOX_RST_MASK) >> WLAN_RESET_CONTROL_MBOX_RST_LSB) -#define WLAN_RESET_CONTROL_MBOX_RST_SET(x) (((x) << WLAN_RESET_CONTROL_MBOX_RST_LSB) & WLAN_RESET_CONTROL_MBOX_RST_MASK) -#define WLAN_RESET_CONTROL_UART_RST_MSB 1 -#define WLAN_RESET_CONTROL_UART_RST_LSB 1 -#define WLAN_RESET_CONTROL_UART_RST_MASK 0x00000002 -#define WLAN_RESET_CONTROL_UART_RST_GET(x) (((x) & WLAN_RESET_CONTROL_UART_RST_MASK) >> WLAN_RESET_CONTROL_UART_RST_LSB) -#define WLAN_RESET_CONTROL_UART_RST_SET(x) (((x) << WLAN_RESET_CONTROL_UART_RST_LSB) & WLAN_RESET_CONTROL_UART_RST_MASK) -#define WLAN_RESET_CONTROL_SI0_RST_MSB 0 -#define WLAN_RESET_CONTROL_SI0_RST_LSB 0 -#define WLAN_RESET_CONTROL_SI0_RST_MASK 0x00000001 -#define WLAN_RESET_CONTROL_SI0_RST_GET(x) (((x) & WLAN_RESET_CONTROL_SI0_RST_MASK) >> WLAN_RESET_CONTROL_SI0_RST_LSB) -#define WLAN_RESET_CONTROL_SI0_RST_SET(x) (((x) << WLAN_RESET_CONTROL_SI0_RST_LSB) & WLAN_RESET_CONTROL_SI0_RST_MASK) - -#define WLAN_XTAL_CONTROL_ADDRESS 0x00000004 -#define WLAN_XTAL_CONTROL_OFFSET 0x00000004 -#define WLAN_XTAL_CONTROL_TCXO_MSB 0 -#define WLAN_XTAL_CONTROL_TCXO_LSB 0 -#define WLAN_XTAL_CONTROL_TCXO_MASK 0x00000001 -#define WLAN_XTAL_CONTROL_TCXO_GET(x) (((x) & WLAN_XTAL_CONTROL_TCXO_MASK) >> WLAN_XTAL_CONTROL_TCXO_LSB) -#define WLAN_XTAL_CONTROL_TCXO_SET(x) (((x) << WLAN_XTAL_CONTROL_TCXO_LSB) & WLAN_XTAL_CONTROL_TCXO_MASK) - -#define WLAN_TCXO_DETECT_ADDRESS 0x00000008 -#define WLAN_TCXO_DETECT_OFFSET 0x00000008 -#define WLAN_TCXO_DETECT_PRESENT_MSB 0 -#define WLAN_TCXO_DETECT_PRESENT_LSB 0 -#define WLAN_TCXO_DETECT_PRESENT_MASK 0x00000001 -#define WLAN_TCXO_DETECT_PRESENT_GET(x) (((x) & WLAN_TCXO_DETECT_PRESENT_MASK) >> WLAN_TCXO_DETECT_PRESENT_LSB) -#define WLAN_TCXO_DETECT_PRESENT_SET(x) (((x) << WLAN_TCXO_DETECT_PRESENT_LSB) & WLAN_TCXO_DETECT_PRESENT_MASK) - -#define WLAN_XTAL_TEST_ADDRESS 0x0000000c -#define WLAN_XTAL_TEST_OFFSET 0x0000000c -#define WLAN_XTAL_TEST_NOTCXODET_MSB 0 -#define WLAN_XTAL_TEST_NOTCXODET_LSB 0 -#define WLAN_XTAL_TEST_NOTCXODET_MASK 0x00000001 -#define WLAN_XTAL_TEST_NOTCXODET_GET(x) (((x) & WLAN_XTAL_TEST_NOTCXODET_MASK) >> WLAN_XTAL_TEST_NOTCXODET_LSB) -#define WLAN_XTAL_TEST_NOTCXODET_SET(x) (((x) << WLAN_XTAL_TEST_NOTCXODET_LSB) & WLAN_XTAL_TEST_NOTCXODET_MASK) - -#define WLAN_QUADRATURE_ADDRESS 0x00000010 -#define WLAN_QUADRATURE_OFFSET 0x00000010 -#define WLAN_QUADRATURE_ADC_MSB 7 -#define WLAN_QUADRATURE_ADC_LSB 4 -#define WLAN_QUADRATURE_ADC_MASK 0x000000f0 -#define WLAN_QUADRATURE_ADC_GET(x) (((x) & WLAN_QUADRATURE_ADC_MASK) >> WLAN_QUADRATURE_ADC_LSB) -#define WLAN_QUADRATURE_ADC_SET(x) (((x) << WLAN_QUADRATURE_ADC_LSB) & WLAN_QUADRATURE_ADC_MASK) -#define WLAN_QUADRATURE_SEL_MSB 2 -#define WLAN_QUADRATURE_SEL_LSB 2 -#define WLAN_QUADRATURE_SEL_MASK 0x00000004 -#define WLAN_QUADRATURE_SEL_GET(x) (((x) & WLAN_QUADRATURE_SEL_MASK) >> WLAN_QUADRATURE_SEL_LSB) -#define WLAN_QUADRATURE_SEL_SET(x) (((x) << WLAN_QUADRATURE_SEL_LSB) & WLAN_QUADRATURE_SEL_MASK) -#define WLAN_QUADRATURE_DAC_MSB 1 -#define WLAN_QUADRATURE_DAC_LSB 0 -#define WLAN_QUADRATURE_DAC_MASK 0x00000003 -#define WLAN_QUADRATURE_DAC_GET(x) (((x) & WLAN_QUADRATURE_DAC_MASK) >> WLAN_QUADRATURE_DAC_LSB) -#define WLAN_QUADRATURE_DAC_SET(x) (((x) << WLAN_QUADRATURE_DAC_LSB) & WLAN_QUADRATURE_DAC_MASK) - -#define WLAN_PLL_CONTROL_ADDRESS 0x00000014 -#define WLAN_PLL_CONTROL_OFFSET 0x00000014 -#define WLAN_PLL_CONTROL_DIG_TEST_CLK_MSB 20 -#define WLAN_PLL_CONTROL_DIG_TEST_CLK_LSB 20 -#define WLAN_PLL_CONTROL_DIG_TEST_CLK_MASK 0x00100000 -#define WLAN_PLL_CONTROL_DIG_TEST_CLK_GET(x) (((x) & WLAN_PLL_CONTROL_DIG_TEST_CLK_MASK) >> WLAN_PLL_CONTROL_DIG_TEST_CLK_LSB) -#define WLAN_PLL_CONTROL_DIG_TEST_CLK_SET(x) (((x) << WLAN_PLL_CONTROL_DIG_TEST_CLK_LSB) & WLAN_PLL_CONTROL_DIG_TEST_CLK_MASK) -#define WLAN_PLL_CONTROL_MAC_OVERRIDE_MSB 19 -#define WLAN_PLL_CONTROL_MAC_OVERRIDE_LSB 19 -#define WLAN_PLL_CONTROL_MAC_OVERRIDE_MASK 0x00080000 -#define WLAN_PLL_CONTROL_MAC_OVERRIDE_GET(x) (((x) & WLAN_PLL_CONTROL_MAC_OVERRIDE_MASK) >> WLAN_PLL_CONTROL_MAC_OVERRIDE_LSB) -#define WLAN_PLL_CONTROL_MAC_OVERRIDE_SET(x) (((x) << WLAN_PLL_CONTROL_MAC_OVERRIDE_LSB) & WLAN_PLL_CONTROL_MAC_OVERRIDE_MASK) -#define WLAN_PLL_CONTROL_NOPWD_MSB 18 -#define WLAN_PLL_CONTROL_NOPWD_LSB 18 -#define WLAN_PLL_CONTROL_NOPWD_MASK 0x00040000 -#define WLAN_PLL_CONTROL_NOPWD_GET(x) (((x) & WLAN_PLL_CONTROL_NOPWD_MASK) >> WLAN_PLL_CONTROL_NOPWD_LSB) -#define WLAN_PLL_CONTROL_NOPWD_SET(x) (((x) << WLAN_PLL_CONTROL_NOPWD_LSB) & WLAN_PLL_CONTROL_NOPWD_MASK) -#define WLAN_PLL_CONTROL_UPDATING_MSB 17 -#define WLAN_PLL_CONTROL_UPDATING_LSB 17 -#define WLAN_PLL_CONTROL_UPDATING_MASK 0x00020000 -#define WLAN_PLL_CONTROL_UPDATING_GET(x) (((x) & WLAN_PLL_CONTROL_UPDATING_MASK) >> WLAN_PLL_CONTROL_UPDATING_LSB) -#define WLAN_PLL_CONTROL_UPDATING_SET(x) (((x) << WLAN_PLL_CONTROL_UPDATING_LSB) & WLAN_PLL_CONTROL_UPDATING_MASK) -#define WLAN_PLL_CONTROL_BYPASS_MSB 16 -#define WLAN_PLL_CONTROL_BYPASS_LSB 16 -#define WLAN_PLL_CONTROL_BYPASS_MASK 0x00010000 -#define WLAN_PLL_CONTROL_BYPASS_GET(x) (((x) & WLAN_PLL_CONTROL_BYPASS_MASK) >> WLAN_PLL_CONTROL_BYPASS_LSB) -#define WLAN_PLL_CONTROL_BYPASS_SET(x) (((x) << WLAN_PLL_CONTROL_BYPASS_LSB) & WLAN_PLL_CONTROL_BYPASS_MASK) -#define WLAN_PLL_CONTROL_REFDIV_MSB 15 -#define WLAN_PLL_CONTROL_REFDIV_LSB 12 -#define WLAN_PLL_CONTROL_REFDIV_MASK 0x0000f000 -#define WLAN_PLL_CONTROL_REFDIV_GET(x) (((x) & WLAN_PLL_CONTROL_REFDIV_MASK) >> WLAN_PLL_CONTROL_REFDIV_LSB) -#define WLAN_PLL_CONTROL_REFDIV_SET(x) (((x) << WLAN_PLL_CONTROL_REFDIV_LSB) & WLAN_PLL_CONTROL_REFDIV_MASK) -#define WLAN_PLL_CONTROL_DIV_MSB 9 -#define WLAN_PLL_CONTROL_DIV_LSB 0 -#define WLAN_PLL_CONTROL_DIV_MASK 0x000003ff -#define WLAN_PLL_CONTROL_DIV_GET(x) (((x) & WLAN_PLL_CONTROL_DIV_MASK) >> WLAN_PLL_CONTROL_DIV_LSB) -#define WLAN_PLL_CONTROL_DIV_SET(x) (((x) << WLAN_PLL_CONTROL_DIV_LSB) & WLAN_PLL_CONTROL_DIV_MASK) - -#define WLAN_PLL_SETTLE_ADDRESS 0x00000018 -#define WLAN_PLL_SETTLE_OFFSET 0x00000018 -#define WLAN_PLL_SETTLE_TIME_MSB 11 -#define WLAN_PLL_SETTLE_TIME_LSB 0 -#define WLAN_PLL_SETTLE_TIME_MASK 0x00000fff -#define WLAN_PLL_SETTLE_TIME_GET(x) (((x) & WLAN_PLL_SETTLE_TIME_MASK) >> WLAN_PLL_SETTLE_TIME_LSB) -#define WLAN_PLL_SETTLE_TIME_SET(x) (((x) << WLAN_PLL_SETTLE_TIME_LSB) & WLAN_PLL_SETTLE_TIME_MASK) - -#define WLAN_XTAL_SETTLE_ADDRESS 0x0000001c -#define WLAN_XTAL_SETTLE_OFFSET 0x0000001c -#define WLAN_XTAL_SETTLE_TIME_MSB 7 -#define WLAN_XTAL_SETTLE_TIME_LSB 0 -#define WLAN_XTAL_SETTLE_TIME_MASK 0x000000ff -#define WLAN_XTAL_SETTLE_TIME_GET(x) (((x) & WLAN_XTAL_SETTLE_TIME_MASK) >> WLAN_XTAL_SETTLE_TIME_LSB) -#define WLAN_XTAL_SETTLE_TIME_SET(x) (((x) << WLAN_XTAL_SETTLE_TIME_LSB) & WLAN_XTAL_SETTLE_TIME_MASK) - -#define WLAN_CPU_CLOCK_ADDRESS 0x00000020 -#define WLAN_CPU_CLOCK_OFFSET 0x00000020 -#define WLAN_CPU_CLOCK_STANDARD_MSB 1 -#define WLAN_CPU_CLOCK_STANDARD_LSB 0 -#define WLAN_CPU_CLOCK_STANDARD_MASK 0x00000003 -#define WLAN_CPU_CLOCK_STANDARD_GET(x) (((x) & WLAN_CPU_CLOCK_STANDARD_MASK) >> WLAN_CPU_CLOCK_STANDARD_LSB) -#define WLAN_CPU_CLOCK_STANDARD_SET(x) (((x) << WLAN_CPU_CLOCK_STANDARD_LSB) & WLAN_CPU_CLOCK_STANDARD_MASK) - -#define WLAN_CLOCK_OUT_ADDRESS 0x00000024 -#define WLAN_CLOCK_OUT_OFFSET 0x00000024 -#define WLAN_CLOCK_OUT_SELECT_MSB 3 -#define WLAN_CLOCK_OUT_SELECT_LSB 0 -#define WLAN_CLOCK_OUT_SELECT_MASK 0x0000000f -#define WLAN_CLOCK_OUT_SELECT_GET(x) (((x) & WLAN_CLOCK_OUT_SELECT_MASK) >> WLAN_CLOCK_OUT_SELECT_LSB) -#define WLAN_CLOCK_OUT_SELECT_SET(x) (((x) << WLAN_CLOCK_OUT_SELECT_LSB) & WLAN_CLOCK_OUT_SELECT_MASK) - -#define WLAN_CLOCK_CONTROL_ADDRESS 0x00000028 -#define WLAN_CLOCK_CONTROL_OFFSET 0x00000028 -#define WLAN_CLOCK_CONTROL_LF_CLK32_MSB 2 -#define WLAN_CLOCK_CONTROL_LF_CLK32_LSB 2 -#define WLAN_CLOCK_CONTROL_LF_CLK32_MASK 0x00000004 -#define WLAN_CLOCK_CONTROL_LF_CLK32_GET(x) (((x) & WLAN_CLOCK_CONTROL_LF_CLK32_MASK) >> WLAN_CLOCK_CONTROL_LF_CLK32_LSB) -#define WLAN_CLOCK_CONTROL_LF_CLK32_SET(x) (((x) << WLAN_CLOCK_CONTROL_LF_CLK32_LSB) & WLAN_CLOCK_CONTROL_LF_CLK32_MASK) -#define WLAN_CLOCK_CONTROL_SI0_CLK_MSB 0 -#define WLAN_CLOCK_CONTROL_SI0_CLK_LSB 0 -#define WLAN_CLOCK_CONTROL_SI0_CLK_MASK 0x00000001 -#define WLAN_CLOCK_CONTROL_SI0_CLK_GET(x) (((x) & WLAN_CLOCK_CONTROL_SI0_CLK_MASK) >> WLAN_CLOCK_CONTROL_SI0_CLK_LSB) -#define WLAN_CLOCK_CONTROL_SI0_CLK_SET(x) (((x) << WLAN_CLOCK_CONTROL_SI0_CLK_LSB) & WLAN_CLOCK_CONTROL_SI0_CLK_MASK) - -#define WLAN_BIAS_OVERRIDE_ADDRESS 0x0000002c -#define WLAN_BIAS_OVERRIDE_OFFSET 0x0000002c -#define WLAN_BIAS_OVERRIDE_ON_MSB 0 -#define WLAN_BIAS_OVERRIDE_ON_LSB 0 -#define WLAN_BIAS_OVERRIDE_ON_MASK 0x00000001 -#define WLAN_BIAS_OVERRIDE_ON_GET(x) (((x) & WLAN_BIAS_OVERRIDE_ON_MASK) >> WLAN_BIAS_OVERRIDE_ON_LSB) -#define WLAN_BIAS_OVERRIDE_ON_SET(x) (((x) << WLAN_BIAS_OVERRIDE_ON_LSB) & WLAN_BIAS_OVERRIDE_ON_MASK) - -#define WLAN_WDT_CONTROL_ADDRESS 0x00000030 -#define WLAN_WDT_CONTROL_OFFSET 0x00000030 -#define WLAN_WDT_CONTROL_ACTION_MSB 2 -#define WLAN_WDT_CONTROL_ACTION_LSB 0 -#define WLAN_WDT_CONTROL_ACTION_MASK 0x00000007 -#define WLAN_WDT_CONTROL_ACTION_GET(x) (((x) & WLAN_WDT_CONTROL_ACTION_MASK) >> WLAN_WDT_CONTROL_ACTION_LSB) -#define WLAN_WDT_CONTROL_ACTION_SET(x) (((x) << WLAN_WDT_CONTROL_ACTION_LSB) & WLAN_WDT_CONTROL_ACTION_MASK) - -#define WLAN_WDT_STATUS_ADDRESS 0x00000034 -#define WLAN_WDT_STATUS_OFFSET 0x00000034 -#define WLAN_WDT_STATUS_INTERRUPT_MSB 0 -#define WLAN_WDT_STATUS_INTERRUPT_LSB 0 -#define WLAN_WDT_STATUS_INTERRUPT_MASK 0x00000001 -#define WLAN_WDT_STATUS_INTERRUPT_GET(x) (((x) & WLAN_WDT_STATUS_INTERRUPT_MASK) >> WLAN_WDT_STATUS_INTERRUPT_LSB) -#define WLAN_WDT_STATUS_INTERRUPT_SET(x) (((x) << WLAN_WDT_STATUS_INTERRUPT_LSB) & WLAN_WDT_STATUS_INTERRUPT_MASK) - -#define WLAN_WDT_ADDRESS 0x00000038 -#define WLAN_WDT_OFFSET 0x00000038 -#define WLAN_WDT_TARGET_MSB 21 -#define WLAN_WDT_TARGET_LSB 0 -#define WLAN_WDT_TARGET_MASK 0x003fffff -#define WLAN_WDT_TARGET_GET(x) (((x) & WLAN_WDT_TARGET_MASK) >> WLAN_WDT_TARGET_LSB) -#define WLAN_WDT_TARGET_SET(x) (((x) << WLAN_WDT_TARGET_LSB) & WLAN_WDT_TARGET_MASK) - -#define WLAN_WDT_COUNT_ADDRESS 0x0000003c -#define WLAN_WDT_COUNT_OFFSET 0x0000003c -#define WLAN_WDT_COUNT_VALUE_MSB 21 -#define WLAN_WDT_COUNT_VALUE_LSB 0 -#define WLAN_WDT_COUNT_VALUE_MASK 0x003fffff -#define WLAN_WDT_COUNT_VALUE_GET(x) (((x) & WLAN_WDT_COUNT_VALUE_MASK) >> WLAN_WDT_COUNT_VALUE_LSB) -#define WLAN_WDT_COUNT_VALUE_SET(x) (((x) << WLAN_WDT_COUNT_VALUE_LSB) & WLAN_WDT_COUNT_VALUE_MASK) - -#define WLAN_WDT_RESET_ADDRESS 0x00000040 -#define WLAN_WDT_RESET_OFFSET 0x00000040 -#define WLAN_WDT_RESET_VALUE_MSB 0 -#define WLAN_WDT_RESET_VALUE_LSB 0 -#define WLAN_WDT_RESET_VALUE_MASK 0x00000001 -#define WLAN_WDT_RESET_VALUE_GET(x) (((x) & WLAN_WDT_RESET_VALUE_MASK) >> WLAN_WDT_RESET_VALUE_LSB) -#define WLAN_WDT_RESET_VALUE_SET(x) (((x) << WLAN_WDT_RESET_VALUE_LSB) & WLAN_WDT_RESET_VALUE_MASK) - -#define WLAN_INT_STATUS_ADDRESS 0x00000044 -#define WLAN_INT_STATUS_OFFSET 0x00000044 -#define WLAN_INT_STATUS_HCI_UART_MSB 21 -#define WLAN_INT_STATUS_HCI_UART_LSB 21 -#define WLAN_INT_STATUS_HCI_UART_MASK 0x00200000 -#define WLAN_INT_STATUS_HCI_UART_GET(x) (((x) & WLAN_INT_STATUS_HCI_UART_MASK) >> WLAN_INT_STATUS_HCI_UART_LSB) -#define WLAN_INT_STATUS_HCI_UART_SET(x) (((x) << WLAN_INT_STATUS_HCI_UART_LSB) & WLAN_INT_STATUS_HCI_UART_MASK) -#define WLAN_INT_STATUS_THERM_MSB 20 -#define WLAN_INT_STATUS_THERM_LSB 20 -#define WLAN_INT_STATUS_THERM_MASK 0x00100000 -#define WLAN_INT_STATUS_THERM_GET(x) (((x) & WLAN_INT_STATUS_THERM_MASK) >> WLAN_INT_STATUS_THERM_LSB) -#define WLAN_INT_STATUS_THERM_SET(x) (((x) << WLAN_INT_STATUS_THERM_LSB) & WLAN_INT_STATUS_THERM_MASK) -#define WLAN_INT_STATUS_EFUSE_OVERWRITE_MSB 19 -#define WLAN_INT_STATUS_EFUSE_OVERWRITE_LSB 19 -#define WLAN_INT_STATUS_EFUSE_OVERWRITE_MASK 0x00080000 -#define WLAN_INT_STATUS_EFUSE_OVERWRITE_GET(x) (((x) & WLAN_INT_STATUS_EFUSE_OVERWRITE_MASK) >> WLAN_INT_STATUS_EFUSE_OVERWRITE_LSB) -#define WLAN_INT_STATUS_EFUSE_OVERWRITE_SET(x) (((x) << WLAN_INT_STATUS_EFUSE_OVERWRITE_LSB) & WLAN_INT_STATUS_EFUSE_OVERWRITE_MASK) -#define WLAN_INT_STATUS_UART_MBOX_MSB 18 -#define WLAN_INT_STATUS_UART_MBOX_LSB 18 -#define WLAN_INT_STATUS_UART_MBOX_MASK 0x00040000 -#define WLAN_INT_STATUS_UART_MBOX_GET(x) (((x) & WLAN_INT_STATUS_UART_MBOX_MASK) >> WLAN_INT_STATUS_UART_MBOX_LSB) -#define WLAN_INT_STATUS_UART_MBOX_SET(x) (((x) << WLAN_INT_STATUS_UART_MBOX_LSB) & WLAN_INT_STATUS_UART_MBOX_MASK) -#define WLAN_INT_STATUS_GENERIC_MBOX_MSB 17 -#define WLAN_INT_STATUS_GENERIC_MBOX_LSB 17 -#define WLAN_INT_STATUS_GENERIC_MBOX_MASK 0x00020000 -#define WLAN_INT_STATUS_GENERIC_MBOX_GET(x) (((x) & WLAN_INT_STATUS_GENERIC_MBOX_MASK) >> WLAN_INT_STATUS_GENERIC_MBOX_LSB) -#define WLAN_INT_STATUS_GENERIC_MBOX_SET(x) (((x) << WLAN_INT_STATUS_GENERIC_MBOX_LSB) & WLAN_INT_STATUS_GENERIC_MBOX_MASK) -#define WLAN_INT_STATUS_RDMA_MSB 16 -#define WLAN_INT_STATUS_RDMA_LSB 16 -#define WLAN_INT_STATUS_RDMA_MASK 0x00010000 -#define WLAN_INT_STATUS_RDMA_GET(x) (((x) & WLAN_INT_STATUS_RDMA_MASK) >> WLAN_INT_STATUS_RDMA_LSB) -#define WLAN_INT_STATUS_RDMA_SET(x) (((x) << WLAN_INT_STATUS_RDMA_LSB) & WLAN_INT_STATUS_RDMA_MASK) -#define WLAN_INT_STATUS_BTCOEX_MSB 15 -#define WLAN_INT_STATUS_BTCOEX_LSB 15 -#define WLAN_INT_STATUS_BTCOEX_MASK 0x00008000 -#define WLAN_INT_STATUS_BTCOEX_GET(x) (((x) & WLAN_INT_STATUS_BTCOEX_MASK) >> WLAN_INT_STATUS_BTCOEX_LSB) -#define WLAN_INT_STATUS_BTCOEX_SET(x) (((x) << WLAN_INT_STATUS_BTCOEX_LSB) & WLAN_INT_STATUS_BTCOEX_MASK) -#define WLAN_INT_STATUS_RTC_POWER_MSB 14 -#define WLAN_INT_STATUS_RTC_POWER_LSB 14 -#define WLAN_INT_STATUS_RTC_POWER_MASK 0x00004000 -#define WLAN_INT_STATUS_RTC_POWER_GET(x) (((x) & WLAN_INT_STATUS_RTC_POWER_MASK) >> WLAN_INT_STATUS_RTC_POWER_LSB) -#define WLAN_INT_STATUS_RTC_POWER_SET(x) (((x) << WLAN_INT_STATUS_RTC_POWER_LSB) & WLAN_INT_STATUS_RTC_POWER_MASK) -#define WLAN_INT_STATUS_MAC_MSB 13 -#define WLAN_INT_STATUS_MAC_LSB 13 -#define WLAN_INT_STATUS_MAC_MASK 0x00002000 -#define WLAN_INT_STATUS_MAC_GET(x) (((x) & WLAN_INT_STATUS_MAC_MASK) >> WLAN_INT_STATUS_MAC_LSB) -#define WLAN_INT_STATUS_MAC_SET(x) (((x) << WLAN_INT_STATUS_MAC_LSB) & WLAN_INT_STATUS_MAC_MASK) -#define WLAN_INT_STATUS_MAILBOX_MSB 12 -#define WLAN_INT_STATUS_MAILBOX_LSB 12 -#define WLAN_INT_STATUS_MAILBOX_MASK 0x00001000 -#define WLAN_INT_STATUS_MAILBOX_GET(x) (((x) & WLAN_INT_STATUS_MAILBOX_MASK) >> WLAN_INT_STATUS_MAILBOX_LSB) -#define WLAN_INT_STATUS_MAILBOX_SET(x) (((x) << WLAN_INT_STATUS_MAILBOX_LSB) & WLAN_INT_STATUS_MAILBOX_MASK) -#define WLAN_INT_STATUS_RTC_ALARM_MSB 11 -#define WLAN_INT_STATUS_RTC_ALARM_LSB 11 -#define WLAN_INT_STATUS_RTC_ALARM_MASK 0x00000800 -#define WLAN_INT_STATUS_RTC_ALARM_GET(x) (((x) & WLAN_INT_STATUS_RTC_ALARM_MASK) >> WLAN_INT_STATUS_RTC_ALARM_LSB) -#define WLAN_INT_STATUS_RTC_ALARM_SET(x) (((x) << WLAN_INT_STATUS_RTC_ALARM_LSB) & WLAN_INT_STATUS_RTC_ALARM_MASK) -#define WLAN_INT_STATUS_HF_TIMER_MSB 10 -#define WLAN_INT_STATUS_HF_TIMER_LSB 10 -#define WLAN_INT_STATUS_HF_TIMER_MASK 0x00000400 -#define WLAN_INT_STATUS_HF_TIMER_GET(x) (((x) & WLAN_INT_STATUS_HF_TIMER_MASK) >> WLAN_INT_STATUS_HF_TIMER_LSB) -#define WLAN_INT_STATUS_HF_TIMER_SET(x) (((x) << WLAN_INT_STATUS_HF_TIMER_LSB) & WLAN_INT_STATUS_HF_TIMER_MASK) -#define WLAN_INT_STATUS_LF_TIMER3_MSB 9 -#define WLAN_INT_STATUS_LF_TIMER3_LSB 9 -#define WLAN_INT_STATUS_LF_TIMER3_MASK 0x00000200 -#define WLAN_INT_STATUS_LF_TIMER3_GET(x) (((x) & WLAN_INT_STATUS_LF_TIMER3_MASK) >> WLAN_INT_STATUS_LF_TIMER3_LSB) -#define WLAN_INT_STATUS_LF_TIMER3_SET(x) (((x) << WLAN_INT_STATUS_LF_TIMER3_LSB) & WLAN_INT_STATUS_LF_TIMER3_MASK) -#define WLAN_INT_STATUS_LF_TIMER2_MSB 8 -#define WLAN_INT_STATUS_LF_TIMER2_LSB 8 -#define WLAN_INT_STATUS_LF_TIMER2_MASK 0x00000100 -#define WLAN_INT_STATUS_LF_TIMER2_GET(x) (((x) & WLAN_INT_STATUS_LF_TIMER2_MASK) >> WLAN_INT_STATUS_LF_TIMER2_LSB) -#define WLAN_INT_STATUS_LF_TIMER2_SET(x) (((x) << WLAN_INT_STATUS_LF_TIMER2_LSB) & WLAN_INT_STATUS_LF_TIMER2_MASK) -#define WLAN_INT_STATUS_LF_TIMER1_MSB 7 -#define WLAN_INT_STATUS_LF_TIMER1_LSB 7 -#define WLAN_INT_STATUS_LF_TIMER1_MASK 0x00000080 -#define WLAN_INT_STATUS_LF_TIMER1_GET(x) (((x) & WLAN_INT_STATUS_LF_TIMER1_MASK) >> WLAN_INT_STATUS_LF_TIMER1_LSB) -#define WLAN_INT_STATUS_LF_TIMER1_SET(x) (((x) << WLAN_INT_STATUS_LF_TIMER1_LSB) & WLAN_INT_STATUS_LF_TIMER1_MASK) -#define WLAN_INT_STATUS_LF_TIMER0_MSB 6 -#define WLAN_INT_STATUS_LF_TIMER0_LSB 6 -#define WLAN_INT_STATUS_LF_TIMER0_MASK 0x00000040 -#define WLAN_INT_STATUS_LF_TIMER0_GET(x) (((x) & WLAN_INT_STATUS_LF_TIMER0_MASK) >> WLAN_INT_STATUS_LF_TIMER0_LSB) -#define WLAN_INT_STATUS_LF_TIMER0_SET(x) (((x) << WLAN_INT_STATUS_LF_TIMER0_LSB) & WLAN_INT_STATUS_LF_TIMER0_MASK) -#define WLAN_INT_STATUS_KEYPAD_MSB 5 -#define WLAN_INT_STATUS_KEYPAD_LSB 5 -#define WLAN_INT_STATUS_KEYPAD_MASK 0x00000020 -#define WLAN_INT_STATUS_KEYPAD_GET(x) (((x) & WLAN_INT_STATUS_KEYPAD_MASK) >> WLAN_INT_STATUS_KEYPAD_LSB) -#define WLAN_INT_STATUS_KEYPAD_SET(x) (((x) << WLAN_INT_STATUS_KEYPAD_LSB) & WLAN_INT_STATUS_KEYPAD_MASK) -#define WLAN_INT_STATUS_SI_MSB 4 -#define WLAN_INT_STATUS_SI_LSB 4 -#define WLAN_INT_STATUS_SI_MASK 0x00000010 -#define WLAN_INT_STATUS_SI_GET(x) (((x) & WLAN_INT_STATUS_SI_MASK) >> WLAN_INT_STATUS_SI_LSB) -#define WLAN_INT_STATUS_SI_SET(x) (((x) << WLAN_INT_STATUS_SI_LSB) & WLAN_INT_STATUS_SI_MASK) -#define WLAN_INT_STATUS_GPIO_MSB 3 -#define WLAN_INT_STATUS_GPIO_LSB 3 -#define WLAN_INT_STATUS_GPIO_MASK 0x00000008 -#define WLAN_INT_STATUS_GPIO_GET(x) (((x) & WLAN_INT_STATUS_GPIO_MASK) >> WLAN_INT_STATUS_GPIO_LSB) -#define WLAN_INT_STATUS_GPIO_SET(x) (((x) << WLAN_INT_STATUS_GPIO_LSB) & WLAN_INT_STATUS_GPIO_MASK) -#define WLAN_INT_STATUS_UART_MSB 2 -#define WLAN_INT_STATUS_UART_LSB 2 -#define WLAN_INT_STATUS_UART_MASK 0x00000004 -#define WLAN_INT_STATUS_UART_GET(x) (((x) & WLAN_INT_STATUS_UART_MASK) >> WLAN_INT_STATUS_UART_LSB) -#define WLAN_INT_STATUS_UART_SET(x) (((x) << WLAN_INT_STATUS_UART_LSB) & WLAN_INT_STATUS_UART_MASK) -#define WLAN_INT_STATUS_ERROR_MSB 1 -#define WLAN_INT_STATUS_ERROR_LSB 1 -#define WLAN_INT_STATUS_ERROR_MASK 0x00000002 -#define WLAN_INT_STATUS_ERROR_GET(x) (((x) & WLAN_INT_STATUS_ERROR_MASK) >> WLAN_INT_STATUS_ERROR_LSB) -#define WLAN_INT_STATUS_ERROR_SET(x) (((x) << WLAN_INT_STATUS_ERROR_LSB) & WLAN_INT_STATUS_ERROR_MASK) -#define WLAN_INT_STATUS_WDT_INT_MSB 0 -#define WLAN_INT_STATUS_WDT_INT_LSB 0 -#define WLAN_INT_STATUS_WDT_INT_MASK 0x00000001 -#define WLAN_INT_STATUS_WDT_INT_GET(x) (((x) & WLAN_INT_STATUS_WDT_INT_MASK) >> WLAN_INT_STATUS_WDT_INT_LSB) -#define WLAN_INT_STATUS_WDT_INT_SET(x) (((x) << WLAN_INT_STATUS_WDT_INT_LSB) & WLAN_INT_STATUS_WDT_INT_MASK) - -#define WLAN_LF_TIMER0_ADDRESS 0x00000048 -#define WLAN_LF_TIMER0_OFFSET 0x00000048 -#define WLAN_LF_TIMER0_TARGET_MSB 31 -#define WLAN_LF_TIMER0_TARGET_LSB 0 -#define WLAN_LF_TIMER0_TARGET_MASK 0xffffffff -#define WLAN_LF_TIMER0_TARGET_GET(x) (((x) & WLAN_LF_TIMER0_TARGET_MASK) >> WLAN_LF_TIMER0_TARGET_LSB) -#define WLAN_LF_TIMER0_TARGET_SET(x) (((x) << WLAN_LF_TIMER0_TARGET_LSB) & WLAN_LF_TIMER0_TARGET_MASK) - -#define WLAN_LF_TIMER_COUNT0_ADDRESS 0x0000004c -#define WLAN_LF_TIMER_COUNT0_OFFSET 0x0000004c -#define WLAN_LF_TIMER_COUNT0_VALUE_MSB 31 -#define WLAN_LF_TIMER_COUNT0_VALUE_LSB 0 -#define WLAN_LF_TIMER_COUNT0_VALUE_MASK 0xffffffff -#define WLAN_LF_TIMER_COUNT0_VALUE_GET(x) (((x) & WLAN_LF_TIMER_COUNT0_VALUE_MASK) >> WLAN_LF_TIMER_COUNT0_VALUE_LSB) -#define WLAN_LF_TIMER_COUNT0_VALUE_SET(x) (((x) << WLAN_LF_TIMER_COUNT0_VALUE_LSB) & WLAN_LF_TIMER_COUNT0_VALUE_MASK) - -#define WLAN_LF_TIMER_CONTROL0_ADDRESS 0x00000050 -#define WLAN_LF_TIMER_CONTROL0_OFFSET 0x00000050 -#define WLAN_LF_TIMER_CONTROL0_ENABLE_MSB 2 -#define WLAN_LF_TIMER_CONTROL0_ENABLE_LSB 2 -#define WLAN_LF_TIMER_CONTROL0_ENABLE_MASK 0x00000004 -#define WLAN_LF_TIMER_CONTROL0_ENABLE_GET(x) (((x) & WLAN_LF_TIMER_CONTROL0_ENABLE_MASK) >> WLAN_LF_TIMER_CONTROL0_ENABLE_LSB) -#define WLAN_LF_TIMER_CONTROL0_ENABLE_SET(x) (((x) << WLAN_LF_TIMER_CONTROL0_ENABLE_LSB) & WLAN_LF_TIMER_CONTROL0_ENABLE_MASK) -#define WLAN_LF_TIMER_CONTROL0_AUTO_RESTART_MSB 1 -#define WLAN_LF_TIMER_CONTROL0_AUTO_RESTART_LSB 1 -#define WLAN_LF_TIMER_CONTROL0_AUTO_RESTART_MASK 0x00000002 -#define WLAN_LF_TIMER_CONTROL0_AUTO_RESTART_GET(x) (((x) & WLAN_LF_TIMER_CONTROL0_AUTO_RESTART_MASK) >> WLAN_LF_TIMER_CONTROL0_AUTO_RESTART_LSB) -#define WLAN_LF_TIMER_CONTROL0_AUTO_RESTART_SET(x) (((x) << WLAN_LF_TIMER_CONTROL0_AUTO_RESTART_LSB) & WLAN_LF_TIMER_CONTROL0_AUTO_RESTART_MASK) -#define WLAN_LF_TIMER_CONTROL0_RESET_MSB 0 -#define WLAN_LF_TIMER_CONTROL0_RESET_LSB 0 -#define WLAN_LF_TIMER_CONTROL0_RESET_MASK 0x00000001 -#define WLAN_LF_TIMER_CONTROL0_RESET_GET(x) (((x) & WLAN_LF_TIMER_CONTROL0_RESET_MASK) >> WLAN_LF_TIMER_CONTROL0_RESET_LSB) -#define WLAN_LF_TIMER_CONTROL0_RESET_SET(x) (((x) << WLAN_LF_TIMER_CONTROL0_RESET_LSB) & WLAN_LF_TIMER_CONTROL0_RESET_MASK) - -#define WLAN_LF_TIMER_STATUS0_ADDRESS 0x00000054 -#define WLAN_LF_TIMER_STATUS0_OFFSET 0x00000054 -#define WLAN_LF_TIMER_STATUS0_INTERRUPT_MSB 0 -#define WLAN_LF_TIMER_STATUS0_INTERRUPT_LSB 0 -#define WLAN_LF_TIMER_STATUS0_INTERRUPT_MASK 0x00000001 -#define WLAN_LF_TIMER_STATUS0_INTERRUPT_GET(x) (((x) & WLAN_LF_TIMER_STATUS0_INTERRUPT_MASK) >> WLAN_LF_TIMER_STATUS0_INTERRUPT_LSB) -#define WLAN_LF_TIMER_STATUS0_INTERRUPT_SET(x) (((x) << WLAN_LF_TIMER_STATUS0_INTERRUPT_LSB) & WLAN_LF_TIMER_STATUS0_INTERRUPT_MASK) - -#define WLAN_LF_TIMER1_ADDRESS 0x00000058 -#define WLAN_LF_TIMER1_OFFSET 0x00000058 -#define WLAN_LF_TIMER1_TARGET_MSB 31 -#define WLAN_LF_TIMER1_TARGET_LSB 0 -#define WLAN_LF_TIMER1_TARGET_MASK 0xffffffff -#define WLAN_LF_TIMER1_TARGET_GET(x) (((x) & WLAN_LF_TIMER1_TARGET_MASK) >> WLAN_LF_TIMER1_TARGET_LSB) -#define WLAN_LF_TIMER1_TARGET_SET(x) (((x) << WLAN_LF_TIMER1_TARGET_LSB) & WLAN_LF_TIMER1_TARGET_MASK) - -#define WLAN_LF_TIMER_COUNT1_ADDRESS 0x0000005c -#define WLAN_LF_TIMER_COUNT1_OFFSET 0x0000005c -#define WLAN_LF_TIMER_COUNT1_VALUE_MSB 31 -#define WLAN_LF_TIMER_COUNT1_VALUE_LSB 0 -#define WLAN_LF_TIMER_COUNT1_VALUE_MASK 0xffffffff -#define WLAN_LF_TIMER_COUNT1_VALUE_GET(x) (((x) & WLAN_LF_TIMER_COUNT1_VALUE_MASK) >> WLAN_LF_TIMER_COUNT1_VALUE_LSB) -#define WLAN_LF_TIMER_COUNT1_VALUE_SET(x) (((x) << WLAN_LF_TIMER_COUNT1_VALUE_LSB) & WLAN_LF_TIMER_COUNT1_VALUE_MASK) - -#define WLAN_LF_TIMER_CONTROL1_ADDRESS 0x00000060 -#define WLAN_LF_TIMER_CONTROL1_OFFSET 0x00000060 -#define WLAN_LF_TIMER_CONTROL1_ENABLE_MSB 2 -#define WLAN_LF_TIMER_CONTROL1_ENABLE_LSB 2 -#define WLAN_LF_TIMER_CONTROL1_ENABLE_MASK 0x00000004 -#define WLAN_LF_TIMER_CONTROL1_ENABLE_GET(x) (((x) & WLAN_LF_TIMER_CONTROL1_ENABLE_MASK) >> WLAN_LF_TIMER_CONTROL1_ENABLE_LSB) -#define WLAN_LF_TIMER_CONTROL1_ENABLE_SET(x) (((x) << WLAN_LF_TIMER_CONTROL1_ENABLE_LSB) & WLAN_LF_TIMER_CONTROL1_ENABLE_MASK) -#define WLAN_LF_TIMER_CONTROL1_AUTO_RESTART_MSB 1 -#define WLAN_LF_TIMER_CONTROL1_AUTO_RESTART_LSB 1 -#define WLAN_LF_TIMER_CONTROL1_AUTO_RESTART_MASK 0x00000002 -#define WLAN_LF_TIMER_CONTROL1_AUTO_RESTART_GET(x) (((x) & WLAN_LF_TIMER_CONTROL1_AUTO_RESTART_MASK) >> WLAN_LF_TIMER_CONTROL1_AUTO_RESTART_LSB) -#define WLAN_LF_TIMER_CONTROL1_AUTO_RESTART_SET(x) (((x) << WLAN_LF_TIMER_CONTROL1_AUTO_RESTART_LSB) & WLAN_LF_TIMER_CONTROL1_AUTO_RESTART_MASK) -#define WLAN_LF_TIMER_CONTROL1_RESET_MSB 0 -#define WLAN_LF_TIMER_CONTROL1_RESET_LSB 0 -#define WLAN_LF_TIMER_CONTROL1_RESET_MASK 0x00000001 -#define WLAN_LF_TIMER_CONTROL1_RESET_GET(x) (((x) & WLAN_LF_TIMER_CONTROL1_RESET_MASK) >> WLAN_LF_TIMER_CONTROL1_RESET_LSB) -#define WLAN_LF_TIMER_CONTROL1_RESET_SET(x) (((x) << WLAN_LF_TIMER_CONTROL1_RESET_LSB) & WLAN_LF_TIMER_CONTROL1_RESET_MASK) - -#define WLAN_LF_TIMER_STATUS1_ADDRESS 0x00000064 -#define WLAN_LF_TIMER_STATUS1_OFFSET 0x00000064 -#define WLAN_LF_TIMER_STATUS1_INTERRUPT_MSB 0 -#define WLAN_LF_TIMER_STATUS1_INTERRUPT_LSB 0 -#define WLAN_LF_TIMER_STATUS1_INTERRUPT_MASK 0x00000001 -#define WLAN_LF_TIMER_STATUS1_INTERRUPT_GET(x) (((x) & WLAN_LF_TIMER_STATUS1_INTERRUPT_MASK) >> WLAN_LF_TIMER_STATUS1_INTERRUPT_LSB) -#define WLAN_LF_TIMER_STATUS1_INTERRUPT_SET(x) (((x) << WLAN_LF_TIMER_STATUS1_INTERRUPT_LSB) & WLAN_LF_TIMER_STATUS1_INTERRUPT_MASK) - -#define WLAN_LF_TIMER2_ADDRESS 0x00000068 -#define WLAN_LF_TIMER2_OFFSET 0x00000068 -#define WLAN_LF_TIMER2_TARGET_MSB 31 -#define WLAN_LF_TIMER2_TARGET_LSB 0 -#define WLAN_LF_TIMER2_TARGET_MASK 0xffffffff -#define WLAN_LF_TIMER2_TARGET_GET(x) (((x) & WLAN_LF_TIMER2_TARGET_MASK) >> WLAN_LF_TIMER2_TARGET_LSB) -#define WLAN_LF_TIMER2_TARGET_SET(x) (((x) << WLAN_LF_TIMER2_TARGET_LSB) & WLAN_LF_TIMER2_TARGET_MASK) - -#define WLAN_LF_TIMER_COUNT2_ADDRESS 0x0000006c -#define WLAN_LF_TIMER_COUNT2_OFFSET 0x0000006c -#define WLAN_LF_TIMER_COUNT2_VALUE_MSB 31 -#define WLAN_LF_TIMER_COUNT2_VALUE_LSB 0 -#define WLAN_LF_TIMER_COUNT2_VALUE_MASK 0xffffffff -#define WLAN_LF_TIMER_COUNT2_VALUE_GET(x) (((x) & WLAN_LF_TIMER_COUNT2_VALUE_MASK) >> WLAN_LF_TIMER_COUNT2_VALUE_LSB) -#define WLAN_LF_TIMER_COUNT2_VALUE_SET(x) (((x) << WLAN_LF_TIMER_COUNT2_VALUE_LSB) & WLAN_LF_TIMER_COUNT2_VALUE_MASK) - -#define WLAN_LF_TIMER_CONTROL2_ADDRESS 0x00000070 -#define WLAN_LF_TIMER_CONTROL2_OFFSET 0x00000070 -#define WLAN_LF_TIMER_CONTROL2_ENABLE_MSB 2 -#define WLAN_LF_TIMER_CONTROL2_ENABLE_LSB 2 -#define WLAN_LF_TIMER_CONTROL2_ENABLE_MASK 0x00000004 -#define WLAN_LF_TIMER_CONTROL2_ENABLE_GET(x) (((x) & WLAN_LF_TIMER_CONTROL2_ENABLE_MASK) >> WLAN_LF_TIMER_CONTROL2_ENABLE_LSB) -#define WLAN_LF_TIMER_CONTROL2_ENABLE_SET(x) (((x) << WLAN_LF_TIMER_CONTROL2_ENABLE_LSB) & WLAN_LF_TIMER_CONTROL2_ENABLE_MASK) -#define WLAN_LF_TIMER_CONTROL2_AUTO_RESTART_MSB 1 -#define WLAN_LF_TIMER_CONTROL2_AUTO_RESTART_LSB 1 -#define WLAN_LF_TIMER_CONTROL2_AUTO_RESTART_MASK 0x00000002 -#define WLAN_LF_TIMER_CONTROL2_AUTO_RESTART_GET(x) (((x) & WLAN_LF_TIMER_CONTROL2_AUTO_RESTART_MASK) >> WLAN_LF_TIMER_CONTROL2_AUTO_RESTART_LSB) -#define WLAN_LF_TIMER_CONTROL2_AUTO_RESTART_SET(x) (((x) << WLAN_LF_TIMER_CONTROL2_AUTO_RESTART_LSB) & WLAN_LF_TIMER_CONTROL2_AUTO_RESTART_MASK) -#define WLAN_LF_TIMER_CONTROL2_RESET_MSB 0 -#define WLAN_LF_TIMER_CONTROL2_RESET_LSB 0 -#define WLAN_LF_TIMER_CONTROL2_RESET_MASK 0x00000001 -#define WLAN_LF_TIMER_CONTROL2_RESET_GET(x) (((x) & WLAN_LF_TIMER_CONTROL2_RESET_MASK) >> WLAN_LF_TIMER_CONTROL2_RESET_LSB) -#define WLAN_LF_TIMER_CONTROL2_RESET_SET(x) (((x) << WLAN_LF_TIMER_CONTROL2_RESET_LSB) & WLAN_LF_TIMER_CONTROL2_RESET_MASK) - -#define WLAN_LF_TIMER_STATUS2_ADDRESS 0x00000074 -#define WLAN_LF_TIMER_STATUS2_OFFSET 0x00000074 -#define WLAN_LF_TIMER_STATUS2_INTERRUPT_MSB 0 -#define WLAN_LF_TIMER_STATUS2_INTERRUPT_LSB 0 -#define WLAN_LF_TIMER_STATUS2_INTERRUPT_MASK 0x00000001 -#define WLAN_LF_TIMER_STATUS2_INTERRUPT_GET(x) (((x) & WLAN_LF_TIMER_STATUS2_INTERRUPT_MASK) >> WLAN_LF_TIMER_STATUS2_INTERRUPT_LSB) -#define WLAN_LF_TIMER_STATUS2_INTERRUPT_SET(x) (((x) << WLAN_LF_TIMER_STATUS2_INTERRUPT_LSB) & WLAN_LF_TIMER_STATUS2_INTERRUPT_MASK) - -#define WLAN_LF_TIMER3_ADDRESS 0x00000078 -#define WLAN_LF_TIMER3_OFFSET 0x00000078 -#define WLAN_LF_TIMER3_TARGET_MSB 31 -#define WLAN_LF_TIMER3_TARGET_LSB 0 -#define WLAN_LF_TIMER3_TARGET_MASK 0xffffffff -#define WLAN_LF_TIMER3_TARGET_GET(x) (((x) & WLAN_LF_TIMER3_TARGET_MASK) >> WLAN_LF_TIMER3_TARGET_LSB) -#define WLAN_LF_TIMER3_TARGET_SET(x) (((x) << WLAN_LF_TIMER3_TARGET_LSB) & WLAN_LF_TIMER3_TARGET_MASK) - -#define WLAN_LF_TIMER_COUNT3_ADDRESS 0x0000007c -#define WLAN_LF_TIMER_COUNT3_OFFSET 0x0000007c -#define WLAN_LF_TIMER_COUNT3_VALUE_MSB 31 -#define WLAN_LF_TIMER_COUNT3_VALUE_LSB 0 -#define WLAN_LF_TIMER_COUNT3_VALUE_MASK 0xffffffff -#define WLAN_LF_TIMER_COUNT3_VALUE_GET(x) (((x) & WLAN_LF_TIMER_COUNT3_VALUE_MASK) >> WLAN_LF_TIMER_COUNT3_VALUE_LSB) -#define WLAN_LF_TIMER_COUNT3_VALUE_SET(x) (((x) << WLAN_LF_TIMER_COUNT3_VALUE_LSB) & WLAN_LF_TIMER_COUNT3_VALUE_MASK) - -#define WLAN_LF_TIMER_CONTROL3_ADDRESS 0x00000080 -#define WLAN_LF_TIMER_CONTROL3_OFFSET 0x00000080 -#define WLAN_LF_TIMER_CONTROL3_ENABLE_MSB 2 -#define WLAN_LF_TIMER_CONTROL3_ENABLE_LSB 2 -#define WLAN_LF_TIMER_CONTROL3_ENABLE_MASK 0x00000004 -#define WLAN_LF_TIMER_CONTROL3_ENABLE_GET(x) (((x) & WLAN_LF_TIMER_CONTROL3_ENABLE_MASK) >> WLAN_LF_TIMER_CONTROL3_ENABLE_LSB) -#define WLAN_LF_TIMER_CONTROL3_ENABLE_SET(x) (((x) << WLAN_LF_TIMER_CONTROL3_ENABLE_LSB) & WLAN_LF_TIMER_CONTROL3_ENABLE_MASK) -#define WLAN_LF_TIMER_CONTROL3_AUTO_RESTART_MSB 1 -#define WLAN_LF_TIMER_CONTROL3_AUTO_RESTART_LSB 1 -#define WLAN_LF_TIMER_CONTROL3_AUTO_RESTART_MASK 0x00000002 -#define WLAN_LF_TIMER_CONTROL3_AUTO_RESTART_GET(x) (((x) & WLAN_LF_TIMER_CONTROL3_AUTO_RESTART_MASK) >> WLAN_LF_TIMER_CONTROL3_AUTO_RESTART_LSB) -#define WLAN_LF_TIMER_CONTROL3_AUTO_RESTART_SET(x) (((x) << WLAN_LF_TIMER_CONTROL3_AUTO_RESTART_LSB) & WLAN_LF_TIMER_CONTROL3_AUTO_RESTART_MASK) -#define WLAN_LF_TIMER_CONTROL3_RESET_MSB 0 -#define WLAN_LF_TIMER_CONTROL3_RESET_LSB 0 -#define WLAN_LF_TIMER_CONTROL3_RESET_MASK 0x00000001 -#define WLAN_LF_TIMER_CONTROL3_RESET_GET(x) (((x) & WLAN_LF_TIMER_CONTROL3_RESET_MASK) >> WLAN_LF_TIMER_CONTROL3_RESET_LSB) -#define WLAN_LF_TIMER_CONTROL3_RESET_SET(x) (((x) << WLAN_LF_TIMER_CONTROL3_RESET_LSB) & WLAN_LF_TIMER_CONTROL3_RESET_MASK) - -#define WLAN_LF_TIMER_STATUS3_ADDRESS 0x00000084 -#define WLAN_LF_TIMER_STATUS3_OFFSET 0x00000084 -#define WLAN_LF_TIMER_STATUS3_INTERRUPT_MSB 0 -#define WLAN_LF_TIMER_STATUS3_INTERRUPT_LSB 0 -#define WLAN_LF_TIMER_STATUS3_INTERRUPT_MASK 0x00000001 -#define WLAN_LF_TIMER_STATUS3_INTERRUPT_GET(x) (((x) & WLAN_LF_TIMER_STATUS3_INTERRUPT_MASK) >> WLAN_LF_TIMER_STATUS3_INTERRUPT_LSB) -#define WLAN_LF_TIMER_STATUS3_INTERRUPT_SET(x) (((x) << WLAN_LF_TIMER_STATUS3_INTERRUPT_LSB) & WLAN_LF_TIMER_STATUS3_INTERRUPT_MASK) - -#define WLAN_HF_TIMER_ADDRESS 0x00000088 -#define WLAN_HF_TIMER_OFFSET 0x00000088 -#define WLAN_HF_TIMER_TARGET_MSB 31 -#define WLAN_HF_TIMER_TARGET_LSB 12 -#define WLAN_HF_TIMER_TARGET_MASK 0xfffff000 -#define WLAN_HF_TIMER_TARGET_GET(x) (((x) & WLAN_HF_TIMER_TARGET_MASK) >> WLAN_HF_TIMER_TARGET_LSB) -#define WLAN_HF_TIMER_TARGET_SET(x) (((x) << WLAN_HF_TIMER_TARGET_LSB) & WLAN_HF_TIMER_TARGET_MASK) - -#define WLAN_HF_TIMER_COUNT_ADDRESS 0x0000008c -#define WLAN_HF_TIMER_COUNT_OFFSET 0x0000008c -#define WLAN_HF_TIMER_COUNT_VALUE_MSB 31 -#define WLAN_HF_TIMER_COUNT_VALUE_LSB 12 -#define WLAN_HF_TIMER_COUNT_VALUE_MASK 0xfffff000 -#define WLAN_HF_TIMER_COUNT_VALUE_GET(x) (((x) & WLAN_HF_TIMER_COUNT_VALUE_MASK) >> WLAN_HF_TIMER_COUNT_VALUE_LSB) -#define WLAN_HF_TIMER_COUNT_VALUE_SET(x) (((x) << WLAN_HF_TIMER_COUNT_VALUE_LSB) & WLAN_HF_TIMER_COUNT_VALUE_MASK) - -#define WLAN_HF_LF_COUNT_ADDRESS 0x00000090 -#define WLAN_HF_LF_COUNT_OFFSET 0x00000090 -#define WLAN_HF_LF_COUNT_VALUE_MSB 31 -#define WLAN_HF_LF_COUNT_VALUE_LSB 0 -#define WLAN_HF_LF_COUNT_VALUE_MASK 0xffffffff -#define WLAN_HF_LF_COUNT_VALUE_GET(x) (((x) & WLAN_HF_LF_COUNT_VALUE_MASK) >> WLAN_HF_LF_COUNT_VALUE_LSB) -#define WLAN_HF_LF_COUNT_VALUE_SET(x) (((x) << WLAN_HF_LF_COUNT_VALUE_LSB) & WLAN_HF_LF_COUNT_VALUE_MASK) - -#define WLAN_HF_TIMER_CONTROL_ADDRESS 0x00000094 -#define WLAN_HF_TIMER_CONTROL_OFFSET 0x00000094 -#define WLAN_HF_TIMER_CONTROL_ENABLE_MSB 3 -#define WLAN_HF_TIMER_CONTROL_ENABLE_LSB 3 -#define WLAN_HF_TIMER_CONTROL_ENABLE_MASK 0x00000008 -#define WLAN_HF_TIMER_CONTROL_ENABLE_GET(x) (((x) & WLAN_HF_TIMER_CONTROL_ENABLE_MASK) >> WLAN_HF_TIMER_CONTROL_ENABLE_LSB) -#define WLAN_HF_TIMER_CONTROL_ENABLE_SET(x) (((x) << WLAN_HF_TIMER_CONTROL_ENABLE_LSB) & WLAN_HF_TIMER_CONTROL_ENABLE_MASK) -#define WLAN_HF_TIMER_CONTROL_ON_MSB 2 -#define WLAN_HF_TIMER_CONTROL_ON_LSB 2 -#define WLAN_HF_TIMER_CONTROL_ON_MASK 0x00000004 -#define WLAN_HF_TIMER_CONTROL_ON_GET(x) (((x) & WLAN_HF_TIMER_CONTROL_ON_MASK) >> WLAN_HF_TIMER_CONTROL_ON_LSB) -#define WLAN_HF_TIMER_CONTROL_ON_SET(x) (((x) << WLAN_HF_TIMER_CONTROL_ON_LSB) & WLAN_HF_TIMER_CONTROL_ON_MASK) -#define WLAN_HF_TIMER_CONTROL_AUTO_RESTART_MSB 1 -#define WLAN_HF_TIMER_CONTROL_AUTO_RESTART_LSB 1 -#define WLAN_HF_TIMER_CONTROL_AUTO_RESTART_MASK 0x00000002 -#define WLAN_HF_TIMER_CONTROL_AUTO_RESTART_GET(x) (((x) & WLAN_HF_TIMER_CONTROL_AUTO_RESTART_MASK) >> WLAN_HF_TIMER_CONTROL_AUTO_RESTART_LSB) -#define WLAN_HF_TIMER_CONTROL_AUTO_RESTART_SET(x) (((x) << WLAN_HF_TIMER_CONTROL_AUTO_RESTART_LSB) & WLAN_HF_TIMER_CONTROL_AUTO_RESTART_MASK) -#define WLAN_HF_TIMER_CONTROL_RESET_MSB 0 -#define WLAN_HF_TIMER_CONTROL_RESET_LSB 0 -#define WLAN_HF_TIMER_CONTROL_RESET_MASK 0x00000001 -#define WLAN_HF_TIMER_CONTROL_RESET_GET(x) (((x) & WLAN_HF_TIMER_CONTROL_RESET_MASK) >> WLAN_HF_TIMER_CONTROL_RESET_LSB) -#define WLAN_HF_TIMER_CONTROL_RESET_SET(x) (((x) << WLAN_HF_TIMER_CONTROL_RESET_LSB) & WLAN_HF_TIMER_CONTROL_RESET_MASK) - -#define WLAN_HF_TIMER_STATUS_ADDRESS 0x00000098 -#define WLAN_HF_TIMER_STATUS_OFFSET 0x00000098 -#define WLAN_HF_TIMER_STATUS_INTERRUPT_MSB 0 -#define WLAN_HF_TIMER_STATUS_INTERRUPT_LSB 0 -#define WLAN_HF_TIMER_STATUS_INTERRUPT_MASK 0x00000001 -#define WLAN_HF_TIMER_STATUS_INTERRUPT_GET(x) (((x) & WLAN_HF_TIMER_STATUS_INTERRUPT_MASK) >> WLAN_HF_TIMER_STATUS_INTERRUPT_LSB) -#define WLAN_HF_TIMER_STATUS_INTERRUPT_SET(x) (((x) << WLAN_HF_TIMER_STATUS_INTERRUPT_LSB) & WLAN_HF_TIMER_STATUS_INTERRUPT_MASK) - -#define WLAN_RTC_CONTROL_ADDRESS 0x0000009c -#define WLAN_RTC_CONTROL_OFFSET 0x0000009c -#define WLAN_RTC_CONTROL_ENABLE_MSB 2 -#define WLAN_RTC_CONTROL_ENABLE_LSB 2 -#define WLAN_RTC_CONTROL_ENABLE_MASK 0x00000004 -#define WLAN_RTC_CONTROL_ENABLE_GET(x) (((x) & WLAN_RTC_CONTROL_ENABLE_MASK) >> WLAN_RTC_CONTROL_ENABLE_LSB) -#define WLAN_RTC_CONTROL_ENABLE_SET(x) (((x) << WLAN_RTC_CONTROL_ENABLE_LSB) & WLAN_RTC_CONTROL_ENABLE_MASK) -#define WLAN_RTC_CONTROL_LOAD_RTC_MSB 1 -#define WLAN_RTC_CONTROL_LOAD_RTC_LSB 1 -#define WLAN_RTC_CONTROL_LOAD_RTC_MASK 0x00000002 -#define WLAN_RTC_CONTROL_LOAD_RTC_GET(x) (((x) & WLAN_RTC_CONTROL_LOAD_RTC_MASK) >> WLAN_RTC_CONTROL_LOAD_RTC_LSB) -#define WLAN_RTC_CONTROL_LOAD_RTC_SET(x) (((x) << WLAN_RTC_CONTROL_LOAD_RTC_LSB) & WLAN_RTC_CONTROL_LOAD_RTC_MASK) -#define WLAN_RTC_CONTROL_LOAD_ALARM_MSB 0 -#define WLAN_RTC_CONTROL_LOAD_ALARM_LSB 0 -#define WLAN_RTC_CONTROL_LOAD_ALARM_MASK 0x00000001 -#define WLAN_RTC_CONTROL_LOAD_ALARM_GET(x) (((x) & WLAN_RTC_CONTROL_LOAD_ALARM_MASK) >> WLAN_RTC_CONTROL_LOAD_ALARM_LSB) -#define WLAN_RTC_CONTROL_LOAD_ALARM_SET(x) (((x) << WLAN_RTC_CONTROL_LOAD_ALARM_LSB) & WLAN_RTC_CONTROL_LOAD_ALARM_MASK) - -#define WLAN_RTC_TIME_ADDRESS 0x000000a0 -#define WLAN_RTC_TIME_OFFSET 0x000000a0 -#define WLAN_RTC_TIME_WEEK_DAY_MSB 26 -#define WLAN_RTC_TIME_WEEK_DAY_LSB 24 -#define WLAN_RTC_TIME_WEEK_DAY_MASK 0x07000000 -#define WLAN_RTC_TIME_WEEK_DAY_GET(x) (((x) & WLAN_RTC_TIME_WEEK_DAY_MASK) >> WLAN_RTC_TIME_WEEK_DAY_LSB) -#define WLAN_RTC_TIME_WEEK_DAY_SET(x) (((x) << WLAN_RTC_TIME_WEEK_DAY_LSB) & WLAN_RTC_TIME_WEEK_DAY_MASK) -#define WLAN_RTC_TIME_HOUR_MSB 21 -#define WLAN_RTC_TIME_HOUR_LSB 16 -#define WLAN_RTC_TIME_HOUR_MASK 0x003f0000 -#define WLAN_RTC_TIME_HOUR_GET(x) (((x) & WLAN_RTC_TIME_HOUR_MASK) >> WLAN_RTC_TIME_HOUR_LSB) -#define WLAN_RTC_TIME_HOUR_SET(x) (((x) << WLAN_RTC_TIME_HOUR_LSB) & WLAN_RTC_TIME_HOUR_MASK) -#define WLAN_RTC_TIME_MINUTE_MSB 14 -#define WLAN_RTC_TIME_MINUTE_LSB 8 -#define WLAN_RTC_TIME_MINUTE_MASK 0x00007f00 -#define WLAN_RTC_TIME_MINUTE_GET(x) (((x) & WLAN_RTC_TIME_MINUTE_MASK) >> WLAN_RTC_TIME_MINUTE_LSB) -#define WLAN_RTC_TIME_MINUTE_SET(x) (((x) << WLAN_RTC_TIME_MINUTE_LSB) & WLAN_RTC_TIME_MINUTE_MASK) -#define WLAN_RTC_TIME_SECOND_MSB 6 -#define WLAN_RTC_TIME_SECOND_LSB 0 -#define WLAN_RTC_TIME_SECOND_MASK 0x0000007f -#define WLAN_RTC_TIME_SECOND_GET(x) (((x) & WLAN_RTC_TIME_SECOND_MASK) >> WLAN_RTC_TIME_SECOND_LSB) -#define WLAN_RTC_TIME_SECOND_SET(x) (((x) << WLAN_RTC_TIME_SECOND_LSB) & WLAN_RTC_TIME_SECOND_MASK) - -#define WLAN_RTC_DATE_ADDRESS 0x000000a4 -#define WLAN_RTC_DATE_OFFSET 0x000000a4 -#define WLAN_RTC_DATE_YEAR_MSB 23 -#define WLAN_RTC_DATE_YEAR_LSB 16 -#define WLAN_RTC_DATE_YEAR_MASK 0x00ff0000 -#define WLAN_RTC_DATE_YEAR_GET(x) (((x) & WLAN_RTC_DATE_YEAR_MASK) >> WLAN_RTC_DATE_YEAR_LSB) -#define WLAN_RTC_DATE_YEAR_SET(x) (((x) << WLAN_RTC_DATE_YEAR_LSB) & WLAN_RTC_DATE_YEAR_MASK) -#define WLAN_RTC_DATE_MONTH_MSB 12 -#define WLAN_RTC_DATE_MONTH_LSB 8 -#define WLAN_RTC_DATE_MONTH_MASK 0x00001f00 -#define WLAN_RTC_DATE_MONTH_GET(x) (((x) & WLAN_RTC_DATE_MONTH_MASK) >> WLAN_RTC_DATE_MONTH_LSB) -#define WLAN_RTC_DATE_MONTH_SET(x) (((x) << WLAN_RTC_DATE_MONTH_LSB) & WLAN_RTC_DATE_MONTH_MASK) -#define WLAN_RTC_DATE_MONTH_DAY_MSB 5 -#define WLAN_RTC_DATE_MONTH_DAY_LSB 0 -#define WLAN_RTC_DATE_MONTH_DAY_MASK 0x0000003f -#define WLAN_RTC_DATE_MONTH_DAY_GET(x) (((x) & WLAN_RTC_DATE_MONTH_DAY_MASK) >> WLAN_RTC_DATE_MONTH_DAY_LSB) -#define WLAN_RTC_DATE_MONTH_DAY_SET(x) (((x) << WLAN_RTC_DATE_MONTH_DAY_LSB) & WLAN_RTC_DATE_MONTH_DAY_MASK) - -#define WLAN_RTC_SET_TIME_ADDRESS 0x000000a8 -#define WLAN_RTC_SET_TIME_OFFSET 0x000000a8 -#define WLAN_RTC_SET_TIME_WEEK_DAY_MSB 26 -#define WLAN_RTC_SET_TIME_WEEK_DAY_LSB 24 -#define WLAN_RTC_SET_TIME_WEEK_DAY_MASK 0x07000000 -#define WLAN_RTC_SET_TIME_WEEK_DAY_GET(x) (((x) & WLAN_RTC_SET_TIME_WEEK_DAY_MASK) >> WLAN_RTC_SET_TIME_WEEK_DAY_LSB) -#define WLAN_RTC_SET_TIME_WEEK_DAY_SET(x) (((x) << WLAN_RTC_SET_TIME_WEEK_DAY_LSB) & WLAN_RTC_SET_TIME_WEEK_DAY_MASK) -#define WLAN_RTC_SET_TIME_HOUR_MSB 21 -#define WLAN_RTC_SET_TIME_HOUR_LSB 16 -#define WLAN_RTC_SET_TIME_HOUR_MASK 0x003f0000 -#define WLAN_RTC_SET_TIME_HOUR_GET(x) (((x) & WLAN_RTC_SET_TIME_HOUR_MASK) >> WLAN_RTC_SET_TIME_HOUR_LSB) -#define WLAN_RTC_SET_TIME_HOUR_SET(x) (((x) << WLAN_RTC_SET_TIME_HOUR_LSB) & WLAN_RTC_SET_TIME_HOUR_MASK) -#define WLAN_RTC_SET_TIME_MINUTE_MSB 14 -#define WLAN_RTC_SET_TIME_MINUTE_LSB 8 -#define WLAN_RTC_SET_TIME_MINUTE_MASK 0x00007f00 -#define WLAN_RTC_SET_TIME_MINUTE_GET(x) (((x) & WLAN_RTC_SET_TIME_MINUTE_MASK) >> WLAN_RTC_SET_TIME_MINUTE_LSB) -#define WLAN_RTC_SET_TIME_MINUTE_SET(x) (((x) << WLAN_RTC_SET_TIME_MINUTE_LSB) & WLAN_RTC_SET_TIME_MINUTE_MASK) -#define WLAN_RTC_SET_TIME_SECOND_MSB 6 -#define WLAN_RTC_SET_TIME_SECOND_LSB 0 -#define WLAN_RTC_SET_TIME_SECOND_MASK 0x0000007f -#define WLAN_RTC_SET_TIME_SECOND_GET(x) (((x) & WLAN_RTC_SET_TIME_SECOND_MASK) >> WLAN_RTC_SET_TIME_SECOND_LSB) -#define WLAN_RTC_SET_TIME_SECOND_SET(x) (((x) << WLAN_RTC_SET_TIME_SECOND_LSB) & WLAN_RTC_SET_TIME_SECOND_MASK) - -#define WLAN_RTC_SET_DATE_ADDRESS 0x000000ac -#define WLAN_RTC_SET_DATE_OFFSET 0x000000ac -#define WLAN_RTC_SET_DATE_YEAR_MSB 23 -#define WLAN_RTC_SET_DATE_YEAR_LSB 16 -#define WLAN_RTC_SET_DATE_YEAR_MASK 0x00ff0000 -#define WLAN_RTC_SET_DATE_YEAR_GET(x) (((x) & WLAN_RTC_SET_DATE_YEAR_MASK) >> WLAN_RTC_SET_DATE_YEAR_LSB) -#define WLAN_RTC_SET_DATE_YEAR_SET(x) (((x) << WLAN_RTC_SET_DATE_YEAR_LSB) & WLAN_RTC_SET_DATE_YEAR_MASK) -#define WLAN_RTC_SET_DATE_MONTH_MSB 12 -#define WLAN_RTC_SET_DATE_MONTH_LSB 8 -#define WLAN_RTC_SET_DATE_MONTH_MASK 0x00001f00 -#define WLAN_RTC_SET_DATE_MONTH_GET(x) (((x) & WLAN_RTC_SET_DATE_MONTH_MASK) >> WLAN_RTC_SET_DATE_MONTH_LSB) -#define WLAN_RTC_SET_DATE_MONTH_SET(x) (((x) << WLAN_RTC_SET_DATE_MONTH_LSB) & WLAN_RTC_SET_DATE_MONTH_MASK) -#define WLAN_RTC_SET_DATE_MONTH_DAY_MSB 5 -#define WLAN_RTC_SET_DATE_MONTH_DAY_LSB 0 -#define WLAN_RTC_SET_DATE_MONTH_DAY_MASK 0x0000003f -#define WLAN_RTC_SET_DATE_MONTH_DAY_GET(x) (((x) & WLAN_RTC_SET_DATE_MONTH_DAY_MASK) >> WLAN_RTC_SET_DATE_MONTH_DAY_LSB) -#define WLAN_RTC_SET_DATE_MONTH_DAY_SET(x) (((x) << WLAN_RTC_SET_DATE_MONTH_DAY_LSB) & WLAN_RTC_SET_DATE_MONTH_DAY_MASK) - -#define WLAN_RTC_SET_ALARM_ADDRESS 0x000000b0 -#define WLAN_RTC_SET_ALARM_OFFSET 0x000000b0 -#define WLAN_RTC_SET_ALARM_HOUR_MSB 21 -#define WLAN_RTC_SET_ALARM_HOUR_LSB 16 -#define WLAN_RTC_SET_ALARM_HOUR_MASK 0x003f0000 -#define WLAN_RTC_SET_ALARM_HOUR_GET(x) (((x) & WLAN_RTC_SET_ALARM_HOUR_MASK) >> WLAN_RTC_SET_ALARM_HOUR_LSB) -#define WLAN_RTC_SET_ALARM_HOUR_SET(x) (((x) << WLAN_RTC_SET_ALARM_HOUR_LSB) & WLAN_RTC_SET_ALARM_HOUR_MASK) -#define WLAN_RTC_SET_ALARM_MINUTE_MSB 14 -#define WLAN_RTC_SET_ALARM_MINUTE_LSB 8 -#define WLAN_RTC_SET_ALARM_MINUTE_MASK 0x00007f00 -#define WLAN_RTC_SET_ALARM_MINUTE_GET(x) (((x) & WLAN_RTC_SET_ALARM_MINUTE_MASK) >> WLAN_RTC_SET_ALARM_MINUTE_LSB) -#define WLAN_RTC_SET_ALARM_MINUTE_SET(x) (((x) << WLAN_RTC_SET_ALARM_MINUTE_LSB) & WLAN_RTC_SET_ALARM_MINUTE_MASK) -#define WLAN_RTC_SET_ALARM_SECOND_MSB 6 -#define WLAN_RTC_SET_ALARM_SECOND_LSB 0 -#define WLAN_RTC_SET_ALARM_SECOND_MASK 0x0000007f -#define WLAN_RTC_SET_ALARM_SECOND_GET(x) (((x) & WLAN_RTC_SET_ALARM_SECOND_MASK) >> WLAN_RTC_SET_ALARM_SECOND_LSB) -#define WLAN_RTC_SET_ALARM_SECOND_SET(x) (((x) << WLAN_RTC_SET_ALARM_SECOND_LSB) & WLAN_RTC_SET_ALARM_SECOND_MASK) - -#define WLAN_RTC_CONFIG_ADDRESS 0x000000b4 -#define WLAN_RTC_CONFIG_OFFSET 0x000000b4 -#define WLAN_RTC_CONFIG_BCD_MSB 2 -#define WLAN_RTC_CONFIG_BCD_LSB 2 -#define WLAN_RTC_CONFIG_BCD_MASK 0x00000004 -#define WLAN_RTC_CONFIG_BCD_GET(x) (((x) & WLAN_RTC_CONFIG_BCD_MASK) >> WLAN_RTC_CONFIG_BCD_LSB) -#define WLAN_RTC_CONFIG_BCD_SET(x) (((x) << WLAN_RTC_CONFIG_BCD_LSB) & WLAN_RTC_CONFIG_BCD_MASK) -#define WLAN_RTC_CONFIG_TWELVE_HOUR_MSB 1 -#define WLAN_RTC_CONFIG_TWELVE_HOUR_LSB 1 -#define WLAN_RTC_CONFIG_TWELVE_HOUR_MASK 0x00000002 -#define WLAN_RTC_CONFIG_TWELVE_HOUR_GET(x) (((x) & WLAN_RTC_CONFIG_TWELVE_HOUR_MASK) >> WLAN_RTC_CONFIG_TWELVE_HOUR_LSB) -#define WLAN_RTC_CONFIG_TWELVE_HOUR_SET(x) (((x) << WLAN_RTC_CONFIG_TWELVE_HOUR_LSB) & WLAN_RTC_CONFIG_TWELVE_HOUR_MASK) -#define WLAN_RTC_CONFIG_DSE_MSB 0 -#define WLAN_RTC_CONFIG_DSE_LSB 0 -#define WLAN_RTC_CONFIG_DSE_MASK 0x00000001 -#define WLAN_RTC_CONFIG_DSE_GET(x) (((x) & WLAN_RTC_CONFIG_DSE_MASK) >> WLAN_RTC_CONFIG_DSE_LSB) -#define WLAN_RTC_CONFIG_DSE_SET(x) (((x) << WLAN_RTC_CONFIG_DSE_LSB) & WLAN_RTC_CONFIG_DSE_MASK) - -#define WLAN_RTC_ALARM_STATUS_ADDRESS 0x000000b8 -#define WLAN_RTC_ALARM_STATUS_OFFSET 0x000000b8 -#define WLAN_RTC_ALARM_STATUS_ENABLE_MSB 1 -#define WLAN_RTC_ALARM_STATUS_ENABLE_LSB 1 -#define WLAN_RTC_ALARM_STATUS_ENABLE_MASK 0x00000002 -#define WLAN_RTC_ALARM_STATUS_ENABLE_GET(x) (((x) & WLAN_RTC_ALARM_STATUS_ENABLE_MASK) >> WLAN_RTC_ALARM_STATUS_ENABLE_LSB) -#define WLAN_RTC_ALARM_STATUS_ENABLE_SET(x) (((x) << WLAN_RTC_ALARM_STATUS_ENABLE_LSB) & WLAN_RTC_ALARM_STATUS_ENABLE_MASK) -#define WLAN_RTC_ALARM_STATUS_INTERRUPT_MSB 0 -#define WLAN_RTC_ALARM_STATUS_INTERRUPT_LSB 0 -#define WLAN_RTC_ALARM_STATUS_INTERRUPT_MASK 0x00000001 -#define WLAN_RTC_ALARM_STATUS_INTERRUPT_GET(x) (((x) & WLAN_RTC_ALARM_STATUS_INTERRUPT_MASK) >> WLAN_RTC_ALARM_STATUS_INTERRUPT_LSB) -#define WLAN_RTC_ALARM_STATUS_INTERRUPT_SET(x) (((x) << WLAN_RTC_ALARM_STATUS_INTERRUPT_LSB) & WLAN_RTC_ALARM_STATUS_INTERRUPT_MASK) - -#define WLAN_UART_WAKEUP_ADDRESS 0x000000bc -#define WLAN_UART_WAKEUP_OFFSET 0x000000bc -#define WLAN_UART_WAKEUP_ENABLE_MSB 0 -#define WLAN_UART_WAKEUP_ENABLE_LSB 0 -#define WLAN_UART_WAKEUP_ENABLE_MASK 0x00000001 -#define WLAN_UART_WAKEUP_ENABLE_GET(x) (((x) & WLAN_UART_WAKEUP_ENABLE_MASK) >> WLAN_UART_WAKEUP_ENABLE_LSB) -#define WLAN_UART_WAKEUP_ENABLE_SET(x) (((x) << WLAN_UART_WAKEUP_ENABLE_LSB) & WLAN_UART_WAKEUP_ENABLE_MASK) - -#define WLAN_RESET_CAUSE_ADDRESS 0x000000c0 -#define WLAN_RESET_CAUSE_OFFSET 0x000000c0 -#define WLAN_RESET_CAUSE_LAST_MSB 2 -#define WLAN_RESET_CAUSE_LAST_LSB 0 -#define WLAN_RESET_CAUSE_LAST_MASK 0x00000007 -#define WLAN_RESET_CAUSE_LAST_GET(x) (((x) & WLAN_RESET_CAUSE_LAST_MASK) >> WLAN_RESET_CAUSE_LAST_LSB) -#define WLAN_RESET_CAUSE_LAST_SET(x) (((x) << WLAN_RESET_CAUSE_LAST_LSB) & WLAN_RESET_CAUSE_LAST_MASK) - -#define WLAN_SYSTEM_SLEEP_ADDRESS 0x000000c4 -#define WLAN_SYSTEM_SLEEP_OFFSET 0x000000c4 -#define WLAN_SYSTEM_SLEEP_HOST_IF_MSB 4 -#define WLAN_SYSTEM_SLEEP_HOST_IF_LSB 4 -#define WLAN_SYSTEM_SLEEP_HOST_IF_MASK 0x00000010 -#define WLAN_SYSTEM_SLEEP_HOST_IF_GET(x) (((x) & WLAN_SYSTEM_SLEEP_HOST_IF_MASK) >> WLAN_SYSTEM_SLEEP_HOST_IF_LSB) -#define WLAN_SYSTEM_SLEEP_HOST_IF_SET(x) (((x) << WLAN_SYSTEM_SLEEP_HOST_IF_LSB) & WLAN_SYSTEM_SLEEP_HOST_IF_MASK) -#define WLAN_SYSTEM_SLEEP_MBOX_MSB 3 -#define WLAN_SYSTEM_SLEEP_MBOX_LSB 3 -#define WLAN_SYSTEM_SLEEP_MBOX_MASK 0x00000008 -#define WLAN_SYSTEM_SLEEP_MBOX_GET(x) (((x) & WLAN_SYSTEM_SLEEP_MBOX_MASK) >> WLAN_SYSTEM_SLEEP_MBOX_LSB) -#define WLAN_SYSTEM_SLEEP_MBOX_SET(x) (((x) << WLAN_SYSTEM_SLEEP_MBOX_LSB) & WLAN_SYSTEM_SLEEP_MBOX_MASK) -#define WLAN_SYSTEM_SLEEP_MAC_IF_MSB 2 -#define WLAN_SYSTEM_SLEEP_MAC_IF_LSB 2 -#define WLAN_SYSTEM_SLEEP_MAC_IF_MASK 0x00000004 -#define WLAN_SYSTEM_SLEEP_MAC_IF_GET(x) (((x) & WLAN_SYSTEM_SLEEP_MAC_IF_MASK) >> WLAN_SYSTEM_SLEEP_MAC_IF_LSB) -#define WLAN_SYSTEM_SLEEP_MAC_IF_SET(x) (((x) << WLAN_SYSTEM_SLEEP_MAC_IF_LSB) & WLAN_SYSTEM_SLEEP_MAC_IF_MASK) -#define WLAN_SYSTEM_SLEEP_LIGHT_MSB 1 -#define WLAN_SYSTEM_SLEEP_LIGHT_LSB 1 -#define WLAN_SYSTEM_SLEEP_LIGHT_MASK 0x00000002 -#define WLAN_SYSTEM_SLEEP_LIGHT_GET(x) (((x) & WLAN_SYSTEM_SLEEP_LIGHT_MASK) >> WLAN_SYSTEM_SLEEP_LIGHT_LSB) -#define WLAN_SYSTEM_SLEEP_LIGHT_SET(x) (((x) << WLAN_SYSTEM_SLEEP_LIGHT_LSB) & WLAN_SYSTEM_SLEEP_LIGHT_MASK) -#define WLAN_SYSTEM_SLEEP_DISABLE_MSB 0 -#define WLAN_SYSTEM_SLEEP_DISABLE_LSB 0 -#define WLAN_SYSTEM_SLEEP_DISABLE_MASK 0x00000001 -#define WLAN_SYSTEM_SLEEP_DISABLE_GET(x) (((x) & WLAN_SYSTEM_SLEEP_DISABLE_MASK) >> WLAN_SYSTEM_SLEEP_DISABLE_LSB) -#define WLAN_SYSTEM_SLEEP_DISABLE_SET(x) (((x) << WLAN_SYSTEM_SLEEP_DISABLE_LSB) & WLAN_SYSTEM_SLEEP_DISABLE_MASK) - -#define WLAN_SDIO_WRAPPER_ADDRESS 0x000000c8 -#define WLAN_SDIO_WRAPPER_OFFSET 0x000000c8 -#define WLAN_SDIO_WRAPPER_SLEEP_MSB 3 -#define WLAN_SDIO_WRAPPER_SLEEP_LSB 3 -#define WLAN_SDIO_WRAPPER_SLEEP_MASK 0x00000008 -#define WLAN_SDIO_WRAPPER_SLEEP_GET(x) (((x) & WLAN_SDIO_WRAPPER_SLEEP_MASK) >> WLAN_SDIO_WRAPPER_SLEEP_LSB) -#define WLAN_SDIO_WRAPPER_SLEEP_SET(x) (((x) << WLAN_SDIO_WRAPPER_SLEEP_LSB) & WLAN_SDIO_WRAPPER_SLEEP_MASK) -#define WLAN_SDIO_WRAPPER_WAKEUP_MSB 2 -#define WLAN_SDIO_WRAPPER_WAKEUP_LSB 2 -#define WLAN_SDIO_WRAPPER_WAKEUP_MASK 0x00000004 -#define WLAN_SDIO_WRAPPER_WAKEUP_GET(x) (((x) & WLAN_SDIO_WRAPPER_WAKEUP_MASK) >> WLAN_SDIO_WRAPPER_WAKEUP_LSB) -#define WLAN_SDIO_WRAPPER_WAKEUP_SET(x) (((x) << WLAN_SDIO_WRAPPER_WAKEUP_LSB) & WLAN_SDIO_WRAPPER_WAKEUP_MASK) -#define WLAN_SDIO_WRAPPER_SOC_ON_MSB 1 -#define WLAN_SDIO_WRAPPER_SOC_ON_LSB 1 -#define WLAN_SDIO_WRAPPER_SOC_ON_MASK 0x00000002 -#define WLAN_SDIO_WRAPPER_SOC_ON_GET(x) (((x) & WLAN_SDIO_WRAPPER_SOC_ON_MASK) >> WLAN_SDIO_WRAPPER_SOC_ON_LSB) -#define WLAN_SDIO_WRAPPER_SOC_ON_SET(x) (((x) << WLAN_SDIO_WRAPPER_SOC_ON_LSB) & WLAN_SDIO_WRAPPER_SOC_ON_MASK) -#define WLAN_SDIO_WRAPPER_ON_MSB 0 -#define WLAN_SDIO_WRAPPER_ON_LSB 0 -#define WLAN_SDIO_WRAPPER_ON_MASK 0x00000001 -#define WLAN_SDIO_WRAPPER_ON_GET(x) (((x) & WLAN_SDIO_WRAPPER_ON_MASK) >> WLAN_SDIO_WRAPPER_ON_LSB) -#define WLAN_SDIO_WRAPPER_ON_SET(x) (((x) << WLAN_SDIO_WRAPPER_ON_LSB) & WLAN_SDIO_WRAPPER_ON_MASK) - -#define WLAN_MAC_SLEEP_CONTROL_ADDRESS 0x000000cc -#define WLAN_MAC_SLEEP_CONTROL_OFFSET 0x000000cc -#define WLAN_MAC_SLEEP_CONTROL_ENABLE_MSB 1 -#define WLAN_MAC_SLEEP_CONTROL_ENABLE_LSB 0 -#define WLAN_MAC_SLEEP_CONTROL_ENABLE_MASK 0x00000003 -#define WLAN_MAC_SLEEP_CONTROL_ENABLE_GET(x) (((x) & WLAN_MAC_SLEEP_CONTROL_ENABLE_MASK) >> WLAN_MAC_SLEEP_CONTROL_ENABLE_LSB) -#define WLAN_MAC_SLEEP_CONTROL_ENABLE_SET(x) (((x) << WLAN_MAC_SLEEP_CONTROL_ENABLE_LSB) & WLAN_MAC_SLEEP_CONTROL_ENABLE_MASK) - -#define WLAN_KEEP_AWAKE_ADDRESS 0x000000d0 -#define WLAN_KEEP_AWAKE_OFFSET 0x000000d0 -#define WLAN_KEEP_AWAKE_COUNT_MSB 7 -#define WLAN_KEEP_AWAKE_COUNT_LSB 0 -#define WLAN_KEEP_AWAKE_COUNT_MASK 0x000000ff -#define WLAN_KEEP_AWAKE_COUNT_GET(x) (((x) & WLAN_KEEP_AWAKE_COUNT_MASK) >> WLAN_KEEP_AWAKE_COUNT_LSB) -#define WLAN_KEEP_AWAKE_COUNT_SET(x) (((x) << WLAN_KEEP_AWAKE_COUNT_LSB) & WLAN_KEEP_AWAKE_COUNT_MASK) - -#define WLAN_LPO_CAL_TIME_ADDRESS 0x000000d4 -#define WLAN_LPO_CAL_TIME_OFFSET 0x000000d4 -#define WLAN_LPO_CAL_TIME_LENGTH_MSB 13 -#define WLAN_LPO_CAL_TIME_LENGTH_LSB 0 -#define WLAN_LPO_CAL_TIME_LENGTH_MASK 0x00003fff -#define WLAN_LPO_CAL_TIME_LENGTH_GET(x) (((x) & WLAN_LPO_CAL_TIME_LENGTH_MASK) >> WLAN_LPO_CAL_TIME_LENGTH_LSB) -#define WLAN_LPO_CAL_TIME_LENGTH_SET(x) (((x) << WLAN_LPO_CAL_TIME_LENGTH_LSB) & WLAN_LPO_CAL_TIME_LENGTH_MASK) - -#define WLAN_LPO_INIT_DIVIDEND_INT_ADDRESS 0x000000d8 -#define WLAN_LPO_INIT_DIVIDEND_INT_OFFSET 0x000000d8 -#define WLAN_LPO_INIT_DIVIDEND_INT_VALUE_MSB 23 -#define WLAN_LPO_INIT_DIVIDEND_INT_VALUE_LSB 0 -#define WLAN_LPO_INIT_DIVIDEND_INT_VALUE_MASK 0x00ffffff -#define WLAN_LPO_INIT_DIVIDEND_INT_VALUE_GET(x) (((x) & WLAN_LPO_INIT_DIVIDEND_INT_VALUE_MASK) >> WLAN_LPO_INIT_DIVIDEND_INT_VALUE_LSB) -#define WLAN_LPO_INIT_DIVIDEND_INT_VALUE_SET(x) (((x) << WLAN_LPO_INIT_DIVIDEND_INT_VALUE_LSB) & WLAN_LPO_INIT_DIVIDEND_INT_VALUE_MASK) - -#define WLAN_LPO_INIT_DIVIDEND_FRACTION_ADDRESS 0x000000dc -#define WLAN_LPO_INIT_DIVIDEND_FRACTION_OFFSET 0x000000dc -#define WLAN_LPO_INIT_DIVIDEND_FRACTION_VALUE_MSB 10 -#define WLAN_LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB 0 -#define WLAN_LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK 0x000007ff -#define WLAN_LPO_INIT_DIVIDEND_FRACTION_VALUE_GET(x) (((x) & WLAN_LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK) >> WLAN_LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB) -#define WLAN_LPO_INIT_DIVIDEND_FRACTION_VALUE_SET(x) (((x) << WLAN_LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB) & WLAN_LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK) - -#define WLAN_LPO_CAL_ADDRESS 0x000000e0 -#define WLAN_LPO_CAL_OFFSET 0x000000e0 -#define WLAN_LPO_CAL_ENABLE_MSB 20 -#define WLAN_LPO_CAL_ENABLE_LSB 20 -#define WLAN_LPO_CAL_ENABLE_MASK 0x00100000 -#define WLAN_LPO_CAL_ENABLE_GET(x) (((x) & WLAN_LPO_CAL_ENABLE_MASK) >> WLAN_LPO_CAL_ENABLE_LSB) -#define WLAN_LPO_CAL_ENABLE_SET(x) (((x) << WLAN_LPO_CAL_ENABLE_LSB) & WLAN_LPO_CAL_ENABLE_MASK) -#define WLAN_LPO_CAL_COUNT_MSB 19 -#define WLAN_LPO_CAL_COUNT_LSB 0 -#define WLAN_LPO_CAL_COUNT_MASK 0x000fffff -#define WLAN_LPO_CAL_COUNT_GET(x) (((x) & WLAN_LPO_CAL_COUNT_MASK) >> WLAN_LPO_CAL_COUNT_LSB) -#define WLAN_LPO_CAL_COUNT_SET(x) (((x) << WLAN_LPO_CAL_COUNT_LSB) & WLAN_LPO_CAL_COUNT_MASK) - -#define WLAN_LPO_CAL_TEST_CONTROL_ADDRESS 0x000000e4 -#define WLAN_LPO_CAL_TEST_CONTROL_OFFSET 0x000000e4 -#define WLAN_LPO_CAL_TEST_CONTROL_ENABLE_MSB 5 -#define WLAN_LPO_CAL_TEST_CONTROL_ENABLE_LSB 5 -#define WLAN_LPO_CAL_TEST_CONTROL_ENABLE_MASK 0x00000020 -#define WLAN_LPO_CAL_TEST_CONTROL_ENABLE_GET(x) (((x) & WLAN_LPO_CAL_TEST_CONTROL_ENABLE_MASK) >> WLAN_LPO_CAL_TEST_CONTROL_ENABLE_LSB) -#define WLAN_LPO_CAL_TEST_CONTROL_ENABLE_SET(x) (((x) << WLAN_LPO_CAL_TEST_CONTROL_ENABLE_LSB) & WLAN_LPO_CAL_TEST_CONTROL_ENABLE_MASK) -#define WLAN_LPO_CAL_TEST_CONTROL_RTC_CYCLES_MSB 4 -#define WLAN_LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB 0 -#define WLAN_LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK 0x0000001f -#define WLAN_LPO_CAL_TEST_CONTROL_RTC_CYCLES_GET(x) (((x) & WLAN_LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK) >> WLAN_LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB) -#define WLAN_LPO_CAL_TEST_CONTROL_RTC_CYCLES_SET(x) (((x) << WLAN_LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB) & WLAN_LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK) - -#define WLAN_LPO_CAL_TEST_STATUS_ADDRESS 0x000000e8 -#define WLAN_LPO_CAL_TEST_STATUS_OFFSET 0x000000e8 -#define WLAN_LPO_CAL_TEST_STATUS_READY_MSB 16 -#define WLAN_LPO_CAL_TEST_STATUS_READY_LSB 16 -#define WLAN_LPO_CAL_TEST_STATUS_READY_MASK 0x00010000 -#define WLAN_LPO_CAL_TEST_STATUS_READY_GET(x) (((x) & WLAN_LPO_CAL_TEST_STATUS_READY_MASK) >> WLAN_LPO_CAL_TEST_STATUS_READY_LSB) -#define WLAN_LPO_CAL_TEST_STATUS_READY_SET(x) (((x) << WLAN_LPO_CAL_TEST_STATUS_READY_LSB) & WLAN_LPO_CAL_TEST_STATUS_READY_MASK) -#define WLAN_LPO_CAL_TEST_STATUS_COUNT_MSB 15 -#define WLAN_LPO_CAL_TEST_STATUS_COUNT_LSB 0 -#define WLAN_LPO_CAL_TEST_STATUS_COUNT_MASK 0x0000ffff -#define WLAN_LPO_CAL_TEST_STATUS_COUNT_GET(x) (((x) & WLAN_LPO_CAL_TEST_STATUS_COUNT_MASK) >> WLAN_LPO_CAL_TEST_STATUS_COUNT_LSB) -#define WLAN_LPO_CAL_TEST_STATUS_COUNT_SET(x) (((x) << WLAN_LPO_CAL_TEST_STATUS_COUNT_LSB) & WLAN_LPO_CAL_TEST_STATUS_COUNT_MASK) - -#define WLAN_CHIP_ID_ADDRESS 0x000000ec -#define WLAN_CHIP_ID_OFFSET 0x000000ec -#define WLAN_CHIP_ID_DEVICE_ID_MSB 31 -#define WLAN_CHIP_ID_DEVICE_ID_LSB 16 -#define WLAN_CHIP_ID_DEVICE_ID_MASK 0xffff0000 -#define WLAN_CHIP_ID_DEVICE_ID_GET(x) (((x) & WLAN_CHIP_ID_DEVICE_ID_MASK) >> WLAN_CHIP_ID_DEVICE_ID_LSB) -#define WLAN_CHIP_ID_DEVICE_ID_SET(x) (((x) << WLAN_CHIP_ID_DEVICE_ID_LSB) & WLAN_CHIP_ID_DEVICE_ID_MASK) -#define WLAN_CHIP_ID_CONFIG_ID_MSB 15 -#define WLAN_CHIP_ID_CONFIG_ID_LSB 4 -#define WLAN_CHIP_ID_CONFIG_ID_MASK 0x0000fff0 -#define WLAN_CHIP_ID_CONFIG_ID_GET(x) (((x) & WLAN_CHIP_ID_CONFIG_ID_MASK) >> WLAN_CHIP_ID_CONFIG_ID_LSB) -#define WLAN_CHIP_ID_CONFIG_ID_SET(x) (((x) << WLAN_CHIP_ID_CONFIG_ID_LSB) & WLAN_CHIP_ID_CONFIG_ID_MASK) -#define WLAN_CHIP_ID_VERSION_ID_MSB 3 -#define WLAN_CHIP_ID_VERSION_ID_LSB 0 -#define WLAN_CHIP_ID_VERSION_ID_MASK 0x0000000f -#define WLAN_CHIP_ID_VERSION_ID_GET(x) (((x) & WLAN_CHIP_ID_VERSION_ID_MASK) >> WLAN_CHIP_ID_VERSION_ID_LSB) -#define WLAN_CHIP_ID_VERSION_ID_SET(x) (((x) << WLAN_CHIP_ID_VERSION_ID_LSB) & WLAN_CHIP_ID_VERSION_ID_MASK) - -#define WLAN_DERIVED_RTC_CLK_ADDRESS 0x000000f0 -#define WLAN_DERIVED_RTC_CLK_OFFSET 0x000000f0 -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MSB 20 -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB 20 -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK 0x00100000 -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_GET(x) (((x) & WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK) >> WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB) -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_SET(x) (((x) << WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB) & WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK) -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_MSB 18 -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB 18 -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK 0x00040000 -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_GET(x) (((x) & WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK) >> WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB) -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_SET(x) (((x) << WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB) & WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK) -#define WLAN_DERIVED_RTC_CLK_FORCE_MSB 17 -#define WLAN_DERIVED_RTC_CLK_FORCE_LSB 16 -#define WLAN_DERIVED_RTC_CLK_FORCE_MASK 0x00030000 -#define WLAN_DERIVED_RTC_CLK_FORCE_GET(x) (((x) & WLAN_DERIVED_RTC_CLK_FORCE_MASK) >> WLAN_DERIVED_RTC_CLK_FORCE_LSB) -#define WLAN_DERIVED_RTC_CLK_FORCE_SET(x) (((x) << WLAN_DERIVED_RTC_CLK_FORCE_LSB) & WLAN_DERIVED_RTC_CLK_FORCE_MASK) -#define WLAN_DERIVED_RTC_CLK_PERIOD_MSB 15 -#define WLAN_DERIVED_RTC_CLK_PERIOD_LSB 1 -#define WLAN_DERIVED_RTC_CLK_PERIOD_MASK 0x0000fffe -#define WLAN_DERIVED_RTC_CLK_PERIOD_GET(x) (((x) & WLAN_DERIVED_RTC_CLK_PERIOD_MASK) >> WLAN_DERIVED_RTC_CLK_PERIOD_LSB) -#define WLAN_DERIVED_RTC_CLK_PERIOD_SET(x) (((x) << WLAN_DERIVED_RTC_CLK_PERIOD_LSB) & WLAN_DERIVED_RTC_CLK_PERIOD_MASK) - -#define MAC_PCU_SLP32_MODE_ADDRESS 0x000000f4 -#define MAC_PCU_SLP32_MODE_OFFSET 0x000000f4 -#define MAC_PCU_SLP32_MODE_TSF2_WRITE_STATUS_MSB 24 -#define MAC_PCU_SLP32_MODE_TSF2_WRITE_STATUS_LSB 24 -#define MAC_PCU_SLP32_MODE_TSF2_WRITE_STATUS_MASK 0x01000000 -#define MAC_PCU_SLP32_MODE_TSF2_WRITE_STATUS_GET(x) (((x) & MAC_PCU_SLP32_MODE_TSF2_WRITE_STATUS_MASK) >> MAC_PCU_SLP32_MODE_TSF2_WRITE_STATUS_LSB) -#define MAC_PCU_SLP32_MODE_TSF2_WRITE_STATUS_SET(x) (((x) << MAC_PCU_SLP32_MODE_TSF2_WRITE_STATUS_LSB) & MAC_PCU_SLP32_MODE_TSF2_WRITE_STATUS_MASK) -#define MAC_PCU_SLP32_MODE_FORCE_BIAS_BLOCK_ON_MSB 23 -#define MAC_PCU_SLP32_MODE_FORCE_BIAS_BLOCK_ON_LSB 23 -#define MAC_PCU_SLP32_MODE_FORCE_BIAS_BLOCK_ON_MASK 0x00800000 -#define MAC_PCU_SLP32_MODE_FORCE_BIAS_BLOCK_ON_GET(x) (((x) & MAC_PCU_SLP32_MODE_FORCE_BIAS_BLOCK_ON_MASK) >> MAC_PCU_SLP32_MODE_FORCE_BIAS_BLOCK_ON_LSB) -#define MAC_PCU_SLP32_MODE_FORCE_BIAS_BLOCK_ON_SET(x) (((x) << MAC_PCU_SLP32_MODE_FORCE_BIAS_BLOCK_ON_LSB) & MAC_PCU_SLP32_MODE_FORCE_BIAS_BLOCK_ON_MASK) -#define MAC_PCU_SLP32_MODE_DISABLE_32KHZ_MSB 22 -#define MAC_PCU_SLP32_MODE_DISABLE_32KHZ_LSB 22 -#define MAC_PCU_SLP32_MODE_DISABLE_32KHZ_MASK 0x00400000 -#define MAC_PCU_SLP32_MODE_DISABLE_32KHZ_GET(x) (((x) & MAC_PCU_SLP32_MODE_DISABLE_32KHZ_MASK) >> MAC_PCU_SLP32_MODE_DISABLE_32KHZ_LSB) -#define MAC_PCU_SLP32_MODE_DISABLE_32KHZ_SET(x) (((x) << MAC_PCU_SLP32_MODE_DISABLE_32KHZ_LSB) & MAC_PCU_SLP32_MODE_DISABLE_32KHZ_MASK) -#define MAC_PCU_SLP32_MODE_TSF_WRITE_STATUS_MSB 21 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_STATUS_LSB 21 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_STATUS_MASK 0x00200000 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_STATUS_GET(x) (((x) & MAC_PCU_SLP32_MODE_TSF_WRITE_STATUS_MASK) >> MAC_PCU_SLP32_MODE_TSF_WRITE_STATUS_LSB) -#define MAC_PCU_SLP32_MODE_TSF_WRITE_STATUS_SET(x) (((x) << MAC_PCU_SLP32_MODE_TSF_WRITE_STATUS_LSB) & MAC_PCU_SLP32_MODE_TSF_WRITE_STATUS_MASK) -#define MAC_PCU_SLP32_MODE_ENABLE_MSB 20 -#define MAC_PCU_SLP32_MODE_ENABLE_LSB 20 -#define MAC_PCU_SLP32_MODE_ENABLE_MASK 0x00100000 -#define MAC_PCU_SLP32_MODE_ENABLE_GET(x) (((x) & MAC_PCU_SLP32_MODE_ENABLE_MASK) >> MAC_PCU_SLP32_MODE_ENABLE_LSB) -#define MAC_PCU_SLP32_MODE_ENABLE_SET(x) (((x) << MAC_PCU_SLP32_MODE_ENABLE_LSB) & MAC_PCU_SLP32_MODE_ENABLE_MASK) -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MSB 19 -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB 0 -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK 0x000fffff -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_GET(x) (((x) & MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK) >> MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB) -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_SET(x) (((x) << MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB) & MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK) - -#define MAC_PCU_SLP32_WAKE_ADDRESS 0x000000f8 -#define MAC_PCU_SLP32_WAKE_OFFSET 0x000000f8 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_MSB 15 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_LSB 0 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_MASK 0x0000ffff -#define MAC_PCU_SLP32_WAKE_XTL_TIME_GET(x) (((x) & MAC_PCU_SLP32_WAKE_XTL_TIME_MASK) >> MAC_PCU_SLP32_WAKE_XTL_TIME_LSB) -#define MAC_PCU_SLP32_WAKE_XTL_TIME_SET(x) (((x) << MAC_PCU_SLP32_WAKE_XTL_TIME_LSB) & MAC_PCU_SLP32_WAKE_XTL_TIME_MASK) - -#define MAC_PCU_SLP32_INC_ADDRESS 0x000000fc -#define MAC_PCU_SLP32_INC_OFFSET 0x000000fc -#define MAC_PCU_SLP32_INC_TSF_INC_MSB 19 -#define MAC_PCU_SLP32_INC_TSF_INC_LSB 0 -#define MAC_PCU_SLP32_INC_TSF_INC_MASK 0x000fffff -#define MAC_PCU_SLP32_INC_TSF_INC_GET(x) (((x) & MAC_PCU_SLP32_INC_TSF_INC_MASK) >> MAC_PCU_SLP32_INC_TSF_INC_LSB) -#define MAC_PCU_SLP32_INC_TSF_INC_SET(x) (((x) << MAC_PCU_SLP32_INC_TSF_INC_LSB) & MAC_PCU_SLP32_INC_TSF_INC_MASK) - -#define MAC_PCU_SLP_MIB1_ADDRESS 0x00000100 -#define MAC_PCU_SLP_MIB1_OFFSET 0x00000100 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_MSB 31 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB 0 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK 0xffffffff -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_GET(x) (((x) & MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK) >> MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB) -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_SET(x) (((x) << MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB) & MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK) - -#define MAC_PCU_SLP_MIB2_ADDRESS 0x00000104 -#define MAC_PCU_SLP_MIB2_OFFSET 0x00000104 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_MSB 31 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB 0 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK 0xffffffff -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_GET(x) (((x) & MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK) >> MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB) -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_SET(x) (((x) << MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB) & MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK) - -#define MAC_PCU_SLP_MIB3_ADDRESS 0x00000108 -#define MAC_PCU_SLP_MIB3_OFFSET 0x00000108 -#define MAC_PCU_SLP_MIB3_PENDING_MSB 1 -#define MAC_PCU_SLP_MIB3_PENDING_LSB 1 -#define MAC_PCU_SLP_MIB3_PENDING_MASK 0x00000002 -#define MAC_PCU_SLP_MIB3_PENDING_GET(x) (((x) & MAC_PCU_SLP_MIB3_PENDING_MASK) >> MAC_PCU_SLP_MIB3_PENDING_LSB) -#define MAC_PCU_SLP_MIB3_PENDING_SET(x) (((x) << MAC_PCU_SLP_MIB3_PENDING_LSB) & MAC_PCU_SLP_MIB3_PENDING_MASK) -#define MAC_PCU_SLP_MIB3_CLR_CNT_MSB 0 -#define MAC_PCU_SLP_MIB3_CLR_CNT_LSB 0 -#define MAC_PCU_SLP_MIB3_CLR_CNT_MASK 0x00000001 -#define MAC_PCU_SLP_MIB3_CLR_CNT_GET(x) (((x) & MAC_PCU_SLP_MIB3_CLR_CNT_MASK) >> MAC_PCU_SLP_MIB3_CLR_CNT_LSB) -#define MAC_PCU_SLP_MIB3_CLR_CNT_SET(x) (((x) << MAC_PCU_SLP_MIB3_CLR_CNT_LSB) & MAC_PCU_SLP_MIB3_CLR_CNT_MASK) - -#define WLAN_POWER_REG_ADDRESS 0x0000010c -#define WLAN_POWER_REG_OFFSET 0x0000010c -#define WLAN_POWER_REG_SLEEP_MAKE_N_BREAK_EN_MSB 15 -#define WLAN_POWER_REG_SLEEP_MAKE_N_BREAK_EN_LSB 15 -#define WLAN_POWER_REG_SLEEP_MAKE_N_BREAK_EN_MASK 0x00008000 -#define WLAN_POWER_REG_SLEEP_MAKE_N_BREAK_EN_GET(x) (((x) & WLAN_POWER_REG_SLEEP_MAKE_N_BREAK_EN_MASK) >> WLAN_POWER_REG_SLEEP_MAKE_N_BREAK_EN_LSB) -#define WLAN_POWER_REG_SLEEP_MAKE_N_BREAK_EN_SET(x) (((x) << WLAN_POWER_REG_SLEEP_MAKE_N_BREAK_EN_LSB) & WLAN_POWER_REG_SLEEP_MAKE_N_BREAK_EN_MASK) -#define WLAN_POWER_REG_DEBUG_EN_MSB 14 -#define WLAN_POWER_REG_DEBUG_EN_LSB 14 -#define WLAN_POWER_REG_DEBUG_EN_MASK 0x00004000 -#define WLAN_POWER_REG_DEBUG_EN_GET(x) (((x) & WLAN_POWER_REG_DEBUG_EN_MASK) >> WLAN_POWER_REG_DEBUG_EN_LSB) -#define WLAN_POWER_REG_DEBUG_EN_SET(x) (((x) << WLAN_POWER_REG_DEBUG_EN_LSB) & WLAN_POWER_REG_DEBUG_EN_MASK) -#define WLAN_POWER_REG_WLAN_BB_PWD_EN_MSB 13 -#define WLAN_POWER_REG_WLAN_BB_PWD_EN_LSB 13 -#define WLAN_POWER_REG_WLAN_BB_PWD_EN_MASK 0x00002000 -#define WLAN_POWER_REG_WLAN_BB_PWD_EN_GET(x) (((x) & WLAN_POWER_REG_WLAN_BB_PWD_EN_MASK) >> WLAN_POWER_REG_WLAN_BB_PWD_EN_LSB) -#define WLAN_POWER_REG_WLAN_BB_PWD_EN_SET(x) (((x) << WLAN_POWER_REG_WLAN_BB_PWD_EN_LSB) & WLAN_POWER_REG_WLAN_BB_PWD_EN_MASK) -#define WLAN_POWER_REG_WLAN_MAC_PWD_EN_MSB 12 -#define WLAN_POWER_REG_WLAN_MAC_PWD_EN_LSB 12 -#define WLAN_POWER_REG_WLAN_MAC_PWD_EN_MASK 0x00001000 -#define WLAN_POWER_REG_WLAN_MAC_PWD_EN_GET(x) (((x) & WLAN_POWER_REG_WLAN_MAC_PWD_EN_MASK) >> WLAN_POWER_REG_WLAN_MAC_PWD_EN_LSB) -#define WLAN_POWER_REG_WLAN_MAC_PWD_EN_SET(x) (((x) << WLAN_POWER_REG_WLAN_MAC_PWD_EN_LSB) & WLAN_POWER_REG_WLAN_MAC_PWD_EN_MASK) -#define WLAN_POWER_REG_VLVL_MSB 11 -#define WLAN_POWER_REG_VLVL_LSB 8 -#define WLAN_POWER_REG_VLVL_MASK 0x00000f00 -#define WLAN_POWER_REG_VLVL_GET(x) (((x) & WLAN_POWER_REG_VLVL_MASK) >> WLAN_POWER_REG_VLVL_LSB) -#define WLAN_POWER_REG_VLVL_SET(x) (((x) << WLAN_POWER_REG_VLVL_LSB) & WLAN_POWER_REG_VLVL_MASK) -#define WLAN_POWER_REG_CPU_INT_ENABLE_MSB 7 -#define WLAN_POWER_REG_CPU_INT_ENABLE_LSB 7 -#define WLAN_POWER_REG_CPU_INT_ENABLE_MASK 0x00000080 -#define WLAN_POWER_REG_CPU_INT_ENABLE_GET(x) (((x) & WLAN_POWER_REG_CPU_INT_ENABLE_MASK) >> WLAN_POWER_REG_CPU_INT_ENABLE_LSB) -#define WLAN_POWER_REG_CPU_INT_ENABLE_SET(x) (((x) << WLAN_POWER_REG_CPU_INT_ENABLE_LSB) & WLAN_POWER_REG_CPU_INT_ENABLE_MASK) -#define WLAN_POWER_REG_WLAN_ISO_DIS_MSB 6 -#define WLAN_POWER_REG_WLAN_ISO_DIS_LSB 6 -#define WLAN_POWER_REG_WLAN_ISO_DIS_MASK 0x00000040 -#define WLAN_POWER_REG_WLAN_ISO_DIS_GET(x) (((x) & WLAN_POWER_REG_WLAN_ISO_DIS_MASK) >> WLAN_POWER_REG_WLAN_ISO_DIS_LSB) -#define WLAN_POWER_REG_WLAN_ISO_DIS_SET(x) (((x) << WLAN_POWER_REG_WLAN_ISO_DIS_LSB) & WLAN_POWER_REG_WLAN_ISO_DIS_MASK) -#define WLAN_POWER_REG_WLAN_ISO_CNTL_MSB 5 -#define WLAN_POWER_REG_WLAN_ISO_CNTL_LSB 5 -#define WLAN_POWER_REG_WLAN_ISO_CNTL_MASK 0x00000020 -#define WLAN_POWER_REG_WLAN_ISO_CNTL_GET(x) (((x) & WLAN_POWER_REG_WLAN_ISO_CNTL_MASK) >> WLAN_POWER_REG_WLAN_ISO_CNTL_LSB) -#define WLAN_POWER_REG_WLAN_ISO_CNTL_SET(x) (((x) << WLAN_POWER_REG_WLAN_ISO_CNTL_LSB) & WLAN_POWER_REG_WLAN_ISO_CNTL_MASK) -#define WLAN_POWER_REG_RADIO_PWD_EN_MSB 4 -#define WLAN_POWER_REG_RADIO_PWD_EN_LSB 4 -#define WLAN_POWER_REG_RADIO_PWD_EN_MASK 0x00000010 -#define WLAN_POWER_REG_RADIO_PWD_EN_GET(x) (((x) & WLAN_POWER_REG_RADIO_PWD_EN_MASK) >> WLAN_POWER_REG_RADIO_PWD_EN_LSB) -#define WLAN_POWER_REG_RADIO_PWD_EN_SET(x) (((x) << WLAN_POWER_REG_RADIO_PWD_EN_LSB) & WLAN_POWER_REG_RADIO_PWD_EN_MASK) -#define WLAN_POWER_REG_SOC_ISO_EN_MSB 3 -#define WLAN_POWER_REG_SOC_ISO_EN_LSB 3 -#define WLAN_POWER_REG_SOC_ISO_EN_MASK 0x00000008 -#define WLAN_POWER_REG_SOC_ISO_EN_GET(x) (((x) & WLAN_POWER_REG_SOC_ISO_EN_MASK) >> WLAN_POWER_REG_SOC_ISO_EN_LSB) -#define WLAN_POWER_REG_SOC_ISO_EN_SET(x) (((x) << WLAN_POWER_REG_SOC_ISO_EN_LSB) & WLAN_POWER_REG_SOC_ISO_EN_MASK) -#define WLAN_POWER_REG_WLAN_ISO_EN_MSB 2 -#define WLAN_POWER_REG_WLAN_ISO_EN_LSB 2 -#define WLAN_POWER_REG_WLAN_ISO_EN_MASK 0x00000004 -#define WLAN_POWER_REG_WLAN_ISO_EN_GET(x) (((x) & WLAN_POWER_REG_WLAN_ISO_EN_MASK) >> WLAN_POWER_REG_WLAN_ISO_EN_LSB) -#define WLAN_POWER_REG_WLAN_ISO_EN_SET(x) (((x) << WLAN_POWER_REG_WLAN_ISO_EN_LSB) & WLAN_POWER_REG_WLAN_ISO_EN_MASK) -#define WLAN_POWER_REG_WLAN_PWD_EN_MSB 1 -#define WLAN_POWER_REG_WLAN_PWD_EN_LSB 1 -#define WLAN_POWER_REG_WLAN_PWD_EN_MASK 0x00000002 -#define WLAN_POWER_REG_WLAN_PWD_EN_GET(x) (((x) & WLAN_POWER_REG_WLAN_PWD_EN_MASK) >> WLAN_POWER_REG_WLAN_PWD_EN_LSB) -#define WLAN_POWER_REG_WLAN_PWD_EN_SET(x) (((x) << WLAN_POWER_REG_WLAN_PWD_EN_LSB) & WLAN_POWER_REG_WLAN_PWD_EN_MASK) -#define WLAN_POWER_REG_POWER_EN_MSB 0 -#define WLAN_POWER_REG_POWER_EN_LSB 0 -#define WLAN_POWER_REG_POWER_EN_MASK 0x00000001 -#define WLAN_POWER_REG_POWER_EN_GET(x) (((x) & WLAN_POWER_REG_POWER_EN_MASK) >> WLAN_POWER_REG_POWER_EN_LSB) -#define WLAN_POWER_REG_POWER_EN_SET(x) (((x) << WLAN_POWER_REG_POWER_EN_LSB) & WLAN_POWER_REG_POWER_EN_MASK) - -#define WLAN_CORE_CLK_CTRL_ADDRESS 0x00000110 -#define WLAN_CORE_CLK_CTRL_OFFSET 0x00000110 -#define WLAN_CORE_CLK_CTRL_DIV_MSB 2 -#define WLAN_CORE_CLK_CTRL_DIV_LSB 0 -#define WLAN_CORE_CLK_CTRL_DIV_MASK 0x00000007 -#define WLAN_CORE_CLK_CTRL_DIV_GET(x) (((x) & WLAN_CORE_CLK_CTRL_DIV_MASK) >> WLAN_CORE_CLK_CTRL_DIV_LSB) -#define WLAN_CORE_CLK_CTRL_DIV_SET(x) (((x) << WLAN_CORE_CLK_CTRL_DIV_LSB) & WLAN_CORE_CLK_CTRL_DIV_MASK) - -#define WLAN_GPIO_WAKEUP_CONTROL_ADDRESS 0x00000114 -#define WLAN_GPIO_WAKEUP_CONTROL_OFFSET 0x00000114 -#define WLAN_GPIO_WAKEUP_CONTROL_ENABLE_MSB 0 -#define WLAN_GPIO_WAKEUP_CONTROL_ENABLE_LSB 0 -#define WLAN_GPIO_WAKEUP_CONTROL_ENABLE_MASK 0x00000001 -#define WLAN_GPIO_WAKEUP_CONTROL_ENABLE_GET(x) (((x) & WLAN_GPIO_WAKEUP_CONTROL_ENABLE_MASK) >> WLAN_GPIO_WAKEUP_CONTROL_ENABLE_LSB) -#define WLAN_GPIO_WAKEUP_CONTROL_ENABLE_SET(x) (((x) << WLAN_GPIO_WAKEUP_CONTROL_ENABLE_LSB) & WLAN_GPIO_WAKEUP_CONTROL_ENABLE_MASK) - -#define HT_ADDRESS 0x00000118 -#define HT_OFFSET 0x00000118 -#define HT_MODE_MSB 0 -#define HT_MODE_LSB 0 -#define HT_MODE_MASK 0x00000001 -#define HT_MODE_GET(x) (((x) & HT_MODE_MASK) >> HT_MODE_LSB) -#define HT_MODE_SET(x) (((x) << HT_MODE_LSB) & HT_MODE_MASK) - -#define MAC_PCU_TSF_L32_ADDRESS 0x0000011c -#define MAC_PCU_TSF_L32_OFFSET 0x0000011c -#define MAC_PCU_TSF_L32_VALUE_MSB 31 -#define MAC_PCU_TSF_L32_VALUE_LSB 0 -#define MAC_PCU_TSF_L32_VALUE_MASK 0xffffffff -#define MAC_PCU_TSF_L32_VALUE_GET(x) (((x) & MAC_PCU_TSF_L32_VALUE_MASK) >> MAC_PCU_TSF_L32_VALUE_LSB) -#define MAC_PCU_TSF_L32_VALUE_SET(x) (((x) << MAC_PCU_TSF_L32_VALUE_LSB) & MAC_PCU_TSF_L32_VALUE_MASK) - -#define MAC_PCU_TSF_U32_ADDRESS 0x00000120 -#define MAC_PCU_TSF_U32_OFFSET 0x00000120 -#define MAC_PCU_TSF_U32_VALUE_MSB 31 -#define MAC_PCU_TSF_U32_VALUE_LSB 0 -#define MAC_PCU_TSF_U32_VALUE_MASK 0xffffffff -#define MAC_PCU_TSF_U32_VALUE_GET(x) (((x) & MAC_PCU_TSF_U32_VALUE_MASK) >> MAC_PCU_TSF_U32_VALUE_LSB) -#define MAC_PCU_TSF_U32_VALUE_SET(x) (((x) << MAC_PCU_TSF_U32_VALUE_LSB) & MAC_PCU_TSF_U32_VALUE_MASK) - -#define MAC_PCU_WBTIMER_ADDRESS 0x00000124 -#define MAC_PCU_WBTIMER_OFFSET 0x00000124 -#define MAC_PCU_WBTIMER_VALUE_MSB 31 -#define MAC_PCU_WBTIMER_VALUE_LSB 0 -#define MAC_PCU_WBTIMER_VALUE_MASK 0xffffffff -#define MAC_PCU_WBTIMER_VALUE_GET(x) (((x) & MAC_PCU_WBTIMER_VALUE_MASK) >> MAC_PCU_WBTIMER_VALUE_LSB) -#define MAC_PCU_WBTIMER_VALUE_SET(x) (((x) << MAC_PCU_WBTIMER_VALUE_LSB) & MAC_PCU_WBTIMER_VALUE_MASK) - -#define MAC_PCU_GENERIC_TIMERS_ADDRESS 0x00000140 -#define MAC_PCU_GENERIC_TIMERS_OFFSET 0x00000140 -#define MAC_PCU_GENERIC_TIMERS_DATA_MSB 31 -#define MAC_PCU_GENERIC_TIMERS_DATA_LSB 0 -#define MAC_PCU_GENERIC_TIMERS_DATA_MASK 0xffffffff -#define MAC_PCU_GENERIC_TIMERS_DATA_GET(x) (((x) & MAC_PCU_GENERIC_TIMERS_DATA_MASK) >> MAC_PCU_GENERIC_TIMERS_DATA_LSB) -#define MAC_PCU_GENERIC_TIMERS_DATA_SET(x) (((x) << MAC_PCU_GENERIC_TIMERS_DATA_LSB) & MAC_PCU_GENERIC_TIMERS_DATA_MASK) - -#define MAC_PCU_GENERIC_TIMERS_MODE_ADDRESS 0x00000180 -#define MAC_PCU_GENERIC_TIMERS_MODE_OFFSET 0x00000180 -#define MAC_PCU_GENERIC_TIMERS_MODE_ENABLE_MSB 15 -#define MAC_PCU_GENERIC_TIMERS_MODE_ENABLE_LSB 0 -#define MAC_PCU_GENERIC_TIMERS_MODE_ENABLE_MASK 0x0000ffff -#define MAC_PCU_GENERIC_TIMERS_MODE_ENABLE_GET(x) (((x) & MAC_PCU_GENERIC_TIMERS_MODE_ENABLE_MASK) >> MAC_PCU_GENERIC_TIMERS_MODE_ENABLE_LSB) -#define MAC_PCU_GENERIC_TIMERS_MODE_ENABLE_SET(x) (((x) << MAC_PCU_GENERIC_TIMERS_MODE_ENABLE_LSB) & MAC_PCU_GENERIC_TIMERS_MODE_ENABLE_MASK) - -#define MAC_PCU_GENERIC_TIMERS2_ADDRESS 0x000001c0 -#define MAC_PCU_GENERIC_TIMERS2_OFFSET 0x000001c0 -#define MAC_PCU_GENERIC_TIMERS2_DATA_MSB 31 -#define MAC_PCU_GENERIC_TIMERS2_DATA_LSB 0 -#define MAC_PCU_GENERIC_TIMERS2_DATA_MASK 0xffffffff -#define MAC_PCU_GENERIC_TIMERS2_DATA_GET(x) (((x) & MAC_PCU_GENERIC_TIMERS2_DATA_MASK) >> MAC_PCU_GENERIC_TIMERS2_DATA_LSB) -#define MAC_PCU_GENERIC_TIMERS2_DATA_SET(x) (((x) << MAC_PCU_GENERIC_TIMERS2_DATA_LSB) & MAC_PCU_GENERIC_TIMERS2_DATA_MASK) - -#define MAC_PCU_GENERIC_TIMERS_MODE2_ADDRESS 0x00000200 -#define MAC_PCU_GENERIC_TIMERS_MODE2_OFFSET 0x00000200 -#define MAC_PCU_GENERIC_TIMERS_MODE2_ENABLE_MSB 15 -#define MAC_PCU_GENERIC_TIMERS_MODE2_ENABLE_LSB 0 -#define MAC_PCU_GENERIC_TIMERS_MODE2_ENABLE_MASK 0x0000ffff -#define MAC_PCU_GENERIC_TIMERS_MODE2_ENABLE_GET(x) (((x) & MAC_PCU_GENERIC_TIMERS_MODE2_ENABLE_MASK) >> MAC_PCU_GENERIC_TIMERS_MODE2_ENABLE_LSB) -#define MAC_PCU_GENERIC_TIMERS_MODE2_ENABLE_SET(x) (((x) << MAC_PCU_GENERIC_TIMERS_MODE2_ENABLE_LSB) & MAC_PCU_GENERIC_TIMERS_MODE2_ENABLE_MASK) - -#define MAC_PCU_SLP1_ADDRESS 0x00000204 -#define MAC_PCU_SLP1_OFFSET 0x00000204 -#define MAC_PCU_SLP1_ASSUME_DTIM_MSB 19 -#define MAC_PCU_SLP1_ASSUME_DTIM_LSB 19 -#define MAC_PCU_SLP1_ASSUME_DTIM_MASK 0x00080000 -#define MAC_PCU_SLP1_ASSUME_DTIM_GET(x) (((x) & MAC_PCU_SLP1_ASSUME_DTIM_MASK) >> MAC_PCU_SLP1_ASSUME_DTIM_LSB) -#define MAC_PCU_SLP1_ASSUME_DTIM_SET(x) (((x) << MAC_PCU_SLP1_ASSUME_DTIM_LSB) & MAC_PCU_SLP1_ASSUME_DTIM_MASK) -#define MAC_PCU_SLP1_CAB_TIMEOUT_MSB 15 -#define MAC_PCU_SLP1_CAB_TIMEOUT_LSB 0 -#define MAC_PCU_SLP1_CAB_TIMEOUT_MASK 0x0000ffff -#define MAC_PCU_SLP1_CAB_TIMEOUT_GET(x) (((x) & MAC_PCU_SLP1_CAB_TIMEOUT_MASK) >> MAC_PCU_SLP1_CAB_TIMEOUT_LSB) -#define MAC_PCU_SLP1_CAB_TIMEOUT_SET(x) (((x) << MAC_PCU_SLP1_CAB_TIMEOUT_LSB) & MAC_PCU_SLP1_CAB_TIMEOUT_MASK) - -#define MAC_PCU_SLP2_ADDRESS 0x00000208 -#define MAC_PCU_SLP2_OFFSET 0x00000208 -#define MAC_PCU_SLP2_BEACON_TIMEOUT_MSB 15 -#define MAC_PCU_SLP2_BEACON_TIMEOUT_LSB 0 -#define MAC_PCU_SLP2_BEACON_TIMEOUT_MASK 0x0000ffff -#define MAC_PCU_SLP2_BEACON_TIMEOUT_GET(x) (((x) & MAC_PCU_SLP2_BEACON_TIMEOUT_MASK) >> MAC_PCU_SLP2_BEACON_TIMEOUT_LSB) -#define MAC_PCU_SLP2_BEACON_TIMEOUT_SET(x) (((x) << MAC_PCU_SLP2_BEACON_TIMEOUT_LSB) & MAC_PCU_SLP2_BEACON_TIMEOUT_MASK) - -#define MAC_PCU_RESET_TSF_ADDRESS 0x0000020c -#define MAC_PCU_RESET_TSF_OFFSET 0x0000020c -#define MAC_PCU_RESET_TSF_ONE_SHOT2_MSB 25 -#define MAC_PCU_RESET_TSF_ONE_SHOT2_LSB 25 -#define MAC_PCU_RESET_TSF_ONE_SHOT2_MASK 0x02000000 -#define MAC_PCU_RESET_TSF_ONE_SHOT2_GET(x) (((x) & MAC_PCU_RESET_TSF_ONE_SHOT2_MASK) >> MAC_PCU_RESET_TSF_ONE_SHOT2_LSB) -#define MAC_PCU_RESET_TSF_ONE_SHOT2_SET(x) (((x) << MAC_PCU_RESET_TSF_ONE_SHOT2_LSB) & MAC_PCU_RESET_TSF_ONE_SHOT2_MASK) -#define MAC_PCU_RESET_TSF_ONE_SHOT_MSB 24 -#define MAC_PCU_RESET_TSF_ONE_SHOT_LSB 24 -#define MAC_PCU_RESET_TSF_ONE_SHOT_MASK 0x01000000 -#define MAC_PCU_RESET_TSF_ONE_SHOT_GET(x) (((x) & MAC_PCU_RESET_TSF_ONE_SHOT_MASK) >> MAC_PCU_RESET_TSF_ONE_SHOT_LSB) -#define MAC_PCU_RESET_TSF_ONE_SHOT_SET(x) (((x) << MAC_PCU_RESET_TSF_ONE_SHOT_LSB) & MAC_PCU_RESET_TSF_ONE_SHOT_MASK) - -#define MAC_PCU_TSF_ADD_PLL_ADDRESS 0x00000210 -#define MAC_PCU_TSF_ADD_PLL_OFFSET 0x00000210 -#define MAC_PCU_TSF_ADD_PLL_VALUE_MSB 7 -#define MAC_PCU_TSF_ADD_PLL_VALUE_LSB 0 -#define MAC_PCU_TSF_ADD_PLL_VALUE_MASK 0x000000ff -#define MAC_PCU_TSF_ADD_PLL_VALUE_GET(x) (((x) & MAC_PCU_TSF_ADD_PLL_VALUE_MASK) >> MAC_PCU_TSF_ADD_PLL_VALUE_LSB) -#define MAC_PCU_TSF_ADD_PLL_VALUE_SET(x) (((x) << MAC_PCU_TSF_ADD_PLL_VALUE_LSB) & MAC_PCU_TSF_ADD_PLL_VALUE_MASK) - -#define SLEEP_RETENTION_ADDRESS 0x00000214 -#define SLEEP_RETENTION_OFFSET 0x00000214 -#define SLEEP_RETENTION_TIME_MSB 9 -#define SLEEP_RETENTION_TIME_LSB 2 -#define SLEEP_RETENTION_TIME_MASK 0x000003fc -#define SLEEP_RETENTION_TIME_GET(x) (((x) & SLEEP_RETENTION_TIME_MASK) >> SLEEP_RETENTION_TIME_LSB) -#define SLEEP_RETENTION_TIME_SET(x) (((x) << SLEEP_RETENTION_TIME_LSB) & SLEEP_RETENTION_TIME_MASK) -#define SLEEP_RETENTION_MODE_MSB 1 -#define SLEEP_RETENTION_MODE_LSB 1 -#define SLEEP_RETENTION_MODE_MASK 0x00000002 -#define SLEEP_RETENTION_MODE_GET(x) (((x) & SLEEP_RETENTION_MODE_MASK) >> SLEEP_RETENTION_MODE_LSB) -#define SLEEP_RETENTION_MODE_SET(x) (((x) << SLEEP_RETENTION_MODE_LSB) & SLEEP_RETENTION_MODE_MASK) -#define SLEEP_RETENTION_ENABLE_MSB 0 -#define SLEEP_RETENTION_ENABLE_LSB 0 -#define SLEEP_RETENTION_ENABLE_MASK 0x00000001 -#define SLEEP_RETENTION_ENABLE_GET(x) (((x) & SLEEP_RETENTION_ENABLE_MASK) >> SLEEP_RETENTION_ENABLE_LSB) -#define SLEEP_RETENTION_ENABLE_SET(x) (((x) << SLEEP_RETENTION_ENABLE_LSB) & SLEEP_RETENTION_ENABLE_MASK) - -#define BTCOEXCTRL_ADDRESS 0x00000218 -#define BTCOEXCTRL_OFFSET 0x00000218 -#define BTCOEXCTRL_WBTIMER_ENABLE_MSB 26 -#define BTCOEXCTRL_WBTIMER_ENABLE_LSB 26 -#define BTCOEXCTRL_WBTIMER_ENABLE_MASK 0x04000000 -#define BTCOEXCTRL_WBTIMER_ENABLE_GET(x) (((x) & BTCOEXCTRL_WBTIMER_ENABLE_MASK) >> BTCOEXCTRL_WBTIMER_ENABLE_LSB) -#define BTCOEXCTRL_WBTIMER_ENABLE_SET(x) (((x) << BTCOEXCTRL_WBTIMER_ENABLE_LSB) & BTCOEXCTRL_WBTIMER_ENABLE_MASK) -#define BTCOEXCTRL_WBSYNC_ON_BEACON_MSB 25 -#define BTCOEXCTRL_WBSYNC_ON_BEACON_LSB 25 -#define BTCOEXCTRL_WBSYNC_ON_BEACON_MASK 0x02000000 -#define BTCOEXCTRL_WBSYNC_ON_BEACON_GET(x) (((x) & BTCOEXCTRL_WBSYNC_ON_BEACON_MASK) >> BTCOEXCTRL_WBSYNC_ON_BEACON_LSB) -#define BTCOEXCTRL_WBSYNC_ON_BEACON_SET(x) (((x) << BTCOEXCTRL_WBSYNC_ON_BEACON_LSB) & BTCOEXCTRL_WBSYNC_ON_BEACON_MASK) -#define BTCOEXCTRL_PTA_MODE_MSB 24 -#define BTCOEXCTRL_PTA_MODE_LSB 23 -#define BTCOEXCTRL_PTA_MODE_MASK 0x01800000 -#define BTCOEXCTRL_PTA_MODE_GET(x) (((x) & BTCOEXCTRL_PTA_MODE_MASK) >> BTCOEXCTRL_PTA_MODE_LSB) -#define BTCOEXCTRL_PTA_MODE_SET(x) (((x) << BTCOEXCTRL_PTA_MODE_LSB) & BTCOEXCTRL_PTA_MODE_MASK) -#define BTCOEXCTRL_FREQ_TIME_MSB 22 -#define BTCOEXCTRL_FREQ_TIME_LSB 18 -#define BTCOEXCTRL_FREQ_TIME_MASK 0x007c0000 -#define BTCOEXCTRL_FREQ_TIME_GET(x) (((x) & BTCOEXCTRL_FREQ_TIME_MASK) >> BTCOEXCTRL_FREQ_TIME_LSB) -#define BTCOEXCTRL_FREQ_TIME_SET(x) (((x) << BTCOEXCTRL_FREQ_TIME_LSB) & BTCOEXCTRL_FREQ_TIME_MASK) -#define BTCOEXCTRL_PRIORITY_TIME_MSB 17 -#define BTCOEXCTRL_PRIORITY_TIME_LSB 12 -#define BTCOEXCTRL_PRIORITY_TIME_MASK 0x0003f000 -#define BTCOEXCTRL_PRIORITY_TIME_GET(x) (((x) & BTCOEXCTRL_PRIORITY_TIME_MASK) >> BTCOEXCTRL_PRIORITY_TIME_LSB) -#define BTCOEXCTRL_PRIORITY_TIME_SET(x) (((x) << BTCOEXCTRL_PRIORITY_TIME_LSB) & BTCOEXCTRL_PRIORITY_TIME_MASK) -#define BTCOEXCTRL_SYNC_DET_EN_MSB 11 -#define BTCOEXCTRL_SYNC_DET_EN_LSB 11 -#define BTCOEXCTRL_SYNC_DET_EN_MASK 0x00000800 -#define BTCOEXCTRL_SYNC_DET_EN_GET(x) (((x) & BTCOEXCTRL_SYNC_DET_EN_MASK) >> BTCOEXCTRL_SYNC_DET_EN_LSB) -#define BTCOEXCTRL_SYNC_DET_EN_SET(x) (((x) << BTCOEXCTRL_SYNC_DET_EN_LSB) & BTCOEXCTRL_SYNC_DET_EN_MASK) -#define BTCOEXCTRL_IDLE_CNT_EN_MSB 10 -#define BTCOEXCTRL_IDLE_CNT_EN_LSB 10 -#define BTCOEXCTRL_IDLE_CNT_EN_MASK 0x00000400 -#define BTCOEXCTRL_IDLE_CNT_EN_GET(x) (((x) & BTCOEXCTRL_IDLE_CNT_EN_MASK) >> BTCOEXCTRL_IDLE_CNT_EN_LSB) -#define BTCOEXCTRL_IDLE_CNT_EN_SET(x) (((x) << BTCOEXCTRL_IDLE_CNT_EN_LSB) & BTCOEXCTRL_IDLE_CNT_EN_MASK) -#define BTCOEXCTRL_FRAME_CNT_EN_MSB 9 -#define BTCOEXCTRL_FRAME_CNT_EN_LSB 9 -#define BTCOEXCTRL_FRAME_CNT_EN_MASK 0x00000200 -#define BTCOEXCTRL_FRAME_CNT_EN_GET(x) (((x) & BTCOEXCTRL_FRAME_CNT_EN_MASK) >> BTCOEXCTRL_FRAME_CNT_EN_LSB) -#define BTCOEXCTRL_FRAME_CNT_EN_SET(x) (((x) << BTCOEXCTRL_FRAME_CNT_EN_LSB) & BTCOEXCTRL_FRAME_CNT_EN_MASK) -#define BTCOEXCTRL_CLK_CNT_EN_MSB 8 -#define BTCOEXCTRL_CLK_CNT_EN_LSB 8 -#define BTCOEXCTRL_CLK_CNT_EN_MASK 0x00000100 -#define BTCOEXCTRL_CLK_CNT_EN_GET(x) (((x) & BTCOEXCTRL_CLK_CNT_EN_MASK) >> BTCOEXCTRL_CLK_CNT_EN_LSB) -#define BTCOEXCTRL_CLK_CNT_EN_SET(x) (((x) << BTCOEXCTRL_CLK_CNT_EN_LSB) & BTCOEXCTRL_CLK_CNT_EN_MASK) -#define BTCOEXCTRL_GAP_MSB 7 -#define BTCOEXCTRL_GAP_LSB 0 -#define BTCOEXCTRL_GAP_MASK 0x000000ff -#define BTCOEXCTRL_GAP_GET(x) (((x) & BTCOEXCTRL_GAP_MASK) >> BTCOEXCTRL_GAP_LSB) -#define BTCOEXCTRL_GAP_SET(x) (((x) << BTCOEXCTRL_GAP_LSB) & BTCOEXCTRL_GAP_MASK) - -#define WBSYNC_PRIORITY1_ADDRESS 0x0000021c -#define WBSYNC_PRIORITY1_OFFSET 0x0000021c -#define WBSYNC_PRIORITY1_BITMAP_MSB 31 -#define WBSYNC_PRIORITY1_BITMAP_LSB 0 -#define WBSYNC_PRIORITY1_BITMAP_MASK 0xffffffff -#define WBSYNC_PRIORITY1_BITMAP_GET(x) (((x) & WBSYNC_PRIORITY1_BITMAP_MASK) >> WBSYNC_PRIORITY1_BITMAP_LSB) -#define WBSYNC_PRIORITY1_BITMAP_SET(x) (((x) << WBSYNC_PRIORITY1_BITMAP_LSB) & WBSYNC_PRIORITY1_BITMAP_MASK) - -#define WBSYNC_PRIORITY2_ADDRESS 0x00000220 -#define WBSYNC_PRIORITY2_OFFSET 0x00000220 -#define WBSYNC_PRIORITY2_BITMAP_MSB 31 -#define WBSYNC_PRIORITY2_BITMAP_LSB 0 -#define WBSYNC_PRIORITY2_BITMAP_MASK 0xffffffff -#define WBSYNC_PRIORITY2_BITMAP_GET(x) (((x) & WBSYNC_PRIORITY2_BITMAP_MASK) >> WBSYNC_PRIORITY2_BITMAP_LSB) -#define WBSYNC_PRIORITY2_BITMAP_SET(x) (((x) << WBSYNC_PRIORITY2_BITMAP_LSB) & WBSYNC_PRIORITY2_BITMAP_MASK) - -#define WBSYNC_PRIORITY3_ADDRESS 0x00000224 -#define WBSYNC_PRIORITY3_OFFSET 0x00000224 -#define WBSYNC_PRIORITY3_BITMAP_MSB 31 -#define WBSYNC_PRIORITY3_BITMAP_LSB 0 -#define WBSYNC_PRIORITY3_BITMAP_MASK 0xffffffff -#define WBSYNC_PRIORITY3_BITMAP_GET(x) (((x) & WBSYNC_PRIORITY3_BITMAP_MASK) >> WBSYNC_PRIORITY3_BITMAP_LSB) -#define WBSYNC_PRIORITY3_BITMAP_SET(x) (((x) << WBSYNC_PRIORITY3_BITMAP_LSB) & WBSYNC_PRIORITY3_BITMAP_MASK) - -#define BTCOEX0_ADDRESS 0x00000228 -#define BTCOEX0_OFFSET 0x00000228 -#define BTCOEX0_SYNC_DUR_MSB 7 -#define BTCOEX0_SYNC_DUR_LSB 0 -#define BTCOEX0_SYNC_DUR_MASK 0x000000ff -#define BTCOEX0_SYNC_DUR_GET(x) (((x) & BTCOEX0_SYNC_DUR_MASK) >> BTCOEX0_SYNC_DUR_LSB) -#define BTCOEX0_SYNC_DUR_SET(x) (((x) << BTCOEX0_SYNC_DUR_LSB) & BTCOEX0_SYNC_DUR_MASK) - -#define BTCOEX1_ADDRESS 0x0000022c -#define BTCOEX1_OFFSET 0x0000022c -#define BTCOEX1_CLK_THRES_MSB 20 -#define BTCOEX1_CLK_THRES_LSB 0 -#define BTCOEX1_CLK_THRES_MASK 0x001fffff -#define BTCOEX1_CLK_THRES_GET(x) (((x) & BTCOEX1_CLK_THRES_MASK) >> BTCOEX1_CLK_THRES_LSB) -#define BTCOEX1_CLK_THRES_SET(x) (((x) << BTCOEX1_CLK_THRES_LSB) & BTCOEX1_CLK_THRES_MASK) - -#define BTCOEX2_ADDRESS 0x00000230 -#define BTCOEX2_OFFSET 0x00000230 -#define BTCOEX2_FRAME_THRES_MSB 7 -#define BTCOEX2_FRAME_THRES_LSB 0 -#define BTCOEX2_FRAME_THRES_MASK 0x000000ff -#define BTCOEX2_FRAME_THRES_GET(x) (((x) & BTCOEX2_FRAME_THRES_MASK) >> BTCOEX2_FRAME_THRES_LSB) -#define BTCOEX2_FRAME_THRES_SET(x) (((x) << BTCOEX2_FRAME_THRES_LSB) & BTCOEX2_FRAME_THRES_MASK) - -#define BTCOEX3_ADDRESS 0x00000234 -#define BTCOEX3_OFFSET 0x00000234 -#define BTCOEX3_CLK_CNT_MSB 20 -#define BTCOEX3_CLK_CNT_LSB 0 -#define BTCOEX3_CLK_CNT_MASK 0x001fffff -#define BTCOEX3_CLK_CNT_GET(x) (((x) & BTCOEX3_CLK_CNT_MASK) >> BTCOEX3_CLK_CNT_LSB) -#define BTCOEX3_CLK_CNT_SET(x) (((x) << BTCOEX3_CLK_CNT_LSB) & BTCOEX3_CLK_CNT_MASK) - -#define BTCOEX4_ADDRESS 0x00000238 -#define BTCOEX4_OFFSET 0x00000238 -#define BTCOEX4_FRAME_CNT_MSB 7 -#define BTCOEX4_FRAME_CNT_LSB 0 -#define BTCOEX4_FRAME_CNT_MASK 0x000000ff -#define BTCOEX4_FRAME_CNT_GET(x) (((x) & BTCOEX4_FRAME_CNT_MASK) >> BTCOEX4_FRAME_CNT_LSB) -#define BTCOEX4_FRAME_CNT_SET(x) (((x) << BTCOEX4_FRAME_CNT_LSB) & BTCOEX4_FRAME_CNT_MASK) - -#define BTCOEX5_ADDRESS 0x0000023c -#define BTCOEX5_OFFSET 0x0000023c -#define BTCOEX5_IDLE_CNT_MSB 15 -#define BTCOEX5_IDLE_CNT_LSB 0 -#define BTCOEX5_IDLE_CNT_MASK 0x0000ffff -#define BTCOEX5_IDLE_CNT_GET(x) (((x) & BTCOEX5_IDLE_CNT_MASK) >> BTCOEX5_IDLE_CNT_LSB) -#define BTCOEX5_IDLE_CNT_SET(x) (((x) << BTCOEX5_IDLE_CNT_LSB) & BTCOEX5_IDLE_CNT_MASK) - -#define BTCOEX6_ADDRESS 0x00000240 -#define BTCOEX6_OFFSET 0x00000240 -#define BTCOEX6_IDLE_RESET_LVL_BITMAP_MSB 31 -#define BTCOEX6_IDLE_RESET_LVL_BITMAP_LSB 0 -#define BTCOEX6_IDLE_RESET_LVL_BITMAP_MASK 0xffffffff -#define BTCOEX6_IDLE_RESET_LVL_BITMAP_GET(x) (((x) & BTCOEX6_IDLE_RESET_LVL_BITMAP_MASK) >> BTCOEX6_IDLE_RESET_LVL_BITMAP_LSB) -#define BTCOEX6_IDLE_RESET_LVL_BITMAP_SET(x) (((x) << BTCOEX6_IDLE_RESET_LVL_BITMAP_LSB) & BTCOEX6_IDLE_RESET_LVL_BITMAP_MASK) - -#define LOCK_ADDRESS 0x00000244 -#define LOCK_OFFSET 0x00000244 -#define LOCK_TLOCK_SLAVE_MSB 31 -#define LOCK_TLOCK_SLAVE_LSB 24 -#define LOCK_TLOCK_SLAVE_MASK 0xff000000 -#define LOCK_TLOCK_SLAVE_GET(x) (((x) & LOCK_TLOCK_SLAVE_MASK) >> LOCK_TLOCK_SLAVE_LSB) -#define LOCK_TLOCK_SLAVE_SET(x) (((x) << LOCK_TLOCK_SLAVE_LSB) & LOCK_TLOCK_SLAVE_MASK) -#define LOCK_TUNLOCK_SLAVE_MSB 23 -#define LOCK_TUNLOCK_SLAVE_LSB 16 -#define LOCK_TUNLOCK_SLAVE_MASK 0x00ff0000 -#define LOCK_TUNLOCK_SLAVE_GET(x) (((x) & LOCK_TUNLOCK_SLAVE_MASK) >> LOCK_TUNLOCK_SLAVE_LSB) -#define LOCK_TUNLOCK_SLAVE_SET(x) (((x) << LOCK_TUNLOCK_SLAVE_LSB) & LOCK_TUNLOCK_SLAVE_MASK) -#define LOCK_TLOCK_MASTER_MSB 15 -#define LOCK_TLOCK_MASTER_LSB 8 -#define LOCK_TLOCK_MASTER_MASK 0x0000ff00 -#define LOCK_TLOCK_MASTER_GET(x) (((x) & LOCK_TLOCK_MASTER_MASK) >> LOCK_TLOCK_MASTER_LSB) -#define LOCK_TLOCK_MASTER_SET(x) (((x) << LOCK_TLOCK_MASTER_LSB) & LOCK_TLOCK_MASTER_MASK) -#define LOCK_TUNLOCK_MASTER_MSB 7 -#define LOCK_TUNLOCK_MASTER_LSB 0 -#define LOCK_TUNLOCK_MASTER_MASK 0x000000ff -#define LOCK_TUNLOCK_MASTER_GET(x) (((x) & LOCK_TUNLOCK_MASTER_MASK) >> LOCK_TUNLOCK_MASTER_LSB) -#define LOCK_TUNLOCK_MASTER_SET(x) (((x) << LOCK_TUNLOCK_MASTER_LSB) & LOCK_TUNLOCK_MASTER_MASK) - -#define NOLOCK_PRIORITY_ADDRESS 0x00000248 -#define NOLOCK_PRIORITY_OFFSET 0x00000248 -#define NOLOCK_PRIORITY_BITMAP_MSB 31 -#define NOLOCK_PRIORITY_BITMAP_LSB 0 -#define NOLOCK_PRIORITY_BITMAP_MASK 0xffffffff -#define NOLOCK_PRIORITY_BITMAP_GET(x) (((x) & NOLOCK_PRIORITY_BITMAP_MASK) >> NOLOCK_PRIORITY_BITMAP_LSB) -#define NOLOCK_PRIORITY_BITMAP_SET(x) (((x) << NOLOCK_PRIORITY_BITMAP_LSB) & NOLOCK_PRIORITY_BITMAP_MASK) - -#define WBSYNC_ADDRESS 0x0000024c -#define WBSYNC_OFFSET 0x0000024c -#define WBSYNC_BTCLOCK_MSB 31 -#define WBSYNC_BTCLOCK_LSB 0 -#define WBSYNC_BTCLOCK_MASK 0xffffffff -#define WBSYNC_BTCLOCK_GET(x) (((x) & WBSYNC_BTCLOCK_MASK) >> WBSYNC_BTCLOCK_LSB) -#define WBSYNC_BTCLOCK_SET(x) (((x) << WBSYNC_BTCLOCK_LSB) & WBSYNC_BTCLOCK_MASK) - -#define WBSYNC1_ADDRESS 0x00000250 -#define WBSYNC1_OFFSET 0x00000250 -#define WBSYNC1_BTCLOCK_MSB 31 -#define WBSYNC1_BTCLOCK_LSB 0 -#define WBSYNC1_BTCLOCK_MASK 0xffffffff -#define WBSYNC1_BTCLOCK_GET(x) (((x) & WBSYNC1_BTCLOCK_MASK) >> WBSYNC1_BTCLOCK_LSB) -#define WBSYNC1_BTCLOCK_SET(x) (((x) << WBSYNC1_BTCLOCK_LSB) & WBSYNC1_BTCLOCK_MASK) - -#define WBSYNC2_ADDRESS 0x00000254 -#define WBSYNC2_OFFSET 0x00000254 -#define WBSYNC2_BTCLOCK_MSB 31 -#define WBSYNC2_BTCLOCK_LSB 0 -#define WBSYNC2_BTCLOCK_MASK 0xffffffff -#define WBSYNC2_BTCLOCK_GET(x) (((x) & WBSYNC2_BTCLOCK_MASK) >> WBSYNC2_BTCLOCK_LSB) -#define WBSYNC2_BTCLOCK_SET(x) (((x) << WBSYNC2_BTCLOCK_LSB) & WBSYNC2_BTCLOCK_MASK) - -#define WBSYNC3_ADDRESS 0x00000258 -#define WBSYNC3_OFFSET 0x00000258 -#define WBSYNC3_BTCLOCK_MSB 31 -#define WBSYNC3_BTCLOCK_LSB 0 -#define WBSYNC3_BTCLOCK_MASK 0xffffffff -#define WBSYNC3_BTCLOCK_GET(x) (((x) & WBSYNC3_BTCLOCK_MASK) >> WBSYNC3_BTCLOCK_LSB) -#define WBSYNC3_BTCLOCK_SET(x) (((x) << WBSYNC3_BTCLOCK_LSB) & WBSYNC3_BTCLOCK_MASK) - -#define WB_TIMER_TARGET_ADDRESS 0x0000025c -#define WB_TIMER_TARGET_OFFSET 0x0000025c -#define WB_TIMER_TARGET_VALUE_MSB 31 -#define WB_TIMER_TARGET_VALUE_LSB 0 -#define WB_TIMER_TARGET_VALUE_MASK 0xffffffff -#define WB_TIMER_TARGET_VALUE_GET(x) (((x) & WB_TIMER_TARGET_VALUE_MASK) >> WB_TIMER_TARGET_VALUE_LSB) -#define WB_TIMER_TARGET_VALUE_SET(x) (((x) << WB_TIMER_TARGET_VALUE_LSB) & WB_TIMER_TARGET_VALUE_MASK) - -#define WB_TIMER_SLOP_ADDRESS 0x00000260 -#define WB_TIMER_SLOP_OFFSET 0x00000260 -#define WB_TIMER_SLOP_VALUE_MSB 9 -#define WB_TIMER_SLOP_VALUE_LSB 0 -#define WB_TIMER_SLOP_VALUE_MASK 0x000003ff -#define WB_TIMER_SLOP_VALUE_GET(x) (((x) & WB_TIMER_SLOP_VALUE_MASK) >> WB_TIMER_SLOP_VALUE_LSB) -#define WB_TIMER_SLOP_VALUE_SET(x) (((x) << WB_TIMER_SLOP_VALUE_LSB) & WB_TIMER_SLOP_VALUE_MASK) - -#define BTCOEX_INT_EN_ADDRESS 0x00000264 -#define BTCOEX_INT_EN_OFFSET 0x00000264 -#define BTCOEX_INT_EN_I2C_RECV_OVERFLOW_MSB 11 -#define BTCOEX_INT_EN_I2C_RECV_OVERFLOW_LSB 11 -#define BTCOEX_INT_EN_I2C_RECV_OVERFLOW_MASK 0x00000800 -#define BTCOEX_INT_EN_I2C_RECV_OVERFLOW_GET(x) (((x) & BTCOEX_INT_EN_I2C_RECV_OVERFLOW_MASK) >> BTCOEX_INT_EN_I2C_RECV_OVERFLOW_LSB) -#define BTCOEX_INT_EN_I2C_RECV_OVERFLOW_SET(x) (((x) << BTCOEX_INT_EN_I2C_RECV_OVERFLOW_LSB) & BTCOEX_INT_EN_I2C_RECV_OVERFLOW_MASK) -#define BTCOEX_INT_EN_I2C_TX_FAILED_MSB 10 -#define BTCOEX_INT_EN_I2C_TX_FAILED_LSB 10 -#define BTCOEX_INT_EN_I2C_TX_FAILED_MASK 0x00000400 -#define BTCOEX_INT_EN_I2C_TX_FAILED_GET(x) (((x) & BTCOEX_INT_EN_I2C_TX_FAILED_MASK) >> BTCOEX_INT_EN_I2C_TX_FAILED_LSB) -#define BTCOEX_INT_EN_I2C_TX_FAILED_SET(x) (((x) << BTCOEX_INT_EN_I2C_TX_FAILED_LSB) & BTCOEX_INT_EN_I2C_TX_FAILED_MASK) -#define BTCOEX_INT_EN_I2C_MESG_SENT_MSB 9 -#define BTCOEX_INT_EN_I2C_MESG_SENT_LSB 9 -#define BTCOEX_INT_EN_I2C_MESG_SENT_MASK 0x00000200 -#define BTCOEX_INT_EN_I2C_MESG_SENT_GET(x) (((x) & BTCOEX_INT_EN_I2C_MESG_SENT_MASK) >> BTCOEX_INT_EN_I2C_MESG_SENT_LSB) -#define BTCOEX_INT_EN_I2C_MESG_SENT_SET(x) (((x) << BTCOEX_INT_EN_I2C_MESG_SENT_LSB) & BTCOEX_INT_EN_I2C_MESG_SENT_MASK) -#define BTCOEX_INT_EN_ST_MESG_RECV_MSB 8 -#define BTCOEX_INT_EN_ST_MESG_RECV_LSB 8 -#define BTCOEX_INT_EN_ST_MESG_RECV_MASK 0x00000100 -#define BTCOEX_INT_EN_ST_MESG_RECV_GET(x) (((x) & BTCOEX_INT_EN_ST_MESG_RECV_MASK) >> BTCOEX_INT_EN_ST_MESG_RECV_LSB) -#define BTCOEX_INT_EN_ST_MESG_RECV_SET(x) (((x) << BTCOEX_INT_EN_ST_MESG_RECV_LSB) & BTCOEX_INT_EN_ST_MESG_RECV_MASK) -#define BTCOEX_INT_EN_WB_TIMER_MSB 7 -#define BTCOEX_INT_EN_WB_TIMER_LSB 7 -#define BTCOEX_INT_EN_WB_TIMER_MASK 0x00000080 -#define BTCOEX_INT_EN_WB_TIMER_GET(x) (((x) & BTCOEX_INT_EN_WB_TIMER_MASK) >> BTCOEX_INT_EN_WB_TIMER_LSB) -#define BTCOEX_INT_EN_WB_TIMER_SET(x) (((x) << BTCOEX_INT_EN_WB_TIMER_LSB) & BTCOEX_INT_EN_WB_TIMER_MASK) -#define BTCOEX_INT_EN_NOSYNC_MSB 4 -#define BTCOEX_INT_EN_NOSYNC_LSB 4 -#define BTCOEX_INT_EN_NOSYNC_MASK 0x00000010 -#define BTCOEX_INT_EN_NOSYNC_GET(x) (((x) & BTCOEX_INT_EN_NOSYNC_MASK) >> BTCOEX_INT_EN_NOSYNC_LSB) -#define BTCOEX_INT_EN_NOSYNC_SET(x) (((x) << BTCOEX_INT_EN_NOSYNC_LSB) & BTCOEX_INT_EN_NOSYNC_MASK) -#define BTCOEX_INT_EN_SYNC_MSB 3 -#define BTCOEX_INT_EN_SYNC_LSB 3 -#define BTCOEX_INT_EN_SYNC_MASK 0x00000008 -#define BTCOEX_INT_EN_SYNC_GET(x) (((x) & BTCOEX_INT_EN_SYNC_MASK) >> BTCOEX_INT_EN_SYNC_LSB) -#define BTCOEX_INT_EN_SYNC_SET(x) (((x) << BTCOEX_INT_EN_SYNC_LSB) & BTCOEX_INT_EN_SYNC_MASK) -#define BTCOEX_INT_EN_END_MSB 2 -#define BTCOEX_INT_EN_END_LSB 2 -#define BTCOEX_INT_EN_END_MASK 0x00000004 -#define BTCOEX_INT_EN_END_GET(x) (((x) & BTCOEX_INT_EN_END_MASK) >> BTCOEX_INT_EN_END_LSB) -#define BTCOEX_INT_EN_END_SET(x) (((x) << BTCOEX_INT_EN_END_LSB) & BTCOEX_INT_EN_END_MASK) -#define BTCOEX_INT_EN_FRAME_CNT_MSB 1 -#define BTCOEX_INT_EN_FRAME_CNT_LSB 1 -#define BTCOEX_INT_EN_FRAME_CNT_MASK 0x00000002 -#define BTCOEX_INT_EN_FRAME_CNT_GET(x) (((x) & BTCOEX_INT_EN_FRAME_CNT_MASK) >> BTCOEX_INT_EN_FRAME_CNT_LSB) -#define BTCOEX_INT_EN_FRAME_CNT_SET(x) (((x) << BTCOEX_INT_EN_FRAME_CNT_LSB) & BTCOEX_INT_EN_FRAME_CNT_MASK) -#define BTCOEX_INT_EN_CLK_CNT_MSB 0 -#define BTCOEX_INT_EN_CLK_CNT_LSB 0 -#define BTCOEX_INT_EN_CLK_CNT_MASK 0x00000001 -#define BTCOEX_INT_EN_CLK_CNT_GET(x) (((x) & BTCOEX_INT_EN_CLK_CNT_MASK) >> BTCOEX_INT_EN_CLK_CNT_LSB) -#define BTCOEX_INT_EN_CLK_CNT_SET(x) (((x) << BTCOEX_INT_EN_CLK_CNT_LSB) & BTCOEX_INT_EN_CLK_CNT_MASK) - -#define BTCOEX_INT_STAT_ADDRESS 0x00000268 -#define BTCOEX_INT_STAT_OFFSET 0x00000268 -#define BTCOEX_INT_STAT_I2C_RECV_OVERFLOW_MSB 11 -#define BTCOEX_INT_STAT_I2C_RECV_OVERFLOW_LSB 11 -#define BTCOEX_INT_STAT_I2C_RECV_OVERFLOW_MASK 0x00000800 -#define BTCOEX_INT_STAT_I2C_RECV_OVERFLOW_GET(x) (((x) & BTCOEX_INT_STAT_I2C_RECV_OVERFLOW_MASK) >> BTCOEX_INT_STAT_I2C_RECV_OVERFLOW_LSB) -#define BTCOEX_INT_STAT_I2C_RECV_OVERFLOW_SET(x) (((x) << BTCOEX_INT_STAT_I2C_RECV_OVERFLOW_LSB) & BTCOEX_INT_STAT_I2C_RECV_OVERFLOW_MASK) -#define BTCOEX_INT_STAT_I2C_TX_FAILED_MSB 10 -#define BTCOEX_INT_STAT_I2C_TX_FAILED_LSB 10 -#define BTCOEX_INT_STAT_I2C_TX_FAILED_MASK 0x00000400 -#define BTCOEX_INT_STAT_I2C_TX_FAILED_GET(x) (((x) & BTCOEX_INT_STAT_I2C_TX_FAILED_MASK) >> BTCOEX_INT_STAT_I2C_TX_FAILED_LSB) -#define BTCOEX_INT_STAT_I2C_TX_FAILED_SET(x) (((x) << BTCOEX_INT_STAT_I2C_TX_FAILED_LSB) & BTCOEX_INT_STAT_I2C_TX_FAILED_MASK) -#define BTCOEX_INT_STAT_I2C_MESG_SENT_MSB 9 -#define BTCOEX_INT_STAT_I2C_MESG_SENT_LSB 9 -#define BTCOEX_INT_STAT_I2C_MESG_SENT_MASK 0x00000200 -#define BTCOEX_INT_STAT_I2C_MESG_SENT_GET(x) (((x) & BTCOEX_INT_STAT_I2C_MESG_SENT_MASK) >> BTCOEX_INT_STAT_I2C_MESG_SENT_LSB) -#define BTCOEX_INT_STAT_I2C_MESG_SENT_SET(x) (((x) << BTCOEX_INT_STAT_I2C_MESG_SENT_LSB) & BTCOEX_INT_STAT_I2C_MESG_SENT_MASK) -#define BTCOEX_INT_STAT_I2C_MESG_RECV_MSB 8 -#define BTCOEX_INT_STAT_I2C_MESG_RECV_LSB 8 -#define BTCOEX_INT_STAT_I2C_MESG_RECV_MASK 0x00000100 -#define BTCOEX_INT_STAT_I2C_MESG_RECV_GET(x) (((x) & BTCOEX_INT_STAT_I2C_MESG_RECV_MASK) >> BTCOEX_INT_STAT_I2C_MESG_RECV_LSB) -#define BTCOEX_INT_STAT_I2C_MESG_RECV_SET(x) (((x) << BTCOEX_INT_STAT_I2C_MESG_RECV_LSB) & BTCOEX_INT_STAT_I2C_MESG_RECV_MASK) -#define BTCOEX_INT_STAT_WB_TIMER_MSB 7 -#define BTCOEX_INT_STAT_WB_TIMER_LSB 7 -#define BTCOEX_INT_STAT_WB_TIMER_MASK 0x00000080 -#define BTCOEX_INT_STAT_WB_TIMER_GET(x) (((x) & BTCOEX_INT_STAT_WB_TIMER_MASK) >> BTCOEX_INT_STAT_WB_TIMER_LSB) -#define BTCOEX_INT_STAT_WB_TIMER_SET(x) (((x) << BTCOEX_INT_STAT_WB_TIMER_LSB) & BTCOEX_INT_STAT_WB_TIMER_MASK) -#define BTCOEX_INT_STAT_BTPRIORITY_STOMP_MSB 6 -#define BTCOEX_INT_STAT_BTPRIORITY_STOMP_LSB 6 -#define BTCOEX_INT_STAT_BTPRIORITY_STOMP_MASK 0x00000040 -#define BTCOEX_INT_STAT_BTPRIORITY_STOMP_GET(x) (((x) & BTCOEX_INT_STAT_BTPRIORITY_STOMP_MASK) >> BTCOEX_INT_STAT_BTPRIORITY_STOMP_LSB) -#define BTCOEX_INT_STAT_BTPRIORITY_STOMP_SET(x) (((x) << BTCOEX_INT_STAT_BTPRIORITY_STOMP_LSB) & BTCOEX_INT_STAT_BTPRIORITY_STOMP_MASK) -#define BTCOEX_INT_STAT_BTPRIORITY_MSB 5 -#define BTCOEX_INT_STAT_BTPRIORITY_LSB 5 -#define BTCOEX_INT_STAT_BTPRIORITY_MASK 0x00000020 -#define BTCOEX_INT_STAT_BTPRIORITY_GET(x) (((x) & BTCOEX_INT_STAT_BTPRIORITY_MASK) >> BTCOEX_INT_STAT_BTPRIORITY_LSB) -#define BTCOEX_INT_STAT_BTPRIORITY_SET(x) (((x) << BTCOEX_INT_STAT_BTPRIORITY_LSB) & BTCOEX_INT_STAT_BTPRIORITY_MASK) -#define BTCOEX_INT_STAT_NOSYNC_MSB 4 -#define BTCOEX_INT_STAT_NOSYNC_LSB 4 -#define BTCOEX_INT_STAT_NOSYNC_MASK 0x00000010 -#define BTCOEX_INT_STAT_NOSYNC_GET(x) (((x) & BTCOEX_INT_STAT_NOSYNC_MASK) >> BTCOEX_INT_STAT_NOSYNC_LSB) -#define BTCOEX_INT_STAT_NOSYNC_SET(x) (((x) << BTCOEX_INT_STAT_NOSYNC_LSB) & BTCOEX_INT_STAT_NOSYNC_MASK) -#define BTCOEX_INT_STAT_SYNC_MSB 3 -#define BTCOEX_INT_STAT_SYNC_LSB 3 -#define BTCOEX_INT_STAT_SYNC_MASK 0x00000008 -#define BTCOEX_INT_STAT_SYNC_GET(x) (((x) & BTCOEX_INT_STAT_SYNC_MASK) >> BTCOEX_INT_STAT_SYNC_LSB) -#define BTCOEX_INT_STAT_SYNC_SET(x) (((x) << BTCOEX_INT_STAT_SYNC_LSB) & BTCOEX_INT_STAT_SYNC_MASK) -#define BTCOEX_INT_STAT_END_MSB 2 -#define BTCOEX_INT_STAT_END_LSB 2 -#define BTCOEX_INT_STAT_END_MASK 0x00000004 -#define BTCOEX_INT_STAT_END_GET(x) (((x) & BTCOEX_INT_STAT_END_MASK) >> BTCOEX_INT_STAT_END_LSB) -#define BTCOEX_INT_STAT_END_SET(x) (((x) << BTCOEX_INT_STAT_END_LSB) & BTCOEX_INT_STAT_END_MASK) -#define BTCOEX_INT_STAT_FRAME_CNT_MSB 1 -#define BTCOEX_INT_STAT_FRAME_CNT_LSB 1 -#define BTCOEX_INT_STAT_FRAME_CNT_MASK 0x00000002 -#define BTCOEX_INT_STAT_FRAME_CNT_GET(x) (((x) & BTCOEX_INT_STAT_FRAME_CNT_MASK) >> BTCOEX_INT_STAT_FRAME_CNT_LSB) -#define BTCOEX_INT_STAT_FRAME_CNT_SET(x) (((x) << BTCOEX_INT_STAT_FRAME_CNT_LSB) & BTCOEX_INT_STAT_FRAME_CNT_MASK) -#define BTCOEX_INT_STAT_CLK_CNT_MSB 0 -#define BTCOEX_INT_STAT_CLK_CNT_LSB 0 -#define BTCOEX_INT_STAT_CLK_CNT_MASK 0x00000001 -#define BTCOEX_INT_STAT_CLK_CNT_GET(x) (((x) & BTCOEX_INT_STAT_CLK_CNT_MASK) >> BTCOEX_INT_STAT_CLK_CNT_LSB) -#define BTCOEX_INT_STAT_CLK_CNT_SET(x) (((x) << BTCOEX_INT_STAT_CLK_CNT_LSB) & BTCOEX_INT_STAT_CLK_CNT_MASK) - -#define BTPRIORITY_INT_EN_ADDRESS 0x0000026c -#define BTPRIORITY_INT_EN_OFFSET 0x0000026c -#define BTPRIORITY_INT_EN_BITMAP_MSB 31 -#define BTPRIORITY_INT_EN_BITMAP_LSB 0 -#define BTPRIORITY_INT_EN_BITMAP_MASK 0xffffffff -#define BTPRIORITY_INT_EN_BITMAP_GET(x) (((x) & BTPRIORITY_INT_EN_BITMAP_MASK) >> BTPRIORITY_INT_EN_BITMAP_LSB) -#define BTPRIORITY_INT_EN_BITMAP_SET(x) (((x) << BTPRIORITY_INT_EN_BITMAP_LSB) & BTPRIORITY_INT_EN_BITMAP_MASK) - -#define BTPRIORITY_INT_STAT_ADDRESS 0x00000270 -#define BTPRIORITY_INT_STAT_OFFSET 0x00000270 -#define BTPRIORITY_INT_STAT_BITMAP_MSB 31 -#define BTPRIORITY_INT_STAT_BITMAP_LSB 0 -#define BTPRIORITY_INT_STAT_BITMAP_MASK 0xffffffff -#define BTPRIORITY_INT_STAT_BITMAP_GET(x) (((x) & BTPRIORITY_INT_STAT_BITMAP_MASK) >> BTPRIORITY_INT_STAT_BITMAP_LSB) -#define BTPRIORITY_INT_STAT_BITMAP_SET(x) (((x) << BTPRIORITY_INT_STAT_BITMAP_LSB) & BTPRIORITY_INT_STAT_BITMAP_MASK) - -#define BTPRIORITY_STOMP_INT_EN_ADDRESS 0x00000274 -#define BTPRIORITY_STOMP_INT_EN_OFFSET 0x00000274 -#define BTPRIORITY_STOMP_INT_EN_BITMAP_MSB 31 -#define BTPRIORITY_STOMP_INT_EN_BITMAP_LSB 0 -#define BTPRIORITY_STOMP_INT_EN_BITMAP_MASK 0xffffffff -#define BTPRIORITY_STOMP_INT_EN_BITMAP_GET(x) (((x) & BTPRIORITY_STOMP_INT_EN_BITMAP_MASK) >> BTPRIORITY_STOMP_INT_EN_BITMAP_LSB) -#define BTPRIORITY_STOMP_INT_EN_BITMAP_SET(x) (((x) << BTPRIORITY_STOMP_INT_EN_BITMAP_LSB) & BTPRIORITY_STOMP_INT_EN_BITMAP_MASK) - -#define BTPRIORITY_STOMP_INT_STAT_ADDRESS 0x00000278 -#define BTPRIORITY_STOMP_INT_STAT_OFFSET 0x00000278 -#define BTPRIORITY_STOMP_INT_STAT_BITMAP_MSB 31 -#define BTPRIORITY_STOMP_INT_STAT_BITMAP_LSB 0 -#define BTPRIORITY_STOMP_INT_STAT_BITMAP_MASK 0xffffffff -#define BTPRIORITY_STOMP_INT_STAT_BITMAP_GET(x) (((x) & BTPRIORITY_STOMP_INT_STAT_BITMAP_MASK) >> BTPRIORITY_STOMP_INT_STAT_BITMAP_LSB) -#define BTPRIORITY_STOMP_INT_STAT_BITMAP_SET(x) (((x) << BTPRIORITY_STOMP_INT_STAT_BITMAP_LSB) & BTPRIORITY_STOMP_INT_STAT_BITMAP_MASK) - -#define MAC_PCU_BMISS_TIMEOUT_ADDRESS 0x0000027c -#define MAC_PCU_BMISS_TIMEOUT_OFFSET 0x0000027c -#define MAC_PCU_BMISS_TIMEOUT_ENABLE_MSB 24 -#define MAC_PCU_BMISS_TIMEOUT_ENABLE_LSB 24 -#define MAC_PCU_BMISS_TIMEOUT_ENABLE_MASK 0x01000000 -#define MAC_PCU_BMISS_TIMEOUT_ENABLE_GET(x) (((x) & MAC_PCU_BMISS_TIMEOUT_ENABLE_MASK) >> MAC_PCU_BMISS_TIMEOUT_ENABLE_LSB) -#define MAC_PCU_BMISS_TIMEOUT_ENABLE_SET(x) (((x) << MAC_PCU_BMISS_TIMEOUT_ENABLE_LSB) & MAC_PCU_BMISS_TIMEOUT_ENABLE_MASK) -#define MAC_PCU_BMISS_TIMEOUT_VALUE_MSB 23 -#define MAC_PCU_BMISS_TIMEOUT_VALUE_LSB 0 -#define MAC_PCU_BMISS_TIMEOUT_VALUE_MASK 0x00ffffff -#define MAC_PCU_BMISS_TIMEOUT_VALUE_GET(x) (((x) & MAC_PCU_BMISS_TIMEOUT_VALUE_MASK) >> MAC_PCU_BMISS_TIMEOUT_VALUE_LSB) -#define MAC_PCU_BMISS_TIMEOUT_VALUE_SET(x) (((x) << MAC_PCU_BMISS_TIMEOUT_VALUE_LSB) & MAC_PCU_BMISS_TIMEOUT_VALUE_MASK) - -#define MAC_PCU_CAB_AWAKE_ADDRESS 0x00000280 -#define MAC_PCU_CAB_AWAKE_OFFSET 0x00000280 -#define MAC_PCU_CAB_AWAKE_ENABLE_MSB 16 -#define MAC_PCU_CAB_AWAKE_ENABLE_LSB 16 -#define MAC_PCU_CAB_AWAKE_ENABLE_MASK 0x00010000 -#define MAC_PCU_CAB_AWAKE_ENABLE_GET(x) (((x) & MAC_PCU_CAB_AWAKE_ENABLE_MASK) >> MAC_PCU_CAB_AWAKE_ENABLE_LSB) -#define MAC_PCU_CAB_AWAKE_ENABLE_SET(x) (((x) << MAC_PCU_CAB_AWAKE_ENABLE_LSB) & MAC_PCU_CAB_AWAKE_ENABLE_MASK) -#define MAC_PCU_CAB_AWAKE_DURATION_MSB 15 -#define MAC_PCU_CAB_AWAKE_DURATION_LSB 0 -#define MAC_PCU_CAB_AWAKE_DURATION_MASK 0x0000ffff -#define MAC_PCU_CAB_AWAKE_DURATION_GET(x) (((x) & MAC_PCU_CAB_AWAKE_DURATION_MASK) >> MAC_PCU_CAB_AWAKE_DURATION_LSB) -#define MAC_PCU_CAB_AWAKE_DURATION_SET(x) (((x) << MAC_PCU_CAB_AWAKE_DURATION_LSB) & MAC_PCU_CAB_AWAKE_DURATION_MASK) - -#define LP_PERF_COUNTER_ADDRESS 0x00000284 -#define LP_PERF_COUNTER_OFFSET 0x00000284 -#define LP_PERF_COUNTER_EN_MSB 0 -#define LP_PERF_COUNTER_EN_LSB 0 -#define LP_PERF_COUNTER_EN_MASK 0x00000001 -#define LP_PERF_COUNTER_EN_GET(x) (((x) & LP_PERF_COUNTER_EN_MASK) >> LP_PERF_COUNTER_EN_LSB) -#define LP_PERF_COUNTER_EN_SET(x) (((x) << LP_PERF_COUNTER_EN_LSB) & LP_PERF_COUNTER_EN_MASK) - -#define LP_PERF_LIGHT_SLEEP_ADDRESS 0x00000288 -#define LP_PERF_LIGHT_SLEEP_OFFSET 0x00000288 -#define LP_PERF_LIGHT_SLEEP_CNT_MSB 31 -#define LP_PERF_LIGHT_SLEEP_CNT_LSB 0 -#define LP_PERF_LIGHT_SLEEP_CNT_MASK 0xffffffff -#define LP_PERF_LIGHT_SLEEP_CNT_GET(x) (((x) & LP_PERF_LIGHT_SLEEP_CNT_MASK) >> LP_PERF_LIGHT_SLEEP_CNT_LSB) -#define LP_PERF_LIGHT_SLEEP_CNT_SET(x) (((x) << LP_PERF_LIGHT_SLEEP_CNT_LSB) & LP_PERF_LIGHT_SLEEP_CNT_MASK) - -#define LP_PERF_DEEP_SLEEP_ADDRESS 0x0000028c -#define LP_PERF_DEEP_SLEEP_OFFSET 0x0000028c -#define LP_PERF_DEEP_SLEEP_CNT_MSB 31 -#define LP_PERF_DEEP_SLEEP_CNT_LSB 0 -#define LP_PERF_DEEP_SLEEP_CNT_MASK 0xffffffff -#define LP_PERF_DEEP_SLEEP_CNT_GET(x) (((x) & LP_PERF_DEEP_SLEEP_CNT_MASK) >> LP_PERF_DEEP_SLEEP_CNT_LSB) -#define LP_PERF_DEEP_SLEEP_CNT_SET(x) (((x) << LP_PERF_DEEP_SLEEP_CNT_LSB) & LP_PERF_DEEP_SLEEP_CNT_MASK) - -#define LP_PERF_ON_ADDRESS 0x00000290 -#define LP_PERF_ON_OFFSET 0x00000290 -#define LP_PERF_ON_CNT_MSB 31 -#define LP_PERF_ON_CNT_LSB 0 -#define LP_PERF_ON_CNT_MASK 0xffffffff -#define LP_PERF_ON_CNT_GET(x) (((x) & LP_PERF_ON_CNT_MASK) >> LP_PERF_ON_CNT_LSB) -#define LP_PERF_ON_CNT_SET(x) (((x) << LP_PERF_ON_CNT_LSB) & LP_PERF_ON_CNT_MASK) - -#define ST_64_BIT_ADDRESS 0x00000294 -#define ST_64_BIT_OFFSET 0x00000294 -#define ST_64_BIT_TIMEOUT_MSB 26 -#define ST_64_BIT_TIMEOUT_LSB 9 -#define ST_64_BIT_TIMEOUT_MASK 0x07fffe00 -#define ST_64_BIT_TIMEOUT_GET(x) (((x) & ST_64_BIT_TIMEOUT_MASK) >> ST_64_BIT_TIMEOUT_LSB) -#define ST_64_BIT_TIMEOUT_SET(x) (((x) << ST_64_BIT_TIMEOUT_LSB) & ST_64_BIT_TIMEOUT_MASK) -#define ST_64_BIT_REQ_ACK_NOT_PULLED_DOWN_MSB 8 -#define ST_64_BIT_REQ_ACK_NOT_PULLED_DOWN_LSB 8 -#define ST_64_BIT_REQ_ACK_NOT_PULLED_DOWN_MASK 0x00000100 -#define ST_64_BIT_REQ_ACK_NOT_PULLED_DOWN_GET(x) (((x) & ST_64_BIT_REQ_ACK_NOT_PULLED_DOWN_MASK) >> ST_64_BIT_REQ_ACK_NOT_PULLED_DOWN_LSB) -#define ST_64_BIT_REQ_ACK_NOT_PULLED_DOWN_SET(x) (((x) << ST_64_BIT_REQ_ACK_NOT_PULLED_DOWN_LSB) & ST_64_BIT_REQ_ACK_NOT_PULLED_DOWN_MASK) -#define ST_64_BIT_DRIVE_MODE_MSB 7 -#define ST_64_BIT_DRIVE_MODE_LSB 7 -#define ST_64_BIT_DRIVE_MODE_MASK 0x00000080 -#define ST_64_BIT_DRIVE_MODE_GET(x) (((x) & ST_64_BIT_DRIVE_MODE_MASK) >> ST_64_BIT_DRIVE_MODE_LSB) -#define ST_64_BIT_DRIVE_MODE_SET(x) (((x) << ST_64_BIT_DRIVE_MODE_LSB) & ST_64_BIT_DRIVE_MODE_MASK) -#define ST_64_BIT_CLOCK_GATE_MSB 6 -#define ST_64_BIT_CLOCK_GATE_LSB 6 -#define ST_64_BIT_CLOCK_GATE_MASK 0x00000040 -#define ST_64_BIT_CLOCK_GATE_GET(x) (((x) & ST_64_BIT_CLOCK_GATE_MASK) >> ST_64_BIT_CLOCK_GATE_LSB) -#define ST_64_BIT_CLOCK_GATE_SET(x) (((x) << ST_64_BIT_CLOCK_GATE_LSB) & ST_64_BIT_CLOCK_GATE_MASK) -#define ST_64_BIT_SOC_CLK_DIVIDE_RATIO_MSB 5 -#define ST_64_BIT_SOC_CLK_DIVIDE_RATIO_LSB 1 -#define ST_64_BIT_SOC_CLK_DIVIDE_RATIO_MASK 0x0000003e -#define ST_64_BIT_SOC_CLK_DIVIDE_RATIO_GET(x) (((x) & ST_64_BIT_SOC_CLK_DIVIDE_RATIO_MASK) >> ST_64_BIT_SOC_CLK_DIVIDE_RATIO_LSB) -#define ST_64_BIT_SOC_CLK_DIVIDE_RATIO_SET(x) (((x) << ST_64_BIT_SOC_CLK_DIVIDE_RATIO_LSB) & ST_64_BIT_SOC_CLK_DIVIDE_RATIO_MASK) -#define ST_64_BIT_MODE_MSB 0 -#define ST_64_BIT_MODE_LSB 0 -#define ST_64_BIT_MODE_MASK 0x00000001 -#define ST_64_BIT_MODE_GET(x) (((x) & ST_64_BIT_MODE_MASK) >> ST_64_BIT_MODE_LSB) -#define ST_64_BIT_MODE_SET(x) (((x) << ST_64_BIT_MODE_LSB) & ST_64_BIT_MODE_MASK) - -#define MESSAGE_WR_ADDRESS 0x00000298 -#define MESSAGE_WR_OFFSET 0x00000298 -#define MESSAGE_WR_TYPE_MSB 31 -#define MESSAGE_WR_TYPE_LSB 0 -#define MESSAGE_WR_TYPE_MASK 0xffffffff -#define MESSAGE_WR_TYPE_GET(x) (((x) & MESSAGE_WR_TYPE_MASK) >> MESSAGE_WR_TYPE_LSB) -#define MESSAGE_WR_TYPE_SET(x) (((x) << MESSAGE_WR_TYPE_LSB) & MESSAGE_WR_TYPE_MASK) - -#define MESSAGE_WR_P_ADDRESS 0x0000029c -#define MESSAGE_WR_P_OFFSET 0x0000029c -#define MESSAGE_WR_P_PARAMETER_MSB 31 -#define MESSAGE_WR_P_PARAMETER_LSB 0 -#define MESSAGE_WR_P_PARAMETER_MASK 0xffffffff -#define MESSAGE_WR_P_PARAMETER_GET(x) (((x) & MESSAGE_WR_P_PARAMETER_MASK) >> MESSAGE_WR_P_PARAMETER_LSB) -#define MESSAGE_WR_P_PARAMETER_SET(x) (((x) << MESSAGE_WR_P_PARAMETER_LSB) & MESSAGE_WR_P_PARAMETER_MASK) - -#define MESSAGE_RD_ADDRESS 0x000002a0 -#define MESSAGE_RD_OFFSET 0x000002a0 -#define MESSAGE_RD_TYPE_MSB 31 -#define MESSAGE_RD_TYPE_LSB 0 -#define MESSAGE_RD_TYPE_MASK 0xffffffff -#define MESSAGE_RD_TYPE_GET(x) (((x) & MESSAGE_RD_TYPE_MASK) >> MESSAGE_RD_TYPE_LSB) -#define MESSAGE_RD_TYPE_SET(x) (((x) << MESSAGE_RD_TYPE_LSB) & MESSAGE_RD_TYPE_MASK) - -#define MESSAGE_RD_P_ADDRESS 0x000002a4 -#define MESSAGE_RD_P_OFFSET 0x000002a4 -#define MESSAGE_RD_P_PARAMETER_MSB 31 -#define MESSAGE_RD_P_PARAMETER_LSB 0 -#define MESSAGE_RD_P_PARAMETER_MASK 0xffffffff -#define MESSAGE_RD_P_PARAMETER_GET(x) (((x) & MESSAGE_RD_P_PARAMETER_MASK) >> MESSAGE_RD_P_PARAMETER_LSB) -#define MESSAGE_RD_P_PARAMETER_SET(x) (((x) << MESSAGE_RD_P_PARAMETER_LSB) & MESSAGE_RD_P_PARAMETER_MASK) - -#define CHIP_MODE_ADDRESS 0x000002a8 -#define CHIP_MODE_OFFSET 0x000002a8 -#define CHIP_MODE_BIT_MSB 1 -#define CHIP_MODE_BIT_LSB 0 -#define CHIP_MODE_BIT_MASK 0x00000003 -#define CHIP_MODE_BIT_GET(x) (((x) & CHIP_MODE_BIT_MASK) >> CHIP_MODE_BIT_LSB) -#define CHIP_MODE_BIT_SET(x) (((x) << CHIP_MODE_BIT_LSB) & CHIP_MODE_BIT_MASK) - -#define CLK_REQ_FALL_EDGE_ADDRESS 0x000002ac -#define CLK_REQ_FALL_EDGE_OFFSET 0x000002ac -#define CLK_REQ_FALL_EDGE_EN_MSB 31 -#define CLK_REQ_FALL_EDGE_EN_LSB 31 -#define CLK_REQ_FALL_EDGE_EN_MASK 0x80000000 -#define CLK_REQ_FALL_EDGE_EN_GET(x) (((x) & CLK_REQ_FALL_EDGE_EN_MASK) >> CLK_REQ_FALL_EDGE_EN_LSB) -#define CLK_REQ_FALL_EDGE_EN_SET(x) (((x) << CLK_REQ_FALL_EDGE_EN_LSB) & CLK_REQ_FALL_EDGE_EN_MASK) -#define CLK_REQ_FALL_EDGE_DELAY_MSB 7 -#define CLK_REQ_FALL_EDGE_DELAY_LSB 0 -#define CLK_REQ_FALL_EDGE_DELAY_MASK 0x000000ff -#define CLK_REQ_FALL_EDGE_DELAY_GET(x) (((x) & CLK_REQ_FALL_EDGE_DELAY_MASK) >> CLK_REQ_FALL_EDGE_DELAY_LSB) -#define CLK_REQ_FALL_EDGE_DELAY_SET(x) (((x) << CLK_REQ_FALL_EDGE_DELAY_LSB) & CLK_REQ_FALL_EDGE_DELAY_MASK) - -#define OTP_ADDRESS 0x000002b0 -#define OTP_OFFSET 0x000002b0 -#define OTP_LDO25_EN_MSB 1 -#define OTP_LDO25_EN_LSB 1 -#define OTP_LDO25_EN_MASK 0x00000002 -#define OTP_LDO25_EN_GET(x) (((x) & OTP_LDO25_EN_MASK) >> OTP_LDO25_EN_LSB) -#define OTP_LDO25_EN_SET(x) (((x) << OTP_LDO25_EN_LSB) & OTP_LDO25_EN_MASK) -#define OTP_VDD12_EN_MSB 0 -#define OTP_VDD12_EN_LSB 0 -#define OTP_VDD12_EN_MASK 0x00000001 -#define OTP_VDD12_EN_GET(x) (((x) & OTP_VDD12_EN_MASK) >> OTP_VDD12_EN_LSB) -#define OTP_VDD12_EN_SET(x) (((x) << OTP_VDD12_EN_LSB) & OTP_VDD12_EN_MASK) - -#define OTP_STATUS_ADDRESS 0x000002b4 -#define OTP_STATUS_OFFSET 0x000002b4 -#define OTP_STATUS_LDO25_EN_READY_MSB 1 -#define OTP_STATUS_LDO25_EN_READY_LSB 1 -#define OTP_STATUS_LDO25_EN_READY_MASK 0x00000002 -#define OTP_STATUS_LDO25_EN_READY_GET(x) (((x) & OTP_STATUS_LDO25_EN_READY_MASK) >> OTP_STATUS_LDO25_EN_READY_LSB) -#define OTP_STATUS_LDO25_EN_READY_SET(x) (((x) << OTP_STATUS_LDO25_EN_READY_LSB) & OTP_STATUS_LDO25_EN_READY_MASK) -#define OTP_STATUS_VDD12_EN_READY_MSB 0 -#define OTP_STATUS_VDD12_EN_READY_LSB 0 -#define OTP_STATUS_VDD12_EN_READY_MASK 0x00000001 -#define OTP_STATUS_VDD12_EN_READY_GET(x) (((x) & OTP_STATUS_VDD12_EN_READY_MASK) >> OTP_STATUS_VDD12_EN_READY_LSB) -#define OTP_STATUS_VDD12_EN_READY_SET(x) (((x) << OTP_STATUS_VDD12_EN_READY_LSB) & OTP_STATUS_VDD12_EN_READY_MASK) - -#define PMU_ADDRESS 0x000002b8 -#define PMU_OFFSET 0x000002b8 -#define PMU_REG_WAKEUP_TIME_SEL_MSB 1 -#define PMU_REG_WAKEUP_TIME_SEL_LSB 0 -#define PMU_REG_WAKEUP_TIME_SEL_MASK 0x00000003 -#define PMU_REG_WAKEUP_TIME_SEL_GET(x) (((x) & PMU_REG_WAKEUP_TIME_SEL_MASK) >> PMU_REG_WAKEUP_TIME_SEL_LSB) -#define PMU_REG_WAKEUP_TIME_SEL_SET(x) (((x) << PMU_REG_WAKEUP_TIME_SEL_LSB) & PMU_REG_WAKEUP_TIME_SEL_MASK) - -#define PMU_CONFIG_ADDRESS 0x000002c0 -#define PMU_CONFIG_OFFSET 0x000002c0 -#define PMU_CONFIG_VALUE_MSB 15 -#define PMU_CONFIG_VALUE_LSB 0 -#define PMU_CONFIG_VALUE_MASK 0x0000ffff -#define PMU_CONFIG_VALUE_GET(x) (((x) & PMU_CONFIG_VALUE_MASK) >> PMU_CONFIG_VALUE_LSB) -#define PMU_CONFIG_VALUE_SET(x) (((x) << PMU_CONFIG_VALUE_LSB) & PMU_CONFIG_VALUE_MASK) - -#define PMU_BYPASS_ADDRESS 0x000002c8 -#define PMU_BYPASS_OFFSET 0x000002c8 -#define PMU_BYPASS_SWREG_MSB 2 -#define PMU_BYPASS_SWREG_LSB 2 -#define PMU_BYPASS_SWREG_MASK 0x00000004 -#define PMU_BYPASS_SWREG_GET(x) (((x) & PMU_BYPASS_SWREG_MASK) >> PMU_BYPASS_SWREG_LSB) -#define PMU_BYPASS_SWREG_SET(x) (((x) << PMU_BYPASS_SWREG_LSB) & PMU_BYPASS_SWREG_MASK) -#define PMU_BYPASS_DREG_MSB 1 -#define PMU_BYPASS_DREG_LSB 1 -#define PMU_BYPASS_DREG_MASK 0x00000002 -#define PMU_BYPASS_DREG_GET(x) (((x) & PMU_BYPASS_DREG_MASK) >> PMU_BYPASS_DREG_LSB) -#define PMU_BYPASS_DREG_SET(x) (((x) << PMU_BYPASS_DREG_LSB) & PMU_BYPASS_DREG_MASK) -#define PMU_BYPASS_PAREG_MSB 0 -#define PMU_BYPASS_PAREG_LSB 0 -#define PMU_BYPASS_PAREG_MASK 0x00000001 -#define PMU_BYPASS_PAREG_GET(x) (((x) & PMU_BYPASS_PAREG_MASK) >> PMU_BYPASS_PAREG_LSB) -#define PMU_BYPASS_PAREG_SET(x) (((x) << PMU_BYPASS_PAREG_LSB) & PMU_BYPASS_PAREG_MASK) - -#define MAC_PCU_TSF2_L32_ADDRESS 0x000002cc -#define MAC_PCU_TSF2_L32_OFFSET 0x000002cc -#define MAC_PCU_TSF2_L32_VALUE_MSB 31 -#define MAC_PCU_TSF2_L32_VALUE_LSB 0 -#define MAC_PCU_TSF2_L32_VALUE_MASK 0xffffffff -#define MAC_PCU_TSF2_L32_VALUE_GET(x) (((x) & MAC_PCU_TSF2_L32_VALUE_MASK) >> MAC_PCU_TSF2_L32_VALUE_LSB) -#define MAC_PCU_TSF2_L32_VALUE_SET(x) (((x) << MAC_PCU_TSF2_L32_VALUE_LSB) & MAC_PCU_TSF2_L32_VALUE_MASK) - -#define MAC_PCU_TSF2_U32_ADDRESS 0x000002d0 -#define MAC_PCU_TSF2_U32_OFFSET 0x000002d0 -#define MAC_PCU_TSF2_U32_VALUE_MSB 31 -#define MAC_PCU_TSF2_U32_VALUE_LSB 0 -#define MAC_PCU_TSF2_U32_VALUE_MASK 0xffffffff -#define MAC_PCU_TSF2_U32_VALUE_GET(x) (((x) & MAC_PCU_TSF2_U32_VALUE_MASK) >> MAC_PCU_TSF2_U32_VALUE_LSB) -#define MAC_PCU_TSF2_U32_VALUE_SET(x) (((x) << MAC_PCU_TSF2_U32_VALUE_LSB) & MAC_PCU_TSF2_U32_VALUE_MASK) - -#define MAC_PCU_GENERIC_TIMERS_MODE3_ADDRESS 0x000002d4 -#define MAC_PCU_GENERIC_TIMERS_MODE3_OFFSET 0x000002d4 -#define MAC_PCU_GENERIC_TIMERS_MODE3_OVERFLOW_INDEX_MSB 27 -#define MAC_PCU_GENERIC_TIMERS_MODE3_OVERFLOW_INDEX_LSB 24 -#define MAC_PCU_GENERIC_TIMERS_MODE3_OVERFLOW_INDEX_MASK 0x0f000000 -#define MAC_PCU_GENERIC_TIMERS_MODE3_OVERFLOW_INDEX_GET(x) (((x) & MAC_PCU_GENERIC_TIMERS_MODE3_OVERFLOW_INDEX_MASK) >> MAC_PCU_GENERIC_TIMERS_MODE3_OVERFLOW_INDEX_LSB) -#define MAC_PCU_GENERIC_TIMERS_MODE3_OVERFLOW_INDEX_SET(x) (((x) << MAC_PCU_GENERIC_TIMERS_MODE3_OVERFLOW_INDEX_LSB) & MAC_PCU_GENERIC_TIMERS_MODE3_OVERFLOW_INDEX_MASK) -#define MAC_PCU_GENERIC_TIMERS_MODE3_THRESH_MSB 19 -#define MAC_PCU_GENERIC_TIMERS_MODE3_THRESH_LSB 0 -#define MAC_PCU_GENERIC_TIMERS_MODE3_THRESH_MASK 0x000fffff -#define MAC_PCU_GENERIC_TIMERS_MODE3_THRESH_GET(x) (((x) & MAC_PCU_GENERIC_TIMERS_MODE3_THRESH_MASK) >> MAC_PCU_GENERIC_TIMERS_MODE3_THRESH_LSB) -#define MAC_PCU_GENERIC_TIMERS_MODE3_THRESH_SET(x) (((x) << MAC_PCU_GENERIC_TIMERS_MODE3_THRESH_LSB) & MAC_PCU_GENERIC_TIMERS_MODE3_THRESH_MASK) - -#define MAC_PCU_DIRECT_CONNECT_ADDRESS 0x000002d8 -#define MAC_PCU_DIRECT_CONNECT_OFFSET 0x000002d8 -#define MAC_PCU_DIRECT_CONNECT_STA_TSF_1_2_SEL_MSB 2 -#define MAC_PCU_DIRECT_CONNECT_STA_TSF_1_2_SEL_LSB 2 -#define MAC_PCU_DIRECT_CONNECT_STA_TSF_1_2_SEL_MASK 0x00000004 -#define MAC_PCU_DIRECT_CONNECT_STA_TSF_1_2_SEL_GET(x) (((x) & MAC_PCU_DIRECT_CONNECT_STA_TSF_1_2_SEL_MASK) >> MAC_PCU_DIRECT_CONNECT_STA_TSF_1_2_SEL_LSB) -#define MAC_PCU_DIRECT_CONNECT_STA_TSF_1_2_SEL_SET(x) (((x) << MAC_PCU_DIRECT_CONNECT_STA_TSF_1_2_SEL_LSB) & MAC_PCU_DIRECT_CONNECT_STA_TSF_1_2_SEL_MASK) -#define MAC_PCU_DIRECT_CONNECT_AP_TSF_1_2_SEL_MSB 1 -#define MAC_PCU_DIRECT_CONNECT_AP_TSF_1_2_SEL_LSB 1 -#define MAC_PCU_DIRECT_CONNECT_AP_TSF_1_2_SEL_MASK 0x00000002 -#define MAC_PCU_DIRECT_CONNECT_AP_TSF_1_2_SEL_GET(x) (((x) & MAC_PCU_DIRECT_CONNECT_AP_TSF_1_2_SEL_MASK) >> MAC_PCU_DIRECT_CONNECT_AP_TSF_1_2_SEL_LSB) -#define MAC_PCU_DIRECT_CONNECT_AP_TSF_1_2_SEL_SET(x) (((x) << MAC_PCU_DIRECT_CONNECT_AP_TSF_1_2_SEL_LSB) & MAC_PCU_DIRECT_CONNECT_AP_TSF_1_2_SEL_MASK) -#define MAC_PCU_DIRECT_CONNECT_AP_STA_ENABLE_MSB 0 -#define MAC_PCU_DIRECT_CONNECT_AP_STA_ENABLE_LSB 0 -#define MAC_PCU_DIRECT_CONNECT_AP_STA_ENABLE_MASK 0x00000001 -#define MAC_PCU_DIRECT_CONNECT_AP_STA_ENABLE_GET(x) (((x) & MAC_PCU_DIRECT_CONNECT_AP_STA_ENABLE_MASK) >> MAC_PCU_DIRECT_CONNECT_AP_STA_ENABLE_LSB) -#define MAC_PCU_DIRECT_CONNECT_AP_STA_ENABLE_SET(x) (((x) << MAC_PCU_DIRECT_CONNECT_AP_STA_ENABLE_LSB) & MAC_PCU_DIRECT_CONNECT_AP_STA_ENABLE_MASK) - -#define THERM_CTRL1_ADDRESS 0x000002dc -#define THERM_CTRL1_OFFSET 0x000002dc -#define THERM_CTRL1_BYPASS_MSB 16 -#define THERM_CTRL1_BYPASS_LSB 16 -#define THERM_CTRL1_BYPASS_MASK 0x00010000 -#define THERM_CTRL1_BYPASS_GET(x) (((x) & THERM_CTRL1_BYPASS_MASK) >> THERM_CTRL1_BYPASS_LSB) -#define THERM_CTRL1_BYPASS_SET(x) (((x) << THERM_CTRL1_BYPASS_LSB) & THERM_CTRL1_BYPASS_MASK) -#define THERM_CTRL1_WIDTH_ARBITOR_MSB 15 -#define THERM_CTRL1_WIDTH_ARBITOR_LSB 12 -#define THERM_CTRL1_WIDTH_ARBITOR_MASK 0x0000f000 -#define THERM_CTRL1_WIDTH_ARBITOR_GET(x) (((x) & THERM_CTRL1_WIDTH_ARBITOR_MASK) >> THERM_CTRL1_WIDTH_ARBITOR_LSB) -#define THERM_CTRL1_WIDTH_ARBITOR_SET(x) (((x) << THERM_CTRL1_WIDTH_ARBITOR_LSB) & THERM_CTRL1_WIDTH_ARBITOR_MASK) -#define THERM_CTRL1_WIDTH_MSB 11 -#define THERM_CTRL1_WIDTH_LSB 5 -#define THERM_CTRL1_WIDTH_MASK 0x00000fe0 -#define THERM_CTRL1_WIDTH_GET(x) (((x) & THERM_CTRL1_WIDTH_MASK) >> THERM_CTRL1_WIDTH_LSB) -#define THERM_CTRL1_WIDTH_SET(x) (((x) << THERM_CTRL1_WIDTH_LSB) & THERM_CTRL1_WIDTH_MASK) -#define THERM_CTRL1_TYPE_MSB 4 -#define THERM_CTRL1_TYPE_LSB 3 -#define THERM_CTRL1_TYPE_MASK 0x00000018 -#define THERM_CTRL1_TYPE_GET(x) (((x) & THERM_CTRL1_TYPE_MASK) >> THERM_CTRL1_TYPE_LSB) -#define THERM_CTRL1_TYPE_SET(x) (((x) << THERM_CTRL1_TYPE_LSB) & THERM_CTRL1_TYPE_MASK) -#define THERM_CTRL1_MEASURE_MSB 2 -#define THERM_CTRL1_MEASURE_LSB 2 -#define THERM_CTRL1_MEASURE_MASK 0x00000004 -#define THERM_CTRL1_MEASURE_GET(x) (((x) & THERM_CTRL1_MEASURE_MASK) >> THERM_CTRL1_MEASURE_LSB) -#define THERM_CTRL1_MEASURE_SET(x) (((x) << THERM_CTRL1_MEASURE_LSB) & THERM_CTRL1_MEASURE_MASK) -#define THERM_CTRL1_INT_EN_MSB 1 -#define THERM_CTRL1_INT_EN_LSB 1 -#define THERM_CTRL1_INT_EN_MASK 0x00000002 -#define THERM_CTRL1_INT_EN_GET(x) (((x) & THERM_CTRL1_INT_EN_MASK) >> THERM_CTRL1_INT_EN_LSB) -#define THERM_CTRL1_INT_EN_SET(x) (((x) << THERM_CTRL1_INT_EN_LSB) & THERM_CTRL1_INT_EN_MASK) -#define THERM_CTRL1_INT_STATUS_MSB 0 -#define THERM_CTRL1_INT_STATUS_LSB 0 -#define THERM_CTRL1_INT_STATUS_MASK 0x00000001 -#define THERM_CTRL1_INT_STATUS_GET(x) (((x) & THERM_CTRL1_INT_STATUS_MASK) >> THERM_CTRL1_INT_STATUS_LSB) -#define THERM_CTRL1_INT_STATUS_SET(x) (((x) << THERM_CTRL1_INT_STATUS_LSB) & THERM_CTRL1_INT_STATUS_MASK) - -#define THERM_CTRL2_ADDRESS 0x000002e0 -#define THERM_CTRL2_OFFSET 0x000002e0 -#define THERM_CTRL2_ADC_OFF_MSB 25 -#define THERM_CTRL2_ADC_OFF_LSB 25 -#define THERM_CTRL2_ADC_OFF_MASK 0x02000000 -#define THERM_CTRL2_ADC_OFF_GET(x) (((x) & THERM_CTRL2_ADC_OFF_MASK) >> THERM_CTRL2_ADC_OFF_LSB) -#define THERM_CTRL2_ADC_OFF_SET(x) (((x) << THERM_CTRL2_ADC_OFF_LSB) & THERM_CTRL2_ADC_OFF_MASK) -#define THERM_CTRL2_ADC_ON_MSB 24 -#define THERM_CTRL2_ADC_ON_LSB 24 -#define THERM_CTRL2_ADC_ON_MASK 0x01000000 -#define THERM_CTRL2_ADC_ON_GET(x) (((x) & THERM_CTRL2_ADC_ON_MASK) >> THERM_CTRL2_ADC_ON_LSB) -#define THERM_CTRL2_ADC_ON_SET(x) (((x) << THERM_CTRL2_ADC_ON_LSB) & THERM_CTRL2_ADC_ON_MASK) -#define THERM_CTRL2_SAMPLE_MSB 23 -#define THERM_CTRL2_SAMPLE_LSB 16 -#define THERM_CTRL2_SAMPLE_MASK 0x00ff0000 -#define THERM_CTRL2_SAMPLE_GET(x) (((x) & THERM_CTRL2_SAMPLE_MASK) >> THERM_CTRL2_SAMPLE_LSB) -#define THERM_CTRL2_SAMPLE_SET(x) (((x) << THERM_CTRL2_SAMPLE_LSB) & THERM_CTRL2_SAMPLE_MASK) -#define THERM_CTRL2_HIGH_MSB 15 -#define THERM_CTRL2_HIGH_LSB 8 -#define THERM_CTRL2_HIGH_MASK 0x0000ff00 -#define THERM_CTRL2_HIGH_GET(x) (((x) & THERM_CTRL2_HIGH_MASK) >> THERM_CTRL2_HIGH_LSB) -#define THERM_CTRL2_HIGH_SET(x) (((x) << THERM_CTRL2_HIGH_LSB) & THERM_CTRL2_HIGH_MASK) -#define THERM_CTRL2_LOW_MSB 7 -#define THERM_CTRL2_LOW_LSB 0 -#define THERM_CTRL2_LOW_MASK 0x000000ff -#define THERM_CTRL2_LOW_GET(x) (((x) & THERM_CTRL2_LOW_MASK) >> THERM_CTRL2_LOW_LSB) -#define THERM_CTRL2_LOW_SET(x) (((x) << THERM_CTRL2_LOW_LSB) & THERM_CTRL2_LOW_MASK) - -#define THERM_CTRL3_ADDRESS 0x000002e4 -#define THERM_CTRL3_OFFSET 0x000002e4 -#define THERM_CTRL3_ADC_GAIN_MSB 16 -#define THERM_CTRL3_ADC_GAIN_LSB 8 -#define THERM_CTRL3_ADC_GAIN_MASK 0x0001ff00 -#define THERM_CTRL3_ADC_GAIN_GET(x) (((x) & THERM_CTRL3_ADC_GAIN_MASK) >> THERM_CTRL3_ADC_GAIN_LSB) -#define THERM_CTRL3_ADC_GAIN_SET(x) (((x) << THERM_CTRL3_ADC_GAIN_LSB) & THERM_CTRL3_ADC_GAIN_MASK) -#define THERM_CTRL3_ADC_OFFSET_MSB 7 -#define THERM_CTRL3_ADC_OFFSET_LSB 0 -#define THERM_CTRL3_ADC_OFFSET_MASK 0x000000ff -#define THERM_CTRL3_ADC_OFFSET_GET(x) (((x) & THERM_CTRL3_ADC_OFFSET_MASK) >> THERM_CTRL3_ADC_OFFSET_LSB) -#define THERM_CTRL3_ADC_OFFSET_SET(x) (((x) << THERM_CTRL3_ADC_OFFSET_LSB) & THERM_CTRL3_ADC_OFFSET_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct rtc_wlan_reg_reg_s { - volatile unsigned int wlan_reset_control; - volatile unsigned int wlan_xtal_control; - volatile unsigned int wlan_tcxo_detect; - volatile unsigned int wlan_xtal_test; - volatile unsigned int wlan_quadrature; - volatile unsigned int wlan_pll_control; - volatile unsigned int wlan_pll_settle; - volatile unsigned int wlan_xtal_settle; - volatile unsigned int wlan_cpu_clock; - volatile unsigned int wlan_clock_out; - volatile unsigned int wlan_clock_control; - volatile unsigned int wlan_bias_override; - volatile unsigned int wlan_wdt_control; - volatile unsigned int wlan_wdt_status; - volatile unsigned int wlan_wdt; - volatile unsigned int wlan_wdt_count; - volatile unsigned int wlan_wdt_reset; - volatile unsigned int wlan_int_status; - volatile unsigned int wlan_lf_timer0; - volatile unsigned int wlan_lf_timer_count0; - volatile unsigned int wlan_lf_timer_control0; - volatile unsigned int wlan_lf_timer_status0; - volatile unsigned int wlan_lf_timer1; - volatile unsigned int wlan_lf_timer_count1; - volatile unsigned int wlan_lf_timer_control1; - volatile unsigned int wlan_lf_timer_status1; - volatile unsigned int wlan_lf_timer2; - volatile unsigned int wlan_lf_timer_count2; - volatile unsigned int wlan_lf_timer_control2; - volatile unsigned int wlan_lf_timer_status2; - volatile unsigned int wlan_lf_timer3; - volatile unsigned int wlan_lf_timer_count3; - volatile unsigned int wlan_lf_timer_control3; - volatile unsigned int wlan_lf_timer_status3; - volatile unsigned int wlan_hf_timer; - volatile unsigned int wlan_hf_timer_count; - volatile unsigned int wlan_hf_lf_count; - volatile unsigned int wlan_hf_timer_control; - volatile unsigned int wlan_hf_timer_status; - volatile unsigned int wlan_rtc_control; - volatile unsigned int wlan_rtc_time; - volatile unsigned int wlan_rtc_date; - volatile unsigned int wlan_rtc_set_time; - volatile unsigned int wlan_rtc_set_date; - volatile unsigned int wlan_rtc_set_alarm; - volatile unsigned int wlan_rtc_config; - volatile unsigned int wlan_rtc_alarm_status; - volatile unsigned int wlan_uart_wakeup; - volatile unsigned int wlan_reset_cause; - volatile unsigned int wlan_system_sleep; - volatile unsigned int wlan_sdio_wrapper; - volatile unsigned int wlan_mac_sleep_control; - volatile unsigned int wlan_keep_awake; - volatile unsigned int wlan_lpo_cal_time; - volatile unsigned int wlan_lpo_init_dividend_int; - volatile unsigned int wlan_lpo_init_dividend_fraction; - volatile unsigned int wlan_lpo_cal; - volatile unsigned int wlan_lpo_cal_test_control; - volatile unsigned int wlan_lpo_cal_test_status; - volatile unsigned int wlan_chip_id; - volatile unsigned int wlan_derived_rtc_clk; - volatile unsigned int mac_pcu_slp32_mode; - volatile unsigned int mac_pcu_slp32_wake; - volatile unsigned int mac_pcu_slp32_inc; - volatile unsigned int mac_pcu_slp_mib1; - volatile unsigned int mac_pcu_slp_mib2; - volatile unsigned int mac_pcu_slp_mib3; - volatile unsigned int wlan_power_reg; - volatile unsigned int wlan_core_clk_ctrl; - volatile unsigned int wlan_gpio_wakeup_control; - volatile unsigned int ht; - volatile unsigned int mac_pcu_tsf_l32; - volatile unsigned int mac_pcu_tsf_u32; - volatile unsigned int mac_pcu_wbtimer; - unsigned char pad0[24]; /* pad to 0x140 */ - volatile unsigned int mac_pcu_generic_timers[16]; - volatile unsigned int mac_pcu_generic_timers_mode; - unsigned char pad1[60]; /* pad to 0x1c0 */ - volatile unsigned int mac_pcu_generic_timers2[16]; - volatile unsigned int mac_pcu_generic_timers_mode2; - volatile unsigned int mac_pcu_slp1; - volatile unsigned int mac_pcu_slp2; - volatile unsigned int mac_pcu_reset_tsf; - volatile unsigned int mac_pcu_tsf_add_pll; - volatile unsigned int sleep_retention; - volatile unsigned int btcoexctrl; - volatile unsigned int wbsync_priority1; - volatile unsigned int wbsync_priority2; - volatile unsigned int wbsync_priority3; - volatile unsigned int btcoex0; - volatile unsigned int btcoex1; - volatile unsigned int btcoex2; - volatile unsigned int btcoex3; - volatile unsigned int btcoex4; - volatile unsigned int btcoex5; - volatile unsigned int btcoex6; - volatile unsigned int lock; - volatile unsigned int nolock_priority; - volatile unsigned int wbsync; - volatile unsigned int wbsync1; - volatile unsigned int wbsync2; - volatile unsigned int wbsync3; - volatile unsigned int wb_timer_target; - volatile unsigned int wb_timer_slop; - volatile unsigned int btcoex_int_en; - volatile unsigned int btcoex_int_stat; - volatile unsigned int btpriority_int_en; - volatile unsigned int btpriority_int_stat; - volatile unsigned int btpriority_stomp_int_en; - volatile unsigned int btpriority_stomp_int_stat; - volatile unsigned int mac_pcu_bmiss_timeout; - volatile unsigned int mac_pcu_cab_awake; - volatile unsigned int lp_perf_counter; - volatile unsigned int lp_perf_light_sleep; - volatile unsigned int lp_perf_deep_sleep; - volatile unsigned int lp_perf_on; - volatile unsigned int st_64_bit; - volatile unsigned int message_wr; - volatile unsigned int message_wr_p; - volatile unsigned int message_rd; - volatile unsigned int message_rd_p; - volatile unsigned int chip_mode; - volatile unsigned int clk_req_fall_edge; - volatile unsigned int otp; - volatile unsigned int otp_status; - volatile unsigned int pmu; - unsigned char pad2[4]; /* pad to 0x2c0 */ - volatile unsigned int pmu_config[2]; - volatile unsigned int pmu_bypass; - volatile unsigned int mac_pcu_tsf2_l32; - volatile unsigned int mac_pcu_tsf2_u32; - volatile unsigned int mac_pcu_generic_timers_mode3; - volatile unsigned int mac_pcu_direct_connect; - volatile unsigned int therm_ctrl1; - volatile unsigned int therm_ctrl2; - volatile unsigned int therm_ctrl3; -} rtc_wlan_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _RTC_WLAN_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/si_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/si_reg.h deleted file mode 100644 index f66796baee48..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/si_reg.h +++ /dev/null @@ -1,209 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _SI_REG_REG_H_ -#define _SI_REG_REG_H_ - -#define SI_CONFIG_ADDRESS 0x00000000 -#define SI_CONFIG_OFFSET 0x00000000 -#define SI_CONFIG_ERR_INT_MSB 19 -#define SI_CONFIG_ERR_INT_LSB 19 -#define SI_CONFIG_ERR_INT_MASK 0x00080000 -#define SI_CONFIG_ERR_INT_GET(x) (((x) & SI_CONFIG_ERR_INT_MASK) >> SI_CONFIG_ERR_INT_LSB) -#define SI_CONFIG_ERR_INT_SET(x) (((x) << SI_CONFIG_ERR_INT_LSB) & SI_CONFIG_ERR_INT_MASK) -#define SI_CONFIG_BIDIR_OD_DATA_MSB 18 -#define SI_CONFIG_BIDIR_OD_DATA_LSB 18 -#define SI_CONFIG_BIDIR_OD_DATA_MASK 0x00040000 -#define SI_CONFIG_BIDIR_OD_DATA_GET(x) (((x) & SI_CONFIG_BIDIR_OD_DATA_MASK) >> SI_CONFIG_BIDIR_OD_DATA_LSB) -#define SI_CONFIG_BIDIR_OD_DATA_SET(x) (((x) << SI_CONFIG_BIDIR_OD_DATA_LSB) & SI_CONFIG_BIDIR_OD_DATA_MASK) -#define SI_CONFIG_I2C_MSB 16 -#define SI_CONFIG_I2C_LSB 16 -#define SI_CONFIG_I2C_MASK 0x00010000 -#define SI_CONFIG_I2C_GET(x) (((x) & SI_CONFIG_I2C_MASK) >> SI_CONFIG_I2C_LSB) -#define SI_CONFIG_I2C_SET(x) (((x) << SI_CONFIG_I2C_LSB) & SI_CONFIG_I2C_MASK) -#define SI_CONFIG_POS_SAMPLE_MSB 7 -#define SI_CONFIG_POS_SAMPLE_LSB 7 -#define SI_CONFIG_POS_SAMPLE_MASK 0x00000080 -#define SI_CONFIG_POS_SAMPLE_GET(x) (((x) & SI_CONFIG_POS_SAMPLE_MASK) >> SI_CONFIG_POS_SAMPLE_LSB) -#define SI_CONFIG_POS_SAMPLE_SET(x) (((x) << SI_CONFIG_POS_SAMPLE_LSB) & SI_CONFIG_POS_SAMPLE_MASK) -#define SI_CONFIG_POS_DRIVE_MSB 6 -#define SI_CONFIG_POS_DRIVE_LSB 6 -#define SI_CONFIG_POS_DRIVE_MASK 0x00000040 -#define SI_CONFIG_POS_DRIVE_GET(x) (((x) & SI_CONFIG_POS_DRIVE_MASK) >> SI_CONFIG_POS_DRIVE_LSB) -#define SI_CONFIG_POS_DRIVE_SET(x) (((x) << SI_CONFIG_POS_DRIVE_LSB) & SI_CONFIG_POS_DRIVE_MASK) -#define SI_CONFIG_INACTIVE_DATA_MSB 5 -#define SI_CONFIG_INACTIVE_DATA_LSB 5 -#define SI_CONFIG_INACTIVE_DATA_MASK 0x00000020 -#define SI_CONFIG_INACTIVE_DATA_GET(x) (((x) & SI_CONFIG_INACTIVE_DATA_MASK) >> SI_CONFIG_INACTIVE_DATA_LSB) -#define SI_CONFIG_INACTIVE_DATA_SET(x) (((x) << SI_CONFIG_INACTIVE_DATA_LSB) & SI_CONFIG_INACTIVE_DATA_MASK) -#define SI_CONFIG_INACTIVE_CLK_MSB 4 -#define SI_CONFIG_INACTIVE_CLK_LSB 4 -#define SI_CONFIG_INACTIVE_CLK_MASK 0x00000010 -#define SI_CONFIG_INACTIVE_CLK_GET(x) (((x) & SI_CONFIG_INACTIVE_CLK_MASK) >> SI_CONFIG_INACTIVE_CLK_LSB) -#define SI_CONFIG_INACTIVE_CLK_SET(x) (((x) << SI_CONFIG_INACTIVE_CLK_LSB) & SI_CONFIG_INACTIVE_CLK_MASK) -#define SI_CONFIG_DIVIDER_MSB 3 -#define SI_CONFIG_DIVIDER_LSB 0 -#define SI_CONFIG_DIVIDER_MASK 0x0000000f -#define SI_CONFIG_DIVIDER_GET(x) (((x) & SI_CONFIG_DIVIDER_MASK) >> SI_CONFIG_DIVIDER_LSB) -#define SI_CONFIG_DIVIDER_SET(x) (((x) << SI_CONFIG_DIVIDER_LSB) & SI_CONFIG_DIVIDER_MASK) - -#define SI_CS_ADDRESS 0x00000004 -#define SI_CS_OFFSET 0x00000004 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_MSB 13 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_LSB 11 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_MASK 0x00003800 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_GET(x) (((x) & SI_CS_BIT_CNT_IN_LAST_BYTE_MASK) >> SI_CS_BIT_CNT_IN_LAST_BYTE_LSB) -#define SI_CS_BIT_CNT_IN_LAST_BYTE_SET(x) (((x) << SI_CS_BIT_CNT_IN_LAST_BYTE_LSB) & SI_CS_BIT_CNT_IN_LAST_BYTE_MASK) -#define SI_CS_DONE_ERR_MSB 10 -#define SI_CS_DONE_ERR_LSB 10 -#define SI_CS_DONE_ERR_MASK 0x00000400 -#define SI_CS_DONE_ERR_GET(x) (((x) & SI_CS_DONE_ERR_MASK) >> SI_CS_DONE_ERR_LSB) -#define SI_CS_DONE_ERR_SET(x) (((x) << SI_CS_DONE_ERR_LSB) & SI_CS_DONE_ERR_MASK) -#define SI_CS_DONE_INT_MSB 9 -#define SI_CS_DONE_INT_LSB 9 -#define SI_CS_DONE_INT_MASK 0x00000200 -#define SI_CS_DONE_INT_GET(x) (((x) & SI_CS_DONE_INT_MASK) >> SI_CS_DONE_INT_LSB) -#define SI_CS_DONE_INT_SET(x) (((x) << SI_CS_DONE_INT_LSB) & SI_CS_DONE_INT_MASK) -#define SI_CS_START_MSB 8 -#define SI_CS_START_LSB 8 -#define SI_CS_START_MASK 0x00000100 -#define SI_CS_START_GET(x) (((x) & SI_CS_START_MASK) >> SI_CS_START_LSB) -#define SI_CS_START_SET(x) (((x) << SI_CS_START_LSB) & SI_CS_START_MASK) -#define SI_CS_RX_CNT_MSB 7 -#define SI_CS_RX_CNT_LSB 4 -#define SI_CS_RX_CNT_MASK 0x000000f0 -#define SI_CS_RX_CNT_GET(x) (((x) & SI_CS_RX_CNT_MASK) >> SI_CS_RX_CNT_LSB) -#define SI_CS_RX_CNT_SET(x) (((x) << SI_CS_RX_CNT_LSB) & SI_CS_RX_CNT_MASK) -#define SI_CS_TX_CNT_MSB 3 -#define SI_CS_TX_CNT_LSB 0 -#define SI_CS_TX_CNT_MASK 0x0000000f -#define SI_CS_TX_CNT_GET(x) (((x) & SI_CS_TX_CNT_MASK) >> SI_CS_TX_CNT_LSB) -#define SI_CS_TX_CNT_SET(x) (((x) << SI_CS_TX_CNT_LSB) & SI_CS_TX_CNT_MASK) - -#define SI_TX_DATA0_ADDRESS 0x00000008 -#define SI_TX_DATA0_OFFSET 0x00000008 -#define SI_TX_DATA0_DATA3_MSB 31 -#define SI_TX_DATA0_DATA3_LSB 24 -#define SI_TX_DATA0_DATA3_MASK 0xff000000 -#define SI_TX_DATA0_DATA3_GET(x) (((x) & SI_TX_DATA0_DATA3_MASK) >> SI_TX_DATA0_DATA3_LSB) -#define SI_TX_DATA0_DATA3_SET(x) (((x) << SI_TX_DATA0_DATA3_LSB) & SI_TX_DATA0_DATA3_MASK) -#define SI_TX_DATA0_DATA2_MSB 23 -#define SI_TX_DATA0_DATA2_LSB 16 -#define SI_TX_DATA0_DATA2_MASK 0x00ff0000 -#define SI_TX_DATA0_DATA2_GET(x) (((x) & SI_TX_DATA0_DATA2_MASK) >> SI_TX_DATA0_DATA2_LSB) -#define SI_TX_DATA0_DATA2_SET(x) (((x) << SI_TX_DATA0_DATA2_LSB) & SI_TX_DATA0_DATA2_MASK) -#define SI_TX_DATA0_DATA1_MSB 15 -#define SI_TX_DATA0_DATA1_LSB 8 -#define SI_TX_DATA0_DATA1_MASK 0x0000ff00 -#define SI_TX_DATA0_DATA1_GET(x) (((x) & SI_TX_DATA0_DATA1_MASK) >> SI_TX_DATA0_DATA1_LSB) -#define SI_TX_DATA0_DATA1_SET(x) (((x) << SI_TX_DATA0_DATA1_LSB) & SI_TX_DATA0_DATA1_MASK) -#define SI_TX_DATA0_DATA0_MSB 7 -#define SI_TX_DATA0_DATA0_LSB 0 -#define SI_TX_DATA0_DATA0_MASK 0x000000ff -#define SI_TX_DATA0_DATA0_GET(x) (((x) & SI_TX_DATA0_DATA0_MASK) >> SI_TX_DATA0_DATA0_LSB) -#define SI_TX_DATA0_DATA0_SET(x) (((x) << SI_TX_DATA0_DATA0_LSB) & SI_TX_DATA0_DATA0_MASK) - -#define SI_TX_DATA1_ADDRESS 0x0000000c -#define SI_TX_DATA1_OFFSET 0x0000000c -#define SI_TX_DATA1_DATA7_MSB 31 -#define SI_TX_DATA1_DATA7_LSB 24 -#define SI_TX_DATA1_DATA7_MASK 0xff000000 -#define SI_TX_DATA1_DATA7_GET(x) (((x) & SI_TX_DATA1_DATA7_MASK) >> SI_TX_DATA1_DATA7_LSB) -#define SI_TX_DATA1_DATA7_SET(x) (((x) << SI_TX_DATA1_DATA7_LSB) & SI_TX_DATA1_DATA7_MASK) -#define SI_TX_DATA1_DATA6_MSB 23 -#define SI_TX_DATA1_DATA6_LSB 16 -#define SI_TX_DATA1_DATA6_MASK 0x00ff0000 -#define SI_TX_DATA1_DATA6_GET(x) (((x) & SI_TX_DATA1_DATA6_MASK) >> SI_TX_DATA1_DATA6_LSB) -#define SI_TX_DATA1_DATA6_SET(x) (((x) << SI_TX_DATA1_DATA6_LSB) & SI_TX_DATA1_DATA6_MASK) -#define SI_TX_DATA1_DATA5_MSB 15 -#define SI_TX_DATA1_DATA5_LSB 8 -#define SI_TX_DATA1_DATA5_MASK 0x0000ff00 -#define SI_TX_DATA1_DATA5_GET(x) (((x) & SI_TX_DATA1_DATA5_MASK) >> SI_TX_DATA1_DATA5_LSB) -#define SI_TX_DATA1_DATA5_SET(x) (((x) << SI_TX_DATA1_DATA5_LSB) & SI_TX_DATA1_DATA5_MASK) -#define SI_TX_DATA1_DATA4_MSB 7 -#define SI_TX_DATA1_DATA4_LSB 0 -#define SI_TX_DATA1_DATA4_MASK 0x000000ff -#define SI_TX_DATA1_DATA4_GET(x) (((x) & SI_TX_DATA1_DATA4_MASK) >> SI_TX_DATA1_DATA4_LSB) -#define SI_TX_DATA1_DATA4_SET(x) (((x) << SI_TX_DATA1_DATA4_LSB) & SI_TX_DATA1_DATA4_MASK) - -#define SI_RX_DATA0_ADDRESS 0x00000010 -#define SI_RX_DATA0_OFFSET 0x00000010 -#define SI_RX_DATA0_DATA3_MSB 31 -#define SI_RX_DATA0_DATA3_LSB 24 -#define SI_RX_DATA0_DATA3_MASK 0xff000000 -#define SI_RX_DATA0_DATA3_GET(x) (((x) & SI_RX_DATA0_DATA3_MASK) >> SI_RX_DATA0_DATA3_LSB) -#define SI_RX_DATA0_DATA3_SET(x) (((x) << SI_RX_DATA0_DATA3_LSB) & SI_RX_DATA0_DATA3_MASK) -#define SI_RX_DATA0_DATA2_MSB 23 -#define SI_RX_DATA0_DATA2_LSB 16 -#define SI_RX_DATA0_DATA2_MASK 0x00ff0000 -#define SI_RX_DATA0_DATA2_GET(x) (((x) & SI_RX_DATA0_DATA2_MASK) >> SI_RX_DATA0_DATA2_LSB) -#define SI_RX_DATA0_DATA2_SET(x) (((x) << SI_RX_DATA0_DATA2_LSB) & SI_RX_DATA0_DATA2_MASK) -#define SI_RX_DATA0_DATA1_MSB 15 -#define SI_RX_DATA0_DATA1_LSB 8 -#define SI_RX_DATA0_DATA1_MASK 0x0000ff00 -#define SI_RX_DATA0_DATA1_GET(x) (((x) & SI_RX_DATA0_DATA1_MASK) >> SI_RX_DATA0_DATA1_LSB) -#define SI_RX_DATA0_DATA1_SET(x) (((x) << SI_RX_DATA0_DATA1_LSB) & SI_RX_DATA0_DATA1_MASK) -#define SI_RX_DATA0_DATA0_MSB 7 -#define SI_RX_DATA0_DATA0_LSB 0 -#define SI_RX_DATA0_DATA0_MASK 0x000000ff -#define SI_RX_DATA0_DATA0_GET(x) (((x) & SI_RX_DATA0_DATA0_MASK) >> SI_RX_DATA0_DATA0_LSB) -#define SI_RX_DATA0_DATA0_SET(x) (((x) << SI_RX_DATA0_DATA0_LSB) & SI_RX_DATA0_DATA0_MASK) - -#define SI_RX_DATA1_ADDRESS 0x00000014 -#define SI_RX_DATA1_OFFSET 0x00000014 -#define SI_RX_DATA1_DATA7_MSB 31 -#define SI_RX_DATA1_DATA7_LSB 24 -#define SI_RX_DATA1_DATA7_MASK 0xff000000 -#define SI_RX_DATA1_DATA7_GET(x) (((x) & SI_RX_DATA1_DATA7_MASK) >> SI_RX_DATA1_DATA7_LSB) -#define SI_RX_DATA1_DATA7_SET(x) (((x) << SI_RX_DATA1_DATA7_LSB) & SI_RX_DATA1_DATA7_MASK) -#define SI_RX_DATA1_DATA6_MSB 23 -#define SI_RX_DATA1_DATA6_LSB 16 -#define SI_RX_DATA1_DATA6_MASK 0x00ff0000 -#define SI_RX_DATA1_DATA6_GET(x) (((x) & SI_RX_DATA1_DATA6_MASK) >> SI_RX_DATA1_DATA6_LSB) -#define SI_RX_DATA1_DATA6_SET(x) (((x) << SI_RX_DATA1_DATA6_LSB) & SI_RX_DATA1_DATA6_MASK) -#define SI_RX_DATA1_DATA5_MSB 15 -#define SI_RX_DATA1_DATA5_LSB 8 -#define SI_RX_DATA1_DATA5_MASK 0x0000ff00 -#define SI_RX_DATA1_DATA5_GET(x) (((x) & SI_RX_DATA1_DATA5_MASK) >> SI_RX_DATA1_DATA5_LSB) -#define SI_RX_DATA1_DATA5_SET(x) (((x) << SI_RX_DATA1_DATA5_LSB) & SI_RX_DATA1_DATA5_MASK) -#define SI_RX_DATA1_DATA4_MSB 7 -#define SI_RX_DATA1_DATA4_LSB 0 -#define SI_RX_DATA1_DATA4_MASK 0x000000ff -#define SI_RX_DATA1_DATA4_GET(x) (((x) & SI_RX_DATA1_DATA4_MASK) >> SI_RX_DATA1_DATA4_LSB) -#define SI_RX_DATA1_DATA4_SET(x) (((x) << SI_RX_DATA1_DATA4_LSB) & SI_RX_DATA1_DATA4_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct si_reg_reg_s { - volatile unsigned int si_config; - volatile unsigned int si_cs; - volatile unsigned int si_tx_data0; - volatile unsigned int si_tx_data1; - volatile unsigned int si_rx_data0; - volatile unsigned int si_rx_data1; -} si_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _SI_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/uart_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/uart_reg.h deleted file mode 100644 index 5aef4bad347b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/uart_reg.h +++ /dev/null @@ -1,260 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _UART_REG_REG_H_ -#define _UART_REG_REG_H_ - -#define UART_DATA_ADDRESS 0x00000000 -#define UART_DATA_OFFSET 0x00000000 -#define UART_DATA_TX_CSR_MSB 9 -#define UART_DATA_TX_CSR_LSB 9 -#define UART_DATA_TX_CSR_MASK 0x00000200 -#define UART_DATA_TX_CSR_GET(x) (((x) & UART_DATA_TX_CSR_MASK) >> UART_DATA_TX_CSR_LSB) -#define UART_DATA_TX_CSR_SET(x) (((x) << UART_DATA_TX_CSR_LSB) & UART_DATA_TX_CSR_MASK) -#define UART_DATA_RX_CSR_MSB 8 -#define UART_DATA_RX_CSR_LSB 8 -#define UART_DATA_RX_CSR_MASK 0x00000100 -#define UART_DATA_RX_CSR_GET(x) (((x) & UART_DATA_RX_CSR_MASK) >> UART_DATA_RX_CSR_LSB) -#define UART_DATA_RX_CSR_SET(x) (((x) << UART_DATA_RX_CSR_LSB) & UART_DATA_RX_CSR_MASK) -#define UART_DATA_TXRX_DATA_MSB 7 -#define UART_DATA_TXRX_DATA_LSB 0 -#define UART_DATA_TXRX_DATA_MASK 0x000000ff -#define UART_DATA_TXRX_DATA_GET(x) (((x) & UART_DATA_TXRX_DATA_MASK) >> UART_DATA_TXRX_DATA_LSB) -#define UART_DATA_TXRX_DATA_SET(x) (((x) << UART_DATA_TXRX_DATA_LSB) & UART_DATA_TXRX_DATA_MASK) - -#define UART_CONTROL_ADDRESS 0x00000004 -#define UART_CONTROL_OFFSET 0x00000004 -#define UART_CONTROL_RX_BUSY_MSB 15 -#define UART_CONTROL_RX_BUSY_LSB 15 -#define UART_CONTROL_RX_BUSY_MASK 0x00008000 -#define UART_CONTROL_RX_BUSY_GET(x) (((x) & UART_CONTROL_RX_BUSY_MASK) >> UART_CONTROL_RX_BUSY_LSB) -#define UART_CONTROL_RX_BUSY_SET(x) (((x) << UART_CONTROL_RX_BUSY_LSB) & UART_CONTROL_RX_BUSY_MASK) -#define UART_CONTROL_TX_BUSY_MSB 14 -#define UART_CONTROL_TX_BUSY_LSB 14 -#define UART_CONTROL_TX_BUSY_MASK 0x00004000 -#define UART_CONTROL_TX_BUSY_GET(x) (((x) & UART_CONTROL_TX_BUSY_MASK) >> UART_CONTROL_TX_BUSY_LSB) -#define UART_CONTROL_TX_BUSY_SET(x) (((x) << UART_CONTROL_TX_BUSY_LSB) & UART_CONTROL_TX_BUSY_MASK) -#define UART_CONTROL_HOST_INT_ENABLE_MSB 13 -#define UART_CONTROL_HOST_INT_ENABLE_LSB 13 -#define UART_CONTROL_HOST_INT_ENABLE_MASK 0x00002000 -#define UART_CONTROL_HOST_INT_ENABLE_GET(x) (((x) & UART_CONTROL_HOST_INT_ENABLE_MASK) >> UART_CONTROL_HOST_INT_ENABLE_LSB) -#define UART_CONTROL_HOST_INT_ENABLE_SET(x) (((x) << UART_CONTROL_HOST_INT_ENABLE_LSB) & UART_CONTROL_HOST_INT_ENABLE_MASK) -#define UART_CONTROL_HOST_INT_MSB 12 -#define UART_CONTROL_HOST_INT_LSB 12 -#define UART_CONTROL_HOST_INT_MASK 0x00001000 -#define UART_CONTROL_HOST_INT_GET(x) (((x) & UART_CONTROL_HOST_INT_MASK) >> UART_CONTROL_HOST_INT_LSB) -#define UART_CONTROL_HOST_INT_SET(x) (((x) << UART_CONTROL_HOST_INT_LSB) & UART_CONTROL_HOST_INT_MASK) -#define UART_CONTROL_TX_BREAK_MSB 11 -#define UART_CONTROL_TX_BREAK_LSB 11 -#define UART_CONTROL_TX_BREAK_MASK 0x00000800 -#define UART_CONTROL_TX_BREAK_GET(x) (((x) & UART_CONTROL_TX_BREAK_MASK) >> UART_CONTROL_TX_BREAK_LSB) -#define UART_CONTROL_TX_BREAK_SET(x) (((x) << UART_CONTROL_TX_BREAK_LSB) & UART_CONTROL_TX_BREAK_MASK) -#define UART_CONTROL_RX_BREAK_MSB 10 -#define UART_CONTROL_RX_BREAK_LSB 10 -#define UART_CONTROL_RX_BREAK_MASK 0x00000400 -#define UART_CONTROL_RX_BREAK_GET(x) (((x) & UART_CONTROL_RX_BREAK_MASK) >> UART_CONTROL_RX_BREAK_LSB) -#define UART_CONTROL_RX_BREAK_SET(x) (((x) << UART_CONTROL_RX_BREAK_LSB) & UART_CONTROL_RX_BREAK_MASK) -#define UART_CONTROL_SERIAL_TX_READY_MSB 9 -#define UART_CONTROL_SERIAL_TX_READY_LSB 9 -#define UART_CONTROL_SERIAL_TX_READY_MASK 0x00000200 -#define UART_CONTROL_SERIAL_TX_READY_GET(x) (((x) & UART_CONTROL_SERIAL_TX_READY_MASK) >> UART_CONTROL_SERIAL_TX_READY_LSB) -#define UART_CONTROL_SERIAL_TX_READY_SET(x) (((x) << UART_CONTROL_SERIAL_TX_READY_LSB) & UART_CONTROL_SERIAL_TX_READY_MASK) -#define UART_CONTROL_TX_READY_ORIDE_MSB 8 -#define UART_CONTROL_TX_READY_ORIDE_LSB 8 -#define UART_CONTROL_TX_READY_ORIDE_MASK 0x00000100 -#define UART_CONTROL_TX_READY_ORIDE_GET(x) (((x) & UART_CONTROL_TX_READY_ORIDE_MASK) >> UART_CONTROL_TX_READY_ORIDE_LSB) -#define UART_CONTROL_TX_READY_ORIDE_SET(x) (((x) << UART_CONTROL_TX_READY_ORIDE_LSB) & UART_CONTROL_TX_READY_ORIDE_MASK) -#define UART_CONTROL_RX_READY_ORIDE_MSB 7 -#define UART_CONTROL_RX_READY_ORIDE_LSB 7 -#define UART_CONTROL_RX_READY_ORIDE_MASK 0x00000080 -#define UART_CONTROL_RX_READY_ORIDE_GET(x) (((x) & UART_CONTROL_RX_READY_ORIDE_MASK) >> UART_CONTROL_RX_READY_ORIDE_LSB) -#define UART_CONTROL_RX_READY_ORIDE_SET(x) (((x) << UART_CONTROL_RX_READY_ORIDE_LSB) & UART_CONTROL_RX_READY_ORIDE_MASK) -#define UART_CONTROL_DMA_ENABLE_MSB 6 -#define UART_CONTROL_DMA_ENABLE_LSB 6 -#define UART_CONTROL_DMA_ENABLE_MASK 0x00000040 -#define UART_CONTROL_DMA_ENABLE_GET(x) (((x) & UART_CONTROL_DMA_ENABLE_MASK) >> UART_CONTROL_DMA_ENABLE_LSB) -#define UART_CONTROL_DMA_ENABLE_SET(x) (((x) << UART_CONTROL_DMA_ENABLE_LSB) & UART_CONTROL_DMA_ENABLE_MASK) -#define UART_CONTROL_FLOW_ENABLE_MSB 5 -#define UART_CONTROL_FLOW_ENABLE_LSB 5 -#define UART_CONTROL_FLOW_ENABLE_MASK 0x00000020 -#define UART_CONTROL_FLOW_ENABLE_GET(x) (((x) & UART_CONTROL_FLOW_ENABLE_MASK) >> UART_CONTROL_FLOW_ENABLE_LSB) -#define UART_CONTROL_FLOW_ENABLE_SET(x) (((x) << UART_CONTROL_FLOW_ENABLE_LSB) & UART_CONTROL_FLOW_ENABLE_MASK) -#define UART_CONTROL_FLOW_INVERT_MSB 4 -#define UART_CONTROL_FLOW_INVERT_LSB 4 -#define UART_CONTROL_FLOW_INVERT_MASK 0x00000010 -#define UART_CONTROL_FLOW_INVERT_GET(x) (((x) & UART_CONTROL_FLOW_INVERT_MASK) >> UART_CONTROL_FLOW_INVERT_LSB) -#define UART_CONTROL_FLOW_INVERT_SET(x) (((x) << UART_CONTROL_FLOW_INVERT_LSB) & UART_CONTROL_FLOW_INVERT_MASK) -#define UART_CONTROL_IFC_ENABLE_MSB 3 -#define UART_CONTROL_IFC_ENABLE_LSB 3 -#define UART_CONTROL_IFC_ENABLE_MASK 0x00000008 -#define UART_CONTROL_IFC_ENABLE_GET(x) (((x) & UART_CONTROL_IFC_ENABLE_MASK) >> UART_CONTROL_IFC_ENABLE_LSB) -#define UART_CONTROL_IFC_ENABLE_SET(x) (((x) << UART_CONTROL_IFC_ENABLE_LSB) & UART_CONTROL_IFC_ENABLE_MASK) -#define UART_CONTROL_IFC_DCE_MSB 2 -#define UART_CONTROL_IFC_DCE_LSB 2 -#define UART_CONTROL_IFC_DCE_MASK 0x00000004 -#define UART_CONTROL_IFC_DCE_GET(x) (((x) & UART_CONTROL_IFC_DCE_MASK) >> UART_CONTROL_IFC_DCE_LSB) -#define UART_CONTROL_IFC_DCE_SET(x) (((x) << UART_CONTROL_IFC_DCE_LSB) & UART_CONTROL_IFC_DCE_MASK) -#define UART_CONTROL_PARITY_ENABLE_MSB 1 -#define UART_CONTROL_PARITY_ENABLE_LSB 1 -#define UART_CONTROL_PARITY_ENABLE_MASK 0x00000002 -#define UART_CONTROL_PARITY_ENABLE_GET(x) (((x) & UART_CONTROL_PARITY_ENABLE_MASK) >> UART_CONTROL_PARITY_ENABLE_LSB) -#define UART_CONTROL_PARITY_ENABLE_SET(x) (((x) << UART_CONTROL_PARITY_ENABLE_LSB) & UART_CONTROL_PARITY_ENABLE_MASK) -#define UART_CONTROL_PARITY_EVEN_MSB 0 -#define UART_CONTROL_PARITY_EVEN_LSB 0 -#define UART_CONTROL_PARITY_EVEN_MASK 0x00000001 -#define UART_CONTROL_PARITY_EVEN_GET(x) (((x) & UART_CONTROL_PARITY_EVEN_MASK) >> UART_CONTROL_PARITY_EVEN_LSB) -#define UART_CONTROL_PARITY_EVEN_SET(x) (((x) << UART_CONTROL_PARITY_EVEN_LSB) & UART_CONTROL_PARITY_EVEN_MASK) - -#define UART_CLKDIV_ADDRESS 0x00000008 -#define UART_CLKDIV_OFFSET 0x00000008 -#define UART_CLKDIV_CLK_SCALE_MSB 23 -#define UART_CLKDIV_CLK_SCALE_LSB 16 -#define UART_CLKDIV_CLK_SCALE_MASK 0x00ff0000 -#define UART_CLKDIV_CLK_SCALE_GET(x) (((x) & UART_CLKDIV_CLK_SCALE_MASK) >> UART_CLKDIV_CLK_SCALE_LSB) -#define UART_CLKDIV_CLK_SCALE_SET(x) (((x) << UART_CLKDIV_CLK_SCALE_LSB) & UART_CLKDIV_CLK_SCALE_MASK) -#define UART_CLKDIV_CLK_STEP_MSB 15 -#define UART_CLKDIV_CLK_STEP_LSB 0 -#define UART_CLKDIV_CLK_STEP_MASK 0x0000ffff -#define UART_CLKDIV_CLK_STEP_GET(x) (((x) & UART_CLKDIV_CLK_STEP_MASK) >> UART_CLKDIV_CLK_STEP_LSB) -#define UART_CLKDIV_CLK_STEP_SET(x) (((x) << UART_CLKDIV_CLK_STEP_LSB) & UART_CLKDIV_CLK_STEP_MASK) - -#define UART_INT_ADDRESS 0x0000000c -#define UART_INT_OFFSET 0x0000000c -#define UART_INT_TX_EMPTY_INT_MSB 9 -#define UART_INT_TX_EMPTY_INT_LSB 9 -#define UART_INT_TX_EMPTY_INT_MASK 0x00000200 -#define UART_INT_TX_EMPTY_INT_GET(x) (((x) & UART_INT_TX_EMPTY_INT_MASK) >> UART_INT_TX_EMPTY_INT_LSB) -#define UART_INT_TX_EMPTY_INT_SET(x) (((x) << UART_INT_TX_EMPTY_INT_LSB) & UART_INT_TX_EMPTY_INT_MASK) -#define UART_INT_RX_FULL_INT_MSB 8 -#define UART_INT_RX_FULL_INT_LSB 8 -#define UART_INT_RX_FULL_INT_MASK 0x00000100 -#define UART_INT_RX_FULL_INT_GET(x) (((x) & UART_INT_RX_FULL_INT_MASK) >> UART_INT_RX_FULL_INT_LSB) -#define UART_INT_RX_FULL_INT_SET(x) (((x) << UART_INT_RX_FULL_INT_LSB) & UART_INT_RX_FULL_INT_MASK) -#define UART_INT_RX_BREAK_OFF_INT_MSB 7 -#define UART_INT_RX_BREAK_OFF_INT_LSB 7 -#define UART_INT_RX_BREAK_OFF_INT_MASK 0x00000080 -#define UART_INT_RX_BREAK_OFF_INT_GET(x) (((x) & UART_INT_RX_BREAK_OFF_INT_MASK) >> UART_INT_RX_BREAK_OFF_INT_LSB) -#define UART_INT_RX_BREAK_OFF_INT_SET(x) (((x) << UART_INT_RX_BREAK_OFF_INT_LSB) & UART_INT_RX_BREAK_OFF_INT_MASK) -#define UART_INT_RX_BREAK_ON_INT_MSB 6 -#define UART_INT_RX_BREAK_ON_INT_LSB 6 -#define UART_INT_RX_BREAK_ON_INT_MASK 0x00000040 -#define UART_INT_RX_BREAK_ON_INT_GET(x) (((x) & UART_INT_RX_BREAK_ON_INT_MASK) >> UART_INT_RX_BREAK_ON_INT_LSB) -#define UART_INT_RX_BREAK_ON_INT_SET(x) (((x) << UART_INT_RX_BREAK_ON_INT_LSB) & UART_INT_RX_BREAK_ON_INT_MASK) -#define UART_INT_RX_PARITY_ERR_INT_MSB 5 -#define UART_INT_RX_PARITY_ERR_INT_LSB 5 -#define UART_INT_RX_PARITY_ERR_INT_MASK 0x00000020 -#define UART_INT_RX_PARITY_ERR_INT_GET(x) (((x) & UART_INT_RX_PARITY_ERR_INT_MASK) >> UART_INT_RX_PARITY_ERR_INT_LSB) -#define UART_INT_RX_PARITY_ERR_INT_SET(x) (((x) << UART_INT_RX_PARITY_ERR_INT_LSB) & UART_INT_RX_PARITY_ERR_INT_MASK) -#define UART_INT_TX_OFLOW_ERR_INT_MSB 4 -#define UART_INT_TX_OFLOW_ERR_INT_LSB 4 -#define UART_INT_TX_OFLOW_ERR_INT_MASK 0x00000010 -#define UART_INT_TX_OFLOW_ERR_INT_GET(x) (((x) & UART_INT_TX_OFLOW_ERR_INT_MASK) >> UART_INT_TX_OFLOW_ERR_INT_LSB) -#define UART_INT_TX_OFLOW_ERR_INT_SET(x) (((x) << UART_INT_TX_OFLOW_ERR_INT_LSB) & UART_INT_TX_OFLOW_ERR_INT_MASK) -#define UART_INT_RX_OFLOW_ERR_INT_MSB 3 -#define UART_INT_RX_OFLOW_ERR_INT_LSB 3 -#define UART_INT_RX_OFLOW_ERR_INT_MASK 0x00000008 -#define UART_INT_RX_OFLOW_ERR_INT_GET(x) (((x) & UART_INT_RX_OFLOW_ERR_INT_MASK) >> UART_INT_RX_OFLOW_ERR_INT_LSB) -#define UART_INT_RX_OFLOW_ERR_INT_SET(x) (((x) << UART_INT_RX_OFLOW_ERR_INT_LSB) & UART_INT_RX_OFLOW_ERR_INT_MASK) -#define UART_INT_RX_FRAMING_ERR_INT_MSB 2 -#define UART_INT_RX_FRAMING_ERR_INT_LSB 2 -#define UART_INT_RX_FRAMING_ERR_INT_MASK 0x00000004 -#define UART_INT_RX_FRAMING_ERR_INT_GET(x) (((x) & UART_INT_RX_FRAMING_ERR_INT_MASK) >> UART_INT_RX_FRAMING_ERR_INT_LSB) -#define UART_INT_RX_FRAMING_ERR_INT_SET(x) (((x) << UART_INT_RX_FRAMING_ERR_INT_LSB) & UART_INT_RX_FRAMING_ERR_INT_MASK) -#define UART_INT_TX_READY_INT_MSB 1 -#define UART_INT_TX_READY_INT_LSB 1 -#define UART_INT_TX_READY_INT_MASK 0x00000002 -#define UART_INT_TX_READY_INT_GET(x) (((x) & UART_INT_TX_READY_INT_MASK) >> UART_INT_TX_READY_INT_LSB) -#define UART_INT_TX_READY_INT_SET(x) (((x) << UART_INT_TX_READY_INT_LSB) & UART_INT_TX_READY_INT_MASK) -#define UART_INT_RX_VALID_INT_MSB 0 -#define UART_INT_RX_VALID_INT_LSB 0 -#define UART_INT_RX_VALID_INT_MASK 0x00000001 -#define UART_INT_RX_VALID_INT_GET(x) (((x) & UART_INT_RX_VALID_INT_MASK) >> UART_INT_RX_VALID_INT_LSB) -#define UART_INT_RX_VALID_INT_SET(x) (((x) << UART_INT_RX_VALID_INT_LSB) & UART_INT_RX_VALID_INT_MASK) - -#define UART_INT_EN_ADDRESS 0x00000010 -#define UART_INT_EN_OFFSET 0x00000010 -#define UART_INT_EN_TX_EMPTY_INT_EN_MSB 9 -#define UART_INT_EN_TX_EMPTY_INT_EN_LSB 9 -#define UART_INT_EN_TX_EMPTY_INT_EN_MASK 0x00000200 -#define UART_INT_EN_TX_EMPTY_INT_EN_GET(x) (((x) & UART_INT_EN_TX_EMPTY_INT_EN_MASK) >> UART_INT_EN_TX_EMPTY_INT_EN_LSB) -#define UART_INT_EN_TX_EMPTY_INT_EN_SET(x) (((x) << UART_INT_EN_TX_EMPTY_INT_EN_LSB) & UART_INT_EN_TX_EMPTY_INT_EN_MASK) -#define UART_INT_EN_RX_FULL_INT_EN_MSB 8 -#define UART_INT_EN_RX_FULL_INT_EN_LSB 8 -#define UART_INT_EN_RX_FULL_INT_EN_MASK 0x00000100 -#define UART_INT_EN_RX_FULL_INT_EN_GET(x) (((x) & UART_INT_EN_RX_FULL_INT_EN_MASK) >> UART_INT_EN_RX_FULL_INT_EN_LSB) -#define UART_INT_EN_RX_FULL_INT_EN_SET(x) (((x) << UART_INT_EN_RX_FULL_INT_EN_LSB) & UART_INT_EN_RX_FULL_INT_EN_MASK) -#define UART_INT_EN_RX_BREAK_OFF_INT_EN_MSB 7 -#define UART_INT_EN_RX_BREAK_OFF_INT_EN_LSB 7 -#define UART_INT_EN_RX_BREAK_OFF_INT_EN_MASK 0x00000080 -#define UART_INT_EN_RX_BREAK_OFF_INT_EN_GET(x) (((x) & UART_INT_EN_RX_BREAK_OFF_INT_EN_MASK) >> UART_INT_EN_RX_BREAK_OFF_INT_EN_LSB) -#define UART_INT_EN_RX_BREAK_OFF_INT_EN_SET(x) (((x) << UART_INT_EN_RX_BREAK_OFF_INT_EN_LSB) & UART_INT_EN_RX_BREAK_OFF_INT_EN_MASK) -#define UART_INT_EN_RX_BREAK_ON_INT_EN_MSB 6 -#define UART_INT_EN_RX_BREAK_ON_INT_EN_LSB 6 -#define UART_INT_EN_RX_BREAK_ON_INT_EN_MASK 0x00000040 -#define UART_INT_EN_RX_BREAK_ON_INT_EN_GET(x) (((x) & UART_INT_EN_RX_BREAK_ON_INT_EN_MASK) >> UART_INT_EN_RX_BREAK_ON_INT_EN_LSB) -#define UART_INT_EN_RX_BREAK_ON_INT_EN_SET(x) (((x) << UART_INT_EN_RX_BREAK_ON_INT_EN_LSB) & UART_INT_EN_RX_BREAK_ON_INT_EN_MASK) -#define UART_INT_EN_RX_PARITY_ERR_INT_EN_MSB 5 -#define UART_INT_EN_RX_PARITY_ERR_INT_EN_LSB 5 -#define UART_INT_EN_RX_PARITY_ERR_INT_EN_MASK 0x00000020 -#define UART_INT_EN_RX_PARITY_ERR_INT_EN_GET(x) (((x) & UART_INT_EN_RX_PARITY_ERR_INT_EN_MASK) >> UART_INT_EN_RX_PARITY_ERR_INT_EN_LSB) -#define UART_INT_EN_RX_PARITY_ERR_INT_EN_SET(x) (((x) << UART_INT_EN_RX_PARITY_ERR_INT_EN_LSB) & UART_INT_EN_RX_PARITY_ERR_INT_EN_MASK) -#define UART_INT_EN_TX_OFLOW_ERR_INT_EN_MSB 4 -#define UART_INT_EN_TX_OFLOW_ERR_INT_EN_LSB 4 -#define UART_INT_EN_TX_OFLOW_ERR_INT_EN_MASK 0x00000010 -#define UART_INT_EN_TX_OFLOW_ERR_INT_EN_GET(x) (((x) & UART_INT_EN_TX_OFLOW_ERR_INT_EN_MASK) >> UART_INT_EN_TX_OFLOW_ERR_INT_EN_LSB) -#define UART_INT_EN_TX_OFLOW_ERR_INT_EN_SET(x) (((x) << UART_INT_EN_TX_OFLOW_ERR_INT_EN_LSB) & UART_INT_EN_TX_OFLOW_ERR_INT_EN_MASK) -#define UART_INT_EN_RX_OFLOW_ERR_INT_EN_MSB 3 -#define UART_INT_EN_RX_OFLOW_ERR_INT_EN_LSB 3 -#define UART_INT_EN_RX_OFLOW_ERR_INT_EN_MASK 0x00000008 -#define UART_INT_EN_RX_OFLOW_ERR_INT_EN_GET(x) (((x) & UART_INT_EN_RX_OFLOW_ERR_INT_EN_MASK) >> UART_INT_EN_RX_OFLOW_ERR_INT_EN_LSB) -#define UART_INT_EN_RX_OFLOW_ERR_INT_EN_SET(x) (((x) << UART_INT_EN_RX_OFLOW_ERR_INT_EN_LSB) & UART_INT_EN_RX_OFLOW_ERR_INT_EN_MASK) -#define UART_INT_EN_RX_FRAMING_ERR_INT_EN_MSB 2 -#define UART_INT_EN_RX_FRAMING_ERR_INT_EN_LSB 2 -#define UART_INT_EN_RX_FRAMING_ERR_INT_EN_MASK 0x00000004 -#define UART_INT_EN_RX_FRAMING_ERR_INT_EN_GET(x) (((x) & UART_INT_EN_RX_FRAMING_ERR_INT_EN_MASK) >> UART_INT_EN_RX_FRAMING_ERR_INT_EN_LSB) -#define UART_INT_EN_RX_FRAMING_ERR_INT_EN_SET(x) (((x) << UART_INT_EN_RX_FRAMING_ERR_INT_EN_LSB) & UART_INT_EN_RX_FRAMING_ERR_INT_EN_MASK) -#define UART_INT_EN_TX_READY_INT_EN_MSB 1 -#define UART_INT_EN_TX_READY_INT_EN_LSB 1 -#define UART_INT_EN_TX_READY_INT_EN_MASK 0x00000002 -#define UART_INT_EN_TX_READY_INT_EN_GET(x) (((x) & UART_INT_EN_TX_READY_INT_EN_MASK) >> UART_INT_EN_TX_READY_INT_EN_LSB) -#define UART_INT_EN_TX_READY_INT_EN_SET(x) (((x) << UART_INT_EN_TX_READY_INT_EN_LSB) & UART_INT_EN_TX_READY_INT_EN_MASK) -#define UART_INT_EN_RX_VALID_INT_EN_MSB 0 -#define UART_INT_EN_RX_VALID_INT_EN_LSB 0 -#define UART_INT_EN_RX_VALID_INT_EN_MASK 0x00000001 -#define UART_INT_EN_RX_VALID_INT_EN_GET(x) (((x) & UART_INT_EN_RX_VALID_INT_EN_MASK) >> UART_INT_EN_RX_VALID_INT_EN_LSB) -#define UART_INT_EN_RX_VALID_INT_EN_SET(x) (((x) << UART_INT_EN_RX_VALID_INT_EN_LSB) & UART_INT_EN_RX_VALID_INT_EN_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct uart_reg_reg_s { - volatile unsigned int uart_data; - volatile unsigned int uart_control; - volatile unsigned int uart_clkdiv; - volatile unsigned int uart_int; - volatile unsigned int uart_int_en; -} uart_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _UART_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/umbox_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/umbox_reg.h deleted file mode 100644 index 66ed47f44d9b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/umbox_reg.h +++ /dev/null @@ -1,37 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "umbox_wlan_reg.h" - - -#ifndef BT_HEADERS - - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/umbox_wlan_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/umbox_wlan_reg.h deleted file mode 100644 index 5c392f894126..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/umbox_wlan_reg.h +++ /dev/null @@ -1,322 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _UMBOX_WLAN_REG_REG_H_ -#define _UMBOX_WLAN_REG_REG_H_ - -#define UMBOX_FIFO_ADDRESS 0x00000000 -#define UMBOX_FIFO_OFFSET 0x00000000 -#define UMBOX_FIFO_DATA_MSB 8 -#define UMBOX_FIFO_DATA_LSB 0 -#define UMBOX_FIFO_DATA_MASK 0x000001ff -#define UMBOX_FIFO_DATA_GET(x) (((x) & UMBOX_FIFO_DATA_MASK) >> UMBOX_FIFO_DATA_LSB) -#define UMBOX_FIFO_DATA_SET(x) (((x) << UMBOX_FIFO_DATA_LSB) & UMBOX_FIFO_DATA_MASK) - -#define UMBOX_FIFO_STATUS_ADDRESS 0x00000008 -#define UMBOX_FIFO_STATUS_OFFSET 0x00000008 -#define UMBOX_FIFO_STATUS_TX_EMPTY_MSB 3 -#define UMBOX_FIFO_STATUS_TX_EMPTY_LSB 3 -#define UMBOX_FIFO_STATUS_TX_EMPTY_MASK 0x00000008 -#define UMBOX_FIFO_STATUS_TX_EMPTY_GET(x) (((x) & UMBOX_FIFO_STATUS_TX_EMPTY_MASK) >> UMBOX_FIFO_STATUS_TX_EMPTY_LSB) -#define UMBOX_FIFO_STATUS_TX_EMPTY_SET(x) (((x) << UMBOX_FIFO_STATUS_TX_EMPTY_LSB) & UMBOX_FIFO_STATUS_TX_EMPTY_MASK) -#define UMBOX_FIFO_STATUS_TX_FULL_MSB 2 -#define UMBOX_FIFO_STATUS_TX_FULL_LSB 2 -#define UMBOX_FIFO_STATUS_TX_FULL_MASK 0x00000004 -#define UMBOX_FIFO_STATUS_TX_FULL_GET(x) (((x) & UMBOX_FIFO_STATUS_TX_FULL_MASK) >> UMBOX_FIFO_STATUS_TX_FULL_LSB) -#define UMBOX_FIFO_STATUS_TX_FULL_SET(x) (((x) << UMBOX_FIFO_STATUS_TX_FULL_LSB) & UMBOX_FIFO_STATUS_TX_FULL_MASK) -#define UMBOX_FIFO_STATUS_RX_EMPTY_MSB 1 -#define UMBOX_FIFO_STATUS_RX_EMPTY_LSB 1 -#define UMBOX_FIFO_STATUS_RX_EMPTY_MASK 0x00000002 -#define UMBOX_FIFO_STATUS_RX_EMPTY_GET(x) (((x) & UMBOX_FIFO_STATUS_RX_EMPTY_MASK) >> UMBOX_FIFO_STATUS_RX_EMPTY_LSB) -#define UMBOX_FIFO_STATUS_RX_EMPTY_SET(x) (((x) << UMBOX_FIFO_STATUS_RX_EMPTY_LSB) & UMBOX_FIFO_STATUS_RX_EMPTY_MASK) -#define UMBOX_FIFO_STATUS_RX_FULL_MSB 0 -#define UMBOX_FIFO_STATUS_RX_FULL_LSB 0 -#define UMBOX_FIFO_STATUS_RX_FULL_MASK 0x00000001 -#define UMBOX_FIFO_STATUS_RX_FULL_GET(x) (((x) & UMBOX_FIFO_STATUS_RX_FULL_MASK) >> UMBOX_FIFO_STATUS_RX_FULL_LSB) -#define UMBOX_FIFO_STATUS_RX_FULL_SET(x) (((x) << UMBOX_FIFO_STATUS_RX_FULL_LSB) & UMBOX_FIFO_STATUS_RX_FULL_MASK) - -#define UMBOX_DMA_POLICY_ADDRESS 0x0000000c -#define UMBOX_DMA_POLICY_OFFSET 0x0000000c -#define UMBOX_DMA_POLICY_TX_QUANTUM_MSB 3 -#define UMBOX_DMA_POLICY_TX_QUANTUM_LSB 3 -#define UMBOX_DMA_POLICY_TX_QUANTUM_MASK 0x00000008 -#define UMBOX_DMA_POLICY_TX_QUANTUM_GET(x) (((x) & UMBOX_DMA_POLICY_TX_QUANTUM_MASK) >> UMBOX_DMA_POLICY_TX_QUANTUM_LSB) -#define UMBOX_DMA_POLICY_TX_QUANTUM_SET(x) (((x) << UMBOX_DMA_POLICY_TX_QUANTUM_LSB) & UMBOX_DMA_POLICY_TX_QUANTUM_MASK) -#define UMBOX_DMA_POLICY_TX_ORDER_MSB 2 -#define UMBOX_DMA_POLICY_TX_ORDER_LSB 2 -#define UMBOX_DMA_POLICY_TX_ORDER_MASK 0x00000004 -#define UMBOX_DMA_POLICY_TX_ORDER_GET(x) (((x) & UMBOX_DMA_POLICY_TX_ORDER_MASK) >> UMBOX_DMA_POLICY_TX_ORDER_LSB) -#define UMBOX_DMA_POLICY_TX_ORDER_SET(x) (((x) << UMBOX_DMA_POLICY_TX_ORDER_LSB) & UMBOX_DMA_POLICY_TX_ORDER_MASK) -#define UMBOX_DMA_POLICY_RX_QUANTUM_MSB 1 -#define UMBOX_DMA_POLICY_RX_QUANTUM_LSB 1 -#define UMBOX_DMA_POLICY_RX_QUANTUM_MASK 0x00000002 -#define UMBOX_DMA_POLICY_RX_QUANTUM_GET(x) (((x) & UMBOX_DMA_POLICY_RX_QUANTUM_MASK) >> UMBOX_DMA_POLICY_RX_QUANTUM_LSB) -#define UMBOX_DMA_POLICY_RX_QUANTUM_SET(x) (((x) << UMBOX_DMA_POLICY_RX_QUANTUM_LSB) & UMBOX_DMA_POLICY_RX_QUANTUM_MASK) -#define UMBOX_DMA_POLICY_RX_ORDER_MSB 0 -#define UMBOX_DMA_POLICY_RX_ORDER_LSB 0 -#define UMBOX_DMA_POLICY_RX_ORDER_MASK 0x00000001 -#define UMBOX_DMA_POLICY_RX_ORDER_GET(x) (((x) & UMBOX_DMA_POLICY_RX_ORDER_MASK) >> UMBOX_DMA_POLICY_RX_ORDER_LSB) -#define UMBOX_DMA_POLICY_RX_ORDER_SET(x) (((x) << UMBOX_DMA_POLICY_RX_ORDER_LSB) & UMBOX_DMA_POLICY_RX_ORDER_MASK) - -#define UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000010 -#define UMBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000010 -#define UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define UMBOX0_DMA_RX_CONTROL_ADDRESS 0x00000014 -#define UMBOX0_DMA_RX_CONTROL_OFFSET 0x00000014 -#define UMBOX0_DMA_RX_CONTROL_RESUME_MSB 2 -#define UMBOX0_DMA_RX_CONTROL_RESUME_LSB 2 -#define UMBOX0_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define UMBOX0_DMA_RX_CONTROL_RESUME_GET(x) (((x) & UMBOX0_DMA_RX_CONTROL_RESUME_MASK) >> UMBOX0_DMA_RX_CONTROL_RESUME_LSB) -#define UMBOX0_DMA_RX_CONTROL_RESUME_SET(x) (((x) << UMBOX0_DMA_RX_CONTROL_RESUME_LSB) & UMBOX0_DMA_RX_CONTROL_RESUME_MASK) -#define UMBOX0_DMA_RX_CONTROL_START_MSB 1 -#define UMBOX0_DMA_RX_CONTROL_START_LSB 1 -#define UMBOX0_DMA_RX_CONTROL_START_MASK 0x00000002 -#define UMBOX0_DMA_RX_CONTROL_START_GET(x) (((x) & UMBOX0_DMA_RX_CONTROL_START_MASK) >> UMBOX0_DMA_RX_CONTROL_START_LSB) -#define UMBOX0_DMA_RX_CONTROL_START_SET(x) (((x) << UMBOX0_DMA_RX_CONTROL_START_LSB) & UMBOX0_DMA_RX_CONTROL_START_MASK) -#define UMBOX0_DMA_RX_CONTROL_STOP_MSB 0 -#define UMBOX0_DMA_RX_CONTROL_STOP_LSB 0 -#define UMBOX0_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define UMBOX0_DMA_RX_CONTROL_STOP_GET(x) (((x) & UMBOX0_DMA_RX_CONTROL_STOP_MASK) >> UMBOX0_DMA_RX_CONTROL_STOP_LSB) -#define UMBOX0_DMA_RX_CONTROL_STOP_SET(x) (((x) << UMBOX0_DMA_RX_CONTROL_STOP_LSB) & UMBOX0_DMA_RX_CONTROL_STOP_MASK) - -#define UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000018 -#define UMBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000018 -#define UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define UMBOX0_DMA_TX_CONTROL_ADDRESS 0x0000001c -#define UMBOX0_DMA_TX_CONTROL_OFFSET 0x0000001c -#define UMBOX0_DMA_TX_CONTROL_RESUME_MSB 2 -#define UMBOX0_DMA_TX_CONTROL_RESUME_LSB 2 -#define UMBOX0_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define UMBOX0_DMA_TX_CONTROL_RESUME_GET(x) (((x) & UMBOX0_DMA_TX_CONTROL_RESUME_MASK) >> UMBOX0_DMA_TX_CONTROL_RESUME_LSB) -#define UMBOX0_DMA_TX_CONTROL_RESUME_SET(x) (((x) << UMBOX0_DMA_TX_CONTROL_RESUME_LSB) & UMBOX0_DMA_TX_CONTROL_RESUME_MASK) -#define UMBOX0_DMA_TX_CONTROL_START_MSB 1 -#define UMBOX0_DMA_TX_CONTROL_START_LSB 1 -#define UMBOX0_DMA_TX_CONTROL_START_MASK 0x00000002 -#define UMBOX0_DMA_TX_CONTROL_START_GET(x) (((x) & UMBOX0_DMA_TX_CONTROL_START_MASK) >> UMBOX0_DMA_TX_CONTROL_START_LSB) -#define UMBOX0_DMA_TX_CONTROL_START_SET(x) (((x) << UMBOX0_DMA_TX_CONTROL_START_LSB) & UMBOX0_DMA_TX_CONTROL_START_MASK) -#define UMBOX0_DMA_TX_CONTROL_STOP_MSB 0 -#define UMBOX0_DMA_TX_CONTROL_STOP_LSB 0 -#define UMBOX0_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define UMBOX0_DMA_TX_CONTROL_STOP_GET(x) (((x) & UMBOX0_DMA_TX_CONTROL_STOP_MASK) >> UMBOX0_DMA_TX_CONTROL_STOP_LSB) -#define UMBOX0_DMA_TX_CONTROL_STOP_SET(x) (((x) << UMBOX0_DMA_TX_CONTROL_STOP_LSB) & UMBOX0_DMA_TX_CONTROL_STOP_MASK) - -#define UMBOX_FIFO_TIMEOUT_ADDRESS 0x00000020 -#define UMBOX_FIFO_TIMEOUT_OFFSET 0x00000020 -#define UMBOX_FIFO_TIMEOUT_ENABLE_SET_MSB 8 -#define UMBOX_FIFO_TIMEOUT_ENABLE_SET_LSB 8 -#define UMBOX_FIFO_TIMEOUT_ENABLE_SET_MASK 0x00000100 -#define UMBOX_FIFO_TIMEOUT_ENABLE_SET_GET(x) (((x) & UMBOX_FIFO_TIMEOUT_ENABLE_SET_MASK) >> UMBOX_FIFO_TIMEOUT_ENABLE_SET_LSB) -#define UMBOX_FIFO_TIMEOUT_ENABLE_SET_SET(x) (((x) << UMBOX_FIFO_TIMEOUT_ENABLE_SET_LSB) & UMBOX_FIFO_TIMEOUT_ENABLE_SET_MASK) -#define UMBOX_FIFO_TIMEOUT_VALUE_MSB 7 -#define UMBOX_FIFO_TIMEOUT_VALUE_LSB 0 -#define UMBOX_FIFO_TIMEOUT_VALUE_MASK 0x000000ff -#define UMBOX_FIFO_TIMEOUT_VALUE_GET(x) (((x) & UMBOX_FIFO_TIMEOUT_VALUE_MASK) >> UMBOX_FIFO_TIMEOUT_VALUE_LSB) -#define UMBOX_FIFO_TIMEOUT_VALUE_SET(x) (((x) << UMBOX_FIFO_TIMEOUT_VALUE_LSB) & UMBOX_FIFO_TIMEOUT_VALUE_MASK) - -#define UMBOX_INT_STATUS_ADDRESS 0x00000024 -#define UMBOX_INT_STATUS_OFFSET 0x00000024 -#define UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_MSB 9 -#define UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_LSB 9 -#define UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_MASK 0x00000200 -#define UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_GET(x) (((x) & UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_MASK) >> UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_LSB) -#define UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_SET(x) (((x) << UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_LSB) & UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_MASK) -#define UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_MSB 8 -#define UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_LSB 8 -#define UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_MASK 0x00000100 -#define UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_GET(x) (((x) & UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_MASK) >> UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_LSB) -#define UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_SET(x) (((x) << UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_LSB) & UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_MASK) -#define UMBOX_INT_STATUS_RX_DMA_COMPLETE_MSB 7 -#define UMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB 7 -#define UMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK 0x00000080 -#define UMBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) (((x) & UMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) >> UMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) -#define UMBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) (((x) << UMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) & UMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) -#define UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB 6 -#define UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB 6 -#define UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK 0x00000040 -#define UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) (((x) & UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) >> UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) -#define UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) (((x) << UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) & UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) -#define UMBOX_INT_STATUS_TX_DMA_COMPLETE_MSB 5 -#define UMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB 5 -#define UMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK 0x00000020 -#define UMBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) (((x) & UMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) >> UMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) -#define UMBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) (((x) << UMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) & UMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) -#define UMBOX_INT_STATUS_HCI_SYNC_ERROR_MSB 4 -#define UMBOX_INT_STATUS_HCI_SYNC_ERROR_LSB 4 -#define UMBOX_INT_STATUS_HCI_SYNC_ERROR_MASK 0x00000010 -#define UMBOX_INT_STATUS_HCI_SYNC_ERROR_GET(x) (((x) & UMBOX_INT_STATUS_HCI_SYNC_ERROR_MASK) >> UMBOX_INT_STATUS_HCI_SYNC_ERROR_LSB) -#define UMBOX_INT_STATUS_HCI_SYNC_ERROR_SET(x) (((x) << UMBOX_INT_STATUS_HCI_SYNC_ERROR_LSB) & UMBOX_INT_STATUS_HCI_SYNC_ERROR_MASK) -#define UMBOX_INT_STATUS_TX_OVERFLOW_MSB 3 -#define UMBOX_INT_STATUS_TX_OVERFLOW_LSB 3 -#define UMBOX_INT_STATUS_TX_OVERFLOW_MASK 0x00000008 -#define UMBOX_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & UMBOX_INT_STATUS_TX_OVERFLOW_MASK) >> UMBOX_INT_STATUS_TX_OVERFLOW_LSB) -#define UMBOX_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << UMBOX_INT_STATUS_TX_OVERFLOW_LSB) & UMBOX_INT_STATUS_TX_OVERFLOW_MASK) -#define UMBOX_INT_STATUS_RX_UNDERFLOW_MSB 2 -#define UMBOX_INT_STATUS_RX_UNDERFLOW_LSB 2 -#define UMBOX_INT_STATUS_RX_UNDERFLOW_MASK 0x00000004 -#define UMBOX_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & UMBOX_INT_STATUS_RX_UNDERFLOW_MASK) >> UMBOX_INT_STATUS_RX_UNDERFLOW_LSB) -#define UMBOX_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << UMBOX_INT_STATUS_RX_UNDERFLOW_LSB) & UMBOX_INT_STATUS_RX_UNDERFLOW_MASK) -#define UMBOX_INT_STATUS_TX_NOT_EMPTY_MSB 1 -#define UMBOX_INT_STATUS_TX_NOT_EMPTY_LSB 1 -#define UMBOX_INT_STATUS_TX_NOT_EMPTY_MASK 0x00000002 -#define UMBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) (((x) & UMBOX_INT_STATUS_TX_NOT_EMPTY_MASK) >> UMBOX_INT_STATUS_TX_NOT_EMPTY_LSB) -#define UMBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) (((x) << UMBOX_INT_STATUS_TX_NOT_EMPTY_LSB) & UMBOX_INT_STATUS_TX_NOT_EMPTY_MASK) -#define UMBOX_INT_STATUS_RX_NOT_FULL_MSB 0 -#define UMBOX_INT_STATUS_RX_NOT_FULL_LSB 0 -#define UMBOX_INT_STATUS_RX_NOT_FULL_MASK 0x00000001 -#define UMBOX_INT_STATUS_RX_NOT_FULL_GET(x) (((x) & UMBOX_INT_STATUS_RX_NOT_FULL_MASK) >> UMBOX_INT_STATUS_RX_NOT_FULL_LSB) -#define UMBOX_INT_STATUS_RX_NOT_FULL_SET(x) (((x) << UMBOX_INT_STATUS_RX_NOT_FULL_LSB) & UMBOX_INT_STATUS_RX_NOT_FULL_MASK) - -#define UMBOX_INT_ENABLE_ADDRESS 0x00000028 -#define UMBOX_INT_ENABLE_OFFSET 0x00000028 -#define UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_MSB 9 -#define UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_LSB 9 -#define UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_MASK 0x00000200 -#define UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_GET(x) (((x) & UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_MASK) >> UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_LSB) -#define UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_SET(x) (((x) << UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_LSB) & UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_MASK) -#define UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_MSB 8 -#define UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_LSB 8 -#define UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_MASK 0x00000100 -#define UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_GET(x) (((x) & UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_MASK) >> UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_LSB) -#define UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_SET(x) (((x) << UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_LSB) & UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_MASK) -#define UMBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB 7 -#define UMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB 7 -#define UMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK 0x00000080 -#define UMBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) (((x) & UMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) >> UMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) -#define UMBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) (((x) << UMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) & UMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) -#define UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB 6 -#define UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB 6 -#define UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK 0x00000040 -#define UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) (((x) & UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) >> UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) -#define UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) (((x) << UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) & UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) -#define UMBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB 5 -#define UMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB 5 -#define UMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK 0x00000020 -#define UMBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) (((x) & UMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) >> UMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) -#define UMBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) (((x) << UMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) & UMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) -#define UMBOX_INT_ENABLE_HCI_SYNC_ERROR_MSB 4 -#define UMBOX_INT_ENABLE_HCI_SYNC_ERROR_LSB 4 -#define UMBOX_INT_ENABLE_HCI_SYNC_ERROR_MASK 0x00000010 -#define UMBOX_INT_ENABLE_HCI_SYNC_ERROR_GET(x) (((x) & UMBOX_INT_ENABLE_HCI_SYNC_ERROR_MASK) >> UMBOX_INT_ENABLE_HCI_SYNC_ERROR_LSB) -#define UMBOX_INT_ENABLE_HCI_SYNC_ERROR_SET(x) (((x) << UMBOX_INT_ENABLE_HCI_SYNC_ERROR_LSB) & UMBOX_INT_ENABLE_HCI_SYNC_ERROR_MASK) -#define UMBOX_INT_ENABLE_TX_OVERFLOW_MSB 3 -#define UMBOX_INT_ENABLE_TX_OVERFLOW_LSB 3 -#define UMBOX_INT_ENABLE_TX_OVERFLOW_MASK 0x00000008 -#define UMBOX_INT_ENABLE_TX_OVERFLOW_GET(x) (((x) & UMBOX_INT_ENABLE_TX_OVERFLOW_MASK) >> UMBOX_INT_ENABLE_TX_OVERFLOW_LSB) -#define UMBOX_INT_ENABLE_TX_OVERFLOW_SET(x) (((x) << UMBOX_INT_ENABLE_TX_OVERFLOW_LSB) & UMBOX_INT_ENABLE_TX_OVERFLOW_MASK) -#define UMBOX_INT_ENABLE_RX_UNDERFLOW_MSB 2 -#define UMBOX_INT_ENABLE_RX_UNDERFLOW_LSB 2 -#define UMBOX_INT_ENABLE_RX_UNDERFLOW_MASK 0x00000004 -#define UMBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) (((x) & UMBOX_INT_ENABLE_RX_UNDERFLOW_MASK) >> UMBOX_INT_ENABLE_RX_UNDERFLOW_LSB) -#define UMBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) (((x) << UMBOX_INT_ENABLE_RX_UNDERFLOW_LSB) & UMBOX_INT_ENABLE_RX_UNDERFLOW_MASK) -#define UMBOX_INT_ENABLE_TX_NOT_EMPTY_MSB 1 -#define UMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB 1 -#define UMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK 0x00000002 -#define UMBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) (((x) & UMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) >> UMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) -#define UMBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) (((x) << UMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) & UMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) -#define UMBOX_INT_ENABLE_RX_NOT_FULL_MSB 0 -#define UMBOX_INT_ENABLE_RX_NOT_FULL_LSB 0 -#define UMBOX_INT_ENABLE_RX_NOT_FULL_MASK 0x00000001 -#define UMBOX_INT_ENABLE_RX_NOT_FULL_GET(x) (((x) & UMBOX_INT_ENABLE_RX_NOT_FULL_MASK) >> UMBOX_INT_ENABLE_RX_NOT_FULL_LSB) -#define UMBOX_INT_ENABLE_RX_NOT_FULL_SET(x) (((x) << UMBOX_INT_ENABLE_RX_NOT_FULL_LSB) & UMBOX_INT_ENABLE_RX_NOT_FULL_MASK) - -#define UMBOX_DEBUG_ADDRESS 0x0000002c -#define UMBOX_DEBUG_OFFSET 0x0000002c -#define UMBOX_DEBUG_SEL_MSB 2 -#define UMBOX_DEBUG_SEL_LSB 0 -#define UMBOX_DEBUG_SEL_MASK 0x00000007 -#define UMBOX_DEBUG_SEL_GET(x) (((x) & UMBOX_DEBUG_SEL_MASK) >> UMBOX_DEBUG_SEL_LSB) -#define UMBOX_DEBUG_SEL_SET(x) (((x) << UMBOX_DEBUG_SEL_LSB) & UMBOX_DEBUG_SEL_MASK) - -#define UMBOX_FIFO_RESET_ADDRESS 0x00000030 -#define UMBOX_FIFO_RESET_OFFSET 0x00000030 -#define UMBOX_FIFO_RESET_INIT_MSB 0 -#define UMBOX_FIFO_RESET_INIT_LSB 0 -#define UMBOX_FIFO_RESET_INIT_MASK 0x00000001 -#define UMBOX_FIFO_RESET_INIT_GET(x) (((x) & UMBOX_FIFO_RESET_INIT_MASK) >> UMBOX_FIFO_RESET_INIT_LSB) -#define UMBOX_FIFO_RESET_INIT_SET(x) (((x) << UMBOX_FIFO_RESET_INIT_LSB) & UMBOX_FIFO_RESET_INIT_MASK) - -#define UMBOX_HCI_FRAMER_ADDRESS 0x00000034 -#define UMBOX_HCI_FRAMER_OFFSET 0x00000034 -#define UMBOX_HCI_FRAMER_CRC_OVERRIDE_MSB 6 -#define UMBOX_HCI_FRAMER_CRC_OVERRIDE_LSB 6 -#define UMBOX_HCI_FRAMER_CRC_OVERRIDE_MASK 0x00000040 -#define UMBOX_HCI_FRAMER_CRC_OVERRIDE_GET(x) (((x) & UMBOX_HCI_FRAMER_CRC_OVERRIDE_MASK) >> UMBOX_HCI_FRAMER_CRC_OVERRIDE_LSB) -#define UMBOX_HCI_FRAMER_CRC_OVERRIDE_SET(x) (((x) << UMBOX_HCI_FRAMER_CRC_OVERRIDE_LSB) & UMBOX_HCI_FRAMER_CRC_OVERRIDE_MASK) -#define UMBOX_HCI_FRAMER_ENABLE_MSB 5 -#define UMBOX_HCI_FRAMER_ENABLE_LSB 5 -#define UMBOX_HCI_FRAMER_ENABLE_MASK 0x00000020 -#define UMBOX_HCI_FRAMER_ENABLE_GET(x) (((x) & UMBOX_HCI_FRAMER_ENABLE_MASK) >> UMBOX_HCI_FRAMER_ENABLE_LSB) -#define UMBOX_HCI_FRAMER_ENABLE_SET(x) (((x) << UMBOX_HCI_FRAMER_ENABLE_LSB) & UMBOX_HCI_FRAMER_ENABLE_MASK) -#define UMBOX_HCI_FRAMER_SYNC_ERROR_MSB 4 -#define UMBOX_HCI_FRAMER_SYNC_ERROR_LSB 4 -#define UMBOX_HCI_FRAMER_SYNC_ERROR_MASK 0x00000010 -#define UMBOX_HCI_FRAMER_SYNC_ERROR_GET(x) (((x) & UMBOX_HCI_FRAMER_SYNC_ERROR_MASK) >> UMBOX_HCI_FRAMER_SYNC_ERROR_LSB) -#define UMBOX_HCI_FRAMER_SYNC_ERROR_SET(x) (((x) << UMBOX_HCI_FRAMER_SYNC_ERROR_LSB) & UMBOX_HCI_FRAMER_SYNC_ERROR_MASK) -#define UMBOX_HCI_FRAMER_UNDERFLOW_MSB 3 -#define UMBOX_HCI_FRAMER_UNDERFLOW_LSB 3 -#define UMBOX_HCI_FRAMER_UNDERFLOW_MASK 0x00000008 -#define UMBOX_HCI_FRAMER_UNDERFLOW_GET(x) (((x) & UMBOX_HCI_FRAMER_UNDERFLOW_MASK) >> UMBOX_HCI_FRAMER_UNDERFLOW_LSB) -#define UMBOX_HCI_FRAMER_UNDERFLOW_SET(x) (((x) << UMBOX_HCI_FRAMER_UNDERFLOW_LSB) & UMBOX_HCI_FRAMER_UNDERFLOW_MASK) -#define UMBOX_HCI_FRAMER_OVERFLOW_MSB 2 -#define UMBOX_HCI_FRAMER_OVERFLOW_LSB 2 -#define UMBOX_HCI_FRAMER_OVERFLOW_MASK 0x00000004 -#define UMBOX_HCI_FRAMER_OVERFLOW_GET(x) (((x) & UMBOX_HCI_FRAMER_OVERFLOW_MASK) >> UMBOX_HCI_FRAMER_OVERFLOW_LSB) -#define UMBOX_HCI_FRAMER_OVERFLOW_SET(x) (((x) << UMBOX_HCI_FRAMER_OVERFLOW_LSB) & UMBOX_HCI_FRAMER_OVERFLOW_MASK) -#define UMBOX_HCI_FRAMER_CONFIG_MODE_MSB 1 -#define UMBOX_HCI_FRAMER_CONFIG_MODE_LSB 0 -#define UMBOX_HCI_FRAMER_CONFIG_MODE_MASK 0x00000003 -#define UMBOX_HCI_FRAMER_CONFIG_MODE_GET(x) (((x) & UMBOX_HCI_FRAMER_CONFIG_MODE_MASK) >> UMBOX_HCI_FRAMER_CONFIG_MODE_LSB) -#define UMBOX_HCI_FRAMER_CONFIG_MODE_SET(x) (((x) << UMBOX_HCI_FRAMER_CONFIG_MODE_LSB) & UMBOX_HCI_FRAMER_CONFIG_MODE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct umbox_wlan_reg_reg_s { - volatile unsigned int umbox_fifo[2]; - volatile unsigned int umbox_fifo_status; - volatile unsigned int umbox_dma_policy; - volatile unsigned int umbox0_dma_rx_descriptor_base; - volatile unsigned int umbox0_dma_rx_control; - volatile unsigned int umbox0_dma_tx_descriptor_base; - volatile unsigned int umbox0_dma_tx_control; - volatile unsigned int umbox_fifo_timeout; - volatile unsigned int umbox_int_status; - volatile unsigned int umbox_int_enable; - volatile unsigned int umbox_debug; - volatile unsigned int umbox_fifo_reset; - volatile unsigned int umbox_hci_framer; -} umbox_wlan_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _UMBOX_WLAN_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/vmc_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/vmc_reg.h deleted file mode 100644 index aef2977ff72f..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/vmc_reg.h +++ /dev/null @@ -1,167 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "vmc_wlan_reg.h" - - -#ifndef BT_HEADERS - -#define MC_BCAM_VALID_ADDRESS WLAN_MC_BCAM_VALID_ADDRESS -#define MC_BCAM_VALID_OFFSET WLAN_MC_BCAM_VALID_OFFSET -#define MC_BCAM_VALID_BIT_MSB WLAN_MC_BCAM_VALID_BIT_MSB -#define MC_BCAM_VALID_BIT_LSB WLAN_MC_BCAM_VALID_BIT_LSB -#define MC_BCAM_VALID_BIT_MASK WLAN_MC_BCAM_VALID_BIT_MASK -#define MC_BCAM_VALID_BIT_GET(x) WLAN_MC_BCAM_VALID_BIT_GET(x) -#define MC_BCAM_VALID_BIT_SET(x) WLAN_MC_BCAM_VALID_BIT_SET(x) -#define MC_BCAM_COMPARE_ADDRESS WLAN_MC_BCAM_COMPARE_ADDRESS -#define MC_BCAM_COMPARE_OFFSET WLAN_MC_BCAM_COMPARE_OFFSET -#define MC_BCAM_COMPARE_KEY_MSB WLAN_MC_BCAM_COMPARE_KEY_MSB -#define MC_BCAM_COMPARE_KEY_LSB WLAN_MC_BCAM_COMPARE_KEY_LSB -#define MC_BCAM_COMPARE_KEY_MASK WLAN_MC_BCAM_COMPARE_KEY_MASK -#define MC_BCAM_COMPARE_KEY_GET(x) WLAN_MC_BCAM_COMPARE_KEY_GET(x) -#define MC_BCAM_COMPARE_KEY_SET(x) WLAN_MC_BCAM_COMPARE_KEY_SET(x) -#define MC_BCAM_TARGET_ADDRESS WLAN_MC_BCAM_TARGET_ADDRESS -#define MC_BCAM_TARGET_OFFSET WLAN_MC_BCAM_TARGET_OFFSET -#define MC_BCAM_TARGET_INST_MSB WLAN_MC_BCAM_TARGET_INST_MSB -#define MC_BCAM_TARGET_INST_LSB WLAN_MC_BCAM_TARGET_INST_LSB -#define MC_BCAM_TARGET_INST_MASK WLAN_MC_BCAM_TARGET_INST_MASK -#define MC_BCAM_TARGET_INST_GET(x) WLAN_MC_BCAM_TARGET_INST_GET(x) -#define MC_BCAM_TARGET_INST_SET(x) WLAN_MC_BCAM_TARGET_INST_SET(x) -#define APB_ADDR_ERROR_CONTROL_ADDRESS WLAN_APB_ADDR_ERROR_CONTROL_ADDRESS -#define APB_ADDR_ERROR_CONTROL_OFFSET WLAN_APB_ADDR_ERROR_CONTROL_OFFSET -#define APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_MSB WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_MSB -#define APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB -#define APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK -#define APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_GET(x) WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_GET(x) -#define APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_SET(x) WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_SET(x) -#define APB_ADDR_ERROR_CONTROL_ENABLE_MSB WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_MSB -#define APB_ADDR_ERROR_CONTROL_ENABLE_LSB WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_LSB -#define APB_ADDR_ERROR_CONTROL_ENABLE_MASK WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_MASK -#define APB_ADDR_ERROR_CONTROL_ENABLE_GET(x) WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_GET(x) -#define APB_ADDR_ERROR_CONTROL_ENABLE_SET(x) WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_SET(x) -#define APB_ADDR_ERROR_STATUS_ADDRESS WLAN_APB_ADDR_ERROR_STATUS_ADDRESS -#define APB_ADDR_ERROR_STATUS_OFFSET WLAN_APB_ADDR_ERROR_STATUS_OFFSET -#define APB_ADDR_ERROR_STATUS_WRITE_MSB WLAN_APB_ADDR_ERROR_STATUS_WRITE_MSB -#define APB_ADDR_ERROR_STATUS_WRITE_LSB WLAN_APB_ADDR_ERROR_STATUS_WRITE_LSB -#define APB_ADDR_ERROR_STATUS_WRITE_MASK WLAN_APB_ADDR_ERROR_STATUS_WRITE_MASK -#define APB_ADDR_ERROR_STATUS_WRITE_GET(x) WLAN_APB_ADDR_ERROR_STATUS_WRITE_GET(x) -#define APB_ADDR_ERROR_STATUS_WRITE_SET(x) WLAN_APB_ADDR_ERROR_STATUS_WRITE_SET(x) -#define APB_ADDR_ERROR_STATUS_ADDRESS_MSB WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_MSB -#define APB_ADDR_ERROR_STATUS_ADDRESS_LSB WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_LSB -#define APB_ADDR_ERROR_STATUS_ADDRESS_MASK WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_MASK -#define APB_ADDR_ERROR_STATUS_ADDRESS_GET(x) WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_GET(x) -#define APB_ADDR_ERROR_STATUS_ADDRESS_SET(x) WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_SET(x) -#define AHB_ADDR_ERROR_CONTROL_ADDRESS WLAN_AHB_ADDR_ERROR_CONTROL_ADDRESS -#define AHB_ADDR_ERROR_CONTROL_OFFSET WLAN_AHB_ADDR_ERROR_CONTROL_OFFSET -#define AHB_ADDR_ERROR_CONTROL_ENABLE_MSB WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_MSB -#define AHB_ADDR_ERROR_CONTROL_ENABLE_LSB WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_LSB -#define AHB_ADDR_ERROR_CONTROL_ENABLE_MASK WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_MASK -#define AHB_ADDR_ERROR_CONTROL_ENABLE_GET(x) WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_GET(x) -#define AHB_ADDR_ERROR_CONTROL_ENABLE_SET(x) WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_SET(x) -#define AHB_ADDR_ERROR_STATUS_ADDRESS WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS -#define AHB_ADDR_ERROR_STATUS_OFFSET WLAN_AHB_ADDR_ERROR_STATUS_OFFSET -#define AHB_ADDR_ERROR_STATUS_MAC_MSB WLAN_AHB_ADDR_ERROR_STATUS_MAC_MSB -#define AHB_ADDR_ERROR_STATUS_MAC_LSB WLAN_AHB_ADDR_ERROR_STATUS_MAC_LSB -#define AHB_ADDR_ERROR_STATUS_MAC_MASK WLAN_AHB_ADDR_ERROR_STATUS_MAC_MASK -#define AHB_ADDR_ERROR_STATUS_MAC_GET(x) WLAN_AHB_ADDR_ERROR_STATUS_MAC_GET(x) -#define AHB_ADDR_ERROR_STATUS_MAC_SET(x) WLAN_AHB_ADDR_ERROR_STATUS_MAC_SET(x) -#define AHB_ADDR_ERROR_STATUS_MBOX_MSB WLAN_AHB_ADDR_ERROR_STATUS_MBOX_MSB -#define AHB_ADDR_ERROR_STATUS_MBOX_LSB WLAN_AHB_ADDR_ERROR_STATUS_MBOX_LSB -#define AHB_ADDR_ERROR_STATUS_MBOX_MASK WLAN_AHB_ADDR_ERROR_STATUS_MBOX_MASK -#define AHB_ADDR_ERROR_STATUS_MBOX_GET(x) WLAN_AHB_ADDR_ERROR_STATUS_MBOX_GET(x) -#define AHB_ADDR_ERROR_STATUS_MBOX_SET(x) WLAN_AHB_ADDR_ERROR_STATUS_MBOX_SET(x) -#define AHB_ADDR_ERROR_STATUS_ADDRESS_MSB WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_MSB -#define AHB_ADDR_ERROR_STATUS_ADDRESS_LSB WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_LSB -#define AHB_ADDR_ERROR_STATUS_ADDRESS_MASK WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_MASK -#define AHB_ADDR_ERROR_STATUS_ADDRESS_GET(x) WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_GET(x) -#define AHB_ADDR_ERROR_STATUS_ADDRESS_SET(x) WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_SET(x) -#define BCAM_CONFLICT_ERROR_ADDRESS WLAN_BCAM_CONFLICT_ERROR_ADDRESS -#define BCAM_CONFLICT_ERROR_OFFSET WLAN_BCAM_CONFLICT_ERROR_OFFSET -#define BCAM_CONFLICT_ERROR_IPORT_FLAG_MSB WLAN_BCAM_CONFLICT_ERROR_IPORT_FLAG_MSB -#define BCAM_CONFLICT_ERROR_IPORT_FLAG_LSB WLAN_BCAM_CONFLICT_ERROR_IPORT_FLAG_LSB -#define BCAM_CONFLICT_ERROR_IPORT_FLAG_MASK WLAN_BCAM_CONFLICT_ERROR_IPORT_FLAG_MASK -#define BCAM_CONFLICT_ERROR_IPORT_FLAG_GET(x) WLAN_BCAM_CONFLICT_ERROR_IPORT_FLAG_GET(x) -#define BCAM_CONFLICT_ERROR_IPORT_FLAG_SET(x) WLAN_BCAM_CONFLICT_ERROR_IPORT_FLAG_SET(x) -#define BCAM_CONFLICT_ERROR_DPORT_FLAG_MSB WLAN_BCAM_CONFLICT_ERROR_DPORT_FLAG_MSB -#define BCAM_CONFLICT_ERROR_DPORT_FLAG_LSB WLAN_BCAM_CONFLICT_ERROR_DPORT_FLAG_LSB -#define BCAM_CONFLICT_ERROR_DPORT_FLAG_MASK WLAN_BCAM_CONFLICT_ERROR_DPORT_FLAG_MASK -#define BCAM_CONFLICT_ERROR_DPORT_FLAG_GET(x) WLAN_BCAM_CONFLICT_ERROR_DPORT_FLAG_GET(x) -#define BCAM_CONFLICT_ERROR_DPORT_FLAG_SET(x) WLAN_BCAM_CONFLICT_ERROR_DPORT_FLAG_SET(x) -#define CPU_PERF_CNT_ADDRESS WLAN_CPU_PERF_CNT_ADDRESS -#define CPU_PERF_CNT_OFFSET WLAN_CPU_PERF_CNT_OFFSET -#define CPU_PERF_CNT_EN_MSB WLAN_CPU_PERF_CNT_EN_MSB -#define CPU_PERF_CNT_EN_LSB WLAN_CPU_PERF_CNT_EN_LSB -#define CPU_PERF_CNT_EN_MASK WLAN_CPU_PERF_CNT_EN_MASK -#define CPU_PERF_CNT_EN_GET(x) WLAN_CPU_PERF_CNT_EN_GET(x) -#define CPU_PERF_CNT_EN_SET(x) WLAN_CPU_PERF_CNT_EN_SET(x) -#define CPU_INST_FETCH_ADDRESS WLAN_CPU_INST_FETCH_ADDRESS -#define CPU_INST_FETCH_OFFSET WLAN_CPU_INST_FETCH_OFFSET -#define CPU_INST_FETCH_CNT_MSB WLAN_CPU_INST_FETCH_CNT_MSB -#define CPU_INST_FETCH_CNT_LSB WLAN_CPU_INST_FETCH_CNT_LSB -#define CPU_INST_FETCH_CNT_MASK WLAN_CPU_INST_FETCH_CNT_MASK -#define CPU_INST_FETCH_CNT_GET(x) WLAN_CPU_INST_FETCH_CNT_GET(x) -#define CPU_INST_FETCH_CNT_SET(x) WLAN_CPU_INST_FETCH_CNT_SET(x) -#define CPU_DATA_FETCH_ADDRESS WLAN_CPU_DATA_FETCH_ADDRESS -#define CPU_DATA_FETCH_OFFSET WLAN_CPU_DATA_FETCH_OFFSET -#define CPU_DATA_FETCH_CNT_MSB WLAN_CPU_DATA_FETCH_CNT_MSB -#define CPU_DATA_FETCH_CNT_LSB WLAN_CPU_DATA_FETCH_CNT_LSB -#define CPU_DATA_FETCH_CNT_MASK WLAN_CPU_DATA_FETCH_CNT_MASK -#define CPU_DATA_FETCH_CNT_GET(x) WLAN_CPU_DATA_FETCH_CNT_GET(x) -#define CPU_DATA_FETCH_CNT_SET(x) WLAN_CPU_DATA_FETCH_CNT_SET(x) -#define CPU_RAM1_CONFLICT_ADDRESS WLAN_CPU_RAM1_CONFLICT_ADDRESS -#define CPU_RAM1_CONFLICT_OFFSET WLAN_CPU_RAM1_CONFLICT_OFFSET -#define CPU_RAM1_CONFLICT_CNT_MSB WLAN_CPU_RAM1_CONFLICT_CNT_MSB -#define CPU_RAM1_CONFLICT_CNT_LSB WLAN_CPU_RAM1_CONFLICT_CNT_LSB -#define CPU_RAM1_CONFLICT_CNT_MASK WLAN_CPU_RAM1_CONFLICT_CNT_MASK -#define CPU_RAM1_CONFLICT_CNT_GET(x) WLAN_CPU_RAM1_CONFLICT_CNT_GET(x) -#define CPU_RAM1_CONFLICT_CNT_SET(x) WLAN_CPU_RAM1_CONFLICT_CNT_SET(x) -#define CPU_RAM2_CONFLICT_ADDRESS WLAN_CPU_RAM2_CONFLICT_ADDRESS -#define CPU_RAM2_CONFLICT_OFFSET WLAN_CPU_RAM2_CONFLICT_OFFSET -#define CPU_RAM2_CONFLICT_CNT_MSB WLAN_CPU_RAM2_CONFLICT_CNT_MSB -#define CPU_RAM2_CONFLICT_CNT_LSB WLAN_CPU_RAM2_CONFLICT_CNT_LSB -#define CPU_RAM2_CONFLICT_CNT_MASK WLAN_CPU_RAM2_CONFLICT_CNT_MASK -#define CPU_RAM2_CONFLICT_CNT_GET(x) WLAN_CPU_RAM2_CONFLICT_CNT_GET(x) -#define CPU_RAM2_CONFLICT_CNT_SET(x) WLAN_CPU_RAM2_CONFLICT_CNT_SET(x) -#define CPU_RAM3_CONFLICT_ADDRESS WLAN_CPU_RAM3_CONFLICT_ADDRESS -#define CPU_RAM3_CONFLICT_OFFSET WLAN_CPU_RAM3_CONFLICT_OFFSET -#define CPU_RAM3_CONFLICT_CNT_MSB WLAN_CPU_RAM3_CONFLICT_CNT_MSB -#define CPU_RAM3_CONFLICT_CNT_LSB WLAN_CPU_RAM3_CONFLICT_CNT_LSB -#define CPU_RAM3_CONFLICT_CNT_MASK WLAN_CPU_RAM3_CONFLICT_CNT_MASK -#define CPU_RAM3_CONFLICT_CNT_GET(x) WLAN_CPU_RAM3_CONFLICT_CNT_GET(x) -#define CPU_RAM3_CONFLICT_CNT_SET(x) WLAN_CPU_RAM3_CONFLICT_CNT_SET(x) -#define CPU_RAM4_CONFLICT_ADDRESS WLAN_CPU_RAM4_CONFLICT_ADDRESS -#define CPU_RAM4_CONFLICT_OFFSET WLAN_CPU_RAM4_CONFLICT_OFFSET -#define CPU_RAM4_CONFLICT_CNT_MSB WLAN_CPU_RAM4_CONFLICT_CNT_MSB -#define CPU_RAM4_CONFLICT_CNT_LSB WLAN_CPU_RAM4_CONFLICT_CNT_LSB -#define CPU_RAM4_CONFLICT_CNT_MASK WLAN_CPU_RAM4_CONFLICT_CNT_MASK -#define CPU_RAM4_CONFLICT_CNT_GET(x) WLAN_CPU_RAM4_CONFLICT_CNT_GET(x) -#define CPU_RAM4_CONFLICT_CNT_SET(x) WLAN_CPU_RAM4_CONFLICT_CNT_SET(x) - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/vmc_wlan_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/vmc_wlan_reg.h deleted file mode 100644 index 9364ef07f33b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw4.0/hw/vmc_wlan_reg.h +++ /dev/null @@ -1,195 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _VMC_WLAN_REG_REG_H_ -#define _VMC_WLAN_REG_REG_H_ - -#define WLAN_MC_BCAM_VALID_ADDRESS 0x00000000 -#define WLAN_MC_BCAM_VALID_OFFSET 0x00000000 -#define WLAN_MC_BCAM_VALID_BIT_MSB 0 -#define WLAN_MC_BCAM_VALID_BIT_LSB 0 -#define WLAN_MC_BCAM_VALID_BIT_MASK 0x00000001 -#define WLAN_MC_BCAM_VALID_BIT_GET(x) (((x) & WLAN_MC_BCAM_VALID_BIT_MASK) >> WLAN_MC_BCAM_VALID_BIT_LSB) -#define WLAN_MC_BCAM_VALID_BIT_SET(x) (((x) << WLAN_MC_BCAM_VALID_BIT_LSB) & WLAN_MC_BCAM_VALID_BIT_MASK) - -#define WLAN_MC_BCAM_COMPARE_ADDRESS 0x00000200 -#define WLAN_MC_BCAM_COMPARE_OFFSET 0x00000200 -#define WLAN_MC_BCAM_COMPARE_KEY_MSB 19 -#define WLAN_MC_BCAM_COMPARE_KEY_LSB 2 -#define WLAN_MC_BCAM_COMPARE_KEY_MASK 0x000ffffc -#define WLAN_MC_BCAM_COMPARE_KEY_GET(x) (((x) & WLAN_MC_BCAM_COMPARE_KEY_MASK) >> WLAN_MC_BCAM_COMPARE_KEY_LSB) -#define WLAN_MC_BCAM_COMPARE_KEY_SET(x) (((x) << WLAN_MC_BCAM_COMPARE_KEY_LSB) & WLAN_MC_BCAM_COMPARE_KEY_MASK) - -#define WLAN_MC_BCAM_TARGET_ADDRESS 0x00000400 -#define WLAN_MC_BCAM_TARGET_OFFSET 0x00000400 -#define WLAN_MC_BCAM_TARGET_INST_MSB 31 -#define WLAN_MC_BCAM_TARGET_INST_LSB 0 -#define WLAN_MC_BCAM_TARGET_INST_MASK 0xffffffff -#define WLAN_MC_BCAM_TARGET_INST_GET(x) (((x) & WLAN_MC_BCAM_TARGET_INST_MASK) >> WLAN_MC_BCAM_TARGET_INST_LSB) -#define WLAN_MC_BCAM_TARGET_INST_SET(x) (((x) << WLAN_MC_BCAM_TARGET_INST_LSB) & WLAN_MC_BCAM_TARGET_INST_MASK) - -#define WLAN_APB_ADDR_ERROR_CONTROL_ADDRESS 0x00000600 -#define WLAN_APB_ADDR_ERROR_CONTROL_OFFSET 0x00000600 -#define WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_MSB 1 -#define WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB 1 -#define WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK 0x00000002 -#define WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_GET(x) (((x) & WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK) >> WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB) -#define WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_SET(x) (((x) << WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB) & WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK) -#define WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_MSB 0 -#define WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_LSB 0 -#define WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_MASK 0x00000001 -#define WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_GET(x) (((x) & WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_MASK) >> WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_LSB) -#define WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_SET(x) (((x) << WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_LSB) & WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_MASK) - -#define WLAN_APB_ADDR_ERROR_STATUS_ADDRESS 0x00000604 -#define WLAN_APB_ADDR_ERROR_STATUS_OFFSET 0x00000604 -#define WLAN_APB_ADDR_ERROR_STATUS_WRITE_MSB 25 -#define WLAN_APB_ADDR_ERROR_STATUS_WRITE_LSB 25 -#define WLAN_APB_ADDR_ERROR_STATUS_WRITE_MASK 0x02000000 -#define WLAN_APB_ADDR_ERROR_STATUS_WRITE_GET(x) (((x) & WLAN_APB_ADDR_ERROR_STATUS_WRITE_MASK) >> WLAN_APB_ADDR_ERROR_STATUS_WRITE_LSB) -#define WLAN_APB_ADDR_ERROR_STATUS_WRITE_SET(x) (((x) << WLAN_APB_ADDR_ERROR_STATUS_WRITE_LSB) & WLAN_APB_ADDR_ERROR_STATUS_WRITE_MASK) -#define WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_MSB 24 -#define WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_LSB 0 -#define WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_MASK 0x01ffffff -#define WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_GET(x) (((x) & WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_MASK) >> WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_LSB) -#define WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_SET(x) (((x) << WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_LSB) & WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_MASK) - -#define WLAN_AHB_ADDR_ERROR_CONTROL_ADDRESS 0x00000608 -#define WLAN_AHB_ADDR_ERROR_CONTROL_OFFSET 0x00000608 -#define WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_MSB 0 -#define WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_LSB 0 -#define WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_MASK 0x00000001 -#define WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_GET(x) (((x) & WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_MASK) >> WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_LSB) -#define WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_SET(x) (((x) << WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_LSB) & WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_MASK) - -#define WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS 0x0000060c -#define WLAN_AHB_ADDR_ERROR_STATUS_OFFSET 0x0000060c -#define WLAN_AHB_ADDR_ERROR_STATUS_MAC_MSB 31 -#define WLAN_AHB_ADDR_ERROR_STATUS_MAC_LSB 31 -#define WLAN_AHB_ADDR_ERROR_STATUS_MAC_MASK 0x80000000 -#define WLAN_AHB_ADDR_ERROR_STATUS_MAC_GET(x) (((x) & WLAN_AHB_ADDR_ERROR_STATUS_MAC_MASK) >> WLAN_AHB_ADDR_ERROR_STATUS_MAC_LSB) -#define WLAN_AHB_ADDR_ERROR_STATUS_MAC_SET(x) (((x) << WLAN_AHB_ADDR_ERROR_STATUS_MAC_LSB) & WLAN_AHB_ADDR_ERROR_STATUS_MAC_MASK) -#define WLAN_AHB_ADDR_ERROR_STATUS_MBOX_MSB 30 -#define WLAN_AHB_ADDR_ERROR_STATUS_MBOX_LSB 30 -#define WLAN_AHB_ADDR_ERROR_STATUS_MBOX_MASK 0x40000000 -#define WLAN_AHB_ADDR_ERROR_STATUS_MBOX_GET(x) (((x) & WLAN_AHB_ADDR_ERROR_STATUS_MBOX_MASK) >> WLAN_AHB_ADDR_ERROR_STATUS_MBOX_LSB) -#define WLAN_AHB_ADDR_ERROR_STATUS_MBOX_SET(x) (((x) << WLAN_AHB_ADDR_ERROR_STATUS_MBOX_LSB) & WLAN_AHB_ADDR_ERROR_STATUS_MBOX_MASK) -#define WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_MSB 23 -#define WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_LSB 0 -#define WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_MASK 0x00ffffff -#define WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_GET(x) (((x) & WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_MASK) >> WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_LSB) -#define WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_SET(x) (((x) << WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_LSB) & WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_MASK) - -#define WLAN_BCAM_CONFLICT_ERROR_ADDRESS 0x00000610 -#define WLAN_BCAM_CONFLICT_ERROR_OFFSET 0x00000610 -#define WLAN_BCAM_CONFLICT_ERROR_IPORT_FLAG_MSB 1 -#define WLAN_BCAM_CONFLICT_ERROR_IPORT_FLAG_LSB 1 -#define WLAN_BCAM_CONFLICT_ERROR_IPORT_FLAG_MASK 0x00000002 -#define WLAN_BCAM_CONFLICT_ERROR_IPORT_FLAG_GET(x) (((x) & WLAN_BCAM_CONFLICT_ERROR_IPORT_FLAG_MASK) >> WLAN_BCAM_CONFLICT_ERROR_IPORT_FLAG_LSB) -#define WLAN_BCAM_CONFLICT_ERROR_IPORT_FLAG_SET(x) (((x) << WLAN_BCAM_CONFLICT_ERROR_IPORT_FLAG_LSB) & WLAN_BCAM_CONFLICT_ERROR_IPORT_FLAG_MASK) -#define WLAN_BCAM_CONFLICT_ERROR_DPORT_FLAG_MSB 0 -#define WLAN_BCAM_CONFLICT_ERROR_DPORT_FLAG_LSB 0 -#define WLAN_BCAM_CONFLICT_ERROR_DPORT_FLAG_MASK 0x00000001 -#define WLAN_BCAM_CONFLICT_ERROR_DPORT_FLAG_GET(x) (((x) & WLAN_BCAM_CONFLICT_ERROR_DPORT_FLAG_MASK) >> WLAN_BCAM_CONFLICT_ERROR_DPORT_FLAG_LSB) -#define WLAN_BCAM_CONFLICT_ERROR_DPORT_FLAG_SET(x) (((x) << WLAN_BCAM_CONFLICT_ERROR_DPORT_FLAG_LSB) & WLAN_BCAM_CONFLICT_ERROR_DPORT_FLAG_MASK) - -#define WLAN_CPU_PERF_CNT_ADDRESS 0x00000614 -#define WLAN_CPU_PERF_CNT_OFFSET 0x00000614 -#define WLAN_CPU_PERF_CNT_EN_MSB 0 -#define WLAN_CPU_PERF_CNT_EN_LSB 0 -#define WLAN_CPU_PERF_CNT_EN_MASK 0x00000001 -#define WLAN_CPU_PERF_CNT_EN_GET(x) (((x) & WLAN_CPU_PERF_CNT_EN_MASK) >> WLAN_CPU_PERF_CNT_EN_LSB) -#define WLAN_CPU_PERF_CNT_EN_SET(x) (((x) << WLAN_CPU_PERF_CNT_EN_LSB) & WLAN_CPU_PERF_CNT_EN_MASK) - -#define WLAN_CPU_INST_FETCH_ADDRESS 0x00000618 -#define WLAN_CPU_INST_FETCH_OFFSET 0x00000618 -#define WLAN_CPU_INST_FETCH_CNT_MSB 31 -#define WLAN_CPU_INST_FETCH_CNT_LSB 0 -#define WLAN_CPU_INST_FETCH_CNT_MASK 0xffffffff -#define WLAN_CPU_INST_FETCH_CNT_GET(x) (((x) & WLAN_CPU_INST_FETCH_CNT_MASK) >> WLAN_CPU_INST_FETCH_CNT_LSB) -#define WLAN_CPU_INST_FETCH_CNT_SET(x) (((x) << WLAN_CPU_INST_FETCH_CNT_LSB) & WLAN_CPU_INST_FETCH_CNT_MASK) - -#define WLAN_CPU_DATA_FETCH_ADDRESS 0x0000061c -#define WLAN_CPU_DATA_FETCH_OFFSET 0x0000061c -#define WLAN_CPU_DATA_FETCH_CNT_MSB 31 -#define WLAN_CPU_DATA_FETCH_CNT_LSB 0 -#define WLAN_CPU_DATA_FETCH_CNT_MASK 0xffffffff -#define WLAN_CPU_DATA_FETCH_CNT_GET(x) (((x) & WLAN_CPU_DATA_FETCH_CNT_MASK) >> WLAN_CPU_DATA_FETCH_CNT_LSB) -#define WLAN_CPU_DATA_FETCH_CNT_SET(x) (((x) << WLAN_CPU_DATA_FETCH_CNT_LSB) & WLAN_CPU_DATA_FETCH_CNT_MASK) - -#define WLAN_CPU_RAM1_CONFLICT_ADDRESS 0x00000620 -#define WLAN_CPU_RAM1_CONFLICT_OFFSET 0x00000620 -#define WLAN_CPU_RAM1_CONFLICT_CNT_MSB 11 -#define WLAN_CPU_RAM1_CONFLICT_CNT_LSB 0 -#define WLAN_CPU_RAM1_CONFLICT_CNT_MASK 0x00000fff -#define WLAN_CPU_RAM1_CONFLICT_CNT_GET(x) (((x) & WLAN_CPU_RAM1_CONFLICT_CNT_MASK) >> WLAN_CPU_RAM1_CONFLICT_CNT_LSB) -#define WLAN_CPU_RAM1_CONFLICT_CNT_SET(x) (((x) << WLAN_CPU_RAM1_CONFLICT_CNT_LSB) & WLAN_CPU_RAM1_CONFLICT_CNT_MASK) - -#define WLAN_CPU_RAM2_CONFLICT_ADDRESS 0x00000624 -#define WLAN_CPU_RAM2_CONFLICT_OFFSET 0x00000624 -#define WLAN_CPU_RAM2_CONFLICT_CNT_MSB 11 -#define WLAN_CPU_RAM2_CONFLICT_CNT_LSB 0 -#define WLAN_CPU_RAM2_CONFLICT_CNT_MASK 0x00000fff -#define WLAN_CPU_RAM2_CONFLICT_CNT_GET(x) (((x) & WLAN_CPU_RAM2_CONFLICT_CNT_MASK) >> WLAN_CPU_RAM2_CONFLICT_CNT_LSB) -#define WLAN_CPU_RAM2_CONFLICT_CNT_SET(x) (((x) << WLAN_CPU_RAM2_CONFLICT_CNT_LSB) & WLAN_CPU_RAM2_CONFLICT_CNT_MASK) - -#define WLAN_CPU_RAM3_CONFLICT_ADDRESS 0x00000628 -#define WLAN_CPU_RAM3_CONFLICT_OFFSET 0x00000628 -#define WLAN_CPU_RAM3_CONFLICT_CNT_MSB 11 -#define WLAN_CPU_RAM3_CONFLICT_CNT_LSB 0 -#define WLAN_CPU_RAM3_CONFLICT_CNT_MASK 0x00000fff -#define WLAN_CPU_RAM3_CONFLICT_CNT_GET(x) (((x) & WLAN_CPU_RAM3_CONFLICT_CNT_MASK) >> WLAN_CPU_RAM3_CONFLICT_CNT_LSB) -#define WLAN_CPU_RAM3_CONFLICT_CNT_SET(x) (((x) << WLAN_CPU_RAM3_CONFLICT_CNT_LSB) & WLAN_CPU_RAM3_CONFLICT_CNT_MASK) - -#define WLAN_CPU_RAM4_CONFLICT_ADDRESS 0x0000062c -#define WLAN_CPU_RAM4_CONFLICT_OFFSET 0x0000062c -#define WLAN_CPU_RAM4_CONFLICT_CNT_MSB 11 -#define WLAN_CPU_RAM4_CONFLICT_CNT_LSB 0 -#define WLAN_CPU_RAM4_CONFLICT_CNT_MASK 0x00000fff -#define WLAN_CPU_RAM4_CONFLICT_CNT_GET(x) (((x) & WLAN_CPU_RAM4_CONFLICT_CNT_MASK) >> WLAN_CPU_RAM4_CONFLICT_CNT_LSB) -#define WLAN_CPU_RAM4_CONFLICT_CNT_SET(x) (((x) << WLAN_CPU_RAM4_CONFLICT_CNT_LSB) & WLAN_CPU_RAM4_CONFLICT_CNT_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct vmc_wlan_reg_reg_s { - volatile unsigned int wlan_mc_bcam_valid[128]; - volatile unsigned int wlan_mc_bcam_compare[128]; - volatile unsigned int wlan_mc_bcam_target[128]; - volatile unsigned int wlan_apb_addr_error_control; - volatile unsigned int wlan_apb_addr_error_status; - volatile unsigned int wlan_ahb_addr_error_control; - volatile unsigned int wlan_ahb_addr_error_status; - volatile unsigned int wlan_bcam_conflict_error; - volatile unsigned int wlan_cpu_perf_cnt; - volatile unsigned int wlan_cpu_inst_fetch; - volatile unsigned int wlan_cpu_data_fetch; - volatile unsigned int wlan_cpu_ram1_conflict; - volatile unsigned int wlan_cpu_ram2_conflict; - volatile unsigned int wlan_cpu_ram3_conflict; - volatile unsigned int wlan_cpu_ram4_conflict; -} vmc_wlan_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _VMC_WLAN_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/analog_intf_athr_wlan_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/analog_intf_athr_wlan_reg.h deleted file mode 100644 index b75c79f80dd5..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/analog_intf_athr_wlan_reg.h +++ /dev/null @@ -1,3729 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _ANALOG_INTF_ATHR_WLAN_REG_REG_H_ -#define _ANALOG_INTF_ATHR_WLAN_REG_REG_H_ - - -/* macros for RXRF_BIAS1 */ -#define PHY_ANALOG_RXRF_BIAS1_ADDRESS 0x00000000 -#define PHY_ANALOG_RXRF_BIAS1_OFFSET 0x00000000 -#define PHY_ANALOG_RXRF_BIAS1_SPARE_MSB 0 -#define PHY_ANALOG_RXRF_BIAS1_SPARE_LSB 0 -#define PHY_ANALOG_RXRF_BIAS1_SPARE_MASK 0x00000001 -#define PHY_ANALOG_RXRF_BIAS1_SPARE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXRF_BIAS1_SPARE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25SPARE_MSB 3 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25SPARE_LSB 1 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25SPARE_MASK 0x0000000e -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25SPARE_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25SPARE_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO18_MSB 6 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO18_LSB 4 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO18_MASK 0x00000070 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO18_GET(x) (((x) & 0x00000070) >> 4) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO18_SET(x) (((x) << 4) & 0x00000070) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25LO36_MSB 9 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25LO36_LSB 7 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25LO36_MASK 0x00000380 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25LO36_GET(x) (((x) & 0x00000380) >> 7) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25LO36_SET(x) (((x) << 7) & 0x00000380) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2_5GH_MSB 12 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2_5GH_LSB 10 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2_5GH_MASK 0x00001c00 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2_5GH_GET(x) (((x) & 0x00001c00) >> 10) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2_5GH_SET(x) (((x) << 10) & 0x00001c00) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR5GH_MSB 15 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR5GH_LSB 13 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR5GH_MASK 0x0000e000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR5GH_GET(x) (((x) & 0x0000e000) >> 13) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR5GH_SET(x) (((x) << 13) & 0x0000e000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25VGA5G_MSB 18 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25VGA5G_LSB 16 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25VGA5G_MASK 0x00070000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25VGA5G_GET(x) (((x) & 0x00070000) >> 16) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25VGA5G_SET(x) (((x) << 16) & 0x00070000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA5G_MSB 21 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA5G_LSB 19 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA5G_MASK 0x00380000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA5G_GET(x) (((x) & 0x00380000) >> 19) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA5G_SET(x) (((x) << 19) & 0x00380000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO24_MSB 24 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO24_LSB 22 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO24_MASK 0x01c00000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO24_GET(x) (((x) & 0x01c00000) >> 22) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IR25LO24_SET(x) (((x) << 22) & 0x01c00000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2GH_MSB 27 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2GH_LSB 25 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2GH_MASK 0x0e000000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2GH_GET(x) (((x) & 0x0e000000) >> 25) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC25MXR2GH_SET(x) (((x) << 25) & 0x0e000000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA2G_MSB 30 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA2G_LSB 28 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA2G_MASK 0x70000000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA2G_GET(x) (((x) & 0x70000000) >> 28) -#define PHY_ANALOG_RXRF_BIAS1_PWD_IC75LNA2G_SET(x) (((x) << 28) & 0x70000000) -#define PHY_ANALOG_RXRF_BIAS1_PWD_BIAS_MSB 31 -#define PHY_ANALOG_RXRF_BIAS1_PWD_BIAS_LSB 31 -#define PHY_ANALOG_RXRF_BIAS1_PWD_BIAS_MASK 0x80000000 -#define PHY_ANALOG_RXRF_BIAS1_PWD_BIAS_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_RXRF_BIAS1_PWD_BIAS_SET(x) (((x) << 31) & 0x80000000) - -/* macros for RXRF_BIAS2 */ -#define PHY_ANALOG_RXRF_BIAS2_ADDRESS 0x00000004 -#define PHY_ANALOG_RXRF_BIAS2_OFFSET 0x00000004 -#define PHY_ANALOG_RXRF_BIAS2_SPARE_MSB 0 -#define PHY_ANALOG_RXRF_BIAS2_SPARE_LSB 0 -#define PHY_ANALOG_RXRF_BIAS2_SPARE_MASK 0x00000001 -#define PHY_ANALOG_RXRF_BIAS2_SPARE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXRF_BIAS2_SPARE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXRF_BIAS2_PKEN_MSB 3 -#define PHY_ANALOG_RXRF_BIAS2_PKEN_LSB 1 -#define PHY_ANALOG_RXRF_BIAS2_PKEN_MASK 0x0000000e -#define PHY_ANALOG_RXRF_BIAS2_PKEN_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_ANALOG_RXRF_BIAS2_PKEN_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_ANALOG_RXRF_BIAS2_VCMVALUE_MSB 6 -#define PHY_ANALOG_RXRF_BIAS2_VCMVALUE_LSB 4 -#define PHY_ANALOG_RXRF_BIAS2_VCMVALUE_MASK 0x00000070 -#define PHY_ANALOG_RXRF_BIAS2_VCMVALUE_GET(x) (((x) & 0x00000070) >> 4) -#define PHY_ANALOG_RXRF_BIAS2_VCMVALUE_SET(x) (((x) << 4) & 0x00000070) -#define PHY_ANALOG_RXRF_BIAS2_PWD_VCMBUF_MSB 7 -#define PHY_ANALOG_RXRF_BIAS2_PWD_VCMBUF_LSB 7 -#define PHY_ANALOG_RXRF_BIAS2_PWD_VCMBUF_MASK 0x00000080 -#define PHY_ANALOG_RXRF_BIAS2_PWD_VCMBUF_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RXRF_BIAS2_PWD_VCMBUF_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPAREH_MSB 10 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPAREH_LSB 8 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPAREH_MASK 0x00000700 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPAREH_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPAREH_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPARE_MSB 13 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPARE_LSB 11 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPARE_MASK 0x00003800 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPARE_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25SPARE_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25LNABUF_MSB 16 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25LNABUF_LSB 14 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25LNABUF_MASK 0x0001c000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25LNABUF_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25LNABUF_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGCH_MSB 19 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGCH_LSB 17 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGCH_MASK 0x000e0000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGCH_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGCH_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC_MSB 22 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC_LSB 20 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC_MASK 0x00700000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25AGC_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC_MSB 25 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC_LSB 23 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC_MASK 0x03800000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25AGC_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25VCMBUF_MSB 28 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25VCMBUF_LSB 26 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25VCMBUF_MASK 0x1c000000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25VCMBUF_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IC25VCMBUF_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25VCM_MSB 31 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25VCM_LSB 29 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25VCM_MASK 0xe0000000 -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25VCM_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_RXRF_BIAS2_PWD_IR25VCM_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for RXRF_GAINSTAGES */ -#define PHY_ANALOG_RXRF_GAINSTAGES_ADDRESS 0x00000008 -#define PHY_ANALOG_RXRF_GAINSTAGES_OFFSET 0x00000008 -#define PHY_ANALOG_RXRF_GAINSTAGES_SPARE_MSB 0 -#define PHY_ANALOG_RXRF_GAINSTAGES_SPARE_LSB 0 -#define PHY_ANALOG_RXRF_GAINSTAGES_SPARE_MASK 0x00000001 -#define PHY_ANALOG_RXRF_GAINSTAGES_SPARE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXRF_GAINSTAGES_SPARE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNAON_CALDC_MSB 1 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNAON_CALDC_LSB 1 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNAON_CALDC_MASK 0x00000002 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNAON_CALDC_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNAON_CALDC_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_CAP_MSB 3 -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_CAP_LSB 2 -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_CAP_MASK 0x0000000c -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_CAP_GET(x) (((x) & 0x0000000c) >> 2) -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_CAP_SET(x) (((x) << 2) & 0x0000000c) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_CAP_MSB 5 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_CAP_LSB 4 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_CAP_MASK 0x00000030 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_CAP_GET(x) (((x) & 0x00000030) >> 4) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_CAP_SET(x) (((x) << 4) & 0x00000030) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_SHORTINP_MSB 6 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_SHORTINP_LSB 6 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_SHORTINP_MASK 0x00000040 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_SHORTINP_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_SHORTINP_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO5G_MSB 7 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO5G_LSB 7 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO5G_MASK 0x00000080 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO5G_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO5G_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_VGA5G_MSB 8 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_VGA5G_LSB 8 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_VGA5G_MASK 0x00000100 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_VGA5G_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_VGA5G_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR5G_MSB 9 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR5G_LSB 9 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR5G_MASK 0x00000200 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR5G_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR5G_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA5G_MSB 10 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA5G_LSB 10 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA5G_MASK 0x00000400 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA5G_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA5G_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_CAP_MSB 12 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_CAP_LSB 11 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_CAP_MASK 0x00001800 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_CAP_GET(x) (((x) & 0x00001800) >> 11) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_CAP_SET(x) (((x) << 11) & 0x00001800) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_SHORTINP_MSB 13 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_SHORTINP_LSB 13 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_SHORTINP_MASK 0x00002000 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_SHORTINP_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_SHORTINP_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_LP_MSB 14 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_LP_LSB 14 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_LP_MASK 0x00004000 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_LP_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_LP_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO2G_MSB 15 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO2G_LSB 15 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO2G_MASK 0x00008000 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO2G_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LO2G_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR2G_MSB 16 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR2G_LSB 16 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR2G_MASK 0x00010000 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR2G_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_MXR2G_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA2G_MSB 17 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA2G_LSB 17 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA2G_MASK 0x00020000 -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA2G_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_RXRF_GAINSTAGES_PWD_LNA2G_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR5G_GAIN_OVR_MSB 19 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR5G_GAIN_OVR_LSB 18 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR5G_GAIN_OVR_MASK 0x000c0000 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR5G_GAIN_OVR_GET(x) (((x) & 0x000c0000) >> 18) -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR5G_GAIN_OVR_SET(x) (((x) << 18) & 0x000c0000) -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_GAIN_OVR_MSB 22 -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_GAIN_OVR_LSB 20 -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_GAIN_OVR_MASK 0x00700000 -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_GAIN_OVR_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_RXRF_GAINSTAGES_VGA5G_GAIN_OVR_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_MSB 25 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_LSB 23 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_MASK 0x03800000 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA5G_GAIN_OVR_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR2G_GAIN_OVR_MSB 27 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR2G_GAIN_OVR_LSB 26 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR2G_GAIN_OVR_MASK 0x0c000000 -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR2G_GAIN_OVR_GET(x) (((x) & 0x0c000000) >> 26) -#define PHY_ANALOG_RXRF_GAINSTAGES_MXR2G_GAIN_OVR_SET(x) (((x) << 26) & 0x0c000000) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_MSB 30 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_LSB 28 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_MASK 0x70000000 -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_GET(x) (((x) & 0x70000000) >> 28) -#define PHY_ANALOG_RXRF_GAINSTAGES_LNA2G_GAIN_OVR_SET(x) (((x) << 28) & 0x70000000) -#define PHY_ANALOG_RXRF_GAINSTAGES_RX_OVERRIDE_MSB 31 -#define PHY_ANALOG_RXRF_GAINSTAGES_RX_OVERRIDE_LSB 31 -#define PHY_ANALOG_RXRF_GAINSTAGES_RX_OVERRIDE_MASK 0x80000000 -#define PHY_ANALOG_RXRF_GAINSTAGES_RX_OVERRIDE_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_RXRF_GAINSTAGES_RX_OVERRIDE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for RXRF_AGC */ -#define PHY_ANALOG_RXRF_AGC_ADDRESS 0x0000000c -#define PHY_ANALOG_RXRF_AGC_OFFSET 0x0000000c -#define PHY_ANALOG_RXRF_AGC_RF5G_ON_DURING_CALPA_MSB 0 -#define PHY_ANALOG_RXRF_AGC_RF5G_ON_DURING_CALPA_LSB 0 -#define PHY_ANALOG_RXRF_AGC_RF5G_ON_DURING_CALPA_MASK 0x00000001 -#define PHY_ANALOG_RXRF_AGC_RF5G_ON_DURING_CALPA_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXRF_AGC_RF5G_ON_DURING_CALPA_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXRF_AGC_RF2G_ON_DURING_CALPA_MSB 1 -#define PHY_ANALOG_RXRF_AGC_RF2G_ON_DURING_CALPA_LSB 1 -#define PHY_ANALOG_RXRF_AGC_RF2G_ON_DURING_CALPA_MASK 0x00000002 -#define PHY_ANALOG_RXRF_AGC_RF2G_ON_DURING_CALPA_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_RXRF_AGC_RF2G_ON_DURING_CALPA_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_RXRF_AGC_AGC_OUT_MSB 2 -#define PHY_ANALOG_RXRF_AGC_AGC_OUT_LSB 2 -#define PHY_ANALOG_RXRF_AGC_AGC_OUT_MASK 0x00000004 -#define PHY_ANALOG_RXRF_AGC_AGC_OUT_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_RXRF_AGC_LNABUFGAIN2X_MSB 3 -#define PHY_ANALOG_RXRF_AGC_LNABUFGAIN2X_LSB 3 -#define PHY_ANALOG_RXRF_AGC_LNABUFGAIN2X_MASK 0x00000008 -#define PHY_ANALOG_RXRF_AGC_LNABUFGAIN2X_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_RXRF_AGC_LNABUFGAIN2X_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_RXRF_AGC_LNABUF_PWD_OVR_MSB 4 -#define PHY_ANALOG_RXRF_AGC_LNABUF_PWD_OVR_LSB 4 -#define PHY_ANALOG_RXRF_AGC_LNABUF_PWD_OVR_MASK 0x00000010 -#define PHY_ANALOG_RXRF_AGC_LNABUF_PWD_OVR_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_RXRF_AGC_LNABUF_PWD_OVR_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_RXRF_AGC_PWD_LNABUF_MSB 5 -#define PHY_ANALOG_RXRF_AGC_PWD_LNABUF_LSB 5 -#define PHY_ANALOG_RXRF_AGC_PWD_LNABUF_MASK 0x00000020 -#define PHY_ANALOG_RXRF_AGC_PWD_LNABUF_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_RXRF_AGC_PWD_LNABUF_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_RXRF_AGC_AGC_FALL_CTRL_MSB 8 -#define PHY_ANALOG_RXRF_AGC_AGC_FALL_CTRL_LSB 6 -#define PHY_ANALOG_RXRF_AGC_AGC_FALL_CTRL_MASK 0x000001c0 -#define PHY_ANALOG_RXRF_AGC_AGC_FALL_CTRL_GET(x) (((x) & 0x000001c0) >> 6) -#define PHY_ANALOG_RXRF_AGC_AGC_FALL_CTRL_SET(x) (((x) << 6) & 0x000001c0) -#define PHY_ANALOG_RXRF_AGC_AGC5G_CALDAC_OVR_MSB 14 -#define PHY_ANALOG_RXRF_AGC_AGC5G_CALDAC_OVR_LSB 9 -#define PHY_ANALOG_RXRF_AGC_AGC5G_CALDAC_OVR_MASK 0x00007e00 -#define PHY_ANALOG_RXRF_AGC_AGC5G_CALDAC_OVR_GET(x) (((x) & 0x00007e00) >> 9) -#define PHY_ANALOG_RXRF_AGC_AGC5G_CALDAC_OVR_SET(x) (((x) << 9) & 0x00007e00) -#define PHY_ANALOG_RXRF_AGC_AGC5G_DBDAC_OVR_MSB 18 -#define PHY_ANALOG_RXRF_AGC_AGC5G_DBDAC_OVR_LSB 15 -#define PHY_ANALOG_RXRF_AGC_AGC5G_DBDAC_OVR_MASK 0x00078000 -#define PHY_ANALOG_RXRF_AGC_AGC5G_DBDAC_OVR_GET(x) (((x) & 0x00078000) >> 15) -#define PHY_ANALOG_RXRF_AGC_AGC5G_DBDAC_OVR_SET(x) (((x) << 15) & 0x00078000) -#define PHY_ANALOG_RXRF_AGC_AGC2G_CALDAC_OVR_MSB 24 -#define PHY_ANALOG_RXRF_AGC_AGC2G_CALDAC_OVR_LSB 19 -#define PHY_ANALOG_RXRF_AGC_AGC2G_CALDAC_OVR_MASK 0x01f80000 -#define PHY_ANALOG_RXRF_AGC_AGC2G_CALDAC_OVR_GET(x) (((x) & 0x01f80000) >> 19) -#define PHY_ANALOG_RXRF_AGC_AGC2G_CALDAC_OVR_SET(x) (((x) << 19) & 0x01f80000) -#define PHY_ANALOG_RXRF_AGC_AGC2G_DBDAC_OVR_MSB 28 -#define PHY_ANALOG_RXRF_AGC_AGC2G_DBDAC_OVR_LSB 25 -#define PHY_ANALOG_RXRF_AGC_AGC2G_DBDAC_OVR_MASK 0x1e000000 -#define PHY_ANALOG_RXRF_AGC_AGC2G_DBDAC_OVR_GET(x) (((x) & 0x1e000000) >> 25) -#define PHY_ANALOG_RXRF_AGC_AGC2G_DBDAC_OVR_SET(x) (((x) << 25) & 0x1e000000) -#define PHY_ANALOG_RXRF_AGC_AGC_CAL_OVR_MSB 29 -#define PHY_ANALOG_RXRF_AGC_AGC_CAL_OVR_LSB 29 -#define PHY_ANALOG_RXRF_AGC_AGC_CAL_OVR_MASK 0x20000000 -#define PHY_ANALOG_RXRF_AGC_AGC_CAL_OVR_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_RXRF_AGC_AGC_CAL_OVR_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_RXRF_AGC_AGC_ON_OVR_MSB 30 -#define PHY_ANALOG_RXRF_AGC_AGC_ON_OVR_LSB 30 -#define PHY_ANALOG_RXRF_AGC_AGC_ON_OVR_MASK 0x40000000 -#define PHY_ANALOG_RXRF_AGC_AGC_ON_OVR_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_RXRF_AGC_AGC_ON_OVR_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_RXRF_AGC_AGC_OVERRIDE_MSB 31 -#define PHY_ANALOG_RXRF_AGC_AGC_OVERRIDE_LSB 31 -#define PHY_ANALOG_RXRF_AGC_AGC_OVERRIDE_MASK 0x80000000 -#define PHY_ANALOG_RXRF_AGC_AGC_OVERRIDE_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_RXRF_AGC_AGC_OVERRIDE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for TXRF1 */ -#define PHY_ANALOG_TXRF1_ADDRESS 0x00000040 -#define PHY_ANALOG_TXRF1_OFFSET 0x00000040 -#define PHY_ANALOG_TXRF1_PDLOBUF5G_MSB 0 -#define PHY_ANALOG_TXRF1_PDLOBUF5G_LSB 0 -#define PHY_ANALOG_TXRF1_PDLOBUF5G_MASK 0x00000001 -#define PHY_ANALOG_TXRF1_PDLOBUF5G_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_TXRF1_PDLOBUF5G_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_TXRF1_PDLODIV5G_MSB 1 -#define PHY_ANALOG_TXRF1_PDLODIV5G_LSB 1 -#define PHY_ANALOG_TXRF1_PDLODIV5G_MASK 0x00000002 -#define PHY_ANALOG_TXRF1_PDLODIV5G_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_TXRF1_PDLODIV5G_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_TXRF1_LOBUF5GFORCED_MSB 2 -#define PHY_ANALOG_TXRF1_LOBUF5GFORCED_LSB 2 -#define PHY_ANALOG_TXRF1_LOBUF5GFORCED_MASK 0x00000004 -#define PHY_ANALOG_TXRF1_LOBUF5GFORCED_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_TXRF1_LOBUF5GFORCED_SET(x) (((x) << 2) & 0x00000004) -#define PHY_ANALOG_TXRF1_LODIV5GFORCED_MSB 3 -#define PHY_ANALOG_TXRF1_LODIV5GFORCED_LSB 3 -#define PHY_ANALOG_TXRF1_LODIV5GFORCED_MASK 0x00000008 -#define PHY_ANALOG_TXRF1_LODIV5GFORCED_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_TXRF1_LODIV5GFORCED_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_TXRF1_PADRV2GN5G_MSB 7 -#define PHY_ANALOG_TXRF1_PADRV2GN5G_LSB 4 -#define PHY_ANALOG_TXRF1_PADRV2GN5G_MASK 0x000000f0 -#define PHY_ANALOG_TXRF1_PADRV2GN5G_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_ANALOG_TXRF1_PADRV2GN5G_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_ANALOG_TXRF1_PADRV3GN5G_MSB 11 -#define PHY_ANALOG_TXRF1_PADRV3GN5G_LSB 8 -#define PHY_ANALOG_TXRF1_PADRV3GN5G_MASK 0x00000f00 -#define PHY_ANALOG_TXRF1_PADRV3GN5G_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_TXRF1_PADRV3GN5G_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_TXRF1_PADRV4GN5G_MSB 15 -#define PHY_ANALOG_TXRF1_PADRV4GN5G_LSB 12 -#define PHY_ANALOG_TXRF1_PADRV4GN5G_MASK 0x0000f000 -#define PHY_ANALOG_TXRF1_PADRV4GN5G_GET(x) (((x) & 0x0000f000) >> 12) -#define PHY_ANALOG_TXRF1_PADRV4GN5G_SET(x) (((x) << 12) & 0x0000f000) -#define PHY_ANALOG_TXRF1_LOCALTXGAIN5G_MSB 16 -#define PHY_ANALOG_TXRF1_LOCALTXGAIN5G_LSB 16 -#define PHY_ANALOG_TXRF1_LOCALTXGAIN5G_MASK 0x00010000 -#define PHY_ANALOG_TXRF1_LOCALTXGAIN5G_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_TXRF1_LOCALTXGAIN5G_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_TXRF1_PDOUT2G_MSB 17 -#define PHY_ANALOG_TXRF1_PDOUT2G_LSB 17 -#define PHY_ANALOG_TXRF1_PDOUT2G_MASK 0x00020000 -#define PHY_ANALOG_TXRF1_PDOUT2G_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_TXRF1_PDOUT2G_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_TXRF1_PDDR2G_MSB 18 -#define PHY_ANALOG_TXRF1_PDDR2G_LSB 18 -#define PHY_ANALOG_TXRF1_PDDR2G_MASK 0x00040000 -#define PHY_ANALOG_TXRF1_PDDR2G_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_TXRF1_PDDR2G_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_TXRF1_PDMXR2G_MSB 19 -#define PHY_ANALOG_TXRF1_PDMXR2G_LSB 19 -#define PHY_ANALOG_TXRF1_PDMXR2G_MASK 0x00080000 -#define PHY_ANALOG_TXRF1_PDMXR2G_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_ANALOG_TXRF1_PDMXR2G_SET(x) (((x) << 19) & 0x00080000) -#define PHY_ANALOG_TXRF1_PDLOBUF2G_MSB 20 -#define PHY_ANALOG_TXRF1_PDLOBUF2G_LSB 20 -#define PHY_ANALOG_TXRF1_PDLOBUF2G_MASK 0x00100000 -#define PHY_ANALOG_TXRF1_PDLOBUF2G_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_TXRF1_PDLOBUF2G_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_TXRF1_PDLODIV2G_MSB 21 -#define PHY_ANALOG_TXRF1_PDLODIV2G_LSB 21 -#define PHY_ANALOG_TXRF1_PDLODIV2G_MASK 0x00200000 -#define PHY_ANALOG_TXRF1_PDLODIV2G_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_TXRF1_PDLODIV2G_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_TXRF1_LOBUF2GFORCED_MSB 22 -#define PHY_ANALOG_TXRF1_LOBUF2GFORCED_LSB 22 -#define PHY_ANALOG_TXRF1_LOBUF2GFORCED_MASK 0x00400000 -#define PHY_ANALOG_TXRF1_LOBUF2GFORCED_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_TXRF1_LOBUF2GFORCED_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_TXRF1_LODIV2GFORCED_MSB 23 -#define PHY_ANALOG_TXRF1_LODIV2GFORCED_LSB 23 -#define PHY_ANALOG_TXRF1_LODIV2GFORCED_MASK 0x00800000 -#define PHY_ANALOG_TXRF1_LODIV2GFORCED_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_TXRF1_LODIV2GFORCED_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_TXRF1_PADRVGN2G_MSB 30 -#define PHY_ANALOG_TXRF1_PADRVGN2G_LSB 24 -#define PHY_ANALOG_TXRF1_PADRVGN2G_MASK 0x7f000000 -#define PHY_ANALOG_TXRF1_PADRVGN2G_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_ANALOG_TXRF1_PADRVGN2G_SET(x) (((x) << 24) & 0x7f000000) -#define PHY_ANALOG_TXRF1_LOCALTXGAIN2G_MSB 31 -#define PHY_ANALOG_TXRF1_LOCALTXGAIN2G_LSB 31 -#define PHY_ANALOG_TXRF1_LOCALTXGAIN2G_MASK 0x80000000 -#define PHY_ANALOG_TXRF1_LOCALTXGAIN2G_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_TXRF1_LOCALTXGAIN2G_SET(x) (((x) << 31) & 0x80000000) - -/* macros for TXRF2 */ -#define PHY_ANALOG_TXRF2_ADDRESS 0x00000044 -#define PHY_ANALOG_TXRF2_OFFSET 0x00000044 -#define PHY_ANALOG_TXRF2_D3B5G_MSB 2 -#define PHY_ANALOG_TXRF2_D3B5G_LSB 0 -#define PHY_ANALOG_TXRF2_D3B5G_MASK 0x00000007 -#define PHY_ANALOG_TXRF2_D3B5G_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_TXRF2_D3B5G_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_TXRF2_D4B5G_MSB 5 -#define PHY_ANALOG_TXRF2_D4B5G_LSB 3 -#define PHY_ANALOG_TXRF2_D4B5G_MASK 0x00000038 -#define PHY_ANALOG_TXRF2_D4B5G_GET(x) (((x) & 0x00000038) >> 3) -#define PHY_ANALOG_TXRF2_D4B5G_SET(x) (((x) << 3) & 0x00000038) -#define PHY_ANALOG_TXRF2_OCAS2G_MSB 8 -#define PHY_ANALOG_TXRF2_OCAS2G_LSB 6 -#define PHY_ANALOG_TXRF2_OCAS2G_MASK 0x000001c0 -#define PHY_ANALOG_TXRF2_OCAS2G_GET(x) (((x) & 0x000001c0) >> 6) -#define PHY_ANALOG_TXRF2_OCAS2G_SET(x) (((x) << 6) & 0x000001c0) -#define PHY_ANALOG_TXRF2_DCAS2G_MSB 11 -#define PHY_ANALOG_TXRF2_DCAS2G_LSB 9 -#define PHY_ANALOG_TXRF2_DCAS2G_MASK 0x00000e00 -#define PHY_ANALOG_TXRF2_DCAS2G_GET(x) (((x) & 0x00000e00) >> 9) -#define PHY_ANALOG_TXRF2_DCAS2G_SET(x) (((x) << 9) & 0x00000e00) -#define PHY_ANALOG_TXRF2_OB2G_PALOFF_MSB 14 -#define PHY_ANALOG_TXRF2_OB2G_PALOFF_LSB 12 -#define PHY_ANALOG_TXRF2_OB2G_PALOFF_MASK 0x00007000 -#define PHY_ANALOG_TXRF2_OB2G_PALOFF_GET(x) (((x) & 0x00007000) >> 12) -#define PHY_ANALOG_TXRF2_OB2G_PALOFF_SET(x) (((x) << 12) & 0x00007000) -#define PHY_ANALOG_TXRF2_OB2G_QAM_MSB 17 -#define PHY_ANALOG_TXRF2_OB2G_QAM_LSB 15 -#define PHY_ANALOG_TXRF2_OB2G_QAM_MASK 0x00038000 -#define PHY_ANALOG_TXRF2_OB2G_QAM_GET(x) (((x) & 0x00038000) >> 15) -#define PHY_ANALOG_TXRF2_OB2G_QAM_SET(x) (((x) << 15) & 0x00038000) -#define PHY_ANALOG_TXRF2_OB2G_PSK_MSB 20 -#define PHY_ANALOG_TXRF2_OB2G_PSK_LSB 18 -#define PHY_ANALOG_TXRF2_OB2G_PSK_MASK 0x001c0000 -#define PHY_ANALOG_TXRF2_OB2G_PSK_GET(x) (((x) & 0x001c0000) >> 18) -#define PHY_ANALOG_TXRF2_OB2G_PSK_SET(x) (((x) << 18) & 0x001c0000) -#define PHY_ANALOG_TXRF2_OB2G_CCK_MSB 23 -#define PHY_ANALOG_TXRF2_OB2G_CCK_LSB 21 -#define PHY_ANALOG_TXRF2_OB2G_CCK_MASK 0x00e00000 -#define PHY_ANALOG_TXRF2_OB2G_CCK_GET(x) (((x) & 0x00e00000) >> 21) -#define PHY_ANALOG_TXRF2_OB2G_CCK_SET(x) (((x) << 21) & 0x00e00000) -#define PHY_ANALOG_TXRF2_DB2G_MSB 26 -#define PHY_ANALOG_TXRF2_DB2G_LSB 24 -#define PHY_ANALOG_TXRF2_DB2G_MASK 0x07000000 -#define PHY_ANALOG_TXRF2_DB2G_GET(x) (((x) & 0x07000000) >> 24) -#define PHY_ANALOG_TXRF2_DB2G_SET(x) (((x) << 24) & 0x07000000) -#define PHY_ANALOG_TXRF2_PDOUT5G_MSB 30 -#define PHY_ANALOG_TXRF2_PDOUT5G_LSB 27 -#define PHY_ANALOG_TXRF2_PDOUT5G_MASK 0x78000000 -#define PHY_ANALOG_TXRF2_PDOUT5G_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_ANALOG_TXRF2_PDOUT5G_SET(x) (((x) << 27) & 0x78000000) -#define PHY_ANALOG_TXRF2_PDMXR5G_MSB 31 -#define PHY_ANALOG_TXRF2_PDMXR5G_LSB 31 -#define PHY_ANALOG_TXRF2_PDMXR5G_MASK 0x80000000 -#define PHY_ANALOG_TXRF2_PDMXR5G_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_TXRF2_PDMXR5G_SET(x) (((x) << 31) & 0x80000000) - -/* macros for TXRF3 */ -#define PHY_ANALOG_TXRF3_ADDRESS 0x00000048 -#define PHY_ANALOG_TXRF3_OFFSET 0x00000048 -#define PHY_ANALOG_TXRF3_FILTR2G_MSB 1 -#define PHY_ANALOG_TXRF3_FILTR2G_LSB 0 -#define PHY_ANALOG_TXRF3_FILTR2G_MASK 0x00000003 -#define PHY_ANALOG_TXRF3_FILTR2G_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF3_FILTR2G_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF3_PWDFB2_2G_MSB 2 -#define PHY_ANALOG_TXRF3_PWDFB2_2G_LSB 2 -#define PHY_ANALOG_TXRF3_PWDFB2_2G_MASK 0x00000004 -#define PHY_ANALOG_TXRF3_PWDFB2_2G_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_TXRF3_PWDFB2_2G_SET(x) (((x) << 2) & 0x00000004) -#define PHY_ANALOG_TXRF3_PWDFB1_2G_MSB 3 -#define PHY_ANALOG_TXRF3_PWDFB1_2G_LSB 3 -#define PHY_ANALOG_TXRF3_PWDFB1_2G_MASK 0x00000008 -#define PHY_ANALOG_TXRF3_PWDFB1_2G_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_TXRF3_PWDFB1_2G_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_TXRF3_PDFB2G_MSB 4 -#define PHY_ANALOG_TXRF3_PDFB2G_LSB 4 -#define PHY_ANALOG_TXRF3_PDFB2G_MASK 0x00000010 -#define PHY_ANALOG_TXRF3_PDFB2G_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_TXRF3_PDFB2G_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_TXRF3_RDIV5G_MSB 6 -#define PHY_ANALOG_TXRF3_RDIV5G_LSB 5 -#define PHY_ANALOG_TXRF3_RDIV5G_MASK 0x00000060 -#define PHY_ANALOG_TXRF3_RDIV5G_GET(x) (((x) & 0x00000060) >> 5) -#define PHY_ANALOG_TXRF3_RDIV5G_SET(x) (((x) << 5) & 0x00000060) -#define PHY_ANALOG_TXRF3_CAPDIV5G_MSB 9 -#define PHY_ANALOG_TXRF3_CAPDIV5G_LSB 7 -#define PHY_ANALOG_TXRF3_CAPDIV5G_MASK 0x00000380 -#define PHY_ANALOG_TXRF3_CAPDIV5G_GET(x) (((x) & 0x00000380) >> 7) -#define PHY_ANALOG_TXRF3_CAPDIV5G_SET(x) (((x) << 7) & 0x00000380) -#define PHY_ANALOG_TXRF3_PDPREDIST5G_MSB 10 -#define PHY_ANALOG_TXRF3_PDPREDIST5G_LSB 10 -#define PHY_ANALOG_TXRF3_PDPREDIST5G_MASK 0x00000400 -#define PHY_ANALOG_TXRF3_PDPREDIST5G_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_TXRF3_PDPREDIST5G_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_TXRF3_RDIV2G_MSB 12 -#define PHY_ANALOG_TXRF3_RDIV2G_LSB 11 -#define PHY_ANALOG_TXRF3_RDIV2G_MASK 0x00001800 -#define PHY_ANALOG_TXRF3_RDIV2G_GET(x) (((x) & 0x00001800) >> 11) -#define PHY_ANALOG_TXRF3_RDIV2G_SET(x) (((x) << 11) & 0x00001800) -#define PHY_ANALOG_TXRF3_PDPREDIST2G_MSB 13 -#define PHY_ANALOG_TXRF3_PDPREDIST2G_LSB 13 -#define PHY_ANALOG_TXRF3_PDPREDIST2G_MASK 0x00002000 -#define PHY_ANALOG_TXRF3_PDPREDIST2G_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_TXRF3_PDPREDIST2G_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_TXRF3_OCAS5G_MSB 16 -#define PHY_ANALOG_TXRF3_OCAS5G_LSB 14 -#define PHY_ANALOG_TXRF3_OCAS5G_MASK 0x0001c000 -#define PHY_ANALOG_TXRF3_OCAS5G_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_TXRF3_OCAS5G_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_TXRF3_D2CAS5G_MSB 19 -#define PHY_ANALOG_TXRF3_D2CAS5G_LSB 17 -#define PHY_ANALOG_TXRF3_D2CAS5G_MASK 0x000e0000 -#define PHY_ANALOG_TXRF3_D2CAS5G_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_TXRF3_D2CAS5G_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_TXRF3_D3CAS5G_MSB 22 -#define PHY_ANALOG_TXRF3_D3CAS5G_LSB 20 -#define PHY_ANALOG_TXRF3_D3CAS5G_MASK 0x00700000 -#define PHY_ANALOG_TXRF3_D3CAS5G_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_TXRF3_D3CAS5G_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_TXRF3_D4CAS5G_MSB 25 -#define PHY_ANALOG_TXRF3_D4CAS5G_LSB 23 -#define PHY_ANALOG_TXRF3_D4CAS5G_MASK 0x03800000 -#define PHY_ANALOG_TXRF3_D4CAS5G_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_TXRF3_D4CAS5G_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_TXRF3_OB5G_MSB 28 -#define PHY_ANALOG_TXRF3_OB5G_LSB 26 -#define PHY_ANALOG_TXRF3_OB5G_MASK 0x1c000000 -#define PHY_ANALOG_TXRF3_OB5G_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_TXRF3_OB5G_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_TXRF3_D2B5G_MSB 31 -#define PHY_ANALOG_TXRF3_D2B5G_LSB 29 -#define PHY_ANALOG_TXRF3_D2B5G_MASK 0xe0000000 -#define PHY_ANALOG_TXRF3_D2B5G_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_TXRF3_D2B5G_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for TXRF4 */ -#define PHY_ANALOG_TXRF4_ADDRESS 0x0000004c -#define PHY_ANALOG_TXRF4_OFFSET 0x0000004c -#define PHY_ANALOG_TXRF4_PK1B2G_CCK_MSB 1 -#define PHY_ANALOG_TXRF4_PK1B2G_CCK_LSB 0 -#define PHY_ANALOG_TXRF4_PK1B2G_CCK_MASK 0x00000003 -#define PHY_ANALOG_TXRF4_PK1B2G_CCK_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF4_PK1B2G_CCK_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF4_MIOB2G_QAM_MSB 4 -#define PHY_ANALOG_TXRF4_MIOB2G_QAM_LSB 2 -#define PHY_ANALOG_TXRF4_MIOB2G_QAM_MASK 0x0000001c -#define PHY_ANALOG_TXRF4_MIOB2G_QAM_GET(x) (((x) & 0x0000001c) >> 2) -#define PHY_ANALOG_TXRF4_MIOB2G_QAM_SET(x) (((x) << 2) & 0x0000001c) -#define PHY_ANALOG_TXRF4_MIOB2G_PSK_MSB 7 -#define PHY_ANALOG_TXRF4_MIOB2G_PSK_LSB 5 -#define PHY_ANALOG_TXRF4_MIOB2G_PSK_MASK 0x000000e0 -#define PHY_ANALOG_TXRF4_MIOB2G_PSK_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_TXRF4_MIOB2G_PSK_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_TXRF4_MIOB2G_CCK_MSB 10 -#define PHY_ANALOG_TXRF4_MIOB2G_CCK_LSB 8 -#define PHY_ANALOG_TXRF4_MIOB2G_CCK_MASK 0x00000700 -#define PHY_ANALOG_TXRF4_MIOB2G_CCK_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_TXRF4_MIOB2G_CCK_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_TXRF4_COMP2G_QAM_MSB 13 -#define PHY_ANALOG_TXRF4_COMP2G_QAM_LSB 11 -#define PHY_ANALOG_TXRF4_COMP2G_QAM_MASK 0x00003800 -#define PHY_ANALOG_TXRF4_COMP2G_QAM_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_TXRF4_COMP2G_QAM_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_TXRF4_COMP2G_PSK_MSB 16 -#define PHY_ANALOG_TXRF4_COMP2G_PSK_LSB 14 -#define PHY_ANALOG_TXRF4_COMP2G_PSK_MASK 0x0001c000 -#define PHY_ANALOG_TXRF4_COMP2G_PSK_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_TXRF4_COMP2G_PSK_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_TXRF4_COMP2G_CCK_MSB 19 -#define PHY_ANALOG_TXRF4_COMP2G_CCK_LSB 17 -#define PHY_ANALOG_TXRF4_COMP2G_CCK_MASK 0x000e0000 -#define PHY_ANALOG_TXRF4_COMP2G_CCK_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_TXRF4_COMP2G_CCK_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_TXRF4_AMP2B2G_QAM_MSB 22 -#define PHY_ANALOG_TXRF4_AMP2B2G_QAM_LSB 20 -#define PHY_ANALOG_TXRF4_AMP2B2G_QAM_MASK 0x00700000 -#define PHY_ANALOG_TXRF4_AMP2B2G_QAM_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_TXRF4_AMP2B2G_QAM_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_TXRF4_AMP2B2G_PSK_MSB 25 -#define PHY_ANALOG_TXRF4_AMP2B2G_PSK_LSB 23 -#define PHY_ANALOG_TXRF4_AMP2B2G_PSK_MASK 0x03800000 -#define PHY_ANALOG_TXRF4_AMP2B2G_PSK_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_TXRF4_AMP2B2G_PSK_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_TXRF4_AMP2B2G_CCK_MSB 28 -#define PHY_ANALOG_TXRF4_AMP2B2G_CCK_LSB 26 -#define PHY_ANALOG_TXRF4_AMP2B2G_CCK_MASK 0x1c000000 -#define PHY_ANALOG_TXRF4_AMP2B2G_CCK_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_TXRF4_AMP2B2G_CCK_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_TXRF4_AMP2CAS2G_MSB 31 -#define PHY_ANALOG_TXRF4_AMP2CAS2G_LSB 29 -#define PHY_ANALOG_TXRF4_AMP2CAS2G_MASK 0xe0000000 -#define PHY_ANALOG_TXRF4_AMP2CAS2G_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_TXRF4_AMP2CAS2G_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for TXRF5 */ -#define PHY_ANALOG_TXRF5_ADDRESS 0x00000050 -#define PHY_ANALOG_TXRF5_OFFSET 0x00000050 -#define PHY_ANALOG_TXRF5_TXMODPALONLY_MSB 0 -#define PHY_ANALOG_TXRF5_TXMODPALONLY_LSB 0 -#define PHY_ANALOG_TXRF5_TXMODPALONLY_MASK 0x00000001 -#define PHY_ANALOG_TXRF5_TXMODPALONLY_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_TXRF5_TXMODPALONLY_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_TXRF5_PAL_LOCKED_MSB 1 -#define PHY_ANALOG_TXRF5_PAL_LOCKED_LSB 1 -#define PHY_ANALOG_TXRF5_PAL_LOCKED_MASK 0x00000002 -#define PHY_ANALOG_TXRF5_PAL_LOCKED_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_TXRF5_FBHI2G_MSB 2 -#define PHY_ANALOG_TXRF5_FBHI2G_LSB 2 -#define PHY_ANALOG_TXRF5_FBHI2G_MASK 0x00000004 -#define PHY_ANALOG_TXRF5_FBHI2G_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_TXRF5_FBLO2G_MSB 3 -#define PHY_ANALOG_TXRF5_FBLO2G_LSB 3 -#define PHY_ANALOG_TXRF5_FBLO2G_MASK 0x00000008 -#define PHY_ANALOG_TXRF5_FBLO2G_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_TXRF5_NOPALGAIN2G_MSB 4 -#define PHY_ANALOG_TXRF5_NOPALGAIN2G_LSB 4 -#define PHY_ANALOG_TXRF5_NOPALGAIN2G_MASK 0x00000010 -#define PHY_ANALOG_TXRF5_NOPALGAIN2G_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_TXRF5_NOPALGAIN2G_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_TXRF5_ENPACAL2G_MSB 5 -#define PHY_ANALOG_TXRF5_ENPACAL2G_LSB 5 -#define PHY_ANALOG_TXRF5_ENPACAL2G_MASK 0x00000020 -#define PHY_ANALOG_TXRF5_ENPACAL2G_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_TXRF5_ENPACAL2G_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_TXRF5_OFFSET2G_MSB 12 -#define PHY_ANALOG_TXRF5_OFFSET2G_LSB 6 -#define PHY_ANALOG_TXRF5_OFFSET2G_MASK 0x00001fc0 -#define PHY_ANALOG_TXRF5_OFFSET2G_GET(x) (((x) & 0x00001fc0) >> 6) -#define PHY_ANALOG_TXRF5_OFFSET2G_SET(x) (((x) << 6) & 0x00001fc0) -#define PHY_ANALOG_TXRF5_ENOFFSETCAL2G_MSB 13 -#define PHY_ANALOG_TXRF5_ENOFFSETCAL2G_LSB 13 -#define PHY_ANALOG_TXRF5_ENOFFSETCAL2G_MASK 0x00002000 -#define PHY_ANALOG_TXRF5_ENOFFSETCAL2G_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_TXRF5_ENOFFSETCAL2G_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_TXRF5_REFHI2G_MSB 16 -#define PHY_ANALOG_TXRF5_REFHI2G_LSB 14 -#define PHY_ANALOG_TXRF5_REFHI2G_MASK 0x0001c000 -#define PHY_ANALOG_TXRF5_REFHI2G_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_TXRF5_REFHI2G_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_TXRF5_REFLO2G_MSB 19 -#define PHY_ANALOG_TXRF5_REFLO2G_LSB 17 -#define PHY_ANALOG_TXRF5_REFLO2G_MASK 0x000e0000 -#define PHY_ANALOG_TXRF5_REFLO2G_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_TXRF5_REFLO2G_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_TXRF5_PALCLAMP2G_MSB 21 -#define PHY_ANALOG_TXRF5_PALCLAMP2G_LSB 20 -#define PHY_ANALOG_TXRF5_PALCLAMP2G_MASK 0x00300000 -#define PHY_ANALOG_TXRF5_PALCLAMP2G_GET(x) (((x) & 0x00300000) >> 20) -#define PHY_ANALOG_TXRF5_PALCLAMP2G_SET(x) (((x) << 20) & 0x00300000) -#define PHY_ANALOG_TXRF5_PK2B2G_QAM_MSB 23 -#define PHY_ANALOG_TXRF5_PK2B2G_QAM_LSB 22 -#define PHY_ANALOG_TXRF5_PK2B2G_QAM_MASK 0x00c00000 -#define PHY_ANALOG_TXRF5_PK2B2G_QAM_GET(x) (((x) & 0x00c00000) >> 22) -#define PHY_ANALOG_TXRF5_PK2B2G_QAM_SET(x) (((x) << 22) & 0x00c00000) -#define PHY_ANALOG_TXRF5_PK2B2G_PSK_MSB 25 -#define PHY_ANALOG_TXRF5_PK2B2G_PSK_LSB 24 -#define PHY_ANALOG_TXRF5_PK2B2G_PSK_MASK 0x03000000 -#define PHY_ANALOG_TXRF5_PK2B2G_PSK_GET(x) (((x) & 0x03000000) >> 24) -#define PHY_ANALOG_TXRF5_PK2B2G_PSK_SET(x) (((x) << 24) & 0x03000000) -#define PHY_ANALOG_TXRF5_PK2B2G_CCK_MSB 27 -#define PHY_ANALOG_TXRF5_PK2B2G_CCK_LSB 26 -#define PHY_ANALOG_TXRF5_PK2B2G_CCK_MASK 0x0c000000 -#define PHY_ANALOG_TXRF5_PK2B2G_CCK_GET(x) (((x) & 0x0c000000) >> 26) -#define PHY_ANALOG_TXRF5_PK2B2G_CCK_SET(x) (((x) << 26) & 0x0c000000) -#define PHY_ANALOG_TXRF5_PK1B2G_QAM_MSB 29 -#define PHY_ANALOG_TXRF5_PK1B2G_QAM_LSB 28 -#define PHY_ANALOG_TXRF5_PK1B2G_QAM_MASK 0x30000000 -#define PHY_ANALOG_TXRF5_PK1B2G_QAM_GET(x) (((x) & 0x30000000) >> 28) -#define PHY_ANALOG_TXRF5_PK1B2G_QAM_SET(x) (((x) << 28) & 0x30000000) -#define PHY_ANALOG_TXRF5_PK1B2G_PSK_MSB 31 -#define PHY_ANALOG_TXRF5_PK1B2G_PSK_LSB 30 -#define PHY_ANALOG_TXRF5_PK1B2G_PSK_MASK 0xc0000000 -#define PHY_ANALOG_TXRF5_PK1B2G_PSK_GET(x) (((x) & 0xc0000000) >> 30) -#define PHY_ANALOG_TXRF5_PK1B2G_PSK_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for TXRF6 */ -#define PHY_ANALOG_TXRF6_ADDRESS 0x00000054 -#define PHY_ANALOG_TXRF6_OFFSET 0x00000054 -#define PHY_ANALOG_TXRF6_PALCLKGATE2G_MSB 0 -#define PHY_ANALOG_TXRF6_PALCLKGATE2G_LSB 0 -#define PHY_ANALOG_TXRF6_PALCLKGATE2G_MASK 0x00000001 -#define PHY_ANALOG_TXRF6_PALCLKGATE2G_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_TXRF6_PALCLKGATE2G_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_TXRF6_PALFLUCTCOUNT2G_MSB 8 -#define PHY_ANALOG_TXRF6_PALFLUCTCOUNT2G_LSB 1 -#define PHY_ANALOG_TXRF6_PALFLUCTCOUNT2G_MASK 0x000001fe -#define PHY_ANALOG_TXRF6_PALFLUCTCOUNT2G_GET(x) (((x) & 0x000001fe) >> 1) -#define PHY_ANALOG_TXRF6_PALFLUCTCOUNT2G_SET(x) (((x) << 1) & 0x000001fe) -#define PHY_ANALOG_TXRF6_PALFLUCTGAIN2G_MSB 10 -#define PHY_ANALOG_TXRF6_PALFLUCTGAIN2G_LSB 9 -#define PHY_ANALOG_TXRF6_PALFLUCTGAIN2G_MASK 0x00000600 -#define PHY_ANALOG_TXRF6_PALFLUCTGAIN2G_GET(x) (((x) & 0x00000600) >> 9) -#define PHY_ANALOG_TXRF6_PALFLUCTGAIN2G_SET(x) (((x) << 9) & 0x00000600) -#define PHY_ANALOG_TXRF6_PALNOFLUCT2G_MSB 11 -#define PHY_ANALOG_TXRF6_PALNOFLUCT2G_LSB 11 -#define PHY_ANALOG_TXRF6_PALNOFLUCT2G_MASK 0x00000800 -#define PHY_ANALOG_TXRF6_PALNOFLUCT2G_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_TXRF6_PALNOFLUCT2G_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_TXRF6_GAINSTEP2G_MSB 14 -#define PHY_ANALOG_TXRF6_GAINSTEP2G_LSB 12 -#define PHY_ANALOG_TXRF6_GAINSTEP2G_MASK 0x00007000 -#define PHY_ANALOG_TXRF6_GAINSTEP2G_GET(x) (((x) & 0x00007000) >> 12) -#define PHY_ANALOG_TXRF6_GAINSTEP2G_SET(x) (((x) << 12) & 0x00007000) -#define PHY_ANALOG_TXRF6_USE_GAIN_DELTA2G_MSB 15 -#define PHY_ANALOG_TXRF6_USE_GAIN_DELTA2G_LSB 15 -#define PHY_ANALOG_TXRF6_USE_GAIN_DELTA2G_MASK 0x00008000 -#define PHY_ANALOG_TXRF6_USE_GAIN_DELTA2G_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_TXRF6_USE_GAIN_DELTA2G_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_TXRF6_CAPDIV_I2G_MSB 19 -#define PHY_ANALOG_TXRF6_CAPDIV_I2G_LSB 16 -#define PHY_ANALOG_TXRF6_CAPDIV_I2G_MASK 0x000f0000 -#define PHY_ANALOG_TXRF6_CAPDIV_I2G_GET(x) (((x) & 0x000f0000) >> 16) -#define PHY_ANALOG_TXRF6_CAPDIV_I2G_SET(x) (((x) << 16) & 0x000f0000) -#define PHY_ANALOG_TXRF6_PADRVGN_INDEX_I2G_MSB 23 -#define PHY_ANALOG_TXRF6_PADRVGN_INDEX_I2G_LSB 20 -#define PHY_ANALOG_TXRF6_PADRVGN_INDEX_I2G_MASK 0x00f00000 -#define PHY_ANALOG_TXRF6_PADRVGN_INDEX_I2G_GET(x) (((x) & 0x00f00000) >> 20) -#define PHY_ANALOG_TXRF6_PADRVGN_INDEX_I2G_SET(x) (((x) << 20) & 0x00f00000) -#define PHY_ANALOG_TXRF6_VCMONDELAY2G_MSB 26 -#define PHY_ANALOG_TXRF6_VCMONDELAY2G_LSB 24 -#define PHY_ANALOG_TXRF6_VCMONDELAY2G_MASK 0x07000000 -#define PHY_ANALOG_TXRF6_VCMONDELAY2G_GET(x) (((x) & 0x07000000) >> 24) -#define PHY_ANALOG_TXRF6_VCMONDELAY2G_SET(x) (((x) << 24) & 0x07000000) -#define PHY_ANALOG_TXRF6_CAPDIV2G_MSB 30 -#define PHY_ANALOG_TXRF6_CAPDIV2G_LSB 27 -#define PHY_ANALOG_TXRF6_CAPDIV2G_MASK 0x78000000 -#define PHY_ANALOG_TXRF6_CAPDIV2G_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_ANALOG_TXRF6_CAPDIV2G_SET(x) (((x) << 27) & 0x78000000) -#define PHY_ANALOG_TXRF6_CAPDIV2GOVR_MSB 31 -#define PHY_ANALOG_TXRF6_CAPDIV2GOVR_LSB 31 -#define PHY_ANALOG_TXRF6_CAPDIV2GOVR_MASK 0x80000000 -#define PHY_ANALOG_TXRF6_CAPDIV2GOVR_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_TXRF6_CAPDIV2GOVR_SET(x) (((x) << 31) & 0x80000000) - -/* macros for TXRF7 */ -#define PHY_ANALOG_TXRF7_ADDRESS 0x00000058 -#define PHY_ANALOG_TXRF7_OFFSET 0x00000058 -#define PHY_ANALOG_TXRF7_SPARE7_MSB 1 -#define PHY_ANALOG_TXRF7_SPARE7_LSB 0 -#define PHY_ANALOG_TXRF7_SPARE7_MASK 0x00000003 -#define PHY_ANALOG_TXRF7_SPARE7_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF7_SPARE7_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_4_MSB 7 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_4_LSB 2 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_4_MASK 0x000000fc -#define PHY_ANALOG_TXRF7_PADRVGNTAB_4_GET(x) (((x) & 0x000000fc) >> 2) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_4_SET(x) (((x) << 2) & 0x000000fc) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_3_MSB 13 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_3_LSB 8 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_3_MASK 0x00003f00 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_3_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_3_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_2_MSB 19 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_2_LSB 14 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_2_MASK 0x000fc000 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_2_GET(x) (((x) & 0x000fc000) >> 14) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_2_SET(x) (((x) << 14) & 0x000fc000) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_1_MSB 25 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_1_LSB 20 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_1_MASK 0x03f00000 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_1_GET(x) (((x) & 0x03f00000) >> 20) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_1_SET(x) (((x) << 20) & 0x03f00000) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_0_MSB 31 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_0_LSB 26 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_0_MASK 0xfc000000 -#define PHY_ANALOG_TXRF7_PADRVGNTAB_0_GET(x) (((x) & 0xfc000000) >> 26) -#define PHY_ANALOG_TXRF7_PADRVGNTAB_0_SET(x) (((x) << 26) & 0xfc000000) - -/* macros for TXRF8 */ -#define PHY_ANALOG_TXRF8_ADDRESS 0x0000005c -#define PHY_ANALOG_TXRF8_OFFSET 0x0000005c -#define PHY_ANALOG_TXRF8_SPARE8_MSB 1 -#define PHY_ANALOG_TXRF8_SPARE8_LSB 0 -#define PHY_ANALOG_TXRF8_SPARE8_MASK 0x00000003 -#define PHY_ANALOG_TXRF8_SPARE8_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF8_SPARE8_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_9_MSB 7 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_9_LSB 2 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_9_MASK 0x000000fc -#define PHY_ANALOG_TXRF8_PADRVGNTAB_9_GET(x) (((x) & 0x000000fc) >> 2) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_9_SET(x) (((x) << 2) & 0x000000fc) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_8_MSB 13 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_8_LSB 8 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_8_MASK 0x00003f00 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_8_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_8_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_7_MSB 19 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_7_LSB 14 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_7_MASK 0x000fc000 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_7_GET(x) (((x) & 0x000fc000) >> 14) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_7_SET(x) (((x) << 14) & 0x000fc000) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_6_MSB 25 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_6_LSB 20 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_6_MASK 0x03f00000 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_6_GET(x) (((x) & 0x03f00000) >> 20) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_6_SET(x) (((x) << 20) & 0x03f00000) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_5_MSB 31 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_5_LSB 26 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_5_MASK 0xfc000000 -#define PHY_ANALOG_TXRF8_PADRVGNTAB_5_GET(x) (((x) & 0xfc000000) >> 26) -#define PHY_ANALOG_TXRF8_PADRVGNTAB_5_SET(x) (((x) << 26) & 0xfc000000) - -/* macros for TXRF9 */ -#define PHY_ANALOG_TXRF9_ADDRESS 0x00000060 -#define PHY_ANALOG_TXRF9_OFFSET 0x00000060 -#define PHY_ANALOG_TXRF9_SPARE9_MSB 1 -#define PHY_ANALOG_TXRF9_SPARE9_LSB 0 -#define PHY_ANALOG_TXRF9_SPARE9_MASK 0x00000003 -#define PHY_ANALOG_TXRF9_SPARE9_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF9_SPARE9_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_14_MSB 7 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_14_LSB 2 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_14_MASK 0x000000fc -#define PHY_ANALOG_TXRF9_PADRVGNTAB_14_GET(x) (((x) & 0x000000fc) >> 2) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_14_SET(x) (((x) << 2) & 0x000000fc) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_13_MSB 13 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_13_LSB 8 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_13_MASK 0x00003f00 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_13_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_13_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_12_MSB 19 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_12_LSB 14 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_12_MASK 0x000fc000 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_12_GET(x) (((x) & 0x000fc000) >> 14) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_12_SET(x) (((x) << 14) & 0x000fc000) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_11_MSB 25 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_11_LSB 20 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_11_MASK 0x03f00000 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_11_GET(x) (((x) & 0x03f00000) >> 20) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_11_SET(x) (((x) << 20) & 0x03f00000) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_10_MSB 31 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_10_LSB 26 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_10_MASK 0xfc000000 -#define PHY_ANALOG_TXRF9_PADRVGNTAB_10_GET(x) (((x) & 0xfc000000) >> 26) -#define PHY_ANALOG_TXRF9_PADRVGNTAB_10_SET(x) (((x) << 26) & 0xfc000000) - -/* macros for TXRF10 */ -#define PHY_ANALOG_TXRF10_ADDRESS 0x00000064 -#define PHY_ANALOG_TXRF10_OFFSET 0x00000064 -#define PHY_ANALOG_TXRF10_SPARE10_MSB 2 -#define PHY_ANALOG_TXRF10_SPARE10_LSB 0 -#define PHY_ANALOG_TXRF10_SPARE10_MASK 0x00000007 -#define PHY_ANALOG_TXRF10_SPARE10_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_TXRF10_SPARE10_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_TXRF10_PDOUT5G_3CALTX_MSB 3 -#define PHY_ANALOG_TXRF10_PDOUT5G_3CALTX_LSB 3 -#define PHY_ANALOG_TXRF10_PDOUT5G_3CALTX_MASK 0x00000008 -#define PHY_ANALOG_TXRF10_PDOUT5G_3CALTX_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_TXRF10_PDOUT5G_3CALTX_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_TXRF10_D3B5GCALTX_MSB 6 -#define PHY_ANALOG_TXRF10_D3B5GCALTX_LSB 4 -#define PHY_ANALOG_TXRF10_D3B5GCALTX_MASK 0x00000070 -#define PHY_ANALOG_TXRF10_D3B5GCALTX_GET(x) (((x) & 0x00000070) >> 4) -#define PHY_ANALOG_TXRF10_D3B5GCALTX_SET(x) (((x) << 4) & 0x00000070) -#define PHY_ANALOG_TXRF10_D4B5GCALTX_MSB 9 -#define PHY_ANALOG_TXRF10_D4B5GCALTX_LSB 7 -#define PHY_ANALOG_TXRF10_D4B5GCALTX_MASK 0x00000380 -#define PHY_ANALOG_TXRF10_D4B5GCALTX_GET(x) (((x) & 0x00000380) >> 7) -#define PHY_ANALOG_TXRF10_D4B5GCALTX_SET(x) (((x) << 7) & 0x00000380) -#define PHY_ANALOG_TXRF10_PADRVGN2GCALTX_MSB 16 -#define PHY_ANALOG_TXRF10_PADRVGN2GCALTX_LSB 10 -#define PHY_ANALOG_TXRF10_PADRVGN2GCALTX_MASK 0x0001fc00 -#define PHY_ANALOG_TXRF10_PADRVGN2GCALTX_GET(x) (((x) & 0x0001fc00) >> 10) -#define PHY_ANALOG_TXRF10_PADRVGN2GCALTX_SET(x) (((x) << 10) & 0x0001fc00) -#define PHY_ANALOG_TXRF10_DB2GCALTX_MSB 19 -#define PHY_ANALOG_TXRF10_DB2GCALTX_LSB 17 -#define PHY_ANALOG_TXRF10_DB2GCALTX_MASK 0x000e0000 -#define PHY_ANALOG_TXRF10_DB2GCALTX_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_TXRF10_DB2GCALTX_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_TXRF10_CALTXSHIFT_MSB 20 -#define PHY_ANALOG_TXRF10_CALTXSHIFT_LSB 20 -#define PHY_ANALOG_TXRF10_CALTXSHIFT_MASK 0x00100000 -#define PHY_ANALOG_TXRF10_CALTXSHIFT_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_TXRF10_CALTXSHIFT_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_TXRF10_CALTXSHIFTOVR_MSB 21 -#define PHY_ANALOG_TXRF10_CALTXSHIFTOVR_LSB 21 -#define PHY_ANALOG_TXRF10_CALTXSHIFTOVR_MASK 0x00200000 -#define PHY_ANALOG_TXRF10_CALTXSHIFTOVR_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_TXRF10_CALTXSHIFTOVR_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_TXRF10_PADRVGN2G_SMOUT_MSB 27 -#define PHY_ANALOG_TXRF10_PADRVGN2G_SMOUT_LSB 22 -#define PHY_ANALOG_TXRF10_PADRVGN2G_SMOUT_MASK 0x0fc00000 -#define PHY_ANALOG_TXRF10_PADRVGN2G_SMOUT_GET(x) (((x) & 0x0fc00000) >> 22) -#define PHY_ANALOG_TXRF10_PADRVGN_INDEX2G_SMOUT_MSB 31 -#define PHY_ANALOG_TXRF10_PADRVGN_INDEX2G_SMOUT_LSB 28 -#define PHY_ANALOG_TXRF10_PADRVGN_INDEX2G_SMOUT_MASK 0xf0000000 -#define PHY_ANALOG_TXRF10_PADRVGN_INDEX2G_SMOUT_GET(x) (((x) & 0xf0000000) >> 28) - -/* macros for TXRF11 */ -#define PHY_ANALOG_TXRF11_ADDRESS 0x00000068 -#define PHY_ANALOG_TXRF11_OFFSET 0x00000068 -#define PHY_ANALOG_TXRF11_SPARE11_MSB 1 -#define PHY_ANALOG_TXRF11_SPARE11_LSB 0 -#define PHY_ANALOG_TXRF11_SPARE11_MASK 0x00000003 -#define PHY_ANALOG_TXRF11_SPARE11_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_TXRF11_SPARE11_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV5G_MSB 4 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV5G_LSB 2 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV5G_MASK 0x0000001c -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV5G_GET(x) (((x) & 0x0000001c) >> 2) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV5G_SET(x) (((x) << 2) & 0x0000001c) -#define PHY_ANALOG_TXRF11_PWD_IR25PA2G_MSB 7 -#define PHY_ANALOG_TXRF11_PWD_IR25PA2G_LSB 5 -#define PHY_ANALOG_TXRF11_PWD_IR25PA2G_MASK 0x000000e0 -#define PHY_ANALOG_TXRF11_PWD_IR25PA2G_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_TXRF11_PWD_IR25PA2G_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS2G_MSB 10 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS2G_LSB 8 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS2G_MASK 0x00000700 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS2G_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXBIAS2G_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV2G_MSB 13 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV2G_LSB 11 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV2G_MASK 0x00003800 -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV2G_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_TXRF11_PWD_IR25MIXDIV2G_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_TXRF11_PWD_ICSPARE_MSB 16 -#define PHY_ANALOG_TXRF11_PWD_ICSPARE_LSB 14 -#define PHY_ANALOG_TXRF11_PWD_ICSPARE_MASK 0x0001c000 -#define PHY_ANALOG_TXRF11_PWD_ICSPARE_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_TXRF11_PWD_ICSPARE_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_TXRF11_PWD_IC25TEMPSEN_MSB 19 -#define PHY_ANALOG_TXRF11_PWD_IC25TEMPSEN_LSB 17 -#define PHY_ANALOG_TXRF11_PWD_IC25TEMPSEN_MASK 0x000e0000 -#define PHY_ANALOG_TXRF11_PWD_IC25TEMPSEN_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_TXRF11_PWD_IC25TEMPSEN_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G2_MSB 22 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G2_LSB 20 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G2_MASK 0x00700000 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G2_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G2_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G1_MSB 25 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G1_LSB 23 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G1_MASK 0x03800000 -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G1_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_TXRF11_PWD_IC25PA5G1_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_TXRF11_PWD_IC25MIXBUF5G_MSB 28 -#define PHY_ANALOG_TXRF11_PWD_IC25MIXBUF5G_LSB 26 -#define PHY_ANALOG_TXRF11_PWD_IC25MIXBUF5G_MASK 0x1c000000 -#define PHY_ANALOG_TXRF11_PWD_IC25MIXBUF5G_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_TXRF11_PWD_IC25MIXBUF5G_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_TXRF11_PWD_IC25PA2G_MSB 31 -#define PHY_ANALOG_TXRF11_PWD_IC25PA2G_LSB 29 -#define PHY_ANALOG_TXRF11_PWD_IC25PA2G_MASK 0xe0000000 -#define PHY_ANALOG_TXRF11_PWD_IC25PA2G_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_TXRF11_PWD_IC25PA2G_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for TXRF12 */ -#define PHY_ANALOG_TXRF12_ADDRESS 0x0000006c -#define PHY_ANALOG_TXRF12_OFFSET 0x0000006c -#define PHY_ANALOG_TXRF12_SPARE12_2_MSB 7 -#define PHY_ANALOG_TXRF12_SPARE12_2_LSB 0 -#define PHY_ANALOG_TXRF12_SPARE12_2_MASK 0x000000ff -#define PHY_ANALOG_TXRF12_SPARE12_2_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_ANALOG_TXRF12_SPARE12_1_MSB 9 -#define PHY_ANALOG_TXRF12_SPARE12_1_LSB 8 -#define PHY_ANALOG_TXRF12_SPARE12_1_MASK 0x00000300 -#define PHY_ANALOG_TXRF12_SPARE12_1_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_ANALOG_TXRF12_SPARE12_1_SET(x) (((x) << 8) & 0x00000300) -#define PHY_ANALOG_TXRF12_ATBSEL5G_MSB 13 -#define PHY_ANALOG_TXRF12_ATBSEL5G_LSB 10 -#define PHY_ANALOG_TXRF12_ATBSEL5G_MASK 0x00003c00 -#define PHY_ANALOG_TXRF12_ATBSEL5G_GET(x) (((x) & 0x00003c00) >> 10) -#define PHY_ANALOG_TXRF12_ATBSEL5G_SET(x) (((x) << 10) & 0x00003c00) -#define PHY_ANALOG_TXRF12_ATBSEL2G_MSB 16 -#define PHY_ANALOG_TXRF12_ATBSEL2G_LSB 14 -#define PHY_ANALOG_TXRF12_ATBSEL2G_MASK 0x0001c000 -#define PHY_ANALOG_TXRF12_ATBSEL2G_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_TXRF12_ATBSEL2G_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_TXRF12_PWD_IRSPARE_MSB 19 -#define PHY_ANALOG_TXRF12_PWD_IRSPARE_LSB 17 -#define PHY_ANALOG_TXRF12_PWD_IRSPARE_MASK 0x000e0000 -#define PHY_ANALOG_TXRF12_PWD_IRSPARE_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_TXRF12_PWD_IRSPARE_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_TXRF12_PWD_IR25TEMPSEN_MSB 22 -#define PHY_ANALOG_TXRF12_PWD_IR25TEMPSEN_LSB 20 -#define PHY_ANALOG_TXRF12_PWD_IR25TEMPSEN_MASK 0x00700000 -#define PHY_ANALOG_TXRF12_PWD_IR25TEMPSEN_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_TXRF12_PWD_IR25TEMPSEN_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G2_MSB 25 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G2_LSB 23 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G2_MASK 0x03800000 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G2_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G2_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G1_MSB 28 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G1_LSB 26 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G1_MASK 0x1c000000 -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G1_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_TXRF12_PWD_IR25PA5G1_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_TXRF12_PWD_IR25MIXBIAS5G_MSB 31 -#define PHY_ANALOG_TXRF12_PWD_IR25MIXBIAS5G_LSB 29 -#define PHY_ANALOG_TXRF12_PWD_IR25MIXBIAS5G_MASK 0xe0000000 -#define PHY_ANALOG_TXRF12_PWD_IR25MIXBIAS5G_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_TXRF12_PWD_IR25MIXBIAS5G_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for SYNTH1 */ -#define PHY_ANALOG_SYNTH1_ADDRESS 0x00000080 -#define PHY_ANALOG_SYNTH1_OFFSET 0x00000080 -#define PHY_ANALOG_SYNTH1_SEL_VCMONABUS_MSB 2 -#define PHY_ANALOG_SYNTH1_SEL_VCMONABUS_LSB 0 -#define PHY_ANALOG_SYNTH1_SEL_VCMONABUS_MASK 0x00000007 -#define PHY_ANALOG_SYNTH1_SEL_VCMONABUS_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_SYNTH1_SEL_VCMONABUS_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_SYNTH1_SEL_VCOABUS_MSB 5 -#define PHY_ANALOG_SYNTH1_SEL_VCOABUS_LSB 3 -#define PHY_ANALOG_SYNTH1_SEL_VCOABUS_MASK 0x00000038 -#define PHY_ANALOG_SYNTH1_SEL_VCOABUS_GET(x) (((x) & 0x00000038) >> 3) -#define PHY_ANALOG_SYNTH1_SEL_VCOABUS_SET(x) (((x) << 3) & 0x00000038) -#define PHY_ANALOG_SYNTH1_MONITOR_SYNTHLOCKVCOK_MSB 6 -#define PHY_ANALOG_SYNTH1_MONITOR_SYNTHLOCKVCOK_LSB 6 -#define PHY_ANALOG_SYNTH1_MONITOR_SYNTHLOCKVCOK_MASK 0x00000040 -#define PHY_ANALOG_SYNTH1_MONITOR_SYNTHLOCKVCOK_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_SYNTH1_MONITOR_SYNTHLOCKVCOK_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_SYNTH1_MONITOR_VC2LOW_MSB 7 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2LOW_LSB 7 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2LOW_MASK 0x00000080 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2LOW_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_SYNTH1_MONITOR_VC2LOW_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_SYNTH1_MONITOR_VC2HIGH_MSB 8 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2HIGH_LSB 8 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2HIGH_MASK 0x00000100 -#define PHY_ANALOG_SYNTH1_MONITOR_VC2HIGH_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_SYNTH1_MONITOR_VC2HIGH_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_SYNTH1_MONITOR_FB_DIV2_MSB 9 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_DIV2_LSB 9 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_DIV2_MASK 0x00000200 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_DIV2_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_SYNTH1_MONITOR_FB_DIV2_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_SYNTH1_MONITOR_REF_MSB 10 -#define PHY_ANALOG_SYNTH1_MONITOR_REF_LSB 10 -#define PHY_ANALOG_SYNTH1_MONITOR_REF_MASK 0x00000400 -#define PHY_ANALOG_SYNTH1_MONITOR_REF_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_SYNTH1_MONITOR_REF_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_SYNTH1_MONITOR_FB_MSB 11 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_LSB 11 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_MASK 0x00000800 -#define PHY_ANALOG_SYNTH1_MONITOR_FB_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_SYNTH1_MONITOR_FB_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_SYNTH1_SEVENBITVCOCAP_MSB 12 -#define PHY_ANALOG_SYNTH1_SEVENBITVCOCAP_LSB 12 -#define PHY_ANALOG_SYNTH1_SEVENBITVCOCAP_MASK 0x00001000 -#define PHY_ANALOG_SYNTH1_SEVENBITVCOCAP_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_SYNTH1_SEVENBITVCOCAP_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_SYNTH1_PWUP_PD_MSB 15 -#define PHY_ANALOG_SYNTH1_PWUP_PD_LSB 13 -#define PHY_ANALOG_SYNTH1_PWUP_PD_MASK 0x0000e000 -#define PHY_ANALOG_SYNTH1_PWUP_PD_GET(x) (((x) & 0x0000e000) >> 13) -#define PHY_ANALOG_SYNTH1_PWUP_PD_SET(x) (((x) << 13) & 0x0000e000) -#define PHY_ANALOG_SYNTH1_PWD_VCOBUF_MSB 16 -#define PHY_ANALOG_SYNTH1_PWD_VCOBUF_LSB 16 -#define PHY_ANALOG_SYNTH1_PWD_VCOBUF_MASK 0x00010000 -#define PHY_ANALOG_SYNTH1_PWD_VCOBUF_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_SYNTH1_PWD_VCOBUF_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_SYNTH1_VCOBUFGAIN_MSB 18 -#define PHY_ANALOG_SYNTH1_VCOBUFGAIN_LSB 17 -#define PHY_ANALOG_SYNTH1_VCOBUFGAIN_MASK 0x00060000 -#define PHY_ANALOG_SYNTH1_VCOBUFGAIN_GET(x) (((x) & 0x00060000) >> 17) -#define PHY_ANALOG_SYNTH1_VCOBUFGAIN_SET(x) (((x) << 17) & 0x00060000) -#define PHY_ANALOG_SYNTH1_VCOREGLEVEL_MSB 20 -#define PHY_ANALOG_SYNTH1_VCOREGLEVEL_LSB 19 -#define PHY_ANALOG_SYNTH1_VCOREGLEVEL_MASK 0x00180000 -#define PHY_ANALOG_SYNTH1_VCOREGLEVEL_GET(x) (((x) & 0x00180000) >> 19) -#define PHY_ANALOG_SYNTH1_VCOREGLEVEL_SET(x) (((x) << 19) & 0x00180000) -#define PHY_ANALOG_SYNTH1_VCOREGBYPASS_MSB 21 -#define PHY_ANALOG_SYNTH1_VCOREGBYPASS_LSB 21 -#define PHY_ANALOG_SYNTH1_VCOREGBYPASS_MASK 0x00200000 -#define PHY_ANALOG_SYNTH1_VCOREGBYPASS_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_SYNTH1_VCOREGBYPASS_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_SYNTH1_PWUP_LOREF_MSB 22 -#define PHY_ANALOG_SYNTH1_PWUP_LOREF_LSB 22 -#define PHY_ANALOG_SYNTH1_PWUP_LOREF_MASK 0x00400000 -#define PHY_ANALOG_SYNTH1_PWUP_LOREF_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_SYNTH1_PWUP_LOREF_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_SYNTH1_PWD_LOMIX_MSB 23 -#define PHY_ANALOG_SYNTH1_PWD_LOMIX_LSB 23 -#define PHY_ANALOG_SYNTH1_PWD_LOMIX_MASK 0x00800000 -#define PHY_ANALOG_SYNTH1_PWD_LOMIX_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_SYNTH1_PWD_LOMIX_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_SYNTH1_PWD_LODIV_MSB 24 -#define PHY_ANALOG_SYNTH1_PWD_LODIV_LSB 24 -#define PHY_ANALOG_SYNTH1_PWD_LODIV_MASK 0x01000000 -#define PHY_ANALOG_SYNTH1_PWD_LODIV_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_ANALOG_SYNTH1_PWD_LODIV_SET(x) (((x) << 24) & 0x01000000) -#define PHY_ANALOG_SYNTH1_PWD_LOBUF5G_MSB 25 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF5G_LSB 25 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF5G_MASK 0x02000000 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF5G_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_ANALOG_SYNTH1_PWD_LOBUF5G_SET(x) (((x) << 25) & 0x02000000) -#define PHY_ANALOG_SYNTH1_PWD_LOBUF2G_MSB 26 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF2G_LSB 26 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF2G_MASK 0x04000000 -#define PHY_ANALOG_SYNTH1_PWD_LOBUF2G_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_SYNTH1_PWD_LOBUF2G_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_SYNTH1_PWD_PRESC_MSB 27 -#define PHY_ANALOG_SYNTH1_PWD_PRESC_LSB 27 -#define PHY_ANALOG_SYNTH1_PWD_PRESC_MASK 0x08000000 -#define PHY_ANALOG_SYNTH1_PWD_PRESC_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_SYNTH1_PWD_PRESC_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_SYNTH1_PWD_VCO_MSB 28 -#define PHY_ANALOG_SYNTH1_PWD_VCO_LSB 28 -#define PHY_ANALOG_SYNTH1_PWD_VCO_MASK 0x10000000 -#define PHY_ANALOG_SYNTH1_PWD_VCO_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_SYNTH1_PWD_VCO_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_SYNTH1_PWD_VCMON_MSB 29 -#define PHY_ANALOG_SYNTH1_PWD_VCMON_LSB 29 -#define PHY_ANALOG_SYNTH1_PWD_VCMON_MASK 0x20000000 -#define PHY_ANALOG_SYNTH1_PWD_VCMON_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_SYNTH1_PWD_VCMON_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_SYNTH1_PWD_CP_MSB 30 -#define PHY_ANALOG_SYNTH1_PWD_CP_LSB 30 -#define PHY_ANALOG_SYNTH1_PWD_CP_MASK 0x40000000 -#define PHY_ANALOG_SYNTH1_PWD_CP_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_SYNTH1_PWD_CP_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_SYNTH1_PWD_BIAS_MSB 31 -#define PHY_ANALOG_SYNTH1_PWD_BIAS_LSB 31 -#define PHY_ANALOG_SYNTH1_PWD_BIAS_MASK 0x80000000 -#define PHY_ANALOG_SYNTH1_PWD_BIAS_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_SYNTH1_PWD_BIAS_SET(x) (((x) << 31) & 0x80000000) - -/* macros for SYNTH2 */ -#define PHY_ANALOG_SYNTH2_ADDRESS 0x00000084 -#define PHY_ANALOG_SYNTH2_OFFSET 0x00000084 -#define PHY_ANALOG_SYNTH2_CAPRANGE3_MSB 3 -#define PHY_ANALOG_SYNTH2_CAPRANGE3_LSB 0 -#define PHY_ANALOG_SYNTH2_CAPRANGE3_MASK 0x0000000f -#define PHY_ANALOG_SYNTH2_CAPRANGE3_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_SYNTH2_CAPRANGE3_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_ANALOG_SYNTH2_CAPRANGE2_MSB 7 -#define PHY_ANALOG_SYNTH2_CAPRANGE2_LSB 4 -#define PHY_ANALOG_SYNTH2_CAPRANGE2_MASK 0x000000f0 -#define PHY_ANALOG_SYNTH2_CAPRANGE2_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_ANALOG_SYNTH2_CAPRANGE2_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_ANALOG_SYNTH2_CAPRANGE1_MSB 11 -#define PHY_ANALOG_SYNTH2_CAPRANGE1_LSB 8 -#define PHY_ANALOG_SYNTH2_CAPRANGE1_MASK 0x00000f00 -#define PHY_ANALOG_SYNTH2_CAPRANGE1_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_SYNTH2_CAPRANGE1_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_SYNTH2_LOOPLEAKCUR_INTN_MSB 15 -#define PHY_ANALOG_SYNTH2_LOOPLEAKCUR_INTN_LSB 12 -#define PHY_ANALOG_SYNTH2_LOOPLEAKCUR_INTN_MASK 0x0000f000 -#define PHY_ANALOG_SYNTH2_LOOPLEAKCUR_INTN_GET(x) (((x) & 0x0000f000) >> 12) -#define PHY_ANALOG_SYNTH2_LOOPLEAKCUR_INTN_SET(x) (((x) << 12) & 0x0000f000) -#define PHY_ANALOG_SYNTH2_CPLOWLK_INTN_MSB 16 -#define PHY_ANALOG_SYNTH2_CPLOWLK_INTN_LSB 16 -#define PHY_ANALOG_SYNTH2_CPLOWLK_INTN_MASK 0x00010000 -#define PHY_ANALOG_SYNTH2_CPLOWLK_INTN_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_SYNTH2_CPLOWLK_INTN_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_SYNTH2_CPSTEERING_EN_INTN_MSB 17 -#define PHY_ANALOG_SYNTH2_CPSTEERING_EN_INTN_LSB 17 -#define PHY_ANALOG_SYNTH2_CPSTEERING_EN_INTN_MASK 0x00020000 -#define PHY_ANALOG_SYNTH2_CPSTEERING_EN_INTN_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_SYNTH2_CPSTEERING_EN_INTN_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_SYNTH2_CPBIAS_INTN_MSB 19 -#define PHY_ANALOG_SYNTH2_CPBIAS_INTN_LSB 18 -#define PHY_ANALOG_SYNTH2_CPBIAS_INTN_MASK 0x000c0000 -#define PHY_ANALOG_SYNTH2_CPBIAS_INTN_GET(x) (((x) & 0x000c0000) >> 18) -#define PHY_ANALOG_SYNTH2_CPBIAS_INTN_SET(x) (((x) << 18) & 0x000c0000) -#define PHY_ANALOG_SYNTH2_VC_LOW_REF_MSB 22 -#define PHY_ANALOG_SYNTH2_VC_LOW_REF_LSB 20 -#define PHY_ANALOG_SYNTH2_VC_LOW_REF_MASK 0x00700000 -#define PHY_ANALOG_SYNTH2_VC_LOW_REF_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_SYNTH2_VC_LOW_REF_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_SYNTH2_VC_MID_REF_MSB 25 -#define PHY_ANALOG_SYNTH2_VC_MID_REF_LSB 23 -#define PHY_ANALOG_SYNTH2_VC_MID_REF_MASK 0x03800000 -#define PHY_ANALOG_SYNTH2_VC_MID_REF_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_SYNTH2_VC_MID_REF_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_SYNTH2_VC_HI_REF_MSB 28 -#define PHY_ANALOG_SYNTH2_VC_HI_REF_LSB 26 -#define PHY_ANALOG_SYNTH2_VC_HI_REF_MASK 0x1c000000 -#define PHY_ANALOG_SYNTH2_VC_HI_REF_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_SYNTH2_VC_HI_REF_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_SYNTH2_VC_CAL_REF_MSB 31 -#define PHY_ANALOG_SYNTH2_VC_CAL_REF_LSB 29 -#define PHY_ANALOG_SYNTH2_VC_CAL_REF_MASK 0xe0000000 -#define PHY_ANALOG_SYNTH2_VC_CAL_REF_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_SYNTH2_VC_CAL_REF_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for SYNTH3 */ -#define PHY_ANALOG_SYNTH3_ADDRESS 0x00000088 -#define PHY_ANALOG_SYNTH3_OFFSET 0x00000088 -#define PHY_ANALOG_SYNTH3_WAIT_VC_CHECK_MSB 5 -#define PHY_ANALOG_SYNTH3_WAIT_VC_CHECK_LSB 0 -#define PHY_ANALOG_SYNTH3_WAIT_VC_CHECK_MASK 0x0000003f -#define PHY_ANALOG_SYNTH3_WAIT_VC_CHECK_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_ANALOG_SYNTH3_WAIT_VC_CHECK_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_ANALOG_SYNTH3_WAIT_CAL_LIN_MSB 11 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_LIN_LSB 6 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_LIN_MASK 0x00000fc0 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_LIN_GET(x) (((x) & 0x00000fc0) >> 6) -#define PHY_ANALOG_SYNTH3_WAIT_CAL_LIN_SET(x) (((x) << 6) & 0x00000fc0) -#define PHY_ANALOG_SYNTH3_WAIT_CAL_BIN_MSB 17 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_BIN_LSB 12 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_BIN_MASK 0x0003f000 -#define PHY_ANALOG_SYNTH3_WAIT_CAL_BIN_GET(x) (((x) & 0x0003f000) >> 12) -#define PHY_ANALOG_SYNTH3_WAIT_CAL_BIN_SET(x) (((x) << 12) & 0x0003f000) -#define PHY_ANALOG_SYNTH3_WAIT_PWRUP_MSB 23 -#define PHY_ANALOG_SYNTH3_WAIT_PWRUP_LSB 18 -#define PHY_ANALOG_SYNTH3_WAIT_PWRUP_MASK 0x00fc0000 -#define PHY_ANALOG_SYNTH3_WAIT_PWRUP_GET(x) (((x) & 0x00fc0000) >> 18) -#define PHY_ANALOG_SYNTH3_WAIT_PWRUP_SET(x) (((x) << 18) & 0x00fc0000) -#define PHY_ANALOG_SYNTH3_WAIT_SHORTR_PWRUP_MSB 29 -#define PHY_ANALOG_SYNTH3_WAIT_SHORTR_PWRUP_LSB 24 -#define PHY_ANALOG_SYNTH3_WAIT_SHORTR_PWRUP_MASK 0x3f000000 -#define PHY_ANALOG_SYNTH3_WAIT_SHORTR_PWRUP_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_ANALOG_SYNTH3_WAIT_SHORTR_PWRUP_SET(x) (((x) << 24) & 0x3f000000) -#define PHY_ANALOG_SYNTH3_SEL_CLK_DIV2_MSB 30 -#define PHY_ANALOG_SYNTH3_SEL_CLK_DIV2_LSB 30 -#define PHY_ANALOG_SYNTH3_SEL_CLK_DIV2_MASK 0x40000000 -#define PHY_ANALOG_SYNTH3_SEL_CLK_DIV2_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_SYNTH3_SEL_CLK_DIV2_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_SYNTH3_DIS_CLK_XTAL_MSB 31 -#define PHY_ANALOG_SYNTH3_DIS_CLK_XTAL_LSB 31 -#define PHY_ANALOG_SYNTH3_DIS_CLK_XTAL_MASK 0x80000000 -#define PHY_ANALOG_SYNTH3_DIS_CLK_XTAL_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_SYNTH3_DIS_CLK_XTAL_SET(x) (((x) << 31) & 0x80000000) - -/* macros for SYNTH4 */ -#define PHY_ANALOG_SYNTH4_ADDRESS 0x0000008c -#define PHY_ANALOG_SYNTH4_OFFSET 0x0000008c -#define PHY_ANALOG_SYNTH4_PS_SINGLE_PULSE_MSB 0 -#define PHY_ANALOG_SYNTH4_PS_SINGLE_PULSE_LSB 0 -#define PHY_ANALOG_SYNTH4_PS_SINGLE_PULSE_MASK 0x00000001 -#define PHY_ANALOG_SYNTH4_PS_SINGLE_PULSE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_SYNTH4_PS_SINGLE_PULSE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_SYNTH4_LONGSHIFTSEL_MSB 1 -#define PHY_ANALOG_SYNTH4_LONGSHIFTSEL_LSB 1 -#define PHY_ANALOG_SYNTH4_LONGSHIFTSEL_MASK 0x00000002 -#define PHY_ANALOG_SYNTH4_LONGSHIFTSEL_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_SYNTH4_LONGSHIFTSEL_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_SYNTH4_LOBUF5GTUNE_OVR_MSB 3 -#define PHY_ANALOG_SYNTH4_LOBUF5GTUNE_OVR_LSB 2 -#define PHY_ANALOG_SYNTH4_LOBUF5GTUNE_OVR_MASK 0x0000000c -#define PHY_ANALOG_SYNTH4_LOBUF5GTUNE_OVR_GET(x) (((x) & 0x0000000c) >> 2) -#define PHY_ANALOG_SYNTH4_LOBUF5GTUNE_OVR_SET(x) (((x) << 2) & 0x0000000c) -#define PHY_ANALOG_SYNTH4_FORCE_LOBUF5GTUNE_MSB 4 -#define PHY_ANALOG_SYNTH4_FORCE_LOBUF5GTUNE_LSB 4 -#define PHY_ANALOG_SYNTH4_FORCE_LOBUF5GTUNE_MASK 0x00000010 -#define PHY_ANALOG_SYNTH4_FORCE_LOBUF5GTUNE_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_SYNTH4_FORCE_LOBUF5GTUNE_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_SYNTH4_PSCOUNT_FBSEL_MSB 5 -#define PHY_ANALOG_SYNTH4_PSCOUNT_FBSEL_LSB 5 -#define PHY_ANALOG_SYNTH4_PSCOUNT_FBSEL_MASK 0x00000020 -#define PHY_ANALOG_SYNTH4_PSCOUNT_FBSEL_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_SYNTH4_PSCOUNT_FBSEL_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_SYNTH4_SDM_DITHER1_MSB 7 -#define PHY_ANALOG_SYNTH4_SDM_DITHER1_LSB 6 -#define PHY_ANALOG_SYNTH4_SDM_DITHER1_MASK 0x000000c0 -#define PHY_ANALOG_SYNTH4_SDM_DITHER1_GET(x) (((x) & 0x000000c0) >> 6) -#define PHY_ANALOG_SYNTH4_SDM_DITHER1_SET(x) (((x) << 6) & 0x000000c0) -#define PHY_ANALOG_SYNTH4_SDM_MODE_MSB 8 -#define PHY_ANALOG_SYNTH4_SDM_MODE_LSB 8 -#define PHY_ANALOG_SYNTH4_SDM_MODE_MASK 0x00000100 -#define PHY_ANALOG_SYNTH4_SDM_MODE_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_SYNTH4_SDM_MODE_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_SYNTH4_SDM_DISABLE_MSB 9 -#define PHY_ANALOG_SYNTH4_SDM_DISABLE_LSB 9 -#define PHY_ANALOG_SYNTH4_SDM_DISABLE_MASK 0x00000200 -#define PHY_ANALOG_SYNTH4_SDM_DISABLE_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_SYNTH4_SDM_DISABLE_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_SYNTH4_RESET_PRESC_MSB 10 -#define PHY_ANALOG_SYNTH4_RESET_PRESC_LSB 10 -#define PHY_ANALOG_SYNTH4_RESET_PRESC_MASK 0x00000400 -#define PHY_ANALOG_SYNTH4_RESET_PRESC_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_SYNTH4_RESET_PRESC_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_SYNTH4_PRESCSEL_MSB 12 -#define PHY_ANALOG_SYNTH4_PRESCSEL_LSB 11 -#define PHY_ANALOG_SYNTH4_PRESCSEL_MASK 0x00001800 -#define PHY_ANALOG_SYNTH4_PRESCSEL_GET(x) (((x) & 0x00001800) >> 11) -#define PHY_ANALOG_SYNTH4_PRESCSEL_SET(x) (((x) << 11) & 0x00001800) -#define PHY_ANALOG_SYNTH4_PFD_DISABLE_MSB 13 -#define PHY_ANALOG_SYNTH4_PFD_DISABLE_LSB 13 -#define PHY_ANALOG_SYNTH4_PFD_DISABLE_MASK 0x00002000 -#define PHY_ANALOG_SYNTH4_PFD_DISABLE_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_SYNTH4_PFD_DISABLE_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_SYNTH4_PFDDELAY_FRACN_MSB 14 -#define PHY_ANALOG_SYNTH4_PFDDELAY_FRACN_LSB 14 -#define PHY_ANALOG_SYNTH4_PFDDELAY_FRACN_MASK 0x00004000 -#define PHY_ANALOG_SYNTH4_PFDDELAY_FRACN_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_SYNTH4_PFDDELAY_FRACN_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_SYNTH4_FORCE_LO_ON_MSB 15 -#define PHY_ANALOG_SYNTH4_FORCE_LO_ON_LSB 15 -#define PHY_ANALOG_SYNTH4_FORCE_LO_ON_MASK 0x00008000 -#define PHY_ANALOG_SYNTH4_FORCE_LO_ON_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_SYNTH4_FORCE_LO_ON_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_SYNTH4_CLKXTAL_EDGE_SEL_MSB 16 -#define PHY_ANALOG_SYNTH4_CLKXTAL_EDGE_SEL_LSB 16 -#define PHY_ANALOG_SYNTH4_CLKXTAL_EDGE_SEL_MASK 0x00010000 -#define PHY_ANALOG_SYNTH4_CLKXTAL_EDGE_SEL_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_SYNTH4_CLKXTAL_EDGE_SEL_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_SYNTH4_VCOCAPPULLUP_MSB 17 -#define PHY_ANALOG_SYNTH4_VCOCAPPULLUP_LSB 17 -#define PHY_ANALOG_SYNTH4_VCOCAPPULLUP_MASK 0x00020000 -#define PHY_ANALOG_SYNTH4_VCOCAPPULLUP_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_SYNTH4_VCOCAPPULLUP_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_SYNTH4_VCOCAP_OVR_MSB 25 -#define PHY_ANALOG_SYNTH4_VCOCAP_OVR_LSB 18 -#define PHY_ANALOG_SYNTH4_VCOCAP_OVR_MASK 0x03fc0000 -#define PHY_ANALOG_SYNTH4_VCOCAP_OVR_GET(x) (((x) & 0x03fc0000) >> 18) -#define PHY_ANALOG_SYNTH4_VCOCAP_OVR_SET(x) (((x) << 18) & 0x03fc0000) -#define PHY_ANALOG_SYNTH4_FORCE_VCOCAP_MSB 26 -#define PHY_ANALOG_SYNTH4_FORCE_VCOCAP_LSB 26 -#define PHY_ANALOG_SYNTH4_FORCE_VCOCAP_MASK 0x04000000 -#define PHY_ANALOG_SYNTH4_FORCE_VCOCAP_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_SYNTH4_FORCE_VCOCAP_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_SYNTH4_FORCE_PINVC_MSB 27 -#define PHY_ANALOG_SYNTH4_FORCE_PINVC_LSB 27 -#define PHY_ANALOG_SYNTH4_FORCE_PINVC_MASK 0x08000000 -#define PHY_ANALOG_SYNTH4_FORCE_PINVC_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_SYNTH4_FORCE_PINVC_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_SYNTH4_SHORTR_UNTIL_LOCKED_MSB 28 -#define PHY_ANALOG_SYNTH4_SHORTR_UNTIL_LOCKED_LSB 28 -#define PHY_ANALOG_SYNTH4_SHORTR_UNTIL_LOCKED_MASK 0x10000000 -#define PHY_ANALOG_SYNTH4_SHORTR_UNTIL_LOCKED_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_SYNTH4_SHORTR_UNTIL_LOCKED_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_SYNTH4_ALWAYS_SHORTR_MSB 29 -#define PHY_ANALOG_SYNTH4_ALWAYS_SHORTR_LSB 29 -#define PHY_ANALOG_SYNTH4_ALWAYS_SHORTR_MASK 0x20000000 -#define PHY_ANALOG_SYNTH4_ALWAYS_SHORTR_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_SYNTH4_ALWAYS_SHORTR_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_SYNTH4_DIS_LOSTVC_MSB 30 -#define PHY_ANALOG_SYNTH4_DIS_LOSTVC_LSB 30 -#define PHY_ANALOG_SYNTH4_DIS_LOSTVC_MASK 0x40000000 -#define PHY_ANALOG_SYNTH4_DIS_LOSTVC_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_SYNTH4_DIS_LOSTVC_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_SYNTH4_DIS_LIN_CAPSEARCH_MSB 31 -#define PHY_ANALOG_SYNTH4_DIS_LIN_CAPSEARCH_LSB 31 -#define PHY_ANALOG_SYNTH4_DIS_LIN_CAPSEARCH_MASK 0x80000000 -#define PHY_ANALOG_SYNTH4_DIS_LIN_CAPSEARCH_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_SYNTH4_DIS_LIN_CAPSEARCH_SET(x) (((x) << 31) & 0x80000000) - -/* macros for SYNTH5 */ -#define PHY_ANALOG_SYNTH5_ADDRESS 0x00000090 -#define PHY_ANALOG_SYNTH5_OFFSET 0x00000090 -#define PHY_ANALOG_SYNTH5_VCOBIAS_MSB 1 -#define PHY_ANALOG_SYNTH5_VCOBIAS_LSB 0 -#define PHY_ANALOG_SYNTH5_VCOBIAS_MASK 0x00000003 -#define PHY_ANALOG_SYNTH5_VCOBIAS_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_SYNTH5_VCOBIAS_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF5G50_MSB 4 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF5G50_LSB 2 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF5G50_MASK 0x0000001c -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF5G50_GET(x) (((x) & 0x0000001c) >> 2) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF5G50_SET(x) (((x) << 2) & 0x0000001c) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF2G50_MSB 7 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF2G50_LSB 5 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF2G50_MASK 0x000000e0 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF2G50_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOBUF2G50_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_SYNTH5_PWDB_ICVCO25_MSB 10 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCO25_LSB 8 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCO25_MASK 0x00000700 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCO25_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_SYNTH5_PWDB_ICVCO25_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_SYNTH5_PWDB_ICVCOREG25_MSB 13 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCOREG25_LSB 11 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCOREG25_MASK 0x00003800 -#define PHY_ANALOG_SYNTH5_PWDB_ICVCOREG25_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_SYNTH5_PWDB_ICVCOREG25_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_SYNTH5_PWDB_IRVCOREG50_MSB 14 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCOREG50_LSB 14 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCOREG50_MASK 0x00004000 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCOREG50_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_SYNTH5_PWDB_IRVCOREG50_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOMIX_MSB 17 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOMIX_LSB 15 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOMIX_MASK 0x00038000 -#define PHY_ANALOG_SYNTH5_PWDB_ICLOMIX_GET(x) (((x) & 0x00038000) >> 15) -#define PHY_ANALOG_SYNTH5_PWDB_ICLOMIX_SET(x) (((x) << 15) & 0x00038000) -#define PHY_ANALOG_SYNTH5_PWDB_ICLODIV50_MSB 20 -#define PHY_ANALOG_SYNTH5_PWDB_ICLODIV50_LSB 18 -#define PHY_ANALOG_SYNTH5_PWDB_ICLODIV50_MASK 0x001c0000 -#define PHY_ANALOG_SYNTH5_PWDB_ICLODIV50_GET(x) (((x) & 0x001c0000) >> 18) -#define PHY_ANALOG_SYNTH5_PWDB_ICLODIV50_SET(x) (((x) << 18) & 0x001c0000) -#define PHY_ANALOG_SYNTH5_PWDB_ICPRESC50_MSB 23 -#define PHY_ANALOG_SYNTH5_PWDB_ICPRESC50_LSB 21 -#define PHY_ANALOG_SYNTH5_PWDB_ICPRESC50_MASK 0x00e00000 -#define PHY_ANALOG_SYNTH5_PWDB_ICPRESC50_GET(x) (((x) & 0x00e00000) >> 21) -#define PHY_ANALOG_SYNTH5_PWDB_ICPRESC50_SET(x) (((x) << 21) & 0x00e00000) -#define PHY_ANALOG_SYNTH5_PWDB_IRVCMON25_MSB 26 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCMON25_LSB 24 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCMON25_MASK 0x07000000 -#define PHY_ANALOG_SYNTH5_PWDB_IRVCMON25_GET(x) (((x) & 0x07000000) >> 24) -#define PHY_ANALOG_SYNTH5_PWDB_IRVCMON25_SET(x) (((x) << 24) & 0x07000000) -#define PHY_ANALOG_SYNTH5_PWDB_IRPFDCP_MSB 29 -#define PHY_ANALOG_SYNTH5_PWDB_IRPFDCP_LSB 27 -#define PHY_ANALOG_SYNTH5_PWDB_IRPFDCP_MASK 0x38000000 -#define PHY_ANALOG_SYNTH5_PWDB_IRPFDCP_GET(x) (((x) & 0x38000000) >> 27) -#define PHY_ANALOG_SYNTH5_PWDB_IRPFDCP_SET(x) (((x) << 27) & 0x38000000) -#define PHY_ANALOG_SYNTH5_SDM_DITHER2_MSB 31 -#define PHY_ANALOG_SYNTH5_SDM_DITHER2_LSB 30 -#define PHY_ANALOG_SYNTH5_SDM_DITHER2_MASK 0xc0000000 -#define PHY_ANALOG_SYNTH5_SDM_DITHER2_GET(x) (((x) & 0xc0000000) >> 30) -#define PHY_ANALOG_SYNTH5_SDM_DITHER2_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for SYNTH6 */ -#define PHY_ANALOG_SYNTH6_ADDRESS 0x00000094 -#define PHY_ANALOG_SYNTH6_OFFSET 0x00000094 -#define PHY_ANALOG_SYNTH6_LOBUF5GTUNE_MSB 1 -#define PHY_ANALOG_SYNTH6_LOBUF5GTUNE_LSB 0 -#define PHY_ANALOG_SYNTH6_LOBUF5GTUNE_MASK 0x00000003 -#define PHY_ANALOG_SYNTH6_LOBUF5GTUNE_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_SYNTH6_LOOP_IP_MSB 8 -#define PHY_ANALOG_SYNTH6_LOOP_IP_LSB 2 -#define PHY_ANALOG_SYNTH6_LOOP_IP_MASK 0x000001fc -#define PHY_ANALOG_SYNTH6_LOOP_IP_GET(x) (((x) & 0x000001fc) >> 2) -#define PHY_ANALOG_SYNTH6_VC2LOW_MSB 9 -#define PHY_ANALOG_SYNTH6_VC2LOW_LSB 9 -#define PHY_ANALOG_SYNTH6_VC2LOW_MASK 0x00000200 -#define PHY_ANALOG_SYNTH6_VC2LOW_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_SYNTH6_VC2HIGH_MSB 10 -#define PHY_ANALOG_SYNTH6_VC2HIGH_LSB 10 -#define PHY_ANALOG_SYNTH6_VC2HIGH_MASK 0x00000400 -#define PHY_ANALOG_SYNTH6_VC2HIGH_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_SYNTH6_RESET_SDM_B_MSB 11 -#define PHY_ANALOG_SYNTH6_RESET_SDM_B_LSB 11 -#define PHY_ANALOG_SYNTH6_RESET_SDM_B_MASK 0x00000800 -#define PHY_ANALOG_SYNTH6_RESET_SDM_B_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_SYNTH6_RESET_PSCOUNTERS_MSB 12 -#define PHY_ANALOG_SYNTH6_RESET_PSCOUNTERS_LSB 12 -#define PHY_ANALOG_SYNTH6_RESET_PSCOUNTERS_MASK 0x00001000 -#define PHY_ANALOG_SYNTH6_RESET_PSCOUNTERS_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_SYNTH6_RESET_PFD_MSB 13 -#define PHY_ANALOG_SYNTH6_RESET_PFD_LSB 13 -#define PHY_ANALOG_SYNTH6_RESET_PFD_MASK 0x00002000 -#define PHY_ANALOG_SYNTH6_RESET_PFD_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_SYNTH6_RESET_RFD_MSB 14 -#define PHY_ANALOG_SYNTH6_RESET_RFD_LSB 14 -#define PHY_ANALOG_SYNTH6_RESET_RFD_MASK 0x00004000 -#define PHY_ANALOG_SYNTH6_RESET_RFD_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_SYNTH6_SHORT_R_MSB 15 -#define PHY_ANALOG_SYNTH6_SHORT_R_LSB 15 -#define PHY_ANALOG_SYNTH6_SHORT_R_MASK 0x00008000 -#define PHY_ANALOG_SYNTH6_SHORT_R_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_SYNTH6_VCO_CAP_ST_MSB 23 -#define PHY_ANALOG_SYNTH6_VCO_CAP_ST_LSB 16 -#define PHY_ANALOG_SYNTH6_VCO_CAP_ST_MASK 0x00ff0000 -#define PHY_ANALOG_SYNTH6_VCO_CAP_ST_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_ANALOG_SYNTH6_PIN_VC_MSB 24 -#define PHY_ANALOG_SYNTH6_PIN_VC_LSB 24 -#define PHY_ANALOG_SYNTH6_PIN_VC_MASK 0x01000000 -#define PHY_ANALOG_SYNTH6_PIN_VC_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_ANALOG_SYNTH6_SYNTH_LOCK_VC_OK_MSB 25 -#define PHY_ANALOG_SYNTH6_SYNTH_LOCK_VC_OK_LSB 25 -#define PHY_ANALOG_SYNTH6_SYNTH_LOCK_VC_OK_MASK 0x02000000 -#define PHY_ANALOG_SYNTH6_SYNTH_LOCK_VC_OK_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_ANALOG_SYNTH6_CAP_SEARCH_MSB 26 -#define PHY_ANALOG_SYNTH6_CAP_SEARCH_LSB 26 -#define PHY_ANALOG_SYNTH6_CAP_SEARCH_MASK 0x04000000 -#define PHY_ANALOG_SYNTH6_CAP_SEARCH_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_SYNTH6_SYNTH_SM_STATE_MSB 30 -#define PHY_ANALOG_SYNTH6_SYNTH_SM_STATE_LSB 27 -#define PHY_ANALOG_SYNTH6_SYNTH_SM_STATE_MASK 0x78000000 -#define PHY_ANALOG_SYNTH6_SYNTH_SM_STATE_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_ANALOG_SYNTH6_SYNTH_ON_MSB 31 -#define PHY_ANALOG_SYNTH6_SYNTH_ON_LSB 31 -#define PHY_ANALOG_SYNTH6_SYNTH_ON_MASK 0x80000000 -#define PHY_ANALOG_SYNTH6_SYNTH_ON_GET(x) (((x) & 0x80000000) >> 31) - -/* macros for SYNTH7 */ -#define PHY_ANALOG_SYNTH7_ADDRESS 0x00000098 -#define PHY_ANALOG_SYNTH7_OFFSET 0x00000098 -#define PHY_ANALOG_SYNTH7_OVRCHANDECODER_MSB 0 -#define PHY_ANALOG_SYNTH7_OVRCHANDECODER_LSB 0 -#define PHY_ANALOG_SYNTH7_OVRCHANDECODER_MASK 0x00000001 -#define PHY_ANALOG_SYNTH7_OVRCHANDECODER_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_SYNTH7_OVRCHANDECODER_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_SYNTH7_FORCE_FRACLSB_MSB 1 -#define PHY_ANALOG_SYNTH7_FORCE_FRACLSB_LSB 1 -#define PHY_ANALOG_SYNTH7_FORCE_FRACLSB_MASK 0x00000002 -#define PHY_ANALOG_SYNTH7_FORCE_FRACLSB_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_SYNTH7_FORCE_FRACLSB_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_SYNTH7_CHANFRAC_MSB 18 -#define PHY_ANALOG_SYNTH7_CHANFRAC_LSB 2 -#define PHY_ANALOG_SYNTH7_CHANFRAC_MASK 0x0007fffc -#define PHY_ANALOG_SYNTH7_CHANFRAC_GET(x) (((x) & 0x0007fffc) >> 2) -#define PHY_ANALOG_SYNTH7_CHANFRAC_SET(x) (((x) << 2) & 0x0007fffc) -#define PHY_ANALOG_SYNTH7_CHANSEL_MSB 27 -#define PHY_ANALOG_SYNTH7_CHANSEL_LSB 19 -#define PHY_ANALOG_SYNTH7_CHANSEL_MASK 0x0ff80000 -#define PHY_ANALOG_SYNTH7_CHANSEL_GET(x) (((x) & 0x0ff80000) >> 19) -#define PHY_ANALOG_SYNTH7_CHANSEL_SET(x) (((x) << 19) & 0x0ff80000) -#define PHY_ANALOG_SYNTH7_AMODEREFSEL_MSB 29 -#define PHY_ANALOG_SYNTH7_AMODEREFSEL_LSB 28 -#define PHY_ANALOG_SYNTH7_AMODEREFSEL_MASK 0x30000000 -#define PHY_ANALOG_SYNTH7_AMODEREFSEL_GET(x) (((x) & 0x30000000) >> 28) -#define PHY_ANALOG_SYNTH7_AMODEREFSEL_SET(x) (((x) << 28) & 0x30000000) -#define PHY_ANALOG_SYNTH7_FRACMODE_MSB 30 -#define PHY_ANALOG_SYNTH7_FRACMODE_LSB 30 -#define PHY_ANALOG_SYNTH7_FRACMODE_MASK 0x40000000 -#define PHY_ANALOG_SYNTH7_FRACMODE_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_SYNTH7_FRACMODE_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_SYNTH7_LOADSYNTHCHANNEL_MSB 31 -#define PHY_ANALOG_SYNTH7_LOADSYNTHCHANNEL_LSB 31 -#define PHY_ANALOG_SYNTH7_LOADSYNTHCHANNEL_MASK 0x80000000 -#define PHY_ANALOG_SYNTH7_LOADSYNTHCHANNEL_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_SYNTH7_LOADSYNTHCHANNEL_SET(x) (((x) << 31) & 0x80000000) - -/* macros for SYNTH8 */ -#define PHY_ANALOG_SYNTH8_ADDRESS 0x0000009c -#define PHY_ANALOG_SYNTH8_OFFSET 0x0000009c -#define PHY_ANALOG_SYNTH8_CPSTEERING_EN_FRACN_MSB 0 -#define PHY_ANALOG_SYNTH8_CPSTEERING_EN_FRACN_LSB 0 -#define PHY_ANALOG_SYNTH8_CPSTEERING_EN_FRACN_MASK 0x00000001 -#define PHY_ANALOG_SYNTH8_CPSTEERING_EN_FRACN_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_SYNTH8_CPSTEERING_EN_FRACN_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_SYNTH8_LOOP_ICPB_MSB 7 -#define PHY_ANALOG_SYNTH8_LOOP_ICPB_LSB 1 -#define PHY_ANALOG_SYNTH8_LOOP_ICPB_MASK 0x000000fe -#define PHY_ANALOG_SYNTH8_LOOP_ICPB_GET(x) (((x) & 0x000000fe) >> 1) -#define PHY_ANALOG_SYNTH8_LOOP_ICPB_SET(x) (((x) << 1) & 0x000000fe) -#define PHY_ANALOG_SYNTH8_LOOP_CSB_MSB 11 -#define PHY_ANALOG_SYNTH8_LOOP_CSB_LSB 8 -#define PHY_ANALOG_SYNTH8_LOOP_CSB_MASK 0x00000f00 -#define PHY_ANALOG_SYNTH8_LOOP_CSB_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_SYNTH8_LOOP_CSB_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_SYNTH8_LOOP_RSB_MSB 16 -#define PHY_ANALOG_SYNTH8_LOOP_RSB_LSB 12 -#define PHY_ANALOG_SYNTH8_LOOP_RSB_MASK 0x0001f000 -#define PHY_ANALOG_SYNTH8_LOOP_RSB_GET(x) (((x) & 0x0001f000) >> 12) -#define PHY_ANALOG_SYNTH8_LOOP_RSB_SET(x) (((x) << 12) & 0x0001f000) -#define PHY_ANALOG_SYNTH8_LOOP_CPB_MSB 21 -#define PHY_ANALOG_SYNTH8_LOOP_CPB_LSB 17 -#define PHY_ANALOG_SYNTH8_LOOP_CPB_MASK 0x003e0000 -#define PHY_ANALOG_SYNTH8_LOOP_CPB_GET(x) (((x) & 0x003e0000) >> 17) -#define PHY_ANALOG_SYNTH8_LOOP_CPB_SET(x) (((x) << 17) & 0x003e0000) -#define PHY_ANALOG_SYNTH8_LOOP_3RD_ORDER_RB_MSB 26 -#define PHY_ANALOG_SYNTH8_LOOP_3RD_ORDER_RB_LSB 22 -#define PHY_ANALOG_SYNTH8_LOOP_3RD_ORDER_RB_MASK 0x07c00000 -#define PHY_ANALOG_SYNTH8_LOOP_3RD_ORDER_RB_GET(x) (((x) & 0x07c00000) >> 22) -#define PHY_ANALOG_SYNTH8_LOOP_3RD_ORDER_RB_SET(x) (((x) << 22) & 0x07c00000) -#define PHY_ANALOG_SYNTH8_REFDIVB_MSB 31 -#define PHY_ANALOG_SYNTH8_REFDIVB_LSB 27 -#define PHY_ANALOG_SYNTH8_REFDIVB_MASK 0xf8000000 -#define PHY_ANALOG_SYNTH8_REFDIVB_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_SYNTH8_REFDIVB_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for SYNTH9 */ -#define PHY_ANALOG_SYNTH9_ADDRESS 0x000000a0 -#define PHY_ANALOG_SYNTH9_OFFSET 0x000000a0 -#define PHY_ANALOG_SYNTH9_PFDDELAY_INTN_MSB 0 -#define PHY_ANALOG_SYNTH9_PFDDELAY_INTN_LSB 0 -#define PHY_ANALOG_SYNTH9_PFDDELAY_INTN_MASK 0x00000001 -#define PHY_ANALOG_SYNTH9_PFDDELAY_INTN_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_SYNTH9_PFDDELAY_INTN_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_SYNTH9_SLOPE_ICPA0_MSB 3 -#define PHY_ANALOG_SYNTH9_SLOPE_ICPA0_LSB 1 -#define PHY_ANALOG_SYNTH9_SLOPE_ICPA0_MASK 0x0000000e -#define PHY_ANALOG_SYNTH9_SLOPE_ICPA0_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_ANALOG_SYNTH9_SLOPE_ICPA0_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_ANALOG_SYNTH9_LOOP_ICPA0_MSB 7 -#define PHY_ANALOG_SYNTH9_LOOP_ICPA0_LSB 4 -#define PHY_ANALOG_SYNTH9_LOOP_ICPA0_MASK 0x000000f0 -#define PHY_ANALOG_SYNTH9_LOOP_ICPA0_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_ANALOG_SYNTH9_LOOP_ICPA0_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_ANALOG_SYNTH9_LOOP_CSA0_MSB 11 -#define PHY_ANALOG_SYNTH9_LOOP_CSA0_LSB 8 -#define PHY_ANALOG_SYNTH9_LOOP_CSA0_MASK 0x00000f00 -#define PHY_ANALOG_SYNTH9_LOOP_CSA0_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_SYNTH9_LOOP_CSA0_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_SYNTH9_LOOP_RSA0_MSB 16 -#define PHY_ANALOG_SYNTH9_LOOP_RSA0_LSB 12 -#define PHY_ANALOG_SYNTH9_LOOP_RSA0_MASK 0x0001f000 -#define PHY_ANALOG_SYNTH9_LOOP_RSA0_GET(x) (((x) & 0x0001f000) >> 12) -#define PHY_ANALOG_SYNTH9_LOOP_RSA0_SET(x) (((x) << 12) & 0x0001f000) -#define PHY_ANALOG_SYNTH9_LOOP_CPA0_MSB 21 -#define PHY_ANALOG_SYNTH9_LOOP_CPA0_LSB 17 -#define PHY_ANALOG_SYNTH9_LOOP_CPA0_MASK 0x003e0000 -#define PHY_ANALOG_SYNTH9_LOOP_CPA0_GET(x) (((x) & 0x003e0000) >> 17) -#define PHY_ANALOG_SYNTH9_LOOP_CPA0_SET(x) (((x) << 17) & 0x003e0000) -#define PHY_ANALOG_SYNTH9_LOOP_3RD_ORDER_RA_MSB 26 -#define PHY_ANALOG_SYNTH9_LOOP_3RD_ORDER_RA_LSB 22 -#define PHY_ANALOG_SYNTH9_LOOP_3RD_ORDER_RA_MASK 0x07c00000 -#define PHY_ANALOG_SYNTH9_LOOP_3RD_ORDER_RA_GET(x) (((x) & 0x07c00000) >> 22) -#define PHY_ANALOG_SYNTH9_LOOP_3RD_ORDER_RA_SET(x) (((x) << 22) & 0x07c00000) -#define PHY_ANALOG_SYNTH9_REFDIVA_MSB 31 -#define PHY_ANALOG_SYNTH9_REFDIVA_LSB 27 -#define PHY_ANALOG_SYNTH9_REFDIVA_MASK 0xf8000000 -#define PHY_ANALOG_SYNTH9_REFDIVA_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_SYNTH9_REFDIVA_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for SYNTH10 */ -#define PHY_ANALOG_SYNTH10_ADDRESS 0x000000a4 -#define PHY_ANALOG_SYNTH10_OFFSET 0x000000a4 -#define PHY_ANALOG_SYNTH10_SPARE10A_MSB 1 -#define PHY_ANALOG_SYNTH10_SPARE10A_LSB 0 -#define PHY_ANALOG_SYNTH10_SPARE10A_MASK 0x00000003 -#define PHY_ANALOG_SYNTH10_SPARE10A_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_SYNTH10_SPARE10A_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_SYNTH10_PWDB_ICLOBIAS50_MSB 4 -#define PHY_ANALOG_SYNTH10_PWDB_ICLOBIAS50_LSB 2 -#define PHY_ANALOG_SYNTH10_PWDB_ICLOBIAS50_MASK 0x0000001c -#define PHY_ANALOG_SYNTH10_PWDB_ICLOBIAS50_GET(x) (((x) & 0x0000001c) >> 2) -#define PHY_ANALOG_SYNTH10_PWDB_ICLOBIAS50_SET(x) (((x) << 2) & 0x0000001c) -#define PHY_ANALOG_SYNTH10_PWDB_IRSPARE25_MSB 7 -#define PHY_ANALOG_SYNTH10_PWDB_IRSPARE25_LSB 5 -#define PHY_ANALOG_SYNTH10_PWDB_IRSPARE25_MASK 0x000000e0 -#define PHY_ANALOG_SYNTH10_PWDB_IRSPARE25_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_SYNTH10_PWDB_IRSPARE25_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_SYNTH10_PWDB_ICSPARE25_MSB 10 -#define PHY_ANALOG_SYNTH10_PWDB_ICSPARE25_LSB 8 -#define PHY_ANALOG_SYNTH10_PWDB_ICSPARE25_MASK 0x00000700 -#define PHY_ANALOG_SYNTH10_PWDB_ICSPARE25_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_SYNTH10_PWDB_ICSPARE25_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_SYNTH10_SLOPE_ICPA1_MSB 13 -#define PHY_ANALOG_SYNTH10_SLOPE_ICPA1_LSB 11 -#define PHY_ANALOG_SYNTH10_SLOPE_ICPA1_MASK 0x00003800 -#define PHY_ANALOG_SYNTH10_SLOPE_ICPA1_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_SYNTH10_SLOPE_ICPA1_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_SYNTH10_LOOP_ICPA1_MSB 17 -#define PHY_ANALOG_SYNTH10_LOOP_ICPA1_LSB 14 -#define PHY_ANALOG_SYNTH10_LOOP_ICPA1_MASK 0x0003c000 -#define PHY_ANALOG_SYNTH10_LOOP_ICPA1_GET(x) (((x) & 0x0003c000) >> 14) -#define PHY_ANALOG_SYNTH10_LOOP_ICPA1_SET(x) (((x) << 14) & 0x0003c000) -#define PHY_ANALOG_SYNTH10_LOOP_CSA1_MSB 21 -#define PHY_ANALOG_SYNTH10_LOOP_CSA1_LSB 18 -#define PHY_ANALOG_SYNTH10_LOOP_CSA1_MASK 0x003c0000 -#define PHY_ANALOG_SYNTH10_LOOP_CSA1_GET(x) (((x) & 0x003c0000) >> 18) -#define PHY_ANALOG_SYNTH10_LOOP_CSA1_SET(x) (((x) << 18) & 0x003c0000) -#define PHY_ANALOG_SYNTH10_LOOP_RSA1_MSB 26 -#define PHY_ANALOG_SYNTH10_LOOP_RSA1_LSB 22 -#define PHY_ANALOG_SYNTH10_LOOP_RSA1_MASK 0x07c00000 -#define PHY_ANALOG_SYNTH10_LOOP_RSA1_GET(x) (((x) & 0x07c00000) >> 22) -#define PHY_ANALOG_SYNTH10_LOOP_RSA1_SET(x) (((x) << 22) & 0x07c00000) -#define PHY_ANALOG_SYNTH10_LOOP_CPA1_MSB 31 -#define PHY_ANALOG_SYNTH10_LOOP_CPA1_LSB 27 -#define PHY_ANALOG_SYNTH10_LOOP_CPA1_MASK 0xf8000000 -#define PHY_ANALOG_SYNTH10_LOOP_CPA1_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_SYNTH10_LOOP_CPA1_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for SYNTH11 */ -#define PHY_ANALOG_SYNTH11_ADDRESS 0x000000a8 -#define PHY_ANALOG_SYNTH11_OFFSET 0x000000a8 -#define PHY_ANALOG_SYNTH11_SPARE11A_MSB 4 -#define PHY_ANALOG_SYNTH11_SPARE11A_LSB 0 -#define PHY_ANALOG_SYNTH11_SPARE11A_MASK 0x0000001f -#define PHY_ANALOG_SYNTH11_SPARE11A_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_ANALOG_SYNTH11_SPARE11A_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_ANALOG_SYNTH11_FORCE_LOBUF5G_ON_MSB 5 -#define PHY_ANALOG_SYNTH11_FORCE_LOBUF5G_ON_LSB 5 -#define PHY_ANALOG_SYNTH11_FORCE_LOBUF5G_ON_MASK 0x00000020 -#define PHY_ANALOG_SYNTH11_FORCE_LOBUF5G_ON_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_SYNTH11_FORCE_LOBUF5G_ON_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_SYNTH11_LOREFSEL_MSB 7 -#define PHY_ANALOG_SYNTH11_LOREFSEL_LSB 6 -#define PHY_ANALOG_SYNTH11_LOREFSEL_MASK 0x000000c0 -#define PHY_ANALOG_SYNTH11_LOREFSEL_GET(x) (((x) & 0x000000c0) >> 6) -#define PHY_ANALOG_SYNTH11_LOREFSEL_SET(x) (((x) << 6) & 0x000000c0) -#define PHY_ANALOG_SYNTH11_LOBUF2GTUNE_MSB 9 -#define PHY_ANALOG_SYNTH11_LOBUF2GTUNE_LSB 8 -#define PHY_ANALOG_SYNTH11_LOBUF2GTUNE_MASK 0x00000300 -#define PHY_ANALOG_SYNTH11_LOBUF2GTUNE_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_ANALOG_SYNTH11_LOBUF2GTUNE_SET(x) (((x) << 8) & 0x00000300) -#define PHY_ANALOG_SYNTH11_CPSTEERING_MODE_MSB 10 -#define PHY_ANALOG_SYNTH11_CPSTEERING_MODE_LSB 10 -#define PHY_ANALOG_SYNTH11_CPSTEERING_MODE_MASK 0x00000400 -#define PHY_ANALOG_SYNTH11_CPSTEERING_MODE_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_SYNTH11_CPSTEERING_MODE_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_SYNTH11_SLOPE_ICPA2_MSB 13 -#define PHY_ANALOG_SYNTH11_SLOPE_ICPA2_LSB 11 -#define PHY_ANALOG_SYNTH11_SLOPE_ICPA2_MASK 0x00003800 -#define PHY_ANALOG_SYNTH11_SLOPE_ICPA2_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_SYNTH11_SLOPE_ICPA2_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_SYNTH11_LOOP_ICPA2_MSB 17 -#define PHY_ANALOG_SYNTH11_LOOP_ICPA2_LSB 14 -#define PHY_ANALOG_SYNTH11_LOOP_ICPA2_MASK 0x0003c000 -#define PHY_ANALOG_SYNTH11_LOOP_ICPA2_GET(x) (((x) & 0x0003c000) >> 14) -#define PHY_ANALOG_SYNTH11_LOOP_ICPA2_SET(x) (((x) << 14) & 0x0003c000) -#define PHY_ANALOG_SYNTH11_LOOP_CSA2_MSB 21 -#define PHY_ANALOG_SYNTH11_LOOP_CSA2_LSB 18 -#define PHY_ANALOG_SYNTH11_LOOP_CSA2_MASK 0x003c0000 -#define PHY_ANALOG_SYNTH11_LOOP_CSA2_GET(x) (((x) & 0x003c0000) >> 18) -#define PHY_ANALOG_SYNTH11_LOOP_CSA2_SET(x) (((x) << 18) & 0x003c0000) -#define PHY_ANALOG_SYNTH11_LOOP_RSA2_MSB 26 -#define PHY_ANALOG_SYNTH11_LOOP_RSA2_LSB 22 -#define PHY_ANALOG_SYNTH11_LOOP_RSA2_MASK 0x07c00000 -#define PHY_ANALOG_SYNTH11_LOOP_RSA2_GET(x) (((x) & 0x07c00000) >> 22) -#define PHY_ANALOG_SYNTH11_LOOP_RSA2_SET(x) (((x) << 22) & 0x07c00000) -#define PHY_ANALOG_SYNTH11_LOOP_CPA2_MSB 31 -#define PHY_ANALOG_SYNTH11_LOOP_CPA2_LSB 27 -#define PHY_ANALOG_SYNTH11_LOOP_CPA2_MASK 0xf8000000 -#define PHY_ANALOG_SYNTH11_LOOP_CPA2_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_SYNTH11_LOOP_CPA2_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for SYNTH12 */ -#define PHY_ANALOG_SYNTH12_ADDRESS 0x000000ac -#define PHY_ANALOG_SYNTH12_OFFSET 0x000000ac -#define PHY_ANALOG_SYNTH12_SPARE12A_MSB 9 -#define PHY_ANALOG_SYNTH12_SPARE12A_LSB 0 -#define PHY_ANALOG_SYNTH12_SPARE12A_MASK 0x000003ff -#define PHY_ANALOG_SYNTH12_SPARE12A_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_ANALOG_SYNTH12_SPARE12A_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_ANALOG_SYNTH12_LOOPLEAKCUR_FRACN_MSB 13 -#define PHY_ANALOG_SYNTH12_LOOPLEAKCUR_FRACN_LSB 10 -#define PHY_ANALOG_SYNTH12_LOOPLEAKCUR_FRACN_MASK 0x00003c00 -#define PHY_ANALOG_SYNTH12_LOOPLEAKCUR_FRACN_GET(x) (((x) & 0x00003c00) >> 10) -#define PHY_ANALOG_SYNTH12_LOOPLEAKCUR_FRACN_SET(x) (((x) << 10) & 0x00003c00) -#define PHY_ANALOG_SYNTH12_CPLOWLK_FRACN_MSB 14 -#define PHY_ANALOG_SYNTH12_CPLOWLK_FRACN_LSB 14 -#define PHY_ANALOG_SYNTH12_CPLOWLK_FRACN_MASK 0x00004000 -#define PHY_ANALOG_SYNTH12_CPLOWLK_FRACN_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_SYNTH12_CPLOWLK_FRACN_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_SYNTH12_CPBIAS_FRACN_MSB 16 -#define PHY_ANALOG_SYNTH12_CPBIAS_FRACN_LSB 15 -#define PHY_ANALOG_SYNTH12_CPBIAS_FRACN_MASK 0x00018000 -#define PHY_ANALOG_SYNTH12_CPBIAS_FRACN_GET(x) (((x) & 0x00018000) >> 15) -#define PHY_ANALOG_SYNTH12_CPBIAS_FRACN_SET(x) (((x) << 15) & 0x00018000) -#define PHY_ANALOG_SYNTH12_SYNTHDIGOUTEN_MSB 17 -#define PHY_ANALOG_SYNTH12_SYNTHDIGOUTEN_LSB 17 -#define PHY_ANALOG_SYNTH12_SYNTHDIGOUTEN_MASK 0x00020000 -#define PHY_ANALOG_SYNTH12_SYNTHDIGOUTEN_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_SYNTH12_SYNTHDIGOUTEN_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_SYNTH12_STRCONT_MSB 18 -#define PHY_ANALOG_SYNTH12_STRCONT_LSB 18 -#define PHY_ANALOG_SYNTH12_STRCONT_MASK 0x00040000 -#define PHY_ANALOG_SYNTH12_STRCONT_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_SYNTH12_STRCONT_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_SYNTH12_VREFMUL3_MSB 22 -#define PHY_ANALOG_SYNTH12_VREFMUL3_LSB 19 -#define PHY_ANALOG_SYNTH12_VREFMUL3_MASK 0x00780000 -#define PHY_ANALOG_SYNTH12_VREFMUL3_GET(x) (((x) & 0x00780000) >> 19) -#define PHY_ANALOG_SYNTH12_VREFMUL3_SET(x) (((x) << 19) & 0x00780000) -#define PHY_ANALOG_SYNTH12_VREFMUL2_MSB 26 -#define PHY_ANALOG_SYNTH12_VREFMUL2_LSB 23 -#define PHY_ANALOG_SYNTH12_VREFMUL2_MASK 0x07800000 -#define PHY_ANALOG_SYNTH12_VREFMUL2_GET(x) (((x) & 0x07800000) >> 23) -#define PHY_ANALOG_SYNTH12_VREFMUL2_SET(x) (((x) << 23) & 0x07800000) -#define PHY_ANALOG_SYNTH12_VREFMUL1_MSB 30 -#define PHY_ANALOG_SYNTH12_VREFMUL1_LSB 27 -#define PHY_ANALOG_SYNTH12_VREFMUL1_MASK 0x78000000 -#define PHY_ANALOG_SYNTH12_VREFMUL1_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_ANALOG_SYNTH12_VREFMUL1_SET(x) (((x) << 27) & 0x78000000) -#define PHY_ANALOG_SYNTH12_CLK_DOUBLER_EN_MSB 31 -#define PHY_ANALOG_SYNTH12_CLK_DOUBLER_EN_LSB 31 -#define PHY_ANALOG_SYNTH12_CLK_DOUBLER_EN_MASK 0x80000000 -#define PHY_ANALOG_SYNTH12_CLK_DOUBLER_EN_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_SYNTH12_CLK_DOUBLER_EN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for SYNTH13 */ -#define PHY_ANALOG_SYNTH13_ADDRESS 0x000000b0 -#define PHY_ANALOG_SYNTH13_OFFSET 0x000000b0 -#define PHY_ANALOG_SYNTH13_SPARE13A_MSB 0 -#define PHY_ANALOG_SYNTH13_SPARE13A_LSB 0 -#define PHY_ANALOG_SYNTH13_SPARE13A_MASK 0x00000001 -#define PHY_ANALOG_SYNTH13_SPARE13A_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_SYNTH13_SPARE13A_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_SYNTH13_SLOPE_ICPA_FRACN_MSB 3 -#define PHY_ANALOG_SYNTH13_SLOPE_ICPA_FRACN_LSB 1 -#define PHY_ANALOG_SYNTH13_SLOPE_ICPA_FRACN_MASK 0x0000000e -#define PHY_ANALOG_SYNTH13_SLOPE_ICPA_FRACN_GET(x) (((x) & 0x0000000e) >> 1) -#define PHY_ANALOG_SYNTH13_SLOPE_ICPA_FRACN_SET(x) (((x) << 1) & 0x0000000e) -#define PHY_ANALOG_SYNTH13_LOOP_ICPA_FRACN_MSB 7 -#define PHY_ANALOG_SYNTH13_LOOP_ICPA_FRACN_LSB 4 -#define PHY_ANALOG_SYNTH13_LOOP_ICPA_FRACN_MASK 0x000000f0 -#define PHY_ANALOG_SYNTH13_LOOP_ICPA_FRACN_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_ANALOG_SYNTH13_LOOP_ICPA_FRACN_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_ANALOG_SYNTH13_LOOP_CSA_FRACN_MSB 11 -#define PHY_ANALOG_SYNTH13_LOOP_CSA_FRACN_LSB 8 -#define PHY_ANALOG_SYNTH13_LOOP_CSA_FRACN_MASK 0x00000f00 -#define PHY_ANALOG_SYNTH13_LOOP_CSA_FRACN_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_SYNTH13_LOOP_CSA_FRACN_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_SYNTH13_LOOP_RSA_FRACN_MSB 16 -#define PHY_ANALOG_SYNTH13_LOOP_RSA_FRACN_LSB 12 -#define PHY_ANALOG_SYNTH13_LOOP_RSA_FRACN_MASK 0x0001f000 -#define PHY_ANALOG_SYNTH13_LOOP_RSA_FRACN_GET(x) (((x) & 0x0001f000) >> 12) -#define PHY_ANALOG_SYNTH13_LOOP_RSA_FRACN_SET(x) (((x) << 12) & 0x0001f000) -#define PHY_ANALOG_SYNTH13_LOOP_CPA_FRACN_MSB 21 -#define PHY_ANALOG_SYNTH13_LOOP_CPA_FRACN_LSB 17 -#define PHY_ANALOG_SYNTH13_LOOP_CPA_FRACN_MASK 0x003e0000 -#define PHY_ANALOG_SYNTH13_LOOP_CPA_FRACN_GET(x) (((x) & 0x003e0000) >> 17) -#define PHY_ANALOG_SYNTH13_LOOP_CPA_FRACN_SET(x) (((x) << 17) & 0x003e0000) -#define PHY_ANALOG_SYNTH13_LOOP_3RD_ORDER_RA_FRACN_MSB 26 -#define PHY_ANALOG_SYNTH13_LOOP_3RD_ORDER_RA_FRACN_LSB 22 -#define PHY_ANALOG_SYNTH13_LOOP_3RD_ORDER_RA_FRACN_MASK 0x07c00000 -#define PHY_ANALOG_SYNTH13_LOOP_3RD_ORDER_RA_FRACN_GET(x) (((x) & 0x07c00000) >> 22) -#define PHY_ANALOG_SYNTH13_LOOP_3RD_ORDER_RA_FRACN_SET(x) (((x) << 22) & 0x07c00000) -#define PHY_ANALOG_SYNTH13_REFDIVA_FRACN_MSB 31 -#define PHY_ANALOG_SYNTH13_REFDIVA_FRACN_LSB 27 -#define PHY_ANALOG_SYNTH13_REFDIVA_FRACN_MASK 0xf8000000 -#define PHY_ANALOG_SYNTH13_REFDIVA_FRACN_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_SYNTH13_REFDIVA_FRACN_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for SYNTH14 */ -#define PHY_ANALOG_SYNTH14_ADDRESS 0x000000b4 -#define PHY_ANALOG_SYNTH14_OFFSET 0x000000b4 -#define PHY_ANALOG_SYNTH14_SPARE14A_MSB 1 -#define PHY_ANALOG_SYNTH14_SPARE14A_LSB 0 -#define PHY_ANALOG_SYNTH14_SPARE14A_MASK 0x00000003 -#define PHY_ANALOG_SYNTH14_SPARE14A_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_SYNTH14_SPARE14A_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_3_MSB 3 -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_3_LSB 2 -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_3_MASK 0x0000000c -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_3_GET(x) (((x) & 0x0000000c) >> 2) -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_3_SET(x) (((x) << 2) & 0x0000000c) -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_3_MSB 5 -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_3_LSB 4 -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_3_MASK 0x00000030 -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_3_GET(x) (((x) & 0x00000030) >> 4) -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_3_SET(x) (((x) << 4) & 0x00000030) -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_2_MSB 7 -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_2_LSB 6 -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_2_MASK 0x000000c0 -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_2_GET(x) (((x) & 0x000000c0) >> 6) -#define PHY_ANALOG_SYNTH14_LOBUF5GTUNE_2_SET(x) (((x) << 6) & 0x000000c0) -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_2_MSB 9 -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_2_LSB 8 -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_2_MASK 0x00000300 -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_2_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_ANALOG_SYNTH14_LOBUF2GTUNE_2_SET(x) (((x) << 8) & 0x00000300) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_3_MSB 10 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_3_LSB 10 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_3_MASK 0x00000400 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_3_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_3_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_3_MSB 11 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_3_LSB 11 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_3_MASK 0x00000800 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_3_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_3_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_2_MSB 12 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_2_LSB 12 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_2_MASK 0x00001000 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_2_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF5G_2_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_2_MSB 13 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_2_LSB 13 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_2_MASK 0x00002000 -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_2_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_SYNTH14_PWD_LOBUF2G_2_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_SYNTH14_PWUPLO23_PD_MSB 16 -#define PHY_ANALOG_SYNTH14_PWUPLO23_PD_LSB 14 -#define PHY_ANALOG_SYNTH14_PWUPLO23_PD_MASK 0x0001c000 -#define PHY_ANALOG_SYNTH14_PWUPLO23_PD_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_SYNTH14_PWUPLO23_PD_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_3_MSB 19 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_3_LSB 17 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_3_MASK 0x000e0000 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_3_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_3_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_3_MSB 22 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_3_LSB 20 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_3_MASK 0x00700000 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_3_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_3_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_2_MSB 25 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_2_LSB 23 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_2_MASK 0x03800000 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_2_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF5G50_2_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_2_MSB 28 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_2_LSB 26 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_2_MASK 0x1c000000 -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_2_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_SYNTH14_PWDB_ICLOBUF2G50_2_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_SYNTH14_PWDB_ICLVLSHFT_MSB 31 -#define PHY_ANALOG_SYNTH14_PWDB_ICLVLSHFT_LSB 29 -#define PHY_ANALOG_SYNTH14_PWDB_ICLVLSHFT_MASK 0xe0000000 -#define PHY_ANALOG_SYNTH14_PWDB_ICLVLSHFT_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_SYNTH14_PWDB_ICLVLSHFT_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for BIAS1 */ -#define PHY_ANALOG_BIAS1_ADDRESS 0x000000c0 -#define PHY_ANALOG_BIAS1_OFFSET 0x000000c0 -#define PHY_ANALOG_BIAS1_SPARE1_MSB 6 -#define PHY_ANALOG_BIAS1_SPARE1_LSB 0 -#define PHY_ANALOG_BIAS1_SPARE1_MASK 0x0000007f -#define PHY_ANALOG_BIAS1_SPARE1_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_ANALOG_BIAS1_SPARE1_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_ANALOG_BIAS1_PWD_IC25V2IQ_MSB 9 -#define PHY_ANALOG_BIAS1_PWD_IC25V2IQ_LSB 7 -#define PHY_ANALOG_BIAS1_PWD_IC25V2IQ_MASK 0x00000380 -#define PHY_ANALOG_BIAS1_PWD_IC25V2IQ_GET(x) (((x) & 0x00000380) >> 7) -#define PHY_ANALOG_BIAS1_PWD_IC25V2IQ_SET(x) (((x) << 7) & 0x00000380) -#define PHY_ANALOG_BIAS1_PWD_IC25V2II_MSB 12 -#define PHY_ANALOG_BIAS1_PWD_IC25V2II_LSB 10 -#define PHY_ANALOG_BIAS1_PWD_IC25V2II_MASK 0x00001c00 -#define PHY_ANALOG_BIAS1_PWD_IC25V2II_GET(x) (((x) & 0x00001c00) >> 10) -#define PHY_ANALOG_BIAS1_PWD_IC25V2II_SET(x) (((x) << 10) & 0x00001c00) -#define PHY_ANALOG_BIAS1_PWD_IC25BB_MSB 15 -#define PHY_ANALOG_BIAS1_PWD_IC25BB_LSB 13 -#define PHY_ANALOG_BIAS1_PWD_IC25BB_MASK 0x0000e000 -#define PHY_ANALOG_BIAS1_PWD_IC25BB_GET(x) (((x) & 0x0000e000) >> 13) -#define PHY_ANALOG_BIAS1_PWD_IC25BB_SET(x) (((x) << 13) & 0x0000e000) -#define PHY_ANALOG_BIAS1_PWD_IC25DAC_MSB 18 -#define PHY_ANALOG_BIAS1_PWD_IC25DAC_LSB 16 -#define PHY_ANALOG_BIAS1_PWD_IC25DAC_MASK 0x00070000 -#define PHY_ANALOG_BIAS1_PWD_IC25DAC_GET(x) (((x) & 0x00070000) >> 16) -#define PHY_ANALOG_BIAS1_PWD_IC25DAC_SET(x) (((x) << 16) & 0x00070000) -#define PHY_ANALOG_BIAS1_PWD_IC25FIR_MSB 21 -#define PHY_ANALOG_BIAS1_PWD_IC25FIR_LSB 19 -#define PHY_ANALOG_BIAS1_PWD_IC25FIR_MASK 0x00380000 -#define PHY_ANALOG_BIAS1_PWD_IC25FIR_GET(x) (((x) & 0x00380000) >> 19) -#define PHY_ANALOG_BIAS1_PWD_IC25FIR_SET(x) (((x) << 19) & 0x00380000) -#define PHY_ANALOG_BIAS1_PWD_IC25ADC_MSB 24 -#define PHY_ANALOG_BIAS1_PWD_IC25ADC_LSB 22 -#define PHY_ANALOG_BIAS1_PWD_IC25ADC_MASK 0x01c00000 -#define PHY_ANALOG_BIAS1_PWD_IC25ADC_GET(x) (((x) & 0x01c00000) >> 22) -#define PHY_ANALOG_BIAS1_PWD_IC25ADC_SET(x) (((x) << 22) & 0x01c00000) -#define PHY_ANALOG_BIAS1_BIAS_SEL_MSB 31 -#define PHY_ANALOG_BIAS1_BIAS_SEL_LSB 25 -#define PHY_ANALOG_BIAS1_BIAS_SEL_MASK 0xfe000000 -#define PHY_ANALOG_BIAS1_BIAS_SEL_GET(x) (((x) & 0xfe000000) >> 25) -#define PHY_ANALOG_BIAS1_BIAS_SEL_SET(x) (((x) << 25) & 0xfe000000) - -/* macros for BIAS2 */ -#define PHY_ANALOG_BIAS2_ADDRESS 0x000000c4 -#define PHY_ANALOG_BIAS2_OFFSET 0x000000c4 -#define PHY_ANALOG_BIAS2_SPARE2_MSB 4 -#define PHY_ANALOG_BIAS2_SPARE2_LSB 0 -#define PHY_ANALOG_BIAS2_SPARE2_MASK 0x0000001f -#define PHY_ANALOG_BIAS2_SPARE2_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_ANALOG_BIAS2_SPARE2_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_ANALOG_BIAS2_PWD_IC25XPA_MSB 7 -#define PHY_ANALOG_BIAS2_PWD_IC25XPA_LSB 5 -#define PHY_ANALOG_BIAS2_PWD_IC25XPA_MASK 0x000000e0 -#define PHY_ANALOG_BIAS2_PWD_IC25XPA_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_BIAS2_PWD_IC25XPA_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_BIAS2_PWD_IC25XTAL_MSB 10 -#define PHY_ANALOG_BIAS2_PWD_IC25XTAL_LSB 8 -#define PHY_ANALOG_BIAS2_PWD_IC25XTAL_MASK 0x00000700 -#define PHY_ANALOG_BIAS2_PWD_IC25XTAL_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_BIAS2_PWD_IC25XTAL_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_BIAS2_PWD_IC25TXRF_MSB 13 -#define PHY_ANALOG_BIAS2_PWD_IC25TXRF_LSB 11 -#define PHY_ANALOG_BIAS2_PWD_IC25TXRF_MASK 0x00003800 -#define PHY_ANALOG_BIAS2_PWD_IC25TXRF_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_BIAS2_PWD_IC25TXRF_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_BIAS2_PWD_IC25RXRF_MSB 16 -#define PHY_ANALOG_BIAS2_PWD_IC25RXRF_LSB 14 -#define PHY_ANALOG_BIAS2_PWD_IC25RXRF_MASK 0x0001c000 -#define PHY_ANALOG_BIAS2_PWD_IC25RXRF_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_BIAS2_PWD_IC25RXRF_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_BIAS2_PWD_IC25SYNTH_MSB 19 -#define PHY_ANALOG_BIAS2_PWD_IC25SYNTH_LSB 17 -#define PHY_ANALOG_BIAS2_PWD_IC25SYNTH_MASK 0x000e0000 -#define PHY_ANALOG_BIAS2_PWD_IC25SYNTH_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_BIAS2_PWD_IC25SYNTH_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLREG_MSB 22 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLREG_LSB 20 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLREG_MASK 0x00700000 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLREG_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLREG_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP2_MSB 25 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP2_LSB 23 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP2_MASK 0x03800000 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP2_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP2_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP_MSB 28 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP_LSB 26 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP_MASK 0x1c000000 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLCP_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLGM_MSB 31 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLGM_LSB 29 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLGM_MASK 0xe0000000 -#define PHY_ANALOG_BIAS2_PWD_IC25PLLGM_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_BIAS2_PWD_IC25PLLGM_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for BIAS3 */ -#define PHY_ANALOG_BIAS3_ADDRESS 0x000000c8 -#define PHY_ANALOG_BIAS3_OFFSET 0x000000c8 -#define PHY_ANALOG_BIAS3_SPARE3_MSB 1 -#define PHY_ANALOG_BIAS3_SPARE3_LSB 0 -#define PHY_ANALOG_BIAS3_SPARE3_MASK 0x00000003 -#define PHY_ANALOG_BIAS3_SPARE3_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_BIAS3_SPARE3_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_BIAS3_PWD_IR25SAR_MSB 4 -#define PHY_ANALOG_BIAS3_PWD_IR25SAR_LSB 2 -#define PHY_ANALOG_BIAS3_PWD_IR25SAR_MASK 0x0000001c -#define PHY_ANALOG_BIAS3_PWD_IR25SAR_GET(x) (((x) & 0x0000001c) >> 2) -#define PHY_ANALOG_BIAS3_PWD_IR25SAR_SET(x) (((x) << 2) & 0x0000001c) -#define PHY_ANALOG_BIAS3_PWD_IR25TXRF_MSB 7 -#define PHY_ANALOG_BIAS3_PWD_IR25TXRF_LSB 5 -#define PHY_ANALOG_BIAS3_PWD_IR25TXRF_MASK 0x000000e0 -#define PHY_ANALOG_BIAS3_PWD_IR25TXRF_GET(x) (((x) & 0x000000e0) >> 5) -#define PHY_ANALOG_BIAS3_PWD_IR25TXRF_SET(x) (((x) << 5) & 0x000000e0) -#define PHY_ANALOG_BIAS3_PWD_IR25RXRF_MSB 10 -#define PHY_ANALOG_BIAS3_PWD_IR25RXRF_LSB 8 -#define PHY_ANALOG_BIAS3_PWD_IR25RXRF_MASK 0x00000700 -#define PHY_ANALOG_BIAS3_PWD_IR25RXRF_GET(x) (((x) & 0x00000700) >> 8) -#define PHY_ANALOG_BIAS3_PWD_IR25RXRF_SET(x) (((x) << 8) & 0x00000700) -#define PHY_ANALOG_BIAS3_PWD_IR25SYNTH_MSB 13 -#define PHY_ANALOG_BIAS3_PWD_IR25SYNTH_LSB 11 -#define PHY_ANALOG_BIAS3_PWD_IR25SYNTH_MASK 0x00003800 -#define PHY_ANALOG_BIAS3_PWD_IR25SYNTH_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_BIAS3_PWD_IR25SYNTH_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_BIAS3_PWD_IR25PLLREG_MSB 16 -#define PHY_ANALOG_BIAS3_PWD_IR25PLLREG_LSB 14 -#define PHY_ANALOG_BIAS3_PWD_IR25PLLREG_MASK 0x0001c000 -#define PHY_ANALOG_BIAS3_PWD_IR25PLLREG_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_BIAS3_PWD_IR25PLLREG_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_BIAS3_PWD_IR25BB_MSB 19 -#define PHY_ANALOG_BIAS3_PWD_IR25BB_LSB 17 -#define PHY_ANALOG_BIAS3_PWD_IR25BB_MASK 0x000e0000 -#define PHY_ANALOG_BIAS3_PWD_IR25BB_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_BIAS3_PWD_IR25BB_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_BIAS3_PWD_IR50DAC_MSB 22 -#define PHY_ANALOG_BIAS3_PWD_IR50DAC_LSB 20 -#define PHY_ANALOG_BIAS3_PWD_IR50DAC_MASK 0x00700000 -#define PHY_ANALOG_BIAS3_PWD_IR50DAC_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_BIAS3_PWD_IR50DAC_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_BIAS3_PWD_IR25DAC_MSB 25 -#define PHY_ANALOG_BIAS3_PWD_IR25DAC_LSB 23 -#define PHY_ANALOG_BIAS3_PWD_IR25DAC_MASK 0x03800000 -#define PHY_ANALOG_BIAS3_PWD_IR25DAC_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_BIAS3_PWD_IR25DAC_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_BIAS3_PWD_IR25FIR_MSB 28 -#define PHY_ANALOG_BIAS3_PWD_IR25FIR_LSB 26 -#define PHY_ANALOG_BIAS3_PWD_IR25FIR_MASK 0x1c000000 -#define PHY_ANALOG_BIAS3_PWD_IR25FIR_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_BIAS3_PWD_IR25FIR_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_BIAS3_PWD_IR50ADC_MSB 31 -#define PHY_ANALOG_BIAS3_PWD_IR50ADC_LSB 29 -#define PHY_ANALOG_BIAS3_PWD_IR50ADC_MASK 0xe0000000 -#define PHY_ANALOG_BIAS3_PWD_IR50ADC_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_BIAS3_PWD_IR50ADC_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for BIAS4 */ -#define PHY_ANALOG_BIAS4_ADDRESS 0x000000cc -#define PHY_ANALOG_BIAS4_OFFSET 0x000000cc -#define PHY_ANALOG_BIAS4_SPARE4_MSB 10 -#define PHY_ANALOG_BIAS4_SPARE4_LSB 0 -#define PHY_ANALOG_BIAS4_SPARE4_MASK 0x000007ff -#define PHY_ANALOG_BIAS4_SPARE4_GET(x) (((x) & 0x000007ff) >> 0) -#define PHY_ANALOG_BIAS4_SPARE4_SET(x) (((x) << 0) & 0x000007ff) -#define PHY_ANALOG_BIAS4_PWD_IR25SPARED_MSB 13 -#define PHY_ANALOG_BIAS4_PWD_IR25SPARED_LSB 11 -#define PHY_ANALOG_BIAS4_PWD_IR25SPARED_MASK 0x00003800 -#define PHY_ANALOG_BIAS4_PWD_IR25SPARED_GET(x) (((x) & 0x00003800) >> 11) -#define PHY_ANALOG_BIAS4_PWD_IR25SPARED_SET(x) (((x) << 11) & 0x00003800) -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREC_MSB 16 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREC_LSB 14 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREC_MASK 0x0001c000 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREC_GET(x) (((x) & 0x0001c000) >> 14) -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREC_SET(x) (((x) << 14) & 0x0001c000) -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREB_MSB 19 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREB_LSB 17 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREB_MASK 0x000e0000 -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREB_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_BIAS4_PWD_IR25SPAREB_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_BIAS4_PWD_IR25XPA_MSB 22 -#define PHY_ANALOG_BIAS4_PWD_IR25XPA_LSB 20 -#define PHY_ANALOG_BIAS4_PWD_IR25XPA_MASK 0x00700000 -#define PHY_ANALOG_BIAS4_PWD_IR25XPA_GET(x) (((x) & 0x00700000) >> 20) -#define PHY_ANALOG_BIAS4_PWD_IR25XPA_SET(x) (((x) << 20) & 0x00700000) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREC_MSB 25 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREC_LSB 23 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREC_MASK 0x03800000 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREC_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREC_SET(x) (((x) << 23) & 0x03800000) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREB_MSB 28 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREB_LSB 26 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREB_MASK 0x1c000000 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREB_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREB_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREA_MSB 31 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREA_LSB 29 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREA_MASK 0xe0000000 -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREA_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_BIAS4_PWD_IC25SPAREA_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for RXTX1 */ -#define PHY_ANALOG_RXTX1_ADDRESS 0x00000100 -#define PHY_ANALOG_RXTX1_OFFSET 0x00000100 -#define PHY_ANALOG_RXTX1_SCFIR_GAIN_MSB 0 -#define PHY_ANALOG_RXTX1_SCFIR_GAIN_LSB 0 -#define PHY_ANALOG_RXTX1_SCFIR_GAIN_MASK 0x00000001 -#define PHY_ANALOG_RXTX1_SCFIR_GAIN_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXTX1_SCFIR_GAIN_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXTX1_MANRXGAIN_MSB 1 -#define PHY_ANALOG_RXTX1_MANRXGAIN_LSB 1 -#define PHY_ANALOG_RXTX1_MANRXGAIN_MASK 0x00000002 -#define PHY_ANALOG_RXTX1_MANRXGAIN_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_RXTX1_MANRXGAIN_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_RXTX1_AGC_DBDAC_MSB 5 -#define PHY_ANALOG_RXTX1_AGC_DBDAC_LSB 2 -#define PHY_ANALOG_RXTX1_AGC_DBDAC_MASK 0x0000003c -#define PHY_ANALOG_RXTX1_AGC_DBDAC_GET(x) (((x) & 0x0000003c) >> 2) -#define PHY_ANALOG_RXTX1_AGC_DBDAC_SET(x) (((x) << 2) & 0x0000003c) -#define PHY_ANALOG_RXTX1_OVR_AGC_DBDAC_MSB 6 -#define PHY_ANALOG_RXTX1_OVR_AGC_DBDAC_LSB 6 -#define PHY_ANALOG_RXTX1_OVR_AGC_DBDAC_MASK 0x00000040 -#define PHY_ANALOG_RXTX1_OVR_AGC_DBDAC_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_RXTX1_OVR_AGC_DBDAC_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_RXTX1_ENABLE_PAL_MSB 7 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_LSB 7 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_MASK 0x00000080 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RXTX1_ENABLE_PAL_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RXTX1_ENABLE_PAL_OVR_MSB 8 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_OVR_LSB 8 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_OVR_MASK 0x00000100 -#define PHY_ANALOG_RXTX1_ENABLE_PAL_OVR_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_RXTX1_ENABLE_PAL_OVR_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_RXTX1_TX1DB_BIQUAD_MSB 11 -#define PHY_ANALOG_RXTX1_TX1DB_BIQUAD_LSB 9 -#define PHY_ANALOG_RXTX1_TX1DB_BIQUAD_MASK 0x00000e00 -#define PHY_ANALOG_RXTX1_TX1DB_BIQUAD_GET(x) (((x) & 0x00000e00) >> 9) -#define PHY_ANALOG_RXTX1_TX1DB_BIQUAD_SET(x) (((x) << 9) & 0x00000e00) -#define PHY_ANALOG_RXTX1_TX6DB_BIQUAD_MSB 13 -#define PHY_ANALOG_RXTX1_TX6DB_BIQUAD_LSB 12 -#define PHY_ANALOG_RXTX1_TX6DB_BIQUAD_MASK 0x00003000 -#define PHY_ANALOG_RXTX1_TX6DB_BIQUAD_GET(x) (((x) & 0x00003000) >> 12) -#define PHY_ANALOG_RXTX1_TX6DB_BIQUAD_SET(x) (((x) << 12) & 0x00003000) -#define PHY_ANALOG_RXTX1_PADRVHALFGN2G_MSB 14 -#define PHY_ANALOG_RXTX1_PADRVHALFGN2G_LSB 14 -#define PHY_ANALOG_RXTX1_PADRVHALFGN2G_MASK 0x00004000 -#define PHY_ANALOG_RXTX1_PADRVHALFGN2G_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_RXTX1_PADRVHALFGN2G_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_RXTX1_PADRV2GN_MSB 18 -#define PHY_ANALOG_RXTX1_PADRV2GN_LSB 15 -#define PHY_ANALOG_RXTX1_PADRV2GN_MASK 0x00078000 -#define PHY_ANALOG_RXTX1_PADRV2GN_GET(x) (((x) & 0x00078000) >> 15) -#define PHY_ANALOG_RXTX1_PADRV2GN_SET(x) (((x) << 15) & 0x00078000) -#define PHY_ANALOG_RXTX1_PADRV3GN5G_MSB 22 -#define PHY_ANALOG_RXTX1_PADRV3GN5G_LSB 19 -#define PHY_ANALOG_RXTX1_PADRV3GN5G_MASK 0x00780000 -#define PHY_ANALOG_RXTX1_PADRV3GN5G_GET(x) (((x) & 0x00780000) >> 19) -#define PHY_ANALOG_RXTX1_PADRV3GN5G_SET(x) (((x) << 19) & 0x00780000) -#define PHY_ANALOG_RXTX1_PADRV4GN5G_MSB 26 -#define PHY_ANALOG_RXTX1_PADRV4GN5G_LSB 23 -#define PHY_ANALOG_RXTX1_PADRV4GN5G_MASK 0x07800000 -#define PHY_ANALOG_RXTX1_PADRV4GN5G_GET(x) (((x) & 0x07800000) >> 23) -#define PHY_ANALOG_RXTX1_PADRV4GN5G_SET(x) (((x) << 23) & 0x07800000) -#define PHY_ANALOG_RXTX1_TXBB_GC_MSB 30 -#define PHY_ANALOG_RXTX1_TXBB_GC_LSB 27 -#define PHY_ANALOG_RXTX1_TXBB_GC_MASK 0x78000000 -#define PHY_ANALOG_RXTX1_TXBB_GC_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_ANALOG_RXTX1_TXBB_GC_SET(x) (((x) << 27) & 0x78000000) -#define PHY_ANALOG_RXTX1_MANTXGAIN_MSB 31 -#define PHY_ANALOG_RXTX1_MANTXGAIN_LSB 31 -#define PHY_ANALOG_RXTX1_MANTXGAIN_MASK 0x80000000 -#define PHY_ANALOG_RXTX1_MANTXGAIN_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_RXTX1_MANTXGAIN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for RXTX2 */ -#define PHY_ANALOG_RXTX2_ADDRESS 0x00000104 -#define PHY_ANALOG_RXTX2_OFFSET 0x00000104 -#define PHY_ANALOG_RXTX2_BMODE_MSB 0 -#define PHY_ANALOG_RXTX2_BMODE_LSB 0 -#define PHY_ANALOG_RXTX2_BMODE_MASK 0x00000001 -#define PHY_ANALOG_RXTX2_BMODE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RXTX2_BMODE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RXTX2_BMODE_OVR_MSB 1 -#define PHY_ANALOG_RXTX2_BMODE_OVR_LSB 1 -#define PHY_ANALOG_RXTX2_BMODE_OVR_MASK 0x00000002 -#define PHY_ANALOG_RXTX2_BMODE_OVR_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_RXTX2_BMODE_OVR_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_RXTX2_SYNTHON_MSB 2 -#define PHY_ANALOG_RXTX2_SYNTHON_LSB 2 -#define PHY_ANALOG_RXTX2_SYNTHON_MASK 0x00000004 -#define PHY_ANALOG_RXTX2_SYNTHON_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_RXTX2_SYNTHON_SET(x) (((x) << 2) & 0x00000004) -#define PHY_ANALOG_RXTX2_SYNTHON_OVR_MSB 3 -#define PHY_ANALOG_RXTX2_SYNTHON_OVR_LSB 3 -#define PHY_ANALOG_RXTX2_SYNTHON_OVR_MASK 0x00000008 -#define PHY_ANALOG_RXTX2_SYNTHON_OVR_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_RXTX2_SYNTHON_OVR_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_RXTX2_BW_ST_MSB 5 -#define PHY_ANALOG_RXTX2_BW_ST_LSB 4 -#define PHY_ANALOG_RXTX2_BW_ST_MASK 0x00000030 -#define PHY_ANALOG_RXTX2_BW_ST_GET(x) (((x) & 0x00000030) >> 4) -#define PHY_ANALOG_RXTX2_BW_ST_SET(x) (((x) << 4) & 0x00000030) -#define PHY_ANALOG_RXTX2_BW_ST_OVR_MSB 6 -#define PHY_ANALOG_RXTX2_BW_ST_OVR_LSB 6 -#define PHY_ANALOG_RXTX2_BW_ST_OVR_MASK 0x00000040 -#define PHY_ANALOG_RXTX2_BW_ST_OVR_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_RXTX2_BW_ST_OVR_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_RXTX2_TXON_MSB 7 -#define PHY_ANALOG_RXTX2_TXON_LSB 7 -#define PHY_ANALOG_RXTX2_TXON_MASK 0x00000080 -#define PHY_ANALOG_RXTX2_TXON_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RXTX2_TXON_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RXTX2_TXON_OVR_MSB 8 -#define PHY_ANALOG_RXTX2_TXON_OVR_LSB 8 -#define PHY_ANALOG_RXTX2_TXON_OVR_MASK 0x00000100 -#define PHY_ANALOG_RXTX2_TXON_OVR_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_RXTX2_TXON_OVR_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_RXTX2_PAON_MSB 9 -#define PHY_ANALOG_RXTX2_PAON_LSB 9 -#define PHY_ANALOG_RXTX2_PAON_MASK 0x00000200 -#define PHY_ANALOG_RXTX2_PAON_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_RXTX2_PAON_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_RXTX2_PAON_OVR_MSB 10 -#define PHY_ANALOG_RXTX2_PAON_OVR_LSB 10 -#define PHY_ANALOG_RXTX2_PAON_OVR_MASK 0x00000400 -#define PHY_ANALOG_RXTX2_PAON_OVR_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_RXTX2_PAON_OVR_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_RXTX2_RXON_MSB 11 -#define PHY_ANALOG_RXTX2_RXON_LSB 11 -#define PHY_ANALOG_RXTX2_RXON_MASK 0x00000800 -#define PHY_ANALOG_RXTX2_RXON_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_RXTX2_RXON_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_RXTX2_RXON_OVR_MSB 12 -#define PHY_ANALOG_RXTX2_RXON_OVR_LSB 12 -#define PHY_ANALOG_RXTX2_RXON_OVR_MASK 0x00001000 -#define PHY_ANALOG_RXTX2_RXON_OVR_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_RXTX2_RXON_OVR_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_RXTX2_AGCON_MSB 13 -#define PHY_ANALOG_RXTX2_AGCON_LSB 13 -#define PHY_ANALOG_RXTX2_AGCON_MASK 0x00002000 -#define PHY_ANALOG_RXTX2_AGCON_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_RXTX2_AGCON_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_RXTX2_AGCON_OVR_MSB 14 -#define PHY_ANALOG_RXTX2_AGCON_OVR_LSB 14 -#define PHY_ANALOG_RXTX2_AGCON_OVR_MASK 0x00004000 -#define PHY_ANALOG_RXTX2_AGCON_OVR_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_RXTX2_AGCON_OVR_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_RXTX2_TXMOD_MSB 17 -#define PHY_ANALOG_RXTX2_TXMOD_LSB 15 -#define PHY_ANALOG_RXTX2_TXMOD_MASK 0x00038000 -#define PHY_ANALOG_RXTX2_TXMOD_GET(x) (((x) & 0x00038000) >> 15) -#define PHY_ANALOG_RXTX2_TXMOD_SET(x) (((x) << 15) & 0x00038000) -#define PHY_ANALOG_RXTX2_TXMOD_OVR_MSB 18 -#define PHY_ANALOG_RXTX2_TXMOD_OVR_LSB 18 -#define PHY_ANALOG_RXTX2_TXMOD_OVR_MASK 0x00040000 -#define PHY_ANALOG_RXTX2_TXMOD_OVR_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_RXTX2_TXMOD_OVR_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_RXTX2_RX1DB_BIQUAD_MSB 21 -#define PHY_ANALOG_RXTX2_RX1DB_BIQUAD_LSB 19 -#define PHY_ANALOG_RXTX2_RX1DB_BIQUAD_MASK 0x00380000 -#define PHY_ANALOG_RXTX2_RX1DB_BIQUAD_GET(x) (((x) & 0x00380000) >> 19) -#define PHY_ANALOG_RXTX2_RX1DB_BIQUAD_SET(x) (((x) << 19) & 0x00380000) -#define PHY_ANALOG_RXTX2_RX6DB_BIQUAD_MSB 23 -#define PHY_ANALOG_RXTX2_RX6DB_BIQUAD_LSB 22 -#define PHY_ANALOG_RXTX2_RX6DB_BIQUAD_MASK 0x00c00000 -#define PHY_ANALOG_RXTX2_RX6DB_BIQUAD_GET(x) (((x) & 0x00c00000) >> 22) -#define PHY_ANALOG_RXTX2_RX6DB_BIQUAD_SET(x) (((x) << 22) & 0x00c00000) -#define PHY_ANALOG_RXTX2_MXRGAIN_MSB 25 -#define PHY_ANALOG_RXTX2_MXRGAIN_LSB 24 -#define PHY_ANALOG_RXTX2_MXRGAIN_MASK 0x03000000 -#define PHY_ANALOG_RXTX2_MXRGAIN_GET(x) (((x) & 0x03000000) >> 24) -#define PHY_ANALOG_RXTX2_MXRGAIN_SET(x) (((x) << 24) & 0x03000000) -#define PHY_ANALOG_RXTX2_VGAGAIN_MSB 28 -#define PHY_ANALOG_RXTX2_VGAGAIN_LSB 26 -#define PHY_ANALOG_RXTX2_VGAGAIN_MASK 0x1c000000 -#define PHY_ANALOG_RXTX2_VGAGAIN_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_ANALOG_RXTX2_VGAGAIN_SET(x) (((x) << 26) & 0x1c000000) -#define PHY_ANALOG_RXTX2_LNAGAIN_MSB 31 -#define PHY_ANALOG_RXTX2_LNAGAIN_LSB 29 -#define PHY_ANALOG_RXTX2_LNAGAIN_MASK 0xe0000000 -#define PHY_ANALOG_RXTX2_LNAGAIN_GET(x) (((x) & 0xe0000000) >> 29) -#define PHY_ANALOG_RXTX2_LNAGAIN_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for RXTX3 */ -#define PHY_ANALOG_RXTX3_ADDRESS 0x00000108 -#define PHY_ANALOG_RXTX3_OFFSET 0x00000108 -#define PHY_ANALOG_RXTX3_SPARE3_MSB 2 -#define PHY_ANALOG_RXTX3_SPARE3_LSB 0 -#define PHY_ANALOG_RXTX3_SPARE3_MASK 0x00000007 -#define PHY_ANALOG_RXTX3_SPARE3_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_RXTX3_SPARE3_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_RXTX3_SPURON_MSB 3 -#define PHY_ANALOG_RXTX3_SPURON_LSB 3 -#define PHY_ANALOG_RXTX3_SPURON_MASK 0x00000008 -#define PHY_ANALOG_RXTX3_SPURON_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_RXTX3_SPURON_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_RXTX3_PAL_LOCKEDEN_MSB 4 -#define PHY_ANALOG_RXTX3_PAL_LOCKEDEN_LSB 4 -#define PHY_ANALOG_RXTX3_PAL_LOCKEDEN_MASK 0x00000010 -#define PHY_ANALOG_RXTX3_PAL_LOCKEDEN_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_RXTX3_PAL_LOCKEDEN_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_RXTX3_DACFULLSCALE_MSB 5 -#define PHY_ANALOG_RXTX3_DACFULLSCALE_LSB 5 -#define PHY_ANALOG_RXTX3_DACFULLSCALE_MASK 0x00000020 -#define PHY_ANALOG_RXTX3_DACFULLSCALE_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_RXTX3_DACFULLSCALE_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_RXTX3_ADCSHORT_MSB 6 -#define PHY_ANALOG_RXTX3_ADCSHORT_LSB 6 -#define PHY_ANALOG_RXTX3_ADCSHORT_MASK 0x00000040 -#define PHY_ANALOG_RXTX3_ADCSHORT_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_RXTX3_ADCSHORT_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_RXTX3_DACPWD_MSB 7 -#define PHY_ANALOG_RXTX3_DACPWD_LSB 7 -#define PHY_ANALOG_RXTX3_DACPWD_MASK 0x00000080 -#define PHY_ANALOG_RXTX3_DACPWD_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RXTX3_DACPWD_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RXTX3_DACPWD_OVR_MSB 8 -#define PHY_ANALOG_RXTX3_DACPWD_OVR_LSB 8 -#define PHY_ANALOG_RXTX3_DACPWD_OVR_MASK 0x00000100 -#define PHY_ANALOG_RXTX3_DACPWD_OVR_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_RXTX3_DACPWD_OVR_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_RXTX3_ADCPWD_MSB 9 -#define PHY_ANALOG_RXTX3_ADCPWD_LSB 9 -#define PHY_ANALOG_RXTX3_ADCPWD_MASK 0x00000200 -#define PHY_ANALOG_RXTX3_ADCPWD_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_RXTX3_ADCPWD_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_RXTX3_ADCPWD_OVR_MSB 10 -#define PHY_ANALOG_RXTX3_ADCPWD_OVR_LSB 10 -#define PHY_ANALOG_RXTX3_ADCPWD_OVR_MASK 0x00000400 -#define PHY_ANALOG_RXTX3_ADCPWD_OVR_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_RXTX3_ADCPWD_OVR_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_RXTX3_AGC_CALDAC_MSB 16 -#define PHY_ANALOG_RXTX3_AGC_CALDAC_LSB 11 -#define PHY_ANALOG_RXTX3_AGC_CALDAC_MASK 0x0001f800 -#define PHY_ANALOG_RXTX3_AGC_CALDAC_GET(x) (((x) & 0x0001f800) >> 11) -#define PHY_ANALOG_RXTX3_AGC_CALDAC_SET(x) (((x) << 11) & 0x0001f800) -#define PHY_ANALOG_RXTX3_AGC_CAL_MSB 17 -#define PHY_ANALOG_RXTX3_AGC_CAL_LSB 17 -#define PHY_ANALOG_RXTX3_AGC_CAL_MASK 0x00020000 -#define PHY_ANALOG_RXTX3_AGC_CAL_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_RXTX3_AGC_CAL_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_RXTX3_AGC_CAL_OVR_MSB 18 -#define PHY_ANALOG_RXTX3_AGC_CAL_OVR_LSB 18 -#define PHY_ANALOG_RXTX3_AGC_CAL_OVR_MASK 0x00040000 -#define PHY_ANALOG_RXTX3_AGC_CAL_OVR_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_RXTX3_AGC_CAL_OVR_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_RXTX3_LOFORCEDON_MSB 19 -#define PHY_ANALOG_RXTX3_LOFORCEDON_LSB 19 -#define PHY_ANALOG_RXTX3_LOFORCEDON_MASK 0x00080000 -#define PHY_ANALOG_RXTX3_LOFORCEDON_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_ANALOG_RXTX3_LOFORCEDON_SET(x) (((x) << 19) & 0x00080000) -#define PHY_ANALOG_RXTX3_CALRESIDUE_MSB 20 -#define PHY_ANALOG_RXTX3_CALRESIDUE_LSB 20 -#define PHY_ANALOG_RXTX3_CALRESIDUE_MASK 0x00100000 -#define PHY_ANALOG_RXTX3_CALRESIDUE_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_RXTX3_CALRESIDUE_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_RXTX3_CALRESIDUE_OVR_MSB 21 -#define PHY_ANALOG_RXTX3_CALRESIDUE_OVR_LSB 21 -#define PHY_ANALOG_RXTX3_CALRESIDUE_OVR_MASK 0x00200000 -#define PHY_ANALOG_RXTX3_CALRESIDUE_OVR_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_RXTX3_CALRESIDUE_OVR_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_RXTX3_CALFC_MSB 22 -#define PHY_ANALOG_RXTX3_CALFC_LSB 22 -#define PHY_ANALOG_RXTX3_CALFC_MASK 0x00400000 -#define PHY_ANALOG_RXTX3_CALFC_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_RXTX3_CALFC_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_RXTX3_CALFC_OVR_MSB 23 -#define PHY_ANALOG_RXTX3_CALFC_OVR_LSB 23 -#define PHY_ANALOG_RXTX3_CALFC_OVR_MASK 0x00800000 -#define PHY_ANALOG_RXTX3_CALFC_OVR_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_RXTX3_CALFC_OVR_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_RXTX3_CALTX_MSB 24 -#define PHY_ANALOG_RXTX3_CALTX_LSB 24 -#define PHY_ANALOG_RXTX3_CALTX_MASK 0x01000000 -#define PHY_ANALOG_RXTX3_CALTX_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_ANALOG_RXTX3_CALTX_SET(x) (((x) << 24) & 0x01000000) -#define PHY_ANALOG_RXTX3_CALTX_OVR_MSB 25 -#define PHY_ANALOG_RXTX3_CALTX_OVR_LSB 25 -#define PHY_ANALOG_RXTX3_CALTX_OVR_MASK 0x02000000 -#define PHY_ANALOG_RXTX3_CALTX_OVR_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_ANALOG_RXTX3_CALTX_OVR_SET(x) (((x) << 25) & 0x02000000) -#define PHY_ANALOG_RXTX3_CALTXSHIFT_MSB 26 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_LSB 26 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_MASK 0x04000000 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_RXTX3_CALTXSHIFT_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_RXTX3_CALTXSHIFT_OVR_MSB 27 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_OVR_LSB 27 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_OVR_MASK 0x08000000 -#define PHY_ANALOG_RXTX3_CALTXSHIFT_OVR_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_RXTX3_CALTXSHIFT_OVR_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_RXTX3_CALPA_MSB 28 -#define PHY_ANALOG_RXTX3_CALPA_LSB 28 -#define PHY_ANALOG_RXTX3_CALPA_MASK 0x10000000 -#define PHY_ANALOG_RXTX3_CALPA_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_RXTX3_CALPA_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_RXTX3_CALPA_OVR_MSB 29 -#define PHY_ANALOG_RXTX3_CALPA_OVR_LSB 29 -#define PHY_ANALOG_RXTX3_CALPA_OVR_MASK 0x20000000 -#define PHY_ANALOG_RXTX3_CALPA_OVR_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_RXTX3_CALPA_OVR_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_RXTX3_TURBOADC_MSB 30 -#define PHY_ANALOG_RXTX3_TURBOADC_LSB 30 -#define PHY_ANALOG_RXTX3_TURBOADC_MASK 0x40000000 -#define PHY_ANALOG_RXTX3_TURBOADC_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_RXTX3_TURBOADC_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_RXTX3_TURBOADC_OVR_MSB 31 -#define PHY_ANALOG_RXTX3_TURBOADC_OVR_LSB 31 -#define PHY_ANALOG_RXTX3_TURBOADC_OVR_MASK 0x80000000 -#define PHY_ANALOG_RXTX3_TURBOADC_OVR_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_RXTX3_TURBOADC_OVR_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB1 */ -#define PHY_ANALOG_BB1_ADDRESS 0x00000140 -#define PHY_ANALOG_BB1_OFFSET 0x00000140 -#define PHY_ANALOG_BB1_I2V_CURR2X_MSB 0 -#define PHY_ANALOG_BB1_I2V_CURR2X_LSB 0 -#define PHY_ANALOG_BB1_I2V_CURR2X_MASK 0x00000001 -#define PHY_ANALOG_BB1_I2V_CURR2X_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_BB1_I2V_CURR2X_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_BB1_ENABLE_LOQ_MSB 1 -#define PHY_ANALOG_BB1_ENABLE_LOQ_LSB 1 -#define PHY_ANALOG_BB1_ENABLE_LOQ_MASK 0x00000002 -#define PHY_ANALOG_BB1_ENABLE_LOQ_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_BB1_ENABLE_LOQ_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_BB1_FORCE_LOQ_MSB 2 -#define PHY_ANALOG_BB1_FORCE_LOQ_LSB 2 -#define PHY_ANALOG_BB1_FORCE_LOQ_MASK 0x00000004 -#define PHY_ANALOG_BB1_FORCE_LOQ_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_BB1_FORCE_LOQ_SET(x) (((x) << 2) & 0x00000004) -#define PHY_ANALOG_BB1_ENABLE_NOTCH_MSB 3 -#define PHY_ANALOG_BB1_ENABLE_NOTCH_LSB 3 -#define PHY_ANALOG_BB1_ENABLE_NOTCH_MASK 0x00000008 -#define PHY_ANALOG_BB1_ENABLE_NOTCH_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_BB1_ENABLE_NOTCH_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_BB1_FORCE_NOTCH_MSB 4 -#define PHY_ANALOG_BB1_FORCE_NOTCH_LSB 4 -#define PHY_ANALOG_BB1_FORCE_NOTCH_MASK 0x00000010 -#define PHY_ANALOG_BB1_FORCE_NOTCH_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_BB1_FORCE_NOTCH_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_BB1_ENABLE_BIQUAD_MSB 5 -#define PHY_ANALOG_BB1_ENABLE_BIQUAD_LSB 5 -#define PHY_ANALOG_BB1_ENABLE_BIQUAD_MASK 0x00000020 -#define PHY_ANALOG_BB1_ENABLE_BIQUAD_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_BB1_ENABLE_BIQUAD_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_BB1_FORCE_BIQUAD_MSB 6 -#define PHY_ANALOG_BB1_FORCE_BIQUAD_LSB 6 -#define PHY_ANALOG_BB1_FORCE_BIQUAD_MASK 0x00000040 -#define PHY_ANALOG_BB1_FORCE_BIQUAD_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_BB1_FORCE_BIQUAD_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_BB1_ENABLE_OSDAC_MSB 7 -#define PHY_ANALOG_BB1_ENABLE_OSDAC_LSB 7 -#define PHY_ANALOG_BB1_ENABLE_OSDAC_MASK 0x00000080 -#define PHY_ANALOG_BB1_ENABLE_OSDAC_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_BB1_ENABLE_OSDAC_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_BB1_FORCE_OSDAC_MSB 8 -#define PHY_ANALOG_BB1_FORCE_OSDAC_LSB 8 -#define PHY_ANALOG_BB1_FORCE_OSDAC_MASK 0x00000100 -#define PHY_ANALOG_BB1_FORCE_OSDAC_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_BB1_FORCE_OSDAC_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_BB1_ENABLE_V2I_MSB 9 -#define PHY_ANALOG_BB1_ENABLE_V2I_LSB 9 -#define PHY_ANALOG_BB1_ENABLE_V2I_MASK 0x00000200 -#define PHY_ANALOG_BB1_ENABLE_V2I_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_BB1_ENABLE_V2I_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_BB1_FORCE_V2I_MSB 10 -#define PHY_ANALOG_BB1_FORCE_V2I_LSB 10 -#define PHY_ANALOG_BB1_FORCE_V2I_MASK 0x00000400 -#define PHY_ANALOG_BB1_FORCE_V2I_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_BB1_FORCE_V2I_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_BB1_ENABLE_I2V_MSB 11 -#define PHY_ANALOG_BB1_ENABLE_I2V_LSB 11 -#define PHY_ANALOG_BB1_ENABLE_I2V_MASK 0x00000800 -#define PHY_ANALOG_BB1_ENABLE_I2V_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_BB1_ENABLE_I2V_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_BB1_FORCE_I2V_MSB 12 -#define PHY_ANALOG_BB1_FORCE_I2V_LSB 12 -#define PHY_ANALOG_BB1_FORCE_I2V_MASK 0x00001000 -#define PHY_ANALOG_BB1_FORCE_I2V_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_BB1_FORCE_I2V_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_BB1_CMSEL_MSB 15 -#define PHY_ANALOG_BB1_CMSEL_LSB 13 -#define PHY_ANALOG_BB1_CMSEL_MASK 0x0000e000 -#define PHY_ANALOG_BB1_CMSEL_GET(x) (((x) & 0x0000e000) >> 13) -#define PHY_ANALOG_BB1_CMSEL_SET(x) (((x) << 13) & 0x0000e000) -#define PHY_ANALOG_BB1_ATBSEL_MSB 17 -#define PHY_ANALOG_BB1_ATBSEL_LSB 16 -#define PHY_ANALOG_BB1_ATBSEL_MASK 0x00030000 -#define PHY_ANALOG_BB1_ATBSEL_GET(x) (((x) & 0x00030000) >> 16) -#define PHY_ANALOG_BB1_ATBSEL_SET(x) (((x) << 16) & 0x00030000) -#define PHY_ANALOG_BB1_PD_OSDAC_CALTX_CALPA_MSB 18 -#define PHY_ANALOG_BB1_PD_OSDAC_CALTX_CALPA_LSB 18 -#define PHY_ANALOG_BB1_PD_OSDAC_CALTX_CALPA_MASK 0x00040000 -#define PHY_ANALOG_BB1_PD_OSDAC_CALTX_CALPA_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_BB1_PD_OSDAC_CALTX_CALPA_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_BB1_OFSTCORRI2VQ_MSB 23 -#define PHY_ANALOG_BB1_OFSTCORRI2VQ_LSB 19 -#define PHY_ANALOG_BB1_OFSTCORRI2VQ_MASK 0x00f80000 -#define PHY_ANALOG_BB1_OFSTCORRI2VQ_GET(x) (((x) & 0x00f80000) >> 19) -#define PHY_ANALOG_BB1_OFSTCORRI2VQ_SET(x) (((x) << 19) & 0x00f80000) -#define PHY_ANALOG_BB1_OFSTCORRI2VI_MSB 28 -#define PHY_ANALOG_BB1_OFSTCORRI2VI_LSB 24 -#define PHY_ANALOG_BB1_OFSTCORRI2VI_MASK 0x1f000000 -#define PHY_ANALOG_BB1_OFSTCORRI2VI_GET(x) (((x) & 0x1f000000) >> 24) -#define PHY_ANALOG_BB1_OFSTCORRI2VI_SET(x) (((x) << 24) & 0x1f000000) -#define PHY_ANALOG_BB1_LOCALOFFSET_MSB 29 -#define PHY_ANALOG_BB1_LOCALOFFSET_LSB 29 -#define PHY_ANALOG_BB1_LOCALOFFSET_MASK 0x20000000 -#define PHY_ANALOG_BB1_LOCALOFFSET_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_BB1_LOCALOFFSET_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_BB1_RANGE_OSDAC_MSB 31 -#define PHY_ANALOG_BB1_RANGE_OSDAC_LSB 30 -#define PHY_ANALOG_BB1_RANGE_OSDAC_MASK 0xc0000000 -#define PHY_ANALOG_BB1_RANGE_OSDAC_GET(x) (((x) & 0xc0000000) >> 30) -#define PHY_ANALOG_BB1_RANGE_OSDAC_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for BB2 */ -#define PHY_ANALOG_BB2_ADDRESS 0x00000144 -#define PHY_ANALOG_BB2_OFFSET 0x00000144 -#define PHY_ANALOG_BB2_SPARE_MSB 3 -#define PHY_ANALOG_BB2_SPARE_LSB 0 -#define PHY_ANALOG_BB2_SPARE_MASK 0x0000000f -#define PHY_ANALOG_BB2_SPARE_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_BB2_SPARE_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_ANALOG_BB2_MXR_HIGHGAINMASK_MSB 7 -#define PHY_ANALOG_BB2_MXR_HIGHGAINMASK_LSB 4 -#define PHY_ANALOG_BB2_MXR_HIGHGAINMASK_MASK 0x000000f0 -#define PHY_ANALOG_BB2_MXR_HIGHGAINMASK_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_ANALOG_BB2_MXR_HIGHGAINMASK_SET(x) (((x) << 4) & 0x000000f0) -#define PHY_ANALOG_BB2_SEL_TEST_MSB 9 -#define PHY_ANALOG_BB2_SEL_TEST_LSB 8 -#define PHY_ANALOG_BB2_SEL_TEST_MASK 0x00000300 -#define PHY_ANALOG_BB2_SEL_TEST_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_ANALOG_BB2_SEL_TEST_SET(x) (((x) << 8) & 0x00000300) -#define PHY_ANALOG_BB2_RCFILTER_CAP_MSB 14 -#define PHY_ANALOG_BB2_RCFILTER_CAP_LSB 10 -#define PHY_ANALOG_BB2_RCFILTER_CAP_MASK 0x00007c00 -#define PHY_ANALOG_BB2_RCFILTER_CAP_GET(x) (((x) & 0x00007c00) >> 10) -#define PHY_ANALOG_BB2_RCFILTER_CAP_SET(x) (((x) << 10) & 0x00007c00) -#define PHY_ANALOG_BB2_OVERRIDE_RCFILTER_CAP_MSB 15 -#define PHY_ANALOG_BB2_OVERRIDE_RCFILTER_CAP_LSB 15 -#define PHY_ANALOG_BB2_OVERRIDE_RCFILTER_CAP_MASK 0x00008000 -#define PHY_ANALOG_BB2_OVERRIDE_RCFILTER_CAP_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_BB2_OVERRIDE_RCFILTER_CAP_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_BB2_FNOTCH_MSB 19 -#define PHY_ANALOG_BB2_FNOTCH_LSB 16 -#define PHY_ANALOG_BB2_FNOTCH_MASK 0x000f0000 -#define PHY_ANALOG_BB2_FNOTCH_GET(x) (((x) & 0x000f0000) >> 16) -#define PHY_ANALOG_BB2_FNOTCH_SET(x) (((x) << 16) & 0x000f0000) -#define PHY_ANALOG_BB2_OVERRIDE_FNOTCH_MSB 20 -#define PHY_ANALOG_BB2_OVERRIDE_FNOTCH_LSB 20 -#define PHY_ANALOG_BB2_OVERRIDE_FNOTCH_MASK 0x00100000 -#define PHY_ANALOG_BB2_OVERRIDE_FNOTCH_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_BB2_OVERRIDE_FNOTCH_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_BB2_FILTERFC_MSB 25 -#define PHY_ANALOG_BB2_FILTERFC_LSB 21 -#define PHY_ANALOG_BB2_FILTERFC_MASK 0x03e00000 -#define PHY_ANALOG_BB2_FILTERFC_GET(x) (((x) & 0x03e00000) >> 21) -#define PHY_ANALOG_BB2_FILTERFC_SET(x) (((x) << 21) & 0x03e00000) -#define PHY_ANALOG_BB2_OVERRIDE_FILTERFC_MSB 26 -#define PHY_ANALOG_BB2_OVERRIDE_FILTERFC_LSB 26 -#define PHY_ANALOG_BB2_OVERRIDE_FILTERFC_MASK 0x04000000 -#define PHY_ANALOG_BB2_OVERRIDE_FILTERFC_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_BB2_OVERRIDE_FILTERFC_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_BB2_I2V2RXOUT_EN_MSB 27 -#define PHY_ANALOG_BB2_I2V2RXOUT_EN_LSB 27 -#define PHY_ANALOG_BB2_I2V2RXOUT_EN_MASK 0x08000000 -#define PHY_ANALOG_BB2_I2V2RXOUT_EN_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_BB2_I2V2RXOUT_EN_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_BB2_BQ2RXOUT_EN_MSB 28 -#define PHY_ANALOG_BB2_BQ2RXOUT_EN_LSB 28 -#define PHY_ANALOG_BB2_BQ2RXOUT_EN_MASK 0x10000000 -#define PHY_ANALOG_BB2_BQ2RXOUT_EN_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_BB2_BQ2RXOUT_EN_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_BB2_RXIN2I2V_EN_MSB 29 -#define PHY_ANALOG_BB2_RXIN2I2V_EN_LSB 29 -#define PHY_ANALOG_BB2_RXIN2I2V_EN_MASK 0x20000000 -#define PHY_ANALOG_BB2_RXIN2I2V_EN_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_BB2_RXIN2I2V_EN_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_BB2_RXIN2BQ_EN_MSB 30 -#define PHY_ANALOG_BB2_RXIN2BQ_EN_LSB 30 -#define PHY_ANALOG_BB2_RXIN2BQ_EN_MASK 0x40000000 -#define PHY_ANALOG_BB2_RXIN2BQ_EN_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_BB2_RXIN2BQ_EN_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_BB2_SWITCH_OVERRIDE_MSB 31 -#define PHY_ANALOG_BB2_SWITCH_OVERRIDE_LSB 31 -#define PHY_ANALOG_BB2_SWITCH_OVERRIDE_MASK 0x80000000 -#define PHY_ANALOG_BB2_SWITCH_OVERRIDE_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_BB2_SWITCH_OVERRIDE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for BB3 */ -#define PHY_ANALOG_BB3_ADDRESS 0x00000148 -#define PHY_ANALOG_BB3_OFFSET 0x00000148 -#define PHY_ANALOG_BB3_SPARE_MSB 7 -#define PHY_ANALOG_BB3_SPARE_LSB 0 -#define PHY_ANALOG_BB3_SPARE_MASK 0x000000ff -#define PHY_ANALOG_BB3_SPARE_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_ANALOG_BB3_SPARE_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_ANALOG_BB3_SEL_OFST_READBK_MSB 9 -#define PHY_ANALOG_BB3_SEL_OFST_READBK_LSB 8 -#define PHY_ANALOG_BB3_SEL_OFST_READBK_MASK 0x00000300 -#define PHY_ANALOG_BB3_SEL_OFST_READBK_GET(x) (((x) & 0x00000300) >> 8) -#define PHY_ANALOG_BB3_SEL_OFST_READBK_SET(x) (((x) << 8) & 0x00000300) -#define PHY_ANALOG_BB3_OVERRIDE_RXONLY_FILTERFC_MSB 10 -#define PHY_ANALOG_BB3_OVERRIDE_RXONLY_FILTERFC_LSB 10 -#define PHY_ANALOG_BB3_OVERRIDE_RXONLY_FILTERFC_MASK 0x00000400 -#define PHY_ANALOG_BB3_OVERRIDE_RXONLY_FILTERFC_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_BB3_OVERRIDE_RXONLY_FILTERFC_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_BB3_RXONLY_FILTERFC_MSB 15 -#define PHY_ANALOG_BB3_RXONLY_FILTERFC_LSB 11 -#define PHY_ANALOG_BB3_RXONLY_FILTERFC_MASK 0x0000f800 -#define PHY_ANALOG_BB3_RXONLY_FILTERFC_GET(x) (((x) & 0x0000f800) >> 11) -#define PHY_ANALOG_BB3_RXONLY_FILTERFC_SET(x) (((x) << 11) & 0x0000f800) -#define PHY_ANALOG_BB3_FILTERFC_MSB 20 -#define PHY_ANALOG_BB3_FILTERFC_LSB 16 -#define PHY_ANALOG_BB3_FILTERFC_MASK 0x001f0000 -#define PHY_ANALOG_BB3_FILTERFC_GET(x) (((x) & 0x001f0000) >> 16) -#define PHY_ANALOG_BB3_OFSTCORRI2VQ_MSB 25 -#define PHY_ANALOG_BB3_OFSTCORRI2VQ_LSB 21 -#define PHY_ANALOG_BB3_OFSTCORRI2VQ_MASK 0x03e00000 -#define PHY_ANALOG_BB3_OFSTCORRI2VQ_GET(x) (((x) & 0x03e00000) >> 21) -#define PHY_ANALOG_BB3_OFSTCORRI2VI_MSB 30 -#define PHY_ANALOG_BB3_OFSTCORRI2VI_LSB 26 -#define PHY_ANALOG_BB3_OFSTCORRI2VI_MASK 0x7c000000 -#define PHY_ANALOG_BB3_OFSTCORRI2VI_GET(x) (((x) & 0x7c000000) >> 26) -#define PHY_ANALOG_BB3_EN_TXBBCONSTCUR_MSB 31 -#define PHY_ANALOG_BB3_EN_TXBBCONSTCUR_LSB 31 -#define PHY_ANALOG_BB3_EN_TXBBCONSTCUR_MASK 0x80000000 -#define PHY_ANALOG_BB3_EN_TXBBCONSTCUR_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_BB3_EN_TXBBCONSTCUR_SET(x) (((x) << 31) & 0x80000000) - -/* macros for PLLCLKMODA */ -#define PHY_ANALOG_PLLCLKMODA_ADDRESS 0x00000280 -#define PHY_ANALOG_PLLCLKMODA_OFFSET 0x00000280 -#define PHY_ANALOG_PLLCLKMODA_PWD_PLLSDM_MSB 0 -#define PHY_ANALOG_PLLCLKMODA_PWD_PLLSDM_LSB 0 -#define PHY_ANALOG_PLLCLKMODA_PWD_PLLSDM_MASK 0x00000001 -#define PHY_ANALOG_PLLCLKMODA_PWD_PLLSDM_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_PLLCLKMODA_PWD_PLLSDM_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_PLLCLKMODA_PWDPLL_MSB 1 -#define PHY_ANALOG_PLLCLKMODA_PWDPLL_LSB 1 -#define PHY_ANALOG_PLLCLKMODA_PWDPLL_MASK 0x00000002 -#define PHY_ANALOG_PLLCLKMODA_PWDPLL_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_PLLCLKMODA_PWDPLL_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_PLLCLKMODA_PLLFRAC_MSB 16 -#define PHY_ANALOG_PLLCLKMODA_PLLFRAC_LSB 2 -#define PHY_ANALOG_PLLCLKMODA_PLLFRAC_MASK 0x0001fffc -#define PHY_ANALOG_PLLCLKMODA_PLLFRAC_GET(x) (((x) & 0x0001fffc) >> 2) -#define PHY_ANALOG_PLLCLKMODA_PLLFRAC_SET(x) (((x) << 2) & 0x0001fffc) -#define PHY_ANALOG_PLLCLKMODA_REFDIV_MSB 20 -#define PHY_ANALOG_PLLCLKMODA_REFDIV_LSB 17 -#define PHY_ANALOG_PLLCLKMODA_REFDIV_MASK 0x001e0000 -#define PHY_ANALOG_PLLCLKMODA_REFDIV_GET(x) (((x) & 0x001e0000) >> 17) -#define PHY_ANALOG_PLLCLKMODA_REFDIV_SET(x) (((x) << 17) & 0x001e0000) -#define PHY_ANALOG_PLLCLKMODA_DIV_MSB 30 -#define PHY_ANALOG_PLLCLKMODA_DIV_LSB 21 -#define PHY_ANALOG_PLLCLKMODA_DIV_MASK 0x7fe00000 -#define PHY_ANALOG_PLLCLKMODA_DIV_GET(x) (((x) & 0x7fe00000) >> 21) -#define PHY_ANALOG_PLLCLKMODA_DIV_SET(x) (((x) << 21) & 0x7fe00000) -#define PHY_ANALOG_PLLCLKMODA_LOCAL_PLL_MSB 31 -#define PHY_ANALOG_PLLCLKMODA_LOCAL_PLL_LSB 31 -#define PHY_ANALOG_PLLCLKMODA_LOCAL_PLL_MASK 0x80000000 -#define PHY_ANALOG_PLLCLKMODA_LOCAL_PLL_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_PLLCLKMODA_LOCAL_PLL_SET(x) (((x) << 31) & 0x80000000) - -/* macros for PLLCLKMODA2 */ -#define PHY_ANALOG_PLLCLKMODA2_ADDRESS 0x00000284 -#define PHY_ANALOG_PLLCLKMODA2_OFFSET 0x00000284 -#define PHY_ANALOG_PLLCLKMODA2_SPARE_MSB 3 -#define PHY_ANALOG_PLLCLKMODA2_SPARE_LSB 0 -#define PHY_ANALOG_PLLCLKMODA2_SPARE_MASK 0x0000000f -#define PHY_ANALOG_PLLCLKMODA2_SPARE_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_PLLCLKMODA2_SPARE_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_ANALOG_PLLCLKMODA2_DACPWD_MSB 4 -#define PHY_ANALOG_PLLCLKMODA2_DACPWD_LSB 4 -#define PHY_ANALOG_PLLCLKMODA2_DACPWD_MASK 0x00000010 -#define PHY_ANALOG_PLLCLKMODA2_DACPWD_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_PLLCLKMODA2_DACPWD_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_PLLCLKMODA2_ADCPWD_MSB 5 -#define PHY_ANALOG_PLLCLKMODA2_ADCPWD_LSB 5 -#define PHY_ANALOG_PLLCLKMODA2_ADCPWD_MASK 0x00000020 -#define PHY_ANALOG_PLLCLKMODA2_ADCPWD_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_PLLCLKMODA2_ADCPWD_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_ADDAC_MSB 6 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_ADDAC_LSB 6 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_ADDAC_MASK 0x00000040 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_ADDAC_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_ADDAC_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_PLLCLKMODA2_DAC_CLK_SEL_MSB 8 -#define PHY_ANALOG_PLLCLKMODA2_DAC_CLK_SEL_LSB 7 -#define PHY_ANALOG_PLLCLKMODA2_DAC_CLK_SEL_MASK 0x00000180 -#define PHY_ANALOG_PLLCLKMODA2_DAC_CLK_SEL_GET(x) (((x) & 0x00000180) >> 7) -#define PHY_ANALOG_PLLCLKMODA2_DAC_CLK_SEL_SET(x) (((x) << 7) & 0x00000180) -#define PHY_ANALOG_PLLCLKMODA2_ADC_CLK_SEL_MSB 12 -#define PHY_ANALOG_PLLCLKMODA2_ADC_CLK_SEL_LSB 9 -#define PHY_ANALOG_PLLCLKMODA2_ADC_CLK_SEL_MASK 0x00001e00 -#define PHY_ANALOG_PLLCLKMODA2_ADC_CLK_SEL_GET(x) (((x) & 0x00001e00) >> 9) -#define PHY_ANALOG_PLLCLKMODA2_ADC_CLK_SEL_SET(x) (((x) << 9) & 0x00001e00) -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_CLKMODA_MSB 13 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_CLKMODA_LSB 13 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_CLKMODA_MASK 0x00002000 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_CLKMODA_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_CLKMODA_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_PLLCLKMODA2_PLLBYPASS_MSB 14 -#define PHY_ANALOG_PLLCLKMODA2_PLLBYPASS_LSB 14 -#define PHY_ANALOG_PLLCLKMODA2_PLLBYPASS_MASK 0x00004000 -#define PHY_ANALOG_PLLCLKMODA2_PLLBYPASS_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_PLLCLKMODA2_PLLBYPASS_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_PLLBYPASS_MSB 15 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_PLLBYPASS_LSB 15 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_PLLBYPASS_MASK 0x00008000 -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_PLLBYPASS_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_PLLCLKMODA2_LOCAL_PLLBYPASS_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_PLLCLKMODA2_PLLATB_MSB 17 -#define PHY_ANALOG_PLLCLKMODA2_PLLATB_LSB 16 -#define PHY_ANALOG_PLLCLKMODA2_PLLATB_MASK 0x00030000 -#define PHY_ANALOG_PLLCLKMODA2_PLLATB_GET(x) (((x) & 0x00030000) >> 16) -#define PHY_ANALOG_PLLCLKMODA2_PLLATB_SET(x) (((x) << 16) & 0x00030000) -#define PHY_ANALOG_PLLCLKMODA2_PLL_SVREG_MSB 18 -#define PHY_ANALOG_PLLCLKMODA2_PLL_SVREG_LSB 18 -#define PHY_ANALOG_PLLCLKMODA2_PLL_SVREG_MASK 0x00040000 -#define PHY_ANALOG_PLLCLKMODA2_PLL_SVREG_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_PLLCLKMODA2_PLL_SVREG_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_PLLCLKMODA2_HI_FREQ_EN_MSB 19 -#define PHY_ANALOG_PLLCLKMODA2_HI_FREQ_EN_LSB 19 -#define PHY_ANALOG_PLLCLKMODA2_HI_FREQ_EN_MASK 0x00080000 -#define PHY_ANALOG_PLLCLKMODA2_HI_FREQ_EN_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_ANALOG_PLLCLKMODA2_HI_FREQ_EN_SET(x) (((x) << 19) & 0x00080000) -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_INT_L_MSB 20 -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_INT_L_LSB 20 -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_INT_L_MASK 0x00100000 -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_INT_L_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_INT_L_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_OVR_MSB 21 -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_OVR_LSB 21 -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_OVR_MASK 0x00200000 -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_OVR_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_PLLCLKMODA2_RST_WARM_OVR_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_PLLCLKMODA2_PLL_KVCO_MSB 23 -#define PHY_ANALOG_PLLCLKMODA2_PLL_KVCO_LSB 22 -#define PHY_ANALOG_PLLCLKMODA2_PLL_KVCO_MASK 0x00c00000 -#define PHY_ANALOG_PLLCLKMODA2_PLL_KVCO_GET(x) (((x) & 0x00c00000) >> 22) -#define PHY_ANALOG_PLLCLKMODA2_PLL_KVCO_SET(x) (((x) << 22) & 0x00c00000) -#define PHY_ANALOG_PLLCLKMODA2_PLLICP_MSB 26 -#define PHY_ANALOG_PLLCLKMODA2_PLLICP_LSB 24 -#define PHY_ANALOG_PLLCLKMODA2_PLLICP_MASK 0x07000000 -#define PHY_ANALOG_PLLCLKMODA2_PLLICP_GET(x) (((x) & 0x07000000) >> 24) -#define PHY_ANALOG_PLLCLKMODA2_PLLICP_SET(x) (((x) << 24) & 0x07000000) -#define PHY_ANALOG_PLLCLKMODA2_PLLFILTER_MSB 31 -#define PHY_ANALOG_PLLCLKMODA2_PLLFILTER_LSB 27 -#define PHY_ANALOG_PLLCLKMODA2_PLLFILTER_MASK 0xf8000000 -#define PHY_ANALOG_PLLCLKMODA2_PLLFILTER_GET(x) (((x) & 0xf8000000) >> 27) -#define PHY_ANALOG_PLLCLKMODA2_PLLFILTER_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for TOP */ -#define PHY_ANALOG_TOP_ADDRESS 0x00000288 -#define PHY_ANALOG_TOP_OFFSET 0x00000288 -#define PHY_ANALOG_TOP_SPARE_MSB 2 -#define PHY_ANALOG_TOP_SPARE_LSB 0 -#define PHY_ANALOG_TOP_SPARE_MASK 0x00000007 -#define PHY_ANALOG_TOP_SPARE_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_TOP_SPARE_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_TOP_PWDBIAS_MSB 3 -#define PHY_ANALOG_TOP_PWDBIAS_LSB 3 -#define PHY_ANALOG_TOP_PWDBIAS_MASK 0x00000008 -#define PHY_ANALOG_TOP_PWDBIAS_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_TOP_PWDBIAS_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_TOP_FLIP_XPABIAS_MSB 4 -#define PHY_ANALOG_TOP_FLIP_XPABIAS_LSB 4 -#define PHY_ANALOG_TOP_FLIP_XPABIAS_MASK 0x00000010 -#define PHY_ANALOG_TOP_FLIP_XPABIAS_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_TOP_FLIP_XPABIAS_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_TOP_XPAON2_MSB 5 -#define PHY_ANALOG_TOP_XPAON2_LSB 5 -#define PHY_ANALOG_TOP_XPAON2_MASK 0x00000020 -#define PHY_ANALOG_TOP_XPAON2_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_TOP_XPAON2_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_TOP_XPAON5_MSB 6 -#define PHY_ANALOG_TOP_XPAON5_LSB 6 -#define PHY_ANALOG_TOP_XPAON5_MASK 0x00000040 -#define PHY_ANALOG_TOP_XPAON5_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_TOP_XPAON5_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_TOP_XPASHORT2GND_MSB 7 -#define PHY_ANALOG_TOP_XPASHORT2GND_LSB 7 -#define PHY_ANALOG_TOP_XPASHORT2GND_MASK 0x00000080 -#define PHY_ANALOG_TOP_XPASHORT2GND_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_TOP_XPASHORT2GND_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_TOP_XPABIASLVL_MSB 11 -#define PHY_ANALOG_TOP_XPABIASLVL_LSB 8 -#define PHY_ANALOG_TOP_XPABIASLVL_MASK 0x00000f00 -#define PHY_ANALOG_TOP_XPABIASLVL_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_TOP_XPABIASLVL_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_TOP_XPABIAS_EN_MSB 12 -#define PHY_ANALOG_TOP_XPABIAS_EN_LSB 12 -#define PHY_ANALOG_TOP_XPABIAS_EN_MASK 0x00001000 -#define PHY_ANALOG_TOP_XPABIAS_EN_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_TOP_XPABIAS_EN_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_TOP_ATBSELECT_MSB 13 -#define PHY_ANALOG_TOP_ATBSELECT_LSB 13 -#define PHY_ANALOG_TOP_ATBSELECT_MASK 0x00002000 -#define PHY_ANALOG_TOP_ATBSELECT_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_TOP_ATBSELECT_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_TOP_LOCAL_XPA_MSB 14 -#define PHY_ANALOG_TOP_LOCAL_XPA_LSB 14 -#define PHY_ANALOG_TOP_LOCAL_XPA_MASK 0x00004000 -#define PHY_ANALOG_TOP_LOCAL_XPA_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_TOP_LOCAL_XPA_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_TOP_XPABIAS_BYPASS_MSB 15 -#define PHY_ANALOG_TOP_XPABIAS_BYPASS_LSB 15 -#define PHY_ANALOG_TOP_XPABIAS_BYPASS_MASK 0x00008000 -#define PHY_ANALOG_TOP_XPABIAS_BYPASS_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_TOP_XPABIAS_BYPASS_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_TOP_TEST_PADQ_EN_MSB 16 -#define PHY_ANALOG_TOP_TEST_PADQ_EN_LSB 16 -#define PHY_ANALOG_TOP_TEST_PADQ_EN_MASK 0x00010000 -#define PHY_ANALOG_TOP_TEST_PADQ_EN_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_TOP_TEST_PADQ_EN_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_TOP_TEST_PADI_EN_MSB 17 -#define PHY_ANALOG_TOP_TEST_PADI_EN_LSB 17 -#define PHY_ANALOG_TOP_TEST_PADI_EN_MASK 0x00020000 -#define PHY_ANALOG_TOP_TEST_PADI_EN_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_TOP_TEST_PADI_EN_SET(x) (((x) << 17) & 0x00020000) -#define PHY_ANALOG_TOP_TESTIQ_RSEL_MSB 18 -#define PHY_ANALOG_TOP_TESTIQ_RSEL_LSB 18 -#define PHY_ANALOG_TOP_TESTIQ_RSEL_MASK 0x00040000 -#define PHY_ANALOG_TOP_TESTIQ_RSEL_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_ANALOG_TOP_TESTIQ_RSEL_SET(x) (((x) << 18) & 0x00040000) -#define PHY_ANALOG_TOP_TESTIQ_BUFEN_MSB 19 -#define PHY_ANALOG_TOP_TESTIQ_BUFEN_LSB 19 -#define PHY_ANALOG_TOP_TESTIQ_BUFEN_MASK 0x00080000 -#define PHY_ANALOG_TOP_TESTIQ_BUFEN_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_ANALOG_TOP_TESTIQ_BUFEN_SET(x) (((x) << 19) & 0x00080000) -#define PHY_ANALOG_TOP_PAD2GND_MSB 20 -#define PHY_ANALOG_TOP_PAD2GND_LSB 20 -#define PHY_ANALOG_TOP_PAD2GND_MASK 0x00100000 -#define PHY_ANALOG_TOP_PAD2GND_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_TOP_PAD2GND_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_TOP_INTH2PAD_MSB 21 -#define PHY_ANALOG_TOP_INTH2PAD_LSB 21 -#define PHY_ANALOG_TOP_INTH2PAD_MASK 0x00200000 -#define PHY_ANALOG_TOP_INTH2PAD_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_ANALOG_TOP_INTH2PAD_SET(x) (((x) << 21) & 0x00200000) -#define PHY_ANALOG_TOP_INTH2GND_MSB 22 -#define PHY_ANALOG_TOP_INTH2GND_LSB 22 -#define PHY_ANALOG_TOP_INTH2GND_MASK 0x00400000 -#define PHY_ANALOG_TOP_INTH2GND_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_TOP_INTH2GND_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_TOP_INT2PAD_MSB 23 -#define PHY_ANALOG_TOP_INT2PAD_LSB 23 -#define PHY_ANALOG_TOP_INT2PAD_MASK 0x00800000 -#define PHY_ANALOG_TOP_INT2PAD_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_TOP_INT2PAD_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_TOP_INT2GND_MSB 24 -#define PHY_ANALOG_TOP_INT2GND_LSB 24 -#define PHY_ANALOG_TOP_INT2GND_MASK 0x01000000 -#define PHY_ANALOG_TOP_INT2GND_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_ANALOG_TOP_INT2GND_SET(x) (((x) << 24) & 0x01000000) -#define PHY_ANALOG_TOP_PWDPALCLK_MSB 25 -#define PHY_ANALOG_TOP_PWDPALCLK_LSB 25 -#define PHY_ANALOG_TOP_PWDPALCLK_MASK 0x02000000 -#define PHY_ANALOG_TOP_PWDPALCLK_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_ANALOG_TOP_PWDPALCLK_SET(x) (((x) << 25) & 0x02000000) -#define PHY_ANALOG_TOP_INV_CLK320_ADC_MSB 26 -#define PHY_ANALOG_TOP_INV_CLK320_ADC_LSB 26 -#define PHY_ANALOG_TOP_INV_CLK320_ADC_MASK 0x04000000 -#define PHY_ANALOG_TOP_INV_CLK320_ADC_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_TOP_INV_CLK320_ADC_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_TOP_FLIP_REFCLK40_MSB 27 -#define PHY_ANALOG_TOP_FLIP_REFCLK40_LSB 27 -#define PHY_ANALOG_TOP_FLIP_REFCLK40_MASK 0x08000000 -#define PHY_ANALOG_TOP_FLIP_REFCLK40_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_TOP_FLIP_REFCLK40_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_TOP_FLIP_PLLCLK320_MSB 28 -#define PHY_ANALOG_TOP_FLIP_PLLCLK320_LSB 28 -#define PHY_ANALOG_TOP_FLIP_PLLCLK320_MASK 0x10000000 -#define PHY_ANALOG_TOP_FLIP_PLLCLK320_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_TOP_FLIP_PLLCLK320_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_TOP_FLIP_PLLCLK160_MSB 29 -#define PHY_ANALOG_TOP_FLIP_PLLCLK160_LSB 29 -#define PHY_ANALOG_TOP_FLIP_PLLCLK160_MASK 0x20000000 -#define PHY_ANALOG_TOP_FLIP_PLLCLK160_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_TOP_FLIP_PLLCLK160_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_TOP_CLK_SEL_MSB 31 -#define PHY_ANALOG_TOP_CLK_SEL_LSB 30 -#define PHY_ANALOG_TOP_CLK_SEL_MASK 0xc0000000 -#define PHY_ANALOG_TOP_CLK_SEL_GET(x) (((x) & 0xc0000000) >> 30) -#define PHY_ANALOG_TOP_CLK_SEL_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for THERM */ -#define PHY_ANALOG_THERM_ADDRESS 0x0000028c -#define PHY_ANALOG_THERM_OFFSET 0x0000028c -#define PHY_ANALOG_THERM_LOREG_LVL_MSB 2 -#define PHY_ANALOG_THERM_LOREG_LVL_LSB 0 -#define PHY_ANALOG_THERM_LOREG_LVL_MASK 0x00000007 -#define PHY_ANALOG_THERM_LOREG_LVL_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_ANALOG_THERM_LOREG_LVL_SET(x) (((x) << 0) & 0x00000007) -#define PHY_ANALOG_THERM_RFREG_LVL_MSB 5 -#define PHY_ANALOG_THERM_RFREG_LVL_LSB 3 -#define PHY_ANALOG_THERM_RFREG_LVL_MASK 0x00000038 -#define PHY_ANALOG_THERM_RFREG_LVL_GET(x) (((x) & 0x00000038) >> 3) -#define PHY_ANALOG_THERM_RFREG_LVL_SET(x) (((x) << 3) & 0x00000038) -#define PHY_ANALOG_THERM_SAR_ADC_DONE_MSB 6 -#define PHY_ANALOG_THERM_SAR_ADC_DONE_LSB 6 -#define PHY_ANALOG_THERM_SAR_ADC_DONE_MASK 0x00000040 -#define PHY_ANALOG_THERM_SAR_ADC_DONE_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_THERM_SAR_ADC_OUT_MSB 14 -#define PHY_ANALOG_THERM_SAR_ADC_OUT_LSB 7 -#define PHY_ANALOG_THERM_SAR_ADC_OUT_MASK 0x00007f80 -#define PHY_ANALOG_THERM_SAR_ADC_OUT_GET(x) (((x) & 0x00007f80) >> 7) -#define PHY_ANALOG_THERM_SAR_DACTEST_CODE_MSB 22 -#define PHY_ANALOG_THERM_SAR_DACTEST_CODE_LSB 15 -#define PHY_ANALOG_THERM_SAR_DACTEST_CODE_MASK 0x007f8000 -#define PHY_ANALOG_THERM_SAR_DACTEST_CODE_GET(x) (((x) & 0x007f8000) >> 15) -#define PHY_ANALOG_THERM_SAR_DACTEST_CODE_SET(x) (((x) << 15) & 0x007f8000) -#define PHY_ANALOG_THERM_SAR_DACTEST_EN_MSB 23 -#define PHY_ANALOG_THERM_SAR_DACTEST_EN_LSB 23 -#define PHY_ANALOG_THERM_SAR_DACTEST_EN_MASK 0x00800000 -#define PHY_ANALOG_THERM_SAR_DACTEST_EN_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_THERM_SAR_DACTEST_EN_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_THERM_SAR_ADCCAL_EN_MSB 24 -#define PHY_ANALOG_THERM_SAR_ADCCAL_EN_LSB 24 -#define PHY_ANALOG_THERM_SAR_ADCCAL_EN_MASK 0x01000000 -#define PHY_ANALOG_THERM_SAR_ADCCAL_EN_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_ANALOG_THERM_SAR_ADCCAL_EN_SET(x) (((x) << 24) & 0x01000000) -#define PHY_ANALOG_THERM_THERMSEL_MSB 26 -#define PHY_ANALOG_THERM_THERMSEL_LSB 25 -#define PHY_ANALOG_THERM_THERMSEL_MASK 0x06000000 -#define PHY_ANALOG_THERM_THERMSEL_GET(x) (((x) & 0x06000000) >> 25) -#define PHY_ANALOG_THERM_THERMSEL_SET(x) (((x) << 25) & 0x06000000) -#define PHY_ANALOG_THERM_SAR_SLOW_EN_MSB 27 -#define PHY_ANALOG_THERM_SAR_SLOW_EN_LSB 27 -#define PHY_ANALOG_THERM_SAR_SLOW_EN_MASK 0x08000000 -#define PHY_ANALOG_THERM_SAR_SLOW_EN_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_THERM_SAR_SLOW_EN_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_THERM_THERMSTART_MSB 28 -#define PHY_ANALOG_THERM_THERMSTART_LSB 28 -#define PHY_ANALOG_THERM_THERMSTART_MASK 0x10000000 -#define PHY_ANALOG_THERM_THERMSTART_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_THERM_THERMSTART_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_THERM_SAR_AUTOPWD_EN_MSB 29 -#define PHY_ANALOG_THERM_SAR_AUTOPWD_EN_LSB 29 -#define PHY_ANALOG_THERM_SAR_AUTOPWD_EN_MASK 0x20000000 -#define PHY_ANALOG_THERM_SAR_AUTOPWD_EN_GET(x) (((x) & 0x20000000) >> 29) -#define PHY_ANALOG_THERM_SAR_AUTOPWD_EN_SET(x) (((x) << 29) & 0x20000000) -#define PHY_ANALOG_THERM_THERMON_MSB 30 -#define PHY_ANALOG_THERM_THERMON_LSB 30 -#define PHY_ANALOG_THERM_THERMON_MASK 0x40000000 -#define PHY_ANALOG_THERM_THERMON_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_THERM_THERMON_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_THERM_LOCAL_THERM_MSB 31 -#define PHY_ANALOG_THERM_LOCAL_THERM_LSB 31 -#define PHY_ANALOG_THERM_LOCAL_THERM_MASK 0x80000000 -#define PHY_ANALOG_THERM_LOCAL_THERM_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_THERM_LOCAL_THERM_SET(x) (((x) << 31) & 0x80000000) - -/* macros for XTAL */ -#define PHY_ANALOG_XTAL_ADDRESS 0x00000290 -#define PHY_ANALOG_XTAL_OFFSET 0x00000290 -#define PHY_ANALOG_XTAL_SPARE_MSB 5 -#define PHY_ANALOG_XTAL_SPARE_LSB 0 -#define PHY_ANALOG_XTAL_SPARE_MASK 0x0000003f -#define PHY_ANALOG_XTAL_SPARE_GET(x) (((x) & 0x0000003f) >> 0) -#define PHY_ANALOG_XTAL_SPARE_SET(x) (((x) << 0) & 0x0000003f) -#define PHY_ANALOG_XTAL_XTAL_NOTCXODET_MSB 6 -#define PHY_ANALOG_XTAL_XTAL_NOTCXODET_LSB 6 -#define PHY_ANALOG_XTAL_XTAL_NOTCXODET_MASK 0x00000040 -#define PHY_ANALOG_XTAL_XTAL_NOTCXODET_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_XTAL_XTAL_NOTCXODET_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_XTAL_LOCALBIAS2X_MSB 7 -#define PHY_ANALOG_XTAL_LOCALBIAS2X_LSB 7 -#define PHY_ANALOG_XTAL_LOCALBIAS2X_MASK 0x00000080 -#define PHY_ANALOG_XTAL_LOCALBIAS2X_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_XTAL_LOCALBIAS2X_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_XTAL_LOCAL_XTAL_MSB 8 -#define PHY_ANALOG_XTAL_LOCAL_XTAL_LSB 8 -#define PHY_ANALOG_XTAL_LOCAL_XTAL_MASK 0x00000100 -#define PHY_ANALOG_XTAL_LOCAL_XTAL_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_XTAL_LOCAL_XTAL_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_XTAL_XTAL_PWDCLKIN_MSB 9 -#define PHY_ANALOG_XTAL_XTAL_PWDCLKIN_LSB 9 -#define PHY_ANALOG_XTAL_XTAL_PWDCLKIN_MASK 0x00000200 -#define PHY_ANALOG_XTAL_XTAL_PWDCLKIN_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_XTAL_XTAL_PWDCLKIN_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_XTAL_XTAL_OSCON_MSB 10 -#define PHY_ANALOG_XTAL_XTAL_OSCON_LSB 10 -#define PHY_ANALOG_XTAL_XTAL_OSCON_MASK 0x00000400 -#define PHY_ANALOG_XTAL_XTAL_OSCON_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_XTAL_XTAL_OSCON_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_XTAL_XTAL_PWDCLKD_MSB 11 -#define PHY_ANALOG_XTAL_XTAL_PWDCLKD_LSB 11 -#define PHY_ANALOG_XTAL_XTAL_PWDCLKD_MASK 0x00000800 -#define PHY_ANALOG_XTAL_XTAL_PWDCLKD_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_XTAL_XTAL_PWDCLKD_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_XTAL_XTAL_LOCALBIAS_MSB 12 -#define PHY_ANALOG_XTAL_XTAL_LOCALBIAS_LSB 12 -#define PHY_ANALOG_XTAL_XTAL_LOCALBIAS_MASK 0x00001000 -#define PHY_ANALOG_XTAL_XTAL_LOCALBIAS_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_XTAL_XTAL_LOCALBIAS_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_XTAL_XTAL_SHRTXIN_MSB 13 -#define PHY_ANALOG_XTAL_XTAL_SHRTXIN_LSB 13 -#define PHY_ANALOG_XTAL_XTAL_SHRTXIN_MASK 0x00002000 -#define PHY_ANALOG_XTAL_XTAL_SHRTXIN_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_XTAL_XTAL_SHRTXIN_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_XTAL_XTAL_DRVSTR_MSB 15 -#define PHY_ANALOG_XTAL_XTAL_DRVSTR_LSB 14 -#define PHY_ANALOG_XTAL_XTAL_DRVSTR_MASK 0x0000c000 -#define PHY_ANALOG_XTAL_XTAL_DRVSTR_GET(x) (((x) & 0x0000c000) >> 14) -#define PHY_ANALOG_XTAL_XTAL_DRVSTR_SET(x) (((x) << 14) & 0x0000c000) -#define PHY_ANALOG_XTAL_XTAL_CAPOUTDAC_MSB 22 -#define PHY_ANALOG_XTAL_XTAL_CAPOUTDAC_LSB 16 -#define PHY_ANALOG_XTAL_XTAL_CAPOUTDAC_MASK 0x007f0000 -#define PHY_ANALOG_XTAL_XTAL_CAPOUTDAC_GET(x) (((x) & 0x007f0000) >> 16) -#define PHY_ANALOG_XTAL_XTAL_CAPOUTDAC_SET(x) (((x) << 16) & 0x007f0000) -#define PHY_ANALOG_XTAL_XTAL_CAPINDAC_MSB 29 -#define PHY_ANALOG_XTAL_XTAL_CAPINDAC_LSB 23 -#define PHY_ANALOG_XTAL_XTAL_CAPINDAC_MASK 0x3f800000 -#define PHY_ANALOG_XTAL_XTAL_CAPINDAC_GET(x) (((x) & 0x3f800000) >> 23) -#define PHY_ANALOG_XTAL_XTAL_CAPINDAC_SET(x) (((x) << 23) & 0x3f800000) -#define PHY_ANALOG_XTAL_XTAL_BIAS2X_MSB 30 -#define PHY_ANALOG_XTAL_XTAL_BIAS2X_LSB 30 -#define PHY_ANALOG_XTAL_XTAL_BIAS2X_MASK 0x40000000 -#define PHY_ANALOG_XTAL_XTAL_BIAS2X_GET(x) (((x) & 0x40000000) >> 30) -#define PHY_ANALOG_XTAL_XTAL_BIAS2X_SET(x) (((x) << 30) & 0x40000000) -#define PHY_ANALOG_XTAL_TCXODET_MSB 31 -#define PHY_ANALOG_XTAL_TCXODET_LSB 31 -#define PHY_ANALOG_XTAL_TCXODET_MASK 0x80000000 -#define PHY_ANALOG_XTAL_TCXODET_GET(x) (((x) & 0x80000000) >> 31) - -/* macros for rbist_cntrl */ -#define PHY_ANALOG_RBIST_CNTRL_ADDRESS 0x00000380 -#define PHY_ANALOG_RBIST_CNTRL_OFFSET 0x00000380 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_DC_ENABLE_MSB 0 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_DC_ENABLE_LSB 0 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_DC_ENABLE_MASK 0x00000001 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_DC_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_DC_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE0_ENABLE_MSB 1 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE0_ENABLE_LSB 1 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE0_ENABLE_MASK 0x00000002 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE0_ENABLE_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE0_ENABLE_SET(x) (((x) << 1) & 0x00000002) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE1_ENABLE_MSB 2 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE1_ENABLE_LSB 2 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE1_ENABLE_MASK 0x00000004 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE1_ENABLE_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_TONE1_ENABLE_SET(x) (((x) << 2) & 0x00000004) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LFTONE0_ENABLE_MSB 3 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LFTONE0_ENABLE_LSB 3 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LFTONE0_ENABLE_MASK 0x00000008 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LFTONE0_ENABLE_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LFTONE0_ENABLE_SET(x) (((x) << 3) & 0x00000008) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_I_MSB 4 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_I_LSB 4 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_I_MASK 0x00000010 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_I_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_I_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_Q_MSB 5 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_Q_LSB 5 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_Q_MASK 0x00000020 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_Q_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_LINRAMP_ENABLE_Q_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_I_MSB 6 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_I_LSB 6 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_I_MASK 0x00000040 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_I_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_I_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_Q_MSB 7 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_Q_LSB 7 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_Q_MASK 0x00000080 -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_Q_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_RBIST_CNTRL_ATE_TONEGEN_PRBS_ENABLE_Q_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_WRITE_TO_CANCEL_MSB 8 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_WRITE_TO_CANCEL_LSB 8 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_WRITE_TO_CANCEL_MASK 0x00000100 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_WRITE_TO_CANCEL_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_WRITE_TO_CANCEL_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_ENABLE_MSB 9 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_ENABLE_LSB 9 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_ENABLE_MASK 0x00000200 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_ENABLE_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_DC_ENABLE_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_CORR_ENABLE_MSB 10 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_CORR_ENABLE_LSB 10 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_CORR_ENABLE_MASK 0x00000400 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_CORR_ENABLE_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_CORR_ENABLE_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_ENABLE_MSB 11 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_ENABLE_LSB 11 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_ENABLE_MASK 0x00000800 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_ENABLE_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_ENABLE_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_IQ_ENABLE_MSB 12 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_IQ_ENABLE_LSB 12 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_IQ_ENABLE_MASK 0x00001000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_IQ_ENABLE_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_IQ_ENABLE_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_I2Q2_ENABLE_MSB 13 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_I2Q2_ENABLE_LSB 13 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_I2Q2_ENABLE_MASK 0x00002000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_I2Q2_ENABLE_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_I2Q2_ENABLE_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_HPF_ENABLE_MSB 14 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_HPF_ENABLE_LSB 14 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_HPF_ENABLE_MASK 0x00004000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_HPF_ENABLE_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_RBIST_CNTRL_ATE_CMAC_POWER_HPF_ENABLE_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_RBIST_CNTRL_ATE_RXDAC_CALIBRATE_MSB 15 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RXDAC_CALIBRATE_LSB 15 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RXDAC_CALIBRATE_MASK 0x00008000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RXDAC_CALIBRATE_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_RBIST_CNTRL_ATE_RXDAC_CALIBRATE_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_RBIST_CNTRL_ATE_RBIST_ENABLE_MSB 16 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RBIST_ENABLE_LSB 16 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RBIST_ENABLE_MASK 0x00010000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_RBIST_ENABLE_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_RBIST_CNTRL_ATE_RBIST_ENABLE_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_RBIST_CNTRL_ATE_ADC_CLK_INVERT_MSB 17 -#define PHY_ANALOG_RBIST_CNTRL_ATE_ADC_CLK_INVERT_LSB 17 -#define PHY_ANALOG_RBIST_CNTRL_ATE_ADC_CLK_INVERT_MASK 0x00020000 -#define PHY_ANALOG_RBIST_CNTRL_ATE_ADC_CLK_INVERT_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_ANALOG_RBIST_CNTRL_ATE_ADC_CLK_INVERT_SET(x) (((x) << 17) & 0x00020000) - -/* macros for tx_dc_offset */ -#define PHY_ANALOG_TX_DC_OFFSET_ADDRESS 0x00000384 -#define PHY_ANALOG_TX_DC_OFFSET_OFFSET 0x00000384 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_I_MSB 10 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_I_LSB 0 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_I_MASK 0x000007ff -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_I_GET(x) (((x) & 0x000007ff) >> 0) -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_I_SET(x) (((x) << 0) & 0x000007ff) -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_Q_MSB 26 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_Q_LSB 16 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_Q_MASK 0x07ff0000 -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_Q_GET(x) (((x) & 0x07ff0000) >> 16) -#define PHY_ANALOG_TX_DC_OFFSET_ATE_TONEGEN_DC_Q_SET(x) (((x) << 16) & 0x07ff0000) - -/* macros for tx_tonegen0 */ -#define PHY_ANALOG_TX_TONEGEN0_ADDRESS 0x00000388 -#define PHY_ANALOG_TX_TONEGEN0_OFFSET 0x00000388 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_FREQ_MSB 6 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_FREQ_LSB 0 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_FREQ_MASK 0x0000007f -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_FREQ_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_FREQ_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_EXP_MSB 11 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_EXP_LSB 8 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_EXP_MASK 0x00000f00 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_EXP_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_EXP_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_MAN_MSB 23 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_MAN_LSB 16 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_MAN_MASK 0x00ff0000 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_MAN_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_A_MAN_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_TAU_K_MSB 30 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_TAU_K_LSB 24 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_TAU_K_MASK 0x7f000000 -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_TAU_K_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_ANALOG_TX_TONEGEN0_ATE_TONEGEN_TONE_TAU_K_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for tx_tonegen1 */ -#define PHY_ANALOG_TX_TONEGEN1_ADDRESS 0x0000038c -#define PHY_ANALOG_TX_TONEGEN1_OFFSET 0x0000038c -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_FREQ_MSB 6 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_FREQ_LSB 0 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_FREQ_MASK 0x0000007f -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_FREQ_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_FREQ_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_EXP_MSB 11 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_EXP_LSB 8 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_EXP_MASK 0x00000f00 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_EXP_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_EXP_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_MAN_MSB 23 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_MAN_LSB 16 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_MAN_MASK 0x00ff0000 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_MAN_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_A_MAN_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_TAU_K_MSB 30 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_TAU_K_LSB 24 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_TAU_K_MASK 0x7f000000 -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_TAU_K_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_ANALOG_TX_TONEGEN1_ATE_TONEGEN_TONE_TAU_K_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for tx_lftonegen0 */ -#define PHY_ANALOG_TX_LFTONEGEN0_ADDRESS 0x00000390 -#define PHY_ANALOG_TX_LFTONEGEN0_OFFSET 0x00000390 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_FREQ_MSB 6 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_FREQ_LSB 0 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_FREQ_MASK 0x0000007f -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_FREQ_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_FREQ_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_EXP_MSB 11 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_EXP_LSB 8 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_EXP_MASK 0x00000f00 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_EXP_GET(x) (((x) & 0x00000f00) >> 8) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_EXP_SET(x) (((x) << 8) & 0x00000f00) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_MAN_MSB 23 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_MAN_LSB 16 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_MAN_MASK 0x00ff0000 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_MAN_GET(x) (((x) & 0x00ff0000) >> 16) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_A_MAN_SET(x) (((x) << 16) & 0x00ff0000) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_TAU_K_MSB 30 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_TAU_K_LSB 24 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_TAU_K_MASK 0x7f000000 -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_TAU_K_GET(x) (((x) & 0x7f000000) >> 24) -#define PHY_ANALOG_TX_LFTONEGEN0_ATE_TONEGEN_TONE_TAU_K_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for tx_linear_ramp_i */ -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ADDRESS 0x00000394 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_OFFSET 0x00000394 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_INIT_MSB 10 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_INIT_LSB 0 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_INIT_MASK 0x000007ff -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_INIT_GET(x) (((x) & 0x000007ff) >> 0) -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_INIT_SET(x) (((x) << 0) & 0x000007ff) -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_DWELL_MSB 21 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_DWELL_LSB 12 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_DWELL_MASK 0x003ff000 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_DWELL_GET(x) (((x) & 0x003ff000) >> 12) -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_DWELL_SET(x) (((x) << 12) & 0x003ff000) -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_STEP_MSB 29 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_STEP_LSB 24 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_STEP_MASK 0x3f000000 -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_STEP_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_ANALOG_TX_LINEAR_RAMP_I_ATE_TONEGEN_LINRAMP_STEP_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for tx_linear_ramp_q */ -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ADDRESS 0x00000398 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_OFFSET 0x00000398 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_INIT_MSB 10 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_INIT_LSB 0 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_INIT_MASK 0x000007ff -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_INIT_GET(x) (((x) & 0x000007ff) >> 0) -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_INIT_SET(x) (((x) << 0) & 0x000007ff) -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_DWELL_MSB 21 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_DWELL_LSB 12 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_DWELL_MASK 0x003ff000 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_DWELL_GET(x) (((x) & 0x003ff000) >> 12) -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_DWELL_SET(x) (((x) << 12) & 0x003ff000) -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_STEP_MSB 29 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_STEP_LSB 24 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_STEP_MASK 0x3f000000 -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_STEP_GET(x) (((x) & 0x3f000000) >> 24) -#define PHY_ANALOG_TX_LINEAR_RAMP_Q_ATE_TONEGEN_LINRAMP_STEP_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for tx_prbs_mag */ -#define PHY_ANALOG_TX_PRBS_MAG_ADDRESS 0x0000039c -#define PHY_ANALOG_TX_PRBS_MAG_OFFSET 0x0000039c -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_I_MSB 9 -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_I_LSB 0 -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_I_MASK 0x000003ff -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_I_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_I_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_Q_MSB 25 -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_Q_LSB 16 -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_Q_MASK 0x03ff0000 -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_Q_GET(x) (((x) & 0x03ff0000) >> 16) -#define PHY_ANALOG_TX_PRBS_MAG_ATE_TONEGEN_PRBS_MAGNITUDE_Q_SET(x) (((x) << 16) & 0x03ff0000) - -/* macros for tx_prbs_seed_i */ -#define PHY_ANALOG_TX_PRBS_SEED_I_ADDRESS 0x000003a0 -#define PHY_ANALOG_TX_PRBS_SEED_I_OFFSET 0x000003a0 -#define PHY_ANALOG_TX_PRBS_SEED_I_ATE_TONEGEN_PRBS_SEED_MSB 30 -#define PHY_ANALOG_TX_PRBS_SEED_I_ATE_TONEGEN_PRBS_SEED_LSB 0 -#define PHY_ANALOG_TX_PRBS_SEED_I_ATE_TONEGEN_PRBS_SEED_MASK 0x7fffffff -#define PHY_ANALOG_TX_PRBS_SEED_I_ATE_TONEGEN_PRBS_SEED_GET(x) (((x) & 0x7fffffff) >> 0) -#define PHY_ANALOG_TX_PRBS_SEED_I_ATE_TONEGEN_PRBS_SEED_SET(x) (((x) << 0) & 0x7fffffff) - -/* macros for tx_prbs_seed_q */ -#define PHY_ANALOG_TX_PRBS_SEED_Q_ADDRESS 0x000003a4 -#define PHY_ANALOG_TX_PRBS_SEED_Q_OFFSET 0x000003a4 -#define PHY_ANALOG_TX_PRBS_SEED_Q_ATE_TONEGEN_PRBS_SEED_MSB 30 -#define PHY_ANALOG_TX_PRBS_SEED_Q_ATE_TONEGEN_PRBS_SEED_LSB 0 -#define PHY_ANALOG_TX_PRBS_SEED_Q_ATE_TONEGEN_PRBS_SEED_MASK 0x7fffffff -#define PHY_ANALOG_TX_PRBS_SEED_Q_ATE_TONEGEN_PRBS_SEED_GET(x) (((x) & 0x7fffffff) >> 0) -#define PHY_ANALOG_TX_PRBS_SEED_Q_ATE_TONEGEN_PRBS_SEED_SET(x) (((x) << 0) & 0x7fffffff) - -/* macros for cmac_dc_cancel */ -#define PHY_ANALOG_CMAC_DC_CANCEL_ADDRESS 0x000003a8 -#define PHY_ANALOG_CMAC_DC_CANCEL_OFFSET 0x000003a8 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_I_MSB 9 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_I_LSB 0 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_I_MASK 0x000003ff -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_I_GET(x) (((x) & 0x000003ff) >> 0) -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_I_SET(x) (((x) << 0) & 0x000003ff) -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_Q_MSB 25 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_Q_LSB 16 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_Q_MASK 0x03ff0000 -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_Q_GET(x) (((x) & 0x03ff0000) >> 16) -#define PHY_ANALOG_CMAC_DC_CANCEL_ATE_CMAC_DC_CANCEL_Q_SET(x) (((x) << 16) & 0x03ff0000) - -/* macros for cmac_dc_offset */ -#define PHY_ANALOG_CMAC_DC_OFFSET_ADDRESS 0x000003ac -#define PHY_ANALOG_CMAC_DC_OFFSET_OFFSET 0x000003ac -#define PHY_ANALOG_CMAC_DC_OFFSET_ATE_CMAC_DC_CYCLES_MSB 3 -#define PHY_ANALOG_CMAC_DC_OFFSET_ATE_CMAC_DC_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_DC_OFFSET_ATE_CMAC_DC_CYCLES_MASK 0x0000000f -#define PHY_ANALOG_CMAC_DC_OFFSET_ATE_CMAC_DC_CYCLES_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_CMAC_DC_OFFSET_ATE_CMAC_DC_CYCLES_SET(x) (((x) << 0) & 0x0000000f) - -/* macros for cmac_corr */ -#define PHY_ANALOG_CMAC_CORR_ADDRESS 0x000003b0 -#define PHY_ANALOG_CMAC_CORR_OFFSET 0x000003b0 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_CYCLES_MSB 4 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_CYCLES_MASK 0x0000001f -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_CYCLES_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_CYCLES_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_FREQ_MSB 13 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_FREQ_LSB 8 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_FREQ_MASK 0x00003f00 -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_FREQ_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_ANALOG_CMAC_CORR_ATE_CMAC_CORR_FREQ_SET(x) (((x) << 8) & 0x00003f00) - -/* macros for cmac_power */ -#define PHY_ANALOG_CMAC_POWER_ADDRESS 0x000003b4 -#define PHY_ANALOG_CMAC_POWER_OFFSET 0x000003b4 -#define PHY_ANALOG_CMAC_POWER_ATE_CMAC_POWER_CYCLES_MSB 3 -#define PHY_ANALOG_CMAC_POWER_ATE_CMAC_POWER_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_POWER_ATE_CMAC_POWER_CYCLES_MASK 0x0000000f -#define PHY_ANALOG_CMAC_POWER_ATE_CMAC_POWER_CYCLES_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_CMAC_POWER_ATE_CMAC_POWER_CYCLES_SET(x) (((x) << 0) & 0x0000000f) - -/* macros for cmac_cross_corr */ -#define PHY_ANALOG_CMAC_CROSS_CORR_ADDRESS 0x000003b8 -#define PHY_ANALOG_CMAC_CROSS_CORR_OFFSET 0x000003b8 -#define PHY_ANALOG_CMAC_CROSS_CORR_ATE_CMAC_IQ_CYCLES_MSB 3 -#define PHY_ANALOG_CMAC_CROSS_CORR_ATE_CMAC_IQ_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_CROSS_CORR_ATE_CMAC_IQ_CYCLES_MASK 0x0000000f -#define PHY_ANALOG_CMAC_CROSS_CORR_ATE_CMAC_IQ_CYCLES_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_CMAC_CROSS_CORR_ATE_CMAC_IQ_CYCLES_SET(x) (((x) << 0) & 0x0000000f) - -/* macros for cmac_i2q2 */ -#define PHY_ANALOG_CMAC_I2Q2_ADDRESS 0x000003bc -#define PHY_ANALOG_CMAC_I2Q2_OFFSET 0x000003bc -#define PHY_ANALOG_CMAC_I2Q2_ATE_CMAC_I2Q2_CYCLES_MSB 3 -#define PHY_ANALOG_CMAC_I2Q2_ATE_CMAC_I2Q2_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_I2Q2_ATE_CMAC_I2Q2_CYCLES_MASK 0x0000000f -#define PHY_ANALOG_CMAC_I2Q2_ATE_CMAC_I2Q2_CYCLES_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_CMAC_I2Q2_ATE_CMAC_I2Q2_CYCLES_SET(x) (((x) << 0) & 0x0000000f) - -/* macros for cmac_power_hpf */ -#define PHY_ANALOG_CMAC_POWER_HPF_ADDRESS 0x000003c0 -#define PHY_ANALOG_CMAC_POWER_HPF_OFFSET 0x000003c0 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_CYCLES_MSB 3 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_CYCLES_LSB 0 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_CYCLES_MASK 0x0000000f -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_CYCLES_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_CYCLES_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_WAIT_MSB 7 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_WAIT_LSB 4 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_WAIT_MASK 0x000000f0 -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_WAIT_GET(x) (((x) & 0x000000f0) >> 4) -#define PHY_ANALOG_CMAC_POWER_HPF_ATE_CMAC_POWER_HPF_WAIT_SET(x) (((x) << 4) & 0x000000f0) - -/* macros for rxdac_set1 */ -#define PHY_ANALOG_RXDAC_SET1_ADDRESS 0x000003c4 -#define PHY_ANALOG_RXDAC_SET1_OFFSET 0x000003c4 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_MUX_MSB 1 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_MUX_LSB 0 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_MUX_MASK 0x00000003 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_MUX_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_MUX_SET(x) (((x) << 0) & 0x00000003) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_HI_GAIN_MSB 4 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_HI_GAIN_LSB 4 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_HI_GAIN_MASK 0x00000010 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_HI_GAIN_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_HI_GAIN_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_WAIT_MSB 13 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_WAIT_LSB 8 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_WAIT_MASK 0x00003f00 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_WAIT_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_WAIT_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_MEASURE_TIME_MSB 19 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_MEASURE_TIME_LSB 16 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_MEASURE_TIME_MASK 0x000f0000 -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_MEASURE_TIME_GET(x) (((x) & 0x000f0000) >> 16) -#define PHY_ANALOG_RXDAC_SET1_ATE_RXDAC_CAL_MEASURE_TIME_SET(x) (((x) << 16) & 0x000f0000) - -/* macros for rxdac_set2 */ -#define PHY_ANALOG_RXDAC_SET2_ADDRESS 0x000003c8 -#define PHY_ANALOG_RXDAC_SET2_OFFSET 0x000003c8 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_HI_MSB 4 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_HI_LSB 0 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_HI_MASK 0x0000001f -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_HI_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_HI_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_HI_MSB 12 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_HI_LSB 8 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_HI_MASK 0x00001f00 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_HI_GET(x) (((x) & 0x00001f00) >> 8) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_HI_SET(x) (((x) << 8) & 0x00001f00) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_LOW_MSB 20 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_LOW_LSB 16 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_LOW_MASK 0x001f0000 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_LOW_GET(x) (((x) & 0x001f0000) >> 16) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_I_LOW_SET(x) (((x) << 16) & 0x001f0000) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_LOW_MSB 28 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_LOW_LSB 24 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_LOW_MASK 0x1f000000 -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_LOW_GET(x) (((x) & 0x1f000000) >> 24) -#define PHY_ANALOG_RXDAC_SET2_ATE_RXDAC_Q_LOW_SET(x) (((x) << 24) & 0x1f000000) - -/* macros for rxdac_long_shift */ -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ADDRESS 0x000003cc -#define PHY_ANALOG_RXDAC_LONG_SHIFT_OFFSET 0x000003cc -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_I_STATIC_MSB 4 -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_I_STATIC_LSB 0 -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_I_STATIC_MASK 0x0000001f -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_I_STATIC_GET(x) (((x) & 0x0000001f) >> 0) -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_I_STATIC_SET(x) (((x) << 0) & 0x0000001f) -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_Q_STATIC_MSB 12 -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_Q_STATIC_LSB 8 -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_Q_STATIC_MASK 0x00001f00 -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_Q_STATIC_GET(x) (((x) & 0x00001f00) >> 8) -#define PHY_ANALOG_RXDAC_LONG_SHIFT_ATE_RXDAC_Q_STATIC_SET(x) (((x) << 8) & 0x00001f00) - -/* macros for cmac_results_i */ -#define PHY_ANALOG_CMAC_RESULTS_I_ADDRESS 0x000003d0 -#define PHY_ANALOG_CMAC_RESULTS_I_OFFSET 0x000003d0 -#define PHY_ANALOG_CMAC_RESULTS_I_ATE_CMAC_RESULTS_MSB 31 -#define PHY_ANALOG_CMAC_RESULTS_I_ATE_CMAC_RESULTS_LSB 0 -#define PHY_ANALOG_CMAC_RESULTS_I_ATE_CMAC_RESULTS_MASK 0xffffffff -#define PHY_ANALOG_CMAC_RESULTS_I_ATE_CMAC_RESULTS_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_ANALOG_CMAC_RESULTS_I_ATE_CMAC_RESULTS_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for cmac_results_q */ -#define PHY_ANALOG_CMAC_RESULTS_Q_ADDRESS 0x000003d4 -#define PHY_ANALOG_CMAC_RESULTS_Q_OFFSET 0x000003d4 -#define PHY_ANALOG_CMAC_RESULTS_Q_ATE_CMAC_RESULTS_MSB 31 -#define PHY_ANALOG_CMAC_RESULTS_Q_ATE_CMAC_RESULTS_LSB 0 -#define PHY_ANALOG_CMAC_RESULTS_Q_ATE_CMAC_RESULTS_MASK 0xffffffff -#define PHY_ANALOG_CMAC_RESULTS_Q_ATE_CMAC_RESULTS_GET(x) (((x) & 0xffffffff) >> 0) -#define PHY_ANALOG_CMAC_RESULTS_Q_ATE_CMAC_RESULTS_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for PMU1 */ -#define PHY_ANALOG_PMU1_ADDRESS 0x00000740 -#define PHY_ANALOG_PMU1_OFFSET 0x00000740 -#define PHY_ANALOG_PMU1_SPARE_MSB 3 -#define PHY_ANALOG_PMU1_SPARE_LSB 0 -#define PHY_ANALOG_PMU1_SPARE_MASK 0x0000000f -#define PHY_ANALOG_PMU1_SPARE_GET(x) (((x) & 0x0000000f) >> 0) -#define PHY_ANALOG_PMU1_SPARE_SET(x) (((x) << 0) & 0x0000000f) -#define PHY_ANALOG_PMU1_OTP_V25_PWD_MSB 4 -#define PHY_ANALOG_PMU1_OTP_V25_PWD_LSB 4 -#define PHY_ANALOG_PMU1_OTP_V25_PWD_MASK 0x00000010 -#define PHY_ANALOG_PMU1_OTP_V25_PWD_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_ANALOG_PMU1_OTP_V25_PWD_SET(x) (((x) << 4) & 0x00000010) -#define PHY_ANALOG_PMU1_PAREGON_MAN_MSB 5 -#define PHY_ANALOG_PMU1_PAREGON_MAN_LSB 5 -#define PHY_ANALOG_PMU1_PAREGON_MAN_MASK 0x00000020 -#define PHY_ANALOG_PMU1_PAREGON_MAN_GET(x) (((x) & 0x00000020) >> 5) -#define PHY_ANALOG_PMU1_PAREGON_MAN_SET(x) (((x) << 5) & 0x00000020) -#define PHY_ANALOG_PMU1_PAREGON_OVERRIDE_EN_MSB 6 -#define PHY_ANALOG_PMU1_PAREGON_OVERRIDE_EN_LSB 6 -#define PHY_ANALOG_PMU1_PAREGON_OVERRIDE_EN_MASK 0x00000040 -#define PHY_ANALOG_PMU1_PAREGON_OVERRIDE_EN_GET(x) (((x) & 0x00000040) >> 6) -#define PHY_ANALOG_PMU1_PAREGON_OVERRIDE_EN_SET(x) (((x) << 6) & 0x00000040) -#define PHY_ANALOG_PMU1_OTPREGON_MAN_MSB 7 -#define PHY_ANALOG_PMU1_OTPREGON_MAN_LSB 7 -#define PHY_ANALOG_PMU1_OTPREGON_MAN_MASK 0x00000080 -#define PHY_ANALOG_PMU1_OTPREGON_MAN_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_ANALOG_PMU1_OTPREGON_MAN_SET(x) (((x) << 7) & 0x00000080) -#define PHY_ANALOG_PMU1_OTPREGON_OVERRIDE_EN_MSB 8 -#define PHY_ANALOG_PMU1_OTPREGON_OVERRIDE_EN_LSB 8 -#define PHY_ANALOG_PMU1_OTPREGON_OVERRIDE_EN_MASK 0x00000100 -#define PHY_ANALOG_PMU1_OTPREGON_OVERRIDE_EN_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_PMU1_OTPREGON_OVERRIDE_EN_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_PMU1_DREGON_MAN_MSB 9 -#define PHY_ANALOG_PMU1_DREGON_MAN_LSB 9 -#define PHY_ANALOG_PMU1_DREGON_MAN_MASK 0x00000200 -#define PHY_ANALOG_PMU1_DREGON_MAN_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_PMU1_DREGON_MAN_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_PMU1_DREGON_OVERRIDE_EN_MSB 10 -#define PHY_ANALOG_PMU1_DREGON_OVERRIDE_EN_LSB 10 -#define PHY_ANALOG_PMU1_DREGON_OVERRIDE_EN_MASK 0x00000400 -#define PHY_ANALOG_PMU1_DREGON_OVERRIDE_EN_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_PMU1_DREGON_OVERRIDE_EN_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_PMU1_DISCONTMODEEN_MSB 11 -#define PHY_ANALOG_PMU1_DISCONTMODEEN_LSB 11 -#define PHY_ANALOG_PMU1_DISCONTMODEEN_MASK 0x00000800 -#define PHY_ANALOG_PMU1_DISCONTMODEEN_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_PMU1_DISCONTMODEEN_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_PMU1_SWREGDISCONT_OVERRIDE_EN_MSB 12 -#define PHY_ANALOG_PMU1_SWREGDISCONT_OVERRIDE_EN_LSB 12 -#define PHY_ANALOG_PMU1_SWREGDISCONT_OVERRIDE_EN_MASK 0x00001000 -#define PHY_ANALOG_PMU1_SWREGDISCONT_OVERRIDE_EN_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_PMU1_SWREGDISCONT_OVERRIDE_EN_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_PMU1_SWREGON_MAN_MSB 13 -#define PHY_ANALOG_PMU1_SWREGON_MAN_LSB 13 -#define PHY_ANALOG_PMU1_SWREGON_MAN_MASK 0x00002000 -#define PHY_ANALOG_PMU1_SWREGON_MAN_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_PMU1_SWREGON_MAN_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_PMU1_SWREGON_OVERRIDE_EN_MSB 14 -#define PHY_ANALOG_PMU1_SWREGON_OVERRIDE_EN_LSB 14 -#define PHY_ANALOG_PMU1_SWREGON_OVERRIDE_EN_MASK 0x00004000 -#define PHY_ANALOG_PMU1_SWREGON_OVERRIDE_EN_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_PMU1_SWREGON_OVERRIDE_EN_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_PMU1_SWREG_FREQCUR_MSB 16 -#define PHY_ANALOG_PMU1_SWREG_FREQCUR_LSB 15 -#define PHY_ANALOG_PMU1_SWREG_FREQCUR_MASK 0x00018000 -#define PHY_ANALOG_PMU1_SWREG_FREQCUR_GET(x) (((x) & 0x00018000) >> 15) -#define PHY_ANALOG_PMU1_SWREG_FREQCUR_SET(x) (((x) << 15) & 0x00018000) -#define PHY_ANALOG_PMU1_SWREG_FREQCAP_MSB 19 -#define PHY_ANALOG_PMU1_SWREG_FREQCAP_LSB 17 -#define PHY_ANALOG_PMU1_SWREG_FREQCAP_MASK 0x000e0000 -#define PHY_ANALOG_PMU1_SWREG_FREQCAP_GET(x) (((x) & 0x000e0000) >> 17) -#define PHY_ANALOG_PMU1_SWREG_FREQCAP_SET(x) (((x) << 17) & 0x000e0000) -#define PHY_ANALOG_PMU1_SWREGFREQ_OVERRIDE_EN_MSB 20 -#define PHY_ANALOG_PMU1_SWREGFREQ_OVERRIDE_EN_LSB 20 -#define PHY_ANALOG_PMU1_SWREGFREQ_OVERRIDE_EN_MASK 0x00100000 -#define PHY_ANALOG_PMU1_SWREGFREQ_OVERRIDE_EN_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_ANALOG_PMU1_SWREGFREQ_OVERRIDE_EN_SET(x) (((x) << 20) & 0x00100000) -#define PHY_ANALOG_PMU1_SWREG_LVLCTR_MSB 22 -#define PHY_ANALOG_PMU1_SWREG_LVLCTR_LSB 21 -#define PHY_ANALOG_PMU1_SWREG_LVLCTR_MASK 0x00600000 -#define PHY_ANALOG_PMU1_SWREG_LVLCTR_GET(x) (((x) & 0x00600000) >> 21) -#define PHY_ANALOG_PMU1_SWREG_LVLCTR_SET(x) (((x) << 21) & 0x00600000) -#define PHY_ANALOG_PMU1_SWREGLVL_OVERRIDE_EN_MSB 23 -#define PHY_ANALOG_PMU1_SWREGLVL_OVERRIDE_EN_LSB 23 -#define PHY_ANALOG_PMU1_SWREGLVL_OVERRIDE_EN_MASK 0x00800000 -#define PHY_ANALOG_PMU1_SWREGLVL_OVERRIDE_EN_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_ANALOG_PMU1_SWREGLVL_OVERRIDE_EN_SET(x) (((x) << 23) & 0x00800000) -#define PHY_ANALOG_PMU1_DREG_LVLCTR_MSB 25 -#define PHY_ANALOG_PMU1_DREG_LVLCTR_LSB 24 -#define PHY_ANALOG_PMU1_DREG_LVLCTR_MASK 0x03000000 -#define PHY_ANALOG_PMU1_DREG_LVLCTR_GET(x) (((x) & 0x03000000) >> 24) -#define PHY_ANALOG_PMU1_DREG_LVLCTR_SET(x) (((x) << 24) & 0x03000000) -#define PHY_ANALOG_PMU1_DREGLVL_OVERRIDE_EN_MSB 26 -#define PHY_ANALOG_PMU1_DREGLVL_OVERRIDE_EN_LSB 26 -#define PHY_ANALOG_PMU1_DREGLVL_OVERRIDE_EN_MASK 0x04000000 -#define PHY_ANALOG_PMU1_DREGLVL_OVERRIDE_EN_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_ANALOG_PMU1_DREGLVL_OVERRIDE_EN_SET(x) (((x) << 26) & 0x04000000) -#define PHY_ANALOG_PMU1_PAREG_XPNP_MSB 27 -#define PHY_ANALOG_PMU1_PAREG_XPNP_LSB 27 -#define PHY_ANALOG_PMU1_PAREG_XPNP_MASK 0x08000000 -#define PHY_ANALOG_PMU1_PAREG_XPNP_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_ANALOG_PMU1_PAREG_XPNP_SET(x) (((x) << 27) & 0x08000000) -#define PHY_ANALOG_PMU1_PAREG_LVLCTR_MSB 30 -#define PHY_ANALOG_PMU1_PAREG_LVLCTR_LSB 28 -#define PHY_ANALOG_PMU1_PAREG_LVLCTR_MASK 0x70000000 -#define PHY_ANALOG_PMU1_PAREG_LVLCTR_GET(x) (((x) & 0x70000000) >> 28) -#define PHY_ANALOG_PMU1_PAREG_LVLCTR_SET(x) (((x) << 28) & 0x70000000) -#define PHY_ANALOG_PMU1_PAREGLVL_OVERRIDE_EN_MSB 31 -#define PHY_ANALOG_PMU1_PAREGLVL_OVERRIDE_EN_LSB 31 -#define PHY_ANALOG_PMU1_PAREGLVL_OVERRIDE_EN_MASK 0x80000000 -#define PHY_ANALOG_PMU1_PAREGLVL_OVERRIDE_EN_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_PMU1_PAREGLVL_OVERRIDE_EN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for PMU2 */ -#define PHY_ANALOG_PMU2_ADDRESS 0x00000744 -#define PHY_ANALOG_PMU2_OFFSET 0x00000744 -#define PHY_ANALOG_PMU2_SPARE_MSB 7 -#define PHY_ANALOG_PMU2_SPARE_LSB 0 -#define PHY_ANALOG_PMU2_SPARE_MASK 0x000000ff -#define PHY_ANALOG_PMU2_SPARE_GET(x) (((x) & 0x000000ff) >> 0) -#define PHY_ANALOG_PMU2_SPARE_SET(x) (((x) << 0) & 0x000000ff) -#define PHY_ANALOG_PMU2_VBATT_1_3TOATB_MSB 8 -#define PHY_ANALOG_PMU2_VBATT_1_3TOATB_LSB 8 -#define PHY_ANALOG_PMU2_VBATT_1_3TOATB_MASK 0x00000100 -#define PHY_ANALOG_PMU2_VBATT_1_3TOATB_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_ANALOG_PMU2_VBATT_1_3TOATB_SET(x) (((x) << 8) & 0x00000100) -#define PHY_ANALOG_PMU2_VBATT_1_2TOATB_MSB 9 -#define PHY_ANALOG_PMU2_VBATT_1_2TOATB_LSB 9 -#define PHY_ANALOG_PMU2_VBATT_1_2TOATB_MASK 0x00000200 -#define PHY_ANALOG_PMU2_VBATT_1_2TOATB_GET(x) (((x) & 0x00000200) >> 9) -#define PHY_ANALOG_PMU2_VBATT_1_2TOATB_SET(x) (((x) << 9) & 0x00000200) -#define PHY_ANALOG_PMU2_VBATT_2_3TOATB_MSB 10 -#define PHY_ANALOG_PMU2_VBATT_2_3TOATB_LSB 10 -#define PHY_ANALOG_PMU2_VBATT_2_3TOATB_MASK 0x00000400 -#define PHY_ANALOG_PMU2_VBATT_2_3TOATB_GET(x) (((x) & 0x00000400) >> 10) -#define PHY_ANALOG_PMU2_VBATT_2_3TOATB_SET(x) (((x) << 10) & 0x00000400) -#define PHY_ANALOG_PMU2_PWD_BANDGAP_MAN_MSB 11 -#define PHY_ANALOG_PMU2_PWD_BANDGAP_MAN_LSB 11 -#define PHY_ANALOG_PMU2_PWD_BANDGAP_MAN_MASK 0x00000800 -#define PHY_ANALOG_PMU2_PWD_BANDGAP_MAN_GET(x) (((x) & 0x00000800) >> 11) -#define PHY_ANALOG_PMU2_PWD_BANDGAP_MAN_SET(x) (((x) << 11) & 0x00000800) -#define PHY_ANALOG_PMU2_PWD_LFO_MAN_MSB 12 -#define PHY_ANALOG_PMU2_PWD_LFO_MAN_LSB 12 -#define PHY_ANALOG_PMU2_PWD_LFO_MAN_MASK 0x00001000 -#define PHY_ANALOG_PMU2_PWD_LFO_MAN_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_ANALOG_PMU2_PWD_LFO_MAN_SET(x) (((x) << 12) & 0x00001000) -#define PHY_ANALOG_PMU2_VBATT_LT_3P2_MSB 13 -#define PHY_ANALOG_PMU2_VBATT_LT_3P2_LSB 13 -#define PHY_ANALOG_PMU2_VBATT_LT_3P2_MASK 0x00002000 -#define PHY_ANALOG_PMU2_VBATT_LT_3P2_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_ANALOG_PMU2_VBATT_LT_3P2_SET(x) (((x) << 13) & 0x00002000) -#define PHY_ANALOG_PMU2_VBATT_LT_2P8_MSB 14 -#define PHY_ANALOG_PMU2_VBATT_LT_2P8_LSB 14 -#define PHY_ANALOG_PMU2_VBATT_LT_2P8_MASK 0x00004000 -#define PHY_ANALOG_PMU2_VBATT_LT_2P8_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_ANALOG_PMU2_VBATT_LT_2P8_SET(x) (((x) << 14) & 0x00004000) -#define PHY_ANALOG_PMU2_VBATT_GT_4P2_MSB 15 -#define PHY_ANALOG_PMU2_VBATT_GT_4P2_LSB 15 -#define PHY_ANALOG_PMU2_VBATT_GT_4P2_MASK 0x00008000 -#define PHY_ANALOG_PMU2_VBATT_GT_4P2_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_ANALOG_PMU2_VBATT_GT_4P2_SET(x) (((x) << 15) & 0x00008000) -#define PHY_ANALOG_PMU2_PMU_XPNP_OVERRIDE_EN_MSB 16 -#define PHY_ANALOG_PMU2_PMU_XPNP_OVERRIDE_EN_LSB 16 -#define PHY_ANALOG_PMU2_PMU_XPNP_OVERRIDE_EN_MASK 0x00010000 -#define PHY_ANALOG_PMU2_PMU_XPNP_OVERRIDE_EN_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_ANALOG_PMU2_PMU_XPNP_OVERRIDE_EN_SET(x) (((x) << 16) & 0x00010000) -#define PHY_ANALOG_PMU2_VBATT_GT_LVLCTR_MSB 18 -#define PHY_ANALOG_PMU2_VBATT_GT_LVLCTR_LSB 17 -#define PHY_ANALOG_PMU2_VBATT_GT_LVLCTR_MASK 0x00060000 -#define PHY_ANALOG_PMU2_VBATT_GT_LVLCTR_GET(x) (((x) & 0x00060000) >> 17) -#define PHY_ANALOG_PMU2_VBATT_GT_LVLCTR_SET(x) (((x) << 17) & 0x00060000) -#define PHY_ANALOG_PMU2_SWREGVSSL2ATB_MSB 19 -#define PHY_ANALOG_PMU2_SWREGVSSL2ATB_LSB 19 -#define PHY_ANALOG_PMU2_SWREGVSSL2ATB_MASK 0x00080000 -#define PHY_ANALOG_PMU2_SWREGVSSL2ATB_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_ANALOG_PMU2_SWREGVSSL2ATB_SET(x) (((x) << 19) & 0x00080000) -#define PHY_ANALOG_PMU2_SWREGVSSL_LVLCTR_MSB 21 -#define PHY_ANALOG_PMU2_SWREGVSSL_LVLCTR_LSB 20 -#define PHY_ANALOG_PMU2_SWREGVSSL_LVLCTR_MASK 0x00300000 -#define PHY_ANALOG_PMU2_SWREGVSSL_LVLCTR_GET(x) (((x) & 0x00300000) >> 20) -#define PHY_ANALOG_PMU2_SWREGVSSL_LVLCTR_SET(x) (((x) << 20) & 0x00300000) -#define PHY_ANALOG_PMU2_SWREGVDDH2ATB_MSB 22 -#define PHY_ANALOG_PMU2_SWREGVDDH2ATB_LSB 22 -#define PHY_ANALOG_PMU2_SWREGVDDH2ATB_MASK 0x00400000 -#define PHY_ANALOG_PMU2_SWREGVDDH2ATB_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_ANALOG_PMU2_SWREGVDDH2ATB_SET(x) (((x) << 22) & 0x00400000) -#define PHY_ANALOG_PMU2_SWREGVDDH_LVLCTR_MSB 24 -#define PHY_ANALOG_PMU2_SWREGVDDH_LVLCTR_LSB 23 -#define PHY_ANALOG_PMU2_SWREGVDDH_LVLCTR_MASK 0x01800000 -#define PHY_ANALOG_PMU2_SWREGVDDH_LVLCTR_GET(x) (((x) & 0x01800000) >> 23) -#define PHY_ANALOG_PMU2_SWREGVDDH_LVLCTR_SET(x) (((x) << 23) & 0x01800000) -#define PHY_ANALOG_PMU2_SWREG2ATB_MSB 27 -#define PHY_ANALOG_PMU2_SWREG2ATB_LSB 25 -#define PHY_ANALOG_PMU2_SWREG2ATB_MASK 0x0e000000 -#define PHY_ANALOG_PMU2_SWREG2ATB_GET(x) (((x) & 0x0e000000) >> 25) -#define PHY_ANALOG_PMU2_SWREG2ATB_SET(x) (((x) << 25) & 0x0e000000) -#define PHY_ANALOG_PMU2_OTPREG2ATB_MSB 28 -#define PHY_ANALOG_PMU2_OTPREG2ATB_LSB 28 -#define PHY_ANALOG_PMU2_OTPREG2ATB_MASK 0x10000000 -#define PHY_ANALOG_PMU2_OTPREG2ATB_GET(x) (((x) & 0x10000000) >> 28) -#define PHY_ANALOG_PMU2_OTPREG2ATB_SET(x) (((x) << 28) & 0x10000000) -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_MSB 30 -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_LSB 29 -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_MASK 0x60000000 -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_GET(x) (((x) & 0x60000000) >> 29) -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_SET(x) (((x) << 29) & 0x60000000) -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_MANOVR_EN_MSB 31 -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_MANOVR_EN_LSB 31 -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_MANOVR_EN_MASK 0x80000000 -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_MANOVR_EN_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_ANALOG_PMU2_OTPREG_LVLCTR_MANOVR_EN_SET(x) (((x) << 31) & 0x80000000) - - -#ifndef __ASSEMBLER__ - -typedef struct analog_intf_athr_wlan_reg_reg_s { - volatile unsigned int RXRF_BIAS1; /* 0x0 - 0x4 */ - volatile unsigned int RXRF_BIAS2; /* 0x4 - 0x8 */ - volatile unsigned int RXRF_GAINSTAGES; /* 0x8 - 0xc */ - volatile unsigned int RXRF_AGC; /* 0xc - 0x10 */ - volatile char pad__0[0x30]; /* 0x10 - 0x40 */ - volatile unsigned int TXRF1; /* 0x40 - 0x44 */ - volatile unsigned int TXRF2; /* 0x44 - 0x48 */ - volatile unsigned int TXRF3; /* 0x48 - 0x4c */ - volatile unsigned int TXRF4; /* 0x4c - 0x50 */ - volatile unsigned int TXRF5; /* 0x50 - 0x54 */ - volatile unsigned int TXRF6; /* 0x54 - 0x58 */ - volatile unsigned int TXRF7; /* 0x58 - 0x5c */ - volatile unsigned int TXRF8; /* 0x5c - 0x60 */ - volatile unsigned int TXRF9; /* 0x60 - 0x64 */ - volatile unsigned int TXRF10; /* 0x64 - 0x68 */ - volatile unsigned int TXRF11; /* 0x68 - 0x6c */ - volatile unsigned int TXRF12; /* 0x6c - 0x70 */ - volatile char pad__1[0x10]; /* 0x70 - 0x80 */ - volatile unsigned int SYNTH1; /* 0x80 - 0x84 */ - volatile unsigned int SYNTH2; /* 0x84 - 0x88 */ - volatile unsigned int SYNTH3; /* 0x88 - 0x8c */ - volatile unsigned int SYNTH4; /* 0x8c - 0x90 */ - volatile unsigned int SYNTH5; /* 0x90 - 0x94 */ - volatile unsigned int SYNTH6; /* 0x94 - 0x98 */ - volatile unsigned int SYNTH7; /* 0x98 - 0x9c */ - volatile unsigned int SYNTH8; /* 0x9c - 0xa0 */ - volatile unsigned int SYNTH9; /* 0xa0 - 0xa4 */ - volatile unsigned int SYNTH10; /* 0xa4 - 0xa8 */ - volatile unsigned int SYNTH11; /* 0xa8 - 0xac */ - volatile unsigned int SYNTH12; /* 0xac - 0xb0 */ - volatile unsigned int SYNTH13; /* 0xb0 - 0xb4 */ - volatile unsigned int SYNTH14; /* 0xb4 - 0xb8 */ - volatile char pad__2[0x8]; /* 0xb8 - 0xc0 */ - volatile unsigned int BIAS1; /* 0xc0 - 0xc4 */ - volatile unsigned int BIAS2; /* 0xc4 - 0xc8 */ - volatile unsigned int BIAS3; /* 0xc8 - 0xcc */ - volatile unsigned int BIAS4; /* 0xcc - 0xd0 */ - volatile char pad__3[0x30]; /* 0xd0 - 0x100 */ - volatile unsigned int RXTX1; /* 0x100 - 0x104 */ - volatile unsigned int RXTX2; /* 0x104 - 0x108 */ - volatile unsigned int RXTX3; /* 0x108 - 0x10c */ - volatile char pad__4[0x34]; /* 0x10c - 0x140 */ - volatile unsigned int BB1; /* 0x140 - 0x144 */ - volatile unsigned int BB2; /* 0x144 - 0x148 */ - volatile unsigned int BB3; /* 0x148 - 0x14c */ - volatile char pad__5[0x134]; /* 0x14c - 0x280 */ - volatile unsigned int PLLCLKMODA; /* 0x280 - 0x284 */ - volatile unsigned int PLLCLKMODA2; /* 0x284 - 0x288 */ - volatile unsigned int TOP; /* 0x288 - 0x28c */ - volatile unsigned int THERM; /* 0x28c - 0x290 */ - volatile unsigned int XTAL; /* 0x290 - 0x294 */ - volatile char pad__6[0xec]; /* 0x294 - 0x380 */ - volatile unsigned int rbist_cntrl; /* 0x380 - 0x384 */ - volatile unsigned int tx_dc_offset; /* 0x384 - 0x388 */ - volatile unsigned int tx_tonegen0; /* 0x388 - 0x38c */ - volatile unsigned int tx_tonegen1; /* 0x38c - 0x390 */ - volatile unsigned int tx_lftonegen0; /* 0x390 - 0x394 */ - volatile unsigned int tx_linear_ramp_i; /* 0x394 - 0x398 */ - volatile unsigned int tx_linear_ramp_q; /* 0x398 - 0x39c */ - volatile unsigned int tx_prbs_mag; /* 0x39c - 0x3a0 */ - volatile unsigned int tx_prbs_seed_i; /* 0x3a0 - 0x3a4 */ - volatile unsigned int tx_prbs_seed_q; /* 0x3a4 - 0x3a8 */ - volatile unsigned int cmac_dc_cancel; /* 0x3a8 - 0x3ac */ - volatile unsigned int cmac_dc_offset; /* 0x3ac - 0x3b0 */ - volatile unsigned int cmac_corr; /* 0x3b0 - 0x3b4 */ - volatile unsigned int cmac_power; /* 0x3b4 - 0x3b8 */ - volatile unsigned int cmac_cross_corr; /* 0x3b8 - 0x3bc */ - volatile unsigned int cmac_i2q2; /* 0x3bc - 0x3c0 */ - volatile unsigned int cmac_power_hpf; /* 0x3c0 - 0x3c4 */ - volatile unsigned int rxdac_set1; /* 0x3c4 - 0x3c8 */ - volatile unsigned int rxdac_set2; /* 0x3c8 - 0x3cc */ - volatile unsigned int rxdac_long_shift; /* 0x3cc - 0x3d0 */ - volatile unsigned int cmac_results_i; /* 0x3d0 - 0x3d4 */ - volatile unsigned int cmac_results_q; /* 0x3d4 - 0x3d8 */ - volatile char pad__7[0x368]; /* 0x3d8 - 0x740 */ - volatile unsigned int PMU1; /* 0x740 - 0x744 */ - volatile unsigned int PMU2; /* 0x744 - 0x748 */ -} analog_intf_athr_wlan_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _ANALOG_INTF_ATHR_WLAN_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/analog_intf_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/analog_intf_reg.h deleted file mode 100644 index ab3e163e857f..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/analog_intf_reg.h +++ /dev/null @@ -1,37 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "analog_intf_athr_wlan_reg.h" - - -#ifndef BT_HEADERS - - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/apb_athr_wlan_map.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/apb_athr_wlan_map.h deleted file mode 100644 index 15637c1d0844..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/apb_athr_wlan_map.h +++ /dev/null @@ -1,72 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _APB_ATHR_WLAN_MAP_H_ -#define _APB_ATHR_WLAN_MAP_H_ - -#define RTC_SOC_BASE_ADDRESS 0x00004000 -#define RTC_WMAC_BASE_ADDRESS 0x00005000 -#define MAC_COEX_BASE_ADDRESS 0x00006000 -#define BT_COEX_BASE_ADDRESS 0x00007000 -#define MIT_BASE_ADDRESS 0x00008000 -#define WLAN_UART_BASE_ADDRESS 0x0000c000 -#define WLAN_DBG_UART_BASE_ADDRESS 0x0000d000 -#define WLAN_UMBOX_BASE_ADDRESS 0x0000e000 -#define WLAN_SI_BASE_ADDRESS 0x00010000 -#define WLAN_GPIO_BASE_ADDRESS 0x00014000 -#define WLAN_MBOX_BASE_ADDRESS 0x00018000 -#define WLAN_ANALOG_INTF_BASE_ADDRESS 0x0001c000 -#define WLAN_MAC_BASE_ADDRESS 0x00020000 -#define EFUSE_BASE_ADDRESS 0x00030000 -#define STEREO_BASE_ADDRESS 0x00034000 -#define CKSUM_ACC_BASE_ADDRESS 0x00035000 -#define STEREO_1_BASE_ADDRESS 0x00036000 -#define MMAC_BASE_ADDRESS 0x00038000 -#define FPGA_REG_BASE_ADDRESS 0x00039000 -#define GMAC_INTR_BASE_ADDRESS 0x00040000 -#define GMAC_RGMII_BASE_ADDRESS 0x00040100 -#define GMAC_MDIO_BASE_ADDRESS 0x00040200 -#define GMAC_CHAIN_0_RX_BASE_ADDRESS 0x00040800 -#define GMAC_CHAIN_0_TX_BASE_ADDRESS 0x00040c00 -#define SFMBOX_SDIO2_BASE_ADDRESS 0x00044000 -#define SFMBOX_SPI2_BASE_ADDRESS 0x00048000 -#define SVD_BASE_ADDRESS 0x00050000 -#define USB_INTR_BASE_ADDRESS 0x00054000 -#define USB_CHAIN_0_RX_BASE_ADDRESS 0x00054100 -#define USB_CHAIN_1_RX_BASE_ADDRESS 0x00054200 -#define USB_CHAIN_2_RX_BASE_ADDRESS 0x00054300 -#define USB_CHAIN_3_RX_BASE_ADDRESS 0x00054400 -#define USB_CHAIN_4_RX_BASE_ADDRESS 0x00054500 -#define USB_CHAIN_5_RX_BASE_ADDRESS 0x00054600 -#define USB_CHAIN_0_TX_BASE_ADDRESS 0x00054700 -#define USB_CHAIN_1_TX_BASE_ADDRESS 0x00054800 -#define USB_CHAIN_2_TX_BASE_ADDRESS 0x00054900 -#define USB_CHAIN_3_TX_BASE_ADDRESS 0x00054a00 -#define USB_CHAIN_4_TX_BASE_ADDRESS 0x00054b00 -#define WLAN_UART2_BASE_ADDRESS 0x00054c00 -#define WLAN_RDMA_BASE_ADDRESS 0x00054d00 -#define I2C_SLAVE_BASE_ADDRESS 0x00054e00 -#define MBOX_I2S_BASE_ADDRESS 0x00055000 -#define MBOX_I2S_1_BASE_ADDRESS 0x00056000 - -#endif /* _APB_ATHR_WLAN_MAP_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/apb_map.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/apb_map.h deleted file mode 100644 index d4894c0b12d6..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/apb_map.h +++ /dev/null @@ -1,47 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "apb_athr_wlan_map.h" - - -#ifndef BT_HEADERS - -#define UART_BASE_ADDRESS WLAN_UART_BASE_ADDRESS -#define DBG_UART_BASE_ADDRESS WLAN_DBG_UART_BASE_ADDRESS -#define UMBOX_BASE_ADDRESS WLAN_UMBOX_BASE_ADDRESS -#define SI_BASE_ADDRESS WLAN_SI_BASE_ADDRESS -#define GPIO_BASE_ADDRESS WLAN_GPIO_BASE_ADDRESS -#define MBOX_BASE_ADDRESS WLAN_MBOX_BASE_ADDRESS -#define ANALOG_INTF_BASE_ADDRESS WLAN_ANALOG_INTF_BASE_ADDRESS -#define MAC_BASE_ADDRESS WLAN_MAC_BASE_ADDRESS -#define UART2_BASE_ADDRESS WLAN_UART2_BASE_ADDRESS -#define RDMA_BASE_ADDRESS WLAN_RDMA_BASE_ADDRESS - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/athrI2cSlaveApbCsr.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/athrI2cSlaveApbCsr.h deleted file mode 100644 index 30ada999a274..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/athrI2cSlaveApbCsr.h +++ /dev/null @@ -1,474 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _ATHRI2CSLAVEAPBCSR_REG_H_ -#define _ATHRI2CSLAVEAPBCSR_REG_H_ - - -/* macros for I2cFifoControl */ -#define I2CFIFOCONTROL_ADDRESS 0x00000000 -#define I2CFIFOCONTROL_OFFSET 0x00000000 -#define I2CFIFOCONTROL_I2CFIFORESET_MSB 0 -#define I2CFIFOCONTROL_I2CFIFORESET_LSB 0 -#define I2CFIFOCONTROL_I2CFIFORESET_MASK 0x00000001 -#define I2CFIFOCONTROL_I2CFIFORESET_GET(x) (((x) & 0x00000001) >> 0) -#define I2CFIFOCONTROL_I2CFIFORESET_SET(x) (((x) << 0) & 0x00000001) -#define I2CFIFOCONTROL_I2CFIFOPREFETCH_MSB 1 -#define I2CFIFOCONTROL_I2CFIFOPREFETCH_LSB 1 -#define I2CFIFOCONTROL_I2CFIFOPREFETCH_MASK 0x00000002 -#define I2CFIFOCONTROL_I2CFIFOPREFETCH_GET(x) (((x) & 0x00000002) >> 1) -#define I2CFIFOCONTROL_I2CFIFOPREFETCH_SET(x) (((x) << 1) & 0x00000002) -#define I2CFIFOCONTROL_I2CFIFOREADLENGTH_MSB 4 -#define I2CFIFOCONTROL_I2CFIFOREADLENGTH_LSB 2 -#define I2CFIFOCONTROL_I2CFIFOREADLENGTH_MASK 0x0000001c -#define I2CFIFOCONTROL_I2CFIFOREADLENGTH_GET(x) (((x) & 0x0000001c) >> 2) -#define I2CFIFOCONTROL_I2CFIFOREADLENGTH_SET(x) (((x) << 2) & 0x0000001c) -#define I2CFIFOCONTROL_I2CFIFOREADTHRESHOLD_MSB 14 -#define I2CFIFOCONTROL_I2CFIFOREADTHRESHOLD_LSB 5 -#define I2CFIFOCONTROL_I2CFIFOREADTHRESHOLD_MASK 0x00007fe0 -#define I2CFIFOCONTROL_I2CFIFOREADTHRESHOLD_GET(x) (((x) & 0x00007fe0) >> 5) -#define I2CFIFOCONTROL_I2CFIFOREADTHRESHOLD_SET(x) (((x) << 5) & 0x00007fe0) -#define I2CFIFOCONTROL_I2CFIFOREADSTALL_MSB 15 -#define I2CFIFOCONTROL_I2CFIFOREADSTALL_LSB 15 -#define I2CFIFOCONTROL_I2CFIFOREADSTALL_MASK 0x00008000 -#define I2CFIFOCONTROL_I2CFIFOREADSTALL_GET(x) (((x) & 0x00008000) >> 15) -#define I2CFIFOCONTROL_I2CFIFOREADSTALL_SET(x) (((x) << 15) & 0x00008000) -#define I2CFIFOCONTROL_I2CFIFOWRITELENGTH_MSB 18 -#define I2CFIFOCONTROL_I2CFIFOWRITELENGTH_LSB 16 -#define I2CFIFOCONTROL_I2CFIFOWRITELENGTH_MASK 0x00070000 -#define I2CFIFOCONTROL_I2CFIFOWRITELENGTH_GET(x) (((x) & 0x00070000) >> 16) -#define I2CFIFOCONTROL_I2CFIFOWRITELENGTH_SET(x) (((x) << 16) & 0x00070000) -#define I2CFIFOCONTROL_I2CFIFOWRITETHRESHOLD_MSB 28 -#define I2CFIFOCONTROL_I2CFIFOWRITETHRESHOLD_LSB 19 -#define I2CFIFOCONTROL_I2CFIFOWRITETHRESHOLD_MASK 0x1ff80000 -#define I2CFIFOCONTROL_I2CFIFOWRITETHRESHOLD_GET(x) (((x) & 0x1ff80000) >> 19) -#define I2CFIFOCONTROL_I2CFIFOWRITETHRESHOLD_SET(x) (((x) << 19) & 0x1ff80000) -#define I2CFIFOCONTROL_I2CFIFOWRITESTALL_MSB 29 -#define I2CFIFOCONTROL_I2CFIFOWRITESTALL_LSB 29 -#define I2CFIFOCONTROL_I2CFIFOWRITESTALL_MASK 0x20000000 -#define I2CFIFOCONTROL_I2CFIFOWRITESTALL_GET(x) (((x) & 0x20000000) >> 29) -#define I2CFIFOCONTROL_I2CFIFOWRITESTALL_SET(x) (((x) << 29) & 0x20000000) - -/* macros for I2cFifoReadPtr */ -#define I2CFIFOREADPTR_ADDRESS 0x00000004 -#define I2CFIFOREADPTR_OFFSET 0x00000004 -#define I2CFIFOREADPTR_I2CFIFOREADWRPTR_MSB 9 -#define I2CFIFOREADPTR_I2CFIFOREADWRPTR_LSB 0 -#define I2CFIFOREADPTR_I2CFIFOREADWRPTR_MASK 0x000003ff -#define I2CFIFOREADPTR_I2CFIFOREADWRPTR_GET(x) (((x) & 0x000003ff) >> 0) -#define I2CFIFOREADPTR_I2CFIFOREADRDPTR_MSB 25 -#define I2CFIFOREADPTR_I2CFIFOREADRDPTR_LSB 16 -#define I2CFIFOREADPTR_I2CFIFOREADRDPTR_MASK 0x03ff0000 -#define I2CFIFOREADPTR_I2CFIFOREADRDPTR_GET(x) (((x) & 0x03ff0000) >> 16) - -/* macros for I2cFifoReadUpdate */ -#define I2CFIFOREADUPDATE_ADDRESS 0x00000008 -#define I2CFIFOREADUPDATE_OFFSET 0x00000008 -#define I2CFIFOREADUPDATE_I2CFIFOREADUPDATE_MSB 10 -#define I2CFIFOREADUPDATE_I2CFIFOREADUPDATE_LSB 0 -#define I2CFIFOREADUPDATE_I2CFIFOREADUPDATE_MASK 0x000007ff -#define I2CFIFOREADUPDATE_I2CFIFOREADUPDATE_GET(x) (((x) & 0x000007ff) >> 0) -#define I2CFIFOREADUPDATE_I2CFIFOREADUPDATE_SET(x) (((x) << 0) & 0x000007ff) - -/* macros for I2cFifoReadBaseAddr */ -#define I2CFIFOREADBASEADDR_ADDRESS 0x0000000c -#define I2CFIFOREADBASEADDR_OFFSET 0x0000000c -#define I2CFIFOREADBASEADDR_I2CFIFOREADBASEADDR_MSB 31 -#define I2CFIFOREADBASEADDR_I2CFIFOREADBASEADDR_LSB 0 -#define I2CFIFOREADBASEADDR_I2CFIFOREADBASEADDR_MASK 0xffffffff -#define I2CFIFOREADBASEADDR_I2CFIFOREADBASEADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define I2CFIFOREADBASEADDR_I2CFIFOREADBASEADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for I2cFifoWritePtr */ -#define I2CFIFOWRITEPTR_ADDRESS 0x00000010 -#define I2CFIFOWRITEPTR_OFFSET 0x00000010 -#define I2CFIFOWRITEPTR_I2CFIFOWRITEWRPTR_MSB 9 -#define I2CFIFOWRITEPTR_I2CFIFOWRITEWRPTR_LSB 0 -#define I2CFIFOWRITEPTR_I2CFIFOWRITEWRPTR_MASK 0x000003ff -#define I2CFIFOWRITEPTR_I2CFIFOWRITEWRPTR_GET(x) (((x) & 0x000003ff) >> 0) -#define I2CFIFOWRITEPTR_I2CFIFOWRITERDPTR_MSB 25 -#define I2CFIFOWRITEPTR_I2CFIFOWRITERDPTR_LSB 16 -#define I2CFIFOWRITEPTR_I2CFIFOWRITERDPTR_MASK 0x03ff0000 -#define I2CFIFOWRITEPTR_I2CFIFOWRITERDPTR_GET(x) (((x) & 0x03ff0000) >> 16) - -/* macros for I2cFifoWriteUpdate */ -#define I2CFIFOWRITEUPDATE_ADDRESS 0x00000014 -#define I2CFIFOWRITEUPDATE_OFFSET 0x00000014 -#define I2CFIFOWRITEUPDATE_I2CFIFOWRITEUPDATE_MSB 10 -#define I2CFIFOWRITEUPDATE_I2CFIFOWRITEUPDATE_LSB 0 -#define I2CFIFOWRITEUPDATE_I2CFIFOWRITEUPDATE_MASK 0x000007ff -#define I2CFIFOWRITEUPDATE_I2CFIFOWRITEUPDATE_GET(x) (((x) & 0x000007ff) >> 0) -#define I2CFIFOWRITEUPDATE_I2CFIFOWRITEUPDATE_SET(x) (((x) << 0) & 0x000007ff) - -/* macros for I2cFifoWriteBaseAddr */ -#define I2CFIFOWRITEBASEADDR_ADDRESS 0x00000018 -#define I2CFIFOWRITEBASEADDR_OFFSET 0x00000018 -#define I2CFIFOWRITEBASEADDR_I2CFIFOWRITEBASEADDR_MSB 31 -#define I2CFIFOWRITEBASEADDR_I2CFIFOWRITEBASEADDR_LSB 0 -#define I2CFIFOWRITEBASEADDR_I2CFIFOWRITEBASEADDR_MASK 0xffffffff -#define I2CFIFOWRITEBASEADDR_I2CFIFOWRITEBASEADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define I2CFIFOWRITEBASEADDR_I2CFIFOWRITEBASEADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for I2cMemControl */ -#define I2CMEMCONTROL_ADDRESS 0x0000001c -#define I2CMEMCONTROL_OFFSET 0x0000001c -#define I2CMEMCONTROL_I2CMEMRESET_MSB 0 -#define I2CMEMCONTROL_I2CMEMRESET_LSB 0 -#define I2CMEMCONTROL_I2CMEMRESET_MASK 0x00000001 -#define I2CMEMCONTROL_I2CMEMRESET_GET(x) (((x) & 0x00000001) >> 0) -#define I2CMEMCONTROL_I2CMEMRESET_SET(x) (((x) << 0) & 0x00000001) -#define I2CMEMCONTROL_I2CMEMFLUSH_MSB 1 -#define I2CMEMCONTROL_I2CMEMFLUSH_LSB 1 -#define I2CMEMCONTROL_I2CMEMFLUSH_MASK 0x00000002 -#define I2CMEMCONTROL_I2CMEMFLUSH_GET(x) (((x) & 0x00000002) >> 1) -#define I2CMEMCONTROL_I2CMEMFLUSH_SET(x) (((x) << 1) & 0x00000002) - -/* macros for I2cMemBaseAddr */ -#define I2CMEMBASEADDR_ADDRESS 0x00000020 -#define I2CMEMBASEADDR_OFFSET 0x00000020 -#define I2CMEMBASEADDR_I2CMEMBASEADDR_MSB 31 -#define I2CMEMBASEADDR_I2CMEMBASEADDR_LSB 0 -#define I2CMEMBASEADDR_I2CMEMBASEADDR_MASK 0xffffffff -#define I2CMEMBASEADDR_I2CMEMBASEADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define I2CMEMBASEADDR_I2CMEMBASEADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for I2cRegReadData */ -#define I2CREGREADDATA_ADDRESS 0x00000024 -#define I2CREGREADDATA_OFFSET 0x00000024 -#define I2CREGREADDATA_I2CREGREADDATA_MSB 31 -#define I2CREGREADDATA_I2CREGREADDATA_LSB 0 -#define I2CREGREADDATA_I2CREGREADDATA_MASK 0xffffffff -#define I2CREGREADDATA_I2CREGREADDATA_GET(x) (((x) & 0xffffffff) >> 0) -#define I2CREGREADDATA_I2CREGREADDATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for I2cRegWriteData */ -#define I2CREGWRITEDATA_ADDRESS 0x00000028 -#define I2CREGWRITEDATA_OFFSET 0x00000028 -#define I2CREGWRITEDATA_I2CREGWRITEDATA_MSB 31 -#define I2CREGWRITEDATA_I2CREGWRITEDATA_LSB 0 -#define I2CREGWRITEDATA_I2CREGWRITEDATA_MASK 0xffffffff -#define I2CREGWRITEDATA_I2CREGWRITEDATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for I2cRegControl */ -#define I2CREGCONTROL_ADDRESS 0x0000002c -#define I2CREGCONTROL_OFFSET 0x0000002c -#define I2CREGCONTROL_I2CREGRESET_MSB 0 -#define I2CREGCONTROL_I2CREGRESET_LSB 0 -#define I2CREGCONTROL_I2CREGRESET_MASK 0x00000001 -#define I2CREGCONTROL_I2CREGRESET_GET(x) (((x) & 0x00000001) >> 0) -#define I2CREGCONTROL_I2CREGRESET_SET(x) (((x) << 0) & 0x00000001) -#define I2CREGCONTROL_I2CREGREADSTALL_MSB 1 -#define I2CREGCONTROL_I2CREGREADSTALL_LSB 1 -#define I2CREGCONTROL_I2CREGREADSTALL_MASK 0x00000002 -#define I2CREGCONTROL_I2CREGREADSTALL_GET(x) (((x) & 0x00000002) >> 1) -#define I2CREGCONTROL_I2CREGREADSTALL_SET(x) (((x) << 1) & 0x00000002) -#define I2CREGCONTROL_I2CREGWRITESTALL_MSB 2 -#define I2CREGCONTROL_I2CREGWRITESTALL_LSB 2 -#define I2CREGCONTROL_I2CREGWRITESTALL_MASK 0x00000004 -#define I2CREGCONTROL_I2CREGWRITESTALL_GET(x) (((x) & 0x00000004) >> 2) -#define I2CREGCONTROL_I2CREGWRITESTALL_SET(x) (((x) << 2) & 0x00000004) -#define I2CREGCONTROL_I2CREGREADCOUNT_MSB 5 -#define I2CREGCONTROL_I2CREGREADCOUNT_LSB 3 -#define I2CREGCONTROL_I2CREGREADCOUNT_MASK 0x00000038 -#define I2CREGCONTROL_I2CREGREADCOUNT_GET(x) (((x) & 0x00000038) >> 3) -#define I2CREGCONTROL_I2CREGWRITECOUNT_MSB 8 -#define I2CREGCONTROL_I2CREGWRITECOUNT_LSB 6 -#define I2CREGCONTROL_I2CREGWRITECOUNT_MASK 0x000001c0 -#define I2CREGCONTROL_I2CREGWRITECOUNT_GET(x) (((x) & 0x000001c0) >> 6) -#define I2CREGCONTROL_I2CREGREADEMPTY_MSB 9 -#define I2CREGCONTROL_I2CREGREADEMPTY_LSB 9 -#define I2CREGCONTROL_I2CREGREADEMPTY_MASK 0x00000200 -#define I2CREGCONTROL_I2CREGREADEMPTY_GET(x) (((x) & 0x00000200) >> 9) -#define I2CREGCONTROL_I2CREGWRITEFULL_MSB 10 -#define I2CREGCONTROL_I2CREGWRITEFULL_LSB 10 -#define I2CREGCONTROL_I2CREGWRITEFULL_MASK 0x00000400 -#define I2CREGCONTROL_I2CREGWRITEFULL_GET(x) (((x) & 0x00000400) >> 10) - -/* macros for I2cCsrReadData */ -#define I2CCSRREADDATA_ADDRESS 0x00000030 -#define I2CCSRREADDATA_OFFSET 0x00000030 -#define I2CCSRREADDATA_I2CCSRREADDATA_MSB 5 -#define I2CCSRREADDATA_I2CCSRREADDATA_LSB 0 -#define I2CCSRREADDATA_I2CCSRREADDATA_MASK 0x0000003f -#define I2CCSRREADDATA_I2CCSRREADDATA_GET(x) (((x) & 0x0000003f) >> 0) -#define I2CCSRREADDATA_I2CCSRREADDATA_SET(x) (((x) << 0) & 0x0000003f) - -/* macros for I2cCsrWriteData */ -#define I2CCSRWRITEDATA_ADDRESS 0x00000034 -#define I2CCSRWRITEDATA_OFFSET 0x00000034 -#define I2CCSRWRITEDATA_I2CCSRWRITEDATA_MSB 5 -#define I2CCSRWRITEDATA_I2CCSRWRITEDATA_LSB 0 -#define I2CCSRWRITEDATA_I2CCSRWRITEDATA_MASK 0x0000003f -#define I2CCSRWRITEDATA_I2CCSRWRITEDATA_GET(x) (((x) & 0x0000003f) >> 0) - -/* macros for I2cCsrControl */ -#define I2CCSRCONTROL_ADDRESS 0x00000038 -#define I2CCSRCONTROL_OFFSET 0x00000038 -#define I2CCSRCONTROL_I2CCSRREADDELAY_MSB 7 -#define I2CCSRCONTROL_I2CCSRREADDELAY_LSB 0 -#define I2CCSRCONTROL_I2CCSRREADDELAY_MASK 0x000000ff -#define I2CCSRCONTROL_I2CCSRREADDELAY_GET(x) (((x) & 0x000000ff) >> 0) -#define I2CCSRCONTROL_I2CCSRREADDELAY_SET(x) (((x) << 0) & 0x000000ff) -#define I2CCSRCONTROL_I2CCSRCLOCKREQUESTENABLE_MSB 8 -#define I2CCSRCONTROL_I2CCSRCLOCKREQUESTENABLE_LSB 8 -#define I2CCSRCONTROL_I2CCSRCLOCKREQUESTENABLE_MASK 0x00000100 -#define I2CCSRCONTROL_I2CCSRCLOCKREQUESTENABLE_GET(x) (((x) & 0x00000100) >> 8) -#define I2CCSRCONTROL_I2CCSRCLOCKREQUESTENABLE_SET(x) (((x) << 8) & 0x00000100) -#define I2CCSRCONTROL_I2CCSRFILTERCLOCKSELECT_MSB 11 -#define I2CCSRCONTROL_I2CCSRFILTERCLOCKSELECT_LSB 9 -#define I2CCSRCONTROL_I2CCSRFILTERCLOCKSELECT_MASK 0x00000e00 -#define I2CCSRCONTROL_I2CCSRFILTERCLOCKSELECT_GET(x) (((x) & 0x00000e00) >> 9) -#define I2CCSRCONTROL_I2CCSRFILTERCLOCKSELECT_SET(x) (((x) << 9) & 0x00000e00) -#define I2CCSRCONTROL_I2CCSRFILTERCLOCKSCALE_MSB 14 -#define I2CCSRCONTROL_I2CCSRFILTERCLOCKSCALE_LSB 12 -#define I2CCSRCONTROL_I2CCSRFILTERCLOCKSCALE_MASK 0x00007000 -#define I2CCSRCONTROL_I2CCSRFILTERCLOCKSCALE_GET(x) (((x) & 0x00007000) >> 12) -#define I2CCSRCONTROL_I2CCSRFILTERCLOCKSCALE_SET(x) (((x) << 12) & 0x00007000) -#define I2CCSRCONTROL_I2CCSRFILTERSDARXSELECT_MSB 17 -#define I2CCSRCONTROL_I2CCSRFILTERSDARXSELECT_LSB 15 -#define I2CCSRCONTROL_I2CCSRFILTERSDARXSELECT_MASK 0x00038000 -#define I2CCSRCONTROL_I2CCSRFILTERSDARXSELECT_GET(x) (((x) & 0x00038000) >> 15) -#define I2CCSRCONTROL_I2CCSRFILTERSDARXSELECT_SET(x) (((x) << 15) & 0x00038000) -#define I2CCSRCONTROL_I2CCSRFILTERSCLRXSELECT_MSB 20 -#define I2CCSRCONTROL_I2CCSRFILTERSCLRXSELECT_LSB 18 -#define I2CCSRCONTROL_I2CCSRFILTERSCLRXSELECT_MASK 0x001c0000 -#define I2CCSRCONTROL_I2CCSRFILTERSCLRXSELECT_GET(x) (((x) & 0x001c0000) >> 18) -#define I2CCSRCONTROL_I2CCSRFILTERSCLRXSELECT_SET(x) (((x) << 18) & 0x001c0000) - -/* macros for I2cFilterSize */ -#define I2CFILTERSIZE_ADDRESS 0x0000003c -#define I2CFILTERSIZE_OFFSET 0x0000003c -#define I2CFILTERSIZE_I2CFILTERSDARXSIZE_MSB 7 -#define I2CFILTERSIZE_I2CFILTERSDARXSIZE_LSB 0 -#define I2CFILTERSIZE_I2CFILTERSDARXSIZE_MASK 0x000000ff -#define I2CFILTERSIZE_I2CFILTERSDARXSIZE_GET(x) (((x) & 0x000000ff) >> 0) -#define I2CFILTERSIZE_I2CFILTERSDARXSIZE_SET(x) (((x) << 0) & 0x000000ff) -#define I2CFILTERSIZE_I2CFILTERSCLRXSIZE_MSB 15 -#define I2CFILTERSIZE_I2CFILTERSCLRXSIZE_LSB 8 -#define I2CFILTERSIZE_I2CFILTERSCLRXSIZE_MASK 0x0000ff00 -#define I2CFILTERSIZE_I2CFILTERSCLRXSIZE_GET(x) (((x) & 0x0000ff00) >> 8) -#define I2CFILTERSIZE_I2CFILTERSCLRXSIZE_SET(x) (((x) << 8) & 0x0000ff00) - -/* macros for I2cAddr */ -#define I2CADDR_ADDRESS 0x00000040 -#define I2CADDR_OFFSET 0x00000040 -#define I2CADDR_I2CFIFOADDR_MSB 6 -#define I2CADDR_I2CFIFOADDR_LSB 0 -#define I2CADDR_I2CFIFOADDR_MASK 0x0000007f -#define I2CADDR_I2CFIFOADDR_GET(x) (((x) & 0x0000007f) >> 0) -#define I2CADDR_I2CFIFOADDR_SET(x) (((x) << 0) & 0x0000007f) -#define I2CADDR_I2CMEMADDR_MSB 14 -#define I2CADDR_I2CMEMADDR_LSB 8 -#define I2CADDR_I2CMEMADDR_MASK 0x00007f00 -#define I2CADDR_I2CMEMADDR_GET(x) (((x) & 0x00007f00) >> 8) -#define I2CADDR_I2CMEMADDR_SET(x) (((x) << 8) & 0x00007f00) -#define I2CADDR_I2CREGADDR_MSB 22 -#define I2CADDR_I2CREGADDR_LSB 16 -#define I2CADDR_I2CREGADDR_MASK 0x007f0000 -#define I2CADDR_I2CREGADDR_GET(x) (((x) & 0x007f0000) >> 16) -#define I2CADDR_I2CREGADDR_SET(x) (((x) << 16) & 0x007f0000) -#define I2CADDR_I2CCSRADDR_MSB 30 -#define I2CADDR_I2CCSRADDR_LSB 24 -#define I2CADDR_I2CCSRADDR_MASK 0x7f000000 -#define I2CADDR_I2CCSRADDR_GET(x) (((x) & 0x7f000000) >> 24) -#define I2CADDR_I2CCSRADDR_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for I2cInt */ -#define I2CINT_ADDRESS 0x00000044 -#define I2CINT_OFFSET 0x00000044 -#define I2CINT_I2CFIFOREADSTARTINT_MSB 0 -#define I2CINT_I2CFIFOREADSTARTINT_LSB 0 -#define I2CINT_I2CFIFOREADSTARTINT_MASK 0x00000001 -#define I2CINT_I2CFIFOREADSTARTINT_GET(x) (((x) & 0x00000001) >> 0) -#define I2CINT_I2CFIFOREADSTARTINT_SET(x) (((x) << 0) & 0x00000001) -#define I2CINT_I2CFIFOREADFINISHINT_MSB 1 -#define I2CINT_I2CFIFOREADFINISHINT_LSB 1 -#define I2CINT_I2CFIFOREADFINISHINT_MASK 0x00000002 -#define I2CINT_I2CFIFOREADFINISHINT_GET(x) (((x) & 0x00000002) >> 1) -#define I2CINT_I2CFIFOREADFINISHINT_SET(x) (((x) << 1) & 0x00000002) -#define I2CINT_I2CFIFOWRITESTARTINT_MSB 2 -#define I2CINT_I2CFIFOWRITESTARTINT_LSB 2 -#define I2CINT_I2CFIFOWRITESTARTINT_MASK 0x00000004 -#define I2CINT_I2CFIFOWRITESTARTINT_GET(x) (((x) & 0x00000004) >> 2) -#define I2CINT_I2CFIFOWRITESTARTINT_SET(x) (((x) << 2) & 0x00000004) -#define I2CINT_I2CFIFOWRITEFINISHINT_MSB 3 -#define I2CINT_I2CFIFOWRITEFINISHINT_LSB 3 -#define I2CINT_I2CFIFOWRITEFINISHINT_MASK 0x00000008 -#define I2CINT_I2CFIFOWRITEFINISHINT_GET(x) (((x) & 0x00000008) >> 3) -#define I2CINT_I2CFIFOWRITEFINISHINT_SET(x) (((x) << 3) & 0x00000008) -#define I2CINT_I2CREGREADSTARTINT_MSB 4 -#define I2CINT_I2CREGREADSTARTINT_LSB 4 -#define I2CINT_I2CREGREADSTARTINT_MASK 0x00000010 -#define I2CINT_I2CREGREADSTARTINT_GET(x) (((x) & 0x00000010) >> 4) -#define I2CINT_I2CREGREADSTARTINT_SET(x) (((x) << 4) & 0x00000010) -#define I2CINT_I2CREGREADFINISHINT_MSB 5 -#define I2CINT_I2CREGREADFINISHINT_LSB 5 -#define I2CINT_I2CREGREADFINISHINT_MASK 0x00000020 -#define I2CINT_I2CREGREADFINISHINT_GET(x) (((x) & 0x00000020) >> 5) -#define I2CINT_I2CREGREADFINISHINT_SET(x) (((x) << 5) & 0x00000020) -#define I2CINT_I2CREGWRITESTARTINT_MSB 6 -#define I2CINT_I2CREGWRITESTARTINT_LSB 6 -#define I2CINT_I2CREGWRITESTARTINT_MASK 0x00000040 -#define I2CINT_I2CREGWRITESTARTINT_GET(x) (((x) & 0x00000040) >> 6) -#define I2CINT_I2CREGWRITESTARTINT_SET(x) (((x) << 6) & 0x00000040) -#define I2CINT_I2CREGWRITEFINISHINT_MSB 7 -#define I2CINT_I2CREGWRITEFINISHINT_LSB 7 -#define I2CINT_I2CREGWRITEFINISHINT_MASK 0x00000080 -#define I2CINT_I2CREGWRITEFINISHINT_GET(x) (((x) & 0x00000080) >> 7) -#define I2CINT_I2CREGWRITEFINISHINT_SET(x) (((x) << 7) & 0x00000080) -#define I2CINT_I2CFIFOREADEMPTYINT_MSB 8 -#define I2CINT_I2CFIFOREADEMPTYINT_LSB 8 -#define I2CINT_I2CFIFOREADEMPTYINT_MASK 0x00000100 -#define I2CINT_I2CFIFOREADEMPTYINT_GET(x) (((x) & 0x00000100) >> 8) -#define I2CINT_I2CFIFOWRITEFULLINT_MSB 9 -#define I2CINT_I2CFIFOWRITEFULLINT_LSB 9 -#define I2CINT_I2CFIFOWRITEFULLINT_MASK 0x00000200 -#define I2CINT_I2CFIFOWRITEFULLINT_GET(x) (((x) & 0x00000200) >> 9) -#define I2CINT_I2CFIFOREADTHRESHOLDINT_MSB 10 -#define I2CINT_I2CFIFOREADTHRESHOLDINT_LSB 10 -#define I2CINT_I2CFIFOREADTHRESHOLDINT_MASK 0x00000400 -#define I2CINT_I2CFIFOREADTHRESHOLDINT_GET(x) (((x) & 0x00000400) >> 10) -#define I2CINT_I2CFIFOWRITETHRESHOLDINT_MSB 11 -#define I2CINT_I2CFIFOWRITETHRESHOLDINT_LSB 11 -#define I2CINT_I2CFIFOWRITETHRESHOLDINT_MASK 0x00000800 -#define I2CINT_I2CFIFOWRITETHRESHOLDINT_GET(x) (((x) & 0x00000800) >> 11) -#define I2CINT_I2CCSRINT_MSB 12 -#define I2CINT_I2CCSRINT_LSB 12 -#define I2CINT_I2CCSRINT_MASK 0x00001000 -#define I2CINT_I2CCSRINT_GET(x) (((x) & 0x00001000) >> 12) -#define I2CINT_I2CCSRINT_SET(x) (((x) << 12) & 0x00001000) - -/* macros for I2cIntEn */ -#define I2CINTEN_ADDRESS 0x00000048 -#define I2CINTEN_OFFSET 0x00000048 -#define I2CINTEN_I2CFIFOREADSTARTINTEN_MSB 0 -#define I2CINTEN_I2CFIFOREADSTARTINTEN_LSB 0 -#define I2CINTEN_I2CFIFOREADSTARTINTEN_MASK 0x00000001 -#define I2CINTEN_I2CFIFOREADSTARTINTEN_GET(x) (((x) & 0x00000001) >> 0) -#define I2CINTEN_I2CFIFOREADSTARTINTEN_SET(x) (((x) << 0) & 0x00000001) -#define I2CINTEN_I2CFIFOREADFINISHINTEN_MSB 1 -#define I2CINTEN_I2CFIFOREADFINISHINTEN_LSB 1 -#define I2CINTEN_I2CFIFOREADFINISHINTEN_MASK 0x00000002 -#define I2CINTEN_I2CFIFOREADFINISHINTEN_GET(x) (((x) & 0x00000002) >> 1) -#define I2CINTEN_I2CFIFOREADFINISHINTEN_SET(x) (((x) << 1) & 0x00000002) -#define I2CINTEN_I2CFIFOWRITESTARTINTEN_MSB 2 -#define I2CINTEN_I2CFIFOWRITESTARTINTEN_LSB 2 -#define I2CINTEN_I2CFIFOWRITESTARTINTEN_MASK 0x00000004 -#define I2CINTEN_I2CFIFOWRITESTARTINTEN_GET(x) (((x) & 0x00000004) >> 2) -#define I2CINTEN_I2CFIFOWRITESTARTINTEN_SET(x) (((x) << 2) & 0x00000004) -#define I2CINTEN_I2CFIFOWRITEFINISHINTEN_MSB 3 -#define I2CINTEN_I2CFIFOWRITEFINISHINTEN_LSB 3 -#define I2CINTEN_I2CFIFOWRITEFINISHINTEN_MASK 0x00000008 -#define I2CINTEN_I2CFIFOWRITEFINISHINTEN_GET(x) (((x) & 0x00000008) >> 3) -#define I2CINTEN_I2CFIFOWRITEFINISHINTEN_SET(x) (((x) << 3) & 0x00000008) -#define I2CINTEN_I2CREGREADSTARTINTEN_MSB 4 -#define I2CINTEN_I2CREGREADSTARTINTEN_LSB 4 -#define I2CINTEN_I2CREGREADSTARTINTEN_MASK 0x00000010 -#define I2CINTEN_I2CREGREADSTARTINTEN_GET(x) (((x) & 0x00000010) >> 4) -#define I2CINTEN_I2CREGREADSTARTINTEN_SET(x) (((x) << 4) & 0x00000010) -#define I2CINTEN_I2CREGREADFINISHINTEN_MSB 5 -#define I2CINTEN_I2CREGREADFINISHINTEN_LSB 5 -#define I2CINTEN_I2CREGREADFINISHINTEN_MASK 0x00000020 -#define I2CINTEN_I2CREGREADFINISHINTEN_GET(x) (((x) & 0x00000020) >> 5) -#define I2CINTEN_I2CREGREADFINISHINTEN_SET(x) (((x) << 5) & 0x00000020) -#define I2CINTEN_I2CREGWRITESTARTINTEN_MSB 6 -#define I2CINTEN_I2CREGWRITESTARTINTEN_LSB 6 -#define I2CINTEN_I2CREGWRITESTARTINTEN_MASK 0x00000040 -#define I2CINTEN_I2CREGWRITESTARTINTEN_GET(x) (((x) & 0x00000040) >> 6) -#define I2CINTEN_I2CREGWRITESTARTINTEN_SET(x) (((x) << 6) & 0x00000040) -#define I2CINTEN_I2CREGWRITEFINISHINTEN_MSB 7 -#define I2CINTEN_I2CREGWRITEFINISHINTEN_LSB 7 -#define I2CINTEN_I2CREGWRITEFINISHINTEN_MASK 0x00000080 -#define I2CINTEN_I2CREGWRITEFINISHINTEN_GET(x) (((x) & 0x00000080) >> 7) -#define I2CINTEN_I2CREGWRITEFINISHINTEN_SET(x) (((x) << 7) & 0x00000080) -#define I2CINTEN_I2CFIFOREADEMPTYINTEN_MSB 8 -#define I2CINTEN_I2CFIFOREADEMPTYINTEN_LSB 8 -#define I2CINTEN_I2CFIFOREADEMPTYINTEN_MASK 0x00000100 -#define I2CINTEN_I2CFIFOREADEMPTYINTEN_GET(x) (((x) & 0x00000100) >> 8) -#define I2CINTEN_I2CFIFOREADEMPTYINTEN_SET(x) (((x) << 8) & 0x00000100) -#define I2CINTEN_I2CFIFOWRITEFULLINTEN_MSB 9 -#define I2CINTEN_I2CFIFOWRITEFULLINTEN_LSB 9 -#define I2CINTEN_I2CFIFOWRITEFULLINTEN_MASK 0x00000200 -#define I2CINTEN_I2CFIFOWRITEFULLINTEN_GET(x) (((x) & 0x00000200) >> 9) -#define I2CINTEN_I2CFIFOWRITEFULLINTEN_SET(x) (((x) << 9) & 0x00000200) -#define I2CINTEN_I2CFIFOREADTHRESHOLDINTEN_MSB 10 -#define I2CINTEN_I2CFIFOREADTHRESHOLDINTEN_LSB 10 -#define I2CINTEN_I2CFIFOREADTHRESHOLDINTEN_MASK 0x00000400 -#define I2CINTEN_I2CFIFOREADTHRESHOLDINTEN_GET(x) (((x) & 0x00000400) >> 10) -#define I2CINTEN_I2CFIFOREADTHRESHOLDINTEN_SET(x) (((x) << 10) & 0x00000400) -#define I2CINTEN_I2CFIFOWRITETHRESHOLDINTEN_MSB 11 -#define I2CINTEN_I2CFIFOWRITETHRESHOLDINTEN_LSB 11 -#define I2CINTEN_I2CFIFOWRITETHRESHOLDINTEN_MASK 0x00000800 -#define I2CINTEN_I2CFIFOWRITETHRESHOLDINTEN_GET(x) (((x) & 0x00000800) >> 11) -#define I2CINTEN_I2CFIFOWRITETHRESHOLDINTEN_SET(x) (((x) << 11) & 0x00000800) -#define I2CINTEN_I2CCSRINTEN_MSB 12 -#define I2CINTEN_I2CCSRINTEN_LSB 12 -#define I2CINTEN_I2CCSRINTEN_MASK 0x00001000 -#define I2CINTEN_I2CCSRINTEN_GET(x) (((x) & 0x00001000) >> 12) -#define I2CINTEN_I2CCSRINTEN_SET(x) (((x) << 12) & 0x00001000) - -/* macros for I2cIntCsr */ -#define I2CINTCSR_ADDRESS 0x0000004c -#define I2CINTCSR_OFFSET 0x0000004c -#define I2CINTCSR_I2CINT_MSB 0 -#define I2CINTCSR_I2CINT_LSB 0 -#define I2CINTCSR_I2CINT_MASK 0x00000001 -#define I2CINTCSR_I2CINT_GET(x) (((x) & 0x00000001) >> 0) -#define I2CINTCSR_I2CINTEN_MSB 1 -#define I2CINTCSR_I2CINTEN_LSB 1 -#define I2CINTCSR_I2CINTEN_MASK 0x00000002 -#define I2CINTCSR_I2CINTEN_GET(x) (((x) & 0x00000002) >> 1) -#define I2CINTCSR_I2CINTEN_SET(x) (((x) << 1) & 0x00000002) - - -#ifndef __ASSEMBLER__ - -typedef struct athrI2cSlaveApbCsr_reg_s { - volatile unsigned int I2cFifoControl; /* 0x0 - 0x4 */ - volatile unsigned int I2cFifoReadPtr; /* 0x4 - 0x8 */ - volatile unsigned int I2cFifoReadUpdate; /* 0x8 - 0xc */ - volatile unsigned int I2cFifoReadBaseAddr; /* 0xc - 0x10 */ - volatile unsigned int I2cFifoWritePtr; /* 0x10 - 0x14 */ - volatile unsigned int I2cFifoWriteUpdate; /* 0x14 - 0x18 */ - volatile unsigned int I2cFifoWriteBaseAddr; /* 0x18 - 0x1c */ - volatile unsigned int I2cMemControl; /* 0x1c - 0x20 */ - volatile unsigned int I2cMemBaseAddr; /* 0x20 - 0x24 */ - volatile unsigned int I2cRegReadData; /* 0x24 - 0x28 */ - volatile unsigned int I2cRegWriteData; /* 0x28 - 0x2c */ - volatile unsigned int I2cRegControl; /* 0x2c - 0x30 */ - volatile unsigned int I2cCsrReadData; /* 0x30 - 0x34 */ - volatile unsigned int I2cCsrWriteData; /* 0x34 - 0x38 */ - volatile unsigned int I2cCsrControl; /* 0x38 - 0x3c */ - volatile unsigned int I2cFilterSize; /* 0x3c - 0x40 */ - volatile unsigned int I2cAddr; /* 0x40 - 0x44 */ - volatile unsigned int I2cInt; /* 0x44 - 0x48 */ - volatile unsigned int I2cIntEn; /* 0x48 - 0x4c */ - volatile unsigned int I2cIntCsr; /* 0x4c - 0x50 */ -} athrI2cSlaveApbCsr_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _ATHRI2CSLAVEAPBCSR_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bb_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bb_reg.h deleted file mode 100644 index 23c97741cb40..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bb_reg.h +++ /dev/null @@ -1,8970 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _BB_REG_REG_H_ -#define _BB_REG_REG_H_ - - -/* macros for bb_chn_reg_map.BB_timing_controls_1 */ -#define BB_TIMING_CONTROLS_1_ADDRESS 0x00000000 -#define BB_TIMING_CONTROLS_1_OFFSET 0x00000000 -#define BB_TIMING_CONTROLS_1_STE_THR_MSB 6 -#define BB_TIMING_CONTROLS_1_STE_THR_LSB 0 -#define BB_TIMING_CONTROLS_1_STE_THR_MASK 0x0000007f -#define BB_TIMING_CONTROLS_1_STE_THR_GET(x) (((x) & 0x0000007f) >> 0) -#define BB_TIMING_CONTROLS_1_STE_THR_SET(x) (((x) << 0) & 0x0000007f) -#define BB_TIMING_CONTROLS_1_STE_TO_LONG1_MSB 12 -#define BB_TIMING_CONTROLS_1_STE_TO_LONG1_LSB 7 -#define BB_TIMING_CONTROLS_1_STE_TO_LONG1_MASK 0x00001f80 -#define BB_TIMING_CONTROLS_1_STE_TO_LONG1_GET(x) (((x) & 0x00001f80) >> 7) -#define BB_TIMING_CONTROLS_1_STE_TO_LONG1_SET(x) (((x) << 7) & 0x00001f80) -#define BB_TIMING_CONTROLS_1_TIMING_BACKOFF_MSB 16 -#define BB_TIMING_CONTROLS_1_TIMING_BACKOFF_LSB 13 -#define BB_TIMING_CONTROLS_1_TIMING_BACKOFF_MASK 0x0001e000 -#define BB_TIMING_CONTROLS_1_TIMING_BACKOFF_GET(x) (((x) & 0x0001e000) >> 13) -#define BB_TIMING_CONTROLS_1_TIMING_BACKOFF_SET(x) (((x) << 13) & 0x0001e000) -#define BB_TIMING_CONTROLS_1_ENABLE_HT_FINE_PPM_MSB 17 -#define BB_TIMING_CONTROLS_1_ENABLE_HT_FINE_PPM_LSB 17 -#define BB_TIMING_CONTROLS_1_ENABLE_HT_FINE_PPM_MASK 0x00020000 -#define BB_TIMING_CONTROLS_1_ENABLE_HT_FINE_PPM_GET(x) (((x) & 0x00020000) >> 17) -#define BB_TIMING_CONTROLS_1_ENABLE_HT_FINE_PPM_SET(x) (((x) << 17) & 0x00020000) -#define BB_TIMING_CONTROLS_1_HT_FINE_PPM_STREAM_MSB 19 -#define BB_TIMING_CONTROLS_1_HT_FINE_PPM_STREAM_LSB 18 -#define BB_TIMING_CONTROLS_1_HT_FINE_PPM_STREAM_MASK 0x000c0000 -#define BB_TIMING_CONTROLS_1_HT_FINE_PPM_STREAM_GET(x) (((x) & 0x000c0000) >> 18) -#define BB_TIMING_CONTROLS_1_HT_FINE_PPM_STREAM_SET(x) (((x) << 18) & 0x000c0000) -#define BB_TIMING_CONTROLS_1_HT_FINE_PPM_QAM_MSB 21 -#define BB_TIMING_CONTROLS_1_HT_FINE_PPM_QAM_LSB 20 -#define BB_TIMING_CONTROLS_1_HT_FINE_PPM_QAM_MASK 0x00300000 -#define BB_TIMING_CONTROLS_1_HT_FINE_PPM_QAM_GET(x) (((x) & 0x00300000) >> 20) -#define BB_TIMING_CONTROLS_1_HT_FINE_PPM_QAM_SET(x) (((x) << 20) & 0x00300000) -#define BB_TIMING_CONTROLS_1_ENABLE_LONG_CHANFIL_MSB 22 -#define BB_TIMING_CONTROLS_1_ENABLE_LONG_CHANFIL_LSB 22 -#define BB_TIMING_CONTROLS_1_ENABLE_LONG_CHANFIL_MASK 0x00400000 -#define BB_TIMING_CONTROLS_1_ENABLE_LONG_CHANFIL_GET(x) (((x) & 0x00400000) >> 22) -#define BB_TIMING_CONTROLS_1_ENABLE_LONG_CHANFIL_SET(x) (((x) << 22) & 0x00400000) -#define BB_TIMING_CONTROLS_1_ENABLE_RX_STBC_MSB 23 -#define BB_TIMING_CONTROLS_1_ENABLE_RX_STBC_LSB 23 -#define BB_TIMING_CONTROLS_1_ENABLE_RX_STBC_MASK 0x00800000 -#define BB_TIMING_CONTROLS_1_ENABLE_RX_STBC_GET(x) (((x) & 0x00800000) >> 23) -#define BB_TIMING_CONTROLS_1_ENABLE_RX_STBC_SET(x) (((x) << 23) & 0x00800000) -#define BB_TIMING_CONTROLS_1_ENABLE_CHANNEL_FILTER_MSB 24 -#define BB_TIMING_CONTROLS_1_ENABLE_CHANNEL_FILTER_LSB 24 -#define BB_TIMING_CONTROLS_1_ENABLE_CHANNEL_FILTER_MASK 0x01000000 -#define BB_TIMING_CONTROLS_1_ENABLE_CHANNEL_FILTER_GET(x) (((x) & 0x01000000) >> 24) -#define BB_TIMING_CONTROLS_1_ENABLE_CHANNEL_FILTER_SET(x) (((x) << 24) & 0x01000000) -#define BB_TIMING_CONTROLS_1_FALSE_ALARM_MSB 26 -#define BB_TIMING_CONTROLS_1_FALSE_ALARM_LSB 25 -#define BB_TIMING_CONTROLS_1_FALSE_ALARM_MASK 0x06000000 -#define BB_TIMING_CONTROLS_1_FALSE_ALARM_GET(x) (((x) & 0x06000000) >> 25) -#define BB_TIMING_CONTROLS_1_FALSE_ALARM_SET(x) (((x) << 25) & 0x06000000) -#define BB_TIMING_CONTROLS_1_ENABLE_LONG_RESCALE_MSB 27 -#define BB_TIMING_CONTROLS_1_ENABLE_LONG_RESCALE_LSB 27 -#define BB_TIMING_CONTROLS_1_ENABLE_LONG_RESCALE_MASK 0x08000000 -#define BB_TIMING_CONTROLS_1_ENABLE_LONG_RESCALE_GET(x) (((x) & 0x08000000) >> 27) -#define BB_TIMING_CONTROLS_1_ENABLE_LONG_RESCALE_SET(x) (((x) << 27) & 0x08000000) -#define BB_TIMING_CONTROLS_1_TIMING_LEAK_ENABLE_MSB 28 -#define BB_TIMING_CONTROLS_1_TIMING_LEAK_ENABLE_LSB 28 -#define BB_TIMING_CONTROLS_1_TIMING_LEAK_ENABLE_MASK 0x10000000 -#define BB_TIMING_CONTROLS_1_TIMING_LEAK_ENABLE_GET(x) (((x) & 0x10000000) >> 28) -#define BB_TIMING_CONTROLS_1_TIMING_LEAK_ENABLE_SET(x) (((x) << 28) & 0x10000000) -#define BB_TIMING_CONTROLS_1_COARSE_PPM_SELECT_MSB 30 -#define BB_TIMING_CONTROLS_1_COARSE_PPM_SELECT_LSB 29 -#define BB_TIMING_CONTROLS_1_COARSE_PPM_SELECT_MASK 0x60000000 -#define BB_TIMING_CONTROLS_1_COARSE_PPM_SELECT_GET(x) (((x) & 0x60000000) >> 29) -#define BB_TIMING_CONTROLS_1_COARSE_PPM_SELECT_SET(x) (((x) << 29) & 0x60000000) -#define BB_TIMING_CONTROLS_1_FFT_SCALING_MSB 31 -#define BB_TIMING_CONTROLS_1_FFT_SCALING_LSB 31 -#define BB_TIMING_CONTROLS_1_FFT_SCALING_MASK 0x80000000 -#define BB_TIMING_CONTROLS_1_FFT_SCALING_GET(x) (((x) & 0x80000000) >> 31) -#define BB_TIMING_CONTROLS_1_FFT_SCALING_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_chn_reg_map.BB_timing_controls_2 */ -#define BB_TIMING_CONTROLS_2_ADDRESS 0x00000004 -#define BB_TIMING_CONTROLS_2_OFFSET 0x00000004 -#define BB_TIMING_CONTROLS_2_FORCED_DELTA_PHI_SYMBOL_MSB 11 -#define BB_TIMING_CONTROLS_2_FORCED_DELTA_PHI_SYMBOL_LSB 0 -#define BB_TIMING_CONTROLS_2_FORCED_DELTA_PHI_SYMBOL_MASK 0x00000fff -#define BB_TIMING_CONTROLS_2_FORCED_DELTA_PHI_SYMBOL_GET(x) (((x) & 0x00000fff) >> 0) -#define BB_TIMING_CONTROLS_2_FORCED_DELTA_PHI_SYMBOL_SET(x) (((x) << 0) & 0x00000fff) -#define BB_TIMING_CONTROLS_2_FORCE_DELTA_PHI_SYMBOL_MSB 12 -#define BB_TIMING_CONTROLS_2_FORCE_DELTA_PHI_SYMBOL_LSB 12 -#define BB_TIMING_CONTROLS_2_FORCE_DELTA_PHI_SYMBOL_MASK 0x00001000 -#define BB_TIMING_CONTROLS_2_FORCE_DELTA_PHI_SYMBOL_GET(x) (((x) & 0x00001000) >> 12) -#define BB_TIMING_CONTROLS_2_FORCE_DELTA_PHI_SYMBOL_SET(x) (((x) << 12) & 0x00001000) -#define BB_TIMING_CONTROLS_2_ENABLE_MAGNITUDE_TRACK_MSB 13 -#define BB_TIMING_CONTROLS_2_ENABLE_MAGNITUDE_TRACK_LSB 13 -#define BB_TIMING_CONTROLS_2_ENABLE_MAGNITUDE_TRACK_MASK 0x00002000 -#define BB_TIMING_CONTROLS_2_ENABLE_MAGNITUDE_TRACK_GET(x) (((x) & 0x00002000) >> 13) -#define BB_TIMING_CONTROLS_2_ENABLE_MAGNITUDE_TRACK_SET(x) (((x) << 13) & 0x00002000) -#define BB_TIMING_CONTROLS_2_ENABLE_SLOPE_FILTER_MSB 14 -#define BB_TIMING_CONTROLS_2_ENABLE_SLOPE_FILTER_LSB 14 -#define BB_TIMING_CONTROLS_2_ENABLE_SLOPE_FILTER_MASK 0x00004000 -#define BB_TIMING_CONTROLS_2_ENABLE_SLOPE_FILTER_GET(x) (((x) & 0x00004000) >> 14) -#define BB_TIMING_CONTROLS_2_ENABLE_SLOPE_FILTER_SET(x) (((x) << 14) & 0x00004000) -#define BB_TIMING_CONTROLS_2_ENABLE_OFFSET_FILTER_MSB 15 -#define BB_TIMING_CONTROLS_2_ENABLE_OFFSET_FILTER_LSB 15 -#define BB_TIMING_CONTROLS_2_ENABLE_OFFSET_FILTER_MASK 0x00008000 -#define BB_TIMING_CONTROLS_2_ENABLE_OFFSET_FILTER_GET(x) (((x) & 0x00008000) >> 15) -#define BB_TIMING_CONTROLS_2_ENABLE_OFFSET_FILTER_SET(x) (((x) << 15) & 0x00008000) -#define BB_TIMING_CONTROLS_2_DC_OFF_DELTAF_THRES_MSB 22 -#define BB_TIMING_CONTROLS_2_DC_OFF_DELTAF_THRES_LSB 16 -#define BB_TIMING_CONTROLS_2_DC_OFF_DELTAF_THRES_MASK 0x007f0000 -#define BB_TIMING_CONTROLS_2_DC_OFF_DELTAF_THRES_GET(x) (((x) & 0x007f0000) >> 16) -#define BB_TIMING_CONTROLS_2_DC_OFF_DELTAF_THRES_SET(x) (((x) << 16) & 0x007f0000) -#define BB_TIMING_CONTROLS_2_DC_OFF_TIM_CONST_MSB 26 -#define BB_TIMING_CONTROLS_2_DC_OFF_TIM_CONST_LSB 24 -#define BB_TIMING_CONTROLS_2_DC_OFF_TIM_CONST_MASK 0x07000000 -#define BB_TIMING_CONTROLS_2_DC_OFF_TIM_CONST_GET(x) (((x) & 0x07000000) >> 24) -#define BB_TIMING_CONTROLS_2_DC_OFF_TIM_CONST_SET(x) (((x) << 24) & 0x07000000) -#define BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_MSB 27 -#define BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_LSB 27 -#define BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_MASK 0x08000000 -#define BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_GET(x) (((x) & 0x08000000) >> 27) -#define BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_SET(x) (((x) << 27) & 0x08000000) -#define BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_TRACK_MSB 28 -#define BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_TRACK_LSB 28 -#define BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_TRACK_MASK 0x10000000 -#define BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_TRACK_GET(x) (((x) & 0x10000000) >> 28) -#define BB_TIMING_CONTROLS_2_ENABLE_DC_OFFSET_TRACK_SET(x) (((x) << 28) & 0x10000000) -#define BB_TIMING_CONTROLS_2_ENABLE_WEIGHTING_MSB 29 -#define BB_TIMING_CONTROLS_2_ENABLE_WEIGHTING_LSB 29 -#define BB_TIMING_CONTROLS_2_ENABLE_WEIGHTING_MASK 0x20000000 -#define BB_TIMING_CONTROLS_2_ENABLE_WEIGHTING_GET(x) (((x) & 0x20000000) >> 29) -#define BB_TIMING_CONTROLS_2_ENABLE_WEIGHTING_SET(x) (((x) << 29) & 0x20000000) -#define BB_TIMING_CONTROLS_2_TRACEBACK128_MSB 30 -#define BB_TIMING_CONTROLS_2_TRACEBACK128_LSB 30 -#define BB_TIMING_CONTROLS_2_TRACEBACK128_MASK 0x40000000 -#define BB_TIMING_CONTROLS_2_TRACEBACK128_GET(x) (((x) & 0x40000000) >> 30) -#define BB_TIMING_CONTROLS_2_TRACEBACK128_SET(x) (((x) << 30) & 0x40000000) -#define BB_TIMING_CONTROLS_2_ENABLE_HT_FINE_TIMING_MSB 31 -#define BB_TIMING_CONTROLS_2_ENABLE_HT_FINE_TIMING_LSB 31 -#define BB_TIMING_CONTROLS_2_ENABLE_HT_FINE_TIMING_MASK 0x80000000 -#define BB_TIMING_CONTROLS_2_ENABLE_HT_FINE_TIMING_GET(x) (((x) & 0x80000000) >> 31) -#define BB_TIMING_CONTROLS_2_ENABLE_HT_FINE_TIMING_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_chn_reg_map.BB_timing_controls_3 */ -#define BB_TIMING_CONTROLS_3_ADDRESS 0x00000008 -#define BB_TIMING_CONTROLS_3_OFFSET 0x00000008 -#define BB_TIMING_CONTROLS_3_PPM_RESCUE_INTERVAL_MSB 7 -#define BB_TIMING_CONTROLS_3_PPM_RESCUE_INTERVAL_LSB 0 -#define BB_TIMING_CONTROLS_3_PPM_RESCUE_INTERVAL_MASK 0x000000ff -#define BB_TIMING_CONTROLS_3_PPM_RESCUE_INTERVAL_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_TIMING_CONTROLS_3_PPM_RESCUE_INTERVAL_SET(x) (((x) << 0) & 0x000000ff) -#define BB_TIMING_CONTROLS_3_ENABLE_PPM_RESCUE_MSB 8 -#define BB_TIMING_CONTROLS_3_ENABLE_PPM_RESCUE_LSB 8 -#define BB_TIMING_CONTROLS_3_ENABLE_PPM_RESCUE_MASK 0x00000100 -#define BB_TIMING_CONTROLS_3_ENABLE_PPM_RESCUE_GET(x) (((x) & 0x00000100) >> 8) -#define BB_TIMING_CONTROLS_3_ENABLE_PPM_RESCUE_SET(x) (((x) << 8) & 0x00000100) -#define BB_TIMING_CONTROLS_3_ENABLE_FINE_PPM_MSB 9 -#define BB_TIMING_CONTROLS_3_ENABLE_FINE_PPM_LSB 9 -#define BB_TIMING_CONTROLS_3_ENABLE_FINE_PPM_MASK 0x00000200 -#define BB_TIMING_CONTROLS_3_ENABLE_FINE_PPM_GET(x) (((x) & 0x00000200) >> 9) -#define BB_TIMING_CONTROLS_3_ENABLE_FINE_PPM_SET(x) (((x) << 9) & 0x00000200) -#define BB_TIMING_CONTROLS_3_ENABLE_FINE_INTERP_MSB 10 -#define BB_TIMING_CONTROLS_3_ENABLE_FINE_INTERP_LSB 10 -#define BB_TIMING_CONTROLS_3_ENABLE_FINE_INTERP_MASK 0x00000400 -#define BB_TIMING_CONTROLS_3_ENABLE_FINE_INTERP_GET(x) (((x) & 0x00000400) >> 10) -#define BB_TIMING_CONTROLS_3_ENABLE_FINE_INTERP_SET(x) (((x) << 10) & 0x00000400) -#define BB_TIMING_CONTROLS_3_CONTINUOUS_PPM_RESCUE_MSB 11 -#define BB_TIMING_CONTROLS_3_CONTINUOUS_PPM_RESCUE_LSB 11 -#define BB_TIMING_CONTROLS_3_CONTINUOUS_PPM_RESCUE_MASK 0x00000800 -#define BB_TIMING_CONTROLS_3_CONTINUOUS_PPM_RESCUE_GET(x) (((x) & 0x00000800) >> 11) -#define BB_TIMING_CONTROLS_3_CONTINUOUS_PPM_RESCUE_SET(x) (((x) << 11) & 0x00000800) -#define BB_TIMING_CONTROLS_3_ENABLE_DF_CHANEST_MSB 12 -#define BB_TIMING_CONTROLS_3_ENABLE_DF_CHANEST_LSB 12 -#define BB_TIMING_CONTROLS_3_ENABLE_DF_CHANEST_MASK 0x00001000 -#define BB_TIMING_CONTROLS_3_ENABLE_DF_CHANEST_GET(x) (((x) & 0x00001000) >> 12) -#define BB_TIMING_CONTROLS_3_ENABLE_DF_CHANEST_SET(x) (((x) << 12) & 0x00001000) -#define BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_EXP_MSB 16 -#define BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_EXP_LSB 13 -#define BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_EXP_MASK 0x0001e000 -#define BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_EXP_GET(x) (((x) & 0x0001e000) >> 13) -#define BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_EXP_SET(x) (((x) << 13) & 0x0001e000) -#define BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_MAN_MSB 31 -#define BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_MAN_LSB 17 -#define BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_MAN_MASK 0xfffe0000 -#define BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_MAN_GET(x) (((x) & 0xfffe0000) >> 17) -#define BB_TIMING_CONTROLS_3_DELTA_SLOPE_COEF_MAN_SET(x) (((x) << 17) & 0xfffe0000) - -/* macros for bb_chn_reg_map.BB_timing_control_4 */ -#define BB_TIMING_CONTROL_4_ADDRESS 0x0000000c -#define BB_TIMING_CONTROL_4_OFFSET 0x0000000c -#define BB_TIMING_CONTROL_4_CAL_LG_COUNT_MAX_MSB 15 -#define BB_TIMING_CONTROL_4_CAL_LG_COUNT_MAX_LSB 12 -#define BB_TIMING_CONTROL_4_CAL_LG_COUNT_MAX_MASK 0x0000f000 -#define BB_TIMING_CONTROL_4_CAL_LG_COUNT_MAX_GET(x) (((x) & 0x0000f000) >> 12) -#define BB_TIMING_CONTROL_4_CAL_LG_COUNT_MAX_SET(x) (((x) << 12) & 0x0000f000) -#define BB_TIMING_CONTROL_4_DO_GAIN_DC_IQ_CAL_MSB 16 -#define BB_TIMING_CONTROL_4_DO_GAIN_DC_IQ_CAL_LSB 16 -#define BB_TIMING_CONTROL_4_DO_GAIN_DC_IQ_CAL_MASK 0x00010000 -#define BB_TIMING_CONTROL_4_DO_GAIN_DC_IQ_CAL_GET(x) (((x) & 0x00010000) >> 16) -#define BB_TIMING_CONTROL_4_DO_GAIN_DC_IQ_CAL_SET(x) (((x) << 16) & 0x00010000) -#define BB_TIMING_CONTROL_4_USE_PILOT_TRACK_DF_MSB 20 -#define BB_TIMING_CONTROL_4_USE_PILOT_TRACK_DF_LSB 17 -#define BB_TIMING_CONTROL_4_USE_PILOT_TRACK_DF_MASK 0x001e0000 -#define BB_TIMING_CONTROL_4_USE_PILOT_TRACK_DF_GET(x) (((x) & 0x001e0000) >> 17) -#define BB_TIMING_CONTROL_4_USE_PILOT_TRACK_DF_SET(x) (((x) << 17) & 0x001e0000) -#define BB_TIMING_CONTROL_4_EARLY_TRIGGER_THR_MSB 27 -#define BB_TIMING_CONTROL_4_EARLY_TRIGGER_THR_LSB 21 -#define BB_TIMING_CONTROL_4_EARLY_TRIGGER_THR_MASK 0x0fe00000 -#define BB_TIMING_CONTROL_4_EARLY_TRIGGER_THR_GET(x) (((x) & 0x0fe00000) >> 21) -#define BB_TIMING_CONTROL_4_EARLY_TRIGGER_THR_SET(x) (((x) << 21) & 0x0fe00000) -#define BB_TIMING_CONTROL_4_ENABLE_PILOT_MASK_MSB 28 -#define BB_TIMING_CONTROL_4_ENABLE_PILOT_MASK_LSB 28 -#define BB_TIMING_CONTROL_4_ENABLE_PILOT_MASK_MASK 0x10000000 -#define BB_TIMING_CONTROL_4_ENABLE_PILOT_MASK_GET(x) (((x) & 0x10000000) >> 28) -#define BB_TIMING_CONTROL_4_ENABLE_PILOT_MASK_SET(x) (((x) << 28) & 0x10000000) -#define BB_TIMING_CONTROL_4_ENABLE_CHAN_MASK_MSB 29 -#define BB_TIMING_CONTROL_4_ENABLE_CHAN_MASK_LSB 29 -#define BB_TIMING_CONTROL_4_ENABLE_CHAN_MASK_MASK 0x20000000 -#define BB_TIMING_CONTROL_4_ENABLE_CHAN_MASK_GET(x) (((x) & 0x20000000) >> 29) -#define BB_TIMING_CONTROL_4_ENABLE_CHAN_MASK_SET(x) (((x) << 29) & 0x20000000) -#define BB_TIMING_CONTROL_4_ENABLE_SPUR_FILTER_MSB 30 -#define BB_TIMING_CONTROL_4_ENABLE_SPUR_FILTER_LSB 30 -#define BB_TIMING_CONTROL_4_ENABLE_SPUR_FILTER_MASK 0x40000000 -#define BB_TIMING_CONTROL_4_ENABLE_SPUR_FILTER_GET(x) (((x) & 0x40000000) >> 30) -#define BB_TIMING_CONTROL_4_ENABLE_SPUR_FILTER_SET(x) (((x) << 30) & 0x40000000) -#define BB_TIMING_CONTROL_4_ENABLE_SPUR_RSSI_MSB 31 -#define BB_TIMING_CONTROL_4_ENABLE_SPUR_RSSI_LSB 31 -#define BB_TIMING_CONTROL_4_ENABLE_SPUR_RSSI_MASK 0x80000000 -#define BB_TIMING_CONTROL_4_ENABLE_SPUR_RSSI_GET(x) (((x) & 0x80000000) >> 31) -#define BB_TIMING_CONTROL_4_ENABLE_SPUR_RSSI_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_chn_reg_map.BB_timing_control_5 */ -#define BB_TIMING_CONTROL_5_ADDRESS 0x00000010 -#define BB_TIMING_CONTROL_5_OFFSET 0x00000010 -#define BB_TIMING_CONTROL_5_ENABLE_CYCPWR_THR1_MSB 0 -#define BB_TIMING_CONTROL_5_ENABLE_CYCPWR_THR1_LSB 0 -#define BB_TIMING_CONTROL_5_ENABLE_CYCPWR_THR1_MASK 0x00000001 -#define BB_TIMING_CONTROL_5_ENABLE_CYCPWR_THR1_GET(x) (((x) & 0x00000001) >> 0) -#define BB_TIMING_CONTROL_5_ENABLE_CYCPWR_THR1_SET(x) (((x) << 0) & 0x00000001) -#define BB_TIMING_CONTROL_5_CYCPWR_THR1_MSB 7 -#define BB_TIMING_CONTROL_5_CYCPWR_THR1_LSB 1 -#define BB_TIMING_CONTROL_5_CYCPWR_THR1_MASK 0x000000fe -#define BB_TIMING_CONTROL_5_CYCPWR_THR1_GET(x) (((x) & 0x000000fe) >> 1) -#define BB_TIMING_CONTROL_5_CYCPWR_THR1_SET(x) (((x) << 1) & 0x000000fe) -#define BB_TIMING_CONTROL_5_ENABLE_RSSI_THR1A_MSB 15 -#define BB_TIMING_CONTROL_5_ENABLE_RSSI_THR1A_LSB 15 -#define BB_TIMING_CONTROL_5_ENABLE_RSSI_THR1A_MASK 0x00008000 -#define BB_TIMING_CONTROL_5_ENABLE_RSSI_THR1A_GET(x) (((x) & 0x00008000) >> 15) -#define BB_TIMING_CONTROL_5_ENABLE_RSSI_THR1A_SET(x) (((x) << 15) & 0x00008000) -#define BB_TIMING_CONTROL_5_RSSI_THR1A_MSB 22 -#define BB_TIMING_CONTROL_5_RSSI_THR1A_LSB 16 -#define BB_TIMING_CONTROL_5_RSSI_THR1A_MASK 0x007f0000 -#define BB_TIMING_CONTROL_5_RSSI_THR1A_GET(x) (((x) & 0x007f0000) >> 16) -#define BB_TIMING_CONTROL_5_RSSI_THR1A_SET(x) (((x) << 16) & 0x007f0000) -#define BB_TIMING_CONTROL_5_LONG_SC_THRESH_HI_RSSI_MSB 29 -#define BB_TIMING_CONTROL_5_LONG_SC_THRESH_HI_RSSI_LSB 23 -#define BB_TIMING_CONTROL_5_LONG_SC_THRESH_HI_RSSI_MASK 0x3f800000 -#define BB_TIMING_CONTROL_5_LONG_SC_THRESH_HI_RSSI_GET(x) (((x) & 0x3f800000) >> 23) -#define BB_TIMING_CONTROL_5_LONG_SC_THRESH_HI_RSSI_SET(x) (((x) << 23) & 0x3f800000) -#define BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_MSB 30 -#define BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_LSB 30 -#define BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_MASK 0x40000000 -#define BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_GET(x) (((x) & 0x40000000) >> 30) -#define BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_SET(x) (((x) << 30) & 0x40000000) -#define BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_EN_MSB 31 -#define BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_EN_LSB 31 -#define BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_EN_MASK 0x80000000 -#define BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_EN_GET(x) (((x) & 0x80000000) >> 31) -#define BB_TIMING_CONTROL_5_FORCED_AGC_STR_PRI_EN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_chn_reg_map.BB_timing_control_6 */ -#define BB_TIMING_CONTROL_6_ADDRESS 0x00000014 -#define BB_TIMING_CONTROL_6_OFFSET 0x00000014 -#define BB_TIMING_CONTROL_6_HI_RSSI_THRESH_MSB 7 -#define BB_TIMING_CONTROL_6_HI_RSSI_THRESH_LSB 0 -#define BB_TIMING_CONTROL_6_HI_RSSI_THRESH_MASK 0x000000ff -#define BB_TIMING_CONTROL_6_HI_RSSI_THRESH_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_TIMING_CONTROL_6_HI_RSSI_THRESH_SET(x) (((x) << 0) & 0x000000ff) -#define BB_TIMING_CONTROL_6_EARLY_TRIGGER_THR_HI_RSSI_MSB 14 -#define BB_TIMING_CONTROL_6_EARLY_TRIGGER_THR_HI_RSSI_LSB 8 -#define BB_TIMING_CONTROL_6_EARLY_TRIGGER_THR_HI_RSSI_MASK 0x00007f00 -#define BB_TIMING_CONTROL_6_EARLY_TRIGGER_THR_HI_RSSI_GET(x) (((x) & 0x00007f00) >> 8) -#define BB_TIMING_CONTROL_6_EARLY_TRIGGER_THR_HI_RSSI_SET(x) (((x) << 8) & 0x00007f00) -#define BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_MSB 20 -#define BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_LSB 15 -#define BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_MASK 0x001f8000 -#define BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_GET(x) (((x) & 0x001f8000) >> 15) -#define BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_SET(x) (((x) << 15) & 0x001f8000) -#define BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_HI_RSSI_MSB 27 -#define BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_HI_RSSI_LSB 21 -#define BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_HI_RSSI_MASK 0x0fe00000 -#define BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_HI_RSSI_GET(x) (((x) & 0x0fe00000) >> 21) -#define BB_TIMING_CONTROL_6_OFDM_XCORR_THRESH_HI_RSSI_SET(x) (((x) << 21) & 0x0fe00000) -#define BB_TIMING_CONTROL_6_LONG_MEDIUM_RATIO_THR_MSB 31 -#define BB_TIMING_CONTROL_6_LONG_MEDIUM_RATIO_THR_LSB 28 -#define BB_TIMING_CONTROL_6_LONG_MEDIUM_RATIO_THR_MASK 0xf0000000 -#define BB_TIMING_CONTROL_6_LONG_MEDIUM_RATIO_THR_GET(x) (((x) & 0xf0000000) >> 28) -#define BB_TIMING_CONTROL_6_LONG_MEDIUM_RATIO_THR_SET(x) (((x) << 28) & 0xf0000000) - -/* macros for bb_chn_reg_map.BB_timing_control_11 */ -#define BB_TIMING_CONTROL_11_ADDRESS 0x00000018 -#define BB_TIMING_CONTROL_11_OFFSET 0x00000018 -#define BB_TIMING_CONTROL_11_SPUR_DELTA_PHASE_MSB 19 -#define BB_TIMING_CONTROL_11_SPUR_DELTA_PHASE_LSB 0 -#define BB_TIMING_CONTROL_11_SPUR_DELTA_PHASE_MASK 0x000fffff -#define BB_TIMING_CONTROL_11_SPUR_DELTA_PHASE_GET(x) (((x) & 0x000fffff) >> 0) -#define BB_TIMING_CONTROL_11_SPUR_DELTA_PHASE_SET(x) (((x) << 0) & 0x000fffff) -#define BB_TIMING_CONTROL_11_SPUR_FREQ_SD_MSB 29 -#define BB_TIMING_CONTROL_11_SPUR_FREQ_SD_LSB 20 -#define BB_TIMING_CONTROL_11_SPUR_FREQ_SD_MASK 0x3ff00000 -#define BB_TIMING_CONTROL_11_SPUR_FREQ_SD_GET(x) (((x) & 0x3ff00000) >> 20) -#define BB_TIMING_CONTROL_11_SPUR_FREQ_SD_SET(x) (((x) << 20) & 0x3ff00000) -#define BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_AGC_MSB 30 -#define BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_AGC_LSB 30 -#define BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_AGC_MASK 0x40000000 -#define BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_AGC_GET(x) (((x) & 0x40000000) >> 30) -#define BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_AGC_SET(x) (((x) << 30) & 0x40000000) -#define BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_SELFCOR_MSB 31 -#define BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_SELFCOR_LSB 31 -#define BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_SELFCOR_MASK 0x80000000 -#define BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_SELFCOR_GET(x) (((x) & 0x80000000) >> 31) -#define BB_TIMING_CONTROL_11_USE_SPUR_FILTER_IN_SELFCOR_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_chn_reg_map.BB_spur_mask_controls */ -#define BB_SPUR_MASK_CONTROLS_ADDRESS 0x0000001c -#define BB_SPUR_MASK_CONTROLS_OFFSET 0x0000001c -#define BB_SPUR_MASK_CONTROLS_SPUR_RSSI_THRESH_MSB 7 -#define BB_SPUR_MASK_CONTROLS_SPUR_RSSI_THRESH_LSB 0 -#define BB_SPUR_MASK_CONTROLS_SPUR_RSSI_THRESH_MASK 0x000000ff -#define BB_SPUR_MASK_CONTROLS_SPUR_RSSI_THRESH_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_SPUR_MASK_CONTROLS_SPUR_RSSI_THRESH_SET(x) (((x) << 0) & 0x000000ff) -#define BB_SPUR_MASK_CONTROLS_EN_VIT_SPUR_RSSI_MSB 8 -#define BB_SPUR_MASK_CONTROLS_EN_VIT_SPUR_RSSI_LSB 8 -#define BB_SPUR_MASK_CONTROLS_EN_VIT_SPUR_RSSI_MASK 0x00000100 -#define BB_SPUR_MASK_CONTROLS_EN_VIT_SPUR_RSSI_GET(x) (((x) & 0x00000100) >> 8) -#define BB_SPUR_MASK_CONTROLS_EN_VIT_SPUR_RSSI_SET(x) (((x) << 8) & 0x00000100) -#define BB_SPUR_MASK_CONTROLS_ENABLE_MASK_PPM_MSB 17 -#define BB_SPUR_MASK_CONTROLS_ENABLE_MASK_PPM_LSB 17 -#define BB_SPUR_MASK_CONTROLS_ENABLE_MASK_PPM_MASK 0x00020000 -#define BB_SPUR_MASK_CONTROLS_ENABLE_MASK_PPM_GET(x) (((x) & 0x00020000) >> 17) -#define BB_SPUR_MASK_CONTROLS_ENABLE_MASK_PPM_SET(x) (((x) << 17) & 0x00020000) -#define BB_SPUR_MASK_CONTROLS_MASK_RATE_CNTL_MSB 25 -#define BB_SPUR_MASK_CONTROLS_MASK_RATE_CNTL_LSB 18 -#define BB_SPUR_MASK_CONTROLS_MASK_RATE_CNTL_MASK 0x03fc0000 -#define BB_SPUR_MASK_CONTROLS_MASK_RATE_CNTL_GET(x) (((x) & 0x03fc0000) >> 18) -#define BB_SPUR_MASK_CONTROLS_MASK_RATE_CNTL_SET(x) (((x) << 18) & 0x03fc0000) -#define BB_SPUR_MASK_CONTROLS_ENABLE_NF_RSSI_SPUR_MIT_MSB 26 -#define BB_SPUR_MASK_CONTROLS_ENABLE_NF_RSSI_SPUR_MIT_LSB 26 -#define BB_SPUR_MASK_CONTROLS_ENABLE_NF_RSSI_SPUR_MIT_MASK 0x04000000 -#define BB_SPUR_MASK_CONTROLS_ENABLE_NF_RSSI_SPUR_MIT_GET(x) (((x) & 0x04000000) >> 26) -#define BB_SPUR_MASK_CONTROLS_ENABLE_NF_RSSI_SPUR_MIT_SET(x) (((x) << 26) & 0x04000000) - -/* macros for bb_chn_reg_map.BB_find_signal_low */ -#define BB_FIND_SIGNAL_LOW_ADDRESS 0x00000020 -#define BB_FIND_SIGNAL_LOW_OFFSET 0x00000020 -#define BB_FIND_SIGNAL_LOW_RELSTEP_LOW_MSB 5 -#define BB_FIND_SIGNAL_LOW_RELSTEP_LOW_LSB 0 -#define BB_FIND_SIGNAL_LOW_RELSTEP_LOW_MASK 0x0000003f -#define BB_FIND_SIGNAL_LOW_RELSTEP_LOW_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_FIND_SIGNAL_LOW_RELSTEP_LOW_SET(x) (((x) << 0) & 0x0000003f) -#define BB_FIND_SIGNAL_LOW_FIRSTEP_LOW_MSB 11 -#define BB_FIND_SIGNAL_LOW_FIRSTEP_LOW_LSB 6 -#define BB_FIND_SIGNAL_LOW_FIRSTEP_LOW_MASK 0x00000fc0 -#define BB_FIND_SIGNAL_LOW_FIRSTEP_LOW_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_FIND_SIGNAL_LOW_FIRSTEP_LOW_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_FIND_SIGNAL_LOW_FIRPWR_LOW_MSB 19 -#define BB_FIND_SIGNAL_LOW_FIRPWR_LOW_LSB 12 -#define BB_FIND_SIGNAL_LOW_FIRPWR_LOW_MASK 0x000ff000 -#define BB_FIND_SIGNAL_LOW_FIRPWR_LOW_GET(x) (((x) & 0x000ff000) >> 12) -#define BB_FIND_SIGNAL_LOW_FIRPWR_LOW_SET(x) (((x) << 12) & 0x000ff000) -#define BB_FIND_SIGNAL_LOW_YCOK_MAX_LOW_MSB 23 -#define BB_FIND_SIGNAL_LOW_YCOK_MAX_LOW_LSB 20 -#define BB_FIND_SIGNAL_LOW_YCOK_MAX_LOW_MASK 0x00f00000 -#define BB_FIND_SIGNAL_LOW_YCOK_MAX_LOW_GET(x) (((x) & 0x00f00000) >> 20) -#define BB_FIND_SIGNAL_LOW_YCOK_MAX_LOW_SET(x) (((x) << 20) & 0x00f00000) -#define BB_FIND_SIGNAL_LOW_LONG_SC_THRESH_MSB 30 -#define BB_FIND_SIGNAL_LOW_LONG_SC_THRESH_LSB 24 -#define BB_FIND_SIGNAL_LOW_LONG_SC_THRESH_MASK 0x7f000000 -#define BB_FIND_SIGNAL_LOW_LONG_SC_THRESH_GET(x) (((x) & 0x7f000000) >> 24) -#define BB_FIND_SIGNAL_LOW_LONG_SC_THRESH_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for bb_chn_reg_map.BB_sfcorr */ -#define BB_SFCORR_ADDRESS 0x00000024 -#define BB_SFCORR_OFFSET 0x00000024 -#define BB_SFCORR_M2COUNT_THR_MSB 4 -#define BB_SFCORR_M2COUNT_THR_LSB 0 -#define BB_SFCORR_M2COUNT_THR_MASK 0x0000001f -#define BB_SFCORR_M2COUNT_THR_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_SFCORR_M2COUNT_THR_SET(x) (((x) << 0) & 0x0000001f) -#define BB_SFCORR_ADCSAT_THRESH_MSB 10 -#define BB_SFCORR_ADCSAT_THRESH_LSB 5 -#define BB_SFCORR_ADCSAT_THRESH_MASK 0x000007e0 -#define BB_SFCORR_ADCSAT_THRESH_GET(x) (((x) & 0x000007e0) >> 5) -#define BB_SFCORR_ADCSAT_THRESH_SET(x) (((x) << 5) & 0x000007e0) -#define BB_SFCORR_ADCSAT_ICOUNT_MSB 16 -#define BB_SFCORR_ADCSAT_ICOUNT_LSB 11 -#define BB_SFCORR_ADCSAT_ICOUNT_MASK 0x0001f800 -#define BB_SFCORR_ADCSAT_ICOUNT_GET(x) (((x) & 0x0001f800) >> 11) -#define BB_SFCORR_ADCSAT_ICOUNT_SET(x) (((x) << 11) & 0x0001f800) -#define BB_SFCORR_M1_THRES_MSB 23 -#define BB_SFCORR_M1_THRES_LSB 17 -#define BB_SFCORR_M1_THRES_MASK 0x00fe0000 -#define BB_SFCORR_M1_THRES_GET(x) (((x) & 0x00fe0000) >> 17) -#define BB_SFCORR_M1_THRES_SET(x) (((x) << 17) & 0x00fe0000) -#define BB_SFCORR_M2_THRES_MSB 30 -#define BB_SFCORR_M2_THRES_LSB 24 -#define BB_SFCORR_M2_THRES_MASK 0x7f000000 -#define BB_SFCORR_M2_THRES_GET(x) (((x) & 0x7f000000) >> 24) -#define BB_SFCORR_M2_THRES_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for bb_chn_reg_map.BB_self_corr_low */ -#define BB_SELF_CORR_LOW_ADDRESS 0x00000028 -#define BB_SELF_CORR_LOW_OFFSET 0x00000028 -#define BB_SELF_CORR_LOW_USE_SELF_CORR_LOW_MSB 0 -#define BB_SELF_CORR_LOW_USE_SELF_CORR_LOW_LSB 0 -#define BB_SELF_CORR_LOW_USE_SELF_CORR_LOW_MASK 0x00000001 -#define BB_SELF_CORR_LOW_USE_SELF_CORR_LOW_GET(x) (((x) & 0x00000001) >> 0) -#define BB_SELF_CORR_LOW_USE_SELF_CORR_LOW_SET(x) (((x) << 0) & 0x00000001) -#define BB_SELF_CORR_LOW_M1COUNT_MAX_LOW_MSB 7 -#define BB_SELF_CORR_LOW_M1COUNT_MAX_LOW_LSB 1 -#define BB_SELF_CORR_LOW_M1COUNT_MAX_LOW_MASK 0x000000fe -#define BB_SELF_CORR_LOW_M1COUNT_MAX_LOW_GET(x) (((x) & 0x000000fe) >> 1) -#define BB_SELF_CORR_LOW_M1COUNT_MAX_LOW_SET(x) (((x) << 1) & 0x000000fe) -#define BB_SELF_CORR_LOW_M2COUNT_THR_LOW_MSB 13 -#define BB_SELF_CORR_LOW_M2COUNT_THR_LOW_LSB 8 -#define BB_SELF_CORR_LOW_M2COUNT_THR_LOW_MASK 0x00003f00 -#define BB_SELF_CORR_LOW_M2COUNT_THR_LOW_GET(x) (((x) & 0x00003f00) >> 8) -#define BB_SELF_CORR_LOW_M2COUNT_THR_LOW_SET(x) (((x) << 8) & 0x00003f00) -#define BB_SELF_CORR_LOW_M1_THRESH_LOW_MSB 20 -#define BB_SELF_CORR_LOW_M1_THRESH_LOW_LSB 14 -#define BB_SELF_CORR_LOW_M1_THRESH_LOW_MASK 0x001fc000 -#define BB_SELF_CORR_LOW_M1_THRESH_LOW_GET(x) (((x) & 0x001fc000) >> 14) -#define BB_SELF_CORR_LOW_M1_THRESH_LOW_SET(x) (((x) << 14) & 0x001fc000) -#define BB_SELF_CORR_LOW_M2_THRESH_LOW_MSB 27 -#define BB_SELF_CORR_LOW_M2_THRESH_LOW_LSB 21 -#define BB_SELF_CORR_LOW_M2_THRESH_LOW_MASK 0x0fe00000 -#define BB_SELF_CORR_LOW_M2_THRESH_LOW_GET(x) (((x) & 0x0fe00000) >> 21) -#define BB_SELF_CORR_LOW_M2_THRESH_LOW_SET(x) (((x) << 21) & 0x0fe00000) - -/* macros for bb_chn_reg_map.BB_ext_chan_scorr_thr */ -#define BB_EXT_CHAN_SCORR_THR_ADDRESS 0x0000002c -#define BB_EXT_CHAN_SCORR_THR_OFFSET 0x0000002c -#define BB_EXT_CHAN_SCORR_THR_M1_THRES_EXT_MSB 6 -#define BB_EXT_CHAN_SCORR_THR_M1_THRES_EXT_LSB 0 -#define BB_EXT_CHAN_SCORR_THR_M1_THRES_EXT_MASK 0x0000007f -#define BB_EXT_CHAN_SCORR_THR_M1_THRES_EXT_GET(x) (((x) & 0x0000007f) >> 0) -#define BB_EXT_CHAN_SCORR_THR_M1_THRES_EXT_SET(x) (((x) << 0) & 0x0000007f) -#define BB_EXT_CHAN_SCORR_THR_M2_THRES_EXT_MSB 13 -#define BB_EXT_CHAN_SCORR_THR_M2_THRES_EXT_LSB 7 -#define BB_EXT_CHAN_SCORR_THR_M2_THRES_EXT_MASK 0x00003f80 -#define BB_EXT_CHAN_SCORR_THR_M2_THRES_EXT_GET(x) (((x) & 0x00003f80) >> 7) -#define BB_EXT_CHAN_SCORR_THR_M2_THRES_EXT_SET(x) (((x) << 7) & 0x00003f80) -#define BB_EXT_CHAN_SCORR_THR_M1_THRES_LOW_EXT_MSB 20 -#define BB_EXT_CHAN_SCORR_THR_M1_THRES_LOW_EXT_LSB 14 -#define BB_EXT_CHAN_SCORR_THR_M1_THRES_LOW_EXT_MASK 0x001fc000 -#define BB_EXT_CHAN_SCORR_THR_M1_THRES_LOW_EXT_GET(x) (((x) & 0x001fc000) >> 14) -#define BB_EXT_CHAN_SCORR_THR_M1_THRES_LOW_EXT_SET(x) (((x) << 14) & 0x001fc000) -#define BB_EXT_CHAN_SCORR_THR_M2_THRES_LOW_EXT_MSB 27 -#define BB_EXT_CHAN_SCORR_THR_M2_THRES_LOW_EXT_LSB 21 -#define BB_EXT_CHAN_SCORR_THR_M2_THRES_LOW_EXT_MASK 0x0fe00000 -#define BB_EXT_CHAN_SCORR_THR_M2_THRES_LOW_EXT_GET(x) (((x) & 0x0fe00000) >> 21) -#define BB_EXT_CHAN_SCORR_THR_M2_THRES_LOW_EXT_SET(x) (((x) << 21) & 0x0fe00000) -#define BB_EXT_CHAN_SCORR_THR_SPUR_SUBCHANNEL_SD_MSB 28 -#define BB_EXT_CHAN_SCORR_THR_SPUR_SUBCHANNEL_SD_LSB 28 -#define BB_EXT_CHAN_SCORR_THR_SPUR_SUBCHANNEL_SD_MASK 0x10000000 -#define BB_EXT_CHAN_SCORR_THR_SPUR_SUBCHANNEL_SD_GET(x) (((x) & 0x10000000) >> 28) -#define BB_EXT_CHAN_SCORR_THR_SPUR_SUBCHANNEL_SD_SET(x) (((x) << 28) & 0x10000000) - -/* macros for bb_chn_reg_map.BB_ext_chan_pwr_thr_2_b0 */ -#define BB_EXT_CHAN_PWR_THR_2_B0_ADDRESS 0x00000030 -#define BB_EXT_CHAN_PWR_THR_2_B0_OFFSET 0x00000030 -#define BB_EXT_CHAN_PWR_THR_2_B0_CF_MAXCCAPWR_EXT_0_MSB 8 -#define BB_EXT_CHAN_PWR_THR_2_B0_CF_MAXCCAPWR_EXT_0_LSB 0 -#define BB_EXT_CHAN_PWR_THR_2_B0_CF_MAXCCAPWR_EXT_0_MASK 0x000001ff -#define BB_EXT_CHAN_PWR_THR_2_B0_CF_MAXCCAPWR_EXT_0_GET(x) (((x) & 0x000001ff) >> 0) -#define BB_EXT_CHAN_PWR_THR_2_B0_CF_MAXCCAPWR_EXT_0_SET(x) (((x) << 0) & 0x000001ff) -#define BB_EXT_CHAN_PWR_THR_2_B0_CYCPWR_THR1_EXT_MSB 15 -#define BB_EXT_CHAN_PWR_THR_2_B0_CYCPWR_THR1_EXT_LSB 9 -#define BB_EXT_CHAN_PWR_THR_2_B0_CYCPWR_THR1_EXT_MASK 0x0000fe00 -#define BB_EXT_CHAN_PWR_THR_2_B0_CYCPWR_THR1_EXT_GET(x) (((x) & 0x0000fe00) >> 9) -#define BB_EXT_CHAN_PWR_THR_2_B0_CYCPWR_THR1_EXT_SET(x) (((x) << 9) & 0x0000fe00) -#define BB_EXT_CHAN_PWR_THR_2_B0_MINCCAPWR_EXT_0_MSB 24 -#define BB_EXT_CHAN_PWR_THR_2_B0_MINCCAPWR_EXT_0_LSB 16 -#define BB_EXT_CHAN_PWR_THR_2_B0_MINCCAPWR_EXT_0_MASK 0x01ff0000 -#define BB_EXT_CHAN_PWR_THR_2_B0_MINCCAPWR_EXT_0_GET(x) (((x) & 0x01ff0000) >> 16) - -/* macros for bb_chn_reg_map.BB_radar_detection */ -#define BB_RADAR_DETECTION_ADDRESS 0x00000034 -#define BB_RADAR_DETECTION_OFFSET 0x00000034 -#define BB_RADAR_DETECTION_PULSE_DETECT_ENABLE_MSB 0 -#define BB_RADAR_DETECTION_PULSE_DETECT_ENABLE_LSB 0 -#define BB_RADAR_DETECTION_PULSE_DETECT_ENABLE_MASK 0x00000001 -#define BB_RADAR_DETECTION_PULSE_DETECT_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define BB_RADAR_DETECTION_PULSE_DETECT_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define BB_RADAR_DETECTION_PULSE_IN_BAND_THRESH_MSB 5 -#define BB_RADAR_DETECTION_PULSE_IN_BAND_THRESH_LSB 1 -#define BB_RADAR_DETECTION_PULSE_IN_BAND_THRESH_MASK 0x0000003e -#define BB_RADAR_DETECTION_PULSE_IN_BAND_THRESH_GET(x) (((x) & 0x0000003e) >> 1) -#define BB_RADAR_DETECTION_PULSE_IN_BAND_THRESH_SET(x) (((x) << 1) & 0x0000003e) -#define BB_RADAR_DETECTION_PULSE_RSSI_THRESH_MSB 11 -#define BB_RADAR_DETECTION_PULSE_RSSI_THRESH_LSB 6 -#define BB_RADAR_DETECTION_PULSE_RSSI_THRESH_MASK 0x00000fc0 -#define BB_RADAR_DETECTION_PULSE_RSSI_THRESH_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_RADAR_DETECTION_PULSE_RSSI_THRESH_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_RADAR_DETECTION_PULSE_HEIGHT_THRESH_MSB 17 -#define BB_RADAR_DETECTION_PULSE_HEIGHT_THRESH_LSB 12 -#define BB_RADAR_DETECTION_PULSE_HEIGHT_THRESH_MASK 0x0003f000 -#define BB_RADAR_DETECTION_PULSE_HEIGHT_THRESH_GET(x) (((x) & 0x0003f000) >> 12) -#define BB_RADAR_DETECTION_PULSE_HEIGHT_THRESH_SET(x) (((x) << 12) & 0x0003f000) -#define BB_RADAR_DETECTION_RADAR_RSSI_THRESH_MSB 23 -#define BB_RADAR_DETECTION_RADAR_RSSI_THRESH_LSB 18 -#define BB_RADAR_DETECTION_RADAR_RSSI_THRESH_MASK 0x00fc0000 -#define BB_RADAR_DETECTION_RADAR_RSSI_THRESH_GET(x) (((x) & 0x00fc0000) >> 18) -#define BB_RADAR_DETECTION_RADAR_RSSI_THRESH_SET(x) (((x) << 18) & 0x00fc0000) -#define BB_RADAR_DETECTION_RADAR_FIRPWR_THRESH_MSB 30 -#define BB_RADAR_DETECTION_RADAR_FIRPWR_THRESH_LSB 24 -#define BB_RADAR_DETECTION_RADAR_FIRPWR_THRESH_MASK 0x7f000000 -#define BB_RADAR_DETECTION_RADAR_FIRPWR_THRESH_GET(x) (((x) & 0x7f000000) >> 24) -#define BB_RADAR_DETECTION_RADAR_FIRPWR_THRESH_SET(x) (((x) << 24) & 0x7f000000) -#define BB_RADAR_DETECTION_ENABLE_RADAR_FFT_MSB 31 -#define BB_RADAR_DETECTION_ENABLE_RADAR_FFT_LSB 31 -#define BB_RADAR_DETECTION_ENABLE_RADAR_FFT_MASK 0x80000000 -#define BB_RADAR_DETECTION_ENABLE_RADAR_FFT_GET(x) (((x) & 0x80000000) >> 31) -#define BB_RADAR_DETECTION_ENABLE_RADAR_FFT_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_chn_reg_map.BB_radar_detection_2 */ -#define BB_RADAR_DETECTION_2_ADDRESS 0x00000038 -#define BB_RADAR_DETECTION_2_OFFSET 0x00000038 -#define BB_RADAR_DETECTION_2_RADAR_LENGTH_MAX_MSB 7 -#define BB_RADAR_DETECTION_2_RADAR_LENGTH_MAX_LSB 0 -#define BB_RADAR_DETECTION_2_RADAR_LENGTH_MAX_MASK 0x000000ff -#define BB_RADAR_DETECTION_2_RADAR_LENGTH_MAX_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_RADAR_DETECTION_2_RADAR_LENGTH_MAX_SET(x) (((x) << 0) & 0x000000ff) -#define BB_RADAR_DETECTION_2_PULSE_RELSTEP_THRESH_MSB 12 -#define BB_RADAR_DETECTION_2_PULSE_RELSTEP_THRESH_LSB 8 -#define BB_RADAR_DETECTION_2_PULSE_RELSTEP_THRESH_MASK 0x00001f00 -#define BB_RADAR_DETECTION_2_PULSE_RELSTEP_THRESH_GET(x) (((x) & 0x00001f00) >> 8) -#define BB_RADAR_DETECTION_2_PULSE_RELSTEP_THRESH_SET(x) (((x) << 8) & 0x00001f00) -#define BB_RADAR_DETECTION_2_ENABLE_PULSE_RELSTEP_CHECK_MSB 13 -#define BB_RADAR_DETECTION_2_ENABLE_PULSE_RELSTEP_CHECK_LSB 13 -#define BB_RADAR_DETECTION_2_ENABLE_PULSE_RELSTEP_CHECK_MASK 0x00002000 -#define BB_RADAR_DETECTION_2_ENABLE_PULSE_RELSTEP_CHECK_GET(x) (((x) & 0x00002000) >> 13) -#define BB_RADAR_DETECTION_2_ENABLE_PULSE_RELSTEP_CHECK_SET(x) (((x) << 13) & 0x00002000) -#define BB_RADAR_DETECTION_2_ENABLE_MAX_RADAR_RSSI_MSB 14 -#define BB_RADAR_DETECTION_2_ENABLE_MAX_RADAR_RSSI_LSB 14 -#define BB_RADAR_DETECTION_2_ENABLE_MAX_RADAR_RSSI_MASK 0x00004000 -#define BB_RADAR_DETECTION_2_ENABLE_MAX_RADAR_RSSI_GET(x) (((x) & 0x00004000) >> 14) -#define BB_RADAR_DETECTION_2_ENABLE_MAX_RADAR_RSSI_SET(x) (((x) << 14) & 0x00004000) -#define BB_RADAR_DETECTION_2_ENABLE_BLOCK_RADAR_CHECK_MSB 15 -#define BB_RADAR_DETECTION_2_ENABLE_BLOCK_RADAR_CHECK_LSB 15 -#define BB_RADAR_DETECTION_2_ENABLE_BLOCK_RADAR_CHECK_MASK 0x00008000 -#define BB_RADAR_DETECTION_2_ENABLE_BLOCK_RADAR_CHECK_GET(x) (((x) & 0x00008000) >> 15) -#define BB_RADAR_DETECTION_2_ENABLE_BLOCK_RADAR_CHECK_SET(x) (((x) << 15) & 0x00008000) -#define BB_RADAR_DETECTION_2_RADAR_RELPWR_THRESH_MSB 21 -#define BB_RADAR_DETECTION_2_RADAR_RELPWR_THRESH_LSB 16 -#define BB_RADAR_DETECTION_2_RADAR_RELPWR_THRESH_MASK 0x003f0000 -#define BB_RADAR_DETECTION_2_RADAR_RELPWR_THRESH_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_RADAR_DETECTION_2_RADAR_RELPWR_THRESH_SET(x) (((x) << 16) & 0x003f0000) -#define BB_RADAR_DETECTION_2_RADAR_USE_FIRPWR_128_MSB 22 -#define BB_RADAR_DETECTION_2_RADAR_USE_FIRPWR_128_LSB 22 -#define BB_RADAR_DETECTION_2_RADAR_USE_FIRPWR_128_MASK 0x00400000 -#define BB_RADAR_DETECTION_2_RADAR_USE_FIRPWR_128_GET(x) (((x) & 0x00400000) >> 22) -#define BB_RADAR_DETECTION_2_RADAR_USE_FIRPWR_128_SET(x) (((x) << 22) & 0x00400000) -#define BB_RADAR_DETECTION_2_ENABLE_RADAR_RELPWR_CHECK_MSB 23 -#define BB_RADAR_DETECTION_2_ENABLE_RADAR_RELPWR_CHECK_LSB 23 -#define BB_RADAR_DETECTION_2_ENABLE_RADAR_RELPWR_CHECK_MASK 0x00800000 -#define BB_RADAR_DETECTION_2_ENABLE_RADAR_RELPWR_CHECK_GET(x) (((x) & 0x00800000) >> 23) -#define BB_RADAR_DETECTION_2_ENABLE_RADAR_RELPWR_CHECK_SET(x) (((x) << 23) & 0x00800000) -#define BB_RADAR_DETECTION_2_CF_RADAR_BIN_THRESH_SEL_MSB 26 -#define BB_RADAR_DETECTION_2_CF_RADAR_BIN_THRESH_SEL_LSB 24 -#define BB_RADAR_DETECTION_2_CF_RADAR_BIN_THRESH_SEL_MASK 0x07000000 -#define BB_RADAR_DETECTION_2_CF_RADAR_BIN_THRESH_SEL_GET(x) (((x) & 0x07000000) >> 24) -#define BB_RADAR_DETECTION_2_CF_RADAR_BIN_THRESH_SEL_SET(x) (((x) << 24) & 0x07000000) -#define BB_RADAR_DETECTION_2_ENABLE_PULSE_GC_COUNT_CHECK_MSB 27 -#define BB_RADAR_DETECTION_2_ENABLE_PULSE_GC_COUNT_CHECK_LSB 27 -#define BB_RADAR_DETECTION_2_ENABLE_PULSE_GC_COUNT_CHECK_MASK 0x08000000 -#define BB_RADAR_DETECTION_2_ENABLE_PULSE_GC_COUNT_CHECK_GET(x) (((x) & 0x08000000) >> 27) -#define BB_RADAR_DETECTION_2_ENABLE_PULSE_GC_COUNT_CHECK_SET(x) (((x) << 27) & 0x08000000) - -/* macros for bb_chn_reg_map.BB_extension_radar */ -#define BB_EXTENSION_RADAR_ADDRESS 0x0000003c -#define BB_EXTENSION_RADAR_OFFSET 0x0000003c -#define BB_EXTENSION_RADAR_BLOCKER40_MAX_RADAR_MSB 13 -#define BB_EXTENSION_RADAR_BLOCKER40_MAX_RADAR_LSB 8 -#define BB_EXTENSION_RADAR_BLOCKER40_MAX_RADAR_MASK 0x00003f00 -#define BB_EXTENSION_RADAR_BLOCKER40_MAX_RADAR_GET(x) (((x) & 0x00003f00) >> 8) -#define BB_EXTENSION_RADAR_BLOCKER40_MAX_RADAR_SET(x) (((x) << 8) & 0x00003f00) -#define BB_EXTENSION_RADAR_ENABLE_EXT_RADAR_MSB 14 -#define BB_EXTENSION_RADAR_ENABLE_EXT_RADAR_LSB 14 -#define BB_EXTENSION_RADAR_ENABLE_EXT_RADAR_MASK 0x00004000 -#define BB_EXTENSION_RADAR_ENABLE_EXT_RADAR_GET(x) (((x) & 0x00004000) >> 14) -#define BB_EXTENSION_RADAR_ENABLE_EXT_RADAR_SET(x) (((x) << 14) & 0x00004000) -#define BB_EXTENSION_RADAR_RADAR_DC_PWR_THRESH_MSB 22 -#define BB_EXTENSION_RADAR_RADAR_DC_PWR_THRESH_LSB 15 -#define BB_EXTENSION_RADAR_RADAR_DC_PWR_THRESH_MASK 0x007f8000 -#define BB_EXTENSION_RADAR_RADAR_DC_PWR_THRESH_GET(x) (((x) & 0x007f8000) >> 15) -#define BB_EXTENSION_RADAR_RADAR_DC_PWR_THRESH_SET(x) (((x) << 15) & 0x007f8000) -#define BB_EXTENSION_RADAR_RADAR_LB_DC_CAP_MSB 30 -#define BB_EXTENSION_RADAR_RADAR_LB_DC_CAP_LSB 23 -#define BB_EXTENSION_RADAR_RADAR_LB_DC_CAP_MASK 0x7f800000 -#define BB_EXTENSION_RADAR_RADAR_LB_DC_CAP_GET(x) (((x) & 0x7f800000) >> 23) -#define BB_EXTENSION_RADAR_RADAR_LB_DC_CAP_SET(x) (((x) << 23) & 0x7f800000) -#define BB_EXTENSION_RADAR_DISABLE_ADCSAT_HOLD_MSB 31 -#define BB_EXTENSION_RADAR_DISABLE_ADCSAT_HOLD_LSB 31 -#define BB_EXTENSION_RADAR_DISABLE_ADCSAT_HOLD_MASK 0x80000000 -#define BB_EXTENSION_RADAR_DISABLE_ADCSAT_HOLD_GET(x) (((x) & 0x80000000) >> 31) -#define BB_EXTENSION_RADAR_DISABLE_ADCSAT_HOLD_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_chn_reg_map.BB_multichain_control */ -#define BB_MULTICHAIN_CONTROL_ADDRESS 0x00000080 -#define BB_MULTICHAIN_CONTROL_OFFSET 0x00000080 -#define BB_MULTICHAIN_CONTROL_FORCE_ANALOG_GAIN_DIFF_MSB 0 -#define BB_MULTICHAIN_CONTROL_FORCE_ANALOG_GAIN_DIFF_LSB 0 -#define BB_MULTICHAIN_CONTROL_FORCE_ANALOG_GAIN_DIFF_MASK 0x00000001 -#define BB_MULTICHAIN_CONTROL_FORCE_ANALOG_GAIN_DIFF_GET(x) (((x) & 0x00000001) >> 0) -#define BB_MULTICHAIN_CONTROL_FORCE_ANALOG_GAIN_DIFF_SET(x) (((x) << 0) & 0x00000001) -#define BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_01_MSB 7 -#define BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_01_LSB 1 -#define BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_01_MASK 0x000000fe -#define BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_01_GET(x) (((x) & 0x000000fe) >> 1) -#define BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_01_SET(x) (((x) << 1) & 0x000000fe) -#define BB_MULTICHAIN_CONTROL_SYNC_SYNTHON_MSB 8 -#define BB_MULTICHAIN_CONTROL_SYNC_SYNTHON_LSB 8 -#define BB_MULTICHAIN_CONTROL_SYNC_SYNTHON_MASK 0x00000100 -#define BB_MULTICHAIN_CONTROL_SYNC_SYNTHON_GET(x) (((x) & 0x00000100) >> 8) -#define BB_MULTICHAIN_CONTROL_SYNC_SYNTHON_SET(x) (((x) << 8) & 0x00000100) -#define BB_MULTICHAIN_CONTROL_USE_POSEDGE_REFCLK_MSB 9 -#define BB_MULTICHAIN_CONTROL_USE_POSEDGE_REFCLK_LSB 9 -#define BB_MULTICHAIN_CONTROL_USE_POSEDGE_REFCLK_MASK 0x00000200 -#define BB_MULTICHAIN_CONTROL_USE_POSEDGE_REFCLK_GET(x) (((x) & 0x00000200) >> 9) -#define BB_MULTICHAIN_CONTROL_USE_POSEDGE_REFCLK_SET(x) (((x) << 9) & 0x00000200) -#define BB_MULTICHAIN_CONTROL_CF_SHORT_SAT_MSB 20 -#define BB_MULTICHAIN_CONTROL_CF_SHORT_SAT_LSB 10 -#define BB_MULTICHAIN_CONTROL_CF_SHORT_SAT_MASK 0x001ffc00 -#define BB_MULTICHAIN_CONTROL_CF_SHORT_SAT_GET(x) (((x) & 0x001ffc00) >> 10) -#define BB_MULTICHAIN_CONTROL_CF_SHORT_SAT_SET(x) (((x) << 10) & 0x001ffc00) -#define BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_02_MSB 28 -#define BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_02_LSB 22 -#define BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_02_MASK 0x1fc00000 -#define BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_02_GET(x) (((x) & 0x1fc00000) >> 22) -#define BB_MULTICHAIN_CONTROL_FORCED_GAIN_DIFF_02_SET(x) (((x) << 22) & 0x1fc00000) -#define BB_MULTICHAIN_CONTROL_FORCE_SIGMA_ZERO_MSB 29 -#define BB_MULTICHAIN_CONTROL_FORCE_SIGMA_ZERO_LSB 29 -#define BB_MULTICHAIN_CONTROL_FORCE_SIGMA_ZERO_MASK 0x20000000 -#define BB_MULTICHAIN_CONTROL_FORCE_SIGMA_ZERO_GET(x) (((x) & 0x20000000) >> 29) -#define BB_MULTICHAIN_CONTROL_FORCE_SIGMA_ZERO_SET(x) (((x) << 29) & 0x20000000) - -/* macros for bb_chn_reg_map.BB_per_chain_csd */ -#define BB_PER_CHAIN_CSD_ADDRESS 0x00000084 -#define BB_PER_CHAIN_CSD_OFFSET 0x00000084 -#define BB_PER_CHAIN_CSD_CSD_CHN1_2CHAINS_MSB 4 -#define BB_PER_CHAIN_CSD_CSD_CHN1_2CHAINS_LSB 0 -#define BB_PER_CHAIN_CSD_CSD_CHN1_2CHAINS_MASK 0x0000001f -#define BB_PER_CHAIN_CSD_CSD_CHN1_2CHAINS_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_PER_CHAIN_CSD_CSD_CHN1_2CHAINS_SET(x) (((x) << 0) & 0x0000001f) -#define BB_PER_CHAIN_CSD_CSD_CHN1_3CHAINS_MSB 9 -#define BB_PER_CHAIN_CSD_CSD_CHN1_3CHAINS_LSB 5 -#define BB_PER_CHAIN_CSD_CSD_CHN1_3CHAINS_MASK 0x000003e0 -#define BB_PER_CHAIN_CSD_CSD_CHN1_3CHAINS_GET(x) (((x) & 0x000003e0) >> 5) -#define BB_PER_CHAIN_CSD_CSD_CHN1_3CHAINS_SET(x) (((x) << 5) & 0x000003e0) -#define BB_PER_CHAIN_CSD_CSD_CHN2_3CHAINS_MSB 14 -#define BB_PER_CHAIN_CSD_CSD_CHN2_3CHAINS_LSB 10 -#define BB_PER_CHAIN_CSD_CSD_CHN2_3CHAINS_MASK 0x00007c00 -#define BB_PER_CHAIN_CSD_CSD_CHN2_3CHAINS_GET(x) (((x) & 0x00007c00) >> 10) -#define BB_PER_CHAIN_CSD_CSD_CHN2_3CHAINS_SET(x) (((x) << 10) & 0x00007c00) - -/* macros for bb_chn_reg_map.BB_tx_crc */ -#define BB_TX_CRC_ADDRESS 0x000000a0 -#define BB_TX_CRC_OFFSET 0x000000a0 -#define BB_TX_CRC_TX_CRC_MSB 15 -#define BB_TX_CRC_TX_CRC_LSB 0 -#define BB_TX_CRC_TX_CRC_MASK 0x0000ffff -#define BB_TX_CRC_TX_CRC_GET(x) (((x) & 0x0000ffff) >> 0) - -/* macros for bb_chn_reg_map.BB_tstdac_constant */ -#define BB_TSTDAC_CONSTANT_ADDRESS 0x000000a4 -#define BB_TSTDAC_CONSTANT_OFFSET 0x000000a4 -#define BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_I_MSB 10 -#define BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_I_LSB 0 -#define BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_I_MASK 0x000007ff -#define BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_I_GET(x) (((x) & 0x000007ff) >> 0) -#define BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_I_SET(x) (((x) << 0) & 0x000007ff) -#define BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_Q_MSB 21 -#define BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_Q_LSB 11 -#define BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_Q_MASK 0x003ff800 -#define BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_Q_GET(x) (((x) & 0x003ff800) >> 11) -#define BB_TSTDAC_CONSTANT_CF_TSTDAC_CONSTANT_Q_SET(x) (((x) << 11) & 0x003ff800) - -/* macros for bb_chn_reg_map.BB_spur_report_b0 */ -#define BB_SPUR_REPORT_B0_ADDRESS 0x000000a8 -#define BB_SPUR_REPORT_B0_OFFSET 0x000000a8 -#define BB_SPUR_REPORT_B0_SPUR_EST_I_0_MSB 7 -#define BB_SPUR_REPORT_B0_SPUR_EST_I_0_LSB 0 -#define BB_SPUR_REPORT_B0_SPUR_EST_I_0_MASK 0x000000ff -#define BB_SPUR_REPORT_B0_SPUR_EST_I_0_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_SPUR_REPORT_B0_SPUR_EST_Q_0_MSB 15 -#define BB_SPUR_REPORT_B0_SPUR_EST_Q_0_LSB 8 -#define BB_SPUR_REPORT_B0_SPUR_EST_Q_0_MASK 0x0000ff00 -#define BB_SPUR_REPORT_B0_SPUR_EST_Q_0_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_SPUR_REPORT_B0_POWER_WITH_SPUR_REMOVED_0_MSB 31 -#define BB_SPUR_REPORT_B0_POWER_WITH_SPUR_REMOVED_0_LSB 16 -#define BB_SPUR_REPORT_B0_POWER_WITH_SPUR_REMOVED_0_MASK 0xffff0000 -#define BB_SPUR_REPORT_B0_POWER_WITH_SPUR_REMOVED_0_GET(x) (((x) & 0xffff0000) >> 16) - -/* macros for bb_chn_reg_map.BB_txiqcal_control_3 */ -#define BB_TXIQCAL_CONTROL_3_ADDRESS 0x000000b0 -#define BB_TXIQCAL_CONTROL_3_OFFSET 0x000000b0 -#define BB_TXIQCAL_CONTROL_3_PWR_HIGH_DB_MSB 5 -#define BB_TXIQCAL_CONTROL_3_PWR_HIGH_DB_LSB 0 -#define BB_TXIQCAL_CONTROL_3_PWR_HIGH_DB_MASK 0x0000003f -#define BB_TXIQCAL_CONTROL_3_PWR_HIGH_DB_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_TXIQCAL_CONTROL_3_PWR_HIGH_DB_SET(x) (((x) << 0) & 0x0000003f) -#define BB_TXIQCAL_CONTROL_3_PWR_LOW_DB_MSB 11 -#define BB_TXIQCAL_CONTROL_3_PWR_LOW_DB_LSB 6 -#define BB_TXIQCAL_CONTROL_3_PWR_LOW_DB_MASK 0x00000fc0 -#define BB_TXIQCAL_CONTROL_3_PWR_LOW_DB_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_TXIQCAL_CONTROL_3_PWR_LOW_DB_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_TXIQCAL_CONTROL_3_IQCAL_TONE_PHS_STEP_MSB 21 -#define BB_TXIQCAL_CONTROL_3_IQCAL_TONE_PHS_STEP_LSB 12 -#define BB_TXIQCAL_CONTROL_3_IQCAL_TONE_PHS_STEP_MASK 0x003ff000 -#define BB_TXIQCAL_CONTROL_3_IQCAL_TONE_PHS_STEP_GET(x) (((x) & 0x003ff000) >> 12) -#define BB_TXIQCAL_CONTROL_3_IQCAL_TONE_PHS_STEP_SET(x) (((x) << 12) & 0x003ff000) -#define BB_TXIQCAL_CONTROL_3_DC_EST_LEN_MSB 23 -#define BB_TXIQCAL_CONTROL_3_DC_EST_LEN_LSB 22 -#define BB_TXIQCAL_CONTROL_3_DC_EST_LEN_MASK 0x00c00000 -#define BB_TXIQCAL_CONTROL_3_DC_EST_LEN_GET(x) (((x) & 0x00c00000) >> 22) -#define BB_TXIQCAL_CONTROL_3_DC_EST_LEN_SET(x) (((x) << 22) & 0x00c00000) -#define BB_TXIQCAL_CONTROL_3_ADC_SAT_LEN_MSB 24 -#define BB_TXIQCAL_CONTROL_3_ADC_SAT_LEN_LSB 24 -#define BB_TXIQCAL_CONTROL_3_ADC_SAT_LEN_MASK 0x01000000 -#define BB_TXIQCAL_CONTROL_3_ADC_SAT_LEN_GET(x) (((x) & 0x01000000) >> 24) -#define BB_TXIQCAL_CONTROL_3_ADC_SAT_LEN_SET(x) (((x) << 24) & 0x01000000) -#define BB_TXIQCAL_CONTROL_3_ADC_SAT_SEL_MSB 26 -#define BB_TXIQCAL_CONTROL_3_ADC_SAT_SEL_LSB 25 -#define BB_TXIQCAL_CONTROL_3_ADC_SAT_SEL_MASK 0x06000000 -#define BB_TXIQCAL_CONTROL_3_ADC_SAT_SEL_GET(x) (((x) & 0x06000000) >> 25) -#define BB_TXIQCAL_CONTROL_3_ADC_SAT_SEL_SET(x) (((x) << 25) & 0x06000000) -#define BB_TXIQCAL_CONTROL_3_IQCAL_MEAS_LEN_MSB 28 -#define BB_TXIQCAL_CONTROL_3_IQCAL_MEAS_LEN_LSB 27 -#define BB_TXIQCAL_CONTROL_3_IQCAL_MEAS_LEN_MASK 0x18000000 -#define BB_TXIQCAL_CONTROL_3_IQCAL_MEAS_LEN_GET(x) (((x) & 0x18000000) >> 27) -#define BB_TXIQCAL_CONTROL_3_IQCAL_MEAS_LEN_SET(x) (((x) << 27) & 0x18000000) -#define BB_TXIQCAL_CONTROL_3_DESIRED_SIZE_DB_MSB 30 -#define BB_TXIQCAL_CONTROL_3_DESIRED_SIZE_DB_LSB 29 -#define BB_TXIQCAL_CONTROL_3_DESIRED_SIZE_DB_MASK 0x60000000 -#define BB_TXIQCAL_CONTROL_3_DESIRED_SIZE_DB_GET(x) (((x) & 0x60000000) >> 29) -#define BB_TXIQCAL_CONTROL_3_DESIRED_SIZE_DB_SET(x) (((x) << 29) & 0x60000000) -#define BB_TXIQCAL_CONTROL_3_TX_IQCORR_EN_MSB 31 -#define BB_TXIQCAL_CONTROL_3_TX_IQCORR_EN_LSB 31 -#define BB_TXIQCAL_CONTROL_3_TX_IQCORR_EN_MASK 0x80000000 -#define BB_TXIQCAL_CONTROL_3_TX_IQCORR_EN_GET(x) (((x) & 0x80000000) >> 31) -#define BB_TXIQCAL_CONTROL_3_TX_IQCORR_EN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_chn_reg_map.BB_green_tx_control_1 */ -#define BB_GREEN_TX_CONTROL_1_ADDRESS 0x000000bc -#define BB_GREEN_TX_CONTROL_1_OFFSET 0x000000bc -#define BB_GREEN_TX_CONTROL_1_GREEN_TX_ENABLE_MSB 0 -#define BB_GREEN_TX_CONTROL_1_GREEN_TX_ENABLE_LSB 0 -#define BB_GREEN_TX_CONTROL_1_GREEN_TX_ENABLE_MASK 0x00000001 -#define BB_GREEN_TX_CONTROL_1_GREEN_TX_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define BB_GREEN_TX_CONTROL_1_GREEN_TX_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define BB_GREEN_TX_CONTROL_1_GREEN_CASES_MSB 1 -#define BB_GREEN_TX_CONTROL_1_GREEN_CASES_LSB 1 -#define BB_GREEN_TX_CONTROL_1_GREEN_CASES_MASK 0x00000002 -#define BB_GREEN_TX_CONTROL_1_GREEN_CASES_GET(x) (((x) & 0x00000002) >> 1) -#define BB_GREEN_TX_CONTROL_1_GREEN_CASES_SET(x) (((x) << 1) & 0x00000002) - -/* macros for bb_chn_reg_map.BB_iq_adc_meas_0_b0 */ -#define BB_IQ_ADC_MEAS_0_B0_ADDRESS 0x000000c0 -#define BB_IQ_ADC_MEAS_0_B0_OFFSET 0x000000c0 -#define BB_IQ_ADC_MEAS_0_B0_GAIN_DC_IQ_CAL_MEAS_0_0_MSB 31 -#define BB_IQ_ADC_MEAS_0_B0_GAIN_DC_IQ_CAL_MEAS_0_0_LSB 0 -#define BB_IQ_ADC_MEAS_0_B0_GAIN_DC_IQ_CAL_MEAS_0_0_MASK 0xffffffff -#define BB_IQ_ADC_MEAS_0_B0_GAIN_DC_IQ_CAL_MEAS_0_0_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for bb_chn_reg_map.BB_iq_adc_meas_1_b0 */ -#define BB_IQ_ADC_MEAS_1_B0_ADDRESS 0x000000c4 -#define BB_IQ_ADC_MEAS_1_B0_OFFSET 0x000000c4 -#define BB_IQ_ADC_MEAS_1_B0_GAIN_DC_IQ_CAL_MEAS_1_0_MSB 31 -#define BB_IQ_ADC_MEAS_1_B0_GAIN_DC_IQ_CAL_MEAS_1_0_LSB 0 -#define BB_IQ_ADC_MEAS_1_B0_GAIN_DC_IQ_CAL_MEAS_1_0_MASK 0xffffffff -#define BB_IQ_ADC_MEAS_1_B0_GAIN_DC_IQ_CAL_MEAS_1_0_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for bb_chn_reg_map.BB_iq_adc_meas_2_b0 */ -#define BB_IQ_ADC_MEAS_2_B0_ADDRESS 0x000000c8 -#define BB_IQ_ADC_MEAS_2_B0_OFFSET 0x000000c8 -#define BB_IQ_ADC_MEAS_2_B0_GAIN_DC_IQ_CAL_MEAS_2_0_MSB 31 -#define BB_IQ_ADC_MEAS_2_B0_GAIN_DC_IQ_CAL_MEAS_2_0_LSB 0 -#define BB_IQ_ADC_MEAS_2_B0_GAIN_DC_IQ_CAL_MEAS_2_0_MASK 0xffffffff -#define BB_IQ_ADC_MEAS_2_B0_GAIN_DC_IQ_CAL_MEAS_2_0_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for bb_chn_reg_map.BB_iq_adc_meas_3_b0 */ -#define BB_IQ_ADC_MEAS_3_B0_ADDRESS 0x000000cc -#define BB_IQ_ADC_MEAS_3_B0_OFFSET 0x000000cc -#define BB_IQ_ADC_MEAS_3_B0_GAIN_DC_IQ_CAL_MEAS_3_0_MSB 31 -#define BB_IQ_ADC_MEAS_3_B0_GAIN_DC_IQ_CAL_MEAS_3_0_LSB 0 -#define BB_IQ_ADC_MEAS_3_B0_GAIN_DC_IQ_CAL_MEAS_3_0_MASK 0xffffffff -#define BB_IQ_ADC_MEAS_3_B0_GAIN_DC_IQ_CAL_MEAS_3_0_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for bb_chn_reg_map.BB_tx_phase_ramp_b0 */ -#define BB_TX_PHASE_RAMP_B0_ADDRESS 0x000000d0 -#define BB_TX_PHASE_RAMP_B0_OFFSET 0x000000d0 -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ENABLE_0_MSB 0 -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ENABLE_0_LSB 0 -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ENABLE_0_MASK 0x00000001 -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ENABLE_0_GET(x) (((x) & 0x00000001) >> 0) -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ENABLE_0_SET(x) (((x) << 0) & 0x00000001) -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_BIAS_0_MSB 6 -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_BIAS_0_LSB 1 -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_BIAS_0_MASK 0x0000007e -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_BIAS_0_GET(x) (((x) & 0x0000007e) >> 1) -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_BIAS_0_SET(x) (((x) << 1) & 0x0000007e) -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_INIT_0_MSB 16 -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_INIT_0_LSB 7 -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_INIT_0_MASK 0x0001ff80 -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_INIT_0_GET(x) (((x) & 0x0001ff80) >> 7) -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_INIT_0_SET(x) (((x) << 7) & 0x0001ff80) -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ALPHA_0_MSB 24 -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ALPHA_0_LSB 17 -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ALPHA_0_MASK 0x01fe0000 -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ALPHA_0_GET(x) (((x) & 0x01fe0000) >> 17) -#define BB_TX_PHASE_RAMP_B0_CF_PHASE_RAMP_ALPHA_0_SET(x) (((x) << 17) & 0x01fe0000) - -/* macros for bb_chn_reg_map.BB_adc_gain_dc_corr_b0 */ -#define BB_ADC_GAIN_DC_CORR_B0_ADDRESS 0x000000d4 -#define BB_ADC_GAIN_DC_CORR_B0_OFFSET 0x000000d4 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_Q_COEFF_0_MSB 5 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_Q_COEFF_0_LSB 0 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_Q_COEFF_0_MASK 0x0000003f -#define BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_Q_COEFF_0_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_Q_COEFF_0_SET(x) (((x) << 0) & 0x0000003f) -#define BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_I_COEFF_0_MSB 11 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_I_COEFF_0_LSB 6 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_I_COEFF_0_MASK 0x00000fc0 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_I_COEFF_0_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_I_COEFF_0_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_Q_COEFF_0_MSB 20 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_Q_COEFF_0_LSB 12 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_Q_COEFF_0_MASK 0x001ff000 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_Q_COEFF_0_GET(x) (((x) & 0x001ff000) >> 12) -#define BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_Q_COEFF_0_SET(x) (((x) << 12) & 0x001ff000) -#define BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_I_COEFF_0_MSB 29 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_I_COEFF_0_LSB 21 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_I_COEFF_0_MASK 0x3fe00000 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_I_COEFF_0_GET(x) (((x) & 0x3fe00000) >> 21) -#define BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_I_COEFF_0_SET(x) (((x) << 21) & 0x3fe00000) -#define BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_ENABLE_MSB 30 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_ENABLE_LSB 30 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_ENABLE_MASK 0x40000000 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_ENABLE_GET(x) (((x) & 0x40000000) >> 30) -#define BB_ADC_GAIN_DC_CORR_B0_ADC_GAIN_CORR_ENABLE_SET(x) (((x) << 30) & 0x40000000) -#define BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_ENABLE_MSB 31 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_ENABLE_LSB 31 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_ENABLE_MASK 0x80000000 -#define BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_ENABLE_GET(x) (((x) & 0x80000000) >> 31) -#define BB_ADC_GAIN_DC_CORR_B0_ADC_DC_CORR_ENABLE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_chn_reg_map.BB_rx_iq_corr_b0 */ -#define BB_RX_IQ_CORR_B0_ADDRESS 0x000000dc -#define BB_RX_IQ_CORR_B0_OFFSET 0x000000dc -#define BB_RX_IQ_CORR_B0_RX_IQCORR_Q_Q_COFF_0_MSB 6 -#define BB_RX_IQ_CORR_B0_RX_IQCORR_Q_Q_COFF_0_LSB 0 -#define BB_RX_IQ_CORR_B0_RX_IQCORR_Q_Q_COFF_0_MASK 0x0000007f -#define BB_RX_IQ_CORR_B0_RX_IQCORR_Q_Q_COFF_0_GET(x) (((x) & 0x0000007f) >> 0) -#define BB_RX_IQ_CORR_B0_RX_IQCORR_Q_Q_COFF_0_SET(x) (((x) << 0) & 0x0000007f) -#define BB_RX_IQ_CORR_B0_RX_IQCORR_Q_I_COFF_0_MSB 13 -#define BB_RX_IQ_CORR_B0_RX_IQCORR_Q_I_COFF_0_LSB 7 -#define BB_RX_IQ_CORR_B0_RX_IQCORR_Q_I_COFF_0_MASK 0x00003f80 -#define BB_RX_IQ_CORR_B0_RX_IQCORR_Q_I_COFF_0_GET(x) (((x) & 0x00003f80) >> 7) -#define BB_RX_IQ_CORR_B0_RX_IQCORR_Q_I_COFF_0_SET(x) (((x) << 7) & 0x00003f80) -#define BB_RX_IQ_CORR_B0_RX_IQCORR_ENABLE_MSB 14 -#define BB_RX_IQ_CORR_B0_RX_IQCORR_ENABLE_LSB 14 -#define BB_RX_IQ_CORR_B0_RX_IQCORR_ENABLE_MASK 0x00004000 -#define BB_RX_IQ_CORR_B0_RX_IQCORR_ENABLE_GET(x) (((x) & 0x00004000) >> 14) -#define BB_RX_IQ_CORR_B0_RX_IQCORR_ENABLE_SET(x) (((x) << 14) & 0x00004000) -#define BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_Q_COFF_0_MSB 21 -#define BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_Q_COFF_0_LSB 15 -#define BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_Q_COFF_0_MASK 0x003f8000 -#define BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_Q_COFF_0_GET(x) (((x) & 0x003f8000) >> 15) -#define BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_Q_COFF_0_SET(x) (((x) << 15) & 0x003f8000) -#define BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_I_COFF_0_MSB 28 -#define BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_I_COFF_0_LSB 22 -#define BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_I_COFF_0_MASK 0x1fc00000 -#define BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_I_COFF_0_GET(x) (((x) & 0x1fc00000) >> 22) -#define BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_Q_I_COFF_0_SET(x) (((x) << 22) & 0x1fc00000) -#define BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_ENABLE_MSB 29 -#define BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_ENABLE_LSB 29 -#define BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_ENABLE_MASK 0x20000000 -#define BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_ENABLE_GET(x) (((x) & 0x20000000) >> 29) -#define BB_RX_IQ_CORR_B0_LOOPBACK_IQCORR_ENABLE_SET(x) (((x) << 29) & 0x20000000) - -/* macros for bb_chn_reg_map.BB_paprd_am2am_mask */ -#define BB_PAPRD_AM2AM_MASK_ADDRESS 0x000000e4 -#define BB_PAPRD_AM2AM_MASK_OFFSET 0x000000e4 -#define BB_PAPRD_AM2AM_MASK_PAPRD_AM2AM_MASK_MSB 24 -#define BB_PAPRD_AM2AM_MASK_PAPRD_AM2AM_MASK_LSB 0 -#define BB_PAPRD_AM2AM_MASK_PAPRD_AM2AM_MASK_MASK 0x01ffffff -#define BB_PAPRD_AM2AM_MASK_PAPRD_AM2AM_MASK_GET(x) (((x) & 0x01ffffff) >> 0) -#define BB_PAPRD_AM2AM_MASK_PAPRD_AM2AM_MASK_SET(x) (((x) << 0) & 0x01ffffff) - -/* macros for bb_chn_reg_map.BB_paprd_am2pm_mask */ -#define BB_PAPRD_AM2PM_MASK_ADDRESS 0x000000e8 -#define BB_PAPRD_AM2PM_MASK_OFFSET 0x000000e8 -#define BB_PAPRD_AM2PM_MASK_PAPRD_AM2PM_MASK_MSB 24 -#define BB_PAPRD_AM2PM_MASK_PAPRD_AM2PM_MASK_LSB 0 -#define BB_PAPRD_AM2PM_MASK_PAPRD_AM2PM_MASK_MASK 0x01ffffff -#define BB_PAPRD_AM2PM_MASK_PAPRD_AM2PM_MASK_GET(x) (((x) & 0x01ffffff) >> 0) -#define BB_PAPRD_AM2PM_MASK_PAPRD_AM2PM_MASK_SET(x) (((x) << 0) & 0x01ffffff) - -/* macros for bb_chn_reg_map.BB_paprd_ht40_mask */ -#define BB_PAPRD_HT40_MASK_ADDRESS 0x000000ec -#define BB_PAPRD_HT40_MASK_OFFSET 0x000000ec -#define BB_PAPRD_HT40_MASK_PAPRD_HT40_MASK_MSB 24 -#define BB_PAPRD_HT40_MASK_PAPRD_HT40_MASK_LSB 0 -#define BB_PAPRD_HT40_MASK_PAPRD_HT40_MASK_MASK 0x01ffffff -#define BB_PAPRD_HT40_MASK_PAPRD_HT40_MASK_GET(x) (((x) & 0x01ffffff) >> 0) -#define BB_PAPRD_HT40_MASK_PAPRD_HT40_MASK_SET(x) (((x) << 0) & 0x01ffffff) - -/* macros for bb_chn_reg_map.BB_paprd_ctrl0_b0 */ -#define BB_PAPRD_CTRL0_B0_ADDRESS 0x000000f0 -#define BB_PAPRD_CTRL0_B0_OFFSET 0x000000f0 -#define BB_PAPRD_CTRL0_B0_PAPRD_ENABLE_0_MSB 0 -#define BB_PAPRD_CTRL0_B0_PAPRD_ENABLE_0_LSB 0 -#define BB_PAPRD_CTRL0_B0_PAPRD_ENABLE_0_MASK 0x00000001 -#define BB_PAPRD_CTRL0_B0_PAPRD_ENABLE_0_GET(x) (((x) & 0x00000001) >> 0) -#define BB_PAPRD_CTRL0_B0_PAPRD_ENABLE_0_SET(x) (((x) << 0) & 0x00000001) -#define BB_PAPRD_CTRL0_B0_PAPRD_ADAPTIVE_USE_SINGLE_TABLE_0_MSB 1 -#define BB_PAPRD_CTRL0_B0_PAPRD_ADAPTIVE_USE_SINGLE_TABLE_0_LSB 1 -#define BB_PAPRD_CTRL0_B0_PAPRD_ADAPTIVE_USE_SINGLE_TABLE_0_MASK 0x00000002 -#define BB_PAPRD_CTRL0_B0_PAPRD_ADAPTIVE_USE_SINGLE_TABLE_0_GET(x) (((x) & 0x00000002) >> 1) -#define BB_PAPRD_CTRL0_B0_PAPRD_ADAPTIVE_USE_SINGLE_TABLE_0_SET(x) (((x) << 1) & 0x00000002) -#define BB_PAPRD_CTRL0_B0_PAPRD_VALID_GAIN_0_MSB 26 -#define BB_PAPRD_CTRL0_B0_PAPRD_VALID_GAIN_0_LSB 2 -#define BB_PAPRD_CTRL0_B0_PAPRD_VALID_GAIN_0_MASK 0x07fffffc -#define BB_PAPRD_CTRL0_B0_PAPRD_VALID_GAIN_0_GET(x) (((x) & 0x07fffffc) >> 2) -#define BB_PAPRD_CTRL0_B0_PAPRD_VALID_GAIN_0_SET(x) (((x) << 2) & 0x07fffffc) -#define BB_PAPRD_CTRL0_B0_PAPRD_MAG_THRSH_0_MSB 31 -#define BB_PAPRD_CTRL0_B0_PAPRD_MAG_THRSH_0_LSB 27 -#define BB_PAPRD_CTRL0_B0_PAPRD_MAG_THRSH_0_MASK 0xf8000000 -#define BB_PAPRD_CTRL0_B0_PAPRD_MAG_THRSH_0_GET(x) (((x) & 0xf8000000) >> 27) -#define BB_PAPRD_CTRL0_B0_PAPRD_MAG_THRSH_0_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for bb_chn_reg_map.BB_paprd_ctrl1_b0 */ -#define BB_PAPRD_CTRL1_B0_ADDRESS 0x000000f4 -#define BB_PAPRD_CTRL1_B0_OFFSET 0x000000f4 -#define BB_PAPRD_CTRL1_B0_PAPRD_ADAPTIVE_SCALING_ENABLE_0_MSB 0 -#define BB_PAPRD_CTRL1_B0_PAPRD_ADAPTIVE_SCALING_ENABLE_0_LSB 0 -#define BB_PAPRD_CTRL1_B0_PAPRD_ADAPTIVE_SCALING_ENABLE_0_MASK 0x00000001 -#define BB_PAPRD_CTRL1_B0_PAPRD_ADAPTIVE_SCALING_ENABLE_0_GET(x) (((x) & 0x00000001) >> 0) -#define BB_PAPRD_CTRL1_B0_PAPRD_ADAPTIVE_SCALING_ENABLE_0_SET(x) (((x) << 0) & 0x00000001) -#define BB_PAPRD_CTRL1_B0_PAPRD_ADAPTIVE_AM2AM_ENABLE_0_MSB 1 -#define BB_PAPRD_CTRL1_B0_PAPRD_ADAPTIVE_AM2AM_ENABLE_0_LSB 1 -#define BB_PAPRD_CTRL1_B0_PAPRD_ADAPTIVE_AM2AM_ENABLE_0_MASK 0x00000002 -#define BB_PAPRD_CTRL1_B0_PAPRD_ADAPTIVE_AM2AM_ENABLE_0_GET(x) (((x) & 0x00000002) >> 1) -#define BB_PAPRD_CTRL1_B0_PAPRD_ADAPTIVE_AM2AM_ENABLE_0_SET(x) (((x) << 1) & 0x00000002) -#define BB_PAPRD_CTRL1_B0_PAPRD_ADAPTIVE_AM2PM_ENABLE_0_MSB 2 -#define BB_PAPRD_CTRL1_B0_PAPRD_ADAPTIVE_AM2PM_ENABLE_0_LSB 2 -#define BB_PAPRD_CTRL1_B0_PAPRD_ADAPTIVE_AM2PM_ENABLE_0_MASK 0x00000004 -#define BB_PAPRD_CTRL1_B0_PAPRD_ADAPTIVE_AM2PM_ENABLE_0_GET(x) (((x) & 0x00000004) >> 2) -#define BB_PAPRD_CTRL1_B0_PAPRD_ADAPTIVE_AM2PM_ENABLE_0_SET(x) (((x) << 2) & 0x00000004) -#define BB_PAPRD_CTRL1_B0_PAPRD_POWER_AT_AM2AM_CAL_0_MSB 8 -#define BB_PAPRD_CTRL1_B0_PAPRD_POWER_AT_AM2AM_CAL_0_LSB 3 -#define BB_PAPRD_CTRL1_B0_PAPRD_POWER_AT_AM2AM_CAL_0_MASK 0x000001f8 -#define BB_PAPRD_CTRL1_B0_PAPRD_POWER_AT_AM2AM_CAL_0_GET(x) (((x) & 0x000001f8) >> 3) -#define BB_PAPRD_CTRL1_B0_PAPRD_POWER_AT_AM2AM_CAL_0_SET(x) (((x) << 3) & 0x000001f8) -#define BB_PAPRD_CTRL1_B0_PA_GAIN_SCALE_FACTOR_0_MSB 16 -#define BB_PAPRD_CTRL1_B0_PA_GAIN_SCALE_FACTOR_0_LSB 9 -#define BB_PAPRD_CTRL1_B0_PA_GAIN_SCALE_FACTOR_0_MASK 0x0001fe00 -#define BB_PAPRD_CTRL1_B0_PA_GAIN_SCALE_FACTOR_0_GET(x) (((x) & 0x0001fe00) >> 9) -#define BB_PAPRD_CTRL1_B0_PA_GAIN_SCALE_FACTOR_0_SET(x) (((x) << 9) & 0x0001fe00) -#define BB_PAPRD_CTRL1_B0_PAPRD_MAG_SCALE_FACTOR_0_MSB 26 -#define BB_PAPRD_CTRL1_B0_PAPRD_MAG_SCALE_FACTOR_0_LSB 17 -#define BB_PAPRD_CTRL1_B0_PAPRD_MAG_SCALE_FACTOR_0_MASK 0x07fe0000 -#define BB_PAPRD_CTRL1_B0_PAPRD_MAG_SCALE_FACTOR_0_GET(x) (((x) & 0x07fe0000) >> 17) -#define BB_PAPRD_CTRL1_B0_PAPRD_MAG_SCALE_FACTOR_0_SET(x) (((x) << 17) & 0x07fe0000) -#define BB_PAPRD_CTRL1_B0_PAPRD_TRAINER_IANDQ_SEL_0_MSB 27 -#define BB_PAPRD_CTRL1_B0_PAPRD_TRAINER_IANDQ_SEL_0_LSB 27 -#define BB_PAPRD_CTRL1_B0_PAPRD_TRAINER_IANDQ_SEL_0_MASK 0x08000000 -#define BB_PAPRD_CTRL1_B0_PAPRD_TRAINER_IANDQ_SEL_0_GET(x) (((x) & 0x08000000) >> 27) -#define BB_PAPRD_CTRL1_B0_PAPRD_TRAINER_IANDQ_SEL_0_SET(x) (((x) << 27) & 0x08000000) - -/* macros for bb_chn_reg_map.BB_pa_gain123_b0 */ -#define BB_PA_GAIN123_B0_ADDRESS 0x000000f8 -#define BB_PA_GAIN123_B0_OFFSET 0x000000f8 -#define BB_PA_GAIN123_B0_PA_GAIN1_0_MSB 9 -#define BB_PA_GAIN123_B0_PA_GAIN1_0_LSB 0 -#define BB_PA_GAIN123_B0_PA_GAIN1_0_MASK 0x000003ff -#define BB_PA_GAIN123_B0_PA_GAIN1_0_GET(x) (((x) & 0x000003ff) >> 0) -#define BB_PA_GAIN123_B0_PA_GAIN1_0_SET(x) (((x) << 0) & 0x000003ff) -#define BB_PA_GAIN123_B0_PA_GAIN2_0_MSB 19 -#define BB_PA_GAIN123_B0_PA_GAIN2_0_LSB 10 -#define BB_PA_GAIN123_B0_PA_GAIN2_0_MASK 0x000ffc00 -#define BB_PA_GAIN123_B0_PA_GAIN2_0_GET(x) (((x) & 0x000ffc00) >> 10) -#define BB_PA_GAIN123_B0_PA_GAIN2_0_SET(x) (((x) << 10) & 0x000ffc00) -#define BB_PA_GAIN123_B0_PA_GAIN3_0_MSB 29 -#define BB_PA_GAIN123_B0_PA_GAIN3_0_LSB 20 -#define BB_PA_GAIN123_B0_PA_GAIN3_0_MASK 0x3ff00000 -#define BB_PA_GAIN123_B0_PA_GAIN3_0_GET(x) (((x) & 0x3ff00000) >> 20) -#define BB_PA_GAIN123_B0_PA_GAIN3_0_SET(x) (((x) << 20) & 0x3ff00000) - -/* macros for bb_chn_reg_map.BB_pa_gain45_b0 */ -#define BB_PA_GAIN45_B0_ADDRESS 0x000000fc -#define BB_PA_GAIN45_B0_OFFSET 0x000000fc -#define BB_PA_GAIN45_B0_PA_GAIN4_0_MSB 9 -#define BB_PA_GAIN45_B0_PA_GAIN4_0_LSB 0 -#define BB_PA_GAIN45_B0_PA_GAIN4_0_MASK 0x000003ff -#define BB_PA_GAIN45_B0_PA_GAIN4_0_GET(x) (((x) & 0x000003ff) >> 0) -#define BB_PA_GAIN45_B0_PA_GAIN4_0_SET(x) (((x) << 0) & 0x000003ff) -#define BB_PA_GAIN45_B0_PA_GAIN5_0_MSB 19 -#define BB_PA_GAIN45_B0_PA_GAIN5_0_LSB 10 -#define BB_PA_GAIN45_B0_PA_GAIN5_0_MASK 0x000ffc00 -#define BB_PA_GAIN45_B0_PA_GAIN5_0_GET(x) (((x) & 0x000ffc00) >> 10) -#define BB_PA_GAIN45_B0_PA_GAIN5_0_SET(x) (((x) << 10) & 0x000ffc00) -#define BB_PA_GAIN45_B0_PAPRD_ADAPTIVE_TABLE_VALID_0_MSB 24 -#define BB_PA_GAIN45_B0_PAPRD_ADAPTIVE_TABLE_VALID_0_LSB 20 -#define BB_PA_GAIN45_B0_PAPRD_ADAPTIVE_TABLE_VALID_0_MASK 0x01f00000 -#define BB_PA_GAIN45_B0_PAPRD_ADAPTIVE_TABLE_VALID_0_GET(x) (((x) & 0x01f00000) >> 20) -#define BB_PA_GAIN45_B0_PAPRD_ADAPTIVE_TABLE_VALID_0_SET(x) (((x) << 20) & 0x01f00000) - -/* macros for bb_chn_reg_map.BB_paprd_pre_post_scale_0_b0 */ -#define BB_PAPRD_PRE_POST_SCALE_0_B0_ADDRESS 0x00000100 -#define BB_PAPRD_PRE_POST_SCALE_0_B0_OFFSET 0x00000100 -#define BB_PAPRD_PRE_POST_SCALE_0_B0_PAPRD_PRE_POST_SCALING_0_0_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_0_B0_PAPRD_PRE_POST_SCALING_0_0_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_0_B0_PAPRD_PRE_POST_SCALING_0_0_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_0_B0_PAPRD_PRE_POST_SCALING_0_0_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_0_B0_PAPRD_PRE_POST_SCALING_0_0_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn_reg_map.BB_paprd_pre_post_scale_1_b0 */ -#define BB_PAPRD_PRE_POST_SCALE_1_B0_ADDRESS 0x00000104 -#define BB_PAPRD_PRE_POST_SCALE_1_B0_OFFSET 0x00000104 -#define BB_PAPRD_PRE_POST_SCALE_1_B0_PAPRD_PRE_POST_SCALING_1_0_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_1_B0_PAPRD_PRE_POST_SCALING_1_0_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_1_B0_PAPRD_PRE_POST_SCALING_1_0_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_1_B0_PAPRD_PRE_POST_SCALING_1_0_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_1_B0_PAPRD_PRE_POST_SCALING_1_0_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn_reg_map.BB_paprd_pre_post_scale_2_b0 */ -#define BB_PAPRD_PRE_POST_SCALE_2_B0_ADDRESS 0x00000108 -#define BB_PAPRD_PRE_POST_SCALE_2_B0_OFFSET 0x00000108 -#define BB_PAPRD_PRE_POST_SCALE_2_B0_PAPRD_PRE_POST_SCALING_2_0_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_2_B0_PAPRD_PRE_POST_SCALING_2_0_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_2_B0_PAPRD_PRE_POST_SCALING_2_0_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_2_B0_PAPRD_PRE_POST_SCALING_2_0_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_2_B0_PAPRD_PRE_POST_SCALING_2_0_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn_reg_map.BB_paprd_pre_post_scale_3_b0 */ -#define BB_PAPRD_PRE_POST_SCALE_3_B0_ADDRESS 0x0000010c -#define BB_PAPRD_PRE_POST_SCALE_3_B0_OFFSET 0x0000010c -#define BB_PAPRD_PRE_POST_SCALE_3_B0_PAPRD_PRE_POST_SCALING_3_0_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_3_B0_PAPRD_PRE_POST_SCALING_3_0_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_3_B0_PAPRD_PRE_POST_SCALING_3_0_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_3_B0_PAPRD_PRE_POST_SCALING_3_0_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_3_B0_PAPRD_PRE_POST_SCALING_3_0_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn_reg_map.BB_paprd_pre_post_scale_4_b0 */ -#define BB_PAPRD_PRE_POST_SCALE_4_B0_ADDRESS 0x00000110 -#define BB_PAPRD_PRE_POST_SCALE_4_B0_OFFSET 0x00000110 -#define BB_PAPRD_PRE_POST_SCALE_4_B0_PAPRD_PRE_POST_SCALING_4_0_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_4_B0_PAPRD_PRE_POST_SCALING_4_0_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_4_B0_PAPRD_PRE_POST_SCALING_4_0_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_4_B0_PAPRD_PRE_POST_SCALING_4_0_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_4_B0_PAPRD_PRE_POST_SCALING_4_0_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn_reg_map.BB_paprd_pre_post_scale_5_b0 */ -#define BB_PAPRD_PRE_POST_SCALE_5_B0_ADDRESS 0x00000114 -#define BB_PAPRD_PRE_POST_SCALE_5_B0_OFFSET 0x00000114 -#define BB_PAPRD_PRE_POST_SCALE_5_B0_PAPRD_PRE_POST_SCALING_5_0_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_5_B0_PAPRD_PRE_POST_SCALING_5_0_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_5_B0_PAPRD_PRE_POST_SCALING_5_0_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_5_B0_PAPRD_PRE_POST_SCALING_5_0_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_5_B0_PAPRD_PRE_POST_SCALING_5_0_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn_reg_map.BB_paprd_pre_post_scale_6_b0 */ -#define BB_PAPRD_PRE_POST_SCALE_6_B0_ADDRESS 0x00000118 -#define BB_PAPRD_PRE_POST_SCALE_6_B0_OFFSET 0x00000118 -#define BB_PAPRD_PRE_POST_SCALE_6_B0_PAPRD_PRE_POST_SCALING_6_0_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_6_B0_PAPRD_PRE_POST_SCALING_6_0_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_6_B0_PAPRD_PRE_POST_SCALING_6_0_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_6_B0_PAPRD_PRE_POST_SCALING_6_0_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_6_B0_PAPRD_PRE_POST_SCALING_6_0_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn_reg_map.BB_paprd_pre_post_scale_7_b0 */ -#define BB_PAPRD_PRE_POST_SCALE_7_B0_ADDRESS 0x0000011c -#define BB_PAPRD_PRE_POST_SCALE_7_B0_OFFSET 0x0000011c -#define BB_PAPRD_PRE_POST_SCALE_7_B0_PAPRD_PRE_POST_SCALING_7_0_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_7_B0_PAPRD_PRE_POST_SCALING_7_0_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_7_B0_PAPRD_PRE_POST_SCALING_7_0_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_7_B0_PAPRD_PRE_POST_SCALING_7_0_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_7_B0_PAPRD_PRE_POST_SCALING_7_0_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn_reg_map.BB_paprd_mem_tab_b0 */ -#define BB_PAPRD_MEM_TAB_B0_ADDRESS 0x00000120 -#define BB_PAPRD_MEM_TAB_B0_OFFSET 0x00000120 -#define BB_PAPRD_MEM_TAB_B0_PAPRD_MEM_MSB 21 -#define BB_PAPRD_MEM_TAB_B0_PAPRD_MEM_LSB 0 -#define BB_PAPRD_MEM_TAB_B0_PAPRD_MEM_MASK 0x003fffff -#define BB_PAPRD_MEM_TAB_B0_PAPRD_MEM_GET(x) (((x) & 0x003fffff) >> 0) -#define BB_PAPRD_MEM_TAB_B0_PAPRD_MEM_SET(x) (((x) << 0) & 0x003fffff) - -/* macros for bb_chn_reg_map.BB_chan_info_chan_tab_b0 */ -#define BB_CHAN_INFO_CHAN_TAB_B0_ADDRESS 0x00000300 -#define BB_CHAN_INFO_CHAN_TAB_B0_OFFSET 0x00000300 -#define BB_CHAN_INFO_CHAN_TAB_B0_CHANINFO_WORD_MSB 31 -#define BB_CHAN_INFO_CHAN_TAB_B0_CHANINFO_WORD_LSB 0 -#define BB_CHAN_INFO_CHAN_TAB_B0_CHANINFO_WORD_MASK 0xffffffff -#define BB_CHAN_INFO_CHAN_TAB_B0_CHANINFO_WORD_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for bb_chn_reg_map.BB_chn_tables_intf_addr */ -#define BB_CHN_TABLES_INTF_ADDR_ADDRESS 0x000003f0 -#define BB_CHN_TABLES_INTF_ADDR_OFFSET 0x000003f0 -#define BB_CHN_TABLES_INTF_ADDR_CHN_TABLES_ADDR_MSB 17 -#define BB_CHN_TABLES_INTF_ADDR_CHN_TABLES_ADDR_LSB 2 -#define BB_CHN_TABLES_INTF_ADDR_CHN_TABLES_ADDR_MASK 0x0003fffc -#define BB_CHN_TABLES_INTF_ADDR_CHN_TABLES_ADDR_GET(x) (((x) & 0x0003fffc) >> 2) -#define BB_CHN_TABLES_INTF_ADDR_CHN_TABLES_ADDR_SET(x) (((x) << 2) & 0x0003fffc) -#define BB_CHN_TABLES_INTF_ADDR_CHN_ADDR_AUTO_INCR_MSB 31 -#define BB_CHN_TABLES_INTF_ADDR_CHN_ADDR_AUTO_INCR_LSB 31 -#define BB_CHN_TABLES_INTF_ADDR_CHN_ADDR_AUTO_INCR_MASK 0x80000000 -#define BB_CHN_TABLES_INTF_ADDR_CHN_ADDR_AUTO_INCR_GET(x) (((x) & 0x80000000) >> 31) -#define BB_CHN_TABLES_INTF_ADDR_CHN_ADDR_AUTO_INCR_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_chn_reg_map.BB_chn_tables_intf_data */ -#define BB_CHN_TABLES_INTF_DATA_ADDRESS 0x000003f4 -#define BB_CHN_TABLES_INTF_DATA_OFFSET 0x000003f4 -#define BB_CHN_TABLES_INTF_DATA_CHN_TABLES_DATA_MSB 31 -#define BB_CHN_TABLES_INTF_DATA_CHN_TABLES_DATA_LSB 0 -#define BB_CHN_TABLES_INTF_DATA_CHN_TABLES_DATA_MASK 0xffffffff -#define BB_CHN_TABLES_INTF_DATA_CHN_TABLES_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CHN_TABLES_INTF_DATA_CHN_TABLES_DATA_SET(x) (((x) << 0) & 0xffffffff) - -#ifndef __ASSEMBLER__ - -typedef struct bb_reg_reg_s_1 { - volatile unsigned int BB_timing_controls_1; /* 0x0 - 0x4 */ - volatile unsigned int BB_timing_controls_2; /* 0x4 - 0x8 */ - volatile unsigned int BB_timing_controls_3; /* 0x8 - 0xc */ - volatile unsigned int BB_timing_control_4; /* 0xc - 0x10 */ - volatile unsigned int BB_timing_control_5; /* 0x10 - 0x14 */ - volatile unsigned int BB_timing_control_6; /* 0x14 - 0x18 */ - volatile unsigned int BB_timing_control_11; /* 0x18 - 0x1c */ - volatile unsigned int BB_spur_mask_controls; /* 0x1c - 0x20 */ - volatile unsigned int BB_find_signal_low; /* 0x20 - 0x24 */ - volatile unsigned int BB_sfcorr; /* 0x24 - 0x28 */ - volatile unsigned int BB_self_corr_low; /* 0x28 - 0x2c */ - volatile unsigned int BB_ext_chan_scorr_thr; /* 0x2c - 0x30 */ - volatile unsigned int BB_ext_chan_pwr_thr_2_b0; /* 0x30 - 0x34 */ - volatile unsigned int BB_radar_detection; /* 0x34 - 0x38 */ - volatile unsigned int BB_radar_detection_2; /* 0x38 - 0x3c */ - volatile unsigned int BB_extension_radar; /* 0x3c - 0x40 */ - volatile char pad__0[0x40]; /* 0x40 - 0x80 */ - volatile unsigned int BB_multichain_control; /* 0x80 - 0x84 */ - volatile unsigned int BB_per_chain_csd; /* 0x84 - 0x88 */ - volatile char pad__1[0x18]; /* 0x88 - 0xa0 */ - volatile unsigned int BB_tx_crc; /* 0xa0 - 0xa4 */ - volatile unsigned int BB_tstdac_constant; /* 0xa4 - 0xa8 */ - volatile unsigned int BB_spur_report_b0; /* 0xa8 - 0xac */ - volatile char pad__2[0x4]; /* 0xac - 0xb0 */ - volatile unsigned int BB_txiqcal_control_3; /* 0xb0 - 0xb4 */ - volatile char pad__3[0x8]; /* 0xb4 - 0xbc */ - volatile unsigned int BB_green_tx_control_1; /* 0xbc - 0xc0 */ - volatile unsigned int BB_iq_adc_meas_0_b0; /* 0xc0 - 0xc4 */ - volatile unsigned int BB_iq_adc_meas_1_b0; /* 0xc4 - 0xc8 */ - volatile unsigned int BB_iq_adc_meas_2_b0; /* 0xc8 - 0xcc */ - volatile unsigned int BB_iq_adc_meas_3_b0; /* 0xcc - 0xd0 */ - volatile unsigned int BB_tx_phase_ramp_b0; /* 0xd0 - 0xd4 */ - volatile unsigned int BB_adc_gain_dc_corr_b0; /* 0xd4 - 0xd8 */ - volatile char pad__4[0x4]; /* 0xd8 - 0xdc */ - volatile unsigned int BB_rx_iq_corr_b0; /* 0xdc - 0xe0 */ - volatile char pad__5[0x4]; /* 0xe0 - 0xe4 */ - volatile unsigned int BB_paprd_am2am_mask; /* 0xe4 - 0xe8 */ - volatile unsigned int BB_paprd_am2pm_mask; /* 0xe8 - 0xec */ - volatile unsigned int BB_paprd_ht40_mask; /* 0xec - 0xf0 */ - volatile unsigned int BB_paprd_ctrl0_b0; /* 0xf0 - 0xf4 */ - volatile unsigned int BB_paprd_ctrl1_b0; /* 0xf4 - 0xf8 */ - volatile unsigned int BB_pa_gain123_b0; /* 0xf8 - 0xfc */ - volatile unsigned int BB_pa_gain45_b0; /* 0xfc - 0x100 */ - volatile unsigned int BB_paprd_pre_post_scale_0_b0; /* 0x100 - 0x104 */ - volatile unsigned int BB_paprd_pre_post_scale_1_b0; /* 0x104 - 0x108 */ - volatile unsigned int BB_paprd_pre_post_scale_2_b0; /* 0x108 - 0x10c */ - volatile unsigned int BB_paprd_pre_post_scale_3_b0; /* 0x10c - 0x110 */ - volatile unsigned int BB_paprd_pre_post_scale_4_b0; /* 0x110 - 0x114 */ - volatile unsigned int BB_paprd_pre_post_scale_5_b0; /* 0x114 - 0x118 */ - volatile unsigned int BB_paprd_pre_post_scale_6_b0; /* 0x118 - 0x11c */ - volatile unsigned int BB_paprd_pre_post_scale_7_b0; /* 0x11c - 0x120 */ - volatile unsigned int BB_paprd_mem_tab_b0[120]; /* 0x120 - 0x300 */ - volatile unsigned int BB_chan_info_chan_tab_b0[60]; /* 0x300 - 0x3f0 */ - volatile unsigned int BB_chn_tables_intf_addr; /* 0x3f0 - 0x3f4 */ - volatile unsigned int BB_chn_tables_intf_data; /* 0x3f4 - 0x3f8 */ -} bb_reg_reg_t_1; - -#endif /* __ASSEMBLER__ */ - - -/* macros for bb_mrc_reg_map.BB_timing_control_3a */ -#define BB_TIMING_CONTROL_3A_ADDRESS 0x00000000 -#define BB_TIMING_CONTROL_3A_OFFSET 0x00000000 -#define BB_TIMING_CONTROL_3A_STE_THR_HI_RSSI_MSB 6 -#define BB_TIMING_CONTROL_3A_STE_THR_HI_RSSI_LSB 0 -#define BB_TIMING_CONTROL_3A_STE_THR_HI_RSSI_MASK 0x0000007f -#define BB_TIMING_CONTROL_3A_STE_THR_HI_RSSI_GET(x) (((x) & 0x0000007f) >> 0) -#define BB_TIMING_CONTROL_3A_STE_THR_HI_RSSI_SET(x) (((x) << 0) & 0x0000007f) -#define BB_TIMING_CONTROL_3A_USE_HTSIG1_20_40_BW_VALUE_MSB 7 -#define BB_TIMING_CONTROL_3A_USE_HTSIG1_20_40_BW_VALUE_LSB 7 -#define BB_TIMING_CONTROL_3A_USE_HTSIG1_20_40_BW_VALUE_MASK 0x00000080 -#define BB_TIMING_CONTROL_3A_USE_HTSIG1_20_40_BW_VALUE_GET(x) (((x) & 0x00000080) >> 7) -#define BB_TIMING_CONTROL_3A_USE_HTSIG1_20_40_BW_VALUE_SET(x) (((x) << 7) & 0x00000080) - -/* macros for bb_mrc_reg_map.BB_ldpc_cntl1 */ -#define BB_LDPC_CNTL1_ADDRESS 0x00000004 -#define BB_LDPC_CNTL1_OFFSET 0x00000004 -#define BB_LDPC_CNTL1_LDPC_LLR_SCALING0_MSB 31 -#define BB_LDPC_CNTL1_LDPC_LLR_SCALING0_LSB 0 -#define BB_LDPC_CNTL1_LDPC_LLR_SCALING0_MASK 0xffffffff -#define BB_LDPC_CNTL1_LDPC_LLR_SCALING0_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_LDPC_CNTL1_LDPC_LLR_SCALING0_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_mrc_reg_map.BB_ldpc_cntl2 */ -#define BB_LDPC_CNTL2_ADDRESS 0x00000008 -#define BB_LDPC_CNTL2_OFFSET 0x00000008 -#define BB_LDPC_CNTL2_LDPC_LLR_SCALING1_MSB 15 -#define BB_LDPC_CNTL2_LDPC_LLR_SCALING1_LSB 0 -#define BB_LDPC_CNTL2_LDPC_LLR_SCALING1_MASK 0x0000ffff -#define BB_LDPC_CNTL2_LDPC_LLR_SCALING1_GET(x) (((x) & 0x0000ffff) >> 0) -#define BB_LDPC_CNTL2_LDPC_LLR_SCALING1_SET(x) (((x) << 0) & 0x0000ffff) -#define BB_LDPC_CNTL2_LDPC_LATENCY_MSB 26 -#define BB_LDPC_CNTL2_LDPC_LATENCY_LSB 16 -#define BB_LDPC_CNTL2_LDPC_LATENCY_MASK 0x07ff0000 -#define BB_LDPC_CNTL2_LDPC_LATENCY_GET(x) (((x) & 0x07ff0000) >> 16) -#define BB_LDPC_CNTL2_LDPC_LATENCY_SET(x) (((x) << 16) & 0x07ff0000) - -/* macros for bb_mrc_reg_map.BB_pilot_spur_mask */ -#define BB_PILOT_SPUR_MASK_ADDRESS 0x0000000c -#define BB_PILOT_SPUR_MASK_OFFSET 0x0000000c -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_A_MSB 4 -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_A_LSB 0 -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_A_MASK 0x0000001f -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_A_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_A_SET(x) (((x) << 0) & 0x0000001f) -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A_MSB 11 -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A_LSB 5 -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A_MASK 0x00000fe0 -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A_GET(x) (((x) & 0x00000fe0) >> 5) -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A_SET(x) (((x) << 5) & 0x00000fe0) -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_B_MSB 16 -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_B_LSB 12 -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_B_MASK 0x0001f000 -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_B_GET(x) (((x) & 0x0001f000) >> 12) -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_B_SET(x) (((x) << 12) & 0x0001f000) -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_B_MSB 23 -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_B_LSB 17 -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_B_MASK 0x00fe0000 -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_B_GET(x) (((x) & 0x00fe0000) >> 17) -#define BB_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_B_SET(x) (((x) << 17) & 0x00fe0000) - -/* macros for bb_mrc_reg_map.BB_chan_spur_mask */ -#define BB_CHAN_SPUR_MASK_ADDRESS 0x00000010 -#define BB_CHAN_SPUR_MASK_OFFSET 0x00000010 -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_A_MSB 4 -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_A_LSB 0 -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_A_MASK 0x0000001f -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_A_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_A_SET(x) (((x) << 0) & 0x0000001f) -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A_MSB 11 -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A_LSB 5 -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A_MASK 0x00000fe0 -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A_GET(x) (((x) & 0x00000fe0) >> 5) -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A_SET(x) (((x) << 5) & 0x00000fe0) -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_B_MSB 16 -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_B_LSB 12 -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_B_MASK 0x0001f000 -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_B_GET(x) (((x) & 0x0001f000) >> 12) -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_B_SET(x) (((x) << 12) & 0x0001f000) -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_B_MSB 23 -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_B_LSB 17 -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_B_MASK 0x00fe0000 -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_B_GET(x) (((x) & 0x00fe0000) >> 17) -#define BB_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_B_SET(x) (((x) << 17) & 0x00fe0000) - -/* macros for bb_mrc_reg_map.BB_short_gi_delta_slope */ -#define BB_SHORT_GI_DELTA_SLOPE_ADDRESS 0x00000014 -#define BB_SHORT_GI_DELTA_SLOPE_OFFSET 0x00000014 -#define BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_EXP_SHORT_GI_MSB 3 -#define BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_EXP_SHORT_GI_LSB 0 -#define BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_EXP_SHORT_GI_MASK 0x0000000f -#define BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_EXP_SHORT_GI_GET(x) (((x) & 0x0000000f) >> 0) -#define BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_EXP_SHORT_GI_SET(x) (((x) << 0) & 0x0000000f) -#define BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_MAN_SHORT_GI_MSB 18 -#define BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_MAN_SHORT_GI_LSB 4 -#define BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_MAN_SHORT_GI_MASK 0x0007fff0 -#define BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_MAN_SHORT_GI_GET(x) (((x) & 0x0007fff0) >> 4) -#define BB_SHORT_GI_DELTA_SLOPE_DELTA_SLOPE_COEF_MAN_SHORT_GI_SET(x) (((x) << 4) & 0x0007fff0) - -/* macros for bb_mrc_reg_map.BB_ml_cntl1 */ -#define BB_ML_CNTL1_ADDRESS 0x00000018 -#define BB_ML_CNTL1_OFFSET 0x00000018 -#define BB_ML_CNTL1_CF_ML_2S_WEIGHT_TABLE_MSB 23 -#define BB_ML_CNTL1_CF_ML_2S_WEIGHT_TABLE_LSB 0 -#define BB_ML_CNTL1_CF_ML_2S_WEIGHT_TABLE_MASK 0x00ffffff -#define BB_ML_CNTL1_CF_ML_2S_WEIGHT_TABLE_GET(x) (((x) & 0x00ffffff) >> 0) -#define BB_ML_CNTL1_CF_ML_2S_WEIGHT_TABLE_SET(x) (((x) << 0) & 0x00ffffff) -#define BB_ML_CNTL1_CF_IS_FLAT_CH_THR_ML_MSB 25 -#define BB_ML_CNTL1_CF_IS_FLAT_CH_THR_ML_LSB 24 -#define BB_ML_CNTL1_CF_IS_FLAT_CH_THR_ML_MASK 0x03000000 -#define BB_ML_CNTL1_CF_IS_FLAT_CH_THR_ML_GET(x) (((x) & 0x03000000) >> 24) -#define BB_ML_CNTL1_CF_IS_FLAT_CH_THR_ML_SET(x) (((x) << 24) & 0x03000000) -#define BB_ML_CNTL1_CF_IS_FLAT_CH_THR_ZF_MSB 27 -#define BB_ML_CNTL1_CF_IS_FLAT_CH_THR_ZF_LSB 26 -#define BB_ML_CNTL1_CF_IS_FLAT_CH_THR_ZF_MASK 0x0c000000 -#define BB_ML_CNTL1_CF_IS_FLAT_CH_THR_ZF_GET(x) (((x) & 0x0c000000) >> 26) -#define BB_ML_CNTL1_CF_IS_FLAT_CH_THR_ZF_SET(x) (((x) << 26) & 0x0c000000) - -/* macros for bb_mrc_reg_map.BB_ml_cntl2 */ -#define BB_ML_CNTL2_ADDRESS 0x0000001c -#define BB_ML_CNTL2_OFFSET 0x0000001c -#define BB_ML_CNTL2_CF_ML_3S_WEIGHT_TABLE_MSB 23 -#define BB_ML_CNTL2_CF_ML_3S_WEIGHT_TABLE_LSB 0 -#define BB_ML_CNTL2_CF_ML_3S_WEIGHT_TABLE_MASK 0x00ffffff -#define BB_ML_CNTL2_CF_ML_3S_WEIGHT_TABLE_GET(x) (((x) & 0x00ffffff) >> 0) -#define BB_ML_CNTL2_CF_ML_3S_WEIGHT_TABLE_SET(x) (((x) << 0) & 0x00ffffff) - -/* macros for bb_mrc_reg_map.BB_tstadc */ -#define BB_TSTADC_ADDRESS 0x00000020 -#define BB_TSTADC_OFFSET 0x00000020 -#define BB_TSTADC_TSTADC_OUT_Q_MSB 9 -#define BB_TSTADC_TSTADC_OUT_Q_LSB 0 -#define BB_TSTADC_TSTADC_OUT_Q_MASK 0x000003ff -#define BB_TSTADC_TSTADC_OUT_Q_GET(x) (((x) & 0x000003ff) >> 0) -#define BB_TSTADC_TSTADC_OUT_I_MSB 19 -#define BB_TSTADC_TSTADC_OUT_I_LSB 10 -#define BB_TSTADC_TSTADC_OUT_I_MASK 0x000ffc00 -#define BB_TSTADC_TSTADC_OUT_I_GET(x) (((x) & 0x000ffc00) >> 10) - -#ifndef __ASSEMBLER__ - -typedef struct bb_reg_reg_s_2 { - volatile unsigned int BB_timing_control_3a; /* 0x0 - 0x4 */ - volatile unsigned int BB_ldpc_cntl1; /* 0x4 - 0x8 */ - volatile unsigned int BB_ldpc_cntl2; /* 0x8 - 0xc */ - volatile unsigned int BB_pilot_spur_mask; /* 0xc - 0x10 */ - volatile unsigned int BB_chan_spur_mask; /* 0x10 - 0x14 */ - volatile unsigned int BB_short_gi_delta_slope; /* 0x14 - 0x18 */ - volatile unsigned int BB_ml_cntl1; /* 0x18 - 0x1c */ - volatile unsigned int BB_ml_cntl2; /* 0x1c - 0x20 */ - volatile unsigned int BB_tstadc; /* 0x20 - 0x24 */ -} bb_reg_reg_t2; - -#endif /* __ASSEMBLER__ */ - - -/* macros for bb_bbb_reg_map.BB_bbb_rx_ctrl_1 */ -#define BB_BBB_RX_CTRL_1_ADDRESS 0x00000000 -#define BB_BBB_RX_CTRL_1_OFFSET 0x00000000 -#define BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_2_MSB 2 -#define BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_2_LSB 0 -#define BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_2_MASK 0x00000007 -#define BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_2_GET(x) (((x) & 0x00000007) >> 0) -#define BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_2_SET(x) (((x) << 0) & 0x00000007) -#define BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_MSB 7 -#define BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_LSB 3 -#define BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_MASK 0x000000f8 -#define BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_GET(x) (((x) & 0x000000f8) >> 3) -#define BB_BBB_RX_CTRL_1_COARSE_TIM_THRESHOLD_SET(x) (((x) << 3) & 0x000000f8) -#define BB_BBB_RX_CTRL_1_COARSE_TIM_N_SYNC_MSB 10 -#define BB_BBB_RX_CTRL_1_COARSE_TIM_N_SYNC_LSB 8 -#define BB_BBB_RX_CTRL_1_COARSE_TIM_N_SYNC_MASK 0x00000700 -#define BB_BBB_RX_CTRL_1_COARSE_TIM_N_SYNC_GET(x) (((x) & 0x00000700) >> 8) -#define BB_BBB_RX_CTRL_1_COARSE_TIM_N_SYNC_SET(x) (((x) << 8) & 0x00000700) -#define BB_BBB_RX_CTRL_1_MAX_BAL_LONG_MSB 15 -#define BB_BBB_RX_CTRL_1_MAX_BAL_LONG_LSB 11 -#define BB_BBB_RX_CTRL_1_MAX_BAL_LONG_MASK 0x0000f800 -#define BB_BBB_RX_CTRL_1_MAX_BAL_LONG_GET(x) (((x) & 0x0000f800) >> 11) -#define BB_BBB_RX_CTRL_1_MAX_BAL_LONG_SET(x) (((x) << 11) & 0x0000f800) -#define BB_BBB_RX_CTRL_1_MAX_BAL_SHORT_MSB 20 -#define BB_BBB_RX_CTRL_1_MAX_BAL_SHORT_LSB 16 -#define BB_BBB_RX_CTRL_1_MAX_BAL_SHORT_MASK 0x001f0000 -#define BB_BBB_RX_CTRL_1_MAX_BAL_SHORT_GET(x) (((x) & 0x001f0000) >> 16) -#define BB_BBB_RX_CTRL_1_MAX_BAL_SHORT_SET(x) (((x) << 16) & 0x001f0000) -#define BB_BBB_RX_CTRL_1_RECON_LMS_STEP_MSB 23 -#define BB_BBB_RX_CTRL_1_RECON_LMS_STEP_LSB 21 -#define BB_BBB_RX_CTRL_1_RECON_LMS_STEP_MASK 0x00e00000 -#define BB_BBB_RX_CTRL_1_RECON_LMS_STEP_GET(x) (((x) & 0x00e00000) >> 21) -#define BB_BBB_RX_CTRL_1_RECON_LMS_STEP_SET(x) (((x) << 21) & 0x00e00000) -#define BB_BBB_RX_CTRL_1_SB_CHECK_WIN_MSB 30 -#define BB_BBB_RX_CTRL_1_SB_CHECK_WIN_LSB 24 -#define BB_BBB_RX_CTRL_1_SB_CHECK_WIN_MASK 0x7f000000 -#define BB_BBB_RX_CTRL_1_SB_CHECK_WIN_GET(x) (((x) & 0x7f000000) >> 24) -#define BB_BBB_RX_CTRL_1_SB_CHECK_WIN_SET(x) (((x) << 24) & 0x7f000000) -#define BB_BBB_RX_CTRL_1_EN_RX_ABORT_CCK_MSB 31 -#define BB_BBB_RX_CTRL_1_EN_RX_ABORT_CCK_LSB 31 -#define BB_BBB_RX_CTRL_1_EN_RX_ABORT_CCK_MASK 0x80000000 -#define BB_BBB_RX_CTRL_1_EN_RX_ABORT_CCK_GET(x) (((x) & 0x80000000) >> 31) -#define BB_BBB_RX_CTRL_1_EN_RX_ABORT_CCK_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_bbb_reg_map.BB_bbb_rx_ctrl_2 */ -#define BB_BBB_RX_CTRL_2_ADDRESS 0x00000004 -#define BB_BBB_RX_CTRL_2_OFFSET 0x00000004 -#define BB_BBB_RX_CTRL_2_FREQ_EST_N_AVG_LONG_MSB 5 -#define BB_BBB_RX_CTRL_2_FREQ_EST_N_AVG_LONG_LSB 0 -#define BB_BBB_RX_CTRL_2_FREQ_EST_N_AVG_LONG_MASK 0x0000003f -#define BB_BBB_RX_CTRL_2_FREQ_EST_N_AVG_LONG_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_BBB_RX_CTRL_2_FREQ_EST_N_AVG_LONG_SET(x) (((x) << 0) & 0x0000003f) -#define BB_BBB_RX_CTRL_2_CHAN_AVG_LONG_MSB 11 -#define BB_BBB_RX_CTRL_2_CHAN_AVG_LONG_LSB 6 -#define BB_BBB_RX_CTRL_2_CHAN_AVG_LONG_MASK 0x00000fc0 -#define BB_BBB_RX_CTRL_2_CHAN_AVG_LONG_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_BBB_RX_CTRL_2_CHAN_AVG_LONG_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_BBB_RX_CTRL_2_COARSE_TIM_THRESHOLD_3_MSB 16 -#define BB_BBB_RX_CTRL_2_COARSE_TIM_THRESHOLD_3_LSB 12 -#define BB_BBB_RX_CTRL_2_COARSE_TIM_THRESHOLD_3_MASK 0x0001f000 -#define BB_BBB_RX_CTRL_2_COARSE_TIM_THRESHOLD_3_GET(x) (((x) & 0x0001f000) >> 12) -#define BB_BBB_RX_CTRL_2_COARSE_TIM_THRESHOLD_3_SET(x) (((x) << 12) & 0x0001f000) -#define BB_BBB_RX_CTRL_2_FREQ_TRACK_UPDATE_PERIOD_MSB 21 -#define BB_BBB_RX_CTRL_2_FREQ_TRACK_UPDATE_PERIOD_LSB 17 -#define BB_BBB_RX_CTRL_2_FREQ_TRACK_UPDATE_PERIOD_MASK 0x003e0000 -#define BB_BBB_RX_CTRL_2_FREQ_TRACK_UPDATE_PERIOD_GET(x) (((x) & 0x003e0000) >> 17) -#define BB_BBB_RX_CTRL_2_FREQ_TRACK_UPDATE_PERIOD_SET(x) (((x) << 17) & 0x003e0000) -#define BB_BBB_RX_CTRL_2_FREQ_EST_SCALING_PERIOD_MSB 25 -#define BB_BBB_RX_CTRL_2_FREQ_EST_SCALING_PERIOD_LSB 22 -#define BB_BBB_RX_CTRL_2_FREQ_EST_SCALING_PERIOD_MASK 0x03c00000 -#define BB_BBB_RX_CTRL_2_FREQ_EST_SCALING_PERIOD_GET(x) (((x) & 0x03c00000) >> 22) -#define BB_BBB_RX_CTRL_2_FREQ_EST_SCALING_PERIOD_SET(x) (((x) << 22) & 0x03c00000) -#define BB_BBB_RX_CTRL_2_LOOP_COEF_DPSK_C2_DATA_MSB 31 -#define BB_BBB_RX_CTRL_2_LOOP_COEF_DPSK_C2_DATA_LSB 26 -#define BB_BBB_RX_CTRL_2_LOOP_COEF_DPSK_C2_DATA_MASK 0xfc000000 -#define BB_BBB_RX_CTRL_2_LOOP_COEF_DPSK_C2_DATA_GET(x) (((x) & 0xfc000000) >> 26) -#define BB_BBB_RX_CTRL_2_LOOP_COEF_DPSK_C2_DATA_SET(x) (((x) << 26) & 0xfc000000) - -/* macros for bb_bbb_reg_map.BB_bbb_rx_ctrl_3 */ -#define BB_BBB_RX_CTRL_3_ADDRESS 0x00000008 -#define BB_BBB_RX_CTRL_3_OFFSET 0x00000008 -#define BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_DPSK_MSB 7 -#define BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_DPSK_LSB 0 -#define BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_DPSK_MASK 0x000000ff -#define BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_DPSK_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_DPSK_SET(x) (((x) << 0) & 0x000000ff) -#define BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_CCK_MSB 15 -#define BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_CCK_LSB 8 -#define BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_CCK_MASK 0x0000ff00 -#define BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_CCK_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_BBB_RX_CTRL_3_TIM_ADJUST_FREQ_CCK_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_BBB_RX_CTRL_3_TIMER_N_SFD_MSB 23 -#define BB_BBB_RX_CTRL_3_TIMER_N_SFD_LSB 16 -#define BB_BBB_RX_CTRL_3_TIMER_N_SFD_MASK 0x00ff0000 -#define BB_BBB_RX_CTRL_3_TIMER_N_SFD_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_BBB_RX_CTRL_3_TIMER_N_SFD_SET(x) (((x) << 16) & 0x00ff0000) - -/* macros for bb_bbb_reg_map.BB_bbb_rx_ctrl_4 */ -#define BB_BBB_RX_CTRL_4_ADDRESS 0x0000000c -#define BB_BBB_RX_CTRL_4_OFFSET 0x0000000c -#define BB_BBB_RX_CTRL_4_TIMER_N_SYNC_MSB 3 -#define BB_BBB_RX_CTRL_4_TIMER_N_SYNC_LSB 0 -#define BB_BBB_RX_CTRL_4_TIMER_N_SYNC_MASK 0x0000000f -#define BB_BBB_RX_CTRL_4_TIMER_N_SYNC_GET(x) (((x) & 0x0000000f) >> 0) -#define BB_BBB_RX_CTRL_4_TIMER_N_SYNC_SET(x) (((x) << 0) & 0x0000000f) -#define BB_BBB_RX_CTRL_4_TIM_ADJUST_TIMER_EXP_MSB 15 -#define BB_BBB_RX_CTRL_4_TIM_ADJUST_TIMER_EXP_LSB 4 -#define BB_BBB_RX_CTRL_4_TIM_ADJUST_TIMER_EXP_MASK 0x0000fff0 -#define BB_BBB_RX_CTRL_4_TIM_ADJUST_TIMER_EXP_GET(x) (((x) & 0x0000fff0) >> 4) -#define BB_BBB_RX_CTRL_4_TIM_ADJUST_TIMER_EXP_SET(x) (((x) << 4) & 0x0000fff0) -#define BB_BBB_RX_CTRL_4_FORCE_UNLOCKED_CLOCKS_MSB 16 -#define BB_BBB_RX_CTRL_4_FORCE_UNLOCKED_CLOCKS_LSB 16 -#define BB_BBB_RX_CTRL_4_FORCE_UNLOCKED_CLOCKS_MASK 0x00010000 -#define BB_BBB_RX_CTRL_4_FORCE_UNLOCKED_CLOCKS_GET(x) (((x) & 0x00010000) >> 16) -#define BB_BBB_RX_CTRL_4_FORCE_UNLOCKED_CLOCKS_SET(x) (((x) << 16) & 0x00010000) -#define BB_BBB_RX_CTRL_4_DYNAMIC_PREAM_SEL_MSB 17 -#define BB_BBB_RX_CTRL_4_DYNAMIC_PREAM_SEL_LSB 17 -#define BB_BBB_RX_CTRL_4_DYNAMIC_PREAM_SEL_MASK 0x00020000 -#define BB_BBB_RX_CTRL_4_DYNAMIC_PREAM_SEL_GET(x) (((x) & 0x00020000) >> 17) -#define BB_BBB_RX_CTRL_4_DYNAMIC_PREAM_SEL_SET(x) (((x) << 17) & 0x00020000) -#define BB_BBB_RX_CTRL_4_SHORT_PREAMBLE_MSB 18 -#define BB_BBB_RX_CTRL_4_SHORT_PREAMBLE_LSB 18 -#define BB_BBB_RX_CTRL_4_SHORT_PREAMBLE_MASK 0x00040000 -#define BB_BBB_RX_CTRL_4_SHORT_PREAMBLE_GET(x) (((x) & 0x00040000) >> 18) -#define BB_BBB_RX_CTRL_4_SHORT_PREAMBLE_SET(x) (((x) << 18) & 0x00040000) -#define BB_BBB_RX_CTRL_4_FREQ_EST_N_AVG_SHORT_MSB 24 -#define BB_BBB_RX_CTRL_4_FREQ_EST_N_AVG_SHORT_LSB 19 -#define BB_BBB_RX_CTRL_4_FREQ_EST_N_AVG_SHORT_MASK 0x01f80000 -#define BB_BBB_RX_CTRL_4_FREQ_EST_N_AVG_SHORT_GET(x) (((x) & 0x01f80000) >> 19) -#define BB_BBB_RX_CTRL_4_FREQ_EST_N_AVG_SHORT_SET(x) (((x) << 19) & 0x01f80000) -#define BB_BBB_RX_CTRL_4_CHAN_AVG_SHORT_MSB 30 -#define BB_BBB_RX_CTRL_4_CHAN_AVG_SHORT_LSB 25 -#define BB_BBB_RX_CTRL_4_CHAN_AVG_SHORT_MASK 0x7e000000 -#define BB_BBB_RX_CTRL_4_CHAN_AVG_SHORT_GET(x) (((x) & 0x7e000000) >> 25) -#define BB_BBB_RX_CTRL_4_CHAN_AVG_SHORT_SET(x) (((x) << 25) & 0x7e000000) -#define BB_BBB_RX_CTRL_4_USE_MRC_WEIGHT_MSB 31 -#define BB_BBB_RX_CTRL_4_USE_MRC_WEIGHT_LSB 31 -#define BB_BBB_RX_CTRL_4_USE_MRC_WEIGHT_MASK 0x80000000 -#define BB_BBB_RX_CTRL_4_USE_MRC_WEIGHT_GET(x) (((x) & 0x80000000) >> 31) -#define BB_BBB_RX_CTRL_4_USE_MRC_WEIGHT_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_bbb_reg_map.BB_bbb_rx_ctrl_5 */ -#define BB_BBB_RX_CTRL_5_ADDRESS 0x00000010 -#define BB_BBB_RX_CTRL_5_OFFSET 0x00000010 -#define BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_DATA_MSB 4 -#define BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_DATA_LSB 0 -#define BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_DATA_MASK 0x0000001f -#define BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_DATA_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_DATA_SET(x) (((x) << 0) & 0x0000001f) -#define BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_HEAD_MSB 9 -#define BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_HEAD_LSB 5 -#define BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_HEAD_MASK 0x000003e0 -#define BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_HEAD_GET(x) (((x) & 0x000003e0) >> 5) -#define BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C1_HEAD_SET(x) (((x) << 5) & 0x000003e0) -#define BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C2_HEAD_MSB 15 -#define BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C2_HEAD_LSB 10 -#define BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C2_HEAD_MASK 0x0000fc00 -#define BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C2_HEAD_GET(x) (((x) & 0x0000fc00) >> 10) -#define BB_BBB_RX_CTRL_5_LOOP_COEF_DPSK_C2_HEAD_SET(x) (((x) << 10) & 0x0000fc00) -#define BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C1_MSB 20 -#define BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C1_LSB 16 -#define BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C1_MASK 0x001f0000 -#define BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C1_GET(x) (((x) & 0x001f0000) >> 16) -#define BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C1_SET(x) (((x) << 16) & 0x001f0000) -#define BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C2_MSB 26 -#define BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C2_LSB 21 -#define BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C2_MASK 0x07e00000 -#define BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C2_GET(x) (((x) & 0x07e00000) >> 21) -#define BB_BBB_RX_CTRL_5_LOOP_COEF_CCK_C2_SET(x) (((x) << 21) & 0x07e00000) - -/* macros for bb_bbb_reg_map.BB_bbb_rx_ctrl_6 */ -#define BB_BBB_RX_CTRL_6_ADDRESS 0x00000014 -#define BB_BBB_RX_CTRL_6_OFFSET 0x00000014 -#define BB_BBB_RX_CTRL_6_SYNC_START_DELAY_MSB 9 -#define BB_BBB_RX_CTRL_6_SYNC_START_DELAY_LSB 0 -#define BB_BBB_RX_CTRL_6_SYNC_START_DELAY_MASK 0x000003ff -#define BB_BBB_RX_CTRL_6_SYNC_START_DELAY_GET(x) (((x) & 0x000003ff) >> 0) -#define BB_BBB_RX_CTRL_6_SYNC_START_DELAY_SET(x) (((x) << 0) & 0x000003ff) -#define BB_BBB_RX_CTRL_6_MAP_1S_TO_2S_MSB 10 -#define BB_BBB_RX_CTRL_6_MAP_1S_TO_2S_LSB 10 -#define BB_BBB_RX_CTRL_6_MAP_1S_TO_2S_MASK 0x00000400 -#define BB_BBB_RX_CTRL_6_MAP_1S_TO_2S_GET(x) (((x) & 0x00000400) >> 10) -#define BB_BBB_RX_CTRL_6_MAP_1S_TO_2S_SET(x) (((x) << 10) & 0x00000400) -#define BB_BBB_RX_CTRL_6_START_IIR_DELAY_MSB 20 -#define BB_BBB_RX_CTRL_6_START_IIR_DELAY_LSB 11 -#define BB_BBB_RX_CTRL_6_START_IIR_DELAY_MASK 0x001ff800 -#define BB_BBB_RX_CTRL_6_START_IIR_DELAY_GET(x) (((x) & 0x001ff800) >> 11) -#define BB_BBB_RX_CTRL_6_START_IIR_DELAY_SET(x) (((x) << 11) & 0x001ff800) -#define BB_BBB_RX_CTRL_6_USE_MCORR_WEIGHT_MSB 21 -#define BB_BBB_RX_CTRL_6_USE_MCORR_WEIGHT_LSB 21 -#define BB_BBB_RX_CTRL_6_USE_MCORR_WEIGHT_MASK 0x00200000 -#define BB_BBB_RX_CTRL_6_USE_MCORR_WEIGHT_GET(x) (((x) & 0x00200000) >> 21) -#define BB_BBB_RX_CTRL_6_USE_MCORR_WEIGHT_SET(x) (((x) << 21) & 0x00200000) -#define BB_BBB_RX_CTRL_6_USE_BKPWR_FOR_CENTER_INDEX_MSB 22 -#define BB_BBB_RX_CTRL_6_USE_BKPWR_FOR_CENTER_INDEX_LSB 22 -#define BB_BBB_RX_CTRL_6_USE_BKPWR_FOR_CENTER_INDEX_MASK 0x00400000 -#define BB_BBB_RX_CTRL_6_USE_BKPWR_FOR_CENTER_INDEX_GET(x) (((x) & 0x00400000) >> 22) -#define BB_BBB_RX_CTRL_6_USE_BKPWR_FOR_CENTER_INDEX_SET(x) (((x) << 22) & 0x00400000) -#define BB_BBB_RX_CTRL_6_CCK_SEL_CHAIN_BY_EO_MSB 23 -#define BB_BBB_RX_CTRL_6_CCK_SEL_CHAIN_BY_EO_LSB 23 -#define BB_BBB_RX_CTRL_6_CCK_SEL_CHAIN_BY_EO_MASK 0x00800000 -#define BB_BBB_RX_CTRL_6_CCK_SEL_CHAIN_BY_EO_GET(x) (((x) & 0x00800000) >> 23) -#define BB_BBB_RX_CTRL_6_CCK_SEL_CHAIN_BY_EO_SET(x) (((x) << 23) & 0x00800000) -#define BB_BBB_RX_CTRL_6_FORCE_CCK_SEL_CHAIN_MSB 24 -#define BB_BBB_RX_CTRL_6_FORCE_CCK_SEL_CHAIN_LSB 24 -#define BB_BBB_RX_CTRL_6_FORCE_CCK_SEL_CHAIN_MASK 0x01000000 -#define BB_BBB_RX_CTRL_6_FORCE_CCK_SEL_CHAIN_GET(x) (((x) & 0x01000000) >> 24) -#define BB_BBB_RX_CTRL_6_FORCE_CCK_SEL_CHAIN_SET(x) (((x) << 24) & 0x01000000) -#define BB_BBB_RX_CTRL_6_FORCE_CENTER_INDEX_MSB 25 -#define BB_BBB_RX_CTRL_6_FORCE_CENTER_INDEX_LSB 25 -#define BB_BBB_RX_CTRL_6_FORCE_CENTER_INDEX_MASK 0x02000000 -#define BB_BBB_RX_CTRL_6_FORCE_CENTER_INDEX_GET(x) (((x) & 0x02000000) >> 25) -#define BB_BBB_RX_CTRL_6_FORCE_CENTER_INDEX_SET(x) (((x) << 25) & 0x02000000) - -/* macros for bb_bbb_reg_map.BB_force_clken_cck */ -#define BB_FORCE_CLKEN_CCK_ADDRESS 0x00000018 -#define BB_FORCE_CLKEN_CCK_OFFSET 0x00000018 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE0_MSB 0 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE0_LSB 0 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE0_MASK 0x00000001 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE0_GET(x) (((x) & 0x00000001) >> 0) -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE0_SET(x) (((x) << 0) & 0x00000001) -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE1_MSB 1 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE1_LSB 1 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE1_MASK 0x00000002 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE1_GET(x) (((x) & 0x00000002) >> 1) -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE1_SET(x) (((x) << 1) & 0x00000002) -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE2_MSB 2 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE2_LSB 2 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE2_MASK 0x00000004 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE2_GET(x) (((x) & 0x00000004) >> 2) -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE2_SET(x) (((x) << 2) & 0x00000004) -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE3_MSB 3 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE3_LSB 3 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE3_MASK 0x00000008 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE3_GET(x) (((x) & 0x00000008) >> 3) -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ENABLE3_SET(x) (((x) << 3) & 0x00000008) -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ALWAYS_MSB 4 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ALWAYS_LSB 4 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ALWAYS_MASK 0x00000010 -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ALWAYS_GET(x) (((x) & 0x00000010) >> 4) -#define BB_FORCE_CLKEN_CCK_FORCE_RX_ALWAYS_SET(x) (((x) << 4) & 0x00000010) -#define BB_FORCE_CLKEN_CCK_FORCE_TXSM_CLKEN_MSB 5 -#define BB_FORCE_CLKEN_CCK_FORCE_TXSM_CLKEN_LSB 5 -#define BB_FORCE_CLKEN_CCK_FORCE_TXSM_CLKEN_MASK 0x00000020 -#define BB_FORCE_CLKEN_CCK_FORCE_TXSM_CLKEN_GET(x) (((x) & 0x00000020) >> 5) -#define BB_FORCE_CLKEN_CCK_FORCE_TXSM_CLKEN_SET(x) (((x) << 5) & 0x00000020) - -#ifndef __ASSEMBLER__ - -typedef struct bb_reg_reg_s_3 { - volatile unsigned int BB_bbb_rx_ctrl_1; /* 0x0 - 0x4 */ - volatile unsigned int BB_bbb_rx_ctrl_2; /* 0x4 - 0x8 */ - volatile unsigned int BB_bbb_rx_ctrl_3; /* 0x8 - 0xc */ - volatile unsigned int BB_bbb_rx_ctrl_4; /* 0xc - 0x10 */ - volatile unsigned int BB_bbb_rx_ctrl_5; /* 0x10 - 0x14 */ - volatile unsigned int BB_bbb_rx_ctrl_6; /* 0x14 - 0x18 */ - volatile unsigned int BB_force_clken_cck; /* 0x18 - 0x1c */ -} bb_reg_reg_t_3; - -#endif /* __ASSEMBLER__ */ - - -/* macros for bb_agc_reg_map.BB_settling_time */ -#define BB_SETTLING_TIME_ADDRESS 0x00000000 -#define BB_SETTLING_TIME_OFFSET 0x00000000 -#define BB_SETTLING_TIME_AGC_SETTLING_MSB 6 -#define BB_SETTLING_TIME_AGC_SETTLING_LSB 0 -#define BB_SETTLING_TIME_AGC_SETTLING_MASK 0x0000007f -#define BB_SETTLING_TIME_AGC_SETTLING_GET(x) (((x) & 0x0000007f) >> 0) -#define BB_SETTLING_TIME_AGC_SETTLING_SET(x) (((x) << 0) & 0x0000007f) -#define BB_SETTLING_TIME_SWITCH_SETTLING_MSB 13 -#define BB_SETTLING_TIME_SWITCH_SETTLING_LSB 7 -#define BB_SETTLING_TIME_SWITCH_SETTLING_MASK 0x00003f80 -#define BB_SETTLING_TIME_SWITCH_SETTLING_GET(x) (((x) & 0x00003f80) >> 7) -#define BB_SETTLING_TIME_SWITCH_SETTLING_SET(x) (((x) << 7) & 0x00003f80) -#define BB_SETTLING_TIME_ADCSAT_THRL_MSB 19 -#define BB_SETTLING_TIME_ADCSAT_THRL_LSB 14 -#define BB_SETTLING_TIME_ADCSAT_THRL_MASK 0x000fc000 -#define BB_SETTLING_TIME_ADCSAT_THRL_GET(x) (((x) & 0x000fc000) >> 14) -#define BB_SETTLING_TIME_ADCSAT_THRL_SET(x) (((x) << 14) & 0x000fc000) -#define BB_SETTLING_TIME_ADCSAT_THRH_MSB 25 -#define BB_SETTLING_TIME_ADCSAT_THRH_LSB 20 -#define BB_SETTLING_TIME_ADCSAT_THRH_MASK 0x03f00000 -#define BB_SETTLING_TIME_ADCSAT_THRH_GET(x) (((x) & 0x03f00000) >> 20) -#define BB_SETTLING_TIME_ADCSAT_THRH_SET(x) (((x) << 20) & 0x03f00000) -#define BB_SETTLING_TIME_LBRESET_ADVANCE_MSB 29 -#define BB_SETTLING_TIME_LBRESET_ADVANCE_LSB 26 -#define BB_SETTLING_TIME_LBRESET_ADVANCE_MASK 0x3c000000 -#define BB_SETTLING_TIME_LBRESET_ADVANCE_GET(x) (((x) & 0x3c000000) >> 26) -#define BB_SETTLING_TIME_LBRESET_ADVANCE_SET(x) (((x) << 26) & 0x3c000000) - -/* macros for bb_agc_reg_map.BB_gain_force_max_gains_b0 */ -#define BB_GAIN_FORCE_MAX_GAINS_B0_ADDRESS 0x00000004 -#define BB_GAIN_FORCE_MAX_GAINS_B0_OFFSET 0x00000004 -#define BB_GAIN_FORCE_MAX_GAINS_B0_RF_GAIN_F_0_MSB 7 -#define BB_GAIN_FORCE_MAX_GAINS_B0_RF_GAIN_F_0_LSB 0 -#define BB_GAIN_FORCE_MAX_GAINS_B0_RF_GAIN_F_0_MASK 0x000000ff -#define BB_GAIN_FORCE_MAX_GAINS_B0_RF_GAIN_F_0_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_GAIN_FORCE_MAX_GAINS_B0_RF_GAIN_F_0_SET(x) (((x) << 0) & 0x000000ff) -#define BB_GAIN_FORCE_MAX_GAINS_B0_MB_GAIN_F_0_MSB 15 -#define BB_GAIN_FORCE_MAX_GAINS_B0_MB_GAIN_F_0_LSB 8 -#define BB_GAIN_FORCE_MAX_GAINS_B0_MB_GAIN_F_0_MASK 0x0000ff00 -#define BB_GAIN_FORCE_MAX_GAINS_B0_MB_GAIN_F_0_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_GAIN_FORCE_MAX_GAINS_B0_MB_GAIN_F_0_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN1_SW_F_0_MSB 16 -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN1_SW_F_0_LSB 16 -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN1_SW_F_0_MASK 0x00010000 -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN1_SW_F_0_GET(x) (((x) & 0x00010000) >> 16) -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN1_SW_F_0_SET(x) (((x) << 16) & 0x00010000) -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN2_SW_F_0_MSB 17 -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN2_SW_F_0_LSB 17 -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN2_SW_F_0_MASK 0x00020000 -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN2_SW_F_0_GET(x) (((x) & 0x00020000) >> 17) -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN2_SW_F_0_SET(x) (((x) << 17) & 0x00020000) -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN1_HYST_MARGIN_0_MSB 24 -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN1_HYST_MARGIN_0_LSB 18 -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN1_HYST_MARGIN_0_MASK 0x01fc0000 -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN1_HYST_MARGIN_0_GET(x) (((x) & 0x01fc0000) >> 18) -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN1_HYST_MARGIN_0_SET(x) (((x) << 18) & 0x01fc0000) -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN2_HYST_MARGIN_0_MSB 31 -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN2_HYST_MARGIN_0_LSB 25 -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN2_HYST_MARGIN_0_MASK 0xfe000000 -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN2_HYST_MARGIN_0_GET(x) (((x) & 0xfe000000) >> 25) -#define BB_GAIN_FORCE_MAX_GAINS_B0_XATTEN2_HYST_MARGIN_0_SET(x) (((x) << 25) & 0xfe000000) - -/* macros for bb_agc_reg_map.BB_gains_min_offsets */ -#define BB_GAINS_MIN_OFFSETS_ADDRESS 0x00000008 -#define BB_GAINS_MIN_OFFSETS_OFFSET 0x00000008 -#define BB_GAINS_MIN_OFFSETS_OFFSETC1_MSB 6 -#define BB_GAINS_MIN_OFFSETS_OFFSETC1_LSB 0 -#define BB_GAINS_MIN_OFFSETS_OFFSETC1_MASK 0x0000007f -#define BB_GAINS_MIN_OFFSETS_OFFSETC1_GET(x) (((x) & 0x0000007f) >> 0) -#define BB_GAINS_MIN_OFFSETS_OFFSETC1_SET(x) (((x) << 0) & 0x0000007f) -#define BB_GAINS_MIN_OFFSETS_OFFSETC2_MSB 11 -#define BB_GAINS_MIN_OFFSETS_OFFSETC2_LSB 7 -#define BB_GAINS_MIN_OFFSETS_OFFSETC2_MASK 0x00000f80 -#define BB_GAINS_MIN_OFFSETS_OFFSETC2_GET(x) (((x) & 0x00000f80) >> 7) -#define BB_GAINS_MIN_OFFSETS_OFFSETC2_SET(x) (((x) << 7) & 0x00000f80) -#define BB_GAINS_MIN_OFFSETS_OFFSETC3_MSB 16 -#define BB_GAINS_MIN_OFFSETS_OFFSETC3_LSB 12 -#define BB_GAINS_MIN_OFFSETS_OFFSETC3_MASK 0x0001f000 -#define BB_GAINS_MIN_OFFSETS_OFFSETC3_GET(x) (((x) & 0x0001f000) >> 12) -#define BB_GAINS_MIN_OFFSETS_OFFSETC3_SET(x) (((x) << 12) & 0x0001f000) -#define BB_GAINS_MIN_OFFSETS_GAIN_FORCE_MSB 17 -#define BB_GAINS_MIN_OFFSETS_GAIN_FORCE_LSB 17 -#define BB_GAINS_MIN_OFFSETS_GAIN_FORCE_MASK 0x00020000 -#define BB_GAINS_MIN_OFFSETS_GAIN_FORCE_GET(x) (((x) & 0x00020000) >> 17) -#define BB_GAINS_MIN_OFFSETS_GAIN_FORCE_SET(x) (((x) << 17) & 0x00020000) -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_ENABLE_MSB 18 -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_ENABLE_LSB 18 -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_ENABLE_MASK 0x00040000 -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_ENABLE_GET(x) (((x) & 0x00040000) >> 18) -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_ENABLE_SET(x) (((x) << 18) & 0x00040000) -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_GC_MSB 19 -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_GC_LSB 19 -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_GC_MASK 0x00080000 -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_GC_GET(x) (((x) & 0x00080000) >> 19) -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_GC_SET(x) (((x) << 19) & 0x00080000) -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_VOTING_MSB 20 -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_VOTING_LSB 20 -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_VOTING_MASK 0x00100000 -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_VOTING_GET(x) (((x) & 0x00100000) >> 20) -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_VOTING_SET(x) (((x) << 20) & 0x00100000) -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_PHY_ERR_MSB 21 -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_PHY_ERR_LSB 21 -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_PHY_ERR_MASK 0x00200000 -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_PHY_ERR_GET(x) (((x) & 0x00200000) >> 21) -#define BB_GAINS_MIN_OFFSETS_CF_AGC_HIST_PHY_ERR_SET(x) (((x) << 21) & 0x00200000) - -/* macros for bb_agc_reg_map.BB_desired_sigsize */ -#define BB_DESIRED_SIGSIZE_ADDRESS 0x0000000c -#define BB_DESIRED_SIGSIZE_OFFSET 0x0000000c -#define BB_DESIRED_SIGSIZE_ADC_DESIRED_SIZE_MSB 7 -#define BB_DESIRED_SIGSIZE_ADC_DESIRED_SIZE_LSB 0 -#define BB_DESIRED_SIGSIZE_ADC_DESIRED_SIZE_MASK 0x000000ff -#define BB_DESIRED_SIGSIZE_ADC_DESIRED_SIZE_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_DESIRED_SIGSIZE_ADC_DESIRED_SIZE_SET(x) (((x) << 0) & 0x000000ff) -#define BB_DESIRED_SIGSIZE_TOTAL_DESIRED_MSB 27 -#define BB_DESIRED_SIGSIZE_TOTAL_DESIRED_LSB 20 -#define BB_DESIRED_SIGSIZE_TOTAL_DESIRED_MASK 0x0ff00000 -#define BB_DESIRED_SIGSIZE_TOTAL_DESIRED_GET(x) (((x) & 0x0ff00000) >> 20) -#define BB_DESIRED_SIGSIZE_TOTAL_DESIRED_SET(x) (((x) << 20) & 0x0ff00000) -#define BB_DESIRED_SIGSIZE_INIT_GC_COUNT_MAX_MSB 29 -#define BB_DESIRED_SIGSIZE_INIT_GC_COUNT_MAX_LSB 28 -#define BB_DESIRED_SIGSIZE_INIT_GC_COUNT_MAX_MASK 0x30000000 -#define BB_DESIRED_SIGSIZE_INIT_GC_COUNT_MAX_GET(x) (((x) & 0x30000000) >> 28) -#define BB_DESIRED_SIGSIZE_INIT_GC_COUNT_MAX_SET(x) (((x) << 28) & 0x30000000) -#define BB_DESIRED_SIGSIZE_REDUCE_INIT_GC_COUNT_MSB 30 -#define BB_DESIRED_SIGSIZE_REDUCE_INIT_GC_COUNT_LSB 30 -#define BB_DESIRED_SIGSIZE_REDUCE_INIT_GC_COUNT_MASK 0x40000000 -#define BB_DESIRED_SIGSIZE_REDUCE_INIT_GC_COUNT_GET(x) (((x) & 0x40000000) >> 30) -#define BB_DESIRED_SIGSIZE_REDUCE_INIT_GC_COUNT_SET(x) (((x) << 30) & 0x40000000) -#define BB_DESIRED_SIGSIZE_ENA_INIT_GAIN_MSB 31 -#define BB_DESIRED_SIGSIZE_ENA_INIT_GAIN_LSB 31 -#define BB_DESIRED_SIGSIZE_ENA_INIT_GAIN_MASK 0x80000000 -#define BB_DESIRED_SIGSIZE_ENA_INIT_GAIN_GET(x) (((x) & 0x80000000) >> 31) -#define BB_DESIRED_SIGSIZE_ENA_INIT_GAIN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_agc_reg_map.BB_find_signal */ -#define BB_FIND_SIGNAL_ADDRESS 0x00000010 -#define BB_FIND_SIGNAL_OFFSET 0x00000010 -#define BB_FIND_SIGNAL_RELSTEP_MSB 5 -#define BB_FIND_SIGNAL_RELSTEP_LSB 0 -#define BB_FIND_SIGNAL_RELSTEP_MASK 0x0000003f -#define BB_FIND_SIGNAL_RELSTEP_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_FIND_SIGNAL_RELSTEP_SET(x) (((x) << 0) & 0x0000003f) -#define BB_FIND_SIGNAL_RELPWR_MSB 11 -#define BB_FIND_SIGNAL_RELPWR_LSB 6 -#define BB_FIND_SIGNAL_RELPWR_MASK 0x00000fc0 -#define BB_FIND_SIGNAL_RELPWR_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_FIND_SIGNAL_RELPWR_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_FIND_SIGNAL_FIRSTEP_MSB 17 -#define BB_FIND_SIGNAL_FIRSTEP_LSB 12 -#define BB_FIND_SIGNAL_FIRSTEP_MASK 0x0003f000 -#define BB_FIND_SIGNAL_FIRSTEP_GET(x) (((x) & 0x0003f000) >> 12) -#define BB_FIND_SIGNAL_FIRSTEP_SET(x) (((x) << 12) & 0x0003f000) -#define BB_FIND_SIGNAL_FIRPWR_MSB 25 -#define BB_FIND_SIGNAL_FIRPWR_LSB 18 -#define BB_FIND_SIGNAL_FIRPWR_MASK 0x03fc0000 -#define BB_FIND_SIGNAL_FIRPWR_GET(x) (((x) & 0x03fc0000) >> 18) -#define BB_FIND_SIGNAL_FIRPWR_SET(x) (((x) << 18) & 0x03fc0000) -#define BB_FIND_SIGNAL_M1COUNT_MAX_MSB 31 -#define BB_FIND_SIGNAL_M1COUNT_MAX_LSB 26 -#define BB_FIND_SIGNAL_M1COUNT_MAX_MASK 0xfc000000 -#define BB_FIND_SIGNAL_M1COUNT_MAX_GET(x) (((x) & 0xfc000000) >> 26) -#define BB_FIND_SIGNAL_M1COUNT_MAX_SET(x) (((x) << 26) & 0xfc000000) - -/* macros for bb_agc_reg_map.BB_agc */ -#define BB_AGC_ADDRESS 0x00000014 -#define BB_AGC_OFFSET 0x00000014 -#define BB_AGC_COARSEPWR_CONST_MSB 6 -#define BB_AGC_COARSEPWR_CONST_LSB 0 -#define BB_AGC_COARSEPWR_CONST_MASK 0x0000007f -#define BB_AGC_COARSEPWR_CONST_GET(x) (((x) & 0x0000007f) >> 0) -#define BB_AGC_COARSEPWR_CONST_SET(x) (((x) << 0) & 0x0000007f) -#define BB_AGC_COARSE_LOW_MSB 14 -#define BB_AGC_COARSE_LOW_LSB 7 -#define BB_AGC_COARSE_LOW_MASK 0x00007f80 -#define BB_AGC_COARSE_LOW_GET(x) (((x) & 0x00007f80) >> 7) -#define BB_AGC_COARSE_LOW_SET(x) (((x) << 7) & 0x00007f80) -#define BB_AGC_COARSE_HIGH_MSB 21 -#define BB_AGC_COARSE_HIGH_LSB 15 -#define BB_AGC_COARSE_HIGH_MASK 0x003f8000 -#define BB_AGC_COARSE_HIGH_GET(x) (((x) & 0x003f8000) >> 15) -#define BB_AGC_COARSE_HIGH_SET(x) (((x) << 15) & 0x003f8000) -#define BB_AGC_QUICK_DROP_MSB 29 -#define BB_AGC_QUICK_DROP_LSB 22 -#define BB_AGC_QUICK_DROP_MASK 0x3fc00000 -#define BB_AGC_QUICK_DROP_GET(x) (((x) & 0x3fc00000) >> 22) -#define BB_AGC_QUICK_DROP_SET(x) (((x) << 22) & 0x3fc00000) -#define BB_AGC_RSSI_OUT_SELECT_MSB 31 -#define BB_AGC_RSSI_OUT_SELECT_LSB 30 -#define BB_AGC_RSSI_OUT_SELECT_MASK 0xc0000000 -#define BB_AGC_RSSI_OUT_SELECT_GET(x) (((x) & 0xc0000000) >> 30) -#define BB_AGC_RSSI_OUT_SELECT_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for bb_agc_reg_map.BB_ext_atten_switch_ctl_b0 */ -#define BB_EXT_ATTEN_SWITCH_CTL_B0_ADDRESS 0x00000018 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_OFFSET 0x00000018 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_DB_0_MSB 5 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_DB_0_LSB 0 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_DB_0_MASK 0x0000003f -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_DB_0_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_DB_0_SET(x) (((x) << 0) & 0x0000003f) -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_DB_0_MSB 11 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_DB_0_LSB 6 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_DB_0_MASK 0x00000fc0 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_DB_0_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_DB_0_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_MARGIN_0_MSB 16 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_MARGIN_0_LSB 12 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_MARGIN_0_MASK 0x0001f000 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_MARGIN_0_GET(x) (((x) & 0x0001f000) >> 12) -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN1_MARGIN_0_SET(x) (((x) << 12) & 0x0001f000) -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_MARGIN_0_MSB 21 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_MARGIN_0_LSB 17 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_MARGIN_0_MASK 0x003e0000 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_MARGIN_0_GET(x) (((x) & 0x003e0000) >> 17) -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XATTEN2_MARGIN_0_SET(x) (((x) << 17) & 0x003e0000) -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XLNA_GAIN_DB_0_MSB 26 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XLNA_GAIN_DB_0_LSB 22 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XLNA_GAIN_DB_0_MASK 0x07c00000 -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XLNA_GAIN_DB_0_GET(x) (((x) & 0x07c00000) >> 22) -#define BB_EXT_ATTEN_SWITCH_CTL_B0_XLNA_GAIN_DB_0_SET(x) (((x) << 22) & 0x07c00000) - -/* macros for bb_agc_reg_map.BB_cca_b0 */ -#define BB_CCA_B0_ADDRESS 0x0000001c -#define BB_CCA_B0_OFFSET 0x0000001c -#define BB_CCA_B0_CF_MAXCCAPWR_0_MSB 8 -#define BB_CCA_B0_CF_MAXCCAPWR_0_LSB 0 -#define BB_CCA_B0_CF_MAXCCAPWR_0_MASK 0x000001ff -#define BB_CCA_B0_CF_MAXCCAPWR_0_GET(x) (((x) & 0x000001ff) >> 0) -#define BB_CCA_B0_CF_MAXCCAPWR_0_SET(x) (((x) << 0) & 0x000001ff) -#define BB_CCA_B0_CF_CCA_COUNT_MAXC_MSB 11 -#define BB_CCA_B0_CF_CCA_COUNT_MAXC_LSB 9 -#define BB_CCA_B0_CF_CCA_COUNT_MAXC_MASK 0x00000e00 -#define BB_CCA_B0_CF_CCA_COUNT_MAXC_GET(x) (((x) & 0x00000e00) >> 9) -#define BB_CCA_B0_CF_CCA_COUNT_MAXC_SET(x) (((x) << 9) & 0x00000e00) -#define BB_CCA_B0_CF_THRESH62_MSB 19 -#define BB_CCA_B0_CF_THRESH62_LSB 12 -#define BB_CCA_B0_CF_THRESH62_MASK 0x000ff000 -#define BB_CCA_B0_CF_THRESH62_GET(x) (((x) & 0x000ff000) >> 12) -#define BB_CCA_B0_CF_THRESH62_SET(x) (((x) << 12) & 0x000ff000) -#define BB_CCA_B0_MINCCAPWR_0_MSB 28 -#define BB_CCA_B0_MINCCAPWR_0_LSB 20 -#define BB_CCA_B0_MINCCAPWR_0_MASK 0x1ff00000 -#define BB_CCA_B0_MINCCAPWR_0_GET(x) (((x) & 0x1ff00000) >> 20) - -/* macros for bb_agc_reg_map.BB_cca_ctrl_2_b0 */ -#define BB_CCA_CTRL_2_B0_ADDRESS 0x00000020 -#define BB_CCA_CTRL_2_B0_OFFSET 0x00000020 -#define BB_CCA_CTRL_2_B0_MINCCAPWR_THR_0_MSB 8 -#define BB_CCA_CTRL_2_B0_MINCCAPWR_THR_0_LSB 0 -#define BB_CCA_CTRL_2_B0_MINCCAPWR_THR_0_MASK 0x000001ff -#define BB_CCA_CTRL_2_B0_MINCCAPWR_THR_0_GET(x) (((x) & 0x000001ff) >> 0) -#define BB_CCA_CTRL_2_B0_MINCCAPWR_THR_0_SET(x) (((x) << 0) & 0x000001ff) -#define BB_CCA_CTRL_2_B0_ENABLE_MINCCAPWR_THR_MSB 9 -#define BB_CCA_CTRL_2_B0_ENABLE_MINCCAPWR_THR_LSB 9 -#define BB_CCA_CTRL_2_B0_ENABLE_MINCCAPWR_THR_MASK 0x00000200 -#define BB_CCA_CTRL_2_B0_ENABLE_MINCCAPWR_THR_GET(x) (((x) & 0x00000200) >> 9) -#define BB_CCA_CTRL_2_B0_ENABLE_MINCCAPWR_THR_SET(x) (((x) << 9) & 0x00000200) -#define BB_CCA_CTRL_2_B0_NF_GAIN_COMP_0_MSB 17 -#define BB_CCA_CTRL_2_B0_NF_GAIN_COMP_0_LSB 10 -#define BB_CCA_CTRL_2_B0_NF_GAIN_COMP_0_MASK 0x0003fc00 -#define BB_CCA_CTRL_2_B0_NF_GAIN_COMP_0_GET(x) (((x) & 0x0003fc00) >> 10) -#define BB_CCA_CTRL_2_B0_NF_GAIN_COMP_0_SET(x) (((x) << 10) & 0x0003fc00) -#define BB_CCA_CTRL_2_B0_THRESH62_MODE_MSB 18 -#define BB_CCA_CTRL_2_B0_THRESH62_MODE_LSB 18 -#define BB_CCA_CTRL_2_B0_THRESH62_MODE_MASK 0x00040000 -#define BB_CCA_CTRL_2_B0_THRESH62_MODE_GET(x) (((x) & 0x00040000) >> 18) -#define BB_CCA_CTRL_2_B0_THRESH62_MODE_SET(x) (((x) << 18) & 0x00040000) - -/* macros for bb_agc_reg_map.BB_restart */ -#define BB_RESTART_ADDRESS 0x00000024 -#define BB_RESTART_OFFSET 0x00000024 -#define BB_RESTART_ENABLE_RESTART_MSB 0 -#define BB_RESTART_ENABLE_RESTART_LSB 0 -#define BB_RESTART_ENABLE_RESTART_MASK 0x00000001 -#define BB_RESTART_ENABLE_RESTART_GET(x) (((x) & 0x00000001) >> 0) -#define BB_RESTART_ENABLE_RESTART_SET(x) (((x) << 0) & 0x00000001) -#define BB_RESTART_RESTART_LGFIRPWR_DELTA_MSB 5 -#define BB_RESTART_RESTART_LGFIRPWR_DELTA_LSB 1 -#define BB_RESTART_RESTART_LGFIRPWR_DELTA_MASK 0x0000003e -#define BB_RESTART_RESTART_LGFIRPWR_DELTA_GET(x) (((x) & 0x0000003e) >> 1) -#define BB_RESTART_RESTART_LGFIRPWR_DELTA_SET(x) (((x) << 1) & 0x0000003e) -#define BB_RESTART_ENABLE_PWR_DROP_ERR_MSB 6 -#define BB_RESTART_ENABLE_PWR_DROP_ERR_LSB 6 -#define BB_RESTART_ENABLE_PWR_DROP_ERR_MASK 0x00000040 -#define BB_RESTART_ENABLE_PWR_DROP_ERR_GET(x) (((x) & 0x00000040) >> 6) -#define BB_RESTART_ENABLE_PWR_DROP_ERR_SET(x) (((x) << 6) & 0x00000040) -#define BB_RESTART_PWRDROP_LGFIRPWR_DELTA_MSB 11 -#define BB_RESTART_PWRDROP_LGFIRPWR_DELTA_LSB 7 -#define BB_RESTART_PWRDROP_LGFIRPWR_DELTA_MASK 0x00000f80 -#define BB_RESTART_PWRDROP_LGFIRPWR_DELTA_GET(x) (((x) & 0x00000f80) >> 7) -#define BB_RESTART_PWRDROP_LGFIRPWR_DELTA_SET(x) (((x) << 7) & 0x00000f80) -#define BB_RESTART_OFDM_CCK_RSSI_BIAS_MSB 17 -#define BB_RESTART_OFDM_CCK_RSSI_BIAS_LSB 12 -#define BB_RESTART_OFDM_CCK_RSSI_BIAS_MASK 0x0003f000 -#define BB_RESTART_OFDM_CCK_RSSI_BIAS_GET(x) (((x) & 0x0003f000) >> 12) -#define BB_RESTART_OFDM_CCK_RSSI_BIAS_SET(x) (((x) << 12) & 0x0003f000) -#define BB_RESTART_ANT_FAST_DIV_GC_LIMIT_MSB 20 -#define BB_RESTART_ANT_FAST_DIV_GC_LIMIT_LSB 18 -#define BB_RESTART_ANT_FAST_DIV_GC_LIMIT_MASK 0x001c0000 -#define BB_RESTART_ANT_FAST_DIV_GC_LIMIT_GET(x) (((x) & 0x001c0000) >> 18) -#define BB_RESTART_ANT_FAST_DIV_GC_LIMIT_SET(x) (((x) << 18) & 0x001c0000) -#define BB_RESTART_ENABLE_ANT_FAST_DIV_M2FLAG_MSB 21 -#define BB_RESTART_ENABLE_ANT_FAST_DIV_M2FLAG_LSB 21 -#define BB_RESTART_ENABLE_ANT_FAST_DIV_M2FLAG_MASK 0x00200000 -#define BB_RESTART_ENABLE_ANT_FAST_DIV_M2FLAG_GET(x) (((x) & 0x00200000) >> 21) -#define BB_RESTART_ENABLE_ANT_FAST_DIV_M2FLAG_SET(x) (((x) << 21) & 0x00200000) -#define BB_RESTART_WEAK_RSSI_VOTE_THR_MSB 28 -#define BB_RESTART_WEAK_RSSI_VOTE_THR_LSB 22 -#define BB_RESTART_WEAK_RSSI_VOTE_THR_MASK 0x1fc00000 -#define BB_RESTART_WEAK_RSSI_VOTE_THR_GET(x) (((x) & 0x1fc00000) >> 22) -#define BB_RESTART_WEAK_RSSI_VOTE_THR_SET(x) (((x) << 22) & 0x1fc00000) -#define BB_RESTART_ENABLE_PWR_DROP_ERR_CCK_MSB 29 -#define BB_RESTART_ENABLE_PWR_DROP_ERR_CCK_LSB 29 -#define BB_RESTART_ENABLE_PWR_DROP_ERR_CCK_MASK 0x20000000 -#define BB_RESTART_ENABLE_PWR_DROP_ERR_CCK_GET(x) (((x) & 0x20000000) >> 29) -#define BB_RESTART_ENABLE_PWR_DROP_ERR_CCK_SET(x) (((x) << 29) & 0x20000000) -#define BB_RESTART_DISABLE_DC_RESTART_MSB 30 -#define BB_RESTART_DISABLE_DC_RESTART_LSB 30 -#define BB_RESTART_DISABLE_DC_RESTART_MASK 0x40000000 -#define BB_RESTART_DISABLE_DC_RESTART_GET(x) (((x) & 0x40000000) >> 30) -#define BB_RESTART_DISABLE_DC_RESTART_SET(x) (((x) << 30) & 0x40000000) -#define BB_RESTART_RESTART_MODE_BW40_MSB 31 -#define BB_RESTART_RESTART_MODE_BW40_LSB 31 -#define BB_RESTART_RESTART_MODE_BW40_MASK 0x80000000 -#define BB_RESTART_RESTART_MODE_BW40_GET(x) (((x) & 0x80000000) >> 31) -#define BB_RESTART_RESTART_MODE_BW40_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_agc_reg_map.BB_multichain_gain_ctrl */ -#define BB_MULTICHAIN_GAIN_CTRL_ADDRESS 0x00000028 -#define BB_MULTICHAIN_GAIN_CTRL_OFFSET 0x00000028 -#define BB_MULTICHAIN_GAIN_CTRL_QUICKDROP_LOW_MSB 7 -#define BB_MULTICHAIN_GAIN_CTRL_QUICKDROP_LOW_LSB 0 -#define BB_MULTICHAIN_GAIN_CTRL_QUICKDROP_LOW_MASK 0x000000ff -#define BB_MULTICHAIN_GAIN_CTRL_QUICKDROP_LOW_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_MULTICHAIN_GAIN_CTRL_QUICKDROP_LOW_SET(x) (((x) << 0) & 0x000000ff) -#define BB_MULTICHAIN_GAIN_CTRL_ENABLE_CHECK_STRONG_ANT_MSB 8 -#define BB_MULTICHAIN_GAIN_CTRL_ENABLE_CHECK_STRONG_ANT_LSB 8 -#define BB_MULTICHAIN_GAIN_CTRL_ENABLE_CHECK_STRONG_ANT_MASK 0x00000100 -#define BB_MULTICHAIN_GAIN_CTRL_ENABLE_CHECK_STRONG_ANT_GET(x) (((x) & 0x00000100) >> 8) -#define BB_MULTICHAIN_GAIN_CTRL_ENABLE_CHECK_STRONG_ANT_SET(x) (((x) << 8) & 0x00000100) -#define BB_MULTICHAIN_GAIN_CTRL_ANT_FAST_DIV_BIAS_MSB 14 -#define BB_MULTICHAIN_GAIN_CTRL_ANT_FAST_DIV_BIAS_LSB 9 -#define BB_MULTICHAIN_GAIN_CTRL_ANT_FAST_DIV_BIAS_MASK 0x00007e00 -#define BB_MULTICHAIN_GAIN_CTRL_ANT_FAST_DIV_BIAS_GET(x) (((x) & 0x00007e00) >> 9) -#define BB_MULTICHAIN_GAIN_CTRL_ANT_FAST_DIV_BIAS_SET(x) (((x) << 9) & 0x00007e00) -#define BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_SNR_MSB 20 -#define BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_SNR_LSB 15 -#define BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_SNR_MASK 0x001f8000 -#define BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_SNR_GET(x) (((x) & 0x001f8000) >> 15) -#define BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_SNR_SET(x) (((x) << 15) & 0x001f8000) -#define BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_ENA_MSB 21 -#define BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_ENA_LSB 21 -#define BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_ENA_MASK 0x00200000 -#define BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_ENA_GET(x) (((x) & 0x00200000) >> 21) -#define BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_ENA_SET(x) (((x) << 21) & 0x00200000) -#define BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_MODE_MSB 22 -#define BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_MODE_LSB 22 -#define BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_MODE_MASK 0x00400000 -#define BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_MODE_GET(x) (((x) & 0x00400000) >> 22) -#define BB_MULTICHAIN_GAIN_CTRL_CAP_GAIN_RATIO_MODE_SET(x) (((x) << 22) & 0x00400000) -#define BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_SW_RX_PROT_MSB 23 -#define BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_SW_RX_PROT_LSB 23 -#define BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_SW_RX_PROT_MASK 0x00800000 -#define BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_SW_RX_PROT_GET(x) (((x) & 0x00800000) >> 23) -#define BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_SW_RX_PROT_SET(x) (((x) << 23) & 0x00800000) -#define BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_DIV_LNADIV_MSB 24 -#define BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_DIV_LNADIV_LSB 24 -#define BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_DIV_LNADIV_MASK 0x01000000 -#define BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_DIV_LNADIV_GET(x) (((x) & 0x01000000) >> 24) -#define BB_MULTICHAIN_GAIN_CTRL_ENABLE_ANT_DIV_LNADIV_SET(x) (((x) << 24) & 0x01000000) -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_LNACONF_MSB 26 -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_LNACONF_LSB 25 -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_LNACONF_MASK 0x06000000 -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_LNACONF_GET(x) (((x) & 0x06000000) >> 25) -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_LNACONF_SET(x) (((x) << 25) & 0x06000000) -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_LNACONF_MSB 28 -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_LNACONF_LSB 27 -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_LNACONF_MASK 0x18000000 -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_LNACONF_GET(x) (((x) & 0x18000000) >> 27) -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_LNACONF_SET(x) (((x) << 27) & 0x18000000) -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_GAINTB_MSB 29 -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_GAINTB_LSB 29 -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_GAINTB_MASK 0x20000000 -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_GAINTB_GET(x) (((x) & 0x20000000) >> 29) -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_ALT_GAINTB_SET(x) (((x) << 29) & 0x20000000) -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_GAINTB_MSB 30 -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_GAINTB_LSB 30 -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_GAINTB_MASK 0x40000000 -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_GAINTB_GET(x) (((x) & 0x40000000) >> 30) -#define BB_MULTICHAIN_GAIN_CTRL_ANT_DIV_MAIN_GAINTB_SET(x) (((x) << 30) & 0x40000000) - -/* macros for bb_agc_reg_map.BB_ext_chan_pwr_thr_1 */ -#define BB_EXT_CHAN_PWR_THR_1_ADDRESS 0x0000002c -#define BB_EXT_CHAN_PWR_THR_1_OFFSET 0x0000002c -#define BB_EXT_CHAN_PWR_THR_1_THRESH62_EXT_MSB 7 -#define BB_EXT_CHAN_PWR_THR_1_THRESH62_EXT_LSB 0 -#define BB_EXT_CHAN_PWR_THR_1_THRESH62_EXT_MASK 0x000000ff -#define BB_EXT_CHAN_PWR_THR_1_THRESH62_EXT_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_EXT_CHAN_PWR_THR_1_THRESH62_EXT_SET(x) (((x) << 0) & 0x000000ff) -#define BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_MINGAINIDX_MSB 15 -#define BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_MINGAINIDX_LSB 8 -#define BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_MINGAINIDX_MASK 0x0000ff00 -#define BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_MINGAINIDX_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_MINGAINIDX_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTAGAINIDX_MSB 20 -#define BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTAGAINIDX_LSB 16 -#define BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTAGAINIDX_MASK 0x001f0000 -#define BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTAGAINIDX_GET(x) (((x) & 0x001f0000) >> 16) -#define BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTAGAINIDX_SET(x) (((x) << 16) & 0x001f0000) -#define BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTANF_MSB 26 -#define BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTANF_LSB 21 -#define BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTANF_MASK 0x07e00000 -#define BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTANF_GET(x) (((x) & 0x07e00000) >> 21) -#define BB_EXT_CHAN_PWR_THR_1_ANT_DIV_ALT_ANT_DELTANF_SET(x) (((x) << 21) & 0x07e00000) - -/* macros for bb_agc_reg_map.BB_ext_chan_detect_win */ -#define BB_EXT_CHAN_DETECT_WIN_ADDRESS 0x00000030 -#define BB_EXT_CHAN_DETECT_WIN_OFFSET 0x00000030 -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_MSB 3 -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_LSB 0 -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_MASK 0x0000000f -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_GET(x) (((x) & 0x0000000f) >> 0) -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_SET(x) (((x) << 0) & 0x0000000f) -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_LOW_MSB 7 -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_LOW_LSB 4 -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_LOW_MASK 0x000000f0 -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_LOW_GET(x) (((x) & 0x000000f0) >> 4) -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_LOW_SET(x) (((x) << 4) & 0x000000f0) -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_CCK_MSB 12 -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_CCK_LSB 8 -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_CCK_MASK 0x00001f00 -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_CCK_GET(x) (((x) & 0x00001f00) >> 8) -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_WEAK_CCK_SET(x) (((x) << 8) & 0x00001f00) -#define BB_EXT_CHAN_DETECT_WIN_DET_20H_COUNT_MSB 15 -#define BB_EXT_CHAN_DETECT_WIN_DET_20H_COUNT_LSB 13 -#define BB_EXT_CHAN_DETECT_WIN_DET_20H_COUNT_MASK 0x0000e000 -#define BB_EXT_CHAN_DETECT_WIN_DET_20H_COUNT_GET(x) (((x) & 0x0000e000) >> 13) -#define BB_EXT_CHAN_DETECT_WIN_DET_20H_COUNT_SET(x) (((x) << 13) & 0x0000e000) -#define BB_EXT_CHAN_DETECT_WIN_DET_EXT_BLK_COUNT_MSB 18 -#define BB_EXT_CHAN_DETECT_WIN_DET_EXT_BLK_COUNT_LSB 16 -#define BB_EXT_CHAN_DETECT_WIN_DET_EXT_BLK_COUNT_MASK 0x00070000 -#define BB_EXT_CHAN_DETECT_WIN_DET_EXT_BLK_COUNT_GET(x) (((x) & 0x00070000) >> 16) -#define BB_EXT_CHAN_DETECT_WIN_DET_EXT_BLK_COUNT_SET(x) (((x) << 16) & 0x00070000) -#define BB_EXT_CHAN_DETECT_WIN_WEAK_SIG_THR_CCK_EXT_MSB 24 -#define BB_EXT_CHAN_DETECT_WIN_WEAK_SIG_THR_CCK_EXT_LSB 19 -#define BB_EXT_CHAN_DETECT_WIN_WEAK_SIG_THR_CCK_EXT_MASK 0x01f80000 -#define BB_EXT_CHAN_DETECT_WIN_WEAK_SIG_THR_CCK_EXT_GET(x) (((x) & 0x01f80000) >> 19) -#define BB_EXT_CHAN_DETECT_WIN_WEAK_SIG_THR_CCK_EXT_SET(x) (((x) << 19) & 0x01f80000) -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_THRESH_MSB 28 -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_THRESH_LSB 25 -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_THRESH_MASK 0x1e000000 -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_THRESH_GET(x) (((x) & 0x1e000000) >> 25) -#define BB_EXT_CHAN_DETECT_WIN_DET_DIFF_WIN_THRESH_SET(x) (((x) << 25) & 0x1e000000) - -/* macros for bb_agc_reg_map.BB_pwr_thr_20_40_det */ -#define BB_PWR_THR_20_40_DET_ADDRESS 0x00000034 -#define BB_PWR_THR_20_40_DET_OFFSET 0x00000034 -#define BB_PWR_THR_20_40_DET_PWRDIFF40_THRSTR_MSB 4 -#define BB_PWR_THR_20_40_DET_PWRDIFF40_THRSTR_LSB 0 -#define BB_PWR_THR_20_40_DET_PWRDIFF40_THRSTR_MASK 0x0000001f -#define BB_PWR_THR_20_40_DET_PWRDIFF40_THRSTR_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_PWR_THR_20_40_DET_PWRDIFF40_THRSTR_SET(x) (((x) << 0) & 0x0000001f) -#define BB_PWR_THR_20_40_DET_BLOCKER40_MAX_MSB 10 -#define BB_PWR_THR_20_40_DET_BLOCKER40_MAX_LSB 5 -#define BB_PWR_THR_20_40_DET_BLOCKER40_MAX_MASK 0x000007e0 -#define BB_PWR_THR_20_40_DET_BLOCKER40_MAX_GET(x) (((x) & 0x000007e0) >> 5) -#define BB_PWR_THR_20_40_DET_BLOCKER40_MAX_SET(x) (((x) << 5) & 0x000007e0) -#define BB_PWR_THR_20_40_DET_DET40_PWRSTEP_MAX_MSB 15 -#define BB_PWR_THR_20_40_DET_DET40_PWRSTEP_MAX_LSB 11 -#define BB_PWR_THR_20_40_DET_DET40_PWRSTEP_MAX_MASK 0x0000f800 -#define BB_PWR_THR_20_40_DET_DET40_PWRSTEP_MAX_GET(x) (((x) & 0x0000f800) >> 11) -#define BB_PWR_THR_20_40_DET_DET40_PWRSTEP_MAX_SET(x) (((x) << 11) & 0x0000f800) -#define BB_PWR_THR_20_40_DET_DET40_THR_SNR_MSB 23 -#define BB_PWR_THR_20_40_DET_DET40_THR_SNR_LSB 16 -#define BB_PWR_THR_20_40_DET_DET40_THR_SNR_MASK 0x00ff0000 -#define BB_PWR_THR_20_40_DET_DET40_THR_SNR_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_PWR_THR_20_40_DET_DET40_THR_SNR_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_PWR_THR_20_40_DET_DET40_PRI_BIAS_MSB 28 -#define BB_PWR_THR_20_40_DET_DET40_PRI_BIAS_LSB 24 -#define BB_PWR_THR_20_40_DET_DET40_PRI_BIAS_MASK 0x1f000000 -#define BB_PWR_THR_20_40_DET_DET40_PRI_BIAS_GET(x) (((x) & 0x1f000000) >> 24) -#define BB_PWR_THR_20_40_DET_DET40_PRI_BIAS_SET(x) (((x) << 24) & 0x1f000000) -#define BB_PWR_THR_20_40_DET_PWRSTEP40_ENA_MSB 29 -#define BB_PWR_THR_20_40_DET_PWRSTEP40_ENA_LSB 29 -#define BB_PWR_THR_20_40_DET_PWRSTEP40_ENA_MASK 0x20000000 -#define BB_PWR_THR_20_40_DET_PWRSTEP40_ENA_GET(x) (((x) & 0x20000000) >> 29) -#define BB_PWR_THR_20_40_DET_PWRSTEP40_ENA_SET(x) (((x) << 29) & 0x20000000) -#define BB_PWR_THR_20_40_DET_LOWSNR40_ENA_MSB 30 -#define BB_PWR_THR_20_40_DET_LOWSNR40_ENA_LSB 30 -#define BB_PWR_THR_20_40_DET_LOWSNR40_ENA_MASK 0x40000000 -#define BB_PWR_THR_20_40_DET_LOWSNR40_ENA_GET(x) (((x) & 0x40000000) >> 30) -#define BB_PWR_THR_20_40_DET_LOWSNR40_ENA_SET(x) (((x) << 30) & 0x40000000) - -/* macros for bb_agc_reg_map.BB_rifs_srch */ -#define BB_RIFS_SRCH_ADDRESS 0x00000038 -#define BB_RIFS_SRCH_OFFSET 0x00000038 -#define BB_RIFS_SRCH_INIT_GAIN_DB_OFFSET_MSB 15 -#define BB_RIFS_SRCH_INIT_GAIN_DB_OFFSET_LSB 8 -#define BB_RIFS_SRCH_INIT_GAIN_DB_OFFSET_MASK 0x0000ff00 -#define BB_RIFS_SRCH_INIT_GAIN_DB_OFFSET_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_RIFS_SRCH_INIT_GAIN_DB_OFFSET_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_RIFS_SRCH_RIFS_INIT_DELAY_MSB 25 -#define BB_RIFS_SRCH_RIFS_INIT_DELAY_LSB 16 -#define BB_RIFS_SRCH_RIFS_INIT_DELAY_MASK 0x03ff0000 -#define BB_RIFS_SRCH_RIFS_INIT_DELAY_GET(x) (((x) & 0x03ff0000) >> 16) -#define BB_RIFS_SRCH_RIFS_INIT_DELAY_SET(x) (((x) << 16) & 0x03ff0000) -#define BB_RIFS_SRCH_RIFS_DISABLE_PWRLOW_GC_MSB 26 -#define BB_RIFS_SRCH_RIFS_DISABLE_PWRLOW_GC_LSB 26 -#define BB_RIFS_SRCH_RIFS_DISABLE_PWRLOW_GC_MASK 0x04000000 -#define BB_RIFS_SRCH_RIFS_DISABLE_PWRLOW_GC_GET(x) (((x) & 0x04000000) >> 26) -#define BB_RIFS_SRCH_RIFS_DISABLE_PWRLOW_GC_SET(x) (((x) << 26) & 0x04000000) -#define BB_RIFS_SRCH_RIFS_DISABLE_CCK_DET_MSB 27 -#define BB_RIFS_SRCH_RIFS_DISABLE_CCK_DET_LSB 27 -#define BB_RIFS_SRCH_RIFS_DISABLE_CCK_DET_MASK 0x08000000 -#define BB_RIFS_SRCH_RIFS_DISABLE_CCK_DET_GET(x) (((x) & 0x08000000) >> 27) -#define BB_RIFS_SRCH_RIFS_DISABLE_CCK_DET_SET(x) (((x) << 27) & 0x08000000) - -/* macros for bb_agc_reg_map.BB_peak_det_ctrl_1 */ -#define BB_PEAK_DET_CTRL_1_ADDRESS 0x0000003c -#define BB_PEAK_DET_CTRL_1_OFFSET 0x0000003c -#define BB_PEAK_DET_CTRL_1_USE_OC_GAIN_TABLE_MSB 0 -#define BB_PEAK_DET_CTRL_1_USE_OC_GAIN_TABLE_LSB 0 -#define BB_PEAK_DET_CTRL_1_USE_OC_GAIN_TABLE_MASK 0x00000001 -#define BB_PEAK_DET_CTRL_1_USE_OC_GAIN_TABLE_GET(x) (((x) & 0x00000001) >> 0) -#define BB_PEAK_DET_CTRL_1_USE_OC_GAIN_TABLE_SET(x) (((x) << 0) & 0x00000001) -#define BB_PEAK_DET_CTRL_1_USE_PEAK_DET_MSB 1 -#define BB_PEAK_DET_CTRL_1_USE_PEAK_DET_LSB 1 -#define BB_PEAK_DET_CTRL_1_USE_PEAK_DET_MASK 0x00000002 -#define BB_PEAK_DET_CTRL_1_USE_PEAK_DET_GET(x) (((x) & 0x00000002) >> 1) -#define BB_PEAK_DET_CTRL_1_USE_PEAK_DET_SET(x) (((x) << 1) & 0x00000002) -#define BB_PEAK_DET_CTRL_1_PEAK_DET_WIN_LEN_MSB 7 -#define BB_PEAK_DET_CTRL_1_PEAK_DET_WIN_LEN_LSB 2 -#define BB_PEAK_DET_CTRL_1_PEAK_DET_WIN_LEN_MASK 0x000000fc -#define BB_PEAK_DET_CTRL_1_PEAK_DET_WIN_LEN_GET(x) (((x) & 0x000000fc) >> 2) -#define BB_PEAK_DET_CTRL_1_PEAK_DET_WIN_LEN_SET(x) (((x) << 2) & 0x000000fc) -#define BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_LOW_0_MSB 12 -#define BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_LOW_0_LSB 8 -#define BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_LOW_0_MASK 0x00001f00 -#define BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_LOW_0_GET(x) (((x) & 0x00001f00) >> 8) -#define BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_LOW_0_SET(x) (((x) << 8) & 0x00001f00) -#define BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_MED_0_MSB 17 -#define BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_MED_0_LSB 13 -#define BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_MED_0_MASK 0x0003e000 -#define BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_MED_0_GET(x) (((x) & 0x0003e000) >> 13) -#define BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_MED_0_SET(x) (((x) << 13) & 0x0003e000) -#define BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_HIGH_0_MSB 22 -#define BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_HIGH_0_LSB 18 -#define BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_HIGH_0_MASK 0x007c0000 -#define BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_HIGH_0_GET(x) (((x) & 0x007c0000) >> 18) -#define BB_PEAK_DET_CTRL_1_PEAK_DET_TALLY_THR_HIGH_0_SET(x) (((x) << 18) & 0x007c0000) -#define BB_PEAK_DET_CTRL_1_PEAK_DET_SETTLING_MSB 29 -#define BB_PEAK_DET_CTRL_1_PEAK_DET_SETTLING_LSB 23 -#define BB_PEAK_DET_CTRL_1_PEAK_DET_SETTLING_MASK 0x3f800000 -#define BB_PEAK_DET_CTRL_1_PEAK_DET_SETTLING_GET(x) (((x) & 0x3f800000) >> 23) -#define BB_PEAK_DET_CTRL_1_PEAK_DET_SETTLING_SET(x) (((x) << 23) & 0x3f800000) -#define BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_CAL_MSB 30 -#define BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_CAL_LSB 30 -#define BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_CAL_MASK 0x40000000 -#define BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_CAL_GET(x) (((x) & 0x40000000) >> 30) -#define BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_CAL_SET(x) (((x) << 30) & 0x40000000) -#define BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_RX_MSB 31 -#define BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_RX_LSB 31 -#define BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_RX_MASK 0x80000000 -#define BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_RX_GET(x) (((x) & 0x80000000) >> 31) -#define BB_PEAK_DET_CTRL_1_PWD_PKDET_DURING_RX_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_agc_reg_map.BB_peak_det_ctrl_2 */ -#define BB_PEAK_DET_CTRL_2_ADDRESS 0x00000040 -#define BB_PEAK_DET_CTRL_2_OFFSET 0x00000040 -#define BB_PEAK_DET_CTRL_2_RFSAT_2_ADD_RFGAIN_DEL_MSB 9 -#define BB_PEAK_DET_CTRL_2_RFSAT_2_ADD_RFGAIN_DEL_LSB 0 -#define BB_PEAK_DET_CTRL_2_RFSAT_2_ADD_RFGAIN_DEL_MASK 0x000003ff -#define BB_PEAK_DET_CTRL_2_RFSAT_2_ADD_RFGAIN_DEL_GET(x) (((x) & 0x000003ff) >> 0) -#define BB_PEAK_DET_CTRL_2_RFSAT_2_ADD_RFGAIN_DEL_SET(x) (((x) << 0) & 0x000003ff) -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_LOW_0_MSB 14 -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_LOW_0_LSB 10 -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_LOW_0_MASK 0x00007c00 -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_LOW_0_GET(x) (((x) & 0x00007c00) >> 10) -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_LOW_0_SET(x) (((x) << 10) & 0x00007c00) -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_MED_0_MSB 19 -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_MED_0_LSB 15 -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_MED_0_MASK 0x000f8000 -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_MED_0_GET(x) (((x) & 0x000f8000) >> 15) -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_MED_0_SET(x) (((x) << 15) & 0x000f8000) -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_HIGH_0_MSB 24 -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_HIGH_0_LSB 20 -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_HIGH_0_MASK 0x01f00000 -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_HIGH_0_GET(x) (((x) & 0x01f00000) >> 20) -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_HIGH_0_SET(x) (((x) << 20) & 0x01f00000) -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_NON_0_MSB 29 -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_NON_0_LSB 25 -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_NON_0_MASK 0x3e000000 -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_NON_0_GET(x) (((x) & 0x3e000000) >> 25) -#define BB_PEAK_DET_CTRL_2_RF_GAIN_DROP_DB_NON_0_SET(x) (((x) << 25) & 0x3e000000) -#define BB_PEAK_DET_CTRL_2_ENABLE_RFSAT_RESTART_MSB 30 -#define BB_PEAK_DET_CTRL_2_ENABLE_RFSAT_RESTART_LSB 30 -#define BB_PEAK_DET_CTRL_2_ENABLE_RFSAT_RESTART_MASK 0x40000000 -#define BB_PEAK_DET_CTRL_2_ENABLE_RFSAT_RESTART_GET(x) (((x) & 0x40000000) >> 30) -#define BB_PEAK_DET_CTRL_2_ENABLE_RFSAT_RESTART_SET(x) (((x) << 30) & 0x40000000) - -/* macros for bb_agc_reg_map.BB_rx_gain_bounds_1 */ -#define BB_RX_GAIN_BOUNDS_1_ADDRESS 0x00000044 -#define BB_RX_GAIN_BOUNDS_1_OFFSET 0x00000044 -#define BB_RX_GAIN_BOUNDS_1_RX_MAX_MB_GAIN_MSB 7 -#define BB_RX_GAIN_BOUNDS_1_RX_MAX_MB_GAIN_LSB 0 -#define BB_RX_GAIN_BOUNDS_1_RX_MAX_MB_GAIN_MASK 0x000000ff -#define BB_RX_GAIN_BOUNDS_1_RX_MAX_MB_GAIN_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_RX_GAIN_BOUNDS_1_RX_MAX_MB_GAIN_SET(x) (((x) << 0) & 0x000000ff) -#define BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_REF_MSB 15 -#define BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_REF_LSB 8 -#define BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_REF_MASK 0x0000ff00 -#define BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_REF_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_REF_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_MSB 23 -#define BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_LSB 16 -#define BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_MASK 0x00ff0000 -#define BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_RX_GAIN_BOUNDS_1_RX_MAX_RF_GAIN_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_2G_MSB 24 -#define BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_2G_LSB 24 -#define BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_2G_MASK 0x01000000 -#define BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_2G_GET(x) (((x) & 0x01000000) >> 24) -#define BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_2G_SET(x) (((x) << 24) & 0x01000000) -#define BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_5G_MSB 25 -#define BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_5G_LSB 25 -#define BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_5G_MASK 0x02000000 -#define BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_5G_GET(x) (((x) & 0x02000000) >> 25) -#define BB_RX_GAIN_BOUNDS_1_RX_OCGAIN_SEL_5G_SET(x) (((x) << 25) & 0x02000000) - -/* macros for bb_agc_reg_map.BB_rx_gain_bounds_2 */ -#define BB_RX_GAIN_BOUNDS_2_ADDRESS 0x00000048 -#define BB_RX_GAIN_BOUNDS_2_OFFSET 0x00000048 -#define BB_RX_GAIN_BOUNDS_2_GC_RSSI_LOW_DB_MSB 7 -#define BB_RX_GAIN_BOUNDS_2_GC_RSSI_LOW_DB_LSB 0 -#define BB_RX_GAIN_BOUNDS_2_GC_RSSI_LOW_DB_MASK 0x000000ff -#define BB_RX_GAIN_BOUNDS_2_GC_RSSI_LOW_DB_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_RX_GAIN_BOUNDS_2_GC_RSSI_LOW_DB_SET(x) (((x) << 0) & 0x000000ff) -#define BB_RX_GAIN_BOUNDS_2_RF_GAIN_REF_BASE_ADDR_MSB 15 -#define BB_RX_GAIN_BOUNDS_2_RF_GAIN_REF_BASE_ADDR_LSB 8 -#define BB_RX_GAIN_BOUNDS_2_RF_GAIN_REF_BASE_ADDR_MASK 0x0000ff00 -#define BB_RX_GAIN_BOUNDS_2_RF_GAIN_REF_BASE_ADDR_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_RX_GAIN_BOUNDS_2_RF_GAIN_REF_BASE_ADDR_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_RX_GAIN_BOUNDS_2_RF_GAIN_BASE_ADDR_MSB 23 -#define BB_RX_GAIN_BOUNDS_2_RF_GAIN_BASE_ADDR_LSB 16 -#define BB_RX_GAIN_BOUNDS_2_RF_GAIN_BASE_ADDR_MASK 0x00ff0000 -#define BB_RX_GAIN_BOUNDS_2_RF_GAIN_BASE_ADDR_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_RX_GAIN_BOUNDS_2_RF_GAIN_BASE_ADDR_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_RX_GAIN_BOUNDS_2_RF_GAIN_DIV_BASE_ADDR_MSB 31 -#define BB_RX_GAIN_BOUNDS_2_RF_GAIN_DIV_BASE_ADDR_LSB 24 -#define BB_RX_GAIN_BOUNDS_2_RF_GAIN_DIV_BASE_ADDR_MASK 0xff000000 -#define BB_RX_GAIN_BOUNDS_2_RF_GAIN_DIV_BASE_ADDR_GET(x) (((x) & 0xff000000) >> 24) -#define BB_RX_GAIN_BOUNDS_2_RF_GAIN_DIV_BASE_ADDR_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_agc_reg_map.BB_peak_det_cal_ctrl */ -#define BB_PEAK_DET_CAL_CTRL_ADDRESS 0x0000004c -#define BB_PEAK_DET_CAL_CTRL_OFFSET 0x0000004c -#define BB_PEAK_DET_CAL_CTRL_PKDET_CAL_WIN_THR_MSB 5 -#define BB_PEAK_DET_CAL_CTRL_PKDET_CAL_WIN_THR_LSB 0 -#define BB_PEAK_DET_CAL_CTRL_PKDET_CAL_WIN_THR_MASK 0x0000003f -#define BB_PEAK_DET_CAL_CTRL_PKDET_CAL_WIN_THR_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_PEAK_DET_CAL_CTRL_PKDET_CAL_WIN_THR_SET(x) (((x) << 0) & 0x0000003f) -#define BB_PEAK_DET_CAL_CTRL_PKDET_CAL_BIAS_MSB 11 -#define BB_PEAK_DET_CAL_CTRL_PKDET_CAL_BIAS_LSB 6 -#define BB_PEAK_DET_CAL_CTRL_PKDET_CAL_BIAS_MASK 0x00000fc0 -#define BB_PEAK_DET_CAL_CTRL_PKDET_CAL_BIAS_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_PEAK_DET_CAL_CTRL_PKDET_CAL_BIAS_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_PEAK_DET_CAL_CTRL_PKDET_CAL_MEAS_TIME_SEL_MSB 13 -#define BB_PEAK_DET_CAL_CTRL_PKDET_CAL_MEAS_TIME_SEL_LSB 12 -#define BB_PEAK_DET_CAL_CTRL_PKDET_CAL_MEAS_TIME_SEL_MASK 0x00003000 -#define BB_PEAK_DET_CAL_CTRL_PKDET_CAL_MEAS_TIME_SEL_GET(x) (((x) & 0x00003000) >> 12) -#define BB_PEAK_DET_CAL_CTRL_PKDET_CAL_MEAS_TIME_SEL_SET(x) (((x) << 12) & 0x00003000) - -/* macros for bb_agc_reg_map.BB_agc_dig_dc_ctrl */ -#define BB_AGC_DIG_DC_CTRL_ADDRESS 0x00000050 -#define BB_AGC_DIG_DC_CTRL_OFFSET 0x00000050 -#define BB_AGC_DIG_DC_CTRL_USE_DIG_DC_MSB 0 -#define BB_AGC_DIG_DC_CTRL_USE_DIG_DC_LSB 0 -#define BB_AGC_DIG_DC_CTRL_USE_DIG_DC_MASK 0x00000001 -#define BB_AGC_DIG_DC_CTRL_USE_DIG_DC_GET(x) (((x) & 0x00000001) >> 0) -#define BB_AGC_DIG_DC_CTRL_USE_DIG_DC_SET(x) (((x) << 0) & 0x00000001) -#define BB_AGC_DIG_DC_CTRL_DIG_DC_SCALE_BIAS_MSB 3 -#define BB_AGC_DIG_DC_CTRL_DIG_DC_SCALE_BIAS_LSB 1 -#define BB_AGC_DIG_DC_CTRL_DIG_DC_SCALE_BIAS_MASK 0x0000000e -#define BB_AGC_DIG_DC_CTRL_DIG_DC_SCALE_BIAS_GET(x) (((x) & 0x0000000e) >> 1) -#define BB_AGC_DIG_DC_CTRL_DIG_DC_SCALE_BIAS_SET(x) (((x) << 1) & 0x0000000e) -#define BB_AGC_DIG_DC_CTRL_DIG_DC_CORRECT_CAP_MSB 9 -#define BB_AGC_DIG_DC_CTRL_DIG_DC_CORRECT_CAP_LSB 4 -#define BB_AGC_DIG_DC_CTRL_DIG_DC_CORRECT_CAP_MASK 0x000003f0 -#define BB_AGC_DIG_DC_CTRL_DIG_DC_CORRECT_CAP_GET(x) (((x) & 0x000003f0) >> 4) -#define BB_AGC_DIG_DC_CTRL_DIG_DC_CORRECT_CAP_SET(x) (((x) << 4) & 0x000003f0) -#define BB_AGC_DIG_DC_CTRL_DIG_DC_SWITCH_CCK_MSB 10 -#define BB_AGC_DIG_DC_CTRL_DIG_DC_SWITCH_CCK_LSB 10 -#define BB_AGC_DIG_DC_CTRL_DIG_DC_SWITCH_CCK_MASK 0x00000400 -#define BB_AGC_DIG_DC_CTRL_DIG_DC_SWITCH_CCK_GET(x) (((x) & 0x00000400) >> 10) -#define BB_AGC_DIG_DC_CTRL_DIG_DC_SWITCH_CCK_SET(x) (((x) << 10) & 0x00000400) -#define BB_AGC_DIG_DC_CTRL_DIG_DC_MIXER_SEL_MASK_MSB 31 -#define BB_AGC_DIG_DC_CTRL_DIG_DC_MIXER_SEL_MASK_LSB 16 -#define BB_AGC_DIG_DC_CTRL_DIG_DC_MIXER_SEL_MASK_MASK 0xffff0000 -#define BB_AGC_DIG_DC_CTRL_DIG_DC_MIXER_SEL_MASK_GET(x) (((x) & 0xffff0000) >> 16) -#define BB_AGC_DIG_DC_CTRL_DIG_DC_MIXER_SEL_MASK_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for bb_agc_reg_map.BB_bt_coex_1 */ -#define BB_BT_COEX_1_ADDRESS 0x00000054 -#define BB_BT_COEX_1_OFFSET 0x00000054 -#define BB_BT_COEX_1_PEAK_DET_TALLY_THR_LOW_1_MSB 4 -#define BB_BT_COEX_1_PEAK_DET_TALLY_THR_LOW_1_LSB 0 -#define BB_BT_COEX_1_PEAK_DET_TALLY_THR_LOW_1_MASK 0x0000001f -#define BB_BT_COEX_1_PEAK_DET_TALLY_THR_LOW_1_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_BT_COEX_1_PEAK_DET_TALLY_THR_LOW_1_SET(x) (((x) << 0) & 0x0000001f) -#define BB_BT_COEX_1_PEAK_DET_TALLY_THR_MED_1_MSB 9 -#define BB_BT_COEX_1_PEAK_DET_TALLY_THR_MED_1_LSB 5 -#define BB_BT_COEX_1_PEAK_DET_TALLY_THR_MED_1_MASK 0x000003e0 -#define BB_BT_COEX_1_PEAK_DET_TALLY_THR_MED_1_GET(x) (((x) & 0x000003e0) >> 5) -#define BB_BT_COEX_1_PEAK_DET_TALLY_THR_MED_1_SET(x) (((x) << 5) & 0x000003e0) -#define BB_BT_COEX_1_PEAK_DET_TALLY_THR_HIGH_1_MSB 14 -#define BB_BT_COEX_1_PEAK_DET_TALLY_THR_HIGH_1_LSB 10 -#define BB_BT_COEX_1_PEAK_DET_TALLY_THR_HIGH_1_MASK 0x00007c00 -#define BB_BT_COEX_1_PEAK_DET_TALLY_THR_HIGH_1_GET(x) (((x) & 0x00007c00) >> 10) -#define BB_BT_COEX_1_PEAK_DET_TALLY_THR_HIGH_1_SET(x) (((x) << 10) & 0x00007c00) -#define BB_BT_COEX_1_RF_GAIN_DROP_DB_LOW_1_MSB 19 -#define BB_BT_COEX_1_RF_GAIN_DROP_DB_LOW_1_LSB 15 -#define BB_BT_COEX_1_RF_GAIN_DROP_DB_LOW_1_MASK 0x000f8000 -#define BB_BT_COEX_1_RF_GAIN_DROP_DB_LOW_1_GET(x) (((x) & 0x000f8000) >> 15) -#define BB_BT_COEX_1_RF_GAIN_DROP_DB_LOW_1_SET(x) (((x) << 15) & 0x000f8000) -#define BB_BT_COEX_1_RF_GAIN_DROP_DB_MED_1_MSB 24 -#define BB_BT_COEX_1_RF_GAIN_DROP_DB_MED_1_LSB 20 -#define BB_BT_COEX_1_RF_GAIN_DROP_DB_MED_1_MASK 0x01f00000 -#define BB_BT_COEX_1_RF_GAIN_DROP_DB_MED_1_GET(x) (((x) & 0x01f00000) >> 20) -#define BB_BT_COEX_1_RF_GAIN_DROP_DB_MED_1_SET(x) (((x) << 20) & 0x01f00000) -#define BB_BT_COEX_1_RF_GAIN_DROP_DB_HIGH_1_MSB 29 -#define BB_BT_COEX_1_RF_GAIN_DROP_DB_HIGH_1_LSB 25 -#define BB_BT_COEX_1_RF_GAIN_DROP_DB_HIGH_1_MASK 0x3e000000 -#define BB_BT_COEX_1_RF_GAIN_DROP_DB_HIGH_1_GET(x) (((x) & 0x3e000000) >> 25) -#define BB_BT_COEX_1_RF_GAIN_DROP_DB_HIGH_1_SET(x) (((x) << 25) & 0x3e000000) -#define BB_BT_COEX_1_BT_TX_DISABLE_NF_CAL_MSB 30 -#define BB_BT_COEX_1_BT_TX_DISABLE_NF_CAL_LSB 30 -#define BB_BT_COEX_1_BT_TX_DISABLE_NF_CAL_MASK 0x40000000 -#define BB_BT_COEX_1_BT_TX_DISABLE_NF_CAL_GET(x) (((x) & 0x40000000) >> 30) -#define BB_BT_COEX_1_BT_TX_DISABLE_NF_CAL_SET(x) (((x) << 30) & 0x40000000) - -/* macros for bb_agc_reg_map.BB_bt_coex_2 */ -#define BB_BT_COEX_2_ADDRESS 0x00000058 -#define BB_BT_COEX_2_OFFSET 0x00000058 -#define BB_BT_COEX_2_PEAK_DET_TALLY_THR_LOW_2_MSB 4 -#define BB_BT_COEX_2_PEAK_DET_TALLY_THR_LOW_2_LSB 0 -#define BB_BT_COEX_2_PEAK_DET_TALLY_THR_LOW_2_MASK 0x0000001f -#define BB_BT_COEX_2_PEAK_DET_TALLY_THR_LOW_2_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_BT_COEX_2_PEAK_DET_TALLY_THR_LOW_2_SET(x) (((x) << 0) & 0x0000001f) -#define BB_BT_COEX_2_PEAK_DET_TALLY_THR_MED_2_MSB 9 -#define BB_BT_COEX_2_PEAK_DET_TALLY_THR_MED_2_LSB 5 -#define BB_BT_COEX_2_PEAK_DET_TALLY_THR_MED_2_MASK 0x000003e0 -#define BB_BT_COEX_2_PEAK_DET_TALLY_THR_MED_2_GET(x) (((x) & 0x000003e0) >> 5) -#define BB_BT_COEX_2_PEAK_DET_TALLY_THR_MED_2_SET(x) (((x) << 5) & 0x000003e0) -#define BB_BT_COEX_2_PEAK_DET_TALLY_THR_HIGH_2_MSB 14 -#define BB_BT_COEX_2_PEAK_DET_TALLY_THR_HIGH_2_LSB 10 -#define BB_BT_COEX_2_PEAK_DET_TALLY_THR_HIGH_2_MASK 0x00007c00 -#define BB_BT_COEX_2_PEAK_DET_TALLY_THR_HIGH_2_GET(x) (((x) & 0x00007c00) >> 10) -#define BB_BT_COEX_2_PEAK_DET_TALLY_THR_HIGH_2_SET(x) (((x) << 10) & 0x00007c00) -#define BB_BT_COEX_2_RF_GAIN_DROP_DB_LOW_2_MSB 19 -#define BB_BT_COEX_2_RF_GAIN_DROP_DB_LOW_2_LSB 15 -#define BB_BT_COEX_2_RF_GAIN_DROP_DB_LOW_2_MASK 0x000f8000 -#define BB_BT_COEX_2_RF_GAIN_DROP_DB_LOW_2_GET(x) (((x) & 0x000f8000) >> 15) -#define BB_BT_COEX_2_RF_GAIN_DROP_DB_LOW_2_SET(x) (((x) << 15) & 0x000f8000) -#define BB_BT_COEX_2_RF_GAIN_DROP_DB_MED_2_MSB 24 -#define BB_BT_COEX_2_RF_GAIN_DROP_DB_MED_2_LSB 20 -#define BB_BT_COEX_2_RF_GAIN_DROP_DB_MED_2_MASK 0x01f00000 -#define BB_BT_COEX_2_RF_GAIN_DROP_DB_MED_2_GET(x) (((x) & 0x01f00000) >> 20) -#define BB_BT_COEX_2_RF_GAIN_DROP_DB_MED_2_SET(x) (((x) << 20) & 0x01f00000) -#define BB_BT_COEX_2_RF_GAIN_DROP_DB_HIGH_2_MSB 29 -#define BB_BT_COEX_2_RF_GAIN_DROP_DB_HIGH_2_LSB 25 -#define BB_BT_COEX_2_RF_GAIN_DROP_DB_HIGH_2_MASK 0x3e000000 -#define BB_BT_COEX_2_RF_GAIN_DROP_DB_HIGH_2_GET(x) (((x) & 0x3e000000) >> 25) -#define BB_BT_COEX_2_RF_GAIN_DROP_DB_HIGH_2_SET(x) (((x) << 25) & 0x3e000000) -#define BB_BT_COEX_2_RFSAT_RX_RX_MSB 31 -#define BB_BT_COEX_2_RFSAT_RX_RX_LSB 30 -#define BB_BT_COEX_2_RFSAT_RX_RX_MASK 0xc0000000 -#define BB_BT_COEX_2_RFSAT_RX_RX_GET(x) (((x) & 0xc0000000) >> 30) -#define BB_BT_COEX_2_RFSAT_RX_RX_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for bb_agc_reg_map.BB_bt_coex_3 */ -#define BB_BT_COEX_3_ADDRESS 0x0000005c -#define BB_BT_COEX_3_OFFSET 0x0000005c -#define BB_BT_COEX_3_RFSAT_BT_SRCH_SRCH_MSB 1 -#define BB_BT_COEX_3_RFSAT_BT_SRCH_SRCH_LSB 0 -#define BB_BT_COEX_3_RFSAT_BT_SRCH_SRCH_MASK 0x00000003 -#define BB_BT_COEX_3_RFSAT_BT_SRCH_SRCH_GET(x) (((x) & 0x00000003) >> 0) -#define BB_BT_COEX_3_RFSAT_BT_SRCH_SRCH_SET(x) (((x) << 0) & 0x00000003) -#define BB_BT_COEX_3_RFSAT_BT_RX_SRCH_MSB 3 -#define BB_BT_COEX_3_RFSAT_BT_RX_SRCH_LSB 2 -#define BB_BT_COEX_3_RFSAT_BT_RX_SRCH_MASK 0x0000000c -#define BB_BT_COEX_3_RFSAT_BT_RX_SRCH_GET(x) (((x) & 0x0000000c) >> 2) -#define BB_BT_COEX_3_RFSAT_BT_RX_SRCH_SET(x) (((x) << 2) & 0x0000000c) -#define BB_BT_COEX_3_RFSAT_BT_SRCH_RX_MSB 5 -#define BB_BT_COEX_3_RFSAT_BT_SRCH_RX_LSB 4 -#define BB_BT_COEX_3_RFSAT_BT_SRCH_RX_MASK 0x00000030 -#define BB_BT_COEX_3_RFSAT_BT_SRCH_RX_GET(x) (((x) & 0x00000030) >> 4) -#define BB_BT_COEX_3_RFSAT_BT_SRCH_RX_SET(x) (((x) << 4) & 0x00000030) -#define BB_BT_COEX_3_RFSAT_WLAN_SRCH_SRCH_MSB 7 -#define BB_BT_COEX_3_RFSAT_WLAN_SRCH_SRCH_LSB 6 -#define BB_BT_COEX_3_RFSAT_WLAN_SRCH_SRCH_MASK 0x000000c0 -#define BB_BT_COEX_3_RFSAT_WLAN_SRCH_SRCH_GET(x) (((x) & 0x000000c0) >> 6) -#define BB_BT_COEX_3_RFSAT_WLAN_SRCH_SRCH_SET(x) (((x) << 6) & 0x000000c0) -#define BB_BT_COEX_3_RFSAT_WLAN_RX_SRCH_MSB 9 -#define BB_BT_COEX_3_RFSAT_WLAN_RX_SRCH_LSB 8 -#define BB_BT_COEX_3_RFSAT_WLAN_RX_SRCH_MASK 0x00000300 -#define BB_BT_COEX_3_RFSAT_WLAN_RX_SRCH_GET(x) (((x) & 0x00000300) >> 8) -#define BB_BT_COEX_3_RFSAT_WLAN_RX_SRCH_SET(x) (((x) << 8) & 0x00000300) -#define BB_BT_COEX_3_RFSAT_WLAN_SRCH_RX_MSB 11 -#define BB_BT_COEX_3_RFSAT_WLAN_SRCH_RX_LSB 10 -#define BB_BT_COEX_3_RFSAT_WLAN_SRCH_RX_MASK 0x00000c00 -#define BB_BT_COEX_3_RFSAT_WLAN_SRCH_RX_GET(x) (((x) & 0x00000c00) >> 10) -#define BB_BT_COEX_3_RFSAT_WLAN_SRCH_RX_SET(x) (((x) << 10) & 0x00000c00) -#define BB_BT_COEX_3_RFSAT_EQ_SRCH_SRCH_MSB 13 -#define BB_BT_COEX_3_RFSAT_EQ_SRCH_SRCH_LSB 12 -#define BB_BT_COEX_3_RFSAT_EQ_SRCH_SRCH_MASK 0x00003000 -#define BB_BT_COEX_3_RFSAT_EQ_SRCH_SRCH_GET(x) (((x) & 0x00003000) >> 12) -#define BB_BT_COEX_3_RFSAT_EQ_SRCH_SRCH_SET(x) (((x) << 12) & 0x00003000) -#define BB_BT_COEX_3_RFSAT_EQ_RX_SRCH_MSB 15 -#define BB_BT_COEX_3_RFSAT_EQ_RX_SRCH_LSB 14 -#define BB_BT_COEX_3_RFSAT_EQ_RX_SRCH_MASK 0x0000c000 -#define BB_BT_COEX_3_RFSAT_EQ_RX_SRCH_GET(x) (((x) & 0x0000c000) >> 14) -#define BB_BT_COEX_3_RFSAT_EQ_RX_SRCH_SET(x) (((x) << 14) & 0x0000c000) -#define BB_BT_COEX_3_RFSAT_EQ_SRCH_RX_MSB 17 -#define BB_BT_COEX_3_RFSAT_EQ_SRCH_RX_LSB 16 -#define BB_BT_COEX_3_RFSAT_EQ_SRCH_RX_MASK 0x00030000 -#define BB_BT_COEX_3_RFSAT_EQ_SRCH_RX_GET(x) (((x) & 0x00030000) >> 16) -#define BB_BT_COEX_3_RFSAT_EQ_SRCH_RX_SET(x) (((x) << 16) & 0x00030000) -#define BB_BT_COEX_3_RF_GAIN_DROP_DB_NON_1_MSB 22 -#define BB_BT_COEX_3_RF_GAIN_DROP_DB_NON_1_LSB 18 -#define BB_BT_COEX_3_RF_GAIN_DROP_DB_NON_1_MASK 0x007c0000 -#define BB_BT_COEX_3_RF_GAIN_DROP_DB_NON_1_GET(x) (((x) & 0x007c0000) >> 18) -#define BB_BT_COEX_3_RF_GAIN_DROP_DB_NON_1_SET(x) (((x) << 18) & 0x007c0000) -#define BB_BT_COEX_3_RF_GAIN_DROP_DB_NON_2_MSB 27 -#define BB_BT_COEX_3_RF_GAIN_DROP_DB_NON_2_LSB 23 -#define BB_BT_COEX_3_RF_GAIN_DROP_DB_NON_2_MASK 0x0f800000 -#define BB_BT_COEX_3_RF_GAIN_DROP_DB_NON_2_GET(x) (((x) & 0x0f800000) >> 23) -#define BB_BT_COEX_3_RF_GAIN_DROP_DB_NON_2_SET(x) (((x) << 23) & 0x0f800000) -#define BB_BT_COEX_3_BT_RX_FIRPWR_INCR_MSB 31 -#define BB_BT_COEX_3_BT_RX_FIRPWR_INCR_LSB 28 -#define BB_BT_COEX_3_BT_RX_FIRPWR_INCR_MASK 0xf0000000 -#define BB_BT_COEX_3_BT_RX_FIRPWR_INCR_GET(x) (((x) & 0xf0000000) >> 28) -#define BB_BT_COEX_3_BT_RX_FIRPWR_INCR_SET(x) (((x) << 28) & 0xf0000000) - -/* macros for bb_agc_reg_map.BB_bt_coex_4 */ -#define BB_BT_COEX_4_ADDRESS 0x00000060 -#define BB_BT_COEX_4_OFFSET 0x00000060 -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_0_MSB 7 -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_0_LSB 0 -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_0_MASK 0x000000ff -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_0_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_0_SET(x) (((x) << 0) & 0x000000ff) -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_1_MSB 15 -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_1_LSB 8 -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_1_MASK 0x0000ff00 -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_1_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_1_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_2_MSB 23 -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_2_LSB 16 -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_2_MASK 0x00ff0000 -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_2_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_2_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_3_MSB 31 -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_3_LSB 24 -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_3_MASK 0xff000000 -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_3_GET(x) (((x) & 0xff000000) >> 24) -#define BB_BT_COEX_4_RFGAIN_EQV_LNA_3_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_agc_reg_map.BB_bt_coex_5 */ -#define BB_BT_COEX_5_ADDRESS 0x00000064 -#define BB_BT_COEX_5_OFFSET 0x00000064 -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_4_MSB 7 -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_4_LSB 0 -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_4_MASK 0x000000ff -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_4_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_4_SET(x) (((x) << 0) & 0x000000ff) -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_5_MSB 15 -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_5_LSB 8 -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_5_MASK 0x0000ff00 -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_5_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_5_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_6_MSB 23 -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_6_LSB 16 -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_6_MASK 0x00ff0000 -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_6_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_6_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_7_MSB 31 -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_7_LSB 24 -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_7_MASK 0xff000000 -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_7_GET(x) (((x) & 0xff000000) >> 24) -#define BB_BT_COEX_5_RFGAIN_EQV_LNA_7_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_agc_reg_map.BB_redpwr_ctrl_1 */ -#define BB_REDPWR_CTRL_1_ADDRESS 0x00000068 -#define BB_REDPWR_CTRL_1_OFFSET 0x00000068 -#define BB_REDPWR_CTRL_1_REDPWR_MODE_MSB 1 -#define BB_REDPWR_CTRL_1_REDPWR_MODE_LSB 0 -#define BB_REDPWR_CTRL_1_REDPWR_MODE_MASK 0x00000003 -#define BB_REDPWR_CTRL_1_REDPWR_MODE_GET(x) (((x) & 0x00000003) >> 0) -#define BB_REDPWR_CTRL_1_REDPWR_MODE_SET(x) (((x) << 0) & 0x00000003) -#define BB_REDPWR_CTRL_1_REDPWR_MODE_CLR_MSB 2 -#define BB_REDPWR_CTRL_1_REDPWR_MODE_CLR_LSB 2 -#define BB_REDPWR_CTRL_1_REDPWR_MODE_CLR_MASK 0x00000004 -#define BB_REDPWR_CTRL_1_REDPWR_MODE_CLR_GET(x) (((x) & 0x00000004) >> 2) -#define BB_REDPWR_CTRL_1_REDPWR_MODE_CLR_SET(x) (((x) << 2) & 0x00000004) -#define BB_REDPWR_CTRL_1_REDPWR_MODE_SET_MSB 3 -#define BB_REDPWR_CTRL_1_REDPWR_MODE_SET_LSB 3 -#define BB_REDPWR_CTRL_1_REDPWR_MODE_SET_MASK 0x00000008 -#define BB_REDPWR_CTRL_1_REDPWR_MODE_SET_GET(x) (((x) & 0x00000008) >> 3) -#define BB_REDPWR_CTRL_1_REDPWR_MODE_SET_SET(x) (((x) << 3) & 0x00000008) -#define BB_REDPWR_CTRL_1_GAIN_CORR_DB2_MSB 8 -#define BB_REDPWR_CTRL_1_GAIN_CORR_DB2_LSB 4 -#define BB_REDPWR_CTRL_1_GAIN_CORR_DB2_MASK 0x000001f0 -#define BB_REDPWR_CTRL_1_GAIN_CORR_DB2_GET(x) (((x) & 0x000001f0) >> 4) -#define BB_REDPWR_CTRL_1_GAIN_CORR_DB2_SET(x) (((x) << 4) & 0x000001f0) -#define BB_REDPWR_CTRL_1_SCFIR_ADJ_GAIN_MSB 12 -#define BB_REDPWR_CTRL_1_SCFIR_ADJ_GAIN_LSB 9 -#define BB_REDPWR_CTRL_1_SCFIR_ADJ_GAIN_MASK 0x00001e00 -#define BB_REDPWR_CTRL_1_SCFIR_ADJ_GAIN_GET(x) (((x) & 0x00001e00) >> 9) -#define BB_REDPWR_CTRL_1_SCFIR_ADJ_GAIN_SET(x) (((x) << 9) & 0x00001e00) -#define BB_REDPWR_CTRL_1_QUICKDROP_RF_MSB 17 -#define BB_REDPWR_CTRL_1_QUICKDROP_RF_LSB 13 -#define BB_REDPWR_CTRL_1_QUICKDROP_RF_MASK 0x0003e000 -#define BB_REDPWR_CTRL_1_QUICKDROP_RF_GET(x) (((x) & 0x0003e000) >> 13) -#define BB_REDPWR_CTRL_1_QUICKDROP_RF_SET(x) (((x) << 13) & 0x0003e000) -#define BB_REDPWR_CTRL_1_BYPASS_FIR_F_MSB 18 -#define BB_REDPWR_CTRL_1_BYPASS_FIR_F_LSB 18 -#define BB_REDPWR_CTRL_1_BYPASS_FIR_F_MASK 0x00040000 -#define BB_REDPWR_CTRL_1_BYPASS_FIR_F_GET(x) (((x) & 0x00040000) >> 18) -#define BB_REDPWR_CTRL_1_BYPASS_FIR_F_SET(x) (((x) << 18) & 0x00040000) -#define BB_REDPWR_CTRL_1_ADC_HALF_REF_F_MSB 19 -#define BB_REDPWR_CTRL_1_ADC_HALF_REF_F_LSB 19 -#define BB_REDPWR_CTRL_1_ADC_HALF_REF_F_MASK 0x00080000 -#define BB_REDPWR_CTRL_1_ADC_HALF_REF_F_GET(x) (((x) & 0x00080000) >> 19) -#define BB_REDPWR_CTRL_1_ADC_HALF_REF_F_SET(x) (((x) << 19) & 0x00080000) - -/* macros for bb_agc_reg_map.BB_redpwr_ctrl_2 */ -#define BB_REDPWR_CTRL_2_ADDRESS 0x0000006c -#define BB_REDPWR_CTRL_2_OFFSET 0x0000006c -#define BB_REDPWR_CTRL_2_SC01_SW_INDEX_MSB 6 -#define BB_REDPWR_CTRL_2_SC01_SW_INDEX_LSB 0 -#define BB_REDPWR_CTRL_2_SC01_SW_INDEX_MASK 0x0000007f -#define BB_REDPWR_CTRL_2_SC01_SW_INDEX_GET(x) (((x) & 0x0000007f) >> 0) -#define BB_REDPWR_CTRL_2_SC01_SW_INDEX_SET(x) (((x) << 0) & 0x0000007f) -#define BB_REDPWR_CTRL_2_SC10_SW_INDEX_MSB 13 -#define BB_REDPWR_CTRL_2_SC10_SW_INDEX_LSB 7 -#define BB_REDPWR_CTRL_2_SC10_SW_INDEX_MASK 0x00003f80 -#define BB_REDPWR_CTRL_2_SC10_SW_INDEX_GET(x) (((x) & 0x00003f80) >> 7) -#define BB_REDPWR_CTRL_2_SC10_SW_INDEX_SET(x) (((x) << 7) & 0x00003f80) -#define BB_REDPWR_CTRL_2_LAST_SC0_INDEX_MSB 20 -#define BB_REDPWR_CTRL_2_LAST_SC0_INDEX_LSB 14 -#define BB_REDPWR_CTRL_2_LAST_SC0_INDEX_MASK 0x001fc000 -#define BB_REDPWR_CTRL_2_LAST_SC0_INDEX_GET(x) (((x) & 0x001fc000) >> 14) -#define BB_REDPWR_CTRL_2_LAST_SC0_INDEX_SET(x) (((x) << 14) & 0x001fc000) - -/* macros for bb_agc_reg_map.BB_rssi_b0 */ -#define BB_RSSI_B0_ADDRESS 0x00000180 -#define BB_RSSI_B0_OFFSET 0x00000180 -#define BB_RSSI_B0_RSSI_0_MSB 7 -#define BB_RSSI_B0_RSSI_0_LSB 0 -#define BB_RSSI_B0_RSSI_0_MASK 0x000000ff -#define BB_RSSI_B0_RSSI_0_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_RSSI_B0_RSSI_EXT_0_MSB 15 -#define BB_RSSI_B0_RSSI_EXT_0_LSB 8 -#define BB_RSSI_B0_RSSI_EXT_0_MASK 0x0000ff00 -#define BB_RSSI_B0_RSSI_EXT_0_GET(x) (((x) & 0x0000ff00) >> 8) - -/* macros for bb_agc_reg_map.BB_spur_est_cck_report_b0 */ -#define BB_SPUR_EST_CCK_REPORT_B0_ADDRESS 0x00000184 -#define BB_SPUR_EST_CCK_REPORT_B0_OFFSET 0x00000184 -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_I_0_CCK_MSB 7 -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_I_0_CCK_LSB 0 -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_I_0_CCK_MASK 0x000000ff -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_I_0_CCK_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_Q_0_CCK_MSB 15 -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_Q_0_CCK_LSB 8 -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_Q_0_CCK_MASK 0x0000ff00 -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_SD_Q_0_CCK_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_I_0_CCK_MSB 23 -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_I_0_CCK_LSB 16 -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_I_0_CCK_MASK 0x00ff0000 -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_I_0_CCK_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_Q_0_CCK_MSB 31 -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_Q_0_CCK_LSB 24 -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_Q_0_CCK_MASK 0xff000000 -#define BB_SPUR_EST_CCK_REPORT_B0_SPUR_EST_Q_0_CCK_GET(x) (((x) & 0xff000000) >> 24) - -/* macros for bb_agc_reg_map.BB_agc_dig_dc_status_i_b0 */ -#define BB_AGC_DIG_DC_STATUS_I_B0_ADDRESS 0x00000188 -#define BB_AGC_DIG_DC_STATUS_I_B0_OFFSET 0x00000188 -#define BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C1_RES_I_0_MSB 8 -#define BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C1_RES_I_0_LSB 0 -#define BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C1_RES_I_0_MASK 0x000001ff -#define BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C1_RES_I_0_GET(x) (((x) & 0x000001ff) >> 0) -#define BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C2_RES_I_0_MSB 17 -#define BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C2_RES_I_0_LSB 9 -#define BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C2_RES_I_0_MASK 0x0003fe00 -#define BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C2_RES_I_0_GET(x) (((x) & 0x0003fe00) >> 9) -#define BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C3_RES_I_0_MSB 26 -#define BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C3_RES_I_0_LSB 18 -#define BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C3_RES_I_0_MASK 0x07fc0000 -#define BB_AGC_DIG_DC_STATUS_I_B0_DIG_DC_C3_RES_I_0_GET(x) (((x) & 0x07fc0000) >> 18) - -/* macros for bb_agc_reg_map.BB_agc_dig_dc_status_q_b0 */ -#define BB_AGC_DIG_DC_STATUS_Q_B0_ADDRESS 0x0000018c -#define BB_AGC_DIG_DC_STATUS_Q_B0_OFFSET 0x0000018c -#define BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C1_RES_Q_0_MSB 8 -#define BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C1_RES_Q_0_LSB 0 -#define BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C1_RES_Q_0_MASK 0x000001ff -#define BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C1_RES_Q_0_GET(x) (((x) & 0x000001ff) >> 0) -#define BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C2_RES_Q_0_MSB 17 -#define BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C2_RES_Q_0_LSB 9 -#define BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C2_RES_Q_0_MASK 0x0003fe00 -#define BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C2_RES_Q_0_GET(x) (((x) & 0x0003fe00) >> 9) -#define BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C3_RES_Q_0_MSB 26 -#define BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C3_RES_Q_0_LSB 18 -#define BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C3_RES_Q_0_MASK 0x07fc0000 -#define BB_AGC_DIG_DC_STATUS_Q_B0_DIG_DC_C3_RES_Q_0_GET(x) (((x) & 0x07fc0000) >> 18) - -/* macros for bb_agc_reg_map.BB_dc_cal_status_b0 */ -#define BB_DC_CAL_STATUS_B0_ADDRESS 0x00000190 -#define BB_DC_CAL_STATUS_B0_OFFSET 0x00000190 -#define BB_DC_CAL_STATUS_B0_OFFSETC1I_0_MSB 4 -#define BB_DC_CAL_STATUS_B0_OFFSETC1I_0_LSB 0 -#define BB_DC_CAL_STATUS_B0_OFFSETC1I_0_MASK 0x0000001f -#define BB_DC_CAL_STATUS_B0_OFFSETC1I_0_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_DC_CAL_STATUS_B0_OFFSETC1Q_0_MSB 9 -#define BB_DC_CAL_STATUS_B0_OFFSETC1Q_0_LSB 5 -#define BB_DC_CAL_STATUS_B0_OFFSETC1Q_0_MASK 0x000003e0 -#define BB_DC_CAL_STATUS_B0_OFFSETC1Q_0_GET(x) (((x) & 0x000003e0) >> 5) -#define BB_DC_CAL_STATUS_B0_OFFSETC2I_0_MSB 14 -#define BB_DC_CAL_STATUS_B0_OFFSETC2I_0_LSB 10 -#define BB_DC_CAL_STATUS_B0_OFFSETC2I_0_MASK 0x00007c00 -#define BB_DC_CAL_STATUS_B0_OFFSETC2I_0_GET(x) (((x) & 0x00007c00) >> 10) -#define BB_DC_CAL_STATUS_B0_OFFSETC2Q_0_MSB 19 -#define BB_DC_CAL_STATUS_B0_OFFSETC2Q_0_LSB 15 -#define BB_DC_CAL_STATUS_B0_OFFSETC2Q_0_MASK 0x000f8000 -#define BB_DC_CAL_STATUS_B0_OFFSETC2Q_0_GET(x) (((x) & 0x000f8000) >> 15) -#define BB_DC_CAL_STATUS_B0_OFFSETC3I_0_MSB 24 -#define BB_DC_CAL_STATUS_B0_OFFSETC3I_0_LSB 20 -#define BB_DC_CAL_STATUS_B0_OFFSETC3I_0_MASK 0x01f00000 -#define BB_DC_CAL_STATUS_B0_OFFSETC3I_0_GET(x) (((x) & 0x01f00000) >> 20) -#define BB_DC_CAL_STATUS_B0_OFFSETC3Q_0_MSB 29 -#define BB_DC_CAL_STATUS_B0_OFFSETC3Q_0_LSB 25 -#define BB_DC_CAL_STATUS_B0_OFFSETC3Q_0_MASK 0x3e000000 -#define BB_DC_CAL_STATUS_B0_OFFSETC3Q_0_GET(x) (((x) & 0x3e000000) >> 25) - -/* macros for bb_agc_reg_map.BB_bbb_sig_detect */ -#define BB_BBB_SIG_DETECT_ADDRESS 0x000001c0 -#define BB_BBB_SIG_DETECT_OFFSET 0x000001c0 -#define BB_BBB_SIG_DETECT_WEAK_SIG_THR_CCK_MSB 5 -#define BB_BBB_SIG_DETECT_WEAK_SIG_THR_CCK_LSB 0 -#define BB_BBB_SIG_DETECT_WEAK_SIG_THR_CCK_MASK 0x0000003f -#define BB_BBB_SIG_DETECT_WEAK_SIG_THR_CCK_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_BBB_SIG_DETECT_WEAK_SIG_THR_CCK_SET(x) (((x) << 0) & 0x0000003f) -#define BB_BBB_SIG_DETECT_ANT_SWITCH_TIME_MSB 12 -#define BB_BBB_SIG_DETECT_ANT_SWITCH_TIME_LSB 6 -#define BB_BBB_SIG_DETECT_ANT_SWITCH_TIME_MASK 0x00001fc0 -#define BB_BBB_SIG_DETECT_ANT_SWITCH_TIME_GET(x) (((x) & 0x00001fc0) >> 6) -#define BB_BBB_SIG_DETECT_ANT_SWITCH_TIME_SET(x) (((x) << 6) & 0x00001fc0) -#define BB_BBB_SIG_DETECT_ENABLE_ANT_FAST_DIV_MSB 13 -#define BB_BBB_SIG_DETECT_ENABLE_ANT_FAST_DIV_LSB 13 -#define BB_BBB_SIG_DETECT_ENABLE_ANT_FAST_DIV_MASK 0x00002000 -#define BB_BBB_SIG_DETECT_ENABLE_ANT_FAST_DIV_GET(x) (((x) & 0x00002000) >> 13) -#define BB_BBB_SIG_DETECT_ENABLE_ANT_FAST_DIV_SET(x) (((x) << 13) & 0x00002000) -#define BB_BBB_SIG_DETECT_LB_ALPHA_128_CCK_MSB 14 -#define BB_BBB_SIG_DETECT_LB_ALPHA_128_CCK_LSB 14 -#define BB_BBB_SIG_DETECT_LB_ALPHA_128_CCK_MASK 0x00004000 -#define BB_BBB_SIG_DETECT_LB_ALPHA_128_CCK_GET(x) (((x) & 0x00004000) >> 14) -#define BB_BBB_SIG_DETECT_LB_ALPHA_128_CCK_SET(x) (((x) << 14) & 0x00004000) -#define BB_BBB_SIG_DETECT_LB_RX_ENABLE_CCK_MSB 15 -#define BB_BBB_SIG_DETECT_LB_RX_ENABLE_CCK_LSB 15 -#define BB_BBB_SIG_DETECT_LB_RX_ENABLE_CCK_MASK 0x00008000 -#define BB_BBB_SIG_DETECT_LB_RX_ENABLE_CCK_GET(x) (((x) & 0x00008000) >> 15) -#define BB_BBB_SIG_DETECT_LB_RX_ENABLE_CCK_SET(x) (((x) << 15) & 0x00008000) -#define BB_BBB_SIG_DETECT_CYC32_COARSE_DC_EST_CCK_MSB 16 -#define BB_BBB_SIG_DETECT_CYC32_COARSE_DC_EST_CCK_LSB 16 -#define BB_BBB_SIG_DETECT_CYC32_COARSE_DC_EST_CCK_MASK 0x00010000 -#define BB_BBB_SIG_DETECT_CYC32_COARSE_DC_EST_CCK_GET(x) (((x) & 0x00010000) >> 16) -#define BB_BBB_SIG_DETECT_CYC32_COARSE_DC_EST_CCK_SET(x) (((x) << 16) & 0x00010000) -#define BB_BBB_SIG_DETECT_CYC64_COARSE_DC_EST_CCK_MSB 17 -#define BB_BBB_SIG_DETECT_CYC64_COARSE_DC_EST_CCK_LSB 17 -#define BB_BBB_SIG_DETECT_CYC64_COARSE_DC_EST_CCK_MASK 0x00020000 -#define BB_BBB_SIG_DETECT_CYC64_COARSE_DC_EST_CCK_GET(x) (((x) & 0x00020000) >> 17) -#define BB_BBB_SIG_DETECT_CYC64_COARSE_DC_EST_CCK_SET(x) (((x) << 17) & 0x00020000) -#define BB_BBB_SIG_DETECT_ENABLE_COARSE_DC_CCK_MSB 18 -#define BB_BBB_SIG_DETECT_ENABLE_COARSE_DC_CCK_LSB 18 -#define BB_BBB_SIG_DETECT_ENABLE_COARSE_DC_CCK_MASK 0x00040000 -#define BB_BBB_SIG_DETECT_ENABLE_COARSE_DC_CCK_GET(x) (((x) & 0x00040000) >> 18) -#define BB_BBB_SIG_DETECT_ENABLE_COARSE_DC_CCK_SET(x) (((x) << 18) & 0x00040000) -#define BB_BBB_SIG_DETECT_CYC256_FINE_DC_EST_CCK_MSB 19 -#define BB_BBB_SIG_DETECT_CYC256_FINE_DC_EST_CCK_LSB 19 -#define BB_BBB_SIG_DETECT_CYC256_FINE_DC_EST_CCK_MASK 0x00080000 -#define BB_BBB_SIG_DETECT_CYC256_FINE_DC_EST_CCK_GET(x) (((x) & 0x00080000) >> 19) -#define BB_BBB_SIG_DETECT_CYC256_FINE_DC_EST_CCK_SET(x) (((x) << 19) & 0x00080000) -#define BB_BBB_SIG_DETECT_ENABLE_FINE_DC_CCK_MSB 20 -#define BB_BBB_SIG_DETECT_ENABLE_FINE_DC_CCK_LSB 20 -#define BB_BBB_SIG_DETECT_ENABLE_FINE_DC_CCK_MASK 0x00100000 -#define BB_BBB_SIG_DETECT_ENABLE_FINE_DC_CCK_GET(x) (((x) & 0x00100000) >> 20) -#define BB_BBB_SIG_DETECT_ENABLE_FINE_DC_CCK_SET(x) (((x) << 20) & 0x00100000) -#define BB_BBB_SIG_DETECT_DELAY_START_SYNC_CCK_MSB 21 -#define BB_BBB_SIG_DETECT_DELAY_START_SYNC_CCK_LSB 21 -#define BB_BBB_SIG_DETECT_DELAY_START_SYNC_CCK_MASK 0x00200000 -#define BB_BBB_SIG_DETECT_DELAY_START_SYNC_CCK_GET(x) (((x) & 0x00200000) >> 21) -#define BB_BBB_SIG_DETECT_DELAY_START_SYNC_CCK_SET(x) (((x) << 21) & 0x00200000) -#define BB_BBB_SIG_DETECT_USE_DC_EST_DURING_SRCH_MSB 22 -#define BB_BBB_SIG_DETECT_USE_DC_EST_DURING_SRCH_LSB 22 -#define BB_BBB_SIG_DETECT_USE_DC_EST_DURING_SRCH_MASK 0x00400000 -#define BB_BBB_SIG_DETECT_USE_DC_EST_DURING_SRCH_GET(x) (((x) & 0x00400000) >> 22) -#define BB_BBB_SIG_DETECT_USE_DC_EST_DURING_SRCH_SET(x) (((x) << 22) & 0x00400000) -#define BB_BBB_SIG_DETECT_BBB_MRC_OFF_NO_SWAP_MSB 23 -#define BB_BBB_SIG_DETECT_BBB_MRC_OFF_NO_SWAP_LSB 23 -#define BB_BBB_SIG_DETECT_BBB_MRC_OFF_NO_SWAP_MASK 0x00800000 -#define BB_BBB_SIG_DETECT_BBB_MRC_OFF_NO_SWAP_GET(x) (((x) & 0x00800000) >> 23) -#define BB_BBB_SIG_DETECT_BBB_MRC_OFF_NO_SWAP_SET(x) (((x) << 23) & 0x00800000) -#define BB_BBB_SIG_DETECT_SWAP_DEFAULT_CHAIN_CCK_MSB 24 -#define BB_BBB_SIG_DETECT_SWAP_DEFAULT_CHAIN_CCK_LSB 24 -#define BB_BBB_SIG_DETECT_SWAP_DEFAULT_CHAIN_CCK_MASK 0x01000000 -#define BB_BBB_SIG_DETECT_SWAP_DEFAULT_CHAIN_CCK_GET(x) (((x) & 0x01000000) >> 24) -#define BB_BBB_SIG_DETECT_SWAP_DEFAULT_CHAIN_CCK_SET(x) (((x) << 24) & 0x01000000) -#define BB_BBB_SIG_DETECT_ENABLE_BARKER_TWO_PHASE_MSB 31 -#define BB_BBB_SIG_DETECT_ENABLE_BARKER_TWO_PHASE_LSB 31 -#define BB_BBB_SIG_DETECT_ENABLE_BARKER_TWO_PHASE_MASK 0x80000000 -#define BB_BBB_SIG_DETECT_ENABLE_BARKER_TWO_PHASE_GET(x) (((x) & 0x80000000) >> 31) -#define BB_BBB_SIG_DETECT_ENABLE_BARKER_TWO_PHASE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_agc_reg_map.BB_bbb_dagc_ctrl */ -#define BB_BBB_DAGC_CTRL_ADDRESS 0x000001c4 -#define BB_BBB_DAGC_CTRL_OFFSET 0x000001c4 -#define BB_BBB_DAGC_CTRL_ENABLE_DAGC_CCK_MSB 0 -#define BB_BBB_DAGC_CTRL_ENABLE_DAGC_CCK_LSB 0 -#define BB_BBB_DAGC_CTRL_ENABLE_DAGC_CCK_MASK 0x00000001 -#define BB_BBB_DAGC_CTRL_ENABLE_DAGC_CCK_GET(x) (((x) & 0x00000001) >> 0) -#define BB_BBB_DAGC_CTRL_ENABLE_DAGC_CCK_SET(x) (((x) << 0) & 0x00000001) -#define BB_BBB_DAGC_CTRL_DAGC_TARGET_PWR_CCK_MSB 8 -#define BB_BBB_DAGC_CTRL_DAGC_TARGET_PWR_CCK_LSB 1 -#define BB_BBB_DAGC_CTRL_DAGC_TARGET_PWR_CCK_MASK 0x000001fe -#define BB_BBB_DAGC_CTRL_DAGC_TARGET_PWR_CCK_GET(x) (((x) & 0x000001fe) >> 1) -#define BB_BBB_DAGC_CTRL_DAGC_TARGET_PWR_CCK_SET(x) (((x) << 1) & 0x000001fe) -#define BB_BBB_DAGC_CTRL_ENABLE_BARKER_RSSI_THR_MSB 9 -#define BB_BBB_DAGC_CTRL_ENABLE_BARKER_RSSI_THR_LSB 9 -#define BB_BBB_DAGC_CTRL_ENABLE_BARKER_RSSI_THR_MASK 0x00000200 -#define BB_BBB_DAGC_CTRL_ENABLE_BARKER_RSSI_THR_GET(x) (((x) & 0x00000200) >> 9) -#define BB_BBB_DAGC_CTRL_ENABLE_BARKER_RSSI_THR_SET(x) (((x) << 9) & 0x00000200) -#define BB_BBB_DAGC_CTRL_BARKER_RSSI_THR_MSB 16 -#define BB_BBB_DAGC_CTRL_BARKER_RSSI_THR_LSB 10 -#define BB_BBB_DAGC_CTRL_BARKER_RSSI_THR_MASK 0x0001fc00 -#define BB_BBB_DAGC_CTRL_BARKER_RSSI_THR_GET(x) (((x) & 0x0001fc00) >> 10) -#define BB_BBB_DAGC_CTRL_BARKER_RSSI_THR_SET(x) (((x) << 10) & 0x0001fc00) -#define BB_BBB_DAGC_CTRL_ENABLE_FIRSTEP_SEL_MSB 17 -#define BB_BBB_DAGC_CTRL_ENABLE_FIRSTEP_SEL_LSB 17 -#define BB_BBB_DAGC_CTRL_ENABLE_FIRSTEP_SEL_MASK 0x00020000 -#define BB_BBB_DAGC_CTRL_ENABLE_FIRSTEP_SEL_GET(x) (((x) & 0x00020000) >> 17) -#define BB_BBB_DAGC_CTRL_ENABLE_FIRSTEP_SEL_SET(x) (((x) << 17) & 0x00020000) -#define BB_BBB_DAGC_CTRL_FIRSTEP_2_MSB 23 -#define BB_BBB_DAGC_CTRL_FIRSTEP_2_LSB 18 -#define BB_BBB_DAGC_CTRL_FIRSTEP_2_MASK 0x00fc0000 -#define BB_BBB_DAGC_CTRL_FIRSTEP_2_GET(x) (((x) & 0x00fc0000) >> 18) -#define BB_BBB_DAGC_CTRL_FIRSTEP_2_SET(x) (((x) << 18) & 0x00fc0000) -#define BB_BBB_DAGC_CTRL_FIRSTEP_COUNT_LGMAX_MSB 27 -#define BB_BBB_DAGC_CTRL_FIRSTEP_COUNT_LGMAX_LSB 24 -#define BB_BBB_DAGC_CTRL_FIRSTEP_COUNT_LGMAX_MASK 0x0f000000 -#define BB_BBB_DAGC_CTRL_FIRSTEP_COUNT_LGMAX_GET(x) (((x) & 0x0f000000) >> 24) -#define BB_BBB_DAGC_CTRL_FIRSTEP_COUNT_LGMAX_SET(x) (((x) << 24) & 0x0f000000) -#define BB_BBB_DAGC_CTRL_FORCE_RX_CHAIN_CCK_0_MSB 29 -#define BB_BBB_DAGC_CTRL_FORCE_RX_CHAIN_CCK_0_LSB 28 -#define BB_BBB_DAGC_CTRL_FORCE_RX_CHAIN_CCK_0_MASK 0x30000000 -#define BB_BBB_DAGC_CTRL_FORCE_RX_CHAIN_CCK_0_GET(x) (((x) & 0x30000000) >> 28) -#define BB_BBB_DAGC_CTRL_FORCE_RX_CHAIN_CCK_0_SET(x) (((x) << 28) & 0x30000000) -#define BB_BBB_DAGC_CTRL_FORCE_RX_CHAIN_CCK_1_MSB 31 -#define BB_BBB_DAGC_CTRL_FORCE_RX_CHAIN_CCK_1_LSB 30 -#define BB_BBB_DAGC_CTRL_FORCE_RX_CHAIN_CCK_1_MASK 0xc0000000 -#define BB_BBB_DAGC_CTRL_FORCE_RX_CHAIN_CCK_1_GET(x) (((x) & 0xc0000000) >> 30) -#define BB_BBB_DAGC_CTRL_FORCE_RX_CHAIN_CCK_1_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for bb_agc_reg_map.BB_iqcorr_ctrl_cck */ -#define BB_IQCORR_CTRL_CCK_ADDRESS 0x000001c8 -#define BB_IQCORR_CTRL_CCK_OFFSET 0x000001c8 -#define BB_IQCORR_CTRL_CCK_IQCORR_Q_Q_COFF_CCK_MSB 4 -#define BB_IQCORR_CTRL_CCK_IQCORR_Q_Q_COFF_CCK_LSB 0 -#define BB_IQCORR_CTRL_CCK_IQCORR_Q_Q_COFF_CCK_MASK 0x0000001f -#define BB_IQCORR_CTRL_CCK_IQCORR_Q_Q_COFF_CCK_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_IQCORR_CTRL_CCK_IQCORR_Q_Q_COFF_CCK_SET(x) (((x) << 0) & 0x0000001f) -#define BB_IQCORR_CTRL_CCK_IQCORR_Q_I_COFF_CCK_MSB 10 -#define BB_IQCORR_CTRL_CCK_IQCORR_Q_I_COFF_CCK_LSB 5 -#define BB_IQCORR_CTRL_CCK_IQCORR_Q_I_COFF_CCK_MASK 0x000007e0 -#define BB_IQCORR_CTRL_CCK_IQCORR_Q_I_COFF_CCK_GET(x) (((x) & 0x000007e0) >> 5) -#define BB_IQCORR_CTRL_CCK_IQCORR_Q_I_COFF_CCK_SET(x) (((x) << 5) & 0x000007e0) -#define BB_IQCORR_CTRL_CCK_ENABLE_IQCORR_CCK_MSB 11 -#define BB_IQCORR_CTRL_CCK_ENABLE_IQCORR_CCK_LSB 11 -#define BB_IQCORR_CTRL_CCK_ENABLE_IQCORR_CCK_MASK 0x00000800 -#define BB_IQCORR_CTRL_CCK_ENABLE_IQCORR_CCK_GET(x) (((x) & 0x00000800) >> 11) -#define BB_IQCORR_CTRL_CCK_ENABLE_IQCORR_CCK_SET(x) (((x) << 11) & 0x00000800) -#define BB_IQCORR_CTRL_CCK_RXCAL_MEAS_TIME_SEL_MSB 13 -#define BB_IQCORR_CTRL_CCK_RXCAL_MEAS_TIME_SEL_LSB 12 -#define BB_IQCORR_CTRL_CCK_RXCAL_MEAS_TIME_SEL_MASK 0x00003000 -#define BB_IQCORR_CTRL_CCK_RXCAL_MEAS_TIME_SEL_GET(x) (((x) & 0x00003000) >> 12) -#define BB_IQCORR_CTRL_CCK_RXCAL_MEAS_TIME_SEL_SET(x) (((x) << 12) & 0x00003000) -#define BB_IQCORR_CTRL_CCK_CLCAL_MEAS_TIME_SEL_MSB 15 -#define BB_IQCORR_CTRL_CCK_CLCAL_MEAS_TIME_SEL_LSB 14 -#define BB_IQCORR_CTRL_CCK_CLCAL_MEAS_TIME_SEL_MASK 0x0000c000 -#define BB_IQCORR_CTRL_CCK_CLCAL_MEAS_TIME_SEL_GET(x) (((x) & 0x0000c000) >> 14) -#define BB_IQCORR_CTRL_CCK_CLCAL_MEAS_TIME_SEL_SET(x) (((x) << 14) & 0x0000c000) -#define BB_IQCORR_CTRL_CCK_CF_CLC_INIT_RFGAIN_MSB 20 -#define BB_IQCORR_CTRL_CCK_CF_CLC_INIT_RFGAIN_LSB 16 -#define BB_IQCORR_CTRL_CCK_CF_CLC_INIT_RFGAIN_MASK 0x001f0000 -#define BB_IQCORR_CTRL_CCK_CF_CLC_INIT_RFGAIN_GET(x) (((x) & 0x001f0000) >> 16) -#define BB_IQCORR_CTRL_CCK_CF_CLC_INIT_RFGAIN_SET(x) (((x) << 16) & 0x001f0000) - -/* macros for bb_agc_reg_map.BB_cck_spur_mit */ -#define BB_CCK_SPUR_MIT_ADDRESS 0x000001cc -#define BB_CCK_SPUR_MIT_OFFSET 0x000001cc -#define BB_CCK_SPUR_MIT_USE_CCK_SPUR_MIT_MSB 0 -#define BB_CCK_SPUR_MIT_USE_CCK_SPUR_MIT_LSB 0 -#define BB_CCK_SPUR_MIT_USE_CCK_SPUR_MIT_MASK 0x00000001 -#define BB_CCK_SPUR_MIT_USE_CCK_SPUR_MIT_GET(x) (((x) & 0x00000001) >> 0) -#define BB_CCK_SPUR_MIT_USE_CCK_SPUR_MIT_SET(x) (((x) << 0) & 0x00000001) -#define BB_CCK_SPUR_MIT_SPUR_RSSI_THR_MSB 8 -#define BB_CCK_SPUR_MIT_SPUR_RSSI_THR_LSB 1 -#define BB_CCK_SPUR_MIT_SPUR_RSSI_THR_MASK 0x000001fe -#define BB_CCK_SPUR_MIT_SPUR_RSSI_THR_GET(x) (((x) & 0x000001fe) >> 1) -#define BB_CCK_SPUR_MIT_SPUR_RSSI_THR_SET(x) (((x) << 1) & 0x000001fe) -#define BB_CCK_SPUR_MIT_CCK_SPUR_FREQ_MSB 28 -#define BB_CCK_SPUR_MIT_CCK_SPUR_FREQ_LSB 9 -#define BB_CCK_SPUR_MIT_CCK_SPUR_FREQ_MASK 0x1ffffe00 -#define BB_CCK_SPUR_MIT_CCK_SPUR_FREQ_GET(x) (((x) & 0x1ffffe00) >> 9) -#define BB_CCK_SPUR_MIT_CCK_SPUR_FREQ_SET(x) (((x) << 9) & 0x1ffffe00) -#define BB_CCK_SPUR_MIT_SPUR_FILTER_TYPE_MSB 30 -#define BB_CCK_SPUR_MIT_SPUR_FILTER_TYPE_LSB 29 -#define BB_CCK_SPUR_MIT_SPUR_FILTER_TYPE_MASK 0x60000000 -#define BB_CCK_SPUR_MIT_SPUR_FILTER_TYPE_GET(x) (((x) & 0x60000000) >> 29) -#define BB_CCK_SPUR_MIT_SPUR_FILTER_TYPE_SET(x) (((x) << 29) & 0x60000000) - -/* macros for bb_agc_reg_map.BB_mrc_cck_ctrl */ -#define BB_MRC_CCK_CTRL_ADDRESS 0x000001d0 -#define BB_MRC_CCK_CTRL_OFFSET 0x000001d0 -#define BB_MRC_CCK_CTRL_BBB_MRC_EN_MSB 0 -#define BB_MRC_CCK_CTRL_BBB_MRC_EN_LSB 0 -#define BB_MRC_CCK_CTRL_BBB_MRC_EN_MASK 0x00000001 -#define BB_MRC_CCK_CTRL_BBB_MRC_EN_GET(x) (((x) & 0x00000001) >> 0) -#define BB_MRC_CCK_CTRL_BBB_MRC_EN_SET(x) (((x) << 0) & 0x00000001) -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MRC_MUX_REG_MSB 1 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MRC_MUX_REG_LSB 1 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MRC_MUX_REG_MASK 0x00000002 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MRC_MUX_REG_GET(x) (((x) & 0x00000002) >> 1) -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MRC_MUX_REG_SET(x) (((x) << 1) & 0x00000002) -#define BB_MRC_CCK_CTRL_AGCDP_CCK_PD_ACCU_THR_HI_MSB 4 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_PD_ACCU_THR_HI_LSB 2 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_PD_ACCU_THR_HI_MASK 0x0000001c -#define BB_MRC_CCK_CTRL_AGCDP_CCK_PD_ACCU_THR_HI_GET(x) (((x) & 0x0000001c) >> 2) -#define BB_MRC_CCK_CTRL_AGCDP_CCK_PD_ACCU_THR_HI_SET(x) (((x) << 2) & 0x0000001c) -#define BB_MRC_CCK_CTRL_AGCDP_CCK_PD_ACCU_THR_LOW_MSB 7 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_PD_ACCU_THR_LOW_LSB 5 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_PD_ACCU_THR_LOW_MASK 0x000000e0 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_PD_ACCU_THR_LOW_GET(x) (((x) & 0x000000e0) >> 5) -#define BB_MRC_CCK_CTRL_AGCDP_CCK_PD_ACCU_THR_LOW_SET(x) (((x) << 5) & 0x000000e0) -#define BB_MRC_CCK_CTRL_AGCDP_CCK_BARKER_RSSI_THR_MSB 11 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_BARKER_RSSI_THR_LSB 8 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_BARKER_RSSI_THR_MASK 0x00000f00 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_BARKER_RSSI_THR_GET(x) (((x) & 0x00000f00) >> 8) -#define BB_MRC_CCK_CTRL_AGCDP_CCK_BARKER_RSSI_THR_SET(x) (((x) << 8) & 0x00000f00) -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MRC_BK_THR_HI_MSB 16 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MRC_BK_THR_HI_LSB 12 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MRC_BK_THR_HI_MASK 0x0001f000 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MRC_BK_THR_HI_GET(x) (((x) & 0x0001f000) >> 12) -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MRC_BK_THR_HI_SET(x) (((x) << 12) & 0x0001f000) -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MRC_BK_THR_LOW_MSB 21 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MRC_BK_THR_LOW_LSB 17 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MRC_BK_THR_LOW_MASK 0x003e0000 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MRC_BK_THR_LOW_GET(x) (((x) & 0x003e0000) >> 17) -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MRC_BK_THR_LOW_SET(x) (((x) << 17) & 0x003e0000) -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MIN_VALUE_MSB 27 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MIN_VALUE_LSB 22 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MIN_VALUE_MASK 0x0fc00000 -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MIN_VALUE_GET(x) (((x) & 0x0fc00000) >> 22) -#define BB_MRC_CCK_CTRL_AGCDP_CCK_MIN_VALUE_SET(x) (((x) << 22) & 0x0fc00000) - -/* macros for bb_agc_reg_map.BB_cck_blocker_det */ -#define BB_CCK_BLOCKER_DET_ADDRESS 0x000001d4 -#define BB_CCK_BLOCKER_DET_OFFSET 0x000001d4 -#define BB_CCK_BLOCKER_DET_CCK_FREQ_SHIFT_BLOCKER_DETECTION_MSB 0 -#define BB_CCK_BLOCKER_DET_CCK_FREQ_SHIFT_BLOCKER_DETECTION_LSB 0 -#define BB_CCK_BLOCKER_DET_CCK_FREQ_SHIFT_BLOCKER_DETECTION_MASK 0x00000001 -#define BB_CCK_BLOCKER_DET_CCK_FREQ_SHIFT_BLOCKER_DETECTION_GET(x) (((x) & 0x00000001) >> 0) -#define BB_CCK_BLOCKER_DET_CCK_FREQ_SHIFT_BLOCKER_DETECTION_SET(x) (((x) << 0) & 0x00000001) -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_RESTART_WEAK_SIG_MSB 1 -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_RESTART_WEAK_SIG_LSB 1 -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_RESTART_WEAK_SIG_MASK 0x00000002 -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_RESTART_WEAK_SIG_GET(x) (((x) & 0x00000002) >> 1) -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_RESTART_WEAK_SIG_SET(x) (((x) << 1) & 0x00000002) -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_BKSUM_NUM_MSB 5 -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_BKSUM_NUM_LSB 2 -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_BKSUM_NUM_MASK 0x0000003c -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_BKSUM_NUM_GET(x) (((x) & 0x0000003c) >> 2) -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_BKSUM_NUM_SET(x) (((x) << 2) & 0x0000003c) -#define BB_CCK_BLOCKER_DET_BK_VALID_DELAY_MSB 8 -#define BB_CCK_BLOCKER_DET_BK_VALID_DELAY_LSB 6 -#define BB_CCK_BLOCKER_DET_BK_VALID_DELAY_MASK 0x000001c0 -#define BB_CCK_BLOCKER_DET_BK_VALID_DELAY_GET(x) (((x) & 0x000001c0) >> 6) -#define BB_CCK_BLOCKER_DET_BK_VALID_DELAY_SET(x) (((x) << 6) & 0x000001c0) -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_THR_MSB 13 -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_THR_LSB 9 -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_THR_MASK 0x00003e00 -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_THR_GET(x) (((x) & 0x00003e00) >> 9) -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_THR_SET(x) (((x) << 9) & 0x00003e00) -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_DELAY_THR_MSB 19 -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_DELAY_THR_LSB 14 -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_DELAY_THR_MASK 0x000fc000 -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_DELAY_THR_GET(x) (((x) & 0x000fc000) >> 14) -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_DET_DELAY_THR_SET(x) (((x) << 14) & 0x000fc000) -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_MONITOR_TIME_MSB 25 -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_MONITOR_TIME_LSB 20 -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_MONITOR_TIME_MASK 0x03f00000 -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_MONITOR_TIME_GET(x) (((x) & 0x03f00000) >> 20) -#define BB_CCK_BLOCKER_DET_CCK_BLOCKER_MONITOR_TIME_SET(x) (((x) << 20) & 0x03f00000) -#define BB_CCK_BLOCKER_DET_SKIP_RAMP_ENABLE_MSB 26 -#define BB_CCK_BLOCKER_DET_SKIP_RAMP_ENABLE_LSB 26 -#define BB_CCK_BLOCKER_DET_SKIP_RAMP_ENABLE_MASK 0x04000000 -#define BB_CCK_BLOCKER_DET_SKIP_RAMP_ENABLE_GET(x) (((x) & 0x04000000) >> 26) -#define BB_CCK_BLOCKER_DET_SKIP_RAMP_ENABLE_SET(x) (((x) << 26) & 0x04000000) -#define BB_CCK_BLOCKER_DET_CCK_DET_RAMP_THR_MSB 31 -#define BB_CCK_BLOCKER_DET_CCK_DET_RAMP_THR_LSB 27 -#define BB_CCK_BLOCKER_DET_CCK_DET_RAMP_THR_MASK 0xf8000000 -#define BB_CCK_BLOCKER_DET_CCK_DET_RAMP_THR_GET(x) (((x) & 0xf8000000) >> 27) -#define BB_CCK_BLOCKER_DET_CCK_DET_RAMP_THR_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for bb_agc_reg_map.BB_rx_ocgain */ -#define BB_RX_OCGAIN_ADDRESS 0x00000200 -#define BB_RX_OCGAIN_OFFSET 0x00000200 -#define BB_RX_OCGAIN_GAIN_ENTRY_MSB 31 -#define BB_RX_OCGAIN_GAIN_ENTRY_LSB 0 -#define BB_RX_OCGAIN_GAIN_ENTRY_MASK 0xffffffff -#define BB_RX_OCGAIN_GAIN_ENTRY_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_RX_OCGAIN_GAIN_ENTRY_SET(x) (((x) << 0) & 0xffffffff) - -#ifndef __ASSEMBLER__ - -typedef struct bb_reg_reg_s_4 { - volatile unsigned int BB_settling_time; /* 0x0 - 0x4 */ - volatile unsigned int BB_gain_force_max_gains_b0; /* 0x4 - 0x8 */ - volatile unsigned int BB_gains_min_offsets; /* 0x8 - 0xc */ - volatile unsigned int BB_desired_sigsize; /* 0xc - 0x10 */ - volatile unsigned int BB_find_signal; /* 0x10 - 0x14 */ - volatile unsigned int BB_agc; /* 0x14 - 0x18 */ - volatile unsigned int BB_ext_atten_switch_ctl_b0; /* 0x18 - 0x1c */ - volatile unsigned int BB_cca_b0; /* 0x1c - 0x20 */ - volatile unsigned int BB_cca_ctrl_2_b0; /* 0x20 - 0x24 */ - volatile unsigned int BB_restart; /* 0x24 - 0x28 */ - volatile unsigned int BB_multichain_gain_ctrl; /* 0x28 - 0x2c */ - volatile unsigned int BB_ext_chan_pwr_thr_1; /* 0x2c - 0x30 */ - volatile unsigned int BB_ext_chan_detect_win; /* 0x30 - 0x34 */ - volatile unsigned int BB_pwr_thr_20_40_det; /* 0x34 - 0x38 */ - volatile unsigned int BB_rifs_srch; /* 0x38 - 0x3c */ - volatile unsigned int BB_peak_det_ctrl_1; /* 0x3c - 0x40 */ - volatile unsigned int BB_peak_det_ctrl_2; /* 0x40 - 0x44 */ - volatile unsigned int BB_rx_gain_bounds_1; /* 0x44 - 0x48 */ - volatile unsigned int BB_rx_gain_bounds_2; /* 0x48 - 0x4c */ - volatile unsigned int BB_peak_det_cal_ctrl; /* 0x4c - 0x50 */ - volatile unsigned int BB_agc_dig_dc_ctrl; /* 0x50 - 0x54 */ - volatile unsigned int BB_bt_coex_1; /* 0x54 - 0x58 */ - volatile unsigned int BB_bt_coex_2; /* 0x58 - 0x5c */ - volatile unsigned int BB_bt_coex_3; /* 0x5c - 0x60 */ - volatile unsigned int BB_bt_coex_4; /* 0x60 - 0x64 */ - volatile unsigned int BB_bt_coex_5; /* 0x64 - 0x68 */ - volatile unsigned int BB_redpwr_ctrl_1; /* 0x68 - 0x6c */ - volatile unsigned int BB_redpwr_ctrl_2; /* 0x6c - 0x70 */ - volatile char pad__0[0x110]; /* 0x70 - 0x180 */ - volatile unsigned int BB_rssi_b0; /* 0x180 - 0x184 */ - volatile unsigned int BB_spur_est_cck_report_b0; /* 0x184 - 0x188 */ - volatile unsigned int BB_agc_dig_dc_status_i_b0; /* 0x188 - 0x18c */ - volatile unsigned int BB_agc_dig_dc_status_q_b0; /* 0x18c - 0x190 */ - volatile unsigned int BB_dc_cal_status_b0; /* 0x190 - 0x194 */ - volatile char pad__1[0x2c]; /* 0x194 - 0x1c0 */ - volatile unsigned int BB_bbb_sig_detect; /* 0x1c0 - 0x1c4 */ - volatile unsigned int BB_bbb_dagc_ctrl; /* 0x1c4 - 0x1c8 */ - volatile unsigned int BB_iqcorr_ctrl_cck; /* 0x1c8 - 0x1cc */ - volatile unsigned int BB_cck_spur_mit; /* 0x1cc - 0x1d0 */ - volatile unsigned int BB_mrc_cck_ctrl; /* 0x1d0 - 0x1d4 */ - volatile unsigned int BB_cck_blocker_det; /* 0x1d4 - 0x1d8 */ - volatile char pad__2[0x28]; /* 0x1d8 - 0x200 */ - volatile unsigned int BB_rx_ocgain[128]; /* 0x200 - 0x400 */ -} bb_reg_reg_t_4; - -#endif /* __ASSEMBLER__ */ - - -/* macros for bb_sm_reg_map.BB_D2_chip_id */ -#define BB_D2_CHIP_ID_ADDRESS 0x00000000 -#define BB_D2_CHIP_ID_OFFSET 0x00000000 -#define BB_D2_CHIP_ID_OLD_ID_MSB 7 -#define BB_D2_CHIP_ID_OLD_ID_LSB 0 -#define BB_D2_CHIP_ID_OLD_ID_MASK 0x000000ff -#define BB_D2_CHIP_ID_OLD_ID_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_D2_CHIP_ID_ID_MSB 31 -#define BB_D2_CHIP_ID_ID_LSB 8 -#define BB_D2_CHIP_ID_ID_MASK 0xffffff00 -#define BB_D2_CHIP_ID_ID_GET(x) (((x) & 0xffffff00) >> 8) - -/* macros for bb_sm_reg_map.BB_gen_controls */ -#define BB_GEN_CONTROLS_ADDRESS 0x00000004 -#define BB_GEN_CONTROLS_OFFSET 0x00000004 -#define BB_GEN_CONTROLS_TURBO_MSB 0 -#define BB_GEN_CONTROLS_TURBO_LSB 0 -#define BB_GEN_CONTROLS_TURBO_MASK 0x00000001 -#define BB_GEN_CONTROLS_TURBO_GET(x) (((x) & 0x00000001) >> 0) -#define BB_GEN_CONTROLS_TURBO_SET(x) (((x) << 0) & 0x00000001) -#define BB_GEN_CONTROLS_CF_SHORT20_MSB 1 -#define BB_GEN_CONTROLS_CF_SHORT20_LSB 1 -#define BB_GEN_CONTROLS_CF_SHORT20_MASK 0x00000002 -#define BB_GEN_CONTROLS_CF_SHORT20_GET(x) (((x) & 0x00000002) >> 1) -#define BB_GEN_CONTROLS_CF_SHORT20_SET(x) (((x) << 1) & 0x00000002) -#define BB_GEN_CONTROLS_DYN_20_40_MSB 2 -#define BB_GEN_CONTROLS_DYN_20_40_LSB 2 -#define BB_GEN_CONTROLS_DYN_20_40_MASK 0x00000004 -#define BB_GEN_CONTROLS_DYN_20_40_GET(x) (((x) & 0x00000004) >> 2) -#define BB_GEN_CONTROLS_DYN_20_40_SET(x) (((x) << 2) & 0x00000004) -#define BB_GEN_CONTROLS_DYN_20_40_PRI_ONLY_MSB 3 -#define BB_GEN_CONTROLS_DYN_20_40_PRI_ONLY_LSB 3 -#define BB_GEN_CONTROLS_DYN_20_40_PRI_ONLY_MASK 0x00000008 -#define BB_GEN_CONTROLS_DYN_20_40_PRI_ONLY_GET(x) (((x) & 0x00000008) >> 3) -#define BB_GEN_CONTROLS_DYN_20_40_PRI_ONLY_SET(x) (((x) << 3) & 0x00000008) -#define BB_GEN_CONTROLS_DYN_20_40_PRI_CHN_MSB 4 -#define BB_GEN_CONTROLS_DYN_20_40_PRI_CHN_LSB 4 -#define BB_GEN_CONTROLS_DYN_20_40_PRI_CHN_MASK 0x00000010 -#define BB_GEN_CONTROLS_DYN_20_40_PRI_CHN_GET(x) (((x) & 0x00000010) >> 4) -#define BB_GEN_CONTROLS_DYN_20_40_PRI_CHN_SET(x) (((x) << 4) & 0x00000010) -#define BB_GEN_CONTROLS_DYN_20_40_EXT_CHN_MSB 5 -#define BB_GEN_CONTROLS_DYN_20_40_EXT_CHN_LSB 5 -#define BB_GEN_CONTROLS_DYN_20_40_EXT_CHN_MASK 0x00000020 -#define BB_GEN_CONTROLS_DYN_20_40_EXT_CHN_GET(x) (((x) & 0x00000020) >> 5) -#define BB_GEN_CONTROLS_DYN_20_40_EXT_CHN_SET(x) (((x) << 5) & 0x00000020) -#define BB_GEN_CONTROLS_HT_ENABLE_MSB 6 -#define BB_GEN_CONTROLS_HT_ENABLE_LSB 6 -#define BB_GEN_CONTROLS_HT_ENABLE_MASK 0x00000040 -#define BB_GEN_CONTROLS_HT_ENABLE_GET(x) (((x) & 0x00000040) >> 6) -#define BB_GEN_CONTROLS_HT_ENABLE_SET(x) (((x) << 6) & 0x00000040) -#define BB_GEN_CONTROLS_ALLOW_SHORT_GI_MSB 7 -#define BB_GEN_CONTROLS_ALLOW_SHORT_GI_LSB 7 -#define BB_GEN_CONTROLS_ALLOW_SHORT_GI_MASK 0x00000080 -#define BB_GEN_CONTROLS_ALLOW_SHORT_GI_GET(x) (((x) & 0x00000080) >> 7) -#define BB_GEN_CONTROLS_ALLOW_SHORT_GI_SET(x) (((x) << 7) & 0x00000080) -#define BB_GEN_CONTROLS_CF_2_CHAINS_USE_WALSH_MSB 8 -#define BB_GEN_CONTROLS_CF_2_CHAINS_USE_WALSH_LSB 8 -#define BB_GEN_CONTROLS_CF_2_CHAINS_USE_WALSH_MASK 0x00000100 -#define BB_GEN_CONTROLS_CF_2_CHAINS_USE_WALSH_GET(x) (((x) & 0x00000100) >> 8) -#define BB_GEN_CONTROLS_CF_2_CHAINS_USE_WALSH_SET(x) (((x) << 8) & 0x00000100) -#define BB_GEN_CONTROLS_CF_3_CHAINS_USE_WALSH_MSB 9 -#define BB_GEN_CONTROLS_CF_3_CHAINS_USE_WALSH_LSB 9 -#define BB_GEN_CONTROLS_CF_3_CHAINS_USE_WALSH_MASK 0x00000200 -#define BB_GEN_CONTROLS_CF_3_CHAINS_USE_WALSH_GET(x) (((x) & 0x00000200) >> 9) -#define BB_GEN_CONTROLS_CF_3_CHAINS_USE_WALSH_SET(x) (((x) << 9) & 0x00000200) -#define BB_GEN_CONTROLS_GF_ENABLE_MSB 10 -#define BB_GEN_CONTROLS_GF_ENABLE_LSB 10 -#define BB_GEN_CONTROLS_GF_ENABLE_MASK 0x00000400 -#define BB_GEN_CONTROLS_GF_ENABLE_GET(x) (((x) & 0x00000400) >> 10) -#define BB_GEN_CONTROLS_GF_ENABLE_SET(x) (((x) << 10) & 0x00000400) -#define BB_GEN_CONTROLS_ENABLE_DAC_ASYNC_FIFO_MSB 11 -#define BB_GEN_CONTROLS_ENABLE_DAC_ASYNC_FIFO_LSB 11 -#define BB_GEN_CONTROLS_ENABLE_DAC_ASYNC_FIFO_MASK 0x00000800 -#define BB_GEN_CONTROLS_ENABLE_DAC_ASYNC_FIFO_GET(x) (((x) & 0x00000800) >> 11) -#define BB_GEN_CONTROLS_ENABLE_DAC_ASYNC_FIFO_SET(x) (((x) << 11) & 0x00000800) -#define BB_GEN_CONTROLS_BOND_OPT_CHAIN_SEL_MSB 14 -#define BB_GEN_CONTROLS_BOND_OPT_CHAIN_SEL_LSB 14 -#define BB_GEN_CONTROLS_BOND_OPT_CHAIN_SEL_MASK 0x00004000 -#define BB_GEN_CONTROLS_BOND_OPT_CHAIN_SEL_GET(x) (((x) & 0x00004000) >> 14) -#define BB_GEN_CONTROLS_BOND_OPT_CHAIN_SEL_SET(x) (((x) << 14) & 0x00004000) -#define BB_GEN_CONTROLS_STATIC20_MODE_HT40_PACKET_HANDLING_MSB 15 -#define BB_GEN_CONTROLS_STATIC20_MODE_HT40_PACKET_HANDLING_LSB 15 -#define BB_GEN_CONTROLS_STATIC20_MODE_HT40_PACKET_HANDLING_MASK 0x00008000 -#define BB_GEN_CONTROLS_STATIC20_MODE_HT40_PACKET_HANDLING_GET(x) (((x) & 0x00008000) >> 15) -#define BB_GEN_CONTROLS_STATIC20_MODE_HT40_PACKET_HANDLING_SET(x) (((x) << 15) & 0x00008000) -#define BB_GEN_CONTROLS_STATIC20_MODE_HT40_PACKET_ERROR_RPT_MSB 16 -#define BB_GEN_CONTROLS_STATIC20_MODE_HT40_PACKET_ERROR_RPT_LSB 16 -#define BB_GEN_CONTROLS_STATIC20_MODE_HT40_PACKET_ERROR_RPT_MASK 0x00010000 -#define BB_GEN_CONTROLS_STATIC20_MODE_HT40_PACKET_ERROR_RPT_GET(x) (((x) & 0x00010000) >> 16) -#define BB_GEN_CONTROLS_STATIC20_MODE_HT40_PACKET_ERROR_RPT_SET(x) (((x) << 16) & 0x00010000) -#define BB_GEN_CONTROLS_ENABLE_CSD_PHASE_DITHERING_MSB 17 -#define BB_GEN_CONTROLS_ENABLE_CSD_PHASE_DITHERING_LSB 17 -#define BB_GEN_CONTROLS_ENABLE_CSD_PHASE_DITHERING_MASK 0x00020000 -#define BB_GEN_CONTROLS_ENABLE_CSD_PHASE_DITHERING_GET(x) (((x) & 0x00020000) >> 17) -#define BB_GEN_CONTROLS_ENABLE_CSD_PHASE_DITHERING_SET(x) (((x) << 17) & 0x00020000) -#define BB_GEN_CONTROLS_UNSUPP_HT_RATE_THRESHOLD_MSB 24 -#define BB_GEN_CONTROLS_UNSUPP_HT_RATE_THRESHOLD_LSB 18 -#define BB_GEN_CONTROLS_UNSUPP_HT_RATE_THRESHOLD_MASK 0x01fc0000 -#define BB_GEN_CONTROLS_UNSUPP_HT_RATE_THRESHOLD_GET(x) (((x) & 0x01fc0000) >> 18) -#define BB_GEN_CONTROLS_UNSUPP_HT_RATE_THRESHOLD_SET(x) (((x) << 18) & 0x01fc0000) -#define BB_GEN_CONTROLS_EN_ERR_TX_CHAIN_MASK_ZERO_MSB 25 -#define BB_GEN_CONTROLS_EN_ERR_TX_CHAIN_MASK_ZERO_LSB 25 -#define BB_GEN_CONTROLS_EN_ERR_TX_CHAIN_MASK_ZERO_MASK 0x02000000 -#define BB_GEN_CONTROLS_EN_ERR_TX_CHAIN_MASK_ZERO_GET(x) (((x) & 0x02000000) >> 25) -#define BB_GEN_CONTROLS_EN_ERR_TX_CHAIN_MASK_ZERO_SET(x) (((x) << 25) & 0x02000000) -#define BB_GEN_CONTROLS_IS_MCKINLEY_TPC_MSB 26 -#define BB_GEN_CONTROLS_IS_MCKINLEY_TPC_LSB 26 -#define BB_GEN_CONTROLS_IS_MCKINLEY_TPC_MASK 0x04000000 -#define BB_GEN_CONTROLS_IS_MCKINLEY_TPC_GET(x) (((x) & 0x04000000) >> 26) -#define BB_GEN_CONTROLS_IS_MCKINLEY_TPC_SET(x) (((x) << 26) & 0x04000000) - -/* macros for bb_sm_reg_map.BB_modes_select */ -#define BB_MODES_SELECT_ADDRESS 0x00000008 -#define BB_MODES_SELECT_OFFSET 0x00000008 -#define BB_MODES_SELECT_CCK_MODE_MSB 0 -#define BB_MODES_SELECT_CCK_MODE_LSB 0 -#define BB_MODES_SELECT_CCK_MODE_MASK 0x00000001 -#define BB_MODES_SELECT_CCK_MODE_GET(x) (((x) & 0x00000001) >> 0) -#define BB_MODES_SELECT_CCK_MODE_SET(x) (((x) << 0) & 0x00000001) -#define BB_MODES_SELECT_DYN_OFDM_CCK_MODE_MSB 2 -#define BB_MODES_SELECT_DYN_OFDM_CCK_MODE_LSB 2 -#define BB_MODES_SELECT_DYN_OFDM_CCK_MODE_MASK 0x00000004 -#define BB_MODES_SELECT_DYN_OFDM_CCK_MODE_GET(x) (((x) & 0x00000004) >> 2) -#define BB_MODES_SELECT_DYN_OFDM_CCK_MODE_SET(x) (((x) << 2) & 0x00000004) -#define BB_MODES_SELECT_HALF_RATE_MODE_MSB 5 -#define BB_MODES_SELECT_HALF_RATE_MODE_LSB 5 -#define BB_MODES_SELECT_HALF_RATE_MODE_MASK 0x00000020 -#define BB_MODES_SELECT_HALF_RATE_MODE_GET(x) (((x) & 0x00000020) >> 5) -#define BB_MODES_SELECT_HALF_RATE_MODE_SET(x) (((x) << 5) & 0x00000020) -#define BB_MODES_SELECT_QUARTER_RATE_MODE_MSB 6 -#define BB_MODES_SELECT_QUARTER_RATE_MODE_LSB 6 -#define BB_MODES_SELECT_QUARTER_RATE_MODE_MASK 0x00000040 -#define BB_MODES_SELECT_QUARTER_RATE_MODE_GET(x) (((x) & 0x00000040) >> 6) -#define BB_MODES_SELECT_QUARTER_RATE_MODE_SET(x) (((x) << 6) & 0x00000040) -#define BB_MODES_SELECT_MAC_CLK_MODE_MSB 7 -#define BB_MODES_SELECT_MAC_CLK_MODE_LSB 7 -#define BB_MODES_SELECT_MAC_CLK_MODE_MASK 0x00000080 -#define BB_MODES_SELECT_MAC_CLK_MODE_GET(x) (((x) & 0x00000080) >> 7) -#define BB_MODES_SELECT_MAC_CLK_MODE_SET(x) (((x) << 7) & 0x00000080) -#define BB_MODES_SELECT_DISABLE_DYN_CCK_DET_MSB 8 -#define BB_MODES_SELECT_DISABLE_DYN_CCK_DET_LSB 8 -#define BB_MODES_SELECT_DISABLE_DYN_CCK_DET_MASK 0x00000100 -#define BB_MODES_SELECT_DISABLE_DYN_CCK_DET_GET(x) (((x) & 0x00000100) >> 8) -#define BB_MODES_SELECT_DISABLE_DYN_CCK_DET_SET(x) (((x) << 8) & 0x00000100) -#define BB_MODES_SELECT_SVD_HALF_RATE_MODE_MSB 9 -#define BB_MODES_SELECT_SVD_HALF_RATE_MODE_LSB 9 -#define BB_MODES_SELECT_SVD_HALF_RATE_MODE_MASK 0x00000200 -#define BB_MODES_SELECT_SVD_HALF_RATE_MODE_GET(x) (((x) & 0x00000200) >> 9) -#define BB_MODES_SELECT_SVD_HALF_RATE_MODE_SET(x) (((x) << 9) & 0x00000200) -#define BB_MODES_SELECT_DISABLE_DYN_FAST_ADC_MSB 10 -#define BB_MODES_SELECT_DISABLE_DYN_FAST_ADC_LSB 10 -#define BB_MODES_SELECT_DISABLE_DYN_FAST_ADC_MASK 0x00000400 -#define BB_MODES_SELECT_DISABLE_DYN_FAST_ADC_GET(x) (((x) & 0x00000400) >> 10) -#define BB_MODES_SELECT_DISABLE_DYN_FAST_ADC_SET(x) (((x) << 10) & 0x00000400) - -/* macros for bb_sm_reg_map.BB_active */ -#define BB_ACTIVE_ADDRESS 0x0000000c -#define BB_ACTIVE_OFFSET 0x0000000c -#define BB_ACTIVE_CF_ACTIVE_MSB 0 -#define BB_ACTIVE_CF_ACTIVE_LSB 0 -#define BB_ACTIVE_CF_ACTIVE_MASK 0x00000001 -#define BB_ACTIVE_CF_ACTIVE_GET(x) (((x) & 0x00000001) >> 0) -#define BB_ACTIVE_CF_ACTIVE_SET(x) (((x) << 0) & 0x00000001) - -/* macros for bb_sm_reg_map.BB_vit_spur_mask_A */ -#define BB_VIT_SPUR_MASK_A_ADDRESS 0x00000020 -#define BB_VIT_SPUR_MASK_A_OFFSET 0x00000020 -#define BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_A_MSB 9 -#define BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_A_LSB 0 -#define BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_A_MASK 0x000003ff -#define BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_A_GET(x) (((x) & 0x000003ff) >> 0) -#define BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_A_SET(x) (((x) << 0) & 0x000003ff) -#define BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_IDX_A_MSB 16 -#define BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_IDX_A_LSB 10 -#define BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_IDX_A_MASK 0x0001fc00 -#define BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_IDX_A_GET(x) (((x) & 0x0001fc00) >> 10) -#define BB_VIT_SPUR_MASK_A_CF_PUNC_MASK_IDX_A_SET(x) (((x) << 10) & 0x0001fc00) - -/* macros for bb_sm_reg_map.BB_vit_spur_mask_B */ -#define BB_VIT_SPUR_MASK_B_ADDRESS 0x00000024 -#define BB_VIT_SPUR_MASK_B_OFFSET 0x00000024 -#define BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_B_MSB 9 -#define BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_B_LSB 0 -#define BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_B_MASK 0x000003ff -#define BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_B_GET(x) (((x) & 0x000003ff) >> 0) -#define BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_B_SET(x) (((x) << 0) & 0x000003ff) -#define BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_IDX_B_MSB 16 -#define BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_IDX_B_LSB 10 -#define BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_IDX_B_MASK 0x0001fc00 -#define BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_IDX_B_GET(x) (((x) & 0x0001fc00) >> 10) -#define BB_VIT_SPUR_MASK_B_CF_PUNC_MASK_IDX_B_SET(x) (((x) << 10) & 0x0001fc00) - -/* macros for bb_sm_reg_map.BB_spectral_scan */ -#define BB_SPECTRAL_SCAN_ADDRESS 0x00000028 -#define BB_SPECTRAL_SCAN_OFFSET 0x00000028 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ENA_MSB 0 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ENA_LSB 0 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ENA_MASK 0x00000001 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ENA_GET(x) (((x) & 0x00000001) >> 0) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ENA_SET(x) (((x) << 0) & 0x00000001) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ACTIVE_MSB 1 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ACTIVE_LSB 1 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ACTIVE_MASK 0x00000002 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ACTIVE_GET(x) (((x) & 0x00000002) >> 1) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_ACTIVE_SET(x) (((x) << 1) & 0x00000002) -#define BB_SPECTRAL_SCAN_DISABLE_RADAR_TCTL_RST_MSB 2 -#define BB_SPECTRAL_SCAN_DISABLE_RADAR_TCTL_RST_LSB 2 -#define BB_SPECTRAL_SCAN_DISABLE_RADAR_TCTL_RST_MASK 0x00000004 -#define BB_SPECTRAL_SCAN_DISABLE_RADAR_TCTL_RST_GET(x) (((x) & 0x00000004) >> 2) -#define BB_SPECTRAL_SCAN_DISABLE_RADAR_TCTL_RST_SET(x) (((x) << 2) & 0x00000004) -#define BB_SPECTRAL_SCAN_DISABLE_PULSE_COARSE_LOW_MSB 3 -#define BB_SPECTRAL_SCAN_DISABLE_PULSE_COARSE_LOW_LSB 3 -#define BB_SPECTRAL_SCAN_DISABLE_PULSE_COARSE_LOW_MASK 0x00000008 -#define BB_SPECTRAL_SCAN_DISABLE_PULSE_COARSE_LOW_GET(x) (((x) & 0x00000008) >> 3) -#define BB_SPECTRAL_SCAN_DISABLE_PULSE_COARSE_LOW_SET(x) (((x) << 3) & 0x00000008) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_FFT_PERIOD_MSB 7 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_FFT_PERIOD_LSB 4 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_FFT_PERIOD_MASK 0x000000f0 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_FFT_PERIOD_GET(x) (((x) & 0x000000f0) >> 4) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_FFT_PERIOD_SET(x) (((x) << 4) & 0x000000f0) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PERIOD_MSB 15 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PERIOD_LSB 8 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PERIOD_MASK 0x0000ff00 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PERIOD_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PERIOD_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_COUNT_MSB 27 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_COUNT_LSB 16 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_COUNT_MASK 0x0fff0000 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_COUNT_GET(x) (((x) & 0x0fff0000) >> 16) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_COUNT_SET(x) (((x) << 16) & 0x0fff0000) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_SHORT_RPT_MSB 28 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_SHORT_RPT_LSB 28 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_SHORT_RPT_MASK 0x10000000 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_SHORT_RPT_GET(x) (((x) & 0x10000000) >> 28) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_SHORT_RPT_SET(x) (((x) << 28) & 0x10000000) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PRIORITY_MSB 29 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PRIORITY_LSB 29 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PRIORITY_MASK 0x20000000 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PRIORITY_GET(x) (((x) & 0x20000000) >> 29) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_PRIORITY_SET(x) (((x) << 29) & 0x20000000) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_USE_ERR5_MSB 30 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_USE_ERR5_LSB 30 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_USE_ERR5_MASK 0x40000000 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_USE_ERR5_GET(x) (((x) & 0x40000000) >> 30) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_USE_ERR5_SET(x) (((x) << 30) & 0x40000000) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_COMPRESSED_RPT_MSB 31 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_COMPRESSED_RPT_LSB 31 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_COMPRESSED_RPT_MASK 0x80000000 -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_COMPRESSED_RPT_GET(x) (((x) & 0x80000000) >> 31) -#define BB_SPECTRAL_SCAN_SPECTRAL_SCAN_COMPRESSED_RPT_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_sm_reg_map.BB_radar_bw_filter */ -#define BB_RADAR_BW_FILTER_ADDRESS 0x0000002c -#define BB_RADAR_BW_FILTER_OFFSET 0x0000002c -#define BB_RADAR_BW_FILTER_RADAR_AVG_BW_CHECK_MSB 0 -#define BB_RADAR_BW_FILTER_RADAR_AVG_BW_CHECK_LSB 0 -#define BB_RADAR_BW_FILTER_RADAR_AVG_BW_CHECK_MASK 0x00000001 -#define BB_RADAR_BW_FILTER_RADAR_AVG_BW_CHECK_GET(x) (((x) & 0x00000001) >> 0) -#define BB_RADAR_BW_FILTER_RADAR_AVG_BW_CHECK_SET(x) (((x) << 0) & 0x00000001) -#define BB_RADAR_BW_FILTER_RADAR_DC_SRC_SEL_MSB 1 -#define BB_RADAR_BW_FILTER_RADAR_DC_SRC_SEL_LSB 1 -#define BB_RADAR_BW_FILTER_RADAR_DC_SRC_SEL_MASK 0x00000002 -#define BB_RADAR_BW_FILTER_RADAR_DC_SRC_SEL_GET(x) (((x) & 0x00000002) >> 1) -#define BB_RADAR_BW_FILTER_RADAR_DC_SRC_SEL_SET(x) (((x) << 1) & 0x00000002) -#define BB_RADAR_BW_FILTER_RADAR_FIRPWR_SEL_MSB 3 -#define BB_RADAR_BW_FILTER_RADAR_FIRPWR_SEL_LSB 2 -#define BB_RADAR_BW_FILTER_RADAR_FIRPWR_SEL_MASK 0x0000000c -#define BB_RADAR_BW_FILTER_RADAR_FIRPWR_SEL_GET(x) (((x) & 0x0000000c) >> 2) -#define BB_RADAR_BW_FILTER_RADAR_FIRPWR_SEL_SET(x) (((x) << 2) & 0x0000000c) -#define BB_RADAR_BW_FILTER_RADAR_PULSE_WIDTH_SEL_MSB 5 -#define BB_RADAR_BW_FILTER_RADAR_PULSE_WIDTH_SEL_LSB 4 -#define BB_RADAR_BW_FILTER_RADAR_PULSE_WIDTH_SEL_MASK 0x00000030 -#define BB_RADAR_BW_FILTER_RADAR_PULSE_WIDTH_SEL_GET(x) (((x) & 0x00000030) >> 4) -#define BB_RADAR_BW_FILTER_RADAR_PULSE_WIDTH_SEL_SET(x) (((x) << 4) & 0x00000030) -#define BB_RADAR_BW_FILTER_RADAR_DC_FIRPWR_THRESH_MSB 14 -#define BB_RADAR_BW_FILTER_RADAR_DC_FIRPWR_THRESH_LSB 8 -#define BB_RADAR_BW_FILTER_RADAR_DC_FIRPWR_THRESH_MASK 0x00007f00 -#define BB_RADAR_BW_FILTER_RADAR_DC_FIRPWR_THRESH_GET(x) (((x) & 0x00007f00) >> 8) -#define BB_RADAR_BW_FILTER_RADAR_DC_FIRPWR_THRESH_SET(x) (((x) << 8) & 0x00007f00) -#define BB_RADAR_BW_FILTER_RADAR_DC_PWR_BIAS_MSB 20 -#define BB_RADAR_BW_FILTER_RADAR_DC_PWR_BIAS_LSB 15 -#define BB_RADAR_BW_FILTER_RADAR_DC_PWR_BIAS_MASK 0x001f8000 -#define BB_RADAR_BW_FILTER_RADAR_DC_PWR_BIAS_GET(x) (((x) & 0x001f8000) >> 15) -#define BB_RADAR_BW_FILTER_RADAR_DC_PWR_BIAS_SET(x) (((x) << 15) & 0x001f8000) -#define BB_RADAR_BW_FILTER_RADAR_BIN_MAX_BW_MSB 26 -#define BB_RADAR_BW_FILTER_RADAR_BIN_MAX_BW_LSB 21 -#define BB_RADAR_BW_FILTER_RADAR_BIN_MAX_BW_MASK 0x07e00000 -#define BB_RADAR_BW_FILTER_RADAR_BIN_MAX_BW_GET(x) (((x) & 0x07e00000) >> 21) -#define BB_RADAR_BW_FILTER_RADAR_BIN_MAX_BW_SET(x) (((x) << 21) & 0x07e00000) - -/* macros for bb_sm_reg_map.BB_search_start_delay */ -#define BB_SEARCH_START_DELAY_ADDRESS 0x00000030 -#define BB_SEARCH_START_DELAY_OFFSET 0x00000030 -#define BB_SEARCH_START_DELAY_SEARCH_START_DELAY_MSB 11 -#define BB_SEARCH_START_DELAY_SEARCH_START_DELAY_LSB 0 -#define BB_SEARCH_START_DELAY_SEARCH_START_DELAY_MASK 0x00000fff -#define BB_SEARCH_START_DELAY_SEARCH_START_DELAY_GET(x) (((x) & 0x00000fff) >> 0) -#define BB_SEARCH_START_DELAY_SEARCH_START_DELAY_SET(x) (((x) << 0) & 0x00000fff) -#define BB_SEARCH_START_DELAY_ENABLE_FLT_SVD_MSB 12 -#define BB_SEARCH_START_DELAY_ENABLE_FLT_SVD_LSB 12 -#define BB_SEARCH_START_DELAY_ENABLE_FLT_SVD_MASK 0x00001000 -#define BB_SEARCH_START_DELAY_ENABLE_FLT_SVD_GET(x) (((x) & 0x00001000) >> 12) -#define BB_SEARCH_START_DELAY_ENABLE_FLT_SVD_SET(x) (((x) << 12) & 0x00001000) -#define BB_SEARCH_START_DELAY_ENABLE_SEND_CHAN_MSB 13 -#define BB_SEARCH_START_DELAY_ENABLE_SEND_CHAN_LSB 13 -#define BB_SEARCH_START_DELAY_ENABLE_SEND_CHAN_MASK 0x00002000 -#define BB_SEARCH_START_DELAY_ENABLE_SEND_CHAN_GET(x) (((x) & 0x00002000) >> 13) -#define BB_SEARCH_START_DELAY_ENABLE_SEND_CHAN_SET(x) (((x) << 13) & 0x00002000) -#define BB_SEARCH_START_DELAY_RX_SOUNDING_ENABLE_MSB 14 -#define BB_SEARCH_START_DELAY_RX_SOUNDING_ENABLE_LSB 14 -#define BB_SEARCH_START_DELAY_RX_SOUNDING_ENABLE_MASK 0x00004000 -#define BB_SEARCH_START_DELAY_RX_SOUNDING_ENABLE_GET(x) (((x) & 0x00004000) >> 14) -#define BB_SEARCH_START_DELAY_RX_SOUNDING_ENABLE_SET(x) (((x) << 14) & 0x00004000) -#define BB_SEARCH_START_DELAY_RM_HCSD4SVD_MSB 15 -#define BB_SEARCH_START_DELAY_RM_HCSD4SVD_LSB 15 -#define BB_SEARCH_START_DELAY_RM_HCSD4SVD_MASK 0x00008000 -#define BB_SEARCH_START_DELAY_RM_HCSD4SVD_GET(x) (((x) & 0x00008000) >> 15) -#define BB_SEARCH_START_DELAY_RM_HCSD4SVD_SET(x) (((x) << 15) & 0x00008000) - -/* macros for bb_sm_reg_map.BB_max_rx_length */ -#define BB_MAX_RX_LENGTH_ADDRESS 0x00000034 -#define BB_MAX_RX_LENGTH_OFFSET 0x00000034 -#define BB_MAX_RX_LENGTH_MAX_RX_LENGTH_MSB 11 -#define BB_MAX_RX_LENGTH_MAX_RX_LENGTH_LSB 0 -#define BB_MAX_RX_LENGTH_MAX_RX_LENGTH_MASK 0x00000fff -#define BB_MAX_RX_LENGTH_MAX_RX_LENGTH_GET(x) (((x) & 0x00000fff) >> 0) -#define BB_MAX_RX_LENGTH_MAX_RX_LENGTH_SET(x) (((x) << 0) & 0x00000fff) -#define BB_MAX_RX_LENGTH_MAX_HT_LENGTH_MSB 29 -#define BB_MAX_RX_LENGTH_MAX_HT_LENGTH_LSB 12 -#define BB_MAX_RX_LENGTH_MAX_HT_LENGTH_MASK 0x3ffff000 -#define BB_MAX_RX_LENGTH_MAX_HT_LENGTH_GET(x) (((x) & 0x3ffff000) >> 12) -#define BB_MAX_RX_LENGTH_MAX_HT_LENGTH_SET(x) (((x) << 12) & 0x3ffff000) - -/* macros for bb_sm_reg_map.BB_frame_control */ -#define BB_FRAME_CONTROL_ADDRESS 0x00000038 -#define BB_FRAME_CONTROL_OFFSET 0x00000038 -#define BB_FRAME_CONTROL_CF_OVERLAP_WINDOW_MSB 1 -#define BB_FRAME_CONTROL_CF_OVERLAP_WINDOW_LSB 0 -#define BB_FRAME_CONTROL_CF_OVERLAP_WINDOW_MASK 0x00000003 -#define BB_FRAME_CONTROL_CF_OVERLAP_WINDOW_GET(x) (((x) & 0x00000003) >> 0) -#define BB_FRAME_CONTROL_CF_OVERLAP_WINDOW_SET(x) (((x) << 0) & 0x00000003) -#define BB_FRAME_CONTROL_CF_SCALE_SHORT_MSB 2 -#define BB_FRAME_CONTROL_CF_SCALE_SHORT_LSB 2 -#define BB_FRAME_CONTROL_CF_SCALE_SHORT_MASK 0x00000004 -#define BB_FRAME_CONTROL_CF_SCALE_SHORT_GET(x) (((x) & 0x00000004) >> 2) -#define BB_FRAME_CONTROL_CF_SCALE_SHORT_SET(x) (((x) << 2) & 0x00000004) -#define BB_FRAME_CONTROL_CF_TX_CLIP_MSB 5 -#define BB_FRAME_CONTROL_CF_TX_CLIP_LSB 3 -#define BB_FRAME_CONTROL_CF_TX_CLIP_MASK 0x00000038 -#define BB_FRAME_CONTROL_CF_TX_CLIP_GET(x) (((x) & 0x00000038) >> 3) -#define BB_FRAME_CONTROL_CF_TX_CLIP_SET(x) (((x) << 3) & 0x00000038) -#define BB_FRAME_CONTROL_CF_TX_DOUBLESAMP_DAC_MSB 7 -#define BB_FRAME_CONTROL_CF_TX_DOUBLESAMP_DAC_LSB 6 -#define BB_FRAME_CONTROL_CF_TX_DOUBLESAMP_DAC_MASK 0x000000c0 -#define BB_FRAME_CONTROL_CF_TX_DOUBLESAMP_DAC_GET(x) (((x) & 0x000000c0) >> 6) -#define BB_FRAME_CONTROL_CF_TX_DOUBLESAMP_DAC_SET(x) (((x) << 6) & 0x000000c0) -#define BB_FRAME_CONTROL_TX_END_ADJUST_MSB 15 -#define BB_FRAME_CONTROL_TX_END_ADJUST_LSB 8 -#define BB_FRAME_CONTROL_TX_END_ADJUST_MASK 0x0000ff00 -#define BB_FRAME_CONTROL_TX_END_ADJUST_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_FRAME_CONTROL_TX_END_ADJUST_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_FRAME_CONTROL_PREPEND_CHAN_INFO_MSB 16 -#define BB_FRAME_CONTROL_PREPEND_CHAN_INFO_LSB 16 -#define BB_FRAME_CONTROL_PREPEND_CHAN_INFO_MASK 0x00010000 -#define BB_FRAME_CONTROL_PREPEND_CHAN_INFO_GET(x) (((x) & 0x00010000) >> 16) -#define BB_FRAME_CONTROL_PREPEND_CHAN_INFO_SET(x) (((x) << 16) & 0x00010000) -#define BB_FRAME_CONTROL_SHORT_HIGH_PAR_NORM_MSB 17 -#define BB_FRAME_CONTROL_SHORT_HIGH_PAR_NORM_LSB 17 -#define BB_FRAME_CONTROL_SHORT_HIGH_PAR_NORM_MASK 0x00020000 -#define BB_FRAME_CONTROL_SHORT_HIGH_PAR_NORM_GET(x) (((x) & 0x00020000) >> 17) -#define BB_FRAME_CONTROL_SHORT_HIGH_PAR_NORM_SET(x) (((x) << 17) & 0x00020000) -#define BB_FRAME_CONTROL_EN_ERR_GREEN_FIELD_MSB 18 -#define BB_FRAME_CONTROL_EN_ERR_GREEN_FIELD_LSB 18 -#define BB_FRAME_CONTROL_EN_ERR_GREEN_FIELD_MASK 0x00040000 -#define BB_FRAME_CONTROL_EN_ERR_GREEN_FIELD_GET(x) (((x) & 0x00040000) >> 18) -#define BB_FRAME_CONTROL_EN_ERR_GREEN_FIELD_SET(x) (((x) << 18) & 0x00040000) -#define BB_FRAME_CONTROL_EN_ERR_STATIC20_MODE_HT40_PACKET_MSB 19 -#define BB_FRAME_CONTROL_EN_ERR_STATIC20_MODE_HT40_PACKET_LSB 19 -#define BB_FRAME_CONTROL_EN_ERR_STATIC20_MODE_HT40_PACKET_MASK 0x00080000 -#define BB_FRAME_CONTROL_EN_ERR_STATIC20_MODE_HT40_PACKET_GET(x) (((x) & 0x00080000) >> 19) -#define BB_FRAME_CONTROL_EN_ERR_STATIC20_MODE_HT40_PACKET_SET(x) (((x) << 19) & 0x00080000) -#define BB_FRAME_CONTROL_EN_ERR_OFDM_XCORR_MSB 20 -#define BB_FRAME_CONTROL_EN_ERR_OFDM_XCORR_LSB 20 -#define BB_FRAME_CONTROL_EN_ERR_OFDM_XCORR_MASK 0x00100000 -#define BB_FRAME_CONTROL_EN_ERR_OFDM_XCORR_GET(x) (((x) & 0x00100000) >> 20) -#define BB_FRAME_CONTROL_EN_ERR_OFDM_XCORR_SET(x) (((x) << 20) & 0x00100000) -#define BB_FRAME_CONTROL_EN_ERR_LONG_SC_THR_MSB 21 -#define BB_FRAME_CONTROL_EN_ERR_LONG_SC_THR_LSB 21 -#define BB_FRAME_CONTROL_EN_ERR_LONG_SC_THR_MASK 0x00200000 -#define BB_FRAME_CONTROL_EN_ERR_LONG_SC_THR_GET(x) (((x) & 0x00200000) >> 21) -#define BB_FRAME_CONTROL_EN_ERR_LONG_SC_THR_SET(x) (((x) << 21) & 0x00200000) -#define BB_FRAME_CONTROL_EN_ERR_TIM_LONG1_MSB 22 -#define BB_FRAME_CONTROL_EN_ERR_TIM_LONG1_LSB 22 -#define BB_FRAME_CONTROL_EN_ERR_TIM_LONG1_MASK 0x00400000 -#define BB_FRAME_CONTROL_EN_ERR_TIM_LONG1_GET(x) (((x) & 0x00400000) >> 22) -#define BB_FRAME_CONTROL_EN_ERR_TIM_LONG1_SET(x) (((x) << 22) & 0x00400000) -#define BB_FRAME_CONTROL_EN_ERR_TIM_EARLY_TRIG_MSB 23 -#define BB_FRAME_CONTROL_EN_ERR_TIM_EARLY_TRIG_LSB 23 -#define BB_FRAME_CONTROL_EN_ERR_TIM_EARLY_TRIG_MASK 0x00800000 -#define BB_FRAME_CONTROL_EN_ERR_TIM_EARLY_TRIG_GET(x) (((x) & 0x00800000) >> 23) -#define BB_FRAME_CONTROL_EN_ERR_TIM_EARLY_TRIG_SET(x) (((x) << 23) & 0x00800000) -#define BB_FRAME_CONTROL_EN_ERR_TIM_TIMEOUT_MSB 24 -#define BB_FRAME_CONTROL_EN_ERR_TIM_TIMEOUT_LSB 24 -#define BB_FRAME_CONTROL_EN_ERR_TIM_TIMEOUT_MASK 0x01000000 -#define BB_FRAME_CONTROL_EN_ERR_TIM_TIMEOUT_GET(x) (((x) & 0x01000000) >> 24) -#define BB_FRAME_CONTROL_EN_ERR_TIM_TIMEOUT_SET(x) (((x) << 24) & 0x01000000) -#define BB_FRAME_CONTROL_EN_ERR_SIGNAL_PARITY_MSB 25 -#define BB_FRAME_CONTROL_EN_ERR_SIGNAL_PARITY_LSB 25 -#define BB_FRAME_CONTROL_EN_ERR_SIGNAL_PARITY_MASK 0x02000000 -#define BB_FRAME_CONTROL_EN_ERR_SIGNAL_PARITY_GET(x) (((x) & 0x02000000) >> 25) -#define BB_FRAME_CONTROL_EN_ERR_SIGNAL_PARITY_SET(x) (((x) << 25) & 0x02000000) -#define BB_FRAME_CONTROL_EN_ERR_RATE_ILLEGAL_MSB 26 -#define BB_FRAME_CONTROL_EN_ERR_RATE_ILLEGAL_LSB 26 -#define BB_FRAME_CONTROL_EN_ERR_RATE_ILLEGAL_MASK 0x04000000 -#define BB_FRAME_CONTROL_EN_ERR_RATE_ILLEGAL_GET(x) (((x) & 0x04000000) >> 26) -#define BB_FRAME_CONTROL_EN_ERR_RATE_ILLEGAL_SET(x) (((x) << 26) & 0x04000000) -#define BB_FRAME_CONTROL_EN_ERR_LENGTH_ILLEGAL_MSB 27 -#define BB_FRAME_CONTROL_EN_ERR_LENGTH_ILLEGAL_LSB 27 -#define BB_FRAME_CONTROL_EN_ERR_LENGTH_ILLEGAL_MASK 0x08000000 -#define BB_FRAME_CONTROL_EN_ERR_LENGTH_ILLEGAL_GET(x) (((x) & 0x08000000) >> 27) -#define BB_FRAME_CONTROL_EN_ERR_LENGTH_ILLEGAL_SET(x) (((x) << 27) & 0x08000000) -#define BB_FRAME_CONTROL_NO_6MBPS_SERVICE_ERR_MSB 28 -#define BB_FRAME_CONTROL_NO_6MBPS_SERVICE_ERR_LSB 28 -#define BB_FRAME_CONTROL_NO_6MBPS_SERVICE_ERR_MASK 0x10000000 -#define BB_FRAME_CONTROL_NO_6MBPS_SERVICE_ERR_GET(x) (((x) & 0x10000000) >> 28) -#define BB_FRAME_CONTROL_NO_6MBPS_SERVICE_ERR_SET(x) (((x) << 28) & 0x10000000) -#define BB_FRAME_CONTROL_EN_ERR_SERVICE_MSB 29 -#define BB_FRAME_CONTROL_EN_ERR_SERVICE_LSB 29 -#define BB_FRAME_CONTROL_EN_ERR_SERVICE_MASK 0x20000000 -#define BB_FRAME_CONTROL_EN_ERR_SERVICE_GET(x) (((x) & 0x20000000) >> 29) -#define BB_FRAME_CONTROL_EN_ERR_SERVICE_SET(x) (((x) << 29) & 0x20000000) -#define BB_FRAME_CONTROL_EN_ERR_TX_UNDERRUN_MSB 30 -#define BB_FRAME_CONTROL_EN_ERR_TX_UNDERRUN_LSB 30 -#define BB_FRAME_CONTROL_EN_ERR_TX_UNDERRUN_MASK 0x40000000 -#define BB_FRAME_CONTROL_EN_ERR_TX_UNDERRUN_GET(x) (((x) & 0x40000000) >> 30) -#define BB_FRAME_CONTROL_EN_ERR_TX_UNDERRUN_SET(x) (((x) << 30) & 0x40000000) -#define BB_FRAME_CONTROL_EN_ERR_RX_ABORT_MSB 31 -#define BB_FRAME_CONTROL_EN_ERR_RX_ABORT_LSB 31 -#define BB_FRAME_CONTROL_EN_ERR_RX_ABORT_MASK 0x80000000 -#define BB_FRAME_CONTROL_EN_ERR_RX_ABORT_GET(x) (((x) & 0x80000000) >> 31) -#define BB_FRAME_CONTROL_EN_ERR_RX_ABORT_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_sm_reg_map.BB_rfbus_request */ -#define BB_RFBUS_REQUEST_ADDRESS 0x0000003c -#define BB_RFBUS_REQUEST_OFFSET 0x0000003c -#define BB_RFBUS_REQUEST_RFBUS_REQUEST_MSB 0 -#define BB_RFBUS_REQUEST_RFBUS_REQUEST_LSB 0 -#define BB_RFBUS_REQUEST_RFBUS_REQUEST_MASK 0x00000001 -#define BB_RFBUS_REQUEST_RFBUS_REQUEST_GET(x) (((x) & 0x00000001) >> 0) -#define BB_RFBUS_REQUEST_RFBUS_REQUEST_SET(x) (((x) << 0) & 0x00000001) - -/* macros for bb_sm_reg_map.BB_rfbus_grant */ -#define BB_RFBUS_GRANT_ADDRESS 0x00000040 -#define BB_RFBUS_GRANT_OFFSET 0x00000040 -#define BB_RFBUS_GRANT_RFBUS_GRANT_MSB 0 -#define BB_RFBUS_GRANT_RFBUS_GRANT_LSB 0 -#define BB_RFBUS_GRANT_RFBUS_GRANT_MASK 0x00000001 -#define BB_RFBUS_GRANT_RFBUS_GRANT_GET(x) (((x) & 0x00000001) >> 0) -#define BB_RFBUS_GRANT_BT_ANT_MSB 1 -#define BB_RFBUS_GRANT_BT_ANT_LSB 1 -#define BB_RFBUS_GRANT_BT_ANT_MASK 0x00000002 -#define BB_RFBUS_GRANT_BT_ANT_GET(x) (((x) & 0x00000002) >> 1) - -/* macros for bb_sm_reg_map.BB_rifs */ -#define BB_RIFS_ADDRESS 0x00000044 -#define BB_RIFS_OFFSET 0x00000044 -#define BB_RIFS_DISABLE_FCC_FIX_MSB 25 -#define BB_RIFS_DISABLE_FCC_FIX_LSB 25 -#define BB_RIFS_DISABLE_FCC_FIX_MASK 0x02000000 -#define BB_RIFS_DISABLE_FCC_FIX_GET(x) (((x) & 0x02000000) >> 25) -#define BB_RIFS_DISABLE_FCC_FIX_SET(x) (((x) << 25) & 0x02000000) -#define BB_RIFS_ENABLE_RESET_TDOMAIN_MSB 26 -#define BB_RIFS_ENABLE_RESET_TDOMAIN_LSB 26 -#define BB_RIFS_ENABLE_RESET_TDOMAIN_MASK 0x04000000 -#define BB_RIFS_ENABLE_RESET_TDOMAIN_GET(x) (((x) & 0x04000000) >> 26) -#define BB_RIFS_ENABLE_RESET_TDOMAIN_SET(x) (((x) << 26) & 0x04000000) -#define BB_RIFS_DISABLE_FCC_FIX2_MSB 27 -#define BB_RIFS_DISABLE_FCC_FIX2_LSB 27 -#define BB_RIFS_DISABLE_FCC_FIX2_MASK 0x08000000 -#define BB_RIFS_DISABLE_FCC_FIX2_GET(x) (((x) & 0x08000000) >> 27) -#define BB_RIFS_DISABLE_FCC_FIX2_SET(x) (((x) << 27) & 0x08000000) -#define BB_RIFS_DISABLE_RIFS_CCK_FIX_MSB 28 -#define BB_RIFS_DISABLE_RIFS_CCK_FIX_LSB 28 -#define BB_RIFS_DISABLE_RIFS_CCK_FIX_MASK 0x10000000 -#define BB_RIFS_DISABLE_RIFS_CCK_FIX_GET(x) (((x) & 0x10000000) >> 28) -#define BB_RIFS_DISABLE_RIFS_CCK_FIX_SET(x) (((x) << 28) & 0x10000000) -#define BB_RIFS_DISABLE_ERROR_RESET_FIX_MSB 29 -#define BB_RIFS_DISABLE_ERROR_RESET_FIX_LSB 29 -#define BB_RIFS_DISABLE_ERROR_RESET_FIX_MASK 0x20000000 -#define BB_RIFS_DISABLE_ERROR_RESET_FIX_GET(x) (((x) & 0x20000000) >> 29) -#define BB_RIFS_DISABLE_ERROR_RESET_FIX_SET(x) (((x) << 29) & 0x20000000) -#define BB_RIFS_RADAR_USE_FDOMAIN_RESET_MSB 30 -#define BB_RIFS_RADAR_USE_FDOMAIN_RESET_LSB 30 -#define BB_RIFS_RADAR_USE_FDOMAIN_RESET_MASK 0x40000000 -#define BB_RIFS_RADAR_USE_FDOMAIN_RESET_GET(x) (((x) & 0x40000000) >> 30) -#define BB_RIFS_RADAR_USE_FDOMAIN_RESET_SET(x) (((x) << 30) & 0x40000000) - -/* macros for bb_sm_reg_map.BB_spectral_scan_2 */ -#define BB_SPECTRAL_SCAN_2_ADDRESS 0x00000048 -#define BB_SPECTRAL_SCAN_2_OFFSET 0x00000048 -#define BB_SPECTRAL_SCAN_2_SPECTRAL_SCAN_RPT_MODE_MSB 0 -#define BB_SPECTRAL_SCAN_2_SPECTRAL_SCAN_RPT_MODE_LSB 0 -#define BB_SPECTRAL_SCAN_2_SPECTRAL_SCAN_RPT_MODE_MASK 0x00000001 -#define BB_SPECTRAL_SCAN_2_SPECTRAL_SCAN_RPT_MODE_GET(x) (((x) & 0x00000001) >> 0) -#define BB_SPECTRAL_SCAN_2_SPECTRAL_SCAN_RPT_MODE_SET(x) (((x) << 0) & 0x00000001) -#define BB_SPECTRAL_SCAN_2_SPECTRAL_SCAN_NOISE_FLOOR_REF_MSB 8 -#define BB_SPECTRAL_SCAN_2_SPECTRAL_SCAN_NOISE_FLOOR_REF_LSB 1 -#define BB_SPECTRAL_SCAN_2_SPECTRAL_SCAN_NOISE_FLOOR_REF_MASK 0x000001fe -#define BB_SPECTRAL_SCAN_2_SPECTRAL_SCAN_NOISE_FLOOR_REF_GET(x) (((x) & 0x000001fe) >> 1) -#define BB_SPECTRAL_SCAN_2_SPECTRAL_SCAN_NOISE_FLOOR_REF_SET(x) (((x) << 1) & 0x000001fe) - -/* macros for bb_sm_reg_map.BB_rx_clear_delay */ -#define BB_RX_CLEAR_DELAY_ADDRESS 0x00000050 -#define BB_RX_CLEAR_DELAY_OFFSET 0x00000050 -#define BB_RX_CLEAR_DELAY_OFDM_XR_RX_CLEAR_DELAY_MSB 9 -#define BB_RX_CLEAR_DELAY_OFDM_XR_RX_CLEAR_DELAY_LSB 0 -#define BB_RX_CLEAR_DELAY_OFDM_XR_RX_CLEAR_DELAY_MASK 0x000003ff -#define BB_RX_CLEAR_DELAY_OFDM_XR_RX_CLEAR_DELAY_GET(x) (((x) & 0x000003ff) >> 0) -#define BB_RX_CLEAR_DELAY_OFDM_XR_RX_CLEAR_DELAY_SET(x) (((x) << 0) & 0x000003ff) - -/* macros for bb_sm_reg_map.BB_analog_power_on_time */ -#define BB_ANALOG_POWER_ON_TIME_ADDRESS 0x00000054 -#define BB_ANALOG_POWER_ON_TIME_OFFSET 0x00000054 -#define BB_ANALOG_POWER_ON_TIME_ACTIVE_TO_RECEIVE_MSB 13 -#define BB_ANALOG_POWER_ON_TIME_ACTIVE_TO_RECEIVE_LSB 0 -#define BB_ANALOG_POWER_ON_TIME_ACTIVE_TO_RECEIVE_MASK 0x00003fff -#define BB_ANALOG_POWER_ON_TIME_ACTIVE_TO_RECEIVE_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_ANALOG_POWER_ON_TIME_ACTIVE_TO_RECEIVE_SET(x) (((x) << 0) & 0x00003fff) - -/* macros for bb_sm_reg_map.BB_tx_timing_1 */ -#define BB_TX_TIMING_1_ADDRESS 0x00000058 -#define BB_TX_TIMING_1_OFFSET 0x00000058 -#define BB_TX_TIMING_1_TX_FRAME_TO_ADC_OFF_MSB 7 -#define BB_TX_TIMING_1_TX_FRAME_TO_ADC_OFF_LSB 0 -#define BB_TX_TIMING_1_TX_FRAME_TO_ADC_OFF_MASK 0x000000ff -#define BB_TX_TIMING_1_TX_FRAME_TO_ADC_OFF_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_TX_TIMING_1_TX_FRAME_TO_ADC_OFF_SET(x) (((x) << 0) & 0x000000ff) -#define BB_TX_TIMING_1_TX_FRAME_TO_A2_RX_OFF_MSB 15 -#define BB_TX_TIMING_1_TX_FRAME_TO_A2_RX_OFF_LSB 8 -#define BB_TX_TIMING_1_TX_FRAME_TO_A2_RX_OFF_MASK 0x0000ff00 -#define BB_TX_TIMING_1_TX_FRAME_TO_A2_RX_OFF_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_TX_TIMING_1_TX_FRAME_TO_A2_RX_OFF_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_TX_TIMING_1_TX_FRAME_TO_DAC_ON_MSB 23 -#define BB_TX_TIMING_1_TX_FRAME_TO_DAC_ON_LSB 16 -#define BB_TX_TIMING_1_TX_FRAME_TO_DAC_ON_MASK 0x00ff0000 -#define BB_TX_TIMING_1_TX_FRAME_TO_DAC_ON_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_TX_TIMING_1_TX_FRAME_TO_DAC_ON_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_TX_TIMING_1_TX_FRAME_TO_A2_TX_ON_MSB 31 -#define BB_TX_TIMING_1_TX_FRAME_TO_A2_TX_ON_LSB 24 -#define BB_TX_TIMING_1_TX_FRAME_TO_A2_TX_ON_MASK 0xff000000 -#define BB_TX_TIMING_1_TX_FRAME_TO_A2_TX_ON_GET(x) (((x) & 0xff000000) >> 24) -#define BB_TX_TIMING_1_TX_FRAME_TO_A2_TX_ON_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_sm_reg_map.BB_tx_timing_2 */ -#define BB_TX_TIMING_2_ADDRESS 0x0000005c -#define BB_TX_TIMING_2_OFFSET 0x0000005c -#define BB_TX_TIMING_2_TX_FRAME_TO_TX_D_START_MSB 7 -#define BB_TX_TIMING_2_TX_FRAME_TO_TX_D_START_LSB 0 -#define BB_TX_TIMING_2_TX_FRAME_TO_TX_D_START_MASK 0x000000ff -#define BB_TX_TIMING_2_TX_FRAME_TO_TX_D_START_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_TX_TIMING_2_TX_FRAME_TO_TX_D_START_SET(x) (((x) << 0) & 0x000000ff) -#define BB_TX_TIMING_2_TX_FRAME_TO_PA_ON_MSB 15 -#define BB_TX_TIMING_2_TX_FRAME_TO_PA_ON_LSB 8 -#define BB_TX_TIMING_2_TX_FRAME_TO_PA_ON_MASK 0x0000ff00 -#define BB_TX_TIMING_2_TX_FRAME_TO_PA_ON_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_TX_TIMING_2_TX_FRAME_TO_PA_ON_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_TX_TIMING_2_TX_END_TO_PA_OFF_MSB 23 -#define BB_TX_TIMING_2_TX_END_TO_PA_OFF_LSB 16 -#define BB_TX_TIMING_2_TX_END_TO_PA_OFF_MASK 0x00ff0000 -#define BB_TX_TIMING_2_TX_END_TO_PA_OFF_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_TX_TIMING_2_TX_END_TO_PA_OFF_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_TX_TIMING_2_TX_END_TO_A2_TX_OFF_MSB 31 -#define BB_TX_TIMING_2_TX_END_TO_A2_TX_OFF_LSB 24 -#define BB_TX_TIMING_2_TX_END_TO_A2_TX_OFF_MASK 0xff000000 -#define BB_TX_TIMING_2_TX_END_TO_A2_TX_OFF_GET(x) (((x) & 0xff000000) >> 24) -#define BB_TX_TIMING_2_TX_END_TO_A2_TX_OFF_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_sm_reg_map.BB_tx_timing_3 */ -#define BB_TX_TIMING_3_ADDRESS 0x00000060 -#define BB_TX_TIMING_3_OFFSET 0x00000060 -#define BB_TX_TIMING_3_TX_END_TO_DAC_OFF_MSB 7 -#define BB_TX_TIMING_3_TX_END_TO_DAC_OFF_LSB 0 -#define BB_TX_TIMING_3_TX_END_TO_DAC_OFF_MASK 0x000000ff -#define BB_TX_TIMING_3_TX_END_TO_DAC_OFF_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_TX_TIMING_3_TX_END_TO_DAC_OFF_SET(x) (((x) << 0) & 0x000000ff) -#define BB_TX_TIMING_3_TX_FRAME_TO_THERM_CHAIN_ON_MSB 15 -#define BB_TX_TIMING_3_TX_FRAME_TO_THERM_CHAIN_ON_LSB 8 -#define BB_TX_TIMING_3_TX_FRAME_TO_THERM_CHAIN_ON_MASK 0x0000ff00 -#define BB_TX_TIMING_3_TX_FRAME_TO_THERM_CHAIN_ON_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_TX_TIMING_3_TX_FRAME_TO_THERM_CHAIN_ON_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_TX_TIMING_3_TX_END_TO_A2_RX_ON_MSB 23 -#define BB_TX_TIMING_3_TX_END_TO_A2_RX_ON_LSB 16 -#define BB_TX_TIMING_3_TX_END_TO_A2_RX_ON_MASK 0x00ff0000 -#define BB_TX_TIMING_3_TX_END_TO_A2_RX_ON_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_TX_TIMING_3_TX_END_TO_A2_RX_ON_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_TX_TIMING_3_TX_END_TO_ADC_ON_MSB 31 -#define BB_TX_TIMING_3_TX_END_TO_ADC_ON_LSB 24 -#define BB_TX_TIMING_3_TX_END_TO_ADC_ON_MASK 0xff000000 -#define BB_TX_TIMING_3_TX_END_TO_ADC_ON_GET(x) (((x) & 0xff000000) >> 24) -#define BB_TX_TIMING_3_TX_END_TO_ADC_ON_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_sm_reg_map.BB_xpa_timing_control */ -#define BB_XPA_TIMING_CONTROL_ADDRESS 0x00000064 -#define BB_XPA_TIMING_CONTROL_OFFSET 0x00000064 -#define BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAA_ON_MSB 7 -#define BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAA_ON_LSB 0 -#define BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAA_ON_MASK 0x000000ff -#define BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAA_ON_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAA_ON_SET(x) (((x) << 0) & 0x000000ff) -#define BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAB_ON_MSB 15 -#define BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAB_ON_LSB 8 -#define BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAB_ON_MASK 0x0000ff00 -#define BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAB_ON_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_XPA_TIMING_CONTROL_TX_FRAME_TO_XPAB_ON_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_XPA_TIMING_CONTROL_TX_END_TO_XPAA_OFF_MSB 23 -#define BB_XPA_TIMING_CONTROL_TX_END_TO_XPAA_OFF_LSB 16 -#define BB_XPA_TIMING_CONTROL_TX_END_TO_XPAA_OFF_MASK 0x00ff0000 -#define BB_XPA_TIMING_CONTROL_TX_END_TO_XPAA_OFF_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_XPA_TIMING_CONTROL_TX_END_TO_XPAA_OFF_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_XPA_TIMING_CONTROL_TX_END_TO_XPAB_OFF_MSB 31 -#define BB_XPA_TIMING_CONTROL_TX_END_TO_XPAB_OFF_LSB 24 -#define BB_XPA_TIMING_CONTROL_TX_END_TO_XPAB_OFF_MASK 0xff000000 -#define BB_XPA_TIMING_CONTROL_TX_END_TO_XPAB_OFF_GET(x) (((x) & 0xff000000) >> 24) -#define BB_XPA_TIMING_CONTROL_TX_END_TO_XPAB_OFF_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_sm_reg_map.BB_misc_pa_control */ -#define BB_MISC_PA_CONTROL_ADDRESS 0x00000080 -#define BB_MISC_PA_CONTROL_OFFSET 0x00000080 -#define BB_MISC_PA_CONTROL_XPAA_ACTIVE_HIGH_MSB 0 -#define BB_MISC_PA_CONTROL_XPAA_ACTIVE_HIGH_LSB 0 -#define BB_MISC_PA_CONTROL_XPAA_ACTIVE_HIGH_MASK 0x00000001 -#define BB_MISC_PA_CONTROL_XPAA_ACTIVE_HIGH_GET(x) (((x) & 0x00000001) >> 0) -#define BB_MISC_PA_CONTROL_XPAA_ACTIVE_HIGH_SET(x) (((x) << 0) & 0x00000001) -#define BB_MISC_PA_CONTROL_XPAB_ACTIVE_HIGH_MSB 1 -#define BB_MISC_PA_CONTROL_XPAB_ACTIVE_HIGH_LSB 1 -#define BB_MISC_PA_CONTROL_XPAB_ACTIVE_HIGH_MASK 0x00000002 -#define BB_MISC_PA_CONTROL_XPAB_ACTIVE_HIGH_GET(x) (((x) & 0x00000002) >> 1) -#define BB_MISC_PA_CONTROL_XPAB_ACTIVE_HIGH_SET(x) (((x) << 1) & 0x00000002) -#define BB_MISC_PA_CONTROL_ENABLE_XPAA_MSB 2 -#define BB_MISC_PA_CONTROL_ENABLE_XPAA_LSB 2 -#define BB_MISC_PA_CONTROL_ENABLE_XPAA_MASK 0x00000004 -#define BB_MISC_PA_CONTROL_ENABLE_XPAA_GET(x) (((x) & 0x00000004) >> 2) -#define BB_MISC_PA_CONTROL_ENABLE_XPAA_SET(x) (((x) << 2) & 0x00000004) -#define BB_MISC_PA_CONTROL_ENABLE_XPAB_MSB 3 -#define BB_MISC_PA_CONTROL_ENABLE_XPAB_LSB 3 -#define BB_MISC_PA_CONTROL_ENABLE_XPAB_MASK 0x00000008 -#define BB_MISC_PA_CONTROL_ENABLE_XPAB_GET(x) (((x) & 0x00000008) >> 3) -#define BB_MISC_PA_CONTROL_ENABLE_XPAB_SET(x) (((x) << 3) & 0x00000008) - -/* macros for bb_sm_reg_map.BB_switch_table_chn_b0 */ -#define BB_SWITCH_TABLE_CHN_B0_ADDRESS 0x00000084 -#define BB_SWITCH_TABLE_CHN_B0_OFFSET 0x00000084 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_IDLE_0_MSB 1 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_IDLE_0_LSB 0 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_IDLE_0_MASK 0x00000003 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_IDLE_0_GET(x) (((x) & 0x00000003) >> 0) -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_IDLE_0_SET(x) (((x) << 0) & 0x00000003) -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_T_0_MSB 3 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_T_0_LSB 2 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_T_0_MASK 0x0000000c -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_T_0_GET(x) (((x) & 0x0000000c) >> 2) -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_T_0_SET(x) (((x) << 2) & 0x0000000c) -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_R_0_MSB 5 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_R_0_LSB 4 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_R_0_MASK 0x00000030 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_R_0_GET(x) (((x) & 0x00000030) >> 4) -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_R_0_SET(x) (((x) << 4) & 0x00000030) -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX1_0_MSB 7 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX1_0_LSB 6 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX1_0_MASK 0x000000c0 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX1_0_GET(x) (((x) & 0x000000c0) >> 6) -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX1_0_SET(x) (((x) << 6) & 0x000000c0) -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX12_0_MSB 9 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX12_0_LSB 8 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX12_0_MASK 0x00000300 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX12_0_GET(x) (((x) & 0x00000300) >> 8) -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_RX12_0_SET(x) (((x) << 8) & 0x00000300) -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_B_0_MSB 11 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_B_0_LSB 10 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_B_0_MASK 0x00000c00 -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_B_0_GET(x) (((x) & 0x00000c00) >> 10) -#define BB_SWITCH_TABLE_CHN_B0_SWITCH_TABLE_B_0_SET(x) (((x) << 10) & 0x00000c00) - -/* macros for bb_sm_reg_map.BB_switch_table_com1 */ -#define BB_SWITCH_TABLE_COM1_ADDRESS 0x00000088 -#define BB_SWITCH_TABLE_COM1_OFFSET 0x00000088 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_IDLE_MSB 3 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_IDLE_LSB 0 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_IDLE_MASK 0x0000000f -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_IDLE_GET(x) (((x) & 0x0000000f) >> 0) -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_IDLE_SET(x) (((x) << 0) & 0x0000000f) -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T1_MSB 7 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T1_LSB 4 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T1_MASK 0x000000f0 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T1_GET(x) (((x) & 0x000000f0) >> 4) -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T1_SET(x) (((x) << 4) & 0x000000f0) -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T2_MSB 11 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T2_LSB 8 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T2_MASK 0x00000f00 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T2_GET(x) (((x) & 0x00000f00) >> 8) -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_T2_SET(x) (((x) << 8) & 0x00000f00) -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_B_MSB 15 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_B_LSB 12 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_B_MASK 0x0000f000 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_B_GET(x) (((x) & 0x0000f000) >> 12) -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_B_SET(x) (((x) << 12) & 0x0000f000) -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_IDLE_ALT_MSB 19 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_IDLE_ALT_LSB 16 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_IDLE_ALT_MASK 0x000f0000 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_IDLE_ALT_GET(x) (((x) & 0x000f0000) >> 16) -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_IDLE_ALT_SET(x) (((x) << 16) & 0x000f0000) -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_SPDT_MSB 23 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_SPDT_LSB 20 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_SPDT_MASK 0x00f00000 -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_SPDT_GET(x) (((x) & 0x00f00000) >> 20) -#define BB_SWITCH_TABLE_COM1_SWITCH_TABLE_COM_SPDT_SET(x) (((x) << 20) & 0x00f00000) - -/* macros for bb_sm_reg_map.BB_switch_table_com2 */ -#define BB_SWITCH_TABLE_COM2_ADDRESS 0x0000008c -#define BB_SWITCH_TABLE_COM2_OFFSET 0x0000008c -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1L1_MSB 3 -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1L1_LSB 0 -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1L1_MASK 0x0000000f -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1L1_GET(x) (((x) & 0x0000000f) >> 0) -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1L1_SET(x) (((x) << 0) & 0x0000000f) -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2L1_MSB 7 -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2L1_LSB 4 -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2L1_MASK 0x000000f0 -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2L1_GET(x) (((x) & 0x000000f0) >> 4) -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2L1_SET(x) (((x) << 4) & 0x000000f0) -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1L2_MSB 11 -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1L2_LSB 8 -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1L2_MASK 0x00000f00 -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1L2_GET(x) (((x) & 0x00000f00) >> 8) -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA1L2_SET(x) (((x) << 8) & 0x00000f00) -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2L2_MSB 15 -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2L2_LSB 12 -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2L2_MASK 0x0000f000 -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2L2_GET(x) (((x) & 0x0000f000) >> 12) -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA2L2_SET(x) (((x) << 12) & 0x0000f000) -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA12_MSB 19 -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA12_LSB 16 -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA12_MASK 0x000f0000 -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA12_GET(x) (((x) & 0x000f0000) >> 16) -#define BB_SWITCH_TABLE_COM2_SWITCH_TABLE_COM_RA12_SET(x) (((x) << 16) & 0x000f0000) - -/* macros for bb_sm_reg_map.BB_multichain_enable */ -#define BB_MULTICHAIN_ENABLE_ADDRESS 0x000000a0 -#define BB_MULTICHAIN_ENABLE_OFFSET 0x000000a0 -#define BB_MULTICHAIN_ENABLE_RX_CHAIN_MASK_MSB 2 -#define BB_MULTICHAIN_ENABLE_RX_CHAIN_MASK_LSB 0 -#define BB_MULTICHAIN_ENABLE_RX_CHAIN_MASK_MASK 0x00000007 -#define BB_MULTICHAIN_ENABLE_RX_CHAIN_MASK_GET(x) (((x) & 0x00000007) >> 0) -#define BB_MULTICHAIN_ENABLE_RX_CHAIN_MASK_SET(x) (((x) << 0) & 0x00000007) - -/* macros for bb_sm_reg_map.BB_cal_chain_mask */ -#define BB_CAL_CHAIN_MASK_ADDRESS 0x000000c0 -#define BB_CAL_CHAIN_MASK_OFFSET 0x000000c0 -#define BB_CAL_CHAIN_MASK_CAL_CHAIN_MASK_MSB 2 -#define BB_CAL_CHAIN_MASK_CAL_CHAIN_MASK_LSB 0 -#define BB_CAL_CHAIN_MASK_CAL_CHAIN_MASK_MASK 0x00000007 -#define BB_CAL_CHAIN_MASK_CAL_CHAIN_MASK_GET(x) (((x) & 0x00000007) >> 0) -#define BB_CAL_CHAIN_MASK_CAL_CHAIN_MASK_SET(x) (((x) << 0) & 0x00000007) - -/* macros for bb_sm_reg_map.BB_agc_control */ -#define BB_AGC_CONTROL_ADDRESS 0x000000c4 -#define BB_AGC_CONTROL_OFFSET 0x000000c4 -#define BB_AGC_CONTROL_DO_CALIBRATE_MSB 0 -#define BB_AGC_CONTROL_DO_CALIBRATE_LSB 0 -#define BB_AGC_CONTROL_DO_CALIBRATE_MASK 0x00000001 -#define BB_AGC_CONTROL_DO_CALIBRATE_GET(x) (((x) & 0x00000001) >> 0) -#define BB_AGC_CONTROL_DO_CALIBRATE_SET(x) (((x) << 0) & 0x00000001) -#define BB_AGC_CONTROL_DO_NOISEFLOOR_MSB 1 -#define BB_AGC_CONTROL_DO_NOISEFLOOR_LSB 1 -#define BB_AGC_CONTROL_DO_NOISEFLOOR_MASK 0x00000002 -#define BB_AGC_CONTROL_DO_NOISEFLOOR_GET(x) (((x) & 0x00000002) >> 1) -#define BB_AGC_CONTROL_DO_NOISEFLOOR_SET(x) (((x) << 1) & 0x00000002) -#define BB_AGC_CONTROL_MIN_NUM_GAIN_CHANGE_MSB 5 -#define BB_AGC_CONTROL_MIN_NUM_GAIN_CHANGE_LSB 3 -#define BB_AGC_CONTROL_MIN_NUM_GAIN_CHANGE_MASK 0x00000038 -#define BB_AGC_CONTROL_MIN_NUM_GAIN_CHANGE_GET(x) (((x) & 0x00000038) >> 3) -#define BB_AGC_CONTROL_MIN_NUM_GAIN_CHANGE_SET(x) (((x) << 3) & 0x00000038) -#define BB_AGC_CONTROL_YCOK_MAX_MSB 9 -#define BB_AGC_CONTROL_YCOK_MAX_LSB 6 -#define BB_AGC_CONTROL_YCOK_MAX_MASK 0x000003c0 -#define BB_AGC_CONTROL_YCOK_MAX_GET(x) (((x) & 0x000003c0) >> 6) -#define BB_AGC_CONTROL_YCOK_MAX_SET(x) (((x) << 6) & 0x000003c0) -#define BB_AGC_CONTROL_LEAKY_BUCKET_ENABLE_MSB 10 -#define BB_AGC_CONTROL_LEAKY_BUCKET_ENABLE_LSB 10 -#define BB_AGC_CONTROL_LEAKY_BUCKET_ENABLE_MASK 0x00000400 -#define BB_AGC_CONTROL_LEAKY_BUCKET_ENABLE_GET(x) (((x) & 0x00000400) >> 10) -#define BB_AGC_CONTROL_LEAKY_BUCKET_ENABLE_SET(x) (((x) << 10) & 0x00000400) -#define BB_AGC_CONTROL_CAL_ENABLE_MSB 11 -#define BB_AGC_CONTROL_CAL_ENABLE_LSB 11 -#define BB_AGC_CONTROL_CAL_ENABLE_MASK 0x00000800 -#define BB_AGC_CONTROL_CAL_ENABLE_GET(x) (((x) & 0x00000800) >> 11) -#define BB_AGC_CONTROL_CAL_ENABLE_SET(x) (((x) << 11) & 0x00000800) -#define BB_AGC_CONTROL_USE_TABLE_SEED_MSB 12 -#define BB_AGC_CONTROL_USE_TABLE_SEED_LSB 12 -#define BB_AGC_CONTROL_USE_TABLE_SEED_MASK 0x00001000 -#define BB_AGC_CONTROL_USE_TABLE_SEED_GET(x) (((x) & 0x00001000) >> 12) -#define BB_AGC_CONTROL_USE_TABLE_SEED_SET(x) (((x) << 12) & 0x00001000) -#define BB_AGC_CONTROL_AGC_UPDATE_TABLE_SEED_MSB 13 -#define BB_AGC_CONTROL_AGC_UPDATE_TABLE_SEED_LSB 13 -#define BB_AGC_CONTROL_AGC_UPDATE_TABLE_SEED_MASK 0x00002000 -#define BB_AGC_CONTROL_AGC_UPDATE_TABLE_SEED_GET(x) (((x) & 0x00002000) >> 13) -#define BB_AGC_CONTROL_AGC_UPDATE_TABLE_SEED_SET(x) (((x) << 13) & 0x00002000) -#define BB_AGC_CONTROL_ENABLE_NOISEFLOOR_MSB 15 -#define BB_AGC_CONTROL_ENABLE_NOISEFLOOR_LSB 15 -#define BB_AGC_CONTROL_ENABLE_NOISEFLOOR_MASK 0x00008000 -#define BB_AGC_CONTROL_ENABLE_NOISEFLOOR_GET(x) (((x) & 0x00008000) >> 15) -#define BB_AGC_CONTROL_ENABLE_NOISEFLOOR_SET(x) (((x) << 15) & 0x00008000) -#define BB_AGC_CONTROL_ENABLE_FLTR_CAL_MSB 16 -#define BB_AGC_CONTROL_ENABLE_FLTR_CAL_LSB 16 -#define BB_AGC_CONTROL_ENABLE_FLTR_CAL_MASK 0x00010000 -#define BB_AGC_CONTROL_ENABLE_FLTR_CAL_GET(x) (((x) & 0x00010000) >> 16) -#define BB_AGC_CONTROL_ENABLE_FLTR_CAL_SET(x) (((x) << 16) & 0x00010000) -#define BB_AGC_CONTROL_NO_UPDATE_NOISEFLOOR_MSB 17 -#define BB_AGC_CONTROL_NO_UPDATE_NOISEFLOOR_LSB 17 -#define BB_AGC_CONTROL_NO_UPDATE_NOISEFLOOR_MASK 0x00020000 -#define BB_AGC_CONTROL_NO_UPDATE_NOISEFLOOR_GET(x) (((x) & 0x00020000) >> 17) -#define BB_AGC_CONTROL_NO_UPDATE_NOISEFLOOR_SET(x) (((x) << 17) & 0x00020000) -#define BB_AGC_CONTROL_EXTEND_NF_PWR_MEAS_MSB 18 -#define BB_AGC_CONTROL_EXTEND_NF_PWR_MEAS_LSB 18 -#define BB_AGC_CONTROL_EXTEND_NF_PWR_MEAS_MASK 0x00040000 -#define BB_AGC_CONTROL_EXTEND_NF_PWR_MEAS_GET(x) (((x) & 0x00040000) >> 18) -#define BB_AGC_CONTROL_EXTEND_NF_PWR_MEAS_SET(x) (((x) << 18) & 0x00040000) -#define BB_AGC_CONTROL_CLC_SUCCESS_MSB 19 -#define BB_AGC_CONTROL_CLC_SUCCESS_LSB 19 -#define BB_AGC_CONTROL_CLC_SUCCESS_MASK 0x00080000 -#define BB_AGC_CONTROL_CLC_SUCCESS_GET(x) (((x) & 0x00080000) >> 19) -#define BB_AGC_CONTROL_ENABLE_PKDET_CAL_MSB 20 -#define BB_AGC_CONTROL_ENABLE_PKDET_CAL_LSB 20 -#define BB_AGC_CONTROL_ENABLE_PKDET_CAL_MASK 0x00100000 -#define BB_AGC_CONTROL_ENABLE_PKDET_CAL_GET(x) (((x) & 0x00100000) >> 20) -#define BB_AGC_CONTROL_ENABLE_PKDET_CAL_SET(x) (((x) << 20) & 0x00100000) - -/* macros for bb_sm_reg_map.BB_iq_adc_cal_mode */ -#define BB_IQ_ADC_CAL_MODE_ADDRESS 0x000000c8 -#define BB_IQ_ADC_CAL_MODE_OFFSET 0x000000c8 -#define BB_IQ_ADC_CAL_MODE_GAIN_DC_IQ_CAL_MODE_MSB 1 -#define BB_IQ_ADC_CAL_MODE_GAIN_DC_IQ_CAL_MODE_LSB 0 -#define BB_IQ_ADC_CAL_MODE_GAIN_DC_IQ_CAL_MODE_MASK 0x00000003 -#define BB_IQ_ADC_CAL_MODE_GAIN_DC_IQ_CAL_MODE_GET(x) (((x) & 0x00000003) >> 0) -#define BB_IQ_ADC_CAL_MODE_GAIN_DC_IQ_CAL_MODE_SET(x) (((x) << 0) & 0x00000003) -#define BB_IQ_ADC_CAL_MODE_TEST_CALADCOFF_MSB 2 -#define BB_IQ_ADC_CAL_MODE_TEST_CALADCOFF_LSB 2 -#define BB_IQ_ADC_CAL_MODE_TEST_CALADCOFF_MASK 0x00000004 -#define BB_IQ_ADC_CAL_MODE_TEST_CALADCOFF_GET(x) (((x) & 0x00000004) >> 2) -#define BB_IQ_ADC_CAL_MODE_TEST_CALADCOFF_SET(x) (((x) << 2) & 0x00000004) - -/* macros for bb_sm_reg_map.BB_fcal_1 */ -#define BB_FCAL_1_ADDRESS 0x000000cc -#define BB_FCAL_1_OFFSET 0x000000cc -#define BB_FCAL_1_FLC_PB_FSTEP_MSB 9 -#define BB_FCAL_1_FLC_PB_FSTEP_LSB 0 -#define BB_FCAL_1_FLC_PB_FSTEP_MASK 0x000003ff -#define BB_FCAL_1_FLC_PB_FSTEP_GET(x) (((x) & 0x000003ff) >> 0) -#define BB_FCAL_1_FLC_PB_FSTEP_SET(x) (((x) << 0) & 0x000003ff) -#define BB_FCAL_1_FLC_SB_FSTEP_MSB 19 -#define BB_FCAL_1_FLC_SB_FSTEP_LSB 10 -#define BB_FCAL_1_FLC_SB_FSTEP_MASK 0x000ffc00 -#define BB_FCAL_1_FLC_SB_FSTEP_GET(x) (((x) & 0x000ffc00) >> 10) -#define BB_FCAL_1_FLC_SB_FSTEP_SET(x) (((x) << 10) & 0x000ffc00) -#define BB_FCAL_1_FLC_PB_ATTEN_MSB 24 -#define BB_FCAL_1_FLC_PB_ATTEN_LSB 20 -#define BB_FCAL_1_FLC_PB_ATTEN_MASK 0x01f00000 -#define BB_FCAL_1_FLC_PB_ATTEN_GET(x) (((x) & 0x01f00000) >> 20) -#define BB_FCAL_1_FLC_PB_ATTEN_SET(x) (((x) << 20) & 0x01f00000) -#define BB_FCAL_1_FLC_SB_ATTEN_MSB 29 -#define BB_FCAL_1_FLC_SB_ATTEN_LSB 25 -#define BB_FCAL_1_FLC_SB_ATTEN_MASK 0x3e000000 -#define BB_FCAL_1_FLC_SB_ATTEN_GET(x) (((x) & 0x3e000000) >> 25) -#define BB_FCAL_1_FLC_SB_ATTEN_SET(x) (((x) << 25) & 0x3e000000) - -/* macros for bb_sm_reg_map.BB_fcal_2_b0 */ -#define BB_FCAL_2_B0_ADDRESS 0x000000d0 -#define BB_FCAL_2_B0_OFFSET 0x000000d0 -#define BB_FCAL_2_B0_FLC_PWR_THRESH_MSB 2 -#define BB_FCAL_2_B0_FLC_PWR_THRESH_LSB 0 -#define BB_FCAL_2_B0_FLC_PWR_THRESH_MASK 0x00000007 -#define BB_FCAL_2_B0_FLC_PWR_THRESH_GET(x) (((x) & 0x00000007) >> 0) -#define BB_FCAL_2_B0_FLC_PWR_THRESH_SET(x) (((x) << 0) & 0x00000007) -#define BB_FCAL_2_B0_FLC_SW_CAP_VAL_0_MSB 7 -#define BB_FCAL_2_B0_FLC_SW_CAP_VAL_0_LSB 3 -#define BB_FCAL_2_B0_FLC_SW_CAP_VAL_0_MASK 0x000000f8 -#define BB_FCAL_2_B0_FLC_SW_CAP_VAL_0_GET(x) (((x) & 0x000000f8) >> 3) -#define BB_FCAL_2_B0_FLC_SW_CAP_VAL_0_SET(x) (((x) << 3) & 0x000000f8) -#define BB_FCAL_2_B0_FLC_BBMISCGAIN_MSB 9 -#define BB_FCAL_2_B0_FLC_BBMISCGAIN_LSB 8 -#define BB_FCAL_2_B0_FLC_BBMISCGAIN_MASK 0x00000300 -#define BB_FCAL_2_B0_FLC_BBMISCGAIN_GET(x) (((x) & 0x00000300) >> 8) -#define BB_FCAL_2_B0_FLC_BBMISCGAIN_SET(x) (((x) << 8) & 0x00000300) -#define BB_FCAL_2_B0_FLC_BB1DBGAIN_MSB 12 -#define BB_FCAL_2_B0_FLC_BB1DBGAIN_LSB 10 -#define BB_FCAL_2_B0_FLC_BB1DBGAIN_MASK 0x00001c00 -#define BB_FCAL_2_B0_FLC_BB1DBGAIN_GET(x) (((x) & 0x00001c00) >> 10) -#define BB_FCAL_2_B0_FLC_BB1DBGAIN_SET(x) (((x) << 10) & 0x00001c00) -#define BB_FCAL_2_B0_FLC_BB6DBGAIN_MSB 14 -#define BB_FCAL_2_B0_FLC_BB6DBGAIN_LSB 13 -#define BB_FCAL_2_B0_FLC_BB6DBGAIN_MASK 0x00006000 -#define BB_FCAL_2_B0_FLC_BB6DBGAIN_GET(x) (((x) & 0x00006000) >> 13) -#define BB_FCAL_2_B0_FLC_BB6DBGAIN_SET(x) (((x) << 13) & 0x00006000) -#define BB_FCAL_2_B0_FLC_SW_CAP_SET_MSB 15 -#define BB_FCAL_2_B0_FLC_SW_CAP_SET_LSB 15 -#define BB_FCAL_2_B0_FLC_SW_CAP_SET_MASK 0x00008000 -#define BB_FCAL_2_B0_FLC_SW_CAP_SET_GET(x) (((x) & 0x00008000) >> 15) -#define BB_FCAL_2_B0_FLC_SW_CAP_SET_SET(x) (((x) << 15) & 0x00008000) -#define BB_FCAL_2_B0_FLC_MEAS_WIN_MSB 18 -#define BB_FCAL_2_B0_FLC_MEAS_WIN_LSB 16 -#define BB_FCAL_2_B0_FLC_MEAS_WIN_MASK 0x00070000 -#define BB_FCAL_2_B0_FLC_MEAS_WIN_GET(x) (((x) & 0x00070000) >> 16) -#define BB_FCAL_2_B0_FLC_MEAS_WIN_SET(x) (((x) << 16) & 0x00070000) -#define BB_FCAL_2_B0_FLC_CAP_VAL_STATUS_0_MSB 24 -#define BB_FCAL_2_B0_FLC_CAP_VAL_STATUS_0_LSB 20 -#define BB_FCAL_2_B0_FLC_CAP_VAL_STATUS_0_MASK 0x01f00000 -#define BB_FCAL_2_B0_FLC_CAP_VAL_STATUS_0_GET(x) (((x) & 0x01f00000) >> 20) - -/* macros for bb_sm_reg_map.BB_dft_tone_ctrl_b0 */ -#define BB_DFT_TONE_CTRL_B0_ADDRESS 0x000000d4 -#define BB_DFT_TONE_CTRL_B0_OFFSET 0x000000d4 -#define BB_DFT_TONE_CTRL_B0_DFT_TONE_EN_0_MSB 0 -#define BB_DFT_TONE_CTRL_B0_DFT_TONE_EN_0_LSB 0 -#define BB_DFT_TONE_CTRL_B0_DFT_TONE_EN_0_MASK 0x00000001 -#define BB_DFT_TONE_CTRL_B0_DFT_TONE_EN_0_GET(x) (((x) & 0x00000001) >> 0) -#define BB_DFT_TONE_CTRL_B0_DFT_TONE_EN_0_SET(x) (((x) << 0) & 0x00000001) -#define BB_DFT_TONE_CTRL_B0_DFT_TONE_AMP_SEL_0_MSB 3 -#define BB_DFT_TONE_CTRL_B0_DFT_TONE_AMP_SEL_0_LSB 2 -#define BB_DFT_TONE_CTRL_B0_DFT_TONE_AMP_SEL_0_MASK 0x0000000c -#define BB_DFT_TONE_CTRL_B0_DFT_TONE_AMP_SEL_0_GET(x) (((x) & 0x0000000c) >> 2) -#define BB_DFT_TONE_CTRL_B0_DFT_TONE_AMP_SEL_0_SET(x) (((x) << 2) & 0x0000000c) -#define BB_DFT_TONE_CTRL_B0_DFT_TONE_FREQ_ANG_0_MSB 12 -#define BB_DFT_TONE_CTRL_B0_DFT_TONE_FREQ_ANG_0_LSB 4 -#define BB_DFT_TONE_CTRL_B0_DFT_TONE_FREQ_ANG_0_MASK 0x00001ff0 -#define BB_DFT_TONE_CTRL_B0_DFT_TONE_FREQ_ANG_0_GET(x) (((x) & 0x00001ff0) >> 4) -#define BB_DFT_TONE_CTRL_B0_DFT_TONE_FREQ_ANG_0_SET(x) (((x) << 4) & 0x00001ff0) - -/* macros for bb_sm_reg_map.BB_cl_cal_ctrl */ -#define BB_CL_CAL_CTRL_ADDRESS 0x000000d8 -#define BB_CL_CAL_CTRL_OFFSET 0x000000d8 -#define BB_CL_CAL_CTRL_ENABLE_PARALLEL_CAL_MSB 0 -#define BB_CL_CAL_CTRL_ENABLE_PARALLEL_CAL_LSB 0 -#define BB_CL_CAL_CTRL_ENABLE_PARALLEL_CAL_MASK 0x00000001 -#define BB_CL_CAL_CTRL_ENABLE_PARALLEL_CAL_GET(x) (((x) & 0x00000001) >> 0) -#define BB_CL_CAL_CTRL_ENABLE_PARALLEL_CAL_SET(x) (((x) << 0) & 0x00000001) -#define BB_CL_CAL_CTRL_ENABLE_CL_CALIBRATE_MSB 1 -#define BB_CL_CAL_CTRL_ENABLE_CL_CALIBRATE_LSB 1 -#define BB_CL_CAL_CTRL_ENABLE_CL_CALIBRATE_MASK 0x00000002 -#define BB_CL_CAL_CTRL_ENABLE_CL_CALIBRATE_GET(x) (((x) & 0x00000002) >> 1) -#define BB_CL_CAL_CTRL_ENABLE_CL_CALIBRATE_SET(x) (((x) << 1) & 0x00000002) -#define BB_CL_CAL_CTRL_CF_CLC_TEST_POINT_MSB 3 -#define BB_CL_CAL_CTRL_CF_CLC_TEST_POINT_LSB 2 -#define BB_CL_CAL_CTRL_CF_CLC_TEST_POINT_MASK 0x0000000c -#define BB_CL_CAL_CTRL_CF_CLC_TEST_POINT_GET(x) (((x) & 0x0000000c) >> 2) -#define BB_CL_CAL_CTRL_CF_CLC_TEST_POINT_SET(x) (((x) << 2) & 0x0000000c) -#define BB_CL_CAL_CTRL_CF_CLC_FORCED_PAGAIN_MSB 7 -#define BB_CL_CAL_CTRL_CF_CLC_FORCED_PAGAIN_LSB 4 -#define BB_CL_CAL_CTRL_CF_CLC_FORCED_PAGAIN_MASK 0x000000f0 -#define BB_CL_CAL_CTRL_CF_CLC_FORCED_PAGAIN_GET(x) (((x) & 0x000000f0) >> 4) -#define BB_CL_CAL_CTRL_CF_CLC_FORCED_PAGAIN_SET(x) (((x) << 4) & 0x000000f0) -#define BB_CL_CAL_CTRL_CARR_LEAK_MAX_OFFSET_MSB 15 -#define BB_CL_CAL_CTRL_CARR_LEAK_MAX_OFFSET_LSB 8 -#define BB_CL_CAL_CTRL_CARR_LEAK_MAX_OFFSET_MASK 0x0000ff00 -#define BB_CL_CAL_CTRL_CARR_LEAK_MAX_OFFSET_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_CL_CAL_CTRL_CARR_LEAK_MAX_OFFSET_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_CL_CAL_CTRL_CF_CLC_INIT_BBGAIN_MSB 21 -#define BB_CL_CAL_CTRL_CF_CLC_INIT_BBGAIN_LSB 16 -#define BB_CL_CAL_CTRL_CF_CLC_INIT_BBGAIN_MASK 0x003f0000 -#define BB_CL_CAL_CTRL_CF_CLC_INIT_BBGAIN_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_CL_CAL_CTRL_CF_CLC_INIT_BBGAIN_SET(x) (((x) << 16) & 0x003f0000) -#define BB_CL_CAL_CTRL_CF_ADC_BOUND_MSB 29 -#define BB_CL_CAL_CTRL_CF_ADC_BOUND_LSB 22 -#define BB_CL_CAL_CTRL_CF_ADC_BOUND_MASK 0x3fc00000 -#define BB_CL_CAL_CTRL_CF_ADC_BOUND_GET(x) (((x) & 0x3fc00000) >> 22) -#define BB_CL_CAL_CTRL_CF_ADC_BOUND_SET(x) (((x) << 22) & 0x3fc00000) -#define BB_CL_CAL_CTRL_USE_DAC_CL_CORRECTION_MSB 30 -#define BB_CL_CAL_CTRL_USE_DAC_CL_CORRECTION_LSB 30 -#define BB_CL_CAL_CTRL_USE_DAC_CL_CORRECTION_MASK 0x40000000 -#define BB_CL_CAL_CTRL_USE_DAC_CL_CORRECTION_GET(x) (((x) & 0x40000000) >> 30) -#define BB_CL_CAL_CTRL_USE_DAC_CL_CORRECTION_SET(x) (((x) << 30) & 0x40000000) -#define BB_CL_CAL_CTRL_CL_MAP_HW_GEN_MSB 31 -#define BB_CL_CAL_CTRL_CL_MAP_HW_GEN_LSB 31 -#define BB_CL_CAL_CTRL_CL_MAP_HW_GEN_MASK 0x80000000 -#define BB_CL_CAL_CTRL_CL_MAP_HW_GEN_GET(x) (((x) & 0x80000000) >> 31) -#define BB_CL_CAL_CTRL_CL_MAP_HW_GEN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_sm_reg_map.BB_cl_map_0_b0 */ -#define BB_CL_MAP_0_B0_ADDRESS 0x000000dc -#define BB_CL_MAP_0_B0_OFFSET 0x000000dc -#define BB_CL_MAP_0_B0_CL_MAP_0_MSB 31 -#define BB_CL_MAP_0_B0_CL_MAP_0_LSB 0 -#define BB_CL_MAP_0_B0_CL_MAP_0_MASK 0xffffffff -#define BB_CL_MAP_0_B0_CL_MAP_0_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_0_B0_CL_MAP_0_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_cl_map_1_b0 */ -#define BB_CL_MAP_1_B0_ADDRESS 0x000000e0 -#define BB_CL_MAP_1_B0_OFFSET 0x000000e0 -#define BB_CL_MAP_1_B0_CL_MAP_1_MSB 31 -#define BB_CL_MAP_1_B0_CL_MAP_1_LSB 0 -#define BB_CL_MAP_1_B0_CL_MAP_1_MASK 0xffffffff -#define BB_CL_MAP_1_B0_CL_MAP_1_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_1_B0_CL_MAP_1_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_cl_map_2_b0 */ -#define BB_CL_MAP_2_B0_ADDRESS 0x000000e4 -#define BB_CL_MAP_2_B0_OFFSET 0x000000e4 -#define BB_CL_MAP_2_B0_CL_MAP_2_MSB 31 -#define BB_CL_MAP_2_B0_CL_MAP_2_LSB 0 -#define BB_CL_MAP_2_B0_CL_MAP_2_MASK 0xffffffff -#define BB_CL_MAP_2_B0_CL_MAP_2_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_2_B0_CL_MAP_2_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_cl_map_3_b0 */ -#define BB_CL_MAP_3_B0_ADDRESS 0x000000e8 -#define BB_CL_MAP_3_B0_OFFSET 0x000000e8 -#define BB_CL_MAP_3_B0_CL_MAP_3_MSB 31 -#define BB_CL_MAP_3_B0_CL_MAP_3_LSB 0 -#define BB_CL_MAP_3_B0_CL_MAP_3_MASK 0xffffffff -#define BB_CL_MAP_3_B0_CL_MAP_3_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_3_B0_CL_MAP_3_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_cl_map_pal_0_b0 */ -#define BB_CL_MAP_PAL_0_B0_ADDRESS 0x000000ec -#define BB_CL_MAP_PAL_0_B0_OFFSET 0x000000ec -#define BB_CL_MAP_PAL_0_B0_CL_MAP_0_MSB 31 -#define BB_CL_MAP_PAL_0_B0_CL_MAP_0_LSB 0 -#define BB_CL_MAP_PAL_0_B0_CL_MAP_0_MASK 0xffffffff -#define BB_CL_MAP_PAL_0_B0_CL_MAP_0_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_PAL_0_B0_CL_MAP_0_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_cl_map_pal_1_b0 */ -#define BB_CL_MAP_PAL_1_B0_ADDRESS 0x000000f0 -#define BB_CL_MAP_PAL_1_B0_OFFSET 0x000000f0 -#define BB_CL_MAP_PAL_1_B0_CL_MAP_1_MSB 31 -#define BB_CL_MAP_PAL_1_B0_CL_MAP_1_LSB 0 -#define BB_CL_MAP_PAL_1_B0_CL_MAP_1_MASK 0xffffffff -#define BB_CL_MAP_PAL_1_B0_CL_MAP_1_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_PAL_1_B0_CL_MAP_1_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_cl_map_pal_2_b0 */ -#define BB_CL_MAP_PAL_2_B0_ADDRESS 0x000000f4 -#define BB_CL_MAP_PAL_2_B0_OFFSET 0x000000f4 -#define BB_CL_MAP_PAL_2_B0_CL_MAP_2_MSB 31 -#define BB_CL_MAP_PAL_2_B0_CL_MAP_2_LSB 0 -#define BB_CL_MAP_PAL_2_B0_CL_MAP_2_MASK 0xffffffff -#define BB_CL_MAP_PAL_2_B0_CL_MAP_2_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_PAL_2_B0_CL_MAP_2_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_cl_map_pal_3_b0 */ -#define BB_CL_MAP_PAL_3_B0_ADDRESS 0x000000f8 -#define BB_CL_MAP_PAL_3_B0_OFFSET 0x000000f8 -#define BB_CL_MAP_PAL_3_B0_CL_MAP_3_MSB 31 -#define BB_CL_MAP_PAL_3_B0_CL_MAP_3_LSB 0 -#define BB_CL_MAP_PAL_3_B0_CL_MAP_3_MASK 0xffffffff -#define BB_CL_MAP_PAL_3_B0_CL_MAP_3_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_PAL_3_B0_CL_MAP_3_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_cl_tab_b0 */ -#define BB_CL_TAB_B0_ADDRESS 0x00000100 -#define BB_CL_TAB_B0_OFFSET 0x00000100 -#define BB_CL_TAB_B0_CL_GAIN_MOD_MSB 4 -#define BB_CL_TAB_B0_CL_GAIN_MOD_LSB 0 -#define BB_CL_TAB_B0_CL_GAIN_MOD_MASK 0x0000001f -#define BB_CL_TAB_B0_CL_GAIN_MOD_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_CL_TAB_B0_CL_GAIN_MOD_SET(x) (((x) << 0) & 0x0000001f) -#define BB_CL_TAB_B0_CARR_LK_DC_ADD_Q_MSB 15 -#define BB_CL_TAB_B0_CARR_LK_DC_ADD_Q_LSB 5 -#define BB_CL_TAB_B0_CARR_LK_DC_ADD_Q_MASK 0x0000ffe0 -#define BB_CL_TAB_B0_CARR_LK_DC_ADD_Q_GET(x) (((x) & 0x0000ffe0) >> 5) -#define BB_CL_TAB_B0_CARR_LK_DC_ADD_Q_SET(x) (((x) << 5) & 0x0000ffe0) -#define BB_CL_TAB_B0_CARR_LK_DC_ADD_I_MSB 26 -#define BB_CL_TAB_B0_CARR_LK_DC_ADD_I_LSB 16 -#define BB_CL_TAB_B0_CARR_LK_DC_ADD_I_MASK 0x07ff0000 -#define BB_CL_TAB_B0_CARR_LK_DC_ADD_I_GET(x) (((x) & 0x07ff0000) >> 16) -#define BB_CL_TAB_B0_CARR_LK_DC_ADD_I_SET(x) (((x) << 16) & 0x07ff0000) -#define BB_CL_TAB_B0_BB_GAIN_MSB 30 -#define BB_CL_TAB_B0_BB_GAIN_LSB 27 -#define BB_CL_TAB_B0_BB_GAIN_MASK 0x78000000 -#define BB_CL_TAB_B0_BB_GAIN_GET(x) (((x) & 0x78000000) >> 27) -#define BB_CL_TAB_B0_BB_GAIN_SET(x) (((x) << 27) & 0x78000000) - -/* macros for bb_sm_reg_map.BB_synth_control */ -#define BB_SYNTH_CONTROL_ADDRESS 0x00000140 -#define BB_SYNTH_CONTROL_OFFSET 0x00000140 -#define BB_SYNTH_CONTROL_RFCHANFRAC_MSB 16 -#define BB_SYNTH_CONTROL_RFCHANFRAC_LSB 0 -#define BB_SYNTH_CONTROL_RFCHANFRAC_MASK 0x0001ffff -#define BB_SYNTH_CONTROL_RFCHANFRAC_GET(x) (((x) & 0x0001ffff) >> 0) -#define BB_SYNTH_CONTROL_RFCHANFRAC_SET(x) (((x) << 0) & 0x0001ffff) -#define BB_SYNTH_CONTROL_RFCHANNEL_MSB 25 -#define BB_SYNTH_CONTROL_RFCHANNEL_LSB 17 -#define BB_SYNTH_CONTROL_RFCHANNEL_MASK 0x03fe0000 -#define BB_SYNTH_CONTROL_RFCHANNEL_GET(x) (((x) & 0x03fe0000) >> 17) -#define BB_SYNTH_CONTROL_RFCHANNEL_SET(x) (((x) << 17) & 0x03fe0000) -#define BB_SYNTH_CONTROL_RFAMODEREFSEL_MSB 27 -#define BB_SYNTH_CONTROL_RFAMODEREFSEL_LSB 26 -#define BB_SYNTH_CONTROL_RFAMODEREFSEL_MASK 0x0c000000 -#define BB_SYNTH_CONTROL_RFAMODEREFSEL_GET(x) (((x) & 0x0c000000) >> 26) -#define BB_SYNTH_CONTROL_RFAMODEREFSEL_SET(x) (((x) << 26) & 0x0c000000) -#define BB_SYNTH_CONTROL_RFFRACMODE_MSB 28 -#define BB_SYNTH_CONTROL_RFFRACMODE_LSB 28 -#define BB_SYNTH_CONTROL_RFFRACMODE_MASK 0x10000000 -#define BB_SYNTH_CONTROL_RFFRACMODE_GET(x) (((x) & 0x10000000) >> 28) -#define BB_SYNTH_CONTROL_RFFRACMODE_SET(x) (((x) << 28) & 0x10000000) -#define BB_SYNTH_CONTROL_RFBMODE_MSB 29 -#define BB_SYNTH_CONTROL_RFBMODE_LSB 29 -#define BB_SYNTH_CONTROL_RFBMODE_MASK 0x20000000 -#define BB_SYNTH_CONTROL_RFBMODE_GET(x) (((x) & 0x20000000) >> 29) -#define BB_SYNTH_CONTROL_RFBMODE_SET(x) (((x) << 29) & 0x20000000) -#define BB_SYNTH_CONTROL_RFSYNTH_CTRL_SSHIFT_MSB 30 -#define BB_SYNTH_CONTROL_RFSYNTH_CTRL_SSHIFT_LSB 30 -#define BB_SYNTH_CONTROL_RFSYNTH_CTRL_SSHIFT_MASK 0x40000000 -#define BB_SYNTH_CONTROL_RFSYNTH_CTRL_SSHIFT_GET(x) (((x) & 0x40000000) >> 30) -#define BB_SYNTH_CONTROL_RFSYNTH_CTRL_SSHIFT_SET(x) (((x) << 30) & 0x40000000) - -/* macros for bb_sm_reg_map.BB_addac_clk_select */ -#define BB_ADDAC_CLK_SELECT_ADDRESS 0x00000144 -#define BB_ADDAC_CLK_SELECT_OFFSET 0x00000144 -#define BB_ADDAC_CLK_SELECT_BB_DAC_CLK_SELECT_MSB 3 -#define BB_ADDAC_CLK_SELECT_BB_DAC_CLK_SELECT_LSB 1 -#define BB_ADDAC_CLK_SELECT_BB_DAC_CLK_SELECT_MASK 0x0000000e -#define BB_ADDAC_CLK_SELECT_BB_DAC_CLK_SELECT_GET(x) (((x) & 0x0000000e) >> 1) -#define BB_ADDAC_CLK_SELECT_BB_DAC_CLK_SELECT_SET(x) (((x) << 1) & 0x0000000e) -#define BB_ADDAC_CLK_SELECT_BB_ADC_CLK_SELECT_MSB 7 -#define BB_ADDAC_CLK_SELECT_BB_ADC_CLK_SELECT_LSB 4 -#define BB_ADDAC_CLK_SELECT_BB_ADC_CLK_SELECT_MASK 0x000000f0 -#define BB_ADDAC_CLK_SELECT_BB_ADC_CLK_SELECT_GET(x) (((x) & 0x000000f0) >> 4) -#define BB_ADDAC_CLK_SELECT_BB_ADC_CLK_SELECT_SET(x) (((x) << 4) & 0x000000f0) - -/* macros for bb_sm_reg_map.BB_pll_cntl */ -#define BB_PLL_CNTL_ADDRESS 0x00000148 -#define BB_PLL_CNTL_OFFSET 0x00000148 -#define BB_PLL_CNTL_BB_PLL_DIV_MSB 9 -#define BB_PLL_CNTL_BB_PLL_DIV_LSB 0 -#define BB_PLL_CNTL_BB_PLL_DIV_MASK 0x000003ff -#define BB_PLL_CNTL_BB_PLL_DIV_GET(x) (((x) & 0x000003ff) >> 0) -#define BB_PLL_CNTL_BB_PLL_DIV_SET(x) (((x) << 0) & 0x000003ff) -#define BB_PLL_CNTL_BB_PLL_REFDIV_MSB 13 -#define BB_PLL_CNTL_BB_PLL_REFDIV_LSB 10 -#define BB_PLL_CNTL_BB_PLL_REFDIV_MASK 0x00003c00 -#define BB_PLL_CNTL_BB_PLL_REFDIV_GET(x) (((x) & 0x00003c00) >> 10) -#define BB_PLL_CNTL_BB_PLL_REFDIV_SET(x) (((x) << 10) & 0x00003c00) -#define BB_PLL_CNTL_BB_PLL_CLK_SEL_MSB 15 -#define BB_PLL_CNTL_BB_PLL_CLK_SEL_LSB 14 -#define BB_PLL_CNTL_BB_PLL_CLK_SEL_MASK 0x0000c000 -#define BB_PLL_CNTL_BB_PLL_CLK_SEL_GET(x) (((x) & 0x0000c000) >> 14) -#define BB_PLL_CNTL_BB_PLL_CLK_SEL_SET(x) (((x) << 14) & 0x0000c000) -#define BB_PLL_CNTL_BB_PLLBYPASS_MSB 16 -#define BB_PLL_CNTL_BB_PLLBYPASS_LSB 16 -#define BB_PLL_CNTL_BB_PLLBYPASS_MASK 0x00010000 -#define BB_PLL_CNTL_BB_PLLBYPASS_GET(x) (((x) & 0x00010000) >> 16) -#define BB_PLL_CNTL_BB_PLLBYPASS_SET(x) (((x) << 16) & 0x00010000) -#define BB_PLL_CNTL_BB_PLL_SETTLE_TIME_MSB 27 -#define BB_PLL_CNTL_BB_PLL_SETTLE_TIME_LSB 17 -#define BB_PLL_CNTL_BB_PLL_SETTLE_TIME_MASK 0x0ffe0000 -#define BB_PLL_CNTL_BB_PLL_SETTLE_TIME_GET(x) (((x) & 0x0ffe0000) >> 17) -#define BB_PLL_CNTL_BB_PLL_SETTLE_TIME_SET(x) (((x) << 17) & 0x0ffe0000) - -/* macros for bb_sm_reg_map.BB_analog_swap */ -#define BB_ANALOG_SWAP_ADDRESS 0x0000014c -#define BB_ANALOG_SWAP_OFFSET 0x0000014c -#define BB_ANALOG_SWAP_ANALOG_RX_SWAP_CNTL_MSB 2 -#define BB_ANALOG_SWAP_ANALOG_RX_SWAP_CNTL_LSB 0 -#define BB_ANALOG_SWAP_ANALOG_RX_SWAP_CNTL_MASK 0x00000007 -#define BB_ANALOG_SWAP_ANALOG_RX_SWAP_CNTL_GET(x) (((x) & 0x00000007) >> 0) -#define BB_ANALOG_SWAP_ANALOG_RX_SWAP_CNTL_SET(x) (((x) << 0) & 0x00000007) -#define BB_ANALOG_SWAP_ANALOG_TX_SWAP_CNTL_MSB 5 -#define BB_ANALOG_SWAP_ANALOG_TX_SWAP_CNTL_LSB 3 -#define BB_ANALOG_SWAP_ANALOG_TX_SWAP_CNTL_MASK 0x00000038 -#define BB_ANALOG_SWAP_ANALOG_TX_SWAP_CNTL_GET(x) (((x) & 0x00000038) >> 3) -#define BB_ANALOG_SWAP_ANALOG_TX_SWAP_CNTL_SET(x) (((x) << 3) & 0x00000038) -#define BB_ANALOG_SWAP_SWAP_ALT_CHN_MSB 6 -#define BB_ANALOG_SWAP_SWAP_ALT_CHN_LSB 6 -#define BB_ANALOG_SWAP_SWAP_ALT_CHN_MASK 0x00000040 -#define BB_ANALOG_SWAP_SWAP_ALT_CHN_GET(x) (((x) & 0x00000040) >> 6) -#define BB_ANALOG_SWAP_SWAP_ALT_CHN_SET(x) (((x) << 6) & 0x00000040) -#define BB_ANALOG_SWAP_ANALOG_DC_DAC_POLARITY_MSB 7 -#define BB_ANALOG_SWAP_ANALOG_DC_DAC_POLARITY_LSB 7 -#define BB_ANALOG_SWAP_ANALOG_DC_DAC_POLARITY_MASK 0x00000080 -#define BB_ANALOG_SWAP_ANALOG_DC_DAC_POLARITY_GET(x) (((x) & 0x00000080) >> 7) -#define BB_ANALOG_SWAP_ANALOG_DC_DAC_POLARITY_SET(x) (((x) << 7) & 0x00000080) -#define BB_ANALOG_SWAP_ANALOG_PKDET_DAC_POLARITY_MSB 8 -#define BB_ANALOG_SWAP_ANALOG_PKDET_DAC_POLARITY_LSB 8 -#define BB_ANALOG_SWAP_ANALOG_PKDET_DAC_POLARITY_MASK 0x00000100 -#define BB_ANALOG_SWAP_ANALOG_PKDET_DAC_POLARITY_GET(x) (((x) & 0x00000100) >> 8) -#define BB_ANALOG_SWAP_ANALOG_PKDET_DAC_POLARITY_SET(x) (((x) << 8) & 0x00000100) - -/* macros for bb_sm_reg_map.BB_addac_parallel_control */ -#define BB_ADDAC_PARALLEL_CONTROL_ADDRESS 0x00000150 -#define BB_ADDAC_PARALLEL_CONTROL_OFFSET 0x00000150 -#define BB_ADDAC_PARALLEL_CONTROL_OFF_DACLPMODE_MSB 12 -#define BB_ADDAC_PARALLEL_CONTROL_OFF_DACLPMODE_LSB 12 -#define BB_ADDAC_PARALLEL_CONTROL_OFF_DACLPMODE_MASK 0x00001000 -#define BB_ADDAC_PARALLEL_CONTROL_OFF_DACLPMODE_GET(x) (((x) & 0x00001000) >> 12) -#define BB_ADDAC_PARALLEL_CONTROL_OFF_DACLPMODE_SET(x) (((x) << 12) & 0x00001000) -#define BB_ADDAC_PARALLEL_CONTROL_OFF_PWDDAC_MSB 13 -#define BB_ADDAC_PARALLEL_CONTROL_OFF_PWDDAC_LSB 13 -#define BB_ADDAC_PARALLEL_CONTROL_OFF_PWDDAC_MASK 0x00002000 -#define BB_ADDAC_PARALLEL_CONTROL_OFF_PWDDAC_GET(x) (((x) & 0x00002000) >> 13) -#define BB_ADDAC_PARALLEL_CONTROL_OFF_PWDDAC_SET(x) (((x) << 13) & 0x00002000) -#define BB_ADDAC_PARALLEL_CONTROL_OFF_PWDADC_MSB 15 -#define BB_ADDAC_PARALLEL_CONTROL_OFF_PWDADC_LSB 15 -#define BB_ADDAC_PARALLEL_CONTROL_OFF_PWDADC_MASK 0x00008000 -#define BB_ADDAC_PARALLEL_CONTROL_OFF_PWDADC_GET(x) (((x) & 0x00008000) >> 15) -#define BB_ADDAC_PARALLEL_CONTROL_OFF_PWDADC_SET(x) (((x) << 15) & 0x00008000) -#define BB_ADDAC_PARALLEL_CONTROL_ON_DACLPMODE_MSB 28 -#define BB_ADDAC_PARALLEL_CONTROL_ON_DACLPMODE_LSB 28 -#define BB_ADDAC_PARALLEL_CONTROL_ON_DACLPMODE_MASK 0x10000000 -#define BB_ADDAC_PARALLEL_CONTROL_ON_DACLPMODE_GET(x) (((x) & 0x10000000) >> 28) -#define BB_ADDAC_PARALLEL_CONTROL_ON_DACLPMODE_SET(x) (((x) << 28) & 0x10000000) -#define BB_ADDAC_PARALLEL_CONTROL_ON_PWDDAC_MSB 29 -#define BB_ADDAC_PARALLEL_CONTROL_ON_PWDDAC_LSB 29 -#define BB_ADDAC_PARALLEL_CONTROL_ON_PWDDAC_MASK 0x20000000 -#define BB_ADDAC_PARALLEL_CONTROL_ON_PWDDAC_GET(x) (((x) & 0x20000000) >> 29) -#define BB_ADDAC_PARALLEL_CONTROL_ON_PWDDAC_SET(x) (((x) << 29) & 0x20000000) -#define BB_ADDAC_PARALLEL_CONTROL_ON_PWDADC_MSB 31 -#define BB_ADDAC_PARALLEL_CONTROL_ON_PWDADC_LSB 31 -#define BB_ADDAC_PARALLEL_CONTROL_ON_PWDADC_MASK 0x80000000 -#define BB_ADDAC_PARALLEL_CONTROL_ON_PWDADC_GET(x) (((x) & 0x80000000) >> 31) -#define BB_ADDAC_PARALLEL_CONTROL_ON_PWDADC_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_sm_reg_map.BB_force_analog */ -#define BB_FORCE_ANALOG_ADDRESS 0x00000158 -#define BB_FORCE_ANALOG_OFFSET 0x00000158 -#define BB_FORCE_ANALOG_FORCE_XPAON_MSB 0 -#define BB_FORCE_ANALOG_FORCE_XPAON_LSB 0 -#define BB_FORCE_ANALOG_FORCE_XPAON_MASK 0x00000001 -#define BB_FORCE_ANALOG_FORCE_XPAON_GET(x) (((x) & 0x00000001) >> 0) -#define BB_FORCE_ANALOG_FORCE_XPAON_SET(x) (((x) << 0) & 0x00000001) -#define BB_FORCE_ANALOG_FORCED_XPAON_MSB 3 -#define BB_FORCE_ANALOG_FORCED_XPAON_LSB 1 -#define BB_FORCE_ANALOG_FORCED_XPAON_MASK 0x0000000e -#define BB_FORCE_ANALOG_FORCED_XPAON_GET(x) (((x) & 0x0000000e) >> 1) -#define BB_FORCE_ANALOG_FORCED_XPAON_SET(x) (((x) << 1) & 0x0000000e) -#define BB_FORCE_ANALOG_FORCE_PDADC_PWD_MSB 4 -#define BB_FORCE_ANALOG_FORCE_PDADC_PWD_LSB 4 -#define BB_FORCE_ANALOG_FORCE_PDADC_PWD_MASK 0x00000010 -#define BB_FORCE_ANALOG_FORCE_PDADC_PWD_GET(x) (((x) & 0x00000010) >> 4) -#define BB_FORCE_ANALOG_FORCE_PDADC_PWD_SET(x) (((x) << 4) & 0x00000010) -#define BB_FORCE_ANALOG_FORCED_PDADC_PWD_MSB 7 -#define BB_FORCE_ANALOG_FORCED_PDADC_PWD_LSB 5 -#define BB_FORCE_ANALOG_FORCED_PDADC_PWD_MASK 0x000000e0 -#define BB_FORCE_ANALOG_FORCED_PDADC_PWD_GET(x) (((x) & 0x000000e0) >> 5) -#define BB_FORCE_ANALOG_FORCED_PDADC_PWD_SET(x) (((x) << 5) & 0x000000e0) - -/* macros for bb_sm_reg_map.BB_test_controls */ -#define BB_TEST_CONTROLS_ADDRESS 0x00000160 -#define BB_TEST_CONTROLS_OFFSET 0x00000160 -#define BB_TEST_CONTROLS_CF_TSTTRIG_SEL_MSB 3 -#define BB_TEST_CONTROLS_CF_TSTTRIG_SEL_LSB 0 -#define BB_TEST_CONTROLS_CF_TSTTRIG_SEL_MASK 0x0000000f -#define BB_TEST_CONTROLS_CF_TSTTRIG_SEL_GET(x) (((x) & 0x0000000f) >> 0) -#define BB_TEST_CONTROLS_CF_TSTTRIG_SEL_SET(x) (((x) << 0) & 0x0000000f) -#define BB_TEST_CONTROLS_CF_TSTTRIG_MSB 4 -#define BB_TEST_CONTROLS_CF_TSTTRIG_LSB 4 -#define BB_TEST_CONTROLS_CF_TSTTRIG_MASK 0x00000010 -#define BB_TEST_CONTROLS_CF_TSTTRIG_GET(x) (((x) & 0x00000010) >> 4) -#define BB_TEST_CONTROLS_CF_TSTTRIG_SET(x) (((x) << 4) & 0x00000010) -#define BB_TEST_CONTROLS_CF_RFSHIFT_SEL_MSB 6 -#define BB_TEST_CONTROLS_CF_RFSHIFT_SEL_LSB 5 -#define BB_TEST_CONTROLS_CF_RFSHIFT_SEL_MASK 0x00000060 -#define BB_TEST_CONTROLS_CF_RFSHIFT_SEL_GET(x) (((x) & 0x00000060) >> 5) -#define BB_TEST_CONTROLS_CF_RFSHIFT_SEL_SET(x) (((x) << 5) & 0x00000060) -#define BB_TEST_CONTROLS_CARDBUS_MODE_MSB 9 -#define BB_TEST_CONTROLS_CARDBUS_MODE_LSB 8 -#define BB_TEST_CONTROLS_CARDBUS_MODE_MASK 0x00000300 -#define BB_TEST_CONTROLS_CARDBUS_MODE_GET(x) (((x) & 0x00000300) >> 8) -#define BB_TEST_CONTROLS_CARDBUS_MODE_SET(x) (((x) << 8) & 0x00000300) -#define BB_TEST_CONTROLS_CLKOUT_IS_CLK32_MSB 10 -#define BB_TEST_CONTROLS_CLKOUT_IS_CLK32_LSB 10 -#define BB_TEST_CONTROLS_CLKOUT_IS_CLK32_MASK 0x00000400 -#define BB_TEST_CONTROLS_CLKOUT_IS_CLK32_GET(x) (((x) & 0x00000400) >> 10) -#define BB_TEST_CONTROLS_CLKOUT_IS_CLK32_SET(x) (((x) << 10) & 0x00000400) -#define BB_TEST_CONTROLS_ENABLE_RFSILENT_BB_MSB 13 -#define BB_TEST_CONTROLS_ENABLE_RFSILENT_BB_LSB 13 -#define BB_TEST_CONTROLS_ENABLE_RFSILENT_BB_MASK 0x00002000 -#define BB_TEST_CONTROLS_ENABLE_RFSILENT_BB_GET(x) (((x) & 0x00002000) >> 13) -#define BB_TEST_CONTROLS_ENABLE_RFSILENT_BB_SET(x) (((x) << 13) & 0x00002000) -#define BB_TEST_CONTROLS_ENABLE_MINI_OBS_MSB 15 -#define BB_TEST_CONTROLS_ENABLE_MINI_OBS_LSB 15 -#define BB_TEST_CONTROLS_ENABLE_MINI_OBS_MASK 0x00008000 -#define BB_TEST_CONTROLS_ENABLE_MINI_OBS_GET(x) (((x) & 0x00008000) >> 15) -#define BB_TEST_CONTROLS_ENABLE_MINI_OBS_SET(x) (((x) << 15) & 0x00008000) -#define BB_TEST_CONTROLS_SLOW_CLK160_MSB 17 -#define BB_TEST_CONTROLS_SLOW_CLK160_LSB 17 -#define BB_TEST_CONTROLS_SLOW_CLK160_MASK 0x00020000 -#define BB_TEST_CONTROLS_SLOW_CLK160_GET(x) (((x) & 0x00020000) >> 17) -#define BB_TEST_CONTROLS_SLOW_CLK160_SET(x) (((x) << 17) & 0x00020000) -#define BB_TEST_CONTROLS_AGC_OBS_SEL_3_MSB 18 -#define BB_TEST_CONTROLS_AGC_OBS_SEL_3_LSB 18 -#define BB_TEST_CONTROLS_AGC_OBS_SEL_3_MASK 0x00040000 -#define BB_TEST_CONTROLS_AGC_OBS_SEL_3_GET(x) (((x) & 0x00040000) >> 18) -#define BB_TEST_CONTROLS_AGC_OBS_SEL_3_SET(x) (((x) << 18) & 0x00040000) -#define BB_TEST_CONTROLS_CF_BBB_OBS_SEL_MSB 22 -#define BB_TEST_CONTROLS_CF_BBB_OBS_SEL_LSB 19 -#define BB_TEST_CONTROLS_CF_BBB_OBS_SEL_MASK 0x00780000 -#define BB_TEST_CONTROLS_CF_BBB_OBS_SEL_GET(x) (((x) & 0x00780000) >> 19) -#define BB_TEST_CONTROLS_CF_BBB_OBS_SEL_SET(x) (((x) << 19) & 0x00780000) -#define BB_TEST_CONTROLS_RX_OBS_SEL_5TH_BIT_MSB 23 -#define BB_TEST_CONTROLS_RX_OBS_SEL_5TH_BIT_LSB 23 -#define BB_TEST_CONTROLS_RX_OBS_SEL_5TH_BIT_MASK 0x00800000 -#define BB_TEST_CONTROLS_RX_OBS_SEL_5TH_BIT_GET(x) (((x) & 0x00800000) >> 23) -#define BB_TEST_CONTROLS_RX_OBS_SEL_5TH_BIT_SET(x) (((x) << 23) & 0x00800000) -#define BB_TEST_CONTROLS_AGC_OBS_SEL_4_MSB 24 -#define BB_TEST_CONTROLS_AGC_OBS_SEL_4_LSB 24 -#define BB_TEST_CONTROLS_AGC_OBS_SEL_4_MASK 0x01000000 -#define BB_TEST_CONTROLS_AGC_OBS_SEL_4_GET(x) (((x) & 0x01000000) >> 24) -#define BB_TEST_CONTROLS_AGC_OBS_SEL_4_SET(x) (((x) << 24) & 0x01000000) -#define BB_TEST_CONTROLS_FORCE_AGC_CLEAR_MSB 28 -#define BB_TEST_CONTROLS_FORCE_AGC_CLEAR_LSB 28 -#define BB_TEST_CONTROLS_FORCE_AGC_CLEAR_MASK 0x10000000 -#define BB_TEST_CONTROLS_FORCE_AGC_CLEAR_GET(x) (((x) & 0x10000000) >> 28) -#define BB_TEST_CONTROLS_FORCE_AGC_CLEAR_SET(x) (((x) << 28) & 0x10000000) -#define BB_TEST_CONTROLS_TSTDAC_OUT_SEL_MSB 31 -#define BB_TEST_CONTROLS_TSTDAC_OUT_SEL_LSB 30 -#define BB_TEST_CONTROLS_TSTDAC_OUT_SEL_MASK 0xc0000000 -#define BB_TEST_CONTROLS_TSTDAC_OUT_SEL_GET(x) (((x) & 0xc0000000) >> 30) -#define BB_TEST_CONTROLS_TSTDAC_OUT_SEL_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for bb_sm_reg_map.BB_test_controls_status */ -#define BB_TEST_CONTROLS_STATUS_ADDRESS 0x00000164 -#define BB_TEST_CONTROLS_STATUS_OFFSET 0x00000164 -#define BB_TEST_CONTROLS_STATUS_CF_TSTDAC_EN_MSB 0 -#define BB_TEST_CONTROLS_STATUS_CF_TSTDAC_EN_LSB 0 -#define BB_TEST_CONTROLS_STATUS_CF_TSTDAC_EN_MASK 0x00000001 -#define BB_TEST_CONTROLS_STATUS_CF_TSTDAC_EN_GET(x) (((x) & 0x00000001) >> 0) -#define BB_TEST_CONTROLS_STATUS_CF_TSTDAC_EN_SET(x) (((x) << 0) & 0x00000001) -#define BB_TEST_CONTROLS_STATUS_CF_TX_SRC_IS_TSTDAC_MSB 1 -#define BB_TEST_CONTROLS_STATUS_CF_TX_SRC_IS_TSTDAC_LSB 1 -#define BB_TEST_CONTROLS_STATUS_CF_TX_SRC_IS_TSTDAC_MASK 0x00000002 -#define BB_TEST_CONTROLS_STATUS_CF_TX_SRC_IS_TSTDAC_GET(x) (((x) & 0x00000002) >> 1) -#define BB_TEST_CONTROLS_STATUS_CF_TX_SRC_IS_TSTDAC_SET(x) (((x) << 1) & 0x00000002) -#define BB_TEST_CONTROLS_STATUS_CF_TX_OBS_SEL_MSB 4 -#define BB_TEST_CONTROLS_STATUS_CF_TX_OBS_SEL_LSB 2 -#define BB_TEST_CONTROLS_STATUS_CF_TX_OBS_SEL_MASK 0x0000001c -#define BB_TEST_CONTROLS_STATUS_CF_TX_OBS_SEL_GET(x) (((x) & 0x0000001c) >> 2) -#define BB_TEST_CONTROLS_STATUS_CF_TX_OBS_SEL_SET(x) (((x) << 2) & 0x0000001c) -#define BB_TEST_CONTROLS_STATUS_CF_TX_OBS_MUX_SEL_MSB 6 -#define BB_TEST_CONTROLS_STATUS_CF_TX_OBS_MUX_SEL_LSB 5 -#define BB_TEST_CONTROLS_STATUS_CF_TX_OBS_MUX_SEL_MASK 0x00000060 -#define BB_TEST_CONTROLS_STATUS_CF_TX_OBS_MUX_SEL_GET(x) (((x) & 0x00000060) >> 5) -#define BB_TEST_CONTROLS_STATUS_CF_TX_OBS_MUX_SEL_SET(x) (((x) << 5) & 0x00000060) -#define BB_TEST_CONTROLS_STATUS_CF_TX_SRC_ALTERNATE_MSB 7 -#define BB_TEST_CONTROLS_STATUS_CF_TX_SRC_ALTERNATE_LSB 7 -#define BB_TEST_CONTROLS_STATUS_CF_TX_SRC_ALTERNATE_MASK 0x00000080 -#define BB_TEST_CONTROLS_STATUS_CF_TX_SRC_ALTERNATE_GET(x) (((x) & 0x00000080) >> 7) -#define BB_TEST_CONTROLS_STATUS_CF_TX_SRC_ALTERNATE_SET(x) (((x) << 7) & 0x00000080) -#define BB_TEST_CONTROLS_STATUS_CF_TSTADC_EN_MSB 8 -#define BB_TEST_CONTROLS_STATUS_CF_TSTADC_EN_LSB 8 -#define BB_TEST_CONTROLS_STATUS_CF_TSTADC_EN_MASK 0x00000100 -#define BB_TEST_CONTROLS_STATUS_CF_TSTADC_EN_GET(x) (((x) & 0x00000100) >> 8) -#define BB_TEST_CONTROLS_STATUS_CF_TSTADC_EN_SET(x) (((x) << 8) & 0x00000100) -#define BB_TEST_CONTROLS_STATUS_CF_RX_SRC_IS_TSTADC_MSB 9 -#define BB_TEST_CONTROLS_STATUS_CF_RX_SRC_IS_TSTADC_LSB 9 -#define BB_TEST_CONTROLS_STATUS_CF_RX_SRC_IS_TSTADC_MASK 0x00000200 -#define BB_TEST_CONTROLS_STATUS_CF_RX_SRC_IS_TSTADC_GET(x) (((x) & 0x00000200) >> 9) -#define BB_TEST_CONTROLS_STATUS_CF_RX_SRC_IS_TSTADC_SET(x) (((x) << 9) & 0x00000200) -#define BB_TEST_CONTROLS_STATUS_RX_OBS_SEL_MSB 13 -#define BB_TEST_CONTROLS_STATUS_RX_OBS_SEL_LSB 10 -#define BB_TEST_CONTROLS_STATUS_RX_OBS_SEL_MASK 0x00003c00 -#define BB_TEST_CONTROLS_STATUS_RX_OBS_SEL_GET(x) (((x) & 0x00003c00) >> 10) -#define BB_TEST_CONTROLS_STATUS_RX_OBS_SEL_SET(x) (((x) << 10) & 0x00003c00) -#define BB_TEST_CONTROLS_STATUS_DISABLE_A2_WARM_RESET_MSB 14 -#define BB_TEST_CONTROLS_STATUS_DISABLE_A2_WARM_RESET_LSB 14 -#define BB_TEST_CONTROLS_STATUS_DISABLE_A2_WARM_RESET_MASK 0x00004000 -#define BB_TEST_CONTROLS_STATUS_DISABLE_A2_WARM_RESET_GET(x) (((x) & 0x00004000) >> 14) -#define BB_TEST_CONTROLS_STATUS_DISABLE_A2_WARM_RESET_SET(x) (((x) << 14) & 0x00004000) -#define BB_TEST_CONTROLS_STATUS_RESET_A2_MSB 15 -#define BB_TEST_CONTROLS_STATUS_RESET_A2_LSB 15 -#define BB_TEST_CONTROLS_STATUS_RESET_A2_MASK 0x00008000 -#define BB_TEST_CONTROLS_STATUS_RESET_A2_GET(x) (((x) & 0x00008000) >> 15) -#define BB_TEST_CONTROLS_STATUS_RESET_A2_SET(x) (((x) << 15) & 0x00008000) -#define BB_TEST_CONTROLS_STATUS_AGC_OBS_SEL_MSB 18 -#define BB_TEST_CONTROLS_STATUS_AGC_OBS_SEL_LSB 16 -#define BB_TEST_CONTROLS_STATUS_AGC_OBS_SEL_MASK 0x00070000 -#define BB_TEST_CONTROLS_STATUS_AGC_OBS_SEL_GET(x) (((x) & 0x00070000) >> 16) -#define BB_TEST_CONTROLS_STATUS_AGC_OBS_SEL_SET(x) (((x) << 16) & 0x00070000) -#define BB_TEST_CONTROLS_STATUS_CF_ENABLE_FFT_DUMP_MSB 19 -#define BB_TEST_CONTROLS_STATUS_CF_ENABLE_FFT_DUMP_LSB 19 -#define BB_TEST_CONTROLS_STATUS_CF_ENABLE_FFT_DUMP_MASK 0x00080000 -#define BB_TEST_CONTROLS_STATUS_CF_ENABLE_FFT_DUMP_GET(x) (((x) & 0x00080000) >> 19) -#define BB_TEST_CONTROLS_STATUS_CF_ENABLE_FFT_DUMP_SET(x) (((x) << 19) & 0x00080000) -#define BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_IN_MSB 23 -#define BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_IN_LSB 23 -#define BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_IN_MASK 0x00800000 -#define BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_IN_GET(x) (((x) & 0x00800000) >> 23) -#define BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_IN_SET(x) (((x) << 23) & 0x00800000) -#define BB_TEST_CONTROLS_STATUS_DISABLE_AGC_TO_A2_MSB 27 -#define BB_TEST_CONTROLS_STATUS_DISABLE_AGC_TO_A2_LSB 27 -#define BB_TEST_CONTROLS_STATUS_DISABLE_AGC_TO_A2_MASK 0x08000000 -#define BB_TEST_CONTROLS_STATUS_DISABLE_AGC_TO_A2_GET(x) (((x) & 0x08000000) >> 27) -#define BB_TEST_CONTROLS_STATUS_DISABLE_AGC_TO_A2_SET(x) (((x) << 27) & 0x08000000) -#define BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_EN_MSB 28 -#define BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_EN_LSB 28 -#define BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_EN_MASK 0x10000000 -#define BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_EN_GET(x) (((x) & 0x10000000) >> 28) -#define BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_EN_SET(x) (((x) << 28) & 0x10000000) -#define BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_SEL_MSB 31 -#define BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_SEL_LSB 29 -#define BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_SEL_MASK 0xe0000000 -#define BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_SEL_GET(x) (((x) & 0xe0000000) >> 29) -#define BB_TEST_CONTROLS_STATUS_CF_DEBUGPORT_SEL_SET(x) (((x) << 29) & 0xe0000000) - -/* macros for bb_sm_reg_map.BB_tstdac */ -#define BB_TSTDAC_ADDRESS 0x00000168 -#define BB_TSTDAC_OFFSET 0x00000168 -#define BB_TSTDAC_TSTDAC_OUT_Q_MSB 9 -#define BB_TSTDAC_TSTDAC_OUT_Q_LSB 0 -#define BB_TSTDAC_TSTDAC_OUT_Q_MASK 0x000003ff -#define BB_TSTDAC_TSTDAC_OUT_Q_GET(x) (((x) & 0x000003ff) >> 0) -#define BB_TSTDAC_TSTDAC_OUT_I_MSB 19 -#define BB_TSTDAC_TSTDAC_OUT_I_LSB 10 -#define BB_TSTDAC_TSTDAC_OUT_I_MASK 0x000ffc00 -#define BB_TSTDAC_TSTDAC_OUT_I_GET(x) (((x) & 0x000ffc00) >> 10) - -/* macros for bb_sm_reg_map.BB_channel_status */ -#define BB_CHANNEL_STATUS_ADDRESS 0x0000016c -#define BB_CHANNEL_STATUS_OFFSET 0x0000016c -#define BB_CHANNEL_STATUS_BT_ACTIVE_MSB 0 -#define BB_CHANNEL_STATUS_BT_ACTIVE_LSB 0 -#define BB_CHANNEL_STATUS_BT_ACTIVE_MASK 0x00000001 -#define BB_CHANNEL_STATUS_BT_ACTIVE_GET(x) (((x) & 0x00000001) >> 0) -#define BB_CHANNEL_STATUS_RX_CLEAR_RAW_MSB 1 -#define BB_CHANNEL_STATUS_RX_CLEAR_RAW_LSB 1 -#define BB_CHANNEL_STATUS_RX_CLEAR_RAW_MASK 0x00000002 -#define BB_CHANNEL_STATUS_RX_CLEAR_RAW_GET(x) (((x) & 0x00000002) >> 1) -#define BB_CHANNEL_STATUS_RX_CLEAR_MAC_MSB 2 -#define BB_CHANNEL_STATUS_RX_CLEAR_MAC_LSB 2 -#define BB_CHANNEL_STATUS_RX_CLEAR_MAC_MASK 0x00000004 -#define BB_CHANNEL_STATUS_RX_CLEAR_MAC_GET(x) (((x) & 0x00000004) >> 2) -#define BB_CHANNEL_STATUS_RX_CLEAR_PAD_MSB 3 -#define BB_CHANNEL_STATUS_RX_CLEAR_PAD_LSB 3 -#define BB_CHANNEL_STATUS_RX_CLEAR_PAD_MASK 0x00000008 -#define BB_CHANNEL_STATUS_RX_CLEAR_PAD_GET(x) (((x) & 0x00000008) >> 3) -#define BB_CHANNEL_STATUS_BB_SW_OUT_0_MSB 5 -#define BB_CHANNEL_STATUS_BB_SW_OUT_0_LSB 4 -#define BB_CHANNEL_STATUS_BB_SW_OUT_0_MASK 0x00000030 -#define BB_CHANNEL_STATUS_BB_SW_OUT_0_GET(x) (((x) & 0x00000030) >> 4) -#define BB_CHANNEL_STATUS_BB_SW_OUT_1_MSB 7 -#define BB_CHANNEL_STATUS_BB_SW_OUT_1_LSB 6 -#define BB_CHANNEL_STATUS_BB_SW_OUT_1_MASK 0x000000c0 -#define BB_CHANNEL_STATUS_BB_SW_OUT_1_GET(x) (((x) & 0x000000c0) >> 6) -#define BB_CHANNEL_STATUS_BB_SW_OUT_2_MSB 9 -#define BB_CHANNEL_STATUS_BB_SW_OUT_2_LSB 8 -#define BB_CHANNEL_STATUS_BB_SW_OUT_2_MASK 0x00000300 -#define BB_CHANNEL_STATUS_BB_SW_OUT_2_GET(x) (((x) & 0x00000300) >> 8) -#define BB_CHANNEL_STATUS_BB_SW_COM_OUT_MSB 13 -#define BB_CHANNEL_STATUS_BB_SW_COM_OUT_LSB 10 -#define BB_CHANNEL_STATUS_BB_SW_COM_OUT_MASK 0x00003c00 -#define BB_CHANNEL_STATUS_BB_SW_COM_OUT_GET(x) (((x) & 0x00003c00) >> 10) -#define BB_CHANNEL_STATUS_ANT_DIV_CFG_USED_MSB 16 -#define BB_CHANNEL_STATUS_ANT_DIV_CFG_USED_LSB 14 -#define BB_CHANNEL_STATUS_ANT_DIV_CFG_USED_MASK 0x0001c000 -#define BB_CHANNEL_STATUS_ANT_DIV_CFG_USED_GET(x) (((x) & 0x0001c000) >> 14) - -/* macros for bb_sm_reg_map.BB_chaninfo_ctrl */ -#define BB_CHANINFO_CTRL_ADDRESS 0x00000170 -#define BB_CHANINFO_CTRL_OFFSET 0x00000170 -#define BB_CHANINFO_CTRL_CAPTURE_CHAN_INFO_MSB 0 -#define BB_CHANINFO_CTRL_CAPTURE_CHAN_INFO_LSB 0 -#define BB_CHANINFO_CTRL_CAPTURE_CHAN_INFO_MASK 0x00000001 -#define BB_CHANINFO_CTRL_CAPTURE_CHAN_INFO_GET(x) (((x) & 0x00000001) >> 0) -#define BB_CHANINFO_CTRL_CAPTURE_CHAN_INFO_SET(x) (((x) << 0) & 0x00000001) -#define BB_CHANINFO_CTRL_DISABLE_CHANINFOMEM_MSB 1 -#define BB_CHANINFO_CTRL_DISABLE_CHANINFOMEM_LSB 1 -#define BB_CHANINFO_CTRL_DISABLE_CHANINFOMEM_MASK 0x00000002 -#define BB_CHANINFO_CTRL_DISABLE_CHANINFOMEM_GET(x) (((x) & 0x00000002) >> 1) -#define BB_CHANINFO_CTRL_DISABLE_CHANINFOMEM_SET(x) (((x) << 1) & 0x00000002) -#define BB_CHANINFO_CTRL_CAPTURE_SOUNDING_PACKET_MSB 2 -#define BB_CHANINFO_CTRL_CAPTURE_SOUNDING_PACKET_LSB 2 -#define BB_CHANINFO_CTRL_CAPTURE_SOUNDING_PACKET_MASK 0x00000004 -#define BB_CHANINFO_CTRL_CAPTURE_SOUNDING_PACKET_GET(x) (((x) & 0x00000004) >> 2) -#define BB_CHANINFO_CTRL_CAPTURE_SOUNDING_PACKET_SET(x) (((x) << 2) & 0x00000004) -#define BB_CHANINFO_CTRL_CHANINFOMEM_S2_READ_MSB 3 -#define BB_CHANINFO_CTRL_CHANINFOMEM_S2_READ_LSB 3 -#define BB_CHANINFO_CTRL_CHANINFOMEM_S2_READ_MASK 0x00000008 -#define BB_CHANINFO_CTRL_CHANINFOMEM_S2_READ_GET(x) (((x) & 0x00000008) >> 3) -#define BB_CHANINFO_CTRL_CHANINFOMEM_S2_READ_SET(x) (((x) << 3) & 0x00000008) - -/* macros for bb_sm_reg_map.BB_chan_info_noise_pwr */ -#define BB_CHAN_INFO_NOISE_PWR_ADDRESS 0x00000174 -#define BB_CHAN_INFO_NOISE_PWR_OFFSET 0x00000174 -#define BB_CHAN_INFO_NOISE_PWR_NOISE_POWER_MSB 11 -#define BB_CHAN_INFO_NOISE_PWR_NOISE_POWER_LSB 0 -#define BB_CHAN_INFO_NOISE_PWR_NOISE_POWER_MASK 0x00000fff -#define BB_CHAN_INFO_NOISE_PWR_NOISE_POWER_GET(x) (((x) & 0x00000fff) >> 0) - -/* macros for bb_sm_reg_map.BB_chan_info_gain_diff */ -#define BB_CHAN_INFO_GAIN_DIFF_ADDRESS 0x00000178 -#define BB_CHAN_INFO_GAIN_DIFF_OFFSET 0x00000178 -#define BB_CHAN_INFO_GAIN_DIFF_FINE_PPM_MSB 11 -#define BB_CHAN_INFO_GAIN_DIFF_FINE_PPM_LSB 0 -#define BB_CHAN_INFO_GAIN_DIFF_FINE_PPM_MASK 0x00000fff -#define BB_CHAN_INFO_GAIN_DIFF_FINE_PPM_GET(x) (((x) & 0x00000fff) >> 0) -#define BB_CHAN_INFO_GAIN_DIFF_ANALOG_GAIN_DIFF_01_MSB 18 -#define BB_CHAN_INFO_GAIN_DIFF_ANALOG_GAIN_DIFF_01_LSB 12 -#define BB_CHAN_INFO_GAIN_DIFF_ANALOG_GAIN_DIFF_01_MASK 0x0007f000 -#define BB_CHAN_INFO_GAIN_DIFF_ANALOG_GAIN_DIFF_01_GET(x) (((x) & 0x0007f000) >> 12) - -/* macros for bb_sm_reg_map.BB_chan_info_fine_timing */ -#define BB_CHAN_INFO_FINE_TIMING_ADDRESS 0x0000017c -#define BB_CHAN_INFO_FINE_TIMING_OFFSET 0x0000017c -#define BB_CHAN_INFO_FINE_TIMING_COARSE_PPM_MSB 11 -#define BB_CHAN_INFO_FINE_TIMING_COARSE_PPM_LSB 0 -#define BB_CHAN_INFO_FINE_TIMING_COARSE_PPM_MASK 0x00000fff -#define BB_CHAN_INFO_FINE_TIMING_COARSE_PPM_GET(x) (((x) & 0x00000fff) >> 0) -#define BB_CHAN_INFO_FINE_TIMING_FINE_TIMING_MSB 21 -#define BB_CHAN_INFO_FINE_TIMING_FINE_TIMING_LSB 12 -#define BB_CHAN_INFO_FINE_TIMING_FINE_TIMING_MASK 0x003ff000 -#define BB_CHAN_INFO_FINE_TIMING_FINE_TIMING_GET(x) (((x) & 0x003ff000) >> 12) - -/* macros for bb_sm_reg_map.BB_chan_info_gain_b0 */ -#define BB_CHAN_INFO_GAIN_B0_ADDRESS 0x00000180 -#define BB_CHAN_INFO_GAIN_B0_OFFSET 0x00000180 -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RSSI_0_MSB 7 -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RSSI_0_LSB 0 -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RSSI_0_MASK 0x000000ff -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RSSI_0_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RF_GAIN_0_MSB 15 -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RF_GAIN_0_LSB 8 -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RF_GAIN_0_MASK 0x0000ff00 -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_RF_GAIN_0_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_MB_GAIN_0_MSB 22 -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_MB_GAIN_0_LSB 16 -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_MB_GAIN_0_MASK 0x007f0000 -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_MB_GAIN_0_GET(x) (((x) & 0x007f0000) >> 16) -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN1_SW_0_MSB 23 -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN1_SW_0_LSB 23 -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN1_SW_0_MASK 0x00800000 -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN1_SW_0_GET(x) (((x) & 0x00800000) >> 23) -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN2_SW_0_MSB 24 -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN2_SW_0_LSB 24 -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN2_SW_0_MASK 0x01000000 -#define BB_CHAN_INFO_GAIN_B0_CHAN_INFO_XATTEN2_SW_0_GET(x) (((x) & 0x01000000) >> 24) - -/* macros for bb_sm_reg_map.BB_sm_hist */ -#define BB_SM_HIST_ADDRESS 0x00000184 -#define BB_SM_HIST_OFFSET 0x00000184 -#define BB_SM_HIST_SM_REC_EN_MSB 0 -#define BB_SM_HIST_SM_REC_EN_LSB 0 -#define BB_SM_HIST_SM_REC_EN_MASK 0x00000001 -#define BB_SM_HIST_SM_REC_EN_GET(x) (((x) & 0x00000001) >> 0) -#define BB_SM_HIST_SM_REC_EN_SET(x) (((x) << 0) & 0x00000001) -#define BB_SM_HIST_SM_REC_MODE_MSB 1 -#define BB_SM_HIST_SM_REC_MODE_LSB 1 -#define BB_SM_HIST_SM_REC_MODE_MASK 0x00000002 -#define BB_SM_HIST_SM_REC_MODE_GET(x) (((x) & 0x00000002) >> 1) -#define BB_SM_HIST_SM_REC_MODE_SET(x) (((x) << 1) & 0x00000002) -#define BB_SM_HIST_SM_REC_TIME_RES_MSB 3 -#define BB_SM_HIST_SM_REC_TIME_RES_LSB 2 -#define BB_SM_HIST_SM_REC_TIME_RES_MASK 0x0000000c -#define BB_SM_HIST_SM_REC_TIME_RES_GET(x) (((x) & 0x0000000c) >> 2) -#define BB_SM_HIST_SM_REC_TIME_RES_SET(x) (((x) << 2) & 0x0000000c) -#define BB_SM_HIST_SM_REC_PART_EN_MSB 11 -#define BB_SM_HIST_SM_REC_PART_EN_LSB 4 -#define BB_SM_HIST_SM_REC_PART_EN_MASK 0x00000ff0 -#define BB_SM_HIST_SM_REC_PART_EN_GET(x) (((x) & 0x00000ff0) >> 4) -#define BB_SM_HIST_SM_REC_PART_EN_SET(x) (((x) << 4) & 0x00000ff0) -#define BB_SM_HIST_SM_REC_CHN_EN_MSB 14 -#define BB_SM_HIST_SM_REC_CHN_EN_LSB 12 -#define BB_SM_HIST_SM_REC_CHN_EN_MASK 0x00007000 -#define BB_SM_HIST_SM_REC_CHN_EN_GET(x) (((x) & 0x00007000) >> 12) -#define BB_SM_HIST_SM_REC_CHN_EN_SET(x) (((x) << 12) & 0x00007000) -#define BB_SM_HIST_SM_REC_DATA_NUM_MSB 18 -#define BB_SM_HIST_SM_REC_DATA_NUM_LSB 15 -#define BB_SM_HIST_SM_REC_DATA_NUM_MASK 0x00078000 -#define BB_SM_HIST_SM_REC_DATA_NUM_GET(x) (((x) & 0x00078000) >> 15) -#define BB_SM_HIST_SM_REC_DATA_NUM_SET(x) (((x) << 15) & 0x00078000) -#define BB_SM_HIST_SM_REC_AGC_SEL_MSB 19 -#define BB_SM_HIST_SM_REC_AGC_SEL_LSB 19 -#define BB_SM_HIST_SM_REC_AGC_SEL_MASK 0x00080000 -#define BB_SM_HIST_SM_REC_AGC_SEL_GET(x) (((x) & 0x00080000) >> 19) -#define BB_SM_HIST_SM_REC_AGC_SEL_SET(x) (((x) << 19) & 0x00080000) -#define BB_SM_HIST_SM_REC_MAC_TRIG_MSB 22 -#define BB_SM_HIST_SM_REC_MAC_TRIG_LSB 20 -#define BB_SM_HIST_SM_REC_MAC_TRIG_MASK 0x00700000 -#define BB_SM_HIST_SM_REC_MAC_TRIG_GET(x) (((x) & 0x00700000) >> 20) -#define BB_SM_HIST_SM_REC_MAC_TRIG_SET(x) (((x) << 20) & 0x00700000) -#define BB_SM_HIST_SM_REC_LAST_ADDR_MSB 29 -#define BB_SM_HIST_SM_REC_LAST_ADDR_LSB 24 -#define BB_SM_HIST_SM_REC_LAST_ADDR_MASK 0x3f000000 -#define BB_SM_HIST_SM_REC_LAST_ADDR_GET(x) (((x) & 0x3f000000) >> 24) - -/* macros for bb_sm_reg_map.BB_scrambler_seed */ -#define BB_SCRAMBLER_SEED_ADDRESS 0x00000190 -#define BB_SCRAMBLER_SEED_OFFSET 0x00000190 -#define BB_SCRAMBLER_SEED_FIXED_SCRAMBLER_SEED_MSB 6 -#define BB_SCRAMBLER_SEED_FIXED_SCRAMBLER_SEED_LSB 0 -#define BB_SCRAMBLER_SEED_FIXED_SCRAMBLER_SEED_MASK 0x0000007f -#define BB_SCRAMBLER_SEED_FIXED_SCRAMBLER_SEED_GET(x) (((x) & 0x0000007f) >> 0) -#define BB_SCRAMBLER_SEED_FIXED_SCRAMBLER_SEED_SET(x) (((x) << 0) & 0x0000007f) - -/* macros for bb_sm_reg_map.BB_bbb_tx_ctrl */ -#define BB_BBB_TX_CTRL_ADDRESS 0x00000194 -#define BB_BBB_TX_CTRL_OFFSET 0x00000194 -#define BB_BBB_TX_CTRL_DISABLE_SCRAMBLER_MSB 0 -#define BB_BBB_TX_CTRL_DISABLE_SCRAMBLER_LSB 0 -#define BB_BBB_TX_CTRL_DISABLE_SCRAMBLER_MASK 0x00000001 -#define BB_BBB_TX_CTRL_DISABLE_SCRAMBLER_GET(x) (((x) & 0x00000001) >> 0) -#define BB_BBB_TX_CTRL_DISABLE_SCRAMBLER_SET(x) (((x) << 0) & 0x00000001) -#define BB_BBB_TX_CTRL_USE_SCRAMBLER_SEED_MSB 1 -#define BB_BBB_TX_CTRL_USE_SCRAMBLER_SEED_LSB 1 -#define BB_BBB_TX_CTRL_USE_SCRAMBLER_SEED_MASK 0x00000002 -#define BB_BBB_TX_CTRL_USE_SCRAMBLER_SEED_GET(x) (((x) & 0x00000002) >> 1) -#define BB_BBB_TX_CTRL_USE_SCRAMBLER_SEED_SET(x) (((x) << 1) & 0x00000002) -#define BB_BBB_TX_CTRL_TX_DAC_SCALE_CCK_MSB 3 -#define BB_BBB_TX_CTRL_TX_DAC_SCALE_CCK_LSB 2 -#define BB_BBB_TX_CTRL_TX_DAC_SCALE_CCK_MASK 0x0000000c -#define BB_BBB_TX_CTRL_TX_DAC_SCALE_CCK_GET(x) (((x) & 0x0000000c) >> 2) -#define BB_BBB_TX_CTRL_TX_DAC_SCALE_CCK_SET(x) (((x) << 2) & 0x0000000c) -#define BB_BBB_TX_CTRL_TXFIR_JAPAN_CCK_MSB 4 -#define BB_BBB_TX_CTRL_TXFIR_JAPAN_CCK_LSB 4 -#define BB_BBB_TX_CTRL_TXFIR_JAPAN_CCK_MASK 0x00000010 -#define BB_BBB_TX_CTRL_TXFIR_JAPAN_CCK_GET(x) (((x) & 0x00000010) >> 4) -#define BB_BBB_TX_CTRL_TXFIR_JAPAN_CCK_SET(x) (((x) << 4) & 0x00000010) -#define BB_BBB_TX_CTRL_ALLOW_1MBPS_SHORT_MSB 5 -#define BB_BBB_TX_CTRL_ALLOW_1MBPS_SHORT_LSB 5 -#define BB_BBB_TX_CTRL_ALLOW_1MBPS_SHORT_MASK 0x00000020 -#define BB_BBB_TX_CTRL_ALLOW_1MBPS_SHORT_GET(x) (((x) & 0x00000020) >> 5) -#define BB_BBB_TX_CTRL_ALLOW_1MBPS_SHORT_SET(x) (((x) << 5) & 0x00000020) -#define BB_BBB_TX_CTRL_TX_CCK_DELAY_1_MSB 8 -#define BB_BBB_TX_CTRL_TX_CCK_DELAY_1_LSB 6 -#define BB_BBB_TX_CTRL_TX_CCK_DELAY_1_MASK 0x000001c0 -#define BB_BBB_TX_CTRL_TX_CCK_DELAY_1_GET(x) (((x) & 0x000001c0) >> 6) -#define BB_BBB_TX_CTRL_TX_CCK_DELAY_1_SET(x) (((x) << 6) & 0x000001c0) -#define BB_BBB_TX_CTRL_TX_CCK_DELAY_2_MSB 11 -#define BB_BBB_TX_CTRL_TX_CCK_DELAY_2_LSB 9 -#define BB_BBB_TX_CTRL_TX_CCK_DELAY_2_MASK 0x00000e00 -#define BB_BBB_TX_CTRL_TX_CCK_DELAY_2_GET(x) (((x) & 0x00000e00) >> 9) -#define BB_BBB_TX_CTRL_TX_CCK_DELAY_2_SET(x) (((x) << 9) & 0x00000e00) - -/* macros for bb_sm_reg_map.BB_bbb_txfir_0 */ -#define BB_BBB_TXFIR_0_ADDRESS 0x00000198 -#define BB_BBB_TXFIR_0_OFFSET 0x00000198 -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H0_MSB 3 -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H0_LSB 0 -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H0_MASK 0x0000000f -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H0_GET(x) (((x) & 0x0000000f) >> 0) -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H0_SET(x) (((x) << 0) & 0x0000000f) -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H1_MSB 11 -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H1_LSB 8 -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H1_MASK 0x00000f00 -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H1_GET(x) (((x) & 0x00000f00) >> 8) -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H1_SET(x) (((x) << 8) & 0x00000f00) -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H2_MSB 20 -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H2_LSB 16 -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H2_MASK 0x001f0000 -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H2_GET(x) (((x) & 0x001f0000) >> 16) -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H2_SET(x) (((x) << 16) & 0x001f0000) -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H3_MSB 28 -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H3_LSB 24 -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H3_MASK 0x1f000000 -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H3_GET(x) (((x) & 0x1f000000) >> 24) -#define BB_BBB_TXFIR_0_TXFIR_COEFF_H3_SET(x) (((x) << 24) & 0x1f000000) - -/* macros for bb_sm_reg_map.BB_bbb_txfir_1 */ -#define BB_BBB_TXFIR_1_ADDRESS 0x0000019c -#define BB_BBB_TXFIR_1_OFFSET 0x0000019c -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H4_MSB 5 -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H4_LSB 0 -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H4_MASK 0x0000003f -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H4_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H4_SET(x) (((x) << 0) & 0x0000003f) -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H5_MSB 13 -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H5_LSB 8 -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H5_MASK 0x00003f00 -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H5_GET(x) (((x) & 0x00003f00) >> 8) -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H5_SET(x) (((x) << 8) & 0x00003f00) -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H6_MSB 22 -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H6_LSB 16 -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H6_MASK 0x007f0000 -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H6_GET(x) (((x) & 0x007f0000) >> 16) -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H6_SET(x) (((x) << 16) & 0x007f0000) -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H7_MSB 30 -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H7_LSB 24 -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H7_MASK 0x7f000000 -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H7_GET(x) (((x) & 0x7f000000) >> 24) -#define BB_BBB_TXFIR_1_TXFIR_COEFF_H7_SET(x) (((x) << 24) & 0x7f000000) - -/* macros for bb_sm_reg_map.BB_bbb_txfir_2 */ -#define BB_BBB_TXFIR_2_ADDRESS 0x000001a0 -#define BB_BBB_TXFIR_2_OFFSET 0x000001a0 -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H8_MSB 7 -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H8_LSB 0 -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H8_MASK 0x000000ff -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H8_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H8_SET(x) (((x) << 0) & 0x000000ff) -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H9_MSB 15 -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H9_LSB 8 -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H9_MASK 0x0000ff00 -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H9_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H9_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H10_MSB 23 -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H10_LSB 16 -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H10_MASK 0x00ff0000 -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H10_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H10_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H11_MSB 31 -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H11_LSB 24 -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H11_MASK 0xff000000 -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H11_GET(x) (((x) & 0xff000000) >> 24) -#define BB_BBB_TXFIR_2_TXFIR_COEFF_H11_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_sm_reg_map.BB_heavy_clip_ctrl */ -#define BB_HEAVY_CLIP_CTRL_ADDRESS 0x000001a4 -#define BB_HEAVY_CLIP_CTRL_OFFSET 0x000001a4 -#define BB_HEAVY_CLIP_CTRL_CF_HEAVY_CLIP_ENABLE_MSB 8 -#define BB_HEAVY_CLIP_CTRL_CF_HEAVY_CLIP_ENABLE_LSB 0 -#define BB_HEAVY_CLIP_CTRL_CF_HEAVY_CLIP_ENABLE_MASK 0x000001ff -#define BB_HEAVY_CLIP_CTRL_CF_HEAVY_CLIP_ENABLE_GET(x) (((x) & 0x000001ff) >> 0) -#define BB_HEAVY_CLIP_CTRL_CF_HEAVY_CLIP_ENABLE_SET(x) (((x) << 0) & 0x000001ff) -#define BB_HEAVY_CLIP_CTRL_PRE_EMP_HT40_ENABLE_MSB 9 -#define BB_HEAVY_CLIP_CTRL_PRE_EMP_HT40_ENABLE_LSB 9 -#define BB_HEAVY_CLIP_CTRL_PRE_EMP_HT40_ENABLE_MASK 0x00000200 -#define BB_HEAVY_CLIP_CTRL_PRE_EMP_HT40_ENABLE_GET(x) (((x) & 0x00000200) >> 9) -#define BB_HEAVY_CLIP_CTRL_PRE_EMP_HT40_ENABLE_SET(x) (((x) << 9) & 0x00000200) -#define BB_HEAVY_CLIP_CTRL_HEAVY_CLIP_FACTOR_XR_MSB 17 -#define BB_HEAVY_CLIP_CTRL_HEAVY_CLIP_FACTOR_XR_LSB 10 -#define BB_HEAVY_CLIP_CTRL_HEAVY_CLIP_FACTOR_XR_MASK 0x0003fc00 -#define BB_HEAVY_CLIP_CTRL_HEAVY_CLIP_FACTOR_XR_GET(x) (((x) & 0x0003fc00) >> 10) -#define BB_HEAVY_CLIP_CTRL_HEAVY_CLIP_FACTOR_XR_SET(x) (((x) << 10) & 0x0003fc00) - -/* macros for bb_sm_reg_map.BB_heavy_clip_20 */ -#define BB_HEAVY_CLIP_20_ADDRESS 0x000001a8 -#define BB_HEAVY_CLIP_20_OFFSET 0x000001a8 -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_0_MSB 7 -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_0_LSB 0 -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_0_MASK 0x000000ff -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_0_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_0_SET(x) (((x) << 0) & 0x000000ff) -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_1_MSB 15 -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_1_LSB 8 -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_1_MASK 0x0000ff00 -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_1_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_1_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_2_MSB 23 -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_2_LSB 16 -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_2_MASK 0x00ff0000 -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_2_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_2_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_3_MSB 31 -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_3_LSB 24 -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_3_MASK 0xff000000 -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_3_GET(x) (((x) & 0xff000000) >> 24) -#define BB_HEAVY_CLIP_20_HEAVY_CLIP_FACTOR_3_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_sm_reg_map.BB_heavy_clip_40 */ -#define BB_HEAVY_CLIP_40_ADDRESS 0x000001ac -#define BB_HEAVY_CLIP_40_OFFSET 0x000001ac -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_4_MSB 7 -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_4_LSB 0 -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_4_MASK 0x000000ff -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_4_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_4_SET(x) (((x) << 0) & 0x000000ff) -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_5_MSB 15 -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_5_LSB 8 -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_5_MASK 0x0000ff00 -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_5_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_5_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_6_MSB 23 -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_6_LSB 16 -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_6_MASK 0x00ff0000 -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_6_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_6_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_7_MSB 31 -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_7_LSB 24 -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_7_MASK 0xff000000 -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_7_GET(x) (((x) & 0xff000000) >> 24) -#define BB_HEAVY_CLIP_40_HEAVY_CLIP_FACTOR_7_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_sm_reg_map.BB_illegal_tx_rate */ -#define BB_ILLEGAL_TX_RATE_ADDRESS 0x000001b0 -#define BB_ILLEGAL_TX_RATE_OFFSET 0x000001b0 -#define BB_ILLEGAL_TX_RATE_ILLEGAL_TX_RATE_MSB 0 -#define BB_ILLEGAL_TX_RATE_ILLEGAL_TX_RATE_LSB 0 -#define BB_ILLEGAL_TX_RATE_ILLEGAL_TX_RATE_MASK 0x00000001 -#define BB_ILLEGAL_TX_RATE_ILLEGAL_TX_RATE_GET(x) (((x) & 0x00000001) >> 0) - -/* macros for bb_sm_reg_map.BB_powertx_rate1 */ -#define BB_POWERTX_RATE1_ADDRESS 0x000001c0 -#define BB_POWERTX_RATE1_OFFSET 0x000001c0 -#define BB_POWERTX_RATE1_POWERTX_0_MSB 5 -#define BB_POWERTX_RATE1_POWERTX_0_LSB 0 -#define BB_POWERTX_RATE1_POWERTX_0_MASK 0x0000003f -#define BB_POWERTX_RATE1_POWERTX_0_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_POWERTX_RATE1_POWERTX_0_SET(x) (((x) << 0) & 0x0000003f) -#define BB_POWERTX_RATE1_POWERTX_1_MSB 13 -#define BB_POWERTX_RATE1_POWERTX_1_LSB 8 -#define BB_POWERTX_RATE1_POWERTX_1_MASK 0x00003f00 -#define BB_POWERTX_RATE1_POWERTX_1_GET(x) (((x) & 0x00003f00) >> 8) -#define BB_POWERTX_RATE1_POWERTX_1_SET(x) (((x) << 8) & 0x00003f00) -#define BB_POWERTX_RATE1_POWERTX_2_MSB 21 -#define BB_POWERTX_RATE1_POWERTX_2_LSB 16 -#define BB_POWERTX_RATE1_POWERTX_2_MASK 0x003f0000 -#define BB_POWERTX_RATE1_POWERTX_2_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_POWERTX_RATE1_POWERTX_2_SET(x) (((x) << 16) & 0x003f0000) -#define BB_POWERTX_RATE1_POWERTX_3_MSB 29 -#define BB_POWERTX_RATE1_POWERTX_3_LSB 24 -#define BB_POWERTX_RATE1_POWERTX_3_MASK 0x3f000000 -#define BB_POWERTX_RATE1_POWERTX_3_GET(x) (((x) & 0x3f000000) >> 24) -#define BB_POWERTX_RATE1_POWERTX_3_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for bb_sm_reg_map.BB_powertx_rate2 */ -#define BB_POWERTX_RATE2_ADDRESS 0x000001c4 -#define BB_POWERTX_RATE2_OFFSET 0x000001c4 -#define BB_POWERTX_RATE2_POWERTX_4_MSB 5 -#define BB_POWERTX_RATE2_POWERTX_4_LSB 0 -#define BB_POWERTX_RATE2_POWERTX_4_MASK 0x0000003f -#define BB_POWERTX_RATE2_POWERTX_4_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_POWERTX_RATE2_POWERTX_4_SET(x) (((x) << 0) & 0x0000003f) -#define BB_POWERTX_RATE2_POWERTX_5_MSB 13 -#define BB_POWERTX_RATE2_POWERTX_5_LSB 8 -#define BB_POWERTX_RATE2_POWERTX_5_MASK 0x00003f00 -#define BB_POWERTX_RATE2_POWERTX_5_GET(x) (((x) & 0x00003f00) >> 8) -#define BB_POWERTX_RATE2_POWERTX_5_SET(x) (((x) << 8) & 0x00003f00) -#define BB_POWERTX_RATE2_POWERTX_6_MSB 21 -#define BB_POWERTX_RATE2_POWERTX_6_LSB 16 -#define BB_POWERTX_RATE2_POWERTX_6_MASK 0x003f0000 -#define BB_POWERTX_RATE2_POWERTX_6_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_POWERTX_RATE2_POWERTX_6_SET(x) (((x) << 16) & 0x003f0000) -#define BB_POWERTX_RATE2_POWERTX_7_MSB 29 -#define BB_POWERTX_RATE2_POWERTX_7_LSB 24 -#define BB_POWERTX_RATE2_POWERTX_7_MASK 0x3f000000 -#define BB_POWERTX_RATE2_POWERTX_7_GET(x) (((x) & 0x3f000000) >> 24) -#define BB_POWERTX_RATE2_POWERTX_7_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for bb_sm_reg_map.BB_powertx_rate3 */ -#define BB_POWERTX_RATE3_ADDRESS 0x000001c8 -#define BB_POWERTX_RATE3_OFFSET 0x000001c8 -#define BB_POWERTX_RATE3_POWERTX_1L_MSB 5 -#define BB_POWERTX_RATE3_POWERTX_1L_LSB 0 -#define BB_POWERTX_RATE3_POWERTX_1L_MASK 0x0000003f -#define BB_POWERTX_RATE3_POWERTX_1L_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_POWERTX_RATE3_POWERTX_1L_SET(x) (((x) << 0) & 0x0000003f) -#define BB_POWERTX_RATE3_POWERTX_2L_MSB 21 -#define BB_POWERTX_RATE3_POWERTX_2L_LSB 16 -#define BB_POWERTX_RATE3_POWERTX_2L_MASK 0x003f0000 -#define BB_POWERTX_RATE3_POWERTX_2L_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_POWERTX_RATE3_POWERTX_2L_SET(x) (((x) << 16) & 0x003f0000) -#define BB_POWERTX_RATE3_POWERTX_2S_MSB 29 -#define BB_POWERTX_RATE3_POWERTX_2S_LSB 24 -#define BB_POWERTX_RATE3_POWERTX_2S_MASK 0x3f000000 -#define BB_POWERTX_RATE3_POWERTX_2S_GET(x) (((x) & 0x3f000000) >> 24) -#define BB_POWERTX_RATE3_POWERTX_2S_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for bb_sm_reg_map.BB_powertx_rate4 */ -#define BB_POWERTX_RATE4_ADDRESS 0x000001cc -#define BB_POWERTX_RATE4_OFFSET 0x000001cc -#define BB_POWERTX_RATE4_POWERTX_55L_MSB 5 -#define BB_POWERTX_RATE4_POWERTX_55L_LSB 0 -#define BB_POWERTX_RATE4_POWERTX_55L_MASK 0x0000003f -#define BB_POWERTX_RATE4_POWERTX_55L_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_POWERTX_RATE4_POWERTX_55L_SET(x) (((x) << 0) & 0x0000003f) -#define BB_POWERTX_RATE4_POWERTX_55S_MSB 13 -#define BB_POWERTX_RATE4_POWERTX_55S_LSB 8 -#define BB_POWERTX_RATE4_POWERTX_55S_MASK 0x00003f00 -#define BB_POWERTX_RATE4_POWERTX_55S_GET(x) (((x) & 0x00003f00) >> 8) -#define BB_POWERTX_RATE4_POWERTX_55S_SET(x) (((x) << 8) & 0x00003f00) -#define BB_POWERTX_RATE4_POWERTX_11L_MSB 21 -#define BB_POWERTX_RATE4_POWERTX_11L_LSB 16 -#define BB_POWERTX_RATE4_POWERTX_11L_MASK 0x003f0000 -#define BB_POWERTX_RATE4_POWERTX_11L_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_POWERTX_RATE4_POWERTX_11L_SET(x) (((x) << 16) & 0x003f0000) -#define BB_POWERTX_RATE4_POWERTX_11S_MSB 29 -#define BB_POWERTX_RATE4_POWERTX_11S_LSB 24 -#define BB_POWERTX_RATE4_POWERTX_11S_MASK 0x3f000000 -#define BB_POWERTX_RATE4_POWERTX_11S_GET(x) (((x) & 0x3f000000) >> 24) -#define BB_POWERTX_RATE4_POWERTX_11S_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for bb_sm_reg_map.BB_powertx_rate5 */ -#define BB_POWERTX_RATE5_ADDRESS 0x000001d0 -#define BB_POWERTX_RATE5_OFFSET 0x000001d0 -#define BB_POWERTX_RATE5_POWERTXHT20_0_MSB 5 -#define BB_POWERTX_RATE5_POWERTXHT20_0_LSB 0 -#define BB_POWERTX_RATE5_POWERTXHT20_0_MASK 0x0000003f -#define BB_POWERTX_RATE5_POWERTXHT20_0_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_POWERTX_RATE5_POWERTXHT20_0_SET(x) (((x) << 0) & 0x0000003f) -#define BB_POWERTX_RATE5_POWERTXHT20_1_MSB 13 -#define BB_POWERTX_RATE5_POWERTXHT20_1_LSB 8 -#define BB_POWERTX_RATE5_POWERTXHT20_1_MASK 0x00003f00 -#define BB_POWERTX_RATE5_POWERTXHT20_1_GET(x) (((x) & 0x00003f00) >> 8) -#define BB_POWERTX_RATE5_POWERTXHT20_1_SET(x) (((x) << 8) & 0x00003f00) -#define BB_POWERTX_RATE5_POWERTXHT20_2_MSB 21 -#define BB_POWERTX_RATE5_POWERTXHT20_2_LSB 16 -#define BB_POWERTX_RATE5_POWERTXHT20_2_MASK 0x003f0000 -#define BB_POWERTX_RATE5_POWERTXHT20_2_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_POWERTX_RATE5_POWERTXHT20_2_SET(x) (((x) << 16) & 0x003f0000) -#define BB_POWERTX_RATE5_POWERTXHT20_3_MSB 29 -#define BB_POWERTX_RATE5_POWERTXHT20_3_LSB 24 -#define BB_POWERTX_RATE5_POWERTXHT20_3_MASK 0x3f000000 -#define BB_POWERTX_RATE5_POWERTXHT20_3_GET(x) (((x) & 0x3f000000) >> 24) -#define BB_POWERTX_RATE5_POWERTXHT20_3_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for bb_sm_reg_map.BB_powertx_rate6 */ -#define BB_POWERTX_RATE6_ADDRESS 0x000001d4 -#define BB_POWERTX_RATE6_OFFSET 0x000001d4 -#define BB_POWERTX_RATE6_POWERTXHT20_4_MSB 5 -#define BB_POWERTX_RATE6_POWERTXHT20_4_LSB 0 -#define BB_POWERTX_RATE6_POWERTXHT20_4_MASK 0x0000003f -#define BB_POWERTX_RATE6_POWERTXHT20_4_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_POWERTX_RATE6_POWERTXHT20_4_SET(x) (((x) << 0) & 0x0000003f) -#define BB_POWERTX_RATE6_POWERTXHT20_5_MSB 13 -#define BB_POWERTX_RATE6_POWERTXHT20_5_LSB 8 -#define BB_POWERTX_RATE6_POWERTXHT20_5_MASK 0x00003f00 -#define BB_POWERTX_RATE6_POWERTXHT20_5_GET(x) (((x) & 0x00003f00) >> 8) -#define BB_POWERTX_RATE6_POWERTXHT20_5_SET(x) (((x) << 8) & 0x00003f00) -#define BB_POWERTX_RATE6_POWERTXHT20_6_MSB 21 -#define BB_POWERTX_RATE6_POWERTXHT20_6_LSB 16 -#define BB_POWERTX_RATE6_POWERTXHT20_6_MASK 0x003f0000 -#define BB_POWERTX_RATE6_POWERTXHT20_6_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_POWERTX_RATE6_POWERTXHT20_6_SET(x) (((x) << 16) & 0x003f0000) -#define BB_POWERTX_RATE6_POWERTXHT20_7_MSB 29 -#define BB_POWERTX_RATE6_POWERTXHT20_7_LSB 24 -#define BB_POWERTX_RATE6_POWERTXHT20_7_MASK 0x3f000000 -#define BB_POWERTX_RATE6_POWERTXHT20_7_GET(x) (((x) & 0x3f000000) >> 24) -#define BB_POWERTX_RATE6_POWERTXHT20_7_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for bb_sm_reg_map.BB_powertx_rate7 */ -#define BB_POWERTX_RATE7_ADDRESS 0x000001d8 -#define BB_POWERTX_RATE7_OFFSET 0x000001d8 -#define BB_POWERTX_RATE7_POWERTXHT40_0_MSB 5 -#define BB_POWERTX_RATE7_POWERTXHT40_0_LSB 0 -#define BB_POWERTX_RATE7_POWERTXHT40_0_MASK 0x0000003f -#define BB_POWERTX_RATE7_POWERTXHT40_0_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_POWERTX_RATE7_POWERTXHT40_0_SET(x) (((x) << 0) & 0x0000003f) -#define BB_POWERTX_RATE7_POWERTXHT40_1_MSB 13 -#define BB_POWERTX_RATE7_POWERTXHT40_1_LSB 8 -#define BB_POWERTX_RATE7_POWERTXHT40_1_MASK 0x00003f00 -#define BB_POWERTX_RATE7_POWERTXHT40_1_GET(x) (((x) & 0x00003f00) >> 8) -#define BB_POWERTX_RATE7_POWERTXHT40_1_SET(x) (((x) << 8) & 0x00003f00) -#define BB_POWERTX_RATE7_POWERTXHT40_2_MSB 21 -#define BB_POWERTX_RATE7_POWERTXHT40_2_LSB 16 -#define BB_POWERTX_RATE7_POWERTXHT40_2_MASK 0x003f0000 -#define BB_POWERTX_RATE7_POWERTXHT40_2_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_POWERTX_RATE7_POWERTXHT40_2_SET(x) (((x) << 16) & 0x003f0000) -#define BB_POWERTX_RATE7_POWERTXHT40_3_MSB 29 -#define BB_POWERTX_RATE7_POWERTXHT40_3_LSB 24 -#define BB_POWERTX_RATE7_POWERTXHT40_3_MASK 0x3f000000 -#define BB_POWERTX_RATE7_POWERTXHT40_3_GET(x) (((x) & 0x3f000000) >> 24) -#define BB_POWERTX_RATE7_POWERTXHT40_3_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for bb_sm_reg_map.BB_powertx_rate8 */ -#define BB_POWERTX_RATE8_ADDRESS 0x000001dc -#define BB_POWERTX_RATE8_OFFSET 0x000001dc -#define BB_POWERTX_RATE8_POWERTXHT40_4_MSB 5 -#define BB_POWERTX_RATE8_POWERTXHT40_4_LSB 0 -#define BB_POWERTX_RATE8_POWERTXHT40_4_MASK 0x0000003f -#define BB_POWERTX_RATE8_POWERTXHT40_4_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_POWERTX_RATE8_POWERTXHT40_4_SET(x) (((x) << 0) & 0x0000003f) -#define BB_POWERTX_RATE8_POWERTXHT40_5_MSB 13 -#define BB_POWERTX_RATE8_POWERTXHT40_5_LSB 8 -#define BB_POWERTX_RATE8_POWERTXHT40_5_MASK 0x00003f00 -#define BB_POWERTX_RATE8_POWERTXHT40_5_GET(x) (((x) & 0x00003f00) >> 8) -#define BB_POWERTX_RATE8_POWERTXHT40_5_SET(x) (((x) << 8) & 0x00003f00) -#define BB_POWERTX_RATE8_POWERTXHT40_6_MSB 21 -#define BB_POWERTX_RATE8_POWERTXHT40_6_LSB 16 -#define BB_POWERTX_RATE8_POWERTXHT40_6_MASK 0x003f0000 -#define BB_POWERTX_RATE8_POWERTXHT40_6_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_POWERTX_RATE8_POWERTXHT40_6_SET(x) (((x) << 16) & 0x003f0000) -#define BB_POWERTX_RATE8_POWERTXHT40_7_MSB 29 -#define BB_POWERTX_RATE8_POWERTXHT40_7_LSB 24 -#define BB_POWERTX_RATE8_POWERTXHT40_7_MASK 0x3f000000 -#define BB_POWERTX_RATE8_POWERTXHT40_7_GET(x) (((x) & 0x3f000000) >> 24) -#define BB_POWERTX_RATE8_POWERTXHT40_7_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for bb_sm_reg_map.BB_powertx_rate9 */ -#define BB_POWERTX_RATE9_ADDRESS 0x000001e0 -#define BB_POWERTX_RATE9_OFFSET 0x000001e0 -#define BB_POWERTX_RATE9_POWERTX_DUP40_CCK_MSB 5 -#define BB_POWERTX_RATE9_POWERTX_DUP40_CCK_LSB 0 -#define BB_POWERTX_RATE9_POWERTX_DUP40_CCK_MASK 0x0000003f -#define BB_POWERTX_RATE9_POWERTX_DUP40_CCK_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_POWERTX_RATE9_POWERTX_DUP40_CCK_SET(x) (((x) << 0) & 0x0000003f) -#define BB_POWERTX_RATE9_POWERTX_DUP40_OFDM_MSB 13 -#define BB_POWERTX_RATE9_POWERTX_DUP40_OFDM_LSB 8 -#define BB_POWERTX_RATE9_POWERTX_DUP40_OFDM_MASK 0x00003f00 -#define BB_POWERTX_RATE9_POWERTX_DUP40_OFDM_GET(x) (((x) & 0x00003f00) >> 8) -#define BB_POWERTX_RATE9_POWERTX_DUP40_OFDM_SET(x) (((x) << 8) & 0x00003f00) -#define BB_POWERTX_RATE9_POWERTX_EXT20_CCK_MSB 21 -#define BB_POWERTX_RATE9_POWERTX_EXT20_CCK_LSB 16 -#define BB_POWERTX_RATE9_POWERTX_EXT20_CCK_MASK 0x003f0000 -#define BB_POWERTX_RATE9_POWERTX_EXT20_CCK_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_POWERTX_RATE9_POWERTX_EXT20_CCK_SET(x) (((x) << 16) & 0x003f0000) -#define BB_POWERTX_RATE9_POWERTX_EXT20_OFDM_MSB 29 -#define BB_POWERTX_RATE9_POWERTX_EXT20_OFDM_LSB 24 -#define BB_POWERTX_RATE9_POWERTX_EXT20_OFDM_MASK 0x3f000000 -#define BB_POWERTX_RATE9_POWERTX_EXT20_OFDM_GET(x) (((x) & 0x3f000000) >> 24) -#define BB_POWERTX_RATE9_POWERTX_EXT20_OFDM_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for bb_sm_reg_map.BB_powertx_rate10 */ -#define BB_POWERTX_RATE10_ADDRESS 0x000001e4 -#define BB_POWERTX_RATE10_OFFSET 0x000001e4 -#define BB_POWERTX_RATE10_POWERTXHT20_8_MSB 5 -#define BB_POWERTX_RATE10_POWERTXHT20_8_LSB 0 -#define BB_POWERTX_RATE10_POWERTXHT20_8_MASK 0x0000003f -#define BB_POWERTX_RATE10_POWERTXHT20_8_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_POWERTX_RATE10_POWERTXHT20_8_SET(x) (((x) << 0) & 0x0000003f) -#define BB_POWERTX_RATE10_POWERTXHT20_9_MSB 13 -#define BB_POWERTX_RATE10_POWERTXHT20_9_LSB 8 -#define BB_POWERTX_RATE10_POWERTXHT20_9_MASK 0x00003f00 -#define BB_POWERTX_RATE10_POWERTXHT20_9_GET(x) (((x) & 0x00003f00) >> 8) -#define BB_POWERTX_RATE10_POWERTXHT20_9_SET(x) (((x) << 8) & 0x00003f00) -#define BB_POWERTX_RATE10_POWERTXHT20_10_MSB 21 -#define BB_POWERTX_RATE10_POWERTXHT20_10_LSB 16 -#define BB_POWERTX_RATE10_POWERTXHT20_10_MASK 0x003f0000 -#define BB_POWERTX_RATE10_POWERTXHT20_10_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_POWERTX_RATE10_POWERTXHT20_10_SET(x) (((x) << 16) & 0x003f0000) -#define BB_POWERTX_RATE10_POWERTXHT20_11_MSB 29 -#define BB_POWERTX_RATE10_POWERTXHT20_11_LSB 24 -#define BB_POWERTX_RATE10_POWERTXHT20_11_MASK 0x3f000000 -#define BB_POWERTX_RATE10_POWERTXHT20_11_GET(x) (((x) & 0x3f000000) >> 24) -#define BB_POWERTX_RATE10_POWERTXHT20_11_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for bb_sm_reg_map.BB_powertx_rate11 */ -#define BB_POWERTX_RATE11_ADDRESS 0x000001e8 -#define BB_POWERTX_RATE11_OFFSET 0x000001e8 -#define BB_POWERTX_RATE11_POWERTXHT20_12_MSB 5 -#define BB_POWERTX_RATE11_POWERTXHT20_12_LSB 0 -#define BB_POWERTX_RATE11_POWERTXHT20_12_MASK 0x0000003f -#define BB_POWERTX_RATE11_POWERTXHT20_12_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_POWERTX_RATE11_POWERTXHT20_12_SET(x) (((x) << 0) & 0x0000003f) -#define BB_POWERTX_RATE11_POWERTXHT20_13_MSB 13 -#define BB_POWERTX_RATE11_POWERTXHT20_13_LSB 8 -#define BB_POWERTX_RATE11_POWERTXHT20_13_MASK 0x00003f00 -#define BB_POWERTX_RATE11_POWERTXHT20_13_GET(x) (((x) & 0x00003f00) >> 8) -#define BB_POWERTX_RATE11_POWERTXHT20_13_SET(x) (((x) << 8) & 0x00003f00) -#define BB_POWERTX_RATE11_POWERTXHT40_12_MSB 21 -#define BB_POWERTX_RATE11_POWERTXHT40_12_LSB 16 -#define BB_POWERTX_RATE11_POWERTXHT40_12_MASK 0x003f0000 -#define BB_POWERTX_RATE11_POWERTXHT40_12_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_POWERTX_RATE11_POWERTXHT40_12_SET(x) (((x) << 16) & 0x003f0000) -#define BB_POWERTX_RATE11_POWERTXHT40_13_MSB 29 -#define BB_POWERTX_RATE11_POWERTXHT40_13_LSB 24 -#define BB_POWERTX_RATE11_POWERTXHT40_13_MASK 0x3f000000 -#define BB_POWERTX_RATE11_POWERTXHT40_13_GET(x) (((x) & 0x3f000000) >> 24) -#define BB_POWERTX_RATE11_POWERTXHT40_13_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for bb_sm_reg_map.BB_powertx_rate12 */ -#define BB_POWERTX_RATE12_ADDRESS 0x000001ec -#define BB_POWERTX_RATE12_OFFSET 0x000001ec -#define BB_POWERTX_RATE12_POWERTXHT40_8_MSB 5 -#define BB_POWERTX_RATE12_POWERTXHT40_8_LSB 0 -#define BB_POWERTX_RATE12_POWERTXHT40_8_MASK 0x0000003f -#define BB_POWERTX_RATE12_POWERTXHT40_8_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_POWERTX_RATE12_POWERTXHT40_8_SET(x) (((x) << 0) & 0x0000003f) -#define BB_POWERTX_RATE12_POWERTXHT40_9_MSB 13 -#define BB_POWERTX_RATE12_POWERTXHT40_9_LSB 8 -#define BB_POWERTX_RATE12_POWERTXHT40_9_MASK 0x00003f00 -#define BB_POWERTX_RATE12_POWERTXHT40_9_GET(x) (((x) & 0x00003f00) >> 8) -#define BB_POWERTX_RATE12_POWERTXHT40_9_SET(x) (((x) << 8) & 0x00003f00) -#define BB_POWERTX_RATE12_POWERTXHT40_10_MSB 21 -#define BB_POWERTX_RATE12_POWERTXHT40_10_LSB 16 -#define BB_POWERTX_RATE12_POWERTXHT40_10_MASK 0x003f0000 -#define BB_POWERTX_RATE12_POWERTXHT40_10_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_POWERTX_RATE12_POWERTXHT40_10_SET(x) (((x) << 16) & 0x003f0000) -#define BB_POWERTX_RATE12_POWERTXHT40_11_MSB 29 -#define BB_POWERTX_RATE12_POWERTXHT40_11_LSB 24 -#define BB_POWERTX_RATE12_POWERTXHT40_11_MASK 0x3f000000 -#define BB_POWERTX_RATE12_POWERTXHT40_11_GET(x) (((x) & 0x3f000000) >> 24) -#define BB_POWERTX_RATE12_POWERTXHT40_11_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for bb_sm_reg_map.BB_powertx_max */ -#define BB_POWERTX_MAX_ADDRESS 0x000001f0 -#define BB_POWERTX_MAX_OFFSET 0x000001f0 -#define BB_POWERTX_MAX_USE_PER_PACKET_POWERTX_MAX_MSB 6 -#define BB_POWERTX_MAX_USE_PER_PACKET_POWERTX_MAX_LSB 6 -#define BB_POWERTX_MAX_USE_PER_PACKET_POWERTX_MAX_MASK 0x00000040 -#define BB_POWERTX_MAX_USE_PER_PACKET_POWERTX_MAX_GET(x) (((x) & 0x00000040) >> 6) -#define BB_POWERTX_MAX_USE_PER_PACKET_POWERTX_MAX_SET(x) (((x) << 6) & 0x00000040) -#define BB_POWERTX_MAX_USE_PER_PACKET_OLPC_GAIN_DELTA_ADJ_MSB 7 -#define BB_POWERTX_MAX_USE_PER_PACKET_OLPC_GAIN_DELTA_ADJ_LSB 7 -#define BB_POWERTX_MAX_USE_PER_PACKET_OLPC_GAIN_DELTA_ADJ_MASK 0x00000080 -#define BB_POWERTX_MAX_USE_PER_PACKET_OLPC_GAIN_DELTA_ADJ_GET(x) (((x) & 0x00000080) >> 7) -#define BB_POWERTX_MAX_USE_PER_PACKET_OLPC_GAIN_DELTA_ADJ_SET(x) (((x) << 7) & 0x00000080) - -/* macros for bb_sm_reg_map.BB_powertx_sub */ -#define BB_POWERTX_SUB_ADDRESS 0x000001f4 -#define BB_POWERTX_SUB_OFFSET 0x000001f4 -#define BB_POWERTX_SUB_POWERTX_SUB_FOR_2CHAIN_MSB 5 -#define BB_POWERTX_SUB_POWERTX_SUB_FOR_2CHAIN_LSB 0 -#define BB_POWERTX_SUB_POWERTX_SUB_FOR_2CHAIN_MASK 0x0000003f -#define BB_POWERTX_SUB_POWERTX_SUB_FOR_2CHAIN_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_POWERTX_SUB_POWERTX_SUB_FOR_2CHAIN_SET(x) (((x) << 0) & 0x0000003f) - -/* macros for bb_sm_reg_map.BB_tpc_1 */ -#define BB_TPC_1_ADDRESS 0x000001f8 -#define BB_TPC_1_OFFSET 0x000001f8 -#define BB_TPC_1_FORCE_DAC_GAIN_MSB 0 -#define BB_TPC_1_FORCE_DAC_GAIN_LSB 0 -#define BB_TPC_1_FORCE_DAC_GAIN_MASK 0x00000001 -#define BB_TPC_1_FORCE_DAC_GAIN_GET(x) (((x) & 0x00000001) >> 0) -#define BB_TPC_1_FORCE_DAC_GAIN_SET(x) (((x) << 0) & 0x00000001) -#define BB_TPC_1_FORCED_DAC_GAIN_MSB 5 -#define BB_TPC_1_FORCED_DAC_GAIN_LSB 1 -#define BB_TPC_1_FORCED_DAC_GAIN_MASK 0x0000003e -#define BB_TPC_1_FORCED_DAC_GAIN_GET(x) (((x) & 0x0000003e) >> 1) -#define BB_TPC_1_FORCED_DAC_GAIN_SET(x) (((x) << 1) & 0x0000003e) -#define BB_TPC_1_PD_DC_OFFSET_TARGET_MSB 13 -#define BB_TPC_1_PD_DC_OFFSET_TARGET_LSB 6 -#define BB_TPC_1_PD_DC_OFFSET_TARGET_MASK 0x00003fc0 -#define BB_TPC_1_PD_DC_OFFSET_TARGET_GET(x) (((x) & 0x00003fc0) >> 6) -#define BB_TPC_1_PD_DC_OFFSET_TARGET_SET(x) (((x) << 6) & 0x00003fc0) -#define BB_TPC_1_NUM_PD_GAIN_MSB 15 -#define BB_TPC_1_NUM_PD_GAIN_LSB 14 -#define BB_TPC_1_NUM_PD_GAIN_MASK 0x0000c000 -#define BB_TPC_1_NUM_PD_GAIN_GET(x) (((x) & 0x0000c000) >> 14) -#define BB_TPC_1_NUM_PD_GAIN_SET(x) (((x) << 14) & 0x0000c000) -#define BB_TPC_1_PD_GAIN_SETTING1_MSB 17 -#define BB_TPC_1_PD_GAIN_SETTING1_LSB 16 -#define BB_TPC_1_PD_GAIN_SETTING1_MASK 0x00030000 -#define BB_TPC_1_PD_GAIN_SETTING1_GET(x) (((x) & 0x00030000) >> 16) -#define BB_TPC_1_PD_GAIN_SETTING1_SET(x) (((x) << 16) & 0x00030000) -#define BB_TPC_1_PD_GAIN_SETTING2_MSB 19 -#define BB_TPC_1_PD_GAIN_SETTING2_LSB 18 -#define BB_TPC_1_PD_GAIN_SETTING2_MASK 0x000c0000 -#define BB_TPC_1_PD_GAIN_SETTING2_GET(x) (((x) & 0x000c0000) >> 18) -#define BB_TPC_1_PD_GAIN_SETTING2_SET(x) (((x) << 18) & 0x000c0000) -#define BB_TPC_1_PD_GAIN_SETTING3_MSB 21 -#define BB_TPC_1_PD_GAIN_SETTING3_LSB 20 -#define BB_TPC_1_PD_GAIN_SETTING3_MASK 0x00300000 -#define BB_TPC_1_PD_GAIN_SETTING3_GET(x) (((x) & 0x00300000) >> 20) -#define BB_TPC_1_PD_GAIN_SETTING3_SET(x) (((x) << 20) & 0x00300000) -#define BB_TPC_1_ENABLE_PD_CALIBRATE_MSB 22 -#define BB_TPC_1_ENABLE_PD_CALIBRATE_LSB 22 -#define BB_TPC_1_ENABLE_PD_CALIBRATE_MASK 0x00400000 -#define BB_TPC_1_ENABLE_PD_CALIBRATE_GET(x) (((x) & 0x00400000) >> 22) -#define BB_TPC_1_ENABLE_PD_CALIBRATE_SET(x) (((x) << 22) & 0x00400000) -#define BB_TPC_1_PD_CALIBRATE_WAIT_MSB 28 -#define BB_TPC_1_PD_CALIBRATE_WAIT_LSB 23 -#define BB_TPC_1_PD_CALIBRATE_WAIT_MASK 0x1f800000 -#define BB_TPC_1_PD_CALIBRATE_WAIT_GET(x) (((x) & 0x1f800000) >> 23) -#define BB_TPC_1_PD_CALIBRATE_WAIT_SET(x) (((x) << 23) & 0x1f800000) -#define BB_TPC_1_FORCE_PDADC_GAIN_MSB 29 -#define BB_TPC_1_FORCE_PDADC_GAIN_LSB 29 -#define BB_TPC_1_FORCE_PDADC_GAIN_MASK 0x20000000 -#define BB_TPC_1_FORCE_PDADC_GAIN_GET(x) (((x) & 0x20000000) >> 29) -#define BB_TPC_1_FORCE_PDADC_GAIN_SET(x) (((x) << 29) & 0x20000000) -#define BB_TPC_1_FORCED_PDADC_GAIN_MSB 31 -#define BB_TPC_1_FORCED_PDADC_GAIN_LSB 30 -#define BB_TPC_1_FORCED_PDADC_GAIN_MASK 0xc0000000 -#define BB_TPC_1_FORCED_PDADC_GAIN_GET(x) (((x) & 0xc0000000) >> 30) -#define BB_TPC_1_FORCED_PDADC_GAIN_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for bb_sm_reg_map.BB_tpc_2 */ -#define BB_TPC_2_ADDRESS 0x000001fc -#define BB_TPC_2_OFFSET 0x000001fc -#define BB_TPC_2_TX_FRAME_TO_PDADC_ON_MSB 7 -#define BB_TPC_2_TX_FRAME_TO_PDADC_ON_LSB 0 -#define BB_TPC_2_TX_FRAME_TO_PDADC_ON_MASK 0x000000ff -#define BB_TPC_2_TX_FRAME_TO_PDADC_ON_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_TPC_2_TX_FRAME_TO_PDADC_ON_SET(x) (((x) << 0) & 0x000000ff) -#define BB_TPC_2_TX_FRAME_TO_PD_ACC_OFDM_MSB 15 -#define BB_TPC_2_TX_FRAME_TO_PD_ACC_OFDM_LSB 8 -#define BB_TPC_2_TX_FRAME_TO_PD_ACC_OFDM_MASK 0x0000ff00 -#define BB_TPC_2_TX_FRAME_TO_PD_ACC_OFDM_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_TPC_2_TX_FRAME_TO_PD_ACC_OFDM_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_TPC_2_TX_FRAME_TO_PD_ACC_CCK_MSB 23 -#define BB_TPC_2_TX_FRAME_TO_PD_ACC_CCK_LSB 16 -#define BB_TPC_2_TX_FRAME_TO_PD_ACC_CCK_MASK 0x00ff0000 -#define BB_TPC_2_TX_FRAME_TO_PD_ACC_CCK_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_TPC_2_TX_FRAME_TO_PD_ACC_CCK_SET(x) (((x) << 16) & 0x00ff0000) - -/* macros for bb_sm_reg_map.BB_tpc_3 */ -#define BB_TPC_3_ADDRESS 0x00000200 -#define BB_TPC_3_OFFSET 0x00000200 -#define BB_TPC_3_TX_END_TO_PDADC_ON_MSB 7 -#define BB_TPC_3_TX_END_TO_PDADC_ON_LSB 0 -#define BB_TPC_3_TX_END_TO_PDADC_ON_MASK 0x000000ff -#define BB_TPC_3_TX_END_TO_PDADC_ON_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_TPC_3_TX_END_TO_PDADC_ON_SET(x) (((x) << 0) & 0x000000ff) -#define BB_TPC_3_TX_END_TO_PD_ACC_ON_MSB 15 -#define BB_TPC_3_TX_END_TO_PD_ACC_ON_LSB 8 -#define BB_TPC_3_TX_END_TO_PD_ACC_ON_MASK 0x0000ff00 -#define BB_TPC_3_TX_END_TO_PD_ACC_ON_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_TPC_3_TX_END_TO_PD_ACC_ON_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_TPC_3_PD_ACC_WINDOW_DC_OFF_MSB 18 -#define BB_TPC_3_PD_ACC_WINDOW_DC_OFF_LSB 16 -#define BB_TPC_3_PD_ACC_WINDOW_DC_OFF_MASK 0x00070000 -#define BB_TPC_3_PD_ACC_WINDOW_DC_OFF_GET(x) (((x) & 0x00070000) >> 16) -#define BB_TPC_3_PD_ACC_WINDOW_DC_OFF_SET(x) (((x) << 16) & 0x00070000) -#define BB_TPC_3_PD_ACC_WINDOW_CAL_MSB 21 -#define BB_TPC_3_PD_ACC_WINDOW_CAL_LSB 19 -#define BB_TPC_3_PD_ACC_WINDOW_CAL_MASK 0x00380000 -#define BB_TPC_3_PD_ACC_WINDOW_CAL_GET(x) (((x) & 0x00380000) >> 19) -#define BB_TPC_3_PD_ACC_WINDOW_CAL_SET(x) (((x) << 19) & 0x00380000) -#define BB_TPC_3_PD_ACC_WINDOW_OFDM_MSB 24 -#define BB_TPC_3_PD_ACC_WINDOW_OFDM_LSB 22 -#define BB_TPC_3_PD_ACC_WINDOW_OFDM_MASK 0x01c00000 -#define BB_TPC_3_PD_ACC_WINDOW_OFDM_GET(x) (((x) & 0x01c00000) >> 22) -#define BB_TPC_3_PD_ACC_WINDOW_OFDM_SET(x) (((x) << 22) & 0x01c00000) -#define BB_TPC_3_PD_ACC_WINDOW_CCK_MSB 27 -#define BB_TPC_3_PD_ACC_WINDOW_CCK_LSB 25 -#define BB_TPC_3_PD_ACC_WINDOW_CCK_MASK 0x0e000000 -#define BB_TPC_3_PD_ACC_WINDOW_CCK_GET(x) (((x) & 0x0e000000) >> 25) -#define BB_TPC_3_PD_ACC_WINDOW_CCK_SET(x) (((x) << 25) & 0x0e000000) -#define BB_TPC_3_TPC_CLK_GATE_ENABLE_MSB 31 -#define BB_TPC_3_TPC_CLK_GATE_ENABLE_LSB 31 -#define BB_TPC_3_TPC_CLK_GATE_ENABLE_MASK 0x80000000 -#define BB_TPC_3_TPC_CLK_GATE_ENABLE_GET(x) (((x) & 0x80000000) >> 31) -#define BB_TPC_3_TPC_CLK_GATE_ENABLE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_sm_reg_map.BB_tpc_4_b0 */ -#define BB_TPC_4_B0_ADDRESS 0x00000204 -#define BB_TPC_4_B0_OFFSET 0x00000204 -#define BB_TPC_4_B0_PD_AVG_VALID_0_MSB 0 -#define BB_TPC_4_B0_PD_AVG_VALID_0_LSB 0 -#define BB_TPC_4_B0_PD_AVG_VALID_0_MASK 0x00000001 -#define BB_TPC_4_B0_PD_AVG_VALID_0_GET(x) (((x) & 0x00000001) >> 0) -#define BB_TPC_4_B0_PD_AVG_OUT_0_MSB 8 -#define BB_TPC_4_B0_PD_AVG_OUT_0_LSB 1 -#define BB_TPC_4_B0_PD_AVG_OUT_0_MASK 0x000001fe -#define BB_TPC_4_B0_PD_AVG_OUT_0_GET(x) (((x) & 0x000001fe) >> 1) -#define BB_TPC_4_B0_DAC_GAIN_0_MSB 13 -#define BB_TPC_4_B0_DAC_GAIN_0_LSB 9 -#define BB_TPC_4_B0_DAC_GAIN_0_MASK 0x00003e00 -#define BB_TPC_4_B0_DAC_GAIN_0_GET(x) (((x) & 0x00003e00) >> 9) -#define BB_TPC_4_B0_TX_GAIN_SETTING_0_MSB 19 -#define BB_TPC_4_B0_TX_GAIN_SETTING_0_LSB 14 -#define BB_TPC_4_B0_TX_GAIN_SETTING_0_MASK 0x000fc000 -#define BB_TPC_4_B0_TX_GAIN_SETTING_0_GET(x) (((x) & 0x000fc000) >> 14) -#define BB_TPC_4_B0_RATE_SENT_0_MSB 24 -#define BB_TPC_4_B0_RATE_SENT_0_LSB 20 -#define BB_TPC_4_B0_RATE_SENT_0_MASK 0x01f00000 -#define BB_TPC_4_B0_RATE_SENT_0_GET(x) (((x) & 0x01f00000) >> 20) -#define BB_TPC_4_B0_ERROR_EST_UPDATE_POWER_THRESH_MSB 30 -#define BB_TPC_4_B0_ERROR_EST_UPDATE_POWER_THRESH_LSB 25 -#define BB_TPC_4_B0_ERROR_EST_UPDATE_POWER_THRESH_MASK 0x7e000000 -#define BB_TPC_4_B0_ERROR_EST_UPDATE_POWER_THRESH_GET(x) (((x) & 0x7e000000) >> 25) -#define BB_TPC_4_B0_ERROR_EST_UPDATE_POWER_THRESH_SET(x) (((x) << 25) & 0x7e000000) - -/* macros for bb_sm_reg_map.BB_tpc_5_b0 */ -#define BB_TPC_5_B0_ADDRESS 0x00000208 -#define BB_TPC_5_B0_OFFSET 0x00000208 -#define BB_TPC_5_B0_PD_GAIN_OVERLAP_MSB 3 -#define BB_TPC_5_B0_PD_GAIN_OVERLAP_LSB 0 -#define BB_TPC_5_B0_PD_GAIN_OVERLAP_MASK 0x0000000f -#define BB_TPC_5_B0_PD_GAIN_OVERLAP_GET(x) (((x) & 0x0000000f) >> 0) -#define BB_TPC_5_B0_PD_GAIN_OVERLAP_SET(x) (((x) << 0) & 0x0000000f) -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_1_0_MSB 9 -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_1_0_LSB 4 -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_1_0_MASK 0x000003f0 -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_1_0_GET(x) (((x) & 0x000003f0) >> 4) -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_1_0_SET(x) (((x) << 4) & 0x000003f0) -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_2_0_MSB 15 -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_2_0_LSB 10 -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_2_0_MASK 0x0000fc00 -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_2_0_GET(x) (((x) & 0x0000fc00) >> 10) -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_2_0_SET(x) (((x) << 10) & 0x0000fc00) -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_3_0_MSB 21 -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_3_0_LSB 16 -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_3_0_MASK 0x003f0000 -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_3_0_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_3_0_SET(x) (((x) << 16) & 0x003f0000) -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_4_0_MSB 27 -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_4_0_LSB 22 -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_4_0_MASK 0x0fc00000 -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_4_0_GET(x) (((x) & 0x0fc00000) >> 22) -#define BB_TPC_5_B0_PD_GAIN_BOUNDARY_4_0_SET(x) (((x) << 22) & 0x0fc00000) - -/* macros for bb_sm_reg_map.BB_tpc_6_b0 */ -#define BB_TPC_6_B0_ADDRESS 0x0000020c -#define BB_TPC_6_B0_OFFSET 0x0000020c -#define BB_TPC_6_B0_PD_DAC_SETTING_1_0_MSB 5 -#define BB_TPC_6_B0_PD_DAC_SETTING_1_0_LSB 0 -#define BB_TPC_6_B0_PD_DAC_SETTING_1_0_MASK 0x0000003f -#define BB_TPC_6_B0_PD_DAC_SETTING_1_0_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_TPC_6_B0_PD_DAC_SETTING_1_0_SET(x) (((x) << 0) & 0x0000003f) -#define BB_TPC_6_B0_PD_DAC_SETTING_2_0_MSB 11 -#define BB_TPC_6_B0_PD_DAC_SETTING_2_0_LSB 6 -#define BB_TPC_6_B0_PD_DAC_SETTING_2_0_MASK 0x00000fc0 -#define BB_TPC_6_B0_PD_DAC_SETTING_2_0_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_TPC_6_B0_PD_DAC_SETTING_2_0_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_TPC_6_B0_PD_DAC_SETTING_3_0_MSB 17 -#define BB_TPC_6_B0_PD_DAC_SETTING_3_0_LSB 12 -#define BB_TPC_6_B0_PD_DAC_SETTING_3_0_MASK 0x0003f000 -#define BB_TPC_6_B0_PD_DAC_SETTING_3_0_GET(x) (((x) & 0x0003f000) >> 12) -#define BB_TPC_6_B0_PD_DAC_SETTING_3_0_SET(x) (((x) << 12) & 0x0003f000) -#define BB_TPC_6_B0_PD_DAC_SETTING_4_0_MSB 23 -#define BB_TPC_6_B0_PD_DAC_SETTING_4_0_LSB 18 -#define BB_TPC_6_B0_PD_DAC_SETTING_4_0_MASK 0x00fc0000 -#define BB_TPC_6_B0_PD_DAC_SETTING_4_0_GET(x) (((x) & 0x00fc0000) >> 18) -#define BB_TPC_6_B0_PD_DAC_SETTING_4_0_SET(x) (((x) << 18) & 0x00fc0000) -#define BB_TPC_6_B0_ERROR_EST_MODE_MSB 25 -#define BB_TPC_6_B0_ERROR_EST_MODE_LSB 24 -#define BB_TPC_6_B0_ERROR_EST_MODE_MASK 0x03000000 -#define BB_TPC_6_B0_ERROR_EST_MODE_GET(x) (((x) & 0x03000000) >> 24) -#define BB_TPC_6_B0_ERROR_EST_MODE_SET(x) (((x) << 24) & 0x03000000) -#define BB_TPC_6_B0_ERROR_EST_FILTER_COEFF_MSB 28 -#define BB_TPC_6_B0_ERROR_EST_FILTER_COEFF_LSB 26 -#define BB_TPC_6_B0_ERROR_EST_FILTER_COEFF_MASK 0x1c000000 -#define BB_TPC_6_B0_ERROR_EST_FILTER_COEFF_GET(x) (((x) & 0x1c000000) >> 26) -#define BB_TPC_6_B0_ERROR_EST_FILTER_COEFF_SET(x) (((x) << 26) & 0x1c000000) - -/* macros for bb_sm_reg_map.BB_tpc_7 */ -#define BB_TPC_7_ADDRESS 0x00000210 -#define BB_TPC_7_OFFSET 0x00000210 -#define BB_TPC_7_TX_GAIN_TABLE_MAX_MSB 5 -#define BB_TPC_7_TX_GAIN_TABLE_MAX_LSB 0 -#define BB_TPC_7_TX_GAIN_TABLE_MAX_MASK 0x0000003f -#define BB_TPC_7_TX_GAIN_TABLE_MAX_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_TPC_7_TX_GAIN_TABLE_MAX_SET(x) (((x) << 0) & 0x0000003f) -#define BB_TPC_7_INIT_TX_GAIN_SETTING_MSB 11 -#define BB_TPC_7_INIT_TX_GAIN_SETTING_LSB 6 -#define BB_TPC_7_INIT_TX_GAIN_SETTING_MASK 0x00000fc0 -#define BB_TPC_7_INIT_TX_GAIN_SETTING_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_TPC_7_INIT_TX_GAIN_SETTING_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_TPC_7_EN_CL_GAIN_MOD_MSB 12 -#define BB_TPC_7_EN_CL_GAIN_MOD_LSB 12 -#define BB_TPC_7_EN_CL_GAIN_MOD_MASK 0x00001000 -#define BB_TPC_7_EN_CL_GAIN_MOD_GET(x) (((x) & 0x00001000) >> 12) -#define BB_TPC_7_EN_CL_GAIN_MOD_SET(x) (((x) << 12) & 0x00001000) -#define BB_TPC_7_USE_TX_PD_IN_XPA_MSB 13 -#define BB_TPC_7_USE_TX_PD_IN_XPA_LSB 13 -#define BB_TPC_7_USE_TX_PD_IN_XPA_MASK 0x00002000 -#define BB_TPC_7_USE_TX_PD_IN_XPA_GET(x) (((x) & 0x00002000) >> 13) -#define BB_TPC_7_USE_TX_PD_IN_XPA_SET(x) (((x) << 13) & 0x00002000) -#define BB_TPC_7_EXTEND_TX_FRAME_FOR_TPC_MSB 14 -#define BB_TPC_7_EXTEND_TX_FRAME_FOR_TPC_LSB 14 -#define BB_TPC_7_EXTEND_TX_FRAME_FOR_TPC_MASK 0x00004000 -#define BB_TPC_7_EXTEND_TX_FRAME_FOR_TPC_GET(x) (((x) & 0x00004000) >> 14) -#define BB_TPC_7_EXTEND_TX_FRAME_FOR_TPC_SET(x) (((x) << 14) & 0x00004000) -#define BB_TPC_7_USE_INIT_TX_GAIN_SETTING_AFTER_WARM_RESET_MSB 15 -#define BB_TPC_7_USE_INIT_TX_GAIN_SETTING_AFTER_WARM_RESET_LSB 15 -#define BB_TPC_7_USE_INIT_TX_GAIN_SETTING_AFTER_WARM_RESET_MASK 0x00008000 -#define BB_TPC_7_USE_INIT_TX_GAIN_SETTING_AFTER_WARM_RESET_GET(x) (((x) & 0x00008000) >> 15) -#define BB_TPC_7_USE_INIT_TX_GAIN_SETTING_AFTER_WARM_RESET_SET(x) (((x) << 15) & 0x00008000) - -/* macros for bb_sm_reg_map.BB_tpc_8 */ -#define BB_TPC_8_ADDRESS 0x00000214 -#define BB_TPC_8_OFFSET 0x00000214 -#define BB_TPC_8_DESIRED_SCALE_0_MSB 4 -#define BB_TPC_8_DESIRED_SCALE_0_LSB 0 -#define BB_TPC_8_DESIRED_SCALE_0_MASK 0x0000001f -#define BB_TPC_8_DESIRED_SCALE_0_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_TPC_8_DESIRED_SCALE_0_SET(x) (((x) << 0) & 0x0000001f) -#define BB_TPC_8_DESIRED_SCALE_1_MSB 9 -#define BB_TPC_8_DESIRED_SCALE_1_LSB 5 -#define BB_TPC_8_DESIRED_SCALE_1_MASK 0x000003e0 -#define BB_TPC_8_DESIRED_SCALE_1_GET(x) (((x) & 0x000003e0) >> 5) -#define BB_TPC_8_DESIRED_SCALE_1_SET(x) (((x) << 5) & 0x000003e0) -#define BB_TPC_8_DESIRED_SCALE_2_MSB 14 -#define BB_TPC_8_DESIRED_SCALE_2_LSB 10 -#define BB_TPC_8_DESIRED_SCALE_2_MASK 0x00007c00 -#define BB_TPC_8_DESIRED_SCALE_2_GET(x) (((x) & 0x00007c00) >> 10) -#define BB_TPC_8_DESIRED_SCALE_2_SET(x) (((x) << 10) & 0x00007c00) -#define BB_TPC_8_DESIRED_SCALE_3_MSB 19 -#define BB_TPC_8_DESIRED_SCALE_3_LSB 15 -#define BB_TPC_8_DESIRED_SCALE_3_MASK 0x000f8000 -#define BB_TPC_8_DESIRED_SCALE_3_GET(x) (((x) & 0x000f8000) >> 15) -#define BB_TPC_8_DESIRED_SCALE_3_SET(x) (((x) << 15) & 0x000f8000) -#define BB_TPC_8_DESIRED_SCALE_4_MSB 24 -#define BB_TPC_8_DESIRED_SCALE_4_LSB 20 -#define BB_TPC_8_DESIRED_SCALE_4_MASK 0x01f00000 -#define BB_TPC_8_DESIRED_SCALE_4_GET(x) (((x) & 0x01f00000) >> 20) -#define BB_TPC_8_DESIRED_SCALE_4_SET(x) (((x) << 20) & 0x01f00000) -#define BB_TPC_8_DESIRED_SCALE_5_MSB 29 -#define BB_TPC_8_DESIRED_SCALE_5_LSB 25 -#define BB_TPC_8_DESIRED_SCALE_5_MASK 0x3e000000 -#define BB_TPC_8_DESIRED_SCALE_5_GET(x) (((x) & 0x3e000000) >> 25) -#define BB_TPC_8_DESIRED_SCALE_5_SET(x) (((x) << 25) & 0x3e000000) - -/* macros for bb_sm_reg_map.BB_tpc_9 */ -#define BB_TPC_9_ADDRESS 0x00000218 -#define BB_TPC_9_OFFSET 0x00000218 -#define BB_TPC_9_DESIRED_SCALE_6_MSB 4 -#define BB_TPC_9_DESIRED_SCALE_6_LSB 0 -#define BB_TPC_9_DESIRED_SCALE_6_MASK 0x0000001f -#define BB_TPC_9_DESIRED_SCALE_6_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_TPC_9_DESIRED_SCALE_6_SET(x) (((x) << 0) & 0x0000001f) -#define BB_TPC_9_DESIRED_SCALE_7_MSB 9 -#define BB_TPC_9_DESIRED_SCALE_7_LSB 5 -#define BB_TPC_9_DESIRED_SCALE_7_MASK 0x000003e0 -#define BB_TPC_9_DESIRED_SCALE_7_GET(x) (((x) & 0x000003e0) >> 5) -#define BB_TPC_9_DESIRED_SCALE_7_SET(x) (((x) << 5) & 0x000003e0) -#define BB_TPC_9_DESIRED_SCALE_CCK_MSB 14 -#define BB_TPC_9_DESIRED_SCALE_CCK_LSB 10 -#define BB_TPC_9_DESIRED_SCALE_CCK_MASK 0x00007c00 -#define BB_TPC_9_DESIRED_SCALE_CCK_GET(x) (((x) & 0x00007c00) >> 10) -#define BB_TPC_9_DESIRED_SCALE_CCK_SET(x) (((x) << 10) & 0x00007c00) -#define BB_TPC_9_EN_PD_DC_OFFSET_THR_MSB 20 -#define BB_TPC_9_EN_PD_DC_OFFSET_THR_LSB 20 -#define BB_TPC_9_EN_PD_DC_OFFSET_THR_MASK 0x00100000 -#define BB_TPC_9_EN_PD_DC_OFFSET_THR_GET(x) (((x) & 0x00100000) >> 20) -#define BB_TPC_9_EN_PD_DC_OFFSET_THR_SET(x) (((x) << 20) & 0x00100000) -#define BB_TPC_9_PD_DC_OFFSET_THR_MSB 26 -#define BB_TPC_9_PD_DC_OFFSET_THR_LSB 21 -#define BB_TPC_9_PD_DC_OFFSET_THR_MASK 0x07e00000 -#define BB_TPC_9_PD_DC_OFFSET_THR_GET(x) (((x) & 0x07e00000) >> 21) -#define BB_TPC_9_PD_DC_OFFSET_THR_SET(x) (((x) << 21) & 0x07e00000) -#define BB_TPC_9_WAIT_CALTX_SETTLE_MSB 30 -#define BB_TPC_9_WAIT_CALTX_SETTLE_LSB 27 -#define BB_TPC_9_WAIT_CALTX_SETTLE_MASK 0x78000000 -#define BB_TPC_9_WAIT_CALTX_SETTLE_GET(x) (((x) & 0x78000000) >> 27) -#define BB_TPC_9_WAIT_CALTX_SETTLE_SET(x) (((x) << 27) & 0x78000000) -#define BB_TPC_9_DISABLE_PDADC_RESIDUAL_DC_REMOVAL_MSB 31 -#define BB_TPC_9_DISABLE_PDADC_RESIDUAL_DC_REMOVAL_LSB 31 -#define BB_TPC_9_DISABLE_PDADC_RESIDUAL_DC_REMOVAL_MASK 0x80000000 -#define BB_TPC_9_DISABLE_PDADC_RESIDUAL_DC_REMOVAL_GET(x) (((x) & 0x80000000) >> 31) -#define BB_TPC_9_DISABLE_PDADC_RESIDUAL_DC_REMOVAL_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_sm_reg_map.BB_tpc_10 */ -#define BB_TPC_10_ADDRESS 0x0000021c -#define BB_TPC_10_OFFSET 0x0000021c -#define BB_TPC_10_DESIRED_SCALE_HT20_0_MSB 4 -#define BB_TPC_10_DESIRED_SCALE_HT20_0_LSB 0 -#define BB_TPC_10_DESIRED_SCALE_HT20_0_MASK 0x0000001f -#define BB_TPC_10_DESIRED_SCALE_HT20_0_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_TPC_10_DESIRED_SCALE_HT20_0_SET(x) (((x) << 0) & 0x0000001f) -#define BB_TPC_10_DESIRED_SCALE_HT20_1_MSB 9 -#define BB_TPC_10_DESIRED_SCALE_HT20_1_LSB 5 -#define BB_TPC_10_DESIRED_SCALE_HT20_1_MASK 0x000003e0 -#define BB_TPC_10_DESIRED_SCALE_HT20_1_GET(x) (((x) & 0x000003e0) >> 5) -#define BB_TPC_10_DESIRED_SCALE_HT20_1_SET(x) (((x) << 5) & 0x000003e0) -#define BB_TPC_10_DESIRED_SCALE_HT20_2_MSB 14 -#define BB_TPC_10_DESIRED_SCALE_HT20_2_LSB 10 -#define BB_TPC_10_DESIRED_SCALE_HT20_2_MASK 0x00007c00 -#define BB_TPC_10_DESIRED_SCALE_HT20_2_GET(x) (((x) & 0x00007c00) >> 10) -#define BB_TPC_10_DESIRED_SCALE_HT20_2_SET(x) (((x) << 10) & 0x00007c00) -#define BB_TPC_10_DESIRED_SCALE_HT20_3_MSB 19 -#define BB_TPC_10_DESIRED_SCALE_HT20_3_LSB 15 -#define BB_TPC_10_DESIRED_SCALE_HT20_3_MASK 0x000f8000 -#define BB_TPC_10_DESIRED_SCALE_HT20_3_GET(x) (((x) & 0x000f8000) >> 15) -#define BB_TPC_10_DESIRED_SCALE_HT20_3_SET(x) (((x) << 15) & 0x000f8000) -#define BB_TPC_10_DESIRED_SCALE_HT20_4_MSB 24 -#define BB_TPC_10_DESIRED_SCALE_HT20_4_LSB 20 -#define BB_TPC_10_DESIRED_SCALE_HT20_4_MASK 0x01f00000 -#define BB_TPC_10_DESIRED_SCALE_HT20_4_GET(x) (((x) & 0x01f00000) >> 20) -#define BB_TPC_10_DESIRED_SCALE_HT20_4_SET(x) (((x) << 20) & 0x01f00000) -#define BB_TPC_10_DESIRED_SCALE_HT20_5_MSB 29 -#define BB_TPC_10_DESIRED_SCALE_HT20_5_LSB 25 -#define BB_TPC_10_DESIRED_SCALE_HT20_5_MASK 0x3e000000 -#define BB_TPC_10_DESIRED_SCALE_HT20_5_GET(x) (((x) & 0x3e000000) >> 25) -#define BB_TPC_10_DESIRED_SCALE_HT20_5_SET(x) (((x) << 25) & 0x3e000000) - -/* macros for bb_sm_reg_map.BB_tpc_11_b0 */ -#define BB_TPC_11_B0_ADDRESS 0x00000220 -#define BB_TPC_11_B0_OFFSET 0x00000220 -#define BB_TPC_11_B0_DESIRED_SCALE_HT20_6_MSB 4 -#define BB_TPC_11_B0_DESIRED_SCALE_HT20_6_LSB 0 -#define BB_TPC_11_B0_DESIRED_SCALE_HT20_6_MASK 0x0000001f -#define BB_TPC_11_B0_DESIRED_SCALE_HT20_6_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_TPC_11_B0_DESIRED_SCALE_HT20_6_SET(x) (((x) << 0) & 0x0000001f) -#define BB_TPC_11_B0_DESIRED_SCALE_HT20_7_MSB 9 -#define BB_TPC_11_B0_DESIRED_SCALE_HT20_7_LSB 5 -#define BB_TPC_11_B0_DESIRED_SCALE_HT20_7_MASK 0x000003e0 -#define BB_TPC_11_B0_DESIRED_SCALE_HT20_7_GET(x) (((x) & 0x000003e0) >> 5) -#define BB_TPC_11_B0_DESIRED_SCALE_HT20_7_SET(x) (((x) << 5) & 0x000003e0) -#define BB_TPC_11_B0_OLPC_GAIN_DELTA_0_MSB 23 -#define BB_TPC_11_B0_OLPC_GAIN_DELTA_0_LSB 16 -#define BB_TPC_11_B0_OLPC_GAIN_DELTA_0_MASK 0x00ff0000 -#define BB_TPC_11_B0_OLPC_GAIN_DELTA_0_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_TPC_11_B0_OLPC_GAIN_DELTA_0_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_TPC_11_B0_OLPC_GAIN_DELTA_0_LSB_EXT_MSB 25 -#define BB_TPC_11_B0_OLPC_GAIN_DELTA_0_LSB_EXT_LSB 24 -#define BB_TPC_11_B0_OLPC_GAIN_DELTA_0_LSB_EXT_MASK 0x03000000 -#define BB_TPC_11_B0_OLPC_GAIN_DELTA_0_LSB_EXT_GET(x) (((x) & 0x03000000) >> 24) -#define BB_TPC_11_B0_OLPC_GAIN_DELTA_0_LSB_EXT_SET(x) (((x) << 24) & 0x03000000) - -/* macros for bb_sm_reg_map.BB_tpc_12 */ -#define BB_TPC_12_ADDRESS 0x00000224 -#define BB_TPC_12_OFFSET 0x00000224 -#define BB_TPC_12_DESIRED_SCALE_HT40_0_MSB 4 -#define BB_TPC_12_DESIRED_SCALE_HT40_0_LSB 0 -#define BB_TPC_12_DESIRED_SCALE_HT40_0_MASK 0x0000001f -#define BB_TPC_12_DESIRED_SCALE_HT40_0_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_TPC_12_DESIRED_SCALE_HT40_0_SET(x) (((x) << 0) & 0x0000001f) -#define BB_TPC_12_DESIRED_SCALE_HT40_1_MSB 9 -#define BB_TPC_12_DESIRED_SCALE_HT40_1_LSB 5 -#define BB_TPC_12_DESIRED_SCALE_HT40_1_MASK 0x000003e0 -#define BB_TPC_12_DESIRED_SCALE_HT40_1_GET(x) (((x) & 0x000003e0) >> 5) -#define BB_TPC_12_DESIRED_SCALE_HT40_1_SET(x) (((x) << 5) & 0x000003e0) -#define BB_TPC_12_DESIRED_SCALE_HT40_2_MSB 14 -#define BB_TPC_12_DESIRED_SCALE_HT40_2_LSB 10 -#define BB_TPC_12_DESIRED_SCALE_HT40_2_MASK 0x00007c00 -#define BB_TPC_12_DESIRED_SCALE_HT40_2_GET(x) (((x) & 0x00007c00) >> 10) -#define BB_TPC_12_DESIRED_SCALE_HT40_2_SET(x) (((x) << 10) & 0x00007c00) -#define BB_TPC_12_DESIRED_SCALE_HT40_3_MSB 19 -#define BB_TPC_12_DESIRED_SCALE_HT40_3_LSB 15 -#define BB_TPC_12_DESIRED_SCALE_HT40_3_MASK 0x000f8000 -#define BB_TPC_12_DESIRED_SCALE_HT40_3_GET(x) (((x) & 0x000f8000) >> 15) -#define BB_TPC_12_DESIRED_SCALE_HT40_3_SET(x) (((x) << 15) & 0x000f8000) -#define BB_TPC_12_DESIRED_SCALE_HT40_4_MSB 24 -#define BB_TPC_12_DESIRED_SCALE_HT40_4_LSB 20 -#define BB_TPC_12_DESIRED_SCALE_HT40_4_MASK 0x01f00000 -#define BB_TPC_12_DESIRED_SCALE_HT40_4_GET(x) (((x) & 0x01f00000) >> 20) -#define BB_TPC_12_DESIRED_SCALE_HT40_4_SET(x) (((x) << 20) & 0x01f00000) -#define BB_TPC_12_DESIRED_SCALE_HT40_5_MSB 29 -#define BB_TPC_12_DESIRED_SCALE_HT40_5_LSB 25 -#define BB_TPC_12_DESIRED_SCALE_HT40_5_MASK 0x3e000000 -#define BB_TPC_12_DESIRED_SCALE_HT40_5_GET(x) (((x) & 0x3e000000) >> 25) -#define BB_TPC_12_DESIRED_SCALE_HT40_5_SET(x) (((x) << 25) & 0x3e000000) - -/* macros for bb_sm_reg_map.BB_tpc_13 */ -#define BB_TPC_13_ADDRESS 0x00000228 -#define BB_TPC_13_OFFSET 0x00000228 -#define BB_TPC_13_DESIRED_SCALE_HT40_6_MSB 4 -#define BB_TPC_13_DESIRED_SCALE_HT40_6_LSB 0 -#define BB_TPC_13_DESIRED_SCALE_HT40_6_MASK 0x0000001f -#define BB_TPC_13_DESIRED_SCALE_HT40_6_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_TPC_13_DESIRED_SCALE_HT40_6_SET(x) (((x) << 0) & 0x0000001f) -#define BB_TPC_13_DESIRED_SCALE_HT40_7_MSB 9 -#define BB_TPC_13_DESIRED_SCALE_HT40_7_LSB 5 -#define BB_TPC_13_DESIRED_SCALE_HT40_7_MASK 0x000003e0 -#define BB_TPC_13_DESIRED_SCALE_HT40_7_GET(x) (((x) & 0x000003e0) >> 5) -#define BB_TPC_13_DESIRED_SCALE_HT40_7_SET(x) (((x) << 5) & 0x000003e0) - -/* macros for bb_sm_reg_map.BB_tpc_14 */ -#define BB_TPC_14_ADDRESS 0x0000022c -#define BB_TPC_14_OFFSET 0x0000022c -#define BB_TPC_14_DESIRED_SCALE_HT20_8_MSB 4 -#define BB_TPC_14_DESIRED_SCALE_HT20_8_LSB 0 -#define BB_TPC_14_DESIRED_SCALE_HT20_8_MASK 0x0000001f -#define BB_TPC_14_DESIRED_SCALE_HT20_8_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_TPC_14_DESIRED_SCALE_HT20_8_SET(x) (((x) << 0) & 0x0000001f) -#define BB_TPC_14_DESIRED_SCALE_HT20_9_MSB 9 -#define BB_TPC_14_DESIRED_SCALE_HT20_9_LSB 5 -#define BB_TPC_14_DESIRED_SCALE_HT20_9_MASK 0x000003e0 -#define BB_TPC_14_DESIRED_SCALE_HT20_9_GET(x) (((x) & 0x000003e0) >> 5) -#define BB_TPC_14_DESIRED_SCALE_HT20_9_SET(x) (((x) << 5) & 0x000003e0) -#define BB_TPC_14_DESIRED_SCALE_HT20_10_MSB 14 -#define BB_TPC_14_DESIRED_SCALE_HT20_10_LSB 10 -#define BB_TPC_14_DESIRED_SCALE_HT20_10_MASK 0x00007c00 -#define BB_TPC_14_DESIRED_SCALE_HT20_10_GET(x) (((x) & 0x00007c00) >> 10) -#define BB_TPC_14_DESIRED_SCALE_HT20_10_SET(x) (((x) << 10) & 0x00007c00) -#define BB_TPC_14_DESIRED_SCALE_HT20_11_MSB 19 -#define BB_TPC_14_DESIRED_SCALE_HT20_11_LSB 15 -#define BB_TPC_14_DESIRED_SCALE_HT20_11_MASK 0x000f8000 -#define BB_TPC_14_DESIRED_SCALE_HT20_11_GET(x) (((x) & 0x000f8000) >> 15) -#define BB_TPC_14_DESIRED_SCALE_HT20_11_SET(x) (((x) << 15) & 0x000f8000) -#define BB_TPC_14_DESIRED_SCALE_HT20_12_MSB 24 -#define BB_TPC_14_DESIRED_SCALE_HT20_12_LSB 20 -#define BB_TPC_14_DESIRED_SCALE_HT20_12_MASK 0x01f00000 -#define BB_TPC_14_DESIRED_SCALE_HT20_12_GET(x) (((x) & 0x01f00000) >> 20) -#define BB_TPC_14_DESIRED_SCALE_HT20_12_SET(x) (((x) << 20) & 0x01f00000) -#define BB_TPC_14_DESIRED_SCALE_HT20_13_MSB 29 -#define BB_TPC_14_DESIRED_SCALE_HT20_13_LSB 25 -#define BB_TPC_14_DESIRED_SCALE_HT20_13_MASK 0x3e000000 -#define BB_TPC_14_DESIRED_SCALE_HT20_13_GET(x) (((x) & 0x3e000000) >> 25) -#define BB_TPC_14_DESIRED_SCALE_HT20_13_SET(x) (((x) << 25) & 0x3e000000) - -/* macros for bb_sm_reg_map.BB_tpc_15 */ -#define BB_TPC_15_ADDRESS 0x00000230 -#define BB_TPC_15_OFFSET 0x00000230 -#define BB_TPC_15_DESIRED_SCALE_HT40_8_MSB 4 -#define BB_TPC_15_DESIRED_SCALE_HT40_8_LSB 0 -#define BB_TPC_15_DESIRED_SCALE_HT40_8_MASK 0x0000001f -#define BB_TPC_15_DESIRED_SCALE_HT40_8_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_TPC_15_DESIRED_SCALE_HT40_8_SET(x) (((x) << 0) & 0x0000001f) -#define BB_TPC_15_DESIRED_SCALE_HT40_9_MSB 9 -#define BB_TPC_15_DESIRED_SCALE_HT40_9_LSB 5 -#define BB_TPC_15_DESIRED_SCALE_HT40_9_MASK 0x000003e0 -#define BB_TPC_15_DESIRED_SCALE_HT40_9_GET(x) (((x) & 0x000003e0) >> 5) -#define BB_TPC_15_DESIRED_SCALE_HT40_9_SET(x) (((x) << 5) & 0x000003e0) -#define BB_TPC_15_DESIRED_SCALE_HT40_10_MSB 14 -#define BB_TPC_15_DESIRED_SCALE_HT40_10_LSB 10 -#define BB_TPC_15_DESIRED_SCALE_HT40_10_MASK 0x00007c00 -#define BB_TPC_15_DESIRED_SCALE_HT40_10_GET(x) (((x) & 0x00007c00) >> 10) -#define BB_TPC_15_DESIRED_SCALE_HT40_10_SET(x) (((x) << 10) & 0x00007c00) -#define BB_TPC_15_DESIRED_SCALE_HT40_11_MSB 19 -#define BB_TPC_15_DESIRED_SCALE_HT40_11_LSB 15 -#define BB_TPC_15_DESIRED_SCALE_HT40_11_MASK 0x000f8000 -#define BB_TPC_15_DESIRED_SCALE_HT40_11_GET(x) (((x) & 0x000f8000) >> 15) -#define BB_TPC_15_DESIRED_SCALE_HT40_11_SET(x) (((x) << 15) & 0x000f8000) -#define BB_TPC_15_DESIRED_SCALE_HT40_12_MSB 24 -#define BB_TPC_15_DESIRED_SCALE_HT40_12_LSB 20 -#define BB_TPC_15_DESIRED_SCALE_HT40_12_MASK 0x01f00000 -#define BB_TPC_15_DESIRED_SCALE_HT40_12_GET(x) (((x) & 0x01f00000) >> 20) -#define BB_TPC_15_DESIRED_SCALE_HT40_12_SET(x) (((x) << 20) & 0x01f00000) -#define BB_TPC_15_DESIRED_SCALE_HT40_13_MSB 29 -#define BB_TPC_15_DESIRED_SCALE_HT40_13_LSB 25 -#define BB_TPC_15_DESIRED_SCALE_HT40_13_MASK 0x3e000000 -#define BB_TPC_15_DESIRED_SCALE_HT40_13_GET(x) (((x) & 0x3e000000) >> 25) -#define BB_TPC_15_DESIRED_SCALE_HT40_13_SET(x) (((x) << 25) & 0x3e000000) - -/* macros for bb_sm_reg_map.BB_tpc_16 */ -#define BB_TPC_16_ADDRESS 0x00000234 -#define BB_TPC_16_OFFSET 0x00000234 -#define BB_TPC_16_PDADC_PAR_CORR_CCK_MSB 13 -#define BB_TPC_16_PDADC_PAR_CORR_CCK_LSB 8 -#define BB_TPC_16_PDADC_PAR_CORR_CCK_MASK 0x00003f00 -#define BB_TPC_16_PDADC_PAR_CORR_CCK_GET(x) (((x) & 0x00003f00) >> 8) -#define BB_TPC_16_PDADC_PAR_CORR_CCK_SET(x) (((x) << 8) & 0x00003f00) -#define BB_TPC_16_PDADC_PAR_CORR_OFDM_MSB 21 -#define BB_TPC_16_PDADC_PAR_CORR_OFDM_LSB 16 -#define BB_TPC_16_PDADC_PAR_CORR_OFDM_MASK 0x003f0000 -#define BB_TPC_16_PDADC_PAR_CORR_OFDM_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_TPC_16_PDADC_PAR_CORR_OFDM_SET(x) (((x) << 16) & 0x003f0000) -#define BB_TPC_16_PDADC_PAR_CORR_HT40_MSB 29 -#define BB_TPC_16_PDADC_PAR_CORR_HT40_LSB 24 -#define BB_TPC_16_PDADC_PAR_CORR_HT40_MASK 0x3f000000 -#define BB_TPC_16_PDADC_PAR_CORR_HT40_GET(x) (((x) & 0x3f000000) >> 24) -#define BB_TPC_16_PDADC_PAR_CORR_HT40_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for bb_sm_reg_map.BB_tpc_17 */ -#define BB_TPC_17_ADDRESS 0x00000238 -#define BB_TPC_17_OFFSET 0x00000238 -#define BB_TPC_17_ENABLE_PAL_MSB 0 -#define BB_TPC_17_ENABLE_PAL_LSB 0 -#define BB_TPC_17_ENABLE_PAL_MASK 0x00000001 -#define BB_TPC_17_ENABLE_PAL_GET(x) (((x) & 0x00000001) >> 0) -#define BB_TPC_17_ENABLE_PAL_SET(x) (((x) << 0) & 0x00000001) -#define BB_TPC_17_ENABLE_PAL_CCK_MSB 1 -#define BB_TPC_17_ENABLE_PAL_CCK_LSB 1 -#define BB_TPC_17_ENABLE_PAL_CCK_MASK 0x00000002 -#define BB_TPC_17_ENABLE_PAL_CCK_GET(x) (((x) & 0x00000002) >> 1) -#define BB_TPC_17_ENABLE_PAL_CCK_SET(x) (((x) << 1) & 0x00000002) -#define BB_TPC_17_ENABLE_PAL_OFDM_20_MSB 2 -#define BB_TPC_17_ENABLE_PAL_OFDM_20_LSB 2 -#define BB_TPC_17_ENABLE_PAL_OFDM_20_MASK 0x00000004 -#define BB_TPC_17_ENABLE_PAL_OFDM_20_GET(x) (((x) & 0x00000004) >> 2) -#define BB_TPC_17_ENABLE_PAL_OFDM_20_SET(x) (((x) << 2) & 0x00000004) -#define BB_TPC_17_ENABLE_PAL_OFDM_40_MSB 3 -#define BB_TPC_17_ENABLE_PAL_OFDM_40_LSB 3 -#define BB_TPC_17_ENABLE_PAL_OFDM_40_MASK 0x00000008 -#define BB_TPC_17_ENABLE_PAL_OFDM_40_GET(x) (((x) & 0x00000008) >> 3) -#define BB_TPC_17_ENABLE_PAL_OFDM_40_SET(x) (((x) << 3) & 0x00000008) -#define BB_TPC_17_PAL_POWER_THRESHOLD_MSB 9 -#define BB_TPC_17_PAL_POWER_THRESHOLD_LSB 4 -#define BB_TPC_17_PAL_POWER_THRESHOLD_MASK 0x000003f0 -#define BB_TPC_17_PAL_POWER_THRESHOLD_GET(x) (((x) & 0x000003f0) >> 4) -#define BB_TPC_17_PAL_POWER_THRESHOLD_SET(x) (((x) << 4) & 0x000003f0) -#define BB_TPC_17_FORCE_PAL_LOCKED_MSB 10 -#define BB_TPC_17_FORCE_PAL_LOCKED_LSB 10 -#define BB_TPC_17_FORCE_PAL_LOCKED_MASK 0x00000400 -#define BB_TPC_17_FORCE_PAL_LOCKED_GET(x) (((x) & 0x00000400) >> 10) -#define BB_TPC_17_FORCE_PAL_LOCKED_SET(x) (((x) << 10) & 0x00000400) -#define BB_TPC_17_INIT_TX_GAIN_SETTING_PAL_ON_MSB 16 -#define BB_TPC_17_INIT_TX_GAIN_SETTING_PAL_ON_LSB 11 -#define BB_TPC_17_INIT_TX_GAIN_SETTING_PAL_ON_MASK 0x0001f800 -#define BB_TPC_17_INIT_TX_GAIN_SETTING_PAL_ON_GET(x) (((x) & 0x0001f800) >> 11) -#define BB_TPC_17_INIT_TX_GAIN_SETTING_PAL_ON_SET(x) (((x) << 11) & 0x0001f800) - -/* macros for bb_sm_reg_map.BB_tpc_18 */ -#define BB_TPC_18_ADDRESS 0x0000023c -#define BB_TPC_18_OFFSET 0x0000023c -#define BB_TPC_18_THERM_CAL_VALUE_MSB 7 -#define BB_TPC_18_THERM_CAL_VALUE_LSB 0 -#define BB_TPC_18_THERM_CAL_VALUE_MASK 0x000000ff -#define BB_TPC_18_THERM_CAL_VALUE_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_TPC_18_THERM_CAL_VALUE_SET(x) (((x) << 0) & 0x000000ff) -#define BB_TPC_18_VOLT_CAL_VALUE_MSB 15 -#define BB_TPC_18_VOLT_CAL_VALUE_LSB 8 -#define BB_TPC_18_VOLT_CAL_VALUE_MASK 0x0000ff00 -#define BB_TPC_18_VOLT_CAL_VALUE_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_TPC_18_VOLT_CAL_VALUE_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_TPC_18_USE_LEGACY_TPC_MSB 16 -#define BB_TPC_18_USE_LEGACY_TPC_LSB 16 -#define BB_TPC_18_USE_LEGACY_TPC_MASK 0x00010000 -#define BB_TPC_18_USE_LEGACY_TPC_GET(x) (((x) & 0x00010000) >> 16) -#define BB_TPC_18_USE_LEGACY_TPC_SET(x) (((x) << 16) & 0x00010000) -#define BB_TPC_18_MIN_POWER_THERM_VOLT_GAIN_CORR_MSB 22 -#define BB_TPC_18_MIN_POWER_THERM_VOLT_GAIN_CORR_LSB 17 -#define BB_TPC_18_MIN_POWER_THERM_VOLT_GAIN_CORR_MASK 0x007e0000 -#define BB_TPC_18_MIN_POWER_THERM_VOLT_GAIN_CORR_GET(x) (((x) & 0x007e0000) >> 17) -#define BB_TPC_18_MIN_POWER_THERM_VOLT_GAIN_CORR_SET(x) (((x) << 17) & 0x007e0000) - -/* macros for bb_sm_reg_map.BB_tpc_19_b0 */ -#define BB_TPC_19_B0_ADDRESS 0x00000240 -#define BB_TPC_19_B0_OFFSET 0x00000240 -#define BB_TPC_19_B0_ALPHA_THERM_0_MSB 7 -#define BB_TPC_19_B0_ALPHA_THERM_0_LSB 0 -#define BB_TPC_19_B0_ALPHA_THERM_0_MASK 0x000000ff -#define BB_TPC_19_B0_ALPHA_THERM_0_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_TPC_19_B0_ALPHA_THERM_0_SET(x) (((x) << 0) & 0x000000ff) -#define BB_TPC_19_B0_ALPHA_THERM_PAL_ON_0_MSB 15 -#define BB_TPC_19_B0_ALPHA_THERM_PAL_ON_0_LSB 8 -#define BB_TPC_19_B0_ALPHA_THERM_PAL_ON_0_MASK 0x0000ff00 -#define BB_TPC_19_B0_ALPHA_THERM_PAL_ON_0_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_TPC_19_B0_ALPHA_THERM_PAL_ON_0_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_TPC_19_B0_ALPHA_VOLT_0_MSB 22 -#define BB_TPC_19_B0_ALPHA_VOLT_0_LSB 16 -#define BB_TPC_19_B0_ALPHA_VOLT_0_MASK 0x007f0000 -#define BB_TPC_19_B0_ALPHA_VOLT_0_GET(x) (((x) & 0x007f0000) >> 16) -#define BB_TPC_19_B0_ALPHA_VOLT_0_SET(x) (((x) << 16) & 0x007f0000) -#define BB_TPC_19_B0_ALPHA_VOLT_PAL_ON_0_MSB 29 -#define BB_TPC_19_B0_ALPHA_VOLT_PAL_ON_0_LSB 23 -#define BB_TPC_19_B0_ALPHA_VOLT_PAL_ON_0_MASK 0x3f800000 -#define BB_TPC_19_B0_ALPHA_VOLT_PAL_ON_0_GET(x) (((x) & 0x3f800000) >> 23) -#define BB_TPC_19_B0_ALPHA_VOLT_PAL_ON_0_SET(x) (((x) << 23) & 0x3f800000) - -/* macros for bb_sm_reg_map.BB_tpc_20 */ -#define BB_TPC_20_ADDRESS 0x00000244 -#define BB_TPC_20_OFFSET 0x00000244 -#define BB_TPC_20_ENABLE_PAL_MCS_0_MSB 0 -#define BB_TPC_20_ENABLE_PAL_MCS_0_LSB 0 -#define BB_TPC_20_ENABLE_PAL_MCS_0_MASK 0x00000001 -#define BB_TPC_20_ENABLE_PAL_MCS_0_GET(x) (((x) & 0x00000001) >> 0) -#define BB_TPC_20_ENABLE_PAL_MCS_0_SET(x) (((x) << 0) & 0x00000001) -#define BB_TPC_20_ENABLE_PAL_MCS_1_MSB 1 -#define BB_TPC_20_ENABLE_PAL_MCS_1_LSB 1 -#define BB_TPC_20_ENABLE_PAL_MCS_1_MASK 0x00000002 -#define BB_TPC_20_ENABLE_PAL_MCS_1_GET(x) (((x) & 0x00000002) >> 1) -#define BB_TPC_20_ENABLE_PAL_MCS_1_SET(x) (((x) << 1) & 0x00000002) -#define BB_TPC_20_ENABLE_PAL_MCS_2_MSB 2 -#define BB_TPC_20_ENABLE_PAL_MCS_2_LSB 2 -#define BB_TPC_20_ENABLE_PAL_MCS_2_MASK 0x00000004 -#define BB_TPC_20_ENABLE_PAL_MCS_2_GET(x) (((x) & 0x00000004) >> 2) -#define BB_TPC_20_ENABLE_PAL_MCS_2_SET(x) (((x) << 2) & 0x00000004) -#define BB_TPC_20_ENABLE_PAL_MCS_3_MSB 3 -#define BB_TPC_20_ENABLE_PAL_MCS_3_LSB 3 -#define BB_TPC_20_ENABLE_PAL_MCS_3_MASK 0x00000008 -#define BB_TPC_20_ENABLE_PAL_MCS_3_GET(x) (((x) & 0x00000008) >> 3) -#define BB_TPC_20_ENABLE_PAL_MCS_3_SET(x) (((x) << 3) & 0x00000008) -#define BB_TPC_20_ENABLE_PAL_MCS_4_MSB 4 -#define BB_TPC_20_ENABLE_PAL_MCS_4_LSB 4 -#define BB_TPC_20_ENABLE_PAL_MCS_4_MASK 0x00000010 -#define BB_TPC_20_ENABLE_PAL_MCS_4_GET(x) (((x) & 0x00000010) >> 4) -#define BB_TPC_20_ENABLE_PAL_MCS_4_SET(x) (((x) << 4) & 0x00000010) -#define BB_TPC_20_ENABLE_PAL_MCS_5_MSB 5 -#define BB_TPC_20_ENABLE_PAL_MCS_5_LSB 5 -#define BB_TPC_20_ENABLE_PAL_MCS_5_MASK 0x00000020 -#define BB_TPC_20_ENABLE_PAL_MCS_5_GET(x) (((x) & 0x00000020) >> 5) -#define BB_TPC_20_ENABLE_PAL_MCS_5_SET(x) (((x) << 5) & 0x00000020) -#define BB_TPC_20_ENABLE_PAL_MCS_6_MSB 6 -#define BB_TPC_20_ENABLE_PAL_MCS_6_LSB 6 -#define BB_TPC_20_ENABLE_PAL_MCS_6_MASK 0x00000040 -#define BB_TPC_20_ENABLE_PAL_MCS_6_GET(x) (((x) & 0x00000040) >> 6) -#define BB_TPC_20_ENABLE_PAL_MCS_6_SET(x) (((x) << 6) & 0x00000040) -#define BB_TPC_20_ENABLE_PAL_MCS_7_MSB 7 -#define BB_TPC_20_ENABLE_PAL_MCS_7_LSB 7 -#define BB_TPC_20_ENABLE_PAL_MCS_7_MASK 0x00000080 -#define BB_TPC_20_ENABLE_PAL_MCS_7_GET(x) (((x) & 0x00000080) >> 7) -#define BB_TPC_20_ENABLE_PAL_MCS_7_SET(x) (((x) << 7) & 0x00000080) -#define BB_TPC_20_ENABLE_PAL_MCS_8_MSB 8 -#define BB_TPC_20_ENABLE_PAL_MCS_8_LSB 8 -#define BB_TPC_20_ENABLE_PAL_MCS_8_MASK 0x00000100 -#define BB_TPC_20_ENABLE_PAL_MCS_8_GET(x) (((x) & 0x00000100) >> 8) -#define BB_TPC_20_ENABLE_PAL_MCS_8_SET(x) (((x) << 8) & 0x00000100) -#define BB_TPC_20_ENABLE_PAL_MCS_9_MSB 9 -#define BB_TPC_20_ENABLE_PAL_MCS_9_LSB 9 -#define BB_TPC_20_ENABLE_PAL_MCS_9_MASK 0x00000200 -#define BB_TPC_20_ENABLE_PAL_MCS_9_GET(x) (((x) & 0x00000200) >> 9) -#define BB_TPC_20_ENABLE_PAL_MCS_9_SET(x) (((x) << 9) & 0x00000200) -#define BB_TPC_20_ENABLE_PAL_MCS_10_MSB 10 -#define BB_TPC_20_ENABLE_PAL_MCS_10_LSB 10 -#define BB_TPC_20_ENABLE_PAL_MCS_10_MASK 0x00000400 -#define BB_TPC_20_ENABLE_PAL_MCS_10_GET(x) (((x) & 0x00000400) >> 10) -#define BB_TPC_20_ENABLE_PAL_MCS_10_SET(x) (((x) << 10) & 0x00000400) -#define BB_TPC_20_ENABLE_PAL_MCS_11_MSB 11 -#define BB_TPC_20_ENABLE_PAL_MCS_11_LSB 11 -#define BB_TPC_20_ENABLE_PAL_MCS_11_MASK 0x00000800 -#define BB_TPC_20_ENABLE_PAL_MCS_11_GET(x) (((x) & 0x00000800) >> 11) -#define BB_TPC_20_ENABLE_PAL_MCS_11_SET(x) (((x) << 11) & 0x00000800) -#define BB_TPC_20_ENABLE_PAL_MCS_12_MSB 12 -#define BB_TPC_20_ENABLE_PAL_MCS_12_LSB 12 -#define BB_TPC_20_ENABLE_PAL_MCS_12_MASK 0x00001000 -#define BB_TPC_20_ENABLE_PAL_MCS_12_GET(x) (((x) & 0x00001000) >> 12) -#define BB_TPC_20_ENABLE_PAL_MCS_12_SET(x) (((x) << 12) & 0x00001000) -#define BB_TPC_20_ENABLE_PAL_MCS_13_MSB 13 -#define BB_TPC_20_ENABLE_PAL_MCS_13_LSB 13 -#define BB_TPC_20_ENABLE_PAL_MCS_13_MASK 0x00002000 -#define BB_TPC_20_ENABLE_PAL_MCS_13_GET(x) (((x) & 0x00002000) >> 13) -#define BB_TPC_20_ENABLE_PAL_MCS_13_SET(x) (((x) << 13) & 0x00002000) -#define BB_TPC_20_ENABLE_PAL_MCS_14_MSB 14 -#define BB_TPC_20_ENABLE_PAL_MCS_14_LSB 14 -#define BB_TPC_20_ENABLE_PAL_MCS_14_MASK 0x00004000 -#define BB_TPC_20_ENABLE_PAL_MCS_14_GET(x) (((x) & 0x00004000) >> 14) -#define BB_TPC_20_ENABLE_PAL_MCS_14_SET(x) (((x) << 14) & 0x00004000) -#define BB_TPC_20_ENABLE_PAL_MCS_15_MSB 15 -#define BB_TPC_20_ENABLE_PAL_MCS_15_LSB 15 -#define BB_TPC_20_ENABLE_PAL_MCS_15_MASK 0x00008000 -#define BB_TPC_20_ENABLE_PAL_MCS_15_GET(x) (((x) & 0x00008000) >> 15) -#define BB_TPC_20_ENABLE_PAL_MCS_15_SET(x) (((x) << 15) & 0x00008000) -#define BB_TPC_20_ENABLE_PAL_MCS_16_MSB 16 -#define BB_TPC_20_ENABLE_PAL_MCS_16_LSB 16 -#define BB_TPC_20_ENABLE_PAL_MCS_16_MASK 0x00010000 -#define BB_TPC_20_ENABLE_PAL_MCS_16_GET(x) (((x) & 0x00010000) >> 16) -#define BB_TPC_20_ENABLE_PAL_MCS_16_SET(x) (((x) << 16) & 0x00010000) -#define BB_TPC_20_ENABLE_PAL_MCS_17_MSB 17 -#define BB_TPC_20_ENABLE_PAL_MCS_17_LSB 17 -#define BB_TPC_20_ENABLE_PAL_MCS_17_MASK 0x00020000 -#define BB_TPC_20_ENABLE_PAL_MCS_17_GET(x) (((x) & 0x00020000) >> 17) -#define BB_TPC_20_ENABLE_PAL_MCS_17_SET(x) (((x) << 17) & 0x00020000) -#define BB_TPC_20_ENABLE_PAL_MCS_18_MSB 18 -#define BB_TPC_20_ENABLE_PAL_MCS_18_LSB 18 -#define BB_TPC_20_ENABLE_PAL_MCS_18_MASK 0x00040000 -#define BB_TPC_20_ENABLE_PAL_MCS_18_GET(x) (((x) & 0x00040000) >> 18) -#define BB_TPC_20_ENABLE_PAL_MCS_18_SET(x) (((x) << 18) & 0x00040000) -#define BB_TPC_20_ENABLE_PAL_MCS_19_MSB 19 -#define BB_TPC_20_ENABLE_PAL_MCS_19_LSB 19 -#define BB_TPC_20_ENABLE_PAL_MCS_19_MASK 0x00080000 -#define BB_TPC_20_ENABLE_PAL_MCS_19_GET(x) (((x) & 0x00080000) >> 19) -#define BB_TPC_20_ENABLE_PAL_MCS_19_SET(x) (((x) << 19) & 0x00080000) -#define BB_TPC_20_ENABLE_PAL_MCS_20_MSB 20 -#define BB_TPC_20_ENABLE_PAL_MCS_20_LSB 20 -#define BB_TPC_20_ENABLE_PAL_MCS_20_MASK 0x00100000 -#define BB_TPC_20_ENABLE_PAL_MCS_20_GET(x) (((x) & 0x00100000) >> 20) -#define BB_TPC_20_ENABLE_PAL_MCS_20_SET(x) (((x) << 20) & 0x00100000) -#define BB_TPC_20_ENABLE_PAL_MCS_21_MSB 21 -#define BB_TPC_20_ENABLE_PAL_MCS_21_LSB 21 -#define BB_TPC_20_ENABLE_PAL_MCS_21_MASK 0x00200000 -#define BB_TPC_20_ENABLE_PAL_MCS_21_GET(x) (((x) & 0x00200000) >> 21) -#define BB_TPC_20_ENABLE_PAL_MCS_21_SET(x) (((x) << 21) & 0x00200000) -#define BB_TPC_20_ENABLE_PAL_MCS_22_MSB 22 -#define BB_TPC_20_ENABLE_PAL_MCS_22_LSB 22 -#define BB_TPC_20_ENABLE_PAL_MCS_22_MASK 0x00400000 -#define BB_TPC_20_ENABLE_PAL_MCS_22_GET(x) (((x) & 0x00400000) >> 22) -#define BB_TPC_20_ENABLE_PAL_MCS_22_SET(x) (((x) << 22) & 0x00400000) -#define BB_TPC_20_ENABLE_PAL_MCS_23_MSB 23 -#define BB_TPC_20_ENABLE_PAL_MCS_23_LSB 23 -#define BB_TPC_20_ENABLE_PAL_MCS_23_MASK 0x00800000 -#define BB_TPC_20_ENABLE_PAL_MCS_23_GET(x) (((x) & 0x00800000) >> 23) -#define BB_TPC_20_ENABLE_PAL_MCS_23_SET(x) (((x) << 23) & 0x00800000) - -/* macros for bb_sm_reg_map.BB_therm_adc_1 */ -#define BB_THERM_ADC_1_ADDRESS 0x00000248 -#define BB_THERM_ADC_1_OFFSET 0x00000248 -#define BB_THERM_ADC_1_INIT_THERM_SETTING_MSB 7 -#define BB_THERM_ADC_1_INIT_THERM_SETTING_LSB 0 -#define BB_THERM_ADC_1_INIT_THERM_SETTING_MASK 0x000000ff -#define BB_THERM_ADC_1_INIT_THERM_SETTING_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_THERM_ADC_1_INIT_THERM_SETTING_SET(x) (((x) << 0) & 0x000000ff) -#define BB_THERM_ADC_1_INIT_VOLT_SETTING_MSB 15 -#define BB_THERM_ADC_1_INIT_VOLT_SETTING_LSB 8 -#define BB_THERM_ADC_1_INIT_VOLT_SETTING_MASK 0x0000ff00 -#define BB_THERM_ADC_1_INIT_VOLT_SETTING_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_THERM_ADC_1_INIT_VOLT_SETTING_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_THERM_ADC_1_INIT_ATB_SETTING_MSB 23 -#define BB_THERM_ADC_1_INIT_ATB_SETTING_LSB 16 -#define BB_THERM_ADC_1_INIT_ATB_SETTING_MASK 0x00ff0000 -#define BB_THERM_ADC_1_INIT_ATB_SETTING_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_THERM_ADC_1_INIT_ATB_SETTING_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_THERM_ADC_1_SAMPLES_CNT_CODING_MSB 25 -#define BB_THERM_ADC_1_SAMPLES_CNT_CODING_LSB 24 -#define BB_THERM_ADC_1_SAMPLES_CNT_CODING_MASK 0x03000000 -#define BB_THERM_ADC_1_SAMPLES_CNT_CODING_GET(x) (((x) & 0x03000000) >> 24) -#define BB_THERM_ADC_1_SAMPLES_CNT_CODING_SET(x) (((x) << 24) & 0x03000000) -#define BB_THERM_ADC_1_USE_INIT_THERM_VOLT_ATB_AFTER_WARM_RESET_MSB 26 -#define BB_THERM_ADC_1_USE_INIT_THERM_VOLT_ATB_AFTER_WARM_RESET_LSB 26 -#define BB_THERM_ADC_1_USE_INIT_THERM_VOLT_ATB_AFTER_WARM_RESET_MASK 0x04000000 -#define BB_THERM_ADC_1_USE_INIT_THERM_VOLT_ATB_AFTER_WARM_RESET_GET(x) (((x) & 0x04000000) >> 26) -#define BB_THERM_ADC_1_USE_INIT_THERM_VOLT_ATB_AFTER_WARM_RESET_SET(x) (((x) << 26) & 0x04000000) -#define BB_THERM_ADC_1_FORCE_THERM_VOLT_ATB_TO_INIT_SETTINGS_MSB 27 -#define BB_THERM_ADC_1_FORCE_THERM_VOLT_ATB_TO_INIT_SETTINGS_LSB 27 -#define BB_THERM_ADC_1_FORCE_THERM_VOLT_ATB_TO_INIT_SETTINGS_MASK 0x08000000 -#define BB_THERM_ADC_1_FORCE_THERM_VOLT_ATB_TO_INIT_SETTINGS_GET(x) (((x) & 0x08000000) >> 27) -#define BB_THERM_ADC_1_FORCE_THERM_VOLT_ATB_TO_INIT_SETTINGS_SET(x) (((x) << 27) & 0x08000000) -#define BB_THERM_ADC_1_CHECK_DONE_FOR_1ST_ADC_MEAS_OF_EACH_FRAME_MSB 28 -#define BB_THERM_ADC_1_CHECK_DONE_FOR_1ST_ADC_MEAS_OF_EACH_FRAME_LSB 28 -#define BB_THERM_ADC_1_CHECK_DONE_FOR_1ST_ADC_MEAS_OF_EACH_FRAME_MASK 0x10000000 -#define BB_THERM_ADC_1_CHECK_DONE_FOR_1ST_ADC_MEAS_OF_EACH_FRAME_GET(x) (((x) & 0x10000000) >> 28) -#define BB_THERM_ADC_1_CHECK_DONE_FOR_1ST_ADC_MEAS_OF_EACH_FRAME_SET(x) (((x) << 28) & 0x10000000) -#define BB_THERM_ADC_1_THERM_MEASURE_RESET_MSB 29 -#define BB_THERM_ADC_1_THERM_MEASURE_RESET_LSB 29 -#define BB_THERM_ADC_1_THERM_MEASURE_RESET_MASK 0x20000000 -#define BB_THERM_ADC_1_THERM_MEASURE_RESET_GET(x) (((x) & 0x20000000) >> 29) -#define BB_THERM_ADC_1_THERM_MEASURE_RESET_SET(x) (((x) << 29) & 0x20000000) - -/* macros for bb_sm_reg_map.BB_therm_adc_2 */ -#define BB_THERM_ADC_2_ADDRESS 0x0000024c -#define BB_THERM_ADC_2_OFFSET 0x0000024c -#define BB_THERM_ADC_2_MEASURE_THERM_FREQ_MSB 11 -#define BB_THERM_ADC_2_MEASURE_THERM_FREQ_LSB 0 -#define BB_THERM_ADC_2_MEASURE_THERM_FREQ_MASK 0x00000fff -#define BB_THERM_ADC_2_MEASURE_THERM_FREQ_GET(x) (((x) & 0x00000fff) >> 0) -#define BB_THERM_ADC_2_MEASURE_THERM_FREQ_SET(x) (((x) << 0) & 0x00000fff) -#define BB_THERM_ADC_2_MEASURE_VOLT_FREQ_MSB 21 -#define BB_THERM_ADC_2_MEASURE_VOLT_FREQ_LSB 12 -#define BB_THERM_ADC_2_MEASURE_VOLT_FREQ_MASK 0x003ff000 -#define BB_THERM_ADC_2_MEASURE_VOLT_FREQ_GET(x) (((x) & 0x003ff000) >> 12) -#define BB_THERM_ADC_2_MEASURE_VOLT_FREQ_SET(x) (((x) << 12) & 0x003ff000) -#define BB_THERM_ADC_2_MEASURE_ATB_FREQ_MSB 31 -#define BB_THERM_ADC_2_MEASURE_ATB_FREQ_LSB 22 -#define BB_THERM_ADC_2_MEASURE_ATB_FREQ_MASK 0xffc00000 -#define BB_THERM_ADC_2_MEASURE_ATB_FREQ_GET(x) (((x) & 0xffc00000) >> 22) -#define BB_THERM_ADC_2_MEASURE_ATB_FREQ_SET(x) (((x) << 22) & 0xffc00000) - -/* macros for bb_sm_reg_map.BB_therm_adc_3 */ -#define BB_THERM_ADC_3_ADDRESS 0x00000250 -#define BB_THERM_ADC_3_OFFSET 0x00000250 -#define BB_THERM_ADC_3_THERM_ADC_OFFSET_MSB 7 -#define BB_THERM_ADC_3_THERM_ADC_OFFSET_LSB 0 -#define BB_THERM_ADC_3_THERM_ADC_OFFSET_MASK 0x000000ff -#define BB_THERM_ADC_3_THERM_ADC_OFFSET_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_THERM_ADC_3_THERM_ADC_OFFSET_SET(x) (((x) << 0) & 0x000000ff) -#define BB_THERM_ADC_3_THERM_ADC_SCALED_GAIN_MSB 16 -#define BB_THERM_ADC_3_THERM_ADC_SCALED_GAIN_LSB 8 -#define BB_THERM_ADC_3_THERM_ADC_SCALED_GAIN_MASK 0x0001ff00 -#define BB_THERM_ADC_3_THERM_ADC_SCALED_GAIN_GET(x) (((x) & 0x0001ff00) >> 8) -#define BB_THERM_ADC_3_THERM_ADC_SCALED_GAIN_SET(x) (((x) << 8) & 0x0001ff00) -#define BB_THERM_ADC_3_ADC_INTERVAL_MSB 29 -#define BB_THERM_ADC_3_ADC_INTERVAL_LSB 17 -#define BB_THERM_ADC_3_ADC_INTERVAL_MASK 0x3ffe0000 -#define BB_THERM_ADC_3_ADC_INTERVAL_GET(x) (((x) & 0x3ffe0000) >> 17) -#define BB_THERM_ADC_3_ADC_INTERVAL_SET(x) (((x) << 17) & 0x3ffe0000) - -/* macros for bb_sm_reg_map.BB_therm_adc_4 */ -#define BB_THERM_ADC_4_ADDRESS 0x00000254 -#define BB_THERM_ADC_4_OFFSET 0x00000254 -#define BB_THERM_ADC_4_LATEST_THERM_VALUE_MSB 7 -#define BB_THERM_ADC_4_LATEST_THERM_VALUE_LSB 0 -#define BB_THERM_ADC_4_LATEST_THERM_VALUE_MASK 0x000000ff -#define BB_THERM_ADC_4_LATEST_THERM_VALUE_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_THERM_ADC_4_LATEST_VOLT_VALUE_MSB 15 -#define BB_THERM_ADC_4_LATEST_VOLT_VALUE_LSB 8 -#define BB_THERM_ADC_4_LATEST_VOLT_VALUE_MASK 0x0000ff00 -#define BB_THERM_ADC_4_LATEST_VOLT_VALUE_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_THERM_ADC_4_LATEST_ATB_VALUE_MSB 23 -#define BB_THERM_ADC_4_LATEST_ATB_VALUE_LSB 16 -#define BB_THERM_ADC_4_LATEST_ATB_VALUE_MASK 0x00ff0000 -#define BB_THERM_ADC_4_LATEST_ATB_VALUE_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_THERM_ADC_4_FORCE_THERM_CHAIN_MSB 24 -#define BB_THERM_ADC_4_FORCE_THERM_CHAIN_LSB 24 -#define BB_THERM_ADC_4_FORCE_THERM_CHAIN_MASK 0x01000000 -#define BB_THERM_ADC_4_FORCE_THERM_CHAIN_GET(x) (((x) & 0x01000000) >> 24) -#define BB_THERM_ADC_4_FORCE_THERM_CHAIN_SET(x) (((x) << 24) & 0x01000000) -#define BB_THERM_ADC_4_PREFERRED_THERM_CHAIN_MSB 27 -#define BB_THERM_ADC_4_PREFERRED_THERM_CHAIN_LSB 25 -#define BB_THERM_ADC_4_PREFERRED_THERM_CHAIN_MASK 0x0e000000 -#define BB_THERM_ADC_4_PREFERRED_THERM_CHAIN_GET(x) (((x) & 0x0e000000) >> 25) -#define BB_THERM_ADC_4_PREFERRED_THERM_CHAIN_SET(x) (((x) << 25) & 0x0e000000) - -/* macros for bb_sm_reg_map.BB_tx_forced_gain */ -#define BB_TX_FORCED_GAIN_ADDRESS 0x00000258 -#define BB_TX_FORCED_GAIN_OFFSET 0x00000258 -#define BB_TX_FORCED_GAIN_FORCE_TX_GAIN_MSB 0 -#define BB_TX_FORCED_GAIN_FORCE_TX_GAIN_LSB 0 -#define BB_TX_FORCED_GAIN_FORCE_TX_GAIN_MASK 0x00000001 -#define BB_TX_FORCED_GAIN_FORCE_TX_GAIN_GET(x) (((x) & 0x00000001) >> 0) -#define BB_TX_FORCED_GAIN_FORCE_TX_GAIN_SET(x) (((x) << 0) & 0x00000001) -#define BB_TX_FORCED_GAIN_FORCED_TXBB1DBGAIN_MSB 3 -#define BB_TX_FORCED_GAIN_FORCED_TXBB1DBGAIN_LSB 1 -#define BB_TX_FORCED_GAIN_FORCED_TXBB1DBGAIN_MASK 0x0000000e -#define BB_TX_FORCED_GAIN_FORCED_TXBB1DBGAIN_GET(x) (((x) & 0x0000000e) >> 1) -#define BB_TX_FORCED_GAIN_FORCED_TXBB1DBGAIN_SET(x) (((x) << 1) & 0x0000000e) -#define BB_TX_FORCED_GAIN_FORCED_TXBB6DBGAIN_MSB 5 -#define BB_TX_FORCED_GAIN_FORCED_TXBB6DBGAIN_LSB 4 -#define BB_TX_FORCED_GAIN_FORCED_TXBB6DBGAIN_MASK 0x00000030 -#define BB_TX_FORCED_GAIN_FORCED_TXBB6DBGAIN_GET(x) (((x) & 0x00000030) >> 4) -#define BB_TX_FORCED_GAIN_FORCED_TXBB6DBGAIN_SET(x) (((x) << 4) & 0x00000030) -#define BB_TX_FORCED_GAIN_FORCED_TXMXRGAIN_MSB 9 -#define BB_TX_FORCED_GAIN_FORCED_TXMXRGAIN_LSB 6 -#define BB_TX_FORCED_GAIN_FORCED_TXMXRGAIN_MASK 0x000003c0 -#define BB_TX_FORCED_GAIN_FORCED_TXMXRGAIN_GET(x) (((x) & 0x000003c0) >> 6) -#define BB_TX_FORCED_GAIN_FORCED_TXMXRGAIN_SET(x) (((x) << 6) & 0x000003c0) -#define BB_TX_FORCED_GAIN_FORCED_PADRVGNA_MSB 13 -#define BB_TX_FORCED_GAIN_FORCED_PADRVGNA_LSB 10 -#define BB_TX_FORCED_GAIN_FORCED_PADRVGNA_MASK 0x00003c00 -#define BB_TX_FORCED_GAIN_FORCED_PADRVGNA_GET(x) (((x) & 0x00003c00) >> 10) -#define BB_TX_FORCED_GAIN_FORCED_PADRVGNA_SET(x) (((x) << 10) & 0x00003c00) -#define BB_TX_FORCED_GAIN_FORCED_PADRVGNB_MSB 17 -#define BB_TX_FORCED_GAIN_FORCED_PADRVGNB_LSB 14 -#define BB_TX_FORCED_GAIN_FORCED_PADRVGNB_MASK 0x0003c000 -#define BB_TX_FORCED_GAIN_FORCED_PADRVGNB_GET(x) (((x) & 0x0003c000) >> 14) -#define BB_TX_FORCED_GAIN_FORCED_PADRVGNB_SET(x) (((x) << 14) & 0x0003c000) -#define BB_TX_FORCED_GAIN_FORCED_PADRVGNC_MSB 21 -#define BB_TX_FORCED_GAIN_FORCED_PADRVGNC_LSB 18 -#define BB_TX_FORCED_GAIN_FORCED_PADRVGNC_MASK 0x003c0000 -#define BB_TX_FORCED_GAIN_FORCED_PADRVGNC_GET(x) (((x) & 0x003c0000) >> 18) -#define BB_TX_FORCED_GAIN_FORCED_PADRVGNC_SET(x) (((x) << 18) & 0x003c0000) -#define BB_TX_FORCED_GAIN_FORCED_PADRVGND_MSB 23 -#define BB_TX_FORCED_GAIN_FORCED_PADRVGND_LSB 22 -#define BB_TX_FORCED_GAIN_FORCED_PADRVGND_MASK 0x00c00000 -#define BB_TX_FORCED_GAIN_FORCED_PADRVGND_GET(x) (((x) & 0x00c00000) >> 22) -#define BB_TX_FORCED_GAIN_FORCED_PADRVGND_SET(x) (((x) << 22) & 0x00c00000) -#define BB_TX_FORCED_GAIN_FORCED_ENABLE_PAL_MSB 24 -#define BB_TX_FORCED_GAIN_FORCED_ENABLE_PAL_LSB 24 -#define BB_TX_FORCED_GAIN_FORCED_ENABLE_PAL_MASK 0x01000000 -#define BB_TX_FORCED_GAIN_FORCED_ENABLE_PAL_GET(x) (((x) & 0x01000000) >> 24) -#define BB_TX_FORCED_GAIN_FORCED_ENABLE_PAL_SET(x) (((x) << 24) & 0x01000000) -#define BB_TX_FORCED_GAIN_FORCED_OB_MSB 27 -#define BB_TX_FORCED_GAIN_FORCED_OB_LSB 25 -#define BB_TX_FORCED_GAIN_FORCED_OB_MASK 0x0e000000 -#define BB_TX_FORCED_GAIN_FORCED_OB_GET(x) (((x) & 0x0e000000) >> 25) -#define BB_TX_FORCED_GAIN_FORCED_OB_SET(x) (((x) << 25) & 0x0e000000) -#define BB_TX_FORCED_GAIN_FORCED_DB_MSB 30 -#define BB_TX_FORCED_GAIN_FORCED_DB_LSB 28 -#define BB_TX_FORCED_GAIN_FORCED_DB_MASK 0x70000000 -#define BB_TX_FORCED_GAIN_FORCED_DB_GET(x) (((x) & 0x70000000) >> 28) -#define BB_TX_FORCED_GAIN_FORCED_DB_SET(x) (((x) << 28) & 0x70000000) -#define BB_TX_FORCED_GAIN_FORCED_GREEN_PAPRD_ENABLE_MSB 31 -#define BB_TX_FORCED_GAIN_FORCED_GREEN_PAPRD_ENABLE_LSB 31 -#define BB_TX_FORCED_GAIN_FORCED_GREEN_PAPRD_ENABLE_MASK 0x80000000 -#define BB_TX_FORCED_GAIN_FORCED_GREEN_PAPRD_ENABLE_GET(x) (((x) & 0x80000000) >> 31) -#define BB_TX_FORCED_GAIN_FORCED_GREEN_PAPRD_ENABLE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_sm_reg_map.BB_pdadc_tab_b0 */ -#define BB_PDADC_TAB_B0_ADDRESS 0x00000280 -#define BB_PDADC_TAB_B0_OFFSET 0x00000280 -#define BB_PDADC_TAB_B0_TAB_ENTRY_MSB 31 -#define BB_PDADC_TAB_B0_TAB_ENTRY_LSB 0 -#define BB_PDADC_TAB_B0_TAB_ENTRY_MASK 0xffffffff -#define BB_PDADC_TAB_B0_TAB_ENTRY_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_1 */ -#define BB_TX_GAIN_TAB_1_ADDRESS 0x00000300 -#define BB_TX_GAIN_TAB_1_OFFSET 0x00000300 -#define BB_TX_GAIN_TAB_1_TG_TABLE1_MSB 31 -#define BB_TX_GAIN_TAB_1_TG_TABLE1_LSB 0 -#define BB_TX_GAIN_TAB_1_TG_TABLE1_MASK 0xffffffff -#define BB_TX_GAIN_TAB_1_TG_TABLE1_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_1_TG_TABLE1_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_2 */ -#define BB_TX_GAIN_TAB_2_ADDRESS 0x00000304 -#define BB_TX_GAIN_TAB_2_OFFSET 0x00000304 -#define BB_TX_GAIN_TAB_2_TG_TABLE2_MSB 31 -#define BB_TX_GAIN_TAB_2_TG_TABLE2_LSB 0 -#define BB_TX_GAIN_TAB_2_TG_TABLE2_MASK 0xffffffff -#define BB_TX_GAIN_TAB_2_TG_TABLE2_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_2_TG_TABLE2_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_3 */ -#define BB_TX_GAIN_TAB_3_ADDRESS 0x00000308 -#define BB_TX_GAIN_TAB_3_OFFSET 0x00000308 -#define BB_TX_GAIN_TAB_3_TG_TABLE3_MSB 31 -#define BB_TX_GAIN_TAB_3_TG_TABLE3_LSB 0 -#define BB_TX_GAIN_TAB_3_TG_TABLE3_MASK 0xffffffff -#define BB_TX_GAIN_TAB_3_TG_TABLE3_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_3_TG_TABLE3_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_4 */ -#define BB_TX_GAIN_TAB_4_ADDRESS 0x0000030c -#define BB_TX_GAIN_TAB_4_OFFSET 0x0000030c -#define BB_TX_GAIN_TAB_4_TG_TABLE4_MSB 31 -#define BB_TX_GAIN_TAB_4_TG_TABLE4_LSB 0 -#define BB_TX_GAIN_TAB_4_TG_TABLE4_MASK 0xffffffff -#define BB_TX_GAIN_TAB_4_TG_TABLE4_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_4_TG_TABLE4_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_5 */ -#define BB_TX_GAIN_TAB_5_ADDRESS 0x00000310 -#define BB_TX_GAIN_TAB_5_OFFSET 0x00000310 -#define BB_TX_GAIN_TAB_5_TG_TABLE5_MSB 31 -#define BB_TX_GAIN_TAB_5_TG_TABLE5_LSB 0 -#define BB_TX_GAIN_TAB_5_TG_TABLE5_MASK 0xffffffff -#define BB_TX_GAIN_TAB_5_TG_TABLE5_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_5_TG_TABLE5_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_6 */ -#define BB_TX_GAIN_TAB_6_ADDRESS 0x00000314 -#define BB_TX_GAIN_TAB_6_OFFSET 0x00000314 -#define BB_TX_GAIN_TAB_6_TG_TABLE6_MSB 31 -#define BB_TX_GAIN_TAB_6_TG_TABLE6_LSB 0 -#define BB_TX_GAIN_TAB_6_TG_TABLE6_MASK 0xffffffff -#define BB_TX_GAIN_TAB_6_TG_TABLE6_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_6_TG_TABLE6_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_7 */ -#define BB_TX_GAIN_TAB_7_ADDRESS 0x00000318 -#define BB_TX_GAIN_TAB_7_OFFSET 0x00000318 -#define BB_TX_GAIN_TAB_7_TG_TABLE7_MSB 31 -#define BB_TX_GAIN_TAB_7_TG_TABLE7_LSB 0 -#define BB_TX_GAIN_TAB_7_TG_TABLE7_MASK 0xffffffff -#define BB_TX_GAIN_TAB_7_TG_TABLE7_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_7_TG_TABLE7_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_8 */ -#define BB_TX_GAIN_TAB_8_ADDRESS 0x0000031c -#define BB_TX_GAIN_TAB_8_OFFSET 0x0000031c -#define BB_TX_GAIN_TAB_8_TG_TABLE8_MSB 31 -#define BB_TX_GAIN_TAB_8_TG_TABLE8_LSB 0 -#define BB_TX_GAIN_TAB_8_TG_TABLE8_MASK 0xffffffff -#define BB_TX_GAIN_TAB_8_TG_TABLE8_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_8_TG_TABLE8_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_9 */ -#define BB_TX_GAIN_TAB_9_ADDRESS 0x00000320 -#define BB_TX_GAIN_TAB_9_OFFSET 0x00000320 -#define BB_TX_GAIN_TAB_9_TG_TABLE9_MSB 31 -#define BB_TX_GAIN_TAB_9_TG_TABLE9_LSB 0 -#define BB_TX_GAIN_TAB_9_TG_TABLE9_MASK 0xffffffff -#define BB_TX_GAIN_TAB_9_TG_TABLE9_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_9_TG_TABLE9_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_10 */ -#define BB_TX_GAIN_TAB_10_ADDRESS 0x00000324 -#define BB_TX_GAIN_TAB_10_OFFSET 0x00000324 -#define BB_TX_GAIN_TAB_10_TG_TABLE10_MSB 31 -#define BB_TX_GAIN_TAB_10_TG_TABLE10_LSB 0 -#define BB_TX_GAIN_TAB_10_TG_TABLE10_MASK 0xffffffff -#define BB_TX_GAIN_TAB_10_TG_TABLE10_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_10_TG_TABLE10_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_11 */ -#define BB_TX_GAIN_TAB_11_ADDRESS 0x00000328 -#define BB_TX_GAIN_TAB_11_OFFSET 0x00000328 -#define BB_TX_GAIN_TAB_11_TG_TABLE11_MSB 31 -#define BB_TX_GAIN_TAB_11_TG_TABLE11_LSB 0 -#define BB_TX_GAIN_TAB_11_TG_TABLE11_MASK 0xffffffff -#define BB_TX_GAIN_TAB_11_TG_TABLE11_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_11_TG_TABLE11_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_12 */ -#define BB_TX_GAIN_TAB_12_ADDRESS 0x0000032c -#define BB_TX_GAIN_TAB_12_OFFSET 0x0000032c -#define BB_TX_GAIN_TAB_12_TG_TABLE12_MSB 31 -#define BB_TX_GAIN_TAB_12_TG_TABLE12_LSB 0 -#define BB_TX_GAIN_TAB_12_TG_TABLE12_MASK 0xffffffff -#define BB_TX_GAIN_TAB_12_TG_TABLE12_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_12_TG_TABLE12_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_13 */ -#define BB_TX_GAIN_TAB_13_ADDRESS 0x00000330 -#define BB_TX_GAIN_TAB_13_OFFSET 0x00000330 -#define BB_TX_GAIN_TAB_13_TG_TABLE13_MSB 31 -#define BB_TX_GAIN_TAB_13_TG_TABLE13_LSB 0 -#define BB_TX_GAIN_TAB_13_TG_TABLE13_MASK 0xffffffff -#define BB_TX_GAIN_TAB_13_TG_TABLE13_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_13_TG_TABLE13_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_14 */ -#define BB_TX_GAIN_TAB_14_ADDRESS 0x00000334 -#define BB_TX_GAIN_TAB_14_OFFSET 0x00000334 -#define BB_TX_GAIN_TAB_14_TG_TABLE14_MSB 31 -#define BB_TX_GAIN_TAB_14_TG_TABLE14_LSB 0 -#define BB_TX_GAIN_TAB_14_TG_TABLE14_MASK 0xffffffff -#define BB_TX_GAIN_TAB_14_TG_TABLE14_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_14_TG_TABLE14_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_15 */ -#define BB_TX_GAIN_TAB_15_ADDRESS 0x00000338 -#define BB_TX_GAIN_TAB_15_OFFSET 0x00000338 -#define BB_TX_GAIN_TAB_15_TG_TABLE15_MSB 31 -#define BB_TX_GAIN_TAB_15_TG_TABLE15_LSB 0 -#define BB_TX_GAIN_TAB_15_TG_TABLE15_MASK 0xffffffff -#define BB_TX_GAIN_TAB_15_TG_TABLE15_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_15_TG_TABLE15_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_16 */ -#define BB_TX_GAIN_TAB_16_ADDRESS 0x0000033c -#define BB_TX_GAIN_TAB_16_OFFSET 0x0000033c -#define BB_TX_GAIN_TAB_16_TG_TABLE16_MSB 31 -#define BB_TX_GAIN_TAB_16_TG_TABLE16_LSB 0 -#define BB_TX_GAIN_TAB_16_TG_TABLE16_MASK 0xffffffff -#define BB_TX_GAIN_TAB_16_TG_TABLE16_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_16_TG_TABLE16_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_17 */ -#define BB_TX_GAIN_TAB_17_ADDRESS 0x00000340 -#define BB_TX_GAIN_TAB_17_OFFSET 0x00000340 -#define BB_TX_GAIN_TAB_17_TG_TABLE17_MSB 31 -#define BB_TX_GAIN_TAB_17_TG_TABLE17_LSB 0 -#define BB_TX_GAIN_TAB_17_TG_TABLE17_MASK 0xffffffff -#define BB_TX_GAIN_TAB_17_TG_TABLE17_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_17_TG_TABLE17_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_18 */ -#define BB_TX_GAIN_TAB_18_ADDRESS 0x00000344 -#define BB_TX_GAIN_TAB_18_OFFSET 0x00000344 -#define BB_TX_GAIN_TAB_18_TG_TABLE18_MSB 31 -#define BB_TX_GAIN_TAB_18_TG_TABLE18_LSB 0 -#define BB_TX_GAIN_TAB_18_TG_TABLE18_MASK 0xffffffff -#define BB_TX_GAIN_TAB_18_TG_TABLE18_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_18_TG_TABLE18_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_19 */ -#define BB_TX_GAIN_TAB_19_ADDRESS 0x00000348 -#define BB_TX_GAIN_TAB_19_OFFSET 0x00000348 -#define BB_TX_GAIN_TAB_19_TG_TABLE19_MSB 31 -#define BB_TX_GAIN_TAB_19_TG_TABLE19_LSB 0 -#define BB_TX_GAIN_TAB_19_TG_TABLE19_MASK 0xffffffff -#define BB_TX_GAIN_TAB_19_TG_TABLE19_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_19_TG_TABLE19_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_20 */ -#define BB_TX_GAIN_TAB_20_ADDRESS 0x0000034c -#define BB_TX_GAIN_TAB_20_OFFSET 0x0000034c -#define BB_TX_GAIN_TAB_20_TG_TABLE20_MSB 31 -#define BB_TX_GAIN_TAB_20_TG_TABLE20_LSB 0 -#define BB_TX_GAIN_TAB_20_TG_TABLE20_MASK 0xffffffff -#define BB_TX_GAIN_TAB_20_TG_TABLE20_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_20_TG_TABLE20_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_21 */ -#define BB_TX_GAIN_TAB_21_ADDRESS 0x00000350 -#define BB_TX_GAIN_TAB_21_OFFSET 0x00000350 -#define BB_TX_GAIN_TAB_21_TG_TABLE21_MSB 31 -#define BB_TX_GAIN_TAB_21_TG_TABLE21_LSB 0 -#define BB_TX_GAIN_TAB_21_TG_TABLE21_MASK 0xffffffff -#define BB_TX_GAIN_TAB_21_TG_TABLE21_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_21_TG_TABLE21_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_22 */ -#define BB_TX_GAIN_TAB_22_ADDRESS 0x00000354 -#define BB_TX_GAIN_TAB_22_OFFSET 0x00000354 -#define BB_TX_GAIN_TAB_22_TG_TABLE22_MSB 31 -#define BB_TX_GAIN_TAB_22_TG_TABLE22_LSB 0 -#define BB_TX_GAIN_TAB_22_TG_TABLE22_MASK 0xffffffff -#define BB_TX_GAIN_TAB_22_TG_TABLE22_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_22_TG_TABLE22_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_23 */ -#define BB_TX_GAIN_TAB_23_ADDRESS 0x00000358 -#define BB_TX_GAIN_TAB_23_OFFSET 0x00000358 -#define BB_TX_GAIN_TAB_23_TG_TABLE23_MSB 31 -#define BB_TX_GAIN_TAB_23_TG_TABLE23_LSB 0 -#define BB_TX_GAIN_TAB_23_TG_TABLE23_MASK 0xffffffff -#define BB_TX_GAIN_TAB_23_TG_TABLE23_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_23_TG_TABLE23_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_24 */ -#define BB_TX_GAIN_TAB_24_ADDRESS 0x0000035c -#define BB_TX_GAIN_TAB_24_OFFSET 0x0000035c -#define BB_TX_GAIN_TAB_24_TG_TABLE24_MSB 31 -#define BB_TX_GAIN_TAB_24_TG_TABLE24_LSB 0 -#define BB_TX_GAIN_TAB_24_TG_TABLE24_MASK 0xffffffff -#define BB_TX_GAIN_TAB_24_TG_TABLE24_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_24_TG_TABLE24_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_25 */ -#define BB_TX_GAIN_TAB_25_ADDRESS 0x00000360 -#define BB_TX_GAIN_TAB_25_OFFSET 0x00000360 -#define BB_TX_GAIN_TAB_25_TG_TABLE25_MSB 31 -#define BB_TX_GAIN_TAB_25_TG_TABLE25_LSB 0 -#define BB_TX_GAIN_TAB_25_TG_TABLE25_MASK 0xffffffff -#define BB_TX_GAIN_TAB_25_TG_TABLE25_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_25_TG_TABLE25_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_26 */ -#define BB_TX_GAIN_TAB_26_ADDRESS 0x00000364 -#define BB_TX_GAIN_TAB_26_OFFSET 0x00000364 -#define BB_TX_GAIN_TAB_26_TG_TABLE26_MSB 31 -#define BB_TX_GAIN_TAB_26_TG_TABLE26_LSB 0 -#define BB_TX_GAIN_TAB_26_TG_TABLE26_MASK 0xffffffff -#define BB_TX_GAIN_TAB_26_TG_TABLE26_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_26_TG_TABLE26_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_27 */ -#define BB_TX_GAIN_TAB_27_ADDRESS 0x00000368 -#define BB_TX_GAIN_TAB_27_OFFSET 0x00000368 -#define BB_TX_GAIN_TAB_27_TG_TABLE27_MSB 31 -#define BB_TX_GAIN_TAB_27_TG_TABLE27_LSB 0 -#define BB_TX_GAIN_TAB_27_TG_TABLE27_MASK 0xffffffff -#define BB_TX_GAIN_TAB_27_TG_TABLE27_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_27_TG_TABLE27_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_28 */ -#define BB_TX_GAIN_TAB_28_ADDRESS 0x0000036c -#define BB_TX_GAIN_TAB_28_OFFSET 0x0000036c -#define BB_TX_GAIN_TAB_28_TG_TABLE28_MSB 31 -#define BB_TX_GAIN_TAB_28_TG_TABLE28_LSB 0 -#define BB_TX_GAIN_TAB_28_TG_TABLE28_MASK 0xffffffff -#define BB_TX_GAIN_TAB_28_TG_TABLE28_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_28_TG_TABLE28_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_29 */ -#define BB_TX_GAIN_TAB_29_ADDRESS 0x00000370 -#define BB_TX_GAIN_TAB_29_OFFSET 0x00000370 -#define BB_TX_GAIN_TAB_29_TG_TABLE29_MSB 31 -#define BB_TX_GAIN_TAB_29_TG_TABLE29_LSB 0 -#define BB_TX_GAIN_TAB_29_TG_TABLE29_MASK 0xffffffff -#define BB_TX_GAIN_TAB_29_TG_TABLE29_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_29_TG_TABLE29_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_30 */ -#define BB_TX_GAIN_TAB_30_ADDRESS 0x00000374 -#define BB_TX_GAIN_TAB_30_OFFSET 0x00000374 -#define BB_TX_GAIN_TAB_30_TG_TABLE30_MSB 31 -#define BB_TX_GAIN_TAB_30_TG_TABLE30_LSB 0 -#define BB_TX_GAIN_TAB_30_TG_TABLE30_MASK 0xffffffff -#define BB_TX_GAIN_TAB_30_TG_TABLE30_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_30_TG_TABLE30_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_31 */ -#define BB_TX_GAIN_TAB_31_ADDRESS 0x00000378 -#define BB_TX_GAIN_TAB_31_OFFSET 0x00000378 -#define BB_TX_GAIN_TAB_31_TG_TABLE31_MSB 31 -#define BB_TX_GAIN_TAB_31_TG_TABLE31_LSB 0 -#define BB_TX_GAIN_TAB_31_TG_TABLE31_MASK 0xffffffff -#define BB_TX_GAIN_TAB_31_TG_TABLE31_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_31_TG_TABLE31_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_32 */ -#define BB_TX_GAIN_TAB_32_ADDRESS 0x0000037c -#define BB_TX_GAIN_TAB_32_OFFSET 0x0000037c -#define BB_TX_GAIN_TAB_32_TG_TABLE32_MSB 31 -#define BB_TX_GAIN_TAB_32_TG_TABLE32_LSB 0 -#define BB_TX_GAIN_TAB_32_TG_TABLE32_MASK 0xffffffff -#define BB_TX_GAIN_TAB_32_TG_TABLE32_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_32_TG_TABLE32_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_rtt_ctrl */ -#define BB_RTT_CTRL_ADDRESS 0x00000380 -#define BB_RTT_CTRL_OFFSET 0x00000380 -#define BB_RTT_CTRL_ENA_RADIO_RETENTION_MSB 0 -#define BB_RTT_CTRL_ENA_RADIO_RETENTION_LSB 0 -#define BB_RTT_CTRL_ENA_RADIO_RETENTION_MASK 0x00000001 -#define BB_RTT_CTRL_ENA_RADIO_RETENTION_GET(x) (((x) & 0x00000001) >> 0) -#define BB_RTT_CTRL_ENA_RADIO_RETENTION_SET(x) (((x) << 0) & 0x00000001) -#define BB_RTT_CTRL_RESTORE_MASK_MSB 6 -#define BB_RTT_CTRL_RESTORE_MASK_LSB 1 -#define BB_RTT_CTRL_RESTORE_MASK_MASK 0x0000007e -#define BB_RTT_CTRL_RESTORE_MASK_GET(x) (((x) & 0x0000007e) >> 1) -#define BB_RTT_CTRL_RESTORE_MASK_SET(x) (((x) << 1) & 0x0000007e) -#define BB_RTT_CTRL_FORCE_RADIO_RESTORE_MSB 7 -#define BB_RTT_CTRL_FORCE_RADIO_RESTORE_LSB 7 -#define BB_RTT_CTRL_FORCE_RADIO_RESTORE_MASK 0x00000080 -#define BB_RTT_CTRL_FORCE_RADIO_RESTORE_GET(x) (((x) & 0x00000080) >> 7) -#define BB_RTT_CTRL_FORCE_RADIO_RESTORE_SET(x) (((x) << 7) & 0x00000080) - -/* macros for bb_sm_reg_map.BB_rtt_table_sw_intf_b0 */ -#define BB_RTT_TABLE_SW_INTF_B0_ADDRESS 0x00000384 -#define BB_RTT_TABLE_SW_INTF_B0_OFFSET 0x00000384 -#define BB_RTT_TABLE_SW_INTF_B0_SW_RTT_TABLE_ACCESS_0_MSB 0 -#define BB_RTT_TABLE_SW_INTF_B0_SW_RTT_TABLE_ACCESS_0_LSB 0 -#define BB_RTT_TABLE_SW_INTF_B0_SW_RTT_TABLE_ACCESS_0_MASK 0x00000001 -#define BB_RTT_TABLE_SW_INTF_B0_SW_RTT_TABLE_ACCESS_0_GET(x) (((x) & 0x00000001) >> 0) -#define BB_RTT_TABLE_SW_INTF_B0_SW_RTT_TABLE_ACCESS_0_SET(x) (((x) << 0) & 0x00000001) -#define BB_RTT_TABLE_SW_INTF_B0_SW_RTT_TABLE_WRITE_0_MSB 1 -#define BB_RTT_TABLE_SW_INTF_B0_SW_RTT_TABLE_WRITE_0_LSB 1 -#define BB_RTT_TABLE_SW_INTF_B0_SW_RTT_TABLE_WRITE_0_MASK 0x00000002 -#define BB_RTT_TABLE_SW_INTF_B0_SW_RTT_TABLE_WRITE_0_GET(x) (((x) & 0x00000002) >> 1) -#define BB_RTT_TABLE_SW_INTF_B0_SW_RTT_TABLE_WRITE_0_SET(x) (((x) << 1) & 0x00000002) -#define BB_RTT_TABLE_SW_INTF_B0_SW_RTT_TABLE_ADDR_0_MSB 4 -#define BB_RTT_TABLE_SW_INTF_B0_SW_RTT_TABLE_ADDR_0_LSB 2 -#define BB_RTT_TABLE_SW_INTF_B0_SW_RTT_TABLE_ADDR_0_MASK 0x0000001c -#define BB_RTT_TABLE_SW_INTF_B0_SW_RTT_TABLE_ADDR_0_GET(x) (((x) & 0x0000001c) >> 2) -#define BB_RTT_TABLE_SW_INTF_B0_SW_RTT_TABLE_ADDR_0_SET(x) (((x) << 2) & 0x0000001c) - -/* macros for bb_sm_reg_map.BB_rtt_table_sw_intf_1_b0 */ -#define BB_RTT_TABLE_SW_INTF_1_B0_ADDRESS 0x00000388 -#define BB_RTT_TABLE_SW_INTF_1_B0_OFFSET 0x00000388 -#define BB_RTT_TABLE_SW_INTF_1_B0_SW_RTT_TABLE_DATA_0_MSB 31 -#define BB_RTT_TABLE_SW_INTF_1_B0_SW_RTT_TABLE_DATA_0_LSB 4 -#define BB_RTT_TABLE_SW_INTF_1_B0_SW_RTT_TABLE_DATA_0_MASK 0xfffffff0 -#define BB_RTT_TABLE_SW_INTF_1_B0_SW_RTT_TABLE_DATA_0_GET(x) (((x) & 0xfffffff0) >> 4) -#define BB_RTT_TABLE_SW_INTF_1_B0_SW_RTT_TABLE_DATA_0_SET(x) (((x) << 4) & 0xfffffff0) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_1_16_lsb_ext */ -#define BB_TX_GAIN_TAB_1_16_LSB_EXT_ADDRESS 0x0000038c -#define BB_TX_GAIN_TAB_1_16_LSB_EXT_OFFSET 0x0000038c -#define BB_TX_GAIN_TAB_1_16_LSB_EXT_TG_TABLE1_16_LSB_EXT_MSB 31 -#define BB_TX_GAIN_TAB_1_16_LSB_EXT_TG_TABLE1_16_LSB_EXT_LSB 0 -#define BB_TX_GAIN_TAB_1_16_LSB_EXT_TG_TABLE1_16_LSB_EXT_MASK 0xffffffff -#define BB_TX_GAIN_TAB_1_16_LSB_EXT_TG_TABLE1_16_LSB_EXT_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_1_16_LSB_EXT_TG_TABLE1_16_LSB_EXT_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_tx_gain_tab_17_32_lsb_ext */ -#define BB_TX_GAIN_TAB_17_32_LSB_EXT_ADDRESS 0x00000390 -#define BB_TX_GAIN_TAB_17_32_LSB_EXT_OFFSET 0x00000390 -#define BB_TX_GAIN_TAB_17_32_LSB_EXT_TG_TABLE17_32_LSB_EXT_MSB 31 -#define BB_TX_GAIN_TAB_17_32_LSB_EXT_TG_TABLE17_32_LSB_EXT_LSB 0 -#define BB_TX_GAIN_TAB_17_32_LSB_EXT_TG_TABLE17_32_LSB_EXT_MASK 0xffffffff -#define BB_TX_GAIN_TAB_17_32_LSB_EXT_TG_TABLE17_32_LSB_EXT_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TX_GAIN_TAB_17_32_LSB_EXT_TG_TABLE17_32_LSB_EXT_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_0 */ -#define BB_CALTX_GAIN_SET_0_ADDRESS 0x00000400 -#define BB_CALTX_GAIN_SET_0_OFFSET 0x00000400 -#define BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_0_MSB 13 -#define BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_0_LSB 0 -#define BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_0_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_0_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_0_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_1_MSB 27 -#define BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_1_LSB 14 -#define BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_1_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_1_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_0_CALTX_GAIN_SET_1_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_2 */ -#define BB_CALTX_GAIN_SET_2_ADDRESS 0x00000404 -#define BB_CALTX_GAIN_SET_2_OFFSET 0x00000404 -#define BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_2_MSB 13 -#define BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_2_LSB 0 -#define BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_2_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_2_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_2_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_3_MSB 27 -#define BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_3_LSB 14 -#define BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_3_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_3_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_2_CALTX_GAIN_SET_3_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_4 */ -#define BB_CALTX_GAIN_SET_4_ADDRESS 0x00000408 -#define BB_CALTX_GAIN_SET_4_OFFSET 0x00000408 -#define BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_4_MSB 13 -#define BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_4_LSB 0 -#define BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_4_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_4_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_4_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_5_MSB 27 -#define BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_5_LSB 14 -#define BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_5_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_5_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_4_CALTX_GAIN_SET_5_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_6 */ -#define BB_CALTX_GAIN_SET_6_ADDRESS 0x0000040c -#define BB_CALTX_GAIN_SET_6_OFFSET 0x0000040c -#define BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_6_MSB 13 -#define BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_6_LSB 0 -#define BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_6_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_6_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_6_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_7_MSB 27 -#define BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_7_LSB 14 -#define BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_7_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_7_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_6_CALTX_GAIN_SET_7_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_8 */ -#define BB_CALTX_GAIN_SET_8_ADDRESS 0x00000410 -#define BB_CALTX_GAIN_SET_8_OFFSET 0x00000410 -#define BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_8_MSB 13 -#define BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_8_LSB 0 -#define BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_8_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_8_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_8_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_9_MSB 27 -#define BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_9_LSB 14 -#define BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_9_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_9_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_8_CALTX_GAIN_SET_9_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_10 */ -#define BB_CALTX_GAIN_SET_10_ADDRESS 0x00000414 -#define BB_CALTX_GAIN_SET_10_OFFSET 0x00000414 -#define BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_10_MSB 13 -#define BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_10_LSB 0 -#define BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_10_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_10_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_10_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_11_MSB 27 -#define BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_11_LSB 14 -#define BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_11_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_11_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_10_CALTX_GAIN_SET_11_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_12 */ -#define BB_CALTX_GAIN_SET_12_ADDRESS 0x00000418 -#define BB_CALTX_GAIN_SET_12_OFFSET 0x00000418 -#define BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_12_MSB 13 -#define BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_12_LSB 0 -#define BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_12_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_12_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_12_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_13_MSB 27 -#define BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_13_LSB 14 -#define BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_13_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_13_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_12_CALTX_GAIN_SET_13_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_14 */ -#define BB_CALTX_GAIN_SET_14_ADDRESS 0x0000041c -#define BB_CALTX_GAIN_SET_14_OFFSET 0x0000041c -#define BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_14_MSB 13 -#define BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_14_LSB 0 -#define BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_14_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_14_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_14_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_15_MSB 27 -#define BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_15_LSB 14 -#define BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_15_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_15_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_14_CALTX_GAIN_SET_15_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_16 */ -#define BB_CALTX_GAIN_SET_16_ADDRESS 0x00000420 -#define BB_CALTX_GAIN_SET_16_OFFSET 0x00000420 -#define BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_16_MSB 13 -#define BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_16_LSB 0 -#define BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_16_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_16_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_16_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_17_MSB 27 -#define BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_17_LSB 14 -#define BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_17_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_17_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_16_CALTX_GAIN_SET_17_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_18 */ -#define BB_CALTX_GAIN_SET_18_ADDRESS 0x00000424 -#define BB_CALTX_GAIN_SET_18_OFFSET 0x00000424 -#define BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_18_MSB 13 -#define BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_18_LSB 0 -#define BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_18_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_18_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_18_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_19_MSB 27 -#define BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_19_LSB 14 -#define BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_19_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_19_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_18_CALTX_GAIN_SET_19_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_20 */ -#define BB_CALTX_GAIN_SET_20_ADDRESS 0x00000428 -#define BB_CALTX_GAIN_SET_20_OFFSET 0x00000428 -#define BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_20_MSB 13 -#define BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_20_LSB 0 -#define BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_20_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_20_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_20_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_21_MSB 27 -#define BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_21_LSB 14 -#define BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_21_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_21_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_20_CALTX_GAIN_SET_21_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_22 */ -#define BB_CALTX_GAIN_SET_22_ADDRESS 0x0000042c -#define BB_CALTX_GAIN_SET_22_OFFSET 0x0000042c -#define BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_22_MSB 13 -#define BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_22_LSB 0 -#define BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_22_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_22_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_22_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_23_MSB 27 -#define BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_23_LSB 14 -#define BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_23_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_23_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_22_CALTX_GAIN_SET_23_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_24 */ -#define BB_CALTX_GAIN_SET_24_ADDRESS 0x00000430 -#define BB_CALTX_GAIN_SET_24_OFFSET 0x00000430 -#define BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_24_MSB 13 -#define BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_24_LSB 0 -#define BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_24_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_24_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_24_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_25_MSB 27 -#define BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_25_LSB 14 -#define BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_25_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_25_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_24_CALTX_GAIN_SET_25_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_26 */ -#define BB_CALTX_GAIN_SET_26_ADDRESS 0x00000434 -#define BB_CALTX_GAIN_SET_26_OFFSET 0x00000434 -#define BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_26_MSB 13 -#define BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_26_LSB 0 -#define BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_26_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_26_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_26_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_27_MSB 27 -#define BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_27_LSB 14 -#define BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_27_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_27_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_26_CALTX_GAIN_SET_27_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_28 */ -#define BB_CALTX_GAIN_SET_28_ADDRESS 0x00000438 -#define BB_CALTX_GAIN_SET_28_OFFSET 0x00000438 -#define BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_28_MSB 13 -#define BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_28_LSB 0 -#define BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_28_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_28_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_28_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_29_MSB 27 -#define BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_29_LSB 14 -#define BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_29_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_29_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_28_CALTX_GAIN_SET_29_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_caltx_gain_set_30 */ -#define BB_CALTX_GAIN_SET_30_ADDRESS 0x0000043c -#define BB_CALTX_GAIN_SET_30_OFFSET 0x0000043c -#define BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_30_MSB 13 -#define BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_30_LSB 0 -#define BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_30_MASK 0x00003fff -#define BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_30_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_30_SET(x) (((x) << 0) & 0x00003fff) -#define BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_31_MSB 27 -#define BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_31_LSB 14 -#define BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_31_MASK 0x0fffc000 -#define BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_31_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_CALTX_GAIN_SET_30_CALTX_GAIN_SET_31_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_txiqcal_control_0 */ -#define BB_TXIQCAL_CONTROL_0_ADDRESS 0x00000444 -#define BB_TXIQCAL_CONTROL_0_OFFSET 0x00000444 -#define BB_TXIQCAL_CONTROL_0_IQC_TX_TABLE_SEL_MSB 0 -#define BB_TXIQCAL_CONTROL_0_IQC_TX_TABLE_SEL_LSB 0 -#define BB_TXIQCAL_CONTROL_0_IQC_TX_TABLE_SEL_MASK 0x00000001 -#define BB_TXIQCAL_CONTROL_0_IQC_TX_TABLE_SEL_GET(x) (((x) & 0x00000001) >> 0) -#define BB_TXIQCAL_CONTROL_0_IQC_TX_TABLE_SEL_SET(x) (((x) << 0) & 0x00000001) -#define BB_TXIQCAL_CONTROL_0_BASE_TX_TONE_DB_MSB 6 -#define BB_TXIQCAL_CONTROL_0_BASE_TX_TONE_DB_LSB 1 -#define BB_TXIQCAL_CONTROL_0_BASE_TX_TONE_DB_MASK 0x0000007e -#define BB_TXIQCAL_CONTROL_0_BASE_TX_TONE_DB_GET(x) (((x) & 0x0000007e) >> 1) -#define BB_TXIQCAL_CONTROL_0_BASE_TX_TONE_DB_SET(x) (((x) << 1) & 0x0000007e) -#define BB_TXIQCAL_CONTROL_0_MAX_TX_TONE_GAIN_MSB 12 -#define BB_TXIQCAL_CONTROL_0_MAX_TX_TONE_GAIN_LSB 7 -#define BB_TXIQCAL_CONTROL_0_MAX_TX_TONE_GAIN_MASK 0x00001f80 -#define BB_TXIQCAL_CONTROL_0_MAX_TX_TONE_GAIN_GET(x) (((x) & 0x00001f80) >> 7) -#define BB_TXIQCAL_CONTROL_0_MAX_TX_TONE_GAIN_SET(x) (((x) << 7) & 0x00001f80) -#define BB_TXIQCAL_CONTROL_0_MIN_TX_TONE_GAIN_MSB 18 -#define BB_TXIQCAL_CONTROL_0_MIN_TX_TONE_GAIN_LSB 13 -#define BB_TXIQCAL_CONTROL_0_MIN_TX_TONE_GAIN_MASK 0x0007e000 -#define BB_TXIQCAL_CONTROL_0_MIN_TX_TONE_GAIN_GET(x) (((x) & 0x0007e000) >> 13) -#define BB_TXIQCAL_CONTROL_0_MIN_TX_TONE_GAIN_SET(x) (((x) << 13) & 0x0007e000) -#define BB_TXIQCAL_CONTROL_0_CALTXSHIFT_DELAY_MSB 22 -#define BB_TXIQCAL_CONTROL_0_CALTXSHIFT_DELAY_LSB 19 -#define BB_TXIQCAL_CONTROL_0_CALTXSHIFT_DELAY_MASK 0x00780000 -#define BB_TXIQCAL_CONTROL_0_CALTXSHIFT_DELAY_GET(x) (((x) & 0x00780000) >> 19) -#define BB_TXIQCAL_CONTROL_0_CALTXSHIFT_DELAY_SET(x) (((x) << 19) & 0x00780000) -#define BB_TXIQCAL_CONTROL_0_LOOPBACK_DELAY_MSB 29 -#define BB_TXIQCAL_CONTROL_0_LOOPBACK_DELAY_LSB 23 -#define BB_TXIQCAL_CONTROL_0_LOOPBACK_DELAY_MASK 0x3f800000 -#define BB_TXIQCAL_CONTROL_0_LOOPBACK_DELAY_GET(x) (((x) & 0x3f800000) >> 23) -#define BB_TXIQCAL_CONTROL_0_LOOPBACK_DELAY_SET(x) (((x) << 23) & 0x3f800000) -#define BB_TXIQCAL_CONTROL_0_ENABLE_COMBINED_CARR_IQ_CAL_MSB 30 -#define BB_TXIQCAL_CONTROL_0_ENABLE_COMBINED_CARR_IQ_CAL_LSB 30 -#define BB_TXIQCAL_CONTROL_0_ENABLE_COMBINED_CARR_IQ_CAL_MASK 0x40000000 -#define BB_TXIQCAL_CONTROL_0_ENABLE_COMBINED_CARR_IQ_CAL_GET(x) (((x) & 0x40000000) >> 30) -#define BB_TXIQCAL_CONTROL_0_ENABLE_COMBINED_CARR_IQ_CAL_SET(x) (((x) << 30) & 0x40000000) -#define BB_TXIQCAL_CONTROL_0_ENABLE_TXIQ_CALIBRATE_MSB 31 -#define BB_TXIQCAL_CONTROL_0_ENABLE_TXIQ_CALIBRATE_LSB 31 -#define BB_TXIQCAL_CONTROL_0_ENABLE_TXIQ_CALIBRATE_MASK 0x80000000 -#define BB_TXIQCAL_CONTROL_0_ENABLE_TXIQ_CALIBRATE_GET(x) (((x) & 0x80000000) >> 31) -#define BB_TXIQCAL_CONTROL_0_ENABLE_TXIQ_CALIBRATE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_sm_reg_map.BB_txiqcal_control_1 */ -#define BB_TXIQCAL_CONTROL_1_ADDRESS 0x00000448 -#define BB_TXIQCAL_CONTROL_1_OFFSET 0x00000448 -#define BB_TXIQCAL_CONTROL_1_RX_INIT_GAIN_DB_MSB 5 -#define BB_TXIQCAL_CONTROL_1_RX_INIT_GAIN_DB_LSB 0 -#define BB_TXIQCAL_CONTROL_1_RX_INIT_GAIN_DB_MASK 0x0000003f -#define BB_TXIQCAL_CONTROL_1_RX_INIT_GAIN_DB_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_TXIQCAL_CONTROL_1_RX_INIT_GAIN_DB_SET(x) (((x) << 0) & 0x0000003f) -#define BB_TXIQCAL_CONTROL_1_MAX_RX_GAIN_DB_MSB 11 -#define BB_TXIQCAL_CONTROL_1_MAX_RX_GAIN_DB_LSB 6 -#define BB_TXIQCAL_CONTROL_1_MAX_RX_GAIN_DB_MASK 0x00000fc0 -#define BB_TXIQCAL_CONTROL_1_MAX_RX_GAIN_DB_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_TXIQCAL_CONTROL_1_MAX_RX_GAIN_DB_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_TXIQCAL_CONTROL_1_MIN_RX_GAIN_DB_MSB 17 -#define BB_TXIQCAL_CONTROL_1_MIN_RX_GAIN_DB_LSB 12 -#define BB_TXIQCAL_CONTROL_1_MIN_RX_GAIN_DB_MASK 0x0003f000 -#define BB_TXIQCAL_CONTROL_1_MIN_RX_GAIN_DB_GET(x) (((x) & 0x0003f000) >> 12) -#define BB_TXIQCAL_CONTROL_1_MIN_RX_GAIN_DB_SET(x) (((x) << 12) & 0x0003f000) -#define BB_TXIQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT_MSB 24 -#define BB_TXIQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT_LSB 18 -#define BB_TXIQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT_MASK 0x01fc0000 -#define BB_TXIQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT_GET(x) (((x) & 0x01fc0000) >> 18) -#define BB_TXIQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT_SET(x) (((x) << 18) & 0x01fc0000) - -/* macros for bb_sm_reg_map.BB_txiqcal_control_2 */ -#define BB_TXIQCAL_CONTROL_2_ADDRESS 0x0000044c -#define BB_TXIQCAL_CONTROL_2_OFFSET 0x0000044c -#define BB_TXIQCAL_CONTROL_2_IQC_FORCED_PAGAIN_MSB 3 -#define BB_TXIQCAL_CONTROL_2_IQC_FORCED_PAGAIN_LSB 0 -#define BB_TXIQCAL_CONTROL_2_IQC_FORCED_PAGAIN_MASK 0x0000000f -#define BB_TXIQCAL_CONTROL_2_IQC_FORCED_PAGAIN_GET(x) (((x) & 0x0000000f) >> 0) -#define BB_TXIQCAL_CONTROL_2_IQC_FORCED_PAGAIN_SET(x) (((x) << 0) & 0x0000000f) -#define BB_TXIQCAL_CONTROL_2_IQCAL_MIN_TX_GAIN_MSB 8 -#define BB_TXIQCAL_CONTROL_2_IQCAL_MIN_TX_GAIN_LSB 4 -#define BB_TXIQCAL_CONTROL_2_IQCAL_MIN_TX_GAIN_MASK 0x000001f0 -#define BB_TXIQCAL_CONTROL_2_IQCAL_MIN_TX_GAIN_GET(x) (((x) & 0x000001f0) >> 4) -#define BB_TXIQCAL_CONTROL_2_IQCAL_MIN_TX_GAIN_SET(x) (((x) << 4) & 0x000001f0) -#define BB_TXIQCAL_CONTROL_2_IQCAL_MAX_TX_GAIN_MSB 13 -#define BB_TXIQCAL_CONTROL_2_IQCAL_MAX_TX_GAIN_LSB 9 -#define BB_TXIQCAL_CONTROL_2_IQCAL_MAX_TX_GAIN_MASK 0x00003e00 -#define BB_TXIQCAL_CONTROL_2_IQCAL_MAX_TX_GAIN_GET(x) (((x) & 0x00003e00) >> 9) -#define BB_TXIQCAL_CONTROL_2_IQCAL_MAX_TX_GAIN_SET(x) (((x) << 9) & 0x00003e00) - -/* macros for bb_sm_reg_map.BB_txiq_corr_coeff_01_b0 */ -#define BB_TXIQ_CORR_COEFF_01_B0_ADDRESS 0x00000450 -#define BB_TXIQ_CORR_COEFF_01_B0_OFFSET 0x00000450 -#define BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_0_0_MSB 13 -#define BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_0_0_LSB 0 -#define BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_0_0_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_0_0_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_0_0_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_1_0_MSB 27 -#define BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_1_0_LSB 14 -#define BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_1_0_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_1_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_01_B0_IQC_COEFF_TABLE_1_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_txiq_corr_coeff_23_b0 */ -#define BB_TXIQ_CORR_COEFF_23_B0_ADDRESS 0x00000454 -#define BB_TXIQ_CORR_COEFF_23_B0_OFFSET 0x00000454 -#define BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_2_0_MSB 13 -#define BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_2_0_LSB 0 -#define BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_2_0_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_2_0_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_2_0_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_3_0_MSB 27 -#define BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_3_0_LSB 14 -#define BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_3_0_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_3_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_23_B0_IQC_COEFF_TABLE_3_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_txiq_corr_coeff_45_b0 */ -#define BB_TXIQ_CORR_COEFF_45_B0_ADDRESS 0x00000458 -#define BB_TXIQ_CORR_COEFF_45_B0_OFFSET 0x00000458 -#define BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_4_0_MSB 13 -#define BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_4_0_LSB 0 -#define BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_4_0_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_4_0_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_4_0_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_5_0_MSB 27 -#define BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_5_0_LSB 14 -#define BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_5_0_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_5_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_45_B0_IQC_COEFF_TABLE_5_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_txiq_corr_coeff_67_b0 */ -#define BB_TXIQ_CORR_COEFF_67_B0_ADDRESS 0x0000045c -#define BB_TXIQ_CORR_COEFF_67_B0_OFFSET 0x0000045c -#define BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_6_0_MSB 13 -#define BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_6_0_LSB 0 -#define BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_6_0_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_6_0_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_6_0_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_7_0_MSB 27 -#define BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_7_0_LSB 14 -#define BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_7_0_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_7_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_67_B0_IQC_COEFF_TABLE_7_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_txiq_corr_coeff_89_b0 */ -#define BB_TXIQ_CORR_COEFF_89_B0_ADDRESS 0x00000460 -#define BB_TXIQ_CORR_COEFF_89_B0_OFFSET 0x00000460 -#define BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_8_0_MSB 13 -#define BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_8_0_LSB 0 -#define BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_8_0_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_8_0_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_8_0_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_9_0_MSB 27 -#define BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_9_0_LSB 14 -#define BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_9_0_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_9_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_89_B0_IQC_COEFF_TABLE_9_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_txiq_corr_coeff_ab_b0 */ -#define BB_TXIQ_CORR_COEFF_AB_B0_ADDRESS 0x00000464 -#define BB_TXIQ_CORR_COEFF_AB_B0_OFFSET 0x00000464 -#define BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_A_0_MSB 13 -#define BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_A_0_LSB 0 -#define BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_A_0_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_A_0_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_A_0_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_B_0_MSB 27 -#define BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_B_0_LSB 14 -#define BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_B_0_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_B_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_AB_B0_IQC_COEFF_TABLE_B_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_txiq_corr_coeff_cd_b0 */ -#define BB_TXIQ_CORR_COEFF_CD_B0_ADDRESS 0x00000468 -#define BB_TXIQ_CORR_COEFF_CD_B0_OFFSET 0x00000468 -#define BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_C_0_MSB 13 -#define BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_C_0_LSB 0 -#define BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_C_0_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_C_0_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_C_0_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_D_0_MSB 27 -#define BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_D_0_LSB 14 -#define BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_D_0_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_D_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_CD_B0_IQC_COEFF_TABLE_D_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_txiq_corr_coeff_ef_b0 */ -#define BB_TXIQ_CORR_COEFF_EF_B0_ADDRESS 0x0000046c -#define BB_TXIQ_CORR_COEFF_EF_B0_OFFSET 0x0000046c -#define BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_E_0_MSB 13 -#define BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_E_0_LSB 0 -#define BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_E_0_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_E_0_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_E_0_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_F_0_MSB 27 -#define BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_F_0_LSB 14 -#define BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_F_0_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_F_0_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_EF_B0_IQC_COEFF_TABLE_F_0_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm_reg_map.BB_cal_rxbb_gain_tbl_0 */ -#define BB_CAL_RXBB_GAIN_TBL_0_ADDRESS 0x00000470 -#define BB_CAL_RXBB_GAIN_TBL_0_OFFSET 0x00000470 -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_0_MSB 7 -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_0_LSB 0 -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_0_MASK 0x000000ff -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_0_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_0_SET(x) (((x) << 0) & 0x000000ff) -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_1_MSB 15 -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_1_LSB 8 -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_1_MASK 0x0000ff00 -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_1_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_1_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_2_MSB 23 -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_2_LSB 16 -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_2_MASK 0x00ff0000 -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_2_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_2_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_3_MSB 31 -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_3_LSB 24 -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_3_MASK 0xff000000 -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_3_GET(x) (((x) & 0xff000000) >> 24) -#define BB_CAL_RXBB_GAIN_TBL_0_TXCAL_RX_BB_GAIN_TABLE_3_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_sm_reg_map.BB_cal_rxbb_gain_tbl_4 */ -#define BB_CAL_RXBB_GAIN_TBL_4_ADDRESS 0x00000474 -#define BB_CAL_RXBB_GAIN_TBL_4_OFFSET 0x00000474 -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_4_MSB 7 -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_4_LSB 0 -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_4_MASK 0x000000ff -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_4_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_4_SET(x) (((x) << 0) & 0x000000ff) -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_5_MSB 15 -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_5_LSB 8 -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_5_MASK 0x0000ff00 -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_5_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_5_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_6_MSB 23 -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_6_LSB 16 -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_6_MASK 0x00ff0000 -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_6_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_6_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_7_MSB 31 -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_7_LSB 24 -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_7_MASK 0xff000000 -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_7_GET(x) (((x) & 0xff000000) >> 24) -#define BB_CAL_RXBB_GAIN_TBL_4_TXCAL_RX_BB_GAIN_TABLE_7_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_sm_reg_map.BB_cal_rxbb_gain_tbl_8 */ -#define BB_CAL_RXBB_GAIN_TBL_8_ADDRESS 0x00000478 -#define BB_CAL_RXBB_GAIN_TBL_8_OFFSET 0x00000478 -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_8_MSB 7 -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_8_LSB 0 -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_8_MASK 0x000000ff -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_8_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_8_SET(x) (((x) << 0) & 0x000000ff) -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_9_MSB 15 -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_9_LSB 8 -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_9_MASK 0x0000ff00 -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_9_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_9_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_10_MSB 23 -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_10_LSB 16 -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_10_MASK 0x00ff0000 -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_10_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_10_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_11_MSB 31 -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_11_LSB 24 -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_11_MASK 0xff000000 -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_11_GET(x) (((x) & 0xff000000) >> 24) -#define BB_CAL_RXBB_GAIN_TBL_8_TXCAL_RX_BB_GAIN_TABLE_11_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_sm_reg_map.BB_cal_rxbb_gain_tbl_12 */ -#define BB_CAL_RXBB_GAIN_TBL_12_ADDRESS 0x0000047c -#define BB_CAL_RXBB_GAIN_TBL_12_OFFSET 0x0000047c -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_12_MSB 7 -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_12_LSB 0 -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_12_MASK 0x000000ff -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_12_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_12_SET(x) (((x) << 0) & 0x000000ff) -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_13_MSB 15 -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_13_LSB 8 -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_13_MASK 0x0000ff00 -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_13_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_13_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_14_MSB 23 -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_14_LSB 16 -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_14_MASK 0x00ff0000 -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_14_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_14_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_15_MSB 31 -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_15_LSB 24 -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_15_MASK 0xff000000 -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_15_GET(x) (((x) & 0xff000000) >> 24) -#define BB_CAL_RXBB_GAIN_TBL_12_TXCAL_RX_BB_GAIN_TABLE_15_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_sm_reg_map.BB_cal_rxbb_gain_tbl_16 */ -#define BB_CAL_RXBB_GAIN_TBL_16_ADDRESS 0x00000480 -#define BB_CAL_RXBB_GAIN_TBL_16_OFFSET 0x00000480 -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_16_MSB 7 -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_16_LSB 0 -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_16_MASK 0x000000ff -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_16_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_16_SET(x) (((x) << 0) & 0x000000ff) -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_17_MSB 15 -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_17_LSB 8 -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_17_MASK 0x0000ff00 -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_17_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_17_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_18_MSB 23 -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_18_LSB 16 -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_18_MASK 0x00ff0000 -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_18_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_18_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_19_MSB 31 -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_19_LSB 24 -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_19_MASK 0xff000000 -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_19_GET(x) (((x) & 0xff000000) >> 24) -#define BB_CAL_RXBB_GAIN_TBL_16_TXCAL_RX_BB_GAIN_TABLE_19_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_sm_reg_map.BB_cal_rxbb_gain_tbl_20 */ -#define BB_CAL_RXBB_GAIN_TBL_20_ADDRESS 0x00000484 -#define BB_CAL_RXBB_GAIN_TBL_20_OFFSET 0x00000484 -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_20_MSB 7 -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_20_LSB 0 -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_20_MASK 0x000000ff -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_20_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_20_SET(x) (((x) << 0) & 0x000000ff) -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_21_MSB 15 -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_21_LSB 8 -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_21_MASK 0x0000ff00 -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_21_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_21_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_22_MSB 23 -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_22_LSB 16 -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_22_MASK 0x00ff0000 -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_22_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_22_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_23_MSB 31 -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_23_LSB 24 -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_23_MASK 0xff000000 -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_23_GET(x) (((x) & 0xff000000) >> 24) -#define BB_CAL_RXBB_GAIN_TBL_20_TXCAL_RX_BB_GAIN_TABLE_23_SET(x) (((x) << 24) & 0xff000000) - -/* macros for bb_sm_reg_map.BB_cal_rxbb_gain_tbl_24 */ -#define BB_CAL_RXBB_GAIN_TBL_24_ADDRESS 0x00000488 -#define BB_CAL_RXBB_GAIN_TBL_24_OFFSET 0x00000488 -#define BB_CAL_RXBB_GAIN_TBL_24_TXCAL_RX_BB_GAIN_TABLE_24_MSB 7 -#define BB_CAL_RXBB_GAIN_TBL_24_TXCAL_RX_BB_GAIN_TABLE_24_LSB 0 -#define BB_CAL_RXBB_GAIN_TBL_24_TXCAL_RX_BB_GAIN_TABLE_24_MASK 0x000000ff -#define BB_CAL_RXBB_GAIN_TBL_24_TXCAL_RX_BB_GAIN_TABLE_24_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_CAL_RXBB_GAIN_TBL_24_TXCAL_RX_BB_GAIN_TABLE_24_SET(x) (((x) << 0) & 0x000000ff) - -/* macros for bb_sm_reg_map.BB_txiqcal_status_b0 */ -#define BB_TXIQCAL_STATUS_B0_ADDRESS 0x0000048c -#define BB_TXIQCAL_STATUS_B0_OFFSET 0x0000048c -#define BB_TXIQCAL_STATUS_B0_TXIQCAL_FAILED_0_MSB 0 -#define BB_TXIQCAL_STATUS_B0_TXIQCAL_FAILED_0_LSB 0 -#define BB_TXIQCAL_STATUS_B0_TXIQCAL_FAILED_0_MASK 0x00000001 -#define BB_TXIQCAL_STATUS_B0_TXIQCAL_FAILED_0_GET(x) (((x) & 0x00000001) >> 0) -#define BB_TXIQCAL_STATUS_B0_CALIBRATED_GAINS_0_MSB 5 -#define BB_TXIQCAL_STATUS_B0_CALIBRATED_GAINS_0_LSB 1 -#define BB_TXIQCAL_STATUS_B0_CALIBRATED_GAINS_0_MASK 0x0000003e -#define BB_TXIQCAL_STATUS_B0_CALIBRATED_GAINS_0_GET(x) (((x) & 0x0000003e) >> 1) -#define BB_TXIQCAL_STATUS_B0_TONE_GAIN_USED_0_MSB 11 -#define BB_TXIQCAL_STATUS_B0_TONE_GAIN_USED_0_LSB 6 -#define BB_TXIQCAL_STATUS_B0_TONE_GAIN_USED_0_MASK 0x00000fc0 -#define BB_TXIQCAL_STATUS_B0_TONE_GAIN_USED_0_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_TXIQCAL_STATUS_B0_RX_GAIN_USED_0_MSB 17 -#define BB_TXIQCAL_STATUS_B0_RX_GAIN_USED_0_LSB 12 -#define BB_TXIQCAL_STATUS_B0_RX_GAIN_USED_0_MASK 0x0003f000 -#define BB_TXIQCAL_STATUS_B0_RX_GAIN_USED_0_GET(x) (((x) & 0x0003f000) >> 12) -#define BB_TXIQCAL_STATUS_B0_LAST_MEAS_ADDR_0_MSB 23 -#define BB_TXIQCAL_STATUS_B0_LAST_MEAS_ADDR_0_LSB 18 -#define BB_TXIQCAL_STATUS_B0_LAST_MEAS_ADDR_0_MASK 0x00fc0000 -#define BB_TXIQCAL_STATUS_B0_LAST_MEAS_ADDR_0_GET(x) (((x) & 0x00fc0000) >> 18) - -/* macros for bb_sm_reg_map.BB_paprd_trainer_cntl1 */ -#define BB_PAPRD_TRAINER_CNTL1_ADDRESS 0x00000490 -#define BB_PAPRD_TRAINER_CNTL1_OFFSET 0x00000490 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TRAIN_ENABLE_MSB 0 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TRAIN_ENABLE_LSB 0 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TRAIN_ENABLE_MASK 0x00000001 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TRAIN_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TRAIN_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING_MSB 7 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING_LSB 1 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING_MASK 0x000000fe -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING_GET(x) (((x) & 0x000000fe) >> 1) -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_AGC2_SETTLING_SET(x) (((x) << 1) & 0x000000fe) -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_IQCORR_ENABLE_MSB 8 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_IQCORR_ENABLE_LSB 8 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_IQCORR_ENABLE_MASK 0x00000100 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_IQCORR_ENABLE_GET(x) (((x) & 0x00000100) >> 8) -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_IQCORR_ENABLE_SET(x) (((x) << 8) & 0x00000100) -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_RX_BB_GAIN_FORCE_MSB 9 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_RX_BB_GAIN_FORCE_LSB 9 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_RX_BB_GAIN_FORCE_MASK 0x00000200 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_RX_BB_GAIN_FORCE_GET(x) (((x) & 0x00000200) >> 9) -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_RX_BB_GAIN_FORCE_SET(x) (((x) << 9) & 0x00000200) -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TX_GAIN_FORCE_MSB 10 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TX_GAIN_FORCE_LSB 10 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TX_GAIN_FORCE_MASK 0x00000400 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TX_GAIN_FORCE_GET(x) (((x) & 0x00000400) >> 10) -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_TX_GAIN_FORCE_SET(x) (((x) << 10) & 0x00000400) -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_ENABLE_MSB 11 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_ENABLE_LSB 11 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_ENABLE_MASK 0x00000800 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_ENABLE_GET(x) (((x) & 0x00000800) >> 11) -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_ENABLE_SET(x) (((x) << 11) & 0x00000800) -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP_MSB 18 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP_LSB 12 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP_MASK 0x0007f000 -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP_GET(x) (((x) & 0x0007f000) >> 12) -#define BB_PAPRD_TRAINER_CNTL1_CF_PAPRD_LB_SKIP_SET(x) (((x) << 12) & 0x0007f000) - -/* macros for bb_sm_reg_map.BB_paprd_trainer_cntl2 */ -#define BB_PAPRD_TRAINER_CNTL2_ADDRESS 0x00000494 -#define BB_PAPRD_TRAINER_CNTL2_OFFSET 0x00000494 -#define BB_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN_MSB 31 -#define BB_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN_LSB 0 -#define BB_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN_MASK 0xffffffff -#define BB_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_PAPRD_TRAINER_CNTL2_CF_PAPRD_INIT_RX_BB_GAIN_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm_reg_map.BB_paprd_trainer_cntl3 */ -#define BB_PAPRD_TRAINER_CNTL3_ADDRESS 0x00000498 -#define BB_PAPRD_TRAINER_CNTL3_OFFSET 0x00000498 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE_MSB 5 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE_LSB 0 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE_MASK 0x0000003f -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_ADC_DESIRED_SIZE_SET(x) (((x) << 0) & 0x0000003f) -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP_MSB 11 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP_LSB 6 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP_MASK 0x00000fc0 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_MIN_LOOPBACK_DEL_MSB 16 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_MIN_LOOPBACK_DEL_LSB 12 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_MIN_LOOPBACK_DEL_MASK 0x0001f000 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_MIN_LOOPBACK_DEL_GET(x) (((x) & 0x0001f000) >> 12) -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_MIN_LOOPBACK_DEL_SET(x) (((x) << 12) & 0x0001f000) -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_NUM_CORR_STAGES_MSB 19 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_NUM_CORR_STAGES_LSB 17 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_NUM_CORR_STAGES_MASK 0x000e0000 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_NUM_CORR_STAGES_GET(x) (((x) & 0x000e0000) >> 17) -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_NUM_CORR_STAGES_SET(x) (((x) << 17) & 0x000e0000) -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_COARSE_CORR_LEN_MSB 23 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_COARSE_CORR_LEN_LSB 20 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_COARSE_CORR_LEN_MASK 0x00f00000 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_COARSE_CORR_LEN_GET(x) (((x) & 0x00f00000) >> 20) -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_COARSE_CORR_LEN_SET(x) (((x) << 20) & 0x00f00000) -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_FINE_CORR_LEN_MSB 27 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_FINE_CORR_LEN_LSB 24 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_FINE_CORR_LEN_MASK 0x0f000000 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_FINE_CORR_LEN_GET(x) (((x) & 0x0f000000) >> 24) -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_FINE_CORR_LEN_SET(x) (((x) << 24) & 0x0f000000) -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_REUSE_CORR_MSB 28 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_REUSE_CORR_LSB 28 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_REUSE_CORR_MASK 0x10000000 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_REUSE_CORR_GET(x) (((x) & 0x10000000) >> 28) -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_REUSE_CORR_SET(x) (((x) << 28) & 0x10000000) -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE_MSB 29 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE_LSB 29 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE_MASK 0x20000000 -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE_GET(x) (((x) & 0x20000000) >> 29) -#define BB_PAPRD_TRAINER_CNTL3_CF_PAPRD_BBTXMIX_DISABLE_SET(x) (((x) << 29) & 0x20000000) - -/* macros for bb_sm_reg_map.BB_paprd_trainer_cntl4 */ -#define BB_PAPRD_TRAINER_CNTL4_ADDRESS 0x0000049c -#define BB_PAPRD_TRAINER_CNTL4_OFFSET 0x0000049c -#define BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_MIN_CORR_MSB 11 -#define BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_MIN_CORR_LSB 0 -#define BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_MIN_CORR_MASK 0x00000fff -#define BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_MIN_CORR_GET(x) (((x) & 0x00000fff) >> 0) -#define BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_MIN_CORR_SET(x) (((x) << 0) & 0x00000fff) -#define BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_SAFETY_DELTA_MSB 15 -#define BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_SAFETY_DELTA_LSB 12 -#define BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_SAFETY_DELTA_MASK 0x0000f000 -#define BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_SAFETY_DELTA_GET(x) (((x) & 0x0000f000) >> 12) -#define BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_SAFETY_DELTA_SET(x) (((x) << 12) & 0x0000f000) -#define BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES_MSB 25 -#define BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES_LSB 16 -#define BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES_MASK 0x03ff0000 -#define BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES_GET(x) (((x) & 0x03ff0000) >> 16) -#define BB_PAPRD_TRAINER_CNTL4_CF_PAPRD_NUM_TRAIN_SAMPLES_SET(x) (((x) << 16) & 0x03ff0000) - -/* macros for bb_sm_reg_map.BB_paprd_trainer_stat1 */ -#define BB_PAPRD_TRAINER_STAT1_ADDRESS 0x000004a0 -#define BB_PAPRD_TRAINER_STAT1_OFFSET 0x000004a0 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE_MSB 0 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE_LSB 0 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE_MASK 0x00000001 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE_GET(x) (((x) & 0x00000001) >> 0) -#define BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE_SET(x) (((x) << 0) & 0x00000001) -#define BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_INCOMPLETE_MSB 1 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_INCOMPLETE_LSB 1 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_INCOMPLETE_MASK 0x00000002 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_INCOMPLETE_GET(x) (((x) & 0x00000002) >> 1) -#define BB_PAPRD_TRAINER_STAT1_PAPRD_CORR_ERR_MSB 2 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_CORR_ERR_LSB 2 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_CORR_ERR_MASK 0x00000004 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_CORR_ERR_GET(x) (((x) & 0x00000004) >> 2) -#define BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_ACTIVE_MSB 3 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_ACTIVE_LSB 3 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_ACTIVE_MASK 0x00000008 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_ACTIVE_GET(x) (((x) & 0x00000008) >> 3) -#define BB_PAPRD_TRAINER_STAT1_PAPRD_RX_GAIN_IDX_MSB 8 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_RX_GAIN_IDX_LSB 4 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_RX_GAIN_IDX_MASK 0x000001f0 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_RX_GAIN_IDX_GET(x) (((x) & 0x000001f0) >> 4) -#define BB_PAPRD_TRAINER_STAT1_PAPRD_AGC2_PWR_MSB 16 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_AGC2_PWR_LSB 9 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_AGC2_PWR_MASK 0x0001fe00 -#define BB_PAPRD_TRAINER_STAT1_PAPRD_AGC2_PWR_GET(x) (((x) & 0x0001fe00) >> 9) - -/* macros for bb_sm_reg_map.BB_paprd_trainer_stat2 */ -#define BB_PAPRD_TRAINER_STAT2_ADDRESS 0x000004a4 -#define BB_PAPRD_TRAINER_STAT2_OFFSET 0x000004a4 -#define BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_VAL_MSB 15 -#define BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_VAL_LSB 0 -#define BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_VAL_MASK 0x0000ffff -#define BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_VAL_GET(x) (((x) & 0x0000ffff) >> 0) -#define BB_PAPRD_TRAINER_STAT2_PAPRD_COARSE_IDX_MSB 20 -#define BB_PAPRD_TRAINER_STAT2_PAPRD_COARSE_IDX_LSB 16 -#define BB_PAPRD_TRAINER_STAT2_PAPRD_COARSE_IDX_MASK 0x001f0000 -#define BB_PAPRD_TRAINER_STAT2_PAPRD_COARSE_IDX_GET(x) (((x) & 0x001f0000) >> 16) -#define BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_IDX_MSB 22 -#define BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_IDX_LSB 21 -#define BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_IDX_MASK 0x00600000 -#define BB_PAPRD_TRAINER_STAT2_PAPRD_FINE_IDX_GET(x) (((x) & 0x00600000) >> 21) - -/* macros for bb_sm_reg_map.BB_paprd_trainer_stat3 */ -#define BB_PAPRD_TRAINER_STAT3_ADDRESS 0x000004a8 -#define BB_PAPRD_TRAINER_STAT3_OFFSET 0x000004a8 -#define BB_PAPRD_TRAINER_STAT3_PAPRD_TRAIN_SAMPLES_CNT_MSB 19 -#define BB_PAPRD_TRAINER_STAT3_PAPRD_TRAIN_SAMPLES_CNT_LSB 0 -#define BB_PAPRD_TRAINER_STAT3_PAPRD_TRAIN_SAMPLES_CNT_MASK 0x000fffff -#define BB_PAPRD_TRAINER_STAT3_PAPRD_TRAIN_SAMPLES_CNT_GET(x) (((x) & 0x000fffff) >> 0) - -/* macros for bb_sm_reg_map.BB_watchdog_status */ -#define BB_WATCHDOG_STATUS_ADDRESS 0x000005c0 -#define BB_WATCHDOG_STATUS_OFFSET 0x000005c0 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_1_MSB 2 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_1_LSB 0 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_1_MASK 0x00000007 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_1_GET(x) (((x) & 0x00000007) >> 0) -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_1_SET(x) (((x) << 0) & 0x00000007) -#define BB_WATCHDOG_STATUS_WATCHDOG_TIMEOUT_MSB 3 -#define BB_WATCHDOG_STATUS_WATCHDOG_TIMEOUT_LSB 3 -#define BB_WATCHDOG_STATUS_WATCHDOG_TIMEOUT_MASK 0x00000008 -#define BB_WATCHDOG_STATUS_WATCHDOG_TIMEOUT_GET(x) (((x) & 0x00000008) >> 3) -#define BB_WATCHDOG_STATUS_WATCHDOG_TIMEOUT_SET(x) (((x) << 3) & 0x00000008) -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_2_MSB 7 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_2_LSB 4 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_2_MASK 0x000000f0 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_2_GET(x) (((x) & 0x000000f0) >> 4) -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_2_SET(x) (((x) << 4) & 0x000000f0) -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_3_MSB 11 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_3_LSB 8 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_3_MASK 0x00000f00 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_3_GET(x) (((x) & 0x00000f00) >> 8) -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_3_SET(x) (((x) << 8) & 0x00000f00) -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_4_MSB 15 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_4_LSB 12 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_4_MASK 0x0000f000 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_4_GET(x) (((x) & 0x0000f000) >> 12) -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_4_SET(x) (((x) << 12) & 0x0000f000) -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_5_MSB 19 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_5_LSB 16 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_5_MASK 0x000f0000 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_5_GET(x) (((x) & 0x000f0000) >> 16) -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_5_SET(x) (((x) << 16) & 0x000f0000) -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_6_MSB 23 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_6_LSB 20 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_6_MASK 0x00f00000 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_6_GET(x) (((x) & 0x00f00000) >> 20) -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_6_SET(x) (((x) << 20) & 0x00f00000) -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_7_MSB 27 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_7_LSB 24 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_7_MASK 0x0f000000 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_7_GET(x) (((x) & 0x0f000000) >> 24) -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_7_SET(x) (((x) << 24) & 0x0f000000) -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_8_MSB 31 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_8_LSB 28 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_8_MASK 0xf0000000 -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_8_GET(x) (((x) & 0xf0000000) >> 28) -#define BB_WATCHDOG_STATUS_WATCHDOG_STATUS_8_SET(x) (((x) << 28) & 0xf0000000) - -/* macros for bb_sm_reg_map.BB_watchdog_ctrl_1 */ -#define BB_WATCHDOG_CTRL_1_ADDRESS 0x000005c4 -#define BB_WATCHDOG_CTRL_1_OFFSET 0x000005c4 -#define BB_WATCHDOG_CTRL_1_ENABLE_WATCHDOG_TIMEOUT_RESET_NON_IDLE_MSB 0 -#define BB_WATCHDOG_CTRL_1_ENABLE_WATCHDOG_TIMEOUT_RESET_NON_IDLE_LSB 0 -#define BB_WATCHDOG_CTRL_1_ENABLE_WATCHDOG_TIMEOUT_RESET_NON_IDLE_MASK 0x00000001 -#define BB_WATCHDOG_CTRL_1_ENABLE_WATCHDOG_TIMEOUT_RESET_NON_IDLE_GET(x) (((x) & 0x00000001) >> 0) -#define BB_WATCHDOG_CTRL_1_ENABLE_WATCHDOG_TIMEOUT_RESET_NON_IDLE_SET(x) (((x) << 0) & 0x00000001) -#define BB_WATCHDOG_CTRL_1_ENABLE_WATCHDOG_TIMEOUT_RESET_IDLE_MSB 1 -#define BB_WATCHDOG_CTRL_1_ENABLE_WATCHDOG_TIMEOUT_RESET_IDLE_LSB 1 -#define BB_WATCHDOG_CTRL_1_ENABLE_WATCHDOG_TIMEOUT_RESET_IDLE_MASK 0x00000002 -#define BB_WATCHDOG_CTRL_1_ENABLE_WATCHDOG_TIMEOUT_RESET_IDLE_GET(x) (((x) & 0x00000002) >> 1) -#define BB_WATCHDOG_CTRL_1_ENABLE_WATCHDOG_TIMEOUT_RESET_IDLE_SET(x) (((x) << 1) & 0x00000002) -#define BB_WATCHDOG_CTRL_1_WATCHDOG_TIMEOUT_RESET_NON_IDLE_LIMIT_MSB 15 -#define BB_WATCHDOG_CTRL_1_WATCHDOG_TIMEOUT_RESET_NON_IDLE_LIMIT_LSB 2 -#define BB_WATCHDOG_CTRL_1_WATCHDOG_TIMEOUT_RESET_NON_IDLE_LIMIT_MASK 0x0000fffc -#define BB_WATCHDOG_CTRL_1_WATCHDOG_TIMEOUT_RESET_NON_IDLE_LIMIT_GET(x) (((x) & 0x0000fffc) >> 2) -#define BB_WATCHDOG_CTRL_1_WATCHDOG_TIMEOUT_RESET_NON_IDLE_LIMIT_SET(x) (((x) << 2) & 0x0000fffc) -#define BB_WATCHDOG_CTRL_1_WATCHDOG_TIMEOUT_RESET_IDLE_LIMIT_MSB 31 -#define BB_WATCHDOG_CTRL_1_WATCHDOG_TIMEOUT_RESET_IDLE_LIMIT_LSB 16 -#define BB_WATCHDOG_CTRL_1_WATCHDOG_TIMEOUT_RESET_IDLE_LIMIT_MASK 0xffff0000 -#define BB_WATCHDOG_CTRL_1_WATCHDOG_TIMEOUT_RESET_IDLE_LIMIT_GET(x) (((x) & 0xffff0000) >> 16) -#define BB_WATCHDOG_CTRL_1_WATCHDOG_TIMEOUT_RESET_IDLE_LIMIT_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for bb_sm_reg_map.BB_watchdog_ctrl_2 */ -#define BB_WATCHDOG_CTRL_2_ADDRESS 0x000005c8 -#define BB_WATCHDOG_CTRL_2_OFFSET 0x000005c8 -#define BB_WATCHDOG_CTRL_2_FORCE_FAST_ADC_CLK_MSB 0 -#define BB_WATCHDOG_CTRL_2_FORCE_FAST_ADC_CLK_LSB 0 -#define BB_WATCHDOG_CTRL_2_FORCE_FAST_ADC_CLK_MASK 0x00000001 -#define BB_WATCHDOG_CTRL_2_FORCE_FAST_ADC_CLK_GET(x) (((x) & 0x00000001) >> 0) -#define BB_WATCHDOG_CTRL_2_FORCE_FAST_ADC_CLK_SET(x) (((x) << 0) & 0x00000001) -#define BB_WATCHDOG_CTRL_2_WATCHDOG_TIMEOUT_RESET_ENA_MSB 1 -#define BB_WATCHDOG_CTRL_2_WATCHDOG_TIMEOUT_RESET_ENA_LSB 1 -#define BB_WATCHDOG_CTRL_2_WATCHDOG_TIMEOUT_RESET_ENA_MASK 0x00000002 -#define BB_WATCHDOG_CTRL_2_WATCHDOG_TIMEOUT_RESET_ENA_GET(x) (((x) & 0x00000002) >> 1) -#define BB_WATCHDOG_CTRL_2_WATCHDOG_TIMEOUT_RESET_ENA_SET(x) (((x) << 1) & 0x00000002) -#define BB_WATCHDOG_CTRL_2_WATCHDOG_IRQ_ENA_MSB 2 -#define BB_WATCHDOG_CTRL_2_WATCHDOG_IRQ_ENA_LSB 2 -#define BB_WATCHDOG_CTRL_2_WATCHDOG_IRQ_ENA_MASK 0x00000004 -#define BB_WATCHDOG_CTRL_2_WATCHDOG_IRQ_ENA_GET(x) (((x) & 0x00000004) >> 2) -#define BB_WATCHDOG_CTRL_2_WATCHDOG_IRQ_ENA_SET(x) (((x) << 2) & 0x00000004) - -/* macros for bb_sm_reg_map.BB_bluetooth_cntl */ -#define BB_BLUETOOTH_CNTL_ADDRESS 0x000005cc -#define BB_BLUETOOTH_CNTL_OFFSET 0x000005cc -#define BB_BLUETOOTH_CNTL_BT_BREAK_CCK_EN_MSB 0 -#define BB_BLUETOOTH_CNTL_BT_BREAK_CCK_EN_LSB 0 -#define BB_BLUETOOTH_CNTL_BT_BREAK_CCK_EN_MASK 0x00000001 -#define BB_BLUETOOTH_CNTL_BT_BREAK_CCK_EN_GET(x) (((x) & 0x00000001) >> 0) -#define BB_BLUETOOTH_CNTL_BT_BREAK_CCK_EN_SET(x) (((x) << 0) & 0x00000001) -#define BB_BLUETOOTH_CNTL_BT_ANT_HALT_WLAN_MSB 1 -#define BB_BLUETOOTH_CNTL_BT_ANT_HALT_WLAN_LSB 1 -#define BB_BLUETOOTH_CNTL_BT_ANT_HALT_WLAN_MASK 0x00000002 -#define BB_BLUETOOTH_CNTL_BT_ANT_HALT_WLAN_GET(x) (((x) & 0x00000002) >> 1) -#define BB_BLUETOOTH_CNTL_BT_ANT_HALT_WLAN_SET(x) (((x) << 1) & 0x00000002) -#define BB_BLUETOOTH_CNTL_ENABLE_RFBUS_GRANT_WAKEUP_MSB 2 -#define BB_BLUETOOTH_CNTL_ENABLE_RFBUS_GRANT_WAKEUP_LSB 2 -#define BB_BLUETOOTH_CNTL_ENABLE_RFBUS_GRANT_WAKEUP_MASK 0x00000004 -#define BB_BLUETOOTH_CNTL_ENABLE_RFBUS_GRANT_WAKEUP_GET(x) (((x) & 0x00000004) >> 2) -#define BB_BLUETOOTH_CNTL_ENABLE_RFBUS_GRANT_WAKEUP_SET(x) (((x) << 2) & 0x00000004) - -/* macros for bb_sm_reg_map.BB_phyonly_warm_reset */ -#define BB_PHYONLY_WARM_RESET_ADDRESS 0x000005d0 -#define BB_PHYONLY_WARM_RESET_OFFSET 0x000005d0 -#define BB_PHYONLY_WARM_RESET_PHYONLY_RST_WARM_L_MSB 0 -#define BB_PHYONLY_WARM_RESET_PHYONLY_RST_WARM_L_LSB 0 -#define BB_PHYONLY_WARM_RESET_PHYONLY_RST_WARM_L_MASK 0x00000001 -#define BB_PHYONLY_WARM_RESET_PHYONLY_RST_WARM_L_GET(x) (((x) & 0x00000001) >> 0) -#define BB_PHYONLY_WARM_RESET_PHYONLY_RST_WARM_L_SET(x) (((x) << 0) & 0x00000001) - -/* macros for bb_sm_reg_map.BB_phyonly_control */ -#define BB_PHYONLY_CONTROL_ADDRESS 0x000005d4 -#define BB_PHYONLY_CONTROL_OFFSET 0x000005d4 -#define BB_PHYONLY_CONTROL_RX_DRAIN_RATE_MSB 0 -#define BB_PHYONLY_CONTROL_RX_DRAIN_RATE_LSB 0 -#define BB_PHYONLY_CONTROL_RX_DRAIN_RATE_MASK 0x00000001 -#define BB_PHYONLY_CONTROL_RX_DRAIN_RATE_GET(x) (((x) & 0x00000001) >> 0) -#define BB_PHYONLY_CONTROL_RX_DRAIN_RATE_SET(x) (((x) << 0) & 0x00000001) -#define BB_PHYONLY_CONTROL_LATE_TX_SIGNAL_SYMBOL_MSB 1 -#define BB_PHYONLY_CONTROL_LATE_TX_SIGNAL_SYMBOL_LSB 1 -#define BB_PHYONLY_CONTROL_LATE_TX_SIGNAL_SYMBOL_MASK 0x00000002 -#define BB_PHYONLY_CONTROL_LATE_TX_SIGNAL_SYMBOL_GET(x) (((x) & 0x00000002) >> 1) -#define BB_PHYONLY_CONTROL_LATE_TX_SIGNAL_SYMBOL_SET(x) (((x) << 1) & 0x00000002) -#define BB_PHYONLY_CONTROL_GENERATE_SCRAMBLER_MSB 2 -#define BB_PHYONLY_CONTROL_GENERATE_SCRAMBLER_LSB 2 -#define BB_PHYONLY_CONTROL_GENERATE_SCRAMBLER_MASK 0x00000004 -#define BB_PHYONLY_CONTROL_GENERATE_SCRAMBLER_GET(x) (((x) & 0x00000004) >> 2) -#define BB_PHYONLY_CONTROL_GENERATE_SCRAMBLER_SET(x) (((x) << 2) & 0x00000004) -#define BB_PHYONLY_CONTROL_TX_ANTENNA_SELECT_MSB 3 -#define BB_PHYONLY_CONTROL_TX_ANTENNA_SELECT_LSB 3 -#define BB_PHYONLY_CONTROL_TX_ANTENNA_SELECT_MASK 0x00000008 -#define BB_PHYONLY_CONTROL_TX_ANTENNA_SELECT_GET(x) (((x) & 0x00000008) >> 3) -#define BB_PHYONLY_CONTROL_TX_ANTENNA_SELECT_SET(x) (((x) << 3) & 0x00000008) -#define BB_PHYONLY_CONTROL_STATIC_TX_ANTENNA_MSB 4 -#define BB_PHYONLY_CONTROL_STATIC_TX_ANTENNA_LSB 4 -#define BB_PHYONLY_CONTROL_STATIC_TX_ANTENNA_MASK 0x00000010 -#define BB_PHYONLY_CONTROL_STATIC_TX_ANTENNA_GET(x) (((x) & 0x00000010) >> 4) -#define BB_PHYONLY_CONTROL_STATIC_TX_ANTENNA_SET(x) (((x) << 4) & 0x00000010) -#define BB_PHYONLY_CONTROL_RX_ANTENNA_SELECT_MSB 5 -#define BB_PHYONLY_CONTROL_RX_ANTENNA_SELECT_LSB 5 -#define BB_PHYONLY_CONTROL_RX_ANTENNA_SELECT_MASK 0x00000020 -#define BB_PHYONLY_CONTROL_RX_ANTENNA_SELECT_GET(x) (((x) & 0x00000020) >> 5) -#define BB_PHYONLY_CONTROL_RX_ANTENNA_SELECT_SET(x) (((x) << 5) & 0x00000020) -#define BB_PHYONLY_CONTROL_STATIC_RX_ANTENNA_MSB 6 -#define BB_PHYONLY_CONTROL_STATIC_RX_ANTENNA_LSB 6 -#define BB_PHYONLY_CONTROL_STATIC_RX_ANTENNA_MASK 0x00000040 -#define BB_PHYONLY_CONTROL_STATIC_RX_ANTENNA_GET(x) (((x) & 0x00000040) >> 6) -#define BB_PHYONLY_CONTROL_STATIC_RX_ANTENNA_SET(x) (((x) << 6) & 0x00000040) -#define BB_PHYONLY_CONTROL_EN_LOW_FREQ_SLEEP_MSB 7 -#define BB_PHYONLY_CONTROL_EN_LOW_FREQ_SLEEP_LSB 7 -#define BB_PHYONLY_CONTROL_EN_LOW_FREQ_SLEEP_MASK 0x00000080 -#define BB_PHYONLY_CONTROL_EN_LOW_FREQ_SLEEP_GET(x) (((x) & 0x00000080) >> 7) -#define BB_PHYONLY_CONTROL_EN_LOW_FREQ_SLEEP_SET(x) (((x) << 7) & 0x00000080) - -/* macros for bb_sm_reg_map.BB_eco_ctrl */ -#define BB_ECO_CTRL_ADDRESS 0x000005dc -#define BB_ECO_CTRL_OFFSET 0x000005dc -#define BB_ECO_CTRL_ECO_CTRL_MSB 7 -#define BB_ECO_CTRL_ECO_CTRL_LSB 0 -#define BB_ECO_CTRL_ECO_CTRL_MASK 0x000000ff -#define BB_ECO_CTRL_ECO_CTRL_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_ECO_CTRL_ECO_CTRL_SET(x) (((x) << 0) & 0x000000ff) - -/* macros for bb_sm_reg_map.BB_tables_intf_addr_b0 */ -#define BB_TABLES_INTF_ADDR_B0_ADDRESS 0x000005f0 -#define BB_TABLES_INTF_ADDR_B0_OFFSET 0x000005f0 -#define BB_TABLES_INTF_ADDR_B0_TABLES_ADDR_0_MSB 17 -#define BB_TABLES_INTF_ADDR_B0_TABLES_ADDR_0_LSB 2 -#define BB_TABLES_INTF_ADDR_B0_TABLES_ADDR_0_MASK 0x0003fffc -#define BB_TABLES_INTF_ADDR_B0_TABLES_ADDR_0_GET(x) (((x) & 0x0003fffc) >> 2) -#define BB_TABLES_INTF_ADDR_B0_TABLES_ADDR_0_SET(x) (((x) << 2) & 0x0003fffc) -#define BB_TABLES_INTF_ADDR_B0_ADDR_AUTO_INCR_0_MSB 31 -#define BB_TABLES_INTF_ADDR_B0_ADDR_AUTO_INCR_0_LSB 31 -#define BB_TABLES_INTF_ADDR_B0_ADDR_AUTO_INCR_0_MASK 0x80000000 -#define BB_TABLES_INTF_ADDR_B0_ADDR_AUTO_INCR_0_GET(x) (((x) & 0x80000000) >> 31) -#define BB_TABLES_INTF_ADDR_B0_ADDR_AUTO_INCR_0_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_sm_reg_map.BB_tables_intf_data_b0 */ -#define BB_TABLES_INTF_DATA_B0_ADDRESS 0x000005f4 -#define BB_TABLES_INTF_DATA_B0_OFFSET 0x000005f4 -#define BB_TABLES_INTF_DATA_B0_TABLES_DATA_0_MSB 31 -#define BB_TABLES_INTF_DATA_B0_TABLES_DATA_0_LSB 0 -#define BB_TABLES_INTF_DATA_B0_TABLES_DATA_0_MASK 0xffffffff -#define BB_TABLES_INTF_DATA_B0_TABLES_DATA_0_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TABLES_INTF_DATA_B0_TABLES_DATA_0_SET(x) (((x) << 0) & 0xffffffff) - -#ifndef __ASSEMBLER__ - -typedef struct bb_reg_reg_s_5 { - volatile unsigned int BB_D2_chip_id; /* 0x0 - 0x4 */ - volatile unsigned int BB_gen_controls; /* 0x4 - 0x8 */ - volatile unsigned int BB_modes_select; /* 0x8 - 0xc */ - volatile unsigned int BB_active; /* 0xc - 0x10 */ - volatile char pad__0[0x10]; /* 0x10 - 0x20 */ - volatile unsigned int BB_vit_spur_mask_A; /* 0x20 - 0x24 */ - volatile unsigned int BB_vit_spur_mask_B; /* 0x24 - 0x28 */ - volatile unsigned int BB_spectral_scan; /* 0x28 - 0x2c */ - volatile unsigned int BB_radar_bw_filter; /* 0x2c - 0x30 */ - volatile unsigned int BB_search_start_delay; /* 0x30 - 0x34 */ - volatile unsigned int BB_max_rx_length; /* 0x34 - 0x38 */ - volatile unsigned int BB_frame_control; /* 0x38 - 0x3c */ - volatile unsigned int BB_rfbus_request; /* 0x3c - 0x40 */ - volatile unsigned int BB_rfbus_grant; /* 0x40 - 0x44 */ - volatile unsigned int BB_rifs; /* 0x44 - 0x48 */ - volatile unsigned int BB_spectral_scan_2; /* 0x48 - 0x4c */ - volatile char pad__1[0x4]; /* 0x4c - 0x50 */ - volatile unsigned int BB_rx_clear_delay; /* 0x50 - 0x54 */ - volatile unsigned int BB_analog_power_on_time; /* 0x54 - 0x58 */ - volatile unsigned int BB_tx_timing_1; /* 0x58 - 0x5c */ - volatile unsigned int BB_tx_timing_2; /* 0x5c - 0x60 */ - volatile unsigned int BB_tx_timing_3; /* 0x60 - 0x64 */ - volatile unsigned int BB_xpa_timing_control; /* 0x64 - 0x68 */ - volatile char pad__2[0x18]; /* 0x68 - 0x80 */ - volatile unsigned int BB_misc_pa_control; /* 0x80 - 0x84 */ - volatile unsigned int BB_switch_table_chn_b0; /* 0x84 - 0x88 */ - volatile unsigned int BB_switch_table_com1; /* 0x88 - 0x8c */ - volatile unsigned int BB_switch_table_com2; /* 0x8c - 0x90 */ - volatile char pad__3[0x10]; /* 0x90 - 0xa0 */ - volatile unsigned int BB_multichain_enable; /* 0xa0 - 0xa4 */ - volatile char pad__4[0x1c]; /* 0xa4 - 0xc0 */ - volatile unsigned int BB_cal_chain_mask; /* 0xc0 - 0xc4 */ - volatile unsigned int BB_agc_control; /* 0xc4 - 0xc8 */ - volatile unsigned int BB_iq_adc_cal_mode; /* 0xc8 - 0xcc */ - volatile unsigned int BB_fcal_1; /* 0xcc - 0xd0 */ - volatile unsigned int BB_fcal_2_b0; /* 0xd0 - 0xd4 */ - volatile unsigned int BB_dft_tone_ctrl_b0; /* 0xd4 - 0xd8 */ - volatile unsigned int BB_cl_cal_ctrl; /* 0xd8 - 0xdc */ - volatile unsigned int BB_cl_map_0_b0; /* 0xdc - 0xe0 */ - volatile unsigned int BB_cl_map_1_b0; /* 0xe0 - 0xe4 */ - volatile unsigned int BB_cl_map_2_b0; /* 0xe4 - 0xe8 */ - volatile unsigned int BB_cl_map_3_b0; /* 0xe8 - 0xec */ - volatile unsigned int BB_cl_map_pal_0_b0; /* 0xec - 0xf0 */ - volatile unsigned int BB_cl_map_pal_1_b0; /* 0xf0 - 0xf4 */ - volatile unsigned int BB_cl_map_pal_2_b0; /* 0xf4 - 0xf8 */ - volatile unsigned int BB_cl_map_pal_3_b0; /* 0xf8 - 0xfc */ - volatile char pad__5[0x4]; /* 0xfc - 0x100 */ - volatile unsigned int BB_cl_tab_b0[16]; /* 0x100 - 0x140 */ - volatile unsigned int BB_synth_control; /* 0x140 - 0x144 */ - volatile unsigned int BB_addac_clk_select; /* 0x144 - 0x148 */ - volatile unsigned int BB_pll_cntl; /* 0x148 - 0x14c */ - volatile unsigned int BB_analog_swap; /* 0x14c - 0x150 */ - volatile unsigned int BB_addac_parallel_control; /* 0x150 - 0x154 */ - volatile char pad__6[0x4]; /* 0x154 - 0x158 */ - volatile unsigned int BB_force_analog; /* 0x158 - 0x15c */ - volatile char pad__7[0x4]; /* 0x15c - 0x160 */ - volatile unsigned int BB_test_controls; /* 0x160 - 0x164 */ - volatile unsigned int BB_test_controls_status; /* 0x164 - 0x168 */ - volatile unsigned int BB_tstdac; /* 0x168 - 0x16c */ - volatile unsigned int BB_channel_status; /* 0x16c - 0x170 */ - volatile unsigned int BB_chaninfo_ctrl; /* 0x170 - 0x174 */ - volatile unsigned int BB_chan_info_noise_pwr; /* 0x174 - 0x178 */ - volatile unsigned int BB_chan_info_gain_diff; /* 0x178 - 0x17c */ - volatile unsigned int BB_chan_info_fine_timing; /* 0x17c - 0x180 */ - volatile unsigned int BB_chan_info_gain_b0; /* 0x180 - 0x184 */ - volatile unsigned int BB_sm_hist; /* 0x184 - 0x188 */ - volatile char pad__8[0x8]; /* 0x188 - 0x190 */ - volatile unsigned int BB_scrambler_seed; /* 0x190 - 0x194 */ - volatile unsigned int BB_bbb_tx_ctrl; /* 0x194 - 0x198 */ - volatile unsigned int BB_bbb_txfir_0; /* 0x198 - 0x19c */ - volatile unsigned int BB_bbb_txfir_1; /* 0x19c - 0x1a0 */ - volatile unsigned int BB_bbb_txfir_2; /* 0x1a0 - 0x1a4 */ - volatile unsigned int BB_heavy_clip_ctrl; /* 0x1a4 - 0x1a8 */ - volatile unsigned int BB_heavy_clip_20; /* 0x1a8 - 0x1ac */ - volatile unsigned int BB_heavy_clip_40; /* 0x1ac - 0x1b0 */ - volatile unsigned int BB_illegal_tx_rate; /* 0x1b0 - 0x1b4 */ - volatile char pad__9[0xc]; /* 0x1b4 - 0x1c0 */ - volatile unsigned int BB_powertx_rate1; /* 0x1c0 - 0x1c4 */ - volatile unsigned int BB_powertx_rate2; /* 0x1c4 - 0x1c8 */ - volatile unsigned int BB_powertx_rate3; /* 0x1c8 - 0x1cc */ - volatile unsigned int BB_powertx_rate4; /* 0x1cc - 0x1d0 */ - volatile unsigned int BB_powertx_rate5; /* 0x1d0 - 0x1d4 */ - volatile unsigned int BB_powertx_rate6; /* 0x1d4 - 0x1d8 */ - volatile unsigned int BB_powertx_rate7; /* 0x1d8 - 0x1dc */ - volatile unsigned int BB_powertx_rate8; /* 0x1dc - 0x1e0 */ - volatile unsigned int BB_powertx_rate9; /* 0x1e0 - 0x1e4 */ - volatile unsigned int BB_powertx_rate10; /* 0x1e4 - 0x1e8 */ - volatile unsigned int BB_powertx_rate11; /* 0x1e8 - 0x1ec */ - volatile unsigned int BB_powertx_rate12; /* 0x1ec - 0x1f0 */ - volatile unsigned int BB_powertx_max; /* 0x1f0 - 0x1f4 */ - volatile unsigned int BB_powertx_sub; /* 0x1f4 - 0x1f8 */ - volatile unsigned int BB_tpc_1; /* 0x1f8 - 0x1fc */ - volatile unsigned int BB_tpc_2; /* 0x1fc - 0x200 */ - volatile unsigned int BB_tpc_3; /* 0x200 - 0x204 */ - volatile unsigned int BB_tpc_4_b0; /* 0x204 - 0x208 */ - volatile unsigned int BB_tpc_5_b0; /* 0x208 - 0x20c */ - volatile unsigned int BB_tpc_6_b0; /* 0x20c - 0x210 */ - volatile unsigned int BB_tpc_7; /* 0x210 - 0x214 */ - volatile unsigned int BB_tpc_8; /* 0x214 - 0x218 */ - volatile unsigned int BB_tpc_9; /* 0x218 - 0x21c */ - volatile unsigned int BB_tpc_10; /* 0x21c - 0x220 */ - volatile unsigned int BB_tpc_11_b0; /* 0x220 - 0x224 */ - volatile unsigned int BB_tpc_12; /* 0x224 - 0x228 */ - volatile unsigned int BB_tpc_13; /* 0x228 - 0x22c */ - volatile unsigned int BB_tpc_14; /* 0x22c - 0x230 */ - volatile unsigned int BB_tpc_15; /* 0x230 - 0x234 */ - volatile unsigned int BB_tpc_16; /* 0x234 - 0x238 */ - volatile unsigned int BB_tpc_17; /* 0x238 - 0x23c */ - volatile unsigned int BB_tpc_18; /* 0x23c - 0x240 */ - volatile unsigned int BB_tpc_19_b0; /* 0x240 - 0x244 */ - volatile unsigned int BB_tpc_20; /* 0x244 - 0x248 */ - volatile unsigned int BB_therm_adc_1; /* 0x248 - 0x24c */ - volatile unsigned int BB_therm_adc_2; /* 0x24c - 0x250 */ - volatile unsigned int BB_therm_adc_3; /* 0x250 - 0x254 */ - volatile unsigned int BB_therm_adc_4; /* 0x254 - 0x258 */ - volatile unsigned int BB_tx_forced_gain; /* 0x258 - 0x25c */ - volatile char pad__10[0x24]; /* 0x25c - 0x280 */ - volatile unsigned int BB_pdadc_tab_b0[32]; /* 0x280 - 0x300 */ - volatile unsigned int BB_tx_gain_tab_1; /* 0x300 - 0x304 */ - volatile unsigned int BB_tx_gain_tab_2; /* 0x304 - 0x308 */ - volatile unsigned int BB_tx_gain_tab_3; /* 0x308 - 0x30c */ - volatile unsigned int BB_tx_gain_tab_4; /* 0x30c - 0x310 */ - volatile unsigned int BB_tx_gain_tab_5; /* 0x310 - 0x314 */ - volatile unsigned int BB_tx_gain_tab_6; /* 0x314 - 0x318 */ - volatile unsigned int BB_tx_gain_tab_7; /* 0x318 - 0x31c */ - volatile unsigned int BB_tx_gain_tab_8; /* 0x31c - 0x320 */ - volatile unsigned int BB_tx_gain_tab_9; /* 0x320 - 0x324 */ - volatile unsigned int BB_tx_gain_tab_10; /* 0x324 - 0x328 */ - volatile unsigned int BB_tx_gain_tab_11; /* 0x328 - 0x32c */ - volatile unsigned int BB_tx_gain_tab_12; /* 0x32c - 0x330 */ - volatile unsigned int BB_tx_gain_tab_13; /* 0x330 - 0x334 */ - volatile unsigned int BB_tx_gain_tab_14; /* 0x334 - 0x338 */ - volatile unsigned int BB_tx_gain_tab_15; /* 0x338 - 0x33c */ - volatile unsigned int BB_tx_gain_tab_16; /* 0x33c - 0x340 */ - volatile unsigned int BB_tx_gain_tab_17; /* 0x340 - 0x344 */ - volatile unsigned int BB_tx_gain_tab_18; /* 0x344 - 0x348 */ - volatile unsigned int BB_tx_gain_tab_19; /* 0x348 - 0x34c */ - volatile unsigned int BB_tx_gain_tab_20; /* 0x34c - 0x350 */ - volatile unsigned int BB_tx_gain_tab_21; /* 0x350 - 0x354 */ - volatile unsigned int BB_tx_gain_tab_22; /* 0x354 - 0x358 */ - volatile unsigned int BB_tx_gain_tab_23; /* 0x358 - 0x35c */ - volatile unsigned int BB_tx_gain_tab_24; /* 0x35c - 0x360 */ - volatile unsigned int BB_tx_gain_tab_25; /* 0x360 - 0x364 */ - volatile unsigned int BB_tx_gain_tab_26; /* 0x364 - 0x368 */ - volatile unsigned int BB_tx_gain_tab_27; /* 0x368 - 0x36c */ - volatile unsigned int BB_tx_gain_tab_28; /* 0x36c - 0x370 */ - volatile unsigned int BB_tx_gain_tab_29; /* 0x370 - 0x374 */ - volatile unsigned int BB_tx_gain_tab_30; /* 0x374 - 0x378 */ - volatile unsigned int BB_tx_gain_tab_31; /* 0x378 - 0x37c */ - volatile unsigned int BB_tx_gain_tab_32; /* 0x37c - 0x380 */ - volatile unsigned int BB_rtt_ctrl; /* 0x380 - 0x384 */ - volatile unsigned int BB_rtt_table_sw_intf_b0; /* 0x384 - 0x388 */ - volatile unsigned int BB_rtt_table_sw_intf_1_b0; /* 0x388 - 0x38c */ - volatile unsigned int BB_tx_gain_tab_1_16_lsb_ext; /* 0x38c - 0x390 */ - volatile unsigned int BB_tx_gain_tab_17_32_lsb_ext; /* 0x390 - 0x394 */ - volatile char pad__11[0x6c]; /* 0x394 - 0x400 */ - volatile unsigned int BB_caltx_gain_set_0; /* 0x400 - 0x404 */ - volatile unsigned int BB_caltx_gain_set_2; /* 0x404 - 0x408 */ - volatile unsigned int BB_caltx_gain_set_4; /* 0x408 - 0x40c */ - volatile unsigned int BB_caltx_gain_set_6; /* 0x40c - 0x410 */ - volatile unsigned int BB_caltx_gain_set_8; /* 0x410 - 0x414 */ - volatile unsigned int BB_caltx_gain_set_10; /* 0x414 - 0x418 */ - volatile unsigned int BB_caltx_gain_set_12; /* 0x418 - 0x41c */ - volatile unsigned int BB_caltx_gain_set_14; /* 0x41c - 0x420 */ - volatile unsigned int BB_caltx_gain_set_16; /* 0x420 - 0x424 */ - volatile unsigned int BB_caltx_gain_set_18; /* 0x424 - 0x428 */ - volatile unsigned int BB_caltx_gain_set_20; /* 0x428 - 0x42c */ - volatile unsigned int BB_caltx_gain_set_22; /* 0x42c - 0x430 */ - volatile unsigned int BB_caltx_gain_set_24; /* 0x430 - 0x434 */ - volatile unsigned int BB_caltx_gain_set_26; /* 0x434 - 0x438 */ - volatile unsigned int BB_caltx_gain_set_28; /* 0x438 - 0x43c */ - volatile unsigned int BB_caltx_gain_set_30; /* 0x43c - 0x440 */ - volatile char pad__12[0x4]; /* 0x440 - 0x444 */ - volatile unsigned int BB_txiqcal_control_0; /* 0x444 - 0x448 */ - volatile unsigned int BB_txiqcal_control_1; /* 0x448 - 0x44c */ - volatile unsigned int BB_txiqcal_control_2; /* 0x44c - 0x450 */ - volatile unsigned int BB_txiq_corr_coeff_01_b0; /* 0x450 - 0x454 */ - volatile unsigned int BB_txiq_corr_coeff_23_b0; /* 0x454 - 0x458 */ - volatile unsigned int BB_txiq_corr_coeff_45_b0; /* 0x458 - 0x45c */ - volatile unsigned int BB_txiq_corr_coeff_67_b0; /* 0x45c - 0x460 */ - volatile unsigned int BB_txiq_corr_coeff_89_b0; /* 0x460 - 0x464 */ - volatile unsigned int BB_txiq_corr_coeff_ab_b0; /* 0x464 - 0x468 */ - volatile unsigned int BB_txiq_corr_coeff_cd_b0; /* 0x468 - 0x46c */ - volatile unsigned int BB_txiq_corr_coeff_ef_b0; /* 0x46c - 0x470 */ - volatile unsigned int BB_cal_rxbb_gain_tbl_0; /* 0x470 - 0x474 */ - volatile unsigned int BB_cal_rxbb_gain_tbl_4; /* 0x474 - 0x478 */ - volatile unsigned int BB_cal_rxbb_gain_tbl_8; /* 0x478 - 0x47c */ - volatile unsigned int BB_cal_rxbb_gain_tbl_12; /* 0x47c - 0x480 */ - volatile unsigned int BB_cal_rxbb_gain_tbl_16; /* 0x480 - 0x484 */ - volatile unsigned int BB_cal_rxbb_gain_tbl_20; /* 0x484 - 0x488 */ - volatile unsigned int BB_cal_rxbb_gain_tbl_24; /* 0x488 - 0x48c */ - volatile unsigned int BB_txiqcal_status_b0; /* 0x48c - 0x490 */ - volatile unsigned int BB_paprd_trainer_cntl1; /* 0x490 - 0x494 */ - volatile unsigned int BB_paprd_trainer_cntl2; /* 0x494 - 0x498 */ - volatile unsigned int BB_paprd_trainer_cntl3; /* 0x498 - 0x49c */ - volatile unsigned int BB_paprd_trainer_cntl4; /* 0x49c - 0x4a0 */ - volatile unsigned int BB_paprd_trainer_stat1; /* 0x4a0 - 0x4a4 */ - volatile unsigned int BB_paprd_trainer_stat2; /* 0x4a4 - 0x4a8 */ - volatile unsigned int BB_paprd_trainer_stat3; /* 0x4a8 - 0x4ac */ - volatile char pad__13[0x114]; /* 0x4ac - 0x5c0 */ - volatile unsigned int BB_watchdog_status; /* 0x5c0 - 0x5c4 */ - volatile unsigned int BB_watchdog_ctrl_1; /* 0x5c4 - 0x5c8 */ - volatile unsigned int BB_watchdog_ctrl_2; /* 0x5c8 - 0x5cc */ - volatile unsigned int BB_bluetooth_cntl; /* 0x5cc - 0x5d0 */ - volatile unsigned int BB_phyonly_warm_reset; /* 0x5d0 - 0x5d4 */ - volatile unsigned int BB_phyonly_control; /* 0x5d4 - 0x5d8 */ - volatile char pad__14[0x4]; /* 0x5d8 - 0x5dc */ - volatile unsigned int BB_eco_ctrl; /* 0x5dc - 0x5e0 */ - volatile char pad__15[0x10]; /* 0x5e0 - 0x5f0 */ - volatile unsigned int BB_tables_intf_addr_b0; /* 0x5f0 - 0x5f4 */ - volatile unsigned int BB_tables_intf_data_b0; /* 0x5f4 - 0x5f8 */ -} bb_reg_reg_t_5; - -#endif /* __ASSEMBLER__ */ - - -/* macros for bb_chn1_reg_map.BB_ext_chan_pwr_thr_2_b1 */ -#define BB_EXT_CHAN_PWR_THR_2_B1_ADDRESS 0x00000030 -#define BB_EXT_CHAN_PWR_THR_2_B1_OFFSET 0x00000030 -#define BB_EXT_CHAN_PWR_THR_2_B1_CF_MAXCCAPWR_EXT_1_MSB 8 -#define BB_EXT_CHAN_PWR_THR_2_B1_CF_MAXCCAPWR_EXT_1_LSB 0 -#define BB_EXT_CHAN_PWR_THR_2_B1_CF_MAXCCAPWR_EXT_1_MASK 0x000001ff -#define BB_EXT_CHAN_PWR_THR_2_B1_CF_MAXCCAPWR_EXT_1_GET(x) (((x) & 0x000001ff) >> 0) -#define BB_EXT_CHAN_PWR_THR_2_B1_CF_MAXCCAPWR_EXT_1_SET(x) (((x) << 0) & 0x000001ff) -#define BB_EXT_CHAN_PWR_THR_2_B1_MINCCAPWR_EXT_1_MSB 24 -#define BB_EXT_CHAN_PWR_THR_2_B1_MINCCAPWR_EXT_1_LSB 16 -#define BB_EXT_CHAN_PWR_THR_2_B1_MINCCAPWR_EXT_1_MASK 0x01ff0000 -#define BB_EXT_CHAN_PWR_THR_2_B1_MINCCAPWR_EXT_1_GET(x) (((x) & 0x01ff0000) >> 16) - -/* macros for bb_chn1_reg_map.BB_spur_report_b1 */ -#define BB_SPUR_REPORT_B1_ADDRESS 0x000000a8 -#define BB_SPUR_REPORT_B1_OFFSET 0x000000a8 -#define BB_SPUR_REPORT_B1_SPUR_EST_I_1_MSB 7 -#define BB_SPUR_REPORT_B1_SPUR_EST_I_1_LSB 0 -#define BB_SPUR_REPORT_B1_SPUR_EST_I_1_MASK 0x000000ff -#define BB_SPUR_REPORT_B1_SPUR_EST_I_1_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_SPUR_REPORT_B1_SPUR_EST_Q_1_MSB 15 -#define BB_SPUR_REPORT_B1_SPUR_EST_Q_1_LSB 8 -#define BB_SPUR_REPORT_B1_SPUR_EST_Q_1_MASK 0x0000ff00 -#define BB_SPUR_REPORT_B1_SPUR_EST_Q_1_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_SPUR_REPORT_B1_POWER_WITH_SPUR_REMOVED_1_MSB 31 -#define BB_SPUR_REPORT_B1_POWER_WITH_SPUR_REMOVED_1_LSB 16 -#define BB_SPUR_REPORT_B1_POWER_WITH_SPUR_REMOVED_1_MASK 0xffff0000 -#define BB_SPUR_REPORT_B1_POWER_WITH_SPUR_REMOVED_1_GET(x) (((x) & 0xffff0000) >> 16) - -/* macros for bb_chn1_reg_map.BB_iq_adc_meas_0_b1 */ -#define BB_IQ_ADC_MEAS_0_B1_ADDRESS 0x000000c0 -#define BB_IQ_ADC_MEAS_0_B1_OFFSET 0x000000c0 -#define BB_IQ_ADC_MEAS_0_B1_GAIN_DC_IQ_CAL_MEAS_0_1_MSB 31 -#define BB_IQ_ADC_MEAS_0_B1_GAIN_DC_IQ_CAL_MEAS_0_1_LSB 0 -#define BB_IQ_ADC_MEAS_0_B1_GAIN_DC_IQ_CAL_MEAS_0_1_MASK 0xffffffff -#define BB_IQ_ADC_MEAS_0_B1_GAIN_DC_IQ_CAL_MEAS_0_1_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for bb_chn1_reg_map.BB_iq_adc_meas_1_b1 */ -#define BB_IQ_ADC_MEAS_1_B1_ADDRESS 0x000000c4 -#define BB_IQ_ADC_MEAS_1_B1_OFFSET 0x000000c4 -#define BB_IQ_ADC_MEAS_1_B1_GAIN_DC_IQ_CAL_MEAS_1_1_MSB 31 -#define BB_IQ_ADC_MEAS_1_B1_GAIN_DC_IQ_CAL_MEAS_1_1_LSB 0 -#define BB_IQ_ADC_MEAS_1_B1_GAIN_DC_IQ_CAL_MEAS_1_1_MASK 0xffffffff -#define BB_IQ_ADC_MEAS_1_B1_GAIN_DC_IQ_CAL_MEAS_1_1_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for bb_chn1_reg_map.BB_iq_adc_meas_2_b1 */ -#define BB_IQ_ADC_MEAS_2_B1_ADDRESS 0x000000c8 -#define BB_IQ_ADC_MEAS_2_B1_OFFSET 0x000000c8 -#define BB_IQ_ADC_MEAS_2_B1_GAIN_DC_IQ_CAL_MEAS_2_1_MSB 31 -#define BB_IQ_ADC_MEAS_2_B1_GAIN_DC_IQ_CAL_MEAS_2_1_LSB 0 -#define BB_IQ_ADC_MEAS_2_B1_GAIN_DC_IQ_CAL_MEAS_2_1_MASK 0xffffffff -#define BB_IQ_ADC_MEAS_2_B1_GAIN_DC_IQ_CAL_MEAS_2_1_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for bb_chn1_reg_map.BB_iq_adc_meas_3_b1 */ -#define BB_IQ_ADC_MEAS_3_B1_ADDRESS 0x000000cc -#define BB_IQ_ADC_MEAS_3_B1_OFFSET 0x000000cc -#define BB_IQ_ADC_MEAS_3_B1_GAIN_DC_IQ_CAL_MEAS_3_1_MSB 31 -#define BB_IQ_ADC_MEAS_3_B1_GAIN_DC_IQ_CAL_MEAS_3_1_LSB 0 -#define BB_IQ_ADC_MEAS_3_B1_GAIN_DC_IQ_CAL_MEAS_3_1_MASK 0xffffffff -#define BB_IQ_ADC_MEAS_3_B1_GAIN_DC_IQ_CAL_MEAS_3_1_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for bb_chn1_reg_map.BB_tx_phase_ramp_b1 */ -#define BB_TX_PHASE_RAMP_B1_ADDRESS 0x000000d0 -#define BB_TX_PHASE_RAMP_B1_OFFSET 0x000000d0 -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_ENABLE_1_MSB 0 -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_ENABLE_1_LSB 0 -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_ENABLE_1_MASK 0x00000001 -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_ENABLE_1_GET(x) (((x) & 0x00000001) >> 0) -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_ENABLE_1_SET(x) (((x) << 0) & 0x00000001) -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_BIAS_1_MSB 6 -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_BIAS_1_LSB 1 -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_BIAS_1_MASK 0x0000007e -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_BIAS_1_GET(x) (((x) & 0x0000007e) >> 1) -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_BIAS_1_SET(x) (((x) << 1) & 0x0000007e) -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_INIT_1_MSB 16 -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_INIT_1_LSB 7 -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_INIT_1_MASK 0x0001ff80 -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_INIT_1_GET(x) (((x) & 0x0001ff80) >> 7) -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_INIT_1_SET(x) (((x) << 7) & 0x0001ff80) -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_ALPHA_1_MSB 24 -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_ALPHA_1_LSB 17 -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_ALPHA_1_MASK 0x01fe0000 -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_ALPHA_1_GET(x) (((x) & 0x01fe0000) >> 17) -#define BB_TX_PHASE_RAMP_B1_CF_PHASE_RAMP_ALPHA_1_SET(x) (((x) << 17) & 0x01fe0000) - -/* macros for bb_chn1_reg_map.BB_adc_gain_dc_corr_b1 */ -#define BB_ADC_GAIN_DC_CORR_B1_ADDRESS 0x000000d4 -#define BB_ADC_GAIN_DC_CORR_B1_OFFSET 0x000000d4 -#define BB_ADC_GAIN_DC_CORR_B1_ADC_GAIN_CORR_Q_COEFF_1_MSB 5 -#define BB_ADC_GAIN_DC_CORR_B1_ADC_GAIN_CORR_Q_COEFF_1_LSB 0 -#define BB_ADC_GAIN_DC_CORR_B1_ADC_GAIN_CORR_Q_COEFF_1_MASK 0x0000003f -#define BB_ADC_GAIN_DC_CORR_B1_ADC_GAIN_CORR_Q_COEFF_1_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_ADC_GAIN_DC_CORR_B1_ADC_GAIN_CORR_Q_COEFF_1_SET(x) (((x) << 0) & 0x0000003f) -#define BB_ADC_GAIN_DC_CORR_B1_ADC_GAIN_CORR_I_COEFF_1_MSB 11 -#define BB_ADC_GAIN_DC_CORR_B1_ADC_GAIN_CORR_I_COEFF_1_LSB 6 -#define BB_ADC_GAIN_DC_CORR_B1_ADC_GAIN_CORR_I_COEFF_1_MASK 0x00000fc0 -#define BB_ADC_GAIN_DC_CORR_B1_ADC_GAIN_CORR_I_COEFF_1_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_ADC_GAIN_DC_CORR_B1_ADC_GAIN_CORR_I_COEFF_1_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_ADC_GAIN_DC_CORR_B1_ADC_DC_CORR_Q_COEFF_1_MSB 20 -#define BB_ADC_GAIN_DC_CORR_B1_ADC_DC_CORR_Q_COEFF_1_LSB 12 -#define BB_ADC_GAIN_DC_CORR_B1_ADC_DC_CORR_Q_COEFF_1_MASK 0x001ff000 -#define BB_ADC_GAIN_DC_CORR_B1_ADC_DC_CORR_Q_COEFF_1_GET(x) (((x) & 0x001ff000) >> 12) -#define BB_ADC_GAIN_DC_CORR_B1_ADC_DC_CORR_Q_COEFF_1_SET(x) (((x) << 12) & 0x001ff000) -#define BB_ADC_GAIN_DC_CORR_B1_ADC_DC_CORR_I_COEFF_1_MSB 29 -#define BB_ADC_GAIN_DC_CORR_B1_ADC_DC_CORR_I_COEFF_1_LSB 21 -#define BB_ADC_GAIN_DC_CORR_B1_ADC_DC_CORR_I_COEFF_1_MASK 0x3fe00000 -#define BB_ADC_GAIN_DC_CORR_B1_ADC_DC_CORR_I_COEFF_1_GET(x) (((x) & 0x3fe00000) >> 21) -#define BB_ADC_GAIN_DC_CORR_B1_ADC_DC_CORR_I_COEFF_1_SET(x) (((x) << 21) & 0x3fe00000) - -/* macros for bb_chn1_reg_map.BB_rx_iq_corr_b1 */ -#define BB_RX_IQ_CORR_B1_ADDRESS 0x000000dc -#define BB_RX_IQ_CORR_B1_OFFSET 0x000000dc -#define BB_RX_IQ_CORR_B1_RX_IQCORR_Q_Q_COFF_1_MSB 6 -#define BB_RX_IQ_CORR_B1_RX_IQCORR_Q_Q_COFF_1_LSB 0 -#define BB_RX_IQ_CORR_B1_RX_IQCORR_Q_Q_COFF_1_MASK 0x0000007f -#define BB_RX_IQ_CORR_B1_RX_IQCORR_Q_Q_COFF_1_GET(x) (((x) & 0x0000007f) >> 0) -#define BB_RX_IQ_CORR_B1_RX_IQCORR_Q_Q_COFF_1_SET(x) (((x) << 0) & 0x0000007f) -#define BB_RX_IQ_CORR_B1_RX_IQCORR_Q_I_COFF_1_MSB 13 -#define BB_RX_IQ_CORR_B1_RX_IQCORR_Q_I_COFF_1_LSB 7 -#define BB_RX_IQ_CORR_B1_RX_IQCORR_Q_I_COFF_1_MASK 0x00003f80 -#define BB_RX_IQ_CORR_B1_RX_IQCORR_Q_I_COFF_1_GET(x) (((x) & 0x00003f80) >> 7) -#define BB_RX_IQ_CORR_B1_RX_IQCORR_Q_I_COFF_1_SET(x) (((x) << 7) & 0x00003f80) -#define BB_RX_IQ_CORR_B1_LOOPBACK_IQCORR_Q_Q_COFF_1_MSB 21 -#define BB_RX_IQ_CORR_B1_LOOPBACK_IQCORR_Q_Q_COFF_1_LSB 15 -#define BB_RX_IQ_CORR_B1_LOOPBACK_IQCORR_Q_Q_COFF_1_MASK 0x003f8000 -#define BB_RX_IQ_CORR_B1_LOOPBACK_IQCORR_Q_Q_COFF_1_GET(x) (((x) & 0x003f8000) >> 15) -#define BB_RX_IQ_CORR_B1_LOOPBACK_IQCORR_Q_Q_COFF_1_SET(x) (((x) << 15) & 0x003f8000) -#define BB_RX_IQ_CORR_B1_LOOPBACK_IQCORR_Q_I_COFF_1_MSB 28 -#define BB_RX_IQ_CORR_B1_LOOPBACK_IQCORR_Q_I_COFF_1_LSB 22 -#define BB_RX_IQ_CORR_B1_LOOPBACK_IQCORR_Q_I_COFF_1_MASK 0x1fc00000 -#define BB_RX_IQ_CORR_B1_LOOPBACK_IQCORR_Q_I_COFF_1_GET(x) (((x) & 0x1fc00000) >> 22) -#define BB_RX_IQ_CORR_B1_LOOPBACK_IQCORR_Q_I_COFF_1_SET(x) (((x) << 22) & 0x1fc00000) - -/* macros for bb_chn1_reg_map.BB_paprd_ctrl0_b1 */ -#define BB_PAPRD_CTRL0_B1_ADDRESS 0x000000f0 -#define BB_PAPRD_CTRL0_B1_OFFSET 0x000000f0 -#define BB_PAPRD_CTRL0_B1_PAPRD_ENABLE_1_MSB 0 -#define BB_PAPRD_CTRL0_B1_PAPRD_ENABLE_1_LSB 0 -#define BB_PAPRD_CTRL0_B1_PAPRD_ENABLE_1_MASK 0x00000001 -#define BB_PAPRD_CTRL0_B1_PAPRD_ENABLE_1_GET(x) (((x) & 0x00000001) >> 0) -#define BB_PAPRD_CTRL0_B1_PAPRD_ENABLE_1_SET(x) (((x) << 0) & 0x00000001) -#define BB_PAPRD_CTRL0_B1_PAPRD_ADAPTIVE_USE_SINGLE_TABLE_1_MSB 1 -#define BB_PAPRD_CTRL0_B1_PAPRD_ADAPTIVE_USE_SINGLE_TABLE_1_LSB 1 -#define BB_PAPRD_CTRL0_B1_PAPRD_ADAPTIVE_USE_SINGLE_TABLE_1_MASK 0x00000002 -#define BB_PAPRD_CTRL0_B1_PAPRD_ADAPTIVE_USE_SINGLE_TABLE_1_GET(x) (((x) & 0x00000002) >> 1) -#define BB_PAPRD_CTRL0_B1_PAPRD_ADAPTIVE_USE_SINGLE_TABLE_1_SET(x) (((x) << 1) & 0x00000002) -#define BB_PAPRD_CTRL0_B1_PAPRD_VALID_GAIN_1_MSB 26 -#define BB_PAPRD_CTRL0_B1_PAPRD_VALID_GAIN_1_LSB 2 -#define BB_PAPRD_CTRL0_B1_PAPRD_VALID_GAIN_1_MASK 0x07fffffc -#define BB_PAPRD_CTRL0_B1_PAPRD_VALID_GAIN_1_GET(x) (((x) & 0x07fffffc) >> 2) -#define BB_PAPRD_CTRL0_B1_PAPRD_VALID_GAIN_1_SET(x) (((x) << 2) & 0x07fffffc) -#define BB_PAPRD_CTRL0_B1_PAPRD_MAG_THRSH_1_MSB 31 -#define BB_PAPRD_CTRL0_B1_PAPRD_MAG_THRSH_1_LSB 27 -#define BB_PAPRD_CTRL0_B1_PAPRD_MAG_THRSH_1_MASK 0xf8000000 -#define BB_PAPRD_CTRL0_B1_PAPRD_MAG_THRSH_1_GET(x) (((x) & 0xf8000000) >> 27) -#define BB_PAPRD_CTRL0_B1_PAPRD_MAG_THRSH_1_SET(x) (((x) << 27) & 0xf8000000) - -/* macros for bb_chn1_reg_map.BB_paprd_ctrl1_b1 */ -#define BB_PAPRD_CTRL1_B1_ADDRESS 0x000000f4 -#define BB_PAPRD_CTRL1_B1_OFFSET 0x000000f4 -#define BB_PAPRD_CTRL1_B1_PAPRD_ADAPTIVE_SCALING_ENABLE_1_MSB 0 -#define BB_PAPRD_CTRL1_B1_PAPRD_ADAPTIVE_SCALING_ENABLE_1_LSB 0 -#define BB_PAPRD_CTRL1_B1_PAPRD_ADAPTIVE_SCALING_ENABLE_1_MASK 0x00000001 -#define BB_PAPRD_CTRL1_B1_PAPRD_ADAPTIVE_SCALING_ENABLE_1_GET(x) (((x) & 0x00000001) >> 0) -#define BB_PAPRD_CTRL1_B1_PAPRD_ADAPTIVE_SCALING_ENABLE_1_SET(x) (((x) << 0) & 0x00000001) -#define BB_PAPRD_CTRL1_B1_PAPRD_ADAPTIVE_AM2AM_ENABLE_1_MSB 1 -#define BB_PAPRD_CTRL1_B1_PAPRD_ADAPTIVE_AM2AM_ENABLE_1_LSB 1 -#define BB_PAPRD_CTRL1_B1_PAPRD_ADAPTIVE_AM2AM_ENABLE_1_MASK 0x00000002 -#define BB_PAPRD_CTRL1_B1_PAPRD_ADAPTIVE_AM2AM_ENABLE_1_GET(x) (((x) & 0x00000002) >> 1) -#define BB_PAPRD_CTRL1_B1_PAPRD_ADAPTIVE_AM2AM_ENABLE_1_SET(x) (((x) << 1) & 0x00000002) -#define BB_PAPRD_CTRL1_B1_PAPRD_ADAPTIVE_AM2PM_ENABLE_1_MSB 2 -#define BB_PAPRD_CTRL1_B1_PAPRD_ADAPTIVE_AM2PM_ENABLE_1_LSB 2 -#define BB_PAPRD_CTRL1_B1_PAPRD_ADAPTIVE_AM2PM_ENABLE_1_MASK 0x00000004 -#define BB_PAPRD_CTRL1_B1_PAPRD_ADAPTIVE_AM2PM_ENABLE_1_GET(x) (((x) & 0x00000004) >> 2) -#define BB_PAPRD_CTRL1_B1_PAPRD_ADAPTIVE_AM2PM_ENABLE_1_SET(x) (((x) << 2) & 0x00000004) -#define BB_PAPRD_CTRL1_B1_PAPRD_POWER_AT_AM2AM_CAL_1_MSB 8 -#define BB_PAPRD_CTRL1_B1_PAPRD_POWER_AT_AM2AM_CAL_1_LSB 3 -#define BB_PAPRD_CTRL1_B1_PAPRD_POWER_AT_AM2AM_CAL_1_MASK 0x000001f8 -#define BB_PAPRD_CTRL1_B1_PAPRD_POWER_AT_AM2AM_CAL_1_GET(x) (((x) & 0x000001f8) >> 3) -#define BB_PAPRD_CTRL1_B1_PAPRD_POWER_AT_AM2AM_CAL_1_SET(x) (((x) << 3) & 0x000001f8) -#define BB_PAPRD_CTRL1_B1_PA_GAIN_SCALE_FACTOR_1_MSB 16 -#define BB_PAPRD_CTRL1_B1_PA_GAIN_SCALE_FACTOR_1_LSB 9 -#define BB_PAPRD_CTRL1_B1_PA_GAIN_SCALE_FACTOR_1_MASK 0x0001fe00 -#define BB_PAPRD_CTRL1_B1_PA_GAIN_SCALE_FACTOR_1_GET(x) (((x) & 0x0001fe00) >> 9) -#define BB_PAPRD_CTRL1_B1_PA_GAIN_SCALE_FACTOR_1_SET(x) (((x) << 9) & 0x0001fe00) -#define BB_PAPRD_CTRL1_B1_PAPRD_MAG_SCALE_FACTOR_1_MSB 26 -#define BB_PAPRD_CTRL1_B1_PAPRD_MAG_SCALE_FACTOR_1_LSB 17 -#define BB_PAPRD_CTRL1_B1_PAPRD_MAG_SCALE_FACTOR_1_MASK 0x07fe0000 -#define BB_PAPRD_CTRL1_B1_PAPRD_MAG_SCALE_FACTOR_1_GET(x) (((x) & 0x07fe0000) >> 17) -#define BB_PAPRD_CTRL1_B1_PAPRD_MAG_SCALE_FACTOR_1_SET(x) (((x) << 17) & 0x07fe0000) -#define BB_PAPRD_CTRL1_B1_PAPRD_TRAINER_IANDQ_SEL_1_MSB 27 -#define BB_PAPRD_CTRL1_B1_PAPRD_TRAINER_IANDQ_SEL_1_LSB 27 -#define BB_PAPRD_CTRL1_B1_PAPRD_TRAINER_IANDQ_SEL_1_MASK 0x08000000 -#define BB_PAPRD_CTRL1_B1_PAPRD_TRAINER_IANDQ_SEL_1_GET(x) (((x) & 0x08000000) >> 27) -#define BB_PAPRD_CTRL1_B1_PAPRD_TRAINER_IANDQ_SEL_1_SET(x) (((x) << 27) & 0x08000000) - -/* macros for bb_chn1_reg_map.BB_pa_gain123_b1 */ -#define BB_PA_GAIN123_B1_ADDRESS 0x000000f8 -#define BB_PA_GAIN123_B1_OFFSET 0x000000f8 -#define BB_PA_GAIN123_B1_PA_GAIN1_1_MSB 9 -#define BB_PA_GAIN123_B1_PA_GAIN1_1_LSB 0 -#define BB_PA_GAIN123_B1_PA_GAIN1_1_MASK 0x000003ff -#define BB_PA_GAIN123_B1_PA_GAIN1_1_GET(x) (((x) & 0x000003ff) >> 0) -#define BB_PA_GAIN123_B1_PA_GAIN1_1_SET(x) (((x) << 0) & 0x000003ff) -#define BB_PA_GAIN123_B1_PA_GAIN2_1_MSB 19 -#define BB_PA_GAIN123_B1_PA_GAIN2_1_LSB 10 -#define BB_PA_GAIN123_B1_PA_GAIN2_1_MASK 0x000ffc00 -#define BB_PA_GAIN123_B1_PA_GAIN2_1_GET(x) (((x) & 0x000ffc00) >> 10) -#define BB_PA_GAIN123_B1_PA_GAIN2_1_SET(x) (((x) << 10) & 0x000ffc00) -#define BB_PA_GAIN123_B1_PA_GAIN3_1_MSB 29 -#define BB_PA_GAIN123_B1_PA_GAIN3_1_LSB 20 -#define BB_PA_GAIN123_B1_PA_GAIN3_1_MASK 0x3ff00000 -#define BB_PA_GAIN123_B1_PA_GAIN3_1_GET(x) (((x) & 0x3ff00000) >> 20) -#define BB_PA_GAIN123_B1_PA_GAIN3_1_SET(x) (((x) << 20) & 0x3ff00000) - -/* macros for bb_chn1_reg_map.BB_pa_gain45_b1 */ -#define BB_PA_GAIN45_B1_ADDRESS 0x000000fc -#define BB_PA_GAIN45_B1_OFFSET 0x000000fc -#define BB_PA_GAIN45_B1_PA_GAIN4_1_MSB 9 -#define BB_PA_GAIN45_B1_PA_GAIN4_1_LSB 0 -#define BB_PA_GAIN45_B1_PA_GAIN4_1_MASK 0x000003ff -#define BB_PA_GAIN45_B1_PA_GAIN4_1_GET(x) (((x) & 0x000003ff) >> 0) -#define BB_PA_GAIN45_B1_PA_GAIN4_1_SET(x) (((x) << 0) & 0x000003ff) -#define BB_PA_GAIN45_B1_PA_GAIN5_1_MSB 19 -#define BB_PA_GAIN45_B1_PA_GAIN5_1_LSB 10 -#define BB_PA_GAIN45_B1_PA_GAIN5_1_MASK 0x000ffc00 -#define BB_PA_GAIN45_B1_PA_GAIN5_1_GET(x) (((x) & 0x000ffc00) >> 10) -#define BB_PA_GAIN45_B1_PA_GAIN5_1_SET(x) (((x) << 10) & 0x000ffc00) -#define BB_PA_GAIN45_B1_PAPRD_ADAPTIVE_TABLE_VALID_1_MSB 24 -#define BB_PA_GAIN45_B1_PAPRD_ADAPTIVE_TABLE_VALID_1_LSB 20 -#define BB_PA_GAIN45_B1_PAPRD_ADAPTIVE_TABLE_VALID_1_MASK 0x01f00000 -#define BB_PA_GAIN45_B1_PAPRD_ADAPTIVE_TABLE_VALID_1_GET(x) (((x) & 0x01f00000) >> 20) -#define BB_PA_GAIN45_B1_PAPRD_ADAPTIVE_TABLE_VALID_1_SET(x) (((x) << 20) & 0x01f00000) - -/* macros for bb_chn1_reg_map.BB_paprd_pre_post_scale_0_b1 */ -#define BB_PAPRD_PRE_POST_SCALE_0_B1_ADDRESS 0x00000100 -#define BB_PAPRD_PRE_POST_SCALE_0_B1_OFFSET 0x00000100 -#define BB_PAPRD_PRE_POST_SCALE_0_B1_PAPRD_PRE_POST_SCALING_0_1_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_0_B1_PAPRD_PRE_POST_SCALING_0_1_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_0_B1_PAPRD_PRE_POST_SCALING_0_1_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_0_B1_PAPRD_PRE_POST_SCALING_0_1_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_0_B1_PAPRD_PRE_POST_SCALING_0_1_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn1_reg_map.BB_paprd_pre_post_scale_1_b1 */ -#define BB_PAPRD_PRE_POST_SCALE_1_B1_ADDRESS 0x00000104 -#define BB_PAPRD_PRE_POST_SCALE_1_B1_OFFSET 0x00000104 -#define BB_PAPRD_PRE_POST_SCALE_1_B1_PAPRD_PRE_POST_SCALING_1_1_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_1_B1_PAPRD_PRE_POST_SCALING_1_1_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_1_B1_PAPRD_PRE_POST_SCALING_1_1_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_1_B1_PAPRD_PRE_POST_SCALING_1_1_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_1_B1_PAPRD_PRE_POST_SCALING_1_1_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn1_reg_map.BB_paprd_pre_post_scale_2_b1 */ -#define BB_PAPRD_PRE_POST_SCALE_2_B1_ADDRESS 0x00000108 -#define BB_PAPRD_PRE_POST_SCALE_2_B1_OFFSET 0x00000108 -#define BB_PAPRD_PRE_POST_SCALE_2_B1_PAPRD_PRE_POST_SCALING_2_1_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_2_B1_PAPRD_PRE_POST_SCALING_2_1_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_2_B1_PAPRD_PRE_POST_SCALING_2_1_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_2_B1_PAPRD_PRE_POST_SCALING_2_1_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_2_B1_PAPRD_PRE_POST_SCALING_2_1_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn1_reg_map.BB_paprd_pre_post_scale_3_b1 */ -#define BB_PAPRD_PRE_POST_SCALE_3_B1_ADDRESS 0x0000010c -#define BB_PAPRD_PRE_POST_SCALE_3_B1_OFFSET 0x0000010c -#define BB_PAPRD_PRE_POST_SCALE_3_B1_PAPRD_PRE_POST_SCALING_3_1_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_3_B1_PAPRD_PRE_POST_SCALING_3_1_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_3_B1_PAPRD_PRE_POST_SCALING_3_1_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_3_B1_PAPRD_PRE_POST_SCALING_3_1_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_3_B1_PAPRD_PRE_POST_SCALING_3_1_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn1_reg_map.BB_paprd_pre_post_scale_4_b1 */ -#define BB_PAPRD_PRE_POST_SCALE_4_B1_ADDRESS 0x00000110 -#define BB_PAPRD_PRE_POST_SCALE_4_B1_OFFSET 0x00000110 -#define BB_PAPRD_PRE_POST_SCALE_4_B1_PAPRD_PRE_POST_SCALING_4_1_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_4_B1_PAPRD_PRE_POST_SCALING_4_1_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_4_B1_PAPRD_PRE_POST_SCALING_4_1_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_4_B1_PAPRD_PRE_POST_SCALING_4_1_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_4_B1_PAPRD_PRE_POST_SCALING_4_1_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn1_reg_map.BB_paprd_pre_post_scale_5_b1 */ -#define BB_PAPRD_PRE_POST_SCALE_5_B1_ADDRESS 0x00000114 -#define BB_PAPRD_PRE_POST_SCALE_5_B1_OFFSET 0x00000114 -#define BB_PAPRD_PRE_POST_SCALE_5_B1_PAPRD_PRE_POST_SCALING_5_1_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_5_B1_PAPRD_PRE_POST_SCALING_5_1_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_5_B1_PAPRD_PRE_POST_SCALING_5_1_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_5_B1_PAPRD_PRE_POST_SCALING_5_1_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_5_B1_PAPRD_PRE_POST_SCALING_5_1_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn1_reg_map.BB_paprd_pre_post_scale_6_b1 */ -#define BB_PAPRD_PRE_POST_SCALE_6_B1_ADDRESS 0x00000118 -#define BB_PAPRD_PRE_POST_SCALE_6_B1_OFFSET 0x00000118 -#define BB_PAPRD_PRE_POST_SCALE_6_B1_PAPRD_PRE_POST_SCALING_6_1_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_6_B1_PAPRD_PRE_POST_SCALING_6_1_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_6_B1_PAPRD_PRE_POST_SCALING_6_1_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_6_B1_PAPRD_PRE_POST_SCALING_6_1_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_6_B1_PAPRD_PRE_POST_SCALING_6_1_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn1_reg_map.BB_paprd_pre_post_scale_7_b1 */ -#define BB_PAPRD_PRE_POST_SCALE_7_B1_ADDRESS 0x0000011c -#define BB_PAPRD_PRE_POST_SCALE_7_B1_OFFSET 0x0000011c -#define BB_PAPRD_PRE_POST_SCALE_7_B1_PAPRD_PRE_POST_SCALING_7_1_MSB 17 -#define BB_PAPRD_PRE_POST_SCALE_7_B1_PAPRD_PRE_POST_SCALING_7_1_LSB 0 -#define BB_PAPRD_PRE_POST_SCALE_7_B1_PAPRD_PRE_POST_SCALING_7_1_MASK 0x0003ffff -#define BB_PAPRD_PRE_POST_SCALE_7_B1_PAPRD_PRE_POST_SCALING_7_1_GET(x) (((x) & 0x0003ffff) >> 0) -#define BB_PAPRD_PRE_POST_SCALE_7_B1_PAPRD_PRE_POST_SCALING_7_1_SET(x) (((x) << 0) & 0x0003ffff) - -/* macros for bb_chn1_reg_map.BB_paprd_mem_tab_b1 */ -#define BB_PAPRD_MEM_TAB_B1_ADDRESS 0x00000120 -#define BB_PAPRD_MEM_TAB_B1_OFFSET 0x00000120 -#define BB_PAPRD_MEM_TAB_B1_PAPRD_MEM_MSB 21 -#define BB_PAPRD_MEM_TAB_B1_PAPRD_MEM_LSB 0 -#define BB_PAPRD_MEM_TAB_B1_PAPRD_MEM_MASK 0x003fffff -#define BB_PAPRD_MEM_TAB_B1_PAPRD_MEM_GET(x) (((x) & 0x003fffff) >> 0) -#define BB_PAPRD_MEM_TAB_B1_PAPRD_MEM_SET(x) (((x) << 0) & 0x003fffff) - -/* macros for bb_chn1_reg_map.BB_chan_info_chan_tab_b1 */ -#define BB_CHAN_INFO_CHAN_TAB_B1_ADDRESS 0x00000300 -#define BB_CHAN_INFO_CHAN_TAB_B1_OFFSET 0x00000300 -#define BB_CHAN_INFO_CHAN_TAB_B1_CHANINFO_WORD_MSB 31 -#define BB_CHAN_INFO_CHAN_TAB_B1_CHANINFO_WORD_LSB 0 -#define BB_CHAN_INFO_CHAN_TAB_B1_CHANINFO_WORD_MASK 0xffffffff -#define BB_CHAN_INFO_CHAN_TAB_B1_CHANINFO_WORD_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for bb_chn1_reg_map.BB_chn1_tables_intf_addr */ -#define BB_CHN1_TABLES_INTF_ADDR_ADDRESS 0x000003f0 -#define BB_CHN1_TABLES_INTF_ADDR_OFFSET 0x000003f0 -#define BB_CHN1_TABLES_INTF_ADDR_CHN1_TABLES_ADDR_MSB 17 -#define BB_CHN1_TABLES_INTF_ADDR_CHN1_TABLES_ADDR_LSB 2 -#define BB_CHN1_TABLES_INTF_ADDR_CHN1_TABLES_ADDR_MASK 0x0003fffc -#define BB_CHN1_TABLES_INTF_ADDR_CHN1_TABLES_ADDR_GET(x) (((x) & 0x0003fffc) >> 2) -#define BB_CHN1_TABLES_INTF_ADDR_CHN1_TABLES_ADDR_SET(x) (((x) << 2) & 0x0003fffc) -#define BB_CHN1_TABLES_INTF_ADDR_CHN1_ADDR_AUTO_INCR_MSB 31 -#define BB_CHN1_TABLES_INTF_ADDR_CHN1_ADDR_AUTO_INCR_LSB 31 -#define BB_CHN1_TABLES_INTF_ADDR_CHN1_ADDR_AUTO_INCR_MASK 0x80000000 -#define BB_CHN1_TABLES_INTF_ADDR_CHN1_ADDR_AUTO_INCR_GET(x) (((x) & 0x80000000) >> 31) -#define BB_CHN1_TABLES_INTF_ADDR_CHN1_ADDR_AUTO_INCR_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_chn1_reg_map.BB_chn1_tables_intf_data */ -#define BB_CHN1_TABLES_INTF_DATA_ADDRESS 0x000003f4 -#define BB_CHN1_TABLES_INTF_DATA_OFFSET 0x000003f4 -#define BB_CHN1_TABLES_INTF_DATA_CHN1_TABLES_DATA_MSB 31 -#define BB_CHN1_TABLES_INTF_DATA_CHN1_TABLES_DATA_LSB 0 -#define BB_CHN1_TABLES_INTF_DATA_CHN1_TABLES_DATA_MASK 0xffffffff -#define BB_CHN1_TABLES_INTF_DATA_CHN1_TABLES_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CHN1_TABLES_INTF_DATA_CHN1_TABLES_DATA_SET(x) (((x) << 0) & 0xffffffff) - -#ifndef __ASSEMBLER__ - -typedef struct bb_reg_reg_s_6 { - volatile char pad__0[0x30]; /* 0x0 - 0x30 */ - volatile unsigned int BB_ext_chan_pwr_thr_2_b1; /* 0x30 - 0x34 */ - volatile char pad__1[0x74]; /* 0x34 - 0xa8 */ - volatile unsigned int BB_spur_report_b1; /* 0xa8 - 0xac */ - volatile char pad__2[0x14]; /* 0xac - 0xc0 */ - volatile unsigned int BB_iq_adc_meas_0_b1; /* 0xc0 - 0xc4 */ - volatile unsigned int BB_iq_adc_meas_1_b1; /* 0xc4 - 0xc8 */ - volatile unsigned int BB_iq_adc_meas_2_b1; /* 0xc8 - 0xcc */ - volatile unsigned int BB_iq_adc_meas_3_b1; /* 0xcc - 0xd0 */ - volatile unsigned int BB_tx_phase_ramp_b1; /* 0xd0 - 0xd4 */ - volatile unsigned int BB_adc_gain_dc_corr_b1; /* 0xd4 - 0xd8 */ - volatile char pad__3[0x4]; /* 0xd8 - 0xdc */ - volatile unsigned int BB_rx_iq_corr_b1; /* 0xdc - 0xe0 */ - volatile char pad__4[0x10]; /* 0xe0 - 0xf0 */ - volatile unsigned int BB_paprd_ctrl0_b1; /* 0xf0 - 0xf4 */ - volatile unsigned int BB_paprd_ctrl1_b1; /* 0xf4 - 0xf8 */ - volatile unsigned int BB_pa_gain123_b1; /* 0xf8 - 0xfc */ - volatile unsigned int BB_pa_gain45_b1; /* 0xfc - 0x100 */ - volatile unsigned int BB_paprd_pre_post_scale_0_b1; /* 0x100 - 0x104 */ - volatile unsigned int BB_paprd_pre_post_scale_1_b1; /* 0x104 - 0x108 */ - volatile unsigned int BB_paprd_pre_post_scale_2_b1; /* 0x108 - 0x10c */ - volatile unsigned int BB_paprd_pre_post_scale_3_b1; /* 0x10c - 0x110 */ - volatile unsigned int BB_paprd_pre_post_scale_4_b1; /* 0x110 - 0x114 */ - volatile unsigned int BB_paprd_pre_post_scale_5_b1; /* 0x114 - 0x118 */ - volatile unsigned int BB_paprd_pre_post_scale_6_b1; /* 0x118 - 0x11c */ - volatile unsigned int BB_paprd_pre_post_scale_7_b1; /* 0x11c - 0x120 */ - volatile unsigned int BB_paprd_mem_tab_b1[120]; /* 0x120 - 0x300 */ - volatile unsigned int BB_chan_info_chan_tab_b1[60]; /* 0x300 - 0x3f0 */ - volatile unsigned int BB_chn1_tables_intf_addr; /* 0x3f0 - 0x3f4 */ - volatile unsigned int BB_chn1_tables_intf_data; /* 0x3f4 - 0x3f8 */ -} bb_reg_reg_t_6; - -#endif /* __ASSEMBLER__ */ - - -/* macros for bb_agc1_reg_map.BB_gain_force_max_gains_b1 */ -#define BB_GAIN_FORCE_MAX_GAINS_B1_ADDRESS 0x00000004 -#define BB_GAIN_FORCE_MAX_GAINS_B1_OFFSET 0x00000004 -#define BB_GAIN_FORCE_MAX_GAINS_B1_RF_GAIN_F_1_MSB 7 -#define BB_GAIN_FORCE_MAX_GAINS_B1_RF_GAIN_F_1_LSB 0 -#define BB_GAIN_FORCE_MAX_GAINS_B1_RF_GAIN_F_1_MASK 0x000000ff -#define BB_GAIN_FORCE_MAX_GAINS_B1_RF_GAIN_F_1_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_GAIN_FORCE_MAX_GAINS_B1_RF_GAIN_F_1_SET(x) (((x) << 0) & 0x000000ff) -#define BB_GAIN_FORCE_MAX_GAINS_B1_MB_GAIN_F_1_MSB 15 -#define BB_GAIN_FORCE_MAX_GAINS_B1_MB_GAIN_F_1_LSB 8 -#define BB_GAIN_FORCE_MAX_GAINS_B1_MB_GAIN_F_1_MASK 0x0000ff00 -#define BB_GAIN_FORCE_MAX_GAINS_B1_MB_GAIN_F_1_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_GAIN_FORCE_MAX_GAINS_B1_MB_GAIN_F_1_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN1_SW_F_1_MSB 16 -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN1_SW_F_1_LSB 16 -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN1_SW_F_1_MASK 0x00010000 -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN1_SW_F_1_GET(x) (((x) & 0x00010000) >> 16) -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN1_SW_F_1_SET(x) (((x) << 16) & 0x00010000) -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN2_SW_F_1_MSB 17 -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN2_SW_F_1_LSB 17 -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN2_SW_F_1_MASK 0x00020000 -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN2_SW_F_1_GET(x) (((x) & 0x00020000) >> 17) -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN2_SW_F_1_SET(x) (((x) << 17) & 0x00020000) -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN1_HYST_MARGIN_1_MSB 24 -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN1_HYST_MARGIN_1_LSB 18 -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN1_HYST_MARGIN_1_MASK 0x01fc0000 -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN1_HYST_MARGIN_1_GET(x) (((x) & 0x01fc0000) >> 18) -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN1_HYST_MARGIN_1_SET(x) (((x) << 18) & 0x01fc0000) -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN2_HYST_MARGIN_1_MSB 31 -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN2_HYST_MARGIN_1_LSB 25 -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN2_HYST_MARGIN_1_MASK 0xfe000000 -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN2_HYST_MARGIN_1_GET(x) (((x) & 0xfe000000) >> 25) -#define BB_GAIN_FORCE_MAX_GAINS_B1_XATTEN2_HYST_MARGIN_1_SET(x) (((x) << 25) & 0xfe000000) - -/* macros for bb_agc1_reg_map.BB_ext_atten_switch_ctl_b1 */ -#define BB_EXT_ATTEN_SWITCH_CTL_B1_ADDRESS 0x00000018 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_OFFSET 0x00000018 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_DB_1_MSB 5 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_DB_1_LSB 0 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_DB_1_MASK 0x0000003f -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_DB_1_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_DB_1_SET(x) (((x) << 0) & 0x0000003f) -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_DB_1_MSB 11 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_DB_1_LSB 6 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_DB_1_MASK 0x00000fc0 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_DB_1_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_DB_1_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_MARGIN_1_MSB 16 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_MARGIN_1_LSB 12 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_MARGIN_1_MASK 0x0001f000 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_MARGIN_1_GET(x) (((x) & 0x0001f000) >> 12) -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN1_MARGIN_1_SET(x) (((x) << 12) & 0x0001f000) -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_MARGIN_1_MSB 21 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_MARGIN_1_LSB 17 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_MARGIN_1_MASK 0x003e0000 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_MARGIN_1_GET(x) (((x) & 0x003e0000) >> 17) -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XATTEN2_MARGIN_1_SET(x) (((x) << 17) & 0x003e0000) -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XLNA_GAIN_DB_1_MSB 26 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XLNA_GAIN_DB_1_LSB 22 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XLNA_GAIN_DB_1_MASK 0x07c00000 -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XLNA_GAIN_DB_1_GET(x) (((x) & 0x07c00000) >> 22) -#define BB_EXT_ATTEN_SWITCH_CTL_B1_XLNA_GAIN_DB_1_SET(x) (((x) << 22) & 0x07c00000) - -/* macros for bb_agc1_reg_map.BB_cca_b1 */ -#define BB_CCA_B1_ADDRESS 0x0000001c -#define BB_CCA_B1_OFFSET 0x0000001c -#define BB_CCA_B1_CF_MAXCCAPWR_1_MSB 8 -#define BB_CCA_B1_CF_MAXCCAPWR_1_LSB 0 -#define BB_CCA_B1_CF_MAXCCAPWR_1_MASK 0x000001ff -#define BB_CCA_B1_CF_MAXCCAPWR_1_GET(x) (((x) & 0x000001ff) >> 0) -#define BB_CCA_B1_CF_MAXCCAPWR_1_SET(x) (((x) << 0) & 0x000001ff) -#define BB_CCA_B1_MINCCAPWR_1_MSB 28 -#define BB_CCA_B1_MINCCAPWR_1_LSB 20 -#define BB_CCA_B1_MINCCAPWR_1_MASK 0x1ff00000 -#define BB_CCA_B1_MINCCAPWR_1_GET(x) (((x) & 0x1ff00000) >> 20) - -/* macros for bb_agc1_reg_map.BB_cca_ctrl_2_b1 */ -#define BB_CCA_CTRL_2_B1_ADDRESS 0x00000020 -#define BB_CCA_CTRL_2_B1_OFFSET 0x00000020 -#define BB_CCA_CTRL_2_B1_MINCCAPWR_THR_1_MSB 8 -#define BB_CCA_CTRL_2_B1_MINCCAPWR_THR_1_LSB 0 -#define BB_CCA_CTRL_2_B1_MINCCAPWR_THR_1_MASK 0x000001ff -#define BB_CCA_CTRL_2_B1_MINCCAPWR_THR_1_GET(x) (((x) & 0x000001ff) >> 0) -#define BB_CCA_CTRL_2_B1_MINCCAPWR_THR_1_SET(x) (((x) << 0) & 0x000001ff) -#define BB_CCA_CTRL_2_B1_NF_GAIN_COMP_1_MSB 17 -#define BB_CCA_CTRL_2_B1_NF_GAIN_COMP_1_LSB 10 -#define BB_CCA_CTRL_2_B1_NF_GAIN_COMP_1_MASK 0x0003fc00 -#define BB_CCA_CTRL_2_B1_NF_GAIN_COMP_1_GET(x) (((x) & 0x0003fc00) >> 10) -#define BB_CCA_CTRL_2_B1_NF_GAIN_COMP_1_SET(x) (((x) << 10) & 0x0003fc00) - -/* macros for bb_agc1_reg_map.BB_rssi_b1 */ -#define BB_RSSI_B1_ADDRESS 0x00000180 -#define BB_RSSI_B1_OFFSET 0x00000180 -#define BB_RSSI_B1_RSSI_1_MSB 7 -#define BB_RSSI_B1_RSSI_1_LSB 0 -#define BB_RSSI_B1_RSSI_1_MASK 0x000000ff -#define BB_RSSI_B1_RSSI_1_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_RSSI_B1_RSSI_EXT_1_MSB 15 -#define BB_RSSI_B1_RSSI_EXT_1_LSB 8 -#define BB_RSSI_B1_RSSI_EXT_1_MASK 0x0000ff00 -#define BB_RSSI_B1_RSSI_EXT_1_GET(x) (((x) & 0x0000ff00) >> 8) - -/* macros for bb_agc1_reg_map.BB_spur_est_cck_report_b1 */ -#define BB_SPUR_EST_CCK_REPORT_B1_ADDRESS 0x00000184 -#define BB_SPUR_EST_CCK_REPORT_B1_OFFSET 0x00000184 -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_SD_I_1_CCK_MSB 7 -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_SD_I_1_CCK_LSB 0 -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_SD_I_1_CCK_MASK 0x000000ff -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_SD_I_1_CCK_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_SD_Q_1_CCK_MSB 15 -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_SD_Q_1_CCK_LSB 8 -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_SD_Q_1_CCK_MASK 0x0000ff00 -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_SD_Q_1_CCK_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_I_1_CCK_MSB 23 -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_I_1_CCK_LSB 16 -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_I_1_CCK_MASK 0x00ff0000 -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_I_1_CCK_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_Q_1_CCK_MSB 31 -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_Q_1_CCK_LSB 24 -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_Q_1_CCK_MASK 0xff000000 -#define BB_SPUR_EST_CCK_REPORT_B1_SPUR_EST_Q_1_CCK_GET(x) (((x) & 0xff000000) >> 24) - -/* macros for bb_agc1_reg_map.BB_agc_dig_dc_status_i_b1 */ -#define BB_AGC_DIG_DC_STATUS_I_B1_ADDRESS 0x00000188 -#define BB_AGC_DIG_DC_STATUS_I_B1_OFFSET 0x00000188 -#define BB_AGC_DIG_DC_STATUS_I_B1_DIG_DC_C1_RES_I_1_MSB 8 -#define BB_AGC_DIG_DC_STATUS_I_B1_DIG_DC_C1_RES_I_1_LSB 0 -#define BB_AGC_DIG_DC_STATUS_I_B1_DIG_DC_C1_RES_I_1_MASK 0x000001ff -#define BB_AGC_DIG_DC_STATUS_I_B1_DIG_DC_C1_RES_I_1_GET(x) (((x) & 0x000001ff) >> 0) -#define BB_AGC_DIG_DC_STATUS_I_B1_DIG_DC_C2_RES_I_1_MSB 17 -#define BB_AGC_DIG_DC_STATUS_I_B1_DIG_DC_C2_RES_I_1_LSB 9 -#define BB_AGC_DIG_DC_STATUS_I_B1_DIG_DC_C2_RES_I_1_MASK 0x0003fe00 -#define BB_AGC_DIG_DC_STATUS_I_B1_DIG_DC_C2_RES_I_1_GET(x) (((x) & 0x0003fe00) >> 9) -#define BB_AGC_DIG_DC_STATUS_I_B1_DIG_DC_C3_RES_I_1_MSB 26 -#define BB_AGC_DIG_DC_STATUS_I_B1_DIG_DC_C3_RES_I_1_LSB 18 -#define BB_AGC_DIG_DC_STATUS_I_B1_DIG_DC_C3_RES_I_1_MASK 0x07fc0000 -#define BB_AGC_DIG_DC_STATUS_I_B1_DIG_DC_C3_RES_I_1_GET(x) (((x) & 0x07fc0000) >> 18) - -/* macros for bb_agc1_reg_map.BB_agc_dig_dc_status_q_b1 */ -#define BB_AGC_DIG_DC_STATUS_Q_B1_ADDRESS 0x0000018c -#define BB_AGC_DIG_DC_STATUS_Q_B1_OFFSET 0x0000018c -#define BB_AGC_DIG_DC_STATUS_Q_B1_DIG_DC_C1_RES_Q_1_MSB 8 -#define BB_AGC_DIG_DC_STATUS_Q_B1_DIG_DC_C1_RES_Q_1_LSB 0 -#define BB_AGC_DIG_DC_STATUS_Q_B1_DIG_DC_C1_RES_Q_1_MASK 0x000001ff -#define BB_AGC_DIG_DC_STATUS_Q_B1_DIG_DC_C1_RES_Q_1_GET(x) (((x) & 0x000001ff) >> 0) -#define BB_AGC_DIG_DC_STATUS_Q_B1_DIG_DC_C2_RES_Q_1_MSB 17 -#define BB_AGC_DIG_DC_STATUS_Q_B1_DIG_DC_C2_RES_Q_1_LSB 9 -#define BB_AGC_DIG_DC_STATUS_Q_B1_DIG_DC_C2_RES_Q_1_MASK 0x0003fe00 -#define BB_AGC_DIG_DC_STATUS_Q_B1_DIG_DC_C2_RES_Q_1_GET(x) (((x) & 0x0003fe00) >> 9) -#define BB_AGC_DIG_DC_STATUS_Q_B1_DIG_DC_C3_RES_Q_1_MSB 26 -#define BB_AGC_DIG_DC_STATUS_Q_B1_DIG_DC_C3_RES_Q_1_LSB 18 -#define BB_AGC_DIG_DC_STATUS_Q_B1_DIG_DC_C3_RES_Q_1_MASK 0x07fc0000 -#define BB_AGC_DIG_DC_STATUS_Q_B1_DIG_DC_C3_RES_Q_1_GET(x) (((x) & 0x07fc0000) >> 18) - -/* macros for bb_agc1_reg_map.BB_dc_cal_status_b1 */ -#define BB_DC_CAL_STATUS_B1_ADDRESS 0x00000190 -#define BB_DC_CAL_STATUS_B1_OFFSET 0x00000190 -#define BB_DC_CAL_STATUS_B1_OFFSETC1I_1_MSB 4 -#define BB_DC_CAL_STATUS_B1_OFFSETC1I_1_LSB 0 -#define BB_DC_CAL_STATUS_B1_OFFSETC1I_1_MASK 0x0000001f -#define BB_DC_CAL_STATUS_B1_OFFSETC1I_1_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_DC_CAL_STATUS_B1_OFFSETC1Q_1_MSB 9 -#define BB_DC_CAL_STATUS_B1_OFFSETC1Q_1_LSB 5 -#define BB_DC_CAL_STATUS_B1_OFFSETC1Q_1_MASK 0x000003e0 -#define BB_DC_CAL_STATUS_B1_OFFSETC1Q_1_GET(x) (((x) & 0x000003e0) >> 5) -#define BB_DC_CAL_STATUS_B1_OFFSETC2I_1_MSB 14 -#define BB_DC_CAL_STATUS_B1_OFFSETC2I_1_LSB 10 -#define BB_DC_CAL_STATUS_B1_OFFSETC2I_1_MASK 0x00007c00 -#define BB_DC_CAL_STATUS_B1_OFFSETC2I_1_GET(x) (((x) & 0x00007c00) >> 10) -#define BB_DC_CAL_STATUS_B1_OFFSETC2Q_1_MSB 19 -#define BB_DC_CAL_STATUS_B1_OFFSETC2Q_1_LSB 15 -#define BB_DC_CAL_STATUS_B1_OFFSETC2Q_1_MASK 0x000f8000 -#define BB_DC_CAL_STATUS_B1_OFFSETC2Q_1_GET(x) (((x) & 0x000f8000) >> 15) -#define BB_DC_CAL_STATUS_B1_OFFSETC3I_1_MSB 24 -#define BB_DC_CAL_STATUS_B1_OFFSETC3I_1_LSB 20 -#define BB_DC_CAL_STATUS_B1_OFFSETC3I_1_MASK 0x01f00000 -#define BB_DC_CAL_STATUS_B1_OFFSETC3I_1_GET(x) (((x) & 0x01f00000) >> 20) -#define BB_DC_CAL_STATUS_B1_OFFSETC3Q_1_MSB 29 -#define BB_DC_CAL_STATUS_B1_OFFSETC3Q_1_LSB 25 -#define BB_DC_CAL_STATUS_B1_OFFSETC3Q_1_MASK 0x3e000000 -#define BB_DC_CAL_STATUS_B1_OFFSETC3Q_1_GET(x) (((x) & 0x3e000000) >> 25) - -/* macros for bb_agc1_reg_map.BB_rx_ocgain2 */ -#define BB_RX_OCGAIN2_ADDRESS 0x00000200 -#define BB_RX_OCGAIN2_OFFSET 0x00000200 -#define BB_RX_OCGAIN2_GAIN_ENTRY2_MSB 31 -#define BB_RX_OCGAIN2_GAIN_ENTRY2_LSB 0 -#define BB_RX_OCGAIN2_GAIN_ENTRY2_MASK 0xffffffff -#define BB_RX_OCGAIN2_GAIN_ENTRY2_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_RX_OCGAIN2_GAIN_ENTRY2_SET(x) (((x) << 0) & 0xffffffff) - -#ifndef __ASSEMBLER__ - -typedef struct bb_reg_reg_s_7 { - volatile char pad__0[0x4]; /* 0x0 - 0x4 */ - volatile unsigned int BB_gain_force_max_gains_b1; /* 0x4 - 0x8 */ - volatile char pad__1[0x10]; /* 0x8 - 0x18 */ - volatile unsigned int BB_ext_atten_switch_ctl_b1; /* 0x18 - 0x1c */ - volatile unsigned int BB_cca_b1; /* 0x1c - 0x20 */ - volatile unsigned int BB_cca_ctrl_2_b1; /* 0x20 - 0x24 */ - volatile char pad__2[0x15c]; /* 0x24 - 0x180 */ - volatile unsigned int BB_rssi_b1; /* 0x180 - 0x184 */ - volatile unsigned int BB_spur_est_cck_report_b1; /* 0x184 - 0x188 */ - volatile unsigned int BB_agc_dig_dc_status_i_b1; /* 0x188 - 0x18c */ - volatile unsigned int BB_agc_dig_dc_status_q_b1; /* 0x18c - 0x190 */ - volatile unsigned int BB_dc_cal_status_b1; /* 0x190 - 0x194 */ - volatile char pad__3[0x6c]; /* 0x194 - 0x200 */ - volatile unsigned int BB_rx_ocgain2[128]; /* 0x200 - 0x400 */ -} bb_reg_reg_t_7; - -#endif /* __ASSEMBLER__ */ - - -/* macros for bb_sm1_reg_map.BB_switch_table_chn_b1 */ -#define BB_SWITCH_TABLE_CHN_B1_ADDRESS 0x00000084 -#define BB_SWITCH_TABLE_CHN_B1_OFFSET 0x00000084 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_IDLE_1_MSB 1 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_IDLE_1_LSB 0 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_IDLE_1_MASK 0x00000003 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_IDLE_1_GET(x) (((x) & 0x00000003) >> 0) -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_IDLE_1_SET(x) (((x) << 0) & 0x00000003) -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_T_1_MSB 3 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_T_1_LSB 2 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_T_1_MASK 0x0000000c -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_T_1_GET(x) (((x) & 0x0000000c) >> 2) -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_T_1_SET(x) (((x) << 2) & 0x0000000c) -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_R_1_MSB 5 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_R_1_LSB 4 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_R_1_MASK 0x00000030 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_R_1_GET(x) (((x) & 0x00000030) >> 4) -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_R_1_SET(x) (((x) << 4) & 0x00000030) -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_RX1_1_MSB 7 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_RX1_1_LSB 6 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_RX1_1_MASK 0x000000c0 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_RX1_1_GET(x) (((x) & 0x000000c0) >> 6) -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_RX1_1_SET(x) (((x) << 6) & 0x000000c0) -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_RX12_1_MSB 9 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_RX12_1_LSB 8 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_RX12_1_MASK 0x00000300 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_RX12_1_GET(x) (((x) & 0x00000300) >> 8) -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_RX12_1_SET(x) (((x) << 8) & 0x00000300) -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_B_1_MSB 11 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_B_1_LSB 10 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_B_1_MASK 0x00000c00 -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_B_1_GET(x) (((x) & 0x00000c00) >> 10) -#define BB_SWITCH_TABLE_CHN_B1_SWITCH_TABLE_B_1_SET(x) (((x) << 10) & 0x00000c00) - -/* macros for bb_sm1_reg_map.BB_fcal_2_b1 */ -#define BB_FCAL_2_B1_ADDRESS 0x000000d0 -#define BB_FCAL_2_B1_OFFSET 0x000000d0 -#define BB_FCAL_2_B1_FLC_SW_CAP_VAL_1_MSB 7 -#define BB_FCAL_2_B1_FLC_SW_CAP_VAL_1_LSB 3 -#define BB_FCAL_2_B1_FLC_SW_CAP_VAL_1_MASK 0x000000f8 -#define BB_FCAL_2_B1_FLC_SW_CAP_VAL_1_GET(x) (((x) & 0x000000f8) >> 3) -#define BB_FCAL_2_B1_FLC_SW_CAP_VAL_1_SET(x) (((x) << 3) & 0x000000f8) -#define BB_FCAL_2_B1_FLC_CAP_VAL_STATUS_1_MSB 24 -#define BB_FCAL_2_B1_FLC_CAP_VAL_STATUS_1_LSB 20 -#define BB_FCAL_2_B1_FLC_CAP_VAL_STATUS_1_MASK 0x01f00000 -#define BB_FCAL_2_B1_FLC_CAP_VAL_STATUS_1_GET(x) (((x) & 0x01f00000) >> 20) - -/* macros for bb_sm1_reg_map.BB_dft_tone_ctrl_b1 */ -#define BB_DFT_TONE_CTRL_B1_ADDRESS 0x000000d4 -#define BB_DFT_TONE_CTRL_B1_OFFSET 0x000000d4 -#define BB_DFT_TONE_CTRL_B1_DFT_TONE_EN_1_MSB 0 -#define BB_DFT_TONE_CTRL_B1_DFT_TONE_EN_1_LSB 0 -#define BB_DFT_TONE_CTRL_B1_DFT_TONE_EN_1_MASK 0x00000001 -#define BB_DFT_TONE_CTRL_B1_DFT_TONE_EN_1_GET(x) (((x) & 0x00000001) >> 0) -#define BB_DFT_TONE_CTRL_B1_DFT_TONE_EN_1_SET(x) (((x) << 0) & 0x00000001) -#define BB_DFT_TONE_CTRL_B1_DFT_TONE_AMP_SEL_1_MSB 3 -#define BB_DFT_TONE_CTRL_B1_DFT_TONE_AMP_SEL_1_LSB 2 -#define BB_DFT_TONE_CTRL_B1_DFT_TONE_AMP_SEL_1_MASK 0x0000000c -#define BB_DFT_TONE_CTRL_B1_DFT_TONE_AMP_SEL_1_GET(x) (((x) & 0x0000000c) >> 2) -#define BB_DFT_TONE_CTRL_B1_DFT_TONE_AMP_SEL_1_SET(x) (((x) << 2) & 0x0000000c) -#define BB_DFT_TONE_CTRL_B1_DFT_TONE_FREQ_ANG_1_MSB 12 -#define BB_DFT_TONE_CTRL_B1_DFT_TONE_FREQ_ANG_1_LSB 4 -#define BB_DFT_TONE_CTRL_B1_DFT_TONE_FREQ_ANG_1_MASK 0x00001ff0 -#define BB_DFT_TONE_CTRL_B1_DFT_TONE_FREQ_ANG_1_GET(x) (((x) & 0x00001ff0) >> 4) -#define BB_DFT_TONE_CTRL_B1_DFT_TONE_FREQ_ANG_1_SET(x) (((x) << 4) & 0x00001ff0) - -/* macros for bb_sm1_reg_map.BB_cl_map_0_b1 */ -#define BB_CL_MAP_0_B1_ADDRESS 0x000000dc -#define BB_CL_MAP_0_B1_OFFSET 0x000000dc -#define BB_CL_MAP_0_B1_CL_MAP_0_MSB 31 -#define BB_CL_MAP_0_B1_CL_MAP_0_LSB 0 -#define BB_CL_MAP_0_B1_CL_MAP_0_MASK 0xffffffff -#define BB_CL_MAP_0_B1_CL_MAP_0_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_0_B1_CL_MAP_0_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm1_reg_map.BB_cl_map_1_b1 */ -#define BB_CL_MAP_1_B1_ADDRESS 0x000000e0 -#define BB_CL_MAP_1_B1_OFFSET 0x000000e0 -#define BB_CL_MAP_1_B1_CL_MAP_1_MSB 31 -#define BB_CL_MAP_1_B1_CL_MAP_1_LSB 0 -#define BB_CL_MAP_1_B1_CL_MAP_1_MASK 0xffffffff -#define BB_CL_MAP_1_B1_CL_MAP_1_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_1_B1_CL_MAP_1_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm1_reg_map.BB_cl_map_2_b1 */ -#define BB_CL_MAP_2_B1_ADDRESS 0x000000e4 -#define BB_CL_MAP_2_B1_OFFSET 0x000000e4 -#define BB_CL_MAP_2_B1_CL_MAP_2_MSB 31 -#define BB_CL_MAP_2_B1_CL_MAP_2_LSB 0 -#define BB_CL_MAP_2_B1_CL_MAP_2_MASK 0xffffffff -#define BB_CL_MAP_2_B1_CL_MAP_2_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_2_B1_CL_MAP_2_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm1_reg_map.BB_cl_map_3_b1 */ -#define BB_CL_MAP_3_B1_ADDRESS 0x000000e8 -#define BB_CL_MAP_3_B1_OFFSET 0x000000e8 -#define BB_CL_MAP_3_B1_CL_MAP_3_MSB 31 -#define BB_CL_MAP_3_B1_CL_MAP_3_LSB 0 -#define BB_CL_MAP_3_B1_CL_MAP_3_MASK 0xffffffff -#define BB_CL_MAP_3_B1_CL_MAP_3_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_3_B1_CL_MAP_3_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm1_reg_map.BB_cl_map_pal_0_b1 */ -#define BB_CL_MAP_PAL_0_B1_ADDRESS 0x000000ec -#define BB_CL_MAP_PAL_0_B1_OFFSET 0x000000ec -#define BB_CL_MAP_PAL_0_B1_CL_MAP_0_MSB 31 -#define BB_CL_MAP_PAL_0_B1_CL_MAP_0_LSB 0 -#define BB_CL_MAP_PAL_0_B1_CL_MAP_0_MASK 0xffffffff -#define BB_CL_MAP_PAL_0_B1_CL_MAP_0_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_PAL_0_B1_CL_MAP_0_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm1_reg_map.BB_cl_map_pal_1_b1 */ -#define BB_CL_MAP_PAL_1_B1_ADDRESS 0x000000f0 -#define BB_CL_MAP_PAL_1_B1_OFFSET 0x000000f0 -#define BB_CL_MAP_PAL_1_B1_CL_MAP_1_MSB 31 -#define BB_CL_MAP_PAL_1_B1_CL_MAP_1_LSB 0 -#define BB_CL_MAP_PAL_1_B1_CL_MAP_1_MASK 0xffffffff -#define BB_CL_MAP_PAL_1_B1_CL_MAP_1_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_PAL_1_B1_CL_MAP_1_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm1_reg_map.BB_cl_map_pal_2_b1 */ -#define BB_CL_MAP_PAL_2_B1_ADDRESS 0x000000f4 -#define BB_CL_MAP_PAL_2_B1_OFFSET 0x000000f4 -#define BB_CL_MAP_PAL_2_B1_CL_MAP_2_MSB 31 -#define BB_CL_MAP_PAL_2_B1_CL_MAP_2_LSB 0 -#define BB_CL_MAP_PAL_2_B1_CL_MAP_2_MASK 0xffffffff -#define BB_CL_MAP_PAL_2_B1_CL_MAP_2_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_PAL_2_B1_CL_MAP_2_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm1_reg_map.BB_cl_map_pal_3_b1 */ -#define BB_CL_MAP_PAL_3_B1_ADDRESS 0x000000f8 -#define BB_CL_MAP_PAL_3_B1_OFFSET 0x000000f8 -#define BB_CL_MAP_PAL_3_B1_CL_MAP_3_MSB 31 -#define BB_CL_MAP_PAL_3_B1_CL_MAP_3_LSB 0 -#define BB_CL_MAP_PAL_3_B1_CL_MAP_3_MASK 0xffffffff -#define BB_CL_MAP_PAL_3_B1_CL_MAP_3_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_CL_MAP_PAL_3_B1_CL_MAP_3_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm1_reg_map.BB_cl_tab_b1 */ -#define BB_CL_TAB_B1_ADDRESS 0x00000100 -#define BB_CL_TAB_B1_OFFSET 0x00000100 -#define BB_CL_TAB_B1_CL_GAIN_MOD_MSB 4 -#define BB_CL_TAB_B1_CL_GAIN_MOD_LSB 0 -#define BB_CL_TAB_B1_CL_GAIN_MOD_MASK 0x0000001f -#define BB_CL_TAB_B1_CL_GAIN_MOD_GET(x) (((x) & 0x0000001f) >> 0) -#define BB_CL_TAB_B1_CL_GAIN_MOD_SET(x) (((x) << 0) & 0x0000001f) -#define BB_CL_TAB_B1_CARR_LK_DC_ADD_Q_MSB 15 -#define BB_CL_TAB_B1_CARR_LK_DC_ADD_Q_LSB 5 -#define BB_CL_TAB_B1_CARR_LK_DC_ADD_Q_MASK 0x0000ffe0 -#define BB_CL_TAB_B1_CARR_LK_DC_ADD_Q_GET(x) (((x) & 0x0000ffe0) >> 5) -#define BB_CL_TAB_B1_CARR_LK_DC_ADD_Q_SET(x) (((x) << 5) & 0x0000ffe0) -#define BB_CL_TAB_B1_CARR_LK_DC_ADD_I_MSB 26 -#define BB_CL_TAB_B1_CARR_LK_DC_ADD_I_LSB 16 -#define BB_CL_TAB_B1_CARR_LK_DC_ADD_I_MASK 0x07ff0000 -#define BB_CL_TAB_B1_CARR_LK_DC_ADD_I_GET(x) (((x) & 0x07ff0000) >> 16) -#define BB_CL_TAB_B1_CARR_LK_DC_ADD_I_SET(x) (((x) << 16) & 0x07ff0000) -#define BB_CL_TAB_B1_BB_GAIN_MSB 30 -#define BB_CL_TAB_B1_BB_GAIN_LSB 27 -#define BB_CL_TAB_B1_BB_GAIN_MASK 0x78000000 -#define BB_CL_TAB_B1_BB_GAIN_GET(x) (((x) & 0x78000000) >> 27) -#define BB_CL_TAB_B1_BB_GAIN_SET(x) (((x) << 27) & 0x78000000) - -/* macros for bb_sm1_reg_map.BB_chan_info_gain_b1 */ -#define BB_CHAN_INFO_GAIN_B1_ADDRESS 0x00000180 -#define BB_CHAN_INFO_GAIN_B1_OFFSET 0x00000180 -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_RSSI_1_MSB 7 -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_RSSI_1_LSB 0 -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_RSSI_1_MASK 0x000000ff -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_RSSI_1_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_RF_GAIN_1_MSB 15 -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_RF_GAIN_1_LSB 8 -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_RF_GAIN_1_MASK 0x0000ff00 -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_RF_GAIN_1_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_MB_GAIN_1_MSB 22 -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_MB_GAIN_1_LSB 16 -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_MB_GAIN_1_MASK 0x007f0000 -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_MB_GAIN_1_GET(x) (((x) & 0x007f0000) >> 16) -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_XATTEN1_SW_1_MSB 23 -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_XATTEN1_SW_1_LSB 23 -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_XATTEN1_SW_1_MASK 0x00800000 -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_XATTEN1_SW_1_GET(x) (((x) & 0x00800000) >> 23) -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_XATTEN2_SW_1_MSB 24 -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_XATTEN2_SW_1_LSB 24 -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_XATTEN2_SW_1_MASK 0x01000000 -#define BB_CHAN_INFO_GAIN_B1_CHAN_INFO_XATTEN2_SW_1_GET(x) (((x) & 0x01000000) >> 24) - -/* macros for bb_sm1_reg_map.BB_tpc_4_b1 */ -#define BB_TPC_4_B1_ADDRESS 0x00000204 -#define BB_TPC_4_B1_OFFSET 0x00000204 -#define BB_TPC_4_B1_PD_AVG_VALID_1_MSB 0 -#define BB_TPC_4_B1_PD_AVG_VALID_1_LSB 0 -#define BB_TPC_4_B1_PD_AVG_VALID_1_MASK 0x00000001 -#define BB_TPC_4_B1_PD_AVG_VALID_1_GET(x) (((x) & 0x00000001) >> 0) -#define BB_TPC_4_B1_PD_AVG_OUT_1_MSB 8 -#define BB_TPC_4_B1_PD_AVG_OUT_1_LSB 1 -#define BB_TPC_4_B1_PD_AVG_OUT_1_MASK 0x000001fe -#define BB_TPC_4_B1_PD_AVG_OUT_1_GET(x) (((x) & 0x000001fe) >> 1) -#define BB_TPC_4_B1_DAC_GAIN_1_MSB 13 -#define BB_TPC_4_B1_DAC_GAIN_1_LSB 9 -#define BB_TPC_4_B1_DAC_GAIN_1_MASK 0x00003e00 -#define BB_TPC_4_B1_DAC_GAIN_1_GET(x) (((x) & 0x00003e00) >> 9) -#define BB_TPC_4_B1_TX_GAIN_SETTING_1_MSB 19 -#define BB_TPC_4_B1_TX_GAIN_SETTING_1_LSB 14 -#define BB_TPC_4_B1_TX_GAIN_SETTING_1_MASK 0x000fc000 -#define BB_TPC_4_B1_TX_GAIN_SETTING_1_GET(x) (((x) & 0x000fc000) >> 14) -#define BB_TPC_4_B1_RATE_SENT_1_MSB 24 -#define BB_TPC_4_B1_RATE_SENT_1_LSB 20 -#define BB_TPC_4_B1_RATE_SENT_1_MASK 0x01f00000 -#define BB_TPC_4_B1_RATE_SENT_1_GET(x) (((x) & 0x01f00000) >> 20) - -/* macros for bb_sm1_reg_map.BB_tpc_5_b1 */ -#define BB_TPC_5_B1_ADDRESS 0x00000208 -#define BB_TPC_5_B1_OFFSET 0x00000208 -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_1_1_MSB 9 -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_1_1_LSB 4 -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_1_1_MASK 0x000003f0 -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_1_1_GET(x) (((x) & 0x000003f0) >> 4) -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_1_1_SET(x) (((x) << 4) & 0x000003f0) -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_2_1_MSB 15 -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_2_1_LSB 10 -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_2_1_MASK 0x0000fc00 -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_2_1_GET(x) (((x) & 0x0000fc00) >> 10) -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_2_1_SET(x) (((x) << 10) & 0x0000fc00) -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_3_1_MSB 21 -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_3_1_LSB 16 -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_3_1_MASK 0x003f0000 -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_3_1_GET(x) (((x) & 0x003f0000) >> 16) -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_3_1_SET(x) (((x) << 16) & 0x003f0000) -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_4_1_MSB 27 -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_4_1_LSB 22 -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_4_1_MASK 0x0fc00000 -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_4_1_GET(x) (((x) & 0x0fc00000) >> 22) -#define BB_TPC_5_B1_PD_GAIN_BOUNDARY_4_1_SET(x) (((x) << 22) & 0x0fc00000) - -/* macros for bb_sm1_reg_map.BB_tpc_6_b1 */ -#define BB_TPC_6_B1_ADDRESS 0x0000020c -#define BB_TPC_6_B1_OFFSET 0x0000020c -#define BB_TPC_6_B1_PD_DAC_SETTING_1_1_MSB 5 -#define BB_TPC_6_B1_PD_DAC_SETTING_1_1_LSB 0 -#define BB_TPC_6_B1_PD_DAC_SETTING_1_1_MASK 0x0000003f -#define BB_TPC_6_B1_PD_DAC_SETTING_1_1_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_TPC_6_B1_PD_DAC_SETTING_1_1_SET(x) (((x) << 0) & 0x0000003f) -#define BB_TPC_6_B1_PD_DAC_SETTING_2_1_MSB 11 -#define BB_TPC_6_B1_PD_DAC_SETTING_2_1_LSB 6 -#define BB_TPC_6_B1_PD_DAC_SETTING_2_1_MASK 0x00000fc0 -#define BB_TPC_6_B1_PD_DAC_SETTING_2_1_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_TPC_6_B1_PD_DAC_SETTING_2_1_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_TPC_6_B1_PD_DAC_SETTING_3_1_MSB 17 -#define BB_TPC_6_B1_PD_DAC_SETTING_3_1_LSB 12 -#define BB_TPC_6_B1_PD_DAC_SETTING_3_1_MASK 0x0003f000 -#define BB_TPC_6_B1_PD_DAC_SETTING_3_1_GET(x) (((x) & 0x0003f000) >> 12) -#define BB_TPC_6_B1_PD_DAC_SETTING_3_1_SET(x) (((x) << 12) & 0x0003f000) -#define BB_TPC_6_B1_PD_DAC_SETTING_4_1_MSB 23 -#define BB_TPC_6_B1_PD_DAC_SETTING_4_1_LSB 18 -#define BB_TPC_6_B1_PD_DAC_SETTING_4_1_MASK 0x00fc0000 -#define BB_TPC_6_B1_PD_DAC_SETTING_4_1_GET(x) (((x) & 0x00fc0000) >> 18) -#define BB_TPC_6_B1_PD_DAC_SETTING_4_1_SET(x) (((x) << 18) & 0x00fc0000) -#define BB_TPC_6_B1_ERROR_EST_MODE_MSB 25 -#define BB_TPC_6_B1_ERROR_EST_MODE_LSB 24 -#define BB_TPC_6_B1_ERROR_EST_MODE_MASK 0x03000000 -#define BB_TPC_6_B1_ERROR_EST_MODE_GET(x) (((x) & 0x03000000) >> 24) -#define BB_TPC_6_B1_ERROR_EST_MODE_SET(x) (((x) << 24) & 0x03000000) -#define BB_TPC_6_B1_ERROR_EST_FILTER_COEFF_MSB 28 -#define BB_TPC_6_B1_ERROR_EST_FILTER_COEFF_LSB 26 -#define BB_TPC_6_B1_ERROR_EST_FILTER_COEFF_MASK 0x1c000000 -#define BB_TPC_6_B1_ERROR_EST_FILTER_COEFF_GET(x) (((x) & 0x1c000000) >> 26) -#define BB_TPC_6_B1_ERROR_EST_FILTER_COEFF_SET(x) (((x) << 26) & 0x1c000000) - -/* macros for bb_sm1_reg_map.BB_tpc_11_b1 */ -#define BB_TPC_11_B1_ADDRESS 0x00000220 -#define BB_TPC_11_B1_OFFSET 0x00000220 -#define BB_TPC_11_B1_OLPC_GAIN_DELTA_1_MSB 23 -#define BB_TPC_11_B1_OLPC_GAIN_DELTA_1_LSB 16 -#define BB_TPC_11_B1_OLPC_GAIN_DELTA_1_MASK 0x00ff0000 -#define BB_TPC_11_B1_OLPC_GAIN_DELTA_1_GET(x) (((x) & 0x00ff0000) >> 16) -#define BB_TPC_11_B1_OLPC_GAIN_DELTA_1_SET(x) (((x) << 16) & 0x00ff0000) -#define BB_TPC_11_B1_OLPC_GAIN_DELTA_1_LSB_EXT_MSB 25 -#define BB_TPC_11_B1_OLPC_GAIN_DELTA_1_LSB_EXT_LSB 24 -#define BB_TPC_11_B1_OLPC_GAIN_DELTA_1_LSB_EXT_MASK 0x03000000 -#define BB_TPC_11_B1_OLPC_GAIN_DELTA_1_LSB_EXT_GET(x) (((x) & 0x03000000) >> 24) -#define BB_TPC_11_B1_OLPC_GAIN_DELTA_1_LSB_EXT_SET(x) (((x) << 24) & 0x03000000) - -/* macros for bb_sm1_reg_map.BB_tpc_19_b1 */ -#define BB_TPC_19_B1_ADDRESS 0x00000240 -#define BB_TPC_19_B1_OFFSET 0x00000240 -#define BB_TPC_19_B1_ALPHA_THERM_1_MSB 7 -#define BB_TPC_19_B1_ALPHA_THERM_1_LSB 0 -#define BB_TPC_19_B1_ALPHA_THERM_1_MASK 0x000000ff -#define BB_TPC_19_B1_ALPHA_THERM_1_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_TPC_19_B1_ALPHA_THERM_1_SET(x) (((x) << 0) & 0x000000ff) -#define BB_TPC_19_B1_ALPHA_THERM_PAL_ON_1_MSB 15 -#define BB_TPC_19_B1_ALPHA_THERM_PAL_ON_1_LSB 8 -#define BB_TPC_19_B1_ALPHA_THERM_PAL_ON_1_MASK 0x0000ff00 -#define BB_TPC_19_B1_ALPHA_THERM_PAL_ON_1_GET(x) (((x) & 0x0000ff00) >> 8) -#define BB_TPC_19_B1_ALPHA_THERM_PAL_ON_1_SET(x) (((x) << 8) & 0x0000ff00) -#define BB_TPC_19_B1_ALPHA_VOLT_1_MSB 22 -#define BB_TPC_19_B1_ALPHA_VOLT_1_LSB 16 -#define BB_TPC_19_B1_ALPHA_VOLT_1_MASK 0x007f0000 -#define BB_TPC_19_B1_ALPHA_VOLT_1_GET(x) (((x) & 0x007f0000) >> 16) -#define BB_TPC_19_B1_ALPHA_VOLT_1_SET(x) (((x) << 16) & 0x007f0000) -#define BB_TPC_19_B1_ALPHA_VOLT_PAL_ON_1_MSB 29 -#define BB_TPC_19_B1_ALPHA_VOLT_PAL_ON_1_LSB 23 -#define BB_TPC_19_B1_ALPHA_VOLT_PAL_ON_1_MASK 0x3f800000 -#define BB_TPC_19_B1_ALPHA_VOLT_PAL_ON_1_GET(x) (((x) & 0x3f800000) >> 23) -#define BB_TPC_19_B1_ALPHA_VOLT_PAL_ON_1_SET(x) (((x) << 23) & 0x3f800000) - -/* macros for bb_sm1_reg_map.BB_pdadc_tab_b1 */ -#define BB_PDADC_TAB_B1_ADDRESS 0x00000280 -#define BB_PDADC_TAB_B1_OFFSET 0x00000280 -#define BB_PDADC_TAB_B1_TAB_ENTRY_MSB 31 -#define BB_PDADC_TAB_B1_TAB_ENTRY_LSB 0 -#define BB_PDADC_TAB_B1_TAB_ENTRY_MASK 0xffffffff -#define BB_PDADC_TAB_B1_TAB_ENTRY_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for bb_sm1_reg_map.BB_rtt_table_sw_intf_b1 */ -#define BB_RTT_TABLE_SW_INTF_B1_ADDRESS 0x00000384 -#define BB_RTT_TABLE_SW_INTF_B1_OFFSET 0x00000384 -#define BB_RTT_TABLE_SW_INTF_B1_SW_RTT_TABLE_ACCESS_1_MSB 0 -#define BB_RTT_TABLE_SW_INTF_B1_SW_RTT_TABLE_ACCESS_1_LSB 0 -#define BB_RTT_TABLE_SW_INTF_B1_SW_RTT_TABLE_ACCESS_1_MASK 0x00000001 -#define BB_RTT_TABLE_SW_INTF_B1_SW_RTT_TABLE_ACCESS_1_GET(x) (((x) & 0x00000001) >> 0) -#define BB_RTT_TABLE_SW_INTF_B1_SW_RTT_TABLE_ACCESS_1_SET(x) (((x) << 0) & 0x00000001) -#define BB_RTT_TABLE_SW_INTF_B1_SW_RTT_TABLE_WRITE_1_MSB 1 -#define BB_RTT_TABLE_SW_INTF_B1_SW_RTT_TABLE_WRITE_1_LSB 1 -#define BB_RTT_TABLE_SW_INTF_B1_SW_RTT_TABLE_WRITE_1_MASK 0x00000002 -#define BB_RTT_TABLE_SW_INTF_B1_SW_RTT_TABLE_WRITE_1_GET(x) (((x) & 0x00000002) >> 1) -#define BB_RTT_TABLE_SW_INTF_B1_SW_RTT_TABLE_WRITE_1_SET(x) (((x) << 1) & 0x00000002) -#define BB_RTT_TABLE_SW_INTF_B1_SW_RTT_TABLE_ADDR_1_MSB 4 -#define BB_RTT_TABLE_SW_INTF_B1_SW_RTT_TABLE_ADDR_1_LSB 2 -#define BB_RTT_TABLE_SW_INTF_B1_SW_RTT_TABLE_ADDR_1_MASK 0x0000001c -#define BB_RTT_TABLE_SW_INTF_B1_SW_RTT_TABLE_ADDR_1_GET(x) (((x) & 0x0000001c) >> 2) -#define BB_RTT_TABLE_SW_INTF_B1_SW_RTT_TABLE_ADDR_1_SET(x) (((x) << 2) & 0x0000001c) - -/* macros for bb_sm1_reg_map.BB_rtt_table_sw_intf_1_b1 */ -#define BB_RTT_TABLE_SW_INTF_1_B1_ADDRESS 0x00000388 -#define BB_RTT_TABLE_SW_INTF_1_B1_OFFSET 0x00000388 -#define BB_RTT_TABLE_SW_INTF_1_B1_SW_RTT_TABLE_DATA_1_MSB 31 -#define BB_RTT_TABLE_SW_INTF_1_B1_SW_RTT_TABLE_DATA_1_LSB 4 -#define BB_RTT_TABLE_SW_INTF_1_B1_SW_RTT_TABLE_DATA_1_MASK 0xfffffff0 -#define BB_RTT_TABLE_SW_INTF_1_B1_SW_RTT_TABLE_DATA_1_GET(x) (((x) & 0xfffffff0) >> 4) -#define BB_RTT_TABLE_SW_INTF_1_B1_SW_RTT_TABLE_DATA_1_SET(x) (((x) << 4) & 0xfffffff0) - -/* macros for bb_sm1_reg_map.BB_txiq_corr_coeff_01_b1 */ -#define BB_TXIQ_CORR_COEFF_01_B1_ADDRESS 0x00000450 -#define BB_TXIQ_CORR_COEFF_01_B1_OFFSET 0x00000450 -#define BB_TXIQ_CORR_COEFF_01_B1_IQC_COEFF_TABLE_0_1_MSB 13 -#define BB_TXIQ_CORR_COEFF_01_B1_IQC_COEFF_TABLE_0_1_LSB 0 -#define BB_TXIQ_CORR_COEFF_01_B1_IQC_COEFF_TABLE_0_1_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_01_B1_IQC_COEFF_TABLE_0_1_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_01_B1_IQC_COEFF_TABLE_0_1_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_01_B1_IQC_COEFF_TABLE_1_1_MSB 27 -#define BB_TXIQ_CORR_COEFF_01_B1_IQC_COEFF_TABLE_1_1_LSB 14 -#define BB_TXIQ_CORR_COEFF_01_B1_IQC_COEFF_TABLE_1_1_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_01_B1_IQC_COEFF_TABLE_1_1_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_01_B1_IQC_COEFF_TABLE_1_1_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm1_reg_map.BB_txiq_corr_coeff_23_b1 */ -#define BB_TXIQ_CORR_COEFF_23_B1_ADDRESS 0x00000454 -#define BB_TXIQ_CORR_COEFF_23_B1_OFFSET 0x00000454 -#define BB_TXIQ_CORR_COEFF_23_B1_IQC_COEFF_TABLE_2_1_MSB 13 -#define BB_TXIQ_CORR_COEFF_23_B1_IQC_COEFF_TABLE_2_1_LSB 0 -#define BB_TXIQ_CORR_COEFF_23_B1_IQC_COEFF_TABLE_2_1_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_23_B1_IQC_COEFF_TABLE_2_1_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_23_B1_IQC_COEFF_TABLE_2_1_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_23_B1_IQC_COEFF_TABLE_3_1_MSB 27 -#define BB_TXIQ_CORR_COEFF_23_B1_IQC_COEFF_TABLE_3_1_LSB 14 -#define BB_TXIQ_CORR_COEFF_23_B1_IQC_COEFF_TABLE_3_1_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_23_B1_IQC_COEFF_TABLE_3_1_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_23_B1_IQC_COEFF_TABLE_3_1_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm1_reg_map.BB_txiq_corr_coeff_45_b1 */ -#define BB_TXIQ_CORR_COEFF_45_B1_ADDRESS 0x00000458 -#define BB_TXIQ_CORR_COEFF_45_B1_OFFSET 0x00000458 -#define BB_TXIQ_CORR_COEFF_45_B1_IQC_COEFF_TABLE_4_1_MSB 13 -#define BB_TXIQ_CORR_COEFF_45_B1_IQC_COEFF_TABLE_4_1_LSB 0 -#define BB_TXIQ_CORR_COEFF_45_B1_IQC_COEFF_TABLE_4_1_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_45_B1_IQC_COEFF_TABLE_4_1_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_45_B1_IQC_COEFF_TABLE_4_1_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_45_B1_IQC_COEFF_TABLE_5_1_MSB 27 -#define BB_TXIQ_CORR_COEFF_45_B1_IQC_COEFF_TABLE_5_1_LSB 14 -#define BB_TXIQ_CORR_COEFF_45_B1_IQC_COEFF_TABLE_5_1_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_45_B1_IQC_COEFF_TABLE_5_1_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_45_B1_IQC_COEFF_TABLE_5_1_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm1_reg_map.BB_txiq_corr_coeff_67_b1 */ -#define BB_TXIQ_CORR_COEFF_67_B1_ADDRESS 0x0000045c -#define BB_TXIQ_CORR_COEFF_67_B1_OFFSET 0x0000045c -#define BB_TXIQ_CORR_COEFF_67_B1_IQC_COEFF_TABLE_6_1_MSB 13 -#define BB_TXIQ_CORR_COEFF_67_B1_IQC_COEFF_TABLE_6_1_LSB 0 -#define BB_TXIQ_CORR_COEFF_67_B1_IQC_COEFF_TABLE_6_1_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_67_B1_IQC_COEFF_TABLE_6_1_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_67_B1_IQC_COEFF_TABLE_6_1_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_67_B1_IQC_COEFF_TABLE_7_1_MSB 27 -#define BB_TXIQ_CORR_COEFF_67_B1_IQC_COEFF_TABLE_7_1_LSB 14 -#define BB_TXIQ_CORR_COEFF_67_B1_IQC_COEFF_TABLE_7_1_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_67_B1_IQC_COEFF_TABLE_7_1_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_67_B1_IQC_COEFF_TABLE_7_1_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm1_reg_map.BB_txiq_corr_coeff_89_b1 */ -#define BB_TXIQ_CORR_COEFF_89_B1_ADDRESS 0x00000460 -#define BB_TXIQ_CORR_COEFF_89_B1_OFFSET 0x00000460 -#define BB_TXIQ_CORR_COEFF_89_B1_IQC_COEFF_TABLE_8_1_MSB 13 -#define BB_TXIQ_CORR_COEFF_89_B1_IQC_COEFF_TABLE_8_1_LSB 0 -#define BB_TXIQ_CORR_COEFF_89_B1_IQC_COEFF_TABLE_8_1_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_89_B1_IQC_COEFF_TABLE_8_1_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_89_B1_IQC_COEFF_TABLE_8_1_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_89_B1_IQC_COEFF_TABLE_9_1_MSB 27 -#define BB_TXIQ_CORR_COEFF_89_B1_IQC_COEFF_TABLE_9_1_LSB 14 -#define BB_TXIQ_CORR_COEFF_89_B1_IQC_COEFF_TABLE_9_1_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_89_B1_IQC_COEFF_TABLE_9_1_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_89_B1_IQC_COEFF_TABLE_9_1_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm1_reg_map.BB_txiq_corr_coeff_ab_b1 */ -#define BB_TXIQ_CORR_COEFF_AB_B1_ADDRESS 0x00000464 -#define BB_TXIQ_CORR_COEFF_AB_B1_OFFSET 0x00000464 -#define BB_TXIQ_CORR_COEFF_AB_B1_IQC_COEFF_TABLE_A_1_MSB 13 -#define BB_TXIQ_CORR_COEFF_AB_B1_IQC_COEFF_TABLE_A_1_LSB 0 -#define BB_TXIQ_CORR_COEFF_AB_B1_IQC_COEFF_TABLE_A_1_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_AB_B1_IQC_COEFF_TABLE_A_1_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_AB_B1_IQC_COEFF_TABLE_A_1_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_AB_B1_IQC_COEFF_TABLE_B_1_MSB 27 -#define BB_TXIQ_CORR_COEFF_AB_B1_IQC_COEFF_TABLE_B_1_LSB 14 -#define BB_TXIQ_CORR_COEFF_AB_B1_IQC_COEFF_TABLE_B_1_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_AB_B1_IQC_COEFF_TABLE_B_1_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_AB_B1_IQC_COEFF_TABLE_B_1_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm1_reg_map.BB_txiq_corr_coeff_cd_b1 */ -#define BB_TXIQ_CORR_COEFF_CD_B1_ADDRESS 0x00000468 -#define BB_TXIQ_CORR_COEFF_CD_B1_OFFSET 0x00000468 -#define BB_TXIQ_CORR_COEFF_CD_B1_IQC_COEFF_TABLE_C_1_MSB 13 -#define BB_TXIQ_CORR_COEFF_CD_B1_IQC_COEFF_TABLE_C_1_LSB 0 -#define BB_TXIQ_CORR_COEFF_CD_B1_IQC_COEFF_TABLE_C_1_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_CD_B1_IQC_COEFF_TABLE_C_1_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_CD_B1_IQC_COEFF_TABLE_C_1_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_CD_B1_IQC_COEFF_TABLE_D_1_MSB 27 -#define BB_TXIQ_CORR_COEFF_CD_B1_IQC_COEFF_TABLE_D_1_LSB 14 -#define BB_TXIQ_CORR_COEFF_CD_B1_IQC_COEFF_TABLE_D_1_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_CD_B1_IQC_COEFF_TABLE_D_1_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_CD_B1_IQC_COEFF_TABLE_D_1_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm1_reg_map.BB_txiq_corr_coeff_ef_b1 */ -#define BB_TXIQ_CORR_COEFF_EF_B1_ADDRESS 0x0000046c -#define BB_TXIQ_CORR_COEFF_EF_B1_OFFSET 0x0000046c -#define BB_TXIQ_CORR_COEFF_EF_B1_IQC_COEFF_TABLE_E_1_MSB 13 -#define BB_TXIQ_CORR_COEFF_EF_B1_IQC_COEFF_TABLE_E_1_LSB 0 -#define BB_TXIQ_CORR_COEFF_EF_B1_IQC_COEFF_TABLE_E_1_MASK 0x00003fff -#define BB_TXIQ_CORR_COEFF_EF_B1_IQC_COEFF_TABLE_E_1_GET(x) (((x) & 0x00003fff) >> 0) -#define BB_TXIQ_CORR_COEFF_EF_B1_IQC_COEFF_TABLE_E_1_SET(x) (((x) << 0) & 0x00003fff) -#define BB_TXIQ_CORR_COEFF_EF_B1_IQC_COEFF_TABLE_F_1_MSB 27 -#define BB_TXIQ_CORR_COEFF_EF_B1_IQC_COEFF_TABLE_F_1_LSB 14 -#define BB_TXIQ_CORR_COEFF_EF_B1_IQC_COEFF_TABLE_F_1_MASK 0x0fffc000 -#define BB_TXIQ_CORR_COEFF_EF_B1_IQC_COEFF_TABLE_F_1_GET(x) (((x) & 0x0fffc000) >> 14) -#define BB_TXIQ_CORR_COEFF_EF_B1_IQC_COEFF_TABLE_F_1_SET(x) (((x) << 14) & 0x0fffc000) - -/* macros for bb_sm1_reg_map.BB_txiqcal_status_b1 */ -#define BB_TXIQCAL_STATUS_B1_ADDRESS 0x0000048c -#define BB_TXIQCAL_STATUS_B1_OFFSET 0x0000048c -#define BB_TXIQCAL_STATUS_B1_TXIQCAL_FAILED_1_MSB 0 -#define BB_TXIQCAL_STATUS_B1_TXIQCAL_FAILED_1_LSB 0 -#define BB_TXIQCAL_STATUS_B1_TXIQCAL_FAILED_1_MASK 0x00000001 -#define BB_TXIQCAL_STATUS_B1_TXIQCAL_FAILED_1_GET(x) (((x) & 0x00000001) >> 0) -#define BB_TXIQCAL_STATUS_B1_CALIBRATED_GAINS_1_MSB 5 -#define BB_TXIQCAL_STATUS_B1_CALIBRATED_GAINS_1_LSB 1 -#define BB_TXIQCAL_STATUS_B1_CALIBRATED_GAINS_1_MASK 0x0000003e -#define BB_TXIQCAL_STATUS_B1_CALIBRATED_GAINS_1_GET(x) (((x) & 0x0000003e) >> 1) -#define BB_TXIQCAL_STATUS_B1_TONE_GAIN_USED_1_MSB 11 -#define BB_TXIQCAL_STATUS_B1_TONE_GAIN_USED_1_LSB 6 -#define BB_TXIQCAL_STATUS_B1_TONE_GAIN_USED_1_MASK 0x00000fc0 -#define BB_TXIQCAL_STATUS_B1_TONE_GAIN_USED_1_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_TXIQCAL_STATUS_B1_RX_GAIN_USED_1_MSB 17 -#define BB_TXIQCAL_STATUS_B1_RX_GAIN_USED_1_LSB 12 -#define BB_TXIQCAL_STATUS_B1_RX_GAIN_USED_1_MASK 0x0003f000 -#define BB_TXIQCAL_STATUS_B1_RX_GAIN_USED_1_GET(x) (((x) & 0x0003f000) >> 12) -#define BB_TXIQCAL_STATUS_B1_LAST_MEAS_ADDR_1_MSB 23 -#define BB_TXIQCAL_STATUS_B1_LAST_MEAS_ADDR_1_LSB 18 -#define BB_TXIQCAL_STATUS_B1_LAST_MEAS_ADDR_1_MASK 0x00fc0000 -#define BB_TXIQCAL_STATUS_B1_LAST_MEAS_ADDR_1_GET(x) (((x) & 0x00fc0000) >> 18) - -/* macros for bb_sm1_reg_map.BB_tables_intf_addr_b1 */ -#define BB_TABLES_INTF_ADDR_B1_ADDRESS 0x000005f0 -#define BB_TABLES_INTF_ADDR_B1_OFFSET 0x000005f0 -#define BB_TABLES_INTF_ADDR_B1_TABLES_ADDR_1_MSB 17 -#define BB_TABLES_INTF_ADDR_B1_TABLES_ADDR_1_LSB 2 -#define BB_TABLES_INTF_ADDR_B1_TABLES_ADDR_1_MASK 0x0003fffc -#define BB_TABLES_INTF_ADDR_B1_TABLES_ADDR_1_GET(x) (((x) & 0x0003fffc) >> 2) -#define BB_TABLES_INTF_ADDR_B1_TABLES_ADDR_1_SET(x) (((x) << 2) & 0x0003fffc) -#define BB_TABLES_INTF_ADDR_B1_ADDR_AUTO_INCR_1_MSB 31 -#define BB_TABLES_INTF_ADDR_B1_ADDR_AUTO_INCR_1_LSB 31 -#define BB_TABLES_INTF_ADDR_B1_ADDR_AUTO_INCR_1_MASK 0x80000000 -#define BB_TABLES_INTF_ADDR_B1_ADDR_AUTO_INCR_1_GET(x) (((x) & 0x80000000) >> 31) -#define BB_TABLES_INTF_ADDR_B1_ADDR_AUTO_INCR_1_SET(x) (((x) << 31) & 0x80000000) - -/* macros for bb_sm1_reg_map.BB_tables_intf_data_b1 */ -#define BB_TABLES_INTF_DATA_B1_ADDRESS 0x000005f4 -#define BB_TABLES_INTF_DATA_B1_OFFSET 0x000005f4 -#define BB_TABLES_INTF_DATA_B1_TABLES_DATA_1_MSB 31 -#define BB_TABLES_INTF_DATA_B1_TABLES_DATA_1_LSB 0 -#define BB_TABLES_INTF_DATA_B1_TABLES_DATA_1_MASK 0xffffffff -#define BB_TABLES_INTF_DATA_B1_TABLES_DATA_1_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_TABLES_INTF_DATA_B1_TABLES_DATA_1_SET(x) (((x) << 0) & 0xffffffff) - -#ifndef __ASSEMBLER__ - -typedef struct bb_reg_reg_s_8 { - volatile char pad__0[0x84]; /* 0x0 - 0x84 */ - volatile unsigned int BB_switch_table_chn_b1; /* 0x84 - 0x88 */ - volatile char pad__1[0x48]; /* 0x88 - 0xd0 */ - volatile unsigned int BB_fcal_2_b1; /* 0xd0 - 0xd4 */ - volatile unsigned int BB_dft_tone_ctrl_b1; /* 0xd4 - 0xd8 */ - volatile char pad__2[0x4]; /* 0xd8 - 0xdc */ - volatile unsigned int BB_cl_map_0_b1; /* 0xdc - 0xe0 */ - volatile unsigned int BB_cl_map_1_b1; /* 0xe0 - 0xe4 */ - volatile unsigned int BB_cl_map_2_b1; /* 0xe4 - 0xe8 */ - volatile unsigned int BB_cl_map_3_b1; /* 0xe8 - 0xec */ - volatile unsigned int BB_cl_map_pal_0_b1; /* 0xec - 0xf0 */ - volatile unsigned int BB_cl_map_pal_1_b1; /* 0xf0 - 0xf4 */ - volatile unsigned int BB_cl_map_pal_2_b1; /* 0xf4 - 0xf8 */ - volatile unsigned int BB_cl_map_pal_3_b1; /* 0xf8 - 0xfc */ - volatile char pad__3[0x4]; /* 0xfc - 0x100 */ - volatile unsigned int BB_cl_tab_b1[16]; /* 0x100 - 0x140 */ - volatile char pad__4[0x40]; /* 0x140 - 0x180 */ - volatile unsigned int BB_chan_info_gain_b1; /* 0x180 - 0x184 */ - volatile char pad__5[0x80]; /* 0x184 - 0x204 */ - volatile unsigned int BB_tpc_4_b1; /* 0x204 - 0x208 */ - volatile unsigned int BB_tpc_5_b1; /* 0x208 - 0x20c */ - volatile unsigned int BB_tpc_6_b1; /* 0x20c - 0x210 */ - volatile char pad__6[0x10]; /* 0x210 - 0x220 */ - volatile unsigned int BB_tpc_11_b1; /* 0x220 - 0x224 */ - volatile char pad__7[0x1c]; /* 0x224 - 0x240 */ - volatile unsigned int BB_tpc_19_b1; /* 0x240 - 0x244 */ - volatile char pad__8[0x3c]; /* 0x244 - 0x280 */ - volatile unsigned int BB_pdadc_tab_b1[32]; /* 0x280 - 0x300 */ - volatile char pad__9[0x84]; /* 0x300 - 0x384 */ - volatile unsigned int BB_rtt_table_sw_intf_b1; /* 0x384 - 0x388 */ - volatile unsigned int BB_rtt_table_sw_intf_1_b1; /* 0x388 - 0x38c */ - volatile char pad__10[0xc4]; /* 0x38c - 0x450 */ - volatile unsigned int BB_txiq_corr_coeff_01_b1; /* 0x450 - 0x454 */ - volatile unsigned int BB_txiq_corr_coeff_23_b1; /* 0x454 - 0x458 */ - volatile unsigned int BB_txiq_corr_coeff_45_b1; /* 0x458 - 0x45c */ - volatile unsigned int BB_txiq_corr_coeff_67_b1; /* 0x45c - 0x460 */ - volatile unsigned int BB_txiq_corr_coeff_89_b1; /* 0x460 - 0x464 */ - volatile unsigned int BB_txiq_corr_coeff_ab_b1; /* 0x464 - 0x468 */ - volatile unsigned int BB_txiq_corr_coeff_cd_b1; /* 0x468 - 0x46c */ - volatile unsigned int BB_txiq_corr_coeff_ef_b1; /* 0x46c - 0x470 */ - volatile char pad__11[0x1c]; /* 0x470 - 0x48c */ - volatile unsigned int BB_txiqcal_status_b1; /* 0x48c - 0x490 */ - volatile char pad__12[0x160]; /* 0x490 - 0x5f0 */ - volatile unsigned int BB_tables_intf_addr_b1; /* 0x5f0 - 0x5f4 */ - volatile unsigned int BB_tables_intf_data_b1; /* 0x5f4 - 0x5f8 */ -} bb_reg_reg_t_8; - -#endif /* __ASSEMBLER__ */ - - -/* macros for bb_chn3_reg_map.BB_dummy1 */ -#define BB_DUMMY1_ADDRESS 0x00000000 -#define BB_DUMMY1_OFFSET 0x00000000 -#define BB_DUMMY1_DUMMY_MSB 0 -#define BB_DUMMY1_DUMMY_LSB 0 -#define BB_DUMMY1_DUMMY_MASK 0x00000001 -#define BB_DUMMY1_DUMMY_GET(x) (((x) & 0x00000001) >> 0) - -#ifndef __ASSEMBLER__ - -typedef struct bb_reg_reg_s_9 { - volatile unsigned int BB_dummy1[256]; /* 0x0 - 0x400 */ -} bb_reg_reg_t_9; - -#endif /* __ASSEMBLER__ */ - - -/* macros for bb_agc3_reg_map.BB_dummy */ -#define BB_DUMMY_ADDRESS 0x00000000 -#define BB_DUMMY_OFFSET 0x00000000 -#define BB_DUMMY_DUMMY_MSB 0 -#define BB_DUMMY_DUMMY_LSB 0 -#define BB_DUMMY_DUMMY_MASK 0x00000001 -#define BB_DUMMY_DUMMY_GET(x) (((x) & 0x00000001) >> 0) - -/* macros for bb_agc3_reg_map.BB_rssi_b3 */ -#define BB_RSSI_B3_ADDRESS 0x00000180 -#define BB_RSSI_B3_OFFSET 0x00000180 -#define BB_RSSI_B3_RSSI_3_MSB 7 -#define BB_RSSI_B3_RSSI_3_LSB 0 -#define BB_RSSI_B3_RSSI_3_MASK 0x000000ff -#define BB_RSSI_B3_RSSI_3_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_RSSI_B3_RSSI_EXT_3_MSB 15 -#define BB_RSSI_B3_RSSI_EXT_3_LSB 8 -#define BB_RSSI_B3_RSSI_EXT_3_MASK 0x0000ff00 -#define BB_RSSI_B3_RSSI_EXT_3_GET(x) (((x) & 0x0000ff00) >> 8) - -#ifndef __ASSEMBLER__ - -typedef struct bb_reg_reg_s_10 { - volatile unsigned int BB_dummy; /* 0x0 - 0x4 */ - volatile char pad__0[0x17c]; /* 0x4 - 0x180 */ - volatile unsigned int BB_rssi_b3; /* 0x180 - 0x184 */ -} bb_reg_reg_t_10; - -#endif /* __ASSEMBLER__ */ - - -/* macros for bb_sm3_reg_map.BB_dummy2 */ -#define BB_DUMMY2_ADDRESS 0x00000000 -#define BB_DUMMY2_OFFSET 0x00000000 -#define BB_DUMMY2_DUMMY_MSB 0 -#define BB_DUMMY2_DUMMY_LSB 0 -#define BB_DUMMY2_DUMMY_MASK 0x00000001 -#define BB_DUMMY2_DUMMY_GET(x) (((x) & 0x00000001) >> 0) - -#ifndef __ASSEMBLER__ - -typedef struct bb_reg_reg_s_11 { - volatile unsigned int BB_dummy2[384]; /* 0x0 - 0x600 */ -} bb_reg_reg_t_11; - -#endif /* __ASSEMBLER__ */ - - -/* macros for bb_mit_reg_map.BB_mit_rf_cntl */ -#define BB_MIT_RF_CNTL_ADDRESS 0x00000000 -#define BB_MIT_RF_CNTL_OFFSET 0x00000000 -#define BB_MIT_RF_CNTL_MIT_FORCE_SYNTH_ON_MSB 0 -#define BB_MIT_RF_CNTL_MIT_FORCE_SYNTH_ON_LSB 0 -#define BB_MIT_RF_CNTL_MIT_FORCE_SYNTH_ON_MASK 0x00000001 -#define BB_MIT_RF_CNTL_MIT_FORCE_SYNTH_ON_GET(x) (((x) & 0x00000001) >> 0) -#define BB_MIT_RF_CNTL_MIT_FORCE_SYNTH_ON_SET(x) (((x) << 0) & 0x00000001) -#define BB_MIT_RF_CNTL_MIT_FORCE_SYNTH_ON_EN_MSB 1 -#define BB_MIT_RF_CNTL_MIT_FORCE_SYNTH_ON_EN_LSB 1 -#define BB_MIT_RF_CNTL_MIT_FORCE_SYNTH_ON_EN_MASK 0x00000002 -#define BB_MIT_RF_CNTL_MIT_FORCE_SYNTH_ON_EN_GET(x) (((x) & 0x00000002) >> 1) -#define BB_MIT_RF_CNTL_MIT_FORCE_SYNTH_ON_EN_SET(x) (((x) << 1) & 0x00000002) -#define BB_MIT_RF_CNTL_MIT_FORCE_ACTIVE_ON_MSB 2 -#define BB_MIT_RF_CNTL_MIT_FORCE_ACTIVE_ON_LSB 2 -#define BB_MIT_RF_CNTL_MIT_FORCE_ACTIVE_ON_MASK 0x00000004 -#define BB_MIT_RF_CNTL_MIT_FORCE_ACTIVE_ON_GET(x) (((x) & 0x00000004) >> 2) -#define BB_MIT_RF_CNTL_MIT_FORCE_ACTIVE_ON_SET(x) (((x) << 2) & 0x00000004) - -/* macros for bb_mit_reg_map.BB_mit_cca_cntl */ -#define BB_MIT_CCA_CNTL_ADDRESS 0x00000004 -#define BB_MIT_CCA_CNTL_OFFSET 0x00000004 -#define BB_MIT_CCA_CNTL_MIT_CCA_MODE_SEL_MSB 2 -#define BB_MIT_CCA_CNTL_MIT_CCA_MODE_SEL_LSB 0 -#define BB_MIT_CCA_CNTL_MIT_CCA_MODE_SEL_MASK 0x00000007 -#define BB_MIT_CCA_CNTL_MIT_CCA_MODE_SEL_GET(x) (((x) & 0x00000007) >> 0) -#define BB_MIT_CCA_CNTL_MIT_CCA_MODE_SEL_SET(x) (((x) << 0) & 0x00000007) -#define BB_MIT_CCA_CNTL_MIT_CCA_COUNT_MSB 20 -#define BB_MIT_CCA_CNTL_MIT_CCA_COUNT_LSB 3 -#define BB_MIT_CCA_CNTL_MIT_CCA_COUNT_MASK 0x001ffff8 -#define BB_MIT_CCA_CNTL_MIT_CCA_COUNT_GET(x) (((x) & 0x001ffff8) >> 3) -#define BB_MIT_CCA_CNTL_MIT_CCA_COUNT_SET(x) (((x) << 3) & 0x001ffff8) - -/* macros for bb_mit_reg_map.BB_mit_rssi_cntl_1 */ -#define BB_MIT_RSSI_CNTL_1_ADDRESS 0x00000008 -#define BB_MIT_RSSI_CNTL_1_OFFSET 0x00000008 -#define BB_MIT_RSSI_CNTL_1_MIT_RSSI_TH_MSB 5 -#define BB_MIT_RSSI_CNTL_1_MIT_RSSI_TH_LSB 0 -#define BB_MIT_RSSI_CNTL_1_MIT_RSSI_TH_MASK 0x0000003f -#define BB_MIT_RSSI_CNTL_1_MIT_RSSI_TH_GET(x) (((x) & 0x0000003f) >> 0) -#define BB_MIT_RSSI_CNTL_1_MIT_RSSI_TH_SET(x) (((x) << 0) & 0x0000003f) -#define BB_MIT_RSSI_CNTL_1_MIT_RX_RF_ATT_TH_H_MSB 11 -#define BB_MIT_RSSI_CNTL_1_MIT_RX_RF_ATT_TH_H_LSB 6 -#define BB_MIT_RSSI_CNTL_1_MIT_RX_RF_ATT_TH_H_MASK 0x00000fc0 -#define BB_MIT_RSSI_CNTL_1_MIT_RX_RF_ATT_TH_H_GET(x) (((x) & 0x00000fc0) >> 6) -#define BB_MIT_RSSI_CNTL_1_MIT_RX_RF_ATT_TH_H_SET(x) (((x) << 6) & 0x00000fc0) -#define BB_MIT_RSSI_CNTL_1_MIT_RX_RF_ATT_TH_L_MSB 17 -#define BB_MIT_RSSI_CNTL_1_MIT_RX_RF_ATT_TH_L_LSB 12 -#define BB_MIT_RSSI_CNTL_1_MIT_RX_RF_ATT_TH_L_MASK 0x0003f000 -#define BB_MIT_RSSI_CNTL_1_MIT_RX_RF_ATT_TH_L_GET(x) (((x) & 0x0003f000) >> 12) -#define BB_MIT_RSSI_CNTL_1_MIT_RX_RF_ATT_TH_L_SET(x) (((x) << 12) & 0x0003f000) -#define BB_MIT_RSSI_CNTL_1_MIT_RX_RF_ATT_OFFSET_MSB 23 -#define BB_MIT_RSSI_CNTL_1_MIT_RX_RF_ATT_OFFSET_LSB 18 -#define BB_MIT_RSSI_CNTL_1_MIT_RX_RF_ATT_OFFSET_MASK 0x00fc0000 -#define BB_MIT_RSSI_CNTL_1_MIT_RX_RF_ATT_OFFSET_GET(x) (((x) & 0x00fc0000) >> 18) -#define BB_MIT_RSSI_CNTL_1_MIT_RX_RF_ATT_OFFSET_SET(x) (((x) << 18) & 0x00fc0000) -#define BB_MIT_RSSI_CNTL_1_MIT_AGC_LIMIT_MSB 29 -#define BB_MIT_RSSI_CNTL_1_MIT_AGC_LIMIT_LSB 24 -#define BB_MIT_RSSI_CNTL_1_MIT_AGC_LIMIT_MASK 0x3f000000 -#define BB_MIT_RSSI_CNTL_1_MIT_AGC_LIMIT_GET(x) (((x) & 0x3f000000) >> 24) -#define BB_MIT_RSSI_CNTL_1_MIT_AGC_LIMIT_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for bb_mit_reg_map.BB_mit_rssi_cntl_2 */ -#define BB_MIT_RSSI_CNTL_2_ADDRESS 0x0000000c -#define BB_MIT_RSSI_CNTL_2_OFFSET 0x0000000c -#define BB_MIT_RSSI_CNTL_2_MIT_AGC_SEL_MSB 0 -#define BB_MIT_RSSI_CNTL_2_MIT_AGC_SEL_LSB 0 -#define BB_MIT_RSSI_CNTL_2_MIT_AGC_SEL_MASK 0x00000001 -#define BB_MIT_RSSI_CNTL_2_MIT_AGC_SEL_GET(x) (((x) & 0x00000001) >> 0) -#define BB_MIT_RSSI_CNTL_2_MIT_AGC_SEL_SET(x) (((x) << 0) & 0x00000001) -#define BB_MIT_RSSI_CNTL_2_MIT_RSSI_BASE_MSB 11 -#define BB_MIT_RSSI_CNTL_2_MIT_RSSI_BASE_LSB 1 -#define BB_MIT_RSSI_CNTL_2_MIT_RSSI_BASE_MASK 0x00000ffe -#define BB_MIT_RSSI_CNTL_2_MIT_RSSI_BASE_GET(x) (((x) & 0x00000ffe) >> 1) -#define BB_MIT_RSSI_CNTL_2_MIT_RSSI_BASE_SET(x) (((x) << 1) & 0x00000ffe) - -/* macros for bb_mit_reg_map.BB_mit_tx_cntl */ -#define BB_MIT_TX_CNTL_ADDRESS 0x00000010 -#define BB_MIT_TX_CNTL_OFFSET 0x00000010 -#define BB_MIT_TX_CNTL_MIT_TX_STA_CNT_MSB 7 -#define BB_MIT_TX_CNTL_MIT_TX_STA_CNT_LSB 0 -#define BB_MIT_TX_CNTL_MIT_TX_STA_CNT_MASK 0x000000ff -#define BB_MIT_TX_CNTL_MIT_TX_STA_CNT_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_MIT_TX_CNTL_MIT_TX_STA_CNT_SET(x) (((x) << 0) & 0x000000ff) -#define BB_MIT_TX_CNTL_MIT_TX_END_DLY_CNT_MSB 21 -#define BB_MIT_TX_CNTL_MIT_TX_END_DLY_CNT_LSB 8 -#define BB_MIT_TX_CNTL_MIT_TX_END_DLY_CNT_MASK 0x003fff00 -#define BB_MIT_TX_CNTL_MIT_TX_END_DLY_CNT_GET(x) (((x) & 0x003fff00) >> 8) -#define BB_MIT_TX_CNTL_MIT_TX_END_DLY_CNT_SET(x) (((x) << 8) & 0x003fff00) -#define BB_MIT_TX_CNTL_MIT_TX_THROUGH_ENA_MSB 22 -#define BB_MIT_TX_CNTL_MIT_TX_THROUGH_ENA_LSB 22 -#define BB_MIT_TX_CNTL_MIT_TX_THROUGH_ENA_MASK 0x00400000 -#define BB_MIT_TX_CNTL_MIT_TX_THROUGH_ENA_GET(x) (((x) & 0x00400000) >> 22) -#define BB_MIT_TX_CNTL_MIT_TX_THROUGH_ENA_SET(x) (((x) << 22) & 0x00400000) -#define BB_MIT_TX_CNTL_MIT_TXHDR_CHAIN_MASK_CCK_MSB 25 -#define BB_MIT_TX_CNTL_MIT_TXHDR_CHAIN_MASK_CCK_LSB 23 -#define BB_MIT_TX_CNTL_MIT_TXHDR_CHAIN_MASK_CCK_MASK 0x03800000 -#define BB_MIT_TX_CNTL_MIT_TXHDR_CHAIN_MASK_CCK_GET(x) (((x) & 0x03800000) >> 23) -#define BB_MIT_TX_CNTL_MIT_TXHDR_CHAIN_MASK_CCK_SET(x) (((x) << 23) & 0x03800000) -#define BB_MIT_TX_CNTL_MIT_TXHDR_PAPRD_TRAIN_MASK_CCK_MSB 28 -#define BB_MIT_TX_CNTL_MIT_TXHDR_PAPRD_TRAIN_MASK_CCK_LSB 26 -#define BB_MIT_TX_CNTL_MIT_TXHDR_PAPRD_TRAIN_MASK_CCK_MASK 0x1c000000 -#define BB_MIT_TX_CNTL_MIT_TXHDR_PAPRD_TRAIN_MASK_CCK_GET(x) (((x) & 0x1c000000) >> 26) -#define BB_MIT_TX_CNTL_MIT_TXHDR_PAPRD_TRAIN_MASK_CCK_SET(x) (((x) << 26) & 0x1c000000) -#define BB_MIT_TX_CNTL_MIT_TXHDR_CHAN_MODE_CCK_MSB 30 -#define BB_MIT_TX_CNTL_MIT_TXHDR_CHAN_MODE_CCK_LSB 29 -#define BB_MIT_TX_CNTL_MIT_TXHDR_CHAN_MODE_CCK_MASK 0x60000000 -#define BB_MIT_TX_CNTL_MIT_TXHDR_CHAN_MODE_CCK_GET(x) (((x) & 0x60000000) >> 29) -#define BB_MIT_TX_CNTL_MIT_TXHDR_CHAN_MODE_CCK_SET(x) (((x) << 29) & 0x60000000) - -/* macros for bb_mit_reg_map.BB_mit_rx_cntl */ -#define BB_MIT_RX_CNTL_ADDRESS 0x00000014 -#define BB_MIT_RX_CNTL_OFFSET 0x00000014 -#define BB_MIT_RX_CNTL_MIT_RX_END_DLY_CNT_MSB 7 -#define BB_MIT_RX_CNTL_MIT_RX_END_DLY_CNT_LSB 0 -#define BB_MIT_RX_CNTL_MIT_RX_END_DLY_CNT_MASK 0x000000ff -#define BB_MIT_RX_CNTL_MIT_RX_END_DLY_CNT_GET(x) (((x) & 0x000000ff) >> 0) -#define BB_MIT_RX_CNTL_MIT_RX_END_DLY_CNT_SET(x) (((x) << 0) & 0x000000ff) -#define BB_MIT_RX_CNTL_MIT_RX_THROUGH_ENA_MSB 8 -#define BB_MIT_RX_CNTL_MIT_RX_THROUGH_ENA_LSB 8 -#define BB_MIT_RX_CNTL_MIT_RX_THROUGH_ENA_MASK 0x00000100 -#define BB_MIT_RX_CNTL_MIT_RX_THROUGH_ENA_GET(x) (((x) & 0x00000100) >> 8) -#define BB_MIT_RX_CNTL_MIT_RX_THROUGH_ENA_SET(x) (((x) << 8) & 0x00000100) - -/* macros for bb_mit_reg_map.BB_mit_out_cntl */ -#define BB_MIT_OUT_CNTL_ADDRESS 0x00000018 -#define BB_MIT_OUT_CNTL_OFFSET 0x00000018 -#define BB_MIT_OUT_CNTL_MIT_CLK_TUNE_MOD_MSB 1 -#define BB_MIT_OUT_CNTL_MIT_CLK_TUNE_MOD_LSB 0 -#define BB_MIT_OUT_CNTL_MIT_CLK_TUNE_MOD_MASK 0x00000003 -#define BB_MIT_OUT_CNTL_MIT_CLK_TUNE_MOD_GET(x) (((x) & 0x00000003) >> 0) -#define BB_MIT_OUT_CNTL_MIT_CLK_TUNE_MOD_SET(x) (((x) << 0) & 0x00000003) -#define BB_MIT_OUT_CNTL_MIT_NO_DATA_TO_ATH_MSB 2 -#define BB_MIT_OUT_CNTL_MIT_NO_DATA_TO_ATH_LSB 2 -#define BB_MIT_OUT_CNTL_MIT_NO_DATA_TO_ATH_MASK 0x00000004 -#define BB_MIT_OUT_CNTL_MIT_NO_DATA_TO_ATH_GET(x) (((x) & 0x00000004) >> 2) -#define BB_MIT_OUT_CNTL_MIT_NO_DATA_TO_ATH_SET(x) (((x) << 2) & 0x00000004) - -/* macros for bb_mit_reg_map.BB_mit_spare_cntl */ -#define BB_MIT_SPARE_CNTL_ADDRESS 0x0000001c -#define BB_MIT_SPARE_CNTL_OFFSET 0x0000001c -#define BB_MIT_SPARE_CNTL_MIT_SPARE_IN_MSB 30 -#define BB_MIT_SPARE_CNTL_MIT_SPARE_IN_LSB 0 -#define BB_MIT_SPARE_CNTL_MIT_SPARE_IN_MASK 0x7fffffff -#define BB_MIT_SPARE_CNTL_MIT_SPARE_IN_GET(x) (((x) & 0x7fffffff) >> 0) -#define BB_MIT_SPARE_CNTL_MIT_SPARE_IN_SET(x) (((x) << 0) & 0x7fffffff) -#define BB_MIT_SPARE_CNTL_MIT_SPARE_OUT_MSB 31 -#define BB_MIT_SPARE_CNTL_MIT_SPARE_OUT_LSB 31 -#define BB_MIT_SPARE_CNTL_MIT_SPARE_OUT_MASK 0x80000000 -#define BB_MIT_SPARE_CNTL_MIT_SPARE_OUT_GET(x) (((x) & 0x80000000) >> 31) - -#ifndef __ASSEMBLER__ - -typedef struct bb_reg_reg_s_12 { - volatile unsigned int BB_mit_rf_cntl; /* 0x0 - 0x4 */ - volatile unsigned int BB_mit_cca_cntl; /* 0x4 - 0x8 */ - volatile unsigned int BB_mit_rssi_cntl_1; /* 0x8 - 0xc */ - volatile unsigned int BB_mit_rssi_cntl_2; /* 0xc - 0x10 */ - volatile unsigned int BB_mit_tx_cntl; /* 0x10 - 0x14 */ - volatile unsigned int BB_mit_rx_cntl; /* 0x14 - 0x18 */ - volatile unsigned int BB_mit_out_cntl; /* 0x18 - 0x1c */ - volatile unsigned int BB_mit_spare_cntl; /* 0x1c - 0x20 */ -} bb_reg_reg_t_12; - -#endif /* __ASSEMBLER__ */ - -#define RFILE_INST_BB_CHN_REG_MAP__NUM 1 -#define RFILE_INST_BB_MRC_REG_MAP__NUM 1 -#define RFILE_INST_BB_BBB_REG_MAP__NUM 1 -#define RFILE_INST_BB_AGC_REG_MAP__NUM 1 -#define RFILE_INST_BB_SM_REG_MAP__NUM 1 -#define RFILE_INST_BB_CHN1_REG_MAP__NUM 1 -#define RFILE_INST_BB_AGC1_REG_MAP__NUM 1 -#define RFILE_INST_BB_SM1_REG_MAP__NUM 1 -#define RFILE_INST_BB_CHN3_REG_MAP__NUM 1 -#define RFILE_INST_BB_AGC3_REG_MAP__NUM 1 -#define RFILE_INST_BB_SM3_REG_MAP__NUM 1 -#define RFILE_INST_BB_MIT_REG_MAP__NUM 1 - - -#ifndef __ASSEMBLER__ - -#if 0 -typedef struct bb_reg_reg_s_13 { - volatile char pad__0[0x9800]; /* 0x0 - 0x9800 */ - struct chn_reg_map bb_chn_reg_map; /* 0x9800 - 0x9bf8 */ - volatile char pad__1[0x8]; /* 0x9bf8 - 0x9c00 */ - struct mrc_reg_map bb_mrc_reg_map; /* 0x9c00 - 0x9c24 */ - volatile char pad__2[0xdc]; /* 0x9c24 - 0x9d00 */ - struct bbb_reg_map bb_bbb_reg_map; /* 0x9d00 - 0x9d1c */ - volatile char pad__3[0xe4]; /* 0x9d1c - 0x9e00 */ - struct agc_reg_map bb_agc_reg_map; /* 0x9e00 - 0xa200 */ - struct sm_reg_map bb_sm_reg_map; /* 0xa200 - 0xa7f8 */ - volatile char pad__4[0x8]; /* 0xa7f8 - 0xa800 */ - struct chn1_reg_map bb_chn1_reg_map; /* 0xa800 - 0xabc8 */ - volatile char pad__5[0x238]; /* 0xabc8 - 0xae00 */ - struct agc1_reg_map bb_agc1_reg_map; /* 0xae00 - 0xb1fc */ - volatile char pad__6[0x4]; /* 0xb1fc - 0xb200 */ - struct sm1_reg_map bb_sm1_reg_map; /* 0xb200 - 0xb774 */ - volatile char pad__7[0x108c]; /* 0xb774 - 0xc800 */ - struct chn3_reg_map bb_chn3_reg_map; /* 0xc800 - 0xcc00 */ - volatile char pad__8[0x200]; /* 0xcc00 - 0xce00 */ - struct agc3_reg_map bb_agc3_reg_map; /* 0xce00 - 0xcf84 */ - volatile char pad__9[0x27c]; /* 0xcf84 - 0xd200 */ - struct sm3_reg_map bb_sm3_reg_map; /* 0xd200 - 0xd800 */ - struct mit_local_reg_map bb_mit_reg_map; /* 0xd800 - 0xd820 */ -} bb_reg_reg_t_13; -#endif //0 - -#endif /* __ASSEMBLER__ */ - -#endif /* _BB_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_gmac_0_rx_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_gmac_0_rx_reg.h deleted file mode 100644 index fc383d76a4d9..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_gmac_0_rx_reg.h +++ /dev/null @@ -1,122 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _BRIDGE_CHAIN_GMAC_0_RX_REG_REG_H_ -#define _BRIDGE_CHAIN_GMAC_0_RX_REG_REG_H_ - -#define GMAC_RX_0_DESC_START_ADDRESS_ADDRESS 0x00000000 -#define GMAC_RX_0_DESC_START_ADDRESS_OFFSET 0x00000000 -#define GMAC_RX_0_DESC_START_ADDRESS_ADDRESS_MSB 31 -#define GMAC_RX_0_DESC_START_ADDRESS_ADDRESS_LSB 0 -#define GMAC_RX_0_DESC_START_ADDRESS_ADDRESS_MASK 0xffffffff -#define GMAC_RX_0_DESC_START_ADDRESS_ADDRESS_GET(x) (((x) & GMAC_RX_0_DESC_START_ADDRESS_ADDRESS_MASK) >> GMAC_RX_0_DESC_START_ADDRESS_ADDRESS_LSB) -#define GMAC_RX_0_DESC_START_ADDRESS_ADDRESS_SET(x) (((x) << GMAC_RX_0_DESC_START_ADDRESS_ADDRESS_LSB) & GMAC_RX_0_DESC_START_ADDRESS_ADDRESS_MASK) - -#define GMAC_RX_0_DMA_START_ADDRESS 0x00000004 -#define GMAC_RX_0_DMA_START_OFFSET 0x00000004 -#define GMAC_RX_0_DMA_START_RESTART_MSB 4 -#define GMAC_RX_0_DMA_START_RESTART_LSB 4 -#define GMAC_RX_0_DMA_START_RESTART_MASK 0x00000010 -#define GMAC_RX_0_DMA_START_RESTART_GET(x) (((x) & GMAC_RX_0_DMA_START_RESTART_MASK) >> GMAC_RX_0_DMA_START_RESTART_LSB) -#define GMAC_RX_0_DMA_START_RESTART_SET(x) (((x) << GMAC_RX_0_DMA_START_RESTART_LSB) & GMAC_RX_0_DMA_START_RESTART_MASK) -#define GMAC_RX_0_DMA_START_START_MSB 0 -#define GMAC_RX_0_DMA_START_START_LSB 0 -#define GMAC_RX_0_DMA_START_START_MASK 0x00000001 -#define GMAC_RX_0_DMA_START_START_GET(x) (((x) & GMAC_RX_0_DMA_START_START_MASK) >> GMAC_RX_0_DMA_START_START_LSB) -#define GMAC_RX_0_DMA_START_START_SET(x) (((x) << GMAC_RX_0_DMA_START_START_LSB) & GMAC_RX_0_DMA_START_START_MASK) - -#define GMAC_RX_0_BURST_SIZE_ADDRESS 0x00000008 -#define GMAC_RX_0_BURST_SIZE_OFFSET 0x00000008 -#define GMAC_RX_0_BURST_SIZE_BURST_MSB 1 -#define GMAC_RX_0_BURST_SIZE_BURST_LSB 0 -#define GMAC_RX_0_BURST_SIZE_BURST_MASK 0x00000003 -#define GMAC_RX_0_BURST_SIZE_BURST_GET(x) (((x) & GMAC_RX_0_BURST_SIZE_BURST_MASK) >> GMAC_RX_0_BURST_SIZE_BURST_LSB) -#define GMAC_RX_0_BURST_SIZE_BURST_SET(x) (((x) << GMAC_RX_0_BURST_SIZE_BURST_LSB) & GMAC_RX_0_BURST_SIZE_BURST_MASK) - -#define GMAC_RX_0_PKT_OFFSET_ADDRESS 0x0000000c -#define GMAC_RX_0_PKT_OFFSET_OFFSET 0x0000000c -#define GMAC_RX_0_PKT_OFFSET_OFFSET_MSB 7 -#define GMAC_RX_0_PKT_OFFSET_OFFSET_LSB 0 -#define GMAC_RX_0_PKT_OFFSET_OFFSET_MASK 0x000000ff -#define GMAC_RX_0_PKT_OFFSET_OFFSET_GET(x) (((x) & GMAC_RX_0_PKT_OFFSET_OFFSET_MASK) >> GMAC_RX_0_PKT_OFFSET_OFFSET_LSB) -#define GMAC_RX_0_PKT_OFFSET_OFFSET_SET(x) (((x) << GMAC_RX_0_PKT_OFFSET_OFFSET_LSB) & GMAC_RX_0_PKT_OFFSET_OFFSET_MASK) - -#define GMAC_RX_0_CHECKSUM_ADDRESS 0x00000010 -#define GMAC_RX_0_CHECKSUM_OFFSET 0x00000010 -#define GMAC_RX_0_CHECKSUM_UDP_MSB 1 -#define GMAC_RX_0_CHECKSUM_UDP_LSB 1 -#define GMAC_RX_0_CHECKSUM_UDP_MASK 0x00000002 -#define GMAC_RX_0_CHECKSUM_UDP_GET(x) (((x) & GMAC_RX_0_CHECKSUM_UDP_MASK) >> GMAC_RX_0_CHECKSUM_UDP_LSB) -#define GMAC_RX_0_CHECKSUM_UDP_SET(x) (((x) << GMAC_RX_0_CHECKSUM_UDP_LSB) & GMAC_RX_0_CHECKSUM_UDP_MASK) -#define GMAC_RX_0_CHECKSUM_TCP_MSB 0 -#define GMAC_RX_0_CHECKSUM_TCP_LSB 0 -#define GMAC_RX_0_CHECKSUM_TCP_MASK 0x00000001 -#define GMAC_RX_0_CHECKSUM_TCP_GET(x) (((x) & GMAC_RX_0_CHECKSUM_TCP_MASK) >> GMAC_RX_0_CHECKSUM_TCP_LSB) -#define GMAC_RX_0_CHECKSUM_TCP_SET(x) (((x) << GMAC_RX_0_CHECKSUM_TCP_LSB) & GMAC_RX_0_CHECKSUM_TCP_MASK) - -#define GMAC_RX_0_DBG_RX_ADDRESS 0x00000014 -#define GMAC_RX_0_DBG_RX_OFFSET 0x00000014 -#define GMAC_RX_0_DBG_RX_STATE_MSB 3 -#define GMAC_RX_0_DBG_RX_STATE_LSB 0 -#define GMAC_RX_0_DBG_RX_STATE_MASK 0x0000000f -#define GMAC_RX_0_DBG_RX_STATE_GET(x) (((x) & GMAC_RX_0_DBG_RX_STATE_MASK) >> GMAC_RX_0_DBG_RX_STATE_LSB) -#define GMAC_RX_0_DBG_RX_STATE_SET(x) (((x) << GMAC_RX_0_DBG_RX_STATE_LSB) & GMAC_RX_0_DBG_RX_STATE_MASK) - -#define GMAC_RX_0_DBG_RX_CUR_ADDR_ADDRESS 0x00000018 -#define GMAC_RX_0_DBG_RX_CUR_ADDR_OFFSET 0x00000018 -#define GMAC_RX_0_DBG_RX_CUR_ADDR_ADDR_MSB 31 -#define GMAC_RX_0_DBG_RX_CUR_ADDR_ADDR_LSB 0 -#define GMAC_RX_0_DBG_RX_CUR_ADDR_ADDR_MASK 0xffffffff -#define GMAC_RX_0_DBG_RX_CUR_ADDR_ADDR_GET(x) (((x) & GMAC_RX_0_DBG_RX_CUR_ADDR_ADDR_MASK) >> GMAC_RX_0_DBG_RX_CUR_ADDR_ADDR_LSB) -#define GMAC_RX_0_DBG_RX_CUR_ADDR_ADDR_SET(x) (((x) << GMAC_RX_0_DBG_RX_CUR_ADDR_ADDR_LSB) & GMAC_RX_0_DBG_RX_CUR_ADDR_ADDR_MASK) - -#define GMAC_RX_0_DATA_SWAP_ADDRESS 0x0000001c -#define GMAC_RX_0_DATA_SWAP_OFFSET 0x0000001c -#define GMAC_RX_0_DATA_SWAP_SWAPD_MSB 1 -#define GMAC_RX_0_DATA_SWAP_SWAPD_LSB 1 -#define GMAC_RX_0_DATA_SWAP_SWAPD_MASK 0x00000002 -#define GMAC_RX_0_DATA_SWAP_SWAPD_GET(x) (((x) & GMAC_RX_0_DATA_SWAP_SWAPD_MASK) >> GMAC_RX_0_DATA_SWAP_SWAPD_LSB) -#define GMAC_RX_0_DATA_SWAP_SWAPD_SET(x) (((x) << GMAC_RX_0_DATA_SWAP_SWAPD_LSB) & GMAC_RX_0_DATA_SWAP_SWAPD_MASK) -#define GMAC_RX_0_DATA_SWAP_SWAP_MSB 0 -#define GMAC_RX_0_DATA_SWAP_SWAP_LSB 0 -#define GMAC_RX_0_DATA_SWAP_SWAP_MASK 0x00000001 -#define GMAC_RX_0_DATA_SWAP_SWAP_GET(x) (((x) & GMAC_RX_0_DATA_SWAP_SWAP_MASK) >> GMAC_RX_0_DATA_SWAP_SWAP_LSB) -#define GMAC_RX_0_DATA_SWAP_SWAP_SET(x) (((x) << GMAC_RX_0_DATA_SWAP_SWAP_LSB) & GMAC_RX_0_DATA_SWAP_SWAP_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct bridge_chain_gmac_0_rx_reg_reg_s { - volatile unsigned int gmac_rx_0_desc_start_address; - volatile unsigned int gmac_rx_0_dma_start; - volatile unsigned int gmac_rx_0_burst_size; - volatile unsigned int gmac_rx_0_pkt_offset; - volatile unsigned int gmac_rx_0_checksum; - volatile unsigned int gmac_rx_0_dbg_rx; - volatile unsigned int gmac_rx_0_dbg_rx_cur_addr; - volatile unsigned int gmac_rx_0_data_swap; -} bridge_chain_gmac_0_rx_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _BRIDGE_CHAIN_GMAC_0_RX_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_gmac_0_tx_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_gmac_0_tx_reg.h deleted file mode 100644 index 6a9a010b150d..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_gmac_0_tx_reg.h +++ /dev/null @@ -1,118 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _BRIDGE_CHAIN_GMAC_0_TX_REG_REG_H_ -#define _BRIDGE_CHAIN_GMAC_0_TX_REG_REG_H_ - -#define GMAC_TX_0_DESC_START_ADDRESS_ADDRESS 0x00000000 -#define GMAC_TX_0_DESC_START_ADDRESS_OFFSET 0x00000000 -#define GMAC_TX_0_DESC_START_ADDRESS_ADDRESS_MSB 31 -#define GMAC_TX_0_DESC_START_ADDRESS_ADDRESS_LSB 0 -#define GMAC_TX_0_DESC_START_ADDRESS_ADDRESS_MASK 0xffffffff -#define GMAC_TX_0_DESC_START_ADDRESS_ADDRESS_GET(x) (((x) & GMAC_TX_0_DESC_START_ADDRESS_ADDRESS_MASK) >> GMAC_TX_0_DESC_START_ADDRESS_ADDRESS_LSB) -#define GMAC_TX_0_DESC_START_ADDRESS_ADDRESS_SET(x) (((x) << GMAC_TX_0_DESC_START_ADDRESS_ADDRESS_LSB) & GMAC_TX_0_DESC_START_ADDRESS_ADDRESS_MASK) - -#define GMAC_TX_0_DMA_START_ADDRESS 0x00000004 -#define GMAC_TX_0_DMA_START_OFFSET 0x00000004 -#define GMAC_TX_0_DMA_START_RESTART_MSB 4 -#define GMAC_TX_0_DMA_START_RESTART_LSB 4 -#define GMAC_TX_0_DMA_START_RESTART_MASK 0x00000010 -#define GMAC_TX_0_DMA_START_RESTART_GET(x) (((x) & GMAC_TX_0_DMA_START_RESTART_MASK) >> GMAC_TX_0_DMA_START_RESTART_LSB) -#define GMAC_TX_0_DMA_START_RESTART_SET(x) (((x) << GMAC_TX_0_DMA_START_RESTART_LSB) & GMAC_TX_0_DMA_START_RESTART_MASK) -#define GMAC_TX_0_DMA_START_START_MSB 0 -#define GMAC_TX_0_DMA_START_START_LSB 0 -#define GMAC_TX_0_DMA_START_START_MASK 0x00000001 -#define GMAC_TX_0_DMA_START_START_GET(x) (((x) & GMAC_TX_0_DMA_START_START_MASK) >> GMAC_TX_0_DMA_START_START_LSB) -#define GMAC_TX_0_DMA_START_START_SET(x) (((x) << GMAC_TX_0_DMA_START_START_LSB) & GMAC_TX_0_DMA_START_START_MASK) - -#define GMAC_TX_0_INTERRUPT_LIMIT_ADDRESS 0x00000008 -#define GMAC_TX_0_INTERRUPT_LIMIT_OFFSET 0x00000008 -#define GMAC_TX_0_INTERRUPT_LIMIT_TIMEOUT_MSB 15 -#define GMAC_TX_0_INTERRUPT_LIMIT_TIMEOUT_LSB 4 -#define GMAC_TX_0_INTERRUPT_LIMIT_TIMEOUT_MASK 0x0000fff0 -#define GMAC_TX_0_INTERRUPT_LIMIT_TIMEOUT_GET(x) (((x) & GMAC_TX_0_INTERRUPT_LIMIT_TIMEOUT_MASK) >> GMAC_TX_0_INTERRUPT_LIMIT_TIMEOUT_LSB) -#define GMAC_TX_0_INTERRUPT_LIMIT_TIMEOUT_SET(x) (((x) << GMAC_TX_0_INTERRUPT_LIMIT_TIMEOUT_LSB) & GMAC_TX_0_INTERRUPT_LIMIT_TIMEOUT_MASK) -#define GMAC_TX_0_INTERRUPT_LIMIT_COUNT_MSB 3 -#define GMAC_TX_0_INTERRUPT_LIMIT_COUNT_LSB 0 -#define GMAC_TX_0_INTERRUPT_LIMIT_COUNT_MASK 0x0000000f -#define GMAC_TX_0_INTERRUPT_LIMIT_COUNT_GET(x) (((x) & GMAC_TX_0_INTERRUPT_LIMIT_COUNT_MASK) >> GMAC_TX_0_INTERRUPT_LIMIT_COUNT_LSB) -#define GMAC_TX_0_INTERRUPT_LIMIT_COUNT_SET(x) (((x) << GMAC_TX_0_INTERRUPT_LIMIT_COUNT_LSB) & GMAC_TX_0_INTERRUPT_LIMIT_COUNT_MASK) - -#define GMAC_TX_0_BURST_SIZE_ADDRESS 0x0000000c -#define GMAC_TX_0_BURST_SIZE_OFFSET 0x0000000c -#define GMAC_TX_0_BURST_SIZE_BURST_MSB 1 -#define GMAC_TX_0_BURST_SIZE_BURST_LSB 0 -#define GMAC_TX_0_BURST_SIZE_BURST_MASK 0x00000003 -#define GMAC_TX_0_BURST_SIZE_BURST_GET(x) (((x) & GMAC_TX_0_BURST_SIZE_BURST_MASK) >> GMAC_TX_0_BURST_SIZE_BURST_LSB) -#define GMAC_TX_0_BURST_SIZE_BURST_SET(x) (((x) << GMAC_TX_0_BURST_SIZE_BURST_LSB) & GMAC_TX_0_BURST_SIZE_BURST_MASK) - -#define GMAC_TX_0_DBG_TX_ADDRESS 0x00000010 -#define GMAC_TX_0_DBG_TX_OFFSET 0x00000010 -#define GMAC_TX_0_DBG_TX_FIFO_TOTAL_LEN_MSB 31 -#define GMAC_TX_0_DBG_TX_FIFO_TOTAL_LEN_LSB 16 -#define GMAC_TX_0_DBG_TX_FIFO_TOTAL_LEN_MASK 0xffff0000 -#define GMAC_TX_0_DBG_TX_FIFO_TOTAL_LEN_GET(x) (((x) & GMAC_TX_0_DBG_TX_FIFO_TOTAL_LEN_MASK) >> GMAC_TX_0_DBG_TX_FIFO_TOTAL_LEN_LSB) -#define GMAC_TX_0_DBG_TX_FIFO_TOTAL_LEN_SET(x) (((x) << GMAC_TX_0_DBG_TX_FIFO_TOTAL_LEN_LSB) & GMAC_TX_0_DBG_TX_FIFO_TOTAL_LEN_MASK) -#define GMAC_TX_0_DBG_TX_STATE_MSB 2 -#define GMAC_TX_0_DBG_TX_STATE_LSB 0 -#define GMAC_TX_0_DBG_TX_STATE_MASK 0x00000007 -#define GMAC_TX_0_DBG_TX_STATE_GET(x) (((x) & GMAC_TX_0_DBG_TX_STATE_MASK) >> GMAC_TX_0_DBG_TX_STATE_LSB) -#define GMAC_TX_0_DBG_TX_STATE_SET(x) (((x) << GMAC_TX_0_DBG_TX_STATE_LSB) & GMAC_TX_0_DBG_TX_STATE_MASK) - -#define GMAC_TX_0_DBG_TX_CUR_ADDR_ADDRESS 0x00000014 -#define GMAC_TX_0_DBG_TX_CUR_ADDR_OFFSET 0x00000014 -#define GMAC_TX_0_DBG_TX_CUR_ADDR_ADDR_MSB 31 -#define GMAC_TX_0_DBG_TX_CUR_ADDR_ADDR_LSB 0 -#define GMAC_TX_0_DBG_TX_CUR_ADDR_ADDR_MASK 0xffffffff -#define GMAC_TX_0_DBG_TX_CUR_ADDR_ADDR_GET(x) (((x) & GMAC_TX_0_DBG_TX_CUR_ADDR_ADDR_MASK) >> GMAC_TX_0_DBG_TX_CUR_ADDR_ADDR_LSB) -#define GMAC_TX_0_DBG_TX_CUR_ADDR_ADDR_SET(x) (((x) << GMAC_TX_0_DBG_TX_CUR_ADDR_ADDR_LSB) & GMAC_TX_0_DBG_TX_CUR_ADDR_ADDR_MASK) - -#define GMAC_TX_0_DATA_SWAP_ADDRESS 0x00000018 -#define GMAC_TX_0_DATA_SWAP_OFFSET 0x00000018 -#define GMAC_TX_0_DATA_SWAP_SWAPD_MSB 1 -#define GMAC_TX_0_DATA_SWAP_SWAPD_LSB 1 -#define GMAC_TX_0_DATA_SWAP_SWAPD_MASK 0x00000002 -#define GMAC_TX_0_DATA_SWAP_SWAPD_GET(x) (((x) & GMAC_TX_0_DATA_SWAP_SWAPD_MASK) >> GMAC_TX_0_DATA_SWAP_SWAPD_LSB) -#define GMAC_TX_0_DATA_SWAP_SWAPD_SET(x) (((x) << GMAC_TX_0_DATA_SWAP_SWAPD_LSB) & GMAC_TX_0_DATA_SWAP_SWAPD_MASK) -#define GMAC_TX_0_DATA_SWAP_SWAP_MSB 0 -#define GMAC_TX_0_DATA_SWAP_SWAP_LSB 0 -#define GMAC_TX_0_DATA_SWAP_SWAP_MASK 0x00000001 -#define GMAC_TX_0_DATA_SWAP_SWAP_GET(x) (((x) & GMAC_TX_0_DATA_SWAP_SWAP_MASK) >> GMAC_TX_0_DATA_SWAP_SWAP_LSB) -#define GMAC_TX_0_DATA_SWAP_SWAP_SET(x) (((x) << GMAC_TX_0_DATA_SWAP_SWAP_LSB) & GMAC_TX_0_DATA_SWAP_SWAP_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct bridge_chain_gmac_0_tx_reg_reg_s { - volatile unsigned int gmac_tx_0_desc_start_address; - volatile unsigned int gmac_tx_0_dma_start; - volatile unsigned int gmac_tx_0_interrupt_limit; - volatile unsigned int gmac_tx_0_burst_size; - volatile unsigned int gmac_tx_0_dbg_tx; - volatile unsigned int gmac_tx_0_dbg_tx_cur_addr; - volatile unsigned int gmac_tx_0_data_swap; -} bridge_chain_gmac_0_tx_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _BRIDGE_CHAIN_GMAC_0_TX_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_rx_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_rx_reg.h deleted file mode 100644 index 65de67f7b47c..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_rx_reg.h +++ /dev/null @@ -1,122 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _BRIDGE_CHAIN_RX_REG_REG_H_ -#define _BRIDGE_CHAIN_RX_REG_REG_H_ - -#define DESC_START_ADDRESS_ADDRESS 0x00000000 -#define DESC_START_ADDRESS_OFFSET 0x00000000 -#define DESC_START_ADDRESS_ADDRESS_MSB 31 -#define DESC_START_ADDRESS_ADDRESS_LSB 0 -#define DESC_START_ADDRESS_ADDRESS_MASK 0xffffffff -#define DESC_START_ADDRESS_ADDRESS_GET(x) (((x) & DESC_START_ADDRESS_ADDRESS_MASK) >> DESC_START_ADDRESS_ADDRESS_LSB) -#define DESC_START_ADDRESS_ADDRESS_SET(x) (((x) << DESC_START_ADDRESS_ADDRESS_LSB) & DESC_START_ADDRESS_ADDRESS_MASK) - -#define DMA_START_ADDRESS 0x00000004 -#define DMA_START_OFFSET 0x00000004 -#define DMA_START_RESTART_MSB 4 -#define DMA_START_RESTART_LSB 4 -#define DMA_START_RESTART_MASK 0x00000010 -#define DMA_START_RESTART_GET(x) (((x) & DMA_START_RESTART_MASK) >> DMA_START_RESTART_LSB) -#define DMA_START_RESTART_SET(x) (((x) << DMA_START_RESTART_LSB) & DMA_START_RESTART_MASK) -#define DMA_START_START_MSB 0 -#define DMA_START_START_LSB 0 -#define DMA_START_START_MASK 0x00000001 -#define DMA_START_START_GET(x) (((x) & DMA_START_START_MASK) >> DMA_START_START_LSB) -#define DMA_START_START_SET(x) (((x) << DMA_START_START_LSB) & DMA_START_START_MASK) - -#define BURST_SIZE_ADDRESS 0x00000008 -#define BURST_SIZE_OFFSET 0x00000008 -#define BURST_SIZE_BURST_MSB 1 -#define BURST_SIZE_BURST_LSB 0 -#define BURST_SIZE_BURST_MASK 0x00000003 -#define BURST_SIZE_BURST_GET(x) (((x) & BURST_SIZE_BURST_MASK) >> BURST_SIZE_BURST_LSB) -#define BURST_SIZE_BURST_SET(x) (((x) << BURST_SIZE_BURST_LSB) & BURST_SIZE_BURST_MASK) - -#define PKT_OFFSET_ADDRESS 0x0000000c -#define PKT_OFFSET_OFFSET 0x0000000c -#define PKT_OFFSET_OFFSET_MSB 7 -#define PKT_OFFSET_OFFSET_LSB 0 -#define PKT_OFFSET_OFFSET_MASK 0x000000ff -#define PKT_OFFSET_OFFSET_GET(x) (((x) & PKT_OFFSET_OFFSET_MASK) >> PKT_OFFSET_OFFSET_LSB) -#define PKT_OFFSET_OFFSET_SET(x) (((x) << PKT_OFFSET_OFFSET_LSB) & PKT_OFFSET_OFFSET_MASK) - -#define CHECKSUM_ADDRESS 0x00000010 -#define CHECKSUM_OFFSET 0x00000010 -#define CHECKSUM_UDP_MSB 1 -#define CHECKSUM_UDP_LSB 1 -#define CHECKSUM_UDP_MASK 0x00000002 -#define CHECKSUM_UDP_GET(x) (((x) & CHECKSUM_UDP_MASK) >> CHECKSUM_UDP_LSB) -#define CHECKSUM_UDP_SET(x) (((x) << CHECKSUM_UDP_LSB) & CHECKSUM_UDP_MASK) -#define CHECKSUM_TCP_MSB 0 -#define CHECKSUM_TCP_LSB 0 -#define CHECKSUM_TCP_MASK 0x00000001 -#define CHECKSUM_TCP_GET(x) (((x) & CHECKSUM_TCP_MASK) >> CHECKSUM_TCP_LSB) -#define CHECKSUM_TCP_SET(x) (((x) << CHECKSUM_TCP_LSB) & CHECKSUM_TCP_MASK) - -#define DBG_RX_ADDRESS 0x00000014 -#define DBG_RX_OFFSET 0x00000014 -#define DBG_RX_STATE_MSB 3 -#define DBG_RX_STATE_LSB 0 -#define DBG_RX_STATE_MASK 0x0000000f -#define DBG_RX_STATE_GET(x) (((x) & DBG_RX_STATE_MASK) >> DBG_RX_STATE_LSB) -#define DBG_RX_STATE_SET(x) (((x) << DBG_RX_STATE_LSB) & DBG_RX_STATE_MASK) - -#define DBG_RX_CUR_ADDR_ADDRESS 0x00000018 -#define DBG_RX_CUR_ADDR_OFFSET 0x00000018 -#define DBG_RX_CUR_ADDR_ADDR_MSB 31 -#define DBG_RX_CUR_ADDR_ADDR_LSB 0 -#define DBG_RX_CUR_ADDR_ADDR_MASK 0xffffffff -#define DBG_RX_CUR_ADDR_ADDR_GET(x) (((x) & DBG_RX_CUR_ADDR_ADDR_MASK) >> DBG_RX_CUR_ADDR_ADDR_LSB) -#define DBG_RX_CUR_ADDR_ADDR_SET(x) (((x) << DBG_RX_CUR_ADDR_ADDR_LSB) & DBG_RX_CUR_ADDR_ADDR_MASK) - -#define DATA_SWAP_ADDRESS 0x0000001c -#define DATA_SWAP_OFFSET 0x0000001c -#define DATA_SWAP_SWAPD_MSB 1 -#define DATA_SWAP_SWAPD_LSB 1 -#define DATA_SWAP_SWAPD_MASK 0x00000002 -#define DATA_SWAP_SWAPD_GET(x) (((x) & DATA_SWAP_SWAPD_MASK) >> DATA_SWAP_SWAPD_LSB) -#define DATA_SWAP_SWAPD_SET(x) (((x) << DATA_SWAP_SWAPD_LSB) & DATA_SWAP_SWAPD_MASK) -#define DATA_SWAP_SWAP_MSB 0 -#define DATA_SWAP_SWAP_LSB 0 -#define DATA_SWAP_SWAP_MASK 0x00000001 -#define DATA_SWAP_SWAP_GET(x) (((x) & DATA_SWAP_SWAP_MASK) >> DATA_SWAP_SWAP_LSB) -#define DATA_SWAP_SWAP_SET(x) (((x) << DATA_SWAP_SWAP_LSB) & DATA_SWAP_SWAP_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct bridge_chain_rx_reg_reg_s { - volatile unsigned int desc_start_address; - volatile unsigned int dma_start; - volatile unsigned int burst_size; - volatile unsigned int pkt_offset; - volatile unsigned int checksum; - volatile unsigned int dbg_rx; - volatile unsigned int dbg_rx_cur_addr; - volatile unsigned int data_swap; -} bridge_chain_rx_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _BRIDGE_CHAIN_RX_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_tx_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_tx_reg.h deleted file mode 100644 index b837bcc57745..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_chain_tx_reg.h +++ /dev/null @@ -1,118 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _BRIDGE_CHAIN_TX_REG_REG_H_ -#define _BRIDGE_CHAIN_TX_REG_REG_H_ - -#define DESC_START_ADDRESS_ADDRESS 0x00000000 -#define DESC_START_ADDRESS_OFFSET 0x00000000 -#define DESC_START_ADDRESS_ADDRESS_MSB 31 -#define DESC_START_ADDRESS_ADDRESS_LSB 0 -#define DESC_START_ADDRESS_ADDRESS_MASK 0xffffffff -#define DESC_START_ADDRESS_ADDRESS_GET(x) (((x) & DESC_START_ADDRESS_ADDRESS_MASK) >> DESC_START_ADDRESS_ADDRESS_LSB) -#define DESC_START_ADDRESS_ADDRESS_SET(x) (((x) << DESC_START_ADDRESS_ADDRESS_LSB) & DESC_START_ADDRESS_ADDRESS_MASK) - -#define DMA_START_ADDRESS 0x00000004 -#define DMA_START_OFFSET 0x00000004 -#define DMA_START_RESTART_MSB 4 -#define DMA_START_RESTART_LSB 4 -#define DMA_START_RESTART_MASK 0x00000010 -#define DMA_START_RESTART_GET(x) (((x) & DMA_START_RESTART_MASK) >> DMA_START_RESTART_LSB) -#define DMA_START_RESTART_SET(x) (((x) << DMA_START_RESTART_LSB) & DMA_START_RESTART_MASK) -#define DMA_START_START_MSB 0 -#define DMA_START_START_LSB 0 -#define DMA_START_START_MASK 0x00000001 -#define DMA_START_START_GET(x) (((x) & DMA_START_START_MASK) >> DMA_START_START_LSB) -#define DMA_START_START_SET(x) (((x) << DMA_START_START_LSB) & DMA_START_START_MASK) - -#define INTERRUPT_LIMIT_ADDRESS 0x00000008 -#define INTERRUPT_LIMIT_OFFSET 0x00000008 -#define INTERRUPT_LIMIT_TIMEOUT_MSB 15 -#define INTERRUPT_LIMIT_TIMEOUT_LSB 4 -#define INTERRUPT_LIMIT_TIMEOUT_MASK 0x0000fff0 -#define INTERRUPT_LIMIT_TIMEOUT_GET(x) (((x) & INTERRUPT_LIMIT_TIMEOUT_MASK) >> INTERRUPT_LIMIT_TIMEOUT_LSB) -#define INTERRUPT_LIMIT_TIMEOUT_SET(x) (((x) << INTERRUPT_LIMIT_TIMEOUT_LSB) & INTERRUPT_LIMIT_TIMEOUT_MASK) -#define INTERRUPT_LIMIT_COUNT_MSB 3 -#define INTERRUPT_LIMIT_COUNT_LSB 0 -#define INTERRUPT_LIMIT_COUNT_MASK 0x0000000f -#define INTERRUPT_LIMIT_COUNT_GET(x) (((x) & INTERRUPT_LIMIT_COUNT_MASK) >> INTERRUPT_LIMIT_COUNT_LSB) -#define INTERRUPT_LIMIT_COUNT_SET(x) (((x) << INTERRUPT_LIMIT_COUNT_LSB) & INTERRUPT_LIMIT_COUNT_MASK) - -#define BURST_SIZE_ADDRESS 0x0000000c -#define BURST_SIZE_OFFSET 0x0000000c -#define BURST_SIZE_BURST_MSB 1 -#define BURST_SIZE_BURST_LSB 0 -#define BURST_SIZE_BURST_MASK 0x00000003 -#define BURST_SIZE_BURST_GET(x) (((x) & BURST_SIZE_BURST_MASK) >> BURST_SIZE_BURST_LSB) -#define BURST_SIZE_BURST_SET(x) (((x) << BURST_SIZE_BURST_LSB) & BURST_SIZE_BURST_MASK) - -#define DBG_TX_ADDRESS 0x00000010 -#define DBG_TX_OFFSET 0x00000010 -#define DBG_TX_FIFO_TOTAL_LEN_MSB 31 -#define DBG_TX_FIFO_TOTAL_LEN_LSB 16 -#define DBG_TX_FIFO_TOTAL_LEN_MASK 0xffff0000 -#define DBG_TX_FIFO_TOTAL_LEN_GET(x) (((x) & DBG_TX_FIFO_TOTAL_LEN_MASK) >> DBG_TX_FIFO_TOTAL_LEN_LSB) -#define DBG_TX_FIFO_TOTAL_LEN_SET(x) (((x) << DBG_TX_FIFO_TOTAL_LEN_LSB) & DBG_TX_FIFO_TOTAL_LEN_MASK) -#define DBG_TX_STATE_MSB 2 -#define DBG_TX_STATE_LSB 0 -#define DBG_TX_STATE_MASK 0x00000007 -#define DBG_TX_STATE_GET(x) (((x) & DBG_TX_STATE_MASK) >> DBG_TX_STATE_LSB) -#define DBG_TX_STATE_SET(x) (((x) << DBG_TX_STATE_LSB) & DBG_TX_STATE_MASK) - -#define DBG_TX_CUR_ADDR_ADDRESS 0x00000014 -#define DBG_TX_CUR_ADDR_OFFSET 0x00000014 -#define DBG_TX_CUR_ADDR_ADDR_MSB 31 -#define DBG_TX_CUR_ADDR_ADDR_LSB 0 -#define DBG_TX_CUR_ADDR_ADDR_MASK 0xffffffff -#define DBG_TX_CUR_ADDR_ADDR_GET(x) (((x) & DBG_TX_CUR_ADDR_ADDR_MASK) >> DBG_TX_CUR_ADDR_ADDR_LSB) -#define DBG_TX_CUR_ADDR_ADDR_SET(x) (((x) << DBG_TX_CUR_ADDR_ADDR_LSB) & DBG_TX_CUR_ADDR_ADDR_MASK) - -#define DATA_SWAP_ADDRESS 0x00000018 -#define DATA_SWAP_OFFSET 0x00000018 -#define DATA_SWAP_SWAPD_MSB 1 -#define DATA_SWAP_SWAPD_LSB 1 -#define DATA_SWAP_SWAPD_MASK 0x00000002 -#define DATA_SWAP_SWAPD_GET(x) (((x) & DATA_SWAP_SWAPD_MASK) >> DATA_SWAP_SWAPD_LSB) -#define DATA_SWAP_SWAPD_SET(x) (((x) << DATA_SWAP_SWAPD_LSB) & DATA_SWAP_SWAPD_MASK) -#define DATA_SWAP_SWAP_MSB 0 -#define DATA_SWAP_SWAP_LSB 0 -#define DATA_SWAP_SWAP_MASK 0x00000001 -#define DATA_SWAP_SWAP_GET(x) (((x) & DATA_SWAP_SWAP_MASK) >> DATA_SWAP_SWAP_LSB) -#define DATA_SWAP_SWAP_SET(x) (((x) << DATA_SWAP_SWAP_LSB) & DATA_SWAP_SWAP_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct bridge_chain_tx_reg_reg_s { - volatile unsigned int desc_start_address; - volatile unsigned int dma_start; - volatile unsigned int interrupt_limit; - volatile unsigned int burst_size; - volatile unsigned int dbg_tx; - volatile unsigned int dbg_tx_cur_addr; - volatile unsigned int data_swap; -} bridge_chain_tx_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _BRIDGE_CHAIN_TX_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_intr_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_intr_reg.h deleted file mode 100644 index 905aaac640fd..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_intr_reg.h +++ /dev/null @@ -1,363 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _BRIDGE_INTR_REG_REG_H_ -#define _BRIDGE_INTR_REG_REG_H_ - -#define INTERRUPT_ADDRESS 0x00000000 -#define INTERRUPT_OFFSET 0x00000000 -#define INTERRUPT_TX_7_END_MSB 31 -#define INTERRUPT_TX_7_END_LSB 31 -#define INTERRUPT_TX_7_END_MASK 0x80000000 -#define INTERRUPT_TX_7_END_GET(x) (((x) & INTERRUPT_TX_7_END_MASK) >> INTERRUPT_TX_7_END_LSB) -#define INTERRUPT_TX_7_END_SET(x) (((x) << INTERRUPT_TX_7_END_LSB) & INTERRUPT_TX_7_END_MASK) -#define INTERRUPT_TX_6_END_MSB 30 -#define INTERRUPT_TX_6_END_LSB 30 -#define INTERRUPT_TX_6_END_MASK 0x40000000 -#define INTERRUPT_TX_6_END_GET(x) (((x) & INTERRUPT_TX_6_END_MASK) >> INTERRUPT_TX_6_END_LSB) -#define INTERRUPT_TX_6_END_SET(x) (((x) << INTERRUPT_TX_6_END_LSB) & INTERRUPT_TX_6_END_MASK) -#define INTERRUPT_TX_5_END_MSB 29 -#define INTERRUPT_TX_5_END_LSB 29 -#define INTERRUPT_TX_5_END_MASK 0x20000000 -#define INTERRUPT_TX_5_END_GET(x) (((x) & INTERRUPT_TX_5_END_MASK) >> INTERRUPT_TX_5_END_LSB) -#define INTERRUPT_TX_5_END_SET(x) (((x) << INTERRUPT_TX_5_END_LSB) & INTERRUPT_TX_5_END_MASK) -#define INTERRUPT_TX_4_END_MSB 28 -#define INTERRUPT_TX_4_END_LSB 28 -#define INTERRUPT_TX_4_END_MASK 0x10000000 -#define INTERRUPT_TX_4_END_GET(x) (((x) & INTERRUPT_TX_4_END_MASK) >> INTERRUPT_TX_4_END_LSB) -#define INTERRUPT_TX_4_END_SET(x) (((x) << INTERRUPT_TX_4_END_LSB) & INTERRUPT_TX_4_END_MASK) -#define INTERRUPT_TX_3_END_MSB 27 -#define INTERRUPT_TX_3_END_LSB 27 -#define INTERRUPT_TX_3_END_MASK 0x08000000 -#define INTERRUPT_TX_3_END_GET(x) (((x) & INTERRUPT_TX_3_END_MASK) >> INTERRUPT_TX_3_END_LSB) -#define INTERRUPT_TX_3_END_SET(x) (((x) << INTERRUPT_TX_3_END_LSB) & INTERRUPT_TX_3_END_MASK) -#define INTERRUPT_TX_2_END_MSB 26 -#define INTERRUPT_TX_2_END_LSB 26 -#define INTERRUPT_TX_2_END_MASK 0x04000000 -#define INTERRUPT_TX_2_END_GET(x) (((x) & INTERRUPT_TX_2_END_MASK) >> INTERRUPT_TX_2_END_LSB) -#define INTERRUPT_TX_2_END_SET(x) (((x) << INTERRUPT_TX_2_END_LSB) & INTERRUPT_TX_2_END_MASK) -#define INTERRUPT_TX_1_END_MSB 25 -#define INTERRUPT_TX_1_END_LSB 25 -#define INTERRUPT_TX_1_END_MASK 0x02000000 -#define INTERRUPT_TX_1_END_GET(x) (((x) & INTERRUPT_TX_1_END_MASK) >> INTERRUPT_TX_1_END_LSB) -#define INTERRUPT_TX_1_END_SET(x) (((x) << INTERRUPT_TX_1_END_LSB) & INTERRUPT_TX_1_END_MASK) -#define INTERRUPT_TX_0_END_MSB 24 -#define INTERRUPT_TX_0_END_LSB 24 -#define INTERRUPT_TX_0_END_MASK 0x01000000 -#define INTERRUPT_TX_0_END_GET(x) (((x) & INTERRUPT_TX_0_END_MASK) >> INTERRUPT_TX_0_END_LSB) -#define INTERRUPT_TX_0_END_SET(x) (((x) << INTERRUPT_TX_0_END_LSB) & INTERRUPT_TX_0_END_MASK) -#define INTERRUPT_TX_7_COMPLETE_MSB 23 -#define INTERRUPT_TX_7_COMPLETE_LSB 23 -#define INTERRUPT_TX_7_COMPLETE_MASK 0x00800000 -#define INTERRUPT_TX_7_COMPLETE_GET(x) (((x) & INTERRUPT_TX_7_COMPLETE_MASK) >> INTERRUPT_TX_7_COMPLETE_LSB) -#define INTERRUPT_TX_7_COMPLETE_SET(x) (((x) << INTERRUPT_TX_7_COMPLETE_LSB) & INTERRUPT_TX_7_COMPLETE_MASK) -#define INTERRUPT_TX_6_COMPLETE_MSB 22 -#define INTERRUPT_TX_6_COMPLETE_LSB 22 -#define INTERRUPT_TX_6_COMPLETE_MASK 0x00400000 -#define INTERRUPT_TX_6_COMPLETE_GET(x) (((x) & INTERRUPT_TX_6_COMPLETE_MASK) >> INTERRUPT_TX_6_COMPLETE_LSB) -#define INTERRUPT_TX_6_COMPLETE_SET(x) (((x) << INTERRUPT_TX_6_COMPLETE_LSB) & INTERRUPT_TX_6_COMPLETE_MASK) -#define INTERRUPT_TX_5_COMPLETE_MSB 21 -#define INTERRUPT_TX_5_COMPLETE_LSB 21 -#define INTERRUPT_TX_5_COMPLETE_MASK 0x00200000 -#define INTERRUPT_TX_5_COMPLETE_GET(x) (((x) & INTERRUPT_TX_5_COMPLETE_MASK) >> INTERRUPT_TX_5_COMPLETE_LSB) -#define INTERRUPT_TX_5_COMPLETE_SET(x) (((x) << INTERRUPT_TX_5_COMPLETE_LSB) & INTERRUPT_TX_5_COMPLETE_MASK) -#define INTERRUPT_TX_4_COMPLETE_MSB 20 -#define INTERRUPT_TX_4_COMPLETE_LSB 20 -#define INTERRUPT_TX_4_COMPLETE_MASK 0x00100000 -#define INTERRUPT_TX_4_COMPLETE_GET(x) (((x) & INTERRUPT_TX_4_COMPLETE_MASK) >> INTERRUPT_TX_4_COMPLETE_LSB) -#define INTERRUPT_TX_4_COMPLETE_SET(x) (((x) << INTERRUPT_TX_4_COMPLETE_LSB) & INTERRUPT_TX_4_COMPLETE_MASK) -#define INTERRUPT_TX_3_COMPLETE_MSB 19 -#define INTERRUPT_TX_3_COMPLETE_LSB 19 -#define INTERRUPT_TX_3_COMPLETE_MASK 0x00080000 -#define INTERRUPT_TX_3_COMPLETE_GET(x) (((x) & INTERRUPT_TX_3_COMPLETE_MASK) >> INTERRUPT_TX_3_COMPLETE_LSB) -#define INTERRUPT_TX_3_COMPLETE_SET(x) (((x) << INTERRUPT_TX_3_COMPLETE_LSB) & INTERRUPT_TX_3_COMPLETE_MASK) -#define INTERRUPT_TX_2_COMPLETE_MSB 18 -#define INTERRUPT_TX_2_COMPLETE_LSB 18 -#define INTERRUPT_TX_2_COMPLETE_MASK 0x00040000 -#define INTERRUPT_TX_2_COMPLETE_GET(x) (((x) & INTERRUPT_TX_2_COMPLETE_MASK) >> INTERRUPT_TX_2_COMPLETE_LSB) -#define INTERRUPT_TX_2_COMPLETE_SET(x) (((x) << INTERRUPT_TX_2_COMPLETE_LSB) & INTERRUPT_TX_2_COMPLETE_MASK) -#define INTERRUPT_TX_1_COMPLETE_MSB 17 -#define INTERRUPT_TX_1_COMPLETE_LSB 17 -#define INTERRUPT_TX_1_COMPLETE_MASK 0x00020000 -#define INTERRUPT_TX_1_COMPLETE_GET(x) (((x) & INTERRUPT_TX_1_COMPLETE_MASK) >> INTERRUPT_TX_1_COMPLETE_LSB) -#define INTERRUPT_TX_1_COMPLETE_SET(x) (((x) << INTERRUPT_TX_1_COMPLETE_LSB) & INTERRUPT_TX_1_COMPLETE_MASK) -#define INTERRUPT_TX_0_COMPLETE_MSB 16 -#define INTERRUPT_TX_0_COMPLETE_LSB 16 -#define INTERRUPT_TX_0_COMPLETE_MASK 0x00010000 -#define INTERRUPT_TX_0_COMPLETE_GET(x) (((x) & INTERRUPT_TX_0_COMPLETE_MASK) >> INTERRUPT_TX_0_COMPLETE_LSB) -#define INTERRUPT_TX_0_COMPLETE_SET(x) (((x) << INTERRUPT_TX_0_COMPLETE_LSB) & INTERRUPT_TX_0_COMPLETE_MASK) -#define INTERRUPT_RX_7_END_MSB 15 -#define INTERRUPT_RX_7_END_LSB 15 -#define INTERRUPT_RX_7_END_MASK 0x00008000 -#define INTERRUPT_RX_7_END_GET(x) (((x) & INTERRUPT_RX_7_END_MASK) >> INTERRUPT_RX_7_END_LSB) -#define INTERRUPT_RX_7_END_SET(x) (((x) << INTERRUPT_RX_7_END_LSB) & INTERRUPT_RX_7_END_MASK) -#define INTERRUPT_RX_6_END_MSB 14 -#define INTERRUPT_RX_6_END_LSB 14 -#define INTERRUPT_RX_6_END_MASK 0x00004000 -#define INTERRUPT_RX_6_END_GET(x) (((x) & INTERRUPT_RX_6_END_MASK) >> INTERRUPT_RX_6_END_LSB) -#define INTERRUPT_RX_6_END_SET(x) (((x) << INTERRUPT_RX_6_END_LSB) & INTERRUPT_RX_6_END_MASK) -#define INTERRUPT_RX_5_END_MSB 13 -#define INTERRUPT_RX_5_END_LSB 13 -#define INTERRUPT_RX_5_END_MASK 0x00002000 -#define INTERRUPT_RX_5_END_GET(x) (((x) & INTERRUPT_RX_5_END_MASK) >> INTERRUPT_RX_5_END_LSB) -#define INTERRUPT_RX_5_END_SET(x) (((x) << INTERRUPT_RX_5_END_LSB) & INTERRUPT_RX_5_END_MASK) -#define INTERRUPT_RX_4_END_MSB 12 -#define INTERRUPT_RX_4_END_LSB 12 -#define INTERRUPT_RX_4_END_MASK 0x00001000 -#define INTERRUPT_RX_4_END_GET(x) (((x) & INTERRUPT_RX_4_END_MASK) >> INTERRUPT_RX_4_END_LSB) -#define INTERRUPT_RX_4_END_SET(x) (((x) << INTERRUPT_RX_4_END_LSB) & INTERRUPT_RX_4_END_MASK) -#define INTERRUPT_RX_3_END_MSB 11 -#define INTERRUPT_RX_3_END_LSB 11 -#define INTERRUPT_RX_3_END_MASK 0x00000800 -#define INTERRUPT_RX_3_END_GET(x) (((x) & INTERRUPT_RX_3_END_MASK) >> INTERRUPT_RX_3_END_LSB) -#define INTERRUPT_RX_3_END_SET(x) (((x) << INTERRUPT_RX_3_END_LSB) & INTERRUPT_RX_3_END_MASK) -#define INTERRUPT_RX_2_END_MSB 10 -#define INTERRUPT_RX_2_END_LSB 10 -#define INTERRUPT_RX_2_END_MASK 0x00000400 -#define INTERRUPT_RX_2_END_GET(x) (((x) & INTERRUPT_RX_2_END_MASK) >> INTERRUPT_RX_2_END_LSB) -#define INTERRUPT_RX_2_END_SET(x) (((x) << INTERRUPT_RX_2_END_LSB) & INTERRUPT_RX_2_END_MASK) -#define INTERRUPT_RX_1_END_MSB 9 -#define INTERRUPT_RX_1_END_LSB 9 -#define INTERRUPT_RX_1_END_MASK 0x00000200 -#define INTERRUPT_RX_1_END_GET(x) (((x) & INTERRUPT_RX_1_END_MASK) >> INTERRUPT_RX_1_END_LSB) -#define INTERRUPT_RX_1_END_SET(x) (((x) << INTERRUPT_RX_1_END_LSB) & INTERRUPT_RX_1_END_MASK) -#define INTERRUPT_RX_0_END_MSB 8 -#define INTERRUPT_RX_0_END_LSB 8 -#define INTERRUPT_RX_0_END_MASK 0x00000100 -#define INTERRUPT_RX_0_END_GET(x) (((x) & INTERRUPT_RX_0_END_MASK) >> INTERRUPT_RX_0_END_LSB) -#define INTERRUPT_RX_0_END_SET(x) (((x) << INTERRUPT_RX_0_END_LSB) & INTERRUPT_RX_0_END_MASK) -#define INTERRUPT_RX_7_COMPLETE_MSB 7 -#define INTERRUPT_RX_7_COMPLETE_LSB 7 -#define INTERRUPT_RX_7_COMPLETE_MASK 0x00000080 -#define INTERRUPT_RX_7_COMPLETE_GET(x) (((x) & INTERRUPT_RX_7_COMPLETE_MASK) >> INTERRUPT_RX_7_COMPLETE_LSB) -#define INTERRUPT_RX_7_COMPLETE_SET(x) (((x) << INTERRUPT_RX_7_COMPLETE_LSB) & INTERRUPT_RX_7_COMPLETE_MASK) -#define INTERRUPT_RX_6_COMPLETE_MSB 6 -#define INTERRUPT_RX_6_COMPLETE_LSB 6 -#define INTERRUPT_RX_6_COMPLETE_MASK 0x00000040 -#define INTERRUPT_RX_6_COMPLETE_GET(x) (((x) & INTERRUPT_RX_6_COMPLETE_MASK) >> INTERRUPT_RX_6_COMPLETE_LSB) -#define INTERRUPT_RX_6_COMPLETE_SET(x) (((x) << INTERRUPT_RX_6_COMPLETE_LSB) & INTERRUPT_RX_6_COMPLETE_MASK) -#define INTERRUPT_RX_5_COMPLETE_MSB 5 -#define INTERRUPT_RX_5_COMPLETE_LSB 5 -#define INTERRUPT_RX_5_COMPLETE_MASK 0x00000020 -#define INTERRUPT_RX_5_COMPLETE_GET(x) (((x) & INTERRUPT_RX_5_COMPLETE_MASK) >> INTERRUPT_RX_5_COMPLETE_LSB) -#define INTERRUPT_RX_5_COMPLETE_SET(x) (((x) << INTERRUPT_RX_5_COMPLETE_LSB) & INTERRUPT_RX_5_COMPLETE_MASK) -#define INTERRUPT_RX_4_COMPLETE_MSB 4 -#define INTERRUPT_RX_4_COMPLETE_LSB 4 -#define INTERRUPT_RX_4_COMPLETE_MASK 0x00000010 -#define INTERRUPT_RX_4_COMPLETE_GET(x) (((x) & INTERRUPT_RX_4_COMPLETE_MASK) >> INTERRUPT_RX_4_COMPLETE_LSB) -#define INTERRUPT_RX_4_COMPLETE_SET(x) (((x) << INTERRUPT_RX_4_COMPLETE_LSB) & INTERRUPT_RX_4_COMPLETE_MASK) -#define INTERRUPT_RX_3_COMPLETE_MSB 3 -#define INTERRUPT_RX_3_COMPLETE_LSB 3 -#define INTERRUPT_RX_3_COMPLETE_MASK 0x00000008 -#define INTERRUPT_RX_3_COMPLETE_GET(x) (((x) & INTERRUPT_RX_3_COMPLETE_MASK) >> INTERRUPT_RX_3_COMPLETE_LSB) -#define INTERRUPT_RX_3_COMPLETE_SET(x) (((x) << INTERRUPT_RX_3_COMPLETE_LSB) & INTERRUPT_RX_3_COMPLETE_MASK) -#define INTERRUPT_RX_2_COMPLETE_MSB 2 -#define INTERRUPT_RX_2_COMPLETE_LSB 2 -#define INTERRUPT_RX_2_COMPLETE_MASK 0x00000004 -#define INTERRUPT_RX_2_COMPLETE_GET(x) (((x) & INTERRUPT_RX_2_COMPLETE_MASK) >> INTERRUPT_RX_2_COMPLETE_LSB) -#define INTERRUPT_RX_2_COMPLETE_SET(x) (((x) << INTERRUPT_RX_2_COMPLETE_LSB) & INTERRUPT_RX_2_COMPLETE_MASK) -#define INTERRUPT_RX_1_COMPLETE_MSB 1 -#define INTERRUPT_RX_1_COMPLETE_LSB 1 -#define INTERRUPT_RX_1_COMPLETE_MASK 0x00000002 -#define INTERRUPT_RX_1_COMPLETE_GET(x) (((x) & INTERRUPT_RX_1_COMPLETE_MASK) >> INTERRUPT_RX_1_COMPLETE_LSB) -#define INTERRUPT_RX_1_COMPLETE_SET(x) (((x) << INTERRUPT_RX_1_COMPLETE_LSB) & INTERRUPT_RX_1_COMPLETE_MASK) -#define INTERRUPT_RX_0_COMPLETE_MSB 0 -#define INTERRUPT_RX_0_COMPLETE_LSB 0 -#define INTERRUPT_RX_0_COMPLETE_MASK 0x00000001 -#define INTERRUPT_RX_0_COMPLETE_GET(x) (((x) & INTERRUPT_RX_0_COMPLETE_MASK) >> INTERRUPT_RX_0_COMPLETE_LSB) -#define INTERRUPT_RX_0_COMPLETE_SET(x) (((x) << INTERRUPT_RX_0_COMPLETE_LSB) & INTERRUPT_RX_0_COMPLETE_MASK) - -#define INTERRUPT_MASK_ADDRESS 0x00000004 -#define INTERRUPT_MASK_OFFSET 0x00000004 -#define INTERRUPT_MASK_TX_7_END_MASK_MSB 31 -#define INTERRUPT_MASK_TX_7_END_MASK_LSB 31 -#define INTERRUPT_MASK_TX_7_END_MASK_MASK 0x80000000 -#define INTERRUPT_MASK_TX_7_END_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_7_END_MASK_MASK) >> INTERRUPT_MASK_TX_7_END_MASK_LSB) -#define INTERRUPT_MASK_TX_7_END_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_7_END_MASK_LSB) & INTERRUPT_MASK_TX_7_END_MASK_MASK) -#define INTERRUPT_MASK_TX_6_END_MASK_MSB 30 -#define INTERRUPT_MASK_TX_6_END_MASK_LSB 30 -#define INTERRUPT_MASK_TX_6_END_MASK_MASK 0x40000000 -#define INTERRUPT_MASK_TX_6_END_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_6_END_MASK_MASK) >> INTERRUPT_MASK_TX_6_END_MASK_LSB) -#define INTERRUPT_MASK_TX_6_END_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_6_END_MASK_LSB) & INTERRUPT_MASK_TX_6_END_MASK_MASK) -#define INTERRUPT_MASK_TX_5_END_MASK_MSB 29 -#define INTERRUPT_MASK_TX_5_END_MASK_LSB 29 -#define INTERRUPT_MASK_TX_5_END_MASK_MASK 0x20000000 -#define INTERRUPT_MASK_TX_5_END_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_5_END_MASK_MASK) >> INTERRUPT_MASK_TX_5_END_MASK_LSB) -#define INTERRUPT_MASK_TX_5_END_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_5_END_MASK_LSB) & INTERRUPT_MASK_TX_5_END_MASK_MASK) -#define INTERRUPT_MASK_TX_4_END_MASK_MSB 28 -#define INTERRUPT_MASK_TX_4_END_MASK_LSB 28 -#define INTERRUPT_MASK_TX_4_END_MASK_MASK 0x10000000 -#define INTERRUPT_MASK_TX_4_END_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_4_END_MASK_MASK) >> INTERRUPT_MASK_TX_4_END_MASK_LSB) -#define INTERRUPT_MASK_TX_4_END_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_4_END_MASK_LSB) & INTERRUPT_MASK_TX_4_END_MASK_MASK) -#define INTERRUPT_MASK_TX_3_END_MASK_MSB 27 -#define INTERRUPT_MASK_TX_3_END_MASK_LSB 27 -#define INTERRUPT_MASK_TX_3_END_MASK_MASK 0x08000000 -#define INTERRUPT_MASK_TX_3_END_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_3_END_MASK_MASK) >> INTERRUPT_MASK_TX_3_END_MASK_LSB) -#define INTERRUPT_MASK_TX_3_END_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_3_END_MASK_LSB) & INTERRUPT_MASK_TX_3_END_MASK_MASK) -#define INTERRUPT_MASK_TX_2_END_MASK_MSB 26 -#define INTERRUPT_MASK_TX_2_END_MASK_LSB 26 -#define INTERRUPT_MASK_TX_2_END_MASK_MASK 0x04000000 -#define INTERRUPT_MASK_TX_2_END_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_2_END_MASK_MASK) >> INTERRUPT_MASK_TX_2_END_MASK_LSB) -#define INTERRUPT_MASK_TX_2_END_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_2_END_MASK_LSB) & INTERRUPT_MASK_TX_2_END_MASK_MASK) -#define INTERRUPT_MASK_TX_1_END_MASK_MSB 25 -#define INTERRUPT_MASK_TX_1_END_MASK_LSB 25 -#define INTERRUPT_MASK_TX_1_END_MASK_MASK 0x02000000 -#define INTERRUPT_MASK_TX_1_END_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_1_END_MASK_MASK) >> INTERRUPT_MASK_TX_1_END_MASK_LSB) -#define INTERRUPT_MASK_TX_1_END_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_1_END_MASK_LSB) & INTERRUPT_MASK_TX_1_END_MASK_MASK) -#define INTERRUPT_MASK_TX_0_END_MASK_MSB 24 -#define INTERRUPT_MASK_TX_0_END_MASK_LSB 24 -#define INTERRUPT_MASK_TX_0_END_MASK_MASK 0x01000000 -#define INTERRUPT_MASK_TX_0_END_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_0_END_MASK_MASK) >> INTERRUPT_MASK_TX_0_END_MASK_LSB) -#define INTERRUPT_MASK_TX_0_END_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_0_END_MASK_LSB) & INTERRUPT_MASK_TX_0_END_MASK_MASK) -#define INTERRUPT_MASK_TX_7_COMPLETE_MASK_MSB 23 -#define INTERRUPT_MASK_TX_7_COMPLETE_MASK_LSB 23 -#define INTERRUPT_MASK_TX_7_COMPLETE_MASK_MASK 0x00800000 -#define INTERRUPT_MASK_TX_7_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_7_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_TX_7_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_TX_7_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_7_COMPLETE_MASK_LSB) & INTERRUPT_MASK_TX_7_COMPLETE_MASK_MASK) -#define INTERRUPT_MASK_TX_6_COMPLETE_MASK_MSB 22 -#define INTERRUPT_MASK_TX_6_COMPLETE_MASK_LSB 22 -#define INTERRUPT_MASK_TX_6_COMPLETE_MASK_MASK 0x00400000 -#define INTERRUPT_MASK_TX_6_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_6_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_TX_6_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_TX_6_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_6_COMPLETE_MASK_LSB) & INTERRUPT_MASK_TX_6_COMPLETE_MASK_MASK) -#define INTERRUPT_MASK_TX_5_COMPLETE_MASK_MSB 21 -#define INTERRUPT_MASK_TX_5_COMPLETE_MASK_LSB 21 -#define INTERRUPT_MASK_TX_5_COMPLETE_MASK_MASK 0x00200000 -#define INTERRUPT_MASK_TX_5_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_5_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_TX_5_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_TX_5_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_5_COMPLETE_MASK_LSB) & INTERRUPT_MASK_TX_5_COMPLETE_MASK_MASK) -#define INTERRUPT_MASK_TX_4_COMPLETE_MASK_MSB 20 -#define INTERRUPT_MASK_TX_4_COMPLETE_MASK_LSB 20 -#define INTERRUPT_MASK_TX_4_COMPLETE_MASK_MASK 0x00100000 -#define INTERRUPT_MASK_TX_4_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_4_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_TX_4_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_TX_4_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_4_COMPLETE_MASK_LSB) & INTERRUPT_MASK_TX_4_COMPLETE_MASK_MASK) -#define INTERRUPT_MASK_TX_3_COMPLETE_MASK_MSB 19 -#define INTERRUPT_MASK_TX_3_COMPLETE_MASK_LSB 19 -#define INTERRUPT_MASK_TX_3_COMPLETE_MASK_MASK 0x00080000 -#define INTERRUPT_MASK_TX_3_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_3_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_TX_3_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_TX_3_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_3_COMPLETE_MASK_LSB) & INTERRUPT_MASK_TX_3_COMPLETE_MASK_MASK) -#define INTERRUPT_MASK_TX_2_COMPLETE_MASK_MSB 18 -#define INTERRUPT_MASK_TX_2_COMPLETE_MASK_LSB 18 -#define INTERRUPT_MASK_TX_2_COMPLETE_MASK_MASK 0x00040000 -#define INTERRUPT_MASK_TX_2_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_2_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_TX_2_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_TX_2_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_2_COMPLETE_MASK_LSB) & INTERRUPT_MASK_TX_2_COMPLETE_MASK_MASK) -#define INTERRUPT_MASK_TX_1_COMPLETE_MASK_MSB 17 -#define INTERRUPT_MASK_TX_1_COMPLETE_MASK_LSB 17 -#define INTERRUPT_MASK_TX_1_COMPLETE_MASK_MASK 0x00020000 -#define INTERRUPT_MASK_TX_1_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_1_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_TX_1_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_TX_1_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_1_COMPLETE_MASK_LSB) & INTERRUPT_MASK_TX_1_COMPLETE_MASK_MASK) -#define INTERRUPT_MASK_TX_0_COMPLETE_MASK_MSB 16 -#define INTERRUPT_MASK_TX_0_COMPLETE_MASK_LSB 16 -#define INTERRUPT_MASK_TX_0_COMPLETE_MASK_MASK 0x00010000 -#define INTERRUPT_MASK_TX_0_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_TX_0_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_TX_0_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_TX_0_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_TX_0_COMPLETE_MASK_LSB) & INTERRUPT_MASK_TX_0_COMPLETE_MASK_MASK) -#define INTERRUPT_MASK_RX_7_END_MASK_MSB 15 -#define INTERRUPT_MASK_RX_7_END_MASK_LSB 15 -#define INTERRUPT_MASK_RX_7_END_MASK_MASK 0x00008000 -#define INTERRUPT_MASK_RX_7_END_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_7_END_MASK_MASK) >> INTERRUPT_MASK_RX_7_END_MASK_LSB) -#define INTERRUPT_MASK_RX_7_END_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_7_END_MASK_LSB) & INTERRUPT_MASK_RX_7_END_MASK_MASK) -#define INTERRUPT_MASK_RX_6_END_MASK_MSB 14 -#define INTERRUPT_MASK_RX_6_END_MASK_LSB 14 -#define INTERRUPT_MASK_RX_6_END_MASK_MASK 0x00004000 -#define INTERRUPT_MASK_RX_6_END_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_6_END_MASK_MASK) >> INTERRUPT_MASK_RX_6_END_MASK_LSB) -#define INTERRUPT_MASK_RX_6_END_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_6_END_MASK_LSB) & INTERRUPT_MASK_RX_6_END_MASK_MASK) -#define INTERRUPT_MASK_RX_5_END_MASK_MSB 13 -#define INTERRUPT_MASK_RX_5_END_MASK_LSB 13 -#define INTERRUPT_MASK_RX_5_END_MASK_MASK 0x00002000 -#define INTERRUPT_MASK_RX_5_END_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_5_END_MASK_MASK) >> INTERRUPT_MASK_RX_5_END_MASK_LSB) -#define INTERRUPT_MASK_RX_5_END_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_5_END_MASK_LSB) & INTERRUPT_MASK_RX_5_END_MASK_MASK) -#define INTERRUPT_MASK_RX_4_END_MASK_MSB 12 -#define INTERRUPT_MASK_RX_4_END_MASK_LSB 12 -#define INTERRUPT_MASK_RX_4_END_MASK_MASK 0x00001000 -#define INTERRUPT_MASK_RX_4_END_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_4_END_MASK_MASK) >> INTERRUPT_MASK_RX_4_END_MASK_LSB) -#define INTERRUPT_MASK_RX_4_END_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_4_END_MASK_LSB) & INTERRUPT_MASK_RX_4_END_MASK_MASK) -#define INTERRUPT_MASK_RX_3_END_MASK_MSB 11 -#define INTERRUPT_MASK_RX_3_END_MASK_LSB 11 -#define INTERRUPT_MASK_RX_3_END_MASK_MASK 0x00000800 -#define INTERRUPT_MASK_RX_3_END_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_3_END_MASK_MASK) >> INTERRUPT_MASK_RX_3_END_MASK_LSB) -#define INTERRUPT_MASK_RX_3_END_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_3_END_MASK_LSB) & INTERRUPT_MASK_RX_3_END_MASK_MASK) -#define INTERRUPT_MASK_RX_2_END_MASK_MSB 10 -#define INTERRUPT_MASK_RX_2_END_MASK_LSB 10 -#define INTERRUPT_MASK_RX_2_END_MASK_MASK 0x00000400 -#define INTERRUPT_MASK_RX_2_END_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_2_END_MASK_MASK) >> INTERRUPT_MASK_RX_2_END_MASK_LSB) -#define INTERRUPT_MASK_RX_2_END_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_2_END_MASK_LSB) & INTERRUPT_MASK_RX_2_END_MASK_MASK) -#define INTERRUPT_MASK_RX_1_END_MASK_MSB 9 -#define INTERRUPT_MASK_RX_1_END_MASK_LSB 9 -#define INTERRUPT_MASK_RX_1_END_MASK_MASK 0x00000200 -#define INTERRUPT_MASK_RX_1_END_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_1_END_MASK_MASK) >> INTERRUPT_MASK_RX_1_END_MASK_LSB) -#define INTERRUPT_MASK_RX_1_END_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_1_END_MASK_LSB) & INTERRUPT_MASK_RX_1_END_MASK_MASK) -#define INTERRUPT_MASK_RX_0_END_MASK_MSB 8 -#define INTERRUPT_MASK_RX_0_END_MASK_LSB 8 -#define INTERRUPT_MASK_RX_0_END_MASK_MASK 0x00000100 -#define INTERRUPT_MASK_RX_0_END_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_0_END_MASK_MASK) >> INTERRUPT_MASK_RX_0_END_MASK_LSB) -#define INTERRUPT_MASK_RX_0_END_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_0_END_MASK_LSB) & INTERRUPT_MASK_RX_0_END_MASK_MASK) -#define INTERRUPT_MASK_RX_7_COMPLETE_MASK_MSB 7 -#define INTERRUPT_MASK_RX_7_COMPLETE_MASK_LSB 7 -#define INTERRUPT_MASK_RX_7_COMPLETE_MASK_MASK 0x00000080 -#define INTERRUPT_MASK_RX_7_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_7_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_RX_7_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_RX_7_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_7_COMPLETE_MASK_LSB) & INTERRUPT_MASK_RX_7_COMPLETE_MASK_MASK) -#define INTERRUPT_MASK_RX_6_COMPLETE_MASK_MSB 6 -#define INTERRUPT_MASK_RX_6_COMPLETE_MASK_LSB 6 -#define INTERRUPT_MASK_RX_6_COMPLETE_MASK_MASK 0x00000040 -#define INTERRUPT_MASK_RX_6_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_6_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_RX_6_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_RX_6_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_6_COMPLETE_MASK_LSB) & INTERRUPT_MASK_RX_6_COMPLETE_MASK_MASK) -#define INTERRUPT_MASK_RX_5_COMPLETE_MASK_MSB 5 -#define INTERRUPT_MASK_RX_5_COMPLETE_MASK_LSB 5 -#define INTERRUPT_MASK_RX_5_COMPLETE_MASK_MASK 0x00000020 -#define INTERRUPT_MASK_RX_5_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_5_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_RX_5_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_RX_5_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_5_COMPLETE_MASK_LSB) & INTERRUPT_MASK_RX_5_COMPLETE_MASK_MASK) -#define INTERRUPT_MASK_RX_4_COMPLETE_MASK_MSB 4 -#define INTERRUPT_MASK_RX_4_COMPLETE_MASK_LSB 4 -#define INTERRUPT_MASK_RX_4_COMPLETE_MASK_MASK 0x00000010 -#define INTERRUPT_MASK_RX_4_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_4_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_RX_4_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_RX_4_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_4_COMPLETE_MASK_LSB) & INTERRUPT_MASK_RX_4_COMPLETE_MASK_MASK) -#define INTERRUPT_MASK_RX_3_COMPLETE_MASK_MSB 3 -#define INTERRUPT_MASK_RX_3_COMPLETE_MASK_LSB 3 -#define INTERRUPT_MASK_RX_3_COMPLETE_MASK_MASK 0x00000008 -#define INTERRUPT_MASK_RX_3_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_3_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_RX_3_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_RX_3_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_3_COMPLETE_MASK_LSB) & INTERRUPT_MASK_RX_3_COMPLETE_MASK_MASK) -#define INTERRUPT_MASK_RX_2_COMPLETE_MASK_MSB 2 -#define INTERRUPT_MASK_RX_2_COMPLETE_MASK_LSB 2 -#define INTERRUPT_MASK_RX_2_COMPLETE_MASK_MASK 0x00000004 -#define INTERRUPT_MASK_RX_2_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_2_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_RX_2_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_RX_2_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_2_COMPLETE_MASK_LSB) & INTERRUPT_MASK_RX_2_COMPLETE_MASK_MASK) -#define INTERRUPT_MASK_RX_1_COMPLETE_MASK_MSB 1 -#define INTERRUPT_MASK_RX_1_COMPLETE_MASK_LSB 1 -#define INTERRUPT_MASK_RX_1_COMPLETE_MASK_MASK 0x00000002 -#define INTERRUPT_MASK_RX_1_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_1_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_RX_1_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_RX_1_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_1_COMPLETE_MASK_LSB) & INTERRUPT_MASK_RX_1_COMPLETE_MASK_MASK) -#define INTERRUPT_MASK_RX_0_COMPLETE_MASK_MSB 0 -#define INTERRUPT_MASK_RX_0_COMPLETE_MASK_LSB 0 -#define INTERRUPT_MASK_RX_0_COMPLETE_MASK_MASK 0x00000001 -#define INTERRUPT_MASK_RX_0_COMPLETE_MASK_GET(x) (((x) & INTERRUPT_MASK_RX_0_COMPLETE_MASK_MASK) >> INTERRUPT_MASK_RX_0_COMPLETE_MASK_LSB) -#define INTERRUPT_MASK_RX_0_COMPLETE_MASK_SET(x) (((x) << INTERRUPT_MASK_RX_0_COMPLETE_MASK_LSB) & INTERRUPT_MASK_RX_0_COMPLETE_MASK_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct bridge_intr_reg_reg_s { - volatile unsigned int interrupt; - volatile unsigned int interrupt_mask; -} bridge_intr_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _BRIDGE_INTR_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_intr_reg_gmac_1_1.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_intr_reg_gmac_1_1.h deleted file mode 100644 index c262d2b10535..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bridge_intr_reg_gmac_1_1.h +++ /dev/null @@ -1,83 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _BRIDGE_INTR_REG_GMAC_1_1_REG_H_ -#define _BRIDGE_INTR_REG_GMAC_1_1_REG_H_ - -#define GMAC_INTERRUPT_ADDRESS 0x00000000 -#define GMAC_INTERRUPT_OFFSET 0x00000000 -#define GMAC_INTERRUPT_TX_0_END_MSB 24 -#define GMAC_INTERRUPT_TX_0_END_LSB 24 -#define GMAC_INTERRUPT_TX_0_END_MASK 0x01000000 -#define GMAC_INTERRUPT_TX_0_END_GET(x) (((x) & GMAC_INTERRUPT_TX_0_END_MASK) >> GMAC_INTERRUPT_TX_0_END_LSB) -#define GMAC_INTERRUPT_TX_0_END_SET(x) (((x) << GMAC_INTERRUPT_TX_0_END_LSB) & GMAC_INTERRUPT_TX_0_END_MASK) -#define GMAC_INTERRUPT_TX_0_COMPLETE_MSB 16 -#define GMAC_INTERRUPT_TX_0_COMPLETE_LSB 16 -#define GMAC_INTERRUPT_TX_0_COMPLETE_MASK 0x00010000 -#define GMAC_INTERRUPT_TX_0_COMPLETE_GET(x) (((x) & GMAC_INTERRUPT_TX_0_COMPLETE_MASK) >> GMAC_INTERRUPT_TX_0_COMPLETE_LSB) -#define GMAC_INTERRUPT_TX_0_COMPLETE_SET(x) (((x) << GMAC_INTERRUPT_TX_0_COMPLETE_LSB) & GMAC_INTERRUPT_TX_0_COMPLETE_MASK) -#define GMAC_INTERRUPT_RX_0_END_MSB 8 -#define GMAC_INTERRUPT_RX_0_END_LSB 8 -#define GMAC_INTERRUPT_RX_0_END_MASK 0x00000100 -#define GMAC_INTERRUPT_RX_0_END_GET(x) (((x) & GMAC_INTERRUPT_RX_0_END_MASK) >> GMAC_INTERRUPT_RX_0_END_LSB) -#define GMAC_INTERRUPT_RX_0_END_SET(x) (((x) << GMAC_INTERRUPT_RX_0_END_LSB) & GMAC_INTERRUPT_RX_0_END_MASK) -#define GMAC_INTERRUPT_RX_0_COMPLETE_MSB 0 -#define GMAC_INTERRUPT_RX_0_COMPLETE_LSB 0 -#define GMAC_INTERRUPT_RX_0_COMPLETE_MASK 0x00000001 -#define GMAC_INTERRUPT_RX_0_COMPLETE_GET(x) (((x) & GMAC_INTERRUPT_RX_0_COMPLETE_MASK) >> GMAC_INTERRUPT_RX_0_COMPLETE_LSB) -#define GMAC_INTERRUPT_RX_0_COMPLETE_SET(x) (((x) << GMAC_INTERRUPT_RX_0_COMPLETE_LSB) & GMAC_INTERRUPT_RX_0_COMPLETE_MASK) - -#define GMAC_INTERRUPT_MASK_ADDRESS 0x00000004 -#define GMAC_INTERRUPT_MASK_OFFSET 0x00000004 -#define GMAC_INTERRUPT_MASK_TX_0_END_MASK_MSB 24 -#define GMAC_INTERRUPT_MASK_TX_0_END_MASK_LSB 24 -#define GMAC_INTERRUPT_MASK_TX_0_END_MASK_MASK 0x01000000 -#define GMAC_INTERRUPT_MASK_TX_0_END_MASK_GET(x) (((x) & GMAC_INTERRUPT_MASK_TX_0_END_MASK_MASK) >> GMAC_INTERRUPT_MASK_TX_0_END_MASK_LSB) -#define GMAC_INTERRUPT_MASK_TX_0_END_MASK_SET(x) (((x) << GMAC_INTERRUPT_MASK_TX_0_END_MASK_LSB) & GMAC_INTERRUPT_MASK_TX_0_END_MASK_MASK) -#define GMAC_INTERRUPT_MASK_TX_0_COMPLETE_MASK_MSB 16 -#define GMAC_INTERRUPT_MASK_TX_0_COMPLETE_MASK_LSB 16 -#define GMAC_INTERRUPT_MASK_TX_0_COMPLETE_MASK_MASK 0x00010000 -#define GMAC_INTERRUPT_MASK_TX_0_COMPLETE_MASK_GET(x) (((x) & GMAC_INTERRUPT_MASK_TX_0_COMPLETE_MASK_MASK) >> GMAC_INTERRUPT_MASK_TX_0_COMPLETE_MASK_LSB) -#define GMAC_INTERRUPT_MASK_TX_0_COMPLETE_MASK_SET(x) (((x) << GMAC_INTERRUPT_MASK_TX_0_COMPLETE_MASK_LSB) & GMAC_INTERRUPT_MASK_TX_0_COMPLETE_MASK_MASK) -#define GMAC_INTERRUPT_MASK_RX_0_END_MASK_MSB 8 -#define GMAC_INTERRUPT_MASK_RX_0_END_MASK_LSB 8 -#define GMAC_INTERRUPT_MASK_RX_0_END_MASK_MASK 0x00000100 -#define GMAC_INTERRUPT_MASK_RX_0_END_MASK_GET(x) (((x) & GMAC_INTERRUPT_MASK_RX_0_END_MASK_MASK) >> GMAC_INTERRUPT_MASK_RX_0_END_MASK_LSB) -#define GMAC_INTERRUPT_MASK_RX_0_END_MASK_SET(x) (((x) << GMAC_INTERRUPT_MASK_RX_0_END_MASK_LSB) & GMAC_INTERRUPT_MASK_RX_0_END_MASK_MASK) -#define GMAC_INTERRUPT_MASK_RX_0_COMPLETE_MASK_MSB 0 -#define GMAC_INTERRUPT_MASK_RX_0_COMPLETE_MASK_LSB 0 -#define GMAC_INTERRUPT_MASK_RX_0_COMPLETE_MASK_MASK 0x00000001 -#define GMAC_INTERRUPT_MASK_RX_0_COMPLETE_MASK_GET(x) (((x) & GMAC_INTERRUPT_MASK_RX_0_COMPLETE_MASK_MASK) >> GMAC_INTERRUPT_MASK_RX_0_COMPLETE_MASK_LSB) -#define GMAC_INTERRUPT_MASK_RX_0_COMPLETE_MASK_SET(x) (((x) << GMAC_INTERRUPT_MASK_RX_0_COMPLETE_MASK_LSB) & GMAC_INTERRUPT_MASK_RX_0_COMPLETE_MASK_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct bridge_intr_reg_gmac_1_1_reg_s { - volatile unsigned int gmac_interrupt; - volatile unsigned int gmac_interrupt_mask; -} bridge_intr_reg_gmac_1_1_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _BRIDGE_INTR_REG_GMAC_1_1_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bt_coex_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bt_coex_reg.h deleted file mode 100644 index 07aa14e97903..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/bt_coex_reg.h +++ /dev/null @@ -1,618 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _BT_COEX_REG_REG_H_ -#define _BT_COEX_REG_REG_H_ - - -/* macros for BTCOEXCTRL */ -#define BTCOEXCTRL_ADDRESS 0x00000000 -#define BTCOEXCTRL_OFFSET 0x00000000 -#define BTCOEXCTRL_GAP_MSB 7 -#define BTCOEXCTRL_GAP_LSB 0 -#define BTCOEXCTRL_GAP_MASK 0x000000ff -#define BTCOEXCTRL_GAP_GET(x) (((x) & 0x000000ff) >> 0) -#define BTCOEXCTRL_GAP_SET(x) (((x) << 0) & 0x000000ff) -#define BTCOEXCTRL_CLK_CNT_EN_MSB 8 -#define BTCOEXCTRL_CLK_CNT_EN_LSB 8 -#define BTCOEXCTRL_CLK_CNT_EN_MASK 0x00000100 -#define BTCOEXCTRL_CLK_CNT_EN_GET(x) (((x) & 0x00000100) >> 8) -#define BTCOEXCTRL_CLK_CNT_EN_SET(x) (((x) << 8) & 0x00000100) -#define BTCOEXCTRL_FRAME_CNT_EN_MSB 9 -#define BTCOEXCTRL_FRAME_CNT_EN_LSB 9 -#define BTCOEXCTRL_FRAME_CNT_EN_MASK 0x00000200 -#define BTCOEXCTRL_FRAME_CNT_EN_GET(x) (((x) & 0x00000200) >> 9) -#define BTCOEXCTRL_FRAME_CNT_EN_SET(x) (((x) << 9) & 0x00000200) -#define BTCOEXCTRL_IDLE_CNT_EN_MSB 10 -#define BTCOEXCTRL_IDLE_CNT_EN_LSB 10 -#define BTCOEXCTRL_IDLE_CNT_EN_MASK 0x00000400 -#define BTCOEXCTRL_IDLE_CNT_EN_GET(x) (((x) & 0x00000400) >> 10) -#define BTCOEXCTRL_IDLE_CNT_EN_SET(x) (((x) << 10) & 0x00000400) -#define BTCOEXCTRL_SYNC_DET_EN_MSB 11 -#define BTCOEXCTRL_SYNC_DET_EN_LSB 11 -#define BTCOEXCTRL_SYNC_DET_EN_MASK 0x00000800 -#define BTCOEXCTRL_SYNC_DET_EN_GET(x) (((x) & 0x00000800) >> 11) -#define BTCOEXCTRL_SYNC_DET_EN_SET(x) (((x) << 11) & 0x00000800) -#define BTCOEXCTRL_PRIORITY_TIME_MSB 17 -#define BTCOEXCTRL_PRIORITY_TIME_LSB 12 -#define BTCOEXCTRL_PRIORITY_TIME_MASK 0x0003f000 -#define BTCOEXCTRL_PRIORITY_TIME_GET(x) (((x) & 0x0003f000) >> 12) -#define BTCOEXCTRL_PRIORITY_TIME_SET(x) (((x) << 12) & 0x0003f000) -#define BTCOEXCTRL_FREQ_TIME_MSB 22 -#define BTCOEXCTRL_FREQ_TIME_LSB 18 -#define BTCOEXCTRL_FREQ_TIME_MASK 0x007c0000 -#define BTCOEXCTRL_FREQ_TIME_GET(x) (((x) & 0x007c0000) >> 18) -#define BTCOEXCTRL_FREQ_TIME_SET(x) (((x) << 18) & 0x007c0000) -#define BTCOEXCTRL_PTA_MODE_MSB 24 -#define BTCOEXCTRL_PTA_MODE_LSB 23 -#define BTCOEXCTRL_PTA_MODE_MASK 0x01800000 -#define BTCOEXCTRL_PTA_MODE_GET(x) (((x) & 0x01800000) >> 23) -#define BTCOEXCTRL_PTA_MODE_SET(x) (((x) << 23) & 0x01800000) -#define BTCOEXCTRL_WBSYNC_ON_BEACON_MSB 25 -#define BTCOEXCTRL_WBSYNC_ON_BEACON_LSB 25 -#define BTCOEXCTRL_WBSYNC_ON_BEACON_MASK 0x02000000 -#define BTCOEXCTRL_WBSYNC_ON_BEACON_GET(x) (((x) & 0x02000000) >> 25) -#define BTCOEXCTRL_WBSYNC_ON_BEACON_SET(x) (((x) << 25) & 0x02000000) -#define BTCOEXCTRL_RFGAIN_VALID_SRC_MSB 28 -#define BTCOEXCTRL_RFGAIN_VALID_SRC_LSB 28 -#define BTCOEXCTRL_RFGAIN_VALID_SRC_MASK 0x10000000 -#define BTCOEXCTRL_RFGAIN_VALID_SRC_GET(x) (((x) & 0x10000000) >> 28) -#define BTCOEXCTRL_RFGAIN_VALID_SRC_SET(x) (((x) << 28) & 0x10000000) - -/* macros for WBSYNC_PRIORITY1 */ -#define WBSYNC_PRIORITY1_ADDRESS 0x00000004 -#define WBSYNC_PRIORITY1_OFFSET 0x00000004 -#define WBSYNC_PRIORITY1_BITMAP_MSB 31 -#define WBSYNC_PRIORITY1_BITMAP_LSB 0 -#define WBSYNC_PRIORITY1_BITMAP_MASK 0xffffffff -#define WBSYNC_PRIORITY1_BITMAP_GET(x) (((x) & 0xffffffff) >> 0) -#define WBSYNC_PRIORITY1_BITMAP_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for WBSYNC_PRIORITY2 */ -#define WBSYNC_PRIORITY2_ADDRESS 0x00000008 -#define WBSYNC_PRIORITY2_OFFSET 0x00000008 -#define WBSYNC_PRIORITY2_BITMAP_MSB 31 -#define WBSYNC_PRIORITY2_BITMAP_LSB 0 -#define WBSYNC_PRIORITY2_BITMAP_MASK 0xffffffff -#define WBSYNC_PRIORITY2_BITMAP_GET(x) (((x) & 0xffffffff) >> 0) -#define WBSYNC_PRIORITY2_BITMAP_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for WBSYNC_PRIORITY3 */ -#define WBSYNC_PRIORITY3_ADDRESS 0x0000000c -#define WBSYNC_PRIORITY3_OFFSET 0x0000000c -#define WBSYNC_PRIORITY3_BITMAP_MSB 31 -#define WBSYNC_PRIORITY3_BITMAP_LSB 0 -#define WBSYNC_PRIORITY3_BITMAP_MASK 0xffffffff -#define WBSYNC_PRIORITY3_BITMAP_GET(x) (((x) & 0xffffffff) >> 0) -#define WBSYNC_PRIORITY3_BITMAP_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BTCOEX0 */ -#define BTCOEX0_ADDRESS 0x00000010 -#define BTCOEX0_OFFSET 0x00000010 -#define BTCOEX0_SYNC_DUR_MSB 7 -#define BTCOEX0_SYNC_DUR_LSB 0 -#define BTCOEX0_SYNC_DUR_MASK 0x000000ff -#define BTCOEX0_SYNC_DUR_GET(x) (((x) & 0x000000ff) >> 0) -#define BTCOEX0_SYNC_DUR_SET(x) (((x) << 0) & 0x000000ff) - -/* macros for BTCOEX1 */ -#define BTCOEX1_ADDRESS 0x00000014 -#define BTCOEX1_OFFSET 0x00000014 -#define BTCOEX1_CLK_THRES_MSB 20 -#define BTCOEX1_CLK_THRES_LSB 0 -#define BTCOEX1_CLK_THRES_MASK 0x001fffff -#define BTCOEX1_CLK_THRES_GET(x) (((x) & 0x001fffff) >> 0) -#define BTCOEX1_CLK_THRES_SET(x) (((x) << 0) & 0x001fffff) - -/* macros for BTCOEX2 */ -#define BTCOEX2_ADDRESS 0x00000018 -#define BTCOEX2_OFFSET 0x00000018 -#define BTCOEX2_FRAME_THRES_MSB 7 -#define BTCOEX2_FRAME_THRES_LSB 0 -#define BTCOEX2_FRAME_THRES_MASK 0x000000ff -#define BTCOEX2_FRAME_THRES_GET(x) (((x) & 0x000000ff) >> 0) -#define BTCOEX2_FRAME_THRES_SET(x) (((x) << 0) & 0x000000ff) - -/* macros for BTCOEX3 */ -#define BTCOEX3_ADDRESS 0x0000001c -#define BTCOEX3_OFFSET 0x0000001c -#define BTCOEX3_CLK_CNT_MSB 20 -#define BTCOEX3_CLK_CNT_LSB 0 -#define BTCOEX3_CLK_CNT_MASK 0x001fffff -#define BTCOEX3_CLK_CNT_GET(x) (((x) & 0x001fffff) >> 0) -#define BTCOEX3_CLK_CNT_SET(x) (((x) << 0) & 0x001fffff) - -/* macros for BTCOEX4 */ -#define BTCOEX4_ADDRESS 0x00000020 -#define BTCOEX4_OFFSET 0x00000020 -#define BTCOEX4_FRAME_CNT_MSB 7 -#define BTCOEX4_FRAME_CNT_LSB 0 -#define BTCOEX4_FRAME_CNT_MASK 0x000000ff -#define BTCOEX4_FRAME_CNT_GET(x) (((x) & 0x000000ff) >> 0) -#define BTCOEX4_FRAME_CNT_SET(x) (((x) << 0) & 0x000000ff) - -/* macros for BTCOEX5 */ -#define BTCOEX5_ADDRESS 0x00000024 -#define BTCOEX5_OFFSET 0x00000024 -#define BTCOEX5_IDLE_CNT_MSB 15 -#define BTCOEX5_IDLE_CNT_LSB 0 -#define BTCOEX5_IDLE_CNT_MASK 0x0000ffff -#define BTCOEX5_IDLE_CNT_GET(x) (((x) & 0x0000ffff) >> 0) -#define BTCOEX5_IDLE_CNT_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for BTCOEX6 */ -#define BTCOEX6_ADDRESS 0x00000028 -#define BTCOEX6_OFFSET 0x00000028 -#define BTCOEX6_IDLE_RESET_LVL_BITMAP_MSB 31 -#define BTCOEX6_IDLE_RESET_LVL_BITMAP_LSB 0 -#define BTCOEX6_IDLE_RESET_LVL_BITMAP_MASK 0xffffffff -#define BTCOEX6_IDLE_RESET_LVL_BITMAP_GET(x) (((x) & 0xffffffff) >> 0) -#define BTCOEX6_IDLE_RESET_LVL_BITMAP_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for LOCK */ -#define LOCK_ADDRESS 0x0000002c -#define LOCK_OFFSET 0x0000002c -#define LOCK_TUNLOCK_MASTER_MSB 7 -#define LOCK_TUNLOCK_MASTER_LSB 0 -#define LOCK_TUNLOCK_MASTER_MASK 0x000000ff -#define LOCK_TUNLOCK_MASTER_GET(x) (((x) & 0x000000ff) >> 0) -#define LOCK_TUNLOCK_MASTER_SET(x) (((x) << 0) & 0x000000ff) -#define LOCK_TLOCK_MASTER_MSB 15 -#define LOCK_TLOCK_MASTER_LSB 8 -#define LOCK_TLOCK_MASTER_MASK 0x0000ff00 -#define LOCK_TLOCK_MASTER_GET(x) (((x) & 0x0000ff00) >> 8) -#define LOCK_TLOCK_MASTER_SET(x) (((x) << 8) & 0x0000ff00) -#define LOCK_TUNLOCK_SLAVE_MSB 23 -#define LOCK_TUNLOCK_SLAVE_LSB 16 -#define LOCK_TUNLOCK_SLAVE_MASK 0x00ff0000 -#define LOCK_TUNLOCK_SLAVE_GET(x) (((x) & 0x00ff0000) >> 16) -#define LOCK_TUNLOCK_SLAVE_SET(x) (((x) << 16) & 0x00ff0000) -#define LOCK_TLOCK_SLAVE_MSB 31 -#define LOCK_TLOCK_SLAVE_LSB 24 -#define LOCK_TLOCK_SLAVE_MASK 0xff000000 -#define LOCK_TLOCK_SLAVE_GET(x) (((x) & 0xff000000) >> 24) -#define LOCK_TLOCK_SLAVE_SET(x) (((x) << 24) & 0xff000000) - -/* macros for NOLOCK_PRIORITY */ -#define NOLOCK_PRIORITY_ADDRESS 0x00000030 -#define NOLOCK_PRIORITY_OFFSET 0x00000030 -#define NOLOCK_PRIORITY_BITMAP_MSB 31 -#define NOLOCK_PRIORITY_BITMAP_LSB 0 -#define NOLOCK_PRIORITY_BITMAP_MASK 0xffffffff -#define NOLOCK_PRIORITY_BITMAP_GET(x) (((x) & 0xffffffff) >> 0) -#define NOLOCK_PRIORITY_BITMAP_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for WBSYNC */ -#define WBSYNC_ADDRESS 0x00000034 -#define WBSYNC_OFFSET 0x00000034 -#define WBSYNC_BTCLOCK_MSB 31 -#define WBSYNC_BTCLOCK_LSB 0 -#define WBSYNC_BTCLOCK_MASK 0xffffffff -#define WBSYNC_BTCLOCK_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for WBSYNC1 */ -#define WBSYNC1_ADDRESS 0x00000038 -#define WBSYNC1_OFFSET 0x00000038 -#define WBSYNC1_BTCLOCK_MSB 31 -#define WBSYNC1_BTCLOCK_LSB 0 -#define WBSYNC1_BTCLOCK_MASK 0xffffffff -#define WBSYNC1_BTCLOCK_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for WBSYNC2 */ -#define WBSYNC2_ADDRESS 0x0000003c -#define WBSYNC2_OFFSET 0x0000003c -#define WBSYNC2_BTCLOCK_MSB 31 -#define WBSYNC2_BTCLOCK_LSB 0 -#define WBSYNC2_BTCLOCK_MASK 0xffffffff -#define WBSYNC2_BTCLOCK_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for WBSYNC3 */ -#define WBSYNC3_ADDRESS 0x00000040 -#define WBSYNC3_OFFSET 0x00000040 -#define WBSYNC3_BTCLOCK_MSB 31 -#define WBSYNC3_BTCLOCK_LSB 0 -#define WBSYNC3_BTCLOCK_MASK 0xffffffff -#define WBSYNC3_BTCLOCK_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for WB_TIMER_TARGET */ -#define WB_TIMER_TARGET_ADDRESS 0x00000044 -#define WB_TIMER_TARGET_OFFSET 0x00000044 -#define WB_TIMER_TARGET_VALUE_MSB 31 -#define WB_TIMER_TARGET_VALUE_LSB 0 -#define WB_TIMER_TARGET_VALUE_MASK 0xffffffff -#define WB_TIMER_TARGET_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define WB_TIMER_TARGET_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for WB_TIMER_SLOP */ -#define WB_TIMER_SLOP_ADDRESS 0x00000048 -#define WB_TIMER_SLOP_OFFSET 0x00000048 -#define WB_TIMER_SLOP_VALUE_MSB 9 -#define WB_TIMER_SLOP_VALUE_LSB 0 -#define WB_TIMER_SLOP_VALUE_MASK 0x000003ff -#define WB_TIMER_SLOP_VALUE_GET(x) (((x) & 0x000003ff) >> 0) -#define WB_TIMER_SLOP_VALUE_SET(x) (((x) << 0) & 0x000003ff) - -/* macros for BTCOEX_INT_EN */ -#define BTCOEX_INT_EN_ADDRESS 0x0000004c -#define BTCOEX_INT_EN_OFFSET 0x0000004c -#define BTCOEX_INT_EN_CLK_CNT_MSB 0 -#define BTCOEX_INT_EN_CLK_CNT_LSB 0 -#define BTCOEX_INT_EN_CLK_CNT_MASK 0x00000001 -#define BTCOEX_INT_EN_CLK_CNT_GET(x) (((x) & 0x00000001) >> 0) -#define BTCOEX_INT_EN_CLK_CNT_SET(x) (((x) << 0) & 0x00000001) -#define BTCOEX_INT_EN_FRAME_CNT_MSB 1 -#define BTCOEX_INT_EN_FRAME_CNT_LSB 1 -#define BTCOEX_INT_EN_FRAME_CNT_MASK 0x00000002 -#define BTCOEX_INT_EN_FRAME_CNT_GET(x) (((x) & 0x00000002) >> 1) -#define BTCOEX_INT_EN_FRAME_CNT_SET(x) (((x) << 1) & 0x00000002) -#define BTCOEX_INT_EN_END_MSB 2 -#define BTCOEX_INT_EN_END_LSB 2 -#define BTCOEX_INT_EN_END_MASK 0x00000004 -#define BTCOEX_INT_EN_END_GET(x) (((x) & 0x00000004) >> 2) -#define BTCOEX_INT_EN_END_SET(x) (((x) << 2) & 0x00000004) -#define BTCOEX_INT_EN_SYNC_MSB 3 -#define BTCOEX_INT_EN_SYNC_LSB 3 -#define BTCOEX_INT_EN_SYNC_MASK 0x00000008 -#define BTCOEX_INT_EN_SYNC_GET(x) (((x) & 0x00000008) >> 3) -#define BTCOEX_INT_EN_SYNC_SET(x) (((x) << 3) & 0x00000008) -#define BTCOEX_INT_EN_NOSYNC_MSB 4 -#define BTCOEX_INT_EN_NOSYNC_LSB 4 -#define BTCOEX_INT_EN_NOSYNC_MASK 0x00000010 -#define BTCOEX_INT_EN_NOSYNC_GET(x) (((x) & 0x00000010) >> 4) -#define BTCOEX_INT_EN_NOSYNC_SET(x) (((x) << 4) & 0x00000010) -#define BTCOEX_INT_EN_WB_TIMER_MSB 7 -#define BTCOEX_INT_EN_WB_TIMER_LSB 7 -#define BTCOEX_INT_EN_WB_TIMER_MASK 0x00000080 -#define BTCOEX_INT_EN_WB_TIMER_GET(x) (((x) & 0x00000080) >> 7) -#define BTCOEX_INT_EN_WB_TIMER_SET(x) (((x) << 7) & 0x00000080) -#define BTCOEX_INT_EN_ST_MESG_RECV_MSB 8 -#define BTCOEX_INT_EN_ST_MESG_RECV_LSB 8 -#define BTCOEX_INT_EN_ST_MESG_RECV_MASK 0x00000100 -#define BTCOEX_INT_EN_ST_MESG_RECV_GET(x) (((x) & 0x00000100) >> 8) -#define BTCOEX_INT_EN_ST_MESG_RECV_SET(x) (((x) << 8) & 0x00000100) -#define BTCOEX_INT_EN_I2C_MESG_SENT_MSB 9 -#define BTCOEX_INT_EN_I2C_MESG_SENT_LSB 9 -#define BTCOEX_INT_EN_I2C_MESG_SENT_MASK 0x00000200 -#define BTCOEX_INT_EN_I2C_MESG_SENT_GET(x) (((x) & 0x00000200) >> 9) -#define BTCOEX_INT_EN_I2C_MESG_SENT_SET(x) (((x) << 9) & 0x00000200) -#define BTCOEX_INT_EN_I2C_TX_FAILED_MSB 10 -#define BTCOEX_INT_EN_I2C_TX_FAILED_LSB 10 -#define BTCOEX_INT_EN_I2C_TX_FAILED_MASK 0x00000400 -#define BTCOEX_INT_EN_I2C_TX_FAILED_GET(x) (((x) & 0x00000400) >> 10) -#define BTCOEX_INT_EN_I2C_TX_FAILED_SET(x) (((x) << 10) & 0x00000400) -#define BTCOEX_INT_EN_I2C_RECV_OVERFLOW_MSB 11 -#define BTCOEX_INT_EN_I2C_RECV_OVERFLOW_LSB 11 -#define BTCOEX_INT_EN_I2C_RECV_OVERFLOW_MASK 0x00000800 -#define BTCOEX_INT_EN_I2C_RECV_OVERFLOW_GET(x) (((x) & 0x00000800) >> 11) -#define BTCOEX_INT_EN_I2C_RECV_OVERFLOW_SET(x) (((x) << 11) & 0x00000800) - -/* macros for BTCOEX_INT_STAT */ -#define BTCOEX_INT_STAT_ADDRESS 0x00000050 -#define BTCOEX_INT_STAT_OFFSET 0x00000050 -#define BTCOEX_INT_STAT_CLK_CNT_MSB 0 -#define BTCOEX_INT_STAT_CLK_CNT_LSB 0 -#define BTCOEX_INT_STAT_CLK_CNT_MASK 0x00000001 -#define BTCOEX_INT_STAT_CLK_CNT_GET(x) (((x) & 0x00000001) >> 0) -#define BTCOEX_INT_STAT_CLK_CNT_SET(x) (((x) << 0) & 0x00000001) -#define BTCOEX_INT_STAT_FRAME_CNT_MSB 1 -#define BTCOEX_INT_STAT_FRAME_CNT_LSB 1 -#define BTCOEX_INT_STAT_FRAME_CNT_MASK 0x00000002 -#define BTCOEX_INT_STAT_FRAME_CNT_GET(x) (((x) & 0x00000002) >> 1) -#define BTCOEX_INT_STAT_FRAME_CNT_SET(x) (((x) << 1) & 0x00000002) -#define BTCOEX_INT_STAT_END_MSB 2 -#define BTCOEX_INT_STAT_END_LSB 2 -#define BTCOEX_INT_STAT_END_MASK 0x00000004 -#define BTCOEX_INT_STAT_END_GET(x) (((x) & 0x00000004) >> 2) -#define BTCOEX_INT_STAT_END_SET(x) (((x) << 2) & 0x00000004) -#define BTCOEX_INT_STAT_SYNC_MSB 3 -#define BTCOEX_INT_STAT_SYNC_LSB 3 -#define BTCOEX_INT_STAT_SYNC_MASK 0x00000008 -#define BTCOEX_INT_STAT_SYNC_GET(x) (((x) & 0x00000008) >> 3) -#define BTCOEX_INT_STAT_SYNC_SET(x) (((x) << 3) & 0x00000008) -#define BTCOEX_INT_STAT_NOSYNC_MSB 4 -#define BTCOEX_INT_STAT_NOSYNC_LSB 4 -#define BTCOEX_INT_STAT_NOSYNC_MASK 0x00000010 -#define BTCOEX_INT_STAT_NOSYNC_GET(x) (((x) & 0x00000010) >> 4) -#define BTCOEX_INT_STAT_NOSYNC_SET(x) (((x) << 4) & 0x00000010) -#define BTCOEX_INT_STAT_BTPRIORITY_MSB 5 -#define BTCOEX_INT_STAT_BTPRIORITY_LSB 5 -#define BTCOEX_INT_STAT_BTPRIORITY_MASK 0x00000020 -#define BTCOEX_INT_STAT_BTPRIORITY_GET(x) (((x) & 0x00000020) >> 5) -#define BTCOEX_INT_STAT_BTPRIORITY_STOMP_MSB 6 -#define BTCOEX_INT_STAT_BTPRIORITY_STOMP_LSB 6 -#define BTCOEX_INT_STAT_BTPRIORITY_STOMP_MASK 0x00000040 -#define BTCOEX_INT_STAT_BTPRIORITY_STOMP_GET(x) (((x) & 0x00000040) >> 6) -#define BTCOEX_INT_STAT_WB_TIMER_MSB 7 -#define BTCOEX_INT_STAT_WB_TIMER_LSB 7 -#define BTCOEX_INT_STAT_WB_TIMER_MASK 0x00000080 -#define BTCOEX_INT_STAT_WB_TIMER_GET(x) (((x) & 0x00000080) >> 7) -#define BTCOEX_INT_STAT_WB_TIMER_SET(x) (((x) << 7) & 0x00000080) -#define BTCOEX_INT_STAT_I2C_MESG_RECV_MSB 8 -#define BTCOEX_INT_STAT_I2C_MESG_RECV_LSB 8 -#define BTCOEX_INT_STAT_I2C_MESG_RECV_MASK 0x00000100 -#define BTCOEX_INT_STAT_I2C_MESG_RECV_GET(x) (((x) & 0x00000100) >> 8) -#define BTCOEX_INT_STAT_I2C_MESG_RECV_SET(x) (((x) << 8) & 0x00000100) -#define BTCOEX_INT_STAT_I2C_MESG_SENT_MSB 9 -#define BTCOEX_INT_STAT_I2C_MESG_SENT_LSB 9 -#define BTCOEX_INT_STAT_I2C_MESG_SENT_MASK 0x00000200 -#define BTCOEX_INT_STAT_I2C_MESG_SENT_GET(x) (((x) & 0x00000200) >> 9) -#define BTCOEX_INT_STAT_I2C_MESG_SENT_SET(x) (((x) << 9) & 0x00000200) -#define BTCOEX_INT_STAT_I2C_TX_FAILED_MSB 10 -#define BTCOEX_INT_STAT_I2C_TX_FAILED_LSB 10 -#define BTCOEX_INT_STAT_I2C_TX_FAILED_MASK 0x00000400 -#define BTCOEX_INT_STAT_I2C_TX_FAILED_GET(x) (((x) & 0x00000400) >> 10) -#define BTCOEX_INT_STAT_I2C_TX_FAILED_SET(x) (((x) << 10) & 0x00000400) -#define BTCOEX_INT_STAT_I2C_RECV_OVERFLOW_MSB 11 -#define BTCOEX_INT_STAT_I2C_RECV_OVERFLOW_LSB 11 -#define BTCOEX_INT_STAT_I2C_RECV_OVERFLOW_MASK 0x00000800 -#define BTCOEX_INT_STAT_I2C_RECV_OVERFLOW_GET(x) (((x) & 0x00000800) >> 11) -#define BTCOEX_INT_STAT_I2C_RECV_OVERFLOW_SET(x) (((x) << 11) & 0x00000800) - -/* macros for BTPRIORITY_INT_EN */ -#define BTPRIORITY_INT_EN_ADDRESS 0x00000054 -#define BTPRIORITY_INT_EN_OFFSET 0x00000054 -#define BTPRIORITY_INT_EN_BITMAP_MSB 31 -#define BTPRIORITY_INT_EN_BITMAP_LSB 0 -#define BTPRIORITY_INT_EN_BITMAP_MASK 0xffffffff -#define BTPRIORITY_INT_EN_BITMAP_GET(x) (((x) & 0xffffffff) >> 0) -#define BTPRIORITY_INT_EN_BITMAP_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BTPRIORITY_INT_STAT */ -#define BTPRIORITY_INT_STAT_ADDRESS 0x00000058 -#define BTPRIORITY_INT_STAT_OFFSET 0x00000058 -#define BTPRIORITY_INT_STAT_BITMAP_MSB 31 -#define BTPRIORITY_INT_STAT_BITMAP_LSB 0 -#define BTPRIORITY_INT_STAT_BITMAP_MASK 0xffffffff -#define BTPRIORITY_INT_STAT_BITMAP_GET(x) (((x) & 0xffffffff) >> 0) -#define BTPRIORITY_INT_STAT_BITMAP_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BTPRIORITY_STOMP_INT_EN */ -#define BTPRIORITY_STOMP_INT_EN_ADDRESS 0x0000005c -#define BTPRIORITY_STOMP_INT_EN_OFFSET 0x0000005c -#define BTPRIORITY_STOMP_INT_EN_BITMAP_MSB 31 -#define BTPRIORITY_STOMP_INT_EN_BITMAP_LSB 0 -#define BTPRIORITY_STOMP_INT_EN_BITMAP_MASK 0xffffffff -#define BTPRIORITY_STOMP_INT_EN_BITMAP_GET(x) (((x) & 0xffffffff) >> 0) -#define BTPRIORITY_STOMP_INT_EN_BITMAP_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BTPRIORITY_STOMP_INT_STAT */ -#define BTPRIORITY_STOMP_INT_STAT_ADDRESS 0x00000060 -#define BTPRIORITY_STOMP_INT_STAT_OFFSET 0x00000060 -#define BTPRIORITY_STOMP_INT_STAT_BITMAP_MSB 31 -#define BTPRIORITY_STOMP_INT_STAT_BITMAP_LSB 0 -#define BTPRIORITY_STOMP_INT_STAT_BITMAP_MASK 0xffffffff -#define BTPRIORITY_STOMP_INT_STAT_BITMAP_GET(x) (((x) & 0xffffffff) >> 0) -#define BTPRIORITY_STOMP_INT_STAT_BITMAP_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for ST_64_BIT */ -#define ST_64_BIT_ADDRESS 0x00000064 -#define ST_64_BIT_OFFSET 0x00000064 -#define ST_64_BIT_MODE_MSB 0 -#define ST_64_BIT_MODE_LSB 0 -#define ST_64_BIT_MODE_MASK 0x00000001 -#define ST_64_BIT_MODE_GET(x) (((x) & 0x00000001) >> 0) -#define ST_64_BIT_MODE_SET(x) (((x) << 0) & 0x00000001) -#define ST_64_BIT_SOC_CLK_DIVIDE_RATIO_MSB 5 -#define ST_64_BIT_SOC_CLK_DIVIDE_RATIO_LSB 1 -#define ST_64_BIT_SOC_CLK_DIVIDE_RATIO_MASK 0x0000003e -#define ST_64_BIT_SOC_CLK_DIVIDE_RATIO_GET(x) (((x) & 0x0000003e) >> 1) -#define ST_64_BIT_SOC_CLK_DIVIDE_RATIO_SET(x) (((x) << 1) & 0x0000003e) -#define ST_64_BIT_CLOCK_GATE_MSB 6 -#define ST_64_BIT_CLOCK_GATE_LSB 6 -#define ST_64_BIT_CLOCK_GATE_MASK 0x00000040 -#define ST_64_BIT_CLOCK_GATE_GET(x) (((x) & 0x00000040) >> 6) -#define ST_64_BIT_CLOCK_GATE_SET(x) (((x) << 6) & 0x00000040) -#define ST_64_BIT_DRIVE_MODE_MSB 7 -#define ST_64_BIT_DRIVE_MODE_LSB 7 -#define ST_64_BIT_DRIVE_MODE_MASK 0x00000080 -#define ST_64_BIT_DRIVE_MODE_GET(x) (((x) & 0x00000080) >> 7) -#define ST_64_BIT_DRIVE_MODE_SET(x) (((x) << 7) & 0x00000080) -#define ST_64_BIT_REQ_ACK_NOT_PULLED_DOWN_MSB 8 -#define ST_64_BIT_REQ_ACK_NOT_PULLED_DOWN_LSB 8 -#define ST_64_BIT_REQ_ACK_NOT_PULLED_DOWN_MASK 0x00000100 -#define ST_64_BIT_REQ_ACK_NOT_PULLED_DOWN_GET(x) (((x) & 0x00000100) >> 8) -#define ST_64_BIT_REQ_ACK_NOT_PULLED_DOWN_SET(x) (((x) << 8) & 0x00000100) -#define ST_64_BIT_TIMEOUT_MSB 26 -#define ST_64_BIT_TIMEOUT_LSB 9 -#define ST_64_BIT_TIMEOUT_MASK 0x07fffe00 -#define ST_64_BIT_TIMEOUT_GET(x) (((x) & 0x07fffe00) >> 9) -#define ST_64_BIT_TIMEOUT_SET(x) (((x) << 9) & 0x07fffe00) - -/* macros for MESSAGE_WR */ -#define MESSAGE_WR_ADDRESS 0x00000068 -#define MESSAGE_WR_OFFSET 0x00000068 -#define MESSAGE_WR_TYPE_MSB 31 -#define MESSAGE_WR_TYPE_LSB 0 -#define MESSAGE_WR_TYPE_MASK 0xffffffff -#define MESSAGE_WR_TYPE_GET(x) (((x) & 0xffffffff) >> 0) -#define MESSAGE_WR_TYPE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MESSAGE_WR_P */ -#define MESSAGE_WR_P_ADDRESS 0x0000006c -#define MESSAGE_WR_P_OFFSET 0x0000006c -#define MESSAGE_WR_P_PARAMETER_MSB 31 -#define MESSAGE_WR_P_PARAMETER_LSB 0 -#define MESSAGE_WR_P_PARAMETER_MASK 0xffffffff -#define MESSAGE_WR_P_PARAMETER_GET(x) (((x) & 0xffffffff) >> 0) -#define MESSAGE_WR_P_PARAMETER_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MESSAGE_RD */ -#define MESSAGE_RD_ADDRESS 0x00000070 -#define MESSAGE_RD_OFFSET 0x00000070 -#define MESSAGE_RD_TYPE_MSB 31 -#define MESSAGE_RD_TYPE_LSB 0 -#define MESSAGE_RD_TYPE_MASK 0xffffffff -#define MESSAGE_RD_TYPE_GET(x) (((x) & 0xffffffff) >> 0) -#define MESSAGE_RD_TYPE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MESSAGE_RD_P */ -#define MESSAGE_RD_P_ADDRESS 0x00000074 -#define MESSAGE_RD_P_OFFSET 0x00000074 -#define MESSAGE_RD_P_PARAMETER_MSB 31 -#define MESSAGE_RD_P_PARAMETER_LSB 0 -#define MESSAGE_RD_P_PARAMETER_MASK 0xffffffff -#define MESSAGE_RD_P_PARAMETER_GET(x) (((x) & 0xffffffff) >> 0) -#define MESSAGE_RD_P_PARAMETER_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BTPRIORITY_INT */ -#define BTPRIORITY_INT_ADDRESS 0x00000078 -#define BTPRIORITY_INT_OFFSET 0x00000078 -#define BTPRIORITY_INT_DELAY_MSB 7 -#define BTPRIORITY_INT_DELAY_LSB 0 -#define BTPRIORITY_INT_DELAY_MASK 0x000000ff -#define BTPRIORITY_INT_DELAY_GET(x) (((x) & 0x000000ff) >> 0) -#define BTPRIORITY_INT_DELAY_SET(x) (((x) << 0) & 0x000000ff) - -/* macros for SCO_PARAMS */ -#define SCO_PARAMS_ADDRESS 0x0000007c -#define SCO_PARAMS_OFFSET 0x0000007c -#define SCO_PARAMS_PERIOD_MSB 13 -#define SCO_PARAMS_PERIOD_LSB 0 -#define SCO_PARAMS_PERIOD_MASK 0x00003fff -#define SCO_PARAMS_PERIOD_GET(x) (((x) & 0x00003fff) >> 0) -#define SCO_PARAMS_PERIOD_SET(x) (((x) << 0) & 0x00003fff) -#define SCO_PARAMS_SLOP_MSB 23 -#define SCO_PARAMS_SLOP_LSB 14 -#define SCO_PARAMS_SLOP_MASK 0x00ffc000 -#define SCO_PARAMS_SLOP_GET(x) (((x) & 0x00ffc000) >> 14) -#define SCO_PARAMS_SLOP_SET(x) (((x) << 14) & 0x00ffc000) - -/* macros for SCO_PRIORITY */ -#define SCO_PRIORITY_ADDRESS 0x00000080 -#define SCO_PRIORITY_OFFSET 0x00000080 -#define SCO_PRIORITY_BITMAP_MSB 31 -#define SCO_PRIORITY_BITMAP_LSB 0 -#define SCO_PRIORITY_BITMAP_MASK 0xffffffff -#define SCO_PRIORITY_BITMAP_GET(x) (((x) & 0xffffffff) >> 0) -#define SCO_PRIORITY_BITMAP_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for SCO_SYNC */ -#define SCO_SYNC_ADDRESS 0x00000084 -#define SCO_SYNC_OFFSET 0x00000084 -#define SCO_SYNC_BTCLOCK_MSB 31 -#define SCO_SYNC_BTCLOCK_LSB 0 -#define SCO_SYNC_BTCLOCK_MASK 0xffffffff -#define SCO_SYNC_BTCLOCK_GET(x) (((x) & 0xffffffff) >> 0) -#define SCO_SYNC_BTCLOCK_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BTCOEX_RAW_STAT */ -#define BTCOEX_RAW_STAT_ADDRESS 0x00000088 -#define BTCOEX_RAW_STAT_OFFSET 0x00000088 -#define BTCOEX_RAW_STAT_CLK_CNT_MSB 0 -#define BTCOEX_RAW_STAT_CLK_CNT_LSB 0 -#define BTCOEX_RAW_STAT_CLK_CNT_MASK 0x00000001 -#define BTCOEX_RAW_STAT_CLK_CNT_GET(x) (((x) & 0x00000001) >> 0) -#define BTCOEX_RAW_STAT_CLK_CNT_SET(x) (((x) << 0) & 0x00000001) -#define BTCOEX_RAW_STAT_FRAME_CNT_MSB 1 -#define BTCOEX_RAW_STAT_FRAME_CNT_LSB 1 -#define BTCOEX_RAW_STAT_FRAME_CNT_MASK 0x00000002 -#define BTCOEX_RAW_STAT_FRAME_CNT_GET(x) (((x) & 0x00000002) >> 1) -#define BTCOEX_RAW_STAT_FRAME_CNT_SET(x) (((x) << 1) & 0x00000002) -#define BTCOEX_RAW_STAT_END_MSB 2 -#define BTCOEX_RAW_STAT_END_LSB 2 -#define BTCOEX_RAW_STAT_END_MASK 0x00000004 -#define BTCOEX_RAW_STAT_END_GET(x) (((x) & 0x00000004) >> 2) -#define BTCOEX_RAW_STAT_END_SET(x) (((x) << 2) & 0x00000004) -#define BTCOEX_RAW_STAT_SYNC_MSB 3 -#define BTCOEX_RAW_STAT_SYNC_LSB 3 -#define BTCOEX_RAW_STAT_SYNC_MASK 0x00000008 -#define BTCOEX_RAW_STAT_SYNC_GET(x) (((x) & 0x00000008) >> 3) -#define BTCOEX_RAW_STAT_SYNC_SET(x) (((x) << 3) & 0x00000008) -#define BTCOEX_RAW_STAT_NOSYNC_MSB 4 -#define BTCOEX_RAW_STAT_NOSYNC_LSB 4 -#define BTCOEX_RAW_STAT_NOSYNC_MASK 0x00000010 -#define BTCOEX_RAW_STAT_NOSYNC_GET(x) (((x) & 0x00000010) >> 4) -#define BTCOEX_RAW_STAT_NOSYNC_SET(x) (((x) << 4) & 0x00000010) -#define BTCOEX_RAW_STAT_WB_TIMER_MSB 7 -#define BTCOEX_RAW_STAT_WB_TIMER_LSB 7 -#define BTCOEX_RAW_STAT_WB_TIMER_MASK 0x00000080 -#define BTCOEX_RAW_STAT_WB_TIMER_GET(x) (((x) & 0x00000080) >> 7) -#define BTCOEX_RAW_STAT_WB_TIMER_SET(x) (((x) << 7) & 0x00000080) - -/* macros for BTPRIORITY_RAW_STAT */ -#define BTPRIORITY_RAW_STAT_ADDRESS 0x0000008c -#define BTPRIORITY_RAW_STAT_OFFSET 0x0000008c -#define BTPRIORITY_RAW_STAT_BITMAP_MSB 31 -#define BTPRIORITY_RAW_STAT_BITMAP_LSB 0 -#define BTPRIORITY_RAW_STAT_BITMAP_MASK 0xffffffff -#define BTPRIORITY_RAW_STAT_BITMAP_GET(x) (((x) & 0xffffffff) >> 0) -#define BTPRIORITY_RAW_STAT_BITMAP_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BTPRIORITY_STOMP_RAW_STAT */ -#define BTPRIORITY_STOMP_RAW_STAT_ADDRESS 0x00000090 -#define BTPRIORITY_STOMP_RAW_STAT_OFFSET 0x00000090 -#define BTPRIORITY_STOMP_RAW_STAT_BITMAP_MSB 31 -#define BTPRIORITY_STOMP_RAW_STAT_BITMAP_LSB 0 -#define BTPRIORITY_STOMP_RAW_STAT_BITMAP_MASK 0xffffffff -#define BTPRIORITY_STOMP_RAW_STAT_BITMAP_GET(x) (((x) & 0xffffffff) >> 0) -#define BTPRIORITY_STOMP_RAW_STAT_BITMAP_SET(x) (((x) << 0) & 0xffffffff) - - -#ifndef __ASSEMBLER__ - -typedef struct bt_coex_reg_reg_s { - volatile unsigned int BTCOEXCTRL; /* 0x0 - 0x4 */ - volatile unsigned int WBSYNC_PRIORITY1; /* 0x4 - 0x8 */ - volatile unsigned int WBSYNC_PRIORITY2; /* 0x8 - 0xc */ - volatile unsigned int WBSYNC_PRIORITY3; /* 0xc - 0x10 */ - volatile unsigned int BTCOEX0; /* 0x10 - 0x14 */ - volatile unsigned int BTCOEX1; /* 0x14 - 0x18 */ - volatile unsigned int BTCOEX2; /* 0x18 - 0x1c */ - volatile unsigned int BTCOEX3; /* 0x1c - 0x20 */ - volatile unsigned int BTCOEX4; /* 0x20 - 0x24 */ - volatile unsigned int BTCOEX5; /* 0x24 - 0x28 */ - volatile unsigned int BTCOEX6; /* 0x28 - 0x2c */ - volatile unsigned int LOCK; /* 0x2c - 0x30 */ - volatile unsigned int NOLOCK_PRIORITY; /* 0x30 - 0x34 */ - volatile unsigned int WBSYNC; /* 0x34 - 0x38 */ - volatile unsigned int WBSYNC1; /* 0x38 - 0x3c */ - volatile unsigned int WBSYNC2; /* 0x3c - 0x40 */ - volatile unsigned int WBSYNC3; /* 0x40 - 0x44 */ - volatile unsigned int WB_TIMER_TARGET; /* 0x44 - 0x48 */ - volatile unsigned int WB_TIMER_SLOP; /* 0x48 - 0x4c */ - volatile unsigned int BTCOEX_INT_EN; /* 0x4c - 0x50 */ - volatile unsigned int BTCOEX_INT_STAT; /* 0x50 - 0x54 */ - volatile unsigned int BTPRIORITY_INT_EN; /* 0x54 - 0x58 */ - volatile unsigned int BTPRIORITY_INT_STAT; /* 0x58 - 0x5c */ - volatile unsigned int BTPRIORITY_STOMP_INT_EN; /* 0x5c - 0x60 */ - volatile unsigned int BTPRIORITY_STOMP_INT_STAT; /* 0x60 - 0x64 */ - volatile unsigned int ST_64_BIT; /* 0x64 - 0x68 */ - volatile unsigned int MESSAGE_WR; /* 0x68 - 0x6c */ - volatile unsigned int MESSAGE_WR_P; /* 0x6c - 0x70 */ - volatile unsigned int MESSAGE_RD; /* 0x70 - 0x74 */ - volatile unsigned int MESSAGE_RD_P; /* 0x74 - 0x78 */ - volatile unsigned int BTPRIORITY_INT; /* 0x78 - 0x7c */ - volatile unsigned int SCO_PARAMS; /* 0x7c - 0x80 */ - volatile unsigned int SCO_PRIORITY; /* 0x80 - 0x84 */ - volatile unsigned int SCO_SYNC; /* 0x84 - 0x88 */ - volatile unsigned int BTCOEX_RAW_STAT; /* 0x88 - 0x8c */ - volatile unsigned int BTPRIORITY_RAW_STAT; /* 0x8c - 0x90 */ - volatile unsigned int BTPRIORITY_STOMP_RAW_STAT; /* 0x90 - 0x94 */ -} bt_coex_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _BT_COEX_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/chk_sum_seg_acc_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/chk_sum_seg_acc_reg.h deleted file mode 100644 index d1c44143317c..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/chk_sum_seg_acc_reg.h +++ /dev/null @@ -1,407 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _CHK_SUM_SEG_ACC_REG_REG_H_ -#define _CHK_SUM_SEG_ACC_REG_REG_H_ - - -/* macros for CHKSUM_ACC_DMATX_CONTROL0 */ -#define CHKSUM_ACC_DMATX_CONTROL0_ADDRESS 0x00000000 -#define CHKSUM_ACC_DMATX_CONTROL0_OFFSET 0x00000000 -#define CHKSUM_ACC_DMATX_CONTROL0_TXEN_MSB 0 -#define CHKSUM_ACC_DMATX_CONTROL0_TXEN_LSB 0 -#define CHKSUM_ACC_DMATX_CONTROL0_TXEN_MASK 0x00000001 -#define CHKSUM_ACC_DMATX_CONTROL0_TXEN_GET(x) (((x) & 0x00000001) >> 0) -#define CHKSUM_ACC_DMATX_CONTROL0_TXEN_SET(x) (((x) << 0) & 0x00000001) -#define CHKSUM_ACC_DMATX_CONTROL0_LITTLEENDIAN_MSB 1 -#define CHKSUM_ACC_DMATX_CONTROL0_LITTLEENDIAN_LSB 1 -#define CHKSUM_ACC_DMATX_CONTROL0_LITTLEENDIAN_MASK 0x00000002 -#define CHKSUM_ACC_DMATX_CONTROL0_LITTLEENDIAN_GET(x) (((x) & 0x00000002) >> 1) -#define CHKSUM_ACC_DMATX_CONTROL0_LITTLEENDIAN_SET(x) (((x) << 1) & 0x00000002) - -/* macros for CHKSUM_ACC_DMATX_CONTROL1 */ -#define CHKSUM_ACC_DMATX_CONTROL1_ADDRESS 0x00000004 -#define CHKSUM_ACC_DMATX_CONTROL1_OFFSET 0x00000004 -#define CHKSUM_ACC_DMATX_CONTROL1_TXEN_MSB 0 -#define CHKSUM_ACC_DMATX_CONTROL1_TXEN_LSB 0 -#define CHKSUM_ACC_DMATX_CONTROL1_TXEN_MASK 0x00000001 -#define CHKSUM_ACC_DMATX_CONTROL1_TXEN_GET(x) (((x) & 0x00000001) >> 0) -#define CHKSUM_ACC_DMATX_CONTROL1_TXEN_SET(x) (((x) << 0) & 0x00000001) -#define CHKSUM_ACC_DMATX_CONTROL1_LITTLEENDIAN_MSB 1 -#define CHKSUM_ACC_DMATX_CONTROL1_LITTLEENDIAN_LSB 1 -#define CHKSUM_ACC_DMATX_CONTROL1_LITTLEENDIAN_MASK 0x00000002 -#define CHKSUM_ACC_DMATX_CONTROL1_LITTLEENDIAN_GET(x) (((x) & 0x00000002) >> 1) -#define CHKSUM_ACC_DMATX_CONTROL1_LITTLEENDIAN_SET(x) (((x) << 1) & 0x00000002) - -/* macros for CHKSUM_ACC_DMATX_CONTROL2 */ -#define CHKSUM_ACC_DMATX_CONTROL2_ADDRESS 0x00000008 -#define CHKSUM_ACC_DMATX_CONTROL2_OFFSET 0x00000008 -#define CHKSUM_ACC_DMATX_CONTROL2_TXEN_MSB 0 -#define CHKSUM_ACC_DMATX_CONTROL2_TXEN_LSB 0 -#define CHKSUM_ACC_DMATX_CONTROL2_TXEN_MASK 0x00000001 -#define CHKSUM_ACC_DMATX_CONTROL2_TXEN_GET(x) (((x) & 0x00000001) >> 0) -#define CHKSUM_ACC_DMATX_CONTROL2_TXEN_SET(x) (((x) << 0) & 0x00000001) -#define CHKSUM_ACC_DMATX_CONTROL2_LITTLEENDIAN_MSB 1 -#define CHKSUM_ACC_DMATX_CONTROL2_LITTLEENDIAN_LSB 1 -#define CHKSUM_ACC_DMATX_CONTROL2_LITTLEENDIAN_MASK 0x00000002 -#define CHKSUM_ACC_DMATX_CONTROL2_LITTLEENDIAN_GET(x) (((x) & 0x00000002) >> 1) -#define CHKSUM_ACC_DMATX_CONTROL2_LITTLEENDIAN_SET(x) (((x) << 1) & 0x00000002) - -/* macros for CHKSUM_ACC_DMATX_CONTROL3 */ -#define CHKSUM_ACC_DMATX_CONTROL3_ADDRESS 0x0000000c -#define CHKSUM_ACC_DMATX_CONTROL3_OFFSET 0x0000000c -#define CHKSUM_ACC_DMATX_CONTROL3_TXEN_MSB 0 -#define CHKSUM_ACC_DMATX_CONTROL3_TXEN_LSB 0 -#define CHKSUM_ACC_DMATX_CONTROL3_TXEN_MASK 0x00000001 -#define CHKSUM_ACC_DMATX_CONTROL3_TXEN_GET(x) (((x) & 0x00000001) >> 0) -#define CHKSUM_ACC_DMATX_CONTROL3_TXEN_SET(x) (((x) << 0) & 0x00000001) -#define CHKSUM_ACC_DMATX_CONTROL3_LITTLEENDIAN_MSB 1 -#define CHKSUM_ACC_DMATX_CONTROL3_LITTLEENDIAN_LSB 1 -#define CHKSUM_ACC_DMATX_CONTROL3_LITTLEENDIAN_MASK 0x00000002 -#define CHKSUM_ACC_DMATX_CONTROL3_LITTLEENDIAN_GET(x) (((x) & 0x00000002) >> 1) -#define CHKSUM_ACC_DMATX_CONTROL3_LITTLEENDIAN_SET(x) (((x) << 1) & 0x00000002) - -/* macros for CHKSUM_ACC_DMATX_DESC0 */ -#define CHKSUM_ACC_DMATX_DESC0_ADDRESS 0x00000010 -#define CHKSUM_ACC_DMATX_DESC0_OFFSET 0x00000010 -#define CHKSUM_ACC_DMATX_DESC0_ADDR_MSB 31 -#define CHKSUM_ACC_DMATX_DESC0_ADDR_LSB 0 -#define CHKSUM_ACC_DMATX_DESC0_ADDR_MASK 0xffffffff -#define CHKSUM_ACC_DMATX_DESC0_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define CHKSUM_ACC_DMATX_DESC0_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for CHKSUM_ACC_DMATX_DESC1 */ -#define CHKSUM_ACC_DMATX_DESC1_ADDRESS 0x00000014 -#define CHKSUM_ACC_DMATX_DESC1_OFFSET 0x00000014 -#define CHKSUM_ACC_DMATX_DESC1_ADDR_MSB 31 -#define CHKSUM_ACC_DMATX_DESC1_ADDR_LSB 0 -#define CHKSUM_ACC_DMATX_DESC1_ADDR_MASK 0xffffffff -#define CHKSUM_ACC_DMATX_DESC1_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define CHKSUM_ACC_DMATX_DESC1_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for CHKSUM_ACC_DMATX_DESC2 */ -#define CHKSUM_ACC_DMATX_DESC2_ADDRESS 0x00000018 -#define CHKSUM_ACC_DMATX_DESC2_OFFSET 0x00000018 -#define CHKSUM_ACC_DMATX_DESC2_ADDR_MSB 31 -#define CHKSUM_ACC_DMATX_DESC2_ADDR_LSB 0 -#define CHKSUM_ACC_DMATX_DESC2_ADDR_MASK 0xffffffff -#define CHKSUM_ACC_DMATX_DESC2_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define CHKSUM_ACC_DMATX_DESC2_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for CHKSUM_ACC_DMATX_DESC3 */ -#define CHKSUM_ACC_DMATX_DESC3_ADDRESS 0x0000001c -#define CHKSUM_ACC_DMATX_DESC3_OFFSET 0x0000001c -#define CHKSUM_ACC_DMATX_DESC3_ADDR_MSB 31 -#define CHKSUM_ACC_DMATX_DESC3_ADDR_LSB 0 -#define CHKSUM_ACC_DMATX_DESC3_ADDR_MASK 0xffffffff -#define CHKSUM_ACC_DMATX_DESC3_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define CHKSUM_ACC_DMATX_DESC3_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for CHKSUM_ACC_DMATX_DESC_STATUS */ -#define CHKSUM_ACC_DMATX_DESC_STATUS_ADDRESS 0x00000020 -#define CHKSUM_ACC_DMATX_DESC_STATUS_OFFSET 0x00000020 -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN0_MSB 0 -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN0_LSB 0 -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN0_MASK 0x00000001 -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN0_GET(x) (((x) & 0x00000001) >> 0) -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN0_SET(x) (((x) << 0) & 0x00000001) -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN1_MSB 1 -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN1_LSB 1 -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN1_MASK 0x00000002 -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN1_GET(x) (((x) & 0x00000002) >> 1) -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN1_SET(x) (((x) << 1) & 0x00000002) -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN2_MSB 2 -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN2_LSB 2 -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN2_MASK 0x00000004 -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN2_GET(x) (((x) & 0x00000004) >> 2) -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN2_SET(x) (((x) << 2) & 0x00000004) -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN3_MSB 3 -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN3_LSB 3 -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN3_MASK 0x00000008 -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN3_GET(x) (((x) & 0x00000008) >> 3) -#define CHKSUM_ACC_DMATX_DESC_STATUS_UNDERRUN3_SET(x) (((x) << 3) & 0x00000008) -#define CHKSUM_ACC_DMATX_DESC_STATUS_BUSERROR_MSB 4 -#define CHKSUM_ACC_DMATX_DESC_STATUS_BUSERROR_LSB 4 -#define CHKSUM_ACC_DMATX_DESC_STATUS_BUSERROR_MASK 0x00000010 -#define CHKSUM_ACC_DMATX_DESC_STATUS_BUSERROR_GET(x) (((x) & 0x00000010) >> 4) -#define CHKSUM_ACC_DMATX_DESC_STATUS_BUSERROR_SET(x) (((x) << 4) & 0x00000010) -#define CHKSUM_ACC_DMATX_DESC_STATUS_DESC_INTR_MSB 8 -#define CHKSUM_ACC_DMATX_DESC_STATUS_DESC_INTR_LSB 5 -#define CHKSUM_ACC_DMATX_DESC_STATUS_DESC_INTR_MASK 0x000001e0 -#define CHKSUM_ACC_DMATX_DESC_STATUS_DESC_INTR_GET(x) (((x) & 0x000001e0) >> 5) -#define CHKSUM_ACC_DMATX_DESC_STATUS_DESC_INTR_SET(x) (((x) << 5) & 0x000001e0) -#define CHKSUM_ACC_DMATX_DESC_STATUS_PKTCNT0_MSB 23 -#define CHKSUM_ACC_DMATX_DESC_STATUS_PKTCNT0_LSB 16 -#define CHKSUM_ACC_DMATX_DESC_STATUS_PKTCNT0_MASK 0x00ff0000 -#define CHKSUM_ACC_DMATX_DESC_STATUS_PKTCNT0_GET(x) (((x) & 0x00ff0000) >> 16) -#define CHKSUM_ACC_DMATX_DESC_STATUS_PKTCNT0_SET(x) (((x) << 16) & 0x00ff0000) -#define CHKSUM_ACC_DMATX_DESC_STATUS_CHAIN_NUM_MSB 25 -#define CHKSUM_ACC_DMATX_DESC_STATUS_CHAIN_NUM_LSB 24 -#define CHKSUM_ACC_DMATX_DESC_STATUS_CHAIN_NUM_MASK 0x03000000 -#define CHKSUM_ACC_DMATX_DESC_STATUS_CHAIN_NUM_GET(x) (((x) & 0x03000000) >> 24) - -/* macros for CHKSUM_ACC_DMATX_ARB_CFG */ -#define CHKSUM_ACC_DMATX_ARB_CFG_ADDRESS 0x00000024 -#define CHKSUM_ACC_DMATX_ARB_CFG_OFFSET 0x00000024 -#define CHKSUM_ACC_DMATX_ARB_CFG_RRMODE_MSB 0 -#define CHKSUM_ACC_DMATX_ARB_CFG_RRMODE_LSB 0 -#define CHKSUM_ACC_DMATX_ARB_CFG_RRMODE_MASK 0x00000001 -#define CHKSUM_ACC_DMATX_ARB_CFG_RRMODE_GET(x) (((x) & 0x00000001) >> 0) -#define CHKSUM_ACC_DMATX_ARB_CFG_RRMODE_SET(x) (((x) << 0) & 0x00000001) -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT0_MSB 13 -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT0_LSB 8 -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT0_MASK 0x00003f00 -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT0_GET(x) (((x) & 0x00003f00) >> 8) -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT0_SET(x) (((x) << 8) & 0x00003f00) -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT1_MSB 19 -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT1_LSB 14 -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT1_MASK 0x000fc000 -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT1_GET(x) (((x) & 0x000fc000) >> 14) -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT1_SET(x) (((x) << 14) & 0x000fc000) -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT2_MSB 25 -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT2_LSB 20 -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT2_MASK 0x03f00000 -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT2_GET(x) (((x) & 0x03f00000) >> 20) -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT2_SET(x) (((x) << 20) & 0x03f00000) -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT3_MSB 31 -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT3_LSB 26 -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT3_MASK 0xfc000000 -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT3_GET(x) (((x) & 0xfc000000) >> 26) -#define CHKSUM_ACC_DMATX_ARB_CFG_WGT3_SET(x) (((x) << 26) & 0xfc000000) - -/* macros for CHKSUM_ACC_RR_PKTCNT01 */ -#define CHKSUM_ACC_RR_PKTCNT01_ADDRESS 0x00000028 -#define CHKSUM_ACC_RR_PKTCNT01_OFFSET 0x00000028 -#define CHKSUM_ACC_RR_PKTCNT01_PKTCNT0_MSB 8 -#define CHKSUM_ACC_RR_PKTCNT01_PKTCNT0_LSB 0 -#define CHKSUM_ACC_RR_PKTCNT01_PKTCNT0_MASK 0x000001ff -#define CHKSUM_ACC_RR_PKTCNT01_PKTCNT0_GET(x) (((x) & 0x000001ff) >> 0) -#define CHKSUM_ACC_RR_PKTCNT01_PKTCNT0_SET(x) (((x) << 0) & 0x000001ff) -#define CHKSUM_ACC_RR_PKTCNT01_PKTCNT1_MSB 24 -#define CHKSUM_ACC_RR_PKTCNT01_PKTCNT1_LSB 16 -#define CHKSUM_ACC_RR_PKTCNT01_PKTCNT1_MASK 0x01ff0000 -#define CHKSUM_ACC_RR_PKTCNT01_PKTCNT1_GET(x) (((x) & 0x01ff0000) >> 16) -#define CHKSUM_ACC_RR_PKTCNT01_PKTCNT1_SET(x) (((x) << 16) & 0x01ff0000) - -/* macros for CHKSUM_ACC_RR_PKTCNT23 */ -#define CHKSUM_ACC_RR_PKTCNT23_ADDRESS 0x0000002c -#define CHKSUM_ACC_RR_PKTCNT23_OFFSET 0x0000002c -#define CHKSUM_ACC_RR_PKTCNT23_PKTCNT2_MSB 8 -#define CHKSUM_ACC_RR_PKTCNT23_PKTCNT2_LSB 0 -#define CHKSUM_ACC_RR_PKTCNT23_PKTCNT2_MASK 0x000001ff -#define CHKSUM_ACC_RR_PKTCNT23_PKTCNT2_GET(x) (((x) & 0x000001ff) >> 0) -#define CHKSUM_ACC_RR_PKTCNT23_PKTCNT2_SET(x) (((x) << 0) & 0x000001ff) -#define CHKSUM_ACC_RR_PKTCNT23_PKTCNT3_MSB 24 -#define CHKSUM_ACC_RR_PKTCNT23_PKTCNT3_LSB 16 -#define CHKSUM_ACC_RR_PKTCNT23_PKTCNT3_MASK 0x01ff0000 -#define CHKSUM_ACC_RR_PKTCNT23_PKTCNT3_GET(x) (((x) & 0x01ff0000) >> 16) -#define CHKSUM_ACC_RR_PKTCNT23_PKTCNT3_SET(x) (((x) << 16) & 0x01ff0000) - -/* macros for CHKSUM_ACC_TXST_PKTCNT */ -#define CHKSUM_ACC_TXST_PKTCNT_ADDRESS 0x00000030 -#define CHKSUM_ACC_TXST_PKTCNT_OFFSET 0x00000030 -#define CHKSUM_ACC_TXST_PKTCNT_PKTCNT1_MSB 15 -#define CHKSUM_ACC_TXST_PKTCNT_PKTCNT1_LSB 8 -#define CHKSUM_ACC_TXST_PKTCNT_PKTCNT1_MASK 0x0000ff00 -#define CHKSUM_ACC_TXST_PKTCNT_PKTCNT1_GET(x) (((x) & 0x0000ff00) >> 8) -#define CHKSUM_ACC_TXST_PKTCNT_PKTCNT1_SET(x) (((x) << 8) & 0x0000ff00) -#define CHKSUM_ACC_TXST_PKTCNT_PKTCNT2_MSB 23 -#define CHKSUM_ACC_TXST_PKTCNT_PKTCNT2_LSB 16 -#define CHKSUM_ACC_TXST_PKTCNT_PKTCNT2_MASK 0x00ff0000 -#define CHKSUM_ACC_TXST_PKTCNT_PKTCNT2_GET(x) (((x) & 0x00ff0000) >> 16) -#define CHKSUM_ACC_TXST_PKTCNT_PKTCNT2_SET(x) (((x) << 16) & 0x00ff0000) -#define CHKSUM_ACC_TXST_PKTCNT_PKTCNT3_MSB 31 -#define CHKSUM_ACC_TXST_PKTCNT_PKTCNT3_LSB 24 -#define CHKSUM_ACC_TXST_PKTCNT_PKTCNT3_MASK 0xff000000 -#define CHKSUM_ACC_TXST_PKTCNT_PKTCNT3_GET(x) (((x) & 0xff000000) >> 24) -#define CHKSUM_ACC_TXST_PKTCNT_PKTCNT3_SET(x) (((x) << 24) & 0xff000000) - -/* macros for CHKSUM_ACC_DMARX_CONTROL */ -#define CHKSUM_ACC_DMARX_CONTROL_ADDRESS 0x00000034 -#define CHKSUM_ACC_DMARX_CONTROL_OFFSET 0x00000034 -#define CHKSUM_ACC_DMARX_CONTROL_RXEN_MSB 0 -#define CHKSUM_ACC_DMARX_CONTROL_RXEN_LSB 0 -#define CHKSUM_ACC_DMARX_CONTROL_RXEN_MASK 0x00000001 -#define CHKSUM_ACC_DMARX_CONTROL_RXEN_GET(x) (((x) & 0x00000001) >> 0) -#define CHKSUM_ACC_DMARX_CONTROL_RXEN_SET(x) (((x) << 0) & 0x00000001) -#define CHKSUM_ACC_DMARX_CONTROL_LITTLEENDIAN_MSB 1 -#define CHKSUM_ACC_DMARX_CONTROL_LITTLEENDIAN_LSB 1 -#define CHKSUM_ACC_DMARX_CONTROL_LITTLEENDIAN_MASK 0x00000002 -#define CHKSUM_ACC_DMARX_CONTROL_LITTLEENDIAN_GET(x) (((x) & 0x00000002) >> 1) -#define CHKSUM_ACC_DMARX_CONTROL_LITTLEENDIAN_SET(x) (((x) << 1) & 0x00000002) - -/* macros for CHKSUM_ACC_DMARX_DESC */ -#define CHKSUM_ACC_DMARX_DESC_ADDRESS 0x00000038 -#define CHKSUM_ACC_DMARX_DESC_OFFSET 0x00000038 -#define CHKSUM_ACC_DMARX_DESC_ADDR_MSB 31 -#define CHKSUM_ACC_DMARX_DESC_ADDR_LSB 0 -#define CHKSUM_ACC_DMARX_DESC_ADDR_MASK 0xffffffff -#define CHKSUM_ACC_DMARX_DESC_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define CHKSUM_ACC_DMARX_DESC_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for CHKSUM_ACC_DMARX_DESC_STATUS */ -#define CHKSUM_ACC_DMARX_DESC_STATUS_ADDRESS 0x0000003c -#define CHKSUM_ACC_DMARX_DESC_STATUS_OFFSET 0x0000003c -#define CHKSUM_ACC_DMARX_DESC_STATUS_OVERFLOW_MSB 0 -#define CHKSUM_ACC_DMARX_DESC_STATUS_OVERFLOW_LSB 0 -#define CHKSUM_ACC_DMARX_DESC_STATUS_OVERFLOW_MASK 0x00000001 -#define CHKSUM_ACC_DMARX_DESC_STATUS_OVERFLOW_GET(x) (((x) & 0x00000001) >> 0) -#define CHKSUM_ACC_DMARX_DESC_STATUS_OVERFLOW_SET(x) (((x) << 0) & 0x00000001) -#define CHKSUM_ACC_DMARX_DESC_STATUS_BUSERROR_MSB 1 -#define CHKSUM_ACC_DMARX_DESC_STATUS_BUSERROR_LSB 1 -#define CHKSUM_ACC_DMARX_DESC_STATUS_BUSERROR_MASK 0x00000002 -#define CHKSUM_ACC_DMARX_DESC_STATUS_BUSERROR_GET(x) (((x) & 0x00000002) >> 1) -#define CHKSUM_ACC_DMARX_DESC_STATUS_BUSERROR_SET(x) (((x) << 1) & 0x00000002) -#define CHKSUM_ACC_DMARX_DESC_STATUS_DESC_INTR_MSB 2 -#define CHKSUM_ACC_DMARX_DESC_STATUS_DESC_INTR_LSB 2 -#define CHKSUM_ACC_DMARX_DESC_STATUS_DESC_INTR_MASK 0x00000004 -#define CHKSUM_ACC_DMARX_DESC_STATUS_DESC_INTR_GET(x) (((x) & 0x00000004) >> 2) -#define CHKSUM_ACC_DMARX_DESC_STATUS_DESC_INTR_SET(x) (((x) << 2) & 0x00000004) -#define CHKSUM_ACC_DMARX_DESC_STATUS_PKTCNT_MSB 23 -#define CHKSUM_ACC_DMARX_DESC_STATUS_PKTCNT_LSB 16 -#define CHKSUM_ACC_DMARX_DESC_STATUS_PKTCNT_MASK 0x00ff0000 -#define CHKSUM_ACC_DMARX_DESC_STATUS_PKTCNT_GET(x) (((x) & 0x00ff0000) >> 16) -#define CHKSUM_ACC_DMARX_DESC_STATUS_PKTCNT_SET(x) (((x) << 16) & 0x00ff0000) - -/* macros for CHKSUM_ACC_INTR */ -#define CHKSUM_ACC_INTR_ADDRESS 0x00000040 -#define CHKSUM_ACC_INTR_OFFSET 0x00000040 -#define CHKSUM_ACC_INTR_RX_VAL_MSB 3 -#define CHKSUM_ACC_INTR_RX_VAL_LSB 0 -#define CHKSUM_ACC_INTR_RX_VAL_MASK 0x0000000f -#define CHKSUM_ACC_INTR_RX_VAL_GET(x) (((x) & 0x0000000f) >> 0) -#define CHKSUM_ACC_INTR_TX_VAL_MSB 16 -#define CHKSUM_ACC_INTR_TX_VAL_LSB 4 -#define CHKSUM_ACC_INTR_TX_VAL_MASK 0x0001fff0 -#define CHKSUM_ACC_INTR_TX_VAL_GET(x) (((x) & 0x0001fff0) >> 4) - -/* macros for CHKSUM_ACC_IMASK */ -#define CHKSUM_ACC_IMASK_ADDRESS 0x00000044 -#define CHKSUM_ACC_IMASK_OFFSET 0x00000044 -#define CHKSUM_ACC_IMASK_RX_VAL_MSB 3 -#define CHKSUM_ACC_IMASK_RX_VAL_LSB 0 -#define CHKSUM_ACC_IMASK_RX_VAL_MASK 0x0000000f -#define CHKSUM_ACC_IMASK_RX_VAL_GET(x) (((x) & 0x0000000f) >> 0) -#define CHKSUM_ACC_IMASK_RX_VAL_SET(x) (((x) << 0) & 0x0000000f) -#define CHKSUM_ACC_IMASK_TX_VAL_MSB 16 -#define CHKSUM_ACC_IMASK_TX_VAL_LSB 4 -#define CHKSUM_ACC_IMASK_TX_VAL_MASK 0x0001fff0 -#define CHKSUM_ACC_IMASK_TX_VAL_GET(x) (((x) & 0x0001fff0) >> 4) -#define CHKSUM_ACC_IMASK_TX_VAL_SET(x) (((x) << 4) & 0x0001fff0) - -/* macros for CHKSUM_ACC_ARB_BURST */ -#define CHKSUM_ACC_ARB_BURST_ADDRESS 0x00000048 -#define CHKSUM_ACC_ARB_BURST_OFFSET 0x00000048 -#define CHKSUM_ACC_ARB_BURST_MAX_TX_MSB 9 -#define CHKSUM_ACC_ARB_BURST_MAX_TX_LSB 0 -#define CHKSUM_ACC_ARB_BURST_MAX_TX_MASK 0x000003ff -#define CHKSUM_ACC_ARB_BURST_MAX_TX_GET(x) (((x) & 0x000003ff) >> 0) -#define CHKSUM_ACC_ARB_BURST_MAX_TX_SET(x) (((x) << 0) & 0x000003ff) -#define CHKSUM_ACC_ARB_BURST_INCR16_EN_MSB 10 -#define CHKSUM_ACC_ARB_BURST_INCR16_EN_LSB 10 -#define CHKSUM_ACC_ARB_BURST_INCR16_EN_MASK 0x00000400 -#define CHKSUM_ACC_ARB_BURST_INCR16_EN_GET(x) (((x) & 0x00000400) >> 10) -#define CHKSUM_ACC_ARB_BURST_INCR16_EN_SET(x) (((x) << 10) & 0x00000400) -#define CHKSUM_ACC_ARB_BURST_INCR8_EN_MSB 11 -#define CHKSUM_ACC_ARB_BURST_INCR8_EN_LSB 11 -#define CHKSUM_ACC_ARB_BURST_INCR8_EN_MASK 0x00000800 -#define CHKSUM_ACC_ARB_BURST_INCR8_EN_GET(x) (((x) & 0x00000800) >> 11) -#define CHKSUM_ACC_ARB_BURST_INCR8_EN_SET(x) (((x) << 11) & 0x00000800) -#define CHKSUM_ACC_ARB_BURST_MAX_RX_MSB 25 -#define CHKSUM_ACC_ARB_BURST_MAX_RX_LSB 16 -#define CHKSUM_ACC_ARB_BURST_MAX_RX_MASK 0x03ff0000 -#define CHKSUM_ACC_ARB_BURST_MAX_RX_GET(x) (((x) & 0x03ff0000) >> 16) -#define CHKSUM_ACC_ARB_BURST_MAX_RX_SET(x) (((x) << 16) & 0x03ff0000) - -/* macros for CHKSUM_ACC_RESET_DMA */ -#define CHKSUM_ACC_RESET_DMA_ADDRESS 0x00000050 -#define CHKSUM_ACC_RESET_DMA_OFFSET 0x00000050 -#define CHKSUM_ACC_RESET_DMA_TX_MSB 0 -#define CHKSUM_ACC_RESET_DMA_TX_LSB 0 -#define CHKSUM_ACC_RESET_DMA_TX_MASK 0x00000001 -#define CHKSUM_ACC_RESET_DMA_TX_GET(x) (((x) & 0x00000001) >> 0) -#define CHKSUM_ACC_RESET_DMA_TX_SET(x) (((x) << 0) & 0x00000001) -#define CHKSUM_ACC_RESET_DMA_RX_MSB 1 -#define CHKSUM_ACC_RESET_DMA_RX_LSB 1 -#define CHKSUM_ACC_RESET_DMA_RX_MASK 0x00000002 -#define CHKSUM_ACC_RESET_DMA_RX_GET(x) (((x) & 0x00000002) >> 1) -#define CHKSUM_ACC_RESET_DMA_RX_SET(x) (((x) << 1) & 0x00000002) - -/* macros for CHKSUM_CONFIG */ -#define CHKSUM_CONFIG_ADDRESS 0x00000054 -#define CHKSUM_CONFIG_OFFSET 0x00000054 -#define CHKSUM_CONFIG_CHKSUM_SWAP_MSB 0 -#define CHKSUM_CONFIG_CHKSUM_SWAP_LSB 0 -#define CHKSUM_CONFIG_CHKSUM_SWAP_MASK 0x00000001 -#define CHKSUM_CONFIG_CHKSUM_SWAP_GET(x) (((x) & 0x00000001) >> 0) -#define CHKSUM_CONFIG_CHKSUM_SWAP_SET(x) (((x) << 0) & 0x00000001) -#define CHKSUM_CONFIG_TXFIFO_MAX_TH_MSB 9 -#define CHKSUM_CONFIG_TXFIFO_MAX_TH_LSB 4 -#define CHKSUM_CONFIG_TXFIFO_MAX_TH_MASK 0x000003f0 -#define CHKSUM_CONFIG_TXFIFO_MAX_TH_GET(x) (((x) & 0x000003f0) >> 4) -#define CHKSUM_CONFIG_TXFIFO_MAX_TH_SET(x) (((x) << 4) & 0x000003f0) -#define CHKSUM_CONFIG_TXFIFO_MIN_TH_MSB 21 -#define CHKSUM_CONFIG_TXFIFO_MIN_TH_LSB 16 -#define CHKSUM_CONFIG_TXFIFO_MIN_TH_MASK 0x003f0000 -#define CHKSUM_CONFIG_TXFIFO_MIN_TH_GET(x) (((x) & 0x003f0000) >> 16) -#define CHKSUM_CONFIG_TXFIFO_MIN_TH_SET(x) (((x) << 16) & 0x003f0000) -#define CHKSUM_CONFIG_SPARE_MSB 31 -#define CHKSUM_CONFIG_SPARE_LSB 22 -#define CHKSUM_CONFIG_SPARE_MASK 0xffc00000 -#define CHKSUM_CONFIG_SPARE_GET(x) (((x) & 0xffc00000) >> 22) -#define CHKSUM_CONFIG_SPARE_SET(x) (((x) << 22) & 0xffc00000) - - -#ifndef __ASSEMBLER__ - -typedef struct chk_sum_seg_acc_reg_reg_s { - volatile unsigned int CHKSUM_ACC_DMATX_CONTROL0; /* 0x0 - 0x4 */ - volatile unsigned int CHKSUM_ACC_DMATX_CONTROL1; /* 0x4 - 0x8 */ - volatile unsigned int CHKSUM_ACC_DMATX_CONTROL2; /* 0x8 - 0xc */ - volatile unsigned int CHKSUM_ACC_DMATX_CONTROL3; /* 0xc - 0x10 */ - volatile unsigned int CHKSUM_ACC_DMATX_DESC0; /* 0x10 - 0x14 */ - volatile unsigned int CHKSUM_ACC_DMATX_DESC1; /* 0x14 - 0x18 */ - volatile unsigned int CHKSUM_ACC_DMATX_DESC2; /* 0x18 - 0x1c */ - volatile unsigned int CHKSUM_ACC_DMATX_DESC3; /* 0x1c - 0x20 */ - volatile unsigned int CHKSUM_ACC_DMATX_DESC_STATUS; /* 0x20 - 0x24 */ - volatile unsigned int CHKSUM_ACC_DMATX_ARB_CFG; /* 0x24 - 0x28 */ - volatile unsigned int CHKSUM_ACC_RR_PKTCNT01; /* 0x28 - 0x2c */ - volatile unsigned int CHKSUM_ACC_RR_PKTCNT23; /* 0x2c - 0x30 */ - volatile unsigned int CHKSUM_ACC_TXST_PKTCNT; /* 0x30 - 0x34 */ - volatile unsigned int CHKSUM_ACC_DMARX_CONTROL; /* 0x34 - 0x38 */ - volatile unsigned int CHKSUM_ACC_DMARX_DESC; /* 0x38 - 0x3c */ - volatile unsigned int CHKSUM_ACC_DMARX_DESC_STATUS; /* 0x3c - 0x40 */ - volatile unsigned int CHKSUM_ACC_INTR; /* 0x40 - 0x44 */ - volatile unsigned int CHKSUM_ACC_IMASK; /* 0x44 - 0x48 */ - volatile unsigned int CHKSUM_ACC_ARB_BURST; /* 0x48 - 0x4c */ - volatile char pad__0[0x4]; /* 0x4c - 0x50 */ - volatile unsigned int CHKSUM_ACC_RESET_DMA; /* 0x50 - 0x54 */ - volatile unsigned int CHKSUM_CONFIG; /* 0x54 - 0x58 */ -} chk_sum_seg_acc_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _CHK_SUM_SEG_ACC_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/efuse_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/efuse_reg.h deleted file mode 100644 index 9ee5e0d90605..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/efuse_reg.h +++ /dev/null @@ -1,44 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "efuse_wlan_reg.h" - - -#ifndef BT_HEADERS - -#define EFUSE_INTF_ADDRESS EFUSE_INTF0_ADDRESS -#define EFUSE_INTF_OFFSET EFUSE_INTF0_OFFSET -#define EFUSE_INTF_R_MSB EFUSE_INTF0_R_MSB -#define EFUSE_INTF_R_LSB EFUSE_INTF0_R_LSB -#define EFUSE_INTF_R_MASK EFUSE_INTF0_R_MASK -#define EFUSE_INTF_R_GET(x) EFUSE_INTF0_R_GET(x) -#define EFUSE_INTF_R_SET(x) EFUSE_INTF0_R_SET(x) - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/efuse_wlan_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/efuse_wlan_reg.h deleted file mode 100644 index 0575f4c9a080..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/efuse_wlan_reg.h +++ /dev/null @@ -1,153 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _EFUSE_REG_REG_H_ -#define _EFUSE_REG_REG_H_ - -#define EFUSE_WR_ENABLE_REG_ADDRESS 0x00000000 -#define EFUSE_WR_ENABLE_REG_OFFSET 0x00000000 -#define EFUSE_WR_ENABLE_REG_V_MSB 0 -#define EFUSE_WR_ENABLE_REG_V_LSB 0 -#define EFUSE_WR_ENABLE_REG_V_MASK 0x00000001 -#define EFUSE_WR_ENABLE_REG_V_GET(x) (((x) & EFUSE_WR_ENABLE_REG_V_MASK) >> EFUSE_WR_ENABLE_REG_V_LSB) -#define EFUSE_WR_ENABLE_REG_V_SET(x) (((x) << EFUSE_WR_ENABLE_REG_V_LSB) & EFUSE_WR_ENABLE_REG_V_MASK) - -#define EFUSE_INT_ENABLE_REG_ADDRESS 0x00000004 -#define EFUSE_INT_ENABLE_REG_OFFSET 0x00000004 -#define EFUSE_INT_ENABLE_REG_V_MSB 0 -#define EFUSE_INT_ENABLE_REG_V_LSB 0 -#define EFUSE_INT_ENABLE_REG_V_MASK 0x00000001 -#define EFUSE_INT_ENABLE_REG_V_GET(x) (((x) & EFUSE_INT_ENABLE_REG_V_MASK) >> EFUSE_INT_ENABLE_REG_V_LSB) -#define EFUSE_INT_ENABLE_REG_V_SET(x) (((x) << EFUSE_INT_ENABLE_REG_V_LSB) & EFUSE_INT_ENABLE_REG_V_MASK) - -#define EFUSE_INT_STATUS_REG_ADDRESS 0x00000008 -#define EFUSE_INT_STATUS_REG_OFFSET 0x00000008 -#define EFUSE_INT_STATUS_REG_V_MSB 0 -#define EFUSE_INT_STATUS_REG_V_LSB 0 -#define EFUSE_INT_STATUS_REG_V_MASK 0x00000001 -#define EFUSE_INT_STATUS_REG_V_GET(x) (((x) & EFUSE_INT_STATUS_REG_V_MASK) >> EFUSE_INT_STATUS_REG_V_LSB) -#define EFUSE_INT_STATUS_REG_V_SET(x) (((x) << EFUSE_INT_STATUS_REG_V_LSB) & EFUSE_INT_STATUS_REG_V_MASK) - -#define BITMASK_WR_REG_ADDRESS 0x0000000c -#define BITMASK_WR_REG_OFFSET 0x0000000c -#define BITMASK_WR_REG_V_MSB 31 -#define BITMASK_WR_REG_V_LSB 0 -#define BITMASK_WR_REG_V_MASK 0xffffffff -#define BITMASK_WR_REG_V_GET(x) (((x) & BITMASK_WR_REG_V_MASK) >> BITMASK_WR_REG_V_LSB) -#define BITMASK_WR_REG_V_SET(x) (((x) << BITMASK_WR_REG_V_LSB) & BITMASK_WR_REG_V_MASK) - -#define VDDQ_SETTLE_TIME_REG_ADDRESS 0x00000010 -#define VDDQ_SETTLE_TIME_REG_OFFSET 0x00000010 -#define VDDQ_SETTLE_TIME_REG_V_MSB 31 -#define VDDQ_SETTLE_TIME_REG_V_LSB 0 -#define VDDQ_SETTLE_TIME_REG_V_MASK 0xffffffff -#define VDDQ_SETTLE_TIME_REG_V_GET(x) (((x) & VDDQ_SETTLE_TIME_REG_V_MASK) >> VDDQ_SETTLE_TIME_REG_V_LSB) -#define VDDQ_SETTLE_TIME_REG_V_SET(x) (((x) << VDDQ_SETTLE_TIME_REG_V_LSB) & VDDQ_SETTLE_TIME_REG_V_MASK) - -#define VDDQ_HOLD_TIME_REG_ADDRESS 0x00000014 -#define VDDQ_HOLD_TIME_REG_OFFSET 0x00000014 -#define VDDQ_HOLD_TIME_REG_V_MSB 31 -#define VDDQ_HOLD_TIME_REG_V_LSB 0 -#define VDDQ_HOLD_TIME_REG_V_MASK 0xffffffff -#define VDDQ_HOLD_TIME_REG_V_GET(x) (((x) & VDDQ_HOLD_TIME_REG_V_MASK) >> VDDQ_HOLD_TIME_REG_V_LSB) -#define VDDQ_HOLD_TIME_REG_V_SET(x) (((x) << VDDQ_HOLD_TIME_REG_V_LSB) & VDDQ_HOLD_TIME_REG_V_MASK) - -#define RD_STROBE_PW_REG_ADDRESS 0x00000018 -#define RD_STROBE_PW_REG_OFFSET 0x00000018 -#define RD_STROBE_PW_REG_V_MSB 31 -#define RD_STROBE_PW_REG_V_LSB 0 -#define RD_STROBE_PW_REG_V_MASK 0xffffffff -#define RD_STROBE_PW_REG_V_GET(x) (((x) & RD_STROBE_PW_REG_V_MASK) >> RD_STROBE_PW_REG_V_LSB) -#define RD_STROBE_PW_REG_V_SET(x) (((x) << RD_STROBE_PW_REG_V_LSB) & RD_STROBE_PW_REG_V_MASK) - -#define PG_STROBE_PW_REG_ADDRESS 0x0000001c -#define PG_STROBE_PW_REG_OFFSET 0x0000001c -#define PG_STROBE_PW_REG_V_MSB 31 -#define PG_STROBE_PW_REG_V_LSB 0 -#define PG_STROBE_PW_REG_V_MASK 0xffffffff -#define PG_STROBE_PW_REG_V_GET(x) (((x) & PG_STROBE_PW_REG_V_MASK) >> PG_STROBE_PW_REG_V_LSB) -#define PG_STROBE_PW_REG_V_SET(x) (((x) << PG_STROBE_PW_REG_V_LSB) & PG_STROBE_PW_REG_V_MASK) - -#define PGENB_SETUP_HOLD_TIME_REG_ADDRESS 0x00000020 -#define PGENB_SETUP_HOLD_TIME_REG_OFFSET 0x00000020 -#define PGENB_SETUP_HOLD_TIME_REG_V_MSB 31 -#define PGENB_SETUP_HOLD_TIME_REG_V_LSB 0 -#define PGENB_SETUP_HOLD_TIME_REG_V_MASK 0xffffffff -#define PGENB_SETUP_HOLD_TIME_REG_V_GET(x) (((x) & PGENB_SETUP_HOLD_TIME_REG_V_MASK) >> PGENB_SETUP_HOLD_TIME_REG_V_LSB) -#define PGENB_SETUP_HOLD_TIME_REG_V_SET(x) (((x) << PGENB_SETUP_HOLD_TIME_REG_V_LSB) & PGENB_SETUP_HOLD_TIME_REG_V_MASK) - -#define STROBE_PULSE_INTERVAL_REG_ADDRESS 0x00000024 -#define STROBE_PULSE_INTERVAL_REG_OFFSET 0x00000024 -#define STROBE_PULSE_INTERVAL_REG_V_MSB 31 -#define STROBE_PULSE_INTERVAL_REG_V_LSB 0 -#define STROBE_PULSE_INTERVAL_REG_V_MASK 0xffffffff -#define STROBE_PULSE_INTERVAL_REG_V_GET(x) (((x) & STROBE_PULSE_INTERVAL_REG_V_MASK) >> STROBE_PULSE_INTERVAL_REG_V_LSB) -#define STROBE_PULSE_INTERVAL_REG_V_SET(x) (((x) << STROBE_PULSE_INTERVAL_REG_V_LSB) & STROBE_PULSE_INTERVAL_REG_V_MASK) - -#define CSB_ADDR_LOAD_SETUP_HOLD_REG_ADDRESS 0x00000028 -#define CSB_ADDR_LOAD_SETUP_HOLD_REG_OFFSET 0x00000028 -#define CSB_ADDR_LOAD_SETUP_HOLD_REG_V_MSB 31 -#define CSB_ADDR_LOAD_SETUP_HOLD_REG_V_LSB 0 -#define CSB_ADDR_LOAD_SETUP_HOLD_REG_V_MASK 0xffffffff -#define CSB_ADDR_LOAD_SETUP_HOLD_REG_V_GET(x) (((x) & CSB_ADDR_LOAD_SETUP_HOLD_REG_V_MASK) >> CSB_ADDR_LOAD_SETUP_HOLD_REG_V_LSB) -#define CSB_ADDR_LOAD_SETUP_HOLD_REG_V_SET(x) (((x) << CSB_ADDR_LOAD_SETUP_HOLD_REG_V_LSB) & CSB_ADDR_LOAD_SETUP_HOLD_REG_V_MASK) - -#define EFUSE_INTF0_ADDRESS 0x00000800 -#define EFUSE_INTF0_OFFSET 0x00000800 -#define EFUSE_INTF0_R_MSB 31 -#define EFUSE_INTF0_R_LSB 0 -#define EFUSE_INTF0_R_MASK 0xffffffff -#define EFUSE_INTF0_R_GET(x) (((x) & EFUSE_INTF0_R_MASK) >> EFUSE_INTF0_R_LSB) -#define EFUSE_INTF0_R_SET(x) (((x) << EFUSE_INTF0_R_LSB) & EFUSE_INTF0_R_MASK) - -#define EFUSE_INTF1_ADDRESS 0x00001000 -#define EFUSE_INTF1_OFFSET 0x00001000 -#define EFUSE_INTF1_R_MSB 31 -#define EFUSE_INTF1_R_LSB 0 -#define EFUSE_INTF1_R_MASK 0xffffffff -#define EFUSE_INTF1_R_GET(x) (((x) & EFUSE_INTF1_R_MASK) >> EFUSE_INTF1_R_LSB) -#define EFUSE_INTF1_R_SET(x) (((x) << EFUSE_INTF1_R_LSB) & EFUSE_INTF1_R_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct efuse_reg_reg_s { - volatile unsigned int efuse_wr_enable_reg; - volatile unsigned int efuse_int_enable_reg; - volatile unsigned int efuse_int_status_reg; - volatile unsigned int bitmask_wr_reg; - volatile unsigned int vddq_settle_time_reg; - volatile unsigned int vddq_hold_time_reg; - volatile unsigned int rd_strobe_pw_reg; - volatile unsigned int pg_strobe_pw_reg; - volatile unsigned int pgenb_setup_hold_time_reg; - volatile unsigned int strobe_pulse_interval_reg; - volatile unsigned int csb_addr_load_setup_hold_reg; - unsigned char pad0[2004]; /* pad to 0x800 */ - volatile unsigned int efuse_intf0[512]; - volatile unsigned int efuse_intf1[512]; -} efuse_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _EFUSE_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/fpga_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/fpga_reg.h deleted file mode 100644 index efb8f4afc1b8..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/fpga_reg.h +++ /dev/null @@ -1,137 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _FPGA_REG_REG_H_ -#define _FPGA_REG_REG_H_ - -#define FPGA_REG1_ADDRESS 0x00000000 -#define FPGA_REG1_OFFSET 0x00000000 -#define FPGA_REG1_FPGA_SRIF_DELAY_MSB 31 -#define FPGA_REG1_FPGA_SRIF_DELAY_LSB 31 -#define FPGA_REG1_FPGA_SRIF_DELAY_MASK 0x80000000 -#define FPGA_REG1_FPGA_SRIF_DELAY_GET(x) (((x) & FPGA_REG1_FPGA_SRIF_DELAY_MASK) >> FPGA_REG1_FPGA_SRIF_DELAY_LSB) -#define FPGA_REG1_FPGA_SRIF_DELAY_SET(x) (((x) << FPGA_REG1_FPGA_SRIF_DELAY_LSB) & FPGA_REG1_FPGA_SRIF_DELAY_MASK) -#define FPGA_REG1_SPARE_FPGA_REG1_MSB 30 -#define FPGA_REG1_SPARE_FPGA_REG1_LSB 21 -#define FPGA_REG1_SPARE_FPGA_REG1_MASK 0x7fe00000 -#define FPGA_REG1_SPARE_FPGA_REG1_GET(x) (((x) & FPGA_REG1_SPARE_FPGA_REG1_MASK) >> FPGA_REG1_SPARE_FPGA_REG1_LSB) -#define FPGA_REG1_SPARE_FPGA_REG1_SET(x) (((x) << FPGA_REG1_SPARE_FPGA_REG1_LSB) & FPGA_REG1_SPARE_FPGA_REG1_MASK) -#define FPGA_REG1_LONG_SHIFT_SAMPLE_PHASE_MSB 20 -#define FPGA_REG1_LONG_SHIFT_SAMPLE_PHASE_LSB 16 -#define FPGA_REG1_LONG_SHIFT_SAMPLE_PHASE_MASK 0x001f0000 -#define FPGA_REG1_LONG_SHIFT_SAMPLE_PHASE_GET(x) (((x) & FPGA_REG1_LONG_SHIFT_SAMPLE_PHASE_MASK) >> FPGA_REG1_LONG_SHIFT_SAMPLE_PHASE_LSB) -#define FPGA_REG1_LONG_SHIFT_SAMPLE_PHASE_SET(x) (((x) << FPGA_REG1_LONG_SHIFT_SAMPLE_PHASE_LSB) & FPGA_REG1_LONG_SHIFT_SAMPLE_PHASE_MASK) -#define FPGA_REG1_LONG_SHIFT_DRIVE_PHASE_MSB 15 -#define FPGA_REG1_LONG_SHIFT_DRIVE_PHASE_LSB 11 -#define FPGA_REG1_LONG_SHIFT_DRIVE_PHASE_MASK 0x0000f800 -#define FPGA_REG1_LONG_SHIFT_DRIVE_PHASE_GET(x) (((x) & FPGA_REG1_LONG_SHIFT_DRIVE_PHASE_MASK) >> FPGA_REG1_LONG_SHIFT_DRIVE_PHASE_LSB) -#define FPGA_REG1_LONG_SHIFT_DRIVE_PHASE_SET(x) (((x) << FPGA_REG1_LONG_SHIFT_DRIVE_PHASE_LSB) & FPGA_REG1_LONG_SHIFT_DRIVE_PHASE_MASK) -#define FPGA_REG1_ENABLE_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_MSB 10 -#define FPGA_REG1_ENABLE_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_LSB 10 -#define FPGA_REG1_ENABLE_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_MASK 0x00000400 -#define FPGA_REG1_ENABLE_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_GET(x) (((x) & FPGA_REG1_ENABLE_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_MASK) >> FPGA_REG1_ENABLE_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_LSB) -#define FPGA_REG1_ENABLE_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_SET(x) (((x) << FPGA_REG1_ENABLE_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_LSB) & FPGA_REG1_ENABLE_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_MASK) -#define FPGA_REG1_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_MSB 9 -#define FPGA_REG1_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_LSB 8 -#define FPGA_REG1_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_MASK 0x00000300 -#define FPGA_REG1_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_GET(x) (((x) & FPGA_REG1_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_MASK) >> FPGA_REG1_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_LSB) -#define FPGA_REG1_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_SET(x) (((x) << FPGA_REG1_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_LSB) & FPGA_REG1_LONG_SHIFT_CHAIN_OVERRIDE_INDEX_MASK) -#define FPGA_REG1_EMUL_RADIO_CLOCK_RATIO_MSB 7 -#define FPGA_REG1_EMUL_RADIO_CLOCK_RATIO_LSB 4 -#define FPGA_REG1_EMUL_RADIO_CLOCK_RATIO_MASK 0x000000f0 -#define FPGA_REG1_EMUL_RADIO_CLOCK_RATIO_GET(x) (((x) & FPGA_REG1_EMUL_RADIO_CLOCK_RATIO_MASK) >> FPGA_REG1_EMUL_RADIO_CLOCK_RATIO_LSB) -#define FPGA_REG1_EMUL_RADIO_CLOCK_RATIO_SET(x) (((x) << FPGA_REG1_EMUL_RADIO_CLOCK_RATIO_LSB) & FPGA_REG1_EMUL_RADIO_CLOCK_RATIO_MASK) -#define FPGA_REG1_DCM_RELEASE_MSB 2 -#define FPGA_REG1_DCM_RELEASE_LSB 2 -#define FPGA_REG1_DCM_RELEASE_MASK 0x00000004 -#define FPGA_REG1_DCM_RELEASE_GET(x) (((x) & FPGA_REG1_DCM_RELEASE_MASK) >> FPGA_REG1_DCM_RELEASE_LSB) -#define FPGA_REG1_DCM_RELEASE_SET(x) (((x) << FPGA_REG1_DCM_RELEASE_LSB) & FPGA_REG1_DCM_RELEASE_MASK) - -#define FPGA_REG2_ADDRESS 0x00000004 -#define FPGA_REG2_OFFSET 0x00000004 -#define FPGA_REG2_FPGA_SPARE_MSB 31 -#define FPGA_REG2_FPGA_SPARE_LSB 14 -#define FPGA_REG2_FPGA_SPARE_MASK 0xffffc000 -#define FPGA_REG2_FPGA_SPARE_GET(x) (((x) & FPGA_REG2_FPGA_SPARE_MASK) >> FPGA_REG2_FPGA_SPARE_LSB) -#define FPGA_REG2_FPGA_SPARE_SET(x) (((x) << FPGA_REG2_FPGA_SPARE_LSB) & FPGA_REG2_FPGA_SPARE_MASK) -#define FPGA_REG2_FPGA_LOOPBACK_I2C_MSB 13 -#define FPGA_REG2_FPGA_LOOPBACK_I2C_LSB 13 -#define FPGA_REG2_FPGA_LOOPBACK_I2C_MASK 0x00002000 -#define FPGA_REG2_FPGA_LOOPBACK_I2C_GET(x) (((x) & FPGA_REG2_FPGA_LOOPBACK_I2C_MASK) >> FPGA_REG2_FPGA_LOOPBACK_I2C_LSB) -#define FPGA_REG2_FPGA_LOOPBACK_I2C_SET(x) (((x) << FPGA_REG2_FPGA_LOOPBACK_I2C_LSB) & FPGA_REG2_FPGA_LOOPBACK_I2C_MASK) -#define FPGA_REG2_FPGA_OWL_PLL_ENABLED_MSB 12 -#define FPGA_REG2_FPGA_OWL_PLL_ENABLED_LSB 12 -#define FPGA_REG2_FPGA_OWL_PLL_ENABLED_MASK 0x00001000 -#define FPGA_REG2_FPGA_OWL_PLL_ENABLED_GET(x) (((x) & FPGA_REG2_FPGA_OWL_PLL_ENABLED_MASK) >> FPGA_REG2_FPGA_OWL_PLL_ENABLED_LSB) -#define FPGA_REG2_FPGA_OWL_PLL_ENABLED_SET(x) (((x) << FPGA_REG2_FPGA_OWL_PLL_ENABLED_LSB) & FPGA_REG2_FPGA_OWL_PLL_ENABLED_MASK) -#define FPGA_REG2_FPGA_IP_REVISION_MSB 11 -#define FPGA_REG2_FPGA_IP_REVISION_LSB 8 -#define FPGA_REG2_FPGA_IP_REVISION_MASK 0x00000f00 -#define FPGA_REG2_FPGA_IP_REVISION_GET(x) (((x) & FPGA_REG2_FPGA_IP_REVISION_MASK) >> FPGA_REG2_FPGA_IP_REVISION_LSB) -#define FPGA_REG2_FPGA_IP_REVISION_SET(x) (((x) << FPGA_REG2_FPGA_IP_REVISION_LSB) & FPGA_REG2_FPGA_IP_REVISION_MASK) -#define FPGA_REG2_FPGA_IP_RELEASE_VERSION_MSB 7 -#define FPGA_REG2_FPGA_IP_RELEASE_VERSION_LSB 4 -#define FPGA_REG2_FPGA_IP_RELEASE_VERSION_MASK 0x000000f0 -#define FPGA_REG2_FPGA_IP_RELEASE_VERSION_GET(x) (((x) & FPGA_REG2_FPGA_IP_RELEASE_VERSION_MASK) >> FPGA_REG2_FPGA_IP_RELEASE_VERSION_LSB) -#define FPGA_REG2_FPGA_IP_RELEASE_VERSION_SET(x) (((x) << FPGA_REG2_FPGA_IP_RELEASE_VERSION_LSB) & FPGA_REG2_FPGA_IP_RELEASE_VERSION_MASK) -#define FPGA_REG2_FPGA_PLATFORM_TYPE_MSB 3 -#define FPGA_REG2_FPGA_PLATFORM_TYPE_LSB 0 -#define FPGA_REG2_FPGA_PLATFORM_TYPE_MASK 0x0000000f -#define FPGA_REG2_FPGA_PLATFORM_TYPE_GET(x) (((x) & FPGA_REG2_FPGA_PLATFORM_TYPE_MASK) >> FPGA_REG2_FPGA_PLATFORM_TYPE_LSB) -#define FPGA_REG2_FPGA_PLATFORM_TYPE_SET(x) (((x) << FPGA_REG2_FPGA_PLATFORM_TYPE_LSB) & FPGA_REG2_FPGA_PLATFORM_TYPE_MASK) - -#define FPGA_REG4_ADDRESS 0x00000008 -#define FPGA_REG4_OFFSET 0x00000008 -#define FPGA_REG4_RADIO_0_TDO_MSB 3 -#define FPGA_REG4_RADIO_0_TDO_LSB 3 -#define FPGA_REG4_RADIO_0_TDO_MASK 0x00000008 -#define FPGA_REG4_RADIO_0_TDO_GET(x) (((x) & FPGA_REG4_RADIO_0_TDO_MASK) >> FPGA_REG4_RADIO_0_TDO_LSB) -#define FPGA_REG4_RADIO_0_TDO_SET(x) (((x) << FPGA_REG4_RADIO_0_TDO_LSB) & FPGA_REG4_RADIO_0_TDO_MASK) -#define FPGA_REG4_RADIO_0_TMS_MSB 2 -#define FPGA_REG4_RADIO_0_TMS_LSB 2 -#define FPGA_REG4_RADIO_0_TMS_MASK 0x00000004 -#define FPGA_REG4_RADIO_0_TMS_GET(x) (((x) & FPGA_REG4_RADIO_0_TMS_MASK) >> FPGA_REG4_RADIO_0_TMS_LSB) -#define FPGA_REG4_RADIO_0_TMS_SET(x) (((x) << FPGA_REG4_RADIO_0_TMS_LSB) & FPGA_REG4_RADIO_0_TMS_MASK) -#define FPGA_REG4_RADIO_0_TDI_MSB 1 -#define FPGA_REG4_RADIO_0_TDI_LSB 1 -#define FPGA_REG4_RADIO_0_TDI_MASK 0x00000002 -#define FPGA_REG4_RADIO_0_TDI_GET(x) (((x) & FPGA_REG4_RADIO_0_TDI_MASK) >> FPGA_REG4_RADIO_0_TDI_LSB) -#define FPGA_REG4_RADIO_0_TDI_SET(x) (((x) << FPGA_REG4_RADIO_0_TDI_LSB) & FPGA_REG4_RADIO_0_TDI_MASK) -#define FPGA_REG4_RADIO_0_TCK_MSB 0 -#define FPGA_REG4_RADIO_0_TCK_LSB 0 -#define FPGA_REG4_RADIO_0_TCK_MASK 0x00000001 -#define FPGA_REG4_RADIO_0_TCK_GET(x) (((x) & FPGA_REG4_RADIO_0_TCK_MASK) >> FPGA_REG4_RADIO_0_TCK_LSB) -#define FPGA_REG4_RADIO_0_TCK_SET(x) (((x) << FPGA_REG4_RADIO_0_TCK_LSB) & FPGA_REG4_RADIO_0_TCK_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct fpga_reg_reg_s { - volatile unsigned int fpga_reg1; - volatile unsigned int fpga_reg2; - volatile unsigned int fpga_reg4; -} fpga_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _FPGA_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/gpio_athr_wlan_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/gpio_athr_wlan_reg.h deleted file mode 100644 index dc61bc9178cb..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/gpio_athr_wlan_reg.h +++ /dev/null @@ -1,2638 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _GPIO_ATHR_WLAN_REG_REG_H_ -#define _GPIO_ATHR_WLAN_REG_REG_H_ - -#define WLAN_GPIO_OUT_LOW_ADDRESS 0x00000000 -#define WLAN_GPIO_OUT_LOW_OFFSET 0x00000000 -#define WLAN_GPIO_OUT_LOW_DATA_MSB 31 -#define WLAN_GPIO_OUT_LOW_DATA_LSB 0 -#define WLAN_GPIO_OUT_LOW_DATA_MASK 0xffffffff -#define WLAN_GPIO_OUT_LOW_DATA_GET(x) (((x) & WLAN_GPIO_OUT_LOW_DATA_MASK) >> WLAN_GPIO_OUT_LOW_DATA_LSB) -#define WLAN_GPIO_OUT_LOW_DATA_SET(x) (((x) << WLAN_GPIO_OUT_LOW_DATA_LSB) & WLAN_GPIO_OUT_LOW_DATA_MASK) - -#define WLAN_GPIO_OUT_W1TS_LOW_ADDRESS 0x00000004 -#define WLAN_GPIO_OUT_W1TS_LOW_OFFSET 0x00000004 -#define WLAN_GPIO_OUT_W1TS_LOW_DATA_MSB 31 -#define WLAN_GPIO_OUT_W1TS_LOW_DATA_LSB 0 -#define WLAN_GPIO_OUT_W1TS_LOW_DATA_MASK 0xffffffff -#define WLAN_GPIO_OUT_W1TS_LOW_DATA_GET(x) (((x) & WLAN_GPIO_OUT_W1TS_LOW_DATA_MASK) >> WLAN_GPIO_OUT_W1TS_LOW_DATA_LSB) -#define WLAN_GPIO_OUT_W1TS_LOW_DATA_SET(x) (((x) << WLAN_GPIO_OUT_W1TS_LOW_DATA_LSB) & WLAN_GPIO_OUT_W1TS_LOW_DATA_MASK) - -#define WLAN_GPIO_OUT_W1TC_LOW_ADDRESS 0x00000008 -#define WLAN_GPIO_OUT_W1TC_LOW_OFFSET 0x00000008 -#define WLAN_GPIO_OUT_W1TC_LOW_DATA_MSB 31 -#define WLAN_GPIO_OUT_W1TC_LOW_DATA_LSB 0 -#define WLAN_GPIO_OUT_W1TC_LOW_DATA_MASK 0xffffffff -#define WLAN_GPIO_OUT_W1TC_LOW_DATA_GET(x) (((x) & WLAN_GPIO_OUT_W1TC_LOW_DATA_MASK) >> WLAN_GPIO_OUT_W1TC_LOW_DATA_LSB) -#define WLAN_GPIO_OUT_W1TC_LOW_DATA_SET(x) (((x) << WLAN_GPIO_OUT_W1TC_LOW_DATA_LSB) & WLAN_GPIO_OUT_W1TC_LOW_DATA_MASK) - -#define WLAN_GPIO_OUT_HIGH_ADDRESS 0x0000000c -#define WLAN_GPIO_OUT_HIGH_OFFSET 0x0000000c -#define WLAN_GPIO_OUT_HIGH_DATA_MSB 31 -#define WLAN_GPIO_OUT_HIGH_DATA_LSB 0 -#define WLAN_GPIO_OUT_HIGH_DATA_MASK 0xffffffff -#define WLAN_GPIO_OUT_HIGH_DATA_GET(x) (((x) & WLAN_GPIO_OUT_HIGH_DATA_MASK) >> WLAN_GPIO_OUT_HIGH_DATA_LSB) -#define WLAN_GPIO_OUT_HIGH_DATA_SET(x) (((x) << WLAN_GPIO_OUT_HIGH_DATA_LSB) & WLAN_GPIO_OUT_HIGH_DATA_MASK) - -#define WLAN_GPIO_OUT_W1TS_HIGH_ADDRESS 0x00000010 -#define WLAN_GPIO_OUT_W1TS_HIGH_OFFSET 0x00000010 -#define WLAN_GPIO_OUT_W1TS_HIGH_DATA_MSB 31 -#define WLAN_GPIO_OUT_W1TS_HIGH_DATA_LSB 0 -#define WLAN_GPIO_OUT_W1TS_HIGH_DATA_MASK 0xffffffff -#define WLAN_GPIO_OUT_W1TS_HIGH_DATA_GET(x) (((x) & WLAN_GPIO_OUT_W1TS_HIGH_DATA_MASK) >> WLAN_GPIO_OUT_W1TS_HIGH_DATA_LSB) -#define WLAN_GPIO_OUT_W1TS_HIGH_DATA_SET(x) (((x) << WLAN_GPIO_OUT_W1TS_HIGH_DATA_LSB) & WLAN_GPIO_OUT_W1TS_HIGH_DATA_MASK) - -#define WLAN_GPIO_OUT_W1TC_HIGH_ADDRESS 0x00000014 -#define WLAN_GPIO_OUT_W1TC_HIGH_OFFSET 0x00000014 -#define WLAN_GPIO_OUT_W1TC_HIGH_DATA_MSB 31 -#define WLAN_GPIO_OUT_W1TC_HIGH_DATA_LSB 0 -#define WLAN_GPIO_OUT_W1TC_HIGH_DATA_MASK 0xffffffff -#define WLAN_GPIO_OUT_W1TC_HIGH_DATA_GET(x) (((x) & WLAN_GPIO_OUT_W1TC_HIGH_DATA_MASK) >> WLAN_GPIO_OUT_W1TC_HIGH_DATA_LSB) -#define WLAN_GPIO_OUT_W1TC_HIGH_DATA_SET(x) (((x) << WLAN_GPIO_OUT_W1TC_HIGH_DATA_LSB) & WLAN_GPIO_OUT_W1TC_HIGH_DATA_MASK) - -#define WLAN_GPIO_ENABLE_LOW_ADDRESS 0x00000018 -#define WLAN_GPIO_ENABLE_LOW_OFFSET 0x00000018 -#define WLAN_GPIO_ENABLE_LOW_DATA_MSB 31 -#define WLAN_GPIO_ENABLE_LOW_DATA_LSB 0 -#define WLAN_GPIO_ENABLE_LOW_DATA_MASK 0xffffffff -#define WLAN_GPIO_ENABLE_LOW_DATA_GET(x) (((x) & WLAN_GPIO_ENABLE_LOW_DATA_MASK) >> WLAN_GPIO_ENABLE_LOW_DATA_LSB) -#define WLAN_GPIO_ENABLE_LOW_DATA_SET(x) (((x) << WLAN_GPIO_ENABLE_LOW_DATA_LSB) & WLAN_GPIO_ENABLE_LOW_DATA_MASK) - -#define WLAN_GPIO_ENABLE_W1TS_LOW_ADDRESS 0x0000001c -#define WLAN_GPIO_ENABLE_W1TS_LOW_OFFSET 0x0000001c -#define WLAN_GPIO_ENABLE_W1TS_LOW_DATA_MSB 31 -#define WLAN_GPIO_ENABLE_W1TS_LOW_DATA_LSB 0 -#define WLAN_GPIO_ENABLE_W1TS_LOW_DATA_MASK 0xffffffff -#define WLAN_GPIO_ENABLE_W1TS_LOW_DATA_GET(x) (((x) & WLAN_GPIO_ENABLE_W1TS_LOW_DATA_MASK) >> WLAN_GPIO_ENABLE_W1TS_LOW_DATA_LSB) -#define WLAN_GPIO_ENABLE_W1TS_LOW_DATA_SET(x) (((x) << WLAN_GPIO_ENABLE_W1TS_LOW_DATA_LSB) & WLAN_GPIO_ENABLE_W1TS_LOW_DATA_MASK) - -#define WLAN_GPIO_ENABLE_W1TC_LOW_ADDRESS 0x00000020 -#define WLAN_GPIO_ENABLE_W1TC_LOW_OFFSET 0x00000020 -#define WLAN_GPIO_ENABLE_W1TC_LOW_DATA_MSB 31 -#define WLAN_GPIO_ENABLE_W1TC_LOW_DATA_LSB 0 -#define WLAN_GPIO_ENABLE_W1TC_LOW_DATA_MASK 0xffffffff -#define WLAN_GPIO_ENABLE_W1TC_LOW_DATA_GET(x) (((x) & WLAN_GPIO_ENABLE_W1TC_LOW_DATA_MASK) >> WLAN_GPIO_ENABLE_W1TC_LOW_DATA_LSB) -#define WLAN_GPIO_ENABLE_W1TC_LOW_DATA_SET(x) (((x) << WLAN_GPIO_ENABLE_W1TC_LOW_DATA_LSB) & WLAN_GPIO_ENABLE_W1TC_LOW_DATA_MASK) - -#define WLAN_GPIO_ENABLE_HIGH_ADDRESS 0x00000024 -#define WLAN_GPIO_ENABLE_HIGH_OFFSET 0x00000024 -#define WLAN_GPIO_ENABLE_HIGH_DATA_MSB 31 -#define WLAN_GPIO_ENABLE_HIGH_DATA_LSB 0 -#define WLAN_GPIO_ENABLE_HIGH_DATA_MASK 0xffffffff -#define WLAN_GPIO_ENABLE_HIGH_DATA_GET(x) (((x) & WLAN_GPIO_ENABLE_HIGH_DATA_MASK) >> WLAN_GPIO_ENABLE_HIGH_DATA_LSB) -#define WLAN_GPIO_ENABLE_HIGH_DATA_SET(x) (((x) << WLAN_GPIO_ENABLE_HIGH_DATA_LSB) & WLAN_GPIO_ENABLE_HIGH_DATA_MASK) - -#define WLAN_GPIO_ENABLE_W1TS_HIGH_ADDRESS 0x00000028 -#define WLAN_GPIO_ENABLE_W1TS_HIGH_OFFSET 0x00000028 -#define WLAN_GPIO_ENABLE_W1TS_HIGH_DATA_MSB 31 -#define WLAN_GPIO_ENABLE_W1TS_HIGH_DATA_LSB 0 -#define WLAN_GPIO_ENABLE_W1TS_HIGH_DATA_MASK 0xffffffff -#define WLAN_GPIO_ENABLE_W1TS_HIGH_DATA_GET(x) (((x) & WLAN_GPIO_ENABLE_W1TS_HIGH_DATA_MASK) >> WLAN_GPIO_ENABLE_W1TS_HIGH_DATA_LSB) -#define WLAN_GPIO_ENABLE_W1TS_HIGH_DATA_SET(x) (((x) << WLAN_GPIO_ENABLE_W1TS_HIGH_DATA_LSB) & WLAN_GPIO_ENABLE_W1TS_HIGH_DATA_MASK) - -#define WLAN_GPIO_ENABLE_W1TC_HIGH_ADDRESS 0x0000002c -#define WLAN_GPIO_ENABLE_W1TC_HIGH_OFFSET 0x0000002c -#define WLAN_GPIO_ENABLE_W1TC_HIGH_DATA_MSB 31 -#define WLAN_GPIO_ENABLE_W1TC_HIGH_DATA_LSB 0 -#define WLAN_GPIO_ENABLE_W1TC_HIGH_DATA_MASK 0xffffffff -#define WLAN_GPIO_ENABLE_W1TC_HIGH_DATA_GET(x) (((x) & WLAN_GPIO_ENABLE_W1TC_HIGH_DATA_MASK) >> WLAN_GPIO_ENABLE_W1TC_HIGH_DATA_LSB) -#define WLAN_GPIO_ENABLE_W1TC_HIGH_DATA_SET(x) (((x) << WLAN_GPIO_ENABLE_W1TC_HIGH_DATA_LSB) & WLAN_GPIO_ENABLE_W1TC_HIGH_DATA_MASK) - -#define WLAN_GPIO_IN_LOW_ADDRESS 0x00000030 -#define WLAN_GPIO_IN_LOW_OFFSET 0x00000030 -#define WLAN_GPIO_IN_LOW_DATA_MSB 31 -#define WLAN_GPIO_IN_LOW_DATA_LSB 0 -#define WLAN_GPIO_IN_LOW_DATA_MASK 0xffffffff -#define WLAN_GPIO_IN_LOW_DATA_GET(x) (((x) & WLAN_GPIO_IN_LOW_DATA_MASK) >> WLAN_GPIO_IN_LOW_DATA_LSB) -#define WLAN_GPIO_IN_LOW_DATA_SET(x) (((x) << WLAN_GPIO_IN_LOW_DATA_LSB) & WLAN_GPIO_IN_LOW_DATA_MASK) - -#define WLAN_GPIO_STATUS_LOW_ADDRESS 0x00000034 -#define WLAN_GPIO_STATUS_LOW_OFFSET 0x00000034 -#define WLAN_GPIO_STATUS_LOW_INTERRUPT_MSB 31 -#define WLAN_GPIO_STATUS_LOW_INTERRUPT_LSB 0 -#define WLAN_GPIO_STATUS_LOW_INTERRUPT_MASK 0xffffffff -#define WLAN_GPIO_STATUS_LOW_INTERRUPT_GET(x) (((x) & WLAN_GPIO_STATUS_LOW_INTERRUPT_MASK) >> WLAN_GPIO_STATUS_LOW_INTERRUPT_LSB) -#define WLAN_GPIO_STATUS_LOW_INTERRUPT_SET(x) (((x) << WLAN_GPIO_STATUS_LOW_INTERRUPT_LSB) & WLAN_GPIO_STATUS_LOW_INTERRUPT_MASK) - -#define WLAN_GPIO_IN_HIGH_ADDRESS 0x00000038 -#define WLAN_GPIO_IN_HIGH_OFFSET 0x00000038 -#define WLAN_GPIO_IN_HIGH_DATA_MSB 31 -#define WLAN_GPIO_IN_HIGH_DATA_LSB 0 -#define WLAN_GPIO_IN_HIGH_DATA_MASK 0xffffffff -#define WLAN_GPIO_IN_HIGH_DATA_GET(x) (((x) & WLAN_GPIO_IN_HIGH_DATA_MASK) >> WLAN_GPIO_IN_HIGH_DATA_LSB) -#define WLAN_GPIO_IN_HIGH_DATA_SET(x) (((x) << WLAN_GPIO_IN_HIGH_DATA_LSB) & WLAN_GPIO_IN_HIGH_DATA_MASK) - -#define WLAN_GPIO_STATUS_HIGH_ADDRESS 0x0000003c -#define WLAN_GPIO_STATUS_HIGH_OFFSET 0x0000003c -#define WLAN_GPIO_STATUS_HIGH_INTERRUPT_MSB 31 -#define WLAN_GPIO_STATUS_HIGH_INTERRUPT_LSB 0 -#define WLAN_GPIO_STATUS_HIGH_INTERRUPT_MASK 0xffffffff -#define WLAN_GPIO_STATUS_HIGH_INTERRUPT_GET(x) (((x) & WLAN_GPIO_STATUS_HIGH_INTERRUPT_MASK) >> WLAN_GPIO_STATUS_HIGH_INTERRUPT_LSB) -#define WLAN_GPIO_STATUS_HIGH_INTERRUPT_SET(x) (((x) << WLAN_GPIO_STATUS_HIGH_INTERRUPT_LSB) & WLAN_GPIO_STATUS_HIGH_INTERRUPT_MASK) - -#define WLAN_GPIO_STATUS_W1TS_LOW_ADDRESS 0x00000040 -#define WLAN_GPIO_STATUS_W1TS_LOW_OFFSET 0x00000040 -#define WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_MSB 31 -#define WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_LSB 0 -#define WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_MASK 0xffffffff -#define WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_GET(x) (((x) & WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_MASK) >> WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_LSB) -#define WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_SET(x) (((x) << WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_LSB) & WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_MASK) - -#define WLAN_GPIO_STATUS_W1TC_LOW_ADDRESS 0x00000044 -#define WLAN_GPIO_STATUS_W1TC_LOW_OFFSET 0x00000044 -#define WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_MSB 31 -#define WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_LSB 0 -#define WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_MASK 0xffffffff -#define WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_GET(x) (((x) & WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_MASK) >> WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_LSB) -#define WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_SET(x) (((x) << WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_LSB) & WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_MASK) - -#define WLAN_GPIO_STATUS_W1TS_HIGH_ADDRESS 0x00000048 -#define WLAN_GPIO_STATUS_W1TS_HIGH_OFFSET 0x00000048 -#define WLAN_GPIO_STATUS_W1TS_HIGH_INTERRUPT_MSB 31 -#define WLAN_GPIO_STATUS_W1TS_HIGH_INTERRUPT_LSB 0 -#define WLAN_GPIO_STATUS_W1TS_HIGH_INTERRUPT_MASK 0xffffffff -#define WLAN_GPIO_STATUS_W1TS_HIGH_INTERRUPT_GET(x) (((x) & WLAN_GPIO_STATUS_W1TS_HIGH_INTERRUPT_MASK) >> WLAN_GPIO_STATUS_W1TS_HIGH_INTERRUPT_LSB) -#define WLAN_GPIO_STATUS_W1TS_HIGH_INTERRUPT_SET(x) (((x) << WLAN_GPIO_STATUS_W1TS_HIGH_INTERRUPT_LSB) & WLAN_GPIO_STATUS_W1TS_HIGH_INTERRUPT_MASK) - -#define WLAN_GPIO_STATUS_W1TC_HIGH_ADDRESS 0x0000004c -#define WLAN_GPIO_STATUS_W1TC_HIGH_OFFSET 0x0000004c -#define WLAN_GPIO_STATUS_W1TC_HIGH_INTERRUPT_MSB 31 -#define WLAN_GPIO_STATUS_W1TC_HIGH_INTERRUPT_LSB 0 -#define WLAN_GPIO_STATUS_W1TC_HIGH_INTERRUPT_MASK 0xffffffff -#define WLAN_GPIO_STATUS_W1TC_HIGH_INTERRUPT_GET(x) (((x) & WLAN_GPIO_STATUS_W1TC_HIGH_INTERRUPT_MASK) >> WLAN_GPIO_STATUS_W1TC_HIGH_INTERRUPT_LSB) -#define WLAN_GPIO_STATUS_W1TC_HIGH_INTERRUPT_SET(x) (((x) << WLAN_GPIO_STATUS_W1TC_HIGH_INTERRUPT_LSB) & WLAN_GPIO_STATUS_W1TC_HIGH_INTERRUPT_MASK) - -#define WLAN_GPIO_PIN0_ADDRESS 0x00000050 -#define WLAN_GPIO_PIN0_OFFSET 0x00000050 -#define WLAN_GPIO_PIN0_CONFIG_MSB 14 -#define WLAN_GPIO_PIN0_CONFIG_LSB 11 -#define WLAN_GPIO_PIN0_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN0_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN0_CONFIG_MASK) >> WLAN_GPIO_PIN0_CONFIG_LSB) -#define WLAN_GPIO_PIN0_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN0_CONFIG_LSB) & WLAN_GPIO_PIN0_CONFIG_MASK) -#define WLAN_GPIO_PIN0_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN0_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN0_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN0_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN0_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN0_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN0_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN0_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN0_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN0_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN0_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN0_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN0_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN0_INT_TYPE_MASK) >> WLAN_GPIO_PIN0_INT_TYPE_LSB) -#define WLAN_GPIO_PIN0_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN0_INT_TYPE_LSB) & WLAN_GPIO_PIN0_INT_TYPE_MASK) -#define WLAN_GPIO_PIN0_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN0_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN0_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN0_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN0_PAD_PULL_MASK) >> WLAN_GPIO_PIN0_PAD_PULL_LSB) -#define WLAN_GPIO_PIN0_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN0_PAD_PULL_LSB) & WLAN_GPIO_PIN0_PAD_PULL_MASK) -#define WLAN_GPIO_PIN0_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN0_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN0_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN0_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN0_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN0_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN0_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN0_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN0_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN0_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN0_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN0_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN0_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN0_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN0_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN0_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN0_PAD_DRIVER_LSB) & WLAN_GPIO_PIN0_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN0_SOURCE_MSB 0 -#define WLAN_GPIO_PIN0_SOURCE_LSB 0 -#define WLAN_GPIO_PIN0_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN0_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN0_SOURCE_MASK) >> WLAN_GPIO_PIN0_SOURCE_LSB) -#define WLAN_GPIO_PIN0_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN0_SOURCE_LSB) & WLAN_GPIO_PIN0_SOURCE_MASK) - -#define WLAN_GPIO_PIN1_ADDRESS 0x00000054 -#define WLAN_GPIO_PIN1_OFFSET 0x00000054 -#define WLAN_GPIO_PIN1_CONFIG_MSB 14 -#define WLAN_GPIO_PIN1_CONFIG_LSB 11 -#define WLAN_GPIO_PIN1_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN1_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN1_CONFIG_MASK) >> WLAN_GPIO_PIN1_CONFIG_LSB) -#define WLAN_GPIO_PIN1_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN1_CONFIG_LSB) & WLAN_GPIO_PIN1_CONFIG_MASK) -#define WLAN_GPIO_PIN1_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN1_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN1_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN1_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN1_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN1_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN1_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN1_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN1_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN1_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN1_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN1_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN1_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN1_INT_TYPE_MASK) >> WLAN_GPIO_PIN1_INT_TYPE_LSB) -#define WLAN_GPIO_PIN1_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN1_INT_TYPE_LSB) & WLAN_GPIO_PIN1_INT_TYPE_MASK) -#define WLAN_GPIO_PIN1_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN1_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN1_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN1_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN1_PAD_PULL_MASK) >> WLAN_GPIO_PIN1_PAD_PULL_LSB) -#define WLAN_GPIO_PIN1_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN1_PAD_PULL_LSB) & WLAN_GPIO_PIN1_PAD_PULL_MASK) -#define WLAN_GPIO_PIN1_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN1_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN1_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN1_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN1_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN1_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN1_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN1_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN1_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN1_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN1_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN1_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN1_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN1_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN1_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN1_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN1_PAD_DRIVER_LSB) & WLAN_GPIO_PIN1_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN1_SOURCE_MSB 0 -#define WLAN_GPIO_PIN1_SOURCE_LSB 0 -#define WLAN_GPIO_PIN1_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN1_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN1_SOURCE_MASK) >> WLAN_GPIO_PIN1_SOURCE_LSB) -#define WLAN_GPIO_PIN1_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN1_SOURCE_LSB) & WLAN_GPIO_PIN1_SOURCE_MASK) - -#define WLAN_GPIO_PIN2_ADDRESS 0x00000058 -#define WLAN_GPIO_PIN2_OFFSET 0x00000058 -#define WLAN_GPIO_PIN2_CONFIG_MSB 14 -#define WLAN_GPIO_PIN2_CONFIG_LSB 11 -#define WLAN_GPIO_PIN2_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN2_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN2_CONFIG_MASK) >> WLAN_GPIO_PIN2_CONFIG_LSB) -#define WLAN_GPIO_PIN2_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN2_CONFIG_LSB) & WLAN_GPIO_PIN2_CONFIG_MASK) -#define WLAN_GPIO_PIN2_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN2_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN2_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN2_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN2_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN2_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN2_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN2_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN2_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN2_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN2_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN2_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN2_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN2_INT_TYPE_MASK) >> WLAN_GPIO_PIN2_INT_TYPE_LSB) -#define WLAN_GPIO_PIN2_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN2_INT_TYPE_LSB) & WLAN_GPIO_PIN2_INT_TYPE_MASK) -#define WLAN_GPIO_PIN2_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN2_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN2_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN2_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN2_PAD_PULL_MASK) >> WLAN_GPIO_PIN2_PAD_PULL_LSB) -#define WLAN_GPIO_PIN2_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN2_PAD_PULL_LSB) & WLAN_GPIO_PIN2_PAD_PULL_MASK) -#define WLAN_GPIO_PIN2_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN2_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN2_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN2_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN2_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN2_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN2_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN2_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN2_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN2_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN2_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN2_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN2_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN2_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN2_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN2_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN2_PAD_DRIVER_LSB) & WLAN_GPIO_PIN2_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN2_SOURCE_MSB 0 -#define WLAN_GPIO_PIN2_SOURCE_LSB 0 -#define WLAN_GPIO_PIN2_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN2_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN2_SOURCE_MASK) >> WLAN_GPIO_PIN2_SOURCE_LSB) -#define WLAN_GPIO_PIN2_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN2_SOURCE_LSB) & WLAN_GPIO_PIN2_SOURCE_MASK) - -#define WLAN_GPIO_PIN3_ADDRESS 0x0000005c -#define WLAN_GPIO_PIN3_OFFSET 0x0000005c -#define WLAN_GPIO_PIN3_CONFIG_MSB 14 -#define WLAN_GPIO_PIN3_CONFIG_LSB 11 -#define WLAN_GPIO_PIN3_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN3_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN3_CONFIG_MASK) >> WLAN_GPIO_PIN3_CONFIG_LSB) -#define WLAN_GPIO_PIN3_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN3_CONFIG_LSB) & WLAN_GPIO_PIN3_CONFIG_MASK) -#define WLAN_GPIO_PIN3_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN3_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN3_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN3_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN3_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN3_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN3_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN3_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN3_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN3_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN3_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN3_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN3_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN3_INT_TYPE_MASK) >> WLAN_GPIO_PIN3_INT_TYPE_LSB) -#define WLAN_GPIO_PIN3_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN3_INT_TYPE_LSB) & WLAN_GPIO_PIN3_INT_TYPE_MASK) -#define WLAN_GPIO_PIN3_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN3_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN3_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN3_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN3_PAD_PULL_MASK) >> WLAN_GPIO_PIN3_PAD_PULL_LSB) -#define WLAN_GPIO_PIN3_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN3_PAD_PULL_LSB) & WLAN_GPIO_PIN3_PAD_PULL_MASK) -#define WLAN_GPIO_PIN3_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN3_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN3_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN3_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN3_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN3_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN3_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN3_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN3_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN3_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN3_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN3_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN3_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN3_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN3_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN3_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN3_PAD_DRIVER_LSB) & WLAN_GPIO_PIN3_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN3_SOURCE_MSB 0 -#define WLAN_GPIO_PIN3_SOURCE_LSB 0 -#define WLAN_GPIO_PIN3_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN3_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN3_SOURCE_MASK) >> WLAN_GPIO_PIN3_SOURCE_LSB) -#define WLAN_GPIO_PIN3_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN3_SOURCE_LSB) & WLAN_GPIO_PIN3_SOURCE_MASK) - -#define WLAN_GPIO_PIN4_ADDRESS 0x00000060 -#define WLAN_GPIO_PIN4_OFFSET 0x00000060 -#define WLAN_GPIO_PIN4_CONFIG_MSB 14 -#define WLAN_GPIO_PIN4_CONFIG_LSB 11 -#define WLAN_GPIO_PIN4_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN4_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN4_CONFIG_MASK) >> WLAN_GPIO_PIN4_CONFIG_LSB) -#define WLAN_GPIO_PIN4_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN4_CONFIG_LSB) & WLAN_GPIO_PIN4_CONFIG_MASK) -#define WLAN_GPIO_PIN4_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN4_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN4_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN4_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN4_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN4_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN4_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN4_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN4_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN4_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN4_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN4_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN4_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN4_INT_TYPE_MASK) >> WLAN_GPIO_PIN4_INT_TYPE_LSB) -#define WLAN_GPIO_PIN4_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN4_INT_TYPE_LSB) & WLAN_GPIO_PIN4_INT_TYPE_MASK) -#define WLAN_GPIO_PIN4_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN4_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN4_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN4_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN4_PAD_PULL_MASK) >> WLAN_GPIO_PIN4_PAD_PULL_LSB) -#define WLAN_GPIO_PIN4_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN4_PAD_PULL_LSB) & WLAN_GPIO_PIN4_PAD_PULL_MASK) -#define WLAN_GPIO_PIN4_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN4_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN4_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN4_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN4_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN4_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN4_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN4_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN4_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN4_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN4_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN4_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN4_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN4_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN4_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN4_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN4_PAD_DRIVER_LSB) & WLAN_GPIO_PIN4_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN4_SOURCE_MSB 0 -#define WLAN_GPIO_PIN4_SOURCE_LSB 0 -#define WLAN_GPIO_PIN4_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN4_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN4_SOURCE_MASK) >> WLAN_GPIO_PIN4_SOURCE_LSB) -#define WLAN_GPIO_PIN4_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN4_SOURCE_LSB) & WLAN_GPIO_PIN4_SOURCE_MASK) - -#define WLAN_GPIO_PIN5_ADDRESS 0x00000064 -#define WLAN_GPIO_PIN5_OFFSET 0x00000064 -#define WLAN_GPIO_PIN5_CONFIG_MSB 14 -#define WLAN_GPIO_PIN5_CONFIG_LSB 11 -#define WLAN_GPIO_PIN5_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN5_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN5_CONFIG_MASK) >> WLAN_GPIO_PIN5_CONFIG_LSB) -#define WLAN_GPIO_PIN5_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN5_CONFIG_LSB) & WLAN_GPIO_PIN5_CONFIG_MASK) -#define WLAN_GPIO_PIN5_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN5_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN5_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN5_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN5_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN5_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN5_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN5_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN5_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN5_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN5_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN5_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN5_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN5_INT_TYPE_MASK) >> WLAN_GPIO_PIN5_INT_TYPE_LSB) -#define WLAN_GPIO_PIN5_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN5_INT_TYPE_LSB) & WLAN_GPIO_PIN5_INT_TYPE_MASK) -#define WLAN_GPIO_PIN5_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN5_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN5_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN5_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN5_PAD_PULL_MASK) >> WLAN_GPIO_PIN5_PAD_PULL_LSB) -#define WLAN_GPIO_PIN5_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN5_PAD_PULL_LSB) & WLAN_GPIO_PIN5_PAD_PULL_MASK) -#define WLAN_GPIO_PIN5_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN5_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN5_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN5_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN5_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN5_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN5_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN5_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN5_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN5_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN5_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN5_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN5_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN5_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN5_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN5_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN5_PAD_DRIVER_LSB) & WLAN_GPIO_PIN5_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN5_SOURCE_MSB 0 -#define WLAN_GPIO_PIN5_SOURCE_LSB 0 -#define WLAN_GPIO_PIN5_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN5_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN5_SOURCE_MASK) >> WLAN_GPIO_PIN5_SOURCE_LSB) -#define WLAN_GPIO_PIN5_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN5_SOURCE_LSB) & WLAN_GPIO_PIN5_SOURCE_MASK) - -#define WLAN_GPIO_PIN6_ADDRESS 0x00000068 -#define WLAN_GPIO_PIN6_OFFSET 0x00000068 -#define WLAN_GPIO_PIN6_CONFIG_MSB 14 -#define WLAN_GPIO_PIN6_CONFIG_LSB 11 -#define WLAN_GPIO_PIN6_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN6_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN6_CONFIG_MASK) >> WLAN_GPIO_PIN6_CONFIG_LSB) -#define WLAN_GPIO_PIN6_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN6_CONFIG_LSB) & WLAN_GPIO_PIN6_CONFIG_MASK) -#define WLAN_GPIO_PIN6_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN6_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN6_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN6_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN6_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN6_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN6_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN6_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN6_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN6_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN6_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN6_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN6_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN6_INT_TYPE_MASK) >> WLAN_GPIO_PIN6_INT_TYPE_LSB) -#define WLAN_GPIO_PIN6_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN6_INT_TYPE_LSB) & WLAN_GPIO_PIN6_INT_TYPE_MASK) -#define WLAN_GPIO_PIN6_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN6_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN6_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN6_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN6_PAD_PULL_MASK) >> WLAN_GPIO_PIN6_PAD_PULL_LSB) -#define WLAN_GPIO_PIN6_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN6_PAD_PULL_LSB) & WLAN_GPIO_PIN6_PAD_PULL_MASK) -#define WLAN_GPIO_PIN6_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN6_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN6_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN6_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN6_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN6_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN6_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN6_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN6_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN6_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN6_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN6_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN6_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN6_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN6_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN6_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN6_PAD_DRIVER_LSB) & WLAN_GPIO_PIN6_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN6_SOURCE_MSB 0 -#define WLAN_GPIO_PIN6_SOURCE_LSB 0 -#define WLAN_GPIO_PIN6_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN6_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN6_SOURCE_MASK) >> WLAN_GPIO_PIN6_SOURCE_LSB) -#define WLAN_GPIO_PIN6_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN6_SOURCE_LSB) & WLAN_GPIO_PIN6_SOURCE_MASK) - -#define WLAN_GPIO_PIN7_ADDRESS 0x0000006c -#define WLAN_GPIO_PIN7_OFFSET 0x0000006c -#define WLAN_GPIO_PIN7_CONFIG_MSB 14 -#define WLAN_GPIO_PIN7_CONFIG_LSB 11 -#define WLAN_GPIO_PIN7_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN7_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN7_CONFIG_MASK) >> WLAN_GPIO_PIN7_CONFIG_LSB) -#define WLAN_GPIO_PIN7_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN7_CONFIG_LSB) & WLAN_GPIO_PIN7_CONFIG_MASK) -#define WLAN_GPIO_PIN7_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN7_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN7_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN7_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN7_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN7_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN7_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN7_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN7_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN7_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN7_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN7_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN7_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN7_INT_TYPE_MASK) >> WLAN_GPIO_PIN7_INT_TYPE_LSB) -#define WLAN_GPIO_PIN7_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN7_INT_TYPE_LSB) & WLAN_GPIO_PIN7_INT_TYPE_MASK) -#define WLAN_GPIO_PIN7_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN7_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN7_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN7_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN7_PAD_PULL_MASK) >> WLAN_GPIO_PIN7_PAD_PULL_LSB) -#define WLAN_GPIO_PIN7_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN7_PAD_PULL_LSB) & WLAN_GPIO_PIN7_PAD_PULL_MASK) -#define WLAN_GPIO_PIN7_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN7_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN7_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN7_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN7_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN7_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN7_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN7_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN7_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN7_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN7_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN7_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN7_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN7_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN7_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN7_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN7_PAD_DRIVER_LSB) & WLAN_GPIO_PIN7_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN7_SOURCE_MSB 0 -#define WLAN_GPIO_PIN7_SOURCE_LSB 0 -#define WLAN_GPIO_PIN7_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN7_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN7_SOURCE_MASK) >> WLAN_GPIO_PIN7_SOURCE_LSB) -#define WLAN_GPIO_PIN7_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN7_SOURCE_LSB) & WLAN_GPIO_PIN7_SOURCE_MASK) - -#define WLAN_GPIO_PIN8_ADDRESS 0x00000070 -#define WLAN_GPIO_PIN8_OFFSET 0x00000070 -#define WLAN_GPIO_PIN8_CONFIG_MSB 14 -#define WLAN_GPIO_PIN8_CONFIG_LSB 11 -#define WLAN_GPIO_PIN8_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN8_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN8_CONFIG_MASK) >> WLAN_GPIO_PIN8_CONFIG_LSB) -#define WLAN_GPIO_PIN8_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN8_CONFIG_LSB) & WLAN_GPIO_PIN8_CONFIG_MASK) -#define WLAN_GPIO_PIN8_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN8_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN8_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN8_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN8_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN8_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN8_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN8_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN8_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN8_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN8_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN8_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN8_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN8_INT_TYPE_MASK) >> WLAN_GPIO_PIN8_INT_TYPE_LSB) -#define WLAN_GPIO_PIN8_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN8_INT_TYPE_LSB) & WLAN_GPIO_PIN8_INT_TYPE_MASK) -#define WLAN_GPIO_PIN8_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN8_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN8_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN8_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN8_PAD_PULL_MASK) >> WLAN_GPIO_PIN8_PAD_PULL_LSB) -#define WLAN_GPIO_PIN8_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN8_PAD_PULL_LSB) & WLAN_GPIO_PIN8_PAD_PULL_MASK) -#define WLAN_GPIO_PIN8_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN8_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN8_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN8_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN8_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN8_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN8_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN8_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN8_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN8_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN8_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN8_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN8_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN8_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN8_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN8_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN8_PAD_DRIVER_LSB) & WLAN_GPIO_PIN8_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN8_SOURCE_MSB 0 -#define WLAN_GPIO_PIN8_SOURCE_LSB 0 -#define WLAN_GPIO_PIN8_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN8_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN8_SOURCE_MASK) >> WLAN_GPIO_PIN8_SOURCE_LSB) -#define WLAN_GPIO_PIN8_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN8_SOURCE_LSB) & WLAN_GPIO_PIN8_SOURCE_MASK) - -#define WLAN_GPIO_PIN9_ADDRESS 0x00000074 -#define WLAN_GPIO_PIN9_OFFSET 0x00000074 -#define WLAN_GPIO_PIN9_CONFIG_MSB 14 -#define WLAN_GPIO_PIN9_CONFIG_LSB 11 -#define WLAN_GPIO_PIN9_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN9_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN9_CONFIG_MASK) >> WLAN_GPIO_PIN9_CONFIG_LSB) -#define WLAN_GPIO_PIN9_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN9_CONFIG_LSB) & WLAN_GPIO_PIN9_CONFIG_MASK) -#define WLAN_GPIO_PIN9_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN9_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN9_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN9_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN9_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN9_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN9_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN9_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN9_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN9_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN9_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN9_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN9_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN9_INT_TYPE_MASK) >> WLAN_GPIO_PIN9_INT_TYPE_LSB) -#define WLAN_GPIO_PIN9_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN9_INT_TYPE_LSB) & WLAN_GPIO_PIN9_INT_TYPE_MASK) -#define WLAN_GPIO_PIN9_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN9_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN9_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN9_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN9_PAD_PULL_MASK) >> WLAN_GPIO_PIN9_PAD_PULL_LSB) -#define WLAN_GPIO_PIN9_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN9_PAD_PULL_LSB) & WLAN_GPIO_PIN9_PAD_PULL_MASK) -#define WLAN_GPIO_PIN9_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN9_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN9_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN9_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN9_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN9_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN9_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN9_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN9_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN9_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN9_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN9_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN9_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN9_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN9_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN9_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN9_PAD_DRIVER_LSB) & WLAN_GPIO_PIN9_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN9_SOURCE_MSB 0 -#define WLAN_GPIO_PIN9_SOURCE_LSB 0 -#define WLAN_GPIO_PIN9_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN9_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN9_SOURCE_MASK) >> WLAN_GPIO_PIN9_SOURCE_LSB) -#define WLAN_GPIO_PIN9_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN9_SOURCE_LSB) & WLAN_GPIO_PIN9_SOURCE_MASK) - -#define WLAN_GPIO_PIN10_ADDRESS 0x00000078 -#define WLAN_GPIO_PIN10_OFFSET 0x00000078 -#define WLAN_GPIO_PIN10_CONFIG_MSB 14 -#define WLAN_GPIO_PIN10_CONFIG_LSB 11 -#define WLAN_GPIO_PIN10_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN10_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN10_CONFIG_MASK) >> WLAN_GPIO_PIN10_CONFIG_LSB) -#define WLAN_GPIO_PIN10_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN10_CONFIG_LSB) & WLAN_GPIO_PIN10_CONFIG_MASK) -#define WLAN_GPIO_PIN10_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN10_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN10_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN10_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN10_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN10_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN10_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN10_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN10_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN10_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN10_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN10_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN10_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN10_INT_TYPE_MASK) >> WLAN_GPIO_PIN10_INT_TYPE_LSB) -#define WLAN_GPIO_PIN10_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN10_INT_TYPE_LSB) & WLAN_GPIO_PIN10_INT_TYPE_MASK) -#define WLAN_GPIO_PIN10_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN10_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN10_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN10_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN10_PAD_PULL_MASK) >> WLAN_GPIO_PIN10_PAD_PULL_LSB) -#define WLAN_GPIO_PIN10_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN10_PAD_PULL_LSB) & WLAN_GPIO_PIN10_PAD_PULL_MASK) -#define WLAN_GPIO_PIN10_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN10_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN10_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN10_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN10_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN10_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN10_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN10_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN10_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN10_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN10_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN10_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN10_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN10_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN10_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN10_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN10_PAD_DRIVER_LSB) & WLAN_GPIO_PIN10_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN10_SOURCE_MSB 0 -#define WLAN_GPIO_PIN10_SOURCE_LSB 0 -#define WLAN_GPIO_PIN10_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN10_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN10_SOURCE_MASK) >> WLAN_GPIO_PIN10_SOURCE_LSB) -#define WLAN_GPIO_PIN10_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN10_SOURCE_LSB) & WLAN_GPIO_PIN10_SOURCE_MASK) - -#define WLAN_GPIO_PIN11_ADDRESS 0x0000007c -#define WLAN_GPIO_PIN11_OFFSET 0x0000007c -#define WLAN_GPIO_PIN11_CONFIG_MSB 14 -#define WLAN_GPIO_PIN11_CONFIG_LSB 11 -#define WLAN_GPIO_PIN11_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN11_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN11_CONFIG_MASK) >> WLAN_GPIO_PIN11_CONFIG_LSB) -#define WLAN_GPIO_PIN11_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN11_CONFIG_LSB) & WLAN_GPIO_PIN11_CONFIG_MASK) -#define WLAN_GPIO_PIN11_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN11_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN11_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN11_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN11_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN11_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN11_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN11_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN11_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN11_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN11_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN11_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN11_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN11_INT_TYPE_MASK) >> WLAN_GPIO_PIN11_INT_TYPE_LSB) -#define WLAN_GPIO_PIN11_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN11_INT_TYPE_LSB) & WLAN_GPIO_PIN11_INT_TYPE_MASK) -#define WLAN_GPIO_PIN11_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN11_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN11_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN11_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN11_PAD_PULL_MASK) >> WLAN_GPIO_PIN11_PAD_PULL_LSB) -#define WLAN_GPIO_PIN11_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN11_PAD_PULL_LSB) & WLAN_GPIO_PIN11_PAD_PULL_MASK) -#define WLAN_GPIO_PIN11_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN11_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN11_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN11_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN11_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN11_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN11_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN11_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN11_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN11_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN11_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN11_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN11_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN11_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN11_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN11_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN11_PAD_DRIVER_LSB) & WLAN_GPIO_PIN11_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN11_SOURCE_MSB 0 -#define WLAN_GPIO_PIN11_SOURCE_LSB 0 -#define WLAN_GPIO_PIN11_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN11_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN11_SOURCE_MASK) >> WLAN_GPIO_PIN11_SOURCE_LSB) -#define WLAN_GPIO_PIN11_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN11_SOURCE_LSB) & WLAN_GPIO_PIN11_SOURCE_MASK) - -#define WLAN_GPIO_PIN12_ADDRESS 0x00000080 -#define WLAN_GPIO_PIN12_OFFSET 0x00000080 -#define WLAN_GPIO_PIN12_CONFIG_MSB 14 -#define WLAN_GPIO_PIN12_CONFIG_LSB 11 -#define WLAN_GPIO_PIN12_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN12_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN12_CONFIG_MASK) >> WLAN_GPIO_PIN12_CONFIG_LSB) -#define WLAN_GPIO_PIN12_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN12_CONFIG_LSB) & WLAN_GPIO_PIN12_CONFIG_MASK) -#define WLAN_GPIO_PIN12_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN12_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN12_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN12_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN12_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN12_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN12_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN12_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN12_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN12_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN12_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN12_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN12_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN12_INT_TYPE_MASK) >> WLAN_GPIO_PIN12_INT_TYPE_LSB) -#define WLAN_GPIO_PIN12_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN12_INT_TYPE_LSB) & WLAN_GPIO_PIN12_INT_TYPE_MASK) -#define WLAN_GPIO_PIN12_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN12_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN12_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN12_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN12_PAD_PULL_MASK) >> WLAN_GPIO_PIN12_PAD_PULL_LSB) -#define WLAN_GPIO_PIN12_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN12_PAD_PULL_LSB) & WLAN_GPIO_PIN12_PAD_PULL_MASK) -#define WLAN_GPIO_PIN12_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN12_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN12_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN12_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN12_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN12_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN12_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN12_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN12_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN12_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN12_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN12_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN12_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN12_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN12_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN12_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN12_PAD_DRIVER_LSB) & WLAN_GPIO_PIN12_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN12_SOURCE_MSB 0 -#define WLAN_GPIO_PIN12_SOURCE_LSB 0 -#define WLAN_GPIO_PIN12_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN12_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN12_SOURCE_MASK) >> WLAN_GPIO_PIN12_SOURCE_LSB) -#define WLAN_GPIO_PIN12_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN12_SOURCE_LSB) & WLAN_GPIO_PIN12_SOURCE_MASK) - -#define WLAN_GPIO_PIN13_ADDRESS 0x00000084 -#define WLAN_GPIO_PIN13_OFFSET 0x00000084 -#define WLAN_GPIO_PIN13_CONFIG_MSB 14 -#define WLAN_GPIO_PIN13_CONFIG_LSB 11 -#define WLAN_GPIO_PIN13_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN13_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN13_CONFIG_MASK) >> WLAN_GPIO_PIN13_CONFIG_LSB) -#define WLAN_GPIO_PIN13_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN13_CONFIG_LSB) & WLAN_GPIO_PIN13_CONFIG_MASK) -#define WLAN_GPIO_PIN13_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN13_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN13_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN13_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN13_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN13_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN13_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN13_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN13_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN13_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN13_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN13_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN13_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN13_INT_TYPE_MASK) >> WLAN_GPIO_PIN13_INT_TYPE_LSB) -#define WLAN_GPIO_PIN13_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN13_INT_TYPE_LSB) & WLAN_GPIO_PIN13_INT_TYPE_MASK) -#define WLAN_GPIO_PIN13_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN13_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN13_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN13_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN13_PAD_PULL_MASK) >> WLAN_GPIO_PIN13_PAD_PULL_LSB) -#define WLAN_GPIO_PIN13_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN13_PAD_PULL_LSB) & WLAN_GPIO_PIN13_PAD_PULL_MASK) -#define WLAN_GPIO_PIN13_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN13_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN13_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN13_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN13_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN13_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN13_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN13_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN13_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN13_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN13_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN13_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN13_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN13_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN13_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN13_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN13_PAD_DRIVER_LSB) & WLAN_GPIO_PIN13_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN13_SOURCE_MSB 0 -#define WLAN_GPIO_PIN13_SOURCE_LSB 0 -#define WLAN_GPIO_PIN13_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN13_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN13_SOURCE_MASK) >> WLAN_GPIO_PIN13_SOURCE_LSB) -#define WLAN_GPIO_PIN13_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN13_SOURCE_LSB) & WLAN_GPIO_PIN13_SOURCE_MASK) - -#define WLAN_GPIO_PIN14_ADDRESS 0x00000088 -#define WLAN_GPIO_PIN14_OFFSET 0x00000088 -#define WLAN_GPIO_PIN14_CONFIG_MSB 14 -#define WLAN_GPIO_PIN14_CONFIG_LSB 11 -#define WLAN_GPIO_PIN14_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN14_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN14_CONFIG_MASK) >> WLAN_GPIO_PIN14_CONFIG_LSB) -#define WLAN_GPIO_PIN14_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN14_CONFIG_LSB) & WLAN_GPIO_PIN14_CONFIG_MASK) -#define WLAN_GPIO_PIN14_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN14_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN14_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN14_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN14_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN14_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN14_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN14_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN14_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN14_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN14_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN14_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN14_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN14_INT_TYPE_MASK) >> WLAN_GPIO_PIN14_INT_TYPE_LSB) -#define WLAN_GPIO_PIN14_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN14_INT_TYPE_LSB) & WLAN_GPIO_PIN14_INT_TYPE_MASK) -#define WLAN_GPIO_PIN14_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN14_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN14_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN14_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN14_PAD_PULL_MASK) >> WLAN_GPIO_PIN14_PAD_PULL_LSB) -#define WLAN_GPIO_PIN14_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN14_PAD_PULL_LSB) & WLAN_GPIO_PIN14_PAD_PULL_MASK) -#define WLAN_GPIO_PIN14_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN14_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN14_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN14_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN14_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN14_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN14_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN14_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN14_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN14_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN14_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN14_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN14_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN14_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN14_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN14_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN14_PAD_DRIVER_LSB) & WLAN_GPIO_PIN14_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN14_SOURCE_MSB 0 -#define WLAN_GPIO_PIN14_SOURCE_LSB 0 -#define WLAN_GPIO_PIN14_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN14_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN14_SOURCE_MASK) >> WLAN_GPIO_PIN14_SOURCE_LSB) -#define WLAN_GPIO_PIN14_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN14_SOURCE_LSB) & WLAN_GPIO_PIN14_SOURCE_MASK) - -#define WLAN_GPIO_PIN15_ADDRESS 0x0000008c -#define WLAN_GPIO_PIN15_OFFSET 0x0000008c -#define WLAN_GPIO_PIN15_CONFIG_MSB 14 -#define WLAN_GPIO_PIN15_CONFIG_LSB 11 -#define WLAN_GPIO_PIN15_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN15_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN15_CONFIG_MASK) >> WLAN_GPIO_PIN15_CONFIG_LSB) -#define WLAN_GPIO_PIN15_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN15_CONFIG_LSB) & WLAN_GPIO_PIN15_CONFIG_MASK) -#define WLAN_GPIO_PIN15_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN15_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN15_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN15_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN15_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN15_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN15_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN15_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN15_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN15_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN15_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN15_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN15_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN15_INT_TYPE_MASK) >> WLAN_GPIO_PIN15_INT_TYPE_LSB) -#define WLAN_GPIO_PIN15_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN15_INT_TYPE_LSB) & WLAN_GPIO_PIN15_INT_TYPE_MASK) -#define WLAN_GPIO_PIN15_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN15_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN15_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN15_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN15_PAD_PULL_MASK) >> WLAN_GPIO_PIN15_PAD_PULL_LSB) -#define WLAN_GPIO_PIN15_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN15_PAD_PULL_LSB) & WLAN_GPIO_PIN15_PAD_PULL_MASK) -#define WLAN_GPIO_PIN15_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN15_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN15_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN15_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN15_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN15_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN15_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN15_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN15_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN15_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN15_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN15_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN15_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN15_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN15_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN15_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN15_PAD_DRIVER_LSB) & WLAN_GPIO_PIN15_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN15_SOURCE_MSB 0 -#define WLAN_GPIO_PIN15_SOURCE_LSB 0 -#define WLAN_GPIO_PIN15_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN15_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN15_SOURCE_MASK) >> WLAN_GPIO_PIN15_SOURCE_LSB) -#define WLAN_GPIO_PIN15_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN15_SOURCE_LSB) & WLAN_GPIO_PIN15_SOURCE_MASK) - -#define WLAN_GPIO_PIN16_ADDRESS 0x00000090 -#define WLAN_GPIO_PIN16_OFFSET 0x00000090 -#define WLAN_GPIO_PIN16_CONFIG_MSB 14 -#define WLAN_GPIO_PIN16_CONFIG_LSB 11 -#define WLAN_GPIO_PIN16_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN16_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN16_CONFIG_MASK) >> WLAN_GPIO_PIN16_CONFIG_LSB) -#define WLAN_GPIO_PIN16_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN16_CONFIG_LSB) & WLAN_GPIO_PIN16_CONFIG_MASK) -#define WLAN_GPIO_PIN16_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN16_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN16_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN16_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN16_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN16_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN16_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN16_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN16_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN16_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN16_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN16_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN16_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN16_INT_TYPE_MASK) >> WLAN_GPIO_PIN16_INT_TYPE_LSB) -#define WLAN_GPIO_PIN16_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN16_INT_TYPE_LSB) & WLAN_GPIO_PIN16_INT_TYPE_MASK) -#define WLAN_GPIO_PIN16_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN16_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN16_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN16_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN16_PAD_PULL_MASK) >> WLAN_GPIO_PIN16_PAD_PULL_LSB) -#define WLAN_GPIO_PIN16_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN16_PAD_PULL_LSB) & WLAN_GPIO_PIN16_PAD_PULL_MASK) -#define WLAN_GPIO_PIN16_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN16_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN16_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN16_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN16_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN16_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN16_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN16_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN16_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN16_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN16_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN16_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN16_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN16_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN16_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN16_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN16_PAD_DRIVER_LSB) & WLAN_GPIO_PIN16_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN16_SOURCE_MSB 0 -#define WLAN_GPIO_PIN16_SOURCE_LSB 0 -#define WLAN_GPIO_PIN16_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN16_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN16_SOURCE_MASK) >> WLAN_GPIO_PIN16_SOURCE_LSB) -#define WLAN_GPIO_PIN16_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN16_SOURCE_LSB) & WLAN_GPIO_PIN16_SOURCE_MASK) - -#define WLAN_GPIO_PIN17_ADDRESS 0x00000094 -#define WLAN_GPIO_PIN17_OFFSET 0x00000094 -#define WLAN_GPIO_PIN17_CONFIG_MSB 14 -#define WLAN_GPIO_PIN17_CONFIG_LSB 11 -#define WLAN_GPIO_PIN17_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN17_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN17_CONFIG_MASK) >> WLAN_GPIO_PIN17_CONFIG_LSB) -#define WLAN_GPIO_PIN17_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN17_CONFIG_LSB) & WLAN_GPIO_PIN17_CONFIG_MASK) -#define WLAN_GPIO_PIN17_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN17_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN17_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN17_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN17_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN17_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN17_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN17_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN17_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN17_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN17_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN17_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN17_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN17_INT_TYPE_MASK) >> WLAN_GPIO_PIN17_INT_TYPE_LSB) -#define WLAN_GPIO_PIN17_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN17_INT_TYPE_LSB) & WLAN_GPIO_PIN17_INT_TYPE_MASK) -#define WLAN_GPIO_PIN17_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN17_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN17_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN17_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN17_PAD_PULL_MASK) >> WLAN_GPIO_PIN17_PAD_PULL_LSB) -#define WLAN_GPIO_PIN17_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN17_PAD_PULL_LSB) & WLAN_GPIO_PIN17_PAD_PULL_MASK) -#define WLAN_GPIO_PIN17_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN17_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN17_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN17_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN17_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN17_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN17_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN17_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN17_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN17_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN17_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN17_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN17_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN17_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN17_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN17_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN17_PAD_DRIVER_LSB) & WLAN_GPIO_PIN17_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN17_SOURCE_MSB 0 -#define WLAN_GPIO_PIN17_SOURCE_LSB 0 -#define WLAN_GPIO_PIN17_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN17_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN17_SOURCE_MASK) >> WLAN_GPIO_PIN17_SOURCE_LSB) -#define WLAN_GPIO_PIN17_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN17_SOURCE_LSB) & WLAN_GPIO_PIN17_SOURCE_MASK) - -#define WLAN_GPIO_PIN18_ADDRESS 0x00000098 -#define WLAN_GPIO_PIN18_OFFSET 0x00000098 -#define WLAN_GPIO_PIN18_CONFIG_MSB 14 -#define WLAN_GPIO_PIN18_CONFIG_LSB 11 -#define WLAN_GPIO_PIN18_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN18_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN18_CONFIG_MASK) >> WLAN_GPIO_PIN18_CONFIG_LSB) -#define WLAN_GPIO_PIN18_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN18_CONFIG_LSB) & WLAN_GPIO_PIN18_CONFIG_MASK) -#define WLAN_GPIO_PIN18_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN18_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN18_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN18_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN18_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN18_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN18_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN18_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN18_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN18_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN18_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN18_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN18_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN18_INT_TYPE_MASK) >> WLAN_GPIO_PIN18_INT_TYPE_LSB) -#define WLAN_GPIO_PIN18_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN18_INT_TYPE_LSB) & WLAN_GPIO_PIN18_INT_TYPE_MASK) -#define WLAN_GPIO_PIN18_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN18_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN18_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN18_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN18_PAD_PULL_MASK) >> WLAN_GPIO_PIN18_PAD_PULL_LSB) -#define WLAN_GPIO_PIN18_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN18_PAD_PULL_LSB) & WLAN_GPIO_PIN18_PAD_PULL_MASK) -#define WLAN_GPIO_PIN18_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN18_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN18_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN18_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN18_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN18_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN18_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN18_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN18_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN18_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN18_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN18_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN18_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN18_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN18_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN18_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN18_PAD_DRIVER_LSB) & WLAN_GPIO_PIN18_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN18_SOURCE_MSB 0 -#define WLAN_GPIO_PIN18_SOURCE_LSB 0 -#define WLAN_GPIO_PIN18_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN18_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN18_SOURCE_MASK) >> WLAN_GPIO_PIN18_SOURCE_LSB) -#define WLAN_GPIO_PIN18_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN18_SOURCE_LSB) & WLAN_GPIO_PIN18_SOURCE_MASK) - -#define WLAN_GPIO_PIN19_ADDRESS 0x0000009c -#define WLAN_GPIO_PIN19_OFFSET 0x0000009c -#define WLAN_GPIO_PIN19_CONFIG_MSB 14 -#define WLAN_GPIO_PIN19_CONFIG_LSB 11 -#define WLAN_GPIO_PIN19_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN19_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN19_CONFIG_MASK) >> WLAN_GPIO_PIN19_CONFIG_LSB) -#define WLAN_GPIO_PIN19_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN19_CONFIG_LSB) & WLAN_GPIO_PIN19_CONFIG_MASK) -#define WLAN_GPIO_PIN19_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN19_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN19_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN19_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN19_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN19_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN19_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN19_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN19_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN19_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN19_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN19_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN19_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN19_INT_TYPE_MASK) >> WLAN_GPIO_PIN19_INT_TYPE_LSB) -#define WLAN_GPIO_PIN19_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN19_INT_TYPE_LSB) & WLAN_GPIO_PIN19_INT_TYPE_MASK) -#define WLAN_GPIO_PIN19_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN19_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN19_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN19_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN19_PAD_PULL_MASK) >> WLAN_GPIO_PIN19_PAD_PULL_LSB) -#define WLAN_GPIO_PIN19_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN19_PAD_PULL_LSB) & WLAN_GPIO_PIN19_PAD_PULL_MASK) -#define WLAN_GPIO_PIN19_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN19_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN19_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN19_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN19_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN19_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN19_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN19_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN19_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN19_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN19_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN19_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN19_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN19_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN19_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN19_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN19_PAD_DRIVER_LSB) & WLAN_GPIO_PIN19_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN19_SOURCE_MSB 0 -#define WLAN_GPIO_PIN19_SOURCE_LSB 0 -#define WLAN_GPIO_PIN19_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN19_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN19_SOURCE_MASK) >> WLAN_GPIO_PIN19_SOURCE_LSB) -#define WLAN_GPIO_PIN19_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN19_SOURCE_LSB) & WLAN_GPIO_PIN19_SOURCE_MASK) - -#define WLAN_GPIO_PIN20_ADDRESS 0x000000a0 -#define WLAN_GPIO_PIN20_OFFSET 0x000000a0 -#define WLAN_GPIO_PIN20_CONFIG_MSB 14 -#define WLAN_GPIO_PIN20_CONFIG_LSB 11 -#define WLAN_GPIO_PIN20_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN20_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN20_CONFIG_MASK) >> WLAN_GPIO_PIN20_CONFIG_LSB) -#define WLAN_GPIO_PIN20_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN20_CONFIG_LSB) & WLAN_GPIO_PIN20_CONFIG_MASK) -#define WLAN_GPIO_PIN20_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN20_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN20_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN20_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN20_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN20_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN20_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN20_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN20_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN20_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN20_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN20_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN20_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN20_INT_TYPE_MASK) >> WLAN_GPIO_PIN20_INT_TYPE_LSB) -#define WLAN_GPIO_PIN20_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN20_INT_TYPE_LSB) & WLAN_GPIO_PIN20_INT_TYPE_MASK) -#define WLAN_GPIO_PIN20_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN20_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN20_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN20_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN20_PAD_PULL_MASK) >> WLAN_GPIO_PIN20_PAD_PULL_LSB) -#define WLAN_GPIO_PIN20_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN20_PAD_PULL_LSB) & WLAN_GPIO_PIN20_PAD_PULL_MASK) -#define WLAN_GPIO_PIN20_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN20_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN20_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN20_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN20_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN20_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN20_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN20_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN20_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN20_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN20_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN20_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN20_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN20_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN20_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN20_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN20_PAD_DRIVER_LSB) & WLAN_GPIO_PIN20_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN20_SOURCE_MSB 0 -#define WLAN_GPIO_PIN20_SOURCE_LSB 0 -#define WLAN_GPIO_PIN20_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN20_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN20_SOURCE_MASK) >> WLAN_GPIO_PIN20_SOURCE_LSB) -#define WLAN_GPIO_PIN20_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN20_SOURCE_LSB) & WLAN_GPIO_PIN20_SOURCE_MASK) - -#define WLAN_GPIO_PIN21_ADDRESS 0x000000a4 -#define WLAN_GPIO_PIN21_OFFSET 0x000000a4 -#define WLAN_GPIO_PIN21_CONFIG_MSB 14 -#define WLAN_GPIO_PIN21_CONFIG_LSB 11 -#define WLAN_GPIO_PIN21_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN21_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN21_CONFIG_MASK) >> WLAN_GPIO_PIN21_CONFIG_LSB) -#define WLAN_GPIO_PIN21_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN21_CONFIG_LSB) & WLAN_GPIO_PIN21_CONFIG_MASK) -#define WLAN_GPIO_PIN21_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN21_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN21_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN21_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN21_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN21_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN21_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN21_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN21_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN21_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN21_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN21_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN21_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN21_INT_TYPE_MASK) >> WLAN_GPIO_PIN21_INT_TYPE_LSB) -#define WLAN_GPIO_PIN21_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN21_INT_TYPE_LSB) & WLAN_GPIO_PIN21_INT_TYPE_MASK) -#define WLAN_GPIO_PIN21_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN21_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN21_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN21_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN21_PAD_PULL_MASK) >> WLAN_GPIO_PIN21_PAD_PULL_LSB) -#define WLAN_GPIO_PIN21_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN21_PAD_PULL_LSB) & WLAN_GPIO_PIN21_PAD_PULL_MASK) -#define WLAN_GPIO_PIN21_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN21_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN21_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN21_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN21_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN21_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN21_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN21_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN21_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN21_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN21_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN21_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN21_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN21_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN21_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN21_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN21_PAD_DRIVER_LSB) & WLAN_GPIO_PIN21_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN21_SOURCE_MSB 0 -#define WLAN_GPIO_PIN21_SOURCE_LSB 0 -#define WLAN_GPIO_PIN21_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN21_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN21_SOURCE_MASK) >> WLAN_GPIO_PIN21_SOURCE_LSB) -#define WLAN_GPIO_PIN21_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN21_SOURCE_LSB) & WLAN_GPIO_PIN21_SOURCE_MASK) - -#define WLAN_GPIO_PIN22_ADDRESS 0x000000a8 -#define WLAN_GPIO_PIN22_OFFSET 0x000000a8 -#define WLAN_GPIO_PIN22_CONFIG_MSB 14 -#define WLAN_GPIO_PIN22_CONFIG_LSB 11 -#define WLAN_GPIO_PIN22_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN22_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN22_CONFIG_MASK) >> WLAN_GPIO_PIN22_CONFIG_LSB) -#define WLAN_GPIO_PIN22_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN22_CONFIG_LSB) & WLAN_GPIO_PIN22_CONFIG_MASK) -#define WLAN_GPIO_PIN22_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN22_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN22_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN22_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN22_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN22_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN22_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN22_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN22_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN22_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN22_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN22_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN22_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN22_INT_TYPE_MASK) >> WLAN_GPIO_PIN22_INT_TYPE_LSB) -#define WLAN_GPIO_PIN22_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN22_INT_TYPE_LSB) & WLAN_GPIO_PIN22_INT_TYPE_MASK) -#define WLAN_GPIO_PIN22_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN22_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN22_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN22_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN22_PAD_PULL_MASK) >> WLAN_GPIO_PIN22_PAD_PULL_LSB) -#define WLAN_GPIO_PIN22_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN22_PAD_PULL_LSB) & WLAN_GPIO_PIN22_PAD_PULL_MASK) -#define WLAN_GPIO_PIN22_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN22_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN22_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN22_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN22_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN22_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN22_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN22_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN22_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN22_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN22_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN22_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN22_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN22_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN22_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN22_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN22_PAD_DRIVER_LSB) & WLAN_GPIO_PIN22_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN22_SOURCE_MSB 0 -#define WLAN_GPIO_PIN22_SOURCE_LSB 0 -#define WLAN_GPIO_PIN22_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN22_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN22_SOURCE_MASK) >> WLAN_GPIO_PIN22_SOURCE_LSB) -#define WLAN_GPIO_PIN22_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN22_SOURCE_LSB) & WLAN_GPIO_PIN22_SOURCE_MASK) - -#define WLAN_GPIO_PIN23_ADDRESS 0x000000ac -#define WLAN_GPIO_PIN23_OFFSET 0x000000ac -#define WLAN_GPIO_PIN23_CONFIG_MSB 14 -#define WLAN_GPIO_PIN23_CONFIG_LSB 11 -#define WLAN_GPIO_PIN23_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN23_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN23_CONFIG_MASK) >> WLAN_GPIO_PIN23_CONFIG_LSB) -#define WLAN_GPIO_PIN23_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN23_CONFIG_LSB) & WLAN_GPIO_PIN23_CONFIG_MASK) -#define WLAN_GPIO_PIN23_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN23_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN23_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN23_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN23_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN23_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN23_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN23_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN23_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN23_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN23_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN23_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN23_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN23_INT_TYPE_MASK) >> WLAN_GPIO_PIN23_INT_TYPE_LSB) -#define WLAN_GPIO_PIN23_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN23_INT_TYPE_LSB) & WLAN_GPIO_PIN23_INT_TYPE_MASK) -#define WLAN_GPIO_PIN23_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN23_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN23_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN23_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN23_PAD_PULL_MASK) >> WLAN_GPIO_PIN23_PAD_PULL_LSB) -#define WLAN_GPIO_PIN23_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN23_PAD_PULL_LSB) & WLAN_GPIO_PIN23_PAD_PULL_MASK) -#define WLAN_GPIO_PIN23_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN23_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN23_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN23_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN23_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN23_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN23_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN23_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN23_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN23_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN23_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN23_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN23_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN23_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN23_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN23_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN23_PAD_DRIVER_LSB) & WLAN_GPIO_PIN23_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN23_SOURCE_MSB 0 -#define WLAN_GPIO_PIN23_SOURCE_LSB 0 -#define WLAN_GPIO_PIN23_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN23_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN23_SOURCE_MASK) >> WLAN_GPIO_PIN23_SOURCE_LSB) -#define WLAN_GPIO_PIN23_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN23_SOURCE_LSB) & WLAN_GPIO_PIN23_SOURCE_MASK) - -#define WLAN_GPIO_PIN24_ADDRESS 0x000000b0 -#define WLAN_GPIO_PIN24_OFFSET 0x000000b0 -#define WLAN_GPIO_PIN24_CONFIG_MSB 14 -#define WLAN_GPIO_PIN24_CONFIG_LSB 11 -#define WLAN_GPIO_PIN24_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN24_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN24_CONFIG_MASK) >> WLAN_GPIO_PIN24_CONFIG_LSB) -#define WLAN_GPIO_PIN24_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN24_CONFIG_LSB) & WLAN_GPIO_PIN24_CONFIG_MASK) -#define WLAN_GPIO_PIN24_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN24_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN24_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN24_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN24_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN24_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN24_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN24_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN24_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN24_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN24_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN24_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN24_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN24_INT_TYPE_MASK) >> WLAN_GPIO_PIN24_INT_TYPE_LSB) -#define WLAN_GPIO_PIN24_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN24_INT_TYPE_LSB) & WLAN_GPIO_PIN24_INT_TYPE_MASK) -#define WLAN_GPIO_PIN24_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN24_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN24_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN24_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN24_PAD_PULL_MASK) >> WLAN_GPIO_PIN24_PAD_PULL_LSB) -#define WLAN_GPIO_PIN24_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN24_PAD_PULL_LSB) & WLAN_GPIO_PIN24_PAD_PULL_MASK) -#define WLAN_GPIO_PIN24_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN24_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN24_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN24_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN24_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN24_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN24_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN24_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN24_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN24_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN24_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN24_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN24_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN24_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN24_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN24_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN24_PAD_DRIVER_LSB) & WLAN_GPIO_PIN24_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN24_SOURCE_MSB 0 -#define WLAN_GPIO_PIN24_SOURCE_LSB 0 -#define WLAN_GPIO_PIN24_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN24_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN24_SOURCE_MASK) >> WLAN_GPIO_PIN24_SOURCE_LSB) -#define WLAN_GPIO_PIN24_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN24_SOURCE_LSB) & WLAN_GPIO_PIN24_SOURCE_MASK) - -#define WLAN_GPIO_PIN25_ADDRESS 0x000000b4 -#define WLAN_GPIO_PIN25_OFFSET 0x000000b4 -#define WLAN_GPIO_PIN25_CONFIG_MSB 14 -#define WLAN_GPIO_PIN25_CONFIG_LSB 11 -#define WLAN_GPIO_PIN25_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN25_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN25_CONFIG_MASK) >> WLAN_GPIO_PIN25_CONFIG_LSB) -#define WLAN_GPIO_PIN25_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN25_CONFIG_LSB) & WLAN_GPIO_PIN25_CONFIG_MASK) -#define WLAN_GPIO_PIN25_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN25_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN25_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN25_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN25_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN25_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN25_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN25_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN25_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN25_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN25_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN25_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN25_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN25_INT_TYPE_MASK) >> WLAN_GPIO_PIN25_INT_TYPE_LSB) -#define WLAN_GPIO_PIN25_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN25_INT_TYPE_LSB) & WLAN_GPIO_PIN25_INT_TYPE_MASK) -#define WLAN_GPIO_PIN25_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN25_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN25_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN25_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN25_PAD_PULL_MASK) >> WLAN_GPIO_PIN25_PAD_PULL_LSB) -#define WLAN_GPIO_PIN25_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN25_PAD_PULL_LSB) & WLAN_GPIO_PIN25_PAD_PULL_MASK) -#define WLAN_GPIO_PIN25_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN25_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN25_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN25_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN25_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN25_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN25_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN25_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN25_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN25_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN25_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN25_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN25_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN25_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN25_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN25_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN25_PAD_DRIVER_LSB) & WLAN_GPIO_PIN25_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN25_SOURCE_MSB 0 -#define WLAN_GPIO_PIN25_SOURCE_LSB 0 -#define WLAN_GPIO_PIN25_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN25_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN25_SOURCE_MASK) >> WLAN_GPIO_PIN25_SOURCE_LSB) -#define WLAN_GPIO_PIN25_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN25_SOURCE_LSB) & WLAN_GPIO_PIN25_SOURCE_MASK) - -#define WLAN_GPIO_PIN26_ADDRESS 0x000000b8 -#define WLAN_GPIO_PIN26_OFFSET 0x000000b8 -#define WLAN_GPIO_PIN26_CONFIG_MSB 14 -#define WLAN_GPIO_PIN26_CONFIG_LSB 11 -#define WLAN_GPIO_PIN26_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN26_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN26_CONFIG_MASK) >> WLAN_GPIO_PIN26_CONFIG_LSB) -#define WLAN_GPIO_PIN26_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN26_CONFIG_LSB) & WLAN_GPIO_PIN26_CONFIG_MASK) -#define WLAN_GPIO_PIN26_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN26_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN26_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN26_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN26_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN26_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN26_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN26_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN26_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN26_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN26_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN26_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN26_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN26_INT_TYPE_MASK) >> WLAN_GPIO_PIN26_INT_TYPE_LSB) -#define WLAN_GPIO_PIN26_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN26_INT_TYPE_LSB) & WLAN_GPIO_PIN26_INT_TYPE_MASK) -#define WLAN_GPIO_PIN26_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN26_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN26_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN26_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN26_PAD_PULL_MASK) >> WLAN_GPIO_PIN26_PAD_PULL_LSB) -#define WLAN_GPIO_PIN26_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN26_PAD_PULL_LSB) & WLAN_GPIO_PIN26_PAD_PULL_MASK) -#define WLAN_GPIO_PIN26_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN26_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN26_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN26_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN26_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN26_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN26_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN26_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN26_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN26_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN26_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN26_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN26_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN26_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN26_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN26_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN26_PAD_DRIVER_LSB) & WLAN_GPIO_PIN26_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN26_SOURCE_MSB 0 -#define WLAN_GPIO_PIN26_SOURCE_LSB 0 -#define WLAN_GPIO_PIN26_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN26_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN26_SOURCE_MASK) >> WLAN_GPIO_PIN26_SOURCE_LSB) -#define WLAN_GPIO_PIN26_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN26_SOURCE_LSB) & WLAN_GPIO_PIN26_SOURCE_MASK) - -#define WLAN_GPIO_PIN27_ADDRESS 0x000000bc -#define WLAN_GPIO_PIN27_OFFSET 0x000000bc -#define WLAN_GPIO_PIN27_CONFIG_MSB 14 -#define WLAN_GPIO_PIN27_CONFIG_LSB 11 -#define WLAN_GPIO_PIN27_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN27_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN27_CONFIG_MASK) >> WLAN_GPIO_PIN27_CONFIG_LSB) -#define WLAN_GPIO_PIN27_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN27_CONFIG_LSB) & WLAN_GPIO_PIN27_CONFIG_MASK) -#define WLAN_GPIO_PIN27_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN27_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN27_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN27_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN27_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN27_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN27_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN27_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN27_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN27_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN27_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN27_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN27_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN27_INT_TYPE_MASK) >> WLAN_GPIO_PIN27_INT_TYPE_LSB) -#define WLAN_GPIO_PIN27_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN27_INT_TYPE_LSB) & WLAN_GPIO_PIN27_INT_TYPE_MASK) -#define WLAN_GPIO_PIN27_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN27_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN27_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN27_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN27_PAD_PULL_MASK) >> WLAN_GPIO_PIN27_PAD_PULL_LSB) -#define WLAN_GPIO_PIN27_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN27_PAD_PULL_LSB) & WLAN_GPIO_PIN27_PAD_PULL_MASK) -#define WLAN_GPIO_PIN27_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN27_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN27_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN27_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN27_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN27_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN27_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN27_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN27_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN27_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN27_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN27_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN27_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN27_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN27_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN27_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN27_PAD_DRIVER_LSB) & WLAN_GPIO_PIN27_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN27_SOURCE_MSB 0 -#define WLAN_GPIO_PIN27_SOURCE_LSB 0 -#define WLAN_GPIO_PIN27_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN27_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN27_SOURCE_MASK) >> WLAN_GPIO_PIN27_SOURCE_LSB) -#define WLAN_GPIO_PIN27_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN27_SOURCE_LSB) & WLAN_GPIO_PIN27_SOURCE_MASK) - -#define WLAN_GPIO_PIN28_ADDRESS 0x000000c0 -#define WLAN_GPIO_PIN28_OFFSET 0x000000c0 -#define WLAN_GPIO_PIN28_CONFIG_MSB 14 -#define WLAN_GPIO_PIN28_CONFIG_LSB 11 -#define WLAN_GPIO_PIN28_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN28_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN28_CONFIG_MASK) >> WLAN_GPIO_PIN28_CONFIG_LSB) -#define WLAN_GPIO_PIN28_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN28_CONFIG_LSB) & WLAN_GPIO_PIN28_CONFIG_MASK) -#define WLAN_GPIO_PIN28_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN28_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN28_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN28_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN28_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN28_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN28_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN28_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN28_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN28_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN28_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN28_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN28_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN28_INT_TYPE_MASK) >> WLAN_GPIO_PIN28_INT_TYPE_LSB) -#define WLAN_GPIO_PIN28_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN28_INT_TYPE_LSB) & WLAN_GPIO_PIN28_INT_TYPE_MASK) -#define WLAN_GPIO_PIN28_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN28_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN28_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN28_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN28_PAD_PULL_MASK) >> WLAN_GPIO_PIN28_PAD_PULL_LSB) -#define WLAN_GPIO_PIN28_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN28_PAD_PULL_LSB) & WLAN_GPIO_PIN28_PAD_PULL_MASK) -#define WLAN_GPIO_PIN28_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN28_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN28_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN28_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN28_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN28_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN28_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN28_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN28_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN28_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN28_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN28_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN28_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN28_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN28_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN28_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN28_PAD_DRIVER_LSB) & WLAN_GPIO_PIN28_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN28_SOURCE_MSB 0 -#define WLAN_GPIO_PIN28_SOURCE_LSB 0 -#define WLAN_GPIO_PIN28_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN28_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN28_SOURCE_MASK) >> WLAN_GPIO_PIN28_SOURCE_LSB) -#define WLAN_GPIO_PIN28_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN28_SOURCE_LSB) & WLAN_GPIO_PIN28_SOURCE_MASK) - -#define WLAN_GPIO_PIN29_ADDRESS 0x000000c4 -#define WLAN_GPIO_PIN29_OFFSET 0x000000c4 -#define WLAN_GPIO_PIN29_CONFIG_MSB 14 -#define WLAN_GPIO_PIN29_CONFIG_LSB 11 -#define WLAN_GPIO_PIN29_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN29_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN29_CONFIG_MASK) >> WLAN_GPIO_PIN29_CONFIG_LSB) -#define WLAN_GPIO_PIN29_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN29_CONFIG_LSB) & WLAN_GPIO_PIN29_CONFIG_MASK) -#define WLAN_GPIO_PIN29_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN29_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN29_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN29_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN29_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN29_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN29_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN29_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN29_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN29_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN29_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN29_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN29_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN29_INT_TYPE_MASK) >> WLAN_GPIO_PIN29_INT_TYPE_LSB) -#define WLAN_GPIO_PIN29_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN29_INT_TYPE_LSB) & WLAN_GPIO_PIN29_INT_TYPE_MASK) -#define WLAN_GPIO_PIN29_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN29_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN29_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN29_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN29_PAD_PULL_MASK) >> WLAN_GPIO_PIN29_PAD_PULL_LSB) -#define WLAN_GPIO_PIN29_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN29_PAD_PULL_LSB) & WLAN_GPIO_PIN29_PAD_PULL_MASK) -#define WLAN_GPIO_PIN29_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN29_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN29_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN29_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN29_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN29_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN29_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN29_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN29_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN29_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN29_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN29_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN29_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN29_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN29_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN29_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN29_PAD_DRIVER_LSB) & WLAN_GPIO_PIN29_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN29_SOURCE_MSB 0 -#define WLAN_GPIO_PIN29_SOURCE_LSB 0 -#define WLAN_GPIO_PIN29_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN29_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN29_SOURCE_MASK) >> WLAN_GPIO_PIN29_SOURCE_LSB) -#define WLAN_GPIO_PIN29_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN29_SOURCE_LSB) & WLAN_GPIO_PIN29_SOURCE_MASK) - -#define WLAN_GPIO_PIN30_ADDRESS 0x000000c8 -#define WLAN_GPIO_PIN30_OFFSET 0x000000c8 -#define WLAN_GPIO_PIN30_CONFIG_MSB 14 -#define WLAN_GPIO_PIN30_CONFIG_LSB 11 -#define WLAN_GPIO_PIN30_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN30_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN30_CONFIG_MASK) >> WLAN_GPIO_PIN30_CONFIG_LSB) -#define WLAN_GPIO_PIN30_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN30_CONFIG_LSB) & WLAN_GPIO_PIN30_CONFIG_MASK) -#define WLAN_GPIO_PIN30_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN30_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN30_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN30_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN30_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN30_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN30_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN30_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN30_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN30_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN30_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN30_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN30_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN30_INT_TYPE_MASK) >> WLAN_GPIO_PIN30_INT_TYPE_LSB) -#define WLAN_GPIO_PIN30_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN30_INT_TYPE_LSB) & WLAN_GPIO_PIN30_INT_TYPE_MASK) -#define WLAN_GPIO_PIN30_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN30_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN30_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN30_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN30_PAD_PULL_MASK) >> WLAN_GPIO_PIN30_PAD_PULL_LSB) -#define WLAN_GPIO_PIN30_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN30_PAD_PULL_LSB) & WLAN_GPIO_PIN30_PAD_PULL_MASK) -#define WLAN_GPIO_PIN30_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN30_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN30_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN30_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN30_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN30_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN30_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN30_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN30_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN30_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN30_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN30_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN30_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN30_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN30_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN30_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN30_PAD_DRIVER_LSB) & WLAN_GPIO_PIN30_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN30_SOURCE_MSB 0 -#define WLAN_GPIO_PIN30_SOURCE_LSB 0 -#define WLAN_GPIO_PIN30_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN30_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN30_SOURCE_MASK) >> WLAN_GPIO_PIN30_SOURCE_LSB) -#define WLAN_GPIO_PIN30_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN30_SOURCE_LSB) & WLAN_GPIO_PIN30_SOURCE_MASK) - -#define WLAN_GPIO_PIN31_ADDRESS 0x000000cc -#define WLAN_GPIO_PIN31_OFFSET 0x000000cc -#define WLAN_GPIO_PIN31_CONFIG_MSB 14 -#define WLAN_GPIO_PIN31_CONFIG_LSB 11 -#define WLAN_GPIO_PIN31_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN31_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN31_CONFIG_MASK) >> WLAN_GPIO_PIN31_CONFIG_LSB) -#define WLAN_GPIO_PIN31_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN31_CONFIG_LSB) & WLAN_GPIO_PIN31_CONFIG_MASK) -#define WLAN_GPIO_PIN31_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN31_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN31_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN31_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN31_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN31_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN31_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN31_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN31_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN31_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN31_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN31_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN31_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN31_INT_TYPE_MASK) >> WLAN_GPIO_PIN31_INT_TYPE_LSB) -#define WLAN_GPIO_PIN31_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN31_INT_TYPE_LSB) & WLAN_GPIO_PIN31_INT_TYPE_MASK) -#define WLAN_GPIO_PIN31_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN31_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN31_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN31_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN31_PAD_PULL_MASK) >> WLAN_GPIO_PIN31_PAD_PULL_LSB) -#define WLAN_GPIO_PIN31_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN31_PAD_PULL_LSB) & WLAN_GPIO_PIN31_PAD_PULL_MASK) -#define WLAN_GPIO_PIN31_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN31_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN31_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN31_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN31_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN31_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN31_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN31_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN31_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN31_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN31_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN31_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN31_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN31_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN31_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN31_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN31_PAD_DRIVER_LSB) & WLAN_GPIO_PIN31_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN31_SOURCE_MSB 0 -#define WLAN_GPIO_PIN31_SOURCE_LSB 0 -#define WLAN_GPIO_PIN31_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN31_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN31_SOURCE_MASK) >> WLAN_GPIO_PIN31_SOURCE_LSB) -#define WLAN_GPIO_PIN31_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN31_SOURCE_LSB) & WLAN_GPIO_PIN31_SOURCE_MASK) - -#define WLAN_GPIO_PIN32_ADDRESS 0x000000d0 -#define WLAN_GPIO_PIN32_OFFSET 0x000000d0 -#define WLAN_GPIO_PIN32_CONFIG_MSB 14 -#define WLAN_GPIO_PIN32_CONFIG_LSB 11 -#define WLAN_GPIO_PIN32_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN32_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN32_CONFIG_MASK) >> WLAN_GPIO_PIN32_CONFIG_LSB) -#define WLAN_GPIO_PIN32_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN32_CONFIG_LSB) & WLAN_GPIO_PIN32_CONFIG_MASK) -#define WLAN_GPIO_PIN32_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN32_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN32_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN32_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN32_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN32_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN32_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN32_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN32_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN32_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN32_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN32_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN32_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN32_INT_TYPE_MASK) >> WLAN_GPIO_PIN32_INT_TYPE_LSB) -#define WLAN_GPIO_PIN32_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN32_INT_TYPE_LSB) & WLAN_GPIO_PIN32_INT_TYPE_MASK) -#define WLAN_GPIO_PIN32_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN32_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN32_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN32_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN32_PAD_PULL_MASK) >> WLAN_GPIO_PIN32_PAD_PULL_LSB) -#define WLAN_GPIO_PIN32_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN32_PAD_PULL_LSB) & WLAN_GPIO_PIN32_PAD_PULL_MASK) -#define WLAN_GPIO_PIN32_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN32_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN32_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN32_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN32_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN32_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN32_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN32_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN32_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN32_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN32_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN32_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN32_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN32_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN32_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN32_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN32_PAD_DRIVER_LSB) & WLAN_GPIO_PIN32_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN32_SOURCE_MSB 0 -#define WLAN_GPIO_PIN32_SOURCE_LSB 0 -#define WLAN_GPIO_PIN32_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN32_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN32_SOURCE_MASK) >> WLAN_GPIO_PIN32_SOURCE_LSB) -#define WLAN_GPIO_PIN32_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN32_SOURCE_LSB) & WLAN_GPIO_PIN32_SOURCE_MASK) - -#define WLAN_GPIO_PIN33_ADDRESS 0x000000d4 -#define WLAN_GPIO_PIN33_OFFSET 0x000000d4 -#define WLAN_GPIO_PIN33_CONFIG_MSB 14 -#define WLAN_GPIO_PIN33_CONFIG_LSB 11 -#define WLAN_GPIO_PIN33_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN33_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN33_CONFIG_MASK) >> WLAN_GPIO_PIN33_CONFIG_LSB) -#define WLAN_GPIO_PIN33_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN33_CONFIG_LSB) & WLAN_GPIO_PIN33_CONFIG_MASK) -#define WLAN_GPIO_PIN33_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN33_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN33_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN33_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN33_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN33_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN33_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN33_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN33_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN33_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN33_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN33_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN33_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN33_INT_TYPE_MASK) >> WLAN_GPIO_PIN33_INT_TYPE_LSB) -#define WLAN_GPIO_PIN33_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN33_INT_TYPE_LSB) & WLAN_GPIO_PIN33_INT_TYPE_MASK) -#define WLAN_GPIO_PIN33_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN33_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN33_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN33_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN33_PAD_PULL_MASK) >> WLAN_GPIO_PIN33_PAD_PULL_LSB) -#define WLAN_GPIO_PIN33_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN33_PAD_PULL_LSB) & WLAN_GPIO_PIN33_PAD_PULL_MASK) -#define WLAN_GPIO_PIN33_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN33_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN33_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN33_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN33_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN33_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN33_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN33_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN33_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN33_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN33_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN33_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN33_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN33_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN33_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN33_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN33_PAD_DRIVER_LSB) & WLAN_GPIO_PIN33_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN33_SOURCE_MSB 0 -#define WLAN_GPIO_PIN33_SOURCE_LSB 0 -#define WLAN_GPIO_PIN33_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN33_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN33_SOURCE_MASK) >> WLAN_GPIO_PIN33_SOURCE_LSB) -#define WLAN_GPIO_PIN33_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN33_SOURCE_LSB) & WLAN_GPIO_PIN33_SOURCE_MASK) - -#define WLAN_GPIO_PIN34_ADDRESS 0x000000d8 -#define WLAN_GPIO_PIN34_OFFSET 0x000000d8 -#define WLAN_GPIO_PIN34_CONFIG_MSB 14 -#define WLAN_GPIO_PIN34_CONFIG_LSB 11 -#define WLAN_GPIO_PIN34_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN34_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN34_CONFIG_MASK) >> WLAN_GPIO_PIN34_CONFIG_LSB) -#define WLAN_GPIO_PIN34_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN34_CONFIG_LSB) & WLAN_GPIO_PIN34_CONFIG_MASK) -#define WLAN_GPIO_PIN34_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN34_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN34_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN34_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN34_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN34_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN34_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN34_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN34_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN34_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN34_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN34_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN34_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN34_INT_TYPE_MASK) >> WLAN_GPIO_PIN34_INT_TYPE_LSB) -#define WLAN_GPIO_PIN34_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN34_INT_TYPE_LSB) & WLAN_GPIO_PIN34_INT_TYPE_MASK) -#define WLAN_GPIO_PIN34_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN34_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN34_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN34_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN34_PAD_PULL_MASK) >> WLAN_GPIO_PIN34_PAD_PULL_LSB) -#define WLAN_GPIO_PIN34_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN34_PAD_PULL_LSB) & WLAN_GPIO_PIN34_PAD_PULL_MASK) -#define WLAN_GPIO_PIN34_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN34_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN34_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN34_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN34_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN34_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN34_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN34_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN34_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN34_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN34_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN34_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN34_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN34_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN34_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN34_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN34_PAD_DRIVER_LSB) & WLAN_GPIO_PIN34_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN34_SOURCE_MSB 0 -#define WLAN_GPIO_PIN34_SOURCE_LSB 0 -#define WLAN_GPIO_PIN34_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN34_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN34_SOURCE_MASK) >> WLAN_GPIO_PIN34_SOURCE_LSB) -#define WLAN_GPIO_PIN34_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN34_SOURCE_LSB) & WLAN_GPIO_PIN34_SOURCE_MASK) - -#define WLAN_GPIO_PIN35_ADDRESS 0x000000dc -#define WLAN_GPIO_PIN35_OFFSET 0x000000dc -#define WLAN_GPIO_PIN35_CONFIG_MSB 14 -#define WLAN_GPIO_PIN35_CONFIG_LSB 11 -#define WLAN_GPIO_PIN35_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN35_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN35_CONFIG_MASK) >> WLAN_GPIO_PIN35_CONFIG_LSB) -#define WLAN_GPIO_PIN35_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN35_CONFIG_LSB) & WLAN_GPIO_PIN35_CONFIG_MASK) -#define WLAN_GPIO_PIN35_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN35_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN35_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN35_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN35_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN35_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN35_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN35_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN35_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN35_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN35_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN35_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN35_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN35_INT_TYPE_MASK) >> WLAN_GPIO_PIN35_INT_TYPE_LSB) -#define WLAN_GPIO_PIN35_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN35_INT_TYPE_LSB) & WLAN_GPIO_PIN35_INT_TYPE_MASK) -#define WLAN_GPIO_PIN35_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN35_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN35_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN35_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN35_PAD_PULL_MASK) >> WLAN_GPIO_PIN35_PAD_PULL_LSB) -#define WLAN_GPIO_PIN35_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN35_PAD_PULL_LSB) & WLAN_GPIO_PIN35_PAD_PULL_MASK) -#define WLAN_GPIO_PIN35_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN35_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN35_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN35_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN35_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN35_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN35_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN35_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN35_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN35_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN35_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN35_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN35_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN35_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN35_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN35_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN35_PAD_DRIVER_LSB) & WLAN_GPIO_PIN35_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN35_SOURCE_MSB 0 -#define WLAN_GPIO_PIN35_SOURCE_LSB 0 -#define WLAN_GPIO_PIN35_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN35_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN35_SOURCE_MASK) >> WLAN_GPIO_PIN35_SOURCE_LSB) -#define WLAN_GPIO_PIN35_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN35_SOURCE_LSB) & WLAN_GPIO_PIN35_SOURCE_MASK) - -#define WLAN_GPIO_PIN36_ADDRESS 0x000000e0 -#define WLAN_GPIO_PIN36_OFFSET 0x000000e0 -#define WLAN_GPIO_PIN36_CONFIG_MSB 14 -#define WLAN_GPIO_PIN36_CONFIG_LSB 11 -#define WLAN_GPIO_PIN36_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN36_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN36_CONFIG_MASK) >> WLAN_GPIO_PIN36_CONFIG_LSB) -#define WLAN_GPIO_PIN36_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN36_CONFIG_LSB) & WLAN_GPIO_PIN36_CONFIG_MASK) -#define WLAN_GPIO_PIN36_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN36_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN36_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN36_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN36_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN36_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN36_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN36_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN36_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN36_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN36_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN36_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN36_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN36_INT_TYPE_MASK) >> WLAN_GPIO_PIN36_INT_TYPE_LSB) -#define WLAN_GPIO_PIN36_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN36_INT_TYPE_LSB) & WLAN_GPIO_PIN36_INT_TYPE_MASK) -#define WLAN_GPIO_PIN36_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN36_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN36_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN36_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN36_PAD_PULL_MASK) >> WLAN_GPIO_PIN36_PAD_PULL_LSB) -#define WLAN_GPIO_PIN36_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN36_PAD_PULL_LSB) & WLAN_GPIO_PIN36_PAD_PULL_MASK) -#define WLAN_GPIO_PIN36_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN36_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN36_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN36_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN36_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN36_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN36_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN36_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN36_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN36_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN36_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN36_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN36_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN36_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN36_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN36_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN36_PAD_DRIVER_LSB) & WLAN_GPIO_PIN36_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN36_SOURCE_MSB 0 -#define WLAN_GPIO_PIN36_SOURCE_LSB 0 -#define WLAN_GPIO_PIN36_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN36_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN36_SOURCE_MASK) >> WLAN_GPIO_PIN36_SOURCE_LSB) -#define WLAN_GPIO_PIN36_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN36_SOURCE_LSB) & WLAN_GPIO_PIN36_SOURCE_MASK) - -#define WLAN_GPIO_PIN37_ADDRESS 0x000000e4 -#define WLAN_GPIO_PIN37_OFFSET 0x000000e4 -#define WLAN_GPIO_PIN37_CONFIG_MSB 14 -#define WLAN_GPIO_PIN37_CONFIG_LSB 11 -#define WLAN_GPIO_PIN37_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN37_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN37_CONFIG_MASK) >> WLAN_GPIO_PIN37_CONFIG_LSB) -#define WLAN_GPIO_PIN37_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN37_CONFIG_LSB) & WLAN_GPIO_PIN37_CONFIG_MASK) -#define WLAN_GPIO_PIN37_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN37_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN37_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN37_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN37_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN37_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN37_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN37_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN37_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN37_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN37_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN37_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN37_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN37_INT_TYPE_MASK) >> WLAN_GPIO_PIN37_INT_TYPE_LSB) -#define WLAN_GPIO_PIN37_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN37_INT_TYPE_LSB) & WLAN_GPIO_PIN37_INT_TYPE_MASK) -#define WLAN_GPIO_PIN37_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN37_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN37_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN37_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN37_PAD_PULL_MASK) >> WLAN_GPIO_PIN37_PAD_PULL_LSB) -#define WLAN_GPIO_PIN37_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN37_PAD_PULL_LSB) & WLAN_GPIO_PIN37_PAD_PULL_MASK) -#define WLAN_GPIO_PIN37_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN37_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN37_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN37_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN37_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN37_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN37_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN37_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN37_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN37_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN37_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN37_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN37_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN37_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN37_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN37_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN37_PAD_DRIVER_LSB) & WLAN_GPIO_PIN37_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN37_SOURCE_MSB 0 -#define WLAN_GPIO_PIN37_SOURCE_LSB 0 -#define WLAN_GPIO_PIN37_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN37_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN37_SOURCE_MASK) >> WLAN_GPIO_PIN37_SOURCE_LSB) -#define WLAN_GPIO_PIN37_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN37_SOURCE_LSB) & WLAN_GPIO_PIN37_SOURCE_MASK) - -#define WLAN_GPIO_PIN38_ADDRESS 0x000000e8 -#define WLAN_GPIO_PIN38_OFFSET 0x000000e8 -#define WLAN_GPIO_PIN38_CONFIG_MSB 14 -#define WLAN_GPIO_PIN38_CONFIG_LSB 11 -#define WLAN_GPIO_PIN38_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN38_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN38_CONFIG_MASK) >> WLAN_GPIO_PIN38_CONFIG_LSB) -#define WLAN_GPIO_PIN38_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN38_CONFIG_LSB) & WLAN_GPIO_PIN38_CONFIG_MASK) -#define WLAN_GPIO_PIN38_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN38_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN38_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN38_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN38_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN38_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN38_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN38_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN38_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN38_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN38_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN38_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN38_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN38_INT_TYPE_MASK) >> WLAN_GPIO_PIN38_INT_TYPE_LSB) -#define WLAN_GPIO_PIN38_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN38_INT_TYPE_LSB) & WLAN_GPIO_PIN38_INT_TYPE_MASK) -#define WLAN_GPIO_PIN38_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN38_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN38_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN38_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN38_PAD_PULL_MASK) >> WLAN_GPIO_PIN38_PAD_PULL_LSB) -#define WLAN_GPIO_PIN38_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN38_PAD_PULL_LSB) & WLAN_GPIO_PIN38_PAD_PULL_MASK) -#define WLAN_GPIO_PIN38_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN38_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN38_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN38_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN38_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN38_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN38_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN38_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN38_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN38_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN38_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN38_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN38_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN38_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN38_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN38_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN38_PAD_DRIVER_LSB) & WLAN_GPIO_PIN38_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN38_SOURCE_MSB 0 -#define WLAN_GPIO_PIN38_SOURCE_LSB 0 -#define WLAN_GPIO_PIN38_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN38_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN38_SOURCE_MASK) >> WLAN_GPIO_PIN38_SOURCE_LSB) -#define WLAN_GPIO_PIN38_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN38_SOURCE_LSB) & WLAN_GPIO_PIN38_SOURCE_MASK) - -#define WLAN_GPIO_PIN39_ADDRESS 0x000000ec -#define WLAN_GPIO_PIN39_OFFSET 0x000000ec -#define WLAN_GPIO_PIN39_CONFIG_MSB 14 -#define WLAN_GPIO_PIN39_CONFIG_LSB 11 -#define WLAN_GPIO_PIN39_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN39_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN39_CONFIG_MASK) >> WLAN_GPIO_PIN39_CONFIG_LSB) -#define WLAN_GPIO_PIN39_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN39_CONFIG_LSB) & WLAN_GPIO_PIN39_CONFIG_MASK) -#define WLAN_GPIO_PIN39_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN39_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN39_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN39_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN39_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN39_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN39_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN39_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN39_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN39_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN39_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN39_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN39_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN39_INT_TYPE_MASK) >> WLAN_GPIO_PIN39_INT_TYPE_LSB) -#define WLAN_GPIO_PIN39_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN39_INT_TYPE_LSB) & WLAN_GPIO_PIN39_INT_TYPE_MASK) -#define WLAN_GPIO_PIN39_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN39_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN39_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN39_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN39_PAD_PULL_MASK) >> WLAN_GPIO_PIN39_PAD_PULL_LSB) -#define WLAN_GPIO_PIN39_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN39_PAD_PULL_LSB) & WLAN_GPIO_PIN39_PAD_PULL_MASK) -#define WLAN_GPIO_PIN39_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN39_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN39_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN39_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN39_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN39_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN39_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN39_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN39_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN39_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN39_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN39_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN39_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN39_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN39_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN39_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN39_PAD_DRIVER_LSB) & WLAN_GPIO_PIN39_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN39_SOURCE_MSB 0 -#define WLAN_GPIO_PIN39_SOURCE_LSB 0 -#define WLAN_GPIO_PIN39_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN39_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN39_SOURCE_MASK) >> WLAN_GPIO_PIN39_SOURCE_LSB) -#define WLAN_GPIO_PIN39_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN39_SOURCE_LSB) & WLAN_GPIO_PIN39_SOURCE_MASK) - -#define WLAN_GPIO_PIN40_ADDRESS 0x000000f0 -#define WLAN_GPIO_PIN40_OFFSET 0x000000f0 -#define WLAN_GPIO_PIN40_CONFIG_MSB 14 -#define WLAN_GPIO_PIN40_CONFIG_LSB 11 -#define WLAN_GPIO_PIN40_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN40_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN40_CONFIG_MASK) >> WLAN_GPIO_PIN40_CONFIG_LSB) -#define WLAN_GPIO_PIN40_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN40_CONFIG_LSB) & WLAN_GPIO_PIN40_CONFIG_MASK) -#define WLAN_GPIO_PIN40_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN40_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN40_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN40_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN40_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN40_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN40_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN40_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN40_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN40_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN40_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN40_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN40_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN40_INT_TYPE_MASK) >> WLAN_GPIO_PIN40_INT_TYPE_LSB) -#define WLAN_GPIO_PIN40_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN40_INT_TYPE_LSB) & WLAN_GPIO_PIN40_INT_TYPE_MASK) -#define WLAN_GPIO_PIN40_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN40_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN40_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN40_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN40_PAD_PULL_MASK) >> WLAN_GPIO_PIN40_PAD_PULL_LSB) -#define WLAN_GPIO_PIN40_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN40_PAD_PULL_LSB) & WLAN_GPIO_PIN40_PAD_PULL_MASK) -#define WLAN_GPIO_PIN40_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN40_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN40_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN40_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN40_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN40_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN40_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN40_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN40_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN40_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN40_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN40_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN40_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN40_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN40_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN40_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN40_PAD_DRIVER_LSB) & WLAN_GPIO_PIN40_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN40_SOURCE_MSB 0 -#define WLAN_GPIO_PIN40_SOURCE_LSB 0 -#define WLAN_GPIO_PIN40_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN40_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN40_SOURCE_MASK) >> WLAN_GPIO_PIN40_SOURCE_LSB) -#define WLAN_GPIO_PIN40_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN40_SOURCE_LSB) & WLAN_GPIO_PIN40_SOURCE_MASK) - -#define WLAN_GPIO_PIN41_ADDRESS 0x000000f4 -#define WLAN_GPIO_PIN41_OFFSET 0x000000f4 -#define WLAN_GPIO_PIN41_CONFIG_MSB 14 -#define WLAN_GPIO_PIN41_CONFIG_LSB 11 -#define WLAN_GPIO_PIN41_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN41_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN41_CONFIG_MASK) >> WLAN_GPIO_PIN41_CONFIG_LSB) -#define WLAN_GPIO_PIN41_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN41_CONFIG_LSB) & WLAN_GPIO_PIN41_CONFIG_MASK) -#define WLAN_GPIO_PIN41_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN41_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN41_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN41_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN41_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN41_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN41_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN41_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN41_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN41_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN41_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN41_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN41_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN41_INT_TYPE_MASK) >> WLAN_GPIO_PIN41_INT_TYPE_LSB) -#define WLAN_GPIO_PIN41_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN41_INT_TYPE_LSB) & WLAN_GPIO_PIN41_INT_TYPE_MASK) -#define WLAN_GPIO_PIN41_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN41_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN41_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN41_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN41_PAD_PULL_MASK) >> WLAN_GPIO_PIN41_PAD_PULL_LSB) -#define WLAN_GPIO_PIN41_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN41_PAD_PULL_LSB) & WLAN_GPIO_PIN41_PAD_PULL_MASK) -#define WLAN_GPIO_PIN41_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN41_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN41_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN41_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN41_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN41_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN41_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN41_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN41_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN41_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN41_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN41_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN41_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN41_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN41_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN41_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN41_PAD_DRIVER_LSB) & WLAN_GPIO_PIN41_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN41_SOURCE_MSB 0 -#define WLAN_GPIO_PIN41_SOURCE_LSB 0 -#define WLAN_GPIO_PIN41_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN41_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN41_SOURCE_MASK) >> WLAN_GPIO_PIN41_SOURCE_LSB) -#define WLAN_GPIO_PIN41_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN41_SOURCE_LSB) & WLAN_GPIO_PIN41_SOURCE_MASK) - -#define WLAN_GPIO_PIN42_ADDRESS 0x000000f8 -#define WLAN_GPIO_PIN42_OFFSET 0x000000f8 -#define WLAN_GPIO_PIN42_CONFIG_MSB 14 -#define WLAN_GPIO_PIN42_CONFIG_LSB 11 -#define WLAN_GPIO_PIN42_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN42_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN42_CONFIG_MASK) >> WLAN_GPIO_PIN42_CONFIG_LSB) -#define WLAN_GPIO_PIN42_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN42_CONFIG_LSB) & WLAN_GPIO_PIN42_CONFIG_MASK) -#define WLAN_GPIO_PIN42_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN42_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN42_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN42_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN42_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN42_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN42_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN42_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN42_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN42_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN42_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN42_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN42_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN42_INT_TYPE_MASK) >> WLAN_GPIO_PIN42_INT_TYPE_LSB) -#define WLAN_GPIO_PIN42_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN42_INT_TYPE_LSB) & WLAN_GPIO_PIN42_INT_TYPE_MASK) -#define WLAN_GPIO_PIN42_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN42_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN42_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN42_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN42_PAD_PULL_MASK) >> WLAN_GPIO_PIN42_PAD_PULL_LSB) -#define WLAN_GPIO_PIN42_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN42_PAD_PULL_LSB) & WLAN_GPIO_PIN42_PAD_PULL_MASK) -#define WLAN_GPIO_PIN42_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN42_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN42_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN42_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN42_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN42_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN42_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN42_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN42_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN42_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN42_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN42_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN42_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN42_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN42_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN42_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN42_PAD_DRIVER_LSB) & WLAN_GPIO_PIN42_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN42_SOURCE_MSB 0 -#define WLAN_GPIO_PIN42_SOURCE_LSB 0 -#define WLAN_GPIO_PIN42_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN42_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN42_SOURCE_MASK) >> WLAN_GPIO_PIN42_SOURCE_LSB) -#define WLAN_GPIO_PIN42_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN42_SOURCE_LSB) & WLAN_GPIO_PIN42_SOURCE_MASK) - -#define WLAN_GPIO_PIN43_ADDRESS 0x000000fc -#define WLAN_GPIO_PIN43_OFFSET 0x000000fc -#define WLAN_GPIO_PIN43_CONFIG_MSB 14 -#define WLAN_GPIO_PIN43_CONFIG_LSB 11 -#define WLAN_GPIO_PIN43_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN43_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN43_CONFIG_MASK) >> WLAN_GPIO_PIN43_CONFIG_LSB) -#define WLAN_GPIO_PIN43_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN43_CONFIG_LSB) & WLAN_GPIO_PIN43_CONFIG_MASK) -#define WLAN_GPIO_PIN43_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN43_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN43_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN43_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN43_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN43_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN43_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN43_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN43_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN43_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN43_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN43_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN43_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN43_INT_TYPE_MASK) >> WLAN_GPIO_PIN43_INT_TYPE_LSB) -#define WLAN_GPIO_PIN43_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN43_INT_TYPE_LSB) & WLAN_GPIO_PIN43_INT_TYPE_MASK) -#define WLAN_GPIO_PIN43_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN43_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN43_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN43_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN43_PAD_PULL_MASK) >> WLAN_GPIO_PIN43_PAD_PULL_LSB) -#define WLAN_GPIO_PIN43_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN43_PAD_PULL_LSB) & WLAN_GPIO_PIN43_PAD_PULL_MASK) -#define WLAN_GPIO_PIN43_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN43_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN43_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN43_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN43_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN43_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN43_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN43_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN43_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN43_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN43_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN43_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN43_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN43_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN43_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN43_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN43_PAD_DRIVER_LSB) & WLAN_GPIO_PIN43_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN43_SOURCE_MSB 0 -#define WLAN_GPIO_PIN43_SOURCE_LSB 0 -#define WLAN_GPIO_PIN43_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN43_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN43_SOURCE_MASK) >> WLAN_GPIO_PIN43_SOURCE_LSB) -#define WLAN_GPIO_PIN43_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN43_SOURCE_LSB) & WLAN_GPIO_PIN43_SOURCE_MASK) - -#define WLAN_GPIO_PIN44_ADDRESS 0x00000100 -#define WLAN_GPIO_PIN44_OFFSET 0x00000100 -#define WLAN_GPIO_PIN44_CONFIG_MSB 14 -#define WLAN_GPIO_PIN44_CONFIG_LSB 11 -#define WLAN_GPIO_PIN44_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN44_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN44_CONFIG_MASK) >> WLAN_GPIO_PIN44_CONFIG_LSB) -#define WLAN_GPIO_PIN44_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN44_CONFIG_LSB) & WLAN_GPIO_PIN44_CONFIG_MASK) -#define WLAN_GPIO_PIN44_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN44_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN44_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN44_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN44_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN44_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN44_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN44_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN44_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN44_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN44_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN44_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN44_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN44_INT_TYPE_MASK) >> WLAN_GPIO_PIN44_INT_TYPE_LSB) -#define WLAN_GPIO_PIN44_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN44_INT_TYPE_LSB) & WLAN_GPIO_PIN44_INT_TYPE_MASK) -#define WLAN_GPIO_PIN44_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN44_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN44_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN44_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN44_PAD_PULL_MASK) >> WLAN_GPIO_PIN44_PAD_PULL_LSB) -#define WLAN_GPIO_PIN44_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN44_PAD_PULL_LSB) & WLAN_GPIO_PIN44_PAD_PULL_MASK) -#define WLAN_GPIO_PIN44_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN44_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN44_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN44_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN44_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN44_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN44_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN44_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN44_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN44_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN44_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN44_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN44_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN44_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN44_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN44_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN44_PAD_DRIVER_LSB) & WLAN_GPIO_PIN44_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN44_SOURCE_MSB 0 -#define WLAN_GPIO_PIN44_SOURCE_LSB 0 -#define WLAN_GPIO_PIN44_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN44_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN44_SOURCE_MASK) >> WLAN_GPIO_PIN44_SOURCE_LSB) -#define WLAN_GPIO_PIN44_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN44_SOURCE_LSB) & WLAN_GPIO_PIN44_SOURCE_MASK) - -#define WLAN_GPIO_PIN45_ADDRESS 0x00000104 -#define WLAN_GPIO_PIN45_OFFSET 0x00000104 -#define WLAN_GPIO_PIN45_CONFIG_MSB 14 -#define WLAN_GPIO_PIN45_CONFIG_LSB 11 -#define WLAN_GPIO_PIN45_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN45_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN45_CONFIG_MASK) >> WLAN_GPIO_PIN45_CONFIG_LSB) -#define WLAN_GPIO_PIN45_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN45_CONFIG_LSB) & WLAN_GPIO_PIN45_CONFIG_MASK) -#define WLAN_GPIO_PIN45_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN45_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN45_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN45_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN45_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN45_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN45_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN45_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN45_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN45_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN45_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN45_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN45_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN45_INT_TYPE_MASK) >> WLAN_GPIO_PIN45_INT_TYPE_LSB) -#define WLAN_GPIO_PIN45_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN45_INT_TYPE_LSB) & WLAN_GPIO_PIN45_INT_TYPE_MASK) -#define WLAN_GPIO_PIN45_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN45_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN45_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN45_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN45_PAD_PULL_MASK) >> WLAN_GPIO_PIN45_PAD_PULL_LSB) -#define WLAN_GPIO_PIN45_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN45_PAD_PULL_LSB) & WLAN_GPIO_PIN45_PAD_PULL_MASK) -#define WLAN_GPIO_PIN45_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN45_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN45_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN45_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN45_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN45_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN45_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN45_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN45_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN45_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN45_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN45_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN45_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN45_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN45_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN45_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN45_PAD_DRIVER_LSB) & WLAN_GPIO_PIN45_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN45_SOURCE_MSB 0 -#define WLAN_GPIO_PIN45_SOURCE_LSB 0 -#define WLAN_GPIO_PIN45_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN45_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN45_SOURCE_MASK) >> WLAN_GPIO_PIN45_SOURCE_LSB) -#define WLAN_GPIO_PIN45_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN45_SOURCE_LSB) & WLAN_GPIO_PIN45_SOURCE_MASK) - -#define WLAN_GPIO_PIN46_ADDRESS 0x00000108 -#define WLAN_GPIO_PIN46_OFFSET 0x00000108 -#define WLAN_GPIO_PIN46_CONFIG_MSB 14 -#define WLAN_GPIO_PIN46_CONFIG_LSB 11 -#define WLAN_GPIO_PIN46_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN46_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN46_CONFIG_MASK) >> WLAN_GPIO_PIN46_CONFIG_LSB) -#define WLAN_GPIO_PIN46_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN46_CONFIG_LSB) & WLAN_GPIO_PIN46_CONFIG_MASK) -#define WLAN_GPIO_PIN46_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN46_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN46_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN46_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN46_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN46_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN46_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN46_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN46_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN46_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN46_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN46_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN46_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN46_INT_TYPE_MASK) >> WLAN_GPIO_PIN46_INT_TYPE_LSB) -#define WLAN_GPIO_PIN46_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN46_INT_TYPE_LSB) & WLAN_GPIO_PIN46_INT_TYPE_MASK) -#define WLAN_GPIO_PIN46_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN46_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN46_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN46_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN46_PAD_PULL_MASK) >> WLAN_GPIO_PIN46_PAD_PULL_LSB) -#define WLAN_GPIO_PIN46_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN46_PAD_PULL_LSB) & WLAN_GPIO_PIN46_PAD_PULL_MASK) -#define WLAN_GPIO_PIN46_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN46_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN46_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN46_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN46_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN46_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN46_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN46_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN46_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN46_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN46_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN46_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN46_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN46_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN46_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN46_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN46_PAD_DRIVER_LSB) & WLAN_GPIO_PIN46_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN46_SOURCE_MSB 0 -#define WLAN_GPIO_PIN46_SOURCE_LSB 0 -#define WLAN_GPIO_PIN46_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN46_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN46_SOURCE_MASK) >> WLAN_GPIO_PIN46_SOURCE_LSB) -#define WLAN_GPIO_PIN46_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN46_SOURCE_LSB) & WLAN_GPIO_PIN46_SOURCE_MASK) - -#define WLAN_GPIO_PIN47_ADDRESS 0x0000010c -#define WLAN_GPIO_PIN47_OFFSET 0x0000010c -#define WLAN_GPIO_PIN47_CONFIG_MSB 14 -#define WLAN_GPIO_PIN47_CONFIG_LSB 11 -#define WLAN_GPIO_PIN47_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN47_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN47_CONFIG_MASK) >> WLAN_GPIO_PIN47_CONFIG_LSB) -#define WLAN_GPIO_PIN47_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN47_CONFIG_LSB) & WLAN_GPIO_PIN47_CONFIG_MASK) -#define WLAN_GPIO_PIN47_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN47_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN47_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN47_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN47_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN47_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN47_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN47_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN47_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN47_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN47_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN47_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN47_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN47_INT_TYPE_MASK) >> WLAN_GPIO_PIN47_INT_TYPE_LSB) -#define WLAN_GPIO_PIN47_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN47_INT_TYPE_LSB) & WLAN_GPIO_PIN47_INT_TYPE_MASK) -#define WLAN_GPIO_PIN47_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN47_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN47_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN47_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN47_PAD_PULL_MASK) >> WLAN_GPIO_PIN47_PAD_PULL_LSB) -#define WLAN_GPIO_PIN47_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN47_PAD_PULL_LSB) & WLAN_GPIO_PIN47_PAD_PULL_MASK) -#define WLAN_GPIO_PIN47_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN47_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN47_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN47_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN47_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN47_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN47_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN47_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN47_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN47_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN47_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN47_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN47_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN47_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN47_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN47_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN47_PAD_DRIVER_LSB) & WLAN_GPIO_PIN47_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN47_SOURCE_MSB 0 -#define WLAN_GPIO_PIN47_SOURCE_LSB 0 -#define WLAN_GPIO_PIN47_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN47_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN47_SOURCE_MASK) >> WLAN_GPIO_PIN47_SOURCE_LSB) -#define WLAN_GPIO_PIN47_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN47_SOURCE_LSB) & WLAN_GPIO_PIN47_SOURCE_MASK) - -#define WLAN_GPIO_PIN48_ADDRESS 0x00000110 -#define WLAN_GPIO_PIN48_OFFSET 0x00000110 -#define WLAN_GPIO_PIN48_CONFIG_MSB 14 -#define WLAN_GPIO_PIN48_CONFIG_LSB 11 -#define WLAN_GPIO_PIN48_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN48_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN48_CONFIG_MASK) >> WLAN_GPIO_PIN48_CONFIG_LSB) -#define WLAN_GPIO_PIN48_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN48_CONFIG_LSB) & WLAN_GPIO_PIN48_CONFIG_MASK) -#define WLAN_GPIO_PIN48_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN48_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN48_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN48_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN48_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN48_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN48_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN48_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN48_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN48_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN48_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN48_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN48_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN48_INT_TYPE_MASK) >> WLAN_GPIO_PIN48_INT_TYPE_LSB) -#define WLAN_GPIO_PIN48_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN48_INT_TYPE_LSB) & WLAN_GPIO_PIN48_INT_TYPE_MASK) -#define WLAN_GPIO_PIN48_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN48_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN48_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN48_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN48_PAD_PULL_MASK) >> WLAN_GPIO_PIN48_PAD_PULL_LSB) -#define WLAN_GPIO_PIN48_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN48_PAD_PULL_LSB) & WLAN_GPIO_PIN48_PAD_PULL_MASK) -#define WLAN_GPIO_PIN48_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN48_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN48_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN48_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN48_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN48_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN48_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN48_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN48_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN48_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN48_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN48_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN48_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN48_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN48_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN48_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN48_PAD_DRIVER_LSB) & WLAN_GPIO_PIN48_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN48_SOURCE_MSB 0 -#define WLAN_GPIO_PIN48_SOURCE_LSB 0 -#define WLAN_GPIO_PIN48_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN48_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN48_SOURCE_MASK) >> WLAN_GPIO_PIN48_SOURCE_LSB) -#define WLAN_GPIO_PIN48_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN48_SOURCE_LSB) & WLAN_GPIO_PIN48_SOURCE_MASK) - -#define WLAN_GPIO_PIN49_ADDRESS 0x00000114 -#define WLAN_GPIO_PIN49_OFFSET 0x00000114 -#define WLAN_GPIO_PIN49_CONFIG_MSB 14 -#define WLAN_GPIO_PIN49_CONFIG_LSB 11 -#define WLAN_GPIO_PIN49_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN49_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN49_CONFIG_MASK) >> WLAN_GPIO_PIN49_CONFIG_LSB) -#define WLAN_GPIO_PIN49_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN49_CONFIG_LSB) & WLAN_GPIO_PIN49_CONFIG_MASK) -#define WLAN_GPIO_PIN49_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN49_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN49_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN49_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN49_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN49_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN49_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN49_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN49_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN49_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN49_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN49_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN49_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN49_INT_TYPE_MASK) >> WLAN_GPIO_PIN49_INT_TYPE_LSB) -#define WLAN_GPIO_PIN49_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN49_INT_TYPE_LSB) & WLAN_GPIO_PIN49_INT_TYPE_MASK) -#define WLAN_GPIO_PIN49_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN49_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN49_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN49_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN49_PAD_PULL_MASK) >> WLAN_GPIO_PIN49_PAD_PULL_LSB) -#define WLAN_GPIO_PIN49_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN49_PAD_PULL_LSB) & WLAN_GPIO_PIN49_PAD_PULL_MASK) -#define WLAN_GPIO_PIN49_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN49_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN49_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN49_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN49_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN49_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN49_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN49_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN49_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN49_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN49_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN49_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN49_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN49_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN49_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN49_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN49_PAD_DRIVER_LSB) & WLAN_GPIO_PIN49_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN49_SOURCE_MSB 0 -#define WLAN_GPIO_PIN49_SOURCE_LSB 0 -#define WLAN_GPIO_PIN49_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN49_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN49_SOURCE_MASK) >> WLAN_GPIO_PIN49_SOURCE_LSB) -#define WLAN_GPIO_PIN49_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN49_SOURCE_LSB) & WLAN_GPIO_PIN49_SOURCE_MASK) - -#define WLAN_GPIO_PIN50_ADDRESS 0x00000118 -#define WLAN_GPIO_PIN50_OFFSET 0x00000118 -#define WLAN_GPIO_PIN50_CONFIG_MSB 14 -#define WLAN_GPIO_PIN50_CONFIG_LSB 11 -#define WLAN_GPIO_PIN50_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN50_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN50_CONFIG_MASK) >> WLAN_GPIO_PIN50_CONFIG_LSB) -#define WLAN_GPIO_PIN50_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN50_CONFIG_LSB) & WLAN_GPIO_PIN50_CONFIG_MASK) -#define WLAN_GPIO_PIN50_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN50_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN50_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN50_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN50_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN50_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN50_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN50_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN50_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN50_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN50_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN50_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN50_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN50_INT_TYPE_MASK) >> WLAN_GPIO_PIN50_INT_TYPE_LSB) -#define WLAN_GPIO_PIN50_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN50_INT_TYPE_LSB) & WLAN_GPIO_PIN50_INT_TYPE_MASK) -#define WLAN_GPIO_PIN50_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN50_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN50_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN50_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN50_PAD_PULL_MASK) >> WLAN_GPIO_PIN50_PAD_PULL_LSB) -#define WLAN_GPIO_PIN50_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN50_PAD_PULL_LSB) & WLAN_GPIO_PIN50_PAD_PULL_MASK) -#define WLAN_GPIO_PIN50_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN50_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN50_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN50_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN50_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN50_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN50_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN50_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN50_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN50_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN50_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN50_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN50_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN50_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN50_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN50_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN50_PAD_DRIVER_LSB) & WLAN_GPIO_PIN50_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN50_SOURCE_MSB 0 -#define WLAN_GPIO_PIN50_SOURCE_LSB 0 -#define WLAN_GPIO_PIN50_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN50_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN50_SOURCE_MASK) >> WLAN_GPIO_PIN50_SOURCE_LSB) -#define WLAN_GPIO_PIN50_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN50_SOURCE_LSB) & WLAN_GPIO_PIN50_SOURCE_MASK) - -#define WLAN_GPIO_PIN51_ADDRESS 0x0000011c -#define WLAN_GPIO_PIN51_OFFSET 0x0000011c -#define WLAN_GPIO_PIN51_CONFIG_MSB 14 -#define WLAN_GPIO_PIN51_CONFIG_LSB 11 -#define WLAN_GPIO_PIN51_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN51_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN51_CONFIG_MASK) >> WLAN_GPIO_PIN51_CONFIG_LSB) -#define WLAN_GPIO_PIN51_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN51_CONFIG_LSB) & WLAN_GPIO_PIN51_CONFIG_MASK) -#define WLAN_GPIO_PIN51_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN51_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN51_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN51_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN51_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN51_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN51_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN51_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN51_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN51_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN51_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN51_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN51_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN51_INT_TYPE_MASK) >> WLAN_GPIO_PIN51_INT_TYPE_LSB) -#define WLAN_GPIO_PIN51_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN51_INT_TYPE_LSB) & WLAN_GPIO_PIN51_INT_TYPE_MASK) -#define WLAN_GPIO_PIN51_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN51_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN51_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN51_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN51_PAD_PULL_MASK) >> WLAN_GPIO_PIN51_PAD_PULL_LSB) -#define WLAN_GPIO_PIN51_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN51_PAD_PULL_LSB) & WLAN_GPIO_PIN51_PAD_PULL_MASK) -#define WLAN_GPIO_PIN51_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN51_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN51_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN51_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN51_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN51_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN51_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN51_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN51_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN51_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN51_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN51_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN51_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN51_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN51_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN51_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN51_PAD_DRIVER_LSB) & WLAN_GPIO_PIN51_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN51_SOURCE_MSB 0 -#define WLAN_GPIO_PIN51_SOURCE_LSB 0 -#define WLAN_GPIO_PIN51_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN51_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN51_SOURCE_MASK) >> WLAN_GPIO_PIN51_SOURCE_LSB) -#define WLAN_GPIO_PIN51_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN51_SOURCE_LSB) & WLAN_GPIO_PIN51_SOURCE_MASK) - -#define WLAN_GPIO_PIN52_ADDRESS 0x00000120 -#define WLAN_GPIO_PIN52_OFFSET 0x00000120 -#define WLAN_GPIO_PIN52_CONFIG_MSB 14 -#define WLAN_GPIO_PIN52_CONFIG_LSB 11 -#define WLAN_GPIO_PIN52_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN52_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN52_CONFIG_MASK) >> WLAN_GPIO_PIN52_CONFIG_LSB) -#define WLAN_GPIO_PIN52_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN52_CONFIG_LSB) & WLAN_GPIO_PIN52_CONFIG_MASK) -#define WLAN_GPIO_PIN52_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN52_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN52_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN52_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN52_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN52_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN52_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN52_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN52_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN52_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN52_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN52_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN52_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN52_INT_TYPE_MASK) >> WLAN_GPIO_PIN52_INT_TYPE_LSB) -#define WLAN_GPIO_PIN52_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN52_INT_TYPE_LSB) & WLAN_GPIO_PIN52_INT_TYPE_MASK) -#define WLAN_GPIO_PIN52_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN52_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN52_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN52_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN52_PAD_PULL_MASK) >> WLAN_GPIO_PIN52_PAD_PULL_LSB) -#define WLAN_GPIO_PIN52_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN52_PAD_PULL_LSB) & WLAN_GPIO_PIN52_PAD_PULL_MASK) -#define WLAN_GPIO_PIN52_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN52_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN52_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN52_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN52_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN52_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN52_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN52_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN52_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN52_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN52_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN52_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN52_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN52_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN52_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN52_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN52_PAD_DRIVER_LSB) & WLAN_GPIO_PIN52_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN52_SOURCE_MSB 0 -#define WLAN_GPIO_PIN52_SOURCE_LSB 0 -#define WLAN_GPIO_PIN52_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN52_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN52_SOURCE_MASK) >> WLAN_GPIO_PIN52_SOURCE_LSB) -#define WLAN_GPIO_PIN52_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN52_SOURCE_LSB) & WLAN_GPIO_PIN52_SOURCE_MASK) - -#define WLAN_GPIO_PIN53_ADDRESS 0x00000124 -#define WLAN_GPIO_PIN53_OFFSET 0x00000124 -#define WLAN_GPIO_PIN53_CONFIG_MSB 14 -#define WLAN_GPIO_PIN53_CONFIG_LSB 11 -#define WLAN_GPIO_PIN53_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN53_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN53_CONFIG_MASK) >> WLAN_GPIO_PIN53_CONFIG_LSB) -#define WLAN_GPIO_PIN53_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN53_CONFIG_LSB) & WLAN_GPIO_PIN53_CONFIG_MASK) -#define WLAN_GPIO_PIN53_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN53_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN53_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN53_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN53_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN53_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN53_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN53_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN53_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN53_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN53_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN53_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN53_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN53_INT_TYPE_MASK) >> WLAN_GPIO_PIN53_INT_TYPE_LSB) -#define WLAN_GPIO_PIN53_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN53_INT_TYPE_LSB) & WLAN_GPIO_PIN53_INT_TYPE_MASK) -#define WLAN_GPIO_PIN53_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN53_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN53_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN53_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN53_PAD_PULL_MASK) >> WLAN_GPIO_PIN53_PAD_PULL_LSB) -#define WLAN_GPIO_PIN53_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN53_PAD_PULL_LSB) & WLAN_GPIO_PIN53_PAD_PULL_MASK) -#define WLAN_GPIO_PIN53_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN53_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN53_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN53_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN53_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN53_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN53_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN53_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN53_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN53_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN53_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN53_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN53_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN53_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN53_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN53_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN53_PAD_DRIVER_LSB) & WLAN_GPIO_PIN53_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN53_SOURCE_MSB 0 -#define WLAN_GPIO_PIN53_SOURCE_LSB 0 -#define WLAN_GPIO_PIN53_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN53_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN53_SOURCE_MASK) >> WLAN_GPIO_PIN53_SOURCE_LSB) -#define WLAN_GPIO_PIN53_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN53_SOURCE_LSB) & WLAN_GPIO_PIN53_SOURCE_MASK) - -#define WLAN_GPIO_PIN54_ADDRESS 0x00000128 -#define WLAN_GPIO_PIN54_OFFSET 0x00000128 -#define WLAN_GPIO_PIN54_CONFIG_MSB 14 -#define WLAN_GPIO_PIN54_CONFIG_LSB 11 -#define WLAN_GPIO_PIN54_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN54_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN54_CONFIG_MASK) >> WLAN_GPIO_PIN54_CONFIG_LSB) -#define WLAN_GPIO_PIN54_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN54_CONFIG_LSB) & WLAN_GPIO_PIN54_CONFIG_MASK) -#define WLAN_GPIO_PIN54_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN54_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN54_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN54_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN54_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN54_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN54_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN54_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN54_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN54_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN54_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN54_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN54_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN54_INT_TYPE_MASK) >> WLAN_GPIO_PIN54_INT_TYPE_LSB) -#define WLAN_GPIO_PIN54_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN54_INT_TYPE_LSB) & WLAN_GPIO_PIN54_INT_TYPE_MASK) -#define WLAN_GPIO_PIN54_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN54_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN54_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN54_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN54_PAD_PULL_MASK) >> WLAN_GPIO_PIN54_PAD_PULL_LSB) -#define WLAN_GPIO_PIN54_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN54_PAD_PULL_LSB) & WLAN_GPIO_PIN54_PAD_PULL_MASK) -#define WLAN_GPIO_PIN54_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN54_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN54_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN54_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN54_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN54_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN54_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN54_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN54_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN54_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN54_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN54_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN54_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN54_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN54_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN54_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN54_PAD_DRIVER_LSB) & WLAN_GPIO_PIN54_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN54_SOURCE_MSB 0 -#define WLAN_GPIO_PIN54_SOURCE_LSB 0 -#define WLAN_GPIO_PIN54_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN54_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN54_SOURCE_MASK) >> WLAN_GPIO_PIN54_SOURCE_LSB) -#define WLAN_GPIO_PIN54_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN54_SOURCE_LSB) & WLAN_GPIO_PIN54_SOURCE_MASK) - -#define WLAN_GPIO_PIN55_ADDRESS 0x0000012c -#define WLAN_GPIO_PIN55_OFFSET 0x0000012c -#define WLAN_GPIO_PIN55_CONFIG_MSB 14 -#define WLAN_GPIO_PIN55_CONFIG_LSB 11 -#define WLAN_GPIO_PIN55_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN55_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN55_CONFIG_MASK) >> WLAN_GPIO_PIN55_CONFIG_LSB) -#define WLAN_GPIO_PIN55_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN55_CONFIG_LSB) & WLAN_GPIO_PIN55_CONFIG_MASK) -#define WLAN_GPIO_PIN55_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN55_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN55_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN55_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN55_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN55_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN55_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN55_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN55_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN55_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN55_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN55_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN55_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN55_INT_TYPE_MASK) >> WLAN_GPIO_PIN55_INT_TYPE_LSB) -#define WLAN_GPIO_PIN55_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN55_INT_TYPE_LSB) & WLAN_GPIO_PIN55_INT_TYPE_MASK) -#define WLAN_GPIO_PIN55_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN55_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN55_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN55_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN55_PAD_PULL_MASK) >> WLAN_GPIO_PIN55_PAD_PULL_LSB) -#define WLAN_GPIO_PIN55_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN55_PAD_PULL_LSB) & WLAN_GPIO_PIN55_PAD_PULL_MASK) -#define WLAN_GPIO_PIN55_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN55_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN55_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN55_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN55_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN55_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN55_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN55_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN55_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN55_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN55_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN55_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN55_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN55_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN55_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN55_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN55_PAD_DRIVER_LSB) & WLAN_GPIO_PIN55_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN55_SOURCE_MSB 0 -#define WLAN_GPIO_PIN55_SOURCE_LSB 0 -#define WLAN_GPIO_PIN55_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN55_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN55_SOURCE_MASK) >> WLAN_GPIO_PIN55_SOURCE_LSB) -#define WLAN_GPIO_PIN55_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN55_SOURCE_LSB) & WLAN_GPIO_PIN55_SOURCE_MASK) - -#define WLAN_GPIO_PIN56_ADDRESS 0x00000130 -#define WLAN_GPIO_PIN56_OFFSET 0x00000130 -#define WLAN_GPIO_PIN56_CONFIG_MSB 14 -#define WLAN_GPIO_PIN56_CONFIG_LSB 11 -#define WLAN_GPIO_PIN56_CONFIG_MASK 0x00007800 -#define WLAN_GPIO_PIN56_CONFIG_GET(x) (((x) & WLAN_GPIO_PIN56_CONFIG_MASK) >> WLAN_GPIO_PIN56_CONFIG_LSB) -#define WLAN_GPIO_PIN56_CONFIG_SET(x) (((x) << WLAN_GPIO_PIN56_CONFIG_LSB) & WLAN_GPIO_PIN56_CONFIG_MASK) -#define WLAN_GPIO_PIN56_WAKEUP_ENABLE_MSB 10 -#define WLAN_GPIO_PIN56_WAKEUP_ENABLE_LSB 10 -#define WLAN_GPIO_PIN56_WAKEUP_ENABLE_MASK 0x00000400 -#define WLAN_GPIO_PIN56_WAKEUP_ENABLE_GET(x) (((x) & WLAN_GPIO_PIN56_WAKEUP_ENABLE_MASK) >> WLAN_GPIO_PIN56_WAKEUP_ENABLE_LSB) -#define WLAN_GPIO_PIN56_WAKEUP_ENABLE_SET(x) (((x) << WLAN_GPIO_PIN56_WAKEUP_ENABLE_LSB) & WLAN_GPIO_PIN56_WAKEUP_ENABLE_MASK) -#define WLAN_GPIO_PIN56_INT_TYPE_MSB 9 -#define WLAN_GPIO_PIN56_INT_TYPE_LSB 7 -#define WLAN_GPIO_PIN56_INT_TYPE_MASK 0x00000380 -#define WLAN_GPIO_PIN56_INT_TYPE_GET(x) (((x) & WLAN_GPIO_PIN56_INT_TYPE_MASK) >> WLAN_GPIO_PIN56_INT_TYPE_LSB) -#define WLAN_GPIO_PIN56_INT_TYPE_SET(x) (((x) << WLAN_GPIO_PIN56_INT_TYPE_LSB) & WLAN_GPIO_PIN56_INT_TYPE_MASK) -#define WLAN_GPIO_PIN56_PAD_PULL_MSB 6 -#define WLAN_GPIO_PIN56_PAD_PULL_LSB 5 -#define WLAN_GPIO_PIN56_PAD_PULL_MASK 0x00000060 -#define WLAN_GPIO_PIN56_PAD_PULL_GET(x) (((x) & WLAN_GPIO_PIN56_PAD_PULL_MASK) >> WLAN_GPIO_PIN56_PAD_PULL_LSB) -#define WLAN_GPIO_PIN56_PAD_PULL_SET(x) (((x) << WLAN_GPIO_PIN56_PAD_PULL_LSB) & WLAN_GPIO_PIN56_PAD_PULL_MASK) -#define WLAN_GPIO_PIN56_PAD_STRENGTH_MSB 4 -#define WLAN_GPIO_PIN56_PAD_STRENGTH_LSB 3 -#define WLAN_GPIO_PIN56_PAD_STRENGTH_MASK 0x00000018 -#define WLAN_GPIO_PIN56_PAD_STRENGTH_GET(x) (((x) & WLAN_GPIO_PIN56_PAD_STRENGTH_MASK) >> WLAN_GPIO_PIN56_PAD_STRENGTH_LSB) -#define WLAN_GPIO_PIN56_PAD_STRENGTH_SET(x) (((x) << WLAN_GPIO_PIN56_PAD_STRENGTH_LSB) & WLAN_GPIO_PIN56_PAD_STRENGTH_MASK) -#define WLAN_GPIO_PIN56_PAD_DRIVER_MSB 2 -#define WLAN_GPIO_PIN56_PAD_DRIVER_LSB 2 -#define WLAN_GPIO_PIN56_PAD_DRIVER_MASK 0x00000004 -#define WLAN_GPIO_PIN56_PAD_DRIVER_GET(x) (((x) & WLAN_GPIO_PIN56_PAD_DRIVER_MASK) >> WLAN_GPIO_PIN56_PAD_DRIVER_LSB) -#define WLAN_GPIO_PIN56_PAD_DRIVER_SET(x) (((x) << WLAN_GPIO_PIN56_PAD_DRIVER_LSB) & WLAN_GPIO_PIN56_PAD_DRIVER_MASK) -#define WLAN_GPIO_PIN56_SOURCE_MSB 0 -#define WLAN_GPIO_PIN56_SOURCE_LSB 0 -#define WLAN_GPIO_PIN56_SOURCE_MASK 0x00000001 -#define WLAN_GPIO_PIN56_SOURCE_GET(x) (((x) & WLAN_GPIO_PIN56_SOURCE_MASK) >> WLAN_GPIO_PIN56_SOURCE_LSB) -#define WLAN_GPIO_PIN56_SOURCE_SET(x) (((x) << WLAN_GPIO_PIN56_SOURCE_LSB) & WLAN_GPIO_PIN56_SOURCE_MASK) - -#define SDIO_ADDRESS 0x00000134 -#define SDIO_OFFSET 0x00000134 -#define SDIO_PINS_EN_MSB 0 -#define SDIO_PINS_EN_LSB 0 -#define SDIO_PINS_EN_MASK 0x00000001 -#define SDIO_PINS_EN_GET(x) (((x) & SDIO_PINS_EN_MASK) >> SDIO_PINS_EN_LSB) -#define SDIO_PINS_EN_SET(x) (((x) << SDIO_PINS_EN_LSB) & SDIO_PINS_EN_MASK) - -#define WL_SOC_APB_ADDRESS 0x00000138 -#define WL_SOC_APB_OFFSET 0x00000138 -#define WL_SOC_APB_TOGGLE_MSB 0 -#define WL_SOC_APB_TOGGLE_LSB 0 -#define WL_SOC_APB_TOGGLE_MASK 0x00000001 -#define WL_SOC_APB_TOGGLE_GET(x) (((x) & WL_SOC_APB_TOGGLE_MASK) >> WL_SOC_APB_TOGGLE_LSB) -#define WL_SOC_APB_TOGGLE_SET(x) (((x) << WL_SOC_APB_TOGGLE_LSB) & WL_SOC_APB_TOGGLE_MASK) - -#define WLAN_SIGMA_DELTA_ADDRESS 0x0000013c -#define WLAN_SIGMA_DELTA_OFFSET 0x0000013c -#define WLAN_SIGMA_DELTA_ENABLE_MSB 16 -#define WLAN_SIGMA_DELTA_ENABLE_LSB 16 -#define WLAN_SIGMA_DELTA_ENABLE_MASK 0x00010000 -#define WLAN_SIGMA_DELTA_ENABLE_GET(x) (((x) & WLAN_SIGMA_DELTA_ENABLE_MASK) >> WLAN_SIGMA_DELTA_ENABLE_LSB) -#define WLAN_SIGMA_DELTA_ENABLE_SET(x) (((x) << WLAN_SIGMA_DELTA_ENABLE_LSB) & WLAN_SIGMA_DELTA_ENABLE_MASK) -#define WLAN_SIGMA_DELTA_PRESCALAR_MSB 15 -#define WLAN_SIGMA_DELTA_PRESCALAR_LSB 8 -#define WLAN_SIGMA_DELTA_PRESCALAR_MASK 0x0000ff00 -#define WLAN_SIGMA_DELTA_PRESCALAR_GET(x) (((x) & WLAN_SIGMA_DELTA_PRESCALAR_MASK) >> WLAN_SIGMA_DELTA_PRESCALAR_LSB) -#define WLAN_SIGMA_DELTA_PRESCALAR_SET(x) (((x) << WLAN_SIGMA_DELTA_PRESCALAR_LSB) & WLAN_SIGMA_DELTA_PRESCALAR_MASK) -#define WLAN_SIGMA_DELTA_TARGET_MSB 7 -#define WLAN_SIGMA_DELTA_TARGET_LSB 0 -#define WLAN_SIGMA_DELTA_TARGET_MASK 0x000000ff -#define WLAN_SIGMA_DELTA_TARGET_GET(x) (((x) & WLAN_SIGMA_DELTA_TARGET_MASK) >> WLAN_SIGMA_DELTA_TARGET_LSB) -#define WLAN_SIGMA_DELTA_TARGET_SET(x) (((x) << WLAN_SIGMA_DELTA_TARGET_LSB) & WLAN_SIGMA_DELTA_TARGET_MASK) - -#define WL_BOOTSTRAP_ADDRESS 0x00000140 -#define WL_BOOTSTRAP_OFFSET 0x00000140 -#define WL_BOOTSTRAP_CPU_MBIST_EN_MSB 12 -#define WL_BOOTSTRAP_CPU_MBIST_EN_LSB 12 -#define WL_BOOTSTRAP_CPU_MBIST_EN_MASK 0x00001000 -#define WL_BOOTSTRAP_CPU_MBIST_EN_GET(x) (((x) & WL_BOOTSTRAP_CPU_MBIST_EN_MASK) >> WL_BOOTSTRAP_CPU_MBIST_EN_LSB) -#define WL_BOOTSTRAP_CPU_MBIST_EN_SET(x) (((x) << WL_BOOTSTRAP_CPU_MBIST_EN_LSB) & WL_BOOTSTRAP_CPU_MBIST_EN_MASK) -#define WL_BOOTSTRAP_STATUS_MSB 11 -#define WL_BOOTSTRAP_STATUS_LSB 0 -#define WL_BOOTSTRAP_STATUS_MASK 0x00000fff -#define WL_BOOTSTRAP_STATUS_GET(x) (((x) & WL_BOOTSTRAP_STATUS_MASK) >> WL_BOOTSTRAP_STATUS_LSB) -#define WL_BOOTSTRAP_STATUS_SET(x) (((x) << WL_BOOTSTRAP_STATUS_LSB) & WL_BOOTSTRAP_STATUS_MASK) - -#define CORE_BOOTSTRAP_LOW_ADDRESS 0x00000144 -#define CORE_BOOTSTRAP_LOW_OFFSET 0x00000144 -#define CORE_BOOTSTRAP_LOW_STATUS_MSB 31 -#define CORE_BOOTSTRAP_LOW_STATUS_LSB 0 -#define CORE_BOOTSTRAP_LOW_STATUS_MASK 0xffffffff -#define CORE_BOOTSTRAP_LOW_STATUS_GET(x) (((x) & CORE_BOOTSTRAP_LOW_STATUS_MASK) >> CORE_BOOTSTRAP_LOW_STATUS_LSB) -#define CORE_BOOTSTRAP_LOW_STATUS_SET(x) (((x) << CORE_BOOTSTRAP_LOW_STATUS_LSB) & CORE_BOOTSTRAP_LOW_STATUS_MASK) - -#define CORE_BOOTSTRAP_HIGH_ADDRESS 0x00000148 -#define CORE_BOOTSTRAP_HIGH_OFFSET 0x00000148 -#define CORE_BOOTSTRAP_HIGH_STATUS_MSB 12 -#define CORE_BOOTSTRAP_HIGH_STATUS_LSB 0 -#define CORE_BOOTSTRAP_HIGH_STATUS_MASK 0x00001fff -#define CORE_BOOTSTRAP_HIGH_STATUS_GET(x) (((x) & CORE_BOOTSTRAP_HIGH_STATUS_MASK) >> CORE_BOOTSTRAP_HIGH_STATUS_LSB) -#define CORE_BOOTSTRAP_HIGH_STATUS_SET(x) (((x) << CORE_BOOTSTRAP_HIGH_STATUS_LSB) & CORE_BOOTSTRAP_HIGH_STATUS_MASK) - -#define WLAN_DEBUG_CONTROL_ADDRESS 0x0000014c -#define WLAN_DEBUG_CONTROL_OFFSET 0x0000014c -#define WLAN_DEBUG_CONTROL_ENABLE_MSB 0 -#define WLAN_DEBUG_CONTROL_ENABLE_LSB 0 -#define WLAN_DEBUG_CONTROL_ENABLE_MASK 0x00000001 -#define WLAN_DEBUG_CONTROL_ENABLE_GET(x) (((x) & WLAN_DEBUG_CONTROL_ENABLE_MASK) >> WLAN_DEBUG_CONTROL_ENABLE_LSB) -#define WLAN_DEBUG_CONTROL_ENABLE_SET(x) (((x) << WLAN_DEBUG_CONTROL_ENABLE_LSB) & WLAN_DEBUG_CONTROL_ENABLE_MASK) - -#define WLAN_DEBUG_INPUT_SEL_ADDRESS 0x00000150 -#define WLAN_DEBUG_INPUT_SEL_OFFSET 0x00000150 -#define WLAN_DEBUG_INPUT_SEL_SHIFT_MSB 5 -#define WLAN_DEBUG_INPUT_SEL_SHIFT_LSB 4 -#define WLAN_DEBUG_INPUT_SEL_SHIFT_MASK 0x00000030 -#define WLAN_DEBUG_INPUT_SEL_SHIFT_GET(x) (((x) & WLAN_DEBUG_INPUT_SEL_SHIFT_MASK) >> WLAN_DEBUG_INPUT_SEL_SHIFT_LSB) -#define WLAN_DEBUG_INPUT_SEL_SHIFT_SET(x) (((x) << WLAN_DEBUG_INPUT_SEL_SHIFT_LSB) & WLAN_DEBUG_INPUT_SEL_SHIFT_MASK) -#define WLAN_DEBUG_INPUT_SEL_SRC_MSB 3 -#define WLAN_DEBUG_INPUT_SEL_SRC_LSB 0 -#define WLAN_DEBUG_INPUT_SEL_SRC_MASK 0x0000000f -#define WLAN_DEBUG_INPUT_SEL_SRC_GET(x) (((x) & WLAN_DEBUG_INPUT_SEL_SRC_MASK) >> WLAN_DEBUG_INPUT_SEL_SRC_LSB) -#define WLAN_DEBUG_INPUT_SEL_SRC_SET(x) (((x) << WLAN_DEBUG_INPUT_SEL_SRC_LSB) & WLAN_DEBUG_INPUT_SEL_SRC_MASK) - -#define WLAN_DEBUG_OUT_ADDRESS 0x00000154 -#define WLAN_DEBUG_OUT_OFFSET 0x00000154 -#define WLAN_DEBUG_OUT_DATA_MSB 17 -#define WLAN_DEBUG_OUT_DATA_LSB 0 -#define WLAN_DEBUG_OUT_DATA_MASK 0x0003ffff -#define WLAN_DEBUG_OUT_DATA_GET(x) (((x) & WLAN_DEBUG_OUT_DATA_MASK) >> WLAN_DEBUG_OUT_DATA_LSB) -#define WLAN_DEBUG_OUT_DATA_SET(x) (((x) << WLAN_DEBUG_OUT_DATA_LSB) & WLAN_DEBUG_OUT_DATA_MASK) - -#define WLAN_RESET_TUPLE_STATUS_ADDRESS 0x00000158 -#define WLAN_RESET_TUPLE_STATUS_OFFSET 0x00000158 -#define WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MSB 11 -#define WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB 8 -#define WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK 0x00000f00 -#define WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_GET(x) (((x) & WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK) >> WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB) -#define WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_SET(x) (((x) << WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB) & WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK) -#define WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MSB 7 -#define WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB 0 -#define WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK 0x000000ff -#define WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_GET(x) (((x) & WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK) >> WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB) -#define WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_SET(x) (((x) << WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB) & WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK) - -#define ANTENNA_CONTROL_ADDRESS 0x0000015c -#define ANTENNA_CONTROL_OFFSET 0x0000015c -#define ANTENNA_CONTROL_RX_CLEAR_MSB 16 -#define ANTENNA_CONTROL_RX_CLEAR_LSB 16 -#define ANTENNA_CONTROL_RX_CLEAR_MASK 0x00010000 -#define ANTENNA_CONTROL_RX_CLEAR_GET(x) (((x) & ANTENNA_CONTROL_RX_CLEAR_MASK) >> ANTENNA_CONTROL_RX_CLEAR_LSB) -#define ANTENNA_CONTROL_RX_CLEAR_SET(x) (((x) << ANTENNA_CONTROL_RX_CLEAR_LSB) & ANTENNA_CONTROL_RX_CLEAR_MASK) -#define ANTENNA_CONTROL_SPI_CS_MSB 15 -#define ANTENNA_CONTROL_SPI_CS_LSB 15 -#define ANTENNA_CONTROL_SPI_CS_MASK 0x00008000 -#define ANTENNA_CONTROL_SPI_CS_GET(x) (((x) & ANTENNA_CONTROL_SPI_CS_MASK) >> ANTENNA_CONTROL_SPI_CS_LSB) -#define ANTENNA_CONTROL_SPI_CS_SET(x) (((x) << ANTENNA_CONTROL_SPI_CS_LSB) & ANTENNA_CONTROL_SPI_CS_MASK) -#define ANTENNA_CONTROL_SPI_MODE_MSB 14 -#define ANTENNA_CONTROL_SPI_MODE_LSB 14 -#define ANTENNA_CONTROL_SPI_MODE_MASK 0x00004000 -#define ANTENNA_CONTROL_SPI_MODE_GET(x) (((x) & ANTENNA_CONTROL_SPI_MODE_MASK) >> ANTENNA_CONTROL_SPI_MODE_LSB) -#define ANTENNA_CONTROL_SPI_MODE_SET(x) (((x) << ANTENNA_CONTROL_SPI_MODE_LSB) & ANTENNA_CONTROL_SPI_MODE_MASK) -#define ANTENNA_CONTROL_LED_SEL_MSB 13 -#define ANTENNA_CONTROL_LED_SEL_LSB 12 -#define ANTENNA_CONTROL_LED_SEL_MASK 0x00003000 -#define ANTENNA_CONTROL_LED_SEL_GET(x) (((x) & ANTENNA_CONTROL_LED_SEL_MASK) >> ANTENNA_CONTROL_LED_SEL_LSB) -#define ANTENNA_CONTROL_LED_SEL_SET(x) (((x) << ANTENNA_CONTROL_LED_SEL_LSB) & ANTENNA_CONTROL_LED_SEL_MASK) -#define ANTENNA_CONTROL_OVERRIDE_MSB 11 -#define ANTENNA_CONTROL_OVERRIDE_LSB 8 -#define ANTENNA_CONTROL_OVERRIDE_MASK 0x00000f00 -#define ANTENNA_CONTROL_OVERRIDE_GET(x) (((x) & ANTENNA_CONTROL_OVERRIDE_MASK) >> ANTENNA_CONTROL_OVERRIDE_LSB) -#define ANTENNA_CONTROL_OVERRIDE_SET(x) (((x) << ANTENNA_CONTROL_OVERRIDE_LSB) & ANTENNA_CONTROL_OVERRIDE_MASK) -#define ANTENNA_CONTROL_VALUE_MSB 7 -#define ANTENNA_CONTROL_VALUE_LSB 4 -#define ANTENNA_CONTROL_VALUE_MASK 0x000000f0 -#define ANTENNA_CONTROL_VALUE_GET(x) (((x) & ANTENNA_CONTROL_VALUE_MASK) >> ANTENNA_CONTROL_VALUE_LSB) -#define ANTENNA_CONTROL_VALUE_SET(x) (((x) << ANTENNA_CONTROL_VALUE_LSB) & ANTENNA_CONTROL_VALUE_MASK) -#define ANTENNA_CONTROL_ENABLE_MSB 3 -#define ANTENNA_CONTROL_ENABLE_LSB 0 -#define ANTENNA_CONTROL_ENABLE_MASK 0x0000000f -#define ANTENNA_CONTROL_ENABLE_GET(x) (((x) & ANTENNA_CONTROL_ENABLE_MASK) >> ANTENNA_CONTROL_ENABLE_LSB) -#define ANTENNA_CONTROL_ENABLE_SET(x) (((x) << ANTENNA_CONTROL_ENABLE_LSB) & ANTENNA_CONTROL_ENABLE_MASK) - -#define SDIO2_ADDRESS 0x00000160 -#define SDIO2_OFFSET 0x00000160 -#define SDIO2_PINS_EN_MSB 0 -#define SDIO2_PINS_EN_LSB 0 -#define SDIO2_PINS_EN_MASK 0x00000001 -#define SDIO2_PINS_EN_GET(x) (((x) & SDIO2_PINS_EN_MASK) >> SDIO2_PINS_EN_LSB) -#define SDIO2_PINS_EN_SET(x) (((x) << SDIO2_PINS_EN_LSB) & SDIO2_PINS_EN_MASK) - -#define SDHC_ADDRESS 0x00000164 -#define SDHC_OFFSET 0x00000164 -#define SDHC_PINS_EN_MSB 0 -#define SDHC_PINS_EN_LSB 0 -#define SDHC_PINS_EN_MASK 0x00000001 -#define SDHC_PINS_EN_GET(x) (((x) & SDHC_PINS_EN_MASK) >> SDHC_PINS_EN_LSB) -#define SDHC_PINS_EN_SET(x) (((x) << SDHC_PINS_EN_LSB) & SDHC_PINS_EN_MASK) - -#define AMBA_DEBUG_BUS_ADDRESS 0x00000168 -#define AMBA_DEBUG_BUS_OFFSET 0x00000168 -#define AMBA_DEBUG_BUS_SEL_MSB 4 -#define AMBA_DEBUG_BUS_SEL_LSB 0 -#define AMBA_DEBUG_BUS_SEL_MASK 0x0000001f -#define AMBA_DEBUG_BUS_SEL_GET(x) (((x) & AMBA_DEBUG_BUS_SEL_MASK) >> AMBA_DEBUG_BUS_SEL_LSB) -#define AMBA_DEBUG_BUS_SEL_SET(x) (((x) << AMBA_DEBUG_BUS_SEL_LSB) & AMBA_DEBUG_BUS_SEL_MASK) - -#define CPU_MBIST_ADDRESS 0x0000016c -#define CPU_MBIST_OFFSET 0x0000016c -#define CPU_MBIST_BLOCK_FAIL_MSB 10 -#define CPU_MBIST_BLOCK_FAIL_LSB 2 -#define CPU_MBIST_BLOCK_FAIL_MASK 0x000007fc -#define CPU_MBIST_BLOCK_FAIL_GET(x) (((x) & CPU_MBIST_BLOCK_FAIL_MASK) >> CPU_MBIST_BLOCK_FAIL_LSB) -#define CPU_MBIST_BLOCK_FAIL_SET(x) (((x) << CPU_MBIST_BLOCK_FAIL_LSB) & CPU_MBIST_BLOCK_FAIL_MASK) -#define CPU_MBIST_GLOBAL_FAIL_MSB 1 -#define CPU_MBIST_GLOBAL_FAIL_LSB 1 -#define CPU_MBIST_GLOBAL_FAIL_MASK 0x00000002 -#define CPU_MBIST_GLOBAL_FAIL_GET(x) (((x) & CPU_MBIST_GLOBAL_FAIL_MASK) >> CPU_MBIST_GLOBAL_FAIL_LSB) -#define CPU_MBIST_GLOBAL_FAIL_SET(x) (((x) << CPU_MBIST_GLOBAL_FAIL_LSB) & CPU_MBIST_GLOBAL_FAIL_MASK) -#define CPU_MBIST_DONE_MSB 0 -#define CPU_MBIST_DONE_LSB 0 -#define CPU_MBIST_DONE_MASK 0x00000001 -#define CPU_MBIST_DONE_GET(x) (((x) & CPU_MBIST_DONE_MASK) >> CPU_MBIST_DONE_LSB) -#define CPU_MBIST_DONE_SET(x) (((x) << CPU_MBIST_DONE_LSB) & CPU_MBIST_DONE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct gpio_athr_wlan_reg_reg_s { - volatile unsigned int wlan_gpio_out_low; - volatile unsigned int wlan_gpio_out_w1ts_low; - volatile unsigned int wlan_gpio_out_w1tc_low; - volatile unsigned int wlan_gpio_out_high; - volatile unsigned int wlan_gpio_out_w1ts_high; - volatile unsigned int wlan_gpio_out_w1tc_high; - volatile unsigned int wlan_gpio_enable_low; - volatile unsigned int wlan_gpio_enable_w1ts_low; - volatile unsigned int wlan_gpio_enable_w1tc_low; - volatile unsigned int wlan_gpio_enable_high; - volatile unsigned int wlan_gpio_enable_w1ts_high; - volatile unsigned int wlan_gpio_enable_w1tc_high; - volatile unsigned int wlan_gpio_in_low; - volatile unsigned int wlan_gpio_status_low; - volatile unsigned int wlan_gpio_in_high; - volatile unsigned int wlan_gpio_status_high; - volatile unsigned int wlan_gpio_status_w1ts_low; - volatile unsigned int wlan_gpio_status_w1tc_low; - volatile unsigned int wlan_gpio_status_w1ts_high; - volatile unsigned int wlan_gpio_status_w1tc_high; - volatile unsigned int wlan_gpio_pin0; - volatile unsigned int wlan_gpio_pin1; - volatile unsigned int wlan_gpio_pin2; - volatile unsigned int wlan_gpio_pin3; - volatile unsigned int wlan_gpio_pin4; - volatile unsigned int wlan_gpio_pin5; - volatile unsigned int wlan_gpio_pin6; - volatile unsigned int wlan_gpio_pin7; - volatile unsigned int wlan_gpio_pin8; - volatile unsigned int wlan_gpio_pin9; - volatile unsigned int wlan_gpio_pin10; - volatile unsigned int wlan_gpio_pin11; - volatile unsigned int wlan_gpio_pin12; - volatile unsigned int wlan_gpio_pin13; - volatile unsigned int wlan_gpio_pin14; - volatile unsigned int wlan_gpio_pin15; - volatile unsigned int wlan_gpio_pin16; - volatile unsigned int wlan_gpio_pin17; - volatile unsigned int wlan_gpio_pin18; - volatile unsigned int wlan_gpio_pin19; - volatile unsigned int wlan_gpio_pin20; - volatile unsigned int wlan_gpio_pin21; - volatile unsigned int wlan_gpio_pin22; - volatile unsigned int wlan_gpio_pin23; - volatile unsigned int wlan_gpio_pin24; - volatile unsigned int wlan_gpio_pin25; - volatile unsigned int wlan_gpio_pin26; - volatile unsigned int wlan_gpio_pin27; - volatile unsigned int wlan_gpio_pin28; - volatile unsigned int wlan_gpio_pin29; - volatile unsigned int wlan_gpio_pin30; - volatile unsigned int wlan_gpio_pin31; - volatile unsigned int wlan_gpio_pin32; - volatile unsigned int wlan_gpio_pin33; - volatile unsigned int wlan_gpio_pin34; - volatile unsigned int wlan_gpio_pin35; - volatile unsigned int wlan_gpio_pin36; - volatile unsigned int wlan_gpio_pin37; - volatile unsigned int wlan_gpio_pin38; - volatile unsigned int wlan_gpio_pin39; - volatile unsigned int wlan_gpio_pin40; - volatile unsigned int wlan_gpio_pin41; - volatile unsigned int wlan_gpio_pin42; - volatile unsigned int wlan_gpio_pin43; - volatile unsigned int wlan_gpio_pin44; - volatile unsigned int wlan_gpio_pin45; - volatile unsigned int wlan_gpio_pin46; - volatile unsigned int wlan_gpio_pin47; - volatile unsigned int wlan_gpio_pin48; - volatile unsigned int wlan_gpio_pin49; - volatile unsigned int wlan_gpio_pin50; - volatile unsigned int wlan_gpio_pin51; - volatile unsigned int wlan_gpio_pin52; - volatile unsigned int wlan_gpio_pin53; - volatile unsigned int wlan_gpio_pin54; - volatile unsigned int wlan_gpio_pin55; - volatile unsigned int wlan_gpio_pin56; - volatile unsigned int sdio; - volatile unsigned int wl_soc_apb; - volatile unsigned int wlan_sigma_delta; - volatile unsigned int wl_bootstrap; - volatile unsigned int core_bootstrap_low; - volatile unsigned int core_bootstrap_high; - volatile unsigned int wlan_debug_control; - volatile unsigned int wlan_debug_input_sel; - volatile unsigned int wlan_debug_out; - volatile unsigned int wlan_reset_tuple_status; - volatile unsigned int antenna_control; - volatile unsigned int sdio2; - volatile unsigned int sdhc; - volatile unsigned int amba_debug_bus; - volatile unsigned int cpu_mbist; -} gpio_athr_wlan_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _GPIO_ATHR_WLAN_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/gpio_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/gpio_reg.h deleted file mode 100644 index 5a82a65ab19d..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/gpio_reg.h +++ /dev/null @@ -1,2411 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "gpio_athr_wlan_reg.h" - - -#ifndef BT_HEADERS - -#define GPIO_OUT_ADDRESS WLAN_GPIO_OUT_LOW_ADDRESS -#define WLAN_GPIO_OUT_ADDRESS WLAN_GPIO_OUT_LOW_ADDRESS -#define GPIO_OUT_OFFSET WLAN_GPIO_OUT_LOW_OFFSET -#define WLAN_GPIO_OUT_OFFSET WLAN_GPIO_OUT_LOW_OFFSET -#define GPIO_OUT_DATA_MSB WLAN_GPIO_OUT_LOW_DATA_MSB -#define WLAN_GPIO_OUT_DATA_MSB WLAN_GPIO_OUT_LOW_DATA_MSB -#define GPIO_OUT_DATA_LSB WLAN_GPIO_OUT_LOW_DATA_LSB -#define WLAN_GPIO_OUT_DATA_LSB WLAN_GPIO_OUT_LOW_DATA_LSB -#define GPIO_OUT_DATA_MASK WLAN_GPIO_OUT_LOW_DATA_MASK -#define WLAN_GPIO_OUT_DATA_MASK WLAN_GPIO_OUT_LOW_DATA_MASK -#define GPIO_OUT_DATA_GET(x) WLAN_GPIO_OUT_LOW_DATA_GET(x) -#define WLAN_GPIO_OUT_DATA_GET(x) WLAN_GPIO_OUT_LOW_DATA_GET(x) -#define GPIO_OUT_DATA_SET(x) WLAN_GPIO_OUT_LOW_DATA_SET(x) -#define WLAN_GPIO_OUT_DATA_SET(x) WLAN_GPIO_OUT_LOW_DATA_SET(x) -#define GPIO_OUT_W1TS_ADDRESS WLAN_GPIO_OUT_W1TS_LOW_ADDRESS -#define WLAN_GPIO_OUT_W1TS_ADDRESS WLAN_GPIO_OUT_W1TS_LOW_ADDRESS -#define GPIO_OUT_W1TS_OFFSET WLAN_GPIO_OUT_W1TS_LOW_OFFSET -#define WLAN_GPIO_OUT_W1TS_OFFSET WLAN_GPIO_OUT_W1TS_LOW_OFFSET -#define GPIO_OUT_W1TS_DATA_MSB WLAN_GPIO_OUT_W1TS_LOW_DATA_MSB -#define WLAN_GPIO_OUT_W1TS_DATA_MSB WLAN_GPIO_OUT_W1TS_LOW_DATA_MSB -#define GPIO_OUT_W1TS_DATA_LSB WLAN_GPIO_OUT_W1TS_LOW_DATA_LSB -#define WLAN_GPIO_OUT_W1TS_DATA_LSB WLAN_GPIO_OUT_W1TS_LOW_DATA_LSB -#define GPIO_OUT_W1TS_DATA_MASK WLAN_GPIO_OUT_W1TS_LOW_DATA_MASK -#define WLAN_GPIO_OUT_W1TS_DATA_MASK WLAN_GPIO_OUT_W1TS_LOW_DATA_MASK -#define GPIO_OUT_W1TS_DATA_GET(x) WLAN_GPIO_OUT_W1TS_LOW_DATA_GET(x) -#define WLAN_GPIO_OUT_W1TS_DATA_GET(x) WLAN_GPIO_OUT_W1TS_LOW_DATA_GET(x) -#define GPIO_OUT_W1TS_DATA_SET(x) WLAN_GPIO_OUT_W1TS_LOW_DATA_SET(x) -#define WLAN_GPIO_OUT_W1TS_DATA_SET(x) WLAN_GPIO_OUT_W1TS_LOW_DATA_SET(x) -#define GPIO_OUT_W1TC_ADDRESS WLAN_GPIO_OUT_W1TC_LOW_ADDRESS -#define WLAN_GPIO_OUT_W1TC_ADDRESS WLAN_GPIO_OUT_W1TC_LOW_ADDRESS -#define GPIO_OUT_W1TC_OFFSET WLAN_GPIO_OUT_W1TC_LOW_OFFSET -#define WLAN_GPIO_OUT_W1TC_OFFSET WLAN_GPIO_OUT_W1TC_LOW_OFFSET -#define GPIO_OUT_W1TC_DATA_MSB WLAN_GPIO_OUT_W1TC_LOW_DATA_MSB -#define WLAN_GPIO_OUT_W1TC_DATA_MSB WLAN_GPIO_OUT_W1TC_LOW_DATA_MSB -#define GPIO_OUT_W1TC_DATA_LSB WLAN_GPIO_OUT_W1TC_LOW_DATA_LSB -#define WLAN_GPIO_OUT_W1TC_DATA_LSB WLAN_GPIO_OUT_W1TC_LOW_DATA_LSB -#define GPIO_OUT_W1TC_DATA_MASK WLAN_GPIO_OUT_W1TC_LOW_DATA_MASK -#define WLAN_GPIO_OUT_W1TC_DATA_MASK WLAN_GPIO_OUT_W1TC_LOW_DATA_MASK -#define GPIO_OUT_W1TC_DATA_GET(x) WLAN_GPIO_OUT_W1TC_LOW_DATA_GET(x) -#define WLAN_GPIO_OUT_W1TC_DATA_GET(x) WLAN_GPIO_OUT_W1TC_LOW_DATA_GET(x) -#define GPIO_OUT_W1TC_DATA_SET(x) WLAN_GPIO_OUT_W1TC_LOW_DATA_SET(x) -#define WLAN_GPIO_OUT_W1TC_DATA_SET(x) WLAN_GPIO_OUT_W1TC_LOW_DATA_SET(x) -#define GPIO_OUT_HIGH_ADDRESS WLAN_GPIO_OUT_HIGH_ADDRESS -#define GPIO_OUT_HIGH_OFFSET WLAN_GPIO_OUT_HIGH_OFFSET -#define GPIO_OUT_HIGH_DATA_MSB WLAN_GPIO_OUT_HIGH_DATA_MSB -#define GPIO_OUT_HIGH_DATA_LSB WLAN_GPIO_OUT_HIGH_DATA_LSB -#define GPIO_OUT_HIGH_DATA_MASK WLAN_GPIO_OUT_HIGH_DATA_MASK -#define GPIO_OUT_HIGH_DATA_GET(x) WLAN_GPIO_OUT_HIGH_DATA_GET(x) -#define GPIO_OUT_HIGH_DATA_SET(x) WLAN_GPIO_OUT_HIGH_DATA_SET(x) -#define GPIO_OUT_W1TS_HIGH_ADDRESS WLAN_GPIO_OUT_W1TS_HIGH_ADDRESS -#define GPIO_OUT_W1TS_HIGH_OFFSET WLAN_GPIO_OUT_W1TS_HIGH_OFFSET -#define GPIO_OUT_W1TS_HIGH_DATA_MSB WLAN_GPIO_OUT_W1TS_HIGH_DATA_MSB -#define GPIO_OUT_W1TS_HIGH_DATA_LSB WLAN_GPIO_OUT_W1TS_HIGH_DATA_LSB -#define GPIO_OUT_W1TS_HIGH_DATA_MASK WLAN_GPIO_OUT_W1TS_HIGH_DATA_MASK -#define GPIO_OUT_W1TS_HIGH_DATA_GET(x) WLAN_GPIO_OUT_W1TS_HIGH_DATA_GET(x) -#define GPIO_OUT_W1TS_HIGH_DATA_SET(x) WLAN_GPIO_OUT_W1TS_HIGH_DATA_SET(x) -#define GPIO_OUT_W1TC_HIGH_ADDRESS WLAN_GPIO_OUT_W1TC_HIGH_ADDRESS -#define GPIO_OUT_W1TC_HIGH_OFFSET WLAN_GPIO_OUT_W1TC_HIGH_OFFSET -#define GPIO_OUT_W1TC_HIGH_DATA_MSB WLAN_GPIO_OUT_W1TC_HIGH_DATA_MSB -#define GPIO_OUT_W1TC_HIGH_DATA_LSB WLAN_GPIO_OUT_W1TC_HIGH_DATA_LSB -#define GPIO_OUT_W1TC_HIGH_DATA_MASK WLAN_GPIO_OUT_W1TC_HIGH_DATA_MASK -#define GPIO_OUT_W1TC_HIGH_DATA_GET(x) WLAN_GPIO_OUT_W1TC_HIGH_DATA_GET(x) -#define GPIO_OUT_W1TC_HIGH_DATA_SET(x) WLAN_GPIO_OUT_W1TC_HIGH_DATA_SET(x) -#define GPIO_ENABLE_ADDRESS WLAN_GPIO_ENABLE_LOW_ADDRESS -#define WLAN_GPIO_ENABLE_ADDRESS WLAN_GPIO_ENABLE_LOW_ADDRESS -#define GPIO_ENABLE_OFFSET WLAN_GPIO_ENABLE_LOW_OFFSET -#define WLAN_GPIO_ENABLE_OFFSET WLAN_GPIO_ENABLE_LOW_OFFSET -#define GPIO_ENABLE_DATA_MSB WLAN_GPIO_ENABLE_LOW_DATA_MSB -#define WLAN_GPIO_ENABLE_DATA_MSB WLAN_GPIO_ENABLE_LOW_DATA_MSB -#define GPIO_ENABLE_DATA_LSB WLAN_GPIO_ENABLE_LOW_DATA_LSB -#define WLAN_GPIO_ENABLE_DATA_LSB WLAN_GPIO_ENABLE_LOW_DATA_LSB -#define GPIO_ENABLE_DATA_MASK WLAN_GPIO_ENABLE_LOW_DATA_MASK -#define WLAN_GPIO_ENABLE_DATA_MASK WLAN_GPIO_ENABLE_LOW_DATA_MASK -#define GPIO_ENABLE_DATA_GET(x) WLAN_GPIO_ENABLE_LOW_DATA_GET(x) -#define WLAN_GPIO_ENABLE_DATA_GET(x) WLAN_GPIO_ENABLE_LOW_DATA_GET(x) -#define GPIO_ENABLE_DATA_SET(x) WLAN_GPIO_ENABLE_LOW_DATA_SET(x) -#define WLAN_GPIO_ENABLE_DATA_SET(x) WLAN_GPIO_ENABLE_LOW_DATA_SET(x) -#define GPIO_ENABLE_W1TS_ADDRESS WLAN_GPIO_ENABLE_W1TS_LOW_ADDRESS -#define WLAN_GPIO_ENABLE_W1TS_ADDRESS WLAN_GPIO_ENABLE_W1TS_LOW_ADDRESS -#define GPIO_ENABLE_W1TS_OFFSET WLAN_GPIO_ENABLE_W1TS_LOW_OFFSET -#define WLAN_GPIO_ENABLE_W1TS_OFFSET WLAN_GPIO_ENABLE_W1TS_LOW_OFFSET -#define GPIO_ENABLE_W1TS_DATA_MSB WLAN_GPIO_ENABLE_W1TS_LOW_DATA_MSB -#define WLAN_GPIO_ENABLE_W1TS_DATA_MSB WLAN_GPIO_ENABLE_W1TS_LOW_DATA_MSB -#define GPIO_ENABLE_W1TS_DATA_LSB WLAN_GPIO_ENABLE_W1TS_LOW_DATA_LSB -#define WLAN_GPIO_ENABLE_W1TS_DATA_LSB WLAN_GPIO_ENABLE_W1TS_LOW_DATA_LSB -#define GPIO_ENABLE_W1TS_DATA_MASK WLAN_GPIO_ENABLE_W1TS_LOW_DATA_MASK -#define WLAN_GPIO_ENABLE_W1TS_DATA_MASK WLAN_GPIO_ENABLE_W1TS_LOW_DATA_MASK -#define GPIO_ENABLE_W1TS_DATA_GET(x) WLAN_GPIO_ENABLE_W1TS_LOW_DATA_GET(x) -#define WLAN_GPIO_ENABLE_W1TS_DATA_GET(x) WLAN_GPIO_ENABLE_W1TS_LOW_DATA_GET(x) -#define GPIO_ENABLE_W1TS_DATA_SET(x) WLAN_GPIO_ENABLE_W1TS_LOW_DATA_SET(x) -#define WLAN_GPIO_ENABLE_W1TS_DATA_SET(x) WLAN_GPIO_ENABLE_W1TS_LOW_DATA_SET(x) -#define GPIO_ENABLE_W1TC_ADDRESS WLAN_GPIO_ENABLE_W1TC_LOW_ADDRESS -#define WLAN_GPIO_ENABLE_W1TC_ADDRESS WLAN_GPIO_ENABLE_W1TC_LOW_ADDRESS -#define GPIO_ENABLE_W1TC_OFFSET WLAN_GPIO_ENABLE_W1TC_LOW_OFFSET -#define WLAN_GPIO_ENABLE_W1TC_OFFSET WLAN_GPIO_ENABLE_W1TC_LOW_OFFSET -#define GPIO_ENABLE_W1TC_DATA_MSB WLAN_GPIO_ENABLE_W1TC_LOW_DATA_MSB -#define WLAN_GPIO_ENABLE_W1TC_DATA_MSB WLAN_GPIO_ENABLE_W1TC_LOW_DATA_MSB -#define GPIO_ENABLE_W1TC_DATA_LSB WLAN_GPIO_ENABLE_W1TC_LOW_DATA_LSB -#define WLAN_GPIO_ENABLE_W1TC_DATA_LSB WLAN_GPIO_ENABLE_W1TC_LOW_DATA_LSB -#define GPIO_ENABLE_W1TC_DATA_MASK WLAN_GPIO_ENABLE_W1TC_LOW_DATA_MASK -#define WLAN_GPIO_ENABLE_W1TC_DATA_MASK WLAN_GPIO_ENABLE_W1TC_LOW_DATA_MASK -#define GPIO_ENABLE_W1TC_DATA_GET(x) WLAN_GPIO_ENABLE_W1TC_LOW_DATA_GET(x) -#define WLAN_GPIO_ENABLE_W1TC_DATA_GET(x) WLAN_GPIO_ENABLE_W1TC_LOW_DATA_GET(x) -#define GPIO_ENABLE_W1TC_DATA_SET(x) WLAN_GPIO_ENABLE_W1TC_LOW_DATA_SET(x) -#define WLAN_GPIO_ENABLE_W1TC_DATA_SET(x) WLAN_GPIO_ENABLE_W1TC_LOW_DATA_SET(x) -#define GPIO_ENABLE_HIGH_ADDRESS WLAN_GPIO_ENABLE_HIGH_ADDRESS -#define GPIO_ENABLE_HIGH_OFFSET WLAN_GPIO_ENABLE_HIGH_OFFSET -#define GPIO_ENABLE_HIGH_DATA_MSB WLAN_GPIO_ENABLE_HIGH_DATA_MSB -#define GPIO_ENABLE_HIGH_DATA_LSB WLAN_GPIO_ENABLE_HIGH_DATA_LSB -#define GPIO_ENABLE_HIGH_DATA_MASK WLAN_GPIO_ENABLE_HIGH_DATA_MASK -#define GPIO_ENABLE_HIGH_DATA_GET(x) WLAN_GPIO_ENABLE_HIGH_DATA_GET(x) -#define GPIO_ENABLE_HIGH_DATA_SET(x) WLAN_GPIO_ENABLE_HIGH_DATA_SET(x) -#define GPIO_ENABLE_W1TS_HIGH_ADDRESS WLAN_GPIO_ENABLE_W1TS_HIGH_ADDRESS -#define GPIO_ENABLE_W1TS_HIGH_OFFSET WLAN_GPIO_ENABLE_W1TS_HIGH_OFFSET -#define GPIO_ENABLE_W1TS_HIGH_DATA_MSB WLAN_GPIO_ENABLE_W1TS_HIGH_DATA_MSB -#define GPIO_ENABLE_W1TS_HIGH_DATA_LSB WLAN_GPIO_ENABLE_W1TS_HIGH_DATA_LSB -#define GPIO_ENABLE_W1TS_HIGH_DATA_MASK WLAN_GPIO_ENABLE_W1TS_HIGH_DATA_MASK -#define GPIO_ENABLE_W1TS_HIGH_DATA_GET(x) WLAN_GPIO_ENABLE_W1TS_HIGH_DATA_GET(x) -#define GPIO_ENABLE_W1TS_HIGH_DATA_SET(x) WLAN_GPIO_ENABLE_W1TS_HIGH_DATA_SET(x) -#define GPIO_ENABLE_W1TC_HIGH_ADDRESS WLAN_GPIO_ENABLE_W1TC_HIGH_ADDRESS -#define GPIO_ENABLE_W1TC_HIGH_OFFSET WLAN_GPIO_ENABLE_W1TC_HIGH_OFFSET -#define GPIO_ENABLE_W1TC_HIGH_DATA_MSB WLAN_GPIO_ENABLE_W1TC_HIGH_DATA_MSB -#define GPIO_ENABLE_W1TC_HIGH_DATA_LSB WLAN_GPIO_ENABLE_W1TC_HIGH_DATA_LSB -#define GPIO_ENABLE_W1TC_HIGH_DATA_MASK WLAN_GPIO_ENABLE_W1TC_HIGH_DATA_MASK -#define GPIO_ENABLE_W1TC_HIGH_DATA_GET(x) WLAN_GPIO_ENABLE_W1TC_HIGH_DATA_GET(x) -#define GPIO_ENABLE_W1TC_HIGH_DATA_SET(x) WLAN_GPIO_ENABLE_W1TC_HIGH_DATA_SET(x) -#define GPIO_IN_ADDRESS WLAN_GPIO_IN_LOW_ADDRESS -#define WLAN_GPIO_IN_ADDRESS WLAN_GPIO_IN_LOW_ADDRESS -#define GPIO_IN_OFFSET WLAN_GPIO_IN_LOW_OFFSET -#define WLAN_GPIO_IN_OFFSET WLAN_GPIO_IN_LOW_OFFSET -#define GPIO_IN_DATA_MSB WLAN_GPIO_IN_LOW_DATA_MSB -#define WLAN_GPIO_IN_DATA_MSB WLAN_GPIO_IN_LOW_DATA_MSB -#define GPIO_IN_DATA_LSB WLAN_GPIO_IN_LOW_DATA_LSB -#define WLAN_GPIO_IN_DATA_LSB WLAN_GPIO_IN_LOW_DATA_LSB -#define GPIO_IN_DATA_MASK WLAN_GPIO_IN_LOW_DATA_MASK -#define WLAN_GPIO_IN_DATA_MASK WLAN_GPIO_IN_LOW_DATA_MASK -#define GPIO_IN_DATA_GET(x) WLAN_GPIO_IN_LOW_DATA_GET(x) -#define WLAN_GPIO_IN_DATA_GET(x) WLAN_GPIO_IN_LOW_DATA_GET(x) -#define GPIO_IN_DATA_SET(x) WLAN_GPIO_IN_LOW_DATA_SET(x) -#define WLAN_GPIO_IN_DATA_SET(x) WLAN_GPIO_IN_LOW_DATA_SET(x) -#define GPIO_STATUS_ADDRESS WLAN_GPIO_STATUS_LOW_ADDRESS -#define WLAN_GPIO_STATUS_ADDRESS WLAN_GPIO_STATUS_LOW_ADDRESS -#define GPIO_STATUS_OFFSET WLAN_GPIO_STATUS_LOW_OFFSET -#define WLAN_GPIO_STATUS_OFFSET WLAN_GPIO_STATUS_LOW_OFFSET -#define GPIO_STATUS_INTERRUPT_MSB WLAN_GPIO_STATUS_LOW_INTERRUPT_MSB -#define WLAN_GPIO_STATUS_INTERRUPT_MSB WLAN_GPIO_STATUS_LOW_INTERRUPT_MSB -#define GPIO_STATUS_INTERRUPT_LSB WLAN_GPIO_STATUS_LOW_INTERRUPT_LSB -#define WLAN_GPIO_STATUS_INTERRUPT_LSB WLAN_GPIO_STATUS_LOW_INTERRUPT_LSB -#define GPIO_STATUS_INTERRUPT_MASK WLAN_GPIO_STATUS_LOW_INTERRUPT_MASK -#define WLAN_GPIO_STATUS_INTERRUPT_MASK WLAN_GPIO_STATUS_LOW_INTERRUPT_MASK -#define GPIO_STATUS_INTERRUPT_GET(x) WLAN_GPIO_STATUS_LOW_INTERRUPT_GET(x) -#define WLAN_GPIO_STATUS_INTERRUPT_GET(x) WLAN_GPIO_STATUS_LOW_INTERRUPT_GET(x) -#define GPIO_STATUS_INTERRUPT_SET(x) WLAN_GPIO_STATUS_LOW_INTERRUPT_SET(x) -#define WLAN_GPIO_STATUS_INTERRUPT_SET(x) WLAN_GPIO_STATUS_LOW_INTERRUPT_SET(x) -#define GPIO_IN_HIGH_ADDRESS WLAN_GPIO_IN_HIGH_ADDRESS -#define GPIO_IN_HIGH_OFFSET WLAN_GPIO_IN_HIGH_OFFSET -#define GPIO_IN_HIGH_DATA_MSB WLAN_GPIO_IN_HIGH_DATA_MSB -#define GPIO_IN_HIGH_DATA_LSB WLAN_GPIO_IN_HIGH_DATA_LSB -#define GPIO_IN_HIGH_DATA_MASK WLAN_GPIO_IN_HIGH_DATA_MASK -#define GPIO_IN_HIGH_DATA_GET(x) WLAN_GPIO_IN_HIGH_DATA_GET(x) -#define GPIO_IN_HIGH_DATA_SET(x) WLAN_GPIO_IN_HIGH_DATA_SET(x) -#define GPIO_STATUS_HIGH_ADDRESS WLAN_GPIO_STATUS_HIGH_ADDRESS -#define GPIO_STATUS_HIGH_OFFSET WLAN_GPIO_STATUS_HIGH_OFFSET -#define GPIO_STATUS_HIGH_INTERRUPT_MSB WLAN_GPIO_STATUS_HIGH_INTERRUPT_MSB -#define GPIO_STATUS_HIGH_INTERRUPT_LSB WLAN_GPIO_STATUS_HIGH_INTERRUPT_LSB -#define GPIO_STATUS_HIGH_INTERRUPT_MASK WLAN_GPIO_STATUS_HIGH_INTERRUPT_MASK -#define GPIO_STATUS_HIGH_INTERRUPT_GET(x) WLAN_GPIO_STATUS_HIGH_INTERRUPT_GET(x) -#define GPIO_STATUS_HIGH_INTERRUPT_SET(x) WLAN_GPIO_STATUS_HIGH_INTERRUPT_SET(x) -#define GPIO_STATUS_W1TS_ADDRESS WLAN_GPIO_STATUS_W1TS_LOW_ADDRESS -#define WLAN_GPIO_STATUS_W1TS_ADDRESS WLAN_GPIO_STATUS_W1TS_LOW_ADDRESS -#define GPIO_STATUS_W1TS_OFFSET WLAN_GPIO_STATUS_W1TS_LOW_OFFSET -#define WLAN_GPIO_STATUS_W1TS_OFFSET WLAN_GPIO_STATUS_W1TS_LOW_OFFSET -#define GPIO_STATUS_W1TS_INTERRUPT_MSB WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_MSB -#define WLAN_GPIO_STATUS_W1TS_INTERRUPT_MSB WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_MSB -#define GPIO_STATUS_W1TS_INTERRUPT_LSB WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_LSB -#define WLAN_GPIO_STATUS_W1TS_INTERRUPT_LSB WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_LSB -#define GPIO_STATUS_W1TS_INTERRUPT_MASK WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_MASK -#define WLAN_GPIO_STATUS_W1TS_INTERRUPT_MASK WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_MASK -#define GPIO_STATUS_W1TS_INTERRUPT_GET(x) WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_GET(x) -#define WLAN_GPIO_STATUS_W1TS_INTERRUPT_GET(x) WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_GET(x) -#define GPIO_STATUS_W1TS_INTERRUPT_SET(x) WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_SET(x) -#define WLAN_GPIO_STATUS_W1TS_INTERRUPT_SET(x) WLAN_GPIO_STATUS_W1TS_LOW_INTERRUPT_SET(x) -#define GPIO_STATUS_W1TC_ADDRESS WLAN_GPIO_STATUS_W1TC_LOW_ADDRESS -#define WLAN_GPIO_STATUS_W1TC_ADDRESS WLAN_GPIO_STATUS_W1TC_LOW_ADDRESS -#define GPIO_STATUS_W1TC_OFFSET WLAN_GPIO_STATUS_W1TC_LOW_OFFSET -#define WLAN_GPIO_STATUS_W1TC_OFFSET WLAN_GPIO_STATUS_W1TC_LOW_OFFSET -#define GPIO_STATUS_W1TC_INTERRUPT_MSB WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_MSB -#define WLAN_GPIO_STATUS_W1TC_INTERRUPT_MSB WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_MSB -#define GPIO_STATUS_W1TC_INTERRUPT_LSB WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_LSB -#define WLAN_GPIO_STATUS_W1TC_INTERRUPT_LSB WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_LSB -#define GPIO_STATUS_W1TC_INTERRUPT_MASK WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_MASK -#define WLAN_GPIO_STATUS_W1TC_INTERRUPT_MASK WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_MASK -#define GPIO_STATUS_W1TC_INTERRUPT_GET(x) WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_GET(x) -#define WLAN_GPIO_STATUS_W1TC_INTERRUPT_GET(x) WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_GET(x) -#define GPIO_STATUS_W1TC_INTERRUPT_SET(x) WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_SET(x) -#define WLAN_GPIO_STATUS_W1TC_INTERRUPT_SET(x) WLAN_GPIO_STATUS_W1TC_LOW_INTERRUPT_SET(x) -#define GPIO_STATUS_W1TS_HIGH_ADDRESS WLAN_GPIO_STATUS_W1TS_HIGH_ADDRESS -#define GPIO_STATUS_W1TS_HIGH_OFFSET WLAN_GPIO_STATUS_W1TS_HIGH_OFFSET -#define GPIO_STATUS_W1TS_HIGH_INTERRUPT_MSB WLAN_GPIO_STATUS_W1TS_HIGH_INTERRUPT_MSB -#define GPIO_STATUS_W1TS_HIGH_INTERRUPT_LSB WLAN_GPIO_STATUS_W1TS_HIGH_INTERRUPT_LSB -#define GPIO_STATUS_W1TS_HIGH_INTERRUPT_MASK WLAN_GPIO_STATUS_W1TS_HIGH_INTERRUPT_MASK -#define GPIO_STATUS_W1TS_HIGH_INTERRUPT_GET(x) WLAN_GPIO_STATUS_W1TS_HIGH_INTERRUPT_GET(x) -#define GPIO_STATUS_W1TS_HIGH_INTERRUPT_SET(x) WLAN_GPIO_STATUS_W1TS_HIGH_INTERRUPT_SET(x) -#define GPIO_STATUS_W1TC_HIGH_ADDRESS WLAN_GPIO_STATUS_W1TC_HIGH_ADDRESS -#define GPIO_STATUS_W1TC_HIGH_OFFSET WLAN_GPIO_STATUS_W1TC_HIGH_OFFSET -#define GPIO_STATUS_W1TC_HIGH_INTERRUPT_MSB WLAN_GPIO_STATUS_W1TC_HIGH_INTERRUPT_MSB -#define GPIO_STATUS_W1TC_HIGH_INTERRUPT_LSB WLAN_GPIO_STATUS_W1TC_HIGH_INTERRUPT_LSB -#define GPIO_STATUS_W1TC_HIGH_INTERRUPT_MASK WLAN_GPIO_STATUS_W1TC_HIGH_INTERRUPT_MASK -#define GPIO_STATUS_W1TC_HIGH_INTERRUPT_GET(x) WLAN_GPIO_STATUS_W1TC_HIGH_INTERRUPT_GET(x) -#define GPIO_STATUS_W1TC_HIGH_INTERRUPT_SET(x) WLAN_GPIO_STATUS_W1TC_HIGH_INTERRUPT_SET(x) -#define GPIO_PIN0_ADDRESS WLAN_GPIO_PIN0_ADDRESS -#define GPIO_PIN0_OFFSET WLAN_GPIO_PIN0_OFFSET -#define GPIO_PIN0_CONFIG_MSB WLAN_GPIO_PIN0_CONFIG_MSB -#define GPIO_PIN0_CONFIG_LSB WLAN_GPIO_PIN0_CONFIG_LSB -#define GPIO_PIN0_CONFIG_MASK WLAN_GPIO_PIN0_CONFIG_MASK -#define GPIO_PIN0_CONFIG_GET(x) WLAN_GPIO_PIN0_CONFIG_GET(x) -#define GPIO_PIN0_CONFIG_SET(x) WLAN_GPIO_PIN0_CONFIG_SET(x) -#define GPIO_PIN0_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN0_WAKEUP_ENABLE_MSB -#define GPIO_PIN0_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN0_WAKEUP_ENABLE_LSB -#define GPIO_PIN0_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN0_WAKEUP_ENABLE_MASK -#define GPIO_PIN0_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN0_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN0_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN0_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN0_INT_TYPE_MSB WLAN_GPIO_PIN0_INT_TYPE_MSB -#define GPIO_PIN0_INT_TYPE_LSB WLAN_GPIO_PIN0_INT_TYPE_LSB -#define GPIO_PIN0_INT_TYPE_MASK WLAN_GPIO_PIN0_INT_TYPE_MASK -#define GPIO_PIN0_INT_TYPE_GET(x) WLAN_GPIO_PIN0_INT_TYPE_GET(x) -#define GPIO_PIN0_INT_TYPE_SET(x) WLAN_GPIO_PIN0_INT_TYPE_SET(x) -#define GPIO_PIN0_PAD_PULL_MSB WLAN_GPIO_PIN0_PAD_PULL_MSB -#define GPIO_PIN0_PAD_PULL_LSB WLAN_GPIO_PIN0_PAD_PULL_LSB -#define GPIO_PIN0_PAD_PULL_MASK WLAN_GPIO_PIN0_PAD_PULL_MASK -#define GPIO_PIN0_PAD_PULL_GET(x) WLAN_GPIO_PIN0_PAD_PULL_GET(x) -#define GPIO_PIN0_PAD_PULL_SET(x) WLAN_GPIO_PIN0_PAD_PULL_SET(x) -#define GPIO_PIN0_PAD_STRENGTH_MSB WLAN_GPIO_PIN0_PAD_STRENGTH_MSB -#define GPIO_PIN0_PAD_STRENGTH_LSB WLAN_GPIO_PIN0_PAD_STRENGTH_LSB -#define GPIO_PIN0_PAD_STRENGTH_MASK WLAN_GPIO_PIN0_PAD_STRENGTH_MASK -#define GPIO_PIN0_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN0_PAD_STRENGTH_GET(x) -#define GPIO_PIN0_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN0_PAD_STRENGTH_SET(x) -#define GPIO_PIN0_PAD_DRIVER_MSB WLAN_GPIO_PIN0_PAD_DRIVER_MSB -#define GPIO_PIN0_PAD_DRIVER_LSB WLAN_GPIO_PIN0_PAD_DRIVER_LSB -#define GPIO_PIN0_PAD_DRIVER_MASK WLAN_GPIO_PIN0_PAD_DRIVER_MASK -#define GPIO_PIN0_PAD_DRIVER_GET(x) WLAN_GPIO_PIN0_PAD_DRIVER_GET(x) -#define GPIO_PIN0_PAD_DRIVER_SET(x) WLAN_GPIO_PIN0_PAD_DRIVER_SET(x) -#define GPIO_PIN0_SOURCE_MSB WLAN_GPIO_PIN0_SOURCE_MSB -#define GPIO_PIN0_SOURCE_LSB WLAN_GPIO_PIN0_SOURCE_LSB -#define GPIO_PIN0_SOURCE_MASK WLAN_GPIO_PIN0_SOURCE_MASK -#define GPIO_PIN0_SOURCE_GET(x) WLAN_GPIO_PIN0_SOURCE_GET(x) -#define GPIO_PIN0_SOURCE_SET(x) WLAN_GPIO_PIN0_SOURCE_SET(x) -#define GPIO_PIN1_ADDRESS WLAN_GPIO_PIN1_ADDRESS -#define GPIO_PIN1_OFFSET WLAN_GPIO_PIN1_OFFSET -#define GPIO_PIN1_CONFIG_MSB WLAN_GPIO_PIN1_CONFIG_MSB -#define GPIO_PIN1_CONFIG_LSB WLAN_GPIO_PIN1_CONFIG_LSB -#define GPIO_PIN1_CONFIG_MASK WLAN_GPIO_PIN1_CONFIG_MASK -#define GPIO_PIN1_CONFIG_GET(x) WLAN_GPIO_PIN1_CONFIG_GET(x) -#define GPIO_PIN1_CONFIG_SET(x) WLAN_GPIO_PIN1_CONFIG_SET(x) -#define GPIO_PIN1_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN1_WAKEUP_ENABLE_MSB -#define GPIO_PIN1_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN1_WAKEUP_ENABLE_LSB -#define GPIO_PIN1_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN1_WAKEUP_ENABLE_MASK -#define GPIO_PIN1_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN1_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN1_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN1_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN1_INT_TYPE_MSB WLAN_GPIO_PIN1_INT_TYPE_MSB -#define GPIO_PIN1_INT_TYPE_LSB WLAN_GPIO_PIN1_INT_TYPE_LSB -#define GPIO_PIN1_INT_TYPE_MASK WLAN_GPIO_PIN1_INT_TYPE_MASK -#define GPIO_PIN1_INT_TYPE_GET(x) WLAN_GPIO_PIN1_INT_TYPE_GET(x) -#define GPIO_PIN1_INT_TYPE_SET(x) WLAN_GPIO_PIN1_INT_TYPE_SET(x) -#define GPIO_PIN1_PAD_PULL_MSB WLAN_GPIO_PIN1_PAD_PULL_MSB -#define GPIO_PIN1_PAD_PULL_LSB WLAN_GPIO_PIN1_PAD_PULL_LSB -#define GPIO_PIN1_PAD_PULL_MASK WLAN_GPIO_PIN1_PAD_PULL_MASK -#define GPIO_PIN1_PAD_PULL_GET(x) WLAN_GPIO_PIN1_PAD_PULL_GET(x) -#define GPIO_PIN1_PAD_PULL_SET(x) WLAN_GPIO_PIN1_PAD_PULL_SET(x) -#define GPIO_PIN1_PAD_STRENGTH_MSB WLAN_GPIO_PIN1_PAD_STRENGTH_MSB -#define GPIO_PIN1_PAD_STRENGTH_LSB WLAN_GPIO_PIN1_PAD_STRENGTH_LSB -#define GPIO_PIN1_PAD_STRENGTH_MASK WLAN_GPIO_PIN1_PAD_STRENGTH_MASK -#define GPIO_PIN1_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN1_PAD_STRENGTH_GET(x) -#define GPIO_PIN1_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN1_PAD_STRENGTH_SET(x) -#define GPIO_PIN1_PAD_DRIVER_MSB WLAN_GPIO_PIN1_PAD_DRIVER_MSB -#define GPIO_PIN1_PAD_DRIVER_LSB WLAN_GPIO_PIN1_PAD_DRIVER_LSB -#define GPIO_PIN1_PAD_DRIVER_MASK WLAN_GPIO_PIN1_PAD_DRIVER_MASK -#define GPIO_PIN1_PAD_DRIVER_GET(x) WLAN_GPIO_PIN1_PAD_DRIVER_GET(x) -#define GPIO_PIN1_PAD_DRIVER_SET(x) WLAN_GPIO_PIN1_PAD_DRIVER_SET(x) -#define GPIO_PIN1_SOURCE_MSB WLAN_GPIO_PIN1_SOURCE_MSB -#define GPIO_PIN1_SOURCE_LSB WLAN_GPIO_PIN1_SOURCE_LSB -#define GPIO_PIN1_SOURCE_MASK WLAN_GPIO_PIN1_SOURCE_MASK -#define GPIO_PIN1_SOURCE_GET(x) WLAN_GPIO_PIN1_SOURCE_GET(x) -#define GPIO_PIN1_SOURCE_SET(x) WLAN_GPIO_PIN1_SOURCE_SET(x) -#define GPIO_PIN2_ADDRESS WLAN_GPIO_PIN2_ADDRESS -#define GPIO_PIN2_OFFSET WLAN_GPIO_PIN2_OFFSET -#define GPIO_PIN2_CONFIG_MSB WLAN_GPIO_PIN2_CONFIG_MSB -#define GPIO_PIN2_CONFIG_LSB WLAN_GPIO_PIN2_CONFIG_LSB -#define GPIO_PIN2_CONFIG_MASK WLAN_GPIO_PIN2_CONFIG_MASK -#define GPIO_PIN2_CONFIG_GET(x) WLAN_GPIO_PIN2_CONFIG_GET(x) -#define GPIO_PIN2_CONFIG_SET(x) WLAN_GPIO_PIN2_CONFIG_SET(x) -#define GPIO_PIN2_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN2_WAKEUP_ENABLE_MSB -#define GPIO_PIN2_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN2_WAKEUP_ENABLE_LSB -#define GPIO_PIN2_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN2_WAKEUP_ENABLE_MASK -#define GPIO_PIN2_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN2_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN2_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN2_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN2_INT_TYPE_MSB WLAN_GPIO_PIN2_INT_TYPE_MSB -#define GPIO_PIN2_INT_TYPE_LSB WLAN_GPIO_PIN2_INT_TYPE_LSB -#define GPIO_PIN2_INT_TYPE_MASK WLAN_GPIO_PIN2_INT_TYPE_MASK -#define GPIO_PIN2_INT_TYPE_GET(x) WLAN_GPIO_PIN2_INT_TYPE_GET(x) -#define GPIO_PIN2_INT_TYPE_SET(x) WLAN_GPIO_PIN2_INT_TYPE_SET(x) -#define GPIO_PIN2_PAD_PULL_MSB WLAN_GPIO_PIN2_PAD_PULL_MSB -#define GPIO_PIN2_PAD_PULL_LSB WLAN_GPIO_PIN2_PAD_PULL_LSB -#define GPIO_PIN2_PAD_PULL_MASK WLAN_GPIO_PIN2_PAD_PULL_MASK -#define GPIO_PIN2_PAD_PULL_GET(x) WLAN_GPIO_PIN2_PAD_PULL_GET(x) -#define GPIO_PIN2_PAD_PULL_SET(x) WLAN_GPIO_PIN2_PAD_PULL_SET(x) -#define GPIO_PIN2_PAD_STRENGTH_MSB WLAN_GPIO_PIN2_PAD_STRENGTH_MSB -#define GPIO_PIN2_PAD_STRENGTH_LSB WLAN_GPIO_PIN2_PAD_STRENGTH_LSB -#define GPIO_PIN2_PAD_STRENGTH_MASK WLAN_GPIO_PIN2_PAD_STRENGTH_MASK -#define GPIO_PIN2_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN2_PAD_STRENGTH_GET(x) -#define GPIO_PIN2_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN2_PAD_STRENGTH_SET(x) -#define GPIO_PIN2_PAD_DRIVER_MSB WLAN_GPIO_PIN2_PAD_DRIVER_MSB -#define GPIO_PIN2_PAD_DRIVER_LSB WLAN_GPIO_PIN2_PAD_DRIVER_LSB -#define GPIO_PIN2_PAD_DRIVER_MASK WLAN_GPIO_PIN2_PAD_DRIVER_MASK -#define GPIO_PIN2_PAD_DRIVER_GET(x) WLAN_GPIO_PIN2_PAD_DRIVER_GET(x) -#define GPIO_PIN2_PAD_DRIVER_SET(x) WLAN_GPIO_PIN2_PAD_DRIVER_SET(x) -#define GPIO_PIN2_SOURCE_MSB WLAN_GPIO_PIN2_SOURCE_MSB -#define GPIO_PIN2_SOURCE_LSB WLAN_GPIO_PIN2_SOURCE_LSB -#define GPIO_PIN2_SOURCE_MASK WLAN_GPIO_PIN2_SOURCE_MASK -#define GPIO_PIN2_SOURCE_GET(x) WLAN_GPIO_PIN2_SOURCE_GET(x) -#define GPIO_PIN2_SOURCE_SET(x) WLAN_GPIO_PIN2_SOURCE_SET(x) -#define GPIO_PIN3_ADDRESS WLAN_GPIO_PIN3_ADDRESS -#define GPIO_PIN3_OFFSET WLAN_GPIO_PIN3_OFFSET -#define GPIO_PIN3_CONFIG_MSB WLAN_GPIO_PIN3_CONFIG_MSB -#define GPIO_PIN3_CONFIG_LSB WLAN_GPIO_PIN3_CONFIG_LSB -#define GPIO_PIN3_CONFIG_MASK WLAN_GPIO_PIN3_CONFIG_MASK -#define GPIO_PIN3_CONFIG_GET(x) WLAN_GPIO_PIN3_CONFIG_GET(x) -#define GPIO_PIN3_CONFIG_SET(x) WLAN_GPIO_PIN3_CONFIG_SET(x) -#define GPIO_PIN3_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN3_WAKEUP_ENABLE_MSB -#define GPIO_PIN3_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN3_WAKEUP_ENABLE_LSB -#define GPIO_PIN3_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN3_WAKEUP_ENABLE_MASK -#define GPIO_PIN3_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN3_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN3_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN3_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN3_INT_TYPE_MSB WLAN_GPIO_PIN3_INT_TYPE_MSB -#define GPIO_PIN3_INT_TYPE_LSB WLAN_GPIO_PIN3_INT_TYPE_LSB -#define GPIO_PIN3_INT_TYPE_MASK WLAN_GPIO_PIN3_INT_TYPE_MASK -#define GPIO_PIN3_INT_TYPE_GET(x) WLAN_GPIO_PIN3_INT_TYPE_GET(x) -#define GPIO_PIN3_INT_TYPE_SET(x) WLAN_GPIO_PIN3_INT_TYPE_SET(x) -#define GPIO_PIN3_PAD_PULL_MSB WLAN_GPIO_PIN3_PAD_PULL_MSB -#define GPIO_PIN3_PAD_PULL_LSB WLAN_GPIO_PIN3_PAD_PULL_LSB -#define GPIO_PIN3_PAD_PULL_MASK WLAN_GPIO_PIN3_PAD_PULL_MASK -#define GPIO_PIN3_PAD_PULL_GET(x) WLAN_GPIO_PIN3_PAD_PULL_GET(x) -#define GPIO_PIN3_PAD_PULL_SET(x) WLAN_GPIO_PIN3_PAD_PULL_SET(x) -#define GPIO_PIN3_PAD_STRENGTH_MSB WLAN_GPIO_PIN3_PAD_STRENGTH_MSB -#define GPIO_PIN3_PAD_STRENGTH_LSB WLAN_GPIO_PIN3_PAD_STRENGTH_LSB -#define GPIO_PIN3_PAD_STRENGTH_MASK WLAN_GPIO_PIN3_PAD_STRENGTH_MASK -#define GPIO_PIN3_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN3_PAD_STRENGTH_GET(x) -#define GPIO_PIN3_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN3_PAD_STRENGTH_SET(x) -#define GPIO_PIN3_PAD_DRIVER_MSB WLAN_GPIO_PIN3_PAD_DRIVER_MSB -#define GPIO_PIN3_PAD_DRIVER_LSB WLAN_GPIO_PIN3_PAD_DRIVER_LSB -#define GPIO_PIN3_PAD_DRIVER_MASK WLAN_GPIO_PIN3_PAD_DRIVER_MASK -#define GPIO_PIN3_PAD_DRIVER_GET(x) WLAN_GPIO_PIN3_PAD_DRIVER_GET(x) -#define GPIO_PIN3_PAD_DRIVER_SET(x) WLAN_GPIO_PIN3_PAD_DRIVER_SET(x) -#define GPIO_PIN3_SOURCE_MSB WLAN_GPIO_PIN3_SOURCE_MSB -#define GPIO_PIN3_SOURCE_LSB WLAN_GPIO_PIN3_SOURCE_LSB -#define GPIO_PIN3_SOURCE_MASK WLAN_GPIO_PIN3_SOURCE_MASK -#define GPIO_PIN3_SOURCE_GET(x) WLAN_GPIO_PIN3_SOURCE_GET(x) -#define GPIO_PIN3_SOURCE_SET(x) WLAN_GPIO_PIN3_SOURCE_SET(x) -#define GPIO_PIN4_ADDRESS WLAN_GPIO_PIN4_ADDRESS -#define GPIO_PIN4_OFFSET WLAN_GPIO_PIN4_OFFSET -#define GPIO_PIN4_CONFIG_MSB WLAN_GPIO_PIN4_CONFIG_MSB -#define GPIO_PIN4_CONFIG_LSB WLAN_GPIO_PIN4_CONFIG_LSB -#define GPIO_PIN4_CONFIG_MASK WLAN_GPIO_PIN4_CONFIG_MASK -#define GPIO_PIN4_CONFIG_GET(x) WLAN_GPIO_PIN4_CONFIG_GET(x) -#define GPIO_PIN4_CONFIG_SET(x) WLAN_GPIO_PIN4_CONFIG_SET(x) -#define GPIO_PIN4_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN4_WAKEUP_ENABLE_MSB -#define GPIO_PIN4_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN4_WAKEUP_ENABLE_LSB -#define GPIO_PIN4_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN4_WAKEUP_ENABLE_MASK -#define GPIO_PIN4_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN4_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN4_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN4_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN4_INT_TYPE_MSB WLAN_GPIO_PIN4_INT_TYPE_MSB -#define GPIO_PIN4_INT_TYPE_LSB WLAN_GPIO_PIN4_INT_TYPE_LSB -#define GPIO_PIN4_INT_TYPE_MASK WLAN_GPIO_PIN4_INT_TYPE_MASK -#define GPIO_PIN4_INT_TYPE_GET(x) WLAN_GPIO_PIN4_INT_TYPE_GET(x) -#define GPIO_PIN4_INT_TYPE_SET(x) WLAN_GPIO_PIN4_INT_TYPE_SET(x) -#define GPIO_PIN4_PAD_PULL_MSB WLAN_GPIO_PIN4_PAD_PULL_MSB -#define GPIO_PIN4_PAD_PULL_LSB WLAN_GPIO_PIN4_PAD_PULL_LSB -#define GPIO_PIN4_PAD_PULL_MASK WLAN_GPIO_PIN4_PAD_PULL_MASK -#define GPIO_PIN4_PAD_PULL_GET(x) WLAN_GPIO_PIN4_PAD_PULL_GET(x) -#define GPIO_PIN4_PAD_PULL_SET(x) WLAN_GPIO_PIN4_PAD_PULL_SET(x) -#define GPIO_PIN4_PAD_STRENGTH_MSB WLAN_GPIO_PIN4_PAD_STRENGTH_MSB -#define GPIO_PIN4_PAD_STRENGTH_LSB WLAN_GPIO_PIN4_PAD_STRENGTH_LSB -#define GPIO_PIN4_PAD_STRENGTH_MASK WLAN_GPIO_PIN4_PAD_STRENGTH_MASK -#define GPIO_PIN4_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN4_PAD_STRENGTH_GET(x) -#define GPIO_PIN4_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN4_PAD_STRENGTH_SET(x) -#define GPIO_PIN4_PAD_DRIVER_MSB WLAN_GPIO_PIN4_PAD_DRIVER_MSB -#define GPIO_PIN4_PAD_DRIVER_LSB WLAN_GPIO_PIN4_PAD_DRIVER_LSB -#define GPIO_PIN4_PAD_DRIVER_MASK WLAN_GPIO_PIN4_PAD_DRIVER_MASK -#define GPIO_PIN4_PAD_DRIVER_GET(x) WLAN_GPIO_PIN4_PAD_DRIVER_GET(x) -#define GPIO_PIN4_PAD_DRIVER_SET(x) WLAN_GPIO_PIN4_PAD_DRIVER_SET(x) -#define GPIO_PIN4_SOURCE_MSB WLAN_GPIO_PIN4_SOURCE_MSB -#define GPIO_PIN4_SOURCE_LSB WLAN_GPIO_PIN4_SOURCE_LSB -#define GPIO_PIN4_SOURCE_MASK WLAN_GPIO_PIN4_SOURCE_MASK -#define GPIO_PIN4_SOURCE_GET(x) WLAN_GPIO_PIN4_SOURCE_GET(x) -#define GPIO_PIN4_SOURCE_SET(x) WLAN_GPIO_PIN4_SOURCE_SET(x) -#define GPIO_PIN5_ADDRESS WLAN_GPIO_PIN5_ADDRESS -#define GPIO_PIN5_OFFSET WLAN_GPIO_PIN5_OFFSET -#define GPIO_PIN5_CONFIG_MSB WLAN_GPIO_PIN5_CONFIG_MSB -#define GPIO_PIN5_CONFIG_LSB WLAN_GPIO_PIN5_CONFIG_LSB -#define GPIO_PIN5_CONFIG_MASK WLAN_GPIO_PIN5_CONFIG_MASK -#define GPIO_PIN5_CONFIG_GET(x) WLAN_GPIO_PIN5_CONFIG_GET(x) -#define GPIO_PIN5_CONFIG_SET(x) WLAN_GPIO_PIN5_CONFIG_SET(x) -#define GPIO_PIN5_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN5_WAKEUP_ENABLE_MSB -#define GPIO_PIN5_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN5_WAKEUP_ENABLE_LSB -#define GPIO_PIN5_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN5_WAKEUP_ENABLE_MASK -#define GPIO_PIN5_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN5_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN5_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN5_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN5_INT_TYPE_MSB WLAN_GPIO_PIN5_INT_TYPE_MSB -#define GPIO_PIN5_INT_TYPE_LSB WLAN_GPIO_PIN5_INT_TYPE_LSB -#define GPIO_PIN5_INT_TYPE_MASK WLAN_GPIO_PIN5_INT_TYPE_MASK -#define GPIO_PIN5_INT_TYPE_GET(x) WLAN_GPIO_PIN5_INT_TYPE_GET(x) -#define GPIO_PIN5_INT_TYPE_SET(x) WLAN_GPIO_PIN5_INT_TYPE_SET(x) -#define GPIO_PIN5_PAD_PULL_MSB WLAN_GPIO_PIN5_PAD_PULL_MSB -#define GPIO_PIN5_PAD_PULL_LSB WLAN_GPIO_PIN5_PAD_PULL_LSB -#define GPIO_PIN5_PAD_PULL_MASK WLAN_GPIO_PIN5_PAD_PULL_MASK -#define GPIO_PIN5_PAD_PULL_GET(x) WLAN_GPIO_PIN5_PAD_PULL_GET(x) -#define GPIO_PIN5_PAD_PULL_SET(x) WLAN_GPIO_PIN5_PAD_PULL_SET(x) -#define GPIO_PIN5_PAD_STRENGTH_MSB WLAN_GPIO_PIN5_PAD_STRENGTH_MSB -#define GPIO_PIN5_PAD_STRENGTH_LSB WLAN_GPIO_PIN5_PAD_STRENGTH_LSB -#define GPIO_PIN5_PAD_STRENGTH_MASK WLAN_GPIO_PIN5_PAD_STRENGTH_MASK -#define GPIO_PIN5_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN5_PAD_STRENGTH_GET(x) -#define GPIO_PIN5_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN5_PAD_STRENGTH_SET(x) -#define GPIO_PIN5_PAD_DRIVER_MSB WLAN_GPIO_PIN5_PAD_DRIVER_MSB -#define GPIO_PIN5_PAD_DRIVER_LSB WLAN_GPIO_PIN5_PAD_DRIVER_LSB -#define GPIO_PIN5_PAD_DRIVER_MASK WLAN_GPIO_PIN5_PAD_DRIVER_MASK -#define GPIO_PIN5_PAD_DRIVER_GET(x) WLAN_GPIO_PIN5_PAD_DRIVER_GET(x) -#define GPIO_PIN5_PAD_DRIVER_SET(x) WLAN_GPIO_PIN5_PAD_DRIVER_SET(x) -#define GPIO_PIN5_SOURCE_MSB WLAN_GPIO_PIN5_SOURCE_MSB -#define GPIO_PIN5_SOURCE_LSB WLAN_GPIO_PIN5_SOURCE_LSB -#define GPIO_PIN5_SOURCE_MASK WLAN_GPIO_PIN5_SOURCE_MASK -#define GPIO_PIN5_SOURCE_GET(x) WLAN_GPIO_PIN5_SOURCE_GET(x) -#define GPIO_PIN5_SOURCE_SET(x) WLAN_GPIO_PIN5_SOURCE_SET(x) -#define GPIO_PIN6_ADDRESS WLAN_GPIO_PIN6_ADDRESS -#define GPIO_PIN6_OFFSET WLAN_GPIO_PIN6_OFFSET -#define GPIO_PIN6_CONFIG_MSB WLAN_GPIO_PIN6_CONFIG_MSB -#define GPIO_PIN6_CONFIG_LSB WLAN_GPIO_PIN6_CONFIG_LSB -#define GPIO_PIN6_CONFIG_MASK WLAN_GPIO_PIN6_CONFIG_MASK -#define GPIO_PIN6_CONFIG_GET(x) WLAN_GPIO_PIN6_CONFIG_GET(x) -#define GPIO_PIN6_CONFIG_SET(x) WLAN_GPIO_PIN6_CONFIG_SET(x) -#define GPIO_PIN6_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN6_WAKEUP_ENABLE_MSB -#define GPIO_PIN6_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN6_WAKEUP_ENABLE_LSB -#define GPIO_PIN6_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN6_WAKEUP_ENABLE_MASK -#define GPIO_PIN6_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN6_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN6_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN6_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN6_INT_TYPE_MSB WLAN_GPIO_PIN6_INT_TYPE_MSB -#define GPIO_PIN6_INT_TYPE_LSB WLAN_GPIO_PIN6_INT_TYPE_LSB -#define GPIO_PIN6_INT_TYPE_MASK WLAN_GPIO_PIN6_INT_TYPE_MASK -#define GPIO_PIN6_INT_TYPE_GET(x) WLAN_GPIO_PIN6_INT_TYPE_GET(x) -#define GPIO_PIN6_INT_TYPE_SET(x) WLAN_GPIO_PIN6_INT_TYPE_SET(x) -#define GPIO_PIN6_PAD_PULL_MSB WLAN_GPIO_PIN6_PAD_PULL_MSB -#define GPIO_PIN6_PAD_PULL_LSB WLAN_GPIO_PIN6_PAD_PULL_LSB -#define GPIO_PIN6_PAD_PULL_MASK WLAN_GPIO_PIN6_PAD_PULL_MASK -#define GPIO_PIN6_PAD_PULL_GET(x) WLAN_GPIO_PIN6_PAD_PULL_GET(x) -#define GPIO_PIN6_PAD_PULL_SET(x) WLAN_GPIO_PIN6_PAD_PULL_SET(x) -#define GPIO_PIN6_PAD_STRENGTH_MSB WLAN_GPIO_PIN6_PAD_STRENGTH_MSB -#define GPIO_PIN6_PAD_STRENGTH_LSB WLAN_GPIO_PIN6_PAD_STRENGTH_LSB -#define GPIO_PIN6_PAD_STRENGTH_MASK WLAN_GPIO_PIN6_PAD_STRENGTH_MASK -#define GPIO_PIN6_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN6_PAD_STRENGTH_GET(x) -#define GPIO_PIN6_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN6_PAD_STRENGTH_SET(x) -#define GPIO_PIN6_PAD_DRIVER_MSB WLAN_GPIO_PIN6_PAD_DRIVER_MSB -#define GPIO_PIN6_PAD_DRIVER_LSB WLAN_GPIO_PIN6_PAD_DRIVER_LSB -#define GPIO_PIN6_PAD_DRIVER_MASK WLAN_GPIO_PIN6_PAD_DRIVER_MASK -#define GPIO_PIN6_PAD_DRIVER_GET(x) WLAN_GPIO_PIN6_PAD_DRIVER_GET(x) -#define GPIO_PIN6_PAD_DRIVER_SET(x) WLAN_GPIO_PIN6_PAD_DRIVER_SET(x) -#define GPIO_PIN6_SOURCE_MSB WLAN_GPIO_PIN6_SOURCE_MSB -#define GPIO_PIN6_SOURCE_LSB WLAN_GPIO_PIN6_SOURCE_LSB -#define GPIO_PIN6_SOURCE_MASK WLAN_GPIO_PIN6_SOURCE_MASK -#define GPIO_PIN6_SOURCE_GET(x) WLAN_GPIO_PIN6_SOURCE_GET(x) -#define GPIO_PIN6_SOURCE_SET(x) WLAN_GPIO_PIN6_SOURCE_SET(x) -#define GPIO_PIN7_ADDRESS WLAN_GPIO_PIN7_ADDRESS -#define GPIO_PIN7_OFFSET WLAN_GPIO_PIN7_OFFSET -#define GPIO_PIN7_CONFIG_MSB WLAN_GPIO_PIN7_CONFIG_MSB -#define GPIO_PIN7_CONFIG_LSB WLAN_GPIO_PIN7_CONFIG_LSB -#define GPIO_PIN7_CONFIG_MASK WLAN_GPIO_PIN7_CONFIG_MASK -#define GPIO_PIN7_CONFIG_GET(x) WLAN_GPIO_PIN7_CONFIG_GET(x) -#define GPIO_PIN7_CONFIG_SET(x) WLAN_GPIO_PIN7_CONFIG_SET(x) -#define GPIO_PIN7_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN7_WAKEUP_ENABLE_MSB -#define GPIO_PIN7_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN7_WAKEUP_ENABLE_LSB -#define GPIO_PIN7_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN7_WAKEUP_ENABLE_MASK -#define GPIO_PIN7_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN7_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN7_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN7_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN7_INT_TYPE_MSB WLAN_GPIO_PIN7_INT_TYPE_MSB -#define GPIO_PIN7_INT_TYPE_LSB WLAN_GPIO_PIN7_INT_TYPE_LSB -#define GPIO_PIN7_INT_TYPE_MASK WLAN_GPIO_PIN7_INT_TYPE_MASK -#define GPIO_PIN7_INT_TYPE_GET(x) WLAN_GPIO_PIN7_INT_TYPE_GET(x) -#define GPIO_PIN7_INT_TYPE_SET(x) WLAN_GPIO_PIN7_INT_TYPE_SET(x) -#define GPIO_PIN7_PAD_PULL_MSB WLAN_GPIO_PIN7_PAD_PULL_MSB -#define GPIO_PIN7_PAD_PULL_LSB WLAN_GPIO_PIN7_PAD_PULL_LSB -#define GPIO_PIN7_PAD_PULL_MASK WLAN_GPIO_PIN7_PAD_PULL_MASK -#define GPIO_PIN7_PAD_PULL_GET(x) WLAN_GPIO_PIN7_PAD_PULL_GET(x) -#define GPIO_PIN7_PAD_PULL_SET(x) WLAN_GPIO_PIN7_PAD_PULL_SET(x) -#define GPIO_PIN7_PAD_STRENGTH_MSB WLAN_GPIO_PIN7_PAD_STRENGTH_MSB -#define GPIO_PIN7_PAD_STRENGTH_LSB WLAN_GPIO_PIN7_PAD_STRENGTH_LSB -#define GPIO_PIN7_PAD_STRENGTH_MASK WLAN_GPIO_PIN7_PAD_STRENGTH_MASK -#define GPIO_PIN7_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN7_PAD_STRENGTH_GET(x) -#define GPIO_PIN7_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN7_PAD_STRENGTH_SET(x) -#define GPIO_PIN7_PAD_DRIVER_MSB WLAN_GPIO_PIN7_PAD_DRIVER_MSB -#define GPIO_PIN7_PAD_DRIVER_LSB WLAN_GPIO_PIN7_PAD_DRIVER_LSB -#define GPIO_PIN7_PAD_DRIVER_MASK WLAN_GPIO_PIN7_PAD_DRIVER_MASK -#define GPIO_PIN7_PAD_DRIVER_GET(x) WLAN_GPIO_PIN7_PAD_DRIVER_GET(x) -#define GPIO_PIN7_PAD_DRIVER_SET(x) WLAN_GPIO_PIN7_PAD_DRIVER_SET(x) -#define GPIO_PIN7_SOURCE_MSB WLAN_GPIO_PIN7_SOURCE_MSB -#define GPIO_PIN7_SOURCE_LSB WLAN_GPIO_PIN7_SOURCE_LSB -#define GPIO_PIN7_SOURCE_MASK WLAN_GPIO_PIN7_SOURCE_MASK -#define GPIO_PIN7_SOURCE_GET(x) WLAN_GPIO_PIN7_SOURCE_GET(x) -#define GPIO_PIN7_SOURCE_SET(x) WLAN_GPIO_PIN7_SOURCE_SET(x) -#define GPIO_PIN8_ADDRESS WLAN_GPIO_PIN8_ADDRESS -#define GPIO_PIN8_OFFSET WLAN_GPIO_PIN8_OFFSET -#define GPIO_PIN8_CONFIG_MSB WLAN_GPIO_PIN8_CONFIG_MSB -#define GPIO_PIN8_CONFIG_LSB WLAN_GPIO_PIN8_CONFIG_LSB -#define GPIO_PIN8_CONFIG_MASK WLAN_GPIO_PIN8_CONFIG_MASK -#define GPIO_PIN8_CONFIG_GET(x) WLAN_GPIO_PIN8_CONFIG_GET(x) -#define GPIO_PIN8_CONFIG_SET(x) WLAN_GPIO_PIN8_CONFIG_SET(x) -#define GPIO_PIN8_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN8_WAKEUP_ENABLE_MSB -#define GPIO_PIN8_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN8_WAKEUP_ENABLE_LSB -#define GPIO_PIN8_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN8_WAKEUP_ENABLE_MASK -#define GPIO_PIN8_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN8_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN8_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN8_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN8_INT_TYPE_MSB WLAN_GPIO_PIN8_INT_TYPE_MSB -#define GPIO_PIN8_INT_TYPE_LSB WLAN_GPIO_PIN8_INT_TYPE_LSB -#define GPIO_PIN8_INT_TYPE_MASK WLAN_GPIO_PIN8_INT_TYPE_MASK -#define GPIO_PIN8_INT_TYPE_GET(x) WLAN_GPIO_PIN8_INT_TYPE_GET(x) -#define GPIO_PIN8_INT_TYPE_SET(x) WLAN_GPIO_PIN8_INT_TYPE_SET(x) -#define GPIO_PIN8_PAD_PULL_MSB WLAN_GPIO_PIN8_PAD_PULL_MSB -#define GPIO_PIN8_PAD_PULL_LSB WLAN_GPIO_PIN8_PAD_PULL_LSB -#define GPIO_PIN8_PAD_PULL_MASK WLAN_GPIO_PIN8_PAD_PULL_MASK -#define GPIO_PIN8_PAD_PULL_GET(x) WLAN_GPIO_PIN8_PAD_PULL_GET(x) -#define GPIO_PIN8_PAD_PULL_SET(x) WLAN_GPIO_PIN8_PAD_PULL_SET(x) -#define GPIO_PIN8_PAD_STRENGTH_MSB WLAN_GPIO_PIN8_PAD_STRENGTH_MSB -#define GPIO_PIN8_PAD_STRENGTH_LSB WLAN_GPIO_PIN8_PAD_STRENGTH_LSB -#define GPIO_PIN8_PAD_STRENGTH_MASK WLAN_GPIO_PIN8_PAD_STRENGTH_MASK -#define GPIO_PIN8_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN8_PAD_STRENGTH_GET(x) -#define GPIO_PIN8_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN8_PAD_STRENGTH_SET(x) -#define GPIO_PIN8_PAD_DRIVER_MSB WLAN_GPIO_PIN8_PAD_DRIVER_MSB -#define GPIO_PIN8_PAD_DRIVER_LSB WLAN_GPIO_PIN8_PAD_DRIVER_LSB -#define GPIO_PIN8_PAD_DRIVER_MASK WLAN_GPIO_PIN8_PAD_DRIVER_MASK -#define GPIO_PIN8_PAD_DRIVER_GET(x) WLAN_GPIO_PIN8_PAD_DRIVER_GET(x) -#define GPIO_PIN8_PAD_DRIVER_SET(x) WLAN_GPIO_PIN8_PAD_DRIVER_SET(x) -#define GPIO_PIN8_SOURCE_MSB WLAN_GPIO_PIN8_SOURCE_MSB -#define GPIO_PIN8_SOURCE_LSB WLAN_GPIO_PIN8_SOURCE_LSB -#define GPIO_PIN8_SOURCE_MASK WLAN_GPIO_PIN8_SOURCE_MASK -#define GPIO_PIN8_SOURCE_GET(x) WLAN_GPIO_PIN8_SOURCE_GET(x) -#define GPIO_PIN8_SOURCE_SET(x) WLAN_GPIO_PIN8_SOURCE_SET(x) -#define GPIO_PIN9_ADDRESS WLAN_GPIO_PIN9_ADDRESS -#define GPIO_PIN9_OFFSET WLAN_GPIO_PIN9_OFFSET -#define GPIO_PIN9_CONFIG_MSB WLAN_GPIO_PIN9_CONFIG_MSB -#define GPIO_PIN9_CONFIG_LSB WLAN_GPIO_PIN9_CONFIG_LSB -#define GPIO_PIN9_CONFIG_MASK WLAN_GPIO_PIN9_CONFIG_MASK -#define GPIO_PIN9_CONFIG_GET(x) WLAN_GPIO_PIN9_CONFIG_GET(x) -#define GPIO_PIN9_CONFIG_SET(x) WLAN_GPIO_PIN9_CONFIG_SET(x) -#define GPIO_PIN9_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN9_WAKEUP_ENABLE_MSB -#define GPIO_PIN9_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN9_WAKEUP_ENABLE_LSB -#define GPIO_PIN9_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN9_WAKEUP_ENABLE_MASK -#define GPIO_PIN9_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN9_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN9_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN9_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN9_INT_TYPE_MSB WLAN_GPIO_PIN9_INT_TYPE_MSB -#define GPIO_PIN9_INT_TYPE_LSB WLAN_GPIO_PIN9_INT_TYPE_LSB -#define GPIO_PIN9_INT_TYPE_MASK WLAN_GPIO_PIN9_INT_TYPE_MASK -#define GPIO_PIN9_INT_TYPE_GET(x) WLAN_GPIO_PIN9_INT_TYPE_GET(x) -#define GPIO_PIN9_INT_TYPE_SET(x) WLAN_GPIO_PIN9_INT_TYPE_SET(x) -#define GPIO_PIN9_PAD_PULL_MSB WLAN_GPIO_PIN9_PAD_PULL_MSB -#define GPIO_PIN9_PAD_PULL_LSB WLAN_GPIO_PIN9_PAD_PULL_LSB -#define GPIO_PIN9_PAD_PULL_MASK WLAN_GPIO_PIN9_PAD_PULL_MASK -#define GPIO_PIN9_PAD_PULL_GET(x) WLAN_GPIO_PIN9_PAD_PULL_GET(x) -#define GPIO_PIN9_PAD_PULL_SET(x) WLAN_GPIO_PIN9_PAD_PULL_SET(x) -#define GPIO_PIN9_PAD_STRENGTH_MSB WLAN_GPIO_PIN9_PAD_STRENGTH_MSB -#define GPIO_PIN9_PAD_STRENGTH_LSB WLAN_GPIO_PIN9_PAD_STRENGTH_LSB -#define GPIO_PIN9_PAD_STRENGTH_MASK WLAN_GPIO_PIN9_PAD_STRENGTH_MASK -#define GPIO_PIN9_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN9_PAD_STRENGTH_GET(x) -#define GPIO_PIN9_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN9_PAD_STRENGTH_SET(x) -#define GPIO_PIN9_PAD_DRIVER_MSB WLAN_GPIO_PIN9_PAD_DRIVER_MSB -#define GPIO_PIN9_PAD_DRIVER_LSB WLAN_GPIO_PIN9_PAD_DRIVER_LSB -#define GPIO_PIN9_PAD_DRIVER_MASK WLAN_GPIO_PIN9_PAD_DRIVER_MASK -#define GPIO_PIN9_PAD_DRIVER_GET(x) WLAN_GPIO_PIN9_PAD_DRIVER_GET(x) -#define GPIO_PIN9_PAD_DRIVER_SET(x) WLAN_GPIO_PIN9_PAD_DRIVER_SET(x) -#define GPIO_PIN9_SOURCE_MSB WLAN_GPIO_PIN9_SOURCE_MSB -#define GPIO_PIN9_SOURCE_LSB WLAN_GPIO_PIN9_SOURCE_LSB -#define GPIO_PIN9_SOURCE_MASK WLAN_GPIO_PIN9_SOURCE_MASK -#define GPIO_PIN9_SOURCE_GET(x) WLAN_GPIO_PIN9_SOURCE_GET(x) -#define GPIO_PIN9_SOURCE_SET(x) WLAN_GPIO_PIN9_SOURCE_SET(x) -#define GPIO_PIN10_ADDRESS WLAN_GPIO_PIN10_ADDRESS -#define GPIO_PIN10_OFFSET WLAN_GPIO_PIN10_OFFSET -#define GPIO_PIN10_CONFIG_MSB WLAN_GPIO_PIN10_CONFIG_MSB -#define GPIO_PIN10_CONFIG_LSB WLAN_GPIO_PIN10_CONFIG_LSB -#define GPIO_PIN10_CONFIG_MASK WLAN_GPIO_PIN10_CONFIG_MASK -#define GPIO_PIN10_CONFIG_GET(x) WLAN_GPIO_PIN10_CONFIG_GET(x) -#define GPIO_PIN10_CONFIG_SET(x) WLAN_GPIO_PIN10_CONFIG_SET(x) -#define GPIO_PIN10_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN10_WAKEUP_ENABLE_MSB -#define GPIO_PIN10_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN10_WAKEUP_ENABLE_LSB -#define GPIO_PIN10_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN10_WAKEUP_ENABLE_MASK -#define GPIO_PIN10_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN10_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN10_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN10_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN10_INT_TYPE_MSB WLAN_GPIO_PIN10_INT_TYPE_MSB -#define GPIO_PIN10_INT_TYPE_LSB WLAN_GPIO_PIN10_INT_TYPE_LSB -#define GPIO_PIN10_INT_TYPE_MASK WLAN_GPIO_PIN10_INT_TYPE_MASK -#define GPIO_PIN10_INT_TYPE_GET(x) WLAN_GPIO_PIN10_INT_TYPE_GET(x) -#define GPIO_PIN10_INT_TYPE_SET(x) WLAN_GPIO_PIN10_INT_TYPE_SET(x) -#define GPIO_PIN10_PAD_PULL_MSB WLAN_GPIO_PIN10_PAD_PULL_MSB -#define GPIO_PIN10_PAD_PULL_LSB WLAN_GPIO_PIN10_PAD_PULL_LSB -#define GPIO_PIN10_PAD_PULL_MASK WLAN_GPIO_PIN10_PAD_PULL_MASK -#define GPIO_PIN10_PAD_PULL_GET(x) WLAN_GPIO_PIN10_PAD_PULL_GET(x) -#define GPIO_PIN10_PAD_PULL_SET(x) WLAN_GPIO_PIN10_PAD_PULL_SET(x) -#define GPIO_PIN10_PAD_STRENGTH_MSB WLAN_GPIO_PIN10_PAD_STRENGTH_MSB -#define GPIO_PIN10_PAD_STRENGTH_LSB WLAN_GPIO_PIN10_PAD_STRENGTH_LSB -#define GPIO_PIN10_PAD_STRENGTH_MASK WLAN_GPIO_PIN10_PAD_STRENGTH_MASK -#define GPIO_PIN10_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN10_PAD_STRENGTH_GET(x) -#define GPIO_PIN10_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN10_PAD_STRENGTH_SET(x) -#define GPIO_PIN10_PAD_DRIVER_MSB WLAN_GPIO_PIN10_PAD_DRIVER_MSB -#define GPIO_PIN10_PAD_DRIVER_LSB WLAN_GPIO_PIN10_PAD_DRIVER_LSB -#define GPIO_PIN10_PAD_DRIVER_MASK WLAN_GPIO_PIN10_PAD_DRIVER_MASK -#define GPIO_PIN10_PAD_DRIVER_GET(x) WLAN_GPIO_PIN10_PAD_DRIVER_GET(x) -#define GPIO_PIN10_PAD_DRIVER_SET(x) WLAN_GPIO_PIN10_PAD_DRIVER_SET(x) -#define GPIO_PIN10_SOURCE_MSB WLAN_GPIO_PIN10_SOURCE_MSB -#define GPIO_PIN10_SOURCE_LSB WLAN_GPIO_PIN10_SOURCE_LSB -#define GPIO_PIN10_SOURCE_MASK WLAN_GPIO_PIN10_SOURCE_MASK -#define GPIO_PIN10_SOURCE_GET(x) WLAN_GPIO_PIN10_SOURCE_GET(x) -#define GPIO_PIN10_SOURCE_SET(x) WLAN_GPIO_PIN10_SOURCE_SET(x) -#define GPIO_PIN11_ADDRESS WLAN_GPIO_PIN11_ADDRESS -#define GPIO_PIN11_OFFSET WLAN_GPIO_PIN11_OFFSET -#define GPIO_PIN11_CONFIG_MSB WLAN_GPIO_PIN11_CONFIG_MSB -#define GPIO_PIN11_CONFIG_LSB WLAN_GPIO_PIN11_CONFIG_LSB -#define GPIO_PIN11_CONFIG_MASK WLAN_GPIO_PIN11_CONFIG_MASK -#define GPIO_PIN11_CONFIG_GET(x) WLAN_GPIO_PIN11_CONFIG_GET(x) -#define GPIO_PIN11_CONFIG_SET(x) WLAN_GPIO_PIN11_CONFIG_SET(x) -#define GPIO_PIN11_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN11_WAKEUP_ENABLE_MSB -#define GPIO_PIN11_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN11_WAKEUP_ENABLE_LSB -#define GPIO_PIN11_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN11_WAKEUP_ENABLE_MASK -#define GPIO_PIN11_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN11_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN11_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN11_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN11_INT_TYPE_MSB WLAN_GPIO_PIN11_INT_TYPE_MSB -#define GPIO_PIN11_INT_TYPE_LSB WLAN_GPIO_PIN11_INT_TYPE_LSB -#define GPIO_PIN11_INT_TYPE_MASK WLAN_GPIO_PIN11_INT_TYPE_MASK -#define GPIO_PIN11_INT_TYPE_GET(x) WLAN_GPIO_PIN11_INT_TYPE_GET(x) -#define GPIO_PIN11_INT_TYPE_SET(x) WLAN_GPIO_PIN11_INT_TYPE_SET(x) -#define GPIO_PIN11_PAD_PULL_MSB WLAN_GPIO_PIN11_PAD_PULL_MSB -#define GPIO_PIN11_PAD_PULL_LSB WLAN_GPIO_PIN11_PAD_PULL_LSB -#define GPIO_PIN11_PAD_PULL_MASK WLAN_GPIO_PIN11_PAD_PULL_MASK -#define GPIO_PIN11_PAD_PULL_GET(x) WLAN_GPIO_PIN11_PAD_PULL_GET(x) -#define GPIO_PIN11_PAD_PULL_SET(x) WLAN_GPIO_PIN11_PAD_PULL_SET(x) -#define GPIO_PIN11_PAD_STRENGTH_MSB WLAN_GPIO_PIN11_PAD_STRENGTH_MSB -#define GPIO_PIN11_PAD_STRENGTH_LSB WLAN_GPIO_PIN11_PAD_STRENGTH_LSB -#define GPIO_PIN11_PAD_STRENGTH_MASK WLAN_GPIO_PIN11_PAD_STRENGTH_MASK -#define GPIO_PIN11_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN11_PAD_STRENGTH_GET(x) -#define GPIO_PIN11_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN11_PAD_STRENGTH_SET(x) -#define GPIO_PIN11_PAD_DRIVER_MSB WLAN_GPIO_PIN11_PAD_DRIVER_MSB -#define GPIO_PIN11_PAD_DRIVER_LSB WLAN_GPIO_PIN11_PAD_DRIVER_LSB -#define GPIO_PIN11_PAD_DRIVER_MASK WLAN_GPIO_PIN11_PAD_DRIVER_MASK -#define GPIO_PIN11_PAD_DRIVER_GET(x) WLAN_GPIO_PIN11_PAD_DRIVER_GET(x) -#define GPIO_PIN11_PAD_DRIVER_SET(x) WLAN_GPIO_PIN11_PAD_DRIVER_SET(x) -#define GPIO_PIN11_SOURCE_MSB WLAN_GPIO_PIN11_SOURCE_MSB -#define GPIO_PIN11_SOURCE_LSB WLAN_GPIO_PIN11_SOURCE_LSB -#define GPIO_PIN11_SOURCE_MASK WLAN_GPIO_PIN11_SOURCE_MASK -#define GPIO_PIN11_SOURCE_GET(x) WLAN_GPIO_PIN11_SOURCE_GET(x) -#define GPIO_PIN11_SOURCE_SET(x) WLAN_GPIO_PIN11_SOURCE_SET(x) -#define GPIO_PIN12_ADDRESS WLAN_GPIO_PIN12_ADDRESS -#define GPIO_PIN12_OFFSET WLAN_GPIO_PIN12_OFFSET -#define GPIO_PIN12_CONFIG_MSB WLAN_GPIO_PIN12_CONFIG_MSB -#define GPIO_PIN12_CONFIG_LSB WLAN_GPIO_PIN12_CONFIG_LSB -#define GPIO_PIN12_CONFIG_MASK WLAN_GPIO_PIN12_CONFIG_MASK -#define GPIO_PIN12_CONFIG_GET(x) WLAN_GPIO_PIN12_CONFIG_GET(x) -#define GPIO_PIN12_CONFIG_SET(x) WLAN_GPIO_PIN12_CONFIG_SET(x) -#define GPIO_PIN12_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN12_WAKEUP_ENABLE_MSB -#define GPIO_PIN12_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN12_WAKEUP_ENABLE_LSB -#define GPIO_PIN12_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN12_WAKEUP_ENABLE_MASK -#define GPIO_PIN12_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN12_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN12_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN12_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN12_INT_TYPE_MSB WLAN_GPIO_PIN12_INT_TYPE_MSB -#define GPIO_PIN12_INT_TYPE_LSB WLAN_GPIO_PIN12_INT_TYPE_LSB -#define GPIO_PIN12_INT_TYPE_MASK WLAN_GPIO_PIN12_INT_TYPE_MASK -#define GPIO_PIN12_INT_TYPE_GET(x) WLAN_GPIO_PIN12_INT_TYPE_GET(x) -#define GPIO_PIN12_INT_TYPE_SET(x) WLAN_GPIO_PIN12_INT_TYPE_SET(x) -#define GPIO_PIN12_PAD_PULL_MSB WLAN_GPIO_PIN12_PAD_PULL_MSB -#define GPIO_PIN12_PAD_PULL_LSB WLAN_GPIO_PIN12_PAD_PULL_LSB -#define GPIO_PIN12_PAD_PULL_MASK WLAN_GPIO_PIN12_PAD_PULL_MASK -#define GPIO_PIN12_PAD_PULL_GET(x) WLAN_GPIO_PIN12_PAD_PULL_GET(x) -#define GPIO_PIN12_PAD_PULL_SET(x) WLAN_GPIO_PIN12_PAD_PULL_SET(x) -#define GPIO_PIN12_PAD_STRENGTH_MSB WLAN_GPIO_PIN12_PAD_STRENGTH_MSB -#define GPIO_PIN12_PAD_STRENGTH_LSB WLAN_GPIO_PIN12_PAD_STRENGTH_LSB -#define GPIO_PIN12_PAD_STRENGTH_MASK WLAN_GPIO_PIN12_PAD_STRENGTH_MASK -#define GPIO_PIN12_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN12_PAD_STRENGTH_GET(x) -#define GPIO_PIN12_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN12_PAD_STRENGTH_SET(x) -#define GPIO_PIN12_PAD_DRIVER_MSB WLAN_GPIO_PIN12_PAD_DRIVER_MSB -#define GPIO_PIN12_PAD_DRIVER_LSB WLAN_GPIO_PIN12_PAD_DRIVER_LSB -#define GPIO_PIN12_PAD_DRIVER_MASK WLAN_GPIO_PIN12_PAD_DRIVER_MASK -#define GPIO_PIN12_PAD_DRIVER_GET(x) WLAN_GPIO_PIN12_PAD_DRIVER_GET(x) -#define GPIO_PIN12_PAD_DRIVER_SET(x) WLAN_GPIO_PIN12_PAD_DRIVER_SET(x) -#define GPIO_PIN12_SOURCE_MSB WLAN_GPIO_PIN12_SOURCE_MSB -#define GPIO_PIN12_SOURCE_LSB WLAN_GPIO_PIN12_SOURCE_LSB -#define GPIO_PIN12_SOURCE_MASK WLAN_GPIO_PIN12_SOURCE_MASK -#define GPIO_PIN12_SOURCE_GET(x) WLAN_GPIO_PIN12_SOURCE_GET(x) -#define GPIO_PIN12_SOURCE_SET(x) WLAN_GPIO_PIN12_SOURCE_SET(x) -#define GPIO_PIN13_ADDRESS WLAN_GPIO_PIN13_ADDRESS -#define GPIO_PIN13_OFFSET WLAN_GPIO_PIN13_OFFSET -#define GPIO_PIN13_CONFIG_MSB WLAN_GPIO_PIN13_CONFIG_MSB -#define GPIO_PIN13_CONFIG_LSB WLAN_GPIO_PIN13_CONFIG_LSB -#define GPIO_PIN13_CONFIG_MASK WLAN_GPIO_PIN13_CONFIG_MASK -#define GPIO_PIN13_CONFIG_GET(x) WLAN_GPIO_PIN13_CONFIG_GET(x) -#define GPIO_PIN13_CONFIG_SET(x) WLAN_GPIO_PIN13_CONFIG_SET(x) -#define GPIO_PIN13_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN13_WAKEUP_ENABLE_MSB -#define GPIO_PIN13_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN13_WAKEUP_ENABLE_LSB -#define GPIO_PIN13_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN13_WAKEUP_ENABLE_MASK -#define GPIO_PIN13_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN13_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN13_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN13_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN13_INT_TYPE_MSB WLAN_GPIO_PIN13_INT_TYPE_MSB -#define GPIO_PIN13_INT_TYPE_LSB WLAN_GPIO_PIN13_INT_TYPE_LSB -#define GPIO_PIN13_INT_TYPE_MASK WLAN_GPIO_PIN13_INT_TYPE_MASK -#define GPIO_PIN13_INT_TYPE_GET(x) WLAN_GPIO_PIN13_INT_TYPE_GET(x) -#define GPIO_PIN13_INT_TYPE_SET(x) WLAN_GPIO_PIN13_INT_TYPE_SET(x) -#define GPIO_PIN13_PAD_PULL_MSB WLAN_GPIO_PIN13_PAD_PULL_MSB -#define GPIO_PIN13_PAD_PULL_LSB WLAN_GPIO_PIN13_PAD_PULL_LSB -#define GPIO_PIN13_PAD_PULL_MASK WLAN_GPIO_PIN13_PAD_PULL_MASK -#define GPIO_PIN13_PAD_PULL_GET(x) WLAN_GPIO_PIN13_PAD_PULL_GET(x) -#define GPIO_PIN13_PAD_PULL_SET(x) WLAN_GPIO_PIN13_PAD_PULL_SET(x) -#define GPIO_PIN13_PAD_STRENGTH_MSB WLAN_GPIO_PIN13_PAD_STRENGTH_MSB -#define GPIO_PIN13_PAD_STRENGTH_LSB WLAN_GPIO_PIN13_PAD_STRENGTH_LSB -#define GPIO_PIN13_PAD_STRENGTH_MASK WLAN_GPIO_PIN13_PAD_STRENGTH_MASK -#define GPIO_PIN13_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN13_PAD_STRENGTH_GET(x) -#define GPIO_PIN13_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN13_PAD_STRENGTH_SET(x) -#define GPIO_PIN13_PAD_DRIVER_MSB WLAN_GPIO_PIN13_PAD_DRIVER_MSB -#define GPIO_PIN13_PAD_DRIVER_LSB WLAN_GPIO_PIN13_PAD_DRIVER_LSB -#define GPIO_PIN13_PAD_DRIVER_MASK WLAN_GPIO_PIN13_PAD_DRIVER_MASK -#define GPIO_PIN13_PAD_DRIVER_GET(x) WLAN_GPIO_PIN13_PAD_DRIVER_GET(x) -#define GPIO_PIN13_PAD_DRIVER_SET(x) WLAN_GPIO_PIN13_PAD_DRIVER_SET(x) -#define GPIO_PIN13_SOURCE_MSB WLAN_GPIO_PIN13_SOURCE_MSB -#define GPIO_PIN13_SOURCE_LSB WLAN_GPIO_PIN13_SOURCE_LSB -#define GPIO_PIN13_SOURCE_MASK WLAN_GPIO_PIN13_SOURCE_MASK -#define GPIO_PIN13_SOURCE_GET(x) WLAN_GPIO_PIN13_SOURCE_GET(x) -#define GPIO_PIN13_SOURCE_SET(x) WLAN_GPIO_PIN13_SOURCE_SET(x) -#define GPIO_PIN14_ADDRESS WLAN_GPIO_PIN14_ADDRESS -#define GPIO_PIN14_OFFSET WLAN_GPIO_PIN14_OFFSET -#define GPIO_PIN14_CONFIG_MSB WLAN_GPIO_PIN14_CONFIG_MSB -#define GPIO_PIN14_CONFIG_LSB WLAN_GPIO_PIN14_CONFIG_LSB -#define GPIO_PIN14_CONFIG_MASK WLAN_GPIO_PIN14_CONFIG_MASK -#define GPIO_PIN14_CONFIG_GET(x) WLAN_GPIO_PIN14_CONFIG_GET(x) -#define GPIO_PIN14_CONFIG_SET(x) WLAN_GPIO_PIN14_CONFIG_SET(x) -#define GPIO_PIN14_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN14_WAKEUP_ENABLE_MSB -#define GPIO_PIN14_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN14_WAKEUP_ENABLE_LSB -#define GPIO_PIN14_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN14_WAKEUP_ENABLE_MASK -#define GPIO_PIN14_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN14_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN14_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN14_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN14_INT_TYPE_MSB WLAN_GPIO_PIN14_INT_TYPE_MSB -#define GPIO_PIN14_INT_TYPE_LSB WLAN_GPIO_PIN14_INT_TYPE_LSB -#define GPIO_PIN14_INT_TYPE_MASK WLAN_GPIO_PIN14_INT_TYPE_MASK -#define GPIO_PIN14_INT_TYPE_GET(x) WLAN_GPIO_PIN14_INT_TYPE_GET(x) -#define GPIO_PIN14_INT_TYPE_SET(x) WLAN_GPIO_PIN14_INT_TYPE_SET(x) -#define GPIO_PIN14_PAD_PULL_MSB WLAN_GPIO_PIN14_PAD_PULL_MSB -#define GPIO_PIN14_PAD_PULL_LSB WLAN_GPIO_PIN14_PAD_PULL_LSB -#define GPIO_PIN14_PAD_PULL_MASK WLAN_GPIO_PIN14_PAD_PULL_MASK -#define GPIO_PIN14_PAD_PULL_GET(x) WLAN_GPIO_PIN14_PAD_PULL_GET(x) -#define GPIO_PIN14_PAD_PULL_SET(x) WLAN_GPIO_PIN14_PAD_PULL_SET(x) -#define GPIO_PIN14_PAD_STRENGTH_MSB WLAN_GPIO_PIN14_PAD_STRENGTH_MSB -#define GPIO_PIN14_PAD_STRENGTH_LSB WLAN_GPIO_PIN14_PAD_STRENGTH_LSB -#define GPIO_PIN14_PAD_STRENGTH_MASK WLAN_GPIO_PIN14_PAD_STRENGTH_MASK -#define GPIO_PIN14_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN14_PAD_STRENGTH_GET(x) -#define GPIO_PIN14_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN14_PAD_STRENGTH_SET(x) -#define GPIO_PIN14_PAD_DRIVER_MSB WLAN_GPIO_PIN14_PAD_DRIVER_MSB -#define GPIO_PIN14_PAD_DRIVER_LSB WLAN_GPIO_PIN14_PAD_DRIVER_LSB -#define GPIO_PIN14_PAD_DRIVER_MASK WLAN_GPIO_PIN14_PAD_DRIVER_MASK -#define GPIO_PIN14_PAD_DRIVER_GET(x) WLAN_GPIO_PIN14_PAD_DRIVER_GET(x) -#define GPIO_PIN14_PAD_DRIVER_SET(x) WLAN_GPIO_PIN14_PAD_DRIVER_SET(x) -#define GPIO_PIN14_SOURCE_MSB WLAN_GPIO_PIN14_SOURCE_MSB -#define GPIO_PIN14_SOURCE_LSB WLAN_GPIO_PIN14_SOURCE_LSB -#define GPIO_PIN14_SOURCE_MASK WLAN_GPIO_PIN14_SOURCE_MASK -#define GPIO_PIN14_SOURCE_GET(x) WLAN_GPIO_PIN14_SOURCE_GET(x) -#define GPIO_PIN14_SOURCE_SET(x) WLAN_GPIO_PIN14_SOURCE_SET(x) -#define GPIO_PIN15_ADDRESS WLAN_GPIO_PIN15_ADDRESS -#define GPIO_PIN15_OFFSET WLAN_GPIO_PIN15_OFFSET -#define GPIO_PIN15_CONFIG_MSB WLAN_GPIO_PIN15_CONFIG_MSB -#define GPIO_PIN15_CONFIG_LSB WLAN_GPIO_PIN15_CONFIG_LSB -#define GPIO_PIN15_CONFIG_MASK WLAN_GPIO_PIN15_CONFIG_MASK -#define GPIO_PIN15_CONFIG_GET(x) WLAN_GPIO_PIN15_CONFIG_GET(x) -#define GPIO_PIN15_CONFIG_SET(x) WLAN_GPIO_PIN15_CONFIG_SET(x) -#define GPIO_PIN15_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN15_WAKEUP_ENABLE_MSB -#define GPIO_PIN15_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN15_WAKEUP_ENABLE_LSB -#define GPIO_PIN15_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN15_WAKEUP_ENABLE_MASK -#define GPIO_PIN15_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN15_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN15_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN15_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN15_INT_TYPE_MSB WLAN_GPIO_PIN15_INT_TYPE_MSB -#define GPIO_PIN15_INT_TYPE_LSB WLAN_GPIO_PIN15_INT_TYPE_LSB -#define GPIO_PIN15_INT_TYPE_MASK WLAN_GPIO_PIN15_INT_TYPE_MASK -#define GPIO_PIN15_INT_TYPE_GET(x) WLAN_GPIO_PIN15_INT_TYPE_GET(x) -#define GPIO_PIN15_INT_TYPE_SET(x) WLAN_GPIO_PIN15_INT_TYPE_SET(x) -#define GPIO_PIN15_PAD_PULL_MSB WLAN_GPIO_PIN15_PAD_PULL_MSB -#define GPIO_PIN15_PAD_PULL_LSB WLAN_GPIO_PIN15_PAD_PULL_LSB -#define GPIO_PIN15_PAD_PULL_MASK WLAN_GPIO_PIN15_PAD_PULL_MASK -#define GPIO_PIN15_PAD_PULL_GET(x) WLAN_GPIO_PIN15_PAD_PULL_GET(x) -#define GPIO_PIN15_PAD_PULL_SET(x) WLAN_GPIO_PIN15_PAD_PULL_SET(x) -#define GPIO_PIN15_PAD_STRENGTH_MSB WLAN_GPIO_PIN15_PAD_STRENGTH_MSB -#define GPIO_PIN15_PAD_STRENGTH_LSB WLAN_GPIO_PIN15_PAD_STRENGTH_LSB -#define GPIO_PIN15_PAD_STRENGTH_MASK WLAN_GPIO_PIN15_PAD_STRENGTH_MASK -#define GPIO_PIN15_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN15_PAD_STRENGTH_GET(x) -#define GPIO_PIN15_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN15_PAD_STRENGTH_SET(x) -#define GPIO_PIN15_PAD_DRIVER_MSB WLAN_GPIO_PIN15_PAD_DRIVER_MSB -#define GPIO_PIN15_PAD_DRIVER_LSB WLAN_GPIO_PIN15_PAD_DRIVER_LSB -#define GPIO_PIN15_PAD_DRIVER_MASK WLAN_GPIO_PIN15_PAD_DRIVER_MASK -#define GPIO_PIN15_PAD_DRIVER_GET(x) WLAN_GPIO_PIN15_PAD_DRIVER_GET(x) -#define GPIO_PIN15_PAD_DRIVER_SET(x) WLAN_GPIO_PIN15_PAD_DRIVER_SET(x) -#define GPIO_PIN15_SOURCE_MSB WLAN_GPIO_PIN15_SOURCE_MSB -#define GPIO_PIN15_SOURCE_LSB WLAN_GPIO_PIN15_SOURCE_LSB -#define GPIO_PIN15_SOURCE_MASK WLAN_GPIO_PIN15_SOURCE_MASK -#define GPIO_PIN15_SOURCE_GET(x) WLAN_GPIO_PIN15_SOURCE_GET(x) -#define GPIO_PIN15_SOURCE_SET(x) WLAN_GPIO_PIN15_SOURCE_SET(x) -#define GPIO_PIN16_ADDRESS WLAN_GPIO_PIN16_ADDRESS -#define GPIO_PIN16_OFFSET WLAN_GPIO_PIN16_OFFSET -#define GPIO_PIN16_CONFIG_MSB WLAN_GPIO_PIN16_CONFIG_MSB -#define GPIO_PIN16_CONFIG_LSB WLAN_GPIO_PIN16_CONFIG_LSB -#define GPIO_PIN16_CONFIG_MASK WLAN_GPIO_PIN16_CONFIG_MASK -#define GPIO_PIN16_CONFIG_GET(x) WLAN_GPIO_PIN16_CONFIG_GET(x) -#define GPIO_PIN16_CONFIG_SET(x) WLAN_GPIO_PIN16_CONFIG_SET(x) -#define GPIO_PIN16_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN16_WAKEUP_ENABLE_MSB -#define GPIO_PIN16_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN16_WAKEUP_ENABLE_LSB -#define GPIO_PIN16_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN16_WAKEUP_ENABLE_MASK -#define GPIO_PIN16_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN16_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN16_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN16_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN16_INT_TYPE_MSB WLAN_GPIO_PIN16_INT_TYPE_MSB -#define GPIO_PIN16_INT_TYPE_LSB WLAN_GPIO_PIN16_INT_TYPE_LSB -#define GPIO_PIN16_INT_TYPE_MASK WLAN_GPIO_PIN16_INT_TYPE_MASK -#define GPIO_PIN16_INT_TYPE_GET(x) WLAN_GPIO_PIN16_INT_TYPE_GET(x) -#define GPIO_PIN16_INT_TYPE_SET(x) WLAN_GPIO_PIN16_INT_TYPE_SET(x) -#define GPIO_PIN16_PAD_PULL_MSB WLAN_GPIO_PIN16_PAD_PULL_MSB -#define GPIO_PIN16_PAD_PULL_LSB WLAN_GPIO_PIN16_PAD_PULL_LSB -#define GPIO_PIN16_PAD_PULL_MASK WLAN_GPIO_PIN16_PAD_PULL_MASK -#define GPIO_PIN16_PAD_PULL_GET(x) WLAN_GPIO_PIN16_PAD_PULL_GET(x) -#define GPIO_PIN16_PAD_PULL_SET(x) WLAN_GPIO_PIN16_PAD_PULL_SET(x) -#define GPIO_PIN16_PAD_STRENGTH_MSB WLAN_GPIO_PIN16_PAD_STRENGTH_MSB -#define GPIO_PIN16_PAD_STRENGTH_LSB WLAN_GPIO_PIN16_PAD_STRENGTH_LSB -#define GPIO_PIN16_PAD_STRENGTH_MASK WLAN_GPIO_PIN16_PAD_STRENGTH_MASK -#define GPIO_PIN16_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN16_PAD_STRENGTH_GET(x) -#define GPIO_PIN16_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN16_PAD_STRENGTH_SET(x) -#define GPIO_PIN16_PAD_DRIVER_MSB WLAN_GPIO_PIN16_PAD_DRIVER_MSB -#define GPIO_PIN16_PAD_DRIVER_LSB WLAN_GPIO_PIN16_PAD_DRIVER_LSB -#define GPIO_PIN16_PAD_DRIVER_MASK WLAN_GPIO_PIN16_PAD_DRIVER_MASK -#define GPIO_PIN16_PAD_DRIVER_GET(x) WLAN_GPIO_PIN16_PAD_DRIVER_GET(x) -#define GPIO_PIN16_PAD_DRIVER_SET(x) WLAN_GPIO_PIN16_PAD_DRIVER_SET(x) -#define GPIO_PIN16_SOURCE_MSB WLAN_GPIO_PIN16_SOURCE_MSB -#define GPIO_PIN16_SOURCE_LSB WLAN_GPIO_PIN16_SOURCE_LSB -#define GPIO_PIN16_SOURCE_MASK WLAN_GPIO_PIN16_SOURCE_MASK -#define GPIO_PIN16_SOURCE_GET(x) WLAN_GPIO_PIN16_SOURCE_GET(x) -#define GPIO_PIN16_SOURCE_SET(x) WLAN_GPIO_PIN16_SOURCE_SET(x) -#define GPIO_PIN17_ADDRESS WLAN_GPIO_PIN17_ADDRESS -#define GPIO_PIN17_OFFSET WLAN_GPIO_PIN17_OFFSET -#define GPIO_PIN17_CONFIG_MSB WLAN_GPIO_PIN17_CONFIG_MSB -#define GPIO_PIN17_CONFIG_LSB WLAN_GPIO_PIN17_CONFIG_LSB -#define GPIO_PIN17_CONFIG_MASK WLAN_GPIO_PIN17_CONFIG_MASK -#define GPIO_PIN17_CONFIG_GET(x) WLAN_GPIO_PIN17_CONFIG_GET(x) -#define GPIO_PIN17_CONFIG_SET(x) WLAN_GPIO_PIN17_CONFIG_SET(x) -#define GPIO_PIN17_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN17_WAKEUP_ENABLE_MSB -#define GPIO_PIN17_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN17_WAKEUP_ENABLE_LSB -#define GPIO_PIN17_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN17_WAKEUP_ENABLE_MASK -#define GPIO_PIN17_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN17_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN17_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN17_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN17_INT_TYPE_MSB WLAN_GPIO_PIN17_INT_TYPE_MSB -#define GPIO_PIN17_INT_TYPE_LSB WLAN_GPIO_PIN17_INT_TYPE_LSB -#define GPIO_PIN17_INT_TYPE_MASK WLAN_GPIO_PIN17_INT_TYPE_MASK -#define GPIO_PIN17_INT_TYPE_GET(x) WLAN_GPIO_PIN17_INT_TYPE_GET(x) -#define GPIO_PIN17_INT_TYPE_SET(x) WLAN_GPIO_PIN17_INT_TYPE_SET(x) -#define GPIO_PIN17_PAD_PULL_MSB WLAN_GPIO_PIN17_PAD_PULL_MSB -#define GPIO_PIN17_PAD_PULL_LSB WLAN_GPIO_PIN17_PAD_PULL_LSB -#define GPIO_PIN17_PAD_PULL_MASK WLAN_GPIO_PIN17_PAD_PULL_MASK -#define GPIO_PIN17_PAD_PULL_GET(x) WLAN_GPIO_PIN17_PAD_PULL_GET(x) -#define GPIO_PIN17_PAD_PULL_SET(x) WLAN_GPIO_PIN17_PAD_PULL_SET(x) -#define GPIO_PIN17_PAD_STRENGTH_MSB WLAN_GPIO_PIN17_PAD_STRENGTH_MSB -#define GPIO_PIN17_PAD_STRENGTH_LSB WLAN_GPIO_PIN17_PAD_STRENGTH_LSB -#define GPIO_PIN17_PAD_STRENGTH_MASK WLAN_GPIO_PIN17_PAD_STRENGTH_MASK -#define GPIO_PIN17_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN17_PAD_STRENGTH_GET(x) -#define GPIO_PIN17_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN17_PAD_STRENGTH_SET(x) -#define GPIO_PIN17_PAD_DRIVER_MSB WLAN_GPIO_PIN17_PAD_DRIVER_MSB -#define GPIO_PIN17_PAD_DRIVER_LSB WLAN_GPIO_PIN17_PAD_DRIVER_LSB -#define GPIO_PIN17_PAD_DRIVER_MASK WLAN_GPIO_PIN17_PAD_DRIVER_MASK -#define GPIO_PIN17_PAD_DRIVER_GET(x) WLAN_GPIO_PIN17_PAD_DRIVER_GET(x) -#define GPIO_PIN17_PAD_DRIVER_SET(x) WLAN_GPIO_PIN17_PAD_DRIVER_SET(x) -#define GPIO_PIN17_SOURCE_MSB WLAN_GPIO_PIN17_SOURCE_MSB -#define GPIO_PIN17_SOURCE_LSB WLAN_GPIO_PIN17_SOURCE_LSB -#define GPIO_PIN17_SOURCE_MASK WLAN_GPIO_PIN17_SOURCE_MASK -#define GPIO_PIN17_SOURCE_GET(x) WLAN_GPIO_PIN17_SOURCE_GET(x) -#define GPIO_PIN17_SOURCE_SET(x) WLAN_GPIO_PIN17_SOURCE_SET(x) -#define GPIO_PIN18_ADDRESS WLAN_GPIO_PIN18_ADDRESS -#define GPIO_PIN18_OFFSET WLAN_GPIO_PIN18_OFFSET -#define GPIO_PIN18_CONFIG_MSB WLAN_GPIO_PIN18_CONFIG_MSB -#define GPIO_PIN18_CONFIG_LSB WLAN_GPIO_PIN18_CONFIG_LSB -#define GPIO_PIN18_CONFIG_MASK WLAN_GPIO_PIN18_CONFIG_MASK -#define GPIO_PIN18_CONFIG_GET(x) WLAN_GPIO_PIN18_CONFIG_GET(x) -#define GPIO_PIN18_CONFIG_SET(x) WLAN_GPIO_PIN18_CONFIG_SET(x) -#define GPIO_PIN18_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN18_WAKEUP_ENABLE_MSB -#define GPIO_PIN18_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN18_WAKEUP_ENABLE_LSB -#define GPIO_PIN18_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN18_WAKEUP_ENABLE_MASK -#define GPIO_PIN18_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN18_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN18_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN18_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN18_INT_TYPE_MSB WLAN_GPIO_PIN18_INT_TYPE_MSB -#define GPIO_PIN18_INT_TYPE_LSB WLAN_GPIO_PIN18_INT_TYPE_LSB -#define GPIO_PIN18_INT_TYPE_MASK WLAN_GPIO_PIN18_INT_TYPE_MASK -#define GPIO_PIN18_INT_TYPE_GET(x) WLAN_GPIO_PIN18_INT_TYPE_GET(x) -#define GPIO_PIN18_INT_TYPE_SET(x) WLAN_GPIO_PIN18_INT_TYPE_SET(x) -#define GPIO_PIN18_PAD_PULL_MSB WLAN_GPIO_PIN18_PAD_PULL_MSB -#define GPIO_PIN18_PAD_PULL_LSB WLAN_GPIO_PIN18_PAD_PULL_LSB -#define GPIO_PIN18_PAD_PULL_MASK WLAN_GPIO_PIN18_PAD_PULL_MASK -#define GPIO_PIN18_PAD_PULL_GET(x) WLAN_GPIO_PIN18_PAD_PULL_GET(x) -#define GPIO_PIN18_PAD_PULL_SET(x) WLAN_GPIO_PIN18_PAD_PULL_SET(x) -#define GPIO_PIN18_PAD_STRENGTH_MSB WLAN_GPIO_PIN18_PAD_STRENGTH_MSB -#define GPIO_PIN18_PAD_STRENGTH_LSB WLAN_GPIO_PIN18_PAD_STRENGTH_LSB -#define GPIO_PIN18_PAD_STRENGTH_MASK WLAN_GPIO_PIN18_PAD_STRENGTH_MASK -#define GPIO_PIN18_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN18_PAD_STRENGTH_GET(x) -#define GPIO_PIN18_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN18_PAD_STRENGTH_SET(x) -#define GPIO_PIN18_PAD_DRIVER_MSB WLAN_GPIO_PIN18_PAD_DRIVER_MSB -#define GPIO_PIN18_PAD_DRIVER_LSB WLAN_GPIO_PIN18_PAD_DRIVER_LSB -#define GPIO_PIN18_PAD_DRIVER_MASK WLAN_GPIO_PIN18_PAD_DRIVER_MASK -#define GPIO_PIN18_PAD_DRIVER_GET(x) WLAN_GPIO_PIN18_PAD_DRIVER_GET(x) -#define GPIO_PIN18_PAD_DRIVER_SET(x) WLAN_GPIO_PIN18_PAD_DRIVER_SET(x) -#define GPIO_PIN18_SOURCE_MSB WLAN_GPIO_PIN18_SOURCE_MSB -#define GPIO_PIN18_SOURCE_LSB WLAN_GPIO_PIN18_SOURCE_LSB -#define GPIO_PIN18_SOURCE_MASK WLAN_GPIO_PIN18_SOURCE_MASK -#define GPIO_PIN18_SOURCE_GET(x) WLAN_GPIO_PIN18_SOURCE_GET(x) -#define GPIO_PIN18_SOURCE_SET(x) WLAN_GPIO_PIN18_SOURCE_SET(x) -#define GPIO_PIN19_ADDRESS WLAN_GPIO_PIN19_ADDRESS -#define GPIO_PIN19_OFFSET WLAN_GPIO_PIN19_OFFSET -#define GPIO_PIN19_CONFIG_MSB WLAN_GPIO_PIN19_CONFIG_MSB -#define GPIO_PIN19_CONFIG_LSB WLAN_GPIO_PIN19_CONFIG_LSB -#define GPIO_PIN19_CONFIG_MASK WLAN_GPIO_PIN19_CONFIG_MASK -#define GPIO_PIN19_CONFIG_GET(x) WLAN_GPIO_PIN19_CONFIG_GET(x) -#define GPIO_PIN19_CONFIG_SET(x) WLAN_GPIO_PIN19_CONFIG_SET(x) -#define GPIO_PIN19_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN19_WAKEUP_ENABLE_MSB -#define GPIO_PIN19_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN19_WAKEUP_ENABLE_LSB -#define GPIO_PIN19_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN19_WAKEUP_ENABLE_MASK -#define GPIO_PIN19_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN19_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN19_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN19_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN19_INT_TYPE_MSB WLAN_GPIO_PIN19_INT_TYPE_MSB -#define GPIO_PIN19_INT_TYPE_LSB WLAN_GPIO_PIN19_INT_TYPE_LSB -#define GPIO_PIN19_INT_TYPE_MASK WLAN_GPIO_PIN19_INT_TYPE_MASK -#define GPIO_PIN19_INT_TYPE_GET(x) WLAN_GPIO_PIN19_INT_TYPE_GET(x) -#define GPIO_PIN19_INT_TYPE_SET(x) WLAN_GPIO_PIN19_INT_TYPE_SET(x) -#define GPIO_PIN19_PAD_PULL_MSB WLAN_GPIO_PIN19_PAD_PULL_MSB -#define GPIO_PIN19_PAD_PULL_LSB WLAN_GPIO_PIN19_PAD_PULL_LSB -#define GPIO_PIN19_PAD_PULL_MASK WLAN_GPIO_PIN19_PAD_PULL_MASK -#define GPIO_PIN19_PAD_PULL_GET(x) WLAN_GPIO_PIN19_PAD_PULL_GET(x) -#define GPIO_PIN19_PAD_PULL_SET(x) WLAN_GPIO_PIN19_PAD_PULL_SET(x) -#define GPIO_PIN19_PAD_STRENGTH_MSB WLAN_GPIO_PIN19_PAD_STRENGTH_MSB -#define GPIO_PIN19_PAD_STRENGTH_LSB WLAN_GPIO_PIN19_PAD_STRENGTH_LSB -#define GPIO_PIN19_PAD_STRENGTH_MASK WLAN_GPIO_PIN19_PAD_STRENGTH_MASK -#define GPIO_PIN19_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN19_PAD_STRENGTH_GET(x) -#define GPIO_PIN19_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN19_PAD_STRENGTH_SET(x) -#define GPIO_PIN19_PAD_DRIVER_MSB WLAN_GPIO_PIN19_PAD_DRIVER_MSB -#define GPIO_PIN19_PAD_DRIVER_LSB WLAN_GPIO_PIN19_PAD_DRIVER_LSB -#define GPIO_PIN19_PAD_DRIVER_MASK WLAN_GPIO_PIN19_PAD_DRIVER_MASK -#define GPIO_PIN19_PAD_DRIVER_GET(x) WLAN_GPIO_PIN19_PAD_DRIVER_GET(x) -#define GPIO_PIN19_PAD_DRIVER_SET(x) WLAN_GPIO_PIN19_PAD_DRIVER_SET(x) -#define GPIO_PIN19_SOURCE_MSB WLAN_GPIO_PIN19_SOURCE_MSB -#define GPIO_PIN19_SOURCE_LSB WLAN_GPIO_PIN19_SOURCE_LSB -#define GPIO_PIN19_SOURCE_MASK WLAN_GPIO_PIN19_SOURCE_MASK -#define GPIO_PIN19_SOURCE_GET(x) WLAN_GPIO_PIN19_SOURCE_GET(x) -#define GPIO_PIN19_SOURCE_SET(x) WLAN_GPIO_PIN19_SOURCE_SET(x) -#define GPIO_PIN20_ADDRESS WLAN_GPIO_PIN20_ADDRESS -#define GPIO_PIN20_OFFSET WLAN_GPIO_PIN20_OFFSET -#define GPIO_PIN20_CONFIG_MSB WLAN_GPIO_PIN20_CONFIG_MSB -#define GPIO_PIN20_CONFIG_LSB WLAN_GPIO_PIN20_CONFIG_LSB -#define GPIO_PIN20_CONFIG_MASK WLAN_GPIO_PIN20_CONFIG_MASK -#define GPIO_PIN20_CONFIG_GET(x) WLAN_GPIO_PIN20_CONFIG_GET(x) -#define GPIO_PIN20_CONFIG_SET(x) WLAN_GPIO_PIN20_CONFIG_SET(x) -#define GPIO_PIN20_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN20_WAKEUP_ENABLE_MSB -#define GPIO_PIN20_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN20_WAKEUP_ENABLE_LSB -#define GPIO_PIN20_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN20_WAKEUP_ENABLE_MASK -#define GPIO_PIN20_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN20_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN20_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN20_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN20_INT_TYPE_MSB WLAN_GPIO_PIN20_INT_TYPE_MSB -#define GPIO_PIN20_INT_TYPE_LSB WLAN_GPIO_PIN20_INT_TYPE_LSB -#define GPIO_PIN20_INT_TYPE_MASK WLAN_GPIO_PIN20_INT_TYPE_MASK -#define GPIO_PIN20_INT_TYPE_GET(x) WLAN_GPIO_PIN20_INT_TYPE_GET(x) -#define GPIO_PIN20_INT_TYPE_SET(x) WLAN_GPIO_PIN20_INT_TYPE_SET(x) -#define GPIO_PIN20_PAD_PULL_MSB WLAN_GPIO_PIN20_PAD_PULL_MSB -#define GPIO_PIN20_PAD_PULL_LSB WLAN_GPIO_PIN20_PAD_PULL_LSB -#define GPIO_PIN20_PAD_PULL_MASK WLAN_GPIO_PIN20_PAD_PULL_MASK -#define GPIO_PIN20_PAD_PULL_GET(x) WLAN_GPIO_PIN20_PAD_PULL_GET(x) -#define GPIO_PIN20_PAD_PULL_SET(x) WLAN_GPIO_PIN20_PAD_PULL_SET(x) -#define GPIO_PIN20_PAD_STRENGTH_MSB WLAN_GPIO_PIN20_PAD_STRENGTH_MSB -#define GPIO_PIN20_PAD_STRENGTH_LSB WLAN_GPIO_PIN20_PAD_STRENGTH_LSB -#define GPIO_PIN20_PAD_STRENGTH_MASK WLAN_GPIO_PIN20_PAD_STRENGTH_MASK -#define GPIO_PIN20_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN20_PAD_STRENGTH_GET(x) -#define GPIO_PIN20_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN20_PAD_STRENGTH_SET(x) -#define GPIO_PIN20_PAD_DRIVER_MSB WLAN_GPIO_PIN20_PAD_DRIVER_MSB -#define GPIO_PIN20_PAD_DRIVER_LSB WLAN_GPIO_PIN20_PAD_DRIVER_LSB -#define GPIO_PIN20_PAD_DRIVER_MASK WLAN_GPIO_PIN20_PAD_DRIVER_MASK -#define GPIO_PIN20_PAD_DRIVER_GET(x) WLAN_GPIO_PIN20_PAD_DRIVER_GET(x) -#define GPIO_PIN20_PAD_DRIVER_SET(x) WLAN_GPIO_PIN20_PAD_DRIVER_SET(x) -#define GPIO_PIN20_SOURCE_MSB WLAN_GPIO_PIN20_SOURCE_MSB -#define GPIO_PIN20_SOURCE_LSB WLAN_GPIO_PIN20_SOURCE_LSB -#define GPIO_PIN20_SOURCE_MASK WLAN_GPIO_PIN20_SOURCE_MASK -#define GPIO_PIN20_SOURCE_GET(x) WLAN_GPIO_PIN20_SOURCE_GET(x) -#define GPIO_PIN20_SOURCE_SET(x) WLAN_GPIO_PIN20_SOURCE_SET(x) -#define GPIO_PIN21_ADDRESS WLAN_GPIO_PIN21_ADDRESS -#define GPIO_PIN21_OFFSET WLAN_GPIO_PIN21_OFFSET -#define GPIO_PIN21_CONFIG_MSB WLAN_GPIO_PIN21_CONFIG_MSB -#define GPIO_PIN21_CONFIG_LSB WLAN_GPIO_PIN21_CONFIG_LSB -#define GPIO_PIN21_CONFIG_MASK WLAN_GPIO_PIN21_CONFIG_MASK -#define GPIO_PIN21_CONFIG_GET(x) WLAN_GPIO_PIN21_CONFIG_GET(x) -#define GPIO_PIN21_CONFIG_SET(x) WLAN_GPIO_PIN21_CONFIG_SET(x) -#define GPIO_PIN21_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN21_WAKEUP_ENABLE_MSB -#define GPIO_PIN21_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN21_WAKEUP_ENABLE_LSB -#define GPIO_PIN21_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN21_WAKEUP_ENABLE_MASK -#define GPIO_PIN21_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN21_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN21_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN21_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN21_INT_TYPE_MSB WLAN_GPIO_PIN21_INT_TYPE_MSB -#define GPIO_PIN21_INT_TYPE_LSB WLAN_GPIO_PIN21_INT_TYPE_LSB -#define GPIO_PIN21_INT_TYPE_MASK WLAN_GPIO_PIN21_INT_TYPE_MASK -#define GPIO_PIN21_INT_TYPE_GET(x) WLAN_GPIO_PIN21_INT_TYPE_GET(x) -#define GPIO_PIN21_INT_TYPE_SET(x) WLAN_GPIO_PIN21_INT_TYPE_SET(x) -#define GPIO_PIN21_PAD_PULL_MSB WLAN_GPIO_PIN21_PAD_PULL_MSB -#define GPIO_PIN21_PAD_PULL_LSB WLAN_GPIO_PIN21_PAD_PULL_LSB -#define GPIO_PIN21_PAD_PULL_MASK WLAN_GPIO_PIN21_PAD_PULL_MASK -#define GPIO_PIN21_PAD_PULL_GET(x) WLAN_GPIO_PIN21_PAD_PULL_GET(x) -#define GPIO_PIN21_PAD_PULL_SET(x) WLAN_GPIO_PIN21_PAD_PULL_SET(x) -#define GPIO_PIN21_PAD_STRENGTH_MSB WLAN_GPIO_PIN21_PAD_STRENGTH_MSB -#define GPIO_PIN21_PAD_STRENGTH_LSB WLAN_GPIO_PIN21_PAD_STRENGTH_LSB -#define GPIO_PIN21_PAD_STRENGTH_MASK WLAN_GPIO_PIN21_PAD_STRENGTH_MASK -#define GPIO_PIN21_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN21_PAD_STRENGTH_GET(x) -#define GPIO_PIN21_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN21_PAD_STRENGTH_SET(x) -#define GPIO_PIN21_PAD_DRIVER_MSB WLAN_GPIO_PIN21_PAD_DRIVER_MSB -#define GPIO_PIN21_PAD_DRIVER_LSB WLAN_GPIO_PIN21_PAD_DRIVER_LSB -#define GPIO_PIN21_PAD_DRIVER_MASK WLAN_GPIO_PIN21_PAD_DRIVER_MASK -#define GPIO_PIN21_PAD_DRIVER_GET(x) WLAN_GPIO_PIN21_PAD_DRIVER_GET(x) -#define GPIO_PIN21_PAD_DRIVER_SET(x) WLAN_GPIO_PIN21_PAD_DRIVER_SET(x) -#define GPIO_PIN21_SOURCE_MSB WLAN_GPIO_PIN21_SOURCE_MSB -#define GPIO_PIN21_SOURCE_LSB WLAN_GPIO_PIN21_SOURCE_LSB -#define GPIO_PIN21_SOURCE_MASK WLAN_GPIO_PIN21_SOURCE_MASK -#define GPIO_PIN21_SOURCE_GET(x) WLAN_GPIO_PIN21_SOURCE_GET(x) -#define GPIO_PIN21_SOURCE_SET(x) WLAN_GPIO_PIN21_SOURCE_SET(x) -#define GPIO_PIN22_ADDRESS WLAN_GPIO_PIN22_ADDRESS -#define GPIO_PIN22_OFFSET WLAN_GPIO_PIN22_OFFSET -#define GPIO_PIN22_CONFIG_MSB WLAN_GPIO_PIN22_CONFIG_MSB -#define GPIO_PIN22_CONFIG_LSB WLAN_GPIO_PIN22_CONFIG_LSB -#define GPIO_PIN22_CONFIG_MASK WLAN_GPIO_PIN22_CONFIG_MASK -#define GPIO_PIN22_CONFIG_GET(x) WLAN_GPIO_PIN22_CONFIG_GET(x) -#define GPIO_PIN22_CONFIG_SET(x) WLAN_GPIO_PIN22_CONFIG_SET(x) -#define GPIO_PIN22_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN22_WAKEUP_ENABLE_MSB -#define GPIO_PIN22_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN22_WAKEUP_ENABLE_LSB -#define GPIO_PIN22_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN22_WAKEUP_ENABLE_MASK -#define GPIO_PIN22_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN22_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN22_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN22_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN22_INT_TYPE_MSB WLAN_GPIO_PIN22_INT_TYPE_MSB -#define GPIO_PIN22_INT_TYPE_LSB WLAN_GPIO_PIN22_INT_TYPE_LSB -#define GPIO_PIN22_INT_TYPE_MASK WLAN_GPIO_PIN22_INT_TYPE_MASK -#define GPIO_PIN22_INT_TYPE_GET(x) WLAN_GPIO_PIN22_INT_TYPE_GET(x) -#define GPIO_PIN22_INT_TYPE_SET(x) WLAN_GPIO_PIN22_INT_TYPE_SET(x) -#define GPIO_PIN22_PAD_PULL_MSB WLAN_GPIO_PIN22_PAD_PULL_MSB -#define GPIO_PIN22_PAD_PULL_LSB WLAN_GPIO_PIN22_PAD_PULL_LSB -#define GPIO_PIN22_PAD_PULL_MASK WLAN_GPIO_PIN22_PAD_PULL_MASK -#define GPIO_PIN22_PAD_PULL_GET(x) WLAN_GPIO_PIN22_PAD_PULL_GET(x) -#define GPIO_PIN22_PAD_PULL_SET(x) WLAN_GPIO_PIN22_PAD_PULL_SET(x) -#define GPIO_PIN22_PAD_STRENGTH_MSB WLAN_GPIO_PIN22_PAD_STRENGTH_MSB -#define GPIO_PIN22_PAD_STRENGTH_LSB WLAN_GPIO_PIN22_PAD_STRENGTH_LSB -#define GPIO_PIN22_PAD_STRENGTH_MASK WLAN_GPIO_PIN22_PAD_STRENGTH_MASK -#define GPIO_PIN22_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN22_PAD_STRENGTH_GET(x) -#define GPIO_PIN22_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN22_PAD_STRENGTH_SET(x) -#define GPIO_PIN22_PAD_DRIVER_MSB WLAN_GPIO_PIN22_PAD_DRIVER_MSB -#define GPIO_PIN22_PAD_DRIVER_LSB WLAN_GPIO_PIN22_PAD_DRIVER_LSB -#define GPIO_PIN22_PAD_DRIVER_MASK WLAN_GPIO_PIN22_PAD_DRIVER_MASK -#define GPIO_PIN22_PAD_DRIVER_GET(x) WLAN_GPIO_PIN22_PAD_DRIVER_GET(x) -#define GPIO_PIN22_PAD_DRIVER_SET(x) WLAN_GPIO_PIN22_PAD_DRIVER_SET(x) -#define GPIO_PIN22_SOURCE_MSB WLAN_GPIO_PIN22_SOURCE_MSB -#define GPIO_PIN22_SOURCE_LSB WLAN_GPIO_PIN22_SOURCE_LSB -#define GPIO_PIN22_SOURCE_MASK WLAN_GPIO_PIN22_SOURCE_MASK -#define GPIO_PIN22_SOURCE_GET(x) WLAN_GPIO_PIN22_SOURCE_GET(x) -#define GPIO_PIN22_SOURCE_SET(x) WLAN_GPIO_PIN22_SOURCE_SET(x) -#define GPIO_PIN23_ADDRESS WLAN_GPIO_PIN23_ADDRESS -#define GPIO_PIN23_OFFSET WLAN_GPIO_PIN23_OFFSET -#define GPIO_PIN23_CONFIG_MSB WLAN_GPIO_PIN23_CONFIG_MSB -#define GPIO_PIN23_CONFIG_LSB WLAN_GPIO_PIN23_CONFIG_LSB -#define GPIO_PIN23_CONFIG_MASK WLAN_GPIO_PIN23_CONFIG_MASK -#define GPIO_PIN23_CONFIG_GET(x) WLAN_GPIO_PIN23_CONFIG_GET(x) -#define GPIO_PIN23_CONFIG_SET(x) WLAN_GPIO_PIN23_CONFIG_SET(x) -#define GPIO_PIN23_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN23_WAKEUP_ENABLE_MSB -#define GPIO_PIN23_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN23_WAKEUP_ENABLE_LSB -#define GPIO_PIN23_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN23_WAKEUP_ENABLE_MASK -#define GPIO_PIN23_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN23_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN23_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN23_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN23_INT_TYPE_MSB WLAN_GPIO_PIN23_INT_TYPE_MSB -#define GPIO_PIN23_INT_TYPE_LSB WLAN_GPIO_PIN23_INT_TYPE_LSB -#define GPIO_PIN23_INT_TYPE_MASK WLAN_GPIO_PIN23_INT_TYPE_MASK -#define GPIO_PIN23_INT_TYPE_GET(x) WLAN_GPIO_PIN23_INT_TYPE_GET(x) -#define GPIO_PIN23_INT_TYPE_SET(x) WLAN_GPIO_PIN23_INT_TYPE_SET(x) -#define GPIO_PIN23_PAD_PULL_MSB WLAN_GPIO_PIN23_PAD_PULL_MSB -#define GPIO_PIN23_PAD_PULL_LSB WLAN_GPIO_PIN23_PAD_PULL_LSB -#define GPIO_PIN23_PAD_PULL_MASK WLAN_GPIO_PIN23_PAD_PULL_MASK -#define GPIO_PIN23_PAD_PULL_GET(x) WLAN_GPIO_PIN23_PAD_PULL_GET(x) -#define GPIO_PIN23_PAD_PULL_SET(x) WLAN_GPIO_PIN23_PAD_PULL_SET(x) -#define GPIO_PIN23_PAD_STRENGTH_MSB WLAN_GPIO_PIN23_PAD_STRENGTH_MSB -#define GPIO_PIN23_PAD_STRENGTH_LSB WLAN_GPIO_PIN23_PAD_STRENGTH_LSB -#define GPIO_PIN23_PAD_STRENGTH_MASK WLAN_GPIO_PIN23_PAD_STRENGTH_MASK -#define GPIO_PIN23_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN23_PAD_STRENGTH_GET(x) -#define GPIO_PIN23_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN23_PAD_STRENGTH_SET(x) -#define GPIO_PIN23_PAD_DRIVER_MSB WLAN_GPIO_PIN23_PAD_DRIVER_MSB -#define GPIO_PIN23_PAD_DRIVER_LSB WLAN_GPIO_PIN23_PAD_DRIVER_LSB -#define GPIO_PIN23_PAD_DRIVER_MASK WLAN_GPIO_PIN23_PAD_DRIVER_MASK -#define GPIO_PIN23_PAD_DRIVER_GET(x) WLAN_GPIO_PIN23_PAD_DRIVER_GET(x) -#define GPIO_PIN23_PAD_DRIVER_SET(x) WLAN_GPIO_PIN23_PAD_DRIVER_SET(x) -#define GPIO_PIN23_SOURCE_MSB WLAN_GPIO_PIN23_SOURCE_MSB -#define GPIO_PIN23_SOURCE_LSB WLAN_GPIO_PIN23_SOURCE_LSB -#define GPIO_PIN23_SOURCE_MASK WLAN_GPIO_PIN23_SOURCE_MASK -#define GPIO_PIN23_SOURCE_GET(x) WLAN_GPIO_PIN23_SOURCE_GET(x) -#define GPIO_PIN23_SOURCE_SET(x) WLAN_GPIO_PIN23_SOURCE_SET(x) -#define GPIO_PIN24_ADDRESS WLAN_GPIO_PIN24_ADDRESS -#define GPIO_PIN24_OFFSET WLAN_GPIO_PIN24_OFFSET -#define GPIO_PIN24_CONFIG_MSB WLAN_GPIO_PIN24_CONFIG_MSB -#define GPIO_PIN24_CONFIG_LSB WLAN_GPIO_PIN24_CONFIG_LSB -#define GPIO_PIN24_CONFIG_MASK WLAN_GPIO_PIN24_CONFIG_MASK -#define GPIO_PIN24_CONFIG_GET(x) WLAN_GPIO_PIN24_CONFIG_GET(x) -#define GPIO_PIN24_CONFIG_SET(x) WLAN_GPIO_PIN24_CONFIG_SET(x) -#define GPIO_PIN24_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN24_WAKEUP_ENABLE_MSB -#define GPIO_PIN24_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN24_WAKEUP_ENABLE_LSB -#define GPIO_PIN24_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN24_WAKEUP_ENABLE_MASK -#define GPIO_PIN24_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN24_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN24_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN24_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN24_INT_TYPE_MSB WLAN_GPIO_PIN24_INT_TYPE_MSB -#define GPIO_PIN24_INT_TYPE_LSB WLAN_GPIO_PIN24_INT_TYPE_LSB -#define GPIO_PIN24_INT_TYPE_MASK WLAN_GPIO_PIN24_INT_TYPE_MASK -#define GPIO_PIN24_INT_TYPE_GET(x) WLAN_GPIO_PIN24_INT_TYPE_GET(x) -#define GPIO_PIN24_INT_TYPE_SET(x) WLAN_GPIO_PIN24_INT_TYPE_SET(x) -#define GPIO_PIN24_PAD_PULL_MSB WLAN_GPIO_PIN24_PAD_PULL_MSB -#define GPIO_PIN24_PAD_PULL_LSB WLAN_GPIO_PIN24_PAD_PULL_LSB -#define GPIO_PIN24_PAD_PULL_MASK WLAN_GPIO_PIN24_PAD_PULL_MASK -#define GPIO_PIN24_PAD_PULL_GET(x) WLAN_GPIO_PIN24_PAD_PULL_GET(x) -#define GPIO_PIN24_PAD_PULL_SET(x) WLAN_GPIO_PIN24_PAD_PULL_SET(x) -#define GPIO_PIN24_PAD_STRENGTH_MSB WLAN_GPIO_PIN24_PAD_STRENGTH_MSB -#define GPIO_PIN24_PAD_STRENGTH_LSB WLAN_GPIO_PIN24_PAD_STRENGTH_LSB -#define GPIO_PIN24_PAD_STRENGTH_MASK WLAN_GPIO_PIN24_PAD_STRENGTH_MASK -#define GPIO_PIN24_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN24_PAD_STRENGTH_GET(x) -#define GPIO_PIN24_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN24_PAD_STRENGTH_SET(x) -#define GPIO_PIN24_PAD_DRIVER_MSB WLAN_GPIO_PIN24_PAD_DRIVER_MSB -#define GPIO_PIN24_PAD_DRIVER_LSB WLAN_GPIO_PIN24_PAD_DRIVER_LSB -#define GPIO_PIN24_PAD_DRIVER_MASK WLAN_GPIO_PIN24_PAD_DRIVER_MASK -#define GPIO_PIN24_PAD_DRIVER_GET(x) WLAN_GPIO_PIN24_PAD_DRIVER_GET(x) -#define GPIO_PIN24_PAD_DRIVER_SET(x) WLAN_GPIO_PIN24_PAD_DRIVER_SET(x) -#define GPIO_PIN24_SOURCE_MSB WLAN_GPIO_PIN24_SOURCE_MSB -#define GPIO_PIN24_SOURCE_LSB WLAN_GPIO_PIN24_SOURCE_LSB -#define GPIO_PIN24_SOURCE_MASK WLAN_GPIO_PIN24_SOURCE_MASK -#define GPIO_PIN24_SOURCE_GET(x) WLAN_GPIO_PIN24_SOURCE_GET(x) -#define GPIO_PIN24_SOURCE_SET(x) WLAN_GPIO_PIN24_SOURCE_SET(x) -#define GPIO_PIN25_ADDRESS WLAN_GPIO_PIN25_ADDRESS -#define GPIO_PIN25_OFFSET WLAN_GPIO_PIN25_OFFSET -#define GPIO_PIN25_CONFIG_MSB WLAN_GPIO_PIN25_CONFIG_MSB -#define GPIO_PIN25_CONFIG_LSB WLAN_GPIO_PIN25_CONFIG_LSB -#define GPIO_PIN25_CONFIG_MASK WLAN_GPIO_PIN25_CONFIG_MASK -#define GPIO_PIN25_CONFIG_GET(x) WLAN_GPIO_PIN25_CONFIG_GET(x) -#define GPIO_PIN25_CONFIG_SET(x) WLAN_GPIO_PIN25_CONFIG_SET(x) -#define GPIO_PIN25_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN25_WAKEUP_ENABLE_MSB -#define GPIO_PIN25_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN25_WAKEUP_ENABLE_LSB -#define GPIO_PIN25_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN25_WAKEUP_ENABLE_MASK -#define GPIO_PIN25_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN25_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN25_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN25_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN25_INT_TYPE_MSB WLAN_GPIO_PIN25_INT_TYPE_MSB -#define GPIO_PIN25_INT_TYPE_LSB WLAN_GPIO_PIN25_INT_TYPE_LSB -#define GPIO_PIN25_INT_TYPE_MASK WLAN_GPIO_PIN25_INT_TYPE_MASK -#define GPIO_PIN25_INT_TYPE_GET(x) WLAN_GPIO_PIN25_INT_TYPE_GET(x) -#define GPIO_PIN25_INT_TYPE_SET(x) WLAN_GPIO_PIN25_INT_TYPE_SET(x) -#define GPIO_PIN25_PAD_PULL_MSB WLAN_GPIO_PIN25_PAD_PULL_MSB -#define GPIO_PIN25_PAD_PULL_LSB WLAN_GPIO_PIN25_PAD_PULL_LSB -#define GPIO_PIN25_PAD_PULL_MASK WLAN_GPIO_PIN25_PAD_PULL_MASK -#define GPIO_PIN25_PAD_PULL_GET(x) WLAN_GPIO_PIN25_PAD_PULL_GET(x) -#define GPIO_PIN25_PAD_PULL_SET(x) WLAN_GPIO_PIN25_PAD_PULL_SET(x) -#define GPIO_PIN25_PAD_STRENGTH_MSB WLAN_GPIO_PIN25_PAD_STRENGTH_MSB -#define GPIO_PIN25_PAD_STRENGTH_LSB WLAN_GPIO_PIN25_PAD_STRENGTH_LSB -#define GPIO_PIN25_PAD_STRENGTH_MASK WLAN_GPIO_PIN25_PAD_STRENGTH_MASK -#define GPIO_PIN25_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN25_PAD_STRENGTH_GET(x) -#define GPIO_PIN25_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN25_PAD_STRENGTH_SET(x) -#define GPIO_PIN25_PAD_DRIVER_MSB WLAN_GPIO_PIN25_PAD_DRIVER_MSB -#define GPIO_PIN25_PAD_DRIVER_LSB WLAN_GPIO_PIN25_PAD_DRIVER_LSB -#define GPIO_PIN25_PAD_DRIVER_MASK WLAN_GPIO_PIN25_PAD_DRIVER_MASK -#define GPIO_PIN25_PAD_DRIVER_GET(x) WLAN_GPIO_PIN25_PAD_DRIVER_GET(x) -#define GPIO_PIN25_PAD_DRIVER_SET(x) WLAN_GPIO_PIN25_PAD_DRIVER_SET(x) -#define GPIO_PIN25_SOURCE_MSB WLAN_GPIO_PIN25_SOURCE_MSB -#define GPIO_PIN25_SOURCE_LSB WLAN_GPIO_PIN25_SOURCE_LSB -#define GPIO_PIN25_SOURCE_MASK WLAN_GPIO_PIN25_SOURCE_MASK -#define GPIO_PIN25_SOURCE_GET(x) WLAN_GPIO_PIN25_SOURCE_GET(x) -#define GPIO_PIN25_SOURCE_SET(x) WLAN_GPIO_PIN25_SOURCE_SET(x) -#define GPIO_PIN26_ADDRESS WLAN_GPIO_PIN26_ADDRESS -#define GPIO_PIN26_OFFSET WLAN_GPIO_PIN26_OFFSET -#define GPIO_PIN26_CONFIG_MSB WLAN_GPIO_PIN26_CONFIG_MSB -#define GPIO_PIN26_CONFIG_LSB WLAN_GPIO_PIN26_CONFIG_LSB -#define GPIO_PIN26_CONFIG_MASK WLAN_GPIO_PIN26_CONFIG_MASK -#define GPIO_PIN26_CONFIG_GET(x) WLAN_GPIO_PIN26_CONFIG_GET(x) -#define GPIO_PIN26_CONFIG_SET(x) WLAN_GPIO_PIN26_CONFIG_SET(x) -#define GPIO_PIN26_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN26_WAKEUP_ENABLE_MSB -#define GPIO_PIN26_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN26_WAKEUP_ENABLE_LSB -#define GPIO_PIN26_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN26_WAKEUP_ENABLE_MASK -#define GPIO_PIN26_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN26_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN26_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN26_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN26_INT_TYPE_MSB WLAN_GPIO_PIN26_INT_TYPE_MSB -#define GPIO_PIN26_INT_TYPE_LSB WLAN_GPIO_PIN26_INT_TYPE_LSB -#define GPIO_PIN26_INT_TYPE_MASK WLAN_GPIO_PIN26_INT_TYPE_MASK -#define GPIO_PIN26_INT_TYPE_GET(x) WLAN_GPIO_PIN26_INT_TYPE_GET(x) -#define GPIO_PIN26_INT_TYPE_SET(x) WLAN_GPIO_PIN26_INT_TYPE_SET(x) -#define GPIO_PIN26_PAD_PULL_MSB WLAN_GPIO_PIN26_PAD_PULL_MSB -#define GPIO_PIN26_PAD_PULL_LSB WLAN_GPIO_PIN26_PAD_PULL_LSB -#define GPIO_PIN26_PAD_PULL_MASK WLAN_GPIO_PIN26_PAD_PULL_MASK -#define GPIO_PIN26_PAD_PULL_GET(x) WLAN_GPIO_PIN26_PAD_PULL_GET(x) -#define GPIO_PIN26_PAD_PULL_SET(x) WLAN_GPIO_PIN26_PAD_PULL_SET(x) -#define GPIO_PIN26_PAD_STRENGTH_MSB WLAN_GPIO_PIN26_PAD_STRENGTH_MSB -#define GPIO_PIN26_PAD_STRENGTH_LSB WLAN_GPIO_PIN26_PAD_STRENGTH_LSB -#define GPIO_PIN26_PAD_STRENGTH_MASK WLAN_GPIO_PIN26_PAD_STRENGTH_MASK -#define GPIO_PIN26_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN26_PAD_STRENGTH_GET(x) -#define GPIO_PIN26_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN26_PAD_STRENGTH_SET(x) -#define GPIO_PIN26_PAD_DRIVER_MSB WLAN_GPIO_PIN26_PAD_DRIVER_MSB -#define GPIO_PIN26_PAD_DRIVER_LSB WLAN_GPIO_PIN26_PAD_DRIVER_LSB -#define GPIO_PIN26_PAD_DRIVER_MASK WLAN_GPIO_PIN26_PAD_DRIVER_MASK -#define GPIO_PIN26_PAD_DRIVER_GET(x) WLAN_GPIO_PIN26_PAD_DRIVER_GET(x) -#define GPIO_PIN26_PAD_DRIVER_SET(x) WLAN_GPIO_PIN26_PAD_DRIVER_SET(x) -#define GPIO_PIN26_SOURCE_MSB WLAN_GPIO_PIN26_SOURCE_MSB -#define GPIO_PIN26_SOURCE_LSB WLAN_GPIO_PIN26_SOURCE_LSB -#define GPIO_PIN26_SOURCE_MASK WLAN_GPIO_PIN26_SOURCE_MASK -#define GPIO_PIN26_SOURCE_GET(x) WLAN_GPIO_PIN26_SOURCE_GET(x) -#define GPIO_PIN26_SOURCE_SET(x) WLAN_GPIO_PIN26_SOURCE_SET(x) -#define GPIO_PIN27_ADDRESS WLAN_GPIO_PIN27_ADDRESS -#define GPIO_PIN27_OFFSET WLAN_GPIO_PIN27_OFFSET -#define GPIO_PIN27_CONFIG_MSB WLAN_GPIO_PIN27_CONFIG_MSB -#define GPIO_PIN27_CONFIG_LSB WLAN_GPIO_PIN27_CONFIG_LSB -#define GPIO_PIN27_CONFIG_MASK WLAN_GPIO_PIN27_CONFIG_MASK -#define GPIO_PIN27_CONFIG_GET(x) WLAN_GPIO_PIN27_CONFIG_GET(x) -#define GPIO_PIN27_CONFIG_SET(x) WLAN_GPIO_PIN27_CONFIG_SET(x) -#define GPIO_PIN27_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN27_WAKEUP_ENABLE_MSB -#define GPIO_PIN27_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN27_WAKEUP_ENABLE_LSB -#define GPIO_PIN27_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN27_WAKEUP_ENABLE_MASK -#define GPIO_PIN27_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN27_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN27_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN27_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN27_INT_TYPE_MSB WLAN_GPIO_PIN27_INT_TYPE_MSB -#define GPIO_PIN27_INT_TYPE_LSB WLAN_GPIO_PIN27_INT_TYPE_LSB -#define GPIO_PIN27_INT_TYPE_MASK WLAN_GPIO_PIN27_INT_TYPE_MASK -#define GPIO_PIN27_INT_TYPE_GET(x) WLAN_GPIO_PIN27_INT_TYPE_GET(x) -#define GPIO_PIN27_INT_TYPE_SET(x) WLAN_GPIO_PIN27_INT_TYPE_SET(x) -#define GPIO_PIN27_PAD_PULL_MSB WLAN_GPIO_PIN27_PAD_PULL_MSB -#define GPIO_PIN27_PAD_PULL_LSB WLAN_GPIO_PIN27_PAD_PULL_LSB -#define GPIO_PIN27_PAD_PULL_MASK WLAN_GPIO_PIN27_PAD_PULL_MASK -#define GPIO_PIN27_PAD_PULL_GET(x) WLAN_GPIO_PIN27_PAD_PULL_GET(x) -#define GPIO_PIN27_PAD_PULL_SET(x) WLAN_GPIO_PIN27_PAD_PULL_SET(x) -#define GPIO_PIN27_PAD_STRENGTH_MSB WLAN_GPIO_PIN27_PAD_STRENGTH_MSB -#define GPIO_PIN27_PAD_STRENGTH_LSB WLAN_GPIO_PIN27_PAD_STRENGTH_LSB -#define GPIO_PIN27_PAD_STRENGTH_MASK WLAN_GPIO_PIN27_PAD_STRENGTH_MASK -#define GPIO_PIN27_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN27_PAD_STRENGTH_GET(x) -#define GPIO_PIN27_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN27_PAD_STRENGTH_SET(x) -#define GPIO_PIN27_PAD_DRIVER_MSB WLAN_GPIO_PIN27_PAD_DRIVER_MSB -#define GPIO_PIN27_PAD_DRIVER_LSB WLAN_GPIO_PIN27_PAD_DRIVER_LSB -#define GPIO_PIN27_PAD_DRIVER_MASK WLAN_GPIO_PIN27_PAD_DRIVER_MASK -#define GPIO_PIN27_PAD_DRIVER_GET(x) WLAN_GPIO_PIN27_PAD_DRIVER_GET(x) -#define GPIO_PIN27_PAD_DRIVER_SET(x) WLAN_GPIO_PIN27_PAD_DRIVER_SET(x) -#define GPIO_PIN27_SOURCE_MSB WLAN_GPIO_PIN27_SOURCE_MSB -#define GPIO_PIN27_SOURCE_LSB WLAN_GPIO_PIN27_SOURCE_LSB -#define GPIO_PIN27_SOURCE_MASK WLAN_GPIO_PIN27_SOURCE_MASK -#define GPIO_PIN27_SOURCE_GET(x) WLAN_GPIO_PIN27_SOURCE_GET(x) -#define GPIO_PIN27_SOURCE_SET(x) WLAN_GPIO_PIN27_SOURCE_SET(x) -#define GPIO_PIN28_ADDRESS WLAN_GPIO_PIN28_ADDRESS -#define GPIO_PIN28_OFFSET WLAN_GPIO_PIN28_OFFSET -#define GPIO_PIN28_CONFIG_MSB WLAN_GPIO_PIN28_CONFIG_MSB -#define GPIO_PIN28_CONFIG_LSB WLAN_GPIO_PIN28_CONFIG_LSB -#define GPIO_PIN28_CONFIG_MASK WLAN_GPIO_PIN28_CONFIG_MASK -#define GPIO_PIN28_CONFIG_GET(x) WLAN_GPIO_PIN28_CONFIG_GET(x) -#define GPIO_PIN28_CONFIG_SET(x) WLAN_GPIO_PIN28_CONFIG_SET(x) -#define GPIO_PIN28_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN28_WAKEUP_ENABLE_MSB -#define GPIO_PIN28_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN28_WAKEUP_ENABLE_LSB -#define GPIO_PIN28_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN28_WAKEUP_ENABLE_MASK -#define GPIO_PIN28_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN28_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN28_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN28_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN28_INT_TYPE_MSB WLAN_GPIO_PIN28_INT_TYPE_MSB -#define GPIO_PIN28_INT_TYPE_LSB WLAN_GPIO_PIN28_INT_TYPE_LSB -#define GPIO_PIN28_INT_TYPE_MASK WLAN_GPIO_PIN28_INT_TYPE_MASK -#define GPIO_PIN28_INT_TYPE_GET(x) WLAN_GPIO_PIN28_INT_TYPE_GET(x) -#define GPIO_PIN28_INT_TYPE_SET(x) WLAN_GPIO_PIN28_INT_TYPE_SET(x) -#define GPIO_PIN28_PAD_PULL_MSB WLAN_GPIO_PIN28_PAD_PULL_MSB -#define GPIO_PIN28_PAD_PULL_LSB WLAN_GPIO_PIN28_PAD_PULL_LSB -#define GPIO_PIN28_PAD_PULL_MASK WLAN_GPIO_PIN28_PAD_PULL_MASK -#define GPIO_PIN28_PAD_PULL_GET(x) WLAN_GPIO_PIN28_PAD_PULL_GET(x) -#define GPIO_PIN28_PAD_PULL_SET(x) WLAN_GPIO_PIN28_PAD_PULL_SET(x) -#define GPIO_PIN28_PAD_STRENGTH_MSB WLAN_GPIO_PIN28_PAD_STRENGTH_MSB -#define GPIO_PIN28_PAD_STRENGTH_LSB WLAN_GPIO_PIN28_PAD_STRENGTH_LSB -#define GPIO_PIN28_PAD_STRENGTH_MASK WLAN_GPIO_PIN28_PAD_STRENGTH_MASK -#define GPIO_PIN28_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN28_PAD_STRENGTH_GET(x) -#define GPIO_PIN28_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN28_PAD_STRENGTH_SET(x) -#define GPIO_PIN28_PAD_DRIVER_MSB WLAN_GPIO_PIN28_PAD_DRIVER_MSB -#define GPIO_PIN28_PAD_DRIVER_LSB WLAN_GPIO_PIN28_PAD_DRIVER_LSB -#define GPIO_PIN28_PAD_DRIVER_MASK WLAN_GPIO_PIN28_PAD_DRIVER_MASK -#define GPIO_PIN28_PAD_DRIVER_GET(x) WLAN_GPIO_PIN28_PAD_DRIVER_GET(x) -#define GPIO_PIN28_PAD_DRIVER_SET(x) WLAN_GPIO_PIN28_PAD_DRIVER_SET(x) -#define GPIO_PIN28_SOURCE_MSB WLAN_GPIO_PIN28_SOURCE_MSB -#define GPIO_PIN28_SOURCE_LSB WLAN_GPIO_PIN28_SOURCE_LSB -#define GPIO_PIN28_SOURCE_MASK WLAN_GPIO_PIN28_SOURCE_MASK -#define GPIO_PIN28_SOURCE_GET(x) WLAN_GPIO_PIN28_SOURCE_GET(x) -#define GPIO_PIN28_SOURCE_SET(x) WLAN_GPIO_PIN28_SOURCE_SET(x) -#define GPIO_PIN29_ADDRESS WLAN_GPIO_PIN29_ADDRESS -#define GPIO_PIN29_OFFSET WLAN_GPIO_PIN29_OFFSET -#define GPIO_PIN29_CONFIG_MSB WLAN_GPIO_PIN29_CONFIG_MSB -#define GPIO_PIN29_CONFIG_LSB WLAN_GPIO_PIN29_CONFIG_LSB -#define GPIO_PIN29_CONFIG_MASK WLAN_GPIO_PIN29_CONFIG_MASK -#define GPIO_PIN29_CONFIG_GET(x) WLAN_GPIO_PIN29_CONFIG_GET(x) -#define GPIO_PIN29_CONFIG_SET(x) WLAN_GPIO_PIN29_CONFIG_SET(x) -#define GPIO_PIN29_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN29_WAKEUP_ENABLE_MSB -#define GPIO_PIN29_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN29_WAKEUP_ENABLE_LSB -#define GPIO_PIN29_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN29_WAKEUP_ENABLE_MASK -#define GPIO_PIN29_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN29_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN29_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN29_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN29_INT_TYPE_MSB WLAN_GPIO_PIN29_INT_TYPE_MSB -#define GPIO_PIN29_INT_TYPE_LSB WLAN_GPIO_PIN29_INT_TYPE_LSB -#define GPIO_PIN29_INT_TYPE_MASK WLAN_GPIO_PIN29_INT_TYPE_MASK -#define GPIO_PIN29_INT_TYPE_GET(x) WLAN_GPIO_PIN29_INT_TYPE_GET(x) -#define GPIO_PIN29_INT_TYPE_SET(x) WLAN_GPIO_PIN29_INT_TYPE_SET(x) -#define GPIO_PIN29_PAD_PULL_MSB WLAN_GPIO_PIN29_PAD_PULL_MSB -#define GPIO_PIN29_PAD_PULL_LSB WLAN_GPIO_PIN29_PAD_PULL_LSB -#define GPIO_PIN29_PAD_PULL_MASK WLAN_GPIO_PIN29_PAD_PULL_MASK -#define GPIO_PIN29_PAD_PULL_GET(x) WLAN_GPIO_PIN29_PAD_PULL_GET(x) -#define GPIO_PIN29_PAD_PULL_SET(x) WLAN_GPIO_PIN29_PAD_PULL_SET(x) -#define GPIO_PIN29_PAD_STRENGTH_MSB WLAN_GPIO_PIN29_PAD_STRENGTH_MSB -#define GPIO_PIN29_PAD_STRENGTH_LSB WLAN_GPIO_PIN29_PAD_STRENGTH_LSB -#define GPIO_PIN29_PAD_STRENGTH_MASK WLAN_GPIO_PIN29_PAD_STRENGTH_MASK -#define GPIO_PIN29_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN29_PAD_STRENGTH_GET(x) -#define GPIO_PIN29_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN29_PAD_STRENGTH_SET(x) -#define GPIO_PIN29_PAD_DRIVER_MSB WLAN_GPIO_PIN29_PAD_DRIVER_MSB -#define GPIO_PIN29_PAD_DRIVER_LSB WLAN_GPIO_PIN29_PAD_DRIVER_LSB -#define GPIO_PIN29_PAD_DRIVER_MASK WLAN_GPIO_PIN29_PAD_DRIVER_MASK -#define GPIO_PIN29_PAD_DRIVER_GET(x) WLAN_GPIO_PIN29_PAD_DRIVER_GET(x) -#define GPIO_PIN29_PAD_DRIVER_SET(x) WLAN_GPIO_PIN29_PAD_DRIVER_SET(x) -#define GPIO_PIN29_SOURCE_MSB WLAN_GPIO_PIN29_SOURCE_MSB -#define GPIO_PIN29_SOURCE_LSB WLAN_GPIO_PIN29_SOURCE_LSB -#define GPIO_PIN29_SOURCE_MASK WLAN_GPIO_PIN29_SOURCE_MASK -#define GPIO_PIN29_SOURCE_GET(x) WLAN_GPIO_PIN29_SOURCE_GET(x) -#define GPIO_PIN29_SOURCE_SET(x) WLAN_GPIO_PIN29_SOURCE_SET(x) -#define GPIO_PIN30_ADDRESS WLAN_GPIO_PIN30_ADDRESS -#define GPIO_PIN30_OFFSET WLAN_GPIO_PIN30_OFFSET -#define GPIO_PIN30_CONFIG_MSB WLAN_GPIO_PIN30_CONFIG_MSB -#define GPIO_PIN30_CONFIG_LSB WLAN_GPIO_PIN30_CONFIG_LSB -#define GPIO_PIN30_CONFIG_MASK WLAN_GPIO_PIN30_CONFIG_MASK -#define GPIO_PIN30_CONFIG_GET(x) WLAN_GPIO_PIN30_CONFIG_GET(x) -#define GPIO_PIN30_CONFIG_SET(x) WLAN_GPIO_PIN30_CONFIG_SET(x) -#define GPIO_PIN30_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN30_WAKEUP_ENABLE_MSB -#define GPIO_PIN30_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN30_WAKEUP_ENABLE_LSB -#define GPIO_PIN30_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN30_WAKEUP_ENABLE_MASK -#define GPIO_PIN30_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN30_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN30_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN30_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN30_INT_TYPE_MSB WLAN_GPIO_PIN30_INT_TYPE_MSB -#define GPIO_PIN30_INT_TYPE_LSB WLAN_GPIO_PIN30_INT_TYPE_LSB -#define GPIO_PIN30_INT_TYPE_MASK WLAN_GPIO_PIN30_INT_TYPE_MASK -#define GPIO_PIN30_INT_TYPE_GET(x) WLAN_GPIO_PIN30_INT_TYPE_GET(x) -#define GPIO_PIN30_INT_TYPE_SET(x) WLAN_GPIO_PIN30_INT_TYPE_SET(x) -#define GPIO_PIN30_PAD_PULL_MSB WLAN_GPIO_PIN30_PAD_PULL_MSB -#define GPIO_PIN30_PAD_PULL_LSB WLAN_GPIO_PIN30_PAD_PULL_LSB -#define GPIO_PIN30_PAD_PULL_MASK WLAN_GPIO_PIN30_PAD_PULL_MASK -#define GPIO_PIN30_PAD_PULL_GET(x) WLAN_GPIO_PIN30_PAD_PULL_GET(x) -#define GPIO_PIN30_PAD_PULL_SET(x) WLAN_GPIO_PIN30_PAD_PULL_SET(x) -#define GPIO_PIN30_PAD_STRENGTH_MSB WLAN_GPIO_PIN30_PAD_STRENGTH_MSB -#define GPIO_PIN30_PAD_STRENGTH_LSB WLAN_GPIO_PIN30_PAD_STRENGTH_LSB -#define GPIO_PIN30_PAD_STRENGTH_MASK WLAN_GPIO_PIN30_PAD_STRENGTH_MASK -#define GPIO_PIN30_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN30_PAD_STRENGTH_GET(x) -#define GPIO_PIN30_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN30_PAD_STRENGTH_SET(x) -#define GPIO_PIN30_PAD_DRIVER_MSB WLAN_GPIO_PIN30_PAD_DRIVER_MSB -#define GPIO_PIN30_PAD_DRIVER_LSB WLAN_GPIO_PIN30_PAD_DRIVER_LSB -#define GPIO_PIN30_PAD_DRIVER_MASK WLAN_GPIO_PIN30_PAD_DRIVER_MASK -#define GPIO_PIN30_PAD_DRIVER_GET(x) WLAN_GPIO_PIN30_PAD_DRIVER_GET(x) -#define GPIO_PIN30_PAD_DRIVER_SET(x) WLAN_GPIO_PIN30_PAD_DRIVER_SET(x) -#define GPIO_PIN30_SOURCE_MSB WLAN_GPIO_PIN30_SOURCE_MSB -#define GPIO_PIN30_SOURCE_LSB WLAN_GPIO_PIN30_SOURCE_LSB -#define GPIO_PIN30_SOURCE_MASK WLAN_GPIO_PIN30_SOURCE_MASK -#define GPIO_PIN30_SOURCE_GET(x) WLAN_GPIO_PIN30_SOURCE_GET(x) -#define GPIO_PIN30_SOURCE_SET(x) WLAN_GPIO_PIN30_SOURCE_SET(x) -#define GPIO_PIN31_ADDRESS WLAN_GPIO_PIN31_ADDRESS -#define GPIO_PIN31_OFFSET WLAN_GPIO_PIN31_OFFSET -#define GPIO_PIN31_CONFIG_MSB WLAN_GPIO_PIN31_CONFIG_MSB -#define GPIO_PIN31_CONFIG_LSB WLAN_GPIO_PIN31_CONFIG_LSB -#define GPIO_PIN31_CONFIG_MASK WLAN_GPIO_PIN31_CONFIG_MASK -#define GPIO_PIN31_CONFIG_GET(x) WLAN_GPIO_PIN31_CONFIG_GET(x) -#define GPIO_PIN31_CONFIG_SET(x) WLAN_GPIO_PIN31_CONFIG_SET(x) -#define GPIO_PIN31_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN31_WAKEUP_ENABLE_MSB -#define GPIO_PIN31_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN31_WAKEUP_ENABLE_LSB -#define GPIO_PIN31_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN31_WAKEUP_ENABLE_MASK -#define GPIO_PIN31_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN31_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN31_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN31_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN31_INT_TYPE_MSB WLAN_GPIO_PIN31_INT_TYPE_MSB -#define GPIO_PIN31_INT_TYPE_LSB WLAN_GPIO_PIN31_INT_TYPE_LSB -#define GPIO_PIN31_INT_TYPE_MASK WLAN_GPIO_PIN31_INT_TYPE_MASK -#define GPIO_PIN31_INT_TYPE_GET(x) WLAN_GPIO_PIN31_INT_TYPE_GET(x) -#define GPIO_PIN31_INT_TYPE_SET(x) WLAN_GPIO_PIN31_INT_TYPE_SET(x) -#define GPIO_PIN31_PAD_PULL_MSB WLAN_GPIO_PIN31_PAD_PULL_MSB -#define GPIO_PIN31_PAD_PULL_LSB WLAN_GPIO_PIN31_PAD_PULL_LSB -#define GPIO_PIN31_PAD_PULL_MASK WLAN_GPIO_PIN31_PAD_PULL_MASK -#define GPIO_PIN31_PAD_PULL_GET(x) WLAN_GPIO_PIN31_PAD_PULL_GET(x) -#define GPIO_PIN31_PAD_PULL_SET(x) WLAN_GPIO_PIN31_PAD_PULL_SET(x) -#define GPIO_PIN31_PAD_STRENGTH_MSB WLAN_GPIO_PIN31_PAD_STRENGTH_MSB -#define GPIO_PIN31_PAD_STRENGTH_LSB WLAN_GPIO_PIN31_PAD_STRENGTH_LSB -#define GPIO_PIN31_PAD_STRENGTH_MASK WLAN_GPIO_PIN31_PAD_STRENGTH_MASK -#define GPIO_PIN31_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN31_PAD_STRENGTH_GET(x) -#define GPIO_PIN31_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN31_PAD_STRENGTH_SET(x) -#define GPIO_PIN31_PAD_DRIVER_MSB WLAN_GPIO_PIN31_PAD_DRIVER_MSB -#define GPIO_PIN31_PAD_DRIVER_LSB WLAN_GPIO_PIN31_PAD_DRIVER_LSB -#define GPIO_PIN31_PAD_DRIVER_MASK WLAN_GPIO_PIN31_PAD_DRIVER_MASK -#define GPIO_PIN31_PAD_DRIVER_GET(x) WLAN_GPIO_PIN31_PAD_DRIVER_GET(x) -#define GPIO_PIN31_PAD_DRIVER_SET(x) WLAN_GPIO_PIN31_PAD_DRIVER_SET(x) -#define GPIO_PIN31_SOURCE_MSB WLAN_GPIO_PIN31_SOURCE_MSB -#define GPIO_PIN31_SOURCE_LSB WLAN_GPIO_PIN31_SOURCE_LSB -#define GPIO_PIN31_SOURCE_MASK WLAN_GPIO_PIN31_SOURCE_MASK -#define GPIO_PIN31_SOURCE_GET(x) WLAN_GPIO_PIN31_SOURCE_GET(x) -#define GPIO_PIN31_SOURCE_SET(x) WLAN_GPIO_PIN31_SOURCE_SET(x) -#define GPIO_PIN32_ADDRESS WLAN_GPIO_PIN32_ADDRESS -#define GPIO_PIN32_OFFSET WLAN_GPIO_PIN32_OFFSET -#define GPIO_PIN32_CONFIG_MSB WLAN_GPIO_PIN32_CONFIG_MSB -#define GPIO_PIN32_CONFIG_LSB WLAN_GPIO_PIN32_CONFIG_LSB -#define GPIO_PIN32_CONFIG_MASK WLAN_GPIO_PIN32_CONFIG_MASK -#define GPIO_PIN32_CONFIG_GET(x) WLAN_GPIO_PIN32_CONFIG_GET(x) -#define GPIO_PIN32_CONFIG_SET(x) WLAN_GPIO_PIN32_CONFIG_SET(x) -#define GPIO_PIN32_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN32_WAKEUP_ENABLE_MSB -#define GPIO_PIN32_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN32_WAKEUP_ENABLE_LSB -#define GPIO_PIN32_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN32_WAKEUP_ENABLE_MASK -#define GPIO_PIN32_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN32_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN32_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN32_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN32_INT_TYPE_MSB WLAN_GPIO_PIN32_INT_TYPE_MSB -#define GPIO_PIN32_INT_TYPE_LSB WLAN_GPIO_PIN32_INT_TYPE_LSB -#define GPIO_PIN32_INT_TYPE_MASK WLAN_GPIO_PIN32_INT_TYPE_MASK -#define GPIO_PIN32_INT_TYPE_GET(x) WLAN_GPIO_PIN32_INT_TYPE_GET(x) -#define GPIO_PIN32_INT_TYPE_SET(x) WLAN_GPIO_PIN32_INT_TYPE_SET(x) -#define GPIO_PIN32_PAD_PULL_MSB WLAN_GPIO_PIN32_PAD_PULL_MSB -#define GPIO_PIN32_PAD_PULL_LSB WLAN_GPIO_PIN32_PAD_PULL_LSB -#define GPIO_PIN32_PAD_PULL_MASK WLAN_GPIO_PIN32_PAD_PULL_MASK -#define GPIO_PIN32_PAD_PULL_GET(x) WLAN_GPIO_PIN32_PAD_PULL_GET(x) -#define GPIO_PIN32_PAD_PULL_SET(x) WLAN_GPIO_PIN32_PAD_PULL_SET(x) -#define GPIO_PIN32_PAD_STRENGTH_MSB WLAN_GPIO_PIN32_PAD_STRENGTH_MSB -#define GPIO_PIN32_PAD_STRENGTH_LSB WLAN_GPIO_PIN32_PAD_STRENGTH_LSB -#define GPIO_PIN32_PAD_STRENGTH_MASK WLAN_GPIO_PIN32_PAD_STRENGTH_MASK -#define GPIO_PIN32_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN32_PAD_STRENGTH_GET(x) -#define GPIO_PIN32_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN32_PAD_STRENGTH_SET(x) -#define GPIO_PIN32_PAD_DRIVER_MSB WLAN_GPIO_PIN32_PAD_DRIVER_MSB -#define GPIO_PIN32_PAD_DRIVER_LSB WLAN_GPIO_PIN32_PAD_DRIVER_LSB -#define GPIO_PIN32_PAD_DRIVER_MASK WLAN_GPIO_PIN32_PAD_DRIVER_MASK -#define GPIO_PIN32_PAD_DRIVER_GET(x) WLAN_GPIO_PIN32_PAD_DRIVER_GET(x) -#define GPIO_PIN32_PAD_DRIVER_SET(x) WLAN_GPIO_PIN32_PAD_DRIVER_SET(x) -#define GPIO_PIN32_SOURCE_MSB WLAN_GPIO_PIN32_SOURCE_MSB -#define GPIO_PIN32_SOURCE_LSB WLAN_GPIO_PIN32_SOURCE_LSB -#define GPIO_PIN32_SOURCE_MASK WLAN_GPIO_PIN32_SOURCE_MASK -#define GPIO_PIN32_SOURCE_GET(x) WLAN_GPIO_PIN32_SOURCE_GET(x) -#define GPIO_PIN32_SOURCE_SET(x) WLAN_GPIO_PIN32_SOURCE_SET(x) -#define GPIO_PIN33_ADDRESS WLAN_GPIO_PIN33_ADDRESS -#define GPIO_PIN33_OFFSET WLAN_GPIO_PIN33_OFFSET -#define GPIO_PIN33_CONFIG_MSB WLAN_GPIO_PIN33_CONFIG_MSB -#define GPIO_PIN33_CONFIG_LSB WLAN_GPIO_PIN33_CONFIG_LSB -#define GPIO_PIN33_CONFIG_MASK WLAN_GPIO_PIN33_CONFIG_MASK -#define GPIO_PIN33_CONFIG_GET(x) WLAN_GPIO_PIN33_CONFIG_GET(x) -#define GPIO_PIN33_CONFIG_SET(x) WLAN_GPIO_PIN33_CONFIG_SET(x) -#define GPIO_PIN33_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN33_WAKEUP_ENABLE_MSB -#define GPIO_PIN33_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN33_WAKEUP_ENABLE_LSB -#define GPIO_PIN33_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN33_WAKEUP_ENABLE_MASK -#define GPIO_PIN33_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN33_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN33_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN33_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN33_INT_TYPE_MSB WLAN_GPIO_PIN33_INT_TYPE_MSB -#define GPIO_PIN33_INT_TYPE_LSB WLAN_GPIO_PIN33_INT_TYPE_LSB -#define GPIO_PIN33_INT_TYPE_MASK WLAN_GPIO_PIN33_INT_TYPE_MASK -#define GPIO_PIN33_INT_TYPE_GET(x) WLAN_GPIO_PIN33_INT_TYPE_GET(x) -#define GPIO_PIN33_INT_TYPE_SET(x) WLAN_GPIO_PIN33_INT_TYPE_SET(x) -#define GPIO_PIN33_PAD_PULL_MSB WLAN_GPIO_PIN33_PAD_PULL_MSB -#define GPIO_PIN33_PAD_PULL_LSB WLAN_GPIO_PIN33_PAD_PULL_LSB -#define GPIO_PIN33_PAD_PULL_MASK WLAN_GPIO_PIN33_PAD_PULL_MASK -#define GPIO_PIN33_PAD_PULL_GET(x) WLAN_GPIO_PIN33_PAD_PULL_GET(x) -#define GPIO_PIN33_PAD_PULL_SET(x) WLAN_GPIO_PIN33_PAD_PULL_SET(x) -#define GPIO_PIN33_PAD_STRENGTH_MSB WLAN_GPIO_PIN33_PAD_STRENGTH_MSB -#define GPIO_PIN33_PAD_STRENGTH_LSB WLAN_GPIO_PIN33_PAD_STRENGTH_LSB -#define GPIO_PIN33_PAD_STRENGTH_MASK WLAN_GPIO_PIN33_PAD_STRENGTH_MASK -#define GPIO_PIN33_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN33_PAD_STRENGTH_GET(x) -#define GPIO_PIN33_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN33_PAD_STRENGTH_SET(x) -#define GPIO_PIN33_PAD_DRIVER_MSB WLAN_GPIO_PIN33_PAD_DRIVER_MSB -#define GPIO_PIN33_PAD_DRIVER_LSB WLAN_GPIO_PIN33_PAD_DRIVER_LSB -#define GPIO_PIN33_PAD_DRIVER_MASK WLAN_GPIO_PIN33_PAD_DRIVER_MASK -#define GPIO_PIN33_PAD_DRIVER_GET(x) WLAN_GPIO_PIN33_PAD_DRIVER_GET(x) -#define GPIO_PIN33_PAD_DRIVER_SET(x) WLAN_GPIO_PIN33_PAD_DRIVER_SET(x) -#define GPIO_PIN33_SOURCE_MSB WLAN_GPIO_PIN33_SOURCE_MSB -#define GPIO_PIN33_SOURCE_LSB WLAN_GPIO_PIN33_SOURCE_LSB -#define GPIO_PIN33_SOURCE_MASK WLAN_GPIO_PIN33_SOURCE_MASK -#define GPIO_PIN33_SOURCE_GET(x) WLAN_GPIO_PIN33_SOURCE_GET(x) -#define GPIO_PIN33_SOURCE_SET(x) WLAN_GPIO_PIN33_SOURCE_SET(x) -#define GPIO_PIN34_ADDRESS WLAN_GPIO_PIN34_ADDRESS -#define GPIO_PIN34_OFFSET WLAN_GPIO_PIN34_OFFSET -#define GPIO_PIN34_CONFIG_MSB WLAN_GPIO_PIN34_CONFIG_MSB -#define GPIO_PIN34_CONFIG_LSB WLAN_GPIO_PIN34_CONFIG_LSB -#define GPIO_PIN34_CONFIG_MASK WLAN_GPIO_PIN34_CONFIG_MASK -#define GPIO_PIN34_CONFIG_GET(x) WLAN_GPIO_PIN34_CONFIG_GET(x) -#define GPIO_PIN34_CONFIG_SET(x) WLAN_GPIO_PIN34_CONFIG_SET(x) -#define GPIO_PIN34_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN34_WAKEUP_ENABLE_MSB -#define GPIO_PIN34_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN34_WAKEUP_ENABLE_LSB -#define GPIO_PIN34_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN34_WAKEUP_ENABLE_MASK -#define GPIO_PIN34_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN34_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN34_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN34_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN34_INT_TYPE_MSB WLAN_GPIO_PIN34_INT_TYPE_MSB -#define GPIO_PIN34_INT_TYPE_LSB WLAN_GPIO_PIN34_INT_TYPE_LSB -#define GPIO_PIN34_INT_TYPE_MASK WLAN_GPIO_PIN34_INT_TYPE_MASK -#define GPIO_PIN34_INT_TYPE_GET(x) WLAN_GPIO_PIN34_INT_TYPE_GET(x) -#define GPIO_PIN34_INT_TYPE_SET(x) WLAN_GPIO_PIN34_INT_TYPE_SET(x) -#define GPIO_PIN34_PAD_PULL_MSB WLAN_GPIO_PIN34_PAD_PULL_MSB -#define GPIO_PIN34_PAD_PULL_LSB WLAN_GPIO_PIN34_PAD_PULL_LSB -#define GPIO_PIN34_PAD_PULL_MASK WLAN_GPIO_PIN34_PAD_PULL_MASK -#define GPIO_PIN34_PAD_PULL_GET(x) WLAN_GPIO_PIN34_PAD_PULL_GET(x) -#define GPIO_PIN34_PAD_PULL_SET(x) WLAN_GPIO_PIN34_PAD_PULL_SET(x) -#define GPIO_PIN34_PAD_STRENGTH_MSB WLAN_GPIO_PIN34_PAD_STRENGTH_MSB -#define GPIO_PIN34_PAD_STRENGTH_LSB WLAN_GPIO_PIN34_PAD_STRENGTH_LSB -#define GPIO_PIN34_PAD_STRENGTH_MASK WLAN_GPIO_PIN34_PAD_STRENGTH_MASK -#define GPIO_PIN34_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN34_PAD_STRENGTH_GET(x) -#define GPIO_PIN34_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN34_PAD_STRENGTH_SET(x) -#define GPIO_PIN34_PAD_DRIVER_MSB WLAN_GPIO_PIN34_PAD_DRIVER_MSB -#define GPIO_PIN34_PAD_DRIVER_LSB WLAN_GPIO_PIN34_PAD_DRIVER_LSB -#define GPIO_PIN34_PAD_DRIVER_MASK WLAN_GPIO_PIN34_PAD_DRIVER_MASK -#define GPIO_PIN34_PAD_DRIVER_GET(x) WLAN_GPIO_PIN34_PAD_DRIVER_GET(x) -#define GPIO_PIN34_PAD_DRIVER_SET(x) WLAN_GPIO_PIN34_PAD_DRIVER_SET(x) -#define GPIO_PIN34_SOURCE_MSB WLAN_GPIO_PIN34_SOURCE_MSB -#define GPIO_PIN34_SOURCE_LSB WLAN_GPIO_PIN34_SOURCE_LSB -#define GPIO_PIN34_SOURCE_MASK WLAN_GPIO_PIN34_SOURCE_MASK -#define GPIO_PIN34_SOURCE_GET(x) WLAN_GPIO_PIN34_SOURCE_GET(x) -#define GPIO_PIN34_SOURCE_SET(x) WLAN_GPIO_PIN34_SOURCE_SET(x) -#define GPIO_PIN35_ADDRESS WLAN_GPIO_PIN35_ADDRESS -#define GPIO_PIN35_OFFSET WLAN_GPIO_PIN35_OFFSET -#define GPIO_PIN35_CONFIG_MSB WLAN_GPIO_PIN35_CONFIG_MSB -#define GPIO_PIN35_CONFIG_LSB WLAN_GPIO_PIN35_CONFIG_LSB -#define GPIO_PIN35_CONFIG_MASK WLAN_GPIO_PIN35_CONFIG_MASK -#define GPIO_PIN35_CONFIG_GET(x) WLAN_GPIO_PIN35_CONFIG_GET(x) -#define GPIO_PIN35_CONFIG_SET(x) WLAN_GPIO_PIN35_CONFIG_SET(x) -#define GPIO_PIN35_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN35_WAKEUP_ENABLE_MSB -#define GPIO_PIN35_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN35_WAKEUP_ENABLE_LSB -#define GPIO_PIN35_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN35_WAKEUP_ENABLE_MASK -#define GPIO_PIN35_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN35_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN35_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN35_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN35_INT_TYPE_MSB WLAN_GPIO_PIN35_INT_TYPE_MSB -#define GPIO_PIN35_INT_TYPE_LSB WLAN_GPIO_PIN35_INT_TYPE_LSB -#define GPIO_PIN35_INT_TYPE_MASK WLAN_GPIO_PIN35_INT_TYPE_MASK -#define GPIO_PIN35_INT_TYPE_GET(x) WLAN_GPIO_PIN35_INT_TYPE_GET(x) -#define GPIO_PIN35_INT_TYPE_SET(x) WLAN_GPIO_PIN35_INT_TYPE_SET(x) -#define GPIO_PIN35_PAD_PULL_MSB WLAN_GPIO_PIN35_PAD_PULL_MSB -#define GPIO_PIN35_PAD_PULL_LSB WLAN_GPIO_PIN35_PAD_PULL_LSB -#define GPIO_PIN35_PAD_PULL_MASK WLAN_GPIO_PIN35_PAD_PULL_MASK -#define GPIO_PIN35_PAD_PULL_GET(x) WLAN_GPIO_PIN35_PAD_PULL_GET(x) -#define GPIO_PIN35_PAD_PULL_SET(x) WLAN_GPIO_PIN35_PAD_PULL_SET(x) -#define GPIO_PIN35_PAD_STRENGTH_MSB WLAN_GPIO_PIN35_PAD_STRENGTH_MSB -#define GPIO_PIN35_PAD_STRENGTH_LSB WLAN_GPIO_PIN35_PAD_STRENGTH_LSB -#define GPIO_PIN35_PAD_STRENGTH_MASK WLAN_GPIO_PIN35_PAD_STRENGTH_MASK -#define GPIO_PIN35_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN35_PAD_STRENGTH_GET(x) -#define GPIO_PIN35_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN35_PAD_STRENGTH_SET(x) -#define GPIO_PIN35_PAD_DRIVER_MSB WLAN_GPIO_PIN35_PAD_DRIVER_MSB -#define GPIO_PIN35_PAD_DRIVER_LSB WLAN_GPIO_PIN35_PAD_DRIVER_LSB -#define GPIO_PIN35_PAD_DRIVER_MASK WLAN_GPIO_PIN35_PAD_DRIVER_MASK -#define GPIO_PIN35_PAD_DRIVER_GET(x) WLAN_GPIO_PIN35_PAD_DRIVER_GET(x) -#define GPIO_PIN35_PAD_DRIVER_SET(x) WLAN_GPIO_PIN35_PAD_DRIVER_SET(x) -#define GPIO_PIN35_SOURCE_MSB WLAN_GPIO_PIN35_SOURCE_MSB -#define GPIO_PIN35_SOURCE_LSB WLAN_GPIO_PIN35_SOURCE_LSB -#define GPIO_PIN35_SOURCE_MASK WLAN_GPIO_PIN35_SOURCE_MASK -#define GPIO_PIN35_SOURCE_GET(x) WLAN_GPIO_PIN35_SOURCE_GET(x) -#define GPIO_PIN35_SOURCE_SET(x) WLAN_GPIO_PIN35_SOURCE_SET(x) -#define GPIO_PIN36_ADDRESS WLAN_GPIO_PIN36_ADDRESS -#define GPIO_PIN36_OFFSET WLAN_GPIO_PIN36_OFFSET -#define GPIO_PIN36_CONFIG_MSB WLAN_GPIO_PIN36_CONFIG_MSB -#define GPIO_PIN36_CONFIG_LSB WLAN_GPIO_PIN36_CONFIG_LSB -#define GPIO_PIN36_CONFIG_MASK WLAN_GPIO_PIN36_CONFIG_MASK -#define GPIO_PIN36_CONFIG_GET(x) WLAN_GPIO_PIN36_CONFIG_GET(x) -#define GPIO_PIN36_CONFIG_SET(x) WLAN_GPIO_PIN36_CONFIG_SET(x) -#define GPIO_PIN36_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN36_WAKEUP_ENABLE_MSB -#define GPIO_PIN36_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN36_WAKEUP_ENABLE_LSB -#define GPIO_PIN36_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN36_WAKEUP_ENABLE_MASK -#define GPIO_PIN36_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN36_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN36_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN36_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN36_INT_TYPE_MSB WLAN_GPIO_PIN36_INT_TYPE_MSB -#define GPIO_PIN36_INT_TYPE_LSB WLAN_GPIO_PIN36_INT_TYPE_LSB -#define GPIO_PIN36_INT_TYPE_MASK WLAN_GPIO_PIN36_INT_TYPE_MASK -#define GPIO_PIN36_INT_TYPE_GET(x) WLAN_GPIO_PIN36_INT_TYPE_GET(x) -#define GPIO_PIN36_INT_TYPE_SET(x) WLAN_GPIO_PIN36_INT_TYPE_SET(x) -#define GPIO_PIN36_PAD_PULL_MSB WLAN_GPIO_PIN36_PAD_PULL_MSB -#define GPIO_PIN36_PAD_PULL_LSB WLAN_GPIO_PIN36_PAD_PULL_LSB -#define GPIO_PIN36_PAD_PULL_MASK WLAN_GPIO_PIN36_PAD_PULL_MASK -#define GPIO_PIN36_PAD_PULL_GET(x) WLAN_GPIO_PIN36_PAD_PULL_GET(x) -#define GPIO_PIN36_PAD_PULL_SET(x) WLAN_GPIO_PIN36_PAD_PULL_SET(x) -#define GPIO_PIN36_PAD_STRENGTH_MSB WLAN_GPIO_PIN36_PAD_STRENGTH_MSB -#define GPIO_PIN36_PAD_STRENGTH_LSB WLAN_GPIO_PIN36_PAD_STRENGTH_LSB -#define GPIO_PIN36_PAD_STRENGTH_MASK WLAN_GPIO_PIN36_PAD_STRENGTH_MASK -#define GPIO_PIN36_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN36_PAD_STRENGTH_GET(x) -#define GPIO_PIN36_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN36_PAD_STRENGTH_SET(x) -#define GPIO_PIN36_PAD_DRIVER_MSB WLAN_GPIO_PIN36_PAD_DRIVER_MSB -#define GPIO_PIN36_PAD_DRIVER_LSB WLAN_GPIO_PIN36_PAD_DRIVER_LSB -#define GPIO_PIN36_PAD_DRIVER_MASK WLAN_GPIO_PIN36_PAD_DRIVER_MASK -#define GPIO_PIN36_PAD_DRIVER_GET(x) WLAN_GPIO_PIN36_PAD_DRIVER_GET(x) -#define GPIO_PIN36_PAD_DRIVER_SET(x) WLAN_GPIO_PIN36_PAD_DRIVER_SET(x) -#define GPIO_PIN36_SOURCE_MSB WLAN_GPIO_PIN36_SOURCE_MSB -#define GPIO_PIN36_SOURCE_LSB WLAN_GPIO_PIN36_SOURCE_LSB -#define GPIO_PIN36_SOURCE_MASK WLAN_GPIO_PIN36_SOURCE_MASK -#define GPIO_PIN36_SOURCE_GET(x) WLAN_GPIO_PIN36_SOURCE_GET(x) -#define GPIO_PIN36_SOURCE_SET(x) WLAN_GPIO_PIN36_SOURCE_SET(x) -#define GPIO_PIN37_ADDRESS WLAN_GPIO_PIN37_ADDRESS -#define GPIO_PIN37_OFFSET WLAN_GPIO_PIN37_OFFSET -#define GPIO_PIN37_CONFIG_MSB WLAN_GPIO_PIN37_CONFIG_MSB -#define GPIO_PIN37_CONFIG_LSB WLAN_GPIO_PIN37_CONFIG_LSB -#define GPIO_PIN37_CONFIG_MASK WLAN_GPIO_PIN37_CONFIG_MASK -#define GPIO_PIN37_CONFIG_GET(x) WLAN_GPIO_PIN37_CONFIG_GET(x) -#define GPIO_PIN37_CONFIG_SET(x) WLAN_GPIO_PIN37_CONFIG_SET(x) -#define GPIO_PIN37_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN37_WAKEUP_ENABLE_MSB -#define GPIO_PIN37_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN37_WAKEUP_ENABLE_LSB -#define GPIO_PIN37_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN37_WAKEUP_ENABLE_MASK -#define GPIO_PIN37_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN37_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN37_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN37_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN37_INT_TYPE_MSB WLAN_GPIO_PIN37_INT_TYPE_MSB -#define GPIO_PIN37_INT_TYPE_LSB WLAN_GPIO_PIN37_INT_TYPE_LSB -#define GPIO_PIN37_INT_TYPE_MASK WLAN_GPIO_PIN37_INT_TYPE_MASK -#define GPIO_PIN37_INT_TYPE_GET(x) WLAN_GPIO_PIN37_INT_TYPE_GET(x) -#define GPIO_PIN37_INT_TYPE_SET(x) WLAN_GPIO_PIN37_INT_TYPE_SET(x) -#define GPIO_PIN37_PAD_PULL_MSB WLAN_GPIO_PIN37_PAD_PULL_MSB -#define GPIO_PIN37_PAD_PULL_LSB WLAN_GPIO_PIN37_PAD_PULL_LSB -#define GPIO_PIN37_PAD_PULL_MASK WLAN_GPIO_PIN37_PAD_PULL_MASK -#define GPIO_PIN37_PAD_PULL_GET(x) WLAN_GPIO_PIN37_PAD_PULL_GET(x) -#define GPIO_PIN37_PAD_PULL_SET(x) WLAN_GPIO_PIN37_PAD_PULL_SET(x) -#define GPIO_PIN37_PAD_STRENGTH_MSB WLAN_GPIO_PIN37_PAD_STRENGTH_MSB -#define GPIO_PIN37_PAD_STRENGTH_LSB WLAN_GPIO_PIN37_PAD_STRENGTH_LSB -#define GPIO_PIN37_PAD_STRENGTH_MASK WLAN_GPIO_PIN37_PAD_STRENGTH_MASK -#define GPIO_PIN37_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN37_PAD_STRENGTH_GET(x) -#define GPIO_PIN37_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN37_PAD_STRENGTH_SET(x) -#define GPIO_PIN37_PAD_DRIVER_MSB WLAN_GPIO_PIN37_PAD_DRIVER_MSB -#define GPIO_PIN37_PAD_DRIVER_LSB WLAN_GPIO_PIN37_PAD_DRIVER_LSB -#define GPIO_PIN37_PAD_DRIVER_MASK WLAN_GPIO_PIN37_PAD_DRIVER_MASK -#define GPIO_PIN37_PAD_DRIVER_GET(x) WLAN_GPIO_PIN37_PAD_DRIVER_GET(x) -#define GPIO_PIN37_PAD_DRIVER_SET(x) WLAN_GPIO_PIN37_PAD_DRIVER_SET(x) -#define GPIO_PIN37_SOURCE_MSB WLAN_GPIO_PIN37_SOURCE_MSB -#define GPIO_PIN37_SOURCE_LSB WLAN_GPIO_PIN37_SOURCE_LSB -#define GPIO_PIN37_SOURCE_MASK WLAN_GPIO_PIN37_SOURCE_MASK -#define GPIO_PIN37_SOURCE_GET(x) WLAN_GPIO_PIN37_SOURCE_GET(x) -#define GPIO_PIN37_SOURCE_SET(x) WLAN_GPIO_PIN37_SOURCE_SET(x) -#define GPIO_PIN38_ADDRESS WLAN_GPIO_PIN38_ADDRESS -#define GPIO_PIN38_OFFSET WLAN_GPIO_PIN38_OFFSET -#define GPIO_PIN38_CONFIG_MSB WLAN_GPIO_PIN38_CONFIG_MSB -#define GPIO_PIN38_CONFIG_LSB WLAN_GPIO_PIN38_CONFIG_LSB -#define GPIO_PIN38_CONFIG_MASK WLAN_GPIO_PIN38_CONFIG_MASK -#define GPIO_PIN38_CONFIG_GET(x) WLAN_GPIO_PIN38_CONFIG_GET(x) -#define GPIO_PIN38_CONFIG_SET(x) WLAN_GPIO_PIN38_CONFIG_SET(x) -#define GPIO_PIN38_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN38_WAKEUP_ENABLE_MSB -#define GPIO_PIN38_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN38_WAKEUP_ENABLE_LSB -#define GPIO_PIN38_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN38_WAKEUP_ENABLE_MASK -#define GPIO_PIN38_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN38_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN38_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN38_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN38_INT_TYPE_MSB WLAN_GPIO_PIN38_INT_TYPE_MSB -#define GPIO_PIN38_INT_TYPE_LSB WLAN_GPIO_PIN38_INT_TYPE_LSB -#define GPIO_PIN38_INT_TYPE_MASK WLAN_GPIO_PIN38_INT_TYPE_MASK -#define GPIO_PIN38_INT_TYPE_GET(x) WLAN_GPIO_PIN38_INT_TYPE_GET(x) -#define GPIO_PIN38_INT_TYPE_SET(x) WLAN_GPIO_PIN38_INT_TYPE_SET(x) -#define GPIO_PIN38_PAD_PULL_MSB WLAN_GPIO_PIN38_PAD_PULL_MSB -#define GPIO_PIN38_PAD_PULL_LSB WLAN_GPIO_PIN38_PAD_PULL_LSB -#define GPIO_PIN38_PAD_PULL_MASK WLAN_GPIO_PIN38_PAD_PULL_MASK -#define GPIO_PIN38_PAD_PULL_GET(x) WLAN_GPIO_PIN38_PAD_PULL_GET(x) -#define GPIO_PIN38_PAD_PULL_SET(x) WLAN_GPIO_PIN38_PAD_PULL_SET(x) -#define GPIO_PIN38_PAD_STRENGTH_MSB WLAN_GPIO_PIN38_PAD_STRENGTH_MSB -#define GPIO_PIN38_PAD_STRENGTH_LSB WLAN_GPIO_PIN38_PAD_STRENGTH_LSB -#define GPIO_PIN38_PAD_STRENGTH_MASK WLAN_GPIO_PIN38_PAD_STRENGTH_MASK -#define GPIO_PIN38_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN38_PAD_STRENGTH_GET(x) -#define GPIO_PIN38_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN38_PAD_STRENGTH_SET(x) -#define GPIO_PIN38_PAD_DRIVER_MSB WLAN_GPIO_PIN38_PAD_DRIVER_MSB -#define GPIO_PIN38_PAD_DRIVER_LSB WLAN_GPIO_PIN38_PAD_DRIVER_LSB -#define GPIO_PIN38_PAD_DRIVER_MASK WLAN_GPIO_PIN38_PAD_DRIVER_MASK -#define GPIO_PIN38_PAD_DRIVER_GET(x) WLAN_GPIO_PIN38_PAD_DRIVER_GET(x) -#define GPIO_PIN38_PAD_DRIVER_SET(x) WLAN_GPIO_PIN38_PAD_DRIVER_SET(x) -#define GPIO_PIN38_SOURCE_MSB WLAN_GPIO_PIN38_SOURCE_MSB -#define GPIO_PIN38_SOURCE_LSB WLAN_GPIO_PIN38_SOURCE_LSB -#define GPIO_PIN38_SOURCE_MASK WLAN_GPIO_PIN38_SOURCE_MASK -#define GPIO_PIN38_SOURCE_GET(x) WLAN_GPIO_PIN38_SOURCE_GET(x) -#define GPIO_PIN38_SOURCE_SET(x) WLAN_GPIO_PIN38_SOURCE_SET(x) -#define GPIO_PIN39_ADDRESS WLAN_GPIO_PIN39_ADDRESS -#define GPIO_PIN39_OFFSET WLAN_GPIO_PIN39_OFFSET -#define GPIO_PIN39_CONFIG_MSB WLAN_GPIO_PIN39_CONFIG_MSB -#define GPIO_PIN39_CONFIG_LSB WLAN_GPIO_PIN39_CONFIG_LSB -#define GPIO_PIN39_CONFIG_MASK WLAN_GPIO_PIN39_CONFIG_MASK -#define GPIO_PIN39_CONFIG_GET(x) WLAN_GPIO_PIN39_CONFIG_GET(x) -#define GPIO_PIN39_CONFIG_SET(x) WLAN_GPIO_PIN39_CONFIG_SET(x) -#define GPIO_PIN39_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN39_WAKEUP_ENABLE_MSB -#define GPIO_PIN39_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN39_WAKEUP_ENABLE_LSB -#define GPIO_PIN39_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN39_WAKEUP_ENABLE_MASK -#define GPIO_PIN39_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN39_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN39_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN39_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN39_INT_TYPE_MSB WLAN_GPIO_PIN39_INT_TYPE_MSB -#define GPIO_PIN39_INT_TYPE_LSB WLAN_GPIO_PIN39_INT_TYPE_LSB -#define GPIO_PIN39_INT_TYPE_MASK WLAN_GPIO_PIN39_INT_TYPE_MASK -#define GPIO_PIN39_INT_TYPE_GET(x) WLAN_GPIO_PIN39_INT_TYPE_GET(x) -#define GPIO_PIN39_INT_TYPE_SET(x) WLAN_GPIO_PIN39_INT_TYPE_SET(x) -#define GPIO_PIN39_PAD_PULL_MSB WLAN_GPIO_PIN39_PAD_PULL_MSB -#define GPIO_PIN39_PAD_PULL_LSB WLAN_GPIO_PIN39_PAD_PULL_LSB -#define GPIO_PIN39_PAD_PULL_MASK WLAN_GPIO_PIN39_PAD_PULL_MASK -#define GPIO_PIN39_PAD_PULL_GET(x) WLAN_GPIO_PIN39_PAD_PULL_GET(x) -#define GPIO_PIN39_PAD_PULL_SET(x) WLAN_GPIO_PIN39_PAD_PULL_SET(x) -#define GPIO_PIN39_PAD_STRENGTH_MSB WLAN_GPIO_PIN39_PAD_STRENGTH_MSB -#define GPIO_PIN39_PAD_STRENGTH_LSB WLAN_GPIO_PIN39_PAD_STRENGTH_LSB -#define GPIO_PIN39_PAD_STRENGTH_MASK WLAN_GPIO_PIN39_PAD_STRENGTH_MASK -#define GPIO_PIN39_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN39_PAD_STRENGTH_GET(x) -#define GPIO_PIN39_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN39_PAD_STRENGTH_SET(x) -#define GPIO_PIN39_PAD_DRIVER_MSB WLAN_GPIO_PIN39_PAD_DRIVER_MSB -#define GPIO_PIN39_PAD_DRIVER_LSB WLAN_GPIO_PIN39_PAD_DRIVER_LSB -#define GPIO_PIN39_PAD_DRIVER_MASK WLAN_GPIO_PIN39_PAD_DRIVER_MASK -#define GPIO_PIN39_PAD_DRIVER_GET(x) WLAN_GPIO_PIN39_PAD_DRIVER_GET(x) -#define GPIO_PIN39_PAD_DRIVER_SET(x) WLAN_GPIO_PIN39_PAD_DRIVER_SET(x) -#define GPIO_PIN39_SOURCE_MSB WLAN_GPIO_PIN39_SOURCE_MSB -#define GPIO_PIN39_SOURCE_LSB WLAN_GPIO_PIN39_SOURCE_LSB -#define GPIO_PIN39_SOURCE_MASK WLAN_GPIO_PIN39_SOURCE_MASK -#define GPIO_PIN39_SOURCE_GET(x) WLAN_GPIO_PIN39_SOURCE_GET(x) -#define GPIO_PIN39_SOURCE_SET(x) WLAN_GPIO_PIN39_SOURCE_SET(x) -#define GPIO_PIN40_ADDRESS WLAN_GPIO_PIN40_ADDRESS -#define GPIO_PIN40_OFFSET WLAN_GPIO_PIN40_OFFSET -#define GPIO_PIN40_CONFIG_MSB WLAN_GPIO_PIN40_CONFIG_MSB -#define GPIO_PIN40_CONFIG_LSB WLAN_GPIO_PIN40_CONFIG_LSB -#define GPIO_PIN40_CONFIG_MASK WLAN_GPIO_PIN40_CONFIG_MASK -#define GPIO_PIN40_CONFIG_GET(x) WLAN_GPIO_PIN40_CONFIG_GET(x) -#define GPIO_PIN40_CONFIG_SET(x) WLAN_GPIO_PIN40_CONFIG_SET(x) -#define GPIO_PIN40_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN40_WAKEUP_ENABLE_MSB -#define GPIO_PIN40_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN40_WAKEUP_ENABLE_LSB -#define GPIO_PIN40_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN40_WAKEUP_ENABLE_MASK -#define GPIO_PIN40_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN40_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN40_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN40_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN40_INT_TYPE_MSB WLAN_GPIO_PIN40_INT_TYPE_MSB -#define GPIO_PIN40_INT_TYPE_LSB WLAN_GPIO_PIN40_INT_TYPE_LSB -#define GPIO_PIN40_INT_TYPE_MASK WLAN_GPIO_PIN40_INT_TYPE_MASK -#define GPIO_PIN40_INT_TYPE_GET(x) WLAN_GPIO_PIN40_INT_TYPE_GET(x) -#define GPIO_PIN40_INT_TYPE_SET(x) WLAN_GPIO_PIN40_INT_TYPE_SET(x) -#define GPIO_PIN40_PAD_PULL_MSB WLAN_GPIO_PIN40_PAD_PULL_MSB -#define GPIO_PIN40_PAD_PULL_LSB WLAN_GPIO_PIN40_PAD_PULL_LSB -#define GPIO_PIN40_PAD_PULL_MASK WLAN_GPIO_PIN40_PAD_PULL_MASK -#define GPIO_PIN40_PAD_PULL_GET(x) WLAN_GPIO_PIN40_PAD_PULL_GET(x) -#define GPIO_PIN40_PAD_PULL_SET(x) WLAN_GPIO_PIN40_PAD_PULL_SET(x) -#define GPIO_PIN40_PAD_STRENGTH_MSB WLAN_GPIO_PIN40_PAD_STRENGTH_MSB -#define GPIO_PIN40_PAD_STRENGTH_LSB WLAN_GPIO_PIN40_PAD_STRENGTH_LSB -#define GPIO_PIN40_PAD_STRENGTH_MASK WLAN_GPIO_PIN40_PAD_STRENGTH_MASK -#define GPIO_PIN40_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN40_PAD_STRENGTH_GET(x) -#define GPIO_PIN40_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN40_PAD_STRENGTH_SET(x) -#define GPIO_PIN40_PAD_DRIVER_MSB WLAN_GPIO_PIN40_PAD_DRIVER_MSB -#define GPIO_PIN40_PAD_DRIVER_LSB WLAN_GPIO_PIN40_PAD_DRIVER_LSB -#define GPIO_PIN40_PAD_DRIVER_MASK WLAN_GPIO_PIN40_PAD_DRIVER_MASK -#define GPIO_PIN40_PAD_DRIVER_GET(x) WLAN_GPIO_PIN40_PAD_DRIVER_GET(x) -#define GPIO_PIN40_PAD_DRIVER_SET(x) WLAN_GPIO_PIN40_PAD_DRIVER_SET(x) -#define GPIO_PIN40_SOURCE_MSB WLAN_GPIO_PIN40_SOURCE_MSB -#define GPIO_PIN40_SOURCE_LSB WLAN_GPIO_PIN40_SOURCE_LSB -#define GPIO_PIN40_SOURCE_MASK WLAN_GPIO_PIN40_SOURCE_MASK -#define GPIO_PIN40_SOURCE_GET(x) WLAN_GPIO_PIN40_SOURCE_GET(x) -#define GPIO_PIN40_SOURCE_SET(x) WLAN_GPIO_PIN40_SOURCE_SET(x) -#define GPIO_PIN41_ADDRESS WLAN_GPIO_PIN41_ADDRESS -#define GPIO_PIN41_OFFSET WLAN_GPIO_PIN41_OFFSET -#define GPIO_PIN41_CONFIG_MSB WLAN_GPIO_PIN41_CONFIG_MSB -#define GPIO_PIN41_CONFIG_LSB WLAN_GPIO_PIN41_CONFIG_LSB -#define GPIO_PIN41_CONFIG_MASK WLAN_GPIO_PIN41_CONFIG_MASK -#define GPIO_PIN41_CONFIG_GET(x) WLAN_GPIO_PIN41_CONFIG_GET(x) -#define GPIO_PIN41_CONFIG_SET(x) WLAN_GPIO_PIN41_CONFIG_SET(x) -#define GPIO_PIN41_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN41_WAKEUP_ENABLE_MSB -#define GPIO_PIN41_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN41_WAKEUP_ENABLE_LSB -#define GPIO_PIN41_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN41_WAKEUP_ENABLE_MASK -#define GPIO_PIN41_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN41_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN41_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN41_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN41_INT_TYPE_MSB WLAN_GPIO_PIN41_INT_TYPE_MSB -#define GPIO_PIN41_INT_TYPE_LSB WLAN_GPIO_PIN41_INT_TYPE_LSB -#define GPIO_PIN41_INT_TYPE_MASK WLAN_GPIO_PIN41_INT_TYPE_MASK -#define GPIO_PIN41_INT_TYPE_GET(x) WLAN_GPIO_PIN41_INT_TYPE_GET(x) -#define GPIO_PIN41_INT_TYPE_SET(x) WLAN_GPIO_PIN41_INT_TYPE_SET(x) -#define GPIO_PIN41_PAD_PULL_MSB WLAN_GPIO_PIN41_PAD_PULL_MSB -#define GPIO_PIN41_PAD_PULL_LSB WLAN_GPIO_PIN41_PAD_PULL_LSB -#define GPIO_PIN41_PAD_PULL_MASK WLAN_GPIO_PIN41_PAD_PULL_MASK -#define GPIO_PIN41_PAD_PULL_GET(x) WLAN_GPIO_PIN41_PAD_PULL_GET(x) -#define GPIO_PIN41_PAD_PULL_SET(x) WLAN_GPIO_PIN41_PAD_PULL_SET(x) -#define GPIO_PIN41_PAD_STRENGTH_MSB WLAN_GPIO_PIN41_PAD_STRENGTH_MSB -#define GPIO_PIN41_PAD_STRENGTH_LSB WLAN_GPIO_PIN41_PAD_STRENGTH_LSB -#define GPIO_PIN41_PAD_STRENGTH_MASK WLAN_GPIO_PIN41_PAD_STRENGTH_MASK -#define GPIO_PIN41_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN41_PAD_STRENGTH_GET(x) -#define GPIO_PIN41_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN41_PAD_STRENGTH_SET(x) -#define GPIO_PIN41_PAD_DRIVER_MSB WLAN_GPIO_PIN41_PAD_DRIVER_MSB -#define GPIO_PIN41_PAD_DRIVER_LSB WLAN_GPIO_PIN41_PAD_DRIVER_LSB -#define GPIO_PIN41_PAD_DRIVER_MASK WLAN_GPIO_PIN41_PAD_DRIVER_MASK -#define GPIO_PIN41_PAD_DRIVER_GET(x) WLAN_GPIO_PIN41_PAD_DRIVER_GET(x) -#define GPIO_PIN41_PAD_DRIVER_SET(x) WLAN_GPIO_PIN41_PAD_DRIVER_SET(x) -#define GPIO_PIN41_SOURCE_MSB WLAN_GPIO_PIN41_SOURCE_MSB -#define GPIO_PIN41_SOURCE_LSB WLAN_GPIO_PIN41_SOURCE_LSB -#define GPIO_PIN41_SOURCE_MASK WLAN_GPIO_PIN41_SOURCE_MASK -#define GPIO_PIN41_SOURCE_GET(x) WLAN_GPIO_PIN41_SOURCE_GET(x) -#define GPIO_PIN41_SOURCE_SET(x) WLAN_GPIO_PIN41_SOURCE_SET(x) -#define GPIO_PIN42_ADDRESS WLAN_GPIO_PIN42_ADDRESS -#define GPIO_PIN42_OFFSET WLAN_GPIO_PIN42_OFFSET -#define GPIO_PIN42_CONFIG_MSB WLAN_GPIO_PIN42_CONFIG_MSB -#define GPIO_PIN42_CONFIG_LSB WLAN_GPIO_PIN42_CONFIG_LSB -#define GPIO_PIN42_CONFIG_MASK WLAN_GPIO_PIN42_CONFIG_MASK -#define GPIO_PIN42_CONFIG_GET(x) WLAN_GPIO_PIN42_CONFIG_GET(x) -#define GPIO_PIN42_CONFIG_SET(x) WLAN_GPIO_PIN42_CONFIG_SET(x) -#define GPIO_PIN42_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN42_WAKEUP_ENABLE_MSB -#define GPIO_PIN42_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN42_WAKEUP_ENABLE_LSB -#define GPIO_PIN42_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN42_WAKEUP_ENABLE_MASK -#define GPIO_PIN42_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN42_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN42_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN42_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN42_INT_TYPE_MSB WLAN_GPIO_PIN42_INT_TYPE_MSB -#define GPIO_PIN42_INT_TYPE_LSB WLAN_GPIO_PIN42_INT_TYPE_LSB -#define GPIO_PIN42_INT_TYPE_MASK WLAN_GPIO_PIN42_INT_TYPE_MASK -#define GPIO_PIN42_INT_TYPE_GET(x) WLAN_GPIO_PIN42_INT_TYPE_GET(x) -#define GPIO_PIN42_INT_TYPE_SET(x) WLAN_GPIO_PIN42_INT_TYPE_SET(x) -#define GPIO_PIN42_PAD_PULL_MSB WLAN_GPIO_PIN42_PAD_PULL_MSB -#define GPIO_PIN42_PAD_PULL_LSB WLAN_GPIO_PIN42_PAD_PULL_LSB -#define GPIO_PIN42_PAD_PULL_MASK WLAN_GPIO_PIN42_PAD_PULL_MASK -#define GPIO_PIN42_PAD_PULL_GET(x) WLAN_GPIO_PIN42_PAD_PULL_GET(x) -#define GPIO_PIN42_PAD_PULL_SET(x) WLAN_GPIO_PIN42_PAD_PULL_SET(x) -#define GPIO_PIN42_PAD_STRENGTH_MSB WLAN_GPIO_PIN42_PAD_STRENGTH_MSB -#define GPIO_PIN42_PAD_STRENGTH_LSB WLAN_GPIO_PIN42_PAD_STRENGTH_LSB -#define GPIO_PIN42_PAD_STRENGTH_MASK WLAN_GPIO_PIN42_PAD_STRENGTH_MASK -#define GPIO_PIN42_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN42_PAD_STRENGTH_GET(x) -#define GPIO_PIN42_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN42_PAD_STRENGTH_SET(x) -#define GPIO_PIN42_PAD_DRIVER_MSB WLAN_GPIO_PIN42_PAD_DRIVER_MSB -#define GPIO_PIN42_PAD_DRIVER_LSB WLAN_GPIO_PIN42_PAD_DRIVER_LSB -#define GPIO_PIN42_PAD_DRIVER_MASK WLAN_GPIO_PIN42_PAD_DRIVER_MASK -#define GPIO_PIN42_PAD_DRIVER_GET(x) WLAN_GPIO_PIN42_PAD_DRIVER_GET(x) -#define GPIO_PIN42_PAD_DRIVER_SET(x) WLAN_GPIO_PIN42_PAD_DRIVER_SET(x) -#define GPIO_PIN42_SOURCE_MSB WLAN_GPIO_PIN42_SOURCE_MSB -#define GPIO_PIN42_SOURCE_LSB WLAN_GPIO_PIN42_SOURCE_LSB -#define GPIO_PIN42_SOURCE_MASK WLAN_GPIO_PIN42_SOURCE_MASK -#define GPIO_PIN42_SOURCE_GET(x) WLAN_GPIO_PIN42_SOURCE_GET(x) -#define GPIO_PIN42_SOURCE_SET(x) WLAN_GPIO_PIN42_SOURCE_SET(x) -#define GPIO_PIN43_ADDRESS WLAN_GPIO_PIN43_ADDRESS -#define GPIO_PIN43_OFFSET WLAN_GPIO_PIN43_OFFSET -#define GPIO_PIN43_CONFIG_MSB WLAN_GPIO_PIN43_CONFIG_MSB -#define GPIO_PIN43_CONFIG_LSB WLAN_GPIO_PIN43_CONFIG_LSB -#define GPIO_PIN43_CONFIG_MASK WLAN_GPIO_PIN43_CONFIG_MASK -#define GPIO_PIN43_CONFIG_GET(x) WLAN_GPIO_PIN43_CONFIG_GET(x) -#define GPIO_PIN43_CONFIG_SET(x) WLAN_GPIO_PIN43_CONFIG_SET(x) -#define GPIO_PIN43_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN43_WAKEUP_ENABLE_MSB -#define GPIO_PIN43_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN43_WAKEUP_ENABLE_LSB -#define GPIO_PIN43_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN43_WAKEUP_ENABLE_MASK -#define GPIO_PIN43_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN43_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN43_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN43_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN43_INT_TYPE_MSB WLAN_GPIO_PIN43_INT_TYPE_MSB -#define GPIO_PIN43_INT_TYPE_LSB WLAN_GPIO_PIN43_INT_TYPE_LSB -#define GPIO_PIN43_INT_TYPE_MASK WLAN_GPIO_PIN43_INT_TYPE_MASK -#define GPIO_PIN43_INT_TYPE_GET(x) WLAN_GPIO_PIN43_INT_TYPE_GET(x) -#define GPIO_PIN43_INT_TYPE_SET(x) WLAN_GPIO_PIN43_INT_TYPE_SET(x) -#define GPIO_PIN43_PAD_PULL_MSB WLAN_GPIO_PIN43_PAD_PULL_MSB -#define GPIO_PIN43_PAD_PULL_LSB WLAN_GPIO_PIN43_PAD_PULL_LSB -#define GPIO_PIN43_PAD_PULL_MASK WLAN_GPIO_PIN43_PAD_PULL_MASK -#define GPIO_PIN43_PAD_PULL_GET(x) WLAN_GPIO_PIN43_PAD_PULL_GET(x) -#define GPIO_PIN43_PAD_PULL_SET(x) WLAN_GPIO_PIN43_PAD_PULL_SET(x) -#define GPIO_PIN43_PAD_STRENGTH_MSB WLAN_GPIO_PIN43_PAD_STRENGTH_MSB -#define GPIO_PIN43_PAD_STRENGTH_LSB WLAN_GPIO_PIN43_PAD_STRENGTH_LSB -#define GPIO_PIN43_PAD_STRENGTH_MASK WLAN_GPIO_PIN43_PAD_STRENGTH_MASK -#define GPIO_PIN43_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN43_PAD_STRENGTH_GET(x) -#define GPIO_PIN43_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN43_PAD_STRENGTH_SET(x) -#define GPIO_PIN43_PAD_DRIVER_MSB WLAN_GPIO_PIN43_PAD_DRIVER_MSB -#define GPIO_PIN43_PAD_DRIVER_LSB WLAN_GPIO_PIN43_PAD_DRIVER_LSB -#define GPIO_PIN43_PAD_DRIVER_MASK WLAN_GPIO_PIN43_PAD_DRIVER_MASK -#define GPIO_PIN43_PAD_DRIVER_GET(x) WLAN_GPIO_PIN43_PAD_DRIVER_GET(x) -#define GPIO_PIN43_PAD_DRIVER_SET(x) WLAN_GPIO_PIN43_PAD_DRIVER_SET(x) -#define GPIO_PIN43_SOURCE_MSB WLAN_GPIO_PIN43_SOURCE_MSB -#define GPIO_PIN43_SOURCE_LSB WLAN_GPIO_PIN43_SOURCE_LSB -#define GPIO_PIN43_SOURCE_MASK WLAN_GPIO_PIN43_SOURCE_MASK -#define GPIO_PIN43_SOURCE_GET(x) WLAN_GPIO_PIN43_SOURCE_GET(x) -#define GPIO_PIN43_SOURCE_SET(x) WLAN_GPIO_PIN43_SOURCE_SET(x) -#define GPIO_PIN44_ADDRESS WLAN_GPIO_PIN44_ADDRESS -#define GPIO_PIN44_OFFSET WLAN_GPIO_PIN44_OFFSET -#define GPIO_PIN44_CONFIG_MSB WLAN_GPIO_PIN44_CONFIG_MSB -#define GPIO_PIN44_CONFIG_LSB WLAN_GPIO_PIN44_CONFIG_LSB -#define GPIO_PIN44_CONFIG_MASK WLAN_GPIO_PIN44_CONFIG_MASK -#define GPIO_PIN44_CONFIG_GET(x) WLAN_GPIO_PIN44_CONFIG_GET(x) -#define GPIO_PIN44_CONFIG_SET(x) WLAN_GPIO_PIN44_CONFIG_SET(x) -#define GPIO_PIN44_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN44_WAKEUP_ENABLE_MSB -#define GPIO_PIN44_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN44_WAKEUP_ENABLE_LSB -#define GPIO_PIN44_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN44_WAKEUP_ENABLE_MASK -#define GPIO_PIN44_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN44_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN44_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN44_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN44_INT_TYPE_MSB WLAN_GPIO_PIN44_INT_TYPE_MSB -#define GPIO_PIN44_INT_TYPE_LSB WLAN_GPIO_PIN44_INT_TYPE_LSB -#define GPIO_PIN44_INT_TYPE_MASK WLAN_GPIO_PIN44_INT_TYPE_MASK -#define GPIO_PIN44_INT_TYPE_GET(x) WLAN_GPIO_PIN44_INT_TYPE_GET(x) -#define GPIO_PIN44_INT_TYPE_SET(x) WLAN_GPIO_PIN44_INT_TYPE_SET(x) -#define GPIO_PIN44_PAD_PULL_MSB WLAN_GPIO_PIN44_PAD_PULL_MSB -#define GPIO_PIN44_PAD_PULL_LSB WLAN_GPIO_PIN44_PAD_PULL_LSB -#define GPIO_PIN44_PAD_PULL_MASK WLAN_GPIO_PIN44_PAD_PULL_MASK -#define GPIO_PIN44_PAD_PULL_GET(x) WLAN_GPIO_PIN44_PAD_PULL_GET(x) -#define GPIO_PIN44_PAD_PULL_SET(x) WLAN_GPIO_PIN44_PAD_PULL_SET(x) -#define GPIO_PIN44_PAD_STRENGTH_MSB WLAN_GPIO_PIN44_PAD_STRENGTH_MSB -#define GPIO_PIN44_PAD_STRENGTH_LSB WLAN_GPIO_PIN44_PAD_STRENGTH_LSB -#define GPIO_PIN44_PAD_STRENGTH_MASK WLAN_GPIO_PIN44_PAD_STRENGTH_MASK -#define GPIO_PIN44_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN44_PAD_STRENGTH_GET(x) -#define GPIO_PIN44_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN44_PAD_STRENGTH_SET(x) -#define GPIO_PIN44_PAD_DRIVER_MSB WLAN_GPIO_PIN44_PAD_DRIVER_MSB -#define GPIO_PIN44_PAD_DRIVER_LSB WLAN_GPIO_PIN44_PAD_DRIVER_LSB -#define GPIO_PIN44_PAD_DRIVER_MASK WLAN_GPIO_PIN44_PAD_DRIVER_MASK -#define GPIO_PIN44_PAD_DRIVER_GET(x) WLAN_GPIO_PIN44_PAD_DRIVER_GET(x) -#define GPIO_PIN44_PAD_DRIVER_SET(x) WLAN_GPIO_PIN44_PAD_DRIVER_SET(x) -#define GPIO_PIN44_SOURCE_MSB WLAN_GPIO_PIN44_SOURCE_MSB -#define GPIO_PIN44_SOURCE_LSB WLAN_GPIO_PIN44_SOURCE_LSB -#define GPIO_PIN44_SOURCE_MASK WLAN_GPIO_PIN44_SOURCE_MASK -#define GPIO_PIN44_SOURCE_GET(x) WLAN_GPIO_PIN44_SOURCE_GET(x) -#define GPIO_PIN44_SOURCE_SET(x) WLAN_GPIO_PIN44_SOURCE_SET(x) -#define GPIO_PIN45_ADDRESS WLAN_GPIO_PIN45_ADDRESS -#define GPIO_PIN45_OFFSET WLAN_GPIO_PIN45_OFFSET -#define GPIO_PIN45_CONFIG_MSB WLAN_GPIO_PIN45_CONFIG_MSB -#define GPIO_PIN45_CONFIG_LSB WLAN_GPIO_PIN45_CONFIG_LSB -#define GPIO_PIN45_CONFIG_MASK WLAN_GPIO_PIN45_CONFIG_MASK -#define GPIO_PIN45_CONFIG_GET(x) WLAN_GPIO_PIN45_CONFIG_GET(x) -#define GPIO_PIN45_CONFIG_SET(x) WLAN_GPIO_PIN45_CONFIG_SET(x) -#define GPIO_PIN45_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN45_WAKEUP_ENABLE_MSB -#define GPIO_PIN45_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN45_WAKEUP_ENABLE_LSB -#define GPIO_PIN45_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN45_WAKEUP_ENABLE_MASK -#define GPIO_PIN45_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN45_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN45_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN45_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN45_INT_TYPE_MSB WLAN_GPIO_PIN45_INT_TYPE_MSB -#define GPIO_PIN45_INT_TYPE_LSB WLAN_GPIO_PIN45_INT_TYPE_LSB -#define GPIO_PIN45_INT_TYPE_MASK WLAN_GPIO_PIN45_INT_TYPE_MASK -#define GPIO_PIN45_INT_TYPE_GET(x) WLAN_GPIO_PIN45_INT_TYPE_GET(x) -#define GPIO_PIN45_INT_TYPE_SET(x) WLAN_GPIO_PIN45_INT_TYPE_SET(x) -#define GPIO_PIN45_PAD_PULL_MSB WLAN_GPIO_PIN45_PAD_PULL_MSB -#define GPIO_PIN45_PAD_PULL_LSB WLAN_GPIO_PIN45_PAD_PULL_LSB -#define GPIO_PIN45_PAD_PULL_MASK WLAN_GPIO_PIN45_PAD_PULL_MASK -#define GPIO_PIN45_PAD_PULL_GET(x) WLAN_GPIO_PIN45_PAD_PULL_GET(x) -#define GPIO_PIN45_PAD_PULL_SET(x) WLAN_GPIO_PIN45_PAD_PULL_SET(x) -#define GPIO_PIN45_PAD_STRENGTH_MSB WLAN_GPIO_PIN45_PAD_STRENGTH_MSB -#define GPIO_PIN45_PAD_STRENGTH_LSB WLAN_GPIO_PIN45_PAD_STRENGTH_LSB -#define GPIO_PIN45_PAD_STRENGTH_MASK WLAN_GPIO_PIN45_PAD_STRENGTH_MASK -#define GPIO_PIN45_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN45_PAD_STRENGTH_GET(x) -#define GPIO_PIN45_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN45_PAD_STRENGTH_SET(x) -#define GPIO_PIN45_PAD_DRIVER_MSB WLAN_GPIO_PIN45_PAD_DRIVER_MSB -#define GPIO_PIN45_PAD_DRIVER_LSB WLAN_GPIO_PIN45_PAD_DRIVER_LSB -#define GPIO_PIN45_PAD_DRIVER_MASK WLAN_GPIO_PIN45_PAD_DRIVER_MASK -#define GPIO_PIN45_PAD_DRIVER_GET(x) WLAN_GPIO_PIN45_PAD_DRIVER_GET(x) -#define GPIO_PIN45_PAD_DRIVER_SET(x) WLAN_GPIO_PIN45_PAD_DRIVER_SET(x) -#define GPIO_PIN45_SOURCE_MSB WLAN_GPIO_PIN45_SOURCE_MSB -#define GPIO_PIN45_SOURCE_LSB WLAN_GPIO_PIN45_SOURCE_LSB -#define GPIO_PIN45_SOURCE_MASK WLAN_GPIO_PIN45_SOURCE_MASK -#define GPIO_PIN45_SOURCE_GET(x) WLAN_GPIO_PIN45_SOURCE_GET(x) -#define GPIO_PIN45_SOURCE_SET(x) WLAN_GPIO_PIN45_SOURCE_SET(x) -#define GPIO_PIN46_ADDRESS WLAN_GPIO_PIN46_ADDRESS -#define GPIO_PIN46_OFFSET WLAN_GPIO_PIN46_OFFSET -#define GPIO_PIN46_CONFIG_MSB WLAN_GPIO_PIN46_CONFIG_MSB -#define GPIO_PIN46_CONFIG_LSB WLAN_GPIO_PIN46_CONFIG_LSB -#define GPIO_PIN46_CONFIG_MASK WLAN_GPIO_PIN46_CONFIG_MASK -#define GPIO_PIN46_CONFIG_GET(x) WLAN_GPIO_PIN46_CONFIG_GET(x) -#define GPIO_PIN46_CONFIG_SET(x) WLAN_GPIO_PIN46_CONFIG_SET(x) -#define GPIO_PIN46_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN46_WAKEUP_ENABLE_MSB -#define GPIO_PIN46_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN46_WAKEUP_ENABLE_LSB -#define GPIO_PIN46_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN46_WAKEUP_ENABLE_MASK -#define GPIO_PIN46_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN46_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN46_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN46_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN46_INT_TYPE_MSB WLAN_GPIO_PIN46_INT_TYPE_MSB -#define GPIO_PIN46_INT_TYPE_LSB WLAN_GPIO_PIN46_INT_TYPE_LSB -#define GPIO_PIN46_INT_TYPE_MASK WLAN_GPIO_PIN46_INT_TYPE_MASK -#define GPIO_PIN46_INT_TYPE_GET(x) WLAN_GPIO_PIN46_INT_TYPE_GET(x) -#define GPIO_PIN46_INT_TYPE_SET(x) WLAN_GPIO_PIN46_INT_TYPE_SET(x) -#define GPIO_PIN46_PAD_PULL_MSB WLAN_GPIO_PIN46_PAD_PULL_MSB -#define GPIO_PIN46_PAD_PULL_LSB WLAN_GPIO_PIN46_PAD_PULL_LSB -#define GPIO_PIN46_PAD_PULL_MASK WLAN_GPIO_PIN46_PAD_PULL_MASK -#define GPIO_PIN46_PAD_PULL_GET(x) WLAN_GPIO_PIN46_PAD_PULL_GET(x) -#define GPIO_PIN46_PAD_PULL_SET(x) WLAN_GPIO_PIN46_PAD_PULL_SET(x) -#define GPIO_PIN46_PAD_STRENGTH_MSB WLAN_GPIO_PIN46_PAD_STRENGTH_MSB -#define GPIO_PIN46_PAD_STRENGTH_LSB WLAN_GPIO_PIN46_PAD_STRENGTH_LSB -#define GPIO_PIN46_PAD_STRENGTH_MASK WLAN_GPIO_PIN46_PAD_STRENGTH_MASK -#define GPIO_PIN46_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN46_PAD_STRENGTH_GET(x) -#define GPIO_PIN46_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN46_PAD_STRENGTH_SET(x) -#define GPIO_PIN46_PAD_DRIVER_MSB WLAN_GPIO_PIN46_PAD_DRIVER_MSB -#define GPIO_PIN46_PAD_DRIVER_LSB WLAN_GPIO_PIN46_PAD_DRIVER_LSB -#define GPIO_PIN46_PAD_DRIVER_MASK WLAN_GPIO_PIN46_PAD_DRIVER_MASK -#define GPIO_PIN46_PAD_DRIVER_GET(x) WLAN_GPIO_PIN46_PAD_DRIVER_GET(x) -#define GPIO_PIN46_PAD_DRIVER_SET(x) WLAN_GPIO_PIN46_PAD_DRIVER_SET(x) -#define GPIO_PIN46_SOURCE_MSB WLAN_GPIO_PIN46_SOURCE_MSB -#define GPIO_PIN46_SOURCE_LSB WLAN_GPIO_PIN46_SOURCE_LSB -#define GPIO_PIN46_SOURCE_MASK WLAN_GPIO_PIN46_SOURCE_MASK -#define GPIO_PIN46_SOURCE_GET(x) WLAN_GPIO_PIN46_SOURCE_GET(x) -#define GPIO_PIN46_SOURCE_SET(x) WLAN_GPIO_PIN46_SOURCE_SET(x) -#define GPIO_PIN47_ADDRESS WLAN_GPIO_PIN47_ADDRESS -#define GPIO_PIN47_OFFSET WLAN_GPIO_PIN47_OFFSET -#define GPIO_PIN47_CONFIG_MSB WLAN_GPIO_PIN47_CONFIG_MSB -#define GPIO_PIN47_CONFIG_LSB WLAN_GPIO_PIN47_CONFIG_LSB -#define GPIO_PIN47_CONFIG_MASK WLAN_GPIO_PIN47_CONFIG_MASK -#define GPIO_PIN47_CONFIG_GET(x) WLAN_GPIO_PIN47_CONFIG_GET(x) -#define GPIO_PIN47_CONFIG_SET(x) WLAN_GPIO_PIN47_CONFIG_SET(x) -#define GPIO_PIN47_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN47_WAKEUP_ENABLE_MSB -#define GPIO_PIN47_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN47_WAKEUP_ENABLE_LSB -#define GPIO_PIN47_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN47_WAKEUP_ENABLE_MASK -#define GPIO_PIN47_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN47_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN47_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN47_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN47_INT_TYPE_MSB WLAN_GPIO_PIN47_INT_TYPE_MSB -#define GPIO_PIN47_INT_TYPE_LSB WLAN_GPIO_PIN47_INT_TYPE_LSB -#define GPIO_PIN47_INT_TYPE_MASK WLAN_GPIO_PIN47_INT_TYPE_MASK -#define GPIO_PIN47_INT_TYPE_GET(x) WLAN_GPIO_PIN47_INT_TYPE_GET(x) -#define GPIO_PIN47_INT_TYPE_SET(x) WLAN_GPIO_PIN47_INT_TYPE_SET(x) -#define GPIO_PIN47_PAD_PULL_MSB WLAN_GPIO_PIN47_PAD_PULL_MSB -#define GPIO_PIN47_PAD_PULL_LSB WLAN_GPIO_PIN47_PAD_PULL_LSB -#define GPIO_PIN47_PAD_PULL_MASK WLAN_GPIO_PIN47_PAD_PULL_MASK -#define GPIO_PIN47_PAD_PULL_GET(x) WLAN_GPIO_PIN47_PAD_PULL_GET(x) -#define GPIO_PIN47_PAD_PULL_SET(x) WLAN_GPIO_PIN47_PAD_PULL_SET(x) -#define GPIO_PIN47_PAD_STRENGTH_MSB WLAN_GPIO_PIN47_PAD_STRENGTH_MSB -#define GPIO_PIN47_PAD_STRENGTH_LSB WLAN_GPIO_PIN47_PAD_STRENGTH_LSB -#define GPIO_PIN47_PAD_STRENGTH_MASK WLAN_GPIO_PIN47_PAD_STRENGTH_MASK -#define GPIO_PIN47_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN47_PAD_STRENGTH_GET(x) -#define GPIO_PIN47_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN47_PAD_STRENGTH_SET(x) -#define GPIO_PIN47_PAD_DRIVER_MSB WLAN_GPIO_PIN47_PAD_DRIVER_MSB -#define GPIO_PIN47_PAD_DRIVER_LSB WLAN_GPIO_PIN47_PAD_DRIVER_LSB -#define GPIO_PIN47_PAD_DRIVER_MASK WLAN_GPIO_PIN47_PAD_DRIVER_MASK -#define GPIO_PIN47_PAD_DRIVER_GET(x) WLAN_GPIO_PIN47_PAD_DRIVER_GET(x) -#define GPIO_PIN47_PAD_DRIVER_SET(x) WLAN_GPIO_PIN47_PAD_DRIVER_SET(x) -#define GPIO_PIN47_SOURCE_MSB WLAN_GPIO_PIN47_SOURCE_MSB -#define GPIO_PIN47_SOURCE_LSB WLAN_GPIO_PIN47_SOURCE_LSB -#define GPIO_PIN47_SOURCE_MASK WLAN_GPIO_PIN47_SOURCE_MASK -#define GPIO_PIN47_SOURCE_GET(x) WLAN_GPIO_PIN47_SOURCE_GET(x) -#define GPIO_PIN47_SOURCE_SET(x) WLAN_GPIO_PIN47_SOURCE_SET(x) -#define GPIO_PIN48_ADDRESS WLAN_GPIO_PIN48_ADDRESS -#define GPIO_PIN48_OFFSET WLAN_GPIO_PIN48_OFFSET -#define GPIO_PIN48_CONFIG_MSB WLAN_GPIO_PIN48_CONFIG_MSB -#define GPIO_PIN48_CONFIG_LSB WLAN_GPIO_PIN48_CONFIG_LSB -#define GPIO_PIN48_CONFIG_MASK WLAN_GPIO_PIN48_CONFIG_MASK -#define GPIO_PIN48_CONFIG_GET(x) WLAN_GPIO_PIN48_CONFIG_GET(x) -#define GPIO_PIN48_CONFIG_SET(x) WLAN_GPIO_PIN48_CONFIG_SET(x) -#define GPIO_PIN48_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN48_WAKEUP_ENABLE_MSB -#define GPIO_PIN48_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN48_WAKEUP_ENABLE_LSB -#define GPIO_PIN48_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN48_WAKEUP_ENABLE_MASK -#define GPIO_PIN48_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN48_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN48_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN48_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN48_INT_TYPE_MSB WLAN_GPIO_PIN48_INT_TYPE_MSB -#define GPIO_PIN48_INT_TYPE_LSB WLAN_GPIO_PIN48_INT_TYPE_LSB -#define GPIO_PIN48_INT_TYPE_MASK WLAN_GPIO_PIN48_INT_TYPE_MASK -#define GPIO_PIN48_INT_TYPE_GET(x) WLAN_GPIO_PIN48_INT_TYPE_GET(x) -#define GPIO_PIN48_INT_TYPE_SET(x) WLAN_GPIO_PIN48_INT_TYPE_SET(x) -#define GPIO_PIN48_PAD_PULL_MSB WLAN_GPIO_PIN48_PAD_PULL_MSB -#define GPIO_PIN48_PAD_PULL_LSB WLAN_GPIO_PIN48_PAD_PULL_LSB -#define GPIO_PIN48_PAD_PULL_MASK WLAN_GPIO_PIN48_PAD_PULL_MASK -#define GPIO_PIN48_PAD_PULL_GET(x) WLAN_GPIO_PIN48_PAD_PULL_GET(x) -#define GPIO_PIN48_PAD_PULL_SET(x) WLAN_GPIO_PIN48_PAD_PULL_SET(x) -#define GPIO_PIN48_PAD_STRENGTH_MSB WLAN_GPIO_PIN48_PAD_STRENGTH_MSB -#define GPIO_PIN48_PAD_STRENGTH_LSB WLAN_GPIO_PIN48_PAD_STRENGTH_LSB -#define GPIO_PIN48_PAD_STRENGTH_MASK WLAN_GPIO_PIN48_PAD_STRENGTH_MASK -#define GPIO_PIN48_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN48_PAD_STRENGTH_GET(x) -#define GPIO_PIN48_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN48_PAD_STRENGTH_SET(x) -#define GPIO_PIN48_PAD_DRIVER_MSB WLAN_GPIO_PIN48_PAD_DRIVER_MSB -#define GPIO_PIN48_PAD_DRIVER_LSB WLAN_GPIO_PIN48_PAD_DRIVER_LSB -#define GPIO_PIN48_PAD_DRIVER_MASK WLAN_GPIO_PIN48_PAD_DRIVER_MASK -#define GPIO_PIN48_PAD_DRIVER_GET(x) WLAN_GPIO_PIN48_PAD_DRIVER_GET(x) -#define GPIO_PIN48_PAD_DRIVER_SET(x) WLAN_GPIO_PIN48_PAD_DRIVER_SET(x) -#define GPIO_PIN48_SOURCE_MSB WLAN_GPIO_PIN48_SOURCE_MSB -#define GPIO_PIN48_SOURCE_LSB WLAN_GPIO_PIN48_SOURCE_LSB -#define GPIO_PIN48_SOURCE_MASK WLAN_GPIO_PIN48_SOURCE_MASK -#define GPIO_PIN48_SOURCE_GET(x) WLAN_GPIO_PIN48_SOURCE_GET(x) -#define GPIO_PIN48_SOURCE_SET(x) WLAN_GPIO_PIN48_SOURCE_SET(x) -#define GPIO_PIN49_ADDRESS WLAN_GPIO_PIN49_ADDRESS -#define GPIO_PIN49_OFFSET WLAN_GPIO_PIN49_OFFSET -#define GPIO_PIN49_CONFIG_MSB WLAN_GPIO_PIN49_CONFIG_MSB -#define GPIO_PIN49_CONFIG_LSB WLAN_GPIO_PIN49_CONFIG_LSB -#define GPIO_PIN49_CONFIG_MASK WLAN_GPIO_PIN49_CONFIG_MASK -#define GPIO_PIN49_CONFIG_GET(x) WLAN_GPIO_PIN49_CONFIG_GET(x) -#define GPIO_PIN49_CONFIG_SET(x) WLAN_GPIO_PIN49_CONFIG_SET(x) -#define GPIO_PIN49_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN49_WAKEUP_ENABLE_MSB -#define GPIO_PIN49_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN49_WAKEUP_ENABLE_LSB -#define GPIO_PIN49_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN49_WAKEUP_ENABLE_MASK -#define GPIO_PIN49_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN49_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN49_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN49_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN49_INT_TYPE_MSB WLAN_GPIO_PIN49_INT_TYPE_MSB -#define GPIO_PIN49_INT_TYPE_LSB WLAN_GPIO_PIN49_INT_TYPE_LSB -#define GPIO_PIN49_INT_TYPE_MASK WLAN_GPIO_PIN49_INT_TYPE_MASK -#define GPIO_PIN49_INT_TYPE_GET(x) WLAN_GPIO_PIN49_INT_TYPE_GET(x) -#define GPIO_PIN49_INT_TYPE_SET(x) WLAN_GPIO_PIN49_INT_TYPE_SET(x) -#define GPIO_PIN49_PAD_PULL_MSB WLAN_GPIO_PIN49_PAD_PULL_MSB -#define GPIO_PIN49_PAD_PULL_LSB WLAN_GPIO_PIN49_PAD_PULL_LSB -#define GPIO_PIN49_PAD_PULL_MASK WLAN_GPIO_PIN49_PAD_PULL_MASK -#define GPIO_PIN49_PAD_PULL_GET(x) WLAN_GPIO_PIN49_PAD_PULL_GET(x) -#define GPIO_PIN49_PAD_PULL_SET(x) WLAN_GPIO_PIN49_PAD_PULL_SET(x) -#define GPIO_PIN49_PAD_STRENGTH_MSB WLAN_GPIO_PIN49_PAD_STRENGTH_MSB -#define GPIO_PIN49_PAD_STRENGTH_LSB WLAN_GPIO_PIN49_PAD_STRENGTH_LSB -#define GPIO_PIN49_PAD_STRENGTH_MASK WLAN_GPIO_PIN49_PAD_STRENGTH_MASK -#define GPIO_PIN49_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN49_PAD_STRENGTH_GET(x) -#define GPIO_PIN49_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN49_PAD_STRENGTH_SET(x) -#define GPIO_PIN49_PAD_DRIVER_MSB WLAN_GPIO_PIN49_PAD_DRIVER_MSB -#define GPIO_PIN49_PAD_DRIVER_LSB WLAN_GPIO_PIN49_PAD_DRIVER_LSB -#define GPIO_PIN49_PAD_DRIVER_MASK WLAN_GPIO_PIN49_PAD_DRIVER_MASK -#define GPIO_PIN49_PAD_DRIVER_GET(x) WLAN_GPIO_PIN49_PAD_DRIVER_GET(x) -#define GPIO_PIN49_PAD_DRIVER_SET(x) WLAN_GPIO_PIN49_PAD_DRIVER_SET(x) -#define GPIO_PIN49_SOURCE_MSB WLAN_GPIO_PIN49_SOURCE_MSB -#define GPIO_PIN49_SOURCE_LSB WLAN_GPIO_PIN49_SOURCE_LSB -#define GPIO_PIN49_SOURCE_MASK WLAN_GPIO_PIN49_SOURCE_MASK -#define GPIO_PIN49_SOURCE_GET(x) WLAN_GPIO_PIN49_SOURCE_GET(x) -#define GPIO_PIN49_SOURCE_SET(x) WLAN_GPIO_PIN49_SOURCE_SET(x) -#define GPIO_PIN50_ADDRESS WLAN_GPIO_PIN50_ADDRESS -#define GPIO_PIN50_OFFSET WLAN_GPIO_PIN50_OFFSET -#define GPIO_PIN50_CONFIG_MSB WLAN_GPIO_PIN50_CONFIG_MSB -#define GPIO_PIN50_CONFIG_LSB WLAN_GPIO_PIN50_CONFIG_LSB -#define GPIO_PIN50_CONFIG_MASK WLAN_GPIO_PIN50_CONFIG_MASK -#define GPIO_PIN50_CONFIG_GET(x) WLAN_GPIO_PIN50_CONFIG_GET(x) -#define GPIO_PIN50_CONFIG_SET(x) WLAN_GPIO_PIN50_CONFIG_SET(x) -#define GPIO_PIN50_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN50_WAKEUP_ENABLE_MSB -#define GPIO_PIN50_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN50_WAKEUP_ENABLE_LSB -#define GPIO_PIN50_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN50_WAKEUP_ENABLE_MASK -#define GPIO_PIN50_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN50_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN50_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN50_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN50_INT_TYPE_MSB WLAN_GPIO_PIN50_INT_TYPE_MSB -#define GPIO_PIN50_INT_TYPE_LSB WLAN_GPIO_PIN50_INT_TYPE_LSB -#define GPIO_PIN50_INT_TYPE_MASK WLAN_GPIO_PIN50_INT_TYPE_MASK -#define GPIO_PIN50_INT_TYPE_GET(x) WLAN_GPIO_PIN50_INT_TYPE_GET(x) -#define GPIO_PIN50_INT_TYPE_SET(x) WLAN_GPIO_PIN50_INT_TYPE_SET(x) -#define GPIO_PIN50_PAD_PULL_MSB WLAN_GPIO_PIN50_PAD_PULL_MSB -#define GPIO_PIN50_PAD_PULL_LSB WLAN_GPIO_PIN50_PAD_PULL_LSB -#define GPIO_PIN50_PAD_PULL_MASK WLAN_GPIO_PIN50_PAD_PULL_MASK -#define GPIO_PIN50_PAD_PULL_GET(x) WLAN_GPIO_PIN50_PAD_PULL_GET(x) -#define GPIO_PIN50_PAD_PULL_SET(x) WLAN_GPIO_PIN50_PAD_PULL_SET(x) -#define GPIO_PIN50_PAD_STRENGTH_MSB WLAN_GPIO_PIN50_PAD_STRENGTH_MSB -#define GPIO_PIN50_PAD_STRENGTH_LSB WLAN_GPIO_PIN50_PAD_STRENGTH_LSB -#define GPIO_PIN50_PAD_STRENGTH_MASK WLAN_GPIO_PIN50_PAD_STRENGTH_MASK -#define GPIO_PIN50_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN50_PAD_STRENGTH_GET(x) -#define GPIO_PIN50_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN50_PAD_STRENGTH_SET(x) -#define GPIO_PIN50_PAD_DRIVER_MSB WLAN_GPIO_PIN50_PAD_DRIVER_MSB -#define GPIO_PIN50_PAD_DRIVER_LSB WLAN_GPIO_PIN50_PAD_DRIVER_LSB -#define GPIO_PIN50_PAD_DRIVER_MASK WLAN_GPIO_PIN50_PAD_DRIVER_MASK -#define GPIO_PIN50_PAD_DRIVER_GET(x) WLAN_GPIO_PIN50_PAD_DRIVER_GET(x) -#define GPIO_PIN50_PAD_DRIVER_SET(x) WLAN_GPIO_PIN50_PAD_DRIVER_SET(x) -#define GPIO_PIN50_SOURCE_MSB WLAN_GPIO_PIN50_SOURCE_MSB -#define GPIO_PIN50_SOURCE_LSB WLAN_GPIO_PIN50_SOURCE_LSB -#define GPIO_PIN50_SOURCE_MASK WLAN_GPIO_PIN50_SOURCE_MASK -#define GPIO_PIN50_SOURCE_GET(x) WLAN_GPIO_PIN50_SOURCE_GET(x) -#define GPIO_PIN50_SOURCE_SET(x) WLAN_GPIO_PIN50_SOURCE_SET(x) -#define GPIO_PIN51_ADDRESS WLAN_GPIO_PIN51_ADDRESS -#define GPIO_PIN51_OFFSET WLAN_GPIO_PIN51_OFFSET -#define GPIO_PIN51_CONFIG_MSB WLAN_GPIO_PIN51_CONFIG_MSB -#define GPIO_PIN51_CONFIG_LSB WLAN_GPIO_PIN51_CONFIG_LSB -#define GPIO_PIN51_CONFIG_MASK WLAN_GPIO_PIN51_CONFIG_MASK -#define GPIO_PIN51_CONFIG_GET(x) WLAN_GPIO_PIN51_CONFIG_GET(x) -#define GPIO_PIN51_CONFIG_SET(x) WLAN_GPIO_PIN51_CONFIG_SET(x) -#define GPIO_PIN51_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN51_WAKEUP_ENABLE_MSB -#define GPIO_PIN51_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN51_WAKEUP_ENABLE_LSB -#define GPIO_PIN51_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN51_WAKEUP_ENABLE_MASK -#define GPIO_PIN51_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN51_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN51_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN51_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN51_INT_TYPE_MSB WLAN_GPIO_PIN51_INT_TYPE_MSB -#define GPIO_PIN51_INT_TYPE_LSB WLAN_GPIO_PIN51_INT_TYPE_LSB -#define GPIO_PIN51_INT_TYPE_MASK WLAN_GPIO_PIN51_INT_TYPE_MASK -#define GPIO_PIN51_INT_TYPE_GET(x) WLAN_GPIO_PIN51_INT_TYPE_GET(x) -#define GPIO_PIN51_INT_TYPE_SET(x) WLAN_GPIO_PIN51_INT_TYPE_SET(x) -#define GPIO_PIN51_PAD_PULL_MSB WLAN_GPIO_PIN51_PAD_PULL_MSB -#define GPIO_PIN51_PAD_PULL_LSB WLAN_GPIO_PIN51_PAD_PULL_LSB -#define GPIO_PIN51_PAD_PULL_MASK WLAN_GPIO_PIN51_PAD_PULL_MASK -#define GPIO_PIN51_PAD_PULL_GET(x) WLAN_GPIO_PIN51_PAD_PULL_GET(x) -#define GPIO_PIN51_PAD_PULL_SET(x) WLAN_GPIO_PIN51_PAD_PULL_SET(x) -#define GPIO_PIN51_PAD_STRENGTH_MSB WLAN_GPIO_PIN51_PAD_STRENGTH_MSB -#define GPIO_PIN51_PAD_STRENGTH_LSB WLAN_GPIO_PIN51_PAD_STRENGTH_LSB -#define GPIO_PIN51_PAD_STRENGTH_MASK WLAN_GPIO_PIN51_PAD_STRENGTH_MASK -#define GPIO_PIN51_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN51_PAD_STRENGTH_GET(x) -#define GPIO_PIN51_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN51_PAD_STRENGTH_SET(x) -#define GPIO_PIN51_PAD_DRIVER_MSB WLAN_GPIO_PIN51_PAD_DRIVER_MSB -#define GPIO_PIN51_PAD_DRIVER_LSB WLAN_GPIO_PIN51_PAD_DRIVER_LSB -#define GPIO_PIN51_PAD_DRIVER_MASK WLAN_GPIO_PIN51_PAD_DRIVER_MASK -#define GPIO_PIN51_PAD_DRIVER_GET(x) WLAN_GPIO_PIN51_PAD_DRIVER_GET(x) -#define GPIO_PIN51_PAD_DRIVER_SET(x) WLAN_GPIO_PIN51_PAD_DRIVER_SET(x) -#define GPIO_PIN51_SOURCE_MSB WLAN_GPIO_PIN51_SOURCE_MSB -#define GPIO_PIN51_SOURCE_LSB WLAN_GPIO_PIN51_SOURCE_LSB -#define GPIO_PIN51_SOURCE_MASK WLAN_GPIO_PIN51_SOURCE_MASK -#define GPIO_PIN51_SOURCE_GET(x) WLAN_GPIO_PIN51_SOURCE_GET(x) -#define GPIO_PIN51_SOURCE_SET(x) WLAN_GPIO_PIN51_SOURCE_SET(x) -#define GPIO_PIN52_ADDRESS WLAN_GPIO_PIN52_ADDRESS -#define GPIO_PIN52_OFFSET WLAN_GPIO_PIN52_OFFSET -#define GPIO_PIN52_CONFIG_MSB WLAN_GPIO_PIN52_CONFIG_MSB -#define GPIO_PIN52_CONFIG_LSB WLAN_GPIO_PIN52_CONFIG_LSB -#define GPIO_PIN52_CONFIG_MASK WLAN_GPIO_PIN52_CONFIG_MASK -#define GPIO_PIN52_CONFIG_GET(x) WLAN_GPIO_PIN52_CONFIG_GET(x) -#define GPIO_PIN52_CONFIG_SET(x) WLAN_GPIO_PIN52_CONFIG_SET(x) -#define GPIO_PIN52_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN52_WAKEUP_ENABLE_MSB -#define GPIO_PIN52_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN52_WAKEUP_ENABLE_LSB -#define GPIO_PIN52_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN52_WAKEUP_ENABLE_MASK -#define GPIO_PIN52_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN52_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN52_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN52_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN52_INT_TYPE_MSB WLAN_GPIO_PIN52_INT_TYPE_MSB -#define GPIO_PIN52_INT_TYPE_LSB WLAN_GPIO_PIN52_INT_TYPE_LSB -#define GPIO_PIN52_INT_TYPE_MASK WLAN_GPIO_PIN52_INT_TYPE_MASK -#define GPIO_PIN52_INT_TYPE_GET(x) WLAN_GPIO_PIN52_INT_TYPE_GET(x) -#define GPIO_PIN52_INT_TYPE_SET(x) WLAN_GPIO_PIN52_INT_TYPE_SET(x) -#define GPIO_PIN52_PAD_PULL_MSB WLAN_GPIO_PIN52_PAD_PULL_MSB -#define GPIO_PIN52_PAD_PULL_LSB WLAN_GPIO_PIN52_PAD_PULL_LSB -#define GPIO_PIN52_PAD_PULL_MASK WLAN_GPIO_PIN52_PAD_PULL_MASK -#define GPIO_PIN52_PAD_PULL_GET(x) WLAN_GPIO_PIN52_PAD_PULL_GET(x) -#define GPIO_PIN52_PAD_PULL_SET(x) WLAN_GPIO_PIN52_PAD_PULL_SET(x) -#define GPIO_PIN52_PAD_STRENGTH_MSB WLAN_GPIO_PIN52_PAD_STRENGTH_MSB -#define GPIO_PIN52_PAD_STRENGTH_LSB WLAN_GPIO_PIN52_PAD_STRENGTH_LSB -#define GPIO_PIN52_PAD_STRENGTH_MASK WLAN_GPIO_PIN52_PAD_STRENGTH_MASK -#define GPIO_PIN52_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN52_PAD_STRENGTH_GET(x) -#define GPIO_PIN52_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN52_PAD_STRENGTH_SET(x) -#define GPIO_PIN52_PAD_DRIVER_MSB WLAN_GPIO_PIN52_PAD_DRIVER_MSB -#define GPIO_PIN52_PAD_DRIVER_LSB WLAN_GPIO_PIN52_PAD_DRIVER_LSB -#define GPIO_PIN52_PAD_DRIVER_MASK WLAN_GPIO_PIN52_PAD_DRIVER_MASK -#define GPIO_PIN52_PAD_DRIVER_GET(x) WLAN_GPIO_PIN52_PAD_DRIVER_GET(x) -#define GPIO_PIN52_PAD_DRIVER_SET(x) WLAN_GPIO_PIN52_PAD_DRIVER_SET(x) -#define GPIO_PIN52_SOURCE_MSB WLAN_GPIO_PIN52_SOURCE_MSB -#define GPIO_PIN52_SOURCE_LSB WLAN_GPIO_PIN52_SOURCE_LSB -#define GPIO_PIN52_SOURCE_MASK WLAN_GPIO_PIN52_SOURCE_MASK -#define GPIO_PIN52_SOURCE_GET(x) WLAN_GPIO_PIN52_SOURCE_GET(x) -#define GPIO_PIN52_SOURCE_SET(x) WLAN_GPIO_PIN52_SOURCE_SET(x) -#define GPIO_PIN53_ADDRESS WLAN_GPIO_PIN53_ADDRESS -#define GPIO_PIN53_OFFSET WLAN_GPIO_PIN53_OFFSET -#define GPIO_PIN53_CONFIG_MSB WLAN_GPIO_PIN53_CONFIG_MSB -#define GPIO_PIN53_CONFIG_LSB WLAN_GPIO_PIN53_CONFIG_LSB -#define GPIO_PIN53_CONFIG_MASK WLAN_GPIO_PIN53_CONFIG_MASK -#define GPIO_PIN53_CONFIG_GET(x) WLAN_GPIO_PIN53_CONFIG_GET(x) -#define GPIO_PIN53_CONFIG_SET(x) WLAN_GPIO_PIN53_CONFIG_SET(x) -#define GPIO_PIN53_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN53_WAKEUP_ENABLE_MSB -#define GPIO_PIN53_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN53_WAKEUP_ENABLE_LSB -#define GPIO_PIN53_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN53_WAKEUP_ENABLE_MASK -#define GPIO_PIN53_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN53_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN53_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN53_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN53_INT_TYPE_MSB WLAN_GPIO_PIN53_INT_TYPE_MSB -#define GPIO_PIN53_INT_TYPE_LSB WLAN_GPIO_PIN53_INT_TYPE_LSB -#define GPIO_PIN53_INT_TYPE_MASK WLAN_GPIO_PIN53_INT_TYPE_MASK -#define GPIO_PIN53_INT_TYPE_GET(x) WLAN_GPIO_PIN53_INT_TYPE_GET(x) -#define GPIO_PIN53_INT_TYPE_SET(x) WLAN_GPIO_PIN53_INT_TYPE_SET(x) -#define GPIO_PIN53_PAD_PULL_MSB WLAN_GPIO_PIN53_PAD_PULL_MSB -#define GPIO_PIN53_PAD_PULL_LSB WLAN_GPIO_PIN53_PAD_PULL_LSB -#define GPIO_PIN53_PAD_PULL_MASK WLAN_GPIO_PIN53_PAD_PULL_MASK -#define GPIO_PIN53_PAD_PULL_GET(x) WLAN_GPIO_PIN53_PAD_PULL_GET(x) -#define GPIO_PIN53_PAD_PULL_SET(x) WLAN_GPIO_PIN53_PAD_PULL_SET(x) -#define GPIO_PIN53_PAD_STRENGTH_MSB WLAN_GPIO_PIN53_PAD_STRENGTH_MSB -#define GPIO_PIN53_PAD_STRENGTH_LSB WLAN_GPIO_PIN53_PAD_STRENGTH_LSB -#define GPIO_PIN53_PAD_STRENGTH_MASK WLAN_GPIO_PIN53_PAD_STRENGTH_MASK -#define GPIO_PIN53_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN53_PAD_STRENGTH_GET(x) -#define GPIO_PIN53_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN53_PAD_STRENGTH_SET(x) -#define GPIO_PIN53_PAD_DRIVER_MSB WLAN_GPIO_PIN53_PAD_DRIVER_MSB -#define GPIO_PIN53_PAD_DRIVER_LSB WLAN_GPIO_PIN53_PAD_DRIVER_LSB -#define GPIO_PIN53_PAD_DRIVER_MASK WLAN_GPIO_PIN53_PAD_DRIVER_MASK -#define GPIO_PIN53_PAD_DRIVER_GET(x) WLAN_GPIO_PIN53_PAD_DRIVER_GET(x) -#define GPIO_PIN53_PAD_DRIVER_SET(x) WLAN_GPIO_PIN53_PAD_DRIVER_SET(x) -#define GPIO_PIN53_SOURCE_MSB WLAN_GPIO_PIN53_SOURCE_MSB -#define GPIO_PIN53_SOURCE_LSB WLAN_GPIO_PIN53_SOURCE_LSB -#define GPIO_PIN53_SOURCE_MASK WLAN_GPIO_PIN53_SOURCE_MASK -#define GPIO_PIN53_SOURCE_GET(x) WLAN_GPIO_PIN53_SOURCE_GET(x) -#define GPIO_PIN53_SOURCE_SET(x) WLAN_GPIO_PIN53_SOURCE_SET(x) -#define GPIO_PIN54_ADDRESS WLAN_GPIO_PIN54_ADDRESS -#define GPIO_PIN54_OFFSET WLAN_GPIO_PIN54_OFFSET -#define GPIO_PIN54_CONFIG_MSB WLAN_GPIO_PIN54_CONFIG_MSB -#define GPIO_PIN54_CONFIG_LSB WLAN_GPIO_PIN54_CONFIG_LSB -#define GPIO_PIN54_CONFIG_MASK WLAN_GPIO_PIN54_CONFIG_MASK -#define GPIO_PIN54_CONFIG_GET(x) WLAN_GPIO_PIN54_CONFIG_GET(x) -#define GPIO_PIN54_CONFIG_SET(x) WLAN_GPIO_PIN54_CONFIG_SET(x) -#define GPIO_PIN54_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN54_WAKEUP_ENABLE_MSB -#define GPIO_PIN54_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN54_WAKEUP_ENABLE_LSB -#define GPIO_PIN54_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN54_WAKEUP_ENABLE_MASK -#define GPIO_PIN54_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN54_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN54_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN54_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN54_INT_TYPE_MSB WLAN_GPIO_PIN54_INT_TYPE_MSB -#define GPIO_PIN54_INT_TYPE_LSB WLAN_GPIO_PIN54_INT_TYPE_LSB -#define GPIO_PIN54_INT_TYPE_MASK WLAN_GPIO_PIN54_INT_TYPE_MASK -#define GPIO_PIN54_INT_TYPE_GET(x) WLAN_GPIO_PIN54_INT_TYPE_GET(x) -#define GPIO_PIN54_INT_TYPE_SET(x) WLAN_GPIO_PIN54_INT_TYPE_SET(x) -#define GPIO_PIN54_PAD_PULL_MSB WLAN_GPIO_PIN54_PAD_PULL_MSB -#define GPIO_PIN54_PAD_PULL_LSB WLAN_GPIO_PIN54_PAD_PULL_LSB -#define GPIO_PIN54_PAD_PULL_MASK WLAN_GPIO_PIN54_PAD_PULL_MASK -#define GPIO_PIN54_PAD_PULL_GET(x) WLAN_GPIO_PIN54_PAD_PULL_GET(x) -#define GPIO_PIN54_PAD_PULL_SET(x) WLAN_GPIO_PIN54_PAD_PULL_SET(x) -#define GPIO_PIN54_PAD_STRENGTH_MSB WLAN_GPIO_PIN54_PAD_STRENGTH_MSB -#define GPIO_PIN54_PAD_STRENGTH_LSB WLAN_GPIO_PIN54_PAD_STRENGTH_LSB -#define GPIO_PIN54_PAD_STRENGTH_MASK WLAN_GPIO_PIN54_PAD_STRENGTH_MASK -#define GPIO_PIN54_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN54_PAD_STRENGTH_GET(x) -#define GPIO_PIN54_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN54_PAD_STRENGTH_SET(x) -#define GPIO_PIN54_PAD_DRIVER_MSB WLAN_GPIO_PIN54_PAD_DRIVER_MSB -#define GPIO_PIN54_PAD_DRIVER_LSB WLAN_GPIO_PIN54_PAD_DRIVER_LSB -#define GPIO_PIN54_PAD_DRIVER_MASK WLAN_GPIO_PIN54_PAD_DRIVER_MASK -#define GPIO_PIN54_PAD_DRIVER_GET(x) WLAN_GPIO_PIN54_PAD_DRIVER_GET(x) -#define GPIO_PIN54_PAD_DRIVER_SET(x) WLAN_GPIO_PIN54_PAD_DRIVER_SET(x) -#define GPIO_PIN54_SOURCE_MSB WLAN_GPIO_PIN54_SOURCE_MSB -#define GPIO_PIN54_SOURCE_LSB WLAN_GPIO_PIN54_SOURCE_LSB -#define GPIO_PIN54_SOURCE_MASK WLAN_GPIO_PIN54_SOURCE_MASK -#define GPIO_PIN54_SOURCE_GET(x) WLAN_GPIO_PIN54_SOURCE_GET(x) -#define GPIO_PIN54_SOURCE_SET(x) WLAN_GPIO_PIN54_SOURCE_SET(x) -#define GPIO_PIN55_ADDRESS WLAN_GPIO_PIN55_ADDRESS -#define GPIO_PIN55_OFFSET WLAN_GPIO_PIN55_OFFSET -#define GPIO_PIN55_CONFIG_MSB WLAN_GPIO_PIN55_CONFIG_MSB -#define GPIO_PIN55_CONFIG_LSB WLAN_GPIO_PIN55_CONFIG_LSB -#define GPIO_PIN55_CONFIG_MASK WLAN_GPIO_PIN55_CONFIG_MASK -#define GPIO_PIN55_CONFIG_GET(x) WLAN_GPIO_PIN55_CONFIG_GET(x) -#define GPIO_PIN55_CONFIG_SET(x) WLAN_GPIO_PIN55_CONFIG_SET(x) -#define GPIO_PIN55_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN55_WAKEUP_ENABLE_MSB -#define GPIO_PIN55_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN55_WAKEUP_ENABLE_LSB -#define GPIO_PIN55_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN55_WAKEUP_ENABLE_MASK -#define GPIO_PIN55_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN55_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN55_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN55_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN55_INT_TYPE_MSB WLAN_GPIO_PIN55_INT_TYPE_MSB -#define GPIO_PIN55_INT_TYPE_LSB WLAN_GPIO_PIN55_INT_TYPE_LSB -#define GPIO_PIN55_INT_TYPE_MASK WLAN_GPIO_PIN55_INT_TYPE_MASK -#define GPIO_PIN55_INT_TYPE_GET(x) WLAN_GPIO_PIN55_INT_TYPE_GET(x) -#define GPIO_PIN55_INT_TYPE_SET(x) WLAN_GPIO_PIN55_INT_TYPE_SET(x) -#define GPIO_PIN55_PAD_PULL_MSB WLAN_GPIO_PIN55_PAD_PULL_MSB -#define GPIO_PIN55_PAD_PULL_LSB WLAN_GPIO_PIN55_PAD_PULL_LSB -#define GPIO_PIN55_PAD_PULL_MASK WLAN_GPIO_PIN55_PAD_PULL_MASK -#define GPIO_PIN55_PAD_PULL_GET(x) WLAN_GPIO_PIN55_PAD_PULL_GET(x) -#define GPIO_PIN55_PAD_PULL_SET(x) WLAN_GPIO_PIN55_PAD_PULL_SET(x) -#define GPIO_PIN55_PAD_STRENGTH_MSB WLAN_GPIO_PIN55_PAD_STRENGTH_MSB -#define GPIO_PIN55_PAD_STRENGTH_LSB WLAN_GPIO_PIN55_PAD_STRENGTH_LSB -#define GPIO_PIN55_PAD_STRENGTH_MASK WLAN_GPIO_PIN55_PAD_STRENGTH_MASK -#define GPIO_PIN55_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN55_PAD_STRENGTH_GET(x) -#define GPIO_PIN55_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN55_PAD_STRENGTH_SET(x) -#define GPIO_PIN55_PAD_DRIVER_MSB WLAN_GPIO_PIN55_PAD_DRIVER_MSB -#define GPIO_PIN55_PAD_DRIVER_LSB WLAN_GPIO_PIN55_PAD_DRIVER_LSB -#define GPIO_PIN55_PAD_DRIVER_MASK WLAN_GPIO_PIN55_PAD_DRIVER_MASK -#define GPIO_PIN55_PAD_DRIVER_GET(x) WLAN_GPIO_PIN55_PAD_DRIVER_GET(x) -#define GPIO_PIN55_PAD_DRIVER_SET(x) WLAN_GPIO_PIN55_PAD_DRIVER_SET(x) -#define GPIO_PIN55_SOURCE_MSB WLAN_GPIO_PIN55_SOURCE_MSB -#define GPIO_PIN55_SOURCE_LSB WLAN_GPIO_PIN55_SOURCE_LSB -#define GPIO_PIN55_SOURCE_MASK WLAN_GPIO_PIN55_SOURCE_MASK -#define GPIO_PIN55_SOURCE_GET(x) WLAN_GPIO_PIN55_SOURCE_GET(x) -#define GPIO_PIN55_SOURCE_SET(x) WLAN_GPIO_PIN55_SOURCE_SET(x) -#define GPIO_PIN56_ADDRESS WLAN_GPIO_PIN56_ADDRESS -#define GPIO_PIN56_OFFSET WLAN_GPIO_PIN56_OFFSET -#define GPIO_PIN56_CONFIG_MSB WLAN_GPIO_PIN56_CONFIG_MSB -#define GPIO_PIN56_CONFIG_LSB WLAN_GPIO_PIN56_CONFIG_LSB -#define GPIO_PIN56_CONFIG_MASK WLAN_GPIO_PIN56_CONFIG_MASK -#define GPIO_PIN56_CONFIG_GET(x) WLAN_GPIO_PIN56_CONFIG_GET(x) -#define GPIO_PIN56_CONFIG_SET(x) WLAN_GPIO_PIN56_CONFIG_SET(x) -#define GPIO_PIN56_WAKEUP_ENABLE_MSB WLAN_GPIO_PIN56_WAKEUP_ENABLE_MSB -#define GPIO_PIN56_WAKEUP_ENABLE_LSB WLAN_GPIO_PIN56_WAKEUP_ENABLE_LSB -#define GPIO_PIN56_WAKEUP_ENABLE_MASK WLAN_GPIO_PIN56_WAKEUP_ENABLE_MASK -#define GPIO_PIN56_WAKEUP_ENABLE_GET(x) WLAN_GPIO_PIN56_WAKEUP_ENABLE_GET(x) -#define GPIO_PIN56_WAKEUP_ENABLE_SET(x) WLAN_GPIO_PIN56_WAKEUP_ENABLE_SET(x) -#define GPIO_PIN56_INT_TYPE_MSB WLAN_GPIO_PIN56_INT_TYPE_MSB -#define GPIO_PIN56_INT_TYPE_LSB WLAN_GPIO_PIN56_INT_TYPE_LSB -#define GPIO_PIN56_INT_TYPE_MASK WLAN_GPIO_PIN56_INT_TYPE_MASK -#define GPIO_PIN56_INT_TYPE_GET(x) WLAN_GPIO_PIN56_INT_TYPE_GET(x) -#define GPIO_PIN56_INT_TYPE_SET(x) WLAN_GPIO_PIN56_INT_TYPE_SET(x) -#define GPIO_PIN56_PAD_PULL_MSB WLAN_GPIO_PIN56_PAD_PULL_MSB -#define GPIO_PIN56_PAD_PULL_LSB WLAN_GPIO_PIN56_PAD_PULL_LSB -#define GPIO_PIN56_PAD_PULL_MASK WLAN_GPIO_PIN56_PAD_PULL_MASK -#define GPIO_PIN56_PAD_PULL_GET(x) WLAN_GPIO_PIN56_PAD_PULL_GET(x) -#define GPIO_PIN56_PAD_PULL_SET(x) WLAN_GPIO_PIN56_PAD_PULL_SET(x) -#define GPIO_PIN56_PAD_STRENGTH_MSB WLAN_GPIO_PIN56_PAD_STRENGTH_MSB -#define GPIO_PIN56_PAD_STRENGTH_LSB WLAN_GPIO_PIN56_PAD_STRENGTH_LSB -#define GPIO_PIN56_PAD_STRENGTH_MASK WLAN_GPIO_PIN56_PAD_STRENGTH_MASK -#define GPIO_PIN56_PAD_STRENGTH_GET(x) WLAN_GPIO_PIN56_PAD_STRENGTH_GET(x) -#define GPIO_PIN56_PAD_STRENGTH_SET(x) WLAN_GPIO_PIN56_PAD_STRENGTH_SET(x) -#define GPIO_PIN56_PAD_DRIVER_MSB WLAN_GPIO_PIN56_PAD_DRIVER_MSB -#define GPIO_PIN56_PAD_DRIVER_LSB WLAN_GPIO_PIN56_PAD_DRIVER_LSB -#define GPIO_PIN56_PAD_DRIVER_MASK WLAN_GPIO_PIN56_PAD_DRIVER_MASK -#define GPIO_PIN56_PAD_DRIVER_GET(x) WLAN_GPIO_PIN56_PAD_DRIVER_GET(x) -#define GPIO_PIN56_PAD_DRIVER_SET(x) WLAN_GPIO_PIN56_PAD_DRIVER_SET(x) -#define GPIO_PIN56_SOURCE_MSB WLAN_GPIO_PIN56_SOURCE_MSB -#define GPIO_PIN56_SOURCE_LSB WLAN_GPIO_PIN56_SOURCE_LSB -#define GPIO_PIN56_SOURCE_MASK WLAN_GPIO_PIN56_SOURCE_MASK -#define GPIO_PIN56_SOURCE_GET(x) WLAN_GPIO_PIN56_SOURCE_GET(x) -#define GPIO_PIN56_SOURCE_SET(x) WLAN_GPIO_PIN56_SOURCE_SET(x) -#define SIGMA_DELTA_ADDRESS WLAN_SIGMA_DELTA_ADDRESS -#define SIGMA_DELTA_OFFSET WLAN_SIGMA_DELTA_OFFSET -#define SIGMA_DELTA_ENABLE_MSB WLAN_SIGMA_DELTA_ENABLE_MSB -#define SIGMA_DELTA_ENABLE_LSB WLAN_SIGMA_DELTA_ENABLE_LSB -#define SIGMA_DELTA_ENABLE_MASK WLAN_SIGMA_DELTA_ENABLE_MASK -#define SIGMA_DELTA_ENABLE_GET(x) WLAN_SIGMA_DELTA_ENABLE_GET(x) -#define SIGMA_DELTA_ENABLE_SET(x) WLAN_SIGMA_DELTA_ENABLE_SET(x) -#define SIGMA_DELTA_PRESCALAR_MSB WLAN_SIGMA_DELTA_PRESCALAR_MSB -#define SIGMA_DELTA_PRESCALAR_LSB WLAN_SIGMA_DELTA_PRESCALAR_LSB -#define SIGMA_DELTA_PRESCALAR_MASK WLAN_SIGMA_DELTA_PRESCALAR_MASK -#define SIGMA_DELTA_PRESCALAR_GET(x) WLAN_SIGMA_DELTA_PRESCALAR_GET(x) -#define SIGMA_DELTA_PRESCALAR_SET(x) WLAN_SIGMA_DELTA_PRESCALAR_SET(x) -#define SIGMA_DELTA_TARGET_MSB WLAN_SIGMA_DELTA_TARGET_MSB -#define SIGMA_DELTA_TARGET_LSB WLAN_SIGMA_DELTA_TARGET_LSB -#define SIGMA_DELTA_TARGET_MASK WLAN_SIGMA_DELTA_TARGET_MASK -#define SIGMA_DELTA_TARGET_GET(x) WLAN_SIGMA_DELTA_TARGET_GET(x) -#define SIGMA_DELTA_TARGET_SET(x) WLAN_SIGMA_DELTA_TARGET_SET(x) -#define DEBUG_CONTROL_ADDRESS WLAN_DEBUG_CONTROL_ADDRESS -#define DEBUG_CONTROL_OFFSET WLAN_DEBUG_CONTROL_OFFSET -#define DEBUG_CONTROL_ENABLE_MSB WLAN_DEBUG_CONTROL_ENABLE_MSB -#define DEBUG_CONTROL_ENABLE_LSB WLAN_DEBUG_CONTROL_ENABLE_LSB -#define DEBUG_CONTROL_ENABLE_MASK WLAN_DEBUG_CONTROL_ENABLE_MASK -#define DEBUG_CONTROL_ENABLE_GET(x) WLAN_DEBUG_CONTROL_ENABLE_GET(x) -#define DEBUG_CONTROL_ENABLE_SET(x) WLAN_DEBUG_CONTROL_ENABLE_SET(x) -#define DEBUG_INPUT_SEL_ADDRESS WLAN_DEBUG_INPUT_SEL_ADDRESS -#define DEBUG_INPUT_SEL_OFFSET WLAN_DEBUG_INPUT_SEL_OFFSET -#define DEBUG_INPUT_SEL_SHIFT_MSB WLAN_DEBUG_INPUT_SEL_SHIFT_MSB -#define DEBUG_INPUT_SEL_SHIFT_LSB WLAN_DEBUG_INPUT_SEL_SHIFT_LSB -#define DEBUG_INPUT_SEL_SHIFT_MASK WLAN_DEBUG_INPUT_SEL_SHIFT_MASK -#define DEBUG_INPUT_SEL_SHIFT_GET(x) WLAN_DEBUG_INPUT_SEL_SHIFT_GET(x) -#define DEBUG_INPUT_SEL_SHIFT_SET(x) WLAN_DEBUG_INPUT_SEL_SHIFT_SET(x) -#define DEBUG_INPUT_SEL_SRC_MSB WLAN_DEBUG_INPUT_SEL_SRC_MSB -#define DEBUG_INPUT_SEL_SRC_LSB WLAN_DEBUG_INPUT_SEL_SRC_LSB -#define DEBUG_INPUT_SEL_SRC_MASK WLAN_DEBUG_INPUT_SEL_SRC_MASK -#define DEBUG_INPUT_SEL_SRC_GET(x) WLAN_DEBUG_INPUT_SEL_SRC_GET(x) -#define DEBUG_INPUT_SEL_SRC_SET(x) WLAN_DEBUG_INPUT_SEL_SRC_SET(x) -#define DEBUG_OUT_ADDRESS WLAN_DEBUG_OUT_ADDRESS -#define DEBUG_OUT_OFFSET WLAN_DEBUG_OUT_OFFSET -#define DEBUG_OUT_DATA_MSB WLAN_DEBUG_OUT_DATA_MSB -#define DEBUG_OUT_DATA_LSB WLAN_DEBUG_OUT_DATA_LSB -#define DEBUG_OUT_DATA_MASK WLAN_DEBUG_OUT_DATA_MASK -#define DEBUG_OUT_DATA_GET(x) WLAN_DEBUG_OUT_DATA_GET(x) -#define DEBUG_OUT_DATA_SET(x) WLAN_DEBUG_OUT_DATA_SET(x) -#define RESET_TUPLE_STATUS_ADDRESS WLAN_RESET_TUPLE_STATUS_ADDRESS -#define RESET_TUPLE_STATUS_OFFSET WLAN_RESET_TUPLE_STATUS_OFFSET -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MSB WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MSB -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_LSB -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_MASK -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_GET(x) WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_GET(x) -#define RESET_TUPLE_STATUS_TEST_RESET_TUPLE_SET(x) WLAN_RESET_TUPLE_STATUS_TEST_RESET_TUPLE_SET(x) -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MSB WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MSB -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_LSB -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_MASK -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_GET(x) WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_GET(x) -#define RESET_TUPLE_STATUS_PIN_RESET_TUPLE_SET(x) WLAN_RESET_TUPLE_STATUS_PIN_RESET_TUPLE_SET(x) - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mac_dma_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mac_dma_reg.h deleted file mode 100644 index 3824a7e71ac2..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mac_dma_reg.h +++ /dev/null @@ -1,347 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -#ifndef __MAC_DMA_REG_SW_H -#define __MAC_DMA_REG_SW_H -// THIS IS A SOFTWARE WRAPPER HEADER FILE -#include "wmac_dma_reg.h" -#include "wmac_dcu_reg.h" -#include "wmac_qcu_reg.h" - -/* Primary Interrupt Status Register */ -#define MAC_DMA_ISR_ADDRESS MAC_DMA_ISR_P_ADDRESS -#define MAC_DMA_ISR_HP_RXOK_MASK 0x00000001 // At least one frame rx on high-priority queue sans errors -#define MAC_DMA_ISR_LP_RXOK_MASK 0x00000002 // At least one frame rx on low-priority queue sans errors -#define MAC_DMA_ISR_RXERR_MASK 0x00000004 // Receive error interrupt -#define MAC_DMA_ISR_RXNOPKT_MASK 0x00000008 // No frame received within timeout clock -#define MAC_DMA_ISR_RXEOL_MASK 0x00000010 // Received descriptor empty interrupt -#define MAC_DMA_ISR_RXORN_MASK 0x00000020 // Receive FIFO overrun interrupt -#define MAC_DMA_ISR_TXOK_MASK 0x00000040 // Transmit okay interrupt -#define MAC_DMA_ISR_BTINT_MASK 0x00000080 // BT interrupt -#define MAC_DMA_ISR_TXERR_MASK 0x00000100 // Transmit error interrupt -#define MAC_DMA_ISR_TXNOPKT_MASK 0x00000200 // No frame transmitted interrupt -#define MAC_DMA_ISR_TXEOL_MASK 0x00000400 // Transmit descriptor empty interrupt -#define MAC_DMA_ISR_TXURN_MASK 0x00000800 // Transmit FIFO underrun interrupt -#define MAC_DMA_ISR_MIB_MASK 0x00001000 // MIB interrupt - see MIBC -#define MAC_DMA_ISR_SWI_MASK 0x00002000 // Software interrupt -#define MAC_DMA_ISR_RXPHY_MASK 0x00004000 // PHY receive error interrupt -#define MAC_DMA_ISR_RXKCM_MASK 0x00008000 // Key-cache miss interrupt -#define MAC_DMA_ISR_SWBA_MASK 0x00010000 // Software beacon alert interrupt -#define MAC_DMA_ISR_BRSSI_MASK 0x00020000 // Beacon threshold interrupt -#define MAC_DMA_ISR_BMISS_MASK 0x00040000 // Beacon missed interrupt -#define MAC_DMA_ISR_TXMINTR_MASK 0x00080000 // Maximum interrupt transmit rate -#define MAC_DMA_ISR_BNR_MASK 0x00100000 // Beacon not ready interrupt -#define MAC_DMA_ISR_RXINT_MASK 0x00200000 // Rx interrupt directly from PCU -#define MAC_DMA_ISR_HCFPOLL_MASK 0x00400000 // Received directed HCF poll -#define MAC_DMA_ISR_BCNMISC_MASK 0x00800000 // CST, GTT, TIM, CABEND, DTIMSYNC, BCNTO, CABTO, -// TSFOOR, DTIM, and TBTT_TIME bits bits from ISR_S2 -#define MAC_DMA_ISR_TIM_MASK 0x00800000 // TIM interrupt -#define MAC_DMA_ISR_RXMINTR_MASK 0x01000000 // Maximum interrupt receive rate -#define MAC_DMA_ISR_QCBROVF_MASK 0x02000000 // QCU CBR overflow interrupt -#define MAC_DMA_ISR_QCBRURN_MASK 0x04000000 // QCU CBR underrun interrupt -#define MAC_DMA_ISR_QTRIG_MASK 0x08000000 // QCU scheduling trigger interrupt -#define MAC_DMA_ISR_TIMER_MASK 0x10000000 // OR of generic timer bits in ISR 5 -#define MAC_DMA_ISR_HCFTO_MASK 0x20000000 // HCF poll timeout -#define MAC_DMA_ISR_TXINTM_MASK 0x40000000 // Tx interrupt after mitigation -#define MAC_DMA_ISR_RXINTM_MASK 0x80000000 // Rx interrupt after mitigation - -/* MAC Secondary interrupt status register 0 */ -#define MAC_DMA_ISR_S0_QCU_TXOK_MASK 0x000003FF // Mask for TXOK (QCU 0-9) -#define MAC_DMA_ISR_S0_QCU_TXOK_LSB 0 // Shift for TXOK (QCU 0-9) - -/* MAC Secondary interrupt status register 1 */ -#define MAC_DMA_ISR_S1_QCU_TXERR_MASK 0x000003FF // Mask for TXERR (QCU 0-9) -#define MAC_DMA_ISR_S1_QCU_TXERR_LSB 0 // Shift for TXERR (QCU 0-9) -#define MAC_DMA_ISR_S1_QCU_TXEOL_MASK 0x03FF0000 // Mask for TXEOL (QCU 0-9) -#define MAC_DMA_ISR_S1_QCU_TXEOL_LSB 16 // Shift for TXEOL (QCU 0-9) - -/* MAC Secondary interrupt status register 2 */ -#define MAC_DMA_ISR_S2_QCU_TXURN_MASK 0x000003FF // Mask for TXURN (QCU 0-9) -#define MAC_DMA_ISR_S2_QCU_TXURN_LSB 0 // Shift for TXURN (QCU 0-9) -#define MAC_DMA_ISR_S2_TDMA_START_ERR_MASK 0x00000400 // TDMA start time error interrupt -#define MAC_DMA_ISR_S2_TDMA_TX_AP_PULSE_MASK 0x00000800 // TDMA Tx AP SYNC PULSE -#define MAC_DMA_ISR_S2_RX_PTR_BAD_MASK 0x00001000 // If PCU RX FIFO read pointer crosses PCU RX FIFO write pointer -#define MAC_DMA_ISR_S2_TIM2_MASK 0x00002000 // TIM2 -#define MAC_DMA_ISR_S2_CAB2END_MASK 0x00004000 // CAB2END -#define MAC_DMA_ISR_S2_DTIM2SYNC_MASK 0x00008000 // DTIM2SYNC -#define MAC_DMA_ISR_S2_BCN2TO_MASK 0x00010000 // BCN2TO -#define MAC_DMA_ISR_S2_CAB2TO_MASK 0x00020000 // CAB2TO -#define MAC_DMA_ISR_S2_DTIM2_MASK 0x00040000 // DTIM2 -#define MAC_DMA_ISR_S2_TSF2OOR_MASK 0x00080000 // Rx TSF2 out of range -#define MAC_DMA_ISR_S2_TBTT2_TIME_MASK 0x00100000 // TBTT2-referenced timer -#define MAC_DMA_ISR_S2_CST_MASK 0x00200000 // Carrier sense timeout -#define MAC_DMA_ISR_S2_GTT_MASK 0x00400000 // Global transmit timeout -#define MAC_DMA_ISR_S2_TIM_MASK 0x00800000 // TIM -#define MAC_DMA_ISR_S2_CABEND_MASK 0x01000000 // CABEND -#define MAC_DMA_ISR_S2_DTIMSYNC_MASK 0x02000000 // DTIMSYNC -#define MAC_DMA_ISR_S2_BCNTO_MASK 0x04000000 // BCNTO -#define MAC_DMA_ISR_S2_CABTO_MASK 0x08000000 // CABTO -#define MAC_DMA_ISR_S2_DTIM_MASK 0x10000000 // DTIM -#define MAC_DMA_ISR_S2_TSFOOR_MASK 0x20000000 // Rx TSF out of range -#define MAC_DMA_ISR_S2_TBTT_TIME_MASK 0x40000000 // TBTT-referenced timer - -/* MAC Secondary interrupt status register 3 */ -#define MAC_DMA_ISR_S3_QCU_QCBROVF_MASK 0x000003FF // Mask for QCBROVF (QCU 0-9) -#define MAC_DMA_ISR_S3_RX_LP_Q_OVF_MASK 0x00004000 // Rxdp LPQ overflow -#define MAC_DMA_ISR_S3_RX_HP_Q_OVF_MASK 0x00008000 // Rxdp HPQ overflow -#define MAC_DMA_ISR_S3_QCU_QCBRURN_MASK 0x03FF0000 // Mask for QCBRURN (QCU 0-9) -#define MAC_DMA_ISR_S3_BRSSI_LO_MASK 0x04000000 // RSSI HI of a beacon threshold -#define MAC_DMA_ISR_S3_BRSSI_HI_MASK 0x08000000 // RSSI LO of a beacon threshold -#define MAC_DMA_ISR_S3_BRSSI_LO2_MASK 0x10000000 // RSSI HI2 of a beacon threshold -#define MAC_DMA_ISR_S3_BRSSI_HI2_MASK 0x20000000 // RSSI LO2 of a beacon threshold -#define MAC_DMA_ISR_S3_BMISS_MASK 0x40000000 // Beacon miss -#define MAC_DMA_ISR_S3_BMISS2_MASK 0x80000000 // Beacon miss2 - -/* MAC Secondary interrupt status register 4 */ -#define MAC_DMA_ISR_S4_QCU_QTRIG_MASK 0x000003FF // Mask for QTRIG (QCU 0-9) -#define MAC_DMA_ISR_S4_QCU_QTXDP_OVF_MASK 0x03FF0000 // Mask for QTXDP Overflow (QCU 0-9) -#define MAC_DMA_ISR_S4_QCU_TXDP_TH_INT_MASK 0x04000000 // TXDP threshold interrupt - -/* MAC Secondary interrupt status register 5 */ -#define MAC_DMA_ISR_S5_TBTT_TIMER_TRIGGER_MASK 0x00000001 -#define MAC_DMA_ISR_S5_DBA_TIMER_TRIGGER_MASK 0x00000002 -#define MAC_DMA_ISR_S5_SBA_TIMER_TRIGGER_MASK 0x00000004 -#define MAC_DMA_ISR_S5_HCF_TIMER_TRIGGER_MASK 0x00000008 -#define MAC_DMA_ISR_S5_TIM_TIMER_TRIGGER_MASK 0x00000010 -#define MAC_DMA_ISR_S5_DTIM_TIMER_TRIGGER_MASK 0x00000020 -#define MAC_DMA_ISR_S5_QUIET_TIMER_TRIGGER_MASK 0x00000040 -#define MAC_DMA_ISR_S5_NDP_TIMER_TRIGGER_MASK 0x00000080 -#define MAC_DMA_ISR_S5_GENERIC_TIMER2_TRIGGER_MASK 0x0000FF00 -#define MAC_DMA_ISR_S5_GENERIC_TIMER2_TRIGGER_LSB 8 -#define MAC_DMA_ISR_S5_GENERIC_TIMER2_TRIGGER(_i) (0x00000100 << (_i)) -#define MAC_DMA_ISR_S5_TIMER_OVERFLOW_MASK 0x00010000 -#define MAC_DMA_ISR_S5_DBA_TIMER_THRESHOLD_MASK 0x00020000 -#define MAC_DMA_ISR_S5_SBA_TIMER_THRESHOLD_MASK 0x00040000 -#define MAC_DMA_ISR_S5_HCF_TIMER_THRESHOLD_MASK 0x00080000 -#define MAC_DMA_ISR_S5_TIM_TIMER_THRESHOLD_MASK 0x00100000 -#define MAC_DMA_ISR_S5_DTIM_TIMER_THRESHOLD_MASK 0x00200000 -#define MAC_DMA_ISR_S5_QUIET_TIMER_THRESHOLD_MASK 0x00400000 -#define MAC_DMA_ISR_S5_NDP_TIMER_THRESHOLD_MASK 0x00800000 -#define MAC_DMA_ISR_S5_GENERIC_TIMER2_THRESHOLD_MASK 0xFF000000 -#define MAC_DMA_ISR_S5_GENERIC_TIMER2_THRESHOLD_LSB 24 -#define MAC_DMA_ISR_S5_GENERIC_TIMER2_THRESHOLD(_i) (0x01000000 << (_i)) - -/* MAC Secondary interrupt status register 6 */ -#define MAC_DMA_ISR_S6_BB_MAC_TEMP_SENSOR_MASK 0x00000001 -#define MAC_DMA_ISR_S6_BB_PANIC_IRQ_MASK 0x00000002 -#define MAC_DMA_ISR_S6_BT_LOW_PRIORITY_RISING_MASK 0x00000004 -#define MAC_DMA_ISR_S6_BT_LOW_PRIORITY_FALLING_MASK 0x00000008 -#define MAC_DMA_ISR_S6_BT_STOMPED_MASK 0x00000010 -#define MAC_DMA_ISR_S6_WL_STOMPED_MASK 0x00000020 -#define MAC_DMA_ISR_S6_BT_ACTIVE_RISING_MASK 0x00000040 -#define MAC_DMA_ISR_S6_BT_ACTIVE_FALLING_MASK 0x00000080 -#define MAC_DMA_ISR_S6_BT_PRIORITY_RISING_MASK 0x00000100 -#define MAC_DMA_ISR_S6_BT_PRIORITY_FALLING_MASK 0x00000200 -#define MAC_DMA_ISR_S6_MBZ_MASK 0xfffffc00 - -#define MAC_DMA_IMR_MASK_MSB MAC_DMA_IMR_P_MASK_MSB -#define MAC_DMA_IMR_MASK_LSB MAC_DMA_IMR_P_MASK_LSB -#define MAC_DMA_IMR_MASK_MASK MAC_DMA_IMR_P_MASK_MASK -#define MAC_DMA_IMR_MASK_GET(x) MAC_DMA_IMR_P_MASK_GET(x) -#define MAC_DMA_IMR_MASK_SET(x) MAC_DMA_IMR_P_MASK_SET(x) -#define MAC_DMA_IMR_ADDRESS MAC_DMA_IMR_P_ADDRESS - -/* Primary Interrupt mask Register */ -#define MAC_DMA_IMR_HP_RXOK_MASK MAC_DMA_ISR_HP_RXOK_MASK -#define MAC_DMA_IMR_LP_RXOK_MASK MAC_DMA_ISR_LP_RXOK_MASK -#define MAC_DMA_IMR_RXERR_MASK MAC_DMA_ISR_RXERR_MASK -#define MAC_DMA_IMR_RXNOPKT_MASK MAC_DMA_ISR_RXNOPKT_MASK -#define MAC_DMA_IMR_RXEOL_MASK MAC_DMA_ISR_RXEOL_MASK -#define MAC_DMA_IMR_RXORN_MASK MAC_DMA_ISR_RXORN_MASK -#define MAC_DMA_IMR_TXOK_MASK MAC_DMA_ISR_TXOK_MASK -#define MAC_DMA_IMR_BTINT_MASK MAC_DMA_ISR_BTINT_MASK -#define MAC_DMA_IMR_TXERR_MASK MAC_DMA_ISR_TXERR_MASK -#define MAC_DMA_IMR_TXNOPKT_MASK MAC_DMA_ISR_TXNOPKT_MASK -#define MAC_DMA_IMR_TXEOL_MASK MAC_DMA_ISR_TXEOL_MASK -#define MAC_DMA_IMR_TXURN_MASK MAC_DMA_ISR_TXURN_MASK -#define MAC_DMA_IMR_MIB_MASK MAC_DMA_ISR_MIB_MASK -#define MAC_DMA_IMR_SWI_MASK MAC_DMA_ISR_SWI_MASK -#define MAC_DMA_IMR_RXPHY_MASK MAC_DMA_ISR_RXPHY_MASK -#define MAC_DMA_IMR_RXKCM_MASK MAC_DMA_ISR_RXKCM_MASK -#define MAC_DMA_IMR_SWBA_MASK MAC_DMA_ISR_SWBA_MASK -#define MAC_DMA_IMR_BRSSI_MASK MAC_DMA_ISR_BRSSI_MASK -#define MAC_DMA_IMR_BMISS_MASK MAC_DMA_ISR_BMISS_MASK -#define MAC_DMA_IMR_TXMINTR_MASK MAC_DMA_ISR_TXMINTR_MASK -#define MAC_DMA_IMR_BNR_MASK MAC_DMA_ISR_BNR_MASK -#define MAC_DMA_IMR_RXINT_MASK MAC_DMA_ISR_RXINT_MASK -#define MAC_DMA_IMR_HCFPOLL_MASK MAC_DMA_ISR_HCFPOLL_MASK -#define MAC_DMA_IMR_BCNMISC_MASK MAC_DMA_ISR_BCNMISC_MASK -#define MAC_DMA_IMR_TIM_MASK MAC_DMA_ISR_TIM_MASK -#define MAC_DMA_IMR_RXMINTR_MASK MAC_DMA_ISR_RXMINTR_MASK -#define MAC_DMA_IMR_QCBROVF_MASK MAC_DMA_ISR_QCBROVF_MASK -#define MAC_DMA_IMR_QCBRURN_MASK MAC_DMA_ISR_QCBRURN_MASK -#define MAC_DMA_IMR_QTRIG_MASK MAC_DMA_ISR_QTRIG_MASK -#define MAC_DMA_IMR_TIMER_MASK MAC_DMA_ISR_TIMER_MASK -#define MAC_DMA_IMR_HCFTO_MASK MAC_DMA_ISR_HCFTO_MASK -#define MAC_DMA_IMR_TXINTM_MASK MAC_DMA_ISR_TXINTM_MASK -#define MAC_DMA_IMR_RXINTM_MASK MAC_DMA_ISR_RXINTM_MASK - -/* MAC Secondary interrupt mask register 0 */ -#define MAC_DMA_IMR_S0_QCU_TXOK_MASK MAC_DMA_ISR_S0_QCU_TXOK_MASK -#define MAC_DMA_IMR_S0_QCU_TXOK_LSB MAC_DMA_ISR_S0_QCU_TXOK_LSB - -/* MAC Secondary interrupt mask register 1 */ -#define MAC_DMA_IMR_S1_QCU_TXERR_MASK MAC_DMA_ISR_S1_QCU_TXERR_MASK -#define MAC_DMA_IMR_S1_QCU_TXERR_LSB MAC_DMA_ISR_S1_QCU_TXERR_LSB -#define MAC_DMA_IMR_S1_QCU_TXEOL_MASK MAC_DMA_ISR_S1_QCU_TXEOL_MASK -#define MAC_DMA_IMR_S1_QCU_TXEOL_LSB MAC_DMA_ISR_S1_QCU_TXEOL_LSB - -/* MAC Secondary interrupt mask register 2 */ -#define MAC_DMA_IMR_S2_QCU_TXURN_MASK MAC_DMA_ISR_S2_QCU_TXURN_MASK -#define MAC_DMA_IMR_S2_QCU_TXURN_LSB MAC_DMA_ISR_S2_QCU_TXURN_LSB -#define MAC_DMA_IMR_S2_TDMA_START_ERR_MASK MAC_DMA_ISR_S2_TDMA_START_ERR_MASK -#define MAC_DMA_IMR_S2_TDMA_TX_AP_PULSE_MASK MAC_DMA_ISR_S2_TDMA_TX_AP_PULSE_MASK -#define MAC_DMA_IMR_S2_RX_PTR_BAD_MASK MAC_DMA_ISR_S2_RX_PTR_BAD_MASK -#define MAC_DMA_IMR_S2_TIM2_MASK MAC_DMA_ISR_S2_TIM2_MASK -#define MAC_DMA_IMR_S2_CAB2END_MASK MAC_DMA_ISR_S2_CAB2END_MASK -#define MAC_DMA_IMR_S2_DTIM2SYNC_MASK MAC_DMA_ISR_S2_DTIM2SYNC_MASK -#define MAC_DMA_IMR_S2_BCN2TO_MASK MAC_DMA_ISR_S2_BCN2TO_MASK -#define MAC_DMA_IMR_S2_CAB2TO_MASK MAC_DMA_ISR_S2_CAB2TO_MASK -#define MAC_DMA_IMR_S2_DTIM2_MASK MAC_DMA_ISR_S2_DTIM2_MASK -#define MAC_DMA_IMR_S2_TSF2OOR_MASK MAC_DMA_ISR_S2_TSF2OOR_MASK -#define MAC_DMA_IMR_S2_TBTT2_TIME_MASK MAC_DMA_ISR_S2_TBTT2_TIME_MASK -#define MAC_DMA_IMR_S2_CST_MASK MAC_DMA_ISR_S2_CST_MASK -#define MAC_DMA_IMR_S2_GTT_MASK MAC_DMA_ISR_S2_GTT_MASK -#define MAC_DMA_IMR_S2_TIM_MASK MAC_DMA_ISR_S2_TIM_MASK -#define MAC_DMA_IMR_S2_CABEND_MASK MAC_DMA_ISR_S2_CABEND_MASK -#define MAC_DMA_IMR_S2_DTIMSYNC_MASK MAC_DMA_ISR_S2_DTIMSYNC_MASK -#define MAC_DMA_IMR_S2_BCNTO_MASK MAC_DMA_ISR_S2_BCNTO_MASK -#define MAC_DMA_IMR_S2_CABTO_MASK MAC_DMA_ISR_S2_CABTO_MASK -#define MAC_DMA_IMR_S2_DTIM_MASK MAC_DMA_ISR_S2_DTIM_MASK -#define MAC_DMA_IMR_S2_TSFOOR_MASK MAC_DMA_ISR_S2_TSFOOR_MASK -#define MAC_DMA_IMR_S2_TBTT_TIME_MASK MAC_DMA_ISR_S2_TBTT_TIME_MASK - -/* MAC Secondary interrupt mask register 3 */ -#define MAC_DMA_IMR_S3_QCU_QCBROVF_MASK MAC_DMA_ISR_S3_QCU_QCBROVF_MASK -#define MAC_DMA_IMR_S3_RX_LP_Q_OVF_MASK MAC_DMA_ISR_S3_RX_LP_Q_OVF_MASK -#define MAC_DMA_IMR_S3_RX_HP_Q_OVF_MASK MAC_DMA_ISR_S3_RX_HP_Q_OVF_MASK -#define MAC_DMA_IMR_S3_QCU_QCBRURN_MASK MAC_DMA_ISR_S3_QCU_QCBRURN_MASK -#define MAC_DMA_IMR_S3_BRSSI_LO_MASK MAC_DMA_ISR_S3_BRSSI_LO_MASK -#define MAC_DMA_IMR_S3_BRSSI_HI_MASK MAC_DMA_ISR_S3_BRSSI_HI_MASK -#define MAC_DMA_IMR_S3_BRSSI_LO2_MASK MAC_DMA_ISR_S3_BRSSI_LO2_MASK -#define MAC_DMA_IMR_S3_BRSSI_HI2_MASK MAC_DMA_ISR_S3_BRSSI_HI2_MASK -#define MAC_DMA_IMR_S3_BMISS_MASK MAC_DMA_ISR_S3_BMISS_MASK -#define MAC_DMA_IMR_S3_BMISS2_MASK MAC_DMA_ISR_S3_BMISS2_MASK - -/* MAC Secondary interrupt mask register 4 */ -#define MAC_DMA_IMR_S4_QCU_QTRIG_MASK MAC_DMA_ISR_S4_QCU_QTRIG_MASK -#define MAC_DMA_IMR_S4_QCU_QTXDP_OVF_MASK MAC_DMA_ISR_S4_QCU_QTXDP_OVF_MASK -#define MAC_DMA_IMR_S4_QCU_TXDP_TH_INT_MASK MAC_DMA_ISR_S4_QCU_TXDP_TH_INT_MASK - -/* MAC Secondary interrupt mask register 5 */ -#define MAC_DMA_IMR_S5_TBTT_TIMER_TRIGGER_MASK MAC_DMA_ISR_S5_TBTT_TIMER_TRIGGER_MASK -#define MAC_DMA_IMR_S5_DBA_TIMER_TRIGGER_MASK MAC_DMA_ISR_S5_DBA_TIMER_TRIGGER_MASK -#define MAC_DMA_IMR_S5_SBA_TIMER_TRIGGER_MASK MAC_DMA_ISR_S5_SBA_TIMER_TRIGGER_MASK -#define MAC_DMA_IMR_S5_HCF_TIMER_TRIGGER_MASK MAC_DMA_ISR_S5_HCF_TIMER_TRIGGER_MASK -#define MAC_DMA_IMR_S5_TIM_TIMER_TRIGGER_MASK MAC_DMA_ISR_S5_TIM_TIMER_TRIGGER_MASK -#define MAC_DMA_IMR_S5_DTIM_TIMER_TRIGGER_MASK MAC_DMA_ISR_S5_DTIM_TIMER_TRIGGER_MASK -#define MAC_DMA_IMR_S5_QUIET_TIMER_TRIGGER_MASK MAC_DMA_ISR_S5_QUIET_TIMER_TRIGGER_MASK -#define MAC_DMA_IMR_S5_NDP_TIMER_TRIGGER_MASK MAC_DMA_ISR_S5_NDP_TIMER_TRIGGER_MASK -#define MAC_DMA_IMR_S5_GENERIC_TIMER2_TRIGGER_MASK MAC_DMA_ISR_S5_GENERIC_TIMER2_TRIGGER_MASK -#define MAC_DMA_IMR_S5_GENERIC_TIMER2_TRIGGER_LSB MAC_DMA_ISR_S5_GENERIC_TIMER2_TRIGGER_LSB -#define MAC_DMA_IMR_S5_GENERIC_TIMER2_TRIGGER(_i) MAC_DMA_ISR_S5_GENERIC_TIMER2_TRIGGER(_i) -#define MAC_DMA_IMR_S5_TIMER_OVERFLOW_MASK MAC_DMA_ISR_S5_TIMER_OVERFLOW_MASK -#define MAC_DMA_IMR_S5_DBA_TIMER_THRESHOLD_MASK MAC_DMA_ISR_S5_DBA_TIMER_THRESHOLD_MASK -#define MAC_DMA_IMR_S5_SBA_TIMER_THRESHOLD_MASK MAC_DMA_ISR_S5_SBA_TIMER_THRESHOLD_MASK -#define MAC_DMA_IMR_S5_HCF_TIMER_THRESHOLD_MASK MAC_DMA_ISR_S5_HCF_TIMER_THRESHOLD_MASK -#define MAC_DMA_IMR_S5_TIM_TIMER_THRESHOLD_MASK MAC_DMA_ISR_S5_TIM_TIMER_THRESHOLD_MASK -#define MAC_DMA_IMR_S5_DTIM_TIMER_THRESHOLD_MASK MAC_DMA_ISR_S5_DTIM_TIMER_THRESHOLD_MASK -#define MAC_DMA_IMR_S5_QUIET_TIMER_THRESHOLD_MASK MAC_DMA_ISR_S5_QUIET_TIMER_THRESHOLD_MASK -#define MAC_DMA_IMR_S5_NDP_TIMER_THRESHOLD_MASK MAC_DMA_ISR_S5_NDP_TIMER_THRESHOLD_MASK -#define MAC_DMA_IMR_S5_GENERIC_TIMER2_THRESHOLD_MASK MAC_DMA_ISR_S5_GENERIC_TIMER2_THRESHOLD_MASK -#define MAC_DMA_IMR_S5_GENERIC_TIMER2_THRESHOLD_LSB MAC_DMA_ISR_S5_GENERIC_TIMER2_THRESHOLD_LSB -#define MAC_DMA_IMR_S5_GENERIC_TIMER2_THRESHOLD(_i) MAC_DMA_ISR_S5_GENERIC_TIMER2_THRESHOLD(_i) - -/* MAC Secondary interrupt mask register 6 */ -#define MAC_DMA_IMR_S6_BB_MAC_TEMP_SENSOR_MASK MAC_DMA_ISR_S6_BB_MAC_TEMP_SENSOR_MASK -#define MAC_DMA_IMR_S6_BB_PANIC_IRQ_MASK MAC_DMA_ISR_S6_BB_PANIC_IRQ_MASK -#define MAC_DMA_IMR_S6_BT_LOW_PRIORITY_RISING_MASK MAC_DMA_ISR_S6_BT_LOW_PRIORITY_RISING_MASK -#define MAC_DMA_IMR_S6_BT_LOW_PRIORITY_FALLING_MASK MAC_DMA_ISR_S6_BT_LOW_PRIORITY_FALLING_MASK -#define MAC_DMA_IMR_S6_BT_STOMPED_MASK MAC_DMA_ISR_S6_BT_STOMPED_MASK -#define MAC_DMA_IMR_S6_WL_STOMPED_MASK MAC_DMA_ISR_S6_WL_STOMPED_MASK -#define MAC_DMA_IMR_S6_BT_ACTIVE_RISING_MASK MAC_DMA_ISR_S6_BT_ACTIVE_RISING_MASK -#define MAC_DMA_IMR_S6_BT_ACTIVE_FALLING_MASK MAC_DMA_ISR_S6_BT_ACTIVE_FALLING_MASK -#define MAC_DMA_IMR_S6_BT_PRIORITY_RISING_MASK MAC_DMA_ISR_S6_BT_PRIORITY_RISING_MASK -#define MAC_DMA_IMR_S6_BT_PRIORITY_FALLING_MASK MAC_DMA_ISR_S6_BT_PRIORITY_FALLING_MASK -#define MAC_DMA_IMR_S6_MBZ_MASK MAC_DMA_ISR_S6_MBZ_MASK - -#define MAC_DMA_TIMT_TX_FIRST_PKT_THRESH_LSB MAC_DMA_TIMT_0_TX_FIRST_PKT_THRESH_LSB -#define MAC_DMA_TIMT_TX_FIRST_PKT_THRESH_MASK MAC_DMA_TIMT_0_TX_FIRST_PKT_THRESH_MASK -#define MAC_DMA_TIMT_TX_LAST_PKT_THRESH_LSB MAC_DMA_TIMT_0_TX_LAST_PKT_THRESH_LSB -#define MAC_DMA_TIMT_TX_LAST_PKT_THRESH_MASK MAC_DMA_TIMT_0_TX_LAST_PKT_THRESH_MASK -#define MAC_DMA_TIMT_ADDRESS MAC_DMA_TIMT_0_ADDRESS -#define MAC_DMA_TIMT_ADDR(_i) (MAC_DMA_TIMT_0_ADDRESS + ((_i)<<2)) - -#define MAC_QCU_CNT_ADDR(_i) (MAC_QCU_CNT_ADDRESS + ((_i)<<2)) - -#define MAC_DCU_MISC_ADDR(_i) (MAC_DCU_MISC_ADDRESS + ((_i)<<2)) -#define MAC_DCU_MISC_FRAG_BURST_WAIT_EN_MASK MAC_DCU_MISC_FRAG_BURST_WAIT_QCU_EN_MASK - -#define MAC_QCU_TXDP_ADDR(_i) (MAC_QCU_TXDP_ADDRESS + ((_i)<<2)) - -#define MAC_DCU_QCUMASK_ADDR(_i) (MAC_DCU_QCUMASK_ADDRESS + ((_i)<<2)) - -#define MAC_DCU_LCL_IFS_ADDR(_i) (MAC_DCU_LCL_IFS_ADDRESS + ((_i)<<2)) - -#define MAC_DCU_RETRY_LIMIT_ADDR(_i) (MAC_DCU_RETRY_LIMIT_ADDRESS + ((_i)<<2)) - -#define MAC_QCU_MISC_ADDR(_i) (MAC_QCU_MISC_ADDRESS + ((_i)<<2)) -#define MAC_QCU_MISC_FSP_ASAP 0 // ASAP -#define MAC_QCU_MISC_FSP_CBR 1 // CBR -#define MAC_QCU_MISC_FSP_DBA_GATED 2 // DMA Beacon Alert gated -#define MAC_QCU_MISC_FSP_TIM_GATED 3 // TIM gated -#define MAC_QCU_MISC_FSP_BEACON_SENT_GATED 4 // Beacon-sent-gated -#define MAC_QCU_MISC_FSP_BEACON_RCVD_GATED 5 // Beacon-received-gated - -#define MAC_DCU_MISC_ADDR(_i) (MAC_DCU_MISC_ADDRESS + ((_i)<<2)) -#define MAC_DCU_MISC_VIR_COL_HANDLING_DEFAULT 0 // Normal -#define MAC_DCU_MISC_VIR_COL_HANDLING_IGNORE 1 // Ignore - -#define MAC_QCU_CBR_ADDR(_i) (MAC_QCU_CBR_ADDRESS + ((_i)<<2)) - -#define MAC_QCU_RDYTIME_ADDR(_i) (MAC_QCU_RDYTIME_ADDRESS + ((_i)<<2)) - -#define MAC_DMA_MIBC_MCS_MSB MAC_DMA_MIBC_STROBE_MSB -#define MAC_DMA_MIBC_MCS_LSB MAC_DMA_MIBC_STROBE_LSB -#define MAC_DMA_MIBC_MCS_MASK MAC_DMA_MIBC_STROBE_MASK -#define MAC_DMA_MIBC_MCS_GET(x) MAC_DMA_MIBC_STROBE_GET(x) -#define MAC_DMA_MIBC_MCS_SET(x) MAC_DMA_MIBC_STROBE_SET(x) -#define MAC_DMA_MIBC_CMC_MSB MAC_DMA_MIBC_CLEAR_MSB -#define MAC_DMA_MIBC_CMC_LSB MAC_DMA_MIBC_CLEAR_LSB -#define MAC_DMA_MIBC_CMC_MASK MAC_DMA_MIBC_CLEAR_MASK -#define MAC_DMA_MIBC_CMC_GET(x) MAC_DMA_MIBC_CLEAR_GET(x) -#define MAC_DMA_MIBC_CMC_SET(x) MAC_DMA_MIBC_CLEAR_SET(x) -#define MAC_DMA_MIBC_FMC_MSB MAC_DMA_MIBC_FREEZE_MSB -#define MAC_DMA_MIBC_FMC_LSB MAC_DMA_MIBC_FREEZE_LSB -#define MAC_DMA_MIBC_FMC_MASK MAC_DMA_MIBC_FREEZE_MASK -#define MAC_DMA_MIBC_FMC_GET(x) MAC_DMA_MIBC_FREEZE_GET(x) -#define MAC_DMA_MIBC_FMC_SET(x) MAC_DMA_MIBC_FREEZE_SET(x) -#define MAC_DMA_MIBC_COW_MSB MAC_DMA_MIBC_WARNING_MSB -#define MAC_DMA_MIBC_COW_LSB MAC_DMA_MIBC_WARNING_LSB -#define MAC_DMA_MIBC_COW_MASK MAC_DMA_MIBC_WARNING_MASK -#define MAC_DMA_MIBC_COW_GET(x) MAC_DMA_MIBC_WARNING_GET(x) -#define MAC_DMA_MIBC_COW_SET(x) MAC_DMA_MIBC_WARNING_SET(x) - -#endif /*__MAC_DMA_REG_SW_H */ - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mac_pcu_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mac_pcu_reg.h deleted file mode 100644 index 0a3e2c6cbea0..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mac_pcu_reg.h +++ /dev/null @@ -1,40 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -#ifndef __MAC_PCU_REG_SW_H -#define __MAC_PCU_REG_SW_H -#include "wmac_pcu_reg.h" - -// THIS IS A SOFTWARE WRAPPER HEADER FILE - - -#define MAC_PCU_BCN_RSSI_AVE_VALUE_MSB MAC_PCU_BCN_RSSI_AVE_AVE_VALUE_MSB -#define MAC_PCU_BCN_RSSI_AVE_VALUE_LSB MAC_PCU_BCN_RSSI_AVE_AVE_VALUE_LSB -#define MAC_PCU_BCN_RSSI_AVE_VALUE_MASK MAC_PCU_BCN_RSSI_AVE_AVE_VALUE_MASK -#define MAC_PCU_BCN_RSSI_AVE_VALUE_GET(x) MAC_PCU_BCN_RSSI_AVE_AVE_VALUE_GET(x) -#define MAC_PCU_BCN_RSSI_AVE_VALUE_SET(x) MAC_PCU_BCN_RSSI_AVE_AVE_VALUE_SET(x) - - -#endif /*__MAC_PCU_REG_SW_H */ - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/map_rf_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/map_rf_reg.h deleted file mode 100644 index 3bc99167c30d..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/map_rf_reg.h +++ /dev/null @@ -1,199 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _MAP_RF_REG_REG_H_ -#define _MAP_RF_REG_REG_H_ - - -/* macros for RAM1 */ -#define RAM1_ADDRESS 0x00000000 -#define RAM1_OFFSET 0x00000000 -#define RAM1_DATA_MSB 7 -#define RAM1_DATA_LSB 0 -#define RAM1_DATA_MASK 0x000000ff -#define RAM1_DATA_GET(x) (((x) & 0x000000ff) >> 0) -#define RAM1_DATA_SET(x) (((x) << 0) & 0x000000ff) - -/* macros for INT_PENDING */ -#define INT_PENDING_ADDRESS 0x00000400 -#define INT_PENDING_OFFSET 0x00000400 -#define INT_PENDING_REG_MSB 31 -#define INT_PENDING_REG_LSB 0 -#define INT_PENDING_REG_MASK 0xffffffff -#define INT_PENDING_REG_GET(x) (((x) & 0xffffffff) >> 0) -#define INT_PENDING_REG_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_WR_MASK_0 */ -#define BB_WR_MASK_0_ADDRESS 0x00000430 -#define BB_WR_MASK_0_OFFSET 0x00000430 -#define BB_WR_MASK_0_REG_MSB 31 -#define BB_WR_MASK_0_REG_LSB 0 -#define BB_WR_MASK_0_REG_MASK 0xffffffff -#define BB_WR_MASK_0_REG_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_WR_MASK_0_REG_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_WR_MASK_1 */ -#define BB_WR_MASK_1_ADDRESS 0x00000434 -#define BB_WR_MASK_1_OFFSET 0x00000434 -#define BB_WR_MASK_1_REG_MSB 31 -#define BB_WR_MASK_1_REG_LSB 0 -#define BB_WR_MASK_1_REG_MASK 0xffffffff -#define BB_WR_MASK_1_REG_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_WR_MASK_1_REG_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_WR_MASK_2 */ -#define BB_WR_MASK_2_ADDRESS 0x00000438 -#define BB_WR_MASK_2_OFFSET 0x00000438 -#define BB_WR_MASK_2_REG_MSB 31 -#define BB_WR_MASK_2_REG_LSB 0 -#define BB_WR_MASK_2_REG_MASK 0xffffffff -#define BB_WR_MASK_2_REG_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_WR_MASK_2_REG_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_WR_MASK_3 */ -#define BB_WR_MASK_3_ADDRESS 0x0000043c -#define BB_WR_MASK_3_OFFSET 0x0000043c -#define BB_WR_MASK_3_REG_MSB 10 -#define BB_WR_MASK_3_REG_LSB 0 -#define BB_WR_MASK_3_REG_MASK 0x000007ff -#define BB_WR_MASK_3_REG_GET(x) (((x) & 0x000007ff) >> 0) -#define BB_WR_MASK_3_REG_SET(x) (((x) << 0) & 0x000007ff) - -/* macros for RF_WR_MASK_0 */ -#define RF_WR_MASK_0_ADDRESS 0x00000440 -#define RF_WR_MASK_0_OFFSET 0x00000440 -#define RF_WR_MASK_0_REG_MSB 31 -#define RF_WR_MASK_0_REG_LSB 0 -#define RF_WR_MASK_0_REG_MASK 0xffffffff -#define RF_WR_MASK_0_REG_GET(x) (((x) & 0xffffffff) >> 0) -#define RF_WR_MASK_0_REG_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for RF_WR_MASK_1 */ -#define RF_WR_MASK_1_ADDRESS 0x00000444 -#define RF_WR_MASK_1_OFFSET 0x00000444 -#define RF_WR_MASK_1_REG_MSB 8 -#define RF_WR_MASK_1_REG_LSB 0 -#define RF_WR_MASK_1_REG_MASK 0x000001ff -#define RF_WR_MASK_1_REG_GET(x) (((x) & 0x000001ff) >> 0) -#define RF_WR_MASK_1_REG_SET(x) (((x) << 0) & 0x000001ff) - -/* macros for BB_RD_MASK_0 */ -#define BB_RD_MASK_0_ADDRESS 0x00000448 -#define BB_RD_MASK_0_OFFSET 0x00000448 -#define BB_RD_MASK_0_REG_MSB 31 -#define BB_RD_MASK_0_REG_LSB 0 -#define BB_RD_MASK_0_REG_MASK 0xffffffff -#define BB_RD_MASK_0_REG_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_RD_MASK_0_REG_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_RD_MASK_1 */ -#define BB_RD_MASK_1_ADDRESS 0x0000044c -#define BB_RD_MASK_1_OFFSET 0x0000044c -#define BB_RD_MASK_1_REG_MSB 31 -#define BB_RD_MASK_1_REG_LSB 0 -#define BB_RD_MASK_1_REG_MASK 0xffffffff -#define BB_RD_MASK_1_REG_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_RD_MASK_1_REG_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_RD_MASK_2 */ -#define BB_RD_MASK_2_ADDRESS 0x00000450 -#define BB_RD_MASK_2_OFFSET 0x00000450 -#define BB_RD_MASK_2_REG_MSB 31 -#define BB_RD_MASK_2_REG_LSB 0 -#define BB_RD_MASK_2_REG_MASK 0xffffffff -#define BB_RD_MASK_2_REG_GET(x) (((x) & 0xffffffff) >> 0) -#define BB_RD_MASK_2_REG_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for BB_RD_MASK_3 */ -#define BB_RD_MASK_3_ADDRESS 0x00000454 -#define BB_RD_MASK_3_OFFSET 0x00000454 -#define BB_RD_MASK_3_REG_MSB 10 -#define BB_RD_MASK_3_REG_LSB 0 -#define BB_RD_MASK_3_REG_MASK 0x000007ff -#define BB_RD_MASK_3_REG_GET(x) (((x) & 0x000007ff) >> 0) -#define BB_RD_MASK_3_REG_SET(x) (((x) << 0) & 0x000007ff) - -/* macros for RF_RD_MASK_0 */ -#define RF_RD_MASK_0_ADDRESS 0x00000458 -#define RF_RD_MASK_0_OFFSET 0x00000458 -#define RF_RD_MASK_0_REG_MSB 31 -#define RF_RD_MASK_0_REG_LSB 0 -#define RF_RD_MASK_0_REG_MASK 0xffffffff -#define RF_RD_MASK_0_REG_GET(x) (((x) & 0xffffffff) >> 0) -#define RF_RD_MASK_0_REG_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for RF_RD_MASK_1 */ -#define RF_RD_MASK_1_ADDRESS 0x0000045c -#define RF_RD_MASK_1_OFFSET 0x0000045c -#define RF_RD_MASK_1_REG_MSB 8 -#define RF_RD_MASK_1_REG_LSB 0 -#define RF_RD_MASK_1_REG_MASK 0x000001ff -#define RF_RD_MASK_1_REG_GET(x) (((x) & 0x000001ff) >> 0) -#define RF_RD_MASK_1_REG_SET(x) (((x) << 0) & 0x000001ff) - -/* macros for INT_SRC */ -#define INT_SRC_ADDRESS 0x00000460 -#define INT_SRC_OFFSET 0x00000460 -#define INT_SRC_REG_MSB 11 -#define INT_SRC_REG_LSB 0 -#define INT_SRC_REG_MASK 0x00000fff -#define INT_SRC_REG_GET(x) (((x) & 0x00000fff) >> 0) - -/* macros for RAM2 */ -#define RAM2_ADDRESS 0x00000800 -#define RAM2_OFFSET 0x00000800 -#define RAM2_DATA_MSB 6 -#define RAM2_DATA_LSB 0 -#define RAM2_DATA_MASK 0x0000007f -#define RAM2_DATA_GET(x) (((x) & 0x0000007f) >> 0) -#define RAM2_DATA_SET(x) (((x) << 0) & 0x0000007f) - - -#ifndef __ASSEMBLER__ - -typedef struct map_rf_reg_reg_s { - volatile unsigned int RAM1[256]; /* 0x0 - 0x400 */ - volatile unsigned int INT_PENDING[12]; /* 0x400 - 0x430 */ - volatile unsigned int BB_WR_MASK_0; /* 0x430 - 0x434 */ - volatile unsigned int BB_WR_MASK_1; /* 0x434 - 0x438 */ - volatile unsigned int BB_WR_MASK_2; /* 0x438 - 0x43c */ - volatile unsigned int BB_WR_MASK_3; /* 0x43c - 0x440 */ - volatile unsigned int RF_WR_MASK_0; /* 0x440 - 0x444 */ - volatile unsigned int RF_WR_MASK_1; /* 0x444 - 0x448 */ - volatile unsigned int BB_RD_MASK_0; /* 0x448 - 0x44c */ - volatile unsigned int BB_RD_MASK_1; /* 0x44c - 0x450 */ - volatile unsigned int BB_RD_MASK_2; /* 0x450 - 0x454 */ - volatile unsigned int BB_RD_MASK_3; /* 0x454 - 0x458 */ - volatile unsigned int RF_RD_MASK_0; /* 0x458 - 0x45c */ - volatile unsigned int RF_RD_MASK_1; /* 0x45c - 0x460 */ - volatile unsigned int INT_SRC; /* 0x460 - 0x464 */ - volatile char pad__0[0x39c]; /* 0x464 - 0x800 */ - volatile unsigned int RAM2[128]; /* 0x800 - 0xa00 */ -} map_rf_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _MAP_RF_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_host_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_host_reg.h deleted file mode 100644 index 7460d94fa39e..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_host_reg.h +++ /dev/null @@ -1,37 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "mbox_wlan_host_reg.h" - - -#ifndef BT_HEADERS - - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_i2s_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_i2s_reg.h deleted file mode 100644 index 51365262b461..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_i2s_reg.h +++ /dev/null @@ -1,299 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _MBOX_REG_REG_H_ -#define _MBOX_REG_REG_H_ - -#define MBOX_FIFO_ADDRESS 0x00000000 -#define MBOX_FIFO_OFFSET 0x00000000 -#define MBOX_FIFO_DATA_MSB 19 -#define MBOX_FIFO_DATA_LSB 0 -#define MBOX_FIFO_DATA_MASK 0x000fffff -#define MBOX_FIFO_DATA_GET(x) (((x) & MBOX_FIFO_DATA_MASK) >> MBOX_FIFO_DATA_LSB) -#define MBOX_FIFO_DATA_SET(x) (((x) << MBOX_FIFO_DATA_LSB) & MBOX_FIFO_DATA_MASK) - -#define MBOX_FIFO_STATUS_ADDRESS 0x00000004 -#define MBOX_FIFO_STATUS_OFFSET 0x00000004 -#define MBOX_FIFO_STATUS_EMPTY_MSB 2 -#define MBOX_FIFO_STATUS_EMPTY_LSB 2 -#define MBOX_FIFO_STATUS_EMPTY_MASK 0x00000004 -#define MBOX_FIFO_STATUS_EMPTY_GET(x) (((x) & MBOX_FIFO_STATUS_EMPTY_MASK) >> MBOX_FIFO_STATUS_EMPTY_LSB) -#define MBOX_FIFO_STATUS_EMPTY_SET(x) (((x) << MBOX_FIFO_STATUS_EMPTY_LSB) & MBOX_FIFO_STATUS_EMPTY_MASK) -#define MBOX_FIFO_STATUS_FULL_MSB 0 -#define MBOX_FIFO_STATUS_FULL_LSB 0 -#define MBOX_FIFO_STATUS_FULL_MASK 0x00000001 -#define MBOX_FIFO_STATUS_FULL_GET(x) (((x) & MBOX_FIFO_STATUS_FULL_MASK) >> MBOX_FIFO_STATUS_FULL_LSB) -#define MBOX_FIFO_STATUS_FULL_SET(x) (((x) << MBOX_FIFO_STATUS_FULL_LSB) & MBOX_FIFO_STATUS_FULL_MASK) - -#define MBOX_DMA_POLICY_ADDRESS 0x00000008 -#define MBOX_DMA_POLICY_OFFSET 0x00000008 -#define MBOX_DMA_POLICY_TX_FIFO_THRESH0_MSB 7 -#define MBOX_DMA_POLICY_TX_FIFO_THRESH0_LSB 4 -#define MBOX_DMA_POLICY_TX_FIFO_THRESH0_MASK 0x000000f0 -#define MBOX_DMA_POLICY_TX_FIFO_THRESH0_GET(x) (((x) & MBOX_DMA_POLICY_TX_FIFO_THRESH0_MASK) >> MBOX_DMA_POLICY_TX_FIFO_THRESH0_LSB) -#define MBOX_DMA_POLICY_TX_FIFO_THRESH0_SET(x) (((x) << MBOX_DMA_POLICY_TX_FIFO_THRESH0_LSB) & MBOX_DMA_POLICY_TX_FIFO_THRESH0_MASK) -#define MBOX_DMA_POLICY_TX_QUANTUM_MSB 3 -#define MBOX_DMA_POLICY_TX_QUANTUM_LSB 3 -#define MBOX_DMA_POLICY_TX_QUANTUM_MASK 0x00000008 -#define MBOX_DMA_POLICY_TX_QUANTUM_GET(x) (((x) & MBOX_DMA_POLICY_TX_QUANTUM_MASK) >> MBOX_DMA_POLICY_TX_QUANTUM_LSB) -#define MBOX_DMA_POLICY_TX_QUANTUM_SET(x) (((x) << MBOX_DMA_POLICY_TX_QUANTUM_LSB) & MBOX_DMA_POLICY_TX_QUANTUM_MASK) -#define MBOX_DMA_POLICY_TX_ORDER_MSB 2 -#define MBOX_DMA_POLICY_TX_ORDER_LSB 2 -#define MBOX_DMA_POLICY_TX_ORDER_MASK 0x00000004 -#define MBOX_DMA_POLICY_TX_ORDER_GET(x) (((x) & MBOX_DMA_POLICY_TX_ORDER_MASK) >> MBOX_DMA_POLICY_TX_ORDER_LSB) -#define MBOX_DMA_POLICY_TX_ORDER_SET(x) (((x) << MBOX_DMA_POLICY_TX_ORDER_LSB) & MBOX_DMA_POLICY_TX_ORDER_MASK) -#define MBOX_DMA_POLICY_RX_QUANTUM_MSB 1 -#define MBOX_DMA_POLICY_RX_QUANTUM_LSB 1 -#define MBOX_DMA_POLICY_RX_QUANTUM_MASK 0x00000002 -#define MBOX_DMA_POLICY_RX_QUANTUM_GET(x) (((x) & MBOX_DMA_POLICY_RX_QUANTUM_MASK) >> MBOX_DMA_POLICY_RX_QUANTUM_LSB) -#define MBOX_DMA_POLICY_RX_QUANTUM_SET(x) (((x) << MBOX_DMA_POLICY_RX_QUANTUM_LSB) & MBOX_DMA_POLICY_RX_QUANTUM_MASK) -#define MBOX_DMA_POLICY_RX_ORDER_MSB 0 -#define MBOX_DMA_POLICY_RX_ORDER_LSB 0 -#define MBOX_DMA_POLICY_RX_ORDER_MASK 0x00000001 -#define MBOX_DMA_POLICY_RX_ORDER_GET(x) (((x) & MBOX_DMA_POLICY_RX_ORDER_MASK) >> MBOX_DMA_POLICY_RX_ORDER_LSB) -#define MBOX_DMA_POLICY_RX_ORDER_SET(x) (((x) << MBOX_DMA_POLICY_RX_ORDER_LSB) & MBOX_DMA_POLICY_RX_ORDER_MASK) - -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x0000000c -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x0000000c -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX0_DMA_RX_CONTROL_ADDRESS 0x00000010 -#define MBOX0_DMA_RX_CONTROL_OFFSET 0x00000010 -#define MBOX0_DMA_RX_CONTROL_RESUME_MSB 2 -#define MBOX0_DMA_RX_CONTROL_RESUME_LSB 2 -#define MBOX0_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX0_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_RESUME_MASK) >> MBOX0_DMA_RX_CONTROL_RESUME_LSB) -#define MBOX0_DMA_RX_CONTROL_RESUME_SET(x) (((x) << MBOX0_DMA_RX_CONTROL_RESUME_LSB) & MBOX0_DMA_RX_CONTROL_RESUME_MASK) -#define MBOX0_DMA_RX_CONTROL_START_MSB 1 -#define MBOX0_DMA_RX_CONTROL_START_LSB 1 -#define MBOX0_DMA_RX_CONTROL_START_MASK 0x00000002 -#define MBOX0_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_START_MASK) >> MBOX0_DMA_RX_CONTROL_START_LSB) -#define MBOX0_DMA_RX_CONTROL_START_SET(x) (((x) << MBOX0_DMA_RX_CONTROL_START_LSB) & MBOX0_DMA_RX_CONTROL_START_MASK) -#define MBOX0_DMA_RX_CONTROL_STOP_MSB 0 -#define MBOX0_DMA_RX_CONTROL_STOP_LSB 0 -#define MBOX0_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define MBOX0_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_STOP_MASK) >> MBOX0_DMA_RX_CONTROL_STOP_LSB) -#define MBOX0_DMA_RX_CONTROL_STOP_SET(x) (((x) << MBOX0_DMA_RX_CONTROL_STOP_LSB) & MBOX0_DMA_RX_CONTROL_STOP_MASK) - -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000014 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000014 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define MBOX0_DMA_TX_CONTROL_ADDRESS 0x00000018 -#define MBOX0_DMA_TX_CONTROL_OFFSET 0x00000018 -#define MBOX0_DMA_TX_CONTROL_RESUME_MSB 2 -#define MBOX0_DMA_TX_CONTROL_RESUME_LSB 2 -#define MBOX0_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define MBOX0_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_RESUME_MASK) >> MBOX0_DMA_TX_CONTROL_RESUME_LSB) -#define MBOX0_DMA_TX_CONTROL_RESUME_SET(x) (((x) << MBOX0_DMA_TX_CONTROL_RESUME_LSB) & MBOX0_DMA_TX_CONTROL_RESUME_MASK) -#define MBOX0_DMA_TX_CONTROL_START_MSB 1 -#define MBOX0_DMA_TX_CONTROL_START_LSB 1 -#define MBOX0_DMA_TX_CONTROL_START_MASK 0x00000002 -#define MBOX0_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_START_MASK) >> MBOX0_DMA_TX_CONTROL_START_LSB) -#define MBOX0_DMA_TX_CONTROL_START_SET(x) (((x) << MBOX0_DMA_TX_CONTROL_START_LSB) & MBOX0_DMA_TX_CONTROL_START_MASK) -#define MBOX0_DMA_TX_CONTROL_STOP_MSB 0 -#define MBOX0_DMA_TX_CONTROL_STOP_LSB 0 -#define MBOX0_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define MBOX0_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_STOP_MASK) >> MBOX0_DMA_TX_CONTROL_STOP_LSB) -#define MBOX0_DMA_TX_CONTROL_STOP_SET(x) (((x) << MBOX0_DMA_TX_CONTROL_STOP_LSB) & MBOX0_DMA_TX_CONTROL_STOP_MASK) - -#define MBOX_FRAME_ADDRESS 0x0000001c -#define MBOX_FRAME_OFFSET 0x0000001c -#define MBOX_FRAME_RX_EOM_MSB 2 -#define MBOX_FRAME_RX_EOM_LSB 2 -#define MBOX_FRAME_RX_EOM_MASK 0x00000004 -#define MBOX_FRAME_RX_EOM_GET(x) (((x) & MBOX_FRAME_RX_EOM_MASK) >> MBOX_FRAME_RX_EOM_LSB) -#define MBOX_FRAME_RX_EOM_SET(x) (((x) << MBOX_FRAME_RX_EOM_LSB) & MBOX_FRAME_RX_EOM_MASK) -#define MBOX_FRAME_RX_SOM_MSB 0 -#define MBOX_FRAME_RX_SOM_LSB 0 -#define MBOX_FRAME_RX_SOM_MASK 0x00000001 -#define MBOX_FRAME_RX_SOM_GET(x) (((x) & MBOX_FRAME_RX_SOM_MASK) >> MBOX_FRAME_RX_SOM_LSB) -#define MBOX_FRAME_RX_SOM_SET(x) (((x) << MBOX_FRAME_RX_SOM_LSB) & MBOX_FRAME_RX_SOM_MASK) - -#define FIFO_TIMEOUT_ADDRESS 0x00000020 -#define FIFO_TIMEOUT_OFFSET 0x00000020 -#define FIFO_TIMEOUT_ENABLE_MSB 8 -#define FIFO_TIMEOUT_ENABLE_LSB 8 -#define FIFO_TIMEOUT_ENABLE_MASK 0x00000100 -#define FIFO_TIMEOUT_ENABLE_GET(x) (((x) & FIFO_TIMEOUT_ENABLE_MASK) >> FIFO_TIMEOUT_ENABLE_LSB) -#define FIFO_TIMEOUT_ENABLE_SET(x) (((x) << FIFO_TIMEOUT_ENABLE_LSB) & FIFO_TIMEOUT_ENABLE_MASK) -#define FIFO_TIMEOUT_VALUE_MSB 7 -#define FIFO_TIMEOUT_VALUE_LSB 0 -#define FIFO_TIMEOUT_VALUE_MASK 0x000000ff -#define FIFO_TIMEOUT_VALUE_GET(x) (((x) & FIFO_TIMEOUT_VALUE_MASK) >> FIFO_TIMEOUT_VALUE_LSB) -#define FIFO_TIMEOUT_VALUE_SET(x) (((x) << FIFO_TIMEOUT_VALUE_LSB) & FIFO_TIMEOUT_VALUE_MASK) - -#define MBOX_INT_STATUS_ADDRESS 0x00000024 -#define MBOX_INT_STATUS_OFFSET 0x00000024 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MSB 10 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB 10 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK 0x00000400 -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) >> MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) & MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB 8 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB 8 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK 0x00000100 -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) >> MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) (((x) << MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) & MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MSB 6 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB 6 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK 0x00000040 -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) >> MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) & MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) -#define MBOX_INT_STATUS_TX_OVERFLOW_MSB 5 -#define MBOX_INT_STATUS_TX_OVERFLOW_LSB 5 -#define MBOX_INT_STATUS_TX_OVERFLOW_MASK 0x00000020 -#define MBOX_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & MBOX_INT_STATUS_TX_OVERFLOW_MASK) >> MBOX_INT_STATUS_TX_OVERFLOW_LSB) -#define MBOX_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << MBOX_INT_STATUS_TX_OVERFLOW_LSB) & MBOX_INT_STATUS_TX_OVERFLOW_MASK) -#define MBOX_INT_STATUS_RX_UNDERFLOW_MSB 4 -#define MBOX_INT_STATUS_RX_UNDERFLOW_LSB 4 -#define MBOX_INT_STATUS_RX_UNDERFLOW_MASK 0x00000010 -#define MBOX_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & MBOX_INT_STATUS_RX_UNDERFLOW_MASK) >> MBOX_INT_STATUS_RX_UNDERFLOW_LSB) -#define MBOX_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << MBOX_INT_STATUS_RX_UNDERFLOW_LSB) & MBOX_INT_STATUS_RX_UNDERFLOW_MASK) -#define MBOX_INT_STATUS_TX_NOT_EMPTY_MSB 2 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_LSB 2 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_MASK 0x00000004 -#define MBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) (((x) & MBOX_INT_STATUS_TX_NOT_EMPTY_MASK) >> MBOX_INT_STATUS_TX_NOT_EMPTY_LSB) -#define MBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) (((x) << MBOX_INT_STATUS_TX_NOT_EMPTY_LSB) & MBOX_INT_STATUS_TX_NOT_EMPTY_MASK) -#define MBOX_INT_STATUS_RX_NOT_FULL_MSB 0 -#define MBOX_INT_STATUS_RX_NOT_FULL_LSB 0 -#define MBOX_INT_STATUS_RX_NOT_FULL_MASK 0x00000001 -#define MBOX_INT_STATUS_RX_NOT_FULL_GET(x) (((x) & MBOX_INT_STATUS_RX_NOT_FULL_MASK) >> MBOX_INT_STATUS_RX_NOT_FULL_LSB) -#define MBOX_INT_STATUS_RX_NOT_FULL_SET(x) (((x) << MBOX_INT_STATUS_RX_NOT_FULL_LSB) & MBOX_INT_STATUS_RX_NOT_FULL_MASK) - -#define MBOX_INT_ENABLE_ADDRESS 0x00000028 -#define MBOX_INT_ENABLE_OFFSET 0x00000028 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB 10 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB 10 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK 0x00000400 -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) >> MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) & MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB 8 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB 8 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK 0x00000100 -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) >> MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) (((x) << MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) & MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB 6 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB 6 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK 0x00000040 -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) >> MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) & MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) -#define MBOX_INT_ENABLE_TX_OVERFLOW_MSB 5 -#define MBOX_INT_ENABLE_TX_OVERFLOW_LSB 5 -#define MBOX_INT_ENABLE_TX_OVERFLOW_MASK 0x00000020 -#define MBOX_INT_ENABLE_TX_OVERFLOW_GET(x) (((x) & MBOX_INT_ENABLE_TX_OVERFLOW_MASK) >> MBOX_INT_ENABLE_TX_OVERFLOW_LSB) -#define MBOX_INT_ENABLE_TX_OVERFLOW_SET(x) (((x) << MBOX_INT_ENABLE_TX_OVERFLOW_LSB) & MBOX_INT_ENABLE_TX_OVERFLOW_MASK) -#define MBOX_INT_ENABLE_RX_UNDERFLOW_MSB 4 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_LSB 4 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_MASK 0x00000010 -#define MBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) (((x) & MBOX_INT_ENABLE_RX_UNDERFLOW_MASK) >> MBOX_INT_ENABLE_RX_UNDERFLOW_LSB) -#define MBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) (((x) << MBOX_INT_ENABLE_RX_UNDERFLOW_LSB) & MBOX_INT_ENABLE_RX_UNDERFLOW_MASK) -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MSB 2 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB 2 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK 0x00000004 -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) (((x) & MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) >> MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) (((x) << MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) & MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) -#define MBOX_INT_ENABLE_RX_NOT_FULL_MSB 0 -#define MBOX_INT_ENABLE_RX_NOT_FULL_LSB 0 -#define MBOX_INT_ENABLE_RX_NOT_FULL_MASK 0x00000001 -#define MBOX_INT_ENABLE_RX_NOT_FULL_GET(x) (((x) & MBOX_INT_ENABLE_RX_NOT_FULL_MASK) >> MBOX_INT_ENABLE_RX_NOT_FULL_LSB) -#define MBOX_INT_ENABLE_RX_NOT_FULL_SET(x) (((x) << MBOX_INT_ENABLE_RX_NOT_FULL_LSB) & MBOX_INT_ENABLE_RX_NOT_FULL_MASK) - -#define MBOX_FIFO_RESET_ADDRESS 0x0000002c -#define MBOX_FIFO_RESET_OFFSET 0x0000002c -#define MBOX_FIFO_RESET_RX_INIT_MSB 2 -#define MBOX_FIFO_RESET_RX_INIT_LSB 2 -#define MBOX_FIFO_RESET_RX_INIT_MASK 0x00000004 -#define MBOX_FIFO_RESET_RX_INIT_GET(x) (((x) & MBOX_FIFO_RESET_RX_INIT_MASK) >> MBOX_FIFO_RESET_RX_INIT_LSB) -#define MBOX_FIFO_RESET_RX_INIT_SET(x) (((x) << MBOX_FIFO_RESET_RX_INIT_LSB) & MBOX_FIFO_RESET_RX_INIT_MASK) -#define MBOX_FIFO_RESET_TX_INIT_MSB 0 -#define MBOX_FIFO_RESET_TX_INIT_LSB 0 -#define MBOX_FIFO_RESET_TX_INIT_MASK 0x00000001 -#define MBOX_FIFO_RESET_TX_INIT_GET(x) (((x) & MBOX_FIFO_RESET_TX_INIT_MASK) >> MBOX_FIFO_RESET_TX_INIT_LSB) -#define MBOX_FIFO_RESET_TX_INIT_SET(x) (((x) << MBOX_FIFO_RESET_TX_INIT_LSB) & MBOX_FIFO_RESET_TX_INIT_MASK) - -#define MBOX_DEBUG_CHAIN0_ADDRESS 0x00000030 -#define MBOX_DEBUG_CHAIN0_OFFSET 0x00000030 -#define MBOX_DEBUG_CHAIN0_ADDRESS_MSB 31 -#define MBOX_DEBUG_CHAIN0_ADDRESS_LSB 0 -#define MBOX_DEBUG_CHAIN0_ADDRESS_MASK 0xffffffff -#define MBOX_DEBUG_CHAIN0_ADDRESS_GET(x) (((x) & MBOX_DEBUG_CHAIN0_ADDRESS_MASK) >> MBOX_DEBUG_CHAIN0_ADDRESS_LSB) -#define MBOX_DEBUG_CHAIN0_ADDRESS_SET(x) (((x) << MBOX_DEBUG_CHAIN0_ADDRESS_LSB) & MBOX_DEBUG_CHAIN0_ADDRESS_MASK) - -#define MBOX_DEBUG_CHAIN1_ADDRESS 0x00000034 -#define MBOX_DEBUG_CHAIN1_OFFSET 0x00000034 -#define MBOX_DEBUG_CHAIN1_ADDRESS_MSB 31 -#define MBOX_DEBUG_CHAIN1_ADDRESS_LSB 0 -#define MBOX_DEBUG_CHAIN1_ADDRESS_MASK 0xffffffff -#define MBOX_DEBUG_CHAIN1_ADDRESS_GET(x) (((x) & MBOX_DEBUG_CHAIN1_ADDRESS_MASK) >> MBOX_DEBUG_CHAIN1_ADDRESS_LSB) -#define MBOX_DEBUG_CHAIN1_ADDRESS_SET(x) (((x) << MBOX_DEBUG_CHAIN1_ADDRESS_LSB) & MBOX_DEBUG_CHAIN1_ADDRESS_MASK) - -#define MBOX_DEBUG_CHAIN0_SIGNALS_ADDRESS 0x00000038 -#define MBOX_DEBUG_CHAIN0_SIGNALS_OFFSET 0x00000038 -#define MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_MSB 31 -#define MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_LSB 0 -#define MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_MASK 0xffffffff -#define MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_GET(x) (((x) & MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_MASK) >> MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_LSB) -#define MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_SET(x) (((x) << MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_LSB) & MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_MASK) - -#define MBOX_DEBUG_CHAIN1_SIGNALS_ADDRESS 0x0000003c -#define MBOX_DEBUG_CHAIN1_SIGNALS_OFFSET 0x0000003c -#define MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_MSB 31 -#define MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_LSB 0 -#define MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_MASK 0xffffffff -#define MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_GET(x) (((x) & MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_MASK) >> MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_LSB) -#define MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_SET(x) (((x) << MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_LSB) & MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct mbox_reg_reg_s { - volatile unsigned int mbox_fifo[1]; - volatile unsigned int mbox_fifo_status; - volatile unsigned int mbox_dma_policy; - volatile unsigned int mbox0_dma_rx_descriptor_base; - volatile unsigned int mbox0_dma_rx_control; - volatile unsigned int mbox0_dma_tx_descriptor_base; - volatile unsigned int mbox0_dma_tx_control; - volatile unsigned int mbox_frame; - volatile unsigned int fifo_timeout; - volatile unsigned int mbox_int_status; - volatile unsigned int mbox_int_enable; - volatile unsigned int mbox_fifo_reset; - volatile unsigned int mbox_debug_chain0; - volatile unsigned int mbox_debug_chain1; - volatile unsigned int mbox_debug_chain0_signals; - volatile unsigned int mbox_debug_chain1_signals; -} mbox_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _MBOX_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_reg.h deleted file mode 100644 index ef74f9b2ca20..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_reg.h +++ /dev/null @@ -1,580 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "mbox_wlan_reg.h" - - -#ifndef BT_HEADERS - -#define MBOX_FIFO_ADDRESS WLAN_MBOX_FIFO_ADDRESS -#define MBOX_FIFO_OFFSET WLAN_MBOX_FIFO_OFFSET -#define MBOX_FIFO_DATA_MSB WLAN_MBOX_FIFO_DATA_MSB -#define MBOX_FIFO_DATA_LSB WLAN_MBOX_FIFO_DATA_LSB -#define MBOX_FIFO_DATA_MASK WLAN_MBOX_FIFO_DATA_MASK -#define MBOX_FIFO_DATA_GET(x) WLAN_MBOX_FIFO_DATA_GET(x) -#define MBOX_FIFO_DATA_SET(x) WLAN_MBOX_FIFO_DATA_SET(x) -#define MBOX_FIFO_STATUS_ADDRESS WLAN_MBOX_FIFO_STATUS_ADDRESS -#define MBOX_FIFO_STATUS_OFFSET WLAN_MBOX_FIFO_STATUS_OFFSET -#define MBOX_FIFO_STATUS_EMPTY_MSB WLAN_MBOX_FIFO_STATUS_EMPTY_MSB -#define MBOX_FIFO_STATUS_EMPTY_LSB WLAN_MBOX_FIFO_STATUS_EMPTY_LSB -#define MBOX_FIFO_STATUS_EMPTY_MASK WLAN_MBOX_FIFO_STATUS_EMPTY_MASK -#define MBOX_FIFO_STATUS_EMPTY_GET(x) WLAN_MBOX_FIFO_STATUS_EMPTY_GET(x) -#define MBOX_FIFO_STATUS_EMPTY_SET(x) WLAN_MBOX_FIFO_STATUS_EMPTY_SET(x) -#define MBOX_FIFO_STATUS_FULL_MSB WLAN_MBOX_FIFO_STATUS_FULL_MSB -#define MBOX_FIFO_STATUS_FULL_LSB WLAN_MBOX_FIFO_STATUS_FULL_LSB -#define MBOX_FIFO_STATUS_FULL_MASK WLAN_MBOX_FIFO_STATUS_FULL_MASK -#define MBOX_FIFO_STATUS_FULL_GET(x) WLAN_MBOX_FIFO_STATUS_FULL_GET(x) -#define MBOX_FIFO_STATUS_FULL_SET(x) WLAN_MBOX_FIFO_STATUS_FULL_SET(x) -#define MBOX_DMA_POLICY_ADDRESS WLAN_MBOX_DMA_POLICY_ADDRESS -#define MBOX_DMA_POLICY_OFFSET WLAN_MBOX_DMA_POLICY_OFFSET -#define MBOX_DMA_POLICY_TX_QUANTUM_MSB WLAN_MBOX_DMA_POLICY_TX_QUANTUM_MSB -#define MBOX_DMA_POLICY_TX_QUANTUM_LSB WLAN_MBOX_DMA_POLICY_TX_QUANTUM_LSB -#define MBOX_DMA_POLICY_TX_QUANTUM_MASK WLAN_MBOX_DMA_POLICY_TX_QUANTUM_MASK -#define MBOX_DMA_POLICY_TX_QUANTUM_GET(x) WLAN_MBOX_DMA_POLICY_TX_QUANTUM_GET(x) -#define MBOX_DMA_POLICY_TX_QUANTUM_SET(x) WLAN_MBOX_DMA_POLICY_TX_QUANTUM_SET(x) -#define MBOX_DMA_POLICY_TX_ORDER_MSB WLAN_MBOX_DMA_POLICY_TX_ORDER_MSB -#define MBOX_DMA_POLICY_TX_ORDER_LSB WLAN_MBOX_DMA_POLICY_TX_ORDER_LSB -#define MBOX_DMA_POLICY_TX_ORDER_MASK WLAN_MBOX_DMA_POLICY_TX_ORDER_MASK -#define MBOX_DMA_POLICY_TX_ORDER_GET(x) WLAN_MBOX_DMA_POLICY_TX_ORDER_GET(x) -#define MBOX_DMA_POLICY_TX_ORDER_SET(x) WLAN_MBOX_DMA_POLICY_TX_ORDER_SET(x) -#define MBOX_DMA_POLICY_RX_QUANTUM_MSB WLAN_MBOX_DMA_POLICY_RX_QUANTUM_MSB -#define MBOX_DMA_POLICY_RX_QUANTUM_LSB WLAN_MBOX_DMA_POLICY_RX_QUANTUM_LSB -#define MBOX_DMA_POLICY_RX_QUANTUM_MASK WLAN_MBOX_DMA_POLICY_RX_QUANTUM_MASK -#define MBOX_DMA_POLICY_RX_QUANTUM_GET(x) WLAN_MBOX_DMA_POLICY_RX_QUANTUM_GET(x) -#define MBOX_DMA_POLICY_RX_QUANTUM_SET(x) WLAN_MBOX_DMA_POLICY_RX_QUANTUM_SET(x) -#define MBOX_DMA_POLICY_RX_ORDER_MSB WLAN_MBOX_DMA_POLICY_RX_ORDER_MSB -#define MBOX_DMA_POLICY_RX_ORDER_LSB WLAN_MBOX_DMA_POLICY_RX_ORDER_LSB -#define MBOX_DMA_POLICY_RX_ORDER_MASK WLAN_MBOX_DMA_POLICY_RX_ORDER_MASK -#define MBOX_DMA_POLICY_RX_ORDER_GET(x) WLAN_MBOX_DMA_POLICY_RX_ORDER_GET(x) -#define MBOX_DMA_POLICY_RX_ORDER_SET(x) WLAN_MBOX_DMA_POLICY_RX_ORDER_SET(x) -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX0_DMA_RX_CONTROL_ADDRESS WLAN_MBOX0_DMA_RX_CONTROL_ADDRESS -#define MBOX0_DMA_RX_CONTROL_OFFSET WLAN_MBOX0_DMA_RX_CONTROL_OFFSET -#define MBOX0_DMA_RX_CONTROL_RESUME_MSB WLAN_MBOX0_DMA_RX_CONTROL_RESUME_MSB -#define MBOX0_DMA_RX_CONTROL_RESUME_LSB WLAN_MBOX0_DMA_RX_CONTROL_RESUME_LSB -#define MBOX0_DMA_RX_CONTROL_RESUME_MASK WLAN_MBOX0_DMA_RX_CONTROL_RESUME_MASK -#define MBOX0_DMA_RX_CONTROL_RESUME_GET(x) WLAN_MBOX0_DMA_RX_CONTROL_RESUME_GET(x) -#define MBOX0_DMA_RX_CONTROL_RESUME_SET(x) WLAN_MBOX0_DMA_RX_CONTROL_RESUME_SET(x) -#define MBOX0_DMA_RX_CONTROL_START_MSB WLAN_MBOX0_DMA_RX_CONTROL_START_MSB -#define MBOX0_DMA_RX_CONTROL_START_LSB WLAN_MBOX0_DMA_RX_CONTROL_START_LSB -#define MBOX0_DMA_RX_CONTROL_START_MASK WLAN_MBOX0_DMA_RX_CONTROL_START_MASK -#define MBOX0_DMA_RX_CONTROL_START_GET(x) WLAN_MBOX0_DMA_RX_CONTROL_START_GET(x) -#define MBOX0_DMA_RX_CONTROL_START_SET(x) WLAN_MBOX0_DMA_RX_CONTROL_START_SET(x) -#define MBOX0_DMA_RX_CONTROL_STOP_MSB WLAN_MBOX0_DMA_RX_CONTROL_STOP_MSB -#define MBOX0_DMA_RX_CONTROL_STOP_LSB WLAN_MBOX0_DMA_RX_CONTROL_STOP_LSB -#define MBOX0_DMA_RX_CONTROL_STOP_MASK WLAN_MBOX0_DMA_RX_CONTROL_STOP_MASK -#define MBOX0_DMA_RX_CONTROL_STOP_GET(x) WLAN_MBOX0_DMA_RX_CONTROL_STOP_GET(x) -#define MBOX0_DMA_RX_CONTROL_STOP_SET(x) WLAN_MBOX0_DMA_RX_CONTROL_STOP_SET(x) -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX0_DMA_TX_CONTROL_ADDRESS WLAN_MBOX0_DMA_TX_CONTROL_ADDRESS -#define MBOX0_DMA_TX_CONTROL_OFFSET WLAN_MBOX0_DMA_TX_CONTROL_OFFSET -#define MBOX0_DMA_TX_CONTROL_RESUME_MSB WLAN_MBOX0_DMA_TX_CONTROL_RESUME_MSB -#define MBOX0_DMA_TX_CONTROL_RESUME_LSB WLAN_MBOX0_DMA_TX_CONTROL_RESUME_LSB -#define MBOX0_DMA_TX_CONTROL_RESUME_MASK WLAN_MBOX0_DMA_TX_CONTROL_RESUME_MASK -#define MBOX0_DMA_TX_CONTROL_RESUME_GET(x) WLAN_MBOX0_DMA_TX_CONTROL_RESUME_GET(x) -#define MBOX0_DMA_TX_CONTROL_RESUME_SET(x) WLAN_MBOX0_DMA_TX_CONTROL_RESUME_SET(x) -#define MBOX0_DMA_TX_CONTROL_START_MSB WLAN_MBOX0_DMA_TX_CONTROL_START_MSB -#define MBOX0_DMA_TX_CONTROL_START_LSB WLAN_MBOX0_DMA_TX_CONTROL_START_LSB -#define MBOX0_DMA_TX_CONTROL_START_MASK WLAN_MBOX0_DMA_TX_CONTROL_START_MASK -#define MBOX0_DMA_TX_CONTROL_START_GET(x) WLAN_MBOX0_DMA_TX_CONTROL_START_GET(x) -#define MBOX0_DMA_TX_CONTROL_START_SET(x) WLAN_MBOX0_DMA_TX_CONTROL_START_SET(x) -#define MBOX0_DMA_TX_CONTROL_STOP_MSB WLAN_MBOX0_DMA_TX_CONTROL_STOP_MSB -#define MBOX0_DMA_TX_CONTROL_STOP_LSB WLAN_MBOX0_DMA_TX_CONTROL_STOP_LSB -#define MBOX0_DMA_TX_CONTROL_STOP_MASK WLAN_MBOX0_DMA_TX_CONTROL_STOP_MASK -#define MBOX0_DMA_TX_CONTROL_STOP_GET(x) WLAN_MBOX0_DMA_TX_CONTROL_STOP_GET(x) -#define MBOX0_DMA_TX_CONTROL_STOP_SET(x) WLAN_MBOX0_DMA_TX_CONTROL_STOP_SET(x) -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_OFFSET -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX1_DMA_RX_CONTROL_ADDRESS WLAN_MBOX1_DMA_RX_CONTROL_ADDRESS -#define MBOX1_DMA_RX_CONTROL_OFFSET WLAN_MBOX1_DMA_RX_CONTROL_OFFSET -#define MBOX1_DMA_RX_CONTROL_RESUME_MSB WLAN_MBOX1_DMA_RX_CONTROL_RESUME_MSB -#define MBOX1_DMA_RX_CONTROL_RESUME_LSB WLAN_MBOX1_DMA_RX_CONTROL_RESUME_LSB -#define MBOX1_DMA_RX_CONTROL_RESUME_MASK WLAN_MBOX1_DMA_RX_CONTROL_RESUME_MASK -#define MBOX1_DMA_RX_CONTROL_RESUME_GET(x) WLAN_MBOX1_DMA_RX_CONTROL_RESUME_GET(x) -#define MBOX1_DMA_RX_CONTROL_RESUME_SET(x) WLAN_MBOX1_DMA_RX_CONTROL_RESUME_SET(x) -#define MBOX1_DMA_RX_CONTROL_START_MSB WLAN_MBOX1_DMA_RX_CONTROL_START_MSB -#define MBOX1_DMA_RX_CONTROL_START_LSB WLAN_MBOX1_DMA_RX_CONTROL_START_LSB -#define MBOX1_DMA_RX_CONTROL_START_MASK WLAN_MBOX1_DMA_RX_CONTROL_START_MASK -#define MBOX1_DMA_RX_CONTROL_START_GET(x) WLAN_MBOX1_DMA_RX_CONTROL_START_GET(x) -#define MBOX1_DMA_RX_CONTROL_START_SET(x) WLAN_MBOX1_DMA_RX_CONTROL_START_SET(x) -#define MBOX1_DMA_RX_CONTROL_STOP_MSB WLAN_MBOX1_DMA_RX_CONTROL_STOP_MSB -#define MBOX1_DMA_RX_CONTROL_STOP_LSB WLAN_MBOX1_DMA_RX_CONTROL_STOP_LSB -#define MBOX1_DMA_RX_CONTROL_STOP_MASK WLAN_MBOX1_DMA_RX_CONTROL_STOP_MASK -#define MBOX1_DMA_RX_CONTROL_STOP_GET(x) WLAN_MBOX1_DMA_RX_CONTROL_STOP_GET(x) -#define MBOX1_DMA_RX_CONTROL_STOP_SET(x) WLAN_MBOX1_DMA_RX_CONTROL_STOP_SET(x) -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_OFFSET -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX1_DMA_TX_CONTROL_ADDRESS WLAN_MBOX1_DMA_TX_CONTROL_ADDRESS -#define MBOX1_DMA_TX_CONTROL_OFFSET WLAN_MBOX1_DMA_TX_CONTROL_OFFSET -#define MBOX1_DMA_TX_CONTROL_RESUME_MSB WLAN_MBOX1_DMA_TX_CONTROL_RESUME_MSB -#define MBOX1_DMA_TX_CONTROL_RESUME_LSB WLAN_MBOX1_DMA_TX_CONTROL_RESUME_LSB -#define MBOX1_DMA_TX_CONTROL_RESUME_MASK WLAN_MBOX1_DMA_TX_CONTROL_RESUME_MASK -#define MBOX1_DMA_TX_CONTROL_RESUME_GET(x) WLAN_MBOX1_DMA_TX_CONTROL_RESUME_GET(x) -#define MBOX1_DMA_TX_CONTROL_RESUME_SET(x) WLAN_MBOX1_DMA_TX_CONTROL_RESUME_SET(x) -#define MBOX1_DMA_TX_CONTROL_START_MSB WLAN_MBOX1_DMA_TX_CONTROL_START_MSB -#define MBOX1_DMA_TX_CONTROL_START_LSB WLAN_MBOX1_DMA_TX_CONTROL_START_LSB -#define MBOX1_DMA_TX_CONTROL_START_MASK WLAN_MBOX1_DMA_TX_CONTROL_START_MASK -#define MBOX1_DMA_TX_CONTROL_START_GET(x) WLAN_MBOX1_DMA_TX_CONTROL_START_GET(x) -#define MBOX1_DMA_TX_CONTROL_START_SET(x) WLAN_MBOX1_DMA_TX_CONTROL_START_SET(x) -#define MBOX1_DMA_TX_CONTROL_STOP_MSB WLAN_MBOX1_DMA_TX_CONTROL_STOP_MSB -#define MBOX1_DMA_TX_CONTROL_STOP_LSB WLAN_MBOX1_DMA_TX_CONTROL_STOP_LSB -#define MBOX1_DMA_TX_CONTROL_STOP_MASK WLAN_MBOX1_DMA_TX_CONTROL_STOP_MASK -#define MBOX1_DMA_TX_CONTROL_STOP_GET(x) WLAN_MBOX1_DMA_TX_CONTROL_STOP_GET(x) -#define MBOX1_DMA_TX_CONTROL_STOP_SET(x) WLAN_MBOX1_DMA_TX_CONTROL_STOP_SET(x) -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_OFFSET -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX2_DMA_RX_CONTROL_ADDRESS WLAN_MBOX2_DMA_RX_CONTROL_ADDRESS -#define MBOX2_DMA_RX_CONTROL_OFFSET WLAN_MBOX2_DMA_RX_CONTROL_OFFSET -#define MBOX2_DMA_RX_CONTROL_RESUME_MSB WLAN_MBOX2_DMA_RX_CONTROL_RESUME_MSB -#define MBOX2_DMA_RX_CONTROL_RESUME_LSB WLAN_MBOX2_DMA_RX_CONTROL_RESUME_LSB -#define MBOX2_DMA_RX_CONTROL_RESUME_MASK WLAN_MBOX2_DMA_RX_CONTROL_RESUME_MASK -#define MBOX2_DMA_RX_CONTROL_RESUME_GET(x) WLAN_MBOX2_DMA_RX_CONTROL_RESUME_GET(x) -#define MBOX2_DMA_RX_CONTROL_RESUME_SET(x) WLAN_MBOX2_DMA_RX_CONTROL_RESUME_SET(x) -#define MBOX2_DMA_RX_CONTROL_START_MSB WLAN_MBOX2_DMA_RX_CONTROL_START_MSB -#define MBOX2_DMA_RX_CONTROL_START_LSB WLAN_MBOX2_DMA_RX_CONTROL_START_LSB -#define MBOX2_DMA_RX_CONTROL_START_MASK WLAN_MBOX2_DMA_RX_CONTROL_START_MASK -#define MBOX2_DMA_RX_CONTROL_START_GET(x) WLAN_MBOX2_DMA_RX_CONTROL_START_GET(x) -#define MBOX2_DMA_RX_CONTROL_START_SET(x) WLAN_MBOX2_DMA_RX_CONTROL_START_SET(x) -#define MBOX2_DMA_RX_CONTROL_STOP_MSB WLAN_MBOX2_DMA_RX_CONTROL_STOP_MSB -#define MBOX2_DMA_RX_CONTROL_STOP_LSB WLAN_MBOX2_DMA_RX_CONTROL_STOP_LSB -#define MBOX2_DMA_RX_CONTROL_STOP_MASK WLAN_MBOX2_DMA_RX_CONTROL_STOP_MASK -#define MBOX2_DMA_RX_CONTROL_STOP_GET(x) WLAN_MBOX2_DMA_RX_CONTROL_STOP_GET(x) -#define MBOX2_DMA_RX_CONTROL_STOP_SET(x) WLAN_MBOX2_DMA_RX_CONTROL_STOP_SET(x) -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_OFFSET -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX2_DMA_TX_CONTROL_ADDRESS WLAN_MBOX2_DMA_TX_CONTROL_ADDRESS -#define MBOX2_DMA_TX_CONTROL_OFFSET WLAN_MBOX2_DMA_TX_CONTROL_OFFSET -#define MBOX2_DMA_TX_CONTROL_RESUME_MSB WLAN_MBOX2_DMA_TX_CONTROL_RESUME_MSB -#define MBOX2_DMA_TX_CONTROL_RESUME_LSB WLAN_MBOX2_DMA_TX_CONTROL_RESUME_LSB -#define MBOX2_DMA_TX_CONTROL_RESUME_MASK WLAN_MBOX2_DMA_TX_CONTROL_RESUME_MASK -#define MBOX2_DMA_TX_CONTROL_RESUME_GET(x) WLAN_MBOX2_DMA_TX_CONTROL_RESUME_GET(x) -#define MBOX2_DMA_TX_CONTROL_RESUME_SET(x) WLAN_MBOX2_DMA_TX_CONTROL_RESUME_SET(x) -#define MBOX2_DMA_TX_CONTROL_START_MSB WLAN_MBOX2_DMA_TX_CONTROL_START_MSB -#define MBOX2_DMA_TX_CONTROL_START_LSB WLAN_MBOX2_DMA_TX_CONTROL_START_LSB -#define MBOX2_DMA_TX_CONTROL_START_MASK WLAN_MBOX2_DMA_TX_CONTROL_START_MASK -#define MBOX2_DMA_TX_CONTROL_START_GET(x) WLAN_MBOX2_DMA_TX_CONTROL_START_GET(x) -#define MBOX2_DMA_TX_CONTROL_START_SET(x) WLAN_MBOX2_DMA_TX_CONTROL_START_SET(x) -#define MBOX2_DMA_TX_CONTROL_STOP_MSB WLAN_MBOX2_DMA_TX_CONTROL_STOP_MSB -#define MBOX2_DMA_TX_CONTROL_STOP_LSB WLAN_MBOX2_DMA_TX_CONTROL_STOP_LSB -#define MBOX2_DMA_TX_CONTROL_STOP_MASK WLAN_MBOX2_DMA_TX_CONTROL_STOP_MASK -#define MBOX2_DMA_TX_CONTROL_STOP_GET(x) WLAN_MBOX2_DMA_TX_CONTROL_STOP_GET(x) -#define MBOX2_DMA_TX_CONTROL_STOP_SET(x) WLAN_MBOX2_DMA_TX_CONTROL_STOP_SET(x) -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_OFFSET -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX3_DMA_RX_CONTROL_ADDRESS WLAN_MBOX3_DMA_RX_CONTROL_ADDRESS -#define MBOX3_DMA_RX_CONTROL_OFFSET WLAN_MBOX3_DMA_RX_CONTROL_OFFSET -#define MBOX3_DMA_RX_CONTROL_RESUME_MSB WLAN_MBOX3_DMA_RX_CONTROL_RESUME_MSB -#define MBOX3_DMA_RX_CONTROL_RESUME_LSB WLAN_MBOX3_DMA_RX_CONTROL_RESUME_LSB -#define MBOX3_DMA_RX_CONTROL_RESUME_MASK WLAN_MBOX3_DMA_RX_CONTROL_RESUME_MASK -#define MBOX3_DMA_RX_CONTROL_RESUME_GET(x) WLAN_MBOX3_DMA_RX_CONTROL_RESUME_GET(x) -#define MBOX3_DMA_RX_CONTROL_RESUME_SET(x) WLAN_MBOX3_DMA_RX_CONTROL_RESUME_SET(x) -#define MBOX3_DMA_RX_CONTROL_START_MSB WLAN_MBOX3_DMA_RX_CONTROL_START_MSB -#define MBOX3_DMA_RX_CONTROL_START_LSB WLAN_MBOX3_DMA_RX_CONTROL_START_LSB -#define MBOX3_DMA_RX_CONTROL_START_MASK WLAN_MBOX3_DMA_RX_CONTROL_START_MASK -#define MBOX3_DMA_RX_CONTROL_START_GET(x) WLAN_MBOX3_DMA_RX_CONTROL_START_GET(x) -#define MBOX3_DMA_RX_CONTROL_START_SET(x) WLAN_MBOX3_DMA_RX_CONTROL_START_SET(x) -#define MBOX3_DMA_RX_CONTROL_STOP_MSB WLAN_MBOX3_DMA_RX_CONTROL_STOP_MSB -#define MBOX3_DMA_RX_CONTROL_STOP_LSB WLAN_MBOX3_DMA_RX_CONTROL_STOP_LSB -#define MBOX3_DMA_RX_CONTROL_STOP_MASK WLAN_MBOX3_DMA_RX_CONTROL_STOP_MASK -#define MBOX3_DMA_RX_CONTROL_STOP_GET(x) WLAN_MBOX3_DMA_RX_CONTROL_STOP_GET(x) -#define MBOX3_DMA_RX_CONTROL_STOP_SET(x) WLAN_MBOX3_DMA_RX_CONTROL_STOP_SET(x) -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_OFFSET WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_OFFSET -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define MBOX3_DMA_TX_CONTROL_ADDRESS WLAN_MBOX3_DMA_TX_CONTROL_ADDRESS -#define MBOX3_DMA_TX_CONTROL_OFFSET WLAN_MBOX3_DMA_TX_CONTROL_OFFSET -#define MBOX3_DMA_TX_CONTROL_RESUME_MSB WLAN_MBOX3_DMA_TX_CONTROL_RESUME_MSB -#define MBOX3_DMA_TX_CONTROL_RESUME_LSB WLAN_MBOX3_DMA_TX_CONTROL_RESUME_LSB -#define MBOX3_DMA_TX_CONTROL_RESUME_MASK WLAN_MBOX3_DMA_TX_CONTROL_RESUME_MASK -#define MBOX3_DMA_TX_CONTROL_RESUME_GET(x) WLAN_MBOX3_DMA_TX_CONTROL_RESUME_GET(x) -#define MBOX3_DMA_TX_CONTROL_RESUME_SET(x) WLAN_MBOX3_DMA_TX_CONTROL_RESUME_SET(x) -#define MBOX3_DMA_TX_CONTROL_START_MSB WLAN_MBOX3_DMA_TX_CONTROL_START_MSB -#define MBOX3_DMA_TX_CONTROL_START_LSB WLAN_MBOX3_DMA_TX_CONTROL_START_LSB -#define MBOX3_DMA_TX_CONTROL_START_MASK WLAN_MBOX3_DMA_TX_CONTROL_START_MASK -#define MBOX3_DMA_TX_CONTROL_START_GET(x) WLAN_MBOX3_DMA_TX_CONTROL_START_GET(x) -#define MBOX3_DMA_TX_CONTROL_START_SET(x) WLAN_MBOX3_DMA_TX_CONTROL_START_SET(x) -#define MBOX3_DMA_TX_CONTROL_STOP_MSB WLAN_MBOX3_DMA_TX_CONTROL_STOP_MSB -#define MBOX3_DMA_TX_CONTROL_STOP_LSB WLAN_MBOX3_DMA_TX_CONTROL_STOP_LSB -#define MBOX3_DMA_TX_CONTROL_STOP_MASK WLAN_MBOX3_DMA_TX_CONTROL_STOP_MASK -#define MBOX3_DMA_TX_CONTROL_STOP_GET(x) WLAN_MBOX3_DMA_TX_CONTROL_STOP_GET(x) -#define MBOX3_DMA_TX_CONTROL_STOP_SET(x) WLAN_MBOX3_DMA_TX_CONTROL_STOP_SET(x) -#define MBOX_INT_STATUS_ADDRESS WLAN_MBOX_INT_STATUS_ADDRESS -#define MBOX_INT_STATUS_OFFSET WLAN_MBOX_INT_STATUS_OFFSET -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MSB WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_MSB -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) -#define MBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) -#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MSB WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_MSB -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) -#define MBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) -#define MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_MSB WLAN_MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_MSB -#define MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_LSB WLAN_MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_LSB -#define MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_MASK WLAN_MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_MASK -#define MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_GET(x) WLAN_MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_GET(x) -#define MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_SET(x) WLAN_MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_SET(x) -#define MBOX_INT_STATUS_FRAME_DONE_MSB WLAN_MBOX_INT_STATUS_FRAME_DONE_MSB -#define MBOX_INT_STATUS_FRAME_DONE_LSB WLAN_MBOX_INT_STATUS_FRAME_DONE_LSB -#define MBOX_INT_STATUS_FRAME_DONE_MASK WLAN_MBOX_INT_STATUS_FRAME_DONE_MASK -#define MBOX_INT_STATUS_FRAME_DONE_GET(x) WLAN_MBOX_INT_STATUS_FRAME_DONE_GET(x) -#define MBOX_INT_STATUS_FRAME_DONE_SET(x) WLAN_MBOX_INT_STATUS_FRAME_DONE_SET(x) -#define MBOX_INT_STATUS_TX_OVERFLOW_MSB WLAN_MBOX_INT_STATUS_TX_OVERFLOW_MSB -#define MBOX_INT_STATUS_TX_OVERFLOW_LSB WLAN_MBOX_INT_STATUS_TX_OVERFLOW_LSB -#define MBOX_INT_STATUS_TX_OVERFLOW_MASK WLAN_MBOX_INT_STATUS_TX_OVERFLOW_MASK -#define MBOX_INT_STATUS_TX_OVERFLOW_GET(x) WLAN_MBOX_INT_STATUS_TX_OVERFLOW_GET(x) -#define MBOX_INT_STATUS_TX_OVERFLOW_SET(x) WLAN_MBOX_INT_STATUS_TX_OVERFLOW_SET(x) -#define MBOX_INT_STATUS_RX_UNDERFLOW_MSB WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_MSB -#define MBOX_INT_STATUS_RX_UNDERFLOW_LSB WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_LSB -#define MBOX_INT_STATUS_RX_UNDERFLOW_MASK WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_MASK -#define MBOX_INT_STATUS_RX_UNDERFLOW_GET(x) WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_GET(x) -#define MBOX_INT_STATUS_RX_UNDERFLOW_SET(x) WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_SET(x) -#define MBOX_INT_STATUS_TX_NOT_EMPTY_MSB WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_MSB -#define MBOX_INT_STATUS_TX_NOT_EMPTY_LSB WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_LSB -#define MBOX_INT_STATUS_TX_NOT_EMPTY_MASK WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_MASK -#define MBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) -#define MBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) -#define MBOX_INT_STATUS_RX_NOT_FULL_MSB WLAN_MBOX_INT_STATUS_RX_NOT_FULL_MSB -#define MBOX_INT_STATUS_RX_NOT_FULL_LSB WLAN_MBOX_INT_STATUS_RX_NOT_FULL_LSB -#define MBOX_INT_STATUS_RX_NOT_FULL_MASK WLAN_MBOX_INT_STATUS_RX_NOT_FULL_MASK -#define MBOX_INT_STATUS_RX_NOT_FULL_GET(x) WLAN_MBOX_INT_STATUS_RX_NOT_FULL_GET(x) -#define MBOX_INT_STATUS_RX_NOT_FULL_SET(x) WLAN_MBOX_INT_STATUS_RX_NOT_FULL_SET(x) -#define MBOX_INT_STATUS_HOST_MSB WLAN_MBOX_INT_STATUS_HOST_MSB -#define MBOX_INT_STATUS_HOST_LSB WLAN_MBOX_INT_STATUS_HOST_LSB -#define MBOX_INT_STATUS_HOST_MASK WLAN_MBOX_INT_STATUS_HOST_MASK -#define MBOX_INT_STATUS_HOST_GET(x) WLAN_MBOX_INT_STATUS_HOST_GET(x) -#define MBOX_INT_STATUS_HOST_SET(x) WLAN_MBOX_INT_STATUS_HOST_SET(x) -#define MBOX_INT_ENABLE_ADDRESS WLAN_MBOX_INT_ENABLE_ADDRESS -#define MBOX_INT_ENABLE_OFFSET WLAN_MBOX_INT_ENABLE_OFFSET -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) -#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) -#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) -#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) -#define MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_MSB WLAN_MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_MSB -#define MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_LSB WLAN_MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_LSB -#define MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_MASK WLAN_MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_MASK -#define MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_GET(x) WLAN_MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_GET(x) -#define MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_SET(x) WLAN_MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_SET(x) -#define MBOX_INT_ENABLE_FRAME_DONE_MSB WLAN_MBOX_INT_ENABLE_FRAME_DONE_MSB -#define MBOX_INT_ENABLE_FRAME_DONE_LSB WLAN_MBOX_INT_ENABLE_FRAME_DONE_LSB -#define MBOX_INT_ENABLE_FRAME_DONE_MASK WLAN_MBOX_INT_ENABLE_FRAME_DONE_MASK -#define MBOX_INT_ENABLE_FRAME_DONE_GET(x) WLAN_MBOX_INT_ENABLE_FRAME_DONE_GET(x) -#define MBOX_INT_ENABLE_FRAME_DONE_SET(x) WLAN_MBOX_INT_ENABLE_FRAME_DONE_SET(x) -#define MBOX_INT_ENABLE_TX_OVERFLOW_MSB WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_MSB -#define MBOX_INT_ENABLE_TX_OVERFLOW_LSB WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_LSB -#define MBOX_INT_ENABLE_TX_OVERFLOW_MASK WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_MASK -#define MBOX_INT_ENABLE_TX_OVERFLOW_GET(x) WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_GET(x) -#define MBOX_INT_ENABLE_TX_OVERFLOW_SET(x) WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_SET(x) -#define MBOX_INT_ENABLE_RX_UNDERFLOW_MSB WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_MSB -#define MBOX_INT_ENABLE_RX_UNDERFLOW_LSB WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_LSB -#define MBOX_INT_ENABLE_RX_UNDERFLOW_MASK WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_MASK -#define MBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) -#define MBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MSB WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_MSB -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) -#define MBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) -#define MBOX_INT_ENABLE_RX_NOT_FULL_MSB WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_MSB -#define MBOX_INT_ENABLE_RX_NOT_FULL_LSB WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_LSB -#define MBOX_INT_ENABLE_RX_NOT_FULL_MASK WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_MASK -#define MBOX_INT_ENABLE_RX_NOT_FULL_GET(x) WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_GET(x) -#define MBOX_INT_ENABLE_RX_NOT_FULL_SET(x) WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_SET(x) -#define MBOX_INT_ENABLE_HOST_MSB WLAN_MBOX_INT_ENABLE_HOST_MSB -#define MBOX_INT_ENABLE_HOST_LSB WLAN_MBOX_INT_ENABLE_HOST_LSB -#define MBOX_INT_ENABLE_HOST_MASK WLAN_MBOX_INT_ENABLE_HOST_MASK -#define MBOX_INT_ENABLE_HOST_GET(x) WLAN_MBOX_INT_ENABLE_HOST_GET(x) -#define MBOX_INT_ENABLE_HOST_SET(x) WLAN_MBOX_INT_ENABLE_HOST_SET(x) -#define INT_HOST_ADDRESS WLAN_INT_HOST_ADDRESS -#define INT_HOST_OFFSET WLAN_INT_HOST_OFFSET -#define INT_HOST_VECTOR_MSB WLAN_INT_HOST_VECTOR_MSB -#define INT_HOST_VECTOR_LSB WLAN_INT_HOST_VECTOR_LSB -#define INT_HOST_VECTOR_MASK WLAN_INT_HOST_VECTOR_MASK -#define INT_HOST_VECTOR_GET(x) WLAN_INT_HOST_VECTOR_GET(x) -#define INT_HOST_VECTOR_SET(x) WLAN_INT_HOST_VECTOR_SET(x) -#define LOCAL_COUNT_ADDRESS WLAN_LOCAL_COUNT_ADDRESS -#define LOCAL_COUNT_OFFSET WLAN_LOCAL_COUNT_OFFSET -#define LOCAL_COUNT_VALUE_MSB WLAN_LOCAL_COUNT_VALUE_MSB -#define LOCAL_COUNT_VALUE_LSB WLAN_LOCAL_COUNT_VALUE_LSB -#define LOCAL_COUNT_VALUE_MASK WLAN_LOCAL_COUNT_VALUE_MASK -#define LOCAL_COUNT_VALUE_GET(x) WLAN_LOCAL_COUNT_VALUE_GET(x) -#define LOCAL_COUNT_VALUE_SET(x) WLAN_LOCAL_COUNT_VALUE_SET(x) -#define COUNT_INC_ADDRESS WLAN_COUNT_INC_ADDRESS -#define COUNT_INC_OFFSET WLAN_COUNT_INC_OFFSET -#define COUNT_INC_VALUE_MSB WLAN_COUNT_INC_VALUE_MSB -#define COUNT_INC_VALUE_LSB WLAN_COUNT_INC_VALUE_LSB -#define COUNT_INC_VALUE_MASK WLAN_COUNT_INC_VALUE_MASK -#define COUNT_INC_VALUE_GET(x) WLAN_COUNT_INC_VALUE_GET(x) -#define COUNT_INC_VALUE_SET(x) WLAN_COUNT_INC_VALUE_SET(x) -#define LOCAL_SCRATCH_ADDRESS WLAN_LOCAL_SCRATCH_ADDRESS -#define LOCAL_SCRATCH_OFFSET WLAN_LOCAL_SCRATCH_OFFSET -#define LOCAL_SCRATCH_VALUE_MSB WLAN_LOCAL_SCRATCH_VALUE_MSB -#define LOCAL_SCRATCH_VALUE_LSB WLAN_LOCAL_SCRATCH_VALUE_LSB -#define LOCAL_SCRATCH_VALUE_MASK WLAN_LOCAL_SCRATCH_VALUE_MASK -#define LOCAL_SCRATCH_VALUE_GET(x) WLAN_LOCAL_SCRATCH_VALUE_GET(x) -#define LOCAL_SCRATCH_VALUE_SET(x) WLAN_LOCAL_SCRATCH_VALUE_SET(x) -#define USE_LOCAL_BUS_ADDRESS WLAN_USE_LOCAL_BUS_ADDRESS -#define USE_LOCAL_BUS_OFFSET WLAN_USE_LOCAL_BUS_OFFSET -#define USE_LOCAL_BUS_PIN_INIT_MSB WLAN_USE_LOCAL_BUS_PIN_INIT_MSB -#define USE_LOCAL_BUS_PIN_INIT_LSB WLAN_USE_LOCAL_BUS_PIN_INIT_LSB -#define USE_LOCAL_BUS_PIN_INIT_MASK WLAN_USE_LOCAL_BUS_PIN_INIT_MASK -#define USE_LOCAL_BUS_PIN_INIT_GET(x) WLAN_USE_LOCAL_BUS_PIN_INIT_GET(x) -#define USE_LOCAL_BUS_PIN_INIT_SET(x) WLAN_USE_LOCAL_BUS_PIN_INIT_SET(x) -#define SDIO_CONFIG_ADDRESS WLAN_SDIO_CONFIG_ADDRESS -#define SDIO_CONFIG_OFFSET WLAN_SDIO_CONFIG_OFFSET -#define SDIO_CONFIG_CCCR_IOR1_MSB WLAN_SDIO_CONFIG_CCCR_IOR1_MSB -#define SDIO_CONFIG_CCCR_IOR1_LSB WLAN_SDIO_CONFIG_CCCR_IOR1_LSB -#define SDIO_CONFIG_CCCR_IOR1_MASK WLAN_SDIO_CONFIG_CCCR_IOR1_MASK -#define SDIO_CONFIG_CCCR_IOR1_GET(x) WLAN_SDIO_CONFIG_CCCR_IOR1_GET(x) -#define SDIO_CONFIG_CCCR_IOR1_SET(x) WLAN_SDIO_CONFIG_CCCR_IOR1_SET(x) -#define MBOX_DEBUG_ADDRESS WLAN_MBOX_DEBUG_ADDRESS -#define MBOX_DEBUG_OFFSET WLAN_MBOX_DEBUG_OFFSET -#define MBOX_DEBUG_SEL_MSB WLAN_MBOX_DEBUG_SEL_MSB -#define MBOX_DEBUG_SEL_LSB WLAN_MBOX_DEBUG_SEL_LSB -#define MBOX_DEBUG_SEL_MASK WLAN_MBOX_DEBUG_SEL_MASK -#define MBOX_DEBUG_SEL_GET(x) WLAN_MBOX_DEBUG_SEL_GET(x) -#define MBOX_DEBUG_SEL_SET(x) WLAN_MBOX_DEBUG_SEL_SET(x) -#define MBOX_FIFO_RESET_ADDRESS WLAN_MBOX_FIFO_RESET_ADDRESS -#define MBOX_FIFO_RESET_OFFSET WLAN_MBOX_FIFO_RESET_OFFSET -#define MBOX_FIFO_RESET_INIT_MSB WLAN_MBOX_FIFO_RESET_INIT_MSB -#define MBOX_FIFO_RESET_INIT_LSB WLAN_MBOX_FIFO_RESET_INIT_LSB -#define MBOX_FIFO_RESET_INIT_MASK WLAN_MBOX_FIFO_RESET_INIT_MASK -#define MBOX_FIFO_RESET_INIT_GET(x) WLAN_MBOX_FIFO_RESET_INIT_GET(x) -#define MBOX_FIFO_RESET_INIT_SET(x) WLAN_MBOX_FIFO_RESET_INIT_SET(x) -#define MBOX_TXFIFO_POP_ADDRESS WLAN_MBOX_TXFIFO_POP_ADDRESS -#define MBOX_TXFIFO_POP_OFFSET WLAN_MBOX_TXFIFO_POP_OFFSET -#define MBOX_TXFIFO_POP_DATA_MSB WLAN_MBOX_TXFIFO_POP_DATA_MSB -#define MBOX_TXFIFO_POP_DATA_LSB WLAN_MBOX_TXFIFO_POP_DATA_LSB -#define MBOX_TXFIFO_POP_DATA_MASK WLAN_MBOX_TXFIFO_POP_DATA_MASK -#define MBOX_TXFIFO_POP_DATA_GET(x) WLAN_MBOX_TXFIFO_POP_DATA_GET(x) -#define MBOX_TXFIFO_POP_DATA_SET(x) WLAN_MBOX_TXFIFO_POP_DATA_SET(x) -#define MBOX_RXFIFO_POP_ADDRESS WLAN_MBOX_RXFIFO_POP_ADDRESS -#define MBOX_RXFIFO_POP_OFFSET WLAN_MBOX_RXFIFO_POP_OFFSET -#define MBOX_RXFIFO_POP_DATA_MSB WLAN_MBOX_RXFIFO_POP_DATA_MSB -#define MBOX_RXFIFO_POP_DATA_LSB WLAN_MBOX_RXFIFO_POP_DATA_LSB -#define MBOX_RXFIFO_POP_DATA_MASK WLAN_MBOX_RXFIFO_POP_DATA_MASK -#define MBOX_RXFIFO_POP_DATA_GET(x) WLAN_MBOX_RXFIFO_POP_DATA_GET(x) -#define MBOX_RXFIFO_POP_DATA_SET(x) WLAN_MBOX_RXFIFO_POP_DATA_SET(x) -#define SDIO_DEBUG_ADDRESS WLAN_SDIO_DEBUG_ADDRESS -#define SDIO_DEBUG_OFFSET WLAN_SDIO_DEBUG_OFFSET -#define SDIO_DEBUG_SEL_MSB WLAN_SDIO_DEBUG_SEL_MSB -#define SDIO_DEBUG_SEL_LSB WLAN_SDIO_DEBUG_SEL_LSB -#define SDIO_DEBUG_SEL_MASK WLAN_SDIO_DEBUG_SEL_MASK -#define SDIO_DEBUG_SEL_GET(x) WLAN_SDIO_DEBUG_SEL_GET(x) -#define SDIO_DEBUG_SEL_SET(x) WLAN_SDIO_DEBUG_SEL_SET(x) -#define GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS -#define GMBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET -#define GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB -#define GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB -#define GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK -#define GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define GMBOX0_DMA_RX_CONTROL_ADDRESS WLAN_GMBOX0_DMA_RX_CONTROL_ADDRESS -#define GMBOX0_DMA_RX_CONTROL_OFFSET WLAN_GMBOX0_DMA_RX_CONTROL_OFFSET -#define GMBOX0_DMA_RX_CONTROL_RESUME_MSB WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_MSB -#define GMBOX0_DMA_RX_CONTROL_RESUME_LSB WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_LSB -#define GMBOX0_DMA_RX_CONTROL_RESUME_MASK WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_MASK -#define GMBOX0_DMA_RX_CONTROL_RESUME_GET(x) WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_GET(x) -#define GMBOX0_DMA_RX_CONTROL_RESUME_SET(x) WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_SET(x) -#define GMBOX0_DMA_RX_CONTROL_START_MSB WLAN_GMBOX0_DMA_RX_CONTROL_START_MSB -#define GMBOX0_DMA_RX_CONTROL_START_LSB WLAN_GMBOX0_DMA_RX_CONTROL_START_LSB -#define GMBOX0_DMA_RX_CONTROL_START_MASK WLAN_GMBOX0_DMA_RX_CONTROL_START_MASK -#define GMBOX0_DMA_RX_CONTROL_START_GET(x) WLAN_GMBOX0_DMA_RX_CONTROL_START_GET(x) -#define GMBOX0_DMA_RX_CONTROL_START_SET(x) WLAN_GMBOX0_DMA_RX_CONTROL_START_SET(x) -#define GMBOX0_DMA_RX_CONTROL_STOP_MSB WLAN_GMBOX0_DMA_RX_CONTROL_STOP_MSB -#define GMBOX0_DMA_RX_CONTROL_STOP_LSB WLAN_GMBOX0_DMA_RX_CONTROL_STOP_LSB -#define GMBOX0_DMA_RX_CONTROL_STOP_MASK WLAN_GMBOX0_DMA_RX_CONTROL_STOP_MASK -#define GMBOX0_DMA_RX_CONTROL_STOP_GET(x) WLAN_GMBOX0_DMA_RX_CONTROL_STOP_GET(x) -#define GMBOX0_DMA_RX_CONTROL_STOP_SET(x) WLAN_GMBOX0_DMA_RX_CONTROL_STOP_SET(x) -#define GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS -#define GMBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET -#define GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB -#define GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB -#define GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK -#define GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) -#define GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) -#define GMBOX0_DMA_TX_CONTROL_ADDRESS WLAN_GMBOX0_DMA_TX_CONTROL_ADDRESS -#define GMBOX0_DMA_TX_CONTROL_OFFSET WLAN_GMBOX0_DMA_TX_CONTROL_OFFSET -#define GMBOX0_DMA_TX_CONTROL_RESUME_MSB WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_MSB -#define GMBOX0_DMA_TX_CONTROL_RESUME_LSB WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_LSB -#define GMBOX0_DMA_TX_CONTROL_RESUME_MASK WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_MASK -#define GMBOX0_DMA_TX_CONTROL_RESUME_GET(x) WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_GET(x) -#define GMBOX0_DMA_TX_CONTROL_RESUME_SET(x) WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_SET(x) -#define GMBOX0_DMA_TX_CONTROL_START_MSB WLAN_GMBOX0_DMA_TX_CONTROL_START_MSB -#define GMBOX0_DMA_TX_CONTROL_START_LSB WLAN_GMBOX0_DMA_TX_CONTROL_START_LSB -#define GMBOX0_DMA_TX_CONTROL_START_MASK WLAN_GMBOX0_DMA_TX_CONTROL_START_MASK -#define GMBOX0_DMA_TX_CONTROL_START_GET(x) WLAN_GMBOX0_DMA_TX_CONTROL_START_GET(x) -#define GMBOX0_DMA_TX_CONTROL_START_SET(x) WLAN_GMBOX0_DMA_TX_CONTROL_START_SET(x) -#define GMBOX0_DMA_TX_CONTROL_STOP_MSB WLAN_GMBOX0_DMA_TX_CONTROL_STOP_MSB -#define GMBOX0_DMA_TX_CONTROL_STOP_LSB WLAN_GMBOX0_DMA_TX_CONTROL_STOP_LSB -#define GMBOX0_DMA_TX_CONTROL_STOP_MASK WLAN_GMBOX0_DMA_TX_CONTROL_STOP_MASK -#define GMBOX0_DMA_TX_CONTROL_STOP_GET(x) WLAN_GMBOX0_DMA_TX_CONTROL_STOP_GET(x) -#define GMBOX0_DMA_TX_CONTROL_STOP_SET(x) WLAN_GMBOX0_DMA_TX_CONTROL_STOP_SET(x) -#define GMBOX_INT_STATUS_ADDRESS WLAN_GMBOX_INT_STATUS_ADDRESS -#define GMBOX_INT_STATUS_OFFSET WLAN_GMBOX_INT_STATUS_OFFSET -#define GMBOX_INT_STATUS_TX_OVERFLOW_MSB WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_MSB -#define GMBOX_INT_STATUS_TX_OVERFLOW_LSB WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_LSB -#define GMBOX_INT_STATUS_TX_OVERFLOW_MASK WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_MASK -#define GMBOX_INT_STATUS_TX_OVERFLOW_GET(x) WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_GET(x) -#define GMBOX_INT_STATUS_TX_OVERFLOW_SET(x) WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_SET(x) -#define GMBOX_INT_STATUS_RX_UNDERFLOW_MSB WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_MSB -#define GMBOX_INT_STATUS_RX_UNDERFLOW_LSB WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_LSB -#define GMBOX_INT_STATUS_RX_UNDERFLOW_MASK WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_MASK -#define GMBOX_INT_STATUS_RX_UNDERFLOW_GET(x) WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_GET(x) -#define GMBOX_INT_STATUS_RX_UNDERFLOW_SET(x) WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_SET(x) -#define GMBOX_INT_STATUS_RX_DMA_COMPLETE_MSB WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_MSB -#define GMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB -#define GMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK -#define GMBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) -#define GMBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) -#define GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB -#define GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB -#define GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK -#define GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) -#define GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) -#define GMBOX_INT_STATUS_TX_DMA_COMPLETE_MSB WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_MSB -#define GMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB -#define GMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK -#define GMBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) -#define GMBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) -#define GMBOX_INT_STATUS_TX_NOT_EMPTY_MSB WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_MSB -#define GMBOX_INT_STATUS_TX_NOT_EMPTY_LSB WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_LSB -#define GMBOX_INT_STATUS_TX_NOT_EMPTY_MASK WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_MASK -#define GMBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) -#define GMBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) -#define GMBOX_INT_STATUS_RX_NOT_FULL_MSB WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_MSB -#define GMBOX_INT_STATUS_RX_NOT_FULL_LSB WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_LSB -#define GMBOX_INT_STATUS_RX_NOT_FULL_MASK WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_MASK -#define GMBOX_INT_STATUS_RX_NOT_FULL_GET(x) WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_GET(x) -#define GMBOX_INT_STATUS_RX_NOT_FULL_SET(x) WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_SET(x) -#define GMBOX_INT_ENABLE_ADDRESS WLAN_GMBOX_INT_ENABLE_ADDRESS -#define GMBOX_INT_ENABLE_OFFSET WLAN_GMBOX_INT_ENABLE_OFFSET -#define GMBOX_INT_ENABLE_TX_OVERFLOW_MSB WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_MSB -#define GMBOX_INT_ENABLE_TX_OVERFLOW_LSB WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_LSB -#define GMBOX_INT_ENABLE_TX_OVERFLOW_MASK WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_MASK -#define GMBOX_INT_ENABLE_TX_OVERFLOW_GET(x) WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_GET(x) -#define GMBOX_INT_ENABLE_TX_OVERFLOW_SET(x) WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_SET(x) -#define GMBOX_INT_ENABLE_RX_UNDERFLOW_MSB WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_MSB -#define GMBOX_INT_ENABLE_RX_UNDERFLOW_LSB WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_LSB -#define GMBOX_INT_ENABLE_RX_UNDERFLOW_MASK WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_MASK -#define GMBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) -#define GMBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) -#define GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB -#define GMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB -#define GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK -#define GMBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) -#define GMBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) -#define GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB -#define GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB -#define GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK -#define GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) -#define GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) -#define GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB -#define GMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB -#define GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK -#define GMBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) -#define GMBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) -#define GMBOX_INT_ENABLE_TX_NOT_EMPTY_MSB WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_MSB -#define GMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB -#define GMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK -#define GMBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) -#define GMBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) -#define GMBOX_INT_ENABLE_RX_NOT_FULL_MSB WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_MSB -#define GMBOX_INT_ENABLE_RX_NOT_FULL_LSB WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_LSB -#define GMBOX_INT_ENABLE_RX_NOT_FULL_MASK WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_MASK -#define GMBOX_INT_ENABLE_RX_NOT_FULL_GET(x) WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_GET(x) -#define GMBOX_INT_ENABLE_RX_NOT_FULL_SET(x) WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_SET(x) -#define HOST_IF_WINDOW_ADDRESS WLAN_HOST_IF_WINDOW_ADDRESS -#define HOST_IF_WINDOW_OFFSET WLAN_HOST_IF_WINDOW_OFFSET -#define HOST_IF_WINDOW_DATA_MSB WLAN_HOST_IF_WINDOW_DATA_MSB -#define HOST_IF_WINDOW_DATA_LSB WLAN_HOST_IF_WINDOW_DATA_LSB -#define HOST_IF_WINDOW_DATA_MASK WLAN_HOST_IF_WINDOW_DATA_MASK -#define HOST_IF_WINDOW_DATA_GET(x) WLAN_HOST_IF_WINDOW_DATA_GET(x) -#define HOST_IF_WINDOW_DATA_SET(x) WLAN_HOST_IF_WINDOW_DATA_SET(x) - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_wlan_host_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_wlan_host_reg.h deleted file mode 100644 index ba03a4876cd7..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_wlan_host_reg.h +++ /dev/null @@ -1,522 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _MBOX_WLAN_HOST_REG_REG_H_ -#define _MBOX_WLAN_HOST_REG_REG_H_ - -#define HOST_INT_STATUS_ADDRESS 0x00000400 -#define HOST_INT_STATUS_OFFSET 0x00000400 -#define HOST_INT_STATUS_ERROR_MSB 7 -#define HOST_INT_STATUS_ERROR_LSB 7 -#define HOST_INT_STATUS_ERROR_MASK 0x00000080 -#define HOST_INT_STATUS_ERROR_GET(x) (((x) & HOST_INT_STATUS_ERROR_MASK) >> HOST_INT_STATUS_ERROR_LSB) -#define HOST_INT_STATUS_ERROR_SET(x) (((x) << HOST_INT_STATUS_ERROR_LSB) & HOST_INT_STATUS_ERROR_MASK) -#define HOST_INT_STATUS_CPU_MSB 6 -#define HOST_INT_STATUS_CPU_LSB 6 -#define HOST_INT_STATUS_CPU_MASK 0x00000040 -#define HOST_INT_STATUS_CPU_GET(x) (((x) & HOST_INT_STATUS_CPU_MASK) >> HOST_INT_STATUS_CPU_LSB) -#define HOST_INT_STATUS_CPU_SET(x) (((x) << HOST_INT_STATUS_CPU_LSB) & HOST_INT_STATUS_CPU_MASK) -#define HOST_INT_STATUS_INT_MSB 5 -#define HOST_INT_STATUS_INT_LSB 5 -#define HOST_INT_STATUS_INT_MASK 0x00000020 -#define HOST_INT_STATUS_INT_GET(x) (((x) & HOST_INT_STATUS_INT_MASK) >> HOST_INT_STATUS_INT_LSB) -#define HOST_INT_STATUS_INT_SET(x) (((x) << HOST_INT_STATUS_INT_LSB) & HOST_INT_STATUS_INT_MASK) -#define HOST_INT_STATUS_COUNTER_MSB 4 -#define HOST_INT_STATUS_COUNTER_LSB 4 -#define HOST_INT_STATUS_COUNTER_MASK 0x00000010 -#define HOST_INT_STATUS_COUNTER_GET(x) (((x) & HOST_INT_STATUS_COUNTER_MASK) >> HOST_INT_STATUS_COUNTER_LSB) -#define HOST_INT_STATUS_COUNTER_SET(x) (((x) << HOST_INT_STATUS_COUNTER_LSB) & HOST_INT_STATUS_COUNTER_MASK) -#define HOST_INT_STATUS_MBOX_DATA_MSB 3 -#define HOST_INT_STATUS_MBOX_DATA_LSB 0 -#define HOST_INT_STATUS_MBOX_DATA_MASK 0x0000000f -#define HOST_INT_STATUS_MBOX_DATA_GET(x) (((x) & HOST_INT_STATUS_MBOX_DATA_MASK) >> HOST_INT_STATUS_MBOX_DATA_LSB) -#define HOST_INT_STATUS_MBOX_DATA_SET(x) (((x) << HOST_INT_STATUS_MBOX_DATA_LSB) & HOST_INT_STATUS_MBOX_DATA_MASK) - -#define CPU_INT_STATUS_ADDRESS 0x00000401 -#define CPU_INT_STATUS_OFFSET 0x00000401 -#define CPU_INT_STATUS_BIT_MSB 7 -#define CPU_INT_STATUS_BIT_LSB 0 -#define CPU_INT_STATUS_BIT_MASK 0x000000ff -#define CPU_INT_STATUS_BIT_GET(x) (((x) & CPU_INT_STATUS_BIT_MASK) >> CPU_INT_STATUS_BIT_LSB) -#define CPU_INT_STATUS_BIT_SET(x) (((x) << CPU_INT_STATUS_BIT_LSB) & CPU_INT_STATUS_BIT_MASK) - -#define ERROR_INT_STATUS_ADDRESS 0x00000402 -#define ERROR_INT_STATUS_OFFSET 0x00000402 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_MSB 6 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_LSB 6 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_MASK 0x00000040 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_GET(x) (((x) & ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_MASK) >> ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_LSB) -#define ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_SET(x) (((x) << ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_LSB) & ERROR_INT_STATUS_UART_HCI_FRAMER_SYNC_ERROR_MASK) -#define ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_MSB 5 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_LSB 5 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_MASK 0x00000020 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_GET(x) (((x) & ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_MASK) >> ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_LSB) -#define ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_SET(x) (((x) << ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_LSB) & ERROR_INT_STATUS_UART_HCI_FRAMER_OVERFLOW_MASK) -#define ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_MSB 4 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_LSB 4 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_MASK 0x00000010 -#define ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_GET(x) (((x) & ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_MASK) >> ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_LSB) -#define ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_SET(x) (((x) << ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_LSB) & ERROR_INT_STATUS_UART_HCI_FRAMER_UNDERFLOW_MASK) -#define ERROR_INT_STATUS_SPI_MSB 3 -#define ERROR_INT_STATUS_SPI_LSB 3 -#define ERROR_INT_STATUS_SPI_MASK 0x00000008 -#define ERROR_INT_STATUS_SPI_GET(x) (((x) & ERROR_INT_STATUS_SPI_MASK) >> ERROR_INT_STATUS_SPI_LSB) -#define ERROR_INT_STATUS_SPI_SET(x) (((x) << ERROR_INT_STATUS_SPI_LSB) & ERROR_INT_STATUS_SPI_MASK) -#define ERROR_INT_STATUS_WAKEUP_MSB 2 -#define ERROR_INT_STATUS_WAKEUP_LSB 2 -#define ERROR_INT_STATUS_WAKEUP_MASK 0x00000004 -#define ERROR_INT_STATUS_WAKEUP_GET(x) (((x) & ERROR_INT_STATUS_WAKEUP_MASK) >> ERROR_INT_STATUS_WAKEUP_LSB) -#define ERROR_INT_STATUS_WAKEUP_SET(x) (((x) << ERROR_INT_STATUS_WAKEUP_LSB) & ERROR_INT_STATUS_WAKEUP_MASK) -#define ERROR_INT_STATUS_RX_UNDERFLOW_MSB 1 -#define ERROR_INT_STATUS_RX_UNDERFLOW_LSB 1 -#define ERROR_INT_STATUS_RX_UNDERFLOW_MASK 0x00000002 -#define ERROR_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) >> ERROR_INT_STATUS_RX_UNDERFLOW_LSB) -#define ERROR_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << ERROR_INT_STATUS_RX_UNDERFLOW_LSB) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) -#define ERROR_INT_STATUS_TX_OVERFLOW_MSB 0 -#define ERROR_INT_STATUS_TX_OVERFLOW_LSB 0 -#define ERROR_INT_STATUS_TX_OVERFLOW_MASK 0x00000001 -#define ERROR_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) >> ERROR_INT_STATUS_TX_OVERFLOW_LSB) -#define ERROR_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << ERROR_INT_STATUS_TX_OVERFLOW_LSB) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) - -#define COUNTER_INT_STATUS_ADDRESS 0x00000403 -#define COUNTER_INT_STATUS_OFFSET 0x00000403 -#define COUNTER_INT_STATUS_COUNTER_MSB 7 -#define COUNTER_INT_STATUS_COUNTER_LSB 0 -#define COUNTER_INT_STATUS_COUNTER_MASK 0x000000ff -#define COUNTER_INT_STATUS_COUNTER_GET(x) (((x) & COUNTER_INT_STATUS_COUNTER_MASK) >> COUNTER_INT_STATUS_COUNTER_LSB) -#define COUNTER_INT_STATUS_COUNTER_SET(x) (((x) << COUNTER_INT_STATUS_COUNTER_LSB) & COUNTER_INT_STATUS_COUNTER_MASK) - -#define MBOX_FRAME_ADDRESS 0x00000404 -#define MBOX_FRAME_OFFSET 0x00000404 -#define MBOX_FRAME_RX_EOM_MSB 7 -#define MBOX_FRAME_RX_EOM_LSB 4 -#define MBOX_FRAME_RX_EOM_MASK 0x000000f0 -#define MBOX_FRAME_RX_EOM_GET(x) (((x) & MBOX_FRAME_RX_EOM_MASK) >> MBOX_FRAME_RX_EOM_LSB) -#define MBOX_FRAME_RX_EOM_SET(x) (((x) << MBOX_FRAME_RX_EOM_LSB) & MBOX_FRAME_RX_EOM_MASK) -#define MBOX_FRAME_RX_SOM_MSB 3 -#define MBOX_FRAME_RX_SOM_LSB 0 -#define MBOX_FRAME_RX_SOM_MASK 0x0000000f -#define MBOX_FRAME_RX_SOM_GET(x) (((x) & MBOX_FRAME_RX_SOM_MASK) >> MBOX_FRAME_RX_SOM_LSB) -#define MBOX_FRAME_RX_SOM_SET(x) (((x) << MBOX_FRAME_RX_SOM_LSB) & MBOX_FRAME_RX_SOM_MASK) - -#define RX_LOOKAHEAD_VALID_ADDRESS 0x00000405 -#define RX_LOOKAHEAD_VALID_OFFSET 0x00000405 -#define RX_LOOKAHEAD_VALID_MBOX_MSB 3 -#define RX_LOOKAHEAD_VALID_MBOX_LSB 0 -#define RX_LOOKAHEAD_VALID_MBOX_MASK 0x0000000f -#define RX_LOOKAHEAD_VALID_MBOX_GET(x) (((x) & RX_LOOKAHEAD_VALID_MBOX_MASK) >> RX_LOOKAHEAD_VALID_MBOX_LSB) -#define RX_LOOKAHEAD_VALID_MBOX_SET(x) (((x) << RX_LOOKAHEAD_VALID_MBOX_LSB) & RX_LOOKAHEAD_VALID_MBOX_MASK) - -#define HOST_INT_STATUS2_ADDRESS 0x00000406 -#define HOST_INT_STATUS2_OFFSET 0x00000406 -#define HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_MSB 2 -#define HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_LSB 2 -#define HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_MASK 0x00000004 -#define HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_GET(x) (((x) & HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_MASK) >> HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_LSB) -#define HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_SET(x) (((x) << HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_LSB) & HOST_INT_STATUS2_GMBOX_RX_UNDERFLOW_MASK) -#define HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_MSB 1 -#define HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_LSB 1 -#define HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_MASK 0x00000002 -#define HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_GET(x) (((x) & HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_MASK) >> HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_LSB) -#define HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_SET(x) (((x) << HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_LSB) & HOST_INT_STATUS2_GMBOX_TX_OVERFLOW_MASK) -#define HOST_INT_STATUS2_GMBOX_DATA_MSB 0 -#define HOST_INT_STATUS2_GMBOX_DATA_LSB 0 -#define HOST_INT_STATUS2_GMBOX_DATA_MASK 0x00000001 -#define HOST_INT_STATUS2_GMBOX_DATA_GET(x) (((x) & HOST_INT_STATUS2_GMBOX_DATA_MASK) >> HOST_INT_STATUS2_GMBOX_DATA_LSB) -#define HOST_INT_STATUS2_GMBOX_DATA_SET(x) (((x) << HOST_INT_STATUS2_GMBOX_DATA_LSB) & HOST_INT_STATUS2_GMBOX_DATA_MASK) - -#define GMBOX_RX_AVAIL_ADDRESS 0x00000407 -#define GMBOX_RX_AVAIL_OFFSET 0x00000407 -#define GMBOX_RX_AVAIL_BYTE_MSB 6 -#define GMBOX_RX_AVAIL_BYTE_LSB 0 -#define GMBOX_RX_AVAIL_BYTE_MASK 0x0000007f -#define GMBOX_RX_AVAIL_BYTE_GET(x) (((x) & GMBOX_RX_AVAIL_BYTE_MASK) >> GMBOX_RX_AVAIL_BYTE_LSB) -#define GMBOX_RX_AVAIL_BYTE_SET(x) (((x) << GMBOX_RX_AVAIL_BYTE_LSB) & GMBOX_RX_AVAIL_BYTE_MASK) - -#define RX_LOOKAHEAD0_ADDRESS 0x00000408 -#define RX_LOOKAHEAD0_OFFSET 0x00000408 -#define RX_LOOKAHEAD0_DATA_MSB 7 -#define RX_LOOKAHEAD0_DATA_LSB 0 -#define RX_LOOKAHEAD0_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD0_DATA_GET(x) (((x) & RX_LOOKAHEAD0_DATA_MASK) >> RX_LOOKAHEAD0_DATA_LSB) -#define RX_LOOKAHEAD0_DATA_SET(x) (((x) << RX_LOOKAHEAD0_DATA_LSB) & RX_LOOKAHEAD0_DATA_MASK) - -#define RX_LOOKAHEAD1_ADDRESS 0x0000040c -#define RX_LOOKAHEAD1_OFFSET 0x0000040c -#define RX_LOOKAHEAD1_DATA_MSB 7 -#define RX_LOOKAHEAD1_DATA_LSB 0 -#define RX_LOOKAHEAD1_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD1_DATA_GET(x) (((x) & RX_LOOKAHEAD1_DATA_MASK) >> RX_LOOKAHEAD1_DATA_LSB) -#define RX_LOOKAHEAD1_DATA_SET(x) (((x) << RX_LOOKAHEAD1_DATA_LSB) & RX_LOOKAHEAD1_DATA_MASK) - -#define RX_LOOKAHEAD2_ADDRESS 0x00000410 -#define RX_LOOKAHEAD2_OFFSET 0x00000410 -#define RX_LOOKAHEAD2_DATA_MSB 7 -#define RX_LOOKAHEAD2_DATA_LSB 0 -#define RX_LOOKAHEAD2_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD2_DATA_GET(x) (((x) & RX_LOOKAHEAD2_DATA_MASK) >> RX_LOOKAHEAD2_DATA_LSB) -#define RX_LOOKAHEAD2_DATA_SET(x) (((x) << RX_LOOKAHEAD2_DATA_LSB) & RX_LOOKAHEAD2_DATA_MASK) - -#define RX_LOOKAHEAD3_ADDRESS 0x00000414 -#define RX_LOOKAHEAD3_OFFSET 0x00000414 -#define RX_LOOKAHEAD3_DATA_MSB 7 -#define RX_LOOKAHEAD3_DATA_LSB 0 -#define RX_LOOKAHEAD3_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD3_DATA_GET(x) (((x) & RX_LOOKAHEAD3_DATA_MASK) >> RX_LOOKAHEAD3_DATA_LSB) -#define RX_LOOKAHEAD3_DATA_SET(x) (((x) << RX_LOOKAHEAD3_DATA_LSB) & RX_LOOKAHEAD3_DATA_MASK) - -#define INT_STATUS_ENABLE_ADDRESS 0x00000418 -#define INT_STATUS_ENABLE_OFFSET 0x00000418 -#define INT_STATUS_ENABLE_ERROR_MSB 7 -#define INT_STATUS_ENABLE_ERROR_LSB 7 -#define INT_STATUS_ENABLE_ERROR_MASK 0x00000080 -#define INT_STATUS_ENABLE_ERROR_GET(x) (((x) & INT_STATUS_ENABLE_ERROR_MASK) >> INT_STATUS_ENABLE_ERROR_LSB) -#define INT_STATUS_ENABLE_ERROR_SET(x) (((x) << INT_STATUS_ENABLE_ERROR_LSB) & INT_STATUS_ENABLE_ERROR_MASK) -#define INT_STATUS_ENABLE_CPU_MSB 6 -#define INT_STATUS_ENABLE_CPU_LSB 6 -#define INT_STATUS_ENABLE_CPU_MASK 0x00000040 -#define INT_STATUS_ENABLE_CPU_GET(x) (((x) & INT_STATUS_ENABLE_CPU_MASK) >> INT_STATUS_ENABLE_CPU_LSB) -#define INT_STATUS_ENABLE_CPU_SET(x) (((x) << INT_STATUS_ENABLE_CPU_LSB) & INT_STATUS_ENABLE_CPU_MASK) -#define INT_STATUS_ENABLE_INT_MSB 5 -#define INT_STATUS_ENABLE_INT_LSB 5 -#define INT_STATUS_ENABLE_INT_MASK 0x00000020 -#define INT_STATUS_ENABLE_INT_GET(x) (((x) & INT_STATUS_ENABLE_INT_MASK) >> INT_STATUS_ENABLE_INT_LSB) -#define INT_STATUS_ENABLE_INT_SET(x) (((x) << INT_STATUS_ENABLE_INT_LSB) & INT_STATUS_ENABLE_INT_MASK) -#define INT_STATUS_ENABLE_COUNTER_MSB 4 -#define INT_STATUS_ENABLE_COUNTER_LSB 4 -#define INT_STATUS_ENABLE_COUNTER_MASK 0x00000010 -#define INT_STATUS_ENABLE_COUNTER_GET(x) (((x) & INT_STATUS_ENABLE_COUNTER_MASK) >> INT_STATUS_ENABLE_COUNTER_LSB) -#define INT_STATUS_ENABLE_COUNTER_SET(x) (((x) << INT_STATUS_ENABLE_COUNTER_LSB) & INT_STATUS_ENABLE_COUNTER_MASK) -#define INT_STATUS_ENABLE_MBOX_DATA_MSB 3 -#define INT_STATUS_ENABLE_MBOX_DATA_LSB 0 -#define INT_STATUS_ENABLE_MBOX_DATA_MASK 0x0000000f -#define INT_STATUS_ENABLE_MBOX_DATA_GET(x) (((x) & INT_STATUS_ENABLE_MBOX_DATA_MASK) >> INT_STATUS_ENABLE_MBOX_DATA_LSB) -#define INT_STATUS_ENABLE_MBOX_DATA_SET(x) (((x) << INT_STATUS_ENABLE_MBOX_DATA_LSB) & INT_STATUS_ENABLE_MBOX_DATA_MASK) - -#define CPU_INT_STATUS_ENABLE_ADDRESS 0x00000419 -#define CPU_INT_STATUS_ENABLE_OFFSET 0x00000419 -#define CPU_INT_STATUS_ENABLE_BIT_MSB 7 -#define CPU_INT_STATUS_ENABLE_BIT_LSB 0 -#define CPU_INT_STATUS_ENABLE_BIT_MASK 0x000000ff -#define CPU_INT_STATUS_ENABLE_BIT_GET(x) (((x) & CPU_INT_STATUS_ENABLE_BIT_MASK) >> CPU_INT_STATUS_ENABLE_BIT_LSB) -#define CPU_INT_STATUS_ENABLE_BIT_SET(x) (((x) << CPU_INT_STATUS_ENABLE_BIT_LSB) & CPU_INT_STATUS_ENABLE_BIT_MASK) - -#define ERROR_STATUS_ENABLE_ADDRESS 0x0000041a -#define ERROR_STATUS_ENABLE_OFFSET 0x0000041a -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_MSB 6 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_LSB 6 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_MASK 0x00000040 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_GET(x) (((x) & ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_MASK) >> ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_LSB) -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_SET(x) (((x) << ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_LSB) & ERROR_STATUS_ENABLE_UART_HCI_FRAMER_SYNC_ERROR_MASK) -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_MSB 5 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_LSB 5 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_MASK 0x00000020 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_MASK) >> ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_LSB) -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_LSB) & ERROR_STATUS_ENABLE_UART_HCI_FRAMER_OVERFLOW_MASK) -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_MSB 4 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_LSB 4 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_MASK 0x00000010 -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_MASK) >> ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_LSB) -#define ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_LSB) & ERROR_STATUS_ENABLE_UART_HCI_FRAMER_UNDERFLOW_MASK) -#define ERROR_STATUS_ENABLE_WAKEUP_MSB 2 -#define ERROR_STATUS_ENABLE_WAKEUP_LSB 2 -#define ERROR_STATUS_ENABLE_WAKEUP_MASK 0x00000004 -#define ERROR_STATUS_ENABLE_WAKEUP_GET(x) (((x) & ERROR_STATUS_ENABLE_WAKEUP_MASK) >> ERROR_STATUS_ENABLE_WAKEUP_LSB) -#define ERROR_STATUS_ENABLE_WAKEUP_SET(x) (((x) << ERROR_STATUS_ENABLE_WAKEUP_LSB) & ERROR_STATUS_ENABLE_WAKEUP_MASK) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MSB 1 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB 1 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK 0x00000002 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) >> ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MSB 0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB 0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK 0x00000001 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) >> ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) - -#define COUNTER_INT_STATUS_ENABLE_ADDRESS 0x0000041b -#define COUNTER_INT_STATUS_ENABLE_OFFSET 0x0000041b -#define COUNTER_INT_STATUS_ENABLE_BIT_MSB 7 -#define COUNTER_INT_STATUS_ENABLE_BIT_LSB 0 -#define COUNTER_INT_STATUS_ENABLE_BIT_MASK 0x000000ff -#define COUNTER_INT_STATUS_ENABLE_BIT_GET(x) (((x) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) >> COUNTER_INT_STATUS_ENABLE_BIT_LSB) -#define COUNTER_INT_STATUS_ENABLE_BIT_SET(x) (((x) << COUNTER_INT_STATUS_ENABLE_BIT_LSB) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) - -#define COUNT_ADDRESS 0x00000420 -#define COUNT_OFFSET 0x00000420 -#define COUNT_VALUE_MSB 7 -#define COUNT_VALUE_LSB 0 -#define COUNT_VALUE_MASK 0x000000ff -#define COUNT_VALUE_GET(x) (((x) & COUNT_VALUE_MASK) >> COUNT_VALUE_LSB) -#define COUNT_VALUE_SET(x) (((x) << COUNT_VALUE_LSB) & COUNT_VALUE_MASK) - -#define COUNT_DEC_ADDRESS 0x00000440 -#define COUNT_DEC_OFFSET 0x00000440 -#define COUNT_DEC_VALUE_MSB 7 -#define COUNT_DEC_VALUE_LSB 0 -#define COUNT_DEC_VALUE_MASK 0x000000ff -#define COUNT_DEC_VALUE_GET(x) (((x) & COUNT_DEC_VALUE_MASK) >> COUNT_DEC_VALUE_LSB) -#define COUNT_DEC_VALUE_SET(x) (((x) << COUNT_DEC_VALUE_LSB) & COUNT_DEC_VALUE_MASK) - -#define SCRATCH_ADDRESS 0x00000460 -#define SCRATCH_OFFSET 0x00000460 -#define SCRATCH_VALUE_MSB 7 -#define SCRATCH_VALUE_LSB 0 -#define SCRATCH_VALUE_MASK 0x000000ff -#define SCRATCH_VALUE_GET(x) (((x) & SCRATCH_VALUE_MASK) >> SCRATCH_VALUE_LSB) -#define SCRATCH_VALUE_SET(x) (((x) << SCRATCH_VALUE_LSB) & SCRATCH_VALUE_MASK) - -#define FIFO_TIMEOUT_ADDRESS 0x00000468 -#define FIFO_TIMEOUT_OFFSET 0x00000468 -#define FIFO_TIMEOUT_VALUE_MSB 7 -#define FIFO_TIMEOUT_VALUE_LSB 0 -#define FIFO_TIMEOUT_VALUE_MASK 0x000000ff -#define FIFO_TIMEOUT_VALUE_GET(x) (((x) & FIFO_TIMEOUT_VALUE_MASK) >> FIFO_TIMEOUT_VALUE_LSB) -#define FIFO_TIMEOUT_VALUE_SET(x) (((x) << FIFO_TIMEOUT_VALUE_LSB) & FIFO_TIMEOUT_VALUE_MASK) - -#define FIFO_TIMEOUT_ENABLE_ADDRESS 0x00000469 -#define FIFO_TIMEOUT_ENABLE_OFFSET 0x00000469 -#define FIFO_TIMEOUT_ENABLE_SET_MSB 0 -#define FIFO_TIMEOUT_ENABLE_SET_LSB 0 -#define FIFO_TIMEOUT_ENABLE_SET_MASK 0x00000001 -#define FIFO_TIMEOUT_ENABLE_SET_GET(x) (((x) & FIFO_TIMEOUT_ENABLE_SET_MASK) >> FIFO_TIMEOUT_ENABLE_SET_LSB) -#define FIFO_TIMEOUT_ENABLE_SET_SET(x) (((x) << FIFO_TIMEOUT_ENABLE_SET_LSB) & FIFO_TIMEOUT_ENABLE_SET_MASK) - -#define DISABLE_SLEEP_ADDRESS 0x0000046a -#define DISABLE_SLEEP_OFFSET 0x0000046a -#define DISABLE_SLEEP_FOR_INT_MSB 1 -#define DISABLE_SLEEP_FOR_INT_LSB 1 -#define DISABLE_SLEEP_FOR_INT_MASK 0x00000002 -#define DISABLE_SLEEP_FOR_INT_GET(x) (((x) & DISABLE_SLEEP_FOR_INT_MASK) >> DISABLE_SLEEP_FOR_INT_LSB) -#define DISABLE_SLEEP_FOR_INT_SET(x) (((x) << DISABLE_SLEEP_FOR_INT_LSB) & DISABLE_SLEEP_FOR_INT_MASK) -#define DISABLE_SLEEP_ON_MSB 0 -#define DISABLE_SLEEP_ON_LSB 0 -#define DISABLE_SLEEP_ON_MASK 0x00000001 -#define DISABLE_SLEEP_ON_GET(x) (((x) & DISABLE_SLEEP_ON_MASK) >> DISABLE_SLEEP_ON_LSB) -#define DISABLE_SLEEP_ON_SET(x) (((x) << DISABLE_SLEEP_ON_LSB) & DISABLE_SLEEP_ON_MASK) - -#define LOCAL_BUS_ADDRESS 0x00000470 -#define LOCAL_BUS_OFFSET 0x00000470 -#define LOCAL_BUS_STATE_MSB 1 -#define LOCAL_BUS_STATE_LSB 0 -#define LOCAL_BUS_STATE_MASK 0x00000003 -#define LOCAL_BUS_STATE_GET(x) (((x) & LOCAL_BUS_STATE_MASK) >> LOCAL_BUS_STATE_LSB) -#define LOCAL_BUS_STATE_SET(x) (((x) << LOCAL_BUS_STATE_LSB) & LOCAL_BUS_STATE_MASK) - -#define INT_WLAN_ADDRESS 0x00000472 -#define INT_WLAN_OFFSET 0x00000472 -#define INT_WLAN_VECTOR_MSB 7 -#define INT_WLAN_VECTOR_LSB 0 -#define INT_WLAN_VECTOR_MASK 0x000000ff -#define INT_WLAN_VECTOR_GET(x) (((x) & INT_WLAN_VECTOR_MASK) >> INT_WLAN_VECTOR_LSB) -#define INT_WLAN_VECTOR_SET(x) (((x) << INT_WLAN_VECTOR_LSB) & INT_WLAN_VECTOR_MASK) - -#define WINDOW_DATA_ADDRESS 0x00000474 -#define WINDOW_DATA_OFFSET 0x00000474 -#define WINDOW_DATA_DATA_MSB 7 -#define WINDOW_DATA_DATA_LSB 0 -#define WINDOW_DATA_DATA_MASK 0x000000ff -#define WINDOW_DATA_DATA_GET(x) (((x) & WINDOW_DATA_DATA_MASK) >> WINDOW_DATA_DATA_LSB) -#define WINDOW_DATA_DATA_SET(x) (((x) << WINDOW_DATA_DATA_LSB) & WINDOW_DATA_DATA_MASK) - -#define WINDOW_WRITE_ADDR_ADDRESS 0x00000478 -#define WINDOW_WRITE_ADDR_OFFSET 0x00000478 -#define WINDOW_WRITE_ADDR_ADDR_MSB 7 -#define WINDOW_WRITE_ADDR_ADDR_LSB 0 -#define WINDOW_WRITE_ADDR_ADDR_MASK 0x000000ff -#define WINDOW_WRITE_ADDR_ADDR_GET(x) (((x) & WINDOW_WRITE_ADDR_ADDR_MASK) >> WINDOW_WRITE_ADDR_ADDR_LSB) -#define WINDOW_WRITE_ADDR_ADDR_SET(x) (((x) << WINDOW_WRITE_ADDR_ADDR_LSB) & WINDOW_WRITE_ADDR_ADDR_MASK) - -#define WINDOW_READ_ADDR_ADDRESS 0x0000047c -#define WINDOW_READ_ADDR_OFFSET 0x0000047c -#define WINDOW_READ_ADDR_ADDR_MSB 7 -#define WINDOW_READ_ADDR_ADDR_LSB 0 -#define WINDOW_READ_ADDR_ADDR_MASK 0x000000ff -#define WINDOW_READ_ADDR_ADDR_GET(x) (((x) & WINDOW_READ_ADDR_ADDR_MASK) >> WINDOW_READ_ADDR_ADDR_LSB) -#define WINDOW_READ_ADDR_ADDR_SET(x) (((x) << WINDOW_READ_ADDR_ADDR_LSB) & WINDOW_READ_ADDR_ADDR_MASK) - -#define HOST_CTRL_SPI_CONFIG_ADDRESS 0x00000480 -#define HOST_CTRL_SPI_CONFIG_OFFSET 0x00000480 -#define HOST_CTRL_SPI_CONFIG_SPI_RESET_MSB 4 -#define HOST_CTRL_SPI_CONFIG_SPI_RESET_LSB 4 -#define HOST_CTRL_SPI_CONFIG_SPI_RESET_MASK 0x00000010 -#define HOST_CTRL_SPI_CONFIG_SPI_RESET_GET(x) (((x) & HOST_CTRL_SPI_CONFIG_SPI_RESET_MASK) >> HOST_CTRL_SPI_CONFIG_SPI_RESET_LSB) -#define HOST_CTRL_SPI_CONFIG_SPI_RESET_SET(x) (((x) << HOST_CTRL_SPI_CONFIG_SPI_RESET_LSB) & HOST_CTRL_SPI_CONFIG_SPI_RESET_MASK) -#define HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_MSB 3 -#define HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_LSB 3 -#define HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_MASK 0x00000008 -#define HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_GET(x) (((x) & HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_MASK) >> HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_LSB) -#define HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_SET(x) (((x) << HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_LSB) & HOST_CTRL_SPI_CONFIG_INTERRUPT_ENABLE_MASK) -#define HOST_CTRL_SPI_CONFIG_TEST_MODE_MSB 2 -#define HOST_CTRL_SPI_CONFIG_TEST_MODE_LSB 2 -#define HOST_CTRL_SPI_CONFIG_TEST_MODE_MASK 0x00000004 -#define HOST_CTRL_SPI_CONFIG_TEST_MODE_GET(x) (((x) & HOST_CTRL_SPI_CONFIG_TEST_MODE_MASK) >> HOST_CTRL_SPI_CONFIG_TEST_MODE_LSB) -#define HOST_CTRL_SPI_CONFIG_TEST_MODE_SET(x) (((x) << HOST_CTRL_SPI_CONFIG_TEST_MODE_LSB) & HOST_CTRL_SPI_CONFIG_TEST_MODE_MASK) -#define HOST_CTRL_SPI_CONFIG_DATA_SIZE_MSB 1 -#define HOST_CTRL_SPI_CONFIG_DATA_SIZE_LSB 0 -#define HOST_CTRL_SPI_CONFIG_DATA_SIZE_MASK 0x00000003 -#define HOST_CTRL_SPI_CONFIG_DATA_SIZE_GET(x) (((x) & HOST_CTRL_SPI_CONFIG_DATA_SIZE_MASK) >> HOST_CTRL_SPI_CONFIG_DATA_SIZE_LSB) -#define HOST_CTRL_SPI_CONFIG_DATA_SIZE_SET(x) (((x) << HOST_CTRL_SPI_CONFIG_DATA_SIZE_LSB) & HOST_CTRL_SPI_CONFIG_DATA_SIZE_MASK) - -#define HOST_CTRL_SPI_STATUS_ADDRESS 0x00000481 -#define HOST_CTRL_SPI_STATUS_OFFSET 0x00000481 -#define HOST_CTRL_SPI_STATUS_ADDR_ERR_MSB 3 -#define HOST_CTRL_SPI_STATUS_ADDR_ERR_LSB 3 -#define HOST_CTRL_SPI_STATUS_ADDR_ERR_MASK 0x00000008 -#define HOST_CTRL_SPI_STATUS_ADDR_ERR_GET(x) (((x) & HOST_CTRL_SPI_STATUS_ADDR_ERR_MASK) >> HOST_CTRL_SPI_STATUS_ADDR_ERR_LSB) -#define HOST_CTRL_SPI_STATUS_ADDR_ERR_SET(x) (((x) << HOST_CTRL_SPI_STATUS_ADDR_ERR_LSB) & HOST_CTRL_SPI_STATUS_ADDR_ERR_MASK) -#define HOST_CTRL_SPI_STATUS_RD_ERR_MSB 2 -#define HOST_CTRL_SPI_STATUS_RD_ERR_LSB 2 -#define HOST_CTRL_SPI_STATUS_RD_ERR_MASK 0x00000004 -#define HOST_CTRL_SPI_STATUS_RD_ERR_GET(x) (((x) & HOST_CTRL_SPI_STATUS_RD_ERR_MASK) >> HOST_CTRL_SPI_STATUS_RD_ERR_LSB) -#define HOST_CTRL_SPI_STATUS_RD_ERR_SET(x) (((x) << HOST_CTRL_SPI_STATUS_RD_ERR_LSB) & HOST_CTRL_SPI_STATUS_RD_ERR_MASK) -#define HOST_CTRL_SPI_STATUS_WR_ERR_MSB 1 -#define HOST_CTRL_SPI_STATUS_WR_ERR_LSB 1 -#define HOST_CTRL_SPI_STATUS_WR_ERR_MASK 0x00000002 -#define HOST_CTRL_SPI_STATUS_WR_ERR_GET(x) (((x) & HOST_CTRL_SPI_STATUS_WR_ERR_MASK) >> HOST_CTRL_SPI_STATUS_WR_ERR_LSB) -#define HOST_CTRL_SPI_STATUS_WR_ERR_SET(x) (((x) << HOST_CTRL_SPI_STATUS_WR_ERR_LSB) & HOST_CTRL_SPI_STATUS_WR_ERR_MASK) -#define HOST_CTRL_SPI_STATUS_READY_MSB 0 -#define HOST_CTRL_SPI_STATUS_READY_LSB 0 -#define HOST_CTRL_SPI_STATUS_READY_MASK 0x00000001 -#define HOST_CTRL_SPI_STATUS_READY_GET(x) (((x) & HOST_CTRL_SPI_STATUS_READY_MASK) >> HOST_CTRL_SPI_STATUS_READY_LSB) -#define HOST_CTRL_SPI_STATUS_READY_SET(x) (((x) << HOST_CTRL_SPI_STATUS_READY_LSB) & HOST_CTRL_SPI_STATUS_READY_MASK) - -#define NON_ASSOC_SLEEP_EN_ADDRESS 0x00000482 -#define NON_ASSOC_SLEEP_EN_OFFSET 0x00000482 -#define NON_ASSOC_SLEEP_EN_BIT_MSB 0 -#define NON_ASSOC_SLEEP_EN_BIT_LSB 0 -#define NON_ASSOC_SLEEP_EN_BIT_MASK 0x00000001 -#define NON_ASSOC_SLEEP_EN_BIT_GET(x) (((x) & NON_ASSOC_SLEEP_EN_BIT_MASK) >> NON_ASSOC_SLEEP_EN_BIT_LSB) -#define NON_ASSOC_SLEEP_EN_BIT_SET(x) (((x) << NON_ASSOC_SLEEP_EN_BIT_LSB) & NON_ASSOC_SLEEP_EN_BIT_MASK) - -#define CPU_DBG_SEL_ADDRESS 0x00000483 -#define CPU_DBG_SEL_OFFSET 0x00000483 -#define CPU_DBG_SEL_BIT_MSB 5 -#define CPU_DBG_SEL_BIT_LSB 0 -#define CPU_DBG_SEL_BIT_MASK 0x0000003f -#define CPU_DBG_SEL_BIT_GET(x) (((x) & CPU_DBG_SEL_BIT_MASK) >> CPU_DBG_SEL_BIT_LSB) -#define CPU_DBG_SEL_BIT_SET(x) (((x) << CPU_DBG_SEL_BIT_LSB) & CPU_DBG_SEL_BIT_MASK) - -#define CPU_DBG_ADDRESS 0x00000484 -#define CPU_DBG_OFFSET 0x00000484 -#define CPU_DBG_DATA_MSB 7 -#define CPU_DBG_DATA_LSB 0 -#define CPU_DBG_DATA_MASK 0x000000ff -#define CPU_DBG_DATA_GET(x) (((x) & CPU_DBG_DATA_MASK) >> CPU_DBG_DATA_LSB) -#define CPU_DBG_DATA_SET(x) (((x) << CPU_DBG_DATA_LSB) & CPU_DBG_DATA_MASK) - -#define INT_STATUS2_ENABLE_ADDRESS 0x00000488 -#define INT_STATUS2_ENABLE_OFFSET 0x00000488 -#define INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_MSB 2 -#define INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_LSB 2 -#define INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_MASK 0x00000004 -#define INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_GET(x) (((x) & INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_MASK) >> INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_LSB) -#define INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_SET(x) (((x) << INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_LSB) & INT_STATUS2_ENABLE_GMBOX_RX_UNDERFLOW_MASK) -#define INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_MSB 1 -#define INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_LSB 1 -#define INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_MASK 0x00000002 -#define INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_GET(x) (((x) & INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_MASK) >> INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_LSB) -#define INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_SET(x) (((x) << INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_LSB) & INT_STATUS2_ENABLE_GMBOX_TX_OVERFLOW_MASK) -#define INT_STATUS2_ENABLE_GMBOX_DATA_MSB 0 -#define INT_STATUS2_ENABLE_GMBOX_DATA_LSB 0 -#define INT_STATUS2_ENABLE_GMBOX_DATA_MASK 0x00000001 -#define INT_STATUS2_ENABLE_GMBOX_DATA_GET(x) (((x) & INT_STATUS2_ENABLE_GMBOX_DATA_MASK) >> INT_STATUS2_ENABLE_GMBOX_DATA_LSB) -#define INT_STATUS2_ENABLE_GMBOX_DATA_SET(x) (((x) << INT_STATUS2_ENABLE_GMBOX_DATA_LSB) & INT_STATUS2_ENABLE_GMBOX_DATA_MASK) - -#define GMBOX_RX_LOOKAHEAD_ADDRESS 0x00000490 -#define GMBOX_RX_LOOKAHEAD_OFFSET 0x00000490 -#define GMBOX_RX_LOOKAHEAD_DATA_MSB 7 -#define GMBOX_RX_LOOKAHEAD_DATA_LSB 0 -#define GMBOX_RX_LOOKAHEAD_DATA_MASK 0x000000ff -#define GMBOX_RX_LOOKAHEAD_DATA_GET(x) (((x) & GMBOX_RX_LOOKAHEAD_DATA_MASK) >> GMBOX_RX_LOOKAHEAD_DATA_LSB) -#define GMBOX_RX_LOOKAHEAD_DATA_SET(x) (((x) << GMBOX_RX_LOOKAHEAD_DATA_LSB) & GMBOX_RX_LOOKAHEAD_DATA_MASK) - -#define GMBOX_RX_LOOKAHEAD_MUX_ADDRESS 0x00000498 -#define GMBOX_RX_LOOKAHEAD_MUX_OFFSET 0x00000498 -#define GMBOX_RX_LOOKAHEAD_MUX_SEL_MSB 0 -#define GMBOX_RX_LOOKAHEAD_MUX_SEL_LSB 0 -#define GMBOX_RX_LOOKAHEAD_MUX_SEL_MASK 0x00000001 -#define GMBOX_RX_LOOKAHEAD_MUX_SEL_GET(x) (((x) & GMBOX_RX_LOOKAHEAD_MUX_SEL_MASK) >> GMBOX_RX_LOOKAHEAD_MUX_SEL_LSB) -#define GMBOX_RX_LOOKAHEAD_MUX_SEL_SET(x) (((x) << GMBOX_RX_LOOKAHEAD_MUX_SEL_LSB) & GMBOX_RX_LOOKAHEAD_MUX_SEL_MASK) - -#define CIS_WINDOW_ADDRESS 0x00000600 -#define CIS_WINDOW_OFFSET 0x00000600 -#define CIS_WINDOW_DATA_MSB 7 -#define CIS_WINDOW_DATA_LSB 0 -#define CIS_WINDOW_DATA_MASK 0x000000ff -#define CIS_WINDOW_DATA_GET(x) (((x) & CIS_WINDOW_DATA_MASK) >> CIS_WINDOW_DATA_LSB) -#define CIS_WINDOW_DATA_SET(x) (((x) << CIS_WINDOW_DATA_LSB) & CIS_WINDOW_DATA_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct mbox_wlan_host_reg_reg_s { - unsigned char pad0[1024]; /* pad to 0x400 */ - volatile unsigned char host_int_status; - volatile unsigned char cpu_int_status; - volatile unsigned char error_int_status; - volatile unsigned char counter_int_status; - volatile unsigned char mbox_frame; - volatile unsigned char rx_lookahead_valid; - volatile unsigned char host_int_status2; - volatile unsigned char gmbox_rx_avail; - volatile unsigned char rx_lookahead0[4]; - volatile unsigned char rx_lookahead1[4]; - volatile unsigned char rx_lookahead2[4]; - volatile unsigned char rx_lookahead3[4]; - volatile unsigned char int_status_enable; - volatile unsigned char cpu_int_status_enable; - volatile unsigned char error_status_enable; - volatile unsigned char counter_int_status_enable; - unsigned char pad1[4]; /* pad to 0x420 */ - volatile unsigned char count[8]; - unsigned char pad2[24]; /* pad to 0x440 */ - volatile unsigned char count_dec[32]; - volatile unsigned char scratch[8]; - volatile unsigned char fifo_timeout; - volatile unsigned char fifo_timeout_enable; - volatile unsigned char disable_sleep; - unsigned char pad3[5]; /* pad to 0x470 */ - volatile unsigned char local_bus; - unsigned char pad4[1]; /* pad to 0x472 */ - volatile unsigned char int_wlan; - unsigned char pad5[1]; /* pad to 0x474 */ - volatile unsigned char window_data[4]; - volatile unsigned char window_write_addr[4]; - volatile unsigned char window_read_addr[4]; - volatile unsigned char host_ctrl_spi_config; - volatile unsigned char host_ctrl_spi_status; - volatile unsigned char non_assoc_sleep_en; - volatile unsigned char cpu_dbg_sel; - volatile unsigned char cpu_dbg[4]; - volatile unsigned char int_status2_enable; - unsigned char pad6[7]; /* pad to 0x490 */ - volatile unsigned char gmbox_rx_lookahead[8]; - volatile unsigned char gmbox_rx_lookahead_mux; - unsigned char pad7[359]; /* pad to 0x600 */ - volatile unsigned char cis_window[512]; -} mbox_wlan_host_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _MBOX_WLAN_HOST_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_wlan_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_wlan_reg.h deleted file mode 100644 index 34a50b788b91..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mbox_wlan_reg.h +++ /dev/null @@ -1,692 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _MBOX_WLAN_REG_REG_H_ -#define _MBOX_WLAN_REG_REG_H_ - -#define WLAN_MBOX_FIFO_ADDRESS 0x00000000 -#define WLAN_MBOX_FIFO_OFFSET 0x00000000 -#define WLAN_MBOX_FIFO_DATA_MSB 19 -#define WLAN_MBOX_FIFO_DATA_LSB 0 -#define WLAN_MBOX_FIFO_DATA_MASK 0x000fffff -#define WLAN_MBOX_FIFO_DATA_GET(x) (((x) & WLAN_MBOX_FIFO_DATA_MASK) >> WLAN_MBOX_FIFO_DATA_LSB) -#define WLAN_MBOX_FIFO_DATA_SET(x) (((x) << WLAN_MBOX_FIFO_DATA_LSB) & WLAN_MBOX_FIFO_DATA_MASK) - -#define WLAN_MBOX_FIFO_STATUS_ADDRESS 0x00000010 -#define WLAN_MBOX_FIFO_STATUS_OFFSET 0x00000010 -#define WLAN_MBOX_FIFO_STATUS_EMPTY_MSB 19 -#define WLAN_MBOX_FIFO_STATUS_EMPTY_LSB 16 -#define WLAN_MBOX_FIFO_STATUS_EMPTY_MASK 0x000f0000 -#define WLAN_MBOX_FIFO_STATUS_EMPTY_GET(x) (((x) & WLAN_MBOX_FIFO_STATUS_EMPTY_MASK) >> WLAN_MBOX_FIFO_STATUS_EMPTY_LSB) -#define WLAN_MBOX_FIFO_STATUS_EMPTY_SET(x) (((x) << WLAN_MBOX_FIFO_STATUS_EMPTY_LSB) & WLAN_MBOX_FIFO_STATUS_EMPTY_MASK) -#define WLAN_MBOX_FIFO_STATUS_FULL_MSB 15 -#define WLAN_MBOX_FIFO_STATUS_FULL_LSB 12 -#define WLAN_MBOX_FIFO_STATUS_FULL_MASK 0x0000f000 -#define WLAN_MBOX_FIFO_STATUS_FULL_GET(x) (((x) & WLAN_MBOX_FIFO_STATUS_FULL_MASK) >> WLAN_MBOX_FIFO_STATUS_FULL_LSB) -#define WLAN_MBOX_FIFO_STATUS_FULL_SET(x) (((x) << WLAN_MBOX_FIFO_STATUS_FULL_LSB) & WLAN_MBOX_FIFO_STATUS_FULL_MASK) - -#define WLAN_MBOX_DMA_POLICY_ADDRESS 0x00000014 -#define WLAN_MBOX_DMA_POLICY_OFFSET 0x00000014 -#define WLAN_MBOX_DMA_POLICY_TX_QUANTUM_MSB 3 -#define WLAN_MBOX_DMA_POLICY_TX_QUANTUM_LSB 3 -#define WLAN_MBOX_DMA_POLICY_TX_QUANTUM_MASK 0x00000008 -#define WLAN_MBOX_DMA_POLICY_TX_QUANTUM_GET(x) (((x) & WLAN_MBOX_DMA_POLICY_TX_QUANTUM_MASK) >> WLAN_MBOX_DMA_POLICY_TX_QUANTUM_LSB) -#define WLAN_MBOX_DMA_POLICY_TX_QUANTUM_SET(x) (((x) << WLAN_MBOX_DMA_POLICY_TX_QUANTUM_LSB) & WLAN_MBOX_DMA_POLICY_TX_QUANTUM_MASK) -#define WLAN_MBOX_DMA_POLICY_TX_ORDER_MSB 2 -#define WLAN_MBOX_DMA_POLICY_TX_ORDER_LSB 2 -#define WLAN_MBOX_DMA_POLICY_TX_ORDER_MASK 0x00000004 -#define WLAN_MBOX_DMA_POLICY_TX_ORDER_GET(x) (((x) & WLAN_MBOX_DMA_POLICY_TX_ORDER_MASK) >> WLAN_MBOX_DMA_POLICY_TX_ORDER_LSB) -#define WLAN_MBOX_DMA_POLICY_TX_ORDER_SET(x) (((x) << WLAN_MBOX_DMA_POLICY_TX_ORDER_LSB) & WLAN_MBOX_DMA_POLICY_TX_ORDER_MASK) -#define WLAN_MBOX_DMA_POLICY_RX_QUANTUM_MSB 1 -#define WLAN_MBOX_DMA_POLICY_RX_QUANTUM_LSB 1 -#define WLAN_MBOX_DMA_POLICY_RX_QUANTUM_MASK 0x00000002 -#define WLAN_MBOX_DMA_POLICY_RX_QUANTUM_GET(x) (((x) & WLAN_MBOX_DMA_POLICY_RX_QUANTUM_MASK) >> WLAN_MBOX_DMA_POLICY_RX_QUANTUM_LSB) -#define WLAN_MBOX_DMA_POLICY_RX_QUANTUM_SET(x) (((x) << WLAN_MBOX_DMA_POLICY_RX_QUANTUM_LSB) & WLAN_MBOX_DMA_POLICY_RX_QUANTUM_MASK) -#define WLAN_MBOX_DMA_POLICY_RX_ORDER_MSB 0 -#define WLAN_MBOX_DMA_POLICY_RX_ORDER_LSB 0 -#define WLAN_MBOX_DMA_POLICY_RX_ORDER_MASK 0x00000001 -#define WLAN_MBOX_DMA_POLICY_RX_ORDER_GET(x) (((x) & WLAN_MBOX_DMA_POLICY_RX_ORDER_MASK) >> WLAN_MBOX_DMA_POLICY_RX_ORDER_LSB) -#define WLAN_MBOX_DMA_POLICY_RX_ORDER_SET(x) (((x) << WLAN_MBOX_DMA_POLICY_RX_ORDER_LSB) & WLAN_MBOX_DMA_POLICY_RX_ORDER_MASK) - -#define WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000018 -#define WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000018 -#define WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX0_DMA_RX_CONTROL_ADDRESS 0x0000001c -#define WLAN_MBOX0_DMA_RX_CONTROL_OFFSET 0x0000001c -#define WLAN_MBOX0_DMA_RX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX0_DMA_RX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX0_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX0_DMA_RX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX0_DMA_RX_CONTROL_RESUME_MASK) >> WLAN_MBOX0_DMA_RX_CONTROL_RESUME_LSB) -#define WLAN_MBOX0_DMA_RX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX0_DMA_RX_CONTROL_RESUME_LSB) & WLAN_MBOX0_DMA_RX_CONTROL_RESUME_MASK) -#define WLAN_MBOX0_DMA_RX_CONTROL_START_MSB 1 -#define WLAN_MBOX0_DMA_RX_CONTROL_START_LSB 1 -#define WLAN_MBOX0_DMA_RX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX0_DMA_RX_CONTROL_START_GET(x) (((x) & WLAN_MBOX0_DMA_RX_CONTROL_START_MASK) >> WLAN_MBOX0_DMA_RX_CONTROL_START_LSB) -#define WLAN_MBOX0_DMA_RX_CONTROL_START_SET(x) (((x) << WLAN_MBOX0_DMA_RX_CONTROL_START_LSB) & WLAN_MBOX0_DMA_RX_CONTROL_START_MASK) -#define WLAN_MBOX0_DMA_RX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX0_DMA_RX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX0_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX0_DMA_RX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX0_DMA_RX_CONTROL_STOP_MASK) >> WLAN_MBOX0_DMA_RX_CONTROL_STOP_LSB) -#define WLAN_MBOX0_DMA_RX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX0_DMA_RX_CONTROL_STOP_LSB) & WLAN_MBOX0_DMA_RX_CONTROL_STOP_MASK) - -#define WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000020 -#define WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000020 -#define WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX0_DMA_TX_CONTROL_ADDRESS 0x00000024 -#define WLAN_MBOX0_DMA_TX_CONTROL_OFFSET 0x00000024 -#define WLAN_MBOX0_DMA_TX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX0_DMA_TX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX0_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX0_DMA_TX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX0_DMA_TX_CONTROL_RESUME_MASK) >> WLAN_MBOX0_DMA_TX_CONTROL_RESUME_LSB) -#define WLAN_MBOX0_DMA_TX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX0_DMA_TX_CONTROL_RESUME_LSB) & WLAN_MBOX0_DMA_TX_CONTROL_RESUME_MASK) -#define WLAN_MBOX0_DMA_TX_CONTROL_START_MSB 1 -#define WLAN_MBOX0_DMA_TX_CONTROL_START_LSB 1 -#define WLAN_MBOX0_DMA_TX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX0_DMA_TX_CONTROL_START_GET(x) (((x) & WLAN_MBOX0_DMA_TX_CONTROL_START_MASK) >> WLAN_MBOX0_DMA_TX_CONTROL_START_LSB) -#define WLAN_MBOX0_DMA_TX_CONTROL_START_SET(x) (((x) << WLAN_MBOX0_DMA_TX_CONTROL_START_LSB) & WLAN_MBOX0_DMA_TX_CONTROL_START_MASK) -#define WLAN_MBOX0_DMA_TX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX0_DMA_TX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX0_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX0_DMA_TX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX0_DMA_TX_CONTROL_STOP_MASK) >> WLAN_MBOX0_DMA_TX_CONTROL_STOP_LSB) -#define WLAN_MBOX0_DMA_TX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX0_DMA_TX_CONTROL_STOP_LSB) & WLAN_MBOX0_DMA_TX_CONTROL_STOP_MASK) - -#define WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000028 -#define WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000028 -#define WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX1_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX1_DMA_RX_CONTROL_ADDRESS 0x0000002c -#define WLAN_MBOX1_DMA_RX_CONTROL_OFFSET 0x0000002c -#define WLAN_MBOX1_DMA_RX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX1_DMA_RX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX1_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX1_DMA_RX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX1_DMA_RX_CONTROL_RESUME_MASK) >> WLAN_MBOX1_DMA_RX_CONTROL_RESUME_LSB) -#define WLAN_MBOX1_DMA_RX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX1_DMA_RX_CONTROL_RESUME_LSB) & WLAN_MBOX1_DMA_RX_CONTROL_RESUME_MASK) -#define WLAN_MBOX1_DMA_RX_CONTROL_START_MSB 1 -#define WLAN_MBOX1_DMA_RX_CONTROL_START_LSB 1 -#define WLAN_MBOX1_DMA_RX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX1_DMA_RX_CONTROL_START_GET(x) (((x) & WLAN_MBOX1_DMA_RX_CONTROL_START_MASK) >> WLAN_MBOX1_DMA_RX_CONTROL_START_LSB) -#define WLAN_MBOX1_DMA_RX_CONTROL_START_SET(x) (((x) << WLAN_MBOX1_DMA_RX_CONTROL_START_LSB) & WLAN_MBOX1_DMA_RX_CONTROL_START_MASK) -#define WLAN_MBOX1_DMA_RX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX1_DMA_RX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX1_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX1_DMA_RX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX1_DMA_RX_CONTROL_STOP_MASK) >> WLAN_MBOX1_DMA_RX_CONTROL_STOP_LSB) -#define WLAN_MBOX1_DMA_RX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX1_DMA_RX_CONTROL_STOP_LSB) & WLAN_MBOX1_DMA_RX_CONTROL_STOP_MASK) - -#define WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000030 -#define WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000030 -#define WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX1_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX1_DMA_TX_CONTROL_ADDRESS 0x00000034 -#define WLAN_MBOX1_DMA_TX_CONTROL_OFFSET 0x00000034 -#define WLAN_MBOX1_DMA_TX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX1_DMA_TX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX1_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX1_DMA_TX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX1_DMA_TX_CONTROL_RESUME_MASK) >> WLAN_MBOX1_DMA_TX_CONTROL_RESUME_LSB) -#define WLAN_MBOX1_DMA_TX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX1_DMA_TX_CONTROL_RESUME_LSB) & WLAN_MBOX1_DMA_TX_CONTROL_RESUME_MASK) -#define WLAN_MBOX1_DMA_TX_CONTROL_START_MSB 1 -#define WLAN_MBOX1_DMA_TX_CONTROL_START_LSB 1 -#define WLAN_MBOX1_DMA_TX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX1_DMA_TX_CONTROL_START_GET(x) (((x) & WLAN_MBOX1_DMA_TX_CONTROL_START_MASK) >> WLAN_MBOX1_DMA_TX_CONTROL_START_LSB) -#define WLAN_MBOX1_DMA_TX_CONTROL_START_SET(x) (((x) << WLAN_MBOX1_DMA_TX_CONTROL_START_LSB) & WLAN_MBOX1_DMA_TX_CONTROL_START_MASK) -#define WLAN_MBOX1_DMA_TX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX1_DMA_TX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX1_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX1_DMA_TX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX1_DMA_TX_CONTROL_STOP_MASK) >> WLAN_MBOX1_DMA_TX_CONTROL_STOP_LSB) -#define WLAN_MBOX1_DMA_TX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX1_DMA_TX_CONTROL_STOP_LSB) & WLAN_MBOX1_DMA_TX_CONTROL_STOP_MASK) - -#define WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000038 -#define WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000038 -#define WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX2_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX2_DMA_RX_CONTROL_ADDRESS 0x0000003c -#define WLAN_MBOX2_DMA_RX_CONTROL_OFFSET 0x0000003c -#define WLAN_MBOX2_DMA_RX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX2_DMA_RX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX2_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX2_DMA_RX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX2_DMA_RX_CONTROL_RESUME_MASK) >> WLAN_MBOX2_DMA_RX_CONTROL_RESUME_LSB) -#define WLAN_MBOX2_DMA_RX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX2_DMA_RX_CONTROL_RESUME_LSB) & WLAN_MBOX2_DMA_RX_CONTROL_RESUME_MASK) -#define WLAN_MBOX2_DMA_RX_CONTROL_START_MSB 1 -#define WLAN_MBOX2_DMA_RX_CONTROL_START_LSB 1 -#define WLAN_MBOX2_DMA_RX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX2_DMA_RX_CONTROL_START_GET(x) (((x) & WLAN_MBOX2_DMA_RX_CONTROL_START_MASK) >> WLAN_MBOX2_DMA_RX_CONTROL_START_LSB) -#define WLAN_MBOX2_DMA_RX_CONTROL_START_SET(x) (((x) << WLAN_MBOX2_DMA_RX_CONTROL_START_LSB) & WLAN_MBOX2_DMA_RX_CONTROL_START_MASK) -#define WLAN_MBOX2_DMA_RX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX2_DMA_RX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX2_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX2_DMA_RX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX2_DMA_RX_CONTROL_STOP_MASK) >> WLAN_MBOX2_DMA_RX_CONTROL_STOP_LSB) -#define WLAN_MBOX2_DMA_RX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX2_DMA_RX_CONTROL_STOP_LSB) & WLAN_MBOX2_DMA_RX_CONTROL_STOP_MASK) - -#define WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000040 -#define WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000040 -#define WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX2_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX2_DMA_TX_CONTROL_ADDRESS 0x00000044 -#define WLAN_MBOX2_DMA_TX_CONTROL_OFFSET 0x00000044 -#define WLAN_MBOX2_DMA_TX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX2_DMA_TX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX2_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX2_DMA_TX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX2_DMA_TX_CONTROL_RESUME_MASK) >> WLAN_MBOX2_DMA_TX_CONTROL_RESUME_LSB) -#define WLAN_MBOX2_DMA_TX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX2_DMA_TX_CONTROL_RESUME_LSB) & WLAN_MBOX2_DMA_TX_CONTROL_RESUME_MASK) -#define WLAN_MBOX2_DMA_TX_CONTROL_START_MSB 1 -#define WLAN_MBOX2_DMA_TX_CONTROL_START_LSB 1 -#define WLAN_MBOX2_DMA_TX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX2_DMA_TX_CONTROL_START_GET(x) (((x) & WLAN_MBOX2_DMA_TX_CONTROL_START_MASK) >> WLAN_MBOX2_DMA_TX_CONTROL_START_LSB) -#define WLAN_MBOX2_DMA_TX_CONTROL_START_SET(x) (((x) << WLAN_MBOX2_DMA_TX_CONTROL_START_LSB) & WLAN_MBOX2_DMA_TX_CONTROL_START_MASK) -#define WLAN_MBOX2_DMA_TX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX2_DMA_TX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX2_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX2_DMA_TX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX2_DMA_TX_CONTROL_STOP_MASK) >> WLAN_MBOX2_DMA_TX_CONTROL_STOP_LSB) -#define WLAN_MBOX2_DMA_TX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX2_DMA_TX_CONTROL_STOP_LSB) & WLAN_MBOX2_DMA_TX_CONTROL_STOP_MASK) - -#define WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000048 -#define WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000048 -#define WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX3_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX3_DMA_RX_CONTROL_ADDRESS 0x0000004c -#define WLAN_MBOX3_DMA_RX_CONTROL_OFFSET 0x0000004c -#define WLAN_MBOX3_DMA_RX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX3_DMA_RX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX3_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX3_DMA_RX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX3_DMA_RX_CONTROL_RESUME_MASK) >> WLAN_MBOX3_DMA_RX_CONTROL_RESUME_LSB) -#define WLAN_MBOX3_DMA_RX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX3_DMA_RX_CONTROL_RESUME_LSB) & WLAN_MBOX3_DMA_RX_CONTROL_RESUME_MASK) -#define WLAN_MBOX3_DMA_RX_CONTROL_START_MSB 1 -#define WLAN_MBOX3_DMA_RX_CONTROL_START_LSB 1 -#define WLAN_MBOX3_DMA_RX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX3_DMA_RX_CONTROL_START_GET(x) (((x) & WLAN_MBOX3_DMA_RX_CONTROL_START_MASK) >> WLAN_MBOX3_DMA_RX_CONTROL_START_LSB) -#define WLAN_MBOX3_DMA_RX_CONTROL_START_SET(x) (((x) << WLAN_MBOX3_DMA_RX_CONTROL_START_LSB) & WLAN_MBOX3_DMA_RX_CONTROL_START_MASK) -#define WLAN_MBOX3_DMA_RX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX3_DMA_RX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX3_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX3_DMA_RX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX3_DMA_RX_CONTROL_STOP_MASK) >> WLAN_MBOX3_DMA_RX_CONTROL_STOP_LSB) -#define WLAN_MBOX3_DMA_RX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX3_DMA_RX_CONTROL_STOP_LSB) & WLAN_MBOX3_DMA_RX_CONTROL_STOP_MASK) - -#define WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000050 -#define WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000050 -#define WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_MBOX3_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_MBOX3_DMA_TX_CONTROL_ADDRESS 0x00000054 -#define WLAN_MBOX3_DMA_TX_CONTROL_OFFSET 0x00000054 -#define WLAN_MBOX3_DMA_TX_CONTROL_RESUME_MSB 2 -#define WLAN_MBOX3_DMA_TX_CONTROL_RESUME_LSB 2 -#define WLAN_MBOX3_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_MBOX3_DMA_TX_CONTROL_RESUME_GET(x) (((x) & WLAN_MBOX3_DMA_TX_CONTROL_RESUME_MASK) >> WLAN_MBOX3_DMA_TX_CONTROL_RESUME_LSB) -#define WLAN_MBOX3_DMA_TX_CONTROL_RESUME_SET(x) (((x) << WLAN_MBOX3_DMA_TX_CONTROL_RESUME_LSB) & WLAN_MBOX3_DMA_TX_CONTROL_RESUME_MASK) -#define WLAN_MBOX3_DMA_TX_CONTROL_START_MSB 1 -#define WLAN_MBOX3_DMA_TX_CONTROL_START_LSB 1 -#define WLAN_MBOX3_DMA_TX_CONTROL_START_MASK 0x00000002 -#define WLAN_MBOX3_DMA_TX_CONTROL_START_GET(x) (((x) & WLAN_MBOX3_DMA_TX_CONTROL_START_MASK) >> WLAN_MBOX3_DMA_TX_CONTROL_START_LSB) -#define WLAN_MBOX3_DMA_TX_CONTROL_START_SET(x) (((x) << WLAN_MBOX3_DMA_TX_CONTROL_START_LSB) & WLAN_MBOX3_DMA_TX_CONTROL_START_MASK) -#define WLAN_MBOX3_DMA_TX_CONTROL_STOP_MSB 0 -#define WLAN_MBOX3_DMA_TX_CONTROL_STOP_LSB 0 -#define WLAN_MBOX3_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_MBOX3_DMA_TX_CONTROL_STOP_GET(x) (((x) & WLAN_MBOX3_DMA_TX_CONTROL_STOP_MASK) >> WLAN_MBOX3_DMA_TX_CONTROL_STOP_LSB) -#define WLAN_MBOX3_DMA_TX_CONTROL_STOP_SET(x) (((x) << WLAN_MBOX3_DMA_TX_CONTROL_STOP_LSB) & WLAN_MBOX3_DMA_TX_CONTROL_STOP_MASK) - -#define WLAN_MBOX_INT_STATUS_ADDRESS 0x00000058 -#define WLAN_MBOX_INT_STATUS_OFFSET 0x00000058 -#define WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_MSB 31 -#define WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB 28 -#define WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK 0xf0000000 -#define WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) (((x) & WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) >> WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) -#define WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) (((x) << WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) & WLAN_MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) -#define WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB 27 -#define WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB 24 -#define WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK 0x0f000000 -#define WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) (((x) & WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) >> WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) -#define WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) (((x) << WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) & WLAN_MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) -#define WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_MSB 23 -#define WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB 20 -#define WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK 0x00f00000 -#define WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) (((x) & WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) >> WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) -#define WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) (((x) << WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) & WLAN_MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) -#define WLAN_MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_MSB 19 -#define WLAN_MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_LSB 19 -#define WLAN_MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_MASK 0x00080000 -#define WLAN_MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_GET(x) (((x) & WLAN_MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_MASK) >> WLAN_MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_LSB) -#define WLAN_MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_SET(x) (((x) << WLAN_MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_LSB) & WLAN_MBOX_INT_STATUS_NO_RX_MBOX_DATA_AVA_MASK) -#define WLAN_MBOX_INT_STATUS_FRAME_DONE_MSB 18 -#define WLAN_MBOX_INT_STATUS_FRAME_DONE_LSB 18 -#define WLAN_MBOX_INT_STATUS_FRAME_DONE_MASK 0x00040000 -#define WLAN_MBOX_INT_STATUS_FRAME_DONE_GET(x) (((x) & WLAN_MBOX_INT_STATUS_FRAME_DONE_MASK) >> WLAN_MBOX_INT_STATUS_FRAME_DONE_LSB) -#define WLAN_MBOX_INT_STATUS_FRAME_DONE_SET(x) (((x) << WLAN_MBOX_INT_STATUS_FRAME_DONE_LSB) & WLAN_MBOX_INT_STATUS_FRAME_DONE_MASK) -#define WLAN_MBOX_INT_STATUS_TX_OVERFLOW_MSB 17 -#define WLAN_MBOX_INT_STATUS_TX_OVERFLOW_LSB 17 -#define WLAN_MBOX_INT_STATUS_TX_OVERFLOW_MASK 0x00020000 -#define WLAN_MBOX_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & WLAN_MBOX_INT_STATUS_TX_OVERFLOW_MASK) >> WLAN_MBOX_INT_STATUS_TX_OVERFLOW_LSB) -#define WLAN_MBOX_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << WLAN_MBOX_INT_STATUS_TX_OVERFLOW_LSB) & WLAN_MBOX_INT_STATUS_TX_OVERFLOW_MASK) -#define WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_MSB 16 -#define WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_LSB 16 -#define WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_MASK 0x00010000 -#define WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_MASK) >> WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_LSB) -#define WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_LSB) & WLAN_MBOX_INT_STATUS_RX_UNDERFLOW_MASK) -#define WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_MSB 15 -#define WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_LSB 12 -#define WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_MASK 0x0000f000 -#define WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) (((x) & WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_MASK) >> WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_LSB) -#define WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) (((x) << WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_LSB) & WLAN_MBOX_INT_STATUS_TX_NOT_EMPTY_MASK) -#define WLAN_MBOX_INT_STATUS_RX_NOT_FULL_MSB 11 -#define WLAN_MBOX_INT_STATUS_RX_NOT_FULL_LSB 8 -#define WLAN_MBOX_INT_STATUS_RX_NOT_FULL_MASK 0x00000f00 -#define WLAN_MBOX_INT_STATUS_RX_NOT_FULL_GET(x) (((x) & WLAN_MBOX_INT_STATUS_RX_NOT_FULL_MASK) >> WLAN_MBOX_INT_STATUS_RX_NOT_FULL_LSB) -#define WLAN_MBOX_INT_STATUS_RX_NOT_FULL_SET(x) (((x) << WLAN_MBOX_INT_STATUS_RX_NOT_FULL_LSB) & WLAN_MBOX_INT_STATUS_RX_NOT_FULL_MASK) -#define WLAN_MBOX_INT_STATUS_HOST_MSB 7 -#define WLAN_MBOX_INT_STATUS_HOST_LSB 0 -#define WLAN_MBOX_INT_STATUS_HOST_MASK 0x000000ff -#define WLAN_MBOX_INT_STATUS_HOST_GET(x) (((x) & WLAN_MBOX_INT_STATUS_HOST_MASK) >> WLAN_MBOX_INT_STATUS_HOST_LSB) -#define WLAN_MBOX_INT_STATUS_HOST_SET(x) (((x) << WLAN_MBOX_INT_STATUS_HOST_LSB) & WLAN_MBOX_INT_STATUS_HOST_MASK) - -#define WLAN_MBOX_INT_ENABLE_ADDRESS 0x0000005c -#define WLAN_MBOX_INT_ENABLE_OFFSET 0x0000005c -#define WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB 31 -#define WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB 28 -#define WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK 0xf0000000 -#define WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) >> WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) -#define WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) & WLAN_MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) -#define WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB 27 -#define WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB 24 -#define WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK 0x0f000000 -#define WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) >> WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) -#define WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) & WLAN_MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) -#define WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB 23 -#define WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB 20 -#define WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK 0x00f00000 -#define WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) >> WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) -#define WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) & WLAN_MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) -#define WLAN_MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_MSB 19 -#define WLAN_MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_LSB 19 -#define WLAN_MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_MASK 0x00080000 -#define WLAN_MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_MASK) >> WLAN_MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_LSB) -#define WLAN_MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_LSB) & WLAN_MBOX_INT_ENABLE_NO_RX_MBOX_DATA_AVA_MASK) -#define WLAN_MBOX_INT_ENABLE_FRAME_DONE_MSB 18 -#define WLAN_MBOX_INT_ENABLE_FRAME_DONE_LSB 18 -#define WLAN_MBOX_INT_ENABLE_FRAME_DONE_MASK 0x00040000 -#define WLAN_MBOX_INT_ENABLE_FRAME_DONE_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_FRAME_DONE_MASK) >> WLAN_MBOX_INT_ENABLE_FRAME_DONE_LSB) -#define WLAN_MBOX_INT_ENABLE_FRAME_DONE_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_FRAME_DONE_LSB) & WLAN_MBOX_INT_ENABLE_FRAME_DONE_MASK) -#define WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_MSB 17 -#define WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_LSB 17 -#define WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_MASK 0x00020000 -#define WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_MASK) >> WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_LSB) -#define WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_LSB) & WLAN_MBOX_INT_ENABLE_TX_OVERFLOW_MASK) -#define WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_MSB 16 -#define WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_LSB 16 -#define WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_MASK 0x00010000 -#define WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_MASK) >> WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_LSB) -#define WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_LSB) & WLAN_MBOX_INT_ENABLE_RX_UNDERFLOW_MASK) -#define WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_MSB 15 -#define WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB 12 -#define WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK 0x0000f000 -#define WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) >> WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) -#define WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) & WLAN_MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) -#define WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_MSB 11 -#define WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_LSB 8 -#define WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_MASK 0x00000f00 -#define WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_MASK) >> WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_LSB) -#define WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_LSB) & WLAN_MBOX_INT_ENABLE_RX_NOT_FULL_MASK) -#define WLAN_MBOX_INT_ENABLE_HOST_MSB 7 -#define WLAN_MBOX_INT_ENABLE_HOST_LSB 0 -#define WLAN_MBOX_INT_ENABLE_HOST_MASK 0x000000ff -#define WLAN_MBOX_INT_ENABLE_HOST_GET(x) (((x) & WLAN_MBOX_INT_ENABLE_HOST_MASK) >> WLAN_MBOX_INT_ENABLE_HOST_LSB) -#define WLAN_MBOX_INT_ENABLE_HOST_SET(x) (((x) << WLAN_MBOX_INT_ENABLE_HOST_LSB) & WLAN_MBOX_INT_ENABLE_HOST_MASK) - -#define WLAN_INT_HOST_ADDRESS 0x00000060 -#define WLAN_INT_HOST_OFFSET 0x00000060 -#define WLAN_INT_HOST_VECTOR_MSB 7 -#define WLAN_INT_HOST_VECTOR_LSB 0 -#define WLAN_INT_HOST_VECTOR_MASK 0x000000ff -#define WLAN_INT_HOST_VECTOR_GET(x) (((x) & WLAN_INT_HOST_VECTOR_MASK) >> WLAN_INT_HOST_VECTOR_LSB) -#define WLAN_INT_HOST_VECTOR_SET(x) (((x) << WLAN_INT_HOST_VECTOR_LSB) & WLAN_INT_HOST_VECTOR_MASK) - -#define WLAN_LOCAL_COUNT_ADDRESS 0x00000080 -#define WLAN_LOCAL_COUNT_OFFSET 0x00000080 -#define WLAN_LOCAL_COUNT_VALUE_MSB 7 -#define WLAN_LOCAL_COUNT_VALUE_LSB 0 -#define WLAN_LOCAL_COUNT_VALUE_MASK 0x000000ff -#define WLAN_LOCAL_COUNT_VALUE_GET(x) (((x) & WLAN_LOCAL_COUNT_VALUE_MASK) >> WLAN_LOCAL_COUNT_VALUE_LSB) -#define WLAN_LOCAL_COUNT_VALUE_SET(x) (((x) << WLAN_LOCAL_COUNT_VALUE_LSB) & WLAN_LOCAL_COUNT_VALUE_MASK) - -#define WLAN_COUNT_INC_ADDRESS 0x000000a0 -#define WLAN_COUNT_INC_OFFSET 0x000000a0 -#define WLAN_COUNT_INC_VALUE_MSB 7 -#define WLAN_COUNT_INC_VALUE_LSB 0 -#define WLAN_COUNT_INC_VALUE_MASK 0x000000ff -#define WLAN_COUNT_INC_VALUE_GET(x) (((x) & WLAN_COUNT_INC_VALUE_MASK) >> WLAN_COUNT_INC_VALUE_LSB) -#define WLAN_COUNT_INC_VALUE_SET(x) (((x) << WLAN_COUNT_INC_VALUE_LSB) & WLAN_COUNT_INC_VALUE_MASK) - -#define WLAN_LOCAL_SCRATCH_ADDRESS 0x000000c0 -#define WLAN_LOCAL_SCRATCH_OFFSET 0x000000c0 -#define WLAN_LOCAL_SCRATCH_VALUE_MSB 7 -#define WLAN_LOCAL_SCRATCH_VALUE_LSB 0 -#define WLAN_LOCAL_SCRATCH_VALUE_MASK 0x000000ff -#define WLAN_LOCAL_SCRATCH_VALUE_GET(x) (((x) & WLAN_LOCAL_SCRATCH_VALUE_MASK) >> WLAN_LOCAL_SCRATCH_VALUE_LSB) -#define WLAN_LOCAL_SCRATCH_VALUE_SET(x) (((x) << WLAN_LOCAL_SCRATCH_VALUE_LSB) & WLAN_LOCAL_SCRATCH_VALUE_MASK) - -#define WLAN_USE_LOCAL_BUS_ADDRESS 0x000000e0 -#define WLAN_USE_LOCAL_BUS_OFFSET 0x000000e0 -#define WLAN_USE_LOCAL_BUS_PIN_INIT_MSB 0 -#define WLAN_USE_LOCAL_BUS_PIN_INIT_LSB 0 -#define WLAN_USE_LOCAL_BUS_PIN_INIT_MASK 0x00000001 -#define WLAN_USE_LOCAL_BUS_PIN_INIT_GET(x) (((x) & WLAN_USE_LOCAL_BUS_PIN_INIT_MASK) >> WLAN_USE_LOCAL_BUS_PIN_INIT_LSB) -#define WLAN_USE_LOCAL_BUS_PIN_INIT_SET(x) (((x) << WLAN_USE_LOCAL_BUS_PIN_INIT_LSB) & WLAN_USE_LOCAL_BUS_PIN_INIT_MASK) - -#define WLAN_SDIO_CONFIG_ADDRESS 0x000000e4 -#define WLAN_SDIO_CONFIG_OFFSET 0x000000e4 -#define WLAN_SDIO_CONFIG_CCCR_IOR1_MSB 0 -#define WLAN_SDIO_CONFIG_CCCR_IOR1_LSB 0 -#define WLAN_SDIO_CONFIG_CCCR_IOR1_MASK 0x00000001 -#define WLAN_SDIO_CONFIG_CCCR_IOR1_GET(x) (((x) & WLAN_SDIO_CONFIG_CCCR_IOR1_MASK) >> WLAN_SDIO_CONFIG_CCCR_IOR1_LSB) -#define WLAN_SDIO_CONFIG_CCCR_IOR1_SET(x) (((x) << WLAN_SDIO_CONFIG_CCCR_IOR1_LSB) & WLAN_SDIO_CONFIG_CCCR_IOR1_MASK) - -#define WLAN_MBOX_DEBUG_ADDRESS 0x000000e8 -#define WLAN_MBOX_DEBUG_OFFSET 0x000000e8 -#define WLAN_MBOX_DEBUG_SEL_MSB 2 -#define WLAN_MBOX_DEBUG_SEL_LSB 0 -#define WLAN_MBOX_DEBUG_SEL_MASK 0x00000007 -#define WLAN_MBOX_DEBUG_SEL_GET(x) (((x) & WLAN_MBOX_DEBUG_SEL_MASK) >> WLAN_MBOX_DEBUG_SEL_LSB) -#define WLAN_MBOX_DEBUG_SEL_SET(x) (((x) << WLAN_MBOX_DEBUG_SEL_LSB) & WLAN_MBOX_DEBUG_SEL_MASK) - -#define WLAN_MBOX_FIFO_RESET_ADDRESS 0x000000ec -#define WLAN_MBOX_FIFO_RESET_OFFSET 0x000000ec -#define WLAN_MBOX_FIFO_RESET_INIT_MSB 0 -#define WLAN_MBOX_FIFO_RESET_INIT_LSB 0 -#define WLAN_MBOX_FIFO_RESET_INIT_MASK 0x00000001 -#define WLAN_MBOX_FIFO_RESET_INIT_GET(x) (((x) & WLAN_MBOX_FIFO_RESET_INIT_MASK) >> WLAN_MBOX_FIFO_RESET_INIT_LSB) -#define WLAN_MBOX_FIFO_RESET_INIT_SET(x) (((x) << WLAN_MBOX_FIFO_RESET_INIT_LSB) & WLAN_MBOX_FIFO_RESET_INIT_MASK) - -#define WLAN_MBOX_TXFIFO_POP_ADDRESS 0x000000f0 -#define WLAN_MBOX_TXFIFO_POP_OFFSET 0x000000f0 -#define WLAN_MBOX_TXFIFO_POP_DATA_MSB 0 -#define WLAN_MBOX_TXFIFO_POP_DATA_LSB 0 -#define WLAN_MBOX_TXFIFO_POP_DATA_MASK 0x00000001 -#define WLAN_MBOX_TXFIFO_POP_DATA_GET(x) (((x) & WLAN_MBOX_TXFIFO_POP_DATA_MASK) >> WLAN_MBOX_TXFIFO_POP_DATA_LSB) -#define WLAN_MBOX_TXFIFO_POP_DATA_SET(x) (((x) << WLAN_MBOX_TXFIFO_POP_DATA_LSB) & WLAN_MBOX_TXFIFO_POP_DATA_MASK) - -#define WLAN_MBOX_RXFIFO_POP_ADDRESS 0x00000100 -#define WLAN_MBOX_RXFIFO_POP_OFFSET 0x00000100 -#define WLAN_MBOX_RXFIFO_POP_DATA_MSB 0 -#define WLAN_MBOX_RXFIFO_POP_DATA_LSB 0 -#define WLAN_MBOX_RXFIFO_POP_DATA_MASK 0x00000001 -#define WLAN_MBOX_RXFIFO_POP_DATA_GET(x) (((x) & WLAN_MBOX_RXFIFO_POP_DATA_MASK) >> WLAN_MBOX_RXFIFO_POP_DATA_LSB) -#define WLAN_MBOX_RXFIFO_POP_DATA_SET(x) (((x) << WLAN_MBOX_RXFIFO_POP_DATA_LSB) & WLAN_MBOX_RXFIFO_POP_DATA_MASK) - -#define WLAN_SDIO_DEBUG_ADDRESS 0x00000110 -#define WLAN_SDIO_DEBUG_OFFSET 0x00000110 -#define WLAN_SDIO_DEBUG_SEL_MSB 3 -#define WLAN_SDIO_DEBUG_SEL_LSB 0 -#define WLAN_SDIO_DEBUG_SEL_MASK 0x0000000f -#define WLAN_SDIO_DEBUG_SEL_GET(x) (((x) & WLAN_SDIO_DEBUG_SEL_MASK) >> WLAN_SDIO_DEBUG_SEL_LSB) -#define WLAN_SDIO_DEBUG_SEL_SET(x) (((x) << WLAN_SDIO_DEBUG_SEL_LSB) & WLAN_SDIO_DEBUG_SEL_MASK) - -#define WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000114 -#define WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000114 -#define WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_GMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_GMBOX0_DMA_RX_CONTROL_ADDRESS 0x00000118 -#define WLAN_GMBOX0_DMA_RX_CONTROL_OFFSET 0x00000118 -#define WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_MSB 2 -#define WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_LSB 2 -#define WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_GET(x) (((x) & WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_MASK) >> WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_LSB) -#define WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_SET(x) (((x) << WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_LSB) & WLAN_GMBOX0_DMA_RX_CONTROL_RESUME_MASK) -#define WLAN_GMBOX0_DMA_RX_CONTROL_START_MSB 1 -#define WLAN_GMBOX0_DMA_RX_CONTROL_START_LSB 1 -#define WLAN_GMBOX0_DMA_RX_CONTROL_START_MASK 0x00000002 -#define WLAN_GMBOX0_DMA_RX_CONTROL_START_GET(x) (((x) & WLAN_GMBOX0_DMA_RX_CONTROL_START_MASK) >> WLAN_GMBOX0_DMA_RX_CONTROL_START_LSB) -#define WLAN_GMBOX0_DMA_RX_CONTROL_START_SET(x) (((x) << WLAN_GMBOX0_DMA_RX_CONTROL_START_LSB) & WLAN_GMBOX0_DMA_RX_CONTROL_START_MASK) -#define WLAN_GMBOX0_DMA_RX_CONTROL_STOP_MSB 0 -#define WLAN_GMBOX0_DMA_RX_CONTROL_STOP_LSB 0 -#define WLAN_GMBOX0_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_GMBOX0_DMA_RX_CONTROL_STOP_GET(x) (((x) & WLAN_GMBOX0_DMA_RX_CONTROL_STOP_MASK) >> WLAN_GMBOX0_DMA_RX_CONTROL_STOP_LSB) -#define WLAN_GMBOX0_DMA_RX_CONTROL_STOP_SET(x) (((x) << WLAN_GMBOX0_DMA_RX_CONTROL_STOP_LSB) & WLAN_GMBOX0_DMA_RX_CONTROL_STOP_MASK) - -#define WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x0000011c -#define WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x0000011c -#define WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & WLAN_GMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define WLAN_GMBOX0_DMA_TX_CONTROL_ADDRESS 0x00000120 -#define WLAN_GMBOX0_DMA_TX_CONTROL_OFFSET 0x00000120 -#define WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_MSB 2 -#define WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_LSB 2 -#define WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_GET(x) (((x) & WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_MASK) >> WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_LSB) -#define WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_SET(x) (((x) << WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_LSB) & WLAN_GMBOX0_DMA_TX_CONTROL_RESUME_MASK) -#define WLAN_GMBOX0_DMA_TX_CONTROL_START_MSB 1 -#define WLAN_GMBOX0_DMA_TX_CONTROL_START_LSB 1 -#define WLAN_GMBOX0_DMA_TX_CONTROL_START_MASK 0x00000002 -#define WLAN_GMBOX0_DMA_TX_CONTROL_START_GET(x) (((x) & WLAN_GMBOX0_DMA_TX_CONTROL_START_MASK) >> WLAN_GMBOX0_DMA_TX_CONTROL_START_LSB) -#define WLAN_GMBOX0_DMA_TX_CONTROL_START_SET(x) (((x) << WLAN_GMBOX0_DMA_TX_CONTROL_START_LSB) & WLAN_GMBOX0_DMA_TX_CONTROL_START_MASK) -#define WLAN_GMBOX0_DMA_TX_CONTROL_STOP_MSB 0 -#define WLAN_GMBOX0_DMA_TX_CONTROL_STOP_LSB 0 -#define WLAN_GMBOX0_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define WLAN_GMBOX0_DMA_TX_CONTROL_STOP_GET(x) (((x) & WLAN_GMBOX0_DMA_TX_CONTROL_STOP_MASK) >> WLAN_GMBOX0_DMA_TX_CONTROL_STOP_LSB) -#define WLAN_GMBOX0_DMA_TX_CONTROL_STOP_SET(x) (((x) << WLAN_GMBOX0_DMA_TX_CONTROL_STOP_LSB) & WLAN_GMBOX0_DMA_TX_CONTROL_STOP_MASK) - -#define WLAN_GMBOX_INT_STATUS_ADDRESS 0x00000124 -#define WLAN_GMBOX_INT_STATUS_OFFSET 0x00000124 -#define WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_MSB 6 -#define WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_LSB 6 -#define WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_MASK 0x00000040 -#define WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_MASK) >> WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_LSB) -#define WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_LSB) & WLAN_GMBOX_INT_STATUS_TX_OVERFLOW_MASK) -#define WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_MSB 5 -#define WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_LSB 5 -#define WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_MASK 0x00000020 -#define WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_MASK) >> WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_LSB) -#define WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_LSB) & WLAN_GMBOX_INT_STATUS_RX_UNDERFLOW_MASK) -#define WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_MSB 4 -#define WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB 4 -#define WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK 0x00000010 -#define WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) (((x) & WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) >> WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) -#define WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) (((x) << WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) & WLAN_GMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) -#define WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB 3 -#define WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB 3 -#define WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK 0x00000008 -#define WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) (((x) & WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) >> WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) -#define WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) (((x) << WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) & WLAN_GMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) -#define WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_MSB 2 -#define WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB 2 -#define WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK 0x00000004 -#define WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) (((x) & WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) >> WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) -#define WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) (((x) << WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) & WLAN_GMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) -#define WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_MSB 1 -#define WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_LSB 1 -#define WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_MASK 0x00000002 -#define WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) (((x) & WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_MASK) >> WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_LSB) -#define WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) (((x) << WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_LSB) & WLAN_GMBOX_INT_STATUS_TX_NOT_EMPTY_MASK) -#define WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_MSB 0 -#define WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_LSB 0 -#define WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_MASK 0x00000001 -#define WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_GET(x) (((x) & WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_MASK) >> WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_LSB) -#define WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_SET(x) (((x) << WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_LSB) & WLAN_GMBOX_INT_STATUS_RX_NOT_FULL_MASK) - -#define WLAN_GMBOX_INT_ENABLE_ADDRESS 0x00000128 -#define WLAN_GMBOX_INT_ENABLE_OFFSET 0x00000128 -#define WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_MSB 6 -#define WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_LSB 6 -#define WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_MASK 0x00000040 -#define WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_GET(x) (((x) & WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_MASK) >> WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_LSB) -#define WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_SET(x) (((x) << WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_LSB) & WLAN_GMBOX_INT_ENABLE_TX_OVERFLOW_MASK) -#define WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_MSB 5 -#define WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_LSB 5 -#define WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_MASK 0x00000020 -#define WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) (((x) & WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_MASK) >> WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_LSB) -#define WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) (((x) << WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_LSB) & WLAN_GMBOX_INT_ENABLE_RX_UNDERFLOW_MASK) -#define WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB 4 -#define WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB 4 -#define WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK 0x00000010 -#define WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) (((x) & WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) >> WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) -#define WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) (((x) << WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) & WLAN_GMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB 3 -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB 3 -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK 0x00000008 -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) (((x) & WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) >> WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) (((x) << WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) & WLAN_GMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB 2 -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB 2 -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK 0x00000004 -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) (((x) & WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) >> WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) -#define WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) (((x) << WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) & WLAN_GMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) -#define WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_MSB 1 -#define WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB 1 -#define WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK 0x00000002 -#define WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) (((x) & WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) >> WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) -#define WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) (((x) << WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) & WLAN_GMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) -#define WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_MSB 0 -#define WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_LSB 0 -#define WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_MASK 0x00000001 -#define WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_GET(x) (((x) & WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_MASK) >> WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_LSB) -#define WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_SET(x) (((x) << WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_LSB) & WLAN_GMBOX_INT_ENABLE_RX_NOT_FULL_MASK) - -#define STE_MODE_ADDRESS 0x0000012c -#define STE_MODE_OFFSET 0x0000012c -#define STE_MODE_SPI_CTRL_EN_MSB 6 -#define STE_MODE_SPI_CTRL_EN_LSB 6 -#define STE_MODE_SPI_CTRL_EN_MASK 0x00000040 -#define STE_MODE_SPI_CTRL_EN_GET(x) (((x) & STE_MODE_SPI_CTRL_EN_MASK) >> STE_MODE_SPI_CTRL_EN_LSB) -#define STE_MODE_SPI_CTRL_EN_SET(x) (((x) << STE_MODE_SPI_CTRL_EN_LSB) & STE_MODE_SPI_CTRL_EN_MASK) -#define STE_MODE_RST_MSB 5 -#define STE_MODE_RST_LSB 5 -#define STE_MODE_RST_MASK 0x00000020 -#define STE_MODE_RST_GET(x) (((x) & STE_MODE_RST_MASK) >> STE_MODE_RST_LSB) -#define STE_MODE_RST_SET(x) (((x) << STE_MODE_RST_LSB) & STE_MODE_RST_MASK) -#define STE_MODE_SWAP_MSB 4 -#define STE_MODE_SWAP_LSB 4 -#define STE_MODE_SWAP_MASK 0x00000010 -#define STE_MODE_SWAP_GET(x) (((x) & STE_MODE_SWAP_MASK) >> STE_MODE_SWAP_LSB) -#define STE_MODE_SWAP_SET(x) (((x) << STE_MODE_SWAP_LSB) & STE_MODE_SWAP_MASK) -#define STE_MODE_SEL_16BIT_MSB 3 -#define STE_MODE_SEL_16BIT_LSB 3 -#define STE_MODE_SEL_16BIT_MASK 0x00000008 -#define STE_MODE_SEL_16BIT_GET(x) (((x) & STE_MODE_SEL_16BIT_MASK) >> STE_MODE_SEL_16BIT_LSB) -#define STE_MODE_SEL_16BIT_SET(x) (((x) << STE_MODE_SEL_16BIT_LSB) & STE_MODE_SEL_16BIT_MASK) -#define STE_MODE_PHA_POL_MSB 2 -#define STE_MODE_PHA_POL_LSB 1 -#define STE_MODE_PHA_POL_MASK 0x00000006 -#define STE_MODE_PHA_POL_GET(x) (((x) & STE_MODE_PHA_POL_MASK) >> STE_MODE_PHA_POL_LSB) -#define STE_MODE_PHA_POL_SET(x) (((x) << STE_MODE_PHA_POL_LSB) & STE_MODE_PHA_POL_MASK) -#define STE_MODE_SEL_MSB 0 -#define STE_MODE_SEL_LSB 0 -#define STE_MODE_SEL_MASK 0x00000001 -#define STE_MODE_SEL_GET(x) (((x) & STE_MODE_SEL_MASK) >> STE_MODE_SEL_LSB) -#define STE_MODE_SEL_SET(x) (((x) << STE_MODE_SEL_LSB) & STE_MODE_SEL_MASK) - -#define WLAN_HOST_IF_WINDOW_ADDRESS 0x00002000 -#define WLAN_HOST_IF_WINDOW_OFFSET 0x00002000 -#define WLAN_HOST_IF_WINDOW_DATA_MSB 7 -#define WLAN_HOST_IF_WINDOW_DATA_LSB 0 -#define WLAN_HOST_IF_WINDOW_DATA_MASK 0x000000ff -#define WLAN_HOST_IF_WINDOW_DATA_GET(x) (((x) & WLAN_HOST_IF_WINDOW_DATA_MASK) >> WLAN_HOST_IF_WINDOW_DATA_LSB) -#define WLAN_HOST_IF_WINDOW_DATA_SET(x) (((x) << WLAN_HOST_IF_WINDOW_DATA_LSB) & WLAN_HOST_IF_WINDOW_DATA_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct mbox_wlan_reg_reg_s { - volatile unsigned int wlan_mbox_fifo[4]; - volatile unsigned int wlan_mbox_fifo_status; - volatile unsigned int wlan_mbox_dma_policy; - volatile unsigned int wlan_mbox0_dma_rx_descriptor_base; - volatile unsigned int wlan_mbox0_dma_rx_control; - volatile unsigned int wlan_mbox0_dma_tx_descriptor_base; - volatile unsigned int wlan_mbox0_dma_tx_control; - volatile unsigned int wlan_mbox1_dma_rx_descriptor_base; - volatile unsigned int wlan_mbox1_dma_rx_control; - volatile unsigned int wlan_mbox1_dma_tx_descriptor_base; - volatile unsigned int wlan_mbox1_dma_tx_control; - volatile unsigned int wlan_mbox2_dma_rx_descriptor_base; - volatile unsigned int wlan_mbox2_dma_rx_control; - volatile unsigned int wlan_mbox2_dma_tx_descriptor_base; - volatile unsigned int wlan_mbox2_dma_tx_control; - volatile unsigned int wlan_mbox3_dma_rx_descriptor_base; - volatile unsigned int wlan_mbox3_dma_rx_control; - volatile unsigned int wlan_mbox3_dma_tx_descriptor_base; - volatile unsigned int wlan_mbox3_dma_tx_control; - volatile unsigned int wlan_mbox_int_status; - volatile unsigned int wlan_mbox_int_enable; - volatile unsigned int wlan_int_host; - unsigned char pad0[28]; /* pad to 0x80 */ - volatile unsigned int wlan_local_count[8]; - volatile unsigned int wlan_count_inc[8]; - volatile unsigned int wlan_local_scratch[8]; - volatile unsigned int wlan_use_local_bus; - volatile unsigned int wlan_sdio_config; - volatile unsigned int wlan_mbox_debug; - volatile unsigned int wlan_mbox_fifo_reset; - volatile unsigned int wlan_mbox_txfifo_pop[4]; - volatile unsigned int wlan_mbox_rxfifo_pop[4]; - volatile unsigned int wlan_sdio_debug; - volatile unsigned int wlan_gmbox0_dma_rx_descriptor_base; - volatile unsigned int wlan_gmbox0_dma_rx_control; - volatile unsigned int wlan_gmbox0_dma_tx_descriptor_base; - volatile unsigned int wlan_gmbox0_dma_tx_control; - volatile unsigned int wlan_gmbox_int_status; - volatile unsigned int wlan_gmbox_int_enable; - volatile unsigned int ste_mode; - unsigned char pad1[7888]; /* pad to 0x2000 */ - volatile unsigned int wlan_host_if_window[2048]; -} mbox_wlan_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _MBOX_WLAN_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mdio_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mdio_reg.h deleted file mode 100644 index c98d36c59706..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mdio_reg.h +++ /dev/null @@ -1,67 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _MDIO_REG_REG_H_ -#define _MDIO_REG_REG_H_ - -#define MDIO_REG_ADDRESS 0x00000000 -#define MDIO_REG_OFFSET 0x00000000 -#define MDIO_REG_VALUE_MSB 15 -#define MDIO_REG_VALUE_LSB 0 -#define MDIO_REG_VALUE_MASK 0x0000ffff -#define MDIO_REG_VALUE_GET(x) (((x) & MDIO_REG_VALUE_MASK) >> MDIO_REG_VALUE_LSB) -#define MDIO_REG_VALUE_SET(x) (((x) << MDIO_REG_VALUE_LSB) & MDIO_REG_VALUE_MASK) - -#define MDIO_ISR_ADDRESS 0x00000020 -#define MDIO_ISR_OFFSET 0x00000020 -#define MDIO_ISR_MASK_MSB 15 -#define MDIO_ISR_MASK_LSB 8 -#define MDIO_ISR_MASK_MASK 0x0000ff00 -#define MDIO_ISR_MASK_GET(x) (((x) & MDIO_ISR_MASK_MASK) >> MDIO_ISR_MASK_LSB) -#define MDIO_ISR_MASK_SET(x) (((x) << MDIO_ISR_MASK_LSB) & MDIO_ISR_MASK_MASK) -#define MDIO_ISR_REGS_MSB 7 -#define MDIO_ISR_REGS_LSB 0 -#define MDIO_ISR_REGS_MASK 0x000000ff -#define MDIO_ISR_REGS_GET(x) (((x) & MDIO_ISR_REGS_MASK) >> MDIO_ISR_REGS_LSB) -#define MDIO_ISR_REGS_SET(x) (((x) << MDIO_ISR_REGS_LSB) & MDIO_ISR_REGS_MASK) - -#define PHY_ADDR_ADDRESS 0x00000024 -#define PHY_ADDR_OFFSET 0x00000024 -#define PHY_ADDR_VAL_MSB 2 -#define PHY_ADDR_VAL_LSB 0 -#define PHY_ADDR_VAL_MASK 0x00000007 -#define PHY_ADDR_VAL_GET(x) (((x) & PHY_ADDR_VAL_MASK) >> PHY_ADDR_VAL_LSB) -#define PHY_ADDR_VAL_SET(x) (((x) << PHY_ADDR_VAL_LSB) & PHY_ADDR_VAL_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct mdio_reg_reg_s { - volatile unsigned int mdio_reg[8]; - volatile unsigned int mdio_isr; - volatile unsigned int phy_addr; -} mdio_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _MDIO_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mii_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mii_reg.h deleted file mode 100644 index eefd4419f8e0..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mii_reg.h +++ /dev/null @@ -1,83 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _MII_REG_REG_H_ -#define _MII_REG_REG_H_ - -#define MII0_CNTL_ADDRESS 0x00000000 -#define MII0_CNTL_OFFSET 0x00000000 -#define MII0_CNTL_RGMII_DELAY_MSB 9 -#define MII0_CNTL_RGMII_DELAY_LSB 8 -#define MII0_CNTL_RGMII_DELAY_MASK 0x00000300 -#define MII0_CNTL_RGMII_DELAY_GET(x) (((x) & MII0_CNTL_RGMII_DELAY_MASK) >> MII0_CNTL_RGMII_DELAY_LSB) -#define MII0_CNTL_RGMII_DELAY_SET(x) (((x) << MII0_CNTL_RGMII_DELAY_LSB) & MII0_CNTL_RGMII_DELAY_MASK) -#define MII0_CNTL_SPEED_MSB 5 -#define MII0_CNTL_SPEED_LSB 4 -#define MII0_CNTL_SPEED_MASK 0x00000030 -#define MII0_CNTL_SPEED_GET(x) (((x) & MII0_CNTL_SPEED_MASK) >> MII0_CNTL_SPEED_LSB) -#define MII0_CNTL_SPEED_SET(x) (((x) << MII0_CNTL_SPEED_LSB) & MII0_CNTL_SPEED_MASK) -#define MII0_CNTL_MASTER_MSB 2 -#define MII0_CNTL_MASTER_LSB 2 -#define MII0_CNTL_MASTER_MASK 0x00000004 -#define MII0_CNTL_MASTER_GET(x) (((x) & MII0_CNTL_MASTER_MASK) >> MII0_CNTL_MASTER_LSB) -#define MII0_CNTL_MASTER_SET(x) (((x) << MII0_CNTL_MASTER_LSB) & MII0_CNTL_MASTER_MASK) -#define MII0_CNTL_SELECT_MSB 1 -#define MII0_CNTL_SELECT_LSB 0 -#define MII0_CNTL_SELECT_MASK 0x00000003 -#define MII0_CNTL_SELECT_GET(x) (((x) & MII0_CNTL_SELECT_MASK) >> MII0_CNTL_SELECT_LSB) -#define MII0_CNTL_SELECT_SET(x) (((x) << MII0_CNTL_SELECT_LSB) & MII0_CNTL_SELECT_MASK) - -#define STAT_CNTL_ADDRESS 0x00000004 -#define STAT_CNTL_OFFSET 0x00000004 -#define STAT_CNTL_GIG_MSB 3 -#define STAT_CNTL_GIG_LSB 3 -#define STAT_CNTL_GIG_MASK 0x00000008 -#define STAT_CNTL_GIG_GET(x) (((x) & STAT_CNTL_GIG_MASK) >> STAT_CNTL_GIG_LSB) -#define STAT_CNTL_GIG_SET(x) (((x) << STAT_CNTL_GIG_LSB) & STAT_CNTL_GIG_MASK) -#define STAT_CNTL_STEN_MSB 2 -#define STAT_CNTL_STEN_LSB 2 -#define STAT_CNTL_STEN_MASK 0x00000004 -#define STAT_CNTL_STEN_GET(x) (((x) & STAT_CNTL_STEN_MASK) >> STAT_CNTL_STEN_LSB) -#define STAT_CNTL_STEN_SET(x) (((x) << STAT_CNTL_STEN_LSB) & STAT_CNTL_STEN_MASK) -#define STAT_CNTL_CLRCNT_MSB 1 -#define STAT_CNTL_CLRCNT_LSB 1 -#define STAT_CNTL_CLRCNT_MASK 0x00000002 -#define STAT_CNTL_CLRCNT_GET(x) (((x) & STAT_CNTL_CLRCNT_MASK) >> STAT_CNTL_CLRCNT_LSB) -#define STAT_CNTL_CLRCNT_SET(x) (((x) << STAT_CNTL_CLRCNT_LSB) & STAT_CNTL_CLRCNT_MASK) -#define STAT_CNTL_AUTOZ_MSB 0 -#define STAT_CNTL_AUTOZ_LSB 0 -#define STAT_CNTL_AUTOZ_MASK 0x00000001 -#define STAT_CNTL_AUTOZ_GET(x) (((x) & STAT_CNTL_AUTOZ_MASK) >> STAT_CNTL_AUTOZ_LSB) -#define STAT_CNTL_AUTOZ_SET(x) (((x) << STAT_CNTL_AUTOZ_LSB) & STAT_CNTL_AUTOZ_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct mii_reg_reg_s { - volatile unsigned int mii0_cntl; - volatile unsigned int stat_cntl; -} mii_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _MII_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mmac_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mmac_reg.h deleted file mode 100644 index 91ccccae31b7..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/mmac_reg.h +++ /dev/null @@ -1,375 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _MMAC_REG_REG_H_ -#define _MMAC_REG_REG_H_ - - -/* macros for RX_FRAME0 */ -#define RX_FRAME0_ADDRESS 0x00000000 -#define RX_FRAME0_OFFSET 0x00000000 -#define RX_FRAME0_OWN_MSB 0 -#define RX_FRAME0_OWN_LSB 0 -#define RX_FRAME0_OWN_MASK 0x00000001 -#define RX_FRAME0_OWN_GET(x) (((x) & 0x00000001) >> 0) -#define RX_FRAME0_OWN_SET(x) (((x) << 0) & 0x00000001) -#define RX_FRAME0_LEN_MSB 12 -#define RX_FRAME0_LEN_LSB 1 -#define RX_FRAME0_LEN_MASK 0x00001ffe -#define RX_FRAME0_LEN_GET(x) (((x) & 0x00001ffe) >> 1) -#define RX_FRAME0_SEQ_NUM_MSB 14 -#define RX_FRAME0_SEQ_NUM_LSB 13 -#define RX_FRAME0_SEQ_NUM_MASK 0x00006000 -#define RX_FRAME0_SEQ_NUM_GET(x) (((x) & 0x00006000) >> 13) - -/* macros for RX_FRAME_0 */ -#define RX_FRAME_0_ADDRESS 0x00000004 -#define RX_FRAME_0_OFFSET 0x00000004 -#define RX_FRAME_0_ADDR_MSB 31 -#define RX_FRAME_0_ADDR_LSB 0 -#define RX_FRAME_0_ADDR_MASK 0xffffffff -#define RX_FRAME_0_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define RX_FRAME_0_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for RX_FRAME1 */ -#define RX_FRAME1_ADDRESS 0x00000008 -#define RX_FRAME1_OFFSET 0x00000008 -#define RX_FRAME1_OWN_MSB 0 -#define RX_FRAME1_OWN_LSB 0 -#define RX_FRAME1_OWN_MASK 0x00000001 -#define RX_FRAME1_OWN_GET(x) (((x) & 0x00000001) >> 0) -#define RX_FRAME1_OWN_SET(x) (((x) << 0) & 0x00000001) -#define RX_FRAME1_LEN_MSB 12 -#define RX_FRAME1_LEN_LSB 1 -#define RX_FRAME1_LEN_MASK 0x00001ffe -#define RX_FRAME1_LEN_GET(x) (((x) & 0x00001ffe) >> 1) -#define RX_FRAME1_SEQ_NUM_MSB 14 -#define RX_FRAME1_SEQ_NUM_LSB 13 -#define RX_FRAME1_SEQ_NUM_MASK 0x00006000 -#define RX_FRAME1_SEQ_NUM_GET(x) (((x) & 0x00006000) >> 13) - -/* macros for RX_FRAME_1 */ -#define RX_FRAME_1_ADDRESS 0x0000000c -#define RX_FRAME_1_OFFSET 0x0000000c -#define RX_FRAME_1_ADDR_MSB 31 -#define RX_FRAME_1_ADDR_LSB 0 -#define RX_FRAME_1_ADDR_MASK 0xffffffff -#define RX_FRAME_1_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define RX_FRAME_1_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MMAC_INTERRUPT_RAW */ -#define MMAC_INTERRUPT_RAW_ADDRESS 0x00000010 -#define MMAC_INTERRUPT_RAW_OFFSET 0x00000010 -#define MMAC_INTERRUPT_RAW_RX_DONE0_MSB 0 -#define MMAC_INTERRUPT_RAW_RX_DONE0_LSB 0 -#define MMAC_INTERRUPT_RAW_RX_DONE0_MASK 0x00000001 -#define MMAC_INTERRUPT_RAW_RX_DONE0_GET(x) (((x) & 0x00000001) >> 0) -#define MMAC_INTERRUPT_RAW_RX_DONE0_SET(x) (((x) << 0) & 0x00000001) -#define MMAC_INTERRUPT_RAW_RX_CRC_FAIL0_MSB 1 -#define MMAC_INTERRUPT_RAW_RX_CRC_FAIL0_LSB 1 -#define MMAC_INTERRUPT_RAW_RX_CRC_FAIL0_MASK 0x00000002 -#define MMAC_INTERRUPT_RAW_RX_CRC_FAIL0_GET(x) (((x) & 0x00000002) >> 1) -#define MMAC_INTERRUPT_RAW_RX_CRC_FAIL0_SET(x) (((x) << 1) & 0x00000002) -#define MMAC_INTERRUPT_RAW_ACK_RESP_FAIL0_MSB 2 -#define MMAC_INTERRUPT_RAW_ACK_RESP_FAIL0_LSB 2 -#define MMAC_INTERRUPT_RAW_ACK_RESP_FAIL0_MASK 0x00000004 -#define MMAC_INTERRUPT_RAW_ACK_RESP_FAIL0_GET(x) (((x) & 0x00000004) >> 2) -#define MMAC_INTERRUPT_RAW_ACK_RESP_FAIL0_SET(x) (((x) << 2) & 0x00000004) -#define MMAC_INTERRUPT_RAW_RX_DONE1_MSB 3 -#define MMAC_INTERRUPT_RAW_RX_DONE1_LSB 3 -#define MMAC_INTERRUPT_RAW_RX_DONE1_MASK 0x00000008 -#define MMAC_INTERRUPT_RAW_RX_DONE1_GET(x) (((x) & 0x00000008) >> 3) -#define MMAC_INTERRUPT_RAW_RX_DONE1_SET(x) (((x) << 3) & 0x00000008) -#define MMAC_INTERRUPT_RAW_RX_CRC_FAIL1_MSB 4 -#define MMAC_INTERRUPT_RAW_RX_CRC_FAIL1_LSB 4 -#define MMAC_INTERRUPT_RAW_RX_CRC_FAIL1_MASK 0x00000010 -#define MMAC_INTERRUPT_RAW_RX_CRC_FAIL1_GET(x) (((x) & 0x00000010) >> 4) -#define MMAC_INTERRUPT_RAW_RX_CRC_FAIL1_SET(x) (((x) << 4) & 0x00000010) -#define MMAC_INTERRUPT_RAW_ACK_RESP_FAIL1_MSB 5 -#define MMAC_INTERRUPT_RAW_ACK_RESP_FAIL1_LSB 5 -#define MMAC_INTERRUPT_RAW_ACK_RESP_FAIL1_MASK 0x00000020 -#define MMAC_INTERRUPT_RAW_ACK_RESP_FAIL1_GET(x) (((x) & 0x00000020) >> 5) -#define MMAC_INTERRUPT_RAW_ACK_RESP_FAIL1_SET(x) (((x) << 5) & 0x00000020) -#define MMAC_INTERRUPT_RAW_RX_ERR_OVERFLOW_MSB 6 -#define MMAC_INTERRUPT_RAW_RX_ERR_OVERFLOW_LSB 6 -#define MMAC_INTERRUPT_RAW_RX_ERR_OVERFLOW_MASK 0x00000040 -#define MMAC_INTERRUPT_RAW_RX_ERR_OVERFLOW_GET(x) (((x) & 0x00000040) >> 6) -#define MMAC_INTERRUPT_RAW_RX_ERR_OVERFLOW_SET(x) (((x) << 6) & 0x00000040) -#define MMAC_INTERRUPT_RAW_TX_DONE_MSB 7 -#define MMAC_INTERRUPT_RAW_TX_DONE_LSB 7 -#define MMAC_INTERRUPT_RAW_TX_DONE_MASK 0x00000080 -#define MMAC_INTERRUPT_RAW_TX_DONE_GET(x) (((x) & 0x00000080) >> 7) -#define MMAC_INTERRUPT_RAW_TX_DONE_SET(x) (((x) << 7) & 0x00000080) -#define MMAC_INTERRUPT_RAW_TX_DONE_ACK_MISSING_MSB 8 -#define MMAC_INTERRUPT_RAW_TX_DONE_ACK_MISSING_LSB 8 -#define MMAC_INTERRUPT_RAW_TX_DONE_ACK_MISSING_MASK 0x00000100 -#define MMAC_INTERRUPT_RAW_TX_DONE_ACK_MISSING_GET(x) (((x) & 0x00000100) >> 8) -#define MMAC_INTERRUPT_RAW_TX_DONE_ACK_MISSING_SET(x) (((x) << 8) & 0x00000100) -#define MMAC_INTERRUPT_RAW_TX_DONE_ACK_RECEIVED_MSB 9 -#define MMAC_INTERRUPT_RAW_TX_DONE_ACK_RECEIVED_LSB 9 -#define MMAC_INTERRUPT_RAW_TX_DONE_ACK_RECEIVED_MASK 0x00000200 -#define MMAC_INTERRUPT_RAW_TX_DONE_ACK_RECEIVED_GET(x) (((x) & 0x00000200) >> 9) -#define MMAC_INTERRUPT_RAW_TX_DONE_ACK_RECEIVED_SET(x) (((x) << 9) & 0x00000200) -#define MMAC_INTERRUPT_RAW_TX_ERROR_MSB 10 -#define MMAC_INTERRUPT_RAW_TX_ERROR_LSB 10 -#define MMAC_INTERRUPT_RAW_TX_ERROR_MASK 0x00000400 -#define MMAC_INTERRUPT_RAW_TX_ERROR_GET(x) (((x) & 0x00000400) >> 10) -#define MMAC_INTERRUPT_RAW_TX_ERROR_SET(x) (((x) << 10) & 0x00000400) - -/* macros for MMAC_INTERRUPT_EN */ -#define MMAC_INTERRUPT_EN_ADDRESS 0x00000014 -#define MMAC_INTERRUPT_EN_OFFSET 0x00000014 -#define MMAC_INTERRUPT_EN_RX_DONE0_MSB 0 -#define MMAC_INTERRUPT_EN_RX_DONE0_LSB 0 -#define MMAC_INTERRUPT_EN_RX_DONE0_MASK 0x00000001 -#define MMAC_INTERRUPT_EN_RX_DONE0_GET(x) (((x) & 0x00000001) >> 0) -#define MMAC_INTERRUPT_EN_RX_DONE0_SET(x) (((x) << 0) & 0x00000001) -#define MMAC_INTERRUPT_EN_RX_CRC_FAIL0_MSB 1 -#define MMAC_INTERRUPT_EN_RX_CRC_FAIL0_LSB 1 -#define MMAC_INTERRUPT_EN_RX_CRC_FAIL0_MASK 0x00000002 -#define MMAC_INTERRUPT_EN_RX_CRC_FAIL0_GET(x) (((x) & 0x00000002) >> 1) -#define MMAC_INTERRUPT_EN_RX_CRC_FAIL0_SET(x) (((x) << 1) & 0x00000002) -#define MMAC_INTERRUPT_EN_ACK_RESP_FAIL0_MSB 2 -#define MMAC_INTERRUPT_EN_ACK_RESP_FAIL0_LSB 2 -#define MMAC_INTERRUPT_EN_ACK_RESP_FAIL0_MASK 0x00000004 -#define MMAC_INTERRUPT_EN_ACK_RESP_FAIL0_GET(x) (((x) & 0x00000004) >> 2) -#define MMAC_INTERRUPT_EN_ACK_RESP_FAIL0_SET(x) (((x) << 2) & 0x00000004) -#define MMAC_INTERRUPT_EN_RX_DONE1_MSB 3 -#define MMAC_INTERRUPT_EN_RX_DONE1_LSB 3 -#define MMAC_INTERRUPT_EN_RX_DONE1_MASK 0x00000008 -#define MMAC_INTERRUPT_EN_RX_DONE1_GET(x) (((x) & 0x00000008) >> 3) -#define MMAC_INTERRUPT_EN_RX_DONE1_SET(x) (((x) << 3) & 0x00000008) -#define MMAC_INTERRUPT_EN_RX_CRC_FAIL1_MSB 4 -#define MMAC_INTERRUPT_EN_RX_CRC_FAIL1_LSB 4 -#define MMAC_INTERRUPT_EN_RX_CRC_FAIL1_MASK 0x00000010 -#define MMAC_INTERRUPT_EN_RX_CRC_FAIL1_GET(x) (((x) & 0x00000010) >> 4) -#define MMAC_INTERRUPT_EN_RX_CRC_FAIL1_SET(x) (((x) << 4) & 0x00000010) -#define MMAC_INTERRUPT_EN_ACK_RESP_FAIL1_MSB 5 -#define MMAC_INTERRUPT_EN_ACK_RESP_FAIL1_LSB 5 -#define MMAC_INTERRUPT_EN_ACK_RESP_FAIL1_MASK 0x00000020 -#define MMAC_INTERRUPT_EN_ACK_RESP_FAIL1_GET(x) (((x) & 0x00000020) >> 5) -#define MMAC_INTERRUPT_EN_ACK_RESP_FAIL1_SET(x) (((x) << 5) & 0x00000020) -#define MMAC_INTERRUPT_EN_RX_ERR_OVERFLOW_MSB 6 -#define MMAC_INTERRUPT_EN_RX_ERR_OVERFLOW_LSB 6 -#define MMAC_INTERRUPT_EN_RX_ERR_OVERFLOW_MASK 0x00000040 -#define MMAC_INTERRUPT_EN_RX_ERR_OVERFLOW_GET(x) (((x) & 0x00000040) >> 6) -#define MMAC_INTERRUPT_EN_RX_ERR_OVERFLOW_SET(x) (((x) << 6) & 0x00000040) -#define MMAC_INTERRUPT_EN_TX_DONE_MSB 7 -#define MMAC_INTERRUPT_EN_TX_DONE_LSB 7 -#define MMAC_INTERRUPT_EN_TX_DONE_MASK 0x00000080 -#define MMAC_INTERRUPT_EN_TX_DONE_GET(x) (((x) & 0x00000080) >> 7) -#define MMAC_INTERRUPT_EN_TX_DONE_SET(x) (((x) << 7) & 0x00000080) -#define MMAC_INTERRUPT_EN_TX_DONE_ACK_MISSING_MSB 8 -#define MMAC_INTERRUPT_EN_TX_DONE_ACK_MISSING_LSB 8 -#define MMAC_INTERRUPT_EN_TX_DONE_ACK_MISSING_MASK 0x00000100 -#define MMAC_INTERRUPT_EN_TX_DONE_ACK_MISSING_GET(x) (((x) & 0x00000100) >> 8) -#define MMAC_INTERRUPT_EN_TX_DONE_ACK_MISSING_SET(x) (((x) << 8) & 0x00000100) -#define MMAC_INTERRUPT_EN_TX_DONE_ACK_RECEIVED_MSB 9 -#define MMAC_INTERRUPT_EN_TX_DONE_ACK_RECEIVED_LSB 9 -#define MMAC_INTERRUPT_EN_TX_DONE_ACK_RECEIVED_MASK 0x00000200 -#define MMAC_INTERRUPT_EN_TX_DONE_ACK_RECEIVED_GET(x) (((x) & 0x00000200) >> 9) -#define MMAC_INTERRUPT_EN_TX_DONE_ACK_RECEIVED_SET(x) (((x) << 9) & 0x00000200) -#define MMAC_INTERRUPT_EN_TX_ERROR_MSB 10 -#define MMAC_INTERRUPT_EN_TX_ERROR_LSB 10 -#define MMAC_INTERRUPT_EN_TX_ERROR_MASK 0x00000400 -#define MMAC_INTERRUPT_EN_TX_ERROR_GET(x) (((x) & 0x00000400) >> 10) -#define MMAC_INTERRUPT_EN_TX_ERROR_SET(x) (((x) << 10) & 0x00000400) - -/* macros for RX_PARAM1 */ -#define RX_PARAM1_ADDRESS 0x00000018 -#define RX_PARAM1_OFFSET 0x00000018 -#define RX_PARAM1_VAP_ADDR_L_MSB 31 -#define RX_PARAM1_VAP_ADDR_L_LSB 0 -#define RX_PARAM1_VAP_ADDR_L_MASK 0xffffffff -#define RX_PARAM1_VAP_ADDR_L_GET(x) (((x) & 0xffffffff) >> 0) -#define RX_PARAM1_VAP_ADDR_L_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for RX_PARAM0 */ -#define RX_PARAM0_ADDRESS 0x0000001c -#define RX_PARAM0_OFFSET 0x0000001c -#define RX_PARAM0_VAP_ADDR_U_MSB 15 -#define RX_PARAM0_VAP_ADDR_U_LSB 0 -#define RX_PARAM0_VAP_ADDR_U_MASK 0x0000ffff -#define RX_PARAM0_VAP_ADDR_U_GET(x) (((x) & 0x0000ffff) >> 0) -#define RX_PARAM0_VAP_ADDR_U_SET(x) (((x) << 0) & 0x0000ffff) -#define RX_PARAM0_SIFS_MSB 21 -#define RX_PARAM0_SIFS_LSB 16 -#define RX_PARAM0_SIFS_MASK 0x003f0000 -#define RX_PARAM0_SIFS_GET(x) (((x) & 0x003f0000) >> 16) -#define RX_PARAM0_SIFS_SET(x) (((x) << 16) & 0x003f0000) -#define RX_PARAM0_CAPTURE_MODE_MSB 23 -#define RX_PARAM0_CAPTURE_MODE_LSB 22 -#define RX_PARAM0_CAPTURE_MODE_MASK 0x00c00000 -#define RX_PARAM0_CAPTURE_MODE_GET(x) (((x) & 0x00c00000) >> 22) -#define RX_PARAM0_CAPTURE_MODE_SET(x) (((x) << 22) & 0x00c00000) -#define RX_PARAM0_TYPE_FILTER_MSB 26 -#define RX_PARAM0_TYPE_FILTER_LSB 24 -#define RX_PARAM0_TYPE_FILTER_MASK 0x07000000 -#define RX_PARAM0_TYPE_FILTER_GET(x) (((x) & 0x07000000) >> 24) -#define RX_PARAM0_TYPE_FILTER_SET(x) (((x) << 24) & 0x07000000) -#define RX_PARAM0_LIVE_MODE_MSB 27 -#define RX_PARAM0_LIVE_MODE_LSB 27 -#define RX_PARAM0_LIVE_MODE_MASK 0x08000000 -#define RX_PARAM0_LIVE_MODE_GET(x) (((x) & 0x08000000) >> 27) -#define RX_PARAM0_LIVE_MODE_SET(x) (((x) << 27) & 0x08000000) - -/* macros for TX_COMMAND0 */ -#define TX_COMMAND0_ADDRESS 0x00000020 -#define TX_COMMAND0_OFFSET 0x00000020 -#define TX_COMMAND0_LEN_MSB 11 -#define TX_COMMAND0_LEN_LSB 0 -#define TX_COMMAND0_LEN_MASK 0x00000fff -#define TX_COMMAND0_LEN_GET(x) (((x) & 0x00000fff) >> 0) -#define TX_COMMAND0_LEN_SET(x) (((x) << 0) & 0x00000fff) -#define TX_COMMAND0_CRC_MSB 12 -#define TX_COMMAND0_CRC_LSB 12 -#define TX_COMMAND0_CRC_MASK 0x00001000 -#define TX_COMMAND0_CRC_GET(x) (((x) & 0x00001000) >> 12) -#define TX_COMMAND0_CRC_SET(x) (((x) << 12) & 0x00001000) -#define TX_COMMAND0_EXP_ACK_MSB 13 -#define TX_COMMAND0_EXP_ACK_LSB 13 -#define TX_COMMAND0_EXP_ACK_MASK 0x00002000 -#define TX_COMMAND0_EXP_ACK_GET(x) (((x) & 0x00002000) >> 13) -#define TX_COMMAND0_EXP_ACK_SET(x) (((x) << 13) & 0x00002000) - -/* macros for TX_COMMAND */ -#define TX_COMMAND_ADDRESS 0x00000024 -#define TX_COMMAND_OFFSET 0x00000024 -#define TX_COMMAND_ADDR_MSB 31 -#define TX_COMMAND_ADDR_LSB 0 -#define TX_COMMAND_ADDR_MASK 0xffffffff -#define TX_COMMAND_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define TX_COMMAND_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for TX_PARAM */ -#define TX_PARAM_ADDRESS 0x00000028 -#define TX_PARAM_OFFSET 0x00000028 -#define TX_PARAM_ACK_MODE_EN_MSB 0 -#define TX_PARAM_ACK_MODE_EN_LSB 0 -#define TX_PARAM_ACK_MODE_EN_MASK 0x00000001 -#define TX_PARAM_ACK_MODE_EN_GET(x) (((x) & 0x00000001) >> 0) -#define TX_PARAM_ACK_MODE_EN_SET(x) (((x) << 0) & 0x00000001) -#define TX_PARAM_ACK_TIMEOUT_MSB 6 -#define TX_PARAM_ACK_TIMEOUT_LSB 1 -#define TX_PARAM_ACK_TIMEOUT_MASK 0x0000007e -#define TX_PARAM_ACK_TIMEOUT_GET(x) (((x) & 0x0000007e) >> 1) -#define TX_PARAM_ACK_TIMEOUT_SET(x) (((x) << 1) & 0x0000007e) -#define TX_PARAM_BACKOFF_MSB 14 -#define TX_PARAM_BACKOFF_LSB 7 -#define TX_PARAM_BACKOFF_MASK 0x00007f80 -#define TX_PARAM_BACKOFF_GET(x) (((x) & 0x00007f80) >> 7) -#define TX_PARAM_BACKOFF_SET(x) (((x) << 7) & 0x00007f80) -#define TX_PARAM_FORCE_ACKF_RSSI_MSB 15 -#define TX_PARAM_FORCE_ACKF_RSSI_LSB 15 -#define TX_PARAM_FORCE_ACKF_RSSI_MASK 0x00008000 -#define TX_PARAM_FORCE_ACKF_RSSI_GET(x) (((x) & 0x00008000) >> 15) -#define TX_PARAM_FORCE_ACKF_RSSI_SET(x) (((x) << 15) & 0x00008000) -#define TX_PARAM_ACKF_RSSI_MSB 23 -#define TX_PARAM_ACKF_RSSI_LSB 16 -#define TX_PARAM_ACKF_RSSI_MASK 0x00ff0000 -#define TX_PARAM_ACKF_RSSI_GET(x) (((x) & 0x00ff0000) >> 16) -#define TX_PARAM_ACKF_RSSI_SET(x) (((x) << 16) & 0x00ff0000) - -/* macros for BEACON_PARAM */ -#define BEACON_PARAM_ADDRESS 0x0000002c -#define BEACON_PARAM_OFFSET 0x0000002c -#define BEACON_PARAM_INTERVAL_MSB 15 -#define BEACON_PARAM_INTERVAL_LSB 0 -#define BEACON_PARAM_INTERVAL_MASK 0x0000ffff -#define BEACON_PARAM_INTERVAL_GET(x) (((x) & 0x0000ffff) >> 0) -#define BEACON_PARAM_INTERVAL_SET(x) (((x) << 0) & 0x0000ffff) -#define BEACON_PARAM_LEN_MSB 27 -#define BEACON_PARAM_LEN_LSB 16 -#define BEACON_PARAM_LEN_MASK 0x0fff0000 -#define BEACON_PARAM_LEN_GET(x) (((x) & 0x0fff0000) >> 16) -#define BEACON_PARAM_LEN_SET(x) (((x) << 16) & 0x0fff0000) -#define BEACON_PARAM_EN_MSB 28 -#define BEACON_PARAM_EN_LSB 28 -#define BEACON_PARAM_EN_MASK 0x10000000 -#define BEACON_PARAM_EN_GET(x) (((x) & 0x10000000) >> 28) -#define BEACON_PARAM_EN_SET(x) (((x) << 28) & 0x10000000) -#define BEACON_PARAM_CRC_MSB 29 -#define BEACON_PARAM_CRC_LSB 29 -#define BEACON_PARAM_CRC_MASK 0x20000000 -#define BEACON_PARAM_CRC_GET(x) (((x) & 0x20000000) >> 29) -#define BEACON_PARAM_CRC_SET(x) (((x) << 29) & 0x20000000) -#define BEACON_PARAM_RESET_TS_MSB 30 -#define BEACON_PARAM_RESET_TS_LSB 30 -#define BEACON_PARAM_RESET_TS_MASK 0x40000000 -#define BEACON_PARAM_RESET_TS_GET(x) (((x) & 0x40000000) >> 30) -#define BEACON_PARAM_RESET_TS_SET(x) (((x) << 30) & 0x40000000) - -/* macros for BEACON */ -#define BEACON_ADDRESS 0x00000030 -#define BEACON_OFFSET 0x00000030 -#define BEACON_ADDR_MSB 31 -#define BEACON_ADDR_LSB 0 -#define BEACON_ADDR_MASK 0xffffffff -#define BEACON_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define BEACON_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for TSF_L */ -#define TSF_L_ADDRESS 0x00000034 -#define TSF_L_OFFSET 0x00000034 -#define TSF_L_COUNT_MSB 31 -#define TSF_L_COUNT_LSB 0 -#define TSF_L_COUNT_MASK 0xffffffff -#define TSF_L_COUNT_GET(x) (((x) & 0xffffffff) >> 0) -#define TSF_L_COUNT_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for TSF_U */ -#define TSF_U_ADDRESS 0x00000038 -#define TSF_U_OFFSET 0x00000038 -#define TSF_U_COUNT_MSB 31 -#define TSF_U_COUNT_LSB 0 -#define TSF_U_COUNT_MASK 0xffffffff -#define TSF_U_COUNT_GET(x) (((x) & 0xffffffff) >> 0) -#define TSF_U_COUNT_SET(x) (((x) << 0) & 0xffffffff) - - -#ifndef __ASSEMBLER__ - -typedef struct mmac_reg_reg_s { - volatile unsigned int RX_FRAME0; /* 0x0 - 0x4 */ - volatile unsigned int RX_FRAME_0; /* 0x4 - 0x8 */ - volatile unsigned int RX_FRAME1; /* 0x8 - 0xc */ - volatile unsigned int RX_FRAME_1; /* 0xc - 0x10 */ - volatile unsigned int MMAC_INTERRUPT_RAW; /* 0x10 - 0x14 */ - volatile unsigned int MMAC_INTERRUPT_EN; /* 0x14 - 0x18 */ - volatile unsigned int RX_PARAM1; /* 0x18 - 0x1c */ - volatile unsigned int RX_PARAM0; /* 0x1c - 0x20 */ - volatile unsigned int TX_COMMAND0; /* 0x20 - 0x24 */ - volatile unsigned int TX_COMMAND; /* 0x24 - 0x28 */ - volatile unsigned int TX_PARAM; /* 0x28 - 0x2c */ - volatile unsigned int BEACON_PARAM; /* 0x2c - 0x30 */ - volatile unsigned int BEACON; /* 0x30 - 0x34 */ - volatile unsigned int TSF_L; /* 0x34 - 0x38 */ - volatile unsigned int TSF_U; /* 0x38 - 0x3c */ -} mmac_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _MMAC_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/odin_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/odin_reg.h deleted file mode 100644 index f9af9bff29c8..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/odin_reg.h +++ /dev/null @@ -1,397 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _ODIN_REG_REG_H_ -#define _ODIN_REG_REG_H_ - - -/* macros for PHY_CTRL0 */ -#define PHY_CTRL0_ADDRESS 0x00000000 -#define PHY_CTRL0_OFFSET 0x00000000 -#define PHY_CTRL0_PLL_ICP_MSB 2 -#define PHY_CTRL0_PLL_ICP_LSB 0 -#define PHY_CTRL0_PLL_ICP_MASK 0x00000007 -#define PHY_CTRL0_PLL_ICP_GET(x) (((x) & 0x00000007) >> 0) -#define PHY_CTRL0_PLL_ICP_SET(x) (((x) << 0) & 0x00000007) -#define PHY_CTRL0_PLL_RS_MSB 5 -#define PHY_CTRL0_PLL_RS_LSB 3 -#define PHY_CTRL0_PLL_RS_MASK 0x00000038 -#define PHY_CTRL0_PLL_RS_GET(x) (((x) & 0x00000038) >> 3) -#define PHY_CTRL0_PLL_RS_SET(x) (((x) << 3) & 0x00000038) -#define PHY_CTRL0_PLL_DIV_MSB 14 -#define PHY_CTRL0_PLL_DIV_LSB 6 -#define PHY_CTRL0_PLL_DIV_MASK 0x00007fc0 -#define PHY_CTRL0_PLL_DIV_GET(x) (((x) & 0x00007fc0) >> 6) -#define PHY_CTRL0_PLL_DIV_SET(x) (((x) << 6) & 0x00007fc0) -#define PHY_CTRL0_PLL_MOD_MSB 17 -#define PHY_CTRL0_PLL_MOD_LSB 15 -#define PHY_CTRL0_PLL_MOD_MASK 0x00038000 -#define PHY_CTRL0_PLL_MOD_GET(x) (((x) & 0x00038000) >> 15) -#define PHY_CTRL0_PLL_MOD_SET(x) (((x) << 15) & 0x00038000) -#define PHY_CTRL0_PLL_OVERIDE_MSB 18 -#define PHY_CTRL0_PLL_OVERIDE_LSB 18 -#define PHY_CTRL0_PLL_OVERIDE_MASK 0x00040000 -#define PHY_CTRL0_PLL_OVERIDE_GET(x) (((x) & 0x00040000) >> 18) -#define PHY_CTRL0_PLL_OVERIDE_SET(x) (((x) << 18) & 0x00040000) -#define PHY_CTRL0_TEST_SPEED_SELECT_MSB 19 -#define PHY_CTRL0_TEST_SPEED_SELECT_LSB 19 -#define PHY_CTRL0_TEST_SPEED_SELECT_MASK 0x00080000 -#define PHY_CTRL0_TEST_SPEED_SELECT_GET(x) (((x) & 0x00080000) >> 19) -#define PHY_CTRL0_TEST_SPEED_SELECT_SET(x) (((x) << 19) & 0x00080000) -#define PHY_CTRL0_RX_PATTERN_EN_MSB 20 -#define PHY_CTRL0_RX_PATTERN_EN_LSB 20 -#define PHY_CTRL0_RX_PATTERN_EN_MASK 0x00100000 -#define PHY_CTRL0_RX_PATTERN_EN_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_CTRL0_RX_PATTERN_EN_SET(x) (((x) << 20) & 0x00100000) -#define PHY_CTRL0_TX_PATTERN_EN_MSB 21 -#define PHY_CTRL0_TX_PATTERN_EN_LSB 21 -#define PHY_CTRL0_TX_PATTERN_EN_MASK 0x00200000 -#define PHY_CTRL0_TX_PATTERN_EN_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_CTRL0_TX_PATTERN_EN_SET(x) (((x) << 21) & 0x00200000) -#define PHY_CTRL0_ANA_LOOPBACK_EN_MSB 22 -#define PHY_CTRL0_ANA_LOOPBACK_EN_LSB 22 -#define PHY_CTRL0_ANA_LOOPBACK_EN_MASK 0x00400000 -#define PHY_CTRL0_ANA_LOOPBACK_EN_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_CTRL0_ANA_LOOPBACK_EN_SET(x) (((x) << 22) & 0x00400000) -#define PHY_CTRL0_DIG_LOOPBACK_EN_MSB 23 -#define PHY_CTRL0_DIG_LOOPBACK_EN_LSB 23 -#define PHY_CTRL0_DIG_LOOPBACK_EN_MASK 0x00800000 -#define PHY_CTRL0_DIG_LOOPBACK_EN_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_CTRL0_DIG_LOOPBACK_EN_SET(x) (((x) << 23) & 0x00800000) -#define PHY_CTRL0_LOOPBACK_ERR_CNT_MSB 31 -#define PHY_CTRL0_LOOPBACK_ERR_CNT_LSB 24 -#define PHY_CTRL0_LOOPBACK_ERR_CNT_MASK 0xff000000 -#define PHY_CTRL0_LOOPBACK_ERR_CNT_GET(x) (((x) & 0xff000000) >> 24) - -/* macros for PHY_CTRL1 */ -#define PHY_CTRL1_ADDRESS 0x00000004 -#define PHY_CTRL1_OFFSET 0x00000004 -#define PHY_CTRL1_RX_FILBW_SEL_MSB 1 -#define PHY_CTRL1_RX_FILBW_SEL_LSB 0 -#define PHY_CTRL1_RX_FILBW_SEL_MASK 0x00000003 -#define PHY_CTRL1_RX_FILBW_SEL_GET(x) (((x) & 0x00000003) >> 0) -#define PHY_CTRL1_RX_FILBW_SEL_SET(x) (((x) << 0) & 0x00000003) -#define PHY_CTRL1_RX_FORCERXON_MSB 2 -#define PHY_CTRL1_RX_FORCERXON_LSB 2 -#define PHY_CTRL1_RX_FORCERXON_MASK 0x00000004 -#define PHY_CTRL1_RX_FORCERXON_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_CTRL1_RX_FORCERXON_SET(x) (((x) << 2) & 0x00000004) -#define PHY_CTRL1_RX_BYPASSEQ_MSB 3 -#define PHY_CTRL1_RX_BYPASSEQ_LSB 3 -#define PHY_CTRL1_RX_BYPASSEQ_MASK 0x00000008 -#define PHY_CTRL1_RX_BYPASSEQ_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_CTRL1_RX_BYPASSEQ_SET(x) (((x) << 3) & 0x00000008) -#define PHY_CTRL1_RX_LOWR_PDET_MSB 4 -#define PHY_CTRL1_RX_LOWR_PDET_LSB 4 -#define PHY_CTRL1_RX_LOWR_PDET_MASK 0x00000010 -#define PHY_CTRL1_RX_LOWR_PDET_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_CTRL1_RX_LOWR_PDET_SET(x) (((x) << 4) & 0x00000010) -#define PHY_CTRL1_RX_SELIR_100M_MSB 6 -#define PHY_CTRL1_RX_SELIR_100M_LSB 5 -#define PHY_CTRL1_RX_SELIR_100M_MASK 0x00000060 -#define PHY_CTRL1_RX_SELIR_100M_GET(x) (((x) & 0x00000060) >> 5) -#define PHY_CTRL1_RX_SELIR_100M_SET(x) (((x) << 5) & 0x00000060) -#define PHY_CTRL1_RX_SELVREF0P6_MSB 7 -#define PHY_CTRL1_RX_SELVREF0P6_LSB 7 -#define PHY_CTRL1_RX_SELVREF0P6_MASK 0x00000080 -#define PHY_CTRL1_RX_SELVREF0P6_GET(x) (((x) & 0x00000080) >> 7) -#define PHY_CTRL1_RX_SELVREF0P6_SET(x) (((x) << 7) & 0x00000080) -#define PHY_CTRL1_RX_SELVREF0P25_MSB 8 -#define PHY_CTRL1_RX_SELVREF0P25_LSB 8 -#define PHY_CTRL1_RX_SELVREF0P25_MASK 0x00000100 -#define PHY_CTRL1_RX_SELVREF0P25_GET(x) (((x) & 0x00000100) >> 8) -#define PHY_CTRL1_RX_SELVREF0P25_SET(x) (((x) << 8) & 0x00000100) -#define PHY_CTRL1_RX_RSVD_MSB 11 -#define PHY_CTRL1_RX_RSVD_LSB 9 -#define PHY_CTRL1_RX_RSVD_MASK 0x00000e00 -#define PHY_CTRL1_RX_RSVD_GET(x) (((x) & 0x00000e00) >> 9) -#define PHY_CTRL1_RX_RSVD_SET(x) (((x) << 9) & 0x00000e00) -#define PHY_CTRL1_NO_PLL_PWD_MSB 12 -#define PHY_CTRL1_NO_PLL_PWD_LSB 12 -#define PHY_CTRL1_NO_PLL_PWD_MASK 0x00001000 -#define PHY_CTRL1_NO_PLL_PWD_GET(x) (((x) & 0x00001000) >> 12) -#define PHY_CTRL1_NO_PLL_PWD_SET(x) (((x) << 12) & 0x00001000) -#define PHY_CTRL1_FORCE_SUSPEND_MSB 13 -#define PHY_CTRL1_FORCE_SUSPEND_LSB 13 -#define PHY_CTRL1_FORCE_SUSPEND_MASK 0x00002000 -#define PHY_CTRL1_FORCE_SUSPEND_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_CTRL1_FORCE_SUSPEND_SET(x) (((x) << 13) & 0x00002000) -#define PHY_CTRL1_TX_PATTERN_SEL_MSB 19 -#define PHY_CTRL1_TX_PATTERN_SEL_LSB 18 -#define PHY_CTRL1_TX_PATTERN_SEL_MASK 0x000c0000 -#define PHY_CTRL1_TX_PATTERN_SEL_GET(x) (((x) & 0x000c0000) >> 18) -#define PHY_CTRL1_TX_PATTERN_SEL_SET(x) (((x) << 18) & 0x000c0000) -#define PHY_CTRL1_USE_PLL_LOCKDETECT_MSB 20 -#define PHY_CTRL1_USE_PLL_LOCKDETECT_LSB 20 -#define PHY_CTRL1_USE_PLL_LOCKDETECT_MASK 0x00100000 -#define PHY_CTRL1_USE_PLL_LOCKDETECT_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_CTRL1_USE_PLL_LOCKDETECT_SET(x) (((x) << 20) & 0x00100000) -#define PHY_CTRL1_USE_PLL_LOCK_DLY_SEL_MSB 22 -#define PHY_CTRL1_USE_PLL_LOCK_DLY_SEL_LSB 21 -#define PHY_CTRL1_USE_PLL_LOCK_DLY_SEL_MASK 0x00600000 -#define PHY_CTRL1_USE_PLL_LOCK_DLY_SEL_GET(x) (((x) & 0x00600000) >> 21) -#define PHY_CTRL1_USE_PLL_LOCK_DLY_SEL_SET(x) (((x) << 21) & 0x00600000) -#define PHY_CTRL1_CLKOBS_SEL_MSB 25 -#define PHY_CTRL1_CLKOBS_SEL_LSB 23 -#define PHY_CTRL1_CLKOBS_SEL_MASK 0x03800000 -#define PHY_CTRL1_CLKOBS_SEL_GET(x) (((x) & 0x03800000) >> 23) -#define PHY_CTRL1_CLKOBS_SEL_SET(x) (((x) << 23) & 0x03800000) -#define PHY_CTRL1_ENABLE_REFCLK_GATE_MSB 26 -#define PHY_CTRL1_ENABLE_REFCLK_GATE_LSB 26 -#define PHY_CTRL1_ENABLE_REFCLK_GATE_MASK 0x04000000 -#define PHY_CTRL1_ENABLE_REFCLK_GATE_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_CTRL1_ENABLE_REFCLK_GATE_SET(x) (((x) << 26) & 0x04000000) -#define PHY_CTRL1_DISABLE_CLK_GATING_MSB 27 -#define PHY_CTRL1_DISABLE_CLK_GATING_LSB 27 -#define PHY_CTRL1_DISABLE_CLK_GATING_MASK 0x08000000 -#define PHY_CTRL1_DISABLE_CLK_GATING_GET(x) (((x) & 0x08000000) >> 27) -#define PHY_CTRL1_DISABLE_CLK_GATING_SET(x) (((x) << 27) & 0x08000000) -#define PHY_CTRL1_PLL_OBS_MODE_N_MSB 31 -#define PHY_CTRL1_PLL_OBS_MODE_N_LSB 31 -#define PHY_CTRL1_PLL_OBS_MODE_N_MASK 0x80000000 -#define PHY_CTRL1_PLL_OBS_MODE_N_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_CTRL1_PLL_OBS_MODE_N_SET(x) (((x) << 31) & 0x80000000) - -/* macros for PHY_CTRL2 */ -#define PHY_CTRL2_ADDRESS 0x00000008 -#define PHY_CTRL2_OFFSET 0x00000008 -#define PHY_CTRL2_HSTXBIAS_PS_EN_MSB 0 -#define PHY_CTRL2_HSTXBIAS_PS_EN_LSB 0 -#define PHY_CTRL2_HSTXBIAS_PS_EN_MASK 0x00000001 -#define PHY_CTRL2_HSTXBIAS_PS_EN_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_CTRL2_HSTXBIAS_PS_EN_SET(x) (((x) << 0) & 0x00000001) -#define PHY_CTRL2_HSRXPHASE_PS_EN_MSB 1 -#define PHY_CTRL2_HSRXPHASE_PS_EN_LSB 1 -#define PHY_CTRL2_HSRXPHASE_PS_EN_MASK 0x00000002 -#define PHY_CTRL2_HSRXPHASE_PS_EN_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_CTRL2_HSRXPHASE_PS_EN_SET(x) (((x) << 1) & 0x00000002) -#define PHY_CTRL2_PWD_IPLL_MSB 7 -#define PHY_CTRL2_PWD_IPLL_LSB 2 -#define PHY_CTRL2_PWD_IPLL_MASK 0x000000fc -#define PHY_CTRL2_PWD_IPLL_GET(x) (((x) & 0x000000fc) >> 2) -#define PHY_CTRL2_PWD_IPLL_SET(x) (((x) << 2) & 0x000000fc) -#define PHY_CTRL2_PWD_ISP_MSB 13 -#define PHY_CTRL2_PWD_ISP_LSB 8 -#define PHY_CTRL2_PWD_ISP_MASK 0x00003f00 -#define PHY_CTRL2_PWD_ISP_GET(x) (((x) & 0x00003f00) >> 8) -#define PHY_CTRL2_PWD_ISP_SET(x) (((x) << 8) & 0x00003f00) -#define PHY_CTRL2_TX_CAL_EN_MSB 20 -#define PHY_CTRL2_TX_CAL_EN_LSB 20 -#define PHY_CTRL2_TX_CAL_EN_MASK 0x00100000 -#define PHY_CTRL2_TX_CAL_EN_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_CTRL2_TX_CAL_EN_SET(x) (((x) << 20) & 0x00100000) -#define PHY_CTRL2_TX_CAL_SEL_MSB 21 -#define PHY_CTRL2_TX_CAL_SEL_LSB 21 -#define PHY_CTRL2_TX_CAL_SEL_MASK 0x00200000 -#define PHY_CTRL2_TX_CAL_SEL_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_CTRL2_TX_CAL_SEL_SET(x) (((x) << 21) & 0x00200000) -#define PHY_CTRL2_TX_MAN_CAL_MSB 25 -#define PHY_CTRL2_TX_MAN_CAL_LSB 22 -#define PHY_CTRL2_TX_MAN_CAL_MASK 0x03c00000 -#define PHY_CTRL2_TX_MAN_CAL_GET(x) (((x) & 0x03c00000) >> 22) -#define PHY_CTRL2_TX_MAN_CAL_SET(x) (((x) << 22) & 0x03c00000) -#define PHY_CTRL2_TX_LCKDET_OVR_MSB 26 -#define PHY_CTRL2_TX_LCKDET_OVR_LSB 26 -#define PHY_CTRL2_TX_LCKDET_OVR_MASK 0x04000000 -#define PHY_CTRL2_TX_LCKDET_OVR_GET(x) (((x) & 0x04000000) >> 26) -#define PHY_CTRL2_TX_LCKDET_OVR_SET(x) (((x) << 26) & 0x04000000) -#define PHY_CTRL2_TX_RSVD_MSB 30 -#define PHY_CTRL2_TX_RSVD_LSB 27 -#define PHY_CTRL2_TX_RSVD_MASK 0x78000000 -#define PHY_CTRL2_TX_RSVD_GET(x) (((x) & 0x78000000) >> 27) -#define PHY_CTRL2_TX_RSVD_SET(x) (((x) << 27) & 0x78000000) -#define PHY_CTRL2_PWD_EXTBIAS_MSB 31 -#define PHY_CTRL2_PWD_EXTBIAS_LSB 31 -#define PHY_CTRL2_PWD_EXTBIAS_MASK 0x80000000 -#define PHY_CTRL2_PWD_EXTBIAS_GET(x) (((x) & 0x80000000) >> 31) -#define PHY_CTRL2_PWD_EXTBIAS_SET(x) (((x) << 31) & 0x80000000) - -/* macros for PHY_CTRL3 */ -#define PHY_CTRL3_ADDRESS 0x0000000c -#define PHY_CTRL3_OFFSET 0x0000000c -#define PHY_CTRL3_PWD_ITX_MSB 18 -#define PHY_CTRL3_PWD_ITX_LSB 0 -#define PHY_CTRL3_PWD_ITX_MASK 0x0007ffff -#define PHY_CTRL3_PWD_ITX_GET(x) (((x) & 0x0007ffff) >> 0) -#define PHY_CTRL3_PWD_ITX_SET(x) (((x) << 0) & 0x0007ffff) -#define PHY_CTRL3_TX_DISABLE_SHORT_DET_MSB 21 -#define PHY_CTRL3_TX_DISABLE_SHORT_DET_LSB 21 -#define PHY_CTRL3_TX_DISABLE_SHORT_DET_MASK 0x00200000 -#define PHY_CTRL3_TX_DISABLE_SHORT_DET_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_CTRL3_TX_DISABLE_SHORT_DET_SET(x) (((x) << 21) & 0x00200000) -#define PHY_CTRL3_TX_SELTEST_MSB 24 -#define PHY_CTRL3_TX_SELTEST_LSB 22 -#define PHY_CTRL3_TX_SELTEST_MASK 0x01c00000 -#define PHY_CTRL3_TX_SELTEST_GET(x) (((x) & 0x01c00000) >> 22) -#define PHY_CTRL3_TX_SELTEST_SET(x) (((x) << 22) & 0x01c00000) -#define PHY_CTRL3_TX_STARTCAL_MSB 25 -#define PHY_CTRL3_TX_STARTCAL_LSB 25 -#define PHY_CTRL3_TX_STARTCAL_MASK 0x02000000 -#define PHY_CTRL3_TX_STARTCAL_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_CTRL3_TX_STARTCAL_SET(x) (((x) << 25) & 0x02000000) - -/* macros for PHY_CTRL4 */ -#define PHY_CTRL4_ADDRESS 0x00000010 -#define PHY_CTRL4_OFFSET 0x00000010 -#define PHY_CTRL4_PWD_IRX_MSB 11 -#define PHY_CTRL4_PWD_IRX_LSB 0 -#define PHY_CTRL4_PWD_IRX_MASK 0x00000fff -#define PHY_CTRL4_PWD_IRX_GET(x) (((x) & 0x00000fff) >> 0) -#define PHY_CTRL4_PWD_IRX_SET(x) (((x) << 0) & 0x00000fff) - -/* macros for PHY_CTRL5 */ -#define PHY_CTRL5_ADDRESS 0x00000014 -#define PHY_CTRL5_OFFSET 0x00000014 -#define PHY_CTRL5_TX_BIAS_DELAY_MSB 6 -#define PHY_CTRL5_TX_BIAS_DELAY_LSB 0 -#define PHY_CTRL5_TX_BIAS_DELAY_MASK 0x0000007f -#define PHY_CTRL5_TX_BIAS_DELAY_GET(x) (((x) & 0x0000007f) >> 0) -#define PHY_CTRL5_TX_BIAS_DELAY_SET(x) (((x) << 0) & 0x0000007f) -#define PHY_CTRL5_EB_WATERMARK_MSB 12 -#define PHY_CTRL5_EB_WATERMARK_LSB 7 -#define PHY_CTRL5_EB_WATERMARK_MASK 0x00001f80 -#define PHY_CTRL5_EB_WATERMARK_GET(x) (((x) & 0x00001f80) >> 7) -#define PHY_CTRL5_EB_WATERMARK_SET(x) (((x) << 7) & 0x00001f80) -#define PHY_CTRL5_FORCE_IDDQ_MSB 13 -#define PHY_CTRL5_FORCE_IDDQ_LSB 13 -#define PHY_CTRL5_FORCE_IDDQ_MASK 0x00002000 -#define PHY_CTRL5_FORCE_IDDQ_GET(x) (((x) & 0x00002000) >> 13) -#define PHY_CTRL5_FORCE_IDDQ_SET(x) (((x) << 13) & 0x00002000) -#define PHY_CTRL5_FORCE_TEST_J_MSB 14 -#define PHY_CTRL5_FORCE_TEST_J_LSB 14 -#define PHY_CTRL5_FORCE_TEST_J_MASK 0x00004000 -#define PHY_CTRL5_FORCE_TEST_J_GET(x) (((x) & 0x00004000) >> 14) -#define PHY_CTRL5_FORCE_TEST_J_SET(x) (((x) << 14) & 0x00004000) -#define PHY_CTRL5_FORCE_TEST_K_MSB 15 -#define PHY_CTRL5_FORCE_TEST_K_LSB 15 -#define PHY_CTRL5_FORCE_TEST_K_MASK 0x00008000 -#define PHY_CTRL5_FORCE_TEST_K_GET(x) (((x) & 0x00008000) >> 15) -#define PHY_CTRL5_FORCE_TEST_K_SET(x) (((x) << 15) & 0x00008000) -#define PHY_CTRL5_FORCE_TEST_SE0_NAK_MSB 16 -#define PHY_CTRL5_FORCE_TEST_SE0_NAK_LSB 16 -#define PHY_CTRL5_FORCE_TEST_SE0_NAK_MASK 0x00010000 -#define PHY_CTRL5_FORCE_TEST_SE0_NAK_GET(x) (((x) & 0x00010000) >> 16) -#define PHY_CTRL5_FORCE_TEST_SE0_NAK_SET(x) (((x) << 16) & 0x00010000) -#define PHY_CTRL5_TEST_JK_OVERRIDE_MSB 17 -#define PHY_CTRL5_TEST_JK_OVERRIDE_LSB 17 -#define PHY_CTRL5_TEST_JK_OVERRIDE_MASK 0x00020000 -#define PHY_CTRL5_TEST_JK_OVERRIDE_GET(x) (((x) & 0x00020000) >> 17) -#define PHY_CTRL5_TEST_JK_OVERRIDE_SET(x) (((x) << 17) & 0x00020000) -#define PHY_CTRL5_XCVR_SEL_MSB 19 -#define PHY_CTRL5_XCVR_SEL_LSB 18 -#define PHY_CTRL5_XCVR_SEL_MASK 0x000c0000 -#define PHY_CTRL5_XCVR_SEL_GET(x) (((x) & 0x000c0000) >> 18) -#define PHY_CTRL5_XCVR_SEL_SET(x) (((x) << 18) & 0x000c0000) -#define PHY_CTRL5_TERM_SEL_MSB 20 -#define PHY_CTRL5_TERM_SEL_LSB 20 -#define PHY_CTRL5_TERM_SEL_MASK 0x00100000 -#define PHY_CTRL5_TERM_SEL_GET(x) (((x) & 0x00100000) >> 20) -#define PHY_CTRL5_TERM_SEL_SET(x) (((x) << 20) & 0x00100000) -#define PHY_CTRL5_SUSPEND_N_MSB 21 -#define PHY_CTRL5_SUSPEND_N_LSB 21 -#define PHY_CTRL5_SUSPEND_N_MASK 0x00200000 -#define PHY_CTRL5_SUSPEND_N_GET(x) (((x) & 0x00200000) >> 21) -#define PHY_CTRL5_SUSPEND_N_SET(x) (((x) << 21) & 0x00200000) -#define PHY_CTRL5_DP_PULLDOWN_MSB 22 -#define PHY_CTRL5_DP_PULLDOWN_LSB 22 -#define PHY_CTRL5_DP_PULLDOWN_MASK 0x00400000 -#define PHY_CTRL5_DP_PULLDOWN_GET(x) (((x) & 0x00400000) >> 22) -#define PHY_CTRL5_DP_PULLDOWN_SET(x) (((x) << 22) & 0x00400000) -#define PHY_CTRL5_DM_PULLDOWN_MSB 23 -#define PHY_CTRL5_DM_PULLDOWN_LSB 23 -#define PHY_CTRL5_DM_PULLDOWN_MASK 0x00800000 -#define PHY_CTRL5_DM_PULLDOWN_GET(x) (((x) & 0x00800000) >> 23) -#define PHY_CTRL5_DM_PULLDOWN_SET(x) (((x) << 23) & 0x00800000) -#define PHY_CTRL5_HOST_DISCON_FIX_ON_MSB 24 -#define PHY_CTRL5_HOST_DISCON_FIX_ON_LSB 24 -#define PHY_CTRL5_HOST_DISCON_FIX_ON_MASK 0x01000000 -#define PHY_CTRL5_HOST_DISCON_FIX_ON_GET(x) (((x) & 0x01000000) >> 24) -#define PHY_CTRL5_HOST_DISCON_FIX_ON_SET(x) (((x) << 24) & 0x01000000) -#define PHY_CTRL5_HOST_DISCON_DETECT_ON_MSB 25 -#define PHY_CTRL5_HOST_DISCON_DETECT_ON_LSB 25 -#define PHY_CTRL5_HOST_DISCON_DETECT_ON_MASK 0x02000000 -#define PHY_CTRL5_HOST_DISCON_DETECT_ON_GET(x) (((x) & 0x02000000) >> 25) -#define PHY_CTRL5_HOST_DISCON_DETECT_ON_SET(x) (((x) << 25) & 0x02000000) -#define PHY_CTRL5_HOST_DISCON_SAMPLE_WIDTH_MSB 28 -#define PHY_CTRL5_HOST_DISCON_SAMPLE_WIDTH_LSB 26 -#define PHY_CTRL5_HOST_DISCON_SAMPLE_WIDTH_MASK 0x1c000000 -#define PHY_CTRL5_HOST_DISCON_SAMPLE_WIDTH_GET(x) (((x) & 0x1c000000) >> 26) -#define PHY_CTRL5_HOST_DISCON_SAMPLE_WIDTH_SET(x) (((x) << 26) & 0x1c000000) - -/* macros for PHY_CTRL6 */ -#define PHY_CTRL6_ADDRESS 0x00000018 -#define PHY_CTRL6_OFFSET 0x00000018 -#define PHY_CTRL6_AVALID_MSB 0 -#define PHY_CTRL6_AVALID_LSB 0 -#define PHY_CTRL6_AVALID_MASK 0x00000001 -#define PHY_CTRL6_AVALID_GET(x) (((x) & 0x00000001) >> 0) -#define PHY_CTRL6_AVALID_SET(x) (((x) << 0) & 0x00000001) -#define PHY_CTRL6_BVALID_MSB 1 -#define PHY_CTRL6_BVALID_LSB 1 -#define PHY_CTRL6_BVALID_MASK 0x00000002 -#define PHY_CTRL6_BVALID_GET(x) (((x) & 0x00000002) >> 1) -#define PHY_CTRL6_BVALID_SET(x) (((x) << 1) & 0x00000002) -#define PHY_CTRL6_VBUSVALID_MSB 2 -#define PHY_CTRL6_VBUSVALID_LSB 2 -#define PHY_CTRL6_VBUSVALID_MASK 0x00000004 -#define PHY_CTRL6_VBUSVALID_GET(x) (((x) & 0x00000004) >> 2) -#define PHY_CTRL6_VBUSVALID_SET(x) (((x) << 2) & 0x00000004) -#define PHY_CTRL6_SESSEND_MSB 3 -#define PHY_CTRL6_SESSEND_LSB 3 -#define PHY_CTRL6_SESSEND_MASK 0x00000008 -#define PHY_CTRL6_SESSEND_GET(x) (((x) & 0x00000008) >> 3) -#define PHY_CTRL6_SESSEND_SET(x) (((x) << 3) & 0x00000008) -#define PHY_CTRL6_IDDIG_MSB 4 -#define PHY_CTRL6_IDDIG_LSB 4 -#define PHY_CTRL6_IDDIG_MASK 0x00000010 -#define PHY_CTRL6_IDDIG_GET(x) (((x) & 0x00000010) >> 4) -#define PHY_CTRL6_IDDIG_SET(x) (((x) << 4) & 0x00000010) - -/* macros for PHY_STATUS */ -#define PHY_STATUS_ADDRESS 0x0000001c -#define PHY_STATUS_OFFSET 0x0000001c -#define PHY_STATUS_TX_CAL_MSB 3 -#define PHY_STATUS_TX_CAL_LSB 0 -#define PHY_STATUS_TX_CAL_MASK 0x0000000f -#define PHY_STATUS_TX_CAL_GET(x) (((x) & 0x0000000f) >> 0) - - -#ifndef __ASSEMBLER__ - -typedef struct odin_reg_reg_s { - volatile unsigned int PHY_CTRL0; /* 0x0 - 0x4 */ - volatile unsigned int PHY_CTRL1; /* 0x4 - 0x8 */ - volatile unsigned int PHY_CTRL2; /* 0x8 - 0xc */ - volatile unsigned int PHY_CTRL3; /* 0xc - 0x10 */ - volatile unsigned int PHY_CTRL4; /* 0x10 - 0x14 */ - volatile unsigned int PHY_CTRL5; /* 0x14 - 0x18 */ - volatile unsigned int PHY_CTRL6; /* 0x18 - 0x1c */ - volatile unsigned int PHY_STATUS; /* 0x1c - 0x20 */ -} odin_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _ODIN_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rdma_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rdma_reg.h deleted file mode 100644 index f21e8878ed3f..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rdma_reg.h +++ /dev/null @@ -1,948 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _RDMA_REG_REG_H_ -#define _RDMA_REG_REG_H_ - -#define DMA_CONFIG_ADDRESS 0x00000000 -#define DMA_CONFIG_OFFSET 0x00000000 -#define DMA_CONFIG_WLBB_PWD_EN_MSB 4 -#define DMA_CONFIG_WLBB_PWD_EN_LSB 4 -#define DMA_CONFIG_WLBB_PWD_EN_MASK 0x00000010 -#define DMA_CONFIG_WLBB_PWD_EN_GET(x) (((x) & DMA_CONFIG_WLBB_PWD_EN_MASK) >> DMA_CONFIG_WLBB_PWD_EN_LSB) -#define DMA_CONFIG_WLBB_PWD_EN_SET(x) (((x) << DMA_CONFIG_WLBB_PWD_EN_LSB) & DMA_CONFIG_WLBB_PWD_EN_MASK) -#define DMA_CONFIG_WLMAC_PWD_EN_MSB 3 -#define DMA_CONFIG_WLMAC_PWD_EN_LSB 3 -#define DMA_CONFIG_WLMAC_PWD_EN_MASK 0x00000008 -#define DMA_CONFIG_WLMAC_PWD_EN_GET(x) (((x) & DMA_CONFIG_WLMAC_PWD_EN_MASK) >> DMA_CONFIG_WLMAC_PWD_EN_LSB) -#define DMA_CONFIG_WLMAC_PWD_EN_SET(x) (((x) << DMA_CONFIG_WLMAC_PWD_EN_LSB) & DMA_CONFIG_WLMAC_PWD_EN_MASK) -#define DMA_CONFIG_ENABLE_RETENTION_MSB 2 -#define DMA_CONFIG_ENABLE_RETENTION_LSB 2 -#define DMA_CONFIG_ENABLE_RETENTION_MASK 0x00000004 -#define DMA_CONFIG_ENABLE_RETENTION_GET(x) (((x) & DMA_CONFIG_ENABLE_RETENTION_MASK) >> DMA_CONFIG_ENABLE_RETENTION_LSB) -#define DMA_CONFIG_ENABLE_RETENTION_SET(x) (((x) << DMA_CONFIG_ENABLE_RETENTION_LSB) & DMA_CONFIG_ENABLE_RETENTION_MASK) -#define DMA_CONFIG_RTC_PRIORITY_MSB 1 -#define DMA_CONFIG_RTC_PRIORITY_LSB 1 -#define DMA_CONFIG_RTC_PRIORITY_MASK 0x00000002 -#define DMA_CONFIG_RTC_PRIORITY_GET(x) (((x) & DMA_CONFIG_RTC_PRIORITY_MASK) >> DMA_CONFIG_RTC_PRIORITY_LSB) -#define DMA_CONFIG_RTC_PRIORITY_SET(x) (((x) << DMA_CONFIG_RTC_PRIORITY_LSB) & DMA_CONFIG_RTC_PRIORITY_MASK) -#define DMA_CONFIG_DMA_TYPE_MSB 0 -#define DMA_CONFIG_DMA_TYPE_LSB 0 -#define DMA_CONFIG_DMA_TYPE_MASK 0x00000001 -#define DMA_CONFIG_DMA_TYPE_GET(x) (((x) & DMA_CONFIG_DMA_TYPE_MASK) >> DMA_CONFIG_DMA_TYPE_LSB) -#define DMA_CONFIG_DMA_TYPE_SET(x) (((x) << DMA_CONFIG_DMA_TYPE_LSB) & DMA_CONFIG_DMA_TYPE_MASK) - -#define DMA_CONTROL_ADDRESS 0x00000004 -#define DMA_CONTROL_OFFSET 0x00000004 -#define DMA_CONTROL_START_MSB 1 -#define DMA_CONTROL_START_LSB 1 -#define DMA_CONTROL_START_MASK 0x00000002 -#define DMA_CONTROL_START_GET(x) (((x) & DMA_CONTROL_START_MASK) >> DMA_CONTROL_START_LSB) -#define DMA_CONTROL_START_SET(x) (((x) << DMA_CONTROL_START_LSB) & DMA_CONTROL_START_MASK) -#define DMA_CONTROL_STOP_MSB 0 -#define DMA_CONTROL_STOP_LSB 0 -#define DMA_CONTROL_STOP_MASK 0x00000001 -#define DMA_CONTROL_STOP_GET(x) (((x) & DMA_CONTROL_STOP_MASK) >> DMA_CONTROL_STOP_LSB) -#define DMA_CONTROL_STOP_SET(x) (((x) << DMA_CONTROL_STOP_LSB) & DMA_CONTROL_STOP_MASK) - -#define DMA_SRC_ADDRESS 0x00000008 -#define DMA_SRC_OFFSET 0x00000008 -#define DMA_SRC_ADDR_MSB 31 -#define DMA_SRC_ADDR_LSB 2 -#define DMA_SRC_ADDR_MASK 0xfffffffc -#define DMA_SRC_ADDR_GET(x) (((x) & DMA_SRC_ADDR_MASK) >> DMA_SRC_ADDR_LSB) -#define DMA_SRC_ADDR_SET(x) (((x) << DMA_SRC_ADDR_LSB) & DMA_SRC_ADDR_MASK) - -#define DMA_DEST_ADDRESS 0x0000000c -#define DMA_DEST_OFFSET 0x0000000c -#define DMA_DEST_ADDR_MSB 31 -#define DMA_DEST_ADDR_LSB 2 -#define DMA_DEST_ADDR_MASK 0xfffffffc -#define DMA_DEST_ADDR_GET(x) (((x) & DMA_DEST_ADDR_MASK) >> DMA_DEST_ADDR_LSB) -#define DMA_DEST_ADDR_SET(x) (((x) << DMA_DEST_ADDR_LSB) & DMA_DEST_ADDR_MASK) - -#define DMA_LENGTH_ADDRESS 0x00000010 -#define DMA_LENGTH_OFFSET 0x00000010 -#define DMA_LENGTH_WORDS_MSB 11 -#define DMA_LENGTH_WORDS_LSB 0 -#define DMA_LENGTH_WORDS_MASK 0x00000fff -#define DMA_LENGTH_WORDS_GET(x) (((x) & DMA_LENGTH_WORDS_MASK) >> DMA_LENGTH_WORDS_LSB) -#define DMA_LENGTH_WORDS_SET(x) (((x) << DMA_LENGTH_WORDS_LSB) & DMA_LENGTH_WORDS_MASK) - -#define VMC_BASE_ADDRESS 0x00000014 -#define VMC_BASE_OFFSET 0x00000014 -#define VMC_BASE_ADDR_MSB 31 -#define VMC_BASE_ADDR_LSB 2 -#define VMC_BASE_ADDR_MASK 0xfffffffc -#define VMC_BASE_ADDR_GET(x) (((x) & VMC_BASE_ADDR_MASK) >> VMC_BASE_ADDR_LSB) -#define VMC_BASE_ADDR_SET(x) (((x) << VMC_BASE_ADDR_LSB) & VMC_BASE_ADDR_MASK) - -#define INDIRECT_REG_ADDRESS 0x00000018 -#define INDIRECT_REG_OFFSET 0x00000018 -#define INDIRECT_REG_ID_MSB 31 -#define INDIRECT_REG_ID_LSB 2 -#define INDIRECT_REG_ID_MASK 0xfffffffc -#define INDIRECT_REG_ID_GET(x) (((x) & INDIRECT_REG_ID_MASK) >> INDIRECT_REG_ID_LSB) -#define INDIRECT_REG_ID_SET(x) (((x) << INDIRECT_REG_ID_LSB) & INDIRECT_REG_ID_MASK) - -#define INDIRECT_RETURN_ADDRESS 0x0000001c -#define INDIRECT_RETURN_OFFSET 0x0000001c -#define INDIRECT_RETURN_ADDR_MSB 31 -#define INDIRECT_RETURN_ADDR_LSB 2 -#define INDIRECT_RETURN_ADDR_MASK 0xfffffffc -#define INDIRECT_RETURN_ADDR_GET(x) (((x) & INDIRECT_RETURN_ADDR_MASK) >> INDIRECT_RETURN_ADDR_LSB) -#define INDIRECT_RETURN_ADDR_SET(x) (((x) << INDIRECT_RETURN_ADDR_LSB) & INDIRECT_RETURN_ADDR_MASK) - -#define RDMA_REGION_0__ADDRESS 0x00000020 -#define RDMA_REGION_0__OFFSET 0x00000020 -#define RDMA_REGION_0__ADDR_MSB 31 -#define RDMA_REGION_0__ADDR_LSB 13 -#define RDMA_REGION_0__ADDR_MASK 0xffffe000 -#define RDMA_REGION_0__ADDR_GET(x) (((x) & RDMA_REGION_0__ADDR_MASK) >> RDMA_REGION_0__ADDR_LSB) -#define RDMA_REGION_0__ADDR_SET(x) (((x) << RDMA_REGION_0__ADDR_LSB) & RDMA_REGION_0__ADDR_MASK) -#define RDMA_REGION_0__LENGTH_MSB 12 -#define RDMA_REGION_0__LENGTH_LSB 2 -#define RDMA_REGION_0__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_0__LENGTH_GET(x) (((x) & RDMA_REGION_0__LENGTH_MASK) >> RDMA_REGION_0__LENGTH_LSB) -#define RDMA_REGION_0__LENGTH_SET(x) (((x) << RDMA_REGION_0__LENGTH_LSB) & RDMA_REGION_0__LENGTH_MASK) -#define RDMA_REGION_0__INDI_MSB 1 -#define RDMA_REGION_0__INDI_LSB 1 -#define RDMA_REGION_0__INDI_MASK 0x00000002 -#define RDMA_REGION_0__INDI_GET(x) (((x) & RDMA_REGION_0__INDI_MASK) >> RDMA_REGION_0__INDI_LSB) -#define RDMA_REGION_0__INDI_SET(x) (((x) << RDMA_REGION_0__INDI_LSB) & RDMA_REGION_0__INDI_MASK) -#define RDMA_REGION_0__NEXT_MSB 0 -#define RDMA_REGION_0__NEXT_LSB 0 -#define RDMA_REGION_0__NEXT_MASK 0x00000001 -#define RDMA_REGION_0__NEXT_GET(x) (((x) & RDMA_REGION_0__NEXT_MASK) >> RDMA_REGION_0__NEXT_LSB) -#define RDMA_REGION_0__NEXT_SET(x) (((x) << RDMA_REGION_0__NEXT_LSB) & RDMA_REGION_0__NEXT_MASK) - -#define RDMA_REGION_1__ADDRESS 0x00000024 -#define RDMA_REGION_1__OFFSET 0x00000024 -#define RDMA_REGION_1__ADDR_MSB 31 -#define RDMA_REGION_1__ADDR_LSB 13 -#define RDMA_REGION_1__ADDR_MASK 0xffffe000 -#define RDMA_REGION_1__ADDR_GET(x) (((x) & RDMA_REGION_1__ADDR_MASK) >> RDMA_REGION_1__ADDR_LSB) -#define RDMA_REGION_1__ADDR_SET(x) (((x) << RDMA_REGION_1__ADDR_LSB) & RDMA_REGION_1__ADDR_MASK) -#define RDMA_REGION_1__LENGTH_MSB 12 -#define RDMA_REGION_1__LENGTH_LSB 2 -#define RDMA_REGION_1__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_1__LENGTH_GET(x) (((x) & RDMA_REGION_1__LENGTH_MASK) >> RDMA_REGION_1__LENGTH_LSB) -#define RDMA_REGION_1__LENGTH_SET(x) (((x) << RDMA_REGION_1__LENGTH_LSB) & RDMA_REGION_1__LENGTH_MASK) -#define RDMA_REGION_1__INDI_MSB 1 -#define RDMA_REGION_1__INDI_LSB 1 -#define RDMA_REGION_1__INDI_MASK 0x00000002 -#define RDMA_REGION_1__INDI_GET(x) (((x) & RDMA_REGION_1__INDI_MASK) >> RDMA_REGION_1__INDI_LSB) -#define RDMA_REGION_1__INDI_SET(x) (((x) << RDMA_REGION_1__INDI_LSB) & RDMA_REGION_1__INDI_MASK) -#define RDMA_REGION_1__NEXT_MSB 0 -#define RDMA_REGION_1__NEXT_LSB 0 -#define RDMA_REGION_1__NEXT_MASK 0x00000001 -#define RDMA_REGION_1__NEXT_GET(x) (((x) & RDMA_REGION_1__NEXT_MASK) >> RDMA_REGION_1__NEXT_LSB) -#define RDMA_REGION_1__NEXT_SET(x) (((x) << RDMA_REGION_1__NEXT_LSB) & RDMA_REGION_1__NEXT_MASK) - -#define RDMA_REGION_2__ADDRESS 0x00000028 -#define RDMA_REGION_2__OFFSET 0x00000028 -#define RDMA_REGION_2__ADDR_MSB 31 -#define RDMA_REGION_2__ADDR_LSB 13 -#define RDMA_REGION_2__ADDR_MASK 0xffffe000 -#define RDMA_REGION_2__ADDR_GET(x) (((x) & RDMA_REGION_2__ADDR_MASK) >> RDMA_REGION_2__ADDR_LSB) -#define RDMA_REGION_2__ADDR_SET(x) (((x) << RDMA_REGION_2__ADDR_LSB) & RDMA_REGION_2__ADDR_MASK) -#define RDMA_REGION_2__LENGTH_MSB 12 -#define RDMA_REGION_2__LENGTH_LSB 2 -#define RDMA_REGION_2__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_2__LENGTH_GET(x) (((x) & RDMA_REGION_2__LENGTH_MASK) >> RDMA_REGION_2__LENGTH_LSB) -#define RDMA_REGION_2__LENGTH_SET(x) (((x) << RDMA_REGION_2__LENGTH_LSB) & RDMA_REGION_2__LENGTH_MASK) -#define RDMA_REGION_2__INDI_MSB 1 -#define RDMA_REGION_2__INDI_LSB 1 -#define RDMA_REGION_2__INDI_MASK 0x00000002 -#define RDMA_REGION_2__INDI_GET(x) (((x) & RDMA_REGION_2__INDI_MASK) >> RDMA_REGION_2__INDI_LSB) -#define RDMA_REGION_2__INDI_SET(x) (((x) << RDMA_REGION_2__INDI_LSB) & RDMA_REGION_2__INDI_MASK) -#define RDMA_REGION_2__NEXT_MSB 0 -#define RDMA_REGION_2__NEXT_LSB 0 -#define RDMA_REGION_2__NEXT_MASK 0x00000001 -#define RDMA_REGION_2__NEXT_GET(x) (((x) & RDMA_REGION_2__NEXT_MASK) >> RDMA_REGION_2__NEXT_LSB) -#define RDMA_REGION_2__NEXT_SET(x) (((x) << RDMA_REGION_2__NEXT_LSB) & RDMA_REGION_2__NEXT_MASK) - -#define RDMA_REGION_3__ADDRESS 0x0000002c -#define RDMA_REGION_3__OFFSET 0x0000002c -#define RDMA_REGION_3__ADDR_MSB 31 -#define RDMA_REGION_3__ADDR_LSB 13 -#define RDMA_REGION_3__ADDR_MASK 0xffffe000 -#define RDMA_REGION_3__ADDR_GET(x) (((x) & RDMA_REGION_3__ADDR_MASK) >> RDMA_REGION_3__ADDR_LSB) -#define RDMA_REGION_3__ADDR_SET(x) (((x) << RDMA_REGION_3__ADDR_LSB) & RDMA_REGION_3__ADDR_MASK) -#define RDMA_REGION_3__LENGTH_MSB 12 -#define RDMA_REGION_3__LENGTH_LSB 2 -#define RDMA_REGION_3__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_3__LENGTH_GET(x) (((x) & RDMA_REGION_3__LENGTH_MASK) >> RDMA_REGION_3__LENGTH_LSB) -#define RDMA_REGION_3__LENGTH_SET(x) (((x) << RDMA_REGION_3__LENGTH_LSB) & RDMA_REGION_3__LENGTH_MASK) -#define RDMA_REGION_3__INDI_MSB 1 -#define RDMA_REGION_3__INDI_LSB 1 -#define RDMA_REGION_3__INDI_MASK 0x00000002 -#define RDMA_REGION_3__INDI_GET(x) (((x) & RDMA_REGION_3__INDI_MASK) >> RDMA_REGION_3__INDI_LSB) -#define RDMA_REGION_3__INDI_SET(x) (((x) << RDMA_REGION_3__INDI_LSB) & RDMA_REGION_3__INDI_MASK) -#define RDMA_REGION_3__NEXT_MSB 0 -#define RDMA_REGION_3__NEXT_LSB 0 -#define RDMA_REGION_3__NEXT_MASK 0x00000001 -#define RDMA_REGION_3__NEXT_GET(x) (((x) & RDMA_REGION_3__NEXT_MASK) >> RDMA_REGION_3__NEXT_LSB) -#define RDMA_REGION_3__NEXT_SET(x) (((x) << RDMA_REGION_3__NEXT_LSB) & RDMA_REGION_3__NEXT_MASK) - -#define RDMA_REGION_4__ADDRESS 0x00000030 -#define RDMA_REGION_4__OFFSET 0x00000030 -#define RDMA_REGION_4__ADDR_MSB 31 -#define RDMA_REGION_4__ADDR_LSB 13 -#define RDMA_REGION_4__ADDR_MASK 0xffffe000 -#define RDMA_REGION_4__ADDR_GET(x) (((x) & RDMA_REGION_4__ADDR_MASK) >> RDMA_REGION_4__ADDR_LSB) -#define RDMA_REGION_4__ADDR_SET(x) (((x) << RDMA_REGION_4__ADDR_LSB) & RDMA_REGION_4__ADDR_MASK) -#define RDMA_REGION_4__LENGTH_MSB 12 -#define RDMA_REGION_4__LENGTH_LSB 2 -#define RDMA_REGION_4__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_4__LENGTH_GET(x) (((x) & RDMA_REGION_4__LENGTH_MASK) >> RDMA_REGION_4__LENGTH_LSB) -#define RDMA_REGION_4__LENGTH_SET(x) (((x) << RDMA_REGION_4__LENGTH_LSB) & RDMA_REGION_4__LENGTH_MASK) -#define RDMA_REGION_4__INDI_MSB 1 -#define RDMA_REGION_4__INDI_LSB 1 -#define RDMA_REGION_4__INDI_MASK 0x00000002 -#define RDMA_REGION_4__INDI_GET(x) (((x) & RDMA_REGION_4__INDI_MASK) >> RDMA_REGION_4__INDI_LSB) -#define RDMA_REGION_4__INDI_SET(x) (((x) << RDMA_REGION_4__INDI_LSB) & RDMA_REGION_4__INDI_MASK) -#define RDMA_REGION_4__NEXT_MSB 0 -#define RDMA_REGION_4__NEXT_LSB 0 -#define RDMA_REGION_4__NEXT_MASK 0x00000001 -#define RDMA_REGION_4__NEXT_GET(x) (((x) & RDMA_REGION_4__NEXT_MASK) >> RDMA_REGION_4__NEXT_LSB) -#define RDMA_REGION_4__NEXT_SET(x) (((x) << RDMA_REGION_4__NEXT_LSB) & RDMA_REGION_4__NEXT_MASK) - -#define RDMA_REGION_5__ADDRESS 0x00000034 -#define RDMA_REGION_5__OFFSET 0x00000034 -#define RDMA_REGION_5__ADDR_MSB 31 -#define RDMA_REGION_5__ADDR_LSB 13 -#define RDMA_REGION_5__ADDR_MASK 0xffffe000 -#define RDMA_REGION_5__ADDR_GET(x) (((x) & RDMA_REGION_5__ADDR_MASK) >> RDMA_REGION_5__ADDR_LSB) -#define RDMA_REGION_5__ADDR_SET(x) (((x) << RDMA_REGION_5__ADDR_LSB) & RDMA_REGION_5__ADDR_MASK) -#define RDMA_REGION_5__LENGTH_MSB 12 -#define RDMA_REGION_5__LENGTH_LSB 2 -#define RDMA_REGION_5__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_5__LENGTH_GET(x) (((x) & RDMA_REGION_5__LENGTH_MASK) >> RDMA_REGION_5__LENGTH_LSB) -#define RDMA_REGION_5__LENGTH_SET(x) (((x) << RDMA_REGION_5__LENGTH_LSB) & RDMA_REGION_5__LENGTH_MASK) -#define RDMA_REGION_5__INDI_MSB 1 -#define RDMA_REGION_5__INDI_LSB 1 -#define RDMA_REGION_5__INDI_MASK 0x00000002 -#define RDMA_REGION_5__INDI_GET(x) (((x) & RDMA_REGION_5__INDI_MASK) >> RDMA_REGION_5__INDI_LSB) -#define RDMA_REGION_5__INDI_SET(x) (((x) << RDMA_REGION_5__INDI_LSB) & RDMA_REGION_5__INDI_MASK) -#define RDMA_REGION_5__NEXT_MSB 0 -#define RDMA_REGION_5__NEXT_LSB 0 -#define RDMA_REGION_5__NEXT_MASK 0x00000001 -#define RDMA_REGION_5__NEXT_GET(x) (((x) & RDMA_REGION_5__NEXT_MASK) >> RDMA_REGION_5__NEXT_LSB) -#define RDMA_REGION_5__NEXT_SET(x) (((x) << RDMA_REGION_5__NEXT_LSB) & RDMA_REGION_5__NEXT_MASK) - -#define RDMA_REGION_6__ADDRESS 0x00000038 -#define RDMA_REGION_6__OFFSET 0x00000038 -#define RDMA_REGION_6__ADDR_MSB 31 -#define RDMA_REGION_6__ADDR_LSB 13 -#define RDMA_REGION_6__ADDR_MASK 0xffffe000 -#define RDMA_REGION_6__ADDR_GET(x) (((x) & RDMA_REGION_6__ADDR_MASK) >> RDMA_REGION_6__ADDR_LSB) -#define RDMA_REGION_6__ADDR_SET(x) (((x) << RDMA_REGION_6__ADDR_LSB) & RDMA_REGION_6__ADDR_MASK) -#define RDMA_REGION_6__LENGTH_MSB 12 -#define RDMA_REGION_6__LENGTH_LSB 2 -#define RDMA_REGION_6__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_6__LENGTH_GET(x) (((x) & RDMA_REGION_6__LENGTH_MASK) >> RDMA_REGION_6__LENGTH_LSB) -#define RDMA_REGION_6__LENGTH_SET(x) (((x) << RDMA_REGION_6__LENGTH_LSB) & RDMA_REGION_6__LENGTH_MASK) -#define RDMA_REGION_6__INDI_MSB 1 -#define RDMA_REGION_6__INDI_LSB 1 -#define RDMA_REGION_6__INDI_MASK 0x00000002 -#define RDMA_REGION_6__INDI_GET(x) (((x) & RDMA_REGION_6__INDI_MASK) >> RDMA_REGION_6__INDI_LSB) -#define RDMA_REGION_6__INDI_SET(x) (((x) << RDMA_REGION_6__INDI_LSB) & RDMA_REGION_6__INDI_MASK) -#define RDMA_REGION_6__NEXT_MSB 0 -#define RDMA_REGION_6__NEXT_LSB 0 -#define RDMA_REGION_6__NEXT_MASK 0x00000001 -#define RDMA_REGION_6__NEXT_GET(x) (((x) & RDMA_REGION_6__NEXT_MASK) >> RDMA_REGION_6__NEXT_LSB) -#define RDMA_REGION_6__NEXT_SET(x) (((x) << RDMA_REGION_6__NEXT_LSB) & RDMA_REGION_6__NEXT_MASK) - -#define RDMA_REGION_7__ADDRESS 0x0000003c -#define RDMA_REGION_7__OFFSET 0x0000003c -#define RDMA_REGION_7__ADDR_MSB 31 -#define RDMA_REGION_7__ADDR_LSB 13 -#define RDMA_REGION_7__ADDR_MASK 0xffffe000 -#define RDMA_REGION_7__ADDR_GET(x) (((x) & RDMA_REGION_7__ADDR_MASK) >> RDMA_REGION_7__ADDR_LSB) -#define RDMA_REGION_7__ADDR_SET(x) (((x) << RDMA_REGION_7__ADDR_LSB) & RDMA_REGION_7__ADDR_MASK) -#define RDMA_REGION_7__LENGTH_MSB 12 -#define RDMA_REGION_7__LENGTH_LSB 2 -#define RDMA_REGION_7__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_7__LENGTH_GET(x) (((x) & RDMA_REGION_7__LENGTH_MASK) >> RDMA_REGION_7__LENGTH_LSB) -#define RDMA_REGION_7__LENGTH_SET(x) (((x) << RDMA_REGION_7__LENGTH_LSB) & RDMA_REGION_7__LENGTH_MASK) -#define RDMA_REGION_7__INDI_MSB 1 -#define RDMA_REGION_7__INDI_LSB 1 -#define RDMA_REGION_7__INDI_MASK 0x00000002 -#define RDMA_REGION_7__INDI_GET(x) (((x) & RDMA_REGION_7__INDI_MASK) >> RDMA_REGION_7__INDI_LSB) -#define RDMA_REGION_7__INDI_SET(x) (((x) << RDMA_REGION_7__INDI_LSB) & RDMA_REGION_7__INDI_MASK) -#define RDMA_REGION_7__NEXT_MSB 0 -#define RDMA_REGION_7__NEXT_LSB 0 -#define RDMA_REGION_7__NEXT_MASK 0x00000001 -#define RDMA_REGION_7__NEXT_GET(x) (((x) & RDMA_REGION_7__NEXT_MASK) >> RDMA_REGION_7__NEXT_LSB) -#define RDMA_REGION_7__NEXT_SET(x) (((x) << RDMA_REGION_7__NEXT_LSB) & RDMA_REGION_7__NEXT_MASK) - -#define RDMA_REGION_8__ADDRESS 0x00000040 -#define RDMA_REGION_8__OFFSET 0x00000040 -#define RDMA_REGION_8__ADDR_MSB 31 -#define RDMA_REGION_8__ADDR_LSB 13 -#define RDMA_REGION_8__ADDR_MASK 0xffffe000 -#define RDMA_REGION_8__ADDR_GET(x) (((x) & RDMA_REGION_8__ADDR_MASK) >> RDMA_REGION_8__ADDR_LSB) -#define RDMA_REGION_8__ADDR_SET(x) (((x) << RDMA_REGION_8__ADDR_LSB) & RDMA_REGION_8__ADDR_MASK) -#define RDMA_REGION_8__LENGTH_MSB 12 -#define RDMA_REGION_8__LENGTH_LSB 2 -#define RDMA_REGION_8__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_8__LENGTH_GET(x) (((x) & RDMA_REGION_8__LENGTH_MASK) >> RDMA_REGION_8__LENGTH_LSB) -#define RDMA_REGION_8__LENGTH_SET(x) (((x) << RDMA_REGION_8__LENGTH_LSB) & RDMA_REGION_8__LENGTH_MASK) -#define RDMA_REGION_8__INDI_MSB 1 -#define RDMA_REGION_8__INDI_LSB 1 -#define RDMA_REGION_8__INDI_MASK 0x00000002 -#define RDMA_REGION_8__INDI_GET(x) (((x) & RDMA_REGION_8__INDI_MASK) >> RDMA_REGION_8__INDI_LSB) -#define RDMA_REGION_8__INDI_SET(x) (((x) << RDMA_REGION_8__INDI_LSB) & RDMA_REGION_8__INDI_MASK) -#define RDMA_REGION_8__NEXT_MSB 0 -#define RDMA_REGION_8__NEXT_LSB 0 -#define RDMA_REGION_8__NEXT_MASK 0x00000001 -#define RDMA_REGION_8__NEXT_GET(x) (((x) & RDMA_REGION_8__NEXT_MASK) >> RDMA_REGION_8__NEXT_LSB) -#define RDMA_REGION_8__NEXT_SET(x) (((x) << RDMA_REGION_8__NEXT_LSB) & RDMA_REGION_8__NEXT_MASK) - -#define RDMA_REGION_9__ADDRESS 0x00000044 -#define RDMA_REGION_9__OFFSET 0x00000044 -#define RDMA_REGION_9__ADDR_MSB 31 -#define RDMA_REGION_9__ADDR_LSB 13 -#define RDMA_REGION_9__ADDR_MASK 0xffffe000 -#define RDMA_REGION_9__ADDR_GET(x) (((x) & RDMA_REGION_9__ADDR_MASK) >> RDMA_REGION_9__ADDR_LSB) -#define RDMA_REGION_9__ADDR_SET(x) (((x) << RDMA_REGION_9__ADDR_LSB) & RDMA_REGION_9__ADDR_MASK) -#define RDMA_REGION_9__LENGTH_MSB 12 -#define RDMA_REGION_9__LENGTH_LSB 2 -#define RDMA_REGION_9__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_9__LENGTH_GET(x) (((x) & RDMA_REGION_9__LENGTH_MASK) >> RDMA_REGION_9__LENGTH_LSB) -#define RDMA_REGION_9__LENGTH_SET(x) (((x) << RDMA_REGION_9__LENGTH_LSB) & RDMA_REGION_9__LENGTH_MASK) -#define RDMA_REGION_9__INDI_MSB 1 -#define RDMA_REGION_9__INDI_LSB 1 -#define RDMA_REGION_9__INDI_MASK 0x00000002 -#define RDMA_REGION_9__INDI_GET(x) (((x) & RDMA_REGION_9__INDI_MASK) >> RDMA_REGION_9__INDI_LSB) -#define RDMA_REGION_9__INDI_SET(x) (((x) << RDMA_REGION_9__INDI_LSB) & RDMA_REGION_9__INDI_MASK) -#define RDMA_REGION_9__NEXT_MSB 0 -#define RDMA_REGION_9__NEXT_LSB 0 -#define RDMA_REGION_9__NEXT_MASK 0x00000001 -#define RDMA_REGION_9__NEXT_GET(x) (((x) & RDMA_REGION_9__NEXT_MASK) >> RDMA_REGION_9__NEXT_LSB) -#define RDMA_REGION_9__NEXT_SET(x) (((x) << RDMA_REGION_9__NEXT_LSB) & RDMA_REGION_9__NEXT_MASK) - -#define RDMA_REGION_10__ADDRESS 0x00000048 -#define RDMA_REGION_10__OFFSET 0x00000048 -#define RDMA_REGION_10__ADDR_MSB 31 -#define RDMA_REGION_10__ADDR_LSB 13 -#define RDMA_REGION_10__ADDR_MASK 0xffffe000 -#define RDMA_REGION_10__ADDR_GET(x) (((x) & RDMA_REGION_10__ADDR_MASK) >> RDMA_REGION_10__ADDR_LSB) -#define RDMA_REGION_10__ADDR_SET(x) (((x) << RDMA_REGION_10__ADDR_LSB) & RDMA_REGION_10__ADDR_MASK) -#define RDMA_REGION_10__LENGTH_MSB 12 -#define RDMA_REGION_10__LENGTH_LSB 2 -#define RDMA_REGION_10__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_10__LENGTH_GET(x) (((x) & RDMA_REGION_10__LENGTH_MASK) >> RDMA_REGION_10__LENGTH_LSB) -#define RDMA_REGION_10__LENGTH_SET(x) (((x) << RDMA_REGION_10__LENGTH_LSB) & RDMA_REGION_10__LENGTH_MASK) -#define RDMA_REGION_10__INDI_MSB 1 -#define RDMA_REGION_10__INDI_LSB 1 -#define RDMA_REGION_10__INDI_MASK 0x00000002 -#define RDMA_REGION_10__INDI_GET(x) (((x) & RDMA_REGION_10__INDI_MASK) >> RDMA_REGION_10__INDI_LSB) -#define RDMA_REGION_10__INDI_SET(x) (((x) << RDMA_REGION_10__INDI_LSB) & RDMA_REGION_10__INDI_MASK) -#define RDMA_REGION_10__NEXT_MSB 0 -#define RDMA_REGION_10__NEXT_LSB 0 -#define RDMA_REGION_10__NEXT_MASK 0x00000001 -#define RDMA_REGION_10__NEXT_GET(x) (((x) & RDMA_REGION_10__NEXT_MASK) >> RDMA_REGION_10__NEXT_LSB) -#define RDMA_REGION_10__NEXT_SET(x) (((x) << RDMA_REGION_10__NEXT_LSB) & RDMA_REGION_10__NEXT_MASK) - -#define RDMA_REGION_11__ADDRESS 0x0000004c -#define RDMA_REGION_11__OFFSET 0x0000004c -#define RDMA_REGION_11__ADDR_MSB 31 -#define RDMA_REGION_11__ADDR_LSB 13 -#define RDMA_REGION_11__ADDR_MASK 0xffffe000 -#define RDMA_REGION_11__ADDR_GET(x) (((x) & RDMA_REGION_11__ADDR_MASK) >> RDMA_REGION_11__ADDR_LSB) -#define RDMA_REGION_11__ADDR_SET(x) (((x) << RDMA_REGION_11__ADDR_LSB) & RDMA_REGION_11__ADDR_MASK) -#define RDMA_REGION_11__LENGTH_MSB 12 -#define RDMA_REGION_11__LENGTH_LSB 2 -#define RDMA_REGION_11__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_11__LENGTH_GET(x) (((x) & RDMA_REGION_11__LENGTH_MASK) >> RDMA_REGION_11__LENGTH_LSB) -#define RDMA_REGION_11__LENGTH_SET(x) (((x) << RDMA_REGION_11__LENGTH_LSB) & RDMA_REGION_11__LENGTH_MASK) -#define RDMA_REGION_11__INDI_MSB 1 -#define RDMA_REGION_11__INDI_LSB 1 -#define RDMA_REGION_11__INDI_MASK 0x00000002 -#define RDMA_REGION_11__INDI_GET(x) (((x) & RDMA_REGION_11__INDI_MASK) >> RDMA_REGION_11__INDI_LSB) -#define RDMA_REGION_11__INDI_SET(x) (((x) << RDMA_REGION_11__INDI_LSB) & RDMA_REGION_11__INDI_MASK) -#define RDMA_REGION_11__NEXT_MSB 0 -#define RDMA_REGION_11__NEXT_LSB 0 -#define RDMA_REGION_11__NEXT_MASK 0x00000001 -#define RDMA_REGION_11__NEXT_GET(x) (((x) & RDMA_REGION_11__NEXT_MASK) >> RDMA_REGION_11__NEXT_LSB) -#define RDMA_REGION_11__NEXT_SET(x) (((x) << RDMA_REGION_11__NEXT_LSB) & RDMA_REGION_11__NEXT_MASK) - -#define RDMA_REGION_12__ADDRESS 0x00000050 -#define RDMA_REGION_12__OFFSET 0x00000050 -#define RDMA_REGION_12__ADDR_MSB 31 -#define RDMA_REGION_12__ADDR_LSB 13 -#define RDMA_REGION_12__ADDR_MASK 0xffffe000 -#define RDMA_REGION_12__ADDR_GET(x) (((x) & RDMA_REGION_12__ADDR_MASK) >> RDMA_REGION_12__ADDR_LSB) -#define RDMA_REGION_12__ADDR_SET(x) (((x) << RDMA_REGION_12__ADDR_LSB) & RDMA_REGION_12__ADDR_MASK) -#define RDMA_REGION_12__LENGTH_MSB 12 -#define RDMA_REGION_12__LENGTH_LSB 2 -#define RDMA_REGION_12__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_12__LENGTH_GET(x) (((x) & RDMA_REGION_12__LENGTH_MASK) >> RDMA_REGION_12__LENGTH_LSB) -#define RDMA_REGION_12__LENGTH_SET(x) (((x) << RDMA_REGION_12__LENGTH_LSB) & RDMA_REGION_12__LENGTH_MASK) -#define RDMA_REGION_12__INDI_MSB 1 -#define RDMA_REGION_12__INDI_LSB 1 -#define RDMA_REGION_12__INDI_MASK 0x00000002 -#define RDMA_REGION_12__INDI_GET(x) (((x) & RDMA_REGION_12__INDI_MASK) >> RDMA_REGION_12__INDI_LSB) -#define RDMA_REGION_12__INDI_SET(x) (((x) << RDMA_REGION_12__INDI_LSB) & RDMA_REGION_12__INDI_MASK) -#define RDMA_REGION_12__NEXT_MSB 0 -#define RDMA_REGION_12__NEXT_LSB 0 -#define RDMA_REGION_12__NEXT_MASK 0x00000001 -#define RDMA_REGION_12__NEXT_GET(x) (((x) & RDMA_REGION_12__NEXT_MASK) >> RDMA_REGION_12__NEXT_LSB) -#define RDMA_REGION_12__NEXT_SET(x) (((x) << RDMA_REGION_12__NEXT_LSB) & RDMA_REGION_12__NEXT_MASK) - -#define RDMA_REGION_13__ADDRESS 0x00000054 -#define RDMA_REGION_13__OFFSET 0x00000054 -#define RDMA_REGION_13__ADDR_MSB 31 -#define RDMA_REGION_13__ADDR_LSB 13 -#define RDMA_REGION_13__ADDR_MASK 0xffffe000 -#define RDMA_REGION_13__ADDR_GET(x) (((x) & RDMA_REGION_13__ADDR_MASK) >> RDMA_REGION_13__ADDR_LSB) -#define RDMA_REGION_13__ADDR_SET(x) (((x) << RDMA_REGION_13__ADDR_LSB) & RDMA_REGION_13__ADDR_MASK) -#define RDMA_REGION_13__LENGTH_MSB 12 -#define RDMA_REGION_13__LENGTH_LSB 2 -#define RDMA_REGION_13__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_13__LENGTH_GET(x) (((x) & RDMA_REGION_13__LENGTH_MASK) >> RDMA_REGION_13__LENGTH_LSB) -#define RDMA_REGION_13__LENGTH_SET(x) (((x) << RDMA_REGION_13__LENGTH_LSB) & RDMA_REGION_13__LENGTH_MASK) -#define RDMA_REGION_13__INDI_MSB 1 -#define RDMA_REGION_13__INDI_LSB 1 -#define RDMA_REGION_13__INDI_MASK 0x00000002 -#define RDMA_REGION_13__INDI_GET(x) (((x) & RDMA_REGION_13__INDI_MASK) >> RDMA_REGION_13__INDI_LSB) -#define RDMA_REGION_13__INDI_SET(x) (((x) << RDMA_REGION_13__INDI_LSB) & RDMA_REGION_13__INDI_MASK) -#define RDMA_REGION_13__NEXT_MSB 0 -#define RDMA_REGION_13__NEXT_LSB 0 -#define RDMA_REGION_13__NEXT_MASK 0x00000001 -#define RDMA_REGION_13__NEXT_GET(x) (((x) & RDMA_REGION_13__NEXT_MASK) >> RDMA_REGION_13__NEXT_LSB) -#define RDMA_REGION_13__NEXT_SET(x) (((x) << RDMA_REGION_13__NEXT_LSB) & RDMA_REGION_13__NEXT_MASK) - -#define RDMA_REGION_14__ADDRESS 0x00000058 -#define RDMA_REGION_14__OFFSET 0x00000058 -#define RDMA_REGION_14__ADDR_MSB 31 -#define RDMA_REGION_14__ADDR_LSB 13 -#define RDMA_REGION_14__ADDR_MASK 0xffffe000 -#define RDMA_REGION_14__ADDR_GET(x) (((x) & RDMA_REGION_14__ADDR_MASK) >> RDMA_REGION_14__ADDR_LSB) -#define RDMA_REGION_14__ADDR_SET(x) (((x) << RDMA_REGION_14__ADDR_LSB) & RDMA_REGION_14__ADDR_MASK) -#define RDMA_REGION_14__LENGTH_MSB 12 -#define RDMA_REGION_14__LENGTH_LSB 2 -#define RDMA_REGION_14__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_14__LENGTH_GET(x) (((x) & RDMA_REGION_14__LENGTH_MASK) >> RDMA_REGION_14__LENGTH_LSB) -#define RDMA_REGION_14__LENGTH_SET(x) (((x) << RDMA_REGION_14__LENGTH_LSB) & RDMA_REGION_14__LENGTH_MASK) -#define RDMA_REGION_14__INDI_MSB 1 -#define RDMA_REGION_14__INDI_LSB 1 -#define RDMA_REGION_14__INDI_MASK 0x00000002 -#define RDMA_REGION_14__INDI_GET(x) (((x) & RDMA_REGION_14__INDI_MASK) >> RDMA_REGION_14__INDI_LSB) -#define RDMA_REGION_14__INDI_SET(x) (((x) << RDMA_REGION_14__INDI_LSB) & RDMA_REGION_14__INDI_MASK) -#define RDMA_REGION_14__NEXT_MSB 0 -#define RDMA_REGION_14__NEXT_LSB 0 -#define RDMA_REGION_14__NEXT_MASK 0x00000001 -#define RDMA_REGION_14__NEXT_GET(x) (((x) & RDMA_REGION_14__NEXT_MASK) >> RDMA_REGION_14__NEXT_LSB) -#define RDMA_REGION_14__NEXT_SET(x) (((x) << RDMA_REGION_14__NEXT_LSB) & RDMA_REGION_14__NEXT_MASK) - -#define RDMA_REGION_15__ADDRESS 0x0000005c -#define RDMA_REGION_15__OFFSET 0x0000005c -#define RDMA_REGION_15__ADDR_MSB 31 -#define RDMA_REGION_15__ADDR_LSB 13 -#define RDMA_REGION_15__ADDR_MASK 0xffffe000 -#define RDMA_REGION_15__ADDR_GET(x) (((x) & RDMA_REGION_15__ADDR_MASK) >> RDMA_REGION_15__ADDR_LSB) -#define RDMA_REGION_15__ADDR_SET(x) (((x) << RDMA_REGION_15__ADDR_LSB) & RDMA_REGION_15__ADDR_MASK) -#define RDMA_REGION_15__LENGTH_MSB 12 -#define RDMA_REGION_15__LENGTH_LSB 2 -#define RDMA_REGION_15__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_15__LENGTH_GET(x) (((x) & RDMA_REGION_15__LENGTH_MASK) >> RDMA_REGION_15__LENGTH_LSB) -#define RDMA_REGION_15__LENGTH_SET(x) (((x) << RDMA_REGION_15__LENGTH_LSB) & RDMA_REGION_15__LENGTH_MASK) -#define RDMA_REGION_15__INDI_MSB 1 -#define RDMA_REGION_15__INDI_LSB 1 -#define RDMA_REGION_15__INDI_MASK 0x00000002 -#define RDMA_REGION_15__INDI_GET(x) (((x) & RDMA_REGION_15__INDI_MASK) >> RDMA_REGION_15__INDI_LSB) -#define RDMA_REGION_15__INDI_SET(x) (((x) << RDMA_REGION_15__INDI_LSB) & RDMA_REGION_15__INDI_MASK) -#define RDMA_REGION_15__NEXT_MSB 0 -#define RDMA_REGION_15__NEXT_LSB 0 -#define RDMA_REGION_15__NEXT_MASK 0x00000001 -#define RDMA_REGION_15__NEXT_GET(x) (((x) & RDMA_REGION_15__NEXT_MASK) >> RDMA_REGION_15__NEXT_LSB) -#define RDMA_REGION_15__NEXT_SET(x) (((x) << RDMA_REGION_15__NEXT_LSB) & RDMA_REGION_15__NEXT_MASK) - -#define RDMA_REGION_16__ADDRESS 0x00000060 -#define RDMA_REGION_16__OFFSET 0x00000060 -#define RDMA_REGION_16__ADDR_MSB 31 -#define RDMA_REGION_16__ADDR_LSB 13 -#define RDMA_REGION_16__ADDR_MASK 0xffffe000 -#define RDMA_REGION_16__ADDR_GET(x) (((x) & RDMA_REGION_16__ADDR_MASK) >> RDMA_REGION_16__ADDR_LSB) -#define RDMA_REGION_16__ADDR_SET(x) (((x) << RDMA_REGION_16__ADDR_LSB) & RDMA_REGION_16__ADDR_MASK) -#define RDMA_REGION_16__LENGTH_MSB 12 -#define RDMA_REGION_16__LENGTH_LSB 2 -#define RDMA_REGION_16__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_16__LENGTH_GET(x) (((x) & RDMA_REGION_16__LENGTH_MASK) >> RDMA_REGION_16__LENGTH_LSB) -#define RDMA_REGION_16__LENGTH_SET(x) (((x) << RDMA_REGION_16__LENGTH_LSB) & RDMA_REGION_16__LENGTH_MASK) -#define RDMA_REGION_16__INDI_MSB 1 -#define RDMA_REGION_16__INDI_LSB 1 -#define RDMA_REGION_16__INDI_MASK 0x00000002 -#define RDMA_REGION_16__INDI_GET(x) (((x) & RDMA_REGION_16__INDI_MASK) >> RDMA_REGION_16__INDI_LSB) -#define RDMA_REGION_16__INDI_SET(x) (((x) << RDMA_REGION_16__INDI_LSB) & RDMA_REGION_16__INDI_MASK) -#define RDMA_REGION_16__NEXT_MSB 0 -#define RDMA_REGION_16__NEXT_LSB 0 -#define RDMA_REGION_16__NEXT_MASK 0x00000001 -#define RDMA_REGION_16__NEXT_GET(x) (((x) & RDMA_REGION_16__NEXT_MASK) >> RDMA_REGION_16__NEXT_LSB) -#define RDMA_REGION_16__NEXT_SET(x) (((x) << RDMA_REGION_16__NEXT_LSB) & RDMA_REGION_16__NEXT_MASK) - -#define RDMA_REGION_17__ADDRESS 0x00000064 -#define RDMA_REGION_17__OFFSET 0x00000064 -#define RDMA_REGION_17__ADDR_MSB 31 -#define RDMA_REGION_17__ADDR_LSB 13 -#define RDMA_REGION_17__ADDR_MASK 0xffffe000 -#define RDMA_REGION_17__ADDR_GET(x) (((x) & RDMA_REGION_17__ADDR_MASK) >> RDMA_REGION_17__ADDR_LSB) -#define RDMA_REGION_17__ADDR_SET(x) (((x) << RDMA_REGION_17__ADDR_LSB) & RDMA_REGION_17__ADDR_MASK) -#define RDMA_REGION_17__LENGTH_MSB 12 -#define RDMA_REGION_17__LENGTH_LSB 2 -#define RDMA_REGION_17__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_17__LENGTH_GET(x) (((x) & RDMA_REGION_17__LENGTH_MASK) >> RDMA_REGION_17__LENGTH_LSB) -#define RDMA_REGION_17__LENGTH_SET(x) (((x) << RDMA_REGION_17__LENGTH_LSB) & RDMA_REGION_17__LENGTH_MASK) -#define RDMA_REGION_17__INDI_MSB 1 -#define RDMA_REGION_17__INDI_LSB 1 -#define RDMA_REGION_17__INDI_MASK 0x00000002 -#define RDMA_REGION_17__INDI_GET(x) (((x) & RDMA_REGION_17__INDI_MASK) >> RDMA_REGION_17__INDI_LSB) -#define RDMA_REGION_17__INDI_SET(x) (((x) << RDMA_REGION_17__INDI_LSB) & RDMA_REGION_17__INDI_MASK) -#define RDMA_REGION_17__NEXT_MSB 0 -#define RDMA_REGION_17__NEXT_LSB 0 -#define RDMA_REGION_17__NEXT_MASK 0x00000001 -#define RDMA_REGION_17__NEXT_GET(x) (((x) & RDMA_REGION_17__NEXT_MASK) >> RDMA_REGION_17__NEXT_LSB) -#define RDMA_REGION_17__NEXT_SET(x) (((x) << RDMA_REGION_17__NEXT_LSB) & RDMA_REGION_17__NEXT_MASK) - -#define RDMA_REGION_18__ADDRESS 0x00000068 -#define RDMA_REGION_18__OFFSET 0x00000068 -#define RDMA_REGION_18__ADDR_MSB 31 -#define RDMA_REGION_18__ADDR_LSB 13 -#define RDMA_REGION_18__ADDR_MASK 0xffffe000 -#define RDMA_REGION_18__ADDR_GET(x) (((x) & RDMA_REGION_18__ADDR_MASK) >> RDMA_REGION_18__ADDR_LSB) -#define RDMA_REGION_18__ADDR_SET(x) (((x) << RDMA_REGION_18__ADDR_LSB) & RDMA_REGION_18__ADDR_MASK) -#define RDMA_REGION_18__LENGTH_MSB 12 -#define RDMA_REGION_18__LENGTH_LSB 2 -#define RDMA_REGION_18__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_18__LENGTH_GET(x) (((x) & RDMA_REGION_18__LENGTH_MASK) >> RDMA_REGION_18__LENGTH_LSB) -#define RDMA_REGION_18__LENGTH_SET(x) (((x) << RDMA_REGION_18__LENGTH_LSB) & RDMA_REGION_18__LENGTH_MASK) -#define RDMA_REGION_18__INDI_MSB 1 -#define RDMA_REGION_18__INDI_LSB 1 -#define RDMA_REGION_18__INDI_MASK 0x00000002 -#define RDMA_REGION_18__INDI_GET(x) (((x) & RDMA_REGION_18__INDI_MASK) >> RDMA_REGION_18__INDI_LSB) -#define RDMA_REGION_18__INDI_SET(x) (((x) << RDMA_REGION_18__INDI_LSB) & RDMA_REGION_18__INDI_MASK) -#define RDMA_REGION_18__NEXT_MSB 0 -#define RDMA_REGION_18__NEXT_LSB 0 -#define RDMA_REGION_18__NEXT_MASK 0x00000001 -#define RDMA_REGION_18__NEXT_GET(x) (((x) & RDMA_REGION_18__NEXT_MASK) >> RDMA_REGION_18__NEXT_LSB) -#define RDMA_REGION_18__NEXT_SET(x) (((x) << RDMA_REGION_18__NEXT_LSB) & RDMA_REGION_18__NEXT_MASK) - -#define RDMA_REGION_19__ADDRESS 0x0000006c -#define RDMA_REGION_19__OFFSET 0x0000006c -#define RDMA_REGION_19__ADDR_MSB 31 -#define RDMA_REGION_19__ADDR_LSB 13 -#define RDMA_REGION_19__ADDR_MASK 0xffffe000 -#define RDMA_REGION_19__ADDR_GET(x) (((x) & RDMA_REGION_19__ADDR_MASK) >> RDMA_REGION_19__ADDR_LSB) -#define RDMA_REGION_19__ADDR_SET(x) (((x) << RDMA_REGION_19__ADDR_LSB) & RDMA_REGION_19__ADDR_MASK) -#define RDMA_REGION_19__LENGTH_MSB 12 -#define RDMA_REGION_19__LENGTH_LSB 2 -#define RDMA_REGION_19__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_19__LENGTH_GET(x) (((x) & RDMA_REGION_19__LENGTH_MASK) >> RDMA_REGION_19__LENGTH_LSB) -#define RDMA_REGION_19__LENGTH_SET(x) (((x) << RDMA_REGION_19__LENGTH_LSB) & RDMA_REGION_19__LENGTH_MASK) -#define RDMA_REGION_19__INDI_MSB 1 -#define RDMA_REGION_19__INDI_LSB 1 -#define RDMA_REGION_19__INDI_MASK 0x00000002 -#define RDMA_REGION_19__INDI_GET(x) (((x) & RDMA_REGION_19__INDI_MASK) >> RDMA_REGION_19__INDI_LSB) -#define RDMA_REGION_19__INDI_SET(x) (((x) << RDMA_REGION_19__INDI_LSB) & RDMA_REGION_19__INDI_MASK) -#define RDMA_REGION_19__NEXT_MSB 0 -#define RDMA_REGION_19__NEXT_LSB 0 -#define RDMA_REGION_19__NEXT_MASK 0x00000001 -#define RDMA_REGION_19__NEXT_GET(x) (((x) & RDMA_REGION_19__NEXT_MASK) >> RDMA_REGION_19__NEXT_LSB) -#define RDMA_REGION_19__NEXT_SET(x) (((x) << RDMA_REGION_19__NEXT_LSB) & RDMA_REGION_19__NEXT_MASK) - -#define RDMA_REGION_20__ADDRESS 0x00000070 -#define RDMA_REGION_20__OFFSET 0x00000070 -#define RDMA_REGION_20__ADDR_MSB 31 -#define RDMA_REGION_20__ADDR_LSB 13 -#define RDMA_REGION_20__ADDR_MASK 0xffffe000 -#define RDMA_REGION_20__ADDR_GET(x) (((x) & RDMA_REGION_20__ADDR_MASK) >> RDMA_REGION_20__ADDR_LSB) -#define RDMA_REGION_20__ADDR_SET(x) (((x) << RDMA_REGION_20__ADDR_LSB) & RDMA_REGION_20__ADDR_MASK) -#define RDMA_REGION_20__LENGTH_MSB 12 -#define RDMA_REGION_20__LENGTH_LSB 2 -#define RDMA_REGION_20__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_20__LENGTH_GET(x) (((x) & RDMA_REGION_20__LENGTH_MASK) >> RDMA_REGION_20__LENGTH_LSB) -#define RDMA_REGION_20__LENGTH_SET(x) (((x) << RDMA_REGION_20__LENGTH_LSB) & RDMA_REGION_20__LENGTH_MASK) -#define RDMA_REGION_20__INDI_MSB 1 -#define RDMA_REGION_20__INDI_LSB 1 -#define RDMA_REGION_20__INDI_MASK 0x00000002 -#define RDMA_REGION_20__INDI_GET(x) (((x) & RDMA_REGION_20__INDI_MASK) >> RDMA_REGION_20__INDI_LSB) -#define RDMA_REGION_20__INDI_SET(x) (((x) << RDMA_REGION_20__INDI_LSB) & RDMA_REGION_20__INDI_MASK) -#define RDMA_REGION_20__NEXT_MSB 0 -#define RDMA_REGION_20__NEXT_LSB 0 -#define RDMA_REGION_20__NEXT_MASK 0x00000001 -#define RDMA_REGION_20__NEXT_GET(x) (((x) & RDMA_REGION_20__NEXT_MASK) >> RDMA_REGION_20__NEXT_LSB) -#define RDMA_REGION_20__NEXT_SET(x) (((x) << RDMA_REGION_20__NEXT_LSB) & RDMA_REGION_20__NEXT_MASK) - -#define RDMA_REGION_21__ADDRESS 0x00000074 -#define RDMA_REGION_21__OFFSET 0x00000074 -#define RDMA_REGION_21__ADDR_MSB 31 -#define RDMA_REGION_21__ADDR_LSB 13 -#define RDMA_REGION_21__ADDR_MASK 0xffffe000 -#define RDMA_REGION_21__ADDR_GET(x) (((x) & RDMA_REGION_21__ADDR_MASK) >> RDMA_REGION_21__ADDR_LSB) -#define RDMA_REGION_21__ADDR_SET(x) (((x) << RDMA_REGION_21__ADDR_LSB) & RDMA_REGION_21__ADDR_MASK) -#define RDMA_REGION_21__LENGTH_MSB 12 -#define RDMA_REGION_21__LENGTH_LSB 2 -#define RDMA_REGION_21__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_21__LENGTH_GET(x) (((x) & RDMA_REGION_21__LENGTH_MASK) >> RDMA_REGION_21__LENGTH_LSB) -#define RDMA_REGION_21__LENGTH_SET(x) (((x) << RDMA_REGION_21__LENGTH_LSB) & RDMA_REGION_21__LENGTH_MASK) -#define RDMA_REGION_21__INDI_MSB 1 -#define RDMA_REGION_21__INDI_LSB 1 -#define RDMA_REGION_21__INDI_MASK 0x00000002 -#define RDMA_REGION_21__INDI_GET(x) (((x) & RDMA_REGION_21__INDI_MASK) >> RDMA_REGION_21__INDI_LSB) -#define RDMA_REGION_21__INDI_SET(x) (((x) << RDMA_REGION_21__INDI_LSB) & RDMA_REGION_21__INDI_MASK) -#define RDMA_REGION_21__NEXT_MSB 0 -#define RDMA_REGION_21__NEXT_LSB 0 -#define RDMA_REGION_21__NEXT_MASK 0x00000001 -#define RDMA_REGION_21__NEXT_GET(x) (((x) & RDMA_REGION_21__NEXT_MASK) >> RDMA_REGION_21__NEXT_LSB) -#define RDMA_REGION_21__NEXT_SET(x) (((x) << RDMA_REGION_21__NEXT_LSB) & RDMA_REGION_21__NEXT_MASK) - -#define RDMA_REGION_22__ADDRESS 0x00000078 -#define RDMA_REGION_22__OFFSET 0x00000078 -#define RDMA_REGION_22__ADDR_MSB 31 -#define RDMA_REGION_22__ADDR_LSB 13 -#define RDMA_REGION_22__ADDR_MASK 0xffffe000 -#define RDMA_REGION_22__ADDR_GET(x) (((x) & RDMA_REGION_22__ADDR_MASK) >> RDMA_REGION_22__ADDR_LSB) -#define RDMA_REGION_22__ADDR_SET(x) (((x) << RDMA_REGION_22__ADDR_LSB) & RDMA_REGION_22__ADDR_MASK) -#define RDMA_REGION_22__LENGTH_MSB 12 -#define RDMA_REGION_22__LENGTH_LSB 2 -#define RDMA_REGION_22__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_22__LENGTH_GET(x) (((x) & RDMA_REGION_22__LENGTH_MASK) >> RDMA_REGION_22__LENGTH_LSB) -#define RDMA_REGION_22__LENGTH_SET(x) (((x) << RDMA_REGION_22__LENGTH_LSB) & RDMA_REGION_22__LENGTH_MASK) -#define RDMA_REGION_22__INDI_MSB 1 -#define RDMA_REGION_22__INDI_LSB 1 -#define RDMA_REGION_22__INDI_MASK 0x00000002 -#define RDMA_REGION_22__INDI_GET(x) (((x) & RDMA_REGION_22__INDI_MASK) >> RDMA_REGION_22__INDI_LSB) -#define RDMA_REGION_22__INDI_SET(x) (((x) << RDMA_REGION_22__INDI_LSB) & RDMA_REGION_22__INDI_MASK) -#define RDMA_REGION_22__NEXT_MSB 0 -#define RDMA_REGION_22__NEXT_LSB 0 -#define RDMA_REGION_22__NEXT_MASK 0x00000001 -#define RDMA_REGION_22__NEXT_GET(x) (((x) & RDMA_REGION_22__NEXT_MASK) >> RDMA_REGION_22__NEXT_LSB) -#define RDMA_REGION_22__NEXT_SET(x) (((x) << RDMA_REGION_22__NEXT_LSB) & RDMA_REGION_22__NEXT_MASK) - -#define RDMA_REGION_23__ADDRESS 0x0000007c -#define RDMA_REGION_23__OFFSET 0x0000007c -#define RDMA_REGION_23__ADDR_MSB 31 -#define RDMA_REGION_23__ADDR_LSB 13 -#define RDMA_REGION_23__ADDR_MASK 0xffffe000 -#define RDMA_REGION_23__ADDR_GET(x) (((x) & RDMA_REGION_23__ADDR_MASK) >> RDMA_REGION_23__ADDR_LSB) -#define RDMA_REGION_23__ADDR_SET(x) (((x) << RDMA_REGION_23__ADDR_LSB) & RDMA_REGION_23__ADDR_MASK) -#define RDMA_REGION_23__LENGTH_MSB 12 -#define RDMA_REGION_23__LENGTH_LSB 2 -#define RDMA_REGION_23__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_23__LENGTH_GET(x) (((x) & RDMA_REGION_23__LENGTH_MASK) >> RDMA_REGION_23__LENGTH_LSB) -#define RDMA_REGION_23__LENGTH_SET(x) (((x) << RDMA_REGION_23__LENGTH_LSB) & RDMA_REGION_23__LENGTH_MASK) -#define RDMA_REGION_23__INDI_MSB 1 -#define RDMA_REGION_23__INDI_LSB 1 -#define RDMA_REGION_23__INDI_MASK 0x00000002 -#define RDMA_REGION_23__INDI_GET(x) (((x) & RDMA_REGION_23__INDI_MASK) >> RDMA_REGION_23__INDI_LSB) -#define RDMA_REGION_23__INDI_SET(x) (((x) << RDMA_REGION_23__INDI_LSB) & RDMA_REGION_23__INDI_MASK) -#define RDMA_REGION_23__NEXT_MSB 0 -#define RDMA_REGION_23__NEXT_LSB 0 -#define RDMA_REGION_23__NEXT_MASK 0x00000001 -#define RDMA_REGION_23__NEXT_GET(x) (((x) & RDMA_REGION_23__NEXT_MASK) >> RDMA_REGION_23__NEXT_LSB) -#define RDMA_REGION_23__NEXT_SET(x) (((x) << RDMA_REGION_23__NEXT_LSB) & RDMA_REGION_23__NEXT_MASK) - -#define RDMA_REGION_24__ADDRESS 0x00000080 -#define RDMA_REGION_24__OFFSET 0x00000080 -#define RDMA_REGION_24__ADDR_MSB 31 -#define RDMA_REGION_24__ADDR_LSB 13 -#define RDMA_REGION_24__ADDR_MASK 0xffffe000 -#define RDMA_REGION_24__ADDR_GET(x) (((x) & RDMA_REGION_24__ADDR_MASK) >> RDMA_REGION_24__ADDR_LSB) -#define RDMA_REGION_24__ADDR_SET(x) (((x) << RDMA_REGION_24__ADDR_LSB) & RDMA_REGION_24__ADDR_MASK) -#define RDMA_REGION_24__LENGTH_MSB 12 -#define RDMA_REGION_24__LENGTH_LSB 2 -#define RDMA_REGION_24__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_24__LENGTH_GET(x) (((x) & RDMA_REGION_24__LENGTH_MASK) >> RDMA_REGION_24__LENGTH_LSB) -#define RDMA_REGION_24__LENGTH_SET(x) (((x) << RDMA_REGION_24__LENGTH_LSB) & RDMA_REGION_24__LENGTH_MASK) -#define RDMA_REGION_24__INDI_MSB 1 -#define RDMA_REGION_24__INDI_LSB 1 -#define RDMA_REGION_24__INDI_MASK 0x00000002 -#define RDMA_REGION_24__INDI_GET(x) (((x) & RDMA_REGION_24__INDI_MASK) >> RDMA_REGION_24__INDI_LSB) -#define RDMA_REGION_24__INDI_SET(x) (((x) << RDMA_REGION_24__INDI_LSB) & RDMA_REGION_24__INDI_MASK) -#define RDMA_REGION_24__NEXT_MSB 0 -#define RDMA_REGION_24__NEXT_LSB 0 -#define RDMA_REGION_24__NEXT_MASK 0x00000001 -#define RDMA_REGION_24__NEXT_GET(x) (((x) & RDMA_REGION_24__NEXT_MASK) >> RDMA_REGION_24__NEXT_LSB) -#define RDMA_REGION_24__NEXT_SET(x) (((x) << RDMA_REGION_24__NEXT_LSB) & RDMA_REGION_24__NEXT_MASK) - -#define RDMA_REGION_25__ADDRESS 0x00000084 -#define RDMA_REGION_25__OFFSET 0x00000084 -#define RDMA_REGION_25__ADDR_MSB 31 -#define RDMA_REGION_25__ADDR_LSB 13 -#define RDMA_REGION_25__ADDR_MASK 0xffffe000 -#define RDMA_REGION_25__ADDR_GET(x) (((x) & RDMA_REGION_25__ADDR_MASK) >> RDMA_REGION_25__ADDR_LSB) -#define RDMA_REGION_25__ADDR_SET(x) (((x) << RDMA_REGION_25__ADDR_LSB) & RDMA_REGION_25__ADDR_MASK) -#define RDMA_REGION_25__LENGTH_MSB 12 -#define RDMA_REGION_25__LENGTH_LSB 2 -#define RDMA_REGION_25__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_25__LENGTH_GET(x) (((x) & RDMA_REGION_25__LENGTH_MASK) >> RDMA_REGION_25__LENGTH_LSB) -#define RDMA_REGION_25__LENGTH_SET(x) (((x) << RDMA_REGION_25__LENGTH_LSB) & RDMA_REGION_25__LENGTH_MASK) -#define RDMA_REGION_25__INDI_MSB 1 -#define RDMA_REGION_25__INDI_LSB 1 -#define RDMA_REGION_25__INDI_MASK 0x00000002 -#define RDMA_REGION_25__INDI_GET(x) (((x) & RDMA_REGION_25__INDI_MASK) >> RDMA_REGION_25__INDI_LSB) -#define RDMA_REGION_25__INDI_SET(x) (((x) << RDMA_REGION_25__INDI_LSB) & RDMA_REGION_25__INDI_MASK) -#define RDMA_REGION_25__NEXT_MSB 0 -#define RDMA_REGION_25__NEXT_LSB 0 -#define RDMA_REGION_25__NEXT_MASK 0x00000001 -#define RDMA_REGION_25__NEXT_GET(x) (((x) & RDMA_REGION_25__NEXT_MASK) >> RDMA_REGION_25__NEXT_LSB) -#define RDMA_REGION_25__NEXT_SET(x) (((x) << RDMA_REGION_25__NEXT_LSB) & RDMA_REGION_25__NEXT_MASK) - -#define RDMA_REGION_26__ADDRESS 0x00000088 -#define RDMA_REGION_26__OFFSET 0x00000088 -#define RDMA_REGION_26__ADDR_MSB 31 -#define RDMA_REGION_26__ADDR_LSB 13 -#define RDMA_REGION_26__ADDR_MASK 0xffffe000 -#define RDMA_REGION_26__ADDR_GET(x) (((x) & RDMA_REGION_26__ADDR_MASK) >> RDMA_REGION_26__ADDR_LSB) -#define RDMA_REGION_26__ADDR_SET(x) (((x) << RDMA_REGION_26__ADDR_LSB) & RDMA_REGION_26__ADDR_MASK) -#define RDMA_REGION_26__LENGTH_MSB 12 -#define RDMA_REGION_26__LENGTH_LSB 2 -#define RDMA_REGION_26__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_26__LENGTH_GET(x) (((x) & RDMA_REGION_26__LENGTH_MASK) >> RDMA_REGION_26__LENGTH_LSB) -#define RDMA_REGION_26__LENGTH_SET(x) (((x) << RDMA_REGION_26__LENGTH_LSB) & RDMA_REGION_26__LENGTH_MASK) -#define RDMA_REGION_26__INDI_MSB 1 -#define RDMA_REGION_26__INDI_LSB 1 -#define RDMA_REGION_26__INDI_MASK 0x00000002 -#define RDMA_REGION_26__INDI_GET(x) (((x) & RDMA_REGION_26__INDI_MASK) >> RDMA_REGION_26__INDI_LSB) -#define RDMA_REGION_26__INDI_SET(x) (((x) << RDMA_REGION_26__INDI_LSB) & RDMA_REGION_26__INDI_MASK) -#define RDMA_REGION_26__NEXT_MSB 0 -#define RDMA_REGION_26__NEXT_LSB 0 -#define RDMA_REGION_26__NEXT_MASK 0x00000001 -#define RDMA_REGION_26__NEXT_GET(x) (((x) & RDMA_REGION_26__NEXT_MASK) >> RDMA_REGION_26__NEXT_LSB) -#define RDMA_REGION_26__NEXT_SET(x) (((x) << RDMA_REGION_26__NEXT_LSB) & RDMA_REGION_26__NEXT_MASK) - -#define RDMA_REGION_27__ADDRESS 0x0000008c -#define RDMA_REGION_27__OFFSET 0x0000008c -#define RDMA_REGION_27__ADDR_MSB 31 -#define RDMA_REGION_27__ADDR_LSB 13 -#define RDMA_REGION_27__ADDR_MASK 0xffffe000 -#define RDMA_REGION_27__ADDR_GET(x) (((x) & RDMA_REGION_27__ADDR_MASK) >> RDMA_REGION_27__ADDR_LSB) -#define RDMA_REGION_27__ADDR_SET(x) (((x) << RDMA_REGION_27__ADDR_LSB) & RDMA_REGION_27__ADDR_MASK) -#define RDMA_REGION_27__LENGTH_MSB 12 -#define RDMA_REGION_27__LENGTH_LSB 2 -#define RDMA_REGION_27__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_27__LENGTH_GET(x) (((x) & RDMA_REGION_27__LENGTH_MASK) >> RDMA_REGION_27__LENGTH_LSB) -#define RDMA_REGION_27__LENGTH_SET(x) (((x) << RDMA_REGION_27__LENGTH_LSB) & RDMA_REGION_27__LENGTH_MASK) -#define RDMA_REGION_27__INDI_MSB 1 -#define RDMA_REGION_27__INDI_LSB 1 -#define RDMA_REGION_27__INDI_MASK 0x00000002 -#define RDMA_REGION_27__INDI_GET(x) (((x) & RDMA_REGION_27__INDI_MASK) >> RDMA_REGION_27__INDI_LSB) -#define RDMA_REGION_27__INDI_SET(x) (((x) << RDMA_REGION_27__INDI_LSB) & RDMA_REGION_27__INDI_MASK) -#define RDMA_REGION_27__NEXT_MSB 0 -#define RDMA_REGION_27__NEXT_LSB 0 -#define RDMA_REGION_27__NEXT_MASK 0x00000001 -#define RDMA_REGION_27__NEXT_GET(x) (((x) & RDMA_REGION_27__NEXT_MASK) >> RDMA_REGION_27__NEXT_LSB) -#define RDMA_REGION_27__NEXT_SET(x) (((x) << RDMA_REGION_27__NEXT_LSB) & RDMA_REGION_27__NEXT_MASK) - -#define RDMA_REGION_28__ADDRESS 0x00000090 -#define RDMA_REGION_28__OFFSET 0x00000090 -#define RDMA_REGION_28__ADDR_MSB 31 -#define RDMA_REGION_28__ADDR_LSB 13 -#define RDMA_REGION_28__ADDR_MASK 0xffffe000 -#define RDMA_REGION_28__ADDR_GET(x) (((x) & RDMA_REGION_28__ADDR_MASK) >> RDMA_REGION_28__ADDR_LSB) -#define RDMA_REGION_28__ADDR_SET(x) (((x) << RDMA_REGION_28__ADDR_LSB) & RDMA_REGION_28__ADDR_MASK) -#define RDMA_REGION_28__LENGTH_MSB 12 -#define RDMA_REGION_28__LENGTH_LSB 2 -#define RDMA_REGION_28__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_28__LENGTH_GET(x) (((x) & RDMA_REGION_28__LENGTH_MASK) >> RDMA_REGION_28__LENGTH_LSB) -#define RDMA_REGION_28__LENGTH_SET(x) (((x) << RDMA_REGION_28__LENGTH_LSB) & RDMA_REGION_28__LENGTH_MASK) -#define RDMA_REGION_28__INDI_MSB 1 -#define RDMA_REGION_28__INDI_LSB 1 -#define RDMA_REGION_28__INDI_MASK 0x00000002 -#define RDMA_REGION_28__INDI_GET(x) (((x) & RDMA_REGION_28__INDI_MASK) >> RDMA_REGION_28__INDI_LSB) -#define RDMA_REGION_28__INDI_SET(x) (((x) << RDMA_REGION_28__INDI_LSB) & RDMA_REGION_28__INDI_MASK) -#define RDMA_REGION_28__NEXT_MSB 0 -#define RDMA_REGION_28__NEXT_LSB 0 -#define RDMA_REGION_28__NEXT_MASK 0x00000001 -#define RDMA_REGION_28__NEXT_GET(x) (((x) & RDMA_REGION_28__NEXT_MASK) >> RDMA_REGION_28__NEXT_LSB) -#define RDMA_REGION_28__NEXT_SET(x) (((x) << RDMA_REGION_28__NEXT_LSB) & RDMA_REGION_28__NEXT_MASK) - -#define RDMA_REGION_29__ADDRESS 0x00000094 -#define RDMA_REGION_29__OFFSET 0x00000094 -#define RDMA_REGION_29__ADDR_MSB 31 -#define RDMA_REGION_29__ADDR_LSB 13 -#define RDMA_REGION_29__ADDR_MASK 0xffffe000 -#define RDMA_REGION_29__ADDR_GET(x) (((x) & RDMA_REGION_29__ADDR_MASK) >> RDMA_REGION_29__ADDR_LSB) -#define RDMA_REGION_29__ADDR_SET(x) (((x) << RDMA_REGION_29__ADDR_LSB) & RDMA_REGION_29__ADDR_MASK) -#define RDMA_REGION_29__LENGTH_MSB 12 -#define RDMA_REGION_29__LENGTH_LSB 2 -#define RDMA_REGION_29__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_29__LENGTH_GET(x) (((x) & RDMA_REGION_29__LENGTH_MASK) >> RDMA_REGION_29__LENGTH_LSB) -#define RDMA_REGION_29__LENGTH_SET(x) (((x) << RDMA_REGION_29__LENGTH_LSB) & RDMA_REGION_29__LENGTH_MASK) -#define RDMA_REGION_29__INDI_MSB 1 -#define RDMA_REGION_29__INDI_LSB 1 -#define RDMA_REGION_29__INDI_MASK 0x00000002 -#define RDMA_REGION_29__INDI_GET(x) (((x) & RDMA_REGION_29__INDI_MASK) >> RDMA_REGION_29__INDI_LSB) -#define RDMA_REGION_29__INDI_SET(x) (((x) << RDMA_REGION_29__INDI_LSB) & RDMA_REGION_29__INDI_MASK) -#define RDMA_REGION_29__NEXT_MSB 0 -#define RDMA_REGION_29__NEXT_LSB 0 -#define RDMA_REGION_29__NEXT_MASK 0x00000001 -#define RDMA_REGION_29__NEXT_GET(x) (((x) & RDMA_REGION_29__NEXT_MASK) >> RDMA_REGION_29__NEXT_LSB) -#define RDMA_REGION_29__NEXT_SET(x) (((x) << RDMA_REGION_29__NEXT_LSB) & RDMA_REGION_29__NEXT_MASK) - -#define RDMA_REGION_30__ADDRESS 0x00000098 -#define RDMA_REGION_30__OFFSET 0x00000098 -#define RDMA_REGION_30__ADDR_MSB 31 -#define RDMA_REGION_30__ADDR_LSB 13 -#define RDMA_REGION_30__ADDR_MASK 0xffffe000 -#define RDMA_REGION_30__ADDR_GET(x) (((x) & RDMA_REGION_30__ADDR_MASK) >> RDMA_REGION_30__ADDR_LSB) -#define RDMA_REGION_30__ADDR_SET(x) (((x) << RDMA_REGION_30__ADDR_LSB) & RDMA_REGION_30__ADDR_MASK) -#define RDMA_REGION_30__LENGTH_MSB 12 -#define RDMA_REGION_30__LENGTH_LSB 2 -#define RDMA_REGION_30__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_30__LENGTH_GET(x) (((x) & RDMA_REGION_30__LENGTH_MASK) >> RDMA_REGION_30__LENGTH_LSB) -#define RDMA_REGION_30__LENGTH_SET(x) (((x) << RDMA_REGION_30__LENGTH_LSB) & RDMA_REGION_30__LENGTH_MASK) -#define RDMA_REGION_30__INDI_MSB 1 -#define RDMA_REGION_30__INDI_LSB 1 -#define RDMA_REGION_30__INDI_MASK 0x00000002 -#define RDMA_REGION_30__INDI_GET(x) (((x) & RDMA_REGION_30__INDI_MASK) >> RDMA_REGION_30__INDI_LSB) -#define RDMA_REGION_30__INDI_SET(x) (((x) << RDMA_REGION_30__INDI_LSB) & RDMA_REGION_30__INDI_MASK) -#define RDMA_REGION_30__NEXT_MSB 0 -#define RDMA_REGION_30__NEXT_LSB 0 -#define RDMA_REGION_30__NEXT_MASK 0x00000001 -#define RDMA_REGION_30__NEXT_GET(x) (((x) & RDMA_REGION_30__NEXT_MASK) >> RDMA_REGION_30__NEXT_LSB) -#define RDMA_REGION_30__NEXT_SET(x) (((x) << RDMA_REGION_30__NEXT_LSB) & RDMA_REGION_30__NEXT_MASK) - -#define RDMA_REGION_31__ADDRESS 0x0000009c -#define RDMA_REGION_31__OFFSET 0x0000009c -#define RDMA_REGION_31__ADDR_MSB 31 -#define RDMA_REGION_31__ADDR_LSB 13 -#define RDMA_REGION_31__ADDR_MASK 0xffffe000 -#define RDMA_REGION_31__ADDR_GET(x) (((x) & RDMA_REGION_31__ADDR_MASK) >> RDMA_REGION_31__ADDR_LSB) -#define RDMA_REGION_31__ADDR_SET(x) (((x) << RDMA_REGION_31__ADDR_LSB) & RDMA_REGION_31__ADDR_MASK) -#define RDMA_REGION_31__LENGTH_MSB 12 -#define RDMA_REGION_31__LENGTH_LSB 2 -#define RDMA_REGION_31__LENGTH_MASK 0x00001ffc -#define RDMA_REGION_31__LENGTH_GET(x) (((x) & RDMA_REGION_31__LENGTH_MASK) >> RDMA_REGION_31__LENGTH_LSB) -#define RDMA_REGION_31__LENGTH_SET(x) (((x) << RDMA_REGION_31__LENGTH_LSB) & RDMA_REGION_31__LENGTH_MASK) -#define RDMA_REGION_31__INDI_MSB 1 -#define RDMA_REGION_31__INDI_LSB 1 -#define RDMA_REGION_31__INDI_MASK 0x00000002 -#define RDMA_REGION_31__INDI_GET(x) (((x) & RDMA_REGION_31__INDI_MASK) >> RDMA_REGION_31__INDI_LSB) -#define RDMA_REGION_31__INDI_SET(x) (((x) << RDMA_REGION_31__INDI_LSB) & RDMA_REGION_31__INDI_MASK) -#define RDMA_REGION_31__NEXT_MSB 0 -#define RDMA_REGION_31__NEXT_LSB 0 -#define RDMA_REGION_31__NEXT_MASK 0x00000001 -#define RDMA_REGION_31__NEXT_GET(x) (((x) & RDMA_REGION_31__NEXT_MASK) >> RDMA_REGION_31__NEXT_LSB) -#define RDMA_REGION_31__NEXT_SET(x) (((x) << RDMA_REGION_31__NEXT_LSB) & RDMA_REGION_31__NEXT_MASK) - -#define DMA_STATUS_ADDRESS 0x000000a0 -#define DMA_STATUS_OFFSET 0x000000a0 -#define DMA_STATUS_ERROR_CODE_MSB 14 -#define DMA_STATUS_ERROR_CODE_LSB 4 -#define DMA_STATUS_ERROR_CODE_MASK 0x00007ff0 -#define DMA_STATUS_ERROR_CODE_GET(x) (((x) & DMA_STATUS_ERROR_CODE_MASK) >> DMA_STATUS_ERROR_CODE_LSB) -#define DMA_STATUS_ERROR_CODE_SET(x) (((x) << DMA_STATUS_ERROR_CODE_LSB) & DMA_STATUS_ERROR_CODE_MASK) -#define DMA_STATUS_ERROR_MSB 3 -#define DMA_STATUS_ERROR_LSB 3 -#define DMA_STATUS_ERROR_MASK 0x00000008 -#define DMA_STATUS_ERROR_GET(x) (((x) & DMA_STATUS_ERROR_MASK) >> DMA_STATUS_ERROR_LSB) -#define DMA_STATUS_ERROR_SET(x) (((x) << DMA_STATUS_ERROR_LSB) & DMA_STATUS_ERROR_MASK) -#define DMA_STATUS_DONE_MSB 2 -#define DMA_STATUS_DONE_LSB 2 -#define DMA_STATUS_DONE_MASK 0x00000004 -#define DMA_STATUS_DONE_GET(x) (((x) & DMA_STATUS_DONE_MASK) >> DMA_STATUS_DONE_LSB) -#define DMA_STATUS_DONE_SET(x) (((x) << DMA_STATUS_DONE_LSB) & DMA_STATUS_DONE_MASK) -#define DMA_STATUS_STOPPED_MSB 1 -#define DMA_STATUS_STOPPED_LSB 1 -#define DMA_STATUS_STOPPED_MASK 0x00000002 -#define DMA_STATUS_STOPPED_GET(x) (((x) & DMA_STATUS_STOPPED_MASK) >> DMA_STATUS_STOPPED_LSB) -#define DMA_STATUS_STOPPED_SET(x) (((x) << DMA_STATUS_STOPPED_LSB) & DMA_STATUS_STOPPED_MASK) -#define DMA_STATUS_RUNNING_MSB 0 -#define DMA_STATUS_RUNNING_LSB 0 -#define DMA_STATUS_RUNNING_MASK 0x00000001 -#define DMA_STATUS_RUNNING_GET(x) (((x) & DMA_STATUS_RUNNING_MASK) >> DMA_STATUS_RUNNING_LSB) -#define DMA_STATUS_RUNNING_SET(x) (((x) << DMA_STATUS_RUNNING_LSB) & DMA_STATUS_RUNNING_MASK) - -#define DMA_INT_EN_ADDRESS 0x000000a4 -#define DMA_INT_EN_OFFSET 0x000000a4 -#define DMA_INT_EN_ERROR_ENA_MSB 3 -#define DMA_INT_EN_ERROR_ENA_LSB 3 -#define DMA_INT_EN_ERROR_ENA_MASK 0x00000008 -#define DMA_INT_EN_ERROR_ENA_GET(x) (((x) & DMA_INT_EN_ERROR_ENA_MASK) >> DMA_INT_EN_ERROR_ENA_LSB) -#define DMA_INT_EN_ERROR_ENA_SET(x) (((x) << DMA_INT_EN_ERROR_ENA_LSB) & DMA_INT_EN_ERROR_ENA_MASK) -#define DMA_INT_EN_DONE_ENA_MSB 2 -#define DMA_INT_EN_DONE_ENA_LSB 2 -#define DMA_INT_EN_DONE_ENA_MASK 0x00000004 -#define DMA_INT_EN_DONE_ENA_GET(x) (((x) & DMA_INT_EN_DONE_ENA_MASK) >> DMA_INT_EN_DONE_ENA_LSB) -#define DMA_INT_EN_DONE_ENA_SET(x) (((x) << DMA_INT_EN_DONE_ENA_LSB) & DMA_INT_EN_DONE_ENA_MASK) -#define DMA_INT_EN_STOPPED_ENA_MSB 1 -#define DMA_INT_EN_STOPPED_ENA_LSB 1 -#define DMA_INT_EN_STOPPED_ENA_MASK 0x00000002 -#define DMA_INT_EN_STOPPED_ENA_GET(x) (((x) & DMA_INT_EN_STOPPED_ENA_MASK) >> DMA_INT_EN_STOPPED_ENA_LSB) -#define DMA_INT_EN_STOPPED_ENA_SET(x) (((x) << DMA_INT_EN_STOPPED_ENA_LSB) & DMA_INT_EN_STOPPED_ENA_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct rdma_reg_reg_s { - volatile unsigned int dma_config; - volatile unsigned int dma_control; - volatile unsigned int dma_src; - volatile unsigned int dma_dest; - volatile unsigned int dma_length; - volatile unsigned int vmc_base; - volatile unsigned int indirect_reg; - volatile unsigned int indirect_return; - volatile unsigned int rdma_region_0_; - volatile unsigned int rdma_region_1_; - volatile unsigned int rdma_region_2_; - volatile unsigned int rdma_region_3_; - volatile unsigned int rdma_region_4_; - volatile unsigned int rdma_region_5_; - volatile unsigned int rdma_region_6_; - volatile unsigned int rdma_region_7_; - volatile unsigned int rdma_region_8_; - volatile unsigned int rdma_region_9_; - volatile unsigned int rdma_region_10_; - volatile unsigned int rdma_region_11_; - volatile unsigned int rdma_region_12_; - volatile unsigned int rdma_region_13_; - volatile unsigned int rdma_region_14_; - volatile unsigned int rdma_region_15_; - volatile unsigned int rdma_region_16_; - volatile unsigned int rdma_region_17_; - volatile unsigned int rdma_region_18_; - volatile unsigned int rdma_region_19_; - volatile unsigned int rdma_region_20_; - volatile unsigned int rdma_region_21_; - volatile unsigned int rdma_region_22_; - volatile unsigned int rdma_region_23_; - volatile unsigned int rdma_region_24_; - volatile unsigned int rdma_region_25_; - volatile unsigned int rdma_region_26_; - volatile unsigned int rdma_region_27_; - volatile unsigned int rdma_region_28_; - volatile unsigned int rdma_region_29_; - volatile unsigned int rdma_region_30_; - volatile unsigned int rdma_region_31_; - volatile unsigned int dma_status; - volatile unsigned int dma_int_en; -} rdma_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _RDMA_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_reg.h deleted file mode 100644 index 338bd42c0890..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_reg.h +++ /dev/null @@ -1,1189 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "rtc_wlan_reg.h" -#include "rtc_soc_reg.h" -#include "rtc_sync_reg.h" -#include "fpga_reg.h" - - -#ifndef BT_HEADERS - -#define RESET_CONTROL_MAC_WARM_RST_MSB WLAN_RESET_CONTROL_MAC_WARM_RST_MSB -#define RESET_CONTROL_MAC_WARM_RST_LSB WLAN_RESET_CONTROL_MAC_WARM_RST_LSB -#define RESET_CONTROL_MAC_WARM_RST_MASK WLAN_RESET_CONTROL_MAC_WARM_RST_MASK -#define RESET_CONTROL_MAC_WARM_RST_GET(x) WLAN_RESET_CONTROL_MAC_WARM_RST_GET(x) -#define RESET_CONTROL_MAC_WARM_RST_SET(x) WLAN_RESET_CONTROL_MAC_WARM_RST_SET(x) -#define RESET_CONTROL_MAC_COLD_RST_MSB WLAN_RESET_CONTROL_MAC_COLD_RST_MSB -#define RESET_CONTROL_MAC_COLD_RST_LSB WLAN_RESET_CONTROL_MAC_COLD_RST_LSB -#define RESET_CONTROL_MAC_COLD_RST_MASK WLAN_RESET_CONTROL_MAC_COLD_RST_MASK -#define RESET_CONTROL_MAC_COLD_RST_GET(x) WLAN_RESET_CONTROL_MAC_COLD_RST_GET(x) -#define RESET_CONTROL_MAC_COLD_RST_SET(x) WLAN_RESET_CONTROL_MAC_COLD_RST_SET(x) -#define RESET_CONTROL_WARM_RST_MSB WLAN_RESET_CONTROL_WARM_RST_MSB -#define RESET_CONTROL_WARM_RST_LSB WLAN_RESET_CONTROL_WARM_RST_LSB -#define RESET_CONTROL_WARM_RST_MASK WLAN_RESET_CONTROL_WARM_RST_MASK -#define RESET_CONTROL_WARM_RST_GET(x) WLAN_RESET_CONTROL_WARM_RST_GET(x) -#define RESET_CONTROL_WARM_RST_SET(x) WLAN_RESET_CONTROL_WARM_RST_SET(x) -#define RESET_CONTROL_BB_WARM_RST_MSB WLAN_RESET_CONTROL_BB_WARM_RST_MSB -#define RESET_CONTROL_BB_WARM_RST_LSB WLAN_RESET_CONTROL_BB_WARM_RST_LSB -#define RESET_CONTROL_BB_WARM_RST_MASK WLAN_RESET_CONTROL_BB_WARM_RST_MASK -#define RESET_CONTROL_BB_WARM_RST_GET(x) WLAN_RESET_CONTROL_BB_WARM_RST_GET(x) -#define RESET_CONTROL_BB_WARM_RST_SET(x) WLAN_RESET_CONTROL_BB_WARM_RST_SET(x) -#define RESET_CONTROL_BB_COLD_RST_MSB WLAN_RESET_CONTROL_BB_COLD_RST_MSB -#define RESET_CONTROL_BB_COLD_RST_LSB WLAN_RESET_CONTROL_BB_COLD_RST_LSB -#define RESET_CONTROL_BB_COLD_RST_MASK WLAN_RESET_CONTROL_BB_COLD_RST_MASK -#define RESET_CONTROL_BB_COLD_RST_GET(x) WLAN_RESET_CONTROL_BB_COLD_RST_GET(x) -#define RESET_CONTROL_BB_COLD_RST_SET(x) WLAN_RESET_CONTROL_BB_COLD_RST_SET(x) -#define RESET_CONTROL_RADIO_SRESET_MSB WLAN_RESET_CONTROL_RADIO_SRESET_MSB -#define RESET_CONTROL_RADIO_SRESET_LSB WLAN_RESET_CONTROL_RADIO_SRESET_LSB -#define RESET_CONTROL_RADIO_SRESET_MASK WLAN_RESET_CONTROL_RADIO_SRESET_MASK -#define RESET_CONTROL_RADIO_SRESET_GET(x) WLAN_RESET_CONTROL_RADIO_SRESET_GET(x) -#define RESET_CONTROL_RADIO_SRESET_SET(x) WLAN_RESET_CONTROL_RADIO_SRESET_SET(x) -#define RESET_CONTROL_MCI_RESET_MSB WLAN_RESET_CONTROL_MCI_RESET_MSB -#define RESET_CONTROL_MCI_RESET_LSB WLAN_RESET_CONTROL_MCI_RESET_LSB -#define RESET_CONTROL_MCI_RESET_MASK WLAN_RESET_CONTROL_MCI_RESET_MASK -#define RESET_CONTROL_MCI_RESET_GET(x) WLAN_RESET_CONTROL_MCI_RESET_GET(x) -#define RESET_CONTROL_MCI_RESET_SET(x) WLAN_RESET_CONTROL_MCI_RESET_SET(x) -#define XTAL_CONTROL_TCXO_MSB WLAN_XTAL_CONTROL_TCXO_MSB -#define XTAL_CONTROL_TCXO_LSB WLAN_XTAL_CONTROL_TCXO_LSB -#define XTAL_CONTROL_TCXO_MASK WLAN_XTAL_CONTROL_TCXO_MASK -#define XTAL_CONTROL_TCXO_GET(x) WLAN_XTAL_CONTROL_TCXO_GET(x) -#define XTAL_CONTROL_TCXO_SET(x) WLAN_XTAL_CONTROL_TCXO_SET(x) -#define REG_CONTROL0_SWREG_BITS_MSB WLAN_REG_CONTROL0_SWREG_BITS_MSB -#define REG_CONTROL0_SWREG_BITS_LSB WLAN_REG_CONTROL0_SWREG_BITS_LSB -#define REG_CONTROL0_SWREG_BITS_MASK WLAN_REG_CONTROL0_SWREG_BITS_MASK -#define REG_CONTROL0_SWREG_BITS_GET(x) WLAN_REG_CONTROL0_SWREG_BITS_GET(x) -#define REG_CONTROL0_SWREG_BITS_SET(x) WLAN_REG_CONTROL0_SWREG_BITS_SET(x) -#define REG_CONTROL1_SWREG_PROGRAM_MSB WLAN_REG_CONTROL1_SWREG_PROGRAM_MSB -#define REG_CONTROL1_SWREG_PROGRAM_LSB WLAN_REG_CONTROL1_SWREG_PROGRAM_LSB -#define REG_CONTROL1_SWREG_PROGRAM_MASK WLAN_REG_CONTROL1_SWREG_PROGRAM_MASK -#define REG_CONTROL1_SWREG_PROGRAM_GET(x) WLAN_REG_CONTROL1_SWREG_PROGRAM_GET(x) -#define REG_CONTROL1_SWREG_PROGRAM_SET(x) WLAN_REG_CONTROL1_SWREG_PROGRAM_SET(x) -#define REG_CONTROL1_OTPREG_LVL_MSB WLAN_REG_CONTROL1_OTPREG_LVL_MSB -#define REG_CONTROL1_OTPREG_LVL_LSB WLAN_REG_CONTROL1_OTPREG_LVL_LSB -#define REG_CONTROL1_OTPREG_LVL_MASK WLAN_REG_CONTROL1_OTPREG_LVL_MASK -#define REG_CONTROL1_OTPREG_LVL_GET(x) WLAN_REG_CONTROL1_OTPREG_LVL_GET(x) -#define REG_CONTROL1_OTPREG_LVL_SET(x) WLAN_REG_CONTROL1_OTPREG_LVL_SET(x) -#define QUADRATURE_DAC_MSB WLAN_QUADRATURE_DAC_MSB -#define QUADRATURE_DAC_LSB WLAN_QUADRATURE_DAC_LSB -#define QUADRATURE_DAC_MASK WLAN_QUADRATURE_DAC_MASK -#define QUADRATURE_DAC_GET(x) WLAN_QUADRATURE_DAC_GET(x) -#define QUADRATURE_DAC_SET(x) WLAN_QUADRATURE_DAC_SET(x) -#define QUADRATURE_ADC_MSB WLAN_QUADRATURE_ADC_MSB -#define QUADRATURE_ADC_LSB WLAN_QUADRATURE_ADC_LSB -#define QUADRATURE_ADC_MASK WLAN_QUADRATURE_ADC_MASK -#define QUADRATURE_ADC_GET(x) WLAN_QUADRATURE_ADC_GET(x) -#define QUADRATURE_ADC_SET(x) WLAN_QUADRATURE_ADC_SET(x) -#define PLL_CONTROL_DIV_MSB WLAN_PLL_CONTROL_DIV_MSB -#define PLL_CONTROL_DIV_LSB WLAN_PLL_CONTROL_DIV_LSB -#define PLL_CONTROL_DIV_MASK WLAN_PLL_CONTROL_DIV_MASK -#define PLL_CONTROL_DIV_GET(x) WLAN_PLL_CONTROL_DIV_GET(x) -#define PLL_CONTROL_DIV_SET(x) WLAN_PLL_CONTROL_DIV_SET(x) -#define PLL_CONTROL_REFDIV_MSB WLAN_PLL_CONTROL_REFDIV_MSB -#define PLL_CONTROL_REFDIV_LSB WLAN_PLL_CONTROL_REFDIV_LSB -#define PLL_CONTROL_REFDIV_MASK WLAN_PLL_CONTROL_REFDIV_MASK -#define PLL_CONTROL_REFDIV_GET(x) WLAN_PLL_CONTROL_REFDIV_GET(x) -#define PLL_CONTROL_REFDIV_SET(x) WLAN_PLL_CONTROL_REFDIV_SET(x) -#define PLL_CONTROL_CLK_SEL_MSB WLAN_PLL_CONTROL_CLK_SEL_MSB -#define PLL_CONTROL_CLK_SEL_LSB WLAN_PLL_CONTROL_CLK_SEL_LSB -#define PLL_CONTROL_CLK_SEL_MASK WLAN_PLL_CONTROL_CLK_SEL_MASK -#define PLL_CONTROL_CLK_SEL_GET(x) WLAN_PLL_CONTROL_CLK_SEL_GET(x) -#define PLL_CONTROL_CLK_SEL_SET(x) WLAN_PLL_CONTROL_CLK_SEL_SET(x) -#define PLL_CONTROL_BYPASS_MSB WLAN_PLL_CONTROL_BYPASS_MSB -#define PLL_CONTROL_BYPASS_LSB WLAN_PLL_CONTROL_BYPASS_LSB -#define PLL_CONTROL_BYPASS_MASK WLAN_PLL_CONTROL_BYPASS_MASK -#define PLL_CONTROL_BYPASS_GET(x) WLAN_PLL_CONTROL_BYPASS_GET(x) -#define PLL_CONTROL_BYPASS_SET(x) WLAN_PLL_CONTROL_BYPASS_SET(x) -#define PLL_CONTROL_UPDATING_MSB WLAN_PLL_CONTROL_UPDATING_MSB -#define PLL_CONTROL_UPDATING_LSB WLAN_PLL_CONTROL_UPDATING_LSB -#define PLL_CONTROL_UPDATING_MASK WLAN_PLL_CONTROL_UPDATING_MASK -#define PLL_CONTROL_UPDATING_GET(x) WLAN_PLL_CONTROL_UPDATING_GET(x) -#define PLL_CONTROL_NOPWD_MSB WLAN_PLL_CONTROL_NOPWD_MSB -#define PLL_CONTROL_NOPWD_LSB WLAN_PLL_CONTROL_NOPWD_LSB -#define PLL_CONTROL_NOPWD_MASK WLAN_PLL_CONTROL_NOPWD_MASK -#define PLL_CONTROL_NOPWD_GET(x) WLAN_PLL_CONTROL_NOPWD_GET(x) -#define PLL_CONTROL_NOPWD_SET(x) WLAN_PLL_CONTROL_NOPWD_SET(x) -#define PLL_CONTROL_MAC_OVERRIDE_MSB WLAN_PLL_CONTROL_MAC_OVERRIDE_MSB -#define PLL_CONTROL_MAC_OVERRIDE_LSB WLAN_PLL_CONTROL_MAC_OVERRIDE_LSB -#define PLL_CONTROL_MAC_OVERRIDE_MASK WLAN_PLL_CONTROL_MAC_OVERRIDE_MASK -#define PLL_CONTROL_MAC_OVERRIDE_GET(x) WLAN_PLL_CONTROL_MAC_OVERRIDE_GET(x) -#define PLL_CONTROL_MAC_OVERRIDE_SET(x) WLAN_PLL_CONTROL_MAC_OVERRIDE_SET(x) -#define PLL_CONTROL_DIG_TEST_CLK_MSB WLAN_PLL_CONTROL_DIG_TEST_CLK_MSB -#define PLL_CONTROL_DIG_TEST_CLK_LSB WLAN_PLL_CONTROL_DIG_TEST_CLK_LSB -#define PLL_CONTROL_DIG_TEST_CLK_MASK WLAN_PLL_CONTROL_DIG_TEST_CLK_MASK -#define PLL_CONTROL_DIG_TEST_CLK_GET(x) WLAN_PLL_CONTROL_DIG_TEST_CLK_GET(x) -#define PLL_CONTROL_DIG_TEST_CLK_SET(x) WLAN_PLL_CONTROL_DIG_TEST_CLK_SET(x) -#define PLL_SETTLE_TIME_MSB WLAN_PLL_SETTLE_TIME_MSB -#define PLL_SETTLE_TIME_LSB WLAN_PLL_SETTLE_TIME_LSB -#define PLL_SETTLE_TIME_MASK WLAN_PLL_SETTLE_TIME_MASK -#define PLL_SETTLE_TIME_GET(x) WLAN_PLL_SETTLE_TIME_GET(x) -#define PLL_SETTLE_TIME_SET(x) WLAN_PLL_SETTLE_TIME_SET(x) -#define XTAL_SETTLE_TIME_MSB WLAN_XTAL_SETTLE_TIME_MSB -#define XTAL_SETTLE_TIME_LSB WLAN_XTAL_SETTLE_TIME_LSB -#define XTAL_SETTLE_TIME_MASK WLAN_XTAL_SETTLE_TIME_MASK -#define XTAL_SETTLE_TIME_GET(x) WLAN_XTAL_SETTLE_TIME_GET(x) -#define XTAL_SETTLE_TIME_SET(x) WLAN_XTAL_SETTLE_TIME_SET(x) -#define CLOCK_OUT_SELECT_MSB WLAN_CLOCK_OUT_SELECT_MSB -#define CLOCK_OUT_SELECT_LSB WLAN_CLOCK_OUT_SELECT_LSB -#define CLOCK_OUT_SELECT_MASK WLAN_CLOCK_OUT_SELECT_MASK -#define CLOCK_OUT_SELECT_GET(x) WLAN_CLOCK_OUT_SELECT_GET(x) -#define CLOCK_OUT_SELECT_SET(x) WLAN_CLOCK_OUT_SELECT_SET(x) -#define CLOCK_OUT_DELAY_MSB WLAN_CLOCK_OUT_DELAY_MSB -#define CLOCK_OUT_DELAY_LSB WLAN_CLOCK_OUT_DELAY_LSB -#define CLOCK_OUT_DELAY_MASK WLAN_CLOCK_OUT_DELAY_MASK -#define CLOCK_OUT_DELAY_GET(x) WLAN_CLOCK_OUT_DELAY_GET(x) -#define CLOCK_OUT_DELAY_SET(x) WLAN_CLOCK_OUT_DELAY_SET(x) -#define BIAS_OVERRIDE_ON_MSB WLAN_BIAS_OVERRIDE_ON_MSB -#define BIAS_OVERRIDE_ON_LSB WLAN_BIAS_OVERRIDE_ON_LSB -#define BIAS_OVERRIDE_ON_MASK WLAN_BIAS_OVERRIDE_ON_MASK -#define BIAS_OVERRIDE_ON_GET(x) WLAN_BIAS_OVERRIDE_ON_GET(x) -#define BIAS_OVERRIDE_ON_SET(x) WLAN_BIAS_OVERRIDE_ON_SET(x) -#define MAC_SLEEP_CONTROL_ENABLE_MSB WLAN_MAC_SLEEP_CONTROL_ENABLE_MSB -#define MAC_SLEEP_CONTROL_ENABLE_LSB WLAN_MAC_SLEEP_CONTROL_ENABLE_LSB -#define MAC_SLEEP_CONTROL_ENABLE_MASK WLAN_MAC_SLEEP_CONTROL_ENABLE_MASK -#define MAC_SLEEP_CONTROL_ENABLE_GET(x) WLAN_MAC_SLEEP_CONTROL_ENABLE_GET(x) -#define MAC_SLEEP_CONTROL_ENABLE_SET(x) WLAN_MAC_SLEEP_CONTROL_ENABLE_SET(x) -#define MAC_SLEEP_CONTROL_RESERVED_MSB WLAN_MAC_SLEEP_CONTROL_RESERVED_MSB -#define MAC_SLEEP_CONTROL_RESERVED_LSB WLAN_MAC_SLEEP_CONTROL_RESERVED_LSB -#define MAC_SLEEP_CONTROL_RESERVED_MASK WLAN_MAC_SLEEP_CONTROL_RESERVED_MASK -#define MAC_SLEEP_CONTROL_RESERVED_GET(x) WLAN_MAC_SLEEP_CONTROL_RESERVED_GET(x) -#define MAC_SLEEP_CONTROL_RESERVED_SET(x) WLAN_MAC_SLEEP_CONTROL_RESERVED_SET(x) -#define MAC_SLEEP_CONTROL_HSEL_WMAC_ENABLE_MSB WLAN_MAC_SLEEP_CONTROL_HSEL_WMAC_ENABLE_MSB -#define MAC_SLEEP_CONTROL_HSEL_WMAC_ENABLE_LSB WLAN_MAC_SLEEP_CONTROL_HSEL_WMAC_ENABLE_LSB -#define MAC_SLEEP_CONTROL_HSEL_WMAC_ENABLE_MASK WLAN_MAC_SLEEP_CONTROL_HSEL_WMAC_ENABLE_MASK -#define MAC_SLEEP_CONTROL_HSEL_WMAC_ENABLE_GET(x) WLAN_MAC_SLEEP_CONTROL_HSEL_WMAC_ENABLE_GET(x) -#define MAC_SLEEP_CONTROL_HSEL_WMAC_ENABLE_SET(x) WLAN_MAC_SLEEP_CONTROL_HSEL_WMAC_ENABLE_SET(x) -#define KEEP_AWAKE_COUNT_MSB WLAN_KEEP_AWAKE_COUNT_MSB -#define KEEP_AWAKE_COUNT_LSB WLAN_KEEP_AWAKE_COUNT_LSB -#define KEEP_AWAKE_COUNT_MASK WLAN_KEEP_AWAKE_COUNT_MASK -#define KEEP_AWAKE_COUNT_GET(x) WLAN_KEEP_AWAKE_COUNT_GET(x) -#define KEEP_AWAKE_COUNT_SET(x) WLAN_KEEP_AWAKE_COUNT_SET(x) -#define DERIVED_RTC_CLK_PERIOD_MSB WLAN_DERIVED_RTC_CLK_PERIOD_MSB -#define DERIVED_RTC_CLK_PERIOD_LSB WLAN_DERIVED_RTC_CLK_PERIOD_LSB -#define DERIVED_RTC_CLK_PERIOD_MASK WLAN_DERIVED_RTC_CLK_PERIOD_MASK -#define DERIVED_RTC_CLK_PERIOD_GET(x) WLAN_DERIVED_RTC_CLK_PERIOD_GET(x) -#define DERIVED_RTC_CLK_PERIOD_SET(x) WLAN_DERIVED_RTC_CLK_PERIOD_SET(x) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_MSB WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_MSB -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_GET(x) WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_GET(x) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MSB WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MSB -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_GET(x) WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_GET(x) -#define DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_SET(x) WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_SET(x) -#define MAC_PCU_WBTIMER_ADDRESS MAC_PCU_WBTIMER_0_ADDRESS -#define MAC_PCU_WBTIMER_OFFSET MAC_PCU_WBTIMER_0_OFFSET -#define MAC_PCU_WBTIMER_ENABLE_MSB MAC_PCU_WBTIMER_0_ENABLE_MSB -#define MAC_PCU_WBTIMER_ENABLE_LSB MAC_PCU_WBTIMER_0_ENABLE_LSB -#define MAC_PCU_WBTIMER_ENABLE_MASK MAC_PCU_WBTIMER_0_ENABLE_MASK -#define MAC_PCU_WBTIMER_ENABLE_GET(x) MAC_PCU_WBTIMER_0_ENABLE_GET(x) -#define MAC_PCU_WBTIMER_ENABLE_SET(x) MAC_PCU_WBTIMER_0_ENABLE_SET(x) -#define MAC_PCU_CAB_AWAKE_ADDRESS MAC_PCU_SLP3_ADDRESS -#define MAC_PCU_CAB_AWAKE_OFFSET MAC_PCU_SLP3_OFFSET -#define MAC_PCU_CAB_AWAKE_DURATION_MSB MAC_PCU_SLP3_CAB_AWAKE_DUR_MSB -#define MAC_PCU_CAB_AWAKE_DURATION_LSB MAC_PCU_SLP3_CAB_AWAKE_DUR_LSB -#define MAC_PCU_CAB_AWAKE_DURATION_MASK MAC_PCU_SLP3_CAB_AWAKE_DUR_MASK -#define MAC_PCU_CAB_AWAKE_DURATION_GET(x) MAC_PCU_SLP3_CAB_AWAKE_DUR_GET(x) -#define MAC_PCU_CAB_AWAKE_DURATION_SET(x) MAC_PCU_SLP3_CAB_AWAKE_DUR_SET(x) -#define MAC_PCU_CAB_AWAKE_ENABLE_MSB MAC_PCU_SLP3_CAB_AWAKE_ENABLE_MSB -#define MAC_PCU_CAB_AWAKE_ENABLE_LSB MAC_PCU_SLP3_CAB_AWAKE_ENABLE_LSB -#define MAC_PCU_CAB_AWAKE_ENABLE_MASK MAC_PCU_SLP3_CAB_AWAKE_ENABLE_MASK -#define MAC_PCU_CAB_AWAKE_ENABLE_GET(x) MAC_PCU_SLP3_CAB_AWAKE_ENABLE_GET(x) -#define MAC_PCU_CAB_AWAKE_ENABLE_SET(x) MAC_PCU_SLP3_CAB_AWAKE_ENABLE_SET(x) -#define HT_ADDRESS WLAN_HT_ADDRESS -#define HT_OFFSET WLAN_HT_OFFSET -#define HT_MODE_MSB WLAN_HT_MODE_MSB -#define HT_MODE_LSB WLAN_HT_MODE_LSB -#define HT_MODE_MASK WLAN_HT_MODE_MASK -#define HT_MODE_GET(x) WLAN_HT_MODE_GET(x) -#define HT_MODE_SET(x) WLAN_HT_MODE_SET(x) -#define RESET_CONTROL_ADDRESS SOC_RESET_CONTROL_ADDRESS -#define RESET_CONTROL_OFFSET SOC_RESET_CONTROL_OFFSET -#define RESET_CONTROL_SDIO2_RST_MSB SOC_RESET_CONTROL_SDIO2_RST_MSB -#define RESET_CONTROL_SDIO2_RST_LSB SOC_RESET_CONTROL_SDIO2_RST_LSB -#define RESET_CONTROL_SDIO2_RST_MASK SOC_RESET_CONTROL_SDIO2_RST_MASK -#define RESET_CONTROL_SDIO2_RST_GET(x) SOC_RESET_CONTROL_SDIO2_RST_GET(x) -#define RESET_CONTROL_SDIO2_RST_SET(x) SOC_RESET_CONTROL_SDIO2_RST_SET(x) -#define RESET_CONTROL_SPI2_RST_MSB SOC_RESET_CONTROL_SPI2_RST_MSB -#define RESET_CONTROL_SPI2_RST_LSB SOC_RESET_CONTROL_SPI2_RST_LSB -#define RESET_CONTROL_SPI2_RST_MASK SOC_RESET_CONTROL_SPI2_RST_MASK -#define RESET_CONTROL_SPI2_RST_GET(x) SOC_RESET_CONTROL_SPI2_RST_GET(x) -#define RESET_CONTROL_SPI2_RST_SET(x) SOC_RESET_CONTROL_SPI2_RST_SET(x) -#define RESET_CONTROL_I2S_1_RST_MSB SOC_RESET_CONTROL_I2S_1_RST_MSB -#define RESET_CONTROL_I2S_1_RST_LSB SOC_RESET_CONTROL_I2S_1_RST_LSB -#define RESET_CONTROL_I2S_1_RST_MASK SOC_RESET_CONTROL_I2S_1_RST_MASK -#define RESET_CONTROL_I2S_1_RST_GET(x) SOC_RESET_CONTROL_I2S_1_RST_GET(x) -#define RESET_CONTROL_I2S_1_RST_SET(x) SOC_RESET_CONTROL_I2S_1_RST_SET(x) -#define RESET_CONTROL_I2S_1_MBOX_RST_MSB SOC_RESET_CONTROL_I2S_1_MBOX_RST_MSB -#define RESET_CONTROL_I2S_1_MBOX_RST_LSB SOC_RESET_CONTROL_I2S_1_MBOX_RST_LSB -#define RESET_CONTROL_I2S_1_MBOX_RST_MASK SOC_RESET_CONTROL_I2S_1_MBOX_RST_MASK -#define RESET_CONTROL_I2S_1_MBOX_RST_GET(x) SOC_RESET_CONTROL_I2S_1_MBOX_RST_GET(x) -#define RESET_CONTROL_I2S_1_MBOX_RST_SET(x) SOC_RESET_CONTROL_I2S_1_MBOX_RST_SET(x) -#define RESET_CONTROL_I2C_SLAVE_RST_MSB SOC_RESET_CONTROL_I2C_SLAVE_RST_MSB -#define RESET_CONTROL_I2C_SLAVE_RST_LSB SOC_RESET_CONTROL_I2C_SLAVE_RST_LSB -#define RESET_CONTROL_I2C_SLAVE_RST_MASK SOC_RESET_CONTROL_I2C_SLAVE_RST_MASK -#define RESET_CONTROL_I2C_SLAVE_RST_GET(x) SOC_RESET_CONTROL_I2C_SLAVE_RST_GET(x) -#define RESET_CONTROL_I2C_SLAVE_RST_SET(x) SOC_RESET_CONTROL_I2C_SLAVE_RST_SET(x) -#define RESET_CONTROL_USB_PHY_ARST_MSB SOC_RESET_CONTROL_USB_PHY_ARST_MSB -#define RESET_CONTROL_USB_PHY_ARST_LSB SOC_RESET_CONTROL_USB_PHY_ARST_LSB -#define RESET_CONTROL_USB_PHY_ARST_MASK SOC_RESET_CONTROL_USB_PHY_ARST_MASK -#define RESET_CONTROL_USB_PHY_ARST_GET(x) SOC_RESET_CONTROL_USB_PHY_ARST_GET(x) -#define RESET_CONTROL_USB_PHY_ARST_SET(x) SOC_RESET_CONTROL_USB_PHY_ARST_SET(x) -#define RESET_CONTROL_USB_PHY_RST_MSB SOC_RESET_CONTROL_USB_PHY_RST_MSB -#define RESET_CONTROL_USB_PHY_RST_LSB SOC_RESET_CONTROL_USB_PHY_RST_LSB -#define RESET_CONTROL_USB_PHY_RST_MASK SOC_RESET_CONTROL_USB_PHY_RST_MASK -#define RESET_CONTROL_USB_PHY_RST_GET(x) SOC_RESET_CONTROL_USB_PHY_RST_GET(x) -#define RESET_CONTROL_USB_PHY_RST_SET(x) SOC_RESET_CONTROL_USB_PHY_RST_SET(x) -#define RESET_CONTROL_USB_RST_MSB SOC_RESET_CONTROL_USB_RST_MSB -#define RESET_CONTROL_USB_RST_LSB SOC_RESET_CONTROL_USB_RST_LSB -#define RESET_CONTROL_USB_RST_MASK SOC_RESET_CONTROL_USB_RST_MASK -#define RESET_CONTROL_USB_RST_GET(x) SOC_RESET_CONTROL_USB_RST_GET(x) -#define RESET_CONTROL_USB_RST_SET(x) SOC_RESET_CONTROL_USB_RST_SET(x) -#define RESET_CONTROL_MMAC_RST_MSB SOC_RESET_CONTROL_MMAC_RST_MSB -#define RESET_CONTROL_MMAC_RST_LSB SOC_RESET_CONTROL_MMAC_RST_LSB -#define RESET_CONTROL_MMAC_RST_MASK SOC_RESET_CONTROL_MMAC_RST_MASK -#define RESET_CONTROL_MMAC_RST_GET(x) SOC_RESET_CONTROL_MMAC_RST_GET(x) -#define RESET_CONTROL_MMAC_RST_SET(x) SOC_RESET_CONTROL_MMAC_RST_SET(x) -#define RESET_CONTROL_MDIO_RST_MSB SOC_RESET_CONTROL_MDIO_RST_MSB -#define RESET_CONTROL_MDIO_RST_LSB SOC_RESET_CONTROL_MDIO_RST_LSB -#define RESET_CONTROL_MDIO_RST_MASK SOC_RESET_CONTROL_MDIO_RST_MASK -#define RESET_CONTROL_MDIO_RST_GET(x) SOC_RESET_CONTROL_MDIO_RST_GET(x) -#define RESET_CONTROL_MDIO_RST_SET(x) SOC_RESET_CONTROL_MDIO_RST_SET(x) -#define RESET_CONTROL_GE0_RST_MSB SOC_RESET_CONTROL_GE0_RST_MSB -#define RESET_CONTROL_GE0_RST_LSB SOC_RESET_CONTROL_GE0_RST_LSB -#define RESET_CONTROL_GE0_RST_MASK SOC_RESET_CONTROL_GE0_RST_MASK -#define RESET_CONTROL_GE0_RST_GET(x) SOC_RESET_CONTROL_GE0_RST_GET(x) -#define RESET_CONTROL_GE0_RST_SET(x) SOC_RESET_CONTROL_GE0_RST_SET(x) -#define RESET_CONTROL_I2S_RST_MSB SOC_RESET_CONTROL_I2S_RST_MSB -#define RESET_CONTROL_I2S_RST_LSB SOC_RESET_CONTROL_I2S_RST_LSB -#define RESET_CONTROL_I2S_RST_MASK SOC_RESET_CONTROL_I2S_RST_MASK -#define RESET_CONTROL_I2S_RST_GET(x) SOC_RESET_CONTROL_I2S_RST_GET(x) -#define RESET_CONTROL_I2S_RST_SET(x) SOC_RESET_CONTROL_I2S_RST_SET(x) -#define RESET_CONTROL_I2S_MBOX_RST_MSB SOC_RESET_CONTROL_I2S_MBOX_RST_MSB -#define RESET_CONTROL_I2S_MBOX_RST_LSB SOC_RESET_CONTROL_I2S_MBOX_RST_LSB -#define RESET_CONTROL_I2S_MBOX_RST_MASK SOC_RESET_CONTROL_I2S_MBOX_RST_MASK -#define RESET_CONTROL_I2S_MBOX_RST_GET(x) SOC_RESET_CONTROL_I2S_MBOX_RST_GET(x) -#define RESET_CONTROL_I2S_MBOX_RST_SET(x) SOC_RESET_CONTROL_I2S_MBOX_RST_SET(x) -#define RESET_CONTROL_CHECKSUM_ACC_RST_MSB SOC_RESET_CONTROL_CHECKSUM_ACC_RST_MSB -#define RESET_CONTROL_CHECKSUM_ACC_RST_LSB SOC_RESET_CONTROL_CHECKSUM_ACC_RST_LSB -#define RESET_CONTROL_CHECKSUM_ACC_RST_MASK SOC_RESET_CONTROL_CHECKSUM_ACC_RST_MASK -#define RESET_CONTROL_CHECKSUM_ACC_RST_GET(x) SOC_RESET_CONTROL_CHECKSUM_ACC_RST_GET(x) -#define RESET_CONTROL_CHECKSUM_ACC_RST_SET(x) SOC_RESET_CONTROL_CHECKSUM_ACC_RST_SET(x) -#define RESET_CONTROL_UART2_RST_MSB SOC_RESET_CONTROL_UART2_RST_MSB -#define RESET_CONTROL_UART2_RST_LSB SOC_RESET_CONTROL_UART2_RST_LSB -#define RESET_CONTROL_UART2_RST_MASK SOC_RESET_CONTROL_UART2_RST_MASK -#define RESET_CONTROL_UART2_RST_GET(x) SOC_RESET_CONTROL_UART2_RST_GET(x) -#define RESET_CONTROL_UART2_RST_SET(x) SOC_RESET_CONTROL_UART2_RST_SET(x) -#define RESET_CONTROL_DEBUG_UART_RST_MSB SOC_RESET_CONTROL_DEBUG_UART_RST_MSB -#define RESET_CONTROL_DEBUG_UART_RST_LSB SOC_RESET_CONTROL_DEBUG_UART_RST_LSB -#define RESET_CONTROL_DEBUG_UART_RST_MASK SOC_RESET_CONTROL_DEBUG_UART_RST_MASK -#define RESET_CONTROL_DEBUG_UART_RST_GET(x) SOC_RESET_CONTROL_DEBUG_UART_RST_GET(x) -#define RESET_CONTROL_DEBUG_UART_RST_SET(x) SOC_RESET_CONTROL_DEBUG_UART_RST_SET(x) -#define RESET_CONTROL_MIT_REG_MAPPING_RST_MSB SOC_RESET_CONTROL_MIT_REG_MAPPING_RST_MSB -#define RESET_CONTROL_MIT_REG_MAPPING_RST_LSB SOC_RESET_CONTROL_MIT_REG_MAPPING_RST_LSB -#define RESET_CONTROL_MIT_REG_MAPPING_RST_MASK SOC_RESET_CONTROL_MIT_REG_MAPPING_RST_MASK -#define RESET_CONTROL_MIT_REG_MAPPING_RST_GET(x) SOC_RESET_CONTROL_MIT_REG_MAPPING_RST_GET(x) -#define RESET_CONTROL_MIT_REG_MAPPING_RST_SET(x) SOC_RESET_CONTROL_MIT_REG_MAPPING_RST_SET(x) -#define RESET_CONTROL_MIT_ADAPTOR_RST_MSB SOC_RESET_CONTROL_MIT_ADAPTOR_RST_MSB -#define RESET_CONTROL_MIT_ADAPTOR_RST_LSB SOC_RESET_CONTROL_MIT_ADAPTOR_RST_LSB -#define RESET_CONTROL_MIT_ADAPTOR_RST_MASK SOC_RESET_CONTROL_MIT_ADAPTOR_RST_MASK -#define RESET_CONTROL_MIT_ADAPTOR_RST_GET(x) SOC_RESET_CONTROL_MIT_ADAPTOR_RST_GET(x) -#define RESET_CONTROL_MIT_ADAPTOR_RST_SET(x) SOC_RESET_CONTROL_MIT_ADAPTOR_RST_SET(x) -#define RESET_CONTROL_CPU_INIT_RESET_MSB SOC_RESET_CONTROL_CPU_INIT_RESET_MSB -#define RESET_CONTROL_CPU_INIT_RESET_LSB SOC_RESET_CONTROL_CPU_INIT_RESET_LSB -#define RESET_CONTROL_CPU_INIT_RESET_MASK SOC_RESET_CONTROL_CPU_INIT_RESET_MASK -#define RESET_CONTROL_CPU_INIT_RESET_GET(x) SOC_RESET_CONTROL_CPU_INIT_RESET_GET(x) -#define RESET_CONTROL_CPU_INIT_RESET_SET(x) SOC_RESET_CONTROL_CPU_INIT_RESET_SET(x) -#define RESET_CONTROL_RST_OUT_MSB SOC_RESET_CONTROL_RST_OUT_MSB -#define RESET_CONTROL_RST_OUT_LSB SOC_RESET_CONTROL_RST_OUT_LSB -#define RESET_CONTROL_RST_OUT_MASK SOC_RESET_CONTROL_RST_OUT_MASK -#define RESET_CONTROL_RST_OUT_GET(x) SOC_RESET_CONTROL_RST_OUT_GET(x) -#define RESET_CONTROL_RST_OUT_SET(x) SOC_RESET_CONTROL_RST_OUT_SET(x) -#define RESET_CONTROL_COLD_RST_MSB SOC_RESET_CONTROL_COLD_RST_MSB -#define RESET_CONTROL_COLD_RST_LSB SOC_RESET_CONTROL_COLD_RST_LSB -#define RESET_CONTROL_COLD_RST_MASK SOC_RESET_CONTROL_COLD_RST_MASK -#define RESET_CONTROL_COLD_RST_GET(x) SOC_RESET_CONTROL_COLD_RST_GET(x) -#define RESET_CONTROL_COLD_RST_SET(x) SOC_RESET_CONTROL_COLD_RST_SET(x) -#define RESET_CONTROL_CPU_WARM_RST_MSB SOC_RESET_CONTROL_CPU_WARM_RST_MSB -#define RESET_CONTROL_CPU_WARM_RST_LSB SOC_RESET_CONTROL_CPU_WARM_RST_LSB -#define RESET_CONTROL_CPU_WARM_RST_MASK SOC_RESET_CONTROL_CPU_WARM_RST_MASK -#define RESET_CONTROL_CPU_WARM_RST_GET(x) SOC_RESET_CONTROL_CPU_WARM_RST_GET(x) -#define RESET_CONTROL_CPU_WARM_RST_SET(x) SOC_RESET_CONTROL_CPU_WARM_RST_SET(x) -#define RESET_CONTROL_MBOX_RST_MSB SOC_RESET_CONTROL_MBOX_RST_MSB -#define RESET_CONTROL_MBOX_RST_LSB SOC_RESET_CONTROL_MBOX_RST_LSB -#define RESET_CONTROL_MBOX_RST_MASK SOC_RESET_CONTROL_MBOX_RST_MASK -#define RESET_CONTROL_MBOX_RST_GET(x) SOC_RESET_CONTROL_MBOX_RST_GET(x) -#define RESET_CONTROL_MBOX_RST_SET(x) SOC_RESET_CONTROL_MBOX_RST_SET(x) -#define RESET_CONTROL_UART_RST_MSB SOC_RESET_CONTROL_UART_RST_MSB -#define RESET_CONTROL_UART_RST_LSB SOC_RESET_CONTROL_UART_RST_LSB -#define RESET_CONTROL_UART_RST_MASK SOC_RESET_CONTROL_UART_RST_MASK -#define RESET_CONTROL_UART_RST_GET(x) SOC_RESET_CONTROL_UART_RST_GET(x) -#define RESET_CONTROL_UART_RST_SET(x) SOC_RESET_CONTROL_UART_RST_SET(x) -#define RESET_CONTROL_SI0_RST_MSB SOC_RESET_CONTROL_SI0_RST_MSB -#define RESET_CONTROL_SI0_RST_LSB SOC_RESET_CONTROL_SI0_RST_LSB -#define RESET_CONTROL_SI0_RST_MASK SOC_RESET_CONTROL_SI0_RST_MASK -#define RESET_CONTROL_SI0_RST_GET(x) SOC_RESET_CONTROL_SI0_RST_GET(x) -#define RESET_CONTROL_SI0_RST_SET(x) SOC_RESET_CONTROL_SI0_RST_SET(x) -#define TCXO_DETECT_ADDRESS SOC_TCXO_DETECT_ADDRESS -#define TCXO_DETECT_OFFSET SOC_TCXO_DETECT_OFFSET -#define TCXO_DETECT_PRESENT_MSB SOC_TCXO_DETECT_PRESENT_MSB -#define TCXO_DETECT_PRESENT_LSB SOC_TCXO_DETECT_PRESENT_LSB -#define TCXO_DETECT_PRESENT_MASK SOC_TCXO_DETECT_PRESENT_MASK -#define TCXO_DETECT_PRESENT_GET(x) SOC_TCXO_DETECT_PRESENT_GET(x) -#define TCXO_DETECT_PRESENT_SET(x) SOC_TCXO_DETECT_PRESENT_SET(x) -#define XTAL_TEST_ADDRESS SOC_XTAL_TEST_ADDRESS -#define XTAL_TEST_OFFSET SOC_XTAL_TEST_OFFSET -#define XTAL_TEST_NOTCXODET_MSB SOC_XTAL_TEST_NOTCXODET_MSB -#define XTAL_TEST_NOTCXODET_LSB SOC_XTAL_TEST_NOTCXODET_LSB -#define XTAL_TEST_NOTCXODET_MASK SOC_XTAL_TEST_NOTCXODET_MASK -#define XTAL_TEST_NOTCXODET_GET(x) SOC_XTAL_TEST_NOTCXODET_GET(x) -#define XTAL_TEST_NOTCXODET_SET(x) SOC_XTAL_TEST_NOTCXODET_SET(x) -#define CPU_CLOCK_ADDRESS SOC_CPU_CLOCK_ADDRESS -#define CPU_CLOCK_OFFSET SOC_CPU_CLOCK_OFFSET -#define CPU_CLOCK_STANDARD_MSB SOC_CPU_CLOCK_STANDARD_MSB -#define CPU_CLOCK_STANDARD_LSB SOC_CPU_CLOCK_STANDARD_LSB -#define CPU_CLOCK_STANDARD_MASK SOC_CPU_CLOCK_STANDARD_MASK -#define CPU_CLOCK_STANDARD_GET(x) SOC_CPU_CLOCK_STANDARD_GET(x) -#define CPU_CLOCK_STANDARD_SET(x) SOC_CPU_CLOCK_STANDARD_SET(x) -#define CLOCK_CONTROL_ADDRESS SOC_CLOCK_CONTROL_ADDRESS -#define CLOCK_CONTROL_OFFSET SOC_CLOCK_CONTROL_OFFSET -#define CLOCK_CONTROL_LF_CLK32_MSB SOC_CLOCK_CONTROL_LF_CLK32_MSB -#define CLOCK_CONTROL_LF_CLK32_LSB SOC_CLOCK_CONTROL_LF_CLK32_LSB -#define CLOCK_CONTROL_LF_CLK32_MASK SOC_CLOCK_CONTROL_LF_CLK32_MASK -#define CLOCK_CONTROL_LF_CLK32_GET(x) SOC_CLOCK_CONTROL_LF_CLK32_GET(x) -#define CLOCK_CONTROL_LF_CLK32_SET(x) SOC_CLOCK_CONTROL_LF_CLK32_SET(x) -#define CLOCK_CONTROL_SI0_CLK_MSB SOC_CLOCK_CONTROL_SI0_CLK_MSB -#define CLOCK_CONTROL_SI0_CLK_LSB SOC_CLOCK_CONTROL_SI0_CLK_LSB -#define CLOCK_CONTROL_SI0_CLK_MASK SOC_CLOCK_CONTROL_SI0_CLK_MASK -#define CLOCK_CONTROL_SI0_CLK_GET(x) SOC_CLOCK_CONTROL_SI0_CLK_GET(x) -#define CLOCK_CONTROL_SI0_CLK_SET(x) SOC_CLOCK_CONTROL_SI0_CLK_SET(x) -#define WDT_CONTROL_ADDRESS SOC_WDT_CONTROL_ADDRESS -#define WDT_CONTROL_OFFSET SOC_WDT_CONTROL_OFFSET -#define WDT_CONTROL_ACTION_MSB SOC_WDT_CONTROL_ACTION_MSB -#define WDT_CONTROL_ACTION_LSB SOC_WDT_CONTROL_ACTION_LSB -#define WDT_CONTROL_ACTION_MASK SOC_WDT_CONTROL_ACTION_MASK -#define WDT_CONTROL_ACTION_GET(x) SOC_WDT_CONTROL_ACTION_GET(x) -#define WDT_CONTROL_ACTION_SET(x) SOC_WDT_CONTROL_ACTION_SET(x) -#define WDT_STATUS_ADDRESS SOC_WDT_STATUS_ADDRESS -#define WDT_STATUS_OFFSET SOC_WDT_STATUS_OFFSET -#define WDT_STATUS_INTERRUPT_MSB SOC_WDT_STATUS_INTERRUPT_MSB -#define WDT_STATUS_INTERRUPT_LSB SOC_WDT_STATUS_INTERRUPT_LSB -#define WDT_STATUS_INTERRUPT_MASK SOC_WDT_STATUS_INTERRUPT_MASK -#define WDT_STATUS_INTERRUPT_GET(x) SOC_WDT_STATUS_INTERRUPT_GET(x) -#define WDT_STATUS_INTERRUPT_SET(x) SOC_WDT_STATUS_INTERRUPT_SET(x) -#define WDT_ADDRESS SOC_WDT_ADDRESS -#define WDT_OFFSET SOC_WDT_OFFSET -#define WDT_TARGET_MSB SOC_WDT_TARGET_MSB -#define WDT_TARGET_LSB SOC_WDT_TARGET_LSB -#define WDT_TARGET_MASK SOC_WDT_TARGET_MASK -#define WDT_TARGET_GET(x) SOC_WDT_TARGET_GET(x) -#define WDT_TARGET_SET(x) SOC_WDT_TARGET_SET(x) -#define WDT_COUNT_ADDRESS SOC_WDT_COUNT_ADDRESS -#define WDT_COUNT_OFFSET SOC_WDT_COUNT_OFFSET -#define WDT_COUNT_VALUE_MSB SOC_WDT_COUNT_VALUE_MSB -#define WDT_COUNT_VALUE_LSB SOC_WDT_COUNT_VALUE_LSB -#define WDT_COUNT_VALUE_MASK SOC_WDT_COUNT_VALUE_MASK -#define WDT_COUNT_VALUE_GET(x) SOC_WDT_COUNT_VALUE_GET(x) -#define WDT_COUNT_VALUE_SET(x) SOC_WDT_COUNT_VALUE_SET(x) -#define WDT_RESET_ADDRESS SOC_WDT_RESET_ADDRESS -#define WDT_RESET_OFFSET SOC_WDT_RESET_OFFSET -#define WDT_RESET_VALUE_MSB SOC_WDT_RESET_VALUE_MSB -#define WDT_RESET_VALUE_LSB SOC_WDT_RESET_VALUE_LSB -#define WDT_RESET_VALUE_MASK SOC_WDT_RESET_VALUE_MASK -#define WDT_RESET_VALUE_GET(x) SOC_WDT_RESET_VALUE_GET(x) -#define WDT_RESET_VALUE_SET(x) SOC_WDT_RESET_VALUE_SET(x) -#define INT_STATUS_ADDRESS SOC_INT_STATUS_ADDRESS -#define INT_STATUS_OFFSET SOC_INT_STATUS_OFFSET -#define INT_STATUS_STE_MBOX_MSB SOC_INT_STATUS_STE_MBOX_MSB -#define INT_STATUS_STE_MBOX_LSB SOC_INT_STATUS_STE_MBOX_LSB -#define INT_STATUS_STE_MBOX_MASK SOC_INT_STATUS_STE_MBOX_MASK -#define INT_STATUS_STE_MBOX_GET(x) SOC_INT_STATUS_STE_MBOX_GET(x) -#define INT_STATUS_STE_MBOX_SET(x) SOC_INT_STATUS_STE_MBOX_SET(x) -#define INT_STATUS_SDIO2_MBOX_MSB SOC_INT_STATUS_SDIO2_MBOX_MSB -#define INT_STATUS_SDIO2_MBOX_LSB SOC_INT_STATUS_SDIO2_MBOX_LSB -#define INT_STATUS_SDIO2_MBOX_MASK SOC_INT_STATUS_SDIO2_MBOX_MASK -#define INT_STATUS_SDIO2_MBOX_GET(x) SOC_INT_STATUS_SDIO2_MBOX_GET(x) -#define INT_STATUS_SDIO2_MBOX_SET(x) SOC_INT_STATUS_SDIO2_MBOX_SET(x) -#define INT_STATUS_USBDMA_MSB SOC_INT_STATUS_USBDMA_MSB -#define INT_STATUS_USBDMA_LSB SOC_INT_STATUS_USBDMA_LSB -#define INT_STATUS_USBDMA_MASK SOC_INT_STATUS_USBDMA_MASK -#define INT_STATUS_USBDMA_GET(x) SOC_INT_STATUS_USBDMA_GET(x) -#define INT_STATUS_USBDMA_SET(x) SOC_INT_STATUS_USBDMA_SET(x) -#define INT_STATUS_USBIP_MSB SOC_INT_STATUS_USBIP_MSB -#define INT_STATUS_USBIP_LSB SOC_INT_STATUS_USBIP_LSB -#define INT_STATUS_USBIP_MASK SOC_INT_STATUS_USBIP_MASK -#define INT_STATUS_USBIP_GET(x) SOC_INT_STATUS_USBIP_GET(x) -#define INT_STATUS_USBIP_SET(x) SOC_INT_STATUS_USBIP_SET(x) -#define INT_STATUS_MMAC_MSB SOC_INT_STATUS_MMAC_MSB -#define INT_STATUS_MMAC_LSB SOC_INT_STATUS_MMAC_LSB -#define INT_STATUS_MMAC_MASK SOC_INT_STATUS_MMAC_MASK -#define INT_STATUS_MMAC_GET(x) SOC_INT_STATUS_MMAC_GET(x) -#define INT_STATUS_MMAC_SET(x) SOC_INT_STATUS_MMAC_SET(x) -#define INT_STATUS_MIT_REG_ACCESS_MSB SOC_INT_STATUS_MIT_REG_ACCESS_MSB -#define INT_STATUS_MIT_REG_ACCESS_LSB SOC_INT_STATUS_MIT_REG_ACCESS_LSB -#define INT_STATUS_MIT_REG_ACCESS_MASK SOC_INT_STATUS_MIT_REG_ACCESS_MASK -#define INT_STATUS_MIT_REG_ACCESS_GET(x) SOC_INT_STATUS_MIT_REG_ACCESS_GET(x) -#define INT_STATUS_MIT_REG_ACCESS_SET(x) SOC_INT_STATUS_MIT_REG_ACCESS_SET(x) -#define INT_STATUS_FLIGHT_MODE_MSB SOC_INT_STATUS_FLIGHT_MODE_MSB -#define INT_STATUS_FLIGHT_MODE_LSB SOC_INT_STATUS_FLIGHT_MODE_LSB -#define INT_STATUS_FLIGHT_MODE_MASK SOC_INT_STATUS_FLIGHT_MODE_MASK -#define INT_STATUS_FLIGHT_MODE_GET(x) SOC_INT_STATUS_FLIGHT_MODE_GET(x) -#define INT_STATUS_FLIGHT_MODE_SET(x) SOC_INT_STATUS_FLIGHT_MODE_SET(x) -#define INT_STATUS_BBP_SLEEP_RISING_MSB SOC_INT_STATUS_BBP_SLEEP_RISING_MSB -#define INT_STATUS_BBP_SLEEP_RISING_LSB SOC_INT_STATUS_BBP_SLEEP_RISING_LSB -#define INT_STATUS_BBP_SLEEP_RISING_MASK SOC_INT_STATUS_BBP_SLEEP_RISING_MASK -#define INT_STATUS_BBP_SLEEP_RISING_GET(x) SOC_INT_STATUS_BBP_SLEEP_RISING_GET(x) -#define INT_STATUS_BBP_SLEEP_RISING_SET(x) SOC_INT_STATUS_BBP_SLEEP_RISING_SET(x) -#define INT_STATUS_RF_SLEEP_RISING_MSB SOC_INT_STATUS_RF_SLEEP_RISING_MSB -#define INT_STATUS_RF_SLEEP_RISING_LSB SOC_INT_STATUS_RF_SLEEP_RISING_LSB -#define INT_STATUS_RF_SLEEP_RISING_MASK SOC_INT_STATUS_RF_SLEEP_RISING_MASK -#define INT_STATUS_RF_SLEEP_RISING_GET(x) SOC_INT_STATUS_RF_SLEEP_RISING_GET(x) -#define INT_STATUS_RF_SLEEP_RISING_SET(x) SOC_INT_STATUS_RF_SLEEP_RISING_SET(x) -#define INT_STATUS_MODE_SWITCH_MSB SOC_INT_STATUS_MODE_SWITCH_MSB -#define INT_STATUS_MODE_SWITCH_LSB SOC_INT_STATUS_MODE_SWITCH_LSB -#define INT_STATUS_MODE_SWITCH_MASK SOC_INT_STATUS_MODE_SWITCH_MASK -#define INT_STATUS_MODE_SWITCH_GET(x) SOC_INT_STATUS_MODE_SWITCH_GET(x) -#define INT_STATUS_MODE_SWITCH_SET(x) SOC_INT_STATUS_MODE_SWITCH_SET(x) -#define INT_STATUS_HCI_UART_MSB SOC_INT_STATUS_HCI_UART_MSB -#define INT_STATUS_HCI_UART_LSB SOC_INT_STATUS_HCI_UART_LSB -#define INT_STATUS_HCI_UART_MASK SOC_INT_STATUS_HCI_UART_MASK -#define INT_STATUS_HCI_UART_GET(x) SOC_INT_STATUS_HCI_UART_GET(x) -#define INT_STATUS_HCI_UART_SET(x) SOC_INT_STATUS_HCI_UART_SET(x) -#define INT_STATUS_THERM_MSB SOC_INT_STATUS_THERM_MSB -#define INT_STATUS_THERM_LSB SOC_INT_STATUS_THERM_LSB -#define INT_STATUS_THERM_MASK SOC_INT_STATUS_THERM_MASK -#define INT_STATUS_THERM_GET(x) SOC_INT_STATUS_THERM_GET(x) -#define INT_STATUS_THERM_SET(x) SOC_INT_STATUS_THERM_SET(x) -#define INT_STATUS_EFUSE_OVERWRITE_MSB SOC_INT_STATUS_EFUSE_OVERWRITE_MSB -#define INT_STATUS_EFUSE_OVERWRITE_LSB SOC_INT_STATUS_EFUSE_OVERWRITE_LSB -#define INT_STATUS_EFUSE_OVERWRITE_MASK SOC_INT_STATUS_EFUSE_OVERWRITE_MASK -#define INT_STATUS_EFUSE_OVERWRITE_GET(x) SOC_INT_STATUS_EFUSE_OVERWRITE_GET(x) -#define INT_STATUS_EFUSE_OVERWRITE_SET(x) SOC_INT_STATUS_EFUSE_OVERWRITE_SET(x) -#define INT_STATUS_UART_MBOX_MSB SOC_INT_STATUS_UART_MBOX_MSB -#define INT_STATUS_UART_MBOX_LSB SOC_INT_STATUS_UART_MBOX_LSB -#define INT_STATUS_UART_MBOX_MASK SOC_INT_STATUS_UART_MBOX_MASK -#define INT_STATUS_UART_MBOX_GET(x) SOC_INT_STATUS_UART_MBOX_GET(x) -#define INT_STATUS_UART_MBOX_SET(x) SOC_INT_STATUS_UART_MBOX_SET(x) -#define INT_STATUS_GENERIC_MBOX_MSB SOC_INT_STATUS_GENERIC_MBOX_MSB -#define INT_STATUS_GENERIC_MBOX_LSB SOC_INT_STATUS_GENERIC_MBOX_LSB -#define INT_STATUS_GENERIC_MBOX_MASK SOC_INT_STATUS_GENERIC_MBOX_MASK -#define INT_STATUS_GENERIC_MBOX_GET(x) SOC_INT_STATUS_GENERIC_MBOX_GET(x) -#define INT_STATUS_GENERIC_MBOX_SET(x) SOC_INT_STATUS_GENERIC_MBOX_SET(x) -#define INT_STATUS_RDMA_MSB SOC_INT_STATUS_RDMA_MSB -#define INT_STATUS_RDMA_LSB SOC_INT_STATUS_RDMA_LSB -#define INT_STATUS_RDMA_MASK SOC_INT_STATUS_RDMA_MASK -#define INT_STATUS_RDMA_GET(x) SOC_INT_STATUS_RDMA_GET(x) -#define INT_STATUS_RDMA_SET(x) SOC_INT_STATUS_RDMA_SET(x) -#define INT_STATUS_BTCOEX_MSB SOC_INT_STATUS_BTCOEX_MSB -#define INT_STATUS_BTCOEX_LSB SOC_INT_STATUS_BTCOEX_LSB -#define INT_STATUS_BTCOEX_MASK SOC_INT_STATUS_BTCOEX_MASK -#define INT_STATUS_BTCOEX_GET(x) SOC_INT_STATUS_BTCOEX_GET(x) -#define INT_STATUS_BTCOEX_SET(x) SOC_INT_STATUS_BTCOEX_SET(x) -#define INT_STATUS_RTC_POWER_MSB SOC_INT_STATUS_RTC_POWER_MSB -#define INT_STATUS_RTC_POWER_LSB SOC_INT_STATUS_RTC_POWER_LSB -#define INT_STATUS_RTC_POWER_MASK SOC_INT_STATUS_RTC_POWER_MASK -#define INT_STATUS_RTC_POWER_GET(x) SOC_INT_STATUS_RTC_POWER_GET(x) -#define INT_STATUS_RTC_POWER_SET(x) SOC_INT_STATUS_RTC_POWER_SET(x) -#define INT_STATUS_MAC_MSB SOC_INT_STATUS_MAC_MSB -#define INT_STATUS_MAC_LSB SOC_INT_STATUS_MAC_LSB -#define INT_STATUS_MAC_MASK SOC_INT_STATUS_MAC_MASK -#define INT_STATUS_MAC_GET(x) SOC_INT_STATUS_MAC_GET(x) -#define INT_STATUS_MAC_SET(x) SOC_INT_STATUS_MAC_SET(x) -#define INT_STATUS_MAILBOX_MSB SOC_INT_STATUS_MAILBOX_MSB -#define INT_STATUS_MAILBOX_LSB SOC_INT_STATUS_MAILBOX_LSB -#define INT_STATUS_MAILBOX_MASK SOC_INT_STATUS_MAILBOX_MASK -#define INT_STATUS_MAILBOX_GET(x) SOC_INT_STATUS_MAILBOX_GET(x) -#define INT_STATUS_MAILBOX_SET(x) SOC_INT_STATUS_MAILBOX_SET(x) -#define INT_STATUS_RTC_ALARM_MSB SOC_INT_STATUS_RTC_ALARM_MSB -#define INT_STATUS_RTC_ALARM_LSB SOC_INT_STATUS_RTC_ALARM_LSB -#define INT_STATUS_RTC_ALARM_MASK SOC_INT_STATUS_RTC_ALARM_MASK -#define INT_STATUS_RTC_ALARM_GET(x) SOC_INT_STATUS_RTC_ALARM_GET(x) -#define INT_STATUS_RTC_ALARM_SET(x) SOC_INT_STATUS_RTC_ALARM_SET(x) -#define INT_STATUS_HF_TIMER_MSB SOC_INT_STATUS_HF_TIMER_MSB -#define INT_STATUS_HF_TIMER_LSB SOC_INT_STATUS_HF_TIMER_LSB -#define INT_STATUS_HF_TIMER_MASK SOC_INT_STATUS_HF_TIMER_MASK -#define INT_STATUS_HF_TIMER_GET(x) SOC_INT_STATUS_HF_TIMER_GET(x) -#define INT_STATUS_HF_TIMER_SET(x) SOC_INT_STATUS_HF_TIMER_SET(x) -#define INT_STATUS_LF_TIMER3_MSB SOC_INT_STATUS_LF_TIMER3_MSB -#define INT_STATUS_LF_TIMER3_LSB SOC_INT_STATUS_LF_TIMER3_LSB -#define INT_STATUS_LF_TIMER3_MASK SOC_INT_STATUS_LF_TIMER3_MASK -#define INT_STATUS_LF_TIMER3_GET(x) SOC_INT_STATUS_LF_TIMER3_GET(x) -#define INT_STATUS_LF_TIMER3_SET(x) SOC_INT_STATUS_LF_TIMER3_SET(x) -#define INT_STATUS_LF_TIMER2_MSB SOC_INT_STATUS_LF_TIMER2_MSB -#define INT_STATUS_LF_TIMER2_LSB SOC_INT_STATUS_LF_TIMER2_LSB -#define INT_STATUS_LF_TIMER2_MASK SOC_INT_STATUS_LF_TIMER2_MASK -#define INT_STATUS_LF_TIMER2_GET(x) SOC_INT_STATUS_LF_TIMER2_GET(x) -#define INT_STATUS_LF_TIMER2_SET(x) SOC_INT_STATUS_LF_TIMER2_SET(x) -#define INT_STATUS_LF_TIMER1_MSB SOC_INT_STATUS_LF_TIMER1_MSB -#define INT_STATUS_LF_TIMER1_LSB SOC_INT_STATUS_LF_TIMER1_LSB -#define INT_STATUS_LF_TIMER1_MASK SOC_INT_STATUS_LF_TIMER1_MASK -#define INT_STATUS_LF_TIMER1_GET(x) SOC_INT_STATUS_LF_TIMER1_GET(x) -#define INT_STATUS_LF_TIMER1_SET(x) SOC_INT_STATUS_LF_TIMER1_SET(x) -#define INT_STATUS_LF_TIMER0_MSB SOC_INT_STATUS_LF_TIMER0_MSB -#define INT_STATUS_LF_TIMER0_LSB SOC_INT_STATUS_LF_TIMER0_LSB -#define INT_STATUS_LF_TIMER0_MASK SOC_INT_STATUS_LF_TIMER0_MASK -#define INT_STATUS_LF_TIMER0_GET(x) SOC_INT_STATUS_LF_TIMER0_GET(x) -#define INT_STATUS_LF_TIMER0_SET(x) SOC_INT_STATUS_LF_TIMER0_SET(x) -#define INT_STATUS_KEYPAD_MSB SOC_INT_STATUS_KEYPAD_MSB -#define INT_STATUS_KEYPAD_LSB SOC_INT_STATUS_KEYPAD_LSB -#define INT_STATUS_KEYPAD_MASK SOC_INT_STATUS_KEYPAD_MASK -#define INT_STATUS_KEYPAD_GET(x) SOC_INT_STATUS_KEYPAD_GET(x) -#define INT_STATUS_KEYPAD_SET(x) SOC_INT_STATUS_KEYPAD_SET(x) -#define INT_STATUS_SI_MSB SOC_INT_STATUS_SI_MSB -#define INT_STATUS_SI_LSB SOC_INT_STATUS_SI_LSB -#define INT_STATUS_SI_MASK SOC_INT_STATUS_SI_MASK -#define INT_STATUS_SI_GET(x) SOC_INT_STATUS_SI_GET(x) -#define INT_STATUS_SI_SET(x) SOC_INT_STATUS_SI_SET(x) -#define INT_STATUS_GPIO_MSB SOC_INT_STATUS_GPIO_MSB -#define INT_STATUS_GPIO_LSB SOC_INT_STATUS_GPIO_LSB -#define INT_STATUS_GPIO_MASK SOC_INT_STATUS_GPIO_MASK -#define INT_STATUS_GPIO_GET(x) SOC_INT_STATUS_GPIO_GET(x) -#define INT_STATUS_GPIO_SET(x) SOC_INT_STATUS_GPIO_SET(x) -#define INT_STATUS_UART_MSB SOC_INT_STATUS_UART_MSB -#define INT_STATUS_UART_LSB SOC_INT_STATUS_UART_LSB -#define INT_STATUS_UART_MASK SOC_INT_STATUS_UART_MASK -#define INT_STATUS_UART_GET(x) SOC_INT_STATUS_UART_GET(x) -#define INT_STATUS_UART_SET(x) SOC_INT_STATUS_UART_SET(x) -#define INT_STATUS_ERROR_MSB SOC_INT_STATUS_ERROR_MSB -#define INT_STATUS_ERROR_LSB SOC_INT_STATUS_ERROR_LSB -#define INT_STATUS_ERROR_MASK SOC_INT_STATUS_ERROR_MASK -#define INT_STATUS_ERROR_GET(x) SOC_INT_STATUS_ERROR_GET(x) -#define INT_STATUS_ERROR_SET(x) SOC_INT_STATUS_ERROR_SET(x) -#define INT_STATUS_WDT_INT_MSB SOC_INT_STATUS_WDT_INT_MSB -#define INT_STATUS_WDT_INT_LSB SOC_INT_STATUS_WDT_INT_LSB -#define INT_STATUS_WDT_INT_MASK SOC_INT_STATUS_WDT_INT_MASK -#define INT_STATUS_WDT_INT_GET(x) SOC_INT_STATUS_WDT_INT_GET(x) -#define INT_STATUS_WDT_INT_SET(x) SOC_INT_STATUS_WDT_INT_SET(x) -#define LF_TIMER0_ADDRESS SOC_LF_TIMER0_ADDRESS -#define LF_TIMER0_OFFSET SOC_LF_TIMER0_OFFSET -#define LF_TIMER0_TARGET_MSB SOC_LF_TIMER0_TARGET_MSB -#define LF_TIMER0_TARGET_LSB SOC_LF_TIMER0_TARGET_LSB -#define LF_TIMER0_TARGET_MASK SOC_LF_TIMER0_TARGET_MASK -#define LF_TIMER0_TARGET_GET(x) SOC_LF_TIMER0_TARGET_GET(x) -#define LF_TIMER0_TARGET_SET(x) SOC_LF_TIMER0_TARGET_SET(x) -#define LF_TIMER_COUNT0_ADDRESS SOC_LF_TIMER_COUNT0_ADDRESS -#define LF_TIMER_COUNT0_OFFSET SOC_LF_TIMER_COUNT0_OFFSET -#define LF_TIMER_COUNT0_VALUE_MSB SOC_LF_TIMER_COUNT0_VALUE_MSB -#define LF_TIMER_COUNT0_VALUE_LSB SOC_LF_TIMER_COUNT0_VALUE_LSB -#define LF_TIMER_COUNT0_VALUE_MASK SOC_LF_TIMER_COUNT0_VALUE_MASK -#define LF_TIMER_COUNT0_VALUE_GET(x) SOC_LF_TIMER_COUNT0_VALUE_GET(x) -#define LF_TIMER_COUNT0_VALUE_SET(x) SOC_LF_TIMER_COUNT0_VALUE_SET(x) -#define LF_TIMER_CONTROL0_ADDRESS SOC_LF_TIMER_CONTROL0_ADDRESS -#define LF_TIMER_CONTROL0_OFFSET SOC_LF_TIMER_CONTROL0_OFFSET -#define LF_TIMER_CONTROL0_ENABLE_MSB SOC_LF_TIMER_CONTROL0_ENABLE_MSB -#define LF_TIMER_CONTROL0_ENABLE_LSB SOC_LF_TIMER_CONTROL0_ENABLE_LSB -#define LF_TIMER_CONTROL0_ENABLE_MASK SOC_LF_TIMER_CONTROL0_ENABLE_MASK -#define LF_TIMER_CONTROL0_ENABLE_GET(x) SOC_LF_TIMER_CONTROL0_ENABLE_GET(x) -#define LF_TIMER_CONTROL0_ENABLE_SET(x) SOC_LF_TIMER_CONTROL0_ENABLE_SET(x) -#define LF_TIMER_CONTROL0_AUTO_RESTART_MSB SOC_LF_TIMER_CONTROL0_AUTO_RESTART_MSB -#define LF_TIMER_CONTROL0_AUTO_RESTART_LSB SOC_LF_TIMER_CONTROL0_AUTO_RESTART_LSB -#define LF_TIMER_CONTROL0_AUTO_RESTART_MASK SOC_LF_TIMER_CONTROL0_AUTO_RESTART_MASK -#define LF_TIMER_CONTROL0_AUTO_RESTART_GET(x) SOC_LF_TIMER_CONTROL0_AUTO_RESTART_GET(x) -#define LF_TIMER_CONTROL0_AUTO_RESTART_SET(x) SOC_LF_TIMER_CONTROL0_AUTO_RESTART_SET(x) -#define LF_TIMER_CONTROL0_RESET_MSB SOC_LF_TIMER_CONTROL0_RESET_MSB -#define LF_TIMER_CONTROL0_RESET_LSB SOC_LF_TIMER_CONTROL0_RESET_LSB -#define LF_TIMER_CONTROL0_RESET_MASK SOC_LF_TIMER_CONTROL0_RESET_MASK -#define LF_TIMER_CONTROL0_RESET_GET(x) SOC_LF_TIMER_CONTROL0_RESET_GET(x) -#define LF_TIMER_CONTROL0_RESET_SET(x) SOC_LF_TIMER_CONTROL0_RESET_SET(x) -#define LF_TIMER_STATUS0_ADDRESS SOC_LF_TIMER_STATUS0_ADDRESS -#define LF_TIMER_STATUS0_OFFSET SOC_LF_TIMER_STATUS0_OFFSET -#define LF_TIMER_STATUS0_INTERRUPT_MSB SOC_LF_TIMER_STATUS0_INTERRUPT_MSB -#define LF_TIMER_STATUS0_INTERRUPT_LSB SOC_LF_TIMER_STATUS0_INTERRUPT_LSB -#define LF_TIMER_STATUS0_INTERRUPT_MASK SOC_LF_TIMER_STATUS0_INTERRUPT_MASK -#define LF_TIMER_STATUS0_INTERRUPT_GET(x) SOC_LF_TIMER_STATUS0_INTERRUPT_GET(x) -#define LF_TIMER_STATUS0_INTERRUPT_SET(x) SOC_LF_TIMER_STATUS0_INTERRUPT_SET(x) -#define LF_TIMER1_ADDRESS SOC_LF_TIMER1_ADDRESS -#define LF_TIMER1_OFFSET SOC_LF_TIMER1_OFFSET -#define LF_TIMER1_TARGET_MSB SOC_LF_TIMER1_TARGET_MSB -#define LF_TIMER1_TARGET_LSB SOC_LF_TIMER1_TARGET_LSB -#define LF_TIMER1_TARGET_MASK SOC_LF_TIMER1_TARGET_MASK -#define LF_TIMER1_TARGET_GET(x) SOC_LF_TIMER1_TARGET_GET(x) -#define LF_TIMER1_TARGET_SET(x) SOC_LF_TIMER1_TARGET_SET(x) -#define LF_TIMER_COUNT1_ADDRESS SOC_LF_TIMER_COUNT1_ADDRESS -#define LF_TIMER_COUNT1_OFFSET SOC_LF_TIMER_COUNT1_OFFSET -#define LF_TIMER_COUNT1_VALUE_MSB SOC_LF_TIMER_COUNT1_VALUE_MSB -#define LF_TIMER_COUNT1_VALUE_LSB SOC_LF_TIMER_COUNT1_VALUE_LSB -#define LF_TIMER_COUNT1_VALUE_MASK SOC_LF_TIMER_COUNT1_VALUE_MASK -#define LF_TIMER_COUNT1_VALUE_GET(x) SOC_LF_TIMER_COUNT1_VALUE_GET(x) -#define LF_TIMER_COUNT1_VALUE_SET(x) SOC_LF_TIMER_COUNT1_VALUE_SET(x) -#define LF_TIMER_CONTROL1_ADDRESS SOC_LF_TIMER_CONTROL1_ADDRESS -#define LF_TIMER_CONTROL1_OFFSET SOC_LF_TIMER_CONTROL1_OFFSET -#define LF_TIMER_CONTROL1_ENABLE_MSB SOC_LF_TIMER_CONTROL1_ENABLE_MSB -#define LF_TIMER_CONTROL1_ENABLE_LSB SOC_LF_TIMER_CONTROL1_ENABLE_LSB -#define LF_TIMER_CONTROL1_ENABLE_MASK SOC_LF_TIMER_CONTROL1_ENABLE_MASK -#define LF_TIMER_CONTROL1_ENABLE_GET(x) SOC_LF_TIMER_CONTROL1_ENABLE_GET(x) -#define LF_TIMER_CONTROL1_ENABLE_SET(x) SOC_LF_TIMER_CONTROL1_ENABLE_SET(x) -#define LF_TIMER_CONTROL1_AUTO_RESTART_MSB SOC_LF_TIMER_CONTROL1_AUTO_RESTART_MSB -#define LF_TIMER_CONTROL1_AUTO_RESTART_LSB SOC_LF_TIMER_CONTROL1_AUTO_RESTART_LSB -#define LF_TIMER_CONTROL1_AUTO_RESTART_MASK SOC_LF_TIMER_CONTROL1_AUTO_RESTART_MASK -#define LF_TIMER_CONTROL1_AUTO_RESTART_GET(x) SOC_LF_TIMER_CONTROL1_AUTO_RESTART_GET(x) -#define LF_TIMER_CONTROL1_AUTO_RESTART_SET(x) SOC_LF_TIMER_CONTROL1_AUTO_RESTART_SET(x) -#define LF_TIMER_CONTROL1_RESET_MSB SOC_LF_TIMER_CONTROL1_RESET_MSB -#define LF_TIMER_CONTROL1_RESET_LSB SOC_LF_TIMER_CONTROL1_RESET_LSB -#define LF_TIMER_CONTROL1_RESET_MASK SOC_LF_TIMER_CONTROL1_RESET_MASK -#define LF_TIMER_CONTROL1_RESET_GET(x) SOC_LF_TIMER_CONTROL1_RESET_GET(x) -#define LF_TIMER_CONTROL1_RESET_SET(x) SOC_LF_TIMER_CONTROL1_RESET_SET(x) -#define LF_TIMER_STATUS1_ADDRESS SOC_LF_TIMER_STATUS1_ADDRESS -#define LF_TIMER_STATUS1_OFFSET SOC_LF_TIMER_STATUS1_OFFSET -#define LF_TIMER_STATUS1_INTERRUPT_MSB SOC_LF_TIMER_STATUS1_INTERRUPT_MSB -#define LF_TIMER_STATUS1_INTERRUPT_LSB SOC_LF_TIMER_STATUS1_INTERRUPT_LSB -#define LF_TIMER_STATUS1_INTERRUPT_MASK SOC_LF_TIMER_STATUS1_INTERRUPT_MASK -#define LF_TIMER_STATUS1_INTERRUPT_GET(x) SOC_LF_TIMER_STATUS1_INTERRUPT_GET(x) -#define LF_TIMER_STATUS1_INTERRUPT_SET(x) SOC_LF_TIMER_STATUS1_INTERRUPT_SET(x) -#define LF_TIMER2_ADDRESS SOC_LF_TIMER2_ADDRESS -#define LF_TIMER2_OFFSET SOC_LF_TIMER2_OFFSET -#define LF_TIMER2_TARGET_MSB SOC_LF_TIMER2_TARGET_MSB -#define LF_TIMER2_TARGET_LSB SOC_LF_TIMER2_TARGET_LSB -#define LF_TIMER2_TARGET_MASK SOC_LF_TIMER2_TARGET_MASK -#define LF_TIMER2_TARGET_GET(x) SOC_LF_TIMER2_TARGET_GET(x) -#define LF_TIMER2_TARGET_SET(x) SOC_LF_TIMER2_TARGET_SET(x) -#define LF_TIMER_COUNT2_ADDRESS SOC_LF_TIMER_COUNT2_ADDRESS -#define LF_TIMER_COUNT2_OFFSET SOC_LF_TIMER_COUNT2_OFFSET -#define LF_TIMER_COUNT2_VALUE_MSB SOC_LF_TIMER_COUNT2_VALUE_MSB -#define LF_TIMER_COUNT2_VALUE_LSB SOC_LF_TIMER_COUNT2_VALUE_LSB -#define LF_TIMER_COUNT2_VALUE_MASK SOC_LF_TIMER_COUNT2_VALUE_MASK -#define LF_TIMER_COUNT2_VALUE_GET(x) SOC_LF_TIMER_COUNT2_VALUE_GET(x) -#define LF_TIMER_COUNT2_VALUE_SET(x) SOC_LF_TIMER_COUNT2_VALUE_SET(x) -#define LF_TIMER_CONTROL2_ADDRESS SOC_LF_TIMER_CONTROL2_ADDRESS -#define LF_TIMER_CONTROL2_OFFSET SOC_LF_TIMER_CONTROL2_OFFSET -#define LF_TIMER_CONTROL2_ENABLE_MSB SOC_LF_TIMER_CONTROL2_ENABLE_MSB -#define LF_TIMER_CONTROL2_ENABLE_LSB SOC_LF_TIMER_CONTROL2_ENABLE_LSB -#define LF_TIMER_CONTROL2_ENABLE_MASK SOC_LF_TIMER_CONTROL2_ENABLE_MASK -#define LF_TIMER_CONTROL2_ENABLE_GET(x) SOC_LF_TIMER_CONTROL2_ENABLE_GET(x) -#define LF_TIMER_CONTROL2_ENABLE_SET(x) SOC_LF_TIMER_CONTROL2_ENABLE_SET(x) -#define LF_TIMER_CONTROL2_AUTO_RESTART_MSB SOC_LF_TIMER_CONTROL2_AUTO_RESTART_MSB -#define LF_TIMER_CONTROL2_AUTO_RESTART_LSB SOC_LF_TIMER_CONTROL2_AUTO_RESTART_LSB -#define LF_TIMER_CONTROL2_AUTO_RESTART_MASK SOC_LF_TIMER_CONTROL2_AUTO_RESTART_MASK -#define LF_TIMER_CONTROL2_AUTO_RESTART_GET(x) SOC_LF_TIMER_CONTROL2_AUTO_RESTART_GET(x) -#define LF_TIMER_CONTROL2_AUTO_RESTART_SET(x) SOC_LF_TIMER_CONTROL2_AUTO_RESTART_SET(x) -#define LF_TIMER_CONTROL2_RESET_MSB SOC_LF_TIMER_CONTROL2_RESET_MSB -#define LF_TIMER_CONTROL2_RESET_LSB SOC_LF_TIMER_CONTROL2_RESET_LSB -#define LF_TIMER_CONTROL2_RESET_MASK SOC_LF_TIMER_CONTROL2_RESET_MASK -#define LF_TIMER_CONTROL2_RESET_GET(x) SOC_LF_TIMER_CONTROL2_RESET_GET(x) -#define LF_TIMER_CONTROL2_RESET_SET(x) SOC_LF_TIMER_CONTROL2_RESET_SET(x) -#define LF_TIMER_STATUS2_ADDRESS SOC_LF_TIMER_STATUS2_ADDRESS -#define LF_TIMER_STATUS2_OFFSET SOC_LF_TIMER_STATUS2_OFFSET -#define LF_TIMER_STATUS2_INTERRUPT_MSB SOC_LF_TIMER_STATUS2_INTERRUPT_MSB -#define LF_TIMER_STATUS2_INTERRUPT_LSB SOC_LF_TIMER_STATUS2_INTERRUPT_LSB -#define LF_TIMER_STATUS2_INTERRUPT_MASK SOC_LF_TIMER_STATUS2_INTERRUPT_MASK -#define LF_TIMER_STATUS2_INTERRUPT_GET(x) SOC_LF_TIMER_STATUS2_INTERRUPT_GET(x) -#define LF_TIMER_STATUS2_INTERRUPT_SET(x) SOC_LF_TIMER_STATUS2_INTERRUPT_SET(x) -#define LF_TIMER3_ADDRESS SOC_LF_TIMER3_ADDRESS -#define LF_TIMER3_OFFSET SOC_LF_TIMER3_OFFSET -#define LF_TIMER3_TARGET_MSB SOC_LF_TIMER3_TARGET_MSB -#define LF_TIMER3_TARGET_LSB SOC_LF_TIMER3_TARGET_LSB -#define LF_TIMER3_TARGET_MASK SOC_LF_TIMER3_TARGET_MASK -#define LF_TIMER3_TARGET_GET(x) SOC_LF_TIMER3_TARGET_GET(x) -#define LF_TIMER3_TARGET_SET(x) SOC_LF_TIMER3_TARGET_SET(x) -#define LF_TIMER_COUNT3_ADDRESS SOC_LF_TIMER_COUNT3_ADDRESS -#define LF_TIMER_COUNT3_OFFSET SOC_LF_TIMER_COUNT3_OFFSET -#define LF_TIMER_COUNT3_VALUE_MSB SOC_LF_TIMER_COUNT3_VALUE_MSB -#define LF_TIMER_COUNT3_VALUE_LSB SOC_LF_TIMER_COUNT3_VALUE_LSB -#define LF_TIMER_COUNT3_VALUE_MASK SOC_LF_TIMER_COUNT3_VALUE_MASK -#define LF_TIMER_COUNT3_VALUE_GET(x) SOC_LF_TIMER_COUNT3_VALUE_GET(x) -#define LF_TIMER_COUNT3_VALUE_SET(x) SOC_LF_TIMER_COUNT3_VALUE_SET(x) -#define LF_TIMER_CONTROL3_ADDRESS SOC_LF_TIMER_CONTROL3_ADDRESS -#define LF_TIMER_CONTROL3_OFFSET SOC_LF_TIMER_CONTROL3_OFFSET -#define LF_TIMER_CONTROL3_ENABLE_MSB SOC_LF_TIMER_CONTROL3_ENABLE_MSB -#define LF_TIMER_CONTROL3_ENABLE_LSB SOC_LF_TIMER_CONTROL3_ENABLE_LSB -#define LF_TIMER_CONTROL3_ENABLE_MASK SOC_LF_TIMER_CONTROL3_ENABLE_MASK -#define LF_TIMER_CONTROL3_ENABLE_GET(x) SOC_LF_TIMER_CONTROL3_ENABLE_GET(x) -#define LF_TIMER_CONTROL3_ENABLE_SET(x) SOC_LF_TIMER_CONTROL3_ENABLE_SET(x) -#define LF_TIMER_CONTROL3_AUTO_RESTART_MSB SOC_LF_TIMER_CONTROL3_AUTO_RESTART_MSB -#define LF_TIMER_CONTROL3_AUTO_RESTART_LSB SOC_LF_TIMER_CONTROL3_AUTO_RESTART_LSB -#define LF_TIMER_CONTROL3_AUTO_RESTART_MASK SOC_LF_TIMER_CONTROL3_AUTO_RESTART_MASK -#define LF_TIMER_CONTROL3_AUTO_RESTART_GET(x) SOC_LF_TIMER_CONTROL3_AUTO_RESTART_GET(x) -#define LF_TIMER_CONTROL3_AUTO_RESTART_SET(x) SOC_LF_TIMER_CONTROL3_AUTO_RESTART_SET(x) -#define LF_TIMER_CONTROL3_RESET_MSB SOC_LF_TIMER_CONTROL3_RESET_MSB -#define LF_TIMER_CONTROL3_RESET_LSB SOC_LF_TIMER_CONTROL3_RESET_LSB -#define LF_TIMER_CONTROL3_RESET_MASK SOC_LF_TIMER_CONTROL3_RESET_MASK -#define LF_TIMER_CONTROL3_RESET_GET(x) SOC_LF_TIMER_CONTROL3_RESET_GET(x) -#define LF_TIMER_CONTROL3_RESET_SET(x) SOC_LF_TIMER_CONTROL3_RESET_SET(x) -#define LF_TIMER_STATUS3_ADDRESS SOC_LF_TIMER_STATUS3_ADDRESS -#define LF_TIMER_STATUS3_OFFSET SOC_LF_TIMER_STATUS3_OFFSET -#define LF_TIMER_STATUS3_INTERRUPT_MSB SOC_LF_TIMER_STATUS3_INTERRUPT_MSB -#define LF_TIMER_STATUS3_INTERRUPT_LSB SOC_LF_TIMER_STATUS3_INTERRUPT_LSB -#define LF_TIMER_STATUS3_INTERRUPT_MASK SOC_LF_TIMER_STATUS3_INTERRUPT_MASK -#define LF_TIMER_STATUS3_INTERRUPT_GET(x) SOC_LF_TIMER_STATUS3_INTERRUPT_GET(x) -#define LF_TIMER_STATUS3_INTERRUPT_SET(x) SOC_LF_TIMER_STATUS3_INTERRUPT_SET(x) -#define HF_TIMER_ADDRESS SOC_HF_TIMER_ADDRESS -#define HF_TIMER_OFFSET SOC_HF_TIMER_OFFSET -#define HF_TIMER_TARGET_MSB SOC_HF_TIMER_TARGET_MSB -#define HF_TIMER_TARGET_LSB SOC_HF_TIMER_TARGET_LSB -#define HF_TIMER_TARGET_MASK SOC_HF_TIMER_TARGET_MASK -#define HF_TIMER_TARGET_GET(x) SOC_HF_TIMER_TARGET_GET(x) -#define HF_TIMER_TARGET_SET(x) SOC_HF_TIMER_TARGET_SET(x) -#define HF_TIMER_COUNT_ADDRESS SOC_HF_TIMER_COUNT_ADDRESS -#define HF_TIMER_COUNT_OFFSET SOC_HF_TIMER_COUNT_OFFSET -#define HF_TIMER_COUNT_VALUE_MSB SOC_HF_TIMER_COUNT_VALUE_MSB -#define HF_TIMER_COUNT_VALUE_LSB SOC_HF_TIMER_COUNT_VALUE_LSB -#define HF_TIMER_COUNT_VALUE_MASK SOC_HF_TIMER_COUNT_VALUE_MASK -#define HF_TIMER_COUNT_VALUE_GET(x) SOC_HF_TIMER_COUNT_VALUE_GET(x) -#define HF_TIMER_COUNT_VALUE_SET(x) SOC_HF_TIMER_COUNT_VALUE_SET(x) -#define HF_LF_COUNT_ADDRESS SOC_HF_LF_COUNT_ADDRESS -#define HF_LF_COUNT_OFFSET SOC_HF_LF_COUNT_OFFSET -#define HF_LF_COUNT_VALUE_MSB SOC_HF_LF_COUNT_VALUE_MSB -#define HF_LF_COUNT_VALUE_LSB SOC_HF_LF_COUNT_VALUE_LSB -#define HF_LF_COUNT_VALUE_MASK SOC_HF_LF_COUNT_VALUE_MASK -#define HF_LF_COUNT_VALUE_GET(x) SOC_HF_LF_COUNT_VALUE_GET(x) -#define HF_LF_COUNT_VALUE_SET(x) SOC_HF_LF_COUNT_VALUE_SET(x) -#define HF_TIMER_CONTROL_ADDRESS SOC_HF_TIMER_CONTROL_ADDRESS -#define HF_TIMER_CONTROL_OFFSET SOC_HF_TIMER_CONTROL_OFFSET -#define HF_TIMER_CONTROL_ENABLE_MSB SOC_HF_TIMER_CONTROL_ENABLE_MSB -#define HF_TIMER_CONTROL_ENABLE_LSB SOC_HF_TIMER_CONTROL_ENABLE_LSB -#define HF_TIMER_CONTROL_ENABLE_MASK SOC_HF_TIMER_CONTROL_ENABLE_MASK -#define HF_TIMER_CONTROL_ENABLE_GET(x) SOC_HF_TIMER_CONTROL_ENABLE_GET(x) -#define HF_TIMER_CONTROL_ENABLE_SET(x) SOC_HF_TIMER_CONTROL_ENABLE_SET(x) -#define HF_TIMER_CONTROL_ON_MSB SOC_HF_TIMER_CONTROL_ON_MSB -#define HF_TIMER_CONTROL_ON_LSB SOC_HF_TIMER_CONTROL_ON_LSB -#define HF_TIMER_CONTROL_ON_MASK SOC_HF_TIMER_CONTROL_ON_MASK -#define HF_TIMER_CONTROL_ON_GET(x) SOC_HF_TIMER_CONTROL_ON_GET(x) -#define HF_TIMER_CONTROL_ON_SET(x) SOC_HF_TIMER_CONTROL_ON_SET(x) -#define HF_TIMER_CONTROL_AUTO_RESTART_MSB SOC_HF_TIMER_CONTROL_AUTO_RESTART_MSB -#define HF_TIMER_CONTROL_AUTO_RESTART_LSB SOC_HF_TIMER_CONTROL_AUTO_RESTART_LSB -#define HF_TIMER_CONTROL_AUTO_RESTART_MASK SOC_HF_TIMER_CONTROL_AUTO_RESTART_MASK -#define HF_TIMER_CONTROL_AUTO_RESTART_GET(x) SOC_HF_TIMER_CONTROL_AUTO_RESTART_GET(x) -#define HF_TIMER_CONTROL_AUTO_RESTART_SET(x) SOC_HF_TIMER_CONTROL_AUTO_RESTART_SET(x) -#define HF_TIMER_CONTROL_RESET_MSB SOC_HF_TIMER_CONTROL_RESET_MSB -#define HF_TIMER_CONTROL_RESET_LSB SOC_HF_TIMER_CONTROL_RESET_LSB -#define HF_TIMER_CONTROL_RESET_MASK SOC_HF_TIMER_CONTROL_RESET_MASK -#define HF_TIMER_CONTROL_RESET_GET(x) SOC_HF_TIMER_CONTROL_RESET_GET(x) -#define HF_TIMER_CONTROL_RESET_SET(x) SOC_HF_TIMER_CONTROL_RESET_SET(x) -#define HF_TIMER_STATUS_ADDRESS SOC_HF_TIMER_STATUS_ADDRESS -#define HF_TIMER_STATUS_OFFSET SOC_HF_TIMER_STATUS_OFFSET -#define HF_TIMER_STATUS_INTERRUPT_MSB SOC_HF_TIMER_STATUS_INTERRUPT_MSB -#define HF_TIMER_STATUS_INTERRUPT_LSB SOC_HF_TIMER_STATUS_INTERRUPT_LSB -#define HF_TIMER_STATUS_INTERRUPT_MASK SOC_HF_TIMER_STATUS_INTERRUPT_MASK -#define HF_TIMER_STATUS_INTERRUPT_GET(x) SOC_HF_TIMER_STATUS_INTERRUPT_GET(x) -#define HF_TIMER_STATUS_INTERRUPT_SET(x) SOC_HF_TIMER_STATUS_INTERRUPT_SET(x) -#define RTC_CONTROL_ADDRESS SOC_RTC_CONTROL_ADDRESS -#define RTC_CONTROL_OFFSET SOC_RTC_CONTROL_OFFSET -#define RTC_CONTROL_ENABLE_MSB SOC_RTC_CONTROL_ENABLE_MSB -#define RTC_CONTROL_ENABLE_LSB SOC_RTC_CONTROL_ENABLE_LSB -#define RTC_CONTROL_ENABLE_MASK SOC_RTC_CONTROL_ENABLE_MASK -#define RTC_CONTROL_ENABLE_GET(x) SOC_RTC_CONTROL_ENABLE_GET(x) -#define RTC_CONTROL_ENABLE_SET(x) SOC_RTC_CONTROL_ENABLE_SET(x) -#define RTC_CONTROL_LOAD_RTC_MSB SOC_RTC_CONTROL_LOAD_RTC_MSB -#define RTC_CONTROL_LOAD_RTC_LSB SOC_RTC_CONTROL_LOAD_RTC_LSB -#define RTC_CONTROL_LOAD_RTC_MASK SOC_RTC_CONTROL_LOAD_RTC_MASK -#define RTC_CONTROL_LOAD_RTC_GET(x) SOC_RTC_CONTROL_LOAD_RTC_GET(x) -#define RTC_CONTROL_LOAD_RTC_SET(x) SOC_RTC_CONTROL_LOAD_RTC_SET(x) -#define RTC_CONTROL_LOAD_ALARM_MSB SOC_RTC_CONTROL_LOAD_ALARM_MSB -#define RTC_CONTROL_LOAD_ALARM_LSB SOC_RTC_CONTROL_LOAD_ALARM_LSB -#define RTC_CONTROL_LOAD_ALARM_MASK SOC_RTC_CONTROL_LOAD_ALARM_MASK -#define RTC_CONTROL_LOAD_ALARM_GET(x) SOC_RTC_CONTROL_LOAD_ALARM_GET(x) -#define RTC_CONTROL_LOAD_ALARM_SET(x) SOC_RTC_CONTROL_LOAD_ALARM_SET(x) -#define RTC_TIME_ADDRESS SOC_RTC_TIME_ADDRESS -#define RTC_TIME_OFFSET SOC_RTC_TIME_OFFSET -#define RTC_TIME_WEEK_DAY_MSB SOC_RTC_TIME_WEEK_DAY_MSB -#define RTC_TIME_WEEK_DAY_LSB SOC_RTC_TIME_WEEK_DAY_LSB -#define RTC_TIME_WEEK_DAY_MASK SOC_RTC_TIME_WEEK_DAY_MASK -#define RTC_TIME_WEEK_DAY_GET(x) SOC_RTC_TIME_WEEK_DAY_GET(x) -#define RTC_TIME_WEEK_DAY_SET(x) SOC_RTC_TIME_WEEK_DAY_SET(x) -#define RTC_TIME_HOUR_MSB SOC_RTC_TIME_HOUR_MSB -#define RTC_TIME_HOUR_LSB SOC_RTC_TIME_HOUR_LSB -#define RTC_TIME_HOUR_MASK SOC_RTC_TIME_HOUR_MASK -#define RTC_TIME_HOUR_GET(x) SOC_RTC_TIME_HOUR_GET(x) -#define RTC_TIME_HOUR_SET(x) SOC_RTC_TIME_HOUR_SET(x) -#define RTC_TIME_MINUTE_MSB SOC_RTC_TIME_MINUTE_MSB -#define RTC_TIME_MINUTE_LSB SOC_RTC_TIME_MINUTE_LSB -#define RTC_TIME_MINUTE_MASK SOC_RTC_TIME_MINUTE_MASK -#define RTC_TIME_MINUTE_GET(x) SOC_RTC_TIME_MINUTE_GET(x) -#define RTC_TIME_MINUTE_SET(x) SOC_RTC_TIME_MINUTE_SET(x) -#define RTC_TIME_SECOND_MSB SOC_RTC_TIME_SECOND_MSB -#define RTC_TIME_SECOND_LSB SOC_RTC_TIME_SECOND_LSB -#define RTC_TIME_SECOND_MASK SOC_RTC_TIME_SECOND_MASK -#define RTC_TIME_SECOND_GET(x) SOC_RTC_TIME_SECOND_GET(x) -#define RTC_TIME_SECOND_SET(x) SOC_RTC_TIME_SECOND_SET(x) -#define RTC_DATE_ADDRESS SOC_RTC_DATE_ADDRESS -#define RTC_DATE_OFFSET SOC_RTC_DATE_OFFSET -#define RTC_DATE_YEAR_MSB SOC_RTC_DATE_YEAR_MSB -#define RTC_DATE_YEAR_LSB SOC_RTC_DATE_YEAR_LSB -#define RTC_DATE_YEAR_MASK SOC_RTC_DATE_YEAR_MASK -#define RTC_DATE_YEAR_GET(x) SOC_RTC_DATE_YEAR_GET(x) -#define RTC_DATE_YEAR_SET(x) SOC_RTC_DATE_YEAR_SET(x) -#define RTC_DATE_MONTH_MSB SOC_RTC_DATE_MONTH_MSB -#define RTC_DATE_MONTH_LSB SOC_RTC_DATE_MONTH_LSB -#define RTC_DATE_MONTH_MASK SOC_RTC_DATE_MONTH_MASK -#define RTC_DATE_MONTH_GET(x) SOC_RTC_DATE_MONTH_GET(x) -#define RTC_DATE_MONTH_SET(x) SOC_RTC_DATE_MONTH_SET(x) -#define RTC_DATE_MONTH_DAY_MSB SOC_RTC_DATE_MONTH_DAY_MSB -#define RTC_DATE_MONTH_DAY_LSB SOC_RTC_DATE_MONTH_DAY_LSB -#define RTC_DATE_MONTH_DAY_MASK SOC_RTC_DATE_MONTH_DAY_MASK -#define RTC_DATE_MONTH_DAY_GET(x) SOC_RTC_DATE_MONTH_DAY_GET(x) -#define RTC_DATE_MONTH_DAY_SET(x) SOC_RTC_DATE_MONTH_DAY_SET(x) -#define RTC_SET_TIME_ADDRESS SOC_RTC_SET_TIME_ADDRESS -#define RTC_SET_TIME_OFFSET SOC_RTC_SET_TIME_OFFSET -#define RTC_SET_TIME_WEEK_DAY_MSB SOC_RTC_SET_TIME_WEEK_DAY_MSB -#define RTC_SET_TIME_WEEK_DAY_LSB SOC_RTC_SET_TIME_WEEK_DAY_LSB -#define RTC_SET_TIME_WEEK_DAY_MASK SOC_RTC_SET_TIME_WEEK_DAY_MASK -#define RTC_SET_TIME_WEEK_DAY_GET(x) SOC_RTC_SET_TIME_WEEK_DAY_GET(x) -#define RTC_SET_TIME_WEEK_DAY_SET(x) SOC_RTC_SET_TIME_WEEK_DAY_SET(x) -#define RTC_SET_TIME_HOUR_MSB SOC_RTC_SET_TIME_HOUR_MSB -#define RTC_SET_TIME_HOUR_LSB SOC_RTC_SET_TIME_HOUR_LSB -#define RTC_SET_TIME_HOUR_MASK SOC_RTC_SET_TIME_HOUR_MASK -#define RTC_SET_TIME_HOUR_GET(x) SOC_RTC_SET_TIME_HOUR_GET(x) -#define RTC_SET_TIME_HOUR_SET(x) SOC_RTC_SET_TIME_HOUR_SET(x) -#define RTC_SET_TIME_MINUTE_MSB SOC_RTC_SET_TIME_MINUTE_MSB -#define RTC_SET_TIME_MINUTE_LSB SOC_RTC_SET_TIME_MINUTE_LSB -#define RTC_SET_TIME_MINUTE_MASK SOC_RTC_SET_TIME_MINUTE_MASK -#define RTC_SET_TIME_MINUTE_GET(x) SOC_RTC_SET_TIME_MINUTE_GET(x) -#define RTC_SET_TIME_MINUTE_SET(x) SOC_RTC_SET_TIME_MINUTE_SET(x) -#define RTC_SET_TIME_SECOND_MSB SOC_RTC_SET_TIME_SECOND_MSB -#define RTC_SET_TIME_SECOND_LSB SOC_RTC_SET_TIME_SECOND_LSB -#define RTC_SET_TIME_SECOND_MASK SOC_RTC_SET_TIME_SECOND_MASK -#define RTC_SET_TIME_SECOND_GET(x) SOC_RTC_SET_TIME_SECOND_GET(x) -#define RTC_SET_TIME_SECOND_SET(x) SOC_RTC_SET_TIME_SECOND_SET(x) -#define RTC_SET_DATE_ADDRESS SOC_RTC_SET_DATE_ADDRESS -#define RTC_SET_DATE_OFFSET SOC_RTC_SET_DATE_OFFSET -#define RTC_SET_DATE_YEAR_MSB SOC_RTC_SET_DATE_YEAR_MSB -#define RTC_SET_DATE_YEAR_LSB SOC_RTC_SET_DATE_YEAR_LSB -#define RTC_SET_DATE_YEAR_MASK SOC_RTC_SET_DATE_YEAR_MASK -#define RTC_SET_DATE_YEAR_GET(x) SOC_RTC_SET_DATE_YEAR_GET(x) -#define RTC_SET_DATE_YEAR_SET(x) SOC_RTC_SET_DATE_YEAR_SET(x) -#define RTC_SET_DATE_MONTH_MSB SOC_RTC_SET_DATE_MONTH_MSB -#define RTC_SET_DATE_MONTH_LSB SOC_RTC_SET_DATE_MONTH_LSB -#define RTC_SET_DATE_MONTH_MASK SOC_RTC_SET_DATE_MONTH_MASK -#define RTC_SET_DATE_MONTH_GET(x) SOC_RTC_SET_DATE_MONTH_GET(x) -#define RTC_SET_DATE_MONTH_SET(x) SOC_RTC_SET_DATE_MONTH_SET(x) -#define RTC_SET_DATE_MONTH_DAY_MSB SOC_RTC_SET_DATE_MONTH_DAY_MSB -#define RTC_SET_DATE_MONTH_DAY_LSB SOC_RTC_SET_DATE_MONTH_DAY_LSB -#define RTC_SET_DATE_MONTH_DAY_MASK SOC_RTC_SET_DATE_MONTH_DAY_MASK -#define RTC_SET_DATE_MONTH_DAY_GET(x) SOC_RTC_SET_DATE_MONTH_DAY_GET(x) -#define RTC_SET_DATE_MONTH_DAY_SET(x) SOC_RTC_SET_DATE_MONTH_DAY_SET(x) -#define RTC_SET_ALARM_ADDRESS SOC_RTC_SET_ALARM_ADDRESS -#define RTC_SET_ALARM_OFFSET SOC_RTC_SET_ALARM_OFFSET -#define RTC_SET_ALARM_HOUR_MSB SOC_RTC_SET_ALARM_HOUR_MSB -#define RTC_SET_ALARM_HOUR_LSB SOC_RTC_SET_ALARM_HOUR_LSB -#define RTC_SET_ALARM_HOUR_MASK SOC_RTC_SET_ALARM_HOUR_MASK -#define RTC_SET_ALARM_HOUR_GET(x) SOC_RTC_SET_ALARM_HOUR_GET(x) -#define RTC_SET_ALARM_HOUR_SET(x) SOC_RTC_SET_ALARM_HOUR_SET(x) -#define RTC_SET_ALARM_MINUTE_MSB SOC_RTC_SET_ALARM_MINUTE_MSB -#define RTC_SET_ALARM_MINUTE_LSB SOC_RTC_SET_ALARM_MINUTE_LSB -#define RTC_SET_ALARM_MINUTE_MASK SOC_RTC_SET_ALARM_MINUTE_MASK -#define RTC_SET_ALARM_MINUTE_GET(x) SOC_RTC_SET_ALARM_MINUTE_GET(x) -#define RTC_SET_ALARM_MINUTE_SET(x) SOC_RTC_SET_ALARM_MINUTE_SET(x) -#define RTC_SET_ALARM_SECOND_MSB SOC_RTC_SET_ALARM_SECOND_MSB -#define RTC_SET_ALARM_SECOND_LSB SOC_RTC_SET_ALARM_SECOND_LSB -#define RTC_SET_ALARM_SECOND_MASK SOC_RTC_SET_ALARM_SECOND_MASK -#define RTC_SET_ALARM_SECOND_GET(x) SOC_RTC_SET_ALARM_SECOND_GET(x) -#define RTC_SET_ALARM_SECOND_SET(x) SOC_RTC_SET_ALARM_SECOND_SET(x) -#define RTC_CONFIG_ADDRESS SOC_RTC_CONFIG_ADDRESS -#define RTC_CONFIG_OFFSET SOC_RTC_CONFIG_OFFSET -#define RTC_CONFIG_BCD_MSB SOC_RTC_CONFIG_BCD_MSB -#define RTC_CONFIG_BCD_LSB SOC_RTC_CONFIG_BCD_LSB -#define RTC_CONFIG_BCD_MASK SOC_RTC_CONFIG_BCD_MASK -#define RTC_CONFIG_BCD_GET(x) SOC_RTC_CONFIG_BCD_GET(x) -#define RTC_CONFIG_BCD_SET(x) SOC_RTC_CONFIG_BCD_SET(x) -#define RTC_CONFIG_TWELVE_HOUR_MSB SOC_RTC_CONFIG_TWELVE_HOUR_MSB -#define RTC_CONFIG_TWELVE_HOUR_LSB SOC_RTC_CONFIG_TWELVE_HOUR_LSB -#define RTC_CONFIG_TWELVE_HOUR_MASK SOC_RTC_CONFIG_TWELVE_HOUR_MASK -#define RTC_CONFIG_TWELVE_HOUR_GET(x) SOC_RTC_CONFIG_TWELVE_HOUR_GET(x) -#define RTC_CONFIG_TWELVE_HOUR_SET(x) SOC_RTC_CONFIG_TWELVE_HOUR_SET(x) -#define RTC_CONFIG_DSE_MSB SOC_RTC_CONFIG_DSE_MSB -#define RTC_CONFIG_DSE_LSB SOC_RTC_CONFIG_DSE_LSB -#define RTC_CONFIG_DSE_MASK SOC_RTC_CONFIG_DSE_MASK -#define RTC_CONFIG_DSE_GET(x) SOC_RTC_CONFIG_DSE_GET(x) -#define RTC_CONFIG_DSE_SET(x) SOC_RTC_CONFIG_DSE_SET(x) -#define RTC_ALARM_STATUS_ADDRESS SOC_RTC_ALARM_STATUS_ADDRESS -#define RTC_ALARM_STATUS_OFFSET SOC_RTC_ALARM_STATUS_OFFSET -#define RTC_ALARM_STATUS_ENABLE_MSB SOC_RTC_ALARM_STATUS_ENABLE_MSB -#define RTC_ALARM_STATUS_ENABLE_LSB SOC_RTC_ALARM_STATUS_ENABLE_LSB -#define RTC_ALARM_STATUS_ENABLE_MASK SOC_RTC_ALARM_STATUS_ENABLE_MASK -#define RTC_ALARM_STATUS_ENABLE_GET(x) SOC_RTC_ALARM_STATUS_ENABLE_GET(x) -#define RTC_ALARM_STATUS_ENABLE_SET(x) SOC_RTC_ALARM_STATUS_ENABLE_SET(x) -#define RTC_ALARM_STATUS_INTERRUPT_MSB SOC_RTC_ALARM_STATUS_INTERRUPT_MSB -#define RTC_ALARM_STATUS_INTERRUPT_LSB SOC_RTC_ALARM_STATUS_INTERRUPT_LSB -#define RTC_ALARM_STATUS_INTERRUPT_MASK SOC_RTC_ALARM_STATUS_INTERRUPT_MASK -#define RTC_ALARM_STATUS_INTERRUPT_GET(x) SOC_RTC_ALARM_STATUS_INTERRUPT_GET(x) -#define RTC_ALARM_STATUS_INTERRUPT_SET(x) SOC_RTC_ALARM_STATUS_INTERRUPT_SET(x) -#define UART_WAKEUP_ADDRESS SOC_UART_WAKEUP_ADDRESS -#define UART_WAKEUP_OFFSET SOC_UART_WAKEUP_OFFSET -#define UART_WAKEUP_ENABLE_MSB SOC_UART_WAKEUP_ENABLE_MSB -#define UART_WAKEUP_ENABLE_LSB SOC_UART_WAKEUP_ENABLE_LSB -#define UART_WAKEUP_ENABLE_MASK SOC_UART_WAKEUP_ENABLE_MASK -#define UART_WAKEUP_ENABLE_GET(x) SOC_UART_WAKEUP_ENABLE_GET(x) -#define UART_WAKEUP_ENABLE_SET(x) SOC_UART_WAKEUP_ENABLE_SET(x) -#define RESET_CAUSE_ADDRESS SOC_RESET_CAUSE_ADDRESS -#define RESET_CAUSE_OFFSET SOC_RESET_CAUSE_OFFSET -#define RESET_CAUSE_LAST_MSB SOC_RESET_CAUSE_LAST_MSB -#define RESET_CAUSE_LAST_LSB SOC_RESET_CAUSE_LAST_LSB -#define RESET_CAUSE_LAST_MASK SOC_RESET_CAUSE_LAST_MASK -#define RESET_CAUSE_LAST_GET(x) SOC_RESET_CAUSE_LAST_GET(x) -#define RESET_CAUSE_LAST_SET(x) SOC_RESET_CAUSE_LAST_SET(x) -#define SYSTEM_SLEEP_ADDRESS SOC_SYSTEM_SLEEP_ADDRESS -#define SYSTEM_SLEEP_OFFSET SOC_SYSTEM_SLEEP_OFFSET -#define SYSTEM_SLEEP_MCI_MSB SOC_SYSTEM_SLEEP_MCI_MSB -#define SYSTEM_SLEEP_MCI_LSB SOC_SYSTEM_SLEEP_MCI_LSB -#define SYSTEM_SLEEP_MCI_MASK SOC_SYSTEM_SLEEP_MCI_MASK -#define SYSTEM_SLEEP_MCI_GET(x) SOC_SYSTEM_SLEEP_MCI_GET(x) -#define SYSTEM_SLEEP_MCI_SET(x) SOC_SYSTEM_SLEEP_MCI_SET(x) -#define SYSTEM_SLEEP_HOST_IF_MSB SOC_SYSTEM_SLEEP_HOST_IF_MSB -#define SYSTEM_SLEEP_HOST_IF_LSB SOC_SYSTEM_SLEEP_HOST_IF_LSB -#define SYSTEM_SLEEP_HOST_IF_MASK SOC_SYSTEM_SLEEP_HOST_IF_MASK -#define SYSTEM_SLEEP_HOST_IF_GET(x) SOC_SYSTEM_SLEEP_HOST_IF_GET(x) -#define SYSTEM_SLEEP_HOST_IF_SET(x) SOC_SYSTEM_SLEEP_HOST_IF_SET(x) -#define SYSTEM_SLEEP_MBOX_MSB SOC_SYSTEM_SLEEP_MBOX_MSB -#define SYSTEM_SLEEP_MBOX_LSB SOC_SYSTEM_SLEEP_MBOX_LSB -#define SYSTEM_SLEEP_MBOX_MASK SOC_SYSTEM_SLEEP_MBOX_MASK -#define SYSTEM_SLEEP_MBOX_GET(x) SOC_SYSTEM_SLEEP_MBOX_GET(x) -#define SYSTEM_SLEEP_MBOX_SET(x) SOC_SYSTEM_SLEEP_MBOX_SET(x) -#define SYSTEM_SLEEP_MAC_IF_MSB SOC_SYSTEM_SLEEP_MAC_IF_MSB -#define SYSTEM_SLEEP_MAC_IF_LSB SOC_SYSTEM_SLEEP_MAC_IF_LSB -#define SYSTEM_SLEEP_MAC_IF_MASK SOC_SYSTEM_SLEEP_MAC_IF_MASK -#define SYSTEM_SLEEP_MAC_IF_GET(x) SOC_SYSTEM_SLEEP_MAC_IF_GET(x) -#define SYSTEM_SLEEP_MAC_IF_SET(x) SOC_SYSTEM_SLEEP_MAC_IF_SET(x) -#define SYSTEM_SLEEP_LIGHT_MSB SOC_SYSTEM_SLEEP_LIGHT_MSB -#define SYSTEM_SLEEP_LIGHT_LSB SOC_SYSTEM_SLEEP_LIGHT_LSB -#define SYSTEM_SLEEP_LIGHT_MASK SOC_SYSTEM_SLEEP_LIGHT_MASK -#define SYSTEM_SLEEP_LIGHT_GET(x) SOC_SYSTEM_SLEEP_LIGHT_GET(x) -#define SYSTEM_SLEEP_LIGHT_SET(x) SOC_SYSTEM_SLEEP_LIGHT_SET(x) -#define SYSTEM_SLEEP_DISABLE_MSB SOC_SYSTEM_SLEEP_DISABLE_MSB -#define SYSTEM_SLEEP_DISABLE_LSB SOC_SYSTEM_SLEEP_DISABLE_LSB -#define SYSTEM_SLEEP_DISABLE_MASK SOC_SYSTEM_SLEEP_DISABLE_MASK -#define SYSTEM_SLEEP_DISABLE_GET(x) SOC_SYSTEM_SLEEP_DISABLE_GET(x) -#define SYSTEM_SLEEP_DISABLE_SET(x) SOC_SYSTEM_SLEEP_DISABLE_SET(x) -#define SDIO_WRAPPER_ADDRESS SOC_SDIO_WRAPPER_ADDRESS -#define SDIO_WRAPPER_OFFSET SOC_SDIO_WRAPPER_OFFSET -#define SDIO_WRAPPER_SLEEP_MSB SOC_SDIO_WRAPPER_SLEEP_MSB -#define SDIO_WRAPPER_SLEEP_LSB SOC_SDIO_WRAPPER_SLEEP_LSB -#define SDIO_WRAPPER_SLEEP_MASK SOC_SDIO_WRAPPER_SLEEP_MASK -#define SDIO_WRAPPER_SLEEP_GET(x) SOC_SDIO_WRAPPER_SLEEP_GET(x) -#define SDIO_WRAPPER_SLEEP_SET(x) SOC_SDIO_WRAPPER_SLEEP_SET(x) -#define SDIO_WRAPPER_WAKEUP_MSB SOC_SDIO_WRAPPER_WAKEUP_MSB -#define SDIO_WRAPPER_WAKEUP_LSB SOC_SDIO_WRAPPER_WAKEUP_LSB -#define SDIO_WRAPPER_WAKEUP_MASK SOC_SDIO_WRAPPER_WAKEUP_MASK -#define SDIO_WRAPPER_WAKEUP_GET(x) SOC_SDIO_WRAPPER_WAKEUP_GET(x) -#define SDIO_WRAPPER_WAKEUP_SET(x) SOC_SDIO_WRAPPER_WAKEUP_SET(x) -#define SDIO_WRAPPER_SOC_ON_MSB SOC_SDIO_WRAPPER_SOC_ON_MSB -#define SDIO_WRAPPER_SOC_ON_LSB SOC_SDIO_WRAPPER_SOC_ON_LSB -#define SDIO_WRAPPER_SOC_ON_MASK SOC_SDIO_WRAPPER_SOC_ON_MASK -#define SDIO_WRAPPER_SOC_ON_GET(x) SOC_SDIO_WRAPPER_SOC_ON_GET(x) -#define SDIO_WRAPPER_SOC_ON_SET(x) SOC_SDIO_WRAPPER_SOC_ON_SET(x) -#define SDIO_WRAPPER_ON_MSB SOC_SDIO_WRAPPER_ON_MSB -#define SDIO_WRAPPER_ON_LSB SOC_SDIO_WRAPPER_ON_LSB -#define SDIO_WRAPPER_ON_MASK SOC_SDIO_WRAPPER_ON_MASK -#define SDIO_WRAPPER_ON_GET(x) SOC_SDIO_WRAPPER_ON_GET(x) -#define SDIO_WRAPPER_ON_SET(x) SOC_SDIO_WRAPPER_ON_SET(x) -#define INT_STATUS1_ADDRESS SOC_INT_STATUS1_ADDRESS -#define INT_STATUS1_OFFSET SOC_INT_STATUS1_OFFSET -#define INT_STATUS1_I2S_1_MSB SOC_INT_STATUS1_I2S_1_MSB -#define INT_STATUS1_I2S_1_LSB SOC_INT_STATUS1_I2S_1_LSB -#define INT_STATUS1_I2S_1_MASK SOC_INT_STATUS1_I2S_1_MASK -#define INT_STATUS1_I2S_1_GET(x) SOC_INT_STATUS1_I2S_1_GET(x) -#define INT_STATUS1_I2S_1_SET(x) SOC_INT_STATUS1_I2S_1_SET(x) -#define INT_STATUS1_I2S_MSB SOC_INT_STATUS1_I2S_MSB -#define INT_STATUS1_I2S_LSB SOC_INT_STATUS1_I2S_LSB -#define INT_STATUS1_I2S_MASK SOC_INT_STATUS1_I2S_MASK -#define INT_STATUS1_I2S_GET(x) SOC_INT_STATUS1_I2S_GET(x) -#define INT_STATUS1_I2S_SET(x) SOC_INT_STATUS1_I2S_SET(x) -#define INT_STATUS1_MDIO_MSB SOC_INT_STATUS1_MDIO_MSB -#define INT_STATUS1_MDIO_LSB SOC_INT_STATUS1_MDIO_LSB -#define INT_STATUS1_MDIO_MASK SOC_INT_STATUS1_MDIO_MASK -#define INT_STATUS1_MDIO_GET(x) SOC_INT_STATUS1_MDIO_GET(x) -#define INT_STATUS1_MDIO_SET(x) SOC_INT_STATUS1_MDIO_SET(x) -#define INT_STATUS1_GMAC_MSB SOC_INT_STATUS1_GMAC_MSB -#define INT_STATUS1_GMAC_LSB SOC_INT_STATUS1_GMAC_LSB -#define INT_STATUS1_GMAC_MASK SOC_INT_STATUS1_GMAC_MASK -#define INT_STATUS1_GMAC_GET(x) SOC_INT_STATUS1_GMAC_GET(x) -#define INT_STATUS1_GMAC_SET(x) SOC_INT_STATUS1_GMAC_SET(x) -#define INT_STATUS1_I2C_S_MSB SOC_INT_STATUS1_I2C_S_MSB -#define INT_STATUS1_I2C_S_LSB SOC_INT_STATUS1_I2C_S_LSB -#define INT_STATUS1_I2C_S_MASK SOC_INT_STATUS1_I2C_S_MASK -#define INT_STATUS1_I2C_S_GET(x) SOC_INT_STATUS1_I2C_S_GET(x) -#define INT_STATUS1_I2C_S_SET(x) SOC_INT_STATUS1_I2C_S_SET(x) -#define INT_STATUS1_CKSUM_MSB SOC_INT_STATUS1_CKSUM_MSB -#define INT_STATUS1_CKSUM_LSB SOC_INT_STATUS1_CKSUM_LSB -#define INT_STATUS1_CKSUM_MASK SOC_INT_STATUS1_CKSUM_MASK -#define INT_STATUS1_CKSUM_GET(x) SOC_INT_STATUS1_CKSUM_GET(x) -#define INT_STATUS1_CKSUM_SET(x) SOC_INT_STATUS1_CKSUM_SET(x) -#define INT_STATUS1_MAC_4_MSB SOC_INT_STATUS1_MAC_4_MSB -#define INT_STATUS1_MAC_4_LSB SOC_INT_STATUS1_MAC_4_LSB -#define INT_STATUS1_MAC_4_MASK SOC_INT_STATUS1_MAC_4_MASK -#define INT_STATUS1_MAC_4_GET(x) SOC_INT_STATUS1_MAC_4_GET(x) -#define INT_STATUS1_MAC_4_SET(x) SOC_INT_STATUS1_MAC_4_SET(x) -#define INT_STATUS1_MAC_3_MSB SOC_INT_STATUS1_MAC_3_MSB -#define INT_STATUS1_MAC_3_LSB SOC_INT_STATUS1_MAC_3_LSB -#define INT_STATUS1_MAC_3_MASK SOC_INT_STATUS1_MAC_3_MASK -#define INT_STATUS1_MAC_3_GET(x) SOC_INT_STATUS1_MAC_3_GET(x) -#define INT_STATUS1_MAC_3_SET(x) SOC_INT_STATUS1_MAC_3_SET(x) -#define INT_STATUS1_MAC_2_MSB SOC_INT_STATUS1_MAC_2_MSB -#define INT_STATUS1_MAC_2_LSB SOC_INT_STATUS1_MAC_2_LSB -#define INT_STATUS1_MAC_2_MASK SOC_INT_STATUS1_MAC_2_MASK -#define INT_STATUS1_MAC_2_GET(x) SOC_INT_STATUS1_MAC_2_GET(x) -#define INT_STATUS1_MAC_2_SET(x) SOC_INT_STATUS1_MAC_2_SET(x) -#define INT_STATUS1_MAC_1_MSB SOC_INT_STATUS1_MAC_1_MSB -#define INT_STATUS1_MAC_1_LSB SOC_INT_STATUS1_MAC_1_LSB -#define INT_STATUS1_MAC_1_MASK SOC_INT_STATUS1_MAC_1_MASK -#define INT_STATUS1_MAC_1_GET(x) SOC_INT_STATUS1_MAC_1_GET(x) -#define INT_STATUS1_MAC_1_SET(x) SOC_INT_STATUS1_MAC_1_SET(x) -#define LPO_CAL_TIME_ADDRESS SOC_LPO_CAL_TIME_ADDRESS -#define LPO_CAL_TIME_OFFSET SOC_LPO_CAL_TIME_OFFSET -#define LPO_CAL_TIME_LENGTH_MSB SOC_LPO_CAL_TIME_LENGTH_MSB -#define LPO_CAL_TIME_LENGTH_LSB SOC_LPO_CAL_TIME_LENGTH_LSB -#define LPO_CAL_TIME_LENGTH_MASK SOC_LPO_CAL_TIME_LENGTH_MASK -#define LPO_CAL_TIME_LENGTH_GET(x) SOC_LPO_CAL_TIME_LENGTH_GET(x) -#define LPO_CAL_TIME_LENGTH_SET(x) SOC_LPO_CAL_TIME_LENGTH_SET(x) -#define LPO_INIT_DIVIDEND_INT_ADDRESS SOC_LPO_INIT_DIVIDEND_INT_ADDRESS -#define LPO_INIT_DIVIDEND_INT_OFFSET SOC_LPO_INIT_DIVIDEND_INT_OFFSET -#define LPO_INIT_DIVIDEND_INT_VALUE_MSB SOC_LPO_INIT_DIVIDEND_INT_VALUE_MSB -#define LPO_INIT_DIVIDEND_INT_VALUE_LSB SOC_LPO_INIT_DIVIDEND_INT_VALUE_LSB -#define LPO_INIT_DIVIDEND_INT_VALUE_MASK SOC_LPO_INIT_DIVIDEND_INT_VALUE_MASK -#define LPO_INIT_DIVIDEND_INT_VALUE_GET(x) SOC_LPO_INIT_DIVIDEND_INT_VALUE_GET(x) -#define LPO_INIT_DIVIDEND_INT_VALUE_SET(x) SOC_LPO_INIT_DIVIDEND_INT_VALUE_SET(x) -#define LPO_INIT_DIVIDEND_FRACTION_ADDRESS SOC_LPO_INIT_DIVIDEND_FRACTION_ADDRESS -#define LPO_INIT_DIVIDEND_FRACTION_OFFSET SOC_LPO_INIT_DIVIDEND_FRACTION_OFFSET -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_MSB SOC_LPO_INIT_DIVIDEND_FRACTION_VALUE_MSB -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB SOC_LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK SOC_LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_GET(x) SOC_LPO_INIT_DIVIDEND_FRACTION_VALUE_GET(x) -#define LPO_INIT_DIVIDEND_FRACTION_VALUE_SET(x) SOC_LPO_INIT_DIVIDEND_FRACTION_VALUE_SET(x) -#define LPO_CAL_ADDRESS SOC_LPO_CAL_ADDRESS -#define LPO_CAL_OFFSET SOC_LPO_CAL_OFFSET -#define LPO_CAL_ENABLE_MSB SOC_LPO_CAL_ENABLE_MSB -#define LPO_CAL_ENABLE_LSB SOC_LPO_CAL_ENABLE_LSB -#define LPO_CAL_ENABLE_MASK SOC_LPO_CAL_ENABLE_MASK -#define LPO_CAL_ENABLE_GET(x) SOC_LPO_CAL_ENABLE_GET(x) -#define LPO_CAL_ENABLE_SET(x) SOC_LPO_CAL_ENABLE_SET(x) -#define LPO_CAL_COUNT_MSB SOC_LPO_CAL_COUNT_MSB -#define LPO_CAL_COUNT_LSB SOC_LPO_CAL_COUNT_LSB -#define LPO_CAL_COUNT_MASK SOC_LPO_CAL_COUNT_MASK -#define LPO_CAL_COUNT_GET(x) SOC_LPO_CAL_COUNT_GET(x) -#define LPO_CAL_COUNT_SET(x) SOC_LPO_CAL_COUNT_SET(x) -#define LPO_CAL_TEST_CONTROL_ADDRESS SOC_LPO_CAL_TEST_CONTROL_ADDRESS -#define LPO_CAL_TEST_CONTROL_OFFSET SOC_LPO_CAL_TEST_CONTROL_OFFSET -#define LPO_CAL_TEST_CONTROL_ENABLE_MSB SOC_LPO_CAL_TEST_CONTROL_ENABLE_MSB -#define LPO_CAL_TEST_CONTROL_ENABLE_LSB SOC_LPO_CAL_TEST_CONTROL_ENABLE_LSB -#define LPO_CAL_TEST_CONTROL_ENABLE_MASK SOC_LPO_CAL_TEST_CONTROL_ENABLE_MASK -#define LPO_CAL_TEST_CONTROL_ENABLE_GET(x) SOC_LPO_CAL_TEST_CONTROL_ENABLE_GET(x) -#define LPO_CAL_TEST_CONTROL_ENABLE_SET(x) SOC_LPO_CAL_TEST_CONTROL_ENABLE_SET(x) -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_MSB SOC_LPO_CAL_TEST_CONTROL_RTC_CYCLES_MSB -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB SOC_LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK SOC_LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_GET(x) SOC_LPO_CAL_TEST_CONTROL_RTC_CYCLES_GET(x) -#define LPO_CAL_TEST_CONTROL_RTC_CYCLES_SET(x) SOC_LPO_CAL_TEST_CONTROL_RTC_CYCLES_SET(x) -#define LPO_CAL_TEST_STATUS_ADDRESS SOC_LPO_CAL_TEST_STATUS_ADDRESS -#define LPO_CAL_TEST_STATUS_OFFSET SOC_LPO_CAL_TEST_STATUS_OFFSET -#define LPO_CAL_TEST_STATUS_READY_MSB SOC_LPO_CAL_TEST_STATUS_READY_MSB -#define LPO_CAL_TEST_STATUS_READY_LSB SOC_LPO_CAL_TEST_STATUS_READY_LSB -#define LPO_CAL_TEST_STATUS_READY_MASK SOC_LPO_CAL_TEST_STATUS_READY_MASK -#define LPO_CAL_TEST_STATUS_READY_GET(x) SOC_LPO_CAL_TEST_STATUS_READY_GET(x) -#define LPO_CAL_TEST_STATUS_READY_SET(x) SOC_LPO_CAL_TEST_STATUS_READY_SET(x) -#define LPO_CAL_TEST_STATUS_COUNT_MSB SOC_LPO_CAL_TEST_STATUS_COUNT_MSB -#define LPO_CAL_TEST_STATUS_COUNT_LSB SOC_LPO_CAL_TEST_STATUS_COUNT_LSB -#define LPO_CAL_TEST_STATUS_COUNT_MASK SOC_LPO_CAL_TEST_STATUS_COUNT_MASK -#define LPO_CAL_TEST_STATUS_COUNT_GET(x) SOC_LPO_CAL_TEST_STATUS_COUNT_GET(x) -#define LPO_CAL_TEST_STATUS_COUNT_SET(x) SOC_LPO_CAL_TEST_STATUS_COUNT_SET(x) -#define CHIP_ID_ADDRESS SOC_CHIP_ID_ADDRESS -#define CHIP_ID_OFFSET SOC_CHIP_ID_OFFSET -#define CHIP_ID_DEVICE_ID_MSB SOC_CHIP_ID_DEVICE_ID_MSB -#define CHIP_ID_DEVICE_ID_LSB SOC_CHIP_ID_DEVICE_ID_LSB -#define CHIP_ID_DEVICE_ID_MASK SOC_CHIP_ID_DEVICE_ID_MASK -#define CHIP_ID_DEVICE_ID_GET(x) SOC_CHIP_ID_DEVICE_ID_GET(x) -#define CHIP_ID_DEVICE_ID_SET(x) SOC_CHIP_ID_DEVICE_ID_SET(x) -#define CHIP_ID_CONFIG_ID_MSB SOC_CHIP_ID_CONFIG_ID_MSB -#define CHIP_ID_CONFIG_ID_LSB SOC_CHIP_ID_CONFIG_ID_LSB -#define CHIP_ID_CONFIG_ID_MASK SOC_CHIP_ID_CONFIG_ID_MASK -#define CHIP_ID_CONFIG_ID_GET(x) SOC_CHIP_ID_CONFIG_ID_GET(x) -#define CHIP_ID_CONFIG_ID_SET(x) SOC_CHIP_ID_CONFIG_ID_SET(x) -#define CHIP_ID_VERSION_ID_MSB SOC_CHIP_ID_VERSION_ID_MSB -#define CHIP_ID_VERSION_ID_LSB SOC_CHIP_ID_VERSION_ID_LSB -#define CHIP_ID_VERSION_ID_MASK SOC_CHIP_ID_VERSION_ID_MASK -#define CHIP_ID_VERSION_ID_GET(x) SOC_CHIP_ID_VERSION_ID_GET(x) -#define CHIP_ID_VERSION_ID_SET(x) SOC_CHIP_ID_VERSION_ID_SET(x) -#define POWER_REG_ADDRESS SOC_POWER_REG_ADDRESS -#define POWER_REG_OFFSET SOC_POWER_REG_OFFSET -#define POWER_REG_SWREG_VS_EN_MSB SOC_POWER_REG_SWREG_VS_EN_MSB -#define POWER_REG_SWREG_VS_EN_LSB SOC_POWER_REG_SWREG_VS_EN_LSB -#define POWER_REG_SWREG_VS_EN_MASK SOC_POWER_REG_SWREG_VS_EN_MASK -#define POWER_REG_SWREG_VS_EN_GET(x) SOC_POWER_REG_SWREG_VS_EN_GET(x) -#define POWER_REG_SWREG_VS_EN_SET(x) SOC_POWER_REG_SWREG_VS_EN_SET(x) -#define POWER_REG_DISCON_MODE_EN_MSB SOC_POWER_REG_DISCON_MODE_EN_MSB -#define POWER_REG_DISCON_MODE_EN_LSB SOC_POWER_REG_DISCON_MODE_EN_LSB -#define POWER_REG_DISCON_MODE_EN_MASK SOC_POWER_REG_DISCON_MODE_EN_MASK -#define POWER_REG_DISCON_MODE_EN_GET(x) SOC_POWER_REG_DISCON_MODE_EN_GET(x) -#define POWER_REG_DISCON_MODE_EN_SET(x) SOC_POWER_REG_DISCON_MODE_EN_SET(x) -#define POWER_REG_DEEP_SLEEP_EN_MSB SOC_POWER_REG_DEEP_SLEEP_EN_MSB -#define POWER_REG_DEEP_SLEEP_EN_LSB SOC_POWER_REG_DEEP_SLEEP_EN_LSB -#define POWER_REG_DEEP_SLEEP_EN_MASK SOC_POWER_REG_DEEP_SLEEP_EN_MASK -#define POWER_REG_DEEP_SLEEP_EN_GET(x) SOC_POWER_REG_DEEP_SLEEP_EN_GET(x) -#define POWER_REG_DEEP_SLEEP_EN_SET(x) SOC_POWER_REG_DEEP_SLEEP_EN_SET(x) -#define POWER_REG_DEBUG_EN_MSB SOC_POWER_REG_DEBUG_EN_MSB -#define POWER_REG_DEBUG_EN_LSB SOC_POWER_REG_DEBUG_EN_LSB -#define POWER_REG_DEBUG_EN_MASK SOC_POWER_REG_DEBUG_EN_MASK -#define POWER_REG_DEBUG_EN_GET(x) SOC_POWER_REG_DEBUG_EN_GET(x) -#define POWER_REG_DEBUG_EN_SET(x) SOC_POWER_REG_DEBUG_EN_SET(x) -#define POWER_REG_WLAN_BB_PWD_EN_MSB SOC_POWER_REG_WLAN_BB_PWD_EN_MSB -#define POWER_REG_WLAN_BB_PWD_EN_LSB SOC_POWER_REG_WLAN_BB_PWD_EN_LSB -#define POWER_REG_WLAN_BB_PWD_EN_MASK SOC_POWER_REG_WLAN_BB_PWD_EN_MASK -#define POWER_REG_WLAN_BB_PWD_EN_GET(x) SOC_POWER_REG_WLAN_BB_PWD_EN_GET(x) -#define POWER_REG_WLAN_BB_PWD_EN_SET(x) SOC_POWER_REG_WLAN_BB_PWD_EN_SET(x) -#define POWER_REG_WLAN_MAC_PWD_EN_MSB SOC_POWER_REG_WLAN_MAC_PWD_EN_MSB -#define POWER_REG_WLAN_MAC_PWD_EN_LSB SOC_POWER_REG_WLAN_MAC_PWD_EN_LSB -#define POWER_REG_WLAN_MAC_PWD_EN_MASK SOC_POWER_REG_WLAN_MAC_PWD_EN_MASK -#define POWER_REG_WLAN_MAC_PWD_EN_GET(x) SOC_POWER_REG_WLAN_MAC_PWD_EN_GET(x) -#define POWER_REG_WLAN_MAC_PWD_EN_SET(x) SOC_POWER_REG_WLAN_MAC_PWD_EN_SET(x) -#define POWER_REG_CPU_INT_ENABLE_MSB SOC_POWER_REG_CPU_INT_ENABLE_MSB -#define POWER_REG_CPU_INT_ENABLE_LSB SOC_POWER_REG_CPU_INT_ENABLE_LSB -#define POWER_REG_CPU_INT_ENABLE_MASK SOC_POWER_REG_CPU_INT_ENABLE_MASK -#define POWER_REG_CPU_INT_ENABLE_GET(x) SOC_POWER_REG_CPU_INT_ENABLE_GET(x) -#define POWER_REG_CPU_INT_ENABLE_SET(x) SOC_POWER_REG_CPU_INT_ENABLE_SET(x) -#define POWER_REG_RADIO_PWD_EN_MSB SOC_POWER_REG_RADIO_PWD_EN_MSB -#define POWER_REG_RADIO_PWD_EN_LSB SOC_POWER_REG_RADIO_PWD_EN_LSB -#define POWER_REG_RADIO_PWD_EN_MASK SOC_POWER_REG_RADIO_PWD_EN_MASK -#define POWER_REG_RADIO_PWD_EN_GET(x) SOC_POWER_REG_RADIO_PWD_EN_GET(x) -#define POWER_REG_RADIO_PWD_EN_SET(x) SOC_POWER_REG_RADIO_PWD_EN_SET(x) -#define POWER_REG_WLAN_PWD_EN_MSB SOC_POWER_REG_WLAN_PWD_EN_MSB -#define POWER_REG_WLAN_PWD_EN_LSB SOC_POWER_REG_WLAN_PWD_EN_LSB -#define POWER_REG_WLAN_PWD_EN_MASK SOC_POWER_REG_WLAN_PWD_EN_MASK -#define POWER_REG_WLAN_PWD_EN_GET(x) SOC_POWER_REG_WLAN_PWD_EN_GET(x) -#define POWER_REG_WLAN_PWD_EN_SET(x) SOC_POWER_REG_WLAN_PWD_EN_SET(x) -#define POWER_REG_POWER_EN_MSB SOC_POWER_REG_POWER_EN_MSB -#define POWER_REG_POWER_EN_LSB SOC_POWER_REG_POWER_EN_LSB -#define POWER_REG_POWER_EN_MASK SOC_POWER_REG_POWER_EN_MASK -#define POWER_REG_POWER_EN_GET(x) SOC_POWER_REG_POWER_EN_GET(x) -#define POWER_REG_POWER_EN_SET(x) SOC_POWER_REG_POWER_EN_SET(x) -#define CORE_CLK_CTRL_ADDRESS SOC_CORE_CLK_CTRL_ADDRESS -#define CORE_CLK_CTRL_OFFSET SOC_CORE_CLK_CTRL_OFFSET -#define CORE_CLK_CTRL_DIV_MSB SOC_CORE_CLK_CTRL_DIV_MSB -#define CORE_CLK_CTRL_DIV_LSB SOC_CORE_CLK_CTRL_DIV_LSB -#define CORE_CLK_CTRL_DIV_MASK SOC_CORE_CLK_CTRL_DIV_MASK -#define CORE_CLK_CTRL_DIV_GET(x) SOC_CORE_CLK_CTRL_DIV_GET(x) -#define CORE_CLK_CTRL_DIV_SET(x) SOC_CORE_CLK_CTRL_DIV_SET(x) -#define GPIO_WAKEUP_CONTROL_ADDRESS SOC_GPIO_WAKEUP_CONTROL_ADDRESS -#define GPIO_WAKEUP_CONTROL_OFFSET SOC_GPIO_WAKEUP_CONTROL_OFFSET -#define GPIO_WAKEUP_CONTROL_ENABLE_MSB SOC_GPIO_WAKEUP_CONTROL_ENABLE_MSB -#define GPIO_WAKEUP_CONTROL_ENABLE_LSB SOC_GPIO_WAKEUP_CONTROL_ENABLE_LSB -#define GPIO_WAKEUP_CONTROL_ENABLE_MASK SOC_GPIO_WAKEUP_CONTROL_ENABLE_MASK -#define GPIO_WAKEUP_CONTROL_ENABLE_GET(x) SOC_GPIO_WAKEUP_CONTROL_ENABLE_GET(x) -#define GPIO_WAKEUP_CONTROL_ENABLE_SET(x) SOC_GPIO_WAKEUP_CONTROL_ENABLE_SET(x) - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_soc_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_soc_reg.h deleted file mode 100644 index 5c69d6d309cf..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_soc_reg.h +++ /dev/null @@ -1,1856 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _RTC_SOC_REG_REG_H_ -#define _RTC_SOC_REG_REG_H_ - -#define SOC_RESET_CONTROL_ADDRESS 0x00000000 -#define SOC_RESET_CONTROL_OFFSET 0x00000000 -#define SOC_RESET_CONTROL_SDIO2_RST_MSB 31 -#define SOC_RESET_CONTROL_SDIO2_RST_LSB 31 -#define SOC_RESET_CONTROL_SDIO2_RST_MASK 0x80000000 -#define SOC_RESET_CONTROL_SDIO2_RST_GET(x) (((x) & SOC_RESET_CONTROL_SDIO2_RST_MASK) >> SOC_RESET_CONTROL_SDIO2_RST_LSB) -#define SOC_RESET_CONTROL_SDIO2_RST_SET(x) (((x) << SOC_RESET_CONTROL_SDIO2_RST_LSB) & SOC_RESET_CONTROL_SDIO2_RST_MASK) -#define SOC_RESET_CONTROL_SPI2_RST_MSB 30 -#define SOC_RESET_CONTROL_SPI2_RST_LSB 30 -#define SOC_RESET_CONTROL_SPI2_RST_MASK 0x40000000 -#define SOC_RESET_CONTROL_SPI2_RST_GET(x) (((x) & SOC_RESET_CONTROL_SPI2_RST_MASK) >> SOC_RESET_CONTROL_SPI2_RST_LSB) -#define SOC_RESET_CONTROL_SPI2_RST_SET(x) (((x) << SOC_RESET_CONTROL_SPI2_RST_LSB) & SOC_RESET_CONTROL_SPI2_RST_MASK) -#define SOC_RESET_CONTROL_I2S_1_RST_MSB 29 -#define SOC_RESET_CONTROL_I2S_1_RST_LSB 29 -#define SOC_RESET_CONTROL_I2S_1_RST_MASK 0x20000000 -#define SOC_RESET_CONTROL_I2S_1_RST_GET(x) (((x) & SOC_RESET_CONTROL_I2S_1_RST_MASK) >> SOC_RESET_CONTROL_I2S_1_RST_LSB) -#define SOC_RESET_CONTROL_I2S_1_RST_SET(x) (((x) << SOC_RESET_CONTROL_I2S_1_RST_LSB) & SOC_RESET_CONTROL_I2S_1_RST_MASK) -#define SOC_RESET_CONTROL_I2S_1_MBOX_RST_MSB 28 -#define SOC_RESET_CONTROL_I2S_1_MBOX_RST_LSB 28 -#define SOC_RESET_CONTROL_I2S_1_MBOX_RST_MASK 0x10000000 -#define SOC_RESET_CONTROL_I2S_1_MBOX_RST_GET(x) (((x) & SOC_RESET_CONTROL_I2S_1_MBOX_RST_MASK) >> SOC_RESET_CONTROL_I2S_1_MBOX_RST_LSB) -#define SOC_RESET_CONTROL_I2S_1_MBOX_RST_SET(x) (((x) << SOC_RESET_CONTROL_I2S_1_MBOX_RST_LSB) & SOC_RESET_CONTROL_I2S_1_MBOX_RST_MASK) -#define SOC_RESET_CONTROL_I2C_SLAVE_RST_MSB 27 -#define SOC_RESET_CONTROL_I2C_SLAVE_RST_LSB 27 -#define SOC_RESET_CONTROL_I2C_SLAVE_RST_MASK 0x08000000 -#define SOC_RESET_CONTROL_I2C_SLAVE_RST_GET(x) (((x) & SOC_RESET_CONTROL_I2C_SLAVE_RST_MASK) >> SOC_RESET_CONTROL_I2C_SLAVE_RST_LSB) -#define SOC_RESET_CONTROL_I2C_SLAVE_RST_SET(x) (((x) << SOC_RESET_CONTROL_I2C_SLAVE_RST_LSB) & SOC_RESET_CONTROL_I2C_SLAVE_RST_MASK) -#define SOC_RESET_CONTROL_USB_PHY_ARST_MSB 26 -#define SOC_RESET_CONTROL_USB_PHY_ARST_LSB 26 -#define SOC_RESET_CONTROL_USB_PHY_ARST_MASK 0x04000000 -#define SOC_RESET_CONTROL_USB_PHY_ARST_GET(x) (((x) & SOC_RESET_CONTROL_USB_PHY_ARST_MASK) >> SOC_RESET_CONTROL_USB_PHY_ARST_LSB) -#define SOC_RESET_CONTROL_USB_PHY_ARST_SET(x) (((x) << SOC_RESET_CONTROL_USB_PHY_ARST_LSB) & SOC_RESET_CONTROL_USB_PHY_ARST_MASK) -#define SOC_RESET_CONTROL_USB_PHY_RST_MSB 25 -#define SOC_RESET_CONTROL_USB_PHY_RST_LSB 25 -#define SOC_RESET_CONTROL_USB_PHY_RST_MASK 0x02000000 -#define SOC_RESET_CONTROL_USB_PHY_RST_GET(x) (((x) & SOC_RESET_CONTROL_USB_PHY_RST_MASK) >> SOC_RESET_CONTROL_USB_PHY_RST_LSB) -#define SOC_RESET_CONTROL_USB_PHY_RST_SET(x) (((x) << SOC_RESET_CONTROL_USB_PHY_RST_LSB) & SOC_RESET_CONTROL_USB_PHY_RST_MASK) -#define SOC_RESET_CONTROL_USB_RST_MSB 24 -#define SOC_RESET_CONTROL_USB_RST_LSB 24 -#define SOC_RESET_CONTROL_USB_RST_MASK 0x01000000 -#define SOC_RESET_CONTROL_USB_RST_GET(x) (((x) & SOC_RESET_CONTROL_USB_RST_MASK) >> SOC_RESET_CONTROL_USB_RST_LSB) -#define SOC_RESET_CONTROL_USB_RST_SET(x) (((x) << SOC_RESET_CONTROL_USB_RST_LSB) & SOC_RESET_CONTROL_USB_RST_MASK) -#define SOC_RESET_CONTROL_MMAC_RST_MSB 23 -#define SOC_RESET_CONTROL_MMAC_RST_LSB 23 -#define SOC_RESET_CONTROL_MMAC_RST_MASK 0x00800000 -#define SOC_RESET_CONTROL_MMAC_RST_GET(x) (((x) & SOC_RESET_CONTROL_MMAC_RST_MASK) >> SOC_RESET_CONTROL_MMAC_RST_LSB) -#define SOC_RESET_CONTROL_MMAC_RST_SET(x) (((x) << SOC_RESET_CONTROL_MMAC_RST_LSB) & SOC_RESET_CONTROL_MMAC_RST_MASK) -#define SOC_RESET_CONTROL_MDIO_RST_MSB 22 -#define SOC_RESET_CONTROL_MDIO_RST_LSB 22 -#define SOC_RESET_CONTROL_MDIO_RST_MASK 0x00400000 -#define SOC_RESET_CONTROL_MDIO_RST_GET(x) (((x) & SOC_RESET_CONTROL_MDIO_RST_MASK) >> SOC_RESET_CONTROL_MDIO_RST_LSB) -#define SOC_RESET_CONTROL_MDIO_RST_SET(x) (((x) << SOC_RESET_CONTROL_MDIO_RST_LSB) & SOC_RESET_CONTROL_MDIO_RST_MASK) -#define SOC_RESET_CONTROL_GE0_RST_MSB 21 -#define SOC_RESET_CONTROL_GE0_RST_LSB 21 -#define SOC_RESET_CONTROL_GE0_RST_MASK 0x00200000 -#define SOC_RESET_CONTROL_GE0_RST_GET(x) (((x) & SOC_RESET_CONTROL_GE0_RST_MASK) >> SOC_RESET_CONTROL_GE0_RST_LSB) -#define SOC_RESET_CONTROL_GE0_RST_SET(x) (((x) << SOC_RESET_CONTROL_GE0_RST_LSB) & SOC_RESET_CONTROL_GE0_RST_MASK) -#define SOC_RESET_CONTROL_I2S_RST_MSB 20 -#define SOC_RESET_CONTROL_I2S_RST_LSB 20 -#define SOC_RESET_CONTROL_I2S_RST_MASK 0x00100000 -#define SOC_RESET_CONTROL_I2S_RST_GET(x) (((x) & SOC_RESET_CONTROL_I2S_RST_MASK) >> SOC_RESET_CONTROL_I2S_RST_LSB) -#define SOC_RESET_CONTROL_I2S_RST_SET(x) (((x) << SOC_RESET_CONTROL_I2S_RST_LSB) & SOC_RESET_CONTROL_I2S_RST_MASK) -#define SOC_RESET_CONTROL_I2S_MBOX_RST_MSB 19 -#define SOC_RESET_CONTROL_I2S_MBOX_RST_LSB 19 -#define SOC_RESET_CONTROL_I2S_MBOX_RST_MASK 0x00080000 -#define SOC_RESET_CONTROL_I2S_MBOX_RST_GET(x) (((x) & SOC_RESET_CONTROL_I2S_MBOX_RST_MASK) >> SOC_RESET_CONTROL_I2S_MBOX_RST_LSB) -#define SOC_RESET_CONTROL_I2S_MBOX_RST_SET(x) (((x) << SOC_RESET_CONTROL_I2S_MBOX_RST_LSB) & SOC_RESET_CONTROL_I2S_MBOX_RST_MASK) -#define SOC_RESET_CONTROL_CHECKSUM_ACC_RST_MSB 18 -#define SOC_RESET_CONTROL_CHECKSUM_ACC_RST_LSB 18 -#define SOC_RESET_CONTROL_CHECKSUM_ACC_RST_MASK 0x00040000 -#define SOC_RESET_CONTROL_CHECKSUM_ACC_RST_GET(x) (((x) & SOC_RESET_CONTROL_CHECKSUM_ACC_RST_MASK) >> SOC_RESET_CONTROL_CHECKSUM_ACC_RST_LSB) -#define SOC_RESET_CONTROL_CHECKSUM_ACC_RST_SET(x) (((x) << SOC_RESET_CONTROL_CHECKSUM_ACC_RST_LSB) & SOC_RESET_CONTROL_CHECKSUM_ACC_RST_MASK) -#define SOC_RESET_CONTROL_UART2_RST_MSB 17 -#define SOC_RESET_CONTROL_UART2_RST_LSB 17 -#define SOC_RESET_CONTROL_UART2_RST_MASK 0x00020000 -#define SOC_RESET_CONTROL_UART2_RST_GET(x) (((x) & SOC_RESET_CONTROL_UART2_RST_MASK) >> SOC_RESET_CONTROL_UART2_RST_LSB) -#define SOC_RESET_CONTROL_UART2_RST_SET(x) (((x) << SOC_RESET_CONTROL_UART2_RST_LSB) & SOC_RESET_CONTROL_UART2_RST_MASK) -#define SOC_RESET_CONTROL_DEBUG_UART_RST_MSB 16 -#define SOC_RESET_CONTROL_DEBUG_UART_RST_LSB 16 -#define SOC_RESET_CONTROL_DEBUG_UART_RST_MASK 0x00010000 -#define SOC_RESET_CONTROL_DEBUG_UART_RST_GET(x) (((x) & SOC_RESET_CONTROL_DEBUG_UART_RST_MASK) >> SOC_RESET_CONTROL_DEBUG_UART_RST_LSB) -#define SOC_RESET_CONTROL_DEBUG_UART_RST_SET(x) (((x) << SOC_RESET_CONTROL_DEBUG_UART_RST_LSB) & SOC_RESET_CONTROL_DEBUG_UART_RST_MASK) -#define SOC_RESET_CONTROL_MIT_REG_MAPPING_RST_MSB 13 -#define SOC_RESET_CONTROL_MIT_REG_MAPPING_RST_LSB 13 -#define SOC_RESET_CONTROL_MIT_REG_MAPPING_RST_MASK 0x00002000 -#define SOC_RESET_CONTROL_MIT_REG_MAPPING_RST_GET(x) (((x) & SOC_RESET_CONTROL_MIT_REG_MAPPING_RST_MASK) >> SOC_RESET_CONTROL_MIT_REG_MAPPING_RST_LSB) -#define SOC_RESET_CONTROL_MIT_REG_MAPPING_RST_SET(x) (((x) << SOC_RESET_CONTROL_MIT_REG_MAPPING_RST_LSB) & SOC_RESET_CONTROL_MIT_REG_MAPPING_RST_MASK) -#define SOC_RESET_CONTROL_MIT_ADAPTOR_RST_MSB 12 -#define SOC_RESET_CONTROL_MIT_ADAPTOR_RST_LSB 12 -#define SOC_RESET_CONTROL_MIT_ADAPTOR_RST_MASK 0x00001000 -#define SOC_RESET_CONTROL_MIT_ADAPTOR_RST_GET(x) (((x) & SOC_RESET_CONTROL_MIT_ADAPTOR_RST_MASK) >> SOC_RESET_CONTROL_MIT_ADAPTOR_RST_LSB) -#define SOC_RESET_CONTROL_MIT_ADAPTOR_RST_SET(x) (((x) << SOC_RESET_CONTROL_MIT_ADAPTOR_RST_LSB) & SOC_RESET_CONTROL_MIT_ADAPTOR_RST_MASK) -#define SOC_RESET_CONTROL_CPU_INIT_RESET_MSB 11 -#define SOC_RESET_CONTROL_CPU_INIT_RESET_LSB 11 -#define SOC_RESET_CONTROL_CPU_INIT_RESET_MASK 0x00000800 -#define SOC_RESET_CONTROL_CPU_INIT_RESET_GET(x) (((x) & SOC_RESET_CONTROL_CPU_INIT_RESET_MASK) >> SOC_RESET_CONTROL_CPU_INIT_RESET_LSB) -#define SOC_RESET_CONTROL_CPU_INIT_RESET_SET(x) (((x) << SOC_RESET_CONTROL_CPU_INIT_RESET_LSB) & SOC_RESET_CONTROL_CPU_INIT_RESET_MASK) -#define SOC_RESET_CONTROL_RST_OUT_MSB 9 -#define SOC_RESET_CONTROL_RST_OUT_LSB 9 -#define SOC_RESET_CONTROL_RST_OUT_MASK 0x00000200 -#define SOC_RESET_CONTROL_RST_OUT_GET(x) (((x) & SOC_RESET_CONTROL_RST_OUT_MASK) >> SOC_RESET_CONTROL_RST_OUT_LSB) -#define SOC_RESET_CONTROL_RST_OUT_SET(x) (((x) << SOC_RESET_CONTROL_RST_OUT_LSB) & SOC_RESET_CONTROL_RST_OUT_MASK) -#define SOC_RESET_CONTROL_COLD_RST_MSB 8 -#define SOC_RESET_CONTROL_COLD_RST_LSB 8 -#define SOC_RESET_CONTROL_COLD_RST_MASK 0x00000100 -#define SOC_RESET_CONTROL_COLD_RST_GET(x) (((x) & SOC_RESET_CONTROL_COLD_RST_MASK) >> SOC_RESET_CONTROL_COLD_RST_LSB) -#define SOC_RESET_CONTROL_COLD_RST_SET(x) (((x) << SOC_RESET_CONTROL_COLD_RST_LSB) & SOC_RESET_CONTROL_COLD_RST_MASK) -#define SOC_RESET_CONTROL_CPU_WARM_RST_MSB 6 -#define SOC_RESET_CONTROL_CPU_WARM_RST_LSB 6 -#define SOC_RESET_CONTROL_CPU_WARM_RST_MASK 0x00000040 -#define SOC_RESET_CONTROL_CPU_WARM_RST_GET(x) (((x) & SOC_RESET_CONTROL_CPU_WARM_RST_MASK) >> SOC_RESET_CONTROL_CPU_WARM_RST_LSB) -#define SOC_RESET_CONTROL_CPU_WARM_RST_SET(x) (((x) << SOC_RESET_CONTROL_CPU_WARM_RST_LSB) & SOC_RESET_CONTROL_CPU_WARM_RST_MASK) -#define SOC_RESET_CONTROL_MBOX_RST_MSB 2 -#define SOC_RESET_CONTROL_MBOX_RST_LSB 2 -#define SOC_RESET_CONTROL_MBOX_RST_MASK 0x00000004 -#define SOC_RESET_CONTROL_MBOX_RST_GET(x) (((x) & SOC_RESET_CONTROL_MBOX_RST_MASK) >> SOC_RESET_CONTROL_MBOX_RST_LSB) -#define SOC_RESET_CONTROL_MBOX_RST_SET(x) (((x) << SOC_RESET_CONTROL_MBOX_RST_LSB) & SOC_RESET_CONTROL_MBOX_RST_MASK) -#define SOC_RESET_CONTROL_UART_RST_MSB 1 -#define SOC_RESET_CONTROL_UART_RST_LSB 1 -#define SOC_RESET_CONTROL_UART_RST_MASK 0x00000002 -#define SOC_RESET_CONTROL_UART_RST_GET(x) (((x) & SOC_RESET_CONTROL_UART_RST_MASK) >> SOC_RESET_CONTROL_UART_RST_LSB) -#define SOC_RESET_CONTROL_UART_RST_SET(x) (((x) << SOC_RESET_CONTROL_UART_RST_LSB) & SOC_RESET_CONTROL_UART_RST_MASK) -#define SOC_RESET_CONTROL_SI0_RST_MSB 0 -#define SOC_RESET_CONTROL_SI0_RST_LSB 0 -#define SOC_RESET_CONTROL_SI0_RST_MASK 0x00000001 -#define SOC_RESET_CONTROL_SI0_RST_GET(x) (((x) & SOC_RESET_CONTROL_SI0_RST_MASK) >> SOC_RESET_CONTROL_SI0_RST_LSB) -#define SOC_RESET_CONTROL_SI0_RST_SET(x) (((x) << SOC_RESET_CONTROL_SI0_RST_LSB) & SOC_RESET_CONTROL_SI0_RST_MASK) - -#define SOC_TCXO_DETECT_ADDRESS 0x00000004 -#define SOC_TCXO_DETECT_OFFSET 0x00000004 -#define SOC_TCXO_DETECT_PRESENT_MSB 0 -#define SOC_TCXO_DETECT_PRESENT_LSB 0 -#define SOC_TCXO_DETECT_PRESENT_MASK 0x00000001 -#define SOC_TCXO_DETECT_PRESENT_GET(x) (((x) & SOC_TCXO_DETECT_PRESENT_MASK) >> SOC_TCXO_DETECT_PRESENT_LSB) -#define SOC_TCXO_DETECT_PRESENT_SET(x) (((x) << SOC_TCXO_DETECT_PRESENT_LSB) & SOC_TCXO_DETECT_PRESENT_MASK) - -#define SOC_XTAL_TEST_ADDRESS 0x00000008 -#define SOC_XTAL_TEST_OFFSET 0x00000008 -#define SOC_XTAL_TEST_NOTCXODET_MSB 0 -#define SOC_XTAL_TEST_NOTCXODET_LSB 0 -#define SOC_XTAL_TEST_NOTCXODET_MASK 0x00000001 -#define SOC_XTAL_TEST_NOTCXODET_GET(x) (((x) & SOC_XTAL_TEST_NOTCXODET_MASK) >> SOC_XTAL_TEST_NOTCXODET_LSB) -#define SOC_XTAL_TEST_NOTCXODET_SET(x) (((x) << SOC_XTAL_TEST_NOTCXODET_LSB) & SOC_XTAL_TEST_NOTCXODET_MASK) - -#define SOC_CPU_CLOCK_ADDRESS 0x00000020 -#define SOC_CPU_CLOCK_OFFSET 0x00000020 -#define SOC_CPU_CLOCK_STANDARD_MSB 1 -#define SOC_CPU_CLOCK_STANDARD_LSB 0 -#define SOC_CPU_CLOCK_STANDARD_MASK 0x00000003 -#define SOC_CPU_CLOCK_STANDARD_GET(x) (((x) & SOC_CPU_CLOCK_STANDARD_MASK) >> SOC_CPU_CLOCK_STANDARD_LSB) -#define SOC_CPU_CLOCK_STANDARD_SET(x) (((x) << SOC_CPU_CLOCK_STANDARD_LSB) & SOC_CPU_CLOCK_STANDARD_MASK) - -#define SOC_CLOCK_CONTROL_ADDRESS 0x00000028 -#define SOC_CLOCK_CONTROL_OFFSET 0x00000028 -#define SOC_CLOCK_CONTROL_LF_CLK32_MSB 2 -#define SOC_CLOCK_CONTROL_LF_CLK32_LSB 2 -#define SOC_CLOCK_CONTROL_LF_CLK32_MASK 0x00000004 -#define SOC_CLOCK_CONTROL_LF_CLK32_GET(x) (((x) & SOC_CLOCK_CONTROL_LF_CLK32_MASK) >> SOC_CLOCK_CONTROL_LF_CLK32_LSB) -#define SOC_CLOCK_CONTROL_LF_CLK32_SET(x) (((x) << SOC_CLOCK_CONTROL_LF_CLK32_LSB) & SOC_CLOCK_CONTROL_LF_CLK32_MASK) -#define SOC_CLOCK_CONTROL_SI0_CLK_MSB 0 -#define SOC_CLOCK_CONTROL_SI0_CLK_LSB 0 -#define SOC_CLOCK_CONTROL_SI0_CLK_MASK 0x00000001 -#define SOC_CLOCK_CONTROL_SI0_CLK_GET(x) (((x) & SOC_CLOCK_CONTROL_SI0_CLK_MASK) >> SOC_CLOCK_CONTROL_SI0_CLK_LSB) -#define SOC_CLOCK_CONTROL_SI0_CLK_SET(x) (((x) << SOC_CLOCK_CONTROL_SI0_CLK_LSB) & SOC_CLOCK_CONTROL_SI0_CLK_MASK) - -#define SOC_WDT_CONTROL_ADDRESS 0x00000030 -#define SOC_WDT_CONTROL_OFFSET 0x00000030 -#define SOC_WDT_CONTROL_ACTION_MSB 2 -#define SOC_WDT_CONTROL_ACTION_LSB 0 -#define SOC_WDT_CONTROL_ACTION_MASK 0x00000007 -#define SOC_WDT_CONTROL_ACTION_GET(x) (((x) & SOC_WDT_CONTROL_ACTION_MASK) >> SOC_WDT_CONTROL_ACTION_LSB) -#define SOC_WDT_CONTROL_ACTION_SET(x) (((x) << SOC_WDT_CONTROL_ACTION_LSB) & SOC_WDT_CONTROL_ACTION_MASK) - -#define SOC_WDT_STATUS_ADDRESS 0x00000034 -#define SOC_WDT_STATUS_OFFSET 0x00000034 -#define SOC_WDT_STATUS_INTERRUPT_MSB 0 -#define SOC_WDT_STATUS_INTERRUPT_LSB 0 -#define SOC_WDT_STATUS_INTERRUPT_MASK 0x00000001 -#define SOC_WDT_STATUS_INTERRUPT_GET(x) (((x) & SOC_WDT_STATUS_INTERRUPT_MASK) >> SOC_WDT_STATUS_INTERRUPT_LSB) -#define SOC_WDT_STATUS_INTERRUPT_SET(x) (((x) << SOC_WDT_STATUS_INTERRUPT_LSB) & SOC_WDT_STATUS_INTERRUPT_MASK) - -#define SOC_WDT_ADDRESS 0x00000038 -#define SOC_WDT_OFFSET 0x00000038 -#define SOC_WDT_TARGET_MSB 21 -#define SOC_WDT_TARGET_LSB 0 -#define SOC_WDT_TARGET_MASK 0x003fffff -#define SOC_WDT_TARGET_GET(x) (((x) & SOC_WDT_TARGET_MASK) >> SOC_WDT_TARGET_LSB) -#define SOC_WDT_TARGET_SET(x) (((x) << SOC_WDT_TARGET_LSB) & SOC_WDT_TARGET_MASK) - -#define SOC_WDT_COUNT_ADDRESS 0x0000003c -#define SOC_WDT_COUNT_OFFSET 0x0000003c -#define SOC_WDT_COUNT_VALUE_MSB 21 -#define SOC_WDT_COUNT_VALUE_LSB 0 -#define SOC_WDT_COUNT_VALUE_MASK 0x003fffff -#define SOC_WDT_COUNT_VALUE_GET(x) (((x) & SOC_WDT_COUNT_VALUE_MASK) >> SOC_WDT_COUNT_VALUE_LSB) -#define SOC_WDT_COUNT_VALUE_SET(x) (((x) << SOC_WDT_COUNT_VALUE_LSB) & SOC_WDT_COUNT_VALUE_MASK) - -#define SOC_WDT_RESET_ADDRESS 0x00000040 -#define SOC_WDT_RESET_OFFSET 0x00000040 -#define SOC_WDT_RESET_VALUE_MSB 0 -#define SOC_WDT_RESET_VALUE_LSB 0 -#define SOC_WDT_RESET_VALUE_MASK 0x00000001 -#define SOC_WDT_RESET_VALUE_GET(x) (((x) & SOC_WDT_RESET_VALUE_MASK) >> SOC_WDT_RESET_VALUE_LSB) -#define SOC_WDT_RESET_VALUE_SET(x) (((x) << SOC_WDT_RESET_VALUE_LSB) & SOC_WDT_RESET_VALUE_MASK) - -#define SOC_INT_STATUS_ADDRESS 0x00000044 -#define SOC_INT_STATUS_OFFSET 0x00000044 -#define SOC_INT_STATUS_STE_MBOX_MSB 31 -#define SOC_INT_STATUS_STE_MBOX_LSB 31 -#define SOC_INT_STATUS_STE_MBOX_MASK 0x80000000 -#define SOC_INT_STATUS_STE_MBOX_GET(x) (((x) & SOC_INT_STATUS_STE_MBOX_MASK) >> SOC_INT_STATUS_STE_MBOX_LSB) -#define SOC_INT_STATUS_STE_MBOX_SET(x) (((x) << SOC_INT_STATUS_STE_MBOX_LSB) & SOC_INT_STATUS_STE_MBOX_MASK) -#define SOC_INT_STATUS_SDIO2_MBOX_MSB 30 -#define SOC_INT_STATUS_SDIO2_MBOX_LSB 30 -#define SOC_INT_STATUS_SDIO2_MBOX_MASK 0x40000000 -#define SOC_INT_STATUS_SDIO2_MBOX_GET(x) (((x) & SOC_INT_STATUS_SDIO2_MBOX_MASK) >> SOC_INT_STATUS_SDIO2_MBOX_LSB) -#define SOC_INT_STATUS_SDIO2_MBOX_SET(x) (((x) << SOC_INT_STATUS_SDIO2_MBOX_LSB) & SOC_INT_STATUS_SDIO2_MBOX_MASK) -#define SOC_INT_STATUS_USBDMA_MSB 29 -#define SOC_INT_STATUS_USBDMA_LSB 29 -#define SOC_INT_STATUS_USBDMA_MASK 0x20000000 -#define SOC_INT_STATUS_USBDMA_GET(x) (((x) & SOC_INT_STATUS_USBDMA_MASK) >> SOC_INT_STATUS_USBDMA_LSB) -#define SOC_INT_STATUS_USBDMA_SET(x) (((x) << SOC_INT_STATUS_USBDMA_LSB) & SOC_INT_STATUS_USBDMA_MASK) -#define SOC_INT_STATUS_USBIP_MSB 28 -#define SOC_INT_STATUS_USBIP_LSB 28 -#define SOC_INT_STATUS_USBIP_MASK 0x10000000 -#define SOC_INT_STATUS_USBIP_GET(x) (((x) & SOC_INT_STATUS_USBIP_MASK) >> SOC_INT_STATUS_USBIP_LSB) -#define SOC_INT_STATUS_USBIP_SET(x) (((x) << SOC_INT_STATUS_USBIP_LSB) & SOC_INT_STATUS_USBIP_MASK) -#define SOC_INT_STATUS_MMAC_MSB 27 -#define SOC_INT_STATUS_MMAC_LSB 27 -#define SOC_INT_STATUS_MMAC_MASK 0x08000000 -#define SOC_INT_STATUS_MMAC_GET(x) (((x) & SOC_INT_STATUS_MMAC_MASK) >> SOC_INT_STATUS_MMAC_LSB) -#define SOC_INT_STATUS_MMAC_SET(x) (((x) << SOC_INT_STATUS_MMAC_LSB) & SOC_INT_STATUS_MMAC_MASK) -#define SOC_INT_STATUS_MIT_REG_ACCESS_MSB 26 -#define SOC_INT_STATUS_MIT_REG_ACCESS_LSB 26 -#define SOC_INT_STATUS_MIT_REG_ACCESS_MASK 0x04000000 -#define SOC_INT_STATUS_MIT_REG_ACCESS_GET(x) (((x) & SOC_INT_STATUS_MIT_REG_ACCESS_MASK) >> SOC_INT_STATUS_MIT_REG_ACCESS_LSB) -#define SOC_INT_STATUS_MIT_REG_ACCESS_SET(x) (((x) << SOC_INT_STATUS_MIT_REG_ACCESS_LSB) & SOC_INT_STATUS_MIT_REG_ACCESS_MASK) -#define SOC_INT_STATUS_FLIGHT_MODE_MSB 25 -#define SOC_INT_STATUS_FLIGHT_MODE_LSB 25 -#define SOC_INT_STATUS_FLIGHT_MODE_MASK 0x02000000 -#define SOC_INT_STATUS_FLIGHT_MODE_GET(x) (((x) & SOC_INT_STATUS_FLIGHT_MODE_MASK) >> SOC_INT_STATUS_FLIGHT_MODE_LSB) -#define SOC_INT_STATUS_FLIGHT_MODE_SET(x) (((x) << SOC_INT_STATUS_FLIGHT_MODE_LSB) & SOC_INT_STATUS_FLIGHT_MODE_MASK) -#define SOC_INT_STATUS_BBP_SLEEP_RISING_MSB 24 -#define SOC_INT_STATUS_BBP_SLEEP_RISING_LSB 24 -#define SOC_INT_STATUS_BBP_SLEEP_RISING_MASK 0x01000000 -#define SOC_INT_STATUS_BBP_SLEEP_RISING_GET(x) (((x) & SOC_INT_STATUS_BBP_SLEEP_RISING_MASK) >> SOC_INT_STATUS_BBP_SLEEP_RISING_LSB) -#define SOC_INT_STATUS_BBP_SLEEP_RISING_SET(x) (((x) << SOC_INT_STATUS_BBP_SLEEP_RISING_LSB) & SOC_INT_STATUS_BBP_SLEEP_RISING_MASK) -#define SOC_INT_STATUS_RF_SLEEP_RISING_MSB 23 -#define SOC_INT_STATUS_RF_SLEEP_RISING_LSB 23 -#define SOC_INT_STATUS_RF_SLEEP_RISING_MASK 0x00800000 -#define SOC_INT_STATUS_RF_SLEEP_RISING_GET(x) (((x) & SOC_INT_STATUS_RF_SLEEP_RISING_MASK) >> SOC_INT_STATUS_RF_SLEEP_RISING_LSB) -#define SOC_INT_STATUS_RF_SLEEP_RISING_SET(x) (((x) << SOC_INT_STATUS_RF_SLEEP_RISING_LSB) & SOC_INT_STATUS_RF_SLEEP_RISING_MASK) -#define SOC_INT_STATUS_MODE_SWITCH_MSB 22 -#define SOC_INT_STATUS_MODE_SWITCH_LSB 22 -#define SOC_INT_STATUS_MODE_SWITCH_MASK 0x00400000 -#define SOC_INT_STATUS_MODE_SWITCH_GET(x) (((x) & SOC_INT_STATUS_MODE_SWITCH_MASK) >> SOC_INT_STATUS_MODE_SWITCH_LSB) -#define SOC_INT_STATUS_MODE_SWITCH_SET(x) (((x) << SOC_INT_STATUS_MODE_SWITCH_LSB) & SOC_INT_STATUS_MODE_SWITCH_MASK) -#define SOC_INT_STATUS_HCI_UART_MSB 21 -#define SOC_INT_STATUS_HCI_UART_LSB 21 -#define SOC_INT_STATUS_HCI_UART_MASK 0x00200000 -#define SOC_INT_STATUS_HCI_UART_GET(x) (((x) & SOC_INT_STATUS_HCI_UART_MASK) >> SOC_INT_STATUS_HCI_UART_LSB) -#define SOC_INT_STATUS_HCI_UART_SET(x) (((x) << SOC_INT_STATUS_HCI_UART_LSB) & SOC_INT_STATUS_HCI_UART_MASK) -#define SOC_INT_STATUS_THERM_MSB 20 -#define SOC_INT_STATUS_THERM_LSB 20 -#define SOC_INT_STATUS_THERM_MASK 0x00100000 -#define SOC_INT_STATUS_THERM_GET(x) (((x) & SOC_INT_STATUS_THERM_MASK) >> SOC_INT_STATUS_THERM_LSB) -#define SOC_INT_STATUS_THERM_SET(x) (((x) << SOC_INT_STATUS_THERM_LSB) & SOC_INT_STATUS_THERM_MASK) -#define SOC_INT_STATUS_EFUSE_OVERWRITE_MSB 19 -#define SOC_INT_STATUS_EFUSE_OVERWRITE_LSB 19 -#define SOC_INT_STATUS_EFUSE_OVERWRITE_MASK 0x00080000 -#define SOC_INT_STATUS_EFUSE_OVERWRITE_GET(x) (((x) & SOC_INT_STATUS_EFUSE_OVERWRITE_MASK) >> SOC_INT_STATUS_EFUSE_OVERWRITE_LSB) -#define SOC_INT_STATUS_EFUSE_OVERWRITE_SET(x) (((x) << SOC_INT_STATUS_EFUSE_OVERWRITE_LSB) & SOC_INT_STATUS_EFUSE_OVERWRITE_MASK) -#define SOC_INT_STATUS_UART_MBOX_MSB 18 -#define SOC_INT_STATUS_UART_MBOX_LSB 18 -#define SOC_INT_STATUS_UART_MBOX_MASK 0x00040000 -#define SOC_INT_STATUS_UART_MBOX_GET(x) (((x) & SOC_INT_STATUS_UART_MBOX_MASK) >> SOC_INT_STATUS_UART_MBOX_LSB) -#define SOC_INT_STATUS_UART_MBOX_SET(x) (((x) << SOC_INT_STATUS_UART_MBOX_LSB) & SOC_INT_STATUS_UART_MBOX_MASK) -#define SOC_INT_STATUS_GENERIC_MBOX_MSB 17 -#define SOC_INT_STATUS_GENERIC_MBOX_LSB 17 -#define SOC_INT_STATUS_GENERIC_MBOX_MASK 0x00020000 -#define SOC_INT_STATUS_GENERIC_MBOX_GET(x) (((x) & SOC_INT_STATUS_GENERIC_MBOX_MASK) >> SOC_INT_STATUS_GENERIC_MBOX_LSB) -#define SOC_INT_STATUS_GENERIC_MBOX_SET(x) (((x) << SOC_INT_STATUS_GENERIC_MBOX_LSB) & SOC_INT_STATUS_GENERIC_MBOX_MASK) -#define SOC_INT_STATUS_RDMA_MSB 16 -#define SOC_INT_STATUS_RDMA_LSB 16 -#define SOC_INT_STATUS_RDMA_MASK 0x00010000 -#define SOC_INT_STATUS_RDMA_GET(x) (((x) & SOC_INT_STATUS_RDMA_MASK) >> SOC_INT_STATUS_RDMA_LSB) -#define SOC_INT_STATUS_RDMA_SET(x) (((x) << SOC_INT_STATUS_RDMA_LSB) & SOC_INT_STATUS_RDMA_MASK) -#define SOC_INT_STATUS_BTCOEX_MSB 15 -#define SOC_INT_STATUS_BTCOEX_LSB 15 -#define SOC_INT_STATUS_BTCOEX_MASK 0x00008000 -#define SOC_INT_STATUS_BTCOEX_GET(x) (((x) & SOC_INT_STATUS_BTCOEX_MASK) >> SOC_INT_STATUS_BTCOEX_LSB) -#define SOC_INT_STATUS_BTCOEX_SET(x) (((x) << SOC_INT_STATUS_BTCOEX_LSB) & SOC_INT_STATUS_BTCOEX_MASK) -#define SOC_INT_STATUS_RTC_POWER_MSB 14 -#define SOC_INT_STATUS_RTC_POWER_LSB 14 -#define SOC_INT_STATUS_RTC_POWER_MASK 0x00004000 -#define SOC_INT_STATUS_RTC_POWER_GET(x) (((x) & SOC_INT_STATUS_RTC_POWER_MASK) >> SOC_INT_STATUS_RTC_POWER_LSB) -#define SOC_INT_STATUS_RTC_POWER_SET(x) (((x) << SOC_INT_STATUS_RTC_POWER_LSB) & SOC_INT_STATUS_RTC_POWER_MASK) -#define SOC_INT_STATUS_MAC_MSB 13 -#define SOC_INT_STATUS_MAC_LSB 13 -#define SOC_INT_STATUS_MAC_MASK 0x00002000 -#define SOC_INT_STATUS_MAC_GET(x) (((x) & SOC_INT_STATUS_MAC_MASK) >> SOC_INT_STATUS_MAC_LSB) -#define SOC_INT_STATUS_MAC_SET(x) (((x) << SOC_INT_STATUS_MAC_LSB) & SOC_INT_STATUS_MAC_MASK) -#define SOC_INT_STATUS_MAILBOX_MSB 12 -#define SOC_INT_STATUS_MAILBOX_LSB 12 -#define SOC_INT_STATUS_MAILBOX_MASK 0x00001000 -#define SOC_INT_STATUS_MAILBOX_GET(x) (((x) & SOC_INT_STATUS_MAILBOX_MASK) >> SOC_INT_STATUS_MAILBOX_LSB) -#define SOC_INT_STATUS_MAILBOX_SET(x) (((x) << SOC_INT_STATUS_MAILBOX_LSB) & SOC_INT_STATUS_MAILBOX_MASK) -#define SOC_INT_STATUS_RTC_ALARM_MSB 11 -#define SOC_INT_STATUS_RTC_ALARM_LSB 11 -#define SOC_INT_STATUS_RTC_ALARM_MASK 0x00000800 -#define SOC_INT_STATUS_RTC_ALARM_GET(x) (((x) & SOC_INT_STATUS_RTC_ALARM_MASK) >> SOC_INT_STATUS_RTC_ALARM_LSB) -#define SOC_INT_STATUS_RTC_ALARM_SET(x) (((x) << SOC_INT_STATUS_RTC_ALARM_LSB) & SOC_INT_STATUS_RTC_ALARM_MASK) -#define SOC_INT_STATUS_HF_TIMER_MSB 10 -#define SOC_INT_STATUS_HF_TIMER_LSB 10 -#define SOC_INT_STATUS_HF_TIMER_MASK 0x00000400 -#define SOC_INT_STATUS_HF_TIMER_GET(x) (((x) & SOC_INT_STATUS_HF_TIMER_MASK) >> SOC_INT_STATUS_HF_TIMER_LSB) -#define SOC_INT_STATUS_HF_TIMER_SET(x) (((x) << SOC_INT_STATUS_HF_TIMER_LSB) & SOC_INT_STATUS_HF_TIMER_MASK) -#define SOC_INT_STATUS_LF_TIMER3_MSB 9 -#define SOC_INT_STATUS_LF_TIMER3_LSB 9 -#define SOC_INT_STATUS_LF_TIMER3_MASK 0x00000200 -#define SOC_INT_STATUS_LF_TIMER3_GET(x) (((x) & SOC_INT_STATUS_LF_TIMER3_MASK) >> SOC_INT_STATUS_LF_TIMER3_LSB) -#define SOC_INT_STATUS_LF_TIMER3_SET(x) (((x) << SOC_INT_STATUS_LF_TIMER3_LSB) & SOC_INT_STATUS_LF_TIMER3_MASK) -#define SOC_INT_STATUS_LF_TIMER2_MSB 8 -#define SOC_INT_STATUS_LF_TIMER2_LSB 8 -#define SOC_INT_STATUS_LF_TIMER2_MASK 0x00000100 -#define SOC_INT_STATUS_LF_TIMER2_GET(x) (((x) & SOC_INT_STATUS_LF_TIMER2_MASK) >> SOC_INT_STATUS_LF_TIMER2_LSB) -#define SOC_INT_STATUS_LF_TIMER2_SET(x) (((x) << SOC_INT_STATUS_LF_TIMER2_LSB) & SOC_INT_STATUS_LF_TIMER2_MASK) -#define SOC_INT_STATUS_LF_TIMER1_MSB 7 -#define SOC_INT_STATUS_LF_TIMER1_LSB 7 -#define SOC_INT_STATUS_LF_TIMER1_MASK 0x00000080 -#define SOC_INT_STATUS_LF_TIMER1_GET(x) (((x) & SOC_INT_STATUS_LF_TIMER1_MASK) >> SOC_INT_STATUS_LF_TIMER1_LSB) -#define SOC_INT_STATUS_LF_TIMER1_SET(x) (((x) << SOC_INT_STATUS_LF_TIMER1_LSB) & SOC_INT_STATUS_LF_TIMER1_MASK) -#define SOC_INT_STATUS_LF_TIMER0_MSB 6 -#define SOC_INT_STATUS_LF_TIMER0_LSB 6 -#define SOC_INT_STATUS_LF_TIMER0_MASK 0x00000040 -#define SOC_INT_STATUS_LF_TIMER0_GET(x) (((x) & SOC_INT_STATUS_LF_TIMER0_MASK) >> SOC_INT_STATUS_LF_TIMER0_LSB) -#define SOC_INT_STATUS_LF_TIMER0_SET(x) (((x) << SOC_INT_STATUS_LF_TIMER0_LSB) & SOC_INT_STATUS_LF_TIMER0_MASK) -#define SOC_INT_STATUS_KEYPAD_MSB 5 -#define SOC_INT_STATUS_KEYPAD_LSB 5 -#define SOC_INT_STATUS_KEYPAD_MASK 0x00000020 -#define SOC_INT_STATUS_KEYPAD_GET(x) (((x) & SOC_INT_STATUS_KEYPAD_MASK) >> SOC_INT_STATUS_KEYPAD_LSB) -#define SOC_INT_STATUS_KEYPAD_SET(x) (((x) << SOC_INT_STATUS_KEYPAD_LSB) & SOC_INT_STATUS_KEYPAD_MASK) -#define SOC_INT_STATUS_SI_MSB 4 -#define SOC_INT_STATUS_SI_LSB 4 -#define SOC_INT_STATUS_SI_MASK 0x00000010 -#define SOC_INT_STATUS_SI_GET(x) (((x) & SOC_INT_STATUS_SI_MASK) >> SOC_INT_STATUS_SI_LSB) -#define SOC_INT_STATUS_SI_SET(x) (((x) << SOC_INT_STATUS_SI_LSB) & SOC_INT_STATUS_SI_MASK) -#define SOC_INT_STATUS_GPIO_MSB 3 -#define SOC_INT_STATUS_GPIO_LSB 3 -#define SOC_INT_STATUS_GPIO_MASK 0x00000008 -#define SOC_INT_STATUS_GPIO_GET(x) (((x) & SOC_INT_STATUS_GPIO_MASK) >> SOC_INT_STATUS_GPIO_LSB) -#define SOC_INT_STATUS_GPIO_SET(x) (((x) << SOC_INT_STATUS_GPIO_LSB) & SOC_INT_STATUS_GPIO_MASK) -#define SOC_INT_STATUS_UART_MSB 2 -#define SOC_INT_STATUS_UART_LSB 2 -#define SOC_INT_STATUS_UART_MASK 0x00000004 -#define SOC_INT_STATUS_UART_GET(x) (((x) & SOC_INT_STATUS_UART_MASK) >> SOC_INT_STATUS_UART_LSB) -#define SOC_INT_STATUS_UART_SET(x) (((x) << SOC_INT_STATUS_UART_LSB) & SOC_INT_STATUS_UART_MASK) -#define SOC_INT_STATUS_ERROR_MSB 1 -#define SOC_INT_STATUS_ERROR_LSB 1 -#define SOC_INT_STATUS_ERROR_MASK 0x00000002 -#define SOC_INT_STATUS_ERROR_GET(x) (((x) & SOC_INT_STATUS_ERROR_MASK) >> SOC_INT_STATUS_ERROR_LSB) -#define SOC_INT_STATUS_ERROR_SET(x) (((x) << SOC_INT_STATUS_ERROR_LSB) & SOC_INT_STATUS_ERROR_MASK) -#define SOC_INT_STATUS_WDT_INT_MSB 0 -#define SOC_INT_STATUS_WDT_INT_LSB 0 -#define SOC_INT_STATUS_WDT_INT_MASK 0x00000001 -#define SOC_INT_STATUS_WDT_INT_GET(x) (((x) & SOC_INT_STATUS_WDT_INT_MASK) >> SOC_INT_STATUS_WDT_INT_LSB) -#define SOC_INT_STATUS_WDT_INT_SET(x) (((x) << SOC_INT_STATUS_WDT_INT_LSB) & SOC_INT_STATUS_WDT_INT_MASK) - -#define SOC_LF_TIMER0_ADDRESS 0x00000048 -#define SOC_LF_TIMER0_OFFSET 0x00000048 -#define SOC_LF_TIMER0_TARGET_MSB 31 -#define SOC_LF_TIMER0_TARGET_LSB 0 -#define SOC_LF_TIMER0_TARGET_MASK 0xffffffff -#define SOC_LF_TIMER0_TARGET_GET(x) (((x) & SOC_LF_TIMER0_TARGET_MASK) >> SOC_LF_TIMER0_TARGET_LSB) -#define SOC_LF_TIMER0_TARGET_SET(x) (((x) << SOC_LF_TIMER0_TARGET_LSB) & SOC_LF_TIMER0_TARGET_MASK) - -#define SOC_LF_TIMER_COUNT0_ADDRESS 0x0000004c -#define SOC_LF_TIMER_COUNT0_OFFSET 0x0000004c -#define SOC_LF_TIMER_COUNT0_VALUE_MSB 31 -#define SOC_LF_TIMER_COUNT0_VALUE_LSB 0 -#define SOC_LF_TIMER_COUNT0_VALUE_MASK 0xffffffff -#define SOC_LF_TIMER_COUNT0_VALUE_GET(x) (((x) & SOC_LF_TIMER_COUNT0_VALUE_MASK) >> SOC_LF_TIMER_COUNT0_VALUE_LSB) -#define SOC_LF_TIMER_COUNT0_VALUE_SET(x) (((x) << SOC_LF_TIMER_COUNT0_VALUE_LSB) & SOC_LF_TIMER_COUNT0_VALUE_MASK) - -#define SOC_LF_TIMER_CONTROL0_ADDRESS 0x00000050 -#define SOC_LF_TIMER_CONTROL0_OFFSET 0x00000050 -#define SOC_LF_TIMER_CONTROL0_ENABLE_MSB 2 -#define SOC_LF_TIMER_CONTROL0_ENABLE_LSB 2 -#define SOC_LF_TIMER_CONTROL0_ENABLE_MASK 0x00000004 -#define SOC_LF_TIMER_CONTROL0_ENABLE_GET(x) (((x) & SOC_LF_TIMER_CONTROL0_ENABLE_MASK) >> SOC_LF_TIMER_CONTROL0_ENABLE_LSB) -#define SOC_LF_TIMER_CONTROL0_ENABLE_SET(x) (((x) << SOC_LF_TIMER_CONTROL0_ENABLE_LSB) & SOC_LF_TIMER_CONTROL0_ENABLE_MASK) -#define SOC_LF_TIMER_CONTROL0_AUTO_RESTART_MSB 1 -#define SOC_LF_TIMER_CONTROL0_AUTO_RESTART_LSB 1 -#define SOC_LF_TIMER_CONTROL0_AUTO_RESTART_MASK 0x00000002 -#define SOC_LF_TIMER_CONTROL0_AUTO_RESTART_GET(x) (((x) & SOC_LF_TIMER_CONTROL0_AUTO_RESTART_MASK) >> SOC_LF_TIMER_CONTROL0_AUTO_RESTART_LSB) -#define SOC_LF_TIMER_CONTROL0_AUTO_RESTART_SET(x) (((x) << SOC_LF_TIMER_CONTROL0_AUTO_RESTART_LSB) & SOC_LF_TIMER_CONTROL0_AUTO_RESTART_MASK) -#define SOC_LF_TIMER_CONTROL0_RESET_MSB 0 -#define SOC_LF_TIMER_CONTROL0_RESET_LSB 0 -#define SOC_LF_TIMER_CONTROL0_RESET_MASK 0x00000001 -#define SOC_LF_TIMER_CONTROL0_RESET_GET(x) (((x) & SOC_LF_TIMER_CONTROL0_RESET_MASK) >> SOC_LF_TIMER_CONTROL0_RESET_LSB) -#define SOC_LF_TIMER_CONTROL0_RESET_SET(x) (((x) << SOC_LF_TIMER_CONTROL0_RESET_LSB) & SOC_LF_TIMER_CONTROL0_RESET_MASK) - -#define SOC_LF_TIMER_STATUS0_ADDRESS 0x00000054 -#define SOC_LF_TIMER_STATUS0_OFFSET 0x00000054 -#define SOC_LF_TIMER_STATUS0_INTERRUPT_MSB 0 -#define SOC_LF_TIMER_STATUS0_INTERRUPT_LSB 0 -#define SOC_LF_TIMER_STATUS0_INTERRUPT_MASK 0x00000001 -#define SOC_LF_TIMER_STATUS0_INTERRUPT_GET(x) (((x) & SOC_LF_TIMER_STATUS0_INTERRUPT_MASK) >> SOC_LF_TIMER_STATUS0_INTERRUPT_LSB) -#define SOC_LF_TIMER_STATUS0_INTERRUPT_SET(x) (((x) << SOC_LF_TIMER_STATUS0_INTERRUPT_LSB) & SOC_LF_TIMER_STATUS0_INTERRUPT_MASK) - -#define SOC_LF_TIMER1_ADDRESS 0x00000058 -#define SOC_LF_TIMER1_OFFSET 0x00000058 -#define SOC_LF_TIMER1_TARGET_MSB 31 -#define SOC_LF_TIMER1_TARGET_LSB 0 -#define SOC_LF_TIMER1_TARGET_MASK 0xffffffff -#define SOC_LF_TIMER1_TARGET_GET(x) (((x) & SOC_LF_TIMER1_TARGET_MASK) >> SOC_LF_TIMER1_TARGET_LSB) -#define SOC_LF_TIMER1_TARGET_SET(x) (((x) << SOC_LF_TIMER1_TARGET_LSB) & SOC_LF_TIMER1_TARGET_MASK) - -#define SOC_LF_TIMER_COUNT1_ADDRESS 0x0000005c -#define SOC_LF_TIMER_COUNT1_OFFSET 0x0000005c -#define SOC_LF_TIMER_COUNT1_VALUE_MSB 31 -#define SOC_LF_TIMER_COUNT1_VALUE_LSB 0 -#define SOC_LF_TIMER_COUNT1_VALUE_MASK 0xffffffff -#define SOC_LF_TIMER_COUNT1_VALUE_GET(x) (((x) & SOC_LF_TIMER_COUNT1_VALUE_MASK) >> SOC_LF_TIMER_COUNT1_VALUE_LSB) -#define SOC_LF_TIMER_COUNT1_VALUE_SET(x) (((x) << SOC_LF_TIMER_COUNT1_VALUE_LSB) & SOC_LF_TIMER_COUNT1_VALUE_MASK) - -#define SOC_LF_TIMER_CONTROL1_ADDRESS 0x00000060 -#define SOC_LF_TIMER_CONTROL1_OFFSET 0x00000060 -#define SOC_LF_TIMER_CONTROL1_ENABLE_MSB 2 -#define SOC_LF_TIMER_CONTROL1_ENABLE_LSB 2 -#define SOC_LF_TIMER_CONTROL1_ENABLE_MASK 0x00000004 -#define SOC_LF_TIMER_CONTROL1_ENABLE_GET(x) (((x) & SOC_LF_TIMER_CONTROL1_ENABLE_MASK) >> SOC_LF_TIMER_CONTROL1_ENABLE_LSB) -#define SOC_LF_TIMER_CONTROL1_ENABLE_SET(x) (((x) << SOC_LF_TIMER_CONTROL1_ENABLE_LSB) & SOC_LF_TIMER_CONTROL1_ENABLE_MASK) -#define SOC_LF_TIMER_CONTROL1_AUTO_RESTART_MSB 1 -#define SOC_LF_TIMER_CONTROL1_AUTO_RESTART_LSB 1 -#define SOC_LF_TIMER_CONTROL1_AUTO_RESTART_MASK 0x00000002 -#define SOC_LF_TIMER_CONTROL1_AUTO_RESTART_GET(x) (((x) & SOC_LF_TIMER_CONTROL1_AUTO_RESTART_MASK) >> SOC_LF_TIMER_CONTROL1_AUTO_RESTART_LSB) -#define SOC_LF_TIMER_CONTROL1_AUTO_RESTART_SET(x) (((x) << SOC_LF_TIMER_CONTROL1_AUTO_RESTART_LSB) & SOC_LF_TIMER_CONTROL1_AUTO_RESTART_MASK) -#define SOC_LF_TIMER_CONTROL1_RESET_MSB 0 -#define SOC_LF_TIMER_CONTROL1_RESET_LSB 0 -#define SOC_LF_TIMER_CONTROL1_RESET_MASK 0x00000001 -#define SOC_LF_TIMER_CONTROL1_RESET_GET(x) (((x) & SOC_LF_TIMER_CONTROL1_RESET_MASK) >> SOC_LF_TIMER_CONTROL1_RESET_LSB) -#define SOC_LF_TIMER_CONTROL1_RESET_SET(x) (((x) << SOC_LF_TIMER_CONTROL1_RESET_LSB) & SOC_LF_TIMER_CONTROL1_RESET_MASK) - -#define SOC_LF_TIMER_STATUS1_ADDRESS 0x00000064 -#define SOC_LF_TIMER_STATUS1_OFFSET 0x00000064 -#define SOC_LF_TIMER_STATUS1_INTERRUPT_MSB 0 -#define SOC_LF_TIMER_STATUS1_INTERRUPT_LSB 0 -#define SOC_LF_TIMER_STATUS1_INTERRUPT_MASK 0x00000001 -#define SOC_LF_TIMER_STATUS1_INTERRUPT_GET(x) (((x) & SOC_LF_TIMER_STATUS1_INTERRUPT_MASK) >> SOC_LF_TIMER_STATUS1_INTERRUPT_LSB) -#define SOC_LF_TIMER_STATUS1_INTERRUPT_SET(x) (((x) << SOC_LF_TIMER_STATUS1_INTERRUPT_LSB) & SOC_LF_TIMER_STATUS1_INTERRUPT_MASK) - -#define SOC_LF_TIMER2_ADDRESS 0x00000068 -#define SOC_LF_TIMER2_OFFSET 0x00000068 -#define SOC_LF_TIMER2_TARGET_MSB 31 -#define SOC_LF_TIMER2_TARGET_LSB 0 -#define SOC_LF_TIMER2_TARGET_MASK 0xffffffff -#define SOC_LF_TIMER2_TARGET_GET(x) (((x) & SOC_LF_TIMER2_TARGET_MASK) >> SOC_LF_TIMER2_TARGET_LSB) -#define SOC_LF_TIMER2_TARGET_SET(x) (((x) << SOC_LF_TIMER2_TARGET_LSB) & SOC_LF_TIMER2_TARGET_MASK) - -#define SOC_LF_TIMER_COUNT2_ADDRESS 0x0000006c -#define SOC_LF_TIMER_COUNT2_OFFSET 0x0000006c -#define SOC_LF_TIMER_COUNT2_VALUE_MSB 31 -#define SOC_LF_TIMER_COUNT2_VALUE_LSB 0 -#define SOC_LF_TIMER_COUNT2_VALUE_MASK 0xffffffff -#define SOC_LF_TIMER_COUNT2_VALUE_GET(x) (((x) & SOC_LF_TIMER_COUNT2_VALUE_MASK) >> SOC_LF_TIMER_COUNT2_VALUE_LSB) -#define SOC_LF_TIMER_COUNT2_VALUE_SET(x) (((x) << SOC_LF_TIMER_COUNT2_VALUE_LSB) & SOC_LF_TIMER_COUNT2_VALUE_MASK) - -#define SOC_LF_TIMER_CONTROL2_ADDRESS 0x00000070 -#define SOC_LF_TIMER_CONTROL2_OFFSET 0x00000070 -#define SOC_LF_TIMER_CONTROL2_ENABLE_MSB 2 -#define SOC_LF_TIMER_CONTROL2_ENABLE_LSB 2 -#define SOC_LF_TIMER_CONTROL2_ENABLE_MASK 0x00000004 -#define SOC_LF_TIMER_CONTROL2_ENABLE_GET(x) (((x) & SOC_LF_TIMER_CONTROL2_ENABLE_MASK) >> SOC_LF_TIMER_CONTROL2_ENABLE_LSB) -#define SOC_LF_TIMER_CONTROL2_ENABLE_SET(x) (((x) << SOC_LF_TIMER_CONTROL2_ENABLE_LSB) & SOC_LF_TIMER_CONTROL2_ENABLE_MASK) -#define SOC_LF_TIMER_CONTROL2_AUTO_RESTART_MSB 1 -#define SOC_LF_TIMER_CONTROL2_AUTO_RESTART_LSB 1 -#define SOC_LF_TIMER_CONTROL2_AUTO_RESTART_MASK 0x00000002 -#define SOC_LF_TIMER_CONTROL2_AUTO_RESTART_GET(x) (((x) & SOC_LF_TIMER_CONTROL2_AUTO_RESTART_MASK) >> SOC_LF_TIMER_CONTROL2_AUTO_RESTART_LSB) -#define SOC_LF_TIMER_CONTROL2_AUTO_RESTART_SET(x) (((x) << SOC_LF_TIMER_CONTROL2_AUTO_RESTART_LSB) & SOC_LF_TIMER_CONTROL2_AUTO_RESTART_MASK) -#define SOC_LF_TIMER_CONTROL2_RESET_MSB 0 -#define SOC_LF_TIMER_CONTROL2_RESET_LSB 0 -#define SOC_LF_TIMER_CONTROL2_RESET_MASK 0x00000001 -#define SOC_LF_TIMER_CONTROL2_RESET_GET(x) (((x) & SOC_LF_TIMER_CONTROL2_RESET_MASK) >> SOC_LF_TIMER_CONTROL2_RESET_LSB) -#define SOC_LF_TIMER_CONTROL2_RESET_SET(x) (((x) << SOC_LF_TIMER_CONTROL2_RESET_LSB) & SOC_LF_TIMER_CONTROL2_RESET_MASK) - -#define SOC_LF_TIMER_STATUS2_ADDRESS 0x00000074 -#define SOC_LF_TIMER_STATUS2_OFFSET 0x00000074 -#define SOC_LF_TIMER_STATUS2_INTERRUPT_MSB 0 -#define SOC_LF_TIMER_STATUS2_INTERRUPT_LSB 0 -#define SOC_LF_TIMER_STATUS2_INTERRUPT_MASK 0x00000001 -#define SOC_LF_TIMER_STATUS2_INTERRUPT_GET(x) (((x) & SOC_LF_TIMER_STATUS2_INTERRUPT_MASK) >> SOC_LF_TIMER_STATUS2_INTERRUPT_LSB) -#define SOC_LF_TIMER_STATUS2_INTERRUPT_SET(x) (((x) << SOC_LF_TIMER_STATUS2_INTERRUPT_LSB) & SOC_LF_TIMER_STATUS2_INTERRUPT_MASK) - -#define SOC_LF_TIMER3_ADDRESS 0x00000078 -#define SOC_LF_TIMER3_OFFSET 0x00000078 -#define SOC_LF_TIMER3_TARGET_MSB 31 -#define SOC_LF_TIMER3_TARGET_LSB 0 -#define SOC_LF_TIMER3_TARGET_MASK 0xffffffff -#define SOC_LF_TIMER3_TARGET_GET(x) (((x) & SOC_LF_TIMER3_TARGET_MASK) >> SOC_LF_TIMER3_TARGET_LSB) -#define SOC_LF_TIMER3_TARGET_SET(x) (((x) << SOC_LF_TIMER3_TARGET_LSB) & SOC_LF_TIMER3_TARGET_MASK) - -#define SOC_LF_TIMER_COUNT3_ADDRESS 0x0000007c -#define SOC_LF_TIMER_COUNT3_OFFSET 0x0000007c -#define SOC_LF_TIMER_COUNT3_VALUE_MSB 31 -#define SOC_LF_TIMER_COUNT3_VALUE_LSB 0 -#define SOC_LF_TIMER_COUNT3_VALUE_MASK 0xffffffff -#define SOC_LF_TIMER_COUNT3_VALUE_GET(x) (((x) & SOC_LF_TIMER_COUNT3_VALUE_MASK) >> SOC_LF_TIMER_COUNT3_VALUE_LSB) -#define SOC_LF_TIMER_COUNT3_VALUE_SET(x) (((x) << SOC_LF_TIMER_COUNT3_VALUE_LSB) & SOC_LF_TIMER_COUNT3_VALUE_MASK) - -#define SOC_LF_TIMER_CONTROL3_ADDRESS 0x00000080 -#define SOC_LF_TIMER_CONTROL3_OFFSET 0x00000080 -#define SOC_LF_TIMER_CONTROL3_ENABLE_MSB 2 -#define SOC_LF_TIMER_CONTROL3_ENABLE_LSB 2 -#define SOC_LF_TIMER_CONTROL3_ENABLE_MASK 0x00000004 -#define SOC_LF_TIMER_CONTROL3_ENABLE_GET(x) (((x) & SOC_LF_TIMER_CONTROL3_ENABLE_MASK) >> SOC_LF_TIMER_CONTROL3_ENABLE_LSB) -#define SOC_LF_TIMER_CONTROL3_ENABLE_SET(x) (((x) << SOC_LF_TIMER_CONTROL3_ENABLE_LSB) & SOC_LF_TIMER_CONTROL3_ENABLE_MASK) -#define SOC_LF_TIMER_CONTROL3_AUTO_RESTART_MSB 1 -#define SOC_LF_TIMER_CONTROL3_AUTO_RESTART_LSB 1 -#define SOC_LF_TIMER_CONTROL3_AUTO_RESTART_MASK 0x00000002 -#define SOC_LF_TIMER_CONTROL3_AUTO_RESTART_GET(x) (((x) & SOC_LF_TIMER_CONTROL3_AUTO_RESTART_MASK) >> SOC_LF_TIMER_CONTROL3_AUTO_RESTART_LSB) -#define SOC_LF_TIMER_CONTROL3_AUTO_RESTART_SET(x) (((x) << SOC_LF_TIMER_CONTROL3_AUTO_RESTART_LSB) & SOC_LF_TIMER_CONTROL3_AUTO_RESTART_MASK) -#define SOC_LF_TIMER_CONTROL3_RESET_MSB 0 -#define SOC_LF_TIMER_CONTROL3_RESET_LSB 0 -#define SOC_LF_TIMER_CONTROL3_RESET_MASK 0x00000001 -#define SOC_LF_TIMER_CONTROL3_RESET_GET(x) (((x) & SOC_LF_TIMER_CONTROL3_RESET_MASK) >> SOC_LF_TIMER_CONTROL3_RESET_LSB) -#define SOC_LF_TIMER_CONTROL3_RESET_SET(x) (((x) << SOC_LF_TIMER_CONTROL3_RESET_LSB) & SOC_LF_TIMER_CONTROL3_RESET_MASK) - -#define SOC_LF_TIMER_STATUS3_ADDRESS 0x00000084 -#define SOC_LF_TIMER_STATUS3_OFFSET 0x00000084 -#define SOC_LF_TIMER_STATUS3_INTERRUPT_MSB 0 -#define SOC_LF_TIMER_STATUS3_INTERRUPT_LSB 0 -#define SOC_LF_TIMER_STATUS3_INTERRUPT_MASK 0x00000001 -#define SOC_LF_TIMER_STATUS3_INTERRUPT_GET(x) (((x) & SOC_LF_TIMER_STATUS3_INTERRUPT_MASK) >> SOC_LF_TIMER_STATUS3_INTERRUPT_LSB) -#define SOC_LF_TIMER_STATUS3_INTERRUPT_SET(x) (((x) << SOC_LF_TIMER_STATUS3_INTERRUPT_LSB) & SOC_LF_TIMER_STATUS3_INTERRUPT_MASK) - -#define SOC_HF_TIMER_ADDRESS 0x00000088 -#define SOC_HF_TIMER_OFFSET 0x00000088 -#define SOC_HF_TIMER_TARGET_MSB 31 -#define SOC_HF_TIMER_TARGET_LSB 12 -#define SOC_HF_TIMER_TARGET_MASK 0xfffff000 -#define SOC_HF_TIMER_TARGET_GET(x) (((x) & SOC_HF_TIMER_TARGET_MASK) >> SOC_HF_TIMER_TARGET_LSB) -#define SOC_HF_TIMER_TARGET_SET(x) (((x) << SOC_HF_TIMER_TARGET_LSB) & SOC_HF_TIMER_TARGET_MASK) - -#define SOC_HF_TIMER_COUNT_ADDRESS 0x0000008c -#define SOC_HF_TIMER_COUNT_OFFSET 0x0000008c -#define SOC_HF_TIMER_COUNT_VALUE_MSB 31 -#define SOC_HF_TIMER_COUNT_VALUE_LSB 12 -#define SOC_HF_TIMER_COUNT_VALUE_MASK 0xfffff000 -#define SOC_HF_TIMER_COUNT_VALUE_GET(x) (((x) & SOC_HF_TIMER_COUNT_VALUE_MASK) >> SOC_HF_TIMER_COUNT_VALUE_LSB) -#define SOC_HF_TIMER_COUNT_VALUE_SET(x) (((x) << SOC_HF_TIMER_COUNT_VALUE_LSB) & SOC_HF_TIMER_COUNT_VALUE_MASK) - -#define SOC_HF_LF_COUNT_ADDRESS 0x00000090 -#define SOC_HF_LF_COUNT_OFFSET 0x00000090 -#define SOC_HF_LF_COUNT_VALUE_MSB 31 -#define SOC_HF_LF_COUNT_VALUE_LSB 0 -#define SOC_HF_LF_COUNT_VALUE_MASK 0xffffffff -#define SOC_HF_LF_COUNT_VALUE_GET(x) (((x) & SOC_HF_LF_COUNT_VALUE_MASK) >> SOC_HF_LF_COUNT_VALUE_LSB) -#define SOC_HF_LF_COUNT_VALUE_SET(x) (((x) << SOC_HF_LF_COUNT_VALUE_LSB) & SOC_HF_LF_COUNT_VALUE_MASK) - -#define SOC_HF_TIMER_CONTROL_ADDRESS 0x00000094 -#define SOC_HF_TIMER_CONTROL_OFFSET 0x00000094 -#define SOC_HF_TIMER_CONTROL_ENABLE_MSB 3 -#define SOC_HF_TIMER_CONTROL_ENABLE_LSB 3 -#define SOC_HF_TIMER_CONTROL_ENABLE_MASK 0x00000008 -#define SOC_HF_TIMER_CONTROL_ENABLE_GET(x) (((x) & SOC_HF_TIMER_CONTROL_ENABLE_MASK) >> SOC_HF_TIMER_CONTROL_ENABLE_LSB) -#define SOC_HF_TIMER_CONTROL_ENABLE_SET(x) (((x) << SOC_HF_TIMER_CONTROL_ENABLE_LSB) & SOC_HF_TIMER_CONTROL_ENABLE_MASK) -#define SOC_HF_TIMER_CONTROL_ON_MSB 2 -#define SOC_HF_TIMER_CONTROL_ON_LSB 2 -#define SOC_HF_TIMER_CONTROL_ON_MASK 0x00000004 -#define SOC_HF_TIMER_CONTROL_ON_GET(x) (((x) & SOC_HF_TIMER_CONTROL_ON_MASK) >> SOC_HF_TIMER_CONTROL_ON_LSB) -#define SOC_HF_TIMER_CONTROL_ON_SET(x) (((x) << SOC_HF_TIMER_CONTROL_ON_LSB) & SOC_HF_TIMER_CONTROL_ON_MASK) -#define SOC_HF_TIMER_CONTROL_AUTO_RESTART_MSB 1 -#define SOC_HF_TIMER_CONTROL_AUTO_RESTART_LSB 1 -#define SOC_HF_TIMER_CONTROL_AUTO_RESTART_MASK 0x00000002 -#define SOC_HF_TIMER_CONTROL_AUTO_RESTART_GET(x) (((x) & SOC_HF_TIMER_CONTROL_AUTO_RESTART_MASK) >> SOC_HF_TIMER_CONTROL_AUTO_RESTART_LSB) -#define SOC_HF_TIMER_CONTROL_AUTO_RESTART_SET(x) (((x) << SOC_HF_TIMER_CONTROL_AUTO_RESTART_LSB) & SOC_HF_TIMER_CONTROL_AUTO_RESTART_MASK) -#define SOC_HF_TIMER_CONTROL_RESET_MSB 0 -#define SOC_HF_TIMER_CONTROL_RESET_LSB 0 -#define SOC_HF_TIMER_CONTROL_RESET_MASK 0x00000001 -#define SOC_HF_TIMER_CONTROL_RESET_GET(x) (((x) & SOC_HF_TIMER_CONTROL_RESET_MASK) >> SOC_HF_TIMER_CONTROL_RESET_LSB) -#define SOC_HF_TIMER_CONTROL_RESET_SET(x) (((x) << SOC_HF_TIMER_CONTROL_RESET_LSB) & SOC_HF_TIMER_CONTROL_RESET_MASK) - -#define SOC_HF_TIMER_STATUS_ADDRESS 0x00000098 -#define SOC_HF_TIMER_STATUS_OFFSET 0x00000098 -#define SOC_HF_TIMER_STATUS_INTERRUPT_MSB 0 -#define SOC_HF_TIMER_STATUS_INTERRUPT_LSB 0 -#define SOC_HF_TIMER_STATUS_INTERRUPT_MASK 0x00000001 -#define SOC_HF_TIMER_STATUS_INTERRUPT_GET(x) (((x) & SOC_HF_TIMER_STATUS_INTERRUPT_MASK) >> SOC_HF_TIMER_STATUS_INTERRUPT_LSB) -#define SOC_HF_TIMER_STATUS_INTERRUPT_SET(x) (((x) << SOC_HF_TIMER_STATUS_INTERRUPT_LSB) & SOC_HF_TIMER_STATUS_INTERRUPT_MASK) - -#define SOC_RTC_CONTROL_ADDRESS 0x0000009c -#define SOC_RTC_CONTROL_OFFSET 0x0000009c -#define SOC_RTC_CONTROL_ENABLE_MSB 2 -#define SOC_RTC_CONTROL_ENABLE_LSB 2 -#define SOC_RTC_CONTROL_ENABLE_MASK 0x00000004 -#define SOC_RTC_CONTROL_ENABLE_GET(x) (((x) & SOC_RTC_CONTROL_ENABLE_MASK) >> SOC_RTC_CONTROL_ENABLE_LSB) -#define SOC_RTC_CONTROL_ENABLE_SET(x) (((x) << SOC_RTC_CONTROL_ENABLE_LSB) & SOC_RTC_CONTROL_ENABLE_MASK) -#define SOC_RTC_CONTROL_LOAD_RTC_MSB 1 -#define SOC_RTC_CONTROL_LOAD_RTC_LSB 1 -#define SOC_RTC_CONTROL_LOAD_RTC_MASK 0x00000002 -#define SOC_RTC_CONTROL_LOAD_RTC_GET(x) (((x) & SOC_RTC_CONTROL_LOAD_RTC_MASK) >> SOC_RTC_CONTROL_LOAD_RTC_LSB) -#define SOC_RTC_CONTROL_LOAD_RTC_SET(x) (((x) << SOC_RTC_CONTROL_LOAD_RTC_LSB) & SOC_RTC_CONTROL_LOAD_RTC_MASK) -#define SOC_RTC_CONTROL_LOAD_ALARM_MSB 0 -#define SOC_RTC_CONTROL_LOAD_ALARM_LSB 0 -#define SOC_RTC_CONTROL_LOAD_ALARM_MASK 0x00000001 -#define SOC_RTC_CONTROL_LOAD_ALARM_GET(x) (((x) & SOC_RTC_CONTROL_LOAD_ALARM_MASK) >> SOC_RTC_CONTROL_LOAD_ALARM_LSB) -#define SOC_RTC_CONTROL_LOAD_ALARM_SET(x) (((x) << SOC_RTC_CONTROL_LOAD_ALARM_LSB) & SOC_RTC_CONTROL_LOAD_ALARM_MASK) - -#define SOC_RTC_TIME_ADDRESS 0x000000a0 -#define SOC_RTC_TIME_OFFSET 0x000000a0 -#define SOC_RTC_TIME_WEEK_DAY_MSB 26 -#define SOC_RTC_TIME_WEEK_DAY_LSB 24 -#define SOC_RTC_TIME_WEEK_DAY_MASK 0x07000000 -#define SOC_RTC_TIME_WEEK_DAY_GET(x) (((x) & SOC_RTC_TIME_WEEK_DAY_MASK) >> SOC_RTC_TIME_WEEK_DAY_LSB) -#define SOC_RTC_TIME_WEEK_DAY_SET(x) (((x) << SOC_RTC_TIME_WEEK_DAY_LSB) & SOC_RTC_TIME_WEEK_DAY_MASK) -#define SOC_RTC_TIME_HOUR_MSB 21 -#define SOC_RTC_TIME_HOUR_LSB 16 -#define SOC_RTC_TIME_HOUR_MASK 0x003f0000 -#define SOC_RTC_TIME_HOUR_GET(x) (((x) & SOC_RTC_TIME_HOUR_MASK) >> SOC_RTC_TIME_HOUR_LSB) -#define SOC_RTC_TIME_HOUR_SET(x) (((x) << SOC_RTC_TIME_HOUR_LSB) & SOC_RTC_TIME_HOUR_MASK) -#define SOC_RTC_TIME_MINUTE_MSB 14 -#define SOC_RTC_TIME_MINUTE_LSB 8 -#define SOC_RTC_TIME_MINUTE_MASK 0x00007f00 -#define SOC_RTC_TIME_MINUTE_GET(x) (((x) & SOC_RTC_TIME_MINUTE_MASK) >> SOC_RTC_TIME_MINUTE_LSB) -#define SOC_RTC_TIME_MINUTE_SET(x) (((x) << SOC_RTC_TIME_MINUTE_LSB) & SOC_RTC_TIME_MINUTE_MASK) -#define SOC_RTC_TIME_SECOND_MSB 6 -#define SOC_RTC_TIME_SECOND_LSB 0 -#define SOC_RTC_TIME_SECOND_MASK 0x0000007f -#define SOC_RTC_TIME_SECOND_GET(x) (((x) & SOC_RTC_TIME_SECOND_MASK) >> SOC_RTC_TIME_SECOND_LSB) -#define SOC_RTC_TIME_SECOND_SET(x) (((x) << SOC_RTC_TIME_SECOND_LSB) & SOC_RTC_TIME_SECOND_MASK) - -#define SOC_RTC_DATE_ADDRESS 0x000000a4 -#define SOC_RTC_DATE_OFFSET 0x000000a4 -#define SOC_RTC_DATE_YEAR_MSB 23 -#define SOC_RTC_DATE_YEAR_LSB 16 -#define SOC_RTC_DATE_YEAR_MASK 0x00ff0000 -#define SOC_RTC_DATE_YEAR_GET(x) (((x) & SOC_RTC_DATE_YEAR_MASK) >> SOC_RTC_DATE_YEAR_LSB) -#define SOC_RTC_DATE_YEAR_SET(x) (((x) << SOC_RTC_DATE_YEAR_LSB) & SOC_RTC_DATE_YEAR_MASK) -#define SOC_RTC_DATE_MONTH_MSB 12 -#define SOC_RTC_DATE_MONTH_LSB 8 -#define SOC_RTC_DATE_MONTH_MASK 0x00001f00 -#define SOC_RTC_DATE_MONTH_GET(x) (((x) & SOC_RTC_DATE_MONTH_MASK) >> SOC_RTC_DATE_MONTH_LSB) -#define SOC_RTC_DATE_MONTH_SET(x) (((x) << SOC_RTC_DATE_MONTH_LSB) & SOC_RTC_DATE_MONTH_MASK) -#define SOC_RTC_DATE_MONTH_DAY_MSB 5 -#define SOC_RTC_DATE_MONTH_DAY_LSB 0 -#define SOC_RTC_DATE_MONTH_DAY_MASK 0x0000003f -#define SOC_RTC_DATE_MONTH_DAY_GET(x) (((x) & SOC_RTC_DATE_MONTH_DAY_MASK) >> SOC_RTC_DATE_MONTH_DAY_LSB) -#define SOC_RTC_DATE_MONTH_DAY_SET(x) (((x) << SOC_RTC_DATE_MONTH_DAY_LSB) & SOC_RTC_DATE_MONTH_DAY_MASK) - -#define SOC_RTC_SET_TIME_ADDRESS 0x000000a8 -#define SOC_RTC_SET_TIME_OFFSET 0x000000a8 -#define SOC_RTC_SET_TIME_WEEK_DAY_MSB 26 -#define SOC_RTC_SET_TIME_WEEK_DAY_LSB 24 -#define SOC_RTC_SET_TIME_WEEK_DAY_MASK 0x07000000 -#define SOC_RTC_SET_TIME_WEEK_DAY_GET(x) (((x) & SOC_RTC_SET_TIME_WEEK_DAY_MASK) >> SOC_RTC_SET_TIME_WEEK_DAY_LSB) -#define SOC_RTC_SET_TIME_WEEK_DAY_SET(x) (((x) << SOC_RTC_SET_TIME_WEEK_DAY_LSB) & SOC_RTC_SET_TIME_WEEK_DAY_MASK) -#define SOC_RTC_SET_TIME_HOUR_MSB 21 -#define SOC_RTC_SET_TIME_HOUR_LSB 16 -#define SOC_RTC_SET_TIME_HOUR_MASK 0x003f0000 -#define SOC_RTC_SET_TIME_HOUR_GET(x) (((x) & SOC_RTC_SET_TIME_HOUR_MASK) >> SOC_RTC_SET_TIME_HOUR_LSB) -#define SOC_RTC_SET_TIME_HOUR_SET(x) (((x) << SOC_RTC_SET_TIME_HOUR_LSB) & SOC_RTC_SET_TIME_HOUR_MASK) -#define SOC_RTC_SET_TIME_MINUTE_MSB 14 -#define SOC_RTC_SET_TIME_MINUTE_LSB 8 -#define SOC_RTC_SET_TIME_MINUTE_MASK 0x00007f00 -#define SOC_RTC_SET_TIME_MINUTE_GET(x) (((x) & SOC_RTC_SET_TIME_MINUTE_MASK) >> SOC_RTC_SET_TIME_MINUTE_LSB) -#define SOC_RTC_SET_TIME_MINUTE_SET(x) (((x) << SOC_RTC_SET_TIME_MINUTE_LSB) & SOC_RTC_SET_TIME_MINUTE_MASK) -#define SOC_RTC_SET_TIME_SECOND_MSB 6 -#define SOC_RTC_SET_TIME_SECOND_LSB 0 -#define SOC_RTC_SET_TIME_SECOND_MASK 0x0000007f -#define SOC_RTC_SET_TIME_SECOND_GET(x) (((x) & SOC_RTC_SET_TIME_SECOND_MASK) >> SOC_RTC_SET_TIME_SECOND_LSB) -#define SOC_RTC_SET_TIME_SECOND_SET(x) (((x) << SOC_RTC_SET_TIME_SECOND_LSB) & SOC_RTC_SET_TIME_SECOND_MASK) - -#define SOC_RTC_SET_DATE_ADDRESS 0x000000ac -#define SOC_RTC_SET_DATE_OFFSET 0x000000ac -#define SOC_RTC_SET_DATE_YEAR_MSB 23 -#define SOC_RTC_SET_DATE_YEAR_LSB 16 -#define SOC_RTC_SET_DATE_YEAR_MASK 0x00ff0000 -#define SOC_RTC_SET_DATE_YEAR_GET(x) (((x) & SOC_RTC_SET_DATE_YEAR_MASK) >> SOC_RTC_SET_DATE_YEAR_LSB) -#define SOC_RTC_SET_DATE_YEAR_SET(x) (((x) << SOC_RTC_SET_DATE_YEAR_LSB) & SOC_RTC_SET_DATE_YEAR_MASK) -#define SOC_RTC_SET_DATE_MONTH_MSB 12 -#define SOC_RTC_SET_DATE_MONTH_LSB 8 -#define SOC_RTC_SET_DATE_MONTH_MASK 0x00001f00 -#define SOC_RTC_SET_DATE_MONTH_GET(x) (((x) & SOC_RTC_SET_DATE_MONTH_MASK) >> SOC_RTC_SET_DATE_MONTH_LSB) -#define SOC_RTC_SET_DATE_MONTH_SET(x) (((x) << SOC_RTC_SET_DATE_MONTH_LSB) & SOC_RTC_SET_DATE_MONTH_MASK) -#define SOC_RTC_SET_DATE_MONTH_DAY_MSB 5 -#define SOC_RTC_SET_DATE_MONTH_DAY_LSB 0 -#define SOC_RTC_SET_DATE_MONTH_DAY_MASK 0x0000003f -#define SOC_RTC_SET_DATE_MONTH_DAY_GET(x) (((x) & SOC_RTC_SET_DATE_MONTH_DAY_MASK) >> SOC_RTC_SET_DATE_MONTH_DAY_LSB) -#define SOC_RTC_SET_DATE_MONTH_DAY_SET(x) (((x) << SOC_RTC_SET_DATE_MONTH_DAY_LSB) & SOC_RTC_SET_DATE_MONTH_DAY_MASK) - -#define SOC_RTC_SET_ALARM_ADDRESS 0x000000b0 -#define SOC_RTC_SET_ALARM_OFFSET 0x000000b0 -#define SOC_RTC_SET_ALARM_HOUR_MSB 21 -#define SOC_RTC_SET_ALARM_HOUR_LSB 16 -#define SOC_RTC_SET_ALARM_HOUR_MASK 0x003f0000 -#define SOC_RTC_SET_ALARM_HOUR_GET(x) (((x) & SOC_RTC_SET_ALARM_HOUR_MASK) >> SOC_RTC_SET_ALARM_HOUR_LSB) -#define SOC_RTC_SET_ALARM_HOUR_SET(x) (((x) << SOC_RTC_SET_ALARM_HOUR_LSB) & SOC_RTC_SET_ALARM_HOUR_MASK) -#define SOC_RTC_SET_ALARM_MINUTE_MSB 14 -#define SOC_RTC_SET_ALARM_MINUTE_LSB 8 -#define SOC_RTC_SET_ALARM_MINUTE_MASK 0x00007f00 -#define SOC_RTC_SET_ALARM_MINUTE_GET(x) (((x) & SOC_RTC_SET_ALARM_MINUTE_MASK) >> SOC_RTC_SET_ALARM_MINUTE_LSB) -#define SOC_RTC_SET_ALARM_MINUTE_SET(x) (((x) << SOC_RTC_SET_ALARM_MINUTE_LSB) & SOC_RTC_SET_ALARM_MINUTE_MASK) -#define SOC_RTC_SET_ALARM_SECOND_MSB 6 -#define SOC_RTC_SET_ALARM_SECOND_LSB 0 -#define SOC_RTC_SET_ALARM_SECOND_MASK 0x0000007f -#define SOC_RTC_SET_ALARM_SECOND_GET(x) (((x) & SOC_RTC_SET_ALARM_SECOND_MASK) >> SOC_RTC_SET_ALARM_SECOND_LSB) -#define SOC_RTC_SET_ALARM_SECOND_SET(x) (((x) << SOC_RTC_SET_ALARM_SECOND_LSB) & SOC_RTC_SET_ALARM_SECOND_MASK) - -#define SOC_RTC_CONFIG_ADDRESS 0x000000b4 -#define SOC_RTC_CONFIG_OFFSET 0x000000b4 -#define SOC_RTC_CONFIG_BCD_MSB 2 -#define SOC_RTC_CONFIG_BCD_LSB 2 -#define SOC_RTC_CONFIG_BCD_MASK 0x00000004 -#define SOC_RTC_CONFIG_BCD_GET(x) (((x) & SOC_RTC_CONFIG_BCD_MASK) >> SOC_RTC_CONFIG_BCD_LSB) -#define SOC_RTC_CONFIG_BCD_SET(x) (((x) << SOC_RTC_CONFIG_BCD_LSB) & SOC_RTC_CONFIG_BCD_MASK) -#define SOC_RTC_CONFIG_TWELVE_HOUR_MSB 1 -#define SOC_RTC_CONFIG_TWELVE_HOUR_LSB 1 -#define SOC_RTC_CONFIG_TWELVE_HOUR_MASK 0x00000002 -#define SOC_RTC_CONFIG_TWELVE_HOUR_GET(x) (((x) & SOC_RTC_CONFIG_TWELVE_HOUR_MASK) >> SOC_RTC_CONFIG_TWELVE_HOUR_LSB) -#define SOC_RTC_CONFIG_TWELVE_HOUR_SET(x) (((x) << SOC_RTC_CONFIG_TWELVE_HOUR_LSB) & SOC_RTC_CONFIG_TWELVE_HOUR_MASK) -#define SOC_RTC_CONFIG_DSE_MSB 0 -#define SOC_RTC_CONFIG_DSE_LSB 0 -#define SOC_RTC_CONFIG_DSE_MASK 0x00000001 -#define SOC_RTC_CONFIG_DSE_GET(x) (((x) & SOC_RTC_CONFIG_DSE_MASK) >> SOC_RTC_CONFIG_DSE_LSB) -#define SOC_RTC_CONFIG_DSE_SET(x) (((x) << SOC_RTC_CONFIG_DSE_LSB) & SOC_RTC_CONFIG_DSE_MASK) - -#define SOC_RTC_ALARM_STATUS_ADDRESS 0x000000b8 -#define SOC_RTC_ALARM_STATUS_OFFSET 0x000000b8 -#define SOC_RTC_ALARM_STATUS_ENABLE_MSB 1 -#define SOC_RTC_ALARM_STATUS_ENABLE_LSB 1 -#define SOC_RTC_ALARM_STATUS_ENABLE_MASK 0x00000002 -#define SOC_RTC_ALARM_STATUS_ENABLE_GET(x) (((x) & SOC_RTC_ALARM_STATUS_ENABLE_MASK) >> SOC_RTC_ALARM_STATUS_ENABLE_LSB) -#define SOC_RTC_ALARM_STATUS_ENABLE_SET(x) (((x) << SOC_RTC_ALARM_STATUS_ENABLE_LSB) & SOC_RTC_ALARM_STATUS_ENABLE_MASK) -#define SOC_RTC_ALARM_STATUS_INTERRUPT_MSB 0 -#define SOC_RTC_ALARM_STATUS_INTERRUPT_LSB 0 -#define SOC_RTC_ALARM_STATUS_INTERRUPT_MASK 0x00000001 -#define SOC_RTC_ALARM_STATUS_INTERRUPT_GET(x) (((x) & SOC_RTC_ALARM_STATUS_INTERRUPT_MASK) >> SOC_RTC_ALARM_STATUS_INTERRUPT_LSB) -#define SOC_RTC_ALARM_STATUS_INTERRUPT_SET(x) (((x) << SOC_RTC_ALARM_STATUS_INTERRUPT_LSB) & SOC_RTC_ALARM_STATUS_INTERRUPT_MASK) - -#define SOC_UART_WAKEUP_ADDRESS 0x000000bc -#define SOC_UART_WAKEUP_OFFSET 0x000000bc -#define SOC_UART_WAKEUP_ENABLE_MSB 0 -#define SOC_UART_WAKEUP_ENABLE_LSB 0 -#define SOC_UART_WAKEUP_ENABLE_MASK 0x00000001 -#define SOC_UART_WAKEUP_ENABLE_GET(x) (((x) & SOC_UART_WAKEUP_ENABLE_MASK) >> SOC_UART_WAKEUP_ENABLE_LSB) -#define SOC_UART_WAKEUP_ENABLE_SET(x) (((x) << SOC_UART_WAKEUP_ENABLE_LSB) & SOC_UART_WAKEUP_ENABLE_MASK) - -#define SOC_RESET_CAUSE_ADDRESS 0x000000c0 -#define SOC_RESET_CAUSE_OFFSET 0x000000c0 -#define SOC_RESET_CAUSE_LAST_MSB 2 -#define SOC_RESET_CAUSE_LAST_LSB 0 -#define SOC_RESET_CAUSE_LAST_MASK 0x00000007 -#define SOC_RESET_CAUSE_LAST_GET(x) (((x) & SOC_RESET_CAUSE_LAST_MASK) >> SOC_RESET_CAUSE_LAST_LSB) -#define SOC_RESET_CAUSE_LAST_SET(x) (((x) << SOC_RESET_CAUSE_LAST_LSB) & SOC_RESET_CAUSE_LAST_MASK) - -#define SOC_SYSTEM_SLEEP_ADDRESS 0x000000c4 -#define SOC_SYSTEM_SLEEP_OFFSET 0x000000c4 -#define SOC_SYSTEM_SLEEP_MCI_MSB 5 -#define SOC_SYSTEM_SLEEP_MCI_LSB 5 -#define SOC_SYSTEM_SLEEP_MCI_MASK 0x00000020 -#define SOC_SYSTEM_SLEEP_MCI_GET(x) (((x) & SOC_SYSTEM_SLEEP_MCI_MASK) >> SOC_SYSTEM_SLEEP_MCI_LSB) -#define SOC_SYSTEM_SLEEP_MCI_SET(x) (((x) << SOC_SYSTEM_SLEEP_MCI_LSB) & SOC_SYSTEM_SLEEP_MCI_MASK) -#define SOC_SYSTEM_SLEEP_HOST_IF_MSB 4 -#define SOC_SYSTEM_SLEEP_HOST_IF_LSB 4 -#define SOC_SYSTEM_SLEEP_HOST_IF_MASK 0x00000010 -#define SOC_SYSTEM_SLEEP_HOST_IF_GET(x) (((x) & SOC_SYSTEM_SLEEP_HOST_IF_MASK) >> SOC_SYSTEM_SLEEP_HOST_IF_LSB) -#define SOC_SYSTEM_SLEEP_HOST_IF_SET(x) (((x) << SOC_SYSTEM_SLEEP_HOST_IF_LSB) & SOC_SYSTEM_SLEEP_HOST_IF_MASK) -#define SOC_SYSTEM_SLEEP_MBOX_MSB 3 -#define SOC_SYSTEM_SLEEP_MBOX_LSB 3 -#define SOC_SYSTEM_SLEEP_MBOX_MASK 0x00000008 -#define SOC_SYSTEM_SLEEP_MBOX_GET(x) (((x) & SOC_SYSTEM_SLEEP_MBOX_MASK) >> SOC_SYSTEM_SLEEP_MBOX_LSB) -#define SOC_SYSTEM_SLEEP_MBOX_SET(x) (((x) << SOC_SYSTEM_SLEEP_MBOX_LSB) & SOC_SYSTEM_SLEEP_MBOX_MASK) -#define SOC_SYSTEM_SLEEP_MAC_IF_MSB 2 -#define SOC_SYSTEM_SLEEP_MAC_IF_LSB 2 -#define SOC_SYSTEM_SLEEP_MAC_IF_MASK 0x00000004 -#define SOC_SYSTEM_SLEEP_MAC_IF_GET(x) (((x) & SOC_SYSTEM_SLEEP_MAC_IF_MASK) >> SOC_SYSTEM_SLEEP_MAC_IF_LSB) -#define SOC_SYSTEM_SLEEP_MAC_IF_SET(x) (((x) << SOC_SYSTEM_SLEEP_MAC_IF_LSB) & SOC_SYSTEM_SLEEP_MAC_IF_MASK) -#define SOC_SYSTEM_SLEEP_LIGHT_MSB 1 -#define SOC_SYSTEM_SLEEP_LIGHT_LSB 1 -#define SOC_SYSTEM_SLEEP_LIGHT_MASK 0x00000002 -#define SOC_SYSTEM_SLEEP_LIGHT_GET(x) (((x) & SOC_SYSTEM_SLEEP_LIGHT_MASK) >> SOC_SYSTEM_SLEEP_LIGHT_LSB) -#define SOC_SYSTEM_SLEEP_LIGHT_SET(x) (((x) << SOC_SYSTEM_SLEEP_LIGHT_LSB) & SOC_SYSTEM_SLEEP_LIGHT_MASK) -#define SOC_SYSTEM_SLEEP_DISABLE_MSB 0 -#define SOC_SYSTEM_SLEEP_DISABLE_LSB 0 -#define SOC_SYSTEM_SLEEP_DISABLE_MASK 0x00000001 -#define SOC_SYSTEM_SLEEP_DISABLE_GET(x) (((x) & SOC_SYSTEM_SLEEP_DISABLE_MASK) >> SOC_SYSTEM_SLEEP_DISABLE_LSB) -#define SOC_SYSTEM_SLEEP_DISABLE_SET(x) (((x) << SOC_SYSTEM_SLEEP_DISABLE_LSB) & SOC_SYSTEM_SLEEP_DISABLE_MASK) - -#define SOC_SDIO_WRAPPER_ADDRESS 0x000000c8 -#define SOC_SDIO_WRAPPER_OFFSET 0x000000c8 -#define SOC_SDIO_WRAPPER_SLEEP_MSB 3 -#define SOC_SDIO_WRAPPER_SLEEP_LSB 3 -#define SOC_SDIO_WRAPPER_SLEEP_MASK 0x00000008 -#define SOC_SDIO_WRAPPER_SLEEP_GET(x) (((x) & SOC_SDIO_WRAPPER_SLEEP_MASK) >> SOC_SDIO_WRAPPER_SLEEP_LSB) -#define SOC_SDIO_WRAPPER_SLEEP_SET(x) (((x) << SOC_SDIO_WRAPPER_SLEEP_LSB) & SOC_SDIO_WRAPPER_SLEEP_MASK) -#define SOC_SDIO_WRAPPER_WAKEUP_MSB 2 -#define SOC_SDIO_WRAPPER_WAKEUP_LSB 2 -#define SOC_SDIO_WRAPPER_WAKEUP_MASK 0x00000004 -#define SOC_SDIO_WRAPPER_WAKEUP_GET(x) (((x) & SOC_SDIO_WRAPPER_WAKEUP_MASK) >> SOC_SDIO_WRAPPER_WAKEUP_LSB) -#define SOC_SDIO_WRAPPER_WAKEUP_SET(x) (((x) << SOC_SDIO_WRAPPER_WAKEUP_LSB) & SOC_SDIO_WRAPPER_WAKEUP_MASK) -#define SOC_SDIO_WRAPPER_SOC_ON_MSB 1 -#define SOC_SDIO_WRAPPER_SOC_ON_LSB 1 -#define SOC_SDIO_WRAPPER_SOC_ON_MASK 0x00000002 -#define SOC_SDIO_WRAPPER_SOC_ON_GET(x) (((x) & SOC_SDIO_WRAPPER_SOC_ON_MASK) >> SOC_SDIO_WRAPPER_SOC_ON_LSB) -#define SOC_SDIO_WRAPPER_SOC_ON_SET(x) (((x) << SOC_SDIO_WRAPPER_SOC_ON_LSB) & SOC_SDIO_WRAPPER_SOC_ON_MASK) -#define SOC_SDIO_WRAPPER_ON_MSB 0 -#define SOC_SDIO_WRAPPER_ON_LSB 0 -#define SOC_SDIO_WRAPPER_ON_MASK 0x00000001 -#define SOC_SDIO_WRAPPER_ON_GET(x) (((x) & SOC_SDIO_WRAPPER_ON_MASK) >> SOC_SDIO_WRAPPER_ON_LSB) -#define SOC_SDIO_WRAPPER_ON_SET(x) (((x) << SOC_SDIO_WRAPPER_ON_LSB) & SOC_SDIO_WRAPPER_ON_MASK) - -#define SOC_INT_STATUS1_ADDRESS 0x000000cc -#define SOC_INT_STATUS1_OFFSET 0x000000cc -#define SOC_INT_STATUS1_I2S_1_MSB 9 -#define SOC_INT_STATUS1_I2S_1_LSB 9 -#define SOC_INT_STATUS1_I2S_1_MASK 0x00000200 -#define SOC_INT_STATUS1_I2S_1_GET(x) (((x) & SOC_INT_STATUS1_I2S_1_MASK) >> SOC_INT_STATUS1_I2S_1_LSB) -#define SOC_INT_STATUS1_I2S_1_SET(x) (((x) << SOC_INT_STATUS1_I2S_1_LSB) & SOC_INT_STATUS1_I2S_1_MASK) -#define SOC_INT_STATUS1_I2S_MSB 8 -#define SOC_INT_STATUS1_I2S_LSB 8 -#define SOC_INT_STATUS1_I2S_MASK 0x00000100 -#define SOC_INT_STATUS1_I2S_GET(x) (((x) & SOC_INT_STATUS1_I2S_MASK) >> SOC_INT_STATUS1_I2S_LSB) -#define SOC_INT_STATUS1_I2S_SET(x) (((x) << SOC_INT_STATUS1_I2S_LSB) & SOC_INT_STATUS1_I2S_MASK) -#define SOC_INT_STATUS1_MDIO_MSB 7 -#define SOC_INT_STATUS1_MDIO_LSB 7 -#define SOC_INT_STATUS1_MDIO_MASK 0x00000080 -#define SOC_INT_STATUS1_MDIO_GET(x) (((x) & SOC_INT_STATUS1_MDIO_MASK) >> SOC_INT_STATUS1_MDIO_LSB) -#define SOC_INT_STATUS1_MDIO_SET(x) (((x) << SOC_INT_STATUS1_MDIO_LSB) & SOC_INT_STATUS1_MDIO_MASK) -#define SOC_INT_STATUS1_GMAC_MSB 6 -#define SOC_INT_STATUS1_GMAC_LSB 6 -#define SOC_INT_STATUS1_GMAC_MASK 0x00000040 -#define SOC_INT_STATUS1_GMAC_GET(x) (((x) & SOC_INT_STATUS1_GMAC_MASK) >> SOC_INT_STATUS1_GMAC_LSB) -#define SOC_INT_STATUS1_GMAC_SET(x) (((x) << SOC_INT_STATUS1_GMAC_LSB) & SOC_INT_STATUS1_GMAC_MASK) -#define SOC_INT_STATUS1_I2C_S_MSB 5 -#define SOC_INT_STATUS1_I2C_S_LSB 5 -#define SOC_INT_STATUS1_I2C_S_MASK 0x00000020 -#define SOC_INT_STATUS1_I2C_S_GET(x) (((x) & SOC_INT_STATUS1_I2C_S_MASK) >> SOC_INT_STATUS1_I2C_S_LSB) -#define SOC_INT_STATUS1_I2C_S_SET(x) (((x) << SOC_INT_STATUS1_I2C_S_LSB) & SOC_INT_STATUS1_I2C_S_MASK) -#define SOC_INT_STATUS1_CKSUM_MSB 4 -#define SOC_INT_STATUS1_CKSUM_LSB 4 -#define SOC_INT_STATUS1_CKSUM_MASK 0x00000010 -#define SOC_INT_STATUS1_CKSUM_GET(x) (((x) & SOC_INT_STATUS1_CKSUM_MASK) >> SOC_INT_STATUS1_CKSUM_LSB) -#define SOC_INT_STATUS1_CKSUM_SET(x) (((x) << SOC_INT_STATUS1_CKSUM_LSB) & SOC_INT_STATUS1_CKSUM_MASK) -#define SOC_INT_STATUS1_MAC_4_MSB 3 -#define SOC_INT_STATUS1_MAC_4_LSB 3 -#define SOC_INT_STATUS1_MAC_4_MASK 0x00000008 -#define SOC_INT_STATUS1_MAC_4_GET(x) (((x) & SOC_INT_STATUS1_MAC_4_MASK) >> SOC_INT_STATUS1_MAC_4_LSB) -#define SOC_INT_STATUS1_MAC_4_SET(x) (((x) << SOC_INT_STATUS1_MAC_4_LSB) & SOC_INT_STATUS1_MAC_4_MASK) -#define SOC_INT_STATUS1_MAC_3_MSB 2 -#define SOC_INT_STATUS1_MAC_3_LSB 2 -#define SOC_INT_STATUS1_MAC_3_MASK 0x00000004 -#define SOC_INT_STATUS1_MAC_3_GET(x) (((x) & SOC_INT_STATUS1_MAC_3_MASK) >> SOC_INT_STATUS1_MAC_3_LSB) -#define SOC_INT_STATUS1_MAC_3_SET(x) (((x) << SOC_INT_STATUS1_MAC_3_LSB) & SOC_INT_STATUS1_MAC_3_MASK) -#define SOC_INT_STATUS1_MAC_2_MSB 1 -#define SOC_INT_STATUS1_MAC_2_LSB 1 -#define SOC_INT_STATUS1_MAC_2_MASK 0x00000002 -#define SOC_INT_STATUS1_MAC_2_GET(x) (((x) & SOC_INT_STATUS1_MAC_2_MASK) >> SOC_INT_STATUS1_MAC_2_LSB) -#define SOC_INT_STATUS1_MAC_2_SET(x) (((x) << SOC_INT_STATUS1_MAC_2_LSB) & SOC_INT_STATUS1_MAC_2_MASK) -#define SOC_INT_STATUS1_MAC_1_MSB 0 -#define SOC_INT_STATUS1_MAC_1_LSB 0 -#define SOC_INT_STATUS1_MAC_1_MASK 0x00000001 -#define SOC_INT_STATUS1_MAC_1_GET(x) (((x) & SOC_INT_STATUS1_MAC_1_MASK) >> SOC_INT_STATUS1_MAC_1_LSB) -#define SOC_INT_STATUS1_MAC_1_SET(x) (((x) << SOC_INT_STATUS1_MAC_1_LSB) & SOC_INT_STATUS1_MAC_1_MASK) - -#define SOC_LPO_CAL_TIME_ADDRESS 0x000000d4 -#define SOC_LPO_CAL_TIME_OFFSET 0x000000d4 -#define SOC_LPO_CAL_TIME_LENGTH_MSB 13 -#define SOC_LPO_CAL_TIME_LENGTH_LSB 0 -#define SOC_LPO_CAL_TIME_LENGTH_MASK 0x00003fff -#define SOC_LPO_CAL_TIME_LENGTH_GET(x) (((x) & SOC_LPO_CAL_TIME_LENGTH_MASK) >> SOC_LPO_CAL_TIME_LENGTH_LSB) -#define SOC_LPO_CAL_TIME_LENGTH_SET(x) (((x) << SOC_LPO_CAL_TIME_LENGTH_LSB) & SOC_LPO_CAL_TIME_LENGTH_MASK) - -#define SOC_LPO_INIT_DIVIDEND_INT_ADDRESS 0x000000d8 -#define SOC_LPO_INIT_DIVIDEND_INT_OFFSET 0x000000d8 -#define SOC_LPO_INIT_DIVIDEND_INT_VALUE_MSB 23 -#define SOC_LPO_INIT_DIVIDEND_INT_VALUE_LSB 0 -#define SOC_LPO_INIT_DIVIDEND_INT_VALUE_MASK 0x00ffffff -#define SOC_LPO_INIT_DIVIDEND_INT_VALUE_GET(x) (((x) & SOC_LPO_INIT_DIVIDEND_INT_VALUE_MASK) >> SOC_LPO_INIT_DIVIDEND_INT_VALUE_LSB) -#define SOC_LPO_INIT_DIVIDEND_INT_VALUE_SET(x) (((x) << SOC_LPO_INIT_DIVIDEND_INT_VALUE_LSB) & SOC_LPO_INIT_DIVIDEND_INT_VALUE_MASK) - -#define SOC_LPO_INIT_DIVIDEND_FRACTION_ADDRESS 0x000000dc -#define SOC_LPO_INIT_DIVIDEND_FRACTION_OFFSET 0x000000dc -#define SOC_LPO_INIT_DIVIDEND_FRACTION_VALUE_MSB 10 -#define SOC_LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB 0 -#define SOC_LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK 0x000007ff -#define SOC_LPO_INIT_DIVIDEND_FRACTION_VALUE_GET(x) (((x) & SOC_LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK) >> SOC_LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB) -#define SOC_LPO_INIT_DIVIDEND_FRACTION_VALUE_SET(x) (((x) << SOC_LPO_INIT_DIVIDEND_FRACTION_VALUE_LSB) & SOC_LPO_INIT_DIVIDEND_FRACTION_VALUE_MASK) - -#define SOC_LPO_CAL_ADDRESS 0x000000e0 -#define SOC_LPO_CAL_OFFSET 0x000000e0 -#define SOC_LPO_CAL_ENABLE_MSB 20 -#define SOC_LPO_CAL_ENABLE_LSB 20 -#define SOC_LPO_CAL_ENABLE_MASK 0x00100000 -#define SOC_LPO_CAL_ENABLE_GET(x) (((x) & SOC_LPO_CAL_ENABLE_MASK) >> SOC_LPO_CAL_ENABLE_LSB) -#define SOC_LPO_CAL_ENABLE_SET(x) (((x) << SOC_LPO_CAL_ENABLE_LSB) & SOC_LPO_CAL_ENABLE_MASK) -#define SOC_LPO_CAL_COUNT_MSB 19 -#define SOC_LPO_CAL_COUNT_LSB 0 -#define SOC_LPO_CAL_COUNT_MASK 0x000fffff -#define SOC_LPO_CAL_COUNT_GET(x) (((x) & SOC_LPO_CAL_COUNT_MASK) >> SOC_LPO_CAL_COUNT_LSB) -#define SOC_LPO_CAL_COUNT_SET(x) (((x) << SOC_LPO_CAL_COUNT_LSB) & SOC_LPO_CAL_COUNT_MASK) - -#define SOC_LPO_CAL_TEST_CONTROL_ADDRESS 0x000000e4 -#define SOC_LPO_CAL_TEST_CONTROL_OFFSET 0x000000e4 -#define SOC_LPO_CAL_TEST_CONTROL_ENABLE_MSB 16 -#define SOC_LPO_CAL_TEST_CONTROL_ENABLE_LSB 16 -#define SOC_LPO_CAL_TEST_CONTROL_ENABLE_MASK 0x00010000 -#define SOC_LPO_CAL_TEST_CONTROL_ENABLE_GET(x) (((x) & SOC_LPO_CAL_TEST_CONTROL_ENABLE_MASK) >> SOC_LPO_CAL_TEST_CONTROL_ENABLE_LSB) -#define SOC_LPO_CAL_TEST_CONTROL_ENABLE_SET(x) (((x) << SOC_LPO_CAL_TEST_CONTROL_ENABLE_LSB) & SOC_LPO_CAL_TEST_CONTROL_ENABLE_MASK) -#define SOC_LPO_CAL_TEST_CONTROL_RTC_CYCLES_MSB 15 -#define SOC_LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB 0 -#define SOC_LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK 0x0000ffff -#define SOC_LPO_CAL_TEST_CONTROL_RTC_CYCLES_GET(x) (((x) & SOC_LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK) >> SOC_LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB) -#define SOC_LPO_CAL_TEST_CONTROL_RTC_CYCLES_SET(x) (((x) << SOC_LPO_CAL_TEST_CONTROL_RTC_CYCLES_LSB) & SOC_LPO_CAL_TEST_CONTROL_RTC_CYCLES_MASK) - -#define SOC_LPO_CAL_TEST_STATUS_ADDRESS 0x000000e8 -#define SOC_LPO_CAL_TEST_STATUS_OFFSET 0x000000e8 -#define SOC_LPO_CAL_TEST_STATUS_READY_MSB 16 -#define SOC_LPO_CAL_TEST_STATUS_READY_LSB 16 -#define SOC_LPO_CAL_TEST_STATUS_READY_MASK 0x00010000 -#define SOC_LPO_CAL_TEST_STATUS_READY_GET(x) (((x) & SOC_LPO_CAL_TEST_STATUS_READY_MASK) >> SOC_LPO_CAL_TEST_STATUS_READY_LSB) -#define SOC_LPO_CAL_TEST_STATUS_READY_SET(x) (((x) << SOC_LPO_CAL_TEST_STATUS_READY_LSB) & SOC_LPO_CAL_TEST_STATUS_READY_MASK) -#define SOC_LPO_CAL_TEST_STATUS_COUNT_MSB 15 -#define SOC_LPO_CAL_TEST_STATUS_COUNT_LSB 0 -#define SOC_LPO_CAL_TEST_STATUS_COUNT_MASK 0x0000ffff -#define SOC_LPO_CAL_TEST_STATUS_COUNT_GET(x) (((x) & SOC_LPO_CAL_TEST_STATUS_COUNT_MASK) >> SOC_LPO_CAL_TEST_STATUS_COUNT_LSB) -#define SOC_LPO_CAL_TEST_STATUS_COUNT_SET(x) (((x) << SOC_LPO_CAL_TEST_STATUS_COUNT_LSB) & SOC_LPO_CAL_TEST_STATUS_COUNT_MASK) - -#define LEGACY_SOC_CHIP_ID_ADDRESS 0x000000ec -#define LEGACY_SOC_CHIP_ID_OFFSET 0x000000ec -#define LEGACY_SOC_CHIP_ID_DEVICE_ID_MSB 31 -#define LEGACY_SOC_CHIP_ID_DEVICE_ID_LSB 16 -#define LEGACY_SOC_CHIP_ID_DEVICE_ID_MASK 0xffff0000 -#define LEGACY_SOC_CHIP_ID_DEVICE_ID_GET(x) (((x) & LEGACY_SOC_CHIP_ID_DEVICE_ID_MASK) >> LEGACY_SOC_CHIP_ID_DEVICE_ID_LSB) -#define LEGACY_SOC_CHIP_ID_DEVICE_ID_SET(x) (((x) << LEGACY_SOC_CHIP_ID_DEVICE_ID_LSB) & LEGACY_SOC_CHIP_ID_DEVICE_ID_MASK) -#define LEGACY_SOC_CHIP_ID_CONFIG_ID_MSB 15 -#define LEGACY_SOC_CHIP_ID_CONFIG_ID_LSB 4 -#define LEGACY_SOC_CHIP_ID_CONFIG_ID_MASK 0x0000fff0 -#define LEGACY_SOC_CHIP_ID_CONFIG_ID_GET(x) (((x) & LEGACY_SOC_CHIP_ID_CONFIG_ID_MASK) >> LEGACY_SOC_CHIP_ID_CONFIG_ID_LSB) -#define LEGACY_SOC_CHIP_ID_CONFIG_ID_SET(x) (((x) << LEGACY_SOC_CHIP_ID_CONFIG_ID_LSB) & LEGACY_SOC_CHIP_ID_CONFIG_ID_MASK) -#define LEGACY_SOC_CHIP_ID_VERSION_ID_MSB 3 -#define LEGACY_SOC_CHIP_ID_VERSION_ID_LSB 0 -#define LEGACY_SOC_CHIP_ID_VERSION_ID_MASK 0x0000000f -#define LEGACY_SOC_CHIP_ID_VERSION_ID_GET(x) (((x) & LEGACY_SOC_CHIP_ID_VERSION_ID_MASK) >> LEGACY_SOC_CHIP_ID_VERSION_ID_LSB) -#define LEGACY_SOC_CHIP_ID_VERSION_ID_SET(x) (((x) << LEGACY_SOC_CHIP_ID_VERSION_ID_LSB) & LEGACY_SOC_CHIP_ID_VERSION_ID_MASK) - -#define SOC_CHIP_ID_ADDRESS 0x000000f0 -#define SOC_CHIP_ID_OFFSET 0x000000f0 -#define SOC_CHIP_ID_DEVICE_ID_MSB 31 -#define SOC_CHIP_ID_DEVICE_ID_LSB 16 -#define SOC_CHIP_ID_DEVICE_ID_MASK 0xffff0000 -#define SOC_CHIP_ID_DEVICE_ID_GET(x) (((x) & SOC_CHIP_ID_DEVICE_ID_MASK) >> SOC_CHIP_ID_DEVICE_ID_LSB) -#define SOC_CHIP_ID_DEVICE_ID_SET(x) (((x) << SOC_CHIP_ID_DEVICE_ID_LSB) & SOC_CHIP_ID_DEVICE_ID_MASK) -#define SOC_CHIP_ID_CONFIG_ID_MSB 15 -#define SOC_CHIP_ID_CONFIG_ID_LSB 4 -#define SOC_CHIP_ID_CONFIG_ID_MASK 0x0000fff0 -#define SOC_CHIP_ID_CONFIG_ID_GET(x) (((x) & SOC_CHIP_ID_CONFIG_ID_MASK) >> SOC_CHIP_ID_CONFIG_ID_LSB) -#define SOC_CHIP_ID_CONFIG_ID_SET(x) (((x) << SOC_CHIP_ID_CONFIG_ID_LSB) & SOC_CHIP_ID_CONFIG_ID_MASK) -#define SOC_CHIP_ID_VERSION_ID_MSB 3 -#define SOC_CHIP_ID_VERSION_ID_LSB 0 -#define SOC_CHIP_ID_VERSION_ID_MASK 0x0000000f -#define SOC_CHIP_ID_VERSION_ID_GET(x) (((x) & SOC_CHIP_ID_VERSION_ID_MASK) >> SOC_CHIP_ID_VERSION_ID_LSB) -#define SOC_CHIP_ID_VERSION_ID_SET(x) (((x) << SOC_CHIP_ID_VERSION_ID_LSB) & SOC_CHIP_ID_VERSION_ID_MASK) - -#define SOC_POWER_REG_ADDRESS 0x0000010c -#define SOC_POWER_REG_OFFSET 0x0000010c -#define SOC_POWER_REG_SWREG_VS_EN_MSB 17 -#define SOC_POWER_REG_SWREG_VS_EN_LSB 17 -#define SOC_POWER_REG_SWREG_VS_EN_MASK 0x00020000 -#define SOC_POWER_REG_SWREG_VS_EN_GET(x) (((x) & SOC_POWER_REG_SWREG_VS_EN_MASK) >> SOC_POWER_REG_SWREG_VS_EN_LSB) -#define SOC_POWER_REG_SWREG_VS_EN_SET(x) (((x) << SOC_POWER_REG_SWREG_VS_EN_LSB) & SOC_POWER_REG_SWREG_VS_EN_MASK) -#define SOC_POWER_REG_DISCON_MODE_EN_MSB 16 -#define SOC_POWER_REG_DISCON_MODE_EN_LSB 16 -#define SOC_POWER_REG_DISCON_MODE_EN_MASK 0x00010000 -#define SOC_POWER_REG_DISCON_MODE_EN_GET(x) (((x) & SOC_POWER_REG_DISCON_MODE_EN_MASK) >> SOC_POWER_REG_DISCON_MODE_EN_LSB) -#define SOC_POWER_REG_DISCON_MODE_EN_SET(x) (((x) << SOC_POWER_REG_DISCON_MODE_EN_LSB) & SOC_POWER_REG_DISCON_MODE_EN_MASK) -#define SOC_POWER_REG_DEEP_SLEEP_EN_MSB 15 -#define SOC_POWER_REG_DEEP_SLEEP_EN_LSB 15 -#define SOC_POWER_REG_DEEP_SLEEP_EN_MASK 0x00008000 -#define SOC_POWER_REG_DEEP_SLEEP_EN_GET(x) (((x) & SOC_POWER_REG_DEEP_SLEEP_EN_MASK) >> SOC_POWER_REG_DEEP_SLEEP_EN_LSB) -#define SOC_POWER_REG_DEEP_SLEEP_EN_SET(x) (((x) << SOC_POWER_REG_DEEP_SLEEP_EN_LSB) & SOC_POWER_REG_DEEP_SLEEP_EN_MASK) -#define SOC_POWER_REG_DEBUG_EN_MSB 14 -#define SOC_POWER_REG_DEBUG_EN_LSB 14 -#define SOC_POWER_REG_DEBUG_EN_MASK 0x00004000 -#define SOC_POWER_REG_DEBUG_EN_GET(x) (((x) & SOC_POWER_REG_DEBUG_EN_MASK) >> SOC_POWER_REG_DEBUG_EN_LSB) -#define SOC_POWER_REG_DEBUG_EN_SET(x) (((x) << SOC_POWER_REG_DEBUG_EN_LSB) & SOC_POWER_REG_DEBUG_EN_MASK) -#define SOC_POWER_REG_WLAN_BB_PWD_EN_MSB 13 -#define SOC_POWER_REG_WLAN_BB_PWD_EN_LSB 13 -#define SOC_POWER_REG_WLAN_BB_PWD_EN_MASK 0x00002000 -#define SOC_POWER_REG_WLAN_BB_PWD_EN_GET(x) (((x) & SOC_POWER_REG_WLAN_BB_PWD_EN_MASK) >> SOC_POWER_REG_WLAN_BB_PWD_EN_LSB) -#define SOC_POWER_REG_WLAN_BB_PWD_EN_SET(x) (((x) << SOC_POWER_REG_WLAN_BB_PWD_EN_LSB) & SOC_POWER_REG_WLAN_BB_PWD_EN_MASK) -#define SOC_POWER_REG_WLAN_MAC_PWD_EN_MSB 12 -#define SOC_POWER_REG_WLAN_MAC_PWD_EN_LSB 12 -#define SOC_POWER_REG_WLAN_MAC_PWD_EN_MASK 0x00001000 -#define SOC_POWER_REG_WLAN_MAC_PWD_EN_GET(x) (((x) & SOC_POWER_REG_WLAN_MAC_PWD_EN_MASK) >> SOC_POWER_REG_WLAN_MAC_PWD_EN_LSB) -#define SOC_POWER_REG_WLAN_MAC_PWD_EN_SET(x) (((x) << SOC_POWER_REG_WLAN_MAC_PWD_EN_LSB) & SOC_POWER_REG_WLAN_MAC_PWD_EN_MASK) -#define SOC_POWER_REG_CPU_INT_ENABLE_MSB 7 -#define SOC_POWER_REG_CPU_INT_ENABLE_LSB 7 -#define SOC_POWER_REG_CPU_INT_ENABLE_MASK 0x00000080 -#define SOC_POWER_REG_CPU_INT_ENABLE_GET(x) (((x) & SOC_POWER_REG_CPU_INT_ENABLE_MASK) >> SOC_POWER_REG_CPU_INT_ENABLE_LSB) -#define SOC_POWER_REG_CPU_INT_ENABLE_SET(x) (((x) << SOC_POWER_REG_CPU_INT_ENABLE_LSB) & SOC_POWER_REG_CPU_INT_ENABLE_MASK) -#define SOC_POWER_REG_RADIO_PWD_EN_MSB 4 -#define SOC_POWER_REG_RADIO_PWD_EN_LSB 4 -#define SOC_POWER_REG_RADIO_PWD_EN_MASK 0x00000010 -#define SOC_POWER_REG_RADIO_PWD_EN_GET(x) (((x) & SOC_POWER_REG_RADIO_PWD_EN_MASK) >> SOC_POWER_REG_RADIO_PWD_EN_LSB) -#define SOC_POWER_REG_RADIO_PWD_EN_SET(x) (((x) << SOC_POWER_REG_RADIO_PWD_EN_LSB) & SOC_POWER_REG_RADIO_PWD_EN_MASK) -#define SOC_POWER_REG_WLAN_PWD_EN_MSB 1 -#define SOC_POWER_REG_WLAN_PWD_EN_LSB 1 -#define SOC_POWER_REG_WLAN_PWD_EN_MASK 0x00000002 -#define SOC_POWER_REG_WLAN_PWD_EN_GET(x) (((x) & SOC_POWER_REG_WLAN_PWD_EN_MASK) >> SOC_POWER_REG_WLAN_PWD_EN_LSB) -#define SOC_POWER_REG_WLAN_PWD_EN_SET(x) (((x) << SOC_POWER_REG_WLAN_PWD_EN_LSB) & SOC_POWER_REG_WLAN_PWD_EN_MASK) -#define SOC_POWER_REG_POWER_EN_MSB 0 -#define SOC_POWER_REG_POWER_EN_LSB 0 -#define SOC_POWER_REG_POWER_EN_MASK 0x00000001 -#define SOC_POWER_REG_POWER_EN_GET(x) (((x) & SOC_POWER_REG_POWER_EN_MASK) >> SOC_POWER_REG_POWER_EN_LSB) -#define SOC_POWER_REG_POWER_EN_SET(x) (((x) << SOC_POWER_REG_POWER_EN_LSB) & SOC_POWER_REG_POWER_EN_MASK) - -#define SOC_CORE_CLK_CTRL_ADDRESS 0x00000110 -#define SOC_CORE_CLK_CTRL_OFFSET 0x00000110 -#define SOC_CORE_CLK_CTRL_DIV_MSB 2 -#define SOC_CORE_CLK_CTRL_DIV_LSB 0 -#define SOC_CORE_CLK_CTRL_DIV_MASK 0x00000007 -#define SOC_CORE_CLK_CTRL_DIV_GET(x) (((x) & SOC_CORE_CLK_CTRL_DIV_MASK) >> SOC_CORE_CLK_CTRL_DIV_LSB) -#define SOC_CORE_CLK_CTRL_DIV_SET(x) (((x) << SOC_CORE_CLK_CTRL_DIV_LSB) & SOC_CORE_CLK_CTRL_DIV_MASK) - -#define SOC_GPIO_WAKEUP_CONTROL_ADDRESS 0x00000114 -#define SOC_GPIO_WAKEUP_CONTROL_OFFSET 0x00000114 -#define SOC_GPIO_WAKEUP_CONTROL_ENABLE_MSB 0 -#define SOC_GPIO_WAKEUP_CONTROL_ENABLE_LSB 0 -#define SOC_GPIO_WAKEUP_CONTROL_ENABLE_MASK 0x00000001 -#define SOC_GPIO_WAKEUP_CONTROL_ENABLE_GET(x) (((x) & SOC_GPIO_WAKEUP_CONTROL_ENABLE_MASK) >> SOC_GPIO_WAKEUP_CONTROL_ENABLE_LSB) -#define SOC_GPIO_WAKEUP_CONTROL_ENABLE_SET(x) (((x) << SOC_GPIO_WAKEUP_CONTROL_ENABLE_LSB) & SOC_GPIO_WAKEUP_CONTROL_ENABLE_MASK) - -#define SLEEP_RETENTION_ADDRESS 0x00000214 -#define SLEEP_RETENTION_OFFSET 0x00000214 -#define SLEEP_RETENTION_GREEN_SAVE_MSB 10 -#define SLEEP_RETENTION_GREEN_SAVE_LSB 10 -#define SLEEP_RETENTION_GREEN_SAVE_MASK 0x00000400 -#define SLEEP_RETENTION_GREEN_SAVE_GET(x) (((x) & SLEEP_RETENTION_GREEN_SAVE_MASK) >> SLEEP_RETENTION_GREEN_SAVE_LSB) -#define SLEEP_RETENTION_GREEN_SAVE_SET(x) (((x) << SLEEP_RETENTION_GREEN_SAVE_LSB) & SLEEP_RETENTION_GREEN_SAVE_MASK) -#define SLEEP_RETENTION_TIME_MSB 9 -#define SLEEP_RETENTION_TIME_LSB 2 -#define SLEEP_RETENTION_TIME_MASK 0x000003fc -#define SLEEP_RETENTION_TIME_GET(x) (((x) & SLEEP_RETENTION_TIME_MASK) >> SLEEP_RETENTION_TIME_LSB) -#define SLEEP_RETENTION_TIME_SET(x) (((x) << SLEEP_RETENTION_TIME_LSB) & SLEEP_RETENTION_TIME_MASK) -#define SLEEP_RETENTION_MODE_MSB 1 -#define SLEEP_RETENTION_MODE_LSB 1 -#define SLEEP_RETENTION_MODE_MASK 0x00000002 -#define SLEEP_RETENTION_MODE_GET(x) (((x) & SLEEP_RETENTION_MODE_MASK) >> SLEEP_RETENTION_MODE_LSB) -#define SLEEP_RETENTION_MODE_SET(x) (((x) << SLEEP_RETENTION_MODE_LSB) & SLEEP_RETENTION_MODE_MASK) -#define SLEEP_RETENTION_ENABLE_MSB 0 -#define SLEEP_RETENTION_ENABLE_LSB 0 -#define SLEEP_RETENTION_ENABLE_MASK 0x00000001 -#define SLEEP_RETENTION_ENABLE_GET(x) (((x) & SLEEP_RETENTION_ENABLE_MASK) >> SLEEP_RETENTION_ENABLE_LSB) -#define SLEEP_RETENTION_ENABLE_SET(x) (((x) << SLEEP_RETENTION_ENABLE_LSB) & SLEEP_RETENTION_ENABLE_MASK) - -#define LP_PERF_COUNTER_ADDRESS 0x00000284 -#define LP_PERF_COUNTER_OFFSET 0x00000284 -#define LP_PERF_COUNTER_EN_MSB 0 -#define LP_PERF_COUNTER_EN_LSB 0 -#define LP_PERF_COUNTER_EN_MASK 0x00000001 -#define LP_PERF_COUNTER_EN_GET(x) (((x) & LP_PERF_COUNTER_EN_MASK) >> LP_PERF_COUNTER_EN_LSB) -#define LP_PERF_COUNTER_EN_SET(x) (((x) << LP_PERF_COUNTER_EN_LSB) & LP_PERF_COUNTER_EN_MASK) - -#define LP_PERF_LIGHT_SLEEP_ADDRESS 0x00000288 -#define LP_PERF_LIGHT_SLEEP_OFFSET 0x00000288 -#define LP_PERF_LIGHT_SLEEP_CNT_MSB 31 -#define LP_PERF_LIGHT_SLEEP_CNT_LSB 0 -#define LP_PERF_LIGHT_SLEEP_CNT_MASK 0xffffffff -#define LP_PERF_LIGHT_SLEEP_CNT_GET(x) (((x) & LP_PERF_LIGHT_SLEEP_CNT_MASK) >> LP_PERF_LIGHT_SLEEP_CNT_LSB) -#define LP_PERF_LIGHT_SLEEP_CNT_SET(x) (((x) << LP_PERF_LIGHT_SLEEP_CNT_LSB) & LP_PERF_LIGHT_SLEEP_CNT_MASK) - -#define LP_PERF_DEEP_SLEEP_ADDRESS 0x0000028c -#define LP_PERF_DEEP_SLEEP_OFFSET 0x0000028c -#define LP_PERF_DEEP_SLEEP_CNT_MSB 31 -#define LP_PERF_DEEP_SLEEP_CNT_LSB 0 -#define LP_PERF_DEEP_SLEEP_CNT_MASK 0xffffffff -#define LP_PERF_DEEP_SLEEP_CNT_GET(x) (((x) & LP_PERF_DEEP_SLEEP_CNT_MASK) >> LP_PERF_DEEP_SLEEP_CNT_LSB) -#define LP_PERF_DEEP_SLEEP_CNT_SET(x) (((x) << LP_PERF_DEEP_SLEEP_CNT_LSB) & LP_PERF_DEEP_SLEEP_CNT_MASK) - -#define LP_PERF_ON_ADDRESS 0x00000290 -#define LP_PERF_ON_OFFSET 0x00000290 -#define LP_PERF_ON_CNT_MSB 31 -#define LP_PERF_ON_CNT_LSB 0 -#define LP_PERF_ON_CNT_MASK 0xffffffff -#define LP_PERF_ON_CNT_GET(x) (((x) & LP_PERF_ON_CNT_MASK) >> LP_PERF_ON_CNT_LSB) -#define LP_PERF_ON_CNT_SET(x) (((x) << LP_PERF_ON_CNT_LSB) & LP_PERF_ON_CNT_MASK) - -#define CHIP_MODE_ADDRESS 0x000002a8 -#define CHIP_MODE_OFFSET 0x000002a8 -#define CHIP_MODE_BIT_MSB 1 -#define CHIP_MODE_BIT_LSB 0 -#define CHIP_MODE_BIT_MASK 0x00000003 -#define CHIP_MODE_BIT_GET(x) (((x) & CHIP_MODE_BIT_MASK) >> CHIP_MODE_BIT_LSB) -#define CHIP_MODE_BIT_SET(x) (((x) << CHIP_MODE_BIT_LSB) & CHIP_MODE_BIT_MASK) - -#define CLK_REQ_FALL_EDGE_ADDRESS 0x000002ac -#define CLK_REQ_FALL_EDGE_OFFSET 0x000002ac -#define CLK_REQ_FALL_EDGE_EN_MSB 31 -#define CLK_REQ_FALL_EDGE_EN_LSB 31 -#define CLK_REQ_FALL_EDGE_EN_MASK 0x80000000 -#define CLK_REQ_FALL_EDGE_EN_GET(x) (((x) & CLK_REQ_FALL_EDGE_EN_MASK) >> CLK_REQ_FALL_EDGE_EN_LSB) -#define CLK_REQ_FALL_EDGE_EN_SET(x) (((x) << CLK_REQ_FALL_EDGE_EN_LSB) & CLK_REQ_FALL_EDGE_EN_MASK) -#define CLK_REQ_FALL_EDGE_DELAY_MSB 7 -#define CLK_REQ_FALL_EDGE_DELAY_LSB 0 -#define CLK_REQ_FALL_EDGE_DELAY_MASK 0x000000ff -#define CLK_REQ_FALL_EDGE_DELAY_GET(x) (((x) & CLK_REQ_FALL_EDGE_DELAY_MASK) >> CLK_REQ_FALL_EDGE_DELAY_LSB) -#define CLK_REQ_FALL_EDGE_DELAY_SET(x) (((x) << CLK_REQ_FALL_EDGE_DELAY_LSB) & CLK_REQ_FALL_EDGE_DELAY_MASK) - -#define OTP_ADDRESS 0x000002b0 -#define OTP_OFFSET 0x000002b0 -#define OTP_LDO25_EN_MSB 1 -#define OTP_LDO25_EN_LSB 1 -#define OTP_LDO25_EN_MASK 0x00000002 -#define OTP_LDO25_EN_GET(x) (((x) & OTP_LDO25_EN_MASK) >> OTP_LDO25_EN_LSB) -#define OTP_LDO25_EN_SET(x) (((x) << OTP_LDO25_EN_LSB) & OTP_LDO25_EN_MASK) -#define OTP_VDD12_EN_MSB 0 -#define OTP_VDD12_EN_LSB 0 -#define OTP_VDD12_EN_MASK 0x00000001 -#define OTP_VDD12_EN_GET(x) (((x) & OTP_VDD12_EN_MASK) >> OTP_VDD12_EN_LSB) -#define OTP_VDD12_EN_SET(x) (((x) << OTP_VDD12_EN_LSB) & OTP_VDD12_EN_MASK) - -#define OTP_STATUS_ADDRESS 0x000002b4 -#define OTP_STATUS_OFFSET 0x000002b4 -#define OTP_STATUS_LDO25_EN_READY_MSB 1 -#define OTP_STATUS_LDO25_EN_READY_LSB 1 -#define OTP_STATUS_LDO25_EN_READY_MASK 0x00000002 -#define OTP_STATUS_LDO25_EN_READY_GET(x) (((x) & OTP_STATUS_LDO25_EN_READY_MASK) >> OTP_STATUS_LDO25_EN_READY_LSB) -#define OTP_STATUS_LDO25_EN_READY_SET(x) (((x) << OTP_STATUS_LDO25_EN_READY_LSB) & OTP_STATUS_LDO25_EN_READY_MASK) -#define OTP_STATUS_VDD12_EN_READY_MSB 0 -#define OTP_STATUS_VDD12_EN_READY_LSB 0 -#define OTP_STATUS_VDD12_EN_READY_MASK 0x00000001 -#define OTP_STATUS_VDD12_EN_READY_GET(x) (((x) & OTP_STATUS_VDD12_EN_READY_MASK) >> OTP_STATUS_VDD12_EN_READY_LSB) -#define OTP_STATUS_VDD12_EN_READY_SET(x) (((x) << OTP_STATUS_VDD12_EN_READY_LSB) & OTP_STATUS_VDD12_EN_READY_MASK) - -#define PMU_ADDRESS 0x000002b8 -#define PMU_OFFSET 0x000002b8 -#define PMU_REG_WAKEUP_TIME_SEL_MSB 1 -#define PMU_REG_WAKEUP_TIME_SEL_LSB 0 -#define PMU_REG_WAKEUP_TIME_SEL_MASK 0x00000003 -#define PMU_REG_WAKEUP_TIME_SEL_GET(x) (((x) & PMU_REG_WAKEUP_TIME_SEL_MASK) >> PMU_REG_WAKEUP_TIME_SEL_LSB) -#define PMU_REG_WAKEUP_TIME_SEL_SET(x) (((x) << PMU_REG_WAKEUP_TIME_SEL_LSB) & PMU_REG_WAKEUP_TIME_SEL_MASK) - -#define PMU_CONFIG_ADDRESS 0x000002bc -#define PMU_CONFIG_OFFSET 0x000002bc -#define PMU_CONFIG_VALUE_MSB 4 -#define PMU_CONFIG_VALUE_LSB 0 -#define PMU_CONFIG_VALUE_MASK 0x0000001f -#define PMU_CONFIG_VALUE_GET(x) (((x) & PMU_CONFIG_VALUE_MASK) >> PMU_CONFIG_VALUE_LSB) -#define PMU_CONFIG_VALUE_SET(x) (((x) << PMU_CONFIG_VALUE_LSB) & PMU_CONFIG_VALUE_MASK) - -#define PMU_PAREG_ADDRESS 0x000002c0 -#define PMU_PAREG_OFFSET 0x000002c0 -#define PMU_PAREG_LVL_CTR_MSB 2 -#define PMU_PAREG_LVL_CTR_LSB 0 -#define PMU_PAREG_LVL_CTR_MASK 0x00000007 -#define PMU_PAREG_LVL_CTR_GET(x) (((x) & PMU_PAREG_LVL_CTR_MASK) >> PMU_PAREG_LVL_CTR_LSB) -#define PMU_PAREG_LVL_CTR_SET(x) (((x) << PMU_PAREG_LVL_CTR_LSB) & PMU_PAREG_LVL_CTR_MASK) - -#define PMU_BYPASS_ADDRESS 0x000002c4 -#define PMU_BYPASS_OFFSET 0x000002c4 -#define PMU_BYPASS_SWREG_MSB 1 -#define PMU_BYPASS_SWREG_LSB 1 -#define PMU_BYPASS_SWREG_MASK 0x00000002 -#define PMU_BYPASS_SWREG_GET(x) (((x) & PMU_BYPASS_SWREG_MASK) >> PMU_BYPASS_SWREG_LSB) -#define PMU_BYPASS_SWREG_SET(x) (((x) << PMU_BYPASS_SWREG_LSB) & PMU_BYPASS_SWREG_MASK) -#define PMU_BYPASS_PAREG_MSB 0 -#define PMU_BYPASS_PAREG_LSB 0 -#define PMU_BYPASS_PAREG_MASK 0x00000001 -#define PMU_BYPASS_PAREG_GET(x) (((x) & PMU_BYPASS_PAREG_MASK) >> PMU_BYPASS_PAREG_LSB) -#define PMU_BYPASS_PAREG_SET(x) (((x) << PMU_BYPASS_PAREG_LSB) & PMU_BYPASS_PAREG_MASK) - -#define THERM_CTRL1_ADDRESS 0x000002dc -#define THERM_CTRL1_OFFSET 0x000002dc -#define THERM_CTRL1_BYPASS_MSB 16 -#define THERM_CTRL1_BYPASS_LSB 16 -#define THERM_CTRL1_BYPASS_MASK 0x00010000 -#define THERM_CTRL1_BYPASS_GET(x) (((x) & THERM_CTRL1_BYPASS_MASK) >> THERM_CTRL1_BYPASS_LSB) -#define THERM_CTRL1_BYPASS_SET(x) (((x) << THERM_CTRL1_BYPASS_LSB) & THERM_CTRL1_BYPASS_MASK) -#define THERM_CTRL1_WIDTH_ARBITOR_MSB 15 -#define THERM_CTRL1_WIDTH_ARBITOR_LSB 12 -#define THERM_CTRL1_WIDTH_ARBITOR_MASK 0x0000f000 -#define THERM_CTRL1_WIDTH_ARBITOR_GET(x) (((x) & THERM_CTRL1_WIDTH_ARBITOR_MASK) >> THERM_CTRL1_WIDTH_ARBITOR_LSB) -#define THERM_CTRL1_WIDTH_ARBITOR_SET(x) (((x) << THERM_CTRL1_WIDTH_ARBITOR_LSB) & THERM_CTRL1_WIDTH_ARBITOR_MASK) -#define THERM_CTRL1_WIDTH_MSB 11 -#define THERM_CTRL1_WIDTH_LSB 5 -#define THERM_CTRL1_WIDTH_MASK 0x00000fe0 -#define THERM_CTRL1_WIDTH_GET(x) (((x) & THERM_CTRL1_WIDTH_MASK) >> THERM_CTRL1_WIDTH_LSB) -#define THERM_CTRL1_WIDTH_SET(x) (((x) << THERM_CTRL1_WIDTH_LSB) & THERM_CTRL1_WIDTH_MASK) -#define THERM_CTRL1_TYPE_MSB 4 -#define THERM_CTRL1_TYPE_LSB 3 -#define THERM_CTRL1_TYPE_MASK 0x00000018 -#define THERM_CTRL1_TYPE_GET(x) (((x) & THERM_CTRL1_TYPE_MASK) >> THERM_CTRL1_TYPE_LSB) -#define THERM_CTRL1_TYPE_SET(x) (((x) << THERM_CTRL1_TYPE_LSB) & THERM_CTRL1_TYPE_MASK) -#define THERM_CTRL1_MEASURE_MSB 2 -#define THERM_CTRL1_MEASURE_LSB 2 -#define THERM_CTRL1_MEASURE_MASK 0x00000004 -#define THERM_CTRL1_MEASURE_GET(x) (((x) & THERM_CTRL1_MEASURE_MASK) >> THERM_CTRL1_MEASURE_LSB) -#define THERM_CTRL1_MEASURE_SET(x) (((x) << THERM_CTRL1_MEASURE_LSB) & THERM_CTRL1_MEASURE_MASK) -#define THERM_CTRL1_INT_EN_MSB 1 -#define THERM_CTRL1_INT_EN_LSB 1 -#define THERM_CTRL1_INT_EN_MASK 0x00000002 -#define THERM_CTRL1_INT_EN_GET(x) (((x) & THERM_CTRL1_INT_EN_MASK) >> THERM_CTRL1_INT_EN_LSB) -#define THERM_CTRL1_INT_EN_SET(x) (((x) << THERM_CTRL1_INT_EN_LSB) & THERM_CTRL1_INT_EN_MASK) -#define THERM_CTRL1_INT_STATUS_MSB 0 -#define THERM_CTRL1_INT_STATUS_LSB 0 -#define THERM_CTRL1_INT_STATUS_MASK 0x00000001 -#define THERM_CTRL1_INT_STATUS_GET(x) (((x) & THERM_CTRL1_INT_STATUS_MASK) >> THERM_CTRL1_INT_STATUS_LSB) -#define THERM_CTRL1_INT_STATUS_SET(x) (((x) << THERM_CTRL1_INT_STATUS_LSB) & THERM_CTRL1_INT_STATUS_MASK) - -#define THERM_CTRL2_ADDRESS 0x000002e0 -#define THERM_CTRL2_OFFSET 0x000002e0 -#define THERM_CTRL2_ADC_OFF_MSB 25 -#define THERM_CTRL2_ADC_OFF_LSB 25 -#define THERM_CTRL2_ADC_OFF_MASK 0x02000000 -#define THERM_CTRL2_ADC_OFF_GET(x) (((x) & THERM_CTRL2_ADC_OFF_MASK) >> THERM_CTRL2_ADC_OFF_LSB) -#define THERM_CTRL2_ADC_OFF_SET(x) (((x) << THERM_CTRL2_ADC_OFF_LSB) & THERM_CTRL2_ADC_OFF_MASK) -#define THERM_CTRL2_ADC_ON_MSB 24 -#define THERM_CTRL2_ADC_ON_LSB 24 -#define THERM_CTRL2_ADC_ON_MASK 0x01000000 -#define THERM_CTRL2_ADC_ON_GET(x) (((x) & THERM_CTRL2_ADC_ON_MASK) >> THERM_CTRL2_ADC_ON_LSB) -#define THERM_CTRL2_ADC_ON_SET(x) (((x) << THERM_CTRL2_ADC_ON_LSB) & THERM_CTRL2_ADC_ON_MASK) -#define THERM_CTRL2_SAMPLE_MSB 23 -#define THERM_CTRL2_SAMPLE_LSB 16 -#define THERM_CTRL2_SAMPLE_MASK 0x00ff0000 -#define THERM_CTRL2_SAMPLE_GET(x) (((x) & THERM_CTRL2_SAMPLE_MASK) >> THERM_CTRL2_SAMPLE_LSB) -#define THERM_CTRL2_SAMPLE_SET(x) (((x) << THERM_CTRL2_SAMPLE_LSB) & THERM_CTRL2_SAMPLE_MASK) -#define THERM_CTRL2_HIGH_MSB 15 -#define THERM_CTRL2_HIGH_LSB 8 -#define THERM_CTRL2_HIGH_MASK 0x0000ff00 -#define THERM_CTRL2_HIGH_GET(x) (((x) & THERM_CTRL2_HIGH_MASK) >> THERM_CTRL2_HIGH_LSB) -#define THERM_CTRL2_HIGH_SET(x) (((x) << THERM_CTRL2_HIGH_LSB) & THERM_CTRL2_HIGH_MASK) -#define THERM_CTRL2_LOW_MSB 7 -#define THERM_CTRL2_LOW_LSB 0 -#define THERM_CTRL2_LOW_MASK 0x000000ff -#define THERM_CTRL2_LOW_GET(x) (((x) & THERM_CTRL2_LOW_MASK) >> THERM_CTRL2_LOW_LSB) -#define THERM_CTRL2_LOW_SET(x) (((x) << THERM_CTRL2_LOW_LSB) & THERM_CTRL2_LOW_MASK) - -#define THERM_CTRL3_ADDRESS 0x000002e4 -#define THERM_CTRL3_OFFSET 0x000002e4 -#define THERM_CTRL3_ADC_GAIN_MSB 16 -#define THERM_CTRL3_ADC_GAIN_LSB 8 -#define THERM_CTRL3_ADC_GAIN_MASK 0x0001ff00 -#define THERM_CTRL3_ADC_GAIN_GET(x) (((x) & THERM_CTRL3_ADC_GAIN_MASK) >> THERM_CTRL3_ADC_GAIN_LSB) -#define THERM_CTRL3_ADC_GAIN_SET(x) (((x) << THERM_CTRL3_ADC_GAIN_LSB) & THERM_CTRL3_ADC_GAIN_MASK) -#define THERM_CTRL3_ADC_OFFSET_MSB 7 -#define THERM_CTRL3_ADC_OFFSET_LSB 0 -#define THERM_CTRL3_ADC_OFFSET_MASK 0x000000ff -#define THERM_CTRL3_ADC_OFFSET_GET(x) (((x) & THERM_CTRL3_ADC_OFFSET_MASK) >> THERM_CTRL3_ADC_OFFSET_LSB) -#define THERM_CTRL3_ADC_OFFSET_SET(x) (((x) << THERM_CTRL3_ADC_OFFSET_LSB) & THERM_CTRL3_ADC_OFFSET_MASK) - -#define LISTEN_MODE1_ADDRESS 0x000002e8 -#define LISTEN_MODE1_OFFSET 0x000002e8 -#define LISTEN_MODE1_TIMER_CLEAR_MSB 19 -#define LISTEN_MODE1_TIMER_CLEAR_LSB 19 -#define LISTEN_MODE1_TIMER_CLEAR_MASK 0x00080000 -#define LISTEN_MODE1_TIMER_CLEAR_GET(x) (((x) & LISTEN_MODE1_TIMER_CLEAR_MASK) >> LISTEN_MODE1_TIMER_CLEAR_LSB) -#define LISTEN_MODE1_TIMER_CLEAR_SET(x) (((x) << LISTEN_MODE1_TIMER_CLEAR_LSB) & LISTEN_MODE1_TIMER_CLEAR_MASK) -#define LISTEN_MODE1_TIMER_THRESH_WAKE_MSB 18 -#define LISTEN_MODE1_TIMER_THRESH_WAKE_LSB 3 -#define LISTEN_MODE1_TIMER_THRESH_WAKE_MASK 0x0007fff8 -#define LISTEN_MODE1_TIMER_THRESH_WAKE_GET(x) (((x) & LISTEN_MODE1_TIMER_THRESH_WAKE_MASK) >> LISTEN_MODE1_TIMER_THRESH_WAKE_LSB) -#define LISTEN_MODE1_TIMER_THRESH_WAKE_SET(x) (((x) << LISTEN_MODE1_TIMER_THRESH_WAKE_LSB) & LISTEN_MODE1_TIMER_THRESH_WAKE_MASK) -#define LISTEN_MODE1_TIMER_OVERFLOW_WAKE_MSB 2 -#define LISTEN_MODE1_TIMER_OVERFLOW_WAKE_LSB 2 -#define LISTEN_MODE1_TIMER_OVERFLOW_WAKE_MASK 0x00000004 -#define LISTEN_MODE1_TIMER_OVERFLOW_WAKE_GET(x) (((x) & LISTEN_MODE1_TIMER_OVERFLOW_WAKE_MASK) >> LISTEN_MODE1_TIMER_OVERFLOW_WAKE_LSB) -#define LISTEN_MODE1_TIMER_OVERFLOW_WAKE_SET(x) (((x) << LISTEN_MODE1_TIMER_OVERFLOW_WAKE_LSB) & LISTEN_MODE1_TIMER_OVERFLOW_WAKE_MASK) -#define LISTEN_MODE1_CLOCK_GATE_MSB 1 -#define LISTEN_MODE1_CLOCK_GATE_LSB 1 -#define LISTEN_MODE1_CLOCK_GATE_MASK 0x00000002 -#define LISTEN_MODE1_CLOCK_GATE_GET(x) (((x) & LISTEN_MODE1_CLOCK_GATE_MASK) >> LISTEN_MODE1_CLOCK_GATE_LSB) -#define LISTEN_MODE1_CLOCK_GATE_SET(x) (((x) << LISTEN_MODE1_CLOCK_GATE_LSB) & LISTEN_MODE1_CLOCK_GATE_MASK) -#define LISTEN_MODE1_ENABLE_MSB 0 -#define LISTEN_MODE1_ENABLE_LSB 0 -#define LISTEN_MODE1_ENABLE_MASK 0x00000001 -#define LISTEN_MODE1_ENABLE_GET(x) (((x) & LISTEN_MODE1_ENABLE_MASK) >> LISTEN_MODE1_ENABLE_LSB) -#define LISTEN_MODE1_ENABLE_SET(x) (((x) << LISTEN_MODE1_ENABLE_LSB) & LISTEN_MODE1_ENABLE_MASK) - -#define LISTEN_MODE2_ADDRESS 0x000002ec -#define LISTEN_MODE2_OFFSET 0x000002ec -#define LISTEN_MODE2_TIMER_TRIGGER_WAKE_MSB 15 -#define LISTEN_MODE2_TIMER_TRIGGER_WAKE_LSB 0 -#define LISTEN_MODE2_TIMER_TRIGGER_WAKE_MASK 0x0000ffff -#define LISTEN_MODE2_TIMER_TRIGGER_WAKE_GET(x) (((x) & LISTEN_MODE2_TIMER_TRIGGER_WAKE_MASK) >> LISTEN_MODE2_TIMER_TRIGGER_WAKE_LSB) -#define LISTEN_MODE2_TIMER_TRIGGER_WAKE_SET(x) (((x) << LISTEN_MODE2_TIMER_TRIGGER_WAKE_LSB) & LISTEN_MODE2_TIMER_TRIGGER_WAKE_MASK) - -#define AUDIO_PLL_CONFIG_ADDRESS 0x000002f0 -#define AUDIO_PLL_CONFIG_OFFSET 0x000002f0 -#define AUDIO_PLL_CONFIG_UPDATING_MSB 31 -#define AUDIO_PLL_CONFIG_UPDATING_LSB 31 -#define AUDIO_PLL_CONFIG_UPDATING_MASK 0x80000000 -#define AUDIO_PLL_CONFIG_UPDATING_GET(x) (((x) & AUDIO_PLL_CONFIG_UPDATING_MASK) >> AUDIO_PLL_CONFIG_UPDATING_LSB) -#define AUDIO_PLL_CONFIG_UPDATING_SET(x) (((x) << AUDIO_PLL_CONFIG_UPDATING_LSB) & AUDIO_PLL_CONFIG_UPDATING_MASK) -#define AUDIO_PLL_CONFIG_EXT_DIV_MSB 14 -#define AUDIO_PLL_CONFIG_EXT_DIV_LSB 12 -#define AUDIO_PLL_CONFIG_EXT_DIV_MASK 0x00007000 -#define AUDIO_PLL_CONFIG_EXT_DIV_GET(x) (((x) & AUDIO_PLL_CONFIG_EXT_DIV_MASK) >> AUDIO_PLL_CONFIG_EXT_DIV_LSB) -#define AUDIO_PLL_CONFIG_EXT_DIV_SET(x) (((x) << AUDIO_PLL_CONFIG_EXT_DIV_LSB) & AUDIO_PLL_CONFIG_EXT_DIV_MASK) -#define AUDIO_PLL_CONFIG_POSTPLLDIV_MSB 9 -#define AUDIO_PLL_CONFIG_POSTPLLDIV_LSB 7 -#define AUDIO_PLL_CONFIG_POSTPLLDIV_MASK 0x00000380 -#define AUDIO_PLL_CONFIG_POSTPLLDIV_GET(x) (((x) & AUDIO_PLL_CONFIG_POSTPLLDIV_MASK) >> AUDIO_PLL_CONFIG_POSTPLLDIV_LSB) -#define AUDIO_PLL_CONFIG_POSTPLLDIV_SET(x) (((x) << AUDIO_PLL_CONFIG_POSTPLLDIV_LSB) & AUDIO_PLL_CONFIG_POSTPLLDIV_MASK) -#define AUDIO_PLL_CONFIG_PLLPWD_MSB 5 -#define AUDIO_PLL_CONFIG_PLLPWD_LSB 5 -#define AUDIO_PLL_CONFIG_PLLPWD_MASK 0x00000020 -#define AUDIO_PLL_CONFIG_PLLPWD_GET(x) (((x) & AUDIO_PLL_CONFIG_PLLPWD_MASK) >> AUDIO_PLL_CONFIG_PLLPWD_LSB) -#define AUDIO_PLL_CONFIG_PLLPWD_SET(x) (((x) << AUDIO_PLL_CONFIG_PLLPWD_LSB) & AUDIO_PLL_CONFIG_PLLPWD_MASK) -#define AUDIO_PLL_CONFIG_BYPASS_MSB 4 -#define AUDIO_PLL_CONFIG_BYPASS_LSB 4 -#define AUDIO_PLL_CONFIG_BYPASS_MASK 0x00000010 -#define AUDIO_PLL_CONFIG_BYPASS_GET(x) (((x) & AUDIO_PLL_CONFIG_BYPASS_MASK) >> AUDIO_PLL_CONFIG_BYPASS_LSB) -#define AUDIO_PLL_CONFIG_BYPASS_SET(x) (((x) << AUDIO_PLL_CONFIG_BYPASS_LSB) & AUDIO_PLL_CONFIG_BYPASS_MASK) -#define AUDIO_PLL_CONFIG_REFDIV_MSB 3 -#define AUDIO_PLL_CONFIG_REFDIV_LSB 0 -#define AUDIO_PLL_CONFIG_REFDIV_MASK 0x0000000f -#define AUDIO_PLL_CONFIG_REFDIV_GET(x) (((x) & AUDIO_PLL_CONFIG_REFDIV_MASK) >> AUDIO_PLL_CONFIG_REFDIV_LSB) -#define AUDIO_PLL_CONFIG_REFDIV_SET(x) (((x) << AUDIO_PLL_CONFIG_REFDIV_LSB) & AUDIO_PLL_CONFIG_REFDIV_MASK) - -#define AUDIO_PLL_MODULATION_ADDRESS 0x000002f4 -#define AUDIO_PLL_MODULATION_OFFSET 0x000002f4 -#define AUDIO_PLL_MODULATION_TGT_DIV_FRAC_MSB 28 -#define AUDIO_PLL_MODULATION_TGT_DIV_FRAC_LSB 11 -#define AUDIO_PLL_MODULATION_TGT_DIV_FRAC_MASK 0x1ffff800 -#define AUDIO_PLL_MODULATION_TGT_DIV_FRAC_GET(x) (((x) & AUDIO_PLL_MODULATION_TGT_DIV_FRAC_MASK) >> AUDIO_PLL_MODULATION_TGT_DIV_FRAC_LSB) -#define AUDIO_PLL_MODULATION_TGT_DIV_FRAC_SET(x) (((x) << AUDIO_PLL_MODULATION_TGT_DIV_FRAC_LSB) & AUDIO_PLL_MODULATION_TGT_DIV_FRAC_MASK) -#define AUDIO_PLL_MODULATION_TGT_DIV_INT_MSB 6 -#define AUDIO_PLL_MODULATION_TGT_DIV_INT_LSB 1 -#define AUDIO_PLL_MODULATION_TGT_DIV_INT_MASK 0x0000007e -#define AUDIO_PLL_MODULATION_TGT_DIV_INT_GET(x) (((x) & AUDIO_PLL_MODULATION_TGT_DIV_INT_MASK) >> AUDIO_PLL_MODULATION_TGT_DIV_INT_LSB) -#define AUDIO_PLL_MODULATION_TGT_DIV_INT_SET(x) (((x) << AUDIO_PLL_MODULATION_TGT_DIV_INT_LSB) & AUDIO_PLL_MODULATION_TGT_DIV_INT_MASK) -#define AUDIO_PLL_MODULATION_START_MSB 0 -#define AUDIO_PLL_MODULATION_START_LSB 0 -#define AUDIO_PLL_MODULATION_START_MASK 0x00000001 -#define AUDIO_PLL_MODULATION_START_GET(x) (((x) & AUDIO_PLL_MODULATION_START_MASK) >> AUDIO_PLL_MODULATION_START_LSB) -#define AUDIO_PLL_MODULATION_START_SET(x) (((x) << AUDIO_PLL_MODULATION_START_LSB) & AUDIO_PLL_MODULATION_START_MASK) - -#define AUDIO_PLL_MOD_STEP_ADDRESS 0x000002f8 -#define AUDIO_PLL_MOD_STEP_OFFSET 0x000002f8 -#define AUDIO_PLL_MOD_STEP_FRAC_MSB 31 -#define AUDIO_PLL_MOD_STEP_FRAC_LSB 14 -#define AUDIO_PLL_MOD_STEP_FRAC_MASK 0xffffc000 -#define AUDIO_PLL_MOD_STEP_FRAC_GET(x) (((x) & AUDIO_PLL_MOD_STEP_FRAC_MASK) >> AUDIO_PLL_MOD_STEP_FRAC_LSB) -#define AUDIO_PLL_MOD_STEP_FRAC_SET(x) (((x) << AUDIO_PLL_MOD_STEP_FRAC_LSB) & AUDIO_PLL_MOD_STEP_FRAC_MASK) -#define AUDIO_PLL_MOD_STEP_INT_MSB 13 -#define AUDIO_PLL_MOD_STEP_INT_LSB 4 -#define AUDIO_PLL_MOD_STEP_INT_MASK 0x00003ff0 -#define AUDIO_PLL_MOD_STEP_INT_GET(x) (((x) & AUDIO_PLL_MOD_STEP_INT_MASK) >> AUDIO_PLL_MOD_STEP_INT_LSB) -#define AUDIO_PLL_MOD_STEP_INT_SET(x) (((x) << AUDIO_PLL_MOD_STEP_INT_LSB) & AUDIO_PLL_MOD_STEP_INT_MASK) -#define AUDIO_PLL_MOD_STEP_UPDATE_CNT_MSB 3 -#define AUDIO_PLL_MOD_STEP_UPDATE_CNT_LSB 0 -#define AUDIO_PLL_MOD_STEP_UPDATE_CNT_MASK 0x0000000f -#define AUDIO_PLL_MOD_STEP_UPDATE_CNT_GET(x) (((x) & AUDIO_PLL_MOD_STEP_UPDATE_CNT_MASK) >> AUDIO_PLL_MOD_STEP_UPDATE_CNT_LSB) -#define AUDIO_PLL_MOD_STEP_UPDATE_CNT_SET(x) (((x) << AUDIO_PLL_MOD_STEP_UPDATE_CNT_LSB) & AUDIO_PLL_MOD_STEP_UPDATE_CNT_MASK) - -#define CURRENT_AUDIO_PLL_MODULATION_ADDRESS 0x000002fc -#define CURRENT_AUDIO_PLL_MODULATION_OFFSET 0x000002fc -#define CURRENT_AUDIO_PLL_MODULATION_FRAC_MSB 27 -#define CURRENT_AUDIO_PLL_MODULATION_FRAC_LSB 10 -#define CURRENT_AUDIO_PLL_MODULATION_FRAC_MASK 0x0ffffc00 -#define CURRENT_AUDIO_PLL_MODULATION_FRAC_GET(x) (((x) & CURRENT_AUDIO_PLL_MODULATION_FRAC_MASK) >> CURRENT_AUDIO_PLL_MODULATION_FRAC_LSB) -#define CURRENT_AUDIO_PLL_MODULATION_FRAC_SET(x) (((x) << CURRENT_AUDIO_PLL_MODULATION_FRAC_LSB) & CURRENT_AUDIO_PLL_MODULATION_FRAC_MASK) -#define CURRENT_AUDIO_PLL_MODULATION_INT_MSB 6 -#define CURRENT_AUDIO_PLL_MODULATION_INT_LSB 1 -#define CURRENT_AUDIO_PLL_MODULATION_INT_MASK 0x0000007e -#define CURRENT_AUDIO_PLL_MODULATION_INT_GET(x) (((x) & CURRENT_AUDIO_PLL_MODULATION_INT_MASK) >> CURRENT_AUDIO_PLL_MODULATION_INT_LSB) -#define CURRENT_AUDIO_PLL_MODULATION_INT_SET(x) (((x) << CURRENT_AUDIO_PLL_MODULATION_INT_LSB) & CURRENT_AUDIO_PLL_MODULATION_INT_MASK) - -#define ETH_PLL_CONFIG_ADDRESS 0x00000300 -#define ETH_PLL_CONFIG_OFFSET 0x00000300 -#define ETH_PLL_CONFIG_GE0_MASTER_MSB 30 -#define ETH_PLL_CONFIG_GE0_MASTER_LSB 30 -#define ETH_PLL_CONFIG_GE0_MASTER_MASK 0x40000000 -#define ETH_PLL_CONFIG_GE0_MASTER_GET(x) (((x) & ETH_PLL_CONFIG_GE0_MASTER_MASK) >> ETH_PLL_CONFIG_GE0_MASTER_LSB) -#define ETH_PLL_CONFIG_GE0_MASTER_SET(x) (((x) << ETH_PLL_CONFIG_GE0_MASTER_LSB) & ETH_PLL_CONFIG_GE0_MASTER_MASK) -#define ETH_PLL_CONFIG_GE0_MSB 29 -#define ETH_PLL_CONFIG_GE0_LSB 29 -#define ETH_PLL_CONFIG_GE0_MASK 0x20000000 -#define ETH_PLL_CONFIG_GE0_GET(x) (((x) & ETH_PLL_CONFIG_GE0_MASK) >> ETH_PLL_CONFIG_GE0_LSB) -#define ETH_PLL_CONFIG_GE0_SET(x) (((x) << ETH_PLL_CONFIG_GE0_LSB) & ETH_PLL_CONFIG_GE0_MASK) -#define ETH_PLL_CONFIG_RANGE_MSB 28 -#define ETH_PLL_CONFIG_RANGE_LSB 28 -#define ETH_PLL_CONFIG_RANGE_MASK 0x10000000 -#define ETH_PLL_CONFIG_RANGE_GET(x) (((x) & ETH_PLL_CONFIG_RANGE_MASK) >> ETH_PLL_CONFIG_RANGE_LSB) -#define ETH_PLL_CONFIG_RANGE_SET(x) (((x) << ETH_PLL_CONFIG_RANGE_LSB) & ETH_PLL_CONFIG_RANGE_MASK) -#define ETH_PLL_CONFIG_FRAC_MSB 27 -#define ETH_PLL_CONFIG_FRAC_LSB 18 -#define ETH_PLL_CONFIG_FRAC_MASK 0x0ffc0000 -#define ETH_PLL_CONFIG_FRAC_GET(x) (((x) & ETH_PLL_CONFIG_FRAC_MASK) >> ETH_PLL_CONFIG_FRAC_LSB) -#define ETH_PLL_CONFIG_FRAC_SET(x) (((x) << ETH_PLL_CONFIG_FRAC_LSB) & ETH_PLL_CONFIG_FRAC_MASK) -#define ETH_PLL_CONFIG_INT_MSB 17 -#define ETH_PLL_CONFIG_INT_LSB 12 -#define ETH_PLL_CONFIG_INT_MASK 0x0003f000 -#define ETH_PLL_CONFIG_INT_GET(x) (((x) & ETH_PLL_CONFIG_INT_MASK) >> ETH_PLL_CONFIG_INT_LSB) -#define ETH_PLL_CONFIG_INT_SET(x) (((x) << ETH_PLL_CONFIG_INT_LSB) & ETH_PLL_CONFIG_INT_MASK) -#define ETH_PLL_CONFIG_OUTDIV_MSB 9 -#define ETH_PLL_CONFIG_OUTDIV_LSB 7 -#define ETH_PLL_CONFIG_OUTDIV_MASK 0x00000380 -#define ETH_PLL_CONFIG_OUTDIV_GET(x) (((x) & ETH_PLL_CONFIG_OUTDIV_MASK) >> ETH_PLL_CONFIG_OUTDIV_LSB) -#define ETH_PLL_CONFIG_OUTDIV_SET(x) (((x) << ETH_PLL_CONFIG_OUTDIV_LSB) & ETH_PLL_CONFIG_OUTDIV_MASK) -#define ETH_PLL_CONFIG_PLLPWD_MSB 6 -#define ETH_PLL_CONFIG_PLLPWD_LSB 6 -#define ETH_PLL_CONFIG_PLLPWD_MASK 0x00000040 -#define ETH_PLL_CONFIG_PLLPWD_GET(x) (((x) & ETH_PLL_CONFIG_PLLPWD_MASK) >> ETH_PLL_CONFIG_PLLPWD_LSB) -#define ETH_PLL_CONFIG_PLLPWD_SET(x) (((x) << ETH_PLL_CONFIG_PLLPWD_LSB) & ETH_PLL_CONFIG_PLLPWD_MASK) -#define ETH_PLL_CONFIG_BYPASS_MSB 5 -#define ETH_PLL_CONFIG_BYPASS_LSB 5 -#define ETH_PLL_CONFIG_BYPASS_MASK 0x00000020 -#define ETH_PLL_CONFIG_BYPASS_GET(x) (((x) & ETH_PLL_CONFIG_BYPASS_MASK) >> ETH_PLL_CONFIG_BYPASS_LSB) -#define ETH_PLL_CONFIG_BYPASS_SET(x) (((x) << ETH_PLL_CONFIG_BYPASS_LSB) & ETH_PLL_CONFIG_BYPASS_MASK) -#define ETH_PLL_CONFIG_REFDIV_MSB 4 -#define ETH_PLL_CONFIG_REFDIV_LSB 0 -#define ETH_PLL_CONFIG_REFDIV_MASK 0x0000001f -#define ETH_PLL_CONFIG_REFDIV_GET(x) (((x) & ETH_PLL_CONFIG_REFDIV_MASK) >> ETH_PLL_CONFIG_REFDIV_LSB) -#define ETH_PLL_CONFIG_REFDIV_SET(x) (((x) << ETH_PLL_CONFIG_REFDIV_LSB) & ETH_PLL_CONFIG_REFDIV_MASK) - -#define CPU_PLL_CONFIG_ADDRESS 0x00000304 -#define CPU_PLL_CONFIG_OFFSET 0x00000304 -#define CPU_PLL_CONFIG_RANGE_MSB 28 -#define CPU_PLL_CONFIG_RANGE_LSB 28 -#define CPU_PLL_CONFIG_RANGE_MASK 0x10000000 -#define CPU_PLL_CONFIG_RANGE_GET(x) (((x) & CPU_PLL_CONFIG_RANGE_MASK) >> CPU_PLL_CONFIG_RANGE_LSB) -#define CPU_PLL_CONFIG_RANGE_SET(x) (((x) << CPU_PLL_CONFIG_RANGE_LSB) & CPU_PLL_CONFIG_RANGE_MASK) -#define CPU_PLL_CONFIG_FRAC_MSB 25 -#define CPU_PLL_CONFIG_FRAC_LSB 20 -#define CPU_PLL_CONFIG_FRAC_MASK 0x03f00000 -#define CPU_PLL_CONFIG_FRAC_GET(x) (((x) & CPU_PLL_CONFIG_FRAC_MASK) >> CPU_PLL_CONFIG_FRAC_LSB) -#define CPU_PLL_CONFIG_FRAC_SET(x) (((x) << CPU_PLL_CONFIG_FRAC_LSB) & CPU_PLL_CONFIG_FRAC_MASK) -#define CPU_PLL_CONFIG_INT_MSB 17 -#define CPU_PLL_CONFIG_INT_LSB 12 -#define CPU_PLL_CONFIG_INT_MASK 0x0003f000 -#define CPU_PLL_CONFIG_INT_GET(x) (((x) & CPU_PLL_CONFIG_INT_MASK) >> CPU_PLL_CONFIG_INT_LSB) -#define CPU_PLL_CONFIG_INT_SET(x) (((x) << CPU_PLL_CONFIG_INT_LSB) & CPU_PLL_CONFIG_INT_MASK) -#define CPU_PLL_CONFIG_OUTDIV_MSB 9 -#define CPU_PLL_CONFIG_OUTDIV_LSB 7 -#define CPU_PLL_CONFIG_OUTDIV_MASK 0x00000380 -#define CPU_PLL_CONFIG_OUTDIV_GET(x) (((x) & CPU_PLL_CONFIG_OUTDIV_MASK) >> CPU_PLL_CONFIG_OUTDIV_LSB) -#define CPU_PLL_CONFIG_OUTDIV_SET(x) (((x) << CPU_PLL_CONFIG_OUTDIV_LSB) & CPU_PLL_CONFIG_OUTDIV_MASK) -#define CPU_PLL_CONFIG_PLLPWD_MSB 6 -#define CPU_PLL_CONFIG_PLLPWD_LSB 6 -#define CPU_PLL_CONFIG_PLLPWD_MASK 0x00000040 -#define CPU_PLL_CONFIG_PLLPWD_GET(x) (((x) & CPU_PLL_CONFIG_PLLPWD_MASK) >> CPU_PLL_CONFIG_PLLPWD_LSB) -#define CPU_PLL_CONFIG_PLLPWD_SET(x) (((x) << CPU_PLL_CONFIG_PLLPWD_LSB) & CPU_PLL_CONFIG_PLLPWD_MASK) -#define CPU_PLL_CONFIG_REFDIV_MSB 4 -#define CPU_PLL_CONFIG_REFDIV_LSB 0 -#define CPU_PLL_CONFIG_REFDIV_MASK 0x0000001f -#define CPU_PLL_CONFIG_REFDIV_GET(x) (((x) & CPU_PLL_CONFIG_REFDIV_MASK) >> CPU_PLL_CONFIG_REFDIV_LSB) -#define CPU_PLL_CONFIG_REFDIV_SET(x) (((x) << CPU_PLL_CONFIG_REFDIV_LSB) & CPU_PLL_CONFIG_REFDIV_MASK) - -#define BB_PLL_CONFIG_ADDRESS 0x00000308 -#define BB_PLL_CONFIG_OFFSET 0x00000308 -#define BB_PLL_CONFIG_FRAC_MSB 17 -#define BB_PLL_CONFIG_FRAC_LSB 0 -#define BB_PLL_CONFIG_FRAC_MASK 0x0003ffff -#define BB_PLL_CONFIG_FRAC_GET(x) (((x) & BB_PLL_CONFIG_FRAC_MASK) >> BB_PLL_CONFIG_FRAC_LSB) -#define BB_PLL_CONFIG_FRAC_SET(x) (((x) << BB_PLL_CONFIG_FRAC_LSB) & BB_PLL_CONFIG_FRAC_MASK) - -#define ETH_XMII_ADDRESS 0x0000030c -#define ETH_XMII_OFFSET 0x0000030c -#define ETH_XMII_TX_INVERT_MSB 31 -#define ETH_XMII_TX_INVERT_LSB 31 -#define ETH_XMII_TX_INVERT_MASK 0x80000000 -#define ETH_XMII_TX_INVERT_GET(x) (((x) & ETH_XMII_TX_INVERT_MASK) >> ETH_XMII_TX_INVERT_LSB) -#define ETH_XMII_TX_INVERT_SET(x) (((x) << ETH_XMII_TX_INVERT_LSB) & ETH_XMII_TX_INVERT_MASK) -#define ETH_XMII_GIGE_QUAD_MSB 30 -#define ETH_XMII_GIGE_QUAD_LSB 30 -#define ETH_XMII_GIGE_QUAD_MASK 0x40000000 -#define ETH_XMII_GIGE_QUAD_GET(x) (((x) & ETH_XMII_GIGE_QUAD_MASK) >> ETH_XMII_GIGE_QUAD_LSB) -#define ETH_XMII_GIGE_QUAD_SET(x) (((x) << ETH_XMII_GIGE_QUAD_LSB) & ETH_XMII_GIGE_QUAD_MASK) -#define ETH_XMII_RX_DELAY_MSB 29 -#define ETH_XMII_RX_DELAY_LSB 28 -#define ETH_XMII_RX_DELAY_MASK 0x30000000 -#define ETH_XMII_RX_DELAY_GET(x) (((x) & ETH_XMII_RX_DELAY_MASK) >> ETH_XMII_RX_DELAY_LSB) -#define ETH_XMII_RX_DELAY_SET(x) (((x) << ETH_XMII_RX_DELAY_LSB) & ETH_XMII_RX_DELAY_MASK) -#define ETH_XMII_TX_DELAY_MSB 27 -#define ETH_XMII_TX_DELAY_LSB 26 -#define ETH_XMII_TX_DELAY_MASK 0x0c000000 -#define ETH_XMII_TX_DELAY_GET(x) (((x) & ETH_XMII_TX_DELAY_MASK) >> ETH_XMII_TX_DELAY_LSB) -#define ETH_XMII_TX_DELAY_SET(x) (((x) << ETH_XMII_TX_DELAY_LSB) & ETH_XMII_TX_DELAY_MASK) -#define ETH_XMII_GIGE_MSB 25 -#define ETH_XMII_GIGE_LSB 25 -#define ETH_XMII_GIGE_MASK 0x02000000 -#define ETH_XMII_GIGE_GET(x) (((x) & ETH_XMII_GIGE_MASK) >> ETH_XMII_GIGE_LSB) -#define ETH_XMII_GIGE_SET(x) (((x) << ETH_XMII_GIGE_LSB) & ETH_XMII_GIGE_MASK) -#define ETH_XMII_OFFSET_PHASE_MSB 24 -#define ETH_XMII_OFFSET_PHASE_LSB 24 -#define ETH_XMII_OFFSET_PHASE_MASK 0x01000000 -#define ETH_XMII_OFFSET_PHASE_GET(x) (((x) & ETH_XMII_OFFSET_PHASE_MASK) >> ETH_XMII_OFFSET_PHASE_LSB) -#define ETH_XMII_OFFSET_PHASE_SET(x) (((x) << ETH_XMII_OFFSET_PHASE_LSB) & ETH_XMII_OFFSET_PHASE_MASK) -#define ETH_XMII_OFFSET_COUNT_MSB 23 -#define ETH_XMII_OFFSET_COUNT_LSB 16 -#define ETH_XMII_OFFSET_COUNT_MASK 0x00ff0000 -#define ETH_XMII_OFFSET_COUNT_GET(x) (((x) & ETH_XMII_OFFSET_COUNT_MASK) >> ETH_XMII_OFFSET_COUNT_LSB) -#define ETH_XMII_OFFSET_COUNT_SET(x) (((x) << ETH_XMII_OFFSET_COUNT_LSB) & ETH_XMII_OFFSET_COUNT_MASK) -#define ETH_XMII_PHASE1_COUNT_MSB 15 -#define ETH_XMII_PHASE1_COUNT_LSB 8 -#define ETH_XMII_PHASE1_COUNT_MASK 0x0000ff00 -#define ETH_XMII_PHASE1_COUNT_GET(x) (((x) & ETH_XMII_PHASE1_COUNT_MASK) >> ETH_XMII_PHASE1_COUNT_LSB) -#define ETH_XMII_PHASE1_COUNT_SET(x) (((x) << ETH_XMII_PHASE1_COUNT_LSB) & ETH_XMII_PHASE1_COUNT_MASK) -#define ETH_XMII_PHASE0_COUNT_MSB 7 -#define ETH_XMII_PHASE0_COUNT_LSB 0 -#define ETH_XMII_PHASE0_COUNT_MASK 0x000000ff -#define ETH_XMII_PHASE0_COUNT_GET(x) (((x) & ETH_XMII_PHASE0_COUNT_MASK) >> ETH_XMII_PHASE0_COUNT_LSB) -#define ETH_XMII_PHASE0_COUNT_SET(x) (((x) << ETH_XMII_PHASE0_COUNT_LSB) & ETH_XMII_PHASE0_COUNT_MASK) - -#define USB_PHY_CONFIG_ADDRESS 0x00000310 -#define USB_PHY_CONFIG_OFFSET 0x00000310 -#define USB_PHY_CONFIG_REFCLK_SEL_MSB 7 -#define USB_PHY_CONFIG_REFCLK_SEL_LSB 4 -#define USB_PHY_CONFIG_REFCLK_SEL_MASK 0x000000f0 -#define USB_PHY_CONFIG_REFCLK_SEL_GET(x) (((x) & USB_PHY_CONFIG_REFCLK_SEL_MASK) >> USB_PHY_CONFIG_REFCLK_SEL_LSB) -#define USB_PHY_CONFIG_REFCLK_SEL_SET(x) (((x) << USB_PHY_CONFIG_REFCLK_SEL_LSB) & USB_PHY_CONFIG_REFCLK_SEL_MASK) -#define USB_PHY_CONFIG_REFDIV_MSB 3 -#define USB_PHY_CONFIG_REFDIV_LSB 3 -#define USB_PHY_CONFIG_REFDIV_MASK 0x00000008 -#define USB_PHY_CONFIG_REFDIV_GET(x) (((x) & USB_PHY_CONFIG_REFDIV_MASK) >> USB_PHY_CONFIG_REFDIV_LSB) -#define USB_PHY_CONFIG_REFDIV_SET(x) (((x) << USB_PHY_CONFIG_REFDIV_LSB) & USB_PHY_CONFIG_REFDIV_MASK) -#define USB_PHY_CONFIG_TESTMODE_MSB 2 -#define USB_PHY_CONFIG_TESTMODE_LSB 2 -#define USB_PHY_CONFIG_TESTMODE_MASK 0x00000004 -#define USB_PHY_CONFIG_TESTMODE_GET(x) (((x) & USB_PHY_CONFIG_TESTMODE_MASK) >> USB_PHY_CONFIG_TESTMODE_LSB) -#define USB_PHY_CONFIG_TESTMODE_SET(x) (((x) << USB_PHY_CONFIG_TESTMODE_LSB) & USB_PHY_CONFIG_TESTMODE_MASK) -#define USB_PHY_CONFIG_PLL_PWD_MSB 1 -#define USB_PHY_CONFIG_PLL_PWD_LSB 1 -#define USB_PHY_CONFIG_PLL_PWD_MASK 0x00000002 -#define USB_PHY_CONFIG_PLL_PWD_GET(x) (((x) & USB_PHY_CONFIG_PLL_PWD_MASK) >> USB_PHY_CONFIG_PLL_PWD_LSB) -#define USB_PHY_CONFIG_PLL_PWD_SET(x) (((x) << USB_PHY_CONFIG_PLL_PWD_LSB) & USB_PHY_CONFIG_PLL_PWD_MASK) -#define USB_PHY_CONFIG_HOSTMODE_MSB 0 -#define USB_PHY_CONFIG_HOSTMODE_LSB 0 -#define USB_PHY_CONFIG_HOSTMODE_MASK 0x00000001 -#define USB_PHY_CONFIG_HOSTMODE_GET(x) (((x) & USB_PHY_CONFIG_HOSTMODE_MASK) >> USB_PHY_CONFIG_HOSTMODE_LSB) -#define USB_PHY_CONFIG_HOSTMODE_SET(x) (((x) << USB_PHY_CONFIG_HOSTMODE_LSB) & USB_PHY_CONFIG_HOSTMODE_MASK) - -#define MITSUMI_INT_CONTROL_REG_ADDRESS 0x00000314 -#define MITSUMI_INT_CONTROL_REG_OFFSET 0x00000314 -#define MITSUMI_INT_CONTROL_REG_FLIGHT_MODE_EN_MSB 3 -#define MITSUMI_INT_CONTROL_REG_FLIGHT_MODE_EN_LSB 3 -#define MITSUMI_INT_CONTROL_REG_FLIGHT_MODE_EN_MASK 0x00000008 -#define MITSUMI_INT_CONTROL_REG_FLIGHT_MODE_EN_GET(x) (((x) & MITSUMI_INT_CONTROL_REG_FLIGHT_MODE_EN_MASK) >> MITSUMI_INT_CONTROL_REG_FLIGHT_MODE_EN_LSB) -#define MITSUMI_INT_CONTROL_REG_FLIGHT_MODE_EN_SET(x) (((x) << MITSUMI_INT_CONTROL_REG_FLIGHT_MODE_EN_LSB) & MITSUMI_INT_CONTROL_REG_FLIGHT_MODE_EN_MASK) -#define MITSUMI_INT_CONTROL_REG_BBP_SLEEP_EN_MSB 2 -#define MITSUMI_INT_CONTROL_REG_BBP_SLEEP_EN_LSB 2 -#define MITSUMI_INT_CONTROL_REG_BBP_SLEEP_EN_MASK 0x00000004 -#define MITSUMI_INT_CONTROL_REG_BBP_SLEEP_EN_GET(x) (((x) & MITSUMI_INT_CONTROL_REG_BBP_SLEEP_EN_MASK) >> MITSUMI_INT_CONTROL_REG_BBP_SLEEP_EN_LSB) -#define MITSUMI_INT_CONTROL_REG_BBP_SLEEP_EN_SET(x) (((x) << MITSUMI_INT_CONTROL_REG_BBP_SLEEP_EN_LSB) & MITSUMI_INT_CONTROL_REG_BBP_SLEEP_EN_MASK) -#define MITSUMI_INT_CONTROL_REG_RF_SLEEP_EN_MSB 1 -#define MITSUMI_INT_CONTROL_REG_RF_SLEEP_EN_LSB 1 -#define MITSUMI_INT_CONTROL_REG_RF_SLEEP_EN_MASK 0x00000002 -#define MITSUMI_INT_CONTROL_REG_RF_SLEEP_EN_GET(x) (((x) & MITSUMI_INT_CONTROL_REG_RF_SLEEP_EN_MASK) >> MITSUMI_INT_CONTROL_REG_RF_SLEEP_EN_LSB) -#define MITSUMI_INT_CONTROL_REG_RF_SLEEP_EN_SET(x) (((x) << MITSUMI_INT_CONTROL_REG_RF_SLEEP_EN_LSB) & MITSUMI_INT_CONTROL_REG_RF_SLEEP_EN_MASK) -#define MITSUMI_INT_CONTROL_REG_MODE_SWITCH_EN_MSB 0 -#define MITSUMI_INT_CONTROL_REG_MODE_SWITCH_EN_LSB 0 -#define MITSUMI_INT_CONTROL_REG_MODE_SWITCH_EN_MASK 0x00000001 -#define MITSUMI_INT_CONTROL_REG_MODE_SWITCH_EN_GET(x) (((x) & MITSUMI_INT_CONTROL_REG_MODE_SWITCH_EN_MASK) >> MITSUMI_INT_CONTROL_REG_MODE_SWITCH_EN_LSB) -#define MITSUMI_INT_CONTROL_REG_MODE_SWITCH_EN_SET(x) (((x) << MITSUMI_INT_CONTROL_REG_MODE_SWITCH_EN_LSB) & MITSUMI_INT_CONTROL_REG_MODE_SWITCH_EN_MASK) - -#define MITSUMI_INT_STATUS_REG_ADDRESS 0x00000318 -#define MITSUMI_INT_STATUS_REG_OFFSET 0x00000318 -#define MITSUMI_INT_STATUS_REG_FLIGHT_MODE_INT_MSB 3 -#define MITSUMI_INT_STATUS_REG_FLIGHT_MODE_INT_LSB 3 -#define MITSUMI_INT_STATUS_REG_FLIGHT_MODE_INT_MASK 0x00000008 -#define MITSUMI_INT_STATUS_REG_FLIGHT_MODE_INT_GET(x) (((x) & MITSUMI_INT_STATUS_REG_FLIGHT_MODE_INT_MASK) >> MITSUMI_INT_STATUS_REG_FLIGHT_MODE_INT_LSB) -#define MITSUMI_INT_STATUS_REG_FLIGHT_MODE_INT_SET(x) (((x) << MITSUMI_INT_STATUS_REG_FLIGHT_MODE_INT_LSB) & MITSUMI_INT_STATUS_REG_FLIGHT_MODE_INT_MASK) -#define MITSUMI_INT_STATUS_REG_BBP_SLEEP_INT_MSB 2 -#define MITSUMI_INT_STATUS_REG_BBP_SLEEP_INT_LSB 2 -#define MITSUMI_INT_STATUS_REG_BBP_SLEEP_INT_MASK 0x00000004 -#define MITSUMI_INT_STATUS_REG_BBP_SLEEP_INT_GET(x) (((x) & MITSUMI_INT_STATUS_REG_BBP_SLEEP_INT_MASK) >> MITSUMI_INT_STATUS_REG_BBP_SLEEP_INT_LSB) -#define MITSUMI_INT_STATUS_REG_BBP_SLEEP_INT_SET(x) (((x) << MITSUMI_INT_STATUS_REG_BBP_SLEEP_INT_LSB) & MITSUMI_INT_STATUS_REG_BBP_SLEEP_INT_MASK) -#define MITSUMI_INT_STATUS_REG_RF_SLEEP_INT_MSB 1 -#define MITSUMI_INT_STATUS_REG_RF_SLEEP_INT_LSB 1 -#define MITSUMI_INT_STATUS_REG_RF_SLEEP_INT_MASK 0x00000002 -#define MITSUMI_INT_STATUS_REG_RF_SLEEP_INT_GET(x) (((x) & MITSUMI_INT_STATUS_REG_RF_SLEEP_INT_MASK) >> MITSUMI_INT_STATUS_REG_RF_SLEEP_INT_LSB) -#define MITSUMI_INT_STATUS_REG_RF_SLEEP_INT_SET(x) (((x) << MITSUMI_INT_STATUS_REG_RF_SLEEP_INT_LSB) & MITSUMI_INT_STATUS_REG_RF_SLEEP_INT_MASK) -#define MITSUMI_INT_STATUS_REG_MODE_SWITCH_INT_MSB 0 -#define MITSUMI_INT_STATUS_REG_MODE_SWITCH_INT_LSB 0 -#define MITSUMI_INT_STATUS_REG_MODE_SWITCH_INT_MASK 0x00000001 -#define MITSUMI_INT_STATUS_REG_MODE_SWITCH_INT_GET(x) (((x) & MITSUMI_INT_STATUS_REG_MODE_SWITCH_INT_MASK) >> MITSUMI_INT_STATUS_REG_MODE_SWITCH_INT_LSB) -#define MITSUMI_INT_STATUS_REG_MODE_SWITCH_INT_SET(x) (((x) << MITSUMI_INT_STATUS_REG_MODE_SWITCH_INT_LSB) & MITSUMI_INT_STATUS_REG_MODE_SWITCH_INT_MASK) - -#define CURRENT_WORKING_MODE_ADDRESS 0x0000031c -#define CURRENT_WORKING_MODE_OFFSET 0x0000031c -#define CURRENT_WORKING_MODE_MIT_FORCE_ACTIVE_ON_MSB 5 -#define CURRENT_WORKING_MODE_MIT_FORCE_ACTIVE_ON_LSB 5 -#define CURRENT_WORKING_MODE_MIT_FORCE_ACTIVE_ON_MASK 0x00000020 -#define CURRENT_WORKING_MODE_MIT_FORCE_ACTIVE_ON_GET(x) (((x) & CURRENT_WORKING_MODE_MIT_FORCE_ACTIVE_ON_MASK) >> CURRENT_WORKING_MODE_MIT_FORCE_ACTIVE_ON_LSB) -#define CURRENT_WORKING_MODE_MIT_FORCE_ACTIVE_ON_SET(x) (((x) << CURRENT_WORKING_MODE_MIT_FORCE_ACTIVE_ON_LSB) & CURRENT_WORKING_MODE_MIT_FORCE_ACTIVE_ON_MASK) -#define CURRENT_WORKING_MODE_MIT_REG_WR_TRIGGER_EN_MSB 2 -#define CURRENT_WORKING_MODE_MIT_REG_WR_TRIGGER_EN_LSB 2 -#define CURRENT_WORKING_MODE_MIT_REG_WR_TRIGGER_EN_MASK 0x00000004 -#define CURRENT_WORKING_MODE_MIT_REG_WR_TRIGGER_EN_GET(x) (((x) & CURRENT_WORKING_MODE_MIT_REG_WR_TRIGGER_EN_MASK) >> CURRENT_WORKING_MODE_MIT_REG_WR_TRIGGER_EN_LSB) -#define CURRENT_WORKING_MODE_MIT_REG_WR_TRIGGER_EN_SET(x) (((x) << CURRENT_WORKING_MODE_MIT_REG_WR_TRIGGER_EN_LSB) & CURRENT_WORKING_MODE_MIT_REG_WR_TRIGGER_EN_MASK) -#define CURRENT_WORKING_MODE_NOT_FIRST_MIT_MODE_MSB 1 -#define CURRENT_WORKING_MODE_NOT_FIRST_MIT_MODE_LSB 1 -#define CURRENT_WORKING_MODE_NOT_FIRST_MIT_MODE_MASK 0x00000002 -#define CURRENT_WORKING_MODE_NOT_FIRST_MIT_MODE_GET(x) (((x) & CURRENT_WORKING_MODE_NOT_FIRST_MIT_MODE_MASK) >> CURRENT_WORKING_MODE_NOT_FIRST_MIT_MODE_LSB) -#define CURRENT_WORKING_MODE_NOT_FIRST_MIT_MODE_SET(x) (((x) << CURRENT_WORKING_MODE_NOT_FIRST_MIT_MODE_LSB) & CURRENT_WORKING_MODE_NOT_FIRST_MIT_MODE_MASK) -#define CURRENT_WORKING_MODE_VALUE_MSB 0 -#define CURRENT_WORKING_MODE_VALUE_LSB 0 -#define CURRENT_WORKING_MODE_VALUE_MASK 0x00000001 -#define CURRENT_WORKING_MODE_VALUE_GET(x) (((x) & CURRENT_WORKING_MODE_VALUE_MASK) >> CURRENT_WORKING_MODE_VALUE_LSB) -#define CURRENT_WORKING_MODE_VALUE_SET(x) (((x) << CURRENT_WORKING_MODE_VALUE_LSB) & CURRENT_WORKING_MODE_VALUE_MASK) - -#define RTC_SLEEP_COUNT_ADDRESS 0x00000320 -#define RTC_SLEEP_COUNT_OFFSET 0x00000320 -#define RTC_SLEEP_COUNT_THRESHOLD_MSB 5 -#define RTC_SLEEP_COUNT_THRESHOLD_LSB 0 -#define RTC_SLEEP_COUNT_THRESHOLD_MASK 0x0000003f -#define RTC_SLEEP_COUNT_THRESHOLD_GET(x) (((x) & RTC_SLEEP_COUNT_THRESHOLD_MASK) >> RTC_SLEEP_COUNT_THRESHOLD_LSB) -#define RTC_SLEEP_COUNT_THRESHOLD_SET(x) (((x) << RTC_SLEEP_COUNT_THRESHOLD_LSB) & RTC_SLEEP_COUNT_THRESHOLD_MASK) - -#define MIT2_VAP_ADDRESS 0x00000324 -#define MIT2_VAP_OFFSET 0x00000324 -#define MIT2_VAP_MODE_MSB 0 -#define MIT2_VAP_MODE_LSB 0 -#define MIT2_VAP_MODE_MASK 0x00000001 -#define MIT2_VAP_MODE_GET(x) (((x) & MIT2_VAP_MODE_MASK) >> MIT2_VAP_MODE_LSB) -#define MIT2_VAP_MODE_SET(x) (((x) << MIT2_VAP_MODE_LSB) & MIT2_VAP_MODE_MASK) - -#define SECOND_HOST_INFT_ADDRESS 0x00000328 -#define SECOND_HOST_INFT_OFFSET 0x00000328 -#define SECOND_HOST_INFT_SDIO_MODE_MSB 0 -#define SECOND_HOST_INFT_SDIO_MODE_LSB 0 -#define SECOND_HOST_INFT_SDIO_MODE_MASK 0x00000001 -#define SECOND_HOST_INFT_SDIO_MODE_GET(x) (((x) & SECOND_HOST_INFT_SDIO_MODE_MASK) >> SECOND_HOST_INFT_SDIO_MODE_LSB) -#define SECOND_HOST_INFT_SDIO_MODE_SET(x) (((x) << SECOND_HOST_INFT_SDIO_MODE_LSB) & SECOND_HOST_INFT_SDIO_MODE_MASK) - -#define SDIO_HOST_ADDRESS 0x0000032c -#define SDIO_HOST_OFFSET 0x0000032c -#define SDIO_HOST_RESET_MSB 0 -#define SDIO_HOST_RESET_LSB 0 -#define SDIO_HOST_RESET_MASK 0x00000001 -#define SDIO_HOST_RESET_GET(x) (((x) & SDIO_HOST_RESET_MASK) >> SDIO_HOST_RESET_LSB) -#define SDIO_HOST_RESET_SET(x) (((x) << SDIO_HOST_RESET_LSB) & SDIO_HOST_RESET_MASK) - -#define ENTERPRISE_CONFIG_ADDRESS 0x00000330 -#define ENTERPRISE_CONFIG_OFFSET 0x00000330 -#define ENTERPRISE_CONFIG_TPC_LOWER_PERFORMANCE_MSB 12 -#define ENTERPRISE_CONFIG_TPC_LOWER_PERFORMANCE_LSB 12 -#define ENTERPRISE_CONFIG_TPC_LOWER_PERFORMANCE_MASK 0x00001000 -#define ENTERPRISE_CONFIG_TPC_LOWER_PERFORMANCE_GET(x) (((x) & ENTERPRISE_CONFIG_TPC_LOWER_PERFORMANCE_MASK) >> ENTERPRISE_CONFIG_TPC_LOWER_PERFORMANCE_LSB) -#define ENTERPRISE_CONFIG_TPC_LOWER_PERFORMANCE_SET(x) (((x) << ENTERPRISE_CONFIG_TPC_LOWER_PERFORMANCE_LSB) & ENTERPRISE_CONFIG_TPC_LOWER_PERFORMANCE_MASK) -#define ENTERPRISE_CONFIG_SWCOM_IDLE_MODE_MSB 11 -#define ENTERPRISE_CONFIG_SWCOM_IDLE_MODE_LSB 11 -#define ENTERPRISE_CONFIG_SWCOM_IDLE_MODE_MASK 0x00000800 -#define ENTERPRISE_CONFIG_SWCOM_IDLE_MODE_GET(x) (((x) & ENTERPRISE_CONFIG_SWCOM_IDLE_MODE_MASK) >> ENTERPRISE_CONFIG_SWCOM_IDLE_MODE_LSB) -#define ENTERPRISE_CONFIG_SWCOM_IDLE_MODE_SET(x) (((x) << ENTERPRISE_CONFIG_SWCOM_IDLE_MODE_LSB) & ENTERPRISE_CONFIG_SWCOM_IDLE_MODE_MASK) -#define ENTERPRISE_CONFIG_STBC_DISABLE_MSB 10 -#define ENTERPRISE_CONFIG_STBC_DISABLE_LSB 10 -#define ENTERPRISE_CONFIG_STBC_DISABLE_MASK 0x00000400 -#define ENTERPRISE_CONFIG_STBC_DISABLE_GET(x) (((x) & ENTERPRISE_CONFIG_STBC_DISABLE_MASK) >> ENTERPRISE_CONFIG_STBC_DISABLE_LSB) -#define ENTERPRISE_CONFIG_STBC_DISABLE_SET(x) (((x) << ENTERPRISE_CONFIG_STBC_DISABLE_LSB) & ENTERPRISE_CONFIG_STBC_DISABLE_MASK) -#define ENTERPRISE_CONFIG_LDPC_DISABLE_MSB 9 -#define ENTERPRISE_CONFIG_LDPC_DISABLE_LSB 9 -#define ENTERPRISE_CONFIG_LDPC_DISABLE_MASK 0x00000200 -#define ENTERPRISE_CONFIG_LDPC_DISABLE_GET(x) (((x) & ENTERPRISE_CONFIG_LDPC_DISABLE_MASK) >> ENTERPRISE_CONFIG_LDPC_DISABLE_LSB) -#define ENTERPRISE_CONFIG_LDPC_DISABLE_SET(x) (((x) << ENTERPRISE_CONFIG_LDPC_DISABLE_LSB) & ENTERPRISE_CONFIG_LDPC_DISABLE_MASK) -#define ENTERPRISE_CONFIG_GREEN_TX_DISABLE_MSB 8 -#define ENTERPRISE_CONFIG_GREEN_TX_DISABLE_LSB 8 -#define ENTERPRISE_CONFIG_GREEN_TX_DISABLE_MASK 0x00000100 -#define ENTERPRISE_CONFIG_GREEN_TX_DISABLE_GET(x) (((x) & ENTERPRISE_CONFIG_GREEN_TX_DISABLE_MASK) >> ENTERPRISE_CONFIG_GREEN_TX_DISABLE_LSB) -#define ENTERPRISE_CONFIG_GREEN_TX_DISABLE_SET(x) (((x) << ENTERPRISE_CONFIG_GREEN_TX_DISABLE_LSB) & ENTERPRISE_CONFIG_GREEN_TX_DISABLE_MASK) -#define ENTERPRISE_CONFIG_DUAL_BAND_DISABLE_MSB 7 -#define ENTERPRISE_CONFIG_DUAL_BAND_DISABLE_LSB 7 -#define ENTERPRISE_CONFIG_DUAL_BAND_DISABLE_MASK 0x00000080 -#define ENTERPRISE_CONFIG_DUAL_BAND_DISABLE_GET(x) (((x) & ENTERPRISE_CONFIG_DUAL_BAND_DISABLE_MASK) >> ENTERPRISE_CONFIG_DUAL_BAND_DISABLE_LSB) -#define ENTERPRISE_CONFIG_DUAL_BAND_DISABLE_SET(x) (((x) << ENTERPRISE_CONFIG_DUAL_BAND_DISABLE_LSB) & ENTERPRISE_CONFIG_DUAL_BAND_DISABLE_MASK) -#define ENTERPRISE_CONFIG_CHAIN1_DISABLE_MSB 6 -#define ENTERPRISE_CONFIG_CHAIN1_DISABLE_LSB 6 -#define ENTERPRISE_CONFIG_CHAIN1_DISABLE_MASK 0x00000040 -#define ENTERPRISE_CONFIG_CHAIN1_DISABLE_GET(x) (((x) & ENTERPRISE_CONFIG_CHAIN1_DISABLE_MASK) >> ENTERPRISE_CONFIG_CHAIN1_DISABLE_LSB) -#define ENTERPRISE_CONFIG_CHAIN1_DISABLE_SET(x) (((x) << ENTERPRISE_CONFIG_CHAIN1_DISABLE_LSB) & ENTERPRISE_CONFIG_CHAIN1_DISABLE_MASK) -#define ENTERPRISE_CONFIG_CH_5MHZ_DISABLE_MSB 5 -#define ENTERPRISE_CONFIG_CH_5MHZ_DISABLE_LSB 5 -#define ENTERPRISE_CONFIG_CH_5MHZ_DISABLE_MASK 0x00000020 -#define ENTERPRISE_CONFIG_CH_5MHZ_DISABLE_GET(x) (((x) & ENTERPRISE_CONFIG_CH_5MHZ_DISABLE_MASK) >> ENTERPRISE_CONFIG_CH_5MHZ_DISABLE_LSB) -#define ENTERPRISE_CONFIG_CH_5MHZ_DISABLE_SET(x) (((x) << ENTERPRISE_CONFIG_CH_5MHZ_DISABLE_LSB) & ENTERPRISE_CONFIG_CH_5MHZ_DISABLE_MASK) -#define ENTERPRISE_CONFIG_CH_10MHZ_DISABLE_MSB 4 -#define ENTERPRISE_CONFIG_CH_10MHZ_DISABLE_LSB 4 -#define ENTERPRISE_CONFIG_CH_10MHZ_DISABLE_MASK 0x00000010 -#define ENTERPRISE_CONFIG_CH_10MHZ_DISABLE_GET(x) (((x) & ENTERPRISE_CONFIG_CH_10MHZ_DISABLE_MASK) >> ENTERPRISE_CONFIG_CH_10MHZ_DISABLE_LSB) -#define ENTERPRISE_CONFIG_CH_10MHZ_DISABLE_SET(x) (((x) << ENTERPRISE_CONFIG_CH_10MHZ_DISABLE_LSB) & ENTERPRISE_CONFIG_CH_10MHZ_DISABLE_MASK) -#define ENTERPRISE_CONFIG_TXBF_DISABLE_MSB 3 -#define ENTERPRISE_CONFIG_TXBF_DISABLE_LSB 3 -#define ENTERPRISE_CONFIG_TXBF_DISABLE_MASK 0x00000008 -#define ENTERPRISE_CONFIG_TXBF_DISABLE_GET(x) (((x) & ENTERPRISE_CONFIG_TXBF_DISABLE_MASK) >> ENTERPRISE_CONFIG_TXBF_DISABLE_LSB) -#define ENTERPRISE_CONFIG_TXBF_DISABLE_SET(x) (((x) << ENTERPRISE_CONFIG_TXBF_DISABLE_LSB) & ENTERPRISE_CONFIG_TXBF_DISABLE_MASK) -#define ENTERPRISE_CONFIG_MIN_PKT_SIZE_DISABLE_MSB 2 -#define ENTERPRISE_CONFIG_MIN_PKT_SIZE_DISABLE_LSB 2 -#define ENTERPRISE_CONFIG_MIN_PKT_SIZE_DISABLE_MASK 0x00000004 -#define ENTERPRISE_CONFIG_MIN_PKT_SIZE_DISABLE_GET(x) (((x) & ENTERPRISE_CONFIG_MIN_PKT_SIZE_DISABLE_MASK) >> ENTERPRISE_CONFIG_MIN_PKT_SIZE_DISABLE_LSB) -#define ENTERPRISE_CONFIG_MIN_PKT_SIZE_DISABLE_SET(x) (((x) << ENTERPRISE_CONFIG_MIN_PKT_SIZE_DISABLE_LSB) & ENTERPRISE_CONFIG_MIN_PKT_SIZE_DISABLE_MASK) -#define ENTERPRISE_CONFIG_LOOPBACK_DISABLE_MSB 1 -#define ENTERPRISE_CONFIG_LOOPBACK_DISABLE_LSB 1 -#define ENTERPRISE_CONFIG_LOOPBACK_DISABLE_MASK 0x00000002 -#define ENTERPRISE_CONFIG_LOOPBACK_DISABLE_GET(x) (((x) & ENTERPRISE_CONFIG_LOOPBACK_DISABLE_MASK) >> ENTERPRISE_CONFIG_LOOPBACK_DISABLE_LSB) -#define ENTERPRISE_CONFIG_LOOPBACK_DISABLE_SET(x) (((x) << ENTERPRISE_CONFIG_LOOPBACK_DISABLE_LSB) & ENTERPRISE_CONFIG_LOOPBACK_DISABLE_MASK) -#define ENTERPRISE_CONFIG_LOCATION_DISABLE_MSB 0 -#define ENTERPRISE_CONFIG_LOCATION_DISABLE_LSB 0 -#define ENTERPRISE_CONFIG_LOCATION_DISABLE_MASK 0x00000001 -#define ENTERPRISE_CONFIG_LOCATION_DISABLE_GET(x) (((x) & ENTERPRISE_CONFIG_LOCATION_DISABLE_MASK) >> ENTERPRISE_CONFIG_LOCATION_DISABLE_LSB) -#define ENTERPRISE_CONFIG_LOCATION_DISABLE_SET(x) (((x) << ENTERPRISE_CONFIG_LOCATION_DISABLE_LSB) & ENTERPRISE_CONFIG_LOCATION_DISABLE_MASK) - -#define RTC_DEBUG_BUS_ADDRESS 0x00000334 -#define RTC_DEBUG_BUS_OFFSET 0x00000334 -#define RTC_DEBUG_BUS_SEL_MSB 0 -#define RTC_DEBUG_BUS_SEL_LSB 0 -#define RTC_DEBUG_BUS_SEL_MASK 0x00000001 -#define RTC_DEBUG_BUS_SEL_GET(x) (((x) & RTC_DEBUG_BUS_SEL_MASK) >> RTC_DEBUG_BUS_SEL_LSB) -#define RTC_DEBUG_BUS_SEL_SET(x) (((x) << RTC_DEBUG_BUS_SEL_LSB) & RTC_DEBUG_BUS_SEL_MASK) - -#define RTC_EXT_CLK_BUF_ADDRESS 0x00000338 -#define RTC_EXT_CLK_BUF_OFFSET 0x00000338 -#define RTC_EXT_CLK_BUF_EN_MSB 0 -#define RTC_EXT_CLK_BUF_EN_LSB 0 -#define RTC_EXT_CLK_BUF_EN_MASK 0x00000001 -#define RTC_EXT_CLK_BUF_EN_GET(x) (((x) & RTC_EXT_CLK_BUF_EN_MASK) >> RTC_EXT_CLK_BUF_EN_LSB) -#define RTC_EXT_CLK_BUF_EN_SET(x) (((x) << RTC_EXT_CLK_BUF_EN_LSB) & RTC_EXT_CLK_BUF_EN_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct rtc_soc_reg_reg_s { - volatile unsigned int soc_reset_control; - volatile unsigned int soc_tcxo_detect; - volatile unsigned int soc_xtal_test; - unsigned char pad0[20]; /* pad to 0x20 */ - volatile unsigned int soc_cpu_clock; - unsigned char pad1[4]; /* pad to 0x28 */ - volatile unsigned int soc_clock_control; - unsigned char pad2[4]; /* pad to 0x30 */ - volatile unsigned int soc_wdt_control; - volatile unsigned int soc_wdt_status; - volatile unsigned int soc_wdt; - volatile unsigned int soc_wdt_count; - volatile unsigned int soc_wdt_reset; - volatile unsigned int soc_int_status; - volatile unsigned int soc_lf_timer0; - volatile unsigned int soc_lf_timer_count0; - volatile unsigned int soc_lf_timer_control0; - volatile unsigned int soc_lf_timer_status0; - volatile unsigned int soc_lf_timer1; - volatile unsigned int soc_lf_timer_count1; - volatile unsigned int soc_lf_timer_control1; - volatile unsigned int soc_lf_timer_status1; - volatile unsigned int soc_lf_timer2; - volatile unsigned int soc_lf_timer_count2; - volatile unsigned int soc_lf_timer_control2; - volatile unsigned int soc_lf_timer_status2; - volatile unsigned int soc_lf_timer3; - volatile unsigned int soc_lf_timer_count3; - volatile unsigned int soc_lf_timer_control3; - volatile unsigned int soc_lf_timer_status3; - volatile unsigned int soc_hf_timer; - volatile unsigned int soc_hf_timer_count; - volatile unsigned int soc_hf_lf_count; - volatile unsigned int soc_hf_timer_control; - volatile unsigned int soc_hf_timer_status; - volatile unsigned int soc_rtc_control; - volatile unsigned int soc_rtc_time; - volatile unsigned int soc_rtc_date; - volatile unsigned int soc_rtc_set_time; - volatile unsigned int soc_rtc_set_date; - volatile unsigned int soc_rtc_set_alarm; - volatile unsigned int soc_rtc_config; - volatile unsigned int soc_rtc_alarm_status; - volatile unsigned int soc_uart_wakeup; - volatile unsigned int soc_reset_cause; - volatile unsigned int soc_system_sleep; - volatile unsigned int soc_sdio_wrapper; - volatile unsigned int soc_int_status1; - unsigned char pad3[4]; /* pad to 0xd4 */ - volatile unsigned int soc_lpo_cal_time; - volatile unsigned int soc_lpo_init_dividend_int; - volatile unsigned int soc_lpo_init_dividend_fraction; - volatile unsigned int soc_lpo_cal; - volatile unsigned int soc_lpo_cal_test_control; - volatile unsigned int soc_lpo_cal_test_status; - volatile unsigned int legacy_soc_chip_id; - volatile unsigned int soc_chip_id; - unsigned char pad4[24]; /* pad to 0x10c */ - volatile unsigned int soc_power_reg; - volatile unsigned int soc_core_clk_ctrl; - volatile unsigned int soc_gpio_wakeup_control; - unsigned char pad5[252]; /* pad to 0x214 */ - volatile unsigned int sleep_retention; - unsigned char pad6[108]; /* pad to 0x284 */ - volatile unsigned int lp_perf_counter; - volatile unsigned int lp_perf_light_sleep; - volatile unsigned int lp_perf_deep_sleep; - volatile unsigned int lp_perf_on; - unsigned char pad7[20]; /* pad to 0x2a8 */ - volatile unsigned int chip_mode; - volatile unsigned int clk_req_fall_edge; - volatile unsigned int otp; - volatile unsigned int otp_status; - volatile unsigned int pmu; - volatile unsigned int pmu_config; - volatile unsigned int pmu_pareg; - volatile unsigned int pmu_bypass; - unsigned char pad8[20]; /* pad to 0x2dc */ - volatile unsigned int therm_ctrl1; - volatile unsigned int therm_ctrl2; - volatile unsigned int therm_ctrl3; - volatile unsigned int listen_mode1; - volatile unsigned int listen_mode2; - volatile unsigned int audio_pll_config; - volatile unsigned int audio_pll_modulation; - volatile unsigned int audio_pll_mod_step; - volatile unsigned int current_audio_pll_modulation; - volatile unsigned int eth_pll_config; - volatile unsigned int cpu_pll_config; - volatile unsigned int bb_pll_config; - volatile unsigned int eth_xmii; - volatile unsigned int usb_phy_config; - volatile unsigned int mitsumi_int_control_reg; - volatile unsigned int mitsumi_int_status_reg; - volatile unsigned int current_working_mode; - volatile unsigned int rtc_sleep_count; - volatile unsigned int mit2_vap; - volatile unsigned int second_host_inft; - volatile unsigned int sdio_host; - volatile unsigned int enterprise_config; - volatile unsigned int rtc_debug_bus; - volatile unsigned int rtc_ext_clk_buf; -} rtc_soc_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _RTC_SOC_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_sync_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_sync_reg.h deleted file mode 100644 index 0ab3ea33d327..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_sync_reg.h +++ /dev/null @@ -1,221 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _RTC_SYNC_REG_REG_H_ -#define _RTC_SYNC_REG_REG_H_ - - -/* macros for RTC_SYNC_RESET */ -#define RTC_SYNC_RESET_ADDRESS 0x00000240 -#define RTC_SYNC_RESET_OFFSET 0x00000240 -#define RTC_SYNC_RESET_RESET_L_MSB 0 -#define RTC_SYNC_RESET_RESET_L_LSB 0 -#define RTC_SYNC_RESET_RESET_L_MASK 0x00000001 -#define RTC_SYNC_RESET_RESET_L_GET(x) (((x) & 0x00000001) >> 0) -#define RTC_SYNC_RESET_RESET_L_SET(x) (((x) << 0) & 0x00000001) - -/* macros for RTC_SYNC_STATUS */ -#define RTC_SYNC_STATUS_ADDRESS 0x00000244 -#define RTC_SYNC_STATUS_OFFSET 0x00000244 -#define RTC_SYNC_STATUS_SHUTDOWN_STATE_MSB 0 -#define RTC_SYNC_STATUS_SHUTDOWN_STATE_LSB 0 -#define RTC_SYNC_STATUS_SHUTDOWN_STATE_MASK 0x00000001 -#define RTC_SYNC_STATUS_SHUTDOWN_STATE_GET(x) (((x) & 0x00000001) >> 0) -#define RTC_SYNC_STATUS_ON_STATE_MSB 1 -#define RTC_SYNC_STATUS_ON_STATE_LSB 1 -#define RTC_SYNC_STATUS_ON_STATE_MASK 0x00000002 -#define RTC_SYNC_STATUS_ON_STATE_GET(x) (((x) & 0x00000002) >> 1) -#define RTC_SYNC_STATUS_SLEEP_STATE_MSB 2 -#define RTC_SYNC_STATUS_SLEEP_STATE_LSB 2 -#define RTC_SYNC_STATUS_SLEEP_STATE_MASK 0x00000004 -#define RTC_SYNC_STATUS_SLEEP_STATE_GET(x) (((x) & 0x00000004) >> 2) -#define RTC_SYNC_STATUS_WAKEUP_STATE_MSB 3 -#define RTC_SYNC_STATUS_WAKEUP_STATE_LSB 3 -#define RTC_SYNC_STATUS_WAKEUP_STATE_MASK 0x00000008 -#define RTC_SYNC_STATUS_WAKEUP_STATE_GET(x) (((x) & 0x00000008) >> 3) -#define RTC_SYNC_STATUS_WRESET_MSB 4 -#define RTC_SYNC_STATUS_WRESET_LSB 4 -#define RTC_SYNC_STATUS_WRESET_MASK 0x00000010 -#define RTC_SYNC_STATUS_WRESET_GET(x) (((x) & 0x00000010) >> 4) -#define RTC_SYNC_STATUS_PLL_CHANGING_MSB 5 -#define RTC_SYNC_STATUS_PLL_CHANGING_LSB 5 -#define RTC_SYNC_STATUS_PLL_CHANGING_MASK 0x00000020 -#define RTC_SYNC_STATUS_PLL_CHANGING_GET(x) (((x) & 0x00000020) >> 5) - -/* macros for RTC_SYNC_DERIVED */ -#define RTC_SYNC_DERIVED_ADDRESS 0x00000248 -#define RTC_SYNC_DERIVED_OFFSET 0x00000248 -#define RTC_SYNC_DERIVED_BYPASS_MSB 0 -#define RTC_SYNC_DERIVED_BYPASS_LSB 0 -#define RTC_SYNC_DERIVED_BYPASS_MASK 0x00000001 -#define RTC_SYNC_DERIVED_BYPASS_GET(x) (((x) & 0x00000001) >> 0) -#define RTC_SYNC_DERIVED_BYPASS_SET(x) (((x) << 0) & 0x00000001) -#define RTC_SYNC_DERIVED_FORCE_MSB 1 -#define RTC_SYNC_DERIVED_FORCE_LSB 1 -#define RTC_SYNC_DERIVED_FORCE_MASK 0x00000002 -#define RTC_SYNC_DERIVED_FORCE_GET(x) (((x) & 0x00000002) >> 1) -#define RTC_SYNC_DERIVED_FORCE_SET(x) (((x) << 1) & 0x00000002) -#define RTC_SYNC_DERIVED_FORCE_SWREG_PWD_MSB 2 -#define RTC_SYNC_DERIVED_FORCE_SWREG_PWD_LSB 2 -#define RTC_SYNC_DERIVED_FORCE_SWREG_PWD_MASK 0x00000004 -#define RTC_SYNC_DERIVED_FORCE_SWREG_PWD_SET(x) (((x) << 2) & 0x00000004) -#define RTC_SYNC_DERIVED_FORCE_LPO_PWD_MSB 3 -#define RTC_SYNC_DERIVED_FORCE_LPO_PWD_LSB 3 -#define RTC_SYNC_DERIVED_FORCE_LPO_PWD_MASK 0x00000008 -#define RTC_SYNC_DERIVED_FORCE_LPO_PWD_SET(x) (((x) << 3) & 0x00000008) - -/* macros for RTC_SYNC_FORCE_WAKE */ -#define RTC_SYNC_FORCE_WAKE_ADDRESS 0x0000024c -#define RTC_SYNC_FORCE_WAKE_OFFSET 0x0000024c -#define RTC_SYNC_FORCE_WAKE_ENABLE_MSB 0 -#define RTC_SYNC_FORCE_WAKE_ENABLE_LSB 0 -#define RTC_SYNC_FORCE_WAKE_ENABLE_MASK 0x00000001 -#define RTC_SYNC_FORCE_WAKE_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define RTC_SYNC_FORCE_WAKE_INTR_MSB 1 -#define RTC_SYNC_FORCE_WAKE_INTR_LSB 1 -#define RTC_SYNC_FORCE_WAKE_INTR_MASK 0x00000002 -#define RTC_SYNC_FORCE_WAKE_INTR_GET(x) (((x) & 0x00000002) >> 1) -#define RTC_SYNC_FORCE_WAKE_INTR_SET(x) (((x) << 1) & 0x00000002) - -/* macros for RTC_SYNC_INTR_CAUSE */ -#define RTC_SYNC_INTR_CAUSE_ADDRESS 0x00000250 -#define RTC_SYNC_INTR_CAUSE_OFFSET 0x00000250 -#define RTC_SYNC_INTR_CAUSE_SHUTDOWN_STATE_MSB 0 -#define RTC_SYNC_INTR_CAUSE_SHUTDOWN_STATE_LSB 0 -#define RTC_SYNC_INTR_CAUSE_SHUTDOWN_STATE_MASK 0x00000001 -#define RTC_SYNC_INTR_CAUSE_SHUTDOWN_STATE_GET(x) (((x) & 0x00000001) >> 0) -#define RTC_SYNC_INTR_CAUSE_SHUTDOWN_STATE_SET(x) (((x) << 0) & 0x00000001) -#define RTC_SYNC_INTR_CAUSE_ON_STATE_MSB 1 -#define RTC_SYNC_INTR_CAUSE_ON_STATE_LSB 1 -#define RTC_SYNC_INTR_CAUSE_ON_STATE_MASK 0x00000002 -#define RTC_SYNC_INTR_CAUSE_ON_STATE_GET(x) (((x) & 0x00000002) >> 1) -#define RTC_SYNC_INTR_CAUSE_ON_STATE_SET(x) (((x) << 1) & 0x00000002) -#define RTC_SYNC_INTR_CAUSE_SLEEP_STATE_MSB 2 -#define RTC_SYNC_INTR_CAUSE_SLEEP_STATE_LSB 2 -#define RTC_SYNC_INTR_CAUSE_SLEEP_STATE_MASK 0x00000004 -#define RTC_SYNC_INTR_CAUSE_SLEEP_STATE_GET(x) (((x) & 0x00000004) >> 2) -#define RTC_SYNC_INTR_CAUSE_SLEEP_STATE_SET(x) (((x) << 2) & 0x00000004) -#define RTC_SYNC_INTR_CAUSE_WAKEUP_STATE_MSB 3 -#define RTC_SYNC_INTR_CAUSE_WAKEUP_STATE_LSB 3 -#define RTC_SYNC_INTR_CAUSE_WAKEUP_STATE_MASK 0x00000008 -#define RTC_SYNC_INTR_CAUSE_WAKEUP_STATE_GET(x) (((x) & 0x00000008) >> 3) -#define RTC_SYNC_INTR_CAUSE_WAKEUP_STATE_SET(x) (((x) << 3) & 0x00000008) -#define RTC_SYNC_INTR_CAUSE_SLEEP_ACCESS_MSB 4 -#define RTC_SYNC_INTR_CAUSE_SLEEP_ACCESS_LSB 4 -#define RTC_SYNC_INTR_CAUSE_SLEEP_ACCESS_MASK 0x00000010 -#define RTC_SYNC_INTR_CAUSE_SLEEP_ACCESS_GET(x) (((x) & 0x00000010) >> 4) -#define RTC_SYNC_INTR_CAUSE_SLEEP_ACCESS_SET(x) (((x) << 4) & 0x00000010) -#define RTC_SYNC_INTR_CAUSE_PLL_CHANGING_MSB 5 -#define RTC_SYNC_INTR_CAUSE_PLL_CHANGING_LSB 5 -#define RTC_SYNC_INTR_CAUSE_PLL_CHANGING_MASK 0x00000020 -#define RTC_SYNC_INTR_CAUSE_PLL_CHANGING_GET(x) (((x) & 0x00000020) >> 5) -#define RTC_SYNC_INTR_CAUSE_PLL_CHANGING_SET(x) (((x) << 5) & 0x00000020) - -/* macros for RTC_SYNC_INTR_ENABLE */ -#define RTC_SYNC_INTR_ENABLE_ADDRESS 0x00000254 -#define RTC_SYNC_INTR_ENABLE_OFFSET 0x00000254 -#define RTC_SYNC_INTR_ENABLE_SHUTDOWN_STATE_MSB 0 -#define RTC_SYNC_INTR_ENABLE_SHUTDOWN_STATE_LSB 0 -#define RTC_SYNC_INTR_ENABLE_SHUTDOWN_STATE_MASK 0x00000001 -#define RTC_SYNC_INTR_ENABLE_SHUTDOWN_STATE_GET(x) (((x) & 0x00000001) >> 0) -#define RTC_SYNC_INTR_ENABLE_SHUTDOWN_STATE_SET(x) (((x) << 0) & 0x00000001) -#define RTC_SYNC_INTR_ENABLE_ON_STATE_MSB 1 -#define RTC_SYNC_INTR_ENABLE_ON_STATE_LSB 1 -#define RTC_SYNC_INTR_ENABLE_ON_STATE_MASK 0x00000002 -#define RTC_SYNC_INTR_ENABLE_ON_STATE_GET(x) (((x) & 0x00000002) >> 1) -#define RTC_SYNC_INTR_ENABLE_ON_STATE_SET(x) (((x) << 1) & 0x00000002) -#define RTC_SYNC_INTR_ENABLE_SLEEP_STATE_MSB 2 -#define RTC_SYNC_INTR_ENABLE_SLEEP_STATE_LSB 2 -#define RTC_SYNC_INTR_ENABLE_SLEEP_STATE_MASK 0x00000004 -#define RTC_SYNC_INTR_ENABLE_SLEEP_STATE_GET(x) (((x) & 0x00000004) >> 2) -#define RTC_SYNC_INTR_ENABLE_SLEEP_STATE_SET(x) (((x) << 2) & 0x00000004) -#define RTC_SYNC_INTR_ENABLE_WAKEUP_STATE_MSB 3 -#define RTC_SYNC_INTR_ENABLE_WAKEUP_STATE_LSB 3 -#define RTC_SYNC_INTR_ENABLE_WAKEUP_STATE_MASK 0x00000008 -#define RTC_SYNC_INTR_ENABLE_WAKEUP_STATE_GET(x) (((x) & 0x00000008) >> 3) -#define RTC_SYNC_INTR_ENABLE_WAKEUP_STATE_SET(x) (((x) << 3) & 0x00000008) -#define RTC_SYNC_INTR_ENABLE_SLEEP_ACCESS_MSB 4 -#define RTC_SYNC_INTR_ENABLE_SLEEP_ACCESS_LSB 4 -#define RTC_SYNC_INTR_ENABLE_SLEEP_ACCESS_MASK 0x00000010 -#define RTC_SYNC_INTR_ENABLE_SLEEP_ACCESS_GET(x) (((x) & 0x00000010) >> 4) -#define RTC_SYNC_INTR_ENABLE_SLEEP_ACCESS_SET(x) (((x) << 4) & 0x00000010) -#define RTC_SYNC_INTR_ENABLE_PLL_CHANGING_MSB 5 -#define RTC_SYNC_INTR_ENABLE_PLL_CHANGING_LSB 5 -#define RTC_SYNC_INTR_ENABLE_PLL_CHANGING_MASK 0x00000020 -#define RTC_SYNC_INTR_ENABLE_PLL_CHANGING_GET(x) (((x) & 0x00000020) >> 5) -#define RTC_SYNC_INTR_ENABLE_PLL_CHANGING_SET(x) (((x) << 5) & 0x00000020) - -/* macros for RTC_SYNC_INTR_MASK */ -#define RTC_SYNC_INTR_MASK_ADDRESS 0x00000258 -#define RTC_SYNC_INTR_MASK_OFFSET 0x00000258 -#define RTC_SYNC_INTR_MASK_SHUTDOWN_STATE_MSB 0 -#define RTC_SYNC_INTR_MASK_SHUTDOWN_STATE_LSB 0 -#define RTC_SYNC_INTR_MASK_SHUTDOWN_STATE_MASK 0x00000001 -#define RTC_SYNC_INTR_MASK_SHUTDOWN_STATE_GET(x) (((x) & 0x00000001) >> 0) -#define RTC_SYNC_INTR_MASK_SHUTDOWN_STATE_SET(x) (((x) << 0) & 0x00000001) -#define RTC_SYNC_INTR_MASK_ON_STATE_MSB 1 -#define RTC_SYNC_INTR_MASK_ON_STATE_LSB 1 -#define RTC_SYNC_INTR_MASK_ON_STATE_MASK 0x00000002 -#define RTC_SYNC_INTR_MASK_ON_STATE_GET(x) (((x) & 0x00000002) >> 1) -#define RTC_SYNC_INTR_MASK_ON_STATE_SET(x) (((x) << 1) & 0x00000002) -#define RTC_SYNC_INTR_MASK_SLEEP_STATE_MSB 2 -#define RTC_SYNC_INTR_MASK_SLEEP_STATE_LSB 2 -#define RTC_SYNC_INTR_MASK_SLEEP_STATE_MASK 0x00000004 -#define RTC_SYNC_INTR_MASK_SLEEP_STATE_GET(x) (((x) & 0x00000004) >> 2) -#define RTC_SYNC_INTR_MASK_SLEEP_STATE_SET(x) (((x) << 2) & 0x00000004) -#define RTC_SYNC_INTR_MASK_WAKEUP_STATE_MSB 3 -#define RTC_SYNC_INTR_MASK_WAKEUP_STATE_LSB 3 -#define RTC_SYNC_INTR_MASK_WAKEUP_STATE_MASK 0x00000008 -#define RTC_SYNC_INTR_MASK_WAKEUP_STATE_GET(x) (((x) & 0x00000008) >> 3) -#define RTC_SYNC_INTR_MASK_WAKEUP_STATE_SET(x) (((x) << 3) & 0x00000008) -#define RTC_SYNC_INTR_MASK_SLEEP_ACCESS_MSB 4 -#define RTC_SYNC_INTR_MASK_SLEEP_ACCESS_LSB 4 -#define RTC_SYNC_INTR_MASK_SLEEP_ACCESS_MASK 0x00000010 -#define RTC_SYNC_INTR_MASK_SLEEP_ACCESS_GET(x) (((x) & 0x00000010) >> 4) -#define RTC_SYNC_INTR_MASK_SLEEP_ACCESS_SET(x) (((x) << 4) & 0x00000010) -#define RTC_SYNC_INTR_MASK_PLL_CHANGING_MSB 5 -#define RTC_SYNC_INTR_MASK_PLL_CHANGING_LSB 5 -#define RTC_SYNC_INTR_MASK_PLL_CHANGING_MASK 0x00000020 -#define RTC_SYNC_INTR_MASK_PLL_CHANGING_GET(x) (((x) & 0x00000020) >> 5) -#define RTC_SYNC_INTR_MASK_PLL_CHANGING_SET(x) (((x) << 5) & 0x00000020) - - -#ifndef __ASSEMBLER__ - -typedef struct rtc_sync_reg_reg_s { - volatile char pad__0[0x240]; /* 0x0 - 0x240 */ - volatile unsigned int RTC_SYNC_RESET; /* 0x240 - 0x244 */ - volatile unsigned int RTC_SYNC_STATUS; /* 0x244 - 0x248 */ - volatile unsigned int RTC_SYNC_DERIVED; /* 0x248 - 0x24c */ - volatile unsigned int RTC_SYNC_FORCE_WAKE; /* 0x24c - 0x250 */ - volatile unsigned int RTC_SYNC_INTR_CAUSE; /* 0x250 - 0x254 */ - volatile unsigned int RTC_SYNC_INTR_ENABLE; /* 0x254 - 0x258 */ - volatile unsigned int RTC_SYNC_INTR_MASK; /* 0x258 - 0x25c */ -} rtc_sync_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _RTC_SYNC_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_wlan_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_wlan_reg.h deleted file mode 100644 index d4a7d4d71a1d..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/rtc_wlan_reg.h +++ /dev/null @@ -1,677 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _RTC_WLAN_REG_REG_H_ -#define _RTC_WLAN_REG_REG_H_ - - -/* macros for WLAN_RESET_CONTROL */ -#define WLAN_RESET_CONTROL_ADDRESS 0x00000000 -#define WLAN_RESET_CONTROL_OFFSET 0x00000000 -#define WLAN_RESET_CONTROL_MAC_WARM_RST_MSB 0 -#define WLAN_RESET_CONTROL_MAC_WARM_RST_LSB 0 -#define WLAN_RESET_CONTROL_MAC_WARM_RST_MASK 0x00000001 -#define WLAN_RESET_CONTROL_MAC_WARM_RST_GET(x) (((x) & 0x00000001) >> 0) -#define WLAN_RESET_CONTROL_MAC_WARM_RST_SET(x) (((x) << 0) & 0x00000001) -#define WLAN_RESET_CONTROL_MAC_COLD_RST_MSB 1 -#define WLAN_RESET_CONTROL_MAC_COLD_RST_LSB 1 -#define WLAN_RESET_CONTROL_MAC_COLD_RST_MASK 0x00000002 -#define WLAN_RESET_CONTROL_MAC_COLD_RST_GET(x) (((x) & 0x00000002) >> 1) -#define WLAN_RESET_CONTROL_MAC_COLD_RST_SET(x) (((x) << 1) & 0x00000002) -#define WLAN_RESET_CONTROL_WARM_RST_MSB 2 -#define WLAN_RESET_CONTROL_WARM_RST_LSB 2 -#define WLAN_RESET_CONTROL_WARM_RST_MASK 0x00000004 -#define WLAN_RESET_CONTROL_WARM_RST_GET(x) (((x) & 0x00000004) >> 2) -#define WLAN_RESET_CONTROL_WARM_RST_SET(x) (((x) << 2) & 0x00000004) -#define WLAN_RESET_CONTROL_COLD_RST_MSB 3 -#define WLAN_RESET_CONTROL_COLD_RST_LSB 3 -#define WLAN_RESET_CONTROL_COLD_RST_MASK 0x00000008 -#define WLAN_RESET_CONTROL_COLD_RST_GET(x) (((x) & 0x00000008) >> 3) -#define WLAN_RESET_CONTROL_COLD_RST_SET(x) (((x) << 3) & 0x00000008) -#define WLAN_RESET_CONTROL_BB_WARM_RST_MSB 4 -#define WLAN_RESET_CONTROL_BB_WARM_RST_LSB 4 -#define WLAN_RESET_CONTROL_BB_WARM_RST_MASK 0x00000010 -#define WLAN_RESET_CONTROL_BB_WARM_RST_GET(x) (((x) & 0x00000010) >> 4) -#define WLAN_RESET_CONTROL_BB_WARM_RST_SET(x) (((x) << 4) & 0x00000010) -#define WLAN_RESET_CONTROL_BB_COLD_RST_MSB 5 -#define WLAN_RESET_CONTROL_BB_COLD_RST_LSB 5 -#define WLAN_RESET_CONTROL_BB_COLD_RST_MASK 0x00000020 -#define WLAN_RESET_CONTROL_BB_COLD_RST_GET(x) (((x) & 0x00000020) >> 5) -#define WLAN_RESET_CONTROL_BB_COLD_RST_SET(x) (((x) << 5) & 0x00000020) -#define WLAN_RESET_CONTROL_RADIO_SRESET_MSB 6 -#define WLAN_RESET_CONTROL_RADIO_SRESET_LSB 6 -#define WLAN_RESET_CONTROL_RADIO_SRESET_MASK 0x00000040 -#define WLAN_RESET_CONTROL_RADIO_SRESET_GET(x) (((x) & 0x00000040) >> 6) -#define WLAN_RESET_CONTROL_RADIO_SRESET_SET(x) (((x) << 6) & 0x00000040) -#define WLAN_RESET_CONTROL_MCI_RESET_MSB 7 -#define WLAN_RESET_CONTROL_MCI_RESET_LSB 7 -#define WLAN_RESET_CONTROL_MCI_RESET_MASK 0x00000080 -#define WLAN_RESET_CONTROL_MCI_RESET_GET(x) (((x) & 0x00000080) >> 7) -#define WLAN_RESET_CONTROL_MCI_RESET_SET(x) (((x) << 7) & 0x00000080) - -/* macros for WLAN_XTAL_CONTROL */ -#define WLAN_XTAL_CONTROL_ADDRESS 0x00000004 -#define WLAN_XTAL_CONTROL_OFFSET 0x00000004 -#define WLAN_XTAL_CONTROL_TCXO_MSB 0 -#define WLAN_XTAL_CONTROL_TCXO_LSB 0 -#define WLAN_XTAL_CONTROL_TCXO_MASK 0x00000001 -#define WLAN_XTAL_CONTROL_TCXO_GET(x) (((x) & 0x00000001) >> 0) -#define WLAN_XTAL_CONTROL_TCXO_SET(x) (((x) << 0) & 0x00000001) - -/* macros for WLAN_REG_CONTROL0 */ -#define WLAN_REG_CONTROL0_ADDRESS 0x00000008 -#define WLAN_REG_CONTROL0_OFFSET 0x00000008 -#define WLAN_REG_CONTROL0_SWREG_BITS_MSB 31 -#define WLAN_REG_CONTROL0_SWREG_BITS_LSB 0 -#define WLAN_REG_CONTROL0_SWREG_BITS_MASK 0xffffffff -#define WLAN_REG_CONTROL0_SWREG_BITS_GET(x) (((x) & 0xffffffff) >> 0) -#define WLAN_REG_CONTROL0_SWREG_BITS_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for WLAN_REG_CONTROL1 */ -#define WLAN_REG_CONTROL1_ADDRESS 0x0000000c -#define WLAN_REG_CONTROL1_OFFSET 0x0000000c -#define WLAN_REG_CONTROL1_SWREG_PROGRAM_MSB 0 -#define WLAN_REG_CONTROL1_SWREG_PROGRAM_LSB 0 -#define WLAN_REG_CONTROL1_SWREG_PROGRAM_MASK 0x00000001 -#define WLAN_REG_CONTROL1_SWREG_PROGRAM_GET(x) (((x) & 0x00000001) >> 0) -#define WLAN_REG_CONTROL1_SWREG_PROGRAM_SET(x) (((x) << 0) & 0x00000001) -#define WLAN_REG_CONTROL1_OTPREG_LVL_MSB 2 -#define WLAN_REG_CONTROL1_OTPREG_LVL_LSB 1 -#define WLAN_REG_CONTROL1_OTPREG_LVL_MASK 0x00000006 -#define WLAN_REG_CONTROL1_OTPREG_LVL_GET(x) (((x) & 0x00000006) >> 1) -#define WLAN_REG_CONTROL1_OTPREG_LVL_SET(x) (((x) << 1) & 0x00000006) - -/* macros for WLAN_QUADRATURE */ -#define WLAN_QUADRATURE_ADDRESS 0x00000010 -#define WLAN_QUADRATURE_OFFSET 0x00000010 -#define WLAN_QUADRATURE_DAC_MSB 2 -#define WLAN_QUADRATURE_DAC_LSB 0 -#define WLAN_QUADRATURE_DAC_MASK 0x00000007 -#define WLAN_QUADRATURE_DAC_GET(x) (((x) & 0x00000007) >> 0) -#define WLAN_QUADRATURE_DAC_SET(x) (((x) << 0) & 0x00000007) -#define WLAN_QUADRATURE_ADC_MSB 7 -#define WLAN_QUADRATURE_ADC_LSB 4 -#define WLAN_QUADRATURE_ADC_MASK 0x000000f0 -#define WLAN_QUADRATURE_ADC_GET(x) (((x) & 0x000000f0) >> 4) -#define WLAN_QUADRATURE_ADC_SET(x) (((x) << 4) & 0x000000f0) - -/* macros for WLAN_PLL_CONTROL */ -#define WLAN_PLL_CONTROL_ADDRESS 0x00000014 -#define WLAN_PLL_CONTROL_OFFSET 0x00000014 -#define WLAN_PLL_CONTROL_DIV_MSB 9 -#define WLAN_PLL_CONTROL_DIV_LSB 0 -#define WLAN_PLL_CONTROL_DIV_MASK 0x000003ff -#define WLAN_PLL_CONTROL_DIV_GET(x) (((x) & 0x000003ff) >> 0) -#define WLAN_PLL_CONTROL_DIV_SET(x) (((x) << 0) & 0x000003ff) -#define WLAN_PLL_CONTROL_REFDIV_MSB 13 -#define WLAN_PLL_CONTROL_REFDIV_LSB 10 -#define WLAN_PLL_CONTROL_REFDIV_MASK 0x00003c00 -#define WLAN_PLL_CONTROL_REFDIV_GET(x) (((x) & 0x00003c00) >> 10) -#define WLAN_PLL_CONTROL_REFDIV_SET(x) (((x) << 10) & 0x00003c00) -#define WLAN_PLL_CONTROL_CLK_SEL_MSB 15 -#define WLAN_PLL_CONTROL_CLK_SEL_LSB 14 -#define WLAN_PLL_CONTROL_CLK_SEL_MASK 0x0000c000 -#define WLAN_PLL_CONTROL_CLK_SEL_GET(x) (((x) & 0x0000c000) >> 14) -#define WLAN_PLL_CONTROL_CLK_SEL_SET(x) (((x) << 14) & 0x0000c000) -#define WLAN_PLL_CONTROL_BYPASS_MSB 16 -#define WLAN_PLL_CONTROL_BYPASS_LSB 16 -#define WLAN_PLL_CONTROL_BYPASS_MASK 0x00010000 -#define WLAN_PLL_CONTROL_BYPASS_GET(x) (((x) & 0x00010000) >> 16) -#define WLAN_PLL_CONTROL_BYPASS_SET(x) (((x) << 16) & 0x00010000) -#define WLAN_PLL_CONTROL_UPDATING_MSB 17 -#define WLAN_PLL_CONTROL_UPDATING_LSB 17 -#define WLAN_PLL_CONTROL_UPDATING_MASK 0x00020000 -#define WLAN_PLL_CONTROL_UPDATING_GET(x) (((x) & 0x00020000) >> 17) -#define WLAN_PLL_CONTROL_NOPWD_MSB 18 -#define WLAN_PLL_CONTROL_NOPWD_LSB 18 -#define WLAN_PLL_CONTROL_NOPWD_MASK 0x00040000 -#define WLAN_PLL_CONTROL_NOPWD_GET(x) (((x) & 0x00040000) >> 18) -#define WLAN_PLL_CONTROL_NOPWD_SET(x) (((x) << 18) & 0x00040000) -#define WLAN_PLL_CONTROL_MAC_OVERRIDE_MSB 19 -#define WLAN_PLL_CONTROL_MAC_OVERRIDE_LSB 19 -#define WLAN_PLL_CONTROL_MAC_OVERRIDE_MASK 0x00080000 -#define WLAN_PLL_CONTROL_MAC_OVERRIDE_GET(x) (((x) & 0x00080000) >> 19) -#define WLAN_PLL_CONTROL_MAC_OVERRIDE_SET(x) (((x) << 19) & 0x00080000) -#define WLAN_PLL_CONTROL_DIG_TEST_CLK_MSB 20 -#define WLAN_PLL_CONTROL_DIG_TEST_CLK_LSB 20 -#define WLAN_PLL_CONTROL_DIG_TEST_CLK_MASK 0x00100000 -#define WLAN_PLL_CONTROL_DIG_TEST_CLK_GET(x) (((x) & 0x00100000) >> 20) -#define WLAN_PLL_CONTROL_DIG_TEST_CLK_SET(x) (((x) << 20) & 0x00100000) - -/* macros for WLAN_PLL_SETTLE */ -#define WLAN_PLL_SETTLE_ADDRESS 0x00000018 -#define WLAN_PLL_SETTLE_OFFSET 0x00000018 -#define WLAN_PLL_SETTLE_TIME_MSB 10 -#define WLAN_PLL_SETTLE_TIME_LSB 0 -#define WLAN_PLL_SETTLE_TIME_MASK 0x000007ff -#define WLAN_PLL_SETTLE_TIME_GET(x) (((x) & 0x000007ff) >> 0) -#define WLAN_PLL_SETTLE_TIME_SET(x) (((x) << 0) & 0x000007ff) - -/* macros for WLAN_XTAL_SETTLE */ -#define WLAN_XTAL_SETTLE_ADDRESS 0x0000001c -#define WLAN_XTAL_SETTLE_OFFSET 0x0000001c -#define WLAN_XTAL_SETTLE_TIME_MSB 6 -#define WLAN_XTAL_SETTLE_TIME_LSB 0 -#define WLAN_XTAL_SETTLE_TIME_MASK 0x0000007f -#define WLAN_XTAL_SETTLE_TIME_GET(x) (((x) & 0x0000007f) >> 0) -#define WLAN_XTAL_SETTLE_TIME_SET(x) (((x) << 0) & 0x0000007f) - -/* macros for WLAN_CLOCK_OUT */ -#define WLAN_CLOCK_OUT_ADDRESS 0x00000020 -#define WLAN_CLOCK_OUT_OFFSET 0x00000020 -#define WLAN_CLOCK_OUT_SELECT_MSB 4 -#define WLAN_CLOCK_OUT_SELECT_LSB 0 -#define WLAN_CLOCK_OUT_SELECT_MASK 0x0000001f -#define WLAN_CLOCK_OUT_SELECT_GET(x) (((x) & 0x0000001f) >> 0) -#define WLAN_CLOCK_OUT_SELECT_SET(x) (((x) << 0) & 0x0000001f) -#define WLAN_CLOCK_OUT_DELAY_MSB 7 -#define WLAN_CLOCK_OUT_DELAY_LSB 5 -#define WLAN_CLOCK_OUT_DELAY_MASK 0x000000e0 -#define WLAN_CLOCK_OUT_DELAY_GET(x) (((x) & 0x000000e0) >> 5) -#define WLAN_CLOCK_OUT_DELAY_SET(x) (((x) << 5) & 0x000000e0) - -/* macros for WLAN_BIAS_OVERRIDE */ -#define WLAN_BIAS_OVERRIDE_ADDRESS 0x00000024 -#define WLAN_BIAS_OVERRIDE_OFFSET 0x00000024 -#define WLAN_BIAS_OVERRIDE_ON_MSB 0 -#define WLAN_BIAS_OVERRIDE_ON_LSB 0 -#define WLAN_BIAS_OVERRIDE_ON_MASK 0x00000001 -#define WLAN_BIAS_OVERRIDE_ON_GET(x) (((x) & 0x00000001) >> 0) -#define WLAN_BIAS_OVERRIDE_ON_SET(x) (((x) << 0) & 0x00000001) - -/* macros for WLAN_RESET_CAUSE */ -#define WLAN_RESET_CAUSE_ADDRESS 0x00000028 -#define WLAN_RESET_CAUSE_OFFSET 0x00000028 -#define WLAN_RESET_CAUSE_LAST_MSB 2 -#define WLAN_RESET_CAUSE_LAST_LSB 0 -#define WLAN_RESET_CAUSE_LAST_MASK 0x00000007 -#define WLAN_RESET_CAUSE_LAST_GET(x) (((x) & 0x00000007) >> 0) - -/* macros for WLAN_SYSTEM_SLEEP */ -#define WLAN_SYSTEM_SLEEP_ADDRESS 0x0000002c -#define WLAN_SYSTEM_SLEEP_OFFSET 0x0000002c -#define WLAN_SYSTEM_SLEEP_DISABLE_MSB 0 -#define WLAN_SYSTEM_SLEEP_DISABLE_LSB 0 -#define WLAN_SYSTEM_SLEEP_DISABLE_MASK 0x00000001 -#define WLAN_SYSTEM_SLEEP_DISABLE_GET(x) (((x) & 0x00000001) >> 0) -#define WLAN_SYSTEM_SLEEP_DISABLE_SET(x) (((x) << 0) & 0x00000001) -#define WLAN_SYSTEM_SLEEP_LIGHT_MSB 1 -#define WLAN_SYSTEM_SLEEP_LIGHT_LSB 1 -#define WLAN_SYSTEM_SLEEP_LIGHT_MASK 0x00000002 -#define WLAN_SYSTEM_SLEEP_LIGHT_GET(x) (((x) & 0x00000002) >> 1) -#define WLAN_SYSTEM_SLEEP_LIGHT_SET(x) (((x) << 1) & 0x00000002) -#define WLAN_SYSTEM_SLEEP_MAC_IF_MSB 2 -#define WLAN_SYSTEM_SLEEP_MAC_IF_LSB 2 -#define WLAN_SYSTEM_SLEEP_MAC_IF_MASK 0x00000004 -#define WLAN_SYSTEM_SLEEP_MAC_IF_GET(x) (((x) & 0x00000004) >> 2) - -/* macros for WLAN_MAC_SLEEP_CONTROL */ -#define WLAN_MAC_SLEEP_CONTROL_ADDRESS 0x00000030 -#define WLAN_MAC_SLEEP_CONTROL_OFFSET 0x00000030 -#define WLAN_MAC_SLEEP_CONTROL_ENABLE_MSB 0 -#define WLAN_MAC_SLEEP_CONTROL_ENABLE_LSB 0 -#define WLAN_MAC_SLEEP_CONTROL_ENABLE_MASK 0x00000001 -#define WLAN_MAC_SLEEP_CONTROL_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define WLAN_MAC_SLEEP_CONTROL_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define WLAN_MAC_SLEEP_CONTROL_RESERVED_MSB 1 -#define WLAN_MAC_SLEEP_CONTROL_RESERVED_LSB 1 -#define WLAN_MAC_SLEEP_CONTROL_RESERVED_MASK 0x00000002 -#define WLAN_MAC_SLEEP_CONTROL_RESERVED_GET(x) (((x) & 0x00000002) >> 1) -#define WLAN_MAC_SLEEP_CONTROL_RESERVED_SET(x) (((x) << 1) & 0x00000002) -#define WLAN_MAC_SLEEP_CONTROL_HSEL_WMAC_ENABLE_MSB 2 -#define WLAN_MAC_SLEEP_CONTROL_HSEL_WMAC_ENABLE_LSB 2 -#define WLAN_MAC_SLEEP_CONTROL_HSEL_WMAC_ENABLE_MASK 0x00000004 -#define WLAN_MAC_SLEEP_CONTROL_HSEL_WMAC_ENABLE_GET(x) (((x) & 0x00000004) >> 2) -#define WLAN_MAC_SLEEP_CONTROL_HSEL_WMAC_ENABLE_SET(x) (((x) << 2) & 0x00000004) - -/* macros for WLAN_KEEP_AWAKE */ -#define WLAN_KEEP_AWAKE_ADDRESS 0x00000034 -#define WLAN_KEEP_AWAKE_OFFSET 0x00000034 -#define WLAN_KEEP_AWAKE_COUNT_MSB 7 -#define WLAN_KEEP_AWAKE_COUNT_LSB 0 -#define WLAN_KEEP_AWAKE_COUNT_MASK 0x000000ff -#define WLAN_KEEP_AWAKE_COUNT_GET(x) (((x) & 0x000000ff) >> 0) -#define WLAN_KEEP_AWAKE_COUNT_SET(x) (((x) << 0) & 0x000000ff) - -/* macros for WLAN_DERIVED_RTC_CLK */ -#define WLAN_DERIVED_RTC_CLK_ADDRESS 0x00000038 -#define WLAN_DERIVED_RTC_CLK_OFFSET 0x00000038 -#define WLAN_DERIVED_RTC_CLK_PERIOD_MSB 15 -#define WLAN_DERIVED_RTC_CLK_PERIOD_LSB 1 -#define WLAN_DERIVED_RTC_CLK_PERIOD_MASK 0x0000fffe -#define WLAN_DERIVED_RTC_CLK_PERIOD_GET(x) (((x) & 0x0000fffe) >> 1) -#define WLAN_DERIVED_RTC_CLK_PERIOD_SET(x) (((x) << 1) & 0x0000fffe) -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_MSB 18 -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_LSB 18 -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_MASK 0x00040000 -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_GET(x) (((x) & 0x00040000) >> 18) -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MSB 20 -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_LSB 20 -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_MASK 0x00100000 -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_GET(x) (((x) & 0x00100000) >> 20) -#define WLAN_DERIVED_RTC_CLK_EXTERNAL_DETECT_EN_SET(x) (((x) << 20) & 0x00100000) - -/* macros for MAC_PCU_SLP32_MODE */ -#define MAC_PCU_SLP32_MODE_ADDRESS 0x0000003c -#define MAC_PCU_SLP32_MODE_OFFSET 0x0000003c -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MSB 19 -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_LSB 0 -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_MASK 0x000fffff -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_GET(x) (((x) & 0x000fffff) >> 0) -#define MAC_PCU_SLP32_MODE_HALF_CLK_LATENCY_SET(x) (((x) << 0) & 0x000fffff) -#define MAC_PCU_SLP32_MODE_ENABLE_MSB 20 -#define MAC_PCU_SLP32_MODE_ENABLE_LSB 20 -#define MAC_PCU_SLP32_MODE_ENABLE_MASK 0x00100000 -#define MAC_PCU_SLP32_MODE_ENABLE_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_PCU_SLP32_MODE_ENABLE_SET(x) (((x) << 20) & 0x00100000) -#define MAC_PCU_SLP32_MODE_TSF_WRITE_STATUS_MSB 21 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_STATUS_LSB 21 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_STATUS_MASK 0x00200000 -#define MAC_PCU_SLP32_MODE_TSF_WRITE_STATUS_GET(x) (((x) & 0x00200000) >> 21) -#define MAC_PCU_SLP32_MODE_DISABLE_32KHZ_MSB 22 -#define MAC_PCU_SLP32_MODE_DISABLE_32KHZ_LSB 22 -#define MAC_PCU_SLP32_MODE_DISABLE_32KHZ_MASK 0x00400000 -#define MAC_PCU_SLP32_MODE_DISABLE_32KHZ_GET(x) (((x) & 0x00400000) >> 22) -#define MAC_PCU_SLP32_MODE_DISABLE_32KHZ_SET(x) (((x) << 22) & 0x00400000) -#define MAC_PCU_SLP32_MODE_FORCE_BIAS_BLOCK_ON_MSB 23 -#define MAC_PCU_SLP32_MODE_FORCE_BIAS_BLOCK_ON_LSB 23 -#define MAC_PCU_SLP32_MODE_FORCE_BIAS_BLOCK_ON_MASK 0x00800000 -#define MAC_PCU_SLP32_MODE_FORCE_BIAS_BLOCK_ON_GET(x) (((x) & 0x00800000) >> 23) -#define MAC_PCU_SLP32_MODE_FORCE_BIAS_BLOCK_ON_SET(x) (((x) << 23) & 0x00800000) -#define MAC_PCU_SLP32_MODE_TSF2_WRITE_STATUS_MSB 24 -#define MAC_PCU_SLP32_MODE_TSF2_WRITE_STATUS_LSB 24 -#define MAC_PCU_SLP32_MODE_TSF2_WRITE_STATUS_MASK 0x01000000 -#define MAC_PCU_SLP32_MODE_TSF2_WRITE_STATUS_GET(x) (((x) & 0x01000000) >> 24) - -/* macros for MAC_PCU_SLP32_WAKE */ -#define MAC_PCU_SLP32_WAKE_ADDRESS 0x00000040 -#define MAC_PCU_SLP32_WAKE_OFFSET 0x00000040 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_MSB 15 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_LSB 0 -#define MAC_PCU_SLP32_WAKE_XTL_TIME_MASK 0x0000ffff -#define MAC_PCU_SLP32_WAKE_XTL_TIME_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_SLP32_WAKE_XTL_TIME_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MAC_PCU_SLP32_INC */ -#define MAC_PCU_SLP32_INC_ADDRESS 0x00000044 -#define MAC_PCU_SLP32_INC_OFFSET 0x00000044 -#define MAC_PCU_SLP32_INC_TSF_INC_MSB 19 -#define MAC_PCU_SLP32_INC_TSF_INC_LSB 0 -#define MAC_PCU_SLP32_INC_TSF_INC_MASK 0x000fffff -#define MAC_PCU_SLP32_INC_TSF_INC_GET(x) (((x) & 0x000fffff) >> 0) -#define MAC_PCU_SLP32_INC_TSF_INC_SET(x) (((x) << 0) & 0x000fffff) - -/* macros for MAC_PCU_SLP_MIB1 */ -#define MAC_PCU_SLP_MIB1_ADDRESS 0x00000048 -#define MAC_PCU_SLP_MIB1_OFFSET 0x00000048 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_MSB 31 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_LSB 0 -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_MASK 0xffffffff -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_SLP_MIB1_SLEEP_CNT_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_SLP_MIB2 */ -#define MAC_PCU_SLP_MIB2_ADDRESS 0x0000004c -#define MAC_PCU_SLP_MIB2_OFFSET 0x0000004c -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_MSB 31 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_LSB 0 -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_MASK 0xffffffff -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_SLP_MIB2_CYCLE_CNT_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_SLP_MIB3 */ -#define MAC_PCU_SLP_MIB3_ADDRESS 0x00000050 -#define MAC_PCU_SLP_MIB3_OFFSET 0x00000050 -#define MAC_PCU_SLP_MIB3_CLR_CNT_MSB 0 -#define MAC_PCU_SLP_MIB3_CLR_CNT_LSB 0 -#define MAC_PCU_SLP_MIB3_CLR_CNT_MASK 0x00000001 -#define MAC_PCU_SLP_MIB3_CLR_CNT_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_SLP_MIB3_CLR_CNT_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_SLP_MIB3_PENDING_MSB 1 -#define MAC_PCU_SLP_MIB3_PENDING_LSB 1 -#define MAC_PCU_SLP_MIB3_PENDING_MASK 0x00000002 -#define MAC_PCU_SLP_MIB3_PENDING_GET(x) (((x) & 0x00000002) >> 1) - -/* macros for MAC_PCU_TSF_L32 */ -#define MAC_PCU_TSF_L32_ADDRESS 0x00000054 -#define MAC_PCU_TSF_L32_OFFSET 0x00000054 -#define MAC_PCU_TSF_L32_VALUE_MSB 31 -#define MAC_PCU_TSF_L32_VALUE_LSB 0 -#define MAC_PCU_TSF_L32_VALUE_MASK 0xffffffff -#define MAC_PCU_TSF_L32_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_TSF_L32_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_TSF_U32 */ -#define MAC_PCU_TSF_U32_ADDRESS 0x00000058 -#define MAC_PCU_TSF_U32_OFFSET 0x00000058 -#define MAC_PCU_TSF_U32_VALUE_MSB 31 -#define MAC_PCU_TSF_U32_VALUE_LSB 0 -#define MAC_PCU_TSF_U32_VALUE_MASK 0xffffffff -#define MAC_PCU_TSF_U32_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_TSF_U32_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_WBTIMER_0 */ -#define MAC_PCU_WBTIMER_0_ADDRESS 0x0000005c -#define MAC_PCU_WBTIMER_0_OFFSET 0x0000005c -#define MAC_PCU_WBTIMER_0_ENABLE_MSB 0 -#define MAC_PCU_WBTIMER_0_ENABLE_LSB 0 -#define MAC_PCU_WBTIMER_0_ENABLE_MASK 0x00000001 -#define MAC_PCU_WBTIMER_0_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_WBTIMER_0_ENABLE_SET(x) (((x) << 0) & 0x00000001) - -/* macros for MAC_PCU_WBTIMER_1 */ -#define MAC_PCU_WBTIMER_1_ADDRESS 0x00000060 -#define MAC_PCU_WBTIMER_1_OFFSET 0x00000060 -#define MAC_PCU_WBTIMER_1_VALUE_MSB 31 -#define MAC_PCU_WBTIMER_1_VALUE_LSB 0 -#define MAC_PCU_WBTIMER_1_VALUE_MASK 0xffffffff -#define MAC_PCU_WBTIMER_1_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_WBTIMER_1_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_GENERIC_TIMERS */ -#define MAC_PCU_GENERIC_TIMERS_ADDRESS 0x00000064 -#define MAC_PCU_GENERIC_TIMERS_OFFSET 0x00000064 -#define MAC_PCU_GENERIC_TIMERS_DATA_MSB 31 -#define MAC_PCU_GENERIC_TIMERS_DATA_LSB 0 -#define MAC_PCU_GENERIC_TIMERS_DATA_MASK 0xffffffff -#define MAC_PCU_GENERIC_TIMERS_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_GENERIC_TIMERS_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_GENERIC_TIMERS_MODE */ -#define MAC_PCU_GENERIC_TIMERS_MODE_ADDRESS 0x000000bc -#define MAC_PCU_GENERIC_TIMERS_MODE_OFFSET 0x000000bc -#define MAC_PCU_GENERIC_TIMERS_MODE_ENABLE_MSB 7 -#define MAC_PCU_GENERIC_TIMERS_MODE_ENABLE_LSB 0 -#define MAC_PCU_GENERIC_TIMERS_MODE_ENABLE_MASK 0x000000ff -#define MAC_PCU_GENERIC_TIMERS_MODE_ENABLE_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_GENERIC_TIMERS_MODE_ENABLE_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_GENERIC_TIMERS_MODE_OVERFLOW_INDEX_MSB 10 -#define MAC_PCU_GENERIC_TIMERS_MODE_OVERFLOW_INDEX_LSB 8 -#define MAC_PCU_GENERIC_TIMERS_MODE_OVERFLOW_INDEX_MASK 0x00000700 -#define MAC_PCU_GENERIC_TIMERS_MODE_OVERFLOW_INDEX_GET(x) (((x) & 0x00000700) >> 8) -#define MAC_PCU_GENERIC_TIMERS_MODE_THRESH_MSB 31 -#define MAC_PCU_GENERIC_TIMERS_MODE_THRESH_LSB 12 -#define MAC_PCU_GENERIC_TIMERS_MODE_THRESH_MASK 0xfffff000 -#define MAC_PCU_GENERIC_TIMERS_MODE_THRESH_GET(x) (((x) & 0xfffff000) >> 12) -#define MAC_PCU_GENERIC_TIMERS_MODE_THRESH_SET(x) (((x) << 12) & 0xfffff000) - -/* macros for MAC_PCU_SLP1 */ -#define MAC_PCU_SLP1_ADDRESS 0x000000c0 -#define MAC_PCU_SLP1_OFFSET 0x000000c0 -#define MAC_PCU_SLP1_CAB_TIMEOUT_EXT_MSB 4 -#define MAC_PCU_SLP1_CAB_TIMEOUT_EXT_LSB 0 -#define MAC_PCU_SLP1_CAB_TIMEOUT_EXT_MASK 0x0000001f -#define MAC_PCU_SLP1_CAB_TIMEOUT_EXT_GET(x) (((x) & 0x0000001f) >> 0) -#define MAC_PCU_SLP1_CAB_TIMEOUT_EXT_SET(x) (((x) << 0) & 0x0000001f) -#define MAC_PCU_SLP1_ASSUME_DTIM_MSB 19 -#define MAC_PCU_SLP1_ASSUME_DTIM_LSB 19 -#define MAC_PCU_SLP1_ASSUME_DTIM_MASK 0x00080000 -#define MAC_PCU_SLP1_ASSUME_DTIM_GET(x) (((x) & 0x00080000) >> 19) -#define MAC_PCU_SLP1_ASSUME_DTIM_SET(x) (((x) << 19) & 0x00080000) -#define MAC_PCU_SLP1_BUG_59985_FIX_ENABLE_MSB 20 -#define MAC_PCU_SLP1_BUG_59985_FIX_ENABLE_LSB 20 -#define MAC_PCU_SLP1_BUG_59985_FIX_ENABLE_MASK 0x00100000 -#define MAC_PCU_SLP1_BUG_59985_FIX_ENABLE_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_PCU_SLP1_BUG_59985_FIX_ENABLE_SET(x) (((x) << 20) & 0x00100000) -#define MAC_PCU_SLP1_CAB_TIMEOUT_MSB 31 -#define MAC_PCU_SLP1_CAB_TIMEOUT_LSB 21 -#define MAC_PCU_SLP1_CAB_TIMEOUT_MASK 0xffe00000 -#define MAC_PCU_SLP1_CAB_TIMEOUT_GET(x) (((x) & 0xffe00000) >> 21) -#define MAC_PCU_SLP1_CAB_TIMEOUT_SET(x) (((x) << 21) & 0xffe00000) - -/* macros for MAC_PCU_SLP2 */ -#define MAC_PCU_SLP2_ADDRESS 0x000000c4 -#define MAC_PCU_SLP2_OFFSET 0x000000c4 -#define MAC_PCU_SLP2_BEACON_TIMEOUT_EXT_MSB 4 -#define MAC_PCU_SLP2_BEACON_TIMEOUT_EXT_LSB 0 -#define MAC_PCU_SLP2_BEACON_TIMEOUT_EXT_MASK 0x0000001f -#define MAC_PCU_SLP2_BEACON_TIMEOUT_EXT_GET(x) (((x) & 0x0000001f) >> 0) -#define MAC_PCU_SLP2_BEACON_TIMEOUT_EXT_SET(x) (((x) << 0) & 0x0000001f) -#define MAC_PCU_SLP2_BEACON_TIMEOUT_MSB 31 -#define MAC_PCU_SLP2_BEACON_TIMEOUT_LSB 21 -#define MAC_PCU_SLP2_BEACON_TIMEOUT_MASK 0xffe00000 -#define MAC_PCU_SLP2_BEACON_TIMEOUT_GET(x) (((x) & 0xffe00000) >> 21) -#define MAC_PCU_SLP2_BEACON_TIMEOUT_SET(x) (((x) << 21) & 0xffe00000) - -/* macros for MAC_PCU_SLP3 */ -#define MAC_PCU_SLP3_ADDRESS 0x000000c8 -#define MAC_PCU_SLP3_OFFSET 0x000000c8 -#define MAC_PCU_SLP3_CAB_AWAKE_DUR_MSB 15 -#define MAC_PCU_SLP3_CAB_AWAKE_DUR_LSB 0 -#define MAC_PCU_SLP3_CAB_AWAKE_DUR_MASK 0x0000ffff -#define MAC_PCU_SLP3_CAB_AWAKE_DUR_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_SLP3_CAB_AWAKE_DUR_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_PCU_SLP3_CAB_AWAKE_ENABLE_MSB 16 -#define MAC_PCU_SLP3_CAB_AWAKE_ENABLE_LSB 16 -#define MAC_PCU_SLP3_CAB_AWAKE_ENABLE_MASK 0x00010000 -#define MAC_PCU_SLP3_CAB_AWAKE_ENABLE_GET(x) (((x) & 0x00010000) >> 16) -#define MAC_PCU_SLP3_CAB_AWAKE_ENABLE_SET(x) (((x) << 16) & 0x00010000) - -/* macros for MAC_PCU_SLP4 */ -#define MAC_PCU_SLP4_ADDRESS 0x000000cc -#define MAC_PCU_SLP4_OFFSET 0x000000cc -#define MAC_PCU_SLP4_BEACON2_TIMEOUT_MSB 15 -#define MAC_PCU_SLP4_BEACON2_TIMEOUT_LSB 0 -#define MAC_PCU_SLP4_BEACON2_TIMEOUT_MASK 0x0000ffff -#define MAC_PCU_SLP4_BEACON2_TIMEOUT_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_SLP4_BEACON2_TIMEOUT_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_PCU_SLP4_CAB2_TIMEOUT_MSB 30 -#define MAC_PCU_SLP4_CAB2_TIMEOUT_LSB 16 -#define MAC_PCU_SLP4_CAB2_TIMEOUT_MASK 0x7fff0000 -#define MAC_PCU_SLP4_CAB2_TIMEOUT_GET(x) (((x) & 0x7fff0000) >> 16) -#define MAC_PCU_SLP4_CAB2_TIMEOUT_SET(x) (((x) << 16) & 0x7fff0000) -#define MAC_PCU_SLP4_ASSUME_DTIM2_MSB 31 -#define MAC_PCU_SLP4_ASSUME_DTIM2_LSB 31 -#define MAC_PCU_SLP4_ASSUME_DTIM2_MASK 0x80000000 -#define MAC_PCU_SLP4_ASSUME_DTIM2_GET(x) (((x) & 0x80000000) >> 31) -#define MAC_PCU_SLP4_ASSUME_DTIM2_SET(x) (((x) << 31) & 0x80000000) - -/* macros for MAC_PCU_RESET_TSF */ -#define MAC_PCU_RESET_TSF_ADDRESS 0x000000d0 -#define MAC_PCU_RESET_TSF_OFFSET 0x000000d0 -#define MAC_PCU_RESET_TSF_ONE_SHOT_MSB 24 -#define MAC_PCU_RESET_TSF_ONE_SHOT_LSB 24 -#define MAC_PCU_RESET_TSF_ONE_SHOT_MASK 0x01000000 -#define MAC_PCU_RESET_TSF_ONE_SHOT_GET(x) (((x) & 0x01000000) >> 24) -#define MAC_PCU_RESET_TSF_ONE_SHOT_SET(x) (((x) << 24) & 0x01000000) -#define MAC_PCU_RESET_TSF_ONE_SHOT2_MSB 25 -#define MAC_PCU_RESET_TSF_ONE_SHOT2_LSB 25 -#define MAC_PCU_RESET_TSF_ONE_SHOT2_MASK 0x02000000 -#define MAC_PCU_RESET_TSF_ONE_SHOT2_GET(x) (((x) & 0x02000000) >> 25) -#define MAC_PCU_RESET_TSF_ONE_SHOT2_SET(x) (((x) << 25) & 0x02000000) - -/* macros for MAC_PCU_TSF2_L32 */ -#define MAC_PCU_TSF2_L32_ADDRESS 0x000000d4 -#define MAC_PCU_TSF2_L32_OFFSET 0x000000d4 -#define MAC_PCU_TSF2_L32_VALUE_MSB 31 -#define MAC_PCU_TSF2_L32_VALUE_LSB 0 -#define MAC_PCU_TSF2_L32_VALUE_MASK 0xffffffff -#define MAC_PCU_TSF2_L32_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_TSF2_L32_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_TSF2_U32 */ -#define MAC_PCU_TSF2_U32_ADDRESS 0x000000d8 -#define MAC_PCU_TSF2_U32_OFFSET 0x000000d8 -#define MAC_PCU_TSF2_U32_VALUE_MSB 31 -#define MAC_PCU_TSF2_U32_VALUE_LSB 0 -#define MAC_PCU_TSF2_U32_VALUE_MASK 0xffffffff -#define MAC_PCU_TSF2_U32_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_TSF2_U32_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_GENERIC_TIMERS2 */ -#define MAC_PCU_GENERIC_TIMERS2_ADDRESS 0x000000dc -#define MAC_PCU_GENERIC_TIMERS2_OFFSET 0x000000dc -#define MAC_PCU_GENERIC_TIMERS2_DATA_MSB 31 -#define MAC_PCU_GENERIC_TIMERS2_DATA_LSB 0 -#define MAC_PCU_GENERIC_TIMERS2_DATA_MASK 0xffffffff -#define MAC_PCU_GENERIC_TIMERS2_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_GENERIC_TIMERS2_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_GENERIC_TIMERS_MODE2 */ -#define MAC_PCU_GENERIC_TIMERS_MODE2_ADDRESS 0x00000134 -#define MAC_PCU_GENERIC_TIMERS_MODE2_OFFSET 0x00000134 -#define MAC_PCU_GENERIC_TIMERS_MODE2_ENABLE_MSB 7 -#define MAC_PCU_GENERIC_TIMERS_MODE2_ENABLE_LSB 0 -#define MAC_PCU_GENERIC_TIMERS_MODE2_ENABLE_MASK 0x000000ff -#define MAC_PCU_GENERIC_TIMERS_MODE2_ENABLE_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_GENERIC_TIMERS_MODE2_ENABLE_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_GENERIC_TIMERS_MODE2_OVERFLOW_INDEX_MSB 11 -#define MAC_PCU_GENERIC_TIMERS_MODE2_OVERFLOW_INDEX_LSB 8 -#define MAC_PCU_GENERIC_TIMERS_MODE2_OVERFLOW_INDEX_MASK 0x00000f00 -#define MAC_PCU_GENERIC_TIMERS_MODE2_OVERFLOW_INDEX_GET(x) (((x) & 0x00000f00) >> 8) -#define MAC_PCU_GENERIC_TIMERS_MODE2_OVERFLOW_INDEX2_MSB 15 -#define MAC_PCU_GENERIC_TIMERS_MODE2_OVERFLOW_INDEX2_LSB 12 -#define MAC_PCU_GENERIC_TIMERS_MODE2_OVERFLOW_INDEX2_MASK 0x0000f000 -#define MAC_PCU_GENERIC_TIMERS_MODE2_OVERFLOW_INDEX2_GET(x) (((x) & 0x0000f000) >> 12) - -/* macros for MAC_PCU_TSF_THRESHOLD */ -#define MAC_PCU_TSF_THRESHOLD_ADDRESS 0x00000144 -#define MAC_PCU_TSF_THRESHOLD_OFFSET 0x00000144 -#define MAC_PCU_TSF_THRESHOLD_VALUE_MSB 15 -#define MAC_PCU_TSF_THRESHOLD_VALUE_LSB 0 -#define MAC_PCU_TSF_THRESHOLD_VALUE_MASK 0x0000ffff -#define MAC_PCU_TSF_THRESHOLD_VALUE_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_TSF_THRESHOLD_VALUE_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for WLAN_HT */ -#define WLAN_HT_ADDRESS 0x00000148 -#define WLAN_HT_OFFSET 0x00000148 -#define WLAN_HT_MODE_MSB 0 -#define WLAN_HT_MODE_LSB 0 -#define WLAN_HT_MODE_MASK 0x00000001 -#define WLAN_HT_MODE_GET(x) (((x) & 0x00000001) >> 0) -#define WLAN_HT_MODE_SET(x) (((x) << 0) & 0x00000001) - -/* macros for MAC_PCU_GENERIC_TIMERS_TSF_SEL */ -#define MAC_PCU_GENERIC_TIMERS_TSF_SEL_ADDRESS 0x00000150 -#define MAC_PCU_GENERIC_TIMERS_TSF_SEL_OFFSET 0x00000150 -#define MAC_PCU_GENERIC_TIMERS_TSF_SEL_VALUE_MSB 15 -#define MAC_PCU_GENERIC_TIMERS_TSF_SEL_VALUE_LSB 0 -#define MAC_PCU_GENERIC_TIMERS_TSF_SEL_VALUE_MASK 0x0000ffff -#define MAC_PCU_GENERIC_TIMERS_TSF_SEL_VALUE_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_GENERIC_TIMERS_TSF_SEL_VALUE_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MAC_PCU_BMISS_TIMEOUT */ -#define MAC_PCU_BMISS_TIMEOUT_ADDRESS 0x00000154 -#define MAC_PCU_BMISS_TIMEOUT_OFFSET 0x00000154 -#define MAC_PCU_BMISS_TIMEOUT_VALUE_MSB 23 -#define MAC_PCU_BMISS_TIMEOUT_VALUE_LSB 0 -#define MAC_PCU_BMISS_TIMEOUT_VALUE_MASK 0x00ffffff -#define MAC_PCU_BMISS_TIMEOUT_VALUE_GET(x) (((x) & 0x00ffffff) >> 0) -#define MAC_PCU_BMISS_TIMEOUT_VALUE_SET(x) (((x) << 0) & 0x00ffffff) -#define MAC_PCU_BMISS_TIMEOUT_ENABLE_MSB 24 -#define MAC_PCU_BMISS_TIMEOUT_ENABLE_LSB 24 -#define MAC_PCU_BMISS_TIMEOUT_ENABLE_MASK 0x01000000 -#define MAC_PCU_BMISS_TIMEOUT_ENABLE_GET(x) (((x) & 0x01000000) >> 24) -#define MAC_PCU_BMISS_TIMEOUT_ENABLE_SET(x) (((x) << 24) & 0x01000000) - -/* macros for MAC_PCU_BMISS2_TIMEOUT */ -#define MAC_PCU_BMISS2_TIMEOUT_ADDRESS 0x00000158 -#define MAC_PCU_BMISS2_TIMEOUT_OFFSET 0x00000158 -#define MAC_PCU_BMISS2_TIMEOUT_VALUE_MSB 23 -#define MAC_PCU_BMISS2_TIMEOUT_VALUE_LSB 0 -#define MAC_PCU_BMISS2_TIMEOUT_VALUE_MASK 0x00ffffff -#define MAC_PCU_BMISS2_TIMEOUT_VALUE_GET(x) (((x) & 0x00ffffff) >> 0) -#define MAC_PCU_BMISS2_TIMEOUT_VALUE_SET(x) (((x) << 0) & 0x00ffffff) -#define MAC_PCU_BMISS2_TIMEOUT_ENABLE_MSB 24 -#define MAC_PCU_BMISS2_TIMEOUT_ENABLE_LSB 24 -#define MAC_PCU_BMISS2_TIMEOUT_ENABLE_MASK 0x01000000 -#define MAC_PCU_BMISS2_TIMEOUT_ENABLE_GET(x) (((x) & 0x01000000) >> 24) -#define MAC_PCU_BMISS2_TIMEOUT_ENABLE_SET(x) (((x) << 24) & 0x01000000) - -/* macros for RTC_AXI_AHB_BRIDGE */ -#define RTC_AXI_AHB_BRIDGE_ADDRESS 0x0000015c -#define RTC_AXI_AHB_BRIDGE_OFFSET 0x0000015c -#define RTC_AXI_AHB_BRIDGE_MAX_BEATS_MSB 1 -#define RTC_AXI_AHB_BRIDGE_MAX_BEATS_LSB 0 -#define RTC_AXI_AHB_BRIDGE_MAX_BEATS_MASK 0x00000003 -#define RTC_AXI_AHB_BRIDGE_MAX_BEATS_GET(x) (((x) & 0x00000003) >> 0) -#define RTC_AXI_AHB_BRIDGE_MAX_BEATS_SET(x) (((x) << 0) & 0x00000003) - -/* macros for UNIFIED_MAC_REVID */ -#define UNIFIED_MAC_REVID_ADDRESS 0x00000160 -#define UNIFIED_MAC_REVID_OFFSET 0x00000160 -#define UNIFIED_MAC_REVID_VALUE_MSB 31 -#define UNIFIED_MAC_REVID_VALUE_LSB 0 -#define UNIFIED_MAC_REVID_VALUE_MASK 0xffffffff -#define UNIFIED_MAC_REVID_VALUE_GET(x) (((x) & 0xffffffff) >> 0) - - -#ifndef __ASSEMBLER__ - -typedef struct rtc_wlan_reg_reg_s { - volatile unsigned int WLAN_RESET_CONTROL; /* 0x0 - 0x4 */ - volatile unsigned int WLAN_XTAL_CONTROL; /* 0x4 - 0x8 */ - volatile unsigned int WLAN_REG_CONTROL0; /* 0x8 - 0xc */ - volatile unsigned int WLAN_REG_CONTROL1; /* 0xc - 0x10 */ - volatile unsigned int WLAN_QUADRATURE; /* 0x10 - 0x14 */ - volatile unsigned int WLAN_PLL_CONTROL; /* 0x14 - 0x18 */ - volatile unsigned int WLAN_PLL_SETTLE; /* 0x18 - 0x1c */ - volatile unsigned int WLAN_XTAL_SETTLE; /* 0x1c - 0x20 */ - volatile unsigned int WLAN_CLOCK_OUT; /* 0x20 - 0x24 */ - volatile unsigned int WLAN_BIAS_OVERRIDE; /* 0x24 - 0x28 */ - volatile unsigned int WLAN_RESET_CAUSE; /* 0x28 - 0x2c */ - volatile unsigned int WLAN_SYSTEM_SLEEP; /* 0x2c - 0x30 */ - volatile unsigned int WLAN_MAC_SLEEP_CONTROL; /* 0x30 - 0x34 */ - volatile unsigned int WLAN_KEEP_AWAKE; /* 0x34 - 0x38 */ - volatile unsigned int WLAN_DERIVED_RTC_CLK; /* 0x38 - 0x3c */ - volatile unsigned int MAC_PCU_SLP32_MODE; /* 0x3c - 0x40 */ - volatile unsigned int MAC_PCU_SLP32_WAKE; /* 0x40 - 0x44 */ - volatile unsigned int MAC_PCU_SLP32_INC; /* 0x44 - 0x48 */ - volatile unsigned int MAC_PCU_SLP_MIB1; /* 0x48 - 0x4c */ - volatile unsigned int MAC_PCU_SLP_MIB2; /* 0x4c - 0x50 */ - volatile unsigned int MAC_PCU_SLP_MIB3; /* 0x50 - 0x54 */ - volatile unsigned int MAC_PCU_TSF_L32; /* 0x54 - 0x58 */ - volatile unsigned int MAC_PCU_TSF_U32; /* 0x58 - 0x5c */ - volatile unsigned int MAC_PCU_WBTIMER_0; /* 0x5c - 0x60 */ - volatile unsigned int MAC_PCU_WBTIMER_1; /* 0x60 - 0x64 */ - volatile unsigned int MAC_PCU_GENERIC_TIMERS[16]; /* 0x64 - 0xa4 */ - volatile char pad__0[0x18]; /* 0xa4 - 0xbc */ - volatile unsigned int MAC_PCU_GENERIC_TIMERS_MODE; /* 0xbc - 0xc0 */ - volatile unsigned int MAC_PCU_SLP1; /* 0xc0 - 0xc4 */ - volatile unsigned int MAC_PCU_SLP2; /* 0xc4 - 0xc8 */ - volatile unsigned int MAC_PCU_SLP3; /* 0xc8 - 0xcc */ - volatile unsigned int MAC_PCU_SLP4; /* 0xcc - 0xd0 */ - volatile unsigned int MAC_PCU_RESET_TSF; /* 0xd0 - 0xd4 */ - volatile unsigned int MAC_PCU_TSF2_L32; /* 0xd4 - 0xd8 */ - volatile unsigned int MAC_PCU_TSF2_U32; /* 0xd8 - 0xdc */ - volatile unsigned int MAC_PCU_GENERIC_TIMERS2[16]; /* 0xdc - 0x11c */ - volatile char pad__1[0x18]; /* 0x11c - 0x134 */ - volatile unsigned int MAC_PCU_GENERIC_TIMERS_MODE2; /* 0x134 - 0x138 */ - volatile char pad__2[0xc]; /* 0x138 - 0x144 */ - volatile unsigned int MAC_PCU_TSF_THRESHOLD; /* 0x144 - 0x148 */ - volatile unsigned int WLAN_HT; /* 0x148 - 0x14c */ - volatile char pad__3[0x4]; /* 0x14c - 0x150 */ - volatile unsigned int MAC_PCU_GENERIC_TIMERS_TSF_SEL; /* 0x150 - 0x154 */ - volatile unsigned int MAC_PCU_BMISS_TIMEOUT; /* 0x154 - 0x158 */ - volatile unsigned int MAC_PCU_BMISS2_TIMEOUT; /* 0x158 - 0x15c */ - volatile unsigned int RTC_AXI_AHB_BRIDGE; /* 0x15c - 0x160 */ - volatile unsigned int UNIFIED_MAC_REVID; /* 0x160 - 0x164 */ -} rtc_wlan_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _RTC_WLAN_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/si_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/si_reg.h deleted file mode 100644 index b1d07a9062ab..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/si_reg.h +++ /dev/null @@ -1,308 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _SI_REG_REG_H_ -#define _SI_REG_REG_H_ - -#define SI_CONFIG_ADDRESS 0x00000000 -#define SI_CONFIG_OFFSET 0x00000000 -#define SI_CONFIG_ERR_INT_MSB 19 -#define SI_CONFIG_ERR_INT_LSB 19 -#define SI_CONFIG_ERR_INT_MASK 0x00080000 -#define SI_CONFIG_ERR_INT_GET(x) (((x) & SI_CONFIG_ERR_INT_MASK) >> SI_CONFIG_ERR_INT_LSB) -#define SI_CONFIG_ERR_INT_SET(x) (((x) << SI_CONFIG_ERR_INT_LSB) & SI_CONFIG_ERR_INT_MASK) -#define SI_CONFIG_BIDIR_OD_DATA_MSB 18 -#define SI_CONFIG_BIDIR_OD_DATA_LSB 18 -#define SI_CONFIG_BIDIR_OD_DATA_MASK 0x00040000 -#define SI_CONFIG_BIDIR_OD_DATA_GET(x) (((x) & SI_CONFIG_BIDIR_OD_DATA_MASK) >> SI_CONFIG_BIDIR_OD_DATA_LSB) -#define SI_CONFIG_BIDIR_OD_DATA_SET(x) (((x) << SI_CONFIG_BIDIR_OD_DATA_LSB) & SI_CONFIG_BIDIR_OD_DATA_MASK) -#define SI_CONFIG_I2C_MSB 16 -#define SI_CONFIG_I2C_LSB 16 -#define SI_CONFIG_I2C_MASK 0x00010000 -#define SI_CONFIG_I2C_GET(x) (((x) & SI_CONFIG_I2C_MASK) >> SI_CONFIG_I2C_LSB) -#define SI_CONFIG_I2C_SET(x) (((x) << SI_CONFIG_I2C_LSB) & SI_CONFIG_I2C_MASK) -#define SI_CONFIG_POS_SAMPLE_MSB 7 -#define SI_CONFIG_POS_SAMPLE_LSB 7 -#define SI_CONFIG_POS_SAMPLE_MASK 0x00000080 -#define SI_CONFIG_POS_SAMPLE_GET(x) (((x) & SI_CONFIG_POS_SAMPLE_MASK) >> SI_CONFIG_POS_SAMPLE_LSB) -#define SI_CONFIG_POS_SAMPLE_SET(x) (((x) << SI_CONFIG_POS_SAMPLE_LSB) & SI_CONFIG_POS_SAMPLE_MASK) -#define SI_CONFIG_POS_DRIVE_MSB 6 -#define SI_CONFIG_POS_DRIVE_LSB 6 -#define SI_CONFIG_POS_DRIVE_MASK 0x00000040 -#define SI_CONFIG_POS_DRIVE_GET(x) (((x) & SI_CONFIG_POS_DRIVE_MASK) >> SI_CONFIG_POS_DRIVE_LSB) -#define SI_CONFIG_POS_DRIVE_SET(x) (((x) << SI_CONFIG_POS_DRIVE_LSB) & SI_CONFIG_POS_DRIVE_MASK) -#define SI_CONFIG_INACTIVE_DATA_MSB 5 -#define SI_CONFIG_INACTIVE_DATA_LSB 5 -#define SI_CONFIG_INACTIVE_DATA_MASK 0x00000020 -#define SI_CONFIG_INACTIVE_DATA_GET(x) (((x) & SI_CONFIG_INACTIVE_DATA_MASK) >> SI_CONFIG_INACTIVE_DATA_LSB) -#define SI_CONFIG_INACTIVE_DATA_SET(x) (((x) << SI_CONFIG_INACTIVE_DATA_LSB) & SI_CONFIG_INACTIVE_DATA_MASK) -#define SI_CONFIG_INACTIVE_CLK_MSB 4 -#define SI_CONFIG_INACTIVE_CLK_LSB 4 -#define SI_CONFIG_INACTIVE_CLK_MASK 0x00000010 -#define SI_CONFIG_INACTIVE_CLK_GET(x) (((x) & SI_CONFIG_INACTIVE_CLK_MASK) >> SI_CONFIG_INACTIVE_CLK_LSB) -#define SI_CONFIG_INACTIVE_CLK_SET(x) (((x) << SI_CONFIG_INACTIVE_CLK_LSB) & SI_CONFIG_INACTIVE_CLK_MASK) -#define SI_CONFIG_DIVIDER_MSB 3 -#define SI_CONFIG_DIVIDER_LSB 0 -#define SI_CONFIG_DIVIDER_MASK 0x0000000f -#define SI_CONFIG_DIVIDER_GET(x) (((x) & SI_CONFIG_DIVIDER_MASK) >> SI_CONFIG_DIVIDER_LSB) -#define SI_CONFIG_DIVIDER_SET(x) (((x) << SI_CONFIG_DIVIDER_LSB) & SI_CONFIG_DIVIDER_MASK) - -#define SI_CS_ADDRESS 0x00000004 -#define SI_CS_OFFSET 0x00000004 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_MSB 13 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_LSB 11 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_MASK 0x00003800 -#define SI_CS_BIT_CNT_IN_LAST_BYTE_GET(x) (((x) & SI_CS_BIT_CNT_IN_LAST_BYTE_MASK) >> SI_CS_BIT_CNT_IN_LAST_BYTE_LSB) -#define SI_CS_BIT_CNT_IN_LAST_BYTE_SET(x) (((x) << SI_CS_BIT_CNT_IN_LAST_BYTE_LSB) & SI_CS_BIT_CNT_IN_LAST_BYTE_MASK) -#define SI_CS_DONE_ERR_MSB 10 -#define SI_CS_DONE_ERR_LSB 10 -#define SI_CS_DONE_ERR_MASK 0x00000400 -#define SI_CS_DONE_ERR_GET(x) (((x) & SI_CS_DONE_ERR_MASK) >> SI_CS_DONE_ERR_LSB) -#define SI_CS_DONE_ERR_SET(x) (((x) << SI_CS_DONE_ERR_LSB) & SI_CS_DONE_ERR_MASK) -#define SI_CS_DONE_INT_MSB 9 -#define SI_CS_DONE_INT_LSB 9 -#define SI_CS_DONE_INT_MASK 0x00000200 -#define SI_CS_DONE_INT_GET(x) (((x) & SI_CS_DONE_INT_MASK) >> SI_CS_DONE_INT_LSB) -#define SI_CS_DONE_INT_SET(x) (((x) << SI_CS_DONE_INT_LSB) & SI_CS_DONE_INT_MASK) -#define SI_CS_START_MSB 8 -#define SI_CS_START_LSB 8 -#define SI_CS_START_MASK 0x00000100 -#define SI_CS_START_GET(x) (((x) & SI_CS_START_MASK) >> SI_CS_START_LSB) -#define SI_CS_START_SET(x) (((x) << SI_CS_START_LSB) & SI_CS_START_MASK) -#define SI_CS_RX_CNT_MSB 7 -#define SI_CS_RX_CNT_LSB 4 -#define SI_CS_RX_CNT_MASK 0x000000f0 -#define SI_CS_RX_CNT_GET(x) (((x) & SI_CS_RX_CNT_MASK) >> SI_CS_RX_CNT_LSB) -#define SI_CS_RX_CNT_SET(x) (((x) << SI_CS_RX_CNT_LSB) & SI_CS_RX_CNT_MASK) -#define SI_CS_TX_CNT_MSB 3 -#define SI_CS_TX_CNT_LSB 0 -#define SI_CS_TX_CNT_MASK 0x0000000f -#define SI_CS_TX_CNT_GET(x) (((x) & SI_CS_TX_CNT_MASK) >> SI_CS_TX_CNT_LSB) -#define SI_CS_TX_CNT_SET(x) (((x) << SI_CS_TX_CNT_LSB) & SI_CS_TX_CNT_MASK) - -#define SI_TX_DATA0_ADDRESS 0x00000008 -#define SI_TX_DATA0_OFFSET 0x00000008 -#define SI_TX_DATA0_DATA3_MSB 31 -#define SI_TX_DATA0_DATA3_LSB 24 -#define SI_TX_DATA0_DATA3_MASK 0xff000000 -#define SI_TX_DATA0_DATA3_GET(x) (((x) & SI_TX_DATA0_DATA3_MASK) >> SI_TX_DATA0_DATA3_LSB) -#define SI_TX_DATA0_DATA3_SET(x) (((x) << SI_TX_DATA0_DATA3_LSB) & SI_TX_DATA0_DATA3_MASK) -#define SI_TX_DATA0_DATA2_MSB 23 -#define SI_TX_DATA0_DATA2_LSB 16 -#define SI_TX_DATA0_DATA2_MASK 0x00ff0000 -#define SI_TX_DATA0_DATA2_GET(x) (((x) & SI_TX_DATA0_DATA2_MASK) >> SI_TX_DATA0_DATA2_LSB) -#define SI_TX_DATA0_DATA2_SET(x) (((x) << SI_TX_DATA0_DATA2_LSB) & SI_TX_DATA0_DATA2_MASK) -#define SI_TX_DATA0_DATA1_MSB 15 -#define SI_TX_DATA0_DATA1_LSB 8 -#define SI_TX_DATA0_DATA1_MASK 0x0000ff00 -#define SI_TX_DATA0_DATA1_GET(x) (((x) & SI_TX_DATA0_DATA1_MASK) >> SI_TX_DATA0_DATA1_LSB) -#define SI_TX_DATA0_DATA1_SET(x) (((x) << SI_TX_DATA0_DATA1_LSB) & SI_TX_DATA0_DATA1_MASK) -#define SI_TX_DATA0_DATA0_MSB 7 -#define SI_TX_DATA0_DATA0_LSB 0 -#define SI_TX_DATA0_DATA0_MASK 0x000000ff -#define SI_TX_DATA0_DATA0_GET(x) (((x) & SI_TX_DATA0_DATA0_MASK) >> SI_TX_DATA0_DATA0_LSB) -#define SI_TX_DATA0_DATA0_SET(x) (((x) << SI_TX_DATA0_DATA0_LSB) & SI_TX_DATA0_DATA0_MASK) - -#define SI_TX_DATA1_ADDRESS 0x0000000c -#define SI_TX_DATA1_OFFSET 0x0000000c -#define SI_TX_DATA1_DATA7_MSB 31 -#define SI_TX_DATA1_DATA7_LSB 24 -#define SI_TX_DATA1_DATA7_MASK 0xff000000 -#define SI_TX_DATA1_DATA7_GET(x) (((x) & SI_TX_DATA1_DATA7_MASK) >> SI_TX_DATA1_DATA7_LSB) -#define SI_TX_DATA1_DATA7_SET(x) (((x) << SI_TX_DATA1_DATA7_LSB) & SI_TX_DATA1_DATA7_MASK) -#define SI_TX_DATA1_DATA6_MSB 23 -#define SI_TX_DATA1_DATA6_LSB 16 -#define SI_TX_DATA1_DATA6_MASK 0x00ff0000 -#define SI_TX_DATA1_DATA6_GET(x) (((x) & SI_TX_DATA1_DATA6_MASK) >> SI_TX_DATA1_DATA6_LSB) -#define SI_TX_DATA1_DATA6_SET(x) (((x) << SI_TX_DATA1_DATA6_LSB) & SI_TX_DATA1_DATA6_MASK) -#define SI_TX_DATA1_DATA5_MSB 15 -#define SI_TX_DATA1_DATA5_LSB 8 -#define SI_TX_DATA1_DATA5_MASK 0x0000ff00 -#define SI_TX_DATA1_DATA5_GET(x) (((x) & SI_TX_DATA1_DATA5_MASK) >> SI_TX_DATA1_DATA5_LSB) -#define SI_TX_DATA1_DATA5_SET(x) (((x) << SI_TX_DATA1_DATA5_LSB) & SI_TX_DATA1_DATA5_MASK) -#define SI_TX_DATA1_DATA4_MSB 7 -#define SI_TX_DATA1_DATA4_LSB 0 -#define SI_TX_DATA1_DATA4_MASK 0x000000ff -#define SI_TX_DATA1_DATA4_GET(x) (((x) & SI_TX_DATA1_DATA4_MASK) >> SI_TX_DATA1_DATA4_LSB) -#define SI_TX_DATA1_DATA4_SET(x) (((x) << SI_TX_DATA1_DATA4_LSB) & SI_TX_DATA1_DATA4_MASK) - -#define SI_RX_DATA0_ADDRESS 0x00000010 -#define SI_RX_DATA0_OFFSET 0x00000010 -#define SI_RX_DATA0_DATA3_MSB 31 -#define SI_RX_DATA0_DATA3_LSB 24 -#define SI_RX_DATA0_DATA3_MASK 0xff000000 -#define SI_RX_DATA0_DATA3_GET(x) (((x) & SI_RX_DATA0_DATA3_MASK) >> SI_RX_DATA0_DATA3_LSB) -#define SI_RX_DATA0_DATA3_SET(x) (((x) << SI_RX_DATA0_DATA3_LSB) & SI_RX_DATA0_DATA3_MASK) -#define SI_RX_DATA0_DATA2_MSB 23 -#define SI_RX_DATA0_DATA2_LSB 16 -#define SI_RX_DATA0_DATA2_MASK 0x00ff0000 -#define SI_RX_DATA0_DATA2_GET(x) (((x) & SI_RX_DATA0_DATA2_MASK) >> SI_RX_DATA0_DATA2_LSB) -#define SI_RX_DATA0_DATA2_SET(x) (((x) << SI_RX_DATA0_DATA2_LSB) & SI_RX_DATA0_DATA2_MASK) -#define SI_RX_DATA0_DATA1_MSB 15 -#define SI_RX_DATA0_DATA1_LSB 8 -#define SI_RX_DATA0_DATA1_MASK 0x0000ff00 -#define SI_RX_DATA0_DATA1_GET(x) (((x) & SI_RX_DATA0_DATA1_MASK) >> SI_RX_DATA0_DATA1_LSB) -#define SI_RX_DATA0_DATA1_SET(x) (((x) << SI_RX_DATA0_DATA1_LSB) & SI_RX_DATA0_DATA1_MASK) -#define SI_RX_DATA0_DATA0_MSB 7 -#define SI_RX_DATA0_DATA0_LSB 0 -#define SI_RX_DATA0_DATA0_MASK 0x000000ff -#define SI_RX_DATA0_DATA0_GET(x) (((x) & SI_RX_DATA0_DATA0_MASK) >> SI_RX_DATA0_DATA0_LSB) -#define SI_RX_DATA0_DATA0_SET(x) (((x) << SI_RX_DATA0_DATA0_LSB) & SI_RX_DATA0_DATA0_MASK) - -#define SI_RX_DATA1_ADDRESS 0x00000014 -#define SI_RX_DATA1_OFFSET 0x00000014 -#define SI_RX_DATA1_DATA7_MSB 31 -#define SI_RX_DATA1_DATA7_LSB 24 -#define SI_RX_DATA1_DATA7_MASK 0xff000000 -#define SI_RX_DATA1_DATA7_GET(x) (((x) & SI_RX_DATA1_DATA7_MASK) >> SI_RX_DATA1_DATA7_LSB) -#define SI_RX_DATA1_DATA7_SET(x) (((x) << SI_RX_DATA1_DATA7_LSB) & SI_RX_DATA1_DATA7_MASK) -#define SI_RX_DATA1_DATA6_MSB 23 -#define SI_RX_DATA1_DATA6_LSB 16 -#define SI_RX_DATA1_DATA6_MASK 0x00ff0000 -#define SI_RX_DATA1_DATA6_GET(x) (((x) & SI_RX_DATA1_DATA6_MASK) >> SI_RX_DATA1_DATA6_LSB) -#define SI_RX_DATA1_DATA6_SET(x) (((x) << SI_RX_DATA1_DATA6_LSB) & SI_RX_DATA1_DATA6_MASK) -#define SI_RX_DATA1_DATA5_MSB 15 -#define SI_RX_DATA1_DATA5_LSB 8 -#define SI_RX_DATA1_DATA5_MASK 0x0000ff00 -#define SI_RX_DATA1_DATA5_GET(x) (((x) & SI_RX_DATA1_DATA5_MASK) >> SI_RX_DATA1_DATA5_LSB) -#define SI_RX_DATA1_DATA5_SET(x) (((x) << SI_RX_DATA1_DATA5_LSB) & SI_RX_DATA1_DATA5_MASK) -#define SI_RX_DATA1_DATA4_MSB 7 -#define SI_RX_DATA1_DATA4_LSB 0 -#define SI_RX_DATA1_DATA4_MASK 0x000000ff -#define SI_RX_DATA1_DATA4_GET(x) (((x) & SI_RX_DATA1_DATA4_MASK) >> SI_RX_DATA1_DATA4_LSB) -#define SI_RX_DATA1_DATA4_SET(x) (((x) << SI_RX_DATA1_DATA4_LSB) & SI_RX_DATA1_DATA4_MASK) - -#define WLAN_APB_ADDR_ERROR_CONTROL_ADDRESS 0x00000018 -#define WLAN_APB_ADDR_ERROR_CONTROL_OFFSET 0x00000018 -#define WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_MSB 1 -#define WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB 1 -#define WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK 0x00000002 -#define WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_GET(x) (((x) & WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK) >> WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB) -#define WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_SET(x) (((x) << WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_LSB) & WLAN_APB_ADDR_ERROR_CONTROL_QUAL_ENABLE_MASK) -#define WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_MSB 0 -#define WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_LSB 0 -#define WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_MASK 0x00000001 -#define WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_GET(x) (((x) & WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_MASK) >> WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_LSB) -#define WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_SET(x) (((x) << WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_LSB) & WLAN_APB_ADDR_ERROR_CONTROL_ENABLE_MASK) - -#define WLAN_APB_ADDR_ERROR_STATUS_ADDRESS 0x0000001c -#define WLAN_APB_ADDR_ERROR_STATUS_OFFSET 0x0000001c -#define WLAN_APB_ADDR_ERROR_STATUS_WRITE_MSB 25 -#define WLAN_APB_ADDR_ERROR_STATUS_WRITE_LSB 25 -#define WLAN_APB_ADDR_ERROR_STATUS_WRITE_MASK 0x02000000 -#define WLAN_APB_ADDR_ERROR_STATUS_WRITE_GET(x) (((x) & WLAN_APB_ADDR_ERROR_STATUS_WRITE_MASK) >> WLAN_APB_ADDR_ERROR_STATUS_WRITE_LSB) -#define WLAN_APB_ADDR_ERROR_STATUS_WRITE_SET(x) (((x) << WLAN_APB_ADDR_ERROR_STATUS_WRITE_LSB) & WLAN_APB_ADDR_ERROR_STATUS_WRITE_MASK) -#define WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_MSB 24 -#define WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_LSB 0 -#define WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_MASK 0x01ffffff -#define WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_GET(x) (((x) & WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_MASK) >> WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_LSB) -#define WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_SET(x) (((x) << WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_LSB) & WLAN_APB_ADDR_ERROR_STATUS_ADDRESS_MASK) - -#define WLAN_AHB_ADDR_ERROR_CONTROL_ADDRESS 0x00000020 -#define WLAN_AHB_ADDR_ERROR_CONTROL_OFFSET 0x00000020 -#define WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_MSB 0 -#define WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_LSB 0 -#define WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_MASK 0x00000001 -#define WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_GET(x) (((x) & WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_MASK) >> WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_LSB) -#define WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_SET(x) (((x) << WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_LSB) & WLAN_AHB_ADDR_ERROR_CONTROL_ENABLE_MASK) - -#define WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS 0x00000024 -#define WLAN_AHB_ADDR_ERROR_STATUS_OFFSET 0x00000024 -#define WLAN_AHB_ADDR_ERROR_STATUS_MAC_MSB 31 -#define WLAN_AHB_ADDR_ERROR_STATUS_MAC_LSB 31 -#define WLAN_AHB_ADDR_ERROR_STATUS_MAC_MASK 0x80000000 -#define WLAN_AHB_ADDR_ERROR_STATUS_MAC_GET(x) (((x) & WLAN_AHB_ADDR_ERROR_STATUS_MAC_MASK) >> WLAN_AHB_ADDR_ERROR_STATUS_MAC_LSB) -#define WLAN_AHB_ADDR_ERROR_STATUS_MAC_SET(x) (((x) << WLAN_AHB_ADDR_ERROR_STATUS_MAC_LSB) & WLAN_AHB_ADDR_ERROR_STATUS_MAC_MASK) -#define WLAN_AHB_ADDR_ERROR_STATUS_MBOX_MSB 30 -#define WLAN_AHB_ADDR_ERROR_STATUS_MBOX_LSB 30 -#define WLAN_AHB_ADDR_ERROR_STATUS_MBOX_MASK 0x40000000 -#define WLAN_AHB_ADDR_ERROR_STATUS_MBOX_GET(x) (((x) & WLAN_AHB_ADDR_ERROR_STATUS_MBOX_MASK) >> WLAN_AHB_ADDR_ERROR_STATUS_MBOX_LSB) -#define WLAN_AHB_ADDR_ERROR_STATUS_MBOX_SET(x) (((x) << WLAN_AHB_ADDR_ERROR_STATUS_MBOX_LSB) & WLAN_AHB_ADDR_ERROR_STATUS_MBOX_MASK) -#define WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_MSB 23 -#define WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_LSB 0 -#define WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_MASK 0x00ffffff -#define WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_GET(x) (((x) & WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_MASK) >> WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_LSB) -#define WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_SET(x) (((x) << WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_LSB) & WLAN_AHB_ADDR_ERROR_STATUS_ADDRESS_MASK) - -#define WLAN_AHB_CONFIG_ADDRESS 0x00000028 -#define WLAN_AHB_CONFIG_OFFSET 0x00000028 -#define WLAN_AHB_CONFIG_MAX_BURST_16_MSB 2 -#define WLAN_AHB_CONFIG_MAX_BURST_16_LSB 2 -#define WLAN_AHB_CONFIG_MAX_BURST_16_MASK 0x00000004 -#define WLAN_AHB_CONFIG_MAX_BURST_16_GET(x) (((x) & WLAN_AHB_CONFIG_MAX_BURST_16_MASK) >> WLAN_AHB_CONFIG_MAX_BURST_16_LSB) -#define WLAN_AHB_CONFIG_MAX_BURST_16_SET(x) (((x) << WLAN_AHB_CONFIG_MAX_BURST_16_LSB) & WLAN_AHB_CONFIG_MAX_BURST_16_MASK) -#define WLAN_AHB_CONFIG_MAX_BURST_8_MSB 1 -#define WLAN_AHB_CONFIG_MAX_BURST_8_LSB 1 -#define WLAN_AHB_CONFIG_MAX_BURST_8_MASK 0x00000002 -#define WLAN_AHB_CONFIG_MAX_BURST_8_GET(x) (((x) & WLAN_AHB_CONFIG_MAX_BURST_8_MASK) >> WLAN_AHB_CONFIG_MAX_BURST_8_LSB) -#define WLAN_AHB_CONFIG_MAX_BURST_8_SET(x) (((x) << WLAN_AHB_CONFIG_MAX_BURST_8_LSB) & WLAN_AHB_CONFIG_MAX_BURST_8_MASK) -#define WLAN_AHB_CONFIG_MAX_BURST_4_MSB 0 -#define WLAN_AHB_CONFIG_MAX_BURST_4_LSB 0 -#define WLAN_AHB_CONFIG_MAX_BURST_4_MASK 0x00000001 -#define WLAN_AHB_CONFIG_MAX_BURST_4_GET(x) (((x) & WLAN_AHB_CONFIG_MAX_BURST_4_MASK) >> WLAN_AHB_CONFIG_MAX_BURST_4_LSB) -#define WLAN_AHB_CONFIG_MAX_BURST_4_SET(x) (((x) << WLAN_AHB_CONFIG_MAX_BURST_4_LSB) & WLAN_AHB_CONFIG_MAX_BURST_4_MASK) - -#define WLAN_MEMORY_MAP_ADDRESS 0x0000002c -#define WLAN_MEMORY_MAP_OFFSET 0x0000002c -#define WLAN_MEMORY_MAP_FOUR_IRAM_BANKS_MSB 3 -#define WLAN_MEMORY_MAP_FOUR_IRAM_BANKS_LSB 3 -#define WLAN_MEMORY_MAP_FOUR_IRAM_BANKS_MASK 0x00000008 -#define WLAN_MEMORY_MAP_FOUR_IRAM_BANKS_GET(x) (((x) & WLAN_MEMORY_MAP_FOUR_IRAM_BANKS_MASK) >> WLAN_MEMORY_MAP_FOUR_IRAM_BANKS_LSB) -#define WLAN_MEMORY_MAP_FOUR_IRAM_BANKS_SET(x) (((x) << WLAN_MEMORY_MAP_FOUR_IRAM_BANKS_LSB) & WLAN_MEMORY_MAP_FOUR_IRAM_BANKS_MASK) -#define WLAN_MEMORY_MAP_THREE_IRAM_BANKS_MSB 2 -#define WLAN_MEMORY_MAP_THREE_IRAM_BANKS_LSB 2 -#define WLAN_MEMORY_MAP_THREE_IRAM_BANKS_MASK 0x00000004 -#define WLAN_MEMORY_MAP_THREE_IRAM_BANKS_GET(x) (((x) & WLAN_MEMORY_MAP_THREE_IRAM_BANKS_MASK) >> WLAN_MEMORY_MAP_THREE_IRAM_BANKS_LSB) -#define WLAN_MEMORY_MAP_THREE_IRAM_BANKS_SET(x) (((x) << WLAN_MEMORY_MAP_THREE_IRAM_BANKS_LSB) & WLAN_MEMORY_MAP_THREE_IRAM_BANKS_MASK) -#define WLAN_MEMORY_MAP_TWO_IRAM_BANKS_MSB 1 -#define WLAN_MEMORY_MAP_TWO_IRAM_BANKS_LSB 1 -#define WLAN_MEMORY_MAP_TWO_IRAM_BANKS_MASK 0x00000002 -#define WLAN_MEMORY_MAP_TWO_IRAM_BANKS_GET(x) (((x) & WLAN_MEMORY_MAP_TWO_IRAM_BANKS_MASK) >> WLAN_MEMORY_MAP_TWO_IRAM_BANKS_LSB) -#define WLAN_MEMORY_MAP_TWO_IRAM_BANKS_SET(x) (((x) << WLAN_MEMORY_MAP_TWO_IRAM_BANKS_LSB) & WLAN_MEMORY_MAP_TWO_IRAM_BANKS_MASK) -#define WLAN_MEMORY_MAP_ONE_IRAM_BANK_MSB 0 -#define WLAN_MEMORY_MAP_ONE_IRAM_BANK_LSB 0 -#define WLAN_MEMORY_MAP_ONE_IRAM_BANK_MASK 0x00000001 -#define WLAN_MEMORY_MAP_ONE_IRAM_BANK_GET(x) (((x) & WLAN_MEMORY_MAP_ONE_IRAM_BANK_MASK) >> WLAN_MEMORY_MAP_ONE_IRAM_BANK_LSB) -#define WLAN_MEMORY_MAP_ONE_IRAM_BANK_SET(x) (((x) << WLAN_MEMORY_MAP_ONE_IRAM_BANK_LSB) & WLAN_MEMORY_MAP_ONE_IRAM_BANK_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct si_reg_reg_s { - volatile unsigned int si_config; - volatile unsigned int si_cs; - volatile unsigned int si_tx_data0; - volatile unsigned int si_tx_data1; - volatile unsigned int si_rx_data0; - volatile unsigned int si_rx_data1; - volatile unsigned int wlan_apb_addr_error_control; - volatile unsigned int wlan_apb_addr_error_status; - volatile unsigned int wlan_ahb_addr_error_control; - volatile unsigned int wlan_ahb_addr_error_status; - volatile unsigned int wlan_ahb_config; - volatile unsigned int wlan_memory_map; -} si_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _SI_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/stereo_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/stereo_reg.h deleted file mode 100644 index 5277db5a24c8..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/stereo_reg.h +++ /dev/null @@ -1,204 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _STEREO_REG_REG_H_ -#define _STEREO_REG_REG_H_ - - -/* macros for STEREO0_CONFIG */ -#define STEREO0_CONFIG_ADDRESS 0x00000000 -#define STEREO0_CONFIG_OFFSET 0x00000000 -#define STEREO0_CONFIG_POSEDGE_MSB 7 -#define STEREO0_CONFIG_POSEDGE_LSB 0 -#define STEREO0_CONFIG_POSEDGE_MASK 0x000000ff -#define STEREO0_CONFIG_POSEDGE_GET(x) (((x) & 0x000000ff) >> 0) -#define STEREO0_CONFIG_POSEDGE_SET(x) (((x) << 0) & 0x000000ff) -#define STEREO0_CONFIG_MASTER_MSB 8 -#define STEREO0_CONFIG_MASTER_LSB 8 -#define STEREO0_CONFIG_MASTER_MASK 0x00000100 -#define STEREO0_CONFIG_MASTER_GET(x) (((x) & 0x00000100) >> 8) -#define STEREO0_CONFIG_MASTER_SET(x) (((x) << 8) & 0x00000100) -#define STEREO0_CONFIG_SAMPLE_CNT_CLEAR_TYPE_MSB 9 -#define STEREO0_CONFIG_SAMPLE_CNT_CLEAR_TYPE_LSB 9 -#define STEREO0_CONFIG_SAMPLE_CNT_CLEAR_TYPE_MASK 0x00000200 -#define STEREO0_CONFIG_SAMPLE_CNT_CLEAR_TYPE_GET(x) (((x) & 0x00000200) >> 9) -#define STEREO0_CONFIG_SAMPLE_CNT_CLEAR_TYPE_SET(x) (((x) << 9) & 0x00000200) -#define STEREO0_CONFIG_MCK_SEL_MSB 10 -#define STEREO0_CONFIG_MCK_SEL_LSB 10 -#define STEREO0_CONFIG_MCK_SEL_MASK 0x00000400 -#define STEREO0_CONFIG_MCK_SEL_GET(x) (((x) & 0x00000400) >> 10) -#define STEREO0_CONFIG_MCK_SEL_SET(x) (((x) << 10) & 0x00000400) -#define STEREO0_CONFIG_I2S_WORD_SIZE_MSB 11 -#define STEREO0_CONFIG_I2S_WORD_SIZE_LSB 11 -#define STEREO0_CONFIG_I2S_WORD_SIZE_MASK 0x00000800 -#define STEREO0_CONFIG_I2S_WORD_SIZE_GET(x) (((x) & 0x00000800) >> 11) -#define STEREO0_CONFIG_I2S_WORD_SIZE_SET(x) (((x) << 11) & 0x00000800) -#define STEREO0_CONFIG_DATA_WORD_SIZE_MSB 13 -#define STEREO0_CONFIG_DATA_WORD_SIZE_LSB 12 -#define STEREO0_CONFIG_DATA_WORD_SIZE_MASK 0x00003000 -#define STEREO0_CONFIG_DATA_WORD_SIZE_GET(x) (((x) & 0x00003000) >> 12) -#define STEREO0_CONFIG_DATA_WORD_SIZE_SET(x) (((x) << 12) & 0x00003000) -#define STEREO0_CONFIG_STEREO_MONO_MSB 15 -#define STEREO0_CONFIG_STEREO_MONO_LSB 14 -#define STEREO0_CONFIG_STEREO_MONO_MASK 0x0000c000 -#define STEREO0_CONFIG_STEREO_MONO_GET(x) (((x) & 0x0000c000) >> 14) -#define STEREO0_CONFIG_STEREO_MONO_SET(x) (((x) << 14) & 0x0000c000) -#define STEREO0_CONFIG_MIC_WORD_SIZE_MSB 16 -#define STEREO0_CONFIG_MIC_WORD_SIZE_LSB 16 -#define STEREO0_CONFIG_MIC_WORD_SIZE_MASK 0x00010000 -#define STEREO0_CONFIG_MIC_WORD_SIZE_GET(x) (((x) & 0x00010000) >> 16) -#define STEREO0_CONFIG_MIC_WORD_SIZE_SET(x) (((x) << 16) & 0x00010000) -#define STEREO0_CONFIG_PCM_SWAP_MSB 17 -#define STEREO0_CONFIG_PCM_SWAP_LSB 17 -#define STEREO0_CONFIG_PCM_SWAP_MASK 0x00020000 -#define STEREO0_CONFIG_PCM_SWAP_GET(x) (((x) & 0x00020000) >> 17) -#define STEREO0_CONFIG_PCM_SWAP_SET(x) (((x) << 17) & 0x00020000) -#define STEREO0_CONFIG_I2S_DELAY_MSB 18 -#define STEREO0_CONFIG_I2S_DELAY_LSB 18 -#define STEREO0_CONFIG_I2S_DELAY_MASK 0x00040000 -#define STEREO0_CONFIG_I2S_DELAY_GET(x) (((x) & 0x00040000) >> 18) -#define STEREO0_CONFIG_I2S_DELAY_SET(x) (((x) << 18) & 0x00040000) -#define STEREO0_CONFIG_RESET_MSB 19 -#define STEREO0_CONFIG_RESET_LSB 19 -#define STEREO0_CONFIG_RESET_MASK 0x00080000 -#define STEREO0_CONFIG_RESET_GET(x) (((x) & 0x00080000) >> 19) -#define STEREO0_CONFIG_RESET_SET(x) (((x) << 19) & 0x00080000) -#define STEREO0_CONFIG_MIC_RESET_MSB 20 -#define STEREO0_CONFIG_MIC_RESET_LSB 20 -#define STEREO0_CONFIG_MIC_RESET_MASK 0x00100000 -#define STEREO0_CONFIG_MIC_RESET_GET(x) (((x) & 0x00100000) >> 20) -#define STEREO0_CONFIG_MIC_RESET_SET(x) (((x) << 20) & 0x00100000) -#define STEREO0_CONFIG_ENABLE_MSB 21 -#define STEREO0_CONFIG_ENABLE_LSB 21 -#define STEREO0_CONFIG_ENABLE_MASK 0x00200000 -#define STEREO0_CONFIG_ENABLE_GET(x) (((x) & 0x00200000) >> 21) -#define STEREO0_CONFIG_ENABLE_SET(x) (((x) << 21) & 0x00200000) -#define STEREO0_CONFIG_REFCLK_SEL_MSB 22 -#define STEREO0_CONFIG_REFCLK_SEL_LSB 22 -#define STEREO0_CONFIG_REFCLK_SEL_MASK 0x00400000 -#define STEREO0_CONFIG_REFCLK_SEL_GET(x) (((x) & 0x00400000) >> 22) -#define STEREO0_CONFIG_REFCLK_SEL_SET(x) (((x) << 22) & 0x00400000) -#define STEREO0_CONFIG_SPDIF_ENABLE_MSB 23 -#define STEREO0_CONFIG_SPDIF_ENABLE_LSB 23 -#define STEREO0_CONFIG_SPDIF_ENABLE_MASK 0x00800000 -#define STEREO0_CONFIG_SPDIF_ENABLE_GET(x) (((x) & 0x00800000) >> 23) -#define STEREO0_CONFIG_SPDIF_ENABLE_SET(x) (((x) << 23) & 0x00800000) - -/* macros for STEREO0_VOLUME */ -#define STEREO0_VOLUME_ADDRESS 0x00000004 -#define STEREO0_VOLUME_OFFSET 0x00000004 -#define STEREO0_VOLUME_CHANNEL0_MSB 4 -#define STEREO0_VOLUME_CHANNEL0_LSB 0 -#define STEREO0_VOLUME_CHANNEL0_MASK 0x0000001f -#define STEREO0_VOLUME_CHANNEL0_GET(x) (((x) & 0x0000001f) >> 0) -#define STEREO0_VOLUME_CHANNEL0_SET(x) (((x) << 0) & 0x0000001f) -#define STEREO0_VOLUME_CHANNEL1_MSB 12 -#define STEREO0_VOLUME_CHANNEL1_LSB 8 -#define STEREO0_VOLUME_CHANNEL1_MASK 0x00001f00 -#define STEREO0_VOLUME_CHANNEL1_GET(x) (((x) & 0x00001f00) >> 8) -#define STEREO0_VOLUME_CHANNEL1_SET(x) (((x) << 8) & 0x00001f00) - -/* macros for STEREO_MASTER_CLOCK */ -#define STEREO_MASTER_CLOCK_ADDRESS 0x00000008 -#define STEREO_MASTER_CLOCK_OFFSET 0x00000008 -#define STEREO_MASTER_CLOCK_MCK_SEL_MSB 0 -#define STEREO_MASTER_CLOCK_MCK_SEL_LSB 0 -#define STEREO_MASTER_CLOCK_MCK_SEL_MASK 0x00000001 -#define STEREO_MASTER_CLOCK_MCK_SEL_GET(x) (((x) & 0x00000001) >> 0) -#define STEREO_MASTER_CLOCK_MCK_SEL_SET(x) (((x) << 0) & 0x00000001) - -/* macros for STEREO0_TX_SAMPLE_CNT_LSB */ -#define STEREO0_TX_SAMPLE_CNT_LSB_ADDRESS 0x0000000c -#define STEREO0_TX_SAMPLE_CNT_LSB_OFFSET 0x0000000c -#define STEREO0_TX_SAMPLE_CNT_LSB_CH0_MSB 15 -#define STEREO0_TX_SAMPLE_CNT_LSB_CH0_LSB 0 -#define STEREO0_TX_SAMPLE_CNT_LSB_CH0_MASK 0x0000ffff -#define STEREO0_TX_SAMPLE_CNT_LSB_CH0_GET(x) (((x) & 0x0000ffff) >> 0) -#define STEREO0_TX_SAMPLE_CNT_LSB_CH0_SET(x) (((x) << 0) & 0x0000ffff) -#define STEREO0_TX_SAMPLE_CNT_LSB_CH1_MSB 31 -#define STEREO0_TX_SAMPLE_CNT_LSB_CH1_LSB 16 -#define STEREO0_TX_SAMPLE_CNT_LSB_CH1_MASK 0xffff0000 -#define STEREO0_TX_SAMPLE_CNT_LSB_CH1_GET(x) (((x) & 0xffff0000) >> 16) -#define STEREO0_TX_SAMPLE_CNT_LSB_CH1_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for STEREO0_TX_SAMPLE_CNT_MSB */ -#define STEREO0_TX_SAMPLE_CNT_MSB_ADDRESS 0x00000010 -#define STEREO0_TX_SAMPLE_CNT_MSB_OFFSET 0x00000010 -#define STEREO0_TX_SAMPLE_CNT_MSB_CH0_MSB 15 -#define STEREO0_TX_SAMPLE_CNT_MSB_CH0_LSB 0 -#define STEREO0_TX_SAMPLE_CNT_MSB_CH0_MASK 0x0000ffff -#define STEREO0_TX_SAMPLE_CNT_MSB_CH0_GET(x) (((x) & 0x0000ffff) >> 0) -#define STEREO0_TX_SAMPLE_CNT_MSB_CH0_SET(x) (((x) << 0) & 0x0000ffff) -#define STEREO0_TX_SAMPLE_CNT_MSB_CH1_MSB 31 -#define STEREO0_TX_SAMPLE_CNT_MSB_CH1_LSB 16 -#define STEREO0_TX_SAMPLE_CNT_MSB_CH1_MASK 0xffff0000 -#define STEREO0_TX_SAMPLE_CNT_MSB_CH1_GET(x) (((x) & 0xffff0000) >> 16) -#define STEREO0_TX_SAMPLE_CNT_MSB_CH1_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for STEREO0_RX_SAMPLE_CNT_LSB */ -#define STEREO0_RX_SAMPLE_CNT_LSB_ADDRESS 0x00000014 -#define STEREO0_RX_SAMPLE_CNT_LSB_OFFSET 0x00000014 -#define STEREO0_RX_SAMPLE_CNT_LSB_CH0_MSB 15 -#define STEREO0_RX_SAMPLE_CNT_LSB_CH0_LSB 0 -#define STEREO0_RX_SAMPLE_CNT_LSB_CH0_MASK 0x0000ffff -#define STEREO0_RX_SAMPLE_CNT_LSB_CH0_GET(x) (((x) & 0x0000ffff) >> 0) -#define STEREO0_RX_SAMPLE_CNT_LSB_CH0_SET(x) (((x) << 0) & 0x0000ffff) -#define STEREO0_RX_SAMPLE_CNT_LSB_CH1_MSB 31 -#define STEREO0_RX_SAMPLE_CNT_LSB_CH1_LSB 16 -#define STEREO0_RX_SAMPLE_CNT_LSB_CH1_MASK 0xffff0000 -#define STEREO0_RX_SAMPLE_CNT_LSB_CH1_GET(x) (((x) & 0xffff0000) >> 16) -#define STEREO0_RX_SAMPLE_CNT_LSB_CH1_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for STEREO0_RX_SAMPLE_CNT_MSB */ -#define STEREO0_RX_SAMPLE_CNT_MSB_ADDRESS 0x00000018 -#define STEREO0_RX_SAMPLE_CNT_MSB_OFFSET 0x00000018 -#define STEREO0_RX_SAMPLE_CNT_MSB_CH0_MSB 15 -#define STEREO0_RX_SAMPLE_CNT_MSB_CH0_LSB 0 -#define STEREO0_RX_SAMPLE_CNT_MSB_CH0_MASK 0x0000ffff -#define STEREO0_RX_SAMPLE_CNT_MSB_CH0_GET(x) (((x) & 0x0000ffff) >> 0) -#define STEREO0_RX_SAMPLE_CNT_MSB_CH0_SET(x) (((x) << 0) & 0x0000ffff) -#define STEREO0_RX_SAMPLE_CNT_MSB_CH1_MSB 31 -#define STEREO0_RX_SAMPLE_CNT_MSB_CH1_LSB 16 -#define STEREO0_RX_SAMPLE_CNT_MSB_CH1_MASK 0xffff0000 -#define STEREO0_RX_SAMPLE_CNT_MSB_CH1_GET(x) (((x) & 0xffff0000) >> 16) -#define STEREO0_RX_SAMPLE_CNT_MSB_CH1_SET(x) (((x) << 16) & 0xffff0000) - - -#ifndef __ASSEMBLER__ - -typedef struct stereo_reg_reg_s { - volatile unsigned int STEREO0_CONFIG; /* 0x0 - 0x4 */ - volatile unsigned int STEREO0_VOLUME; /* 0x4 - 0x8 */ - volatile unsigned int STEREO_MASTER_CLOCK; /* 0x8 - 0xc */ - volatile unsigned int STEREO0_TX_SAMPLE_CNT_LSB; /* 0xc - 0x10 */ - volatile unsigned int STEREO0_TX_SAMPLE_CNT_MSB; /* 0x10 - 0x14 */ - volatile unsigned int STEREO0_RX_SAMPLE_CNT_LSB; /* 0x14 - 0x18 */ - volatile unsigned int STEREO0_RX_SAMPLE_CNT_MSB; /* 0x18 - 0x1c */ -} stereo_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _STEREO_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/uart_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/uart_reg.h deleted file mode 100644 index 5aef4bad347b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/uart_reg.h +++ /dev/null @@ -1,260 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _UART_REG_REG_H_ -#define _UART_REG_REG_H_ - -#define UART_DATA_ADDRESS 0x00000000 -#define UART_DATA_OFFSET 0x00000000 -#define UART_DATA_TX_CSR_MSB 9 -#define UART_DATA_TX_CSR_LSB 9 -#define UART_DATA_TX_CSR_MASK 0x00000200 -#define UART_DATA_TX_CSR_GET(x) (((x) & UART_DATA_TX_CSR_MASK) >> UART_DATA_TX_CSR_LSB) -#define UART_DATA_TX_CSR_SET(x) (((x) << UART_DATA_TX_CSR_LSB) & UART_DATA_TX_CSR_MASK) -#define UART_DATA_RX_CSR_MSB 8 -#define UART_DATA_RX_CSR_LSB 8 -#define UART_DATA_RX_CSR_MASK 0x00000100 -#define UART_DATA_RX_CSR_GET(x) (((x) & UART_DATA_RX_CSR_MASK) >> UART_DATA_RX_CSR_LSB) -#define UART_DATA_RX_CSR_SET(x) (((x) << UART_DATA_RX_CSR_LSB) & UART_DATA_RX_CSR_MASK) -#define UART_DATA_TXRX_DATA_MSB 7 -#define UART_DATA_TXRX_DATA_LSB 0 -#define UART_DATA_TXRX_DATA_MASK 0x000000ff -#define UART_DATA_TXRX_DATA_GET(x) (((x) & UART_DATA_TXRX_DATA_MASK) >> UART_DATA_TXRX_DATA_LSB) -#define UART_DATA_TXRX_DATA_SET(x) (((x) << UART_DATA_TXRX_DATA_LSB) & UART_DATA_TXRX_DATA_MASK) - -#define UART_CONTROL_ADDRESS 0x00000004 -#define UART_CONTROL_OFFSET 0x00000004 -#define UART_CONTROL_RX_BUSY_MSB 15 -#define UART_CONTROL_RX_BUSY_LSB 15 -#define UART_CONTROL_RX_BUSY_MASK 0x00008000 -#define UART_CONTROL_RX_BUSY_GET(x) (((x) & UART_CONTROL_RX_BUSY_MASK) >> UART_CONTROL_RX_BUSY_LSB) -#define UART_CONTROL_RX_BUSY_SET(x) (((x) << UART_CONTROL_RX_BUSY_LSB) & UART_CONTROL_RX_BUSY_MASK) -#define UART_CONTROL_TX_BUSY_MSB 14 -#define UART_CONTROL_TX_BUSY_LSB 14 -#define UART_CONTROL_TX_BUSY_MASK 0x00004000 -#define UART_CONTROL_TX_BUSY_GET(x) (((x) & UART_CONTROL_TX_BUSY_MASK) >> UART_CONTROL_TX_BUSY_LSB) -#define UART_CONTROL_TX_BUSY_SET(x) (((x) << UART_CONTROL_TX_BUSY_LSB) & UART_CONTROL_TX_BUSY_MASK) -#define UART_CONTROL_HOST_INT_ENABLE_MSB 13 -#define UART_CONTROL_HOST_INT_ENABLE_LSB 13 -#define UART_CONTROL_HOST_INT_ENABLE_MASK 0x00002000 -#define UART_CONTROL_HOST_INT_ENABLE_GET(x) (((x) & UART_CONTROL_HOST_INT_ENABLE_MASK) >> UART_CONTROL_HOST_INT_ENABLE_LSB) -#define UART_CONTROL_HOST_INT_ENABLE_SET(x) (((x) << UART_CONTROL_HOST_INT_ENABLE_LSB) & UART_CONTROL_HOST_INT_ENABLE_MASK) -#define UART_CONTROL_HOST_INT_MSB 12 -#define UART_CONTROL_HOST_INT_LSB 12 -#define UART_CONTROL_HOST_INT_MASK 0x00001000 -#define UART_CONTROL_HOST_INT_GET(x) (((x) & UART_CONTROL_HOST_INT_MASK) >> UART_CONTROL_HOST_INT_LSB) -#define UART_CONTROL_HOST_INT_SET(x) (((x) << UART_CONTROL_HOST_INT_LSB) & UART_CONTROL_HOST_INT_MASK) -#define UART_CONTROL_TX_BREAK_MSB 11 -#define UART_CONTROL_TX_BREAK_LSB 11 -#define UART_CONTROL_TX_BREAK_MASK 0x00000800 -#define UART_CONTROL_TX_BREAK_GET(x) (((x) & UART_CONTROL_TX_BREAK_MASK) >> UART_CONTROL_TX_BREAK_LSB) -#define UART_CONTROL_TX_BREAK_SET(x) (((x) << UART_CONTROL_TX_BREAK_LSB) & UART_CONTROL_TX_BREAK_MASK) -#define UART_CONTROL_RX_BREAK_MSB 10 -#define UART_CONTROL_RX_BREAK_LSB 10 -#define UART_CONTROL_RX_BREAK_MASK 0x00000400 -#define UART_CONTROL_RX_BREAK_GET(x) (((x) & UART_CONTROL_RX_BREAK_MASK) >> UART_CONTROL_RX_BREAK_LSB) -#define UART_CONTROL_RX_BREAK_SET(x) (((x) << UART_CONTROL_RX_BREAK_LSB) & UART_CONTROL_RX_BREAK_MASK) -#define UART_CONTROL_SERIAL_TX_READY_MSB 9 -#define UART_CONTROL_SERIAL_TX_READY_LSB 9 -#define UART_CONTROL_SERIAL_TX_READY_MASK 0x00000200 -#define UART_CONTROL_SERIAL_TX_READY_GET(x) (((x) & UART_CONTROL_SERIAL_TX_READY_MASK) >> UART_CONTROL_SERIAL_TX_READY_LSB) -#define UART_CONTROL_SERIAL_TX_READY_SET(x) (((x) << UART_CONTROL_SERIAL_TX_READY_LSB) & UART_CONTROL_SERIAL_TX_READY_MASK) -#define UART_CONTROL_TX_READY_ORIDE_MSB 8 -#define UART_CONTROL_TX_READY_ORIDE_LSB 8 -#define UART_CONTROL_TX_READY_ORIDE_MASK 0x00000100 -#define UART_CONTROL_TX_READY_ORIDE_GET(x) (((x) & UART_CONTROL_TX_READY_ORIDE_MASK) >> UART_CONTROL_TX_READY_ORIDE_LSB) -#define UART_CONTROL_TX_READY_ORIDE_SET(x) (((x) << UART_CONTROL_TX_READY_ORIDE_LSB) & UART_CONTROL_TX_READY_ORIDE_MASK) -#define UART_CONTROL_RX_READY_ORIDE_MSB 7 -#define UART_CONTROL_RX_READY_ORIDE_LSB 7 -#define UART_CONTROL_RX_READY_ORIDE_MASK 0x00000080 -#define UART_CONTROL_RX_READY_ORIDE_GET(x) (((x) & UART_CONTROL_RX_READY_ORIDE_MASK) >> UART_CONTROL_RX_READY_ORIDE_LSB) -#define UART_CONTROL_RX_READY_ORIDE_SET(x) (((x) << UART_CONTROL_RX_READY_ORIDE_LSB) & UART_CONTROL_RX_READY_ORIDE_MASK) -#define UART_CONTROL_DMA_ENABLE_MSB 6 -#define UART_CONTROL_DMA_ENABLE_LSB 6 -#define UART_CONTROL_DMA_ENABLE_MASK 0x00000040 -#define UART_CONTROL_DMA_ENABLE_GET(x) (((x) & UART_CONTROL_DMA_ENABLE_MASK) >> UART_CONTROL_DMA_ENABLE_LSB) -#define UART_CONTROL_DMA_ENABLE_SET(x) (((x) << UART_CONTROL_DMA_ENABLE_LSB) & UART_CONTROL_DMA_ENABLE_MASK) -#define UART_CONTROL_FLOW_ENABLE_MSB 5 -#define UART_CONTROL_FLOW_ENABLE_LSB 5 -#define UART_CONTROL_FLOW_ENABLE_MASK 0x00000020 -#define UART_CONTROL_FLOW_ENABLE_GET(x) (((x) & UART_CONTROL_FLOW_ENABLE_MASK) >> UART_CONTROL_FLOW_ENABLE_LSB) -#define UART_CONTROL_FLOW_ENABLE_SET(x) (((x) << UART_CONTROL_FLOW_ENABLE_LSB) & UART_CONTROL_FLOW_ENABLE_MASK) -#define UART_CONTROL_FLOW_INVERT_MSB 4 -#define UART_CONTROL_FLOW_INVERT_LSB 4 -#define UART_CONTROL_FLOW_INVERT_MASK 0x00000010 -#define UART_CONTROL_FLOW_INVERT_GET(x) (((x) & UART_CONTROL_FLOW_INVERT_MASK) >> UART_CONTROL_FLOW_INVERT_LSB) -#define UART_CONTROL_FLOW_INVERT_SET(x) (((x) << UART_CONTROL_FLOW_INVERT_LSB) & UART_CONTROL_FLOW_INVERT_MASK) -#define UART_CONTROL_IFC_ENABLE_MSB 3 -#define UART_CONTROL_IFC_ENABLE_LSB 3 -#define UART_CONTROL_IFC_ENABLE_MASK 0x00000008 -#define UART_CONTROL_IFC_ENABLE_GET(x) (((x) & UART_CONTROL_IFC_ENABLE_MASK) >> UART_CONTROL_IFC_ENABLE_LSB) -#define UART_CONTROL_IFC_ENABLE_SET(x) (((x) << UART_CONTROL_IFC_ENABLE_LSB) & UART_CONTROL_IFC_ENABLE_MASK) -#define UART_CONTROL_IFC_DCE_MSB 2 -#define UART_CONTROL_IFC_DCE_LSB 2 -#define UART_CONTROL_IFC_DCE_MASK 0x00000004 -#define UART_CONTROL_IFC_DCE_GET(x) (((x) & UART_CONTROL_IFC_DCE_MASK) >> UART_CONTROL_IFC_DCE_LSB) -#define UART_CONTROL_IFC_DCE_SET(x) (((x) << UART_CONTROL_IFC_DCE_LSB) & UART_CONTROL_IFC_DCE_MASK) -#define UART_CONTROL_PARITY_ENABLE_MSB 1 -#define UART_CONTROL_PARITY_ENABLE_LSB 1 -#define UART_CONTROL_PARITY_ENABLE_MASK 0x00000002 -#define UART_CONTROL_PARITY_ENABLE_GET(x) (((x) & UART_CONTROL_PARITY_ENABLE_MASK) >> UART_CONTROL_PARITY_ENABLE_LSB) -#define UART_CONTROL_PARITY_ENABLE_SET(x) (((x) << UART_CONTROL_PARITY_ENABLE_LSB) & UART_CONTROL_PARITY_ENABLE_MASK) -#define UART_CONTROL_PARITY_EVEN_MSB 0 -#define UART_CONTROL_PARITY_EVEN_LSB 0 -#define UART_CONTROL_PARITY_EVEN_MASK 0x00000001 -#define UART_CONTROL_PARITY_EVEN_GET(x) (((x) & UART_CONTROL_PARITY_EVEN_MASK) >> UART_CONTROL_PARITY_EVEN_LSB) -#define UART_CONTROL_PARITY_EVEN_SET(x) (((x) << UART_CONTROL_PARITY_EVEN_LSB) & UART_CONTROL_PARITY_EVEN_MASK) - -#define UART_CLKDIV_ADDRESS 0x00000008 -#define UART_CLKDIV_OFFSET 0x00000008 -#define UART_CLKDIV_CLK_SCALE_MSB 23 -#define UART_CLKDIV_CLK_SCALE_LSB 16 -#define UART_CLKDIV_CLK_SCALE_MASK 0x00ff0000 -#define UART_CLKDIV_CLK_SCALE_GET(x) (((x) & UART_CLKDIV_CLK_SCALE_MASK) >> UART_CLKDIV_CLK_SCALE_LSB) -#define UART_CLKDIV_CLK_SCALE_SET(x) (((x) << UART_CLKDIV_CLK_SCALE_LSB) & UART_CLKDIV_CLK_SCALE_MASK) -#define UART_CLKDIV_CLK_STEP_MSB 15 -#define UART_CLKDIV_CLK_STEP_LSB 0 -#define UART_CLKDIV_CLK_STEP_MASK 0x0000ffff -#define UART_CLKDIV_CLK_STEP_GET(x) (((x) & UART_CLKDIV_CLK_STEP_MASK) >> UART_CLKDIV_CLK_STEP_LSB) -#define UART_CLKDIV_CLK_STEP_SET(x) (((x) << UART_CLKDIV_CLK_STEP_LSB) & UART_CLKDIV_CLK_STEP_MASK) - -#define UART_INT_ADDRESS 0x0000000c -#define UART_INT_OFFSET 0x0000000c -#define UART_INT_TX_EMPTY_INT_MSB 9 -#define UART_INT_TX_EMPTY_INT_LSB 9 -#define UART_INT_TX_EMPTY_INT_MASK 0x00000200 -#define UART_INT_TX_EMPTY_INT_GET(x) (((x) & UART_INT_TX_EMPTY_INT_MASK) >> UART_INT_TX_EMPTY_INT_LSB) -#define UART_INT_TX_EMPTY_INT_SET(x) (((x) << UART_INT_TX_EMPTY_INT_LSB) & UART_INT_TX_EMPTY_INT_MASK) -#define UART_INT_RX_FULL_INT_MSB 8 -#define UART_INT_RX_FULL_INT_LSB 8 -#define UART_INT_RX_FULL_INT_MASK 0x00000100 -#define UART_INT_RX_FULL_INT_GET(x) (((x) & UART_INT_RX_FULL_INT_MASK) >> UART_INT_RX_FULL_INT_LSB) -#define UART_INT_RX_FULL_INT_SET(x) (((x) << UART_INT_RX_FULL_INT_LSB) & UART_INT_RX_FULL_INT_MASK) -#define UART_INT_RX_BREAK_OFF_INT_MSB 7 -#define UART_INT_RX_BREAK_OFF_INT_LSB 7 -#define UART_INT_RX_BREAK_OFF_INT_MASK 0x00000080 -#define UART_INT_RX_BREAK_OFF_INT_GET(x) (((x) & UART_INT_RX_BREAK_OFF_INT_MASK) >> UART_INT_RX_BREAK_OFF_INT_LSB) -#define UART_INT_RX_BREAK_OFF_INT_SET(x) (((x) << UART_INT_RX_BREAK_OFF_INT_LSB) & UART_INT_RX_BREAK_OFF_INT_MASK) -#define UART_INT_RX_BREAK_ON_INT_MSB 6 -#define UART_INT_RX_BREAK_ON_INT_LSB 6 -#define UART_INT_RX_BREAK_ON_INT_MASK 0x00000040 -#define UART_INT_RX_BREAK_ON_INT_GET(x) (((x) & UART_INT_RX_BREAK_ON_INT_MASK) >> UART_INT_RX_BREAK_ON_INT_LSB) -#define UART_INT_RX_BREAK_ON_INT_SET(x) (((x) << UART_INT_RX_BREAK_ON_INT_LSB) & UART_INT_RX_BREAK_ON_INT_MASK) -#define UART_INT_RX_PARITY_ERR_INT_MSB 5 -#define UART_INT_RX_PARITY_ERR_INT_LSB 5 -#define UART_INT_RX_PARITY_ERR_INT_MASK 0x00000020 -#define UART_INT_RX_PARITY_ERR_INT_GET(x) (((x) & UART_INT_RX_PARITY_ERR_INT_MASK) >> UART_INT_RX_PARITY_ERR_INT_LSB) -#define UART_INT_RX_PARITY_ERR_INT_SET(x) (((x) << UART_INT_RX_PARITY_ERR_INT_LSB) & UART_INT_RX_PARITY_ERR_INT_MASK) -#define UART_INT_TX_OFLOW_ERR_INT_MSB 4 -#define UART_INT_TX_OFLOW_ERR_INT_LSB 4 -#define UART_INT_TX_OFLOW_ERR_INT_MASK 0x00000010 -#define UART_INT_TX_OFLOW_ERR_INT_GET(x) (((x) & UART_INT_TX_OFLOW_ERR_INT_MASK) >> UART_INT_TX_OFLOW_ERR_INT_LSB) -#define UART_INT_TX_OFLOW_ERR_INT_SET(x) (((x) << UART_INT_TX_OFLOW_ERR_INT_LSB) & UART_INT_TX_OFLOW_ERR_INT_MASK) -#define UART_INT_RX_OFLOW_ERR_INT_MSB 3 -#define UART_INT_RX_OFLOW_ERR_INT_LSB 3 -#define UART_INT_RX_OFLOW_ERR_INT_MASK 0x00000008 -#define UART_INT_RX_OFLOW_ERR_INT_GET(x) (((x) & UART_INT_RX_OFLOW_ERR_INT_MASK) >> UART_INT_RX_OFLOW_ERR_INT_LSB) -#define UART_INT_RX_OFLOW_ERR_INT_SET(x) (((x) << UART_INT_RX_OFLOW_ERR_INT_LSB) & UART_INT_RX_OFLOW_ERR_INT_MASK) -#define UART_INT_RX_FRAMING_ERR_INT_MSB 2 -#define UART_INT_RX_FRAMING_ERR_INT_LSB 2 -#define UART_INT_RX_FRAMING_ERR_INT_MASK 0x00000004 -#define UART_INT_RX_FRAMING_ERR_INT_GET(x) (((x) & UART_INT_RX_FRAMING_ERR_INT_MASK) >> UART_INT_RX_FRAMING_ERR_INT_LSB) -#define UART_INT_RX_FRAMING_ERR_INT_SET(x) (((x) << UART_INT_RX_FRAMING_ERR_INT_LSB) & UART_INT_RX_FRAMING_ERR_INT_MASK) -#define UART_INT_TX_READY_INT_MSB 1 -#define UART_INT_TX_READY_INT_LSB 1 -#define UART_INT_TX_READY_INT_MASK 0x00000002 -#define UART_INT_TX_READY_INT_GET(x) (((x) & UART_INT_TX_READY_INT_MASK) >> UART_INT_TX_READY_INT_LSB) -#define UART_INT_TX_READY_INT_SET(x) (((x) << UART_INT_TX_READY_INT_LSB) & UART_INT_TX_READY_INT_MASK) -#define UART_INT_RX_VALID_INT_MSB 0 -#define UART_INT_RX_VALID_INT_LSB 0 -#define UART_INT_RX_VALID_INT_MASK 0x00000001 -#define UART_INT_RX_VALID_INT_GET(x) (((x) & UART_INT_RX_VALID_INT_MASK) >> UART_INT_RX_VALID_INT_LSB) -#define UART_INT_RX_VALID_INT_SET(x) (((x) << UART_INT_RX_VALID_INT_LSB) & UART_INT_RX_VALID_INT_MASK) - -#define UART_INT_EN_ADDRESS 0x00000010 -#define UART_INT_EN_OFFSET 0x00000010 -#define UART_INT_EN_TX_EMPTY_INT_EN_MSB 9 -#define UART_INT_EN_TX_EMPTY_INT_EN_LSB 9 -#define UART_INT_EN_TX_EMPTY_INT_EN_MASK 0x00000200 -#define UART_INT_EN_TX_EMPTY_INT_EN_GET(x) (((x) & UART_INT_EN_TX_EMPTY_INT_EN_MASK) >> UART_INT_EN_TX_EMPTY_INT_EN_LSB) -#define UART_INT_EN_TX_EMPTY_INT_EN_SET(x) (((x) << UART_INT_EN_TX_EMPTY_INT_EN_LSB) & UART_INT_EN_TX_EMPTY_INT_EN_MASK) -#define UART_INT_EN_RX_FULL_INT_EN_MSB 8 -#define UART_INT_EN_RX_FULL_INT_EN_LSB 8 -#define UART_INT_EN_RX_FULL_INT_EN_MASK 0x00000100 -#define UART_INT_EN_RX_FULL_INT_EN_GET(x) (((x) & UART_INT_EN_RX_FULL_INT_EN_MASK) >> UART_INT_EN_RX_FULL_INT_EN_LSB) -#define UART_INT_EN_RX_FULL_INT_EN_SET(x) (((x) << UART_INT_EN_RX_FULL_INT_EN_LSB) & UART_INT_EN_RX_FULL_INT_EN_MASK) -#define UART_INT_EN_RX_BREAK_OFF_INT_EN_MSB 7 -#define UART_INT_EN_RX_BREAK_OFF_INT_EN_LSB 7 -#define UART_INT_EN_RX_BREAK_OFF_INT_EN_MASK 0x00000080 -#define UART_INT_EN_RX_BREAK_OFF_INT_EN_GET(x) (((x) & UART_INT_EN_RX_BREAK_OFF_INT_EN_MASK) >> UART_INT_EN_RX_BREAK_OFF_INT_EN_LSB) -#define UART_INT_EN_RX_BREAK_OFF_INT_EN_SET(x) (((x) << UART_INT_EN_RX_BREAK_OFF_INT_EN_LSB) & UART_INT_EN_RX_BREAK_OFF_INT_EN_MASK) -#define UART_INT_EN_RX_BREAK_ON_INT_EN_MSB 6 -#define UART_INT_EN_RX_BREAK_ON_INT_EN_LSB 6 -#define UART_INT_EN_RX_BREAK_ON_INT_EN_MASK 0x00000040 -#define UART_INT_EN_RX_BREAK_ON_INT_EN_GET(x) (((x) & UART_INT_EN_RX_BREAK_ON_INT_EN_MASK) >> UART_INT_EN_RX_BREAK_ON_INT_EN_LSB) -#define UART_INT_EN_RX_BREAK_ON_INT_EN_SET(x) (((x) << UART_INT_EN_RX_BREAK_ON_INT_EN_LSB) & UART_INT_EN_RX_BREAK_ON_INT_EN_MASK) -#define UART_INT_EN_RX_PARITY_ERR_INT_EN_MSB 5 -#define UART_INT_EN_RX_PARITY_ERR_INT_EN_LSB 5 -#define UART_INT_EN_RX_PARITY_ERR_INT_EN_MASK 0x00000020 -#define UART_INT_EN_RX_PARITY_ERR_INT_EN_GET(x) (((x) & UART_INT_EN_RX_PARITY_ERR_INT_EN_MASK) >> UART_INT_EN_RX_PARITY_ERR_INT_EN_LSB) -#define UART_INT_EN_RX_PARITY_ERR_INT_EN_SET(x) (((x) << UART_INT_EN_RX_PARITY_ERR_INT_EN_LSB) & UART_INT_EN_RX_PARITY_ERR_INT_EN_MASK) -#define UART_INT_EN_TX_OFLOW_ERR_INT_EN_MSB 4 -#define UART_INT_EN_TX_OFLOW_ERR_INT_EN_LSB 4 -#define UART_INT_EN_TX_OFLOW_ERR_INT_EN_MASK 0x00000010 -#define UART_INT_EN_TX_OFLOW_ERR_INT_EN_GET(x) (((x) & UART_INT_EN_TX_OFLOW_ERR_INT_EN_MASK) >> UART_INT_EN_TX_OFLOW_ERR_INT_EN_LSB) -#define UART_INT_EN_TX_OFLOW_ERR_INT_EN_SET(x) (((x) << UART_INT_EN_TX_OFLOW_ERR_INT_EN_LSB) & UART_INT_EN_TX_OFLOW_ERR_INT_EN_MASK) -#define UART_INT_EN_RX_OFLOW_ERR_INT_EN_MSB 3 -#define UART_INT_EN_RX_OFLOW_ERR_INT_EN_LSB 3 -#define UART_INT_EN_RX_OFLOW_ERR_INT_EN_MASK 0x00000008 -#define UART_INT_EN_RX_OFLOW_ERR_INT_EN_GET(x) (((x) & UART_INT_EN_RX_OFLOW_ERR_INT_EN_MASK) >> UART_INT_EN_RX_OFLOW_ERR_INT_EN_LSB) -#define UART_INT_EN_RX_OFLOW_ERR_INT_EN_SET(x) (((x) << UART_INT_EN_RX_OFLOW_ERR_INT_EN_LSB) & UART_INT_EN_RX_OFLOW_ERR_INT_EN_MASK) -#define UART_INT_EN_RX_FRAMING_ERR_INT_EN_MSB 2 -#define UART_INT_EN_RX_FRAMING_ERR_INT_EN_LSB 2 -#define UART_INT_EN_RX_FRAMING_ERR_INT_EN_MASK 0x00000004 -#define UART_INT_EN_RX_FRAMING_ERR_INT_EN_GET(x) (((x) & UART_INT_EN_RX_FRAMING_ERR_INT_EN_MASK) >> UART_INT_EN_RX_FRAMING_ERR_INT_EN_LSB) -#define UART_INT_EN_RX_FRAMING_ERR_INT_EN_SET(x) (((x) << UART_INT_EN_RX_FRAMING_ERR_INT_EN_LSB) & UART_INT_EN_RX_FRAMING_ERR_INT_EN_MASK) -#define UART_INT_EN_TX_READY_INT_EN_MSB 1 -#define UART_INT_EN_TX_READY_INT_EN_LSB 1 -#define UART_INT_EN_TX_READY_INT_EN_MASK 0x00000002 -#define UART_INT_EN_TX_READY_INT_EN_GET(x) (((x) & UART_INT_EN_TX_READY_INT_EN_MASK) >> UART_INT_EN_TX_READY_INT_EN_LSB) -#define UART_INT_EN_TX_READY_INT_EN_SET(x) (((x) << UART_INT_EN_TX_READY_INT_EN_LSB) & UART_INT_EN_TX_READY_INT_EN_MASK) -#define UART_INT_EN_RX_VALID_INT_EN_MSB 0 -#define UART_INT_EN_RX_VALID_INT_EN_LSB 0 -#define UART_INT_EN_RX_VALID_INT_EN_MASK 0x00000001 -#define UART_INT_EN_RX_VALID_INT_EN_GET(x) (((x) & UART_INT_EN_RX_VALID_INT_EN_MASK) >> UART_INT_EN_RX_VALID_INT_EN_LSB) -#define UART_INT_EN_RX_VALID_INT_EN_SET(x) (((x) << UART_INT_EN_RX_VALID_INT_EN_LSB) & UART_INT_EN_RX_VALID_INT_EN_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct uart_reg_reg_s { - volatile unsigned int uart_data; - volatile unsigned int uart_control; - volatile unsigned int uart_clkdiv; - volatile unsigned int uart_int; - volatile unsigned int uart_int_en; -} uart_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _UART_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/umbox_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/umbox_reg.h deleted file mode 100644 index 66ed47f44d9b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/umbox_reg.h +++ /dev/null @@ -1,37 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifdef WLAN_HEADERS - -#include "umbox_wlan_reg.h" - - -#ifndef BT_HEADERS - - - -#endif -#endif - - - diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/umbox_wlan_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/umbox_wlan_reg.h deleted file mode 100644 index 5c392f894126..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/umbox_wlan_reg.h +++ /dev/null @@ -1,322 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _UMBOX_WLAN_REG_REG_H_ -#define _UMBOX_WLAN_REG_REG_H_ - -#define UMBOX_FIFO_ADDRESS 0x00000000 -#define UMBOX_FIFO_OFFSET 0x00000000 -#define UMBOX_FIFO_DATA_MSB 8 -#define UMBOX_FIFO_DATA_LSB 0 -#define UMBOX_FIFO_DATA_MASK 0x000001ff -#define UMBOX_FIFO_DATA_GET(x) (((x) & UMBOX_FIFO_DATA_MASK) >> UMBOX_FIFO_DATA_LSB) -#define UMBOX_FIFO_DATA_SET(x) (((x) << UMBOX_FIFO_DATA_LSB) & UMBOX_FIFO_DATA_MASK) - -#define UMBOX_FIFO_STATUS_ADDRESS 0x00000008 -#define UMBOX_FIFO_STATUS_OFFSET 0x00000008 -#define UMBOX_FIFO_STATUS_TX_EMPTY_MSB 3 -#define UMBOX_FIFO_STATUS_TX_EMPTY_LSB 3 -#define UMBOX_FIFO_STATUS_TX_EMPTY_MASK 0x00000008 -#define UMBOX_FIFO_STATUS_TX_EMPTY_GET(x) (((x) & UMBOX_FIFO_STATUS_TX_EMPTY_MASK) >> UMBOX_FIFO_STATUS_TX_EMPTY_LSB) -#define UMBOX_FIFO_STATUS_TX_EMPTY_SET(x) (((x) << UMBOX_FIFO_STATUS_TX_EMPTY_LSB) & UMBOX_FIFO_STATUS_TX_EMPTY_MASK) -#define UMBOX_FIFO_STATUS_TX_FULL_MSB 2 -#define UMBOX_FIFO_STATUS_TX_FULL_LSB 2 -#define UMBOX_FIFO_STATUS_TX_FULL_MASK 0x00000004 -#define UMBOX_FIFO_STATUS_TX_FULL_GET(x) (((x) & UMBOX_FIFO_STATUS_TX_FULL_MASK) >> UMBOX_FIFO_STATUS_TX_FULL_LSB) -#define UMBOX_FIFO_STATUS_TX_FULL_SET(x) (((x) << UMBOX_FIFO_STATUS_TX_FULL_LSB) & UMBOX_FIFO_STATUS_TX_FULL_MASK) -#define UMBOX_FIFO_STATUS_RX_EMPTY_MSB 1 -#define UMBOX_FIFO_STATUS_RX_EMPTY_LSB 1 -#define UMBOX_FIFO_STATUS_RX_EMPTY_MASK 0x00000002 -#define UMBOX_FIFO_STATUS_RX_EMPTY_GET(x) (((x) & UMBOX_FIFO_STATUS_RX_EMPTY_MASK) >> UMBOX_FIFO_STATUS_RX_EMPTY_LSB) -#define UMBOX_FIFO_STATUS_RX_EMPTY_SET(x) (((x) << UMBOX_FIFO_STATUS_RX_EMPTY_LSB) & UMBOX_FIFO_STATUS_RX_EMPTY_MASK) -#define UMBOX_FIFO_STATUS_RX_FULL_MSB 0 -#define UMBOX_FIFO_STATUS_RX_FULL_LSB 0 -#define UMBOX_FIFO_STATUS_RX_FULL_MASK 0x00000001 -#define UMBOX_FIFO_STATUS_RX_FULL_GET(x) (((x) & UMBOX_FIFO_STATUS_RX_FULL_MASK) >> UMBOX_FIFO_STATUS_RX_FULL_LSB) -#define UMBOX_FIFO_STATUS_RX_FULL_SET(x) (((x) << UMBOX_FIFO_STATUS_RX_FULL_LSB) & UMBOX_FIFO_STATUS_RX_FULL_MASK) - -#define UMBOX_DMA_POLICY_ADDRESS 0x0000000c -#define UMBOX_DMA_POLICY_OFFSET 0x0000000c -#define UMBOX_DMA_POLICY_TX_QUANTUM_MSB 3 -#define UMBOX_DMA_POLICY_TX_QUANTUM_LSB 3 -#define UMBOX_DMA_POLICY_TX_QUANTUM_MASK 0x00000008 -#define UMBOX_DMA_POLICY_TX_QUANTUM_GET(x) (((x) & UMBOX_DMA_POLICY_TX_QUANTUM_MASK) >> UMBOX_DMA_POLICY_TX_QUANTUM_LSB) -#define UMBOX_DMA_POLICY_TX_QUANTUM_SET(x) (((x) << UMBOX_DMA_POLICY_TX_QUANTUM_LSB) & UMBOX_DMA_POLICY_TX_QUANTUM_MASK) -#define UMBOX_DMA_POLICY_TX_ORDER_MSB 2 -#define UMBOX_DMA_POLICY_TX_ORDER_LSB 2 -#define UMBOX_DMA_POLICY_TX_ORDER_MASK 0x00000004 -#define UMBOX_DMA_POLICY_TX_ORDER_GET(x) (((x) & UMBOX_DMA_POLICY_TX_ORDER_MASK) >> UMBOX_DMA_POLICY_TX_ORDER_LSB) -#define UMBOX_DMA_POLICY_TX_ORDER_SET(x) (((x) << UMBOX_DMA_POLICY_TX_ORDER_LSB) & UMBOX_DMA_POLICY_TX_ORDER_MASK) -#define UMBOX_DMA_POLICY_RX_QUANTUM_MSB 1 -#define UMBOX_DMA_POLICY_RX_QUANTUM_LSB 1 -#define UMBOX_DMA_POLICY_RX_QUANTUM_MASK 0x00000002 -#define UMBOX_DMA_POLICY_RX_QUANTUM_GET(x) (((x) & UMBOX_DMA_POLICY_RX_QUANTUM_MASK) >> UMBOX_DMA_POLICY_RX_QUANTUM_LSB) -#define UMBOX_DMA_POLICY_RX_QUANTUM_SET(x) (((x) << UMBOX_DMA_POLICY_RX_QUANTUM_LSB) & UMBOX_DMA_POLICY_RX_QUANTUM_MASK) -#define UMBOX_DMA_POLICY_RX_ORDER_MSB 0 -#define UMBOX_DMA_POLICY_RX_ORDER_LSB 0 -#define UMBOX_DMA_POLICY_RX_ORDER_MASK 0x00000001 -#define UMBOX_DMA_POLICY_RX_ORDER_GET(x) (((x) & UMBOX_DMA_POLICY_RX_ORDER_MASK) >> UMBOX_DMA_POLICY_RX_ORDER_LSB) -#define UMBOX_DMA_POLICY_RX_ORDER_SET(x) (((x) << UMBOX_DMA_POLICY_RX_ORDER_LSB) & UMBOX_DMA_POLICY_RX_ORDER_MASK) - -#define UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x00000010 -#define UMBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x00000010 -#define UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & UMBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define UMBOX0_DMA_RX_CONTROL_ADDRESS 0x00000014 -#define UMBOX0_DMA_RX_CONTROL_OFFSET 0x00000014 -#define UMBOX0_DMA_RX_CONTROL_RESUME_MSB 2 -#define UMBOX0_DMA_RX_CONTROL_RESUME_LSB 2 -#define UMBOX0_DMA_RX_CONTROL_RESUME_MASK 0x00000004 -#define UMBOX0_DMA_RX_CONTROL_RESUME_GET(x) (((x) & UMBOX0_DMA_RX_CONTROL_RESUME_MASK) >> UMBOX0_DMA_RX_CONTROL_RESUME_LSB) -#define UMBOX0_DMA_RX_CONTROL_RESUME_SET(x) (((x) << UMBOX0_DMA_RX_CONTROL_RESUME_LSB) & UMBOX0_DMA_RX_CONTROL_RESUME_MASK) -#define UMBOX0_DMA_RX_CONTROL_START_MSB 1 -#define UMBOX0_DMA_RX_CONTROL_START_LSB 1 -#define UMBOX0_DMA_RX_CONTROL_START_MASK 0x00000002 -#define UMBOX0_DMA_RX_CONTROL_START_GET(x) (((x) & UMBOX0_DMA_RX_CONTROL_START_MASK) >> UMBOX0_DMA_RX_CONTROL_START_LSB) -#define UMBOX0_DMA_RX_CONTROL_START_SET(x) (((x) << UMBOX0_DMA_RX_CONTROL_START_LSB) & UMBOX0_DMA_RX_CONTROL_START_MASK) -#define UMBOX0_DMA_RX_CONTROL_STOP_MSB 0 -#define UMBOX0_DMA_RX_CONTROL_STOP_LSB 0 -#define UMBOX0_DMA_RX_CONTROL_STOP_MASK 0x00000001 -#define UMBOX0_DMA_RX_CONTROL_STOP_GET(x) (((x) & UMBOX0_DMA_RX_CONTROL_STOP_MASK) >> UMBOX0_DMA_RX_CONTROL_STOP_LSB) -#define UMBOX0_DMA_RX_CONTROL_STOP_SET(x) (((x) << UMBOX0_DMA_RX_CONTROL_STOP_LSB) & UMBOX0_DMA_RX_CONTROL_STOP_MASK) - -#define UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000018 -#define UMBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000018 -#define UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27 -#define UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2 -#define UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc -#define UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) -#define UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & UMBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) - -#define UMBOX0_DMA_TX_CONTROL_ADDRESS 0x0000001c -#define UMBOX0_DMA_TX_CONTROL_OFFSET 0x0000001c -#define UMBOX0_DMA_TX_CONTROL_RESUME_MSB 2 -#define UMBOX0_DMA_TX_CONTROL_RESUME_LSB 2 -#define UMBOX0_DMA_TX_CONTROL_RESUME_MASK 0x00000004 -#define UMBOX0_DMA_TX_CONTROL_RESUME_GET(x) (((x) & UMBOX0_DMA_TX_CONTROL_RESUME_MASK) >> UMBOX0_DMA_TX_CONTROL_RESUME_LSB) -#define UMBOX0_DMA_TX_CONTROL_RESUME_SET(x) (((x) << UMBOX0_DMA_TX_CONTROL_RESUME_LSB) & UMBOX0_DMA_TX_CONTROL_RESUME_MASK) -#define UMBOX0_DMA_TX_CONTROL_START_MSB 1 -#define UMBOX0_DMA_TX_CONTROL_START_LSB 1 -#define UMBOX0_DMA_TX_CONTROL_START_MASK 0x00000002 -#define UMBOX0_DMA_TX_CONTROL_START_GET(x) (((x) & UMBOX0_DMA_TX_CONTROL_START_MASK) >> UMBOX0_DMA_TX_CONTROL_START_LSB) -#define UMBOX0_DMA_TX_CONTROL_START_SET(x) (((x) << UMBOX0_DMA_TX_CONTROL_START_LSB) & UMBOX0_DMA_TX_CONTROL_START_MASK) -#define UMBOX0_DMA_TX_CONTROL_STOP_MSB 0 -#define UMBOX0_DMA_TX_CONTROL_STOP_LSB 0 -#define UMBOX0_DMA_TX_CONTROL_STOP_MASK 0x00000001 -#define UMBOX0_DMA_TX_CONTROL_STOP_GET(x) (((x) & UMBOX0_DMA_TX_CONTROL_STOP_MASK) >> UMBOX0_DMA_TX_CONTROL_STOP_LSB) -#define UMBOX0_DMA_TX_CONTROL_STOP_SET(x) (((x) << UMBOX0_DMA_TX_CONTROL_STOP_LSB) & UMBOX0_DMA_TX_CONTROL_STOP_MASK) - -#define UMBOX_FIFO_TIMEOUT_ADDRESS 0x00000020 -#define UMBOX_FIFO_TIMEOUT_OFFSET 0x00000020 -#define UMBOX_FIFO_TIMEOUT_ENABLE_SET_MSB 8 -#define UMBOX_FIFO_TIMEOUT_ENABLE_SET_LSB 8 -#define UMBOX_FIFO_TIMEOUT_ENABLE_SET_MASK 0x00000100 -#define UMBOX_FIFO_TIMEOUT_ENABLE_SET_GET(x) (((x) & UMBOX_FIFO_TIMEOUT_ENABLE_SET_MASK) >> UMBOX_FIFO_TIMEOUT_ENABLE_SET_LSB) -#define UMBOX_FIFO_TIMEOUT_ENABLE_SET_SET(x) (((x) << UMBOX_FIFO_TIMEOUT_ENABLE_SET_LSB) & UMBOX_FIFO_TIMEOUT_ENABLE_SET_MASK) -#define UMBOX_FIFO_TIMEOUT_VALUE_MSB 7 -#define UMBOX_FIFO_TIMEOUT_VALUE_LSB 0 -#define UMBOX_FIFO_TIMEOUT_VALUE_MASK 0x000000ff -#define UMBOX_FIFO_TIMEOUT_VALUE_GET(x) (((x) & UMBOX_FIFO_TIMEOUT_VALUE_MASK) >> UMBOX_FIFO_TIMEOUT_VALUE_LSB) -#define UMBOX_FIFO_TIMEOUT_VALUE_SET(x) (((x) << UMBOX_FIFO_TIMEOUT_VALUE_LSB) & UMBOX_FIFO_TIMEOUT_VALUE_MASK) - -#define UMBOX_INT_STATUS_ADDRESS 0x00000024 -#define UMBOX_INT_STATUS_OFFSET 0x00000024 -#define UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_MSB 9 -#define UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_LSB 9 -#define UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_MASK 0x00000200 -#define UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_GET(x) (((x) & UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_MASK) >> UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_LSB) -#define UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_SET(x) (((x) << UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_LSB) & UMBOX_INT_STATUS_HCI_FRAMER_UNDERFLOW_MASK) -#define UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_MSB 8 -#define UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_LSB 8 -#define UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_MASK 0x00000100 -#define UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_GET(x) (((x) & UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_MASK) >> UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_LSB) -#define UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_SET(x) (((x) << UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_LSB) & UMBOX_INT_STATUS_HCI_FRAMER_OVERFLOW_MASK) -#define UMBOX_INT_STATUS_RX_DMA_COMPLETE_MSB 7 -#define UMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB 7 -#define UMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK 0x00000080 -#define UMBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) (((x) & UMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) >> UMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) -#define UMBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) (((x) << UMBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) & UMBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) -#define UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB 6 -#define UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB 6 -#define UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK 0x00000040 -#define UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) (((x) & UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) >> UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) -#define UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) (((x) << UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) & UMBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) -#define UMBOX_INT_STATUS_TX_DMA_COMPLETE_MSB 5 -#define UMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB 5 -#define UMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK 0x00000020 -#define UMBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) (((x) & UMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) >> UMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) -#define UMBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) (((x) << UMBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) & UMBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) -#define UMBOX_INT_STATUS_HCI_SYNC_ERROR_MSB 4 -#define UMBOX_INT_STATUS_HCI_SYNC_ERROR_LSB 4 -#define UMBOX_INT_STATUS_HCI_SYNC_ERROR_MASK 0x00000010 -#define UMBOX_INT_STATUS_HCI_SYNC_ERROR_GET(x) (((x) & UMBOX_INT_STATUS_HCI_SYNC_ERROR_MASK) >> UMBOX_INT_STATUS_HCI_SYNC_ERROR_LSB) -#define UMBOX_INT_STATUS_HCI_SYNC_ERROR_SET(x) (((x) << UMBOX_INT_STATUS_HCI_SYNC_ERROR_LSB) & UMBOX_INT_STATUS_HCI_SYNC_ERROR_MASK) -#define UMBOX_INT_STATUS_TX_OVERFLOW_MSB 3 -#define UMBOX_INT_STATUS_TX_OVERFLOW_LSB 3 -#define UMBOX_INT_STATUS_TX_OVERFLOW_MASK 0x00000008 -#define UMBOX_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & UMBOX_INT_STATUS_TX_OVERFLOW_MASK) >> UMBOX_INT_STATUS_TX_OVERFLOW_LSB) -#define UMBOX_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << UMBOX_INT_STATUS_TX_OVERFLOW_LSB) & UMBOX_INT_STATUS_TX_OVERFLOW_MASK) -#define UMBOX_INT_STATUS_RX_UNDERFLOW_MSB 2 -#define UMBOX_INT_STATUS_RX_UNDERFLOW_LSB 2 -#define UMBOX_INT_STATUS_RX_UNDERFLOW_MASK 0x00000004 -#define UMBOX_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & UMBOX_INT_STATUS_RX_UNDERFLOW_MASK) >> UMBOX_INT_STATUS_RX_UNDERFLOW_LSB) -#define UMBOX_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << UMBOX_INT_STATUS_RX_UNDERFLOW_LSB) & UMBOX_INT_STATUS_RX_UNDERFLOW_MASK) -#define UMBOX_INT_STATUS_TX_NOT_EMPTY_MSB 1 -#define UMBOX_INT_STATUS_TX_NOT_EMPTY_LSB 1 -#define UMBOX_INT_STATUS_TX_NOT_EMPTY_MASK 0x00000002 -#define UMBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) (((x) & UMBOX_INT_STATUS_TX_NOT_EMPTY_MASK) >> UMBOX_INT_STATUS_TX_NOT_EMPTY_LSB) -#define UMBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) (((x) << UMBOX_INT_STATUS_TX_NOT_EMPTY_LSB) & UMBOX_INT_STATUS_TX_NOT_EMPTY_MASK) -#define UMBOX_INT_STATUS_RX_NOT_FULL_MSB 0 -#define UMBOX_INT_STATUS_RX_NOT_FULL_LSB 0 -#define UMBOX_INT_STATUS_RX_NOT_FULL_MASK 0x00000001 -#define UMBOX_INT_STATUS_RX_NOT_FULL_GET(x) (((x) & UMBOX_INT_STATUS_RX_NOT_FULL_MASK) >> UMBOX_INT_STATUS_RX_NOT_FULL_LSB) -#define UMBOX_INT_STATUS_RX_NOT_FULL_SET(x) (((x) << UMBOX_INT_STATUS_RX_NOT_FULL_LSB) & UMBOX_INT_STATUS_RX_NOT_FULL_MASK) - -#define UMBOX_INT_ENABLE_ADDRESS 0x00000028 -#define UMBOX_INT_ENABLE_OFFSET 0x00000028 -#define UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_MSB 9 -#define UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_LSB 9 -#define UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_MASK 0x00000200 -#define UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_GET(x) (((x) & UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_MASK) >> UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_LSB) -#define UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_SET(x) (((x) << UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_LSB) & UMBOX_INT_ENABLE_HCI_FRAMER_UNDERFLOW_MASK) -#define UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_MSB 8 -#define UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_LSB 8 -#define UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_MASK 0x00000100 -#define UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_GET(x) (((x) & UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_MASK) >> UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_LSB) -#define UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_SET(x) (((x) << UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_LSB) & UMBOX_INT_ENABLE_HCI_FRAMER_OVERFLOW_MASK) -#define UMBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB 7 -#define UMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB 7 -#define UMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK 0x00000080 -#define UMBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) (((x) & UMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) >> UMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) -#define UMBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) (((x) << UMBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) & UMBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) -#define UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB 6 -#define UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB 6 -#define UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK 0x00000040 -#define UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) (((x) & UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) >> UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) -#define UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) (((x) << UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) & UMBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) -#define UMBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB 5 -#define UMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB 5 -#define UMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK 0x00000020 -#define UMBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) (((x) & UMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) >> UMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) -#define UMBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) (((x) << UMBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) & UMBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) -#define UMBOX_INT_ENABLE_HCI_SYNC_ERROR_MSB 4 -#define UMBOX_INT_ENABLE_HCI_SYNC_ERROR_LSB 4 -#define UMBOX_INT_ENABLE_HCI_SYNC_ERROR_MASK 0x00000010 -#define UMBOX_INT_ENABLE_HCI_SYNC_ERROR_GET(x) (((x) & UMBOX_INT_ENABLE_HCI_SYNC_ERROR_MASK) >> UMBOX_INT_ENABLE_HCI_SYNC_ERROR_LSB) -#define UMBOX_INT_ENABLE_HCI_SYNC_ERROR_SET(x) (((x) << UMBOX_INT_ENABLE_HCI_SYNC_ERROR_LSB) & UMBOX_INT_ENABLE_HCI_SYNC_ERROR_MASK) -#define UMBOX_INT_ENABLE_TX_OVERFLOW_MSB 3 -#define UMBOX_INT_ENABLE_TX_OVERFLOW_LSB 3 -#define UMBOX_INT_ENABLE_TX_OVERFLOW_MASK 0x00000008 -#define UMBOX_INT_ENABLE_TX_OVERFLOW_GET(x) (((x) & UMBOX_INT_ENABLE_TX_OVERFLOW_MASK) >> UMBOX_INT_ENABLE_TX_OVERFLOW_LSB) -#define UMBOX_INT_ENABLE_TX_OVERFLOW_SET(x) (((x) << UMBOX_INT_ENABLE_TX_OVERFLOW_LSB) & UMBOX_INT_ENABLE_TX_OVERFLOW_MASK) -#define UMBOX_INT_ENABLE_RX_UNDERFLOW_MSB 2 -#define UMBOX_INT_ENABLE_RX_UNDERFLOW_LSB 2 -#define UMBOX_INT_ENABLE_RX_UNDERFLOW_MASK 0x00000004 -#define UMBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) (((x) & UMBOX_INT_ENABLE_RX_UNDERFLOW_MASK) >> UMBOX_INT_ENABLE_RX_UNDERFLOW_LSB) -#define UMBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) (((x) << UMBOX_INT_ENABLE_RX_UNDERFLOW_LSB) & UMBOX_INT_ENABLE_RX_UNDERFLOW_MASK) -#define UMBOX_INT_ENABLE_TX_NOT_EMPTY_MSB 1 -#define UMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB 1 -#define UMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK 0x00000002 -#define UMBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) (((x) & UMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) >> UMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) -#define UMBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) (((x) << UMBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) & UMBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) -#define UMBOX_INT_ENABLE_RX_NOT_FULL_MSB 0 -#define UMBOX_INT_ENABLE_RX_NOT_FULL_LSB 0 -#define UMBOX_INT_ENABLE_RX_NOT_FULL_MASK 0x00000001 -#define UMBOX_INT_ENABLE_RX_NOT_FULL_GET(x) (((x) & UMBOX_INT_ENABLE_RX_NOT_FULL_MASK) >> UMBOX_INT_ENABLE_RX_NOT_FULL_LSB) -#define UMBOX_INT_ENABLE_RX_NOT_FULL_SET(x) (((x) << UMBOX_INT_ENABLE_RX_NOT_FULL_LSB) & UMBOX_INT_ENABLE_RX_NOT_FULL_MASK) - -#define UMBOX_DEBUG_ADDRESS 0x0000002c -#define UMBOX_DEBUG_OFFSET 0x0000002c -#define UMBOX_DEBUG_SEL_MSB 2 -#define UMBOX_DEBUG_SEL_LSB 0 -#define UMBOX_DEBUG_SEL_MASK 0x00000007 -#define UMBOX_DEBUG_SEL_GET(x) (((x) & UMBOX_DEBUG_SEL_MASK) >> UMBOX_DEBUG_SEL_LSB) -#define UMBOX_DEBUG_SEL_SET(x) (((x) << UMBOX_DEBUG_SEL_LSB) & UMBOX_DEBUG_SEL_MASK) - -#define UMBOX_FIFO_RESET_ADDRESS 0x00000030 -#define UMBOX_FIFO_RESET_OFFSET 0x00000030 -#define UMBOX_FIFO_RESET_INIT_MSB 0 -#define UMBOX_FIFO_RESET_INIT_LSB 0 -#define UMBOX_FIFO_RESET_INIT_MASK 0x00000001 -#define UMBOX_FIFO_RESET_INIT_GET(x) (((x) & UMBOX_FIFO_RESET_INIT_MASK) >> UMBOX_FIFO_RESET_INIT_LSB) -#define UMBOX_FIFO_RESET_INIT_SET(x) (((x) << UMBOX_FIFO_RESET_INIT_LSB) & UMBOX_FIFO_RESET_INIT_MASK) - -#define UMBOX_HCI_FRAMER_ADDRESS 0x00000034 -#define UMBOX_HCI_FRAMER_OFFSET 0x00000034 -#define UMBOX_HCI_FRAMER_CRC_OVERRIDE_MSB 6 -#define UMBOX_HCI_FRAMER_CRC_OVERRIDE_LSB 6 -#define UMBOX_HCI_FRAMER_CRC_OVERRIDE_MASK 0x00000040 -#define UMBOX_HCI_FRAMER_CRC_OVERRIDE_GET(x) (((x) & UMBOX_HCI_FRAMER_CRC_OVERRIDE_MASK) >> UMBOX_HCI_FRAMER_CRC_OVERRIDE_LSB) -#define UMBOX_HCI_FRAMER_CRC_OVERRIDE_SET(x) (((x) << UMBOX_HCI_FRAMER_CRC_OVERRIDE_LSB) & UMBOX_HCI_FRAMER_CRC_OVERRIDE_MASK) -#define UMBOX_HCI_FRAMER_ENABLE_MSB 5 -#define UMBOX_HCI_FRAMER_ENABLE_LSB 5 -#define UMBOX_HCI_FRAMER_ENABLE_MASK 0x00000020 -#define UMBOX_HCI_FRAMER_ENABLE_GET(x) (((x) & UMBOX_HCI_FRAMER_ENABLE_MASK) >> UMBOX_HCI_FRAMER_ENABLE_LSB) -#define UMBOX_HCI_FRAMER_ENABLE_SET(x) (((x) << UMBOX_HCI_FRAMER_ENABLE_LSB) & UMBOX_HCI_FRAMER_ENABLE_MASK) -#define UMBOX_HCI_FRAMER_SYNC_ERROR_MSB 4 -#define UMBOX_HCI_FRAMER_SYNC_ERROR_LSB 4 -#define UMBOX_HCI_FRAMER_SYNC_ERROR_MASK 0x00000010 -#define UMBOX_HCI_FRAMER_SYNC_ERROR_GET(x) (((x) & UMBOX_HCI_FRAMER_SYNC_ERROR_MASK) >> UMBOX_HCI_FRAMER_SYNC_ERROR_LSB) -#define UMBOX_HCI_FRAMER_SYNC_ERROR_SET(x) (((x) << UMBOX_HCI_FRAMER_SYNC_ERROR_LSB) & UMBOX_HCI_FRAMER_SYNC_ERROR_MASK) -#define UMBOX_HCI_FRAMER_UNDERFLOW_MSB 3 -#define UMBOX_HCI_FRAMER_UNDERFLOW_LSB 3 -#define UMBOX_HCI_FRAMER_UNDERFLOW_MASK 0x00000008 -#define UMBOX_HCI_FRAMER_UNDERFLOW_GET(x) (((x) & UMBOX_HCI_FRAMER_UNDERFLOW_MASK) >> UMBOX_HCI_FRAMER_UNDERFLOW_LSB) -#define UMBOX_HCI_FRAMER_UNDERFLOW_SET(x) (((x) << UMBOX_HCI_FRAMER_UNDERFLOW_LSB) & UMBOX_HCI_FRAMER_UNDERFLOW_MASK) -#define UMBOX_HCI_FRAMER_OVERFLOW_MSB 2 -#define UMBOX_HCI_FRAMER_OVERFLOW_LSB 2 -#define UMBOX_HCI_FRAMER_OVERFLOW_MASK 0x00000004 -#define UMBOX_HCI_FRAMER_OVERFLOW_GET(x) (((x) & UMBOX_HCI_FRAMER_OVERFLOW_MASK) >> UMBOX_HCI_FRAMER_OVERFLOW_LSB) -#define UMBOX_HCI_FRAMER_OVERFLOW_SET(x) (((x) << UMBOX_HCI_FRAMER_OVERFLOW_LSB) & UMBOX_HCI_FRAMER_OVERFLOW_MASK) -#define UMBOX_HCI_FRAMER_CONFIG_MODE_MSB 1 -#define UMBOX_HCI_FRAMER_CONFIG_MODE_LSB 0 -#define UMBOX_HCI_FRAMER_CONFIG_MODE_MASK 0x00000003 -#define UMBOX_HCI_FRAMER_CONFIG_MODE_GET(x) (((x) & UMBOX_HCI_FRAMER_CONFIG_MODE_MASK) >> UMBOX_HCI_FRAMER_CONFIG_MODE_LSB) -#define UMBOX_HCI_FRAMER_CONFIG_MODE_SET(x) (((x) << UMBOX_HCI_FRAMER_CONFIG_MODE_LSB) & UMBOX_HCI_FRAMER_CONFIG_MODE_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct umbox_wlan_reg_reg_s { - volatile unsigned int umbox_fifo[2]; - volatile unsigned int umbox_fifo_status; - volatile unsigned int umbox_dma_policy; - volatile unsigned int umbox0_dma_rx_descriptor_base; - volatile unsigned int umbox0_dma_rx_control; - volatile unsigned int umbox0_dma_tx_descriptor_base; - volatile unsigned int umbox0_dma_tx_control; - volatile unsigned int umbox_fifo_timeout; - volatile unsigned int umbox_int_status; - volatile unsigned int umbox_int_enable; - volatile unsigned int umbox_debug; - volatile unsigned int umbox_fifo_reset; - volatile unsigned int umbox_hci_framer; -} umbox_wlan_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _UMBOX_WLAN_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/usb_cast_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/usb_cast_reg.h deleted file mode 100644 index 91af22da0080..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/usb_cast_reg.h +++ /dev/null @@ -1,1387 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - - -#ifndef _USB_CAST_REG_REG_H_ -#define _USB_CAST_REG_REG_H_ - -#define ENDP0_ADDRESS 0x00000000 -#define ENDP0_OFFSET 0x00000000 -#define ENDP0_CHGSETUP_MSB 23 -#define ENDP0_CHGSETUP_LSB 23 -#define ENDP0_CHGSETUP_MASK 0x00800000 -#define ENDP0_CHGSETUP_GET(x) (((x) & ENDP0_CHGSETUP_MASK) >> ENDP0_CHGSETUP_LSB) -#define ENDP0_CHGSETUP_SET(x) (((x) << ENDP0_CHGSETUP_LSB) & ENDP0_CHGSETUP_MASK) -#define ENDP0_DSTALL_MSB 20 -#define ENDP0_DSTALL_LSB 20 -#define ENDP0_DSTALL_MASK 0x00100000 -#define ENDP0_DSTALL_GET(x) (((x) & ENDP0_DSTALL_MASK) >> ENDP0_DSTALL_LSB) -#define ENDP0_DSTALL_SET(x) (((x) << ENDP0_DSTALL_LSB) & ENDP0_DSTALL_MASK) -#define ENDP0_HSNAK_MSB 17 -#define ENDP0_HSNAK_LSB 17 -#define ENDP0_HSNAK_MASK 0x00020000 -#define ENDP0_HSNAK_GET(x) (((x) & ENDP0_HSNAK_MASK) >> ENDP0_HSNAK_LSB) -#define ENDP0_HSNAK_SET(x) (((x) << ENDP0_HSNAK_LSB) & ENDP0_HSNAK_MASK) -#define ENDP0_STALL_MSB 16 -#define ENDP0_STALL_LSB 16 -#define ENDP0_STALL_MASK 0x00010000 -#define ENDP0_STALL_GET(x) (((x) & ENDP0_STALL_MASK) >> ENDP0_STALL_LSB) -#define ENDP0_STALL_SET(x) (((x) << ENDP0_STALL_LSB) & ENDP0_STALL_MASK) -#define ENDP0_MAXP_MSB 7 -#define ENDP0_MAXP_LSB 0 -#define ENDP0_MAXP_MASK 0x000000ff -#define ENDP0_MAXP_GET(x) (((x) & ENDP0_MAXP_MASK) >> ENDP0_MAXP_LSB) -#define ENDP0_MAXP_SET(x) (((x) << ENDP0_MAXP_LSB) & ENDP0_MAXP_MASK) - -#define OUT1ENDP_ADDRESS 0x00000008 -#define OUT1ENDP_OFFSET 0x00000008 -#define OUT1ENDP_ISOERR_MSB 24 -#define OUT1ENDP_ISOERR_LSB 24 -#define OUT1ENDP_ISOERR_MASK 0x01000000 -#define OUT1ENDP_ISOERR_GET(x) (((x) & OUT1ENDP_ISOERR_MASK) >> OUT1ENDP_ISOERR_LSB) -#define OUT1ENDP_ISOERR_SET(x) (((x) << OUT1ENDP_ISOERR_LSB) & OUT1ENDP_ISOERR_MASK) -#define OUT1ENDP_VAL_MSB 23 -#define OUT1ENDP_VAL_LSB 23 -#define OUT1ENDP_VAL_MASK 0x00800000 -#define OUT1ENDP_VAL_GET(x) (((x) & OUT1ENDP_VAL_MASK) >> OUT1ENDP_VAL_LSB) -#define OUT1ENDP_VAL_SET(x) (((x) << OUT1ENDP_VAL_LSB) & OUT1ENDP_VAL_MASK) -#define OUT1ENDP_STALL_MSB 22 -#define OUT1ENDP_STALL_LSB 22 -#define OUT1ENDP_STALL_MASK 0x00400000 -#define OUT1ENDP_STALL_GET(x) (((x) & OUT1ENDP_STALL_MASK) >> OUT1ENDP_STALL_LSB) -#define OUT1ENDP_STALL_SET(x) (((x) << OUT1ENDP_STALL_LSB) & OUT1ENDP_STALL_MASK) -#define OUT1ENDP_ISOD_MSB 21 -#define OUT1ENDP_ISOD_LSB 20 -#define OUT1ENDP_ISOD_MASK 0x00300000 -#define OUT1ENDP_ISOD_GET(x) (((x) & OUT1ENDP_ISOD_MASK) >> OUT1ENDP_ISOD_LSB) -#define OUT1ENDP_ISOD_SET(x) (((x) << OUT1ENDP_ISOD_LSB) & OUT1ENDP_ISOD_MASK) -#define OUT1ENDP_TYPE_MSB 19 -#define OUT1ENDP_TYPE_LSB 18 -#define OUT1ENDP_TYPE_MASK 0x000c0000 -#define OUT1ENDP_TYPE_GET(x) (((x) & OUT1ENDP_TYPE_MASK) >> OUT1ENDP_TYPE_LSB) -#define OUT1ENDP_TYPE_SET(x) (((x) << OUT1ENDP_TYPE_LSB) & OUT1ENDP_TYPE_MASK) -#define OUT1ENDP_MAXP_MSB 10 -#define OUT1ENDP_MAXP_LSB 0 -#define OUT1ENDP_MAXP_MASK 0x000007ff -#define OUT1ENDP_MAXP_GET(x) (((x) & OUT1ENDP_MAXP_MASK) >> OUT1ENDP_MAXP_LSB) -#define OUT1ENDP_MAXP_SET(x) (((x) << OUT1ENDP_MAXP_LSB) & OUT1ENDP_MAXP_MASK) - -#define IN1ENDP_ADDRESS 0x0000000c -#define IN1ENDP_OFFSET 0x0000000c -#define IN1ENDP_HCSET_MSB 28 -#define IN1ENDP_HCSET_LSB 28 -#define IN1ENDP_HCSET_MASK 0x10000000 -#define IN1ENDP_HCSET_GET(x) (((x) & IN1ENDP_HCSET_MASK) >> IN1ENDP_HCSET_LSB) -#define IN1ENDP_HCSET_SET(x) (((x) << IN1ENDP_HCSET_LSB) & IN1ENDP_HCSET_MASK) -#define IN1ENDP_ISOERR_MSB 24 -#define IN1ENDP_ISOERR_LSB 24 -#define IN1ENDP_ISOERR_MASK 0x01000000 -#define IN1ENDP_ISOERR_GET(x) (((x) & IN1ENDP_ISOERR_MASK) >> IN1ENDP_ISOERR_LSB) -#define IN1ENDP_ISOERR_SET(x) (((x) << IN1ENDP_ISOERR_LSB) & IN1ENDP_ISOERR_MASK) -#define IN1ENDP_VAL_MSB 23 -#define IN1ENDP_VAL_LSB 23 -#define IN1ENDP_VAL_MASK 0x00800000 -#define IN1ENDP_VAL_GET(x) (((x) & IN1ENDP_VAL_MASK) >> IN1ENDP_VAL_LSB) -#define IN1ENDP_VAL_SET(x) (((x) << IN1ENDP_VAL_LSB) & IN1ENDP_VAL_MASK) -#define IN1ENDP_STALL_MSB 22 -#define IN1ENDP_STALL_LSB 22 -#define IN1ENDP_STALL_MASK 0x00400000 -#define IN1ENDP_STALL_GET(x) (((x) & IN1ENDP_STALL_MASK) >> IN1ENDP_STALL_LSB) -#define IN1ENDP_STALL_SET(x) (((x) << IN1ENDP_STALL_LSB) & IN1ENDP_STALL_MASK) -#define IN1ENDP_ISOD_MSB 21 -#define IN1ENDP_ISOD_LSB 20 -#define IN1ENDP_ISOD_MASK 0x00300000 -#define IN1ENDP_ISOD_GET(x) (((x) & IN1ENDP_ISOD_MASK) >> IN1ENDP_ISOD_LSB) -#define IN1ENDP_ISOD_SET(x) (((x) << IN1ENDP_ISOD_LSB) & IN1ENDP_ISOD_MASK) -#define IN1ENDP_TYPE_MSB 19 -#define IN1ENDP_TYPE_LSB 18 -#define IN1ENDP_TYPE_MASK 0x000c0000 -#define IN1ENDP_TYPE_GET(x) (((x) & IN1ENDP_TYPE_MASK) >> IN1ENDP_TYPE_LSB) -#define IN1ENDP_TYPE_SET(x) (((x) << IN1ENDP_TYPE_LSB) & IN1ENDP_TYPE_MASK) -#define IN1ENDP_MAXP_MSB 10 -#define IN1ENDP_MAXP_LSB 0 -#define IN1ENDP_MAXP_MASK 0x000007ff -#define IN1ENDP_MAXP_GET(x) (((x) & IN1ENDP_MAXP_MASK) >> IN1ENDP_MAXP_LSB) -#define IN1ENDP_MAXP_SET(x) (((x) << IN1ENDP_MAXP_LSB) & IN1ENDP_MAXP_MASK) - -#define OUT2ENDP_ADDRESS 0x00000010 -#define OUT2ENDP_OFFSET 0x00000010 -#define OUT2ENDP_ISOERR_MSB 24 -#define OUT2ENDP_ISOERR_LSB 24 -#define OUT2ENDP_ISOERR_MASK 0x01000000 -#define OUT2ENDP_ISOERR_GET(x) (((x) & OUT2ENDP_ISOERR_MASK) >> OUT2ENDP_ISOERR_LSB) -#define OUT2ENDP_ISOERR_SET(x) (((x) << OUT2ENDP_ISOERR_LSB) & OUT2ENDP_ISOERR_MASK) -#define OUT2ENDP_VAL_MSB 23 -#define OUT2ENDP_VAL_LSB 23 -#define OUT2ENDP_VAL_MASK 0x00800000 -#define OUT2ENDP_VAL_GET(x) (((x) & OUT2ENDP_VAL_MASK) >> OUT2ENDP_VAL_LSB) -#define OUT2ENDP_VAL_SET(x) (((x) << OUT2ENDP_VAL_LSB) & OUT2ENDP_VAL_MASK) -#define OUT2ENDP_STALL_MSB 22 -#define OUT2ENDP_STALL_LSB 22 -#define OUT2ENDP_STALL_MASK 0x00400000 -#define OUT2ENDP_STALL_GET(x) (((x) & OUT2ENDP_STALL_MASK) >> OUT2ENDP_STALL_LSB) -#define OUT2ENDP_STALL_SET(x) (((x) << OUT2ENDP_STALL_LSB) & OUT2ENDP_STALL_MASK) -#define OUT2ENDP_ISOD_MSB 21 -#define OUT2ENDP_ISOD_LSB 20 -#define OUT2ENDP_ISOD_MASK 0x00300000 -#define OUT2ENDP_ISOD_GET(x) (((x) & OUT2ENDP_ISOD_MASK) >> OUT2ENDP_ISOD_LSB) -#define OUT2ENDP_ISOD_SET(x) (((x) << OUT2ENDP_ISOD_LSB) & OUT2ENDP_ISOD_MASK) -#define OUT2ENDP_TYPE_MSB 19 -#define OUT2ENDP_TYPE_LSB 18 -#define OUT2ENDP_TYPE_MASK 0x000c0000 -#define OUT2ENDP_TYPE_GET(x) (((x) & OUT2ENDP_TYPE_MASK) >> OUT2ENDP_TYPE_LSB) -#define OUT2ENDP_TYPE_SET(x) (((x) << OUT2ENDP_TYPE_LSB) & OUT2ENDP_TYPE_MASK) -#define OUT2ENDP_MAXP_MSB 10 -#define OUT2ENDP_MAXP_LSB 0 -#define OUT2ENDP_MAXP_MASK 0x000007ff -#define OUT2ENDP_MAXP_GET(x) (((x) & OUT2ENDP_MAXP_MASK) >> OUT2ENDP_MAXP_LSB) -#define OUT2ENDP_MAXP_SET(x) (((x) << OUT2ENDP_MAXP_LSB) & OUT2ENDP_MAXP_MASK) - -#define IN2ENDP_ADDRESS 0x00000014 -#define IN2ENDP_OFFSET 0x00000014 -#define IN2ENDP_HCSET_MSB 28 -#define IN2ENDP_HCSET_LSB 28 -#define IN2ENDP_HCSET_MASK 0x10000000 -#define IN2ENDP_HCSET_GET(x) (((x) & IN2ENDP_HCSET_MASK) >> IN2ENDP_HCSET_LSB) -#define IN2ENDP_HCSET_SET(x) (((x) << IN2ENDP_HCSET_LSB) & IN2ENDP_HCSET_MASK) -#define IN2ENDP_ISOERR_MSB 24 -#define IN2ENDP_ISOERR_LSB 24 -#define IN2ENDP_ISOERR_MASK 0x01000000 -#define IN2ENDP_ISOERR_GET(x) (((x) & IN2ENDP_ISOERR_MASK) >> IN2ENDP_ISOERR_LSB) -#define IN2ENDP_ISOERR_SET(x) (((x) << IN2ENDP_ISOERR_LSB) & IN2ENDP_ISOERR_MASK) -#define IN2ENDP_VAL_MSB 23 -#define IN2ENDP_VAL_LSB 23 -#define IN2ENDP_VAL_MASK 0x00800000 -#define IN2ENDP_VAL_GET(x) (((x) & IN2ENDP_VAL_MASK) >> IN2ENDP_VAL_LSB) -#define IN2ENDP_VAL_SET(x) (((x) << IN2ENDP_VAL_LSB) & IN2ENDP_VAL_MASK) -#define IN2ENDP_STALL_MSB 22 -#define IN2ENDP_STALL_LSB 22 -#define IN2ENDP_STALL_MASK 0x00400000 -#define IN2ENDP_STALL_GET(x) (((x) & IN2ENDP_STALL_MASK) >> IN2ENDP_STALL_LSB) -#define IN2ENDP_STALL_SET(x) (((x) << IN2ENDP_STALL_LSB) & IN2ENDP_STALL_MASK) -#define IN2ENDP_ISOD_MSB 21 -#define IN2ENDP_ISOD_LSB 20 -#define IN2ENDP_ISOD_MASK 0x00300000 -#define IN2ENDP_ISOD_GET(x) (((x) & IN2ENDP_ISOD_MASK) >> IN2ENDP_ISOD_LSB) -#define IN2ENDP_ISOD_SET(x) (((x) << IN2ENDP_ISOD_LSB) & IN2ENDP_ISOD_MASK) -#define IN2ENDP_TYPE_MSB 19 -#define IN2ENDP_TYPE_LSB 18 -#define IN2ENDP_TYPE_MASK 0x000c0000 -#define IN2ENDP_TYPE_GET(x) (((x) & IN2ENDP_TYPE_MASK) >> IN2ENDP_TYPE_LSB) -#define IN2ENDP_TYPE_SET(x) (((x) << IN2ENDP_TYPE_LSB) & IN2ENDP_TYPE_MASK) -#define IN2ENDP_MAXP_MSB 10 -#define IN2ENDP_MAXP_LSB 0 -#define IN2ENDP_MAXP_MASK 0x000007ff -#define IN2ENDP_MAXP_GET(x) (((x) & IN2ENDP_MAXP_MASK) >> IN2ENDP_MAXP_LSB) -#define IN2ENDP_MAXP_SET(x) (((x) << IN2ENDP_MAXP_LSB) & IN2ENDP_MAXP_MASK) - -#define OUT3ENDP_ADDRESS 0x00000018 -#define OUT3ENDP_OFFSET 0x00000018 -#define OUT3ENDP_ISOERR_MSB 24 -#define OUT3ENDP_ISOERR_LSB 24 -#define OUT3ENDP_ISOERR_MASK 0x01000000 -#define OUT3ENDP_ISOERR_GET(x) (((x) & OUT3ENDP_ISOERR_MASK) >> OUT3ENDP_ISOERR_LSB) -#define OUT3ENDP_ISOERR_SET(x) (((x) << OUT3ENDP_ISOERR_LSB) & OUT3ENDP_ISOERR_MASK) -#define OUT3ENDP_VAL_MSB 23 -#define OUT3ENDP_VAL_LSB 23 -#define OUT3ENDP_VAL_MASK 0x00800000 -#define OUT3ENDP_VAL_GET(x) (((x) & OUT3ENDP_VAL_MASK) >> OUT3ENDP_VAL_LSB) -#define OUT3ENDP_VAL_SET(x) (((x) << OUT3ENDP_VAL_LSB) & OUT3ENDP_VAL_MASK) -#define OUT3ENDP_STALL_MSB 22 -#define OUT3ENDP_STALL_LSB 22 -#define OUT3ENDP_STALL_MASK 0x00400000 -#define OUT3ENDP_STALL_GET(x) (((x) & OUT3ENDP_STALL_MASK) >> OUT3ENDP_STALL_LSB) -#define OUT3ENDP_STALL_SET(x) (((x) << OUT3ENDP_STALL_LSB) & OUT3ENDP_STALL_MASK) -#define OUT3ENDP_ISOD_MSB 21 -#define OUT3ENDP_ISOD_LSB 20 -#define OUT3ENDP_ISOD_MASK 0x00300000 -#define OUT3ENDP_ISOD_GET(x) (((x) & OUT3ENDP_ISOD_MASK) >> OUT3ENDP_ISOD_LSB) -#define OUT3ENDP_ISOD_SET(x) (((x) << OUT3ENDP_ISOD_LSB) & OUT3ENDP_ISOD_MASK) -#define OUT3ENDP_TYPE_MSB 19 -#define OUT3ENDP_TYPE_LSB 18 -#define OUT3ENDP_TYPE_MASK 0x000c0000 -#define OUT3ENDP_TYPE_GET(x) (((x) & OUT3ENDP_TYPE_MASK) >> OUT3ENDP_TYPE_LSB) -#define OUT3ENDP_TYPE_SET(x) (((x) << OUT3ENDP_TYPE_LSB) & OUT3ENDP_TYPE_MASK) -#define OUT3ENDP_MAXP_MSB 10 -#define OUT3ENDP_MAXP_LSB 0 -#define OUT3ENDP_MAXP_MASK 0x000007ff -#define OUT3ENDP_MAXP_GET(x) (((x) & OUT3ENDP_MAXP_MASK) >> OUT3ENDP_MAXP_LSB) -#define OUT3ENDP_MAXP_SET(x) (((x) << OUT3ENDP_MAXP_LSB) & OUT3ENDP_MAXP_MASK) - -#define IN3ENDP_ADDRESS 0x0000001c -#define IN3ENDP_OFFSET 0x0000001c -#define IN3ENDP_HCSET_MSB 28 -#define IN3ENDP_HCSET_LSB 28 -#define IN3ENDP_HCSET_MASK 0x10000000 -#define IN3ENDP_HCSET_GET(x) (((x) & IN3ENDP_HCSET_MASK) >> IN3ENDP_HCSET_LSB) -#define IN3ENDP_HCSET_SET(x) (((x) << IN3ENDP_HCSET_LSB) & IN3ENDP_HCSET_MASK) -#define IN3ENDP_ISOERR_MSB 24 -#define IN3ENDP_ISOERR_LSB 24 -#define IN3ENDP_ISOERR_MASK 0x01000000 -#define IN3ENDP_ISOERR_GET(x) (((x) & IN3ENDP_ISOERR_MASK) >> IN3ENDP_ISOERR_LSB) -#define IN3ENDP_ISOERR_SET(x) (((x) << IN3ENDP_ISOERR_LSB) & IN3ENDP_ISOERR_MASK) -#define IN3ENDP_VAL_MSB 23 -#define IN3ENDP_VAL_LSB 23 -#define IN3ENDP_VAL_MASK 0x00800000 -#define IN3ENDP_VAL_GET(x) (((x) & IN3ENDP_VAL_MASK) >> IN3ENDP_VAL_LSB) -#define IN3ENDP_VAL_SET(x) (((x) << IN3ENDP_VAL_LSB) & IN3ENDP_VAL_MASK) -#define IN3ENDP_STALL_MSB 22 -#define IN3ENDP_STALL_LSB 22 -#define IN3ENDP_STALL_MASK 0x00400000 -#define IN3ENDP_STALL_GET(x) (((x) & IN3ENDP_STALL_MASK) >> IN3ENDP_STALL_LSB) -#define IN3ENDP_STALL_SET(x) (((x) << IN3ENDP_STALL_LSB) & IN3ENDP_STALL_MASK) -#define IN3ENDP_ISOD_MSB 21 -#define IN3ENDP_ISOD_LSB 20 -#define IN3ENDP_ISOD_MASK 0x00300000 -#define IN3ENDP_ISOD_GET(x) (((x) & IN3ENDP_ISOD_MASK) >> IN3ENDP_ISOD_LSB) -#define IN3ENDP_ISOD_SET(x) (((x) << IN3ENDP_ISOD_LSB) & IN3ENDP_ISOD_MASK) -#define IN3ENDP_TYPE_MSB 19 -#define IN3ENDP_TYPE_LSB 18 -#define IN3ENDP_TYPE_MASK 0x000c0000 -#define IN3ENDP_TYPE_GET(x) (((x) & IN3ENDP_TYPE_MASK) >> IN3ENDP_TYPE_LSB) -#define IN3ENDP_TYPE_SET(x) (((x) << IN3ENDP_TYPE_LSB) & IN3ENDP_TYPE_MASK) -#define IN3ENDP_MAXP_MSB 10 -#define IN3ENDP_MAXP_LSB 0 -#define IN3ENDP_MAXP_MASK 0x000007ff -#define IN3ENDP_MAXP_GET(x) (((x) & IN3ENDP_MAXP_MASK) >> IN3ENDP_MAXP_LSB) -#define IN3ENDP_MAXP_SET(x) (((x) << IN3ENDP_MAXP_LSB) & IN3ENDP_MAXP_MASK) - -#define OUT4ENDP_ADDRESS 0x00000020 -#define OUT4ENDP_OFFSET 0x00000020 -#define OUT4ENDP_ISOERR_MSB 24 -#define OUT4ENDP_ISOERR_LSB 24 -#define OUT4ENDP_ISOERR_MASK 0x01000000 -#define OUT4ENDP_ISOERR_GET(x) (((x) & OUT4ENDP_ISOERR_MASK) >> OUT4ENDP_ISOERR_LSB) -#define OUT4ENDP_ISOERR_SET(x) (((x) << OUT4ENDP_ISOERR_LSB) & OUT4ENDP_ISOERR_MASK) -#define OUT4ENDP_VAL_MSB 23 -#define OUT4ENDP_VAL_LSB 23 -#define OUT4ENDP_VAL_MASK 0x00800000 -#define OUT4ENDP_VAL_GET(x) (((x) & OUT4ENDP_VAL_MASK) >> OUT4ENDP_VAL_LSB) -#define OUT4ENDP_VAL_SET(x) (((x) << OUT4ENDP_VAL_LSB) & OUT4ENDP_VAL_MASK) -#define OUT4ENDP_STALL_MSB 22 -#define OUT4ENDP_STALL_LSB 22 -#define OUT4ENDP_STALL_MASK 0x00400000 -#define OUT4ENDP_STALL_GET(x) (((x) & OUT4ENDP_STALL_MASK) >> OUT4ENDP_STALL_LSB) -#define OUT4ENDP_STALL_SET(x) (((x) << OUT4ENDP_STALL_LSB) & OUT4ENDP_STALL_MASK) -#define OUT4ENDP_ISOD_MSB 21 -#define OUT4ENDP_ISOD_LSB 20 -#define OUT4ENDP_ISOD_MASK 0x00300000 -#define OUT4ENDP_ISOD_GET(x) (((x) & OUT4ENDP_ISOD_MASK) >> OUT4ENDP_ISOD_LSB) -#define OUT4ENDP_ISOD_SET(x) (((x) << OUT4ENDP_ISOD_LSB) & OUT4ENDP_ISOD_MASK) -#define OUT4ENDP_TYPE_MSB 19 -#define OUT4ENDP_TYPE_LSB 18 -#define OUT4ENDP_TYPE_MASK 0x000c0000 -#define OUT4ENDP_TYPE_GET(x) (((x) & OUT4ENDP_TYPE_MASK) >> OUT4ENDP_TYPE_LSB) -#define OUT4ENDP_TYPE_SET(x) (((x) << OUT4ENDP_TYPE_LSB) & OUT4ENDP_TYPE_MASK) -#define OUT4ENDP_MAXP_MSB 10 -#define OUT4ENDP_MAXP_LSB 0 -#define OUT4ENDP_MAXP_MASK 0x000007ff -#define OUT4ENDP_MAXP_GET(x) (((x) & OUT4ENDP_MAXP_MASK) >> OUT4ENDP_MAXP_LSB) -#define OUT4ENDP_MAXP_SET(x) (((x) << OUT4ENDP_MAXP_LSB) & OUT4ENDP_MAXP_MASK) - -#define IN4ENDP_ADDRESS 0x00000024 -#define IN4ENDP_OFFSET 0x00000024 -#define IN4ENDP_HCSET_MSB 28 -#define IN4ENDP_HCSET_LSB 28 -#define IN4ENDP_HCSET_MASK 0x10000000 -#define IN4ENDP_HCSET_GET(x) (((x) & IN4ENDP_HCSET_MASK) >> IN4ENDP_HCSET_LSB) -#define IN4ENDP_HCSET_SET(x) (((x) << IN4ENDP_HCSET_LSB) & IN4ENDP_HCSET_MASK) -#define IN4ENDP_ISOERR_MSB 24 -#define IN4ENDP_ISOERR_LSB 24 -#define IN4ENDP_ISOERR_MASK 0x01000000 -#define IN4ENDP_ISOERR_GET(x) (((x) & IN4ENDP_ISOERR_MASK) >> IN4ENDP_ISOERR_LSB) -#define IN4ENDP_ISOERR_SET(x) (((x) << IN4ENDP_ISOERR_LSB) & IN4ENDP_ISOERR_MASK) -#define IN4ENDP_VAL_MSB 23 -#define IN4ENDP_VAL_LSB 23 -#define IN4ENDP_VAL_MASK 0x00800000 -#define IN4ENDP_VAL_GET(x) (((x) & IN4ENDP_VAL_MASK) >> IN4ENDP_VAL_LSB) -#define IN4ENDP_VAL_SET(x) (((x) << IN4ENDP_VAL_LSB) & IN4ENDP_VAL_MASK) -#define IN4ENDP_STALL_MSB 22 -#define IN4ENDP_STALL_LSB 22 -#define IN4ENDP_STALL_MASK 0x00400000 -#define IN4ENDP_STALL_GET(x) (((x) & IN4ENDP_STALL_MASK) >> IN4ENDP_STALL_LSB) -#define IN4ENDP_STALL_SET(x) (((x) << IN4ENDP_STALL_LSB) & IN4ENDP_STALL_MASK) -#define IN4ENDP_ISOD_MSB 21 -#define IN4ENDP_ISOD_LSB 20 -#define IN4ENDP_ISOD_MASK 0x00300000 -#define IN4ENDP_ISOD_GET(x) (((x) & IN4ENDP_ISOD_MASK) >> IN4ENDP_ISOD_LSB) -#define IN4ENDP_ISOD_SET(x) (((x) << IN4ENDP_ISOD_LSB) & IN4ENDP_ISOD_MASK) -#define IN4ENDP_TYPE_MSB 19 -#define IN4ENDP_TYPE_LSB 18 -#define IN4ENDP_TYPE_MASK 0x000c0000 -#define IN4ENDP_TYPE_GET(x) (((x) & IN4ENDP_TYPE_MASK) >> IN4ENDP_TYPE_LSB) -#define IN4ENDP_TYPE_SET(x) (((x) << IN4ENDP_TYPE_LSB) & IN4ENDP_TYPE_MASK) -#define IN4ENDP_MAXP_MSB 10 -#define IN4ENDP_MAXP_LSB 0 -#define IN4ENDP_MAXP_MASK 0x000007ff -#define IN4ENDP_MAXP_GET(x) (((x) & IN4ENDP_MAXP_MASK) >> IN4ENDP_MAXP_LSB) -#define IN4ENDP_MAXP_SET(x) (((x) << IN4ENDP_MAXP_LSB) & IN4ENDP_MAXP_MASK) - -#define OUT5ENDP_ADDRESS 0x00000028 -#define OUT5ENDP_OFFSET 0x00000028 -#define OUT5ENDP_ISOERR_MSB 24 -#define OUT5ENDP_ISOERR_LSB 24 -#define OUT5ENDP_ISOERR_MASK 0x01000000 -#define OUT5ENDP_ISOERR_GET(x) (((x) & OUT5ENDP_ISOERR_MASK) >> OUT5ENDP_ISOERR_LSB) -#define OUT5ENDP_ISOERR_SET(x) (((x) << OUT5ENDP_ISOERR_LSB) & OUT5ENDP_ISOERR_MASK) -#define OUT5ENDP_VAL_MSB 23 -#define OUT5ENDP_VAL_LSB 23 -#define OUT5ENDP_VAL_MASK 0x00800000 -#define OUT5ENDP_VAL_GET(x) (((x) & OUT5ENDP_VAL_MASK) >> OUT5ENDP_VAL_LSB) -#define OUT5ENDP_VAL_SET(x) (((x) << OUT5ENDP_VAL_LSB) & OUT5ENDP_VAL_MASK) -#define OUT5ENDP_STALL_MSB 22 -#define OUT5ENDP_STALL_LSB 22 -#define OUT5ENDP_STALL_MASK 0x00400000 -#define OUT5ENDP_STALL_GET(x) (((x) & OUT5ENDP_STALL_MASK) >> OUT5ENDP_STALL_LSB) -#define OUT5ENDP_STALL_SET(x) (((x) << OUT5ENDP_STALL_LSB) & OUT5ENDP_STALL_MASK) -#define OUT5ENDP_ISOD_MSB 21 -#define OUT5ENDP_ISOD_LSB 20 -#define OUT5ENDP_ISOD_MASK 0x00300000 -#define OUT5ENDP_ISOD_GET(x) (((x) & OUT5ENDP_ISOD_MASK) >> OUT5ENDP_ISOD_LSB) -#define OUT5ENDP_ISOD_SET(x) (((x) << OUT5ENDP_ISOD_LSB) & OUT5ENDP_ISOD_MASK) -#define OUT5ENDP_TYPE_MSB 19 -#define OUT5ENDP_TYPE_LSB 18 -#define OUT5ENDP_TYPE_MASK 0x000c0000 -#define OUT5ENDP_TYPE_GET(x) (((x) & OUT5ENDP_TYPE_MASK) >> OUT5ENDP_TYPE_LSB) -#define OUT5ENDP_TYPE_SET(x) (((x) << OUT5ENDP_TYPE_LSB) & OUT5ENDP_TYPE_MASK) -#define OUT5ENDP_MAXP_MSB 10 -#define OUT5ENDP_MAXP_LSB 0 -#define OUT5ENDP_MAXP_MASK 0x000007ff -#define OUT5ENDP_MAXP_GET(x) (((x) & OUT5ENDP_MAXP_MASK) >> OUT5ENDP_MAXP_LSB) -#define OUT5ENDP_MAXP_SET(x) (((x) << OUT5ENDP_MAXP_LSB) & OUT5ENDP_MAXP_MASK) - -#define IN5ENDP_ADDRESS 0x0000002c -#define IN5ENDP_OFFSET 0x0000002c -#define IN5ENDP_HCSET_MSB 28 -#define IN5ENDP_HCSET_LSB 28 -#define IN5ENDP_HCSET_MASK 0x10000000 -#define IN5ENDP_HCSET_GET(x) (((x) & IN5ENDP_HCSET_MASK) >> IN5ENDP_HCSET_LSB) -#define IN5ENDP_HCSET_SET(x) (((x) << IN5ENDP_HCSET_LSB) & IN5ENDP_HCSET_MASK) -#define IN5ENDP_ISOERR_MSB 24 -#define IN5ENDP_ISOERR_LSB 24 -#define IN5ENDP_ISOERR_MASK 0x01000000 -#define IN5ENDP_ISOERR_GET(x) (((x) & IN5ENDP_ISOERR_MASK) >> IN5ENDP_ISOERR_LSB) -#define IN5ENDP_ISOERR_SET(x) (((x) << IN5ENDP_ISOERR_LSB) & IN5ENDP_ISOERR_MASK) -#define IN5ENDP_VAL_MSB 23 -#define IN5ENDP_VAL_LSB 23 -#define IN5ENDP_VAL_MASK 0x00800000 -#define IN5ENDP_VAL_GET(x) (((x) & IN5ENDP_VAL_MASK) >> IN5ENDP_VAL_LSB) -#define IN5ENDP_VAL_SET(x) (((x) << IN5ENDP_VAL_LSB) & IN5ENDP_VAL_MASK) -#define IN5ENDP_STALL_MSB 22 -#define IN5ENDP_STALL_LSB 22 -#define IN5ENDP_STALL_MASK 0x00400000 -#define IN5ENDP_STALL_GET(x) (((x) & IN5ENDP_STALL_MASK) >> IN5ENDP_STALL_LSB) -#define IN5ENDP_STALL_SET(x) (((x) << IN5ENDP_STALL_LSB) & IN5ENDP_STALL_MASK) -#define IN5ENDP_ISOD_MSB 21 -#define IN5ENDP_ISOD_LSB 20 -#define IN5ENDP_ISOD_MASK 0x00300000 -#define IN5ENDP_ISOD_GET(x) (((x) & IN5ENDP_ISOD_MASK) >> IN5ENDP_ISOD_LSB) -#define IN5ENDP_ISOD_SET(x) (((x) << IN5ENDP_ISOD_LSB) & IN5ENDP_ISOD_MASK) -#define IN5ENDP_TYPE_MSB 19 -#define IN5ENDP_TYPE_LSB 18 -#define IN5ENDP_TYPE_MASK 0x000c0000 -#define IN5ENDP_TYPE_GET(x) (((x) & IN5ENDP_TYPE_MASK) >> IN5ENDP_TYPE_LSB) -#define IN5ENDP_TYPE_SET(x) (((x) << IN5ENDP_TYPE_LSB) & IN5ENDP_TYPE_MASK) -#define IN5ENDP_MAXP_MSB 10 -#define IN5ENDP_MAXP_LSB 0 -#define IN5ENDP_MAXP_MASK 0x000007ff -#define IN5ENDP_MAXP_GET(x) (((x) & IN5ENDP_MAXP_MASK) >> IN5ENDP_MAXP_LSB) -#define IN5ENDP_MAXP_SET(x) (((x) << IN5ENDP_MAXP_LSB) & IN5ENDP_MAXP_MASK) - -#define USBMODESTATUS_ADDRESS 0x0000008c -#define USBMODESTATUS_OFFSET 0x0000008c -#define USBMODESTATUS_DEVICE_MSB 5 -#define USBMODESTATUS_DEVICE_LSB 5 -#define USBMODESTATUS_DEVICE_MASK 0x00000020 -#define USBMODESTATUS_DEVICE_GET(x) (((x) & USBMODESTATUS_DEVICE_MASK) >> USBMODESTATUS_DEVICE_LSB) -#define USBMODESTATUS_DEVICE_SET(x) (((x) << USBMODESTATUS_DEVICE_LSB) & USBMODESTATUS_DEVICE_MASK) -#define USBMODESTATUS_HOST_MSB 4 -#define USBMODESTATUS_HOST_LSB 4 -#define USBMODESTATUS_HOST_MASK 0x00000010 -#define USBMODESTATUS_HOST_GET(x) (((x) & USBMODESTATUS_HOST_MASK) >> USBMODESTATUS_HOST_LSB) -#define USBMODESTATUS_HOST_SET(x) (((x) << USBMODESTATUS_HOST_LSB) & USBMODESTATUS_HOST_MASK) -#define USBMODESTATUS_HS_MSB 2 -#define USBMODESTATUS_HS_LSB 2 -#define USBMODESTATUS_HS_MASK 0x00000004 -#define USBMODESTATUS_HS_GET(x) (((x) & USBMODESTATUS_HS_MASK) >> USBMODESTATUS_HS_LSB) -#define USBMODESTATUS_HS_SET(x) (((x) << USBMODESTATUS_HS_LSB) & USBMODESTATUS_HS_MASK) -#define USBMODESTATUS_FS_MSB 1 -#define USBMODESTATUS_FS_LSB 1 -#define USBMODESTATUS_FS_MASK 0x00000002 -#define USBMODESTATUS_FS_GET(x) (((x) & USBMODESTATUS_FS_MASK) >> USBMODESTATUS_FS_LSB) -#define USBMODESTATUS_FS_SET(x) (((x) << USBMODESTATUS_FS_LSB) & USBMODESTATUS_FS_MASK) -#define USBMODESTATUS_LS_MSB 0 -#define USBMODESTATUS_LS_LSB 0 -#define USBMODESTATUS_LS_MASK 0x00000001 -#define USBMODESTATUS_LS_GET(x) (((x) & USBMODESTATUS_LS_MASK) >> USBMODESTATUS_LS_LSB) -#define USBMODESTATUS_LS_SET(x) (((x) << USBMODESTATUS_LS_LSB) & USBMODESTATUS_LS_MASK) - -#define EPIRQ_ADDRESS 0x00000188 -#define EPIRQ_OFFSET 0x00000188 -#define EPIRQ_OUTIRQ_MSB 31 -#define EPIRQ_OUTIRQ_LSB 16 -#define EPIRQ_OUTIRQ_MASK 0xffff0000 -#define EPIRQ_OUTIRQ_GET(x) (((x) & EPIRQ_OUTIRQ_MASK) >> EPIRQ_OUTIRQ_LSB) -#define EPIRQ_OUTIRQ_SET(x) (((x) << EPIRQ_OUTIRQ_LSB) & EPIRQ_OUTIRQ_MASK) -#define EPIRQ_INIRQ_MSB 15 -#define EPIRQ_INIRQ_LSB 0 -#define EPIRQ_INIRQ_MASK 0x0000ffff -#define EPIRQ_INIRQ_GET(x) (((x) & EPIRQ_INIRQ_MASK) >> EPIRQ_INIRQ_LSB) -#define EPIRQ_INIRQ_SET(x) (((x) << EPIRQ_INIRQ_LSB) & EPIRQ_INIRQ_MASK) - -#define USBIRQ_ADDRESS 0x0000018c -#define USBIRQ_OFFSET 0x0000018c -#define USBIRQ_OUTPNGIRQ_MSB 31 -#define USBIRQ_OUTPNGIRQ_LSB 16 -#define USBIRQ_OUTPNGIRQ_MASK 0xffff0000 -#define USBIRQ_OUTPNGIRQ_GET(x) (((x) & USBIRQ_OUTPNGIRQ_MASK) >> USBIRQ_OUTPNGIRQ_LSB) -#define USBIRQ_OUTPNGIRQ_SET(x) (((x) << USBIRQ_OUTPNGIRQ_LSB) & USBIRQ_OUTPNGIRQ_MASK) -#define USBIRQ_LPMIR_MSB 7 -#define USBIRQ_LPMIR_LSB 7 -#define USBIRQ_LPMIR_MASK 0x00000080 -#define USBIRQ_LPMIR_GET(x) (((x) & USBIRQ_LPMIR_MASK) >> USBIRQ_LPMIR_LSB) -#define USBIRQ_LPMIR_SET(x) (((x) << USBIRQ_LPMIR_LSB) & USBIRQ_LPMIR_MASK) -#define USBIRQ_OVERFLOWIR_MSB 6 -#define USBIRQ_OVERFLOWIR_LSB 6 -#define USBIRQ_OVERFLOWIR_MASK 0x00000040 -#define USBIRQ_OVERFLOWIR_GET(x) (((x) & USBIRQ_OVERFLOWIR_MASK) >> USBIRQ_OVERFLOWIR_LSB) -#define USBIRQ_OVERFLOWIR_SET(x) (((x) << USBIRQ_OVERFLOWIR_LSB) & USBIRQ_OVERFLOWIR_MASK) -#define USBIRQ_HSPEEDIR_MSB 5 -#define USBIRQ_HSPEEDIR_LSB 5 -#define USBIRQ_HSPEEDIR_MASK 0x00000020 -#define USBIRQ_HSPEEDIR_GET(x) (((x) & USBIRQ_HSPEEDIR_MASK) >> USBIRQ_HSPEEDIR_LSB) -#define USBIRQ_HSPEEDIR_SET(x) (((x) << USBIRQ_HSPEEDIR_LSB) & USBIRQ_HSPEEDIR_MASK) -#define USBIRQ_URESIR_MSB 4 -#define USBIRQ_URESIR_LSB 4 -#define USBIRQ_URESIR_MASK 0x00000010 -#define USBIRQ_URESIR_GET(x) (((x) & USBIRQ_URESIR_MASK) >> USBIRQ_URESIR_LSB) -#define USBIRQ_URESIR_SET(x) (((x) << USBIRQ_URESIR_LSB) & USBIRQ_URESIR_MASK) -#define USBIRQ_SUSPIR_MSB 3 -#define USBIRQ_SUSPIR_LSB 3 -#define USBIRQ_SUSPIR_MASK 0x00000008 -#define USBIRQ_SUSPIR_GET(x) (((x) & USBIRQ_SUSPIR_MASK) >> USBIRQ_SUSPIR_LSB) -#define USBIRQ_SUSPIR_SET(x) (((x) << USBIRQ_SUSPIR_LSB) & USBIRQ_SUSPIR_MASK) -#define USBIRQ_SUTOKIR_MSB 2 -#define USBIRQ_SUTOKIR_LSB 2 -#define USBIRQ_SUTOKIR_MASK 0x00000004 -#define USBIRQ_SUTOKIR_GET(x) (((x) & USBIRQ_SUTOKIR_MASK) >> USBIRQ_SUTOKIR_LSB) -#define USBIRQ_SUTOKIR_SET(x) (((x) << USBIRQ_SUTOKIR_LSB) & USBIRQ_SUTOKIR_MASK) -#define USBIRQ_SOFIR_MSB 1 -#define USBIRQ_SOFIR_LSB 1 -#define USBIRQ_SOFIR_MASK 0x00000002 -#define USBIRQ_SOFIR_GET(x) (((x) & USBIRQ_SOFIR_MASK) >> USBIRQ_SOFIR_LSB) -#define USBIRQ_SOFIR_SET(x) (((x) << USBIRQ_SOFIR_LSB) & USBIRQ_SOFIR_MASK) -#define USBIRQ_SUDAVIR_MSB 0 -#define USBIRQ_SUDAVIR_LSB 0 -#define USBIRQ_SUDAVIR_MASK 0x00000001 -#define USBIRQ_SUDAVIR_GET(x) (((x) & USBIRQ_SUDAVIR_MASK) >> USBIRQ_SUDAVIR_LSB) -#define USBIRQ_SUDAVIR_SET(x) (((x) << USBIRQ_SUDAVIR_LSB) & USBIRQ_SUDAVIR_MASK) - -#define EPIEN_ADDRESS 0x00000194 -#define EPIEN_OFFSET 0x00000194 -#define EPIEN_OUTIEN_MSB 31 -#define EPIEN_OUTIEN_LSB 16 -#define EPIEN_OUTIEN_MASK 0xffff0000 -#define EPIEN_OUTIEN_GET(x) (((x) & EPIEN_OUTIEN_MASK) >> EPIEN_OUTIEN_LSB) -#define EPIEN_OUTIEN_SET(x) (((x) << EPIEN_OUTIEN_LSB) & EPIEN_OUTIEN_MASK) -#define EPIEN_INIEN_MSB 15 -#define EPIEN_INIEN_LSB 0 -#define EPIEN_INIEN_MASK 0x0000ffff -#define EPIEN_INIEN_GET(x) (((x) & EPIEN_INIEN_MASK) >> EPIEN_INIEN_LSB) -#define EPIEN_INIEN_SET(x) (((x) << EPIEN_INIEN_LSB) & EPIEN_INIEN_MASK) - -#define PIEN_ADDRESS 0x00000198 -#define PIEN_OFFSET 0x00000198 -#define PIEN_OUTPIE_MSB 31 -#define PIEN_OUTPIE_LSB 16 -#define PIEN_OUTPIE_MASK 0xffff0000 -#define PIEN_OUTPIE_GET(x) (((x) & PIEN_OUTPIE_MASK) >> PIEN_OUTPIE_LSB) -#define PIEN_OUTPIE_SET(x) (((x) << PIEN_OUTPIE_LSB) & PIEN_OUTPIE_MASK) -#define PIEN_LPMIE_MSB 7 -#define PIEN_LPMIE_LSB 7 -#define PIEN_LPMIE_MASK 0x00000080 -#define PIEN_LPMIE_GET(x) (((x) & PIEN_LPMIE_MASK) >> PIEN_LPMIE_LSB) -#define PIEN_LPMIE_SET(x) (((x) << PIEN_LPMIE_LSB) & PIEN_LPMIE_MASK) -#define PIEN_OVERFLOIE_MSB 6 -#define PIEN_OVERFLOIE_LSB 6 -#define PIEN_OVERFLOIE_MASK 0x00000040 -#define PIEN_OVERFLOIE_GET(x) (((x) & PIEN_OVERFLOIE_MASK) >> PIEN_OVERFLOIE_LSB) -#define PIEN_OVERFLOIE_SET(x) (((x) << PIEN_OVERFLOIE_LSB) & PIEN_OVERFLOIE_MASK) -#define PIEN_HSPEEDIE_MSB 5 -#define PIEN_HSPEEDIE_LSB 5 -#define PIEN_HSPEEDIE_MASK 0x00000020 -#define PIEN_HSPEEDIE_GET(x) (((x) & PIEN_HSPEEDIE_MASK) >> PIEN_HSPEEDIE_LSB) -#define PIEN_HSPEEDIE_SET(x) (((x) << PIEN_HSPEEDIE_LSB) & PIEN_HSPEEDIE_MASK) -#define PIEN_URESIE_MSB 4 -#define PIEN_URESIE_LSB 4 -#define PIEN_URESIE_MASK 0x00000010 -#define PIEN_URESIE_GET(x) (((x) & PIEN_URESIE_MASK) >> PIEN_URESIE_LSB) -#define PIEN_URESIE_SET(x) (((x) << PIEN_URESIE_LSB) & PIEN_URESIE_MASK) -#define PIEN_SUSPIE_MSB 3 -#define PIEN_SUSPIE_LSB 3 -#define PIEN_SUSPIE_MASK 0x00000008 -#define PIEN_SUSPIE_GET(x) (((x) & PIEN_SUSPIE_MASK) >> PIEN_SUSPIE_LSB) -#define PIEN_SUSPIE_SET(x) (((x) << PIEN_SUSPIE_LSB) & PIEN_SUSPIE_MASK) -#define PIEN_SUTOKIE_MSB 2 -#define PIEN_SUTOKIE_LSB 2 -#define PIEN_SUTOKIE_MASK 0x00000004 -#define PIEN_SUTOKIE_GET(x) (((x) & PIEN_SUTOKIE_MASK) >> PIEN_SUTOKIE_LSB) -#define PIEN_SUTOKIE_SET(x) (((x) << PIEN_SUTOKIE_LSB) & PIEN_SUTOKIE_MASK) -#define PIEN_SOFIE_MSB 1 -#define PIEN_SOFIE_LSB 1 -#define PIEN_SOFIE_MASK 0x00000002 -#define PIEN_SOFIE_GET(x) (((x) & PIEN_SOFIE_MASK) >> PIEN_SOFIE_LSB) -#define PIEN_SOFIE_SET(x) (((x) << PIEN_SOFIE_LSB) & PIEN_SOFIE_MASK) -#define PIEN_SUDAVIE_MSB 0 -#define PIEN_SUDAVIE_LSB 0 -#define PIEN_SUDAVIE_MASK 0x00000001 -#define PIEN_SUDAVIE_GET(x) (((x) & PIEN_SUDAVIE_MASK) >> PIEN_SUDAVIE_LSB) -#define PIEN_SUDAVIE_SET(x) (((x) << PIEN_SUDAVIE_LSB) & PIEN_SUDAVIE_MASK) - -#define FNCTRL_ADDRESS 0x000001a4 -#define FNCTRL_OFFSET 0x000001a4 -#define FNCTRL_CLKGATE_MSB 31 -#define FNCTRL_CLKGATE_LSB 24 -#define FNCTRL_CLKGATE_MASK 0xff000000 -#define FNCTRL_CLKGATE_GET(x) (((x) & FNCTRL_CLKGATE_MASK) >> FNCTRL_CLKGATE_LSB) -#define FNCTRL_CLKGATE_SET(x) (((x) << FNCTRL_CLKGATE_LSB) & FNCTRL_CLKGATE_MASK) -#define FNCTRL_FNADDR_MSB 22 -#define FNCTRL_FNADDR_LSB 16 -#define FNCTRL_FNADDR_MASK 0x007f0000 -#define FNCTRL_FNADDR_GET(x) (((x) & FNCTRL_FNADDR_MASK) >> FNCTRL_FNADDR_LSB) -#define FNCTRL_FNADDR_SET(x) (((x) << FNCTRL_FNADDR_LSB) & FNCTRL_FNADDR_MASK) -#define FNCTRL_FRMNR1_MSB 13 -#define FNCTRL_FRMNR1_LSB 8 -#define FNCTRL_FRMNR1_MASK 0x00003f00 -#define FNCTRL_FRMNR1_GET(x) (((x) & FNCTRL_FRMNR1_MASK) >> FNCTRL_FRMNR1_LSB) -#define FNCTRL_FRMNR1_SET(x) (((x) << FNCTRL_FRMNR1_LSB) & FNCTRL_FRMNR1_MASK) -#define FNCTRL_FRMNR0_MSB 7 -#define FNCTRL_FRMNR0_LSB 3 -#define FNCTRL_FRMNR0_MASK 0x000000f8 -#define FNCTRL_FRMNR0_GET(x) (((x) & FNCTRL_FRMNR0_MASK) >> FNCTRL_FRMNR0_LSB) -#define FNCTRL_FRMNR0_SET(x) (((x) << FNCTRL_FRMNR0_LSB) & FNCTRL_FRMNR0_MASK) -#define FNCTRL_MFR_MSB 2 -#define FNCTRL_MFR_LSB 0 -#define FNCTRL_MFR_MASK 0x00000007 -#define FNCTRL_MFR_GET(x) (((x) & FNCTRL_MFR_MASK) >> FNCTRL_MFR_LSB) -#define FNCTRL_MFR_SET(x) (((x) << FNCTRL_MFR_LSB) & FNCTRL_MFR_MASK) - -#define OTGREG_ADDRESS 0x000001bc -#define OTGREG_OFFSET 0x000001bc -#define OTGREG_OTGSTATUS_ID_MSB 30 -#define OTGREG_OTGSTATUS_ID_LSB 30 -#define OTGREG_OTGSTATUS_ID_MASK 0x40000000 -#define OTGREG_OTGSTATUS_ID_GET(x) (((x) & OTGREG_OTGSTATUS_ID_MASK) >> OTGREG_OTGSTATUS_ID_LSB) -#define OTGREG_OTGSTATUS_ID_SET(x) (((x) << OTGREG_OTGSTATUS_ID_LSB) & OTGREG_OTGSTATUS_ID_MASK) -#define OTGREG_OTGSTATUS_AVBUSVAL_MSB 29 -#define OTGREG_OTGSTATUS_AVBUSVAL_LSB 29 -#define OTGREG_OTGSTATUS_AVBUSVAL_MASK 0x20000000 -#define OTGREG_OTGSTATUS_AVBUSVAL_GET(x) (((x) & OTGREG_OTGSTATUS_AVBUSVAL_MASK) >> OTGREG_OTGSTATUS_AVBUSVAL_LSB) -#define OTGREG_OTGSTATUS_AVBUSVAL_SET(x) (((x) << OTGREG_OTGSTATUS_AVBUSVAL_LSB) & OTGREG_OTGSTATUS_AVBUSVAL_MASK) -#define OTGREG_OTGSTATUS_BSESSEND_MSB 28 -#define OTGREG_OTGSTATUS_BSESSEND_LSB 28 -#define OTGREG_OTGSTATUS_BSESSEND_MASK 0x10000000 -#define OTGREG_OTGSTATUS_BSESSEND_GET(x) (((x) & OTGREG_OTGSTATUS_BSESSEND_MASK) >> OTGREG_OTGSTATUS_BSESSEND_LSB) -#define OTGREG_OTGSTATUS_BSESSEND_SET(x) (((x) << OTGREG_OTGSTATUS_BSESSEND_LSB) & OTGREG_OTGSTATUS_BSESSEND_MASK) -#define OTGREG_OTGSTATUS_ASESSVAL_MSB 27 -#define OTGREG_OTGSTATUS_ASESSVAL_LSB 27 -#define OTGREG_OTGSTATUS_ASESSVAL_MASK 0x08000000 -#define OTGREG_OTGSTATUS_ASESSVAL_GET(x) (((x) & OTGREG_OTGSTATUS_ASESSVAL_MASK) >> OTGREG_OTGSTATUS_ASESSVAL_LSB) -#define OTGREG_OTGSTATUS_ASESSVAL_SET(x) (((x) << OTGREG_OTGSTATUS_ASESSVAL_LSB) & OTGREG_OTGSTATUS_ASESSVAL_MASK) -#define OTGREG_OTGSTATUS_CONN_MSB 25 -#define OTGREG_OTGSTATUS_CONN_LSB 25 -#define OTGREG_OTGSTATUS_CONN_MASK 0x02000000 -#define OTGREG_OTGSTATUS_CONN_GET(x) (((x) & OTGREG_OTGSTATUS_CONN_MASK) >> OTGREG_OTGSTATUS_CONN_LSB) -#define OTGREG_OTGSTATUS_CONN_SET(x) (((x) << OTGREG_OTGSTATUS_CONN_LSB) & OTGREG_OTGSTATUS_CONN_MASK) -#define OTGREG_OTGSTATUS_BSE0SRP_MSB 24 -#define OTGREG_OTGSTATUS_BSE0SRP_LSB 24 -#define OTGREG_OTGSTATUS_BSE0SRP_MASK 0x01000000 -#define OTGREG_OTGSTATUS_BSE0SRP_GET(x) (((x) & OTGREG_OTGSTATUS_BSE0SRP_MASK) >> OTGREG_OTGSTATUS_BSE0SRP_LSB) -#define OTGREG_OTGSTATUS_BSE0SRP_SET(x) (((x) << OTGREG_OTGSTATUS_BSE0SRP_LSB) & OTGREG_OTGSTATUS_BSE0SRP_MASK) -#define OTGREG_OTGCTRL_FORCEBCONN_MSB 23 -#define OTGREG_OTGCTRL_FORCEBCONN_LSB 23 -#define OTGREG_OTGCTRL_FORCEBCONN_MASK 0x00800000 -#define OTGREG_OTGCTRL_FORCEBCONN_GET(x) (((x) & OTGREG_OTGCTRL_FORCEBCONN_MASK) >> OTGREG_OTGCTRL_FORCEBCONN_LSB) -#define OTGREG_OTGCTRL_FORCEBCONN_SET(x) (((x) << OTGREG_OTGCTRL_FORCEBCONN_LSB) & OTGREG_OTGCTRL_FORCEBCONN_MASK) -#define OTGREG_OTGCTRL_SRPDATDETEN_MSB 21 -#define OTGREG_OTGCTRL_SRPDATDETEN_LSB 21 -#define OTGREG_OTGCTRL_SRPDATDETEN_MASK 0x00200000 -#define OTGREG_OTGCTRL_SRPDATDETEN_GET(x) (((x) & OTGREG_OTGCTRL_SRPDATDETEN_MASK) >> OTGREG_OTGCTRL_SRPDATDETEN_LSB) -#define OTGREG_OTGCTRL_SRPDATDETEN_SET(x) (((x) << OTGREG_OTGCTRL_SRPDATDETEN_LSB) & OTGREG_OTGCTRL_SRPDATDETEN_MASK) -#define OTGREG_OTGCTRL_SRPVBUSDETEN_MSB 20 -#define OTGREG_OTGCTRL_SRPVBUSDETEN_LSB 20 -#define OTGREG_OTGCTRL_SRPVBUSDETEN_MASK 0x00100000 -#define OTGREG_OTGCTRL_SRPVBUSDETEN_GET(x) (((x) & OTGREG_OTGCTRL_SRPVBUSDETEN_MASK) >> OTGREG_OTGCTRL_SRPVBUSDETEN_LSB) -#define OTGREG_OTGCTRL_SRPVBUSDETEN_SET(x) (((x) << OTGREG_OTGCTRL_SRPVBUSDETEN_LSB) & OTGREG_OTGCTRL_SRPVBUSDETEN_MASK) -#define OTGREG_OTGCTRL_BHNPEN_MSB 19 -#define OTGREG_OTGCTRL_BHNPEN_LSB 19 -#define OTGREG_OTGCTRL_BHNPEN_MASK 0x00080000 -#define OTGREG_OTGCTRL_BHNPEN_GET(x) (((x) & OTGREG_OTGCTRL_BHNPEN_MASK) >> OTGREG_OTGCTRL_BHNPEN_LSB) -#define OTGREG_OTGCTRL_BHNPEN_SET(x) (((x) << OTGREG_OTGCTRL_BHNPEN_LSB) & OTGREG_OTGCTRL_BHNPEN_MASK) -#define OTGREG_OTGCTRL_ASETBHNPEN_MSB 18 -#define OTGREG_OTGCTRL_ASETBHNPEN_LSB 18 -#define OTGREG_OTGCTRL_ASETBHNPEN_MASK 0x00040000 -#define OTGREG_OTGCTRL_ASETBHNPEN_GET(x) (((x) & OTGREG_OTGCTRL_ASETBHNPEN_MASK) >> OTGREG_OTGCTRL_ASETBHNPEN_LSB) -#define OTGREG_OTGCTRL_ASETBHNPEN_SET(x) (((x) << OTGREG_OTGCTRL_ASETBHNPEN_LSB) & OTGREG_OTGCTRL_ASETBHNPEN_MASK) -#define OTGREG_OTGCTRL_ABUSDROP_MSB 17 -#define OTGREG_OTGCTRL_ABUSDROP_LSB 17 -#define OTGREG_OTGCTRL_ABUSDROP_MASK 0x00020000 -#define OTGREG_OTGCTRL_ABUSDROP_GET(x) (((x) & OTGREG_OTGCTRL_ABUSDROP_MASK) >> OTGREG_OTGCTRL_ABUSDROP_LSB) -#define OTGREG_OTGCTRL_ABUSDROP_SET(x) (((x) << OTGREG_OTGCTRL_ABUSDROP_LSB) & OTGREG_OTGCTRL_ABUSDROP_MASK) -#define OTGREG_OTGCTRL_BUSREQ_MSB 16 -#define OTGREG_OTGCTRL_BUSREQ_LSB 16 -#define OTGREG_OTGCTRL_BUSREQ_MASK 0x00010000 -#define OTGREG_OTGCTRL_BUSREQ_GET(x) (((x) & OTGREG_OTGCTRL_BUSREQ_MASK) >> OTGREG_OTGCTRL_BUSREQ_LSB) -#define OTGREG_OTGCTRL_BUSREQ_SET(x) (((x) << OTGREG_OTGCTRL_BUSREQ_LSB) & OTGREG_OTGCTRL_BUSREQ_MASK) -#define OTGREG_OTGSTATE_MSB 11 -#define OTGREG_OTGSTATE_LSB 8 -#define OTGREG_OTGSTATE_MASK 0x00000f00 -#define OTGREG_OTGSTATE_GET(x) (((x) & OTGREG_OTGSTATE_MASK) >> OTGREG_OTGSTATE_LSB) -#define OTGREG_OTGSTATE_SET(x) (((x) << OTGREG_OTGSTATE_LSB) & OTGREG_OTGSTATE_MASK) -#define OTGREG_OTGIRQ_PERIPHIRQ_MSB 4 -#define OTGREG_OTGIRQ_PERIPHIRQ_LSB 4 -#define OTGREG_OTGIRQ_PERIPHIRQ_MASK 0x00000010 -#define OTGREG_OTGIRQ_PERIPHIRQ_GET(x) (((x) & OTGREG_OTGIRQ_PERIPHIRQ_MASK) >> OTGREG_OTGIRQ_PERIPHIRQ_LSB) -#define OTGREG_OTGIRQ_PERIPHIRQ_SET(x) (((x) << OTGREG_OTGIRQ_PERIPHIRQ_LSB) & OTGREG_OTGIRQ_PERIPHIRQ_MASK) -#define OTGREG_OTGIRQ_VBUSERRIRQ_MSB 3 -#define OTGREG_OTGIRQ_VBUSERRIRQ_LSB 3 -#define OTGREG_OTGIRQ_VBUSERRIRQ_MASK 0x00000008 -#define OTGREG_OTGIRQ_VBUSERRIRQ_GET(x) (((x) & OTGREG_OTGIRQ_VBUSERRIRQ_MASK) >> OTGREG_OTGIRQ_VBUSERRIRQ_LSB) -#define OTGREG_OTGIRQ_VBUSERRIRQ_SET(x) (((x) << OTGREG_OTGIRQ_VBUSERRIRQ_LSB) & OTGREG_OTGIRQ_VBUSERRIRQ_MASK) -#define OTGREG_OTGIRQ_LOCSOFIRQ_MSB 2 -#define OTGREG_OTGIRQ_LOCSOFIRQ_LSB 2 -#define OTGREG_OTGIRQ_LOCSOFIRQ_MASK 0x00000004 -#define OTGREG_OTGIRQ_LOCSOFIRQ_GET(x) (((x) & OTGREG_OTGIRQ_LOCSOFIRQ_MASK) >> OTGREG_OTGIRQ_LOCSOFIRQ_LSB) -#define OTGREG_OTGIRQ_LOCSOFIRQ_SET(x) (((x) << OTGREG_OTGIRQ_LOCSOFIRQ_LSB) & OTGREG_OTGIRQ_LOCSOFIRQ_MASK) -#define OTGREG_OTGIRQ_SRPDETIRQ_MSB 1 -#define OTGREG_OTGIRQ_SRPDETIRQ_LSB 1 -#define OTGREG_OTGIRQ_SRPDETIRQ_MASK 0x00000002 -#define OTGREG_OTGIRQ_SRPDETIRQ_GET(x) (((x) & OTGREG_OTGIRQ_SRPDETIRQ_MASK) >> OTGREG_OTGIRQ_SRPDETIRQ_LSB) -#define OTGREG_OTGIRQ_SRPDETIRQ_SET(x) (((x) << OTGREG_OTGIRQ_SRPDETIRQ_LSB) & OTGREG_OTGIRQ_SRPDETIRQ_MASK) -#define OTGREG_OTGIRQ_IDLEIRQ_MSB 0 -#define OTGREG_OTGIRQ_IDLEIRQ_LSB 0 -#define OTGREG_OTGIRQ_IDLEIRQ_MASK 0x00000001 -#define OTGREG_OTGIRQ_IDLEIRQ_GET(x) (((x) & OTGREG_OTGIRQ_IDLEIRQ_MASK) >> OTGREG_OTGIRQ_IDLEIRQ_LSB) -#define OTGREG_OTGIRQ_IDLEIRQ_SET(x) (((x) << OTGREG_OTGIRQ_IDLEIRQ_LSB) & OTGREG_OTGIRQ_IDLEIRQ_MASK) - -#define DMASTART_ADDRESS 0x000001cc -#define DMASTART_OFFSET 0x000001cc -#define DMASTART_OUT15_MSB 31 -#define DMASTART_OUT15_LSB 31 -#define DMASTART_OUT15_MASK 0x80000000 -#define DMASTART_OUT15_GET(x) (((x) & DMASTART_OUT15_MASK) >> DMASTART_OUT15_LSB) -#define DMASTART_OUT15_SET(x) (((x) << DMASTART_OUT15_LSB) & DMASTART_OUT15_MASK) -#define DMASTART_OUT14_MSB 30 -#define DMASTART_OUT14_LSB 30 -#define DMASTART_OUT14_MASK 0x40000000 -#define DMASTART_OUT14_GET(x) (((x) & DMASTART_OUT14_MASK) >> DMASTART_OUT14_LSB) -#define DMASTART_OUT14_SET(x) (((x) << DMASTART_OUT14_LSB) & DMASTART_OUT14_MASK) -#define DMASTART_OUT13_MSB 29 -#define DMASTART_OUT13_LSB 29 -#define DMASTART_OUT13_MASK 0x20000000 -#define DMASTART_OUT13_GET(x) (((x) & DMASTART_OUT13_MASK) >> DMASTART_OUT13_LSB) -#define DMASTART_OUT13_SET(x) (((x) << DMASTART_OUT13_LSB) & DMASTART_OUT13_MASK) -#define DMASTART_OUT12_MSB 28 -#define DMASTART_OUT12_LSB 28 -#define DMASTART_OUT12_MASK 0x10000000 -#define DMASTART_OUT12_GET(x) (((x) & DMASTART_OUT12_MASK) >> DMASTART_OUT12_LSB) -#define DMASTART_OUT12_SET(x) (((x) << DMASTART_OUT12_LSB) & DMASTART_OUT12_MASK) -#define DMASTART_OUT11_MSB 27 -#define DMASTART_OUT11_LSB 27 -#define DMASTART_OUT11_MASK 0x08000000 -#define DMASTART_OUT11_GET(x) (((x) & DMASTART_OUT11_MASK) >> DMASTART_OUT11_LSB) -#define DMASTART_OUT11_SET(x) (((x) << DMASTART_OUT11_LSB) & DMASTART_OUT11_MASK) -#define DMASTART_OUT10_MSB 26 -#define DMASTART_OUT10_LSB 26 -#define DMASTART_OUT10_MASK 0x04000000 -#define DMASTART_OUT10_GET(x) (((x) & DMASTART_OUT10_MASK) >> DMASTART_OUT10_LSB) -#define DMASTART_OUT10_SET(x) (((x) << DMASTART_OUT10_LSB) & DMASTART_OUT10_MASK) -#define DMASTART_OUT9_MSB 25 -#define DMASTART_OUT9_LSB 25 -#define DMASTART_OUT9_MASK 0x02000000 -#define DMASTART_OUT9_GET(x) (((x) & DMASTART_OUT9_MASK) >> DMASTART_OUT9_LSB) -#define DMASTART_OUT9_SET(x) (((x) << DMASTART_OUT9_LSB) & DMASTART_OUT9_MASK) -#define DMASTART_OUT8_MSB 24 -#define DMASTART_OUT8_LSB 24 -#define DMASTART_OUT8_MASK 0x01000000 -#define DMASTART_OUT8_GET(x) (((x) & DMASTART_OUT8_MASK) >> DMASTART_OUT8_LSB) -#define DMASTART_OUT8_SET(x) (((x) << DMASTART_OUT8_LSB) & DMASTART_OUT8_MASK) -#define DMASTART_OUT7_MSB 23 -#define DMASTART_OUT7_LSB 23 -#define DMASTART_OUT7_MASK 0x00800000 -#define DMASTART_OUT7_GET(x) (((x) & DMASTART_OUT7_MASK) >> DMASTART_OUT7_LSB) -#define DMASTART_OUT7_SET(x) (((x) << DMASTART_OUT7_LSB) & DMASTART_OUT7_MASK) -#define DMASTART_OUT6_MSB 22 -#define DMASTART_OUT6_LSB 22 -#define DMASTART_OUT6_MASK 0x00400000 -#define DMASTART_OUT6_GET(x) (((x) & DMASTART_OUT6_MASK) >> DMASTART_OUT6_LSB) -#define DMASTART_OUT6_SET(x) (((x) << DMASTART_OUT6_LSB) & DMASTART_OUT6_MASK) -#define DMASTART_OUT5_MSB 21 -#define DMASTART_OUT5_LSB 21 -#define DMASTART_OUT5_MASK 0x00200000 -#define DMASTART_OUT5_GET(x) (((x) & DMASTART_OUT5_MASK) >> DMASTART_OUT5_LSB) -#define DMASTART_OUT5_SET(x) (((x) << DMASTART_OUT5_LSB) & DMASTART_OUT5_MASK) -#define DMASTART_OUT4_MSB 20 -#define DMASTART_OUT4_LSB 20 -#define DMASTART_OUT4_MASK 0x00100000 -#define DMASTART_OUT4_GET(x) (((x) & DMASTART_OUT4_MASK) >> DMASTART_OUT4_LSB) -#define DMASTART_OUT4_SET(x) (((x) << DMASTART_OUT4_LSB) & DMASTART_OUT4_MASK) -#define DMASTART_OUT3_MSB 19 -#define DMASTART_OUT3_LSB 19 -#define DMASTART_OUT3_MASK 0x00080000 -#define DMASTART_OUT3_GET(x) (((x) & DMASTART_OUT3_MASK) >> DMASTART_OUT3_LSB) -#define DMASTART_OUT3_SET(x) (((x) << DMASTART_OUT3_LSB) & DMASTART_OUT3_MASK) -#define DMASTART_OUT2_MSB 18 -#define DMASTART_OUT2_LSB 18 -#define DMASTART_OUT2_MASK 0x00040000 -#define DMASTART_OUT2_GET(x) (((x) & DMASTART_OUT2_MASK) >> DMASTART_OUT2_LSB) -#define DMASTART_OUT2_SET(x) (((x) << DMASTART_OUT2_LSB) & DMASTART_OUT2_MASK) -#define DMASTART_OUT1_MSB 17 -#define DMASTART_OUT1_LSB 17 -#define DMASTART_OUT1_MASK 0x00020000 -#define DMASTART_OUT1_GET(x) (((x) & DMASTART_OUT1_MASK) >> DMASTART_OUT1_LSB) -#define DMASTART_OUT1_SET(x) (((x) << DMASTART_OUT1_LSB) & DMASTART_OUT1_MASK) -#define DMASTART_OUT0_MSB 16 -#define DMASTART_OUT0_LSB 16 -#define DMASTART_OUT0_MASK 0x00010000 -#define DMASTART_OUT0_GET(x) (((x) & DMASTART_OUT0_MASK) >> DMASTART_OUT0_LSB) -#define DMASTART_OUT0_SET(x) (((x) << DMASTART_OUT0_LSB) & DMASTART_OUT0_MASK) -#define DMASTART_IN15_MSB 15 -#define DMASTART_IN15_LSB 15 -#define DMASTART_IN15_MASK 0x00008000 -#define DMASTART_IN15_GET(x) (((x) & DMASTART_IN15_MASK) >> DMASTART_IN15_LSB) -#define DMASTART_IN15_SET(x) (((x) << DMASTART_IN15_LSB) & DMASTART_IN15_MASK) -#define DMASTART_IN14_MSB 14 -#define DMASTART_IN14_LSB 14 -#define DMASTART_IN14_MASK 0x00004000 -#define DMASTART_IN14_GET(x) (((x) & DMASTART_IN14_MASK) >> DMASTART_IN14_LSB) -#define DMASTART_IN14_SET(x) (((x) << DMASTART_IN14_LSB) & DMASTART_IN14_MASK) -#define DMASTART_IN13_MSB 13 -#define DMASTART_IN13_LSB 13 -#define DMASTART_IN13_MASK 0x00002000 -#define DMASTART_IN13_GET(x) (((x) & DMASTART_IN13_MASK) >> DMASTART_IN13_LSB) -#define DMASTART_IN13_SET(x) (((x) << DMASTART_IN13_LSB) & DMASTART_IN13_MASK) -#define DMASTART_IN12_MSB 12 -#define DMASTART_IN12_LSB 12 -#define DMASTART_IN12_MASK 0x00001000 -#define DMASTART_IN12_GET(x) (((x) & DMASTART_IN12_MASK) >> DMASTART_IN12_LSB) -#define DMASTART_IN12_SET(x) (((x) << DMASTART_IN12_LSB) & DMASTART_IN12_MASK) -#define DMASTART_IN11_MSB 11 -#define DMASTART_IN11_LSB 11 -#define DMASTART_IN11_MASK 0x00000800 -#define DMASTART_IN11_GET(x) (((x) & DMASTART_IN11_MASK) >> DMASTART_IN11_LSB) -#define DMASTART_IN11_SET(x) (((x) << DMASTART_IN11_LSB) & DMASTART_IN11_MASK) -#define DMASTART_IN10_MSB 10 -#define DMASTART_IN10_LSB 10 -#define DMASTART_IN10_MASK 0x00000400 -#define DMASTART_IN10_GET(x) (((x) & DMASTART_IN10_MASK) >> DMASTART_IN10_LSB) -#define DMASTART_IN10_SET(x) (((x) << DMASTART_IN10_LSB) & DMASTART_IN10_MASK) -#define DMASTART_IN9_MSB 9 -#define DMASTART_IN9_LSB 9 -#define DMASTART_IN9_MASK 0x00000200 -#define DMASTART_IN9_GET(x) (((x) & DMASTART_IN9_MASK) >> DMASTART_IN9_LSB) -#define DMASTART_IN9_SET(x) (((x) << DMASTART_IN9_LSB) & DMASTART_IN9_MASK) -#define DMASTART_IN8_MSB 8 -#define DMASTART_IN8_LSB 8 -#define DMASTART_IN8_MASK 0x00000100 -#define DMASTART_IN8_GET(x) (((x) & DMASTART_IN8_MASK) >> DMASTART_IN8_LSB) -#define DMASTART_IN8_SET(x) (((x) << DMASTART_IN8_LSB) & DMASTART_IN8_MASK) -#define DMASTART_IN7_MSB 7 -#define DMASTART_IN7_LSB 7 -#define DMASTART_IN7_MASK 0x00000080 -#define DMASTART_IN7_GET(x) (((x) & DMASTART_IN7_MASK) >> DMASTART_IN7_LSB) -#define DMASTART_IN7_SET(x) (((x) << DMASTART_IN7_LSB) & DMASTART_IN7_MASK) -#define DMASTART_IN6_MSB 6 -#define DMASTART_IN6_LSB 6 -#define DMASTART_IN6_MASK 0x00000040 -#define DMASTART_IN6_GET(x) (((x) & DMASTART_IN6_MASK) >> DMASTART_IN6_LSB) -#define DMASTART_IN6_SET(x) (((x) << DMASTART_IN6_LSB) & DMASTART_IN6_MASK) -#define DMASTART_IN5_MSB 5 -#define DMASTART_IN5_LSB 5 -#define DMASTART_IN5_MASK 0x00000020 -#define DMASTART_IN5_GET(x) (((x) & DMASTART_IN5_MASK) >> DMASTART_IN5_LSB) -#define DMASTART_IN5_SET(x) (((x) << DMASTART_IN5_LSB) & DMASTART_IN5_MASK) -#define DMASTART_IN4_MSB 4 -#define DMASTART_IN4_LSB 4 -#define DMASTART_IN4_MASK 0x00000010 -#define DMASTART_IN4_GET(x) (((x) & DMASTART_IN4_MASK) >> DMASTART_IN4_LSB) -#define DMASTART_IN4_SET(x) (((x) << DMASTART_IN4_LSB) & DMASTART_IN4_MASK) -#define DMASTART_IN3_MSB 3 -#define DMASTART_IN3_LSB 3 -#define DMASTART_IN3_MASK 0x00000008 -#define DMASTART_IN3_GET(x) (((x) & DMASTART_IN3_MASK) >> DMASTART_IN3_LSB) -#define DMASTART_IN3_SET(x) (((x) << DMASTART_IN3_LSB) & DMASTART_IN3_MASK) -#define DMASTART_IN2_MSB 2 -#define DMASTART_IN2_LSB 2 -#define DMASTART_IN2_MASK 0x00000004 -#define DMASTART_IN2_GET(x) (((x) & DMASTART_IN2_MASK) >> DMASTART_IN2_LSB) -#define DMASTART_IN2_SET(x) (((x) << DMASTART_IN2_LSB) & DMASTART_IN2_MASK) -#define DMASTART_IN1_MSB 1 -#define DMASTART_IN1_LSB 1 -#define DMASTART_IN1_MASK 0x00000002 -#define DMASTART_IN1_GET(x) (((x) & DMASTART_IN1_MASK) >> DMASTART_IN1_LSB) -#define DMASTART_IN1_SET(x) (((x) << DMASTART_IN1_LSB) & DMASTART_IN1_MASK) -#define DMASTART_IN0_MSB 0 -#define DMASTART_IN0_LSB 0 -#define DMASTART_IN0_MASK 0x00000001 -#define DMASTART_IN0_GET(x) (((x) & DMASTART_IN0_MASK) >> DMASTART_IN0_LSB) -#define DMASTART_IN0_SET(x) (((x) << DMASTART_IN0_LSB) & DMASTART_IN0_MASK) - -#define DMASTOP_ADDRESS 0x000001d0 -#define DMASTOP_OFFSET 0x000001d0 -#define DMASTOP_OUT15_MSB 31 -#define DMASTOP_OUT15_LSB 31 -#define DMASTOP_OUT15_MASK 0x80000000 -#define DMASTOP_OUT15_GET(x) (((x) & DMASTOP_OUT15_MASK) >> DMASTOP_OUT15_LSB) -#define DMASTOP_OUT15_SET(x) (((x) << DMASTOP_OUT15_LSB) & DMASTOP_OUT15_MASK) -#define DMASTOP_OUT14_MSB 30 -#define DMASTOP_OUT14_LSB 30 -#define DMASTOP_OUT14_MASK 0x40000000 -#define DMASTOP_OUT14_GET(x) (((x) & DMASTOP_OUT14_MASK) >> DMASTOP_OUT14_LSB) -#define DMASTOP_OUT14_SET(x) (((x) << DMASTOP_OUT14_LSB) & DMASTOP_OUT14_MASK) -#define DMASTOP_OUT13_MSB 29 -#define DMASTOP_OUT13_LSB 29 -#define DMASTOP_OUT13_MASK 0x20000000 -#define DMASTOP_OUT13_GET(x) (((x) & DMASTOP_OUT13_MASK) >> DMASTOP_OUT13_LSB) -#define DMASTOP_OUT13_SET(x) (((x) << DMASTOP_OUT13_LSB) & DMASTOP_OUT13_MASK) -#define DMASTOP_OUT12_MSB 28 -#define DMASTOP_OUT12_LSB 28 -#define DMASTOP_OUT12_MASK 0x10000000 -#define DMASTOP_OUT12_GET(x) (((x) & DMASTOP_OUT12_MASK) >> DMASTOP_OUT12_LSB) -#define DMASTOP_OUT12_SET(x) (((x) << DMASTOP_OUT12_LSB) & DMASTOP_OUT12_MASK) -#define DMASTOP_OUT11_MSB 27 -#define DMASTOP_OUT11_LSB 27 -#define DMASTOP_OUT11_MASK 0x08000000 -#define DMASTOP_OUT11_GET(x) (((x) & DMASTOP_OUT11_MASK) >> DMASTOP_OUT11_LSB) -#define DMASTOP_OUT11_SET(x) (((x) << DMASTOP_OUT11_LSB) & DMASTOP_OUT11_MASK) -#define DMASTOP_OUT10_MSB 26 -#define DMASTOP_OUT10_LSB 26 -#define DMASTOP_OUT10_MASK 0x04000000 -#define DMASTOP_OUT10_GET(x) (((x) & DMASTOP_OUT10_MASK) >> DMASTOP_OUT10_LSB) -#define DMASTOP_OUT10_SET(x) (((x) << DMASTOP_OUT10_LSB) & DMASTOP_OUT10_MASK) -#define DMASTOP_OUT9_MSB 25 -#define DMASTOP_OUT9_LSB 25 -#define DMASTOP_OUT9_MASK 0x02000000 -#define DMASTOP_OUT9_GET(x) (((x) & DMASTOP_OUT9_MASK) >> DMASTOP_OUT9_LSB) -#define DMASTOP_OUT9_SET(x) (((x) << DMASTOP_OUT9_LSB) & DMASTOP_OUT9_MASK) -#define DMASTOP_OUT8_MSB 24 -#define DMASTOP_OUT8_LSB 24 -#define DMASTOP_OUT8_MASK 0x01000000 -#define DMASTOP_OUT8_GET(x) (((x) & DMASTOP_OUT8_MASK) >> DMASTOP_OUT8_LSB) -#define DMASTOP_OUT8_SET(x) (((x) << DMASTOP_OUT8_LSB) & DMASTOP_OUT8_MASK) -#define DMASTOP_OUT7_MSB 23 -#define DMASTOP_OUT7_LSB 23 -#define DMASTOP_OUT7_MASK 0x00800000 -#define DMASTOP_OUT7_GET(x) (((x) & DMASTOP_OUT7_MASK) >> DMASTOP_OUT7_LSB) -#define DMASTOP_OUT7_SET(x) (((x) << DMASTOP_OUT7_LSB) & DMASTOP_OUT7_MASK) -#define DMASTOP_OUT6_MSB 22 -#define DMASTOP_OUT6_LSB 22 -#define DMASTOP_OUT6_MASK 0x00400000 -#define DMASTOP_OUT6_GET(x) (((x) & DMASTOP_OUT6_MASK) >> DMASTOP_OUT6_LSB) -#define DMASTOP_OUT6_SET(x) (((x) << DMASTOP_OUT6_LSB) & DMASTOP_OUT6_MASK) -#define DMASTOP_OUT5_MSB 21 -#define DMASTOP_OUT5_LSB 21 -#define DMASTOP_OUT5_MASK 0x00200000 -#define DMASTOP_OUT5_GET(x) (((x) & DMASTOP_OUT5_MASK) >> DMASTOP_OUT5_LSB) -#define DMASTOP_OUT5_SET(x) (((x) << DMASTOP_OUT5_LSB) & DMASTOP_OUT5_MASK) -#define DMASTOP_OUT4_MSB 20 -#define DMASTOP_OUT4_LSB 20 -#define DMASTOP_OUT4_MASK 0x00100000 -#define DMASTOP_OUT4_GET(x) (((x) & DMASTOP_OUT4_MASK) >> DMASTOP_OUT4_LSB) -#define DMASTOP_OUT4_SET(x) (((x) << DMASTOP_OUT4_LSB) & DMASTOP_OUT4_MASK) -#define DMASTOP_OUT3_MSB 19 -#define DMASTOP_OUT3_LSB 19 -#define DMASTOP_OUT3_MASK 0x00080000 -#define DMASTOP_OUT3_GET(x) (((x) & DMASTOP_OUT3_MASK) >> DMASTOP_OUT3_LSB) -#define DMASTOP_OUT3_SET(x) (((x) << DMASTOP_OUT3_LSB) & DMASTOP_OUT3_MASK) -#define DMASTOP_OUT2_MSB 18 -#define DMASTOP_OUT2_LSB 18 -#define DMASTOP_OUT2_MASK 0x00040000 -#define DMASTOP_OUT2_GET(x) (((x) & DMASTOP_OUT2_MASK) >> DMASTOP_OUT2_LSB) -#define DMASTOP_OUT2_SET(x) (((x) << DMASTOP_OUT2_LSB) & DMASTOP_OUT2_MASK) -#define DMASTOP_OUT1_MSB 17 -#define DMASTOP_OUT1_LSB 17 -#define DMASTOP_OUT1_MASK 0x00020000 -#define DMASTOP_OUT1_GET(x) (((x) & DMASTOP_OUT1_MASK) >> DMASTOP_OUT1_LSB) -#define DMASTOP_OUT1_SET(x) (((x) << DMASTOP_OUT1_LSB) & DMASTOP_OUT1_MASK) -#define DMASTOP_OUT0_MSB 16 -#define DMASTOP_OUT0_LSB 16 -#define DMASTOP_OUT0_MASK 0x00010000 -#define DMASTOP_OUT0_GET(x) (((x) & DMASTOP_OUT0_MASK) >> DMASTOP_OUT0_LSB) -#define DMASTOP_OUT0_SET(x) (((x) << DMASTOP_OUT0_LSB) & DMASTOP_OUT0_MASK) -#define DMASTOP_IN15_MSB 15 -#define DMASTOP_IN15_LSB 15 -#define DMASTOP_IN15_MASK 0x00008000 -#define DMASTOP_IN15_GET(x) (((x) & DMASTOP_IN15_MASK) >> DMASTOP_IN15_LSB) -#define DMASTOP_IN15_SET(x) (((x) << DMASTOP_IN15_LSB) & DMASTOP_IN15_MASK) -#define DMASTOP_IN14_MSB 14 -#define DMASTOP_IN14_LSB 14 -#define DMASTOP_IN14_MASK 0x00004000 -#define DMASTOP_IN14_GET(x) (((x) & DMASTOP_IN14_MASK) >> DMASTOP_IN14_LSB) -#define DMASTOP_IN14_SET(x) (((x) << DMASTOP_IN14_LSB) & DMASTOP_IN14_MASK) -#define DMASTOP_IN13_MSB 13 -#define DMASTOP_IN13_LSB 13 -#define DMASTOP_IN13_MASK 0x00002000 -#define DMASTOP_IN13_GET(x) (((x) & DMASTOP_IN13_MASK) >> DMASTOP_IN13_LSB) -#define DMASTOP_IN13_SET(x) (((x) << DMASTOP_IN13_LSB) & DMASTOP_IN13_MASK) -#define DMASTOP_IN12_MSB 12 -#define DMASTOP_IN12_LSB 12 -#define DMASTOP_IN12_MASK 0x00001000 -#define DMASTOP_IN12_GET(x) (((x) & DMASTOP_IN12_MASK) >> DMASTOP_IN12_LSB) -#define DMASTOP_IN12_SET(x) (((x) << DMASTOP_IN12_LSB) & DMASTOP_IN12_MASK) -#define DMASTOP_IN11_MSB 11 -#define DMASTOP_IN11_LSB 11 -#define DMASTOP_IN11_MASK 0x00000800 -#define DMASTOP_IN11_GET(x) (((x) & DMASTOP_IN11_MASK) >> DMASTOP_IN11_LSB) -#define DMASTOP_IN11_SET(x) (((x) << DMASTOP_IN11_LSB) & DMASTOP_IN11_MASK) -#define DMASTOP_IN10_MSB 10 -#define DMASTOP_IN10_LSB 10 -#define DMASTOP_IN10_MASK 0x00000400 -#define DMASTOP_IN10_GET(x) (((x) & DMASTOP_IN10_MASK) >> DMASTOP_IN10_LSB) -#define DMASTOP_IN10_SET(x) (((x) << DMASTOP_IN10_LSB) & DMASTOP_IN10_MASK) -#define DMASTOP_IN9_MSB 9 -#define DMASTOP_IN9_LSB 9 -#define DMASTOP_IN9_MASK 0x00000200 -#define DMASTOP_IN9_GET(x) (((x) & DMASTOP_IN9_MASK) >> DMASTOP_IN9_LSB) -#define DMASTOP_IN9_SET(x) (((x) << DMASTOP_IN9_LSB) & DMASTOP_IN9_MASK) -#define DMASTOP_IN8_MSB 8 -#define DMASTOP_IN8_LSB 8 -#define DMASTOP_IN8_MASK 0x00000100 -#define DMASTOP_IN8_GET(x) (((x) & DMASTOP_IN8_MASK) >> DMASTOP_IN8_LSB) -#define DMASTOP_IN8_SET(x) (((x) << DMASTOP_IN8_LSB) & DMASTOP_IN8_MASK) -#define DMASTOP_IN7_MSB 7 -#define DMASTOP_IN7_LSB 7 -#define DMASTOP_IN7_MASK 0x00000080 -#define DMASTOP_IN7_GET(x) (((x) & DMASTOP_IN7_MASK) >> DMASTOP_IN7_LSB) -#define DMASTOP_IN7_SET(x) (((x) << DMASTOP_IN7_LSB) & DMASTOP_IN7_MASK) -#define DMASTOP_IN6_MSB 6 -#define DMASTOP_IN6_LSB 6 -#define DMASTOP_IN6_MASK 0x00000040 -#define DMASTOP_IN6_GET(x) (((x) & DMASTOP_IN6_MASK) >> DMASTOP_IN6_LSB) -#define DMASTOP_IN6_SET(x) (((x) << DMASTOP_IN6_LSB) & DMASTOP_IN6_MASK) -#define DMASTOP_IN5_MSB 5 -#define DMASTOP_IN5_LSB 5 -#define DMASTOP_IN5_MASK 0x00000020 -#define DMASTOP_IN5_GET(x) (((x) & DMASTOP_IN5_MASK) >> DMASTOP_IN5_LSB) -#define DMASTOP_IN5_SET(x) (((x) << DMASTOP_IN5_LSB) & DMASTOP_IN5_MASK) -#define DMASTOP_IN4_MSB 4 -#define DMASTOP_IN4_LSB 4 -#define DMASTOP_IN4_MASK 0x00000010 -#define DMASTOP_IN4_GET(x) (((x) & DMASTOP_IN4_MASK) >> DMASTOP_IN4_LSB) -#define DMASTOP_IN4_SET(x) (((x) << DMASTOP_IN4_LSB) & DMASTOP_IN4_MASK) -#define DMASTOP_IN3_MSB 3 -#define DMASTOP_IN3_LSB 3 -#define DMASTOP_IN3_MASK 0x00000008 -#define DMASTOP_IN3_GET(x) (((x) & DMASTOP_IN3_MASK) >> DMASTOP_IN3_LSB) -#define DMASTOP_IN3_SET(x) (((x) << DMASTOP_IN3_LSB) & DMASTOP_IN3_MASK) -#define DMASTOP_IN2_MSB 2 -#define DMASTOP_IN2_LSB 2 -#define DMASTOP_IN2_MASK 0x00000004 -#define DMASTOP_IN2_GET(x) (((x) & DMASTOP_IN2_MASK) >> DMASTOP_IN2_LSB) -#define DMASTOP_IN2_SET(x) (((x) << DMASTOP_IN2_LSB) & DMASTOP_IN2_MASK) -#define DMASTOP_IN1_MSB 1 -#define DMASTOP_IN1_LSB 1 -#define DMASTOP_IN1_MASK 0x00000002 -#define DMASTOP_IN1_GET(x) (((x) & DMASTOP_IN1_MASK) >> DMASTOP_IN1_LSB) -#define DMASTOP_IN1_SET(x) (((x) << DMASTOP_IN1_LSB) & DMASTOP_IN1_MASK) -#define DMASTOP_IN0_MSB 0 -#define DMASTOP_IN0_LSB 0 -#define DMASTOP_IN0_MASK 0x00000001 -#define DMASTOP_IN0_GET(x) (((x) & DMASTOP_IN0_MASK) >> DMASTOP_IN0_LSB) -#define DMASTOP_IN0_SET(x) (((x) << DMASTOP_IN0_LSB) & DMASTOP_IN0_MASK) - -#define EP0DMAADDR_ADDRESS 0x00000400 -#define EP0DMAADDR_OFFSET 0x00000400 -#define EP0DMAADDR_ADDR_MSB 31 -#define EP0DMAADDR_ADDR_LSB 2 -#define EP0DMAADDR_ADDR_MASK 0xfffffffc -#define EP0DMAADDR_ADDR_GET(x) (((x) & EP0DMAADDR_ADDR_MASK) >> EP0DMAADDR_ADDR_LSB) -#define EP0DMAADDR_ADDR_SET(x) (((x) << EP0DMAADDR_ADDR_LSB) & EP0DMAADDR_ADDR_MASK) - -#define EP1DMAADDR_ADDRESS 0x00000420 -#define EP1DMAADDR_OFFSET 0x00000420 -#define EP1DMAADDR_ADDR_MSB 31 -#define EP1DMAADDR_ADDR_LSB 2 -#define EP1DMAADDR_ADDR_MASK 0xfffffffc -#define EP1DMAADDR_ADDR_GET(x) (((x) & EP1DMAADDR_ADDR_MASK) >> EP1DMAADDR_ADDR_LSB) -#define EP1DMAADDR_ADDR_SET(x) (((x) << EP1DMAADDR_ADDR_LSB) & EP1DMAADDR_ADDR_MASK) - -#define OUT1DMACTRL_ADDRESS 0x0000042c -#define OUT1DMACTRL_OFFSET 0x0000042c -#define OUT1DMACTRL_HRPROT_MSB 31 -#define OUT1DMACTRL_HRPROT_LSB 28 -#define OUT1DMACTRL_HRPROT_MASK 0xf0000000 -#define OUT1DMACTRL_HRPROT_GET(x) (((x) & OUT1DMACTRL_HRPROT_MASK) >> OUT1DMACTRL_HRPROT_LSB) -#define OUT1DMACTRL_HRPROT_SET(x) (((x) << OUT1DMACTRL_HRPROT_LSB) & OUT1DMACTRL_HRPROT_MASK) -#define OUT1DMACTRL_HSIZE_MSB 27 -#define OUT1DMACTRL_HSIZE_LSB 26 -#define OUT1DMACTRL_HSIZE_MASK 0x0c000000 -#define OUT1DMACTRL_HSIZE_GET(x) (((x) & OUT1DMACTRL_HSIZE_MASK) >> OUT1DMACTRL_HSIZE_LSB) -#define OUT1DMACTRL_HSIZE_SET(x) (((x) << OUT1DMACTRL_HSIZE_LSB) & OUT1DMACTRL_HSIZE_MASK) -#define OUT1DMACTRL_HLOCK_MSB 25 -#define OUT1DMACTRL_HLOCK_LSB 25 -#define OUT1DMACTRL_HLOCK_MASK 0x02000000 -#define OUT1DMACTRL_HLOCK_GET(x) (((x) & OUT1DMACTRL_HLOCK_MASK) >> OUT1DMACTRL_HLOCK_LSB) -#define OUT1DMACTRL_HLOCK_SET(x) (((x) << OUT1DMACTRL_HLOCK_LSB) & OUT1DMACTRL_HLOCK_MASK) -#define OUT1DMACTRL_DMARING_MSB 22 -#define OUT1DMACTRL_DMARING_LSB 22 -#define OUT1DMACTRL_DMARING_MASK 0x00400000 -#define OUT1DMACTRL_DMARING_GET(x) (((x) & OUT1DMACTRL_DMARING_MASK) >> OUT1DMACTRL_DMARING_LSB) -#define OUT1DMACTRL_DMARING_SET(x) (((x) << OUT1DMACTRL_DMARING_LSB) & OUT1DMACTRL_DMARING_MASK) -#define OUT1DMACTRL_DMANINCR_MSB 21 -#define OUT1DMACTRL_DMANINCR_LSB 21 -#define OUT1DMACTRL_DMANINCR_MASK 0x00200000 -#define OUT1DMACTRL_DMANINCR_GET(x) (((x) & OUT1DMACTRL_DMANINCR_MASK) >> OUT1DMACTRL_DMANINCR_LSB) -#define OUT1DMACTRL_DMANINCR_SET(x) (((x) << OUT1DMACTRL_DMANINCR_LSB) & OUT1DMACTRL_DMANINCR_MASK) -#define OUT1DMACTRL_DMATUNLIM_MSB 20 -#define OUT1DMACTRL_DMATUNLIM_LSB 20 -#define OUT1DMACTRL_DMATUNLIM_MASK 0x00100000 -#define OUT1DMACTRL_DMATUNLIM_GET(x) (((x) & OUT1DMACTRL_DMATUNLIM_MASK) >> OUT1DMACTRL_DMATUNLIM_LSB) -#define OUT1DMACTRL_DMATUNLIM_SET(x) (((x) << OUT1DMACTRL_DMATUNLIM_LSB) & OUT1DMACTRL_DMATUNLIM_MASK) -#define OUT1DMACTRL_DMASTART_MSB 18 -#define OUT1DMACTRL_DMASTART_LSB 18 -#define OUT1DMACTRL_DMASTART_MASK 0x00040000 -#define OUT1DMACTRL_DMASTART_GET(x) (((x) & OUT1DMACTRL_DMASTART_MASK) >> OUT1DMACTRL_DMASTART_LSB) -#define OUT1DMACTRL_DMASTART_SET(x) (((x) << OUT1DMACTRL_DMASTART_LSB) & OUT1DMACTRL_DMASTART_MASK) -#define OUT1DMACTRL_DMASTOP_MSB 17 -#define OUT1DMACTRL_DMASTOP_LSB 17 -#define OUT1DMACTRL_DMASTOP_MASK 0x00020000 -#define OUT1DMACTRL_DMASTOP_GET(x) (((x) & OUT1DMACTRL_DMASTOP_MASK) >> OUT1DMACTRL_DMASTOP_LSB) -#define OUT1DMACTRL_DMASTOP_SET(x) (((x) << OUT1DMACTRL_DMASTOP_LSB) & OUT1DMACTRL_DMASTOP_MASK) -#define OUT1DMACTRL_ENDIAN_MSB 16 -#define OUT1DMACTRL_ENDIAN_LSB 16 -#define OUT1DMACTRL_ENDIAN_MASK 0x00010000 -#define OUT1DMACTRL_ENDIAN_GET(x) (((x) & OUT1DMACTRL_ENDIAN_MASK) >> OUT1DMACTRL_ENDIAN_LSB) -#define OUT1DMACTRL_ENDIAN_SET(x) (((x) << OUT1DMACTRL_ENDIAN_LSB) & OUT1DMACTRL_ENDIAN_MASK) -#define OUT1DMACTRL_RINGSIZ_MSB 15 -#define OUT1DMACTRL_RINGSIZ_LSB 2 -#define OUT1DMACTRL_RINGSIZ_MASK 0x0000fffc -#define OUT1DMACTRL_RINGSIZ_GET(x) (((x) & OUT1DMACTRL_RINGSIZ_MASK) >> OUT1DMACTRL_RINGSIZ_LSB) -#define OUT1DMACTRL_RINGSIZ_SET(x) (((x) << OUT1DMACTRL_RINGSIZ_LSB) & OUT1DMACTRL_RINGSIZ_MASK) - -#define EP2DMAADDR_ADDRESS 0x00000440 -#define EP2DMAADDR_OFFSET 0x00000440 -#define EP2DMAADDR_ADDR_MSB 31 -#define EP2DMAADDR_ADDR_LSB 2 -#define EP2DMAADDR_ADDR_MASK 0xfffffffc -#define EP2DMAADDR_ADDR_GET(x) (((x) & EP2DMAADDR_ADDR_MASK) >> EP2DMAADDR_ADDR_LSB) -#define EP2DMAADDR_ADDR_SET(x) (((x) << EP2DMAADDR_ADDR_LSB) & EP2DMAADDR_ADDR_MASK) - -#define OUT2DMACTRL_ADDRESS 0x0000044c -#define OUT2DMACTRL_OFFSET 0x0000044c -#define OUT2DMACTRL_HRPROT_MSB 31 -#define OUT2DMACTRL_HRPROT_LSB 28 -#define OUT2DMACTRL_HRPROT_MASK 0xf0000000 -#define OUT2DMACTRL_HRPROT_GET(x) (((x) & OUT2DMACTRL_HRPROT_MASK) >> OUT2DMACTRL_HRPROT_LSB) -#define OUT2DMACTRL_HRPROT_SET(x) (((x) << OUT2DMACTRL_HRPROT_LSB) & OUT2DMACTRL_HRPROT_MASK) -#define OUT2DMACTRL_HSIZE_MSB 27 -#define OUT2DMACTRL_HSIZE_LSB 26 -#define OUT2DMACTRL_HSIZE_MASK 0x0c000000 -#define OUT2DMACTRL_HSIZE_GET(x) (((x) & OUT2DMACTRL_HSIZE_MASK) >> OUT2DMACTRL_HSIZE_LSB) -#define OUT2DMACTRL_HSIZE_SET(x) (((x) << OUT2DMACTRL_HSIZE_LSB) & OUT2DMACTRL_HSIZE_MASK) -#define OUT2DMACTRL_HLOCK_MSB 25 -#define OUT2DMACTRL_HLOCK_LSB 25 -#define OUT2DMACTRL_HLOCK_MASK 0x02000000 -#define OUT2DMACTRL_HLOCK_GET(x) (((x) & OUT2DMACTRL_HLOCK_MASK) >> OUT2DMACTRL_HLOCK_LSB) -#define OUT2DMACTRL_HLOCK_SET(x) (((x) << OUT2DMACTRL_HLOCK_LSB) & OUT2DMACTRL_HLOCK_MASK) -#define OUT2DMACTRL_DMARING_MSB 22 -#define OUT2DMACTRL_DMARING_LSB 22 -#define OUT2DMACTRL_DMARING_MASK 0x00400000 -#define OUT2DMACTRL_DMARING_GET(x) (((x) & OUT2DMACTRL_DMARING_MASK) >> OUT2DMACTRL_DMARING_LSB) -#define OUT2DMACTRL_DMARING_SET(x) (((x) << OUT2DMACTRL_DMARING_LSB) & OUT2DMACTRL_DMARING_MASK) -#define OUT2DMACTRL_DMANINCR_MSB 21 -#define OUT2DMACTRL_DMANINCR_LSB 21 -#define OUT2DMACTRL_DMANINCR_MASK 0x00200000 -#define OUT2DMACTRL_DMANINCR_GET(x) (((x) & OUT2DMACTRL_DMANINCR_MASK) >> OUT2DMACTRL_DMANINCR_LSB) -#define OUT2DMACTRL_DMANINCR_SET(x) (((x) << OUT2DMACTRL_DMANINCR_LSB) & OUT2DMACTRL_DMANINCR_MASK) -#define OUT2DMACTRL_DMATUNLIM_MSB 20 -#define OUT2DMACTRL_DMATUNLIM_LSB 20 -#define OUT2DMACTRL_DMATUNLIM_MASK 0x00100000 -#define OUT2DMACTRL_DMATUNLIM_GET(x) (((x) & OUT2DMACTRL_DMATUNLIM_MASK) >> OUT2DMACTRL_DMATUNLIM_LSB) -#define OUT2DMACTRL_DMATUNLIM_SET(x) (((x) << OUT2DMACTRL_DMATUNLIM_LSB) & OUT2DMACTRL_DMATUNLIM_MASK) -#define OUT2DMACTRL_DMASTART_MSB 18 -#define OUT2DMACTRL_DMASTART_LSB 18 -#define OUT2DMACTRL_DMASTART_MASK 0x00040000 -#define OUT2DMACTRL_DMASTART_GET(x) (((x) & OUT2DMACTRL_DMASTART_MASK) >> OUT2DMACTRL_DMASTART_LSB) -#define OUT2DMACTRL_DMASTART_SET(x) (((x) << OUT2DMACTRL_DMASTART_LSB) & OUT2DMACTRL_DMASTART_MASK) -#define OUT2DMACTRL_DMASTOP_MSB 17 -#define OUT2DMACTRL_DMASTOP_LSB 17 -#define OUT2DMACTRL_DMASTOP_MASK 0x00020000 -#define OUT2DMACTRL_DMASTOP_GET(x) (((x) & OUT2DMACTRL_DMASTOP_MASK) >> OUT2DMACTRL_DMASTOP_LSB) -#define OUT2DMACTRL_DMASTOP_SET(x) (((x) << OUT2DMACTRL_DMASTOP_LSB) & OUT2DMACTRL_DMASTOP_MASK) -#define OUT2DMACTRL_ENDIAN_MSB 16 -#define OUT2DMACTRL_ENDIAN_LSB 16 -#define OUT2DMACTRL_ENDIAN_MASK 0x00010000 -#define OUT2DMACTRL_ENDIAN_GET(x) (((x) & OUT2DMACTRL_ENDIAN_MASK) >> OUT2DMACTRL_ENDIAN_LSB) -#define OUT2DMACTRL_ENDIAN_SET(x) (((x) << OUT2DMACTRL_ENDIAN_LSB) & OUT2DMACTRL_ENDIAN_MASK) -#define OUT2DMACTRL_RINGSIZ_MSB 15 -#define OUT2DMACTRL_RINGSIZ_LSB 2 -#define OUT2DMACTRL_RINGSIZ_MASK 0x0000fffc -#define OUT2DMACTRL_RINGSIZ_GET(x) (((x) & OUT2DMACTRL_RINGSIZ_MASK) >> OUT2DMACTRL_RINGSIZ_LSB) -#define OUT2DMACTRL_RINGSIZ_SET(x) (((x) << OUT2DMACTRL_RINGSIZ_LSB) & OUT2DMACTRL_RINGSIZ_MASK) - -#define EP3DMAADDR_ADDRESS 0x00000460 -#define EP3DMAADDR_OFFSET 0x00000460 -#define EP3DMAADDR_ADDR_MSB 31 -#define EP3DMAADDR_ADDR_LSB 2 -#define EP3DMAADDR_ADDR_MASK 0xfffffffc -#define EP3DMAADDR_ADDR_GET(x) (((x) & EP3DMAADDR_ADDR_MASK) >> EP3DMAADDR_ADDR_LSB) -#define EP3DMAADDR_ADDR_SET(x) (((x) << EP3DMAADDR_ADDR_LSB) & EP3DMAADDR_ADDR_MASK) - -#define OUT3DMACTRL_ADDRESS 0x0000046c -#define OUT3DMACTRL_OFFSET 0x0000046c -#define OUT3DMACTRL_HRPROT_MSB 31 -#define OUT3DMACTRL_HRPROT_LSB 28 -#define OUT3DMACTRL_HRPROT_MASK 0xf0000000 -#define OUT3DMACTRL_HRPROT_GET(x) (((x) & OUT3DMACTRL_HRPROT_MASK) >> OUT3DMACTRL_HRPROT_LSB) -#define OUT3DMACTRL_HRPROT_SET(x) (((x) << OUT3DMACTRL_HRPROT_LSB) & OUT3DMACTRL_HRPROT_MASK) -#define OUT3DMACTRL_HSIZE_MSB 27 -#define OUT3DMACTRL_HSIZE_LSB 26 -#define OUT3DMACTRL_HSIZE_MASK 0x0c000000 -#define OUT3DMACTRL_HSIZE_GET(x) (((x) & OUT3DMACTRL_HSIZE_MASK) >> OUT3DMACTRL_HSIZE_LSB) -#define OUT3DMACTRL_HSIZE_SET(x) (((x) << OUT3DMACTRL_HSIZE_LSB) & OUT3DMACTRL_HSIZE_MASK) -#define OUT3DMACTRL_HLOCK_MSB 25 -#define OUT3DMACTRL_HLOCK_LSB 25 -#define OUT3DMACTRL_HLOCK_MASK 0x02000000 -#define OUT3DMACTRL_HLOCK_GET(x) (((x) & OUT3DMACTRL_HLOCK_MASK) >> OUT3DMACTRL_HLOCK_LSB) -#define OUT3DMACTRL_HLOCK_SET(x) (((x) << OUT3DMACTRL_HLOCK_LSB) & OUT3DMACTRL_HLOCK_MASK) -#define OUT3DMACTRL_DMARING_MSB 22 -#define OUT3DMACTRL_DMARING_LSB 22 -#define OUT3DMACTRL_DMARING_MASK 0x00400000 -#define OUT3DMACTRL_DMARING_GET(x) (((x) & OUT3DMACTRL_DMARING_MASK) >> OUT3DMACTRL_DMARING_LSB) -#define OUT3DMACTRL_DMARING_SET(x) (((x) << OUT3DMACTRL_DMARING_LSB) & OUT3DMACTRL_DMARING_MASK) -#define OUT3DMACTRL_DMANINCR_MSB 21 -#define OUT3DMACTRL_DMANINCR_LSB 21 -#define OUT3DMACTRL_DMANINCR_MASK 0x00200000 -#define OUT3DMACTRL_DMANINCR_GET(x) (((x) & OUT3DMACTRL_DMANINCR_MASK) >> OUT3DMACTRL_DMANINCR_LSB) -#define OUT3DMACTRL_DMANINCR_SET(x) (((x) << OUT3DMACTRL_DMANINCR_LSB) & OUT3DMACTRL_DMANINCR_MASK) -#define OUT3DMACTRL_DMATUNLIM_MSB 20 -#define OUT3DMACTRL_DMATUNLIM_LSB 20 -#define OUT3DMACTRL_DMATUNLIM_MASK 0x00100000 -#define OUT3DMACTRL_DMATUNLIM_GET(x) (((x) & OUT3DMACTRL_DMATUNLIM_MASK) >> OUT3DMACTRL_DMATUNLIM_LSB) -#define OUT3DMACTRL_DMATUNLIM_SET(x) (((x) << OUT3DMACTRL_DMATUNLIM_LSB) & OUT3DMACTRL_DMATUNLIM_MASK) -#define OUT3DMACTRL_DMASTART_MSB 18 -#define OUT3DMACTRL_DMASTART_LSB 18 -#define OUT3DMACTRL_DMASTART_MASK 0x00040000 -#define OUT3DMACTRL_DMASTART_GET(x) (((x) & OUT3DMACTRL_DMASTART_MASK) >> OUT3DMACTRL_DMASTART_LSB) -#define OUT3DMACTRL_DMASTART_SET(x) (((x) << OUT3DMACTRL_DMASTART_LSB) & OUT3DMACTRL_DMASTART_MASK) -#define OUT3DMACTRL_DMASTOP_MSB 17 -#define OUT3DMACTRL_DMASTOP_LSB 17 -#define OUT3DMACTRL_DMASTOP_MASK 0x00020000 -#define OUT3DMACTRL_DMASTOP_GET(x) (((x) & OUT3DMACTRL_DMASTOP_MASK) >> OUT3DMACTRL_DMASTOP_LSB) -#define OUT3DMACTRL_DMASTOP_SET(x) (((x) << OUT3DMACTRL_DMASTOP_LSB) & OUT3DMACTRL_DMASTOP_MASK) -#define OUT3DMACTRL_ENDIAN_MSB 16 -#define OUT3DMACTRL_ENDIAN_LSB 16 -#define OUT3DMACTRL_ENDIAN_MASK 0x00010000 -#define OUT3DMACTRL_ENDIAN_GET(x) (((x) & OUT3DMACTRL_ENDIAN_MASK) >> OUT3DMACTRL_ENDIAN_LSB) -#define OUT3DMACTRL_ENDIAN_SET(x) (((x) << OUT3DMACTRL_ENDIAN_LSB) & OUT3DMACTRL_ENDIAN_MASK) -#define OUT3DMACTRL_RINGSIZ_MSB 15 -#define OUT3DMACTRL_RINGSIZ_LSB 2 -#define OUT3DMACTRL_RINGSIZ_MASK 0x0000fffc -#define OUT3DMACTRL_RINGSIZ_GET(x) (((x) & OUT3DMACTRL_RINGSIZ_MASK) >> OUT3DMACTRL_RINGSIZ_LSB) -#define OUT3DMACTRL_RINGSIZ_SET(x) (((x) << OUT3DMACTRL_RINGSIZ_LSB) & OUT3DMACTRL_RINGSIZ_MASK) - -#define EP4DMAADDR_ADDRESS 0x00000480 -#define EP4DMAADDR_OFFSET 0x00000480 -#define EP4DMAADDR_ADDR_MSB 31 -#define EP4DMAADDR_ADDR_LSB 2 -#define EP4DMAADDR_ADDR_MASK 0xfffffffc -#define EP4DMAADDR_ADDR_GET(x) (((x) & EP4DMAADDR_ADDR_MASK) >> EP4DMAADDR_ADDR_LSB) -#define EP4DMAADDR_ADDR_SET(x) (((x) << EP4DMAADDR_ADDR_LSB) & EP4DMAADDR_ADDR_MASK) - -#define OUT4DMACTRL_ADDRESS 0x0000048c -#define OUT4DMACTRL_OFFSET 0x0000048c -#define OUT4DMACTRL_HRPROT_MSB 31 -#define OUT4DMACTRL_HRPROT_LSB 28 -#define OUT4DMACTRL_HRPROT_MASK 0xf0000000 -#define OUT4DMACTRL_HRPROT_GET(x) (((x) & OUT4DMACTRL_HRPROT_MASK) >> OUT4DMACTRL_HRPROT_LSB) -#define OUT4DMACTRL_HRPROT_SET(x) (((x) << OUT4DMACTRL_HRPROT_LSB) & OUT4DMACTRL_HRPROT_MASK) -#define OUT4DMACTRL_HSIZE_MSB 27 -#define OUT4DMACTRL_HSIZE_LSB 26 -#define OUT4DMACTRL_HSIZE_MASK 0x0c000000 -#define OUT4DMACTRL_HSIZE_GET(x) (((x) & OUT4DMACTRL_HSIZE_MASK) >> OUT4DMACTRL_HSIZE_LSB) -#define OUT4DMACTRL_HSIZE_SET(x) (((x) << OUT4DMACTRL_HSIZE_LSB) & OUT4DMACTRL_HSIZE_MASK) -#define OUT4DMACTRL_HLOCK_MSB 25 -#define OUT4DMACTRL_HLOCK_LSB 25 -#define OUT4DMACTRL_HLOCK_MASK 0x02000000 -#define OUT4DMACTRL_HLOCK_GET(x) (((x) & OUT4DMACTRL_HLOCK_MASK) >> OUT4DMACTRL_HLOCK_LSB) -#define OUT4DMACTRL_HLOCK_SET(x) (((x) << OUT4DMACTRL_HLOCK_LSB) & OUT4DMACTRL_HLOCK_MASK) -#define OUT4DMACTRL_DMARING_MSB 22 -#define OUT4DMACTRL_DMARING_LSB 22 -#define OUT4DMACTRL_DMARING_MASK 0x00400000 -#define OUT4DMACTRL_DMARING_GET(x) (((x) & OUT4DMACTRL_DMARING_MASK) >> OUT4DMACTRL_DMARING_LSB) -#define OUT4DMACTRL_DMARING_SET(x) (((x) << OUT4DMACTRL_DMARING_LSB) & OUT4DMACTRL_DMARING_MASK) -#define OUT4DMACTRL_DMANINCR_MSB 21 -#define OUT4DMACTRL_DMANINCR_LSB 21 -#define OUT4DMACTRL_DMANINCR_MASK 0x00200000 -#define OUT4DMACTRL_DMANINCR_GET(x) (((x) & OUT4DMACTRL_DMANINCR_MASK) >> OUT4DMACTRL_DMANINCR_LSB) -#define OUT4DMACTRL_DMANINCR_SET(x) (((x) << OUT4DMACTRL_DMANINCR_LSB) & OUT4DMACTRL_DMANINCR_MASK) -#define OUT4DMACTRL_DMATUNLIM_MSB 20 -#define OUT4DMACTRL_DMATUNLIM_LSB 20 -#define OUT4DMACTRL_DMATUNLIM_MASK 0x00100000 -#define OUT4DMACTRL_DMATUNLIM_GET(x) (((x) & OUT4DMACTRL_DMATUNLIM_MASK) >> OUT4DMACTRL_DMATUNLIM_LSB) -#define OUT4DMACTRL_DMATUNLIM_SET(x) (((x) << OUT4DMACTRL_DMATUNLIM_LSB) & OUT4DMACTRL_DMATUNLIM_MASK) -#define OUT4DMACTRL_DMASTART_MSB 18 -#define OUT4DMACTRL_DMASTART_LSB 18 -#define OUT4DMACTRL_DMASTART_MASK 0x00040000 -#define OUT4DMACTRL_DMASTART_GET(x) (((x) & OUT4DMACTRL_DMASTART_MASK) >> OUT4DMACTRL_DMASTART_LSB) -#define OUT4DMACTRL_DMASTART_SET(x) (((x) << OUT4DMACTRL_DMASTART_LSB) & OUT4DMACTRL_DMASTART_MASK) -#define OUT4DMACTRL_DMASTOP_MSB 17 -#define OUT4DMACTRL_DMASTOP_LSB 17 -#define OUT4DMACTRL_DMASTOP_MASK 0x00020000 -#define OUT4DMACTRL_DMASTOP_GET(x) (((x) & OUT4DMACTRL_DMASTOP_MASK) >> OUT4DMACTRL_DMASTOP_LSB) -#define OUT4DMACTRL_DMASTOP_SET(x) (((x) << OUT4DMACTRL_DMASTOP_LSB) & OUT4DMACTRL_DMASTOP_MASK) -#define OUT4DMACTRL_ENDIAN_MSB 16 -#define OUT4DMACTRL_ENDIAN_LSB 16 -#define OUT4DMACTRL_ENDIAN_MASK 0x00010000 -#define OUT4DMACTRL_ENDIAN_GET(x) (((x) & OUT4DMACTRL_ENDIAN_MASK) >> OUT4DMACTRL_ENDIAN_LSB) -#define OUT4DMACTRL_ENDIAN_SET(x) (((x) << OUT4DMACTRL_ENDIAN_LSB) & OUT4DMACTRL_ENDIAN_MASK) -#define OUT4DMACTRL_RINGSIZ_MSB 15 -#define OUT4DMACTRL_RINGSIZ_LSB 2 -#define OUT4DMACTRL_RINGSIZ_MASK 0x0000fffc -#define OUT4DMACTRL_RINGSIZ_GET(x) (((x) & OUT4DMACTRL_RINGSIZ_MASK) >> OUT4DMACTRL_RINGSIZ_LSB) -#define OUT4DMACTRL_RINGSIZ_SET(x) (((x) << OUT4DMACTRL_RINGSIZ_LSB) & OUT4DMACTRL_RINGSIZ_MASK) - -#define EP5DMAADDR_ADDRESS 0x000004a0 -#define EP5DMAADDR_OFFSET 0x000004a0 -#define EP5DMAADDR_ADDR_MSB 31 -#define EP5DMAADDR_ADDR_LSB 2 -#define EP5DMAADDR_ADDR_MASK 0xfffffffc -#define EP5DMAADDR_ADDR_GET(x) (((x) & EP5DMAADDR_ADDR_MASK) >> EP5DMAADDR_ADDR_LSB) -#define EP5DMAADDR_ADDR_SET(x) (((x) << EP5DMAADDR_ADDR_LSB) & EP5DMAADDR_ADDR_MASK) - -#define OUT5DMACTRL_ADDRESS 0x000004ac -#define OUT5DMACTRL_OFFSET 0x000004ac -#define OUT5DMACTRL_HRPROT_MSB 31 -#define OUT5DMACTRL_HRPROT_LSB 28 -#define OUT5DMACTRL_HRPROT_MASK 0xf0000000 -#define OUT5DMACTRL_HRPROT_GET(x) (((x) & OUT5DMACTRL_HRPROT_MASK) >> OUT5DMACTRL_HRPROT_LSB) -#define OUT5DMACTRL_HRPROT_SET(x) (((x) << OUT5DMACTRL_HRPROT_LSB) & OUT5DMACTRL_HRPROT_MASK) -#define OUT5DMACTRL_HSIZE_MSB 27 -#define OUT5DMACTRL_HSIZE_LSB 26 -#define OUT5DMACTRL_HSIZE_MASK 0x0c000000 -#define OUT5DMACTRL_HSIZE_GET(x) (((x) & OUT5DMACTRL_HSIZE_MASK) >> OUT5DMACTRL_HSIZE_LSB) -#define OUT5DMACTRL_HSIZE_SET(x) (((x) << OUT5DMACTRL_HSIZE_LSB) & OUT5DMACTRL_HSIZE_MASK) -#define OUT5DMACTRL_HLOCK_MSB 25 -#define OUT5DMACTRL_HLOCK_LSB 25 -#define OUT5DMACTRL_HLOCK_MASK 0x02000000 -#define OUT5DMACTRL_HLOCK_GET(x) (((x) & OUT5DMACTRL_HLOCK_MASK) >> OUT5DMACTRL_HLOCK_LSB) -#define OUT5DMACTRL_HLOCK_SET(x) (((x) << OUT5DMACTRL_HLOCK_LSB) & OUT5DMACTRL_HLOCK_MASK) -#define OUT5DMACTRL_DMARING_MSB 22 -#define OUT5DMACTRL_DMARING_LSB 22 -#define OUT5DMACTRL_DMARING_MASK 0x00400000 -#define OUT5DMACTRL_DMARING_GET(x) (((x) & OUT5DMACTRL_DMARING_MASK) >> OUT5DMACTRL_DMARING_LSB) -#define OUT5DMACTRL_DMARING_SET(x) (((x) << OUT5DMACTRL_DMARING_LSB) & OUT5DMACTRL_DMARING_MASK) -#define OUT5DMACTRL_DMANINCR_MSB 21 -#define OUT5DMACTRL_DMANINCR_LSB 21 -#define OUT5DMACTRL_DMANINCR_MASK 0x00200000 -#define OUT5DMACTRL_DMANINCR_GET(x) (((x) & OUT5DMACTRL_DMANINCR_MASK) >> OUT5DMACTRL_DMANINCR_LSB) -#define OUT5DMACTRL_DMANINCR_SET(x) (((x) << OUT5DMACTRL_DMANINCR_LSB) & OUT5DMACTRL_DMANINCR_MASK) -#define OUT5DMACTRL_DMATUNLIM_MSB 20 -#define OUT5DMACTRL_DMATUNLIM_LSB 20 -#define OUT5DMACTRL_DMATUNLIM_MASK 0x00100000 -#define OUT5DMACTRL_DMATUNLIM_GET(x) (((x) & OUT5DMACTRL_DMATUNLIM_MASK) >> OUT5DMACTRL_DMATUNLIM_LSB) -#define OUT5DMACTRL_DMATUNLIM_SET(x) (((x) << OUT5DMACTRL_DMATUNLIM_LSB) & OUT5DMACTRL_DMATUNLIM_MASK) -#define OUT5DMACTRL_DMASTART_MSB 18 -#define OUT5DMACTRL_DMASTART_LSB 18 -#define OUT5DMACTRL_DMASTART_MASK 0x00040000 -#define OUT5DMACTRL_DMASTART_GET(x) (((x) & OUT5DMACTRL_DMASTART_MASK) >> OUT5DMACTRL_DMASTART_LSB) -#define OUT5DMACTRL_DMASTART_SET(x) (((x) << OUT5DMACTRL_DMASTART_LSB) & OUT5DMACTRL_DMASTART_MASK) -#define OUT5DMACTRL_DMASTOP_MSB 17 -#define OUT5DMACTRL_DMASTOP_LSB 17 -#define OUT5DMACTRL_DMASTOP_MASK 0x00020000 -#define OUT5DMACTRL_DMASTOP_GET(x) (((x) & OUT5DMACTRL_DMASTOP_MASK) >> OUT5DMACTRL_DMASTOP_LSB) -#define OUT5DMACTRL_DMASTOP_SET(x) (((x) << OUT5DMACTRL_DMASTOP_LSB) & OUT5DMACTRL_DMASTOP_MASK) -#define OUT5DMACTRL_ENDIAN_MSB 16 -#define OUT5DMACTRL_ENDIAN_LSB 16 -#define OUT5DMACTRL_ENDIAN_MASK 0x00010000 -#define OUT5DMACTRL_ENDIAN_GET(x) (((x) & OUT5DMACTRL_ENDIAN_MASK) >> OUT5DMACTRL_ENDIAN_LSB) -#define OUT5DMACTRL_ENDIAN_SET(x) (((x) << OUT5DMACTRL_ENDIAN_LSB) & OUT5DMACTRL_ENDIAN_MASK) -#define OUT5DMACTRL_RINGSIZ_MSB 15 -#define OUT5DMACTRL_RINGSIZ_LSB 2 -#define OUT5DMACTRL_RINGSIZ_MASK 0x0000fffc -#define OUT5DMACTRL_RINGSIZ_GET(x) (((x) & OUT5DMACTRL_RINGSIZ_MASK) >> OUT5DMACTRL_RINGSIZ_LSB) -#define OUT5DMACTRL_RINGSIZ_SET(x) (((x) << OUT5DMACTRL_RINGSIZ_LSB) & OUT5DMACTRL_RINGSIZ_MASK) - -#define USB_IP_BASE_ADDRESS 0x00084000 -#define USB_IP_BASE_OFFSET 0x00084000 - - -#ifndef __ASSEMBLER__ - -typedef struct usb_cast_reg_reg_s { - volatile unsigned int endp0; - unsigned char pad0[4]; /* pad to 0x8 */ - volatile unsigned int out1endp; - volatile unsigned int in1endp; - volatile unsigned int out2endp; - volatile unsigned int in2endp; - volatile unsigned int out3endp; - volatile unsigned int in3endp; - volatile unsigned int out4endp; - volatile unsigned int in4endp; - volatile unsigned int out5endp; - volatile unsigned int in5endp; - unsigned char pad1[92]; /* pad to 0x8c */ - volatile unsigned int usbmodestatus; - unsigned char pad2[248]; /* pad to 0x188 */ - volatile unsigned int epirq; - volatile unsigned int usbirq; - unsigned char pad3[4]; /* pad to 0x194 */ - volatile unsigned int epien; - volatile unsigned int pien; - unsigned char pad4[8]; /* pad to 0x1a4 */ - volatile unsigned int fnctrl; - unsigned char pad5[20]; /* pad to 0x1bc */ - volatile unsigned int otgreg; - unsigned char pad6[12]; /* pad to 0x1cc */ - volatile unsigned int dmastart; - volatile unsigned int dmastop; - unsigned char pad7[556]; /* pad to 0x400 */ - volatile unsigned int ep0dmaaddr; - unsigned char pad8[28]; /* pad to 0x420 */ - volatile unsigned int ep1dmaaddr; - unsigned char pad9[8]; /* pad to 0x42c */ - volatile unsigned int out1dmactrl; - unsigned char pad10[16]; /* pad to 0x440 */ - volatile unsigned int ep2dmaaddr; - unsigned char pad11[8]; /* pad to 0x44c */ - volatile unsigned int out2dmactrl; - unsigned char pad12[16]; /* pad to 0x460 */ - volatile unsigned int ep3dmaaddr; - unsigned char pad13[8]; /* pad to 0x46c */ - volatile unsigned int out3dmactrl; - unsigned char pad14[16]; /* pad to 0x480 */ - volatile unsigned int ep4dmaaddr; - unsigned char pad15[8]; /* pad to 0x48c */ - volatile unsigned int out4dmactrl; - unsigned char pad16[16]; /* pad to 0x4a0 */ - volatile unsigned int ep5dmaaddr; - unsigned char pad17[8]; /* pad to 0x4ac */ - volatile unsigned int out5dmactrl; - unsigned char pad18[539472]; /* pad to 0x84000 */ - volatile unsigned int usb_ip_base; -} usb_cast_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _USB_CAST_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wlan_coex_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wlan_coex_reg.h deleted file mode 100644 index 17c39a31464c..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wlan_coex_reg.h +++ /dev/null @@ -1,839 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _WLAN_COEX_REG_REG_H_ -#define _WLAN_COEX_REG_REG_H_ - - -/* macros for MCI_COMMAND0 */ -#define MCI_COMMAND0_ADDRESS 0x00000000 -#define MCI_COMMAND0_OFFSET 0x00000000 -#define MCI_COMMAND0_HEADER_MSB 7 -#define MCI_COMMAND0_HEADER_LSB 0 -#define MCI_COMMAND0_HEADER_MASK 0x000000ff -#define MCI_COMMAND0_HEADER_GET(x) (((x) & 0x000000ff) >> 0) -#define MCI_COMMAND0_HEADER_SET(x) (((x) << 0) & 0x000000ff) -#define MCI_COMMAND0_LEN_MSB 12 -#define MCI_COMMAND0_LEN_LSB 8 -#define MCI_COMMAND0_LEN_MASK 0x00001f00 -#define MCI_COMMAND0_LEN_GET(x) (((x) & 0x00001f00) >> 8) -#define MCI_COMMAND0_LEN_SET(x) (((x) << 8) & 0x00001f00) -#define MCI_COMMAND0_DISABLE_TIMESTAMP_MSB 13 -#define MCI_COMMAND0_DISABLE_TIMESTAMP_LSB 13 -#define MCI_COMMAND0_DISABLE_TIMESTAMP_MASK 0x00002000 -#define MCI_COMMAND0_DISABLE_TIMESTAMP_GET(x) (((x) & 0x00002000) >> 13) -#define MCI_COMMAND0_DISABLE_TIMESTAMP_SET(x) (((x) << 13) & 0x00002000) - -/* macros for MCI_COMMAND1 */ -#define MCI_COMMAND1_ADDRESS 0x00000004 -#define MCI_COMMAND1_OFFSET 0x00000004 -#define MCI_COMMAND1_ADDR_MSB 31 -#define MCI_COMMAND1_ADDR_LSB 0 -#define MCI_COMMAND1_ADDR_MASK 0xffffffff -#define MCI_COMMAND1_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define MCI_COMMAND1_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MCI_COMMAND2 */ -#define MCI_COMMAND2_ADDRESS 0x00000008 -#define MCI_COMMAND2_OFFSET 0x00000008 -#define MCI_COMMAND2_RESET_TX_MSB 0 -#define MCI_COMMAND2_RESET_TX_LSB 0 -#define MCI_COMMAND2_RESET_TX_MASK 0x00000001 -#define MCI_COMMAND2_RESET_TX_GET(x) (((x) & 0x00000001) >> 0) -#define MCI_COMMAND2_RESET_TX_SET(x) (((x) << 0) & 0x00000001) -#define MCI_COMMAND2_RESET_RX_MSB 1 -#define MCI_COMMAND2_RESET_RX_LSB 1 -#define MCI_COMMAND2_RESET_RX_MASK 0x00000002 -#define MCI_COMMAND2_RESET_RX_GET(x) (((x) & 0x00000002) >> 1) -#define MCI_COMMAND2_RESET_RX_SET(x) (((x) << 1) & 0x00000002) -#define MCI_COMMAND2_RESET_RX_NUM_CYCLES_MSB 9 -#define MCI_COMMAND2_RESET_RX_NUM_CYCLES_LSB 2 -#define MCI_COMMAND2_RESET_RX_NUM_CYCLES_MASK 0x000003fc -#define MCI_COMMAND2_RESET_RX_NUM_CYCLES_GET(x) (((x) & 0x000003fc) >> 2) -#define MCI_COMMAND2_RESET_RX_NUM_CYCLES_SET(x) (((x) << 2) & 0x000003fc) - -/* macros for MCI_RX_CTRL */ -#define MCI_RX_CTRL_ADDRESS 0x0000000c -#define MCI_RX_CTRL_OFFSET 0x0000000c -#define MCI_RX_CTRL_DISABLE_TIMESTAMP_MSB 0 -#define MCI_RX_CTRL_DISABLE_TIMESTAMP_LSB 0 -#define MCI_RX_CTRL_DISABLE_TIMESTAMP_MASK 0x00000001 -#define MCI_RX_CTRL_DISABLE_TIMESTAMP_GET(x) (((x) & 0x00000001) >> 0) -#define MCI_RX_CTRL_DISABLE_TIMESTAMP_SET(x) (((x) << 0) & 0x00000001) -#define MCI_RX_CTRL_DISABLE_MAXGAIN_RESET_MSB 1 -#define MCI_RX_CTRL_DISABLE_MAXGAIN_RESET_LSB 1 -#define MCI_RX_CTRL_DISABLE_MAXGAIN_RESET_MASK 0x00000002 -#define MCI_RX_CTRL_DISABLE_MAXGAIN_RESET_GET(x) (((x) & 0x00000002) >> 1) -#define MCI_RX_CTRL_DISABLE_MAXGAIN_RESET_SET(x) (((x) << 1) & 0x00000002) -#define MCI_RX_CTRL_DISABLE_MAXGAIN_WBTIMER_RESET_MSB 2 -#define MCI_RX_CTRL_DISABLE_MAXGAIN_WBTIMER_RESET_LSB 2 -#define MCI_RX_CTRL_DISABLE_MAXGAIN_WBTIMER_RESET_MASK 0x00000004 -#define MCI_RX_CTRL_DISABLE_MAXGAIN_WBTIMER_RESET_GET(x) (((x) & 0x00000004) >> 2) -#define MCI_RX_CTRL_DISABLE_MAXGAIN_WBTIMER_RESET_SET(x) (((x) << 2) & 0x00000004) - -/* macros for MCI_TX_CTRL */ -#define MCI_TX_CTRL_ADDRESS 0x00000010 -#define MCI_TX_CTRL_OFFSET 0x00000010 -#define MCI_TX_CTRL_CLK_DIV_MSB 1 -#define MCI_TX_CTRL_CLK_DIV_LSB 0 -#define MCI_TX_CTRL_CLK_DIV_MASK 0x00000003 -#define MCI_TX_CTRL_CLK_DIV_GET(x) (((x) & 0x00000003) >> 0) -#define MCI_TX_CTRL_CLK_DIV_SET(x) (((x) << 0) & 0x00000003) -#define MCI_TX_CTRL_DISABLE_LNA_UPDATES_MSB 2 -#define MCI_TX_CTRL_DISABLE_LNA_UPDATES_LSB 2 -#define MCI_TX_CTRL_DISABLE_LNA_UPDATES_MASK 0x00000004 -#define MCI_TX_CTRL_DISABLE_LNA_UPDATES_GET(x) (((x) & 0x00000004) >> 2) -#define MCI_TX_CTRL_DISABLE_LNA_UPDATES_SET(x) (((x) << 2) & 0x00000004) -#define MCI_TX_CTRL_GAIN_UPDATE_FREQ_MSB 23 -#define MCI_TX_CTRL_GAIN_UPDATE_FREQ_LSB 3 -#define MCI_TX_CTRL_GAIN_UPDATE_FREQ_MASK 0x00fffff8 -#define MCI_TX_CTRL_GAIN_UPDATE_FREQ_GET(x) (((x) & 0x00fffff8) >> 3) -#define MCI_TX_CTRL_GAIN_UPDATE_FREQ_SET(x) (((x) << 3) & 0x00fffff8) -#define MCI_TX_CTRL_GAIN_UPDATE_NUM_MSB 27 -#define MCI_TX_CTRL_GAIN_UPDATE_NUM_LSB 24 -#define MCI_TX_CTRL_GAIN_UPDATE_NUM_MASK 0x0f000000 -#define MCI_TX_CTRL_GAIN_UPDATE_NUM_GET(x) (((x) & 0x0f000000) >> 24) -#define MCI_TX_CTRL_GAIN_UPDATE_NUM_SET(x) (((x) << 24) & 0x0f000000) - -/* macros for MCI_MSG_ATTRIBUTES_TABLE */ -#define MCI_MSG_ATTRIBUTES_TABLE_ADDRESS 0x00000014 -#define MCI_MSG_ATTRIBUTES_TABLE_OFFSET 0x00000014 -#define MCI_MSG_ATTRIBUTES_TABLE_CHECKSUM_EN_MSB 15 -#define MCI_MSG_ATTRIBUTES_TABLE_CHECKSUM_EN_LSB 0 -#define MCI_MSG_ATTRIBUTES_TABLE_CHECKSUM_EN_MASK 0x0000ffff -#define MCI_MSG_ATTRIBUTES_TABLE_CHECKSUM_EN_GET(x) (((x) & 0x0000ffff) >> 0) -#define MCI_MSG_ATTRIBUTES_TABLE_CHECKSUM_EN_SET(x) (((x) << 0) & 0x0000ffff) -#define MCI_MSG_ATTRIBUTES_TABLE_INVALID_HDR_MSB 31 -#define MCI_MSG_ATTRIBUTES_TABLE_INVALID_HDR_LSB 16 -#define MCI_MSG_ATTRIBUTES_TABLE_INVALID_HDR_MASK 0xffff0000 -#define MCI_MSG_ATTRIBUTES_TABLE_INVALID_HDR_GET(x) (((x) & 0xffff0000) >> 16) -#define MCI_MSG_ATTRIBUTES_TABLE_INVALID_HDR_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MCI_SCHD_TABLE_0 */ -#define MCI_SCHD_TABLE_0_ADDRESS 0x00000018 -#define MCI_SCHD_TABLE_0_OFFSET 0x00000018 -#define MCI_SCHD_TABLE_0_BASE_ADDR_MSB 31 -#define MCI_SCHD_TABLE_0_BASE_ADDR_LSB 0 -#define MCI_SCHD_TABLE_0_BASE_ADDR_MASK 0xffffffff -#define MCI_SCHD_TABLE_0_BASE_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define MCI_SCHD_TABLE_0_BASE_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MCI_SCHD_TABLE_1 */ -#define MCI_SCHD_TABLE_1_ADDRESS 0x0000001c -#define MCI_SCHD_TABLE_1_OFFSET 0x0000001c -#define MCI_SCHD_TABLE_1_OWN_MSB 15 -#define MCI_SCHD_TABLE_1_OWN_LSB 0 -#define MCI_SCHD_TABLE_1_OWN_MASK 0x0000ffff -#define MCI_SCHD_TABLE_1_OWN_GET(x) (((x) & 0x0000ffff) >> 0) -#define MCI_SCHD_TABLE_1_OWN_SET(x) (((x) << 0) & 0x0000ffff) -#define MCI_SCHD_TABLE_1_SW_REQ_OWN_MSB 31 -#define MCI_SCHD_TABLE_1_SW_REQ_OWN_LSB 16 -#define MCI_SCHD_TABLE_1_SW_REQ_OWN_MASK 0xffff0000 -#define MCI_SCHD_TABLE_1_SW_REQ_OWN_GET(x) (((x) & 0xffff0000) >> 16) -#define MCI_SCHD_TABLE_1_SW_REQ_OWN_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MCI_GPM_0 */ -#define MCI_GPM_0_ADDRESS 0x00000020 -#define MCI_GPM_0_OFFSET 0x00000020 -#define MCI_GPM_0_START_ADDR_MSB 31 -#define MCI_GPM_0_START_ADDR_LSB 0 -#define MCI_GPM_0_START_ADDR_MASK 0xffffffff -#define MCI_GPM_0_START_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define MCI_GPM_0_START_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MCI_GPM_1 */ -#define MCI_GPM_1_ADDRESS 0x00000024 -#define MCI_GPM_1_OFFSET 0x00000024 -#define MCI_GPM_1_LEN_MSB 15 -#define MCI_GPM_1_LEN_LSB 0 -#define MCI_GPM_1_LEN_MASK 0x0000ffff -#define MCI_GPM_1_LEN_GET(x) (((x) & 0x0000ffff) >> 0) -#define MCI_GPM_1_LEN_SET(x) (((x) << 0) & 0x0000ffff) -#define MCI_GPM_1_WRITE_PTR_MSB 31 -#define MCI_GPM_1_WRITE_PTR_LSB 16 -#define MCI_GPM_1_WRITE_PTR_MASK 0xffff0000 -#define MCI_GPM_1_WRITE_PTR_GET(x) (((x) & 0xffff0000) >> 16) - -/* macros for MCI_INTERRUPT_RAW */ -#define MCI_INTERRUPT_RAW_ADDRESS 0x00000028 -#define MCI_INTERRUPT_RAW_OFFSET 0x00000028 -#define MCI_INTERRUPT_RAW_SW_MSG_DONE_MSB 0 -#define MCI_INTERRUPT_RAW_SW_MSG_DONE_LSB 0 -#define MCI_INTERRUPT_RAW_SW_MSG_DONE_MASK 0x00000001 -#define MCI_INTERRUPT_RAW_SW_MSG_DONE_GET(x) (((x) & 0x00000001) >> 0) -#define MCI_INTERRUPT_RAW_SW_MSG_DONE_SET(x) (((x) << 0) & 0x00000001) -#define MCI_INTERRUPT_RAW_CPU_INT_MSG_MSB 1 -#define MCI_INTERRUPT_RAW_CPU_INT_MSG_LSB 1 -#define MCI_INTERRUPT_RAW_CPU_INT_MSG_MASK 0x00000002 -#define MCI_INTERRUPT_RAW_CPU_INT_MSG_GET(x) (((x) & 0x00000002) >> 1) -#define MCI_INTERRUPT_RAW_CPU_INT_MSG_SET(x) (((x) << 1) & 0x00000002) -#define MCI_INTERRUPT_RAW_RX_CKSUM_FAIL_MSB 2 -#define MCI_INTERRUPT_RAW_RX_CKSUM_FAIL_LSB 2 -#define MCI_INTERRUPT_RAW_RX_CKSUM_FAIL_MASK 0x00000004 -#define MCI_INTERRUPT_RAW_RX_CKSUM_FAIL_GET(x) (((x) & 0x00000004) >> 2) -#define MCI_INTERRUPT_RAW_RX_CKSUM_FAIL_SET(x) (((x) << 2) & 0x00000004) -#define MCI_INTERRUPT_RAW_RX_INVALID_HDR_MSB 3 -#define MCI_INTERRUPT_RAW_RX_INVALID_HDR_LSB 3 -#define MCI_INTERRUPT_RAW_RX_INVALID_HDR_MASK 0x00000008 -#define MCI_INTERRUPT_RAW_RX_INVALID_HDR_GET(x) (((x) & 0x00000008) >> 3) -#define MCI_INTERRUPT_RAW_RX_INVALID_HDR_SET(x) (((x) << 3) & 0x00000008) -#define MCI_INTERRUPT_RAW_RX_HW_MSG_FAIL_MSB 4 -#define MCI_INTERRUPT_RAW_RX_HW_MSG_FAIL_LSB 4 -#define MCI_INTERRUPT_RAW_RX_HW_MSG_FAIL_MASK 0x00000010 -#define MCI_INTERRUPT_RAW_RX_HW_MSG_FAIL_GET(x) (((x) & 0x00000010) >> 4) -#define MCI_INTERRUPT_RAW_RX_HW_MSG_FAIL_SET(x) (((x) << 4) & 0x00000010) -#define MCI_INTERRUPT_RAW_RX_SW_MSG_FAIL_MSB 5 -#define MCI_INTERRUPT_RAW_RX_SW_MSG_FAIL_LSB 5 -#define MCI_INTERRUPT_RAW_RX_SW_MSG_FAIL_MASK 0x00000020 -#define MCI_INTERRUPT_RAW_RX_SW_MSG_FAIL_GET(x) (((x) & 0x00000020) >> 5) -#define MCI_INTERRUPT_RAW_RX_SW_MSG_FAIL_SET(x) (((x) << 5) & 0x00000020) -#define MCI_INTERRUPT_RAW_TX_HW_MSG_FAIL_MSB 7 -#define MCI_INTERRUPT_RAW_TX_HW_MSG_FAIL_LSB 7 -#define MCI_INTERRUPT_RAW_TX_HW_MSG_FAIL_MASK 0x00000080 -#define MCI_INTERRUPT_RAW_TX_HW_MSG_FAIL_GET(x) (((x) & 0x00000080) >> 7) -#define MCI_INTERRUPT_RAW_TX_HW_MSG_FAIL_SET(x) (((x) << 7) & 0x00000080) -#define MCI_INTERRUPT_RAW_TX_SW_MSG_FAIL_MSB 8 -#define MCI_INTERRUPT_RAW_TX_SW_MSG_FAIL_LSB 8 -#define MCI_INTERRUPT_RAW_TX_SW_MSG_FAIL_MASK 0x00000100 -#define MCI_INTERRUPT_RAW_TX_SW_MSG_FAIL_GET(x) (((x) & 0x00000100) >> 8) -#define MCI_INTERRUPT_RAW_TX_SW_MSG_FAIL_SET(x) (((x) << 8) & 0x00000100) -#define MCI_INTERRUPT_RAW_RX_MSG_MSB 9 -#define MCI_INTERRUPT_RAW_RX_MSG_LSB 9 -#define MCI_INTERRUPT_RAW_RX_MSG_MASK 0x00000200 -#define MCI_INTERRUPT_RAW_RX_MSG_GET(x) (((x) & 0x00000200) >> 9) -#define MCI_INTERRUPT_RAW_RX_MSG_SET(x) (((x) << 9) & 0x00000200) -#define MCI_INTERRUPT_RAW_REMOTE_SLEEP_UPDATE_MSB 10 -#define MCI_INTERRUPT_RAW_REMOTE_SLEEP_UPDATE_LSB 10 -#define MCI_INTERRUPT_RAW_REMOTE_SLEEP_UPDATE_MASK 0x00000400 -#define MCI_INTERRUPT_RAW_REMOTE_SLEEP_UPDATE_GET(x) (((x) & 0x00000400) >> 10) -#define MCI_INTERRUPT_RAW_REMOTE_SLEEP_UPDATE_SET(x) (((x) << 10) & 0x00000400) -#define MCI_INTERRUPT_RAW_BT_PRI_MSB 26 -#define MCI_INTERRUPT_RAW_BT_PRI_LSB 11 -#define MCI_INTERRUPT_RAW_BT_PRI_MASK 0x07fff800 -#define MCI_INTERRUPT_RAW_BT_PRI_GET(x) (((x) & 0x07fff800) >> 11) -#define MCI_INTERRUPT_RAW_BT_PRI_SET(x) (((x) << 11) & 0x07fff800) -#define MCI_INTERRUPT_RAW_BT_PRI_THRESH_MSB 27 -#define MCI_INTERRUPT_RAW_BT_PRI_THRESH_LSB 27 -#define MCI_INTERRUPT_RAW_BT_PRI_THRESH_MASK 0x08000000 -#define MCI_INTERRUPT_RAW_BT_PRI_THRESH_GET(x) (((x) & 0x08000000) >> 27) -#define MCI_INTERRUPT_RAW_BT_PRI_THRESH_SET(x) (((x) << 27) & 0x08000000) -#define MCI_INTERRUPT_RAW_BT_FREQ_MSB 28 -#define MCI_INTERRUPT_RAW_BT_FREQ_LSB 28 -#define MCI_INTERRUPT_RAW_BT_FREQ_MASK 0x10000000 -#define MCI_INTERRUPT_RAW_BT_FREQ_GET(x) (((x) & 0x10000000) >> 28) -#define MCI_INTERRUPT_RAW_BT_FREQ_SET(x) (((x) << 28) & 0x10000000) -#define MCI_INTERRUPT_RAW_BT_STOMP_MSB 29 -#define MCI_INTERRUPT_RAW_BT_STOMP_LSB 29 -#define MCI_INTERRUPT_RAW_BT_STOMP_MASK 0x20000000 -#define MCI_INTERRUPT_RAW_BT_STOMP_GET(x) (((x) & 0x20000000) >> 29) -#define MCI_INTERRUPT_RAW_BT_STOMP_SET(x) (((x) << 29) & 0x20000000) - -/* macros for MCI_INTERRUPT_EN */ -#define MCI_INTERRUPT_EN_ADDRESS 0x0000002c -#define MCI_INTERRUPT_EN_OFFSET 0x0000002c -#define MCI_INTERRUPT_EN_SW_MSG_DONE_MSB 0 -#define MCI_INTERRUPT_EN_SW_MSG_DONE_LSB 0 -#define MCI_INTERRUPT_EN_SW_MSG_DONE_MASK 0x00000001 -#define MCI_INTERRUPT_EN_SW_MSG_DONE_GET(x) (((x) & 0x00000001) >> 0) -#define MCI_INTERRUPT_EN_SW_MSG_DONE_SET(x) (((x) << 0) & 0x00000001) -#define MCI_INTERRUPT_EN_CPU_INT_MSG_MSB 1 -#define MCI_INTERRUPT_EN_CPU_INT_MSG_LSB 1 -#define MCI_INTERRUPT_EN_CPU_INT_MSG_MASK 0x00000002 -#define MCI_INTERRUPT_EN_CPU_INT_MSG_GET(x) (((x) & 0x00000002) >> 1) -#define MCI_INTERRUPT_EN_CPU_INT_MSG_SET(x) (((x) << 1) & 0x00000002) -#define MCI_INTERRUPT_EN_RX_CKSUM_FAIL_MSB 2 -#define MCI_INTERRUPT_EN_RX_CKSUM_FAIL_LSB 2 -#define MCI_INTERRUPT_EN_RX_CKSUM_FAIL_MASK 0x00000004 -#define MCI_INTERRUPT_EN_RX_CKSUM_FAIL_GET(x) (((x) & 0x00000004) >> 2) -#define MCI_INTERRUPT_EN_RX_CKSUM_FAIL_SET(x) (((x) << 2) & 0x00000004) -#define MCI_INTERRUPT_EN_RX_INVALID_HDR_MSB 3 -#define MCI_INTERRUPT_EN_RX_INVALID_HDR_LSB 3 -#define MCI_INTERRUPT_EN_RX_INVALID_HDR_MASK 0x00000008 -#define MCI_INTERRUPT_EN_RX_INVALID_HDR_GET(x) (((x) & 0x00000008) >> 3) -#define MCI_INTERRUPT_EN_RX_INVALID_HDR_SET(x) (((x) << 3) & 0x00000008) -#define MCI_INTERRUPT_EN_RX_HW_MSG_FAIL_MSB 4 -#define MCI_INTERRUPT_EN_RX_HW_MSG_FAIL_LSB 4 -#define MCI_INTERRUPT_EN_RX_HW_MSG_FAIL_MASK 0x00000010 -#define MCI_INTERRUPT_EN_RX_HW_MSG_FAIL_GET(x) (((x) & 0x00000010) >> 4) -#define MCI_INTERRUPT_EN_RX_HW_MSG_FAIL_SET(x) (((x) << 4) & 0x00000010) -#define MCI_INTERRUPT_EN_RX_SW_MSG_FAIL_MSB 5 -#define MCI_INTERRUPT_EN_RX_SW_MSG_FAIL_LSB 5 -#define MCI_INTERRUPT_EN_RX_SW_MSG_FAIL_MASK 0x00000020 -#define MCI_INTERRUPT_EN_RX_SW_MSG_FAIL_GET(x) (((x) & 0x00000020) >> 5) -#define MCI_INTERRUPT_EN_RX_SW_MSG_FAIL_SET(x) (((x) << 5) & 0x00000020) -#define MCI_INTERRUPT_EN_TX_HW_MSG_FAIL_MSB 7 -#define MCI_INTERRUPT_EN_TX_HW_MSG_FAIL_LSB 7 -#define MCI_INTERRUPT_EN_TX_HW_MSG_FAIL_MASK 0x00000080 -#define MCI_INTERRUPT_EN_TX_HW_MSG_FAIL_GET(x) (((x) & 0x00000080) >> 7) -#define MCI_INTERRUPT_EN_TX_HW_MSG_FAIL_SET(x) (((x) << 7) & 0x00000080) -#define MCI_INTERRUPT_EN_TX_SW_MSG_FAIL_MSB 8 -#define MCI_INTERRUPT_EN_TX_SW_MSG_FAIL_LSB 8 -#define MCI_INTERRUPT_EN_TX_SW_MSG_FAIL_MASK 0x00000100 -#define MCI_INTERRUPT_EN_TX_SW_MSG_FAIL_GET(x) (((x) & 0x00000100) >> 8) -#define MCI_INTERRUPT_EN_TX_SW_MSG_FAIL_SET(x) (((x) << 8) & 0x00000100) -#define MCI_INTERRUPT_EN_RX_MSG_MSB 9 -#define MCI_INTERRUPT_EN_RX_MSG_LSB 9 -#define MCI_INTERRUPT_EN_RX_MSG_MASK 0x00000200 -#define MCI_INTERRUPT_EN_RX_MSG_GET(x) (((x) & 0x00000200) >> 9) -#define MCI_INTERRUPT_EN_RX_MSG_SET(x) (((x) << 9) & 0x00000200) -#define MCI_INTERRUPT_EN_REMOTE_SLEEP_UPDATE_MSB 10 -#define MCI_INTERRUPT_EN_REMOTE_SLEEP_UPDATE_LSB 10 -#define MCI_INTERRUPT_EN_REMOTE_SLEEP_UPDATE_MASK 0x00000400 -#define MCI_INTERRUPT_EN_REMOTE_SLEEP_UPDATE_GET(x) (((x) & 0x00000400) >> 10) -#define MCI_INTERRUPT_EN_REMOTE_SLEEP_UPDATE_SET(x) (((x) << 10) & 0x00000400) -#define MCI_INTERRUPT_EN_BT_PRI_MSB 26 -#define MCI_INTERRUPT_EN_BT_PRI_LSB 11 -#define MCI_INTERRUPT_EN_BT_PRI_MASK 0x07fff800 -#define MCI_INTERRUPT_EN_BT_PRI_GET(x) (((x) & 0x07fff800) >> 11) -#define MCI_INTERRUPT_EN_BT_PRI_SET(x) (((x) << 11) & 0x07fff800) -#define MCI_INTERRUPT_EN_BT_PRI_THRESH_MSB 27 -#define MCI_INTERRUPT_EN_BT_PRI_THRESH_LSB 27 -#define MCI_INTERRUPT_EN_BT_PRI_THRESH_MASK 0x08000000 -#define MCI_INTERRUPT_EN_BT_PRI_THRESH_GET(x) (((x) & 0x08000000) >> 27) -#define MCI_INTERRUPT_EN_BT_PRI_THRESH_SET(x) (((x) << 27) & 0x08000000) -#define MCI_INTERRUPT_EN_BT_FREQ_MSB 28 -#define MCI_INTERRUPT_EN_BT_FREQ_LSB 28 -#define MCI_INTERRUPT_EN_BT_FREQ_MASK 0x10000000 -#define MCI_INTERRUPT_EN_BT_FREQ_GET(x) (((x) & 0x10000000) >> 28) -#define MCI_INTERRUPT_EN_BT_FREQ_SET(x) (((x) << 28) & 0x10000000) -#define MCI_INTERRUPT_EN_BT_STOMP_MSB 29 -#define MCI_INTERRUPT_EN_BT_STOMP_LSB 29 -#define MCI_INTERRUPT_EN_BT_STOMP_MASK 0x20000000 -#define MCI_INTERRUPT_EN_BT_STOMP_GET(x) (((x) & 0x20000000) >> 29) -#define MCI_INTERRUPT_EN_BT_STOMP_SET(x) (((x) << 29) & 0x20000000) - -/* macros for MCI_REMOTE_CPU_INT */ -#define MCI_REMOTE_CPU_INT_ADDRESS 0x00000030 -#define MCI_REMOTE_CPU_INT_OFFSET 0x00000030 -#define MCI_REMOTE_CPU_INT_BODY_MSB 31 -#define MCI_REMOTE_CPU_INT_BODY_LSB 0 -#define MCI_REMOTE_CPU_INT_BODY_MASK 0xffffffff -#define MCI_REMOTE_CPU_INT_BODY_GET(x) (((x) & 0xffffffff) >> 0) -#define MCI_REMOTE_CPU_INT_BODY_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MCI_REMOTE_CPU_INT_EN */ -#define MCI_REMOTE_CPU_INT_EN_ADDRESS 0x00000034 -#define MCI_REMOTE_CPU_INT_EN_OFFSET 0x00000034 -#define MCI_REMOTE_CPU_INT_EN_BODY_MSB 31 -#define MCI_REMOTE_CPU_INT_EN_BODY_LSB 0 -#define MCI_REMOTE_CPU_INT_EN_BODY_MASK 0xffffffff -#define MCI_REMOTE_CPU_INT_EN_BODY_GET(x) (((x) & 0xffffffff) >> 0) -#define MCI_REMOTE_CPU_INT_EN_BODY_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MCI_INTERRUPT_RX_MSG_RAW */ -#define MCI_INTERRUPT_RX_MSG_RAW_ADDRESS 0x00000038 -#define MCI_INTERRUPT_RX_MSG_RAW_OFFSET 0x00000038 -#define MCI_INTERRUPT_RX_MSG_RAW_REMOTE_RESET_MSB 0 -#define MCI_INTERRUPT_RX_MSG_RAW_REMOTE_RESET_LSB 0 -#define MCI_INTERRUPT_RX_MSG_RAW_REMOTE_RESET_MASK 0x00000001 -#define MCI_INTERRUPT_RX_MSG_RAW_REMOTE_RESET_GET(x) (((x) & 0x00000001) >> 0) -#define MCI_INTERRUPT_RX_MSG_RAW_REMOTE_RESET_SET(x) (((x) << 0) & 0x00000001) -#define MCI_INTERRUPT_RX_MSG_RAW_LNA_CTRL_MSB 1 -#define MCI_INTERRUPT_RX_MSG_RAW_LNA_CTRL_LSB 1 -#define MCI_INTERRUPT_RX_MSG_RAW_LNA_CTRL_MASK 0x00000002 -#define MCI_INTERRUPT_RX_MSG_RAW_LNA_CTRL_GET(x) (((x) & 0x00000002) >> 1) -#define MCI_INTERRUPT_RX_MSG_RAW_LNA_CTRL_SET(x) (((x) << 1) & 0x00000002) -#define MCI_INTERRUPT_RX_MSG_RAW_CONT_NACK_MSB 2 -#define MCI_INTERRUPT_RX_MSG_RAW_CONT_NACK_LSB 2 -#define MCI_INTERRUPT_RX_MSG_RAW_CONT_NACK_MASK 0x00000004 -#define MCI_INTERRUPT_RX_MSG_RAW_CONT_NACK_GET(x) (((x) & 0x00000004) >> 2) -#define MCI_INTERRUPT_RX_MSG_RAW_CONT_NACK_SET(x) (((x) << 2) & 0x00000004) -#define MCI_INTERRUPT_RX_MSG_RAW_CONT_INFO_MSB 3 -#define MCI_INTERRUPT_RX_MSG_RAW_CONT_INFO_LSB 3 -#define MCI_INTERRUPT_RX_MSG_RAW_CONT_INFO_MASK 0x00000008 -#define MCI_INTERRUPT_RX_MSG_RAW_CONT_INFO_GET(x) (((x) & 0x00000008) >> 3) -#define MCI_INTERRUPT_RX_MSG_RAW_CONT_INFO_SET(x) (((x) << 3) & 0x00000008) -#define MCI_INTERRUPT_RX_MSG_RAW_CONT_RST_MSB 4 -#define MCI_INTERRUPT_RX_MSG_RAW_CONT_RST_LSB 4 -#define MCI_INTERRUPT_RX_MSG_RAW_CONT_RST_MASK 0x00000010 -#define MCI_INTERRUPT_RX_MSG_RAW_CONT_RST_GET(x) (((x) & 0x00000010) >> 4) -#define MCI_INTERRUPT_RX_MSG_RAW_CONT_RST_SET(x) (((x) << 4) & 0x00000010) -#define MCI_INTERRUPT_RX_MSG_RAW_SCHD_INFO_MSB 5 -#define MCI_INTERRUPT_RX_MSG_RAW_SCHD_INFO_LSB 5 -#define MCI_INTERRUPT_RX_MSG_RAW_SCHD_INFO_MASK 0x00000020 -#define MCI_INTERRUPT_RX_MSG_RAW_SCHD_INFO_GET(x) (((x) & 0x00000020) >> 5) -#define MCI_INTERRUPT_RX_MSG_RAW_SCHD_INFO_SET(x) (((x) << 5) & 0x00000020) -#define MCI_INTERRUPT_RX_MSG_RAW_CPU_INT_MSB 6 -#define MCI_INTERRUPT_RX_MSG_RAW_CPU_INT_LSB 6 -#define MCI_INTERRUPT_RX_MSG_RAW_CPU_INT_MASK 0x00000040 -#define MCI_INTERRUPT_RX_MSG_RAW_CPU_INT_GET(x) (((x) & 0x00000040) >> 6) -#define MCI_INTERRUPT_RX_MSG_RAW_CPU_INT_SET(x) (((x) << 6) & 0x00000040) -#define MCI_INTERRUPT_RX_MSG_RAW_GPM_MSB 8 -#define MCI_INTERRUPT_RX_MSG_RAW_GPM_LSB 8 -#define MCI_INTERRUPT_RX_MSG_RAW_GPM_MASK 0x00000100 -#define MCI_INTERRUPT_RX_MSG_RAW_GPM_GET(x) (((x) & 0x00000100) >> 8) -#define MCI_INTERRUPT_RX_MSG_RAW_GPM_SET(x) (((x) << 8) & 0x00000100) -#define MCI_INTERRUPT_RX_MSG_RAW_LNA_INFO_MSB 9 -#define MCI_INTERRUPT_RX_MSG_RAW_LNA_INFO_LSB 9 -#define MCI_INTERRUPT_RX_MSG_RAW_LNA_INFO_MASK 0x00000200 -#define MCI_INTERRUPT_RX_MSG_RAW_LNA_INFO_GET(x) (((x) & 0x00000200) >> 9) -#define MCI_INTERRUPT_RX_MSG_RAW_LNA_INFO_SET(x) (((x) << 9) & 0x00000200) -#define MCI_INTERRUPT_RX_MSG_RAW_SYS_SLEEPING_MSB 10 -#define MCI_INTERRUPT_RX_MSG_RAW_SYS_SLEEPING_LSB 10 -#define MCI_INTERRUPT_RX_MSG_RAW_SYS_SLEEPING_MASK 0x00000400 -#define MCI_INTERRUPT_RX_MSG_RAW_SYS_SLEEPING_GET(x) (((x) & 0x00000400) >> 10) -#define MCI_INTERRUPT_RX_MSG_RAW_SYS_SLEEPING_SET(x) (((x) << 10) & 0x00000400) -#define MCI_INTERRUPT_RX_MSG_RAW_SYS_WAKING_MSB 11 -#define MCI_INTERRUPT_RX_MSG_RAW_SYS_WAKING_LSB 11 -#define MCI_INTERRUPT_RX_MSG_RAW_SYS_WAKING_MASK 0x00000800 -#define MCI_INTERRUPT_RX_MSG_RAW_SYS_WAKING_GET(x) (((x) & 0x00000800) >> 11) -#define MCI_INTERRUPT_RX_MSG_RAW_SYS_WAKING_SET(x) (((x) << 11) & 0x00000800) -#define MCI_INTERRUPT_RX_MSG_RAW_REQ_WAKE_MSB 12 -#define MCI_INTERRUPT_RX_MSG_RAW_REQ_WAKE_LSB 12 -#define MCI_INTERRUPT_RX_MSG_RAW_REQ_WAKE_MASK 0x00001000 -#define MCI_INTERRUPT_RX_MSG_RAW_REQ_WAKE_GET(x) (((x) & 0x00001000) >> 12) -#define MCI_INTERRUPT_RX_MSG_RAW_REQ_WAKE_SET(x) (((x) << 12) & 0x00001000) - -/* macros for MCI_INTERRUPT_RX_MSG_EN */ -#define MCI_INTERRUPT_RX_MSG_EN_ADDRESS 0x0000003c -#define MCI_INTERRUPT_RX_MSG_EN_OFFSET 0x0000003c -#define MCI_INTERRUPT_RX_MSG_EN_REMOTE_RESET_MSB 0 -#define MCI_INTERRUPT_RX_MSG_EN_REMOTE_RESET_LSB 0 -#define MCI_INTERRUPT_RX_MSG_EN_REMOTE_RESET_MASK 0x00000001 -#define MCI_INTERRUPT_RX_MSG_EN_REMOTE_RESET_GET(x) (((x) & 0x00000001) >> 0) -#define MCI_INTERRUPT_RX_MSG_EN_REMOTE_RESET_SET(x) (((x) << 0) & 0x00000001) -#define MCI_INTERRUPT_RX_MSG_EN_LNA_CTRL_MSB 1 -#define MCI_INTERRUPT_RX_MSG_EN_LNA_CTRL_LSB 1 -#define MCI_INTERRUPT_RX_MSG_EN_LNA_CTRL_MASK 0x00000002 -#define MCI_INTERRUPT_RX_MSG_EN_LNA_CTRL_GET(x) (((x) & 0x00000002) >> 1) -#define MCI_INTERRUPT_RX_MSG_EN_LNA_CTRL_SET(x) (((x) << 1) & 0x00000002) -#define MCI_INTERRUPT_RX_MSG_EN_CONT_NACK_MSB 2 -#define MCI_INTERRUPT_RX_MSG_EN_CONT_NACK_LSB 2 -#define MCI_INTERRUPT_RX_MSG_EN_CONT_NACK_MASK 0x00000004 -#define MCI_INTERRUPT_RX_MSG_EN_CONT_NACK_GET(x) (((x) & 0x00000004) >> 2) -#define MCI_INTERRUPT_RX_MSG_EN_CONT_NACK_SET(x) (((x) << 2) & 0x00000004) -#define MCI_INTERRUPT_RX_MSG_EN_CONT_INFO_MSB 3 -#define MCI_INTERRUPT_RX_MSG_EN_CONT_INFO_LSB 3 -#define MCI_INTERRUPT_RX_MSG_EN_CONT_INFO_MASK 0x00000008 -#define MCI_INTERRUPT_RX_MSG_EN_CONT_INFO_GET(x) (((x) & 0x00000008) >> 3) -#define MCI_INTERRUPT_RX_MSG_EN_CONT_INFO_SET(x) (((x) << 3) & 0x00000008) -#define MCI_INTERRUPT_RX_MSG_EN_CONT_RST_MSB 4 -#define MCI_INTERRUPT_RX_MSG_EN_CONT_RST_LSB 4 -#define MCI_INTERRUPT_RX_MSG_EN_CONT_RST_MASK 0x00000010 -#define MCI_INTERRUPT_RX_MSG_EN_CONT_RST_GET(x) (((x) & 0x00000010) >> 4) -#define MCI_INTERRUPT_RX_MSG_EN_CONT_RST_SET(x) (((x) << 4) & 0x00000010) -#define MCI_INTERRUPT_RX_MSG_EN_SCHD_INFO_MSB 5 -#define MCI_INTERRUPT_RX_MSG_EN_SCHD_INFO_LSB 5 -#define MCI_INTERRUPT_RX_MSG_EN_SCHD_INFO_MASK 0x00000020 -#define MCI_INTERRUPT_RX_MSG_EN_SCHD_INFO_GET(x) (((x) & 0x00000020) >> 5) -#define MCI_INTERRUPT_RX_MSG_EN_SCHD_INFO_SET(x) (((x) << 5) & 0x00000020) -#define MCI_INTERRUPT_RX_MSG_EN_CPU_INT_MSB 6 -#define MCI_INTERRUPT_RX_MSG_EN_CPU_INT_LSB 6 -#define MCI_INTERRUPT_RX_MSG_EN_CPU_INT_MASK 0x00000040 -#define MCI_INTERRUPT_RX_MSG_EN_CPU_INT_GET(x) (((x) & 0x00000040) >> 6) -#define MCI_INTERRUPT_RX_MSG_EN_CPU_INT_SET(x) (((x) << 6) & 0x00000040) -#define MCI_INTERRUPT_RX_MSG_EN_GPM_MSB 8 -#define MCI_INTERRUPT_RX_MSG_EN_GPM_LSB 8 -#define MCI_INTERRUPT_RX_MSG_EN_GPM_MASK 0x00000100 -#define MCI_INTERRUPT_RX_MSG_EN_GPM_GET(x) (((x) & 0x00000100) >> 8) -#define MCI_INTERRUPT_RX_MSG_EN_GPM_SET(x) (((x) << 8) & 0x00000100) -#define MCI_INTERRUPT_RX_MSG_EN_LNA_INFO_MSB 9 -#define MCI_INTERRUPT_RX_MSG_EN_LNA_INFO_LSB 9 -#define MCI_INTERRUPT_RX_MSG_EN_LNA_INFO_MASK 0x00000200 -#define MCI_INTERRUPT_RX_MSG_EN_LNA_INFO_GET(x) (((x) & 0x00000200) >> 9) -#define MCI_INTERRUPT_RX_MSG_EN_LNA_INFO_SET(x) (((x) << 9) & 0x00000200) -#define MCI_INTERRUPT_RX_MSG_EN_SYS_SLEEPING_MSB 10 -#define MCI_INTERRUPT_RX_MSG_EN_SYS_SLEEPING_LSB 10 -#define MCI_INTERRUPT_RX_MSG_EN_SYS_SLEEPING_MASK 0x00000400 -#define MCI_INTERRUPT_RX_MSG_EN_SYS_SLEEPING_GET(x) (((x) & 0x00000400) >> 10) -#define MCI_INTERRUPT_RX_MSG_EN_SYS_SLEEPING_SET(x) (((x) << 10) & 0x00000400) -#define MCI_INTERRUPT_RX_MSG_EN_SYS_WAKING_MSB 11 -#define MCI_INTERRUPT_RX_MSG_EN_SYS_WAKING_LSB 11 -#define MCI_INTERRUPT_RX_MSG_EN_SYS_WAKING_MASK 0x00000800 -#define MCI_INTERRUPT_RX_MSG_EN_SYS_WAKING_GET(x) (((x) & 0x00000800) >> 11) -#define MCI_INTERRUPT_RX_MSG_EN_SYS_WAKING_SET(x) (((x) << 11) & 0x00000800) -#define MCI_INTERRUPT_RX_MSG_EN_REQ_WAKE_MSB 12 -#define MCI_INTERRUPT_RX_MSG_EN_REQ_WAKE_LSB 12 -#define MCI_INTERRUPT_RX_MSG_EN_REQ_WAKE_MASK 0x00001000 -#define MCI_INTERRUPT_RX_MSG_EN_REQ_WAKE_GET(x) (((x) & 0x00001000) >> 12) -#define MCI_INTERRUPT_RX_MSG_EN_REQ_WAKE_SET(x) (((x) << 12) & 0x00001000) - -/* macros for MCI_CPU_INT */ -#define MCI_CPU_INT_ADDRESS 0x00000040 -#define MCI_CPU_INT_OFFSET 0x00000040 -#define MCI_CPU_INT_MSG_MSB 31 -#define MCI_CPU_INT_MSG_LSB 0 -#define MCI_CPU_INT_MSG_MASK 0xffffffff -#define MCI_CPU_INT_MSG_GET(x) (((x) & 0xffffffff) >> 0) -#define MCI_CPU_INT_MSG_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MCI_RX_STATUS */ -#define MCI_RX_STATUS_ADDRESS 0x00000044 -#define MCI_RX_STATUS_OFFSET 0x00000044 -#define MCI_RX_STATUS_SCHD_MSG_INDEX_MSB 11 -#define MCI_RX_STATUS_SCHD_MSG_INDEX_LSB 8 -#define MCI_RX_STATUS_SCHD_MSG_INDEX_MASK 0x00000f00 -#define MCI_RX_STATUS_SCHD_MSG_INDEX_GET(x) (((x) & 0x00000f00) >> 8) -#define MCI_RX_STATUS_REMOTE_SLEEP_MSB 12 -#define MCI_RX_STATUS_REMOTE_SLEEP_LSB 12 -#define MCI_RX_STATUS_REMOTE_SLEEP_MASK 0x00001000 -#define MCI_RX_STATUS_REMOTE_SLEEP_GET(x) (((x) & 0x00001000) >> 12) - -/* macros for MCI_CONT_STATUS */ -#define MCI_CONT_STATUS_ADDRESS 0x00000048 -#define MCI_CONT_STATUS_OFFSET 0x00000048 -#define MCI_CONT_STATUS_RSSI_POWER_MSB 7 -#define MCI_CONT_STATUS_RSSI_POWER_LSB 0 -#define MCI_CONT_STATUS_RSSI_POWER_MASK 0x000000ff -#define MCI_CONT_STATUS_RSSI_POWER_GET(x) (((x) & 0x000000ff) >> 0) -#define MCI_CONT_STATUS_PRIORITY_MSB 15 -#define MCI_CONT_STATUS_PRIORITY_LSB 8 -#define MCI_CONT_STATUS_PRIORITY_MASK 0x0000ff00 -#define MCI_CONT_STATUS_PRIORITY_GET(x) (((x) & 0x0000ff00) >> 8) -#define MCI_CONT_STATUS_TX_MSB 16 -#define MCI_CONT_STATUS_TX_LSB 16 -#define MCI_CONT_STATUS_TX_MASK 0x00010000 -#define MCI_CONT_STATUS_TX_GET(x) (((x) & 0x00010000) >> 16) -#define MCI_CONT_STATUS_LINKID_MSB 20 -#define MCI_CONT_STATUS_LINKID_LSB 17 -#define MCI_CONT_STATUS_LINKID_MASK 0x001e0000 -#define MCI_CONT_STATUS_LINKID_GET(x) (((x) & 0x001e0000) >> 17) -#define MCI_CONT_STATUS_CHANNEL_MSB 27 -#define MCI_CONT_STATUS_CHANNEL_LSB 21 -#define MCI_CONT_STATUS_CHANNEL_MASK 0x0fe00000 -#define MCI_CONT_STATUS_CHANNEL_GET(x) (((x) & 0x0fe00000) >> 21) -#define MCI_CONT_STATUS_OWNER_MSB 31 -#define MCI_CONT_STATUS_OWNER_LSB 28 -#define MCI_CONT_STATUS_OWNER_MASK 0xf0000000 -#define MCI_CONT_STATUS_OWNER_GET(x) (((x) & 0xf0000000) >> 28) - -/* macros for MCI_BT_PRI0 */ -#define MCI_BT_PRI0_ADDRESS 0x0000004c -#define MCI_BT_PRI0_OFFSET 0x0000004c -#define MCI_BT_PRI0_VAL0_MSB 7 -#define MCI_BT_PRI0_VAL0_LSB 0 -#define MCI_BT_PRI0_VAL0_MASK 0x000000ff -#define MCI_BT_PRI0_VAL0_GET(x) (((x) & 0x000000ff) >> 0) -#define MCI_BT_PRI0_VAL0_SET(x) (((x) << 0) & 0x000000ff) -#define MCI_BT_PRI0_VAL1_MSB 15 -#define MCI_BT_PRI0_VAL1_LSB 8 -#define MCI_BT_PRI0_VAL1_MASK 0x0000ff00 -#define MCI_BT_PRI0_VAL1_GET(x) (((x) & 0x0000ff00) >> 8) -#define MCI_BT_PRI0_VAL1_SET(x) (((x) << 8) & 0x0000ff00) -#define MCI_BT_PRI0_VAL2_MSB 23 -#define MCI_BT_PRI0_VAL2_LSB 16 -#define MCI_BT_PRI0_VAL2_MASK 0x00ff0000 -#define MCI_BT_PRI0_VAL2_GET(x) (((x) & 0x00ff0000) >> 16) -#define MCI_BT_PRI0_VAL2_SET(x) (((x) << 16) & 0x00ff0000) -#define MCI_BT_PRI0_VAL3_MSB 31 -#define MCI_BT_PRI0_VAL3_LSB 24 -#define MCI_BT_PRI0_VAL3_MASK 0xff000000 -#define MCI_BT_PRI0_VAL3_GET(x) (((x) & 0xff000000) >> 24) -#define MCI_BT_PRI0_VAL3_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MCI_BT_PRI1 */ -#define MCI_BT_PRI1_ADDRESS 0x00000050 -#define MCI_BT_PRI1_OFFSET 0x00000050 -#define MCI_BT_PRI1_VAL0_MSB 7 -#define MCI_BT_PRI1_VAL0_LSB 0 -#define MCI_BT_PRI1_VAL0_MASK 0x000000ff -#define MCI_BT_PRI1_VAL0_GET(x) (((x) & 0x000000ff) >> 0) -#define MCI_BT_PRI1_VAL0_SET(x) (((x) << 0) & 0x000000ff) -#define MCI_BT_PRI1_VAL1_MSB 15 -#define MCI_BT_PRI1_VAL1_LSB 8 -#define MCI_BT_PRI1_VAL1_MASK 0x0000ff00 -#define MCI_BT_PRI1_VAL1_GET(x) (((x) & 0x0000ff00) >> 8) -#define MCI_BT_PRI1_VAL1_SET(x) (((x) << 8) & 0x0000ff00) -#define MCI_BT_PRI1_VAL2_MSB 23 -#define MCI_BT_PRI1_VAL2_LSB 16 -#define MCI_BT_PRI1_VAL2_MASK 0x00ff0000 -#define MCI_BT_PRI1_VAL2_GET(x) (((x) & 0x00ff0000) >> 16) -#define MCI_BT_PRI1_VAL2_SET(x) (((x) << 16) & 0x00ff0000) -#define MCI_BT_PRI1_VAL3_MSB 31 -#define MCI_BT_PRI1_VAL3_LSB 24 -#define MCI_BT_PRI1_VAL3_MASK 0xff000000 -#define MCI_BT_PRI1_VAL3_GET(x) (((x) & 0xff000000) >> 24) -#define MCI_BT_PRI1_VAL3_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MCI_BT_PRI2 */ -#define MCI_BT_PRI2_ADDRESS 0x00000054 -#define MCI_BT_PRI2_OFFSET 0x00000054 -#define MCI_BT_PRI2_VAL0_MSB 7 -#define MCI_BT_PRI2_VAL0_LSB 0 -#define MCI_BT_PRI2_VAL0_MASK 0x000000ff -#define MCI_BT_PRI2_VAL0_GET(x) (((x) & 0x000000ff) >> 0) -#define MCI_BT_PRI2_VAL0_SET(x) (((x) << 0) & 0x000000ff) -#define MCI_BT_PRI2_VAL1_MSB 15 -#define MCI_BT_PRI2_VAL1_LSB 8 -#define MCI_BT_PRI2_VAL1_MASK 0x0000ff00 -#define MCI_BT_PRI2_VAL1_GET(x) (((x) & 0x0000ff00) >> 8) -#define MCI_BT_PRI2_VAL1_SET(x) (((x) << 8) & 0x0000ff00) -#define MCI_BT_PRI2_VAL2_MSB 23 -#define MCI_BT_PRI2_VAL2_LSB 16 -#define MCI_BT_PRI2_VAL2_MASK 0x00ff0000 -#define MCI_BT_PRI2_VAL2_GET(x) (((x) & 0x00ff0000) >> 16) -#define MCI_BT_PRI2_VAL2_SET(x) (((x) << 16) & 0x00ff0000) -#define MCI_BT_PRI2_VAL3_MSB 31 -#define MCI_BT_PRI2_VAL3_LSB 24 -#define MCI_BT_PRI2_VAL3_MASK 0xff000000 -#define MCI_BT_PRI2_VAL3_GET(x) (((x) & 0xff000000) >> 24) -#define MCI_BT_PRI2_VAL3_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MCI_BT_PRI3 */ -#define MCI_BT_PRI3_ADDRESS 0x00000058 -#define MCI_BT_PRI3_OFFSET 0x00000058 -#define MCI_BT_PRI3_VAL0_MSB 7 -#define MCI_BT_PRI3_VAL0_LSB 0 -#define MCI_BT_PRI3_VAL0_MASK 0x000000ff -#define MCI_BT_PRI3_VAL0_GET(x) (((x) & 0x000000ff) >> 0) -#define MCI_BT_PRI3_VAL0_SET(x) (((x) << 0) & 0x000000ff) -#define MCI_BT_PRI3_VAL1_MSB 15 -#define MCI_BT_PRI3_VAL1_LSB 8 -#define MCI_BT_PRI3_VAL1_MASK 0x0000ff00 -#define MCI_BT_PRI3_VAL1_GET(x) (((x) & 0x0000ff00) >> 8) -#define MCI_BT_PRI3_VAL1_SET(x) (((x) << 8) & 0x0000ff00) -#define MCI_BT_PRI3_VAL2_MSB 23 -#define MCI_BT_PRI3_VAL2_LSB 16 -#define MCI_BT_PRI3_VAL2_MASK 0x00ff0000 -#define MCI_BT_PRI3_VAL2_GET(x) (((x) & 0x00ff0000) >> 16) -#define MCI_BT_PRI3_VAL2_SET(x) (((x) << 16) & 0x00ff0000) -#define MCI_BT_PRI3_VAL3_MSB 31 -#define MCI_BT_PRI3_VAL3_LSB 24 -#define MCI_BT_PRI3_VAL3_MASK 0xff000000 -#define MCI_BT_PRI3_VAL3_GET(x) (((x) & 0xff000000) >> 24) -#define MCI_BT_PRI3_VAL3_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MCI_BT_PRI */ -#define MCI_BT_PRI_ADDRESS 0x0000005c -#define MCI_BT_PRI_OFFSET 0x0000005c -#define MCI_BT_PRI_THRESH_MSB 7 -#define MCI_BT_PRI_THRESH_LSB 0 -#define MCI_BT_PRI_THRESH_MASK 0x000000ff -#define MCI_BT_PRI_THRESH_GET(x) (((x) & 0x000000ff) >> 0) -#define MCI_BT_PRI_THRESH_SET(x) (((x) << 0) & 0x000000ff) - -/* macros for MCI_WL_FREQ0 */ -#define MCI_WL_FREQ0_ADDRESS 0x00000060 -#define MCI_WL_FREQ0_OFFSET 0x00000060 -#define MCI_WL_FREQ0_MASK_MSB 31 -#define MCI_WL_FREQ0_MASK_LSB 0 -#define MCI_WL_FREQ0_MASK_MASK 0xffffffff -#define MCI_WL_FREQ0_MASK_GET(x) (((x) & 0xffffffff) >> 0) -#define MCI_WL_FREQ0_MASK_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MCI_WL_FREQ1 */ -#define MCI_WL_FREQ1_ADDRESS 0x00000064 -#define MCI_WL_FREQ1_OFFSET 0x00000064 -#define MCI_WL_FREQ1_MASK_MSB 31 -#define MCI_WL_FREQ1_MASK_LSB 0 -#define MCI_WL_FREQ1_MASK_MASK 0xffffffff -#define MCI_WL_FREQ1_MASK_GET(x) (((x) & 0xffffffff) >> 0) -#define MCI_WL_FREQ1_MASK_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MCI_WL_FREQ2 */ -#define MCI_WL_FREQ2_ADDRESS 0x00000068 -#define MCI_WL_FREQ2_OFFSET 0x00000068 -#define MCI_WL_FREQ2_MASK_MSB 15 -#define MCI_WL_FREQ2_MASK_LSB 0 -#define MCI_WL_FREQ2_MASK_MASK 0x0000ffff -#define MCI_WL_FREQ2_MASK_GET(x) (((x) & 0x0000ffff) >> 0) -#define MCI_WL_FREQ2_MASK_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MCI_GAIN */ -#define MCI_GAIN_ADDRESS 0x0000006c -#define MCI_GAIN_OFFSET 0x0000006c -#define MCI_GAIN_OFFSET1_MSB 7 -#define MCI_GAIN_OFFSET1_LSB 0 -#define MCI_GAIN_OFFSET1_MASK 0x000000ff -#define MCI_GAIN_OFFSET1_GET(x) (((x) & 0x000000ff) >> 0) -#define MCI_GAIN_OFFSET1_SET(x) (((x) << 0) & 0x000000ff) -#define MCI_GAIN_OFFSET2_MSB 15 -#define MCI_GAIN_OFFSET2_LSB 8 -#define MCI_GAIN_OFFSET2_MASK 0x0000ff00 -#define MCI_GAIN_OFFSET2_GET(x) (((x) & 0x0000ff00) >> 8) -#define MCI_GAIN_OFFSET2_SET(x) (((x) << 8) & 0x0000ff00) - -/* macros for MCI_WBTIMER1 */ -#define MCI_WBTIMER1_ADDRESS 0x00000070 -#define MCI_WBTIMER1_OFFSET 0x00000070 -#define MCI_WBTIMER1_TARGET_MSB 31 -#define MCI_WBTIMER1_TARGET_LSB 0 -#define MCI_WBTIMER1_TARGET_MASK 0xffffffff -#define MCI_WBTIMER1_TARGET_GET(x) (((x) & 0xffffffff) >> 0) -#define MCI_WBTIMER1_TARGET_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MCI_WBTIMER2 */ -#define MCI_WBTIMER2_ADDRESS 0x00000074 -#define MCI_WBTIMER2_OFFSET 0x00000074 -#define MCI_WBTIMER2_TARGET_MSB 31 -#define MCI_WBTIMER2_TARGET_LSB 0 -#define MCI_WBTIMER2_TARGET_MASK 0xffffffff -#define MCI_WBTIMER2_TARGET_GET(x) (((x) & 0xffffffff) >> 0) -#define MCI_WBTIMER2_TARGET_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MCI_WBTIMER3 */ -#define MCI_WBTIMER3_ADDRESS 0x00000078 -#define MCI_WBTIMER3_OFFSET 0x00000078 -#define MCI_WBTIMER3_TARGET_MSB 31 -#define MCI_WBTIMER3_TARGET_LSB 0 -#define MCI_WBTIMER3_TARGET_MASK 0xffffffff -#define MCI_WBTIMER3_TARGET_GET(x) (((x) & 0xffffffff) >> 0) -#define MCI_WBTIMER3_TARGET_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MCI_WBTIMER4 */ -#define MCI_WBTIMER4_ADDRESS 0x0000007c -#define MCI_WBTIMER4_OFFSET 0x0000007c -#define MCI_WBTIMER4_TARGET_MSB 31 -#define MCI_WBTIMER4_TARGET_LSB 0 -#define MCI_WBTIMER4_TARGET_MASK 0xffffffff -#define MCI_WBTIMER4_TARGET_GET(x) (((x) & 0xffffffff) >> 0) -#define MCI_WBTIMER4_TARGET_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MCI_MAXGAIN */ -#define MCI_MAXGAIN_ADDRESS 0x00000080 -#define MCI_MAXGAIN_OFFSET 0x00000080 -#define MCI_MAXGAIN_GAIN1_MSB 7 -#define MCI_MAXGAIN_GAIN1_LSB 0 -#define MCI_MAXGAIN_GAIN1_MASK 0x000000ff -#define MCI_MAXGAIN_GAIN1_GET(x) (((x) & 0x000000ff) >> 0) -#define MCI_MAXGAIN_GAIN1_SET(x) (((x) << 0) & 0x000000ff) -#define MCI_MAXGAIN_GAIN2_MSB 15 -#define MCI_MAXGAIN_GAIN2_LSB 8 -#define MCI_MAXGAIN_GAIN2_MASK 0x0000ff00 -#define MCI_MAXGAIN_GAIN2_GET(x) (((x) & 0x0000ff00) >> 8) -#define MCI_MAXGAIN_GAIN2_SET(x) (((x) << 8) & 0x0000ff00) -#define MCI_MAXGAIN_GAIN3_MSB 23 -#define MCI_MAXGAIN_GAIN3_LSB 16 -#define MCI_MAXGAIN_GAIN3_MASK 0x00ff0000 -#define MCI_MAXGAIN_GAIN3_GET(x) (((x) & 0x00ff0000) >> 16) -#define MCI_MAXGAIN_GAIN3_SET(x) (((x) << 16) & 0x00ff0000) -#define MCI_MAXGAIN_GAIN4_MSB 31 -#define MCI_MAXGAIN_GAIN4_LSB 24 -#define MCI_MAXGAIN_GAIN4_MASK 0xff000000 -#define MCI_MAXGAIN_GAIN4_GET(x) (((x) & 0xff000000) >> 24) -#define MCI_MAXGAIN_GAIN4_SET(x) (((x) << 24) & 0xff000000) - -/* macros for BTCOEX_CTRL */ -#define BTCOEX_CTRL_ADDRESS 0x000000ac -#define BTCOEX_CTRL_OFFSET 0x000000ac -#define BTCOEX_CTRL_MCI_MODE_ENABLE_MSB 2 -#define BTCOEX_CTRL_MCI_MODE_ENABLE_LSB 2 -#define BTCOEX_CTRL_MCI_MODE_ENABLE_MASK 0x00000004 -#define BTCOEX_CTRL_MCI_MODE_ENABLE_GET(x) (((x) & 0x00000004) >> 2) -#define BTCOEX_CTRL_MCI_MODE_ENABLE_SET(x) (((x) << 2) & 0x00000004) - -/* macros for BTCOEX_CTRL2 */ -#define BTCOEX_CTRL2_ADDRESS 0x0000014c -#define BTCOEX_CTRL2_OFFSET 0x0000014c -#define BTCOEX_CTRL2_RESERVED2_MSB 7 -#define BTCOEX_CTRL2_RESERVED2_LSB 0 -#define BTCOEX_CTRL2_RESERVED2_MASK 0x000000ff -#define BTCOEX_CTRL2_RESERVED2_GET(x) (((x) & 0x000000ff) >> 0) -#define BTCOEX_CTRL2_RESERVED2_SET(x) (((x) << 0) & 0x000000ff) -#define BTCOEX_CTRL2_OBS_SEL_MSB 10 -#define BTCOEX_CTRL2_OBS_SEL_LSB 8 -#define BTCOEX_CTRL2_OBS_SEL_MASK 0x00000700 -#define BTCOEX_CTRL2_OBS_SEL_GET(x) (((x) & 0x00000700) >> 8) -#define BTCOEX_CTRL2_OBS_SEL_SET(x) (((x) << 8) & 0x00000700) - -/* macros for BTCOEX_DBG */ -#define BTCOEX_DBG_ADDRESS 0x00000254 -#define BTCOEX_DBG_OFFSET 0x00000254 -#define BTCOEX_DBG_OBS_MSB 31 -#define BTCOEX_DBG_OBS_LSB 0 -#define BTCOEX_DBG_OBS_MASK 0xffffffff -#define BTCOEX_DBG_OBS_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MCI_LAST_HW_MSG_HDR */ -#define MCI_LAST_HW_MSG_HDR_ADDRESS 0x00000258 -#define MCI_LAST_HW_MSG_HDR_OFFSET 0x00000258 -#define MCI_LAST_HW_MSG_HDR_HDR_MSB 7 -#define MCI_LAST_HW_MSG_HDR_HDR_LSB 0 -#define MCI_LAST_HW_MSG_HDR_HDR_MASK 0x000000ff -#define MCI_LAST_HW_MSG_HDR_HDR_GET(x) (((x) & 0x000000ff) >> 0) -#define MCI_LAST_HW_MSG_HDR_LEN_MSB 10 -#define MCI_LAST_HW_MSG_HDR_LEN_LSB 8 -#define MCI_LAST_HW_MSG_HDR_LEN_MASK 0x00000700 -#define MCI_LAST_HW_MSG_HDR_LEN_GET(x) (((x) & 0x00000700) >> 8) - -/* macros for MCI_LAST_HW_MSG_BDY */ -#define MCI_LAST_HW_MSG_BDY_ADDRESS 0x0000025c -#define MCI_LAST_HW_MSG_BDY_OFFSET 0x0000025c -#define MCI_LAST_HW_MSG_BDY_BDY_MSB 31 -#define MCI_LAST_HW_MSG_BDY_BDY_LSB 0 -#define MCI_LAST_HW_MSG_BDY_BDY_MASK 0xffffffff -#define MCI_LAST_HW_MSG_BDY_BDY_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MCI_MAXGAIN_RST */ -#define MCI_MAXGAIN_RST_ADDRESS 0x00000260 -#define MCI_MAXGAIN_RST_OFFSET 0x00000260 -#define MCI_MAXGAIN_RST_TARGET_MSB 31 -#define MCI_MAXGAIN_RST_TARGET_LSB 0 -#define MCI_MAXGAIN_RST_TARGET_MASK 0xffffffff -#define MCI_MAXGAIN_RST_TARGET_GET(x) (((x) & 0xffffffff) >> 0) -#define MCI_MAXGAIN_RST_TARGET_SET(x) (((x) << 0) & 0xffffffff) - - -#ifndef __ASSEMBLER__ - -typedef struct wlan_coex_reg_reg_s { - volatile unsigned int MCI_COMMAND0; /* 0x0 - 0x4 */ - volatile unsigned int MCI_COMMAND1; /* 0x4 - 0x8 */ - volatile unsigned int MCI_COMMAND2; /* 0x8 - 0xc */ - volatile unsigned int MCI_RX_CTRL; /* 0xc - 0x10 */ - volatile unsigned int MCI_TX_CTRL; /* 0x10 - 0x14 */ - volatile unsigned int MCI_MSG_ATTRIBUTES_TABLE; /* 0x14 - 0x18 */ - volatile unsigned int MCI_SCHD_TABLE_0; /* 0x18 - 0x1c */ - volatile unsigned int MCI_SCHD_TABLE_1; /* 0x1c - 0x20 */ - volatile unsigned int MCI_GPM_0; /* 0x20 - 0x24 */ - volatile unsigned int MCI_GPM_1; /* 0x24 - 0x28 */ - volatile unsigned int MCI_INTERRUPT_RAW; /* 0x28 - 0x2c */ - volatile unsigned int MCI_INTERRUPT_EN; /* 0x2c - 0x30 */ - volatile unsigned int MCI_REMOTE_CPU_INT; /* 0x30 - 0x34 */ - volatile unsigned int MCI_REMOTE_CPU_INT_EN; /* 0x34 - 0x38 */ - volatile unsigned int MCI_INTERRUPT_RX_MSG_RAW; /* 0x38 - 0x3c */ - volatile unsigned int MCI_INTERRUPT_RX_MSG_EN; /* 0x3c - 0x40 */ - volatile unsigned int MCI_CPU_INT; /* 0x40 - 0x44 */ - volatile unsigned int MCI_RX_STATUS; /* 0x44 - 0x48 */ - volatile unsigned int MCI_CONT_STATUS; /* 0x48 - 0x4c */ - volatile unsigned int MCI_BT_PRI0; /* 0x4c - 0x50 */ - volatile unsigned int MCI_BT_PRI1; /* 0x50 - 0x54 */ - volatile unsigned int MCI_BT_PRI2; /* 0x54 - 0x58 */ - volatile unsigned int MCI_BT_PRI3; /* 0x58 - 0x5c */ - volatile unsigned int MCI_BT_PRI; /* 0x5c - 0x60 */ - volatile unsigned int MCI_WL_FREQ0; /* 0x60 - 0x64 */ - volatile unsigned int MCI_WL_FREQ1; /* 0x64 - 0x68 */ - volatile unsigned int MCI_WL_FREQ2; /* 0x68 - 0x6c */ - volatile unsigned int MCI_GAIN; /* 0x6c - 0x70 */ - volatile unsigned int MCI_WBTIMER1; /* 0x70 - 0x74 */ - volatile unsigned int MCI_WBTIMER2; /* 0x74 - 0x78 */ - volatile unsigned int MCI_WBTIMER3; /* 0x78 - 0x7c */ - volatile unsigned int MCI_WBTIMER4; /* 0x7c - 0x80 */ - volatile unsigned int MCI_MAXGAIN; /* 0x80 - 0x84 */ - volatile char pad__0[0x28]; /* 0x84 - 0xac */ - volatile unsigned int BTCOEX_CTRL; /* 0xac - 0xb0 */ - volatile char pad__1[0x9c]; /* 0xb0 - 0x14c */ - volatile unsigned int BTCOEX_CTRL2; /* 0x14c - 0x150 */ - volatile char pad__2[0x104]; /* 0x150 - 0x254 */ - volatile unsigned int BTCOEX_DBG; /* 0x254 - 0x258 */ - volatile unsigned int MCI_LAST_HW_MSG_HDR; /* 0x258 - 0x25c */ - volatile unsigned int MCI_LAST_HW_MSG_BDY; /* 0x25c - 0x260 */ - volatile unsigned int MCI_MAXGAIN_RST; /* 0x260 - 0x264 */ -} wlan_coex_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _WLAN_COEX_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_dcu_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_dcu_reg.h deleted file mode 100644 index 944eb7165413..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_dcu_reg.h +++ /dev/null @@ -1,772 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _WMAC_DCU_REG_REG_H_ -#define _WMAC_DCU_REG_REG_H_ - - -/* macros for MAC_DCU_QCUMASK */ -#define MAC_DCU_QCUMASK_ADDRESS 0x00001000 -#define MAC_DCU_QCUMASK_OFFSET 0x00001000 -#define MAC_DCU_QCUMASK_DATA_MSB 9 -#define MAC_DCU_QCUMASK_DATA_LSB 0 -#define MAC_DCU_QCUMASK_DATA_MASK 0x000003ff -#define MAC_DCU_QCUMASK_DATA_GET(x) (((x) & 0x000003ff) >> 0) -#define MAC_DCU_QCUMASK_DATA_SET(x) (((x) << 0) & 0x000003ff) - -/* macros for MAC_DCU_GBL_IFS_SIFS */ -#define MAC_DCU_GBL_IFS_SIFS_ADDRESS 0x00001030 -#define MAC_DCU_GBL_IFS_SIFS_OFFSET 0x00001030 -#define MAC_DCU_GBL_IFS_SIFS_DURATION_MSB 15 -#define MAC_DCU_GBL_IFS_SIFS_DURATION_LSB 0 -#define MAC_DCU_GBL_IFS_SIFS_DURATION_MASK 0x0000ffff -#define MAC_DCU_GBL_IFS_SIFS_DURATION_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DCU_GBL_IFS_SIFS_DURATION_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MAC_DCU_TXFILTER_DCU0_31_0 */ -#define MAC_DCU_TXFILTER_DCU0_31_0_ADDRESS 0x00001038 -#define MAC_DCU_TXFILTER_DCU0_31_0_OFFSET 0x00001038 -#define MAC_DCU_TXFILTER_DCU0_31_0_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU0_31_0_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU0_31_0_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU0_31_0_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DCU_TXFILTER_DCU0_31_0_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DCU_TXFILTER_DCU8_31_0 */ -#define MAC_DCU_TXFILTER_DCU8_31_0_ADDRESS 0x0000103c -#define MAC_DCU_TXFILTER_DCU8_31_0_OFFSET 0x0000103c -#define MAC_DCU_TXFILTER_DCU8_31_0_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU8_31_0_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU8_31_0_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU8_31_0_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_LCL_IFS */ -#define MAC_DCU_LCL_IFS_ADDRESS 0x00001040 -#define MAC_DCU_LCL_IFS_OFFSET 0x00001040 -#define MAC_DCU_LCL_IFS_CW_MIN_MSB 9 -#define MAC_DCU_LCL_IFS_CW_MIN_LSB 0 -#define MAC_DCU_LCL_IFS_CW_MIN_MASK 0x000003ff -#define MAC_DCU_LCL_IFS_CW_MIN_GET(x) (((x) & 0x000003ff) >> 0) -#define MAC_DCU_LCL_IFS_CW_MIN_SET(x) (((x) << 0) & 0x000003ff) -#define MAC_DCU_LCL_IFS_CW_MAX_MSB 19 -#define MAC_DCU_LCL_IFS_CW_MAX_LSB 10 -#define MAC_DCU_LCL_IFS_CW_MAX_MASK 0x000ffc00 -#define MAC_DCU_LCL_IFS_CW_MAX_GET(x) (((x) & 0x000ffc00) >> 10) -#define MAC_DCU_LCL_IFS_CW_MAX_SET(x) (((x) << 10) & 0x000ffc00) -#define MAC_DCU_LCL_IFS_AIFS_MSB 27 -#define MAC_DCU_LCL_IFS_AIFS_LSB 20 -#define MAC_DCU_LCL_IFS_AIFS_MASK 0x0ff00000 -#define MAC_DCU_LCL_IFS_AIFS_GET(x) (((x) & 0x0ff00000) >> 20) -#define MAC_DCU_LCL_IFS_AIFS_SET(x) (((x) << 20) & 0x0ff00000) -#define MAC_DCU_LCL_IFS_LONG_AIFS_MSB 28 -#define MAC_DCU_LCL_IFS_LONG_AIFS_LSB 28 -#define MAC_DCU_LCL_IFS_LONG_AIFS_MASK 0x10000000 -#define MAC_DCU_LCL_IFS_LONG_AIFS_GET(x) (((x) & 0x10000000) >> 28) -#define MAC_DCU_LCL_IFS_LONG_AIFS_SET(x) (((x) << 28) & 0x10000000) - -/* macros for MAC_DCU_GBL_IFS_SLOT */ -#define MAC_DCU_GBL_IFS_SLOT_ADDRESS 0x00001070 -#define MAC_DCU_GBL_IFS_SLOT_OFFSET 0x00001070 -#define MAC_DCU_GBL_IFS_SLOT_DURATION_MSB 15 -#define MAC_DCU_GBL_IFS_SLOT_DURATION_LSB 0 -#define MAC_DCU_GBL_IFS_SLOT_DURATION_MASK 0x0000ffff -#define MAC_DCU_GBL_IFS_SLOT_DURATION_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DCU_GBL_IFS_SLOT_DURATION_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MAC_DCU_TXFILTER_DCU0_63_32 */ -#define MAC_DCU_TXFILTER_DCU0_63_32_ADDRESS 0x00001078 -#define MAC_DCU_TXFILTER_DCU0_63_32_OFFSET 0x00001078 -#define MAC_DCU_TXFILTER_DCU0_63_32_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU0_63_32_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU0_63_32_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU0_63_32_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DCU_TXFILTER_DCU0_63_32_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DCU_TXFILTER_DCU8_63_32 */ -#define MAC_DCU_TXFILTER_DCU8_63_32_ADDRESS 0x0000107c -#define MAC_DCU_TXFILTER_DCU8_63_32_OFFSET 0x0000107c -#define MAC_DCU_TXFILTER_DCU8_63_32_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU8_63_32_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU8_63_32_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU8_63_32_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_RETRY_LIMIT */ -#define MAC_DCU_RETRY_LIMIT_ADDRESS 0x00001080 -#define MAC_DCU_RETRY_LIMIT_OFFSET 0x00001080 -#define MAC_DCU_RETRY_LIMIT_FRFL_MSB 3 -#define MAC_DCU_RETRY_LIMIT_FRFL_LSB 0 -#define MAC_DCU_RETRY_LIMIT_FRFL_MASK 0x0000000f -#define MAC_DCU_RETRY_LIMIT_FRFL_GET(x) (((x) & 0x0000000f) >> 0) -#define MAC_DCU_RETRY_LIMIT_FRFL_SET(x) (((x) << 0) & 0x0000000f) -#define MAC_DCU_RETRY_LIMIT_SRFL_MSB 13 -#define MAC_DCU_RETRY_LIMIT_SRFL_LSB 8 -#define MAC_DCU_RETRY_LIMIT_SRFL_MASK 0x00003f00 -#define MAC_DCU_RETRY_LIMIT_SRFL_GET(x) (((x) & 0x00003f00) >> 8) -#define MAC_DCU_RETRY_LIMIT_SRFL_SET(x) (((x) << 8) & 0x00003f00) -#define MAC_DCU_RETRY_LIMIT_SDFL_MSB 19 -#define MAC_DCU_RETRY_LIMIT_SDFL_LSB 14 -#define MAC_DCU_RETRY_LIMIT_SDFL_MASK 0x000fc000 -#define MAC_DCU_RETRY_LIMIT_SDFL_GET(x) (((x) & 0x000fc000) >> 14) -#define MAC_DCU_RETRY_LIMIT_SDFL_SET(x) (((x) << 14) & 0x000fc000) - -/* macros for MAC_DCU_GBL_IFS_EIFS */ -#define MAC_DCU_GBL_IFS_EIFS_ADDRESS 0x000010b0 -#define MAC_DCU_GBL_IFS_EIFS_OFFSET 0x000010b0 -#define MAC_DCU_GBL_IFS_EIFS_DURATION_MSB 15 -#define MAC_DCU_GBL_IFS_EIFS_DURATION_LSB 0 -#define MAC_DCU_GBL_IFS_EIFS_DURATION_MASK 0x0000ffff -#define MAC_DCU_GBL_IFS_EIFS_DURATION_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DCU_GBL_IFS_EIFS_DURATION_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MAC_DCU_TXFILTER_DCU0_95_64 */ -#define MAC_DCU_TXFILTER_DCU0_95_64_ADDRESS 0x000010b8 -#define MAC_DCU_TXFILTER_DCU0_95_64_OFFSET 0x000010b8 -#define MAC_DCU_TXFILTER_DCU0_95_64_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU0_95_64_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU0_95_64_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU0_95_64_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DCU_TXFILTER_DCU0_95_64_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DCU_TXFILTER_DCU8_95_64 */ -#define MAC_DCU_TXFILTER_DCU8_95_64_ADDRESS 0x000010bc -#define MAC_DCU_TXFILTER_DCU8_95_64_OFFSET 0x000010bc -#define MAC_DCU_TXFILTER_DCU8_95_64_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU8_95_64_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU8_95_64_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU8_95_64_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_CHANNEL_TIME */ -#define MAC_DCU_CHANNEL_TIME_ADDRESS 0x000010c0 -#define MAC_DCU_CHANNEL_TIME_OFFSET 0x000010c0 -#define MAC_DCU_CHANNEL_TIME_DURATION_MSB 19 -#define MAC_DCU_CHANNEL_TIME_DURATION_LSB 0 -#define MAC_DCU_CHANNEL_TIME_DURATION_MASK 0x000fffff -#define MAC_DCU_CHANNEL_TIME_DURATION_GET(x) (((x) & 0x000fffff) >> 0) -#define MAC_DCU_CHANNEL_TIME_DURATION_SET(x) (((x) << 0) & 0x000fffff) -#define MAC_DCU_CHANNEL_TIME_ENABLE_MSB 20 -#define MAC_DCU_CHANNEL_TIME_ENABLE_LSB 20 -#define MAC_DCU_CHANNEL_TIME_ENABLE_MASK 0x00100000 -#define MAC_DCU_CHANNEL_TIME_ENABLE_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_DCU_CHANNEL_TIME_ENABLE_SET(x) (((x) << 20) & 0x00100000) - -/* macros for MAC_DCU_GBL_IFS_MISC */ -#define MAC_DCU_GBL_IFS_MISC_ADDRESS 0x000010f0 -#define MAC_DCU_GBL_IFS_MISC_OFFSET 0x000010f0 -#define MAC_DCU_GBL_IFS_MISC_LFSR_SLICE_SEL_MSB 2 -#define MAC_DCU_GBL_IFS_MISC_LFSR_SLICE_SEL_LSB 0 -#define MAC_DCU_GBL_IFS_MISC_LFSR_SLICE_SEL_MASK 0x00000007 -#define MAC_DCU_GBL_IFS_MISC_LFSR_SLICE_SEL_GET(x) (((x) & 0x00000007) >> 0) -#define MAC_DCU_GBL_IFS_MISC_LFSR_SLICE_SEL_SET(x) (((x) << 0) & 0x00000007) -#define MAC_DCU_GBL_IFS_MISC_TURBO_MODE_MSB 3 -#define MAC_DCU_GBL_IFS_MISC_TURBO_MODE_LSB 3 -#define MAC_DCU_GBL_IFS_MISC_TURBO_MODE_MASK 0x00000008 -#define MAC_DCU_GBL_IFS_MISC_TURBO_MODE_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_DCU_GBL_IFS_MISC_TURBO_MODE_SET(x) (((x) << 3) & 0x00000008) -#define MAC_DCU_GBL_IFS_MISC_SIFS_DUR_USEC_MSB 9 -#define MAC_DCU_GBL_IFS_MISC_SIFS_DUR_USEC_LSB 4 -#define MAC_DCU_GBL_IFS_MISC_SIFS_DUR_USEC_MASK 0x000003f0 -#define MAC_DCU_GBL_IFS_MISC_SIFS_DUR_USEC_GET(x) (((x) & 0x000003f0) >> 4) -#define MAC_DCU_GBL_IFS_MISC_SIFS_DUR_USEC_SET(x) (((x) << 4) & 0x000003f0) -#define MAC_DCU_GBL_IFS_MISC_ARB_DLY_MSB 21 -#define MAC_DCU_GBL_IFS_MISC_ARB_DLY_LSB 20 -#define MAC_DCU_GBL_IFS_MISC_ARB_DLY_MASK 0x00300000 -#define MAC_DCU_GBL_IFS_MISC_ARB_DLY_GET(x) (((x) & 0x00300000) >> 20) -#define MAC_DCU_GBL_IFS_MISC_ARB_DLY_SET(x) (((x) << 20) & 0x00300000) -#define MAC_DCU_GBL_IFS_MISC_SIFS_RST_UNCOND_MSB 22 -#define MAC_DCU_GBL_IFS_MISC_SIFS_RST_UNCOND_LSB 22 -#define MAC_DCU_GBL_IFS_MISC_SIFS_RST_UNCOND_MASK 0x00400000 -#define MAC_DCU_GBL_IFS_MISC_SIFS_RST_UNCOND_GET(x) (((x) & 0x00400000) >> 22) -#define MAC_DCU_GBL_IFS_MISC_SIFS_RST_UNCOND_SET(x) (((x) << 22) & 0x00400000) -#define MAC_DCU_GBL_IFS_MISC_AIFS_RST_UNCOND_MSB 23 -#define MAC_DCU_GBL_IFS_MISC_AIFS_RST_UNCOND_LSB 23 -#define MAC_DCU_GBL_IFS_MISC_AIFS_RST_UNCOND_MASK 0x00800000 -#define MAC_DCU_GBL_IFS_MISC_AIFS_RST_UNCOND_GET(x) (((x) & 0x00800000) >> 23) -#define MAC_DCU_GBL_IFS_MISC_AIFS_RST_UNCOND_SET(x) (((x) << 23) & 0x00800000) -#define MAC_DCU_GBL_IFS_MISC_LFSR_SLICE_RANDOM_DIS_MSB 24 -#define MAC_DCU_GBL_IFS_MISC_LFSR_SLICE_RANDOM_DIS_LSB 24 -#define MAC_DCU_GBL_IFS_MISC_LFSR_SLICE_RANDOM_DIS_MASK 0x01000000 -#define MAC_DCU_GBL_IFS_MISC_LFSR_SLICE_RANDOM_DIS_GET(x) (((x) & 0x01000000) >> 24) -#define MAC_DCU_GBL_IFS_MISC_LFSR_SLICE_RANDOM_DIS_SET(x) (((x) << 24) & 0x01000000) -#define MAC_DCU_GBL_IFS_MISC_CHAN_SLOT_WIN_DUR_MSB 26 -#define MAC_DCU_GBL_IFS_MISC_CHAN_SLOT_WIN_DUR_LSB 25 -#define MAC_DCU_GBL_IFS_MISC_CHAN_SLOT_WIN_DUR_MASK 0x06000000 -#define MAC_DCU_GBL_IFS_MISC_CHAN_SLOT_WIN_DUR_GET(x) (((x) & 0x06000000) >> 25) -#define MAC_DCU_GBL_IFS_MISC_CHAN_SLOT_WIN_DUR_SET(x) (((x) << 25) & 0x06000000) -#define MAC_DCU_GBL_IFS_MISC_CHAN_SLOT_ALWAYS_MSB 27 -#define MAC_DCU_GBL_IFS_MISC_CHAN_SLOT_ALWAYS_LSB 27 -#define MAC_DCU_GBL_IFS_MISC_CHAN_SLOT_ALWAYS_MASK 0x08000000 -#define MAC_DCU_GBL_IFS_MISC_CHAN_SLOT_ALWAYS_GET(x) (((x) & 0x08000000) >> 27) -#define MAC_DCU_GBL_IFS_MISC_CHAN_SLOT_ALWAYS_SET(x) (((x) << 27) & 0x08000000) -#define MAC_DCU_GBL_IFS_MISC_IGNORE_BACKOFF_MSB 28 -#define MAC_DCU_GBL_IFS_MISC_IGNORE_BACKOFF_LSB 28 -#define MAC_DCU_GBL_IFS_MISC_IGNORE_BACKOFF_MASK 0x10000000 -#define MAC_DCU_GBL_IFS_MISC_IGNORE_BACKOFF_GET(x) (((x) & 0x10000000) >> 28) -#define MAC_DCU_GBL_IFS_MISC_IGNORE_BACKOFF_SET(x) (((x) << 28) & 0x10000000) -#define MAC_DCU_GBL_IFS_MISC_SLOT_COUNT_RST_UNCOND_MSB 29 -#define MAC_DCU_GBL_IFS_MISC_SLOT_COUNT_RST_UNCOND_LSB 29 -#define MAC_DCU_GBL_IFS_MISC_SLOT_COUNT_RST_UNCOND_MASK 0x20000000 -#define MAC_DCU_GBL_IFS_MISC_SLOT_COUNT_RST_UNCOND_GET(x) (((x) & 0x20000000) >> 29) -#define MAC_DCU_GBL_IFS_MISC_SLOT_COUNT_RST_UNCOND_SET(x) (((x) << 29) & 0x20000000) - -/* macros for MAC_DCU_TXFILTER_DCU0_127_96 */ -#define MAC_DCU_TXFILTER_DCU0_127_96_ADDRESS 0x000010f8 -#define MAC_DCU_TXFILTER_DCU0_127_96_OFFSET 0x000010f8 -#define MAC_DCU_TXFILTER_DCU0_127_96_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU0_127_96_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU0_127_96_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU0_127_96_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DCU_TXFILTER_DCU0_127_96_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DCU_TXFILTER_DCU8_127_96 */ -#define MAC_DCU_TXFILTER_DCU8_127_96_ADDRESS 0x000010fc -#define MAC_DCU_TXFILTER_DCU8_127_96_OFFSET 0x000010fc -#define MAC_DCU_TXFILTER_DCU8_127_96_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU8_127_96_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU8_127_96_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU8_127_96_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_MISC */ -#define MAC_DCU_MISC_ADDRESS 0x00001100 -#define MAC_DCU_MISC_OFFSET 0x00001100 -#define MAC_DCU_MISC_BKOFF_THRESH_MSB 5 -#define MAC_DCU_MISC_BKOFF_THRESH_LSB 0 -#define MAC_DCU_MISC_BKOFF_THRESH_MASK 0x0000003f -#define MAC_DCU_MISC_BKOFF_THRESH_GET(x) (((x) & 0x0000003f) >> 0) -#define MAC_DCU_MISC_BKOFF_THRESH_SET(x) (((x) << 0) & 0x0000003f) -#define MAC_DCU_MISC_SFC_RST_AT_TS_END_EN_MSB 6 -#define MAC_DCU_MISC_SFC_RST_AT_TS_END_EN_LSB 6 -#define MAC_DCU_MISC_SFC_RST_AT_TS_END_EN_MASK 0x00000040 -#define MAC_DCU_MISC_SFC_RST_AT_TS_END_EN_GET(x) (((x) & 0x00000040) >> 6) -#define MAC_DCU_MISC_SFC_RST_AT_TS_END_EN_SET(x) (((x) << 6) & 0x00000040) -#define MAC_DCU_MISC_CW_RST_AT_TS_END_DIS_MSB 7 -#define MAC_DCU_MISC_CW_RST_AT_TS_END_DIS_LSB 7 -#define MAC_DCU_MISC_CW_RST_AT_TS_END_DIS_MASK 0x00000080 -#define MAC_DCU_MISC_CW_RST_AT_TS_END_DIS_GET(x) (((x) & 0x00000080) >> 7) -#define MAC_DCU_MISC_CW_RST_AT_TS_END_DIS_SET(x) (((x) << 7) & 0x00000080) -#define MAC_DCU_MISC_FRAG_BURST_WAIT_QCU_EN_MSB 8 -#define MAC_DCU_MISC_FRAG_BURST_WAIT_QCU_EN_LSB 8 -#define MAC_DCU_MISC_FRAG_BURST_WAIT_QCU_EN_MASK 0x00000100 -#define MAC_DCU_MISC_FRAG_BURST_WAIT_QCU_EN_GET(x) (((x) & 0x00000100) >> 8) -#define MAC_DCU_MISC_FRAG_BURST_WAIT_QCU_EN_SET(x) (((x) << 8) & 0x00000100) -#define MAC_DCU_MISC_FRAG_BURST_BKOFF_EN_MSB 9 -#define MAC_DCU_MISC_FRAG_BURST_BKOFF_EN_LSB 9 -#define MAC_DCU_MISC_FRAG_BURST_BKOFF_EN_MASK 0x00000200 -#define MAC_DCU_MISC_FRAG_BURST_BKOFF_EN_GET(x) (((x) & 0x00000200) >> 9) -#define MAC_DCU_MISC_FRAG_BURST_BKOFF_EN_SET(x) (((x) << 9) & 0x00000200) -#define MAC_DCU_MISC_HCF_POLL_EN_MSB 11 -#define MAC_DCU_MISC_HCF_POLL_EN_LSB 11 -#define MAC_DCU_MISC_HCF_POLL_EN_MASK 0x00000800 -#define MAC_DCU_MISC_HCF_POLL_EN_GET(x) (((x) & 0x00000800) >> 11) -#define MAC_DCU_MISC_HCF_POLL_EN_SET(x) (((x) << 11) & 0x00000800) -#define MAC_DCU_MISC_BKOFF_PF_MSB 12 -#define MAC_DCU_MISC_BKOFF_PF_LSB 12 -#define MAC_DCU_MISC_BKOFF_PF_MASK 0x00001000 -#define MAC_DCU_MISC_BKOFF_PF_GET(x) (((x) & 0x00001000) >> 12) -#define MAC_DCU_MISC_BKOFF_PF_SET(x) (((x) << 12) & 0x00001000) -#define MAC_DCU_MISC_VIRT_COLL_POLICY_MSB 15 -#define MAC_DCU_MISC_VIRT_COLL_POLICY_LSB 14 -#define MAC_DCU_MISC_VIRT_COLL_POLICY_MASK 0x0000c000 -#define MAC_DCU_MISC_VIRT_COLL_POLICY_GET(x) (((x) & 0x0000c000) >> 14) -#define MAC_DCU_MISC_VIRT_COLL_POLICY_SET(x) (((x) << 14) & 0x0000c000) -#define MAC_DCU_MISC_IS_BCN_MSB 16 -#define MAC_DCU_MISC_IS_BCN_LSB 16 -#define MAC_DCU_MISC_IS_BCN_MASK 0x00010000 -#define MAC_DCU_MISC_IS_BCN_GET(x) (((x) & 0x00010000) >> 16) -#define MAC_DCU_MISC_IS_BCN_SET(x) (((x) << 16) & 0x00010000) -#define MAC_DCU_MISC_ARB_LOCKOUT_IF_EN_MSB 17 -#define MAC_DCU_MISC_ARB_LOCKOUT_IF_EN_LSB 17 -#define MAC_DCU_MISC_ARB_LOCKOUT_IF_EN_MASK 0x00020000 -#define MAC_DCU_MISC_ARB_LOCKOUT_IF_EN_GET(x) (((x) & 0x00020000) >> 17) -#define MAC_DCU_MISC_ARB_LOCKOUT_IF_EN_SET(x) (((x) << 17) & 0x00020000) -#define MAC_DCU_MISC_LOCKOUT_GBL_EN_MSB 18 -#define MAC_DCU_MISC_LOCKOUT_GBL_EN_LSB 18 -#define MAC_DCU_MISC_LOCKOUT_GBL_EN_MASK 0x00040000 -#define MAC_DCU_MISC_LOCKOUT_GBL_EN_GET(x) (((x) & 0x00040000) >> 18) -#define MAC_DCU_MISC_LOCKOUT_GBL_EN_SET(x) (((x) << 18) & 0x00040000) -#define MAC_DCU_MISC_LOCKOUT_IGNORE_MSB 19 -#define MAC_DCU_MISC_LOCKOUT_IGNORE_LSB 19 -#define MAC_DCU_MISC_LOCKOUT_IGNORE_MASK 0x00080000 -#define MAC_DCU_MISC_LOCKOUT_IGNORE_GET(x) (((x) & 0x00080000) >> 19) -#define MAC_DCU_MISC_LOCKOUT_IGNORE_SET(x) (((x) << 19) & 0x00080000) -#define MAC_DCU_MISC_SEQNUM_FREEZE_MSB 20 -#define MAC_DCU_MISC_SEQNUM_FREEZE_LSB 20 -#define MAC_DCU_MISC_SEQNUM_FREEZE_MASK 0x00100000 -#define MAC_DCU_MISC_SEQNUM_FREEZE_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_DCU_MISC_SEQNUM_FREEZE_SET(x) (((x) << 20) & 0x00100000) -#define MAC_DCU_MISC_POST_BKOFF_SKIP_MSB 21 -#define MAC_DCU_MISC_POST_BKOFF_SKIP_LSB 21 -#define MAC_DCU_MISC_POST_BKOFF_SKIP_MASK 0x00200000 -#define MAC_DCU_MISC_POST_BKOFF_SKIP_GET(x) (((x) & 0x00200000) >> 21) -#define MAC_DCU_MISC_POST_BKOFF_SKIP_SET(x) (((x) << 21) & 0x00200000) -#define MAC_DCU_MISC_VIRT_COLL_CW_INC_EN_MSB 22 -#define MAC_DCU_MISC_VIRT_COLL_CW_INC_EN_LSB 22 -#define MAC_DCU_MISC_VIRT_COLL_CW_INC_EN_MASK 0x00400000 -#define MAC_DCU_MISC_VIRT_COLL_CW_INC_EN_GET(x) (((x) & 0x00400000) >> 22) -#define MAC_DCU_MISC_VIRT_COLL_CW_INC_EN_SET(x) (((x) << 22) & 0x00400000) -#define MAC_DCU_MISC_RETRY_ON_BLOWN_IFS_EN_MSB 23 -#define MAC_DCU_MISC_RETRY_ON_BLOWN_IFS_EN_LSB 23 -#define MAC_DCU_MISC_RETRY_ON_BLOWN_IFS_EN_MASK 0x00800000 -#define MAC_DCU_MISC_RETRY_ON_BLOWN_IFS_EN_GET(x) (((x) & 0x00800000) >> 23) -#define MAC_DCU_MISC_RETRY_ON_BLOWN_IFS_EN_SET(x) (((x) << 23) & 0x00800000) -#define MAC_DCU_MISC_SIFS_BURST_CHAN_BUSY_IGNORE_MSB 24 -#define MAC_DCU_MISC_SIFS_BURST_CHAN_BUSY_IGNORE_LSB 24 -#define MAC_DCU_MISC_SIFS_BURST_CHAN_BUSY_IGNORE_MASK 0x01000000 -#define MAC_DCU_MISC_SIFS_BURST_CHAN_BUSY_IGNORE_GET(x) (((x) & 0x01000000) >> 24) -#define MAC_DCU_MISC_SIFS_BURST_CHAN_BUSY_IGNORE_SET(x) (((x) << 24) & 0x01000000) - -/* macros for MAC_DCU_TXFILTER_DCU1_31_0 */ -#define MAC_DCU_TXFILTER_DCU1_31_0_ADDRESS 0x00001138 -#define MAC_DCU_TXFILTER_DCU1_31_0_OFFSET 0x00001138 -#define MAC_DCU_TXFILTER_DCU1_31_0_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU1_31_0_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU1_31_0_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU1_31_0_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU9_31_0 */ -#define MAC_DCU_TXFILTER_DCU9_31_0_ADDRESS 0x0000113c -#define MAC_DCU_TXFILTER_DCU9_31_0_OFFSET 0x0000113c -#define MAC_DCU_TXFILTER_DCU9_31_0_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU9_31_0_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU9_31_0_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU9_31_0_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_SEQ */ -#define MAC_DCU_SEQ_ADDRESS 0x00001140 -#define MAC_DCU_SEQ_OFFSET 0x00001140 -#define MAC_DCU_SEQ_NUM_MSB 31 -#define MAC_DCU_SEQ_NUM_LSB 0 -#define MAC_DCU_SEQ_NUM_MASK 0xffffffff -#define MAC_DCU_SEQ_NUM_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DCU_SEQ_NUM_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DCU_TXFILTER_DCU1_63_32 */ -#define MAC_DCU_TXFILTER_DCU1_63_32_ADDRESS 0x00001178 -#define MAC_DCU_TXFILTER_DCU1_63_32_OFFSET 0x00001178 -#define MAC_DCU_TXFILTER_DCU1_63_32_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU1_63_32_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU1_63_32_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU1_63_32_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU9_63_32 */ -#define MAC_DCU_TXFILTER_DCU9_63_32_ADDRESS 0x0000117c -#define MAC_DCU_TXFILTER_DCU9_63_32_OFFSET 0x0000117c -#define MAC_DCU_TXFILTER_DCU9_63_32_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU9_63_32_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU9_63_32_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU9_63_32_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU1_95_64 */ -#define MAC_DCU_TXFILTER_DCU1_95_64_ADDRESS 0x000011b8 -#define MAC_DCU_TXFILTER_DCU1_95_64_OFFSET 0x000011b8 -#define MAC_DCU_TXFILTER_DCU1_95_64_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU1_95_64_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU1_95_64_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU1_95_64_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU9_95_64 */ -#define MAC_DCU_TXFILTER_DCU9_95_64_ADDRESS 0x000011bc -#define MAC_DCU_TXFILTER_DCU9_95_64_OFFSET 0x000011bc -#define MAC_DCU_TXFILTER_DCU9_95_64_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU9_95_64_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU9_95_64_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU9_95_64_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU1_127_96 */ -#define MAC_DCU_TXFILTER_DCU1_127_96_ADDRESS 0x000011f8 -#define MAC_DCU_TXFILTER_DCU1_127_96_OFFSET 0x000011f8 -#define MAC_DCU_TXFILTER_DCU1_127_96_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU1_127_96_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU1_127_96_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU1_127_96_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU9_127_96 */ -#define MAC_DCU_TXFILTER_DCU9_127_96_ADDRESS 0x000011fc -#define MAC_DCU_TXFILTER_DCU9_127_96_OFFSET 0x000011fc -#define MAC_DCU_TXFILTER_DCU9_127_96_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU9_127_96_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU9_127_96_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU9_127_96_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU2_31_0 */ -#define MAC_DCU_TXFILTER_DCU2_31_0_ADDRESS 0x00001238 -#define MAC_DCU_TXFILTER_DCU2_31_0_OFFSET 0x00001238 -#define MAC_DCU_TXFILTER_DCU2_31_0_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU2_31_0_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU2_31_0_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU2_31_0_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_PAUSE */ -#define MAC_DCU_PAUSE_ADDRESS 0x00001270 -#define MAC_DCU_PAUSE_OFFSET 0x00001270 -#define MAC_DCU_PAUSE_REQUEST_MSB 9 -#define MAC_DCU_PAUSE_REQUEST_LSB 0 -#define MAC_DCU_PAUSE_REQUEST_MASK 0x000003ff -#define MAC_DCU_PAUSE_REQUEST_GET(x) (((x) & 0x000003ff) >> 0) -#define MAC_DCU_PAUSE_REQUEST_SET(x) (((x) << 0) & 0x000003ff) -#define MAC_DCU_PAUSE_STATUS_MSB 16 -#define MAC_DCU_PAUSE_STATUS_LSB 16 -#define MAC_DCU_PAUSE_STATUS_MASK 0x00010000 -#define MAC_DCU_PAUSE_STATUS_GET(x) (((x) & 0x00010000) >> 16) - -/* macros for MAC_DCU_TXFILTER_DCU2_63_32 */ -#define MAC_DCU_TXFILTER_DCU2_63_32_ADDRESS 0x00001278 -#define MAC_DCU_TXFILTER_DCU2_63_32_OFFSET 0x00001278 -#define MAC_DCU_TXFILTER_DCU2_63_32_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU2_63_32_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU2_63_32_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU2_63_32_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_WOW_KACFG */ -#define MAC_DCU_WOW_KACFG_ADDRESS 0x000012b0 -#define MAC_DCU_WOW_KACFG_OFFSET 0x000012b0 -#define MAC_DCU_WOW_KACFG_TX_EN_MSB 0 -#define MAC_DCU_WOW_KACFG_TX_EN_LSB 0 -#define MAC_DCU_WOW_KACFG_TX_EN_MASK 0x00000001 -#define MAC_DCU_WOW_KACFG_TX_EN_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_DCU_WOW_KACFG_TX_EN_SET(x) (((x) << 0) & 0x00000001) -#define MAC_DCU_WOW_KACFG_TIM_EN_MSB 1 -#define MAC_DCU_WOW_KACFG_TIM_EN_LSB 1 -#define MAC_DCU_WOW_KACFG_TIM_EN_MASK 0x00000002 -#define MAC_DCU_WOW_KACFG_TIM_EN_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_DCU_WOW_KACFG_TIM_EN_SET(x) (((x) << 1) & 0x00000002) -#define MAC_DCU_WOW_KACFG_BCN_CNT_MSB 11 -#define MAC_DCU_WOW_KACFG_BCN_CNT_LSB 4 -#define MAC_DCU_WOW_KACFG_BCN_CNT_MASK 0x00000ff0 -#define MAC_DCU_WOW_KACFG_BCN_CNT_GET(x) (((x) & 0x00000ff0) >> 4) -#define MAC_DCU_WOW_KACFG_BCN_CNT_SET(x) (((x) << 4) & 0x00000ff0) -#define MAC_DCU_WOW_KACFG_RX_TIMEOUT_CNT_MSB 23 -#define MAC_DCU_WOW_KACFG_RX_TIMEOUT_CNT_LSB 12 -#define MAC_DCU_WOW_KACFG_RX_TIMEOUT_CNT_MASK 0x00fff000 -#define MAC_DCU_WOW_KACFG_RX_TIMEOUT_CNT_GET(x) (((x) & 0x00fff000) >> 12) -#define MAC_DCU_WOW_KACFG_RX_TIMEOUT_CNT_SET(x) (((x) << 12) & 0x00fff000) - -/* macros for MAC_DCU_TXFILTER_DCU2_95_64 */ -#define MAC_DCU_TXFILTER_DCU2_95_64_ADDRESS 0x000012b8 -#define MAC_DCU_TXFILTER_DCU2_95_64_OFFSET 0x000012b8 -#define MAC_DCU_TXFILTER_DCU2_95_64_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU2_95_64_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU2_95_64_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU2_95_64_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXSLOT */ -#define MAC_DCU_TXSLOT_ADDRESS 0x000012f0 -#define MAC_DCU_TXSLOT_OFFSET 0x000012f0 -#define MAC_DCU_TXSLOT_MASK_MSB 15 -#define MAC_DCU_TXSLOT_MASK_LSB 0 -#define MAC_DCU_TXSLOT_MASK_MASK 0x0000ffff -#define MAC_DCU_TXSLOT_MASK_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DCU_TXSLOT_MASK_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MAC_DCU_TXFILTER_DCU2_127_96 */ -#define MAC_DCU_TXFILTER_DCU2_127_96_ADDRESS 0x000012f8 -#define MAC_DCU_TXFILTER_DCU2_127_96_OFFSET 0x000012f8 -#define MAC_DCU_TXFILTER_DCU2_127_96_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU2_127_96_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU2_127_96_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU2_127_96_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU3_31_0 */ -#define MAC_DCU_TXFILTER_DCU3_31_0_ADDRESS 0x00001338 -#define MAC_DCU_TXFILTER_DCU3_31_0_OFFSET 0x00001338 -#define MAC_DCU_TXFILTER_DCU3_31_0_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU3_31_0_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU3_31_0_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU3_31_0_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU3_63_32 */ -#define MAC_DCU_TXFILTER_DCU3_63_32_ADDRESS 0x00001378 -#define MAC_DCU_TXFILTER_DCU3_63_32_OFFSET 0x00001378 -#define MAC_DCU_TXFILTER_DCU3_63_32_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU3_63_32_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU3_63_32_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU3_63_32_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU3_95_64 */ -#define MAC_DCU_TXFILTER_DCU3_95_64_ADDRESS 0x000013b8 -#define MAC_DCU_TXFILTER_DCU3_95_64_OFFSET 0x000013b8 -#define MAC_DCU_TXFILTER_DCU3_95_64_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU3_95_64_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU3_95_64_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU3_95_64_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU3_127_96 */ -#define MAC_DCU_TXFILTER_DCU3_127_96_ADDRESS 0x000013f8 -#define MAC_DCU_TXFILTER_DCU3_127_96_OFFSET 0x000013f8 -#define MAC_DCU_TXFILTER_DCU3_127_96_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU3_127_96_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU3_127_96_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU3_127_96_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU4_31_0 */ -#define MAC_DCU_TXFILTER_DCU4_31_0_ADDRESS 0x00001438 -#define MAC_DCU_TXFILTER_DCU4_31_0_OFFSET 0x00001438 -#define MAC_DCU_TXFILTER_DCU4_31_0_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU4_31_0_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU4_31_0_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU4_31_0_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_CLEAR */ -#define MAC_DCU_TXFILTER_CLEAR_ADDRESS 0x0000143c -#define MAC_DCU_TXFILTER_CLEAR_OFFSET 0x0000143c -#define MAC_DCU_TXFILTER_CLEAR_DATA_MSB 31 -#define MAC_DCU_TXFILTER_CLEAR_DATA_LSB 0 -#define MAC_DCU_TXFILTER_CLEAR_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_CLEAR_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DCU_TXFILTER_CLEAR_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DCU_TXFILTER_DCU4_63_32 */ -#define MAC_DCU_TXFILTER_DCU4_63_32_ADDRESS 0x00001478 -#define MAC_DCU_TXFILTER_DCU4_63_32_OFFSET 0x00001478 -#define MAC_DCU_TXFILTER_DCU4_63_32_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU4_63_32_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU4_63_32_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU4_63_32_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_SET */ -#define MAC_DCU_TXFILTER_SET_ADDRESS 0x0000147c -#define MAC_DCU_TXFILTER_SET_OFFSET 0x0000147c -#define MAC_DCU_TXFILTER_SET_DATA_MSB 31 -#define MAC_DCU_TXFILTER_SET_DATA_LSB 0 -#define MAC_DCU_TXFILTER_SET_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_SET_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DCU_TXFILTER_SET_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DCU_TXFILTER_DCU4_95_64 */ -#define MAC_DCU_TXFILTER_DCU4_95_64_ADDRESS 0x000014b8 -#define MAC_DCU_TXFILTER_DCU4_95_64_OFFSET 0x000014b8 -#define MAC_DCU_TXFILTER_DCU4_95_64_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU4_95_64_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU4_95_64_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU4_95_64_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU4_127_96 */ -#define MAC_DCU_TXFILTER_DCU4_127_96_ADDRESS 0x000014f8 -#define MAC_DCU_TXFILTER_DCU4_127_96_OFFSET 0x000014f8 -#define MAC_DCU_TXFILTER_DCU4_127_96_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU4_127_96_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU4_127_96_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU4_127_96_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU5_31_0 */ -#define MAC_DCU_TXFILTER_DCU5_31_0_ADDRESS 0x00001538 -#define MAC_DCU_TXFILTER_DCU5_31_0_OFFSET 0x00001538 -#define MAC_DCU_TXFILTER_DCU5_31_0_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU5_31_0_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU5_31_0_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU5_31_0_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU5_63_32 */ -#define MAC_DCU_TXFILTER_DCU5_63_32_ADDRESS 0x00001578 -#define MAC_DCU_TXFILTER_DCU5_63_32_OFFSET 0x00001578 -#define MAC_DCU_TXFILTER_DCU5_63_32_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU5_63_32_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU5_63_32_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU5_63_32_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU5_95_64 */ -#define MAC_DCU_TXFILTER_DCU5_95_64_ADDRESS 0x000015b8 -#define MAC_DCU_TXFILTER_DCU5_95_64_OFFSET 0x000015b8 -#define MAC_DCU_TXFILTER_DCU5_95_64_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU5_95_64_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU5_95_64_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU5_95_64_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU5_127_96 */ -#define MAC_DCU_TXFILTER_DCU5_127_96_ADDRESS 0x000015f8 -#define MAC_DCU_TXFILTER_DCU5_127_96_OFFSET 0x000015f8 -#define MAC_DCU_TXFILTER_DCU5_127_96_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU5_127_96_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU5_127_96_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU5_127_96_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU6_31_0 */ -#define MAC_DCU_TXFILTER_DCU6_31_0_ADDRESS 0x00001638 -#define MAC_DCU_TXFILTER_DCU6_31_0_OFFSET 0x00001638 -#define MAC_DCU_TXFILTER_DCU6_31_0_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU6_31_0_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU6_31_0_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU6_31_0_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU6_63_32 */ -#define MAC_DCU_TXFILTER_DCU6_63_32_ADDRESS 0x00001678 -#define MAC_DCU_TXFILTER_DCU6_63_32_OFFSET 0x00001678 -#define MAC_DCU_TXFILTER_DCU6_63_32_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU6_63_32_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU6_63_32_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU6_63_32_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU6_95_64 */ -#define MAC_DCU_TXFILTER_DCU6_95_64_ADDRESS 0x000016b8 -#define MAC_DCU_TXFILTER_DCU6_95_64_OFFSET 0x000016b8 -#define MAC_DCU_TXFILTER_DCU6_95_64_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU6_95_64_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU6_95_64_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU6_95_64_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU6_127_96 */ -#define MAC_DCU_TXFILTER_DCU6_127_96_ADDRESS 0x000016f8 -#define MAC_DCU_TXFILTER_DCU6_127_96_OFFSET 0x000016f8 -#define MAC_DCU_TXFILTER_DCU6_127_96_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU6_127_96_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU6_127_96_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU6_127_96_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU7_31_0 */ -#define MAC_DCU_TXFILTER_DCU7_31_0_ADDRESS 0x00001738 -#define MAC_DCU_TXFILTER_DCU7_31_0_OFFSET 0x00001738 -#define MAC_DCU_TXFILTER_DCU7_31_0_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU7_31_0_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU7_31_0_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU7_31_0_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU7_63_32 */ -#define MAC_DCU_TXFILTER_DCU7_63_32_ADDRESS 0x00001778 -#define MAC_DCU_TXFILTER_DCU7_63_32_OFFSET 0x00001778 -#define MAC_DCU_TXFILTER_DCU7_63_32_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU7_63_32_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU7_63_32_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU7_63_32_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU7_95_64 */ -#define MAC_DCU_TXFILTER_DCU7_95_64_ADDRESS 0x000017b8 -#define MAC_DCU_TXFILTER_DCU7_95_64_OFFSET 0x000017b8 -#define MAC_DCU_TXFILTER_DCU7_95_64_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU7_95_64_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU7_95_64_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU7_95_64_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DCU_TXFILTER_DCU7_127_96 */ -#define MAC_DCU_TXFILTER_DCU7_127_96_ADDRESS 0x000017f8 -#define MAC_DCU_TXFILTER_DCU7_127_96_OFFSET 0x000017f8 -#define MAC_DCU_TXFILTER_DCU7_127_96_DATA_MSB 31 -#define MAC_DCU_TXFILTER_DCU7_127_96_DATA_LSB 0 -#define MAC_DCU_TXFILTER_DCU7_127_96_DATA_MASK 0xffffffff -#define MAC_DCU_TXFILTER_DCU7_127_96_DATA_GET(x) (((x) & 0xffffffff) >> 0) - - -#ifndef __ASSEMBLER__ - -typedef struct wmac_dcu_reg_reg_s { - volatile char pad__0[0x1000]; /* 0x0 - 0x1000 */ - volatile unsigned int MAC_DCU_QCUMASK[10]; /* 0x1000 - 0x1028 */ - volatile char pad__1[0x8]; /* 0x1028 - 0x1030 */ - volatile unsigned int MAC_DCU_GBL_IFS_SIFS; /* 0x1030 - 0x1034 */ - volatile char pad__2[0x4]; /* 0x1034 - 0x1038 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU0_31_0; /* 0x1038 - 0x103c */ - volatile unsigned int MAC_DCU_TXFILTER_DCU8_31_0; /* 0x103c - 0x1040 */ - volatile unsigned int MAC_DCU_LCL_IFS[10]; /* 0x1040 - 0x1068 */ - volatile char pad__3[0x8]; /* 0x1068 - 0x1070 */ - volatile unsigned int MAC_DCU_GBL_IFS_SLOT; /* 0x1070 - 0x1074 */ - volatile char pad__4[0x4]; /* 0x1074 - 0x1078 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU0_63_32; /* 0x1078 - 0x107c */ - volatile unsigned int MAC_DCU_TXFILTER_DCU8_63_32; /* 0x107c - 0x1080 */ - volatile unsigned int MAC_DCU_RETRY_LIMIT[10]; /* 0x1080 - 0x10a8 */ - volatile char pad__5[0x8]; /* 0x10a8 - 0x10b0 */ - volatile unsigned int MAC_DCU_GBL_IFS_EIFS; /* 0x10b0 - 0x10b4 */ - volatile char pad__6[0x4]; /* 0x10b4 - 0x10b8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU0_95_64; /* 0x10b8 - 0x10bc */ - volatile unsigned int MAC_DCU_TXFILTER_DCU8_95_64; /* 0x10bc - 0x10c0 */ - volatile unsigned int MAC_DCU_CHANNEL_TIME[10]; /* 0x10c0 - 0x10e8 */ - volatile char pad__7[0x8]; /* 0x10e8 - 0x10f0 */ - volatile unsigned int MAC_DCU_GBL_IFS_MISC; /* 0x10f0 - 0x10f4 */ - volatile char pad__8[0x4]; /* 0x10f4 - 0x10f8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU0_127_96; /* 0x10f8 - 0x10fc */ - volatile unsigned int MAC_DCU_TXFILTER_DCU8_127_96; /* 0x10fc - 0x1100 */ - volatile unsigned int MAC_DCU_MISC[10]; /* 0x1100 - 0x1128 */ - volatile char pad__9[0x10]; /* 0x1128 - 0x1138 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU1_31_0; /* 0x1138 - 0x113c */ - volatile unsigned int MAC_DCU_TXFILTER_DCU9_31_0; /* 0x113c - 0x1140 */ - volatile unsigned int MAC_DCU_SEQ; /* 0x1140 - 0x1144 */ - volatile char pad__10[0x34]; /* 0x1144 - 0x1178 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU1_63_32; /* 0x1178 - 0x117c */ - volatile unsigned int MAC_DCU_TXFILTER_DCU9_63_32; /* 0x117c - 0x1180 */ - volatile char pad__11[0x38]; /* 0x1180 - 0x11b8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU1_95_64; /* 0x11b8 - 0x11bc */ - volatile unsigned int MAC_DCU_TXFILTER_DCU9_95_64; /* 0x11bc - 0x11c0 */ - volatile char pad__12[0x38]; /* 0x11c0 - 0x11f8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU1_127_96; /* 0x11f8 - 0x11fc */ - volatile unsigned int MAC_DCU_TXFILTER_DCU9_127_96; /* 0x11fc - 0x1200 */ - volatile char pad__13[0x38]; /* 0x1200 - 0x1238 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU2_31_0; /* 0x1238 - 0x123c */ - volatile char pad__14[0x34]; /* 0x123c - 0x1270 */ - volatile unsigned int MAC_DCU_PAUSE; /* 0x1270 - 0x1274 */ - volatile char pad__15[0x4]; /* 0x1274 - 0x1278 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU2_63_32; /* 0x1278 - 0x127c */ - volatile char pad__16[0x34]; /* 0x127c - 0x12b0 */ - volatile unsigned int MAC_DCU_WOW_KACFG; /* 0x12b0 - 0x12b4 */ - volatile char pad__17[0x4]; /* 0x12b4 - 0x12b8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU2_95_64; /* 0x12b8 - 0x12bc */ - volatile char pad__18[0x34]; /* 0x12bc - 0x12f0 */ - volatile unsigned int MAC_DCU_TXSLOT; /* 0x12f0 - 0x12f4 */ - volatile char pad__19[0x4]; /* 0x12f4 - 0x12f8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU2_127_96; /* 0x12f8 - 0x12fc */ - volatile char pad__20[0x3c]; /* 0x12fc - 0x1338 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU3_31_0; /* 0x1338 - 0x133c */ - volatile char pad__21[0x3c]; /* 0x133c - 0x1378 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU3_63_32; /* 0x1378 - 0x137c */ - volatile char pad__22[0x3c]; /* 0x137c - 0x13b8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU3_95_64; /* 0x13b8 - 0x13bc */ - volatile char pad__23[0x3c]; /* 0x13bc - 0x13f8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU3_127_96; /* 0x13f8 - 0x13fc */ - volatile char pad__24[0x3c]; /* 0x13fc - 0x1438 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU4_31_0; /* 0x1438 - 0x143c */ - volatile unsigned int MAC_DCU_TXFILTER_CLEAR; /* 0x143c - 0x1440 */ - volatile char pad__25[0x38]; /* 0x1440 - 0x1478 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU4_63_32; /* 0x1478 - 0x147c */ - volatile unsigned int MAC_DCU_TXFILTER_SET; /* 0x147c - 0x1480 */ - volatile char pad__26[0x38]; /* 0x1480 - 0x14b8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU4_95_64; /* 0x14b8 - 0x14bc */ - volatile char pad__27[0x3c]; /* 0x14bc - 0x14f8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU4_127_96; /* 0x14f8 - 0x14fc */ - volatile char pad__28[0x3c]; /* 0x14fc - 0x1538 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU5_31_0; /* 0x1538 - 0x153c */ - volatile char pad__29[0x3c]; /* 0x153c - 0x1578 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU5_63_32; /* 0x1578 - 0x157c */ - volatile char pad__30[0x3c]; /* 0x157c - 0x15b8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU5_95_64; /* 0x15b8 - 0x15bc */ - volatile char pad__31[0x3c]; /* 0x15bc - 0x15f8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU5_127_96; /* 0x15f8 - 0x15fc */ - volatile char pad__32[0x3c]; /* 0x15fc - 0x1638 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU6_31_0; /* 0x1638 - 0x163c */ - volatile char pad__33[0x3c]; /* 0x163c - 0x1678 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU6_63_32; /* 0x1678 - 0x167c */ - volatile char pad__34[0x3c]; /* 0x167c - 0x16b8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU6_95_64; /* 0x16b8 - 0x16bc */ - volatile char pad__35[0x3c]; /* 0x16bc - 0x16f8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU6_127_96; /* 0x16f8 - 0x16fc */ - volatile char pad__36[0x3c]; /* 0x16fc - 0x1738 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU7_31_0; /* 0x1738 - 0x173c */ - volatile char pad__37[0x3c]; /* 0x173c - 0x1778 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU7_63_32; /* 0x1778 - 0x177c */ - volatile char pad__38[0x3c]; /* 0x177c - 0x17b8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU7_95_64; /* 0x17b8 - 0x17bc */ - volatile char pad__39[0x3c]; /* 0x17bc - 0x17f8 */ - volatile unsigned int MAC_DCU_TXFILTER_DCU7_127_96; /* 0x17f8 - 0x17fc */ -} wmac_dcu_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _WMAC_DCU_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_dma_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_dma_reg.h deleted file mode 100644 index 59514f19a55b..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_dma_reg.h +++ /dev/null @@ -1,1000 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _WMAC_DMA_REG_REG_H_ -#define _WMAC_DMA_REG_REG_H_ - - -/* macros for MAC_DMA_CR */ -#define MAC_DMA_CR_ADDRESS 0x00000008 -#define MAC_DMA_CR_OFFSET 0x00000008 -#define MAC_DMA_CR_RXE_LP_MSB 2 -#define MAC_DMA_CR_RXE_LP_LSB 2 -#define MAC_DMA_CR_RXE_LP_MASK 0x00000004 -#define MAC_DMA_CR_RXE_LP_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_DMA_CR_RXE_HP_MSB 3 -#define MAC_DMA_CR_RXE_HP_LSB 3 -#define MAC_DMA_CR_RXE_HP_MASK 0x00000008 -#define MAC_DMA_CR_RXE_HP_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_DMA_CR_RXD_MSB 5 -#define MAC_DMA_CR_RXD_LSB 5 -#define MAC_DMA_CR_RXD_MASK 0x00000020 -#define MAC_DMA_CR_RXD_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_DMA_CR_RXD_SET(x) (((x) << 5) & 0x00000020) -#define MAC_DMA_CR_SWI_MSB 6 -#define MAC_DMA_CR_SWI_LSB 6 -#define MAC_DMA_CR_SWI_MASK 0x00000040 -#define MAC_DMA_CR_SWI_GET(x) (((x) & 0x00000040) >> 6) - -/* macros for MAC_DMA_CFG */ -#define MAC_DMA_CFG_ADDRESS 0x00000014 -#define MAC_DMA_CFG_OFFSET 0x00000014 -#define MAC_DMA_CFG_BE_MODE_XMIT_DESC_MSB 0 -#define MAC_DMA_CFG_BE_MODE_XMIT_DESC_LSB 0 -#define MAC_DMA_CFG_BE_MODE_XMIT_DESC_MASK 0x00000001 -#define MAC_DMA_CFG_BE_MODE_XMIT_DESC_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_DMA_CFG_BE_MODE_XMIT_DESC_SET(x) (((x) << 0) & 0x00000001) -#define MAC_DMA_CFG_BE_MODE_XMIT_DATA_MSB 1 -#define MAC_DMA_CFG_BE_MODE_XMIT_DATA_LSB 1 -#define MAC_DMA_CFG_BE_MODE_XMIT_DATA_MASK 0x00000002 -#define MAC_DMA_CFG_BE_MODE_XMIT_DATA_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_DMA_CFG_BE_MODE_XMIT_DATA_SET(x) (((x) << 1) & 0x00000002) -#define MAC_DMA_CFG_BE_MODE_RCV_DESC_MSB 2 -#define MAC_DMA_CFG_BE_MODE_RCV_DESC_LSB 2 -#define MAC_DMA_CFG_BE_MODE_RCV_DESC_MASK 0x00000004 -#define MAC_DMA_CFG_BE_MODE_RCV_DESC_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_DMA_CFG_BE_MODE_RCV_DESC_SET(x) (((x) << 2) & 0x00000004) -#define MAC_DMA_CFG_BE_MODE_RCV_DATA_MSB 3 -#define MAC_DMA_CFG_BE_MODE_RCV_DATA_LSB 3 -#define MAC_DMA_CFG_BE_MODE_RCV_DATA_MASK 0x00000008 -#define MAC_DMA_CFG_BE_MODE_RCV_DATA_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_DMA_CFG_BE_MODE_RCV_DATA_SET(x) (((x) << 3) & 0x00000008) -#define MAC_DMA_CFG_BE_MODE_MMR_MSB 4 -#define MAC_DMA_CFG_BE_MODE_MMR_LSB 4 -#define MAC_DMA_CFG_BE_MODE_MMR_MASK 0x00000010 -#define MAC_DMA_CFG_BE_MODE_MMR_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_DMA_CFG_BE_MODE_MMR_SET(x) (((x) << 4) & 0x00000010) -#define MAC_DMA_CFG_ADHOC_MSB 5 -#define MAC_DMA_CFG_ADHOC_LSB 5 -#define MAC_DMA_CFG_ADHOC_MASK 0x00000020 -#define MAC_DMA_CFG_ADHOC_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_DMA_CFG_ADHOC_SET(x) (((x) << 5) & 0x00000020) -#define MAC_DMA_CFG_PHY_OK_MSB 8 -#define MAC_DMA_CFG_PHY_OK_LSB 8 -#define MAC_DMA_CFG_PHY_OK_MASK 0x00000100 -#define MAC_DMA_CFG_PHY_OK_GET(x) (((x) & 0x00000100) >> 8) -#define MAC_DMA_CFG_EEPROM_BUSY_MSB 9 -#define MAC_DMA_CFG_EEPROM_BUSY_LSB 9 -#define MAC_DMA_CFG_EEPROM_BUSY_MASK 0x00000200 -#define MAC_DMA_CFG_EEPROM_BUSY_GET(x) (((x) & 0x00000200) >> 9) -#define MAC_DMA_CFG_CLKGATE_DIS_MSB 10 -#define MAC_DMA_CFG_CLKGATE_DIS_LSB 10 -#define MAC_DMA_CFG_CLKGATE_DIS_MASK 0x00000400 -#define MAC_DMA_CFG_CLKGATE_DIS_GET(x) (((x) & 0x00000400) >> 10) -#define MAC_DMA_CFG_CLKGATE_DIS_SET(x) (((x) << 10) & 0x00000400) -#define MAC_DMA_CFG_HALT_REQ_MSB 11 -#define MAC_DMA_CFG_HALT_REQ_LSB 11 -#define MAC_DMA_CFG_HALT_REQ_MASK 0x00000800 -#define MAC_DMA_CFG_HALT_REQ_GET(x) (((x) & 0x00000800) >> 11) -#define MAC_DMA_CFG_HALT_REQ_SET(x) (((x) << 11) & 0x00000800) -#define MAC_DMA_CFG_HALT_ACK_MSB 12 -#define MAC_DMA_CFG_HALT_ACK_LSB 12 -#define MAC_DMA_CFG_HALT_ACK_MASK 0x00001000 -#define MAC_DMA_CFG_HALT_ACK_GET(x) (((x) & 0x00001000) >> 12) -#define MAC_DMA_CFG_REQ_Q_FULL_THRESHOLD_MSB 18 -#define MAC_DMA_CFG_REQ_Q_FULL_THRESHOLD_LSB 17 -#define MAC_DMA_CFG_REQ_Q_FULL_THRESHOLD_MASK 0x00060000 -#define MAC_DMA_CFG_REQ_Q_FULL_THRESHOLD_GET(x) (((x) & 0x00060000) >> 17) -#define MAC_DMA_CFG_REQ_Q_FULL_THRESHOLD_SET(x) (((x) << 17) & 0x00060000) -#define MAC_DMA_CFG_MISSING_TX_INTR_FIX_ENABLE_MSB 19 -#define MAC_DMA_CFG_MISSING_TX_INTR_FIX_ENABLE_LSB 19 -#define MAC_DMA_CFG_MISSING_TX_INTR_FIX_ENABLE_MASK 0x00080000 -#define MAC_DMA_CFG_MISSING_TX_INTR_FIX_ENABLE_GET(x) (((x) & 0x00080000) >> 19) -#define MAC_DMA_CFG_MISSING_TX_INTR_FIX_ENABLE_SET(x) (((x) << 19) & 0x00080000) -#define MAC_DMA_CFG_LEGACY_INT_MIT_MODE_ENABLE_MSB 20 -#define MAC_DMA_CFG_LEGACY_INT_MIT_MODE_ENABLE_LSB 20 -#define MAC_DMA_CFG_LEGACY_INT_MIT_MODE_ENABLE_MASK 0x00100000 -#define MAC_DMA_CFG_LEGACY_INT_MIT_MODE_ENABLE_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_DMA_CFG_LEGACY_INT_MIT_MODE_ENABLE_SET(x) (((x) << 20) & 0x00100000) -#define MAC_DMA_CFG_RESET_INT_MIT_CNTRS_MSB 21 -#define MAC_DMA_CFG_RESET_INT_MIT_CNTRS_LSB 21 -#define MAC_DMA_CFG_RESET_INT_MIT_CNTRS_MASK 0x00200000 -#define MAC_DMA_CFG_RESET_INT_MIT_CNTRS_GET(x) (((x) & 0x00200000) >> 21) -#define MAC_DMA_CFG_RESET_INT_MIT_CNTRS_SET(x) (((x) << 21) & 0x00200000) - -/* macros for MAC_DMA_RXBUFPTR_THRESH */ -#define MAC_DMA_RXBUFPTR_THRESH_ADDRESS 0x00000018 -#define MAC_DMA_RXBUFPTR_THRESH_OFFSET 0x00000018 -#define MAC_DMA_RXBUFPTR_THRESH_HP_DATA_MSB 3 -#define MAC_DMA_RXBUFPTR_THRESH_HP_DATA_LSB 0 -#define MAC_DMA_RXBUFPTR_THRESH_HP_DATA_MASK 0x0000000f -#define MAC_DMA_RXBUFPTR_THRESH_HP_DATA_GET(x) (((x) & 0x0000000f) >> 0) -#define MAC_DMA_RXBUFPTR_THRESH_HP_DATA_SET(x) (((x) << 0) & 0x0000000f) -#define MAC_DMA_RXBUFPTR_THRESH_LP_DATA_MSB 14 -#define MAC_DMA_RXBUFPTR_THRESH_LP_DATA_LSB 8 -#define MAC_DMA_RXBUFPTR_THRESH_LP_DATA_MASK 0x00007f00 -#define MAC_DMA_RXBUFPTR_THRESH_LP_DATA_GET(x) (((x) & 0x00007f00) >> 8) -#define MAC_DMA_RXBUFPTR_THRESH_LP_DATA_SET(x) (((x) << 8) & 0x00007f00) - -/* macros for MAC_DMA_TXDPPTR_THRESH */ -#define MAC_DMA_TXDPPTR_THRESH_ADDRESS 0x0000001c -#define MAC_DMA_TXDPPTR_THRESH_OFFSET 0x0000001c -#define MAC_DMA_TXDPPTR_THRESH_DATA_MSB 3 -#define MAC_DMA_TXDPPTR_THRESH_DATA_LSB 0 -#define MAC_DMA_TXDPPTR_THRESH_DATA_MASK 0x0000000f -#define MAC_DMA_TXDPPTR_THRESH_DATA_GET(x) (((x) & 0x0000000f) >> 0) -#define MAC_DMA_TXDPPTR_THRESH_DATA_SET(x) (((x) << 0) & 0x0000000f) - -/* macros for MAC_DMA_MIRT */ -#define MAC_DMA_MIRT_ADDRESS 0x00000020 -#define MAC_DMA_MIRT_OFFSET 0x00000020 -#define MAC_DMA_MIRT_RATE_THRESH_MSB 15 -#define MAC_DMA_MIRT_RATE_THRESH_LSB 0 -#define MAC_DMA_MIRT_RATE_THRESH_MASK 0x0000ffff -#define MAC_DMA_MIRT_RATE_THRESH_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DMA_MIRT_RATE_THRESH_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MAC_DMA_GLOBAL_IER */ -#define MAC_DMA_GLOBAL_IER_ADDRESS 0x00000024 -#define MAC_DMA_GLOBAL_IER_OFFSET 0x00000024 -#define MAC_DMA_GLOBAL_IER_ENABLE_MSB 0 -#define MAC_DMA_GLOBAL_IER_ENABLE_LSB 0 -#define MAC_DMA_GLOBAL_IER_ENABLE_MASK 0x00000001 -#define MAC_DMA_GLOBAL_IER_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_DMA_GLOBAL_IER_ENABLE_SET(x) (((x) << 0) & 0x00000001) - -/* macros for MAC_DMA_TIMT_0 */ -#define MAC_DMA_TIMT_0_ADDRESS 0x00000028 -#define MAC_DMA_TIMT_0_OFFSET 0x00000028 -#define MAC_DMA_TIMT_0_TX_LAST_PKT_THRESH_MSB 15 -#define MAC_DMA_TIMT_0_TX_LAST_PKT_THRESH_LSB 0 -#define MAC_DMA_TIMT_0_TX_LAST_PKT_THRESH_MASK 0x0000ffff -#define MAC_DMA_TIMT_0_TX_LAST_PKT_THRESH_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DMA_TIMT_0_TX_LAST_PKT_THRESH_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_DMA_TIMT_0_TX_FIRST_PKT_THRESH_MSB 31 -#define MAC_DMA_TIMT_0_TX_FIRST_PKT_THRESH_LSB 16 -#define MAC_DMA_TIMT_0_TX_FIRST_PKT_THRESH_MASK 0xffff0000 -#define MAC_DMA_TIMT_0_TX_FIRST_PKT_THRESH_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_DMA_TIMT_0_TX_FIRST_PKT_THRESH_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_DMA_RIMT */ -#define MAC_DMA_RIMT_ADDRESS 0x0000002c -#define MAC_DMA_RIMT_OFFSET 0x0000002c -#define MAC_DMA_RIMT_RX_LAST_PKT_THRESH_MSB 15 -#define MAC_DMA_RIMT_RX_LAST_PKT_THRESH_LSB 0 -#define MAC_DMA_RIMT_RX_LAST_PKT_THRESH_MASK 0x0000ffff -#define MAC_DMA_RIMT_RX_LAST_PKT_THRESH_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DMA_RIMT_RX_LAST_PKT_THRESH_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_DMA_RIMT_RX_FIRST_PKT_THRESH_MSB 31 -#define MAC_DMA_RIMT_RX_FIRST_PKT_THRESH_LSB 16 -#define MAC_DMA_RIMT_RX_FIRST_PKT_THRESH_MASK 0xffff0000 -#define MAC_DMA_RIMT_RX_FIRST_PKT_THRESH_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_DMA_RIMT_RX_FIRST_PKT_THRESH_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_DMA_TXCFG */ -#define MAC_DMA_TXCFG_ADDRESS 0x00000030 -#define MAC_DMA_TXCFG_OFFSET 0x00000030 -#define MAC_DMA_TXCFG_DMA_SIZE_MSB 2 -#define MAC_DMA_TXCFG_DMA_SIZE_LSB 0 -#define MAC_DMA_TXCFG_DMA_SIZE_MASK 0x00000007 -#define MAC_DMA_TXCFG_DMA_SIZE_GET(x) (((x) & 0x00000007) >> 0) -#define MAC_DMA_TXCFG_DMA_SIZE_SET(x) (((x) << 0) & 0x00000007) -#define MAC_DMA_TXCFG_TRIGLVL_MSB 9 -#define MAC_DMA_TXCFG_TRIGLVL_LSB 4 -#define MAC_DMA_TXCFG_TRIGLVL_MASK 0x000003f0 -#define MAC_DMA_TXCFG_TRIGLVL_GET(x) (((x) & 0x000003f0) >> 4) -#define MAC_DMA_TXCFG_TRIGLVL_SET(x) (((x) << 4) & 0x000003f0) -#define MAC_DMA_TXCFG_JUMBO_EN_MSB 10 -#define MAC_DMA_TXCFG_JUMBO_EN_LSB 10 -#define MAC_DMA_TXCFG_JUMBO_EN_MASK 0x00000400 -#define MAC_DMA_TXCFG_JUMBO_EN_GET(x) (((x) & 0x00000400) >> 10) -#define MAC_DMA_TXCFG_JUMBO_EN_SET(x) (((x) << 10) & 0x00000400) -#define MAC_DMA_TXCFG_BCN_PAST_ATIM_DIS_MSB 11 -#define MAC_DMA_TXCFG_BCN_PAST_ATIM_DIS_LSB 11 -#define MAC_DMA_TXCFG_BCN_PAST_ATIM_DIS_MASK 0x00000800 -#define MAC_DMA_TXCFG_BCN_PAST_ATIM_DIS_GET(x) (((x) & 0x00000800) >> 11) -#define MAC_DMA_TXCFG_BCN_PAST_ATIM_DIS_SET(x) (((x) << 11) & 0x00000800) -#define MAC_DMA_TXCFG_ATIM_DEFER_DIS_MSB 12 -#define MAC_DMA_TXCFG_ATIM_DEFER_DIS_LSB 12 -#define MAC_DMA_TXCFG_ATIM_DEFER_DIS_MASK 0x00001000 -#define MAC_DMA_TXCFG_ATIM_DEFER_DIS_GET(x) (((x) & 0x00001000) >> 12) -#define MAC_DMA_TXCFG_ATIM_DEFER_DIS_SET(x) (((x) << 12) & 0x00001000) -#define MAC_DMA_TXCFG_RTCI_DIS_MSB 14 -#define MAC_DMA_TXCFG_RTCI_DIS_LSB 14 -#define MAC_DMA_TXCFG_RTCI_DIS_MASK 0x00004000 -#define MAC_DMA_TXCFG_RTCI_DIS_GET(x) (((x) & 0x00004000) >> 14) -#define MAC_DMA_TXCFG_RTCI_DIS_SET(x) (((x) << 14) & 0x00004000) -#define MAC_DMA_TXCFG_DIS_RETRY_UNDERRUN_MSB 17 -#define MAC_DMA_TXCFG_DIS_RETRY_UNDERRUN_LSB 17 -#define MAC_DMA_TXCFG_DIS_RETRY_UNDERRUN_MASK 0x00020000 -#define MAC_DMA_TXCFG_DIS_RETRY_UNDERRUN_GET(x) (((x) & 0x00020000) >> 17) -#define MAC_DMA_TXCFG_DIS_RETRY_UNDERRUN_SET(x) (((x) << 17) & 0x00020000) -#define MAC_DMA_TXCFG_DIS_CW_INC_QUIET_COLL_MSB 18 -#define MAC_DMA_TXCFG_DIS_CW_INC_QUIET_COLL_LSB 18 -#define MAC_DMA_TXCFG_DIS_CW_INC_QUIET_COLL_MASK 0x00040000 -#define MAC_DMA_TXCFG_DIS_CW_INC_QUIET_COLL_GET(x) (((x) & 0x00040000) >> 18) -#define MAC_DMA_TXCFG_DIS_CW_INC_QUIET_COLL_SET(x) (((x) << 18) & 0x00040000) -#define MAC_DMA_TXCFG_RTS_FAIL_EXCESSIVE_RETRIES_MSB 19 -#define MAC_DMA_TXCFG_RTS_FAIL_EXCESSIVE_RETRIES_LSB 19 -#define MAC_DMA_TXCFG_RTS_FAIL_EXCESSIVE_RETRIES_MASK 0x00080000 -#define MAC_DMA_TXCFG_RTS_FAIL_EXCESSIVE_RETRIES_GET(x) (((x) & 0x00080000) >> 19) -#define MAC_DMA_TXCFG_RTS_FAIL_EXCESSIVE_RETRIES_SET(x) (((x) << 19) & 0x00080000) - -/* macros for MAC_DMA_RXCFG */ -#define MAC_DMA_RXCFG_ADDRESS 0x00000034 -#define MAC_DMA_RXCFG_OFFSET 0x00000034 -#define MAC_DMA_RXCFG_DMA_SIZE_MSB 2 -#define MAC_DMA_RXCFG_DMA_SIZE_LSB 0 -#define MAC_DMA_RXCFG_DMA_SIZE_MASK 0x00000007 -#define MAC_DMA_RXCFG_DMA_SIZE_GET(x) (((x) & 0x00000007) >> 0) -#define MAC_DMA_RXCFG_DMA_SIZE_SET(x) (((x) << 0) & 0x00000007) -#define MAC_DMA_RXCFG_ZERO_LEN_DMA_EN_MSB 4 -#define MAC_DMA_RXCFG_ZERO_LEN_DMA_EN_LSB 3 -#define MAC_DMA_RXCFG_ZERO_LEN_DMA_EN_MASK 0x00000018 -#define MAC_DMA_RXCFG_ZERO_LEN_DMA_EN_GET(x) (((x) & 0x00000018) >> 3) -#define MAC_DMA_RXCFG_ZERO_LEN_DMA_EN_SET(x) (((x) << 3) & 0x00000018) -#define MAC_DMA_RXCFG_JUMBO_EN_MSB 5 -#define MAC_DMA_RXCFG_JUMBO_EN_LSB 5 -#define MAC_DMA_RXCFG_JUMBO_EN_MASK 0x00000020 -#define MAC_DMA_RXCFG_JUMBO_EN_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_DMA_RXCFG_JUMBO_EN_SET(x) (((x) << 5) & 0x00000020) -#define MAC_DMA_RXCFG_JUMBO_WRAP_EN_MSB 6 -#define MAC_DMA_RXCFG_JUMBO_WRAP_EN_LSB 6 -#define MAC_DMA_RXCFG_JUMBO_WRAP_EN_MASK 0x00000040 -#define MAC_DMA_RXCFG_JUMBO_WRAP_EN_GET(x) (((x) & 0x00000040) >> 6) -#define MAC_DMA_RXCFG_JUMBO_WRAP_EN_SET(x) (((x) << 6) & 0x00000040) -#define MAC_DMA_RXCFG_SLEEP_RX_PEND_EN_MSB 7 -#define MAC_DMA_RXCFG_SLEEP_RX_PEND_EN_LSB 7 -#define MAC_DMA_RXCFG_SLEEP_RX_PEND_EN_MASK 0x00000080 -#define MAC_DMA_RXCFG_SLEEP_RX_PEND_EN_GET(x) (((x) & 0x00000080) >> 7) -#define MAC_DMA_RXCFG_SLEEP_RX_PEND_EN_SET(x) (((x) << 7) & 0x00000080) - -/* macros for MAC_DMA_RXJLA */ -#define MAC_DMA_RXJLA_ADDRESS 0x00000038 -#define MAC_DMA_RXJLA_OFFSET 0x00000038 -#define MAC_DMA_RXJLA_DATA_MSB 31 -#define MAC_DMA_RXJLA_DATA_LSB 2 -#define MAC_DMA_RXJLA_DATA_MASK 0xfffffffc -#define MAC_DMA_RXJLA_DATA_GET(x) (((x) & 0xfffffffc) >> 2) - -/* macros for MAC_DMA_MIBC */ -#define MAC_DMA_MIBC_ADDRESS 0x00000040 -#define MAC_DMA_MIBC_OFFSET 0x00000040 -#define MAC_DMA_MIBC_WARNING_MSB 0 -#define MAC_DMA_MIBC_WARNING_LSB 0 -#define MAC_DMA_MIBC_WARNING_MASK 0x00000001 -#define MAC_DMA_MIBC_WARNING_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_DMA_MIBC_FREEZE_MSB 1 -#define MAC_DMA_MIBC_FREEZE_LSB 1 -#define MAC_DMA_MIBC_FREEZE_MASK 0x00000002 -#define MAC_DMA_MIBC_FREEZE_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_DMA_MIBC_FREEZE_SET(x) (((x) << 1) & 0x00000002) -#define MAC_DMA_MIBC_CLEAR_MSB 2 -#define MAC_DMA_MIBC_CLEAR_LSB 2 -#define MAC_DMA_MIBC_CLEAR_MASK 0x00000004 -#define MAC_DMA_MIBC_CLEAR_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_DMA_MIBC_CLEAR_SET(x) (((x) << 2) & 0x00000004) -#define MAC_DMA_MIBC_STROBE_MSB 3 -#define MAC_DMA_MIBC_STROBE_LSB 3 -#define MAC_DMA_MIBC_STROBE_MASK 0x00000008 -#define MAC_DMA_MIBC_STROBE_GET(x) (((x) & 0x00000008) >> 3) - -/* macros for MAC_DMA_TOPS */ -#define MAC_DMA_TOPS_ADDRESS 0x00000044 -#define MAC_DMA_TOPS_OFFSET 0x00000044 -#define MAC_DMA_TOPS_TIMEOUT_MSB 15 -#define MAC_DMA_TOPS_TIMEOUT_LSB 0 -#define MAC_DMA_TOPS_TIMEOUT_MASK 0x0000ffff -#define MAC_DMA_TOPS_TIMEOUT_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DMA_TOPS_TIMEOUT_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MAC_DMA_RXNPTO */ -#define MAC_DMA_RXNPTO_ADDRESS 0x00000048 -#define MAC_DMA_RXNPTO_OFFSET 0x00000048 -#define MAC_DMA_RXNPTO_TIMEOUT_MSB 9 -#define MAC_DMA_RXNPTO_TIMEOUT_LSB 0 -#define MAC_DMA_RXNPTO_TIMEOUT_MASK 0x000003ff -#define MAC_DMA_RXNPTO_TIMEOUT_GET(x) (((x) & 0x000003ff) >> 0) -#define MAC_DMA_RXNPTO_TIMEOUT_SET(x) (((x) << 0) & 0x000003ff) - -/* macros for MAC_DMA_TXNPTO */ -#define MAC_DMA_TXNPTO_ADDRESS 0x0000004c -#define MAC_DMA_TXNPTO_OFFSET 0x0000004c -#define MAC_DMA_TXNPTO_TIMEOUT_MSB 9 -#define MAC_DMA_TXNPTO_TIMEOUT_LSB 0 -#define MAC_DMA_TXNPTO_TIMEOUT_MASK 0x000003ff -#define MAC_DMA_TXNPTO_TIMEOUT_GET(x) (((x) & 0x000003ff) >> 0) -#define MAC_DMA_TXNPTO_TIMEOUT_SET(x) (((x) << 0) & 0x000003ff) -#define MAC_DMA_TXNPTO_MASK_MSB 19 -#define MAC_DMA_TXNPTO_MASK_LSB 10 -#define MAC_DMA_TXNPTO_MASK_MASK 0x000ffc00 -#define MAC_DMA_TXNPTO_MASK_GET(x) (((x) & 0x000ffc00) >> 10) -#define MAC_DMA_TXNPTO_MASK_SET(x) (((x) << 10) & 0x000ffc00) - -/* macros for MAC_DMA_RPGTO */ -#define MAC_DMA_RPGTO_ADDRESS 0x00000050 -#define MAC_DMA_RPGTO_OFFSET 0x00000050 -#define MAC_DMA_RPGTO_TIMEOUT_MSB 9 -#define MAC_DMA_RPGTO_TIMEOUT_LSB 0 -#define MAC_DMA_RPGTO_TIMEOUT_MASK 0x000003ff -#define MAC_DMA_RPGTO_TIMEOUT_GET(x) (((x) & 0x000003ff) >> 0) -#define MAC_DMA_RPGTO_TIMEOUT_SET(x) (((x) << 0) & 0x000003ff) - -/* macros for MAC_DMA_MACMISC */ -#define MAC_DMA_MACMISC_ADDRESS 0x00000058 -#define MAC_DMA_MACMISC_OFFSET 0x00000058 -#define MAC_DMA_MACMISC_FORCE_PCI_EXT_MSB 4 -#define MAC_DMA_MACMISC_FORCE_PCI_EXT_LSB 4 -#define MAC_DMA_MACMISC_FORCE_PCI_EXT_MASK 0x00000010 -#define MAC_DMA_MACMISC_FORCE_PCI_EXT_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_DMA_MACMISC_FORCE_PCI_EXT_SET(x) (((x) << 4) & 0x00000010) -#define MAC_DMA_MACMISC_DMA_OBS_MUXSEL_MSB 8 -#define MAC_DMA_MACMISC_DMA_OBS_MUXSEL_LSB 5 -#define MAC_DMA_MACMISC_DMA_OBS_MUXSEL_MASK 0x000001e0 -#define MAC_DMA_MACMISC_DMA_OBS_MUXSEL_GET(x) (((x) & 0x000001e0) >> 5) -#define MAC_DMA_MACMISC_DMA_OBS_MUXSEL_SET(x) (((x) << 5) & 0x000001e0) -#define MAC_DMA_MACMISC_MISC_OBS_MUXSEL_MSB 11 -#define MAC_DMA_MACMISC_MISC_OBS_MUXSEL_LSB 9 -#define MAC_DMA_MACMISC_MISC_OBS_MUXSEL_MASK 0x00000e00 -#define MAC_DMA_MACMISC_MISC_OBS_MUXSEL_GET(x) (((x) & 0x00000e00) >> 9) -#define MAC_DMA_MACMISC_MISC_OBS_MUXSEL_SET(x) (((x) << 9) & 0x00000e00) -#define MAC_DMA_MACMISC_MISC_F2_OBS_LOW_MUXSEL_MSB 14 -#define MAC_DMA_MACMISC_MISC_F2_OBS_LOW_MUXSEL_LSB 12 -#define MAC_DMA_MACMISC_MISC_F2_OBS_LOW_MUXSEL_MASK 0x00007000 -#define MAC_DMA_MACMISC_MISC_F2_OBS_LOW_MUXSEL_GET(x) (((x) & 0x00007000) >> 12) -#define MAC_DMA_MACMISC_MISC_F2_OBS_LOW_MUXSEL_SET(x) (((x) << 12) & 0x00007000) -#define MAC_DMA_MACMISC_MISC_F2_OBS_HIGH_MUXSEL_MSB 17 -#define MAC_DMA_MACMISC_MISC_F2_OBS_HIGH_MUXSEL_LSB 15 -#define MAC_DMA_MACMISC_MISC_F2_OBS_HIGH_MUXSEL_MASK 0x00038000 -#define MAC_DMA_MACMISC_MISC_F2_OBS_HIGH_MUXSEL_GET(x) (((x) & 0x00038000) >> 15) -#define MAC_DMA_MACMISC_MISC_F2_OBS_HIGH_MUXSEL_SET(x) (((x) << 15) & 0x00038000) - -/* macros for MAC_DMA_INTER */ -#define MAC_DMA_INTER_ADDRESS 0x0000005c -#define MAC_DMA_INTER_OFFSET 0x0000005c -#define MAC_DMA_INTER_REQ_MSB 0 -#define MAC_DMA_INTER_REQ_LSB 0 -#define MAC_DMA_INTER_REQ_MASK 0x00000001 -#define MAC_DMA_INTER_REQ_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_DMA_INTER_REQ_SET(x) (((x) << 0) & 0x00000001) -#define MAC_DMA_INTER_MSI_RX_SRC_MSB 2 -#define MAC_DMA_INTER_MSI_RX_SRC_LSB 1 -#define MAC_DMA_INTER_MSI_RX_SRC_MASK 0x00000006 -#define MAC_DMA_INTER_MSI_RX_SRC_GET(x) (((x) & 0x00000006) >> 1) -#define MAC_DMA_INTER_MSI_RX_SRC_SET(x) (((x) << 1) & 0x00000006) -#define MAC_DMA_INTER_MSI_TX_SRC_MSB 4 -#define MAC_DMA_INTER_MSI_TX_SRC_LSB 3 -#define MAC_DMA_INTER_MSI_TX_SRC_MASK 0x00000018 -#define MAC_DMA_INTER_MSI_TX_SRC_GET(x) (((x) & 0x00000018) >> 3) -#define MAC_DMA_INTER_MSI_TX_SRC_SET(x) (((x) << 3) & 0x00000018) - -/* macros for MAC_DMA_DATABUF */ -#define MAC_DMA_DATABUF_ADDRESS 0x00000060 -#define MAC_DMA_DATABUF_OFFSET 0x00000060 -#define MAC_DMA_DATABUF_LEN_MSB 11 -#define MAC_DMA_DATABUF_LEN_LSB 0 -#define MAC_DMA_DATABUF_LEN_MASK 0x00000fff -#define MAC_DMA_DATABUF_LEN_GET(x) (((x) & 0x00000fff) >> 0) -#define MAC_DMA_DATABUF_LEN_SET(x) (((x) << 0) & 0x00000fff) - -/* macros for MAC_DMA_GTT */ -#define MAC_DMA_GTT_ADDRESS 0x00000064 -#define MAC_DMA_GTT_OFFSET 0x00000064 -#define MAC_DMA_GTT_COUNT_MSB 15 -#define MAC_DMA_GTT_COUNT_LSB 0 -#define MAC_DMA_GTT_COUNT_MASK 0x0000ffff -#define MAC_DMA_GTT_COUNT_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DMA_GTT_COUNT_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_DMA_GTT_LIMIT_MSB 31 -#define MAC_DMA_GTT_LIMIT_LSB 16 -#define MAC_DMA_GTT_LIMIT_MASK 0xffff0000 -#define MAC_DMA_GTT_LIMIT_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_DMA_GTT_LIMIT_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_DMA_GTTM */ -#define MAC_DMA_GTTM_ADDRESS 0x00000068 -#define MAC_DMA_GTTM_OFFSET 0x00000068 -#define MAC_DMA_GTTM_USEC_STROBE_MSB 0 -#define MAC_DMA_GTTM_USEC_STROBE_LSB 0 -#define MAC_DMA_GTTM_USEC_STROBE_MASK 0x00000001 -#define MAC_DMA_GTTM_USEC_STROBE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_DMA_GTTM_USEC_STROBE_SET(x) (((x) << 0) & 0x00000001) -#define MAC_DMA_GTTM_IGNORE_CHAN_IDLE_MSB 1 -#define MAC_DMA_GTTM_IGNORE_CHAN_IDLE_LSB 1 -#define MAC_DMA_GTTM_IGNORE_CHAN_IDLE_MASK 0x00000002 -#define MAC_DMA_GTTM_IGNORE_CHAN_IDLE_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_DMA_GTTM_IGNORE_CHAN_IDLE_SET(x) (((x) << 1) & 0x00000002) -#define MAC_DMA_GTTM_RESET_ON_CHAN_IDLE_MSB 2 -#define MAC_DMA_GTTM_RESET_ON_CHAN_IDLE_LSB 2 -#define MAC_DMA_GTTM_RESET_ON_CHAN_IDLE_MASK 0x00000004 -#define MAC_DMA_GTTM_RESET_ON_CHAN_IDLE_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_DMA_GTTM_RESET_ON_CHAN_IDLE_SET(x) (((x) << 2) & 0x00000004) -#define MAC_DMA_GTTM_CST_USEC_STROBE_MSB 3 -#define MAC_DMA_GTTM_CST_USEC_STROBE_LSB 3 -#define MAC_DMA_GTTM_CST_USEC_STROBE_MASK 0x00000008 -#define MAC_DMA_GTTM_CST_USEC_STROBE_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_DMA_GTTM_CST_USEC_STROBE_SET(x) (((x) << 3) & 0x00000008) -#define MAC_DMA_GTTM_DISABLE_QCU_FR_ACTIVE_GTT_MSB 4 -#define MAC_DMA_GTTM_DISABLE_QCU_FR_ACTIVE_GTT_LSB 4 -#define MAC_DMA_GTTM_DISABLE_QCU_FR_ACTIVE_GTT_MASK 0x00000010 -#define MAC_DMA_GTTM_DISABLE_QCU_FR_ACTIVE_GTT_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_DMA_GTTM_DISABLE_QCU_FR_ACTIVE_GTT_SET(x) (((x) << 4) & 0x00000010) -#define MAC_DMA_GTTM_DISABLE_QCU_FR_ACTIVE_BT_MSB 5 -#define MAC_DMA_GTTM_DISABLE_QCU_FR_ACTIVE_BT_LSB 5 -#define MAC_DMA_GTTM_DISABLE_QCU_FR_ACTIVE_BT_MASK 0x00000020 -#define MAC_DMA_GTTM_DISABLE_QCU_FR_ACTIVE_BT_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_DMA_GTTM_DISABLE_QCU_FR_ACTIVE_BT_SET(x) (((x) << 5) & 0x00000020) - -/* macros for MAC_DMA_CST */ -#define MAC_DMA_CST_ADDRESS 0x0000006c -#define MAC_DMA_CST_OFFSET 0x0000006c -#define MAC_DMA_CST_COUNT_MSB 15 -#define MAC_DMA_CST_COUNT_LSB 0 -#define MAC_DMA_CST_COUNT_MASK 0x0000ffff -#define MAC_DMA_CST_COUNT_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DMA_CST_COUNT_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_DMA_CST_LIMIT_MSB 31 -#define MAC_DMA_CST_LIMIT_LSB 16 -#define MAC_DMA_CST_LIMIT_MASK 0xffff0000 -#define MAC_DMA_CST_LIMIT_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_DMA_CST_LIMIT_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_DMA_RXDP_SIZE */ -#define MAC_DMA_RXDP_SIZE_ADDRESS 0x00000070 -#define MAC_DMA_RXDP_SIZE_OFFSET 0x00000070 -#define MAC_DMA_RXDP_SIZE_LP_MSB 7 -#define MAC_DMA_RXDP_SIZE_LP_LSB 0 -#define MAC_DMA_RXDP_SIZE_LP_MASK 0x000000ff -#define MAC_DMA_RXDP_SIZE_LP_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_DMA_RXDP_SIZE_HP_MSB 12 -#define MAC_DMA_RXDP_SIZE_HP_LSB 8 -#define MAC_DMA_RXDP_SIZE_HP_MASK 0x00001f00 -#define MAC_DMA_RXDP_SIZE_HP_GET(x) (((x) & 0x00001f00) >> 8) - -/* macros for MAC_DMA_RX_QUEUE_HP_RXDP */ -#define MAC_DMA_RX_QUEUE_HP_RXDP_ADDRESS 0x00000074 -#define MAC_DMA_RX_QUEUE_HP_RXDP_OFFSET 0x00000074 -#define MAC_DMA_RX_QUEUE_HP_RXDP_ADDR_MSB 31 -#define MAC_DMA_RX_QUEUE_HP_RXDP_ADDR_LSB 0 -#define MAC_DMA_RX_QUEUE_HP_RXDP_ADDR_MASK 0xffffffff -#define MAC_DMA_RX_QUEUE_HP_RXDP_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_RX_QUEUE_HP_RXDP_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_RX_QUEUE_LP_RXDP */ -#define MAC_DMA_RX_QUEUE_LP_RXDP_ADDRESS 0x00000078 -#define MAC_DMA_RX_QUEUE_LP_RXDP_OFFSET 0x00000078 -#define MAC_DMA_RX_QUEUE_LP_RXDP_ADDR_MSB 31 -#define MAC_DMA_RX_QUEUE_LP_RXDP_ADDR_LSB 0 -#define MAC_DMA_RX_QUEUE_LP_RXDP_ADDR_MASK 0xffffffff -#define MAC_DMA_RX_QUEUE_LP_RXDP_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_RX_QUEUE_LP_RXDP_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_ISR_P */ -#define MAC_DMA_ISR_P_ADDRESS 0x00000080 -#define MAC_DMA_ISR_P_OFFSET 0x00000080 -#define MAC_DMA_ISR_P_DATA_MSB 31 -#define MAC_DMA_ISR_P_DATA_LSB 0 -#define MAC_DMA_ISR_P_DATA_MASK 0xffffffff -#define MAC_DMA_ISR_P_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_ISR_P_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_ISR_S0 */ -#define MAC_DMA_ISR_S0_ADDRESS 0x00000084 -#define MAC_DMA_ISR_S0_OFFSET 0x00000084 -#define MAC_DMA_ISR_S0_DATA_MSB 31 -#define MAC_DMA_ISR_S0_DATA_LSB 0 -#define MAC_DMA_ISR_S0_DATA_MASK 0xffffffff -#define MAC_DMA_ISR_S0_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_ISR_S0_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_ISR_S1 */ -#define MAC_DMA_ISR_S1_ADDRESS 0x00000088 -#define MAC_DMA_ISR_S1_OFFSET 0x00000088 -#define MAC_DMA_ISR_S1_DATA_MSB 31 -#define MAC_DMA_ISR_S1_DATA_LSB 0 -#define MAC_DMA_ISR_S1_DATA_MASK 0xffffffff -#define MAC_DMA_ISR_S1_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_ISR_S1_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_ISR_S2 */ -#define MAC_DMA_ISR_S2_ADDRESS 0x0000008c -#define MAC_DMA_ISR_S2_OFFSET 0x0000008c -#define MAC_DMA_ISR_S2_DATA_MSB 31 -#define MAC_DMA_ISR_S2_DATA_LSB 0 -#define MAC_DMA_ISR_S2_DATA_MASK 0xffffffff -#define MAC_DMA_ISR_S2_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_ISR_S2_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_ISR_S3 */ -#define MAC_DMA_ISR_S3_ADDRESS 0x00000090 -#define MAC_DMA_ISR_S3_OFFSET 0x00000090 -#define MAC_DMA_ISR_S3_DATA_MSB 31 -#define MAC_DMA_ISR_S3_DATA_LSB 0 -#define MAC_DMA_ISR_S3_DATA_MASK 0xffffffff -#define MAC_DMA_ISR_S3_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_ISR_S3_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_ISR_S4 */ -#define MAC_DMA_ISR_S4_ADDRESS 0x00000094 -#define MAC_DMA_ISR_S4_OFFSET 0x00000094 -#define MAC_DMA_ISR_S4_DATA_MSB 31 -#define MAC_DMA_ISR_S4_DATA_LSB 0 -#define MAC_DMA_ISR_S4_DATA_MASK 0xffffffff -#define MAC_DMA_ISR_S4_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_ISR_S4_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_ISR_S5 */ -#define MAC_DMA_ISR_S5_ADDRESS 0x00000098 -#define MAC_DMA_ISR_S5_OFFSET 0x00000098 -#define MAC_DMA_ISR_S5_DATA_MSB 31 -#define MAC_DMA_ISR_S5_DATA_LSB 0 -#define MAC_DMA_ISR_S5_DATA_MASK 0xffffffff -#define MAC_DMA_ISR_S5_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_ISR_S5_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_ISR_S6 */ -#define MAC_DMA_ISR_S6_ADDRESS 0x0000009c -#define MAC_DMA_ISR_S6_OFFSET 0x0000009c -#define MAC_DMA_ISR_S6_DATA_MSB 31 -#define MAC_DMA_ISR_S6_DATA_LSB 0 -#define MAC_DMA_ISR_S6_DATA_MASK 0xffffffff -#define MAC_DMA_ISR_S6_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_ISR_S6_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_IMR_P */ -#define MAC_DMA_IMR_P_ADDRESS 0x000000a0 -#define MAC_DMA_IMR_P_OFFSET 0x000000a0 -#define MAC_DMA_IMR_P_MASK_MSB 31 -#define MAC_DMA_IMR_P_MASK_LSB 0 -#define MAC_DMA_IMR_P_MASK_MASK 0xffffffff -#define MAC_DMA_IMR_P_MASK_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_IMR_P_MASK_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_IMR_S0 */ -#define MAC_DMA_IMR_S0_ADDRESS 0x000000a4 -#define MAC_DMA_IMR_S0_OFFSET 0x000000a4 -#define MAC_DMA_IMR_S0_MASK_MSB 31 -#define MAC_DMA_IMR_S0_MASK_LSB 0 -#define MAC_DMA_IMR_S0_MASK_MASK 0xffffffff -#define MAC_DMA_IMR_S0_MASK_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_IMR_S0_MASK_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_IMR_S1 */ -#define MAC_DMA_IMR_S1_ADDRESS 0x000000a8 -#define MAC_DMA_IMR_S1_OFFSET 0x000000a8 -#define MAC_DMA_IMR_S1_DATA_MSB 31 -#define MAC_DMA_IMR_S1_DATA_LSB 0 -#define MAC_DMA_IMR_S1_DATA_MASK 0xffffffff -#define MAC_DMA_IMR_S1_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_IMR_S1_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_IMR_S2 */ -#define MAC_DMA_IMR_S2_ADDRESS 0x000000ac -#define MAC_DMA_IMR_S2_OFFSET 0x000000ac -#define MAC_DMA_IMR_S2_MASK_MSB 31 -#define MAC_DMA_IMR_S2_MASK_LSB 0 -#define MAC_DMA_IMR_S2_MASK_MASK 0xffffffff -#define MAC_DMA_IMR_S2_MASK_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_IMR_S2_MASK_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_IMR_S3 */ -#define MAC_DMA_IMR_S3_ADDRESS 0x000000b0 -#define MAC_DMA_IMR_S3_OFFSET 0x000000b0 -#define MAC_DMA_IMR_S3_MASK_MSB 31 -#define MAC_DMA_IMR_S3_MASK_LSB 0 -#define MAC_DMA_IMR_S3_MASK_MASK 0xffffffff -#define MAC_DMA_IMR_S3_MASK_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_IMR_S3_MASK_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_IMR_S4 */ -#define MAC_DMA_IMR_S4_ADDRESS 0x000000b4 -#define MAC_DMA_IMR_S4_OFFSET 0x000000b4 -#define MAC_DMA_IMR_S4_MASK_MSB 31 -#define MAC_DMA_IMR_S4_MASK_LSB 0 -#define MAC_DMA_IMR_S4_MASK_MASK 0xffffffff -#define MAC_DMA_IMR_S4_MASK_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_IMR_S4_MASK_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_IMR_S5 */ -#define MAC_DMA_IMR_S5_ADDRESS 0x000000b8 -#define MAC_DMA_IMR_S5_OFFSET 0x000000b8 -#define MAC_DMA_IMR_S5_MASK_MSB 31 -#define MAC_DMA_IMR_S5_MASK_LSB 0 -#define MAC_DMA_IMR_S5_MASK_MASK 0xffffffff -#define MAC_DMA_IMR_S5_MASK_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_IMR_S5_MASK_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_IMR_S6 */ -#define MAC_DMA_IMR_S6_ADDRESS 0x000000bc -#define MAC_DMA_IMR_S6_OFFSET 0x000000bc -#define MAC_DMA_IMR_S6_MASK_MSB 31 -#define MAC_DMA_IMR_S6_MASK_LSB 0 -#define MAC_DMA_IMR_S6_MASK_MASK 0xffffffff -#define MAC_DMA_IMR_S6_MASK_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_DMA_IMR_S6_MASK_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_DMA_ISR_P_RAC */ -#define MAC_DMA_ISR_P_RAC_ADDRESS 0x000000c0 -#define MAC_DMA_ISR_P_RAC_OFFSET 0x000000c0 -#define MAC_DMA_ISR_P_RAC_DATA_MSB 31 -#define MAC_DMA_ISR_P_RAC_DATA_LSB 0 -#define MAC_DMA_ISR_P_RAC_DATA_MASK 0xffffffff -#define MAC_DMA_ISR_P_RAC_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_ISR_S0_S */ -#define MAC_DMA_ISR_S0_S_ADDRESS 0x000000c4 -#define MAC_DMA_ISR_S0_S_OFFSET 0x000000c4 -#define MAC_DMA_ISR_S0_S_SHADOW_MSB 31 -#define MAC_DMA_ISR_S0_S_SHADOW_LSB 0 -#define MAC_DMA_ISR_S0_S_SHADOW_MASK 0xffffffff -#define MAC_DMA_ISR_S0_S_SHADOW_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_ISR_S1_S */ -#define MAC_DMA_ISR_S1_S_ADDRESS 0x000000c8 -#define MAC_DMA_ISR_S1_S_OFFSET 0x000000c8 -#define MAC_DMA_ISR_S1_S_SHADOW_MSB 31 -#define MAC_DMA_ISR_S1_S_SHADOW_LSB 0 -#define MAC_DMA_ISR_S1_S_SHADOW_MASK 0xffffffff -#define MAC_DMA_ISR_S1_S_SHADOW_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_ISR_S6_S */ -#define MAC_DMA_ISR_S6_S_ADDRESS 0x000000cc -#define MAC_DMA_ISR_S6_S_OFFSET 0x000000cc -#define MAC_DMA_ISR_S6_S_SHADOW_MSB 31 -#define MAC_DMA_ISR_S6_S_SHADOW_LSB 0 -#define MAC_DMA_ISR_S6_S_SHADOW_MASK 0xffffffff -#define MAC_DMA_ISR_S6_S_SHADOW_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_ISR_S2_S */ -#define MAC_DMA_ISR_S2_S_ADDRESS 0x000000d0 -#define MAC_DMA_ISR_S2_S_OFFSET 0x000000d0 -#define MAC_DMA_ISR_S2_S_SHADOW_MSB 31 -#define MAC_DMA_ISR_S2_S_SHADOW_LSB 0 -#define MAC_DMA_ISR_S2_S_SHADOW_MASK 0xffffffff -#define MAC_DMA_ISR_S2_S_SHADOW_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_ISR_S3_S */ -#define MAC_DMA_ISR_S3_S_ADDRESS 0x000000d4 -#define MAC_DMA_ISR_S3_S_OFFSET 0x000000d4 -#define MAC_DMA_ISR_S3_S_SHADOW_MSB 31 -#define MAC_DMA_ISR_S3_S_SHADOW_LSB 0 -#define MAC_DMA_ISR_S3_S_SHADOW_MASK 0xffffffff -#define MAC_DMA_ISR_S3_S_SHADOW_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_ISR_S4_S */ -#define MAC_DMA_ISR_S4_S_ADDRESS 0x000000d8 -#define MAC_DMA_ISR_S4_S_OFFSET 0x000000d8 -#define MAC_DMA_ISR_S4_S_SHADOW_MSB 31 -#define MAC_DMA_ISR_S4_S_SHADOW_LSB 0 -#define MAC_DMA_ISR_S4_S_SHADOW_MASK 0xffffffff -#define MAC_DMA_ISR_S4_S_SHADOW_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_ISR_S5_S */ -#define MAC_DMA_ISR_S5_S_ADDRESS 0x000000dc -#define MAC_DMA_ISR_S5_S_OFFSET 0x000000dc -#define MAC_DMA_ISR_S5_S_SHADOW_MSB 31 -#define MAC_DMA_ISR_S5_S_SHADOW_LSB 0 -#define MAC_DMA_ISR_S5_S_SHADOW_MASK 0xffffffff -#define MAC_DMA_ISR_S5_S_SHADOW_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_DMADBG_0 */ -#define MAC_DMA_DMADBG_0_ADDRESS 0x000000e0 -#define MAC_DMA_DMADBG_0_OFFSET 0x000000e0 -#define MAC_DMA_DMADBG_0_DATA_MSB 31 -#define MAC_DMA_DMADBG_0_DATA_LSB 0 -#define MAC_DMA_DMADBG_0_DATA_MASK 0xffffffff -#define MAC_DMA_DMADBG_0_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_DMADBG_1 */ -#define MAC_DMA_DMADBG_1_ADDRESS 0x000000e4 -#define MAC_DMA_DMADBG_1_OFFSET 0x000000e4 -#define MAC_DMA_DMADBG_1_DATA_MSB 31 -#define MAC_DMA_DMADBG_1_DATA_LSB 0 -#define MAC_DMA_DMADBG_1_DATA_MASK 0xffffffff -#define MAC_DMA_DMADBG_1_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_DMADBG_2 */ -#define MAC_DMA_DMADBG_2_ADDRESS 0x000000e8 -#define MAC_DMA_DMADBG_2_OFFSET 0x000000e8 -#define MAC_DMA_DMADBG_2_DATA_MSB 31 -#define MAC_DMA_DMADBG_2_DATA_LSB 0 -#define MAC_DMA_DMADBG_2_DATA_MASK 0xffffffff -#define MAC_DMA_DMADBG_2_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_DMADBG_3 */ -#define MAC_DMA_DMADBG_3_ADDRESS 0x000000ec -#define MAC_DMA_DMADBG_3_OFFSET 0x000000ec -#define MAC_DMA_DMADBG_3_DATA_MSB 31 -#define MAC_DMA_DMADBG_3_DATA_LSB 0 -#define MAC_DMA_DMADBG_3_DATA_MASK 0xffffffff -#define MAC_DMA_DMADBG_3_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_DMADBG_4 */ -#define MAC_DMA_DMADBG_4_ADDRESS 0x000000f0 -#define MAC_DMA_DMADBG_4_OFFSET 0x000000f0 -#define MAC_DMA_DMADBG_4_DATA_MSB 31 -#define MAC_DMA_DMADBG_4_DATA_LSB 0 -#define MAC_DMA_DMADBG_4_DATA_MASK 0xffffffff -#define MAC_DMA_DMADBG_4_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_DMADBG_5 */ -#define MAC_DMA_DMADBG_5_ADDRESS 0x000000f4 -#define MAC_DMA_DMADBG_5_OFFSET 0x000000f4 -#define MAC_DMA_DMADBG_5_DATA_MSB 31 -#define MAC_DMA_DMADBG_5_DATA_LSB 0 -#define MAC_DMA_DMADBG_5_DATA_MASK 0xffffffff -#define MAC_DMA_DMADBG_5_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_DMADBG_6 */ -#define MAC_DMA_DMADBG_6_ADDRESS 0x000000f8 -#define MAC_DMA_DMADBG_6_OFFSET 0x000000f8 -#define MAC_DMA_DMADBG_6_DATA_MSB 31 -#define MAC_DMA_DMADBG_6_DATA_LSB 0 -#define MAC_DMA_DMADBG_6_DATA_MASK 0xffffffff -#define MAC_DMA_DMADBG_6_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_DMADBG_7 */ -#define MAC_DMA_DMADBG_7_ADDRESS 0x000000fc -#define MAC_DMA_DMADBG_7_OFFSET 0x000000fc -#define MAC_DMA_DMADBG_7_DATA_MSB 31 -#define MAC_DMA_DMADBG_7_DATA_LSB 0 -#define MAC_DMA_DMADBG_7_DATA_MASK 0xffffffff -#define MAC_DMA_DMADBG_7_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_QCU_TXDP_REMAINING_QCU_7_0 */ -#define MAC_DMA_QCU_TXDP_REMAINING_QCU_7_0_ADDRESS 0x00000100 -#define MAC_DMA_QCU_TXDP_REMAINING_QCU_7_0_OFFSET 0x00000100 -#define MAC_DMA_QCU_TXDP_REMAINING_QCU_7_0_DATA_MSB 31 -#define MAC_DMA_QCU_TXDP_REMAINING_QCU_7_0_DATA_LSB 0 -#define MAC_DMA_QCU_TXDP_REMAINING_QCU_7_0_DATA_MASK 0xffffffff -#define MAC_DMA_QCU_TXDP_REMAINING_QCU_7_0_DATA_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_DMA_QCU_TXDP_REMAINING_QCU_9_8 */ -#define MAC_DMA_QCU_TXDP_REMAINING_QCU_9_8_ADDRESS 0x00000104 -#define MAC_DMA_QCU_TXDP_REMAINING_QCU_9_8_OFFSET 0x00000104 -#define MAC_DMA_QCU_TXDP_REMAINING_QCU_9_8_DATA_MSB 7 -#define MAC_DMA_QCU_TXDP_REMAINING_QCU_9_8_DATA_LSB 0 -#define MAC_DMA_QCU_TXDP_REMAINING_QCU_9_8_DATA_MASK 0x000000ff -#define MAC_DMA_QCU_TXDP_REMAINING_QCU_9_8_DATA_GET(x) (((x) & 0x000000ff) >> 0) - -/* macros for MAC_DMA_TIMT_1 */ -#define MAC_DMA_TIMT_1_ADDRESS 0x00000108 -#define MAC_DMA_TIMT_1_OFFSET 0x00000108 -#define MAC_DMA_TIMT_1_TX_LAST_PKT_THRESH_MSB 15 -#define MAC_DMA_TIMT_1_TX_LAST_PKT_THRESH_LSB 0 -#define MAC_DMA_TIMT_1_TX_LAST_PKT_THRESH_MASK 0x0000ffff -#define MAC_DMA_TIMT_1_TX_LAST_PKT_THRESH_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DMA_TIMT_1_TX_LAST_PKT_THRESH_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_DMA_TIMT_1_TX_FIRST_PKT_THRESH_MSB 31 -#define MAC_DMA_TIMT_1_TX_FIRST_PKT_THRESH_LSB 16 -#define MAC_DMA_TIMT_1_TX_FIRST_PKT_THRESH_MASK 0xffff0000 -#define MAC_DMA_TIMT_1_TX_FIRST_PKT_THRESH_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_DMA_TIMT_1_TX_FIRST_PKT_THRESH_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_DMA_TIMT_2 */ -#define MAC_DMA_TIMT_2_ADDRESS 0x0000010c -#define MAC_DMA_TIMT_2_OFFSET 0x0000010c -#define MAC_DMA_TIMT_2_TX_LAST_PKT_THRESH_MSB 15 -#define MAC_DMA_TIMT_2_TX_LAST_PKT_THRESH_LSB 0 -#define MAC_DMA_TIMT_2_TX_LAST_PKT_THRESH_MASK 0x0000ffff -#define MAC_DMA_TIMT_2_TX_LAST_PKT_THRESH_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DMA_TIMT_2_TX_LAST_PKT_THRESH_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_DMA_TIMT_2_TX_FIRST_PKT_THRESH_MSB 31 -#define MAC_DMA_TIMT_2_TX_FIRST_PKT_THRESH_LSB 16 -#define MAC_DMA_TIMT_2_TX_FIRST_PKT_THRESH_MASK 0xffff0000 -#define MAC_DMA_TIMT_2_TX_FIRST_PKT_THRESH_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_DMA_TIMT_2_TX_FIRST_PKT_THRESH_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_DMA_TIMT_3 */ -#define MAC_DMA_TIMT_3_ADDRESS 0x00000110 -#define MAC_DMA_TIMT_3_OFFSET 0x00000110 -#define MAC_DMA_TIMT_3_TX_LAST_PKT_THRESH_MSB 15 -#define MAC_DMA_TIMT_3_TX_LAST_PKT_THRESH_LSB 0 -#define MAC_DMA_TIMT_3_TX_LAST_PKT_THRESH_MASK 0x0000ffff -#define MAC_DMA_TIMT_3_TX_LAST_PKT_THRESH_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DMA_TIMT_3_TX_LAST_PKT_THRESH_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_DMA_TIMT_3_TX_FIRST_PKT_THRESH_MSB 31 -#define MAC_DMA_TIMT_3_TX_FIRST_PKT_THRESH_LSB 16 -#define MAC_DMA_TIMT_3_TX_FIRST_PKT_THRESH_MASK 0xffff0000 -#define MAC_DMA_TIMT_3_TX_FIRST_PKT_THRESH_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_DMA_TIMT_3_TX_FIRST_PKT_THRESH_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_DMA_TIMT_4 */ -#define MAC_DMA_TIMT_4_ADDRESS 0x00000114 -#define MAC_DMA_TIMT_4_OFFSET 0x00000114 -#define MAC_DMA_TIMT_4_TX_LAST_PKT_THRESH_MSB 15 -#define MAC_DMA_TIMT_4_TX_LAST_PKT_THRESH_LSB 0 -#define MAC_DMA_TIMT_4_TX_LAST_PKT_THRESH_MASK 0x0000ffff -#define MAC_DMA_TIMT_4_TX_LAST_PKT_THRESH_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DMA_TIMT_4_TX_LAST_PKT_THRESH_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_DMA_TIMT_4_TX_FIRST_PKT_THRESH_MSB 31 -#define MAC_DMA_TIMT_4_TX_FIRST_PKT_THRESH_LSB 16 -#define MAC_DMA_TIMT_4_TX_FIRST_PKT_THRESH_MASK 0xffff0000 -#define MAC_DMA_TIMT_4_TX_FIRST_PKT_THRESH_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_DMA_TIMT_4_TX_FIRST_PKT_THRESH_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_DMA_TIMT_5 */ -#define MAC_DMA_TIMT_5_ADDRESS 0x00000118 -#define MAC_DMA_TIMT_5_OFFSET 0x00000118 -#define MAC_DMA_TIMT_5_TX_LAST_PKT_THRESH_MSB 15 -#define MAC_DMA_TIMT_5_TX_LAST_PKT_THRESH_LSB 0 -#define MAC_DMA_TIMT_5_TX_LAST_PKT_THRESH_MASK 0x0000ffff -#define MAC_DMA_TIMT_5_TX_LAST_PKT_THRESH_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DMA_TIMT_5_TX_LAST_PKT_THRESH_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_DMA_TIMT_5_TX_FIRST_PKT_THRESH_MSB 31 -#define MAC_DMA_TIMT_5_TX_FIRST_PKT_THRESH_LSB 16 -#define MAC_DMA_TIMT_5_TX_FIRST_PKT_THRESH_MASK 0xffff0000 -#define MAC_DMA_TIMT_5_TX_FIRST_PKT_THRESH_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_DMA_TIMT_5_TX_FIRST_PKT_THRESH_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_DMA_TIMT_6 */ -#define MAC_DMA_TIMT_6_ADDRESS 0x0000011c -#define MAC_DMA_TIMT_6_OFFSET 0x0000011c -#define MAC_DMA_TIMT_6_TX_LAST_PKT_THRESH_MSB 15 -#define MAC_DMA_TIMT_6_TX_LAST_PKT_THRESH_LSB 0 -#define MAC_DMA_TIMT_6_TX_LAST_PKT_THRESH_MASK 0x0000ffff -#define MAC_DMA_TIMT_6_TX_LAST_PKT_THRESH_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DMA_TIMT_6_TX_LAST_PKT_THRESH_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_DMA_TIMT_6_TX_FIRST_PKT_THRESH_MSB 31 -#define MAC_DMA_TIMT_6_TX_FIRST_PKT_THRESH_LSB 16 -#define MAC_DMA_TIMT_6_TX_FIRST_PKT_THRESH_MASK 0xffff0000 -#define MAC_DMA_TIMT_6_TX_FIRST_PKT_THRESH_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_DMA_TIMT_6_TX_FIRST_PKT_THRESH_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_DMA_TIMT_7 */ -#define MAC_DMA_TIMT_7_ADDRESS 0x00000120 -#define MAC_DMA_TIMT_7_OFFSET 0x00000120 -#define MAC_DMA_TIMT_7_TX_LAST_PKT_THRESH_MSB 15 -#define MAC_DMA_TIMT_7_TX_LAST_PKT_THRESH_LSB 0 -#define MAC_DMA_TIMT_7_TX_LAST_PKT_THRESH_MASK 0x0000ffff -#define MAC_DMA_TIMT_7_TX_LAST_PKT_THRESH_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DMA_TIMT_7_TX_LAST_PKT_THRESH_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_DMA_TIMT_7_TX_FIRST_PKT_THRESH_MSB 31 -#define MAC_DMA_TIMT_7_TX_FIRST_PKT_THRESH_LSB 16 -#define MAC_DMA_TIMT_7_TX_FIRST_PKT_THRESH_MASK 0xffff0000 -#define MAC_DMA_TIMT_7_TX_FIRST_PKT_THRESH_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_DMA_TIMT_7_TX_FIRST_PKT_THRESH_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_DMA_TIMT_8 */ -#define MAC_DMA_TIMT_8_ADDRESS 0x00000124 -#define MAC_DMA_TIMT_8_OFFSET 0x00000124 -#define MAC_DMA_TIMT_8_TX_LAST_PKT_THRESH_MSB 15 -#define MAC_DMA_TIMT_8_TX_LAST_PKT_THRESH_LSB 0 -#define MAC_DMA_TIMT_8_TX_LAST_PKT_THRESH_MASK 0x0000ffff -#define MAC_DMA_TIMT_8_TX_LAST_PKT_THRESH_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DMA_TIMT_8_TX_LAST_PKT_THRESH_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_DMA_TIMT_8_TX_FIRST_PKT_THRESH_MSB 31 -#define MAC_DMA_TIMT_8_TX_FIRST_PKT_THRESH_LSB 16 -#define MAC_DMA_TIMT_8_TX_FIRST_PKT_THRESH_MASK 0xffff0000 -#define MAC_DMA_TIMT_8_TX_FIRST_PKT_THRESH_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_DMA_TIMT_8_TX_FIRST_PKT_THRESH_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_DMA_TIMT_9 */ -#define MAC_DMA_TIMT_9_ADDRESS 0x00000128 -#define MAC_DMA_TIMT_9_OFFSET 0x00000128 -#define MAC_DMA_TIMT_9_TX_LAST_PKT_THRESH_MSB 15 -#define MAC_DMA_TIMT_9_TX_LAST_PKT_THRESH_LSB 0 -#define MAC_DMA_TIMT_9_TX_LAST_PKT_THRESH_MASK 0x0000ffff -#define MAC_DMA_TIMT_9_TX_LAST_PKT_THRESH_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_DMA_TIMT_9_TX_LAST_PKT_THRESH_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_DMA_TIMT_9_TX_FIRST_PKT_THRESH_MSB 31 -#define MAC_DMA_TIMT_9_TX_FIRST_PKT_THRESH_LSB 16 -#define MAC_DMA_TIMT_9_TX_FIRST_PKT_THRESH_MASK 0xffff0000 -#define MAC_DMA_TIMT_9_TX_FIRST_PKT_THRESH_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_DMA_TIMT_9_TX_FIRST_PKT_THRESH_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_DMA_CHKACC */ -#define MAC_DMA_CHKACC_ADDRESS 0x0000012c -#define MAC_DMA_CHKACC_OFFSET 0x0000012c -#define MAC_DMA_CHKACC_CHKSUM_SEL_MSB 0 -#define MAC_DMA_CHKACC_CHKSUM_SEL_LSB 0 -#define MAC_DMA_CHKACC_CHKSUM_SEL_MASK 0x00000001 -#define MAC_DMA_CHKACC_CHKSUM_SEL_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_DMA_CHKACC_CHKSUM_SEL_SET(x) (((x) << 0) & 0x00000001) - - -#ifndef __ASSEMBLER__ - -typedef struct wmac_dma_reg_reg_s { - volatile char pad__0[0x8]; /* 0x0 - 0x8 */ - volatile unsigned int MAC_DMA_CR; /* 0x8 - 0xc */ - volatile char pad__1[0x8]; /* 0xc - 0x14 */ - volatile unsigned int MAC_DMA_CFG; /* 0x14 - 0x18 */ - volatile unsigned int MAC_DMA_RXBUFPTR_THRESH; /* 0x18 - 0x1c */ - volatile unsigned int MAC_DMA_TXDPPTR_THRESH; /* 0x1c - 0x20 */ - volatile unsigned int MAC_DMA_MIRT; /* 0x20 - 0x24 */ - volatile unsigned int MAC_DMA_GLOBAL_IER; /* 0x24 - 0x28 */ - volatile unsigned int MAC_DMA_TIMT_0; /* 0x28 - 0x2c */ - volatile unsigned int MAC_DMA_RIMT; /* 0x2c - 0x30 */ - volatile unsigned int MAC_DMA_TXCFG; /* 0x30 - 0x34 */ - volatile unsigned int MAC_DMA_RXCFG; /* 0x34 - 0x38 */ - volatile unsigned int MAC_DMA_RXJLA; /* 0x38 - 0x3c */ - volatile char pad__2[0x4]; /* 0x3c - 0x40 */ - volatile unsigned int MAC_DMA_MIBC; /* 0x40 - 0x44 */ - volatile unsigned int MAC_DMA_TOPS; /* 0x44 - 0x48 */ - volatile unsigned int MAC_DMA_RXNPTO; /* 0x48 - 0x4c */ - volatile unsigned int MAC_DMA_TXNPTO; /* 0x4c - 0x50 */ - volatile unsigned int MAC_DMA_RPGTO; /* 0x50 - 0x54 */ - volatile char pad__3[0x4]; /* 0x54 - 0x58 */ - volatile unsigned int MAC_DMA_MACMISC; /* 0x58 - 0x5c */ - volatile unsigned int MAC_DMA_INTER; /* 0x5c - 0x60 */ - volatile unsigned int MAC_DMA_DATABUF; /* 0x60 - 0x64 */ - volatile unsigned int MAC_DMA_GTT; /* 0x64 - 0x68 */ - volatile unsigned int MAC_DMA_GTTM; /* 0x68 - 0x6c */ - volatile unsigned int MAC_DMA_CST; /* 0x6c - 0x70 */ - volatile unsigned int MAC_DMA_RXDP_SIZE; /* 0x70 - 0x74 */ - volatile unsigned int MAC_DMA_RX_QUEUE_HP_RXDP; /* 0x74 - 0x78 */ - volatile unsigned int MAC_DMA_RX_QUEUE_LP_RXDP; /* 0x78 - 0x7c */ - volatile char pad__4[0x4]; /* 0x7c - 0x80 */ - volatile unsigned int MAC_DMA_ISR_P; /* 0x80 - 0x84 */ - volatile unsigned int MAC_DMA_ISR_S0; /* 0x84 - 0x88 */ - volatile unsigned int MAC_DMA_ISR_S1; /* 0x88 - 0x8c */ - volatile unsigned int MAC_DMA_ISR_S2; /* 0x8c - 0x90 */ - volatile unsigned int MAC_DMA_ISR_S3; /* 0x90 - 0x94 */ - volatile unsigned int MAC_DMA_ISR_S4; /* 0x94 - 0x98 */ - volatile unsigned int MAC_DMA_ISR_S5; /* 0x98 - 0x9c */ - volatile unsigned int MAC_DMA_ISR_S6; /* 0x9c - 0xa0 */ - volatile unsigned int MAC_DMA_IMR_P; /* 0xa0 - 0xa4 */ - volatile unsigned int MAC_DMA_IMR_S0; /* 0xa4 - 0xa8 */ - volatile unsigned int MAC_DMA_IMR_S1; /* 0xa8 - 0xac */ - volatile unsigned int MAC_DMA_IMR_S2; /* 0xac - 0xb0 */ - volatile unsigned int MAC_DMA_IMR_S3; /* 0xb0 - 0xb4 */ - volatile unsigned int MAC_DMA_IMR_S4; /* 0xb4 - 0xb8 */ - volatile unsigned int MAC_DMA_IMR_S5; /* 0xb8 - 0xbc */ - volatile unsigned int MAC_DMA_IMR_S6; /* 0xbc - 0xc0 */ - volatile unsigned int MAC_DMA_ISR_P_RAC; /* 0xc0 - 0xc4 */ - volatile unsigned int MAC_DMA_ISR_S0_S; /* 0xc4 - 0xc8 */ - volatile unsigned int MAC_DMA_ISR_S1_S; /* 0xc8 - 0xcc */ - volatile unsigned int MAC_DMA_ISR_S6_S; /* 0xcc - 0xd0 */ - volatile unsigned int MAC_DMA_ISR_S2_S; /* 0xd0 - 0xd4 */ - volatile unsigned int MAC_DMA_ISR_S3_S; /* 0xd4 - 0xd8 */ - volatile unsigned int MAC_DMA_ISR_S4_S; /* 0xd8 - 0xdc */ - volatile unsigned int MAC_DMA_ISR_S5_S; /* 0xdc - 0xe0 */ - volatile unsigned int MAC_DMA_DMADBG_0; /* 0xe0 - 0xe4 */ - volatile unsigned int MAC_DMA_DMADBG_1; /* 0xe4 - 0xe8 */ - volatile unsigned int MAC_DMA_DMADBG_2; /* 0xe8 - 0xec */ - volatile unsigned int MAC_DMA_DMADBG_3; /* 0xec - 0xf0 */ - volatile unsigned int MAC_DMA_DMADBG_4; /* 0xf0 - 0xf4 */ - volatile unsigned int MAC_DMA_DMADBG_5; /* 0xf4 - 0xf8 */ - volatile unsigned int MAC_DMA_DMADBG_6; /* 0xf8 - 0xfc */ - volatile unsigned int MAC_DMA_DMADBG_7; /* 0xfc - 0x100 */ - volatile unsigned int MAC_DMA_QCU_TXDP_REMAINING_QCU_7_0; /* 0x100 - 0x104 */ - volatile unsigned int MAC_DMA_QCU_TXDP_REMAINING_QCU_9_8; /* 0x104 - 0x108 */ - volatile unsigned int MAC_DMA_TIMT_1; /* 0x108 - 0x10c */ - volatile unsigned int MAC_DMA_TIMT_2; /* 0x10c - 0x110 */ - volatile unsigned int MAC_DMA_TIMT_3; /* 0x110 - 0x114 */ - volatile unsigned int MAC_DMA_TIMT_4; /* 0x114 - 0x118 */ - volatile unsigned int MAC_DMA_TIMT_5; /* 0x118 - 0x11c */ - volatile unsigned int MAC_DMA_TIMT_6; /* 0x11c - 0x120 */ - volatile unsigned int MAC_DMA_TIMT_7; /* 0x120 - 0x124 */ - volatile unsigned int MAC_DMA_TIMT_8; /* 0x124 - 0x128 */ - volatile unsigned int MAC_DMA_TIMT_9; /* 0x128 - 0x12c */ - volatile unsigned int MAC_DMA_CHKACC; /* 0x12c - 0x130 */ -} wmac_dma_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _WMAC_DMA_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_pcu_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_pcu_reg.h deleted file mode 100644 index a83ae2c7d7ee..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_pcu_reg.h +++ /dev/null @@ -1,4492 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _WMAC_PCU_REG_REG_H_ -#define _WMAC_PCU_REG_REG_H_ - - -/* macros for MAC_PCU_STA_ADDR_L32 */ -#define MAC_PCU_STA_ADDR_L32_ADDRESS 0x00008000 -#define MAC_PCU_STA_ADDR_L32_OFFSET 0x00008000 -#define MAC_PCU_STA_ADDR_L32_ADDR_31_0_MSB 31 -#define MAC_PCU_STA_ADDR_L32_ADDR_31_0_LSB 0 -#define MAC_PCU_STA_ADDR_L32_ADDR_31_0_MASK 0xffffffff -#define MAC_PCU_STA_ADDR_L32_ADDR_31_0_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_STA_ADDR_L32_ADDR_31_0_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_STA_ADDR_U16 */ -#define MAC_PCU_STA_ADDR_U16_ADDRESS 0x00008004 -#define MAC_PCU_STA_ADDR_U16_OFFSET 0x00008004 -#define MAC_PCU_STA_ADDR_U16_ADDR_47_32_MSB 15 -#define MAC_PCU_STA_ADDR_U16_ADDR_47_32_LSB 0 -#define MAC_PCU_STA_ADDR_U16_ADDR_47_32_MASK 0x0000ffff -#define MAC_PCU_STA_ADDR_U16_ADDR_47_32_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_STA_ADDR_U16_ADDR_47_32_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_PCU_STA_ADDR_U16_STA_AP_MSB 16 -#define MAC_PCU_STA_ADDR_U16_STA_AP_LSB 16 -#define MAC_PCU_STA_ADDR_U16_STA_AP_MASK 0x00010000 -#define MAC_PCU_STA_ADDR_U16_STA_AP_GET(x) (((x) & 0x00010000) >> 16) -#define MAC_PCU_STA_ADDR_U16_STA_AP_SET(x) (((x) << 16) & 0x00010000) -#define MAC_PCU_STA_ADDR_U16_ADHOC_MSB 17 -#define MAC_PCU_STA_ADDR_U16_ADHOC_LSB 17 -#define MAC_PCU_STA_ADDR_U16_ADHOC_MASK 0x00020000 -#define MAC_PCU_STA_ADDR_U16_ADHOC_GET(x) (((x) & 0x00020000) >> 17) -#define MAC_PCU_STA_ADDR_U16_ADHOC_SET(x) (((x) << 17) & 0x00020000) -#define MAC_PCU_STA_ADDR_U16_PW_SAVE_MSB 18 -#define MAC_PCU_STA_ADDR_U16_PW_SAVE_LSB 18 -#define MAC_PCU_STA_ADDR_U16_PW_SAVE_MASK 0x00040000 -#define MAC_PCU_STA_ADDR_U16_PW_SAVE_GET(x) (((x) & 0x00040000) >> 18) -#define MAC_PCU_STA_ADDR_U16_PW_SAVE_SET(x) (((x) << 18) & 0x00040000) -#define MAC_PCU_STA_ADDR_U16_KEYSRCH_DIS_MSB 19 -#define MAC_PCU_STA_ADDR_U16_KEYSRCH_DIS_LSB 19 -#define MAC_PCU_STA_ADDR_U16_KEYSRCH_DIS_MASK 0x00080000 -#define MAC_PCU_STA_ADDR_U16_KEYSRCH_DIS_GET(x) (((x) & 0x00080000) >> 19) -#define MAC_PCU_STA_ADDR_U16_KEYSRCH_DIS_SET(x) (((x) << 19) & 0x00080000) -#define MAC_PCU_STA_ADDR_U16_PCF_MSB 20 -#define MAC_PCU_STA_ADDR_U16_PCF_LSB 20 -#define MAC_PCU_STA_ADDR_U16_PCF_MASK 0x00100000 -#define MAC_PCU_STA_ADDR_U16_PCF_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_PCU_STA_ADDR_U16_PCF_SET(x) (((x) << 20) & 0x00100000) -#define MAC_PCU_STA_ADDR_U16_USE_DEFANT_MSB 21 -#define MAC_PCU_STA_ADDR_U16_USE_DEFANT_LSB 21 -#define MAC_PCU_STA_ADDR_U16_USE_DEFANT_MASK 0x00200000 -#define MAC_PCU_STA_ADDR_U16_USE_DEFANT_GET(x) (((x) & 0x00200000) >> 21) -#define MAC_PCU_STA_ADDR_U16_USE_DEFANT_SET(x) (((x) << 21) & 0x00200000) -#define MAC_PCU_STA_ADDR_U16_DEFANT_UPDATE_MSB 22 -#define MAC_PCU_STA_ADDR_U16_DEFANT_UPDATE_LSB 22 -#define MAC_PCU_STA_ADDR_U16_DEFANT_UPDATE_MASK 0x00400000 -#define MAC_PCU_STA_ADDR_U16_DEFANT_UPDATE_GET(x) (((x) & 0x00400000) >> 22) -#define MAC_PCU_STA_ADDR_U16_DEFANT_UPDATE_SET(x) (((x) << 22) & 0x00400000) -#define MAC_PCU_STA_ADDR_U16_RTS_USE_DEF_MSB 23 -#define MAC_PCU_STA_ADDR_U16_RTS_USE_DEF_LSB 23 -#define MAC_PCU_STA_ADDR_U16_RTS_USE_DEF_MASK 0x00800000 -#define MAC_PCU_STA_ADDR_U16_RTS_USE_DEF_GET(x) (((x) & 0x00800000) >> 23) -#define MAC_PCU_STA_ADDR_U16_RTS_USE_DEF_SET(x) (((x) << 23) & 0x00800000) -#define MAC_PCU_STA_ADDR_U16_ACKCTS_6MB_MSB 24 -#define MAC_PCU_STA_ADDR_U16_ACKCTS_6MB_LSB 24 -#define MAC_PCU_STA_ADDR_U16_ACKCTS_6MB_MASK 0x01000000 -#define MAC_PCU_STA_ADDR_U16_ACKCTS_6MB_GET(x) (((x) & 0x01000000) >> 24) -#define MAC_PCU_STA_ADDR_U16_ACKCTS_6MB_SET(x) (((x) << 24) & 0x01000000) -#define MAC_PCU_STA_ADDR_U16_BASE_RATE_11B_MSB 25 -#define MAC_PCU_STA_ADDR_U16_BASE_RATE_11B_LSB 25 -#define MAC_PCU_STA_ADDR_U16_BASE_RATE_11B_MASK 0x02000000 -#define MAC_PCU_STA_ADDR_U16_BASE_RATE_11B_GET(x) (((x) & 0x02000000) >> 25) -#define MAC_PCU_STA_ADDR_U16_BASE_RATE_11B_SET(x) (((x) << 25) & 0x02000000) -#define MAC_PCU_STA_ADDR_U16_SECTOR_SELF_GEN_MSB 26 -#define MAC_PCU_STA_ADDR_U16_SECTOR_SELF_GEN_LSB 26 -#define MAC_PCU_STA_ADDR_U16_SECTOR_SELF_GEN_MASK 0x04000000 -#define MAC_PCU_STA_ADDR_U16_SECTOR_SELF_GEN_GET(x) (((x) & 0x04000000) >> 26) -#define MAC_PCU_STA_ADDR_U16_SECTOR_SELF_GEN_SET(x) (((x) << 26) & 0x04000000) -#define MAC_PCU_STA_ADDR_U16_CRPT_MIC_ENABLE_MSB 27 -#define MAC_PCU_STA_ADDR_U16_CRPT_MIC_ENABLE_LSB 27 -#define MAC_PCU_STA_ADDR_U16_CRPT_MIC_ENABLE_MASK 0x08000000 -#define MAC_PCU_STA_ADDR_U16_CRPT_MIC_ENABLE_GET(x) (((x) & 0x08000000) >> 27) -#define MAC_PCU_STA_ADDR_U16_CRPT_MIC_ENABLE_SET(x) (((x) << 27) & 0x08000000) -#define MAC_PCU_STA_ADDR_U16_KSRCH_MODE_MSB 28 -#define MAC_PCU_STA_ADDR_U16_KSRCH_MODE_LSB 28 -#define MAC_PCU_STA_ADDR_U16_KSRCH_MODE_MASK 0x10000000 -#define MAC_PCU_STA_ADDR_U16_KSRCH_MODE_GET(x) (((x) & 0x10000000) >> 28) -#define MAC_PCU_STA_ADDR_U16_KSRCH_MODE_SET(x) (((x) << 28) & 0x10000000) -#define MAC_PCU_STA_ADDR_U16_PRESERVE_SEQNUM_MSB 29 -#define MAC_PCU_STA_ADDR_U16_PRESERVE_SEQNUM_LSB 29 -#define MAC_PCU_STA_ADDR_U16_PRESERVE_SEQNUM_MASK 0x20000000 -#define MAC_PCU_STA_ADDR_U16_PRESERVE_SEQNUM_GET(x) (((x) & 0x20000000) >> 29) -#define MAC_PCU_STA_ADDR_U16_PRESERVE_SEQNUM_SET(x) (((x) << 29) & 0x20000000) -#define MAC_PCU_STA_ADDR_U16_CBCIV_ENDIAN_MSB 30 -#define MAC_PCU_STA_ADDR_U16_CBCIV_ENDIAN_LSB 30 -#define MAC_PCU_STA_ADDR_U16_CBCIV_ENDIAN_MASK 0x40000000 -#define MAC_PCU_STA_ADDR_U16_CBCIV_ENDIAN_GET(x) (((x) & 0x40000000) >> 30) -#define MAC_PCU_STA_ADDR_U16_CBCIV_ENDIAN_SET(x) (((x) << 30) & 0x40000000) -#define MAC_PCU_STA_ADDR_U16_ADHOC_MCAST_SEARCH_MSB 31 -#define MAC_PCU_STA_ADDR_U16_ADHOC_MCAST_SEARCH_LSB 31 -#define MAC_PCU_STA_ADDR_U16_ADHOC_MCAST_SEARCH_MASK 0x80000000 -#define MAC_PCU_STA_ADDR_U16_ADHOC_MCAST_SEARCH_GET(x) (((x) & 0x80000000) >> 31) -#define MAC_PCU_STA_ADDR_U16_ADHOC_MCAST_SEARCH_SET(x) (((x) << 31) & 0x80000000) - -/* macros for MAC_PCU_BSSID_L32 */ -#define MAC_PCU_BSSID_L32_ADDRESS 0x00008008 -#define MAC_PCU_BSSID_L32_OFFSET 0x00008008 -#define MAC_PCU_BSSID_L32_ADDR_MSB 31 -#define MAC_PCU_BSSID_L32_ADDR_LSB 0 -#define MAC_PCU_BSSID_L32_ADDR_MASK 0xffffffff -#define MAC_PCU_BSSID_L32_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_BSSID_L32_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_BSSID_U16 */ -#define MAC_PCU_BSSID_U16_ADDRESS 0x0000800c -#define MAC_PCU_BSSID_U16_OFFSET 0x0000800c -#define MAC_PCU_BSSID_U16_ADDR_MSB 15 -#define MAC_PCU_BSSID_U16_ADDR_LSB 0 -#define MAC_PCU_BSSID_U16_ADDR_MASK 0x0000ffff -#define MAC_PCU_BSSID_U16_ADDR_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_BSSID_U16_ADDR_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_PCU_BSSID_U16_AID_MSB 26 -#define MAC_PCU_BSSID_U16_AID_LSB 16 -#define MAC_PCU_BSSID_U16_AID_MASK 0x07ff0000 -#define MAC_PCU_BSSID_U16_AID_GET(x) (((x) & 0x07ff0000) >> 16) -#define MAC_PCU_BSSID_U16_AID_SET(x) (((x) << 16) & 0x07ff0000) - -/* macros for MAC_PCU_BCN_RSSI_AVE */ -#define MAC_PCU_BCN_RSSI_AVE_ADDRESS 0x00008010 -#define MAC_PCU_BCN_RSSI_AVE_OFFSET 0x00008010 -#define MAC_PCU_BCN_RSSI_AVE_AVE_VALUE_MSB 11 -#define MAC_PCU_BCN_RSSI_AVE_AVE_VALUE_LSB 0 -#define MAC_PCU_BCN_RSSI_AVE_AVE_VALUE_MASK 0x00000fff -#define MAC_PCU_BCN_RSSI_AVE_AVE_VALUE_GET(x) (((x) & 0x00000fff) >> 0) -#define MAC_PCU_BCN_RSSI_AVE_AVE_VALUE2_MSB 27 -#define MAC_PCU_BCN_RSSI_AVE_AVE_VALUE2_LSB 16 -#define MAC_PCU_BCN_RSSI_AVE_AVE_VALUE2_MASK 0x0fff0000 -#define MAC_PCU_BCN_RSSI_AVE_AVE_VALUE2_GET(x) (((x) & 0x0fff0000) >> 16) - -/* macros for MAC_PCU_ACK_CTS_TIMEOUT */ -#define MAC_PCU_ACK_CTS_TIMEOUT_ADDRESS 0x00008014 -#define MAC_PCU_ACK_CTS_TIMEOUT_OFFSET 0x00008014 -#define MAC_PCU_ACK_CTS_TIMEOUT_ACK_TIMEOUT_MSB 13 -#define MAC_PCU_ACK_CTS_TIMEOUT_ACK_TIMEOUT_LSB 0 -#define MAC_PCU_ACK_CTS_TIMEOUT_ACK_TIMEOUT_MASK 0x00003fff -#define MAC_PCU_ACK_CTS_TIMEOUT_ACK_TIMEOUT_GET(x) (((x) & 0x00003fff) >> 0) -#define MAC_PCU_ACK_CTS_TIMEOUT_ACK_TIMEOUT_SET(x) (((x) << 0) & 0x00003fff) -#define MAC_PCU_ACK_CTS_TIMEOUT_CTS_TIMEOUT_MSB 29 -#define MAC_PCU_ACK_CTS_TIMEOUT_CTS_TIMEOUT_LSB 16 -#define MAC_PCU_ACK_CTS_TIMEOUT_CTS_TIMEOUT_MASK 0x3fff0000 -#define MAC_PCU_ACK_CTS_TIMEOUT_CTS_TIMEOUT_GET(x) (((x) & 0x3fff0000) >> 16) -#define MAC_PCU_ACK_CTS_TIMEOUT_CTS_TIMEOUT_SET(x) (((x) << 16) & 0x3fff0000) - -/* macros for MAC_PCU_BCN_RSSI_CTL */ -#define MAC_PCU_BCN_RSSI_CTL_ADDRESS 0x00008018 -#define MAC_PCU_BCN_RSSI_CTL_OFFSET 0x00008018 -#define MAC_PCU_BCN_RSSI_CTL_RSSI_LOW_THRESH_MSB 7 -#define MAC_PCU_BCN_RSSI_CTL_RSSI_LOW_THRESH_LSB 0 -#define MAC_PCU_BCN_RSSI_CTL_RSSI_LOW_THRESH_MASK 0x000000ff -#define MAC_PCU_BCN_RSSI_CTL_RSSI_LOW_THRESH_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_BCN_RSSI_CTL_RSSI_LOW_THRESH_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_BCN_RSSI_CTL_MISS_THRESH_MSB 15 -#define MAC_PCU_BCN_RSSI_CTL_MISS_THRESH_LSB 8 -#define MAC_PCU_BCN_RSSI_CTL_MISS_THRESH_MASK 0x0000ff00 -#define MAC_PCU_BCN_RSSI_CTL_MISS_THRESH_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_BCN_RSSI_CTL_MISS_THRESH_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_BCN_RSSI_CTL_RSSI_HIGH_THRESH_MSB 23 -#define MAC_PCU_BCN_RSSI_CTL_RSSI_HIGH_THRESH_LSB 16 -#define MAC_PCU_BCN_RSSI_CTL_RSSI_HIGH_THRESH_MASK 0x00ff0000 -#define MAC_PCU_BCN_RSSI_CTL_RSSI_HIGH_THRESH_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_BCN_RSSI_CTL_RSSI_HIGH_THRESH_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_BCN_RSSI_CTL_WEIGHT_MSB 28 -#define MAC_PCU_BCN_RSSI_CTL_WEIGHT_LSB 24 -#define MAC_PCU_BCN_RSSI_CTL_WEIGHT_MASK 0x1f000000 -#define MAC_PCU_BCN_RSSI_CTL_WEIGHT_GET(x) (((x) & 0x1f000000) >> 24) -#define MAC_PCU_BCN_RSSI_CTL_WEIGHT_SET(x) (((x) << 24) & 0x1f000000) -#define MAC_PCU_BCN_RSSI_CTL_RESET_MSB 29 -#define MAC_PCU_BCN_RSSI_CTL_RESET_LSB 29 -#define MAC_PCU_BCN_RSSI_CTL_RESET_MASK 0x20000000 -#define MAC_PCU_BCN_RSSI_CTL_RESET_GET(x) (((x) & 0x20000000) >> 29) -#define MAC_PCU_BCN_RSSI_CTL_RESET_SET(x) (((x) << 29) & 0x20000000) - -/* macros for MAC_PCU_USEC_LATENCY */ -#define MAC_PCU_USEC_LATENCY_ADDRESS 0x0000801c -#define MAC_PCU_USEC_LATENCY_OFFSET 0x0000801c -#define MAC_PCU_USEC_LATENCY_USEC_MSB 7 -#define MAC_PCU_USEC_LATENCY_USEC_LSB 0 -#define MAC_PCU_USEC_LATENCY_USEC_MASK 0x000000ff -#define MAC_PCU_USEC_LATENCY_USEC_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_USEC_LATENCY_USEC_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_USEC_LATENCY_TX_LATENCY_MSB 22 -#define MAC_PCU_USEC_LATENCY_TX_LATENCY_LSB 14 -#define MAC_PCU_USEC_LATENCY_TX_LATENCY_MASK 0x007fc000 -#define MAC_PCU_USEC_LATENCY_TX_LATENCY_GET(x) (((x) & 0x007fc000) >> 14) -#define MAC_PCU_USEC_LATENCY_TX_LATENCY_SET(x) (((x) << 14) & 0x007fc000) -#define MAC_PCU_USEC_LATENCY_RX_LATENCY_MSB 28 -#define MAC_PCU_USEC_LATENCY_RX_LATENCY_LSB 23 -#define MAC_PCU_USEC_LATENCY_RX_LATENCY_MASK 0x1f800000 -#define MAC_PCU_USEC_LATENCY_RX_LATENCY_GET(x) (((x) & 0x1f800000) >> 23) -#define MAC_PCU_USEC_LATENCY_RX_LATENCY_SET(x) (((x) << 23) & 0x1f800000) - -/* macros for MAC_PCU_BCN_RSSI_CTL2 */ -#define MAC_PCU_BCN_RSSI_CTL2_ADDRESS 0x00008020 -#define MAC_PCU_BCN_RSSI_CTL2_OFFSET 0x00008020 -#define MAC_PCU_BCN_RSSI_CTL2_RSSI2_LOW_THRESH_MSB 7 -#define MAC_PCU_BCN_RSSI_CTL2_RSSI2_LOW_THRESH_LSB 0 -#define MAC_PCU_BCN_RSSI_CTL2_RSSI2_LOW_THRESH_MASK 0x000000ff -#define MAC_PCU_BCN_RSSI_CTL2_RSSI2_LOW_THRESH_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_BCN_RSSI_CTL2_RSSI2_LOW_THRESH_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_BCN_RSSI_CTL2_RSSI2_HIGH_THRESH_MSB 23 -#define MAC_PCU_BCN_RSSI_CTL2_RSSI2_HIGH_THRESH_LSB 16 -#define MAC_PCU_BCN_RSSI_CTL2_RSSI2_HIGH_THRESH_MASK 0x00ff0000 -#define MAC_PCU_BCN_RSSI_CTL2_RSSI2_HIGH_THRESH_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_BCN_RSSI_CTL2_RSSI2_HIGH_THRESH_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_BCN_RSSI_CTL2_RESET2_MSB 29 -#define MAC_PCU_BCN_RSSI_CTL2_RESET2_LSB 29 -#define MAC_PCU_BCN_RSSI_CTL2_RESET2_MASK 0x20000000 -#define MAC_PCU_BCN_RSSI_CTL2_RESET2_GET(x) (((x) & 0x20000000) >> 29) -#define MAC_PCU_BCN_RSSI_CTL2_RESET2_SET(x) (((x) << 29) & 0x20000000) - -/* macros for MAC_PCU_BT_WL_1 */ -#define MAC_PCU_BT_WL_1_ADDRESS 0x00008024 -#define MAC_PCU_BT_WL_1_OFFSET 0x00008024 -#define MAC_PCU_BT_WL_1_WEIGHT_MSB 31 -#define MAC_PCU_BT_WL_1_WEIGHT_LSB 0 -#define MAC_PCU_BT_WL_1_WEIGHT_MASK 0xffffffff -#define MAC_PCU_BT_WL_1_WEIGHT_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_BT_WL_1_WEIGHT_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_BT_WL_2 */ -#define MAC_PCU_BT_WL_2_ADDRESS 0x00008028 -#define MAC_PCU_BT_WL_2_OFFSET 0x00008028 -#define MAC_PCU_BT_WL_2_WEIGHT_MSB 31 -#define MAC_PCU_BT_WL_2_WEIGHT_LSB 0 -#define MAC_PCU_BT_WL_2_WEIGHT_MASK 0xffffffff -#define MAC_PCU_BT_WL_2_WEIGHT_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_BT_WL_2_WEIGHT_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_BT_WL_3 */ -#define MAC_PCU_BT_WL_3_ADDRESS 0x0000802c -#define MAC_PCU_BT_WL_3_OFFSET 0x0000802c -#define MAC_PCU_BT_WL_3_WEIGHT_MSB 31 -#define MAC_PCU_BT_WL_3_WEIGHT_LSB 0 -#define MAC_PCU_BT_WL_3_WEIGHT_MASK 0xffffffff -#define MAC_PCU_BT_WL_3_WEIGHT_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_BT_WL_3_WEIGHT_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_BT_WL_4 */ -#define MAC_PCU_BT_WL_4_ADDRESS 0x00008030 -#define MAC_PCU_BT_WL_4_OFFSET 0x00008030 -#define MAC_PCU_BT_WL_4_WEIGHT_MSB 31 -#define MAC_PCU_BT_WL_4_WEIGHT_LSB 0 -#define MAC_PCU_BT_WL_4_WEIGHT_MASK 0xffffffff -#define MAC_PCU_BT_WL_4_WEIGHT_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_BT_WL_4_WEIGHT_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_COEX_EPTA */ -#define MAC_PCU_COEX_EPTA_ADDRESS 0x00008034 -#define MAC_PCU_COEX_EPTA_OFFSET 0x00008034 -#define MAC_PCU_COEX_EPTA_LINKID_MSB 5 -#define MAC_PCU_COEX_EPTA_LINKID_LSB 0 -#define MAC_PCU_COEX_EPTA_LINKID_MASK 0x0000003f -#define MAC_PCU_COEX_EPTA_LINKID_GET(x) (((x) & 0x0000003f) >> 0) -#define MAC_PCU_COEX_EPTA_LINKID_SET(x) (((x) << 0) & 0x0000003f) -#define MAC_PCU_COEX_EPTA_WT_IDX_MSB 12 -#define MAC_PCU_COEX_EPTA_WT_IDX_LSB 6 -#define MAC_PCU_COEX_EPTA_WT_IDX_MASK 0x00001fc0 -#define MAC_PCU_COEX_EPTA_WT_IDX_GET(x) (((x) & 0x00001fc0) >> 6) -#define MAC_PCU_COEX_EPTA_WT_IDX_SET(x) (((x) << 6) & 0x00001fc0) - -/* macros for MAC_PCU_MAX_CFP_DUR */ -#define MAC_PCU_MAX_CFP_DUR_ADDRESS 0x00008038 -#define MAC_PCU_MAX_CFP_DUR_OFFSET 0x00008038 -#define MAC_PCU_MAX_CFP_DUR_VALUE_MSB 15 -#define MAC_PCU_MAX_CFP_DUR_VALUE_LSB 0 -#define MAC_PCU_MAX_CFP_DUR_VALUE_MASK 0x0000ffff -#define MAC_PCU_MAX_CFP_DUR_VALUE_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_MAX_CFP_DUR_VALUE_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_NUMERATOR_MSB 19 -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_NUMERATOR_LSB 16 -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_NUMERATOR_MASK 0x000f0000 -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_NUMERATOR_GET(x) (((x) & 0x000f0000) >> 16) -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_NUMERATOR_SET(x) (((x) << 16) & 0x000f0000) -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_DENOMINATOR_MSB 27 -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_DENOMINATOR_LSB 24 -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_DENOMINATOR_MASK 0x0f000000 -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_DENOMINATOR_GET(x) (((x) & 0x0f000000) >> 24) -#define MAC_PCU_MAX_CFP_DUR_USEC_FRAC_DENOMINATOR_SET(x) (((x) << 24) & 0x0f000000) - -/* macros for MAC_PCU_RX_FILTER */ -#define MAC_PCU_RX_FILTER_ADDRESS 0x0000803c -#define MAC_PCU_RX_FILTER_OFFSET 0x0000803c -#define MAC_PCU_RX_FILTER_UNICAST_MSB 0 -#define MAC_PCU_RX_FILTER_UNICAST_LSB 0 -#define MAC_PCU_RX_FILTER_UNICAST_MASK 0x00000001 -#define MAC_PCU_RX_FILTER_UNICAST_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_RX_FILTER_UNICAST_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_RX_FILTER_MULTICAST_MSB 1 -#define MAC_PCU_RX_FILTER_MULTICAST_LSB 1 -#define MAC_PCU_RX_FILTER_MULTICAST_MASK 0x00000002 -#define MAC_PCU_RX_FILTER_MULTICAST_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_RX_FILTER_MULTICAST_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_RX_FILTER_BROADCAST_MSB 2 -#define MAC_PCU_RX_FILTER_BROADCAST_LSB 2 -#define MAC_PCU_RX_FILTER_BROADCAST_MASK 0x00000004 -#define MAC_PCU_RX_FILTER_BROADCAST_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_RX_FILTER_BROADCAST_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_RX_FILTER_CONTROL_MSB 3 -#define MAC_PCU_RX_FILTER_CONTROL_LSB 3 -#define MAC_PCU_RX_FILTER_CONTROL_MASK 0x00000008 -#define MAC_PCU_RX_FILTER_CONTROL_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_RX_FILTER_CONTROL_SET(x) (((x) << 3) & 0x00000008) -#define MAC_PCU_RX_FILTER_BEACON_MSB 4 -#define MAC_PCU_RX_FILTER_BEACON_LSB 4 -#define MAC_PCU_RX_FILTER_BEACON_MASK 0x00000010 -#define MAC_PCU_RX_FILTER_BEACON_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_PCU_RX_FILTER_BEACON_SET(x) (((x) << 4) & 0x00000010) -#define MAC_PCU_RX_FILTER_PROMISCUOUS_MSB 5 -#define MAC_PCU_RX_FILTER_PROMISCUOUS_LSB 5 -#define MAC_PCU_RX_FILTER_PROMISCUOUS_MASK 0x00000020 -#define MAC_PCU_RX_FILTER_PROMISCUOUS_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_PCU_RX_FILTER_PROMISCUOUS_SET(x) (((x) << 5) & 0x00000020) -#define MAC_PCU_RX_FILTER_XR_POLL_MSB 6 -#define MAC_PCU_RX_FILTER_XR_POLL_LSB 6 -#define MAC_PCU_RX_FILTER_XR_POLL_MASK 0x00000040 -#define MAC_PCU_RX_FILTER_XR_POLL_GET(x) (((x) & 0x00000040) >> 6) -#define MAC_PCU_RX_FILTER_XR_POLL_SET(x) (((x) << 6) & 0x00000040) -#define MAC_PCU_RX_FILTER_PROBE_REQ_MSB 7 -#define MAC_PCU_RX_FILTER_PROBE_REQ_LSB 7 -#define MAC_PCU_RX_FILTER_PROBE_REQ_MASK 0x00000080 -#define MAC_PCU_RX_FILTER_PROBE_REQ_GET(x) (((x) & 0x00000080) >> 7) -#define MAC_PCU_RX_FILTER_PROBE_REQ_SET(x) (((x) << 7) & 0x00000080) -#define MAC_PCU_RX_FILTER_SYNC_FRAME_MSB 8 -#define MAC_PCU_RX_FILTER_SYNC_FRAME_LSB 8 -#define MAC_PCU_RX_FILTER_SYNC_FRAME_MASK 0x00000100 -#define MAC_PCU_RX_FILTER_SYNC_FRAME_GET(x) (((x) & 0x00000100) >> 8) -#define MAC_PCU_RX_FILTER_SYNC_FRAME_SET(x) (((x) << 8) & 0x00000100) -#define MAC_PCU_RX_FILTER_MY_BEACON_MSB 9 -#define MAC_PCU_RX_FILTER_MY_BEACON_LSB 9 -#define MAC_PCU_RX_FILTER_MY_BEACON_MASK 0x00000200 -#define MAC_PCU_RX_FILTER_MY_BEACON_GET(x) (((x) & 0x00000200) >> 9) -#define MAC_PCU_RX_FILTER_MY_BEACON_SET(x) (((x) << 9) & 0x00000200) -#define MAC_PCU_RX_FILTER_COMPRESSED_BAR_MSB 10 -#define MAC_PCU_RX_FILTER_COMPRESSED_BAR_LSB 10 -#define MAC_PCU_RX_FILTER_COMPRESSED_BAR_MASK 0x00000400 -#define MAC_PCU_RX_FILTER_COMPRESSED_BAR_GET(x) (((x) & 0x00000400) >> 10) -#define MAC_PCU_RX_FILTER_COMPRESSED_BAR_SET(x) (((x) << 10) & 0x00000400) -#define MAC_PCU_RX_FILTER_COMPRESSED_BA_MSB 11 -#define MAC_PCU_RX_FILTER_COMPRESSED_BA_LSB 11 -#define MAC_PCU_RX_FILTER_COMPRESSED_BA_MASK 0x00000800 -#define MAC_PCU_RX_FILTER_COMPRESSED_BA_GET(x) (((x) & 0x00000800) >> 11) -#define MAC_PCU_RX_FILTER_COMPRESSED_BA_SET(x) (((x) << 11) & 0x00000800) -#define MAC_PCU_RX_FILTER_UNCOMPRESSED_BA_BAR_MSB 12 -#define MAC_PCU_RX_FILTER_UNCOMPRESSED_BA_BAR_LSB 12 -#define MAC_PCU_RX_FILTER_UNCOMPRESSED_BA_BAR_MASK 0x00001000 -#define MAC_PCU_RX_FILTER_UNCOMPRESSED_BA_BAR_GET(x) (((x) & 0x00001000) >> 12) -#define MAC_PCU_RX_FILTER_UNCOMPRESSED_BA_BAR_SET(x) (((x) << 12) & 0x00001000) -#define MAC_PCU_RX_FILTER_ASSUME_RADAR_MSB 13 -#define MAC_PCU_RX_FILTER_ASSUME_RADAR_LSB 13 -#define MAC_PCU_RX_FILTER_ASSUME_RADAR_MASK 0x00002000 -#define MAC_PCU_RX_FILTER_ASSUME_RADAR_GET(x) (((x) & 0x00002000) >> 13) -#define MAC_PCU_RX_FILTER_ASSUME_RADAR_SET(x) (((x) << 13) & 0x00002000) -#define MAC_PCU_RX_FILTER_PS_POLL_MSB 14 -#define MAC_PCU_RX_FILTER_PS_POLL_LSB 14 -#define MAC_PCU_RX_FILTER_PS_POLL_MASK 0x00004000 -#define MAC_PCU_RX_FILTER_PS_POLL_GET(x) (((x) & 0x00004000) >> 14) -#define MAC_PCU_RX_FILTER_PS_POLL_SET(x) (((x) << 14) & 0x00004000) -#define MAC_PCU_RX_FILTER_MCAST_BCAST_ALL_MSB 15 -#define MAC_PCU_RX_FILTER_MCAST_BCAST_ALL_LSB 15 -#define MAC_PCU_RX_FILTER_MCAST_BCAST_ALL_MASK 0x00008000 -#define MAC_PCU_RX_FILTER_MCAST_BCAST_ALL_GET(x) (((x) & 0x00008000) >> 15) -#define MAC_PCU_RX_FILTER_MCAST_BCAST_ALL_SET(x) (((x) << 15) & 0x00008000) -#define MAC_PCU_RX_FILTER_RST_DLMTR_CNT_DISABLE_MSB 16 -#define MAC_PCU_RX_FILTER_RST_DLMTR_CNT_DISABLE_LSB 16 -#define MAC_PCU_RX_FILTER_RST_DLMTR_CNT_DISABLE_MASK 0x00010000 -#define MAC_PCU_RX_FILTER_RST_DLMTR_CNT_DISABLE_GET(x) (((x) & 0x00010000) >> 16) -#define MAC_PCU_RX_FILTER_RST_DLMTR_CNT_DISABLE_SET(x) (((x) << 16) & 0x00010000) -#define MAC_PCU_RX_FILTER_HW_BCN_PROC_ENABLE_MSB 17 -#define MAC_PCU_RX_FILTER_HW_BCN_PROC_ENABLE_LSB 17 -#define MAC_PCU_RX_FILTER_HW_BCN_PROC_ENABLE_MASK 0x00020000 -#define MAC_PCU_RX_FILTER_HW_BCN_PROC_ENABLE_GET(x) (((x) & 0x00020000) >> 17) -#define MAC_PCU_RX_FILTER_HW_BCN_PROC_ENABLE_SET(x) (((x) << 17) & 0x00020000) -#define MAC_PCU_RX_FILTER_MGMT_ACTION_MCAST_MSB 18 -#define MAC_PCU_RX_FILTER_MGMT_ACTION_MCAST_LSB 18 -#define MAC_PCU_RX_FILTER_MGMT_ACTION_MCAST_MASK 0x00040000 -#define MAC_PCU_RX_FILTER_MGMT_ACTION_MCAST_GET(x) (((x) & 0x00040000) >> 18) -#define MAC_PCU_RX_FILTER_MGMT_ACTION_MCAST_SET(x) (((x) << 18) & 0x00040000) -#define MAC_PCU_RX_FILTER_CONTROL_WRAPPER_MSB 19 -#define MAC_PCU_RX_FILTER_CONTROL_WRAPPER_LSB 19 -#define MAC_PCU_RX_FILTER_CONTROL_WRAPPER_MASK 0x00080000 -#define MAC_PCU_RX_FILTER_CONTROL_WRAPPER_GET(x) (((x) & 0x00080000) >> 19) -#define MAC_PCU_RX_FILTER_CONTROL_WRAPPER_SET(x) (((x) << 19) & 0x00080000) -#define MAC_PCU_RX_FILTER_FROM_TO_DS_MSB 20 -#define MAC_PCU_RX_FILTER_FROM_TO_DS_LSB 20 -#define MAC_PCU_RX_FILTER_FROM_TO_DS_MASK 0x00100000 -#define MAC_PCU_RX_FILTER_FROM_TO_DS_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_PCU_RX_FILTER_FROM_TO_DS_SET(x) (((x) << 20) & 0x00100000) -#define MAC_PCU_RX_FILTER_GENERIC_FTYPE_MSB 26 -#define MAC_PCU_RX_FILTER_GENERIC_FTYPE_LSB 21 -#define MAC_PCU_RX_FILTER_GENERIC_FTYPE_MASK 0x07e00000 -#define MAC_PCU_RX_FILTER_GENERIC_FTYPE_GET(x) (((x) & 0x07e00000) >> 21) -#define MAC_PCU_RX_FILTER_GENERIC_FTYPE_SET(x) (((x) << 21) & 0x07e00000) -#define MAC_PCU_RX_FILTER_GENERIC_FILTER_MSB 28 -#define MAC_PCU_RX_FILTER_GENERIC_FILTER_LSB 27 -#define MAC_PCU_RX_FILTER_GENERIC_FILTER_MASK 0x18000000 -#define MAC_PCU_RX_FILTER_GENERIC_FILTER_GET(x) (((x) & 0x18000000) >> 27) -#define MAC_PCU_RX_FILTER_GENERIC_FILTER_SET(x) (((x) << 27) & 0x18000000) -#define MAC_PCU_RX_FILTER_MY_BEACON2_MSB 29 -#define MAC_PCU_RX_FILTER_MY_BEACON2_LSB 29 -#define MAC_PCU_RX_FILTER_MY_BEACON2_MASK 0x20000000 -#define MAC_PCU_RX_FILTER_MY_BEACON2_GET(x) (((x) & 0x20000000) >> 29) -#define MAC_PCU_RX_FILTER_MY_BEACON2_SET(x) (((x) << 29) & 0x20000000) - -/* macros for MAC_PCU_MCAST_FILTER_L32 */ -#define MAC_PCU_MCAST_FILTER_L32_ADDRESS 0x00008040 -#define MAC_PCU_MCAST_FILTER_L32_OFFSET 0x00008040 -#define MAC_PCU_MCAST_FILTER_L32_VALUE_MSB 31 -#define MAC_PCU_MCAST_FILTER_L32_VALUE_LSB 0 -#define MAC_PCU_MCAST_FILTER_L32_VALUE_MASK 0xffffffff -#define MAC_PCU_MCAST_FILTER_L32_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_MCAST_FILTER_L32_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_MCAST_FILTER_U32 */ -#define MAC_PCU_MCAST_FILTER_U32_ADDRESS 0x00008044 -#define MAC_PCU_MCAST_FILTER_U32_OFFSET 0x00008044 -#define MAC_PCU_MCAST_FILTER_U32_VALUE_MSB 31 -#define MAC_PCU_MCAST_FILTER_U32_VALUE_LSB 0 -#define MAC_PCU_MCAST_FILTER_U32_VALUE_MASK 0xffffffff -#define MAC_PCU_MCAST_FILTER_U32_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_MCAST_FILTER_U32_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_DIAG_SW */ -#define MAC_PCU_DIAG_SW_ADDRESS 0x00008048 -#define MAC_PCU_DIAG_SW_OFFSET 0x00008048 -#define MAC_PCU_DIAG_SW_INVALID_KEY_NO_ACK_MSB 0 -#define MAC_PCU_DIAG_SW_INVALID_KEY_NO_ACK_LSB 0 -#define MAC_PCU_DIAG_SW_INVALID_KEY_NO_ACK_MASK 0x00000001 -#define MAC_PCU_DIAG_SW_INVALID_KEY_NO_ACK_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_DIAG_SW_INVALID_KEY_NO_ACK_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_DIAG_SW_NO_ACK_MSB 1 -#define MAC_PCU_DIAG_SW_NO_ACK_LSB 1 -#define MAC_PCU_DIAG_SW_NO_ACK_MASK 0x00000002 -#define MAC_PCU_DIAG_SW_NO_ACK_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_DIAG_SW_NO_ACK_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_DIAG_SW_NO_CTS_MSB 2 -#define MAC_PCU_DIAG_SW_NO_CTS_LSB 2 -#define MAC_PCU_DIAG_SW_NO_CTS_MASK 0x00000004 -#define MAC_PCU_DIAG_SW_NO_CTS_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_DIAG_SW_NO_CTS_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_DIAG_SW_NO_ENCRYPT_MSB 3 -#define MAC_PCU_DIAG_SW_NO_ENCRYPT_LSB 3 -#define MAC_PCU_DIAG_SW_NO_ENCRYPT_MASK 0x00000008 -#define MAC_PCU_DIAG_SW_NO_ENCRYPT_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_DIAG_SW_NO_ENCRYPT_SET(x) (((x) << 3) & 0x00000008) -#define MAC_PCU_DIAG_SW_NO_DECRYPT_MSB 4 -#define MAC_PCU_DIAG_SW_NO_DECRYPT_LSB 4 -#define MAC_PCU_DIAG_SW_NO_DECRYPT_MASK 0x00000010 -#define MAC_PCU_DIAG_SW_NO_DECRYPT_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_PCU_DIAG_SW_NO_DECRYPT_SET(x) (((x) << 4) & 0x00000010) -#define MAC_PCU_DIAG_SW_HALT_RX_MSB 5 -#define MAC_PCU_DIAG_SW_HALT_RX_LSB 5 -#define MAC_PCU_DIAG_SW_HALT_RX_MASK 0x00000020 -#define MAC_PCU_DIAG_SW_HALT_RX_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_PCU_DIAG_SW_HALT_RX_SET(x) (((x) << 5) & 0x00000020) -#define MAC_PCU_DIAG_SW_LOOP_BACK_MSB 6 -#define MAC_PCU_DIAG_SW_LOOP_BACK_LSB 6 -#define MAC_PCU_DIAG_SW_LOOP_BACK_MASK 0x00000040 -#define MAC_PCU_DIAG_SW_LOOP_BACK_GET(x) (((x) & 0x00000040) >> 6) -#define MAC_PCU_DIAG_SW_LOOP_BACK_SET(x) (((x) << 6) & 0x00000040) -#define MAC_PCU_DIAG_SW_CORRUPT_FCS_MSB 7 -#define MAC_PCU_DIAG_SW_CORRUPT_FCS_LSB 7 -#define MAC_PCU_DIAG_SW_CORRUPT_FCS_MASK 0x00000080 -#define MAC_PCU_DIAG_SW_CORRUPT_FCS_GET(x) (((x) & 0x00000080) >> 7) -#define MAC_PCU_DIAG_SW_CORRUPT_FCS_SET(x) (((x) << 7) & 0x00000080) -#define MAC_PCU_DIAG_SW_DUMP_CHAN_INFO_MSB 8 -#define MAC_PCU_DIAG_SW_DUMP_CHAN_INFO_LSB 8 -#define MAC_PCU_DIAG_SW_DUMP_CHAN_INFO_MASK 0x00000100 -#define MAC_PCU_DIAG_SW_DUMP_CHAN_INFO_GET(x) (((x) & 0x00000100) >> 8) -#define MAC_PCU_DIAG_SW_DUMP_CHAN_INFO_SET(x) (((x) << 8) & 0x00000100) -#define MAC_PCU_DIAG_SW_ACCEPT_NON_V0_MSB 17 -#define MAC_PCU_DIAG_SW_ACCEPT_NON_V0_LSB 17 -#define MAC_PCU_DIAG_SW_ACCEPT_NON_V0_MASK 0x00020000 -#define MAC_PCU_DIAG_SW_ACCEPT_NON_V0_GET(x) (((x) & 0x00020000) >> 17) -#define MAC_PCU_DIAG_SW_ACCEPT_NON_V0_SET(x) (((x) << 17) & 0x00020000) -#define MAC_PCU_DIAG_SW_OBS_SEL_1_0_MSB 19 -#define MAC_PCU_DIAG_SW_OBS_SEL_1_0_LSB 18 -#define MAC_PCU_DIAG_SW_OBS_SEL_1_0_MASK 0x000c0000 -#define MAC_PCU_DIAG_SW_OBS_SEL_1_0_GET(x) (((x) & 0x000c0000) >> 18) -#define MAC_PCU_DIAG_SW_OBS_SEL_1_0_SET(x) (((x) << 18) & 0x000c0000) -#define MAC_PCU_DIAG_SW_RX_CLEAR_HIGH_MSB 20 -#define MAC_PCU_DIAG_SW_RX_CLEAR_HIGH_LSB 20 -#define MAC_PCU_DIAG_SW_RX_CLEAR_HIGH_MASK 0x00100000 -#define MAC_PCU_DIAG_SW_RX_CLEAR_HIGH_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_PCU_DIAG_SW_RX_CLEAR_HIGH_SET(x) (((x) << 20) & 0x00100000) -#define MAC_PCU_DIAG_SW_IGNORE_NAV_MSB 21 -#define MAC_PCU_DIAG_SW_IGNORE_NAV_LSB 21 -#define MAC_PCU_DIAG_SW_IGNORE_NAV_MASK 0x00200000 -#define MAC_PCU_DIAG_SW_IGNORE_NAV_GET(x) (((x) & 0x00200000) >> 21) -#define MAC_PCU_DIAG_SW_IGNORE_NAV_SET(x) (((x) << 21) & 0x00200000) -#define MAC_PCU_DIAG_SW_CHAN_IDLE_HIGH_MSB 22 -#define MAC_PCU_DIAG_SW_CHAN_IDLE_HIGH_LSB 22 -#define MAC_PCU_DIAG_SW_CHAN_IDLE_HIGH_MASK 0x00400000 -#define MAC_PCU_DIAG_SW_CHAN_IDLE_HIGH_GET(x) (((x) & 0x00400000) >> 22) -#define MAC_PCU_DIAG_SW_CHAN_IDLE_HIGH_SET(x) (((x) << 22) & 0x00400000) -#define MAC_PCU_DIAG_SW_PHYERR_ENABLE_EIFS_CTL_MSB 23 -#define MAC_PCU_DIAG_SW_PHYERR_ENABLE_EIFS_CTL_LSB 23 -#define MAC_PCU_DIAG_SW_PHYERR_ENABLE_EIFS_CTL_MASK 0x00800000 -#define MAC_PCU_DIAG_SW_PHYERR_ENABLE_EIFS_CTL_GET(x) (((x) & 0x00800000) >> 23) -#define MAC_PCU_DIAG_SW_PHYERR_ENABLE_EIFS_CTL_SET(x) (((x) << 23) & 0x00800000) -#define MAC_PCU_DIAG_SW_DUAL_CHAIN_CHAN_INFO_MSB 24 -#define MAC_PCU_DIAG_SW_DUAL_CHAIN_CHAN_INFO_LSB 24 -#define MAC_PCU_DIAG_SW_DUAL_CHAIN_CHAN_INFO_MASK 0x01000000 -#define MAC_PCU_DIAG_SW_DUAL_CHAIN_CHAN_INFO_GET(x) (((x) & 0x01000000) >> 24) -#define MAC_PCU_DIAG_SW_DUAL_CHAIN_CHAN_INFO_SET(x) (((x) << 24) & 0x01000000) -#define MAC_PCU_DIAG_SW_FORCE_RX_ABORT_MSB 25 -#define MAC_PCU_DIAG_SW_FORCE_RX_ABORT_LSB 25 -#define MAC_PCU_DIAG_SW_FORCE_RX_ABORT_MASK 0x02000000 -#define MAC_PCU_DIAG_SW_FORCE_RX_ABORT_GET(x) (((x) & 0x02000000) >> 25) -#define MAC_PCU_DIAG_SW_FORCE_RX_ABORT_SET(x) (((x) << 25) & 0x02000000) -#define MAC_PCU_DIAG_SW_SATURATE_CYCLE_CNT_MSB 26 -#define MAC_PCU_DIAG_SW_SATURATE_CYCLE_CNT_LSB 26 -#define MAC_PCU_DIAG_SW_SATURATE_CYCLE_CNT_MASK 0x04000000 -#define MAC_PCU_DIAG_SW_SATURATE_CYCLE_CNT_GET(x) (((x) & 0x04000000) >> 26) -#define MAC_PCU_DIAG_SW_SATURATE_CYCLE_CNT_SET(x) (((x) << 26) & 0x04000000) -#define MAC_PCU_DIAG_SW_OBS_SEL_2_MSB 27 -#define MAC_PCU_DIAG_SW_OBS_SEL_2_LSB 27 -#define MAC_PCU_DIAG_SW_OBS_SEL_2_MASK 0x08000000 -#define MAC_PCU_DIAG_SW_OBS_SEL_2_GET(x) (((x) & 0x08000000) >> 27) -#define MAC_PCU_DIAG_SW_OBS_SEL_2_SET(x) (((x) << 27) & 0x08000000) -#define MAC_PCU_DIAG_SW_RX_CLEAR_CTL_LOW_MSB 28 -#define MAC_PCU_DIAG_SW_RX_CLEAR_CTL_LOW_LSB 28 -#define MAC_PCU_DIAG_SW_RX_CLEAR_CTL_LOW_MASK 0x10000000 -#define MAC_PCU_DIAG_SW_RX_CLEAR_CTL_LOW_GET(x) (((x) & 0x10000000) >> 28) -#define MAC_PCU_DIAG_SW_RX_CLEAR_CTL_LOW_SET(x) (((x) << 28) & 0x10000000) -#define MAC_PCU_DIAG_SW_RX_CLEAR_EXT_LOW_MSB 29 -#define MAC_PCU_DIAG_SW_RX_CLEAR_EXT_LOW_LSB 29 -#define MAC_PCU_DIAG_SW_RX_CLEAR_EXT_LOW_MASK 0x20000000 -#define MAC_PCU_DIAG_SW_RX_CLEAR_EXT_LOW_GET(x) (((x) & 0x20000000) >> 29) -#define MAC_PCU_DIAG_SW_RX_CLEAR_EXT_LOW_SET(x) (((x) << 29) & 0x20000000) -#define MAC_PCU_DIAG_SW_DEBUG_MODE_MSB 31 -#define MAC_PCU_DIAG_SW_DEBUG_MODE_LSB 30 -#define MAC_PCU_DIAG_SW_DEBUG_MODE_MASK 0xc0000000 -#define MAC_PCU_DIAG_SW_DEBUG_MODE_GET(x) (((x) & 0xc0000000) >> 30) -#define MAC_PCU_DIAG_SW_DEBUG_MODE_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for MAC_PCU_TST_ADDAC */ -#define MAC_PCU_TST_ADDAC_ADDRESS 0x00008054 -#define MAC_PCU_TST_ADDAC_OFFSET 0x00008054 -#define MAC_PCU_TST_ADDAC_CONT_TX_MSB 0 -#define MAC_PCU_TST_ADDAC_CONT_TX_LSB 0 -#define MAC_PCU_TST_ADDAC_CONT_TX_MASK 0x00000001 -#define MAC_PCU_TST_ADDAC_CONT_TX_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_TST_ADDAC_CONT_TX_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_TST_ADDAC_TESTMODE_MSB 1 -#define MAC_PCU_TST_ADDAC_TESTMODE_LSB 1 -#define MAC_PCU_TST_ADDAC_TESTMODE_MASK 0x00000002 -#define MAC_PCU_TST_ADDAC_TESTMODE_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_TST_ADDAC_TESTMODE_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_TST_ADDAC_LOOP_MSB 2 -#define MAC_PCU_TST_ADDAC_LOOP_LSB 2 -#define MAC_PCU_TST_ADDAC_LOOP_MASK 0x00000004 -#define MAC_PCU_TST_ADDAC_LOOP_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_TST_ADDAC_LOOP_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_TST_ADDAC_LOOP_LEN_MSB 13 -#define MAC_PCU_TST_ADDAC_LOOP_LEN_LSB 3 -#define MAC_PCU_TST_ADDAC_LOOP_LEN_MASK 0x00003ff8 -#define MAC_PCU_TST_ADDAC_LOOP_LEN_GET(x) (((x) & 0x00003ff8) >> 3) -#define MAC_PCU_TST_ADDAC_LOOP_LEN_SET(x) (((x) << 3) & 0x00003ff8) -#define MAC_PCU_TST_ADDAC_UPPER_8B_MSB 14 -#define MAC_PCU_TST_ADDAC_UPPER_8B_LSB 14 -#define MAC_PCU_TST_ADDAC_UPPER_8B_MASK 0x00004000 -#define MAC_PCU_TST_ADDAC_UPPER_8B_GET(x) (((x) & 0x00004000) >> 14) -#define MAC_PCU_TST_ADDAC_UPPER_8B_SET(x) (((x) << 14) & 0x00004000) -#define MAC_PCU_TST_ADDAC_SAMPLE_SIZE_2K_MSB 15 -#define MAC_PCU_TST_ADDAC_SAMPLE_SIZE_2K_LSB 15 -#define MAC_PCU_TST_ADDAC_SAMPLE_SIZE_2K_MASK 0x00008000 -#define MAC_PCU_TST_ADDAC_SAMPLE_SIZE_2K_GET(x) (((x) & 0x00008000) >> 15) -#define MAC_PCU_TST_ADDAC_SAMPLE_SIZE_2K_SET(x) (((x) << 15) & 0x00008000) -#define MAC_PCU_TST_ADDAC_TRIG_SEL_MSB 16 -#define MAC_PCU_TST_ADDAC_TRIG_SEL_LSB 16 -#define MAC_PCU_TST_ADDAC_TRIG_SEL_MASK 0x00010000 -#define MAC_PCU_TST_ADDAC_TRIG_SEL_GET(x) (((x) & 0x00010000) >> 16) -#define MAC_PCU_TST_ADDAC_TRIG_SEL_SET(x) (((x) << 16) & 0x00010000) -#define MAC_PCU_TST_ADDAC_TRIG_POLARITY_MSB 17 -#define MAC_PCU_TST_ADDAC_TRIG_POLARITY_LSB 17 -#define MAC_PCU_TST_ADDAC_TRIG_POLARITY_MASK 0x00020000 -#define MAC_PCU_TST_ADDAC_TRIG_POLARITY_GET(x) (((x) & 0x00020000) >> 17) -#define MAC_PCU_TST_ADDAC_TRIG_POLARITY_SET(x) (((x) << 17) & 0x00020000) -#define MAC_PCU_TST_ADDAC_CONT_TEST_MSB 18 -#define MAC_PCU_TST_ADDAC_CONT_TEST_LSB 18 -#define MAC_PCU_TST_ADDAC_CONT_TEST_MASK 0x00040000 -#define MAC_PCU_TST_ADDAC_CONT_TEST_GET(x) (((x) & 0x00040000) >> 18) -#define MAC_PCU_TST_ADDAC_TEST_CAPTURE_MSB 19 -#define MAC_PCU_TST_ADDAC_TEST_CAPTURE_LSB 19 -#define MAC_PCU_TST_ADDAC_TEST_CAPTURE_MASK 0x00080000 -#define MAC_PCU_TST_ADDAC_TEST_CAPTURE_GET(x) (((x) & 0x00080000) >> 19) -#define MAC_PCU_TST_ADDAC_TEST_CAPTURE_SET(x) (((x) << 19) & 0x00080000) -#define MAC_PCU_TST_ADDAC_TEST_ARM_MSB 20 -#define MAC_PCU_TST_ADDAC_TEST_ARM_LSB 20 -#define MAC_PCU_TST_ADDAC_TEST_ARM_MASK 0x00100000 -#define MAC_PCU_TST_ADDAC_TEST_ARM_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_PCU_TST_ADDAC_TEST_ARM_SET(x) (((x) << 20) & 0x00100000) - -/* macros for MAC_PCU_DEF_ANTENNA */ -#define MAC_PCU_DEF_ANTENNA_ADDRESS 0x00008058 -#define MAC_PCU_DEF_ANTENNA_OFFSET 0x00008058 -#define MAC_PCU_DEF_ANTENNA_VALUE_MSB 23 -#define MAC_PCU_DEF_ANTENNA_VALUE_LSB 0 -#define MAC_PCU_DEF_ANTENNA_VALUE_MASK 0x00ffffff -#define MAC_PCU_DEF_ANTENNA_VALUE_GET(x) (((x) & 0x00ffffff) >> 0) -#define MAC_PCU_DEF_ANTENNA_VALUE_SET(x) (((x) << 0) & 0x00ffffff) -#define MAC_PCU_DEF_ANTENNA_TX_DEF_ANT_SEL_MSB 24 -#define MAC_PCU_DEF_ANTENNA_TX_DEF_ANT_SEL_LSB 24 -#define MAC_PCU_DEF_ANTENNA_TX_DEF_ANT_SEL_MASK 0x01000000 -#define MAC_PCU_DEF_ANTENNA_TX_DEF_ANT_SEL_GET(x) (((x) & 0x01000000) >> 24) -#define MAC_PCU_DEF_ANTENNA_TX_DEF_ANT_SEL_SET(x) (((x) << 24) & 0x01000000) -#define MAC_PCU_DEF_ANTENNA_SLOW_TX_ANT_EN_MSB 25 -#define MAC_PCU_DEF_ANTENNA_SLOW_TX_ANT_EN_LSB 25 -#define MAC_PCU_DEF_ANTENNA_SLOW_TX_ANT_EN_MASK 0x02000000 -#define MAC_PCU_DEF_ANTENNA_SLOW_TX_ANT_EN_GET(x) (((x) & 0x02000000) >> 25) -#define MAC_PCU_DEF_ANTENNA_SLOW_TX_ANT_EN_SET(x) (((x) << 25) & 0x02000000) -#define MAC_PCU_DEF_ANTENNA_TX_CUR_ANT_MSB 26 -#define MAC_PCU_DEF_ANTENNA_TX_CUR_ANT_LSB 26 -#define MAC_PCU_DEF_ANTENNA_TX_CUR_ANT_MASK 0x04000000 -#define MAC_PCU_DEF_ANTENNA_TX_CUR_ANT_GET(x) (((x) & 0x04000000) >> 26) -#define MAC_PCU_DEF_ANTENNA_TX_CUR_ANT_SET(x) (((x) << 26) & 0x04000000) -#define MAC_PCU_DEF_ANTENNA_FAST_DEF_ANT_MSB 27 -#define MAC_PCU_DEF_ANTENNA_FAST_DEF_ANT_LSB 27 -#define MAC_PCU_DEF_ANTENNA_FAST_DEF_ANT_MASK 0x08000000 -#define MAC_PCU_DEF_ANTENNA_FAST_DEF_ANT_GET(x) (((x) & 0x08000000) >> 27) -#define MAC_PCU_DEF_ANTENNA_FAST_DEF_ANT_SET(x) (((x) << 27) & 0x08000000) -#define MAC_PCU_DEF_ANTENNA_RX_LNA_CONFIG_SEL_MSB 28 -#define MAC_PCU_DEF_ANTENNA_RX_LNA_CONFIG_SEL_LSB 28 -#define MAC_PCU_DEF_ANTENNA_RX_LNA_CONFIG_SEL_MASK 0x10000000 -#define MAC_PCU_DEF_ANTENNA_RX_LNA_CONFIG_SEL_GET(x) (((x) & 0x10000000) >> 28) -#define MAC_PCU_DEF_ANTENNA_RX_LNA_CONFIG_SEL_SET(x) (((x) << 28) & 0x10000000) -#define MAC_PCU_DEF_ANTENNA_FAST_TX_ANT_EN_MSB 29 -#define MAC_PCU_DEF_ANTENNA_FAST_TX_ANT_EN_LSB 29 -#define MAC_PCU_DEF_ANTENNA_FAST_TX_ANT_EN_MASK 0x20000000 -#define MAC_PCU_DEF_ANTENNA_FAST_TX_ANT_EN_GET(x) (((x) & 0x20000000) >> 29) -#define MAC_PCU_DEF_ANTENNA_FAST_TX_ANT_EN_SET(x) (((x) << 29) & 0x20000000) -#define MAC_PCU_DEF_ANTENNA_RX_ANT_EN_MSB 30 -#define MAC_PCU_DEF_ANTENNA_RX_ANT_EN_LSB 30 -#define MAC_PCU_DEF_ANTENNA_RX_ANT_EN_MASK 0x40000000 -#define MAC_PCU_DEF_ANTENNA_RX_ANT_EN_GET(x) (((x) & 0x40000000) >> 30) -#define MAC_PCU_DEF_ANTENNA_RX_ANT_EN_SET(x) (((x) << 30) & 0x40000000) -#define MAC_PCU_DEF_ANTENNA_RX_ANT_DIV_ON_MSB 31 -#define MAC_PCU_DEF_ANTENNA_RX_ANT_DIV_ON_LSB 31 -#define MAC_PCU_DEF_ANTENNA_RX_ANT_DIV_ON_MASK 0x80000000 -#define MAC_PCU_DEF_ANTENNA_RX_ANT_DIV_ON_GET(x) (((x) & 0x80000000) >> 31) -#define MAC_PCU_DEF_ANTENNA_RX_ANT_DIV_ON_SET(x) (((x) << 31) & 0x80000000) - -/* macros for MAC_PCU_AES_MUTE_MASK_0 */ -#define MAC_PCU_AES_MUTE_MASK_0_ADDRESS 0x0000805c -#define MAC_PCU_AES_MUTE_MASK_0_OFFSET 0x0000805c -#define MAC_PCU_AES_MUTE_MASK_0_FC_MSB 15 -#define MAC_PCU_AES_MUTE_MASK_0_FC_LSB 0 -#define MAC_PCU_AES_MUTE_MASK_0_FC_MASK 0x0000ffff -#define MAC_PCU_AES_MUTE_MASK_0_FC_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_AES_MUTE_MASK_0_FC_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_PCU_AES_MUTE_MASK_0_QOS_MSB 31 -#define MAC_PCU_AES_MUTE_MASK_0_QOS_LSB 16 -#define MAC_PCU_AES_MUTE_MASK_0_QOS_MASK 0xffff0000 -#define MAC_PCU_AES_MUTE_MASK_0_QOS_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_PCU_AES_MUTE_MASK_0_QOS_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_PCU_AES_MUTE_MASK_1 */ -#define MAC_PCU_AES_MUTE_MASK_1_ADDRESS 0x00008060 -#define MAC_PCU_AES_MUTE_MASK_1_OFFSET 0x00008060 -#define MAC_PCU_AES_MUTE_MASK_1_SEQ_MSB 15 -#define MAC_PCU_AES_MUTE_MASK_1_SEQ_LSB 0 -#define MAC_PCU_AES_MUTE_MASK_1_SEQ_MASK 0x0000ffff -#define MAC_PCU_AES_MUTE_MASK_1_SEQ_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_AES_MUTE_MASK_1_SEQ_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_PCU_AES_MUTE_MASK_1_FC_MGMT_MSB 31 -#define MAC_PCU_AES_MUTE_MASK_1_FC_MGMT_LSB 16 -#define MAC_PCU_AES_MUTE_MASK_1_FC_MGMT_MASK 0xffff0000 -#define MAC_PCU_AES_MUTE_MASK_1_FC_MGMT_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_PCU_AES_MUTE_MASK_1_FC_MGMT_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_PCU_GATED_CLKS */ -#define MAC_PCU_GATED_CLKS_ADDRESS 0x00008064 -#define MAC_PCU_GATED_CLKS_OFFSET 0x00008064 -#define MAC_PCU_GATED_CLKS_GATED_TX_MSB 1 -#define MAC_PCU_GATED_CLKS_GATED_TX_LSB 1 -#define MAC_PCU_GATED_CLKS_GATED_TX_MASK 0x00000002 -#define MAC_PCU_GATED_CLKS_GATED_TX_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_GATED_CLKS_GATED_TX_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_GATED_CLKS_GATED_RX_MSB 2 -#define MAC_PCU_GATED_CLKS_GATED_RX_LSB 2 -#define MAC_PCU_GATED_CLKS_GATED_RX_MASK 0x00000004 -#define MAC_PCU_GATED_CLKS_GATED_RX_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_GATED_CLKS_GATED_RX_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_GATED_CLKS_GATED_REG_MSB 3 -#define MAC_PCU_GATED_CLKS_GATED_REG_LSB 3 -#define MAC_PCU_GATED_CLKS_GATED_REG_MASK 0x00000008 -#define MAC_PCU_GATED_CLKS_GATED_REG_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_GATED_CLKS_GATED_REG_SET(x) (((x) << 3) & 0x00000008) - -/* macros for MAC_PCU_OBS_BUS_2 */ -#define MAC_PCU_OBS_BUS_2_ADDRESS 0x00008068 -#define MAC_PCU_OBS_BUS_2_OFFSET 0x00008068 -#define MAC_PCU_OBS_BUS_2_VALUE_MSB 17 -#define MAC_PCU_OBS_BUS_2_VALUE_LSB 0 -#define MAC_PCU_OBS_BUS_2_VALUE_MASK 0x0003ffff -#define MAC_PCU_OBS_BUS_2_VALUE_GET(x) (((x) & 0x0003ffff) >> 0) -#define MAC_PCU_OBS_BUS_2_WCF_STATE_MSB 21 -#define MAC_PCU_OBS_BUS_2_WCF_STATE_LSB 18 -#define MAC_PCU_OBS_BUS_2_WCF_STATE_MASK 0x003c0000 -#define MAC_PCU_OBS_BUS_2_WCF_STATE_GET(x) (((x) & 0x003c0000) >> 18) -#define MAC_PCU_OBS_BUS_2_WCF0_FULL_MSB 22 -#define MAC_PCU_OBS_BUS_2_WCF0_FULL_LSB 22 -#define MAC_PCU_OBS_BUS_2_WCF0_FULL_MASK 0x00400000 -#define MAC_PCU_OBS_BUS_2_WCF0_FULL_GET(x) (((x) & 0x00400000) >> 22) -#define MAC_PCU_OBS_BUS_2_WCF1_FULL_MSB 23 -#define MAC_PCU_OBS_BUS_2_WCF1_FULL_LSB 23 -#define MAC_PCU_OBS_BUS_2_WCF1_FULL_MASK 0x00800000 -#define MAC_PCU_OBS_BUS_2_WCF1_FULL_GET(x) (((x) & 0x00800000) >> 23) -#define MAC_PCU_OBS_BUS_2_WCF_COUNT_MSB 28 -#define MAC_PCU_OBS_BUS_2_WCF_COUNT_LSB 24 -#define MAC_PCU_OBS_BUS_2_WCF_COUNT_MASK 0x1f000000 -#define MAC_PCU_OBS_BUS_2_WCF_COUNT_GET(x) (((x) & 0x1f000000) >> 24) -#define MAC_PCU_OBS_BUS_2_MACBB_ALL_AWAKE_MSB 29 -#define MAC_PCU_OBS_BUS_2_MACBB_ALL_AWAKE_LSB 29 -#define MAC_PCU_OBS_BUS_2_MACBB_ALL_AWAKE_MASK 0x20000000 -#define MAC_PCU_OBS_BUS_2_MACBB_ALL_AWAKE_GET(x) (((x) & 0x20000000) >> 29) - -/* macros for MAC_PCU_OBS_BUS_1 */ -#define MAC_PCU_OBS_BUS_1_ADDRESS 0x0000806c -#define MAC_PCU_OBS_BUS_1_OFFSET 0x0000806c -#define MAC_PCU_OBS_BUS_1_PCU_DIRECTED_MSB 0 -#define MAC_PCU_OBS_BUS_1_PCU_DIRECTED_LSB 0 -#define MAC_PCU_OBS_BUS_1_PCU_DIRECTED_MASK 0x00000001 -#define MAC_PCU_OBS_BUS_1_PCU_DIRECTED_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_OBS_BUS_1_PCU_RX_END_MSB 1 -#define MAC_PCU_OBS_BUS_1_PCU_RX_END_LSB 1 -#define MAC_PCU_OBS_BUS_1_PCU_RX_END_MASK 0x00000002 -#define MAC_PCU_OBS_BUS_1_PCU_RX_END_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_OBS_BUS_1_RX_WEP_MSB 2 -#define MAC_PCU_OBS_BUS_1_RX_WEP_LSB 2 -#define MAC_PCU_OBS_BUS_1_RX_WEP_MASK 0x00000004 -#define MAC_PCU_OBS_BUS_1_RX_WEP_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_OBS_BUS_1_RX_MY_BEACON_MSB 3 -#define MAC_PCU_OBS_BUS_1_RX_MY_BEACON_LSB 3 -#define MAC_PCU_OBS_BUS_1_RX_MY_BEACON_MASK 0x00000008 -#define MAC_PCU_OBS_BUS_1_RX_MY_BEACON_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_OBS_BUS_1_FILTER_PASS_MSB 4 -#define MAC_PCU_OBS_BUS_1_FILTER_PASS_LSB 4 -#define MAC_PCU_OBS_BUS_1_FILTER_PASS_MASK 0x00000010 -#define MAC_PCU_OBS_BUS_1_FILTER_PASS_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_PCU_OBS_BUS_1_TX_HCF_MSB 5 -#define MAC_PCU_OBS_BUS_1_TX_HCF_LSB 5 -#define MAC_PCU_OBS_BUS_1_TX_HCF_MASK 0x00000020 -#define MAC_PCU_OBS_BUS_1_TX_HCF_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_PCU_OBS_BUS_1_TM_QUIET_TIME_MSB 6 -#define MAC_PCU_OBS_BUS_1_TM_QUIET_TIME_LSB 6 -#define MAC_PCU_OBS_BUS_1_TM_QUIET_TIME_MASK 0x00000040 -#define MAC_PCU_OBS_BUS_1_TM_QUIET_TIME_GET(x) (((x) & 0x00000040) >> 6) -#define MAC_PCU_OBS_BUS_1_PCU_CHANNEL_IDLE_MSB 7 -#define MAC_PCU_OBS_BUS_1_PCU_CHANNEL_IDLE_LSB 7 -#define MAC_PCU_OBS_BUS_1_PCU_CHANNEL_IDLE_MASK 0x00000080 -#define MAC_PCU_OBS_BUS_1_PCU_CHANNEL_IDLE_GET(x) (((x) & 0x00000080) >> 7) -#define MAC_PCU_OBS_BUS_1_TX_HOLD_MSB 8 -#define MAC_PCU_OBS_BUS_1_TX_HOLD_LSB 8 -#define MAC_PCU_OBS_BUS_1_TX_HOLD_MASK 0x00000100 -#define MAC_PCU_OBS_BUS_1_TX_HOLD_GET(x) (((x) & 0x00000100) >> 8) -#define MAC_PCU_OBS_BUS_1_TX_FRAME_MSB 9 -#define MAC_PCU_OBS_BUS_1_TX_FRAME_LSB 9 -#define MAC_PCU_OBS_BUS_1_TX_FRAME_MASK 0x00000200 -#define MAC_PCU_OBS_BUS_1_TX_FRAME_GET(x) (((x) & 0x00000200) >> 9) -#define MAC_PCU_OBS_BUS_1_RX_FRAME_MSB 10 -#define MAC_PCU_OBS_BUS_1_RX_FRAME_LSB 10 -#define MAC_PCU_OBS_BUS_1_RX_FRAME_MASK 0x00000400 -#define MAC_PCU_OBS_BUS_1_RX_FRAME_GET(x) (((x) & 0x00000400) >> 10) -#define MAC_PCU_OBS_BUS_1_RX_CLEAR_MSB 11 -#define MAC_PCU_OBS_BUS_1_RX_CLEAR_LSB 11 -#define MAC_PCU_OBS_BUS_1_RX_CLEAR_MASK 0x00000800 -#define MAC_PCU_OBS_BUS_1_RX_CLEAR_GET(x) (((x) & 0x00000800) >> 11) -#define MAC_PCU_OBS_BUS_1_WEP_STATE_MSB 17 -#define MAC_PCU_OBS_BUS_1_WEP_STATE_LSB 12 -#define MAC_PCU_OBS_BUS_1_WEP_STATE_MASK 0x0003f000 -#define MAC_PCU_OBS_BUS_1_WEP_STATE_GET(x) (((x) & 0x0003f000) >> 12) -#define MAC_PCU_OBS_BUS_1_RX_STATE_MSB 24 -#define MAC_PCU_OBS_BUS_1_RX_STATE_LSB 20 -#define MAC_PCU_OBS_BUS_1_RX_STATE_MASK 0x01f00000 -#define MAC_PCU_OBS_BUS_1_RX_STATE_GET(x) (((x) & 0x01f00000) >> 20) -#define MAC_PCU_OBS_BUS_1_TX_STATE_MSB 30 -#define MAC_PCU_OBS_BUS_1_TX_STATE_LSB 25 -#define MAC_PCU_OBS_BUS_1_TX_STATE_MASK 0x7e000000 -#define MAC_PCU_OBS_BUS_1_TX_STATE_GET(x) (((x) & 0x7e000000) >> 25) - -/* macros for MAC_PCU_DYM_MIMO_PWR_SAVE */ -#define MAC_PCU_DYM_MIMO_PWR_SAVE_ADDRESS 0x00008070 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_OFFSET 0x00008070 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_USE_MAC_CTRL_MSB 0 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_USE_MAC_CTRL_LSB 0 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_USE_MAC_CTRL_MASK 0x00000001 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_USE_MAC_CTRL_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_USE_MAC_CTRL_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HW_CTRL_EN_MSB 1 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HW_CTRL_EN_LSB 1 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HW_CTRL_EN_MASK 0x00000002 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HW_CTRL_EN_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HW_CTRL_EN_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_SW_CHAIN_MASK_SEL_MSB 2 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_SW_CHAIN_MASK_SEL_LSB 2 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_SW_CHAIN_MASK_SEL_MASK 0x00000004 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_SW_CHAIN_MASK_SEL_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_SW_CHAIN_MASK_SEL_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_LOW_PWR_CHAIN_MASK_MSB 6 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_LOW_PWR_CHAIN_MASK_LSB 4 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_LOW_PWR_CHAIN_MASK_MASK 0x00000070 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_LOW_PWR_CHAIN_MASK_GET(x) (((x) & 0x00000070) >> 4) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_LOW_PWR_CHAIN_MASK_SET(x) (((x) << 4) & 0x00000070) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HI_PWR_CHAIN_MASK_MSB 10 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HI_PWR_CHAIN_MASK_LSB 8 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HI_PWR_CHAIN_MASK_MASK 0x00000700 -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HI_PWR_CHAIN_MASK_GET(x) (((x) & 0x00000700) >> 8) -#define MAC_PCU_DYM_MIMO_PWR_SAVE_HI_PWR_CHAIN_MASK_SET(x) (((x) << 8) & 0x00000700) - -/* macros for MAC_PCU_LAST_BEACON_TSF */ -#define MAC_PCU_LAST_BEACON_TSF_ADDRESS 0x00008080 -#define MAC_PCU_LAST_BEACON_TSF_OFFSET 0x00008080 -#define MAC_PCU_LAST_BEACON_TSF_VALUE_MSB 31 -#define MAC_PCU_LAST_BEACON_TSF_VALUE_LSB 0 -#define MAC_PCU_LAST_BEACON_TSF_VALUE_MASK 0xffffffff -#define MAC_PCU_LAST_BEACON_TSF_VALUE_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_PCU_NAV */ -#define MAC_PCU_NAV_ADDRESS 0x00008084 -#define MAC_PCU_NAV_OFFSET 0x00008084 -#define MAC_PCU_NAV_VALUE_MSB 25 -#define MAC_PCU_NAV_VALUE_LSB 0 -#define MAC_PCU_NAV_VALUE_MASK 0x03ffffff -#define MAC_PCU_NAV_VALUE_GET(x) (((x) & 0x03ffffff) >> 0) -#define MAC_PCU_NAV_VALUE_SET(x) (((x) << 0) & 0x03ffffff) - -/* macros for MAC_PCU_RTS_SUCCESS_CNT */ -#define MAC_PCU_RTS_SUCCESS_CNT_ADDRESS 0x00008088 -#define MAC_PCU_RTS_SUCCESS_CNT_OFFSET 0x00008088 -#define MAC_PCU_RTS_SUCCESS_CNT_VALUE_MSB 15 -#define MAC_PCU_RTS_SUCCESS_CNT_VALUE_LSB 0 -#define MAC_PCU_RTS_SUCCESS_CNT_VALUE_MASK 0x0000ffff -#define MAC_PCU_RTS_SUCCESS_CNT_VALUE_GET(x) (((x) & 0x0000ffff) >> 0) - -/* macros for MAC_PCU_RTS_FAIL_CNT */ -#define MAC_PCU_RTS_FAIL_CNT_ADDRESS 0x0000808c -#define MAC_PCU_RTS_FAIL_CNT_OFFSET 0x0000808c -#define MAC_PCU_RTS_FAIL_CNT_VALUE_MSB 15 -#define MAC_PCU_RTS_FAIL_CNT_VALUE_LSB 0 -#define MAC_PCU_RTS_FAIL_CNT_VALUE_MASK 0x0000ffff -#define MAC_PCU_RTS_FAIL_CNT_VALUE_GET(x) (((x) & 0x0000ffff) >> 0) - -/* macros for MAC_PCU_ACK_FAIL_CNT */ -#define MAC_PCU_ACK_FAIL_CNT_ADDRESS 0x00008090 -#define MAC_PCU_ACK_FAIL_CNT_OFFSET 0x00008090 -#define MAC_PCU_ACK_FAIL_CNT_VALUE_MSB 15 -#define MAC_PCU_ACK_FAIL_CNT_VALUE_LSB 0 -#define MAC_PCU_ACK_FAIL_CNT_VALUE_MASK 0x0000ffff -#define MAC_PCU_ACK_FAIL_CNT_VALUE_GET(x) (((x) & 0x0000ffff) >> 0) - -/* macros for MAC_PCU_FCS_FAIL_CNT */ -#define MAC_PCU_FCS_FAIL_CNT_ADDRESS 0x00008094 -#define MAC_PCU_FCS_FAIL_CNT_OFFSET 0x00008094 -#define MAC_PCU_FCS_FAIL_CNT_VALUE_MSB 15 -#define MAC_PCU_FCS_FAIL_CNT_VALUE_LSB 0 -#define MAC_PCU_FCS_FAIL_CNT_VALUE_MASK 0x0000ffff -#define MAC_PCU_FCS_FAIL_CNT_VALUE_GET(x) (((x) & 0x0000ffff) >> 0) - -/* macros for MAC_PCU_BEACON_CNT */ -#define MAC_PCU_BEACON_CNT_ADDRESS 0x00008098 -#define MAC_PCU_BEACON_CNT_OFFSET 0x00008098 -#define MAC_PCU_BEACON_CNT_VALUE_MSB 15 -#define MAC_PCU_BEACON_CNT_VALUE_LSB 0 -#define MAC_PCU_BEACON_CNT_VALUE_MASK 0x0000ffff -#define MAC_PCU_BEACON_CNT_VALUE_GET(x) (((x) & 0x0000ffff) >> 0) - -/* macros for MAC_PCU_BEACON2_CNT */ -#define MAC_PCU_BEACON2_CNT_ADDRESS 0x0000809c -#define MAC_PCU_BEACON2_CNT_OFFSET 0x0000809c -#define MAC_PCU_BEACON2_CNT_VALUE_MSB 15 -#define MAC_PCU_BEACON2_CNT_VALUE_LSB 0 -#define MAC_PCU_BEACON2_CNT_VALUE_MASK 0x0000ffff -#define MAC_PCU_BEACON2_CNT_VALUE_GET(x) (((x) & 0x0000ffff) >> 0) - -/* macros for MAC_PCU_BASIC_SET */ -#define MAC_PCU_BASIC_SET_ADDRESS 0x000080a0 -#define MAC_PCU_BASIC_SET_OFFSET 0x000080a0 -#define MAC_PCU_BASIC_SET_MCS_MSB 31 -#define MAC_PCU_BASIC_SET_MCS_LSB 0 -#define MAC_PCU_BASIC_SET_MCS_MASK 0xffffffff -#define MAC_PCU_BASIC_SET_MCS_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_BASIC_SET_MCS_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_MGMT_SEQ */ -#define MAC_PCU_MGMT_SEQ_ADDRESS 0x000080a4 -#define MAC_PCU_MGMT_SEQ_OFFSET 0x000080a4 -#define MAC_PCU_MGMT_SEQ_MIN_MSB 11 -#define MAC_PCU_MGMT_SEQ_MIN_LSB 0 -#define MAC_PCU_MGMT_SEQ_MIN_MASK 0x00000fff -#define MAC_PCU_MGMT_SEQ_MIN_GET(x) (((x) & 0x00000fff) >> 0) -#define MAC_PCU_MGMT_SEQ_MIN_SET(x) (((x) << 0) & 0x00000fff) -#define MAC_PCU_MGMT_SEQ_MAX_MSB 27 -#define MAC_PCU_MGMT_SEQ_MAX_LSB 16 -#define MAC_PCU_MGMT_SEQ_MAX_MASK 0x0fff0000 -#define MAC_PCU_MGMT_SEQ_MAX_GET(x) (((x) & 0x0fff0000) >> 16) -#define MAC_PCU_MGMT_SEQ_MAX_SET(x) (((x) << 16) & 0x0fff0000) - -/* macros for MAC_PCU_BF_RPT1 */ -#define MAC_PCU_BF_RPT1_ADDRESS 0x000080a8 -#define MAC_PCU_BF_RPT1_OFFSET 0x000080a8 -#define MAC_PCU_BF_RPT1_V_ACTION_VALUE_MSB 7 -#define MAC_PCU_BF_RPT1_V_ACTION_VALUE_LSB 0 -#define MAC_PCU_BF_RPT1_V_ACTION_VALUE_MASK 0x000000ff -#define MAC_PCU_BF_RPT1_V_ACTION_VALUE_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_BF_RPT1_V_ACTION_VALUE_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_BF_RPT1_CV_ACTION_VALUE_MSB 15 -#define MAC_PCU_BF_RPT1_CV_ACTION_VALUE_LSB 8 -#define MAC_PCU_BF_RPT1_CV_ACTION_VALUE_MASK 0x0000ff00 -#define MAC_PCU_BF_RPT1_CV_ACTION_VALUE_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_BF_RPT1_CV_ACTION_VALUE_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_BF_RPT1_CATEGORY_VALUE_MSB 23 -#define MAC_PCU_BF_RPT1_CATEGORY_VALUE_LSB 16 -#define MAC_PCU_BF_RPT1_CATEGORY_VALUE_MASK 0x00ff0000 -#define MAC_PCU_BF_RPT1_CATEGORY_VALUE_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_BF_RPT1_CATEGORY_VALUE_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_BF_RPT1_FRAME_SUBTYPE_VALUE_MSB 27 -#define MAC_PCU_BF_RPT1_FRAME_SUBTYPE_VALUE_LSB 24 -#define MAC_PCU_BF_RPT1_FRAME_SUBTYPE_VALUE_MASK 0x0f000000 -#define MAC_PCU_BF_RPT1_FRAME_SUBTYPE_VALUE_GET(x) (((x) & 0x0f000000) >> 24) -#define MAC_PCU_BF_RPT1_FRAME_SUBTYPE_VALUE_SET(x) (((x) << 24) & 0x0f000000) -#define MAC_PCU_BF_RPT1_FRAME_TYPE_VALUE_MSB 29 -#define MAC_PCU_BF_RPT1_FRAME_TYPE_VALUE_LSB 28 -#define MAC_PCU_BF_RPT1_FRAME_TYPE_VALUE_MASK 0x30000000 -#define MAC_PCU_BF_RPT1_FRAME_TYPE_VALUE_GET(x) (((x) & 0x30000000) >> 28) -#define MAC_PCU_BF_RPT1_FRAME_TYPE_VALUE_SET(x) (((x) << 28) & 0x30000000) - -/* macros for MAC_PCU_BF_RPT2 */ -#define MAC_PCU_BF_RPT2_ADDRESS 0x000080ac -#define MAC_PCU_BF_RPT2_OFFSET 0x000080ac -#define MAC_PCU_BF_RPT2_FRAME_SUBTYPE_VALUE_MSB 3 -#define MAC_PCU_BF_RPT2_FRAME_SUBTYPE_VALUE_LSB 0 -#define MAC_PCU_BF_RPT2_FRAME_SUBTYPE_VALUE_MASK 0x0000000f -#define MAC_PCU_BF_RPT2_FRAME_SUBTYPE_VALUE_GET(x) (((x) & 0x0000000f) >> 0) -#define MAC_PCU_BF_RPT2_FRAME_SUBTYPE_VALUE_SET(x) (((x) << 0) & 0x0000000f) - -/* macros for MAC_PCU_TX_ANT_1 */ -#define MAC_PCU_TX_ANT_1_ADDRESS 0x000080b0 -#define MAC_PCU_TX_ANT_1_OFFSET 0x000080b0 -#define MAC_PCU_TX_ANT_1_VALUE_MSB 31 -#define MAC_PCU_TX_ANT_1_VALUE_LSB 0 -#define MAC_PCU_TX_ANT_1_VALUE_MASK 0xffffffff -#define MAC_PCU_TX_ANT_1_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_TX_ANT_1_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_TX_ANT_2 */ -#define MAC_PCU_TX_ANT_2_ADDRESS 0x000080b4 -#define MAC_PCU_TX_ANT_2_OFFSET 0x000080b4 -#define MAC_PCU_TX_ANT_2_VALUE_MSB 31 -#define MAC_PCU_TX_ANT_2_VALUE_LSB 0 -#define MAC_PCU_TX_ANT_2_VALUE_MASK 0xffffffff -#define MAC_PCU_TX_ANT_2_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_TX_ANT_2_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_TX_ANT_3 */ -#define MAC_PCU_TX_ANT_3_ADDRESS 0x000080b8 -#define MAC_PCU_TX_ANT_3_OFFSET 0x000080b8 -#define MAC_PCU_TX_ANT_3_VALUE_MSB 31 -#define MAC_PCU_TX_ANT_3_VALUE_LSB 0 -#define MAC_PCU_TX_ANT_3_VALUE_MASK 0xffffffff -#define MAC_PCU_TX_ANT_3_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_TX_ANT_3_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_TX_ANT_4 */ -#define MAC_PCU_TX_ANT_4_ADDRESS 0x000080bc -#define MAC_PCU_TX_ANT_4_OFFSET 0x000080bc -#define MAC_PCU_TX_ANT_4_VALUE_MSB 31 -#define MAC_PCU_TX_ANT_4_VALUE_LSB 0 -#define MAC_PCU_TX_ANT_4_VALUE_MASK 0xffffffff -#define MAC_PCU_TX_ANT_4_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_TX_ANT_4_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_XRMODE */ -#define MAC_PCU_XRMODE_ADDRESS 0x000080c0 -#define MAC_PCU_XRMODE_OFFSET 0x000080c0 -#define MAC_PCU_XRMODE_POLL_TYPE_MSB 5 -#define MAC_PCU_XRMODE_POLL_TYPE_LSB 0 -#define MAC_PCU_XRMODE_POLL_TYPE_MASK 0x0000003f -#define MAC_PCU_XRMODE_POLL_TYPE_GET(x) (((x) & 0x0000003f) >> 0) -#define MAC_PCU_XRMODE_POLL_TYPE_SET(x) (((x) << 0) & 0x0000003f) -#define MAC_PCU_XRMODE_WAIT_FOR_POLL_MSB 7 -#define MAC_PCU_XRMODE_WAIT_FOR_POLL_LSB 7 -#define MAC_PCU_XRMODE_WAIT_FOR_POLL_MASK 0x00000080 -#define MAC_PCU_XRMODE_WAIT_FOR_POLL_GET(x) (((x) & 0x00000080) >> 7) -#define MAC_PCU_XRMODE_WAIT_FOR_POLL_SET(x) (((x) << 7) & 0x00000080) -#define MAC_PCU_XRMODE_FRAME_HOLD_MSB 31 -#define MAC_PCU_XRMODE_FRAME_HOLD_LSB 20 -#define MAC_PCU_XRMODE_FRAME_HOLD_MASK 0xfff00000 -#define MAC_PCU_XRMODE_FRAME_HOLD_GET(x) (((x) & 0xfff00000) >> 20) -#define MAC_PCU_XRMODE_FRAME_HOLD_SET(x) (((x) << 20) & 0xfff00000) - -/* macros for MAC_PCU_XRDEL */ -#define MAC_PCU_XRDEL_ADDRESS 0x000080c4 -#define MAC_PCU_XRDEL_OFFSET 0x000080c4 -#define MAC_PCU_XRDEL_SLOT_DELAY_MSB 15 -#define MAC_PCU_XRDEL_SLOT_DELAY_LSB 0 -#define MAC_PCU_XRDEL_SLOT_DELAY_MASK 0x0000ffff -#define MAC_PCU_XRDEL_SLOT_DELAY_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_XRDEL_SLOT_DELAY_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_PCU_XRDEL_CHIRP_DATA_DELAY_MSB 31 -#define MAC_PCU_XRDEL_CHIRP_DATA_DELAY_LSB 16 -#define MAC_PCU_XRDEL_CHIRP_DATA_DELAY_MASK 0xffff0000 -#define MAC_PCU_XRDEL_CHIRP_DATA_DELAY_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_PCU_XRDEL_CHIRP_DATA_DELAY_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_PCU_XRTO */ -#define MAC_PCU_XRTO_ADDRESS 0x000080c8 -#define MAC_PCU_XRTO_OFFSET 0x000080c8 -#define MAC_PCU_XRTO_CHIRP_TIMEOUT_MSB 15 -#define MAC_PCU_XRTO_CHIRP_TIMEOUT_LSB 0 -#define MAC_PCU_XRTO_CHIRP_TIMEOUT_MASK 0x0000ffff -#define MAC_PCU_XRTO_CHIRP_TIMEOUT_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_XRTO_CHIRP_TIMEOUT_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_PCU_XRTO_POLL_TIMEOUT_MSB 31 -#define MAC_PCU_XRTO_POLL_TIMEOUT_LSB 16 -#define MAC_PCU_XRTO_POLL_TIMEOUT_MASK 0xffff0000 -#define MAC_PCU_XRTO_POLL_TIMEOUT_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_PCU_XRTO_POLL_TIMEOUT_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_PCU_XRCRP */ -#define MAC_PCU_XRCRP_ADDRESS 0x000080cc -#define MAC_PCU_XRCRP_OFFSET 0x000080cc -#define MAC_PCU_XRCRP_SEND_CHIRP_MSB 0 -#define MAC_PCU_XRCRP_SEND_CHIRP_LSB 0 -#define MAC_PCU_XRCRP_SEND_CHIRP_MASK 0x00000001 -#define MAC_PCU_XRCRP_SEND_CHIRP_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_XRCRP_SEND_CHIRP_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_XRCRP_CHIRP_GAP_MSB 31 -#define MAC_PCU_XRCRP_CHIRP_GAP_LSB 16 -#define MAC_PCU_XRCRP_CHIRP_GAP_MASK 0xffff0000 -#define MAC_PCU_XRCRP_CHIRP_GAP_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_PCU_XRCRP_CHIRP_GAP_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_PCU_XRSTMP */ -#define MAC_PCU_XRSTMP_ADDRESS 0x000080d0 -#define MAC_PCU_XRSTMP_OFFSET 0x000080d0 -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_MSB 0 -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_LSB 0 -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_MASK 0x00000001 -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_XRSTMP_RX_ABORT_BSSID_MSB 1 -#define MAC_PCU_XRSTMP_RX_ABORT_BSSID_LSB 1 -#define MAC_PCU_XRSTMP_RX_ABORT_BSSID_MASK 0x00000002 -#define MAC_PCU_XRSTMP_RX_ABORT_BSSID_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_XRSTMP_RX_ABORT_BSSID_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_MSB 2 -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_LSB 2 -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_MASK 0x00000004 -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_XRSTMP_TX_STOMP_BSSID_MSB 3 -#define MAC_PCU_XRSTMP_TX_STOMP_BSSID_LSB 3 -#define MAC_PCU_XRSTMP_TX_STOMP_BSSID_MASK 0x00000008 -#define MAC_PCU_XRSTMP_TX_STOMP_BSSID_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_XRSTMP_TX_STOMP_BSSID_SET(x) (((x) << 3) & 0x00000008) -#define MAC_PCU_XRSTMP_TX_STOMP_DATA_MSB 4 -#define MAC_PCU_XRSTMP_TX_STOMP_DATA_LSB 4 -#define MAC_PCU_XRSTMP_TX_STOMP_DATA_MASK 0x00000010 -#define MAC_PCU_XRSTMP_TX_STOMP_DATA_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_PCU_XRSTMP_TX_STOMP_DATA_SET(x) (((x) << 4) & 0x00000010) -#define MAC_PCU_XRSTMP_RX_ABORT_DATA_MSB 5 -#define MAC_PCU_XRSTMP_RX_ABORT_DATA_LSB 5 -#define MAC_PCU_XRSTMP_RX_ABORT_DATA_MASK 0x00000020 -#define MAC_PCU_XRSTMP_RX_ABORT_DATA_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_PCU_XRSTMP_RX_ABORT_DATA_SET(x) (((x) << 5) & 0x00000020) -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_THRESH_MSB 15 -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_THRESH_LSB 8 -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_THRESH_MASK 0x0000ff00 -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_THRESH_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_XRSTMP_TX_STOMP_RSSI_THRESH_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_THRESH_MSB 23 -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_THRESH_LSB 16 -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_THRESH_MASK 0x00ff0000 -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_THRESH_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_XRSTMP_RX_ABORT_RSSI_THRESH_SET(x) (((x) << 16) & 0x00ff0000) - -/* macros for MAC_PCU_SELF_GEN_DEFAULT */ -#define MAC_PCU_SELF_GEN_DEFAULT_ADDRESS 0x000080dc -#define MAC_PCU_SELF_GEN_DEFAULT_OFFSET 0x000080dc -#define MAC_PCU_SELF_GEN_DEFAULT_MMSS_MSB 2 -#define MAC_PCU_SELF_GEN_DEFAULT_MMSS_LSB 0 -#define MAC_PCU_SELF_GEN_DEFAULT_MMSS_MASK 0x00000007 -#define MAC_PCU_SELF_GEN_DEFAULT_MMSS_GET(x) (((x) & 0x00000007) >> 0) -#define MAC_PCU_SELF_GEN_DEFAULT_MMSS_SET(x) (((x) << 0) & 0x00000007) -#define MAC_PCU_SELF_GEN_DEFAULT_CEC_MSB 4 -#define MAC_PCU_SELF_GEN_DEFAULT_CEC_LSB 3 -#define MAC_PCU_SELF_GEN_DEFAULT_CEC_MASK 0x00000018 -#define MAC_PCU_SELF_GEN_DEFAULT_CEC_GET(x) (((x) & 0x00000018) >> 3) -#define MAC_PCU_SELF_GEN_DEFAULT_CEC_SET(x) (((x) << 3) & 0x00000018) -#define MAC_PCU_SELF_GEN_DEFAULT_STAGGER_SOUNDING_MSB 5 -#define MAC_PCU_SELF_GEN_DEFAULT_STAGGER_SOUNDING_LSB 5 -#define MAC_PCU_SELF_GEN_DEFAULT_STAGGER_SOUNDING_MASK 0x00000020 -#define MAC_PCU_SELF_GEN_DEFAULT_STAGGER_SOUNDING_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_PCU_SELF_GEN_DEFAULT_STAGGER_SOUNDING_SET(x) (((x) << 5) & 0x00000020) - -/* macros for MAC_PCU_ADDR1_MASK_L32 */ -#define MAC_PCU_ADDR1_MASK_L32_ADDRESS 0x000080e0 -#define MAC_PCU_ADDR1_MASK_L32_OFFSET 0x000080e0 -#define MAC_PCU_ADDR1_MASK_L32_VALUE_MSB 31 -#define MAC_PCU_ADDR1_MASK_L32_VALUE_LSB 0 -#define MAC_PCU_ADDR1_MASK_L32_VALUE_MASK 0xffffffff -#define MAC_PCU_ADDR1_MASK_L32_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_ADDR1_MASK_L32_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_ADDR1_MASK_U16 */ -#define MAC_PCU_ADDR1_MASK_U16_ADDRESS 0x000080e4 -#define MAC_PCU_ADDR1_MASK_U16_OFFSET 0x000080e4 -#define MAC_PCU_ADDR1_MASK_U16_VALUE_MSB 15 -#define MAC_PCU_ADDR1_MASK_U16_VALUE_LSB 0 -#define MAC_PCU_ADDR1_MASK_U16_VALUE_MASK 0x0000ffff -#define MAC_PCU_ADDR1_MASK_U16_VALUE_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_ADDR1_MASK_U16_VALUE_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MAC_PCU_TPC */ -#define MAC_PCU_TPC_ADDRESS 0x000080e8 -#define MAC_PCU_TPC_OFFSET 0x000080e8 -#define MAC_PCU_TPC_ACK_PWR_MSB 5 -#define MAC_PCU_TPC_ACK_PWR_LSB 0 -#define MAC_PCU_TPC_ACK_PWR_MASK 0x0000003f -#define MAC_PCU_TPC_ACK_PWR_GET(x) (((x) & 0x0000003f) >> 0) -#define MAC_PCU_TPC_ACK_PWR_SET(x) (((x) << 0) & 0x0000003f) -#define MAC_PCU_TPC_CTS_PWR_MSB 13 -#define MAC_PCU_TPC_CTS_PWR_LSB 8 -#define MAC_PCU_TPC_CTS_PWR_MASK 0x00003f00 -#define MAC_PCU_TPC_CTS_PWR_GET(x) (((x) & 0x00003f00) >> 8) -#define MAC_PCU_TPC_CTS_PWR_SET(x) (((x) << 8) & 0x00003f00) -#define MAC_PCU_TPC_CHIRP_PWR_MSB 21 -#define MAC_PCU_TPC_CHIRP_PWR_LSB 16 -#define MAC_PCU_TPC_CHIRP_PWR_MASK 0x003f0000 -#define MAC_PCU_TPC_CHIRP_PWR_GET(x) (((x) & 0x003f0000) >> 16) -#define MAC_PCU_TPC_CHIRP_PWR_SET(x) (((x) << 16) & 0x003f0000) -#define MAC_PCU_TPC_RPT_PWR_MSB 29 -#define MAC_PCU_TPC_RPT_PWR_LSB 24 -#define MAC_PCU_TPC_RPT_PWR_MASK 0x3f000000 -#define MAC_PCU_TPC_RPT_PWR_GET(x) (((x) & 0x3f000000) >> 24) -#define MAC_PCU_TPC_RPT_PWR_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for MAC_PCU_TX_FRAME_CNT */ -#define MAC_PCU_TX_FRAME_CNT_ADDRESS 0x000080ec -#define MAC_PCU_TX_FRAME_CNT_OFFSET 0x000080ec -#define MAC_PCU_TX_FRAME_CNT_VALUE_MSB 31 -#define MAC_PCU_TX_FRAME_CNT_VALUE_LSB 0 -#define MAC_PCU_TX_FRAME_CNT_VALUE_MASK 0xffffffff -#define MAC_PCU_TX_FRAME_CNT_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_TX_FRAME_CNT_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_RX_FRAME_CNT */ -#define MAC_PCU_RX_FRAME_CNT_ADDRESS 0x000080f0 -#define MAC_PCU_RX_FRAME_CNT_OFFSET 0x000080f0 -#define MAC_PCU_RX_FRAME_CNT_VALUE_MSB 31 -#define MAC_PCU_RX_FRAME_CNT_VALUE_LSB 0 -#define MAC_PCU_RX_FRAME_CNT_VALUE_MASK 0xffffffff -#define MAC_PCU_RX_FRAME_CNT_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_RX_FRAME_CNT_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_RX_CLEAR_CNT */ -#define MAC_PCU_RX_CLEAR_CNT_ADDRESS 0x000080f4 -#define MAC_PCU_RX_CLEAR_CNT_OFFSET 0x000080f4 -#define MAC_PCU_RX_CLEAR_CNT_VALUE_MSB 31 -#define MAC_PCU_RX_CLEAR_CNT_VALUE_LSB 0 -#define MAC_PCU_RX_CLEAR_CNT_VALUE_MASK 0xffffffff -#define MAC_PCU_RX_CLEAR_CNT_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_RX_CLEAR_CNT_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_CYCLE_CNT */ -#define MAC_PCU_CYCLE_CNT_ADDRESS 0x000080f8 -#define MAC_PCU_CYCLE_CNT_OFFSET 0x000080f8 -#define MAC_PCU_CYCLE_CNT_VALUE_MSB 31 -#define MAC_PCU_CYCLE_CNT_VALUE_LSB 0 -#define MAC_PCU_CYCLE_CNT_VALUE_MASK 0xffffffff -#define MAC_PCU_CYCLE_CNT_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_CYCLE_CNT_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_QUIET_TIME_1 */ -#define MAC_PCU_QUIET_TIME_1_ADDRESS 0x000080fc -#define MAC_PCU_QUIET_TIME_1_OFFSET 0x000080fc -#define MAC_PCU_QUIET_TIME_1_ACK_CTS_ENABLE_MSB 17 -#define MAC_PCU_QUIET_TIME_1_ACK_CTS_ENABLE_LSB 17 -#define MAC_PCU_QUIET_TIME_1_ACK_CTS_ENABLE_MASK 0x00020000 -#define MAC_PCU_QUIET_TIME_1_ACK_CTS_ENABLE_GET(x) (((x) & 0x00020000) >> 17) -#define MAC_PCU_QUIET_TIME_1_ACK_CTS_ENABLE_SET(x) (((x) << 17) & 0x00020000) - -/* macros for MAC_PCU_QUIET_TIME_2 */ -#define MAC_PCU_QUIET_TIME_2_ADDRESS 0x00008100 -#define MAC_PCU_QUIET_TIME_2_OFFSET 0x00008100 -#define MAC_PCU_QUIET_TIME_2_DURATION2_MSB 15 -#define MAC_PCU_QUIET_TIME_2_DURATION2_LSB 0 -#define MAC_PCU_QUIET_TIME_2_DURATION2_MASK 0x0000ffff -#define MAC_PCU_QUIET_TIME_2_DURATION2_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_QUIET_TIME_2_DURATION2_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_PCU_QUIET_TIME_2_DURATION_MSB 31 -#define MAC_PCU_QUIET_TIME_2_DURATION_LSB 16 -#define MAC_PCU_QUIET_TIME_2_DURATION_MASK 0xffff0000 -#define MAC_PCU_QUIET_TIME_2_DURATION_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_PCU_QUIET_TIME_2_DURATION_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_PCU_QOS_NO_ACK */ -#define MAC_PCU_QOS_NO_ACK_ADDRESS 0x00008108 -#define MAC_PCU_QOS_NO_ACK_OFFSET 0x00008108 -#define MAC_PCU_QOS_NO_ACK_TWO_BIT_VALUES_MSB 3 -#define MAC_PCU_QOS_NO_ACK_TWO_BIT_VALUES_LSB 0 -#define MAC_PCU_QOS_NO_ACK_TWO_BIT_VALUES_MASK 0x0000000f -#define MAC_PCU_QOS_NO_ACK_TWO_BIT_VALUES_GET(x) (((x) & 0x0000000f) >> 0) -#define MAC_PCU_QOS_NO_ACK_TWO_BIT_VALUES_SET(x) (((x) << 0) & 0x0000000f) -#define MAC_PCU_QOS_NO_ACK_BIT_OFFSET_MSB 6 -#define MAC_PCU_QOS_NO_ACK_BIT_OFFSET_LSB 4 -#define MAC_PCU_QOS_NO_ACK_BIT_OFFSET_MASK 0x00000070 -#define MAC_PCU_QOS_NO_ACK_BIT_OFFSET_GET(x) (((x) & 0x00000070) >> 4) -#define MAC_PCU_QOS_NO_ACK_BIT_OFFSET_SET(x) (((x) << 4) & 0x00000070) -#define MAC_PCU_QOS_NO_ACK_BYTE_OFFSET_MSB 8 -#define MAC_PCU_QOS_NO_ACK_BYTE_OFFSET_LSB 7 -#define MAC_PCU_QOS_NO_ACK_BYTE_OFFSET_MASK 0x00000180 -#define MAC_PCU_QOS_NO_ACK_BYTE_OFFSET_GET(x) (((x) & 0x00000180) >> 7) -#define MAC_PCU_QOS_NO_ACK_BYTE_OFFSET_SET(x) (((x) << 7) & 0x00000180) - -/* macros for MAC_PCU_PHY_ERROR_MASK */ -#define MAC_PCU_PHY_ERROR_MASK_ADDRESS 0x0000810c -#define MAC_PCU_PHY_ERROR_MASK_OFFSET 0x0000810c -#define MAC_PCU_PHY_ERROR_MASK_VALUE_MSB 31 -#define MAC_PCU_PHY_ERROR_MASK_VALUE_LSB 0 -#define MAC_PCU_PHY_ERROR_MASK_VALUE_MASK 0xffffffff -#define MAC_PCU_PHY_ERROR_MASK_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_PHY_ERROR_MASK_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_XRLAT */ -#define MAC_PCU_XRLAT_ADDRESS 0x00008110 -#define MAC_PCU_XRLAT_OFFSET 0x00008110 -#define MAC_PCU_XRLAT_VALUE_MSB 11 -#define MAC_PCU_XRLAT_VALUE_LSB 0 -#define MAC_PCU_XRLAT_VALUE_MASK 0x00000fff -#define MAC_PCU_XRLAT_VALUE_GET(x) (((x) & 0x00000fff) >> 0) -#define MAC_PCU_XRLAT_VALUE_SET(x) (((x) << 0) & 0x00000fff) - -/* macros for MAC_PCU_RXBUF */ -#define MAC_PCU_RXBUF_ADDRESS 0x00008114 -#define MAC_PCU_RXBUF_OFFSET 0x00008114 -#define MAC_PCU_RXBUF_HIGH_PRIORITY_THRSHD_MSB 10 -#define MAC_PCU_RXBUF_HIGH_PRIORITY_THRSHD_LSB 0 -#define MAC_PCU_RXBUF_HIGH_PRIORITY_THRSHD_MASK 0x000007ff -#define MAC_PCU_RXBUF_HIGH_PRIORITY_THRSHD_GET(x) (((x) & 0x000007ff) >> 0) -#define MAC_PCU_RXBUF_HIGH_PRIORITY_THRSHD_SET(x) (((x) << 0) & 0x000007ff) -#define MAC_PCU_RXBUF_REG_RD_ENABLE_MSB 11 -#define MAC_PCU_RXBUF_REG_RD_ENABLE_LSB 11 -#define MAC_PCU_RXBUF_REG_RD_ENABLE_MASK 0x00000800 -#define MAC_PCU_RXBUF_REG_RD_ENABLE_GET(x) (((x) & 0x00000800) >> 11) -#define MAC_PCU_RXBUF_REG_RD_ENABLE_SET(x) (((x) << 11) & 0x00000800) - -/* macros for MAC_PCU_MIC_QOS_CONTROL */ -#define MAC_PCU_MIC_QOS_CONTROL_ADDRESS 0x00008118 -#define MAC_PCU_MIC_QOS_CONTROL_OFFSET 0x00008118 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_0_MSB 1 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_0_LSB 0 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_0_MASK 0x00000003 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_0_GET(x) (((x) & 0x00000003) >> 0) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_0_SET(x) (((x) << 0) & 0x00000003) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_1_MSB 3 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_1_LSB 2 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_1_MASK 0x0000000c -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_1_GET(x) (((x) & 0x0000000c) >> 2) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_1_SET(x) (((x) << 2) & 0x0000000c) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_2_MSB 5 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_2_LSB 4 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_2_MASK 0x00000030 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_2_GET(x) (((x) & 0x00000030) >> 4) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_2_SET(x) (((x) << 4) & 0x00000030) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_3_MSB 7 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_3_LSB 6 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_3_MASK 0x000000c0 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_3_GET(x) (((x) & 0x000000c0) >> 6) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_3_SET(x) (((x) << 6) & 0x000000c0) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_4_MSB 9 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_4_LSB 8 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_4_MASK 0x00000300 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_4_GET(x) (((x) & 0x00000300) >> 8) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_4_SET(x) (((x) << 8) & 0x00000300) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_5_MSB 11 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_5_LSB 10 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_5_MASK 0x00000c00 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_5_GET(x) (((x) & 0x00000c00) >> 10) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_5_SET(x) (((x) << 10) & 0x00000c00) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_6_MSB 13 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_6_LSB 12 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_6_MASK 0x00003000 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_6_GET(x) (((x) & 0x00003000) >> 12) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_6_SET(x) (((x) << 12) & 0x00003000) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_7_MSB 15 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_7_LSB 14 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_7_MASK 0x0000c000 -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_7_GET(x) (((x) & 0x0000c000) >> 14) -#define MAC_PCU_MIC_QOS_CONTROL_VALUE_7_SET(x) (((x) << 14) & 0x0000c000) -#define MAC_PCU_MIC_QOS_CONTROL_ENABLE_MSB 16 -#define MAC_PCU_MIC_QOS_CONTROL_ENABLE_LSB 16 -#define MAC_PCU_MIC_QOS_CONTROL_ENABLE_MASK 0x00010000 -#define MAC_PCU_MIC_QOS_CONTROL_ENABLE_GET(x) (((x) & 0x00010000) >> 16) -#define MAC_PCU_MIC_QOS_CONTROL_ENABLE_SET(x) (((x) << 16) & 0x00010000) - -/* macros for MAC_PCU_MIC_QOS_SELECT */ -#define MAC_PCU_MIC_QOS_SELECT_ADDRESS 0x0000811c -#define MAC_PCU_MIC_QOS_SELECT_OFFSET 0x0000811c -#define MAC_PCU_MIC_QOS_SELECT_VALUE_0_MSB 3 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_0_LSB 0 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_0_MASK 0x0000000f -#define MAC_PCU_MIC_QOS_SELECT_VALUE_0_GET(x) (((x) & 0x0000000f) >> 0) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_0_SET(x) (((x) << 0) & 0x0000000f) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_1_MSB 7 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_1_LSB 4 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_1_MASK 0x000000f0 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_1_GET(x) (((x) & 0x000000f0) >> 4) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_1_SET(x) (((x) << 4) & 0x000000f0) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_2_MSB 11 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_2_LSB 8 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_2_MASK 0x00000f00 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_2_GET(x) (((x) & 0x00000f00) >> 8) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_2_SET(x) (((x) << 8) & 0x00000f00) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_3_MSB 15 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_3_LSB 12 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_3_MASK 0x0000f000 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_3_GET(x) (((x) & 0x0000f000) >> 12) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_3_SET(x) (((x) << 12) & 0x0000f000) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_4_MSB 19 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_4_LSB 16 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_4_MASK 0x000f0000 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_4_GET(x) (((x) & 0x000f0000) >> 16) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_4_SET(x) (((x) << 16) & 0x000f0000) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_5_MSB 23 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_5_LSB 20 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_5_MASK 0x00f00000 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_5_GET(x) (((x) & 0x00f00000) >> 20) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_5_SET(x) (((x) << 20) & 0x00f00000) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_6_MSB 27 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_6_LSB 24 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_6_MASK 0x0f000000 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_6_GET(x) (((x) & 0x0f000000) >> 24) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_6_SET(x) (((x) << 24) & 0x0f000000) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_7_MSB 31 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_7_LSB 28 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_7_MASK 0xf0000000 -#define MAC_PCU_MIC_QOS_SELECT_VALUE_7_GET(x) (((x) & 0xf0000000) >> 28) -#define MAC_PCU_MIC_QOS_SELECT_VALUE_7_SET(x) (((x) << 28) & 0xf0000000) - -/* macros for MAC_PCU_MISC_MODE */ -#define MAC_PCU_MISC_MODE_ADDRESS 0x00008120 -#define MAC_PCU_MISC_MODE_OFFSET 0x00008120 -#define MAC_PCU_MISC_MODE_BSSID_MATCH_FORCE_MSB 0 -#define MAC_PCU_MISC_MODE_BSSID_MATCH_FORCE_LSB 0 -#define MAC_PCU_MISC_MODE_BSSID_MATCH_FORCE_MASK 0x00000001 -#define MAC_PCU_MISC_MODE_BSSID_MATCH_FORCE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_MISC_MODE_BSSID_MATCH_FORCE_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_MISC_MODE_DEBUG_MODE_AD_MSB 1 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_AD_LSB 1 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_AD_MASK 0x00000002 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_AD_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_MISC_MODE_DEBUG_MODE_AD_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_MISC_MODE_MIC_NEW_LOCATION_ENABLE_MSB 2 -#define MAC_PCU_MISC_MODE_MIC_NEW_LOCATION_ENABLE_LSB 2 -#define MAC_PCU_MISC_MODE_MIC_NEW_LOCATION_ENABLE_MASK 0x00000004 -#define MAC_PCU_MISC_MODE_MIC_NEW_LOCATION_ENABLE_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_MISC_MODE_MIC_NEW_LOCATION_ENABLE_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_MISC_MODE_TX_ADD_TSF_MSB 3 -#define MAC_PCU_MISC_MODE_TX_ADD_TSF_LSB 3 -#define MAC_PCU_MISC_MODE_TX_ADD_TSF_MASK 0x00000008 -#define MAC_PCU_MISC_MODE_TX_ADD_TSF_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_MISC_MODE_TX_ADD_TSF_SET(x) (((x) << 3) & 0x00000008) -#define MAC_PCU_MISC_MODE_CCK_SIFS_MODE_MSB 4 -#define MAC_PCU_MISC_MODE_CCK_SIFS_MODE_LSB 4 -#define MAC_PCU_MISC_MODE_CCK_SIFS_MODE_MASK 0x00000010 -#define MAC_PCU_MISC_MODE_CCK_SIFS_MODE_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_PCU_MISC_MODE_CCK_SIFS_MODE_SET(x) (((x) << 4) & 0x00000010) -#define MAC_PCU_MISC_MODE_RXSM2SVD_PRE_RST_MSB 5 -#define MAC_PCU_MISC_MODE_RXSM2SVD_PRE_RST_LSB 5 -#define MAC_PCU_MISC_MODE_RXSM2SVD_PRE_RST_MASK 0x00000020 -#define MAC_PCU_MISC_MODE_RXSM2SVD_PRE_RST_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_PCU_MISC_MODE_RXSM2SVD_PRE_RST_SET(x) (((x) << 5) & 0x00000020) -#define MAC_PCU_MISC_MODE_RCV_DELAY_SOUNDING_IM_TXBF_MSB 6 -#define MAC_PCU_MISC_MODE_RCV_DELAY_SOUNDING_IM_TXBF_LSB 6 -#define MAC_PCU_MISC_MODE_RCV_DELAY_SOUNDING_IM_TXBF_MASK 0x00000040 -#define MAC_PCU_MISC_MODE_RCV_DELAY_SOUNDING_IM_TXBF_GET(x) (((x) & 0x00000040) >> 6) -#define MAC_PCU_MISC_MODE_RCV_DELAY_SOUNDING_IM_TXBF_SET(x) (((x) << 6) & 0x00000040) -#define MAC_PCU_MISC_MODE_DEBUG_MODE_BA_BITMAP_MSB 9 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_BA_BITMAP_LSB 9 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_BA_BITMAP_MASK 0x00000200 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_BA_BITMAP_GET(x) (((x) & 0x00000200) >> 9) -#define MAC_PCU_MISC_MODE_DEBUG_MODE_BA_BITMAP_SET(x) (((x) << 9) & 0x00000200) -#define MAC_PCU_MISC_MODE_DEBUG_MODE_SIFS_MSB 10 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_SIFS_LSB 10 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_SIFS_MASK 0x00000400 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_SIFS_GET(x) (((x) & 0x00000400) >> 10) -#define MAC_PCU_MISC_MODE_DEBUG_MODE_SIFS_SET(x) (((x) << 10) & 0x00000400) -#define MAC_PCU_MISC_MODE_KC_RX_ANT_UPDATE_MSB 11 -#define MAC_PCU_MISC_MODE_KC_RX_ANT_UPDATE_LSB 11 -#define MAC_PCU_MISC_MODE_KC_RX_ANT_UPDATE_MASK 0x00000800 -#define MAC_PCU_MISC_MODE_KC_RX_ANT_UPDATE_GET(x) (((x) & 0x00000800) >> 11) -#define MAC_PCU_MISC_MODE_KC_RX_ANT_UPDATE_SET(x) (((x) << 11) & 0x00000800) -#define MAC_PCU_MISC_MODE_TXOP_TBTT_LIMIT_ENABLE_MSB 12 -#define MAC_PCU_MISC_MODE_TXOP_TBTT_LIMIT_ENABLE_LSB 12 -#define MAC_PCU_MISC_MODE_TXOP_TBTT_LIMIT_ENABLE_MASK 0x00001000 -#define MAC_PCU_MISC_MODE_TXOP_TBTT_LIMIT_ENABLE_GET(x) (((x) & 0x00001000) >> 12) -#define MAC_PCU_MISC_MODE_TXOP_TBTT_LIMIT_ENABLE_SET(x) (((x) << 12) & 0x00001000) -#define MAC_PCU_MISC_MODE_MISS_BEACON_IN_SLEEP_MSB 14 -#define MAC_PCU_MISC_MODE_MISS_BEACON_IN_SLEEP_LSB 14 -#define MAC_PCU_MISC_MODE_MISS_BEACON_IN_SLEEP_MASK 0x00004000 -#define MAC_PCU_MISC_MODE_MISS_BEACON_IN_SLEEP_GET(x) (((x) & 0x00004000) >> 14) -#define MAC_PCU_MISC_MODE_MISS_BEACON_IN_SLEEP_SET(x) (((x) << 14) & 0x00004000) -#define MAC_PCU_MISC_MODE_FORCE_QUIET_COLLISION_MSB 18 -#define MAC_PCU_MISC_MODE_FORCE_QUIET_COLLISION_LSB 18 -#define MAC_PCU_MISC_MODE_FORCE_QUIET_COLLISION_MASK 0x00040000 -#define MAC_PCU_MISC_MODE_FORCE_QUIET_COLLISION_GET(x) (((x) & 0x00040000) >> 18) -#define MAC_PCU_MISC_MODE_FORCE_QUIET_COLLISION_SET(x) (((x) << 18) & 0x00040000) -#define MAC_PCU_MISC_MODE_BT_ANT_PREVENTS_RX_MSB 20 -#define MAC_PCU_MISC_MODE_BT_ANT_PREVENTS_RX_LSB 20 -#define MAC_PCU_MISC_MODE_BT_ANT_PREVENTS_RX_MASK 0x00100000 -#define MAC_PCU_MISC_MODE_BT_ANT_PREVENTS_RX_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_PCU_MISC_MODE_BT_ANT_PREVENTS_RX_SET(x) (((x) << 20) & 0x00100000) -#define MAC_PCU_MISC_MODE_TBTT_PROTECT_MSB 21 -#define MAC_PCU_MISC_MODE_TBTT_PROTECT_LSB 21 -#define MAC_PCU_MISC_MODE_TBTT_PROTECT_MASK 0x00200000 -#define MAC_PCU_MISC_MODE_TBTT_PROTECT_GET(x) (((x) & 0x00200000) >> 21) -#define MAC_PCU_MISC_MODE_TBTT_PROTECT_SET(x) (((x) << 21) & 0x00200000) -#define MAC_PCU_MISC_MODE_HCF_POLL_CANCELS_NAV_MSB 22 -#define MAC_PCU_MISC_MODE_HCF_POLL_CANCELS_NAV_LSB 22 -#define MAC_PCU_MISC_MODE_HCF_POLL_CANCELS_NAV_MASK 0x00400000 -#define MAC_PCU_MISC_MODE_HCF_POLL_CANCELS_NAV_GET(x) (((x) & 0x00400000) >> 22) -#define MAC_PCU_MISC_MODE_HCF_POLL_CANCELS_NAV_SET(x) (((x) << 22) & 0x00400000) -#define MAC_PCU_MISC_MODE_RX_HCF_POLL_ENABLE_MSB 23 -#define MAC_PCU_MISC_MODE_RX_HCF_POLL_ENABLE_LSB 23 -#define MAC_PCU_MISC_MODE_RX_HCF_POLL_ENABLE_MASK 0x00800000 -#define MAC_PCU_MISC_MODE_RX_HCF_POLL_ENABLE_GET(x) (((x) & 0x00800000) >> 23) -#define MAC_PCU_MISC_MODE_RX_HCF_POLL_ENABLE_SET(x) (((x) << 23) & 0x00800000) -#define MAC_PCU_MISC_MODE_CLEAR_VMF_MSB 24 -#define MAC_PCU_MISC_MODE_CLEAR_VMF_LSB 24 -#define MAC_PCU_MISC_MODE_CLEAR_VMF_MASK 0x01000000 -#define MAC_PCU_MISC_MODE_CLEAR_VMF_GET(x) (((x) & 0x01000000) >> 24) -#define MAC_PCU_MISC_MODE_CLEAR_VMF_SET(x) (((x) << 24) & 0x01000000) -#define MAC_PCU_MISC_MODE_CLEAR_FIRST_HCF_MSB 25 -#define MAC_PCU_MISC_MODE_CLEAR_FIRST_HCF_LSB 25 -#define MAC_PCU_MISC_MODE_CLEAR_FIRST_HCF_MASK 0x02000000 -#define MAC_PCU_MISC_MODE_CLEAR_FIRST_HCF_GET(x) (((x) & 0x02000000) >> 25) -#define MAC_PCU_MISC_MODE_CLEAR_FIRST_HCF_SET(x) (((x) << 25) & 0x02000000) -#define MAC_PCU_MISC_MODE_CLEAR_BA_VALID_MSB 26 -#define MAC_PCU_MISC_MODE_CLEAR_BA_VALID_LSB 26 -#define MAC_PCU_MISC_MODE_CLEAR_BA_VALID_MASK 0x04000000 -#define MAC_PCU_MISC_MODE_CLEAR_BA_VALID_GET(x) (((x) & 0x04000000) >> 26) -#define MAC_PCU_MISC_MODE_CLEAR_BA_VALID_SET(x) (((x) << 26) & 0x04000000) -#define MAC_PCU_MISC_MODE_SEL_EVM_MSB 27 -#define MAC_PCU_MISC_MODE_SEL_EVM_LSB 27 -#define MAC_PCU_MISC_MODE_SEL_EVM_MASK 0x08000000 -#define MAC_PCU_MISC_MODE_SEL_EVM_GET(x) (((x) & 0x08000000) >> 27) -#define MAC_PCU_MISC_MODE_SEL_EVM_SET(x) (((x) << 27) & 0x08000000) -#define MAC_PCU_MISC_MODE_ALWAYS_PERFORM_KEY_SEARCH_MSB 28 -#define MAC_PCU_MISC_MODE_ALWAYS_PERFORM_KEY_SEARCH_LSB 28 -#define MAC_PCU_MISC_MODE_ALWAYS_PERFORM_KEY_SEARCH_MASK 0x10000000 -#define MAC_PCU_MISC_MODE_ALWAYS_PERFORM_KEY_SEARCH_GET(x) (((x) & 0x10000000) >> 28) -#define MAC_PCU_MISC_MODE_ALWAYS_PERFORM_KEY_SEARCH_SET(x) (((x) << 28) & 0x10000000) -#define MAC_PCU_MISC_MODE_USE_EOP_PTR_FOR_DMA_WR_MSB 29 -#define MAC_PCU_MISC_MODE_USE_EOP_PTR_FOR_DMA_WR_LSB 29 -#define MAC_PCU_MISC_MODE_USE_EOP_PTR_FOR_DMA_WR_MASK 0x20000000 -#define MAC_PCU_MISC_MODE_USE_EOP_PTR_FOR_DMA_WR_GET(x) (((x) & 0x20000000) >> 29) -#define MAC_PCU_MISC_MODE_USE_EOP_PTR_FOR_DMA_WR_SET(x) (((x) << 29) & 0x20000000) -#define MAC_PCU_MISC_MODE_DEBUG_MODE_MSB 31 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_LSB 30 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_MASK 0xc0000000 -#define MAC_PCU_MISC_MODE_DEBUG_MODE_GET(x) (((x) & 0xc0000000) >> 30) -#define MAC_PCU_MISC_MODE_DEBUG_MODE_SET(x) (((x) << 30) & 0xc0000000) - -/* macros for MAC_PCU_FILTER_OFDM_CNT */ -#define MAC_PCU_FILTER_OFDM_CNT_ADDRESS 0x00008124 -#define MAC_PCU_FILTER_OFDM_CNT_OFFSET 0x00008124 -#define MAC_PCU_FILTER_OFDM_CNT_VALUE_MSB 23 -#define MAC_PCU_FILTER_OFDM_CNT_VALUE_LSB 0 -#define MAC_PCU_FILTER_OFDM_CNT_VALUE_MASK 0x00ffffff -#define MAC_PCU_FILTER_OFDM_CNT_VALUE_GET(x) (((x) & 0x00ffffff) >> 0) -#define MAC_PCU_FILTER_OFDM_CNT_VALUE_SET(x) (((x) << 0) & 0x00ffffff) - -/* macros for MAC_PCU_FILTER_CCK_CNT */ -#define MAC_PCU_FILTER_CCK_CNT_ADDRESS 0x00008128 -#define MAC_PCU_FILTER_CCK_CNT_OFFSET 0x00008128 -#define MAC_PCU_FILTER_CCK_CNT_VALUE_MSB 23 -#define MAC_PCU_FILTER_CCK_CNT_VALUE_LSB 0 -#define MAC_PCU_FILTER_CCK_CNT_VALUE_MASK 0x00ffffff -#define MAC_PCU_FILTER_CCK_CNT_VALUE_GET(x) (((x) & 0x00ffffff) >> 0) -#define MAC_PCU_FILTER_CCK_CNT_VALUE_SET(x) (((x) << 0) & 0x00ffffff) - -/* macros for MAC_PCU_PHY_ERR_CNT_1 */ -#define MAC_PCU_PHY_ERR_CNT_1_ADDRESS 0x0000812c -#define MAC_PCU_PHY_ERR_CNT_1_OFFSET 0x0000812c -#define MAC_PCU_PHY_ERR_CNT_1_VALUE_MSB 23 -#define MAC_PCU_PHY_ERR_CNT_1_VALUE_LSB 0 -#define MAC_PCU_PHY_ERR_CNT_1_VALUE_MASK 0x00ffffff -#define MAC_PCU_PHY_ERR_CNT_1_VALUE_GET(x) (((x) & 0x00ffffff) >> 0) -#define MAC_PCU_PHY_ERR_CNT_1_VALUE_SET(x) (((x) << 0) & 0x00ffffff) - -/* macros for MAC_PCU_PHY_ERR_CNT_1_MASK */ -#define MAC_PCU_PHY_ERR_CNT_1_MASK_ADDRESS 0x00008130 -#define MAC_PCU_PHY_ERR_CNT_1_MASK_OFFSET 0x00008130 -#define MAC_PCU_PHY_ERR_CNT_1_MASK_VALUE_MSB 31 -#define MAC_PCU_PHY_ERR_CNT_1_MASK_VALUE_LSB 0 -#define MAC_PCU_PHY_ERR_CNT_1_MASK_VALUE_MASK 0xffffffff -#define MAC_PCU_PHY_ERR_CNT_1_MASK_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_PHY_ERR_CNT_1_MASK_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_PHY_ERR_CNT_2 */ -#define MAC_PCU_PHY_ERR_CNT_2_ADDRESS 0x00008134 -#define MAC_PCU_PHY_ERR_CNT_2_OFFSET 0x00008134 -#define MAC_PCU_PHY_ERR_CNT_2_VALUE_MSB 23 -#define MAC_PCU_PHY_ERR_CNT_2_VALUE_LSB 0 -#define MAC_PCU_PHY_ERR_CNT_2_VALUE_MASK 0x00ffffff -#define MAC_PCU_PHY_ERR_CNT_2_VALUE_GET(x) (((x) & 0x00ffffff) >> 0) -#define MAC_PCU_PHY_ERR_CNT_2_VALUE_SET(x) (((x) << 0) & 0x00ffffff) - -/* macros for MAC_PCU_PHY_ERR_CNT_2_MASK */ -#define MAC_PCU_PHY_ERR_CNT_2_MASK_ADDRESS 0x00008138 -#define MAC_PCU_PHY_ERR_CNT_2_MASK_OFFSET 0x00008138 -#define MAC_PCU_PHY_ERR_CNT_2_MASK_VALUE_MSB 31 -#define MAC_PCU_PHY_ERR_CNT_2_MASK_VALUE_LSB 0 -#define MAC_PCU_PHY_ERR_CNT_2_MASK_VALUE_MASK 0xffffffff -#define MAC_PCU_PHY_ERR_CNT_2_MASK_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_PHY_ERR_CNT_2_MASK_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_PHY_ERROR_EIFS_MASK */ -#define MAC_PCU_PHY_ERROR_EIFS_MASK_ADDRESS 0x00008144 -#define MAC_PCU_PHY_ERROR_EIFS_MASK_OFFSET 0x00008144 -#define MAC_PCU_PHY_ERROR_EIFS_MASK_VALUE_MSB 31 -#define MAC_PCU_PHY_ERROR_EIFS_MASK_VALUE_LSB 0 -#define MAC_PCU_PHY_ERROR_EIFS_MASK_VALUE_MASK 0xffffffff -#define MAC_PCU_PHY_ERROR_EIFS_MASK_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_PHY_ERROR_EIFS_MASK_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_COEX_LNAMAXGAIN1 */ -#define MAC_PCU_COEX_LNAMAXGAIN1_ADDRESS 0x00008150 -#define MAC_PCU_COEX_LNAMAXGAIN1_OFFSET 0x00008150 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN1_MSB 7 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN1_LSB 0 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN1_MASK 0x000000ff -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN1_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN1_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN2_MSB 15 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN2_LSB 8 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN2_MASK 0x0000ff00 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN2_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN2_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN3_MSB 23 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN3_LSB 16 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN3_MASK 0x00ff0000 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN3_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN3_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN4_MSB 31 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN4_LSB 24 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN4_MASK 0xff000000 -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN4_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_PCU_COEX_LNAMAXGAIN1_MAXGAIN4_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_COEX_LNAMAXGAIN2 */ -#define MAC_PCU_COEX_LNAMAXGAIN2_ADDRESS 0x00008154 -#define MAC_PCU_COEX_LNAMAXGAIN2_OFFSET 0x00008154 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN1_MSB 7 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN1_LSB 0 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN1_MASK 0x000000ff -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN1_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN1_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN2_MSB 15 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN2_LSB 8 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN2_MASK 0x0000ff00 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN2_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN2_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN3_MSB 23 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN3_LSB 16 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN3_MASK 0x00ff0000 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN3_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN3_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN4_MSB 31 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN4_LSB 24 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN4_MASK 0xff000000 -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN4_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_PCU_COEX_LNAMAXGAIN2_MAXGAIN4_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_COEX_LNAMAXGAIN3 */ -#define MAC_PCU_COEX_LNAMAXGAIN3_ADDRESS 0x00008158 -#define MAC_PCU_COEX_LNAMAXGAIN3_OFFSET 0x00008158 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN1_MSB 7 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN1_LSB 0 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN1_MASK 0x000000ff -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN1_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN1_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN2_MSB 15 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN2_LSB 8 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN2_MASK 0x0000ff00 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN2_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN2_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN3_MSB 23 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN3_LSB 16 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN3_MASK 0x00ff0000 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN3_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN3_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN4_MSB 31 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN4_LSB 24 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN4_MASK 0xff000000 -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN4_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_PCU_COEX_LNAMAXGAIN3_MAXGAIN4_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_COEX_LNAMAXGAIN4 */ -#define MAC_PCU_COEX_LNAMAXGAIN4_ADDRESS 0x0000815c -#define MAC_PCU_COEX_LNAMAXGAIN4_OFFSET 0x0000815c -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN1_MSB 7 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN1_LSB 0 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN1_MASK 0x000000ff -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN1_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN1_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN2_MSB 15 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN2_LSB 8 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN2_MASK 0x0000ff00 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN2_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN2_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN3_MSB 23 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN3_LSB 16 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN3_MASK 0x00ff0000 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN3_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN3_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN4_MSB 31 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN4_LSB 24 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN4_MASK 0xff000000 -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN4_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_PCU_COEX_LNAMAXGAIN4_MAXGAIN4_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_PHY_ERR_CNT_3 */ -#define MAC_PCU_PHY_ERR_CNT_3_ADDRESS 0x00008168 -#define MAC_PCU_PHY_ERR_CNT_3_OFFSET 0x00008168 -#define MAC_PCU_PHY_ERR_CNT_3_VALUE_MSB 23 -#define MAC_PCU_PHY_ERR_CNT_3_VALUE_LSB 0 -#define MAC_PCU_PHY_ERR_CNT_3_VALUE_MASK 0x00ffffff -#define MAC_PCU_PHY_ERR_CNT_3_VALUE_GET(x) (((x) & 0x00ffffff) >> 0) -#define MAC_PCU_PHY_ERR_CNT_3_VALUE_SET(x) (((x) << 0) & 0x00ffffff) - -/* macros for MAC_PCU_PHY_ERR_CNT_3_MASK */ -#define MAC_PCU_PHY_ERR_CNT_3_MASK_ADDRESS 0x0000816c -#define MAC_PCU_PHY_ERR_CNT_3_MASK_OFFSET 0x0000816c -#define MAC_PCU_PHY_ERR_CNT_3_MASK_VALUE_MSB 31 -#define MAC_PCU_PHY_ERR_CNT_3_MASK_VALUE_LSB 0 -#define MAC_PCU_PHY_ERR_CNT_3_MASK_VALUE_MASK 0xffffffff -#define MAC_PCU_PHY_ERR_CNT_3_MASK_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_PHY_ERR_CNT_3_MASK_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_BLUETOOTH_MODE */ -#define MAC_PCU_BLUETOOTH_MODE_ADDRESS 0x00008170 -#define MAC_PCU_BLUETOOTH_MODE_OFFSET 0x00008170 -#define MAC_PCU_BLUETOOTH_MODE_TIME_EXTEND_MSB 7 -#define MAC_PCU_BLUETOOTH_MODE_TIME_EXTEND_LSB 0 -#define MAC_PCU_BLUETOOTH_MODE_TIME_EXTEND_MASK 0x000000ff -#define MAC_PCU_BLUETOOTH_MODE_TIME_EXTEND_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_BLUETOOTH_MODE_TIME_EXTEND_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_BLUETOOTH_MODE_TX_STATE_EXTEND_MSB 8 -#define MAC_PCU_BLUETOOTH_MODE_TX_STATE_EXTEND_LSB 8 -#define MAC_PCU_BLUETOOTH_MODE_TX_STATE_EXTEND_MASK 0x00000100 -#define MAC_PCU_BLUETOOTH_MODE_TX_STATE_EXTEND_GET(x) (((x) & 0x00000100) >> 8) -#define MAC_PCU_BLUETOOTH_MODE_TX_STATE_EXTEND_SET(x) (((x) << 8) & 0x00000100) -#define MAC_PCU_BLUETOOTH_MODE_TX_FRAME_EXTEND_MSB 9 -#define MAC_PCU_BLUETOOTH_MODE_TX_FRAME_EXTEND_LSB 9 -#define MAC_PCU_BLUETOOTH_MODE_TX_FRAME_EXTEND_MASK 0x00000200 -#define MAC_PCU_BLUETOOTH_MODE_TX_FRAME_EXTEND_GET(x) (((x) & 0x00000200) >> 9) -#define MAC_PCU_BLUETOOTH_MODE_TX_FRAME_EXTEND_SET(x) (((x) << 9) & 0x00000200) -#define MAC_PCU_BLUETOOTH_MODE_MODE_MSB 11 -#define MAC_PCU_BLUETOOTH_MODE_MODE_LSB 10 -#define MAC_PCU_BLUETOOTH_MODE_MODE_MASK 0x00000c00 -#define MAC_PCU_BLUETOOTH_MODE_MODE_GET(x) (((x) & 0x00000c00) >> 10) -#define MAC_PCU_BLUETOOTH_MODE_MODE_SET(x) (((x) << 10) & 0x00000c00) -#define MAC_PCU_BLUETOOTH_MODE_QUIET_MSB 12 -#define MAC_PCU_BLUETOOTH_MODE_QUIET_LSB 12 -#define MAC_PCU_BLUETOOTH_MODE_QUIET_MASK 0x00001000 -#define MAC_PCU_BLUETOOTH_MODE_QUIET_GET(x) (((x) & 0x00001000) >> 12) -#define MAC_PCU_BLUETOOTH_MODE_QUIET_SET(x) (((x) << 12) & 0x00001000) -#define MAC_PCU_BLUETOOTH_MODE_QCU_THRESH_MSB 16 -#define MAC_PCU_BLUETOOTH_MODE_QCU_THRESH_LSB 13 -#define MAC_PCU_BLUETOOTH_MODE_QCU_THRESH_MASK 0x0001e000 -#define MAC_PCU_BLUETOOTH_MODE_QCU_THRESH_GET(x) (((x) & 0x0001e000) >> 13) -#define MAC_PCU_BLUETOOTH_MODE_QCU_THRESH_SET(x) (((x) << 13) & 0x0001e000) -#define MAC_PCU_BLUETOOTH_MODE_RX_CLEAR_POLARITY_MSB 17 -#define MAC_PCU_BLUETOOTH_MODE_RX_CLEAR_POLARITY_LSB 17 -#define MAC_PCU_BLUETOOTH_MODE_RX_CLEAR_POLARITY_MASK 0x00020000 -#define MAC_PCU_BLUETOOTH_MODE_RX_CLEAR_POLARITY_GET(x) (((x) & 0x00020000) >> 17) -#define MAC_PCU_BLUETOOTH_MODE_RX_CLEAR_POLARITY_SET(x) (((x) << 17) & 0x00020000) -#define MAC_PCU_BLUETOOTH_MODE_PRIORITY_TIME_MSB 23 -#define MAC_PCU_BLUETOOTH_MODE_PRIORITY_TIME_LSB 18 -#define MAC_PCU_BLUETOOTH_MODE_PRIORITY_TIME_MASK 0x00fc0000 -#define MAC_PCU_BLUETOOTH_MODE_PRIORITY_TIME_GET(x) (((x) & 0x00fc0000) >> 18) -#define MAC_PCU_BLUETOOTH_MODE_PRIORITY_TIME_SET(x) (((x) << 18) & 0x00fc0000) -#define MAC_PCU_BLUETOOTH_MODE_FIRST_SLOT_TIME_MSB 31 -#define MAC_PCU_BLUETOOTH_MODE_FIRST_SLOT_TIME_LSB 24 -#define MAC_PCU_BLUETOOTH_MODE_FIRST_SLOT_TIME_MASK 0xff000000 -#define MAC_PCU_BLUETOOTH_MODE_FIRST_SLOT_TIME_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_PCU_BLUETOOTH_MODE_FIRST_SLOT_TIME_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_HCF_TIMEOUT */ -#define MAC_PCU_HCF_TIMEOUT_ADDRESS 0x00008178 -#define MAC_PCU_HCF_TIMEOUT_OFFSET 0x00008178 -#define MAC_PCU_HCF_TIMEOUT_VALUE_MSB 15 -#define MAC_PCU_HCF_TIMEOUT_VALUE_LSB 0 -#define MAC_PCU_HCF_TIMEOUT_VALUE_MASK 0x0000ffff -#define MAC_PCU_HCF_TIMEOUT_VALUE_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_HCF_TIMEOUT_VALUE_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MAC_PCU_BLUETOOTH_MODE2 */ -#define MAC_PCU_BLUETOOTH_MODE2_ADDRESS 0x0000817c -#define MAC_PCU_BLUETOOTH_MODE2_OFFSET 0x0000817c -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_THRESH_MSB 7 -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_THRESH_LSB 0 -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_THRESH_MASK 0x000000ff -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_THRESH_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_THRESH_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_CNT_MSB 15 -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_CNT_LSB 8 -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_CNT_MASK 0x0000ff00 -#define MAC_PCU_BLUETOOTH_MODE2_BCN_MISS_CNT_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_BLUETOOTH_MODE2_HOLD_RX_CLEAR_MSB 16 -#define MAC_PCU_BLUETOOTH_MODE2_HOLD_RX_CLEAR_LSB 16 -#define MAC_PCU_BLUETOOTH_MODE2_HOLD_RX_CLEAR_MASK 0x00010000 -#define MAC_PCU_BLUETOOTH_MODE2_HOLD_RX_CLEAR_GET(x) (((x) & 0x00010000) >> 16) -#define MAC_PCU_BLUETOOTH_MODE2_HOLD_RX_CLEAR_SET(x) (((x) << 16) & 0x00010000) -#define MAC_PCU_BLUETOOTH_MODE2_SLEEP_ALLOW_BT_ACCESS_MSB 17 -#define MAC_PCU_BLUETOOTH_MODE2_SLEEP_ALLOW_BT_ACCESS_LSB 17 -#define MAC_PCU_BLUETOOTH_MODE2_SLEEP_ALLOW_BT_ACCESS_MASK 0x00020000 -#define MAC_PCU_BLUETOOTH_MODE2_SLEEP_ALLOW_BT_ACCESS_GET(x) (((x) & 0x00020000) >> 17) -#define MAC_PCU_BLUETOOTH_MODE2_SLEEP_ALLOW_BT_ACCESS_SET(x) (((x) << 17) & 0x00020000) -#define MAC_PCU_BLUETOOTH_MODE2_PROTECT_BT_AFTER_WAKEUP_MSB 19 -#define MAC_PCU_BLUETOOTH_MODE2_PROTECT_BT_AFTER_WAKEUP_LSB 19 -#define MAC_PCU_BLUETOOTH_MODE2_PROTECT_BT_AFTER_WAKEUP_MASK 0x00080000 -#define MAC_PCU_BLUETOOTH_MODE2_PROTECT_BT_AFTER_WAKEUP_GET(x) (((x) & 0x00080000) >> 19) -#define MAC_PCU_BLUETOOTH_MODE2_PROTECT_BT_AFTER_WAKEUP_SET(x) (((x) << 19) & 0x00080000) -#define MAC_PCU_BLUETOOTH_MODE2_DISABLE_BT_ANT_MSB 20 -#define MAC_PCU_BLUETOOTH_MODE2_DISABLE_BT_ANT_LSB 20 -#define MAC_PCU_BLUETOOTH_MODE2_DISABLE_BT_ANT_MASK 0x00100000 -#define MAC_PCU_BLUETOOTH_MODE2_DISABLE_BT_ANT_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_PCU_BLUETOOTH_MODE2_DISABLE_BT_ANT_SET(x) (((x) << 20) & 0x00100000) -#define MAC_PCU_BLUETOOTH_MODE2_QUIET_2_WIRE_MSB 21 -#define MAC_PCU_BLUETOOTH_MODE2_QUIET_2_WIRE_LSB 21 -#define MAC_PCU_BLUETOOTH_MODE2_QUIET_2_WIRE_MASK 0x00200000 -#define MAC_PCU_BLUETOOTH_MODE2_QUIET_2_WIRE_GET(x) (((x) & 0x00200000) >> 21) -#define MAC_PCU_BLUETOOTH_MODE2_QUIET_2_WIRE_SET(x) (((x) << 21) & 0x00200000) -#define MAC_PCU_BLUETOOTH_MODE2_WL_ACTIVE_MODE_MSB 23 -#define MAC_PCU_BLUETOOTH_MODE2_WL_ACTIVE_MODE_LSB 22 -#define MAC_PCU_BLUETOOTH_MODE2_WL_ACTIVE_MODE_MASK 0x00c00000 -#define MAC_PCU_BLUETOOTH_MODE2_WL_ACTIVE_MODE_GET(x) (((x) & 0x00c00000) >> 22) -#define MAC_PCU_BLUETOOTH_MODE2_WL_ACTIVE_MODE_SET(x) (((x) << 22) & 0x00c00000) -#define MAC_PCU_BLUETOOTH_MODE2_WL_TXRX_SEPARATE_MSB 24 -#define MAC_PCU_BLUETOOTH_MODE2_WL_TXRX_SEPARATE_LSB 24 -#define MAC_PCU_BLUETOOTH_MODE2_WL_TXRX_SEPARATE_MASK 0x01000000 -#define MAC_PCU_BLUETOOTH_MODE2_WL_TXRX_SEPARATE_GET(x) (((x) & 0x01000000) >> 24) -#define MAC_PCU_BLUETOOTH_MODE2_WL_TXRX_SEPARATE_SET(x) (((x) << 24) & 0x01000000) -#define MAC_PCU_BLUETOOTH_MODE2_RS_DISCARD_EXTEND_MSB 25 -#define MAC_PCU_BLUETOOTH_MODE2_RS_DISCARD_EXTEND_LSB 25 -#define MAC_PCU_BLUETOOTH_MODE2_RS_DISCARD_EXTEND_MASK 0x02000000 -#define MAC_PCU_BLUETOOTH_MODE2_RS_DISCARD_EXTEND_GET(x) (((x) & 0x02000000) >> 25) -#define MAC_PCU_BLUETOOTH_MODE2_RS_DISCARD_EXTEND_SET(x) (((x) << 25) & 0x02000000) -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_ACTIVE_CTRL_MSB 27 -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_ACTIVE_CTRL_LSB 26 -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_ACTIVE_CTRL_MASK 0x0c000000 -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_ACTIVE_CTRL_GET(x) (((x) & 0x0c000000) >> 26) -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_ACTIVE_CTRL_SET(x) (((x) << 26) & 0x0c000000) -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_PRIORITY_CTRL_MSB 29 -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_PRIORITY_CTRL_LSB 28 -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_PRIORITY_CTRL_MASK 0x30000000 -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_PRIORITY_CTRL_GET(x) (((x) & 0x30000000) >> 28) -#define MAC_PCU_BLUETOOTH_MODE2_TSF_BT_PRIORITY_CTRL_SET(x) (((x) << 28) & 0x30000000) -#define MAC_PCU_BLUETOOTH_MODE2_INTERRUPT_ENABLE_MSB 30 -#define MAC_PCU_BLUETOOTH_MODE2_INTERRUPT_ENABLE_LSB 30 -#define MAC_PCU_BLUETOOTH_MODE2_INTERRUPT_ENABLE_MASK 0x40000000 -#define MAC_PCU_BLUETOOTH_MODE2_INTERRUPT_ENABLE_GET(x) (((x) & 0x40000000) >> 30) -#define MAC_PCU_BLUETOOTH_MODE2_INTERRUPT_ENABLE_SET(x) (((x) << 30) & 0x40000000) -#define MAC_PCU_BLUETOOTH_MODE2_PHY_ERR_BT_COLL_ENABLE_MSB 31 -#define MAC_PCU_BLUETOOTH_MODE2_PHY_ERR_BT_COLL_ENABLE_LSB 31 -#define MAC_PCU_BLUETOOTH_MODE2_PHY_ERR_BT_COLL_ENABLE_MASK 0x80000000 -#define MAC_PCU_BLUETOOTH_MODE2_PHY_ERR_BT_COLL_ENABLE_GET(x) (((x) & 0x80000000) >> 31) -#define MAC_PCU_BLUETOOTH_MODE2_PHY_ERR_BT_COLL_ENABLE_SET(x) (((x) << 31) & 0x80000000) - -/* macros for MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE */ -#define MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_ADDRESS 0x000081c8 -#define MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_OFFSET 0x000081c8 -#define MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_VALUE_MSB 31 -#define MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_VALUE_LSB 0 -#define MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_VALUE_MASK 0xffffffff -#define MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE_VALUE_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY */ -#define MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_ADDRESS 0x000081cc -#define MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_OFFSET 0x000081cc -#define MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_VALUE_MSB 31 -#define MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_VALUE_LSB 0 -#define MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_VALUE_MASK 0xffffffff -#define MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY_VALUE_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_PCU_TXSIFS */ -#define MAC_PCU_TXSIFS_ADDRESS 0x000081d0 -#define MAC_PCU_TXSIFS_OFFSET 0x000081d0 -#define MAC_PCU_TXSIFS_SIFS_TIME_MSB 7 -#define MAC_PCU_TXSIFS_SIFS_TIME_LSB 0 -#define MAC_PCU_TXSIFS_SIFS_TIME_MASK 0x000000ff -#define MAC_PCU_TXSIFS_SIFS_TIME_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_TXSIFS_SIFS_TIME_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_TXSIFS_TX_LATENCY_MSB 11 -#define MAC_PCU_TXSIFS_TX_LATENCY_LSB 8 -#define MAC_PCU_TXSIFS_TX_LATENCY_MASK 0x00000f00 -#define MAC_PCU_TXSIFS_TX_LATENCY_GET(x) (((x) & 0x00000f00) >> 8) -#define MAC_PCU_TXSIFS_TX_LATENCY_SET(x) (((x) << 8) & 0x00000f00) -#define MAC_PCU_TXSIFS_ACK_SHIFT_MSB 14 -#define MAC_PCU_TXSIFS_ACK_SHIFT_LSB 12 -#define MAC_PCU_TXSIFS_ACK_SHIFT_MASK 0x00007000 -#define MAC_PCU_TXSIFS_ACK_SHIFT_GET(x) (((x) & 0x00007000) >> 12) -#define MAC_PCU_TXSIFS_ACK_SHIFT_SET(x) (((x) << 12) & 0x00007000) - -/* macros for MAC_PCU_BLUETOOTH_MODE3 */ -#define MAC_PCU_BLUETOOTH_MODE3_ADDRESS 0x000081d4 -#define MAC_PCU_BLUETOOTH_MODE3_OFFSET 0x000081d4 -#define MAC_PCU_BLUETOOTH_MODE3_WL_ACTIVE_TIME_MSB 7 -#define MAC_PCU_BLUETOOTH_MODE3_WL_ACTIVE_TIME_LSB 0 -#define MAC_PCU_BLUETOOTH_MODE3_WL_ACTIVE_TIME_MASK 0x000000ff -#define MAC_PCU_BLUETOOTH_MODE3_WL_ACTIVE_TIME_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_BLUETOOTH_MODE3_WL_ACTIVE_TIME_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_BLUETOOTH_MODE3_WL_QC_TIME_MSB 15 -#define MAC_PCU_BLUETOOTH_MODE3_WL_QC_TIME_LSB 8 -#define MAC_PCU_BLUETOOTH_MODE3_WL_QC_TIME_MASK 0x0000ff00 -#define MAC_PCU_BLUETOOTH_MODE3_WL_QC_TIME_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_BLUETOOTH_MODE3_WL_QC_TIME_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_BLUETOOTH_MODE3_ALLOW_CONCURRENT_ACCESS_MSB 19 -#define MAC_PCU_BLUETOOTH_MODE3_ALLOW_CONCURRENT_ACCESS_LSB 16 -#define MAC_PCU_BLUETOOTH_MODE3_ALLOW_CONCURRENT_ACCESS_MASK 0x000f0000 -#define MAC_PCU_BLUETOOTH_MODE3_ALLOW_CONCURRENT_ACCESS_GET(x) (((x) & 0x000f0000) >> 16) -#define MAC_PCU_BLUETOOTH_MODE3_ALLOW_CONCURRENT_ACCESS_SET(x) (((x) << 16) & 0x000f0000) -#define MAC_PCU_BLUETOOTH_MODE3_AGC_SATURATION_CNT_ENABLE_MSB 20 -#define MAC_PCU_BLUETOOTH_MODE3_AGC_SATURATION_CNT_ENABLE_LSB 20 -#define MAC_PCU_BLUETOOTH_MODE3_AGC_SATURATION_CNT_ENABLE_MASK 0x00100000 -#define MAC_PCU_BLUETOOTH_MODE3_AGC_SATURATION_CNT_ENABLE_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_PCU_BLUETOOTH_MODE3_AGC_SATURATION_CNT_ENABLE_SET(x) (((x) << 20) & 0x00100000) -#define MAC_PCU_BLUETOOTH_MODE3_WL_PRIORITY_OFFSET_EN_MSB 21 -#define MAC_PCU_BLUETOOTH_MODE3_WL_PRIORITY_OFFSET_EN_LSB 21 -#define MAC_PCU_BLUETOOTH_MODE3_WL_PRIORITY_OFFSET_EN_MASK 0x00200000 -#define MAC_PCU_BLUETOOTH_MODE3_WL_PRIORITY_OFFSET_EN_GET(x) (((x) & 0x00200000) >> 21) -#define MAC_PCU_BLUETOOTH_MODE3_WL_PRIORITY_OFFSET_EN_SET(x) (((x) << 21) & 0x00200000) -#define MAC_PCU_BLUETOOTH_MODE3_RFGAIN_LOCK_SRC_MSB 22 -#define MAC_PCU_BLUETOOTH_MODE3_RFGAIN_LOCK_SRC_LSB 22 -#define MAC_PCU_BLUETOOTH_MODE3_RFGAIN_LOCK_SRC_MASK 0x00400000 -#define MAC_PCU_BLUETOOTH_MODE3_RFGAIN_LOCK_SRC_GET(x) (((x) & 0x00400000) >> 22) -#define MAC_PCU_BLUETOOTH_MODE3_RFGAIN_LOCK_SRC_SET(x) (((x) << 22) & 0x00400000) -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_PRI_EN_MSB 23 -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_PRI_EN_LSB 23 -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_PRI_EN_MASK 0x00800000 -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_PRI_EN_GET(x) (((x) & 0x00800000) >> 23) -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_PRI_EN_SET(x) (((x) << 23) & 0x00800000) -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_TOGGLE_WLA_EN_MSB 24 -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_TOGGLE_WLA_EN_LSB 24 -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_TOGGLE_WLA_EN_MASK 0x01000000 -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_TOGGLE_WLA_EN_GET(x) (((x) & 0x01000000) >> 24) -#define MAC_PCU_BLUETOOTH_MODE3_DYNAMIC_TOGGLE_WLA_EN_SET(x) (((x) << 24) & 0x01000000) -#define MAC_PCU_BLUETOOTH_MODE3_SLOT_SLOP_MSB 26 -#define MAC_PCU_BLUETOOTH_MODE3_SLOT_SLOP_LSB 25 -#define MAC_PCU_BLUETOOTH_MODE3_SLOT_SLOP_MASK 0x06000000 -#define MAC_PCU_BLUETOOTH_MODE3_SLOT_SLOP_GET(x) (((x) & 0x06000000) >> 25) -#define MAC_PCU_BLUETOOTH_MODE3_SLOT_SLOP_SET(x) (((x) << 25) & 0x06000000) -#define MAC_PCU_BLUETOOTH_MODE3_BT_TX_ON_EN_MSB 27 -#define MAC_PCU_BLUETOOTH_MODE3_BT_TX_ON_EN_LSB 27 -#define MAC_PCU_BLUETOOTH_MODE3_BT_TX_ON_EN_MASK 0x08000000 -#define MAC_PCU_BLUETOOTH_MODE3_BT_TX_ON_EN_GET(x) (((x) & 0x08000000) >> 27) -#define MAC_PCU_BLUETOOTH_MODE3_BT_TX_ON_EN_SET(x) (((x) << 27) & 0x08000000) -#define MAC_PCU_BLUETOOTH_MODE3_BT_PRIORITY_EXTEND_THRES_MSB 31 -#define MAC_PCU_BLUETOOTH_MODE3_BT_PRIORITY_EXTEND_THRES_LSB 28 -#define MAC_PCU_BLUETOOTH_MODE3_BT_PRIORITY_EXTEND_THRES_MASK 0xf0000000 -#define MAC_PCU_BLUETOOTH_MODE3_BT_PRIORITY_EXTEND_THRES_GET(x) (((x) & 0xf0000000) >> 28) -#define MAC_PCU_BLUETOOTH_MODE3_BT_PRIORITY_EXTEND_THRES_SET(x) (((x) << 28) & 0xf0000000) - -/* macros for MAC_PCU_BLUETOOTH_MODE4 */ -#define MAC_PCU_BLUETOOTH_MODE4_ADDRESS 0x000081d8 -#define MAC_PCU_BLUETOOTH_MODE4_OFFSET 0x000081d8 -#define MAC_PCU_BLUETOOTH_MODE4_BT_ACTIVE_EXTEND_MSB 15 -#define MAC_PCU_BLUETOOTH_MODE4_BT_ACTIVE_EXTEND_LSB 0 -#define MAC_PCU_BLUETOOTH_MODE4_BT_ACTIVE_EXTEND_MASK 0x0000ffff -#define MAC_PCU_BLUETOOTH_MODE4_BT_ACTIVE_EXTEND_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_BLUETOOTH_MODE4_BT_ACTIVE_EXTEND_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_PCU_BLUETOOTH_MODE4_BT_PRIORITY_EXTEND_MSB 31 -#define MAC_PCU_BLUETOOTH_MODE4_BT_PRIORITY_EXTEND_LSB 16 -#define MAC_PCU_BLUETOOTH_MODE4_BT_PRIORITY_EXTEND_MASK 0xffff0000 -#define MAC_PCU_BLUETOOTH_MODE4_BT_PRIORITY_EXTEND_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_PCU_BLUETOOTH_MODE4_BT_PRIORITY_EXTEND_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_PCU_BLUETOOTH_MODE5 */ -#define MAC_PCU_BLUETOOTH_MODE5_ADDRESS 0x000081dc -#define MAC_PCU_BLUETOOTH_MODE5_OFFSET 0x000081dc -#define MAC_PCU_BLUETOOTH_MODE5_MCI_WL_LEVEL_MULT_MSB 2 -#define MAC_PCU_BLUETOOTH_MODE5_MCI_WL_LEVEL_MULT_LSB 0 -#define MAC_PCU_BLUETOOTH_MODE5_MCI_WL_LEVEL_MULT_MASK 0x00000007 -#define MAC_PCU_BLUETOOTH_MODE5_MCI_WL_LEVEL_MULT_GET(x) (((x) & 0x00000007) >> 0) -#define MAC_PCU_BLUETOOTH_MODE5_MCI_WL_LEVEL_MULT_SET(x) (((x) << 0) & 0x00000007) -#define MAC_PCU_BLUETOOTH_MODE5_TX_ON_SRC_MSB 3 -#define MAC_PCU_BLUETOOTH_MODE5_TX_ON_SRC_LSB 3 -#define MAC_PCU_BLUETOOTH_MODE5_TX_ON_SRC_MASK 0x00000008 -#define MAC_PCU_BLUETOOTH_MODE5_TX_ON_SRC_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_BLUETOOTH_MODE5_TX_ON_SRC_SET(x) (((x) << 3) & 0x00000008) -#define MAC_PCU_BLUETOOTH_MODE5_TIMER_TARGET_MSB 19 -#define MAC_PCU_BLUETOOTH_MODE5_TIMER_TARGET_LSB 4 -#define MAC_PCU_BLUETOOTH_MODE5_TIMER_TARGET_MASK 0x000ffff0 -#define MAC_PCU_BLUETOOTH_MODE5_TIMER_TARGET_GET(x) (((x) & 0x000ffff0) >> 4) -#define MAC_PCU_BLUETOOTH_MODE5_TIMER_TARGET_SET(x) (((x) << 4) & 0x000ffff0) -#define MAC_PCU_BLUETOOTH_MODE5_SHARED_RX_MSB 20 -#define MAC_PCU_BLUETOOTH_MODE5_SHARED_RX_LSB 20 -#define MAC_PCU_BLUETOOTH_MODE5_SHARED_RX_MASK 0x00100000 -#define MAC_PCU_BLUETOOTH_MODE5_SHARED_RX_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_PCU_BLUETOOTH_MODE5_SHARED_RX_SET(x) (((x) << 20) & 0x00100000) -#define MAC_PCU_BLUETOOTH_MODE5_USE_BTP_EXT_MSB 21 -#define MAC_PCU_BLUETOOTH_MODE5_USE_BTP_EXT_LSB 21 -#define MAC_PCU_BLUETOOTH_MODE5_USE_BTP_EXT_MASK 0x00200000 -#define MAC_PCU_BLUETOOTH_MODE5_USE_BTP_EXT_GET(x) (((x) & 0x00200000) >> 21) -#define MAC_PCU_BLUETOOTH_MODE5_USE_BTP_EXT_SET(x) (((x) << 21) & 0x00200000) - -/* macros for MAC_PCU_BLUETOOTH_WEIGHTS */ -#define MAC_PCU_BLUETOOTH_WEIGHTS_ADDRESS 0x000081e0 -#define MAC_PCU_BLUETOOTH_WEIGHTS_OFFSET 0x000081e0 -#define MAC_PCU_BLUETOOTH_WEIGHTS_BT_WEIGHT_MSB 15 -#define MAC_PCU_BLUETOOTH_WEIGHTS_BT_WEIGHT_LSB 0 -#define MAC_PCU_BLUETOOTH_WEIGHTS_BT_WEIGHT_MASK 0x0000ffff -#define MAC_PCU_BLUETOOTH_WEIGHTS_BT_WEIGHT_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_BLUETOOTH_WEIGHTS_BT_WEIGHT_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_PCU_BLUETOOTH_WEIGHTS_WL_WEIGHT_MSB 31 -#define MAC_PCU_BLUETOOTH_WEIGHTS_WL_WEIGHT_LSB 16 -#define MAC_PCU_BLUETOOTH_WEIGHTS_WL_WEIGHT_MASK 0xffff0000 -#define MAC_PCU_BLUETOOTH_WEIGHTS_WL_WEIGHT_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_PCU_BLUETOOTH_WEIGHTS_WL_WEIGHT_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_PCU_BT_BT_ASYNC */ -#define MAC_PCU_BT_BT_ASYNC_ADDRESS 0x000081e4 -#define MAC_PCU_BT_BT_ASYNC_OFFSET 0x000081e4 -#define MAC_PCU_BT_BT_ASYNC_TXHP_WEIGHT_MSB 3 -#define MAC_PCU_BT_BT_ASYNC_TXHP_WEIGHT_LSB 0 -#define MAC_PCU_BT_BT_ASYNC_TXHP_WEIGHT_MASK 0x0000000f -#define MAC_PCU_BT_BT_ASYNC_TXHP_WEIGHT_GET(x) (((x) & 0x0000000f) >> 0) -#define MAC_PCU_BT_BT_ASYNC_TXHP_WEIGHT_SET(x) (((x) << 0) & 0x0000000f) -#define MAC_PCU_BT_BT_ASYNC_TXLP_WEIGHT_MSB 7 -#define MAC_PCU_BT_BT_ASYNC_TXLP_WEIGHT_LSB 4 -#define MAC_PCU_BT_BT_ASYNC_TXLP_WEIGHT_MASK 0x000000f0 -#define MAC_PCU_BT_BT_ASYNC_TXLP_WEIGHT_GET(x) (((x) & 0x000000f0) >> 4) -#define MAC_PCU_BT_BT_ASYNC_TXLP_WEIGHT_SET(x) (((x) << 4) & 0x000000f0) -#define MAC_PCU_BT_BT_ASYNC_RXHP_WEIGHT_MSB 11 -#define MAC_PCU_BT_BT_ASYNC_RXHP_WEIGHT_LSB 8 -#define MAC_PCU_BT_BT_ASYNC_RXHP_WEIGHT_MASK 0x00000f00 -#define MAC_PCU_BT_BT_ASYNC_RXHP_WEIGHT_GET(x) (((x) & 0x00000f00) >> 8) -#define MAC_PCU_BT_BT_ASYNC_RXHP_WEIGHT_SET(x) (((x) << 8) & 0x00000f00) -#define MAC_PCU_BT_BT_ASYNC_RXLP_WEIGHT_MSB 15 -#define MAC_PCU_BT_BT_ASYNC_RXLP_WEIGHT_LSB 12 -#define MAC_PCU_BT_BT_ASYNC_RXLP_WEIGHT_MASK 0x0000f000 -#define MAC_PCU_BT_BT_ASYNC_RXLP_WEIGHT_GET(x) (((x) & 0x0000f000) >> 12) -#define MAC_PCU_BT_BT_ASYNC_RXLP_WEIGHT_SET(x) (((x) << 12) & 0x0000f000) - -/* macros for MAC_PCU_TXOP_X */ -#define MAC_PCU_TXOP_X_ADDRESS 0x000081ec -#define MAC_PCU_TXOP_X_OFFSET 0x000081ec -#define MAC_PCU_TXOP_X_VALUE_MSB 7 -#define MAC_PCU_TXOP_X_VALUE_LSB 0 -#define MAC_PCU_TXOP_X_VALUE_MASK 0x000000ff -#define MAC_PCU_TXOP_X_VALUE_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_TXOP_X_VALUE_SET(x) (((x) << 0) & 0x000000ff) - -/* macros for MAC_PCU_TXOP_0_3 */ -#define MAC_PCU_TXOP_0_3_ADDRESS 0x000081f0 -#define MAC_PCU_TXOP_0_3_OFFSET 0x000081f0 -#define MAC_PCU_TXOP_0_3_VALUE_0_MSB 7 -#define MAC_PCU_TXOP_0_3_VALUE_0_LSB 0 -#define MAC_PCU_TXOP_0_3_VALUE_0_MASK 0x000000ff -#define MAC_PCU_TXOP_0_3_VALUE_0_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_TXOP_0_3_VALUE_0_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_TXOP_0_3_VALUE_1_MSB 15 -#define MAC_PCU_TXOP_0_3_VALUE_1_LSB 8 -#define MAC_PCU_TXOP_0_3_VALUE_1_MASK 0x0000ff00 -#define MAC_PCU_TXOP_0_3_VALUE_1_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_TXOP_0_3_VALUE_1_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_TXOP_0_3_VALUE_2_MSB 23 -#define MAC_PCU_TXOP_0_3_VALUE_2_LSB 16 -#define MAC_PCU_TXOP_0_3_VALUE_2_MASK 0x00ff0000 -#define MAC_PCU_TXOP_0_3_VALUE_2_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_TXOP_0_3_VALUE_2_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_TXOP_0_3_VALUE_3_MSB 31 -#define MAC_PCU_TXOP_0_3_VALUE_3_LSB 24 -#define MAC_PCU_TXOP_0_3_VALUE_3_MASK 0xff000000 -#define MAC_PCU_TXOP_0_3_VALUE_3_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_PCU_TXOP_0_3_VALUE_3_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_TXOP_4_7 */ -#define MAC_PCU_TXOP_4_7_ADDRESS 0x000081f4 -#define MAC_PCU_TXOP_4_7_OFFSET 0x000081f4 -#define MAC_PCU_TXOP_4_7_VALUE_4_MSB 7 -#define MAC_PCU_TXOP_4_7_VALUE_4_LSB 0 -#define MAC_PCU_TXOP_4_7_VALUE_4_MASK 0x000000ff -#define MAC_PCU_TXOP_4_7_VALUE_4_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_TXOP_4_7_VALUE_4_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_TXOP_4_7_VALUE_5_MSB 15 -#define MAC_PCU_TXOP_4_7_VALUE_5_LSB 8 -#define MAC_PCU_TXOP_4_7_VALUE_5_MASK 0x0000ff00 -#define MAC_PCU_TXOP_4_7_VALUE_5_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_TXOP_4_7_VALUE_5_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_TXOP_4_7_VALUE_6_MSB 23 -#define MAC_PCU_TXOP_4_7_VALUE_6_LSB 16 -#define MAC_PCU_TXOP_4_7_VALUE_6_MASK 0x00ff0000 -#define MAC_PCU_TXOP_4_7_VALUE_6_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_TXOP_4_7_VALUE_6_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_TXOP_4_7_VALUE_7_MSB 31 -#define MAC_PCU_TXOP_4_7_VALUE_7_LSB 24 -#define MAC_PCU_TXOP_4_7_VALUE_7_MASK 0xff000000 -#define MAC_PCU_TXOP_4_7_VALUE_7_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_PCU_TXOP_4_7_VALUE_7_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_TXOP_8_11 */ -#define MAC_PCU_TXOP_8_11_ADDRESS 0x000081f8 -#define MAC_PCU_TXOP_8_11_OFFSET 0x000081f8 -#define MAC_PCU_TXOP_8_11_VALUE_8_MSB 7 -#define MAC_PCU_TXOP_8_11_VALUE_8_LSB 0 -#define MAC_PCU_TXOP_8_11_VALUE_8_MASK 0x000000ff -#define MAC_PCU_TXOP_8_11_VALUE_8_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_TXOP_8_11_VALUE_8_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_TXOP_8_11_VALUE_9_MSB 15 -#define MAC_PCU_TXOP_8_11_VALUE_9_LSB 8 -#define MAC_PCU_TXOP_8_11_VALUE_9_MASK 0x0000ff00 -#define MAC_PCU_TXOP_8_11_VALUE_9_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_TXOP_8_11_VALUE_9_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_TXOP_8_11_VALUE_10_MSB 23 -#define MAC_PCU_TXOP_8_11_VALUE_10_LSB 16 -#define MAC_PCU_TXOP_8_11_VALUE_10_MASK 0x00ff0000 -#define MAC_PCU_TXOP_8_11_VALUE_10_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_TXOP_8_11_VALUE_10_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_TXOP_8_11_VALUE_11_MSB 31 -#define MAC_PCU_TXOP_8_11_VALUE_11_LSB 24 -#define MAC_PCU_TXOP_8_11_VALUE_11_MASK 0xff000000 -#define MAC_PCU_TXOP_8_11_VALUE_11_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_PCU_TXOP_8_11_VALUE_11_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_TXOP_12_15 */ -#define MAC_PCU_TXOP_12_15_ADDRESS 0x000081fc -#define MAC_PCU_TXOP_12_15_OFFSET 0x000081fc -#define MAC_PCU_TXOP_12_15_VALUE_12_MSB 7 -#define MAC_PCU_TXOP_12_15_VALUE_12_LSB 0 -#define MAC_PCU_TXOP_12_15_VALUE_12_MASK 0x000000ff -#define MAC_PCU_TXOP_12_15_VALUE_12_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_TXOP_12_15_VALUE_12_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_TXOP_12_15_VALUE_13_MSB 15 -#define MAC_PCU_TXOP_12_15_VALUE_13_LSB 8 -#define MAC_PCU_TXOP_12_15_VALUE_13_MASK 0x0000ff00 -#define MAC_PCU_TXOP_12_15_VALUE_13_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_TXOP_12_15_VALUE_13_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_TXOP_12_15_VALUE_14_MSB 23 -#define MAC_PCU_TXOP_12_15_VALUE_14_LSB 16 -#define MAC_PCU_TXOP_12_15_VALUE_14_MASK 0x00ff0000 -#define MAC_PCU_TXOP_12_15_VALUE_14_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_TXOP_12_15_VALUE_14_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_TXOP_12_15_VALUE_15_MSB 31 -#define MAC_PCU_TXOP_12_15_VALUE_15_LSB 24 -#define MAC_PCU_TXOP_12_15_VALUE_15_MASK 0xff000000 -#define MAC_PCU_TXOP_12_15_VALUE_15_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_PCU_TXOP_12_15_VALUE_15_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_LSB */ -#define MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_LSB_ADDRESS 0x00008200 -#define MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_LSB_OFFSET 0x00008200 -#define MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_LSB_VALUE_MSB 31 -#define MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_LSB_VALUE_LSB 0 -#define MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_LSB_VALUE_MASK 0xffffffff -#define MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_LSB_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_LSB_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_MSB */ -#define MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_MSB_ADDRESS 0x00008204 -#define MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_MSB_OFFSET 0x00008204 -#define MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_MSB_VALUE_MSB 31 -#define MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_MSB_VALUE_LSB 0 -#define MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_MSB_VALUE_MASK 0xffffffff -#define MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_MSB_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_MSB_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_TDMA_SLOT_ALERT_CNTL */ -#define MAC_PCU_TDMA_SLOT_ALERT_CNTL_ADDRESS 0x00008208 -#define MAC_PCU_TDMA_SLOT_ALERT_CNTL_OFFSET 0x00008208 -#define MAC_PCU_TDMA_SLOT_ALERT_CNTL_VALUE_MSB 15 -#define MAC_PCU_TDMA_SLOT_ALERT_CNTL_VALUE_LSB 0 -#define MAC_PCU_TDMA_SLOT_ALERT_CNTL_VALUE_MASK 0x0000ffff -#define MAC_PCU_TDMA_SLOT_ALERT_CNTL_VALUE_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_TDMA_SLOT_ALERT_CNTL_VALUE_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MAC_PCU_WOW1 */ -#define MAC_PCU_WOW1_ADDRESS 0x0000825c -#define MAC_PCU_WOW1_OFFSET 0x0000825c -#define MAC_PCU_WOW1_PATTERN_ENABLE_MSB 7 -#define MAC_PCU_WOW1_PATTERN_ENABLE_LSB 0 -#define MAC_PCU_WOW1_PATTERN_ENABLE_MASK 0x000000ff -#define MAC_PCU_WOW1_PATTERN_ENABLE_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_WOW1_PATTERN_ENABLE_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_WOW1_PATTERN_DETECT_MSB 15 -#define MAC_PCU_WOW1_PATTERN_DETECT_LSB 8 -#define MAC_PCU_WOW1_PATTERN_DETECT_MASK 0x0000ff00 -#define MAC_PCU_WOW1_PATTERN_DETECT_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_WOW1_MAGIC_ENABLE_MSB 16 -#define MAC_PCU_WOW1_MAGIC_ENABLE_LSB 16 -#define MAC_PCU_WOW1_MAGIC_ENABLE_MASK 0x00010000 -#define MAC_PCU_WOW1_MAGIC_ENABLE_GET(x) (((x) & 0x00010000) >> 16) -#define MAC_PCU_WOW1_MAGIC_ENABLE_SET(x) (((x) << 16) & 0x00010000) -#define MAC_PCU_WOW1_MAGIC_DETECT_MSB 17 -#define MAC_PCU_WOW1_MAGIC_DETECT_LSB 17 -#define MAC_PCU_WOW1_MAGIC_DETECT_MASK 0x00020000 -#define MAC_PCU_WOW1_MAGIC_DETECT_GET(x) (((x) & 0x00020000) >> 17) -#define MAC_PCU_WOW1_INTR_ENABLE_MSB 18 -#define MAC_PCU_WOW1_INTR_ENABLE_LSB 18 -#define MAC_PCU_WOW1_INTR_ENABLE_MASK 0x00040000 -#define MAC_PCU_WOW1_INTR_ENABLE_GET(x) (((x) & 0x00040000) >> 18) -#define MAC_PCU_WOW1_INTR_ENABLE_SET(x) (((x) << 18) & 0x00040000) -#define MAC_PCU_WOW1_INTR_DETECT_MSB 19 -#define MAC_PCU_WOW1_INTR_DETECT_LSB 19 -#define MAC_PCU_WOW1_INTR_DETECT_MASK 0x00080000 -#define MAC_PCU_WOW1_INTR_DETECT_GET(x) (((x) & 0x00080000) >> 19) -#define MAC_PCU_WOW1_KEEP_ALIVE_FAIL_MSB 20 -#define MAC_PCU_WOW1_KEEP_ALIVE_FAIL_LSB 20 -#define MAC_PCU_WOW1_KEEP_ALIVE_FAIL_MASK 0x00100000 -#define MAC_PCU_WOW1_KEEP_ALIVE_FAIL_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_PCU_WOW1_BEACON_FAIL_MSB 21 -#define MAC_PCU_WOW1_BEACON_FAIL_LSB 21 -#define MAC_PCU_WOW1_BEACON_FAIL_MASK 0x00200000 -#define MAC_PCU_WOW1_BEACON_FAIL_GET(x) (((x) & 0x00200000) >> 21) -#define MAC_PCU_WOW1_CW_BITS_MSB 31 -#define MAC_PCU_WOW1_CW_BITS_LSB 28 -#define MAC_PCU_WOW1_CW_BITS_MASK 0xf0000000 -#define MAC_PCU_WOW1_CW_BITS_GET(x) (((x) & 0xf0000000) >> 28) -#define MAC_PCU_WOW1_CW_BITS_SET(x) (((x) << 28) & 0xf0000000) - -/* macros for MAC_PCU_WOW2 */ -#define MAC_PCU_WOW2_ADDRESS 0x00008260 -#define MAC_PCU_WOW2_OFFSET 0x00008260 -#define MAC_PCU_WOW2_AIFS_MSB 7 -#define MAC_PCU_WOW2_AIFS_LSB 0 -#define MAC_PCU_WOW2_AIFS_MASK 0x000000ff -#define MAC_PCU_WOW2_AIFS_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_WOW2_AIFS_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_WOW2_SLOT_MSB 15 -#define MAC_PCU_WOW2_SLOT_LSB 8 -#define MAC_PCU_WOW2_SLOT_MASK 0x0000ff00 -#define MAC_PCU_WOW2_SLOT_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_WOW2_SLOT_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_WOW2_TRY_CNT_MSB 23 -#define MAC_PCU_WOW2_TRY_CNT_LSB 16 -#define MAC_PCU_WOW2_TRY_CNT_MASK 0x00ff0000 -#define MAC_PCU_WOW2_TRY_CNT_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_WOW2_TRY_CNT_SET(x) (((x) << 16) & 0x00ff0000) - -/* macros for MAC_PCU_LOGIC_ANALYZER */ -#define MAC_PCU_LOGIC_ANALYZER_ADDRESS 0x00008264 -#define MAC_PCU_LOGIC_ANALYZER_OFFSET 0x00008264 -#define MAC_PCU_LOGIC_ANALYZER_HOLD_MSB 0 -#define MAC_PCU_LOGIC_ANALYZER_HOLD_LSB 0 -#define MAC_PCU_LOGIC_ANALYZER_HOLD_MASK 0x00000001 -#define MAC_PCU_LOGIC_ANALYZER_HOLD_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_LOGIC_ANALYZER_HOLD_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_LOGIC_ANALYZER_CLEAR_MSB 1 -#define MAC_PCU_LOGIC_ANALYZER_CLEAR_LSB 1 -#define MAC_PCU_LOGIC_ANALYZER_CLEAR_MASK 0x00000002 -#define MAC_PCU_LOGIC_ANALYZER_CLEAR_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_LOGIC_ANALYZER_CLEAR_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_LOGIC_ANALYZER_STATE_MSB 2 -#define MAC_PCU_LOGIC_ANALYZER_STATE_LSB 2 -#define MAC_PCU_LOGIC_ANALYZER_STATE_MASK 0x00000004 -#define MAC_PCU_LOGIC_ANALYZER_STATE_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_LOGIC_ANALYZER_ENABLE_MSB 3 -#define MAC_PCU_LOGIC_ANALYZER_ENABLE_LSB 3 -#define MAC_PCU_LOGIC_ANALYZER_ENABLE_MASK 0x00000008 -#define MAC_PCU_LOGIC_ANALYZER_ENABLE_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_LOGIC_ANALYZER_ENABLE_SET(x) (((x) << 3) & 0x00000008) -#define MAC_PCU_LOGIC_ANALYZER_QCU_SEL_MSB 7 -#define MAC_PCU_LOGIC_ANALYZER_QCU_SEL_LSB 4 -#define MAC_PCU_LOGIC_ANALYZER_QCU_SEL_MASK 0x000000f0 -#define MAC_PCU_LOGIC_ANALYZER_QCU_SEL_GET(x) (((x) & 0x000000f0) >> 4) -#define MAC_PCU_LOGIC_ANALYZER_QCU_SEL_SET(x) (((x) << 4) & 0x000000f0) -#define MAC_PCU_LOGIC_ANALYZER_INT_ADDR_MSB 17 -#define MAC_PCU_LOGIC_ANALYZER_INT_ADDR_LSB 8 -#define MAC_PCU_LOGIC_ANALYZER_INT_ADDR_MASK 0x0003ff00 -#define MAC_PCU_LOGIC_ANALYZER_INT_ADDR_GET(x) (((x) & 0x0003ff00) >> 8) -#define MAC_PCU_LOGIC_ANALYZER_DIAG_MODE_MSB 31 -#define MAC_PCU_LOGIC_ANALYZER_DIAG_MODE_LSB 18 -#define MAC_PCU_LOGIC_ANALYZER_DIAG_MODE_MASK 0xfffc0000 -#define MAC_PCU_LOGIC_ANALYZER_DIAG_MODE_GET(x) (((x) & 0xfffc0000) >> 18) -#define MAC_PCU_LOGIC_ANALYZER_DIAG_MODE_SET(x) (((x) << 18) & 0xfffc0000) - -/* macros for MAC_PCU_LOGIC_ANALYZER_32L */ -#define MAC_PCU_LOGIC_ANALYZER_32L_ADDRESS 0x00008268 -#define MAC_PCU_LOGIC_ANALYZER_32L_OFFSET 0x00008268 -#define MAC_PCU_LOGIC_ANALYZER_32L_MASK_MSB 31 -#define MAC_PCU_LOGIC_ANALYZER_32L_MASK_LSB 0 -#define MAC_PCU_LOGIC_ANALYZER_32L_MASK_MASK 0xffffffff -#define MAC_PCU_LOGIC_ANALYZER_32L_MASK_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_LOGIC_ANALYZER_32L_MASK_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_LOGIC_ANALYZER_16U */ -#define MAC_PCU_LOGIC_ANALYZER_16U_ADDRESS 0x0000826c -#define MAC_PCU_LOGIC_ANALYZER_16U_OFFSET 0x0000826c -#define MAC_PCU_LOGIC_ANALYZER_16U_MASK_MSB 15 -#define MAC_PCU_LOGIC_ANALYZER_16U_MASK_LSB 0 -#define MAC_PCU_LOGIC_ANALYZER_16U_MASK_MASK 0x0000ffff -#define MAC_PCU_LOGIC_ANALYZER_16U_MASK_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_LOGIC_ANALYZER_16U_MASK_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MAC_PCU_WOW3_BEACON_FAIL */ -#define MAC_PCU_WOW3_BEACON_FAIL_ADDRESS 0x00008270 -#define MAC_PCU_WOW3_BEACON_FAIL_OFFSET 0x00008270 -#define MAC_PCU_WOW3_BEACON_FAIL_ENABLE_MSB 0 -#define MAC_PCU_WOW3_BEACON_FAIL_ENABLE_LSB 0 -#define MAC_PCU_WOW3_BEACON_FAIL_ENABLE_MASK 0x00000001 -#define MAC_PCU_WOW3_BEACON_FAIL_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_WOW3_BEACON_FAIL_ENABLE_SET(x) (((x) << 0) & 0x00000001) - -/* macros for MAC_PCU_WOW3_BEACON */ -#define MAC_PCU_WOW3_BEACON_ADDRESS 0x00008274 -#define MAC_PCU_WOW3_BEACON_OFFSET 0x00008274 -#define MAC_PCU_WOW3_BEACON_TIMEOUT_MSB 31 -#define MAC_PCU_WOW3_BEACON_TIMEOUT_LSB 0 -#define MAC_PCU_WOW3_BEACON_TIMEOUT_MASK 0xffffffff -#define MAC_PCU_WOW3_BEACON_TIMEOUT_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_WOW3_BEACON_TIMEOUT_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_WOW3_KEEP_ALIVE */ -#define MAC_PCU_WOW3_KEEP_ALIVE_ADDRESS 0x00008278 -#define MAC_PCU_WOW3_KEEP_ALIVE_OFFSET 0x00008278 -#define MAC_PCU_WOW3_KEEP_ALIVE_TIMEOUT_MSB 31 -#define MAC_PCU_WOW3_KEEP_ALIVE_TIMEOUT_LSB 0 -#define MAC_PCU_WOW3_KEEP_ALIVE_TIMEOUT_MASK 0xffffffff -#define MAC_PCU_WOW3_KEEP_ALIVE_TIMEOUT_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_WOW3_KEEP_ALIVE_TIMEOUT_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_WOW_KA */ -#define MAC_PCU_WOW_KA_ADDRESS 0x0000827c -#define MAC_PCU_WOW_KA_OFFSET 0x0000827c -#define MAC_PCU_WOW_KA_AUTO_DISABLE_MSB 0 -#define MAC_PCU_WOW_KA_AUTO_DISABLE_LSB 0 -#define MAC_PCU_WOW_KA_AUTO_DISABLE_MASK 0x00000001 -#define MAC_PCU_WOW_KA_AUTO_DISABLE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_WOW_KA_AUTO_DISABLE_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_WOW_KA_FAIL_DISABLE_MSB 1 -#define MAC_PCU_WOW_KA_FAIL_DISABLE_LSB 1 -#define MAC_PCU_WOW_KA_FAIL_DISABLE_MASK 0x00000002 -#define MAC_PCU_WOW_KA_FAIL_DISABLE_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_WOW_KA_FAIL_DISABLE_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_WOW_KA_BKOFF_CS_ENABLE_MSB 2 -#define MAC_PCU_WOW_KA_BKOFF_CS_ENABLE_LSB 2 -#define MAC_PCU_WOW_KA_BKOFF_CS_ENABLE_MASK 0x00000004 -#define MAC_PCU_WOW_KA_BKOFF_CS_ENABLE_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_WOW_KA_BKOFF_CS_ENABLE_SET(x) (((x) << 2) & 0x00000004) - -/* macros for PCU_1US */ -#define PCU_1US_ADDRESS 0x00008284 -#define PCU_1US_OFFSET 0x00008284 -#define PCU_1US_SCALER_MSB 6 -#define PCU_1US_SCALER_LSB 0 -#define PCU_1US_SCALER_MASK 0x0000007f -#define PCU_1US_SCALER_GET(x) (((x) & 0x0000007f) >> 0) -#define PCU_1US_SCALER_SET(x) (((x) << 0) & 0x0000007f) - -/* macros for PCU_KA */ -#define PCU_KA_ADDRESS 0x00008288 -#define PCU_KA_OFFSET 0x00008288 -#define PCU_KA_DEL_MSB 11 -#define PCU_KA_DEL_LSB 0 -#define PCU_KA_DEL_MASK 0x00000fff -#define PCU_KA_DEL_GET(x) (((x) & 0x00000fff) >> 0) -#define PCU_KA_DEL_SET(x) (((x) << 0) & 0x00000fff) - -/* macros for WOW_EXACT */ -#define WOW_EXACT_ADDRESS 0x0000828c -#define WOW_EXACT_OFFSET 0x0000828c -#define WOW_EXACT_LENGTH_MSB 7 -#define WOW_EXACT_LENGTH_LSB 0 -#define WOW_EXACT_LENGTH_MASK 0x000000ff -#define WOW_EXACT_LENGTH_GET(x) (((x) & 0x000000ff) >> 0) -#define WOW_EXACT_LENGTH_SET(x) (((x) << 0) & 0x000000ff) -#define WOW_EXACT_OFFSET_MSB 15 -#define WOW_EXACT_OFFSET_LSB 8 -#define WOW_EXACT_OFFSET_MASK 0x0000ff00 -#define WOW_EXACT_OFFSET_GET(x) (((x) & 0x0000ff00) >> 8) -#define WOW_EXACT_OFFSET_SET(x) (((x) << 8) & 0x0000ff00) - -/* macros for PCU_WOW4 */ -#define PCU_WOW4_ADDRESS 0x00008294 -#define PCU_WOW4_OFFSET 0x00008294 -#define PCU_WOW4_OFFSET0_MSB 7 -#define PCU_WOW4_OFFSET0_LSB 0 -#define PCU_WOW4_OFFSET0_MASK 0x000000ff -#define PCU_WOW4_OFFSET0_GET(x) (((x) & 0x000000ff) >> 0) -#define PCU_WOW4_OFFSET0_SET(x) (((x) << 0) & 0x000000ff) -#define PCU_WOW4_OFFSET1_MSB 15 -#define PCU_WOW4_OFFSET1_LSB 8 -#define PCU_WOW4_OFFSET1_MASK 0x0000ff00 -#define PCU_WOW4_OFFSET1_GET(x) (((x) & 0x0000ff00) >> 8) -#define PCU_WOW4_OFFSET1_SET(x) (((x) << 8) & 0x0000ff00) -#define PCU_WOW4_OFFSET2_MSB 23 -#define PCU_WOW4_OFFSET2_LSB 16 -#define PCU_WOW4_OFFSET2_MASK 0x00ff0000 -#define PCU_WOW4_OFFSET2_GET(x) (((x) & 0x00ff0000) >> 16) -#define PCU_WOW4_OFFSET2_SET(x) (((x) << 16) & 0x00ff0000) -#define PCU_WOW4_OFFSET3_MSB 31 -#define PCU_WOW4_OFFSET3_LSB 24 -#define PCU_WOW4_OFFSET3_MASK 0xff000000 -#define PCU_WOW4_OFFSET3_GET(x) (((x) & 0xff000000) >> 24) -#define PCU_WOW4_OFFSET3_SET(x) (((x) << 24) & 0xff000000) - -/* macros for PCU_WOW5 */ -#define PCU_WOW5_ADDRESS 0x00008298 -#define PCU_WOW5_OFFSET 0x00008298 -#define PCU_WOW5_OFFSET4_MSB 7 -#define PCU_WOW5_OFFSET4_LSB 0 -#define PCU_WOW5_OFFSET4_MASK 0x000000ff -#define PCU_WOW5_OFFSET4_GET(x) (((x) & 0x000000ff) >> 0) -#define PCU_WOW5_OFFSET4_SET(x) (((x) << 0) & 0x000000ff) -#define PCU_WOW5_OFFSET5_MSB 15 -#define PCU_WOW5_OFFSET5_LSB 8 -#define PCU_WOW5_OFFSET5_MASK 0x0000ff00 -#define PCU_WOW5_OFFSET5_GET(x) (((x) & 0x0000ff00) >> 8) -#define PCU_WOW5_OFFSET5_SET(x) (((x) << 8) & 0x0000ff00) -#define PCU_WOW5_OFFSET6_MSB 23 -#define PCU_WOW5_OFFSET6_LSB 16 -#define PCU_WOW5_OFFSET6_MASK 0x00ff0000 -#define PCU_WOW5_OFFSET6_GET(x) (((x) & 0x00ff0000) >> 16) -#define PCU_WOW5_OFFSET6_SET(x) (((x) << 16) & 0x00ff0000) -#define PCU_WOW5_OFFSET7_MSB 31 -#define PCU_WOW5_OFFSET7_LSB 24 -#define PCU_WOW5_OFFSET7_MASK 0xff000000 -#define PCU_WOW5_OFFSET7_GET(x) (((x) & 0xff000000) >> 24) -#define PCU_WOW5_OFFSET7_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_PHY_ERR_CNT_MASK_CONT */ -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_ADDRESS 0x0000829c -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_OFFSET 0x0000829c -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK1_MSB 7 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK1_LSB 0 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK1_MASK 0x000000ff -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK1_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK1_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK2_MSB 15 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK2_LSB 8 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK2_MASK 0x0000ff00 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK2_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK2_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK3_MSB 23 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK3_LSB 16 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK3_MASK 0x00ff0000 -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK3_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_PHY_ERR_CNT_MASK_CONT_MASK3_SET(x) (((x) << 16) & 0x00ff0000) - -/* macros for MAC_PCU_AZIMUTH_MODE */ -#define MAC_PCU_AZIMUTH_MODE_ADDRESS 0x00008300 -#define MAC_PCU_AZIMUTH_MODE_OFFSET 0x00008300 -#define MAC_PCU_AZIMUTH_MODE_DISABLE_TSF_UPDATE_MSB 0 -#define MAC_PCU_AZIMUTH_MODE_DISABLE_TSF_UPDATE_LSB 0 -#define MAC_PCU_AZIMUTH_MODE_DISABLE_TSF_UPDATE_MASK 0x00000001 -#define MAC_PCU_AZIMUTH_MODE_DISABLE_TSF_UPDATE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_AZIMUTH_MODE_DISABLE_TSF_UPDATE_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_AZIMUTH_MODE_KEY_SEARCH_AD1_MSB 1 -#define MAC_PCU_AZIMUTH_MODE_KEY_SEARCH_AD1_LSB 1 -#define MAC_PCU_AZIMUTH_MODE_KEY_SEARCH_AD1_MASK 0x00000002 -#define MAC_PCU_AZIMUTH_MODE_KEY_SEARCH_AD1_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_AZIMUTH_MODE_KEY_SEARCH_AD1_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_AZIMUTH_MODE_TX_TSF_STATUS_SEL_MSB 2 -#define MAC_PCU_AZIMUTH_MODE_TX_TSF_STATUS_SEL_LSB 2 -#define MAC_PCU_AZIMUTH_MODE_TX_TSF_STATUS_SEL_MASK 0x00000004 -#define MAC_PCU_AZIMUTH_MODE_TX_TSF_STATUS_SEL_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_AZIMUTH_MODE_TX_TSF_STATUS_SEL_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_AZIMUTH_MODE_RX_TSF_STATUS_SEL_MSB 3 -#define MAC_PCU_AZIMUTH_MODE_RX_TSF_STATUS_SEL_LSB 3 -#define MAC_PCU_AZIMUTH_MODE_RX_TSF_STATUS_SEL_MASK 0x00000008 -#define MAC_PCU_AZIMUTH_MODE_RX_TSF_STATUS_SEL_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_AZIMUTH_MODE_RX_TSF_STATUS_SEL_SET(x) (((x) << 3) & 0x00000008) -#define MAC_PCU_AZIMUTH_MODE_CLK_EN_MSB 4 -#define MAC_PCU_AZIMUTH_MODE_CLK_EN_LSB 4 -#define MAC_PCU_AZIMUTH_MODE_CLK_EN_MASK 0x00000010 -#define MAC_PCU_AZIMUTH_MODE_CLK_EN_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_PCU_AZIMUTH_MODE_CLK_EN_SET(x) (((x) << 4) & 0x00000010) -#define MAC_PCU_AZIMUTH_MODE_TX_DESC_EN_MSB 5 -#define MAC_PCU_AZIMUTH_MODE_TX_DESC_EN_LSB 5 -#define MAC_PCU_AZIMUTH_MODE_TX_DESC_EN_MASK 0x00000020 -#define MAC_PCU_AZIMUTH_MODE_TX_DESC_EN_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_PCU_AZIMUTH_MODE_TX_DESC_EN_SET(x) (((x) << 5) & 0x00000020) -#define MAC_PCU_AZIMUTH_MODE_ACK_CTS_MATCH_TX_AD2_MSB 6 -#define MAC_PCU_AZIMUTH_MODE_ACK_CTS_MATCH_TX_AD2_LSB 6 -#define MAC_PCU_AZIMUTH_MODE_ACK_CTS_MATCH_TX_AD2_MASK 0x00000040 -#define MAC_PCU_AZIMUTH_MODE_ACK_CTS_MATCH_TX_AD2_GET(x) (((x) & 0x00000040) >> 6) -#define MAC_PCU_AZIMUTH_MODE_ACK_CTS_MATCH_TX_AD2_SET(x) (((x) << 6) & 0x00000040) -#define MAC_PCU_AZIMUTH_MODE_BA_USES_AD1_MSB 7 -#define MAC_PCU_AZIMUTH_MODE_BA_USES_AD1_LSB 7 -#define MAC_PCU_AZIMUTH_MODE_BA_USES_AD1_MASK 0x00000080 -#define MAC_PCU_AZIMUTH_MODE_BA_USES_AD1_GET(x) (((x) & 0x00000080) >> 7) -#define MAC_PCU_AZIMUTH_MODE_BA_USES_AD1_SET(x) (((x) << 7) & 0x00000080) -#define MAC_PCU_AZIMUTH_MODE_WMAC_CLK_SEL_MSB 8 -#define MAC_PCU_AZIMUTH_MODE_WMAC_CLK_SEL_LSB 8 -#define MAC_PCU_AZIMUTH_MODE_WMAC_CLK_SEL_MASK 0x00000100 -#define MAC_PCU_AZIMUTH_MODE_WMAC_CLK_SEL_GET(x) (((x) & 0x00000100) >> 8) -#define MAC_PCU_AZIMUTH_MODE_WMAC_CLK_SEL_SET(x) (((x) << 8) & 0x00000100) -#define MAC_PCU_AZIMUTH_MODE_FILTER_PASS_HOLD_MSB 9 -#define MAC_PCU_AZIMUTH_MODE_FILTER_PASS_HOLD_LSB 9 -#define MAC_PCU_AZIMUTH_MODE_FILTER_PASS_HOLD_MASK 0x00000200 -#define MAC_PCU_AZIMUTH_MODE_FILTER_PASS_HOLD_GET(x) (((x) & 0x00000200) >> 9) -#define MAC_PCU_AZIMUTH_MODE_FILTER_PASS_HOLD_SET(x) (((x) << 9) & 0x00000200) - -/* macros for MAC_PCU_AZIMUTH_TIME_STAMP */ -#define MAC_PCU_AZIMUTH_TIME_STAMP_ADDRESS 0x00008314 -#define MAC_PCU_AZIMUTH_TIME_STAMP_OFFSET 0x00008314 -#define MAC_PCU_AZIMUTH_TIME_STAMP_VALUE_MSB 31 -#define MAC_PCU_AZIMUTH_TIME_STAMP_VALUE_LSB 0 -#define MAC_PCU_AZIMUTH_TIME_STAMP_VALUE_MASK 0xffffffff -#define MAC_PCU_AZIMUTH_TIME_STAMP_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_AZIMUTH_TIME_STAMP_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_20_40_MODE */ -#define MAC_PCU_20_40_MODE_ADDRESS 0x00008318 -#define MAC_PCU_20_40_MODE_OFFSET 0x00008318 -#define MAC_PCU_20_40_MODE_JOINED_RX_CLEAR_MSB 0 -#define MAC_PCU_20_40_MODE_JOINED_RX_CLEAR_LSB 0 -#define MAC_PCU_20_40_MODE_JOINED_RX_CLEAR_MASK 0x00000001 -#define MAC_PCU_20_40_MODE_JOINED_RX_CLEAR_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_20_40_MODE_JOINED_RX_CLEAR_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_20_40_MODE_EXT_PIFS_ENABLE_MSB 1 -#define MAC_PCU_20_40_MODE_EXT_PIFS_ENABLE_LSB 1 -#define MAC_PCU_20_40_MODE_EXT_PIFS_ENABLE_MASK 0x00000002 -#define MAC_PCU_20_40_MODE_EXT_PIFS_ENABLE_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_20_40_MODE_EXT_PIFS_ENABLE_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_20_40_MODE_TX_HT20_ON_EXT_BUSY_MSB 2 -#define MAC_PCU_20_40_MODE_TX_HT20_ON_EXT_BUSY_LSB 2 -#define MAC_PCU_20_40_MODE_TX_HT20_ON_EXT_BUSY_MASK 0x00000004 -#define MAC_PCU_20_40_MODE_TX_HT20_ON_EXT_BUSY_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_20_40_MODE_TX_HT20_ON_EXT_BUSY_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_20_40_MODE_SWAMPED_FORCES_RX_CLEAR_CTL_IDLE_MSB 3 -#define MAC_PCU_20_40_MODE_SWAMPED_FORCES_RX_CLEAR_CTL_IDLE_LSB 3 -#define MAC_PCU_20_40_MODE_SWAMPED_FORCES_RX_CLEAR_CTL_IDLE_MASK 0x00000008 -#define MAC_PCU_20_40_MODE_SWAMPED_FORCES_RX_CLEAR_CTL_IDLE_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_20_40_MODE_SWAMPED_FORCES_RX_CLEAR_CTL_IDLE_SET(x) (((x) << 3) & 0x00000008) -#define MAC_PCU_20_40_MODE_PIFS_CYCLES_MSB 15 -#define MAC_PCU_20_40_MODE_PIFS_CYCLES_LSB 4 -#define MAC_PCU_20_40_MODE_PIFS_CYCLES_MASK 0x0000fff0 -#define MAC_PCU_20_40_MODE_PIFS_CYCLES_GET(x) (((x) & 0x0000fff0) >> 4) -#define MAC_PCU_20_40_MODE_PIFS_CYCLES_SET(x) (((x) << 4) & 0x0000fff0) - -/* macros for MAC_PCU_H_XFER_TIMEOUT */ -#define MAC_PCU_H_XFER_TIMEOUT_ADDRESS 0x0000831c -#define MAC_PCU_H_XFER_TIMEOUT_OFFSET 0x0000831c -#define MAC_PCU_H_XFER_TIMEOUT_VALUE_MSB 4 -#define MAC_PCU_H_XFER_TIMEOUT_VALUE_LSB 0 -#define MAC_PCU_H_XFER_TIMEOUT_VALUE_MASK 0x0000001f -#define MAC_PCU_H_XFER_TIMEOUT_VALUE_GET(x) (((x) & 0x0000001f) >> 0) -#define MAC_PCU_H_XFER_TIMEOUT_VALUE_SET(x) (((x) << 0) & 0x0000001f) -#define MAC_PCU_H_XFER_TIMEOUT_DISABLE_MSB 5 -#define MAC_PCU_H_XFER_TIMEOUT_DISABLE_LSB 5 -#define MAC_PCU_H_XFER_TIMEOUT_DISABLE_MASK 0x00000020 -#define MAC_PCU_H_XFER_TIMEOUT_DISABLE_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_PCU_H_XFER_TIMEOUT_DISABLE_SET(x) (((x) << 5) & 0x00000020) -#define MAC_PCU_H_XFER_TIMEOUT_EXTXBF_IMMEDIATE_RESP_MSB 6 -#define MAC_PCU_H_XFER_TIMEOUT_EXTXBF_IMMEDIATE_RESP_LSB 6 -#define MAC_PCU_H_XFER_TIMEOUT_EXTXBF_IMMEDIATE_RESP_MASK 0x00000040 -#define MAC_PCU_H_XFER_TIMEOUT_EXTXBF_IMMEDIATE_RESP_GET(x) (((x) & 0x00000040) >> 6) -#define MAC_PCU_H_XFER_TIMEOUT_EXTXBF_IMMEDIATE_RESP_SET(x) (((x) << 6) & 0x00000040) -#define MAC_PCU_H_XFER_TIMEOUT_DELAY_EXTXBF_ONLY_UPLOAD_H_MSB 7 -#define MAC_PCU_H_XFER_TIMEOUT_DELAY_EXTXBF_ONLY_UPLOAD_H_LSB 7 -#define MAC_PCU_H_XFER_TIMEOUT_DELAY_EXTXBF_ONLY_UPLOAD_H_MASK 0x00000080 -#define MAC_PCU_H_XFER_TIMEOUT_DELAY_EXTXBF_ONLY_UPLOAD_H_GET(x) (((x) & 0x00000080) >> 7) -#define MAC_PCU_H_XFER_TIMEOUT_DELAY_EXTXBF_ONLY_UPLOAD_H_SET(x) (((x) << 7) & 0x00000080) -#define MAC_PCU_H_XFER_TIMEOUT_EXTXBF_NOACK_NORPT_MSB 8 -#define MAC_PCU_H_XFER_TIMEOUT_EXTXBF_NOACK_NORPT_LSB 8 -#define MAC_PCU_H_XFER_TIMEOUT_EXTXBF_NOACK_NORPT_MASK 0x00000100 -#define MAC_PCU_H_XFER_TIMEOUT_EXTXBF_NOACK_NORPT_GET(x) (((x) & 0x00000100) >> 8) -#define MAC_PCU_H_XFER_TIMEOUT_EXTXBF_NOACK_NORPT_SET(x) (((x) << 8) & 0x00000100) - -/* macros for MAC_PCU_RX_CLEAR_DIFF_CNT */ -#define MAC_PCU_RX_CLEAR_DIFF_CNT_ADDRESS 0x00008328 -#define MAC_PCU_RX_CLEAR_DIFF_CNT_OFFSET 0x00008328 -#define MAC_PCU_RX_CLEAR_DIFF_CNT_VALUE_MSB 31 -#define MAC_PCU_RX_CLEAR_DIFF_CNT_VALUE_LSB 0 -#define MAC_PCU_RX_CLEAR_DIFF_CNT_VALUE_MASK 0xffffffff -#define MAC_PCU_RX_CLEAR_DIFF_CNT_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_RX_CLEAR_DIFF_CNT_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_SELF_GEN_ANTENNA_MASK */ -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_ADDRESS 0x0000832c -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_OFFSET 0x0000832c -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_VALUE_MSB 2 -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_VALUE_LSB 0 -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_VALUE_MASK 0x00000007 -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_VALUE_GET(x) (((x) & 0x00000007) >> 0) -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_VALUE_SET(x) (((x) << 0) & 0x00000007) -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_ONE_RESP_EN_MSB 3 -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_ONE_RESP_EN_LSB 3 -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_ONE_RESP_EN_MASK 0x00000008 -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_ONE_RESP_EN_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_ONE_RESP_EN_SET(x) (((x) << 3) & 0x00000008) -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_FORCE_CHAIN_0_MSB 4 -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_FORCE_CHAIN_0_LSB 4 -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_FORCE_CHAIN_0_MASK 0x00000010 -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_FORCE_CHAIN_0_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_PCU_SELF_GEN_ANTENNA_MASK_FORCE_CHAIN_0_SET(x) (((x) << 4) & 0x00000010) - -/* macros for MAC_PCU_BA_BAR_CONTROL */ -#define MAC_PCU_BA_BAR_CONTROL_ADDRESS 0x00008330 -#define MAC_PCU_BA_BAR_CONTROL_OFFSET 0x00008330 -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_OFFSET_MSB 3 -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_OFFSET_LSB 0 -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_OFFSET_MASK 0x0000000f -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_OFFSET_GET(x) (((x) & 0x0000000f) >> 0) -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_OFFSET_SET(x) (((x) << 0) & 0x0000000f) -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_OFFSET_MSB 7 -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_OFFSET_LSB 4 -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_OFFSET_MASK 0x000000f0 -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_OFFSET_GET(x) (((x) & 0x000000f0) >> 4) -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_OFFSET_SET(x) (((x) << 4) & 0x000000f0) -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_VALUE_MSB 8 -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_VALUE_LSB 8 -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_VALUE_MASK 0x00000100 -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_VALUE_GET(x) (((x) & 0x00000100) >> 8) -#define MAC_PCU_BA_BAR_CONTROL_COMPRESSED_VALUE_SET(x) (((x) << 8) & 0x00000100) -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_VALUE_MSB 9 -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_VALUE_LSB 9 -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_VALUE_MASK 0x00000200 -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_VALUE_GET(x) (((x) & 0x00000200) >> 9) -#define MAC_PCU_BA_BAR_CONTROL_ACK_POLICY_VALUE_SET(x) (((x) << 9) & 0x00000200) -#define MAC_PCU_BA_BAR_CONTROL_FORCE_NO_MATCH_MSB 10 -#define MAC_PCU_BA_BAR_CONTROL_FORCE_NO_MATCH_LSB 10 -#define MAC_PCU_BA_BAR_CONTROL_FORCE_NO_MATCH_MASK 0x00000400 -#define MAC_PCU_BA_BAR_CONTROL_FORCE_NO_MATCH_GET(x) (((x) & 0x00000400) >> 10) -#define MAC_PCU_BA_BAR_CONTROL_FORCE_NO_MATCH_SET(x) (((x) << 10) & 0x00000400) -#define MAC_PCU_BA_BAR_CONTROL_TX_BA_CLEAR_BA_VALID_MSB 11 -#define MAC_PCU_BA_BAR_CONTROL_TX_BA_CLEAR_BA_VALID_LSB 11 -#define MAC_PCU_BA_BAR_CONTROL_TX_BA_CLEAR_BA_VALID_MASK 0x00000800 -#define MAC_PCU_BA_BAR_CONTROL_TX_BA_CLEAR_BA_VALID_GET(x) (((x) & 0x00000800) >> 11) -#define MAC_PCU_BA_BAR_CONTROL_TX_BA_CLEAR_BA_VALID_SET(x) (((x) << 11) & 0x00000800) -#define MAC_PCU_BA_BAR_CONTROL_UPDATE_BA_BITMAP_QOS_NULL_MSB 12 -#define MAC_PCU_BA_BAR_CONTROL_UPDATE_BA_BITMAP_QOS_NULL_LSB 12 -#define MAC_PCU_BA_BAR_CONTROL_UPDATE_BA_BITMAP_QOS_NULL_MASK 0x00001000 -#define MAC_PCU_BA_BAR_CONTROL_UPDATE_BA_BITMAP_QOS_NULL_GET(x) (((x) & 0x00001000) >> 12) -#define MAC_PCU_BA_BAR_CONTROL_UPDATE_BA_BITMAP_QOS_NULL_SET(x) (((x) << 12) & 0x00001000) - -/* macros for MAC_PCU_LEGACY_PLCP_SPOOF */ -#define MAC_PCU_LEGACY_PLCP_SPOOF_ADDRESS 0x00008334 -#define MAC_PCU_LEGACY_PLCP_SPOOF_OFFSET 0x00008334 -#define MAC_PCU_LEGACY_PLCP_SPOOF_EIFS_MINUS_DIFS_MSB 7 -#define MAC_PCU_LEGACY_PLCP_SPOOF_EIFS_MINUS_DIFS_LSB 0 -#define MAC_PCU_LEGACY_PLCP_SPOOF_EIFS_MINUS_DIFS_MASK 0x000000ff -#define MAC_PCU_LEGACY_PLCP_SPOOF_EIFS_MINUS_DIFS_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_LEGACY_PLCP_SPOOF_EIFS_MINUS_DIFS_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_LEGACY_PLCP_SPOOF_MIN_LENGTH_MSB 12 -#define MAC_PCU_LEGACY_PLCP_SPOOF_MIN_LENGTH_LSB 8 -#define MAC_PCU_LEGACY_PLCP_SPOOF_MIN_LENGTH_MASK 0x00001f00 -#define MAC_PCU_LEGACY_PLCP_SPOOF_MIN_LENGTH_GET(x) (((x) & 0x00001f00) >> 8) -#define MAC_PCU_LEGACY_PLCP_SPOOF_MIN_LENGTH_SET(x) (((x) << 8) & 0x00001f00) - -/* macros for MAC_PCU_PHY_ERROR_MASK_CONT */ -#define MAC_PCU_PHY_ERROR_MASK_CONT_ADDRESS 0x00008338 -#define MAC_PCU_PHY_ERROR_MASK_CONT_OFFSET 0x00008338 -#define MAC_PCU_PHY_ERROR_MASK_CONT_MASK_VALUE_MSB 7 -#define MAC_PCU_PHY_ERROR_MASK_CONT_MASK_VALUE_LSB 0 -#define MAC_PCU_PHY_ERROR_MASK_CONT_MASK_VALUE_MASK 0x000000ff -#define MAC_PCU_PHY_ERROR_MASK_CONT_MASK_VALUE_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_PHY_ERROR_MASK_CONT_MASK_VALUE_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_PHY_ERROR_MASK_CONT_EIFS_VALUE_MSB 23 -#define MAC_PCU_PHY_ERROR_MASK_CONT_EIFS_VALUE_LSB 16 -#define MAC_PCU_PHY_ERROR_MASK_CONT_EIFS_VALUE_MASK 0x00ff0000 -#define MAC_PCU_PHY_ERROR_MASK_CONT_EIFS_VALUE_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_PHY_ERROR_MASK_CONT_EIFS_VALUE_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_PHY_ERROR_MASK_CONT_AIFS_VALUE_MSB 31 -#define MAC_PCU_PHY_ERROR_MASK_CONT_AIFS_VALUE_LSB 24 -#define MAC_PCU_PHY_ERROR_MASK_CONT_AIFS_VALUE_MASK 0xff000000 -#define MAC_PCU_PHY_ERROR_MASK_CONT_AIFS_VALUE_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_PCU_PHY_ERROR_MASK_CONT_AIFS_VALUE_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_TX_TIMER */ -#define MAC_PCU_TX_TIMER_ADDRESS 0x0000833c -#define MAC_PCU_TX_TIMER_OFFSET 0x0000833c -#define MAC_PCU_TX_TIMER_TX_TIMER_MSB 14 -#define MAC_PCU_TX_TIMER_TX_TIMER_LSB 0 -#define MAC_PCU_TX_TIMER_TX_TIMER_MASK 0x00007fff -#define MAC_PCU_TX_TIMER_TX_TIMER_GET(x) (((x) & 0x00007fff) >> 0) -#define MAC_PCU_TX_TIMER_TX_TIMER_SET(x) (((x) << 0) & 0x00007fff) -#define MAC_PCU_TX_TIMER_TX_TIMER_ENABLE_MSB 15 -#define MAC_PCU_TX_TIMER_TX_TIMER_ENABLE_LSB 15 -#define MAC_PCU_TX_TIMER_TX_TIMER_ENABLE_MASK 0x00008000 -#define MAC_PCU_TX_TIMER_TX_TIMER_ENABLE_GET(x) (((x) & 0x00008000) >> 15) -#define MAC_PCU_TX_TIMER_TX_TIMER_ENABLE_SET(x) (((x) << 15) & 0x00008000) -#define MAC_PCU_TX_TIMER_RIFS_TIMER_MSB 19 -#define MAC_PCU_TX_TIMER_RIFS_TIMER_LSB 16 -#define MAC_PCU_TX_TIMER_RIFS_TIMER_MASK 0x000f0000 -#define MAC_PCU_TX_TIMER_RIFS_TIMER_GET(x) (((x) & 0x000f0000) >> 16) -#define MAC_PCU_TX_TIMER_RIFS_TIMER_SET(x) (((x) << 16) & 0x000f0000) -#define MAC_PCU_TX_TIMER_QUIET_TIMER_MSB 24 -#define MAC_PCU_TX_TIMER_QUIET_TIMER_LSB 20 -#define MAC_PCU_TX_TIMER_QUIET_TIMER_MASK 0x01f00000 -#define MAC_PCU_TX_TIMER_QUIET_TIMER_GET(x) (((x) & 0x01f00000) >> 20) -#define MAC_PCU_TX_TIMER_QUIET_TIMER_SET(x) (((x) << 20) & 0x01f00000) -#define MAC_PCU_TX_TIMER_QUIET_TIMER_ENABLE_MSB 25 -#define MAC_PCU_TX_TIMER_QUIET_TIMER_ENABLE_LSB 25 -#define MAC_PCU_TX_TIMER_QUIET_TIMER_ENABLE_MASK 0x02000000 -#define MAC_PCU_TX_TIMER_QUIET_TIMER_ENABLE_GET(x) (((x) & 0x02000000) >> 25) -#define MAC_PCU_TX_TIMER_QUIET_TIMER_ENABLE_SET(x) (((x) << 25) & 0x02000000) - -/* macros for MAC_PCU_TXBUF_CTRL */ -#define MAC_PCU_TXBUF_CTRL_ADDRESS 0x00008340 -#define MAC_PCU_TXBUF_CTRL_OFFSET 0x00008340 -#define MAC_PCU_TXBUF_CTRL_USABLE_ENTRIES_MSB 11 -#define MAC_PCU_TXBUF_CTRL_USABLE_ENTRIES_LSB 0 -#define MAC_PCU_TXBUF_CTRL_USABLE_ENTRIES_MASK 0x00000fff -#define MAC_PCU_TXBUF_CTRL_USABLE_ENTRIES_GET(x) (((x) & 0x00000fff) >> 0) -#define MAC_PCU_TXBUF_CTRL_USABLE_ENTRIES_SET(x) (((x) << 0) & 0x00000fff) -#define MAC_PCU_TXBUF_CTRL_TX_FIFO_WRAP_ENABLE_MSB 16 -#define MAC_PCU_TXBUF_CTRL_TX_FIFO_WRAP_ENABLE_LSB 16 -#define MAC_PCU_TXBUF_CTRL_TX_FIFO_WRAP_ENABLE_MASK 0x00010000 -#define MAC_PCU_TXBUF_CTRL_TX_FIFO_WRAP_ENABLE_GET(x) (((x) & 0x00010000) >> 16) -#define MAC_PCU_TXBUF_CTRL_TX_FIFO_WRAP_ENABLE_SET(x) (((x) << 16) & 0x00010000) - -/* macros for MAC_PCU_MISC_MODE2 */ -#define MAC_PCU_MISC_MODE2_ADDRESS 0x00008344 -#define MAC_PCU_MISC_MODE2_OFFSET 0x00008344 -#define MAC_PCU_MISC_MODE2_BUG_21532_FIX_ENABLE_MSB 0 -#define MAC_PCU_MISC_MODE2_BUG_21532_FIX_ENABLE_LSB 0 -#define MAC_PCU_MISC_MODE2_BUG_21532_FIX_ENABLE_MASK 0x00000001 -#define MAC_PCU_MISC_MODE2_BUG_21532_FIX_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_MISC_MODE2_BUG_21532_FIX_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE_MSB 1 -#define MAC_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE_LSB 1 -#define MAC_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE_MASK 0x00000002 -#define MAC_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT_MSB 2 -#define MAC_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT_LSB 2 -#define MAC_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT_MASK 0x00000004 -#define MAC_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_MISC_MODE2_BUG_58603_FIX_ENABLE_MSB 3 -#define MAC_PCU_MISC_MODE2_BUG_58603_FIX_ENABLE_LSB 3 -#define MAC_PCU_MISC_MODE2_BUG_58603_FIX_ENABLE_MASK 0x00000008 -#define MAC_PCU_MISC_MODE2_BUG_58603_FIX_ENABLE_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_MISC_MODE2_BUG_58603_FIX_ENABLE_SET(x) (((x) << 3) & 0x00000008) -#define MAC_PCU_MISC_MODE2_BUG_58057_FIX_ENABLE_MSB 4 -#define MAC_PCU_MISC_MODE2_BUG_58057_FIX_ENABLE_LSB 4 -#define MAC_PCU_MISC_MODE2_BUG_58057_FIX_ENABLE_MASK 0x00000010 -#define MAC_PCU_MISC_MODE2_BUG_58057_FIX_ENABLE_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_PCU_MISC_MODE2_BUG_58057_FIX_ENABLE_SET(x) (((x) << 4) & 0x00000010) -#define MAC_PCU_MISC_MODE2_RESERVED_0_MSB 5 -#define MAC_PCU_MISC_MODE2_RESERVED_0_LSB 5 -#define MAC_PCU_MISC_MODE2_RESERVED_0_MASK 0x00000020 -#define MAC_PCU_MISC_MODE2_RESERVED_0_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_PCU_MISC_MODE2_RESERVED_0_SET(x) (((x) << 5) & 0x00000020) -#define MAC_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE_MSB 6 -#define MAC_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE_LSB 6 -#define MAC_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE_MASK 0x00000040 -#define MAC_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE_GET(x) (((x) & 0x00000040) >> 6) -#define MAC_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE_SET(x) (((x) << 6) & 0x00000040) -#define MAC_PCU_MISC_MODE2_CFP_IGNORE_MSB 7 -#define MAC_PCU_MISC_MODE2_CFP_IGNORE_LSB 7 -#define MAC_PCU_MISC_MODE2_CFP_IGNORE_MASK 0x00000080 -#define MAC_PCU_MISC_MODE2_CFP_IGNORE_GET(x) (((x) & 0x00000080) >> 7) -#define MAC_PCU_MISC_MODE2_CFP_IGNORE_SET(x) (((x) << 7) & 0x00000080) -#define MAC_PCU_MISC_MODE2_MGMT_QOS_MSB 15 -#define MAC_PCU_MISC_MODE2_MGMT_QOS_LSB 8 -#define MAC_PCU_MISC_MODE2_MGMT_QOS_MASK 0x0000ff00 -#define MAC_PCU_MISC_MODE2_MGMT_QOS_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_MISC_MODE2_MGMT_QOS_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION_MSB 16 -#define MAC_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION_LSB 16 -#define MAC_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION_MASK 0x00010000 -#define MAC_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION_GET(x) (((x) & 0x00010000) >> 16) -#define MAC_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION_SET(x) (((x) << 16) & 0x00010000) -#define MAC_PCU_MISC_MODE2_AGG_WEP_MSB 17 -#define MAC_PCU_MISC_MODE2_AGG_WEP_LSB 17 -#define MAC_PCU_MISC_MODE2_AGG_WEP_MASK 0x00020000 -#define MAC_PCU_MISC_MODE2_AGG_WEP_GET(x) (((x) & 0x00020000) >> 17) -#define MAC_PCU_MISC_MODE2_AGG_WEP_SET(x) (((x) << 17) & 0x00020000) -#define MAC_PCU_MISC_MODE2_BC_MC_WAPI_MODE_MSB 18 -#define MAC_PCU_MISC_MODE2_BC_MC_WAPI_MODE_LSB 18 -#define MAC_PCU_MISC_MODE2_BC_MC_WAPI_MODE_MASK 0x00040000 -#define MAC_PCU_MISC_MODE2_BC_MC_WAPI_MODE_GET(x) (((x) & 0x00040000) >> 18) -#define MAC_PCU_MISC_MODE2_BC_MC_WAPI_MODE_SET(x) (((x) << 18) & 0x00040000) -#define MAC_PCU_MISC_MODE2_DUR_ACCOUNT_BY_BA_MSB 19 -#define MAC_PCU_MISC_MODE2_DUR_ACCOUNT_BY_BA_LSB 19 -#define MAC_PCU_MISC_MODE2_DUR_ACCOUNT_BY_BA_MASK 0x00080000 -#define MAC_PCU_MISC_MODE2_DUR_ACCOUNT_BY_BA_GET(x) (((x) & 0x00080000) >> 19) -#define MAC_PCU_MISC_MODE2_DUR_ACCOUNT_BY_BA_SET(x) (((x) << 19) & 0x00080000) -#define MAC_PCU_MISC_MODE2_BUG_28676_MSB 20 -#define MAC_PCU_MISC_MODE2_BUG_28676_LSB 20 -#define MAC_PCU_MISC_MODE2_BUG_28676_MASK 0x00100000 -#define MAC_PCU_MISC_MODE2_BUG_28676_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_PCU_MISC_MODE2_BUG_28676_SET(x) (((x) << 20) & 0x00100000) -#define MAC_PCU_MISC_MODE2_CLEAR_MORE_FRAG_MSB 21 -#define MAC_PCU_MISC_MODE2_CLEAR_MORE_FRAG_LSB 21 -#define MAC_PCU_MISC_MODE2_CLEAR_MORE_FRAG_MASK 0x00200000 -#define MAC_PCU_MISC_MODE2_CLEAR_MORE_FRAG_GET(x) (((x) & 0x00200000) >> 21) -#define MAC_PCU_MISC_MODE2_CLEAR_MORE_FRAG_SET(x) (((x) << 21) & 0x00200000) -#define MAC_PCU_MISC_MODE2_IGNORE_TXOP_1ST_PKT_MSB 22 -#define MAC_PCU_MISC_MODE2_IGNORE_TXOP_1ST_PKT_LSB 22 -#define MAC_PCU_MISC_MODE2_IGNORE_TXOP_1ST_PKT_MASK 0x00400000 -#define MAC_PCU_MISC_MODE2_IGNORE_TXOP_1ST_PKT_GET(x) (((x) & 0x00400000) >> 22) -#define MAC_PCU_MISC_MODE2_IGNORE_TXOP_1ST_PKT_SET(x) (((x) << 22) & 0x00400000) -#define MAC_PCU_MISC_MODE2_MPDU_DENSITY_STS_FIX_MSB 23 -#define MAC_PCU_MISC_MODE2_MPDU_DENSITY_STS_FIX_LSB 23 -#define MAC_PCU_MISC_MODE2_MPDU_DENSITY_STS_FIX_MASK 0x00800000 -#define MAC_PCU_MISC_MODE2_MPDU_DENSITY_STS_FIX_GET(x) (((x) & 0x00800000) >> 23) -#define MAC_PCU_MISC_MODE2_MPDU_DENSITY_STS_FIX_SET(x) (((x) << 23) & 0x00800000) -#define MAC_PCU_MISC_MODE2_MPDU_DENSITY_WAIT_WEP_MSB 24 -#define MAC_PCU_MISC_MODE2_MPDU_DENSITY_WAIT_WEP_LSB 24 -#define MAC_PCU_MISC_MODE2_MPDU_DENSITY_WAIT_WEP_MASK 0x01000000 -#define MAC_PCU_MISC_MODE2_MPDU_DENSITY_WAIT_WEP_GET(x) (((x) & 0x01000000) >> 24) -#define MAC_PCU_MISC_MODE2_MPDU_DENSITY_WAIT_WEP_SET(x) (((x) << 24) & 0x01000000) -#define MAC_PCU_MISC_MODE2_RCV_TIMESTAMP_FIX_MSB 25 -#define MAC_PCU_MISC_MODE2_RCV_TIMESTAMP_FIX_LSB 25 -#define MAC_PCU_MISC_MODE2_RCV_TIMESTAMP_FIX_MASK 0x02000000 -#define MAC_PCU_MISC_MODE2_RCV_TIMESTAMP_FIX_GET(x) (((x) & 0x02000000) >> 25) -#define MAC_PCU_MISC_MODE2_RCV_TIMESTAMP_FIX_SET(x) (((x) << 25) & 0x02000000) -#define MAC_PCU_MISC_MODE2_DECOUPLE_DECRYPTION_MSB 27 -#define MAC_PCU_MISC_MODE2_DECOUPLE_DECRYPTION_LSB 27 -#define MAC_PCU_MISC_MODE2_DECOUPLE_DECRYPTION_MASK 0x08000000 -#define MAC_PCU_MISC_MODE2_DECOUPLE_DECRYPTION_GET(x) (((x) & 0x08000000) >> 27) -#define MAC_PCU_MISC_MODE2_DECOUPLE_DECRYPTION_SET(x) (((x) << 27) & 0x08000000) -#define MAC_PCU_MISC_MODE2_H_TO_SW_DEBUG_MODE_MSB 28 -#define MAC_PCU_MISC_MODE2_H_TO_SW_DEBUG_MODE_LSB 28 -#define MAC_PCU_MISC_MODE2_H_TO_SW_DEBUG_MODE_MASK 0x10000000 -#define MAC_PCU_MISC_MODE2_H_TO_SW_DEBUG_MODE_GET(x) (((x) & 0x10000000) >> 28) -#define MAC_PCU_MISC_MODE2_H_TO_SW_DEBUG_MODE_SET(x) (((x) << 28) & 0x10000000) -#define MAC_PCU_MISC_MODE2_TXBF_ACT_RPT_DONE_PASS_MSB 29 -#define MAC_PCU_MISC_MODE2_TXBF_ACT_RPT_DONE_PASS_LSB 29 -#define MAC_PCU_MISC_MODE2_TXBF_ACT_RPT_DONE_PASS_MASK 0x20000000 -#define MAC_PCU_MISC_MODE2_TXBF_ACT_RPT_DONE_PASS_GET(x) (((x) & 0x20000000) >> 29) -#define MAC_PCU_MISC_MODE2_TXBF_ACT_RPT_DONE_PASS_SET(x) (((x) << 29) & 0x20000000) -#define MAC_PCU_MISC_MODE2_PCU_LOOP_TXBF_MSB 30 -#define MAC_PCU_MISC_MODE2_PCU_LOOP_TXBF_LSB 30 -#define MAC_PCU_MISC_MODE2_PCU_LOOP_TXBF_MASK 0x40000000 -#define MAC_PCU_MISC_MODE2_PCU_LOOP_TXBF_GET(x) (((x) & 0x40000000) >> 30) -#define MAC_PCU_MISC_MODE2_PCU_LOOP_TXBF_SET(x) (((x) << 30) & 0x40000000) -#define MAC_PCU_MISC_MODE2_CLEAR_WEP_TXBUSY_ON_TXURN_MSB 31 -#define MAC_PCU_MISC_MODE2_CLEAR_WEP_TXBUSY_ON_TXURN_LSB 31 -#define MAC_PCU_MISC_MODE2_CLEAR_WEP_TXBUSY_ON_TXURN_MASK 0x80000000 -#define MAC_PCU_MISC_MODE2_CLEAR_WEP_TXBUSY_ON_TXURN_GET(x) (((x) & 0x80000000) >> 31) -#define MAC_PCU_MISC_MODE2_CLEAR_WEP_TXBUSY_ON_TXURN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for MAC_PCU_ALT_AES_MUTE_MASK */ -#define MAC_PCU_ALT_AES_MUTE_MASK_ADDRESS 0x00008348 -#define MAC_PCU_ALT_AES_MUTE_MASK_OFFSET 0x00008348 -#define MAC_PCU_ALT_AES_MUTE_MASK_QOS_MSB 31 -#define MAC_PCU_ALT_AES_MUTE_MASK_QOS_LSB 16 -#define MAC_PCU_ALT_AES_MUTE_MASK_QOS_MASK 0xffff0000 -#define MAC_PCU_ALT_AES_MUTE_MASK_QOS_GET(x) (((x) & 0xffff0000) >> 16) -#define MAC_PCU_ALT_AES_MUTE_MASK_QOS_SET(x) (((x) << 16) & 0xffff0000) - -/* macros for MAC_PCU_WOW6 */ -#define MAC_PCU_WOW6_ADDRESS 0x0000834c -#define MAC_PCU_WOW6_OFFSET 0x0000834c -#define MAC_PCU_WOW6_RXBUF_START_ADDR_MSB 15 -#define MAC_PCU_WOW6_RXBUF_START_ADDR_LSB 0 -#define MAC_PCU_WOW6_RXBUF_START_ADDR_MASK 0x0000ffff -#define MAC_PCU_WOW6_RXBUF_START_ADDR_GET(x) (((x) & 0x0000ffff) >> 0) - -/* macros for ASYNC_FIFO_REG1 */ -#define ASYNC_FIFO_REG1_ADDRESS 0x00008350 -#define ASYNC_FIFO_REG1_OFFSET 0x00008350 -#define ASYNC_FIFO_REG1_DBG_MSB 29 -#define ASYNC_FIFO_REG1_DBG_LSB 0 -#define ASYNC_FIFO_REG1_DBG_MASK 0x3fffffff -#define ASYNC_FIFO_REG1_DBG_GET(x) (((x) & 0x3fffffff) >> 0) -#define ASYNC_FIFO_REG1_DBG_SET(x) (((x) << 0) & 0x3fffffff) - -/* macros for ASYNC_FIFO_REG2 */ -#define ASYNC_FIFO_REG2_ADDRESS 0x00008354 -#define ASYNC_FIFO_REG2_OFFSET 0x00008354 -#define ASYNC_FIFO_REG2_DBG_MSB 27 -#define ASYNC_FIFO_REG2_DBG_LSB 0 -#define ASYNC_FIFO_REG2_DBG_MASK 0x0fffffff -#define ASYNC_FIFO_REG2_DBG_GET(x) (((x) & 0x0fffffff) >> 0) -#define ASYNC_FIFO_REG2_DBG_SET(x) (((x) << 0) & 0x0fffffff) - -/* macros for ASYNC_FIFO_REG3 */ -#define ASYNC_FIFO_REG3_ADDRESS 0x00008358 -#define ASYNC_FIFO_REG3_OFFSET 0x00008358 -#define ASYNC_FIFO_REG3_DBG_MSB 9 -#define ASYNC_FIFO_REG3_DBG_LSB 0 -#define ASYNC_FIFO_REG3_DBG_MASK 0x000003ff -#define ASYNC_FIFO_REG3_DBG_GET(x) (((x) & 0x000003ff) >> 0) -#define ASYNC_FIFO_REG3_DBG_SET(x) (((x) << 0) & 0x000003ff) -#define ASYNC_FIFO_REG3_DATAPATH_SEL_MSB 10 -#define ASYNC_FIFO_REG3_DATAPATH_SEL_LSB 10 -#define ASYNC_FIFO_REG3_DATAPATH_SEL_MASK 0x00000400 -#define ASYNC_FIFO_REG3_DATAPATH_SEL_GET(x) (((x) & 0x00000400) >> 10) -#define ASYNC_FIFO_REG3_DATAPATH_SEL_SET(x) (((x) << 10) & 0x00000400) -#define ASYNC_FIFO_REG3_SFT_RST_N_MSB 31 -#define ASYNC_FIFO_REG3_SFT_RST_N_LSB 31 -#define ASYNC_FIFO_REG3_SFT_RST_N_MASK 0x80000000 -#define ASYNC_FIFO_REG3_SFT_RST_N_GET(x) (((x) & 0x80000000) >> 31) -#define ASYNC_FIFO_REG3_SFT_RST_N_SET(x) (((x) << 31) & 0x80000000) - -/* macros for MAC_PCU_WOW5 */ -#define MAC_PCU_WOW5_ADDRESS 0x0000835c -#define MAC_PCU_WOW5_OFFSET 0x0000835c -#define MAC_PCU_WOW5_RX_ABORT_ENABLE_MSB 15 -#define MAC_PCU_WOW5_RX_ABORT_ENABLE_LSB 0 -#define MAC_PCU_WOW5_RX_ABORT_ENABLE_MASK 0x0000ffff -#define MAC_PCU_WOW5_RX_ABORT_ENABLE_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_WOW5_RX_ABORT_ENABLE_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MAC_PCU_WOW_LENGTH1 */ -#define MAC_PCU_WOW_LENGTH1_ADDRESS 0x00008360 -#define MAC_PCU_WOW_LENGTH1_OFFSET 0x00008360 -#define MAC_PCU_WOW_LENGTH1_PATTERN_3_MSB 7 -#define MAC_PCU_WOW_LENGTH1_PATTERN_3_LSB 0 -#define MAC_PCU_WOW_LENGTH1_PATTERN_3_MASK 0x000000ff -#define MAC_PCU_WOW_LENGTH1_PATTERN_3_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_WOW_LENGTH1_PATTERN_3_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_WOW_LENGTH1_PATTERN_2_MSB 15 -#define MAC_PCU_WOW_LENGTH1_PATTERN_2_LSB 8 -#define MAC_PCU_WOW_LENGTH1_PATTERN_2_MASK 0x0000ff00 -#define MAC_PCU_WOW_LENGTH1_PATTERN_2_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_WOW_LENGTH1_PATTERN_2_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_WOW_LENGTH1_PATTERN_1_MSB 23 -#define MAC_PCU_WOW_LENGTH1_PATTERN_1_LSB 16 -#define MAC_PCU_WOW_LENGTH1_PATTERN_1_MASK 0x00ff0000 -#define MAC_PCU_WOW_LENGTH1_PATTERN_1_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_WOW_LENGTH1_PATTERN_1_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_WOW_LENGTH1_PATTERN_0_MSB 31 -#define MAC_PCU_WOW_LENGTH1_PATTERN_0_LSB 24 -#define MAC_PCU_WOW_LENGTH1_PATTERN_0_MASK 0xff000000 -#define MAC_PCU_WOW_LENGTH1_PATTERN_0_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_PCU_WOW_LENGTH1_PATTERN_0_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_WOW_LENGTH2 */ -#define MAC_PCU_WOW_LENGTH2_ADDRESS 0x00008364 -#define MAC_PCU_WOW_LENGTH2_OFFSET 0x00008364 -#define MAC_PCU_WOW_LENGTH2_PATTERN_7_MSB 7 -#define MAC_PCU_WOW_LENGTH2_PATTERN_7_LSB 0 -#define MAC_PCU_WOW_LENGTH2_PATTERN_7_MASK 0x000000ff -#define MAC_PCU_WOW_LENGTH2_PATTERN_7_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_WOW_LENGTH2_PATTERN_7_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_WOW_LENGTH2_PATTERN_6_MSB 15 -#define MAC_PCU_WOW_LENGTH2_PATTERN_6_LSB 8 -#define MAC_PCU_WOW_LENGTH2_PATTERN_6_MASK 0x0000ff00 -#define MAC_PCU_WOW_LENGTH2_PATTERN_6_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_WOW_LENGTH2_PATTERN_6_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_WOW_LENGTH2_PATTERN_5_MSB 23 -#define MAC_PCU_WOW_LENGTH2_PATTERN_5_LSB 16 -#define MAC_PCU_WOW_LENGTH2_PATTERN_5_MASK 0x00ff0000 -#define MAC_PCU_WOW_LENGTH2_PATTERN_5_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_WOW_LENGTH2_PATTERN_5_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_WOW_LENGTH2_PATTERN_4_MSB 31 -#define MAC_PCU_WOW_LENGTH2_PATTERN_4_LSB 24 -#define MAC_PCU_WOW_LENGTH2_PATTERN_4_MASK 0xff000000 -#define MAC_PCU_WOW_LENGTH2_PATTERN_4_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_PCU_WOW_LENGTH2_PATTERN_4_SET(x) (((x) << 24) & 0xff000000) - -/* macros for WOW_PATTERN_MATCH_LESS_THAN_256_BYTES */ -#define WOW_PATTERN_MATCH_LESS_THAN_256_BYTES_ADDRESS 0x00008368 -#define WOW_PATTERN_MATCH_LESS_THAN_256_BYTES_OFFSET 0x00008368 -#define WOW_PATTERN_MATCH_LESS_THAN_256_BYTES_EN_MSB 15 -#define WOW_PATTERN_MATCH_LESS_THAN_256_BYTES_EN_LSB 0 -#define WOW_PATTERN_MATCH_LESS_THAN_256_BYTES_EN_MASK 0x0000ffff -#define WOW_PATTERN_MATCH_LESS_THAN_256_BYTES_EN_GET(x) (((x) & 0x0000ffff) >> 0) -#define WOW_PATTERN_MATCH_LESS_THAN_256_BYTES_EN_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MAC_PCU_WOW4 */ -#define MAC_PCU_WOW4_ADDRESS 0x00008370 -#define MAC_PCU_WOW4_OFFSET 0x00008370 -#define MAC_PCU_WOW4_PATTERN_ENABLE_MSB 7 -#define MAC_PCU_WOW4_PATTERN_ENABLE_LSB 0 -#define MAC_PCU_WOW4_PATTERN_ENABLE_MASK 0x000000ff -#define MAC_PCU_WOW4_PATTERN_ENABLE_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_WOW4_PATTERN_ENABLE_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_WOW4_PATTERN_DETECT_MSB 15 -#define MAC_PCU_WOW4_PATTERN_DETECT_LSB 8 -#define MAC_PCU_WOW4_PATTERN_DETECT_MASK 0x0000ff00 -#define MAC_PCU_WOW4_PATTERN_DETECT_GET(x) (((x) & 0x0000ff00) >> 8) - -/* macros for WOW2_EXACT */ -#define WOW2_EXACT_ADDRESS 0x00008374 -#define WOW2_EXACT_OFFSET 0x00008374 -#define WOW2_EXACT_LENGTH_MSB 7 -#define WOW2_EXACT_LENGTH_LSB 0 -#define WOW2_EXACT_LENGTH_MASK 0x000000ff -#define WOW2_EXACT_LENGTH_GET(x) (((x) & 0x000000ff) >> 0) -#define WOW2_EXACT_LENGTH_SET(x) (((x) << 0) & 0x000000ff) -#define WOW2_EXACT_OFFSET_MSB 15 -#define WOW2_EXACT_OFFSET_LSB 8 -#define WOW2_EXACT_OFFSET_MASK 0x0000ff00 -#define WOW2_EXACT_OFFSET_GET(x) (((x) & 0x0000ff00) >> 8) -#define WOW2_EXACT_OFFSET_SET(x) (((x) << 8) & 0x0000ff00) - -/* macros for PCU_WOW6 */ -#define PCU_WOW6_ADDRESS 0x00008378 -#define PCU_WOW6_OFFSET 0x00008378 -#define PCU_WOW6_OFFSET8_MSB 7 -#define PCU_WOW6_OFFSET8_LSB 0 -#define PCU_WOW6_OFFSET8_MASK 0x000000ff -#define PCU_WOW6_OFFSET8_GET(x) (((x) & 0x000000ff) >> 0) -#define PCU_WOW6_OFFSET8_SET(x) (((x) << 0) & 0x000000ff) -#define PCU_WOW6_OFFSET9_MSB 15 -#define PCU_WOW6_OFFSET9_LSB 8 -#define PCU_WOW6_OFFSET9_MASK 0x0000ff00 -#define PCU_WOW6_OFFSET9_GET(x) (((x) & 0x0000ff00) >> 8) -#define PCU_WOW6_OFFSET9_SET(x) (((x) << 8) & 0x0000ff00) -#define PCU_WOW6_OFFSET10_MSB 23 -#define PCU_WOW6_OFFSET10_LSB 16 -#define PCU_WOW6_OFFSET10_MASK 0x00ff0000 -#define PCU_WOW6_OFFSET10_GET(x) (((x) & 0x00ff0000) >> 16) -#define PCU_WOW6_OFFSET10_SET(x) (((x) << 16) & 0x00ff0000) -#define PCU_WOW6_OFFSET11_MSB 31 -#define PCU_WOW6_OFFSET11_LSB 24 -#define PCU_WOW6_OFFSET11_MASK 0xff000000 -#define PCU_WOW6_OFFSET11_GET(x) (((x) & 0xff000000) >> 24) -#define PCU_WOW6_OFFSET11_SET(x) (((x) << 24) & 0xff000000) - -/* macros for PCU_WOW7 */ -#define PCU_WOW7_ADDRESS 0x0000837c -#define PCU_WOW7_OFFSET 0x0000837c -#define PCU_WOW7_OFFSET12_MSB 7 -#define PCU_WOW7_OFFSET12_LSB 0 -#define PCU_WOW7_OFFSET12_MASK 0x000000ff -#define PCU_WOW7_OFFSET12_GET(x) (((x) & 0x000000ff) >> 0) -#define PCU_WOW7_OFFSET12_SET(x) (((x) << 0) & 0x000000ff) -#define PCU_WOW7_OFFSET13_MSB 15 -#define PCU_WOW7_OFFSET13_LSB 8 -#define PCU_WOW7_OFFSET13_MASK 0x0000ff00 -#define PCU_WOW7_OFFSET13_GET(x) (((x) & 0x0000ff00) >> 8) -#define PCU_WOW7_OFFSET13_SET(x) (((x) << 8) & 0x0000ff00) -#define PCU_WOW7_OFFSET14_MSB 23 -#define PCU_WOW7_OFFSET14_LSB 16 -#define PCU_WOW7_OFFSET14_MASK 0x00ff0000 -#define PCU_WOW7_OFFSET14_GET(x) (((x) & 0x00ff0000) >> 16) -#define PCU_WOW7_OFFSET14_SET(x) (((x) << 16) & 0x00ff0000) -#define PCU_WOW7_OFFSET15_MSB 31 -#define PCU_WOW7_OFFSET15_LSB 24 -#define PCU_WOW7_OFFSET15_MASK 0xff000000 -#define PCU_WOW7_OFFSET15_GET(x) (((x) & 0xff000000) >> 24) -#define PCU_WOW7_OFFSET15_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_WOW_LENGTH3 */ -#define MAC_PCU_WOW_LENGTH3_ADDRESS 0x00008380 -#define MAC_PCU_WOW_LENGTH3_OFFSET 0x00008380 -#define MAC_PCU_WOW_LENGTH3_PATTERN_11_MSB 7 -#define MAC_PCU_WOW_LENGTH3_PATTERN_11_LSB 0 -#define MAC_PCU_WOW_LENGTH3_PATTERN_11_MASK 0x000000ff -#define MAC_PCU_WOW_LENGTH3_PATTERN_11_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_WOW_LENGTH3_PATTERN_11_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_WOW_LENGTH3_PATTERN_10_MSB 15 -#define MAC_PCU_WOW_LENGTH3_PATTERN_10_LSB 8 -#define MAC_PCU_WOW_LENGTH3_PATTERN_10_MASK 0x0000ff00 -#define MAC_PCU_WOW_LENGTH3_PATTERN_10_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_WOW_LENGTH3_PATTERN_10_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_WOW_LENGTH3_PATTERN_9_MSB 23 -#define MAC_PCU_WOW_LENGTH3_PATTERN_9_LSB 16 -#define MAC_PCU_WOW_LENGTH3_PATTERN_9_MASK 0x00ff0000 -#define MAC_PCU_WOW_LENGTH3_PATTERN_9_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_WOW_LENGTH3_PATTERN_9_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_WOW_LENGTH3_PATTERN_8_MSB 31 -#define MAC_PCU_WOW_LENGTH3_PATTERN_8_LSB 24 -#define MAC_PCU_WOW_LENGTH3_PATTERN_8_MASK 0xff000000 -#define MAC_PCU_WOW_LENGTH3_PATTERN_8_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_PCU_WOW_LENGTH3_PATTERN_8_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_WOW_LENGTH4 */ -#define MAC_PCU_WOW_LENGTH4_ADDRESS 0x00008384 -#define MAC_PCU_WOW_LENGTH4_OFFSET 0x00008384 -#define MAC_PCU_WOW_LENGTH4_PATTERN_15_MSB 7 -#define MAC_PCU_WOW_LENGTH4_PATTERN_15_LSB 0 -#define MAC_PCU_WOW_LENGTH4_PATTERN_15_MASK 0x000000ff -#define MAC_PCU_WOW_LENGTH4_PATTERN_15_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_WOW_LENGTH4_PATTERN_15_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_WOW_LENGTH4_PATTERN_14_MSB 15 -#define MAC_PCU_WOW_LENGTH4_PATTERN_14_LSB 8 -#define MAC_PCU_WOW_LENGTH4_PATTERN_14_MASK 0x0000ff00 -#define MAC_PCU_WOW_LENGTH4_PATTERN_14_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_WOW_LENGTH4_PATTERN_14_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_WOW_LENGTH4_PATTERN_13_MSB 23 -#define MAC_PCU_WOW_LENGTH4_PATTERN_13_LSB 16 -#define MAC_PCU_WOW_LENGTH4_PATTERN_13_MASK 0x00ff0000 -#define MAC_PCU_WOW_LENGTH4_PATTERN_13_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_WOW_LENGTH4_PATTERN_13_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_WOW_LENGTH4_PATTERN_12_MSB 31 -#define MAC_PCU_WOW_LENGTH4_PATTERN_12_LSB 24 -#define MAC_PCU_WOW_LENGTH4_PATTERN_12_MASK 0xff000000 -#define MAC_PCU_WOW_LENGTH4_PATTERN_12_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_PCU_WOW_LENGTH4_PATTERN_12_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_LOCATION_MODE_CONTROL */ -#define MAC_PCU_LOCATION_MODE_CONTROL_ADDRESS 0x00008388 -#define MAC_PCU_LOCATION_MODE_CONTROL_OFFSET 0x00008388 -#define MAC_PCU_LOCATION_MODE_CONTROL_ENABLE_MSB 0 -#define MAC_PCU_LOCATION_MODE_CONTROL_ENABLE_LSB 0 -#define MAC_PCU_LOCATION_MODE_CONTROL_ENABLE_MASK 0x00000001 -#define MAC_PCU_LOCATION_MODE_CONTROL_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_LOCATION_MODE_CONTROL_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_LOCATION_MODE_CONTROL_UPLOAD_H_DISABLE_MSB 1 -#define MAC_PCU_LOCATION_MODE_CONTROL_UPLOAD_H_DISABLE_LSB 1 -#define MAC_PCU_LOCATION_MODE_CONTROL_UPLOAD_H_DISABLE_MASK 0x00000002 -#define MAC_PCU_LOCATION_MODE_CONTROL_UPLOAD_H_DISABLE_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_LOCATION_MODE_CONTROL_UPLOAD_H_DISABLE_SET(x) (((x) << 1) & 0x00000002) - -/* macros for MAC_PCU_LOCATION_MODE_TIMER */ -#define MAC_PCU_LOCATION_MODE_TIMER_ADDRESS 0x0000838c -#define MAC_PCU_LOCATION_MODE_TIMER_OFFSET 0x0000838c -#define MAC_PCU_LOCATION_MODE_TIMER_VALUE_MSB 31 -#define MAC_PCU_LOCATION_MODE_TIMER_VALUE_LSB 0 -#define MAC_PCU_LOCATION_MODE_TIMER_VALUE_MASK 0xffffffff -#define MAC_PCU_LOCATION_MODE_TIMER_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_LOCATION_MODE_TIMER_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_BSSID2_L32 */ -#define MAC_PCU_BSSID2_L32_ADDRESS 0x00008398 -#define MAC_PCU_BSSID2_L32_OFFSET 0x00008398 -#define MAC_PCU_BSSID2_L32_ADDR_MSB 31 -#define MAC_PCU_BSSID2_L32_ADDR_LSB 0 -#define MAC_PCU_BSSID2_L32_ADDR_MASK 0xffffffff -#define MAC_PCU_BSSID2_L32_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_BSSID2_L32_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_BSSID2_U16 */ -#define MAC_PCU_BSSID2_U16_ADDRESS 0x0000839c -#define MAC_PCU_BSSID2_U16_OFFSET 0x0000839c -#define MAC_PCU_BSSID2_U16_ADDR_MSB 15 -#define MAC_PCU_BSSID2_U16_ADDR_LSB 0 -#define MAC_PCU_BSSID2_U16_ADDR_MASK 0x0000ffff -#define MAC_PCU_BSSID2_U16_ADDR_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_BSSID2_U16_ADDR_SET(x) (((x) << 0) & 0x0000ffff) -#define MAC_PCU_BSSID2_U16_ENABLE_MSB 16 -#define MAC_PCU_BSSID2_U16_ENABLE_LSB 16 -#define MAC_PCU_BSSID2_U16_ENABLE_MASK 0x00010000 -#define MAC_PCU_BSSID2_U16_ENABLE_GET(x) (((x) & 0x00010000) >> 16) -#define MAC_PCU_BSSID2_U16_ENABLE_SET(x) (((x) << 16) & 0x00010000) -#define MAC_PCU_BSSID2_U16_AID_MSB 30 -#define MAC_PCU_BSSID2_U16_AID_LSB 20 -#define MAC_PCU_BSSID2_U16_AID_MASK 0x7ff00000 -#define MAC_PCU_BSSID2_U16_AID_GET(x) (((x) & 0x7ff00000) >> 20) -#define MAC_PCU_BSSID2_U16_AID_SET(x) (((x) << 20) & 0x7ff00000) - -/* macros for MAC_PCU_DIRECT_CONNECT */ -#define MAC_PCU_DIRECT_CONNECT_ADDRESS 0x000083a0 -#define MAC_PCU_DIRECT_CONNECT_OFFSET 0x000083a0 -#define MAC_PCU_DIRECT_CONNECT_TSF2_ENABLE_MSB 0 -#define MAC_PCU_DIRECT_CONNECT_TSF2_ENABLE_LSB 0 -#define MAC_PCU_DIRECT_CONNECT_TSF2_ENABLE_MASK 0x00000001 -#define MAC_PCU_DIRECT_CONNECT_TSF2_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_DIRECT_CONNECT_TSF2_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_DIRECT_CONNECT_TS_TSF_SEL_MSB 1 -#define MAC_PCU_DIRECT_CONNECT_TS_TSF_SEL_LSB 1 -#define MAC_PCU_DIRECT_CONNECT_TS_TSF_SEL_MASK 0x00000002 -#define MAC_PCU_DIRECT_CONNECT_TS_TSF_SEL_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_DIRECT_CONNECT_TS_TSF_SEL_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_DIRECT_CONNECT_TSF1_UPDATE_MSB 2 -#define MAC_PCU_DIRECT_CONNECT_TSF1_UPDATE_LSB 2 -#define MAC_PCU_DIRECT_CONNECT_TSF1_UPDATE_MASK 0x00000004 -#define MAC_PCU_DIRECT_CONNECT_TSF1_UPDATE_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_DIRECT_CONNECT_TSF1_UPDATE_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_DIRECT_CONNECT_TSF2_UPDATE_MSB 3 -#define MAC_PCU_DIRECT_CONNECT_TSF2_UPDATE_LSB 3 -#define MAC_PCU_DIRECT_CONNECT_TSF2_UPDATE_MASK 0x00000008 -#define MAC_PCU_DIRECT_CONNECT_TSF2_UPDATE_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_DIRECT_CONNECT_TSF2_UPDATE_SET(x) (((x) << 3) & 0x00000008) -#define MAC_PCU_DIRECT_CONNECT_MY_BEACON_OVERRIDE_MSB 4 -#define MAC_PCU_DIRECT_CONNECT_MY_BEACON_OVERRIDE_LSB 4 -#define MAC_PCU_DIRECT_CONNECT_MY_BEACON_OVERRIDE_MASK 0x00000010 -#define MAC_PCU_DIRECT_CONNECT_MY_BEACON_OVERRIDE_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_PCU_DIRECT_CONNECT_MY_BEACON_OVERRIDE_SET(x) (((x) << 4) & 0x00000010) -#define MAC_PCU_DIRECT_CONNECT_MY_BEACON2_OVERRIDE_MSB 5 -#define MAC_PCU_DIRECT_CONNECT_MY_BEACON2_OVERRIDE_LSB 5 -#define MAC_PCU_DIRECT_CONNECT_MY_BEACON2_OVERRIDE_MASK 0x00000020 -#define MAC_PCU_DIRECT_CONNECT_MY_BEACON2_OVERRIDE_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_PCU_DIRECT_CONNECT_MY_BEACON2_OVERRIDE_SET(x) (((x) << 5) & 0x00000020) -#define MAC_PCU_DIRECT_CONNECT_BMISS_CNT_TSF_SEL_MSB 6 -#define MAC_PCU_DIRECT_CONNECT_BMISS_CNT_TSF_SEL_LSB 6 -#define MAC_PCU_DIRECT_CONNECT_BMISS_CNT_TSF_SEL_MASK 0x00000040 -#define MAC_PCU_DIRECT_CONNECT_BMISS_CNT_TSF_SEL_GET(x) (((x) & 0x00000040) >> 6) -#define MAC_PCU_DIRECT_CONNECT_BMISS_CNT_TSF_SEL_SET(x) (((x) << 6) & 0x00000040) -#define MAC_PCU_DIRECT_CONNECT_BMISS_CNT_OVERRIDE_MSB 7 -#define MAC_PCU_DIRECT_CONNECT_BMISS_CNT_OVERRIDE_LSB 7 -#define MAC_PCU_DIRECT_CONNECT_BMISS_CNT_OVERRIDE_MASK 0x00000080 -#define MAC_PCU_DIRECT_CONNECT_BMISS_CNT_OVERRIDE_GET(x) (((x) & 0x00000080) >> 7) -#define MAC_PCU_DIRECT_CONNECT_BMISS_CNT_OVERRIDE_SET(x) (((x) << 7) & 0x00000080) -#define MAC_PCU_DIRECT_CONNECT_RESERVED_MSB 31 -#define MAC_PCU_DIRECT_CONNECT_RESERVED_LSB 8 -#define MAC_PCU_DIRECT_CONNECT_RESERVED_MASK 0xffffff00 -#define MAC_PCU_DIRECT_CONNECT_RESERVED_GET(x) (((x) & 0xffffff00) >> 8) -#define MAC_PCU_DIRECT_CONNECT_RESERVED_SET(x) (((x) << 8) & 0xffffff00) - -/* macros for MAC_PCU_TID_TO_AC */ -#define MAC_PCU_TID_TO_AC_ADDRESS 0x000083a4 -#define MAC_PCU_TID_TO_AC_OFFSET 0x000083a4 -#define MAC_PCU_TID_TO_AC_DATA_MSB 31 -#define MAC_PCU_TID_TO_AC_DATA_LSB 0 -#define MAC_PCU_TID_TO_AC_DATA_MASK 0xffffffff -#define MAC_PCU_TID_TO_AC_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_TID_TO_AC_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_HP_QUEUE */ -#define MAC_PCU_HP_QUEUE_ADDRESS 0x000083a8 -#define MAC_PCU_HP_QUEUE_OFFSET 0x000083a8 -#define MAC_PCU_HP_QUEUE_ENABLE_MSB 0 -#define MAC_PCU_HP_QUEUE_ENABLE_LSB 0 -#define MAC_PCU_HP_QUEUE_ENABLE_MASK 0x00000001 -#define MAC_PCU_HP_QUEUE_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_HP_QUEUE_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_HP_QUEUE_AC_MASK_BE_MSB 1 -#define MAC_PCU_HP_QUEUE_AC_MASK_BE_LSB 1 -#define MAC_PCU_HP_QUEUE_AC_MASK_BE_MASK 0x00000002 -#define MAC_PCU_HP_QUEUE_AC_MASK_BE_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_HP_QUEUE_AC_MASK_BE_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_HP_QUEUE_AC_MASK_BK_MSB 2 -#define MAC_PCU_HP_QUEUE_AC_MASK_BK_LSB 2 -#define MAC_PCU_HP_QUEUE_AC_MASK_BK_MASK 0x00000004 -#define MAC_PCU_HP_QUEUE_AC_MASK_BK_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_HP_QUEUE_AC_MASK_BK_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_HP_QUEUE_AC_MASK_VI_MSB 3 -#define MAC_PCU_HP_QUEUE_AC_MASK_VI_LSB 3 -#define MAC_PCU_HP_QUEUE_AC_MASK_VI_MASK 0x00000008 -#define MAC_PCU_HP_QUEUE_AC_MASK_VI_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_HP_QUEUE_AC_MASK_VI_SET(x) (((x) << 3) & 0x00000008) -#define MAC_PCU_HP_QUEUE_AC_MASK_VO_MSB 4 -#define MAC_PCU_HP_QUEUE_AC_MASK_VO_LSB 4 -#define MAC_PCU_HP_QUEUE_AC_MASK_VO_MASK 0x00000010 -#define MAC_PCU_HP_QUEUE_AC_MASK_VO_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_PCU_HP_QUEUE_AC_MASK_VO_SET(x) (((x) << 4) & 0x00000010) -#define MAC_PCU_HP_QUEUE_HPQON_UAPSD_MSB 5 -#define MAC_PCU_HP_QUEUE_HPQON_UAPSD_LSB 5 -#define MAC_PCU_HP_QUEUE_HPQON_UAPSD_MASK 0x00000020 -#define MAC_PCU_HP_QUEUE_HPQON_UAPSD_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_PCU_HP_QUEUE_HPQON_UAPSD_SET(x) (((x) << 5) & 0x00000020) -#define MAC_PCU_HP_QUEUE_FRAME_FILTER_ENABLE0_MSB 6 -#define MAC_PCU_HP_QUEUE_FRAME_FILTER_ENABLE0_LSB 6 -#define MAC_PCU_HP_QUEUE_FRAME_FILTER_ENABLE0_MASK 0x00000040 -#define MAC_PCU_HP_QUEUE_FRAME_FILTER_ENABLE0_GET(x) (((x) & 0x00000040) >> 6) -#define MAC_PCU_HP_QUEUE_FRAME_FILTER_ENABLE0_SET(x) (((x) << 6) & 0x00000040) -#define MAC_PCU_HP_QUEUE_FRAME_BSSID_MATCH0_MSB 7 -#define MAC_PCU_HP_QUEUE_FRAME_BSSID_MATCH0_LSB 7 -#define MAC_PCU_HP_QUEUE_FRAME_BSSID_MATCH0_MASK 0x00000080 -#define MAC_PCU_HP_QUEUE_FRAME_BSSID_MATCH0_GET(x) (((x) & 0x00000080) >> 7) -#define MAC_PCU_HP_QUEUE_FRAME_BSSID_MATCH0_SET(x) (((x) << 7) & 0x00000080) -#define MAC_PCU_HP_QUEUE_FRAME_TYPE0_MSB 9 -#define MAC_PCU_HP_QUEUE_FRAME_TYPE0_LSB 8 -#define MAC_PCU_HP_QUEUE_FRAME_TYPE0_MASK 0x00000300 -#define MAC_PCU_HP_QUEUE_FRAME_TYPE0_GET(x) (((x) & 0x00000300) >> 8) -#define MAC_PCU_HP_QUEUE_FRAME_TYPE0_SET(x) (((x) << 8) & 0x00000300) -#define MAC_PCU_HP_QUEUE_FRAME_TYPE_MASK0_MSB 11 -#define MAC_PCU_HP_QUEUE_FRAME_TYPE_MASK0_LSB 10 -#define MAC_PCU_HP_QUEUE_FRAME_TYPE_MASK0_MASK 0x00000c00 -#define MAC_PCU_HP_QUEUE_FRAME_TYPE_MASK0_GET(x) (((x) & 0x00000c00) >> 10) -#define MAC_PCU_HP_QUEUE_FRAME_TYPE_MASK0_SET(x) (((x) << 10) & 0x00000c00) -#define MAC_PCU_HP_QUEUE_FRAME_SUBTYPE0_MSB 15 -#define MAC_PCU_HP_QUEUE_FRAME_SUBTYPE0_LSB 12 -#define MAC_PCU_HP_QUEUE_FRAME_SUBTYPE0_MASK 0x0000f000 -#define MAC_PCU_HP_QUEUE_FRAME_SUBTYPE0_GET(x) (((x) & 0x0000f000) >> 12) -#define MAC_PCU_HP_QUEUE_FRAME_SUBTYPE0_SET(x) (((x) << 12) & 0x0000f000) -#define MAC_PCU_HP_QUEUE_FRAME_SUBTYPE_MASK0_MSB 19 -#define MAC_PCU_HP_QUEUE_FRAME_SUBTYPE_MASK0_LSB 16 -#define MAC_PCU_HP_QUEUE_FRAME_SUBTYPE_MASK0_MASK 0x000f0000 -#define MAC_PCU_HP_QUEUE_FRAME_SUBTYPE_MASK0_GET(x) (((x) & 0x000f0000) >> 16) -#define MAC_PCU_HP_QUEUE_FRAME_SUBTYPE_MASK0_SET(x) (((x) << 16) & 0x000f0000) -#define MAC_PCU_HP_QUEUE_UAPSD_EN_MSB 20 -#define MAC_PCU_HP_QUEUE_UAPSD_EN_LSB 20 -#define MAC_PCU_HP_QUEUE_UAPSD_EN_MASK 0x00100000 -#define MAC_PCU_HP_QUEUE_UAPSD_EN_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_PCU_HP_QUEUE_UAPSD_EN_SET(x) (((x) << 20) & 0x00100000) -#define MAC_PCU_HP_QUEUE_PM_CHANGE_MSB 21 -#define MAC_PCU_HP_QUEUE_PM_CHANGE_LSB 21 -#define MAC_PCU_HP_QUEUE_PM_CHANGE_MASK 0x00200000 -#define MAC_PCU_HP_QUEUE_PM_CHANGE_GET(x) (((x) & 0x00200000) >> 21) -#define MAC_PCU_HP_QUEUE_PM_CHANGE_SET(x) (((x) << 21) & 0x00200000) -#define MAC_PCU_HP_QUEUE_NON_UAPSD_EN_MSB 22 -#define MAC_PCU_HP_QUEUE_NON_UAPSD_EN_LSB 22 -#define MAC_PCU_HP_QUEUE_NON_UAPSD_EN_MASK 0x00400000 -#define MAC_PCU_HP_QUEUE_NON_UAPSD_EN_GET(x) (((x) & 0x00400000) >> 22) -#define MAC_PCU_HP_QUEUE_NON_UAPSD_EN_SET(x) (((x) << 22) & 0x00400000) -#define MAC_PCU_HP_QUEUE_UAPSD_AC_MUST_MATCH_MSB 23 -#define MAC_PCU_HP_QUEUE_UAPSD_AC_MUST_MATCH_LSB 23 -#define MAC_PCU_HP_QUEUE_UAPSD_AC_MUST_MATCH_MASK 0x00800000 -#define MAC_PCU_HP_QUEUE_UAPSD_AC_MUST_MATCH_GET(x) (((x) & 0x00800000) >> 23) -#define MAC_PCU_HP_QUEUE_UAPSD_AC_MUST_MATCH_SET(x) (((x) << 23) & 0x00800000) -#define MAC_PCU_HP_QUEUE_UAPSD_ONLY_QOS_MSB 24 -#define MAC_PCU_HP_QUEUE_UAPSD_ONLY_QOS_LSB 24 -#define MAC_PCU_HP_QUEUE_UAPSD_ONLY_QOS_MASK 0x01000000 -#define MAC_PCU_HP_QUEUE_UAPSD_ONLY_QOS_GET(x) (((x) & 0x01000000) >> 24) -#define MAC_PCU_HP_QUEUE_UAPSD_ONLY_QOS_SET(x) (((x) << 24) & 0x01000000) - -/* macros for MAC_PCU_AGC_SATURATION_CNT0 */ -#define MAC_PCU_AGC_SATURATION_CNT0_ADDRESS 0x000083bc -#define MAC_PCU_AGC_SATURATION_CNT0_OFFSET 0x000083bc -#define MAC_PCU_AGC_SATURATION_CNT0_VALUE_MSB 31 -#define MAC_PCU_AGC_SATURATION_CNT0_VALUE_LSB 0 -#define MAC_PCU_AGC_SATURATION_CNT0_VALUE_MASK 0xffffffff -#define MAC_PCU_AGC_SATURATION_CNT0_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_AGC_SATURATION_CNT0_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_AGC_SATURATION_CNT1 */ -#define MAC_PCU_AGC_SATURATION_CNT1_ADDRESS 0x000083c0 -#define MAC_PCU_AGC_SATURATION_CNT1_OFFSET 0x000083c0 -#define MAC_PCU_AGC_SATURATION_CNT1_VALUE_MSB 31 -#define MAC_PCU_AGC_SATURATION_CNT1_VALUE_LSB 0 -#define MAC_PCU_AGC_SATURATION_CNT1_VALUE_MASK 0xffffffff -#define MAC_PCU_AGC_SATURATION_CNT1_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_AGC_SATURATION_CNT1_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_AGC_SATURATION_CNT2 */ -#define MAC_PCU_AGC_SATURATION_CNT2_ADDRESS 0x000083c4 -#define MAC_PCU_AGC_SATURATION_CNT2_OFFSET 0x000083c4 -#define MAC_PCU_AGC_SATURATION_CNT2_VALUE_MSB 31 -#define MAC_PCU_AGC_SATURATION_CNT2_VALUE_LSB 0 -#define MAC_PCU_AGC_SATURATION_CNT2_VALUE_MASK 0xffffffff -#define MAC_PCU_AGC_SATURATION_CNT2_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_AGC_SATURATION_CNT2_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_HW_BCN_PROC1 */ -#define MAC_PCU_HW_BCN_PROC1_ADDRESS 0x000083c8 -#define MAC_PCU_HW_BCN_PROC1_OFFSET 0x000083c8 -#define MAC_PCU_HW_BCN_PROC1_CRC_ENABLE_MSB 0 -#define MAC_PCU_HW_BCN_PROC1_CRC_ENABLE_LSB 0 -#define MAC_PCU_HW_BCN_PROC1_CRC_ENABLE_MASK 0x00000001 -#define MAC_PCU_HW_BCN_PROC1_CRC_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_HW_BCN_PROC1_CRC_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_HW_BCN_PROC1_RESET_CRC_MSB 1 -#define MAC_PCU_HW_BCN_PROC1_RESET_CRC_LSB 1 -#define MAC_PCU_HW_BCN_PROC1_RESET_CRC_MASK 0x00000002 -#define MAC_PCU_HW_BCN_PROC1_RESET_CRC_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_HW_BCN_PROC1_RESET_CRC_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_BCN_INTVL_MSB 2 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_BCN_INTVL_LSB 2 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_BCN_INTVL_MASK 0x00000004 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_BCN_INTVL_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_BCN_INTVL_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_CAP_INFO_MSB 3 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_CAP_INFO_LSB 3 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_CAP_INFO_MASK 0x00000008 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_CAP_INFO_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_CAP_INFO_SET(x) (((x) << 3) & 0x00000008) -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_TIM_ELM_MSB 4 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_TIM_ELM_LSB 4 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_TIM_ELM_MASK 0x00000010 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_TIM_ELM_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_TIM_ELM_SET(x) (((x) << 4) & 0x00000010) -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_ELM0_MSB 5 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_ELM0_LSB 5 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_ELM0_MASK 0x00000020 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_ELM0_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_ELM0_SET(x) (((x) << 5) & 0x00000020) -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_ELM1_MSB 6 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_ELM1_LSB 6 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_ELM1_MASK 0x00000040 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_ELM1_GET(x) (((x) & 0x00000040) >> 6) -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_ELM1_SET(x) (((x) << 6) & 0x00000040) -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_ELM2_MSB 7 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_ELM2_LSB 7 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_ELM2_MASK 0x00000080 -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_ELM2_GET(x) (((x) & 0x00000080) >> 7) -#define MAC_PCU_HW_BCN_PROC1_EXCLUDE_ELM2_SET(x) (((x) << 7) & 0x00000080) -#define MAC_PCU_HW_BCN_PROC1_ELM0_ID_MSB 15 -#define MAC_PCU_HW_BCN_PROC1_ELM0_ID_LSB 8 -#define MAC_PCU_HW_BCN_PROC1_ELM0_ID_MASK 0x0000ff00 -#define MAC_PCU_HW_BCN_PROC1_ELM0_ID_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_HW_BCN_PROC1_ELM0_ID_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_HW_BCN_PROC1_ELM1_ID_MSB 23 -#define MAC_PCU_HW_BCN_PROC1_ELM1_ID_LSB 16 -#define MAC_PCU_HW_BCN_PROC1_ELM1_ID_MASK 0x00ff0000 -#define MAC_PCU_HW_BCN_PROC1_ELM1_ID_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_HW_BCN_PROC1_ELM1_ID_SET(x) (((x) << 16) & 0x00ff0000) -#define MAC_PCU_HW_BCN_PROC1_ELM2_ID_MSB 31 -#define MAC_PCU_HW_BCN_PROC1_ELM2_ID_LSB 24 -#define MAC_PCU_HW_BCN_PROC1_ELM2_ID_MASK 0xff000000 -#define MAC_PCU_HW_BCN_PROC1_ELM2_ID_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_PCU_HW_BCN_PROC1_ELM2_ID_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_PCU_HW_BCN_PROC2 */ -#define MAC_PCU_HW_BCN_PROC2_ADDRESS 0x000083cc -#define MAC_PCU_HW_BCN_PROC2_OFFSET 0x000083cc -#define MAC_PCU_HW_BCN_PROC2_FILTER_INTERVAL_ENABLE_MSB 0 -#define MAC_PCU_HW_BCN_PROC2_FILTER_INTERVAL_ENABLE_LSB 0 -#define MAC_PCU_HW_BCN_PROC2_FILTER_INTERVAL_ENABLE_MASK 0x00000001 -#define MAC_PCU_HW_BCN_PROC2_FILTER_INTERVAL_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_HW_BCN_PROC2_FILTER_INTERVAL_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_HW_BCN_PROC2_RESET_INTERVAL_MSB 1 -#define MAC_PCU_HW_BCN_PROC2_RESET_INTERVAL_LSB 1 -#define MAC_PCU_HW_BCN_PROC2_RESET_INTERVAL_MASK 0x00000002 -#define MAC_PCU_HW_BCN_PROC2_RESET_INTERVAL_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_HW_BCN_PROC2_RESET_INTERVAL_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_HW_BCN_PROC2_EXCLUDE_ELM3_MSB 2 -#define MAC_PCU_HW_BCN_PROC2_EXCLUDE_ELM3_LSB 2 -#define MAC_PCU_HW_BCN_PROC2_EXCLUDE_ELM3_MASK 0x00000004 -#define MAC_PCU_HW_BCN_PROC2_EXCLUDE_ELM3_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_HW_BCN_PROC2_EXCLUDE_ELM3_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_HW_BCN_PROC2_FILTER_INTERVAL_MSB 15 -#define MAC_PCU_HW_BCN_PROC2_FILTER_INTERVAL_LSB 8 -#define MAC_PCU_HW_BCN_PROC2_FILTER_INTERVAL_MASK 0x0000ff00 -#define MAC_PCU_HW_BCN_PROC2_FILTER_INTERVAL_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_HW_BCN_PROC2_FILTER_INTERVAL_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_HW_BCN_PROC2_ELM3_ID_MSB 23 -#define MAC_PCU_HW_BCN_PROC2_ELM3_ID_LSB 16 -#define MAC_PCU_HW_BCN_PROC2_ELM3_ID_MASK 0x00ff0000 -#define MAC_PCU_HW_BCN_PROC2_ELM3_ID_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_HW_BCN_PROC2_ELM3_ID_SET(x) (((x) << 16) & 0x00ff0000) - -/* macros for MAC_PCU_MISC_MODE3 */ -#define MAC_PCU_MISC_MODE3_ADDRESS 0x000083d0 -#define MAC_PCU_MISC_MODE3_OFFSET 0x000083d0 -#define MAC_PCU_MISC_MODE3_BUG_55702_FIX_ENABLE_MSB 0 -#define MAC_PCU_MISC_MODE3_BUG_55702_FIX_ENABLE_LSB 0 -#define MAC_PCU_MISC_MODE3_BUG_55702_FIX_ENABLE_MASK 0x00000001 -#define MAC_PCU_MISC_MODE3_BUG_55702_FIX_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_MISC_MODE3_BUG_55702_FIX_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_MISC_MODE3_AES_3STREAM_MSB 1 -#define MAC_PCU_MISC_MODE3_AES_3STREAM_LSB 1 -#define MAC_PCU_MISC_MODE3_AES_3STREAM_MASK 0x00000002 -#define MAC_PCU_MISC_MODE3_AES_3STREAM_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_MISC_MODE3_AES_3STREAM_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_MISC_MODE3_REGULAR_SOUNDING_MSB 2 -#define MAC_PCU_MISC_MODE3_REGULAR_SOUNDING_LSB 2 -#define MAC_PCU_MISC_MODE3_REGULAR_SOUNDING_MASK 0x00000004 -#define MAC_PCU_MISC_MODE3_REGULAR_SOUNDING_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_MISC_MODE3_REGULAR_SOUNDING_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_MISC_MODE3_BUG_58011_FIX_ENABLE_MSB 3 -#define MAC_PCU_MISC_MODE3_BUG_58011_FIX_ENABLE_LSB 3 -#define MAC_PCU_MISC_MODE3_BUG_58011_FIX_ENABLE_MASK 0x00000008 -#define MAC_PCU_MISC_MODE3_BUG_58011_FIX_ENABLE_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_MISC_MODE3_BUG_58011_FIX_ENABLE_SET(x) (((x) << 3) & 0x00000008) -#define MAC_PCU_MISC_MODE3_BUG_56991_FIX_ENABLE_MSB 4 -#define MAC_PCU_MISC_MODE3_BUG_56991_FIX_ENABLE_LSB 4 -#define MAC_PCU_MISC_MODE3_BUG_56991_FIX_ENABLE_MASK 0x00000010 -#define MAC_PCU_MISC_MODE3_BUG_56991_FIX_ENABLE_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_PCU_MISC_MODE3_BUG_56991_FIX_ENABLE_SET(x) (((x) << 4) & 0x00000010) -#define MAC_PCU_MISC_MODE3_WOW_ADDR1_MASK_ENABLE_MSB 5 -#define MAC_PCU_MISC_MODE3_WOW_ADDR1_MASK_ENABLE_LSB 5 -#define MAC_PCU_MISC_MODE3_WOW_ADDR1_MASK_ENABLE_MASK 0x00000020 -#define MAC_PCU_MISC_MODE3_WOW_ADDR1_MASK_ENABLE_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_PCU_MISC_MODE3_WOW_ADDR1_MASK_ENABLE_SET(x) (((x) << 5) & 0x00000020) -#define MAC_PCU_MISC_MODE3_BUG_61936_FIX_ENABLE_MSB 6 -#define MAC_PCU_MISC_MODE3_BUG_61936_FIX_ENABLE_LSB 6 -#define MAC_PCU_MISC_MODE3_BUG_61936_FIX_ENABLE_MASK 0x00000040 -#define MAC_PCU_MISC_MODE3_BUG_61936_FIX_ENABLE_GET(x) (((x) & 0x00000040) >> 6) -#define MAC_PCU_MISC_MODE3_BUG_61936_FIX_ENABLE_SET(x) (((x) << 6) & 0x00000040) -#define MAC_PCU_MISC_MODE3_CHECK_LENGTH_FOR_BA_MSB 7 -#define MAC_PCU_MISC_MODE3_CHECK_LENGTH_FOR_BA_LSB 7 -#define MAC_PCU_MISC_MODE3_CHECK_LENGTH_FOR_BA_MASK 0x00000080 -#define MAC_PCU_MISC_MODE3_CHECK_LENGTH_FOR_BA_GET(x) (((x) & 0x00000080) >> 7) -#define MAC_PCU_MISC_MODE3_CHECK_LENGTH_FOR_BA_SET(x) (((x) << 7) & 0x00000080) -#define MAC_PCU_MISC_MODE3_BA_FRAME_LENGTH_MSB 15 -#define MAC_PCU_MISC_MODE3_BA_FRAME_LENGTH_LSB 8 -#define MAC_PCU_MISC_MODE3_BA_FRAME_LENGTH_MASK 0x0000ff00 -#define MAC_PCU_MISC_MODE3_BA_FRAME_LENGTH_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_MISC_MODE3_BA_FRAME_LENGTH_SET(x) (((x) << 8) & 0x0000ff00) -#define MAC_PCU_MISC_MODE3_MATCH_TID_FOR_BA_MSB 16 -#define MAC_PCU_MISC_MODE3_MATCH_TID_FOR_BA_LSB 16 -#define MAC_PCU_MISC_MODE3_MATCH_TID_FOR_BA_MASK 0x00010000 -#define MAC_PCU_MISC_MODE3_MATCH_TID_FOR_BA_GET(x) (((x) & 0x00010000) >> 16) -#define MAC_PCU_MISC_MODE3_MATCH_TID_FOR_BA_SET(x) (((x) << 16) & 0x00010000) -#define MAC_PCU_MISC_MODE3_WAPI_ORDER_MASK_MSB 17 -#define MAC_PCU_MISC_MODE3_WAPI_ORDER_MASK_LSB 17 -#define MAC_PCU_MISC_MODE3_WAPI_ORDER_MASK_MASK 0x00020000 -#define MAC_PCU_MISC_MODE3_WAPI_ORDER_MASK_GET(x) (((x) & 0x00020000) >> 17) -#define MAC_PCU_MISC_MODE3_WAPI_ORDER_MASK_SET(x) (((x) << 17) & 0x00020000) -#define MAC_PCU_MISC_MODE3_BB_LDPC_EN_MSB 18 -#define MAC_PCU_MISC_MODE3_BB_LDPC_EN_LSB 18 -#define MAC_PCU_MISC_MODE3_BB_LDPC_EN_MASK 0x00040000 -#define MAC_PCU_MISC_MODE3_BB_LDPC_EN_GET(x) (((x) & 0x00040000) >> 18) -#define MAC_PCU_MISC_MODE3_BB_LDPC_EN_SET(x) (((x) << 18) & 0x00040000) -#define MAC_PCU_MISC_MODE3_SELF_GEN_SMOOTHING_MSB 19 -#define MAC_PCU_MISC_MODE3_SELF_GEN_SMOOTHING_LSB 19 -#define MAC_PCU_MISC_MODE3_SELF_GEN_SMOOTHING_MASK 0x00080000 -#define MAC_PCU_MISC_MODE3_SELF_GEN_SMOOTHING_GET(x) (((x) & 0x00080000) >> 19) -#define MAC_PCU_MISC_MODE3_SELF_GEN_SMOOTHING_SET(x) (((x) << 19) & 0x00080000) -#define MAC_PCU_MISC_MODE3_SMOOTHING_FORCE_MSB 20 -#define MAC_PCU_MISC_MODE3_SMOOTHING_FORCE_LSB 20 -#define MAC_PCU_MISC_MODE3_SMOOTHING_FORCE_MASK 0x00100000 -#define MAC_PCU_MISC_MODE3_SMOOTHING_FORCE_GET(x) (((x) & 0x00100000) >> 20) -#define MAC_PCU_MISC_MODE3_SMOOTHING_FORCE_SET(x) (((x) << 20) & 0x00100000) -#define MAC_PCU_MISC_MODE3_ALLOW_RAC_MSB 21 -#define MAC_PCU_MISC_MODE3_ALLOW_RAC_LSB 21 -#define MAC_PCU_MISC_MODE3_ALLOW_RAC_MASK 0x00200000 -#define MAC_PCU_MISC_MODE3_ALLOW_RAC_GET(x) (((x) & 0x00200000) >> 21) -#define MAC_PCU_MISC_MODE3_ALLOW_RAC_SET(x) (((x) << 21) & 0x00200000) -#define MAC_PCU_MISC_MODE3_IGNORE_TXOP_IF_ZER0_MSB 22 -#define MAC_PCU_MISC_MODE3_IGNORE_TXOP_IF_ZER0_LSB 22 -#define MAC_PCU_MISC_MODE3_IGNORE_TXOP_IF_ZER0_MASK 0x00400000 -#define MAC_PCU_MISC_MODE3_IGNORE_TXOP_IF_ZER0_GET(x) (((x) & 0x00400000) >> 22) -#define MAC_PCU_MISC_MODE3_IGNORE_TXOP_IF_ZER0_SET(x) (((x) << 22) & 0x00400000) -#define MAC_PCU_MISC_MODE3_BEACON_FROM_TO_DS_CHECK_MSB 23 -#define MAC_PCU_MISC_MODE3_BEACON_FROM_TO_DS_CHECK_LSB 23 -#define MAC_PCU_MISC_MODE3_BEACON_FROM_TO_DS_CHECK_MASK 0x00800000 -#define MAC_PCU_MISC_MODE3_BEACON_FROM_TO_DS_CHECK_GET(x) (((x) & 0x00800000) >> 23) -#define MAC_PCU_MISC_MODE3_BEACON_FROM_TO_DS_CHECK_SET(x) (((x) << 23) & 0x00800000) -#define MAC_PCU_MISC_MODE3_PM_FIELD_FOR_DAT_MSB 24 -#define MAC_PCU_MISC_MODE3_PM_FIELD_FOR_DAT_LSB 24 -#define MAC_PCU_MISC_MODE3_PM_FIELD_FOR_DAT_MASK 0x01000000 -#define MAC_PCU_MISC_MODE3_PM_FIELD_FOR_DAT_GET(x) (((x) & 0x01000000) >> 24) -#define MAC_PCU_MISC_MODE3_PM_FIELD_FOR_DAT_SET(x) (((x) << 24) & 0x01000000) -#define MAC_PCU_MISC_MODE3_PM_FIELD_FOR_MGMT_MSB 25 -#define MAC_PCU_MISC_MODE3_PM_FIELD_FOR_MGMT_LSB 25 -#define MAC_PCU_MISC_MODE3_PM_FIELD_FOR_MGMT_MASK 0x02000000 -#define MAC_PCU_MISC_MODE3_PM_FIELD_FOR_MGMT_GET(x) (((x) & 0x02000000) >> 25) -#define MAC_PCU_MISC_MODE3_PM_FIELD_FOR_MGMT_SET(x) (((x) << 25) & 0x02000000) -#define MAC_PCU_MISC_MODE3_PM_FIELD2_FOR_CTL_MSB 26 -#define MAC_PCU_MISC_MODE3_PM_FIELD2_FOR_CTL_LSB 26 -#define MAC_PCU_MISC_MODE3_PM_FIELD2_FOR_CTL_MASK 0x04000000 -#define MAC_PCU_MISC_MODE3_PM_FIELD2_FOR_CTL_GET(x) (((x) & 0x04000000) >> 26) -#define MAC_PCU_MISC_MODE3_PM_FIELD2_FOR_CTL_SET(x) (((x) << 26) & 0x04000000) -#define MAC_PCU_MISC_MODE3_PM_FIELD2_FOR_DAT_MSB 27 -#define MAC_PCU_MISC_MODE3_PM_FIELD2_FOR_DAT_LSB 27 -#define MAC_PCU_MISC_MODE3_PM_FIELD2_FOR_DAT_MASK 0x08000000 -#define MAC_PCU_MISC_MODE3_PM_FIELD2_FOR_DAT_GET(x) (((x) & 0x08000000) >> 27) -#define MAC_PCU_MISC_MODE3_PM_FIELD2_FOR_DAT_SET(x) (((x) << 27) & 0x08000000) -#define MAC_PCU_MISC_MODE3_PM_FIELD2_FOR_MGT_MSB 28 -#define MAC_PCU_MISC_MODE3_PM_FIELD2_FOR_MGT_LSB 28 -#define MAC_PCU_MISC_MODE3_PM_FIELD2_FOR_MGT_MASK 0x10000000 -#define MAC_PCU_MISC_MODE3_PM_FIELD2_FOR_MGT_GET(x) (((x) & 0x10000000) >> 28) -#define MAC_PCU_MISC_MODE3_PM_FIELD2_FOR_MGT_SET(x) (((x) << 28) & 0x10000000) -#define MAC_PCU_MISC_MODE3_KEY_MISS_FIX_MSB 29 -#define MAC_PCU_MISC_MODE3_KEY_MISS_FIX_LSB 29 -#define MAC_PCU_MISC_MODE3_KEY_MISS_FIX_MASK 0x20000000 -#define MAC_PCU_MISC_MODE3_KEY_MISS_FIX_GET(x) (((x) & 0x20000000) >> 29) -#define MAC_PCU_MISC_MODE3_KEY_MISS_FIX_SET(x) (((x) << 29) & 0x20000000) -#define MAC_PCU_MISC_MODE3_PER_STA_WEP_ENTRY_ENABLE_MSB 30 -#define MAC_PCU_MISC_MODE3_PER_STA_WEP_ENTRY_ENABLE_LSB 30 -#define MAC_PCU_MISC_MODE3_PER_STA_WEP_ENTRY_ENABLE_MASK 0x40000000 -#define MAC_PCU_MISC_MODE3_PER_STA_WEP_ENTRY_ENABLE_GET(x) (((x) & 0x40000000) >> 30) -#define MAC_PCU_MISC_MODE3_PER_STA_WEP_ENTRY_ENABLE_SET(x) (((x) << 30) & 0x40000000) -#define MAC_PCU_MISC_MODE3_TIME_BASED_DISCARD_EN_MSB 31 -#define MAC_PCU_MISC_MODE3_TIME_BASED_DISCARD_EN_LSB 31 -#define MAC_PCU_MISC_MODE3_TIME_BASED_DISCARD_EN_MASK 0x80000000 -#define MAC_PCU_MISC_MODE3_TIME_BASED_DISCARD_EN_GET(x) (((x) & 0x80000000) >> 31) -#define MAC_PCU_MISC_MODE3_TIME_BASED_DISCARD_EN_SET(x) (((x) << 31) & 0x80000000) - -/* macros for MAC_PCU_MISC_MODE4 */ -#define MAC_PCU_MISC_MODE4_ADDRESS 0x000083d4 -#define MAC_PCU_MISC_MODE4_OFFSET 0x000083d4 -#define MAC_PCU_MISC_MODE4_BC_MC_WAPI_MODE2_EN_MSB 0 -#define MAC_PCU_MISC_MODE4_BC_MC_WAPI_MODE2_EN_LSB 0 -#define MAC_PCU_MISC_MODE4_BC_MC_WAPI_MODE2_EN_MASK 0x00000001 -#define MAC_PCU_MISC_MODE4_BC_MC_WAPI_MODE2_EN_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_MISC_MODE4_BC_MC_WAPI_MODE2_EN_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_MISC_MODE4_BC_MC_WAPI_MODE2_MSB 1 -#define MAC_PCU_MISC_MODE4_BC_MC_WAPI_MODE2_LSB 1 -#define MAC_PCU_MISC_MODE4_BC_MC_WAPI_MODE2_MASK 0x00000002 -#define MAC_PCU_MISC_MODE4_BC_MC_WAPI_MODE2_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_MISC_MODE4_BC_MC_WAPI_MODE2_SET(x) (((x) << 1) & 0x00000002) -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_BEACON_MSB 2 -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_BEACON_LSB 2 -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_BEACON_MASK 0x00000004 -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_BEACON_GET(x) (((x) & 0x00000004) >> 2) -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_BEACON_SET(x) (((x) << 2) & 0x00000004) -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_BCAST_PROBE_RESP_MSB 3 -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_BCAST_PROBE_RESP_LSB 3 -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_BCAST_PROBE_RESP_MASK 0x00000008 -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_BCAST_PROBE_RESP_GET(x) (((x) & 0x00000008) >> 3) -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_BCAST_PROBE_RESP_SET(x) (((x) << 3) & 0x00000008) -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_MCAST_PROBE_RESP_MSB 4 -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_MCAST_PROBE_RESP_LSB 4 -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_MCAST_PROBE_RESP_MASK 0x00000010 -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_MCAST_PROBE_RESP_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_MCAST_PROBE_RESP_SET(x) (((x) << 4) & 0x00000010) -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_UCAST_MOON_PROBE_RESP_MSB 5 -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_UCAST_MOON_PROBE_RESP_LSB 5 -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_UCAST_MOON_PROBE_RESP_MASK 0x00000020 -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_UCAST_MOON_PROBE_RESP_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_UCAST_MOON_PROBE_RESP_SET(x) (((x) << 5) & 0x00000020) -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_UCAST_PROBE_RESP_MSB 6 -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_UCAST_PROBE_RESP_LSB 6 -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_UCAST_PROBE_RESP_MASK 0x00000040 -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_UCAST_PROBE_RESP_GET(x) (((x) & 0x00000040) >> 6) -#define MAC_PCU_MISC_MODE4_SYNC_TSF_ON_UCAST_PROBE_RESP_SET(x) (((x) << 6) & 0x00000040) - -/* macros for MAC_PCU_PS_FILTER */ -#define MAC_PCU_PS_FILTER_ADDRESS 0x000083dc -#define MAC_PCU_PS_FILTER_OFFSET 0x000083dc -#define MAC_PCU_PS_FILTER_ENABLE_MSB 0 -#define MAC_PCU_PS_FILTER_ENABLE_LSB 0 -#define MAC_PCU_PS_FILTER_ENABLE_MASK 0x00000001 -#define MAC_PCU_PS_FILTER_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_PS_FILTER_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_PS_FILTER_PS_SAVE_ENABLE_MSB 1 -#define MAC_PCU_PS_FILTER_PS_SAVE_ENABLE_LSB 1 -#define MAC_PCU_PS_FILTER_PS_SAVE_ENABLE_MASK 0x00000002 -#define MAC_PCU_PS_FILTER_PS_SAVE_ENABLE_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_PS_FILTER_PS_SAVE_ENABLE_SET(x) (((x) << 1) & 0x00000002) - -/* macros for MAC_PCU_BASIC_RATE_SET0 */ -#define MAC_PCU_BASIC_RATE_SET0_ADDRESS 0x000083e0 -#define MAC_PCU_BASIC_RATE_SET0_OFFSET 0x000083e0 -#define MAC_PCU_BASIC_RATE_SET0_VALUE_MSB 29 -#define MAC_PCU_BASIC_RATE_SET0_VALUE_LSB 0 -#define MAC_PCU_BASIC_RATE_SET0_VALUE_MASK 0x3fffffff -#define MAC_PCU_BASIC_RATE_SET0_VALUE_GET(x) (((x) & 0x3fffffff) >> 0) -#define MAC_PCU_BASIC_RATE_SET0_VALUE_SET(x) (((x) << 0) & 0x3fffffff) - -/* macros for MAC_PCU_BASIC_RATE_SET1 */ -#define MAC_PCU_BASIC_RATE_SET1_ADDRESS 0x000083e4 -#define MAC_PCU_BASIC_RATE_SET1_OFFSET 0x000083e4 -#define MAC_PCU_BASIC_RATE_SET1_VALUE_MSB 29 -#define MAC_PCU_BASIC_RATE_SET1_VALUE_LSB 0 -#define MAC_PCU_BASIC_RATE_SET1_VALUE_MASK 0x3fffffff -#define MAC_PCU_BASIC_RATE_SET1_VALUE_GET(x) (((x) & 0x3fffffff) >> 0) -#define MAC_PCU_BASIC_RATE_SET1_VALUE_SET(x) (((x) << 0) & 0x3fffffff) - -/* macros for MAC_PCU_BASIC_RATE_SET2 */ -#define MAC_PCU_BASIC_RATE_SET2_ADDRESS 0x000083e8 -#define MAC_PCU_BASIC_RATE_SET2_OFFSET 0x000083e8 -#define MAC_PCU_BASIC_RATE_SET2_VALUE_MSB 29 -#define MAC_PCU_BASIC_RATE_SET2_VALUE_LSB 0 -#define MAC_PCU_BASIC_RATE_SET2_VALUE_MASK 0x3fffffff -#define MAC_PCU_BASIC_RATE_SET2_VALUE_GET(x) (((x) & 0x3fffffff) >> 0) -#define MAC_PCU_BASIC_RATE_SET2_VALUE_SET(x) (((x) << 0) & 0x3fffffff) - -/* macros for MAC_PCU_BASIC_RATE_SET3 */ -#define MAC_PCU_BASIC_RATE_SET3_ADDRESS 0x000083ec -#define MAC_PCU_BASIC_RATE_SET3_OFFSET 0x000083ec -#define MAC_PCU_BASIC_RATE_SET3_VALUE_MSB 24 -#define MAC_PCU_BASIC_RATE_SET3_VALUE_LSB 0 -#define MAC_PCU_BASIC_RATE_SET3_VALUE_MASK 0x01ffffff -#define MAC_PCU_BASIC_RATE_SET3_VALUE_GET(x) (((x) & 0x01ffffff) >> 0) -#define MAC_PCU_BASIC_RATE_SET3_VALUE_SET(x) (((x) << 0) & 0x01ffffff) - -/* macros for MAC_PCU_TXBUF_BA */ -#define MAC_PCU_TXBUF_BA_ADDRESS 0x00008400 -#define MAC_PCU_TXBUF_BA_OFFSET 0x00008400 -#define MAC_PCU_TXBUF_BA_DATA_MSB 31 -#define MAC_PCU_TXBUF_BA_DATA_LSB 0 -#define MAC_PCU_TXBUF_BA_DATA_MASK 0xffffffff -#define MAC_PCU_TXBUF_BA_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_TXBUF_BA_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_BT_BT */ -#define MAC_PCU_BT_BT_ADDRESS 0x00008500 -#define MAC_PCU_BT_BT_OFFSET 0x00008500 -#define MAC_PCU_BT_BT_WEIGHT_MSB 31 -#define MAC_PCU_BT_BT_WEIGHT_LSB 0 -#define MAC_PCU_BT_BT_WEIGHT_MASK 0xffffffff -#define MAC_PCU_BT_BT_WEIGHT_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_BT_BT_WEIGHT_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_RX_INT_STATUS0 */ -#define MAC_PCU_RX_INT_STATUS0_ADDRESS 0x00008600 -#define MAC_PCU_RX_INT_STATUS0_OFFSET 0x00008600 -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_L_MSB 7 -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_L_LSB 0 -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_L_MASK 0x000000ff -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_L_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_H_MSB 15 -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_H_LSB 8 -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_H_MASK 0x0000ff00 -#define MAC_PCU_RX_INT_STATUS0_FRAME_CONTROL_H_GET(x) (((x) & 0x0000ff00) >> 8) -#define MAC_PCU_RX_INT_STATUS0_DURATION_L_MSB 23 -#define MAC_PCU_RX_INT_STATUS0_DURATION_L_LSB 16 -#define MAC_PCU_RX_INT_STATUS0_DURATION_L_MASK 0x00ff0000 -#define MAC_PCU_RX_INT_STATUS0_DURATION_L_GET(x) (((x) & 0x00ff0000) >> 16) -#define MAC_PCU_RX_INT_STATUS0_DURATION_H_MSB 31 -#define MAC_PCU_RX_INT_STATUS0_DURATION_H_LSB 24 -#define MAC_PCU_RX_INT_STATUS0_DURATION_H_MASK 0xff000000 -#define MAC_PCU_RX_INT_STATUS0_DURATION_H_GET(x) (((x) & 0xff000000) >> 24) - -/* macros for MAC_PCU_RX_INT_STATUS1 */ -#define MAC_PCU_RX_INT_STATUS1_ADDRESS 0x00008604 -#define MAC_PCU_RX_INT_STATUS1_OFFSET 0x00008604 -#define MAC_PCU_RX_INT_STATUS1_VALUE_MSB 17 -#define MAC_PCU_RX_INT_STATUS1_VALUE_LSB 0 -#define MAC_PCU_RX_INT_STATUS1_VALUE_MASK 0x0003ffff -#define MAC_PCU_RX_INT_STATUS1_VALUE_GET(x) (((x) & 0x0003ffff) >> 0) - -/* macros for MAC_PCU_RX_INT_STATUS2 */ -#define MAC_PCU_RX_INT_STATUS2_ADDRESS 0x00008608 -#define MAC_PCU_RX_INT_STATUS2_OFFSET 0x00008608 -#define MAC_PCU_RX_INT_STATUS2_VALUE_MSB 26 -#define MAC_PCU_RX_INT_STATUS2_VALUE_LSB 0 -#define MAC_PCU_RX_INT_STATUS2_VALUE_MASK 0x07ffffff -#define MAC_PCU_RX_INT_STATUS2_VALUE_GET(x) (((x) & 0x07ffffff) >> 0) - -/* macros for MAC_PCU_RX_INT_STATUS3 */ -#define MAC_PCU_RX_INT_STATUS3_ADDRESS 0x0000860c -#define MAC_PCU_RX_INT_STATUS3_OFFSET 0x0000860c -#define MAC_PCU_RX_INT_STATUS3_VALUE_MSB 23 -#define MAC_PCU_RX_INT_STATUS3_VALUE_LSB 0 -#define MAC_PCU_RX_INT_STATUS3_VALUE_MASK 0x00ffffff -#define MAC_PCU_RX_INT_STATUS3_VALUE_GET(x) (((x) & 0x00ffffff) >> 0) - -/* macros for HT_HALF_GI_RATE1 */ -#define HT_HALF_GI_RATE1_ADDRESS 0x00008610 -#define HT_HALF_GI_RATE1_OFFSET 0x00008610 -#define HT_HALF_GI_RATE1_MCS0_MSB 7 -#define HT_HALF_GI_RATE1_MCS0_LSB 0 -#define HT_HALF_GI_RATE1_MCS0_MASK 0x000000ff -#define HT_HALF_GI_RATE1_MCS0_GET(x) (((x) & 0x000000ff) >> 0) -#define HT_HALF_GI_RATE1_MCS0_SET(x) (((x) << 0) & 0x000000ff) -#define HT_HALF_GI_RATE1_MCS1_MSB 15 -#define HT_HALF_GI_RATE1_MCS1_LSB 8 -#define HT_HALF_GI_RATE1_MCS1_MASK 0x0000ff00 -#define HT_HALF_GI_RATE1_MCS1_GET(x) (((x) & 0x0000ff00) >> 8) -#define HT_HALF_GI_RATE1_MCS1_SET(x) (((x) << 8) & 0x0000ff00) -#define HT_HALF_GI_RATE1_MCS2_MSB 23 -#define HT_HALF_GI_RATE1_MCS2_LSB 16 -#define HT_HALF_GI_RATE1_MCS2_MASK 0x00ff0000 -#define HT_HALF_GI_RATE1_MCS2_GET(x) (((x) & 0x00ff0000) >> 16) -#define HT_HALF_GI_RATE1_MCS2_SET(x) (((x) << 16) & 0x00ff0000) -#define HT_HALF_GI_RATE1_MCS3_MSB 31 -#define HT_HALF_GI_RATE1_MCS3_LSB 24 -#define HT_HALF_GI_RATE1_MCS3_MASK 0xff000000 -#define HT_HALF_GI_RATE1_MCS3_GET(x) (((x) & 0xff000000) >> 24) -#define HT_HALF_GI_RATE1_MCS3_SET(x) (((x) << 24) & 0xff000000) - -/* macros for HT_HALF_GI_RATE2 */ -#define HT_HALF_GI_RATE2_ADDRESS 0x00008614 -#define HT_HALF_GI_RATE2_OFFSET 0x00008614 -#define HT_HALF_GI_RATE2_MCS4_MSB 7 -#define HT_HALF_GI_RATE2_MCS4_LSB 0 -#define HT_HALF_GI_RATE2_MCS4_MASK 0x000000ff -#define HT_HALF_GI_RATE2_MCS4_GET(x) (((x) & 0x000000ff) >> 0) -#define HT_HALF_GI_RATE2_MCS4_SET(x) (((x) << 0) & 0x000000ff) -#define HT_HALF_GI_RATE2_MCS5_MSB 15 -#define HT_HALF_GI_RATE2_MCS5_LSB 8 -#define HT_HALF_GI_RATE2_MCS5_MASK 0x0000ff00 -#define HT_HALF_GI_RATE2_MCS5_GET(x) (((x) & 0x0000ff00) >> 8) -#define HT_HALF_GI_RATE2_MCS5_SET(x) (((x) << 8) & 0x0000ff00) -#define HT_HALF_GI_RATE2_MCS6_MSB 23 -#define HT_HALF_GI_RATE2_MCS6_LSB 16 -#define HT_HALF_GI_RATE2_MCS6_MASK 0x00ff0000 -#define HT_HALF_GI_RATE2_MCS6_GET(x) (((x) & 0x00ff0000) >> 16) -#define HT_HALF_GI_RATE2_MCS6_SET(x) (((x) << 16) & 0x00ff0000) -#define HT_HALF_GI_RATE2_MCS7_MSB 31 -#define HT_HALF_GI_RATE2_MCS7_LSB 24 -#define HT_HALF_GI_RATE2_MCS7_MASK 0xff000000 -#define HT_HALF_GI_RATE2_MCS7_GET(x) (((x) & 0xff000000) >> 24) -#define HT_HALF_GI_RATE2_MCS7_SET(x) (((x) << 24) & 0xff000000) - -/* macros for HT_FULL_GI_RATE1 */ -#define HT_FULL_GI_RATE1_ADDRESS 0x00008618 -#define HT_FULL_GI_RATE1_OFFSET 0x00008618 -#define HT_FULL_GI_RATE1_MCS0_MSB 7 -#define HT_FULL_GI_RATE1_MCS0_LSB 0 -#define HT_FULL_GI_RATE1_MCS0_MASK 0x000000ff -#define HT_FULL_GI_RATE1_MCS0_GET(x) (((x) & 0x000000ff) >> 0) -#define HT_FULL_GI_RATE1_MCS0_SET(x) (((x) << 0) & 0x000000ff) -#define HT_FULL_GI_RATE1_MCS1_MSB 15 -#define HT_FULL_GI_RATE1_MCS1_LSB 8 -#define HT_FULL_GI_RATE1_MCS1_MASK 0x0000ff00 -#define HT_FULL_GI_RATE1_MCS1_GET(x) (((x) & 0x0000ff00) >> 8) -#define HT_FULL_GI_RATE1_MCS1_SET(x) (((x) << 8) & 0x0000ff00) -#define HT_FULL_GI_RATE1_MCS2_MSB 23 -#define HT_FULL_GI_RATE1_MCS2_LSB 16 -#define HT_FULL_GI_RATE1_MCS2_MASK 0x00ff0000 -#define HT_FULL_GI_RATE1_MCS2_GET(x) (((x) & 0x00ff0000) >> 16) -#define HT_FULL_GI_RATE1_MCS2_SET(x) (((x) << 16) & 0x00ff0000) -#define HT_FULL_GI_RATE1_MCS3_MSB 31 -#define HT_FULL_GI_RATE1_MCS3_LSB 24 -#define HT_FULL_GI_RATE1_MCS3_MASK 0xff000000 -#define HT_FULL_GI_RATE1_MCS3_GET(x) (((x) & 0xff000000) >> 24) -#define HT_FULL_GI_RATE1_MCS3_SET(x) (((x) << 24) & 0xff000000) - -/* macros for HT_FULL_GI_RATE2 */ -#define HT_FULL_GI_RATE2_ADDRESS 0x0000861c -#define HT_FULL_GI_RATE2_OFFSET 0x0000861c -#define HT_FULL_GI_RATE2_MCS4_MSB 7 -#define HT_FULL_GI_RATE2_MCS4_LSB 0 -#define HT_FULL_GI_RATE2_MCS4_MASK 0x000000ff -#define HT_FULL_GI_RATE2_MCS4_GET(x) (((x) & 0x000000ff) >> 0) -#define HT_FULL_GI_RATE2_MCS4_SET(x) (((x) << 0) & 0x000000ff) -#define HT_FULL_GI_RATE2_MCS5_MSB 15 -#define HT_FULL_GI_RATE2_MCS5_LSB 8 -#define HT_FULL_GI_RATE2_MCS5_MASK 0x0000ff00 -#define HT_FULL_GI_RATE2_MCS5_GET(x) (((x) & 0x0000ff00) >> 8) -#define HT_FULL_GI_RATE2_MCS5_SET(x) (((x) << 8) & 0x0000ff00) -#define HT_FULL_GI_RATE2_MCS6_MSB 23 -#define HT_FULL_GI_RATE2_MCS6_LSB 16 -#define HT_FULL_GI_RATE2_MCS6_MASK 0x00ff0000 -#define HT_FULL_GI_RATE2_MCS6_GET(x) (((x) & 0x00ff0000) >> 16) -#define HT_FULL_GI_RATE2_MCS6_SET(x) (((x) << 16) & 0x00ff0000) -#define HT_FULL_GI_RATE2_MCS7_MSB 31 -#define HT_FULL_GI_RATE2_MCS7_LSB 24 -#define HT_FULL_GI_RATE2_MCS7_MASK 0xff000000 -#define HT_FULL_GI_RATE2_MCS7_GET(x) (((x) & 0xff000000) >> 24) -#define HT_FULL_GI_RATE2_MCS7_SET(x) (((x) << 24) & 0xff000000) - -/* macros for LEGACY_RATE1 */ -#define LEGACY_RATE1_ADDRESS 0x00008620 -#define LEGACY_RATE1_OFFSET 0x00008620 -#define LEGACY_RATE1_RATE8_MSB 5 -#define LEGACY_RATE1_RATE8_LSB 0 -#define LEGACY_RATE1_RATE8_MASK 0x0000003f -#define LEGACY_RATE1_RATE8_GET(x) (((x) & 0x0000003f) >> 0) -#define LEGACY_RATE1_RATE8_SET(x) (((x) << 0) & 0x0000003f) -#define LEGACY_RATE1_RATE9_MSB 11 -#define LEGACY_RATE1_RATE9_LSB 6 -#define LEGACY_RATE1_RATE9_MASK 0x00000fc0 -#define LEGACY_RATE1_RATE9_GET(x) (((x) & 0x00000fc0) >> 6) -#define LEGACY_RATE1_RATE9_SET(x) (((x) << 6) & 0x00000fc0) -#define LEGACY_RATE1_RATE10_MSB 17 -#define LEGACY_RATE1_RATE10_LSB 12 -#define LEGACY_RATE1_RATE10_MASK 0x0003f000 -#define LEGACY_RATE1_RATE10_GET(x) (((x) & 0x0003f000) >> 12) -#define LEGACY_RATE1_RATE10_SET(x) (((x) << 12) & 0x0003f000) -#define LEGACY_RATE1_RATE11_MSB 23 -#define LEGACY_RATE1_RATE11_LSB 18 -#define LEGACY_RATE1_RATE11_MASK 0x00fc0000 -#define LEGACY_RATE1_RATE11_GET(x) (((x) & 0x00fc0000) >> 18) -#define LEGACY_RATE1_RATE11_SET(x) (((x) << 18) & 0x00fc0000) -#define LEGACY_RATE1_RATE12_MSB 29 -#define LEGACY_RATE1_RATE12_LSB 24 -#define LEGACY_RATE1_RATE12_MASK 0x3f000000 -#define LEGACY_RATE1_RATE12_GET(x) (((x) & 0x3f000000) >> 24) -#define LEGACY_RATE1_RATE12_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for LEGACY_RATE2 */ -#define LEGACY_RATE2_ADDRESS 0x00008624 -#define LEGACY_RATE2_OFFSET 0x00008624 -#define LEGACY_RATE2_RATE13_MSB 5 -#define LEGACY_RATE2_RATE13_LSB 0 -#define LEGACY_RATE2_RATE13_MASK 0x0000003f -#define LEGACY_RATE2_RATE13_GET(x) (((x) & 0x0000003f) >> 0) -#define LEGACY_RATE2_RATE13_SET(x) (((x) << 0) & 0x0000003f) -#define LEGACY_RATE2_RATE14_MSB 11 -#define LEGACY_RATE2_RATE14_LSB 6 -#define LEGACY_RATE2_RATE14_MASK 0x00000fc0 -#define LEGACY_RATE2_RATE14_GET(x) (((x) & 0x00000fc0) >> 6) -#define LEGACY_RATE2_RATE14_SET(x) (((x) << 6) & 0x00000fc0) -#define LEGACY_RATE2_RATE15_MSB 17 -#define LEGACY_RATE2_RATE15_LSB 12 -#define LEGACY_RATE2_RATE15_MASK 0x0003f000 -#define LEGACY_RATE2_RATE15_GET(x) (((x) & 0x0003f000) >> 12) -#define LEGACY_RATE2_RATE15_SET(x) (((x) << 12) & 0x0003f000) -#define LEGACY_RATE2_RATE24_MSB 23 -#define LEGACY_RATE2_RATE24_LSB 18 -#define LEGACY_RATE2_RATE24_MASK 0x00fc0000 -#define LEGACY_RATE2_RATE24_GET(x) (((x) & 0x00fc0000) >> 18) -#define LEGACY_RATE2_RATE24_SET(x) (((x) << 18) & 0x00fc0000) -#define LEGACY_RATE2_RATE25_MSB 29 -#define LEGACY_RATE2_RATE25_LSB 24 -#define LEGACY_RATE2_RATE25_MASK 0x3f000000 -#define LEGACY_RATE2_RATE25_GET(x) (((x) & 0x3f000000) >> 24) -#define LEGACY_RATE2_RATE25_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for LEGACY_RATE3 */ -#define LEGACY_RATE3_ADDRESS 0x00008628 -#define LEGACY_RATE3_OFFSET 0x00008628 -#define LEGACY_RATE3_RATE26_MSB 5 -#define LEGACY_RATE3_RATE26_LSB 0 -#define LEGACY_RATE3_RATE26_MASK 0x0000003f -#define LEGACY_RATE3_RATE26_GET(x) (((x) & 0x0000003f) >> 0) -#define LEGACY_RATE3_RATE26_SET(x) (((x) << 0) & 0x0000003f) -#define LEGACY_RATE3_RATE27_MSB 11 -#define LEGACY_RATE3_RATE27_LSB 6 -#define LEGACY_RATE3_RATE27_MASK 0x00000fc0 -#define LEGACY_RATE3_RATE27_GET(x) (((x) & 0x00000fc0) >> 6) -#define LEGACY_RATE3_RATE27_SET(x) (((x) << 6) & 0x00000fc0) -#define LEGACY_RATE3_RATE28_MSB 17 -#define LEGACY_RATE3_RATE28_LSB 12 -#define LEGACY_RATE3_RATE28_MASK 0x0003f000 -#define LEGACY_RATE3_RATE28_GET(x) (((x) & 0x0003f000) >> 12) -#define LEGACY_RATE3_RATE28_SET(x) (((x) << 12) & 0x0003f000) -#define LEGACY_RATE3_RATE29_MSB 23 -#define LEGACY_RATE3_RATE29_LSB 18 -#define LEGACY_RATE3_RATE29_MASK 0x00fc0000 -#define LEGACY_RATE3_RATE29_GET(x) (((x) & 0x00fc0000) >> 18) -#define LEGACY_RATE3_RATE29_SET(x) (((x) << 18) & 0x00fc0000) -#define LEGACY_RATE3_RATE30_MSB 29 -#define LEGACY_RATE3_RATE30_LSB 24 -#define LEGACY_RATE3_RATE30_MASK 0x3f000000 -#define LEGACY_RATE3_RATE30_GET(x) (((x) & 0x3f000000) >> 24) -#define LEGACY_RATE3_RATE30_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for RX_INT_FILTER */ -#define RX_INT_FILTER_ADDRESS 0x0000862c -#define RX_INT_FILTER_OFFSET 0x0000862c -#define RX_INT_FILTER_ENABLE_MSB 0 -#define RX_INT_FILTER_ENABLE_LSB 0 -#define RX_INT_FILTER_ENABLE_MASK 0x00000001 -#define RX_INT_FILTER_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define RX_INT_FILTER_ENABLE_SET(x) (((x) << 0) & 0x00000001) -#define RX_INT_FILTER_DIRECTED_MSB 1 -#define RX_INT_FILTER_DIRECTED_LSB 1 -#define RX_INT_FILTER_DIRECTED_MASK 0x00000002 -#define RX_INT_FILTER_DIRECTED_GET(x) (((x) & 0x00000002) >> 1) -#define RX_INT_FILTER_DIRECTED_SET(x) (((x) << 1) & 0x00000002) -#define RX_INT_FILTER_BCAST_MSB 2 -#define RX_INT_FILTER_BCAST_LSB 2 -#define RX_INT_FILTER_BCAST_MASK 0x00000004 -#define RX_INT_FILTER_BCAST_GET(x) (((x) & 0x00000004) >> 2) -#define RX_INT_FILTER_BCAST_SET(x) (((x) << 2) & 0x00000004) -#define RX_INT_FILTER_MCAST_MSB 3 -#define RX_INT_FILTER_MCAST_LSB 3 -#define RX_INT_FILTER_MCAST_MASK 0x00000008 -#define RX_INT_FILTER_MCAST_GET(x) (((x) & 0x00000008) >> 3) -#define RX_INT_FILTER_MCAST_SET(x) (((x) << 3) & 0x00000008) -#define RX_INT_FILTER_RTS_MSB 4 -#define RX_INT_FILTER_RTS_LSB 4 -#define RX_INT_FILTER_RTS_MASK 0x00000010 -#define RX_INT_FILTER_RTS_GET(x) (((x) & 0x00000010) >> 4) -#define RX_INT_FILTER_RTS_SET(x) (((x) << 4) & 0x00000010) -#define RX_INT_FILTER_ACK_MSB 5 -#define RX_INT_FILTER_ACK_LSB 5 -#define RX_INT_FILTER_ACK_MASK 0x00000020 -#define RX_INT_FILTER_ACK_GET(x) (((x) & 0x00000020) >> 5) -#define RX_INT_FILTER_ACK_SET(x) (((x) << 5) & 0x00000020) -#define RX_INT_FILTER_CTS_MSB 6 -#define RX_INT_FILTER_CTS_LSB 6 -#define RX_INT_FILTER_CTS_MASK 0x00000040 -#define RX_INT_FILTER_CTS_GET(x) (((x) & 0x00000040) >> 6) -#define RX_INT_FILTER_CTS_SET(x) (((x) << 6) & 0x00000040) -#define RX_INT_FILTER_RETRY_MSB 7 -#define RX_INT_FILTER_RETRY_LSB 7 -#define RX_INT_FILTER_RETRY_MASK 0x00000080 -#define RX_INT_FILTER_RETRY_GET(x) (((x) & 0x00000080) >> 7) -#define RX_INT_FILTER_RETRY_SET(x) (((x) << 7) & 0x00000080) -#define RX_INT_FILTER_MORE_DATA_MSB 8 -#define RX_INT_FILTER_MORE_DATA_LSB 8 -#define RX_INT_FILTER_MORE_DATA_MASK 0x00000100 -#define RX_INT_FILTER_MORE_DATA_GET(x) (((x) & 0x00000100) >> 8) -#define RX_INT_FILTER_MORE_DATA_SET(x) (((x) << 8) & 0x00000100) -#define RX_INT_FILTER_MORE_FRAG_MSB 9 -#define RX_INT_FILTER_MORE_FRAG_LSB 9 -#define RX_INT_FILTER_MORE_FRAG_MASK 0x00000200 -#define RX_INT_FILTER_MORE_FRAG_GET(x) (((x) & 0x00000200) >> 9) -#define RX_INT_FILTER_MORE_FRAG_SET(x) (((x) << 9) & 0x00000200) -#define RX_INT_FILTER_RATE_HIGH_MSB 10 -#define RX_INT_FILTER_RATE_HIGH_LSB 10 -#define RX_INT_FILTER_RATE_HIGH_MASK 0x00000400 -#define RX_INT_FILTER_RATE_HIGH_GET(x) (((x) & 0x00000400) >> 10) -#define RX_INT_FILTER_RATE_HIGH_SET(x) (((x) << 10) & 0x00000400) -#define RX_INT_FILTER_RATE_LOW_MSB 11 -#define RX_INT_FILTER_RATE_LOW_LSB 11 -#define RX_INT_FILTER_RATE_LOW_MASK 0x00000800 -#define RX_INT_FILTER_RATE_LOW_GET(x) (((x) & 0x00000800) >> 11) -#define RX_INT_FILTER_RATE_LOW_SET(x) (((x) << 11) & 0x00000800) -#define RX_INT_FILTER_RSSI_MSB 12 -#define RX_INT_FILTER_RSSI_LSB 12 -#define RX_INT_FILTER_RSSI_MASK 0x00001000 -#define RX_INT_FILTER_RSSI_GET(x) (((x) & 0x00001000) >> 12) -#define RX_INT_FILTER_RSSI_SET(x) (((x) << 12) & 0x00001000) -#define RX_INT_FILTER_LENGTH_HIGH_MSB 13 -#define RX_INT_FILTER_LENGTH_HIGH_LSB 13 -#define RX_INT_FILTER_LENGTH_HIGH_MASK 0x00002000 -#define RX_INT_FILTER_LENGTH_HIGH_GET(x) (((x) & 0x00002000) >> 13) -#define RX_INT_FILTER_LENGTH_HIGH_SET(x) (((x) << 13) & 0x00002000) -#define RX_INT_FILTER_LENGTH_LOW_MSB 14 -#define RX_INT_FILTER_LENGTH_LOW_LSB 14 -#define RX_INT_FILTER_LENGTH_LOW_MASK 0x00004000 -#define RX_INT_FILTER_LENGTH_LOW_GET(x) (((x) & 0x00004000) >> 14) -#define RX_INT_FILTER_LENGTH_LOW_SET(x) (((x) << 14) & 0x00004000) -#define RX_INT_FILTER_EOSP_MSB 15 -#define RX_INT_FILTER_EOSP_LSB 15 -#define RX_INT_FILTER_EOSP_MASK 0x00008000 -#define RX_INT_FILTER_EOSP_GET(x) (((x) & 0x00008000) >> 15) -#define RX_INT_FILTER_EOSP_SET(x) (((x) << 15) & 0x00008000) -#define RX_INT_FILTER_AMPDU_MSB 16 -#define RX_INT_FILTER_AMPDU_LSB 16 -#define RX_INT_FILTER_AMPDU_MASK 0x00010000 -#define RX_INT_FILTER_AMPDU_GET(x) (((x) & 0x00010000) >> 16) -#define RX_INT_FILTER_AMPDU_SET(x) (((x) << 16) & 0x00010000) -#define RX_INT_FILTER_BEACON_MSB 17 -#define RX_INT_FILTER_BEACON_LSB 17 -#define RX_INT_FILTER_BEACON_MASK 0x00020000 -#define RX_INT_FILTER_BEACON_GET(x) (((x) & 0x00020000) >> 17) -#define RX_INT_FILTER_BEACON_SET(x) (((x) << 17) & 0x00020000) -#define RX_INT_FILTER_RSSI_HIGH_MSB 18 -#define RX_INT_FILTER_RSSI_HIGH_LSB 18 -#define RX_INT_FILTER_RSSI_HIGH_MASK 0x00040000 -#define RX_INT_FILTER_RSSI_HIGH_GET(x) (((x) & 0x00040000) >> 18) -#define RX_INT_FILTER_RSSI_HIGH_SET(x) (((x) << 18) & 0x00040000) - -/* macros for RX_INT_OVERFLOW */ -#define RX_INT_OVERFLOW_ADDRESS 0x00008630 -#define RX_INT_OVERFLOW_OFFSET 0x00008630 -#define RX_INT_OVERFLOW_STATUS_MSB 0 -#define RX_INT_OVERFLOW_STATUS_LSB 0 -#define RX_INT_OVERFLOW_STATUS_MASK 0x00000001 -#define RX_INT_OVERFLOW_STATUS_GET(x) (((x) & 0x00000001) >> 0) -#define RX_INT_OVERFLOW_STATUS_SET(x) (((x) << 0) & 0x00000001) - -/* macros for RX_FILTER_THRESH0 */ -#define RX_FILTER_THRESH0_ADDRESS 0x00008634 -#define RX_FILTER_THRESH0_OFFSET 0x00008634 -#define RX_FILTER_THRESH0_RATE_HIGH_MSB 7 -#define RX_FILTER_THRESH0_RATE_HIGH_LSB 0 -#define RX_FILTER_THRESH0_RATE_HIGH_MASK 0x000000ff -#define RX_FILTER_THRESH0_RATE_HIGH_GET(x) (((x) & 0x000000ff) >> 0) -#define RX_FILTER_THRESH0_RATE_HIGH_SET(x) (((x) << 0) & 0x000000ff) -#define RX_FILTER_THRESH0_RATE_LOW_MSB 15 -#define RX_FILTER_THRESH0_RATE_LOW_LSB 8 -#define RX_FILTER_THRESH0_RATE_LOW_MASK 0x0000ff00 -#define RX_FILTER_THRESH0_RATE_LOW_GET(x) (((x) & 0x0000ff00) >> 8) -#define RX_FILTER_THRESH0_RATE_LOW_SET(x) (((x) << 8) & 0x0000ff00) -#define RX_FILTER_THRESH0_RSSI_LOW_MSB 23 -#define RX_FILTER_THRESH0_RSSI_LOW_LSB 16 -#define RX_FILTER_THRESH0_RSSI_LOW_MASK 0x00ff0000 -#define RX_FILTER_THRESH0_RSSI_LOW_GET(x) (((x) & 0x00ff0000) >> 16) -#define RX_FILTER_THRESH0_RSSI_LOW_SET(x) (((x) << 16) & 0x00ff0000) -#define RX_FILTER_THRESH0_RSSI_HIGH_MSB 31 -#define RX_FILTER_THRESH0_RSSI_HIGH_LSB 24 -#define RX_FILTER_THRESH0_RSSI_HIGH_MASK 0xff000000 -#define RX_FILTER_THRESH0_RSSI_HIGH_GET(x) (((x) & 0xff000000) >> 24) -#define RX_FILTER_THRESH0_RSSI_HIGH_SET(x) (((x) << 24) & 0xff000000) - -/* macros for RX_FILTER_THRESH1 */ -#define RX_FILTER_THRESH1_ADDRESS 0x00008638 -#define RX_FILTER_THRESH1_OFFSET 0x00008638 -#define RX_FILTER_THRESH1_LENGTH_HIGH_MSB 11 -#define RX_FILTER_THRESH1_LENGTH_HIGH_LSB 0 -#define RX_FILTER_THRESH1_LENGTH_HIGH_MASK 0x00000fff -#define RX_FILTER_THRESH1_LENGTH_HIGH_GET(x) (((x) & 0x00000fff) >> 0) -#define RX_FILTER_THRESH1_LENGTH_HIGH_SET(x) (((x) << 0) & 0x00000fff) -#define RX_FILTER_THRESH1_LENGTH_LOW_MSB 23 -#define RX_FILTER_THRESH1_LENGTH_LOW_LSB 12 -#define RX_FILTER_THRESH1_LENGTH_LOW_MASK 0x00fff000 -#define RX_FILTER_THRESH1_LENGTH_LOW_GET(x) (((x) & 0x00fff000) >> 12) -#define RX_FILTER_THRESH1_LENGTH_LOW_SET(x) (((x) << 12) & 0x00fff000) - -/* macros for RX_PRIORITY_THRESH0 */ -#define RX_PRIORITY_THRESH0_ADDRESS 0x0000863c -#define RX_PRIORITY_THRESH0_OFFSET 0x0000863c -#define RX_PRIORITY_THRESH0_RATE_HIGH_MSB 7 -#define RX_PRIORITY_THRESH0_RATE_HIGH_LSB 0 -#define RX_PRIORITY_THRESH0_RATE_HIGH_MASK 0x000000ff -#define RX_PRIORITY_THRESH0_RATE_HIGH_GET(x) (((x) & 0x000000ff) >> 0) -#define RX_PRIORITY_THRESH0_RATE_HIGH_SET(x) (((x) << 0) & 0x000000ff) -#define RX_PRIORITY_THRESH0_RATE_LOW_MSB 15 -#define RX_PRIORITY_THRESH0_RATE_LOW_LSB 8 -#define RX_PRIORITY_THRESH0_RATE_LOW_MASK 0x0000ff00 -#define RX_PRIORITY_THRESH0_RATE_LOW_GET(x) (((x) & 0x0000ff00) >> 8) -#define RX_PRIORITY_THRESH0_RATE_LOW_SET(x) (((x) << 8) & 0x0000ff00) -#define RX_PRIORITY_THRESH0_RSSI_HIGH_MSB 23 -#define RX_PRIORITY_THRESH0_RSSI_HIGH_LSB 16 -#define RX_PRIORITY_THRESH0_RSSI_HIGH_MASK 0x00ff0000 -#define RX_PRIORITY_THRESH0_RSSI_HIGH_GET(x) (((x) & 0x00ff0000) >> 16) -#define RX_PRIORITY_THRESH0_RSSI_HIGH_SET(x) (((x) << 16) & 0x00ff0000) -#define RX_PRIORITY_THRESH0_RSSI_LOW_MSB 31 -#define RX_PRIORITY_THRESH0_RSSI_LOW_LSB 24 -#define RX_PRIORITY_THRESH0_RSSI_LOW_MASK 0xff000000 -#define RX_PRIORITY_THRESH0_RSSI_LOW_GET(x) (((x) & 0xff000000) >> 24) -#define RX_PRIORITY_THRESH0_RSSI_LOW_SET(x) (((x) << 24) & 0xff000000) - -/* macros for RX_PRIORITY_THRESH1 */ -#define RX_PRIORITY_THRESH1_ADDRESS 0x00008640 -#define RX_PRIORITY_THRESH1_OFFSET 0x00008640 -#define RX_PRIORITY_THRESH1_LENGTH_HIGH_MSB 11 -#define RX_PRIORITY_THRESH1_LENGTH_HIGH_LSB 0 -#define RX_PRIORITY_THRESH1_LENGTH_HIGH_MASK 0x00000fff -#define RX_PRIORITY_THRESH1_LENGTH_HIGH_GET(x) (((x) & 0x00000fff) >> 0) -#define RX_PRIORITY_THRESH1_LENGTH_HIGH_SET(x) (((x) << 0) & 0x00000fff) -#define RX_PRIORITY_THRESH1_LENGTH_LOW_MSB 23 -#define RX_PRIORITY_THRESH1_LENGTH_LOW_LSB 12 -#define RX_PRIORITY_THRESH1_LENGTH_LOW_MASK 0x00fff000 -#define RX_PRIORITY_THRESH1_LENGTH_LOW_GET(x) (((x) & 0x00fff000) >> 12) -#define RX_PRIORITY_THRESH1_LENGTH_LOW_SET(x) (((x) << 12) & 0x00fff000) -#define RX_PRIORITY_THRESH1_XCAST_RSSI_HIGH_MSB 31 -#define RX_PRIORITY_THRESH1_XCAST_RSSI_HIGH_LSB 24 -#define RX_PRIORITY_THRESH1_XCAST_RSSI_HIGH_MASK 0xff000000 -#define RX_PRIORITY_THRESH1_XCAST_RSSI_HIGH_GET(x) (((x) & 0xff000000) >> 24) -#define RX_PRIORITY_THRESH1_XCAST_RSSI_HIGH_SET(x) (((x) << 24) & 0xff000000) - -/* macros for RX_PRIORITY_THRESH2 */ -#define RX_PRIORITY_THRESH2_ADDRESS 0x00008644 -#define RX_PRIORITY_THRESH2_OFFSET 0x00008644 -#define RX_PRIORITY_THRESH2_PRESP_RSSI_HIGH_MSB 7 -#define RX_PRIORITY_THRESH2_PRESP_RSSI_HIGH_LSB 0 -#define RX_PRIORITY_THRESH2_PRESP_RSSI_HIGH_MASK 0x000000ff -#define RX_PRIORITY_THRESH2_PRESP_RSSI_HIGH_GET(x) (((x) & 0x000000ff) >> 0) -#define RX_PRIORITY_THRESH2_PRESP_RSSI_HIGH_SET(x) (((x) << 0) & 0x000000ff) -#define RX_PRIORITY_THRESH2_MGMT_RSSI_HIGH_MSB 15 -#define RX_PRIORITY_THRESH2_MGMT_RSSI_HIGH_LSB 8 -#define RX_PRIORITY_THRESH2_MGMT_RSSI_HIGH_MASK 0x0000ff00 -#define RX_PRIORITY_THRESH2_MGMT_RSSI_HIGH_GET(x) (((x) & 0x0000ff00) >> 8) -#define RX_PRIORITY_THRESH2_MGMT_RSSI_HIGH_SET(x) (((x) << 8) & 0x0000ff00) -#define RX_PRIORITY_THRESH2_BEACON_RSSI_HIGH_MSB 23 -#define RX_PRIORITY_THRESH2_BEACON_RSSI_HIGH_LSB 16 -#define RX_PRIORITY_THRESH2_BEACON_RSSI_HIGH_MASK 0x00ff0000 -#define RX_PRIORITY_THRESH2_BEACON_RSSI_HIGH_GET(x) (((x) & 0x00ff0000) >> 16) -#define RX_PRIORITY_THRESH2_BEACON_RSSI_HIGH_SET(x) (((x) << 16) & 0x00ff0000) -#define RX_PRIORITY_THRESH2_NULL_RSSI_HIGH_MSB 31 -#define RX_PRIORITY_THRESH2_NULL_RSSI_HIGH_LSB 24 -#define RX_PRIORITY_THRESH2_NULL_RSSI_HIGH_MASK 0xff000000 -#define RX_PRIORITY_THRESH2_NULL_RSSI_HIGH_GET(x) (((x) & 0xff000000) >> 24) -#define RX_PRIORITY_THRESH2_NULL_RSSI_HIGH_SET(x) (((x) << 24) & 0xff000000) - -/* macros for RX_PRIORITY_THRESH3 */ -#define RX_PRIORITY_THRESH3_ADDRESS 0x00008648 -#define RX_PRIORITY_THRESH3_OFFSET 0x00008648 -#define RX_PRIORITY_THRESH3_PREQ_RSSI_HIGH_MSB 7 -#define RX_PRIORITY_THRESH3_PREQ_RSSI_HIGH_LSB 0 -#define RX_PRIORITY_THRESH3_PREQ_RSSI_HIGH_MASK 0x000000ff -#define RX_PRIORITY_THRESH3_PREQ_RSSI_HIGH_GET(x) (((x) & 0x000000ff) >> 0) -#define RX_PRIORITY_THRESH3_PREQ_RSSI_HIGH_SET(x) (((x) << 0) & 0x000000ff) -#define RX_PRIORITY_THRESH3_PS_POLL_RSSI_HIGH_MSB 15 -#define RX_PRIORITY_THRESH3_PS_POLL_RSSI_HIGH_LSB 8 -#define RX_PRIORITY_THRESH3_PS_POLL_RSSI_HIGH_MASK 0x0000ff00 -#define RX_PRIORITY_THRESH3_PS_POLL_RSSI_HIGH_GET(x) (((x) & 0x0000ff00) >> 8) -#define RX_PRIORITY_THRESH3_PS_POLL_RSSI_HIGH_SET(x) (((x) << 8) & 0x0000ff00) - -/* macros for RX_PRIORITY_OFFSET0 */ -#define RX_PRIORITY_OFFSET0_ADDRESS 0x0000864c -#define RX_PRIORITY_OFFSET0_OFFSET 0x0000864c -#define RX_PRIORITY_OFFSET0_PHY_RATE_HIGH_MSB 5 -#define RX_PRIORITY_OFFSET0_PHY_RATE_HIGH_LSB 0 -#define RX_PRIORITY_OFFSET0_PHY_RATE_HIGH_MASK 0x0000003f -#define RX_PRIORITY_OFFSET0_PHY_RATE_HIGH_GET(x) (((x) & 0x0000003f) >> 0) -#define RX_PRIORITY_OFFSET0_PHY_RATE_HIGH_SET(x) (((x) << 0) & 0x0000003f) -#define RX_PRIORITY_OFFSET0_PHY_RATE_LOW_MSB 11 -#define RX_PRIORITY_OFFSET0_PHY_RATE_LOW_LSB 6 -#define RX_PRIORITY_OFFSET0_PHY_RATE_LOW_MASK 0x00000fc0 -#define RX_PRIORITY_OFFSET0_PHY_RATE_LOW_GET(x) (((x) & 0x00000fc0) >> 6) -#define RX_PRIORITY_OFFSET0_PHY_RATE_LOW_SET(x) (((x) << 6) & 0x00000fc0) -#define RX_PRIORITY_OFFSET0_RSSI_HIGH_MSB 17 -#define RX_PRIORITY_OFFSET0_RSSI_HIGH_LSB 12 -#define RX_PRIORITY_OFFSET0_RSSI_HIGH_MASK 0x0003f000 -#define RX_PRIORITY_OFFSET0_RSSI_HIGH_GET(x) (((x) & 0x0003f000) >> 12) -#define RX_PRIORITY_OFFSET0_RSSI_HIGH_SET(x) (((x) << 12) & 0x0003f000) -#define RX_PRIORITY_OFFSET0_RSSI_LOW_MSB 23 -#define RX_PRIORITY_OFFSET0_RSSI_LOW_LSB 18 -#define RX_PRIORITY_OFFSET0_RSSI_LOW_MASK 0x00fc0000 -#define RX_PRIORITY_OFFSET0_RSSI_LOW_GET(x) (((x) & 0x00fc0000) >> 18) -#define RX_PRIORITY_OFFSET0_RSSI_LOW_SET(x) (((x) << 18) & 0x00fc0000) -#define RX_PRIORITY_OFFSET0_XCAST_RSSI_HIGH_MSB 29 -#define RX_PRIORITY_OFFSET0_XCAST_RSSI_HIGH_LSB 24 -#define RX_PRIORITY_OFFSET0_XCAST_RSSI_HIGH_MASK 0x3f000000 -#define RX_PRIORITY_OFFSET0_XCAST_RSSI_HIGH_GET(x) (((x) & 0x3f000000) >> 24) -#define RX_PRIORITY_OFFSET0_XCAST_RSSI_HIGH_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for RX_PRIORITY_OFFSET1 */ -#define RX_PRIORITY_OFFSET1_ADDRESS 0x00008650 -#define RX_PRIORITY_OFFSET1_OFFSET 0x00008650 -#define RX_PRIORITY_OFFSET1_LENGTH_HIGH_MSB 5 -#define RX_PRIORITY_OFFSET1_LENGTH_HIGH_LSB 0 -#define RX_PRIORITY_OFFSET1_LENGTH_HIGH_MASK 0x0000003f -#define RX_PRIORITY_OFFSET1_LENGTH_HIGH_GET(x) (((x) & 0x0000003f) >> 0) -#define RX_PRIORITY_OFFSET1_LENGTH_HIGH_SET(x) (((x) << 0) & 0x0000003f) -#define RX_PRIORITY_OFFSET1_LENGTH_LOW_MSB 11 -#define RX_PRIORITY_OFFSET1_LENGTH_LOW_LSB 6 -#define RX_PRIORITY_OFFSET1_LENGTH_LOW_MASK 0x00000fc0 -#define RX_PRIORITY_OFFSET1_LENGTH_LOW_GET(x) (((x) & 0x00000fc0) >> 6) -#define RX_PRIORITY_OFFSET1_LENGTH_LOW_SET(x) (((x) << 6) & 0x00000fc0) -#define RX_PRIORITY_OFFSET1_PRESP_RSSI_HIGH_MSB 17 -#define RX_PRIORITY_OFFSET1_PRESP_RSSI_HIGH_LSB 12 -#define RX_PRIORITY_OFFSET1_PRESP_RSSI_HIGH_MASK 0x0003f000 -#define RX_PRIORITY_OFFSET1_PRESP_RSSI_HIGH_GET(x) (((x) & 0x0003f000) >> 12) -#define RX_PRIORITY_OFFSET1_PRESP_RSSI_HIGH_SET(x) (((x) << 12) & 0x0003f000) -#define RX_PRIORITY_OFFSET1_RETX_MSB 23 -#define RX_PRIORITY_OFFSET1_RETX_LSB 18 -#define RX_PRIORITY_OFFSET1_RETX_MASK 0x00fc0000 -#define RX_PRIORITY_OFFSET1_RETX_GET(x) (((x) & 0x00fc0000) >> 18) -#define RX_PRIORITY_OFFSET1_RETX_SET(x) (((x) << 18) & 0x00fc0000) -#define RX_PRIORITY_OFFSET1_RTS_MSB 29 -#define RX_PRIORITY_OFFSET1_RTS_LSB 24 -#define RX_PRIORITY_OFFSET1_RTS_MASK 0x3f000000 -#define RX_PRIORITY_OFFSET1_RTS_GET(x) (((x) & 0x3f000000) >> 24) -#define RX_PRIORITY_OFFSET1_RTS_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for RX_PRIORITY_OFFSET2 */ -#define RX_PRIORITY_OFFSET2_ADDRESS 0x00008654 -#define RX_PRIORITY_OFFSET2_OFFSET 0x00008654 -#define RX_PRIORITY_OFFSET2_XCAST_MSB 5 -#define RX_PRIORITY_OFFSET2_XCAST_LSB 0 -#define RX_PRIORITY_OFFSET2_XCAST_MASK 0x0000003f -#define RX_PRIORITY_OFFSET2_XCAST_GET(x) (((x) & 0x0000003f) >> 0) -#define RX_PRIORITY_OFFSET2_XCAST_SET(x) (((x) << 0) & 0x0000003f) -#define RX_PRIORITY_OFFSET2_PRESP_MSB 11 -#define RX_PRIORITY_OFFSET2_PRESP_LSB 6 -#define RX_PRIORITY_OFFSET2_PRESP_MASK 0x00000fc0 -#define RX_PRIORITY_OFFSET2_PRESP_GET(x) (((x) & 0x00000fc0) >> 6) -#define RX_PRIORITY_OFFSET2_PRESP_SET(x) (((x) << 6) & 0x00000fc0) -#define RX_PRIORITY_OFFSET2_ATIM_MSB 17 -#define RX_PRIORITY_OFFSET2_ATIM_LSB 12 -#define RX_PRIORITY_OFFSET2_ATIM_MASK 0x0003f000 -#define RX_PRIORITY_OFFSET2_ATIM_GET(x) (((x) & 0x0003f000) >> 12) -#define RX_PRIORITY_OFFSET2_ATIM_SET(x) (((x) << 12) & 0x0003f000) -#define RX_PRIORITY_OFFSET2_MGMT_MSB 23 -#define RX_PRIORITY_OFFSET2_MGMT_LSB 18 -#define RX_PRIORITY_OFFSET2_MGMT_MASK 0x00fc0000 -#define RX_PRIORITY_OFFSET2_MGMT_GET(x) (((x) & 0x00fc0000) >> 18) -#define RX_PRIORITY_OFFSET2_MGMT_SET(x) (((x) << 18) & 0x00fc0000) -#define RX_PRIORITY_OFFSET2_BEACON_MSB 29 -#define RX_PRIORITY_OFFSET2_BEACON_LSB 24 -#define RX_PRIORITY_OFFSET2_BEACON_MASK 0x3f000000 -#define RX_PRIORITY_OFFSET2_BEACON_GET(x) (((x) & 0x3f000000) >> 24) -#define RX_PRIORITY_OFFSET2_BEACON_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for RX_PRIORITY_OFFSET3 */ -#define RX_PRIORITY_OFFSET3_ADDRESS 0x00008658 -#define RX_PRIORITY_OFFSET3_OFFSET 0x00008658 -#define RX_PRIORITY_OFFSET3_MORE_MSB 5 -#define RX_PRIORITY_OFFSET3_MORE_LSB 0 -#define RX_PRIORITY_OFFSET3_MORE_MASK 0x0000003f -#define RX_PRIORITY_OFFSET3_MORE_GET(x) (((x) & 0x0000003f) >> 0) -#define RX_PRIORITY_OFFSET3_MORE_SET(x) (((x) << 0) & 0x0000003f) -#define RX_PRIORITY_OFFSET3_EOSP_MSB 11 -#define RX_PRIORITY_OFFSET3_EOSP_LSB 6 -#define RX_PRIORITY_OFFSET3_EOSP_MASK 0x00000fc0 -#define RX_PRIORITY_OFFSET3_EOSP_GET(x) (((x) & 0x00000fc0) >> 6) -#define RX_PRIORITY_OFFSET3_EOSP_SET(x) (((x) << 6) & 0x00000fc0) -#define RX_PRIORITY_OFFSET3_AMPDU_MSB 17 -#define RX_PRIORITY_OFFSET3_AMPDU_LSB 12 -#define RX_PRIORITY_OFFSET3_AMPDU_MASK 0x0003f000 -#define RX_PRIORITY_OFFSET3_AMPDU_GET(x) (((x) & 0x0003f000) >> 12) -#define RX_PRIORITY_OFFSET3_AMPDU_SET(x) (((x) << 12) & 0x0003f000) -#define RX_PRIORITY_OFFSET3_AMSDU_MSB 23 -#define RX_PRIORITY_OFFSET3_AMSDU_LSB 18 -#define RX_PRIORITY_OFFSET3_AMSDU_MASK 0x00fc0000 -#define RX_PRIORITY_OFFSET3_AMSDU_GET(x) (((x) & 0x00fc0000) >> 18) -#define RX_PRIORITY_OFFSET3_AMSDU_SET(x) (((x) << 18) & 0x00fc0000) -#define RX_PRIORITY_OFFSET3_PS_POLL_MSB 29 -#define RX_PRIORITY_OFFSET3_PS_POLL_LSB 24 -#define RX_PRIORITY_OFFSET3_PS_POLL_MASK 0x3f000000 -#define RX_PRIORITY_OFFSET3_PS_POLL_GET(x) (((x) & 0x3f000000) >> 24) -#define RX_PRIORITY_OFFSET3_PS_POLL_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for RX_PRIORITY_OFFSET4 */ -#define RX_PRIORITY_OFFSET4_ADDRESS 0x0000865c -#define RX_PRIORITY_OFFSET4_OFFSET 0x0000865c -#define RX_PRIORITY_OFFSET4_PREQ_MSB 5 -#define RX_PRIORITY_OFFSET4_PREQ_LSB 0 -#define RX_PRIORITY_OFFSET4_PREQ_MASK 0x0000003f -#define RX_PRIORITY_OFFSET4_PREQ_GET(x) (((x) & 0x0000003f) >> 0) -#define RX_PRIORITY_OFFSET4_PREQ_SET(x) (((x) << 0) & 0x0000003f) -#define RX_PRIORITY_OFFSET4_NULL_MSB 11 -#define RX_PRIORITY_OFFSET4_NULL_LSB 6 -#define RX_PRIORITY_OFFSET4_NULL_MASK 0x00000fc0 -#define RX_PRIORITY_OFFSET4_NULL_GET(x) (((x) & 0x00000fc0) >> 6) -#define RX_PRIORITY_OFFSET4_NULL_SET(x) (((x) << 6) & 0x00000fc0) -#define RX_PRIORITY_OFFSET4_BEACON_SSID_MSB 17 -#define RX_PRIORITY_OFFSET4_BEACON_SSID_LSB 12 -#define RX_PRIORITY_OFFSET4_BEACON_SSID_MASK 0x0003f000 -#define RX_PRIORITY_OFFSET4_BEACON_SSID_GET(x) (((x) & 0x0003f000) >> 12) -#define RX_PRIORITY_OFFSET4_BEACON_SSID_SET(x) (((x) << 12) & 0x0003f000) -#define RX_PRIORITY_OFFSET4_MGMT_RSSI_HIGH_MSB 23 -#define RX_PRIORITY_OFFSET4_MGMT_RSSI_HIGH_LSB 18 -#define RX_PRIORITY_OFFSET4_MGMT_RSSI_HIGH_MASK 0x00fc0000 -#define RX_PRIORITY_OFFSET4_MGMT_RSSI_HIGH_GET(x) (((x) & 0x00fc0000) >> 18) -#define RX_PRIORITY_OFFSET4_MGMT_RSSI_HIGH_SET(x) (((x) << 18) & 0x00fc0000) -#define RX_PRIORITY_OFFSET4_BEACON_RSSI_HIGH_MSB 29 -#define RX_PRIORITY_OFFSET4_BEACON_RSSI_HIGH_LSB 24 -#define RX_PRIORITY_OFFSET4_BEACON_RSSI_HIGH_MASK 0x3f000000 -#define RX_PRIORITY_OFFSET4_BEACON_RSSI_HIGH_GET(x) (((x) & 0x3f000000) >> 24) -#define RX_PRIORITY_OFFSET4_BEACON_RSSI_HIGH_SET(x) (((x) << 24) & 0x3f000000) - -/* macros for RX_PRIORITY_OFFSET5 */ -#define RX_PRIORITY_OFFSET5_ADDRESS 0x00008660 -#define RX_PRIORITY_OFFSET5_OFFSET 0x00008660 -#define RX_PRIORITY_OFFSET5_NULL_RSSI_HIGH_MSB 5 -#define RX_PRIORITY_OFFSET5_NULL_RSSI_HIGH_LSB 0 -#define RX_PRIORITY_OFFSET5_NULL_RSSI_HIGH_MASK 0x0000003f -#define RX_PRIORITY_OFFSET5_NULL_RSSI_HIGH_GET(x) (((x) & 0x0000003f) >> 0) -#define RX_PRIORITY_OFFSET5_NULL_RSSI_HIGH_SET(x) (((x) << 0) & 0x0000003f) -#define RX_PRIORITY_OFFSET5_PREQ_RSSI_HIGH_MSB 11 -#define RX_PRIORITY_OFFSET5_PREQ_RSSI_HIGH_LSB 6 -#define RX_PRIORITY_OFFSET5_PREQ_RSSI_HIGH_MASK 0x00000fc0 -#define RX_PRIORITY_OFFSET5_PREQ_RSSI_HIGH_GET(x) (((x) & 0x00000fc0) >> 6) -#define RX_PRIORITY_OFFSET5_PREQ_RSSI_HIGH_SET(x) (((x) << 6) & 0x00000fc0) -#define RX_PRIORITY_OFFSET5_PS_POLL_RSSI_HIGH_MSB 17 -#define RX_PRIORITY_OFFSET5_PS_POLL_RSSI_HIGH_LSB 12 -#define RX_PRIORITY_OFFSET5_PS_POLL_RSSI_HIGH_MASK 0x0003f000 -#define RX_PRIORITY_OFFSET5_PS_POLL_RSSI_HIGH_GET(x) (((x) & 0x0003f000) >> 12) -#define RX_PRIORITY_OFFSET5_PS_POLL_RSSI_HIGH_SET(x) (((x) << 12) & 0x0003f000) - -/* macros for MAC_PCU_LAST_BEACON2_TSF */ -#define MAC_PCU_LAST_BEACON2_TSF_ADDRESS 0x00008664 -#define MAC_PCU_LAST_BEACON2_TSF_OFFSET 0x00008664 -#define MAC_PCU_LAST_BEACON2_TSF_VALUE_MSB 31 -#define MAC_PCU_LAST_BEACON2_TSF_VALUE_LSB 0 -#define MAC_PCU_LAST_BEACON2_TSF_VALUE_MASK 0xffffffff -#define MAC_PCU_LAST_BEACON2_TSF_VALUE_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_PCU_PHY_ERROR_AIFS */ -#define MAC_PCU_PHY_ERROR_AIFS_ADDRESS 0x00008668 -#define MAC_PCU_PHY_ERROR_AIFS_OFFSET 0x00008668 -#define MAC_PCU_PHY_ERROR_AIFS_MASK_ENABLE_MSB 0 -#define MAC_PCU_PHY_ERROR_AIFS_MASK_ENABLE_LSB 0 -#define MAC_PCU_PHY_ERROR_AIFS_MASK_ENABLE_MASK 0x00000001 -#define MAC_PCU_PHY_ERROR_AIFS_MASK_ENABLE_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_PHY_ERROR_AIFS_MASK_ENABLE_SET(x) (((x) << 0) & 0x00000001) - -/* macros for MAC_PCU_PHY_ERROR_AIFS_MASK */ -#define MAC_PCU_PHY_ERROR_AIFS_MASK_ADDRESS 0x0000866c -#define MAC_PCU_PHY_ERROR_AIFS_MASK_OFFSET 0x0000866c -#define MAC_PCU_PHY_ERROR_AIFS_MASK_VALUE_MSB 31 -#define MAC_PCU_PHY_ERROR_AIFS_MASK_VALUE_LSB 0 -#define MAC_PCU_PHY_ERROR_AIFS_MASK_VALUE_MASK 0xffffffff -#define MAC_PCU_PHY_ERROR_AIFS_MASK_VALUE_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_PHY_ERROR_AIFS_MASK_VALUE_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_FILTER_RSSI_AVE */ -#define MAC_PCU_FILTER_RSSI_AVE_ADDRESS 0x00008670 -#define MAC_PCU_FILTER_RSSI_AVE_OFFSET 0x00008670 -#define MAC_PCU_FILTER_RSSI_AVE_AVE_VALUE_MSB 7 -#define MAC_PCU_FILTER_RSSI_AVE_AVE_VALUE_LSB 0 -#define MAC_PCU_FILTER_RSSI_AVE_AVE_VALUE_MASK 0x000000ff -#define MAC_PCU_FILTER_RSSI_AVE_AVE_VALUE_GET(x) (((x) & 0x000000ff) >> 0) -#define MAC_PCU_FILTER_RSSI_AVE_AVE_VALUE_SET(x) (((x) << 0) & 0x000000ff) -#define MAC_PCU_FILTER_RSSI_AVE_NUM_FRAMES_EXPONENT_MSB 10 -#define MAC_PCU_FILTER_RSSI_AVE_NUM_FRAMES_EXPONENT_LSB 8 -#define MAC_PCU_FILTER_RSSI_AVE_NUM_FRAMES_EXPONENT_MASK 0x00000700 -#define MAC_PCU_FILTER_RSSI_AVE_NUM_FRAMES_EXPONENT_GET(x) (((x) & 0x00000700) >> 8) -#define MAC_PCU_FILTER_RSSI_AVE_NUM_FRAMES_EXPONENT_SET(x) (((x) << 8) & 0x00000700) -#define MAC_PCU_FILTER_RSSI_AVE_ENABLE_MSB 11 -#define MAC_PCU_FILTER_RSSI_AVE_ENABLE_LSB 11 -#define MAC_PCU_FILTER_RSSI_AVE_ENABLE_MASK 0x00000800 -#define MAC_PCU_FILTER_RSSI_AVE_ENABLE_GET(x) (((x) & 0x00000800) >> 11) -#define MAC_PCU_FILTER_RSSI_AVE_ENABLE_SET(x) (((x) << 11) & 0x00000800) -#define MAC_PCU_FILTER_RSSI_AVE_RESET_MSB 12 -#define MAC_PCU_FILTER_RSSI_AVE_RESET_LSB 12 -#define MAC_PCU_FILTER_RSSI_AVE_RESET_MASK 0x00001000 -#define MAC_PCU_FILTER_RSSI_AVE_RESET_GET(x) (((x) & 0x00001000) >> 12) -#define MAC_PCU_FILTER_RSSI_AVE_RESET_SET(x) (((x) << 12) & 0x00001000) - -/* macros for MAC_PCU_TBD_FILTER */ -#define MAC_PCU_TBD_FILTER_ADDRESS 0x00008674 -#define MAC_PCU_TBD_FILTER_OFFSET 0x00008674 -#define MAC_PCU_TBD_FILTER_USE_WBTIMER_TX_TS_MSB 0 -#define MAC_PCU_TBD_FILTER_USE_WBTIMER_TX_TS_LSB 0 -#define MAC_PCU_TBD_FILTER_USE_WBTIMER_TX_TS_MASK 0x00000001 -#define MAC_PCU_TBD_FILTER_USE_WBTIMER_TX_TS_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_PCU_TBD_FILTER_USE_WBTIMER_TX_TS_SET(x) (((x) << 0) & 0x00000001) -#define MAC_PCU_TBD_FILTER_USE_WBTIMER_RX_TS_MSB 1 -#define MAC_PCU_TBD_FILTER_USE_WBTIMER_RX_TS_LSB 1 -#define MAC_PCU_TBD_FILTER_USE_WBTIMER_RX_TS_MASK 0x00000002 -#define MAC_PCU_TBD_FILTER_USE_WBTIMER_RX_TS_GET(x) (((x) & 0x00000002) >> 1) -#define MAC_PCU_TBD_FILTER_USE_WBTIMER_RX_TS_SET(x) (((x) << 1) & 0x00000002) - -/* macros for MAC_PCU_BT_ANT_SLEEP_EXTEND */ -#define MAC_PCU_BT_ANT_SLEEP_EXTEND_ADDRESS 0x00008678 -#define MAC_PCU_BT_ANT_SLEEP_EXTEND_OFFSET 0x00008678 -#define MAC_PCU_BT_ANT_SLEEP_EXTEND_CNT_MSB 15 -#define MAC_PCU_BT_ANT_SLEEP_EXTEND_CNT_LSB 0 -#define MAC_PCU_BT_ANT_SLEEP_EXTEND_CNT_MASK 0x0000ffff -#define MAC_PCU_BT_ANT_SLEEP_EXTEND_CNT_GET(x) (((x) & 0x0000ffff) >> 0) -#define MAC_PCU_BT_ANT_SLEEP_EXTEND_CNT_SET(x) (((x) << 0) & 0x0000ffff) - -/* macros for MAC_PCU_KEY_CACHE */ -#define MAC_PCU_KEY_CACHE_ADDRESS 0x00008800 -#define MAC_PCU_KEY_CACHE_OFFSET 0x00008800 -#define MAC_PCU_KEY_CACHE_DATA_MSB 31 -#define MAC_PCU_KEY_CACHE_DATA_LSB 0 -#define MAC_PCU_KEY_CACHE_DATA_MASK 0xffffffff -#define MAC_PCU_KEY_CACHE_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_KEY_CACHE_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_PCU_BUF */ -#define MAC_PCU_BUF_ADDRESS 0x0000e000 -#define MAC_PCU_BUF_OFFSET 0x0000e000 -#define MAC_PCU_BUF_DATA_MSB 31 -#define MAC_PCU_BUF_DATA_LSB 0 -#define MAC_PCU_BUF_DATA_MASK 0xffffffff -#define MAC_PCU_BUF_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_PCU_BUF_DATA_SET(x) (((x) << 0) & 0xffffffff) - - -#ifndef __ASSEMBLER__ - -typedef struct wmac_pcu_reg_reg_s { - volatile char pad__0[0x8000]; /* 0x0 - 0x8000 */ - volatile unsigned int MAC_PCU_STA_ADDR_L32; /* 0x8000 - 0x8004 */ - volatile unsigned int MAC_PCU_STA_ADDR_U16; /* 0x8004 - 0x8008 */ - volatile unsigned int MAC_PCU_BSSID_L32; /* 0x8008 - 0x800c */ - volatile unsigned int MAC_PCU_BSSID_U16; /* 0x800c - 0x8010 */ - volatile unsigned int MAC_PCU_BCN_RSSI_AVE; /* 0x8010 - 0x8014 */ - volatile unsigned int MAC_PCU_ACK_CTS_TIMEOUT; /* 0x8014 - 0x8018 */ - volatile unsigned int MAC_PCU_BCN_RSSI_CTL; /* 0x8018 - 0x801c */ - volatile unsigned int MAC_PCU_USEC_LATENCY; /* 0x801c - 0x8020 */ - volatile unsigned int MAC_PCU_BCN_RSSI_CTL2; /* 0x8020 - 0x8024 */ - volatile unsigned int MAC_PCU_BT_WL_1; /* 0x8024 - 0x8028 */ - volatile unsigned int MAC_PCU_BT_WL_2; /* 0x8028 - 0x802c */ - volatile unsigned int MAC_PCU_BT_WL_3; /* 0x802c - 0x8030 */ - volatile unsigned int MAC_PCU_BT_WL_4; /* 0x8030 - 0x8034 */ - volatile unsigned int MAC_PCU_COEX_EPTA; /* 0x8034 - 0x8038 */ - volatile unsigned int MAC_PCU_MAX_CFP_DUR; /* 0x8038 - 0x803c */ - volatile unsigned int MAC_PCU_RX_FILTER; /* 0x803c - 0x8040 */ - volatile unsigned int MAC_PCU_MCAST_FILTER_L32; /* 0x8040 - 0x8044 */ - volatile unsigned int MAC_PCU_MCAST_FILTER_U32; /* 0x8044 - 0x8048 */ - volatile unsigned int MAC_PCU_DIAG_SW; /* 0x8048 - 0x804c */ - volatile char pad__1[0x8]; /* 0x804c - 0x8054 */ - volatile unsigned int MAC_PCU_TST_ADDAC; /* 0x8054 - 0x8058 */ - volatile unsigned int MAC_PCU_DEF_ANTENNA; /* 0x8058 - 0x805c */ - volatile unsigned int MAC_PCU_AES_MUTE_MASK_0; /* 0x805c - 0x8060 */ - volatile unsigned int MAC_PCU_AES_MUTE_MASK_1; /* 0x8060 - 0x8064 */ - volatile unsigned int MAC_PCU_GATED_CLKS; /* 0x8064 - 0x8068 */ - volatile unsigned int MAC_PCU_OBS_BUS_2; /* 0x8068 - 0x806c */ - volatile unsigned int MAC_PCU_OBS_BUS_1; /* 0x806c - 0x8070 */ - volatile unsigned int MAC_PCU_DYM_MIMO_PWR_SAVE; /* 0x8070 - 0x8074 */ - volatile char pad__2[0xc]; /* 0x8074 - 0x8080 */ - volatile unsigned int MAC_PCU_LAST_BEACON_TSF; /* 0x8080 - 0x8084 */ - volatile unsigned int MAC_PCU_NAV; /* 0x8084 - 0x8088 */ - volatile unsigned int MAC_PCU_RTS_SUCCESS_CNT; /* 0x8088 - 0x808c */ - volatile unsigned int MAC_PCU_RTS_FAIL_CNT; /* 0x808c - 0x8090 */ - volatile unsigned int MAC_PCU_ACK_FAIL_CNT; /* 0x8090 - 0x8094 */ - volatile unsigned int MAC_PCU_FCS_FAIL_CNT; /* 0x8094 - 0x8098 */ - volatile unsigned int MAC_PCU_BEACON_CNT; /* 0x8098 - 0x809c */ - volatile unsigned int MAC_PCU_BEACON2_CNT; /* 0x809c - 0x80a0 */ - volatile unsigned int MAC_PCU_BASIC_SET; /* 0x80a0 - 0x80a4 */ - volatile unsigned int MAC_PCU_MGMT_SEQ; /* 0x80a4 - 0x80a8 */ - volatile unsigned int MAC_PCU_BF_RPT1; /* 0x80a8 - 0x80ac */ - volatile unsigned int MAC_PCU_BF_RPT2; /* 0x80ac - 0x80b0 */ - volatile unsigned int MAC_PCU_TX_ANT_1; /* 0x80b0 - 0x80b4 */ - volatile unsigned int MAC_PCU_TX_ANT_2; /* 0x80b4 - 0x80b8 */ - volatile unsigned int MAC_PCU_TX_ANT_3; /* 0x80b8 - 0x80bc */ - volatile unsigned int MAC_PCU_TX_ANT_4; /* 0x80bc - 0x80c0 */ - volatile unsigned int MAC_PCU_XRMODE; /* 0x80c0 - 0x80c4 */ - volatile unsigned int MAC_PCU_XRDEL; /* 0x80c4 - 0x80c8 */ - volatile unsigned int MAC_PCU_XRTO; /* 0x80c8 - 0x80cc */ - volatile unsigned int MAC_PCU_XRCRP; /* 0x80cc - 0x80d0 */ - volatile unsigned int MAC_PCU_XRSTMP; /* 0x80d0 - 0x80d4 */ - volatile char pad__3[0x8]; /* 0x80d4 - 0x80dc */ - volatile unsigned int MAC_PCU_SELF_GEN_DEFAULT; /* 0x80dc - 0x80e0 */ - volatile unsigned int MAC_PCU_ADDR1_MASK_L32; /* 0x80e0 - 0x80e4 */ - volatile unsigned int MAC_PCU_ADDR1_MASK_U16; /* 0x80e4 - 0x80e8 */ - volatile unsigned int MAC_PCU_TPC; /* 0x80e8 - 0x80ec */ - volatile unsigned int MAC_PCU_TX_FRAME_CNT; /* 0x80ec - 0x80f0 */ - volatile unsigned int MAC_PCU_RX_FRAME_CNT; /* 0x80f0 - 0x80f4 */ - volatile unsigned int MAC_PCU_RX_CLEAR_CNT; /* 0x80f4 - 0x80f8 */ - volatile unsigned int MAC_PCU_CYCLE_CNT; /* 0x80f8 - 0x80fc */ - volatile unsigned int MAC_PCU_QUIET_TIME_1; /* 0x80fc - 0x8100 */ - volatile unsigned int MAC_PCU_QUIET_TIME_2; /* 0x8100 - 0x8104 */ - volatile char pad__4[0x4]; /* 0x8104 - 0x8108 */ - volatile unsigned int MAC_PCU_QOS_NO_ACK; /* 0x8108 - 0x810c */ - volatile unsigned int MAC_PCU_PHY_ERROR_MASK; /* 0x810c - 0x8110 */ - volatile unsigned int MAC_PCU_XRLAT; /* 0x8110 - 0x8114 */ - volatile unsigned int MAC_PCU_RXBUF; /* 0x8114 - 0x8118 */ - volatile unsigned int MAC_PCU_MIC_QOS_CONTROL; /* 0x8118 - 0x811c */ - volatile unsigned int MAC_PCU_MIC_QOS_SELECT; /* 0x811c - 0x8120 */ - volatile unsigned int MAC_PCU_MISC_MODE; /* 0x8120 - 0x8124 */ - volatile unsigned int MAC_PCU_FILTER_OFDM_CNT; /* 0x8124 - 0x8128 */ - volatile unsigned int MAC_PCU_FILTER_CCK_CNT; /* 0x8128 - 0x812c */ - volatile unsigned int MAC_PCU_PHY_ERR_CNT_1; /* 0x812c - 0x8130 */ - volatile unsigned int MAC_PCU_PHY_ERR_CNT_1_MASK; /* 0x8130 - 0x8134 */ - volatile unsigned int MAC_PCU_PHY_ERR_CNT_2; /* 0x8134 - 0x8138 */ - volatile unsigned int MAC_PCU_PHY_ERR_CNT_2_MASK; /* 0x8138 - 0x813c */ - volatile char pad__5[0x8]; /* 0x813c - 0x8144 */ - volatile unsigned int MAC_PCU_PHY_ERROR_EIFS_MASK; /* 0x8144 - 0x8148 */ - volatile char pad__6[0x8]; /* 0x8148 - 0x8150 */ - volatile unsigned int MAC_PCU_COEX_LNAMAXGAIN1; /* 0x8150 - 0x8154 */ - volatile unsigned int MAC_PCU_COEX_LNAMAXGAIN2; /* 0x8154 - 0x8158 */ - volatile unsigned int MAC_PCU_COEX_LNAMAXGAIN3; /* 0x8158 - 0x815c */ - volatile unsigned int MAC_PCU_COEX_LNAMAXGAIN4; /* 0x815c - 0x8160 */ - volatile char pad__7[0x8]; /* 0x8160 - 0x8168 */ - volatile unsigned int MAC_PCU_PHY_ERR_CNT_3; /* 0x8168 - 0x816c */ - volatile unsigned int MAC_PCU_PHY_ERR_CNT_3_MASK; /* 0x816c - 0x8170 */ - volatile unsigned int MAC_PCU_BLUETOOTH_MODE; /* 0x8170 - 0x8174 */ - volatile char pad__8[0x4]; /* 0x8174 - 0x8178 */ - volatile unsigned int MAC_PCU_HCF_TIMEOUT; /* 0x8178 - 0x817c */ - volatile unsigned int MAC_PCU_BLUETOOTH_MODE2; /* 0x817c - 0x8180 */ - volatile char pad__9[0x48]; /* 0x8180 - 0x81c8 */ - volatile unsigned int MAC_PCU_BLUETOOTH_TSF_BT_ACTIVE; /* 0x81c8 - 0x81cc */ - volatile unsigned int MAC_PCU_BLUETOOTH_TSF_BT_PRIORITY; /* 0x81cc - 0x81d0 */ - volatile unsigned int MAC_PCU_TXSIFS; /* 0x81d0 - 0x81d4 */ - volatile unsigned int MAC_PCU_BLUETOOTH_MODE3; /* 0x81d4 - 0x81d8 */ - volatile unsigned int MAC_PCU_BLUETOOTH_MODE4; /* 0x81d8 - 0x81dc */ - volatile unsigned int MAC_PCU_BLUETOOTH_MODE5; /* 0x81dc - 0x81e0 */ - volatile unsigned int MAC_PCU_BLUETOOTH_WEIGHTS; /* 0x81e0 - 0x81e4 */ - volatile unsigned int MAC_PCU_BT_BT_ASYNC; /* 0x81e4 - 0x81e8 */ - volatile char pad__10[0x4]; /* 0x81e8 - 0x81ec */ - volatile unsigned int MAC_PCU_TXOP_X; /* 0x81ec - 0x81f0 */ - volatile unsigned int MAC_PCU_TXOP_0_3; /* 0x81f0 - 0x81f4 */ - volatile unsigned int MAC_PCU_TXOP_4_7; /* 0x81f4 - 0x81f8 */ - volatile unsigned int MAC_PCU_TXOP_8_11; /* 0x81f8 - 0x81fc */ - volatile unsigned int MAC_PCU_TXOP_12_15; /* 0x81fc - 0x8200 */ - volatile unsigned int MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_LSB; /* 0x8200 - 0x8204 */ - volatile unsigned int MAC_PCU_TDMA_TXFRAME_START_TIME_TRIGGER_MSB; /* 0x8204 - 0x8208 */ - volatile unsigned int MAC_PCU_TDMA_SLOT_ALERT_CNTL; /* 0x8208 - 0x820c */ - volatile char pad__11[0x50]; /* 0x820c - 0x825c */ - volatile unsigned int MAC_PCU_WOW1; /* 0x825c - 0x8260 */ - volatile unsigned int MAC_PCU_WOW2; /* 0x8260 - 0x8264 */ - volatile unsigned int MAC_PCU_LOGIC_ANALYZER; /* 0x8264 - 0x8268 */ - volatile unsigned int MAC_PCU_LOGIC_ANALYZER_32L; /* 0x8268 - 0x826c */ - volatile unsigned int MAC_PCU_LOGIC_ANALYZER_16U; /* 0x826c - 0x8270 */ - volatile unsigned int MAC_PCU_WOW3_BEACON_FAIL; /* 0x8270 - 0x8274 */ - volatile unsigned int MAC_PCU_WOW3_BEACON; /* 0x8274 - 0x8278 */ - volatile unsigned int MAC_PCU_WOW3_KEEP_ALIVE; /* 0x8278 - 0x827c */ - volatile unsigned int MAC_PCU_WOW_KA; /* 0x827c - 0x8280 */ - volatile char pad__12[0x4]; /* 0x8280 - 0x8284 */ - volatile unsigned int PCU_1US; /* 0x8284 - 0x8288 */ - volatile unsigned int PCU_KA; /* 0x8288 - 0x828c */ - volatile unsigned int WOW_EXACT; /* 0x828c - 0x8290 */ - volatile char pad__13[0x4]; /* 0x8290 - 0x8294 */ - volatile unsigned int PCU_WOW4; /* 0x8294 - 0x8298 */ - volatile unsigned int PCU_WOW5; /* 0x8298 - 0x829c */ - volatile unsigned int MAC_PCU_PHY_ERR_CNT_MASK_CONT; /* 0x829c - 0x82a0 */ - volatile char pad__14[0x60]; /* 0x82a0 - 0x8300 */ - volatile unsigned int MAC_PCU_AZIMUTH_MODE; /* 0x8300 - 0x8304 */ - volatile char pad__15[0x10]; /* 0x8304 - 0x8314 */ - volatile unsigned int MAC_PCU_AZIMUTH_TIME_STAMP; /* 0x8314 - 0x8318 */ - volatile unsigned int MAC_PCU_20_40_MODE; /* 0x8318 - 0x831c */ - volatile unsigned int MAC_PCU_H_XFER_TIMEOUT; /* 0x831c - 0x8320 */ - volatile char pad__16[0x8]; /* 0x8320 - 0x8328 */ - volatile unsigned int MAC_PCU_RX_CLEAR_DIFF_CNT; /* 0x8328 - 0x832c */ - volatile unsigned int MAC_PCU_SELF_GEN_ANTENNA_MASK; /* 0x832c - 0x8330 */ - volatile unsigned int MAC_PCU_BA_BAR_CONTROL; /* 0x8330 - 0x8334 */ - volatile unsigned int MAC_PCU_LEGACY_PLCP_SPOOF; /* 0x8334 - 0x8338 */ - volatile unsigned int MAC_PCU_PHY_ERROR_MASK_CONT; /* 0x8338 - 0x833c */ - volatile unsigned int MAC_PCU_TX_TIMER; /* 0x833c - 0x8340 */ - volatile unsigned int MAC_PCU_TXBUF_CTRL; /* 0x8340 - 0x8344 */ - volatile unsigned int MAC_PCU_MISC_MODE2; /* 0x8344 - 0x8348 */ - volatile unsigned int MAC_PCU_ALT_AES_MUTE_MASK; /* 0x8348 - 0x834c */ - volatile unsigned int MAC_PCU_WOW6; /* 0x834c - 0x8350 */ - volatile unsigned int ASYNC_FIFO_REG1; /* 0x8350 - 0x8354 */ - volatile unsigned int ASYNC_FIFO_REG2; /* 0x8354 - 0x8358 */ - volatile unsigned int ASYNC_FIFO_REG3; /* 0x8358 - 0x835c */ - volatile unsigned int MAC_PCU_WOW5; /* 0x835c - 0x8360 */ - volatile unsigned int MAC_PCU_WOW_LENGTH1; /* 0x8360 - 0x8364 */ - volatile unsigned int MAC_PCU_WOW_LENGTH2; /* 0x8364 - 0x8368 */ - volatile unsigned int WOW_PATTERN_MATCH_LESS_THAN_256_BYTES; /* 0x8368 - 0x836c */ - volatile char pad__17[0x4]; /* 0x836c - 0x8370 */ - volatile unsigned int MAC_PCU_WOW4; /* 0x8370 - 0x8374 */ - volatile unsigned int WOW2_EXACT; /* 0x8374 - 0x8378 */ - volatile unsigned int PCU_WOW6; /* 0x8378 - 0x837c */ - volatile unsigned int PCU_WOW7; /* 0x837c - 0x8380 */ - volatile unsigned int MAC_PCU_WOW_LENGTH3; /* 0x8380 - 0x8384 */ - volatile unsigned int MAC_PCU_WOW_LENGTH4; /* 0x8384 - 0x8388 */ - volatile unsigned int MAC_PCU_LOCATION_MODE_CONTROL; /* 0x8388 - 0x838c */ - volatile unsigned int MAC_PCU_LOCATION_MODE_TIMER; /* 0x838c - 0x8390 */ - volatile char pad__18[0x8]; /* 0x8390 - 0x8398 */ - volatile unsigned int MAC_PCU_BSSID2_L32; /* 0x8398 - 0x839c */ - volatile unsigned int MAC_PCU_BSSID2_U16; /* 0x839c - 0x83a0 */ - volatile unsigned int MAC_PCU_DIRECT_CONNECT; /* 0x83a0 - 0x83a4 */ - volatile unsigned int MAC_PCU_TID_TO_AC; /* 0x83a4 - 0x83a8 */ - volatile unsigned int MAC_PCU_HP_QUEUE; /* 0x83a8 - 0x83ac */ - volatile char pad__19[0x10]; /* 0x83ac - 0x83bc */ - volatile unsigned int MAC_PCU_AGC_SATURATION_CNT0; /* 0x83bc - 0x83c0 */ - volatile unsigned int MAC_PCU_AGC_SATURATION_CNT1; /* 0x83c0 - 0x83c4 */ - volatile unsigned int MAC_PCU_AGC_SATURATION_CNT2; /* 0x83c4 - 0x83c8 */ - volatile unsigned int MAC_PCU_HW_BCN_PROC1; /* 0x83c8 - 0x83cc */ - volatile unsigned int MAC_PCU_HW_BCN_PROC2; /* 0x83cc - 0x83d0 */ - volatile unsigned int MAC_PCU_MISC_MODE3; /* 0x83d0 - 0x83d4 */ - volatile unsigned int MAC_PCU_MISC_MODE4; /* 0x83d4 - 0x83d8 */ - volatile char pad__20[0x4]; /* 0x83d8 - 0x83dc */ - volatile unsigned int MAC_PCU_PS_FILTER; /* 0x83dc - 0x83e0 */ - volatile unsigned int MAC_PCU_BASIC_RATE_SET0; /* 0x83e0 - 0x83e4 */ - volatile unsigned int MAC_PCU_BASIC_RATE_SET1; /* 0x83e4 - 0x83e8 */ - volatile unsigned int MAC_PCU_BASIC_RATE_SET2; /* 0x83e8 - 0x83ec */ - volatile unsigned int MAC_PCU_BASIC_RATE_SET3; /* 0x83ec - 0x83f0 */ - volatile char pad__21[0x10]; /* 0x83f0 - 0x8400 */ - volatile unsigned int MAC_PCU_TXBUF_BA[64]; /* 0x8400 - 0x8500 */ - volatile unsigned int MAC_PCU_BT_BT[64]; /* 0x8500 - 0x8600 */ - volatile unsigned int MAC_PCU_RX_INT_STATUS0; /* 0x8600 - 0x8604 */ - volatile unsigned int MAC_PCU_RX_INT_STATUS1; /* 0x8604 - 0x8608 */ - volatile unsigned int MAC_PCU_RX_INT_STATUS2; /* 0x8608 - 0x860c */ - volatile unsigned int MAC_PCU_RX_INT_STATUS3; /* 0x860c - 0x8610 */ - volatile unsigned int HT_HALF_GI_RATE1; /* 0x8610 - 0x8614 */ - volatile unsigned int HT_HALF_GI_RATE2; /* 0x8614 - 0x8618 */ - volatile unsigned int HT_FULL_GI_RATE1; /* 0x8618 - 0x861c */ - volatile unsigned int HT_FULL_GI_RATE2; /* 0x861c - 0x8620 */ - volatile unsigned int LEGACY_RATE1; /* 0x8620 - 0x8624 */ - volatile unsigned int LEGACY_RATE2; /* 0x8624 - 0x8628 */ - volatile unsigned int LEGACY_RATE3; /* 0x8628 - 0x862c */ - volatile unsigned int RX_INT_FILTER; /* 0x862c - 0x8630 */ - volatile unsigned int RX_INT_OVERFLOW; /* 0x8630 - 0x8634 */ - volatile unsigned int RX_FILTER_THRESH0; /* 0x8634 - 0x8638 */ - volatile unsigned int RX_FILTER_THRESH1; /* 0x8638 - 0x863c */ - volatile unsigned int RX_PRIORITY_THRESH0; /* 0x863c - 0x8640 */ - volatile unsigned int RX_PRIORITY_THRESH1; /* 0x8640 - 0x8644 */ - volatile unsigned int RX_PRIORITY_THRESH2; /* 0x8644 - 0x8648 */ - volatile unsigned int RX_PRIORITY_THRESH3; /* 0x8648 - 0x864c */ - volatile unsigned int RX_PRIORITY_OFFSET0; /* 0x864c - 0x8650 */ - volatile unsigned int RX_PRIORITY_OFFSET1; /* 0x8650 - 0x8654 */ - volatile unsigned int RX_PRIORITY_OFFSET2; /* 0x8654 - 0x8658 */ - volatile unsigned int RX_PRIORITY_OFFSET3; /* 0x8658 - 0x865c */ - volatile unsigned int RX_PRIORITY_OFFSET4; /* 0x865c - 0x8660 */ - volatile unsigned int RX_PRIORITY_OFFSET5; /* 0x8660 - 0x8664 */ - volatile unsigned int MAC_PCU_LAST_BEACON2_TSF; /* 0x8664 - 0x8668 */ - volatile unsigned int MAC_PCU_PHY_ERROR_AIFS; /* 0x8668 - 0x866c */ - volatile unsigned int MAC_PCU_PHY_ERROR_AIFS_MASK; /* 0x866c - 0x8670 */ - volatile unsigned int MAC_PCU_FILTER_RSSI_AVE; /* 0x8670 - 0x8674 */ - volatile unsigned int MAC_PCU_TBD_FILTER; /* 0x8674 - 0x8678 */ - volatile unsigned int MAC_PCU_BT_ANT_SLEEP_EXTEND; /* 0x8678 - 0x867c */ - volatile char pad__22[0x184]; /* 0x867c - 0x8800 */ - volatile unsigned int MAC_PCU_KEY_CACHE[512]; /* 0x8800 - 0x9000 */ - volatile char pad__23[0x5000]; /* 0x9000 - 0xe000 */ - volatile unsigned int MAC_PCU_BUF[2048]; /* 0xe000 - 0x10000 */ -} wmac_pcu_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _WMAC_PCU_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_qcu_reg.h b/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_qcu_reg.h deleted file mode 100644 index c722dcdfaf3a..000000000000 --- a/drivers/net/wireless/ar6003/include/AR6002/hw6.0/hw/wmac_qcu_reg.h +++ /dev/null @@ -1,251 +0,0 @@ -// ------------------------------------------------------------------ -// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -// ------------------------------------------------------------------ -//=================================================================== -// Author(s): ="Atheros" -//=================================================================== - -/* Copyright (C) 2010 Denali Software Inc. All rights reserved */ -/* THIS FILE IS AUTOMATICALLY GENERATED BY DENALI BLUEPRINT, DO NOT EDIT */ - - -#ifndef _WMAC_QCU_REG_REG_H_ -#define _WMAC_QCU_REG_REG_H_ - - -/* macros for MAC_QCU_TXDP */ -#define MAC_QCU_TXDP_ADDRESS 0x00000800 -#define MAC_QCU_TXDP_OFFSET 0x00000800 -#define MAC_QCU_TXDP_DATA_MSB 31 -#define MAC_QCU_TXDP_DATA_LSB 0 -#define MAC_QCU_TXDP_DATA_MASK 0xffffffff -#define MAC_QCU_TXDP_DATA_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_QCU_TXDP_DATA_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_QCU_STATUS_RING_START */ -#define MAC_QCU_STATUS_RING_START_ADDRESS 0x00000830 -#define MAC_QCU_STATUS_RING_START_OFFSET 0x00000830 -#define MAC_QCU_STATUS_RING_START_ADDR_MSB 31 -#define MAC_QCU_STATUS_RING_START_ADDR_LSB 0 -#define MAC_QCU_STATUS_RING_START_ADDR_MASK 0xffffffff -#define MAC_QCU_STATUS_RING_START_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_QCU_STATUS_RING_START_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_QCU_STATUS_RING_END */ -#define MAC_QCU_STATUS_RING_END_ADDRESS 0x00000834 -#define MAC_QCU_STATUS_RING_END_OFFSET 0x00000834 -#define MAC_QCU_STATUS_RING_END_ADDR_MSB 31 -#define MAC_QCU_STATUS_RING_END_ADDR_LSB 0 -#define MAC_QCU_STATUS_RING_END_ADDR_MASK 0xffffffff -#define MAC_QCU_STATUS_RING_END_ADDR_GET(x) (((x) & 0xffffffff) >> 0) -#define MAC_QCU_STATUS_RING_END_ADDR_SET(x) (((x) << 0) & 0xffffffff) - -/* macros for MAC_QCU_STATUS_RING_CURRENT */ -#define MAC_QCU_STATUS_RING_CURRENT_ADDRESS 0x00000838 -#define MAC_QCU_STATUS_RING_CURRENT_OFFSET 0x00000838 -#define MAC_QCU_STATUS_RING_CURRENT_ADDRESS_MSB 31 -#define MAC_QCU_STATUS_RING_CURRENT_ADDRESS_LSB 0 -#define MAC_QCU_STATUS_RING_CURRENT_ADDRESS_MASK 0xffffffff -#define MAC_QCU_STATUS_RING_CURRENT_ADDRESS_GET(x) (((x) & 0xffffffff) >> 0) - -/* macros for MAC_QCU_TXE */ -#define MAC_QCU_TXE_ADDRESS 0x00000840 -#define MAC_QCU_TXE_OFFSET 0x00000840 -#define MAC_QCU_TXE_DATA_MSB 9 -#define MAC_QCU_TXE_DATA_LSB 0 -#define MAC_QCU_TXE_DATA_MASK 0x000003ff -#define MAC_QCU_TXE_DATA_GET(x) (((x) & 0x000003ff) >> 0) - -/* macros for MAC_QCU_TXD */ -#define MAC_QCU_TXD_ADDRESS 0x00000880 -#define MAC_QCU_TXD_OFFSET 0x00000880 -#define MAC_QCU_TXD_DATA_MSB 9 -#define MAC_QCU_TXD_DATA_LSB 0 -#define MAC_QCU_TXD_DATA_MASK 0x000003ff -#define MAC_QCU_TXD_DATA_GET(x) (((x) & 0x000003ff) >> 0) -#define MAC_QCU_TXD_DATA_SET(x) (((x) << 0) & 0x000003ff) - -/* macros for MAC_QCU_CBR */ -#define MAC_QCU_CBR_ADDRESS 0x000008c0 -#define MAC_QCU_CBR_OFFSET 0x000008c0 -#define MAC_QCU_CBR_INTERVAL_MSB 23 -#define MAC_QCU_CBR_INTERVAL_LSB 0 -#define MAC_QCU_CBR_INTERVAL_MASK 0x00ffffff -#define MAC_QCU_CBR_INTERVAL_GET(x) (((x) & 0x00ffffff) >> 0) -#define MAC_QCU_CBR_INTERVAL_SET(x) (((x) << 0) & 0x00ffffff) -#define MAC_QCU_CBR_OVF_THRESH_MSB 31 -#define MAC_QCU_CBR_OVF_THRESH_LSB 24 -#define MAC_QCU_CBR_OVF_THRESH_MASK 0xff000000 -#define MAC_QCU_CBR_OVF_THRESH_GET(x) (((x) & 0xff000000) >> 24) -#define MAC_QCU_CBR_OVF_THRESH_SET(x) (((x) << 24) & 0xff000000) - -/* macros for MAC_QCU_RDYTIME */ -#define MAC_QCU_RDYTIME_ADDRESS 0x00000900 -#define MAC_QCU_RDYTIME_OFFSET 0x00000900 -#define MAC_QCU_RDYTIME_DURATION_MSB 23 -#define MAC_QCU_RDYTIME_DURATION_LSB 0 -#define MAC_QCU_RDYTIME_DURATION_MASK 0x00ffffff -#define MAC_QCU_RDYTIME_DURATION_GET(x) (((x) & 0x00ffffff) >> 0) -#define MAC_QCU_RDYTIME_DURATION_SET(x) (((x) << 0) & 0x00ffffff) -#define MAC_QCU_RDYTIME_EN_MSB 24 -#define MAC_QCU_RDYTIME_EN_LSB 24 -#define MAC_QCU_RDYTIME_EN_MASK 0x01000000 -#define MAC_QCU_RDYTIME_EN_GET(x) (((x) & 0x01000000) >> 24) -#define MAC_QCU_RDYTIME_EN_SET(x) (((x) << 24) & 0x01000000) - -/* macros for MAC_QCU_ONESHOT_ARM_SC */ -#define MAC_QCU_ONESHOT_ARM_SC_ADDRESS 0x00000940 -#define MAC_QCU_ONESHOT_ARM_SC_OFFSET 0x00000940 -#define MAC_QCU_ONESHOT_ARM_SC_SET_MSB 9 -#define MAC_QCU_ONESHOT_ARM_SC_SET_LSB 0 -#define MAC_QCU_ONESHOT_ARM_SC_SET_MASK 0x000003ff -#define MAC_QCU_ONESHOT_ARM_SC_SET_GET(x) (((x) & 0x000003ff) >> 0) -#define MAC_QCU_ONESHOT_ARM_SC_SET_SET(x) (((x) << 0) & 0x000003ff) - -/* macros for MAC_QCU_ONESHOT_ARM_CC */ -#define MAC_QCU_ONESHOT_ARM_CC_ADDRESS 0x00000980 -#define MAC_QCU_ONESHOT_ARM_CC_OFFSET 0x00000980 -#define MAC_QCU_ONESHOT_ARM_CC_CLEAR_MSB 9 -#define MAC_QCU_ONESHOT_ARM_CC_CLEAR_LSB 0 -#define MAC_QCU_ONESHOT_ARM_CC_CLEAR_MASK 0x000003ff -#define MAC_QCU_ONESHOT_ARM_CC_CLEAR_GET(x) (((x) & 0x000003ff) >> 0) -#define MAC_QCU_ONESHOT_ARM_CC_CLEAR_SET(x) (((x) << 0) & 0x000003ff) - -/* macros for MAC_QCU_MISC */ -#define MAC_QCU_MISC_ADDRESS 0x000009c0 -#define MAC_QCU_MISC_OFFSET 0x000009c0 -#define MAC_QCU_MISC_FSP_MSB 3 -#define MAC_QCU_MISC_FSP_LSB 0 -#define MAC_QCU_MISC_FSP_MASK 0x0000000f -#define MAC_QCU_MISC_FSP_GET(x) (((x) & 0x0000000f) >> 0) -#define MAC_QCU_MISC_FSP_SET(x) (((x) << 0) & 0x0000000f) -#define MAC_QCU_MISC_ONESHOT_EN_MSB 4 -#define MAC_QCU_MISC_ONESHOT_EN_LSB 4 -#define MAC_QCU_MISC_ONESHOT_EN_MASK 0x00000010 -#define MAC_QCU_MISC_ONESHOT_EN_GET(x) (((x) & 0x00000010) >> 4) -#define MAC_QCU_MISC_ONESHOT_EN_SET(x) (((x) << 4) & 0x00000010) -#define MAC_QCU_MISC_CBR_EXP_INC_DIS_NOFR_MSB 5 -#define MAC_QCU_MISC_CBR_EXP_INC_DIS_NOFR_LSB 5 -#define MAC_QCU_MISC_CBR_EXP_INC_DIS_NOFR_MASK 0x00000020 -#define MAC_QCU_MISC_CBR_EXP_INC_DIS_NOFR_GET(x) (((x) & 0x00000020) >> 5) -#define MAC_QCU_MISC_CBR_EXP_INC_DIS_NOFR_SET(x) (((x) << 5) & 0x00000020) -#define MAC_QCU_MISC_CBR_EXP_INC_DIS_NOBCNFR_MSB 6 -#define MAC_QCU_MISC_CBR_EXP_INC_DIS_NOBCNFR_LSB 6 -#define MAC_QCU_MISC_CBR_EXP_INC_DIS_NOBCNFR_MASK 0x00000040 -#define MAC_QCU_MISC_CBR_EXP_INC_DIS_NOBCNFR_GET(x) (((x) & 0x00000040) >> 6) -#define MAC_QCU_MISC_CBR_EXP_INC_DIS_NOBCNFR_SET(x) (((x) << 6) & 0x00000040) -#define MAC_QCU_MISC_IS_BCN_MSB 7 -#define MAC_QCU_MISC_IS_BCN_LSB 7 -#define MAC_QCU_MISC_IS_BCN_MASK 0x00000080 -#define MAC_QCU_MISC_IS_BCN_GET(x) (((x) & 0x00000080) >> 7) -#define MAC_QCU_MISC_IS_BCN_SET(x) (((x) << 7) & 0x00000080) -#define MAC_QCU_MISC_CBR_EXP_INC_LIMIT_MSB 8 -#define MAC_QCU_MISC_CBR_EXP_INC_LIMIT_LSB 8 -#define MAC_QCU_MISC_CBR_EXP_INC_LIMIT_MASK 0x00000100 -#define MAC_QCU_MISC_CBR_EXP_INC_LIMIT_GET(x) (((x) & 0x00000100) >> 8) -#define MAC_QCU_MISC_CBR_EXP_INC_LIMIT_SET(x) (((x) << 8) & 0x00000100) -#define MAC_QCU_MISC_TXE_CLR_ON_CBR_END_MSB 9 -#define MAC_QCU_MISC_TXE_CLR_ON_CBR_END_LSB 9 -#define MAC_QCU_MISC_TXE_CLR_ON_CBR_END_MASK 0x00000200 -#define MAC_QCU_MISC_TXE_CLR_ON_CBR_END_GET(x) (((x) & 0x00000200) >> 9) -#define MAC_QCU_MISC_TXE_CLR_ON_CBR_END_SET(x) (((x) << 9) & 0x00000200) -#define MAC_QCU_MISC_MMR_CBR_EXP_CNT_CLR_EN_MSB 10 -#define MAC_QCU_MISC_MMR_CBR_EXP_CNT_CLR_EN_LSB 10 -#define MAC_QCU_MISC_MMR_CBR_EXP_CNT_CLR_EN_MASK 0x00000400 -#define MAC_QCU_MISC_MMR_CBR_EXP_CNT_CLR_EN_GET(x) (((x) & 0x00000400) >> 10) -#define MAC_QCU_MISC_MMR_CBR_EXP_CNT_CLR_EN_SET(x) (((x) << 10) & 0x00000400) -#define MAC_QCU_MISC_FR_ABORT_REQ_EN_MSB 11 -#define MAC_QCU_MISC_FR_ABORT_REQ_EN_LSB 11 -#define MAC_QCU_MISC_FR_ABORT_REQ_EN_MASK 0x00000800 -#define MAC_QCU_MISC_FR_ABORT_REQ_EN_GET(x) (((x) & 0x00000800) >> 11) -#define MAC_QCU_MISC_FR_ABORT_REQ_EN_SET(x) (((x) << 11) & 0x00000800) - -/* macros for MAC_QCU_CNT */ -#define MAC_QCU_CNT_ADDRESS 0x00000a00 -#define MAC_QCU_CNT_OFFSET 0x00000a00 -#define MAC_QCU_CNT_FR_PEND_MSB 1 -#define MAC_QCU_CNT_FR_PEND_LSB 0 -#define MAC_QCU_CNT_FR_PEND_MASK 0x00000003 -#define MAC_QCU_CNT_FR_PEND_GET(x) (((x) & 0x00000003) >> 0) -#define MAC_QCU_CNT_CBR_EXP_MSB 15 -#define MAC_QCU_CNT_CBR_EXP_LSB 8 -#define MAC_QCU_CNT_CBR_EXP_MASK 0x0000ff00 -#define MAC_QCU_CNT_CBR_EXP_GET(x) (((x) & 0x0000ff00) >> 8) - -/* macros for MAC_QCU_RDYTIME_SHDN */ -#define MAC_QCU_RDYTIME_SHDN_ADDRESS 0x00000a40 -#define MAC_QCU_RDYTIME_SHDN_OFFSET 0x00000a40 -#define MAC_QCU_RDYTIME_SHDN_SHUTDOWN_MSB 9 -#define MAC_QCU_RDYTIME_SHDN_SHUTDOWN_LSB 0 -#define MAC_QCU_RDYTIME_SHDN_SHUTDOWN_MASK 0x000003ff -#define MAC_QCU_RDYTIME_SHDN_SHUTDOWN_GET(x) (((x) & 0x000003ff) >> 0) -#define MAC_QCU_RDYTIME_SHDN_SHUTDOWN_SET(x) (((x) << 0) & 0x000003ff) - -/* macros for MAC_QCU_DESC_CRC_CHK */ -#define MAC_QCU_DESC_CRC_CHK_ADDRESS 0x00000a44 -#define MAC_QCU_DESC_CRC_CHK_OFFSET 0x00000a44 -#define MAC_QCU_DESC_CRC_CHK_EN_MSB 0 -#define MAC_QCU_DESC_CRC_CHK_EN_LSB 0 -#define MAC_QCU_DESC_CRC_CHK_EN_MASK 0x00000001 -#define MAC_QCU_DESC_CRC_CHK_EN_GET(x) (((x) & 0x00000001) >> 0) -#define MAC_QCU_DESC_CRC_CHK_EN_SET(x) (((x) << 0) & 0x00000001) - -/* macros for MAC_QCU_EOL */ -#define MAC_QCU_EOL_ADDRESS 0x00000a48 -#define MAC_QCU_EOL_OFFSET 0x00000a48 -#define MAC_QCU_EOL_DUR_CAL_EN_MSB 9 -#define MAC_QCU_EOL_DUR_CAL_EN_LSB 0 -#define MAC_QCU_EOL_DUR_CAL_EN_MASK 0x000003ff -#define MAC_QCU_EOL_DUR_CAL_EN_GET(x) (((x) & 0x000003ff) >> 0) -#define MAC_QCU_EOL_DUR_CAL_EN_SET(x) (((x) << 0) & 0x000003ff) - - -#ifndef __ASSEMBLER__ - -typedef struct wmac_qcu_reg_reg_s { - volatile char pad__0[0x800]; /* 0x0 - 0x800 */ - volatile unsigned int MAC_QCU_TXDP[10]; /* 0x800 - 0x828 */ - volatile char pad__1[0x8]; /* 0x828 - 0x830 */ - volatile unsigned int MAC_QCU_STATUS_RING_START; /* 0x830 - 0x834 */ - volatile unsigned int MAC_QCU_STATUS_RING_END; /* 0x834 - 0x838 */ - volatile unsigned int MAC_QCU_STATUS_RING_CURRENT; /* 0x838 - 0x83c */ - volatile char pad__2[0x4]; /* 0x83c - 0x840 */ - volatile unsigned int MAC_QCU_TXE; /* 0x840 - 0x844 */ - volatile char pad__3[0x3c]; /* 0x844 - 0x880 */ - volatile unsigned int MAC_QCU_TXD; /* 0x880 - 0x884 */ - volatile char pad__4[0x3c]; /* 0x884 - 0x8c0 */ - volatile unsigned int MAC_QCU_CBR[10]; /* 0x8c0 - 0x8e8 */ - volatile char pad__5[0x18]; /* 0x8e8 - 0x900 */ - volatile unsigned int MAC_QCU_RDYTIME[10]; /* 0x900 - 0x928 */ - volatile char pad__6[0x18]; /* 0x928 - 0x940 */ - volatile unsigned int MAC_QCU_ONESHOT_ARM_SC; /* 0x940 - 0x944 */ - volatile char pad__7[0x3c]; /* 0x944 - 0x980 */ - volatile unsigned int MAC_QCU_ONESHOT_ARM_CC; /* 0x980 - 0x984 */ - volatile char pad__8[0x3c]; /* 0x984 - 0x9c0 */ - volatile unsigned int MAC_QCU_MISC[10]; /* 0x9c0 - 0x9e8 */ - volatile char pad__9[0x18]; /* 0x9e8 - 0xa00 */ - volatile unsigned int MAC_QCU_CNT[10]; /* 0xa00 - 0xa28 */ - volatile char pad__10[0x18]; /* 0xa28 - 0xa40 */ - volatile unsigned int MAC_QCU_RDYTIME_SHDN; /* 0xa40 - 0xa44 */ - volatile unsigned int MAC_QCU_DESC_CRC_CHK; /* 0xa44 - 0xa48 */ - volatile unsigned int MAC_QCU_EOL; /* 0xa48 - 0xa4c */ -} wmac_qcu_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _WMAC_QCU_REG_REG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/a_hci.h b/drivers/net/wireless/ar6003/include/a_hci.h deleted file mode 100644 index d38c3f917be1..000000000000 --- a/drivers/net/wireless/ar6003/include/a_hci.h +++ /dev/null @@ -1,668 +0,0 @@ -//- -// Copyright (c) 2009-2010 Atheros Communications Inc. -// All rights reserved. -// $ATH_LICENSE_TARGET_C$ -// -// - - -#ifndef __A_HCI_H__ -#define __A_HCI_H__ - -#define HCI_CMD_OGF_MASK 0x3F -#define HCI_CMD_OGF_SHIFT 10 -#define HCI_CMD_GET_OGF(opcode) ((opcode >> HCI_CMD_OGF_SHIFT) & HCI_CMD_OGF_MASK) - -#define HCI_CMD_OCF_MASK 0x3FF -#define HCI_CMD_OCF_SHIFT 0 -#define HCI_CMD_GET_OCF(opcode) (((opcode) >> HCI_CMD_OCF_SHIFT) & HCI_CMD_OCF_MASK) - -#define HCI_FORM_OPCODE(ocf, ogf) ((ocf & HCI_CMD_OCF_MASK) << HCI_CMD_OCF_SHIFT | \ - (ogf & HCI_CMD_OGF_MASK) << HCI_CMD_OGF_SHIFT) - - -/*======== HCI Opcode groups ===============*/ -#define OGF_NOP 0x00 -#define OGF_LINK_CONTROL 0x01 -#define OGF_LINK_POLICY 0x03 -#define OGF_INFO_PARAMS 0x04 -#define OGF_STATUS 0x05 -#define OGF_TESTING 0x06 -#define OGF_BLUETOOTH 0x3E -#define OGF_VENDOR_DEBUG 0x3F - - - -#define OCF_NOP 0x00 - - -/*===== Link Control Commands Opcode===================*/ -#define OCF_HCI_Create_Physical_Link 0x35 -#define OCF_HCI_Accept_Physical_Link_Req 0x36 -#define OCF_HCI_Disconnect_Physical_Link 0x37 -#define OCF_HCI_Create_Logical_Link 0x38 -#define OCF_HCI_Accept_Logical_Link 0x39 -#define OCF_HCI_Disconnect_Logical_Link 0x3A -#define OCF_HCI_Logical_Link_Cancel 0x3B -#define OCF_HCI_Flow_Spec_Modify 0x3C - - - -/*===== Link Policy Commands Opcode====================*/ -#define OCF_HCI_Set_Event_Mask 0x01 -#define OCF_HCI_Reset 0x03 -#define OCF_HCI_Read_Conn_Accept_Timeout 0x15 -#define OCF_HCI_Write_Conn_Accept_Timeout 0x16 -#define OCF_HCI_Read_Link_Supervision_Timeout 0x36 -#define OCF_HCI_Write_Link_Supervision_Timeout 0x37 -#define OCF_HCI_Enhanced_Flush 0x5F -#define OCF_HCI_Read_Logical_Link_Accept_Timeout 0x61 -#define OCF_HCI_Write_Logical_Link_Accept_Timeout 0x62 -#define OCF_HCI_Set_Event_Mask_Page_2 0x63 -#define OCF_HCI_Read_Location_Data 0x64 -#define OCF_HCI_Write_Location_Data 0x65 -#define OCF_HCI_Read_Flow_Control_Mode 0x66 -#define OCF_HCI_Write_Flow_Control_Mode 0x67 -#define OCF_HCI_Read_BE_Flush_Timeout 0x69 -#define OCF_HCI_Write_BE_Flush_Timeout 0x6A -#define OCF_HCI_Short_Range_Mode 0x6B - - -/*======== Info Commands Opcode========================*/ -#define OCF_HCI_Read_Local_Ver_Info 0x01 -#define OCF_HCI_Read_Local_Supported_Cmds 0x02 -#define OCF_HCI_Read_Data_Block_Size 0x0A -/*======== Status Commands Opcode======================*/ -#define OCF_HCI_Read_Failed_Contact_Counter 0x01 -#define OCF_HCI_Reset_Failed_Contact_Counter 0x02 -#define OCF_HCI_Read_Link_Quality 0x03 -#define OCF_HCI_Read_RSSI 0x05 -#define OCF_HCI_Read_Local_AMP_Info 0x09 -#define OCF_HCI_Read_Local_AMP_ASSOC 0x0A -#define OCF_HCI_Write_Remote_AMP_ASSOC 0x0B - - -/*======= AMP_ASSOC Specific TLV tags =================*/ -#define AMP_ASSOC_MAC_ADDRESS_INFO_TYPE 0x1 -#define AMP_ASSOC_PREF_CHAN_LIST 0x2 -#define AMP_ASSOC_CONNECTED_CHAN 0x3 -#define AMP_ASSOC_PAL_CAPABILITIES 0x4 -#define AMP_ASSOC_PAL_VERSION 0x5 - - -/*========= PAL Events =================================*/ -#define PAL_COMMAND_COMPLETE_EVENT 0x0E -#define PAL_COMMAND_STATUS_EVENT 0x0F -#define PAL_HARDWARE_ERROR_EVENT 0x10 -#define PAL_FLUSH_OCCURRED_EVENT 0x11 -#define PAL_LOOPBACK_EVENT 0x19 -#define PAL_BUFFER_OVERFLOW_EVENT 0x1A -#define PAL_QOS_VIOLATION_EVENT 0x1E -#define PAL_ENHANCED_FLUSH_COMPLT_EVENT 0x39 -#define PAL_PHYSICAL_LINK_COMPL_EVENT 0x40 -#define PAL_CHANNEL_SELECT_EVENT 0x41 -#define PAL_DISCONNECT_PHYSICAL_LINK_EVENT 0x42 -#define PAL_PHY_LINK_EARLY_LOSS_WARNING_EVENT 0x43 -#define PAL_PHY_LINK_RECOVERY_EVENT 0x44 -#define PAL_LOGICAL_LINK_COMPL_EVENT 0x45 -#define PAL_DISCONNECT_LOGICAL_LINK_COMPL_EVENT 0x46 -#define PAL_FLOW_SPEC_MODIFY_COMPL_EVENT 0x47 -#define PAL_NUM_COMPL_DATA_BLOCK_EVENT 0x48 -#define PAL_SHORT_RANGE_MODE_CHANGE_COMPL_EVENT 0x4C -#define PAL_AMP_STATUS_CHANGE_EVENT 0x4D -/*======== End of PAL events definiton =================*/ - - -/*======== Timeouts (not part of HCI cmd, but input to PAL engine) =========*/ -#define Timer_Conn_Accept_TO 0x01 -#define Timer_Link_Supervision_TO 0x02 - -#define NUM_HCI_COMMAND_PKTS 0x1 - - -/*====== NOP Cmd ============================*/ -#define HCI_CMD_NOP HCI_FORM_OPCODE(OCF_NOP, OGF_NOP) - - -/*===== Link Control Commands================*/ -#define HCI_Create_Physical_Link HCI_FORM_OPCODE(OCF_HCI_Create_Physical_Link, OGF_LINK_CONTROL) -#define HCI_Accept_Physical_Link_Req HCI_FORM_OPCODE(OCF_HCI_Accept_Physical_Link_Req, OGF_LINK_CONTROL) -#define HCI_Disconnect_Physical_Link HCI_FORM_OPCODE(OCF_HCI_Disconnect_Physical_Link, OGF_LINK_CONTROL) -#define HCI_Create_Logical_Link HCI_FORM_OPCODE(OCF_HCI_Create_Logical_Link, OGF_LINK_CONTROL) -#define HCI_Accept_Logical_Link HCI_FORM_OPCODE(OCF_HCI_Accept_Logical_Link, OGF_LINK_CONTROL) -#define HCI_Disconnect_Logical_Link HCI_FORM_OPCODE(OCF_HCI_Disconnect_Logical_Link, OGF_LINK_CONTROL) -#define HCI_Logical_Link_Cancel HCI_FORM_OPCODE(OCF_HCI_Logical_Link_Cancel, OGF_LINK_CONTROL) -#define HCI_Flow_Spec_Modify HCI_FORM_OPCODE(OCF_HCI_Flow_Spec_Modify, OGF_LINK_CONTROL) - - -/*===== Link Policy Commands ================*/ -#define HCI_Set_Event_Mask HCI_FORM_OPCODE(OCF_HCI_Set_Event_Mask, OGF_LINK_POLICY) -#define HCI_Reset HCI_FORM_OPCODE(OCF_HCI_Reset, OGF_LINK_POLICY) -#define HCI_Enhanced_Flush HCI_FORM_OPCODE(OCF_HCI_Enhanced_Flush, OGF_LINK_POLICY) -#define HCI_Read_Conn_Accept_Timeout HCI_FORM_OPCODE(OCF_HCI_Read_Conn_Accept_Timeout, OGF_LINK_POLICY) -#define HCI_Write_Conn_Accept_Timeout HCI_FORM_OPCODE(OCF_HCI_Write_Conn_Accept_Timeout, OGF_LINK_POLICY) -#define HCI_Read_Logical_Link_Accept_Timeout HCI_FORM_OPCODE(OCF_HCI_Read_Logical_Link_Accept_Timeout, OGF_LINK_POLICY) -#define HCI_Write_Logical_Link_Accept_Timeout HCI_FORM_OPCODE(OCF_HCI_Write_Logical_Link_Accept_Timeout, OGF_LINK_POLICY) -#define HCI_Read_Link_Supervision_Timeout HCI_FORM_OPCODE(OCF_HCI_Read_Link_Supervision_Timeout, OGF_LINK_POLICY) -#define HCI_Write_Link_Supervision_Timeout HCI_FORM_OPCODE(OCF_HCI_Write_Link_Supervision_Timeout, OGF_LINK_POLICY) -#define HCI_Read_Location_Data HCI_FORM_OPCODE(OCF_HCI_Read_Location_Data, OGF_LINK_POLICY) -#define HCI_Write_Location_Data HCI_FORM_OPCODE(OCF_HCI_Write_Location_Data, OGF_LINK_POLICY) -#define HCI_Set_Event_Mask_Page_2 HCI_FORM_OPCODE(OCF_HCI_Set_Event_Mask_Page_2, OGF_LINK_POLICY) -#define HCI_Read_Flow_Control_Mode HCI_FORM_OPCODE(OCF_HCI_Read_Flow_Control_Mode, OGF_LINK_POLICY) -#define HCI_Write_Flow_Control_Mode HCI_FORM_OPCODE(OCF_HCI_Write_Flow_Control_Mode, OGF_LINK_POLICY) -#define HCI_Write_BE_Flush_Timeout HCI_FORM_OPCODE(OCF_HCI_Write_BE_Flush_Timeout, OGF_LINK_POLICY) -#define HCI_Read_BE_Flush_Timeout HCI_FORM_OPCODE(OCF_HCI_Read_BE_Flush_Timeout, OGF_LINK_POLICY) -#define HCI_Short_Range_Mode HCI_FORM_OPCODE(OCF_HCI_Short_Range_Mode, OGF_LINK_POLICY) - - -/*===== Info Commands =====================*/ -#define HCI_Read_Local_Ver_Info HCI_FORM_OPCODE(OCF_HCI_Read_Local_Ver_Info, OGF_INFO_PARAMS) -#define HCI_Read_Local_Supported_Cmds HCI_FORM_OPCODE(OCF_HCI_Read_Local_Supported_Cmds, OGF_INFO_PARAMS) -#define HCI_Read_Data_Block_Size HCI_FORM_OPCODE(OCF_HCI_Read_Data_Block_Size, OGF_INFO_PARAMS) - -/*===== Status Commands =====================*/ -#define HCI_Read_Link_Quality HCI_FORM_OPCODE(OCF_HCI_Read_Link_Quality, OGF_STATUS) -#define HCI_Read_RSSI HCI_FORM_OPCODE(OCF_HCI_Read_RSSI, OGF_STATUS) -#define HCI_Read_Local_AMP_Info HCI_FORM_OPCODE(OCF_HCI_Read_Local_AMP_Info, OGF_STATUS) -#define HCI_Read_Local_AMP_ASSOC HCI_FORM_OPCODE(OCF_HCI_Read_Local_AMP_ASSOC, OGF_STATUS) -#define HCI_Write_Remote_AMP_ASSOC HCI_FORM_OPCODE(OCF_HCI_Write_Remote_AMP_ASSOC, OGF_STATUS) - -/*====== End of cmd definitions =============*/ - - - -/*===== Timeouts(private - can't come from HCI)=================*/ -#define Conn_Accept_TO HCI_FORM_OPCODE(Timer_Conn_Accept_TO, OGF_VENDOR_DEBUG) -#define Link_Supervision_TO HCI_FORM_OPCODE(Timer_Link_Supervision_TO, OGF_VENDOR_DEBUG) - -/*----- PAL Constants (Sec 6 of Doc)------------------------*/ -#define Max80211_PAL_PDU_Size 1492 -#define Max80211_AMP_ASSOC_Len 672 -#define MinGUserPrio 4 -#define MaxGUserPrio 7 -#define BEUserPrio0 0 -#define BEUserPrio1 3 -#define Max80211BeaconPeriod 2000 /* in millisec */ -#define ShortRangeModePowerMax 4 /* dBm */ - -/*------ PAL Protocol Identifiers (Sec5.1) ------------------*/ -typedef enum { - ACL_DATA = 0x01, - ACTIVITY_REPORT, - SECURED_FRAMES, - LINK_SUPERVISION_REQ, - LINK_SUPERVISION_RESP, -}PAL_PROTOCOL_IDENTIFIERS; - -#define HCI_CMD_HDR_SZ 3 -#define HCI_EVENT_HDR_SIZE 2 -#define MAX_EVT_PKT_SZ 255 -#define AMP_ASSOC_MAX_FRAG_SZ 248 -#define AMP_MAX_GUARANTEED_BW 20000 - -#define DEFAULT_CONN_ACCPT_TO 5000 -#define DEFAULT_LL_ACCPT_TO 5000 -#define DEFAULT_LSTO 10000 - -#define PACKET_BASED_FLOW_CONTROL_MODE 0x00 -#define DATA_BLK_BASED_FLOW_CONTROL_MODE 0x01 - -#define SERVICE_TYPE_BEST_EFFORT 0x01 -#define SERVICE_TYPE_GUARANTEED 0x02 - -#define MAC_ADDR_LEN 6 -#define LINK_KEY_LEN 32 - -typedef enum { - ACL_DATA_PB_1ST_NON_AUTOMATICALLY_FLUSHABLE = 0x00, - ACL_DATA_PB_CONTINUING_FRAGMENT = 0x01, - ACL_DATA_PB_1ST_AUTOMATICALLY_FLUSHABLE = 0x02, - ACL_DATA_PB_COMPLETE_PDU = 0x03, -} ACL_DATA_PB_FLAGS; -#define ACL_DATA_PB_FLAGS_SHIFT 12 - -typedef enum { - ACL_DATA_BC_POINT_TO_POINT = 0x00, -} ACL_DATA_BC_FLAGS; -#define ACL_DATA_BC_FLAGS_SHIFT 14 - -/* Command pkt */ -typedef struct hci_cmd_pkt_t { - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT8 params[255]; -} POSTPACK HCI_CMD_PKT; - -#define ACL_DATA_HDR_SIZE 4 /* hdl_and flags + data_len */ -/* Data pkt */ -typedef struct hci_acl_data_pkt_t { - A_UINT16 hdl_and_flags; - A_UINT16 data_len; - A_UINT8 data[Max80211_PAL_PDU_Size]; -} POSTPACK HCI_ACL_DATA_PKT; - -/* Event pkt */ -typedef struct hci_event_pkt_t { - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 params[256]; -} POSTPACK HCI_EVENT_PKT; - - -/*============== HCI Command definitions ======================= */ -typedef struct hci_cmd_phy_link_t { - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT8 phy_link_hdl; - A_UINT8 link_key_len; - A_UINT8 link_key_type; - A_UINT8 link_key[LINK_KEY_LEN]; -} POSTPACK HCI_CMD_PHY_LINK; - -typedef struct hci_cmd_write_rem_amp_assoc_t { - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT8 phy_link_hdl; - A_UINT16 len_so_far; - A_UINT16 amp_assoc_remaining_len; - A_UINT8 amp_assoc_frag[AMP_ASSOC_MAX_FRAG_SZ]; -} POSTPACK HCI_CMD_WRITE_REM_AMP_ASSOC; - - -typedef struct hci_cmd_opcode_hdl_t { - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT16 hdl; -} POSTPACK HCI_CMD_READ_LINK_QUAL, - HCI_CMD_FLUSH, - HCI_CMD_READ_LINK_SUPERVISION_TIMEOUT; - -typedef struct hci_cmd_read_local_amp_assoc_t { - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT8 phy_link_hdl; - A_UINT16 len_so_far; - A_UINT16 max_rem_amp_assoc_len; -} POSTPACK HCI_CMD_READ_LOCAL_AMP_ASSOC; - - -typedef struct hci_cmd_set_event_mask_t { - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT64 mask; -}POSTPACK HCI_CMD_SET_EVT_MASK, HCI_CMD_SET_EVT_MASK_PG_2; - - -typedef struct hci_cmd_enhanced_flush_t{ - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT16 hdl; - A_UINT8 type; -} POSTPACK HCI_CMD_ENHANCED_FLUSH; - - -typedef struct hci_cmd_write_timeout_t { - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT16 timeout; -} POSTPACK HCI_CMD_WRITE_TIMEOUT; - -typedef struct hci_cmd_write_link_supervision_timeout_t { - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT16 hdl; - A_UINT16 timeout; -} POSTPACK HCI_CMD_WRITE_LINK_SUPERVISION_TIMEOUT; - -typedef struct hci_cmd_write_flow_control_t { - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT8 mode; -} POSTPACK HCI_CMD_WRITE_FLOW_CONTROL; - -typedef struct location_data_cfg_t { - A_UINT8 reg_domain_aware; - A_UINT8 reg_domain[3]; - A_UINT8 reg_options; -} POSTPACK LOCATION_DATA_CFG; - -typedef struct hci_cmd_write_location_data_t { - A_UINT16 opcode; - A_UINT8 param_length; - LOCATION_DATA_CFG cfg; -} POSTPACK HCI_CMD_WRITE_LOCATION_DATA; - - -typedef struct flow_spec_t { - A_UINT8 id; - A_UINT8 service_type; - A_UINT16 max_sdu; - A_UINT32 sdu_inter_arrival_time; - A_UINT32 access_latency; - A_UINT32 flush_timeout; -} POSTPACK FLOW_SPEC; - - -typedef struct hci_cmd_create_logical_link_t { - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT8 phy_link_hdl; - FLOW_SPEC tx_flow_spec; - FLOW_SPEC rx_flow_spec; -} POSTPACK HCI_CMD_CREATE_LOGICAL_LINK; - -typedef struct hci_cmd_flow_spec_modify_t { - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT16 hdl; - FLOW_SPEC tx_flow_spec; - FLOW_SPEC rx_flow_spec; -} POSTPACK HCI_CMD_FLOW_SPEC_MODIFY; - -typedef struct hci_cmd_logical_link_cancel_t { - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT8 phy_link_hdl; - A_UINT8 tx_flow_spec_id; -} POSTPACK HCI_CMD_LOGICAL_LINK_CANCEL; - -typedef struct hci_cmd_disconnect_logical_link_t { - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT16 logical_link_hdl; -} POSTPACK HCI_CMD_DISCONNECT_LOGICAL_LINK; - -typedef struct hci_cmd_disconnect_phy_link_t { - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT8 phy_link_hdl; -} POSTPACK HCI_CMD_DISCONNECT_PHY_LINK; - -typedef struct hci_cmd_srm_t { - A_UINT16 opcode; - A_UINT8 param_length; - A_UINT8 phy_link_hdl; - A_UINT8 mode; -} POSTPACK HCI_CMD_SHORT_RANGE_MODE; -/*============== HCI Command definitions end ======================= */ - - - -/*============== HCI Event definitions ============================= */ - -/* Command complete event */ -typedef struct hci_event_cmd_complete_t { - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 num_hci_cmd_pkts; - A_UINT16 opcode; - A_UINT8 params[255]; -} POSTPACK HCI_EVENT_CMD_COMPLETE; - - -/* Command status event */ -typedef struct hci_event_cmd_status_t { - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 status; - A_UINT8 num_hci_cmd_pkts; - A_UINT16 opcode; -} POSTPACK HCI_EVENT_CMD_STATUS; - -/* Hardware Error event */ -typedef struct hci_event_hw_err_t { - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 hw_err_code; -} POSTPACK HCI_EVENT_HW_ERR; - -/* Flush occured event */ -/* Qos Violation event */ -typedef struct hci_event_handle_t { - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT16 handle; -} POSTPACK HCI_EVENT_FLUSH_OCCRD, - HCI_EVENT_QOS_VIOLATION; - -/* Loopback command event */ -typedef struct hci_loopback_cmd_t { - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 params[252]; -} POSTPACK HCI_EVENT_LOOPBACK_CMD; - -/* Data buffer overflow event */ -typedef struct hci_data_buf_overflow_t { - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 link_type; -} POSTPACK HCI_EVENT_DATA_BUF_OVERFLOW; - -/* Enhanced Flush complete event */ -typedef struct hci_enhanced_flush_complt_t{ - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT16 hdl; -} POSTPACK HCI_EVENT_ENHANCED_FLUSH_COMPLT; - -/* Channel select event */ -typedef struct hci_event_chan_select_t { - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 phy_link_hdl; -} POSTPACK HCI_EVENT_CHAN_SELECT; - -/* Physical Link Complete event */ -typedef struct hci_event_phy_link_complete_event_t { - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 status; - A_UINT8 phy_link_hdl; -} POSTPACK HCI_EVENT_PHY_LINK_COMPLETE; - -/* Logical Link complete event */ -typedef struct hci_event_logical_link_complete_event_t { - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 status; - A_UINT16 logical_link_hdl; - A_UINT8 phy_hdl; - A_UINT8 tx_flow_id; -} POSTPACK HCI_EVENT_LOGICAL_LINK_COMPLETE_EVENT; - -/* Disconnect Logical Link complete event */ -typedef struct hci_event_disconnect_logical_link_event_t { - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 status; - A_UINT16 logical_link_hdl; - A_UINT8 reason; -} POSTPACK HCI_EVENT_DISCONNECT_LOGICAL_LINK_EVENT; - -/* Disconnect Physical Link complete event */ -typedef struct hci_event_disconnect_phy_link_complete_t { - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 status; - A_UINT8 phy_link_hdl; - A_UINT8 reason; -} POSTPACK HCI_EVENT_DISCONNECT_PHY_LINK_COMPLETE; - -typedef struct hci_event_physical_link_loss_early_warning_t{ - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 phy_hdl; - A_UINT8 reason; -} POSTPACK HCI_EVENT_PHY_LINK_LOSS_EARLY_WARNING; - -typedef struct hci_event_physical_link_recovery_t{ - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 phy_hdl; -} POSTPACK HCI_EVENT_PHY_LINK_RECOVERY; - - -/* Flow spec modify complete event */ -/* Flush event */ -typedef struct hci_event_status_handle_t { - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 status; - A_UINT16 handle; -} POSTPACK HCI_EVENT_FLOW_SPEC_MODIFY, - HCI_EVENT_FLUSH; - - -/* Num of completed data blocks event */ -typedef struct hci_event_num_of_compl_data_blks_t { - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT16 num_data_blks; - A_UINT8 num_handles; - A_UINT8 params[255]; -} POSTPACK HCI_EVENT_NUM_COMPL_DATA_BLKS; - -/* Short range mode change complete event */ -typedef struct hci_srm_cmpl_t { - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 status; - A_UINT8 phy_link; - A_UINT8 state; -} POSTPACK HCI_EVENT_SRM_COMPL; - -typedef struct hci_event_amp_status_change_t{ - A_UINT8 event_code; - A_UINT8 param_len; - A_UINT8 status; - A_UINT8 amp_status; -} POSTPACK HCI_EVENT_AMP_STATUS_CHANGE; - -/*============== Event definitions end =========================== */ - - -typedef struct local_amp_info_resp_t { - A_UINT8 status; - A_UINT8 amp_status; - A_UINT32 total_bw; /* kbps */ - A_UINT32 max_guranteed_bw; /* kbps */ - A_UINT32 min_latency; - A_UINT32 max_pdu_size; - A_UINT8 amp_type; - A_UINT16 pal_capabilities; - A_UINT16 amp_assoc_len; - A_UINT32 max_flush_timeout; /* in ms */ - A_UINT32 be_flush_timeout; /* in ms */ -} POSTPACK LOCAL_AMP_INFO; - -typedef struct amp_assoc_cmd_resp_t{ - A_UINT8 status; - A_UINT8 phy_hdl; - A_UINT16 amp_assoc_len; - A_UINT8 amp_assoc_frag[AMP_ASSOC_MAX_FRAG_SZ]; -}POSTPACK AMP_ASSOC_CMD_RESP; - - -enum PAL_HCI_CMD_STATUS { - PAL_HCI_CMD_PROCESSED, - PAL_HCI_CMD_IGNORED -}; - - -/*============= HCI Error Codes =======================*/ -#define HCI_SUCCESS 0x00 -#define HCI_ERR_UNKNOW_CMD 0x01 -#define HCI_ERR_UNKNOWN_CONN_ID 0x02 -#define HCI_ERR_HW_FAILURE 0x03 -#define HCI_ERR_PAGE_TIMEOUT 0x04 -#define HCI_ERR_AUTH_FAILURE 0x05 -#define HCI_ERR_KEY_MISSING 0x06 -#define HCI_ERR_MEM_CAP_EXECED 0x07 -#define HCI_ERR_CON_TIMEOUT 0x08 -#define HCI_ERR_CON_LIMIT_EXECED 0x09 -#define HCI_ERR_ACL_CONN_ALRDY_EXISTS 0x0B -#define HCI_ERR_COMMAND_DISALLOWED 0x0C -#define HCI_ERR_CONN_REJ_BY_LIMIT_RES 0x0D -#define HCI_ERR_CONN_REJ_BY_SEC 0x0E -#define HCI_ERR_CONN_REJ_BY_BAD_ADDR 0x0F -#define HCI_ERR_CONN_ACCPT_TIMEOUT 0x10 -#define HCI_ERR_UNSUPPORT_FEATURE 0x11 -#define HCI_ERR_INVALID_HCI_CMD_PARAMS 0x12 -#define HCI_ERR_REMOTE_USER_TERMINATE_CONN 0x13 -#define HCI_ERR_CON_TERM_BY_HOST 0x16 -#define HCI_ERR_UNSPECIFIED_ERROR 0x1F -#define HCI_ERR_ENCRYPTION_MODE_NOT_SUPPORT 0x25 -#define HCI_ERR_REQUESTED_QOS_NOT_SUPPORT 0x27 -#define HCI_ERR_QOS_UNACCEPTABLE_PARM 0x2C -#define HCI_ERR_QOS_REJECTED 0x2D -#define HCI_ERR_CONN_REJ_NO_SUITABLE_CHAN 0x39 - -/*============= HCI Error Codes End =======================*/ - - -/* Following are event return parameters.. part of HCI events - */ -typedef struct timeout_read_t { - A_UINT8 status; - A_UINT16 timeout; -}POSTPACK TIMEOUT_INFO; - -typedef struct link_supervision_timeout_read_t { - A_UINT8 status; - A_UINT16 hdl; - A_UINT16 timeout; -}POSTPACK LINK_SUPERVISION_TIMEOUT_INFO; - -typedef struct status_hdl_t { - A_UINT8 status; - A_UINT16 hdl; -}POSTPACK INFO_STATUS_HDL; - -typedef struct write_remote_amp_assoc_t{ - A_UINT8 status; - A_UINT8 hdl; -}POSTPACK WRITE_REMOTE_AMP_ASSOC_INFO; - -typedef struct read_loc_info_t { - A_UINT8 status; - LOCATION_DATA_CFG loc; -}POSTPACK READ_LOC_INFO; - -typedef struct read_flow_ctrl_mode_t { - A_UINT8 status; - A_UINT8 mode; -}POSTPACK READ_FLWCTRL_INFO; - -typedef struct read_data_blk_size_t { - A_UINT8 status; - A_UINT16 max_acl_data_pkt_len; - A_UINT16 data_block_len; - A_UINT16 total_num_data_blks; -}POSTPACK READ_DATA_BLK_SIZE_INFO; - -/* Read Link quality info */ -typedef struct link_qual_t { - A_UINT8 status; - A_UINT16 hdl; - A_UINT8 link_qual; -} POSTPACK READ_LINK_QUAL_INFO, - READ_RSSI_INFO; - -typedef struct ll_cancel_resp_t { - A_UINT8 status; - A_UINT8 phy_link_hdl; - A_UINT8 tx_flow_spec_id; -} POSTPACK LL_CANCEL_RESP; - -typedef struct read_local_ver_info_t { - A_UINT8 status; - A_UINT8 hci_version; - A_UINT16 hci_revision; - A_UINT8 pal_version; - A_UINT16 manf_name; - A_UINT16 pal_sub_ver; -} POSTPACK READ_LOCAL_VER_INFO; - - -#endif /* __A_HCI_H__ */ diff --git a/drivers/net/wireless/ar6003/include/athdefs.h b/drivers/net/wireless/ar6003/include/athdefs.h deleted file mode 100644 index b59bfd3af0a5..000000000000 --- a/drivers/net/wireless/ar6003/include/athdefs.h +++ /dev/null @@ -1,84 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== -#ifndef __ATHDEFS_H__ -#define __ATHDEFS_H__ - -/* - * This file contains definitions that may be used across both - * Host and Target software. Nothing here is module-dependent - * or platform-dependent. - */ - -/* - * Generic error codes that can be used by hw, sta, ap, sim, dk - * and any other environments. Since these are enums, feel free to - * add any more codes that you need. - */ - -typedef enum { - A_ERROR = -1, /* Generic error return */ - A_OK = 0, /* success */ - /* Following values start at 1 */ - A_DEVICE_NOT_FOUND, /* not able to find PCI device */ - A_NO_MEMORY, /* not able to allocate memory, not available */ - A_MEMORY_NOT_AVAIL, /* memory region is not free for mapping */ - A_NO_FREE_DESC, /* no free descriptors available */ - A_BAD_ADDRESS, /* address does not match descriptor */ - A_WIN_DRIVER_ERROR, /* used in NT_HW version, if problem at init */ - A_REGS_NOT_MAPPED, /* registers not correctly mapped */ - A_EPERM, /* Not superuser */ - A_EACCES, /* Access denied */ - A_ENOENT, /* No such entry, search failed, etc. */ - A_EEXIST, /* The object already exists (can't create) */ - A_EFAULT, /* Bad address fault */ - A_EBUSY, /* Object is busy */ - A_EINVAL, /* Invalid parameter */ - A_EMSGSIZE, /* Inappropriate message buffer length */ - A_ECANCELED, /* Operation canceled */ - A_ENOTSUP, /* Operation not supported */ - A_ECOMM, /* Communication error on send */ - A_EPROTO, /* Protocol error */ - A_ENODEV, /* No such device */ - A_EDEVNOTUP, /* device is not UP */ - A_NO_RESOURCE, /* No resources for requested operation */ - A_HARDWARE, /* Hardware failure */ - A_PENDING, /* Asynchronous routine; will send up results la -ter (typically in callback) */ - A_EBADCHANNEL, /* The channel cannot be used */ - A_DECRYPT_ERROR, /* Decryption error */ - A_PHY_ERROR, /* RX PHY error */ - A_CONSUMED /* Object was consumed */ -} A_STATUS; - -#define A_SUCCESS(x) (x == A_OK) -#define A_FAILED(x) (!A_SUCCESS(x)) - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#endif /* __ATHDEFS_H__ */ diff --git a/drivers/net/wireless/ar6003/include/bmi_msg.h b/drivers/net/wireless/ar6003/include/bmi_msg.h deleted file mode 100644 index 3035827c9abb..000000000000 --- a/drivers/net/wireless/ar6003/include/bmi_msg.h +++ /dev/null @@ -1,334 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef __BMI_MSG_H__ -#define __BMI_MSG_H__ - -#ifndef ATH_TARGET -#include "athstartpack.h" -#endif - -/* - * Bootloader Messaging Interface (BMI) - * - * BMI is a very simple messaging interface used during initialization - * to read memory, write memory, execute code, and to define an - * application entry PC. - * - * It is used to download an application to AR6K, to provide - * patches to code that is already resident on AR6K, and generally - * to examine and modify state. The Host has an opportunity to use - * BMI only once during bootup. Once the Host issues a BMI_DONE - * command, this opportunity ends. - * - * The Host writes BMI requests to mailbox0, and reads BMI responses - * from mailbox0. BMI requests all begin with a command - * (see below for specific commands), and are followed by - * command-specific data. - * - * Flow control: - * The Host can only issue a command once the Target gives it a - * "BMI Command Credit", using AR6K Counter #4. As soon as the - * Target has completed a command, it issues another BMI Command - * Credit (so the Host can issue the next command). - * - * BMI handles all required Target-side cache flushing. - */ - - -/* Maximum data size used for BMI transfers */ -#define BMI_DATASZ_MAX 256 - -/* BMI Commands */ - -#define BMI_NO_COMMAND 0 - -#define BMI_DONE 1 - /* - * Semantics: Host is done using BMI - * Request format: - * A_UINT32 command (BMI_DONE) - * Response format: none - */ - -#define BMI_READ_MEMORY 2 - /* - * Semantics: Host reads AR6K memory - * Request format: - * A_UINT32 command (BMI_READ_MEMORY) - * A_UINT32 address - * A_UINT32 length, at most BMI_DATASZ_MAX - * Response format: - * A_UINT8 data[length] - */ - -#define BMI_WRITE_MEMORY 3 - /* - * Semantics: Host writes AR6K memory - * Request format: - * A_UINT32 command (BMI_WRITE_MEMORY) - * A_UINT32 address - * A_UINT32 length, at most BMI_DATASZ_MAX - * A_UINT8 data[length] - * Response format: none - */ -/* - * Capbility to write "segmented files" is provided for two reasons - * 1) backwards compatibility for certain situations where Hosts - * have limited flexibility - * 2) because it's darn convenient. - * - * A segmented file consists of a file header followed by an arbitrary number - * of segments. Each segment contains segment metadata -- a Target address and - * a length -- followed by "length" bytes of data. A segmented file ends with - * a segment that specifies length=BMI_SGMTFILE_DONE. When a segmented file - * is sent to the Target, firmware writes each segment to the specified address. - * - * Special cases: - * 1) If a segment's metadata indicates length=BMI_SGMTFILE_EXEC, then the - * specified address is used as a function entry point for a brief function - * with prototype "(void *)(void)". That function is called immediately. - * After execution of the function completes, firmware continues with the - * next segment. No data is expected when length=BMI_SGMTFILE_EXEC. - * - * 2) If a segment's metadata indicates length=BMI_SGMTFILE_BEGINADDR, then - * the specified address is established as the application start address - * so that a subsequent BMI_DONE jumps there. - * - * 3) If a segment's metadata indicates length=BMI_SGMTFILE_BDDATA, then - * the specified address is used as the (possibly compressed) length of board - * data, which is loaded into the proper Target address as specified by - * hi_board_data. In addition, the hi_board_data_initialized flag is set. - * - * A segmented file is sent to the Target using a sequence of 1 or more - * BMI_WRITE_MEMORY commands. The first such command must have - * address=BMI_SEGMENTED_WRITE_ADDR. Subsequent BMI_WRITE_MEMORY commands - * can use an arbitrary address. In each BMI_WRITE_MEMORY command, the - * length specifies the number of data bytes transmitted (except for the - * special cases listed above). - * - * Alternatively, a segmented file may be sent to the Target using a - * BMI_LZ_STREAM_START command with address=BMI_SEGMENTED_WRITE_ADDR - * followed by a series of BMI_LZ_DATA commands that each send the next portion - * of the segmented file. - * - * The data segments may be lz77 compressed. In this case, the segmented file - * header flag, BMI_SGMTFILE_FLAG_COMPRESS, must be set. Note that segmented - * file METAdata is never compressed; only the data segments themselves are - * compressed. There is no way to mix compressed and uncompressed data segments - * in a single segmented file. Compressed (or uncompressed) segments are handled - * by both BMI_WRITE_MEMORY and by BMI_LZ_DATA commands. (Compression is an - * attribute of the segmented file rather than of the command used to transmit - * it.) - */ -#define BMI_SEGMENTED_WRITE_ADDR 0x1234 - -/* File header for a segmented file */ -struct bmi_segmented_file_header { - A_UINT32 magic_num; - A_UINT32 file_flags; -}; -#define BMI_SGMTFILE_MAGIC_NUM 0x544d4753 /* "SGMT" */ -#define BMI_SGMTFILE_FLAG_COMPRESS 1 - -/* Metadata for a segmented file segment */ -struct bmi_segmented_metadata { - A_UINT32 addr; - A_UINT32 length; -}; -/* Special values for bmi_segmented_metadata.length (all have high bit set) */ -#define BMI_SGMTFILE_DONE 0xffffffff /* end of segmented data */ -#define BMI_SGMTFILE_BDDATA 0xfffffffe /* Board Data segment */ -#define BMI_SGMTFILE_BEGINADDR 0xfffffffd /* set beginning address */ -#define BMI_SGMTFILE_EXEC 0xfffffffc /* immediate function execution */ - -#define BMI_EXECUTE 4 - /* - * Semantics: Causes AR6K to execute code - * Request format: - * A_UINT32 command (BMI_EXECUTE) - * A_UINT32 address - * A_UINT32 parameter - * Response format: - * A_UINT32 return value - */ -/* - * Note: In order to support the segmented file feature - * (see BMI_WRITE_MEMORY), when the address specified in a - * BMI_EXECUTE command matches (same physical address) - * BMI_SEGMENTED_WRITE_ADDR, it is ignored. Instead, execution - * begins at the address specified by hi_app_start. - */ - -#define BMI_SET_APP_START 5 - /* - * Semantics: Set Target application starting address - * Request format: - * A_UINT32 command (BMI_SET_APP_START) - * A_UINT32 address - * Response format: none - */ - -#define BMI_READ_SOC_REGISTER 6 - /* - * Semantics: Read a 32-bit Target SOC register. - * Request format: - * A_UINT32 command (BMI_READ_REGISTER) - * A_UINT32 address - * Response format: - * A_UINT32 value - */ - -#define BMI_WRITE_SOC_REGISTER 7 - /* - * Semantics: Write a 32-bit Target SOC register. - * Request format: - * A_UINT32 command (BMI_WRITE_REGISTER) - * A_UINT32 address - * A_UINT32 value - * - * Response format: none - */ - -#define BMI_GET_TARGET_ID 8 -#define BMI_GET_TARGET_INFO 8 - /* - * Semantics: Fetch the 4-byte Target information - * Request format: - * A_UINT32 command (BMI_GET_TARGET_ID/INFO) - * Response format1 (old firmware): - * A_UINT32 TargetVersionID - * Response format2 (newer firmware): - * A_UINT32 TARGET_VERSION_SENTINAL - * struct bmi_target_info; - */ - -PREPACK struct bmi_target_info { - A_UINT32 target_info_byte_count; /* size of this structure */ - A_UINT32 target_ver; /* Target Version ID */ - A_UINT32 target_type; /* Target type */ -} POSTPACK; -#define TARGET_VERSION_SENTINAL 0xffffffff -#define TARGET_TYPE_AR6001 1 -#define TARGET_TYPE_AR6002 2 -#define TARGET_TYPE_AR6003 3 -#define TARGET_TYPE_MCKINLEY 5 - - -#define BMI_ROMPATCH_INSTALL 9 - /* - * Semantics: Install a ROM Patch. - * Request format: - * A_UINT32 command (BMI_ROMPATCH_INSTALL) - * A_UINT32 Target ROM Address - * A_UINT32 Target RAM Address or Value (depending on Target Type) - * A_UINT32 Size, in bytes - * A_UINT32 Activate? 1-->activate; - * 0-->install but do not activate - * Response format: - * A_UINT32 PatchID - */ - -#define BMI_ROMPATCH_UNINSTALL 10 - /* - * Semantics: Uninstall a previously-installed ROM Patch, - * automatically deactivating, if necessary. - * Request format: - * A_UINT32 command (BMI_ROMPATCH_UNINSTALL) - * A_UINT32 PatchID - * - * Response format: none - */ - -#define BMI_ROMPATCH_ACTIVATE 11 - /* - * Semantics: Activate a list of previously-installed ROM Patches. - * Request format: - * A_UINT32 command (BMI_ROMPATCH_ACTIVATE) - * A_UINT32 rompatch_count - * A_UINT32 PatchID[rompatch_count] - * - * Response format: none - */ - -#define BMI_ROMPATCH_DEACTIVATE 12 - /* - * Semantics: Deactivate a list of active ROM Patches. - * Request format: - * A_UINT32 command (BMI_ROMPATCH_DEACTIVATE) - * A_UINT32 rompatch_count - * A_UINT32 PatchID[rompatch_count] - * - * Response format: none - */ - - -#define BMI_LZ_STREAM_START 13 - /* - * Semantics: Begin an LZ-compressed stream of input - * which is to be uncompressed by the Target to an - * output buffer at address. The output buffer must - * be sufficiently large to hold the uncompressed - * output from the compressed input stream. This BMI - * command should be followed by a series of 1 or more - * BMI_LZ_DATA commands. - * A_UINT32 command (BMI_LZ_STREAM_START) - * A_UINT32 address - * Note: Not supported on all versions of ROM firmware. - */ - -#define BMI_LZ_DATA 14 - /* - * Semantics: Host writes AR6K memory with LZ-compressed - * data which is uncompressed by the Target. This command - * must be preceded by a BMI_LZ_STREAM_START command. A series - * of BMI_LZ_DATA commands are considered part of a single - * input stream until another BMI_LZ_STREAM_START is issued. - * Request format: - * A_UINT32 command (BMI_LZ_DATA) - * A_UINT32 length (of compressed data), - * at most BMI_DATASZ_MAX - * A_UINT8 CompressedData[length] - * Response format: none - * Note: Not supported on all versions of ROM firmware. - */ - -#define BMI_NVRAM_PROCESS 15 -#define BMI_NVRAM_SEG_NAME_SZ 16 - /* - * Semantics: Cause Target to search NVRAM (if any) for a - * segment with the specified name and process it according - * to NVRAM metadata. - * Request format: - * A_UINT32 command (BMI_NVRAM_PROCESS) - * A_UCHAR name[BMI_NVRAM_SEG_NAME_SZ] name (LE format) - * Response format: - * A_UINT32 0, if nothing was executed; - * otherwise the value returned from the - * last NVRAM segment that was executed - */ - -#ifndef ATH_TARGET -#include "athendpack.h" -#endif - -#endif /* __BMI_MSG_H__ */ diff --git a/drivers/net/wireless/ar6003/include/btcoexGpio.h b/drivers/net/wireless/ar6003/include/btcoexGpio.h deleted file mode 100644 index bc067f557eaa..000000000000 --- a/drivers/net/wireless/ar6003/include/btcoexGpio.h +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) 2010 Atheros Communications Inc. -// All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// - -#ifndef BTCOEX_GPIO_H_ -#define BTCOEX_GPIO_H_ - - - -#ifdef FPGA -#define GPIO_A (15) -#define GPIO_B (16) -#define GPIO_C (17) -#define GPIO_D (18) -#define GPIO_E (19) -#define GPIO_F (21) -#define GPIO_G (21) -#else -#define GPIO_A (0) -#define GPIO_B (5) -#define GPIO_C (6) -#define GPIO_D (7) -#define GPIO_E (7) -#define GPIO_F (7) -#define GPIO_G (7) -#endif - - - - - -#define GPIO_DEBUG_WORD_1 (1< -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef _CNXMGMT_H_ -#define _CNXMGMT_H_ - -typedef enum { - CM_CONNECT_WITHOUT_SCAN = 0x0001, - CM_CONNECT_ASSOC_POLICY_USER = 0x0002, - CM_CONNECT_SEND_REASSOC = 0x0004, - CM_CONNECT_WITHOUT_ROAMTABLE_UPDATE = 0x0008, - CM_CONNECT_DO_WPA_OFFLOAD = 0x0010, - CM_CONNECT_DO_NOT_DEAUTH = 0x0020, -} CM_CONNECT_TYPE; - -#endif /* _CNXMGMT_H_ */ diff --git a/drivers/net/wireless/ar6003/include/dbglog.h b/drivers/net/wireless/ar6003/include/dbglog.h deleted file mode 100644 index 382d9a2dd4eb..000000000000 --- a/drivers/net/wireless/ar6003/include/dbglog.h +++ /dev/null @@ -1,134 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef _DBGLOG_H_ -#define _DBGLOG_H_ - -#ifndef ATH_TARGET -#include "athstartpack.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define DBGLOG_TIMESTAMP_OFFSET 0 -#define DBGLOG_TIMESTAMP_MASK 0x0000FFFF /* Bit 0-15. Contains bit - 8-23 of the LF0 timer */ -#define DBGLOG_DBGID_OFFSET 16 -#define DBGLOG_DBGID_MASK 0x03FF0000 /* Bit 16-25 */ -#define DBGLOG_DBGID_NUM_MAX 256 /* Upper limit is width of mask */ - -#define DBGLOG_MODULEID_OFFSET 26 -#define DBGLOG_MODULEID_MASK 0x3C000000 /* Bit 26-29 */ -#define DBGLOG_MODULEID_NUM_MAX 16 /* Upper limit is width of mask */ - -/* - * Please ensure that the definition of any new module intrduced is captured - * between the DBGLOG_MODULEID_START and DBGLOG_MODULEID_END defines. The - * structure is required for the parser to correctly pick up the values for - * different modules. - */ -#define DBGLOG_MODULEID_START -#define DBGLOG_MODULEID_INF 0 -#define DBGLOG_MODULEID_WMI 1 -#define DBGLOG_MODULEID_MISC 2 -#define DBGLOG_MODULEID_PM 3 -#define DBGLOG_MODULEID_TXRX_MGMTBUF 4 -#define DBGLOG_MODULEID_TXRX_TXBUF 5 -#define DBGLOG_MODULEID_TXRX_RXBUF 6 -#define DBGLOG_MODULEID_WOW 7 -#define DBGLOG_MODULEID_WHAL 8 -#define DBGLOG_MODULEID_DC 9 -#define DBGLOG_MODULEID_CO 10 -#define DBGLOG_MODULEID_RO 11 -#define DBGLOG_MODULEID_CM 12 -#define DBGLOG_MODULEID_MGMT 13 -#define DBGLOG_MODULEID_TMR 14 -#define DBGLOG_MODULEID_BTCOEX 15 -#define DBGLOG_MODULEID_END - -#define DBGLOG_NUM_ARGS_OFFSET 30 -#define DBGLOG_NUM_ARGS_MASK 0xC0000000 /* Bit 30-31 */ -#define DBGLOG_NUM_ARGS_MAX 2 /* Upper limit is width of mask */ - -#define DBGLOG_MODULE_LOG_ENABLE_OFFSET 0 -#define DBGLOG_MODULE_LOG_ENABLE_MASK 0x0000FFFF - -#define DBGLOG_REPORTING_ENABLED_OFFSET 16 -#define DBGLOG_REPORTING_ENABLED_MASK 0x00010000 - -#define DBGLOG_TIMESTAMP_RESOLUTION_OFFSET 17 -#define DBGLOG_TIMESTAMP_RESOLUTION_MASK 0x000E0000 - -#define DBGLOG_REPORT_SIZE_OFFSET 20 -#define DBGLOG_REPORT_SIZE_MASK 0x3FF00000 - -#define DBGLOG_LOG_BUFFER_SIZE 1500 -#define DBGLOG_DBGID_DEFINITION_LEN_MAX 90 - -PREPACK struct dbglog_buf_s { - struct dbglog_buf_s *next; - A_UINT8 *buffer; - A_UINT32 bufsize; - A_UINT32 length; - A_UINT32 count; - A_UINT32 free; -} POSTPACK; - -PREPACK struct dbglog_hdr_s { - struct dbglog_buf_s *dbuf; - A_UINT32 dropped; -} POSTPACK; - -PREPACK struct dbglog_config_s { - A_UINT32 cfgvalid; /* Mask with valid config bits */ - union { - /* TODO: Take care of endianness */ - struct { - A_UINT32 mmask:16; /* Mask of modules with logging on */ - A_UINT32 rep:1; /* Reporting enabled or not */ - A_UINT32 tsr:3; /* Time stamp resolution. Def: 1 ms */ - A_UINT32 size:10; /* Report size in number of messages */ - A_UINT32 reserved:2; - } dbglog_config; - - A_UINT32 value; - } u; -} POSTPACK; - -#define cfgmmask u.dbglog_config.mmask -#define cfgrep u.dbglog_config.rep -#define cfgtsr u.dbglog_config.tsr -#define cfgsize u.dbglog_config.size -#define cfgvalue u.value - -#ifdef __cplusplus -} -#endif - -#ifndef ATH_TARGET -#include "athendpack.h" -#endif - -#endif /* _DBGLOG_H_ */ diff --git a/drivers/net/wireless/ar6003/include/dbglog_id.h b/drivers/net/wireless/ar6003/include/dbglog_id.h deleted file mode 100644 index 16ab89c9e110..000000000000 --- a/drivers/net/wireless/ar6003/include/dbglog_id.h +++ /dev/null @@ -1,593 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef _DBGLOG_ID_H_ -#define _DBGLOG_ID_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The nomenclature for the debug identifiers is MODULE_DESCRIPTION. - * Please ensure that the definition of any new debugid introduced is captured - * between the _DBGID_DEFINITION_START and - * _DBGID_DEFINITION_END defines. The structure is required for the - * parser to correctly pick up the values for different debug identifiers. - */ - -/* INF debug identifier definitions */ -#define INF_DBGID_DEFINITION_START -#define INF_ASSERTION_FAILED 1 -#define INF_TARGET_ID 2 -#define INF_DBGID_DEFINITION_END - -/* WMI debug identifier definitions */ -#define WMI_DBGID_DEFINITION_START -#define WMI_CMD_RX_XTND_PKT_TOO_SHORT 1 -#define WMI_EXTENDED_CMD_NOT_HANDLED 2 -#define WMI_CMD_RX_PKT_TOO_SHORT 3 -#define WMI_CALLING_WMI_EXTENSION_FN 4 -#define WMI_CMD_NOT_HANDLED 5 -#define WMI_IN_SYNC 6 -#define WMI_TARGET_WMI_SYNC_CMD 7 -#define WMI_SET_SNR_THRESHOLD_PARAMS 8 -#define WMI_SET_RSSI_THRESHOLD_PARAMS 9 -#define WMI_SET_LQ_TRESHOLD_PARAMS 10 -#define WMI_TARGET_CREATE_PSTREAM_CMD 11 -#define WMI_WI_DTM_INUSE 12 -#define WMI_TARGET_DELETE_PSTREAM_CMD 13 -#define WMI_TARGET_IMPLICIT_DELETE_PSTREAM_CMD 14 -#define WMI_TARGET_GET_BIT_RATE_CMD 15 -#define WMI_GET_RATE_MASK_CMD_FIX_RATE_MASK_IS 16 -#define WMI_TARGET_GET_AVAILABLE_CHANNELS_CMD 17 -#define WMI_TARGET_GET_TX_PWR_CMD 18 -#define WMI_FREE_EVBUF_WMIBUF 19 -#define WMI_FREE_EVBUF_DATABUF 20 -#define WMI_FREE_EVBUF_BADFLAG 21 -#define WMI_HTC_RX_ERROR_DATA_PACKET 22 -#define WMI_HTC_RX_SYNC_PAUSING_FOR_MBOX 23 -#define WMI_INCORRECT_WMI_DATA_HDR_DROPPING_PKT 24 -#define WMI_SENDING_READY_EVENT 25 -#define WMI_SETPOWER_MDOE_TO_MAXPERF 26 -#define WMI_SETPOWER_MDOE_TO_REC 27 -#define WMI_BSSINFO_EVENT_FROM 28 -#define WMI_TARGET_GET_STATS_CMD 29 -#define WMI_SENDING_SCAN_COMPLETE_EVENT 30 -#define WMI_SENDING_RSSI_INDB_THRESHOLD_EVENT 31 -#define WMI_SENDING_RSSI_INDBM_THRESHOLD_EVENT 32 -#define WMI_SENDING_LINK_QUALITY_THRESHOLD_EVENT 33 -#define WMI_SENDING_ERROR_REPORT_EVENT 34 -#define WMI_SENDING_CAC_EVENT 35 -#define WMI_TARGET_GET_ROAM_TABLE_CMD 36 -#define WMI_TARGET_GET_ROAM_DATA_CMD 37 -#define WMI_SENDING_GPIO_INTR_EVENT 38 -#define WMI_SENDING_GPIO_ACK_EVENT 39 -#define WMI_SENDING_GPIO_DATA_EVENT 40 -#define WMI_CMD_RX 41 -#define WMI_CMD_RX_XTND 42 -#define WMI_EVENT_SEND 43 -#define WMI_EVENT_SEND_XTND 44 -#define WMI_CMD_PARAMS_DUMP_START 45 -#define WMI_CMD_PARAMS_DUMP_END 46 -#define WMI_CMD_PARAMS 47 -#define WMI_DBGID_DEFINITION_END - -/* MISC debug identifier definitions */ -#define MISC_DBGID_DEFINITION_START -#define MISC_WLAN_SCHEDULER_EVENT_REGISTER_ERROR 1 -#define TLPM_INIT 2 -#define TLPM_FILTER_POWER_STATE 3 -#define TLPM_NOTIFY_NOT_IDLE 4 -#define TLPM_TIMEOUT_IDLE_HANDLER 5 -#define TLPM_TIMEOUT_WAKEUP_HANDLER 6 -#define TLPM_WAKEUP_SIGNAL_HANDLER 7 -#define TLPM_UNEXPECTED_GPIO_INTR_ERROR 8 -#define TLPM_BREAK_ON_NOT_RECEIVED_ERROR 9 -#define TLPM_BREAK_OFF_NOT_RECIVED_ERROR 10 -#define TLPM_ACK_GPIO_INTR 11 -#define TLPM_ON 12 -#define TLPM_OFF 13 -#define TLPM_WAKEUP_FROM_HOST 14 -#define TLPM_WAKEUP_FROM_BT 15 -#define TLPM_TX_BREAK_RECIVED 16 -#define TLPM_IDLE_TIMER_NOT_RUNNING 17 -#define WAC_ENABLE 18 -#define WAC_SCAN_DONE 19 -#define WAC_REPORT_BSS 20 -#define WAC_START_WPS 21 -#define WAC_SCAN_REPLY 22 -#define WAC_UPDATE_BSS 23 -#define WAC_PIN_STATUS 24 -#define WAC_PIN_STATUS_REJECT 25 -#define WAC_RSSI_BELOW_THRESHOLD 26 -#define WAC_CTRL_REQ_CMD 27 -#define WAC_CTRL_REQ_REPLY 28 -#define DV_SET_ANTENNA 29 -#define MISC_DBGID_DEFINITION_END - -/* TXRX debug identifier definitions */ -#define TXRX_TXBUF_DBGID_DEFINITION_START -#define TXRX_TXBUF_ALLOCATE_BUF 1 -#define TXRX_TXBUF_QUEUE_BUF_TO_MBOX 2 -#define TXRX_TXBUF_QUEUE_BUF_TO_TXQ 3 -#define TXRX_TXBUF_TXQ_DEPTH 4 -#define TXRX_TXBUF_IBSS_QUEUE_TO_SFQ 5 -#define TXRX_TXBUF_IBSS_QUEUE_TO_TXQ_FRM_SFQ 6 -#define TXRX_TXBUF_INITIALIZE_TIMER 7 -#define TXRX_TXBUF_ARM_TIMER 8 -#define TXRX_TXBUF_DISARM_TIMER 9 -#define TXRX_TXBUF_UNINITIALIZE_TIMER 10 -#define TXRX_TXBUF_DBGID_DEFINITION_END - -#define TXRX_RXBUF_DBGID_DEFINITION_START -#define TXRX_RXBUF_ALLOCATE_BUF 1 -#define TXRX_RXBUF_QUEUE_TO_HOST 2 -#define TXRX_RXBUF_QUEUE_TO_WLAN 3 -#define TXRX_RXBUF_ZERO_LEN_BUF 4 -#define TXRX_RXBUF_QUEUE_TO_HOST_LASTBUF_IN_RXCHAIN 5 -#define TXRX_RXBUF_LASTBUF_IN_RXCHAIN_ZEROBUF 6 -#define TXRX_RXBUF_QUEUE_EMPTY_QUEUE_TO_WLAN 7 -#define TXRX_RXBUF_SEND_TO_RECV_MGMT 8 -#define TXRX_RXBUF_SEND_TO_IEEE_LAYER 9 -#define TXRX_RXBUF_REQUEUE_ERROR 10 -#define TXRX_RXBUF_DBGID_DEFINITION_END - -#define TXRX_MGMTBUF_DBGID_DEFINITION_START -#define TXRX_MGMTBUF_ALLOCATE_BUF 1 -#define TXRX_MGMTBUF_ALLOCATE_SM_BUF 2 -#define TXRX_MGMTBUF_ALLOCATE_RMBUF 3 -#define TXRX_MGMTBUF_GET_BUF 4 -#define TXRX_MGMTBUF_GET_SM_BUF 5 -#define TXRX_MGMTBUF_QUEUE_BUF_TO_TXQ 6 -#define TXRX_MGMTBUF_REAPED_BUF 7 -#define TXRX_MGMTBUF_REAPED_SM_BUF 8 -#define TXRX_MGMTBUF_WAIT_FOR_TXQ_DRAIN 9 -#define TXRX_MGMTBUF_WAIT_FOR_TXQ_SFQ_DRAIN 10 -#define TXRX_MGMTBUF_ENQUEUE_INTO_DATA_SFQ 11 -#define TXRX_MGMTBUF_DEQUEUE_FROM_DATA_SFQ 12 -#define TXRX_MGMTBUF_PAUSE_DATA_TXQ 13 -#define TXRX_MGMTBUF_RESUME_DATA_TXQ 14 -#define TXRX_MGMTBUF_WAIT_FORTXQ_DRAIN_TIMEOUT 15 -#define TXRX_MGMTBUF_DRAINQ 16 -#define TXRX_MGMTBUF_INDICATE_Q_DRAINED 17 -#define TXRX_MGMTBUF_ENQUEUE_INTO_HW_SFQ 18 -#define TXRX_MGMTBUF_DEQUEUE_FROM_HW_SFQ 19 -#define TXRX_MGMTBUF_PAUSE_HW_TXQ 20 -#define TXRX_MGMTBUF_RESUME_HW_TXQ 21 -#define TXRX_MGMTBUF_TEAR_DOWN_BA 22 -#define TXRX_MGMTBUF_PROCESS_ADDBA_REQ 23 -#define TXRX_MGMTBUF_PROCESS_DELBA 24 -#define TXRX_MGMTBUF_PERFORM_BA 25 -#define TXRX_MGMTBUF_WLAN_RESET_ON_ERROR 26 -#define TXRX_MGMTBUF_DBGID_DEFINITION_END - -/* PM (Power Module) debug identifier definitions */ -#define PM_DBGID_DEFINITION_START -#define PM_INIT 1 -#define PM_ENABLE 2 -#define PM_SET_STATE 3 -#define PM_SET_POWERMODE 4 -#define PM_CONN_NOTIFY 5 -#define PM_REF_COUNT_NEGATIVE 6 -#define PM_INFRA_STA_APSD_ENABLE 7 -#define PM_INFRA_STA_UPDATE_APSD_STATE 8 -#define PM_CHAN_OP_REQ 9 -#define PM_SET_MY_BEACON_POLICY 10 -#define PM_SET_ALL_BEACON_POLICY 11 -#define PM_INFRA_STA_SET_PM_PARAMS1 12 -#define PM_INFRA_STA_SET_PM_PARAMS2 13 -#define PM_ADHOC_SET_PM_CAPS_FAIL 14 -#define PM_ADHOC_UNKNOWN_IBSS_ATTRIB_ID 15 -#define PM_ADHOC_SET_PM_PARAMS 16 -#define PM_ADHOC_STATE1 18 -#define PM_ADHOC_STATE2 19 -#define PM_ADHOC_CONN_MAP 20 -#define PM_FAKE_SLEEP 21 -#define PM_AP_STATE1 22 -#define PM_AP_SET_PM_PARAMS 23 -#define PM_P2P_STATE1 24 -#define PM_DBGID_DEFINITION_END - -/* Wake on Wireless debug identifier definitions */ -#define WOW_DBGID_DEFINITION_START -#define WOW_INIT 1 -#define WOW_GET_CONFIG_DSET 2 -#define WOW_NO_CONFIG_DSET 3 -#define WOW_INVALID_CONFIG_DSET 4 -#define WOW_USE_DEFAULT_CONFIG 5 -#define WOW_SETUP_GPIO 6 -#define WOW_INIT_DONE 7 -#define WOW_SET_GPIO_PIN 8 -#define WOW_CLEAR_GPIO_PIN 9 -#define WOW_SET_WOW_MODE_CMD 10 -#define WOW_SET_HOST_MODE_CMD 11 -#define WOW_ADD_WOW_PATTERN_CMD 12 -#define WOW_NEW_WOW_PATTERN_AT_INDEX 13 -#define WOW_DEL_WOW_PATTERN_CMD 14 -#define WOW_LIST_CONTAINS_PATTERNS 15 -#define WOW_GET_WOW_LIST_CMD 16 -#define WOW_INVALID_FILTER_ID 17 -#define WOW_INVALID_FILTER_LISTID 18 -#define WOW_NO_VALID_FILTER_AT_ID 19 -#define WOW_NO_VALID_LIST_AT_ID 20 -#define WOW_NUM_PATTERNS_EXCEEDED 21 -#define WOW_NUM_LISTS_EXCEEDED 22 -#define WOW_GET_WOW_STATS 23 -#define WOW_CLEAR_WOW_STATS 24 -#define WOW_WAKEUP_HOST 25 -#define WOW_EVENT_WAKEUP_HOST 26 -#define WOW_EVENT_DISCARD 27 -#define WOW_PATTERN_MATCH 28 -#define WOW_PATTERN_NOT_MATCH 29 -#define WOW_PATTERN_NOT_MATCH_OFFSET 30 -#define WOW_DISABLED_HOST_ASLEEP 31 -#define WOW_ENABLED_HOST_ASLEEP_NO_PATTERNS 32 -#define WOW_ENABLED_HOST_ASLEEP_NO_MATCH_FOUND 33 -#define WOW_DBGID_DEFINITION_END - -/* WHAL debug identifier definitions */ -#define WHAL_DBGID_DEFINITION_START -#define WHAL_ERROR_ANI_CONTROL 1 -#define WHAL_ERROR_CHIP_TEST1 2 -#define WHAL_ERROR_CHIP_TEST2 3 -#define WHAL_ERROR_EEPROM_CHECKSUM 4 -#define WHAL_ERROR_EEPROM_MACADDR 5 -#define WHAL_ERROR_INTERRUPT_HIU 6 -#define WHAL_ERROR_KEYCACHE_RESET 7 -#define WHAL_ERROR_KEYCACHE_SET 8 -#define WHAL_ERROR_KEYCACHE_TYPE 9 -#define WHAL_ERROR_KEYCACHE_TKIPENTRY 10 -#define WHAL_ERROR_KEYCACHE_WEPLENGTH 11 -#define WHAL_ERROR_PHY_INVALID_CHANNEL 12 -#define WHAL_ERROR_POWER_AWAKE 13 -#define WHAL_ERROR_POWER_SET 14 -#define WHAL_ERROR_RECV_STOPDMA 15 -#define WHAL_ERROR_RECV_STOPPCU 16 -#define WHAL_ERROR_RESET_CHANNF1 17 -#define WHAL_ERROR_RESET_CHANNF2 18 -#define WHAL_ERROR_RESET_PM 19 -#define WHAL_ERROR_RESET_OFFSETCAL 20 -#define WHAL_ERROR_RESET_RFGRANT 21 -#define WHAL_ERROR_RESET_RXFRAME 22 -#define WHAL_ERROR_RESET_STOPDMA 23 -#define WHAL_ERROR_RESET_RECOVER 24 -#define WHAL_ERROR_XMIT_COMPUTE 25 -#define WHAL_ERROR_XMIT_NOQUEUE 26 -#define WHAL_ERROR_XMIT_ACTIVEQUEUE 27 -#define WHAL_ERROR_XMIT_BADTYPE 28 -#define WHAL_ERROR_XMIT_STOPDMA 29 -#define WHAL_ERROR_INTERRUPT_BB_PANIC 30 -#define WHAL_ERROR_RESET_TXIQCAL 31 -#define WHAL_ERROR_PAPRD_MAXGAIN_ABOVE_WINDOW 32 -#define WHAL_DBGID_DEFINITION_END - -/* DC debug identifier definitions */ -#define DC_DBGID_DEFINITION_START -#define DC_SCAN_CHAN_START 1 -#define DC_SCAN_CHAN_FINISH 2 -#define DC_BEACON_RECEIVE7 3 -#define DC_SSID_PROBE_CB 4 -#define DC_SEND_NEXT_SSID_PROBE 5 -#define DC_START_SEARCH 6 -#define DC_CANCEL_SEARCH_CB 7 -#define DC_STOP_SEARCH 8 -#define DC_END_SEARCH 9 -#define DC_MIN_CHDWELL_TIMEOUT 10 -#define DC_START_SEARCH_CANCELED 11 -#define DC_SET_POWER_MODE 12 -#define DC_INIT 13 -#define DC_SEARCH_OPPORTUNITY 14 -#define DC_RECEIVED_ANY_BEACON 15 -#define DC_RECEIVED_MY_BEACON 16 -#define DC_PROFILE_IS_ADHOC_BUT_BSS_IS_INFRA 17 -#define DC_PS_ENABLED_BUT_ATHEROS_IE_ABSENT 18 -#define DC_BSS_ADHOC_CHANNEL_NOT_ALLOWED 19 -#define DC_SET_BEACON_UPDATE 20 -#define DC_BEACON_UPDATE_COMPLETE 21 -#define DC_END_SEARCH_BEACON_UPDATE_COMP_CB 22 -#define DC_BSSINFO_EVENT_DROPPED 23 -#define DC_IEEEPS_ENABLED_BUT_ATIM_ABSENT 24 -#define DC_DBGID_DEFINITION_END - -/* CO debug identifier definitions */ -#define CO_DBGID_DEFINITION_START -#define CO_INIT 1 -#define CO_ACQUIRE_LOCK 2 -#define CO_START_OP1 3 -#define CO_START_OP2 4 -#define CO_DRAIN_TX_COMPLETE_CB 5 -#define CO_CHANGE_CHANNEL_CB 6 -#define CO_RETURN_TO_HOME_CHANNEL 7 -#define CO_FINISH_OP_TIMEOUT 8 -#define CO_OP_END 9 -#define CO_CANCEL_OP 10 -#define CO_CHANGE_CHANNEL 11 -#define CO_RELEASE_LOCK 12 -#define CO_CHANGE_STATE 13 -#define CO_DBGID_DEFINITION_END - -/* RO debug identifier definitions */ -#define RO_DBGID_DEFINITION_START -#define RO_REFRESH_ROAM_TABLE 1 -#define RO_UPDATE_ROAM_CANDIDATE 2 -#define RO_UPDATE_ROAM_CANDIDATE_CB 3 -#define RO_UPDATE_ROAM_CANDIDATE_FINISH 4 -#define RO_REFRESH_ROAM_TABLE_DONE 5 -#define RO_PERIODIC_SEARCH_CB 6 -#define RO_PERIODIC_SEARCH_TIMEOUT 7 -#define RO_INIT 8 -#define RO_BMISS_STATE1 9 -#define RO_BMISS_STATE2 10 -#define RO_SET_PERIODIC_SEARCH_ENABLE 11 -#define RO_SET_PERIODIC_SEARCH_DISABLE 12 -#define RO_ENABLE_SQ_THRESHOLD 13 -#define RO_DISABLE_SQ_THRESHOLD 14 -#define RO_ADD_BSS_TO_ROAM_TABLE 15 -#define RO_SET_PERIODIC_SEARCH_MODE 16 -#define RO_CONFIGURE_SQ_THRESHOLD1 17 -#define RO_CONFIGURE_SQ_THRESHOLD2 18 -#define RO_CONFIGURE_SQ_PARAMS 19 -#define RO_LOW_SIGNAL_QUALITY_EVENT 20 -#define RO_HIGH_SIGNAL_QUALITY_EVENT 21 -#define RO_REMOVE_BSS_FROM_ROAM_TABLE 22 -#define RO_UPDATE_CONNECTION_STATE_METRIC 23 -#define RO_LOWRSSI_SCAN_PARAMS 24 -#define RO_LOWRSSI_SCAN_START 25 -#define RO_LOWRSSI_SCAN_END 26 -#define RO_LOWRSSI_SCAN_CANCEL 27 -#define RO_LOWRSSI_ROAM_CANCEL 28 -#define RO_REFRESH_ROAM_CANDIDATE 29 -#define RO_DBGID_DEFINITION_END - -/* CM debug identifier definitions */ -#define CM_DBGID_DEFINITION_START -#define CM_INITIATE_HANDOFF 1 -#define CM_INITIATE_HANDOFF_CB 2 -#define CM_CONNECT_EVENT 3 -#define CM_DISCONNECT_EVENT 4 -#define CM_INIT 5 -#define CM_HANDOFF_SOURCE 6 -#define CM_SET_HANDOFF_TRIGGERS 7 -#define CM_CONNECT_REQUEST 8 -#define CM_CONNECT_REQUEST_CB 9 -#define CM_CONTINUE_SCAN_CB 10 -#define CM_DBGID_DEFINITION_END - - -/* mgmt debug identifier definitions */ -#define MGMT_DBGID_DEFINITION_START -#define KEYMGMT_CONNECTION_INIT 1 -#define KEYMGMT_CONNECTION_COMPLETE 2 -#define KEYMGMT_CONNECTION_CLOSE 3 -#define KEYMGMT_ADD_KEY 4 -#define MLME_NEW_STATE 5 -#define MLME_CONN_INIT 6 -#define MLME_CONN_COMPLETE 7 -#define MLME_CONN_CLOSE 8 -#define MLME_WLAN_OPMODE 9 -#define MLME_WLAN_SLOTTIME 10 -#define MGMT_DBGID_DEFINITION_END - -/* TMR debug identifier definitions */ -#define TMR_DBGID_DEFINITION_START -#define TMR_HANG_DETECTED 1 -#define TMR_WDT_TRIGGERED 2 -#define TMR_WDT_RESET 3 -#define TMR_HANDLER_ENTRY 4 -#define TMR_HANDLER_EXIT 5 -#define TMR_SAVED_START 6 -#define TMR_SAVED_END 7 -#define TMR_DBGID_DEFINITION_END - -/* BTCOEX debug identifier definitions */ -#define BTCOEX_DBGID_DEFINITION_START -#define BTCOEX_STATUS_CMD 1 -#define BTCOEX_PARAMS_CMD 2 -#define BTCOEX_ANT_CONFIG 3 -#define BTCOEX_COLOCATED_BT_DEVICE 4 -#define BTCOEX_CLOSE_RANGE_SCO_ON 5 -#define BTCOEX_CLOSE_RANGE_SCO_OFF 6 -#define BTCOEX_CLOSE_RANGE_A2DP_ON 7 -#define BTCOEX_CLOSE_RANGE_A2DP_OFF 8 -#define BTCOEX_A2DP_PROTECT_ON 9 -#define BTCOEX_A2DP_PROTECT_OFF 10 -#define BTCOEX_SCO_PROTECT_ON 11 -#define BTCOEX_SCO_PROTECT_OFF 12 -#define BTCOEX_CLOSE_RANGE_DETECTOR_START 13 -#define BTCOEX_CLOSE_RANGE_DETECTOR_STOP 14 -#define BTCOEX_CLOSE_RANGE_TOGGLE 15 -#define BTCOEX_CLOSE_RANGE_TOGGLE_RSSI_LRCNT 16 -#define BTCOEX_CLOSE_RANGE_RSSI_THRESH 17 -#define BTCOEX_CLOSE_RANGE_LOW_RATE_THRESH 18 -#define BTCOEX_PTA_PRI_INTR_HANDLER 19 -#define BTCOEX_PSPOLL_QUEUED 20 -#define BTCOEX_PSPOLL_COMPLETE 21 -#define BTCOEX_DBG_PM_AWAKE 22 -#define BTCOEX_DBG_PM_SLEEP 23 -#define BTCOEX_DBG_SCO_COEX_ON 24 -#define BTCOEX_SCO_DATARECEIVE 25 -#define BTCOEX_INTR_INIT 26 -#define BTCOEX_PTA_PRI_DIFF 27 -#define BTCOEX_TIM_NOTIFICATION 28 -#define BTCOEX_SCO_WAKEUP_ON_DATA 29 -#define BTCOEX_SCO_SLEEP 30 -#define BTCOEX_SET_WEIGHTS 31 -#define BTCOEX_SCO_DATARECEIVE_LATENCY_VAL 32 -#define BTCOEX_SCO_MEASURE_TIME_DIFF 33 -#define BTCOEX_SET_EOL_VAL 34 -#define BTCOEX_OPT_DETECT_HANDLER 35 -#define BTCOEX_SCO_TOGGLE_STATE 36 -#define BTCOEX_SCO_STOMP 37 -#define BTCOEX_NULL_COMP_CALLBACK 38 -#define BTCOEX_RX_INCOMING 39 -#define BTCOEX_RX_INCOMING_CTL 40 -#define BTCOEX_RX_INCOMING_MGMT 41 -#define BTCOEX_RX_INCOMING_DATA 42 -#define BTCOEX_RTS_RECEPTION 43 -#define BTCOEX_FRAME_PRI_LOW_RATE_THRES 44 -#define BTCOEX_PM_FAKE_SLEEP 45 -#define BTCOEX_ACL_COEX_STATUS 46 -#define BTCOEX_ACL_COEX_DETECTION 47 -#define BTCOEX_A2DP_COEX_STATUS 48 -#define BTCOEX_SCO_STATUS 49 -#define BTCOEX_WAKEUP_ON_DATA 50 -#define BTCOEX_DATARECEIVE 51 -#define BTCOEX_GET_MAX_AGGR_SIZE 53 -#define BTCOEX_MAX_AGGR_AVAIL_TIME 54 -#define BTCOEX_DBG_WBTIMER_INTR 55 -#define BTCOEX_DBG_SCO_SYNC 57 -#define BTCOEX_UPLINK_QUEUED_RATE 59 -#define BTCOEX_DBG_UPLINK_ENABLE_EOL 60 -#define BTCOEX_UPLINK_FRAME_DURATION 61 -#define BTCOEX_UPLINK_SET_EOL 62 -#define BTCOEX_DBG_EOL_EXPIRED 63 -#define BTCOEX_DBG_DATA_COMPLETE 64 -#define BTCOEX_UPLINK_QUEUED_TIMESTAMP 65 -#define BTCOEX_DBG_DATA_COMPLETE_TIME 66 -#define BTCOEX_DBG_A2DP_ROLE_IS_SLAVE 67 -#define BTCOEX_DBG_A2DP_ROLE_IS_MASTER 68 -#define BTCOEX_DBG_UPLINK_SEQ_NUM 69 -#define BTCOEX_UPLINK_AGGR_SEQ 70 -#define BTCOEX_DBG_TX_COMP_SEQ_NO 71 -#define BTCOEX_DBG_MAX_AGGR_PAUSE_STATE 72 -#define BTCOEX_DBG_ACL_TRAFFIC 73 -#define BTCOEX_CURR_AGGR_PROP 74 -#define BTCOEX_DBG_SCO_GET_PER_TIME_DIFF 75 -#define BTCOEX_PSPOLL_PROCESS 76 -#define BTCOEX_RETURN_FROM_MAC 77 -#define BTCOEX_FREED_REQUEUED_CNT 78 -#define BTCOEX_DBG_TOGGLE_LOW_RATES 79 -#define BTCOEX_MAC_GOES_TO_SLEEP 80 -#define BTCOEX_DBG_A2DP_NO_SYNC 81 -#define BTCOEX_RETURN_FROM_MAC_HOLD_Q_INFO 82 -#define BTCOEX_RETURN_FROM_MAC_AC 83 -#define BTCOEX_DBG_DTIM_RECV 84 -#define BTCOEX_IS_PRE_UPDATE 86 -#define BTCOEX_ENQUEUED_BIT_MAP 87 -#define BTCOEX_TX_COMPLETE_FIRST_DESC_STATS 88 -#define BTCOEX_UPLINK_DESC 89 -#define BTCOEX_SCO_GET_PER_FIRST_FRM_TIMESTAMP 90 -#define BTCOEX_DBG_RECV_ACK 94 -#define BTCOEX_DBG_ADDBA_INDICATION 95 -#define BTCOEX_TX_COMPLETE_EOL_FAILED 96 -#define BTCOEX_DBG_A2DP_USAGE_COMPLETE 97 -#define BTCOEX_DBG_A2DP_STOMP_FOR_BCN_HANDLER 98 -#define BTCOEX_DBG_A2DP_SYNC_INTR 99 -#define BTCOEX_DBG_A2DP_STOMP_FOR_BCN_RECEPTION 100 -#define BTCOEX_FORM_AGGR_CURR_AGGR 101 -#define BTCOEX_DBG_TOGGLE_A2DP_BURST_CNT 102 -#define BTCOEX_DBG_BT_TRAFFIC 103 -#define BTCOEX_DBG_STOMP_BT_TRAFFIC 104 -#define BTCOEX_RECV_NULL 105 -#define BTCOEX_DBG_A2DP_MASTER_BT_END 106 -#define BTCOEX_DBG_A2DP_BT_START 107 -#define BTCOEX_DBG_A2DP_SLAVE_BT_END 108 -#define BTCOEX_DBG_A2DP_STOMP_BT 109 -#define BTCOEX_DBG_GO_TO_SLEEP 110 -#define BTCOEX_DBG_A2DP_PKT 111 -#define BTCOEX_DBG_A2DP_PSPOLL_DATA_RECV 112 -#define BTCOEX_DBG_A2DP_NULL 113 -#define BTCOEX_DBG_UPLINK_DATA 114 -#define BTCOEX_DBG_A2DP_STOMP_LOW_PRIO_NULL 115 -#define BTCOEX_DBG_ADD_BA_RESP_TIMEOUT 116 -#define BTCOEX_DBG_TXQ_STATE 117 -#define BTCOEX_DBG_ALLOW_SCAN 118 -#define BTCOEX_DBG_SCAN_REQUEST 119 -#define BTCOEX_A2DP_SLEEP 127 -#define BTCOEX_DBG_DATA_ACTIV_TIMEOUT 128 -#define BTCOEX_DBG_SWITCH_TO_PSPOLL_ON_MODE 129 -#define BTCOEX_DBG_SWITCH_TO_PSPOLL_OFF_MODE 130 -#define BTCOEX_DATARECEIVE_AGGR 131 -#define BTCOEX_DBG_DATA_RECV_SLEEPING_PENDING 132 -#define BTCOEX_DBG_DATARESP_TIMEOUT 133 -#define BTCOEX_BDG_BMISS 134 -#define BTCOEX_DBG_DATA_RECV_WAKEUP_TIM 135 -#define BTCOEX_DBG_SECOND_BMISS 136 -#define BTCOEX_DBG_SET_WLAN_STATE 138 -#define BTCOEX_BDG_FIRST_BMISS 139 -#define BTCOEX_DBG_A2DP_CHAN_OP 140 -#define BTCOEX_DBG_A2DP_INTR 141 -#define BTCOEX_DBG_BT_INQUIRY 142 -#define BTCOEX_DBG_BT_INQUIRY_DATA_FETCH 143 -#define BTCOEX_DBG_POST_INQUIRY_FINISH 144 -#define BTCOEX_DBG_SCO_OPT_MODE_TIMER_HANDLER 145 -#define BTCOEX_DBG_NULL_FRAME_SLEEP 146 -#define BTCOEX_DBG_NULL_FRAME_AWAKE 147 -#define BTCOEX_DBG_SET_AGGR_SIZE 152 -#define BTCOEX_DBG_TEAR_BA_TIMEOUT 153 -#define BTCOEX_DBG_MGMT_FRAME_SEQ_NO 154 -#define BTCOEX_DBG_SCO_STOMP_HIGH_PRI 155 -#define BTCOEX_DBG_COLOCATED_BT_DEV 156 -#define BTCOEX_DBG_FE_ANT_TYPE 157 -#define BTCOEX_DBG_BT_INQUIRY_CMD 158 -#define BTCOEX_DBG_SCO_CONFIG 159 -#define BTCOEX_DBG_SCO_PSPOLL_CONFIG 160 -#define BTCOEX_DBG_SCO_OPTMODE_CONFIG 161 -#define BTCOEX_DBG_A2DP_CONFIG 162 -#define BTCOEX_DBG_A2DP_PSPOLL_CONFIG 163 -#define BTCOEX_DBG_A2DP_OPTMODE_CONFIG 164 -#define BTCOEX_DBG_ACLCOEX_CONFIG 165 -#define BTCOEX_DBG_ACLCOEX_PSPOLL_CONFIG 166 -#define BTCOEX_DBG_ACLCOEX_OPTMODE_CONFIG 167 -#define BTCOEX_DBG_DEBUG_CMD 168 -#define BTCOEX_DBG_SET_BT_OPERATING_STATUS 169 -#define BTCOEX_DBG_GET_CONFIG 170 -#define BTCOEX_DBG_GET_STATS 171 -#define BTCOEX_DBG_BT_OPERATING_STATUS 172 -#define BTCOEX_DBG_PERFORM_RECONNECT 173 -#define BTCOEX_DBG_ACL_WLAN_MED 175 -#define BTCOEX_DBG_ACL_BT_MED 176 -#define BTCOEX_DBG_WLAN_CONNECT 177 -#define BTCOEX_DBG_A2DP_DUAL_START 178 -#define BTCOEX_DBG_PMAWAKE_NOTIFY 179 -#define BTCOEX_DBG_BEACON_SCAN_ENABLE 180 -#define BTCOEX_DBG_BEACON_SCAN_DISABLE 181 -#define BTCOEX_DBG_RX_NOTIFY 182 -#define BTCOEX_SCO_GET_PER_SECOND_FRM_TIMESTAMP 183 -#define BTCOEX_DBG_TXQ_DETAILS 184 -#define BTCOEX_DBG_SCO_STOMP_LOW_PRI 185 -#define BTCOEX_DBG_A2DP_FORCE_SCAN 186 -#define BTCOEX_DBG_DTIM_STOMP_COMP 187 -#define BTCOEX_ACL_PRESENCE_TIMER 188 -#define BTCOEX_DBG_QUEUE_SELF_CTS 189 -#define BTCOEX_DBG_SELF_CTS_COMP 190 -#define BTCOEX_DBG_APMODE_WAIT_FOR_CTS_COMP_FAILED 191 -#define BTCOEX_DBG_APMODE_A2DP_MED_TO_BT 192 -#define BTCOEX_DBG_APMODE_SET_BTSTATE 193 -#define BTCOEX_DBG_APMODE_A2DP_STATUS 194 -#define BTCOEX_DBG_APMODE_SCO_CTS_HANDLER 195 -#define BTCOEX_DBG_APMODE_SCO_STATUS 196 -#define BTCOEX_DBG_APMODE_TXQ_DRAINED 197 -#define BTCOEX_DBG_APMODE_SCO_ARM_TIMER 198 -#define BTCOEX_DBG_APMODE_SWITCH_MED_TO_WLAN 199 -#define BTCOEX_APMODE_BCN_TX_HANDLER 200 -#define BTCOEX_APMODE_BCN_TX 201 -#define BTCOEX_APMODE_SCO_RTS_HANDLER 202 -#define BTCOEX_DBGID_DEFINITION_END - -#ifdef __cplusplus -} -#endif - -#endif /* _DBGLOG_ID_H_ */ diff --git a/drivers/net/wireless/ar6003/include/dfs_common.h b/drivers/net/wireless/ar6003/include/dfs_common.h deleted file mode 100644 index cf1844fbb2c6..000000000000 --- a/drivers/net/wireless/ar6003/include/dfs_common.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2005-2006 Atheros Communications, Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -#ifndef _DFS_COMMON_H_ -#define _DFS_COMMON_H_ - -enum { - DFS_UNINIT_DOMAIN = 0, /* Uninitialized dfs domain */ - DFS_FCC_DOMAIN = 1, /* FCC3 dfs domain */ - DFS_ETSI_DOMAIN = 2, /* ETSI dfs domain */ - DFS_MKK4_DOMAIN = 3 /* Japan dfs domain */ -}; - - - -#define MAX_BIN5_DUR 131 /* 105 * 1.25*/ - -PREPACK struct ath_dfs_capinfo { - A_UINT64 ext_chan_busy_ts; - A_UINT8 enable_ar; - A_UINT8 enable_radar; -} POSTPACK; - -typedef struct ath_dfs_capinfo WMI_DFS_HOST_ATTACH_EVENT; - -PREPACK struct ath_dfs_info { - A_UINT32 dfs_domain; -} POSTPACK; - -typedef struct ath_dfs_info WMI_DFS_HOST_INIT_EVENT; - - -PREPACK struct dfs_event_info { - A_UINT64 full_ts; /* 64-bit full timestamp from interrupt time */ - A_UINT32 ts; /* Original 15 bit recv timestamp */ - A_UINT32 ext_chan_busy; /* Ext chan busy % */ - A_UINT8 rssi; /* rssi of radar event */ - A_UINT8 dur; /* duration of radar pulse */ - A_UINT8 chanindex; /* Channel of event */ - A_UINT8 flags; -#define CH_TYPE_MASK 1 -#define PRIMARY_CH 0 -#define EXT_CH 1 -#define EVENT_TYPE_MASK 2 -#define AR_EVENT 0 -#define DFS_EVENT 2 -} POSTPACK; - -/* XXX: Replace 256 with WMI_SVC_MAX_BUFFERED_EVENT_SIZE */ -#define WMI_DFS_EVENT_MAX_BUFFER_SIZE ((256 - 1)/sizeof(struct dfs_event_info)) -/* Fill in event info */ -PREPACK struct dfs_ev_buffer { - A_UINT8 num_events; - struct dfs_event_info ev_info[WMI_DFS_EVENT_MAX_BUFFER_SIZE]; -} POSTPACK; - -typedef struct dfs_ev_buffer WMI_DFS_PHYERR_EVENT; - - - /* This should match the table from if_ath.c */ -enum { - ATH_DEBUG_DFS = 0x00000100, /* Minimal DFS debug */ - ATH_DEBUG_DFS1 = 0x00000200, /* Normal DFS debug */ - ATH_DEBUG_DFS2 = 0x00000400, /* Maximal DFS debug */ - ATH_DEBUG_DFS3 = 0x00000800, /* matched filterID display */ -}; - -#define TRAFFIC_DETECTED 1 - -#endif /* _DFS_H_ */ diff --git a/drivers/net/wireless/ar6003/include/discovery.h b/drivers/net/wireless/ar6003/include/discovery.h deleted file mode 100644 index e81d707cf830..000000000000 --- a/drivers/net/wireless/ar6003/include/discovery.h +++ /dev/null @@ -1,77 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef _DISCOVERY_H_ -#define _DISCOVERY_H_ - -/* - * DC_SCAN_PRIORITY is an 8-bit bitmap of the scan priority of a channel - */ -typedef enum { - DEFAULT_SCPRI = 0x01, - POPULAR_SCPRI = 0x02, - SSIDS_SCPRI = 0x04, - PROF_SCPRI = 0x08, - DISABLE_SCPRI = 0x10, -} DC_SCAN_PRIORITY; - -/* The following search type construct can be used to manipulate the behavior of the search module based on different bits set */ -typedef enum { - SCAN_RESET = 0, - SCAN_ALL = (DEFAULT_SCPRI | POPULAR_SCPRI | \ - SSIDS_SCPRI | PROF_SCPRI), - - SCAN_POPULAR = (POPULAR_SCPRI | SSIDS_SCPRI | PROF_SCPRI), - SCAN_SSIDS = (SSIDS_SCPRI | PROF_SCPRI), - SCAN_PROF_MASK = (PROF_SCPRI), - SCAN_MULTI_CHANNEL = 0x000100, - SCAN_DETERMINISTIC = 0x000200, - SCAN_PROFILE_MATCH_TERMINATED = 0x000400, - SCAN_HOME_CHANNEL_SKIP = 0x000800, - SCAN_CHANNEL_LIST_CONTINUE = 0x001000, - SCAN_CURRENT_SSID_SKIP = 0x002000, - SCAN_ACTIVE_PROBE_DISABLE = 0x004000, - SCAN_CHANNEL_HINT_ONLY = 0x008000, - SCAN_ACTIVE_CHANNELS_ONLY = 0x010000, - SCAN_UNUSED1 = 0x020000, /* unused */ - SCAN_PERIODIC = 0x040000, - SCAN_FIXED_DURATION = 0x080000, - SCAN_AP_ASSISTED = 0x100000, - SCAN_DONOT_RETURN_TO_HOME_AFTERSCAN = 0x200000, -} DC_SCAN_TYPE; - -typedef enum { - BSS_REPORTING_DEFAULT = 0x0, - EXCLUDE_NON_SCAN_RESULTS = 0x1, /* Exclude results outside of scan */ -} DC_BSS_REPORTING_POLICY; - -typedef enum { - DC_IGNORE_WPAx_GROUP_CIPHER = 0x01, - DC_PROFILE_MATCH_DONE = 0x02, - DC_IGNORE_AAC_BEACON = 0x04, - DC_CSA_FOLLOW_BSS = 0x08, -} DC_PROFILE_FILTER; - -#define DEFAULT_DC_PROFILE_FILTER (DC_CSA_FOLLOW_BSS) - -#endif /* _DISCOVERY_H_ */ diff --git a/drivers/net/wireless/ar6003/include/dset_internal.h b/drivers/net/wireless/ar6003/include/dset_internal.h deleted file mode 100644 index 2460f0ecf12b..000000000000 --- a/drivers/net/wireless/ar6003/include/dset_internal.h +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - - -#ifndef __DSET_INTERNAL_H__ -#define __DSET_INTERNAL_H__ - -#ifndef ATH_TARGET -#include "athstartpack.h" -#endif - -/* - * Internal dset definitions, common for DataSet layer. - */ - -#define DSET_TYPE_STANDARD 0 -#define DSET_TYPE_BPATCHED 1 -#define DSET_TYPE_COMPRESSED 2 - -/* Dataset descriptor */ - -typedef PREPACK struct dset_descriptor_s { - struct dset_descriptor_s *next; /* List link. NULL only at the last - descriptor */ - A_UINT16 id; /* Dset ID */ - A_UINT16 size; /* Dset size. */ - void *DataPtr; /* Pointer to raw data for standard - DataSet or pointer to original - dset_descriptor for patched - DataSet */ - A_UINT32 data_type; /* DSET_TYPE_*, above */ - - void *AuxPtr; /* Additional data that might - needed for data_type. For - example, pointer to patch - Dataset descriptor for BPatch. */ -} POSTPACK dset_descriptor_t; - -#ifndef ATH_TARGET -#include "athendpack.h" -#endif - -#endif /* __DSET_INTERNAL_H__ */ diff --git a/drivers/net/wireless/ar6003/include/dsetid.h b/drivers/net/wireless/ar6003/include/dsetid.h deleted file mode 100644 index d08fdeb39ec3..000000000000 --- a/drivers/net/wireless/ar6003/include/dsetid.h +++ /dev/null @@ -1,134 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - - -#ifndef __DSETID_H__ -#define __DSETID_H__ - -#ifndef ATH_TARGET -#include "athstartpack.h" -#endif - -/* Well-known DataSet IDs */ -#define DSETID_UNUSED 0x00000000 -#define DSETID_BOARD_DATA 0x00000001 /* Cal and board data */ -#define DSETID_REGDB 0x00000002 /* Regulatory Database */ -#define DSETID_POWER_CONTROL 0x00000003 /* TX Pwr Lim & Ant Gain */ -#define DSETID_USER_CONFIG 0x00000004 /* User Configuration */ - -#define DSETID_ANALOG_CONTROL_DATA_START 0x00000005 -#define DSETID_ANALOG_CONTROL_DATA_END 0x00000025 -/* - * Get DSETID for various reference clock speeds. - * For each speed there are three DataSets that correspond - * to the three columns of bank6 data (addr, 11a, 11b/g). - * This macro returns the dsetid of the first of those - * three DataSets. - */ -#define ANALOG_CONTROL_DATA_DSETID(refclk) \ - (DSETID_ANALOG_CONTROL_DATA_START + 3*refclk) - -/* - * There are TWO STARTUP_PATCH DataSets. - * DSETID_STARTUP_PATCH is historical, and was applied before BMI on - * earlier systems. On AR6002, it is applied after BMI, just like - * DSETID_STARTUP_PATCH2. - */ -#define DSETID_STARTUP_PATCH 0x00000026 -#define DSETID_GPIO_CONFIG_PATCH 0x00000027 -#define DSETID_WLANREGS 0x00000028 /* override wlan regs */ -#define DSETID_STARTUP_PATCH2 0x00000029 - -#define DSETID_WOW_CONFIG 0x00000090 /* WoW Configuration */ - -/* Add WHAL_INI_DATA_ID to DSETID_INI_DATA for a specific WHAL INI table. */ -#define DSETID_INI_DATA 0x00000100 -/* Reserved for WHAL INI Tables: 0x100..0x11f */ -#define DSETID_INI_DATA_END 0x0000011f - -#define DSETID_VENDOR_START 0x00010000 /* Vendor-defined DataSets */ - -#define DSETID_INDEX_END 0xfffffffe /* Reserved to indicate the - end of a memory-based - DataSet Index */ -#define DSETID_INDEX_FREE 0xffffffff /* An unused index entry */ - -/* - * PATCH DataSet format: - * A list of patches, terminated by a patch with - * address=PATCH_END. - * - * This allows for patches to be stored in flash. - */ -PREPACK struct patch_s { - A_UINT32 *address; - A_UINT32 data; -} POSTPACK ; - -/* - * Skip some patches. Can be used to erase a single patch in a - * patch DataSet without having to re-write the DataSet. May - * also be used to embed information for use by subsequent - * patch code. The "data" in a PATCH_SKIP tells how many - * bytes of length "patch_s" to skip. - */ -#define PATCH_SKIP ((A_UINT32 *)0x00000000) - -/* - * Execute code at the address specified by "data". - * The address of the patch structure is passed as - * the one parameter. - */ -#define PATCH_CODE_ABS ((A_UINT32 *)0x00000001) - -/* - * Same as PATCH_CODE_ABS, but treat "data" as an - * offset from the start of the patch word. - */ -#define PATCH_CODE_REL ((A_UINT32 *)0x00000002) - -/* Mark the end of this patch DataSet. */ -#define PATCH_END ((A_UINT32 *)0xffffffff) - -/* - * A DataSet which contains a Binary Patch to some other DataSet - * uses the original dsetid with the DSETID_BPATCH_FLAG bit set. - * Such a BPatch DataSet consists of BPatch metadata followed by - * the bdiff bytes. BPatch metadata consists of a single 32-bit - * word that contains the size of the BPatched final image. - * - * To create a suitable bdiff DataSet, use bdiff in host/tools/bdiff - * to create "diffs": - * bdiff -q -O -nooldmd5 -nonewmd5 -d ORIGfile NEWfile diffs - * Then add BPatch metadata to the start of "diffs". - * - * NB: There are some implementation-induced restrictions - * on which DataSets can be BPatched. - */ -#define DSETID_BPATCH_FLAG 0x80000000 - -#ifndef ATH_TARGET -#include "athendpack.h" -#endif - -#endif /* __DSETID_H__ */ diff --git a/drivers/net/wireless/ar6003/include/epping_test.h b/drivers/net/wireless/ar6003/include/epping_test.h deleted file mode 100644 index f8aeb3f657ea..000000000000 --- a/drivers/net/wireless/ar6003/include/epping_test.h +++ /dev/null @@ -1,120 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2009-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -// - -/* This file contains shared definitions for the host/target endpoint ping test */ - -#ifndef EPPING_TEST_H_ -#define EPPING_TEST_H_ - -#ifndef ATH_TARGET -#include "athstartpack.h" -#endif - - /* alignment to 4-bytes */ -#define EPPING_ALIGNMENT_PAD (((sizeof(HTC_FRAME_HDR) + 3) & (~0x3)) - sizeof(HTC_FRAME_HDR)) - -#ifndef A_OFFSETOF -#define A_OFFSETOF(type,field) (int)(&(((type *)NULL)->field)) -#endif - -#define EPPING_RSVD_FILL 0xCC - -#define HCI_RSVD_EXPECTED_PKT_TYPE_RECV_OFFSET 7 - -typedef PREPACK struct { - A_UINT8 _HCIRsvd[8]; /* reserved for HCI packet header (GMBOX) testing */ - A_UINT8 StreamEcho_h; /* stream no. to echo this packet on (filled by host) */ - A_UINT8 StreamEchoSent_t; /* stream no. packet was echoed to (filled by target) - When echoed: StreamEchoSent_t == StreamEcho_h */ - A_UINT8 StreamRecv_t; /* stream no. that target received this packet on (filled by target) */ - A_UINT8 StreamNo_h; /* stream number to send on (filled by host) */ - A_UINT8 Magic_h[4]; /* magic number to filter for this packet on the host*/ - A_UINT8 _rsvd[6]; /* reserved fields that must be set to a "reserved" value - since this packet maps to a 14-byte ethernet frame we want - to make sure ethertype field is set to something unknown */ - - A_UINT8 _pad[2]; /* padding for alignment */ - A_UINT8 TimeStamp[8]; /* timestamp of packet (host or target) */ - A_UINT32 HostContext_h; /* 4 byte host context, target echos this back */ - A_UINT32 SeqNo; /* sequence number (set by host or target) */ - A_UINT16 Cmd_h; /* ping command (filled by host) */ - A_UINT16 CmdFlags_h; /* optional flags */ - A_UINT8 CmdBuffer_h[8]; /* buffer for command (host -> target) */ - A_UINT8 CmdBuffer_t[8]; /* buffer for command (target -> host) */ - A_UINT16 DataLength; /* length of data */ - A_UINT16 DataCRC; /* 16 bit CRC of data */ - A_UINT16 HeaderCRC; /* header CRC (fields : StreamNo_h to end, minus HeaderCRC) */ -} POSTPACK EPPING_HEADER; - -#define EPPING_PING_MAGIC_0 0xAA -#define EPPING_PING_MAGIC_1 0x55 -#define EPPING_PING_MAGIC_2 0xCE -#define EPPING_PING_MAGIC_3 0xEC - - - -#define IS_EPPING_PACKET(pPkt) (((pPkt)->Magic_h[0] == EPPING_PING_MAGIC_0) && \ - ((pPkt)->Magic_h[1] == EPPING_PING_MAGIC_1) && \ - ((pPkt)->Magic_h[2] == EPPING_PING_MAGIC_2) && \ - ((pPkt)->Magic_h[3] == EPPING_PING_MAGIC_3)) - -#define SET_EPPING_PACKET_MAGIC(pPkt) { (pPkt)->Magic_h[0] = EPPING_PING_MAGIC_0; \ - (pPkt)->Magic_h[1] = EPPING_PING_MAGIC_1; \ - (pPkt)->Magic_h[2] = EPPING_PING_MAGIC_2; \ - (pPkt)->Magic_h[3] = EPPING_PING_MAGIC_3;} - -#define CMD_FLAGS_DATA_CRC (1 << 0) /* DataCRC field is valid */ -#define CMD_FLAGS_DELAY_ECHO (1 << 1) /* delay the echo of the packet */ -#define CMD_FLAGS_NO_DROP (1 << 2) /* do not drop at HTC layer no matter what the stream is */ - -#define IS_EPING_PACKET_NO_DROP(pPkt) ((pPkt)->CmdFlags_h & CMD_FLAGS_NO_DROP) - -#define EPPING_CMD_ECHO_PACKET 1 /* echo packet test */ -#define EPPING_CMD_RESET_RECV_CNT 2 /* reset recv count */ -#define EPPING_CMD_CAPTURE_RECV_CNT 3 /* fetch recv count, 4-byte count returned in CmdBuffer_t */ -#define EPPING_CMD_NO_ECHO 4 /* non-echo packet test (tx-only) */ -#define EPPING_CMD_CONT_RX_START 5 /* continous RX packets, parameters are in CmdBuffer_h */ -#define EPPING_CMD_CONT_RX_STOP 6 /* stop continuous RX packet transmission */ - - /* test command parameters may be no more than 8 bytes */ -typedef PREPACK struct { - A_UINT16 BurstCnt; /* number of packets to burst together (for HTC 2.1 testing) */ - A_UINT16 PacketLength; /* length of packet to generate including header */ - A_UINT16 Flags; /* flags */ - -#define EPPING_CONT_RX_DATA_CRC (1 << 0) /* Add CRC to all data */ -#define EPPING_CONT_RX_RANDOM_DATA (1 << 1) /* randomize the data pattern */ -#define EPPING_CONT_RX_RANDOM_LEN (1 << 2) /* randomize the packet lengths */ -} POSTPACK EPPING_CONT_RX_PARAMS; - -#define EPPING_HDR_CRC_OFFSET A_OFFSETOF(EPPING_HEADER,StreamNo_h) -#define EPPING_HDR_BYTES_CRC (sizeof(EPPING_HEADER) - EPPING_HDR_CRC_OFFSET - (sizeof(A_UINT16))) - -#define HCI_TRANSPORT_STREAM_NUM 16 /* this number is higher than the define WMM AC classes so we - can use this to distinguish packets */ - -#ifndef ATH_TARGET -#include "athendpack.h" -#endif - - -#endif /*EPPING_TEST_H_*/ diff --git a/drivers/net/wireless/ar6003/include/gmboxif.h b/drivers/net/wireless/ar6003/include/gmboxif.h deleted file mode 100644 index ac251b6bef7a..000000000000 --- a/drivers/net/wireless/ar6003/include/gmboxif.h +++ /dev/null @@ -1,83 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2009-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef __GMBOXIF_H__ -#define __GMBOXIF_H__ - -#ifndef ATH_TARGET -#include "athstartpack.h" -#endif - -/* GMBOX interface definitions */ - -#define AR6K_GMBOX_CREDIT_COUNTER 1 /* we use credit counter 1 to track credits */ -#define AR6K_GMBOX_CREDIT_SIZE_COUNTER 2 /* credit counter 2 is used to pass the size of each credit */ - - - /* HCI UART transport definitions when used over GMBOX interface */ -#define HCI_UART_COMMAND_PKT 0x01 -#define HCI_UART_ACL_PKT 0x02 -#define HCI_UART_SCO_PKT 0x03 -#define HCI_UART_EVENT_PKT 0x04 - - /* definitions for BT HCI packets */ -typedef PREPACK struct { - A_UINT16 Flags_ConnHandle; - A_UINT16 Length; -} POSTPACK BT_HCI_ACL_HEADER; - -typedef PREPACK struct { - A_UINT16 Flags_ConnHandle; - A_UINT8 Length; -} POSTPACK BT_HCI_SCO_HEADER; - -typedef PREPACK struct { - A_UINT16 OpCode; - A_UINT8 ParamLength; -} POSTPACK BT_HCI_COMMAND_HEADER; - -typedef PREPACK struct { - A_UINT8 EventCode; - A_UINT8 ParamLength; -} POSTPACK BT_HCI_EVENT_HEADER; - -/* MBOX host interrupt signal assignments */ - -#define MBOX_SIG_HCI_BRIDGE_MAX 8 -#define MBOX_SIG_HCI_BRIDGE_BT_ON 0 -#define MBOX_SIG_HCI_BRIDGE_BT_OFF 1 -#define MBOX_SIG_HCI_BRIDGE_BAUD_SET 2 -#define MBOX_SIG_HCI_BRIDGE_PWR_SAV_ON 3 -#define MBOX_SIG_HCI_BRIDGE_PWR_SAV_OFF 4 - -/* Host interrupts target to change baud rate and - * baud rate info is stored in scratch registers 4 and 5 - */ -#define LSB_SCRATCH_IDX 4 -#define MSB_SCRATCH_IDX 5 - -#ifndef ATH_TARGET -#include "athendpack.h" -#endif - -#endif /* __GMBOXIF_H__ */ - diff --git a/drivers/net/wireless/ar6003/include/gpio.h b/drivers/net/wireless/ar6003/include/gpio.h deleted file mode 100644 index 0334f2c3319a..000000000000 --- a/drivers/net/wireless/ar6003/include/gpio.h +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2005-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#define AR6001_GPIO_PIN_COUNT 18 -#define AR6002_GPIO_PIN_COUNT 18 -#define AR6003_GPIO_PIN_COUNT 28 -#define MCKINLEY_GPIO_PIN_COUNT 57 - -/* - * Values of gpioreg_id in the WMIX_GPIO_REGISTER_SET_CMDID and WMIX_GPIO_REGISTER_GET_CMDID - * commands come in two flavors. If the upper bit of gpioreg_id is CLEAR, then the - * remainder is interpreted as one of these values. This provides platform-independent - * access to GPIO registers. If the upper bit (GPIO_ID_OFFSET_FLAG) of gpioreg_id is SET, - * then the remainder is interpreted as a platform-specific GPIO register offset. - */ -#define GPIO_ID_OUT 0x00000000 -#define GPIO_ID_OUT_W1TS 0x00000001 -#define GPIO_ID_OUT_W1TC 0x00000002 -#define GPIO_ID_ENABLE 0x00000003 -#define GPIO_ID_ENABLE_W1TS 0x00000004 -#define GPIO_ID_ENABLE_W1TC 0x00000005 -#define GPIO_ID_IN 0x00000006 -#define GPIO_ID_STATUS 0x00000007 -#define GPIO_ID_STATUS_W1TS 0x00000008 -#define GPIO_ID_STATUS_W1TC 0x00000009 -#define GPIO_ID_PIN0 0x0000000a -#define GPIO_ID_PIN(n) (GPIO_ID_PIN0+(n)) -#define GPIO_ID_NONE 0xffffffff - -#define GPIO_ID_OFFSET_FLAG 0x80000000 -#define GPIO_ID_REG_MASK 0x7fffffff -#define GPIO_ID_IS_OFFSET(reg_id) (((reg_id) & GPIO_ID_OFFSET_FLAG) != 0) diff --git a/drivers/net/wireless/ar6003/include/host_proxy_iface.h b/drivers/net/wireless/ar6003/include/host_proxy_iface.h deleted file mode 100644 index 7f0f3fd92ff1..000000000000 --- a/drivers/net/wireless/ar6003/include/host_proxy_iface.h +++ /dev/null @@ -1,45 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2011 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -/* - * This file contains the definitions of the host_proxy interface. - */ - -#ifndef _HOST_PROXY_IFACE_H_ -#define _HOST_PROXY_IFACE_H_ - -/* Host proxy initializes shared memory with HOST_PROXY_INIT to - * indicate that it is ready to receive instruction */ -#define HOST_PROXY_INIT (1) -/* Host writes HOST_PROXY_NORMAL_BOOT to shared memory to - * indicate to host proxy that it should proceed to boot - * normally (bypassing BMI). - */ -#define HOST_PROXY_NORMAL_BOOT (2) -/* Host writes HOST_PROXY_BMI_BOOT to shared memory to - * indicate to host proxy that is should enable BMI and - * exit. This allows a host to reprogram the on board - * flash. - */ -#define HOST_PROXY_BMI_BOOT (3) - -#endif /* _HOST_PROXY_IFACE_H_ */ diff --git a/drivers/net/wireless/ar6003/include/htc.h b/drivers/net/wireless/ar6003/include/htc.h deleted file mode 100644 index a86cdaeb5fa1..000000000000 --- a/drivers/net/wireless/ar6003/include/htc.h +++ /dev/null @@ -1,238 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef __HTC_H__ -#define __HTC_H__ - -#ifndef ATH_TARGET -#include "athstartpack.h" -#endif - -#ifndef A_OFFSETOF -#define A_OFFSETOF(type,field) (unsigned long)(&(((type *)NULL)->field)) -#endif - -#define ASSEMBLE_UNALIGNED_UINT16(p,highbyte,lowbyte) \ - (((A_UINT16)(((A_UINT8 *)(p))[(highbyte)])) << 8 | (A_UINT16)(((A_UINT8 *)(p))[(lowbyte)])) - -/* alignment independent macros (little-endian) to fetch UINT16s or UINT8s from a - * structure using only the type and field name. - * Use these macros if there is the potential for unaligned buffer accesses. */ -#define A_GET_UINT16_FIELD(p,type,field) \ - ASSEMBLE_UNALIGNED_UINT16(p,\ - A_OFFSETOF(type,field) + 1, \ - A_OFFSETOF(type,field)) - -#define A_SET_UINT16_FIELD(p,type,field,value) \ -{ \ - ((A_UINT8 *)(p))[A_OFFSETOF(type,field)] = (A_UINT8)(value); \ - ((A_UINT8 *)(p))[A_OFFSETOF(type,field) + 1] = (A_UINT8)((value) >> 8); \ -} - -#define A_GET_UINT8_FIELD(p,type,field) \ - ((A_UINT8 *)(p))[A_OFFSETOF(type,field)] - -#define A_SET_UINT8_FIELD(p,type,field,value) \ - ((A_UINT8 *)(p))[A_OFFSETOF(type,field)] = (value) - -/****** DANGER DANGER *************** - * - * The frame header length and message formats defined herein were - * selected to accommodate optimal alignment for target processing. This reduces code - * size and improves performance. - * - * Any changes to the header length may alter the alignment and cause exceptions - * on the target. When adding to the message structures insure that fields are - * properly aligned. - * - */ - -/* HTC frame header */ -typedef PREPACK struct _HTC_FRAME_HDR{ - /* do not remove or re-arrange these fields, these are minimally required - * to take advantage of 4-byte lookaheads in some hardware implementations */ - A_UINT8 EndpointID; - A_UINT8 Flags; - A_UINT16 PayloadLen; /* length of data (including trailer) that follows the header */ - - /***** end of 4-byte lookahead ****/ - - A_UINT8 ControlBytes[2]; - - /* message payload starts after the header */ - -} POSTPACK HTC_FRAME_HDR; - -/* frame header flags */ - - /* send direction */ -#define HTC_FLAGS_NEED_CREDIT_UPDATE (1 << 0) -#define HTC_FLAGS_SEND_BUNDLE (1 << 1) /* start or part of bundle */ - /* receive direction */ -#define HTC_FLAGS_RECV_UNUSED_0 (1 << 0) /* bit 0 unused */ -#define HTC_FLAGS_RECV_TRAILER (1 << 1) /* bit 1 trailer data present */ -#define HTC_FLAGS_RECV_UNUSED_2 (1 << 0) /* bit 2 unused */ -#define HTC_FLAGS_RECV_UNUSED_3 (1 << 0) /* bit 3 unused */ -#define HTC_FLAGS_RECV_BUNDLE_CNT_MASK (0xF0) /* bits 7..4 */ -#define HTC_FLAGS_RECV_BUNDLE_CNT_SHIFT 4 - -#define HTC_HDR_LENGTH (sizeof(HTC_FRAME_HDR)) -#define HTC_MAX_TRAILER_LENGTH 255 -#define HTC_MAX_PAYLOAD_LENGTH (4096 - sizeof(HTC_FRAME_HDR)) - -/* HTC control message IDs */ - -#define HTC_MSG_READY_ID 1 -#define HTC_MSG_CONNECT_SERVICE_ID 2 -#define HTC_MSG_CONNECT_SERVICE_RESPONSE_ID 3 -#define HTC_MSG_SETUP_COMPLETE_ID 4 -#define HTC_MSG_SETUP_COMPLETE_EX_ID 5 - -#define HTC_MAX_CONTROL_MESSAGE_LENGTH 256 - -/* base message ID header */ -typedef PREPACK struct { - A_UINT16 MessageID; -} POSTPACK HTC_UNKNOWN_MSG; - -/* HTC ready message - * direction : target-to-host */ -typedef PREPACK struct { - A_UINT16 MessageID; /* ID */ - A_UINT16 CreditCount; /* number of credits the target can offer */ - A_UINT16 CreditSize; /* size of each credit */ - A_UINT8 MaxEndpoints; /* maximum number of endpoints the target has resources for */ - A_UINT8 _Pad1; -} POSTPACK HTC_READY_MSG; - - /* extended HTC ready message */ -typedef PREPACK struct { - HTC_READY_MSG Version2_0_Info; /* legacy version 2.0 information at the front... */ - /* extended information */ - A_UINT8 HTCVersion; - A_UINT8 MaxMsgsPerHTCBundle; -} POSTPACK HTC_READY_EX_MSG; - -#define HTC_VERSION_2P0 0x00 -#define HTC_VERSION_2P1 0x01 /* HTC 2.1 */ - -#define HTC_SERVICE_META_DATA_MAX_LENGTH 128 - -/* connect service - * direction : host-to-target */ -typedef PREPACK struct { - A_UINT16 MessageID; - A_UINT16 ServiceID; /* service ID of the service to connect to */ - A_UINT16 ConnectionFlags; /* connection flags */ - -#define HTC_CONNECT_FLAGS_REDUCE_CREDIT_DRIBBLE (1 << 2) /* reduce credit dribbling when - the host needs credits */ -#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_MASK (0x3) -#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_FOURTH 0x0 -#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_HALF 0x1 -#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_THREE_FOURTHS 0x2 -#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_UNITY 0x3 - - A_UINT8 ServiceMetaLength; /* length of meta data that follows */ - A_UINT8 _Pad1; - - /* service-specific meta data starts after the header */ - -} POSTPACK HTC_CONNECT_SERVICE_MSG; - -/* connect response - * direction : target-to-host */ -typedef PREPACK struct { - A_UINT16 MessageID; - A_UINT16 ServiceID; /* service ID that the connection request was made */ - A_UINT8 Status; /* service connection status */ - A_UINT8 EndpointID; /* assigned endpoint ID */ - A_UINT16 MaxMsgSize; /* maximum expected message size on this endpoint */ - A_UINT8 ServiceMetaLength; /* length of meta data that follows */ - A_UINT8 _Pad1; - - /* service-specific meta data starts after the header */ - -} POSTPACK HTC_CONNECT_SERVICE_RESPONSE_MSG; - -typedef PREPACK struct { - A_UINT16 MessageID; - /* currently, no other fields */ -} POSTPACK HTC_SETUP_COMPLETE_MSG; - - /* extended setup completion message */ -typedef PREPACK struct { - A_UINT16 MessageID; - A_UINT32 SetupFlags; - A_UINT8 MaxMsgsPerBundledRecv; - A_UINT8 Rsvd[3]; -} POSTPACK HTC_SETUP_COMPLETE_EX_MSG; - -#define HTC_SETUP_COMPLETE_FLAGS_ENABLE_BUNDLE_RECV (1 << 0) - -/* connect response status codes */ -#define HTC_SERVICE_SUCCESS 0 /* success */ -#define HTC_SERVICE_NOT_FOUND 1 /* service could not be found */ -#define HTC_SERVICE_FAILED 2 /* specific service failed the connect */ -#define HTC_SERVICE_NO_RESOURCES 3 /* no resources (i.e. no more endpoints) */ -#define HTC_SERVICE_NO_MORE_EP 4 /* specific service is not allowing any more - endpoints */ - -/* report record IDs */ - -#define HTC_RECORD_NULL 0 -#define HTC_RECORD_CREDITS 1 -#define HTC_RECORD_LOOKAHEAD 2 -#define HTC_RECORD_LOOKAHEAD_BUNDLE 3 - -typedef PREPACK struct { - A_UINT8 RecordID; /* Record ID */ - A_UINT8 Length; /* Length of record */ -} POSTPACK HTC_RECORD_HDR; - -typedef PREPACK struct { - A_UINT8 EndpointID; /* Endpoint that owns these credits */ - A_UINT8 Credits; /* credits to report since last report */ -} POSTPACK HTC_CREDIT_REPORT; - -typedef PREPACK struct { - A_UINT8 PreValid; /* pre valid guard */ - A_UINT8 LookAhead[4]; /* 4 byte lookahead */ - A_UINT8 PostValid; /* post valid guard */ - - /* NOTE: the LookAhead array is guarded by a PreValid and Post Valid guard bytes. - * The PreValid bytes must equal the inverse of the PostValid byte */ - -} POSTPACK HTC_LOOKAHEAD_REPORT; - -typedef PREPACK struct { - A_UINT8 LookAhead[4]; /* 4 byte lookahead */ -} POSTPACK HTC_BUNDLED_LOOKAHEAD_REPORT; - -#ifndef ATH_TARGET -#include "athendpack.h" -#endif - - -#endif /* __HTC_H__ */ - diff --git a/drivers/net/wireless/ar6003/include/htc_services.h b/drivers/net/wireless/ar6003/include/htc_services.h deleted file mode 100644 index fb22268a8d84..000000000000 --- a/drivers/net/wireless/ar6003/include/htc_services.h +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2007 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef __HTC_SERVICES_H__ -#define __HTC_SERVICES_H__ - -/* Current service IDs */ - -typedef enum { - RSVD_SERVICE_GROUP = 0, - WMI_SERVICE_GROUP = 1, - - HTC_TEST_GROUP = 254, - HTC_SERVICE_GROUP_LAST = 255 -}HTC_SERVICE_GROUP_IDS; - -#define MAKE_SERVICE_ID(group,index) \ - (int)(((int)group << 8) | (int)(index)) - -/* NOTE: service ID of 0x0000 is reserved and should never be used */ -#define HTC_CTRL_RSVD_SVC MAKE_SERVICE_ID(RSVD_SERVICE_GROUP,1) -#define WMI_CONTROL_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,0) -#define WMI_DATA_BE_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,1) -#define WMI_DATA_BK_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,2) -#define WMI_DATA_VI_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,3) -#define WMI_DATA_VO_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,4) -#define WMI_MAX_SERVICES 5 - -/* raw stream service (i.e. flash, tcmd, calibration apps) */ -#define HTC_RAW_STREAMS_SVC MAKE_SERVICE_ID(HTC_TEST_GROUP,0) - -#endif /*HTC_SERVICES_H_*/ diff --git a/drivers/net/wireless/ar6003/include/ini_dset.h b/drivers/net/wireless/ar6003/include/ini_dset.h deleted file mode 100644 index 6ab422ad44ee..000000000000 --- a/drivers/net/wireless/ar6003/include/ini_dset.h +++ /dev/null @@ -1,83 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef _INI_DSET_H_ -#define _INI_DSET_H_ - -/* - * Each of these represents a WHAL INI table, which consists - * of an "address column" followed by 1 or more "value columns". - * - * Software uses the base WHAL_INI_DATA_ID+column to access a - * DataSet that holds a particular column of data. - */ -typedef enum { -#if defined(AR6002_REV4) || defined(AR6003) || defined(AR6002_REV6) -/* Add these definitions for compatability */ -#define WHAL_INI_DATA_ID_BB_RFGAIN_LNA1 WHAL_INI_DATA_ID_BB_RFGAIN -#define WHAL_INI_DATA_ID_BB_RFGAIN_LNA2 WHAL_INI_DATA_ID_BB_RFGAIN - WHAL_INI_DATA_ID_NULL =0, - WHAL_INI_DATA_ID_MODE_SPECIFIC =1, /* 2,3,4,5 */ - WHAL_INI_DATA_ID_COMMON =6, /* 7 */ - WHAL_INI_DATA_ID_BB_RFGAIN =8, /* 9,10 */ -#ifdef FPGA - WHAL_INI_DATA_ID_ANALOG_BANK0 =11, /* 12 */ - WHAL_INI_DATA_ID_ANALOG_BANK1 =13, /* 14 */ - WHAL_INI_DATA_ID_ANALOG_BANK2 =15, /* 16 */ - WHAL_INI_DATA_ID_ANALOG_BANK3 =17, /* 18, 19 */ - WHAL_INI_DATA_ID_ANALOG_BANK6 =20, /* 21,22 */ - WHAL_INI_DATA_ID_ANALOG_BANK7 =23, /* 24 */ - WHAL_INI_DATA_ID_ADDAC =25, /* 26 */ -#else - WHAL_INI_DATA_ID_ANALOG_COMMON =11, /* 12 */ - WHAL_INI_DATA_ID_ANALOG_MODE_SPECIFIC=13, /* 14,15 */ - WHAL_INI_DATA_ID_ANALOG_BANK6 =16, /* 17,18 */ - WHAL_INI_DATA_ID_MODE_OVERRIDES =19, /* 20,21,22,23 */ - WHAL_INI_DATA_ID_COMMON_OVERRIDES =24, /* 25 */ - WHAL_INI_DATA_ID_ANALOG_OVERRIDES =26, /* 27,28 */ -#endif /* FPGA */ -#else - WHAL_INI_DATA_ID_NULL =0, - WHAL_INI_DATA_ID_MODE_SPECIFIC =1, /* 2,3 */ - WHAL_INI_DATA_ID_COMMON =4, /* 5 */ - WHAL_INI_DATA_ID_BB_RFGAIN =6, /* 7,8 */ -#define WHAL_INI_DATA_ID_BB_RFGAIN_LNA1 WHAL_INI_DATA_ID_BB_RFGAIN - WHAL_INI_DATA_ID_ANALOG_BANK1 =9, /* 10 */ - WHAL_INI_DATA_ID_ANALOG_BANK2 =11, /* 12 */ - WHAL_INI_DATA_ID_ANALOG_BANK3 =13, /* 14, 15 */ - WHAL_INI_DATA_ID_ANALOG_BANK6 =16, /* 17, 18 */ - WHAL_INI_DATA_ID_ANALOG_BANK7 =19, /* 20 */ - WHAL_INI_DATA_ID_MODE_OVERRIDES =21, /* 22,23 */ - WHAL_INI_DATA_ID_COMMON_OVERRIDES =24, /* 25 */ - WHAL_INI_DATA_ID_ANALOG_OVERRIDES =26, /* 27,28 */ - WHAL_INI_DATA_ID_BB_RFGAIN_LNA2 =29, /* 30,31 */ -#endif - WHAL_INI_DATA_ID_MAX =31 -} WHAL_INI_DATA_ID; - -typedef PREPACK struct { - A_UINT16 freqIndex; // 1 - A mode 2 - B or G mode 0 - common - A_UINT16 offset; - A_UINT32 newValue; -} POSTPACK INI_DSET_REG_OVERRIDE; - -#endif diff --git a/drivers/net/wireless/ar6003/include/iot_flashotp.h b/drivers/net/wireless/ar6003/include/iot_flashotp.h deleted file mode 100644 index 67c24fc3f805..000000000000 --- a/drivers/net/wireless/ar6003/include/iot_flashotp.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef _IOT_FLASHOTP_H_ -#define _IOT_FLASHOTP_H_ -/******************************************/ -/* firmware input param value definitions */ -/******************************************/ -/* IOTFLASHOTP_PARAM_SKIP_OTP - instructs firmware to skip OTP operations */ -#define IOTFLASHOTP_PARAM_SKIP_OTP (0x00000001) -/* IOTFLASHOTP_PARAM_SKIP_FLASH - instructs firmware to skip Flash operations */ -#define IOTFLASHOTP_PARAM_SKIP_FLASH (0x00000002) -/* IOTFLASHOTP_PARAM_USE_NVRAM_CONFIG_FROM_OTP - instructs firmware to use NVRAM config found in OTP - * to access flash. */ -#define IOTFLASHOTP_PARAM_USE_NVRAM_CONFIG_FROM_OTP (0x00000004) -/*************************************/ -/* firmware return value definitions */ -/*************************************/ -#define IOTFLASHOTP_RESULT_OTP_SUCCESS (0x00000001) -#define IOTFLASHOTP_RESULT_OTP_FAILED (0x00000002) -#define IOTFLASHOTP_RESULT_OTP_NOT_WRITTEN (0x00000004) -#define IOTFLASHOTP_RESULT_OTP_SKIPPED (0x00000008) -#define IOTFLASHOTP_RESULT_OTP_POS_MASK (0x0000000f) -#define IOTFLASHOTP_RESULT_OTP_POS_SHIFT (8) -#define IOTFLASHOTP_RESULT_OTP_MASK (0x0000ffff) - -#define IOTFLASHOTP_RESULT_FLASH_SUCCESS (0x00010000) -#define IOTFLASHOTP_RESULT_FLASH_FAILED (0x00020000) -#define IOTFLASHOTP_RESULT_FLASH_VALIDATE_FAILED (0x00040000) -#define IOTFLASHOTP_RESULT_FLASH_SKIPPED (0x00080000) -#define IOTFLASHOTP_RESULT_FLASH_MASK (0xffff0000) - - -#if !defined(AR6002_REV4) -typedef unsigned long A_UINT32; -#endif - -typedef struct{ - A_UINT32 length; // length of binary in bytes - A_UINT32 loadAddr; // address to which the image should be loaded - A_UINT32 execAddr; // address from which execution should start - A_UINT32 MACOffset; // offset in image of MAC address location. - A_UINT32 ChksumOffset; // offset of checksum location <0 implies no checksum> - A_UINT32 ChksumStart; // offset in image for start of checksum calculation - A_UINT32 ChksumEnd; // offset in image for end of checksum calculation - A_UINT32 partitionTableOffset; // offset in image for start of 3 word partition table - A_UINT32 flashDescOffset; // offset in image for the start of the flash descriptor file -}CONFIG_HEADER; - -typedef struct{ - A_UINT32 capacity; // size of flash chip in bytes - A_UINT32 blocksize; // size of a block needed for nvram block erase command - A_UINT32 sectorsize; // size of sector needed for nvram sector erase command - A_UINT32 pagesize; // size of page needed for nvram write command -}FLASH_DESCRIPTOR; - - -#endif /* _IOT_FLASHOTP_H_ */ diff --git a/drivers/net/wireless/ar6003/include/p2p.h b/drivers/net/wireless/ar6003/include/p2p.h deleted file mode 100644 index 83115d9081c2..000000000000 --- a/drivers/net/wireless/ar6003/include/p2p.h +++ /dev/null @@ -1,429 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// This file has the shared declarations between the host & target P2P modules. -// Author(s): ="Atheros" -//============================================================================== -#ifndef _P2P_H_ -#define _P2P_H_ - -#define WPS_NONCE_LEN 16 -#define WPS_DEV_TYPE_LEN 8 -#define WPS_AUTHENTICATOR_LEN 8 -#define WPS_HASH_LEN 32 -#define WPS_SECRET_NONCE_LEN 16 -#define WPS_KWA_LEN 8 -#define WPS_MAX_PIN_LEN 8 -#define P2P_MAX_SSID_LEN 32 - -#define WPS_DEV_OUI_WFA 0x0050f204 -#define P2P_IE_VENDOR_TYPE 0x506f9a09 - -#define WLAN_EID_VENDOR_SPECIFIC 221 - -#define P2P_DEV_CAPAB_SERVICE_DISCOVERY BIT(0) - -/* Config Methods */ -#define WPS_CONFIG_USBA 0x0001 -#define WPS_CONFIG_ETHERNET 0x0002 -#define WPS_CONFIG_LABEL 0x0004 -#define WPS_CONFIG_DISPLAY 0x0008 -#define WPS_CONFIG_EXT_NFC_TOKEN 0x0010 -#define WPS_CONFIG_INT_NFC_TOKEN 0x0020 -#define WPS_CONFIG_NFC_INTERFACE 0x0040 -#define WPS_CONFIG_PUSHBUTTON 0x0080 -#define WPS_CONFIG_KEYPAD 0x0100 - -/* Attribute Types */ -enum wps_attribute { - ATTR_AP_CHANNEL = 0x1001, - ATTR_ASSOC_STATE = 0x1002, - ATTR_AUTH_TYPE = 0x1003, - ATTR_AUTH_TYPE_FLAGS = 0x1004, - ATTR_AUTHENTICATOR = 0x1005, - ATTR_CONFIG_METHODS = 0x1008, - ATTR_CONFIG_ERROR = 0x1009, - ATTR_CONFIRM_URL4 = 0x100a, - ATTR_CONFIRM_URL6 = 0x100b, - ATTR_CONN_TYPE = 0x100c, - ATTR_CONN_TYPE_FLAGS = 0x100d, - ATTR_CRED = 0x100e, - ATTR_ENCR_TYPE = 0x100f, - ATTR_ENCR_TYPE_FLAGS = 0x1010, - ATTR_DEV_NAME = 0x1011, - ATTR_DEV_PASSWORD_ID = 0x1012, - ATTR_E_HASH1 = 0x1014, - ATTR_E_HASH2 = 0x1015, - ATTR_E_SNONCE1 = 0x1016, - ATTR_E_SNONCE2 = 0x1017, - ATTR_ENCR_SETTINGS = 0x1018, - ATTR_ENROLLEE_NONCE = 0x101a, - ATTR_FEATURE_ID = 0x101b, - ATTR_IDENTITY = 0x101c, - ATTR_IDENTITY_PROOF = 0x101d, - ATTR_KEY_WRAP_AUTH = 0x101e, - ATTR_KEY_ID = 0x101f, - ATTR_MAC_ADDR = 0x1020, - ATTR_MANUFACTURER = 0x1021, - ATTR_MSG_TYPE = 0x1022, - ATTR_MODEL_NAME = 0x1023, - ATTR_MODEL_NUMBER = 0x1024, - ATTR_NETWORK_INDEX = 0x1026, - ATTR_NETWORK_KEY = 0x1027, - ATTR_NETWORK_KEY_INDEX = 0x1028, - ATTR_NEW_DEVICE_NAME = 0x1029, - ATTR_NEW_PASSWORD = 0x102a, - ATTR_OOB_DEVICE_PASSWORD = 0x102c, - ATTR_OS_VERSION = 0x102d, - ATTR_POWER_LEVEL = 0x102f, - ATTR_PSK_CURRENT = 0x1030, - ATTR_PSK_MAX = 0x1031, - ATTR_PUBLIC_KEY = 0x1032, - ATTR_RADIO_ENABLE = 0x1033, - ATTR_REBOOT = 0x1034, - ATTR_REGISTRAR_CURRENT = 0x1035, - ATTR_REGISTRAR_ESTABLISHED = 0x1036, - ATTR_REGISTRAR_LIST = 0x1037, - ATTR_REGISTRAR_MAX = 0x1038, - ATTR_REGISTRAR_NONCE = 0x1039, - ATTR_REQUEST_TYPE = 0x103a, - ATTR_RESPONSE_TYPE = 0x103b, - ATTR_RF_BANDS = 0x103c, - ATTR_R_HASH1 = 0x103d, - ATTR_R_HASH2 = 0x103e, - ATTR_R_SNONCE1 = 0x103f, - ATTR_R_SNONCE2 = 0x1040, - ATTR_SELECTED_REGISTRAR = 0x1041, - ATTR_SERIAL_NUMBER = 0x1042, - ATTR_WPS_STATE = 0x1044, - ATTR_SSID = 0x1045, - ATTR_TOTAL_NETWORKS = 0x1046, - ATTR_UUID_E = 0x1047, - ATTR_UUID_R = 0x1048, - ATTR_VENDOR_EXT = 0x1049, - ATTR_VERSION = 0x104a, - ATTR_X509_CERT_REQ = 0x104b, - ATTR_X509_CERT = 0x104c, - ATTR_EAP_IDENTITY = 0x104d, - ATTR_MSG_COUNTER = 0x104e, - ATTR_PUBKEY_HASH = 0x104f, - ATTR_REKEY_KEY = 0x1050, - ATTR_KEY_LIFETIME = 0x1051, - ATTR_PERMITTED_CFG_METHODS = 0x1052, - ATTR_SELECTED_REGISTRAR_CONFIG_METHODS = 0x1053, - ATTR_PRIMARY_DEV_TYPE = 0x1054, - ATTR_SECONDARY_DEV_TYP_ELIST = 0x1055, - ATTR_PORTABLE_DEV = 0x1056, - ATTR_AP_SETUP_LOCKED = 0x1057, - ATTR_APPLICATION_EXT = 0x1058, - ATTR_EAP_TYPE = 0x1059, - ATTR_IV = 0x1060, - ATTR_KEY_PROVIDED_AUTO = 0x1061, - ATTR_802_1X_ENABLED = 0x1062, - ATTR_APPSESSIONKEY = 0x1063, - ATTR_WEPTRANSMITKEY = 0x1064, - ATTR_REQUESTED_DEV_TYPE = 0x106a -}; - -enum p2p_wps_method { - WPS_NOT_READY, WPS_PIN_LABEL, WPS_PIN_DISPLAY, WPS_PIN_KEYPAD, WPS_PBC -}; - -enum p2p_status_code { - P2P_SC_SUCCESS = 0, - P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE = 1, - P2P_SC_FAIL_INCOMPATIBLE_PARAMS = 2, - P2P_SC_FAIL_LIMIT_REACHED = 3, - P2P_SC_FAIL_INVALID_PARAMS = 4, - P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE = 5, - P2P_SC_FAIL_PREV_PROTOCOL_ERROR = 6, - P2P_SC_FAIL_NO_COMMON_CHANNELS = 7, - P2P_SC_FAIL_UNKNOWN_GROUP = 8, - P2P_SC_FAIL_BOTH_GO_INTENT_15 = 9, - P2P_SC_FAIL_INCOMPATIBLE_PROV_METHOD = 10, - P2P_SC_FAIL_REJECTED_BY_USER = 11, -}; - -struct wps_parse_attr { - /* fixed length fields */ - const A_UINT8 *version; /* 1 octet */ - const A_UINT8 *msg_type; /* 1 octet */ - const A_UINT8 *enrollee_nonce; /* WPS_NONCE_LEN (16) octets */ - const A_UINT8 *registrar_nonce; /* WPS_NONCE_LEN (16) octets */ - const A_UINT8 *uuid_r; /* WPS_UUID_LEN (16) octets */ - const A_UINT8 *uuid_e; /* WPS_UUID_LEN (16) octets */ - const A_UINT8 *auth_type_flags; /* 2 octets */ - const A_UINT8 *encr_type_flags; /* 2 octets */ - const A_UINT8 *conn_type_flags; /* 1 octet */ - const A_UINT8 *config_methods; /* 2 octets */ - const A_UINT8 *sel_reg_config_methods; /* 2 octets */ - const A_UINT8 *primary_dev_type; /* 8 octets */ - const A_UINT8 *rf_bands; /* 1 octet */ - const A_UINT8 *assoc_state; /* 2 octets */ - const A_UINT8 *config_error; /* 2 octets */ - const A_UINT8 *dev_password_id; /* 2 octets */ - const A_UINT8 *oob_dev_password; /* WPS_OOB_DEVICE_PASSWORD_ATTR_LEN (54) - * octets */ - const A_UINT8 *os_version; /* 4 octets */ - const A_UINT8 *wps_state; /* 1 octet */ - const A_UINT8 *authenticator; /* WPS_AUTHENTICATOR_LEN (8) octets */ - const A_UINT8 *r_hash1; /* WPS_HASH_LEN (32) octets */ - const A_UINT8 *r_hash2; /* WPS_HASH_LEN (32) octets */ - const A_UINT8 *e_hash1; /* WPS_HASH_LEN (32) octets */ - const A_UINT8 *e_hash2; /* WPS_HASH_LEN (32) octets */ - const A_UINT8 *r_snonce1; /* WPS_SECRET_NONCE_LEN (16) octets */ - const A_UINT8 *r_snonce2; /* WPS_SECRET_NONCE_LEN (16) octets */ - const A_UINT8 *e_snonce1; /* WPS_SECRET_NONCE_LEN (16) octets */ - const A_UINT8 *e_snonce2; /* WPS_SECRET_NONCE_LEN (16) octets */ - const A_UINT8 *key_wrap_auth; /* WPS_KWA_LEN (8) octets */ - const A_UINT8 *auth_type; /* 2 octets */ - const A_UINT8 *encr_type; /* 2 octets */ - const A_UINT8 *network_idx; /* 1 octet */ - const A_UINT8 *network_key_idx; /* 1 octet */ - const A_UINT8 *mac_addr; /* ETH_ALEN (6) octets */ - const A_UINT8 *key_prov_auto; /* 1 octet (Bool) */ - const A_UINT8 *dot1x_enabled; /* 1 octet (Bool) */ - const A_UINT8 *selected_registrar; /* 1 octet (Bool) */ - const A_UINT8 *request_type; /* 1 octet */ - const A_UINT8 *response_type; /* 1 octet */ - const A_UINT8 *ap_setup_locked; /* 1 octet */ - - /* variable length fields */ - const A_UINT8 *manufacturer; - A_UINT32 manufacturer_len; - const A_UINT8 *model_name; - A_UINT32 model_name_len; - const A_UINT8 *model_number; - A_UINT32 model_number_len; - const A_UINT8 *serial_number; - A_UINT32 serial_number_len; - const A_UINT8 *dev_name; - A_UINT32 dev_name_len; - const A_UINT8 *public_key; - A_UINT32 public_key_len; - const A_UINT8 *encr_settings; - A_UINT32 encr_settings_len; - const A_UINT8 *ssid; /* <= 32 octets */ - A_UINT32 ssid_len; - const A_UINT8 *network_key; /* <= 64 octets */ - A_UINT32 network_key_len; - const A_UINT8 *eap_type; /* <= 8 octets */ - A_UINT32 eap_type_len; - const A_UINT8 *eap_identity; /* <= 64 octets */ - A_UINT32 eap_identity_len; - - /* attributes that can occur multiple times */ -#define MAX_CRED_COUNT 10 - const A_UINT8 *cred[MAX_CRED_COUNT]; - A_UINT32 cred_len[MAX_CRED_COUNT]; - A_UINT32 num_cred; - -#define MAX_REQ_DEV_TYPE_COUNT 10 - const A_UINT8 *req_dev_type[MAX_REQ_DEV_TYPE_COUNT]; - A_UINT32 num_req_dev_type; -}; - - -enum p2p_sublem_id { - P2P_ATTR_STATUS = 0, - P2P_ATTR_MINOR_REASON_CODE = 1, - P2P_ATTR_CAPABILITY = 2, - P2P_ATTR_DEVICE_ID = 3, - P2P_ATTR_GROUP_OWNER_INTENT = 4, - P2P_ATTR_CONFIGURATION_TIMEOUT = 5, - P2P_ATTR_LISTEN_CHANNEL = 6, - P2P_ATTR_GROUP_BSSID = 7, - P2P_ATTR_EXT_LISTEN_TIMING = 8, - P2P_ATTR_INTENDED_INTERFACE_ADDR = 9, - P2P_ATTR_MANAGEABILITY = 10, - P2P_ATTR_CHANNEL_LIST = 11, - P2P_ATTR_NOTICE_OF_ABSENCE = 12, - P2P_ATTR_DEVICE_INFO = 13, - P2P_ATTR_GROUP_INFO = 14, - P2P_ATTR_GROUP_ID = 15, - P2P_ATTR_INTERFACE = 16, - P2P_ATTR_OPERATING_CHANNEL = 17, - P2P_ATTR_INVITATION_FLAGS = 18, - P2P_ATTR_VENDOR_SPECIFIC = 221 -}; - -#define P2P_MAX_REG_CLASSES 10 -#define P2P_MAX_REG_CLASS_CHANNELS 20 - -#define P2P_WILDCARD_SSID "DIRECT-" -#define P2P_WILDCARD_SSID_LEN 7 - -struct p2p_channels { - struct p2p_reg_class { - A_UINT8 reg_class; - A_UINT8 channel[P2P_MAX_REG_CLASS_CHANNELS]; - A_UINT8 channels; - } reg_class[P2P_MAX_REG_CLASSES]; - A_UINT8 reg_classes; -}; - -#define P2P_NOA_DESCRIPTOR_LEN 13 -struct p2p_noa_descriptor { - A_UINT8 type_count; /* 255: continuous schedule, 0: reserved */ - A_UINT32 duration ; /* Absent period duration in micro seconds */ - A_UINT32 interval; /* Absent period interval in micro seconds */ - A_UINT32 start_time; /* 32 bit tsf time when in starts */ -}; - -#define P2P_MAX_NOA_DESCRIPTORS 4 -/* - * Length = (2 octets for Index and CTWin/Opp PS) and - * (13 octets for each NOA Descriptors) - */ -#define P2P_NOA_IE_SIZE(num_desc) (2 + (13 * (num_desc))) - -#define P2P_NOE_IE_OPP_PS_SET (0x80) -#define P2P_NOE_IE_CTWIN_MASK (0x7F) - -struct p2p_sub_element_noa { - A_UINT8 p2p_sub_id; - A_UINT8 p2p_sub_len; - A_UINT8 index; /* identifies instance of NOA su element */ - A_UINT8 oppPS:1, /* oppPS state of the AP */ - ctwindow:7; /* ctwindow in TUs */ - A_UINT8 num_descriptors; /* number of NOA descriptors */ - struct p2p_noa_descriptor noa_descriptors[P2P_MAX_NOA_DESCRIPTORS]; -}; - -#define ETH_ALEN 6 - -struct p2p_ie { - A_UINT8 dialog_token; - const A_UINT8 *capability; - const A_UINT8 *go_intent; - const A_UINT8 *status; - const A_UINT8 *listen_channel; - const A_UINT8 *operating_channel; - const A_UINT8 *channel_list; - A_UINT8 channel_list_len; - const A_UINT8 *config_timeout; - const A_UINT8 *intended_addr; - const A_UINT8 *group_bssid; - const A_UINT8 *invitation_flags; - - const A_UINT8 *group_info; - A_UINT32 group_info_len; - const A_UINT8 *group_id; - A_UINT32 group_id_len; - - const A_UINT8 *device_id; - const A_UINT8 *manageability; - - const A_UINT8 *noa; - A_UINT32 noa_len; - const A_UINT8 *ext_listen_timing; - - const A_UINT8 *minor_reason_code; - - /* P2P Device Info */ - const A_UINT8 *p2p_device_info; - A_UINT32 p2p_device_info_len; - const A_UINT8 *p2p_device_addr; - const A_UINT8 *pri_dev_type; - A_UINT8 num_sec_dev_types; - A_CHAR device_name[33]; - A_UINT8 dev_name_len; - A_UINT16 config_methods; - - /* WPS IE */ - A_UINT16 dev_password_id; - A_UINT16 wps_config_methods; - const A_UINT8 *wps_pri_dev_type; - A_CHAR wps_device_name[33]; - A_UINT8 wps_dev_name_len; - - - /* SSID IE */ - const A_UINT8 *ssid; -}; - -struct p2p_device { - A_UINT16 listen_freq; - A_UINT32 wps_pbc; - A_CHAR wps_pin[WPS_MAX_PIN_LEN]; - A_UINT8 pin_len; - enum p2p_wps_method wps_method; - - A_UINT8 p2p_device_addr[ETH_ALEN]; - A_UINT8 pri_dev_type[8]; - A_CHAR device_name[33]; - A_UINT16 config_methods; - A_UINT8 dev_capab; - A_UINT8 group_capab; - - A_UINT8 interface_addr[ETH_ALEN]; - - /* Dev. Discoverability data */ - A_UINT8 dev_disc_dialog_token; - A_UINT8 member_in_go_dev[ETH_ALEN]; - A_UINT8 member_in_go_iface[ETH_ALEN]; - A_UINT8 dev_disc_go_oper_ssid[WMI_MAX_SSID_LEN]; - A_UINT8 dev_disc_go_oper_ssid_len; - A_UINT16 dev_disc_go_oper_freq; - - A_UINT32 go_neg_req_sent; - enum p2p_go_state { UNKNOWN_GO, LOCAL_GO, REMOTE_GO } go_state; - A_UINT8 dialog_token; - A_UINT8 intended_addr[ETH_ALEN]; - - A_CHAR country[3]; - struct p2p_channels channels; - A_UINT16 oper_freq; - A_UINT8 oper_ssid[P2P_MAX_SSID_LEN]; - A_UINT8 oper_ssid_len; - - A_UINT16 req_config_methods; - -#define P2P_DEV_PROBE_REQ_ONLY BIT(0) -#define P2P_DEV_REPORTED BIT(1) -#define P2P_DEV_NOT_YET_READY BIT(2) -#define P2P_DEV_SD_INFO BIT(3) -#define P2P_DEV_SD_SCHEDULE BIT(4) -#define P2P_DEV_PD_PEER_DISPLAY BIT(5) -#define P2P_DEV_PD_PEER_KEYPAD BIT(6) -#define P2P_DEV_USER_REJECTED BIT(7) -#define P2P_DEV_PEER_WAITING_RESPONSE BIT(8) -#define P2P_DEV_PREFER_PERSISTENT_GROUP BIT(9) -#define P2P_DEV_WAIT_GO_NEG_RESPONSE BIT(10) -#define P2P_DEV_WAIT_GO_NEG_CONFIRM BIT(11) -#define P2P_DEV_GROUP_CLIENT_ONLY BIT(12) -#define P2P_DEV_FORCE_FREQ BIT(13) -#define P2P_DEV_PD_FOR_JOIN BIT(14) - - A_UINT32 flags; - - A_UINT32 status; - A_UINT8 wait_count; - A_UINT32 invitation_reqs; - - A_UINT16 ext_listen_period; - A_UINT16 ext_listen_interval; - - A_UINT8 go_timeout; - A_UINT8 client_timeout; - A_UINT8 persistent_grp; - -}; -#endif /* _P2P_H_ */ diff --git a/drivers/net/wireless/ar6003/include/pkt_log.h b/drivers/net/wireless/ar6003/include/pkt_log.h deleted file mode 100644 index 331cc04edada..000000000000 --- a/drivers/net/wireless/ar6003/include/pkt_log.h +++ /dev/null @@ -1,45 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2005-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef __PKT_LOG_H__ -#define __PKT_LOG_H__ - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Pkt log info */ -typedef PREPACK struct pkt_log_t { - struct info_t { - A_UINT16 st; - A_UINT16 end; - A_UINT16 cur; - }info[4096]; - A_UINT16 last_idx; -}POSTPACK PACKET_LOG; - - -#ifdef __cplusplus -} -#endif -#endif /* __PKT_LOG_H__ */ diff --git a/drivers/net/wireless/ar6003/include/queue.h b/drivers/net/wireless/ar6003/include/queue.h deleted file mode 100644 index 72c10cfa2fa1..000000000000 --- a/drivers/net/wireless/ar6003/include/queue.h +++ /dev/null @@ -1,564 +0,0 @@ -// -// Copyright (c) 1991, 1993 -// The Regents of the University of California. All rights reserved. -// $ATH_LICENSE_NULL$ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. All advertising materials mentioning features or use of this software -// must display the following acknowledgement: -// This product includes software developed by the University of -// California, Berkeley and its contributors. -// 4. Neither the name of the University nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -// SUCH DAMAGE. -// -// @(#)queue.h 8.5 (Berkeley) 8/20/94 -// $FreeBSD: src/sys/sys/queue.h,v 1.58 2004/04/07 04:19:49 imp Exp $ -// $Id: //depot/sw/releases/olca3.1-RC/include/queue.h#1 $ -// - -#ifndef _SYS_QUEUE_H_ -#define _SYS_QUEUE_H_ - -/* - * This file defines four types of data structures: singly-linked lists, - * singly-linked tail queues, lists and tail queues. - * - * A singly-linked list is headed by a single forward pointer. The elements - * are singly linked for minimum space and pointer manipulation overhead at - * the expense of O(n) removal for arbitrary elements. New elements can be - * added to the list after an existing element or at the head of the list. - * Elements being removed from the head of the list should use the explicit - * macro for this purpose for optimum efficiency. A singly-linked list may - * only be traversed in the forward direction. Singly-linked lists are ideal - * for applications with large datasets and few or no removals or for - * implementing a LIFO queue. - * - * A singly-linked tail queue is headed by a pair of pointers, one to the - * head of the list and the other to the tail of the list. The elements are - * singly linked for minimum space and pointer manipulation overhead at the - * expense of O(n) removal for arbitrary elements. New elements can be added - * to the list after an existing element, at the head of the list, or at the - * end of the list. Elements being removed from the head of the tail queue - * should use the explicit macro for this purpose for optimum efficiency. - * A singly-linked tail queue may only be traversed in the forward direction. - * Singly-linked tail queues are ideal for applications with large datasets - * and few or no removals or for implementing a FIFO queue. - * - * A list is headed by a single forward pointer (or an array of forward - * pointers for a hash table header). The elements are doubly linked - * so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before - * or after an existing element or at the head of the list. A list - * may only be traversed in the forward direction. - * - * A tail queue is headed by a pair of pointers, one to the head of the - * list and the other to the tail of the list. The elements are doubly - * linked so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before or - * after an existing element, at the head of the list, or at the end of - * the list. A tail queue may be traversed in either direction. - * - * For details on the use of these macros, see the queue(3) manual page. - * - * - * SLIST LIST STAILQ TAILQ - * _HEAD + + + + - * _HEAD_INITIALIZER + + + + - * _ENTRY + + + + - * _INIT + + + + - * _EMPTY + + + + - * _FIRST + + + + - * _NEXT + + + + - * _PREV - - - + - * _LAST - - + + - * _FOREACH + + + + - * _FOREACH_SAFE + + + + - * _FOREACH_REVERSE - - - + - * _FOREACH_REVERSE_SAFE - - - + - * _INSERT_HEAD + + + + - * _INSERT_BEFORE - + - + - * _INSERT_AFTER + + + + - * _INSERT_TAIL - - + + - * _CONCAT - - + + - * _REMOVE_HEAD + - + - - * _REMOVE + + + + - * - */ -#define QUEUE_MACRO_DEBUG 0 -#if QUEUE_MACRO_DEBUG -/* Store the last 2 places the queue element or head was altered */ -struct qm_trace { - char * lastfile; - int lastline; - char * prevfile; - int prevline; -}; - -#define TRACEBUF struct qm_trace trace; -#define TRASHIT(x) do {(x) = (void *)-1;} while (0) - -#define QMD_TRACE_HEAD(head) do { \ - (head)->trace.prevline = (head)->trace.lastline; \ - (head)->trace.prevfile = (head)->trace.lastfile; \ - (head)->trace.lastline = __LINE__; \ - (head)->trace.lastfile = __FILE__; \ -} while (0) - -#define QMD_TRACE_ELEM(elem) do { \ - (elem)->trace.prevline = (elem)->trace.lastline; \ - (elem)->trace.prevfile = (elem)->trace.lastfile; \ - (elem)->trace.lastline = __LINE__; \ - (elem)->trace.lastfile = __FILE__; \ -} while (0) - -#else -#define QMD_TRACE_ELEM(elem) -#define QMD_TRACE_HEAD(head) -#define TRACEBUF -#define TRASHIT(x) -#endif /* QUEUE_MACRO_DEBUG */ - -/* - * Singly-linked List declarations. - */ -#define SLIST_HEAD(name, type) \ -struct name { \ - struct type *slh_first; /* first element */ \ -} - -#define SLIST_HEAD_INITIALIZER(head) \ - { NULL } - -#define SLIST_ENTRY(type) \ -struct { \ - struct type *sle_next; /* next element */ \ -} - -/* - * Singly-linked List functions. - */ -#define SLIST_EMPTY(head) ((head)->slh_first == NULL) - -#define SLIST_FIRST(head) ((head)->slh_first) - -#define SLIST_FOREACH(var, head, field) \ - for ((var) = SLIST_FIRST((head)); \ - (var); \ - (var) = SLIST_NEXT((var), field)) - -#define SLIST_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = SLIST_FIRST((head)); \ - (var) && ((tvar) = SLIST_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \ - for ((varp) = &SLIST_FIRST((head)); \ - ((var) = *(varp)) != NULL; \ - (varp) = &SLIST_NEXT((var), field)) - -#define SLIST_INIT(head) do { \ - SLIST_FIRST((head)) = NULL; \ -} while (0) - -#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ - SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \ - SLIST_NEXT((slistelm), field) = (elm); \ -} while (0) - -#define SLIST_INSERT_HEAD(head, elm, field) do { \ - SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \ - SLIST_FIRST((head)) = (elm); \ -} while (0) - -#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) - -#define SLIST_REMOVE(head, elm, type, field) do { \ - if (SLIST_FIRST((head)) == (elm)) { \ - SLIST_REMOVE_HEAD((head), field); \ - } \ - else { \ - struct type *curelm = SLIST_FIRST((head)); \ - while (SLIST_NEXT(curelm, field) != (elm)) \ - curelm = SLIST_NEXT(curelm, field); \ - SLIST_NEXT(curelm, field) = \ - SLIST_NEXT(SLIST_NEXT(curelm, field), field); \ - } \ -} while (0) - -#define SLIST_REMOVE_HEAD(head, field) do { \ - SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ -} while (0) - -/* - * Singly-linked Tail queue declarations. - */ -#define STAILQ_HEAD(name, type) \ -struct name { \ - struct type *stqh_first;/* first element */ \ - struct type **stqh_last;/* addr of last next element */ \ -} - -#define STAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).stqh_first } - -#define STAILQ_ENTRY(type) \ -struct { \ - struct type *stqe_next; /* next element */ \ -} - -/* - * Singly-linked Tail queue functions. - */ -#define STAILQ_CONCAT(head1, head2) do { \ - if (!STAILQ_EMPTY((head2))) { \ - *(head1)->stqh_last = (head2)->stqh_first; \ - (head1)->stqh_last = (head2)->stqh_last; \ - STAILQ_INIT((head2)); \ - } \ -} while (0) - -#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) - -#define STAILQ_FIRST(head) ((head)->stqh_first) - -#define STAILQ_FOREACH(var, head, field) \ - for((var) = STAILQ_FIRST((head)); \ - (var); \ - (var) = STAILQ_NEXT((var), field)) - - -#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = STAILQ_FIRST((head)); \ - (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define STAILQ_INIT(head) do { \ - STAILQ_FIRST((head)) = NULL; \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ -} while (0) - -#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ - if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - STAILQ_NEXT((tqelm), field) = (elm); \ -} while (0) - -#define STAILQ_INSERT_HEAD(head, elm, field) do { \ - if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - STAILQ_FIRST((head)) = (elm); \ -} while (0) - -#define STAILQ_INSERT_TAIL(head, elm, field) do { \ - STAILQ_NEXT((elm), field) = NULL; \ - *(head)->stqh_last = (elm); \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ -} while (0) - -#define FIELD_OFFSET(type, field) ((int)(int *)&(((struct type *)0)->field)) - -#define STAILQ_LAST(head, type, field) \ - (STAILQ_EMPTY((head)) ? \ - NULL : \ - ((struct type *) \ - ((char *)((head)->stqh_last) - FIELD_OFFSET(type, field)))) - -#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) - -#define STAILQ_CONCAT_ELEM(prevelm, elm, field) do { \ - prevelm->field.stqe_next = elm; \ -} while (0) - -#define STAILQ_REMOVE(head, elm, type, field) do { \ - if (STAILQ_FIRST((head)) == (elm)) { \ - STAILQ_REMOVE_HEAD((head), field); \ - } \ - else { \ - struct type *curelm = STAILQ_FIRST((head)); \ - while (STAILQ_NEXT(curelm, field) != (elm)) \ - curelm = STAILQ_NEXT(curelm, field); \ - if ((STAILQ_NEXT(curelm, field) = \ - STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL)\ - (head)->stqh_last = &STAILQ_NEXT((curelm), field);\ - } \ -} while (0) - -#define STAILQ_REMOVE_HEAD(head, field) do { \ - if ((STAILQ_FIRST((head)) = \ - STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ -} while (0) - -#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \ - if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ -} while (0) - -/* - * List declarations. - */ -#define ATH_LIST_HEAD(name, type) \ -struct name { \ - struct type *lh_first; /* first element */ \ -} - -#define LIST_HEAD_INITIALIZER(head) \ - { NULL } - -#define LIST_ENTRY(type) \ -struct { \ - struct type *le_next; /* next element */ \ - struct type **le_prev; /* address of previous next element */ \ -} - -/* - * List functions. - */ - -#define LIST_EMPTY(head) ((head)->lh_first == NULL) - -#define LIST_FIRST(head) ((head)->lh_first) - -#define LIST_FOREACH(var, head, field) \ - for ((var) = LIST_FIRST((head)); \ - (var); \ - (var) = LIST_NEXT((var), field)) - -#define LIST_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = LIST_FIRST((head)); \ - (var) && ((tvar) = LIST_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define LIST_INIT(head) do { \ - LIST_FIRST((head)) = NULL; \ -} while (0) - -#define LIST_INSERT_AFTER(listelm, elm, field) do { \ - if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\ - LIST_NEXT((listelm), field)->field.le_prev = \ - &LIST_NEXT((elm), field); \ - LIST_NEXT((listelm), field) = (elm); \ - (elm)->field.le_prev = &LIST_NEXT((listelm), field); \ -} while (0) - -#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ - (elm)->field.le_prev = (listelm)->field.le_prev; \ - LIST_NEXT((elm), field) = (listelm); \ - *(listelm)->field.le_prev = (elm); \ - (listelm)->field.le_prev = &LIST_NEXT((elm), field); \ -} while (0) - -#define LIST_INSERT_HEAD(head, elm, field) do { \ - if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \ - LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\ - LIST_FIRST((head)) = (elm); \ - (elm)->field.le_prev = &LIST_FIRST((head)); \ -} while (0) - -#define LIST_NEXT(elm, field) ((elm)->field.le_next) - -#define LIST_REMOVE(elm, field) do { \ - if (LIST_NEXT((elm), field) != NULL) \ - LIST_NEXT((elm), field)->field.le_prev = \ - (elm)->field.le_prev; \ - *(elm)->field.le_prev = LIST_NEXT((elm), field); \ -} while (0) - -/* - * Tail queue declarations. - */ -#define TAILQ_HEAD(name, type) \ -struct name { \ - struct type *tqh_first; /* first element */ \ - struct type **tqh_last; /* addr of last next element */ \ - TRACEBUF \ -} - -#define TAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).tqh_first } - -#define TAILQ_ENTRY(type) \ -struct { \ - struct type *tqe_next; /* next element */ \ - struct type **tqe_prev; /* address of previous next element */ \ - TRACEBUF \ -} - -/* - * Tail queue functions. - */ -#define TAILQ_CONCAT(head1, head2, field) do { \ - if (!TAILQ_EMPTY(head2)) { \ - *(head1)->tqh_last = (head2)->tqh_first; \ - (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ - (head1)->tqh_last = (head2)->tqh_last; \ - TAILQ_INIT((head2)); \ - QMD_TRACE_HEAD(head); \ - QMD_TRACE_HEAD(head2); \ - } \ -} while (0) - -#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) - -#define TAILQ_FIRST(head) ((head)->tqh_first) - -#define TAILQ_FOREACH(var, head, field) \ - for ((var) = TAILQ_FIRST((head)); \ - (var); \ - (var) = TAILQ_NEXT((var), field)) - -#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = TAILQ_FIRST((head)); \ - (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ - for ((var) = TAILQ_LAST((head), headname); \ - (var); \ - (var) = TAILQ_PREV((var), headname, field)) - -#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ - for ((var) = TAILQ_LAST((head), headname); \ - (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \ - (var) = (tvar)) - -#define TAILQ_INIT(head) do { \ - TAILQ_FIRST((head)) = NULL; \ - (head)->tqh_last = &TAILQ_FIRST((head)); \ - QMD_TRACE_HEAD(head); \ -} while (0) - -#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ - if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\ - TAILQ_NEXT((elm), field)->field.tqe_prev = \ - &TAILQ_NEXT((elm), field); \ - else { \ - (head)->tqh_last = &TAILQ_NEXT((elm), field); \ - QMD_TRACE_HEAD(head); \ - } \ - TAILQ_NEXT((listelm), field) = (elm); \ - (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \ - QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ -} while (0) - -#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ - (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ - TAILQ_NEXT((elm), field) = (listelm); \ - *(listelm)->field.tqe_prev = (elm); \ - (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \ - QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ -} while (0) - -#define TAILQ_INSERT_HEAD(head, elm, field) do { \ - if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \ - TAILQ_FIRST((head))->field.tqe_prev = \ - &TAILQ_NEXT((elm), field); \ - else \ - (head)->tqh_last = &TAILQ_NEXT((elm), field); \ - TAILQ_FIRST((head)) = (elm); \ - (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \ - QMD_TRACE_HEAD(head); \ - QMD_TRACE_ELEM(&(elm)->field); \ -} while (0) - -#define TAILQ_INSERT_TAIL(head, elm, field) do { \ - TAILQ_NEXT((elm), field) = NULL; \ - (elm)->field.tqe_prev = (head)->tqh_last; \ - *(head)->tqh_last = (elm); \ - (head)->tqh_last = &TAILQ_NEXT((elm), field); \ - QMD_TRACE_HEAD(head); \ - QMD_TRACE_ELEM(&(elm)->field); \ -} while (0) - -#define TAILQ_LAST(head, headname) \ - (*(((struct headname *)((head)->tqh_last))->tqh_last)) - -#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) - -#define TAILQ_PREV(elm, headname, field) \ - (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) - -#define TAILQ_REMOVE(head, elm, field) do { \ - if ((TAILQ_NEXT((elm), field)) != NULL) \ - TAILQ_NEXT((elm), field)->field.tqe_prev = \ - (elm)->field.tqe_prev; \ - else { \ - (head)->tqh_last = (elm)->field.tqe_prev; \ - QMD_TRACE_HEAD(head); \ - } \ - *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \ - TRASHIT((elm)->field.tqe_next); \ - TRASHIT((elm)->field.tqe_prev); \ - QMD_TRACE_ELEM(&(elm)->field); \ -} while (0) - - -#ifdef _KERNEL - -/* - * XXX insque() and remque() are an old way of handling certain queues. - * They bogusly assumes that all queue heads look alike. - */ - -struct quehead { - struct quehead *qh_link; - struct quehead *qh_rlink; -}; - -#if defined(__GNUC__) || defined(__INTEL_COMPILER) - -static __inline void -insque(void *a, void *b) -{ - struct quehead *element = (struct quehead *)a, - *head = (struct quehead *)b; - - element->qh_link = head->qh_link; - element->qh_rlink = head; - head->qh_link = element; - element->qh_link->qh_rlink = element; -} - -static __inline void -remque(void *a) -{ - struct quehead *element = (struct quehead *)a; - - element->qh_link->qh_rlink = element->qh_rlink; - element->qh_rlink->qh_link = element->qh_link; - element->qh_rlink = 0; -} - -#else /* !(__GNUC__ || __INTEL_COMPILER) */ - -void insque(void *a, void *b); -void remque(void *a); - -#endif /* __GNUC__ || __INTEL_COMPILER */ - -#endif /* _KERNEL */ - -#endif /* !_SYS_QUEUE_H_ */ - diff --git a/drivers/net/wireless/ar6003/include/regdump.h b/drivers/net/wireless/ar6003/include/regdump.h deleted file mode 100644 index ff79b4846e69..000000000000 --- a/drivers/net/wireless/ar6003/include/regdump.h +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef __REGDUMP_H__ -#define __REGDUMP_H__ - -#ifndef ATH_TARGET -#include "athstartpack.h" -#endif - -#if defined(AR6001) -#include "AR6001/AR6001_regdump.h" -#endif -#if defined(AR6002) -#include "AR6002/AR6002_regdump.h" -#endif - -#if !defined(__ASSEMBLER__) -/* - * Target CPU state at the time of failure is reflected - * in a register dump, which the Host can fetch through - * the diagnostic window. - */ -PREPACK struct register_dump_s { - A_UINT32 target_id; /* Target ID */ - A_UINT32 assline; /* Line number (if assertion failure) */ - A_UINT32 pc; /* Program Counter at time of exception */ - A_UINT32 badvaddr; /* Virtual address causing exception */ - CPU_exception_frame_t exc_frame; /* CPU-specific exception info */ - - /* Could copy top of stack here, too.... */ -} POSTPACK; -#endif /* __ASSEMBLER__ */ - -#ifndef ATH_TARGET -#include "athendpack.h" -#endif - -#endif /* __REGDUMP_H__ */ diff --git a/drivers/net/wireless/ar6003/include/roaming.h b/drivers/net/wireless/ar6003/include/roaming.h deleted file mode 100644 index 8019850a0571..000000000000 --- a/drivers/net/wireless/ar6003/include/roaming.h +++ /dev/null @@ -1,41 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef _ROAMING_H_ -#define _ROAMING_H_ - -/* - * The signal quality could be in terms of either snr or rssi. We should - * have an enum for both of them. For the time being, we are going to move - * it to wmi.h that is shared by both host and the target, since we are - * repartitioning the code to the host - */ -#define SIGNAL_QUALITY_NOISE_FLOOR -96 -#define SIGNAL_QUALITY_METRICS_NUM_MAX 2 -typedef enum { - SIGNAL_QUALITY_METRICS_SNR = 0, - SIGNAL_QUALITY_METRICS_RSSI, - SIGNAL_QUALITY_METRICS_ALL, -} SIGNAL_QUALITY_METRICS_TYPE; - -#endif /* _ROAMING_H_ */ diff --git a/drivers/net/wireless/ar6003/include/targaddrs.h b/drivers/net/wireless/ar6003/include/targaddrs.h deleted file mode 100644 index ccbfe5892e80..000000000000 --- a/drivers/net/wireless/ar6003/include/targaddrs.h +++ /dev/null @@ -1,398 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef __TARGADDRS_H__ -#define __TARGADDRS_H__ - -#ifndef ATH_TARGET -#include "athstartpack.h" -#endif - -#if defined(AR6002) -#include "AR6002/addrs.h" -#endif - -/* - * AR6K option bits, to enable/disable various features. - * By default, all option bits are 0. - * These bits can be set in LOCAL_SCRATCH register 0. - */ -#define AR6K_OPTION_BMI_DISABLE 0x01 /* Disable BMI comm with Host */ -#define AR6K_OPTION_SERIAL_ENABLE 0x02 /* Enable serial port msgs */ -#define AR6K_OPTION_WDT_DISABLE 0x04 /* WatchDog Timer override */ -#define AR6K_OPTION_SLEEP_DISABLE 0x08 /* Disable system sleep */ -#define AR6K_OPTION_STOP_BOOT 0x10 /* Stop boot processes (for ATE) */ -#define AR6K_OPTION_ENABLE_NOANI 0x20 /* Operate without ANI */ -#define AR6K_OPTION_DSET_DISABLE 0x40 /* Ignore DataSets */ -#define AR6K_OPTION_IGNORE_FLASH 0x80 /* Ignore flash during bootup */ - -/* - * xxx_HOST_INTEREST_ADDRESS is the address in Target RAM of the - * host_interest structure. It must match the address of the _host_interest - * symbol (see linker script). - * - * Host Interest is shared between Host and Target in order to coordinate - * between the two, and is intended to remain constant (with additions only - * at the end) across software releases. - * - * All addresses are available here so that it's possible to - * write a single binary that works with all Target Types. - * May be used in assembler code as well as C. - */ -#define AR6002_HOST_INTEREST_ADDRESS 0x00500400 -#define AR6003_HOST_INTEREST_ADDRESS 0x00540600 -#define MCKINLEY_HOST_INTEREST_ADDRESS 0x00400600 - - -#define HOST_INTEREST_MAX_SIZE 0x100 - -#if !defined(__ASSEMBLER__) -struct register_dump_s; -struct dbglog_hdr_s; - -/* - * These are items that the Host may need to access - * via BMI or via the Diagnostic Window. The position - * of items in this structure must remain constant - * across firmware revisions! - * - * Types for each item must be fixed size across - * target and host platforms. - * - * More items may be added at the end. - */ -PREPACK64 struct host_interest_s { - /* - * Pointer to application-defined area, if any. - * Set by Target application during startup. - */ - A_UINT32 hi_app_host_interest; /* 0x00 */ - - /* Pointer to register dump area, valid after Target crash. */ - A_UINT32 hi_failure_state; /* 0x04 */ - - /* Pointer to debug logging header */ - A_UINT32 hi_dbglog_hdr; /* 0x08 */ - - /* Indicates whether or not flash is present on Target. - * NB: flash_is_present indicator is here not just - * because it might be of interest to the Host; but - * also because it's set early on by Target's startup - * asm code and we need it to have a special RAM address - * so that it doesn't get reinitialized with the rest - * of data. - */ - A_UINT32 hi_flash_is_present; /* 0x0c */ - - /* - * General-purpose flag bits, similar to AR6000_OPTION_* flags. - * Can be used by application rather than by OS. - */ - A_UINT32 hi_option_flag; /* 0x10 */ - - /* - * Boolean that determines whether or not to - * display messages on the serial port. - */ - A_UINT32 hi_serial_enable; /* 0x14 */ - - /* Start address of DataSet index, if any */ - A_UINT32 hi_dset_list_head; /* 0x18 */ - - /* Override Target application start address */ - A_UINT32 hi_app_start; /* 0x1c */ - - /* Clock and voltage tuning */ - A_UINT32 hi_skip_clock_init; /* 0x20 */ - A_UINT32 hi_core_clock_setting; /* 0x24 */ - A_UINT32 hi_cpu_clock_setting; /* 0x28 */ - A_UINT32 hi_system_sleep_setting; /* 0x2c */ - A_UINT32 hi_xtal_control_setting; /* 0x30 */ - A_UINT32 hi_pll_ctrl_setting_24ghz; /* 0x34 */ - A_UINT32 hi_pll_ctrl_setting_5ghz; /* 0x38 */ - A_UINT32 hi_ref_voltage_trim_setting; /* 0x3c */ - A_UINT32 hi_clock_info; /* 0x40 */ - - /* - * Flash configuration overrides, used only - * when firmware is not executing from flash. - * (When using flash, modify the global variables - * with equivalent names.) - */ - A_UINT32 hi_bank0_addr_value; /* 0x44 */ - A_UINT32 hi_bank0_read_value; /* 0x48 */ - A_UINT32 hi_bank0_write_value; /* 0x4c */ - A_UINT32 hi_bank0_config_value; /* 0x50 */ - - /* Pointer to Board Data */ - A_UINT32 hi_board_data; /* 0x54 */ - A_UINT32 hi_board_data_initialized; /* 0x58 */ - - A_UINT32 hi_dset_RAM_index_table; /* 0x5c */ - - A_UINT32 hi_desired_baud_rate; /* 0x60 */ - A_UINT32 hi_dbglog_config; /* 0x64 */ - A_UINT32 hi_end_RAM_reserve_sz; /* 0x68 */ - A_UINT32 hi_mbox_io_block_sz; /* 0x6c */ - - A_UINT32 hi_num_bpatch_streams; /* 0x70 -- unused */ - A_UINT32 hi_mbox_isr_yield_limit; /* 0x74 */ - - A_UINT32 hi_refclk_hz; /* 0x78 */ - A_UINT32 hi_ext_clk_detected; /* 0x7c */ - A_UINT32 hi_dbg_uart_txpin; /* 0x80 */ - A_UINT32 hi_dbg_uart_rxpin; /* 0x84 */ - A_UINT32 hi_hci_uart_baud; /* 0x88 */ - A_UINT32 hi_hci_uart_pin_assignments; /* 0x8C */ - /* NOTE: byte [0] = tx pin, [1] = rx pin, [2] = rts pin, [3] = cts pin */ - A_UINT32 hi_hci_uart_baud_scale_val; /* 0x90 */ - A_UINT32 hi_hci_uart_baud_step_val; /* 0x94 */ - - A_UINT32 hi_allocram_start; /* 0x98 */ - A_UINT32 hi_allocram_sz; /* 0x9c */ - A_UINT32 hi_hci_bridge_flags; /* 0xa0 */ - A_UINT32 hi_hci_uart_support_pins; /* 0xa4 */ - /* NOTE: byte [0] = RESET pin (bit 7 is polarity), bytes[1]..bytes[3] are for future use */ - A_UINT32 hi_hci_uart_pwr_mgmt_params; /* 0xa8 */ - /* 0xa8 - [1]: 0 = UART FC active low, 1 = UART FC active high - * [31:16]: wakeup timeout in ms - */ - /* Pointer to extended board Data */ - A_UINT32 hi_board_ext_data; /* 0xac */ - A_UINT32 hi_board_ext_data_config; /* 0xb0 */ - /* - * Bit [0] : valid - * Bit[31:16: size - */ - /* - * hi_reset_flag is used to do some stuff when target reset. - * such as restore app_start after warm reset or - * preserve host Interest area, or preserve ROM data, literals etc. - */ - A_UINT32 hi_reset_flag; /* 0xb4 */ - /* indicate hi_reset_flag is valid */ - A_UINT32 hi_reset_flag_valid; /* 0xb8 */ - A_UINT32 hi_hci_uart_pwr_mgmt_params_ext; /* 0xbc */ - /* 0xbc - [31:0]: idle timeout in ms - */ - /* ACS flags */ - A_UINT32 hi_acs_flags; /* 0xc0 */ - A_UINT32 hi_console_flags; /* 0xc4 */ - A_UINT32 hi_nvram_state; /* 0xc8 */ - A_UINT32 hi_option_flag2; /* 0xcc */ - - /* If non-zero, override values sent to Host in WMI_READY event. */ - A_UINT32 hi_sw_version_override; /* 0xd0 */ - A_UINT32 hi_abi_version_override; /* 0xd4 */ - - /* test applications flags */ - A_UINT32 hi_test_apps_related ; /* 0xd8 */ - /* location of test script */ - A_UINT32 hi_ota_testscript; /* 0xdc */ - /* location of CAL data */ - A_UINT32 hi_cal_data; /* 0xe0 */ - -} POSTPACK64; -/* bitmap for hi_test_apps_related */ -#define HI_TEST_APPS_TESTSCRIPT_LOADED 0x00000001 -#define HI_TEST_APPS_CAL_DATA_AVAIL 0x00000002 - -/* Bits defined in hi_option_flag */ -#define HI_OPTION_TIMER_WAR 0x01 /* Enable timer workaround */ -#define HI_OPTION_BMI_CRED_LIMIT 0x02 /* Limit BMI command credits */ -#define HI_OPTION_RELAY_DOT11_HDR 0x04 /* Relay Dot11 hdr to/from host */ -#define HI_OPTION_MAC_ADDR_METHOD 0x08 /* MAC addr method 0-locally administred 1-globally unique addrs */ -#define HI_OPTION_ENABLE_RFKILL 0x10 /* RFKill Enable Feature*/ -#define HI_OPTION_ENABLE_PROFILE 0x20 /* Enable CPU profiling */ -#define HI_OPTION_DISABLE_DBGLOG 0x40 /* Disable debug logging */ -#define HI_OPTION_SKIP_ERA_TRACKING 0x80 /* Skip Era Tracking */ -#define HI_OPTION_PAPRD_DISABLE 0x100 /* Disable PAPRD (debug) */ -#define HI_OPTION_NUM_DEV_LSB 0x200 -#define HI_OPTION_NUM_DEV_MSB 0x800 -#define HI_OPTION_DEV_MODE_LSB 0x1000 -#define HI_OPTION_DEV_MODE_MSB 0x8000000 -#define HI_OPTION_NO_LFT_STBL 0x10000000 /* Disable LowFreq Timer Stabilization */ -#define HI_OPTION_SKIP_REG_SCAN 0x20000000 /* Skip regulatory scan */ -#define HI_OPTION_INIT_REG_SCAN 0x40000000 /* Do regulatory scan during init before sending WMI ready event to host */ -#define HI_OPTION_FW_BRIDGE 0x80000000 - -#define HI_OPTION_OFFLOAD_AMSDU 0x01 -#define HI_OPTION_MAC_ADDR_METHOD_SHIFT 3 - -/* 2 bits of hi_option_flag are used to represent 3 modes */ -#define HI_OPTION_FW_MODE_IBSS 0x0 /* IBSS Mode */ -#define HI_OPTION_FW_MODE_BSS_STA 0x1 /* STA Mode */ -#define HI_OPTION_FW_MODE_AP 0x2 /* AP Mode */ -#define HI_OPTION_FW_MODE_BT30AMP 0x3 /* BT30 AMP Mode */ - -/* 2 bits of hi_option flag are usedto represent 4 submodes */ -#define HI_OPTION_FW_SUBMODE_NONE 0x0 /* Normal mode */ -#define HI_OPTION_FW_SUBMODE_P2PDEV 0x1 /* p2p device mode */ -#define HI_OPTION_FW_SUBMODE_P2PCLIENT 0x2 /* p2p client mode */ -#define HI_OPTION_FW_SUBMODE_P2PGO 0x3 /* p2p go mode */ - -/* Num dev Mask */ -#define HI_OPTION_NUM_DEV_MASK 0x7 -#define HI_OPTION_NUM_DEV_SHIFT 0x9 - -#define HI_OPTION_RF_KILL_SHIFT 0x4 -#define HI_OPTION_RF_KILL_MASK 0x1 - -/* firmware bridging */ -#define HI_OPTION_FW_BRIDGE_SHIFT 0x1f - -/* Fw Mode/SubMode Mask -|-------------------------------------------------------------------------------| -| SUB | SUB | SUB | SUB | | | | | -| MODE[3] | MODE[2] | MODE[1] | MODE[0] | MODE[3] | MODE[2] | MODE[1] | MODE[0] | -| (2) | (2) | (2) | (2) | (2) | (2) | (2) | (2) | -|-------------------------------------------------------------------------------| -*/ -#define HI_OPTION_FW_MODE_BITS 0x2 -#define HI_OPTION_FW_MODE_MASK 0x3 -#define HI_OPTION_FW_MODE_SHIFT 0xC -#define HI_OPTION_ALL_FW_MODE_MASK 0xFF - -#define HI_OPTION_FW_SUBMODE_BITS 0x2 -#define HI_OPTION_FW_SUBMODE_MASK 0x3 -#define HI_OPTION_FW_SUBMODE_SHIFT 0x14 -#define HI_OPTION_ALL_FW_SUBMODE_MASK 0xFF00 -#define HI_OPTION_ALL_FW_SUBMODE_SHIFT 0x8 - -/* hi_reset_flag */ -#define HI_RESET_FLAG_PRESERVE_APP_START 0x01 /* preserve App Start address */ -#define HI_RESET_FLAG_PRESERVE_HOST_INTEREST 0x02 /* preserve host interest */ -#define HI_RESET_FLAG_PRESERVE_ROMDATA 0x04 /* preserve ROM data */ -#define HI_RESET_FLAG_PRESERVE_NVRAM_STATE 0x08 - -#define HI_RESET_FLAG_IS_VALID 0x12345678 /* indicate the reset flag is valid */ - -#define ON_RESET_FLAGS_VALID() \ - (HOST_INTEREST->hi_reset_flag_valid == HI_RESET_FLAG_IS_VALID) - -#define RESET_FLAGS_VALIDATE() \ - (HOST_INTEREST->hi_reset_flag_valid = HI_RESET_FLAG_IS_VALID) - -#define RESET_FLAGS_INVALIDATE() \ - (HOST_INTEREST->hi_reset_flag_valid = 0) - -#define ON_RESET_PRESERVE_APP_START() \ - (HOST_INTEREST->hi_reset_flag & HI_RESET_FLAG_PRESERVE_APP_START) - -#define ON_RESET_PRESERVE_NVRAM_STATE() \ - (HOST_INTEREST->hi_reset_flag & HI_RESET_FLAG_PRESERVE_NVRAM_STATE) - -#define ON_RESET_PRESERVE_HOST_INTEREST() \ - (HOST_INTEREST->hi_reset_flag & HI_RESET_FLAG_PRESERVE_HOST_INTEREST) - -#define ON_RESET_PRESERVE_ROMDATA() \ - (HOST_INTEREST->hi_reset_flag & HI_RESET_FLAG_PRESERVE_ROMDATA) - -#define HI_ACS_FLAGS_ENABLED (1 << 0) /* ACS is enabled */ -#define HI_ACS_FLAGS_USE_WWAN (1 << 1) /* Use physical WWAN device */ -#define HI_ACS_FLAGS_TEST_VAP (1 << 2) /* Use test VAP */ - -/* CONSOLE FLAGS - * - * Bit Range Meaning - * --------- -------------------------------- - * 2..0 UART ID (0 = Default) - * 3 Baud Select (0 = 9600, 1 = 115200) - * 30..4 Reserved - * 31 Enable Console - * - * */ - -#define HI_CONSOLE_FLAGS_ENABLE (1 << 31) -#define HI_CONSOLE_FLAGS_UART_MASK (0x7) -#define HI_CONSOLE_FLAGS_UART_SHIFT 0 -#define HI_CONSOLE_FLAGS_BAUD_SELECT (1 << 3) - -/* - * Intended for use by Host software, this macro returns the Target RAM - * address of any item in the host_interest structure. - * Example: target_addr = AR6002_HOST_INTEREST_ITEM_ADDRESS(hi_board_data); - */ -#define AR6002_HOST_INTEREST_ITEM_ADDRESS(item) \ - (A_UINT32)((unsigned long)&((((struct host_interest_s *)(AR6002_HOST_INTEREST_ADDRESS))->item))) - -#define AR6003_HOST_INTEREST_ITEM_ADDRESS(item) \ - (A_UINT32)((unsigned long)&((((struct host_interest_s *)(AR6003_HOST_INTEREST_ADDRESS))->item))) - -#define MCKINLEY_HOST_INTEREST_ITEM_ADDRESS(item) \ - ((A_UINT32)&((((struct host_interest_s *)(MCKINLEY_HOST_INTEREST_ADDRESS))->item))) - -#define HOST_INTEREST_DBGLOG_IS_ENABLED() \ - (!(HOST_INTEREST->hi_option_flag & HI_OPTION_DISABLE_DBGLOG)) - -#define HOST_INTEREST_PROFILE_IS_ENABLED() \ - (HOST_INTEREST->hi_option_flag & HI_OPTION_ENABLE_PROFILE) - -#define LF_TIMER_STABILIZATION_IS_ENABLED() \ - (!(HOST_INTEREST->hi_option_flag & HI_OPTION_NO_LFT_STBL)) - -#define IS_AMSDU_OFFLAOD_ENABLED() \ - ((HOST_INTEREST->hi_option_flag2 & HI_OPTION_OFFLOAD_AMSDU)) - -/* Convert a Target virtual address into a Target physical address */ -#define AR6002_VTOP(vaddr) ((vaddr) & 0x001fffff) -#define AR6003_VTOP(vaddr) ((vaddr) & 0x001fffff) -#define MCKINLEY_VTOP(vaddr) (vaddr) -#define TARG_VTOP(TargetType, vaddr) \ - (((TargetType) == TARGET_TYPE_AR6002) ? AR6002_VTOP(vaddr) : \ - (((TargetType) == TARGET_TYPE_AR6003) ? AR6003_VTOP(vaddr) : \ - (((TargetType) == TARGET_TYPE_MCKINLEY) ? MCKINLEY_VTOP(vaddr) : 0))) - -#define HOST_INTEREST_ITEM_ADDRESS(TargetType, item) \ - (((TargetType) == TARGET_TYPE_AR6002) ? AR6002_HOST_INTEREST_ITEM_ADDRESS(item) : \ - (((TargetType) == TARGET_TYPE_AR6003) ? AR6003_HOST_INTEREST_ITEM_ADDRESS(item) : \ - (((TargetType) == TARGET_TYPE_MCKINLEY) ? MCKINLEY_HOST_INTEREST_ITEM_ADDRESS(item) : 0))) - -/* override REV2 ROM's app start address */ -#define AR6002_REV2_APP_START_OVERRIDE 0x911A00 -#define AR6002_REV2_DATASET_PATCH_ADDRESS 0x52d8b0 -#define AR6002_REV2_APP_LOAD_ADDRESS 0x502070 - -#define AR6003_REV2_APP_START_OVERRIDE 0x944C00 -#define AR6003_REV2_APP_LOAD_ADDRESS 0x543180 -#define AR6003_REV2_BOARD_EXT_DATA_ADDRESS 0x57E500 -#define AR6003_REV2_DATASET_PATCH_ADDRESS 0x57e884 -#define AR6003_REV2_RAM_RESERVE_SIZE 6912 - -#define AR6003_REV3_APP_START_OVERRIDE 0x945d00 -#define AR6003_REV3_APP_LOAD_ADDRESS 0x545000 -#define AR6003_REV3_BOARD_EXT_DATA_ADDRESS 0x542330 -#define AR6003_REV3_DATASET_PATCH_ADDRESS 0x57FF74 -#define AR6003_REV3_RAM_RESERVE_SIZE 4352 - -/* # of A_UINT32 entries in targregs, used by DIAG_FETCH_TARG_REGS */ -#define AR6003_FETCH_TARG_REGS_COUNT 64 -#define MCKINLEY_FETCH_TARG_REGS_COUNT 64 - -#endif /* !__ASSEMBLER__ */ - -#ifndef ATH_TARGET -#include "athendpack.h" -#endif - -#endif /* __TARGADDRS_H__ */ diff --git a/drivers/net/wireless/ar6003/include/testcmd.h b/drivers/net/wireless/ar6003/include/testcmd.h deleted file mode 100644 index 28100a1aa43d..000000000000 --- a/drivers/net/wireless/ar6003/include/testcmd.h +++ /dev/null @@ -1,247 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef TESTCMD_H_ -#define TESTCMD_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef AR6002_REV2 -#define TCMD_MAX_RATES 12 -#else -#define TCMD_MAX_RATES 28 -#endif - -#define WMI_CMD_ID_SIZE 4 -#define WMI_CMDS_SIZE_MAX 2048 -#define TC_CMDS_GAP 16 -// should add up to the same size as buf[WMI_CMDS_SIZE_MAX] -//#define TC_CMDS_SIZE_MAX (WMI_CMDS_SIZE_MAX - sizeof(TC_CMDS_HDR) - WMI_CMD_ID_SIZE - TC_CMDS_GAP) -#define TC_CMDS_SIZE_MAX 256 - -typedef enum { - ZEROES_PATTERN = 0, - ONES_PATTERN, - REPEATING_10, - PN7_PATTERN, - PN9_PATTERN, - PN15_PATTERN -}TX_DATA_PATTERN; - -/* Continous tx - mode : TCMD_CONT_TX_OFF - Disabling continous tx - TCMD_CONT_TX_SINE - Enable continuous unmodulated tx - TCMD_CONT_TX_FRAME- Enable continuous modulated tx - freq : Channel freq in Mhz. (e.g 2412 for channel 1 in 11 g) -dataRate: 0 - 1 Mbps - 1 - 2 Mbps - 2 - 5.5 Mbps - 3 - 11 Mbps - 4 - 6 Mbps - 5 - 9 Mbps - 6 - 12 Mbps - 7 - 18 Mbps - 8 - 24 Mbps - 9 - 36 Mbps - 10 - 28 Mbps - 11 - 54 Mbps - txPwr: twice the Tx power in dBm, actual dBm values of [5 -11] for unmod Tx, - [5-14] for mod Tx -antenna: 1 - one antenna - 2 - two antenna -Note : Enable/disable continuous tx test cmd works only when target is awake. -*/ - -typedef enum { - TCMD_CONT_TX_OFF = 0, - TCMD_CONT_TX_SINE, - TCMD_CONT_TX_FRAME, - TCMD_CONT_TX_TX99, - TCMD_CONT_TX_TX100 -} TCMD_CONT_TX_MODE; - -typedef enum { - TCMD_WLAN_MODE_NOHT = 0, - TCMD_WLAN_MODE_HT20 = 1, - TCMD_WLAN_MODE_HT40PLUS = 2, - TCMD_WLAN_MODE_HT40MINUS = 3, - TCMD_WLAN_MODE_CCK = 4, - - TCMD_WLAN_MODE_MAX, - TCMD_WLAN_MODE_INVALID = TCMD_WLAN_MODE_MAX, - -} TCMD_WLAN_MODE; - -typedef PREPACK struct { - A_UINT32 testCmdId; - A_UINT32 mode; - A_UINT32 freq; - A_UINT32 dataRate; - A_INT32 txPwr; - A_UINT32 antenna; - A_UINT32 enANI; - A_UINT32 scramblerOff; - A_UINT32 aifsn; - A_UINT16 pktSz; - A_UINT16 txPattern; - A_UINT32 shortGuard; - A_UINT32 numPackets; - A_UINT32 wlanMode; -} POSTPACK TCMD_CONT_TX; - -#define TCMD_TXPATTERN_ZERONE 0x1 -#define TCMD_TXPATTERN_ZERONE_DIS_SCRAMBLE 0x2 - -/* Continuous Rx - act: TCMD_CONT_RX_PROMIS - promiscuous mode (accept all incoming frames) - TCMD_CONT_RX_FILTER - filter mode (accept only frames with dest - address equal specified - mac address (set via act =3) - TCMD_CONT_RX_REPORT off mode (disable cont rx mode and get the - report from the last cont - Rx test) - - TCMD_CONT_RX_SETMAC - set MacAddr mode (sets the MAC address for the - target. This Overrides - the default MAC address.) - -*/ -typedef enum { - TCMD_CONT_RX_PROMIS =0, - TCMD_CONT_RX_FILTER, - TCMD_CONT_RX_REPORT, - TCMD_CONT_RX_SETMAC, - TCMD_CONT_RX_SET_ANT_SWITCH_TABLE, - - TC_CMD_RESP, -} TCMD_CONT_RX_ACT; - -typedef PREPACK struct { - A_UINT32 testCmdId; - A_UINT32 act; - A_UINT32 enANI; - PREPACK union { - struct PREPACK TCMD_CONT_RX_PARA { - A_UINT32 freq; - A_UINT32 antenna; - A_UINT32 wlanMode; - } POSTPACK para; - struct PREPACK TCMD_CONT_RX_REPORT { - A_UINT32 totalPkt; - A_INT32 rssiInDBm; - A_UINT32 crcErrPkt; - A_UINT32 secErrPkt; - A_UINT16 rateCnt[TCMD_MAX_RATES]; - A_UINT16 rateCntShortGuard[TCMD_MAX_RATES]; - } POSTPACK report; - struct PREPACK TCMD_CONT_RX_MAC { - A_UCHAR addr[ATH_MAC_LEN]; - A_UCHAR btaddr[ATH_MAC_LEN]; - A_UINT16 regDmn[2]; - A_UINT32 otpWriteFlag; - } POSTPACK mac; - struct PREPACK TCMD_CONT_RX_ANT_SWITCH_TABLE { - A_UINT32 antswitch1; - A_UINT32 antswitch2; - }POSTPACK antswitchtable; - } POSTPACK u; -} POSTPACK TCMD_CONT_RX; - -/* Force sleep/wake test cmd - mode: TCMD_PM_WAKEUP - Wakeup the target - TCMD_PM_SLEEP - Force the target to sleep. - */ -typedef enum { - TCMD_PM_WAKEUP = 1, /* be consistent with target */ - TCMD_PM_SLEEP, - TCMD_PM_DEEPSLEEP -} TCMD_PM_MODE; - -typedef PREPACK struct { - A_UINT32 testCmdId; - A_UINT32 mode; -} POSTPACK TCMD_PM; - -typedef enum { - TC_CMDS_VERSION_RESERVED=0, - TC_CMDS_VERSION_MDK, - TC_CMDS_VERSION_TS, - TC_CMDS_VERSION_LAST, -} TC_CMDS_VERSION; - -typedef enum { - TC_CMDS_TS =0, - TC_CMDS_CAL, -} TC_CMDS_ACT; - -typedef PREPACK struct { - A_UINT32 testCmdId; - A_UINT32 act; - PREPACK union { - A_UINT32 enANI; // to be identical to CONT_RX struct - struct PREPACK { - A_UINT16 length; - A_UINT8 version; - A_UINT8 reserved; - } POSTPACK parm; - } POSTPACK u; -} POSTPACK TC_CMDS_HDR; - -typedef PREPACK struct { - TC_CMDS_HDR hdr; - A_UINT8 buf[TC_CMDS_SIZE_MAX]; -} POSTPACK TC_CMDS; - -typedef PREPACK struct { - A_UINT32 testCmdId; - A_UINT32 regAddr; - A_UINT32 val; - A_UINT16 flag; -} POSTPACK TCMD_SET_REG; - -typedef enum { - TCMD_CONT_TX_ID, - TCMD_CONT_RX_ID, - TCMD_PM_ID, - TC_CMDS_ID, - TCMD_SET_REG_ID, -} TCMD_ID; - -typedef PREPACK union { - TCMD_CONT_TX contTx; - TCMD_CONT_RX contRx; - TCMD_PM pm; - // New test cmds from ART/MDK ... - TC_CMDS tcCmds; - TCMD_SET_REG setReg; -} POSTPACK TEST_CMD; - -#ifdef __cplusplus -} -#endif - -#endif /* TESTCMD_H_ */ - - diff --git a/drivers/net/wireless/ar6003/include/tlpm.h b/drivers/net/wireless/ar6003/include/tlpm.h deleted file mode 100644 index 659b1c07ba90..000000000000 --- a/drivers/net/wireless/ar6003/include/tlpm.h +++ /dev/null @@ -1,38 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef __TLPM_H__ -#define __TLPM_H__ - -/* idle timeout in 16-bit value as in HOST_INTEREST hi_hci_uart_pwr_mgmt_params */ -#define TLPM_DEFAULT_IDLE_TIMEOUT_MS 1000 -/* hex in LSB and MSB for HCI command */ -#define TLPM_DEFAULT_IDLE_TIMEOUT_LSB 0xE8 -#define TLPM_DEFAULT_IDLE_TIMEOUT_MSB 0x3 - -/* wakeup timeout in 8-bit value as in HOST_INTEREST hi_hci_uart_pwr_mgmt_params */ -#define TLPM_DEFAULT_WAKEUP_TIMEOUT_MS 10 - -/* default UART FC polarity is low */ -#define TLPM_DEFAULT_UART_FC_POLARITY 0 - -#endif diff --git a/drivers/net/wireless/ar6003/include/wac_defs.h b/drivers/net/wireless/ar6003/include/wac_defs.h deleted file mode 100644 index b32c6846ef84..000000000000 --- a/drivers/net/wireless/ar6003/include/wac_defs.h +++ /dev/null @@ -1,56 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef __WAC_API_H__ -#define __WAC_API_H__ - -typedef enum { - WAC_SET, - WAC_GET, -} WAC_REQUEST_TYPE; - -typedef enum { - WAC_ADD, - WAC_DEL, - WAC_GET_STATUS, - WAC_GET_IE, -} WAC_COMMAND; - -typedef enum { - PRBREQ, - PRBRSP, - BEACON, -} WAC_FRAME_TYPE; - -typedef enum { - WAC_FAILED_NO_WAC_AP = -4, - WAC_FAILED_LOW_RSSI = -3, - WAC_FAILED_INVALID_PARAM = -2, - WAC_FAILED_REJECTED = -1, - WAC_SUCCESS = 0, - WAC_DISABLED = 1, - WAC_PROCEED_FIRST_PHASE, - WAC_PROCEED_SECOND_PHASE, -} WAC_STATUS; - - -#endif diff --git a/drivers/net/wireless/ar6003/include/wlan_defs.h b/drivers/net/wireless/ar6003/include/wlan_defs.h deleted file mode 100644 index eee7195d09db..000000000000 --- a/drivers/net/wireless/ar6003/include/wlan_defs.h +++ /dev/null @@ -1,85 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== -#ifndef __WLAN_DEFS_H__ -#define __WLAN_DEFS_H__ - -/* - * This file contains WLAN definitions that may be used across both - * Host and Target software. - */ - -typedef enum { - MODE_11A = 0, /* 11a Mode */ - MODE_11G = 1, /* 11b/g Mode */ - MODE_11B = 2, /* 11b Mode */ - MODE_11GONLY = 3, /* 11g only Mode */ -#ifdef SUPPORT_11N - MODE_11NA_HT20 = 4, /* 11a HT20 mode */ - MODE_11NG_HT20 = 5, /* 11g HT20 mode */ - MODE_11NA_HT40 = 6, /* 11a HT40 mode */ - MODE_11NG_HT40 = 7, /* 11g HT40 mode */ - MODE_UNKNOWN = 8, - MODE_MAX = 8 -#else - MODE_UNKNOWN = 4, - MODE_MAX = 4 -#endif -} WLAN_PHY_MODE; - -typedef enum { - WLAN_11A_CAPABILITY = 1, - WLAN_11G_CAPABILITY = 2, - WLAN_11AG_CAPABILITY = 3, -}WLAN_CAPABILITY; - -#ifdef SUPPORT_11N -#ifdef SUPPORT_2SS -typedef A_UINT64 A_RATEMASK; -#else -typedef unsigned long A_RATEMASK; -#endif /* SUPPORT_2SS */ -#else -typedef unsigned short A_RATEMASK; -#endif /* SUPPORT_11N */ - -#ifdef SUPPORT_11N -#define IS_MODE_11A(mode) (((mode) == MODE_11A) || \ - ((mode) == MODE_11NA_HT20) || \ - ((mode) == MODE_11NA_HT40)) -#define IS_MODE_11B(mode) ((mode) == MODE_11B) -#define IS_MODE_11G(mode) (((mode) == MODE_11G) || \ - ((mode) == MODE_11GONLY) || \ - ((mode) == MODE_11NG_HT20) || \ - ((mode) == MODE_11NG_HT40)) -#define IS_MODE_11GN(mode) (((mode) == MODE_11NG_HT20) || \ - ((mode) == MODE_11NG_HT40)) -#define IS_MODE_11GONLY(mode) ((mode) == MODE_11GONLY) -#else -#define IS_MODE_11A(mode) ((mode) == MODE_11A) -#define IS_MODE_11B(mode) ((mode) == MODE_11B) -#define IS_MODE_11G(mode) (((mode) == MODE_11G) || \ - ((mode) == MODE_11GONLY)) -#define IS_MODE_11GONLY(mode) ((mode) == MODE_11GONLY) -#endif /* SUPPORT_11N */ - -#endif /* __WLANDEFS_H__ */ diff --git a/drivers/net/wireless/ar6003/include/wlan_dset.h b/drivers/net/wireless/ar6003/include/wlan_dset.h deleted file mode 100644 index 864a60cedf10..000000000000 --- a/drivers/net/wireless/ar6003/include/wlan_dset.h +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -#ifndef __WLAN_DSET_H__ -#define __WLAN_DSET_H__ - -typedef PREPACK struct wow_config_dset { - - A_UINT8 valid_dset; - A_UINT8 gpio_enable; - A_UINT16 gpio_pin; -} POSTPACK WOW_CONFIG_DSET; - -#endif diff --git a/drivers/net/wireless/ar6003/include/wmi.h b/drivers/net/wireless/ar6003/include/wmi.h deleted file mode 100644 index 0c32588543e8..000000000000 --- a/drivers/net/wireless/ar6003/include/wmi.h +++ /dev/null @@ -1,3834 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -/* - * This file contains the definitions of the WMI protocol specified in the - * Wireless Module Interface (WMI). It includes definitions of all the - * commands and events. Commands are messages from the host to the WM. - * Events and Replies are messages from the WM to the host. - * - * Ownership of correctness in regards to commands - * belongs to the host driver and the WMI is not required to validate - * parameters for value, proper range, or any other checking. - * - */ - -#ifndef _WMI_H_ -#define _WMI_H_ - -#ifndef ATH_TARGET -#include "athstartpack.h" -#endif - -#include "wmix.h" -#include "wlan_defs.h" -#include "dfs_common.h" -#ifdef __cplusplus -extern "C" { -#endif - -#define HTC_PROTOCOL_VERSION 0x0002 -#define HTC_PROTOCOL_REVISION 0x0000 - -#define WMI_PROTOCOL_VERSION 0x0002 -#define WMI_PROTOCOL_REVISION 0x0000 - -#define ATH_MAC_LEN 6 /* length of mac in bytes */ -#define WMI_CMD_MAX_LEN 100 -#define WMI_CONTROL_MSG_MAX_LEN 256 -#define WMI_OPT_CONTROL_MSG_MAX_LEN 1536 -#define IS_ETHERTYPE(_typeOrLen) ((_typeOrLen) >= 0x0600) -#define RFC1042OUI {0x00, 0x00, 0x00} - -#define IP_ETHERTYPE 0x0800 - -#define WMI_IMPLICIT_PSTREAM 0xFF -#define WMI_MAX_THINSTREAM 15 - -#ifdef AR6002_REV2 -#define IBSS_MAX_NUM_STA 4 -#else -#define IBSS_MAX_NUM_STA 8 -#endif - -#define WMI_MODE_MAX 8 -#define WMI_MAX_RATE_MASK 2 - -PREPACK struct host_app_area_s { - A_UINT32 wmi_protocol_ver; -} POSTPACK; - -/* - * Data Path - */ -typedef PREPACK struct { - A_UINT8 dstMac[ATH_MAC_LEN]; - A_UINT8 srcMac[ATH_MAC_LEN]; - A_UINT16 typeOrLen; -} POSTPACK ATH_MAC_HDR; - -typedef PREPACK struct { - A_UINT8 dsap; - A_UINT8 ssap; - A_UINT8 cntl; - A_UINT8 orgCode[3]; - A_UINT16 etherType; -} POSTPACK ATH_LLC_SNAP_HDR; - -typedef enum { - DATA_MSGTYPE = 0x0, - CNTL_MSGTYPE, - SYNC_MSGTYPE, - OPT_MSGTYPE, -} WMI_MSG_TYPE; - - -/* - * Macros for operating on WMI_DATA_HDR (info) field - */ - -#define WMI_DATA_HDR_MSG_TYPE_MASK 0x03 -#define WMI_DATA_HDR_MSG_TYPE_SHIFT 0 -#define WMI_DATA_HDR_UP_MASK 0x07 -#define WMI_DATA_HDR_UP_SHIFT 2 -/* In AP mode, the same bit (b5) is used to indicate Power save state in - * the Rx dir and More data bit state in the tx direction. - */ -#define WMI_DATA_HDR_PS_MASK 0x1 -#define WMI_DATA_HDR_PS_SHIFT 5 - -#define WMI_DATA_HDR_MORE_MASK 0x1 -#define WMI_DATA_HDR_MORE_SHIFT 5 - -typedef enum { - WMI_DATA_HDR_DATA_TYPE_802_3 = 0, - WMI_DATA_HDR_DATA_TYPE_802_11, - WMI_DATA_HDR_DATA_TYPE_ACL, -} WMI_DATA_HDR_DATA_TYPE; - -/* Bitmap of data header flags */ -typedef enum { - WMI_DATA_HDR_FLAGS_MORE = 0x1, - WMI_DATA_HDR_FLAGS_EOSP = 0x2, -} WMI_DATA_HDR_FLAGS; - -#define WMI_DATA_HDR_DATA_TYPE_MASK 0x3 -#define WMI_DATA_HDR_DATA_TYPE_SHIFT 6 - -#define WMI_DATA_HDR_SET_MORE_BIT(h) ((h)->info |= (WMI_DATA_HDR_MORE_MASK << WMI_DATA_HDR_MORE_SHIFT)) -#define WMI_DATA_HDR_HAS_MORE_BIT(h) ((h)->info & (WMI_DATA_HDR_MORE_MASK << WMI_DATA_HDR_MORE_SHIFT)) - -#define WMI_DATA_HDR_IS_MSG_TYPE(h, t) (((h)->info & (WMI_DATA_HDR_MSG_TYPE_MASK)) == (t)) -#define WMI_DATA_HDR_SET_MSG_TYPE(h, t) (h)->info = (((h)->info & ~(WMI_DATA_HDR_MSG_TYPE_MASK << WMI_DATA_HDR_MSG_TYPE_SHIFT)) | (t << WMI_DATA_HDR_MSG_TYPE_SHIFT)) -#define WMI_DATA_HDR_GET_UP(h) (((h)->info >> WMI_DATA_HDR_UP_SHIFT) & WMI_DATA_HDR_UP_MASK) -#define WMI_DATA_HDR_SET_UP(h, p) (h)->info = (((h)->info & ~(WMI_DATA_HDR_UP_MASK << WMI_DATA_HDR_UP_SHIFT)) | (p << WMI_DATA_HDR_UP_SHIFT)) - -#define WMI_DATA_HDR_GET_DATA_TYPE(h) (((h)->info >> WMI_DATA_HDR_DATA_TYPE_SHIFT) & WMI_DATA_HDR_DATA_TYPE_MASK) -#define WMI_DATA_HDR_SET_DATA_TYPE(h, p) (h)->info = (((h)->info & ~(WMI_DATA_HDR_DATA_TYPE_MASK << WMI_DATA_HDR_DATA_TYPE_SHIFT)) | ((p) << WMI_DATA_HDR_DATA_TYPE_SHIFT)) - -#define WMI_DATA_HDR_GET_DOT11(h) (WMI_DATA_HDR_GET_DATA_TYPE((h)) == WMI_DATA_HDR_DATA_TYPE_802_11) -#define WMI_DATA_HDR_SET_DOT11(h, p) WMI_DATA_HDR_SET_DATA_TYPE((h), (p)) - -/* Macros for operating on WMI_DATA_HDR (info2) field */ -#define WMI_DATA_HDR_SEQNO_MASK 0xFFF -#define WMI_DATA_HDR_SEQNO_SHIFT 0 - -#define WMI_DATA_HDR_AMSDU_MASK 0x1 -#define WMI_DATA_HDR_AMSDU_SHIFT 12 - -#define WMI_DATA_HDR_META_MASK 0x7 -#define WMI_DATA_HDR_META_SHIFT 13 - -#define GET_SEQ_NO(_v) ((_v) & WMI_DATA_HDR_SEQNO_MASK) -#define GET_ISMSDU(_v) ((_v) & WMI_DATA_HDR_AMSDU_MASK) - -#define WMI_DATA_HDR_GET_SEQNO(h) GET_SEQ_NO((h)->info2 >> WMI_DATA_HDR_SEQNO_SHIFT) -#define WMI_DATA_HDR_SET_SEQNO(h, _v) ((h)->info2 = ((h)->info2 & ~(WMI_DATA_HDR_SEQNO_MASK << WMI_DATA_HDR_SEQNO_SHIFT)) | (GET_SEQ_NO(_v) << WMI_DATA_HDR_SEQNO_SHIFT)) - -#define WMI_DATA_HDR_IS_AMSDU(h) GET_ISMSDU((h)->info2 >> WMI_DATA_HDR_AMSDU_SHIFT) -#define WMI_DATA_HDR_SET_AMSDU(h, _v) ((h)->info2 = ((h)->info2 & ~(WMI_DATA_HDR_AMSDU_MASK << WMI_DATA_HDR_AMSDU_SHIFT)) | (GET_ISMSDU(_v) << WMI_DATA_HDR_AMSDU_SHIFT)) - -#define WMI_DATA_HDR_GET_META(h) (((h)->info2 >> WMI_DATA_HDR_META_SHIFT) & WMI_DATA_HDR_META_MASK) -#define WMI_DATA_HDR_SET_META(h, _v) ((h)->info2 = ((h)->info2 & ~(WMI_DATA_HDR_META_MASK << WMI_DATA_HDR_META_SHIFT)) | ((_v) << WMI_DATA_HDR_META_SHIFT)) - -/* Macros for operating on WMI_DATA_HDR (info3) field */ -#define WMI_DATA_HDR_DEVID_MASK 0xF -#define WMI_DATA_HDR_DEVID_SHIFT 0 -#define GET_DEVID(_v) ((_v) & WMI_DATA_HDR_DEVID_MASK) - -#define WMI_DATA_HDR_GET_DEVID(h) (((h)->info3 >> WMI_DATA_HDR_DEVID_SHIFT) & WMI_DATA_HDR_DEVID_MASK) -#define WMI_DATA_HDR_SET_DEVID(h, _v) ((h)->info3 = ((h)->info3 & ~(WMI_DATA_HDR_DEVID_MASK << WMI_DATA_HDR_DEVID_SHIFT)) | (GET_DEVID(_v) << WMI_DATA_HDR_DEVID_SHIFT)) - -#define WMI_DATA_HDR_TRIGGER_MASK 0x1 -#define WMI_DATA_HDR_TRIGGER_SHIFT 4 -#define WMI_DATA_HDR_SET_TRIGGER(h, _v) ((h)->info3 = ((h)->info3 & ~(WMI_DATA_HDR_TRIGGER_MASK << WMI_DATA_HDR_TRIGGER_SHIFT)) | ((_v) << WMI_DATA_HDR_TRIGGER_SHIFT)) -#define WMI_DATA_HDR_IS_TRIGGER(h) ((((h)->info3 >> WMI_DATA_HDR_TRIGGER_SHIFT) & WMI_DATA_HDR_TRIGGER_MASK) == WMI_DATA_HDR_TRIGGER_MASK) - -#define WMI_DATA_HDR_EOSP_MASK WMI_DATA_HDR_TRIGGER_MASK -#define WMI_DATA_HDR_EOSP_SHIFT WMI_DATA_HDR_TRIGGER_SHIFT - -#define WMI_DATA_HDR_SET_EOSP_BIT(h) ((h)->info3 |= (WMI_DATA_HDR_EOSP_MASK << WMI_DATA_HDR_EOSP_SHIFT)) -#define WMI_DATA_HDR_HAS_EOSP_BIT(h) ((h)->info3 & (WMI_DATA_HDR_EOSP_MASK << WMI_DATA_HDR_EOSP_SHIFT)) - -typedef PREPACK struct { - A_INT8 rssi; - A_UINT8 info; /* usage of 'info' field(8-bit): - * b1:b0 - WMI_MSG_TYPE - * b4:b3:b2 - UP(tid) - * b5 - Used in AP mode. More-data in tx dir, PS in rx. - * b7:b6 - Dot3 header(0), - * Dot11 Header(1), - * ACL data(2) - */ - - A_UINT16 info2; /* usage of 'info2' field(16-bit): - * b11:b0 - seq_no - * b12 - A-MSDU? - * b15:b13 - META_DATA_VERSION 0 - 7 - */ - A_UINT16 info3; /* b3:b2:b1:b0 - device id - * b4 - Used in AP mode. uAPSD trigger in rx, EOSP in tx - */ -} POSTPACK WMI_DATA_HDR; - -/* - * TX META VERSION DEFINITIONS - */ -#define WMI_MAX_TX_META_SZ (12) -#define WMI_MAX_TX_META_VERSION (7) -#define WMI_META_VERSION_1 (0x01) -#define WMI_META_VERSION_2 (0X02) -#define WMI_META_VERSION_3 (0x03) - -#define WMI_ACL_TO_DOT11_HEADROOM 36 - -#if 0 /* removed to prevent compile errors for WM.. */ -typedef PREPACK struct { -/* intentionally empty. Default version is no meta data. */ -} POSTPACK WMI_TX_META_V0; -#endif - -typedef PREPACK struct { - A_UINT8 pktID; /* The packet ID to identify the tx request */ - A_UINT8 ratePolicyID; /* The rate policy to be used for the tx of this frame */ -} POSTPACK WMI_TX_META_V1; - - -#define WMI_CSUM_DIR_TX (0x1) -#define TX_CSUM_CALC_FILL (0x1) -typedef PREPACK struct { - A_UINT8 csumStart; /*Offset from start of the Payload(SNAP header) for csum calculation to begin */ - A_UINT8 csumDest; /*Offset from start of Payload(SNAP header) where final csum goes*/ - A_UINT8 csumFlags; /*Flag for check sum engine to be offloaded to device*/ -} POSTPACK WMI_TX_META_V2; - -/* WMI_META_TX_FLAG... are used as TX qualifiers for frames containing WMI_TX_RATE_SCHEDULE in the - * meta data. 0 or more of these flags should be assigned to the flags member of the schedule. */ -#define WMI_META_TX_FLAG_ACK 0x01 // frame needs ACK response from receiver -#define WMI_META_TX_FLAG_SET_RETRY_BIT 0x02 // device will set retry bit in MAC header for retried frames. -#define WMI_META_TX_FLAG_SET_DURATION 0x04 // device will fill duration field in MAC header -/* NOTE: If WMI_META_TX_FLAG_USE_PREFIX == 0 device will NOT use prefix frame. - * If WMI_META_TX_FLAG_USE_PREFIX == 1 && WMI_META_TX_FLAG_PREFIX_RTS == 0 device will use CTS prefix. - * If WMI_META_TX_FLAG_USE_PREFIX == 1 && WMI_META_TX_FLAG_PREFIX_RTS == 1 device will use RTS prefix. - */ -#define WMI_META_TX_FLAG_USE_PREFIX 0x08 // device will send either RTS or CTS frame prior to subject frame. -#define WMI_META_TX_FLAG_PREFIX_RTS 0x10 // device will send RTS and wait for CTS prior to sending subject frame. -#define WMI_META_TX_LOAD_TSF 0x20 // device will fill the TSF field during transmit procedure. - -/* WMI_TX_RATE_SCHEDULE - Acts as a host-provided rate schedule to replace what would be normally determined - * by firmware. This allows the host to specify what rates and attempts should be used to transmit the - * frame. */ -typedef PREPACK struct { -#define WMI_TX_MAX_RATE_SERIES (4) - A_UINT8 rateSeries[WMI_TX_MAX_RATE_SERIES]; //rate index for each series. first invalid rate terminates series. - A_UINT8 trySeries[WMI_TX_MAX_RATE_SERIES]; //number of tries for each series. - A_UINT8 flags; // combination of WMI_META_TX_FLAG... - A_UINT8 accessCategory; // should be WMM_AC_BE for managment frames and multicast frames. - //A_UINT8 keyIndex; - // -}POSTPACK WMI_TX_RATE_SCHEDULE; - -typedef PREPACK struct { - WMI_TX_RATE_SCHEDULE rateSched; - A_UINT8 pktID; /* The packet ID to identify the tx request */ -} POSTPACK WMI_TX_META_V3; - -/* - * RX META VERSION DEFINITIONS - */ -/* if RX meta data is present at all then the meta data field - * will consume WMI_MAX_RX_META_SZ bytes of space between the - * WMI_DATA_HDR and the payload. How much of the available - * Meta data is actually used depends on which meta data - * version is active. */ -#define WMI_MAX_RX_META_SZ (12) -#define WMI_MAX_RX_META_VERSION (7) - -#define WMI_RX_STATUS_OK 0 /* success */ -#define WMI_RX_STATUS_DECRYPT_ERR 1 /* decrypt error */ -#define WMI_RX_STATUS_MIC_ERR 2 /* tkip MIC error */ -#define WMI_RX_STATUS_ERR 3 /* undefined error */ - -#define WMI_RX_FLAGS_AGGR 0x0001 /* part of AGGR */ -#define WMI_RX_FlAGS_STBC 0x0002 /* used STBC */ -#define WMI_RX_FLAGS_SGI 0x0004 /* used SGI */ -#define WMI_RX_FLAGS_HT 0x0008 /* is HT packet */ -/* the flags field is also used to store the CRYPTO_TYPE of the frame - * that value is shifted by WMI_RX_FLAGS_CRYPTO_SHIFT */ -#define WMI_RX_FLAGS_CRYPTO_SHIFT 4 -#define WMI_RX_FLAGS_CRYPTO_MASK 0x1f -#define WMI_RX_META_GET_CRYPTO(flags) (((flags) >> WMI_RX_FLAGS_CRYPTO_SHIFT) & WMI_RX_FLAGS_CRYPTO_MASK) - -#if 0 /* removed to prevent compile errors for WM.. */ -typedef PREPACK struct { -/* intentionally empty. Default version is no meta data. */ -} POSTPACK WMI_RX_META_VERSION_0; -#endif - -typedef PREPACK struct { - A_UINT8 status; /* one of WMI_RX_STATUS_... */ - A_UINT8 rix; /* rate index mapped to rate at which this packet was received. */ - A_UINT8 rssi; /* rssi of packet */ - A_UINT8 channel;/* rf channel during packet reception */ - A_UINT16 flags; /* a combination of WMI_RX_FLAGS_... */ -} POSTPACK WMI_RX_META_V1; - -#define RX_CSUM_VALID_FLAG (0x1) -typedef PREPACK struct { - A_UINT16 csum; - A_UINT8 csumFlags;/* bit 0 set -partial csum valid - bit 1 set -test mode */ -} POSTPACK WMI_RX_META_V2; - - - -#define WMI_GET_DEVICE_ID(info1) ((info1) & 0xF) -/* Macros for operating on WMI_CMD_HDR (info1) field */ -#define WMI_CMD_HDR_DEVID_MASK 0xF -#define WMI_CMD_HDR_DEVID_SHIFT 0 -#define GET_CMD_DEVID(_v) ((_v) & WMI_CMD_HDR_DEVID_MASK) - -#define WMI_CMD_HDR_GET_DEVID(h) (((h)->info1 >> WMI_CMD_HDR_DEVID_SHIFT) & WMI_CMD_HDR_DEVID_MASK) -#define WMI_CMD_HDR_SET_DEVID(h, _v) ((h)->info1 = ((h)->info1 & ~(WMI_CMD_HDR_DEVID_MASK << WMI_CMD_HDR_DEVID_SHIFT)) | (GET_CMD_DEVID(_v) << WMI_CMD_HDR_DEVID_SHIFT)) - -/* - * Control Path - */ -typedef PREPACK struct { - A_UINT16 commandId; -/* - * info1 - 16 bits - * b03:b00 - id - * b15:b04 - unused - */ - A_UINT16 info1; - - A_UINT16 reserved; /* For alignment */ -} POSTPACK WMI_CMD_HDR; /* used for commands and events */ - -/* - * List of Commnands - */ -typedef enum { - WMI_CONNECT_CMDID = 0x0001, - WMI_RECONNECT_CMDID, - WMI_DISCONNECT_CMDID, - WMI_SYNCHRONIZE_CMDID, - WMI_CREATE_PSTREAM_CMDID, - WMI_DELETE_PSTREAM_CMDID, - WMI_START_SCAN_CMDID, - WMI_SET_SCAN_PARAMS_CMDID, - WMI_SET_BSS_FILTER_CMDID, - WMI_SET_PROBED_SSID_CMDID, /* 10 */ - WMI_SET_LISTEN_INT_CMDID, - WMI_SET_BMISS_TIME_CMDID, - WMI_SET_DISC_TIMEOUT_CMDID, - WMI_GET_CHANNEL_LIST_CMDID, - WMI_SET_BEACON_INT_CMDID, - WMI_GET_STATISTICS_CMDID, - WMI_SET_CHANNEL_PARAMS_CMDID, - WMI_SET_POWER_MODE_CMDID, - WMI_SET_IBSS_PM_CAPS_CMDID, - WMI_SET_POWER_PARAMS_CMDID, /* 20 */ - WMI_SET_POWERSAVE_TIMERS_POLICY_CMDID, - WMI_ADD_CIPHER_KEY_CMDID, - WMI_DELETE_CIPHER_KEY_CMDID, - WMI_ADD_KRK_CMDID, - WMI_DELETE_KRK_CMDID, - WMI_SET_PMKID_CMDID, - WMI_SET_TX_PWR_CMDID, - WMI_GET_TX_PWR_CMDID, - WMI_SET_ASSOC_INFO_CMDID, - WMI_ADD_BAD_AP_CMDID, /* 30 */ - WMI_DELETE_BAD_AP_CMDID, - WMI_SET_TKIP_COUNTERMEASURES_CMDID, - WMI_RSSI_THRESHOLD_PARAMS_CMDID, - WMI_TARGET_ERROR_REPORT_BITMASK_CMDID, - WMI_SET_ACCESS_PARAMS_CMDID, - WMI_SET_RETRY_LIMITS_CMDID, - WMI_RESERVED1, - WMI_RESERVED2, - WMI_SET_VOICE_PKT_SIZE_CMDID, - WMI_SET_MAX_SP_LEN_CMDID, /* 40 */ - WMI_SET_ROAM_CTRL_CMDID, - WMI_GET_ROAM_TBL_CMDID, - WMI_GET_ROAM_DATA_CMDID, - WMI_ENABLE_RM_CMDID, - WMI_SET_MAX_OFFHOME_DURATION_CMDID, - WMI_EXTENSION_CMDID, /* Non-wireless extensions */ - WMI_SNR_THRESHOLD_PARAMS_CMDID, - WMI_LQ_THRESHOLD_PARAMS_CMDID, - WMI_SET_LPREAMBLE_CMDID, - WMI_SET_RTS_CMDID, /* 50 */ - WMI_CLR_RSSI_SNR_CMDID, - WMI_SET_FIXRATES_CMDID, - WMI_GET_FIXRATES_CMDID, - WMI_SET_AUTH_MODE_CMDID, - WMI_SET_REASSOC_MODE_CMDID, - WMI_SET_WMM_CMDID, - WMI_SET_WMM_TXOP_CMDID, - WMI_TEST_CMDID, - /* COEX AR6002 only*/ - WMI_SET_BT_STATUS_CMDID, - WMI_SET_BT_PARAMS_CMDID, /* 60 */ - - WMI_SET_KEEPALIVE_CMDID, - WMI_GET_KEEPALIVE_CMDID, - WMI_SET_APPIE_CMDID, - WMI_GET_APPIE_CMDID, - WMI_SET_WSC_STATUS_CMDID, - - /* Wake on Wireless */ - WMI_SET_HOST_SLEEP_MODE_CMDID, - WMI_SET_WOW_MODE_CMDID, - WMI_GET_WOW_LIST_CMDID, - WMI_ADD_WOW_PATTERN_CMDID, - WMI_DEL_WOW_PATTERN_CMDID, /* 70 */ - - WMI_SET_FRAMERATES_CMDID, - WMI_SET_AP_PS_CMDID, - WMI_SET_QOS_SUPP_CMDID, - /* WMI_THIN_RESERVED_... mark the start and end - * values for WMI_THIN_RESERVED command IDs. These - * command IDs can be found in wmi_thin.h */ - WMI_THIN_RESERVED_START = 0x8000, - WMI_THIN_RESERVED_END = 0x8fff, - /* - * Developer commands starts at 0xF000 - */ - WMI_SET_BITRATE_CMDID = 0xF000, - WMI_GET_BITRATE_CMDID, - WMI_SET_WHALPARAM_CMDID, - - - /*Should add the new command to the tail for compatible with - * etna. - */ - WMI_SET_MAC_ADDRESS_CMDID, - WMI_SET_AKMP_PARAMS_CMDID, - WMI_SET_PMKID_LIST_CMDID, - WMI_GET_PMKID_LIST_CMDID, - WMI_ABORT_SCAN_CMDID, - WMI_SET_TARGET_EVENT_REPORT_CMDID, - - // Unused - WMI_UNUSED1, - WMI_UNUSED2, - - /* - * AP mode commands - */ - WMI_AP_HIDDEN_SSID_CMDID, /* F00B */ - WMI_AP_SET_NUM_STA_CMDID, - WMI_AP_ACL_POLICY_CMDID, - WMI_AP_ACL_MAC_LIST_CMDID, - WMI_AP_CONFIG_COMMIT_CMDID, - WMI_AP_SET_MLME_CMDID, /* F010 */ - WMI_AP_SET_PVB_CMDID, - WMI_AP_CONN_INACT_CMDID, - WMI_AP_PROT_SCAN_TIME_CMDID, - WMI_AP_SET_COUNTRY_CMDID, - WMI_AP_SET_DTIM_CMDID, - WMI_AP_MODE_STAT_CMDID, - - WMI_SET_IP_CMDID, /* F017 */ - WMI_SET_PARAMS_CMDID, - WMI_SET_MCAST_FILTER_CMDID, - WMI_DEL_MCAST_FILTER_CMDID, - - WMI_ALLOW_AGGR_CMDID, /* F01B */ - WMI_ADDBA_REQ_CMDID, - WMI_DELBA_REQ_CMDID, - WMI_SET_HT_CAP_CMDID, - WMI_SET_HT_OP_CMDID, - WMI_SET_TX_SELECT_RATES_CMDID, - WMI_SET_TX_SGI_PARAM_CMDID, - WMI_SET_RATE_POLICY_CMDID, - - WMI_HCI_CMD_CMDID, /* F023 */ - WMI_RX_FRAME_FORMAT_CMDID, - WMI_SET_THIN_MODE_CMDID, - WMI_SET_BT_WLAN_CONN_PRECEDENCE_CMDID, - - WMI_AP_SET_11BG_RATESET_CMDID, /* F027 */ - WMI_SET_PMK_CMDID, - WMI_MCAST_FILTER_CMDID, - /* COEX CMDID AR6003*/ - WMI_SET_BTCOEX_FE_ANT_CMDID, /* F02A */ - WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID, - WMI_SET_BTCOEX_SCO_CONFIG_CMDID, - WMI_SET_BTCOEX_A2DP_CONFIG_CMDID, - WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMDID, - WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMDID, - WMI_SET_BTCOEX_DEBUG_CMDID, - WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID, - WMI_GET_BTCOEX_STATS_CMDID, - WMI_GET_BTCOEX_CONFIG_CMDID, - - WMI_SET_DFS_ENABLE_CMDID, /* F034 */ - WMI_SET_DFS_MINRSSITHRESH_CMDID, - WMI_SET_DFS_MAXPULSEDUR_CMDID, - WMI_DFS_RADAR_DETECTED_CMDID, - - /* P2P CMDS */ - WMI_P2P_SET_CONFIG_CMDID, /* F038 */ - WMI_WPS_SET_CONFIG_CMDID, - WMI_SET_REQ_DEV_ATTR_CMDID, - WMI_P2P_FIND_CMDID, - WMI_P2P_STOP_FIND_CMDID, - WMI_P2P_GO_NEG_START_CMDID, - WMI_P2P_LISTEN_CMDID, - - WMI_CONFIG_TX_MAC_RULES_CMDID, - WMI_SET_PROMISCUOUS_MODE_CMDID,/* F040 */ - WMI_RX_FRAME_FILTER_CMDID, - WMI_SET_CHANNEL_CMDID, - - /* WAC commands */ - WMI_ENABLE_WAC_CMDID, - WMI_WAC_SCAN_REPLY_CMDID, - WMI_WAC_CTRL_REQ_CMDID, - WMI_SET_DIV_PARAMS_CMDID, - - WMI_GET_PMK_CMDID, - WMI_SET_PASSPHRASE_CMDID, - WMI_SEND_ASSOC_RES_CMDID, - WMI_SET_ASSOC_REQ_RELAY_CMDID, - WMI_GET_RFKILL_MODE_CMDID, - WMI_SET_RFKILL_MODE_CMDID, - - /* ACS command, consists of sub-commands */ - WMI_ACS_CTRL_CMDID, - - /* Ultra low power store / recall commands */ - WMI_STORERECALL_CONFIGURE_CMDID, - WMI_STORERECALL_RECALL_CMDID, - WMI_STORERECALL_HOST_READY_CMDID, - WMI_FORCE_TARGET_ASSERT_CMDID, - WMI_SET_EXCESS_TX_RETRY_THRES_CMDID, - - WMI_P2P_GO_NEG_REQ_RSP_CMDID, /* F053 */ - WMI_P2P_GRP_INIT_CMDID, - WMI_P2P_GRP_FORMATION_DONE_CMDID, - WMI_P2P_INVITE_CMDID, - WMI_P2P_INVITE_REQ_RSP_CMDID, - WMI_P2P_PROV_DISC_REQ_CMDID, - WMI_P2P_SET_CMDID, - - WMI_AP_SET_APSD_CMDID, /* F05A */ - WMI_AP_APSD_BUFFERED_TRAFFIC_CMDID, - - WMI_P2P_SDPD_TX_CMDID, /* F05C */ - WMI_P2P_STOP_SDPD_CMDID, - WMI_P2P_CANCEL_CMDID, - -} WMI_COMMAND_ID; - -/* - * Frame Types - */ -typedef enum { - WMI_FRAME_BEACON = 0, - WMI_FRAME_PROBE_REQ, - WMI_FRAME_PROBE_RESP, - WMI_FRAME_ASSOC_REQ, - WMI_FRAME_ASSOC_RESP, - WMI_NUM_MGMT_FRAME -} WMI_MGMT_FRAME_TYPE; - -/* - * Connect Command - */ -typedef enum { - INFRA_NETWORK = 0x01, - ADHOC_NETWORK = 0x02, - ADHOC_CREATOR = 0x04, - AP_NETWORK = 0x10, -} NETWORK_TYPE; - -typedef enum { - SUBTYPE_NONE, - SUBTYPE_BT, - SUBTYPE_P2PDEV, - SUBTYPE_P2PCLIENT, - SUBTYPE_P2PGO, -} NETWORK_SUBTYPE; - -typedef enum { - OPEN_AUTH = 0x01, - SHARED_AUTH = 0x02, - LEAP_AUTH = 0x04, /* different from IEEE_AUTH_MODE definitions */ -} DOT11_AUTH_MODE; - -typedef enum { - WMI_NONE_AUTH = 0x01, - WMI_WPA_AUTH = 0x02, - WMI_WPA2_AUTH = 0x04, - WMI_WPA_PSK_AUTH = 0x08, - WMI_WPA2_PSK_AUTH = 0x10, - WMI_WPA_AUTH_CCKM = 0x20, - WMI_WPA2_AUTH_CCKM = 0x40, -} AUTH_MODE; - -typedef enum { - NONE_CRYPT = 0x01, - WEP_CRYPT = 0x02, - TKIP_CRYPT = 0x04, - AES_CRYPT = 0x08, -#ifdef WAPI_ENABLE - WAPI_CRYPT = 0x10, -#endif /*WAPI_ENABLE*/ -} CRYPTO_TYPE; - -#define WMI_MIN_CRYPTO_TYPE NONE_CRYPT -#define WMI_MAX_CRYPTO_TYPE (AES_CRYPT + 1) - -#ifdef WAPI_ENABLE -#undef WMI_MAX_CRYPTO_TYPE -#define WMI_MAX_CRYPTO_TYPE (WAPI_CRYPT + 1) -#endif /* WAPI_ENABLE */ - -#ifdef WAPI_ENABLE -#define IW_ENCODE_ALG_SM4 0x20 -/* - * Defined this to be some very high bit because it is less likely to be - * clobbered by future changes to the kernel's wireless.h file -*/ -#define IW_AUTH_CIPHER_SMS4 0x40000000 -#endif - -#define WMI_MIN_KEY_INDEX 0 -#define WMI_MAX_KEY_INDEX 3 - -#ifdef WAPI_ENABLE -#undef WMI_MAX_KEY_INDEX -#define WMI_MAX_KEY_INDEX 7 /* wapi grpKey 0-3, prwKey 4-7 */ -#endif /* WAPI_ENABLE */ - -#define WMI_MAX_KEY_LEN 32 - -#define WMI_MAX_SSID_LEN 32 - -typedef enum { - CONNECT_ASSOC_POLICY_USER = 0x0001, - CONNECT_SEND_REASSOC = 0x0002, - CONNECT_IGNORE_WPAx_GROUP_CIPHER = 0x0004, - CONNECT_PROFILE_MATCH_DONE = 0x0008, - CONNECT_IGNORE_AAC_BEACON = 0x0010, - CONNECT_CSA_FOLLOW_BSS = 0x0020, - CONNECT_DO_WPA_OFFLOAD = 0x0040, - CONNECT_DO_NOT_DEAUTH = 0x0080, - CONNECT_WPS_FLAG = 0x0100, - /* AP configuration flags */ - AP_NO_DISASSOC_UPON_DEAUTH = 0x10000 -} WMI_CONNECT_CTRL_FLAGS_BITS; - -#define DEFAULT_CONNECT_CTRL_FLAGS (CONNECT_CSA_FOLLOW_BSS) - -typedef PREPACK struct { - A_UINT8 networkType; - A_UINT8 dot11AuthMode; - A_UINT8 authMode; - A_UINT8 pairwiseCryptoType; - A_UINT8 pairwiseCryptoLen; - A_UINT8 groupCryptoType; - A_UINT8 groupCryptoLen; - A_UINT8 ssidLength; - A_UCHAR ssid[WMI_MAX_SSID_LEN]; - A_UINT16 channel; - A_UINT8 bssid[ATH_MAC_LEN]; - A_UINT32 ctrl_flags; -} POSTPACK WMI_CONNECT_CMD; - - -typedef PREPACK struct { - A_UINT32 divIdleTime; - A_UINT8 antRssiThresh; - A_UINT8 divEnable; - A_UINT16 active_treshold_rate; -} POSTPACK WMI_DIV_PARAMS_CMD; - -/* - * WMI_RECONNECT_CMDID - */ -typedef PREPACK struct { - A_UINT16 channel; /* hint */ - A_UINT8 bssid[ATH_MAC_LEN]; /* mandatory if set */ -} POSTPACK WMI_RECONNECT_CMD; - -/* - * WMI_SET_PMK_CMDID - */ -#define WMI_PMK_LEN 32 -typedef PREPACK struct { - A_UINT8 pmk[WMI_PMK_LEN]; -} POSTPACK WMI_SET_PMK_CMD, WMI_GET_PMK_REPLY; - -/* - * WMI_SET_PASSPHRASE_CMDID - */ -#define WMI_PASSPHRASE_LEN 64 -typedef PREPACK struct { - A_UCHAR ssid[WMI_MAX_SSID_LEN]; - A_UINT8 passphrase[WMI_PASSPHRASE_LEN]; - A_UINT8 ssid_len; - A_UINT8 passphrase_len; -} POSTPACK WMI_SET_PASSPHRASE_CMD; - -/* - * WMI_SET_EXCESS_TX_RETRY_THRES_CMDID - */ -typedef PREPACK struct { - A_UINT32 threshold; -} POSTPACK WMI_SET_EXCESS_TX_RETRY_THRES_CMD; - -/* - * WMI_ADD_CIPHER_KEY_CMDID - */ -typedef enum { - PAIRWISE_USAGE = 0x00, - GROUP_USAGE = 0x01, - TX_USAGE = 0x02, /* default Tx Key - Static WEP only */ -} KEY_USAGE; - -/* - * Bit Flag - * Bit 0 - Initialise TSC - default is Initialize - */ -#define KEY_OP_INIT_TSC 0x01 -#define KEY_OP_INIT_RSC 0x02 -#ifdef WAPI_ENABLE -#define KEY_OP_INIT_WAPIPN 0x10 -#endif /* WAPI_ENABLE */ - -#define KEY_OP_INIT_VAL 0x03 /* Default Initialise the TSC & RSC */ -#define KEY_OP_VALID_MASK 0x03 - -typedef PREPACK struct { - A_UINT8 keyIndex; - A_UINT8 keyType; - A_UINT8 keyUsage; /* KEY_USAGE */ - A_UINT8 keyLength; - A_UINT8 keyRSC[8]; /* key replay sequence counter */ - A_UINT8 key[WMI_MAX_KEY_LEN]; - A_UINT8 key_op_ctrl; /* Additional Key Control information */ - A_UINT8 key_macaddr[ATH_MAC_LEN]; -} POSTPACK WMI_ADD_CIPHER_KEY_CMD; - -/* - * WMI_DELETE_CIPHER_KEY_CMDID - */ -typedef PREPACK struct { - A_UINT8 keyIndex; -} POSTPACK WMI_DELETE_CIPHER_KEY_CMD; - -#define WMI_KRK_LEN 16 -/* - * WMI_ADD_KRK_CMDID - */ -typedef PREPACK struct { - A_UINT8 krk[WMI_KRK_LEN]; -} POSTPACK WMI_ADD_KRK_CMD; - -/* - * WMI_SET_TKIP_COUNTERMEASURES_CMDID - */ -typedef enum { - WMI_TKIP_CM_DISABLE = 0x0, - WMI_TKIP_CM_ENABLE = 0x1, -} WMI_TKIP_CM_CONTROL; - -typedef PREPACK struct { - A_UINT8 cm_en; /* WMI_TKIP_CM_CONTROL */ -} POSTPACK WMI_SET_TKIP_COUNTERMEASURES_CMD; - -/* - * WMI_SET_PMKID_CMDID - */ - -#define WMI_PMKID_LEN 16 - -typedef enum { - PMKID_DISABLE = 0, - PMKID_ENABLE = 1, -} PMKID_ENABLE_FLG; - -typedef PREPACK struct { - A_UINT8 bssid[ATH_MAC_LEN]; - A_UINT8 enable; /* PMKID_ENABLE_FLG */ - A_UINT8 pmkid[WMI_PMKID_LEN]; -} POSTPACK WMI_SET_PMKID_CMD; - -/* - * WMI_START_SCAN_CMD - */ -typedef enum { - WMI_LONG_SCAN = 0, - WMI_SHORT_SCAN = 1, -} WMI_SCAN_TYPE; - -typedef PREPACK struct { - A_BOOL forceFgScan; - A_BOOL isLegacy; /* For Legacy Cisco AP compatibility */ - A_UINT32 homeDwellTime; /* Maximum duration in the home channel(milliseconds) */ - A_UINT32 forceScanInterval; /* Time interval between scans (milliseconds)*/ - A_UINT8 scanType; /* WMI_SCAN_TYPE */ - A_UINT8 numChannels; /* how many channels follow */ - A_UINT16 channelList[1]; /* channels in Mhz */ -} POSTPACK WMI_START_SCAN_CMD; - -/* - * WMI_SET_SCAN_PARAMS_CMDID - */ -#define WMI_SHORTSCANRATIO_DEFAULT 3 -/* - * Warning: ScanCtrlFlag value of 0xFF is used to disable all flags in WMI_SCAN_PARAMS_CMD - * Do not add any more flags to WMI_SCAN_CTRL_FLAG_BITS - */ -typedef enum { - CONNECT_SCAN_CTRL_FLAGS = 0x01, /* set if can scan in the Connect cmd */ - SCAN_CONNECTED_CTRL_FLAGS = 0x02, /* set if scan for the SSID it is */ - /* already connected to */ - ACTIVE_SCAN_CTRL_FLAGS = 0x04, /* set if enable active scan */ - ROAM_SCAN_CTRL_FLAGS = 0x08, /* set if enable roam scan when bmiss and lowrssi */ - REPORT_BSSINFO_CTRL_FLAGS = 0x10, /* set if follows customer BSSINFO reporting rule */ - ENABLE_AUTO_CTRL_FLAGS = 0x20, /* if disabled, target doesn't - scan after a disconnect event */ - ENABLE_SCAN_ABORT_EVENT = 0x40 /* Scan complete event with canceled status will be generated when a scan is prempted before it gets completed */ -} WMI_SCAN_CTRL_FLAGS_BITS; - -#define CAN_SCAN_IN_CONNECT(flags) (flags & CONNECT_SCAN_CTRL_FLAGS) -#define CAN_SCAN_CONNECTED(flags) (flags & SCAN_CONNECTED_CTRL_FLAGS) -#define ENABLE_ACTIVE_SCAN(flags) (flags & ACTIVE_SCAN_CTRL_FLAGS) -#define ENABLE_ROAM_SCAN(flags) (flags & ROAM_SCAN_CTRL_FLAGS) -#define CONFIG_REPORT_BSSINFO(flags) (flags & REPORT_BSSINFO_CTRL_FLAGS) -#define IS_AUTO_SCAN_ENABLED(flags) (flags & ENABLE_AUTO_CTRL_FLAGS) -#define SCAN_ABORT_EVENT_ENABLED(flags) (flags & ENABLE_SCAN_ABORT_EVENT) - -#define DEFAULT_SCAN_CTRL_FLAGS (CONNECT_SCAN_CTRL_FLAGS| SCAN_CONNECTED_CTRL_FLAGS| ACTIVE_SCAN_CTRL_FLAGS| ROAM_SCAN_CTRL_FLAGS | ENABLE_AUTO_CTRL_FLAGS) - - -typedef PREPACK struct { - A_UINT16 fg_start_period; /* seconds */ - A_UINT16 fg_end_period; /* seconds */ - A_UINT16 bg_period; /* seconds */ - A_UINT16 maxact_chdwell_time; /* msec */ - A_UINT16 pas_chdwell_time; /* msec */ - A_UINT8 shortScanRatio; /* how many shorts scan for one long */ - A_UINT8 scanCtrlFlags; - A_UINT16 minact_chdwell_time; /* msec */ - A_UINT16 maxact_scan_per_ssid; /* max active scans per ssid */ - A_UINT32 max_dfsch_act_time; /* msecs */ -} POSTPACK WMI_SCAN_PARAMS_CMD; - -typedef PREPACK struct { - A_UINT16 chan_index; - A_INT8 bang_radar; -} POSTPACK WMI_RADAR_DETECTED_CMD; - -/* - * WMI_SET_BSS_FILTER_CMDID - */ -typedef enum { - NONE_BSS_FILTER = 0x0, /* no beacons forwarded */ - ALL_BSS_FILTER, /* all beacons forwarded */ - PROFILE_FILTER, /* only beacons matching profile */ - ALL_BUT_PROFILE_FILTER, /* all but beacons matching profile */ - CURRENT_BSS_FILTER, /* only beacons matching current BSS */ - ALL_BUT_BSS_FILTER, /* all but beacons matching BSS */ - PROBED_SSID_FILTER, /* beacons matching probed ssid */ - LAST_BSS_FILTER, /* marker only */ -} WMI_BSS_FILTER; - -typedef PREPACK struct { - A_UINT8 bssFilter; /* see WMI_BSS_FILTER */ - A_UINT8 reserved1; /* For alignment */ - A_UINT16 reserved2; /* For alignment */ - A_UINT32 ieMask; -} POSTPACK WMI_BSS_FILTER_CMD; - -/* - * WMI_SET_PROBED_SSID_CMDID - */ -#define MAX_PROBED_SSID_INDEX 15 - -typedef enum { - DISABLE_SSID_FLAG = 0, /* disables entry */ - SPECIFIC_SSID_FLAG = 0x01, /* probes specified ssid */ - ANY_SSID_FLAG = 0x02, /* probes for any ssid */ -} WMI_SSID_FLAG; - -typedef PREPACK struct { - A_UINT8 entryIndex; /* 0 to MAX_PROBED_SSID_INDEX */ - A_UINT8 flag; /* WMI_SSID_FLG */ - A_UINT8 ssidLength; - A_UINT8 ssid[32]; -} POSTPACK WMI_PROBED_SSID_CMD; - -/* - * WMI_SET_LISTEN_INT_CMDID - * The Listen interval is between 15 and 3000 TUs - */ -#define MIN_LISTEN_INTERVAL 15 -#define MAX_LISTEN_INTERVAL 5000 -#define MIN_LISTEN_BEACONS 1 -#define MAX_LISTEN_BEACONS 50 - -typedef PREPACK struct { - A_UINT16 listenInterval; - A_UINT16 numBeacons; -} POSTPACK WMI_LISTEN_INT_CMD; - -/* - * WMI_SET_BEACON_INT_CMDID - */ -typedef PREPACK struct { - A_UINT16 beaconInterval; -} POSTPACK WMI_BEACON_INT_CMD; - -/* - * WMI_SET_BMISS_TIME_CMDID - * valid values are between 1000 and 5000 TUs - */ - -#define MIN_BMISS_TIME 1000 -#define MAX_BMISS_TIME 5000 -#define MIN_BMISS_BEACONS 1 -#define MAX_BMISS_BEACONS 50 - -typedef PREPACK struct { - A_UINT16 bmissTime; - A_UINT16 numBeacons; -} POSTPACK WMI_BMISS_TIME_CMD; - -/* - * WMI_SET_POWER_MODE_CMDID - */ -typedef enum { - REC_POWER = 0x01, - MAX_PERF_POWER, -} WMI_POWER_MODE; - -typedef PREPACK struct { - A_UINT8 powerMode; /* WMI_POWER_MODE */ -} POSTPACK WMI_POWER_MODE_CMD; - -typedef PREPACK struct { - A_INT8 status; /* WMI_SET_PARAMS_REPLY */ -} POSTPACK WMI_SET_PARAMS_REPLY; - -typedef PREPACK struct { - A_UINT32 opcode; - A_UINT32 length; - A_CHAR buffer[1]; /* WMI_SET_PARAMS */ -} POSTPACK WMI_SET_PARAMS_CMD; - -typedef PREPACK struct { - A_UINT8 multicast_mac[ATH_MAC_LEN]; /* WMI_SET_MCAST_FILTER */ -} POSTPACK WMI_SET_MCAST_FILTER_CMD; - -typedef PREPACK struct { - A_UINT8 enable; /* WMI_MCAST_FILTER */ -} POSTPACK WMI_MCAST_FILTER_CMD; - -/* - * WMI_SET_POWER_PARAMS_CMDID - */ -typedef enum { - IGNORE_DTIM = 0x01, - NORMAL_DTIM = 0x02, - STICK_DTIM = 0x03, - AUTO_DTIM = 0x04, -} WMI_DTIM_POLICY; - -/* Policy to determnine whether TX should wakeup WLAN if sleeping */ -typedef enum { - TX_WAKEUP_UPON_SLEEP = 1, - TX_DONT_WAKEUP_UPON_SLEEP = 2 -} WMI_TX_WAKEUP_POLICY_UPON_SLEEP; - -/* - * Policy to determnine whether power save failure event should be sent to - * host during scanning - */ -typedef enum { - SEND_POWER_SAVE_FAIL_EVENT_ALWAYS = 1, - IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN = 2, -} POWER_SAVE_FAIL_EVENT_POLICY; - -typedef PREPACK struct { - A_UINT16 idle_period; /* msec */ - A_UINT16 pspoll_number; - A_UINT16 dtim_policy; - A_UINT16 tx_wakeup_policy; - A_UINT16 num_tx_to_wakeup; - A_UINT16 ps_fail_event_policy; -} POSTPACK WMI_POWER_PARAMS_CMD; - -/* Adhoc power save types */ -typedef enum { - ADHOC_PS_DISABLE=1, - ADHOC_PS_ATH=2, - ADHOC_PS_IEEE=3, - ADHOC_PS_OTHER=4, -} WMI_ADHOC_PS_TYPE; - -typedef PREPACK struct { - A_UINT8 power_saving; - A_UINT8 ttl; /* number of beacon periods */ - A_UINT16 atim_windows; /* msec */ - A_UINT16 timeout_value; /* msec */ -} POSTPACK WMI_IBSS_PM_CAPS_CMD; - -/* AP power save types */ -typedef enum { - AP_PS_DISABLE=1, - AP_PS_ATH=2, -} WMI_AP_PS_TYPE; - -typedef PREPACK struct { - A_UINT32 idle_time; /* in msec */ - A_UINT32 ps_period; /* in usec */ - A_UINT8 sleep_period; /* in ps periods */ - A_UINT8 psType; -} POSTPACK WMI_AP_PS_CMD; - -/* - * WMI_SET_POWERSAVE_TIMERS_POLICY_CMDID - */ -typedef enum { - IGNORE_TIM_ALL_QUEUES_APSD = 0, - PROCESS_TIM_ALL_QUEUES_APSD = 1, - IGNORE_TIM_SIMULATED_APSD = 2, - PROCESS_TIM_SIMULATED_APSD = 3, -} APSD_TIM_POLICY; - -typedef PREPACK struct { - A_UINT16 psPollTimeout; /* msec */ - A_UINT16 triggerTimeout; /* msec */ - A_UINT32 apsdTimPolicy; /* TIM behavior with ques APSD enabled. Default is IGNORE_TIM_ALL_QUEUES_APSD */ - A_UINT32 simulatedAPSDTimPolicy; /* TIM behavior with simulated APSD enabled. Default is PROCESS_TIM_SIMULATED_APSD */ -} POSTPACK WMI_POWERSAVE_TIMERS_POLICY_CMD; - -/* - * WMI_SET_VOICE_PKT_SIZE_CMDID - */ -typedef PREPACK struct { - A_UINT16 voicePktSize; -} POSTPACK WMI_SET_VOICE_PKT_SIZE_CMD; - -/* - * WMI_SET_MAX_SP_LEN_CMDID - */ -typedef enum { - DELIVER_ALL_PKT = 0x0, - DELIVER_2_PKT = 0x1, - DELIVER_4_PKT = 0x2, - DELIVER_6_PKT = 0x3, -} APSD_SP_LEN_TYPE; - -typedef PREPACK struct { - A_UINT8 maxSPLen; -} POSTPACK WMI_SET_MAX_SP_LEN_CMD; - -/* - * WMI_SET_DISC_TIMEOUT_CMDID - */ -typedef PREPACK struct { - A_UINT8 disconnectTimeout; /* seconds */ -} POSTPACK WMI_DISC_TIMEOUT_CMD; - -typedef enum { - UPLINK_TRAFFIC = 0, - DNLINK_TRAFFIC = 1, - BIDIR_TRAFFIC = 2, -} DIR_TYPE; - -typedef enum { - DISABLE_FOR_THIS_AC = 0, - ENABLE_FOR_THIS_AC = 1, - ENABLE_FOR_ALL_AC = 2, -} VOICEPS_CAP_TYPE; - -typedef enum { - TRAFFIC_TYPE_APERIODIC = 0, - TRAFFIC_TYPE_PERIODIC = 1, -}TRAFFIC_TYPE; - -/* - * WMI_SYNCHRONIZE_CMDID - */ -typedef PREPACK struct { - A_UINT8 dataSyncMap; -} POSTPACK WMI_SYNC_CMD; - -/* - * WMI_CREATE_PSTREAM_CMDID - */ -typedef PREPACK struct { - A_UINT32 minServiceInt; /* in milli-sec */ - A_UINT32 maxServiceInt; /* in milli-sec */ - A_UINT32 inactivityInt; /* in milli-sec */ - A_UINT32 suspensionInt; /* in milli-sec */ - A_UINT32 serviceStartTime; - A_UINT32 minDataRate; /* in bps */ - A_UINT32 meanDataRate; /* in bps */ - A_UINT32 peakDataRate; /* in bps */ - A_UINT32 maxBurstSize; - A_UINT32 delayBound; - A_UINT32 minPhyRate; /* in bps */ - A_UINT32 sba; - A_UINT32 mediumTime; - A_UINT16 nominalMSDU; /* in octects */ - A_UINT16 maxMSDU; /* in octects */ - A_UINT8 trafficClass; - A_UINT8 trafficDirection; /* DIR_TYPE */ - A_UINT8 rxQueueNum; - A_UINT8 trafficType; /* TRAFFIC_TYPE */ - A_UINT8 voicePSCapability; /* VOICEPS_CAP_TYPE */ - A_UINT8 tsid; - A_UINT8 userPriority; /* 802.1D user priority */ - A_UINT8 nominalPHY; /* nominal phy rate */ -} POSTPACK WMI_CREATE_PSTREAM_CMD; - -/* - * WMI_DELETE_PSTREAM_CMDID - */ -typedef PREPACK struct { - A_UINT8 txQueueNumber; - A_UINT8 rxQueueNumber; - A_UINT8 trafficDirection; - A_UINT8 trafficClass; - A_UINT8 tsid; -} POSTPACK WMI_DELETE_PSTREAM_CMD; - -/* - * WMI_SET_CHANNEL_PARAMS_CMDID - */ -typedef enum { - WMI_11A_MODE = 0x1, - WMI_11G_MODE = 0x2, - WMI_11AG_MODE = 0x3, - WMI_11B_MODE = 0x4, - WMI_11GONLY_MODE = 0x5, -} WMI_PHY_MODE; - -#define WMI_MAX_CHANNELS 32 - -typedef PREPACK struct { - A_UINT8 reserved1; - A_UINT8 scanParam; /* set if enable scan */ - A_UINT8 phyMode; /* see WMI_PHY_MODE */ - A_UINT8 numChannels; /* how many channels follow */ - A_UINT16 channelList[1]; /* channels in Mhz */ -} POSTPACK WMI_CHANNEL_PARAMS_CMD; - - -/* - * WMI_RSSI_THRESHOLD_PARAMS_CMDID - * Setting the polltime to 0 would disable polling. - * Threshold values are in the ascending order, and should agree to: - * (lowThreshold_lowerVal < lowThreshold_upperVal < highThreshold_lowerVal - * < highThreshold_upperVal) - */ - -typedef PREPACK struct WMI_RSSI_THRESHOLD_PARAMS{ - A_UINT32 pollTime; /* Polling time as a factor of LI */ - A_INT16 thresholdAbove1_Val; /* lowest of upper */ - A_INT16 thresholdAbove2_Val; - A_INT16 thresholdAbove3_Val; - A_INT16 thresholdAbove4_Val; - A_INT16 thresholdAbove5_Val; - A_INT16 thresholdAbove6_Val; /* highest of upper */ - A_INT16 thresholdBelow1_Val; /* lowest of bellow */ - A_INT16 thresholdBelow2_Val; - A_INT16 thresholdBelow3_Val; - A_INT16 thresholdBelow4_Val; - A_INT16 thresholdBelow5_Val; - A_INT16 thresholdBelow6_Val; /* highest of bellow */ - A_UINT8 weight; /* "alpha" */ - A_UINT8 reserved[3]; -} POSTPACK WMI_RSSI_THRESHOLD_PARAMS_CMD; - -/* - * WMI_SNR_THRESHOLD_PARAMS_CMDID - * Setting the polltime to 0 would disable polling. - */ - -typedef PREPACK struct WMI_SNR_THRESHOLD_PARAMS{ - A_UINT32 pollTime; /* Polling time as a factor of LI */ - A_UINT8 weight; /* "alpha" */ - A_UINT8 thresholdAbove1_Val; /* lowest of uppper*/ - A_UINT8 thresholdAbove2_Val; - A_UINT8 thresholdAbove3_Val; - A_UINT8 thresholdAbove4_Val; /* highest of upper */ - A_UINT8 thresholdBelow1_Val; /* lowest of bellow */ - A_UINT8 thresholdBelow2_Val; - A_UINT8 thresholdBelow3_Val; - A_UINT8 thresholdBelow4_Val; /* highest of bellow */ - A_UINT8 reserved[3]; -} POSTPACK WMI_SNR_THRESHOLD_PARAMS_CMD; - -/* - * WMI_LQ_THRESHOLD_PARAMS_CMDID - */ -typedef PREPACK struct WMI_LQ_THRESHOLD_PARAMS { - A_UINT8 enable; - A_UINT8 thresholdAbove1_Val; - A_UINT8 thresholdAbove2_Val; - A_UINT8 thresholdAbove3_Val; - A_UINT8 thresholdAbove4_Val; - A_UINT8 thresholdBelow1_Val; - A_UINT8 thresholdBelow2_Val; - A_UINT8 thresholdBelow3_Val; - A_UINT8 thresholdBelow4_Val; - A_UINT8 reserved[3]; -} POSTPACK WMI_LQ_THRESHOLD_PARAMS_CMD; - -typedef enum { - WMI_LPREAMBLE_DISABLED = 0, - WMI_LPREAMBLE_ENABLED -} WMI_LPREAMBLE_STATUS; - -typedef enum { - WMI_IGNORE_BARKER_IN_ERP = 0, - WMI_DONOT_IGNORE_BARKER_IN_ERP -} WMI_PREAMBLE_POLICY; - -typedef PREPACK struct { - A_UINT8 status; - A_UINT8 preamblePolicy; -}POSTPACK WMI_SET_LPREAMBLE_CMD; - -typedef PREPACK struct { - A_UINT16 threshold; -}POSTPACK WMI_SET_RTS_CMD; - -/* - * WMI_TARGET_ERROR_REPORT_BITMASK_CMDID - * Sets the error reporting event bitmask in target. Target clears it - * upon an error. Subsequent errors are counted, but not reported - * via event, unless the bitmask is set again. - */ -typedef PREPACK struct { - A_UINT32 bitmask; -} POSTPACK WMI_TARGET_ERROR_REPORT_BITMASK; - -/* - * WMI_SET_TX_PWR_CMDID - */ -typedef PREPACK struct { - A_UINT8 dbM; /* in dbM units */ -} POSTPACK WMI_SET_TX_PWR_CMD, WMI_TX_PWR_REPLY; - -/* - * WMI_SET_ASSOC_INFO_CMDID - * - * A maximum of 2 private IEs can be sent in the [Re]Assoc request. - * A 3rd one, the CCX version IE can also be set from the host. - */ -#define WMI_MAX_ASSOC_INFO_TYPE 2 -#define WMI_CCX_VER_IE 2 /* ieType to set CCX Version IE */ - -#define WMI_MAX_ASSOC_INFO_LEN 240 - -typedef PREPACK struct { - A_UINT8 ieType; - A_UINT8 bufferSize; - A_UINT8 assocInfo[1]; /* up to WMI_MAX_ASSOC_INFO_LEN */ -} POSTPACK WMI_SET_ASSOC_INFO_CMD; - - -/* - * WMI_GET_TX_PWR_CMDID does not take any parameters - */ - -/* - * WMI_ADD_BAD_AP_CMDID - */ -#define WMI_MAX_BAD_AP_INDEX 1 - -typedef PREPACK struct { - A_UINT8 badApIndex; /* 0 to WMI_MAX_BAD_AP_INDEX */ - A_UINT8 bssid[ATH_MAC_LEN]; -} POSTPACK WMI_ADD_BAD_AP_CMD; - -/* - * WMI_DELETE_BAD_AP_CMDID - */ -typedef PREPACK struct { - A_UINT8 badApIndex; /* 0 to WMI_MAX_BAD_AP_INDEX */ -} POSTPACK WMI_DELETE_BAD_AP_CMD; - -/* - * WMI_SET_ACCESS_PARAMS_CMDID - */ -#define WMI_DEFAULT_TXOP_ACPARAM 0 /* implies one MSDU */ -#define WMI_DEFAULT_ECWMIN_ACPARAM 4 /* corresponds to CWmin of 15 */ -#define WMI_DEFAULT_ECWMAX_ACPARAM 10 /* corresponds to CWmax of 1023 */ -#define WMI_MAX_CW_ACPARAM 15 /* maximum eCWmin or eCWmax */ -#define WMI_DEFAULT_AIFSN_ACPARAM 2 -#define WMI_MAX_AIFSN_ACPARAM 15 -typedef PREPACK struct { - A_UINT16 txop; /* in units of 32 usec */ - A_UINT8 eCWmin; - A_UINT8 eCWmax; - A_UINT8 aifsn; - A_UINT8 ac; -} POSTPACK WMI_SET_ACCESS_PARAMS_CMD; - - -/* - * WMI_SET_RETRY_LIMITS_CMDID - * - * This command is used to customize the number of retries the - * wlan device will perform on a given frame. - */ -#define WMI_MIN_RETRIES 2 -#define WMI_MAX_RETRIES 13 -typedef enum { - MGMT_FRAMETYPE = 0, - CONTROL_FRAMETYPE = 1, - DATA_FRAMETYPE = 2 -} WMI_FRAMETYPE; - -typedef PREPACK struct { - A_UINT8 frameType; /* WMI_FRAMETYPE */ - A_UINT8 trafficClass; /* applies only to DATA_FRAMETYPE */ - A_UINT8 maxRetries; - A_UINT8 enableNotify; -} POSTPACK WMI_SET_RETRY_LIMITS_CMD; - -/* - * WMI_SET_ROAM_CTRL_CMDID - * - * This command is used to influence the Roaming behaviour - * Set the host biases of the BSSs before setting the roam mode as bias - * based. - */ - -/* - * Different types of Roam Control - */ - -typedef enum { - WMI_FORCE_ROAM = 1, /* Roam to the specified BSSID */ - WMI_SET_ROAM_MODE = 2, /* default ,progd bias, no roam */ - WMI_SET_HOST_BIAS = 3, /* Set the Host Bias */ - WMI_SET_LOWRSSI_SCAN_PARAMS = 4, /* Set lowrssi Scan parameters */ -} WMI_ROAM_CTRL_TYPE; - -#define WMI_MIN_ROAM_CTRL_TYPE WMI_FORCE_ROAM -#define WMI_MAX_ROAM_CTRL_TYPE WMI_SET_LOWRSSI_SCAN_PARAMS - -/* - * ROAM MODES - */ - -typedef enum { - WMI_DEFAULT_ROAM_MODE = 1, /* RSSI based ROAM */ - WMI_HOST_BIAS_ROAM_MODE = 2, /* HOST BIAS based ROAM */ - WMI_LOCK_BSS_MODE = 3 /* Lock to the Current BSS - no Roam */ -} WMI_ROAM_MODE; - -/* - * BSS HOST BIAS INFO - */ - -typedef PREPACK struct { - A_UINT8 bssid[ATH_MAC_LEN]; - A_INT8 bias; -} POSTPACK WMI_BSS_BIAS; - -typedef PREPACK struct { - A_UINT8 numBss; - WMI_BSS_BIAS bssBias[1]; -} POSTPACK WMI_BSS_BIAS_INFO; - -typedef PREPACK struct WMI_LOWRSSI_SCAN_PARAMS { - A_UINT16 lowrssi_scan_period; - A_INT16 lowrssi_scan_threshold; - A_INT16 lowrssi_roam_threshold; - A_UINT8 roam_rssi_floor; - A_UINT8 reserved[1]; /* For alignment */ -} POSTPACK WMI_LOWRSSI_SCAN_PARAMS; - -typedef PREPACK struct { - PREPACK union { - A_UINT8 bssid[ATH_MAC_LEN]; /* WMI_FORCE_ROAM */ - A_UINT8 roamMode; /* WMI_SET_ROAM_MODE */ - WMI_BSS_BIAS_INFO bssBiasInfo; /* WMI_SET_HOST_BIAS */ - WMI_LOWRSSI_SCAN_PARAMS lrScanParams; - } POSTPACK info; - A_UINT8 roamCtrlType ; -} POSTPACK WMI_SET_ROAM_CTRL_CMD; - -/* - * WMI_SET_BT_WLAN_CONN_PRECEDENCE_CMDID - */ -typedef enum { - BT_WLAN_CONN_PRECDENCE_WLAN=0, /* Default */ - BT_WLAN_CONN_PRECDENCE_PAL, -} BT_WLAN_CONN_PRECEDENCE; - -typedef PREPACK struct { - A_UINT8 precedence; -} POSTPACK WMI_SET_BT_WLAN_CONN_PRECEDENCE; - -/* - * WMI_ENABLE_RM_CMDID - */ -typedef PREPACK struct { - A_BOOL enable_radio_measurements; -} POSTPACK WMI_ENABLE_RM_CMD; - -/* - * WMI_SET_MAX_OFFHOME_DURATION_CMDID - */ -typedef PREPACK struct { - A_UINT8 max_offhome_duration; -} POSTPACK WMI_SET_MAX_OFFHOME_DURATION_CMD; - -typedef PREPACK struct { - A_UINT32 frequency; - A_UINT8 threshold; -} POSTPACK WMI_SET_HB_CHALLENGE_RESP_PARAMS_CMD; - -typedef PREPACK struct { - A_UINT8 enable; -} POSTPACK WMI_SET_DFS_CMD; - - -typedef enum { - WMI_CCX_RM_STATUS_UNKNOWN = 0, - WMI_CCX_RM_REPORT_SENT, - WMI_CCX_RM_REFUSE_REPORT_SENT, - WMI_CCX_RM_STATUS_MAX -} WMI_CCX_RM_STATUS_TYPE; - -/*---------------------- BTCOEX RELATED -------------------------------------*/ -/*----------------------COMMON to AR6002 and AR6003 -------------------------*/ -typedef enum { - BT_STREAM_UNDEF = 0, - BT_STREAM_SCO, /* SCO stream */ - BT_STREAM_A2DP, /* A2DP stream */ - BT_STREAM_SCAN, /* BT Discovery or Page */ - BT_STREAM_ESCO, - BT_STREAM_MAX -} BT_STREAM_TYPE; - -typedef enum { - BT_PARAM_SCO_PSPOLL_LATENCY_ONE_FOURTH =1, - BT_PARAM_SCO_PSPOLL_LATENCY_HALF, - BT_PARAM_SCO_PSPOLL_LATENCY_THREE_FOURTH, -} BT_PARAMS_SCO_PSPOLL_LATENCY; - -typedef enum { - BT_PARAMS_SCO_STOMP_SCO_NEVER =1, - BT_PARAMS_SCO_STOMP_SCO_ALWAYS, - BT_PARAMS_SCO_STOMP_SCO_IN_LOWRSSI, -} BT_PARAMS_SCO_STOMP_RULES; - -typedef enum { - BT_STATUS_UNDEF = 0, - BT_STATUS_ON, - BT_STATUS_OFF, - BT_STATUS_MAX -} BT_STREAM_STATUS; - -typedef PREPACK struct { - A_UINT8 streamType; - A_UINT8 status; -} POSTPACK WMI_SET_BT_STATUS_CMD; - -typedef enum { - BT_ANT_TYPE_UNDEF=0, - BT_ANT_TYPE_DUAL, - BT_ANT_TYPE_SPLITTER, - BT_ANT_TYPE_SWITCH, - BT_ANT_TYPE_HIGH_ISO_DUAL -} BT_ANT_FRONTEND_CONFIG; - -typedef enum { - BT_COLOCATED_DEV_BTS4020=0, - BT_COLCATED_DEV_CSR , - BT_COLOCATED_DEV_VALKYRIE -} BT_COLOCATED_DEV_TYPE; - -/*********************** Applicable to AR6002 ONLY ******************************/ - -typedef enum { - BT_PARAM_SCO = 1, /* SCO stream parameters */ - BT_PARAM_A2DP , - BT_PARAM_ANTENNA_CONFIG, - BT_PARAM_COLOCATED_BT_DEVICE, - BT_PARAM_ACLCOEX, - BT_PARAM_11A_SEPARATE_ANT, - BT_PARAM_MAX -} BT_PARAM_TYPE; - - -#define BT_SCO_ALLOW_CLOSE_RANGE_OPT (1 << 0) -#define BT_SCO_FORCE_AWAKE_OPT (1 << 1) -#define BT_SCO_SET_RSSI_OVERRIDE(flags) ((flags) |= (1 << 2)) -#define BT_SCO_GET_RSSI_OVERRIDE(flags) (((flags) >> 2) & 0x1) -#define BT_SCO_SET_RTS_OVERRIDE(flags) ((flags) |= (1 << 3)) -#define BT_SCO_GET_RTS_OVERRIDE(flags) (((flags) >> 3) & 0x1) -#define BT_SCO_GET_MIN_LOW_RATE_CNT(flags) (((flags) >> 8) & 0xFF) -#define BT_SCO_GET_MAX_LOW_RATE_CNT(flags) (((flags) >> 16) & 0xFF) -#define BT_SCO_SET_MIN_LOW_RATE_CNT(flags,val) (flags) |= (((val) & 0xFF) << 8) -#define BT_SCO_SET_MAX_LOW_RATE_CNT(flags,val) (flags) |= (((val) & 0xFF) << 16) - -typedef PREPACK struct { - A_UINT32 numScoCyclesForceTrigger; /* Number SCO cycles after which - force a pspoll. default = 10 */ - A_UINT32 dataResponseTimeout; /* Timeout Waiting for Downlink pkt - in response for ps-poll, - default = 10 msecs */ - A_UINT32 stompScoRules; - A_UINT32 scoOptFlags; /* SCO Options Flags : - bits: meaning: - 0 Allow Close Range Optimization - 1 Force awake during close range - 2 If set use host supplied RSSI for OPT - 3 If set use host supplied RTS COUNT for OPT - 4..7 Unused - 8..15 Low Data Rate Min Cnt - 16..23 Low Data Rate Max Cnt - */ - - A_UINT8 stompDutyCyleVal; /* Sco cycles to limit ps-poll queuing - if stomped */ - A_UINT8 stompDutyCyleMaxVal; /*firm ware increases stomp duty cycle - gradually uptill this value on need basis*/ - A_UINT8 psPollLatencyFraction; /* Fraction of idle - period, within which - additional ps-polls - can be queued */ - A_UINT8 noSCOSlots; /* Number of SCO Tx/Rx slots. - HVx, EV3, 2EV3 = 2 */ - A_UINT8 noIdleSlots; /* Number of Bluetooth idle slots between - consecutive SCO Tx/Rx slots - HVx, EV3 = 4 - 2EV3 = 10 */ - A_UINT8 scoOptOffRssi;/*RSSI value below which we go to ps poll*/ - A_UINT8 scoOptOnRssi; /*RSSI value above which we reenter opt mode*/ - A_UINT8 scoOptRtsCount; -} POSTPACK BT_PARAMS_SCO; - -#define BT_A2DP_ALLOW_CLOSE_RANGE_OPT (1 << 0) -#define BT_A2DP_FORCE_AWAKE_OPT (1 << 1) -#define BT_A2DP_SET_RSSI_OVERRIDE(flags) ((flags) |= (1 << 2)) -#define BT_A2DP_GET_RSSI_OVERRIDE(flags) (((flags) >> 2) & 0x1) -#define BT_A2DP_SET_RTS_OVERRIDE(flags) ((flags) |= (1 << 3)) -#define BT_A2DP_GET_RTS_OVERRIDE(flags) (((flags) >> 3) & 0x1) -#define BT_A2DP_GET_MIN_LOW_RATE_CNT(flags) (((flags) >> 8) & 0xFF) -#define BT_A2DP_GET_MAX_LOW_RATE_CNT(flags) (((flags) >> 16) & 0xFF) -#define BT_A2DP_SET_MIN_LOW_RATE_CNT(flags,val) (flags) |= (((val) & 0xFF) << 8) -#define BT_A2DP_SET_MAX_LOW_RATE_CNT(flags,val) (flags) |= (((val) & 0xFF) << 16) - -typedef PREPACK struct { - A_UINT32 a2dpWlanUsageLimit; /* MAX time firmware uses the medium for - wlan, after it identifies the idle time - default (30 msecs) */ - A_UINT32 a2dpBurstCntMin; /* Minimum number of bluetooth data frames - to replenish Wlan Usage limit (default 3) */ - A_UINT32 a2dpDataRespTimeout; - A_UINT32 a2dpOptFlags; /* A2DP Option flags: - bits: meaning: - 0 Allow Close Range Optimization - 1 Force awake during close range - 2 If set use host supplied RSSI for OPT - 3 If set use host supplied RTS COUNT for OPT - 4..7 Unused - 8..15 Low Data Rate Min Cnt - 16..23 Low Data Rate Max Cnt - */ - A_UINT8 isCoLocatedBtRoleMaster; - A_UINT8 a2dpOptOffRssi;/*RSSI value below which we go to ps poll*/ - A_UINT8 a2dpOptOnRssi; /*RSSI value above which we reenter opt mode*/ - A_UINT8 a2dpOptRtsCount; -}POSTPACK BT_PARAMS_A2DP; - -/* During BT ftp/ BT OPP or any another data based acl profile on bluetooth - (non a2dp).*/ -typedef PREPACK struct { - A_UINT32 aclWlanMediumUsageTime; /* Wlan usage time during Acl (non-a2dp) - coexistence (default 30 msecs) */ - A_UINT32 aclBtMediumUsageTime; /* Bt usage time during acl coexistence - (default 30 msecs)*/ - A_UINT32 aclDataRespTimeout; - A_UINT32 aclDetectTimeout; /* ACL coexistence enabled if we get - 10 Pkts in X msec(default 100 msecs) */ - A_UINT32 aclmaxPktCnt; /* No of ACL pkts to receive before - enabling ACL coex */ - -}POSTPACK BT_PARAMS_ACLCOEX; - -typedef PREPACK struct { - PREPACK union { - BT_PARAMS_SCO scoParams; - BT_PARAMS_A2DP a2dpParams; - BT_PARAMS_ACLCOEX aclCoexParams; - A_UINT8 antType; /* 0 -Disabled (default) - 1 - BT_ANT_TYPE_DUAL - 2 - BT_ANT_TYPE_SPLITTER - 3 - BT_ANT_TYPE_SWITCH */ - A_UINT8 coLocatedBtDev; /* 0 - BT_COLOCATED_DEV_BTS4020 (default) - 1 - BT_COLCATED_DEV_CSR - 2 - BT_COLOCATED_DEV_VALKYRIe - */ - } POSTPACK info; - A_UINT8 paramType ; -} POSTPACK WMI_SET_BT_PARAMS_CMD; - -/************************ END AR6002 BTCOEX *******************************/ -/*-----------------------AR6003 BTCOEX -----------------------------------*/ - -/* ---------------WMI_SET_BTCOEX_FE_ANT_CMDID --------------------------*/ -/* Indicates front end antenna configuration. This command needs to be issued - * right after initialization and after WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID. - * AR6003 enables coexistence and antenna switching based on the configuration. - */ -typedef enum { - WMI_BTCOEX_NOT_ENABLED = 0, - WMI_BTCOEX_FE_ANT_SINGLE =1, - WMI_BTCOEX_FE_ANT_DUAL=2, - WMI_BTCOEX_FE_ANT_DUAL_HIGH_ISO=3, - WMI_BTCOEX_FE_ANT_BYPASS_MODE=4, - WMI_BTCOEX_FE_ANT_COMBINE_MODE=5, - WMI_BTCOEX_FE_ANT_TYPE_MAX -}WMI_BTCOEX_FE_ANT_TYPE; - -typedef PREPACK struct { - A_UINT8 btcoexFeAntType; /* 1 - WMI_BTCOEX_FE_ANT_SINGLE for single antenna front end - 2 - WMI_BTCOEX_FE_ANT_DUAL for dual antenna front end - (for isolations less 35dB, for higher isolation there - is not need to pass this command). - (not implemented) - */ -}POSTPACK WMI_SET_BTCOEX_FE_ANT_CMD; - -/* -------------WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID ----------------*/ -/* Indicate the bluetooth chip to the firmware. Firmware can have different algorithm based - * bluetooth chip type.Based on bluetooth device, different coexistence protocol would be used. - */ -typedef PREPACK struct { - A_UINT8 btcoexCoLocatedBTdev; /*1 - Qcom BT (3 -wire PTA) - 2 - CSR BT (3 wire PTA) - 3 - Atheros 3001 BT (3 wire PTA) - 4 - STE bluetooth (4-wire ePTA) - 5 - Atheros 3002 BT (4-wire MCI) - defaults= 3 (Atheros 3001 BT ) - */ -}POSTPACK WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD; - -/* -------------WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMDID ------------*/ -/* Configuration parameters during bluetooth inquiry and page. Page configuration - * is applicable only on interfaces which can distinguish page (applicable only for ePTA - - * STE bluetooth). - * Bluetooth inquiry start and end is indicated via WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID. - * During this the station will be power-save mode. - */ -typedef PREPACK struct { - A_UINT32 btInquiryDataFetchFrequency;/* The frequency of querying the AP for data - (via pspoll) is configured by this parameter. - "default = 10 ms" */ - - A_UINT32 protectBmissDurPostBtInquiry;/* The firmware will continue to be in inquiry state - for configured duration, after inquiry completion - . This is to ensure other bluetooth transactions - (RDP, SDP profiles, link key exchange ...etc) - goes through smoothly without wifi stomping. - default = 10 secs*/ - - A_UINT32 maxpageStomp; /*Applicable only for STE-BT interface. Currently not - used */ - A_UINT32 btInquiryPageFlag; /* Not used */ -}POSTPACK WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMD; - -/*---------------------WMI_SET_BTCOEX_SCO_CONFIG_CMDID ---------------*/ -/* Configure SCO parameters. These parameters would be used whenever firmware is indicated - * of (e)SCO profile on bluetooth ( via WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID). - * Configration of BTCOEX_SCO_CONFIG data structure are common configuration and applies - * ps-poll mode and opt mode. - * Ps-poll Mode - Station is in power-save and retrieves downlink data between sco gaps. - * Opt Mode - station is in awake state and access point can send data to station any time. - * BTCOEX_PSPOLLMODE_SCO_CONFIG - Configuration applied only during ps-poll mode. - * BTCOEX_OPTMODE_SCO_CONFIG - Configuration applied only during opt mode. - */ -#define WMI_SCO_CONFIG_FLAG_ALLOW_OPTIMIZATION (1 << 0) -#define WMI_SCO_CONFIG_FLAG_IS_EDR_CAPABLE (1 << 1) -#define WMI_SCO_CONFIG_FLAG_IS_BT_MASTER (1 << 2) -#define WMI_SCO_CONFIG_FLAG_FW_DETECT_OF_PER (1 << 3) -typedef PREPACK struct { - A_UINT32 scoSlots; /* Number of SCO Tx/Rx slots. - HVx, EV3, 2EV3 = 2 */ - A_UINT32 scoIdleSlots; /* Number of Bluetooth idle slots between - consecutive SCO Tx/Rx slots - HVx, EV3 = 4 - 2EV3 = 10 - */ - A_UINT32 scoFlags; /* SCO Options Flags : - bits: meaning: - 0 Allow Close Range Optimization - 1 Is EDR capable or Not - 2 IS Co-located Bt role Master - 3 Firmware determines the periodicity of SCO. - */ - - A_UINT32 linkId; /* applicable to STE-BT - not used */ -}POSTPACK BTCOEX_SCO_CONFIG; - -typedef PREPACK struct { - A_UINT32 scoCyclesForceTrigger; /* Number SCO cycles after which - force a pspoll. default = 10 */ - A_UINT32 scoDataResponseTimeout; /* Timeout Waiting for Downlink pkt - in response for ps-poll, - default = 20 msecs */ - - A_UINT32 scoStompDutyCyleVal; /* not implemented */ - - A_UINT32 scoStompDutyCyleMaxVal; /*Not implemented */ - - A_UINT32 scoPsPollLatencyFraction; /* Fraction of idle - period, within which - additional ps-polls can be queued - 1 - 1/4 of idle duration - 2 - 1/2 of idle duration - 3 - 3/4 of idle duration - default =2 (1/2) - */ -}POSTPACK BTCOEX_PSPOLLMODE_SCO_CONFIG; - -typedef PREPACK struct { - A_UINT32 scoStompCntIn100ms;/*max number of SCO stomp in 100ms allowed in - opt mode. If exceeds the configured value, - switch to ps-poll mode - default = 3 */ - - A_UINT32 scoContStompMax; /* max number of continous stomp allowed in opt mode. - if excedded switch to pspoll mode - default = 3 */ - - A_UINT32 scoMinlowRateMbps; /* Low rate threshold */ - - A_UINT32 scoLowRateCnt; /* number of low rate pkts (< scoMinlowRateMbps) allowed in 100 ms. - If exceeded switch/stay to ps-poll mode, lower stay in opt mode. - default = 36 - */ - - A_UINT32 scoHighPktRatio; /*(Total Rx pkts in 100 ms + 1)/ - ((Total tx pkts in 100 ms - No of high rate pkts in 100 ms) + 1) in 100 ms, - if exceeded switch/stay in opt mode and if lower switch/stay in pspoll mode. - default = 5 (80% of high rates) - */ - - A_UINT32 scoMaxAggrSize; /* Max number of Rx subframes allowed in this mode. (Firmware re-negogiates - max number of aggregates if it was negogiated to higher value - default = 1 - Recommended value Basic rate headsets = 1, EDR (2-EV3) =4. - */ -}POSTPACK BTCOEX_OPTMODE_SCO_CONFIG; - -typedef PREPACK struct { - A_UINT32 scanInterval; - A_UINT32 maxScanStompCnt; -}POSTPACK BTCOEX_WLANSCAN_SCO_CONFIG; - -typedef PREPACK struct { - BTCOEX_SCO_CONFIG scoConfig; - BTCOEX_PSPOLLMODE_SCO_CONFIG scoPspollConfig; - BTCOEX_OPTMODE_SCO_CONFIG scoOptModeConfig; - BTCOEX_WLANSCAN_SCO_CONFIG scoWlanScanConfig; -}POSTPACK WMI_SET_BTCOEX_SCO_CONFIG_CMD; - -/* ------------------WMI_SET_BTCOEX_A2DP_CONFIG_CMDID -------------------*/ -/* Configure A2DP profile parameters. These parameters would be used whenver firmware is indicated - * of A2DP profile on bluetooth ( via WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID). - * Configuration of BTCOEX_A2DP_CONFIG data structure are common configuration and applies to - * ps-poll mode and opt mode. - * Ps-poll Mode - Station is in power-save and retrieves downlink data between a2dp data bursts. - * Opt Mode - station is in power save during a2dp bursts and awake in the gaps. - * BTCOEX_PSPOLLMODE_A2DP_CONFIG - Configuration applied only during ps-poll mode. - * BTCOEX_OPTMODE_A2DP_CONFIG - Configuration applied only during opt mode. - */ - -#define WMI_A2DP_CONFIG_FLAG_ALLOW_OPTIMIZATION (1 << 0) -#define WMI_A2DP_CONFIG_FLAG_IS_EDR_CAPABLE (1 << 1) -#define WMI_A2DP_CONFIG_FLAG_IS_BT_ROLE_MASTER (1 << 2) -#define WMI_A2DP_CONFIG_FLAG_IS_A2DP_HIGH_PRI (1 << 3) -#define WMI_A2DP_CONFIG_FLAG_FIND_BT_ROLE (1 << 4) - -typedef PREPACK struct { - A_UINT32 a2dpFlags; /* A2DP Option flags: - bits: meaning: - 0 Allow Close Range Optimization - 1 IS EDR capable - 2 IS Co-located Bt role Master - 3 a2dp traffic is high priority - 4 Fw detect the role of bluetooth. - */ - A_UINT32 linkId; /* Applicable only to STE-BT - not used */ - -}POSTPACK BTCOEX_A2DP_CONFIG; - -typedef PREPACK struct { - A_UINT32 a2dpWlanMaxDur; /* MAX time firmware uses the medium for - wlan, after it identifies the idle time - default (30 msecs) */ - - A_UINT32 a2dpMinBurstCnt; /* Minimum number of bluetooth data frames - to replenish Wlan Usage limit (default 3) */ - - A_UINT32 a2dpDataRespTimeout; /* Max duration firmware waits for downlink - by stomping on bluetooth - after ps-poll is acknowledged. - default = 20 ms - */ -}POSTPACK BTCOEX_PSPOLLMODE_A2DP_CONFIG; - -typedef PREPACK struct { - A_UINT32 a2dpMinlowRateMbps; /* Low rate threshold */ - - A_UINT32 a2dpLowRateCnt; /* number of low rate pkts (< a2dpMinlowRateMbps) allowed in 100 ms. - If exceeded switch/stay to ps-poll mode, lower stay in opt mode. - default = 36 - */ - - A_UINT32 a2dpHighPktRatio; /*(Total Rx pkts in 100 ms + 1)/ - ((Total tx pkts in 100 ms - No of high rate pkts in 100 ms) + 1) in 100 ms, - if exceeded switch/stay in opt mode and if lower switch/stay in pspoll mode. - default = 5 (80% of high rates) - */ - - A_UINT32 a2dpMaxAggrSize; /* Max number of Rx subframes allowed in this mode. (Firmware re-negogiates - max number of aggregates if it was negogiated to higher value - default = 1 - Recommended value Basic rate headsets = 1, EDR (2-EV3) =8. - */ - A_UINT32 a2dpPktStompCnt; /*number of a2dp pkts that can be stomped per burst. - default = 6*/ - -}POSTPACK BTCOEX_OPTMODE_A2DP_CONFIG; - -typedef PREPACK struct { - BTCOEX_A2DP_CONFIG a2dpConfig; - BTCOEX_PSPOLLMODE_A2DP_CONFIG a2dppspollConfig; - BTCOEX_OPTMODE_A2DP_CONFIG a2dpOptConfig; -}POSTPACK WMI_SET_BTCOEX_A2DP_CONFIG_CMD; - -/*------------ WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMDID---------------------*/ -/* Configure non-A2dp ACL profile parameters.The starts of ACL profile can either be - * indicated via WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID orenabled via firmware detection - * which is configured via "aclCoexFlags". - * Configration of BTCOEX_ACLCOEX_CONFIG data structure are common configuration and applies - * ps-poll mode and opt mode. - * Ps-poll Mode - Station is in power-save and retrieves downlink data during wlan medium. - * Opt Mode - station is in power save during bluetooth medium time and awake during wlan duration. - * (Not implemented yet) - * - * BTCOEX_PSPOLLMODE_ACLCOEX_CONFIG - Configuration applied only during ps-poll mode. - * BTCOEX_OPTMODE_ACLCOEX_CONFIG - Configuration applied only during opt mode. - */ - -#define WMI_ACLCOEX_FLAGS_ALLOW_OPTIMIZATION (1 << 0) -#define WMI_ACLCOEX_FLAGS_DISABLE_FW_DETECTION (1 << 1) - -typedef PREPACK struct { - A_UINT32 aclWlanMediumDur; /* Wlan usage time during Acl (non-a2dp) - coexistence (default 30 msecs) - */ - - A_UINT32 aclBtMediumDur; /* Bt usage time during acl coexistence - (default 30 msecs) - */ - - A_UINT32 aclDetectTimeout; /* BT activity observation time limit. - In this time duration, number of bt pkts are counted. - If the Cnt reaches "aclPktCntLowerLimit" value - for "aclIterToEnableCoex" iteration continuously, - firmware gets into ACL coexistence mode. - Similarly, if bt traffic count during ACL coexistence - has not reached "aclPktCntLowerLimit" continuously - for "aclIterToEnableCoex", then ACL coexistence is - disabled. - -default 100 msecs - */ - - A_UINT32 aclPktCntLowerLimit; /* Acl Pkt Cnt to be received in duration of - "aclDetectTimeout" for - "aclIterForEnDis" times to enabling ACL coex. - Similar logic is used to disable acl coexistence. - (If "aclPktCntLowerLimit" cnt of acl pkts - are not seen by the for "aclIterForEnDis" - then acl coexistence is disabled). - default = 10 - */ - - A_UINT32 aclIterForEnDis; /* number of Iteration of "aclPktCntLowerLimit" for Enabling and - Disabling Acl Coexistence. - default = 3 - */ - - A_UINT32 aclPktCntUpperLimit; /* This is upperBound limit, if there is more than - "aclPktCntUpperLimit" seen in "aclDetectTimeout", - ACL coexistence is enabled right away. - - default 15*/ - - A_UINT32 aclCoexFlags; /* A2DP Option flags: - bits: meaning: - 0 Allow Close Range Optimization - 1 disable Firmware detection - (Currently supported configuration is aclCoexFlags =0) - */ - - A_UINT32 linkId; /* Applicable only for STE-BT - not used */ - -}POSTPACK BTCOEX_ACLCOEX_CONFIG; - -typedef PREPACK struct { - A_UINT32 aclDataRespTimeout; /* Max duration firmware waits for downlink - by stomping on bluetooth - after ps-poll is acknowledged. - default = 20 ms */ - -}POSTPACK BTCOEX_PSPOLLMODE_ACLCOEX_CONFIG; - - -/* Not implemented yet*/ -typedef PREPACK struct { - A_UINT32 aclCoexMinlowRateMbps; - A_UINT32 aclCoexLowRateCnt; - A_UINT32 aclCoexHighPktRatio; - A_UINT32 aclCoexMaxAggrSize; - A_UINT32 aclPktStompCnt; -}POSTPACK BTCOEX_OPTMODE_ACLCOEX_CONFIG; - -typedef PREPACK struct { - BTCOEX_ACLCOEX_CONFIG aclCoexConfig; - BTCOEX_PSPOLLMODE_ACLCOEX_CONFIG aclCoexPspollConfig; - BTCOEX_OPTMODE_ACLCOEX_CONFIG aclCoexOptConfig; -}POSTPACK WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD; - -/* -----------WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID ------------------*/ -typedef enum { - WMI_BTCOEX_BT_PROFILE_SCO =1, - WMI_BTCOEX_BT_PROFILE_A2DP, - WMI_BTCOEX_BT_PROFILE_INQUIRY_PAGE, - WMI_BTCOEX_BT_PROFILE_ACLCOEX, -}WMI_BTCOEX_BT_PROFILE; - -typedef PREPACK struct { - A_UINT32 btProfileType; - A_UINT32 btOperatingStatus; - A_UINT32 btLinkId; -}WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMD; - -/*--------------------- WMI_SET_BTCOEX_DEBUG_CMDID ---------------------*/ -/* Used for firmware development and debugging */ -typedef PREPACK struct { - A_UINT32 btcoexDbgParam1; - A_UINT32 btcoexDbgParam2; - A_UINT32 btcoexDbgParam3; - A_UINT32 btcoexDbgParam4; - A_UINT32 btcoexDbgParam5; -}WMI_SET_BTCOEX_DEBUG_CMD; - -/*---------------------WMI_GET_BTCOEX_CONFIG_CMDID --------------------- */ -/* Command to firmware to get configuration parameters of the bt profile - * reported via WMI_BTCOEX_CONFIG_EVENTID */ -typedef PREPACK struct { - A_UINT32 btProfileType; /* 1 - SCO - 2 - A2DP - 3 - INQUIRY_PAGE - 4 - ACLCOEX - */ - A_UINT32 linkId; /* not used */ -}WMI_GET_BTCOEX_CONFIG_CMD; - -/*------------------WMI_REPORT_BTCOEX_CONFIG_EVENTID------------------- */ -/* Event from firmware to host, sent in response to WMI_GET_BTCOEX_CONFIG_CMDID - * */ -typedef PREPACK struct { - A_UINT32 btProfileType; - A_UINT32 linkId; /* not used */ - PREPACK union { - WMI_SET_BTCOEX_SCO_CONFIG_CMD scoConfigCmd; - WMI_SET_BTCOEX_A2DP_CONFIG_CMD a2dpConfigCmd; - WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD aclcoexConfig; - WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMD btinquiryPageConfigCmd; - } POSTPACK info; -} POSTPACK WMI_BTCOEX_CONFIG_EVENT; - -/*------------- WMI_REPORT_BTCOEX_BTCOEX_STATS_EVENTID--------------------*/ -/* Used for firmware development and debugging*/ -typedef PREPACK struct { - A_UINT32 highRatePktCnt; - A_UINT32 firstBmissCnt; - A_UINT32 psPollFailureCnt; - A_UINT32 nullFrameFailureCnt; - A_UINT32 optModeTransitionCnt; -}BTCOEX_GENERAL_STATS; - -typedef PREPACK struct { - A_UINT32 scoStompCntAvg; - A_UINT32 scoStompIn100ms; - A_UINT32 scoMaxContStomp; - A_UINT32 scoAvgNoRetries; - A_UINT32 scoMaxNoRetriesIn100ms; -}BTCOEX_SCO_STATS; - -typedef PREPACK struct { - A_UINT32 a2dpBurstCnt; - A_UINT32 a2dpMaxBurstCnt; - A_UINT32 a2dpAvgIdletimeIn100ms; - A_UINT32 a2dpAvgStompCnt; -}BTCOEX_A2DP_STATS; - -typedef PREPACK struct { - A_UINT32 aclPktCntInBtTime; - A_UINT32 aclStompCntInWlanTime; - A_UINT32 aclPktCntIn100ms; -}BTCOEX_ACLCOEX_STATS; - -typedef PREPACK struct { - BTCOEX_GENERAL_STATS coexStats; - BTCOEX_SCO_STATS scoStats; - BTCOEX_A2DP_STATS a2dpStats; - BTCOEX_ACLCOEX_STATS aclCoexStats; -}WMI_BTCOEX_STATS_EVENT; - - -/*--------------------------END OF BTCOEX -------------------------------------*/ - -/* WAC commands - */ - - -typedef PREPACK struct { - A_UINT32 period; - A_UINT32 threshold; - A_INT32 rssi; - A_BOOL enable; - A_CHAR wps_pin[8]; -}WMI_WAC_ENABLE_CMD; - -typedef enum { - WAC_MORE_SCAN = -1, - WAC_SEND_PROBE_IDX = 0, -}WAC_SUBCMD; - -typedef PREPACK struct { - WAC_SUBCMD cmdid; -}WMI_WAC_SCAN_REPLY_CMD; - -typedef PREPACK struct { - A_UINT8 req; - A_UINT8 cmd; - A_UINT8 frame; - A_UINT8 ie[17]; - A_INT32 status; -}WMI_WAC_CTRL_REQ_CMD; - -/* END OF WAC */ - -typedef PREPACK struct { - A_UINT32 sleepState; -}WMI_REPORT_SLEEP_STATE_EVENT; - -typedef enum { - WMI_REPORT_SLEEP_STATUS_IS_DEEP_SLEEP =0, - WMI_REPORT_SLEEP_STATUS_IS_AWAKE -} WMI_REPORT_SLEEP_STATUS; -typedef enum { - DISCONN_EVT_IN_RECONN = 0, /* default */ - NO_DISCONN_EVT_IN_RECONN -} TARGET_EVENT_REPORT_CONFIG; - -typedef PREPACK struct { - A_UINT32 evtConfig; -} POSTPACK WMI_SET_TARGET_EVENT_REPORT_CMD; - - -typedef PREPACK struct { - A_UINT16 cmd_buf_sz; /* HCI cmd buffer size */ - A_UINT8 buf[1]; /* Absolute HCI cmd */ -} POSTPACK WMI_HCI_CMD; - -/* - * Command Replies - */ - -/* - * WMI_GET_CHANNEL_LIST_CMDID reply - */ -typedef PREPACK struct { - A_UINT8 reserved1; - A_UINT8 numChannels; /* number of channels in reply */ - A_UINT16 channelList[1]; /* channel in Mhz */ -} POSTPACK WMI_CHANNEL_LIST_REPLY; - -typedef enum { - A_SUCCEEDED = A_OK, - A_FAILED_DELETE_STREAM_DOESNOT_EXIST=250, - A_SUCCEEDED_MODIFY_STREAM=251, - A_FAILED_INVALID_STREAM = 252, - A_FAILED_MAX_THINSTREAMS = 253, - A_FAILED_CREATE_REMOVE_PSTREAM_FIRST = 254, -} PSTREAM_REPLY_STATUS; - -typedef PREPACK struct { - A_UINT8 status; /* PSTREAM_REPLY_STATUS */ - A_UINT8 txQueueNumber; - A_UINT8 rxQueueNumber; - A_UINT8 trafficClass; - A_UINT8 trafficDirection; /* DIR_TYPE */ -} POSTPACK WMI_CRE_PRIORITY_STREAM_REPLY; - -typedef PREPACK struct { - A_UINT8 status; /* PSTREAM_REPLY_STATUS */ - A_UINT8 txQueueNumber; - A_UINT8 rxQueueNumber; - A_UINT8 trafficDirection; /* DIR_TYPE */ - A_UINT8 trafficClass; -} POSTPACK WMI_DEL_PRIORITY_STREAM_REPLY; - -/* - * List of Events (target to host) - */ -typedef enum { - WMI_READY_EVENTID = 0x1001, - WMI_CONNECT_EVENTID, - WMI_DISCONNECT_EVENTID, - WMI_BSSINFO_EVENTID, - WMI_CMDERROR_EVENTID, - WMI_REGDOMAIN_EVENTID, - WMI_PSTREAM_TIMEOUT_EVENTID, - WMI_NEIGHBOR_REPORT_EVENTID, - WMI_TKIP_MICERR_EVENTID, - WMI_SCAN_COMPLETE_EVENTID, /* 0x100a */ - WMI_REPORT_STATISTICS_EVENTID, - WMI_RSSI_THRESHOLD_EVENTID, - WMI_ERROR_REPORT_EVENTID, - WMI_OPT_RX_FRAME_EVENTID, - WMI_REPORT_ROAM_TBL_EVENTID, - WMI_EXTENSION_EVENTID, - WMI_CAC_EVENTID, - WMI_SNR_THRESHOLD_EVENTID, - WMI_LQ_THRESHOLD_EVENTID, - WMI_TX_RETRY_ERR_EVENTID, /* 0x1014 */ - WMI_REPORT_ROAM_DATA_EVENTID, - WMI_TEST_EVENTID, - WMI_APLIST_EVENTID, - WMI_GET_WOW_LIST_EVENTID, - WMI_GET_PMKID_LIST_EVENTID, - WMI_CHANNEL_CHANGE_EVENTID, - WMI_PEER_NODE_EVENTID, - WMI_PSPOLL_EVENTID, - WMI_DTIMEXPIRY_EVENTID, - WMI_WLAN_VERSION_EVENTID, - WMI_SET_PARAMS_REPLY_EVENTID, - WMI_ADDBA_REQ_EVENTID, /*0x1020 */ - WMI_ADDBA_RESP_EVENTID, - WMI_DELBA_REQ_EVENTID, - WMI_TX_COMPLETE_EVENTID, - WMI_HCI_EVENT_EVENTID, - WMI_ACL_DATA_EVENTID, - WMI_REPORT_SLEEP_STATE_EVENTID, - - WMI_WAPI_REKEY_EVENTID, - - WMI_REPORT_BTCOEX_STATS_EVENTID, - WMI_REPORT_BTCOEX_CONFIG_EVENTID, - WMI_GET_PMK_EVENTID, - - /* DFS Events */ - WMI_DFS_HOST_ATTACH_EVENTID, - WMI_DFS_HOST_INIT_EVENTID, - WMI_DFS_RESET_DELAYLINES_EVENTID, - WMI_DFS_RESET_RADARQ_EVENTID, - WMI_DFS_RESET_AR_EVENTID, - WMI_DFS_RESET_ARQ_EVENTID, /*0x1030*/ - WMI_DFS_SET_DUR_MULTIPLIER_EVENTID, - WMI_DFS_SET_BANGRADAR_EVENTID, - WMI_DFS_SET_DEBUGLEVEL_EVENTID, - WMI_DFS_PHYERR_EVENTID, - /* CCX Evants */ - WMI_CCX_RM_STATUS_EVENTID, - - /* P2P Events */ - WMI_P2P_GO_NEG_RESULT_EVENTID, - - WMI_WAC_SCAN_DONE_EVENTID, - WMI_WAC_REPORT_BSS_EVENTID, - WMI_WAC_START_WPS_EVENTID, - WMI_WAC_CTRL_REQ_REPLY_EVENTID, - - /*RFKILL Events*/ - WMI_RFKILL_STATE_CHANGE_EVENTID, - WMI_RFKILL_GET_MODE_CMD_EVENTID, - - /* More P2P Events */ - WMI_P2P_GO_NEG_REQ_EVENTID, - WMI_P2P_INVITE_REQ_EVENTID, - WMI_P2P_INVITE_RCVD_RESULT_EVENTID, - WMI_P2P_INVITE_SENT_RESULT_EVENTID, /*1040*/ - WMI_P2P_PROV_DISC_RESP_EVENTID, - WMI_P2P_PROV_DISC_REQ_EVENTID, - WMI_P2P_START_SDPD_EVENTID, - WMI_P2P_SDPD_RX_EVENTID, - - WMI_THIN_RESERVED_START_EVENTID = 0x8000, - /* Events in this range are reserved for thinmode - * See wmi_thin.h for actual definitions */ - WMI_THIN_RESERVED_END_EVENTID = 0x8fff, - - WMI_SET_CHANNEL_EVENTID, - WMI_ASSOC_REQ_EVENTID, - - - /* generic ACS event */ - WMI_ACS_EVENTID, - WMI_REPORT_WMM_PARAMS_EVENTID, - WMI_STORERECALL_STORE_EVENTID, - -} WMI_EVENT_ID; - -typedef enum { - WMI_11A_CAPABILITY = 1, - WMI_11G_CAPABILITY = 2, - WMI_11AG_CAPABILITY = 3, - WMI_11NA_CAPABILITY = 4, - WMI_11NG_CAPABILITY = 5, - WMI_11NAG_CAPABILITY = 6, - // END CAPABILITY - WMI_11N_CAPABILITY_OFFSET = (WMI_11NA_CAPABILITY - WMI_11A_CAPABILITY), -} WMI_PHY_CAPABILITY; - -typedef PREPACK struct { - A_UINT8 macaddr[ATH_MAC_LEN]; - A_UINT8 phyCapability; /* WMI_PHY_CAPABILITY */ -} POSTPACK WMI_READY_EVENT_1; - -typedef PREPACK struct { - A_UINT32 sw_version; - A_UINT32 abi_version; - A_UINT8 macaddr[ATH_MAC_LEN]; - A_UINT8 phyCapability; /* WMI_PHY_CAPABILITY */ -} POSTPACK WMI_READY_EVENT_2; - -#if defined(ATH_TARGET) -#ifdef AR6002_REV2 -#define WMI_READY_EVENT WMI_READY_EVENT_1 /* AR6002_REV2 target code */ -#else -#define WMI_READY_EVENT WMI_READY_EVENT_2 /* AR6001, AR6002_REV4, AR6002_REV6 */ -#endif -#else -#define WMI_READY_EVENT WMI_READY_EVENT_2 /* host code */ -#endif - - -/* - * Connect Event - */ -typedef PREPACK struct { - PREPACK union { - struct { - A_UINT16 channel; - A_UINT8 bssid[ATH_MAC_LEN]; - A_UINT16 listenInterval; - A_UINT16 beaconInterval; - A_UINT32 networkType; - } infra_ibss_bss; - struct { - A_UINT8 phymode; - A_UINT8 aid; - A_UINT8 mac_addr[ATH_MAC_LEN]; - A_UINT8 auth; - A_UINT8 keymgmt; - A_UINT16 cipher; - A_UINT8 apsd_info; - A_UINT8 unused[3]; - } ap_sta; - struct { - A_UINT16 channel; - A_UINT8 bssid[ATH_MAC_LEN]; - A_UINT8 unused[8]; - } ap_bss; - } POSTPACK u; - A_UINT8 beaconIeLen; - A_UINT8 assocReqLen; - A_UINT8 assocRespLen; - A_UINT8 assocInfo[1]; -} POSTPACK WMI_CONNECT_EVENT; - - -typedef struct { - A_UINT8 status; - A_UINT8 rspType; -} WMI_ASSOCREQ_EVENT; - -typedef PREPACK struct { - A_UINT8 host_accept; - A_UINT8 host_reasonCode; - A_UINT8 target_status; - A_UINT8 sta_mac_addr[ATH_MAC_LEN]; - A_UINT8 rspType; -} POSTPACK WMI_SEND_ASSOCRES_CMD; - -typedef struct { - A_UINT8 enable; -} WMI_SET_ASSOCREQ_RELAY; - -/* - * Disconnect Event - */ -typedef enum { - NO_NETWORK_AVAIL = 0x01, - LOST_LINK = 0x02, /* bmiss */ - DISCONNECT_CMD = 0x03, - BSS_DISCONNECTED = 0x04, - AUTH_FAILED = 0x05, - ASSOC_FAILED = 0x06, - NO_RESOURCES_AVAIL = 0x07, - CSERV_DISCONNECT = 0x08, - INVALID_PROFILE = 0x0a, - DOT11H_CHANNEL_SWITCH = 0x0b, - PROFILE_MISMATCH = 0x0c, - CONNECTION_EVICTED = 0x0d, - IBSS_MERGE = 0x0e, - EXCESS_TX_RETRY = 0x0f, /* TX frames failed after excessive retries */ -} WMI_DISCONNECT_REASON; - -typedef PREPACK struct { - A_UINT16 protocolReasonStatus; /* reason code, see 802.11 spec. */ - A_UINT8 bssid[ATH_MAC_LEN]; /* set if known */ - A_UINT8 disconnectReason ; /* see WMI_DISCONNECT_REASON */ - A_UINT8 assocRespLen; - A_UINT8 assocInfo[1]; -} POSTPACK WMI_DISCONNECT_EVENT; - -/* - * BSS Info Event. - * Mechanism used to inform host of the presence and characteristic of - * wireless networks present. Consists of bss info header followed by - * the beacon or probe-response frame body. The 802.11 header is not included. - */ -typedef enum { - BEACON_FTYPE = 0x1, - PROBERESP_FTYPE, - ACTION_MGMT_FTYPE, - PROBEREQ_FTYPE, -} WMI_BI_FTYPE; - -enum { - BSS_ELEMID_CHANSWITCH = 0x01, - BSS_ELEMID_ATHEROS = 0x02, -}; - -typedef PREPACK struct { - A_UINT16 channel; - A_UINT8 frameType; /* see WMI_BI_FTYPE */ - A_UINT8 snr; - A_INT16 rssi; - A_UINT8 bssid[ATH_MAC_LEN]; - A_UINT32 ieMask; -} POSTPACK WMI_BSS_INFO_HDR; - -/* - * BSS INFO HDR version 2.0 - * With 6 bytes HTC header and 6 bytes of WMI header - * WMI_BSS_INFO_HDR cannot be accomodated in the removed 802.11 management - * header space. - * - Reduce the ieMask to 2 bytes as only two bit flags are used - * - Remove rssi and compute it on the host. rssi = snr - 95 - */ -typedef PREPACK struct { - A_UINT16 channel; - A_UINT8 frameType; /* see WMI_BI_FTYPE */ - A_UINT8 snr; - A_UINT8 bssid[ATH_MAC_LEN]; - A_UINT16 ieMask; -} POSTPACK WMI_BSS_INFO_HDR2; - -typedef PREPACK struct { - A_UINT8 bssid[ATH_MAC_LEN]; - A_UINT8 pin[8]; -} POSTPACK WMI_WPS_PIN_INFO; - -typedef PREPACK struct { - PREPACK union { - A_UINT8 ie[17]; - A_INT32 wac_status; - } POSTPACK info; -} POSTPACK WMI_GET_WAC_INFO; - -/* - * Command Error Event - */ -typedef enum { - INVALID_PARAM = 0x01, - ILLEGAL_STATE = 0x02, - INTERNAL_ERROR = 0x03, -} WMI_ERROR_CODE; - -typedef PREPACK struct { - A_UINT16 commandId; - A_UINT8 errorCode; -} POSTPACK WMI_CMD_ERROR_EVENT; - -/* - * New Regulatory Domain Event - */ -typedef PREPACK struct { - A_UINT32 regDomain; -} POSTPACK WMI_REG_DOMAIN_EVENT; - -typedef PREPACK struct { - A_UINT8 txQueueNumber; - A_UINT8 rxQueueNumber; - A_UINT8 trafficDirection; - A_UINT8 trafficClass; -} POSTPACK WMI_PSTREAM_TIMEOUT_EVENT; - -/* - * The WMI_NEIGHBOR_REPORT Event is generated by the target to inform - * the host of BSS's it has found that matches the current profile. - * It can be used by the host to cache PMKs and/to initiate pre-authentication - * if the BSS supports it. The first bssid is always the current associated - * BSS. - * The bssid and bssFlags information repeats according to the number - * or APs reported. - */ -typedef enum { - WMI_DEFAULT_BSS_FLAGS = 0x00, - WMI_PREAUTH_CAPABLE_BSS = 0x01, - WMI_PMKID_VALID_BSS = 0x02, -} WMI_BSS_FLAGS; - -typedef PREPACK struct { - A_UINT8 bssid[ATH_MAC_LEN]; - A_UINT8 bssFlags; /* see WMI_BSS_FLAGS */ -} POSTPACK WMI_NEIGHBOR_INFO; - -typedef PREPACK struct { - A_INT8 numberOfAps; - WMI_NEIGHBOR_INFO neighbor[1]; -} POSTPACK WMI_NEIGHBOR_REPORT_EVENT; - -/* - * TKIP MIC Error Event - */ -typedef PREPACK struct { - A_UINT8 keyid; - A_UINT8 ismcast; -} POSTPACK WMI_TKIP_MICERR_EVENT; - -/* - * WMI_SCAN_COMPLETE_EVENTID - no parameters (old), staus parameter (new) - */ -typedef PREPACK struct { - A_INT32 status; -} POSTPACK WMI_SCAN_COMPLETE_EVENT; - -typedef PREPACK struct { - A_INT32 rm_type; - A_INT32 status; -} POSTPACK WMI_CCX_RM_STATUS_EVENT; - -#define MAX_OPT_DATA_LEN 1400 - -/* - * WMI_SET_ADHOC_BSSID_CMDID - */ -typedef PREPACK struct { - A_UINT8 bssid[ATH_MAC_LEN]; -} POSTPACK WMI_SET_ADHOC_BSSID_CMD; - -/* - * Special frame receive Event. - * Mechanism used to inform host of the receiption of the special frames. - * Consists of special frame info header followed by special frame body. - * The 802.11 header is not included. - */ -typedef PREPACK struct { - A_UINT16 channel; - A_UINT8 frameType; /* see WMI_OPT_FTYPE */ - A_INT8 snr; - A_UINT8 srcAddr[ATH_MAC_LEN]; - A_UINT8 bssid[ATH_MAC_LEN]; -} POSTPACK WMI_OPT_RX_INFO_HDR; - -/* - * Reporting statistics. - */ -typedef PREPACK struct { - A_UINT32 tx_packets; - A_UINT32 tx_bytes; - A_UINT32 tx_unicast_pkts; - A_UINT32 tx_unicast_bytes; - A_UINT32 tx_multicast_pkts; - A_UINT32 tx_multicast_bytes; - A_UINT32 tx_broadcast_pkts; - A_UINT32 tx_broadcast_bytes; - A_UINT32 tx_rts_success_cnt; - A_UINT32 tx_packet_per_ac[4]; - A_UINT32 tx_errors_per_ac[4]; - - A_UINT32 tx_errors; - A_UINT32 tx_failed_cnt; - A_UINT32 tx_retry_cnt; - A_UINT32 tx_mult_retry_cnt; - A_UINT32 tx_rts_fail_cnt; - A_INT32 tx_unicast_rate; -}POSTPACK tx_stats_t; - -typedef PREPACK struct { - A_UINT32 rx_packets; - A_UINT32 rx_bytes; - A_UINT32 rx_unicast_pkts; - A_UINT32 rx_unicast_bytes; - A_UINT32 rx_multicast_pkts; - A_UINT32 rx_multicast_bytes; - A_UINT32 rx_broadcast_pkts; - A_UINT32 rx_broadcast_bytes; - A_UINT32 rx_fragment_pkt; - - A_UINT32 rx_errors; - A_UINT32 rx_crcerr; - A_UINT32 rx_key_cache_miss; - A_UINT32 rx_decrypt_err; - A_UINT32 rx_duplicate_frames; - A_INT32 rx_unicast_rate; -}POSTPACK rx_stats_t; - -typedef PREPACK struct { - A_UINT32 tkip_local_mic_failure; - A_UINT32 tkip_counter_measures_invoked; - A_UINT32 tkip_replays; - A_UINT32 tkip_format_errors; - A_UINT32 ccmp_format_errors; - A_UINT32 ccmp_replays; -}POSTPACK tkip_ccmp_stats_t; - -typedef PREPACK struct { - A_UINT32 power_save_failure_cnt; - A_UINT16 stop_tx_failure_cnt; - A_UINT16 atim_tx_failure_cnt; - A_UINT16 atim_rx_failure_cnt; - A_UINT16 bcn_rx_failure_cnt; -}POSTPACK pm_stats_t; - -typedef PREPACK struct { - A_UINT32 cs_bmiss_cnt; - A_UINT32 cs_lowRssi_cnt; - A_UINT16 cs_connect_cnt; - A_UINT16 cs_disconnect_cnt; - A_INT16 cs_aveBeacon_rssi; - A_UINT16 cs_roam_count; - A_INT16 cs_rssi; - A_UINT8 cs_snr; - A_UINT8 cs_aveBeacon_snr; - A_UINT8 cs_lastRoam_msec; -} POSTPACK cserv_stats_t; - -typedef PREPACK struct { - tx_stats_t tx_stats; - rx_stats_t rx_stats; - tkip_ccmp_stats_t tkipCcmpStats; -}POSTPACK wlan_net_stats_t; - -typedef PREPACK struct { - A_UINT32 arp_received; - A_UINT32 arp_matched; - A_UINT32 arp_replied; -} POSTPACK arp_stats_t; - -typedef PREPACK struct { - A_UINT32 wow_num_pkts_dropped; - A_UINT16 wow_num_events_discarded; - A_UINT8 wow_num_host_pkt_wakeups; - A_UINT8 wow_num_host_event_wakeups; -} POSTPACK wlan_wow_stats_t; - -typedef PREPACK struct { - A_UINT32 lqVal; - A_INT32 noise_floor_calibation; - pm_stats_t pmStats; - wlan_net_stats_t txrxStats; - wlan_wow_stats_t wowStats; - arp_stats_t arpStats; - cserv_stats_t cservStats; -} POSTPACK WMI_TARGET_STATS; - -/* - * WMI_RSSI_THRESHOLD_EVENTID. - * Indicate the RSSI events to host. Events are indicated when we breach a - * thresold value. - */ -typedef enum{ - WMI_RSSI_THRESHOLD1_ABOVE = 0, - WMI_RSSI_THRESHOLD2_ABOVE, - WMI_RSSI_THRESHOLD3_ABOVE, - WMI_RSSI_THRESHOLD4_ABOVE, - WMI_RSSI_THRESHOLD5_ABOVE, - WMI_RSSI_THRESHOLD6_ABOVE, - WMI_RSSI_THRESHOLD1_BELOW, - WMI_RSSI_THRESHOLD2_BELOW, - WMI_RSSI_THRESHOLD3_BELOW, - WMI_RSSI_THRESHOLD4_BELOW, - WMI_RSSI_THRESHOLD5_BELOW, - WMI_RSSI_THRESHOLD6_BELOW -}WMI_RSSI_THRESHOLD_VAL; - -typedef PREPACK struct { - A_INT16 rssi; - A_UINT8 range; -}POSTPACK WMI_RSSI_THRESHOLD_EVENT; - -/* - * WMI_ERROR_REPORT_EVENTID - */ -typedef enum{ - WMI_TARGET_PM_ERR_FAIL = 0x00000001, - WMI_TARGET_KEY_NOT_FOUND = 0x00000002, - WMI_TARGET_DECRYPTION_ERR = 0x00000004, - WMI_TARGET_BMISS = 0x00000008, - WMI_PSDISABLE_NODE_JOIN = 0x00000010, - WMI_TARGET_COM_ERR = 0x00000020, - WMI_TARGET_FATAL_ERR = 0x00000040, - WMI_TARGET_BCN_FOUND = 0x00000080 -} WMI_TARGET_ERROR_VAL; - -typedef PREPACK struct { - A_UINT32 errorVal; -}POSTPACK WMI_TARGET_ERROR_REPORT_EVENT; - -typedef PREPACK struct { - A_UINT8 retrys; -}POSTPACK WMI_TX_RETRY_ERR_EVENT; - -typedef enum{ - WMI_SNR_THRESHOLD1_ABOVE = 1, - WMI_SNR_THRESHOLD1_BELOW, - WMI_SNR_THRESHOLD2_ABOVE, - WMI_SNR_THRESHOLD2_BELOW, - WMI_SNR_THRESHOLD3_ABOVE, - WMI_SNR_THRESHOLD3_BELOW, - WMI_SNR_THRESHOLD4_ABOVE, - WMI_SNR_THRESHOLD4_BELOW -} WMI_SNR_THRESHOLD_VAL; - -typedef PREPACK struct { - A_UINT8 range; /* WMI_SNR_THRESHOLD_VAL */ - A_UINT8 snr; -}POSTPACK WMI_SNR_THRESHOLD_EVENT; - -typedef enum{ - WMI_LQ_THRESHOLD1_ABOVE = 1, - WMI_LQ_THRESHOLD1_BELOW, - WMI_LQ_THRESHOLD2_ABOVE, - WMI_LQ_THRESHOLD2_BELOW, - WMI_LQ_THRESHOLD3_ABOVE, - WMI_LQ_THRESHOLD3_BELOW, - WMI_LQ_THRESHOLD4_ABOVE, - WMI_LQ_THRESHOLD4_BELOW -} WMI_LQ_THRESHOLD_VAL; - -typedef PREPACK struct { - A_INT32 lq; - A_UINT8 range; /* WMI_LQ_THRESHOLD_VAL */ -}POSTPACK WMI_LQ_THRESHOLD_EVENT; -/* - * WMI_REPORT_ROAM_TBL_EVENTID - */ -#define MAX_ROAM_TBL_CAND 5 - -typedef PREPACK struct { - A_INT32 roam_util; - A_UINT8 bssid[ATH_MAC_LEN]; - A_INT8 rssi; - A_INT8 rssidt; - A_INT8 last_rssi; - A_INT8 util; - A_INT8 bias; - A_UINT8 reserved; /* For alignment */ -} POSTPACK WMI_BSS_ROAM_INFO; - - -typedef PREPACK struct { - A_UINT16 roamMode; - A_UINT16 numEntries; - WMI_BSS_ROAM_INFO bssRoamInfo[1]; -} POSTPACK WMI_TARGET_ROAM_TBL; - -/* - * WMI_HCI_EVENT_EVENTID - */ -typedef PREPACK struct { - A_UINT16 evt_buf_sz; /* HCI event buffer size */ - A_UINT8 buf[1]; /* HCI event */ -} POSTPACK WMI_HCI_EVENT; - -/* - * WMI_CAC_EVENTID - */ -typedef enum { - CAC_INDICATION_ADMISSION = 0x00, - CAC_INDICATION_ADMISSION_RESP = 0x01, - CAC_INDICATION_DELETE = 0x02, - CAC_INDICATION_NO_RESP = 0x03, -}CAC_INDICATION; - -#define WMM_TSPEC_IE_LEN 63 - -typedef PREPACK struct { - A_UINT8 ac; - A_UINT8 cac_indication; - A_UINT8 statusCode; - A_UINT8 tspecSuggestion[WMM_TSPEC_IE_LEN]; -}POSTPACK WMI_CAC_EVENT; - -/* - * WMI_APLIST_EVENTID - */ - -typedef enum { - APLIST_VER1 = 1, -} APLIST_VER; - -typedef PREPACK struct { - A_UINT8 bssid[ATH_MAC_LEN]; - A_UINT16 channel; -} POSTPACK WMI_AP_INFO_V1; - -typedef PREPACK union { - WMI_AP_INFO_V1 apInfoV1; -} POSTPACK WMI_AP_INFO; - -typedef PREPACK struct { - A_UINT8 apListVer; - A_UINT8 numAP; - WMI_AP_INFO apList[1]; -} POSTPACK WMI_APLIST_EVENT; - -/* - * developer commands - */ - -/* - * WMI_SET_BITRATE_CMDID - * - * Get bit rate cmd uses same definition as set bit rate cmd - */ -typedef enum { - RATE_AUTO = -1, - RATE_1Mb = 0, - RATE_2Mb = 1, - RATE_5_5Mb = 2, - RATE_11Mb = 3, - RATE_6Mb = 4, - RATE_9Mb = 5, - RATE_12Mb = 6, - RATE_18Mb = 7, - RATE_24Mb = 8, - RATE_36Mb = 9, - RATE_48Mb = 10, - RATE_54Mb = 11, - RATE_MCS_0_20 = 12, - RATE_MCS_1_20 = 13, - RATE_MCS_2_20 = 14, - RATE_MCS_3_20 = 15, - RATE_MCS_4_20 = 16, - RATE_MCS_5_20 = 17, - RATE_MCS_6_20 = 18, - RATE_MCS_7_20 = 19, - RATE_MCS_0_40 = 20, - RATE_MCS_1_40 = 21, - RATE_MCS_2_40 = 22, - RATE_MCS_3_40 = 23, - RATE_MCS_4_40 = 24, - RATE_MCS_5_40 = 25, - RATE_MCS_6_40 = 26, - RATE_MCS_7_40 = 27, -} WMI_BIT_RATE; - -typedef PREPACK struct { - A_INT8 rateIndex; /* see WMI_BIT_RATE */ - A_INT8 mgmtRateIndex; - A_INT8 ctlRateIndex; -} POSTPACK WMI_BIT_RATE_CMD; - - -typedef PREPACK struct { - A_INT8 rateIndex; /* see WMI_BIT_RATE */ -} POSTPACK WMI_BIT_RATE_REPLY; - - -/* - * WMI_SET_FIXRATES_CMDID - * - * Get fix rates cmd uses same definition as set fix rates cmd - */ -#define FIX_RATE_1Mb ((A_UINT32)0x1) -#define FIX_RATE_2Mb ((A_UINT32)0x2) -#define FIX_RATE_5_5Mb ((A_UINT32)0x4) -#define FIX_RATE_11Mb ((A_UINT32)0x8) -#define FIX_RATE_6Mb ((A_UINT32)0x10) -#define FIX_RATE_9Mb ((A_UINT32)0x20) -#define FIX_RATE_12Mb ((A_UINT32)0x40) -#define FIX_RATE_18Mb ((A_UINT32)0x80) -#define FIX_RATE_24Mb ((A_UINT32)0x100) -#define FIX_RATE_36Mb ((A_UINT32)0x200) -#define FIX_RATE_48Mb ((A_UINT32)0x400) -#define FIX_RATE_54Mb ((A_UINT32)0x800) -#define FIX_RATE_MCS_0_20 ((A_UINT32)0x1000) -#define FIX_RATE_MCS_1_20 ((A_UINT32)0x2000) -#define FIX_RATE_MCS_2_20 ((A_UINT32)0x4000) -#define FIX_RATE_MCS_3_20 ((A_UINT32)0x8000) -#define FIX_RATE_MCS_4_20 ((A_UINT32)0x10000) -#define FIX_RATE_MCS_5_20 ((A_UINT32)0x20000) -#define FIX_RATE_MCS_6_20 ((A_UINT32)0x40000) -#define FIX_RATE_MCS_7_20 ((A_UINT32)0x80000) -#define FIX_RATE_MCS_0_40 ((A_UINT32)0x100000) -#define FIX_RATE_MCS_1_40 ((A_UINT32)0x200000) -#define FIX_RATE_MCS_2_40 ((A_UINT32)0x400000) -#define FIX_RATE_MCS_3_40 ((A_UINT32)0x800000) -#define FIX_RATE_MCS_4_40 ((A_UINT32)0x1000000) -#define FIX_RATE_MCS_5_40 ((A_UINT32)0x2000000) -#define FIX_RATE_MCS_6_40 ((A_UINT32)0x4000000) -#define FIX_RATE_MCS_7_40 ((A_UINT32)0x8000000) - -typedef PREPACK struct { - A_UINT32 fixRateMask[WMI_MAX_RATE_MASK]; /* see WMI_BIT_RATE */ -} POSTPACK WMI_FIX_RATES_CMD, WMI_FIX_RATES_REPLY; - -typedef PREPACK struct { - A_UINT8 bEnableMask; - A_UINT8 frameType; /* type and subtype */ - A_UINT8 reserved[2]; /* for alignment */ - A_UINT32 frameRateMask[WMI_MAX_RATE_MASK]; /* see WMI_BIT_RATE */ -} POSTPACK WMI_FRAME_RATES_CMD, WMI_FRAME_RATES_REPLY; - -/* - * WMI_SET_RECONNECT_AUTH_MODE_CMDID - * - * Set authentication mode - */ -typedef enum { - RECONN_DO_AUTH = 0x00, - RECONN_NOT_AUTH = 0x01 -} WMI_AUTH_MODE; - -typedef PREPACK struct { - A_UINT8 mode; -} POSTPACK WMI_SET_AUTH_MODE_CMD; - -/* - * WMI_SET_REASSOC_MODE_CMDID - * - * Set authentication mode - */ -typedef enum { - REASSOC_DO_DISASSOC = 0x00, - REASSOC_DONOT_DISASSOC = 0x01 -} WMI_REASSOC_MODE; - -typedef PREPACK struct { - A_UINT8 mode; -}POSTPACK WMI_SET_REASSOC_MODE_CMD; - -typedef enum { - ROAM_DATA_TIME = 1, /* Get The Roam Time Data */ -} ROAM_DATA_TYPE; - -typedef PREPACK struct { - A_UINT32 disassoc_time; - A_UINT32 no_txrx_time; - A_UINT32 assoc_time; - A_UINT32 allow_txrx_time; - A_UINT8 disassoc_bssid[ATH_MAC_LEN]; - A_INT8 disassoc_bss_rssi; - A_UINT8 assoc_bssid[ATH_MAC_LEN]; - A_INT8 assoc_bss_rssi; -} POSTPACK WMI_TARGET_ROAM_TIME; - -typedef PREPACK struct { - PREPACK union { - WMI_TARGET_ROAM_TIME roamTime; - } POSTPACK u; - A_UINT8 roamDataType ; -} POSTPACK WMI_TARGET_ROAM_DATA; - -typedef enum { - WMI_WMM_DISABLED = 0, - WMI_WMM_ENABLED -} WMI_WMM_STATUS; - -typedef PREPACK struct { - A_UINT8 status; -}POSTPACK WMI_SET_WMM_CMD; - -typedef PREPACK struct { - A_UINT8 status; -}POSTPACK WMI_SET_QOS_SUPP_CMD; - -typedef enum { - WMI_TXOP_DISABLED = 0, - WMI_TXOP_ENABLED -} WMI_TXOP_CFG; - -typedef PREPACK struct { - A_UINT8 txopEnable; -}POSTPACK WMI_SET_WMM_TXOP_CMD; - -typedef PREPACK struct { - A_UINT8 keepaliveInterval; -} POSTPACK WMI_SET_KEEPALIVE_CMD; - -typedef PREPACK struct { - A_BOOL configured; - A_UINT8 keepaliveInterval; -} POSTPACK WMI_GET_KEEPALIVE_CMD; - -/* - * Add Application specified IE to a management frame - */ -#define WMI_MAX_IE_LEN 255 - -typedef PREPACK struct { - A_UINT8 mgmtFrmType; /* one of WMI_MGMT_FRAME_TYPE */ - A_UINT8 ieLen; /* Length of the IE that should be added to the MGMT frame */ - A_UINT8 ieInfo[1]; -} POSTPACK WMI_SET_APPIE_CMD; - -/* - * Notify the WSC registration status to the target - */ -#define WSC_REG_ACTIVE 1 -#define WSC_REG_INACTIVE 0 -/* Generic Hal Interface for setting hal paramters. */ -/* Add new Set HAL Param cmdIds here for newer params */ -typedef enum { - WHAL_SETCABTO_CMDID = 1, -}WHAL_CMDID; - -typedef PREPACK struct { - A_UINT8 cabTimeOut; -} POSTPACK WHAL_SETCABTO_PARAM; - -typedef PREPACK struct { - A_UINT8 whalCmdId; - A_UINT8 data[1]; -} POSTPACK WHAL_PARAMCMD; - - -#define WOW_MAX_FILTER_LISTS 1 /*4*/ -#define WOW_MAX_FILTERS_PER_LIST 4 -#define WOW_PATTERN_SIZE 64 -#define WOW_MASK_SIZE 64 - -#define MAC_MAX_FILTERS_PER_LIST 7 - -typedef PREPACK struct { - A_UINT8 wow_valid_filter; - A_UINT8 wow_filter_id; - A_UINT8 wow_filter_size; - A_UINT8 wow_filter_offset; - A_UINT8 wow_filter_mask[WOW_MASK_SIZE]; - A_UINT8 wow_filter_pattern[WOW_PATTERN_SIZE]; -} POSTPACK WOW_FILTER; - - -typedef PREPACK struct { - A_UINT8 wow_valid_list; - A_UINT8 wow_list_id; - A_UINT8 wow_num_filters; - A_UINT8 wow_total_list_size; - WOW_FILTER list[WOW_MAX_FILTERS_PER_LIST]; -} POSTPACK WOW_FILTER_LIST; - -typedef PREPACK struct { - A_UINT8 valid_filter; - A_UINT8 mac_addr[ATH_MAC_LEN]; -} POSTPACK MAC_FILTER; - - -typedef PREPACK struct { - A_UINT8 total_list_size; - A_UINT8 enable; - MAC_FILTER list[MAC_MAX_FILTERS_PER_LIST]; -} POSTPACK MAC_FILTER_LIST; - -#define MAX_IP_ADDRS 2 -typedef PREPACK struct { - A_UINT32 ips[MAX_IP_ADDRS]; /* IP in Network Byte Order */ -} POSTPACK WMI_SET_IP_CMD; - -typedef PREPACK struct { - A_BOOL awake; - A_BOOL asleep; -} POSTPACK WMI_SET_HOST_SLEEP_MODE_CMD; - -typedef enum { - WOW_FILTER_SSID = 0x1 -} WMI_WOW_FILTER; - -typedef PREPACK struct { - A_BOOL enable_wow; - WMI_WOW_FILTER filter; - A_UINT16 hostReqDelay; -} POSTPACK WMI_SET_WOW_MODE_CMD; - -typedef PREPACK struct { - A_UINT8 filter_list_id; -} POSTPACK WMI_GET_WOW_LIST_CMD; - -/* - * WMI_GET_WOW_LIST_CMD reply - */ -typedef PREPACK struct { - A_UINT8 num_filters; /* number of patterns in reply */ - A_UINT8 this_filter_num; /* this is filter # x of total num_filters */ - A_UINT8 wow_mode; - A_UINT8 host_mode; - WOW_FILTER wow_filters[1]; -} POSTPACK WMI_GET_WOW_LIST_REPLY; - -typedef PREPACK struct { - A_UINT8 filter_list_id; - A_UINT8 filter_size; - A_UINT8 filter_offset; - A_UINT8 filter[1]; -} POSTPACK WMI_ADD_WOW_PATTERN_CMD; - -typedef PREPACK struct { - A_UINT16 filter_list_id; - A_UINT16 filter_id; -} POSTPACK WMI_DEL_WOW_PATTERN_CMD; - -typedef PREPACK struct { - A_UINT8 macaddr[ATH_MAC_LEN]; -} POSTPACK WMI_SET_MAC_ADDRESS_CMD; - -/* - * WMI_SET_AKMP_PARAMS_CMD - */ - -#define WMI_AKMP_MULTI_PMKID_EN 0x000001 - -typedef PREPACK struct { - A_UINT32 akmpInfo; -} POSTPACK WMI_SET_AKMP_PARAMS_CMD; - -typedef PREPACK struct { - A_UINT8 pmkid[WMI_PMKID_LEN]; -} POSTPACK WMI_PMKID; - -/* - * WMI_SET_PMKID_LIST_CMD - */ -#define WMI_MAX_PMKID_CACHE 8 - -typedef PREPACK struct { - A_UINT32 numPMKID; - WMI_PMKID pmkidList[WMI_MAX_PMKID_CACHE]; -} POSTPACK WMI_SET_PMKID_LIST_CMD; - -/* - * WMI_GET_PMKID_LIST_CMD Reply - * Following the Number of PMKIDs is the list of PMKIDs - */ -typedef PREPACK struct { - A_UINT32 numPMKID; - A_UINT8 bssidList[ATH_MAC_LEN][1]; - WMI_PMKID pmkidList[1]; -} POSTPACK WMI_PMKID_LIST_REPLY; - -typedef PREPACK struct { - A_UINT16 oldChannel; - A_UINT32 newChannel; -} POSTPACK WMI_CHANNEL_CHANGE_EVENT; - -typedef PREPACK struct { - A_UINT32 version; -} POSTPACK WMI_WLAN_VERSION_EVENT; - - -/* WMI_ADDBA_REQ_EVENTID */ -typedef PREPACK struct { - A_UINT8 tid; - A_UINT8 win_sz; - A_UINT16 st_seq_no; - A_UINT8 status; /* f/w response for ADDBA Req; OK(0) or failure(!=0) */ -} POSTPACK WMI_ADDBA_REQ_EVENT; - -/* WMI_ADDBA_RESP_EVENTID */ -typedef PREPACK struct { - A_UINT8 tid; - A_UINT8 status; /* OK(0), failure (!=0) */ - A_UINT16 amsdu_sz; /* Three values: Not supported(0), 3839, 8k */ -} POSTPACK WMI_ADDBA_RESP_EVENT; - -/* WMI_DELBA_EVENTID - * f/w received a DELBA for peer and processed it. - * Host is notified of this - */ -typedef PREPACK struct { - A_UINT8 tid; - A_UINT8 is_peer_initiator; - A_UINT16 reason_code; -} POSTPACK WMI_DELBA_EVENT; - - -#ifdef WAPI_ENABLE -#define WAPI_REKEY_UCAST 1 -#define WAPI_REKEY_MCAST 2 -typedef PREPACK struct { - A_UINT8 type; - A_UINT8 macAddr[ATH_MAC_LEN]; -} POSTPACK WMI_WAPIREKEY_EVENT; -#endif - - -/* WMI_ALLOW_AGGR_CMDID - * Configures tid's to allow ADDBA negotiations - * on each tid, in each direction - */ -typedef PREPACK struct { - A_UINT16 tx_allow_aggr; /* 16-bit mask to allow uplink ADDBA negotiation - bit position indicates tid*/ - A_UINT16 rx_allow_aggr; /* 16-bit mask to allow donwlink ADDBA negotiation - bit position indicates tid*/ -} POSTPACK WMI_ALLOW_AGGR_CMD; - -/* WMI_ADDBA_REQ_CMDID - * f/w starts performing ADDBA negotiations with peer - * on the given tid - */ -typedef PREPACK struct { - A_UINT8 tid; -} POSTPACK WMI_ADDBA_REQ_CMD; - -/* WMI_DELBA_REQ_CMDID - * f/w would teardown BA with peer. - * is_send_initiator indicates if it's or tx or rx side - */ -typedef PREPACK struct { - A_UINT8 tid; - A_UINT8 is_sender_initiator; - -} POSTPACK WMI_DELBA_REQ_CMD; - -#define PEER_NODE_JOIN_EVENT 0x00 -#define PEER_NODE_LEAVE_EVENT 0x01 -#define PEER_FIRST_NODE_JOIN_EVENT 0x10 -#define PEER_LAST_NODE_LEAVE_EVENT 0x11 -typedef PREPACK struct { - A_UINT8 eventCode; - A_UINT8 peerMacAddr[ATH_MAC_LEN]; -} POSTPACK WMI_PEER_NODE_EVENT; - -#define IEEE80211_FRAME_TYPE_MGT 0x00 -#define IEEE80211_FRAME_TYPE_CTL 0x04 - -typedef PREPACK struct { - A_UINT32 rules; /* combination of WMI_WRT_... values */ -} POSTPACK WMI_CONFIG_TX_MAC_RULES_CMD; - -typedef PREPACK struct { - A_UINT8 enable; /* 1 == device operates in promiscuous mode , 0 == normal mode */ -} POSTPACK WMI_SET_PROMISCUOUS_MODE_CMD; - -typedef enum { - RADIO_STATE_OFF = 0x1, - RADIO_STATE_ON = 0x2, - RADIO_STATE_INVALID = 0xFF -}RFKILL_RADIO_STATE; - -typedef PREPACK struct { - A_UINT8 GPIOPinNumber; - A_UINT8 IntrType; - A_UINT8 RadioState; -} POSTPACK WMI_RFKILL_MODE_CMD; - -/* - * Transmit complete event data structure(s) - */ - - -typedef PREPACK struct { -#define TX_COMPLETE_STATUS_SUCCESS 0 -#define TX_COMPLETE_STATUS_RETRIES 1 -#define TX_COMPLETE_STATUS_NOLINK 2 -#define TX_COMPLETE_STATUS_TIMEOUT 3 -#define TX_COMPLETE_STATUS_OTHER 4 - - A_UINT8 status; /* one of TX_COMPLETE_STATUS_... */ - A_UINT8 pktID; /* packet ID to identify parent packet */ - A_UINT8 rateIdx; /* rate index on successful transmission */ - A_UINT8 ackFailures; /* number of ACK failures in tx attempt */ -#if 0 /* optional params currently ommitted. */ - A_UINT32 queueDelay; // usec delay measured Tx Start time - host delivery time - A_UINT32 mediaDelay; // usec delay measured ACK rx time - host delivery time -#endif -} POSTPACK TX_COMPLETE_MSG_V1; /* version 1 of tx complete msg */ - -typedef PREPACK struct { - A_UINT8 numMessages; /* number of tx comp msgs following this struct */ - A_UINT8 msgLen; /* length in bytes for each individual msg following this struct */ - A_UINT8 msgType; /* version of tx complete msg data following this struct */ - A_UINT8 reserved; /* individual messages follow this header */ -} POSTPACK WMI_TX_COMPLETE_EVENT; - -#define WMI_TXCOMPLETE_VERSION_1 (0x01) - - -/* - * ------- AP Mode definitions -------------- - */ - -/* - * !!! Warning !!! - * -Changing the following values needs compilation of both driver and firmware - */ -#ifdef AR6002_REV2 -#define AP_MAX_NUM_STA 4 -#else -#define AP_MAX_NUM_STA 10 -#endif - -/*Maximum no. of virtual interface supported*/ -#define NUM_DEV 3 -#define NUM_CONN (AP_MAX_NUM_STA + NUM_DEV) - -#define AP_ACL_SIZE 10 -#define IEEE80211_MAX_IE 256 -#define MCAST_AID 0xFF /* Spl. AID used to set DTIM flag in the beacons */ -#define DEF_AP_COUNTRY_CODE "US " -#define DEF_AP_WMODE_G WMI_11G_MODE -#define DEF_AP_WMODE_AG WMI_11AG_MODE -#define DEF_AP_DTIM 5 -#define DEF_BEACON_INTERVAL 100 - -/* AP mode disconnect reasons */ -#define AP_DISCONNECT_STA_LEFT 101 -#define AP_DISCONNECT_FROM_HOST 102 -#define AP_DISCONNECT_COMM_TIMEOUT 103 -#define AP_DISCONNECT_MAX_STA 104 -#define AP_DISCONNECT_ACL 105 - -/* - * Used with WMI_AP_HIDDEN_SSID_CMDID - */ -#define HIDDEN_SSID_FALSE 0 -#define HIDDEN_SSID_TRUE 1 -typedef PREPACK struct { - A_UINT8 hidden_ssid; -} POSTPACK WMI_AP_HIDDEN_SSID_CMD; - -/* - * Used with WMI_AP_ACL_POLICY_CMDID - */ -#define AP_ACL_DISABLE 0x00 -#define AP_ACL_ALLOW_MAC 0x01 -#define AP_ACL_DENY_MAC 0x02 -#define AP_ACL_RETAIN_LIST_MASK 0x80 -typedef PREPACK struct { - A_UINT8 policy; -} POSTPACK WMI_AP_ACL_POLICY_CMD; - -/* - * Used with WMI_AP_ACL_MAC_LIST_CMDID - */ -#define ADD_MAC_ADDR 1 -#define DEL_MAC_ADDR 2 -typedef PREPACK struct { - A_UINT8 action; - A_UINT8 index; - A_UINT8 mac[ATH_MAC_LEN]; - A_UINT8 wildcard; -} POSTPACK WMI_AP_ACL_MAC_CMD; - -typedef PREPACK struct { - A_UINT16 index; - A_UINT8 acl_mac[AP_ACL_SIZE][ATH_MAC_LEN]; - A_UINT8 wildcard[AP_ACL_SIZE]; - A_UINT8 policy; -} POSTPACK WMI_AP_ACL; - -/* - * Used with WMI_AP_SET_NUM_STA_CMDID - */ -typedef PREPACK struct { - A_UINT8 num_sta; -} POSTPACK WMI_AP_NUM_STA_CMD; - -/* - * Used with WMI_AP_SET_MLME_CMDID - */ -typedef PREPACK struct { - A_UINT8 mac[ATH_MAC_LEN]; - A_UINT16 reason; /* 802.11 reason code */ - A_UINT8 cmd; /* operation to perform */ -/* MLME Commands */ -#define WMI_AP_MLME_ASSOC 1 /* associate station */ -#define WMI_AP_DISASSOC 2 /* disassociate station */ -#define WMI_AP_DEAUTH 3 /* deauthenticate station */ -#define WMI_AP_MLME_AUTHORIZE 4 /* authorize station */ -#define WMI_AP_MLME_UNAUTHORIZE 5 /* unauthorize station */ -} POSTPACK WMI_AP_SET_MLME_CMD; - -typedef PREPACK struct { - A_UINT32 period; -} POSTPACK WMI_AP_CONN_INACT_CMD; - -typedef PREPACK struct { - A_UINT32 period_min; - A_UINT32 dwell_ms; -} POSTPACK WMI_AP_PROT_SCAN_TIME_CMD; - -typedef PREPACK struct { - A_BOOL flag; - A_UINT16 rsvd; - A_UINT16 aid; -} POSTPACK WMI_AP_SET_PVB_CMD; - -#define WMI_DISABLE_REGULATORY_CODE "FF" - -typedef PREPACK struct { - A_UCHAR countryCode[3]; -} POSTPACK WMI_AP_SET_COUNTRY_CMD; - -typedef PREPACK struct { - A_UINT8 dtim; -} POSTPACK WMI_AP_SET_DTIM_CMD; - -typedef PREPACK struct { - A_UINT8 band; /* specifies which band to apply these values */ - A_UINT8 enable; /* allows 11n to be disabled on a per band basis */ - A_UINT8 chan_width_40M_supported; - A_UINT8 short_GI_20MHz; - A_UINT8 short_GI_40MHz; - A_UINT8 intolerance_40MHz; - A_UINT8 max_ampdu_len_exp; -} POSTPACK WMI_SET_HT_CAP_CMD; - -typedef PREPACK struct { - A_UINT8 sta_chan_width; -} POSTPACK WMI_SET_HT_OP_CMD; - -typedef PREPACK struct { - A_UINT32 rateMasks[WMI_MODE_MAX*WMI_MAX_RATE_MASK]; -} POSTPACK WMI_SET_TX_SELECT_RATES_CMD; - -typedef PREPACK struct { - A_UINT32 sgiMask[WMI_MAX_RATE_MASK]; - A_UINT8 sgiPERThreshold; -} POSTPACK WMI_SET_TX_SGI_PARAM_CMD; - -#define DEFAULT_SGI_MASK_L32 0x08080000 -#define DEFAULT_SGI_MASK_U32 0x00000000 -#define DEFAULT_SGI_PER 10 - -typedef PREPACK struct { - A_UINT32 rateField[WMI_MAX_RATE_MASK]; /* 1 bit per rate corresponding to index */ -#define WMI_RATE_POLICY_ID_MAX 5 - A_UINT8 id; /* valid values == 1->WMI_RATE_POLICY_ID_MAX */ - A_UINT8 shortTrys; - A_UINT8 longTrys; - A_UINT8 reserved; /* padding */ -} POSTPACK WMI_SET_RATE_POLICY_CMD; - -typedef PREPACK struct { - A_UINT8 metaVersion; /* version of meta data for rx packets <0 = default> (0-7 = valid) */ - A_UINT8 dot11Hdr; /* 1 == leave .11 header intact , 0 == replace .11 header with .3 */ - A_UINT8 defragOnHost; /* 1 == defragmentation is performed by host, 0 == performed by target */ - A_UINT8 reserved[1]; /* alignment */ -} POSTPACK WMI_RX_FRAME_FORMAT_CMD; - - -typedef PREPACK struct { - A_UINT8 enable; /* 1 == device operates in thin mode , 0 == normal mode */ - A_UINT8 reserved[3]; -} POSTPACK WMI_SET_THIN_MODE_CMD; - - -typedef PREPACK struct { - A_UINT16 channel; /* frequency in Mhz */ - //A_UINT8 mode; // HT20 or HT40 - //A_UINT8 secondary; // if mode == HT40 secondary channel above | below -} POSTPACK WMI_SET_CHANNEL_CMD; - - -typedef enum { - WMI_SET_CHANNEL_RES_SUCCESS = 0, // device has joined the network - WMI_SET_CHANNEL_RES_FAIL, // device failed for unspecified reason -}WMI_SET_CHANNEL_RESULT; - -typedef PREPACK struct { - A_UINT8 result; /* the result of the join cmd. one of WMI_THIN_JOIN_RESULT */ - A_UINT8 reserved[3]; /* alignment */ -} POSTPACK WMI_SET_CHANNEL_EVENT; - -typedef enum { - WMI_FILTERMASK_MGMT=0, - WMI_FILTERMASK_CTRL, - WMI_FILTERMASK_DATA, - WMI_FILTERMASK_MAX -}WMI_FILTERMASK_INDEX; - -typedef PREPACK struct { - A_UINT16 filtermask[WMI_FILTERMASK_MAX]; - A_UINT16 reserved; /* alignment */ -} POSTPACK WMI_RX_FRAME_FILTER_CMD; - -/* AP mode events */ -/* WMI_PS_POLL_EVENT */ -typedef PREPACK struct { - A_UINT16 aid; -} POSTPACK WMI_PSPOLL_EVENT; - -typedef PREPACK struct { - A_UINT32 tx_bytes; - A_UINT32 tx_pkts; - A_UINT32 tx_error; - A_UINT32 tx_discard; - A_UINT32 rx_bytes; - A_UINT32 rx_pkts; - A_UINT32 rx_error; - A_UINT32 rx_discard; - A_UINT32 aid; -} POSTPACK WMI_PER_STA_STAT; - -#define AP_GET_STATS 0 -#define AP_CLEAR_STATS 1 - -typedef PREPACK struct { - A_UINT32 action; - WMI_PER_STA_STAT sta[AP_MAX_NUM_STA]; -} POSTPACK WMI_AP_MODE_STAT; - -#define AP_11BG_RATESET1 1 -#define AP_11BG_RATESET2 2 -#define DEF_AP_11BG_RATESET AP_11BG_RATESET1 -typedef PREPACK struct { - A_UINT8 rateset; -} POSTPACK WMI_AP_SET_11BG_RATESET_CMD; -/* - * End of AP mode definitions - */ - -struct _wmm_params { - A_UINT8 acm; /* ACM parameter */ - A_UINT8 aifsn; /* AIFSN parameters */ - A_UINT8 logcwmin; /* cwmin in exponential form */ - A_UINT8 logcwmax; /* cwmax in exponential form */ - A_UINT16 txopLimit; /* txopLimit */ -}; - -/* WMI_REPORT_WMM_PARAMS_EVENT */ -typedef PREPACK struct { - struct _wmm_params wmm_params[4]; -} POSTPACK WMI_REPORT_WMM_PARAMS_EVENT; - -/* P2P module definitions */ - -/* P2P module commands */ -typedef PREPACK struct { - A_UINT8 go_intent; - A_UINT8 country[3]; - A_UINT8 reg_class; - A_UINT8 listen_channel; - A_UINT8 op_reg_class; - A_UINT8 op_channel; - A_UINT16 config_methods; -} POSTPACK WMI_P2P_SET_CONFIG_CMD; - -typedef PREPACK struct { - A_UINT16 categ; - A_UINT16 sub_categ; -} POSTPACK device_type_tuple; - -typedef PREPACK struct { - device_type_tuple pri_dev_type; - //A_UINT8 pri_device_type[8]; -#define MAX_P2P_SEC_DEVICE_TYPES 5 - device_type_tuple sec_dev_type[MAX_P2P_SEC_DEVICE_TYPES]; -#define WPS_UUID_LEN 16 - A_UINT8 uuid[WPS_UUID_LEN]; -#define WPS_MAX_DEVNAME_LEN 32 - A_UINT8 device_name[WPS_MAX_DEVNAME_LEN]; - A_UINT8 dev_name_len; -} POSTPACK WMI_WPS_SET_CONFIG_CMD; - -typedef PREPACK struct { - device_type_tuple pri_dev_type; - device_type_tuple sec_dev_type[MAX_P2P_SEC_DEVICE_TYPES]; - A_UINT8 device_addr[ATH_MAC_LEN]; -} POSTPACK WMI_SET_REQ_DEV_ATTR_CMD; - -typedef PREPACK struct { - A_UINT8 ssidLength; - A_UINT8 ssid[WMI_MAX_SSID_LEN]; -} POSTPACK P2P_SSID; - -typedef enum wmi_p2p_discovery_type { - WMI_P2P_FIND_START_WITH_FULL, - WMI_P2P_FIND_ONLY_SOCIAL, - WMI_P2P_FIND_PROGRESSIVE -} WMI_P2P_DISC_TYPE; - -typedef PREPACK struct { - A_UINT32 timeout; - WMI_P2P_DISC_TYPE type; -} POSTPACK WMI_P2P_FIND_CMD; - -typedef PREPACK struct { - A_UINT16 listen_freq; - A_UINT16 force_freq; - A_UINT16 go_oper_freq; - A_UINT8 dialog_token; - A_UINT8 peer_addr[ATH_MAC_LEN]; - A_UINT8 own_interface_addr[ATH_MAC_LEN]; - A_UINT8 member_in_go_dev[ATH_MAC_LEN]; - A_UINT8 go_dev_dialog_token; - P2P_SSID peer_go_ssid; - A_UINT8 wps_method; - A_UINT8 dev_capab; - A_INT8 go_intent; - A_UINT8 persistent_grp; -} POSTPACK WMI_P2P_GO_NEG_START_CMD; - -typedef PREPACK struct { - A_UINT8 persistent_group; - A_UINT8 group_formation; -} POSTPACK WMI_P2P_GRP_INIT_CMD; - -typedef PREPACK struct { - A_UINT8 peer_addr[ATH_MAC_LEN]; - A_UINT8 grp_formation_status; -} POSTPACK WMI_P2P_GRP_FORMATION_DONE_CMD; - -typedef PREPACK struct { - A_UINT32 timeout; -}POSTPACK WMI_P2P_LISTEN_CMD; - -typedef PREPACK struct { - A_UINT16 listen_freq; - A_UINT16 force_freq; - A_UINT8 status; - A_INT8 go_intent; - A_UINT8 wps_buf[512]; - A_UINT16 wps_buflen; - A_UINT8 p2p_buf[512]; - A_UINT16 p2p_buflen; - A_UINT8 dialog_token; - A_UINT8 wps_method; - A_UINT8 persistent_grp; -}POSTPACK WMI_P2P_GO_NEG_REQ_RSP_CMD; - -typedef enum { - WMI_P2P_INVITE_ROLE_GO, - WMI_P2P_INVITE_ROLE_ACTIVE_GO, - WMI_P2P_INVITE_ROLE_CLIENT, -} WMI_P2P_INVITE_ROLE; - -typedef PREPACK struct { - WMI_P2P_INVITE_ROLE role; - A_UINT16 listen_freq; - A_UINT16 force_freq; - A_UINT8 dialog_token; - A_UINT8 peer_addr[ATH_MAC_LEN]; - A_UINT8 bssid[ATH_MAC_LEN]; - A_UINT8 go_dev_addr[ATH_MAC_LEN]; - P2P_SSID ssid; - A_UINT8 is_persistent; - A_UINT8 wps_method; -}POSTPACK WMI_P2P_INVITE_CMD; - -typedef PREPACK struct { - A_UINT16 force_freq; - A_UINT8 status; - A_UINT8 dialog_token; - A_UINT8 p2p_buf[512]; - A_UINT16 p2p_buflen; - A_UINT8 is_go; - A_UINT8 group_bssid[ATH_MAC_LEN]; -}POSTPACK WMI_P2P_INVITE_REQ_RSP_CMD; - -typedef PREPACK struct { - A_UINT16 wps_method; - A_UINT16 listen_freq; - A_UINT8 dialog_token; - A_UINT8 peer[ATH_MAC_LEN]; - A_UINT8 go_dev_addr[ATH_MAC_LEN]; - P2P_SSID go_oper_ssid; -}POSTPACK WMI_P2P_PROV_DISC_REQ_CMD; - -typedef enum { - WMI_P2P_CONFID_LISTEN_CHANNEL=1, - WMI_P2P_CONFID_CROSS_CONNECT=2, - WMI_P2P_CONFID_SSID_POSTFIX=3, - WMI_P2P_CONFID_INTRA_BSS=4, - -} WMI_P2P_CONF_ID; - -typedef PREPACK struct { - A_UINT8 reg_class; - A_UINT8 listen_channel; -}POSTPACK WMI_P2P_LISTEN_CHANNEL; - -typedef PREPACK struct { - A_UINT8 flag; -}POSTPACK WMI_P2P_SET_CROSS_CONNECT; - -typedef PREPACK struct { - A_UINT8 ssid_postfix[WMI_MAX_SSID_LEN-9]; - A_UINT8 ssid_postfix_len; -}POSTPACK WMI_P2P_SET_SSID_POSTFIX; - -typedef PREPACK struct { - A_UINT8 flag; -}POSTPACK WMI_P2P_SET_INTRA_BSS; - -typedef PREPACK struct { - A_UINT8 config_id; /* set to one of WMI_P2P_CONF_ID */ - PREPACK union { - WMI_P2P_LISTEN_CHANNEL listen_ch; - WMI_P2P_SET_CROSS_CONNECT cross_conn; - WMI_P2P_SET_SSID_POSTFIX ssid_postfix; - WMI_P2P_SET_INTRA_BSS intra_bss; - }POSTPACK val; -}POSTPACK WMI_P2P_SET_CMD; - -#define WMI_P2P_MAX_TLV_LEN 1024 -typedef enum { - WMI_P2P_SD_TYPE_GAS_INITIAL_REQ = 0x1, - WMI_P2P_SD_TYPE_GAS_INITIAL_RESP = 0x2, - WMI_P2P_SD_TYPE_GAS_COMEBACK_REQ = 0x3, - WMI_P2P_SD_TYPE_GAS_COMEBACK_RESP = 0x4, - WMI_P2P_PD_TYPE_RESP = 0x5, - WMI_P2P_SD_TYPE_STATUS_IND = 0x6, -} WMI_P2P_SDPD_TYPE; - -typedef enum { - WMI_P2P_SDPD_TRANSACTION_PENDING = 0x1, - WMI_P2P_SDPD_TRANSACTION_COMP = 0x2, -} WMI_P2P_SDPD_TRANSACTION_STATUS; - -typedef PREPACK struct { - A_UINT8 type; - A_UINT8 dialog_token; - A_UINT8 frag_id; - A_UINT8 reserved1; /* alignment */ - A_UINT8 peer_addr[ATH_MAC_LEN]; - A_UINT16 freq; - A_UINT16 status_code; - A_UINT16 comeback_delay; - A_UINT16 tlv_length; - A_UINT16 update_indic; - A_UINT16 total_length; - A_UINT16 reserved2; /* future */ - A_UINT8 tlv[WMI_P2P_MAX_TLV_LEN]; -} POSTPACK WMI_P2P_SDPD_TX_CMD; - -/* P2P module events */ - -typedef PREPACK struct { - A_UINT8 sa[ATH_MAC_LEN]; - A_UINT8 wps_buf[512]; - A_UINT16 wps_buflen; - A_UINT8 p2p_buf[512]; - A_UINT16 p2p_buflen; - A_UINT8 dialog_token; -}POSTPACK WMI_P2P_GO_NEG_REQ_EVENT; - -typedef PREPACK struct { - A_UINT16 freq; - A_INT8 status; - A_UINT8 role_go; - A_UINT8 ssid[WMI_MAX_SSID_LEN]; - A_UINT8 ssid_len; -#define WMI_MAX_PASSPHRASE_LEN 9 - A_CHAR pass_phrase[WMI_MAX_PASSPHRASE_LEN]; - A_UINT8 peer_device_addr[ATH_MAC_LEN]; - A_UINT8 peer_interface_addr[ATH_MAC_LEN]; - A_UINT8 wps_method; - A_UINT8 persistent_grp; -} POSTPACK WMI_P2P_GO_NEG_RESULT_EVENT; - -typedef PREPACK struct { - A_UINT8 p2p_buf[512]; - A_UINT16 p2p_buflen; - A_UINT8 sa[ATH_MAC_LEN]; - A_UINT8 bssid[ATH_MAC_LEN]; - A_UINT8 go_dev_addr[ATH_MAC_LEN]; - P2P_SSID ssid; - A_UINT8 is_persistent; - A_UINT8 dialog_token; -} POSTPACK WMI_P2P_INVITE_REQ_EVENT; - -typedef PREPACK struct { - A_UINT16 oper_freq; - A_UINT8 sa[ATH_MAC_LEN]; - A_UINT8 bssid[ATH_MAC_LEN]; - A_UINT8 is_bssid_valid; - A_UINT8 go_dev_addr[ATH_MAC_LEN]; - P2P_SSID ssid; - A_UINT8 status; -} POSTPACK WMI_P2P_INVITE_RCVD_RESULT_EVENT; - -typedef PREPACK struct { - A_UINT8 status; - A_UINT8 bssid[ATH_MAC_LEN]; - A_UINT8 is_bssid_valid; -} POSTPACK WMI_P2P_INVITE_SENT_RESULT_EVENT; - -typedef PREPACK struct { - A_UINT8 sa[ATH_MAC_LEN]; - A_UINT16 wps_config_method; - A_UINT8 dev_addr[ATH_MAC_LEN]; -#define WPS_DEV_TYPE_LEN 8 - A_UINT8 pri_dev_type[WPS_DEV_TYPE_LEN]; - A_UINT8 device_name[WPS_MAX_DEVNAME_LEN]; - A_UINT8 dev_name_len; - A_UINT16 dev_config_methods; - A_UINT8 device_capab; - A_UINT8 group_capab; -} POSTPACK WMI_P2P_PROV_DISC_REQ_EVENT; - -typedef PREPACK struct { - A_UINT8 peer[ATH_MAC_LEN]; - A_UINT16 config_methods; -} POSTPACK WMI_P2P_PROV_DISC_RESP_EVENT; - -typedef PREPACK struct { - A_UINT8 type; - A_UINT8 transaction_status; - A_UINT8 dialog_token; - A_UINT8 frag_id; - A_UINT8 peer_addr[ATH_MAC_LEN]; - A_UINT16 freq; - A_UINT16 status_code; - A_UINT16 comeback_delay; - A_UINT16 tlv_length; - A_UINT16 update_indic; -// Variable length TLV will be placed after the event -} POSTPACK WMI_P2P_SDPD_RX_EVENT; - -typedef PREPACK struct { - A_UINT8 event_id; /* event identifier */ - A_UINT8 length; /* number of bytes of data that follows */ - A_UINT8 data[1]; /* start of event data */ -} POSTPACK WMI_ACS_EVENT_MSG; - -#define WMI_ACS_EVENT_HDR_LEN (sizeof(WMI_ACS_EVENT_MSG) - sizeof(A_UINT8)) - -typedef PREPACK struct { - A_UINT8 ctrl_id; /* control identifier */ - A_UINT8 length; /* number of bytes of data to follow */ - A_UINT8 data[1]; /* start of control data */ -} POSTPACK WMI_ACS_CTRL_MSG; - -#define WMI_ACS_CTRL_HDR_LEN (sizeof(WMI_ACS_CTRL_MSG) - sizeof(A_UINT8)) - -/* STORE / RECALL Commands AND Events DEFINITION START */ -typedef PREPACK struct { - A_UINT8 enable; -#define STRRCL_RECIPIENT_HOST 1 - A_UINT8 recipient; -} POSTPACK WMI_STORERECALL_CONFIGURE_CMD; - -typedef PREPACK struct { - A_UINT32 length; /* number of bytes of data to follow */ - A_UINT8 data[1]; /* start of data */ -} POSTPACK WMI_STORERECALL_RECALL_CMD; - -typedef PREPACK struct { - A_UINT32 sleep_msec; - A_UINT8 store_after_tx_empty; - A_UINT8 store_after_fresh_beacon_rx; -} POSTPACK WMI_STORERECALL_HOST_READY_CMD; - -typedef PREPACK struct { - A_UINT32 msec_sleep; /* time between power off/on */ - A_UINT32 length; /* length of following data */ - A_UINT8 data[1]; /* start of data */ -} POSTPACK WMI_STORERECALL_STORE_EVENT; - -/* STORE / RECALL Commands AND Events DEFINITION END */ - -typedef enum { - WMI_AP_APSD_DISABLED = 0, - WMI_AP_APSD_ENABLED -} WMI_AP_APSD_STATUS; - -typedef PREPACK struct { - A_UINT8 enable; -} POSTPACK WMI_AP_SET_APSD_CMD; - -typedef enum { - WMI_AP_APSD_NO_DELIVERY_FRAMES_FOR_THIS_TRIGGER = 0x1, -} WMI_AP_APSD_BUFFERED_TRAFFIC_FLAGS; - -typedef PREPACK struct { - A_UINT16 aid; - A_UINT16 bitmap; - A_UINT32 flags; -} POSTPACK WMI_AP_APSD_BUFFERED_TRAFFIC_CMD; - -/* - * These constants are used with A_WLAN_BAND_SET. - */ -#define A_BAND_24GHZ 0 -#define A_BAND_5GHZ 1 -#define A_NUM_BANDS 2 - -#ifndef ATH_TARGET -#include "athendpack.h" -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _WMI_H_ */ diff --git a/drivers/net/wireless/ar6003/include/wmi_thin.h b/drivers/net/wireless/ar6003/include/wmi_thin.h deleted file mode 100644 index 3d48b061a5ab..000000000000 --- a/drivers/net/wireless/ar6003/include/wmi_thin.h +++ /dev/null @@ -1,371 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -/* - * This file contains the definitions of the WMI protocol specified in the - * Wireless Module Interface (WMI). It includes definitions of all the - * commands and events. Commands are messages from the host to the WM. - * Events and Replies are messages from the WM to the host. - * - * Ownership of correctness in regards to WMI commands - * belongs to the host driver and the WM is not required to validate - * parameters for value, proper range, or any other checking. - * - */ - -#ifndef _WMI_THIN_H_ -#define _WMI_THIN_H_ - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef enum { - WMI_THIN_CONFIG_CMDID = 0x8000, // WMI_THIN_RESERVED_START - WMI_THIN_SET_MIB_CMDID, - WMI_THIN_GET_MIB_CMDID, - WMI_THIN_JOIN_CMDID, - WMI_THIN_CONNECT_CMDID, - WMI_THIN_RESET_CMDID, - /* add new CMDID's here */ - WMI_THIN_RESERVED_END_CMDID = 0x8fff // WMI_THIN_RESERVED_END -} WMI_THIN_COMMAND_ID; - -typedef enum{ - TEMPLATE_FRM_FIRST = 0, - TEMPLATE_FRM_PROBE_REQ =TEMPLATE_FRM_FIRST, - TEMPLATE_FRM_BEACON, - TEMPLATE_FRM_PROBE_RESP, - TEMPLATE_FRM_NULL, - TEMPLATE_FRM_QOS_NULL, - TEMPLATE_FRM_PSPOLL, - TEMPLATE_FRM_MAX -}WMI_TEMPLATE_FRM_TYPE; - -/* TEMPLATE_FRM_LEN... represent the maximum allowable - * data lengths (bytes) for each frame type */ -#define TEMPLATE_FRM_LEN_PROBE_REQ (256) /* Symbian dictates a minimum of 256 for these 3 frame types */ -#define TEMPLATE_FRM_LEN_BEACON (256) -#define TEMPLATE_FRM_LEN_PROBE_RESP (256) -#define TEMPLATE_FRM_LEN_NULL (32) -#define TEMPLATE_FRM_LEN_QOS_NULL (32) -#define TEMPLATE_FRM_LEN_PSPOLL (32) -#define TEMPLATE_FRM_LEN_SUM (TEMPLATE_FRM_LEN_PROBE_REQ + TEMPLATE_FRM_LEN_BEACON + TEMPLATE_FRM_LEN_PROBE_RESP + \ - TEMPLATE_FRM_LEN_NULL + TEMPLATE_FRM_LEN_QOS_NULL + TEMPLATE_FRM_LEN_PSPOLL) - - -/* MAC Header Build Rules */ -/* These values allow the host to configure the - * target code that is responsible for constructing - * the MAC header. In cases where the MAC header - * is provided by the host framework, the target - * has a diminished responsibility over what fields - * it must write. This will vary from framework to framework. - * Symbian requires different behavior from MAC80211 which - * requires different behavior from MS Native Wifi. */ -#define WMI_WRT_VER_TYPE 0x00000001 -#define WMI_WRT_DURATION 0x00000002 -#define WMI_WRT_DIRECTION 0x00000004 -#define WMI_WRT_POWER 0x00000008 -#define WMI_WRT_WEP 0x00000010 -#define WMI_WRT_MORE 0x00000020 -#define WMI_WRT_BSSID 0x00000040 -#define WMI_WRT_QOS 0x00000080 -#define WMI_WRT_SEQNO 0x00000100 -#define WMI_GUARD_TX 0x00000200 /* prevents TX ops that are not allowed for a current state */ -#define WMI_WRT_DEFAULT_CONFIG (WMI_WRT_VER_TYPE | WMI_WRT_DURATION | WMI_WRT_DIRECTION | \ - WMI_WRT_POWER | WMI_WRT_MORE | WMI_WRT_WEP | WMI_WRT_BSSID | \ - WMI_WRT_QOS | WMI_WRT_SEQNO | WMI_GUARD_TX) - -/* WMI_THIN_CONFIG_TXCOMPLETE -- Used to configure the params and content for - * TX Complete messages the will come from the Target. these messages are - * disabled by default but can be enabled using this structure and the - * WMI_THIN_CONFIG_CMDID. */ -typedef PREPACK struct { - A_UINT8 version; /* the versioned type of messages to use or 0 to disable */ - A_UINT8 countThreshold; /* msg count threshold triggering a tx complete message */ - A_UINT16 timeThreshold; /* timeout interval in MSEC triggering a tx complete message */ -} POSTPACK WMI_THIN_CONFIG_TXCOMPLETE; - -/* WMI_THIN_CONFIG_DECRYPT_ERR -- Used to configure behavior for received frames - * that have decryption errors. The default behavior is to discard the frame - * without notification. Alternately, the MAC Header is forwarded to the host - * with the failed status. */ -typedef PREPACK struct { - A_UINT8 enable; /* 1 == send decrypt errors to the host, 0 == don't */ - A_UINT8 reserved[3]; /* align padding */ -} POSTPACK WMI_THIN_CONFIG_DECRYPT_ERR; - -/* WMI_THIN_CONFIG_TX_MAC_RULES -- Used to configure behavior for transmitted - * frames that require partial MAC header construction. These rules - * are used by the target to indicate which fields need to be written. */ -typedef PREPACK struct { - A_UINT32 rules; /* combination of WMI_WRT_... values */ -} POSTPACK WMI_THIN_CONFIG_TX_MAC_RULES; - -/* WMI_THIN_CONFIG_RX_FILTER_RULES -- Used to configure behavior for received - * frames as to which frames should get forwarded to the host and which - * should get processed internally. */ -typedef PREPACK struct { - A_UINT32 rules; /* combination of WMI_FILT_... values */ -} POSTPACK WMI_THIN_CONFIG_RX_FILTER_RULES; - - -/* WMI_THIN_CONFIG_CIPHER_ENCAP -- Used to configure behavior for both - * TX and RX frames regarding security cipher encapsulation. The host may specify - * whether or not the firmware is responsible for cipher - * encapsulation. If the firmware is responsible it will add the security header - * and trailer for TX frames and remove the header and trailer for Rx frames. Also, - * the firmware will examine the resource counter if any and behave appropriately when - * a bad value is detected. If the host indicates responsibility for encapsulation - * then it is responsible for all aspects of encapsulation, however the device will - * still perform the encryption and decryption of the frame payload if a key has - * been provided. */ -typedef PREPACK struct { - A_UINT8 enable; /* enables/disables firmware cipher encapsulation */ - A_UINT8 reserved[3]; /* align padding */ -} POSTPACK WMI_THIN_CONFIG_CIPHER_ENCAP; - -/* WMI_THIN_CONFIG_CMD -- Used to contain some combination of the above - * WMI_THIN_CONFIG_... structures. The actual combination is indicated - * by the value of cfgField. Each bit in this field corresponds to - * one of the above structures. */ -typedef PREPACK struct { -#define WMI_THIN_CFG_TXCOMP 0x00000001 -#define WMI_THIN_CFG_DECRYPT 0x00000002 -#define WMI_THIN_UNUSED1 0x00000004 /* used to be WMI_THIN_CFG_MAC_RULES */ -#define WMI_THIN_CFG_FILTER_RULES 0x00000008 -#define WMI_THIN_CFG_CIPHER_ENCAP 0x00000010 - A_UINT32 cfgField; /* combination of WMI_THIN_CFG_... describes contents of config command */ - A_UINT16 length; /* length in bytes of appended sub-commands */ - A_UINT8 reserved[2]; /* align padding */ -} POSTPACK WMI_THIN_CONFIG_CMD; - -/* MIB Access Identifiers tailored for Symbian. */ -enum { - MIB_ID_STA_MAC = 1, // [READONLY] - MIB_ID_RX_LIFE_TIME, // [NOT IMPLEMENTED] - MIB_ID_SLOT_TIME, // [READ/WRITE] - MIB_ID_RTS_THRESHOLD, // [READ/WRITE] - MIB_ID_CTS_TO_SELF, // [READ/WRITE] - MIB_ID_TEMPLATE_FRAME, // [WRITE ONLY] - MIB_ID_RXFRAME_FILTER, // [READ/WRITE] - MIB_ID_BEACON_FILTER_TABLE, // [WRITE ONLY] - MIB_ID_BEACON_FILTER, // [READ/WRITE] - MIB_ID_BEACON_LOST_COUNT, // [WRITE ONLY] - MIB_ID_RSSI_THRESHOLD, // [WRITE ONLY] - MIB_ID_HT_CAP, // [NOT IMPLEMENTED] - MIB_ID_HT_OP, // [NOT IMPLEMENTED] - MIB_ID_HT_2ND_BEACON, // [NOT IMPLEMENTED] - MIB_ID_HT_BLOCK_ACK, // [NOT IMPLEMENTED] - MIB_ID_PREAMBLE, // [READ/WRITE] - /*MIB_ID_GROUP_ADDR_TABLE,*/ - /*MIB_ID_WEP_DEFAULT_KEY_ID */ // satisfied by wmi_addKey_cmd() - /*MIB_ID_TX_POWER */ - /*MIB_ID_ARP_IP_TABLE */ - /*MIB_ID_SLEEP_MODE */ - /*MIB_ID_WAKE_INTERVAL*/ - /*MIB_ID_STAT_TABLE*/ - /*MIB_ID_IBSS_PWR_SAVE*/ - /*MIB_ID_COUNTERS_TABLE*/ - /*MIB_ID_ETHERTYPE_FILTER*/ - /*MIB_ID_BC_UDP_FILTER*/ - -}; - -typedef PREPACK struct { - A_UINT8 addr[ATH_MAC_LEN]; -} POSTPACK WMI_THIN_MIB_STA_MAC; - -typedef PREPACK struct { - A_UINT32 time; // units == msec -} POSTPACK WMI_THIN_MIB_RX_LIFE_TIME; - -typedef PREPACK struct { - A_UINT8 enable; //1 = on, 0 = off -} POSTPACK WMI_THIN_MIB_CTS_TO_SELF; - -typedef PREPACK struct { - A_UINT32 time; // units == usec -} POSTPACK WMI_THIN_MIB_SLOT_TIME; - -typedef PREPACK struct { - A_UINT16 length; //units == bytes -} POSTPACK WMI_THIN_MIB_RTS_THRESHOLD; - -typedef PREPACK struct { - A_UINT8 type; // type of frame - A_UINT8 rate; // tx rate to be used (one of WMI_BIT_RATE) - A_UINT16 length; // num bytes following this structure as the template data -} POSTPACK WMI_THIN_MIB_TEMPLATE_FRAME; - -typedef PREPACK struct { -#define FRAME_FILTER_PROMISCUOUS 0x00000001 -#define FRAME_FILTER_BSSID 0x00000002 - A_UINT32 filterMask; -} POSTPACK WMI_THIN_MIB_RXFRAME_FILTER; - - -#define IE_FILTER_TREATMENT_CHANGE 1 -#define IE_FILTER_TREATMENT_APPEAR 2 - -typedef PREPACK struct { - A_UINT8 ie; - A_UINT8 treatment; -} POSTPACK WMI_THIN_MIB_BEACON_FILTER_TABLE; - -typedef PREPACK struct { - A_UINT8 ie; - A_UINT8 treatment; - A_UINT8 oui[3]; - A_UINT8 type; - A_UINT16 version; -} POSTPACK WMI_THIN_MIB_BEACON_FILTER_TABLE_OUI; - -typedef PREPACK struct { - A_UINT16 numElements; - A_UINT8 entrySize; // sizeof(WMI_THIN_MIB_BEACON_FILTER_TABLE) on host cpu may be 2 may be 4 - A_UINT8 reserved; -} POSTPACK WMI_THIN_MIB_BEACON_FILTER_TABLE_HEADER; - -typedef PREPACK struct { - A_UINT32 count; /* num beacons between deliveries */ - A_UINT8 enable; - A_UINT8 reserved[3]; -} POSTPACK WMI_THIN_MIB_BEACON_FILTER; - -typedef PREPACK struct { - A_UINT32 count; /* num consec lost beacons after which send event */ -} POSTPACK WMI_THIN_MIB_BEACON_LOST_COUNT; - -typedef PREPACK struct { - A_UINT8 rssi; /* the low threshold which can trigger an event warning */ - A_UINT8 tolerance; /* the range above and below the threshold to prevent event flooding to the host. */ - A_UINT8 count; /* the sample count of consecutive frames necessary to trigger an event. */ - A_UINT8 reserved[1]; /* padding */ -} POSTPACK WMI_THIN_MIB_RSSI_THRESHOLD; - - -typedef PREPACK struct { - A_UINT32 cap; - A_UINT32 rxRateField; - A_UINT32 beamForming; - A_UINT8 addr[ATH_MAC_LEN]; - A_UINT8 enable; - A_UINT8 stbc; - A_UINT8 maxAMPDU; - A_UINT8 msduSpacing; - A_UINT8 mcsFeedback; - A_UINT8 antennaSelCap; -} POSTPACK WMI_THIN_MIB_HT_CAP; - -typedef PREPACK struct { - A_UINT32 infoField; - A_UINT32 basicRateField; - A_UINT8 protection; - A_UINT8 secondChanneloffset; - A_UINT8 channelWidth; - A_UINT8 reserved; -} POSTPACK WMI_THIN_MIB_HT_OP; - -typedef PREPACK struct { -#define SECOND_BEACON_PRIMARY 1 -#define SECOND_BEACON_EITHER 2 -#define SECOND_BEACON_SECONDARY 3 - A_UINT8 cfg; - A_UINT8 reserved[3]; /* padding */ -} POSTPACK WMI_THIN_MIB_HT_2ND_BEACON; - -typedef PREPACK struct { - A_UINT8 txTIDField; - A_UINT8 rxTIDField; - A_UINT8 reserved[2]; /* padding */ -} POSTPACK WMI_THIN_MIB_HT_BLOCK_ACK; - -typedef PREPACK struct { - A_UINT8 enableLong; // 1 == long preamble, 0 == short preamble - A_UINT8 reserved[3]; -} POSTPACK WMI_THIN_MIB_PREAMBLE; - -typedef PREPACK struct { - A_UINT16 length; /* the length in bytes of the appended MIB data */ - A_UINT8 mibID; /* the ID of the MIB element being set */ - A_UINT8 reserved; /* align padding */ -} POSTPACK WMI_THIN_SET_MIB_CMD; - -typedef PREPACK struct { - A_UINT8 mibID; /* the ID of the MIB element being set */ - A_UINT8 reserved[3]; /* align padding */ -} POSTPACK WMI_THIN_GET_MIB_CMD; - -typedef PREPACK struct { - A_UINT32 basicRateMask; /* bit mask of basic rates */ - A_UINT32 beaconIntval; /* TUs */ - A_UINT16 atimWindow; /* TUs */ - A_UINT16 channel; /* frequency in Mhz */ - A_UINT8 networkType; /* INFRA_NETWORK | ADHOC_NETWORK */ - A_UINT8 ssidLength; /* 0 - 32 */ - A_UINT8 probe; /* != 0 : issue probe req at start */ - A_UINT8 reserved; /* alignment */ - A_UCHAR ssid[WMI_MAX_SSID_LEN]; - A_UINT8 bssid[ATH_MAC_LEN]; -} POSTPACK WMI_THIN_JOIN_CMD; - -typedef PREPACK struct { - A_UINT16 dtim; /* dtim interval in num beacons */ - A_UINT16 aid; /* 80211 association ID from Assoc resp */ -} POSTPACK WMI_THIN_CONNECT_CMD; - -typedef PREPACK struct { - A_UINT8 reserved[4]; -} POSTPACK WMI_THIN_RESET_CMD; - -typedef enum { - WMI_THIN_EVENTID_RESERVED_START = 0x8000, - WMI_THIN_GET_MIB_EVENTID, - WMI_THIN_JOIN_EVENTID, - - /* Add new THIN EVENTID's here */ - WMI_THIN_EVENTID_RESERVED_END = 0x8fff -} WMI_THIN_EVENT_ID; - -/* Possible values for WMI_THIN_JOIN_EVENT.result */ -typedef enum { - WMI_THIN_JOIN_RES_SUCCESS = 0, // device has joined the network - WMI_THIN_JOIN_RES_FAIL, // device failed for unspecified reason - WMI_THIN_JOIN_RES_TIMEOUT, // device failed due to no beacon rx in time limit - WMI_THIN_JOIN_RES_BAD_PARAM, // device failed due to bad cmd param. - WMI_THIN_JOIN_RES_IBSS_START, // device started new IBSS network. -}WMI_THIN_JOIN_RESULT; - -typedef PREPACK struct { - A_UINT8 result; /* the result of the join cmd. one of WMI_THIN_JOIN_RESULT */ - A_UINT8 reserved[3]; /* alignment */ -} POSTPACK WMI_THIN_JOIN_EVENT; - -#ifdef __cplusplus -} -#endif - -#endif /* _WMI_THIN_H_ */ diff --git a/drivers/net/wireless/ar6003/include/wmix.h b/drivers/net/wireless/ar6003/include/wmix.h deleted file mode 100644 index cc58c5b1e861..000000000000 --- a/drivers/net/wireless/ar6003/include/wmix.h +++ /dev/null @@ -1,280 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. -// -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// -//------------------------------------------------------------------------------ -//============================================================================== -// Author(s): ="Atheros" -//============================================================================== - -/* - * This file contains extensions of the WMI protocol specified in the - * Wireless Module Interface (WMI). It includes definitions of all - * extended commands and events. Extensions include useful commands - * that are not directly related to wireless activities. They may - * be hardware-specific, and they might not be supported on all - * implementations. - * - * Extended WMIX commands are encapsulated in a WMI message with - * cmd=WMI_EXTENSION_CMD. - */ - -#ifndef _WMIX_H_ -#define _WMIX_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef ATH_TARGET -#include "athstartpack.h" -#endif - -#include "dbglog.h" - -/* - * Extended WMI commands are those that are needed during wireless - * operation, but which are not really wireless commands. This allows, - * for instance, platform-specific commands. Extended WMI commands are - * embedded in a WMI command message with WMI_COMMAND_ID=WMI_EXTENSION_CMDID. - * Extended WMI events are similarly embedded in a WMI event message with - * WMI_EVENT_ID=WMI_EXTENSION_EVENTID. - */ -typedef PREPACK struct { - A_UINT32 commandId; -} POSTPACK WMIX_CMD_HDR; - -typedef enum { - WMIX_DSETOPEN_REPLY_CMDID = 0x2001, - WMIX_DSETDATA_REPLY_CMDID, - WMIX_GPIO_OUTPUT_SET_CMDID, - WMIX_GPIO_INPUT_GET_CMDID, - WMIX_GPIO_REGISTER_SET_CMDID, - WMIX_GPIO_REGISTER_GET_CMDID, - WMIX_GPIO_INTR_ACK_CMDID, - WMIX_HB_CHALLENGE_RESP_CMDID, - WMIX_DBGLOG_CFG_MODULE_CMDID, - WMIX_PROF_CFG_CMDID, /* 0x200a */ - WMIX_PROF_ADDR_SET_CMDID, - WMIX_PROF_START_CMDID, - WMIX_PROF_STOP_CMDID, - WMIX_PROF_COUNT_GET_CMDID, -} WMIX_COMMAND_ID; - -typedef enum { - WMIX_DSETOPENREQ_EVENTID = 0x3001, - WMIX_DSETCLOSE_EVENTID, - WMIX_DSETDATAREQ_EVENTID, - WMIX_GPIO_INTR_EVENTID, - WMIX_GPIO_DATA_EVENTID, - WMIX_GPIO_ACK_EVENTID, - WMIX_HB_CHALLENGE_RESP_EVENTID, - WMIX_DBGLOG_EVENTID, - WMIX_PROF_COUNT_EVENTID, -} WMIX_EVENT_ID; - -/* - * =============DataSet support================= - */ - -/* - * WMIX_DSETOPENREQ_EVENTID - * DataSet Open Request Event - */ -typedef PREPACK struct { - A_UINT32 dset_id; - A_UINT32 targ_dset_handle; /* echo'ed, not used by Host, */ - A_UINT32 targ_reply_fn; /* echo'ed, not used by Host, */ - A_UINT32 targ_reply_arg; /* echo'ed, not used by Host, */ -} POSTPACK WMIX_DSETOPENREQ_EVENT; - -/* - * WMIX_DSETCLOSE_EVENTID - * DataSet Close Event - */ -typedef PREPACK struct { - A_UINT32 access_cookie; -} POSTPACK WMIX_DSETCLOSE_EVENT; - -/* - * WMIX_DSETDATAREQ_EVENTID - * DataSet Data Request Event - */ -typedef PREPACK struct { - A_UINT32 access_cookie; - A_UINT32 offset; - A_UINT32 length; - A_UINT32 targ_buf; /* echo'ed, not used by Host, */ - A_UINT32 targ_reply_fn; /* echo'ed, not used by Host, */ - A_UINT32 targ_reply_arg; /* echo'ed, not used by Host, */ -} POSTPACK WMIX_DSETDATAREQ_EVENT; - -typedef PREPACK struct { - A_UINT32 status; - A_UINT32 targ_dset_handle; - A_UINT32 targ_reply_fn; - A_UINT32 targ_reply_arg; - A_UINT32 access_cookie; - A_UINT32 size; - A_UINT32 version; -} POSTPACK WMIX_DSETOPEN_REPLY_CMD; - -typedef PREPACK struct { - A_UINT32 status; - A_UINT32 targ_buf; - A_UINT32 targ_reply_fn; - A_UINT32 targ_reply_arg; - A_UINT32 length; - A_UINT8 buf[1]; -} POSTPACK WMIX_DSETDATA_REPLY_CMD; - - -/* - * =============GPIO support================= - * NB: Some of the WMIX APIs use a 32-bit mask. On Targets that support - * more than 32 GPIO pins, those APIs only support the first 32 GPIO pins. - */ - -#include "gpio.h" - -/* - * Set GPIO pin output state. - * In order for output to be driven, a pin must be enabled for output. - * This can be done during initialization through the GPIO Configuration - * DataSet, or during operation with the enable_mask. - * - * If a request is made to simultaneously set/clear or set/disable or - * clear/disable or disable/enable, results are undefined. - */ -typedef PREPACK struct { - A_UINT32 set_mask; /* pins to set */ - A_UINT32 clear_mask; /* pins to clear */ - A_UINT32 enable_mask; /* pins to enable for output */ - A_UINT32 disable_mask; /* pins to disable/tristate */ -} POSTPACK WMIX_GPIO_OUTPUT_SET_CMD; - -/* - * Set a GPIO register. For debug/exceptional cases. - * Values for gpioreg_id are GPIO_ID_*, defined in a - * platform-dependent header, gpio.h. - */ -typedef PREPACK struct { - A_UINT32 gpioreg_id; /* GPIO register ID */ - A_UINT32 value; /* value to write */ -} POSTPACK WMIX_GPIO_REGISTER_SET_CMD; - -/* Get a GPIO register. For debug/exceptional cases. */ -typedef PREPACK struct { - A_UINT32 gpioreg_id; /* GPIO register to read */ -} POSTPACK WMIX_GPIO_REGISTER_GET_CMD; - -/* - * Host acknowledges and re-arms GPIO interrupts. A single - * message should be used to acknowledge all interrupts that - * were delivered in an earlier WMIX_GPIO_INTR_EVENT message. - */ -typedef PREPACK struct { - A_UINT32 ack_mask; /* interrupts to acknowledge */ -} POSTPACK WMIX_GPIO_INTR_ACK_CMD; - -/* - * Target informs Host of GPIO interrupts that have ocurred since the - * last WMIX_GIPO_INTR_ACK_CMD was received. Additional information -- - * the current GPIO input values is provided -- in order to support - * use of a GPIO interrupt as a Data Valid signal for other GPIO pins. - */ -typedef PREPACK struct { - A_UINT32 intr_mask; /* pending GPIO interrupts */ - A_UINT32 input_values; /* recent GPIO input values */ -} POSTPACK WMIX_GPIO_INTR_EVENT; - -/* - * Target responds to Host's earlier WMIX_GPIO_INPUT_GET_CMDID request - * using a GPIO_DATA_EVENT with - * value set to the mask of GPIO pin inputs and - * reg_id set to GPIO_ID_NONE - * - * - * Target responds to Hosts's earlier WMIX_GPIO_REGISTER_GET_CMDID request - * using a GPIO_DATA_EVENT with - * value set to the value of the requested register and - * reg_id identifying the register (reflects the original request) - * NB: reg_id supports the future possibility of unsolicited - * WMIX_GPIO_DATA_EVENTs (for polling GPIO input), and it may - * simplify Host GPIO support. - */ -typedef PREPACK struct { - A_UINT32 value; - A_UINT32 reg_id; -} POSTPACK WMIX_GPIO_DATA_EVENT; - -/* - * =============Error Detection support================= - */ - -/* - * WMIX_HB_CHALLENGE_RESP_CMDID - * Heartbeat Challenge Response command - */ -typedef PREPACK struct { - A_UINT32 cookie; - A_UINT32 source; -} POSTPACK WMIX_HB_CHALLENGE_RESP_CMD; - -/* - * WMIX_HB_CHALLENGE_RESP_EVENTID - * Heartbeat Challenge Response Event - */ -#define WMIX_HB_CHALLENGE_RESP_EVENT WMIX_HB_CHALLENGE_RESP_CMD - -typedef PREPACK struct { - struct dbglog_config_s config; -} POSTPACK WMIX_DBGLOG_CFG_MODULE_CMD; - -/* - * =============Target Profiling support================= - */ - -typedef PREPACK struct { - A_UINT32 period; /* Time (in 30.5us ticks) between samples */ - A_UINT32 nbins; -} POSTPACK WMIX_PROF_CFG_CMD; - -typedef PREPACK struct { - A_UINT32 addr; -} POSTPACK WMIX_PROF_ADDR_SET_CMD; - -/* - * Target responds to Hosts's earlier WMIX_PROF_COUNT_GET_CMDID request - * using a WMIX_PROF_COUNT_EVENT with - * addr set to the next address - * count set to the corresponding count - */ -typedef PREPACK struct { - A_UINT32 addr; - A_UINT32 count; -} POSTPACK WMIX_PROF_COUNT_EVENT; - -#ifndef ATH_TARGET -#include "athendpack.h" -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _WMIX_H_ */ diff --git a/drivers/net/wireless/esp8089/Kconfig b/drivers/net/wireless/esp8089/Kconfig deleted file mode 100755 index 620c5cfe719d..000000000000 --- a/drivers/net/wireless/esp8089/Kconfig +++ /dev/null @@ -1,22 +0,0 @@ - config ESP8089 - depends on WLAN_80211 && MMC - select WIRELESS_EXT - select WEXT_PRIV - select CFG80211 - select MAC80211 - select NL80211_TESTMODE - bool "Espressif 8089 sdio Wi-Fi" - ---help--- - Espressif 8089 sdio Wi-Fi support - - config BK3515A_COMBO - depends on ESP8089 - select WIRELESS_EXT - select WEXT_PRIV - select CFG80211 - select MAC80211 - select NL80211_TESTMODE - bool "Espressif 8089 sdio Wi-Fi combo with BK3515A bluetooth" - ---help--- - RK Wi-Fi+BT+[GPS optional] Combo module support - diff --git a/drivers/net/wireless/mt5931/Kconfig b/drivers/net/wireless/mt5931/Kconfig deleted file mode 100755 index 4835b1783d8e..000000000000 --- a/drivers/net/wireless/mt5931/Kconfig +++ /dev/null @@ -1,19 +0,0 @@ - config MT5931 - depends on WLAN_80211 && MMC - select WIRELESS_EXT - select WEXT_PRIV - select CFG80211 - select NL80211_TESTMODE - bool "MediaTek MT5931 WiFi" - ---help--- - MediaTek MT5931 WiFi - - config MT5931_MT6622 - depends on WLAN_80211 && MMC - select WIRELESS_EXT - select WEXT_PRIV - select CFG80211 - select NL80211_TESTMODE - bool "MediaTek MT5931 & MT6622 WiFi Bluetooth Combo" - ---help--- - MediaTek MT5931 & MT6622 WiFi Bluetooth Combo diff --git a/drivers/net/wireless/mt5931/Makefile b/drivers/net/wireless/mt5931/Makefile deleted file mode 100755 index eaf16c44529c..000000000000 --- a/drivers/net/wireless/mt5931/Makefile +++ /dev/null @@ -1,150 +0,0 @@ -# --------------------------------------------------- -# Compile Options -# --------------------------------------------------- - -#include $(MTK_PATH_BUILD)/Makefile -#ccflags-y += -DLINUX -DMT6620 -ccflags-y += -DLINUX -DMT5931 ##mark skynine modify DMT6620-->DMT5931 - -ifeq ($(MTK_WAPI_SUPPORT), yes) - ccflags-y += -DCFG_SUPPORT_WAPI=1 -else - ccflags-y += -DCFG_SUPPORT_WAPI=0 -endif - -ifeq ($(HAVE_XLOG_FEATURE), yes) - ccflags-y += -DCFG_SUPPORT_XLOG=1 -else - ccflags-y += -DCFG_SUPPORT_XLOG=0 -endif - -ifeq ($(HAVE_AEE_FEATURE), yes) - ccflags-y += -DCFG_SUPPORT_AEE=1 -else - ccflags-y += -DCFG_SUPPORT_AEE=0 -endif - -#ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF_SDIO1), y) -# ccflags-y += -D_HIF_SDIO=1 -#endif - -#MODULE_NAME := wlan_mt6620 -MODULE_NAME := wlan ##mark skynine modify MT6620-->MT5931 - -ccflags-y += -D_HIF_SDIO=1 - -ccflags-y += -DRSSI_ENHANCE=1 - -ccflags-y += -DDBG=0 -ccflags-y += -I$(src)/os -I$(src)/os/linux/include -I$(src)/os/linux/hif/sdio/include -ccflags-y += -I$(src)/include -I$(src)/include/nic -I$(src)/include/mgmt - -#obj-$(CONFIG_MTK_COMBO_WIFI) += $(MODULE_NAME).o -#obj-$(CONFIG_MT5931) += $(MODULE_NAME).o -#obj-y += $(MODULE_NAME).o - -# --------------------------------------------------- -# Directory List -# --------------------------------------------------- -COMMON_DIR := common/ -OS_DIR := os/linux/ -HIF_DIR := os/linux/hif/sdio/ -NIC_DIR := nic/ -MGMT_DIR := mgmt/ - - -# --------------------------------------------------- -# Objects List -# --------------------------------------------------- - -COMMON_OBJS := $(COMMON_DIR)dump.o \ - $(COMMON_DIR)wlan_lib.o \ - $(COMMON_DIR)wlan_oid.o \ - $(COMMON_DIR)wlan_bow.o - -NIC_OBJS := $(NIC_DIR)nic.o \ - $(NIC_DIR)nic_tx.o \ - $(NIC_DIR)nic_rx.o \ - $(NIC_DIR)nic_pwr_mgt.o \ - $(NIC_DIR)cmd_buf.o \ - $(NIC_DIR)que_mgt.o \ - $(NIC_DIR)nic_cmd_event.o - -OS_OBJS := $(OS_DIR)gl_init.o \ - $(OS_DIR)gl_kal.o \ - $(OS_DIR)gl_bow.o \ - $(OS_DIR)gl_wext.o \ - $(OS_DIR)gl_wext_priv.o \ - $(OS_DIR)gl_rst.o \ - $(OS_DIR)gl_cfg80211.o \ - $(OS_DIR)platform.o - -MGMT_OBJS := $(MGMT_DIR)ais_fsm.o \ - $(MGMT_DIR)aaa_fsm.o \ - $(MGMT_DIR)assoc.o \ - $(MGMT_DIR)auth.o \ - $(MGMT_DIR)bss.o \ - $(MGMT_DIR)cnm.o \ - $(MGMT_DIR)cnm_timer.o \ - $(MGMT_DIR)cnm_mem.o \ - $(MGMT_DIR)hem_mbox.o \ - $(MGMT_DIR)mib.o \ - $(MGMT_DIR)privacy.o \ - $(MGMT_DIR)rate.o \ - $(MGMT_DIR)rlm.o \ - $(MGMT_DIR)rlm_domain.o \ - $(MGMT_DIR)rlm_obss.o \ - $(MGMT_DIR)rlm_protection.o \ - $(MGMT_DIR)rsn.o \ - $(MGMT_DIR)saa_fsm.o \ - $(MGMT_DIR)scan.o \ - $(MGMT_DIR)scan_fsm.o \ - $(MGMT_DIR)sec_fsm.o \ - $(MGMT_DIR)swcr.o \ - $(MGMT_DIR)roaming_fsm.o - -# --------------------------------------------------- -# P2P Objects List -# --------------------------------------------------- - -COMMON_OBJS += $(COMMON_DIR)wlan_p2p.o - -NIC_OBJS += $(NIC_DIR)p2p_nic.o - -OS_OBJS += $(OS_DIR)gl_p2p.o \ - $(OS_DIR)gl_p2p_cfg80211.o \ - $(OS_DIR)gl_p2p_init.o \ - $(OS_DIR)gl_p2p_kal.o - -MGMT_OBJS += $(MGMT_DIR)p2p_assoc.o \ - $(MGMT_DIR)p2p_bss.o \ - $(MGMT_DIR)p2p_fsm.o \ - $(MGMT_DIR)p2p_func.o \ - $(MGMT_DIR)p2p_rlm.o \ - $(MGMT_DIR)p2p_rlm_obss.o \ - $(MGMT_DIR)p2p_scan.o \ - $(MGMT_DIR)p2p_ie.o \ - $(MGMT_DIR)p2p_state.o - - -ifeq ($(MTK_WAPI_SUPPORT), yes) -MGMT_OBJS += $(MGMT_DIR)wapi.o -endif - -ifeq ($(WLAN_PROC), y) -OS_OBJS += gl_proc.o -endif - -HIF_OBJS := $(HIF_DIR)arm.o \ - $(HIF_DIR)sdio.o - -obj-y += $(COMMON_OBJS) -obj-y += $(NIC_OBJS) -obj-y += $(OS_OBJS) -obj-y += $(HIF_OBJS) -obj-y += $(MGMT_OBJS) - - -clean: - rm $(HIF_OBJS) $(OS_OBJS) $(NIC_OBJS) $(MGMT_OBJS) $(COMMON_OBJS) - diff --git a/drivers/net/wireless/mt5931/Makefile.module b/drivers/net/wireless/mt5931/Makefile.module deleted file mode 100755 index 1645ae2424a6..000000000000 --- a/drivers/net/wireless/mt5931/Makefile.module +++ /dev/null @@ -1,152 +0,0 @@ -# --------------------------------------------------- -# Compile Options -# --------------------------------------------------- - -#include $(MTK_PATH_BUILD)/Makefile -#ccflags-y += -DLINUX -DMT6620 -ccflags-y += -DLINUX -DMT5931 ##mark skynine modify DMT6620-->DMT5931 - -ifeq ($(MTK_WAPI_SUPPORT), yes) - ccflags-y += -DCFG_SUPPORT_WAPI=1 -else - ccflags-y += -DCFG_SUPPORT_WAPI=0 -endif - -ifeq ($(HAVE_XLOG_FEATURE), yes) - ccflags-y += -DCFG_SUPPORT_XLOG=1 -else - ccflags-y += -DCFG_SUPPORT_XLOG=0 -endif - -ifeq ($(HAVE_AEE_FEATURE), yes) - ccflags-y += -DCFG_SUPPORT_AEE=1 -else - ccflags-y += -DCFG_SUPPORT_AEE=0 -endif - -#ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF_SDIO1), y) -# ccflags-y += -D_HIF_SDIO=1 -#endif - -#MODULE_NAME := wlan_mt6620 -MODULE_NAME := wlan - -ccflags-y += -D_HIF_SDIO=1 - -ccflags-y += -DDBG=0 -ccflags-y += -I$(src)/os -I$(src)/os/linux/include -I$(src)/os/linux/hif/sdio/include -ccflags-y += -I$(src)/include -I$(src)/include/nic -I$(src)/include/mgmt - -#obj-$(CONFIG_MTK_COMBO_WIFI) += $(MODULE_NAME).o -#obj-$(CONFIG_MT5931) += $(MODULE_NAME).o -obj-m += $(MODULE_NAME).o - -# --------------------------------------------------- -# Directory List -# --------------------------------------------------- -COMMON_DIR := common/ -OS_DIR := os/linux/ -HIF_DIR := os/linux/hif/sdio/ -NIC_DIR := nic/ -MGMT_DIR := mgmt/ - - -# --------------------------------------------------- -# Objects List -# --------------------------------------------------- - -COMMON_OBJS := $(COMMON_DIR)dump.o \ - $(COMMON_DIR)wlan_lib.o \ - $(COMMON_DIR)wlan_oid.o \ - $(COMMON_DIR)wlan_bow.o - -NIC_OBJS := $(NIC_DIR)nic.o \ - $(NIC_DIR)nic_tx.o \ - $(NIC_DIR)nic_rx.o \ - $(NIC_DIR)nic_pwr_mgt.o \ - $(NIC_DIR)cmd_buf.o \ - $(NIC_DIR)que_mgt.o \ - $(NIC_DIR)nic_cmd_event.o - -OS_OBJS := $(OS_DIR)gl_init.o \ - $(OS_DIR)gl_kal.o \ - $(OS_DIR)gl_bow.o \ - $(OS_DIR)gl_wext.o \ - $(OS_DIR)gl_wext_priv.o \ - $(OS_DIR)gl_rst.o \ - $(OS_DIR)gl_cfg80211.o \ - $(OS_DIR)platform.o - -MGMT_OBJS := $(MGMT_DIR)ais_fsm.o \ - $(MGMT_DIR)aaa_fsm.o \ - $(MGMT_DIR)assoc.o \ - $(MGMT_DIR)auth.o \ - $(MGMT_DIR)bss.o \ - $(MGMT_DIR)cnm.o \ - $(MGMT_DIR)cnm_timer.o \ - $(MGMT_DIR)cnm_mem.o \ - $(MGMT_DIR)hem_mbox.o \ - $(MGMT_DIR)mib.o \ - $(MGMT_DIR)privacy.o \ - $(MGMT_DIR)rate.o \ - $(MGMT_DIR)rlm.o \ - $(MGMT_DIR)rlm_domain.o \ - $(MGMT_DIR)rlm_obss.o \ - $(MGMT_DIR)rlm_protection.o \ - $(MGMT_DIR)rsn.o \ - $(MGMT_DIR)saa_fsm.o \ - $(MGMT_DIR)scan.o \ - $(MGMT_DIR)scan_fsm.o \ - $(MGMT_DIR)sec_fsm.o \ - $(MGMT_DIR)swcr.o \ - $(MGMT_DIR)roaming_fsm.o - -# --------------------------------------------------- -# P2P Objects List -# --------------------------------------------------- - -COMMON_OBJS += $(COMMON_DIR)wlan_p2p.o - -NIC_OBJS += $(NIC_DIR)p2p_nic.o - -OS_OBJS += $(OS_DIR)gl_p2p.o \ - $(OS_DIR)gl_p2p_cfg80211.o \ - $(OS_DIR)gl_p2p_init.o \ - $(OS_DIR)gl_p2p_kal.o - -MGMT_OBJS += $(MGMT_DIR)p2p_assoc.o \ - $(MGMT_DIR)p2p_bss.o \ - $(MGMT_DIR)p2p_fsm.o \ - $(MGMT_DIR)p2p_func.o \ - $(MGMT_DIR)p2p_rlm.o \ - $(MGMT_DIR)p2p_rlm_obss.o \ - $(MGMT_DIR)p2p_scan.o \ - $(MGMT_DIR)p2p_ie.o \ - $(MGMT_DIR)p2p_state.o - - -ifeq ($(MTK_WAPI_SUPPORT), yes) -MGMT_OBJS += $(MGMT_DIR)wapi.o -endif - -ifeq ($(WLAN_PROC), y) -OS_OBJS += gl_proc.o -endif - -HIF_OBJS := $(HIF_DIR)arm.o \ - $(HIF_DIR)sdio.o - -$(MODULE_NAME)-y += $(COMMON_OBJS) -$(MODULE_NAME)-y += $(NIC_OBJS) -$(MODULE_NAME)-y += $(OS_OBJS) -$(MODULE_NAME)-y += $(HIF_OBJS) -$(MODULE_NAME)-y += $(MGMT_OBJS) - -KERNEL_DIR = /home/hwg/rk2928_kernel_M7000HC/kernel - -all: - make -C $(KERNEL_DIR) M=`pwd` modules - -clean: - rm $(HIF_OBJS) $(OS_OBJS) $(NIC_OBJS) $(MGMT_OBJS) $(COMMON_OBJS) - diff --git a/drivers/net/wireless/mt5931/common/dump.c b/drivers/net/wireless/mt5931/common/dump.c deleted file mode 100755 index 95f2d7f25b76..000000000000 --- a/drivers/net/wireless/mt5931/common/dump.c +++ /dev/null @@ -1,539 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/common/dump.c#1 $ -*/ - -/*! \file "dump.c" - \brief Provide memory dump function for debugging. - - Provide memory dump function for debugging. -*/ - - - -/* -** $Log: dump.c $ - * - * 11 24 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * Adjust code for DBG and CONFIG_XLOG. - * - * 11 10 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * Using the new XLOG define for dum Memory. - * - * 11 03 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * Add dumpMemory8 at XLOG support. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 19:58:51 GMT mtk01426 -** Init develop -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#if DBG -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to dump a segment of memory in bytes. -* -* \param[in] pucStartAddr Pointer to the starting address of the memory to be dumped. -* \param[in] u4Length Length of the memory to be dumped. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -dumpMemory8 ( - IN PUINT_8 pucStartAddr, - IN UINT_32 u4Length - ) -{ - ASSERT(pucStartAddr); - - LOG_FUNC("DUMP8 ADDRESS: %08lx, Length: %ld\n", (UINT_32)pucStartAddr, u4Length); - - while (u4Length > 0) { - if (u4Length >= 16) { - LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11], - pucStartAddr[12], pucStartAddr[13], pucStartAddr[14], pucStartAddr[15]); - u4Length -= 16; - pucStartAddr += 16; - } - else { - switch (u4Length) { - case 1: - LOG_FUNC("(%08lx) %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0]); - break; - case 2: - LOG_FUNC("(%08lx) %02x %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0], pucStartAddr[ 1]); - break; - case 3: - LOG_FUNC("(%08lx) %02x %02x %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2]); - break; - case 4: - LOG_FUNC("(%08lx) %02x %02x %02x %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3]); - break; - case 5: - LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4]); - break; - case 6: - LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5]); - break; - case 7: - LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6]); - break; - case 8: - LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7]); - break; - case 9: - LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8]); - break; - case 10: - LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8], pucStartAddr[ 9]); - break; - case 11: - LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10]); - break; - case 12: - LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11]); - break; - case 13: - LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11], - pucStartAddr[12]); - break; - case 14: - LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11], - pucStartAddr[12], pucStartAddr[13]); - break; - case 15: - LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x\n", - (UINT_32)pucStartAddr, - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11], - pucStartAddr[12], pucStartAddr[13], pucStartAddr[14]); - break; - default: - break; - } - u4Length = 0; - } - } - - LOG_FUNC("\n"); - - return; -} /* end of dumpMemory8() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to dump a segment of memory in double words. -* -* \param[in] pucStartAddr Pointer to the starting address of the memory to be dumped. -* \param[in] u4Length Length of the memory to be dumped. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -dumpMemory32 ( - IN PUINT_32 pu4StartAddr, - IN UINT_32 u4Length) -{ - PUINT_8 pucAddr; - - - ASSERT(pu4StartAddr); - - LOG_FUNC("DUMP32 ADDRESS: %08lx, Length: %ld\n", (UINT_32)pu4StartAddr, u4Length); - - if (IS_NOT_ALIGN_4((UINT_32)pu4StartAddr)) { - UINT_32 u4ProtrudeLen = sizeof(UINT_32) - ((UINT_32)pu4StartAddr % 4); - - - u4ProtrudeLen = ((u4Length < u4ProtrudeLen) ? u4Length: u4ProtrudeLen); - LOG_FUNC("pu4StartAddr is not at DW boundary.\n"); - pucAddr = (PUINT_8) &pu4StartAddr[0]; - - switch (u4ProtrudeLen) { - case 1: - LOG_FUNC("(%08lx) %02x------\n", - (UINT_32)pu4StartAddr, - pucAddr[0]); - break; - case 2: - LOG_FUNC("(%08lx) %02x%02x----\n", - (UINT_32)pu4StartAddr, - pucAddr[1], pucAddr[0]); - break; - case 3: - LOG_FUNC("(%08lx) %02x%02x%02x--\n", - (UINT_32)pu4StartAddr, - pucAddr[2], pucAddr[1], pucAddr[0]); - break; - default: - break; - } - - u4Length -= u4ProtrudeLen; - pu4StartAddr = (PUINT_32)((UINT_32)pu4StartAddr + u4ProtrudeLen); - } - - while (u4Length > 0) { - if (u4Length >= 16) { - LOG_FUNC("(%08lx) %08lx %08lx %08lx %08lx\n", - (UINT_32)pu4StartAddr, - pu4StartAddr[0], pu4StartAddr[1], pu4StartAddr[2], pu4StartAddr[3]); - pu4StartAddr += 4; - u4Length -= 16; - } - else { - switch (u4Length) { - case 1: - pucAddr = (PUINT_8) &pu4StartAddr[0]; - LOG_FUNC("(%08lx) ------%02x\n", - (UINT_32)pu4StartAddr, - pucAddr[0]); - break; - case 2: - pucAddr = (PUINT_8) &pu4StartAddr[0]; - LOG_FUNC("(%08lx) ----%02x%02x\n", - (UINT_32)pu4StartAddr, - pucAddr[1], pucAddr[0]); - break; - case 3: - pucAddr = (PUINT_8) &pu4StartAddr[0]; - LOG_FUNC("(%08lx) --%02x%02x%02x\n", - (UINT_32)pu4StartAddr, - pucAddr[2], pucAddr[1], pucAddr[0]); - break; - case 4: - LOG_FUNC("(%08lx) %08lx\n", - (UINT_32)pu4StartAddr, - pu4StartAddr[0]); - break; - case 5: - pucAddr = (PUINT_8) &pu4StartAddr[1]; - LOG_FUNC("(%08lx) %08lx ------%02x\n", - (UINT_32)pu4StartAddr, - pu4StartAddr[0], - pucAddr[0]); - break; - case 6: - pucAddr = (PUINT_8) &pu4StartAddr[1]; - LOG_FUNC("(%08lx) %08lx ----%02x%02x\n", - (UINT_32)pu4StartAddr, - pu4StartAddr[0], - pucAddr[1], pucAddr[0]); - break; - case 7: - pucAddr = (PUINT_8) &pu4StartAddr[1]; - LOG_FUNC("(%08lx) %08lx --%02x%02x%02x\n", - (UINT_32)pu4StartAddr, - pu4StartAddr[0], - pucAddr[2], pucAddr[1], pucAddr[0]); - break; - case 8: - LOG_FUNC("(%08lx) %08lx %08lx\n", - (UINT_32)pu4StartAddr, - pu4StartAddr[0], pu4StartAddr[1]); - break; - case 9: - pucAddr = (PUINT_8) &pu4StartAddr[2]; - LOG_FUNC("(%08lx) %08lx %08lx ------%02x\n", - (UINT_32)pu4StartAddr, - pu4StartAddr[0], pu4StartAddr[1], - pucAddr[0]); - break; - case 10: - pucAddr = (PUINT_8) &pu4StartAddr[2]; - LOG_FUNC("(%08lx) %08lx %08lx ----%02x%02x\n", - (UINT_32)pu4StartAddr, - pu4StartAddr[0], pu4StartAddr[1], - pucAddr[1], pucAddr[0]); - break; - case 11: - pucAddr = (PUINT_8) &pu4StartAddr[2]; - LOG_FUNC("(%08lx) %08lx %08lx --%02x%02x%02x\n", - (UINT_32)pu4StartAddr, - pu4StartAddr[0], pu4StartAddr[1], - pucAddr[2], pucAddr[1], pucAddr[0]); - break; - case 12: - LOG_FUNC("(%08lx) %08lx %08lx %08lx\n", - (UINT_32)pu4StartAddr, - pu4StartAddr[0], pu4StartAddr[1], pu4StartAddr[2]); - break; - case 13: - pucAddr = (PUINT_8) &pu4StartAddr[3]; - LOG_FUNC("(%08lx) %08lx %08lx %08lx ------%02x\n", - (UINT_32)pu4StartAddr, - pu4StartAddr[0], pu4StartAddr[1], pu4StartAddr[2], - pucAddr[0]); - break; - case 14: - pucAddr = (PUINT_8) &pu4StartAddr[3]; - LOG_FUNC("(%08lx) %08lx %08lx %08lx ----%02x%02x\n", - (UINT_32)pu4StartAddr, - pu4StartAddr[0], pu4StartAddr[1], pu4StartAddr[2], - pucAddr[1], pucAddr[0]); - break; - case 15: - pucAddr = (PUINT_8) &pu4StartAddr[3]; - LOG_FUNC("(%08lx) %08lx %08lx %08lx --%02x%02x%02x\n", - (UINT_32)pu4StartAddr, - pu4StartAddr[0], pu4StartAddr[1], pu4StartAddr[2], - pucAddr[2], pucAddr[1], pucAddr[0]); - break; - default: - break; - } - u4Length = 0; - } - } - - return; -} /* end of dumpMemory32() */ -#elif CFG_SUPPORT_XLOG - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to dump a segment of memory in bytes. -* -* \param[in] pucStartAddr Pointer to the starting address of the memory to be dumped. -* \param[in] u4Length Length of the memory to be dumped. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -dumpMemory8 ( - IN UINT_32 log_level, - IN PUINT_8 pucStartAddr, - IN UINT_32 u4Length - ) -{ - ASSERT(pucStartAddr); - - if (log_level == ANDROID_LOG_ERROR) { - xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, "DUMP8 ADDRESS: %08lx, Length: %ld\n", (UINT_32)pucStartAddr, u4Length); - } - else if (log_level == ANDROID_LOG_WARN) { - xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, "DUMP8 ADDRESS: %08lx, Length: %ld\n", (UINT_32)pucStartAddr, u4Length); - } - else if (log_level == ANDROID_LOG_INFO) { - xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, "DUMP8 ADDRESS: %08lx, Length: %ld\n", (UINT_32)pucStartAddr, u4Length); - } - else if (log_level == ANDROID_LOG_DEBUG) { - xlog_printk(ANDROID_LOG_DEBUG, XLOG_TAG, "DUMP8 ADDRESS: %08lx, Length: %ld\n", (UINT_32)pucStartAddr, u4Length); - } - else if (log_level == ANDROID_LOG_VERBOSE) { - xlog_printk(ANDROID_LOG_VERBOSE, XLOG_TAG, "DUMP8 ADDRESS: %08lx, Length: %ld\n", (UINT_32)pucStartAddr, u4Length); - } - - while (u4Length > 0) { - if (u4Length >= 16) { - XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x %02x\n", - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11], - pucStartAddr[12], pucStartAddr[13], pucStartAddr[14], pucStartAddr[15]); - u4Length -= 16; - pucStartAddr += 16; - } - else { - switch (u4Length) { - case 1: - XLOG_FUNC(log_level, "%02x\n", - pucStartAddr[ 0]); - break; - case 2: - XLOG_FUNC(log_level, "%02x %02x\n", - pucStartAddr[ 0], pucStartAddr[ 1]); - break; - case 3: - XLOG_FUNC(log_level, "%02x %02x %02x\n", - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2]); - break; - case 4: - XLOG_FUNC(log_level, "%02x %02x %02x %02x\n", - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3]); - break; - case 5: - XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x\n", - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4]); - break; - case 6: - XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x\n", - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5]); - break; - case 7: - XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x\n", - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6]); - break; - case 8: - XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x\n", - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7]); - break; - case 9: - XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x\n", - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8]); - break; - case 10: - XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x\n", - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8], pucStartAddr[ 9]); - break; - case 11: - XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x\n", - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10]); - break; - case 12: - XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x\n", - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11]); - break; - case 13: - XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x\n", - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11], - pucStartAddr[12]); - break; - case 14: - XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x\n", - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11], - pucStartAddr[12], pucStartAddr[13]); - break; - case 15: - XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x\n", - pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3], - pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7], - pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11], - pucStartAddr[12], pucStartAddr[13], pucStartAddr[14]); - break; - default: - break; - } - u4Length = 0; - } - } - - - return; -} /* end of dumpMemory8() */ -#endif /* DBG */ - - diff --git a/drivers/net/wireless/mt5931/common/wlan_bow.c b/drivers/net/wireless/mt5931/common/wlan_bow.c deleted file mode 100755 index 41b179dde04e..000000000000 --- a/drivers/net/wireless/mt5931/common/wlan_bow.c +++ /dev/null @@ -1,3898 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/common/wlan_bow.c#1 $ -*/ - -/*! \file wlan_bow.c - \brief This file contains the 802.11 PAL commands processing routines for - MediaTek Inc. 802.11 Wireless LAN Adapters. -*/ - - - -/* -** $Log: wlan_bow.c $ - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 01 16 2012 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Support BOW for 5GHz band. - * - * 01 09 2012 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * [ALPS00110632] [Rose][LCA42][Cross Feature][Bluetooth]The "KE" pops up after the device reboots automatically.(once) - * - * Fix bow link disconnected event dereference. - * - * 09 29 2011 cm.chang - * NULL - * Change the function prototype of rlmDomainGetChnlList() - * - * 07 06 2011 terry.wu - * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment - * Improve BoW connection establishment speed. - * - * 06 23 2011 cp.wu - * [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module - * change parameter name from PeerAddr to BSSID - * - * 06 21 2011 terry.wu - * NULL - * Fix BoW KE. - * - * 06 20 2011 terry.wu - * NULL - * Add BoW Rate Limitation. - * - * 06 20 2011 cp.wu - * [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module - * 1. specify target's BSSID when requesting channel privilege. - * 2. pass BSSID information to firmware domain - * - * 06 17 2011 terry.wu - * NULL - * Add BoW 11N support. - * - * 06 07 2011 cp.wu - * [WCXRP00000681] [MT5931][Firmware] HIF code size reduction - * aware more compile options. - * - * 05 25 2011 terry.wu - * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment - * Add BoW Cancel Scan Request and Turn On deactive network function. - * - * 05 23 2011 terry.wu - * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment - * Add some BoW error handling. - * - * 05 22 2011 terry.wu - * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment - * . - * - * 05 22 2011 terry.wu - * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment - * Only reply probe response to its peer or mached SSID for BoW AP. - * - * 05 22 2011 terry.wu - * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment - * Add BoW SAA retry and disable disconnect event when AAA fail . - * - * 05 21 2011 terry.wu - * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment - * Protect BoW connection establishment. - * - * 05 17 2011 terry.wu - * [WCXRP00000730] [MT6620 Wi-Fi][BoW] Send deauth while disconnecting - * Send deauth while disconnecting BoW link. - * - * 05 17 2011 terry.wu - * [WCXRP00000707] [MT6620 Wi-Fi][Driver] Fix BoW Multiple Physical Link connect/disconnect issue - * Fix wrong StaRec state of BoW . - * - * 05 06 2011 terry.wu - * [WCXRP00000707] [MT6620 Wi-Fi][Driver] Fix BoW Multiple Physical Link connect/disconnect issue - * Fix BoW Multiple Physical Link connect/disconnect issue. - * - * 05 03 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Use kalMemAlloc to allocate event buffer for kalIndicateBOWEvent. - * - * 04 15 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Fix prAssocRspSwRfb casting. - * - * 04 15 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add BOW short range mode. - * - * 04 12 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add WMM IE for BOW initiator data. - * - * 04 10 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Change Link disconnection event procedure for hotspot and change skb length check to 1514 bytes. - * - * 04 09 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Change Link connection event procedure and change skb length check to 1512 bytes. - * - * 03 28 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Simplify link disconnected routine, remove link disconnected other routine. - * - * 03 27 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Support multiple physical link. - * - * 03 27 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add new feature - multiple physical link support. - * - * 02 22 2011 wh.su - * [WCXRP00000486] [MT6620 Wi-Fi][BOW] Fixed the bow send frame but not encrypted issue - * fixed the BOW packet sending without encrypted issue. - * - * 02 21 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Fix BOW link disconnection bug. - * - * 02 16 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add bowNotifyAllLinkDisconnected interface and change channel grant procedure for bow starting. - * - * 02 11 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Update BOW channel granted function. - * - * 02 10 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Fix kernel API change issue. - * Before ALPS 2.2 (2.2 included), kfifo_alloc() is - * struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, spinlock_t *lock); - * After ALPS 2.3, kfifo_alloc() is changed to - * int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask); - * - * 02 09 2011 cp.wu - * [WCXRP00000430] [MT6620 Wi-Fi][Firmware][Driver] Create V1.2 branch for MT6620E1 and MT6620E3 - * create V1.2 driver branch based on label MT6620_WIFI_DRIVER_V1_2_110209_1031 - * with BOW and P2P enabled as default - * - * 02 08 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Replace kfifo_get and kfifo_put with kfifo_out and kfifo_in. - * Update BOW get MAC status, remove returning event for AIS network type. - * - * 01 26 2011 cm.chang - * [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument - * . - * - * 01 11 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Update BOW Activity Report structure and bug fix. - * - * 01 10 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Update BOW to support multiple physical link. - * - * 12 08 2010 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Support concurrent networks. - * - * 12 07 2010 cm.chang - * [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk - * 1. BSSINFO include RLM parameter - * 2. free all sta records when network is disconnected - * - * 11 11 2010 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Fix BoW timer assert issue. - * - * 10 18 2010 chinghwa.yu - * [WCXRP00000110] [MT6620 Wi-Fi] [Driver] Fix BoW Connected event size - * Fix for event returnning Band. - * - * 10 18 2010 chinghwa.yu - * [WCXRP00000110] [MT6620 Wi-Fi] [Driver] Fix BoW Connected event size - * Fix wrong BoW event size. - * - * 10 04 2010 cp.wu - * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only - * remove ENUM_NETWORK_TYPE_T definitions - * - * 09 27 2010 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000065] Update BoW design and settings - * Update BCM/BoW design and settings. - * - * 09 16 2010 chinghwa.yu - * NULL - * Fix bowResponderScanDone error when prBssDesc is NULL. - * - * 09 14 2010 chinghwa.yu - * NULL - * Add bowRunEventAAAComplete. - * - * 09 14 2010 cp.wu - * NULL - * indicate correct AIS network information for PAL. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 24 2010 cm.chang - * NULL - * Support RLM initail channel of Ad-hoc, P2P and BOW - * - * 08 24 2010 chinghwa.yu - * NULL - * Initialize nicActivateNetwork(prAdapter as soon as bow is starting.. - * - * 08 24 2010 chinghwa.yu - * NULL - * Update BOW for the 1st time. - * - * 08 23 2010 cp.wu - * NULL - * revise constant definitions to be matched with implementation (original cmd-event definition is deprecated) - * - * 07 30 2010 cp.wu - * NULL - * 1) BoW wrapper: use definitions instead of hard-coded constant for error code - * 2) AIS-FSM: eliminate use of desired RF parameters, use prTargetBssDesc instead - * 3) add handling for RX_PKT_DESTINATION_HOST_WITH_FORWARD for GO-broadcast frames - * - * 07 15 2010 cp.wu - * - * sync. bluetooth-over-Wi-Fi interface to driver interface document v0.2.6. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 25 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add API in que_mgt to retrieve sta-rec index for security frames. - * - * 06 24 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 802.1x and bluetooth-over-Wi-Fi security frames are now delievered to firmware via command path instead of data path. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * 1) add timeout handler mechanism for pending command packets - * 2) add p2p add/removal key - * - * 05 13 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add NULL OID implementation for WOL-related OIDs. - * - * 05 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * 1) all BT physical handles shares the same RSSI/Link Quality. - * 2) simplify BT command composing - * - * 04 28 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * change prefix for data structure used to communicate with 802.11 PAL - * to avoid ambiguous naming with firmware interface - * - * 04 27 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add multiple physical link support - * - * 04 14 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * information buffer for query oid/ioctl is now buffered in prCmdInfo - * instead of glue-layer variable to improve multiple oid/ioctl capability - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * 2) command sequence number is now increased atomically - * * 3) private data could be hold and taken use for other purpose -** -*/ - -/****************************************************************************** -* C O M P I L E R F L A G S -******************************************************************************* -*/ - -/****************************************************************************** -* E X T E R N A L R E F E R E N C E S -******************************************************************************* -*/ -#include "precomp.h" - -#if CFG_ENABLE_BT_OVER_WIFI - -#if CFG_BOW_TEST -extern UINT_32 g_arBowRevPalPacketTime[32]; -#endif - - -/****************************************************************************** -* C O N S T A N T S -******************************************************************************* -*/ - -/****************************************************************************** -* D A T A T Y P E S -******************************************************************************* -*/ - -/****************************************************************************** -* P U B L I C D A T A -******************************************************************************* -*/ - -static UINT_32 g_u4LinkCount = 0; -static UINT_32 g_u4Beaconing = 0; -static BOW_TABLE_T arBowTable[CFG_BOW_PHYSICAL_LINK_NUM]; - -/****************************************************************************** -* P R I V A T E D A T A -******************************************************************************* -*/ - -const BOW_CMD_T arBowCmdTable[] = { - {BOW_CMD_ID_GET_MAC_STATUS, bowCmdGetMacStatus}, - {BOW_CMD_ID_SETUP_CONNECTION, bowCmdSetupConnection}, - {BOW_CMD_ID_DESTROY_CONNECTION, bowCmdDestroyConnection}, - {BOW_CMD_ID_SET_PTK, bowCmdSetPTK}, - {BOW_CMD_ID_READ_RSSI, bowCmdReadRSSI}, - {BOW_CMD_ID_READ_LINK_QUALITY, bowCmdReadLinkQuality}, - {BOW_CMD_ID_SHORT_RANGE_MODE, bowCmdShortRangeMode}, - {BOW_CMD_ID_GET_CHANNEL_LIST, bowCmdGetChannelList}, -}; - -/****************************************************************************** -* M A C R O S -******************************************************************************* -*/ - -/****************************************************************************** -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************* -*/ - -/****************************************************************************** -* F U N C T I O N S -******************************************************************************* -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief command packet generation utility -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] ucCID Command ID -* \param[in] fgSetQuery Set or Query -* \param[in] fgNeedResp Need for response -* \param[in] pfCmdDoneHandler Function pointer when command is done -* \param[in] u4SetQueryInfoLen The length of the set/query buffer -* \param[in] pucInfoBuffer Pointer to set/query buffer -* -* -* \retval WLAN_STATUS_PENDING -* \retval WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSendSetQueryBowCmd ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucCID, - IN BOOLEAN fgSetQuery, - IN BOOLEAN fgNeedResp, - IN PFN_CMD_DONE_HANDLER pfCmdDoneHandler, - IN PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler, - IN UINT_32 u4SetQueryInfoLen, - IN PUINT_8 pucInfoBuffer, - IN UINT_8 ucSeqNumber - ) -{ - P_GLUE_INFO_T prGlueInfo; - P_CMD_INFO_T prCmdInfo; - P_WIFI_CMD_T prWifiCmd; - UINT_8 ucCmdSeqNum; - - ASSERT(prAdapter); - - prGlueInfo = prAdapter->prGlueInfo; - ASSERT(prGlueInfo); - - DBGLOG(REQ, TRACE, ("Command ID = 0x%08X\n", ucCID)); - - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, (CMD_HDR_SIZE + u4SetQueryInfoLen)); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - DBGLOG(REQ, TRACE, ("ucCmdSeqNum =%d\n", ucCmdSeqNum)); - - // Setup common CMD Info Packet - prCmdInfo->eCmdType = COMMAND_TYPE_NETWORK_IOCTL; - prCmdInfo->eNetworkType = NETWORK_TYPE_BOW_INDEX; - prCmdInfo->u2InfoBufLen = (UINT_16)(CMD_HDR_SIZE + u4SetQueryInfoLen); - prCmdInfo->pfCmdDoneHandler = pfCmdDoneHandler; - prCmdInfo->pfCmdTimeoutHandler = pfCmdTimeoutHandler; - prCmdInfo->fgIsOid = FALSE; - prCmdInfo->ucCID = ucCID; - prCmdInfo->fgSetQuery = fgSetQuery; - prCmdInfo->fgNeedResp = fgNeedResp; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = u4SetQueryInfoLen; - prCmdInfo->pvInformationBuffer = NULL; - prCmdInfo->u4InformationBufferLength = 0; - prCmdInfo->u4PrivateData = (UINT_32) ucSeqNumber; - - // Setup WIFI_CMD_T (no payload) - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - if(u4SetQueryInfoLen > 0 && pucInfoBuffer != NULL) { - kalMemCopy(prWifiCmd->aucBuffer, pucInfoBuffer, u4SetQueryInfoLen); - } - - // insert into prCmdQueue - kalEnqueueCommand(prGlueInfo, (P_QUE_ENTRY_T)prCmdInfo); - - // wakeup txServiceThread later - GLUE_SET_EVENT(prGlueInfo); - return WLAN_STATUS_PENDING; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to dispatch command coming from 802.11 PAL -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmd Pointer to the buffer that holds the command -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanbowHandleCommand( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ) -{ - WLAN_STATUS retval = WLAN_STATUS_FAILURE; - UINT_16 i; - - ASSERT(prAdapter); - - for (i = 0; i < sizeof(arBowCmdTable) / sizeof(BOW_CMD_T); i++) { - if ((arBowCmdTable[i].uCmdID == prCmd->rHeader.ucCommandId) && - arBowCmdTable[i].pfCmdHandle) { - retval = arBowCmdTable[i].pfCmdHandle(prAdapter, prCmd); - break; - } - } - - return retval; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This is command handler for BOW_CMD_ID_GET_MAC_STATUS -* coming from 802.11 PAL -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmd Pointer to the buffer that holds the command -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -bowCmdGetMacStatus( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ) -{ - P_AMPC_EVENT prEvent; - P_BOW_MAC_STATUS prMacStatus; - UINT_8 idx = 0; - UINT_8 ucPrimaryChannel; - ENUM_BAND_T eBand; - ENUM_CHNL_EXT_T eBssSCO; - UINT_8 ucNumOfChannel = 0;//MAX_BOW_NUMBER_OF_CHANNEL; - - RF_CHANNEL_INFO_T aucChannelList[MAX_BOW_NUMBER_OF_CHANNEL]; - - ASSERT(prAdapter); - - //3 <1> If LinkCount != 0 -> OK (optional) - - eBand = BAND_2G4; - eBssSCO = CHNL_EXT_SCN; - - // fill event header - prEvent = (P_AMPC_EVENT) kalMemAlloc((sizeof(AMPC_EVENT) + sizeof(BOW_MAC_STATUS)), VIR_MEM_TYPE); - - prEvent->rHeader.ucEventId = BOW_EVENT_ID_MAC_STATUS; - prEvent->rHeader.ucSeqNumber = prCmd->rHeader.ucSeqNumber; - prEvent->rHeader.u2PayloadLength = sizeof(BOW_MAC_STATUS); - - // fill event body - prMacStatus = (P_BOW_MAC_STATUS)(prEvent->aucPayload); - kalMemZero(prMacStatus, sizeof(BOW_MAC_STATUS)); - - //3 <2> Call CNM to decide if BOW available. - if (cnmBowIsPermitted(prAdapter)) - { - prMacStatus->ucAvailability = TRUE; - } - else - { - prMacStatus->ucAvailability = FALSE; - } - - memcpy(prMacStatus->aucMacAddr, prAdapter->rWifiVar.aucDeviceAddress, PARAM_MAC_ADDR_LEN); - - if (cnmPreferredChannel(prAdapter, &eBand, &ucPrimaryChannel, &eBssSCO)) - { -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowCmdGetMacStatus, Get preferred channel.\n")); -#endif - - prMacStatus->ucNumOfChannel = 1; - prMacStatus->arChannelList[0].ucChannelBand = eBand; - prMacStatus->arChannelList[0].ucChannelNum = ucPrimaryChannel; - } - else - { -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowCmdGetMacStatus, Get channel list. Current number of channel, %d.\n", ucNumOfChannel)); -#endif - - rlmDomainGetChnlList(prAdapter, BAND_2G4, MAX_BOW_NUMBER_OF_CHANNEL_2G4, &ucNumOfChannel, aucChannelList); - - if (ucNumOfChannel > 0) { - for (idx = 0; idx < ucNumOfChannel/*MAX_BOW_NUMBER_OF_CHANNEL_2G4*/; idx++) - { - prMacStatus->arChannelList[idx].ucChannelBand = aucChannelList[idx].eBand; - prMacStatus->arChannelList[idx].ucChannelNum = aucChannelList[idx].ucChannelNum; - } - - prMacStatus->ucNumOfChannel = ucNumOfChannel; - } - - rlmDomainGetChnlList(prAdapter, BAND_5G, MAX_BOW_NUMBER_OF_CHANNEL_5G, &ucNumOfChannel, aucChannelList); - - if (ucNumOfChannel > 0) { - for (idx = 0; idx < ucNumOfChannel/*MAX_BOW_NUMBER_OF_CHANNEL_5G*/; idx++) - { - prMacStatus->arChannelList[prMacStatus->ucNumOfChannel + idx].ucChannelBand = aucChannelList[idx].eBand; - prMacStatus->arChannelList[prMacStatus->ucNumOfChannel + idx].ucChannelNum = aucChannelList[idx].ucChannelNum; - } - - prMacStatus->ucNumOfChannel = prMacStatus->ucNumOfChannel + ucNumOfChannel; - - } - } - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("ucNumOfChannel, eBand, aucChannelList, %x, %x, %x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x.\n", - ucNumOfChannel, - aucChannelList[0].eBand, - aucChannelList[0].ucChannelNum, - aucChannelList[1].ucChannelNum, - aucChannelList[2].ucChannelNum, - aucChannelList[3].ucChannelNum, - aucChannelList[4].ucChannelNum, - aucChannelList[5].ucChannelNum, - aucChannelList[6].ucChannelNum, - aucChannelList[7].ucChannelNum, - aucChannelList[8].ucChannelNum, - aucChannelList[9].ucChannelNum, - aucChannelList[10].ucChannelNum, - aucChannelList[11].ucChannelNum, - aucChannelList[12].ucChannelNum, - aucChannelList[13].ucChannelNum, - aucChannelList[14].ucChannelNum, - aucChannelList[15].ucChannelNum, - aucChannelList[16].ucChannelNum, - aucChannelList[17].ucChannelNum)); - - DBGLOG(BOW, EVENT, ("prMacStatus->ucNumOfChannel, eBand, prMacStatus->arChannelList, %x, %x, %x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x.\n", - prMacStatus->ucNumOfChannel, - prMacStatus->arChannelList[0].ucChannelBand, - prMacStatus->arChannelList[0].ucChannelNum, - prMacStatus->arChannelList[1].ucChannelNum, - prMacStatus->arChannelList[2].ucChannelNum, - prMacStatus->arChannelList[3].ucChannelNum, - prMacStatus->arChannelList[4].ucChannelNum, - prMacStatus->arChannelList[5].ucChannelNum, - prMacStatus->arChannelList[6].ucChannelNum, - prMacStatus->arChannelList[7].ucChannelNum, - prMacStatus->arChannelList[8].ucChannelNum, - prMacStatus->arChannelList[9].ucChannelNum, - prMacStatus->arChannelList[10].ucChannelNum, - prMacStatus->arChannelList[11].ucChannelNum, - prMacStatus->arChannelList[12].ucChannelNum, - prMacStatus->arChannelList[13].ucChannelNum, - prMacStatus->arChannelList[14].ucChannelNum, - prMacStatus->arChannelList[15].ucChannelNum, - prMacStatus->arChannelList[16].ucChannelNum, - prMacStatus->arChannelList[17].ucChannelNum)); - - DBGLOG(BOW, EVENT, ("prMacStatus->ucNumOfChannel, %x.\n", prMacStatus->ucNumOfChannel)); - DBGLOG(BOW, EVENT, ("prMacStatus->arChannelList[0].ucChannelBand, %x.\n", prMacStatus->arChannelList[0].ucChannelBand)); - DBGLOG(BOW, EVENT, ("prMacStatus->arChannelList[0].ucChannelNum, %x.\n", prMacStatus->arChannelList[0].ucChannelNum)); - DBGLOG(BOW, EVENT, ("prMacStatus->ucAvailability, %x.\n", prMacStatus->ucAvailability)); - DBGLOG(BOW, EVENT, ("prMacStatus->aucMacAddr, %x:%x:%x:%x:%x:%x.\n", - prMacStatus->aucMacAddr[0], - prMacStatus->aucMacAddr[1], - prMacStatus->aucMacAddr[2], - prMacStatus->aucMacAddr[3], - prMacStatus->aucMacAddr[4], - prMacStatus->aucMacAddr[5])); -#endif - - kalIndicateBOWEvent(prAdapter->prGlueInfo, prEvent); - - kalMemFree(prEvent, VIR_MEM_TYPE, (sizeof(AMPC_EVENT) + sizeof(BOW_MAC_STATUS))); - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This is command handler for BOW_CMD_ID_SETUP_CONNECTION -* coming from 802.11 PAL -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmd Pointer to the buffer that holds the command -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -bowCmdSetupConnection( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ) -{ - P_BOW_SETUP_CONNECTION prBowSetupConnection; - CMD_BT_OVER_WIFI rCmdBtOverWifi; - P_BOW_FSM_INFO_T prBowFsmInfo; - BOW_TABLE_T rBowTable; - - UINT_8 ucBowTableIdx = 0; - - ASSERT(prAdapter); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - prBowSetupConnection = (P_BOW_SETUP_CONNECTION) &(prCmd->aucPayload[0]); - - // parameter size check - if(prCmd->rHeader.u2PayloadLength != sizeof(BOW_SETUP_CONNECTION)) - { - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_INVALID); - return WLAN_STATUS_INVALID_LENGTH; - } - - //3 <1> If ucLinkCount >= 4 -> Fail. - if (g_u4LinkCount >= CFG_BOW_PHYSICAL_LINK_NUM) - { - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_UNACCEPTED); - return WLAN_STATUS_NOT_ACCEPTED; - } - - //3 <2> Call CNM, check if BOW is available. - if (!cnmBowIsPermitted(prAdapter)) - { - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_UNACCEPTED); - return WLAN_STATUS_NOT_ACCEPTED; - } - - //3 <3> Lookup BOW Table, if Peer MAC address exist and valid -> Fail. - if (bowCheckBowTableIfVaild(prAdapter, prBowSetupConnection->aucPeerAddress)) - { - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_UNACCEPTED); - return WLAN_STATUS_NOT_ACCEPTED; - } - - if(EQUAL_MAC_ADDR(prBowSetupConnection->aucPeerAddress, prAdapter->rWifiVar.aucDeviceAddress)) - { - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_INVALID); - return WLAN_STATUS_NOT_ACCEPTED; - } - - - // fill CMD_BT_OVER_WIFI - rCmdBtOverWifi.ucAction = BOW_SETUP_CMD; - rCmdBtOverWifi.ucChannelNum = prBowSetupConnection->ucChannelNum; - COPY_MAC_ADDR(rCmdBtOverWifi.rPeerAddr, prBowSetupConnection->aucPeerAddress); - rCmdBtOverWifi.u2BeaconInterval = prBowSetupConnection->u2BeaconInterval; - rCmdBtOverWifi.ucTimeoutDiscovery = prBowSetupConnection->ucTimeoutDiscovery; - rCmdBtOverWifi.ucTimeoutInactivity = prBowSetupConnection->ucTimeoutInactivity; - rCmdBtOverWifi.ucRole = prBowSetupConnection->ucRole; - rCmdBtOverWifi.PAL_Capabilities = prBowSetupConnection->ucPAL_Capabilities; - rCmdBtOverWifi.cMaxTxPower = prBowSetupConnection->cMaxTxPower; - - if (prBowSetupConnection->ucChannelNum > 14) { - rCmdBtOverWifi.ucChannelBand = BAND_5G; - } - else { - rCmdBtOverWifi.ucChannelBand = BAND_2G4; - } - - COPY_MAC_ADDR(prBowFsmInfo->aucPeerAddress, prBowSetupConnection->aucPeerAddress); - -#if CFG_BOW_PHYSICAL_LINK_NUM > 1 - /*Channel check for supporting multiple physical link*/ - if(g_u4LinkCount > 0) { - if (prBowSetupConnection->ucChannelNum != prBowFsmInfo->ucPrimaryChannel) { - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_UNACCEPTED); - return WLAN_STATUS_NOT_ACCEPTED; - } - } -#endif - - prBowFsmInfo->ucPrimaryChannel = prBowSetupConnection->ucChannelNum; - prBowFsmInfo->eBand = rCmdBtOverWifi.ucChannelBand; - prBowFsmInfo->u2BeaconInterval = prBowSetupConnection->u2BeaconInterval; - prBowFsmInfo->ucRole = prBowSetupConnection->ucRole; - - if (prBowSetupConnection->ucPAL_Capabilities > 0) - { - prBowFsmInfo->fgSupportQoS = TRUE; - } - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowCmdSetupConnection.\n")); - DBGLOG(BOW, EVENT, ("rCmdBtOverWifi Channel Number - 0x%x.\n", rCmdBtOverWifi.ucChannelNum)); - DBGLOG(BOW, EVENT, ("rCmdBtOverWifi Peer address - %x:%x:%x:%x:%x:%x.\n", rCmdBtOverWifi.rPeerAddr[0], - rCmdBtOverWifi.rPeerAddr[1], - rCmdBtOverWifi.rPeerAddr[2], - rCmdBtOverWifi.rPeerAddr[3], - rCmdBtOverWifi.rPeerAddr[4], - rCmdBtOverWifi.rPeerAddr[5])); - DBGLOG(BOW, EVENT, ("rCmdBtOverWifi Beacon interval - 0x%x.\n", rCmdBtOverWifi.u2BeaconInterval)); - DBGLOG(BOW, EVENT, ("rCmdBtOverWifi Timeout activity - 0x%x.\n", rCmdBtOverWifi.ucTimeoutDiscovery)); - DBGLOG(BOW, EVENT, ("rCmdBtOverWifi Timeout inactivity - 0x%x.\n", rCmdBtOverWifi.ucTimeoutInactivity)); - DBGLOG(BOW, EVENT, ("rCmdBtOverWifi Role - 0x%x.\n", rCmdBtOverWifi.ucRole)); - DBGLOG(BOW, EVENT, ("rCmdBtOverWifi PAL capability - 0x%x.\n", rCmdBtOverWifi.PAL_Capabilities)); - DBGLOG(BOW, EVENT, ("rCmdBtOverWifi Max Tx power - 0x%x.\n", rCmdBtOverWifi.cMaxTxPower)); -#endif - - //3 <4> Get a free BOW entry, mark as Valid, fill in Peer MAC address, LinkCount += 1, state == Starting. - if (!bowGetBowTableFreeEntry(prAdapter, &ucBowTableIdx)) - { - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_UNACCEPTED); - return WLAN_STATUS_NOT_ACCEPTED; - } - - prBowFsmInfo->prTargetBssDesc = NULL; - - COPY_MAC_ADDR(rBowTable.aucPeerAddress, prBowSetupConnection->aucPeerAddress); - //owTable.eState = BOW_DEVICE_STATE_ACQUIRING_CHANNEL; - rBowTable.fgIsValid = TRUE; - rBowTable.ucAcquireID = prBowFsmInfo->ucSeqNumOfChReq; - //rBowTable.ucRole = prBowSetupConnection->ucRole; - //rBowTable.ucChannelNum = prBowSetupConnection->ucChannelNum; - bowSetBowTableContent(prAdapter, ucBowTableIdx, &rBowTable); - - kalSetBowRole(prAdapter->prGlueInfo, rCmdBtOverWifi.ucRole, prBowSetupConnection->aucPeerAddress); - - GLUE_INC_REF_CNT(g_u4LinkCount); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowStarting, g_u4LinkCount, %x.\n", g_u4LinkCount)); -#endif - - if (g_u4LinkCount == 1) - { -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowStarting, cnmTimerInitTimer.\n")); - DBGLOG(BOW, EVENT, ("prBowFsmInfo->u2BeaconInterval, %d.\n", prBowFsmInfo->u2BeaconInterval)); -#endif - cnmTimerInitTimer(prAdapter, - &prBowFsmInfo->rStartingBeaconTimer, - (PFN_MGMT_TIMEOUT_FUNC)bowSendBeacon, - (UINT_32)NULL); - - cnmTimerInitTimer(prAdapter, - &prBowFsmInfo->rChGrantedTimer, - (PFN_MGMT_TIMEOUT_FUNC)bowChGrantedTimeout, - (UINT_32)NULL); - - //Reset Global Variable - g_u4Beaconing = 0; - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowCmdSetupConnection, g_u4LinkCount, %x.\n", g_u4LinkCount)); - DBGLOG(BOW, EVENT, ("kalInitBowDevice, bow0\n")); -#endif -#if CFG_BOW_SEPARATE_DATA_PATH - kalInitBowDevice(prAdapter->prGlueInfo, BOWDEVNAME); -#endif - - /*Active BoW Network*/ - SET_NET_ACTIVE(prAdapter, NETWORK_TYPE_BOW_INDEX); - SET_NET_PWR_STATE_ACTIVE(prAdapter, NETWORK_TYPE_BOW_INDEX); - nicActivateNetwork(prAdapter, NETWORK_TYPE_BOW_INDEX); - - } - - if(rCmdBtOverWifi.ucRole == BOW_INITIATOR) { - bowSetBowTableState(prAdapter, prBowSetupConnection->aucPeerAddress, BOW_DEVICE_STATE_ACQUIRING_CHANNEL); - bowRequestCh(prAdapter); - } else { - bowSetBowTableState(prAdapter, prBowSetupConnection->aucPeerAddress, BOW_DEVICE_STATE_SCANNING); - bowResponderScan(prAdapter); - } - - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_SUCCESS); - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This is command handler for BOW_CMD_ID_DESTROY_CONNECTION -* coming from 802.11 PAL -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmd Pointer to the buffer that holds the command -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -bowCmdDestroyConnection( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ) -{ - P_BOW_DESTROY_CONNECTION prBowDestroyConnection; - CMD_BT_OVER_WIFI rCmdBtOverWifi; - P_BOW_FSM_INFO_T prBowFsmInfo; -#if CFG_BOW_TEST - UINT_8 ucIdx; -#endif - - ASSERT(prAdapter); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - - //3 <1> If LinkCount == 0 ->Fail (Optional) - if (g_u4LinkCount == 0) - { - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_UNACCEPTED); - return WLAN_STATUS_NOT_ACCEPTED; - } - - // parameter size check - if(prCmd->rHeader.u2PayloadLength != sizeof(BOW_DESTROY_CONNECTION)) - { - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_UNACCEPTED); - return WLAN_STATUS_INVALID_LENGTH; - } - - //3 <2> Lookup BOW table, check if is not exist (Valid and Peer MAC address) -> Fail - prBowDestroyConnection = (P_BOW_DESTROY_CONNECTION) &(prCmd->aucPayload[0]); - - if (!bowCheckBowTableIfVaild(prAdapter, prBowDestroyConnection->aucPeerAddress)) - { -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowCmdDestroyConnection, bowCheckIfVaild, not accepted.\n")); -#endif - return WLAN_STATUS_NOT_ACCEPTED; - } - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowCmdDestroyConnection, destroy Peer address - %x:%x:%x:%x:%x:%x.\n", prBowDestroyConnection->aucPeerAddress[0], - prBowDestroyConnection->aucPeerAddress[1], - prBowDestroyConnection->aucPeerAddress[2], - prBowDestroyConnection->aucPeerAddress[3], - prBowDestroyConnection->aucPeerAddress[4], - prBowDestroyConnection->aucPeerAddress[5])); -#endif - - // fill CMD_BT_OVER_WIFI - rCmdBtOverWifi.ucAction = 2; - COPY_MAC_ADDR(rCmdBtOverWifi.rPeerAddr, prBowDestroyConnection->aucPeerAddress); - COPY_MAC_ADDR(prBowFsmInfo->aucPeerAddress, prBowDestroyConnection->aucPeerAddress); -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowCmdDestroyConnection, rCmdBtOverWifi.rPeerAddr - %x:%x:%x:%x:%x:%x.\n", rCmdBtOverWifi.rPeerAddr[0], - rCmdBtOverWifi.rPeerAddr[1], - rCmdBtOverWifi.rPeerAddr[2], - rCmdBtOverWifi.rPeerAddr[3], - rCmdBtOverWifi.rPeerAddr[4], - rCmdBtOverWifi.rPeerAddr[5])); -#endif - -#if CFG_BOW_TEST - for (ucIdx = 0; ucIdx < 11; ucIdx++) - { - DBGLOG(BOW, EVENT, ("BoW receiving PAL packet delta time vs packet number -- %d ms vs %x.\n", ucIdx, g_arBowRevPalPacketTime[ucIdx])); - } -#endif - - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_SUCCESS); - - return wlanoidSendSetQueryBowCmd(prAdapter, - CMD_ID_CMD_BT_OVER_WIFI, - TRUE, - FALSE, - wlanbowCmdEventLinkDisconnected, - wlanbowCmdTimeoutHandler, - sizeof(CMD_BT_OVER_WIFI), - (PUINT_8) &rCmdBtOverWifi, - prCmd->rHeader.ucSeqNumber - ); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This is command handler for BOW_CMD_ID_SET_PTK -* coming from 802.11 PAL -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmd Pointer to the buffer that holds the command -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -bowCmdSetPTK( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ) -{ - P_BOW_SET_PTK prBowSetPTK; - CMD_802_11_KEY rCmdKey; - - ASSERT(prAdapter); - - // parameter size check - if(prCmd->rHeader.u2PayloadLength != sizeof(BOW_SET_PTK)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - prBowSetPTK = (P_BOW_SET_PTK) &(prCmd->aucPayload[0]); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("prBowSetPTK->aucPeerAddress, %x:%x:%x:%x:%x:%x.\n", - prBowSetPTK->aucPeerAddress[0], - prBowSetPTK->aucPeerAddress[1], - prBowSetPTK->aucPeerAddress[2], - prBowSetPTK->aucPeerAddress[3], - prBowSetPTK->aucPeerAddress[4], - prBowSetPTK->aucPeerAddress[5])); - - DBGLOG(BOW, EVENT, ("rCmdKey.ucIsAuthenticator, %x.\n", kalGetBowRole(prAdapter->prGlueInfo, prBowSetPTK->aucPeerAddress))); -#endif - - if (!bowCheckBowTableIfVaild(prAdapter, prBowSetPTK->aucPeerAddress)) - { - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_UNACCEPTED); - - return WLAN_STATUS_NOT_ACCEPTED; - } - - if (bowGetBowTableState(prAdapter, prBowSetPTK->aucPeerAddress) != BOW_DEVICE_STATE_CONNECTED) - { - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_FAILURE); - - return WLAN_STATUS_NOT_ACCEPTED; - } - - // fill CMD_802_11_KEY - rCmdKey.ucAddRemove = 1; // add - rCmdKey.ucTxKey = 1; - rCmdKey.ucKeyType = 1; - rCmdKey.ucIsAuthenticator = kalGetBowRole(prAdapter->prGlueInfo, prBowSetPTK->aucPeerAddress); - COPY_MAC_ADDR(rCmdKey.aucPeerAddr, prBowSetPTK->aucPeerAddress); - rCmdKey.ucNetType = NETWORK_TYPE_BOW_INDEX; // BT Over Wi-Fi - rCmdKey.ucAlgorithmId = CIPHER_SUITE_CCMP; // AES - rCmdKey.ucKeyId = 0; - rCmdKey.ucKeyLen = 16; // AES = 128bit - kalMemCopy(rCmdKey.aucKeyMaterial, prBowSetPTK->aucTemporalKey, 16); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("prBowSetPTK->aucTemporalKey, %x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x.\n", - prBowSetPTK->aucTemporalKey[0], - prBowSetPTK->aucTemporalKey[1], - prBowSetPTK->aucTemporalKey[2], - prBowSetPTK->aucTemporalKey[3], - prBowSetPTK->aucTemporalKey[4], - prBowSetPTK->aucTemporalKey[5], - prBowSetPTK->aucTemporalKey[6], - prBowSetPTK->aucTemporalKey[7], - prBowSetPTK->aucTemporalKey[8], - prBowSetPTK->aucTemporalKey[9], - prBowSetPTK->aucTemporalKey[10], - prBowSetPTK->aucTemporalKey[11], - prBowSetPTK->aucTemporalKey[12], - prBowSetPTK->aucTemporalKey[13], - prBowSetPTK->aucTemporalKey[14], - prBowSetPTK->aucTemporalKey[15])); - - DBGLOG(BOW, EVENT, ("rCmdKey.aucKeyMaterial, %x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x.\n", - rCmdKey.aucKeyMaterial[0], - rCmdKey.aucKeyMaterial[1], - rCmdKey.aucKeyMaterial[2], - rCmdKey.aucKeyMaterial[3], - rCmdKey.aucKeyMaterial[4], - rCmdKey.aucKeyMaterial[5], - rCmdKey.aucKeyMaterial[6], - rCmdKey.aucKeyMaterial[7], - rCmdKey.aucKeyMaterial[8], - rCmdKey.aucKeyMaterial[9], - rCmdKey.aucKeyMaterial[10], - rCmdKey.aucKeyMaterial[11], - rCmdKey.aucKeyMaterial[12], - rCmdKey.aucKeyMaterial[13], - rCmdKey.aucKeyMaterial[14], - rCmdKey.aucKeyMaterial[15])); -#endif - - return wlanoidSendSetQueryBowCmd(prAdapter, - CMD_ID_ADD_REMOVE_KEY, - TRUE, - FALSE, - wlanbowCmdEventSetCommon, - wlanbowCmdTimeoutHandler, - sizeof(CMD_802_11_KEY), - (PUINT_8) &rCmdKey, - prCmd->rHeader.ucSeqNumber - ); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This is command handler for BOW_CMD_ID_READ_RSSI -* coming from 802.11 PAL -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmd Pointer to the buffer that holds the command -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -bowCmdReadRSSI( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ) -{ - P_BOW_READ_RSSI prBowReadRSSI; - - ASSERT(prAdapter); - - // parameter size check - if(prCmd->rHeader.u2PayloadLength != sizeof(BOW_READ_RSSI)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - prBowReadRSSI = (P_BOW_READ_RSSI) &(prCmd->aucPayload[0]); - - return wlanoidSendSetQueryBowCmd(prAdapter, - CMD_ID_GET_LINK_QUALITY, - FALSE, - TRUE, - wlanbowCmdEventReadRssi, - wlanbowCmdTimeoutHandler, - 0, - NULL, - prCmd->rHeader.ucSeqNumber - ); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This is command handler for BOW_CMD_ID_READ_LINK_QUALITY -* coming from 802.11 PAL -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmd Pointer to the buffer that holds the command -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -bowCmdReadLinkQuality( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ) -{ - P_BOW_READ_LINK_QUALITY prBowReadLinkQuality; - - ASSERT(prAdapter); - - // parameter size check - if(prCmd->rHeader.u2PayloadLength != sizeof(P_BOW_READ_LINK_QUALITY)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - prBowReadLinkQuality = (P_BOW_READ_LINK_QUALITY) &(prCmd->aucPayload[0]); - - return wlanoidSendSetQueryBowCmd(prAdapter, - CMD_ID_GET_LINK_QUALITY, - FALSE, - TRUE, - wlanbowCmdEventReadLinkQuality, - wlanbowCmdTimeoutHandler, - 0, - NULL, - prCmd->rHeader.ucSeqNumber - ); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This is command handler for BOW_CMD_ID_SHORT_RANGE_MODE -* coming from 802.11 PAL -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmd Pointer to the buffer that holds the command -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -bowCmdShortRangeMode( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ) -{ - P_BOW_SHORT_RANGE_MODE prBowShortRangeMode; - CMD_TX_PWR_T rTxPwrParam; - - ASSERT(prAdapter); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowCmdShortRangeMode.\n")); -#endif - - prBowShortRangeMode = (P_BOW_SHORT_RANGE_MODE) &(prCmd->aucPayload[0]); - - // parameter size check - if(prCmd->rHeader.u2PayloadLength != sizeof(BOW_SHORT_RANGE_MODE)) { - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_UNACCEPTED); - return WLAN_STATUS_INVALID_LENGTH; - } - - if (!bowCheckBowTableIfVaild(prAdapter, prBowShortRangeMode->aucPeerAddress)) - { - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_UNACCEPTED); - return WLAN_STATUS_NOT_ACCEPTED; - } - - if (bowGetBowTableState(prAdapter, prBowShortRangeMode->aucPeerAddress) != BOW_DEVICE_STATE_CONNECTED) - { - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_FAILURE); - return WLAN_STATUS_NOT_ACCEPTED; - } - - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("prBowShortRangeMode->aucPeerAddress, %x:%x:%x:%x:%x:%x.\n", - prBowShortRangeMode->aucPeerAddress[0], - prBowShortRangeMode->aucPeerAddress[1], - prBowShortRangeMode->aucPeerAddress[2], - prBowShortRangeMode->aucPeerAddress[3], - prBowShortRangeMode->aucPeerAddress[4], - prBowShortRangeMode->aucPeerAddress[5])); -#endif - - rTxPwrParam.cTxPwr2G4Cck = (prBowShortRangeMode->cTxPower << 1); - - rTxPwrParam.cTxPwr2G4OFDM_BPSK = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr2G4OFDM_QPSK = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr2G4OFDM_16QAM = (prBowShortRangeMode->cTxPower << 1); - - rTxPwrParam.cTxPwr2G4OFDM_48Mbps = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr2G4OFDM_54Mbps = (prBowShortRangeMode->cTxPower << 1); - - rTxPwrParam.cTxPwr2G4HT20_BPSK = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr2G4HT20_QPSK = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr2G4HT20_16QAM = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr2G4HT20_MCS5 = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr2G4HT20_MCS6 = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr2G4HT20_MCS7 = (prBowShortRangeMode->cTxPower << 1); - - rTxPwrParam.cTxPwr2G4HT40_BPSK = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr2G4HT40_QPSK = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr2G4HT40_16QAM = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr2G4HT40_MCS5 = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr2G4HT40_MCS6 = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr2G4HT40_MCS7 = (prBowShortRangeMode->cTxPower << 1); - - rTxPwrParam.cTxPwr5GOFDM_BPSK = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr5GOFDM_QPSK = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr5GOFDM_16QAM = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr5GOFDM_48Mbps = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr5GOFDM_54Mbps = (prBowShortRangeMode->cTxPower << 1); - - rTxPwrParam.cTxPwr5GHT20_BPSK = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr5GHT20_QPSK = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr5GHT20_16QAM = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr5GHT20_MCS5 = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr5GHT20_MCS6 = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr5GHT20_MCS7 = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr5GHT40_BPSK = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr5GHT40_QPSK = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr5GHT40_16QAM = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr5GHT40_MCS5 = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr5GHT40_MCS6 = (prBowShortRangeMode->cTxPower << 1); - rTxPwrParam.cTxPwr5GHT40_MCS7 = (prBowShortRangeMode->cTxPower << 1); - - if (nicUpdateTxPower(prAdapter, &rTxPwrParam) == WLAN_STATUS_SUCCESS) - { -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowCmdShortRangeMode, %x.\n", WLAN_STATUS_SUCCESS)); -#endif - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_SUCCESS); - return WLAN_STATUS_SUCCESS; - } - else - { - wlanbowCmdEventSetStatus(prAdapter, prCmd, BOWCMD_STATUS_FAILURE); - return WLAN_STATUS_FAILURE; - } - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This is command handler for BOW_CMD_ID_GET_CHANNEL_LIST -* coming from 802.11 PAL -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmd Pointer to the buffer that holds the command -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -bowCmdGetChannelList( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ) -{ - ASSERT(prAdapter); - - // not supported yet - return WLAN_STATUS_FAILURE; -} - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This is generic command done handler -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmdInfo Pointer to the buffer that holds the command info -* \param[in] pucEventBuf Pointer to the set buffer OR event buffer -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanbowCmdEventSetStatus( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd, - IN UINT_8 ucEventBuf - ) -{ - P_AMPC_EVENT prEvent; - P_BOW_COMMAND_STATUS prBowCmdStatus; - - ASSERT(prAdapter); - - // fill event header - prEvent = (P_AMPC_EVENT) kalMemAlloc((sizeof(AMPC_EVENT) + sizeof(BOW_COMMAND_STATUS)), VIR_MEM_TYPE); - prEvent->rHeader.ucEventId = BOW_EVENT_ID_COMMAND_STATUS; - prEvent->rHeader.ucSeqNumber = prCmd->rHeader.ucSeqNumber; - prEvent->rHeader.u2PayloadLength = sizeof(BOW_COMMAND_STATUS); - - // fill event body - prBowCmdStatus = (P_BOW_COMMAND_STATUS)(prEvent->aucPayload); - kalMemZero(prBowCmdStatus, sizeof(BOW_COMMAND_STATUS)); - - prBowCmdStatus->ucStatus = ucEventBuf; - - kalIndicateBOWEvent(prAdapter->prGlueInfo, prEvent); - - kalMemFree(prEvent, VIR_MEM_TYPE, (sizeof(AMPC_EVENT) + sizeof(BOW_COMMAND_STATUS))); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This is generic command done handler -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmdInfo Pointer to the buffer that holds the command info -* \param[in] pucEventBuf Pointer to the set buffer OR event buffer -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanbowCmdEventSetCommon( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_AMPC_EVENT prEvent; - P_BOW_COMMAND_STATUS prBowCmdStatus; - - ASSERT(prAdapter); - - // fill event header - prEvent = (P_AMPC_EVENT) kalMemAlloc((sizeof(AMPC_EVENT) + sizeof(BOW_COMMAND_STATUS)), VIR_MEM_TYPE); - prEvent->rHeader.ucEventId = BOW_EVENT_ID_COMMAND_STATUS; - prEvent->rHeader.ucSeqNumber = (UINT_8) prCmdInfo->u4PrivateData; - prEvent->rHeader.u2PayloadLength = sizeof(BOW_COMMAND_STATUS); - - // fill event body - prBowCmdStatus = (P_BOW_COMMAND_STATUS)(prEvent->aucPayload); - kalMemZero(prBowCmdStatus, sizeof(BOW_COMMAND_STATUS)); - - prBowCmdStatus->ucStatus = BOWCMD_STATUS_SUCCESS; - - kalIndicateBOWEvent(prAdapter->prGlueInfo, prEvent); - - kalMemFree(prEvent, VIR_MEM_TYPE, (sizeof(AMPC_EVENT) + sizeof(BOW_COMMAND_STATUS))); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief command done handler for CMD_ID_CMD_BT_OVER_WIFI -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmdInfo Pointer to the buffer that holds the command info -* \param[in] pucEventBuf Pointer to the set buffer OR event buffer -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanbowCmdEventLinkConnected( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_AMPC_EVENT prEvent; - P_BOW_LINK_CONNECTED prBowLinkConnected; - P_BOW_FSM_INFO_T prBowFsmInfo; - P_BSS_INFO_T prBssInfo; - - ASSERT(prAdapter); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]); - - // fill event header - prEvent = (P_AMPC_EVENT) kalMemAlloc((sizeof(AMPC_EVENT) + sizeof(BOW_LINK_CONNECTED)), VIR_MEM_TYPE); - prEvent->rHeader.ucEventId = BOW_EVENT_ID_LINK_CONNECTED; - prEvent->rHeader.ucSeqNumber = (UINT_8) prCmdInfo->u4PrivateData; - prEvent->rHeader.u2PayloadLength = sizeof(BOW_LINK_CONNECTED); - - // fill event body - prBowLinkConnected = (P_BOW_LINK_CONNECTED)(prEvent->aucPayload); - kalMemZero(prBowLinkConnected, sizeof(BOW_LINK_CONNECTED)); - prBowLinkConnected->rChannel.ucChannelNum = prBssInfo->ucPrimaryChannel; - prBowLinkConnected->rChannel.ucChannelBand = prBssInfo->eBand; - COPY_MAC_ADDR(prBowLinkConnected->aucPeerAddress, prBowFsmInfo->aucPeerAddress); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("prEvent->rHeader.ucEventId, 0x%x\n", prEvent->rHeader.ucEventId)); - DBGLOG(BOW, EVENT, ("prEvent->rHeader.ucSeqNumber, 0x%x\n", prEvent->rHeader.ucSeqNumber)); - DBGLOG(BOW, EVENT, ("prEvent->rHeader.u2PayloadLength, 0x%x\n", prEvent->rHeader.u2PayloadLength)); - DBGLOG(BOW, EVENT, ("prBowLinkConnected->rChannel.ucChannelNum, 0x%x\n", prBowLinkConnected->rChannel.ucChannelNum)); - DBGLOG(BOW, EVENT, ("prBowLinkConnected->rChannel.ucChannelBand, 0x%x\n", prBowLinkConnected->rChannel.ucChannelBand)); - DBGLOG(BOW, EVENT, ("wlanbowCmdEventLinkConnected, prBowFsmInfo->aucPeerAddress, %x:%x:%x:%x:%x:%x.\n", - prBowFsmInfo->aucPeerAddress[0], - prBowFsmInfo->aucPeerAddress[1], - prBowFsmInfo->aucPeerAddress[2], - prBowFsmInfo->aucPeerAddress[3], - prBowFsmInfo->aucPeerAddress[4], - prBowFsmInfo->aucPeerAddress[5])); - DBGLOG(BOW, EVENT, ("wlanbowCmdEventLinkConnected, prBowLinkConnected->aucPeerAddress, %x:%x:%x:%x:%x:%x.\n", - prBowLinkConnected->aucPeerAddress[0], - prBowLinkConnected->aucPeerAddress[1], - prBowLinkConnected->aucPeerAddress[2], - prBowLinkConnected->aucPeerAddress[3], - prBowLinkConnected->aucPeerAddress[4], - prBowLinkConnected->aucPeerAddress[5])); - DBGLOG(BOW, EVENT, ("wlanbowCmdEventLinkConnected, g_u4LinkCount, %x.\n", g_u4LinkCount)); -#endif - - /*Indicate Event to PAL*/ - kalIndicateBOWEvent(prAdapter->prGlueInfo, prEvent); - kalMemFree(prEvent, VIR_MEM_TYPE, (sizeof(AMPC_EVENT) + sizeof(BOW_LINK_CONNECTED))); - - /*Release channel if granted*/ - if(prBowFsmInfo->fgIsChannelGranted) { - cnmTimerStopTimer(prAdapter, &prBowFsmInfo->rChGrantedTimer); - //bowReleaseCh(prAdapter); - /*Requested, not granted yet*/ - } else if(prBowFsmInfo->fgIsChannelRequested) { - prBowFsmInfo->fgIsChannelRequested = FALSE; - } - - /* set to connected status*/ - bowSetBowTableState(prAdapter, prBowFsmInfo->aucPeerAddress, BOW_DEVICE_STATE_CONNECTED); - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief command done handler for CMD_ID_CMD_BT_OVER_WIFI -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmdInfo Pointer to the buffer that holds the command info -* \param[in] pucEventBuf Pointer to the set buffer OR event buffer -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanbowCmdEventLinkDisconnected( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_AMPC_EVENT prEvent; - P_BOW_LINK_DISCONNECTED prBowLinkDisconnected; - P_BOW_FSM_INFO_T prBowFsmInfo; - BOW_TABLE_T rBowTable; - UINT_8 ucBowTableIdx; - ENUM_BOW_DEVICE_STATE eFsmState; - BOOL fgSendDeauth = FALSE; - - ASSERT(prAdapter); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - eFsmState = bowGetBowTableState(prAdapter, prBowFsmInfo->aucPeerAddress); - - if(eFsmState == BOW_DEVICE_STATE_DISCONNECTED) { - /*do nothing*/ - return; - } - /*Cancel scan*/ - else if(eFsmState == BOW_DEVICE_STATE_SCANNING && - !(prBowFsmInfo->fgIsChannelRequested)) { - bowResponderCancelScan(prAdapter, FALSE); - bowSetBowTableState(prAdapter, prBowFsmInfo->aucPeerAddress, BOW_DEVICE_STATE_DISCONNECTING); - return; - } - - // fill event header - prEvent = (P_AMPC_EVENT) kalMemAlloc((sizeof(AMPC_EVENT) + sizeof(BOW_LINK_DISCONNECTED)), VIR_MEM_TYPE); - prEvent->rHeader.ucEventId = BOW_EVENT_ID_LINK_DISCONNECTED; - if ((prCmdInfo->u4PrivateData)) - { - prEvent->rHeader.ucSeqNumber = (UINT_8) prCmdInfo->u4PrivateData; - } - else - { - prEvent->rHeader.ucSeqNumber = 0; - } - - prEvent->rHeader.u2PayloadLength = sizeof(BOW_LINK_DISCONNECTED); - - // fill event body - prBowLinkDisconnected = (P_BOW_LINK_DISCONNECTED)(prEvent->aucPayload); - kalMemZero(prBowLinkDisconnected, sizeof(BOW_LINK_DISCONNECTED)); - prBowLinkDisconnected->ucReason = 0x0; - COPY_MAC_ADDR(prBowLinkDisconnected->aucPeerAddress, prBowFsmInfo->aucPeerAddress); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("prEvent->rHeader.ucEventId, 0x%x\n", prEvent->rHeader.ucEventId)); - DBGLOG(BOW, EVENT, ("prEvent->rHeader.ucSeqNumber, 0x%x\n", prEvent->rHeader.ucSeqNumber)); - DBGLOG(BOW, EVENT, ("prEvent->rHeader.u2PayloadLength, 0x%x\n", prEvent->rHeader.u2PayloadLength)); - - DBGLOG(BOW, EVENT, ("wlanbowCmdEventLinkDisconnected, prBowFsmInfo->aucPeerAddress, %x:%x:%x:%x:%x:%x.\n", - prBowFsmInfo->aucPeerAddress[0], - prBowFsmInfo->aucPeerAddress[1], - prBowFsmInfo->aucPeerAddress[2], - prBowFsmInfo->aucPeerAddress[3], - prBowFsmInfo->aucPeerAddress[4], - prBowFsmInfo->aucPeerAddress[5])); - - DBGLOG(BOW, EVENT, ("wlanbowCmdEventLinkDisconnected, prBowLinkDisconnected->aucPeerAddress, %x:%x:%x:%x:%x:%x.\n", - prBowLinkDisconnected->aucPeerAddress[0], - prBowLinkDisconnected->aucPeerAddress[1], - prBowLinkDisconnected->aucPeerAddress[2], - prBowLinkDisconnected->aucPeerAddress[3], - prBowLinkDisconnected->aucPeerAddress[4], - prBowLinkDisconnected->aucPeerAddress[5])); - - DBGLOG(BOW, EVENT, ("wlanbowCmdEventLinkDisconnected, g_u4LinkCount, %x.\n", g_u4LinkCount)); -#endif - - /*Indicate BoW event to PAL*/ -#if 0 - kalIndicateBOWEvent(prAdapter->prGlueInfo, prEvent); - kalMemFree(prEvent, VIR_MEM_TYPE, (sizeof(AMPC_EVENT) + sizeof(BOW_LINK_DISCONNECTED))); -#endif - - // set to disconnected status - prBowFsmInfo->prTargetStaRec = cnmGetStaRecByAddress(prAdapter, NETWORK_TYPE_BOW_INDEX, prBowLinkDisconnected->aucPeerAddress); - - /*Release channel if granted*/ - if(prBowFsmInfo->fgIsChannelGranted) { - cnmTimerStopTimer(prAdapter, &prBowFsmInfo->rChGrantedTimer); - bowReleaseCh(prAdapter); - /*Requested, not granted yet*/ - } else if(prBowFsmInfo->fgIsChannelRequested) { - prBowFsmInfo->fgIsChannelRequested = FALSE; - //bowReleaseCh(prAdapter); - } - -#if 1 - /*Send Deauth to connected peer*/ - if (eFsmState == BOW_DEVICE_STATE_CONNECTED && - (prBowFsmInfo->prTargetStaRec->ucStaState == STA_STATE_3)) - { - fgSendDeauth = TRUE; -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("wlanbowCmdEventLinkDisconnected, bowGetBowTableState, %x.\n", bowGetBowTableState(prAdapter, prBowLinkDisconnected->aucPeerAddress))); -#endif - authSendDeauthFrame(prAdapter, - prBowFsmInfo->prTargetStaRec, - (P_SW_RFB_T)NULL, - REASON_CODE_DEAUTH_LEAVING_BSS, - (PFN_TX_DONE_HANDLER)bowDisconnectLink); - } -#endif - -#if 0 - //3 <3>Stop this link; flush Tx; send deAuthentication -> abort. SAA, AAA. need to check BOW table state == Connected. - if (prAdapter->prGlueInfo->i4TxPendingFrameNum > 0) { - kalFlushPendingTxPackets(prAdapter->prGlueInfo); - } - - /* flush pending security frames */ - if (prAdapter->prGlueInfo->i4TxPendingSecurityFrameNum > 0) { - kalClearSecurityFrames(prAdapter->prGlueInfo); - } -#endif - - /*Update BoW table*/ - bowGetBowTableEntryByPeerAddress(prAdapter, prBowLinkDisconnected->aucPeerAddress, &ucBowTableIdx); - rBowTable.fgIsValid = FALSE; - rBowTable.eState = BOW_DEVICE_STATE_DISCONNECTED; - bowSetBowTableContent(prAdapter, ucBowTableIdx, &rBowTable); - - /*Indicate BoW event to PAL*/ - kalIndicateBOWEvent(prAdapter->prGlueInfo, prEvent); - kalMemFree(prEvent, VIR_MEM_TYPE, (sizeof(AMPC_EVENT) + sizeof(BOW_LINK_DISCONNECTED))); - - /*Decrease link count*/ - GLUE_DEC_REF_CNT(g_u4LinkCount); - - /*If no need to send deauth, DO disconnect now*/ - /*If need to send deauth, DO disconnect at deauth Tx done*/ - if(!fgSendDeauth){ - bowDisconnectLink(prAdapter, NULL, TX_RESULT_SUCCESS); - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief command done handler for CMD_ID_CMD_BT_OVER_WIFI -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmdInfo Pointer to the buffer that holds the command info -* \param[in] pucEventBuf Pointer to the set buffer OR event buffer -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanbowCmdEventSetSetupConnection ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_AMPC_EVENT prEvent; - P_BOW_COMMAND_STATUS prBowCmdStatus; - P_WIFI_CMD_T prWifiCmd; - P_CMD_BT_OVER_WIFI prCmdBtOverWifi; - P_BOW_FSM_INFO_T prBowFsmInfo; - - ASSERT(prAdapter); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - - // restore original command for rPeerAddr - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prCmdBtOverWifi = (P_CMD_BT_OVER_WIFI)(prWifiCmd->aucBuffer); - - // fill event header - prEvent = (P_AMPC_EVENT) kalMemAlloc((sizeof(AMPC_EVENT) + sizeof(BOW_COMMAND_STATUS)), VIR_MEM_TYPE); - prEvent->rHeader.ucEventId = BOW_EVENT_ID_COMMAND_STATUS; - prEvent->rHeader.ucSeqNumber = (UINT_8) prCmdInfo->u4PrivateData; - prEvent->rHeader.u2PayloadLength = sizeof(BOW_COMMAND_STATUS); - - // fill event body - prBowCmdStatus = (P_BOW_COMMAND_STATUS)(prEvent->aucPayload); - kalMemZero(prBowCmdStatus, sizeof(BOW_COMMAND_STATUS)); - prBowCmdStatus->ucStatus = BOWCMD_STATUS_SUCCESS; - - /*Indicate BoW event to PAL*/ - kalIndicateBOWEvent(prAdapter->prGlueInfo, prEvent); - kalMemFree(prEvent, VIR_MEM_TYPE, (sizeof(AMPC_EVENT) + sizeof(BOW_COMMAND_STATUS))); - - // set to starting status - kalSetBowState(prAdapter->prGlueInfo, - BOW_DEVICE_STATE_STARTING, - prCmdBtOverWifi->rPeerAddr); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This is the command done handler for BOW_CMD_ID_READ_LINK_QUALITY -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmdInfo Pointer to the buffer that holds the command info -* \param[in] pucEventBuf Pointer to the set buffer OR event buffer -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanbowCmdEventReadLinkQuality ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_EVENT_LINK_QUALITY prLinkQuality; - P_AMPC_EVENT prEvent; - P_BOW_LINK_QUALITY prBowLinkQuality; - - ASSERT(prAdapter); - - prLinkQuality = (P_EVENT_LINK_QUALITY)pucEventBuf; - - // fill event header - prEvent = (P_AMPC_EVENT) kalMemAlloc((sizeof(AMPC_EVENT) + sizeof(BOW_LINK_QUALITY)), VIR_MEM_TYPE); - prEvent->rHeader.ucEventId = BOW_EVENT_ID_LINK_QUALITY; - prEvent->rHeader.ucSeqNumber = (UINT_8) prCmdInfo->u4PrivateData; - prEvent->rHeader.u2PayloadLength = sizeof(BOW_LINK_QUALITY); - - // fill event body - prBowLinkQuality = (P_BOW_LINK_QUALITY)(prEvent->aucPayload); - kalMemZero(prBowLinkQuality, sizeof(BOW_LINK_QUALITY)); - prBowLinkQuality->ucLinkQuality = (UINT_8)prLinkQuality->cLinkQuality; - - kalIndicateBOWEvent(prAdapter->prGlueInfo, prEvent); - - kalMemFree(prEvent, VIR_MEM_TYPE, (sizeof(AMPC_EVENT) + sizeof(BOW_LINK_QUALITY))); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This is the command done handler for BOW_CMD_ID_READ_RSSI -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmdInfo Pointer to the buffer that holds the command info -* \param[in] pucEventBuf Pointer to the set buffer OR event buffer -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanbowCmdEventReadRssi ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_EVENT_LINK_QUALITY prLinkQuality; - P_AMPC_EVENT prEvent; - P_BOW_RSSI prBowRssi; - - ASSERT(prAdapter); - - prLinkQuality = (P_EVENT_LINK_QUALITY)pucEventBuf; - - // fill event header - prEvent = (P_AMPC_EVENT) kalMemAlloc((sizeof(AMPC_EVENT) + sizeof(BOW_LINK_QUALITY)), VIR_MEM_TYPE); - prEvent->rHeader.ucEventId = BOW_EVENT_ID_RSSI; - prEvent->rHeader.ucSeqNumber = (UINT_8) prCmdInfo->u4PrivateData; - prEvent->rHeader.u2PayloadLength = sizeof(BOW_RSSI); - - // fill event body - prBowRssi = (P_BOW_RSSI)(prEvent->aucPayload); - kalMemZero(prBowRssi, sizeof(BOW_RSSI)); - prBowRssi->cRssi = (INT_8) prLinkQuality->cRssi; - - kalIndicateBOWEvent(prAdapter->prGlueInfo, prEvent); - - kalMemFree(prEvent, VIR_MEM_TYPE, (sizeof(AMPC_EVENT) + sizeof(BOW_LINK_QUALITY))); - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This is the default command timeout handler -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] prCmdInfo Pointer to the buffer that holds the command info -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanbowCmdTimeoutHandler ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ) -{ - P_AMPC_EVENT prEvent; - P_BOW_COMMAND_STATUS prBowCmdStatus; - - ASSERT(prAdapter); - - // fill event header - prEvent = (P_AMPC_EVENT) kalMemAlloc((sizeof(AMPC_EVENT) + sizeof(BOW_COMMAND_STATUS)), VIR_MEM_TYPE); - prEvent->rHeader.ucEventId = BOW_EVENT_ID_COMMAND_STATUS; - prEvent->rHeader.ucSeqNumber = (UINT_8) prCmdInfo->u4PrivateData; - prEvent->rHeader.u2PayloadLength = sizeof(BOW_COMMAND_STATUS); - - // fill event body - prBowCmdStatus = (P_BOW_COMMAND_STATUS)(prEvent->aucPayload); - kalMemZero(prBowCmdStatus, sizeof(BOW_COMMAND_STATUS)); - - prBowCmdStatus->ucStatus = BOWCMD_STATUS_TIMEOUT; // timeout - - kalIndicateBOWEvent(prAdapter->prGlueInfo, prEvent); - - kalMemFree(prEvent, VIR_MEM_TYPE, (sizeof(AMPC_EVENT) + sizeof(BOW_COMMAND_STATUS))); - - return; -} - - -VOID -bowStopping( - IN P_ADAPTER_T prAdapter - ) -{ - P_BOW_FSM_INFO_T prBowFsmInfo; - P_BSS_INFO_T prBowBssInfo; - - ASSERT(prAdapter); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - prBowBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowStoping.\n")); - DBGLOG(BOW, EVENT, ("bowStoping, SSID %s.\n", prBowBssInfo->aucSSID)); - DBGLOG(BOW, EVENT, ("bowStoping, prBowBssInfo->aucBSSID, %x:%x:%x:%x:%x:%x.\n", - prBowBssInfo->aucBSSID[0], - prBowBssInfo->aucBSSID[1], - prBowBssInfo->aucBSSID[2], - prBowBssInfo->aucBSSID[3], - prBowBssInfo->aucBSSID[4], - prBowBssInfo->aucBSSID[5])); - DBGLOG(BOW, EVENT, ("bowStoping, prBssInfo->aucOwnMacAddr, %x:%x:%x:%x:%x:%x.\n", - prBowBssInfo->aucOwnMacAddr[0], - prBowBssInfo->aucOwnMacAddr[1], - prBowBssInfo->aucOwnMacAddr[2], - prBowBssInfo->aucOwnMacAddr[3], - prBowBssInfo->aucOwnMacAddr[4], - prBowBssInfo->aucOwnMacAddr[5])); - DBGLOG(BOW, EVENT, ("bowStoping, prAdapter->rWifiVar.aucDeviceAddress, %x:%x:%x:%x:%x:%x.\n", - prAdapter->rWifiVar.aucDeviceAddress[0], - prAdapter->rWifiVar.aucDeviceAddress[1], - prAdapter->rWifiVar.aucDeviceAddress[2], - prAdapter->rWifiVar.aucDeviceAddress[3], - prAdapter->rWifiVar.aucDeviceAddress[4], - prAdapter->rWifiVar.aucDeviceAddress[5])); - DBGLOG(BOW, EVENT, ("bowStopping, g_u4LinkCount, %x.\n", g_u4LinkCount)); - DBGLOG(BOW, EVENT, ("prBowFsmInfo->aucPeerAddress, %x:%x:%x:%x:%x:%x.\n", prBowFsmInfo->aucPeerAddress[0], - prBowFsmInfo->aucPeerAddress[1], - prBowFsmInfo->aucPeerAddress[2], - prBowFsmInfo->aucPeerAddress[3], - prBowFsmInfo->aucPeerAddress[4], - prBowFsmInfo->aucPeerAddress[5])); - kalPrint("BoW Stoping,[%d,%d]\n", g_u4LinkCount, g_u4Beaconing); -#endif - - if (g_u4LinkCount == 0) - { - /*Stop beaconing*/ - GLUE_DEC_REF_CNT(g_u4Beaconing); - - /*Deactive BoW network*/ - //prBowBssInfo->fgIsNetActive = FALSE; - //prBowBssInfo->fgIsBeaconActivated = FALSE; - nicPmIndicateBssAbort(prAdapter, NETWORK_TYPE_BOW_INDEX); - bowChangeMediaState(prAdapter, PARAM_MEDIA_STATE_DISCONNECTED); - nicUpdateBss(prAdapter, NETWORK_TYPE_BOW_INDEX); - /*temp solution for FW hal_pwr_mgt.c#3037 ASSERT*/ - nicDeactivateNetwork(prAdapter, NETWORK_TYPE_BOW_INDEX); - SET_NET_PWR_STATE_IDLE(prAdapter, NETWORK_TYPE_BOW_INDEX); - UNSET_NET_ACTIVE(prAdapter, NETWORK_TYPE_BOW_INDEX); - - } - - return; -} - - -VOID -bowStarting( - IN P_ADAPTER_T prAdapter - ) -{ - P_BOW_FSM_INFO_T prBowFsmInfo; - P_BSS_INFO_T prBssInfo; - - ASSERT(prAdapter); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - - if (g_u4LinkCount == 1) - { -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("BoW Starting.\n")); - DBGLOG(BOW, EVENT, ("BoW channel granted.\n")); -#endif - -#if 0 - /*Active BoW Network*/ - SET_NET_ACTIVE(prAdapter, NETWORK_TYPE_BOW_INDEX); - SET_NET_PWR_STATE_ACTIVE(prAdapter, NETWORK_TYPE_BOW_INDEX); - nicActivateNetwork(prAdapter, NETWORK_TYPE_BOW_INDEX); -#endif - - //3 <1> Update BSS_INFO_T per Network Basis - //4 <1.1> Setup Operation Mode - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]); - prBssInfo->ucNetTypeIndex = NETWORK_TYPE_BOW_INDEX; - prBssInfo->eCurrentOPMode = OP_MODE_BOW; - - //4 <1.2> Setup SSID - COPY_MAC_ADDR(prBssInfo->aucOwnMacAddr, prAdapter->rWifiVar.aucDeviceAddress); - COPY_MAC_ADDR(prBssInfo->aucBSSID, prAdapter->rWifiVar.aucDeviceAddress); - prBssInfo->ucSSIDLen = BOW_SSID_LEN; - bowAssignSsid(prBssInfo->aucSSID, prBssInfo->aucOwnMacAddr); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("SSID %s.\n", prBssInfo->aucSSID)); - DBGLOG(BOW, EVENT, ("prBssInfo->aucBSSID, %x:%x:%x:%x:%x:%x.\n", - prBssInfo->aucBSSID[0], - prBssInfo->aucBSSID[1], - prBssInfo->aucBSSID[2], - prBssInfo->aucBSSID[3], - prBssInfo->aucBSSID[4], - prBssInfo->aucBSSID[5])); - DBGLOG(BOW, EVENT, ("prBssInfo->aucOwnMacAddr, %x:%x:%x:%x:%x:%x.\n", - prBssInfo->aucOwnMacAddr[0], - prBssInfo->aucOwnMacAddr[1], - prBssInfo->aucOwnMacAddr[2], - prBssInfo->aucOwnMacAddr[3], - prBssInfo->aucOwnMacAddr[4], - prBssInfo->aucOwnMacAddr[5])); - DBGLOG(BOW, EVENT, ("prAdapter->rWifiVar.aucDeviceAddress, %x:%x:%x:%x:%x:%x.\n", - prAdapter->rWifiVar.aucDeviceAddress[0], - prAdapter->rWifiVar.aucDeviceAddress[1], - prAdapter->rWifiVar.aucDeviceAddress[2], - prAdapter->rWifiVar.aucDeviceAddress[3], - prAdapter->rWifiVar.aucDeviceAddress[4], - prAdapter->rWifiVar.aucDeviceAddress[5])); -#endif - - //4 <1.3> Clear current AP's STA_RECORD_T and current AID - prBssInfo->prStaRecOfAP = (P_STA_RECORD_T)NULL; - prBssInfo->u2AssocId = 0; - - //4 <1.4> Setup Channel, Band and Phy Attributes - prBssInfo->ucPrimaryChannel = prBowFsmInfo->ucPrimaryChannel; - if (prBowFsmInfo->eBand == BAND_2G4) - { - prBssInfo->eBand = BAND_2G4; - } - else - { - prBssInfo->eBand = BAND_5G; - } - -#if CFG_BOW_SUPPORT_11N - prBssInfo->ucPhyTypeSet = prAdapter->rWifiVar.ucAvailablePhyTypeSet & PHY_TYPE_SET_802_11BGN; /* Depend on eBand */ - prBssInfo->ucConfigAdHocAPMode = AP_MODE_MIXED_11BG; /* Depend on eCurrentOPMode and ucPhyTypeSet */ - - prBssInfo->ucNonHTBasicPhyType = (UINT_8) - rNonHTApModeAttributes[prBssInfo->ucConfigAdHocAPMode].ePhyTypeIndex; - prBssInfo->u2BSSBasicRateSet = - rNonHTApModeAttributes[prBssInfo->ucConfigAdHocAPMode].u2BSSBasicRateSet; - - prBssInfo->u2OperationalRateSet = - rNonHTPhyAttributes[prBssInfo->ucNonHTBasicPhyType].u2SupportedRateSet; - - rateGetDataRatesFromRateSet(prBssInfo->u2OperationalRateSet, - prBssInfo->u2BSSBasicRateSet, - prBssInfo->aucAllSupportedRates, - &prBssInfo->ucAllSupportedRatesLen); - -#else - if (prBssInfo->eBand == BAND_2G4) - { - prBssInfo->ucPhyTypeSet = PHY_TYPE_SET_802_11BG; /* Depend on eBand */ - prBssInfo->ucConfigAdHocAPMode = AP_MODE_MIXED_11BG; /* Depend on eCurrentOPMode and ucPhyTypeSet */ - - prBssInfo->u2BSSBasicRateSet = BASIC_RATE_SET_ERP; //RATE_SET_ERP; - prBssInfo->u2OperationalRateSet = RATE_SET_ERP; - prBssInfo->ucNonHTBasicPhyType = PHY_TYPE_ERP_INDEX; - } - else - { - //prBssInfo->ucPhyTypeSet = PHY_TYPE_SET_802_11BG; /* Depend on eBand */ - //prBssInfo->ucConfigAdHocAPMode = AP_MODE_MIXED_11BG; /* Depend on eCurrentOPMode and ucPhyTypeSet */ - prBssInfo->ucPhyTypeSet = PHY_TYPE_SET_802_11A; /* Depend on eBand */ - prBssInfo->ucConfigAdHocAPMode = AP_MODE_11A; /* Depend on eCurrentOPMode and ucPhyTypeSet */ - - //prBssInfo->u2BSSBasicRateSet = BASIC_RATE_SET_ERP; //RATE_SET_ERP; - //prBssInfo->u2OperationalRateSet = RATE_SET_ERP; - - prBssInfo->u2BSSBasicRateSet = BASIC_RATE_SET_OFDM; //RATE_SET_ERP; - prBssInfo->u2OperationalRateSet = RATE_SET_OFDM; - prBssInfo->ucNonHTBasicPhyType = PHY_TYPE_OFDM_INDEX; - } - - -#endif - prBssInfo->fgErpProtectMode = FALSE; - - //4 <1.5> Setup MIB for current BSS - prBssInfo->u2BeaconInterval = prBowFsmInfo->u2BeaconInterval; - prBssInfo->ucDTIMPeriod = DOT11_DTIM_PERIOD_DEFAULT; - prBssInfo->u2ATIMWindow = 0; - prBssInfo->ucBeaconTimeoutCount = 0; - if (prBowFsmInfo->fgSupportQoS) - { - prAdapter->rWifiVar.fgSupportQoS = TRUE; - prBssInfo->fgIsQBSS = TRUE; - } - - - //3 <2> Update BSS_INFO_T common part -#if CFG_SUPPORT_AAA - bssInitForAP(prAdapter, prBssInfo, TRUE); - nicQmUpdateWmmParms(prAdapter, NETWORK_TYPE_BOW_INDEX); -#endif /* CFG_SUPPORT_AAA */ - prBssInfo->fgIsNetActive = TRUE; - prBssInfo->fgIsBeaconActivated = TRUE; - - //3 <3> Set MAC HW - - //4 <2> Initiate BSS_INFO_T - common part - BOW_BSS_INFO_INIT(prAdapter, NETWORK_TYPE_BOW_INDEX); -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("prBowFsmInfo->aucPeerAddress, %x:%x:%x:%x:%x:%x.\n", prBowFsmInfo->aucPeerAddress[0], - prBowFsmInfo->aucPeerAddress[1], - prBowFsmInfo->aucPeerAddress[2], - prBowFsmInfo->aucPeerAddress[3], - prBowFsmInfo->aucPeerAddress[4], - prBowFsmInfo->aucPeerAddress[5])); -#endif - - //4 <3.1> use command packets to inform firmware - rlmBssInitForAPandIbss(prAdapter, prBssInfo); - nicUpdateBss(prAdapter, NETWORK_TYPE_BOW_INDEX); - - //4 <3.2> Update AdHoc PM parameter - nicPmIndicateBssCreated(prAdapter, NETWORK_TYPE_BOW_INDEX); - - //4 <3.1> Reset HW TSF Update Mode and Beacon Mode - - //4 <3.2> Setup BSSID - // TODO: rxmSetRxFilterBSSID0 -// rxmSetRxFilterBSSID0(prBssInfo->ucHwBssidId, prBssInfo->aucBSSID); - - //4 <3.3> Setup RX Filter to accept Probe Request - // TODO: f get/set RX filter. - -#if 0 - { - UINT_32 u4RxFilter; - if (halMacRxGetRxFilters(&u4RxFilter)== HAL_STATUS_SUCCESS) { - - u4RxFilter &= ~BIT(RXFILTER_DROP_PROBE_REQ); - - halMacRxSetRxFilters(u4RxFilter); - } - } -#endif - } - - /*Update BoW Table*/ - bowSetBowTableState(prAdapter, prBowFsmInfo->aucPeerAddress, BOW_DEVICE_STATE_STARTING); - -#if CFG_BOW_TEST - kalPrint("BoW Starting,[%d,%d]\n", g_u4LinkCount, g_u4Beaconing); - DBGLOG(BOW, EVENT, ("bowStarting, g_u4LinkCount, %x.\n", g_u4LinkCount)); -#endif - - /*Start beaconing*/ - if (g_u4Beaconing < 1) - { - GLUE_INC_REF_CNT(g_u4Beaconing); - bssSendBeaconProbeResponse(prAdapter, NETWORK_TYPE_BOW_INDEX, NULL, 0); - cnmTimerStartTimer(prAdapter, &prBowFsmInfo->rStartingBeaconTimer, prBowFsmInfo->u2BeaconInterval); - } - -#if 0 - /*Responder: Start to scan Initiator*/ - if (prBowFsmInfo->ucRole == BOW_RESPONDER) - { -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowStarting responder, start scan result searching.\n")); -#endif - cnmTimerStopTimer(prAdapter, &prBowFsmInfo->rChGrantedTimer); - bowReleaseCh(prAdapter); - bowResponderScan(prAdapter); - } - /*Initiator: Request channel, wait for responder*/ - else { - //bowRequestCh(prAdapter); - } -#endif - return; -} - -VOID -bowAssignSsid ( - IN PUINT_8 pucSsid, - IN PUINT_8 puOwnMacAddr - ) -{ - UINT_8 i; - UINT_8 aucSSID[]=BOW_WILDCARD_SSID; - - kalMemCopy(pucSsid, aucSSID, BOW_WILDCARD_SSID_LEN); - - for (i = 0; i < 6; i++) - { - pucSsid[(3 * i) + 3] = 0x2D; - if ((*(puOwnMacAddr + i) >> 4) < 0xA) - { - *(pucSsid + (3 * i) + 4) = (*(puOwnMacAddr + i) >> 4) + 0x30; - } - else - { - *(pucSsid + (3 * i) + 4) = (*(puOwnMacAddr + i) >> 4) + 0x57; - } - - if ((*(puOwnMacAddr + i) & 0x0F) < 0xA) - { - pucSsid[(3 * i) + 5] = (*(puOwnMacAddr + i) & 0x0F) + 0x30; - } - else - { - pucSsid[(3 * i) + 5] = (*(puOwnMacAddr + i) & 0x0F) + 0x57; - } - } - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will validate the Rx Probe Request Frame and then return -* result to BSS to indicate if need to send the corresponding Probe Response -* Frame if the specified conditions were matched. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prSwRfb Pointer to SW RFB data structure. -* @param[out] pu4ControlFlags Control flags for replying the Probe Response -* -* @retval TRUE Reply the Probe Response -* @retval FALSE Don't reply the Probe Response -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -bowValidateProbeReq( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_32 pu4ControlFlags - ) -{ - P_WLAN_MAC_MGMT_HEADER_T prMgtHdr; - P_BOW_FSM_INFO_T prBowFsmInfo; - P_BSS_INFO_T prBssInfo; - P_IE_SSID_T prIeSsid = (P_IE_SSID_T)NULL; - PUINT_8 pucIE; - UINT_16 u2IELength; - UINT_16 u2Offset = 0; - BOOLEAN fgReplyProbeResp = FALSE; - - ASSERT(prSwRfb); - ASSERT(pu4ControlFlags); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]); - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - - -#if 0//CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowValidateProbeReq.\n")); -#endif - - //4 <1> Parse Probe Req IE and Get IE ptr (SSID, Supported Rate IE, ...) - prMgtHdr = (P_WLAN_MAC_MGMT_HEADER_T)prSwRfb->pvHeader; - - u2IELength = prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen; - pucIE = (PUINT_8)((UINT_32)prSwRfb->pvHeader + prSwRfb->u2HeaderLen); - - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - if (ELEM_ID_SSID == IE_ID(pucIE)) { - if ((!prIeSsid) && - (IE_LEN(pucIE) <= ELEM_MAX_LEN_SSID)) { - prIeSsid = (P_IE_SSID_T)pucIE; - } - break; - } - } /* end of IE_FOR_EACH */ - - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - if (ELEM_ID_SSID == IE_ID(pucIE)) { - if ((!prIeSsid) && - (IE_LEN(pucIE) <= ELEM_MAX_LEN_SSID)) { - prIeSsid = (P_IE_SSID_T)pucIE; - } - break; - } - } /* end of IE_FOR_EACH */ - - //4 <2> Check network conditions - /*If BoW AP is beaconing*/ - if (prBssInfo->eCurrentOPMode == OP_MODE_BOW && - g_u4Beaconing > 0) { - - /*Check the probe requset sender is our peer*/ - if(bowCheckBowTableIfVaild(prAdapter, prMgtHdr->aucSrcAddr)) { - fgReplyProbeResp = TRUE; - } - /*Check the probe request target SSID is our SSID*/ - else if ((prIeSsid) && - EQUAL_SSID(prBssInfo->aucSSID, prBssInfo->ucSSIDLen, - prIeSsid->aucSSID, prIeSsid->ucLength)) { - fgReplyProbeResp = TRUE; - } - else { - fgReplyProbeResp = FALSE; - } - } - - return fgReplyProbeResp; - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will indicate an Event of "Media Disconnect" to HOST -* -* @param[in] u4Param Unused timer parameter -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bowSendBeacon( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Param - ) -{ - P_BOW_FSM_INFO_T prBowFsmInfo; - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - - if ((g_u4Beaconing != 0) && (g_u4LinkCount > 0) && (g_u4LinkCount < CFG_BOW_PHYSICAL_LINK_NUM)) - { - //Send beacon - bssSendBeaconProbeResponse(prAdapter, NETWORK_TYPE_BOW_INDEX, NULL, 0); - cnmTimerStartTimer(prAdapter, &prBowFsmInfo->rStartingBeaconTimer, prBowFsmInfo->u2BeaconInterval); - } -#if CFG_BOW_TEST - else { - kalPrint("BoW Send Beacon,[%d,%d]\n", g_u4LinkCount, g_u4Beaconing); - } -#endif -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will indicate an Event of "Media Disconnect" to HOST -* -* @param[in] u4Param Unused timer parameter -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bowResponderScan( - IN P_ADAPTER_T prAdapter - ) -{ - P_BOW_FSM_INFO_T prBowFsmInfo; - P_MSG_SCN_SCAN_REQ prScanReqMsg; - P_BSS_INFO_T prBssInfo; - - ASSERT(prAdapter); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowResponderScan.\n")); - kalPrint("BOW SCAN [REQ:%d]\n", prBowFsmInfo->ucSeqNumOfScanReq+1); -#endif - - prScanReqMsg = (P_MSG_SCN_SCAN_REQ)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_SCN_SCAN_REQ)); - - if (!prScanReqMsg) - { - ASSERT(0); // Can't trigger SCAN FSM - return; - } - - /*Fill scan message*/ - prScanReqMsg->rMsgHdr.eMsgId = MID_BOW_SCN_SCAN_REQ; - prScanReqMsg->ucSeqNum = ++prBowFsmInfo->ucSeqNumOfScanReq; - prScanReqMsg->ucNetTypeIndex = (UINT_8)NETWORK_TYPE_BOW_INDEX; - prScanReqMsg->eScanType = SCAN_TYPE_ACTIVE_SCAN; - prScanReqMsg->ucSSIDType = SCAN_REQ_SSID_SPECIFIED; - prScanReqMsg->ucSSIDLength = BOW_SSID_LEN; - bowAssignSsid(prScanReqMsg->aucSSID, prBowFsmInfo->aucPeerAddress); - prScanReqMsg->ucChannelListNum = 1; - - if (prBowFsmInfo->eBand == BAND_2G4) - { - prScanReqMsg->eScanChannel = SCAN_CHANNEL_SPECIFIED; - prScanReqMsg->arChnlInfoList[0].eBand = BAND_2G4; - } - else - { - prScanReqMsg->eScanChannel = SCAN_CHANNEL_5G; - prScanReqMsg->arChnlInfoList[0].eBand = BAND_5G; - } - - prScanReqMsg->arChnlInfoList[0].ucChannelNum = prBowFsmInfo->ucPrimaryChannel; - prScanReqMsg->u2IELen = 0; - - /*Send scan message*/ - mboxSendMsg(prAdapter, MBOX_ID_0, (P_MSG_HDR_T) prScanReqMsg, MSG_SEND_METHOD_BUF); - - /*Change state to SCANNING*/ - bowSetBowTableState(prAdapter, prBowFsmInfo->aucPeerAddress, BOW_DEVICE_STATE_SCANNING); - - //prBowFsmInfo->fgTryScan = FALSE; /* Will enable background sleep for infrastructure */ - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -bowResponderScanDone( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_SCN_SCAN_DONE prScanDoneMsg; - P_BOW_FSM_INFO_T prBowFsmInfo; - P_BSS_DESC_T prBssDesc; - UINT_8 ucSeqNumOfCompMsg; - P_CONNECTION_SETTINGS_T prConnSettings; - ENUM_BOW_DEVICE_STATE eFsmState; - ENUM_SCAN_STATUS eScanStatus; - - ASSERT(prAdapter); - ASSERT(prMsgHdr); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - prScanDoneMsg = (P_MSG_SCN_SCAN_DONE) prMsgHdr; - eFsmState = bowGetBowTableState(prAdapter, prBowFsmInfo->aucPeerAddress); - - ASSERT(prScanDoneMsg->ucNetTypeIndex == NETWORK_TYPE_BOW_INDEX); - - ucSeqNumOfCompMsg = prScanDoneMsg->ucSeqNum; - eScanStatus = prScanDoneMsg->eScanStatus; - - cnmMemFree(prAdapter, prMsgHdr); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowResponderScanDone.\n")); - kalPrint("BOW SCAN [DONE:%d]\n", ucSeqNumOfCompMsg); -#endif - - if( eScanStatus == SCAN_STATUS_CANCELLED) { -#if CFG_BOW_TEST - kalPrint("BOW SCAN [CANCELLED:%d]\n", ucSeqNumOfCompMsg); -#endif - if(eFsmState == BOW_DEVICE_STATE_DISCONNECTING) { - wlanoidSendSetQueryBowCmd(prAdapter, - CMD_ID_CMD_BT_OVER_WIFI, - TRUE, - FALSE, - wlanbowCmdEventLinkDisconnected, - wlanbowCmdTimeoutHandler, - 0, - NULL, - 0 - ); - } - return; - } - else if(eFsmState == BOW_DEVICE_STATE_DISCONNECTED) { - //bowDisconnectLink(prAdapter, NULL, TX_RESULT_SUCCESS); - return; - } - else if (ucSeqNumOfCompMsg != prBowFsmInfo->ucSeqNumOfScanReq) - { - DBGLOG(BOW, EVENT, ("Sequence no. of BOW Responder scan done is not matched.\n")); - return; - } - else - { - prConnSettings->fgIsScanReqIssued = FALSE; - prBssDesc = scanSearchBssDescByBssid(prAdapter, prBowFsmInfo->aucPeerAddress); -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("End scan result searching.\n")); -#endif - - /*Initiator is FOUND*/ - if (prBssDesc != NULL)// (prBssDesc->aucBSSID != NULL)) - { -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("Search Bow Peer address - %x:%x:%x:%x:%x:%x.\n", prBssDesc->aucBSSID[0], - prBssDesc->aucBSSID[1], - prBssDesc->aucBSSID[2], - prBssDesc->aucBSSID[3], - prBssDesc->aucBSSID[4], - prBssDesc->aucBSSID[5])); - DBGLOG(BOW, EVENT, ("Starting to join initiator.\n")); -#endif - /*Set target BssDesc*/ - prBowFsmInfo->prTargetBssDesc = prBssDesc; - /*Request channel to do JOIN*/ - bowSetBowTableState(prAdapter, prBowFsmInfo->aucPeerAddress, BOW_DEVICE_STATE_ACQUIRING_CHANNEL); - bowRequestCh(prAdapter); - } - /*Initiator is NOT FOUND*/ - else - { - /*Scan again, until PAL timeout*/ - bowResponderScan(prAdapter); -#if 0 - wlanoidSendSetQueryBowCmd(prAdapter, - CMD_ID_CMD_BT_OVER_WIFI, - TRUE, - FALSE, - wlanbowCmdEventLinkDisconnected, - wlanbowCmdTimeoutHandler, - 0, - NULL, - 0 - ); -#endif - } - } - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Function for cancelling scan request. There is another option to extend channel privilige -* for another purpose. -* -* @param fgIsChannelExtention - Keep the channel previlege, but can cancel scan timer. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bowResponderCancelScan ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsChannelExtention - ) -{ - - P_MSG_SCN_SCAN_CANCEL prScanCancel = (P_MSG_SCN_SCAN_CANCEL)NULL; - P_BOW_FSM_INFO_T prBowFsmInfo = (P_BOW_FSM_INFO_T)NULL; - - DEBUGFUNC("bowResponderCancelScan()"); - - do { - ASSERT(prAdapter); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - - if (TRUE) { -#if CFG_BOW_TEST - kalPrint("BOW SCAN [CANCEL:%d]\n", prBowFsmInfo->ucSeqNumOfScanReq); -#endif - /* There is a channel privilege on hand. */ - - DBGLOG(P2P, TRACE, ("BOW Cancel Scan\n")); - - prScanCancel = (P_MSG_SCN_SCAN_CANCEL)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_SCN_SCAN_CANCEL)); - if (!prScanCancel) { - /* Buffer not enough, can not cancel scan request. */ - DBGLOG(P2P, TRACE, ("Buffer not enough, can not cancel scan.\n")); - ASSERT(FALSE); - break; - } - - prScanCancel->rMsgHdr.eMsgId = MID_BOW_SCN_SCAN_CANCEL; - prScanCancel->ucNetTypeIndex = NETWORK_TYPE_BOW_INDEX; - prScanCancel->ucSeqNum = prBowFsmInfo->ucSeqNumOfScanReq; -#if CFG_ENABLE_WIFI_DIRECT - prScanCancel->fgIsChannelExt = fgIsChannelExtention; -#endif - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prScanCancel, - MSG_SEND_METHOD_BUF); - - } - - } while (FALSE); - -} /* bowResponderCancelScan */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Initialization of JOIN STATE -* -* @param[in] prBssDesc The pointer of BSS_DESC_T which is the BSS we will try to join with. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bowResponderJoin( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc - ) -{ - P_BOW_FSM_INFO_T prBowFsmInfo; - P_BSS_INFO_T prBssInfo; - P_CONNECTION_SETTINGS_T prConnSettings; - P_STA_RECORD_T prStaRec; - P_MSG_JOIN_REQ_T prJoinReqMsg; - - ASSERT(prBssDesc); - ASSERT(prAdapter); - - DBGLOG(BOW, EVENT, ("Starting bowResponderJoin.\n")); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - - //4 <1> We are going to connect to this BSS. - prBssDesc->fgIsConnecting = TRUE; - bowSetBowTableState(prAdapter, prBowFsmInfo->aucPeerAddress, BOW_DEVICE_STATE_CONNECTING); - - //4 <2> Setup corresponding STA_RECORD_T - /*Support First JOIN and retry*/ - prStaRec = bssCreateStaRecFromBssDesc( - prAdapter, - STA_TYPE_BOW_AP, - NETWORK_TYPE_BOW_INDEX, - prBssDesc); - - prBowFsmInfo->prTargetStaRec = prStaRec; - - //4 <3> Update ucAvailableAuthTypes which we can choice during SAA - prStaRec->fgIsReAssoc = FALSE; - prBowFsmInfo->ucAvailableAuthTypes = (UINT_8)AUTH_TYPE_OPEN_SYSTEM; - prStaRec->ucTxAuthAssocRetryLimit = TX_AUTH_ASSOCI_RETRY_LIMIT; - - - //4 <4> Use an appropriate Authentication Algorithm Number among the ucAvailableAuthTypes - if (prBowFsmInfo->ucAvailableAuthTypes & - (UINT_8)AUTH_TYPE_OPEN_SYSTEM) { - - DBGLOG(BOW, LOUD, ("JOIN INIT: Try to do Authentication with AuthType == OPEN_SYSTEM.\n")); - prBowFsmInfo->ucAvailableAuthTypes &= - ~(UINT_8)AUTH_TYPE_OPEN_SYSTEM; - - prStaRec->ucAuthAlgNum = (UINT_8)AUTH_ALGORITHM_NUM_OPEN_SYSTEM; - } - else { - ASSERT(0); - } - - //4 <4.1> sync. to firmware domain - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - - //4 <5> Overwrite Connection Setting for eConnectionPolicy - if (prBssDesc->ucSSIDLen) { - COPY_SSID(prConnSettings->aucSSID, - prConnSettings->ucSSIDLen, - prBssDesc->aucSSID, - prBssDesc->ucSSIDLen); -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowResponderJoin, SSID %s.\n", prBssDesc->aucSSID)); - DBGLOG(BOW, EVENT, ("bowResponderJoin, SSID %s.\n", prConnSettings->aucSSID)); -#endif - } - - //4 <6> Send a Msg to trigger SAA to start JOIN process. - prJoinReqMsg = (P_MSG_JOIN_REQ_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_JOIN_REQ_T)); - if (!prJoinReqMsg) { - - ASSERT(0); // Can't trigger SAA FSM - return; - } - - prJoinReqMsg->rMsgHdr.eMsgId = MID_BOW_SAA_FSM_START; - prJoinReqMsg->ucSeqNum = ++prBowFsmInfo->ucSeqNumOfReqMsg; - prJoinReqMsg->prStaRec = prStaRec; - - prBssInfo->prStaRecOfAP = prStaRec; - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("prStaRec->eStaType, %x.\n", prStaRec->eStaType)); - printk("BoW trigger SAA ["MACSTR"]\n", MAC2STR(prStaRec->aucMacAddr)); -#endif - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prJoinReqMsg, - MSG_SEND_METHOD_BUF); - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will handle the Join Complete Event from SAA FSM for BOW FSM -* -* @param[in] prMsgHdr Message of Join Complete of SAA FSM. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bowFsmRunEventJoinComplete( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_JOIN_COMP_T prJoinCompMsg; - P_BOW_FSM_INFO_T prBowFsmInfo; - P_STA_RECORD_T prStaRec; - P_SW_RFB_T prAssocRspSwRfb; - P_BSS_INFO_T prBssInfo; - P_WLAN_ASSOC_RSP_FRAME_T prAssocRspFrame = (P_WLAN_ASSOC_RSP_FRAME_T) NULL; - UINT_16 u2IELength; - PUINT_8 pucIE; - P_BSS_INFO_T prBowBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]); - - ASSERT(prAdapter); - ASSERT(prMsgHdr); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - prJoinCompMsg = (P_MSG_JOIN_COMP_T)prMsgHdr; - prStaRec = prJoinCompMsg->prStaRec; - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("Start bowfsmRunEventJoinComplete.\n")); - DBGLOG(BOW, EVENT, ("bowfsmRunEventJoinComplete ptr check\n")); - DBGLOG(BOW, EVENT, ("prMsgHdr %x\n", prMsgHdr)); - DBGLOG(BOW, EVENT, ("prAdapter %x\n", prAdapter)); - DBGLOG(BOW, EVENT, ("prBowFsmInfo %x\n", prBowFsmInfo)); - DBGLOG(BOW, EVENT, ("prStaRec %x\n", prStaRec)); -#endif - - ASSERT(prStaRec); - ASSERT(prBowFsmInfo); - - // Check SEQ NUM - if (prJoinCompMsg->ucSeqNum == prBowFsmInfo->ucSeqNumOfReqMsg) { - COPY_MAC_ADDR(prBowFsmInfo->aucPeerAddress, prStaRec->aucMacAddr); - - //4 <1> JOIN was successful - if (prJoinCompMsg->rJoinStatus == WLAN_STATUS_SUCCESS) { - prAssocRspSwRfb = prJoinCompMsg->prSwRfb; - prAssocRspFrame = (P_WLAN_ASSOC_RSP_FRAME_T) prAssocRspSwRfb->pvHeader; - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]); - - u2IELength = (UINT_16) ((prAssocRspSwRfb->u2PacketLen - prAssocRspSwRfb->u2HeaderLen) - - (OFFSET_OF(WLAN_ASSOC_RSP_FRAME_T, aucInfoElem[0]) - WLAN_MAC_MGMT_HEADER_LEN)); - pucIE = prAssocRspFrame->aucInfoElem; - - prStaRec->eStaType = STA_TYPE_BOW_AP; - prStaRec->u2DesiredNonHTRateSet &= prBowBssInfo->u2OperationalRateSet; - prStaRec->ucDesiredPhyTypeSet = prStaRec->ucPhyTypeSet & prBowBssInfo->ucPhyTypeSet; -#if CFG_BOW_RATE_LIMITATION - //4 <1.2>Update Rate Set - /*Limit Rate Set to 24M, 48M, 54M */ - prStaRec->u2DesiredNonHTRateSet &= (RATE_SET_BIT_24M | - RATE_SET_BIT_48M | - RATE_SET_BIT_54M); - /*If peer cannot support the above rate set, fix on the avaliable highest rate*/ - if(prStaRec->u2DesiredNonHTRateSet == 0) { - UINT_8 ucHighestRateIndex; - if (rateGetHighestRateIndexFromRateSet(prBowBssInfo->u2OperationalRateSet, &ucHighestRateIndex)) { - prStaRec->u2DesiredNonHTRateSet = BIT(ucHighestRateIndex); - } - } -#endif - - //4 <1.1> Change FW's Media State immediately. - bowChangeMediaState(prAdapter, PARAM_MEDIA_STATE_CONNECTED); - - mqmProcessAssocRsp(prAdapter, prAssocRspSwRfb, pucIE, u2IELength); - - //4 <1.2> Update HT information and set channel - /* Record HT related parameters in rStaRec and rBssInfo - * Note: it shall be called before nicUpdateBss() - */ -#if CFG_BOW_SUPPORT_11N - rlmProcessAssocRsp(prAdapter, prAssocRspSwRfb, pucIE, u2IELength); -#endif - - //4 <1.3> Update BSS_INFO_T - nicUpdateBss(prAdapter, NETWORK_TYPE_BOW_INDEX); -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("Finish bowUpdateBssInfoForJOIN.\n")); -#endif - //4 <1.4> Activate current AP's STA_RECORD_T in Driver. - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_3); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowFsmRunEventJoinComplete, qmActivateStaRec.\n")); -#endif - - //4 <1.7> Set the Next State of BOW FSM - wlanoidSendSetQueryBowCmd(prAdapter, - CMD_ID_CMD_BT_OVER_WIFI, - TRUE, - FALSE, - wlanbowCmdEventLinkConnected, - wlanbowCmdTimeoutHandler, - 0, - NULL, - 0 - ); - } - //4 <2> JOIN was not successful - else - { - /*Retry*/ - bowResponderJoin(prAdapter, prBowFsmInfo->prTargetBssDesc); -#if 0 - wlanoidSendSetQueryBowCmd(prAdapter, - CMD_ID_CMD_BT_OVER_WIFI, - TRUE, - FALSE, - wlanbowCmdEventLinkDisconnected, - wlanbowCmdTimeoutHandler, - 0, - NULL, - 0 - ); -#endif -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("Start bowfsmRunEventJoinComplete -- Join failed.\n")); - printk("BoW trigger SAA REJOIN\n"); -#endif - } - } - - cnmMemFree(prAdapter, prMsgHdr); - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will indicate the Media State to HOST -* -* @param[in] eConnectionState Current Media State -* @param[in] fgDelayIndication Set TRUE for postponing the Disconnect Indication. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bowIndicationOfMediaStateToHost ( - IN P_ADAPTER_T prAdapter, - IN ENUM_PARAM_MEDIA_STATE_T eConnectionState, - IN BOOLEAN fgDelayIndication - ) -{ - EVENT_CONNECTION_STATUS rEventConnStatus; - P_CONNECTION_SETTINGS_T prConnSettings; - P_BSS_INFO_T prBssInfo; - P_BOW_FSM_INFO_T prBowFsmInfo; - - - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]); - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - - // NOTE(Kevin): Move following line to bowChangeMediaState() macro per CM's request. - //prBowBssInfo->eConnectionState = eConnectionState; - - /* For indicating the Disconnect Event only if current media state is - * disconnected and we didn't do indication yet. - */ - if (prBssInfo->eConnectionState == PARAM_MEDIA_STATE_DISCONNECTED) { - if (prBssInfo->eConnectionStateIndicated == eConnectionState) { - return; - } - } - - if (!fgDelayIndication) { - //4 <0> Cancel Delay Timer - cnmTimerStopTimer(prAdapter, &prBowFsmInfo->rIndicationOfDisconnectTimer); - - //4 <1> Fill EVENT_CONNECTION_STATUS - rEventConnStatus.ucMediaStatus = (UINT_8)eConnectionState; - - if (eConnectionState == PARAM_MEDIA_STATE_CONNECTED) { - rEventConnStatus.ucReasonOfDisconnect = DISCONNECT_REASON_CODE_RESERVED; - - if (prBssInfo->eCurrentOPMode == OP_MODE_BOW) { - rEventConnStatus.ucInfraMode = (UINT_8)NET_TYPE_INFRA; - rEventConnStatus.u2AID = prBssInfo->u2AssocId; - rEventConnStatus.u2ATIMWindow = 0; - } - else if (prBssInfo->eCurrentOPMode == OP_MODE_IBSS) { - rEventConnStatus.ucInfraMode = (UINT_8)NET_TYPE_IBSS; - rEventConnStatus.u2AID = 0; - rEventConnStatus.u2ATIMWindow = prBssInfo->u2ATIMWindow; - } - else { - ASSERT(0); - } - - COPY_SSID(rEventConnStatus.aucSsid, - rEventConnStatus.ucSsidLen, - prConnSettings->aucSSID, - prConnSettings->ucSSIDLen); - - COPY_MAC_ADDR(rEventConnStatus.aucBssid, prBssInfo->aucBSSID); - - rEventConnStatus.u2BeaconPeriod = prBssInfo->u2BeaconInterval; - rEventConnStatus.u4FreqInKHz = nicChannelNum2Freq(prBssInfo->ucPrimaryChannel); - - switch (prBssInfo->ucNonHTBasicPhyType) { - case PHY_TYPE_HR_DSSS_INDEX: - rEventConnStatus.ucNetworkType = (UINT_8)PARAM_NETWORK_TYPE_DS; - break; - - case PHY_TYPE_ERP_INDEX: - rEventConnStatus.ucNetworkType = (UINT_8)PARAM_NETWORK_TYPE_OFDM24; - break; - - case PHY_TYPE_OFDM_INDEX: - rEventConnStatus.ucNetworkType = (UINT_8)PARAM_NETWORK_TYPE_OFDM5; - break; - - default: - ASSERT(0); - rEventConnStatus.ucNetworkType = (UINT_8)PARAM_NETWORK_TYPE_DS; - break; - } - } - else { - #if CFG_PRIVACY_MIGRATION - /* Clear the pmkid cache while media disconnect */ - secClearPmkid(prAdapter); - #endif - - rEventConnStatus.ucReasonOfDisconnect = prBssInfo->ucReasonOfDisconnect; - - } - - //4 <2> Indication - nicMediaStateChange(prAdapter, NETWORK_TYPE_BOW_INDEX, &rEventConnStatus); - prBssInfo->eConnectionStateIndicated = eConnectionState; - } - else { - /* NOTE: Only delay the Indication of Disconnect Event */ - ASSERT(eConnectionState == PARAM_MEDIA_STATE_DISCONNECTED); - - DBGLOG(BOW, INFO, ("Postpone the indication of Disconnect for %d seconds\n", - prConnSettings->ucDelayTimeOfDisconnectEvent)); - - cnmTimerStartTimer(prAdapter, - &prBowFsmInfo->rIndicationOfDisconnectTimer, - SEC_TO_MSEC(prConnSettings->ucDelayTimeOfDisconnectEvent)); - } - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will indiate the Event of Tx Fail of AAA Module. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bowRunEventAAATxFail ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ) -{ - P_BSS_INFO_T prBssInfo; - - ASSERT(prAdapter); - ASSERT(prStaRec); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowRunEventAAATxFail , bssRemoveStaRecFromClientList.\n")); - printk("BoW AAA TxFail, target state %d\n", prStaRec->ucStaState+1); -#endif - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]); - bssRemoveStaRecFromClientList(prAdapter, prBssInfo, prStaRec); - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will indiate the Event of Successful Completion of AAA Module. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -bowRunEventAAAComplete ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ) -{ - P_BOW_FSM_INFO_T prBowFsmInfo; - - ASSERT(prStaRec); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowRunEventAAAComplete, cnmStaRecChangeState, STA_STATE_3.\n")); - printk("BoW AAA complete ["MACSTR"]\n", MAC2STR(prStaRec->aucMacAddr)); -#endif - - /*Update BssInfo to connected*/ - bowChangeMediaState(prAdapter, PARAM_MEDIA_STATE_CONNECTED); - nicUpdateBss(prAdapter, NETWORK_TYPE_BOW_INDEX); - - /*Update StaRec to State3*/ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_3); - - /*Connected*/ - wlanoidSendSetQueryBowCmd(prAdapter, - CMD_ID_CMD_BT_OVER_WIFI, - TRUE, - FALSE, - wlanbowCmdEventLinkConnected, - wlanbowCmdTimeoutHandler, - 0, - NULL, - 0 - ); - - return WLAN_STATUS_SUCCESS; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will handle RxDeauth -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ - -WLAN_STATUS -bowRunEventRxDeAuth ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prSwRfb - ) -{ - P_BSS_INFO_T prBowBssInfo; - P_BOW_FSM_INFO_T prBowFsmInfo; - ENUM_BOW_DEVICE_STATE eFsmState; - - ASSERT(prAdapter); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - prBowBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]); - - if(!IS_STA_IN_BOW(prStaRec)) { - return WLAN_STATUS_NOT_ACCEPTED; - } - - eFsmState = bowGetBowTableState(prAdapter, prStaRec->aucMacAddr); - - if(eFsmState == BOW_DEVICE_STATE_DISCONNECTED) { - /*do nothing*/ - return WLAN_STATUS_NOT_ACCEPTED; - } - - if (prStaRec->ucStaState > STA_STATE_1) { - - if (STA_STATE_3 == prStaRec->ucStaState) { - //P_MSG_AIS_ABORT_T prAisAbortMsg; - - /* NOTE(Kevin): Change state immediately to avoid starvation of - * MSG buffer because of too many deauth frames before changing - * the STA state. - */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - } - - COPY_MAC_ADDR(prBowFsmInfo->aucPeerAddress, prStaRec->aucMacAddr); - - wlanoidSendSetQueryBowCmd(prAdapter, - CMD_ID_CMD_BT_OVER_WIFI, - TRUE, - FALSE, - wlanbowCmdEventLinkDisconnected, - wlanbowCmdTimeoutHandler, - 0, - NULL, - 0 - ); - - return WLAN_STATUS_SUCCESS; - } - - return WLAN_STATUS_NOT_ACCEPTED; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function handle BoW Link disconnect. -* -* \param[in] pMsduInfo Pointer to the Msdu Info -* \param[in] rStatus The Tx done status -* -* \return - -* -* \note after receive deauth frame, callback function call this -*/ -/*----------------------------------------------------------------------------*/ -VOID -bowDisconnectLink ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ) -{ - P_BOW_FSM_INFO_T prBowFsmInfo; - P_STA_RECORD_T prStaRec; - - ASSERT(prAdapter); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - - /*Free target StaRec*/ - if(prMsduInfo) { - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - } - else { - prStaRec = prBowFsmInfo->prTargetStaRec; - } - - if(prStaRec) { - //cnmStaRecFree(prAdapter, prStaRec, TRUE); - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - } - kalPrint("bowDisconnectLink\n"); - /*No one connected*/ - if (g_u4LinkCount == 0 && g_u4Beaconing != 0) - { - cnmTimerStopTimer(prAdapter, &prBowFsmInfo->rStartingBeaconTimer); - bowStopping(prAdapter); - kalPrint("bowStopping\n"); - /*Restore TxPower from Short range mode*/ -#if CFG_SUPPORT_NVRAM && 0 - wlanLoadManufactureData(prAdapter, kalGetConfiguration(prAdapter->prGlueInfo)); -#endif - /*Uninit BoW Interface*/ -#if CFG_BOW_SEPARATE_DATA_PATH - kalUninitBowDevice(prAdapter->prGlueInfo); -#endif - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will validate the Rx Assoc Req Frame and then return -* the status code to AAA to indicate if need to perform following actions -* when the specified conditions were matched. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prSwRfb Pointer to SW RFB data structure. -* @param[out] pu2StatusCode The Status Code of Validation Result -* -* @retval TRUE Reply the Assoc Resp -* @retval FALSE Don't reply the Assoc Resp -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -bowValidateAssocReq ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_16 pu2StatusCode - ) -{ - BOOLEAN fgReplyAssocResp = FALSE; - P_BSS_INFO_T prBowBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]); - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - P_BOW_FSM_INFO_T prBowFsmInfo; - P_WLAN_ASSOC_REQ_FRAME_T prAssocReqFrame = (P_WLAN_ASSOC_REQ_FRAME_T)NULL; - OS_SYSTIME rCurrentTime; - static OS_SYSTIME rLastRejectAssocTime = 0; - - ASSERT(prAdapter); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - prAssocReqFrame = (P_WLAN_ASSOC_REQ_FRAME_T) prSwRfb->pvHeader; - *pu2StatusCode = STATUS_CODE_REQ_DECLINED; - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowValidateAssocReq, prBowFsmInfo->aucPeerAddress, %x:%x:%x:%x:%x:%x.\n", - prBowFsmInfo->aucPeerAddress[0], - prBowFsmInfo->aucPeerAddress[1], - prBowFsmInfo->aucPeerAddress[2], - prBowFsmInfo->aucPeerAddress[3], - prBowFsmInfo->aucPeerAddress[4], - prBowFsmInfo->aucPeerAddress[5])); - DBGLOG(BOW, EVENT, ("bowValidateAssocReq, prAssocReqFrame->aucSrcAddr, %x:%x:%x:%x:%x:%x.\n", - prAssocReqFrame->aucSrcAddr[0], - prAssocReqFrame->aucSrcAddr[1], - prAssocReqFrame->aucSrcAddr[2], - prAssocReqFrame->aucSrcAddr[3], - prAssocReqFrame->aucSrcAddr[4], - prAssocReqFrame->aucSrcAddr[5])); -#endif - - /*Assoc Accept*/ - while(EQUAL_MAC_ADDR(prAssocReqFrame->aucSrcAddr, prBowFsmInfo->aucPeerAddress)) { -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowValidateAssocReq, return wlanbowCmdEventLinkConnected.\n")); -#endif - /*Update StaRec*/ - prStaRec = cnmGetStaRecByAddress(prAdapter, - (UINT_8) NETWORK_TYPE_BOW_INDEX, - prAssocReqFrame->aucSrcAddr); - prStaRec->eStaType = STA_TYPE_BOW_CLIENT; - prStaRec->u2DesiredNonHTRateSet &= prBowBssInfo->u2OperationalRateSet; - prStaRec->ucDesiredPhyTypeSet = prStaRec->ucPhyTypeSet & prBowBssInfo->ucPhyTypeSet; - -#if CFG_BOW_RATE_LIMITATION - /*Limit Rate Set to 24M, 48M, 54M */ - prStaRec->u2DesiredNonHTRateSet &= (RATE_SET_BIT_24M | - RATE_SET_BIT_48M | - RATE_SET_BIT_54M); - /*If peer cannot support the above rate set, fix on the avaliable highest rate*/ - if(prStaRec->u2DesiredNonHTRateSet == 0) { - UINT_8 ucHighestRateIndex; - if (rateGetHighestRateIndexFromRateSet(prBowBssInfo->u2OperationalRateSet, &ucHighestRateIndex)) { - prStaRec->u2DesiredNonHTRateSet = BIT(ucHighestRateIndex); - } else { - /*If no avaliable rate is found, DECLINE the association*/ - *pu2StatusCode = STATUS_CODE_ASSOC_DENIED_RATE_NOT_SUPPORTED; - break; - } - } -#endif - prStaRec->ucNetTypeIndex = NETWORK_TYPE_BOW_INDEX; - - /*Undpate BssInfo to FW*/ - bowChangeMediaState(prAdapter, PARAM_MEDIA_STATE_CONNECTED); - nicUpdateBss(prAdapter, NETWORK_TYPE_BOW_INDEX); - - /*reply successful*/ - *pu2StatusCode = STATUS_CODE_SUCCESSFUL; - fgReplyAssocResp = TRUE; - break; - } - - /*Reject Assoc*/ - if(*pu2StatusCode != STATUS_CODE_SUCCESSFUL) { - /*Reply Assoc with reject every 5s*/ - rCurrentTime = kalGetTimeTick(); - if(CHECK_FOR_TIMEOUT(rCurrentTime, rLastRejectAssocTime, MSEC_TO_SYSTIME(5000)) || - rLastRejectAssocTime == 0 - ) { - fgReplyAssocResp = TRUE; - rLastRejectAssocTime = rCurrentTime; - } - } - - return fgReplyAssocResp; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will validate the Rx Auth Frame and then return -* the status code to AAA to indicate if need to perform following actions -* when the specified conditions were matched. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prSwRfb Pointer to SW RFB data structure. -* @param[in] pprStaRec Pointer to pointer of STA_RECORD_T structure. -* @param[out] pu2StatusCode The Status Code of Validation Result -* -* @retval TRUE Reply the Auth -* @retval FALSE Don't reply the Auth -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -bowValidateAuth ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN PP_STA_RECORD_T pprStaRec, - OUT PUINT_16 pu2StatusCode - ) -{ - BOOLEAN fgReplyAuth = FALSE; - P_BSS_INFO_T prBowBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]); - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - P_BOW_FSM_INFO_T prBowFsmInfo; - P_WLAN_AUTH_FRAME_T prAuthFrame = (P_WLAN_AUTH_FRAME_T)NULL; - OS_SYSTIME rCurrentTime; - static OS_SYSTIME rLastRejectAuthTime = 0; - - /* TODO(Kevin): Call BoW functions to check .. - 1. Check we are BoW now. - 2. Check we can accept connection from thsi peer - 3. Check Black List here. - */ - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - prAuthFrame = (P_WLAN_AUTH_FRAME_T) prSwRfb->pvHeader; - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowValidateAuth, prBowFsmInfo->aucPeerAddress, %x:%x:%x:%x:%x:%x.\n", - prBowFsmInfo->aucPeerAddress[0], - prBowFsmInfo->aucPeerAddress[1], - prBowFsmInfo->aucPeerAddress[2], - prBowFsmInfo->aucPeerAddress[3], - prBowFsmInfo->aucPeerAddress[4], - prBowFsmInfo->aucPeerAddress[5])); - DBGLOG(BOW, EVENT, ("bowValidateAuth, prAuthFrame->aucSrcAddr, %x:%x:%x:%x:%x:%x.\n", - prAuthFrame->aucSrcAddr[0], - prAuthFrame->aucSrcAddr[1], - prAuthFrame->aucSrcAddr[2], - prAuthFrame->aucSrcAddr[3], - prAuthFrame->aucSrcAddr[4], - prAuthFrame->aucSrcAddr[5])); -#endif - - prStaRec = cnmGetStaRecByAddress(prAdapter, - (UINT_8) NETWORK_TYPE_BOW_INDEX, - prAuthFrame->aucSrcAddr); - if (!prStaRec) { -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowValidateAuth, cnmStaRecAlloc.\n")); -#endif - prStaRec = cnmStaRecAlloc(prAdapter, - (UINT_8) NETWORK_TYPE_BOW_INDEX); - - /* TODO(Kevin): Error handling of allocation of STA_RECORD_T for - * exhausted case and do removal of unused STA_RECORD_T. - */ - ASSERT(prStaRec); - COPY_MAC_ADDR(prStaRec->aucMacAddr, prAuthFrame->aucSrcAddr); - prSwRfb->ucStaRecIdx = prStaRec->ucIndex; - prBowBssInfo->prStaRecOfAP = prStaRec; - - /* NOTE(Kevin): Better to change state here, not at TX Done */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowValidateAuth, cnmStaRecChangeState.\n")); -#endif - } - else - { - prSwRfb->ucStaRecIdx = prStaRec->ucIndex; -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowValidateAuth, prStaRec->ucIndex, %x.\n", prStaRec->ucIndex)); -#endif - bssRemoveStaRecFromClientList(prAdapter, prBowBssInfo, prStaRec); - } - - if (EQUAL_MAC_ADDR(prAuthFrame->aucSrcAddr, prBowFsmInfo->aucPeerAddress)) { - - prStaRec->eStaType = STA_TYPE_BOW_CLIENT; - prStaRec->ucNetTypeIndex = NETWORK_TYPE_BOW_INDEX; -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowValidateAuth, prStaRec->eStaType, %x.\n", prStaRec->eStaType)); - DBGLOG(BOW, EVENT, ("bowValidateAuth, prStaRec->ucNetTypeIndex, %x.\n", prStaRec->ucNetTypeIndex)); -#endif - /* Update Station Record - Status/Reason Code */ - prStaRec->u2StatusCode = STATUS_CODE_SUCCESSFUL; - prStaRec->ucJoinFailureCount = 0; - *pprStaRec = prStaRec; - *pu2StatusCode = STATUS_CODE_SUCCESSFUL; - fgReplyAuth = TRUE; - } - else { - cnmStaRecFree(prAdapter, prStaRec, FALSE); - *pu2StatusCode = STATUS_CODE_REQ_DECLINED; - - /*Reply auth with reject every 5s*/ - rCurrentTime = kalGetTimeTick(); - if(CHECK_FOR_TIMEOUT(rCurrentTime, rLastRejectAuthTime, MSEC_TO_SYSTIME(5000)) || - rLastRejectAuthTime == 0 - ) { - fgReplyAuth = TRUE; - rLastRejectAuthTime = rCurrentTime; - } - } - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowValidateAuth, fgReplyAuth, %x.\n", fgReplyAuth)); -#endif - return fgReplyAuth; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is invoked when CNM granted channel privilege -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -bowRunEventChGrant ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_BSS_INFO_T prBowBssInfo; - P_BOW_FSM_INFO_T prBowFsmInfo; - P_MSG_CH_GRANT_T prMsgChGrant; - UINT_8 ucTokenID; - UINT_32 u4GrantInterval; - ENUM_BOW_DEVICE_STATE eFsmState; - - ASSERT(prAdapter); - ASSERT(prMsgHdr); - - prBowBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]); - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - prMsgChGrant = (P_MSG_CH_GRANT_T)prMsgHdr; - ucTokenID = prMsgChGrant->ucTokenID; - u4GrantInterval = prMsgChGrant->u4GrantInterval; - - /* 1. free message */ - cnmMemFree(prAdapter, prMsgHdr); - prBowFsmInfo->fgIsChannelGranted = TRUE; - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("Entering bowRunEventChGrant.\n")); -#endif - - eFsmState = bowGetBowTableState(prAdapter, prBowFsmInfo->aucPeerAddress); - - /*Release channel*/ - if((!prBowFsmInfo->fgIsChannelRequested) || - (prBowFsmInfo->ucSeqNumOfChReq != ucTokenID) || - (eFsmState == BOW_DEVICE_STATE_DISCONNECTED) || - (eFsmState == BOW_DEVICE_STATE_DISCONNECTING)){ -#if CFG_BOW_TEST - printk("BoW Channel [GIVE UP:%d]\n", ucTokenID); - printk("[Requested:%d][ucSeqNumOfChReq:%d][eFsmState:%d]\n", - prBowFsmInfo->fgIsChannelRequested, prBowFsmInfo->ucSeqNumOfChReq, eFsmState); -#endif - bowReleaseCh(prAdapter); - return; - } - - /* 2. channel privilege has been approved */ - prBowFsmInfo->u4ChGrantedInterval = u4GrantInterval; - -#if 0 - cnmTimerStartTimer(prAdapter, - &prBowFsmInfo->rChGrantedTimer, - prBowFsmInfo->u4ChGrantedInterval - BOW_JOIN_CH_GRANT_THRESHOLD); -#else - cnmTimerStartTimer(prAdapter, - &prBowFsmInfo->rChGrantedTimer, - BOW_JOIN_CH_REQUEST_INTERVAL - BOW_JOIN_CH_GRANT_THRESHOLD); -#endif - - /* 3.2 set local variable to indicate join timer is ticking */ - prBowFsmInfo->fgIsInfraChannelFinished = FALSE; - -#if CFG_BOW_TEST - printk("BoW Channel [GRANTED:%d].\n", ucTokenID); -#endif - - if(eFsmState == BOW_DEVICE_STATE_ACQUIRING_CHANNEL) { - bowStarting(prAdapter); - bowReleaseCh(prAdapter); - if(prBowFsmInfo->ucRole == BOW_RESPONDER) { - bowResponderJoin(prAdapter, prBowFsmInfo->prTargetBssDesc); - } - } - else { - /*update bssinfo*/ - nicUpdateBss(prAdapter, NETWORK_TYPE_BOW_INDEX); - bowReleaseCh(prAdapter); - } - - return; -} /* end of aisFsmRunEventChGrant() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is to inform CNM for channel privilege requesting -* has been released -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -bowRequestCh ( - IN P_ADAPTER_T prAdapter - ) -{ - P_BOW_FSM_INFO_T prBowFsmInfo; - P_MSG_CH_REQ_T prMsgChReq; - - ASSERT(prAdapter); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - - if (prBowFsmInfo->fgIsChannelGranted == FALSE) - { - -#if CFG_BOW_TEST - printk("BoW channel [REQUEST:%d], %d, %d.\n", prBowFsmInfo->ucSeqNumOfChReq+1, prBowFsmInfo->ucPrimaryChannel, prBowFsmInfo->eBand); -#endif - prMsgChReq = (P_MSG_CH_REQ_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_CH_REQ_T)); - - if (!prMsgChReq) { - ASSERT(0); // Can't indicate CNM for channel acquiring - return; - } - - prMsgChReq->rMsgHdr.eMsgId = MID_MNY_CNM_CH_REQ; - prMsgChReq->ucNetTypeIndex = NETWORK_TYPE_BOW_INDEX; - prMsgChReq->ucTokenID = ++prBowFsmInfo->ucSeqNumOfChReq; - prMsgChReq->eReqType = CH_REQ_TYPE_JOIN; -#if 0 - prMsgChReq->u4MaxInterval = BOW_JOIN_CH_REQUEST_INTERVAL; -#else - prMsgChReq->u4MaxInterval = 1; -#endif - prMsgChReq->ucPrimaryChannel = prBowFsmInfo->ucPrimaryChannel; //prBowFsmInfo->prTargetBssDesc->ucChannelNum; - prMsgChReq->eRfSco = CHNL_EXT_SCN; //prBowFsmInfo->prTargetBssDesc->eSco; - prMsgChReq->eRfBand = prBowFsmInfo->eBand; //prBowFsmInfo->prTargetBssDesc->eBand; - COPY_MAC_ADDR(prMsgChReq->aucBSSID, prBowFsmInfo->aucPeerAddress); - - - prBowFsmInfo->fgIsChannelRequested = TRUE; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prMsgChReq, - MSG_SEND_METHOD_BUF); - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is to inform BOW that channel privilege is granted -* has been released -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -bowReleaseCh ( - IN P_ADAPTER_T prAdapter - ) -{ - P_BOW_FSM_INFO_T prBowFsmInfo; - P_MSG_CH_ABORT_T prMsgChAbort; - - ASSERT(prAdapter); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - - if(prBowFsmInfo->fgIsChannelGranted != FALSE || prBowFsmInfo->fgIsChannelRequested != FALSE) - { -#if CFG_BOW_TEST - printk("BoW channel [RELEASE:%d] %d, %d.\n", prBowFsmInfo->ucSeqNumOfChReq, prBowFsmInfo->ucPrimaryChannel, prBowFsmInfo->eBand); -#endif - - prBowFsmInfo->fgIsChannelRequested = FALSE; - prBowFsmInfo->fgIsChannelGranted = FALSE; - - /* 1. return channel privilege to CNM immediately */ - prMsgChAbort = (P_MSG_CH_ABORT_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_CH_ABORT_T)); - if (!prMsgChAbort) { - ASSERT(0); // Can't release Channel to CNM - return; - } - - prMsgChAbort->rMsgHdr.eMsgId = MID_MNY_CNM_CH_ABORT; - prMsgChAbort->ucNetTypeIndex = NETWORK_TYPE_BOW_INDEX; - prMsgChAbort->ucTokenID = prBowFsmInfo->ucSeqNumOfChReq; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prMsgChAbort, - MSG_SEND_METHOD_BUF); - } - - return; -} /* end of aisFsmReleaseCh() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will indicate an Event of "Media Disconnect" to HOST -* -* @param[in] u4Param Unused timer parameter -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bowChGrantedTimeout( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Param - ) -{ - P_BOW_FSM_INFO_T prBowFsmInfo; - ENUM_BOW_DEVICE_STATE eFsmState; - - ASSERT(prAdapter); - - prBowFsmInfo = &(prAdapter->rWifiVar.rBowFsmInfo); - -#if CFG_BOW_TEST - printk("BoW Channel [TIMEOUT]\n"); -#endif -#if 1 - //bowReleaseCh(prAdapter); - eFsmState = bowGetBowTableState(prAdapter, prBowFsmInfo->aucPeerAddress); - - /*If connecting is not completed, request CH again*/ - if((eFsmState == BOW_DEVICE_STATE_CONNECTING) || - (eFsmState == BOW_DEVICE_STATE_STARTING)) - { - bowRequestCh(prAdapter); - } -#endif -} - - -BOOLEAN -bowNotifyAllLinkDisconnected ( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_8 ucBowTableIdx = 0; - CMD_INFO_T rCmdInfo; - - ASSERT(prAdapter); - - kalMemZero(&rCmdInfo, sizeof(CMD_INFO_T)); - - while (ucBowTableIdx < CFG_BOW_PHYSICAL_LINK_NUM) - { - if (arBowTable[ucBowTableIdx].fgIsValid) - { - COPY_MAC_ADDR(prAdapter->rWifiVar.rBowFsmInfo.aucPeerAddress, arBowTable[ucBowTableIdx].aucPeerAddress); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowNotifyAllLinkDisconnected, arBowTable[%x].aucPeerAddress, %x:%x:%x:%x:%x:%x.\n", ucBowTableIdx, - arBowTable[ucBowTableIdx].aucPeerAddress[0], - arBowTable[ucBowTableIdx].aucPeerAddress[1], - arBowTable[ucBowTableIdx].aucPeerAddress[2], - arBowTable[ucBowTableIdx].aucPeerAddress[3], - arBowTable[ucBowTableIdx].aucPeerAddress[4], - arBowTable[ucBowTableIdx].aucPeerAddress[5])); - DBGLOG(BOW, EVENT, ("bowNotifyAllLinkDisconnected, arBowTable[%x].fgIsValid, %x.\n", ucBowTableIdx, arBowTable[ucBowTableIdx].fgIsValid)); -#endif -#if 1 - wlanoidSendSetQueryBowCmd(prAdapter, - CMD_ID_CMD_BT_OVER_WIFI, - TRUE, - FALSE, - wlanbowCmdEventLinkDisconnected, - wlanbowCmdTimeoutHandler, - 0, - NULL, - 0 - ); -#else - wlanbowCmdEventLinkDisconnected(prAdapter, &rCmdInfo, NULL); -#endif - } - - ucBowTableIdx += 1; - } - - return TRUE; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to retrieve Bluetooth-over-Wi-Fi state from glue layer -* -* \param[in] -* prGlueInfo -* rPeerAddr -* \return -* ENUM_BOW_DEVICE_STATE -*/ -/*----------------------------------------------------------------------------*/ - -BOOLEAN -bowCheckBowTableIfVaild( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucPeerAddress[6] - ) -{ - UINT_8 idx; - - KAL_SPIN_LOCK_DECLARATION(); - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - for(idx = 0 ; idx < CFG_BOW_PHYSICAL_LINK_NUM ; idx++) - { - if( arBowTable[idx].fgIsValid && - EQUAL_MAC_ADDR(arBowTable[idx].aucPeerAddress, aucPeerAddress)) - { - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("kalCheckBowifVaild, aucPeerAddress %x, %x:%x:%x:%x:%x:%x.\n", idx, - aucPeerAddress[0], - aucPeerAddress[1], - aucPeerAddress[2], - aucPeerAddress[3], - aucPeerAddress[4], - aucPeerAddress[5])); - - DBGLOG(BOW, EVENT, ("kalCheckBowifVaild, arBowTable[idx].aucPeerAddress %x, %x:%x:%x:%x:%x:%x.\n", idx, - arBowTable[idx].aucPeerAddress[0], - arBowTable[idx].aucPeerAddress[1], - arBowTable[idx].aucPeerAddress[2], - arBowTable[idx].aucPeerAddress[3], - arBowTable[idx].aucPeerAddress[4], - arBowTable[idx].aucPeerAddress[5])); - - DBGLOG(BOW, EVENT, ("kalCheckBowifVaild, arBowTable[idx].fgIsValid, %x, %x.\n", idx, arBowTable[idx].fgIsValid)); - -#endif - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - return TRUE; - } - } - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - return FALSE; -} - -BOOLEAN -bowGetBowTableContent( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucBowTableIdx, - OUT P_BOW_TABLE_T prBowTable - ) -{ - KAL_SPIN_LOCK_DECLARATION(); - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - if (arBowTable[ucBowTableIdx].fgIsValid) - { - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowGetBowTableContent, arBowTable[idx].fgIsValid, %x, %x.\n", ucBowTableIdx, arBowTable[ucBowTableIdx].fgIsValid)); - printk("GET State [%d]\n", arBowTable[ucBowTableIdx].eState); -#endif - prBowTable = &(arBowTable[ucBowTableIdx]); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - return TRUE; - } - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - return FALSE; -} - - -BOOLEAN -bowSetBowTableContent( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucBowTableIdx, - IN P_BOW_TABLE_T prBowTable - ) -{ - KAL_SPIN_LOCK_DECLARATION(); - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - COPY_MAC_ADDR(arBowTable[ucBowTableIdx].aucPeerAddress, prBowTable->aucPeerAddress); - arBowTable[ucBowTableIdx].eState = prBowTable->eState; - arBowTable[ucBowTableIdx].fgIsValid = prBowTable->fgIsValid; - arBowTable[ucBowTableIdx].ucAcquireID = prBowTable->ucAcquireID; - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - kalSetBowState(prAdapter->prGlueInfo, prBowTable->eState, prBowTable->aucPeerAddress); - //kalSetBowRole(prAdapter->prGlueInfo, prBowTable->ucRole, prBowTable->aucPeerAddress); - -#if CFG_BOW_TEST - printk("SET State [%d]\n", arBowTable[ucBowTableIdx].eState); - DBGLOG(BOW, EVENT, ("kalCheckBowifVaild, arBowTable[ucBowTableIdx].fgIsValid, %x, %x.\n", ucBowTableIdx, arBowTable[ucBowTableIdx].fgIsValid)); -#endif - - return TRUE; - -} - - -BOOLEAN -bowGetBowTableEntryByPeerAddress( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucPeerAddress[6], - OUT PUINT_8 pucBowTableIdx - ) -{ - UINT_8 idx; - - KAL_SPIN_LOCK_DECLARATION(); - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - for(idx = 0 ; idx < CFG_BOW_PHYSICAL_LINK_NUM ; idx++) - { - if( arBowTable[idx].fgIsValid && - EQUAL_MAC_ADDR(arBowTable[idx].aucPeerAddress, aucPeerAddress)) - { - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("kalCheckBowifVaild, aucPeerAddress %x, %x:%x:%x:%x:%x:%x.\n", idx, - aucPeerAddress[0], - aucPeerAddress[1], - aucPeerAddress[2], - aucPeerAddress[3], - aucPeerAddress[4], - aucPeerAddress[5])); - DBGLOG(BOW, EVENT, ("kalCheckBowifVaild, arBowTable[idx].aucPeerAddress %x, %x:%x:%x:%x:%x:%x.\n", idx, - arBowTable[idx].aucPeerAddress[0], - arBowTable[idx].aucPeerAddress[1], - arBowTable[idx].aucPeerAddress[2], - arBowTable[idx].aucPeerAddress[3], - arBowTable[idx].aucPeerAddress[4], - arBowTable[idx].aucPeerAddress[5])); - DBGLOG(BOW, EVENT, ("kalCheckBowifVaild, arBowTable[idx].fgIsValid, %x, %x.\n", idx, arBowTable[idx].fgIsValid)); -#endif - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - *pucBowTableIdx = idx; - - return TRUE; - } - } - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - return FALSE; -} - - -BOOLEAN -bowGetBowTableFreeEntry( - IN P_ADAPTER_T prAdapter, - OUT PUINT_8 pucBowTableIdx - ) -{ - UINT_8 idx; - - KAL_SPIN_LOCK_DECLARATION(); - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - for(idx = 0 ; idx < CFG_BOW_PHYSICAL_LINK_NUM ; idx++) - { - if(!arBowTable[idx].fgIsValid) - { -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowGetBowTableFreeEntry, arBowTable[idx].fgIsValid, %x, %x.\n", idx, arBowTable[idx].fgIsValid)); -#endif - *pucBowTableIdx = idx; - arBowTable[idx].fgIsValid = TRUE; - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - return TRUE; - } - } - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - return FALSE; -} - - -ENUM_BOW_DEVICE_STATE -bowGetBowTableState( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucPeerAddress[6] - ) -{ - UINT_8 idx; - - KAL_SPIN_LOCK_DECLARATION(); - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - for(idx = 0 ; idx < CFG_BOW_PHYSICAL_LINK_NUM ; idx++) - { - if( arBowTable[idx].fgIsValid && - EQUAL_MAC_ADDR(arBowTable[idx].aucPeerAddress, aucPeerAddress)) - { -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("bowGetState, aucPeerAddress %x, %x:%x:%x:%x:%x:%x.\n", idx, - aucPeerAddress[0], - aucPeerAddress[1], - aucPeerAddress[2], - aucPeerAddress[3], - aucPeerAddress[4], - aucPeerAddress[5])); - DBGLOG(BOW, EVENT, ("bowGetState, arBowTable[idx].aucPeerAddress %x, %x:%x:%x:%x:%x:%x.\n", idx, - arBowTable[idx].aucPeerAddress[0], - arBowTable[idx].aucPeerAddress[1], - arBowTable[idx].aucPeerAddress[2], - arBowTable[idx].aucPeerAddress[3], - arBowTable[idx].aucPeerAddress[4], - arBowTable[idx].aucPeerAddress[5])); - DBGLOG(BOW, EVENT, ("bowGetState, arBowTable[idx].fgIsValid, %x, %x.\n", idx, arBowTable[idx].fgIsValid)); - DBGLOG(BOW, EVENT, ("bowGetState, arBowTable[idx].eState;, %x, %x.\n", idx, arBowTable[idx].eState)); - printk("GET State [%d]\n", arBowTable[idx].eState); -#endif - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - return arBowTable[idx].eState; - } - } - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - return BOW_DEVICE_STATE_DISCONNECTED; -} - - -BOOLEAN -bowSetBowTableState( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucPeerAddress[6], - IN ENUM_BOW_DEVICE_STATE eState - ) -{ - UINT_8 ucBowTableIdx; - - if(bowGetBowTableEntryByPeerAddress(prAdapter, aucPeerAddress, &ucBowTableIdx)) { - KAL_SPIN_LOCK_DECLARATION(); - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - arBowTable[ucBowTableIdx].eState = eState; -#if CFG_BOW_TEST - printk("SET State [%d]\n", eState); -#endif - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_BOW_TABLE); - - kalSetBowState(prAdapter->prGlueInfo, eState, aucPeerAddress); - return TRUE; - } - return FALSE; -} - - -#endif - diff --git a/drivers/net/wireless/mt5931/common/wlan_lib.c b/drivers/net/wireless/mt5931/common/wlan_lib.c deleted file mode 100755 index 76bead149da0..000000000000 --- a/drivers/net/wireless/mt5931/common/wlan_lib.c +++ /dev/null @@ -1,5536 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/common/wlan_lib.c#2 $ -*/ -/*! \file wlan_lib.c - \brief Internal driver stack will export the required procedures here for GLUE Layer. - - This file contains all routines which are exported from MediaTek 802.11 Wireless - LAN driver stack to GLUE Layer. -*/ - - -/* -** $Log: wlan_lib.c $ -** -** 08 15 2012 eason.tsai -** [ALPS00338170] [Need Patch] [Volunteer Patch] modify build warning -** fix build waring for codechange - * - * 07 13 2012 cp.wu - * [WCXRP00001259] [MT6620 Wi-Fi][Driver][Firmware] Send a signal to firmware for termination after SDIO error has happened - * [driver domain] add force reset by host-to-device interrupt mechanism - * - * 06 11 2012 cp.wu - * [WCXRP00001252] [MT6620 Wi-Fi][Driver] Add debug message while encountering firmware response timeout - * output message while timeout event occurs - * - * 06 11 2012 eason.tsai - * NULL - * change from binay to hex code - * - * 06 08 2012 eason.tsai - * NULL - * Nvram context covert from 6620 to 6628 for old 6620 meta tool - * - * 05 11 2012 cp.wu - * [WCXRP00001237] [MT6620 Wi-Fi][Driver] Show MAC address and MAC address source for ACS's convenience - * show MAC address & source while initiliazation - * - * 03 29 2012 eason.tsai - * [WCXRP00001216] [MT6628 Wi-Fi][Driver]add conditional define - * add conditional define. - * - * 03 04 2012 eason.tsai - * NULL - * modify the cal fail report code. - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 01 16 2012 cp.wu - * [WCXRP00001169] [MT6620 Wi-Fi][Driver] API and behavior modification for preferred band configuration with corresponding network configuration - * correct scan result removing policy. - * - * 01 16 2012 cp.wu - * [MT6620 Wi-Fi][Driver] API and behavior modification for preferred band configuration with corresponding network configuration - * add wlanSetPreferBandByNetwork() for glue layer to invoke for setting preferred band configuration corresponding to network type. - * - * 01 05 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * Adding the related ioctl / wlan oid function to set the Tx power cfg. - * - * 11 28 2011 cp.wu - * [WCXRP00001125] [MT6620 Wi-Fi][Firmware] Strengthen Wi-Fi power off sequence to have a clearroom environment when returining to ROM code - * 1. Due to firmware now stops HIF DMA for powering off, do not try to receive any packet from firmware - * 2. Take use of prAdapter->fgIsEnterD3ReqIssued for tracking whether it is powering off or not - * - * 11 14 2011 cm.chang - * [WCXRP00001104] [All Wi-Fi][FW] Show init process by HW mail-box register - * Show FW initial ID when timeout to wait for ready bit - * - * 11 11 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * modify the xlog related code. - * - * 10 18 2011 cp.wu - * [WCXRP00001022] [MT6628 Driver][Firmware Download] Add multi section independent download functionality - * when powering off, always clear pending interrupts, then wait for RDY to be de-asserted - * - * 10 14 2011 cp.wu - * [WCXRP00001022] [MT6628 Driver][Firmware Download] Add multi section independent download functionality - * shorten the packet length for firmware download if no more than 2048 bytes. - * - * 10 03 2011 cp.wu - * [WCXRP00001022] [MT6628 Driver][Firmware Download] Add multi section independent download functionality - * add firmware download path in divided scatters. - * - * 10 03 2011 cp.wu - * [MT6628 Driver][Firmware Download] Add multi section independent download functionality - * add firmware downloading aggregated path. - * - * 09 30 2011 cm.chang - * [WCXRP00001020] [MT6620 Wi-Fi][Driver] Handle secondary channel offset of AP in 5GHz band - * . - * - * 09 20 2011 cp.wu - * [WCXRP00000994] [MT6620 Wi-Fi][Driver] dump message for bus error and reset bus error flag while re-initialized - * 1. always show error message for SDIO bus errors. - * 2. reset bus error flag when re-initialization - * - * 08 26 2011 cm.chang - * [WCXRP00000952] [MT5931 Wi-Fi][FW] Handshake with BWCS before DPD/TX power calibration - * Fix compiling error for WinXP MT5931 driver - * - * 08 25 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings - * Add BWCS Sync ready for WinXP. - * - * 08 25 2011 chinghwa.yu - * [WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add DFS switch. - * - * 08 24 2011 chinghwa.yu - * [WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Update RDD test mode cases. - * - * 08 19 2011 cp.wu - * [WCXRP00000702] [MT5931][Driver] Modify initialization sequence for E1 ASIC - * escape from normal path if any error is occured. - * - * 08 15 2011 cp.wu - * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree - * reuse firmware download logic of MT6620 for MT6628. - * - * 08 15 2011 cp.wu - * [WCXRP00000913] [MT6620 Wi-Fi] create repository of source code dedicated for MT6620 E6 ASIC - * support to load different firmware image for E3/E4/E5 and E6 ASIC on win32 platforms. - * - * 08 02 2011 yuche.tsai - * [WCXRP00000896] [Volunteer Patch][WiFi Direct][Driver] GO with multiple client, TX deauth to a disconnecting device issue. - * Fix GO send deauth frame issue. - * - * 07 22 2011 jeffrey.chang - * [WCXRP00000864] [MT5931] Add command to adjust OSC stable time - * modify driver to set OSC stable time after f/w download - * - * 07 18 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add CMD/Event for RDD and BWCS. - * - * 06 24 2011 cp.wu - * [WCXRP00000812] [MT6620 Wi-Fi][Driver] not show NVRAM when there is no valid MAC address in NVRAM content - * if there is no valid address in chip, generate a new one from driver domain instead of firmware domain due to sufficient randomness - * - * 06 23 2011 cp.wu - * [WCXRP00000812] [MT6620 Wi-Fi][Driver] not show NVRAM when there is no valid MAC address in NVRAM content - * check with firmware for valid MAC address. - * - * 06 20 2011 cp.wu - * [WCXRP00000702] [MT5931][Driver] Modify initialization sequence for E1 ASIC - * disable whole-chip resetting mechanism due to the need of further ECO to work as expected. - * - * 05 31 2011 cp.wu - * [WCXRP00000749] [MT6620 Wi-Fi][Driver] Add band edge tx power control to Wi-Fi NVRAM - * changed to use non-zero checking for valid bit in NVRAM content - * - * 05 27 2011 cp.wu - * [WCXRP00000749] [MT6620 Wi-Fi][Driver] Add band edge tx power control to Wi-Fi NVRAM - * invoke CMD_ID_SET_EDGE_TXPWR_LIMIT when there is valid data exist in NVRAM content. - * - * 05 18 2011 cp.wu - * [WCXRP00000734] [MT6620 Wi-Fi][Driver] Pass PHY_PARAM in NVRAM to firmware domain - * pass PHY_PARAM in NVRAM from driver to firmware. - * - * 05 11 2011 cp.wu - * [WCXRP00000718] [MT6620 Wi-Fi] modify the behavior of setting tx power - * correct assertion. - * - * 05 11 2011 cp.wu - * [WCXRP00000718] [MT6620 Wi-Fi] modify the behavior of setting tx power - * ACPI APIs migrate to wlan_lib.c for glue layer to invoke. - * - * 05 11 2011 cm.chang - * [WCXRP00000717] [MT5931 Wi-Fi][Driver] Handle wrong NVRAM content about AP bandwidth setting - * . - * - * 05 05 2011 cp.wu - * [WCXRP00000702] [MT5931][Driver] Modify initialization sequence for E1 ASIC - * change delay from 100ms to 120ms upon DE's suggestion. - * - * 05 05 2011 cp.wu - * [WCXRP00000702] [MT5931][Driver] Modify initialization sequence for E1 ASIC - * add delay after whole-chip resetting for MT5931 E1 ASIC. - * - * 04 22 2011 cp.wu - * [WCXRP00000598] [MT6620 Wi-Fi][Driver] Implementation of interface for communicating with user space process for RESET_START and RESET_END events - * skip power-off handshaking when RESET indication is received. - * - * 04 22 2011 george.huang - * [WCXRP00000621] [MT6620 Wi-Fi][Driver] Support P2P supplicant to set power mode - * . - * - * 04 18 2011 cp.wu - * [WCXRP00000636] [WHQL][MT5931 Driver] 2c_PMHibernate (hang on 2h) - * 1) add API for glue layer to query ACPI state - * 2) Windows glue should not access to hardware after switched into D3 state - * - * 04 15 2011 cp.wu - * [WCXRP00000654] [MT6620 Wi-Fi][Driver] Add loop termination criterion for wlanAdapterStop(). - * add loop termination criteria for wlanAdapterStop(). - * - * 04 12 2011 eddie.chen - * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma - * Fix the sta index in processing security frame - * Simple flow control for TC4 to avoid mgt frames for PS STA to occupy the TC4 - * Add debug message. - * - * 04 12 2011 cp.wu - * [WCXRP00000631] [MT6620 Wi-Fi][Driver] Add an API for QM to retrieve current TC counter value and processing frame dropping cases for TC4 path - * 1. add nicTxGetResource() API for QM to make decisions. - * 2. if management frames is decided by QM for dropping, the call back is invoked to indicate such a case. - * - * 04 06 2011 cp.wu - * [WCXRP00000616] [MT6620 Wi-Fi][Driver] Free memory to pool and kernel in case any unexpected failure happend inside wlanAdapterStart - * invoke nicReleaseAdapterMemory() as failure handling in case wlanAdapterStart() failed unexpectedly - * - * 03 29 2011 wh.su - * [WCXRP00000248] [MT6620 Wi-Fi][FW]Fixed the Klockwork error - * fixed the kclocwork error. - * - * 03 15 2011 cp.wu - * [WCXRP00000559] [MT6620 Wi-Fi][Driver] Combine TX/RX DMA buffers into a single one to reduce physically continuous memory consumption - * 1. deprecate CFG_HANDLE_IST_IN_SDIO_CALLBACK - * 2. Use common coalescing buffer for both TX/RX directions - * - * - * 03 10 2011 cp.wu - * [WCXRP00000532] [MT6620 Wi-Fi][Driver] Migrate NVRAM configuration procedures from MT6620 E2 to MT6620 E3 - * deprecate configuration used by MT6620 E2 - * - * 03 07 2011 terry.wu - * [WCXRP00000521] [MT6620 Wi-Fi][Driver] Remove non-standard debug message - * Toggle non-standard debug messages to comments. - * - * 02 25 2011 cp.wu - * [WCXRP00000496] [MT5931][Driver] Apply host-triggered chip reset before initializing firmware download procedures - * apply host-triggered chip reset mechanism before initializing firmware download procedures. - * - * 02 17 2011 eddie.chen - * [WCXRP00000458] [MT6620 Wi-Fi][Driver] BOW Concurrent - ProbeResp was exist in other channel - * 1) Chnage GetFrameAction decision when BSS is absent. - * 2) Check channel and resource in processing ProbeRequest - * - * 02 16 2011 cm.chang - * [WCXRP00000447] [MT6620 Wi-Fi][FW] Support new NVRAM update mechanism - * . - * - * 02 01 2011 george.huang - * [WCXRP00000333] [MT5931][FW] support SRAM power control drivers - * init variable for CTIA. - * - * 01 27 2011 george.huang - * [WCXRP00000355] [MT6620 Wi-Fi] Set WMM-PS related setting with qualifying AP capability - * Support current measure mode, assigned by registry (XP only). - * - * 01 24 2011 cp.wu - * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving - * 1. add an extra counter for tracking pending forward frames. - * 2. notify TX service thread as well when there is pending forward frame - * 3. correct build errors leaded by introduction of Wi-Fi direct separation module - * - * 01 12 2011 cm.chang - * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting - * User-defined bandwidth is for 2.4G and 5G individually - * - * 01 10 2011 cp.wu - * [WCXRP00000351] [MT6620 Wi-Fi][Driver] remove from scanning result in OID handling layer when the corresponding BSS is disconnected due to beacon timeout - * remove from scanning result when the BSS is disconnected due to beacon timeout. - * - * 01 04 2011 cp.wu - * [WCXRP00000338] [MT6620 Wi-Fi][Driver] Separate kalMemAlloc into kmalloc and vmalloc implementations to ease physically continous memory demands - * separate kalMemAlloc() into virtually-continous and physically-continous type to ease slab system pressure - * - * 12 31 2010 cp.wu - * [WCXRP00000327] [MT6620 Wi-Fi][Driver] Improve HEC WHQA 6972 workaround coverage in driver side - * while being unloaded, clear all pending interrupt then set LP-own to firmware - * - * 12 31 2010 cp.wu - * [WCXRP00000335] [MT6620 Wi-Fi][Driver] change to use milliseconds sleep instead of delay to avoid blocking to system scheduling - * change to use msleep() and shorten waiting interval to reduce blocking to other task while Wi-Fi driver is being loaded - * - * 12 28 2010 cp.wu - * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release - * report EEPROM used flag via NIC_CAPABILITY - * - * 12 28 2010 cp.wu - * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release - * integrate with 'EEPROM used' flag for reporting correct capability to Engineer Mode/META and other tools - * - * 12 22 2010 eddie.chen - * [WCXRP00000218] [MT6620 Wi-Fi][Driver] Add auto rate window control in registry - * Remove controling auto rate from initial setting. The initial setting is defined by FW code. - * - * 12 15 2010 cp.wu - * NULL - * sync. with ALPS code by enabling interrupt just before leaving wlanAdapterStart() - * - * 12 08 2010 yuche.tsai - * [WCXRP00000245] [MT6620][Driver] Invitation & Provision Discovery Feature Check-in - * Change Param name for invitation connection. - * - * 12 07 2010 cm.chang - * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant - * 1. Country code is from NVRAM or supplicant - * 2. Change band definition in CMD/EVENT. - * - * 11 03 2010 cp.wu - * [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection - * 1) use 8 buffers for MT5931 which is equipped with less memory - * 2) modify MT5931 debug level to TRACE when download is successful - * - * 11 02 2010 cp.wu - * [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection - * for MT5931, adapter initialization is done *after* firmware is downloaded. - * - * 11 02 2010 cp.wu - * [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection - * correct MT5931 firmware download procedure: - * MT5931 will download firmware first then acquire LP-OWN - * - * 11 02 2010 cp.wu - * [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection - * 1) update MT5931 firmware encryption tool. (using 64-bytes unit) - * 2) update MT5931 firmware download procedure - * - * 11 01 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module - * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead - * 2) Remove CNM CH-RECOVER event handling - * 3) cfg read/write API renamed with kal prefix for unified naming rules. - * - * 11 01 2010 yarco.yang - * [WCXRP00000149] [MT6620 WI-Fi][Driver]Fine tune performance on MT6516 platform - * Add code to run WlanIST in SDIO callback. - * - * 10 27 2010 george.huang - * [WCXRP00000127] [MT6620 Wi-Fi][Driver] Add a registry to disable Beacon Timeout function for SQA test by using E1 EVB - * Support registry option for disable beacon lost detection. - * - * 10 26 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command - * 1) update NVRAM content template to ver 1.02 - * 2) add compile option for querying NIC capability (default: off) - * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting - * 4) correct auto-rate compiler error under linux (treat warning as error) - * 5) simplify usage of NVRAM and REG_INFO_T - * 6) add version checking between driver and firmware - * - * 10 26 2010 eddie.chen - * [WCXRP00000134] [MT6620 Wi-Fi][Driver] Add a registry to enable auto rate for SQA test by using E1 EVB - * Add auto rate parameter in registry. - * - * 10 25 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * add option for enable/disable TX PWR gain adjustment (default: off) - * - * 10 18 2010 cp.wu - * [WCXRP00000117] [MT6620 Wi-Fi][Driver] Add logic for suspending driver when MT6620 is not responding anymore - * 1. when wlanAdapterStop() failed to send POWER CTRL command to firmware, do not poll for ready bit dis-assertion - * 2. shorten polling count for shorter response time - * 3. if bad I/O operation is detected during TX resource polling, then further operation is aborted as well - * - * 10 18 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android - * complete implementation of Android NVRAM access - * - * 10 15 2010 cp.wu - * [WCXRP00000103] [MT6620 Wi-Fi][Driver] Driver crashed when using WZC to connect to AP#B with connection with AP#A - * bugfix: always reset pointer to IEbuf to zero when keeping scanning result for the connected AP - * - * 10 08 2010 cp.wu - * [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test - * adding fixed rate support for distance test. (from registry setting) - * - * 10 07 2010 cp.wu - * [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection - * add firmware download for MT5931. - * - * 10 06 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * divide a single function into 2 part to surpress a weird compiler warning from gcc-4.4.0 - * - * 10 06 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * code reorganization to improve isolation between GLUE and CORE layers. - * - * 10 05 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * load manufacture data when CFG_SUPPORT_NVRAM is set to 1 - * - * 10 04 2010 cp.wu - * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only - * remove ENUM_NETWORK_TYPE_T definitions - * - * 09 29 2010 wh.su - * [WCXRP00000072] [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue - * [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue. - * - * 09 24 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * eliminate unused variables which lead gcc to argue - * - * 09 24 2010 cp.wu - * [WCXRP00000057] [MT6620 Wi-Fi][Driver] Modify online scan to a run-time switchable feature - * Modify online scan as a run-time adjustable option (for Windows, in registry) - * - * 09 23 2010 cp.wu - * [WCXRP00000051] [MT6620 Wi-Fi][Driver] WHQL test fail in MAC address changed item - * use firmware reported mac address right after wlanAdapterStart() as permanent address - * - * 09 23 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * eliminate reference of CFG_RESPONSE_MAX_PKT_SIZE - * - * 09 21 2010 cp.wu - * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated - * Do a complete reset with STA-REC null checking for RF test re-entry - * - * 09 21 2010 kevin.huang - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * Eliminate Linux Compile Warning - * - * 09 13 2010 cp.wu - * NULL - * acquire & release power control in oid handing wrapper. - * - * 09 09 2010 cp.wu - * NULL - * move IE to buffer head when the IE pointer is not pointed at head. - * - * 09 08 2010 cp.wu - * NULL - * use static memory pool for storing IEs of scanning result. - * - * 09 01 2010 cp.wu - * NULL - * HIFSYS Clock Source Workaround - * - * 09 01 2010 wh.su - * NULL - * adding the wapi support for integration test. - * - * 09 01 2010 cp.wu - * NULL - * move HIF CR initialization from where after sdioSetupCardFeature() to wlanAdapterStart() - * - * 08 30 2010 cp.wu - * NULL - * eliminate klockwork errors - * - * 08 26 2010 yuche.tsai - * NULL - * Add AT GO test configure mode under WinXP. - * Please enable 1. CFG_ENABLE_WIFI_DIRECT, 2. CFG_TEST_WIFI_DIRECT_GO, 3. CFG_SUPPORT_AAA - * - * 08 25 2010 george.huang - * NULL - * update OID/ registry control path for PM related settings - * - * 08 24 2010 cp.wu - * NULL - * 1) initialize variable for enabling short premable/short time slot. - * 2) add compile option for disabling online scan - * - * 08 13 2010 cp.wu - * NULL - * correction issue: desired phy type not initialized as ABGN mode. - * - * 08 12 2010 cp.wu - * NULL - * [AIS-FSM] honor registry setting for adhoc running mode. (A/B/G) - * - * 08 10 2010 cm.chang - * NULL - * Support EEPROM read/write in RF test mode - * - * 08 03 2010 cp.wu - * NULL - * surpress compilation warning. - * - * 08 03 2010 cp.wu - * NULL - * Centralize mgmt/system service procedures into independent calls. - * - * 07 30 2010 cp.wu - * NULL - * 1) BoW wrapper: use definitions instead of hard-coded constant for error code - * 2) AIS-FSM: eliminate use of desired RF parameters, use prTargetBssDesc instead - * 3) add handling for RX_PKT_DESTINATION_HOST_WITH_FORWARD for GO-broadcast frames - * - * 07 29 2010 cp.wu - * NULL - * eliminate u4FreqInKHz usage, combined into rConnections.ucAdHoc* - * - * 07 28 2010 cp.wu - * NULL - * 1) eliminate redundant variable eOPMode in prAdapter->rWlanInfo - * 2) change nicMediaStateChange() API prototype - * - * 07 21 2010 cp.wu - * - * 1) change BG_SCAN to ONLINE_SCAN for consistent term - * 2) only clear scanning result when scan is permitted to do - * - * 07 19 2010 cm.chang - * - * Set RLM parameters and enable CNM channel manager - * - * 07 19 2010 jeffrey.chang - * - * Linux port modification - * - * 07 13 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * Reduce unnecessary type casting - * - * 07 13 2010 cp.wu - * - * use multiple queues to keep 1x/MMPDU/CMD's strict order even when there is incoming 1x frames. - * - * 07 13 2010 cp.wu - * - * 1) MMPDUs are now sent to MT6620 by CMD queue for keeping strict order of 1X/MMPDU/CMD packets - * 2) integrate with qmGetFrameAction() for deciding which MMPDU/1X could pass checking for sending - * 2) enhance CMD_INFO_T descriptor number from 10 to 32 to avoid descriptor underflow under concurrent network operation - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 05 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) ignore RSN checking when RSN is not turned on. - * 2) set STA-REC deactivation callback as NULL - * 3) add variable initialization API based on PHY configuration - * - * 07 02 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) for event packet, no need to fill RFB. - * 2) when wlanAdapterStart() failed, no need to initialize state machines - * 3) after Beacon/ProbeResp parsing, corresponding BSS_DESC_T should be marked as IE-parsed - * - * 07 01 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Support sync command of STA_REC - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add scan uninitialization procedure - * - * 06 25 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add API in que_mgt to retrieve sta-rec index for security frames. - * - * 06 24 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 802.1x and bluetooth-over-Wi-Fi security frames are now delievered to firmware via command path instead of data path. - * - * 06 23 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Merge g_arStaRec[] into adapter->arStaRec[] - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * initialize mbox & ais_fsm in wlanAdapterStart() - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * change MAC address updating logic. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * simplify timer usage. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) eliminate CFG_CMD_EVENT_VERSION_0_9 - * 2) when disconnected, indicate nic directly (no event is needed) - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * cnm_timer has been migrated. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 28 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * disable interrupt then send power control command packet. - * - * 05 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) when stopping adapter, wait til RDY bit has been cleaerd. - * 2) set TASK_OFFLOAD as driver-core OIDs - * - * 05 20 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) integrate OID_GEN_NETWORK_LAYER_ADDRESSES with CMD_ID_SET_IP_ADDRESS - * 2) buffer statistics data for 2 seconds - * 3) use default value for adhoc parameters instead of 0 - * - * 05 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) do not take timeout mechanism for power mode oids - * 2) retrieve network type from connection status - * 3) after disassciation, set radio state to off - * 4) TCP option over IPv6 is supported - * - * 05 17 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add CFG_STARTUP_DEBUG for debugging starting up issue. - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * 1) add timeout handler mechanism for pending command packets - * 2) add p2p add/removal key - * - * 04 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * surpress compiler warning - * - * 04 20 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * roll-back to rev.60. - * - * 04 20 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) remove redundant firmware image unloading - * 2) use compile-time macros to separate logic related to accquiring own - * - * 04 16 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * treat BUS access failure as kind of card removal. - * - * 04 14 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * always set fw-own before driver is unloaded. - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * 2) command sequence number is now increased atomically - * * * 3) private data could be hold and taken use for other purpose - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * finish non-glue layer access to glue variables - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * rWlanInfo should be placed at adapter rather than glue due to most operations - * are done in adapter layer. - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * ePowerCtrl is not necessary as a glue variable. - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * add timeout check in the kalOidComplete - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * improve none-glue code portability - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * improve none-glue code portability - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * code refine: fgTestMode should be at adapter rather than glue due to the device/fw is also involved - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access for prGlueInfo->fgIsCardRemoved in non-glue layer - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) for some OID, never do timeout expiration - * 2) add 2 kal API for later integration - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) eliminate unused definitions - * 2) ready bit will be polled for limited iteration - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * kalOidComplete is not necessary in linux - * - * 04 01 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * change to use pass-in prRegInfo instead of accessing prGlueInfo directly - * - * 04 01 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * change to use WIFI_TCM_ALWAYS_ON as firmware image - * - * 04 01 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * . - * - * 03 31 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * modify the wapi related code for new driver's design. - * - * 03 30 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * adding none-glue code portability - * - * 03 30 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * adding non-glue code portability - * - * 03 29 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * improve non-glue code portability - * - * 03 25 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * firmware download load adress & start address are now configured from config.h - * due to the different configurations on FPGA and ASIC - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * [WPD00003826] Initial import for Linux port - * initial import for Linux port - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port - * - * 03 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * only send CMD_NIC_POWER_CTRL in wlanAdapterStop() when card is not removed and is not in D3 state - * - * 03 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * always send CMD_NIC_POWER_CTRL packet when nic is being halted - * - * 03 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) add ACPI D0/D3 state switching support - * 2) use more formal way to handle interrupt when the status is retrieved from enhanced RX response - * -* 03 12 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add two option for ACK and ENCRYPTION for firmware download - * - * 03 11 2010 cp.wu - * [WPD00003821][BUG] Host driver stops processing RX packets from HIF RX0 - * add RX starvation warning debug message controlled by CFG_HIF_RX_STARVATION_WARNING - * - * 03 08 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) add another spin-lock to protect MsduInfoList due to it might be accessed by different thread. - * 2) change own-back acquiring procedure to wait for up to 16.67 seconds - * - * 03 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * when starting adapter, read local adminsitrated address from registry and send to firmware via CMD_BASIC_CONFIG. - * - * 03 02 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) the use of prPendingOid revised, all accessing are now protected by spin lock - * 2) ensure wlanReleasePendingOid will clear all command queues - * - * 03 02 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add mutex to avoid multiple access to qmTxQueue simultaneously. - * - * 03 01 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add command/event definitions for initial states - * - * 02 24 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Added code for QM_TEST_MODE - * - * 02 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct function name .. - * - * 02 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * separate wlanProcesQueuePacket() into 2 APIs upon request - * - * 02 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add new API: wlanProcessQueuedPackets() - * - * 02 11 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct wlanAdapterStart - * - * 02 11 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. add logic for firmware download - * 2. firmware image filename and start/load address are now retrieved from registry - * - * 02 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement host-side firmware download logic - * - * 02 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) remove unused function in nic_rx.c [which has been handled in que_mgt.c] - * 2) firmware image length is now retrieved via NdisFileOpen - * 3) firmware image is not structured by (P_IMG_SEC_HDR_T) anymore - * 4) nicRxWaitResponse() revised - * 5) another set of TQ counter default value is added for fw-download state - * 6) Wi-Fi load address is now retrieved from registry too - * - * 02 09 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. Permanent and current MAC address are now retrieved by CMD/EVENT packets instead of hard-coded address - * 2. follow MSDN defined behavior when associates to another AP - * 3. for firmware download, packet size could be up to 2048 bytes - * - * 02 08 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * prepare for implementing fw download logic - * - * 02 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * wlanoidSetFrequency is now implemented by RF test command. - * - * 02 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * QueryRssi is no longer w/o hardware access, it is now implemented by command/event handling loop - * - * 02 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. clear prPendingCmdInfo properly - * 2. while allocating memory for cmdinfo, no need to add extra 4 bytes. - * - * 01 28 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * allow MCR read/write OIDs in RF test mode - * - * 01 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) implement timeout mechanism when OID is pending for longer than 1 second - * 2) allow OID_802_11_CONFIGURATION to be executed when RF test mode is turned on - * - * 01 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. eliminate improper variable in rHifInfo - * 2. block TX/ordinary OID when RF test mode is engaged - * 3. wait until firmware finish operation when entering into and leaving from RF test mode - * 4. correct some HAL implementation - * - * 01 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Under WinXP with SDIO, use prGlueInfo->rHifInfo.pvInformationBuffer instead of prGlueInfo->pvInformationBuffer -** \main\maintrunk.MT6620WiFiDriver_Prj\36 2009-12-10 16:54:36 GMT mtk02752 -** code clean -** \main\maintrunk.MT6620WiFiDriver_Prj\35 2009-12-09 20:04:59 GMT mtk02752 -** only report as connected when CFG_HIF_EMULATION_TEST is set to 1 -** \main\maintrunk.MT6620WiFiDriver_Prj\34 2009-12-08 17:39:41 GMT mtk02752 -** wlanoidRftestQueryAutoTest could be executed without touching hardware -** \main\maintrunk.MT6620WiFiDriver_Prj\33 2009-12-03 16:10:26 GMT mtk01461 -** Add debug message -** \main\maintrunk.MT6620WiFiDriver_Prj\32 2009-12-02 22:05:33 GMT mtk02752 -** kalOidComplete() will decrease i4OidPendingCount -** \main\maintrunk.MT6620WiFiDriver_Prj\31 2009-12-01 23:02:36 GMT mtk02752 -** remove unnecessary spinlock -** \main\maintrunk.MT6620WiFiDriver_Prj\30 2009-12-01 22:50:38 GMT mtk02752 -** use TC4 for command, maintein i4OidPendingCount -** \main\maintrunk.MT6620WiFiDriver_Prj\29 2009-11-27 12:45:34 GMT mtk02752 -** prCmdInfo should be freed when invoking wlanReleasePendingOid() to clear pending oid -** \main\maintrunk.MT6620WiFiDriver_Prj\28 2009-11-24 19:55:51 GMT mtk02752 -** wlanSendPacket & wlanRetransmitOfPendingFrames is only used in old data path -** \main\maintrunk.MT6620WiFiDriver_Prj\27 2009-11-23 17:59:55 GMT mtk02752 -** clear prPendingOID inside wlanSendCommand() when the OID didn't need to be replied. -** \main\maintrunk.MT6620WiFiDriver_Prj\26 2009-11-23 14:45:29 GMT mtk02752 -** add another version of wlanSendCommand() for command-sending only without blocking for response -** \main\maintrunk.MT6620WiFiDriver_Prj\25 2009-11-17 22:40:44 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\24 2009-11-11 10:14:56 GMT mtk01084 -** modify place to invoke wlanIst -** \main\maintrunk.MT6620WiFiDriver_Prj\23 2009-10-30 18:17:07 GMT mtk01084 -** fix compiler warning -** \main\maintrunk.MT6620WiFiDriver_Prj\22 2009-10-29 19:46:15 GMT mtk01084 -** invoke interrupt process routine -** \main\maintrunk.MT6620WiFiDriver_Prj\21 2009-10-13 21:58:24 GMT mtk01084 -** modify for new HW architecture -** \main\maintrunk.MT6620WiFiDriver_Prj\20 2009-09-09 17:26:01 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\19 2009-05-20 12:21:27 GMT mtk01461 -** Add SeqNum check when process Event Packet -** \main\maintrunk.MT6620WiFiDriver_Prj\18 2009-05-19 10:38:44 GMT mtk01461 -** Add wlanReleasePendingOid() for mpReset() if there is a pending OID and no available TX resource to send it. -** \main\maintrunk.MT6620WiFiDriver_Prj\17 2009-04-29 15:41:34 GMT mtk01461 -** Add handle of EVENT of CMD Result in wlanSendCommand() -** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-04-22 09:11:23 GMT mtk01461 -** Fix wlanSendCommand() for Driver Domain CR -** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-04-21 09:33:56 GMT mtk01461 -** Update wlanSendCommand() for Driver Domain Response and handle Event Packet, wlanQuery/SetInformation() for enqueue CMD_INFO_T -** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-04-17 20:00:08 GMT mtk01461 -** Update wlanImageSectionDownload for optimized CMD process -** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-04-14 20:50:51 GMT mtk01426 -** Fixed compile error -** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-04-13 16:38:40 GMT mtk01084 -** add wifi start function -** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-04-13 14:26:44 GMT mtk01084 -** modify a parameter about FW download length -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-04-10 21:53:42 GMT mtk01461 -** Update wlanSendCommand() -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-04-08 16:51:04 GMT mtk01084 -** Update for the image download part -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-04-01 10:32:47 GMT mtk01461 -** Add wlanSendLeftClusteredFrames() for SDIO_TX_ENHANCE -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-03-23 21:44:13 GMT mtk01461 -** Refine TC assignment for WmmAssoc flag -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-03-23 16:51:57 GMT mtk01084 -** modify the input argument of caller to RECLAIM_POWER_CONTROL_TO_PM() -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-03-23 00:27:13 GMT mtk01461 -** Add reference code of FW Image Download -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-19 18:32:37 GMT mtk01084 -** update for basic power management functions -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-16 09:09:08 GMT mtk01461 -** Update TX PATH API -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 16:28:45 GMT mtk01426 -** Init develop -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" -#include "mgmt/ais_fsm.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -/* 6.1.1.2 Interpretation of priority parameter in MAC service primitives */ -/* Static convert the Priority Parameter/TID(User Priority/TS Identifier) to Traffic Class */ -const UINT_8 aucPriorityParam2TC[] = { - TC1_INDEX, - TC0_INDEX, - TC0_INDEX, - TC1_INDEX, - TC2_INDEX, - TC2_INDEX, - TC3_INDEX, - TC3_INDEX -}; - -#if QM_TEST_MODE -extern QUE_MGT_T g_rQM; -#endif -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef struct _CODE_MAPPING_T { - UINT_32 u4RegisterValue; - INT_32 u4TxpowerOffset; -} CODE_MAPPING_T, *P_CODE_MAPPING_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ -BOOLEAN fgIsBusAccessFailed = FALSE; - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -#define SIGNED_EXTEND(n, _sValue) \ - (((_sValue) & BIT((n)-1)) ? ((_sValue) | BITS(n,31)) : \ - ((_sValue) & ~BITS(n,31))) - -// TODO: Check -/* OID set handlers without the need to access HW register */ -PFN_OID_HANDLER_FUNC apfnOidSetHandlerWOHwAccess[] = { - wlanoidSetChannel, - wlanoidSetBeaconInterval, - wlanoidSetAtimWindow, - wlanoidSetFrequency, -}; - -// TODO: Check -/* OID query handlers without the need to access HW register */ -PFN_OID_HANDLER_FUNC apfnOidQueryHandlerWOHwAccess[] = { - wlanoidQueryBssid, - wlanoidQuerySsid, - wlanoidQueryInfrastructureMode, - wlanoidQueryAuthMode, - wlanoidQueryEncryptionStatus, - wlanoidQueryPmkid, - wlanoidQueryNetworkTypeInUse, - wlanoidQueryBssidList, - wlanoidQueryAcpiDevicePowerState, - wlanoidQuerySupportedRates, - wlanoidQueryDesiredRates, - wlanoidQuery802dot11PowerSaveProfile, - wlanoidQueryBeaconInterval, - wlanoidQueryAtimWindow, - wlanoidQueryFrequency, -}; - -/* OID set handlers allowed in RF test mode */ -PFN_OID_HANDLER_FUNC apfnOidSetHandlerAllowedInRFTest[] = { - wlanoidRftestSetTestMode, - wlanoidRftestSetAbortTestMode, - wlanoidRftestSetAutoTest, - wlanoidSetMcrWrite, - wlanoidSetEepromWrite -}; - -/* OID query handlers allowed in RF test mode */ -PFN_OID_HANDLER_FUNC apfnOidQueryHandlerAllowedInRFTest[] = { - wlanoidRftestQueryAutoTest, - wlanoidQueryMcrRead, - wlanoidQueryEepromRead -} -; - -PFN_OID_HANDLER_FUNC apfnOidWOTimeoutCheck[] = { - wlanoidRftestSetTestMode, - wlanoidRftestSetAbortTestMode, - wlanoidSetAcpiDevicePowerState, -}; - - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/*! -* \brief This is a private routine, which is used to check if HW access is needed -* for the OID query/ set handlers. -* -* \param[IN] pfnOidHandler Pointer to the OID handler. -* \param[IN] fgSetInfo It is a Set information handler. -* -* \retval TRUE This function needs HW access -* \retval FALSE This function does not need HW access -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wlanIsHandlerNeedHwAccess ( - IN PFN_OID_HANDLER_FUNC pfnOidHandler, - IN BOOLEAN fgSetInfo - ) -{ - PFN_OID_HANDLER_FUNC* apfnOidHandlerWOHwAccess; - UINT_32 i; - UINT_32 u4NumOfElem; - - if (fgSetInfo) { - apfnOidHandlerWOHwAccess = apfnOidSetHandlerWOHwAccess; - u4NumOfElem = sizeof(apfnOidSetHandlerWOHwAccess) / sizeof(PFN_OID_HANDLER_FUNC); - } - else { - apfnOidHandlerWOHwAccess = apfnOidQueryHandlerWOHwAccess; - u4NumOfElem = sizeof(apfnOidQueryHandlerWOHwAccess) / sizeof(PFN_OID_HANDLER_FUNC); - } - - for (i = 0; i < u4NumOfElem; i++) { - if (apfnOidHandlerWOHwAccess[i] == pfnOidHandler) { - return FALSE; - } - } - - return TRUE; -} /* wlanIsHandlerNeedHwAccess */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set flag for later handling card -* ejected event. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* -* \return (none) -* -* \note When surprised removal happens, Glue layer should invoke this -* function to notify WPDD not to do any hw access. -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanCardEjected ( - IN P_ADAPTER_T prAdapter - ) -{ - DEBUGFUNC("wlanCardEjected"); - //INITLOG(("\n")); - - ASSERT(prAdapter); - - /* mark that the card is being ejected, NDIS will shut us down soon */ - nicTxRelease(prAdapter); - -} /* wlanCardEjected */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Create adapter object -* -* \param prAdapter This routine is call to allocate the driver software objects. -* If fails, return NULL. -* \retval NULL If it fails, NULL is returned. -* \retval NOT NULL If the adapter was initialized successfully. -*/ -/*----------------------------------------------------------------------------*/ -P_ADAPTER_T -wlanAdapterCreate ( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - P_ADAPTER_T prAdpater = (P_ADAPTER_T)NULL; - - DEBUGFUNC("wlanAdapterCreate"); - - do { - prAdpater = (P_ADAPTER_T) kalMemAlloc(sizeof(ADAPTER_T), VIR_MEM_TYPE); - - if (!prAdpater) { - DBGLOG(INIT, ERROR, ("Allocate ADAPTER memory ==> FAILED\n")); - break; - } - -#if QM_TEST_MODE - g_rQM.prAdapter = prAdpater; -#endif - kalMemZero(prAdpater, sizeof(ADAPTER_T)); - prAdpater->prGlueInfo = prGlueInfo; - - } while(FALSE); - - return prAdpater; -} /* wlanAdapterCreate */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Destroy adapter object -* -* \param prAdapter This routine is call to destroy the driver software objects. -* If fails, return NULL. -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanAdapterDestroy ( - IN P_ADAPTER_T prAdapter - ) -{ - - if (!prAdapter) { - return; - } - - kalMemFree(prAdapter, VIR_MEM_TYPE, sizeof(ADAPTER_T)); - - return; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Initialize the adapter. The sequence is -* 1. Disable interrupt -* 2. Read adapter configuration from EEPROM and registry, verify chip ID. -* 3. Create NIC Tx/Rx resource. -* 4. Initialize the chip -* 5. Initialize the protocol -* 6. Enable Interrupt -* -* \param prAdapter Pointer of Adapter Data Structure -* -* \retval WLAN_STATUS_SUCCESS: Success -* \retval WLAN_STATUS_FAILURE: Failed -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanAdapterStart ( - IN P_ADAPTER_T prAdapter, - IN P_REG_INFO_T prRegInfo, - IN PVOID pvFwImageMapFile, - IN UINT_32 u4FwImageFileLength - ) -{ - WLAN_STATUS u4Status = WLAN_STATUS_SUCCESS; - UINT_32 i, u4Value = 0; - UINT_32 u4WHISR = 0; - UINT_8 aucTxCount[8]; -#if CFG_ENABLE_FW_DOWNLOAD - UINT_32 u4FwLoadAddr, u4ImgSecSize; - #if CFG_ENABLE_FW_DIVIDED_DOWNLOAD - UINT_32 j; - P_FIRMWARE_DIVIDED_DOWNLOAD_T prFwHead; - BOOLEAN fgValidHead; - const UINT_32 u4CRCOffset = offsetof(FIRMWARE_DIVIDED_DOWNLOAD_T, u4NumOfEntries); - #endif -#endif -#if (defined(MT5931) && (!CFG_SUPPORT_BCM_BWCS)) - PARAM_PTA_IPC_T rBwcsPta; - UINT_32 u4SetInfoLen; -#endif - - ASSERT(prAdapter); - - DEBUGFUNC("wlanAdapterStart"); - - //4 <0> Reset variables in ADAPTER_T - prAdapter->fgIsFwOwn = TRUE; - prAdapter->fgIsEnterD3ReqIssued = FALSE; - - QUEUE_INITIALIZE(&(prAdapter->rPendingCmdQueue)); - - /* Initialize rWlanInfo */ - kalMemSet(&(prAdapter->rWlanInfo), 0, sizeof(WLAN_INFO_T)); - - //4 <0.1> reset fgIsBusAccessFailed - fgIsBusAccessFailed = FALSE; - - do { - if ( (u4Status = nicAllocateAdapterMemory(prAdapter)) != WLAN_STATUS_SUCCESS ) { - DBGLOG(INIT, ERROR, ("nicAllocateAdapterMemory Error!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - - prAdapter->u4OsPacketFilter = PARAM_PACKET_FILTER_SUPPORTED; - -#if defined(MT6620) || defined(MT6628) - DBGLOG(INIT, TRACE, ("wlanAdapterStart(): Acquiring LP-OWN\n")); - ACQUIRE_POWER_CONTROL_FROM_PM(prAdapter); - #if !CFG_ENABLE_FULL_PM - nicpmSetDriverOwn(prAdapter); - #endif - - if(prAdapter->fgIsFwOwn == TRUE) { - DBGLOG(INIT, ERROR, ("nicpmSetDriverOwn() failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - - //4 <1> Initialize the Adapter - if ( (u4Status = nicInitializeAdapter(prAdapter)) != WLAN_STATUS_SUCCESS ) { - DBGLOG(INIT, ERROR, ("nicInitializeAdapter failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } -#endif - - //4 <2> Initialize System Service (MGMT Memory pool and STA_REC) - nicInitSystemService(prAdapter); - - //4 <3> Initialize Tx - nicTxInitialize(prAdapter); - wlanDefTxPowerCfg(prAdapter); - - //4 <4> Initialize Rx - nicRxInitialize(prAdapter); - -#if CFG_ENABLE_FW_DOWNLOAD - #if defined(MT6620) || defined(MT6628) - if (pvFwImageMapFile) { - /* 1. disable interrupt, download is done by polling mode only */ - nicDisableInterrupt(prAdapter); - - /* 2. Initialize Tx Resource to fw download state */ - nicTxInitResetResource(prAdapter); - - /* 3. FW download here */ - u4FwLoadAddr = prRegInfo->u4LoadAddress; - - #if CFG_ENABLE_FW_DIVIDED_DOWNLOAD - // 3a. parse file header for decision of divided firmware download or not - prFwHead = (P_FIRMWARE_DIVIDED_DOWNLOAD_T)pvFwImageMapFile; - - if(prFwHead->u4Signature == MTK_WIFI_SIGNATURE && - prFwHead->u4CRC == wlanCRC32((PUINT_8)pvFwImageMapFile + u4CRCOffset, u4FwImageFileLength - u4CRCOffset)) { - fgValidHead = TRUE; - } - else { - fgValidHead = FALSE; - } - - /* 3b. engage divided firmware downloading */ - if(fgValidHead == TRUE) { - for(i = 0 ; i < prFwHead->u4NumOfEntries ; i++) { - #if CFG_ENABLE_FW_DOWNLOAD_AGGREGATION - if(wlanImageSectionDownloadAggregated(prAdapter, - prFwHead->arSection[i].u4DestAddr, - prFwHead->arSection[i].u4Length, - (PUINT_8)pvFwImageMapFile + prFwHead->arSection[i].u4Offset) != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, ERROR, ("Firmware scatter download failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - } - #else - for(j = 0 ; j < prFwHead->arSection[i].u4Length ; j += CMD_PKT_SIZE_FOR_IMAGE) { - if(j + CMD_PKT_SIZE_FOR_IMAGE < prFwHead->arSection[i].u4Length) - u4ImgSecSize = CMD_PKT_SIZE_FOR_IMAGE; - else - u4ImgSecSize = prFwHead->arSection[i].u4Length - j; - - if(wlanImageSectionDownload(prAdapter, - prFwHead->arSection[i].u4DestAddr + j, - u4ImgSecSize, - (PUINT_8)pvFwImageMapFile + prFwHead->arSection[i].u4Offset + j) != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, ERROR, ("Firmware scatter download failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - } - #endif - - /* escape from loop if any pending error occurs */ - if(u4Status == WLAN_STATUS_FAILURE) { - break; - } - } - } - else - #endif - #if CFG_ENABLE_FW_DOWNLOAD_AGGREGATION - if(wlanImageSectionDownloadAggregated(prAdapter, - u4FwLoadAddr, - u4FwImageFileLength, - (PUINT_8)pvFwImageMapFile) != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, ERROR, ("Firmware scatter download failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - } - #else - for (i = 0; i < u4FwImageFileLength ; i += CMD_PKT_SIZE_FOR_IMAGE) { - if(i + CMD_PKT_SIZE_FOR_IMAGE < u4FwImageFileLength) - u4ImgSecSize = CMD_PKT_SIZE_FOR_IMAGE; - else - u4ImgSecSize = u4FwImageFileLength - i; - - if(wlanImageSectionDownload(prAdapter, - u4FwLoadAddr + i, - u4ImgSecSize, - (PUINT_8)pvFwImageMapFile + i) != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, ERROR, ("Firmware scatter download failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - } - #endif - - if(u4Status != WLAN_STATUS_SUCCESS) { - break; - } - - #if !CFG_ENABLE_FW_DOWNLOAD_ACK - // Send INIT_CMD_ID_QUERY_PENDING_ERROR command and wait for response - if(wlanImageQueryStatus(prAdapter) != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, ERROR, ("Firmware download failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - #endif - } - else { - DBGLOG(INIT, ERROR, ("No Firmware found!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - - /* 4. send Wi-Fi Start command */ - #if CFG_OVERRIDE_FW_START_ADDRESS - wlanConfigWifiFunc(prAdapter, - TRUE, - prRegInfo->u4StartAddress); - #else - wlanConfigWifiFunc(prAdapter, - FALSE, - 0); - #endif - #elif defined(MT5931) - if (pvFwImageMapFile) { - DBGLOG(INIT, TRACE, ("Download Address: 0x%08X\n", prRegInfo->u4LoadAddress)); - DBGLOG(INIT, TRACE, ("Firmware Length: 0x%08X\n", u4FwImageFileLength)); - - do { -#if CFG_SUPPORT_WHOLE_CHIP_RESET -#define RESET_RDY_INTERVAL (120) - - /* 1.0 whole-chip reset except HIFSYS */ - HAL_MCR_WR(prAdapter, MCR_WMCSR, WMCSR_CHIP_RST); - HAL_MCR_WR(prAdapter, MCR_WMCSR, 0); - - /* 1.0.1 delay for EEIF ready */ - kalMsleep(RESET_RDY_INTERVAL); -#endif - - /* 1.1 wait for INIT_RDY */ - i = 0; - while(1) { - HAL_MCR_RD(prAdapter, MCR_WMCSR, &u4Value); - - if (u4Value & WMCSR_INI_RDY) { - DBGLOG(INIT, TRACE, ("INIT-RDY detected\n")); - break; - } - else if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - u4Status = WLAN_STATUS_FAILURE; - break; - } - else if(i >= CFG_RESPONSE_POLLING_TIMEOUT) { - DBGLOG(INIT, ERROR, ("Waiting for Init Ready bit: Timeout\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - else { - i++; - kalMsleep(10); - } - } - - if(u4Status != WLAN_STATUS_SUCCESS) { - break; - } - - /* 1.2 set KSEL/FLEN */ - HAL_MCR_WR(prAdapter, MCR_FWCFG, u4FwImageFileLength >> 6); - - /* 1.3 enable FWDL_EN */ - HAL_MCR_WR(prAdapter, MCR_WMCSR, WMCSR_FWDLEN); - - /* 1.4 wait for PLL_RDY */ - i = 0; - while(1) { - HAL_MCR_RD(prAdapter, MCR_WMCSR, &u4Value); - - if (u4Value & WMCSR_PLLRDY) { - DBGLOG(INIT, TRACE, ("PLL-RDY detected\n")); - break; - } - else if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - u4Status = WLAN_STATUS_FAILURE; - break; - } - else if(i >= CFG_RESPONSE_POLLING_TIMEOUT) { - DBGLOG(INIT, ERROR, ("Waiting for PLL Ready bit: Timeout\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - else { - i++; - kalMsleep(10); - } - } - - if(u4Status != WLAN_STATUS_SUCCESS) { - break; - } - - /* 2.1 turn on HIFSYS firmware download mode */ - HAL_MCR_WR(prAdapter, MCR_FWDLSR, FWDLSR_FWDL_MODE); - - /* 2.2 set starting address */ - u4FwLoadAddr = prRegInfo->u4LoadAddress; - HAL_MCR_WR(prAdapter, MCR_FWDLDSAR, u4FwLoadAddr); - - /* 3. upload firmware */ - for (i = 0; i < u4FwImageFileLength ; i += CMD_PKT_SIZE_FOR_IMAGE) { - if(i + CMD_PKT_SIZE_FOR_IMAGE < u4FwImageFileLength) - u4ImgSecSize = CMD_PKT_SIZE_FOR_IMAGE; - else - u4ImgSecSize = u4FwImageFileLength - i; - - if(wlanImageSectionDownload(prAdapter, - u4FwLoadAddr + i, - u4ImgSecSize, - (PUINT_8)pvFwImageMapFile + i) != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, ERROR, ("Firmware scatter download failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - } - - if(u4Status != WLAN_STATUS_SUCCESS) { - break; - } - - /* 4.1 poll FWDL_OK & FWDL_FAIL bits */ - i = 0; - while(1) { - HAL_MCR_RD(prAdapter, MCR_WMCSR, &u4Value); - - if (u4Value & WMCSR_DL_OK) { - DBGLOG(INIT, TRACE, ("DL_OK detected\n")); - break; - } - else if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE - || (u4Value & WMCSR_DL_FAIL)) { - DBGLOG(INIT, ERROR, ("DL_FAIL detected: 0x%08X\n", u4Value)); - u4Status = WLAN_STATUS_FAILURE; - break; - } - else if(i >= CFG_RESPONSE_POLLING_TIMEOUT) { - DBGLOG(INIT, ERROR, ("Waiting for DL_OK/DL_FAIL bit: Timeout\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - else { - i++; - kalMsleep(10); - } - } - - if(u4Status != WLAN_STATUS_SUCCESS) { - break; - } - - /* 4.2 turn off HIFSYS download mode */ - HAL_MCR_WR(prAdapter, MCR_FWDLSR, 0); - - } while (FALSE); - - if(u4Status != WLAN_STATUS_SUCCESS) { - break; - } - - /* 5. disable interrupt */ - nicDisableInterrupt(prAdapter); - } - else { - DBGLOG(INIT, ERROR, ("No Firmware found!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - #endif -#endif - - DBGLOG(INIT, TRACE, ("wlanAdapterStart(): Waiting for Ready bit..\n")); - //4 <5> check Wi-Fi FW asserts ready bit - i = 0; - while(1) { - HAL_MCR_RD(prAdapter, MCR_WCIR, &u4Value); - - if (u4Value & WCIR_WLAN_READY) { - DBGLOG(INIT, TRACE, ("Ready bit asserted\n")); - break; - } - else if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - u4Status = WLAN_STATUS_FAILURE; - break; - } - else if(i >= CFG_RESPONSE_POLLING_TIMEOUT) { - UINT_32 u4MailBox0; - - nicGetMailbox(prAdapter, 0, &u4MailBox0); - DBGLOG(INIT, ERROR, ("Waiting for Ready bit: Timeout, ID=%d\n", - (u4MailBox0 & 0x0000FFFF))); - u4Status = WLAN_STATUS_FAILURE; - break; - } - else { - i++; - kalMsleep(10); - } - } - -#if defined(MT5931) - // Acquire LP-OWN - DBGLOG(INIT, TRACE, ("wlanAdapterStart(): Acquiring LP-OWN\n")); - ACQUIRE_POWER_CONTROL_FROM_PM(prAdapter); - #if !CFG_ENABLE_FULL_PM - nicpmSetDriverOwn(prAdapter); - #endif - - if(prAdapter->fgIsFwOwn == TRUE) { - DBGLOG(INIT, ERROR, ("nicpmSetDriverOwn() failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - - //4 <1> Initialize the Adapter - if ( (u4Status = nicInitializeAdapter(prAdapter)) != WLAN_STATUS_SUCCESS ) { - DBGLOG(INIT, ERROR, ("nicInitializeAdapter failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - - /* post initialization for MT5931 due to some CR is only accessible after driver own */ - nicRxPostInitialize(prAdapter); -#endif - - if(u4Status == WLAN_STATUS_SUCCESS) { - // 1. reset interrupt status - HAL_READ_INTR_STATUS(prAdapter, 4, (PUINT_8)&u4WHISR); - if(HAL_IS_TX_DONE_INTR(u4WHISR)) { - HAL_READ_TX_RELEASED_COUNT(prAdapter, aucTxCount); - } - - /* 2. reset TX Resource for normal operation */ - nicTxResetResource(prAdapter); - -#if CFG_SUPPORT_OSC_SETTING && defined(MT5931) - wlanSetMcuOscStableTime(prAdapter, 0); -#endif - - /* 3. query for permanent address by polling */ - wlanQueryPermanentAddress(prAdapter); - -#if (CFG_SUPPORT_NIC_CAPABILITY == 1) - /* 4. query for NIC capability */ - wlanQueryNicCapability(prAdapter); -#endif - - /* 5. Override network address */ - wlanUpdateNetworkAddress(prAdapter); - - /* 6. indicate disconnection as default status */ - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_DISCONNECT, - NULL, - 0); - } - - RECLAIM_POWER_CONTROL_TO_PM(prAdapter, FALSE); - - if(u4Status != WLAN_STATUS_SUCCESS) { - break; - } - - /* OID timeout timer initialize */ - cnmTimerInitTimer(prAdapter, - &prAdapter->rOidTimeoutTimer, - (PFN_MGMT_TIMEOUT_FUNC)wlanReleasePendingOid, - (UINT_32)NULL); - - /* Power state initialization */ - prAdapter->fgWiFiInSleepyState = FALSE; - prAdapter->rAcpiState = ACPI_STATE_D0; - - /* Online scan option */ - if(prRegInfo->fgDisOnlineScan == 0) { - prAdapter->fgEnOnlineScan = TRUE; - } - else { - prAdapter->fgEnOnlineScan = FALSE; - } - - /* Beacon lost detection option */ - if(prRegInfo->fgDisBcnLostDetection != 0) { - prAdapter->fgDisBcnLostDetection = TRUE; - } - - /* Load compile time constant */ - prAdapter->rWlanInfo.u2BeaconPeriod = CFG_INIT_ADHOC_BEACON_INTERVAL; - prAdapter->rWlanInfo.u2AtimWindow = CFG_INIT_ADHOC_ATIM_WINDOW; - -#if 1// set PM parameters - prAdapter->fgEnArpFilter = prRegInfo->fgEnArpFilter; - prAdapter->u4PsCurrentMeasureEn = prRegInfo->u4PsCurrentMeasureEn; - - prAdapter->u4UapsdAcBmp = prRegInfo->u4UapsdAcBmp; - - prAdapter->u4MaxSpLen = prRegInfo->u4MaxSpLen; - - DBGLOG(INIT, TRACE, ("[1] fgEnArpFilter:0x%x, u4UapsdAcBmp:0x%x, u4MaxSpLen:0x%x", - prAdapter->fgEnArpFilter, - prAdapter->u4UapsdAcBmp, - prAdapter->u4MaxSpLen)); - - prAdapter->fgEnCtiaPowerMode = FALSE; - -#endif - - /* MGMT Initialization */ - nicInitMGMT(prAdapter, prRegInfo); - - /* Enable WZC Disassociation */ - prAdapter->rWifiVar.fgSupportWZCDisassociation = TRUE; - - /* Apply Rate Setting */ - if((ENUM_REGISTRY_FIXED_RATE_T)(prRegInfo->u4FixedRate) < FIXED_RATE_NUM) { - prAdapter->rWifiVar.eRateSetting = (ENUM_REGISTRY_FIXED_RATE_T)(prRegInfo->u4FixedRate); - } - else { - prAdapter->rWifiVar.eRateSetting = FIXED_RATE_NONE; - } - - if(prAdapter->rWifiVar.eRateSetting == FIXED_RATE_NONE) { - /* Enable Auto (Long/Short) Preamble */ - prAdapter->rWifiVar.ePreambleType = PREAMBLE_TYPE_AUTO; - } - else if((prAdapter->rWifiVar.eRateSetting >= FIXED_RATE_MCS0_20M_400NS && - prAdapter->rWifiVar.eRateSetting <= FIXED_RATE_MCS7_20M_400NS) - || (prAdapter->rWifiVar.eRateSetting >= FIXED_RATE_MCS0_40M_400NS && - prAdapter->rWifiVar.eRateSetting <= FIXED_RATE_MCS32_400NS)) { - /* Force Short Preamble */ - prAdapter->rWifiVar.ePreambleType = PREAMBLE_TYPE_SHORT; - } - else { - /* Force Long Preamble */ - prAdapter->rWifiVar.ePreambleType = PREAMBLE_TYPE_LONG; - } - - /* Disable Hidden SSID Join */ - prAdapter->rWifiVar.fgEnableJoinToHiddenSSID = FALSE; - - /* Enable Short Slot Time */ - prAdapter->rWifiVar.fgIsShortSlotTimeOptionEnable = TRUE; - - /* configure available PHY type set */ - nicSetAvailablePhyTypeSet(prAdapter); - -#if 1// set PM parameters - { -#if CFG_SUPPORT_PWR_MGT - prAdapter->u4PowerMode = prRegInfo->u4PowerMode; - prAdapter->rWlanInfo.arPowerSaveMode[NETWORK_TYPE_P2P_INDEX].ucNetTypeIndex = NETWORK_TYPE_P2P_INDEX; - prAdapter->rWlanInfo.arPowerSaveMode[NETWORK_TYPE_P2P_INDEX].ucPsProfile = ENUM_PSP_FAST_SWITCH; -#else - prAdapter->u4PowerMode = ENUM_PSP_CONTINUOUS_ACTIVE; -#endif - {/*CR:WCNAE00007101*/ - struct net_device *prDev = prAdapter->prGlueInfo->prDevHandler; - - if (prDev != NULL) { - glBusSetIrq(prDev, NULL, prAdapter->prGlueInfo ); - } - else { - printk(KERN_INFO "Skip glBusSetIrq because of the prDev\n"); - } - } - nicConfigPowerSaveProfile( - prAdapter, - NETWORK_TYPE_AIS_INDEX, //FIXIT - prAdapter->u4PowerMode, - FALSE); - } - -#endif - -#if CFG_SUPPORT_NVRAM - /* load manufacture data */ - wlanLoadManufactureData(prAdapter, prRegInfo); -#endif - -#if (defined(MT5931) && (!CFG_SUPPORT_BCM_BWCS)) - //Enable DPD calibration. - rBwcsPta.u.aucBTPParams[0] = 0x00; - rBwcsPta.u.aucBTPParams[1] = 0x01; - rBwcsPta.u.aucBTPParams[2] = 0x00; - rBwcsPta.u.aucBTPParams[3] = 0x80; - - wlanoidSetBT(prAdapter, - (PVOID)&rBwcsPta, - sizeof(PARAM_PTA_IPC_T), - &u4SetInfoLen); -#endif - -#if 0 - /* Update Auto rate parameters in FW */ - nicRlmArUpdateParms(prAdapter, - prRegInfo->u4ArSysParam0, - prRegInfo->u4ArSysParam1, - prRegInfo->u4ArSysParam2, - prRegInfo->u4ArSysParam3); -#endif - - -#if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1) - /* clock gating workaround */ - prAdapter->fgIsClockGatingEnabled = FALSE; -#endif - - } while(FALSE); - - if(u4Status == WLAN_STATUS_SUCCESS) { - // restore to hardware default - HAL_SET_INTR_STATUS_READ_CLEAR(prAdapter); - HAL_SET_MAILBOX_READ_CLEAR(prAdapter, FALSE); - - /* Enable interrupt */ - nicEnableInterrupt(prAdapter); - - } - else { - // release allocated memory - nicReleaseAdapterMemory(prAdapter); - } - - return u4Status; -} /* wlanAdapterStart */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Uninitialize the adapter -* -* \param prAdapter Pointer of Adapter Data Structure -* -* \retval WLAN_STATUS_SUCCESS: Success -* \retval WLAN_STATUS_FAILURE: Failed -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanAdapterStop ( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_32 i, u4Value = 0; - WLAN_STATUS u4Status = WLAN_STATUS_SUCCESS; - - ASSERT(prAdapter); - -#if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1) - if(prAdapter->fgIsClockGatingEnabled == TRUE) { - nicDisableClockGating(prAdapter); - } -#endif - - /* MGMT - unitialization */ - nicUninitMGMT(prAdapter); - - if(prAdapter->rAcpiState == ACPI_STATE_D0 && -#if (CFG_CHIP_RESET_SUPPORT == 1) - kalIsResetting() == FALSE && -#endif - kalIsCardRemoved(prAdapter->prGlueInfo) == FALSE) { - - /* 0. Disable interrupt, this can be done without Driver own */ - nicDisableInterrupt(prAdapter); - - ACQUIRE_POWER_CONTROL_FROM_PM(prAdapter); - - /* 1. Set CMD to FW to tell WIFI to stop (enter power off state) */ - if(prAdapter->fgIsFwOwn == FALSE && - wlanSendNicPowerCtrlCmd(prAdapter, 1) == WLAN_STATUS_SUCCESS) { - /* 2. Clear pending interrupt */ - i = 0; - while(i < CFG_IST_LOOP_COUNT && nicProcessIST(prAdapter) != WLAN_STATUS_NOT_INDICATING) { - i++; - }; - - /* 3. Wait til RDY bit has been cleaerd */ - i = 0; - while(1) { - HAL_MCR_RD(prAdapter, MCR_WCIR, &u4Value); - - if ((u4Value & WCIR_WLAN_READY) == 0) - break; - else if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE - || i >= CFG_RESPONSE_POLLING_TIMEOUT) { - break; - } - else { - i++; - kalMsleep(10); - } - } - } - - /* 4. Set Onwership to F/W */ - nicpmSetFWOwn(prAdapter, FALSE); - -#if CFG_FORCE_RESET_UNDER_BUS_ERROR - if(HAL_TEST_FLAG(prAdapter, ADAPTER_FLAG_HW_ERR) == TRUE) { - /* force acquire firmware own */ - kalDevRegWrite(prAdapter->prGlueInfo, MCR_WHLPCR, WHLPCR_FW_OWN_REQ_CLR); - - /* delay for 10ms */ - kalMdelay(10); - - /* force firmware reset via software interrupt */ - kalDevRegWrite(prAdapter->prGlueInfo, MCR_WSICR, WSICR_H2D_SW_INT_SET); - - /* force release firmware own */ - kalDevRegWrite(prAdapter->prGlueInfo, MCR_WHLPCR, WHLPCR_FW_OWN_REQ_SET); - } -#endif - - RECLAIM_POWER_CONTROL_TO_PM(prAdapter, FALSE); - } - - nicRxUninitialize(prAdapter); - - nicTxRelease(prAdapter); - - /* System Service Uninitialization */ - nicUninitSystemService(prAdapter); - - nicReleaseAdapterMemory(prAdapter); - -#if defined(_HIF_SPI) - /* Note: restore the SPI Mode Select from 32 bit to default */ - nicRestoreSpiDefMode(prAdapter); -#endif - - return u4Status; -} /* wlanAdapterStop */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is called by ISR (interrupt). -* -* \param prAdapter Pointer of Adapter Data Structure -* -* \retval TRUE: NIC's interrupt -* \retval FALSE: Not NIC's interrupt -*/ -/*----------------------------------------------------------------------------*/ -BOOL -wlanISR ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgGlobalIntrCtrl - ) -{ - ASSERT(prAdapter); - - if (fgGlobalIntrCtrl) { - nicDisableInterrupt(prAdapter); - - //wlanIST(prAdapter); - } - - return TRUE; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is called by IST (task_let). -* -* \param prAdapter Pointer of Adapter Data Structure -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanIST ( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - ACQUIRE_POWER_CONTROL_FROM_PM(prAdapter); - - nicProcessIST(prAdapter); - - nicEnableInterrupt(prAdapter); - - RECLAIM_POWER_CONTROL_TO_PM(prAdapter, FALSE); - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will check command queue to find out if any could be dequeued -* and/or send to HIF to MT6620 -* -* \param prAdapter Pointer of Adapter Data Structure -* \param prCmdQue Pointer of Command Queue (in Glue Layer) -* -* \retval WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanProcessCommandQueue ( - IN P_ADAPTER_T prAdapter, - IN P_QUE_T prCmdQue - ) -{ - WLAN_STATUS rStatus; - QUE_T rTempCmdQue, rMergeCmdQue, rStandInCmdQue; - P_QUE_T prTempCmdQue, prMergeCmdQue, prStandInCmdQue; - P_QUE_ENTRY_T prQueueEntry; - P_CMD_INFO_T prCmdInfo; - P_MSDU_INFO_T prMsduInfo; - ENUM_FRAME_ACTION_T eFrameAction = FRAME_ACTION_DROP_PKT; - - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - ASSERT(prCmdQue); - - prTempCmdQue = &rTempCmdQue; - prMergeCmdQue = &rMergeCmdQue; - prStandInCmdQue = &rStandInCmdQue; - - QUEUE_INITIALIZE(prTempCmdQue); - QUEUE_INITIALIZE(prMergeCmdQue); - QUEUE_INITIALIZE(prStandInCmdQue); - - //4 <1> Move whole list of CMD_INFO to temp queue - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_QUE); - QUEUE_MOVE_ALL(prTempCmdQue, prCmdQue); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_QUE); - - //4 <2> Dequeue from head and check it is able to be sent - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - while(prQueueEntry) { - prCmdInfo = (P_CMD_INFO_T)prQueueEntry; - - switch(prCmdInfo->eCmdType) { - case COMMAND_TYPE_GENERAL_IOCTL: - case COMMAND_TYPE_NETWORK_IOCTL: - /* command packet will be always sent */ - eFrameAction = FRAME_ACTION_TX_PKT; - break; - - case COMMAND_TYPE_SECURITY_FRAME: - /* inquire with QM */ - eFrameAction = qmGetFrameAction(prAdapter, - prCmdInfo->eNetworkType, - prCmdInfo->ucStaRecIndex, - NULL, - FRAME_TYPE_802_1X); - break; - - case COMMAND_TYPE_MANAGEMENT_FRAME: - /* inquire with QM */ - prMsduInfo = (P_MSDU_INFO_T)(prCmdInfo->prPacket); - - eFrameAction = qmGetFrameAction(prAdapter, - prMsduInfo->ucNetworkType, - prMsduInfo->ucStaRecIndex, - prMsduInfo, - FRAME_TYPE_MMPDU); - break; - - default: - ASSERT(0); - break; - } - - //4 <3> handling upon dequeue result - if(eFrameAction == FRAME_ACTION_DROP_PKT) { - wlanReleaseCommand(prAdapter, prCmdInfo); - } - else if(eFrameAction == FRAME_ACTION_QUEUE_PKT) { - QUEUE_INSERT_TAIL(prMergeCmdQue, prQueueEntry); - } - else if(eFrameAction == FRAME_ACTION_TX_PKT) { - //4 <4> Send the command - rStatus = wlanSendCommand(prAdapter, prCmdInfo); - - if(rStatus == WLAN_STATUS_RESOURCES) { - // no more TC4 resource for further transmission - QUEUE_INSERT_TAIL(prMergeCmdQue, prQueueEntry); - break; - } - else if(rStatus == WLAN_STATUS_PENDING) { - // command packet which needs further handling upon response - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_PENDING); - QUEUE_INSERT_TAIL(&(prAdapter->rPendingCmdQueue), prQueueEntry); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_PENDING); - } - else { - P_CMD_INFO_T prCmdInfo = (P_CMD_INFO_T)prQueueEntry; - - if (rStatus == WLAN_STATUS_SUCCESS) { - if (prCmdInfo->pfCmdDoneHandler) { - prCmdInfo->pfCmdDoneHandler(prAdapter, prCmdInfo, prCmdInfo->pucInfoBuffer); - } - } - else { - if (prCmdInfo->fgIsOid) { - kalOidComplete(prAdapter->prGlueInfo, prCmdInfo->fgSetQuery, prCmdInfo->u4SetInfoLen, rStatus); - } - } - - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - } - } - else { - ASSERT(0); - } - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - } - - //4 <3> Merge back to original queue - //4 <3.1> Merge prMergeCmdQue & prTempCmdQue - QUEUE_CONCATENATE_QUEUES(prMergeCmdQue, prTempCmdQue); - - //4 <3.2> Move prCmdQue to prStandInQue, due to prCmdQue might differ due to incoming 802.1X frames - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_QUE); - QUEUE_MOVE_ALL(prStandInCmdQue, prCmdQue); - - //4 <3.3> concatenate prStandInQue to prMergeCmdQue - QUEUE_CONCATENATE_QUEUES(prMergeCmdQue, prStandInCmdQue); - - //4 <3.4> then move prMergeCmdQue to prCmdQue - QUEUE_MOVE_ALL(prCmdQue, prMergeCmdQue); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_QUE); - - return WLAN_STATUS_SUCCESS; -} /* end of wlanProcessCommandQueue() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will take CMD_INFO_T which carry some informations of -* incoming OID and notify the NIC_TX to send CMD. -* -* \param prAdapter Pointer of Adapter Data Structure -* \param prCmdInfo Pointer of P_CMD_INFO_T -* -* \retval WLAN_STATUS_SUCCESS : CMD was written to HIF and be freed(CMD Done) immediately. -* \retval WLAN_STATUS_RESOURCE : No resource for current command, need to wait for previous -* frame finishing their transmission. -* \retval WLAN_STATUS_FAILURE : Get failure while access HIF or been rejected. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanSendCommand ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ) -{ - P_TX_CTRL_T prTxCtrl; - UINT_8 ucTC; /* "Traffic Class" SW(Driver) resource classification */ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - prTxCtrl = &prAdapter->rTxCtrl; - - //DbgPrint("wlanSendCommand()\n"); - // - // -#if DBG && 0 - LOG_FUNC("wlanSendCommand()\n"); - LOG_FUNC("CmdType %u NetworkType %u StaRecIndex %u Oid %u CID 0x%x SetQuery %u NeedResp %u CmdSeqNum %u\n", - prCmdInfo->eCmdType, - prCmdInfo->eNetworkType, - prCmdInfo->ucStaRecIndex, - prCmdInfo->fgIsOid, - prCmdInfo->ucCID, - prCmdInfo->fgSetQuery, - prCmdInfo->fgNeedResp, - prCmdInfo->ucCmdSeqNum); -#endif - -#if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1) - if(prAdapter->fgIsClockGatingEnabled == TRUE) { - nicDisableClockGating(prAdapter); - } -#endif - - do { - // <0> card removal check - if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - rStatus = WLAN_STATUS_FAILURE; - break; - } - - // <1> Normal case of sending CMD Packet - if (!prCmdInfo->fgDriverDomainMCR) { - // <1.1> Assign Traffic Class(TC) = TC4. - ucTC = TC4_INDEX; - - // <1.2> Check if pending packet or resource was exhausted - if ((rStatus = nicTxAcquireResource(prAdapter, ucTC)) == WLAN_STATUS_RESOURCES) { - DbgPrint("NO Resource:%d\n", ucTC); - break; - } - - // <1.3> Forward CMD_INFO_T to NIC Layer - rStatus = nicTxCmd(prAdapter, prCmdInfo, ucTC); - - // <1.4> Set Pending in response to Query Command/Need Response - if (rStatus == WLAN_STATUS_SUCCESS) { - if ((!prCmdInfo->fgSetQuery) || (prCmdInfo->fgNeedResp)) { - rStatus = WLAN_STATUS_PENDING; - } - } - } - // <2> Special case for access Driver Domain MCR - else { - P_CMD_ACCESS_REG prCmdAccessReg; - prCmdAccessReg = (P_CMD_ACCESS_REG)(prCmdInfo->pucInfoBuffer + CMD_HDR_SIZE); - - if (prCmdInfo->fgSetQuery) { - HAL_MCR_WR(prAdapter, - (prCmdAccessReg->u4Address & BITS(2,31)), //address is in DWORD unit - prCmdAccessReg->u4Data); - } - else { - P_CMD_ACCESS_REG prEventAccessReg; - UINT_32 u4Address; - - u4Address = prCmdAccessReg->u4Address; - prEventAccessReg = (P_CMD_ACCESS_REG)prCmdInfo->pucInfoBuffer; - prEventAccessReg->u4Address = u4Address; - - HAL_MCR_RD(prAdapter, - prEventAccessReg->u4Address & BITS(2,31), //address is in DWORD unit - &prEventAccessReg->u4Data); - } - } - - } - while (FALSE); - -#if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1) - if(prAdapter->fgIsClockGatingEnabled == FALSE) { - nicEnableClockGating(prAdapter); - } -#endif - - return rStatus; -} /* end of wlanSendCommand() */ - - -/*----------------------------------------------------------------------------*/ -/*! - * \brief This function will release thd CMD_INFO upon its attribution - * - * \param prAdapter Pointer of Adapter Data Structure - * \param prCmdInfo Pointer of CMD_INFO_T - * - * \return (none) - */ -/*----------------------------------------------------------------------------*/ -VOID -wlanReleaseCommand ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ) -{ - P_TX_CTRL_T prTxCtrl; - P_MSDU_INFO_T prMsduInfo; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prTxCtrl = &prAdapter->rTxCtrl; - - switch(prCmdInfo->eCmdType) { - case COMMAND_TYPE_GENERAL_IOCTL: - case COMMAND_TYPE_NETWORK_IOCTL: - if (prCmdInfo->fgIsOid) { - kalOidComplete(prAdapter->prGlueInfo, - prCmdInfo->fgSetQuery, - prCmdInfo->u4SetInfoLen, - WLAN_STATUS_FAILURE); - } - break; - - case COMMAND_TYPE_SECURITY_FRAME: - kalSecurityFrameSendComplete(prAdapter->prGlueInfo, - prCmdInfo->prPacket, - WLAN_STATUS_FAILURE); - break; - - case COMMAND_TYPE_MANAGEMENT_FRAME: - prMsduInfo = (P_MSDU_INFO_T)prCmdInfo->prPacket; - - /* invoke callbacks */ - if(prMsduInfo->pfTxDoneHandler != NULL) { - prMsduInfo->pfTxDoneHandler(prAdapter, prMsduInfo, TX_RESULT_DROPPED_IN_DRIVER); - } - - GLUE_DEC_REF_CNT(prTxCtrl->i4TxMgmtPendingNum); - cnmMgtPktFree(prAdapter, prMsduInfo); - break; - - default: - ASSERT(0); - break; - } - - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - -} /* end of wlanReleaseCommand() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will search the CMD Queue to look for the pending OID and -* compelete it immediately when system request a reset. -* -* \param prAdapter ointer of Adapter Data Structure -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanReleasePendingOid ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Data - ) -{ - P_QUE_T prCmdQue; - QUE_T rTempCmdQue; - P_QUE_T prTempCmdQue = &rTempCmdQue; - P_QUE_ENTRY_T prQueueEntry = (P_QUE_ENTRY_T)NULL; - P_CMD_INFO_T prCmdInfo = (P_CMD_INFO_T)NULL; - - KAL_SPIN_LOCK_DECLARATION(); - - DEBUGFUNC("wlanReleasePendingOid"); - - ASSERT(prAdapter); - - DBGLOG(INIT, ERROR, ("OID Timeout! Releasing pending OIDs ..\n")); - - do { - // 1: Clear Pending OID in prAdapter->rPendingCmdQueue - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_PENDING); - - prCmdQue = &prAdapter->rPendingCmdQueue; - QUEUE_MOVE_ALL(prTempCmdQue, prCmdQue); - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - while (prQueueEntry) { - prCmdInfo = (P_CMD_INFO_T)prQueueEntry; - - if (prCmdInfo->fgIsOid) { - if (prCmdInfo->pfCmdTimeoutHandler) { - prCmdInfo->pfCmdTimeoutHandler(prAdapter, prCmdInfo); - } - else - kalOidComplete(prAdapter->prGlueInfo, - prCmdInfo->fgSetQuery, - 0, - WLAN_STATUS_FAILURE); - - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - } - else { - QUEUE_INSERT_TAIL(prCmdQue, prQueueEntry); - } - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - } - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_PENDING); - - // 2: Clear pending OID in glue layer command queue - kalOidCmdClearance(prAdapter->prGlueInfo); - - // 3: Clear pending OID queued in pvOidEntry with REQ_FLAG_OID set - kalOidClearance(prAdapter->prGlueInfo); - - } while(FALSE); - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will search the CMD Queue to look for the pending CMD/OID for specific -* NETWORK TYPE and compelete it immediately when system request a reset. -* -* \param prAdapter ointer of Adapter Data Structure -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanReleasePendingCMDbyNetwork ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType - ) -{ - P_QUE_T prCmdQue; - QUE_T rTempCmdQue; - P_QUE_T prTempCmdQue = &rTempCmdQue; - P_QUE_ENTRY_T prQueueEntry = (P_QUE_ENTRY_T)NULL; - P_CMD_INFO_T prCmdInfo = (P_CMD_INFO_T)NULL; - - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - - do { - // 1: Clear Pending OID in prAdapter->rPendingCmdQueue - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_PENDING); - - prCmdQue = &prAdapter->rPendingCmdQueue; - QUEUE_MOVE_ALL(prTempCmdQue, prCmdQue); - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - while (prQueueEntry) { - prCmdInfo = (P_CMD_INFO_T)prQueueEntry; - - DBGLOG(P2P, TRACE, ("Pending CMD for Network Type:%d \n", prCmdInfo->eNetworkType)); - - if (prCmdInfo->eNetworkType == eNetworkType) { - if (prCmdInfo->pfCmdTimeoutHandler) { - prCmdInfo->pfCmdTimeoutHandler(prAdapter, prCmdInfo); - } - else - kalOidComplete(prAdapter->prGlueInfo, - prCmdInfo->fgSetQuery, - 0, - WLAN_STATUS_FAILURE); - - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - } - else { - QUEUE_INSERT_TAIL(prCmdQue, prQueueEntry); - } - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - } - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_PENDING); - - - } while(FALSE); - - return; -} /* wlanReleasePendingCMDbyNetwork */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Return the packet buffer and reallocate one to the RFB -* -* \param prAdapter Pointer of Adapter Data Structure -* \param pvPacket Pointer of returned packet -* -* \retval WLAN_STATUS_SUCCESS: Success -* \retval WLAN_STATUS_FAILURE: Failed -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanReturnPacket ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvPacket - ) -{ - P_RX_CTRL_T prRxCtrl; - P_SW_RFB_T prSwRfb = NULL; - KAL_SPIN_LOCK_DECLARATION(); - - DEBUGFUNC("wlanReturnPacket"); - - ASSERT(prAdapter); - - prRxCtrl = &prAdapter->rRxCtrl; - ASSERT(prRxCtrl); - - if (pvPacket) { - kalPacketFree(prAdapter->prGlueInfo, pvPacket); - RX_ADD_CNT(prRxCtrl, RX_DATA_RETURNED_COUNT, 1); -#if CFG_NATIVE_802_11 - if (GLUE_TEST_FLAG(prAdapter->prGlueInfo, GLUE_FLAG_HALT)) { - } -#endif - } - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - QUEUE_REMOVE_HEAD(&prRxCtrl->rIndicatedRfbList, prSwRfb, P_SW_RFB_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - if (!prSwRfb){ - ASSERT(0); - return; - } - - if (nicRxSetupRFB(prAdapter, prSwRfb)){ - ASSERT(0); - return; - } - nicRxReturnRFB(prAdapter, prSwRfb); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is a required function that returns information about -* the capabilities and status of the driver and/or its network adapter. -* -* \param[IN] prAdapter Pointer to the Adapter structure. -* \param[IN] pfnOidQryHandler Function pointer for the OID query handler. -* \param[IN] pvInfoBuf Points to a buffer for return the query information. -* \param[IN] u4QueryBufferLen Specifies the number of bytes at pvInfoBuf. -* \param[OUT] pu4QueryInfoLen Points to the number of bytes it written or is needed. -* -* \retval WLAN_STATUS_xxx Different WLAN_STATUS code returned by different handlers. -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanQueryInformation ( - IN P_ADAPTER_T prAdapter, - IN PFN_OID_HANDLER_FUNC pfnOidQryHandler, - IN PVOID pvInfoBuf, - IN UINT_32 u4InfoBufLen, - OUT PUINT_32 pu4QryInfoLen - ) -{ - WLAN_STATUS status = WLAN_STATUS_FAILURE; - - ASSERT(prAdapter); - ASSERT(pu4QryInfoLen); - - // ignore any OID request after connected, under PS current measurement mode - if (prAdapter->u4PsCurrentMeasureEn && - (prAdapter->prGlueInfo->eParamMediaStateIndicated == PARAM_MEDIA_STATE_CONNECTED)) { - return WLAN_STATUS_SUCCESS; // note: return WLAN_STATUS_FAILURE or WLAN_STATUS_SUCCESS for blocking OIDs during current measurement ?? - } - -#if 1 - /* most OID handler will just queue a command packet */ - status = pfnOidQryHandler(prAdapter, - pvInfoBuf, - u4InfoBufLen, - pu4QryInfoLen); -#else - if (wlanIsHandlerNeedHwAccess(pfnOidQryHandler, FALSE)) { - ACQUIRE_POWER_CONTROL_FROM_PM(prAdapter); - - /* Reset sleepy state */ - if(prAdapter->fgWiFiInSleepyState == TRUE) { - prAdapter->fgWiFiInSleepyState = FALSE; - } - - status = pfnOidQryHandler(prAdapter, - pvInfoBuf, - u4InfoBufLen, - pu4QryInfoLen); - - RECLAIM_POWER_CONTROL_TO_PM(prAdapter, FALSE); - } - else { - status = pfnOidQryHandler(prAdapter, - pvInfoBuf, - u4InfoBufLen, - pu4QryInfoLen); - } -#endif - - return status; - -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is a required function that allows bound protocol drivers, -* or NDIS, to request changes in the state information that the miniport -* maintains for particular object identifiers, such as changes in multicast -* addresses. -* -* \param[IN] prAdapter Pointer to the Glue info structure. -* \param[IN] pfnOidSetHandler Points to the OID set handlers. -* \param[IN] pvInfoBuf Points to a buffer containing the OID-specific data for the set. -* \param[IN] u4InfoBufLen Specifies the number of bytes at prSetBuffer. -* \param[OUT] pu4SetInfoLen Points to the number of bytes it read or is needed. -* -* \retval WLAN_STATUS_xxx Different WLAN_STATUS code returned by different handlers. -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanSetInformation ( - IN P_ADAPTER_T prAdapter, - IN PFN_OID_HANDLER_FUNC pfnOidSetHandler, - IN PVOID pvInfoBuf, - IN UINT_32 u4InfoBufLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS status = WLAN_STATUS_FAILURE; - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - // ignore any OID request after connected, under PS current measurement mode - if (prAdapter->u4PsCurrentMeasureEn && - (prAdapter->prGlueInfo->eParamMediaStateIndicated == PARAM_MEDIA_STATE_CONNECTED)) { - return WLAN_STATUS_SUCCESS; // note: return WLAN_STATUS_FAILURE or WLAN_STATUS_SUCCESS for blocking OIDs during current measurement ?? - } - -#if 1 - /* most OID handler will just queue a command packet - * for power state transition OIDs, handler will acquire power control by itself - */ - status = pfnOidSetHandler(prAdapter, - pvInfoBuf, - u4InfoBufLen, - pu4SetInfoLen); -#else - if (wlanIsHandlerNeedHwAccess(pfnOidSetHandler, TRUE)) { - ACQUIRE_POWER_CONTROL_FROM_PM(prAdapter); - - /* Reset sleepy state */ - if(prAdapter->fgWiFiInSleepyState == TRUE) { - prAdapter->fgWiFiInSleepyState = FALSE; - } - - status = pfnOidSetHandler(prAdapter, - pvInfoBuf, - u4InfoBufLen, - pu4SetInfoLen); - - RECLAIM_POWER_CONTROL_TO_PM(prAdapter, FALSE); - } - else { - status = pfnOidSetHandler(prAdapter, - pvInfoBuf, - u4InfoBufLen, - pu4SetInfoLen); - } -#endif - - return status; -} - - -#if CFG_SUPPORT_WAPI -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is a used to query driver's config wapi mode or not -* -* \param[IN] prAdapter Pointer to the Glue info structure. -* -* \retval TRUE for use wapi mode -* -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wlanQueryWapiMode ( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - return prAdapter->rWifiVar.rConnSettings.fgWapiMode; -} -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is called to set RX filter to Promiscuous Mode. -* -* \param[IN] prAdapter Pointer to the Adapter structure. -* \param[IN] fgEnablePromiscuousMode Enable/ disable RX Promiscuous Mode. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanSetPromiscuousMode ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgEnablePromiscuousMode - ) -{ - ASSERT(prAdapter); - -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is called to set RX filter to allow to receive -* broadcast address packets. -* -* \param[IN] prAdapter Pointer to the Adapter structure. -* \param[IN] fgEnableBroadcast Enable/ disable broadcast packet to be received. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanRxSetBroadcast ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgEnableBroadcast - ) -{ - ASSERT(prAdapter); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is called to send out CMD_NIC_POWER_CTRL command packet -* -* \param[IN] prAdapter Pointer to the Adapter structure. -* \param[IN] ucPowerMode refer to CMD/EVENT document -* -* \return WLAN_STATUS_SUCCESS -* \return WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanSendNicPowerCtrlCmd ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucPowerMode - ) -{ - WLAN_STATUS status = WLAN_STATUS_SUCCESS; - P_GLUE_INFO_T prGlueInfo; - P_CMD_INFO_T prCmdInfo; - P_WIFI_CMD_T prWifiCmd; - UINT_8 ucTC, ucCmdSeqNum; - - ASSERT(prAdapter); - - prGlueInfo = prAdapter->prGlueInfo; - - /* 1. Prepare CMD */ - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, (CMD_HDR_SIZE + sizeof(CMD_NIC_POWER_CTRL))); - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - /* 2.1 increase command sequence number */ - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - DBGLOG(REQ, TRACE, ("ucCmdSeqNum =%d\n", ucCmdSeqNum)); - - /* 2.2 Setup common CMD Info Packet */ - prCmdInfo->eCmdType = COMMAND_TYPE_GENERAL_IOCTL; - prCmdInfo->u2InfoBufLen = (UINT_16)(CMD_HDR_SIZE + sizeof(CMD_NIC_POWER_CTRL)); - prCmdInfo->pfCmdDoneHandler = NULL; - prCmdInfo->pfCmdTimeoutHandler = NULL; - prCmdInfo->fgIsOid = TRUE; - prCmdInfo->ucCID = CMD_ID_NIC_POWER_CTRL; - prCmdInfo->fgSetQuery = TRUE; - prCmdInfo->fgNeedResp = FALSE; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = sizeof(CMD_NIC_POWER_CTRL); - - /* 2.3 Setup WIFI_CMD_T */ - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - kalMemZero(prWifiCmd->aucBuffer, sizeof(CMD_NIC_POWER_CTRL)); - ((P_CMD_NIC_POWER_CTRL)(prWifiCmd->aucBuffer))->ucPowerMode = ucPowerMode; - - /* 3. Issue CMD for entering specific power mode */ - ucTC = TC4_INDEX; - - while(1) { - // 3.0 Removal check - if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - status = WLAN_STATUS_FAILURE; - break; - } - - // 3.1 Acquire TX Resource - if (nicTxAcquireResource(prAdapter, ucTC) == WLAN_STATUS_RESOURCES) { - if (nicTxPollingResource(prAdapter, ucTC) != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, ERROR,("Fail to get TX resource return within timeout\n")); - status = WLAN_STATUS_FAILURE; - break; - } - else { - continue; - } - } - - // 3.2 Send CMD Info Packet - if (nicTxCmd(prAdapter, prCmdInfo, ucTC) != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, ERROR,("Fail to transmit CMD_NIC_POWER_CTRL command\n")); - status = WLAN_STATUS_FAILURE; - } - - break; - }; - - // 4. Free CMD Info Packet. - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - - // 5. Add flag - if(ucPowerMode == 1) { - prAdapter->fgIsEnterD3ReqIssued = TRUE; - } - - return status; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is called to check if it is RF test mode and -* the OID is allowed to be called or not -* -* \param[IN] prAdapter Pointer to the Adapter structure. -* \param[IN] fgEnableBroadcast Enable/ disable broadcast packet to be received. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wlanIsHandlerAllowedInRFTest ( - IN PFN_OID_HANDLER_FUNC pfnOidHandler, - IN BOOLEAN fgSetInfo - ) -{ - PFN_OID_HANDLER_FUNC* apfnOidHandlerAllowedInRFTest; - UINT_32 i; - UINT_32 u4NumOfElem; - - if (fgSetInfo) { - apfnOidHandlerAllowedInRFTest = apfnOidSetHandlerAllowedInRFTest; - u4NumOfElem = sizeof(apfnOidSetHandlerAllowedInRFTest) / sizeof(PFN_OID_HANDLER_FUNC); - } - else { - apfnOidHandlerAllowedInRFTest = apfnOidQueryHandlerAllowedInRFTest; - u4NumOfElem = sizeof(apfnOidQueryHandlerAllowedInRFTest) / sizeof(PFN_OID_HANDLER_FUNC); - } - - for (i = 0; i < u4NumOfElem; i++) { - if (apfnOidHandlerAllowedInRFTest[i] == pfnOidHandler) { - return TRUE; - } - } - - return FALSE; -} - -#if CFG_ENABLE_FW_DOWNLOAD - #if CFG_ENABLE_FW_DOWNLOAD_AGGREGATION -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to download FW image in an aggregated way -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanImageSectionDownloadAggregated ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4DestAddr, - IN UINT_32 u4ImgSecSize, - IN PUINT_8 pucImgSecBuf - ) -{ - #if defined(MT6620) || defined(MT6628) - P_CMD_INFO_T prCmdInfo; - P_INIT_HIF_TX_HEADER_T prInitHifTxHeader; - P_INIT_CMD_DOWNLOAD_BUF prInitCmdDownloadBuf; - UINT_8 ucTC, ucCmdSeqNum; - WLAN_STATUS u4Status = WLAN_STATUS_SUCCESS; - PUINT_8 pucOutputBuf = (PUINT_8)NULL; /* Pointer to Transmit Data Structure Frame */ - UINT_32 u4PktCnt, u4Offset, u4Length; - UINT_32 u4TotalLength; - - ASSERT(prAdapter); - ASSERT(pucImgSecBuf); - - pucOutputBuf = prAdapter->rTxCtrl.pucTxCoalescingBufPtr; - - DEBUGFUNC("wlanImageSectionDownloadAggregated"); - - if (u4ImgSecSize == 0) { - return WLAN_STATUS_SUCCESS; - } - - // 1. Allocate CMD Info Packet and Pre-fill Headers - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, - sizeof(INIT_HIF_TX_HEADER_T) + sizeof(INIT_CMD_DOWNLOAD_BUF) + CMD_PKT_SIZE_FOR_IMAGE); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - prCmdInfo->u2InfoBufLen = - sizeof(INIT_HIF_TX_HEADER_T) + sizeof(INIT_CMD_DOWNLOAD_BUF) + CMD_PKT_SIZE_FOR_IMAGE; - - // 2. Use TC0's resource to download image. (only TC0 is allowed) - ucTC = TC0_INDEX; - - // 3. Setup common CMD Info Packet - prInitHifTxHeader = (P_INIT_HIF_TX_HEADER_T)(prCmdInfo->pucInfoBuffer); - prInitHifTxHeader->ucEtherTypeOffset = 0; - prInitHifTxHeader->ucCSflags = 0; - prInitHifTxHeader->rInitWifiCmd.ucCID = INIT_CMD_ID_DOWNLOAD_BUF; - - // 4. Setup CMD_DOWNLOAD_BUF - prInitCmdDownloadBuf = (P_INIT_CMD_DOWNLOAD_BUF)(prInitHifTxHeader->rInitWifiCmd.aucBuffer); - prInitCmdDownloadBuf->u4DataMode = 0 - #if CFG_ENABLE_FW_ENCRYPTION - | DOWNLOAD_BUF_ENCRYPTION_MODE - #endif - ; - - // 5.0 reset loop control variable - u4TotalLength = 0; - u4Offset = u4PktCnt = 0; - - // 5.1 main loop for maximize transmission count per access - while(u4Offset < u4ImgSecSize) { - if(nicTxAcquireResource(prAdapter, ucTC) == WLAN_STATUS_SUCCESS) { - // 5.1.1 calculate u4Length - if(u4Offset + CMD_PKT_SIZE_FOR_IMAGE < u4ImgSecSize) { - u4Length = CMD_PKT_SIZE_FOR_IMAGE; - } - else { - u4Length = u4ImgSecSize - u4Offset; - } - - // 5.1.1 increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - prInitHifTxHeader->rInitWifiCmd.ucSeqNum = ucCmdSeqNum; - - // 5.1.2 update HIF TX hardware header - prInitHifTxHeader->u2TxByteCount = ALIGN_4(sizeof(INIT_HIF_TX_HEADER_T) + sizeof(INIT_CMD_DOWNLOAD_BUF) + (UINT_16)u4Length); - - // 5.1.3 fill command header - prInitCmdDownloadBuf->u4Address = u4DestAddr + u4Offset; - prInitCmdDownloadBuf->u4Length = u4Length; - prInitCmdDownloadBuf->u4CRC32 = wlanCRC32(pucImgSecBuf + u4Offset, u4Length); - - // 5.1.4.1 copy header to coalescing buffer - kalMemCopy(pucOutputBuf + u4TotalLength, - (PVOID)prCmdInfo->pucInfoBuffer, - sizeof(INIT_HIF_TX_HEADER_T) + sizeof(INIT_CMD_DOWNLOAD_BUF)); - - // 5.1.4.2 copy payload to coalescing buffer - kalMemCopy(pucOutputBuf + u4TotalLength + sizeof(INIT_HIF_TX_HEADER_T) + sizeof(INIT_CMD_DOWNLOAD_BUF), - pucImgSecBuf + u4Offset, - u4Length); - - // 5.1.4.3 update length and other variables - u4TotalLength += ALIGN_4(sizeof(INIT_HIF_TX_HEADER_T) + sizeof(INIT_CMD_DOWNLOAD_BUF) + u4Length); - u4Offset += u4Length; - u4PktCnt++; - - if(u4Offset < u4ImgSecSize) { - continue; - } - } - else if(u4PktCnt == 0) { - /* no resource, so get some back */ - if (nicTxPollingResource(prAdapter, ucTC) != WLAN_STATUS_SUCCESS) { - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR,("Fail to get TX resource return within timeout\n")); - break; - } - } - - if(u4PktCnt != 0) { - // start transmission - HAL_WRITE_TX_PORT(prAdapter, - 0, - u4TotalLength, - (PUINT_8)pucOutputBuf, - prAdapter->u4CoalescingBufCachedSize); - - // reset varaibles - u4PktCnt = 0; - u4TotalLength = 0; - } - } - - // 8. Free CMD Info Packet. - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - - return u4Status; - - #else - #error "Only MT6620/MT6628 supports firmware download in an aggregated way" - - return WLAN_STATUS_FAILURE; - - #endif -} - - #endif -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to download FW image. -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanImageSectionDownload ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4DestAddr, - IN UINT_32 u4ImgSecSize, - IN PUINT_8 pucImgSecBuf - ) -{ - #if defined(MT6620) || defined(MT6628) - - P_CMD_INFO_T prCmdInfo; - P_INIT_HIF_TX_HEADER_T prInitHifTxHeader; - P_INIT_CMD_DOWNLOAD_BUF prInitCmdDownloadBuf; - UINT_8 ucTC, ucCmdSeqNum; - WLAN_STATUS u4Status = WLAN_STATUS_SUCCESS; - - ASSERT(prAdapter); - ASSERT(pucImgSecBuf); - ASSERT(u4ImgSecSize <= CMD_PKT_SIZE_FOR_IMAGE); - - DEBUGFUNC("wlanImageSectionDownload"); - - if (u4ImgSecSize == 0) { - return WLAN_STATUS_SUCCESS; - } - - // 1. Allocate CMD Info Packet and its Buffer. - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, - sizeof(INIT_HIF_TX_HEADER_T) + sizeof(INIT_CMD_DOWNLOAD_BUF) + u4ImgSecSize); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - prCmdInfo->u2InfoBufLen = - sizeof(INIT_HIF_TX_HEADER_T) + sizeof(INIT_CMD_DOWNLOAD_BUF) + (UINT_16)u4ImgSecSize; - - // 2. Use TC0's resource to download image. (only TC0 is allowed) - ucTC = TC0_INDEX; - - // 3. increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - - // 4. Setup common CMD Info Packet - prInitHifTxHeader = (P_INIT_HIF_TX_HEADER_T)(prCmdInfo->pucInfoBuffer); - prInitHifTxHeader->rInitWifiCmd.ucCID = INIT_CMD_ID_DOWNLOAD_BUF; - prInitHifTxHeader->rInitWifiCmd.ucSeqNum = ucCmdSeqNum; - - // 5. Setup CMD_DOWNLOAD_BUF - prInitCmdDownloadBuf = (P_INIT_CMD_DOWNLOAD_BUF)(prInitHifTxHeader->rInitWifiCmd.aucBuffer); - prInitCmdDownloadBuf->u4Address = u4DestAddr; - prInitCmdDownloadBuf->u4Length = u4ImgSecSize; - prInitCmdDownloadBuf->u4CRC32 = wlanCRC32(pucImgSecBuf, u4ImgSecSize); - prInitCmdDownloadBuf->u4DataMode = 0 - #if CFG_ENABLE_FW_DOWNLOAD_ACK - | DOWNLOAD_BUF_ACK_OPTION // ACK needed - #endif - #if CFG_ENABLE_FW_ENCRYPTION - | DOWNLOAD_BUF_ENCRYPTION_MODE - #endif - ; - kalMemCopy(prInitCmdDownloadBuf->aucBuffer, pucImgSecBuf, u4ImgSecSize); - - // 6. Send FW_Download command - while(1) { - // 6.1 Acquire TX Resource - if (nicTxAcquireResource(prAdapter, ucTC) == WLAN_STATUS_RESOURCES) { - if (nicTxPollingResource(prAdapter, ucTC) != WLAN_STATUS_SUCCESS) { - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR,("Fail to get TX resource return within timeout\n")); - break; - } - else { - continue; - } - } - - // 6.2 Send CMD Info Packet - if (nicTxInitCmd(prAdapter, prCmdInfo, ucTC) != WLAN_STATUS_SUCCESS) { - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR,("Fail to transmit image download command\n")); - } - - break; - }; - - #if CFG_ENABLE_FW_DOWNLOAD_ACK - // 7. Wait for INIT_EVENT_ID_CMD_RESULT - u4Status = wlanImageSectionDownloadStatus(prAdapter, ucCmdSeqNum); - #endif - - // 8. Free CMD Info Packet. - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - - return u4Status; - - #elif defined(MT5931) - - UINT_32 i, u4Value; - P_HIF_HW_TX_HEADER_T prHifTxHeader; - - WLAN_STATUS u4Status = WLAN_STATUS_SUCCESS; - - ASSERT(prAdapter); - ASSERT(pucImgSecBuf); - ASSERT(u4ImgSecSize <= CMD_PKT_SIZE_FOR_IMAGE); - - DEBUGFUNC("wlanImageSectionDownload"); - DBGLOG(INIT, TRACE, ("Destination: 0x%08X / Length: 0x%08X\n", u4DestAddr, u4ImgSecSize)); - - if (u4ImgSecSize == 0) { - return WLAN_STATUS_SUCCESS; - } - - // 1. Use TX coalescing buffer - prHifTxHeader = (P_HIF_HW_TX_HEADER_T) prAdapter->pucCoalescingBufCached; - - // 2. Setup HIF_TX_HEADER - prHifTxHeader->u2TxByteCount = (UINT_16)(ALIGN_4(sizeof(HIF_HW_TX_HEADER_T) + u4ImgSecSize)); - prHifTxHeader->ucEtherTypeOffset = 0; - prHifTxHeader->ucCSflags = 0; - - // 3. Copy payload - kalMemCopy(prHifTxHeader->aucBuffer, pucImgSecBuf, u4ImgSecSize); - - // 3.1 add 4-bytes zero tail - kalMemZero(&(prHifTxHeader->aucBuffer[ALIGN_4(u4ImgSecSize)]), sizeof(HIF_HW_TX_HEADER_T)); - - // 4. Poll til FWDL_RDY = 1 - i = 0; - while(1) { - HAL_MCR_RD(prAdapter, MCR_FWDLSR, &u4Value); - - if (u4Value & FWDLSR_FWDL_RDY) { - DBGLOG(INIT, TRACE, ("FWDL_RDY detected\n")); - break; - } - else if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - u4Status = WLAN_STATUS_FAILURE; - break; - } - else if(i >= CFG_RESPONSE_POLLING_TIMEOUT) { - DBGLOG(INIT, ERROR, ("Waiting for FWDL_RDY: Timeout (0x%08X)\n", u4Value)); - u4Status = WLAN_STATUS_FAILURE; - break; - } - else { - i++; - kalMsleep(10); - } - } - - // 5. Send firmware - HAL_PORT_WR(prAdapter, - MCR_FWDLDR, - prHifTxHeader->u2TxByteCount, - (PUINT_8)prHifTxHeader, - prAdapter->u4CoalescingBufCachedSize); - - return u4Status; - - #endif -} - -#if !CFG_ENABLE_FW_DOWNLOAD_ACK -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to confirm previously firmware download is done without error -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanImageQueryStatus( - IN P_ADAPTER_T prAdapter - ) -{ - P_CMD_INFO_T prCmdInfo; - P_INIT_HIF_TX_HEADER_T prInitHifTxHeader; - UINT_8 aucBuffer[sizeof(INIT_HIF_RX_HEADER_T) + sizeof(INIT_EVENT_PENDING_ERROR)]; - UINT_32 u4RxPktLength; - P_INIT_HIF_RX_HEADER_T prInitHifRxHeader; - P_INIT_EVENT_PENDING_ERROR prEventPendingError; - WLAN_STATUS u4Status = WLAN_STATUS_SUCCESS; - UINT_8 ucTC, ucCmdSeqNum; - - ASSERT(prAdapter); - - DEBUGFUNC("wlanImageQueryStatus"); - - // 1. Allocate CMD Info Packet and it Buffer. - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, sizeof(INIT_HIF_TX_HEADER_T)); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - kalMemZero(prCmdInfo, sizeof(INIT_HIF_TX_HEADER_T)); - prCmdInfo->u2InfoBufLen = sizeof(INIT_HIF_TX_HEADER_T); - - // 2. Use TC0's resource to download image. (only TC0 is allowed) - ucTC = TC0_INDEX; - - // 3. increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - - // 4. Setup common CMD Info Packet - prInitHifTxHeader = (P_INIT_HIF_TX_HEADER_T)(prCmdInfo->pucInfoBuffer); - prInitHifTxHeader->rInitWifiCmd.ucCID = INIT_CMD_ID_QUERY_PENDING_ERROR; - prInitHifTxHeader->rInitWifiCmd.ucSeqNum = ucCmdSeqNum; - - // 5. Send command - while(1) { - // 5.1 Acquire TX Resource - if (nicTxAcquireResource(prAdapter, ucTC) == WLAN_STATUS_RESOURCES) { - if (nicTxPollingResource(prAdapter, ucTC) != WLAN_STATUS_SUCCESS) { - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR,("Fail to get TX resource return within timeout\n")); - break; - } - else { - continue; - } - } - - // 5.2 Send CMD Info Packet - if (nicTxInitCmd(prAdapter, prCmdInfo, ucTC) != WLAN_STATUS_SUCCESS) { - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR,("Fail to transmit image download command\n")); - } - - break; - }; - - // 6. Wait for INIT_EVENT_ID_PENDING_ERROR - do { - if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR, ("Bus error(%d)/Card removed(%d)\n", fgIsBusAccessFailed, kalIsCardRemoved(prAdapter->prGlueInfo))); - } - else if(nicRxWaitResponse(prAdapter, - 0, - aucBuffer, - sizeof(INIT_HIF_RX_HEADER_T) + sizeof(INIT_EVENT_PENDING_ERROR), - &u4RxPktLength) != WLAN_STATUS_SUCCESS) { - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR, ("No RX response\n")); - } - else { - prInitHifRxHeader = (P_INIT_HIF_RX_HEADER_T) aucBuffer; - - // EID / SeqNum check - if(prInitHifRxHeader->rInitWifiEvent.ucEID != INIT_EVENT_ID_PENDING_ERROR) { - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR, ("EVENT-ID Mismatch: %d\n", prInitHifRxHeader->rInitWifiEvent.ucEID)); - } - else if(prInitHifRxHeader->rInitWifiEvent.ucSeqNum != ucCmdSeqNum) { - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR, ("SEQ-NUM Mismatch: %d (expected: %d)\n", prInitHifRxHeader->rInitWifiEvent.ucSeqNum, ucCmdSeqNum)); - } - else { - prEventPendingError = (P_INIT_EVENT_PENDING_ERROR) (prInitHifRxHeader->rInitWifiEvent.aucBuffer); - if(prEventPendingError->ucStatus != 0) { // 0 for download success - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR, ("ERROR CODE: %d\n", prEventCmdResult->ucStatus)); - } - else { - u4Status = WLAN_STATUS_SUCCESS; - } - } - } - } while (FALSE); - - // 7. Free CMD Info Packet. - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - - return u4Status; -} - - -#else -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to confirm the status of -* previously downloaded firmware scatter -* -* @param prAdapter Pointer to the Adapter structure. -* ucCmdSeqNum Sequence number of previous firmware scatter -* -* @return WLAN_STATUS_SUCCESS -* WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanImageSectionDownloadStatus ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucCmdSeqNum - ) -{ - UINT_8 aucBuffer[sizeof(INIT_HIF_RX_HEADER_T) + sizeof(INIT_EVENT_CMD_RESULT)]; - P_INIT_HIF_RX_HEADER_T prInitHifRxHeader; - P_INIT_EVENT_CMD_RESULT prEventCmdResult; - UINT_32 u4RxPktLength; - WLAN_STATUS u4Status; - - ASSERT(prAdapter); - - do { - if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR, ("Bus error(%d)/Card removed(%d)\n", fgIsBusAccessFailed, kalIsCardRemoved(prAdapter->prGlueInfo))); - } - else if(nicRxWaitResponse(prAdapter, - 0, - aucBuffer, - sizeof(INIT_HIF_RX_HEADER_T) + sizeof(INIT_EVENT_CMD_RESULT), - &u4RxPktLength) != WLAN_STATUS_SUCCESS) { - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR, ("No RX response\n")); - } - else { - prInitHifRxHeader = (P_INIT_HIF_RX_HEADER_T) aucBuffer; - - // EID / SeqNum check - if(prInitHifRxHeader->rInitWifiEvent.ucEID != INIT_EVENT_ID_CMD_RESULT) { - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR, ("EVENT-ID Mismatch: %d\n", prInitHifRxHeader->rInitWifiEvent.ucEID)); - } - else if(prInitHifRxHeader->rInitWifiEvent.ucSeqNum != ucCmdSeqNum) { - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR, ("SEQ-NUM Mismatch: %d\n", prInitHifRxHeader->rInitWifiEvent.ucSeqNum)); - } - else { - prEventCmdResult = (P_INIT_EVENT_CMD_RESULT) (prInitHifRxHeader->rInitWifiEvent.aucBuffer); - if(prEventCmdResult->ucStatus != 0) { // 0 for download success - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR, ("ERROR CODE: %d\n", prEventCmdResult->ucStatus)); - } - else { - u4Status = WLAN_STATUS_SUCCESS; - } - } - } - } while (FALSE); - - return u4Status; -} - - -#endif -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to start FW normal operation. -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanConfigWifiFunc ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgEnable, - IN UINT_32 u4StartAddress - ) -{ - P_CMD_INFO_T prCmdInfo; - P_INIT_HIF_TX_HEADER_T prInitHifTxHeader; - P_INIT_CMD_WIFI_START prInitCmdWifiStart; - UINT_8 ucTC, ucCmdSeqNum; - WLAN_STATUS u4Status = WLAN_STATUS_SUCCESS; - - ASSERT(prAdapter); - - DEBUGFUNC("wlanConfigWifiFunc"); - - // 1. Allocate CMD Info Packet and its Buffer. - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, - sizeof(INIT_HIF_TX_HEADER_T) + sizeof(INIT_CMD_WIFI_START)); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - kalMemZero(prCmdInfo, sizeof(INIT_HIF_TX_HEADER_T) + sizeof(INIT_CMD_WIFI_START)); - prCmdInfo->u2InfoBufLen = - sizeof(INIT_HIF_TX_HEADER_T) + sizeof(INIT_CMD_WIFI_START); - - // 2. Always use TC0 - ucTC = TC0_INDEX; - - // 3. increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - - // 4. Setup common CMD Info Packet - prInitHifTxHeader = (P_INIT_HIF_TX_HEADER_T)(prCmdInfo->pucInfoBuffer); - prInitHifTxHeader->rInitWifiCmd.ucCID = INIT_CMD_ID_WIFI_START; - prInitHifTxHeader->rInitWifiCmd.ucSeqNum = ucCmdSeqNum; - - prInitCmdWifiStart = (P_INIT_CMD_WIFI_START)(prInitHifTxHeader->rInitWifiCmd.aucBuffer); - prInitCmdWifiStart->u4Override = (fgEnable == TRUE ? 1 : 0); - prInitCmdWifiStart->u4Address = u4StartAddress; - - // 5. Seend WIFI start command - while(1) { - // 5.1 Acquire TX Resource - if (nicTxAcquireResource(prAdapter, ucTC) == WLAN_STATUS_RESOURCES) { - if (nicTxPollingResource(prAdapter, ucTC) != WLAN_STATUS_SUCCESS) { - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR,("Fail to get TX resource return within timeout\n")); - break; - } - else { - continue; - } - } - - // 5.2 Send CMD Info Packet - if (nicTxInitCmd(prAdapter, prCmdInfo, ucTC) != WLAN_STATUS_SUCCESS) { - u4Status = WLAN_STATUS_FAILURE; - DBGLOG(INIT, ERROR,("Fail to transmit WIFI start command\n")); - } - - break; - }; - - // 6. Free CMD Info Packet. - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - - return u4Status; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to generate CRC32 checksum -* -* @param buf Pointer to the data. -* @param len data length -* -* @return crc32 value -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 wlanCRC32( - PUINT_8 buf, - UINT_32 len) -{ - UINT_32 i, crc32 = 0xFFFFFFFF; - const UINT_32 crc32_ccitt_table[256] = { - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, - 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, - 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, - 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, - 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, - 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, - 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, - 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, - 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, - 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, - 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, - 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, - 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, - 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, - 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, - 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, - 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, - 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, - 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, - 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, - 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, - 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, - 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, - 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, - 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, - 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, - 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, - 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, - 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, - 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, - 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, - 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, - 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, - 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, - 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, - 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, - 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, - 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, - 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, - 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, - 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, - 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, - 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, - 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, - 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, - 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, - 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, - 0x2d02ef8d }; - - for (i = 0; i < len; i++) - crc32 = crc32_ccitt_table[(crc32 ^ buf[i]) & 0xff] ^ (crc32 >> 8); - - return ( ~crc32 ); -} -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to process queued RX packets -* -* @param prAdapter Pointer to the Adapter structure. -* prSwRfbListHead Pointer to head of RX packets link list -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanProcessQueuedSwRfb ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfbListHead - ) -{ - P_SW_RFB_T prSwRfb, prNextSwRfb; - P_TX_CTRL_T prTxCtrl; - P_RX_CTRL_T prRxCtrl; - - ASSERT(prAdapter); - ASSERT(prSwRfbListHead); - - prTxCtrl = &prAdapter->rTxCtrl; - prRxCtrl = &prAdapter->rRxCtrl; - - prSwRfb = prSwRfbListHead; - - do { - // save next first - prNextSwRfb = (P_SW_RFB_T)QUEUE_GET_NEXT_ENTRY((P_QUE_ENTRY_T)prSwRfb); - - switch(prSwRfb->eDst) { - case RX_PKT_DESTINATION_HOST: - nicRxProcessPktWithoutReorder(prAdapter, prSwRfb); - break; - - case RX_PKT_DESTINATION_FORWARD: - nicRxProcessForwardPkt(prAdapter, prSwRfb); - break; - - case RX_PKT_DESTINATION_HOST_WITH_FORWARD: - nicRxProcessGOBroadcastPkt(prAdapter, prSwRfb); - break; - - case RX_PKT_DESTINATION_NULL: - nicRxReturnRFB(prAdapter, prSwRfb); - break; - - default: - break; - } - -#if CFG_HIF_RX_STARVATION_WARNING - prRxCtrl->u4DequeuedCnt++; -#endif - prSwRfb = prNextSwRfb; - } while(prSwRfb); - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to purge queued TX packets -* by indicating failure to OS and returned to free list -* -* @param prAdapter Pointer to the Adapter structure. -* prMsduInfoListHead Pointer to head of TX packets link list -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanProcessQueuedMsduInfo ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfoListHead - ) -{ - ASSERT(prAdapter); - ASSERT(prMsduInfoListHead); - - nicTxFreeMsduInfoPacket(prAdapter, prMsduInfoListHead); - nicTxReturnMsduInfo(prAdapter, prMsduInfoListHead); - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to check if the OID handler needs timeout -* -* @param prAdapter Pointer to the Adapter structure. -* pfnOidHandler Pointer to the OID handler -* -* @return TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wlanoidTimeoutCheck ( - IN P_ADAPTER_T prAdapter, - IN PFN_OID_HANDLER_FUNC pfnOidHandler - ) -{ - PFN_OID_HANDLER_FUNC* apfnOidHandlerWOTimeoutCheck; - UINT_32 i; - UINT_32 u4NumOfElem; - - apfnOidHandlerWOTimeoutCheck = apfnOidWOTimeoutCheck; - u4NumOfElem = sizeof(apfnOidWOTimeoutCheck) / sizeof(PFN_OID_HANDLER_FUNC); - - for (i = 0; i < u4NumOfElem; i++) { - if (apfnOidHandlerWOTimeoutCheck[i] == pfnOidHandler) { - return FALSE; - } - } - - // set timer if need timeout check - //cnmTimerStartTimer(prAdapter, - // &(prAdapter->rOidTimeoutTimer), - // 1000); - cnmTimerStartTimer(prAdapter, - &(prAdapter->rOidTimeoutTimer), - 2000); - - return TRUE; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to clear any pending OID timeout check -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanoidClearTimeoutCheck ( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - cnmTimerStopTimer(prAdapter, &(prAdapter->rOidTimeoutTimer)); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to set up the MCUSYS's OSC stable time -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ - -#if CFG_SUPPORT_OSC_SETTING && defined(MT5931) -WLAN_STATUS -wlanSetMcuOscStableTime ( - IN P_ADAPTER_T prAdapter, - IN UINT_16 u2OscStableTime - ) -{ - UINT_8 ucCmdSeqNum = 0; - P_CMD_INFO_T prCmdInfo = NULL; - P_WIFI_CMD_T prWifiCmd = NULL; - P_CMD_MCU_LP_PARAM_T prMcuSetOscCmd = NULL; - WLAN_STATUS status = WLAN_STATUS_SUCCESS; - - ASSERT(prAdapter); - - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, - CMD_HDR_SIZE + sizeof(CMD_MCU_LP_PARAM_T)); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - - // compose CMD_MCU_LP_PARAM_T cmd pkt - prCmdInfo->eCmdType = COMMAND_TYPE_GENERAL_IOCTL; - prCmdInfo->u2InfoBufLen = CMD_HDR_SIZE + sizeof(CMD_MCU_LP_PARAM_T); - prCmdInfo->pfCmdDoneHandler = NULL; - prCmdInfo->pfCmdTimeoutHandler = NULL; - prCmdInfo->fgIsOid = FALSE; - prCmdInfo->ucCID = CMD_ID_SET_OSC; - prCmdInfo->fgSetQuery = TRUE; - prCmdInfo->fgNeedResp = FALSE; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = sizeof(CMD_MCU_LP_PARAM_T); - - // Setup WIFI_CMD_T - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - // configure CMD_MCU_LP_PARAM_T - prMcuSetOscCmd = (P_CMD_MCU_LP_PARAM_T)(prWifiCmd->aucBuffer); - prMcuSetOscCmd->u2OscStableTime = u2OscStableTime; - - status = wlanSendCommand(prAdapter, prCmdInfo); - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - - return status; -} -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to update network address in firmware domain -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return WLAN_STATUS_FAILURE The request could not be processed -* WLAN_STATUS_PENDING The request has been queued for later processing -* WLAN_STATUS_SUCCESS The request has been processed -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanUpdateNetworkAddress ( - IN P_ADAPTER_T prAdapter - ) -{ - const UINT_8 aucZeroMacAddr[] = NULL_MAC_ADDR; - PARAM_MAC_ADDRESS rMacAddr; - UINT_8 ucCmdSeqNum; - P_CMD_INFO_T prCmdInfo; - P_WIFI_CMD_T prWifiCmd; - P_CMD_BASIC_CONFIG prCmdBasicConfig; - UINT_32 u4SysTime; - - DEBUGFUNC("wlanUpdateNetworkAddress"); - - ASSERT(prAdapter); - - if(kalRetrieveNetworkAddress(prAdapter->prGlueInfo, &rMacAddr) == FALSE - || IS_BMCAST_MAC_ADDR(rMacAddr) - || EQUAL_MAC_ADDR(aucZeroMacAddr, rMacAddr)) { - // eFUSE has a valid address, don't do anything - if(prAdapter->fgIsEmbbededMacAddrValid == TRUE) { -#if CFG_SHOW_MACADDR_SOURCE - DBGLOG(INIT, INFO, ("Using embedded MAC address")); -#endif - return WLAN_STATUS_SUCCESS; - } - else { -#if CFG_SHOW_MACADDR_SOURCE - DBGLOG(INIT, INFO, ("Using dynamically generated MAC address")); -#endif - // dynamic generate - u4SysTime = (UINT_32) kalGetTimeTick(); - - rMacAddr[0] = 0x00; - rMacAddr[1] = 0x08; - rMacAddr[2] = 0x22; - - kalMemCopy(&rMacAddr[3], &u4SysTime, 3); - } - } - else { -#if CFG_SHOW_MACADDR_SOURCE - DBGLOG(INIT, INFO, ("Using host-supplied MAC address")); -#endif - } - - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, - CMD_HDR_SIZE + sizeof(CMD_BASIC_CONFIG)); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - - // compose CMD_BUILD_CONNECTION cmd pkt - prCmdInfo->eCmdType = COMMAND_TYPE_GENERAL_IOCTL; - prCmdInfo->u2InfoBufLen = CMD_HDR_SIZE + sizeof(CMD_BASIC_CONFIG); - prCmdInfo->pfCmdDoneHandler = NULL; - prCmdInfo->pfCmdTimeoutHandler = NULL; - prCmdInfo->fgIsOid = FALSE; - prCmdInfo->ucCID = CMD_ID_BASIC_CONFIG; - prCmdInfo->fgSetQuery = TRUE; - prCmdInfo->fgNeedResp = FALSE; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = sizeof(CMD_BASIC_CONFIG); - - // Setup WIFI_CMD_T - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - // configure CMD_BASIC_CONFIG - prCmdBasicConfig = (P_CMD_BASIC_CONFIG)(prWifiCmd->aucBuffer); - kalMemCopy(&(prCmdBasicConfig->rMyMacAddr), &rMacAddr, PARAM_MAC_ADDR_LEN); - prCmdBasicConfig->ucNative80211 = 0; - prCmdBasicConfig->rCsumOffload.u2RxChecksum = 0; - prCmdBasicConfig->rCsumOffload.u2TxChecksum = 0; - -#if CFG_TCP_IP_CHKSUM_OFFLOAD - if(prAdapter->u4CSUMFlags & CSUM_OFFLOAD_EN_TX_TCP) - prCmdBasicConfig->rCsumOffload.u2TxChecksum |= BIT(2); - - if(prAdapter->u4CSUMFlags & CSUM_OFFLOAD_EN_TX_UDP) - prCmdBasicConfig->rCsumOffload.u2TxChecksum |= BIT(1); - - if(prAdapter->u4CSUMFlags & CSUM_OFFLOAD_EN_TX_IP) - prCmdBasicConfig->rCsumOffload.u2TxChecksum |= BIT(0); - - if(prAdapter->u4CSUMFlags & CSUM_OFFLOAD_EN_RX_TCP) - prCmdBasicConfig->rCsumOffload.u2RxChecksum |= BIT(2); - - if(prAdapter->u4CSUMFlags & CSUM_OFFLOAD_EN_RX_UDP) - prCmdBasicConfig->rCsumOffload.u2RxChecksum |= BIT(1); - - if(prAdapter->u4CSUMFlags & (CSUM_OFFLOAD_EN_RX_IPv4 | CSUM_OFFLOAD_EN_RX_IPv6)) - prCmdBasicConfig->rCsumOffload.u2RxChecksum |= BIT(0); -#endif - - if(wlanSendCommand(prAdapter, prCmdInfo) == WLAN_STATUS_RESOURCES) { - prCmdInfo->pfCmdDoneHandler = nicCmdEventQueryAddress; - kalEnqueueCommand(prAdapter->prGlueInfo, (P_QUE_ENTRY_T)prCmdInfo); - - return WLAN_STATUS_PENDING; - } - else { - nicCmdEventQueryAddress(prAdapter, prCmdInfo, (PUINT_8)prCmdBasicConfig); - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - - return WLAN_STATUS_SUCCESS; - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to check if the device is in RF test mode -* -* @param pfnOidHandler Pointer to the OID handler -* -* @return TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wlanQueryTestMode( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - return prAdapter->fgTestMode; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to identify 802.1x and Bluetooth-over-Wi-Fi -* security frames, and queued into command queue for strict ordering -* due to 802.1x frames before add-key OIDs are not to be encrypted -* -* @param prAdapter Pointer of Adapter Data Structure -* @param prPacket Pointer of native packet -* -* @return TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wlanProcessSecurityFrame( - IN P_ADAPTER_T prAdapter, - IN P_NATIVE_PACKET prPacket - ) -{ - UINT_8 ucPriorityParam; - UINT_8 aucEthDestAddr[PARAM_MAC_ADDR_LEN]; - BOOLEAN fgIs1x = FALSE; - BOOLEAN fgIsPAL = FALSE; - UINT_32 u4PacketLen; - ULONG u4SysTime; - UINT_8 ucNetworkType; - P_CMD_INFO_T prCmdInfo; - - ASSERT(prAdapter); - ASSERT(prPacket); - - if (kalQoSFrameClassifierAndPacketInfo(prAdapter->prGlueInfo, - prPacket, - &ucPriorityParam, - &u4PacketLen, - aucEthDestAddr, - &fgIs1x, - &fgIsPAL, - &ucNetworkType) == TRUE) { - if(fgIs1x == FALSE) { - return FALSE; - } - else { - KAL_SPIN_LOCK_DECLARATION(); - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_RESOURCE); - QUEUE_REMOVE_HEAD(&prAdapter->rFreeCmdList, prCmdInfo, P_CMD_INFO_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_RESOURCE); - - DBGLOG(RSN, INFO, ("T1X len=%d\n", u4PacketLen)); - - if (prCmdInfo) { - P_STA_RECORD_T prStaRec; - // fill arrival time - u4SysTime = (OS_SYSTIME)kalGetTimeTick(); - GLUE_SET_PKT_ARRIVAL_TIME(prPacket, u4SysTime); - - kalMemZero(prCmdInfo, sizeof(CMD_INFO_T)); - - prCmdInfo->eCmdType = COMMAND_TYPE_SECURITY_FRAME; - prCmdInfo->u2InfoBufLen = (UINT_16)u4PacketLen; - prCmdInfo->pucInfoBuffer = NULL; - prCmdInfo->prPacket = prPacket; -#if 0 - prCmdInfo->ucStaRecIndex = qmGetStaRecIdx(prAdapter, - aucEthDestAddr, - (ENUM_NETWORK_TYPE_INDEX_T)ucNetworkType); -#endif - prStaRec = cnmGetStaRecByAddress(prAdapter, - (ENUM_NETWORK_TYPE_INDEX_T)ucNetworkType, - aucEthDestAddr); - if(prStaRec) { - prCmdInfo->ucStaRecIndex = prStaRec->ucIndex; - } - else { - prCmdInfo->ucStaRecIndex = STA_REC_INDEX_NOT_FOUND; - } - - prCmdInfo->eNetworkType = (ENUM_NETWORK_TYPE_INDEX_T)ucNetworkType; - prCmdInfo->pfCmdDoneHandler = wlanSecurityFrameTxDone; - prCmdInfo->pfCmdTimeoutHandler = wlanSecurityFrameTxTimeout; - prCmdInfo->fgIsOid = FALSE; - prCmdInfo->fgSetQuery = TRUE; - prCmdInfo->fgNeedResp = FALSE; - - kalEnqueueCommand(prAdapter->prGlueInfo, (P_QUE_ENTRY_T)prCmdInfo); - - return TRUE; - } - else { - ASSERT(0); - return FALSE; - } - } - } - else { - return FALSE; - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called when 802.1x or Bluetooth-over-Wi-Fi -* security frames has been sent to firmware -* -* @param prAdapter Pointer of Adapter Data Structure -* @param prCmdInfo Pointer of CMD_INFO_T -* @param pucEventBuf meaningless, only for API compatibility -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanSecurityFrameTxDone( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - ASSERT(prAdapter); - ASSERT(prCmdInfo); - if (prCmdInfo->eNetworkType == NETWORK_TYPE_AIS_INDEX && - prAdapter->rWifiVar.rAisSpecificBssInfo.fgCounterMeasure) { - P_STA_RECORD_T prSta = cnmGetStaRecByIndex(prAdapter, prCmdInfo->ucStaRecIndex); - if (prSta) { - kalMsleep(10); - secFsmEventEapolTxDone(prAdapter, prSta, TX_RESULT_SUCCESS); - } - } - - kalSecurityFrameSendComplete(prAdapter->prGlueInfo, - prCmdInfo->prPacket, - WLAN_STATUS_SUCCESS); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called when 802.1x or Bluetooth-over-Wi-Fi -* security frames has failed sending to firmware -* -* @param prAdapter Pointer of Adapter Data Structure -* @param prCmdInfo Pointer of CMD_INFO_T -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanSecurityFrameTxTimeout( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ) -{ - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - kalSecurityFrameSendComplete(prAdapter->prGlueInfo, - prCmdInfo->prPacket, - WLAN_STATUS_FAILURE); -} - -void sortAvgRssi(void); -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called before AIS is starting a new scan -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanClearScanningResult( - IN P_ADAPTER_T prAdapter - ) -{ - BOOLEAN fgKeepCurrOne = FALSE; - UINT_32 i; - - ASSERT(prAdapter); - -#if RSSI_ENHANCE - sortAvgRssi(); -#endif - - // clear scanning result - if(kalGetMediaStateIndicated(prAdapter->prGlueInfo) == PARAM_MEDIA_STATE_CONNECTED) { - for(i = 0 ; i < prAdapter->rWlanInfo.u4ScanResultNum ; i++) { - if(EQUAL_MAC_ADDR(prAdapter->rWlanInfo.rCurrBssId.arMacAddress, - prAdapter->rWlanInfo.arScanResult[i].arMacAddress)) { - fgKeepCurrOne = TRUE; - - if(i != 0) { - // copy structure - kalMemCopy(&(prAdapter->rWlanInfo.arScanResult[0]), - &(prAdapter->rWlanInfo.arScanResult[i]), - OFFSET_OF(PARAM_BSSID_EX_T, aucIEs)); - } - - if(prAdapter->rWlanInfo.arScanResult[i].u4IELength > 0) { - if(prAdapter->rWlanInfo.apucScanResultIEs[i] != &(prAdapter->rWlanInfo.aucScanIEBuf[0])) { - // move IEs to head - kalMemCopy(prAdapter->rWlanInfo.aucScanIEBuf, - prAdapter->rWlanInfo.apucScanResultIEs[i], - prAdapter->rWlanInfo.arScanResult[i].u4IELength); - } - - // modify IE pointer - prAdapter->rWlanInfo.apucScanResultIEs[0] = &(prAdapter->rWlanInfo.aucScanIEBuf[0]); - } - else { - prAdapter->rWlanInfo.apucScanResultIEs[0] = NULL; - } - - break; - } - } - } - - if(fgKeepCurrOne == TRUE) { - prAdapter->rWlanInfo.u4ScanResultNum = 1; - prAdapter->rWlanInfo.u4ScanIEBufferUsage = - ALIGN_4(prAdapter->rWlanInfo.arScanResult[0].u4IELength); - } - else { - prAdapter->rWlanInfo.u4ScanResultNum = 0; - prAdapter->rWlanInfo.u4ScanIEBufferUsage = 0; - } - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called when AIS received a beacon timeout event -* -* @param prAdapter Pointer of Adapter Data Structure -* @param arBSSID MAC address of the specified BSS -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanClearBssInScanningResult( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 arBSSID - ) -{ - UINT_32 i, j, u4IELength = 0, u4IEMoveLength; - PUINT_8 pucIEPtr; - - ASSERT(prAdapter); - - // clear scanning result - i = 0; - while(1) { - if(i >= prAdapter->rWlanInfo.u4ScanResultNum) { - break; - } - - if(EQUAL_MAC_ADDR(arBSSID, prAdapter->rWlanInfo.arScanResult[i].arMacAddress)) { - // backup current IE length - u4IELength = ALIGN_4(prAdapter->rWlanInfo.arScanResult[i].u4IELength); - pucIEPtr = prAdapter->rWlanInfo.apucScanResultIEs[i]; - - // removed from middle - for(j = i + 1 ; j < prAdapter->rWlanInfo.u4ScanResultNum ; j++) { - kalMemCopy(&(prAdapter->rWlanInfo.arScanResult[j-1]), - &(prAdapter->rWlanInfo.arScanResult[j]), - OFFSET_OF(PARAM_BSSID_EX_T, aucIEs)); - - prAdapter->rWlanInfo.apucScanResultIEs[j-1] = - prAdapter->rWlanInfo.apucScanResultIEs[j]; - } - - prAdapter->rWlanInfo.u4ScanResultNum--; - - // remove IE buffer if needed := move rest of IE buffer - if(u4IELength > 0) { - u4IEMoveLength = prAdapter->rWlanInfo.u4ScanIEBufferUsage - - (((UINT_32)pucIEPtr) + u4IELength - ((UINT_32)(&(prAdapter->rWlanInfo.aucScanIEBuf[0])))); - - kalMemCopy(pucIEPtr, - (PUINT_8)(((UINT_32)pucIEPtr) + u4IELength), - u4IEMoveLength); - - prAdapter->rWlanInfo.u4ScanIEBufferUsage -= u4IELength; - - // correction of pointers to IE buffer - for(j = 0 ; j < prAdapter->rWlanInfo.u4ScanResultNum ; j++) { - if(prAdapter->rWlanInfo.apucScanResultIEs[j] > pucIEPtr) { - prAdapter->rWlanInfo.apucScanResultIEs[j] = - (PUINT_8)((UINT_32)(prAdapter->rWlanInfo.apucScanResultIEs[j]) - u4IELength); - } - } - } - } - - i++; - } - - return; -} - - -#if CFG_TEST_WIFI_DIRECT_GO -VOID -wlanEnableP2pFunction ( - IN P_ADAPTER_T prAdapter - ) -{ -#if 0 - P_MSG_P2P_FUNCTION_SWITCH_T prMsgFuncSwitch = (P_MSG_P2P_FUNCTION_SWITCH_T)NULL; - - prMsgFuncSwitch = (P_MSG_P2P_FUNCTION_SWITCH_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_FUNCTION_SWITCH_T)); - if (!prMsgFuncSwitch) { - ASSERT(FALSE); - return; - } - - - prMsgFuncSwitch->rMsgHdr.eMsgId = MID_MNY_P2P_FUN_SWITCH; - prMsgFuncSwitch->fgIsFuncOn = TRUE; - - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prMsgFuncSwitch, - MSG_SEND_METHOD_BUF); -#endif - return; -} - -VOID -wlanEnableATGO ( - IN P_ADAPTER_T prAdapter - ) -{ - - P_MSG_P2P_CONNECTION_REQUEST_T prMsgConnReq = (P_MSG_P2P_CONNECTION_REQUEST_T)NULL; - UINT_8 aucTargetDeviceID[MAC_ADDR_LEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; - - prMsgConnReq = (P_MSG_P2P_CONNECTION_REQUEST_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_CONNECTION_REQUEST_T)); - if (!prMsgConnReq) { - ASSERT(FALSE); - return; - } - - prMsgConnReq->rMsgHdr.eMsgId = MID_MNY_P2P_CONNECTION_REQ; - - /*=====Param Modified for test=====*/ - COPY_MAC_ADDR(prMsgConnReq->aucDeviceID, aucTargetDeviceID); - prMsgConnReq->fgIsTobeGO = TRUE; - prMsgConnReq->fgIsPersistentGroup = FALSE; - - /*=====Param Modified for test=====*/ - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prMsgConnReq, - MSG_SEND_METHOD_BUF); - - return; -} -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to retrieve permanent address from firmware -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return WLAN_STATUS_SUCCESS -* WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanQueryPermanentAddress( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_8 ucCmdSeqNum; - P_CMD_INFO_T prCmdInfo; - P_WIFI_CMD_T prWifiCmd; - UINT_32 u4RxPktLength; - UINT_8 aucBuffer[sizeof(WIFI_EVENT_T) + sizeof(EVENT_BASIC_CONFIG)]; - P_HIF_RX_HEADER_T prHifRxHdr; - P_WIFI_EVENT_T prEvent; - P_EVENT_BASIC_CONFIG prEventBasicConfig; - - ASSERT(prAdapter); - - DEBUGFUNC("wlanQueryPermanentAddress"); - - // 1. Allocate CMD Info Packet and its Buffer - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, CMD_HDR_SIZE + sizeof(CMD_BASIC_CONFIG)); - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - - // compose CMD_BUILD_CONNECTION cmd pkt - prCmdInfo->eCmdType = COMMAND_TYPE_GENERAL_IOCTL; - prCmdInfo->u2InfoBufLen = CMD_HDR_SIZE + sizeof(CMD_BASIC_CONFIG); - prCmdInfo->pfCmdDoneHandler = NULL; - prCmdInfo->fgIsOid = FALSE; - prCmdInfo->ucCID = CMD_ID_BASIC_CONFIG; - prCmdInfo->fgSetQuery = FALSE; - prCmdInfo->fgNeedResp = TRUE; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = sizeof(CMD_BASIC_CONFIG); - - // Setup WIFI_CMD_T - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - wlanSendCommand(prAdapter, prCmdInfo); - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - - if(nicRxWaitResponse(prAdapter, - 1, - aucBuffer, - sizeof(WIFI_EVENT_T) + sizeof(EVENT_BASIC_CONFIG), - &u4RxPktLength) != WLAN_STATUS_SUCCESS) { - return WLAN_STATUS_FAILURE; - } - - // header checking .. - prHifRxHdr = (P_HIF_RX_HEADER_T)aucBuffer; - if(prHifRxHdr->u2PacketType != HIF_RX_PKT_TYPE_EVENT) { - return WLAN_STATUS_FAILURE; - } - - prEvent = (P_WIFI_EVENT_T)aucBuffer; - if(prEvent->ucEID != EVENT_ID_BASIC_CONFIG) { - return WLAN_STATUS_FAILURE; - } - - prEventBasicConfig = (P_EVENT_BASIC_CONFIG)(prEvent->aucBuffer); - - COPY_MAC_ADDR(prAdapter->rWifiVar.aucPermanentAddress, &(prEventBasicConfig->rMyMacAddr)); - COPY_MAC_ADDR(prAdapter->rWifiVar.aucMacAddress, &(prEventBasicConfig->rMyMacAddr)); - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to retrieve NIC capability from firmware -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return WLAN_STATUS_SUCCESS -* WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanQueryNicCapability( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_8 ucCmdSeqNum; - P_CMD_INFO_T prCmdInfo; - P_WIFI_CMD_T prWifiCmd; - UINT_32 u4RxPktLength; - UINT_8 aucBuffer[sizeof(WIFI_EVENT_T) + sizeof(EVENT_NIC_CAPABILITY)]; - P_HIF_RX_HEADER_T prHifRxHdr; - P_WIFI_EVENT_T prEvent; - P_EVENT_NIC_CAPABILITY prEventNicCapability; - - ASSERT(prAdapter); - - DEBUGFUNC("wlanQueryNicCapability"); - - // 1. Allocate CMD Info Packet and its Buffer - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, CMD_HDR_SIZE + sizeof(EVENT_NIC_CAPABILITY)); - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - - // compose CMD_BUILD_CONNECTION cmd pkt - prCmdInfo->eCmdType = COMMAND_TYPE_GENERAL_IOCTL; - prCmdInfo->u2InfoBufLen = CMD_HDR_SIZE + sizeof(EVENT_NIC_CAPABILITY); - prCmdInfo->pfCmdDoneHandler = NULL; - prCmdInfo->fgIsOid = FALSE; - prCmdInfo->ucCID = CMD_ID_GET_NIC_CAPABILITY; - prCmdInfo->fgSetQuery = FALSE; - prCmdInfo->fgNeedResp = TRUE; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = 0; - - // Setup WIFI_CMD_T - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - wlanSendCommand(prAdapter, prCmdInfo); - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - - if(nicRxWaitResponse(prAdapter, - 1, - aucBuffer, - sizeof(WIFI_EVENT_T) + sizeof(EVENT_NIC_CAPABILITY), - &u4RxPktLength) != WLAN_STATUS_SUCCESS) { - return WLAN_STATUS_FAILURE; - } - - // header checking .. - prHifRxHdr = (P_HIF_RX_HEADER_T)aucBuffer; - if(prHifRxHdr->u2PacketType != HIF_RX_PKT_TYPE_EVENT) { - return WLAN_STATUS_FAILURE; - } - - prEvent = (P_WIFI_EVENT_T)aucBuffer; - if(prEvent->ucEID != EVENT_ID_NIC_CAPABILITY) { - return WLAN_STATUS_FAILURE; - } - - prEventNicCapability = (P_EVENT_NIC_CAPABILITY)(prEvent->aucBuffer); - - prAdapter->rVerInfo.u2FwProductID = prEventNicCapability->u2ProductID; - prAdapter->rVerInfo.u2FwOwnVersion = prEventNicCapability->u2FwVersion; - prAdapter->rVerInfo.u2FwPeerVersion = prEventNicCapability->u2DriverVersion; - prAdapter->fgIsHw5GBandDisabled = (BOOLEAN)prEventNicCapability->ucHw5GBandDisabled; - prAdapter->fgIsEepromUsed = (BOOLEAN)prEventNicCapability->ucEepromUsed; - prAdapter->fgIsEfuseValid = (BOOLEAN)prEventNicCapability->ucEfuseValid; - prAdapter->fgIsEmbbededMacAddrValid = (BOOLEAN)prEventNicCapability->ucMacAddrValid; - - -#if CFG_ENABLE_CAL_LOG - DBGLOG(INIT, INFO, (" RF CAL FAIL = (%d),BB CAL FAIL = (%d)\n", - prEventNicCapability->ucRfCalFail ,prEventNicCapability->ucBbCalFail )); -#endif - return WLAN_STATUS_SUCCESS; -} - -#ifdef MT6628 -static INT_32 wlanChangeCodeWord(INT_32 au4Input){ - - UINT_16 i; -#if TXPWR_USE_PDSLOPE - CODE_MAPPING_T arCodeTable[] = { - {0X100, -40}, - {0X104, -35}, - {0X128, -30}, - {0X14C, -25}, - {0X170, -20}, - {0X194, -15}, - {0X1B8, -10}, - {0X1DC, - 5}, - {0 , 0}, - {0X24 , 5}, - {0X48 , 10}, - {0X6C , 15}, - {0X90 , 20}, - {0XB4 , 25}, - {0XD8 , 30}, - {0XFC , 35}, - {0XFF , 40}, - - }; -#else - CODE_MAPPING_T arCodeTable[] = { - {0X100, 0x80}, - {0X104, 0x80}, - {0X128, 0x80}, - {0X14C, 0x80}, - {0X170, 0x80}, - {0X194, 0x94}, - {0X1B8, 0XB8}, - {0X1DC, 0xDC}, - {0 , 0}, - {0X24 , 0x24}, - {0X48 , 0x48}, - {0X6C , 0x6c}, - {0X90 , 0x7F}, - {0XB4 , 0x7F}, - {0XD8 , 0x7F}, - {0XFC , 0x7F}, - {0XFF , 0x7F}, - - }; -#endif - - for (i = 0; i < sizeof(arCodeTable) / sizeof(CODE_MAPPING_T); i++) { - - if (arCodeTable[i].u4RegisterValue == au4Input){ - return arCodeTable[i] .u4TxpowerOffset; - } - } - - - return 0; -} -#endif -#if TXPWR_USE_PDSLOPE - -/*----------------------------------------------------------------------------*/ -/*! -* @brief -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return WLAN_STATUS_SUCCESS -* WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanQueryPdMcr( - IN P_ADAPTER_T prAdapter, - P_PARAM_MCR_RW_STRUC_T prMcrRdInfo - ) -{ - UINT_8 ucCmdSeqNum; - P_CMD_INFO_T prCmdInfo; - P_WIFI_CMD_T prWifiCmd; - UINT_32 u4RxPktLength; - UINT_8 aucBuffer[sizeof(WIFI_EVENT_T) + sizeof(CMD_ACCESS_REG)]; - P_HIF_RX_HEADER_T prHifRxHdr; - P_WIFI_EVENT_T prEvent; - P_CMD_ACCESS_REG prCmdMcrQuery; - ASSERT(prAdapter); - - - // 1. Allocate CMD Info Packet and its Buffer - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, CMD_HDR_SIZE + sizeof(CMD_ACCESS_REG)); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - - // compose CMD_BUILD_CONNECTION cmd pkt - prCmdInfo->eCmdType = COMMAND_TYPE_GENERAL_IOCTL; - prCmdInfo->u2InfoBufLen = (UINT_16)(CMD_HDR_SIZE + sizeof(CMD_ACCESS_REG)); - prCmdInfo->pfCmdDoneHandler = NULL; - prCmdInfo->pfCmdTimeoutHandler = nicOidCmdTimeoutCommon; - prCmdInfo->fgIsOid = FALSE; - prCmdInfo->ucCID = CMD_ID_ACCESS_REG; - prCmdInfo->fgSetQuery = FALSE; - prCmdInfo->fgNeedResp = TRUE; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = sizeof(CMD_ACCESS_REG); - - // Setup WIFI_CMD_T - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - kalMemCopy(prWifiCmd->aucBuffer, prMcrRdInfo, sizeof(CMD_ACCESS_REG)); - - wlanSendCommand(prAdapter, prCmdInfo); - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - - if(nicRxWaitResponse(prAdapter, - 1, - aucBuffer, - sizeof(WIFI_EVENT_T) + sizeof(CMD_ACCESS_REG), - &u4RxPktLength) != WLAN_STATUS_SUCCESS) { - return WLAN_STATUS_FAILURE; - } - - // header checking .. - prHifRxHdr = (P_HIF_RX_HEADER_T)aucBuffer; - if(prHifRxHdr->u2PacketType != HIF_RX_PKT_TYPE_EVENT) { - return WLAN_STATUS_FAILURE; - } - - - prEvent = (P_WIFI_EVENT_T)aucBuffer; - - if(prEvent->ucEID != EVENT_ID_ACCESS_REG) { - return WLAN_STATUS_FAILURE; - } - - prCmdMcrQuery = (P_CMD_ACCESS_REG)(prEvent->aucBuffer); - prMcrRdInfo->u4McrOffset = prCmdMcrQuery->u4Address; - prMcrRdInfo->u4McrData = prCmdMcrQuery->u4Data; - - return WLAN_STATUS_SUCCESS; -} - -static INT_32 wlanIntRound(INT_32 au4Input) -{ - - - if (au4Input >= 0){ - if((au4Input%10) == 5){ - au4Input = au4Input + 5; - return au4Input; - } - } - - if (au4Input < 0){ - if((au4Input%10) == -5){ - au4Input = au4Input - 5; - return au4Input; - } - } - - return au4Input; -} - -static INT_32 wlanCal6628EfuseForm(IN P_ADAPTER_T prAdapter,INT_32 au4Input){ - - PARAM_MCR_RW_STRUC_T rMcrRdInfo; - INT_32 au4PdSlope,au4TxPwrOffset,au4TxPwrOffset_Round; - INT_8 auTxPwrOffset_Round; - - rMcrRdInfo.u4McrOffset = 0x60205c68; - rMcrRdInfo.u4McrData = 0; - au4TxPwrOffset = au4Input; - wlanQueryPdMcr(prAdapter,&rMcrRdInfo); - - au4PdSlope = (rMcrRdInfo.u4McrData) & BITS(0,6); - au4TxPwrOffset_Round = wlanIntRound((au4TxPwrOffset*au4PdSlope))/10; - - au4TxPwrOffset_Round = -au4TxPwrOffset_Round; - - if(au4TxPwrOffset_Round < -128) { - au4TxPwrOffset_Round = 128; - } - else if (au4TxPwrOffset_Round < 0){ - au4TxPwrOffset_Round += 256; - } - else if (au4TxPwrOffset_Round > 127){ - au4TxPwrOffset_Round = 127; - } - - auTxPwrOffset_Round = (UINT8) au4TxPwrOffset_Round ; - - return au4TxPwrOffset_Round; -} - -#endif - -#ifdef MT6628 -static VOID wlanChangeNvram6620to6628(PUINT_8 pucEFUSE){ - - - #define EFUSE_CH_OFFSET1_L_MASK_6620 BITS(0,8) - #define EFUSE_CH_OFFSET1_L_SHIFT_6620 0 - #define EFUSE_CH_OFFSET1_M_MASK_6620 BITS(9,17) - #define EFUSE_CH_OFFSET1_M_SHIFT_6620 9 - #define EFUSE_CH_OFFSET1_H_MASK_6620 BITS(18,26) - #define EFUSE_CH_OFFSET1_H_SHIFT_6620 18 - #define EFUSE_CH_OFFSET1_VLD_MASK_6620 BIT(27) - #define EFUSE_CH_OFFSET1_VLD_SHIFT_6620 27 - - #define EFUSE_CH_OFFSET1_L_MASK_5931 BITS(0,7) - #define EFUSE_CH_OFFSET1_L_SHIFT_5931 0 - #define EFUSE_CH_OFFSET1_M_MASK_5931 BITS(8,15) - #define EFUSE_CH_OFFSET1_M_SHIFT_5931 8 - #define EFUSE_CH_OFFSET1_H_MASK_5931 BITS(16,23) - #define EFUSE_CH_OFFSET1_H_SHIFT_5931 16 - #define EFUSE_CH_OFFSET1_VLD_MASK_5931 BIT(24) - #define EFUSE_CH_OFFSET1_VLD_SHIFT_5931 24 - #define EFUSE_ALL_CH_OFFSET1_MASK_5931 BITS(25,27) - #define EFUSE_ALL_CH_OFFSET1_SHIFT_5931 25 - - - - - INT_32 au4ChOffset; - INT_16 au2ChOffsetL,au2ChOffsetM,au2ChOffsetH; - - - au4ChOffset = *(UINT_32*)(pucEFUSE + 72); - - if((au4ChOffset & EFUSE_CH_OFFSET1_VLD_MASK_6620) && ((*(UINT_32*)(pucEFUSE + 28)) == 0)) { - - - au2ChOffsetL = ((au4ChOffset & EFUSE_CH_OFFSET1_L_MASK_6620) >> - EFUSE_CH_OFFSET1_L_SHIFT_6620); - - au2ChOffsetM = ((au4ChOffset & EFUSE_CH_OFFSET1_M_MASK_6620) >> - EFUSE_CH_OFFSET1_M_SHIFT_6620); - - au2ChOffsetH = ((au4ChOffset & EFUSE_CH_OFFSET1_H_MASK_6620) >> - EFUSE_CH_OFFSET1_H_SHIFT_6620); - - au2ChOffsetL = wlanChangeCodeWord(au2ChOffsetL); - au2ChOffsetM = wlanChangeCodeWord(au2ChOffsetM); - au2ChOffsetH = wlanChangeCodeWord(au2ChOffsetH); - - au4ChOffset = 0; - au4ChOffset |= *(UINT_32*)(pucEFUSE + 72) - >> (EFUSE_CH_OFFSET1_VLD_SHIFT_6620 - EFUSE_CH_OFFSET1_VLD_SHIFT_5931 )& EFUSE_CH_OFFSET1_VLD_MASK_5931 ; - - - - au4ChOffset |= ((((UINT_32)au2ChOffsetL) << EFUSE_CH_OFFSET1_L_SHIFT_5931) & EFUSE_CH_OFFSET1_L_MASK_5931); - au4ChOffset |= ((((UINT_32)au2ChOffsetM) << EFUSE_CH_OFFSET1_M_SHIFT_5931) & EFUSE_CH_OFFSET1_M_MASK_5931); - au4ChOffset |= ((((UINT_32)au2ChOffsetH) << EFUSE_CH_OFFSET1_H_SHIFT_5931) & EFUSE_CH_OFFSET1_H_MASK_5931); - - *((INT_32 *)((pucEFUSE + 28))) = au4ChOffset ; - - - - } - -} -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to load manufacture data from NVRAM -* if available and valid -* -* @param prAdapter Pointer of Adapter Data Structure -* @param prRegInfo Pointer of REG_INFO_T -* -* @return WLAN_STATUS_SUCCESS -* WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanLoadManufactureData ( - IN P_ADAPTER_T prAdapter, - IN P_REG_INFO_T prRegInfo - ) -{ -#if CFG_SUPPORT_RDD_TEST_MODE - CMD_RDD_CH_T rRddParam; -#endif - - ASSERT(prAdapter); - - /* 1. Version Check */ - kalGetConfigurationVersion(prAdapter->prGlueInfo, - &(prAdapter->rVerInfo.u2Part1CfgOwnVersion), - &(prAdapter->rVerInfo.u2Part1CfgPeerVersion), - &(prAdapter->rVerInfo.u2Part2CfgOwnVersion), - &(prAdapter->rVerInfo.u2Part2CfgPeerVersion)); - -#if (CFG_SW_NVRAM_VERSION_CHECK == 1) - if(CFG_DRV_OWN_VERSION < prAdapter->rVerInfo.u2Part1CfgPeerVersion - || CFG_DRV_OWN_VERSION < prAdapter->rVerInfo.u2Part2CfgPeerVersion - || prAdapter->rVerInfo.u2Part1CfgOwnVersion < CFG_DRV_PEER_VERSION - || prAdapter->rVerInfo.u2Part2CfgOwnVersion < CFG_DRV_PEER_VERSION) { - return WLAN_STATUS_FAILURE; - } -#endif - - // MT6620 E1/E2 would be ignored directly - if(prAdapter->rVerInfo.u2Part1CfgOwnVersion == 0x0001) { - prRegInfo->ucTxPwrValid = 1; - } - else { - /* 2. Load TX power gain parameters if valid */ - if(prRegInfo->ucTxPwrValid != 0) { - // send to F/W - nicUpdateTxPower(prAdapter, (P_CMD_TX_PWR_T)(&(prRegInfo->rTxPwr))); - } - } - - /* 3. Check if needs to support 5GHz */ - if(prRegInfo->ucEnable5GBand) { - // check if it is disabled by hardware - if(prAdapter->fgIsHw5GBandDisabled - || prRegInfo->ucSupport5GBand == 0) { - prAdapter->fgEnable5GBand = FALSE; - } - else { - prAdapter->fgEnable5GBand = TRUE; - } - } - else { - prAdapter->fgEnable5GBand = FALSE; - } - - /* 4. Send EFUSE data */ -#if defined(MT6628) - wlanChangeNvram6620to6628(prRegInfo->aucEFUSE); -#endif - - wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_PHY_PARAM, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_PHY_PARAM_T), - (PUINT_8)(prRegInfo->aucEFUSE), - NULL, - 0); - -#if CFG_SUPPORT_RDD_TEST_MODE - rRddParam.ucRddTestMode = (UINT_8) prRegInfo->u4RddTestMode; - rRddParam.ucRddShutCh = (UINT_8) prRegInfo->u4RddShutFreq; - rRddParam.ucRddStartCh = (UINT_8) nicFreq2ChannelNum(prRegInfo->u4RddStartFreq); - rRddParam.ucRddStopCh = (UINT_8) nicFreq2ChannelNum(prRegInfo->u4RddStopFreq); - rRddParam.ucRddDfs = (UINT_8) prRegInfo->u4RddDfs; - prAdapter->ucRddStatus = 0; - nicUpdateRddTestMode(prAdapter, (P_CMD_RDD_CH_T)(&rRddParam)); -#endif - - /* 5. Get 16-bits Country Code and Bandwidth */ - prAdapter->rWifiVar.rConnSettings.u2CountryCode = - (((UINT_16) prRegInfo->au2CountryCode[0]) << 8) | - (((UINT_16) prRegInfo->au2CountryCode[1]) & BITS(0,7)); - -#if 0 /* Bandwidth control will be controlled by GUI. 20110930 - * So ignore the setting from registry/NVRAM - */ - prAdapter->rWifiVar.rConnSettings.uc2G4BandwidthMode = - prRegInfo->uc2G4BwFixed20M ? CONFIG_BW_20M : CONFIG_BW_20_40M; - prAdapter->rWifiVar.rConnSettings.uc5GBandwidthMode = - prRegInfo->uc5GBwFixed20M ? CONFIG_BW_20M : CONFIG_BW_20_40M; -#endif - - /* 6. Set domain and channel information to chip */ - rlmDomainSendCmd(prAdapter, FALSE); - - /* 7. set band edge tx power if available */ - if(prRegInfo->fg2G4BandEdgePwrUsed) { - CMD_EDGE_TXPWR_LIMIT_T rCmdEdgeTxPwrLimit; - - rCmdEdgeTxPwrLimit.cBandEdgeMaxPwrCCK - = prRegInfo->cBandEdgeMaxPwrCCK; - rCmdEdgeTxPwrLimit.cBandEdgeMaxPwrOFDM20 - = prRegInfo->cBandEdgeMaxPwrOFDM20; - rCmdEdgeTxPwrLimit.cBandEdgeMaxPwrOFDM40 - = prRegInfo->cBandEdgeMaxPwrOFDM40; - - wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_EDGE_TXPWR_LIMIT, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_EDGE_TXPWR_LIMIT_T), - (PUINT_8)&rCmdEdgeTxPwrLimit, - NULL, - 0); - } - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to check -* Media Stream Mode is set to non-default value or not, -* and clear to default value if above criteria is met -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return TRUE -* The media stream mode was non-default value and has been reset -* FALSE -* The media stream mode is default value -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wlanResetMediaStreamMode( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - if(prAdapter->rWlanInfo.eLinkAttr.ucMediaStreamMode != 0) { - prAdapter->rWlanInfo.eLinkAttr.ucMediaStreamMode = 0; - - return TRUE; - } - else { - return FALSE; - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to check if any pending timer has expired -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanTimerTimeoutCheck( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - cnmTimerDoTimeOutCheck(prAdapter); - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to check if any pending mailbox message -* to be handled -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanProcessMboxMessage( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_32 i; - - ASSERT(prAdapter); - - for(i = 0 ; i < MBOX_ID_TOTAL_NUM ; i++) { - mboxRcvAllMsg(prAdapter , (ENUM_MBOX_ID_T)i); - } - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to enqueue a single TX packet into CORE -* -* @param prAdapter Pointer of Adapter Data Structure -* prNativePacket Pointer of Native Packet -* -* @return WLAN_STATUS_SUCCESS -* WLAN_STATUS_RESOURCES -* WLAN_STATUS_INVALID_PACKET -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanEnqueueTxPacket ( - IN P_ADAPTER_T prAdapter, - IN P_NATIVE_PACKET prNativePacket - ) -{ - P_TX_CTRL_T prTxCtrl; - P_MSDU_INFO_T prMsduInfo; - - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - - prTxCtrl = &prAdapter->rTxCtrl; - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_MSDU_INFO_LIST); - QUEUE_REMOVE_HEAD(&prTxCtrl->rFreeMsduInfoList, prMsduInfo, P_MSDU_INFO_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_MSDU_INFO_LIST); - - if(prMsduInfo == NULL) { - return WLAN_STATUS_RESOURCES; - } - else { - prMsduInfo->eSrc = TX_PACKET_OS; - - if(nicTxFillMsduInfo(prAdapter, - prMsduInfo, - prNativePacket) == FALSE) { // packet is not extractable - kalSendComplete(prAdapter->prGlueInfo, - prNativePacket, - WLAN_STATUS_INVALID_PACKET); - - nicTxReturnMsduInfo(prAdapter, prMsduInfo); - - return WLAN_STATUS_INVALID_PACKET; - } - else { - // enqueue to QM - nicTxEnqueueMsdu(prAdapter, prMsduInfo); - - return WLAN_STATUS_SUCCESS; - } - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to flush pending TX packets in CORE -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanFlushTxPendingPackets( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - return nicTxFlush(prAdapter); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief this function sends pending MSDU_INFO_T to MT6620 -* -* @param prAdapter Pointer to the Adapter structure. -* @param pfgHwAccess Pointer for tracking LP-OWN status -* -* @retval WLAN_STATUS_SUCCESS Reset is done successfully. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanTxPendingPackets ( - IN P_ADAPTER_T prAdapter, - IN OUT PBOOLEAN pfgHwAccess - ) -{ - P_TX_CTRL_T prTxCtrl; - P_MSDU_INFO_T prMsduInfo; - - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - prTxCtrl = &prAdapter->rTxCtrl; - - ASSERT(pfgHwAccess); - - // <1> dequeue packet by txDequeuTxPackets() - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_QM_TX_QUEUE); - prMsduInfo = qmDequeueTxPackets(prAdapter, &prTxCtrl->rTc); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_QM_TX_QUEUE); - - if(prMsduInfo != NULL) { - if(kalIsCardRemoved(prAdapter->prGlueInfo) == FALSE) { - /* <2> Acquire LP-OWN if necessary */ - if(*pfgHwAccess == FALSE) { - *pfgHwAccess = TRUE; - - wlanAcquirePowerControl(prAdapter); - } - -#if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1) - if(prAdapter->fgIsClockGatingEnabled == TRUE) { - nicDisableClockGating(prAdapter); - } -#endif - // <3> send packets - nicTxMsduInfoList(prAdapter, prMsduInfo); - - // <4> update TC by txAdjustTcQuotas() - nicTxAdjustTcq(prAdapter); - } - else { - wlanProcessQueuedMsduInfo(prAdapter, prMsduInfo); - } - } - -#if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1) - if(prAdapter->fgIsClockGatingEnabled == FALSE) { - nicEnableClockGating(prAdapter); - } -#endif - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to acquire power control from firmware -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanAcquirePowerControl( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - ACQUIRE_POWER_CONTROL_FROM_PM(prAdapter); - - /* Reset sleepy state */ - if(prAdapter->fgWiFiInSleepyState == TRUE) { - prAdapter->fgWiFiInSleepyState = FALSE; - } - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to release power control to firmware -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanReleasePowerControl( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - RECLAIM_POWER_CONTROL_TO_PM(prAdapter, FALSE); - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to report currently pending TX frames count -* (command packets are not included) -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return number of pending TX frames -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -wlanGetTxPendingFrameCount ( - IN P_ADAPTER_T prAdapter - ) -{ - P_TX_CTRL_T prTxCtrl; - UINT_32 u4Num; - - ASSERT(prAdapter); - prTxCtrl = &prAdapter->rTxCtrl; - - u4Num = kalGetTxPendingFrameCount(prAdapter->prGlueInfo) + (UINT_32)(prTxCtrl->i4PendingFwdFrameCount); - - return u4Num; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is to report current ACPI state -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return ACPI_STATE_D0 Normal Operation Mode -* ACPI_STATE_D3 Suspend Mode -*/ -/*----------------------------------------------------------------------------*/ -ENUM_ACPI_STATE_T -wlanGetAcpiState ( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - return prAdapter->rAcpiState; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is to update current ACPI state only -* -* @param prAdapter Pointer of Adapter Data Structure -* @param ePowerState ACPI_STATE_D0 Normal Operation Mode -* ACPI_STATE_D3 Suspend Mode -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanSetAcpiState ( - IN P_ADAPTER_T prAdapter, - IN ENUM_ACPI_STATE_T ePowerState - ) -{ - ASSERT(prAdapter); - ASSERT(ePowerState <= ACPI_STATE_D3); - - prAdapter->rAcpiState = ePowerState; - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is to query ECO version from HIFSYS CR -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return zero Unable to retrieve ECO version information -* non-zero ECO version (1-based) -*/ -/*----------------------------------------------------------------------------*/ -UINT_8 -wlanGetEcoVersion( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - if(nicVerifyChipID(prAdapter) == TRUE) { - return (prAdapter->ucRevID + 1); - } - else { - return 0; - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is to setting the default Tx Power configuration -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return zero Unable to retrieve ECO version information -* non-zero ECO version (1-based) -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanDefTxPowerCfg ( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_8 i; - P_GLUE_INFO_T prGlueInfo = prAdapter->prGlueInfo; - P_SET_TXPWR_CTRL_T prTxpwr; - - ASSERT(prGlueInfo); - - prTxpwr = &prGlueInfo->rTxPwr; - - prTxpwr->c2GLegacyStaPwrOffset = 0; - prTxpwr->c2GHotspotPwrOffset = 0; - prTxpwr->c2GP2pPwrOffset = 0; - prTxpwr->c2GBowPwrOffset = 0; - prTxpwr->c5GLegacyStaPwrOffset = 0; - prTxpwr->c5GHotspotPwrOffset = 0; - prTxpwr->c5GP2pPwrOffset = 0; - prTxpwr->c5GBowPwrOffset = 0; - prTxpwr->ucConcurrencePolicy = 0; - for (i=0; i<3;i++) - prTxpwr->acReserved1[i] = 0; - - for (i=0; i<14;i++) - prTxpwr->acTxPwrLimit2G[i] = 63; - - for (i=0; i<4;i++) - prTxpwr->acTxPwrLimit5G[i] = 63; - - for (i=0; i<2;i++) - prTxpwr->acReserved2[i] = 0; - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is to -* set preferred band configuration corresponding to network type -* -* @param prAdapter Pointer of Adapter Data Structure -* @param eBand Given band -* @param eNetTypeIndex Given Network Type -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanSetPreferBandByNetwork ( - IN P_ADAPTER_T prAdapter, - IN ENUM_BAND_T eBand, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ) -{ - ASSERT(prAdapter); - ASSERT(eBand <= BAND_NUM); - ASSERT(eNetTypeIndex <= NETWORK_TYPE_INDEX_NUM); - - /* 1. set prefer band according to network type */ - prAdapter->aePreferBand[eNetTypeIndex] = eBand; - - /* 2. remove buffered BSS descriptors correspondingly */ - if(eBand == BAND_2G4) { - scanRemoveBssDescByBandAndNetwork(prAdapter, BAND_5G, eNetTypeIndex); - } - else if(eBand == BAND_5G) { - scanRemoveBssDescByBandAndNetwork(prAdapter, BAND_2G4, eNetTypeIndex); - } - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is to -* get channel information corresponding to specified network type -* -* @param prAdapter Pointer of Adapter Data Structure -* @param eNetTypeIndex Given Network Type -* -* @return channel number -*/ -/*----------------------------------------------------------------------------*/ -UINT_8 -wlanGetChannelNumberByNetwork ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ) -{ - P_BSS_INFO_T prBssInfo; - - ASSERT(prAdapter); - ASSERT(eNetTypeIndex <= NETWORK_TYPE_INDEX_NUM); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[eNetTypeIndex]); - - return prBssInfo->ucPrimaryChannel; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is to -* check unconfigured system properties and generate related message on -* scan list to notify users -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanCheckSystemConfiguration ( - IN P_ADAPTER_T prAdapter - ) -{ -#if (CFG_NVRAM_EXISTENCE_CHECK == 1) || (CFG_SW_NVRAM_VERSION_CHECK == 1) - const UINT_8 aucZeroMacAddr[] = NULL_MAC_ADDR; - const UINT_8 aucBCAddr[] = BC_MAC_ADDR; - BOOLEAN fgIsConfExist = TRUE; - BOOLEAN fgGenErrMsg = FALSE; - P_REG_INFO_T prRegInfo = NULL; - P_WLAN_BEACON_FRAME_T prBeacon = NULL; - P_IE_SSID_T prSsid = NULL; - UINT_32 u4ErrCode = 0; - UINT_8 aucErrMsg[32]; - PARAM_SSID_T rSsid; - PARAM_802_11_CONFIG_T rConfiguration; - PARAM_RATES_EX rSupportedRates; -#endif - - DEBUGFUNC("wlanCheckSystemConfiguration"); - - ASSERT(prAdapter); - -#if (CFG_NVRAM_EXISTENCE_CHECK == 1) - if(kalIsConfigurationExist(prAdapter->prGlueInfo) == FALSE) { - fgIsConfExist = FALSE; - fgGenErrMsg = TRUE; - } -#endif - -#if (CFG_SW_NVRAM_VERSION_CHECK == 1) - prRegInfo = kalGetConfiguration(prAdapter->prGlueInfo); - - if(fgIsConfExist == TRUE && - (CFG_DRV_OWN_VERSION < prAdapter->rVerInfo.u2Part1CfgPeerVersion - || CFG_DRV_OWN_VERSION < prAdapter->rVerInfo.u2Part2CfgPeerVersion - || prAdapter->rVerInfo.u2Part1CfgOwnVersion < CFG_DRV_PEER_VERSION - || prAdapter->rVerInfo.u2Part2CfgOwnVersion < CFG_DRV_PEER_VERSION /* NVRAM */ - || CFG_DRV_OWN_VERSION < prAdapter->rVerInfo.u2FwPeerVersion - || prAdapter->rVerInfo.u2FwOwnVersion < CFG_DRV_PEER_VERSION - || (prAdapter->fgIsEmbbededMacAddrValid == FALSE && - (IS_BMCAST_MAC_ADDR(prRegInfo->aucMacAddr) - || EQUAL_MAC_ADDR(aucZeroMacAddr, prRegInfo->aucMacAddr))) - || prRegInfo->ucTxPwrValid == 0)) { - fgGenErrMsg = TRUE; - } -#endif - - if(fgGenErrMsg == TRUE) { - prBeacon = cnmMemAlloc(prAdapter, RAM_TYPE_BUF, sizeof(WLAN_BEACON_FRAME_T) + sizeof(IE_SSID_T)); - - // initialization - kalMemZero(prBeacon, sizeof(WLAN_BEACON_FRAME_T) + sizeof(IE_SSID_T)); - - // prBeacon initialization - prBeacon->u2FrameCtrl = MAC_FRAME_BEACON; - COPY_MAC_ADDR(prBeacon->aucDestAddr, aucBCAddr); - COPY_MAC_ADDR(prBeacon->aucSrcAddr, aucZeroMacAddr); - COPY_MAC_ADDR(prBeacon->aucBSSID, aucZeroMacAddr); - prBeacon->u2BeaconInterval = 100; - prBeacon->u2CapInfo = CAP_INFO_ESS; - - // prSSID initialization - prSsid = (P_IE_SSID_T)(&prBeacon->aucInfoElem[0]); - prSsid->ucId = ELEM_ID_SSID; - - // rConfiguration initialization - rConfiguration.u4Length = sizeof(PARAM_802_11_CONFIG_T); - rConfiguration.u4BeaconPeriod = 100; - rConfiguration.u4ATIMWindow = 1; - rConfiguration.u4DSConfig = 2412; - rConfiguration.rFHConfig.u4Length = sizeof(PARAM_802_11_CONFIG_FH_T); - - // rSupportedRates initialization - kalMemZero(rSupportedRates, sizeof(PARAM_RATES_EX)); - } - -#if (CFG_NVRAM_EXISTENCE_CHECK == 1) - #define NVRAM_ERR_MSG "NVRAM WARNING: Err = 0x01" - if(kalIsConfigurationExist(prAdapter->prGlueInfo) == FALSE) { - COPY_SSID(prSsid->aucSSID, - prSsid->ucLength, - NVRAM_ERR_MSG, - strlen(NVRAM_ERR_MSG)); - - kalIndicateBssInfo(prAdapter->prGlueInfo, - (PUINT_8)prBeacon, - OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem) + OFFSET_OF(IE_SSID_T, aucSSID) + prSsid->ucLength, - 1, - 0); - - COPY_SSID(rSsid.aucSsid, rSsid.u4SsidLen, NVRAM_ERR_MSG, strlen(NVRAM_ERR_MSG)); - nicAddScanResult(prAdapter, - prBeacon->aucBSSID, - &rSsid, - 0, - 0, - PARAM_NETWORK_TYPE_FH, - &rConfiguration, - NET_TYPE_INFRA, - rSupportedRates, - OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem) + OFFSET_OF(IE_SSID_T, aucSSID) + prSsid->ucLength - WLAN_MAC_MGMT_HEADER_LEN, - (PUINT_8)((UINT_32)(prBeacon) + WLAN_MAC_MGMT_HEADER_LEN)); - } -#endif - -#if (CFG_SW_NVRAM_VERSION_CHECK == 1) - #define VER_ERR_MSG "NVRAM WARNING: Err = 0x%02X" - if(fgIsConfExist == TRUE) { - if((CFG_DRV_OWN_VERSION < prAdapter->rVerInfo.u2Part1CfgPeerVersion - || CFG_DRV_OWN_VERSION < prAdapter->rVerInfo.u2Part2CfgPeerVersion - || prAdapter->rVerInfo.u2Part1CfgOwnVersion < CFG_DRV_PEER_VERSION - || prAdapter->rVerInfo.u2Part2CfgOwnVersion < CFG_DRV_PEER_VERSION /* NVRAM */ - || CFG_DRV_OWN_VERSION < prAdapter->rVerInfo.u2FwPeerVersion - || prAdapter->rVerInfo.u2FwOwnVersion < CFG_DRV_PEER_VERSION)) { - u4ErrCode |= NVRAM_ERROR_VERSION_MISMATCH; - } - - - if(prRegInfo->ucTxPwrValid == 0) { - u4ErrCode |= NVRAM_ERROR_INVALID_TXPWR; - } - - if(prAdapter->fgIsEmbbededMacAddrValid == FALSE && - (IS_BMCAST_MAC_ADDR(prRegInfo->aucMacAddr) || EQUAL_MAC_ADDR(aucZeroMacAddr, prRegInfo->aucMacAddr))) { - u4ErrCode |= NVRAM_ERROR_INVALID_MAC_ADDR; - } - - if(u4ErrCode != 0) { - sprintf(aucErrMsg, VER_ERR_MSG, (unsigned int)u4ErrCode); - COPY_SSID(prSsid->aucSSID, - prSsid->ucLength, - aucErrMsg, - strlen(aucErrMsg)); - - kalIndicateBssInfo(prAdapter->prGlueInfo, - (PUINT_8)prBeacon, - OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem) + OFFSET_OF(IE_SSID_T, aucSSID) + prSsid->ucLength, - 1, - 0); - - COPY_SSID(rSsid.aucSsid, rSsid.u4SsidLen, NVRAM_ERR_MSG, strlen(NVRAM_ERR_MSG)); - nicAddScanResult(prAdapter, - prBeacon->aucBSSID, - &rSsid, - 0, - 0, - PARAM_NETWORK_TYPE_FH, - &rConfiguration, - NET_TYPE_INFRA, - rSupportedRates, - OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem) + OFFSET_OF(IE_SSID_T, aucSSID) + prSsid->ucLength - WLAN_MAC_MGMT_HEADER_LEN, - (PUINT_8)((UINT_32)(prBeacon) + WLAN_MAC_MGMT_HEADER_LEN)); - } - } -#endif - - if(fgGenErrMsg == TRUE) { - cnmMemFree(prAdapter, prBeacon); - } - - return WLAN_STATUS_SUCCESS; -} - diff --git a/drivers/net/wireless/mt5931/common/wlan_oid.c b/drivers/net/wireless/mt5931/common/wlan_oid.c deleted file mode 100755 index b0ae362ffc9f..000000000000 --- a/drivers/net/wireless/mt5931/common/wlan_oid.c +++ /dev/null @@ -1,10979 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/common/wlan_oid.c#5 $ -*/ - -/*! \file wlanoid.c - \brief This file contains the WLAN OID processing routines of Windows driver for - MediaTek Inc. 802.11 Wireless LAN Adapters. -*/ - - - -/* -** $Log: wlan_oid.c $ -** -** 07 19 2012 yuche.tsai -** NULL -** Code update for JB. - * - * 07 17 2012 yuche.tsai - * NULL - * Let netdev bring up. - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 01 06 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * using the wlanSendSetQueryCmd to set the tx power control cmd. - * - * 01 06 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * change the set tx power cmd name. - * - * 01 05 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * Adding the related ioctl / wlan oid function to set the Tx power cfg. - * - * 12 20 2011 cp.wu - * [WCXRP00001144] [MT6620 Wi-Fi][Driver][Firmware] Add RF_FUNC_ID for exposing device and related version information - * add driver implementations for RF_AT_FUNCID_FW_INFO & RF_AT_FUNCID_DRV_INFO - * to expose version information - * - * 12 05 2011 cp.wu - * [WCXRP00001131] [MT6620 Wi-Fi][Driver][AIS] Implement connect-by-BSSID path - * add CONNECT_BY_BSSID policy - * - * 11 22 2011 cp.wu - * [WCXRP00001120] [MT6620 Wi-Fi][Driver] Modify roaming to AIS state transition from synchronous to asynchronous approach to avoid incomplete state termination - * 1. change RDD related compile option brace position. - * 2. when roaming is triggered, ask AIS to transit immediately only when AIS is in Normal TR state without join timeout timer ticking - * 3. otherwise, insert AIS_REQUEST into pending request queue - * - * 11 21 2011 cp.wu - * [WCXRP00001118] [MT6620 Wi-Fi][Driver] Corner case protections to pass Monkey testing - * 1. wlanoidQueryBssIdList might be passed with a non-zero length but a NULL pointer of buffer - * add more checking for such cases - * - * 2. kalSendComplete() might be invoked with a packet belongs to P2P network right after P2P is unregistered. - * add some tweaking to protect such cases because that net device has become invalid. - * - * 11 15 2011 cm.chang - * NULL - * Fix compiling warning - * - * 11 11 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * modify the xlog related code. - * - * 11 11 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * add debug counters of bb and ar for xlog. - * - * 11 10 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * change the debug module level. - * - * 11 09 2011 george.huang - * [WCXRP00000871] [MT6620 Wi-Fi][FW] Include additional wakeup condition, which is by consequent DTIM unicast indication - * add XLOG for Set PS mode entry - * - * 11 08 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * check if CFG_SUPPORT_SWCR is defined to aoid compiler error. - * - * 11 07 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * add debug counters and periodically dump counters for debugging. - * - * 11 03 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * change the DBGLOG for "\n" and "\r\n". LABEL to LOUD for XLOG - * - * 11 02 2011 chinghwa.yu - * [WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add RDD certification features. - * - * 10 21 2011 eddie.chen - * [WCXRP00001051] [MT6620 Wi-Fi][Driver/Fw] Adjust the STA aging timeout - * Add switch to ignore the STA aging timeout. - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 09 15 2011 tsaiyuan.hsu - * [WCXRP00000938] [MT6620 Wi-Fi][FW] add system config for CTIA - * correct fifo full control from query to set operation for CTIA. - * - * 08 31 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * . - * - * 08 17 2011 tsaiyuan.hsu - * [WCXRP00000938] [MT6620 Wi-Fi][FW] add system config for CTIA - * add system config for CTIA. - * - * 08 15 2011 george.huang - * [MT6620 Wi-Fi][FW] handle TSF drift for connection detection - * . - * - * 07 28 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings - * Add BWCS cmd and event. - * - * 07 18 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add CMD/Event for RDD and BWCS. - * - * 07 11 2011 wh.su - * [WCXRP00000849] [MT6620 Wi-Fi][Driver] Remove some of the WAPI define for make sure the value is initialize, for customer not enable WAPI - * For make sure wapi initial value is set. - * - * 06 23 2011 cp.wu - * [WCXRP00000812] [MT6620 Wi-Fi][Driver] not show NVRAM when there is no valid MAC address in NVRAM content - * check with firmware for valid MAC address. - * - * 05 02 2011 eddie.chen - * [WCXRP00000373] [MT6620 Wi-Fi][FW] SW debug control - * Fix compile warning. - * - * 04 29 2011 george.huang - * [WCXRP00000684] [MT6620 Wi-Fi][Driver] Support P2P setting ARP filter - * . - * - * 04 27 2011 george.huang - * [WCXRP00000684] [MT6620 Wi-Fi][Driver] Support P2P setting ARP filter - * add more debug message - * - * 04 26 2011 eddie.chen - * [WCXRP00000373] [MT6620 Wi-Fi][FW] SW debug control - * Add rx path profiling. - * - * 04 12 2011 eddie.chen - * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma - * Fix the sta index in processing security frame - * Simple flow control for TC4 to avoid mgt frames for PS STA to occupy the TC4 - * Add debug message. - * - * 04 08 2011 george.huang - * [WCXRP00000621] [MT6620 Wi-Fi][Driver] Support P2P supplicant to set power mode - * separate settings of P2P and AIS - * - * 03 31 2011 puff.wen - * NULL - * . - * - * 03 29 2011 puff.wen - * NULL - * Add chennel switch for stress test - * - * 03 29 2011 cp.wu - * [WCXRP00000604] [MT6620 Wi-Fi][Driver] Surpress Klockwork Warning - * surpress klock warning with code path rewritten - * - * 03 24 2011 wh.su - * [WCXRP00000595] [MT6620 Wi-Fi][Driver] at CTIA indicate disconnect to make the ps profile can apply - * use disconnect event instead of ais abort for CTIA testing. - * - * 03 23 2011 george.huang - * [WCXRP00000586] [MT6620 Wi-Fi][FW] Modify for blocking absence request right after connected - * revise for CTIA power mode setting - * - * 03 22 2011 george.huang - * [WCXRP00000504] [MT6620 Wi-Fi][FW] Support Sigma CAPI for power saving related command - * link with supplicant commands - * - * 03 17 2011 chinglan.wang - * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature - * . - * - * 03 17 2011 yarco.yang - * [WCXRP00000569] [MT6620 Wi-Fi][F/W][Driver] Set multicast address support current network usage - * . - * - * 03 15 2011 george.huang - * [WCXRP00000557] [MT6620 Wi-Fi] Support current consumption test mode commands - * Support current consumption measurement mode command - * - * 03 15 2011 eddie.chen - * [WCXRP00000554] [MT6620 Wi-Fi][DRV] Add sw control debug counter - * Add sw debug counter for QM. - * - * 03 10 2011 cp.wu - * [WCXRP00000532] [MT6620 Wi-Fi][Driver] Migrate NVRAM configuration procedures from MT6620 E2 to MT6620 E3 - * deprecate configuration used by MT6620 E2 - * - * 03 07 2011 terry.wu - * [WCXRP00000521] [MT6620 Wi-Fi][Driver] Remove non-standard debug message - * Toggle non-standard debug messages to comments. - * - * 03 04 2011 cp.wu - * [WCXRP00000515] [MT6620 Wi-Fi][Driver] Surpress compiler warning which is identified by GNU compiler collection - * surpress compile warning occured when compiled by GNU compiler collection. - * - * 03 03 2011 wh.su - * [WCXRP00000510] [MT6620 Wi-Fi] [Driver] Fixed the CTIA enter test mode issue - * fixed the enter ctia test mode issue. - * - * 03 02 2011 george.huang - * [WCXRP00000504] [MT6620 Wi-Fi][FW] Support Sigma CAPI for power saving related command - * Update sigma CAPI for U-APSD setting - * - * 03 02 2011 george.huang - * [WCXRP00000504] [MT6620 Wi-Fi][FW] Support Sigma CAPI for power saving related command - * Support UAPSD/OppPS/NoA parameter setting - * - * 03 02 2011 cp.wu - * [WCXRP00000503] [MT6620 Wi-Fi][Driver] Take RCPI brought by association response as initial RSSI right after connection is built. - * use RCPI brought by ASSOC-RESP after connection is built as initial RCPI to avoid using a uninitialized MAC-RX RCPI. - * - * 01 27 2011 george.huang - * [WCXRP00000400] [MT6620 Wi-Fi] support CTIA power mode setting - * Support CTIA power mode setting. - * - * 01 26 2011 wh.su - * [WCXRP00000396] [MT6620 Wi-Fi][Driver] Support Sw Ctrl ioctl at linux - * adding the SW cmd ioctl support, use set/get structure ioctl. - * - * 01 25 2011 cp.wu - * [WCXRP00000394] [MT6620 Wi-Fi][Driver] Count space needed for generating error message in scanning list into buffer size checking - * when doing size prechecking, check illegal MAC address as well - * - * 01 20 2011 eddie.chen - * [WCXRP00000374] [MT6620 Wi-Fi][DRV] SW debug control - * Add Oid for sw control debug command - * - * 01 15 2011 puff.wen - * NULL - * Add Stress test - * - * 01 12 2011 cp.wu - * [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module - * check if allow to switch to IBSS mode via concurrent module before setting to IBSS mode - * - * 01 12 2011 cm.chang - * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting - * User-defined bandwidth is for 2.4G and 5G individually - * - * 01 04 2011 cp.wu - * [WCXRP00000342] [MT6620 Wi-Fi][Driver] show error code in scanning list when MAC address is not correctly configured in NVRAM - * show error code 0x10 when MAC address in NVRAM is not configured correctly. - * - * 01 04 2011 cp.wu - * [WCXRP00000338] [MT6620 Wi-Fi][Driver] Separate kalMemAlloc into kmalloc and vmalloc implementations to ease physically continous memory demands - * separate kalMemAlloc() into virtually-continous and physically-continous type to ease slab system pressure - * - * 12 28 2010 george.huang - * [WCXRP00000232] [MT5931 Wi-Fi][FW] Modifications for updated HW power on sequence and related design - * support WMM-PS U-APSD AC assignment. - * - * 12 28 2010 cp.wu - * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release - * report EEPROM used flag via NIC_CAPABILITY - * - * 12 28 2010 cp.wu - * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release - * integrate with 'EEPROM used' flag for reporting correct capability to Engineer Mode/META and other tools - * - * 12 16 2010 cp.wu - * [WCXRP00000268] [MT6620 Wi-Fi][Driver] correction for WHQL failed items - * correction for OID_802_11_NETWORK_TYPES_SUPPORTED handlers - * - * 12 13 2010 cp.wu - * [WCXRP00000256] [MT6620 Wi-Fi][Driver] Eliminate potential issues which is identified by Klockwork - * suppress warning reported by Klockwork. - * - * 12 07 2010 cm.chang - * [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk - * 1. BSSINFO include RLM parameter - * 2. free all sta records when network is disconnected - * - * 12 07 2010 cm.chang - * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant - * 1. Country code is from NVRAM or supplicant - * 2. Change band definition in CMD/EVENT. - * - * 11 30 2010 cp.wu - * [WCXRP00000213] [MT6620 Wi-Fi][Driver] Implement scanning with specified SSID for wpa_supplicant with ap_scan=1 - * . - * - * 11 26 2010 cp.wu - * [WCXRP00000209] [MT6620 Wi-Fi][Driver] Modify NVRAM checking mechanism to warning only with necessary data field checking - * 1. NVRAM error is now treated as warning only, thus normal operation is still available but extra scan result used to indicate user is attached - * 2. DPD and TX-PWR are needed fields from now on, if these 2 fields are not availble then warning message is shown - * - * 11 25 2010 cp.wu - * [WCXRP00000208] [MT6620 Wi-Fi][Driver] Add scanning with specified SSID to AIS FSM - * add scanning with specified SSID facility to AIS-FSM - * - * 11 21 2010 wh.su - * [WCXRP00000192] [MT6620 Wi-Fi][Driver] Fixed fail trying to build connection with Security AP while enable WAPI message check - * Not set the wapi mode while the wapi assoc info set non-wapi ie. - * - * 11 05 2010 wh.su - * [WCXRP00000165] [MT6620 Wi-Fi] [Pre-authentication] Assoc req rsn ie use wrong pmkid value - * fixed the.pmkid value mismatch issue - * - * 11 01 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module - * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead - * 2) Remove CNM CH-RECOVER event handling - * 3) cfg read/write API renamed with kal prefix for unified naming rules. - * - * 10 26 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command - * 1) update NVRAM content template to ver 1.02 - * 2) add compile option for querying NIC capability (default: off) - * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting - * 4) correct auto-rate compiler error under linux (treat warning as error) - * 5) simplify usage of NVRAM and REG_INFO_T - * 6) add version checking between driver and firmware - * - * 10 22 2010 cp.wu - * [WCXRP00000122] [MT6620 Wi-Fi][Driver] Preparation for YuSu source tree integration - * dos2unix conversion. - * - * 10 20 2010 cp.wu - * [WCXRP00000117] [MT6620 Wi-Fi][Driver] Add logic for suspending driver when MT6620 is not responding anymore - * use OID_CUSTOM_TEST_MODE as indication for driver reset - * by dropping pending TX packets - * - * 10 18 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android - * complete implementation of Android NVRAM access - * - * 10 06 2010 yuche.tsai - * NULL - * Update SLT 5G Test Channel Set. - * - * 10 06 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * code reorganization to improve isolation between GLUE and CORE layers. - * - * 10 06 2010 yuche.tsai - * NULL - * Update For SLT 5G Test Channel Selection Rule. - * - * 10 05 2010 cp.wu - * [WCXRP00000075] [MT6620 Wi-Fi][Driver] Fill query buffer for OID_802_11_BSSID_LIST in 4-bytes aligned form - * Query buffer size needs to be enlarged due to result is filled in 4-bytes alignment boundary - * - * 10 05 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * 1) add NVRAM access API - * 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option) - * 3) add OID implementation for NVRAM read/write service - * - * 10 04 2010 cp.wu - * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only - * remove ENUM_NETWORK_TYPE_T definitions - * - * 10 04 2010 cp.wu - * [WCXRP00000075] [MT6620 Wi-Fi][Driver] Fill query buffer for OID_802_11_BSSID_LIST in 4-bytes aligned form - * Extend result length to multiples of 4-bytes - * - * 09 24 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * eliminate unused variables which lead gcc to argue - * - * 09 24 2010 cp.wu - * [WCXRP00000057] [MT6620 Wi-Fi][Driver] Modify online scan to a run-time switchable feature - * Modify online scan as a run-time adjustable option (for Windows, in registry) - * - * 09 23 2010 cp.wu - * [WCXRP00000051] [MT6620 Wi-Fi][Driver] WHQL test fail in MAC address changed item - * use firmware reported mac address right after wlanAdapterStart() as permanent address - * - * 09 23 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * add skeleton for NVRAM integration - * - * 09 08 2010 cp.wu - * NULL - * use static memory pool for storing IEs of scanning result. - * - * 09 07 2010 yuche.tsai - * NULL - * Update SLT due to API change of SCAN module. - * - * 09 06 2010 cp.wu - * NULL - * Androi/Linux: return current operating channel information - * - * 09 06 2010 cp.wu - * NULL - * 1) initialize for correct parameter even for disassociation. - * 2) AIS-FSM should have a limit on trials to build connection - * - * 09 03 2010 yuche.tsai - * NULL - * Refine SLT IO control handler. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 09 01 2010 wh.su - * NULL - * adding the wapi support for integration test. - * - * 08 30 2010 chinglan.wang - * NULL - * Modify the rescan condition. - * - * 08 29 2010 yuche.tsai - * NULL - * Finish SLT TX/RX & Rate Changing Support. - * - * 08 27 2010 chinglan.wang - * NULL - * Update configuration for MT6620_E1_PRE_ALPHA_1832_0827_2010 - * - * 08 25 2010 george.huang - * NULL - * update OID/ registry control path for PM related settings - * - * 08 24 2010 cp.wu - * NULL - * 1) initialize variable for enabling short premable/short time slot. - * 2) add compile option for disabling online scan - * - * 08 16 2010 george.huang - * NULL - * . - * - * 08 16 2010 george.huang - * NULL - * upate params defined in CMD_SET_NETWORK_ADDRESS_LIST - * - * 08 04 2010 cp.wu - * NULL - * fix for check build WHQL testing: - * 1) do not assert query buffer if indicated buffer length is zero - * 2) sdio.c has bugs which cause freeing same pointer twice - * - * 08 04 2010 cp.wu - * NULL - * revert changelist #15371, efuse read/write access will be done by RF test approach - * - * 08 04 2010 cp.wu - * NULL - * add OID definitions for EFUSE read/write access. - * - * 08 04 2010 george.huang - * NULL - * handle change PS mode OID/ CMD - * - * 08 04 2010 cp.wu - * NULL - * add an extra parameter to rftestQueryATInfo 'cause it's necessary to pass u4FuncData for query request. - * - * 08 04 2010 cp.wu - * NULL - * bypass u4FuncData for RF-Test query request as well. - * - * 08 04 2010 yarco.yang - * NULL - * Add TX_AMPDU and ADDBA_REJECT command - * - * 08 03 2010 cp.wu - * NULL - * surpress compilation warning. - * - * 08 02 2010 george.huang - * NULL - * add WMM-PS test related OID/ CMD handlers - * - * 07 29 2010 cp.wu - * NULL - * eliminate u4FreqInKHz usage, combined into rConnections.ucAdHoc* - * - * 07 28 2010 cp.wu - * NULL - * 1) eliminate redundant variable eOPMode in prAdapter->rWlanInfo - * 2) change nicMediaStateChange() API prototype - * - * 07 26 2010 cp.wu - * - * re-commit code logic being overwriten. - * - * 07 24 2010 wh.su - * - * .support the Wi-Fi RSN - * - * 07 21 2010 cp.wu - * - * 1) change BG_SCAN to ONLINE_SCAN for consistent term - * 2) only clear scanning result when scan is permitted to do - * - * 07 20 2010 cp.wu - * - * 1) [AIS] when new scan is issued, clear currently available scanning result except the connected one - * 2) refine disconnection behaviour when issued during BG-SCAN process - * - * 07 19 2010 wh.su - * - * modify the auth and encry status variable. - * - * 07 16 2010 cp.wu - * - * remove work-around in case SCN is not available. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 05 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) change fake BSS_DESC from channel 6 to channel 1 due to channel switching is not done yet. - * 2) after MAC address is queried from firmware, all related variables in driver domain should be updated as well - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * AIS-FSM integration with CNM channel request messages - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * implementation of DRV-SCN and related mailbox message handling. - * - * 06 29 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) sync to. CMD/EVENT document v0.03 - * 2) simplify DTIM period parsing in scan.c only, bss.c no longer parses it again. - * 3) send command packet to indicate FW-PM after - * a) 1st beacon is received after AIS has connected to an AP - * b) IBSS-ALONE has been created - * c) IBSS-MERGE has occured - * - * 06 25 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add API in que_mgt to retrieve sta-rec index for security frames. - * - * 06 24 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 802.1x and bluetooth-over-Wi-Fi security frames are now delievered to firmware via command path instead of data path. - * - * 06 23 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) add SCN compilation option. - * 2) when SCN is not turned on, BSSID_SCAN will generate a fake entry for 1st connection - * - * 06 23 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * implement SCAN-REQUEST oid as mailbox message dispatching. - * - * 06 23 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * integrate . - * - * 06 22 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) add command warpper for STA-REC/BSS-INFO sync. - * 2) enhance command packet sending procedure for non-oid part - * 3) add command packet definitions for STA-REC/BSS-INFO sync. - * - * 06 21 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * remove duplicate variable for migration. - * - * 06 21 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * adding the compiling flag for oid pmkid. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * enable RX management frame handling. - * - * 06 18 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * migration the security related function from firmware. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) eliminate CFG_CMD_EVENT_VERSION_0_9 - * 2) when disconnected, indicate nic directly (no event is needed) - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge wlan_def.h. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge wifi_var.h, precomp.h, cnm_timer.h (data type only) - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 06 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * move timer callback to glue layer. - * - * 05 28 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * simplify cmd packet sending for RF test and MCR access OIDs - * - * 05 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * disable radio even when STA is not associated. - * - * 05 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct 2 OID behaviour to meet WHQL requirement. - * - * 05 26 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * 1) Modify set mac address code - * 2) remove power managment macro - * - * 05 25 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct BSSID_LIST oid when radio if turned off. - * - * 05 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) when acquiring LP-own, write for clr-own with lower frequency compared to read poll - * 2) correct address list parsing - * - * 05 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * disable wlanoidSetNetworkAddress() temporally. - * - * 05 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * some OIDs should be DRIVER_CORE instead of GLUE_EXTENSION - * - * 05 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) disable NETWORK_LAYER_ADDRESSES handling temporally. - * 2) finish statistics OIDs - * - * 05 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * change OID behavior to meet WHQL requirement. - * - * 05 20 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) integrate OID_GEN_NETWORK_LAYER_ADDRESSES with CMD_ID_SET_IP_ADDRESS - * 2) buffer statistics data for 2 seconds - * 3) use default value for adhoc parameters instead of 0 - * - * 05 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) do not take timeout mechanism for power mode oids - * 2) retrieve network type from connection status - * 3) after disassciation, set radio state to off - * 4) TCP option over IPv6 is supported - * - * 05 18 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement Wakeup-on-LAN except firmware integration part - * - * 05 17 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct wlanoidSet802dot11PowerSaveProfile implementation. - * - * 05 17 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) enable CMD/EVENT ver 0.9 definition. - * 2) abandon use of ENUM_MEDIA_STATE - * - * 05 17 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct OID_802_11_DISASSOCIATE handling. - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * 1) add timeout handler mechanism for pending command packets - * 2) add p2p add/removal key - * - * 05 14 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * Add dissassocation support for wpa supplicant - * - * 05 14 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct return value. - * - * 05 13 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add NULL OID implementation for WOL-related OIDs. - * - * 05 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * for disassociation, still use parameter with current setting. - * - * 05 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * for disassociation, generate a WZC-compatible invalid SSID. - * - * 05 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * associate to illegal SSID when handling OID_802_11_DISASSOCIATE - * - * 04 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * reserve field of privacy filter and RTS threshold setting. - * - * 04 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * surpress compiler warning - * - * 04 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * . - * - * 04 22 2010 cp.wu - * [WPD00003830]add OID_802_11_PRIVACY_FILTER support - * enable RX filter OID - * - * 04 19 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * Add ioctl of power management - * - * 04 14 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * information buffer for query oid/ioctl is now buffered in prCmdInfo - * * instead of glue-layer variable to improve multiple oid/ioctl capability - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * * 2) command sequence number is now increased atomically - * * * * 3) private data could be hold and taken use for other purpose - * - * 04 12 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct OID_802_11_CONFIGURATION query for infrastructure mode. - * - * 04 09 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * 1) remove unused spin lock declaration - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * finish non-glue layer access to glue variables - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * rWlanInfo should be placed at adapter rather than glue due to most operations - * * are done in adapter layer. - * - * 04 07 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * (1)improve none-glue code portability - * (2) disable set Multicast address during atomic context - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access to prGlueInfo->eParamMediaStateIndicated from non-glue layer - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * ePowerCtrl is not necessary as a glue variable. - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access to prGlueInfo->rWlanInfo.eLinkAttr.ucMediaStreamMode from non-glue layer. - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * improve none-glue code portability - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * code refine: fgTestMode should be at adapter rather than glue due to the device/fw is also involved - * - * 04 01 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * . - * - * 03 31 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * modify the wapi related code for new driver's design. - * - * 03 30 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * statistics information OIDs are now handled by querying from firmware domain - * - * 03 28 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * improve glue code portability - * - * 03 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * indicate media stream mode after set is done - * - * 03 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add a temporary flag for integration with CMD/EVENT v0.9. - * - * 03 25 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) correct OID_802_11_CONFIGURATION with frequency setting behavior. - * the frequency is used for adhoc connection only - * 2) update with SD1 v0.9 CMD/EVENT documentation - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * [WPD00003826] Initial import for Linux port - * initial import for Linux port - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port - * - * 03 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * generate information for OID_GEN_RCV_OK & OID_GEN_XMIT_OK - * - * - * 03 22 2010 cp.wu - * [WPD00003824][MT6620 Wi-Fi][New Feature] Add support of large scan list - * Implement feature needed by CR: WPD00003824: refining association command by pasting scanning result - * - * 03 19 2010 wh.su - * [WPD00003820][MT6620 Wi-Fi] Modify the code for meet the WHQL test - * adding the check for pass WHQL test item. - * - * 03 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) add ACPI D0/D3 state switching support - * * 2) use more formal way to handle interrupt when the status is retrieved from enhanced RX response - * -* 03 16 2010 wh.su - * [WPD00003820][MT6620 Wi-Fi] Modify the code for meet the WHQL test - * fixed some whql pre-test fail case. - * - * 03 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement custom OID: EEPROM read/write access - * - * 03 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement OID_802_3_MULTICAST_LIST oid handling - * - * 03 02 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) the use of prPendingOid revised, all accessing are now protected by spin lock - * * 2) ensure wlanReleasePendingOid will clear all command queues - * - * 02 25 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * send CMD_ID_INFRASTRUCTURE when handling OID_802_11_INFRASTRUCTURE_MODE set. - * - * 02 24 2010 wh.su - * [WPD00003820][MT6620 Wi-Fi] Modify the code for meet the WHQL test - * Don't needed to check the auth mode, WHQL testing not specific at auth wpa2. - * - * 02 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * do not check SSID validity anymore. - * - * 02 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add checksum offloading support. - * - * 02 09 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. Permanent and current MAC address are now retrieved by CMD/EVENT packets instead of hard-coded address - * * 2. follow MSDN defined behavior when associates to another AP - * * 3. for firmware download, packet size could be up to 2048 bytes - * - * 02 09 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * move ucCmdSeqNum as instance variable - * - * 02 04 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * when OID_CUSTOM_OID_INTERFACE_VERSION is queried, do modify connection states - * - * 01 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) implement timeout mechanism when OID is pending for longer than 1 second - * * 2) allow OID_802_11_CONFIGURATION to be executed when RF test mode is turned on - * - * 01 27 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * . - * - * 01 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. eliminate improper variable in rHifInfo - * * 2. block TX/ordinary OID when RF test mode is engaged - * * 3. wait until firmware finish operation when entering into and leaving from RF test mode - * * 4. correct some HAL implementation - * - * 01 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement following 802.11 OIDs: - * OID_802_11_RSSI, - * OID_802_11_RSSI_TRIGGER, - * OID_802_11_STATISTICS, - * OID_802_11_DISASSOCIATE, - * OID_802_11_POWER_MODE - * - * 01 21 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement OID_802_11_MEDIA_STREAM_MODE - * - * 01 21 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement OID_802_11_SUPPORTED_RATES / OID_802_11_DESIRED_RATES - * - * 01 21 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * do not fill ucJoinOnly currently - * - * 01 14 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * enable to connect to ad-hoc network - * - * 01 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * .implement Set/Query BeaconInterval/AtimWindow - * - * 01 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * .Set/Get AT Info is not blocked even when driver is not in fg test mode - * - * 12 30 2009 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) According to CMD/EVENT documentation v0.8, - * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used, - * and result is retrieved by get ATInfo instead - * 2) add 4 counter for recording aggregation statistics - * - * 12 28 2009 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate redundant variables for connection_state -** \main\maintrunk.MT6620WiFiDriver_Prj\32 2009-12-16 22:13:36 GMT mtk02752 -** change hard-coded MAC address to match with FW (temporally) -** \main\maintrunk.MT6620WiFiDriver_Prj\31 2009-12-10 16:49:50 GMT mtk02752 -** code clean -** \main\maintrunk.MT6620WiFiDriver_Prj\30 2009-12-08 17:38:49 GMT mtk02752 -** + add OID for RF test -** * MCR RD/WR are modified to match with cmd/event definition -** \main\maintrunk.MT6620WiFiDriver_Prj\29 2009-12-08 11:32:20 GMT mtk02752 -** add skeleton for RF test implementation -** \main\maintrunk.MT6620WiFiDriver_Prj\28 2009-12-03 16:43:24 GMT mtk01461 -** Modify query SCAN list oid by adding prEventScanResult -** -** \main\maintrunk.MT6620WiFiDriver_Prj\27 2009-12-03 16:39:27 GMT mtk01461 -** Sync CMD data structure in set ssid oid -** \main\maintrunk.MT6620WiFiDriver_Prj\26 2009-12-03 16:28:22 GMT mtk01461 -** Add invalid check of set SSID oid and fix query scan list oid -** \main\maintrunk.MT6620WiFiDriver_Prj\25 2009-11-30 17:33:08 GMT mtk02752 -** implement wlanoidSetInfrastructureMode/wlanoidQueryInfrastructureMode -** \main\maintrunk.MT6620WiFiDriver_Prj\24 2009-11-30 10:53:49 GMT mtk02752 -** 1st DW of WIFI_CMD_T is shared with HIF_TX_HEADER_T -** \main\maintrunk.MT6620WiFiDriver_Prj\23 2009-11-30 09:22:48 GMT mtk02752 -** correct wifi cmd length mismatch -** \main\maintrunk.MT6620WiFiDriver_Prj\22 2009-11-25 21:34:33 GMT mtk02752 -** sync EVENT_SCAN_RESULT_T with firmware -** \main\maintrunk.MT6620WiFiDriver_Prj\21 2009-11-25 21:03:27 GMT mtk02752 -** implement wlanoidQueryBssidList() -** \main\maintrunk.MT6620WiFiDriver_Prj\20 2009-11-25 18:17:17 GMT mtk02752 -** refine GL_WLAN_INFO_T for buffering scan result -** \main\maintrunk.MT6620WiFiDriver_Prj\19 2009-11-23 20:28:51 GMT mtk02752 -** some OID will be set to WLAN_STATUS_PENDING until it is sent via wlanSendCommand() -** \main\maintrunk.MT6620WiFiDriver_Prj\18 2009-11-23 17:56:36 GMT mtk02752 -** implement wlanoidSetBssidListScan(), wlanoidSetBssid() and wlanoidSetSsid() -** -** \main\maintrunk.MT6620WiFiDriver_Prj\17 2009-11-13 17:20:53 GMT mtk02752 -** add Set BSSID/SSID path but disabled temporally due to FW is not ready yet -** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-11-13 12:28:58 GMT mtk02752 -** add wlanoidSetBssidListScan -> cmd_info path -** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-11-09 22:48:07 GMT mtk01084 -** modify test cases entry -** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-11-04 14:10:58 GMT mtk01084 -** add new test interfaces -** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-10-30 18:17:10 GMT mtk01084 -** fix compiler warning -** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-10-29 19:46:26 GMT mtk01084 -** add test functions -** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-10-23 16:07:56 GMT mtk01084 -** include new file -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-10-13 21:58:29 GMT mtk01084 -** modify for new HW architecture -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-10-02 13:48:49 GMT mtk01725 -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-09-09 17:26:04 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-21 12:09:50 GMT mtk01461 -** Update for MCR Write OID -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-21 09:35:18 GMT mtk01461 -** Update wlanoidQueryMcrRead() for composing CMD_INFO_T -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-17 18:09:51 GMT mtk01426 -** Remove kalIndicateStatusAndComplete() in wlanoidQueryOidInterfaceVersion() -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-04-14 15:51:50 GMT mtk01426 -** Add MCR read/write support -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-19 18:32:40 GMT mtk01084 -** update for basic power management functions -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:06:31 GMT mtk01426 -** Init for develop -** -*/ - -/****************************************************************************** -* C O M P I L E R F L A G S -******************************************************************************* -*/ - -/****************************************************************************** -* E X T E R N A L R E F E R E N C E S -******************************************************************************* -*/ -#include "precomp.h" -#include "mgmt/rsn.h" - -#include - -/****************************************************************************** -* C O N S T A N T S -******************************************************************************* -*/ -#define NVRAM_ERROR_VERSION_MISMATCH BIT(1) -#define NVRAM_ERROR_INVALID_TXPWR BIT(2) -#define NVRAM_ERROR_INVALID_DPD BIT(3) -#define NVRAM_ERROR_INVALID_MAC_ADDR BIT(4) - -/****************************************************************************** -* D A T A T Y P E S -******************************************************************************* -*/ - -/****************************************************************************** -* P U B L I C D A T A -******************************************************************************* -*/ -#if DBG -extern UINT_8 aucDebugModule[DBG_MODULE_NUM]; -extern UINT_32 u4DebugModule; -UINT_32 u4DebugModuleTemp; -#endif /* DBG */ - -#if RSSI_ENHANCE -int numOfTblRssi; -TABLE_RSSI mTABLE_RSSI[MAX_SCAN_RSSI_NUM]; -int mTblRssiStatus[MAX_SCAN_RSSI_NUM]; - -void initScanRssiHistory(void) -{ - int i; - numOfTblRssi = 0; - memset(mTABLE_RSSI, 0, MAX_SCAN_RSSI_NUM*sizeof(TABLE_RSSI)); - for(i = 0; i < MAX_SCAN_RSSI_NUM; i++) { - mTblRssiStatus[i] = 0; - } -} -#endif - -/****************************************************************************** -* P R I V A T E D A T A -******************************************************************************* -*/ - -/****************************************************************************** -* M A C R O S -******************************************************************************* -*/ - -/****************************************************************************** -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************* -*/ -extern int sprintf(char * buf, const char * fmt, ...); - -/****************************************************************************** -* F U N C T I O N S -******************************************************************************* -*/ -#if CFG_ENABLE_STATISTICS_BUFFERING -static BOOLEAN -IsBufferedStatisticsUsable( - P_ADAPTER_T prAdapter) -{ - ASSERT(prAdapter); - - if(prAdapter->fgIsStatValid == TRUE && - (kalGetTimeTick() - prAdapter->rStatUpdateTime) <= CFG_STATISTICS_VALID_CYCLE) - return TRUE; - else - return FALSE; -} -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the supported physical layer network -* type that can be used by the driver. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryNetworkTypesSupported ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - UINT_32 u4NumItem = 0; - ENUM_PARAM_NETWORK_TYPE_T eSupportedNetworks[PARAM_NETWORK_TYPE_NUM]; - PPARAM_NETWORK_TYPE_LIST prSupported; - - /* The array of all physical layer network subtypes that the driver supports. */ - - DEBUGFUNC("wlanoidQueryNetworkTypesSupported"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - /* Init. */ - for (u4NumItem = 0; u4NumItem < PARAM_NETWORK_TYPE_NUM ; u4NumItem++) { - eSupportedNetworks[u4NumItem] = 0; - } - - u4NumItem = 0; - - eSupportedNetworks[u4NumItem] = PARAM_NETWORK_TYPE_DS; - u4NumItem ++; - - eSupportedNetworks[u4NumItem] = PARAM_NETWORK_TYPE_OFDM24; - u4NumItem ++; - - *pu4QueryInfoLen = - (UINT_32)OFFSET_OF(PARAM_NETWORK_TYPE_LIST, eNetworkType) + - (u4NumItem * sizeof(ENUM_PARAM_NETWORK_TYPE_T)); - - if (u4QueryBufferLen < *pu4QueryInfoLen) { - return WLAN_STATUS_INVALID_LENGTH; - } - - prSupported = (PPARAM_NETWORK_TYPE_LIST)pvQueryBuffer; - prSupported->NumberOfItems = u4NumItem; - kalMemCopy(prSupported->eNetworkType, - eSupportedNetworks, - u4NumItem * sizeof(ENUM_PARAM_NETWORK_TYPE_T)); - - DBGLOG(REQ, TRACE, ("NDIS supported network type list: %ld\n", - prSupported->NumberOfItems)); - DBGLOG_MEM8(REQ, INFO, prSupported, *pu4QueryInfoLen); - - return WLAN_STATUS_SUCCESS; -} /* wlanoidQueryNetworkTypesSupported */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the current physical layer network -* type used by the driver. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the -* call failed due to invalid length of the query -* buffer, returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryNetworkTypeInUse ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - // TODO: need to check the OID handler content again!! - - ENUM_PARAM_NETWORK_TYPE_T rCurrentNetworkTypeInUse = PARAM_NETWORK_TYPE_OFDM24; - - DEBUGFUNC("wlanoidQueryNetworkTypeInUse"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - if (u4QueryBufferLen < sizeof(ENUM_PARAM_NETWORK_TYPE_T)) { - *pu4QueryInfoLen = sizeof(ENUM_PARAM_NETWORK_TYPE_T); - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - - if (kalGetMediaStateIndicated(prAdapter->prGlueInfo) == PARAM_MEDIA_STATE_CONNECTED) { - rCurrentNetworkTypeInUse = - (ENUM_PARAM_NETWORK_TYPE_T)(prAdapter->rWlanInfo.ucNetworkType); - } - else { - rCurrentNetworkTypeInUse = - (ENUM_PARAM_NETWORK_TYPE_T)(prAdapter->rWlanInfo.ucNetworkTypeInUse); - } - - *(P_ENUM_PARAM_NETWORK_TYPE_T)pvQueryBuffer = rCurrentNetworkTypeInUse; - *pu4QueryInfoLen = sizeof(ENUM_PARAM_NETWORK_TYPE_T); - - DBGLOG(REQ, TRACE, ("Network type in use: %d\n", rCurrentNetworkTypeInUse)); - - return WLAN_STATUS_SUCCESS; -} /* wlanoidQueryNetworkTypeInUse */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set the physical layer network type used -* by the driver. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns the -* amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS The given network type is supported and accepted. -* \retval WLAN_STATUS_INVALID_DATA The given network type is not in the -* supported list. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetNetworkTypeInUse ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - // TODO: need to check the OID handler content again!! - - ENUM_PARAM_NETWORK_TYPE_T eNewNetworkType; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - DEBUGFUNC("wlanoidSetNetworkTypeInUse"); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - if (u4SetBufferLen < sizeof(ENUM_PARAM_NETWORK_TYPE_T)) { - *pu4SetInfoLen = sizeof(ENUM_PARAM_NETWORK_TYPE_T); - return WLAN_STATUS_INVALID_LENGTH; - } - - eNewNetworkType = *(P_ENUM_PARAM_NETWORK_TYPE_T)pvSetBuffer; - *pu4SetInfoLen = sizeof(ENUM_PARAM_NETWORK_TYPE_T); - - DBGLOG(REQ, - INFO, - ("New network type: %d mode\n", eNewNetworkType)); - - switch (eNewNetworkType) { - - case PARAM_NETWORK_TYPE_DS: - prAdapter->rWlanInfo.ucNetworkTypeInUse = (UINT_8) PARAM_NETWORK_TYPE_DS; - break; - - case PARAM_NETWORK_TYPE_OFDM5: - prAdapter->rWlanInfo.ucNetworkTypeInUse = (UINT_8) PARAM_NETWORK_TYPE_OFDM5; - break; - - case PARAM_NETWORK_TYPE_OFDM24: - prAdapter->rWlanInfo.ucNetworkTypeInUse = (UINT_8) PARAM_NETWORK_TYPE_OFDM24; - break; - - case PARAM_NETWORK_TYPE_AUTOMODE: - prAdapter->rWlanInfo.ucNetworkTypeInUse = (UINT_8) PARAM_NETWORK_TYPE_AUTOMODE; - break; - - case PARAM_NETWORK_TYPE_FH: - DBGLOG(REQ, INFO, ("Not support network type: %d\n", eNewNetworkType)); - rStatus = WLAN_STATUS_NOT_SUPPORTED; - break; - - default: - DBGLOG(REQ, INFO, ("Unknown network type: %d\n", eNewNetworkType)); - rStatus = WLAN_STATUS_INVALID_DATA; - break; - } - - /* Verify if we support the new network type. */ - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(REQ, WARN, ("Unknown network type: %d\n", eNewNetworkType)); - } - - return rStatus; -} /* wlanoidSetNetworkTypeInUse */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the current BSSID. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryBssid ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - - DEBUGFUNC("wlanoidQueryBssid"); - - ASSERT(prAdapter); - - if (u4QueryBufferLen < MAC_ADDR_LEN) { - ASSERT(pu4QueryInfoLen); - *pu4QueryInfoLen = MAC_ADDR_LEN; - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - ASSERT(u4QueryBufferLen >= MAC_ADDR_LEN); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - if(kalGetMediaStateIndicated(prAdapter->prGlueInfo) == PARAM_MEDIA_STATE_CONNECTED) { - kalMemCopy(pvQueryBuffer, prAdapter->rWlanInfo.rCurrBssId.arMacAddress, MAC_ADDR_LEN); - } - else if(prAdapter->rWifiVar.rConnSettings.eOPMode == NET_TYPE_IBSS) { - PARAM_MAC_ADDRESS aucTemp; /*!< BSSID */ - COPY_MAC_ADDR(aucTemp, prAdapter->rWlanInfo.rCurrBssId.arMacAddress); - aucTemp[0] &= ~BIT(0); - aucTemp[1] |= BIT(1); - COPY_MAC_ADDR(pvQueryBuffer, aucTemp); - } - else { - rStatus = WLAN_STATUS_ADAPTER_NOT_READY; - } - - *pu4QueryInfoLen = MAC_ADDR_LEN; - return rStatus; -} /* wlanoidQueryBssid */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the list of all BSSIDs detected by -* the driver. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryBssidList ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ -#if (CFG_NVRAM_EXISTENCE_CHECK == 1) || (CFG_SW_NVRAM_VERSION_CHECK == 1) - const UINT_8 aucZeroMacAddr[] = NULL_MAC_ADDR; - BOOLEAN fgIsConfExist = TRUE; - P_REG_INFO_T prRegInfo; -#endif - - P_GLUE_INFO_T prGlueInfo; - UINT_32 i,j, u4BssidListExLen; - P_PARAM_BSSID_LIST_EX_T prList; - P_PARAM_BSSID_EX_T prBssidEx; - PUINT_8 cp; - BOOLEAN bInitial = TRUE; - - DEBUGFUNC("wlanoidQueryBssidList"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - - if(!pvQueryBuffer) { - return WLAN_STATUS_INVALID_DATA; - } - } - - prGlueInfo = prAdapter->prGlueInfo; - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in qeury BSSID list! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - u4BssidListExLen = 0; - - if(prAdapter->fgIsRadioOff == FALSE) { - for(i = 0 ; i < prAdapter->rWlanInfo.u4ScanResultNum ; i++) { - u4BssidListExLen += ALIGN_4(prAdapter->rWlanInfo.arScanResult[i].u4Length); - } - } - -#if (CFG_NVRAM_EXISTENCE_CHECK == 1) - if(kalIsConfigurationExist(prAdapter->prGlueInfo) == FALSE) { - fgIsConfExist = FALSE; - u4BssidListExLen += OFFSET_OF(PARAM_BSSID_EX_T, aucIEs); - } -#endif - -#if (CFG_SW_NVRAM_VERSION_CHECK == 1) - prRegInfo = kalGetConfiguration(prGlueInfo); - - if(fgIsConfExist == TRUE && - (CFG_DRV_OWN_VERSION < prAdapter->rVerInfo.u2Part1CfgPeerVersion - || CFG_DRV_OWN_VERSION < prAdapter->rVerInfo.u2Part2CfgPeerVersion - || prAdapter->rVerInfo.u2Part1CfgOwnVersion < CFG_DRV_PEER_VERSION - || prAdapter->rVerInfo.u2Part2CfgOwnVersion < CFG_DRV_PEER_VERSION /* NVRAM */ - || CFG_DRV_OWN_VERSION < prAdapter->rVerInfo.u2FwPeerVersion - || prAdapter->rVerInfo.u2FwOwnVersion < CFG_DRV_PEER_VERSION - || (prAdapter->fgIsEmbbededMacAddrValid == FALSE && - (IS_BMCAST_MAC_ADDR(prRegInfo->aucMacAddr) - || EQUAL_MAC_ADDR(aucZeroMacAddr, prRegInfo->aucMacAddr))) - || prRegInfo->ucTxPwrValid == 0)) { - u4BssidListExLen += OFFSET_OF(PARAM_BSSID_EX_T, aucIEs); - } -#endif - - if(u4BssidListExLen) { - u4BssidListExLen += 4; // u4NumberOfItems. - } - else { - u4BssidListExLen = sizeof(PARAM_BSSID_LIST_EX_T); - } - - *pu4QueryInfoLen = u4BssidListExLen; - - if (u4QueryBufferLen < *pu4QueryInfoLen) { - return WLAN_STATUS_INVALID_LENGTH; - } - - /* Clear the buffer */ - kalMemZero(pvQueryBuffer, u4BssidListExLen); - - prList = (P_PARAM_BSSID_LIST_EX_T) pvQueryBuffer; - cp = (PUINT_8)&prList->arBssid[0]; - - - if(prAdapter->fgIsRadioOff == FALSE && prAdapter->rWlanInfo.u4ScanResultNum > 0) { - // fill up for each entry - for(i = 0 ; i < prAdapter->rWlanInfo.u4ScanResultNum ; i++) { - prBssidEx = (P_PARAM_BSSID_EX_T)cp; - - // copy structure - kalMemCopy(prBssidEx, - &(prAdapter->rWlanInfo.arScanResult[i]), - OFFSET_OF(PARAM_BSSID_EX_T, aucIEs)); - -#if RSSI_ENHANCE - bInitial = TRUE; - -// printk(KERN_INFO "%s::first prAdapter->rWlanInfo.arScanResult[i].AvgRssiX8 = %d, prBssidEx->rRssi= %d\n", __func__, prAdapter->rWlanInfo.arScanResult[i].AvgRssiX8, prBssidEx->rRssi); - for(j=0;jrWlanInfo.u4ScanResultNum;j++) - { - if(EQUAL_MAC_ADDR(&(prAdapter->rWlanInfo.arScanResult[i].arMacAddress), mTABLE_RSSI[j].arMacAddress)) - { - bInitial = FALSE; - prBssidEx->AvgRssiX8 = mTABLE_RSSI[j].AvgRssiX8; - prBssidEx->AvgRssi = mTABLE_RSSI[j].AvgRssi; - break; - } - } - - if (bInitial) - { - prBssidEx->AvgRssiX8 = prBssidEx->rRssi << 3; - prBssidEx->AvgRssi = prBssidEx->rRssi; - //printk(KERN_INFO "%s:: bInitial --- prBssidEx->AvgRssiX8 = %d, prBssidEx->AvgRssi = %d, prBssidEx->rRssi= %d\n", __func__, prBssidEx->AvgRssiX8, prBssidEx->AvgRssi, prBssidEx->rRssi); - } else { - prBssidEx->AvgRssiX8 = (prBssidEx->AvgRssiX8 - prBssidEx->AvgRssi) + prBssidEx->rRssi; - //printk(KERN_INFO "%s:: prBssidEx->AvgRssiX8 = %d, prBssidEx->AvgRssi = %d, prBssidEx->rRssi= %d\n", __func__, prBssidEx->AvgRssiX8, prBssidEx->AvgRssi, prBssidEx->rRssi); - } - - prBssidEx->AvgRssi = prBssidEx->AvgRssiX8 >> 3; - //prBssidEx->AvgRssi +=8; - prBssidEx->rRssi = prBssidEx->AvgRssi + 10; - prAdapter->rWlanInfo.arScanResult[i].rRssi = prBssidEx->AvgRssi; -#endif - /*For WHQL test, Rssi should be in range -10 ~ -200 dBm*/ - if(prBssidEx->rRssi > PARAM_WHQL_RSSI_MAX_DBM) { - prBssidEx->rRssi = PARAM_WHQL_RSSI_MAX_DBM; - } - - if(prAdapter->rWlanInfo.arScanResult[i].u4IELength > 0) { - // copy IEs - kalMemCopy(prBssidEx->aucIEs, - prAdapter->rWlanInfo.apucScanResultIEs[i], - prAdapter->rWlanInfo.arScanResult[i].u4IELength); - } - - // 4-bytes alignement - prBssidEx->u4Length = ALIGN_4(prBssidEx->u4Length); - - cp += prBssidEx->u4Length; - prList->u4NumberOfItems++; - } -#if RSSI_ENHANCE - for(i = 0 ; i < prAdapter->rWlanInfo.u4ScanResultNum ; i++) - { - COPY_MAC_ADDR(mTABLE_RSSI[i].arMacAddress,prAdapter->rWlanInfo.arScanResult[i].arMacAddress); - mTABLE_RSSI[i].AvgRssi = prAdapter->rWlanInfo.arScanResult[i].rRssi; - mTABLE_RSSI[i].AvgRssiX8= prAdapter->rWlanInfo.arScanResult[i].rRssi << 3; - } - for(i = prAdapter->rWlanInfo.u4ScanResultNum ; i < MAX_SCAN_RSSI_NUM ; i++) - { - mTABLE_RSSI[i].arMacAddress[0]=0; - mTABLE_RSSI[i].arMacAddress[1]=0; - mTABLE_RSSI[i].arMacAddress[2]=0; - mTABLE_RSSI[i].arMacAddress[3]=0; - mTABLE_RSSI[i].arMacAddress[4]=0; - mTABLE_RSSI[i].arMacAddress[5]=0; - } -#endif - } - -#if (CFG_NVRAM_EXISTENCE_CHECK == 1) - #define NVRAM_ERR_MSG "NVRAM WARNING: Err = 0x01" - if(kalIsConfigurationExist(prAdapter->prGlueInfo) == FALSE) { - prBssidEx = (P_PARAM_BSSID_EX_T)cp; - - /* generate fake result as error message */ - i = prAdapter->rWlanInfo.u4ScanResultNum; - - // zero - kalMemZero(prBssidEx, OFFSET_OF(PARAM_BSSID_EX_T, aucIEs)); - - // then fill buffer - COPY_MAC_ADDR(prBssidEx->arMacAddress, aucZeroMacAddr); - COPY_SSID(prBssidEx->rSsid.aucSsid, - prBssidEx->rSsid.u4SsidLen, - NVRAM_ERR_MSG, - strlen(NVRAM_ERR_MSG)); - prBssidEx->u4Privacy = 0; - prBssidEx->rRssi = 0; - prBssidEx->eNetworkTypeInUse = PARAM_NETWORK_TYPE_FH; - prBssidEx->rConfiguration.u4Length = sizeof(PARAM_802_11_CONFIG_T); - prBssidEx->rConfiguration.u4BeaconPeriod = 100; - prBssidEx->rConfiguration.u4ATIMWindow = 1; - prBssidEx->rConfiguration.u4DSConfig = 2412000; - prBssidEx->rConfiguration.rFHConfig.u4Length = sizeof(PARAM_802_11_CONFIG_FH_T); - prBssidEx->eOpMode = BSS_TYPE_INFRASTRUCTURE; - prBssidEx->u4IELength = 0; - - /* move to next entry */ - prBssidEx->u4Length = OFFSET_OF(PARAM_BSSID_EX_T, aucIEs); - cp += prBssidEx->u4Length; - prList->u4NumberOfItems++; - } -#endif - -#if (CFG_SW_NVRAM_VERSION_CHECK == 1) - #define VER_ERR_MSG "NVRAM WARNING: Err = 0x%02X" - if(fgIsConfExist == TRUE) { - UINT_32 u4ErrCode = 0; - - if((CFG_DRV_OWN_VERSION < prAdapter->rVerInfo.u2Part1CfgPeerVersion - || CFG_DRV_OWN_VERSION < prAdapter->rVerInfo.u2Part2CfgPeerVersion - || prAdapter->rVerInfo.u2Part1CfgOwnVersion < CFG_DRV_PEER_VERSION - || prAdapter->rVerInfo.u2Part2CfgOwnVersion < CFG_DRV_PEER_VERSION /* NVRAM */ - || CFG_DRV_OWN_VERSION < prAdapter->rVerInfo.u2FwPeerVersion - || prAdapter->rVerInfo.u2FwOwnVersion < CFG_DRV_PEER_VERSION)) { - u4ErrCode |= NVRAM_ERROR_VERSION_MISMATCH; - } - - - if(prRegInfo->ucTxPwrValid == 0) { - u4ErrCode |= NVRAM_ERROR_INVALID_TXPWR; - } - - if(prAdapter->fgIsEmbbededMacAddrValid == FALSE && - (IS_BMCAST_MAC_ADDR(prRegInfo->aucMacAddr) || EQUAL_MAC_ADDR(aucZeroMacAddr, prRegInfo->aucMacAddr))) { - u4ErrCode |= NVRAM_ERROR_INVALID_MAC_ADDR; - } - - if(u4ErrCode != 0) { - UINT_8 aucErrMsg[32]; - prBssidEx = (P_PARAM_BSSID_EX_T)cp; - - // zero - kalMemZero(prBssidEx, OFFSET_OF(PARAM_BSSID_EX_T, aucIEs)); - - // then fill buffer - COPY_MAC_ADDR(prBssidEx->arMacAddress, aucZeroMacAddr); - - sprintf(aucErrMsg, VER_ERR_MSG, (unsigned int)u4ErrCode); - COPY_SSID(prBssidEx->rSsid.aucSsid, - prBssidEx->rSsid.u4SsidLen, - aucErrMsg, - strlen(aucErrMsg)); - - prBssidEx->u4Privacy = 0; - prBssidEx->rRssi = 0; - prBssidEx->eNetworkTypeInUse = PARAM_NETWORK_TYPE_FH; - prBssidEx->rConfiguration.u4Length = sizeof(PARAM_802_11_CONFIG_T); - prBssidEx->rConfiguration.u4BeaconPeriod = 100; - prBssidEx->rConfiguration.u4ATIMWindow = 1; - prBssidEx->rConfiguration.u4DSConfig = 2412000; - prBssidEx->rConfiguration.rFHConfig.u4Length = sizeof(PARAM_802_11_CONFIG_FH_T); - prBssidEx->eOpMode = BSS_TYPE_INFRASTRUCTURE; - prBssidEx->u4IELength = 0; - - /* move to next entry */ - prBssidEx->u4Length = OFFSET_OF(PARAM_BSSID_EX_T, aucIEs); - cp += prBssidEx->u4Length; - prList->u4NumberOfItems++; - } - } -#endif - - return WLAN_STATUS_SUCCESS; -} /* wlanoidQueryBssidList */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to request the driver to perform -* scanning. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetBssidListScan ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_SSID_T prSsid; - PARAM_SSID_T rSsid; - - DEBUGFUNC("wlanoidSetBssidListScan()"); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set BSSID list scan! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - ASSERT(pu4SetInfoLen); - *pu4SetInfoLen = 0; - - if (prAdapter->fgIsRadioOff) { - DBGLOG(REQ, WARN, ("Return from BSSID list scan! (radio off). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_SUCCESS; - } - - if(pvSetBuffer != NULL && u4SetBufferLen != 0) { - COPY_SSID(rSsid.aucSsid, - rSsid.u4SsidLen, - pvSetBuffer, - u4SetBufferLen); - prSsid = &rSsid; - } - else { - prSsid = NULL; - } - -#if CFG_SUPPORT_RDD_TEST_MODE - if (prAdapter->prGlueInfo->rRegInfo.u4RddTestMode) { - if((prAdapter->fgEnOnlineScan == TRUE) && (prAdapter->ucRddStatus)){ - if (kalGetMediaStateIndicated(prAdapter->prGlueInfo) != PARAM_MEDIA_STATE_CONNECTED){ - aisFsmScanRequest(prAdapter, prSsid, NULL, 0); - } - } - } - else -#endif - { - if(prAdapter->fgEnOnlineScan == TRUE) { - aisFsmScanRequest(prAdapter, prSsid, NULL, 0); - } - else if(kalGetMediaStateIndicated(prAdapter->prGlueInfo) != PARAM_MEDIA_STATE_CONNECTED) { - aisFsmScanRequest(prAdapter, prSsid, NULL, 0); - } - } - - return WLAN_STATUS_SUCCESS; -} /* wlanoidSetBssidListScan */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to request the driver to perform -* scanning with attaching information elements(IEs) specified from user space -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetBssidListScanExt ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_SCAN_REQUEST_EXT_T prScanRequest; - P_PARAM_SSID_T prSsid; - PUINT_8 pucIe; - UINT_32 u4IeLength; - - DEBUGFUNC("wlanoidSetBssidListScanExt()"); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set BSSID list scan! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - ASSERT(pu4SetInfoLen); - *pu4SetInfoLen = 0; - - if(u4SetBufferLen != sizeof(PARAM_SCAN_REQUEST_EXT_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - if (prAdapter->fgIsRadioOff) { - DBGLOG(REQ, WARN, ("Return from BSSID list scan! (radio off). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_SUCCESS; - } - - if(pvSetBuffer != NULL && u4SetBufferLen != 0) { - prScanRequest = (P_PARAM_SCAN_REQUEST_EXT_T)pvSetBuffer; - prSsid = &(prScanRequest->rSsid); - pucIe = prScanRequest->pucIE; - u4IeLength = prScanRequest->u4IELength; - } - else { - prScanRequest = NULL; - prSsid = NULL; - pucIe = NULL; - u4IeLength = 0; - } - -#if CFG_SUPPORT_RDD_TEST_MODE - if (prAdapter->prGlueInfo->rRegInfo.u4RddTestMode) { - if((prAdapter->fgEnOnlineScan == TRUE) && (prAdapter->ucRddStatus)){ - if (kalGetMediaStateIndicated(prAdapter->prGlueInfo) != PARAM_MEDIA_STATE_CONNECTED){ - aisFsmScanRequest(prAdapter, prSsid, pucIe, u4IeLength); - } - } - } - else -#endif - { - if(prAdapter->fgEnOnlineScan == TRUE) { - aisFsmScanRequest(prAdapter, prSsid, pucIe, u4IeLength); - } - else if(kalGetMediaStateIndicated(prAdapter->prGlueInfo) != PARAM_MEDIA_STATE_CONNECTED) { - aisFsmScanRequest(prAdapter, prSsid, pucIe, u4IeLength); - } - } - - return WLAN_STATUS_SUCCESS; -} /* wlanoidSetBssidListScanWithIE */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine will initiate the join procedure to attempt to associate -* with the specified BSSID. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_INVALID_DATA -* \retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetBssid ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_GLUE_INFO_T prGlueInfo; - P_UINT_8 pAddr; - UINT_32 i; - INT_32 i4Idx = -1; - P_MSG_AIS_ABORT_T prAisAbortMsg; - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = MAC_ADDR_LEN;; - if (u4SetBufferLen != MAC_ADDR_LEN){ - *pu4SetInfoLen = MAC_ADDR_LEN; - return WLAN_STATUS_INVALID_LENGTH; - } - else if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set ssid! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - prGlueInfo = prAdapter->prGlueInfo; - pAddr = (P_UINT_8)pvSetBuffer; - - // re-association check - if(kalGetMediaStateIndicated(prGlueInfo) == PARAM_MEDIA_STATE_CONNECTED) { - if(EQUAL_MAC_ADDR(prAdapter->rWlanInfo.rCurrBssId.arMacAddress, pAddr)) { - kalSetMediaStateIndicated(prGlueInfo, PARAM_MEDIA_STATE_TO_BE_INDICATED); - } - else { - kalIndicateStatusAndComplete(prGlueInfo, - WLAN_STATUS_MEDIA_DISCONNECT, - NULL, - 0); - } - } - - // check if any scanned result matchs with the BSSID - for(i = 0 ; i < prAdapter->rWlanInfo.u4ScanResultNum ; i++) { - if(EQUAL_MAC_ADDR(prAdapter->rWlanInfo.arScanResult[i].arMacAddress, pAddr)) { - i4Idx = (INT_32)i; - break; - } - } - - /* prepare message to AIS */ - if (prAdapter->rWifiVar.rConnSettings.eOPMode == NET_TYPE_IBSS - || prAdapter->rWifiVar.rConnSettings.eOPMode == NET_TYPE_DEDICATED_IBSS) { - /* IBSS */ /* beacon period */ - prAdapter->rWifiVar.rConnSettings.u2BeaconPeriod = prAdapter->rWlanInfo.u2BeaconPeriod; - prAdapter->rWifiVar.rConnSettings.u2AtimWindow = prAdapter->rWlanInfo.u2AtimWindow; - } - - /* Set Connection Request Issued Flag */ - prAdapter->rWifiVar.rConnSettings.fgIsConnReqIssued = TRUE; - prAdapter->rWifiVar.rConnSettings.eConnectionPolicy = CONNECT_BY_BSSID; - - /* Send AIS Abort Message */ - prAisAbortMsg = (P_MSG_AIS_ABORT_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_AIS_ABORT_T)); - if (!prAisAbortMsg) { - ASSERT(0); - return WLAN_STATUS_FAILURE; - } - - prAisAbortMsg->rMsgHdr.eMsgId = MID_OID_AIS_FSM_JOIN_REQ; - prAisAbortMsg->ucReasonOfDisconnect = DISCONNECT_REASON_CODE_NEW_CONNECTION; - - if (EQUAL_MAC_ADDR(prAdapter->rWifiVar.rConnSettings.aucBSSID, pAddr)) { - prAisAbortMsg->fgDelayIndication = TRUE; - } - else { - /* Update the information to CONNECTION_SETTINGS_T */ - prAdapter->rWifiVar.rConnSettings.ucSSIDLen = 0; - prAdapter->rWifiVar.rConnSettings.aucSSID[0] = '\0'; - - COPY_MAC_ADDR(prAdapter->rWifiVar.rConnSettings.aucBSSID, pAddr); - prAisAbortMsg->fgDelayIndication = FALSE; - } - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prAisAbortMsg, - MSG_SEND_METHOD_BUF); - - return WLAN_STATUS_SUCCESS; -} /* end of wlanoidSetBssid() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine will initiate the join procedure to attempt -* to associate with the new SSID. If the previous scanning -* result is aged, we will scan the channels at first. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_DATA -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetSsid ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_GLUE_INFO_T prGlueInfo; - P_PARAM_SSID_T pParamSsid; - UINT_32 i; - INT_32 i4Idx = -1, i4MaxRSSI = INT_MIN; - P_MSG_AIS_ABORT_T prAisAbortMsg; - BOOLEAN fgIsValidSsid = TRUE; - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - /* MSDN: - * Powering on the radio if the radio is powered off through a setting of OID_802_11_DISASSOCIATE - */ - if(prAdapter->fgIsRadioOff == TRUE) { - prAdapter->fgIsRadioOff = FALSE; - } - - if(u4SetBufferLen < sizeof(PARAM_SSID_T) || u4SetBufferLen > sizeof(PARAM_SSID_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - else if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set ssid! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - pParamSsid = (P_PARAM_SSID_T) pvSetBuffer; - - if (pParamSsid->u4SsidLen > 32) { - return WLAN_STATUS_INVALID_LENGTH; - } - - prGlueInfo = prAdapter->prGlueInfo; - - // prepare for CMD_BUILD_CONNECTION & CMD_GET_CONNECTION_STATUS - // re-association check - if(kalGetMediaStateIndicated(prGlueInfo) == PARAM_MEDIA_STATE_CONNECTED) { - if(EQUAL_SSID(prAdapter->rWlanInfo.rCurrBssId.rSsid.aucSsid, - prAdapter->rWlanInfo.rCurrBssId.rSsid.u4SsidLen, - pParamSsid->aucSsid, - pParamSsid->u4SsidLen)) { - kalSetMediaStateIndicated(prGlueInfo, PARAM_MEDIA_STATE_TO_BE_INDICATED); - } - else { - kalIndicateStatusAndComplete(prGlueInfo, - WLAN_STATUS_MEDIA_DISCONNECT, - NULL, - 0); - } - } - - // check if any scanned result matchs with the SSID - for(i = 0 ; i < prAdapter->rWlanInfo.u4ScanResultNum ; i++) { - PUINT_8 aucSsid = prAdapter->rWlanInfo.arScanResult[i].rSsid.aucSsid; - UINT_8 ucSsidLength = (UINT_8) prAdapter->rWlanInfo.arScanResult[i].rSsid.u4SsidLen; - INT_32 i4RSSI = prAdapter->rWlanInfo.arScanResult[i].rRssi; - - if(EQUAL_SSID(aucSsid, ucSsidLength, pParamSsid->aucSsid, pParamSsid->u4SsidLen) && - i4RSSI >= i4MaxRSSI) { - i4Idx = (INT_32)i; - i4MaxRSSI = i4RSSI; - } - } - - /* prepare message to AIS */ - if (prAdapter->rWifiVar.rConnSettings.eOPMode == NET_TYPE_IBSS - || prAdapter->rWifiVar.rConnSettings.eOPMode == NET_TYPE_DEDICATED_IBSS) { - /* IBSS */ /* beacon period */ - prAdapter->rWifiVar.rConnSettings.u2BeaconPeriod = prAdapter->rWlanInfo.u2BeaconPeriod; - prAdapter->rWifiVar.rConnSettings.u2AtimWindow = prAdapter->rWlanInfo.u2AtimWindow; - } - - if (prAdapter->rWifiVar.fgSupportWZCDisassociation) { - if (pParamSsid->u4SsidLen == ELEM_MAX_LEN_SSID) { - fgIsValidSsid = FALSE; - - for (i = 0; i < ELEM_MAX_LEN_SSID; i++) { - if ( !((0 < pParamSsid->aucSsid[i]) && (pParamSsid->aucSsid[i] <= 0x1F)) ) { - fgIsValidSsid = TRUE; - break; - } - } - } - } - - /* Set Connection Request Issued Flag */ - if (fgIsValidSsid) { - prAdapter->rWifiVar.rConnSettings.fgIsConnReqIssued = TRUE; - - if(pParamSsid->u4SsidLen) { - prAdapter->rWifiVar.rConnSettings.eConnectionPolicy = CONNECT_BY_SSID_BEST_RSSI; - } - else { - // wildcard SSID - prAdapter->rWifiVar.rConnSettings.eConnectionPolicy = CONNECT_BY_SSID_ANY; - } - } - else { - prAdapter->rWifiVar.rConnSettings.fgIsConnReqIssued = FALSE; - } - - /* Send AIS Abort Message */ - prAisAbortMsg = (P_MSG_AIS_ABORT_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_AIS_ABORT_T)); - if (!prAisAbortMsg) { - ASSERT(0); - return WLAN_STATUS_FAILURE; - } - - prAisAbortMsg->rMsgHdr.eMsgId = MID_OID_AIS_FSM_JOIN_REQ; - prAisAbortMsg->ucReasonOfDisconnect = DISCONNECT_REASON_CODE_NEW_CONNECTION; - - if (EQUAL_SSID(prAdapter->rWifiVar.rConnSettings.aucSSID, - prAdapter->rWifiVar.rConnSettings.ucSSIDLen, - pParamSsid->aucSsid, - pParamSsid->u4SsidLen)) { - prAisAbortMsg->fgDelayIndication = TRUE; - } - else { - /* Update the information to CONNECTION_SETTINGS_T */ - COPY_SSID(prAdapter->rWifiVar.rConnSettings.aucSSID, - prAdapter->rWifiVar.rConnSettings.ucSSIDLen, - pParamSsid->aucSsid, - (UINT_8)pParamSsid->u4SsidLen); - - prAisAbortMsg->fgDelayIndication = FALSE; - } - DBGLOG(SCN, INFO, ("SSID %s\n", prAdapter->rWifiVar.rConnSettings.aucSSID)); - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prAisAbortMsg, - MSG_SEND_METHOD_BUF); - - return WLAN_STATUS_SUCCESS; - -} /* end of wlanoidSetSsid() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the currently associated SSID. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQuerySsid ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - P_PARAM_SSID_T prAssociatedSsid; - - DEBUGFUNC("wlanoidQuerySsid"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(PARAM_SSID_T); - - /* Check for query buffer length */ - if (u4QueryBufferLen < *pu4QueryInfoLen) { - DBGLOG(REQ, WARN, ("Invalid length %lu\n", u4QueryBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - - prAssociatedSsid = (P_PARAM_SSID_T)pvQueryBuffer; - - kalMemZero(prAssociatedSsid->aucSsid, sizeof(prAssociatedSsid->aucSsid)); - - if (kalGetMediaStateIndicated(prAdapter->prGlueInfo) == PARAM_MEDIA_STATE_CONNECTED) { - prAssociatedSsid->u4SsidLen = prAdapter->rWlanInfo.rCurrBssId.rSsid.u4SsidLen; - - if (prAssociatedSsid->u4SsidLen) { - kalMemCopy(prAssociatedSsid->aucSsid, - prAdapter->rWlanInfo.rCurrBssId.rSsid.aucSsid, - prAssociatedSsid->u4SsidLen); - } - } - else { - prAssociatedSsid->u4SsidLen = 0; - - DBGLOG(REQ, TRACE, ("Null SSID\n")); - } - - return WLAN_STATUS_SUCCESS; -} /* wlanoidQuerySsid */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the current 802.11 network type. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryInfrastructureMode ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryInfrastructureMode"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - - *pu4QueryInfoLen = sizeof(ENUM_PARAM_OP_MODE_T); - - if (u4QueryBufferLen < sizeof(ENUM_PARAM_OP_MODE_T)) { - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *(P_ENUM_PARAM_OP_MODE_T)pvQueryBuffer = prAdapter->rWifiVar.rConnSettings.eOPMode; - - /* - ** According to OID_802_11_INFRASTRUCTURE_MODE - ** If there is no prior OID_802_11_INFRASTRUCTURE_MODE, - ** NDIS_STATUS_ADAPTER_NOT_READY shall be returned. - */ -#if DBG - switch (*(P_ENUM_PARAM_OP_MODE_T)pvQueryBuffer) { - case NET_TYPE_IBSS: - DBGLOG(REQ, INFO, ("IBSS mode\n")); - break; - case NET_TYPE_INFRA: - DBGLOG(REQ, INFO, ("Infrastructure mode\n")); - break; - default: - DBGLOG(REQ, INFO, ("Automatic mode\n")); - } -#endif - - return WLAN_STATUS_SUCCESS; -} /* wlanoidQueryInfrastructureMode */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set mode to infrastructure or -* IBSS, or automatic switch between the two. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed due to invalid -* length of the set buffer, returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_DATA -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetInfrastructureMode ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_GLUE_INFO_T prGlueInfo; - ENUM_PARAM_OP_MODE_T eOpMode; - - DEBUGFUNC("wlanoidSetInfrastructureMode"); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - prGlueInfo = prAdapter->prGlueInfo; - - if (u4SetBufferLen < sizeof(ENUM_PARAM_OP_MODE_T)) - return WLAN_STATUS_BUFFER_TOO_SHORT; - - *pu4SetInfoLen = sizeof(ENUM_PARAM_OP_MODE_T); - - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set infrastructure mode! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - eOpMode = *(P_ENUM_PARAM_OP_MODE_T)pvSetBuffer; - /* Verify the new infrastructure mode. */ - if (eOpMode >= NET_TYPE_NUM) { - DBGLOG(REQ, TRACE, ("Invalid mode value %d\n", eOpMode)); - return WLAN_STATUS_INVALID_DATA; - } - - /* check if possible to switch to AdHoc mode */ - if(eOpMode == NET_TYPE_IBSS || eOpMode == NET_TYPE_DEDICATED_IBSS) { - if(cnmAisIbssIsPermitted(prAdapter) == FALSE) { - DBGLOG(REQ, TRACE, ("Mode value %d unallowed\n", eOpMode)); - return WLAN_STATUS_FAILURE; - } - } - - /* Save the new infrastructure mode setting. */ - prAdapter->rWifiVar.rConnSettings.eOPMode = eOpMode; - - /* Clean up the Tx key flag */ - prAdapter->rWifiVar.rAisSpecificBssInfo.fgTransmitKeyExist = FALSE; - - prAdapter->rWifiVar.rConnSettings.fgWapiMode = FALSE; -#if CFG_SUPPORT_WAPI - prAdapter->prGlueInfo->u2WapiAssocInfoIESz = 0; - kalMemZero(&prAdapter->prGlueInfo->aucWapiAssocInfoIEs, 42); -#endif - -#if CFG_SUPPORT_802_11W - prAdapter->rWifiVar.rAisSpecificBssInfo.fgMgmtProtection = FALSE; - prAdapter->rWifiVar.rAisSpecificBssInfo.fgBipKeyInstalled = FALSE; -#endif - -#if CFG_SUPPORT_WPS2 - kalMemZero(&prAdapter->prGlueInfo->aucWSCAssocInfoIE, 200); - prAdapter->prGlueInfo->u2WSCAssocInfoIELen = 0; -#endif - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_INFRASTRUCTURE, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - 0, - NULL, - pvSetBuffer, - u4SetBufferLen - ); - -} /* wlanoidSetInfrastructureMode */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the current 802.11 authentication -* mode. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryAuthMode ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryAuthMode"); - - ASSERT(prAdapter); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - *pu4QueryInfoLen = sizeof(ENUM_PARAM_AUTH_MODE_T); - - if (u4QueryBufferLen < sizeof(ENUM_PARAM_AUTH_MODE_T)) { - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - *(P_ENUM_PARAM_AUTH_MODE_T)pvQueryBuffer = prAdapter->rWifiVar.rConnSettings.eAuthMode; - -#if DBG - switch (*(P_ENUM_PARAM_AUTH_MODE_T)pvQueryBuffer) { - case AUTH_MODE_OPEN: - DBGLOG(REQ, INFO, ("Current auth mode: Open\n")); - break; - - case AUTH_MODE_SHARED: - DBGLOG(REQ, INFO, ("Current auth mode: Shared\n")); - break; - - case AUTH_MODE_AUTO_SWITCH: - DBGLOG(REQ, INFO, ("Current auth mode: Auto-switch\n")); - break; - - case AUTH_MODE_WPA: - DBGLOG(REQ, INFO, ("Current auth mode: WPA\n")); - break; - - case AUTH_MODE_WPA_PSK: - DBGLOG(REQ, INFO, ("Current auth mode: WPA PSK\n")); - break; - - case AUTH_MODE_WPA_NONE: - DBGLOG(REQ, INFO, ("Current auth mode: WPA None\n")); - break; - - case AUTH_MODE_WPA2: - DBGLOG(REQ, INFO, ("Current auth mode: WPA2\n")); - break; - - case AUTH_MODE_WPA2_PSK: - DBGLOG(REQ, INFO, ("Current auth mode: WPA2 PSK\n")); - break; - - default: - DBGLOG(REQ, INFO, ("Current auth mode: %d\n", - *(P_ENUM_PARAM_AUTH_MODE_T)pvQueryBuffer)); - } -#endif - return WLAN_STATUS_SUCCESS; -} /* wlanoidQueryAuthMode */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set the IEEE 802.11 authentication mode -* to the driver. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_DATA -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_NOT_ACCEPTED -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetAuthMode ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_GLUE_INFO_T prGlueInfo; - UINT_32 i, u4AkmSuite; - P_DOT11_RSNA_CONFIG_AUTHENTICATION_SUITES_ENTRY prEntry; - - DEBUGFUNC("wlanoidSetAuthMode"); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - ASSERT(pvSetBuffer); - - prGlueInfo = prAdapter->prGlueInfo; - - *pu4SetInfoLen = sizeof(ENUM_PARAM_AUTH_MODE_T); - - if (u4SetBufferLen < sizeof(ENUM_PARAM_AUTH_MODE_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - /* RF Test */ - //if (IS_ARB_IN_RFTEST_STATE(prAdapter)) { - // return WLAN_STATUS_SUCCESS; - //} - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set Authentication mode! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - /* Check if the new authentication mode is valid. */ - if (*(P_ENUM_PARAM_AUTH_MODE_T)pvSetBuffer >= AUTH_MODE_NUM) { - DBGLOG(REQ, TRACE, ("Invalid auth mode %d\n", - *(P_ENUM_PARAM_AUTH_MODE_T)pvSetBuffer)); - return WLAN_STATUS_INVALID_DATA; - } - - switch (*(P_ENUM_PARAM_AUTH_MODE_T)pvSetBuffer) { - case AUTH_MODE_WPA: - case AUTH_MODE_WPA_PSK: - case AUTH_MODE_WPA2: - case AUTH_MODE_WPA2_PSK: - /* infrastructure mode only */ - if (prAdapter->rWifiVar.rConnSettings.eOPMode != NET_TYPE_INFRA) { - return WLAN_STATUS_NOT_ACCEPTED; - } - break; - - case AUTH_MODE_WPA_NONE: - /* ad hoc mode only */ - if (prAdapter->rWifiVar.rConnSettings.eOPMode != NET_TYPE_IBSS) { - return WLAN_STATUS_NOT_ACCEPTED; - } - break; - - default: - ; - } - - /* Save the new authentication mode. */ - prAdapter->rWifiVar.rConnSettings.eAuthMode = *(P_ENUM_PARAM_AUTH_MODE_T)pvSetBuffer; - -#if DBG - switch (prAdapter->rWifiVar.rConnSettings.eAuthMode) { - case AUTH_MODE_OPEN: - DBGLOG(RSN, TRACE, ("New auth mode: open\n")); - break; - - case AUTH_MODE_SHARED: - DBGLOG(RSN, TRACE, ("New auth mode: shared\n")); - break; - - case AUTH_MODE_AUTO_SWITCH: - DBGLOG(RSN, TRACE, ("New auth mode: auto-switch\n")); - break; - - case AUTH_MODE_WPA: - DBGLOG(RSN, TRACE, ("New auth mode: WPA\n")); - break; - - case AUTH_MODE_WPA_PSK: - DBGLOG(RSN, TRACE, ("New auth mode: WPA PSK\n")); - break; - - case AUTH_MODE_WPA_NONE: - DBGLOG(RSN, TRACE, ("New auth mode: WPA None\n")); - break; - - case AUTH_MODE_WPA2: - DBGLOG(RSN, TRACE, ("New auth mode: WPA2\n")); - break; - - case AUTH_MODE_WPA2_PSK: - DBGLOG(RSN, TRACE, ("New auth mode: WPA2 PSK\n")); - break; - - default: - DBGLOG(RSN, TRACE, ("New auth mode: unknown (%d)\n", - prAdapter->rWifiVar.rConnSettings.eAuthMode)); - } -#endif - - if (prAdapter->rWifiVar.rConnSettings.eAuthMode >= AUTH_MODE_WPA) { - switch(prAdapter->rWifiVar.rConnSettings.eAuthMode) { - case AUTH_MODE_WPA: - u4AkmSuite = WPA_AKM_SUITE_802_1X; - break; - - case AUTH_MODE_WPA_PSK: - u4AkmSuite = WPA_AKM_SUITE_PSK; - break; - - case AUTH_MODE_WPA_NONE: - u4AkmSuite = WPA_AKM_SUITE_NONE; - break; - - case AUTH_MODE_WPA2: - u4AkmSuite = RSN_AKM_SUITE_802_1X; - break; - - case AUTH_MODE_WPA2_PSK: - u4AkmSuite = RSN_AKM_SUITE_PSK; - break; - - default: - u4AkmSuite = 0; - } - } - else { - u4AkmSuite = 0; - } - - /* Enable the specific AKM suite only. */ - for (i = 0; i < MAX_NUM_SUPPORTED_AKM_SUITES; i++) { - prEntry = &prAdapter->rMib.dot11RSNAConfigAuthenticationSuitesTable[i]; - - if (prEntry->dot11RSNAConfigAuthenticationSuite == u4AkmSuite) { - prEntry->dot11RSNAConfigAuthenticationSuiteEnabled = TRUE; - } - else { - prEntry->dot11RSNAConfigAuthenticationSuiteEnabled = FALSE; - } -#if CFG_SUPPORT_802_11W - if (kalGetMfpSetting(prAdapter->prGlueInfo) != RSN_AUTH_MFP_DISABLED) { - if ((u4AkmSuite == RSN_AKM_SUITE_PSK) && - prEntry->dot11RSNAConfigAuthenticationSuite == RSN_AKM_SUITE_PSK_SHA256) { - DBGLOG(RSN, TRACE, ("Enable RSN_AKM_SUITE_PSK_SHA256 AKM support\n")); - prEntry->dot11RSNAConfigAuthenticationSuiteEnabled = TRUE; - - } - if ((u4AkmSuite == RSN_AKM_SUITE_802_1X) && - prEntry->dot11RSNAConfigAuthenticationSuite == RSN_AKM_SUITE_802_1X_SHA256) { - DBGLOG(RSN, TRACE, ("Enable RSN_AKM_SUITE_802_1X_SHA256 AKM support\n")); - prEntry->dot11RSNAConfigAuthenticationSuiteEnabled = TRUE; - } - } -#endif - } - - - return WLAN_STATUS_SUCCESS; - -} /* wlanoidSetAuthMode */ - - -#if 0 -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the current 802.11 privacy filter -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryPrivacyFilter ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryPrivacyFilter"); - - ASSERT(prAdapter); - - ASSERT(pvQueryBuffer); - ASSERT(pu4QueryInfoLen); - - *pu4QueryInfoLen = sizeof(ENUM_PARAM_PRIVACY_FILTER_T); - - if (u4QueryBufferLen < sizeof(ENUM_PARAM_PRIVACY_FILTER_T)) { - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - *(P_ENUM_PARAM_PRIVACY_FILTER_T)pvQueryBuffer = prAdapter->rWlanInfo.ePrivacyFilter; - -#if DBG - switch (*(P_ENUM_PARAM_PRIVACY_FILTER_T)pvQueryBuffer) { - case PRIVACY_FILTER_ACCEPT_ALL: - DBGLOG(REQ, INFO, ("Current privacy mode: open mode\n")); - break; - - case PRIVACY_FILTER_8021xWEP: - DBGLOG(REQ, INFO, ("Current privacy mode: filtering mode\n")); - break; - - default: - DBGLOG(REQ, INFO, ("Current auth mode: %d\n", - *(P_ENUM_PARAM_AUTH_MODE_T)pvQueryBuffer)); - } -#endif - return WLAN_STATUS_SUCCESS; -} /* wlanoidQueryPrivacyFilter */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set the IEEE 802.11 privacy filter -* to the driver. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_DATA -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_NOT_ACCEPTED -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetPrivacyFilter ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_GLUE_INFO_T prGlueInfo; - - DEBUGFUNC("wlanoidSetPrivacyFilter"); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - ASSERT(pvSetBuffer); - - prGlueInfo = prAdapter->prGlueInfo; - - *pu4SetInfoLen = sizeof(ENUM_PARAM_PRIVACY_FILTER_T); - - if (u4SetBufferLen < sizeof(ENUM_PARAM_PRIVACY_FILTER_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set Authentication mode! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - /* Check if the new authentication mode is valid. */ - if (*(P_ENUM_PARAM_PRIVACY_FILTER_T)pvSetBuffer >= PRIVACY_FILTER_NUM) { - DBGLOG(REQ, TRACE, ("Invalid privacy filter %d\n", - *(P_ENUM_PARAM_PRIVACY_FILTER_T)pvSetBuffer)); - return WLAN_STATUS_INVALID_DATA; - } - - switch (*(P_ENUM_PARAM_PRIVACY_FILTER_T)pvSetBuffer) { - default: - break; - } - - /* Save the new authentication mode. */ - prAdapter->rWlanInfo.ePrivacyFilter = *(ENUM_PARAM_PRIVACY_FILTER_T)pvSetBuffer; - - return WLAN_STATUS_SUCCESS; - -} /* wlanoidSetPrivacyFilter */ -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to reload the available default settings for -* the specified type field. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_INVALID_DATA -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetReloadDefaults ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - ENUM_PARAM_NETWORK_TYPE_T eNetworkType; - UINT_32 u4Len; - UINT_8 ucCmdSeqNum; - - - DEBUGFUNC("wlanoidSetReloadDefaults"); - - ASSERT(prAdapter); - - ASSERT(pu4SetInfoLen); - *pu4SetInfoLen = sizeof(PARAM_RELOAD_DEFAULTS); - - //if (IS_ARB_IN_RFTEST_STATE(prAdapter)) { - // return WLAN_STATUS_SUCCESS; - //} - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set Reload default! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - ASSERT(pvSetBuffer); - /* Verify the available reload options and reload the settings. */ - switch (*(P_PARAM_RELOAD_DEFAULTS)pvSetBuffer) { - case ENUM_RELOAD_WEP_KEYS: - /* Reload available default WEP keys from the permanent - storage. */ - prAdapter->rWifiVar.rConnSettings.eAuthMode = AUTH_MODE_OPEN; - prAdapter->rWifiVar.rConnSettings.eEncStatus = ENUM_ENCRYPTION1_KEY_ABSENT;//ENUM_ENCRYPTION_DISABLED; - { - P_GLUE_INFO_T prGlueInfo; - P_CMD_INFO_T prCmdInfo; - P_WIFI_CMD_T prWifiCmd; - P_CMD_802_11_KEY prCmdKey; - UINT_8 aucBCAddr[] = BC_MAC_ADDR; - - prGlueInfo = prAdapter->prGlueInfo; - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, (CMD_HDR_SIZE + sizeof(CMD_802_11_KEY))); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - - // compose CMD_802_11_KEY cmd pkt - prCmdInfo->eCmdType = COMMAND_TYPE_NETWORK_IOCTL; - prCmdInfo->eNetworkType = NETWORK_TYPE_AIS_INDEX; - prCmdInfo->u2InfoBufLen = CMD_HDR_SIZE + sizeof(CMD_802_11_KEY); - prCmdInfo->pfCmdDoneHandler = nicCmdEventSetCommon; - prCmdInfo->pfCmdTimeoutHandler = nicOidCmdTimeoutCommon; - prCmdInfo->fgIsOid = TRUE; - prCmdInfo->ucCID = CMD_ID_ADD_REMOVE_KEY; - prCmdInfo->fgSetQuery = TRUE; - prCmdInfo->fgNeedResp = FALSE; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = sizeof(PARAM_REMOVE_KEY_T); - prCmdInfo->pvInformationBuffer = pvSetBuffer; - prCmdInfo->u4InformationBufferLength = u4SetBufferLen; - - // Setup WIFI_CMD_T - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - prCmdKey = (P_CMD_802_11_KEY)(prWifiCmd->aucBuffer); - - kalMemZero((PUINT_8)prCmdKey, sizeof(CMD_802_11_KEY)); - - prCmdKey->ucAddRemove = 0; /* Remove */ - prCmdKey->ucKeyId = 0;//(UINT_8)(prRemovedKey->u4KeyIndex & 0x000000ff); - kalMemCopy(prCmdKey->aucPeerAddr, aucBCAddr, MAC_ADDR_LEN); - - ASSERT(prCmdKey->ucKeyId < MAX_KEY_NUM); - - prCmdKey->ucKeyType = 0; - - // insert into prCmdQueue - kalEnqueueCommand(prGlueInfo, (P_QUE_ENTRY_T)prCmdInfo); - - // wakeup txServiceThread later - GLUE_SET_EVENT(prGlueInfo); - - return WLAN_STATUS_PENDING; - } - - break; - - default: - DBGLOG(REQ, TRACE, ("Invalid reload option %d\n", - *(P_PARAM_RELOAD_DEFAULTS)pvSetBuffer)); - rStatus = WLAN_STATUS_INVALID_DATA; - } - - /* OID_802_11_RELOAD_DEFAULTS requiest to reset to auto mode */ - eNetworkType = PARAM_NETWORK_TYPE_AUTOMODE; - wlanoidSetNetworkTypeInUse(prAdapter, &eNetworkType, sizeof(eNetworkType), &u4Len); - - return rStatus; -} /* wlanoidSetReloadDefaults */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set a WEP key to the driver. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_INVALID_DATA -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -*/ -/*----------------------------------------------------------------------------*/ -#ifdef LINUX -UINT_8 keyBuffer[sizeof(PARAM_KEY_T) + 16 /* LEGACY_KEY_MAX_LEN*/]; -UINT_8 aucBCAddr[] = BC_MAC_ADDR; -#endif -WLAN_STATUS -wlanoidSetAddWep ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - #ifndef LINUX - UINT_8 keyBuffer[sizeof(PARAM_KEY_T) + 16 /* LEGACY_KEY_MAX_LEN*/]; - UINT_8 aucBCAddr[] = BC_MAC_ADDR; - #endif - P_PARAM_WEP_T prNewWepKey; - P_PARAM_KEY_T prParamKey = (P_PARAM_KEY_T)keyBuffer; - UINT_32 u4KeyId, u4SetLen; - - DEBUGFUNC("wlanoidSetAddWep"); - - ASSERT(prAdapter); - - *pu4SetInfoLen = OFFSET_OF(PARAM_WEP_T, aucKeyMaterial); - - if (u4SetBufferLen < OFFSET_OF(PARAM_WEP_T, aucKeyMaterial)) { - ASSERT(pu4SetInfoLen); - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set add WEP! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - prNewWepKey = (P_PARAM_WEP_T)pvSetBuffer; - - /* Verify the total buffer for minimum length. */ - if (u4SetBufferLen < OFFSET_OF(PARAM_WEP_T, aucKeyMaterial) + prNewWepKey->u4KeyLength) { - DBGLOG(REQ, WARN, ("Invalid total buffer length (%d) than minimum length (%d)\n", - (UINT_8)u4SetBufferLen, - (UINT_8)OFFSET_OF(PARAM_WEP_T, aucKeyMaterial))); - - *pu4SetInfoLen = OFFSET_OF(PARAM_WEP_T, aucKeyMaterial); - return WLAN_STATUS_INVALID_DATA; - } - - /* Verify the key structure length. */ - if (prNewWepKey->u4Length > u4SetBufferLen) { - DBGLOG(REQ, WARN, ("Invalid key structure length (%d) greater than total buffer length (%d)\n", - (UINT_8)prNewWepKey->u4Length, - (UINT_8)u4SetBufferLen)); - - *pu4SetInfoLen = u4SetBufferLen; - return WLAN_STATUS_INVALID_DATA; - } - - /* Verify the key material length for maximum key material length:16 */ - if (prNewWepKey->u4KeyLength > 16 /* LEGACY_KEY_MAX_LEN */) { - DBGLOG(REQ, WARN, ("Invalid key material length (%d) greater than maximum key material length (16)\n", - (UINT_8)prNewWepKey->u4KeyLength)); - - *pu4SetInfoLen = u4SetBufferLen; - return WLAN_STATUS_INVALID_DATA; - } - - *pu4SetInfoLen = u4SetBufferLen; - - u4KeyId = prNewWepKey->u4KeyIndex & BITS(0,29) /* WEP_KEY_ID_FIELD */; - - /* Verify whether key index is valid or not, current version - driver support only 4 global WEP keys setting by this OID */ - if (u4KeyId > MAX_KEY_NUM - 1) { - DBGLOG(REQ, ERROR, ("Error, invalid WEP key ID: %d\n", (UINT_8)u4KeyId)); - return WLAN_STATUS_INVALID_DATA; - } - - prParamKey->u4KeyIndex = u4KeyId; - - /* Transmit key */ - if (prNewWepKey->u4KeyIndex & IS_TRANSMIT_KEY) { - prParamKey->u4KeyIndex |= IS_TRANSMIT_KEY; - } - - /* Per client key */ - if (prNewWepKey->u4KeyIndex & IS_UNICAST_KEY) { - prParamKey->u4KeyIndex |= IS_UNICAST_KEY; - } - - prParamKey->u4KeyLength = prNewWepKey->u4KeyLength; - - kalMemCopy(prParamKey->arBSSID, aucBCAddr, MAC_ADDR_LEN); - - kalMemCopy(prParamKey->aucKeyMaterial, - prNewWepKey->aucKeyMaterial, - prNewWepKey->u4KeyLength); - - prParamKey->u4Length = OFFSET_OF(PARAM_KEY_T, aucKeyMaterial) + prNewWepKey->u4KeyLength; - - wlanoidSetAddKey(prAdapter, - (PVOID)prParamKey, - prParamKey->u4Length, - &u4SetLen); - - return WLAN_STATUS_PENDING; -} /* wlanoidSetAddWep */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to request the driver to remove the WEP key -* at the specified key index. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_DATA -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetRemoveWep ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - UINT_32 u4KeyId, u4SetLen; - PARAM_REMOVE_KEY_T rRemoveKey; - UINT_8 aucBCAddr[] = BC_MAC_ADDR; - - DEBUGFUNC("wlanoidSetRemoveWep"); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_KEY_INDEX); - - if (u4SetBufferLen < sizeof(PARAM_KEY_INDEX)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - u4KeyId = *(PUINT_32)pvSetBuffer; - - /* Dump PARAM_WEP content. */ - DBGLOG(REQ, INFO, ("Set: Dump PARAM_KEY_INDEX content\n")); - DBGLOG(REQ, INFO, ("Index : 0x%08lx\n", u4KeyId)); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set remove WEP! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - if (u4KeyId & IS_TRANSMIT_KEY) { - /* Bit 31 should not be set */ - DBGLOG(REQ, ERROR, ("Invalid WEP key index: 0x%08lx\n", u4KeyId)); - return WLAN_STATUS_INVALID_DATA; - } - - u4KeyId &= BITS(0,7); - - /* Verify whether key index is valid or not. Current version - driver support only 4 global WEP keys. */ - if (u4KeyId > MAX_KEY_NUM - 1) { - DBGLOG(REQ, ERROR, ("invalid WEP key ID %lu\n", u4KeyId)); - return WLAN_STATUS_INVALID_DATA; - } - - rRemoveKey.u4Length = sizeof(PARAM_REMOVE_KEY_T); - rRemoveKey.u4KeyIndex = *(PUINT_32)pvSetBuffer; - - kalMemCopy(rRemoveKey.arBSSID, aucBCAddr, MAC_ADDR_LEN); - - wlanoidSetRemoveKey(prAdapter, - (PVOID)&rRemoveKey, - sizeof(PARAM_REMOVE_KEY_T), - &u4SetLen); - - return WLAN_STATUS_PENDING; -} /* wlanoidSetRemoveWep */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set a key to the driver. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_INVALID_DATA -* -* \note The setting buffer PARAM_KEY_T, which is set by NDIS, is unpacked. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetAddKey ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_GLUE_INFO_T prGlueInfo; - P_CMD_INFO_T prCmdInfo; - P_WIFI_CMD_T prWifiCmd; - P_PARAM_KEY_T prNewKey; - P_CMD_802_11_KEY prCmdKey; - UINT_8 ucCmdSeqNum; - - DEBUGFUNC("wlanoidSetAddKey"); - DBGLOG(REQ, LOUD, ("\n")); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set add key! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - prNewKey = (P_PARAM_KEY_T) pvSetBuffer; - - /* Verify the key structure length. */ - if (prNewKey->u4Length > u4SetBufferLen) { - DBGLOG(REQ, WARN, ("Invalid key structure length (%d) greater than total buffer length (%d)\n", - (UINT_8)prNewKey->u4Length, - (UINT_8)u4SetBufferLen)); - - *pu4SetInfoLen = u4SetBufferLen; - return WLAN_STATUS_INVALID_LENGTH; - } - - /* Verify the key material length for key material buffer */ - if (prNewKey->u4KeyLength > prNewKey->u4Length - OFFSET_OF(PARAM_KEY_T, aucKeyMaterial)) { - DBGLOG(REQ, WARN, ("Invalid key material length (%d)\n", (UINT_8)prNewKey->u4KeyLength)); - *pu4SetInfoLen = u4SetBufferLen; - return WLAN_STATUS_INVALID_DATA; - } - - /* Exception check */ - if (prNewKey->u4KeyIndex & 0x0fffff00) { - return WLAN_STATUS_INVALID_DATA; - } - - /* Exception check, pairwise key must with transmit bit enabled */ - if ((prNewKey->u4KeyIndex & BITS(30,31)) == IS_UNICAST_KEY) { - return WLAN_STATUS_INVALID_DATA; - } - - if (!(prNewKey->u4KeyLength == WEP_40_LEN || prNewKey->u4KeyLength == WEP_104_LEN || - prNewKey->u4KeyLength == CCMP_KEY_LEN || prNewKey->u4KeyLength == TKIP_KEY_LEN)) - { - return WLAN_STATUS_INVALID_DATA; - } - - /* Exception check, pairwise key must with transmit bit enabled */ - if ((prNewKey->u4KeyIndex & BITS(30,31)) == BITS(30,31)) { - if (((prNewKey->u4KeyIndex & 0xff) != 0) || - ((prNewKey->arBSSID[0] == 0xff) && (prNewKey->arBSSID[1] == 0xff) && (prNewKey->arBSSID[2] == 0xff) && - (prNewKey->arBSSID[3] == 0xff) && (prNewKey->arBSSID[4] == 0xff) && (prNewKey->arBSSID[5] == 0xff))) { - return WLAN_STATUS_INVALID_DATA; - } - } - - *pu4SetInfoLen = u4SetBufferLen; - - /* Dump PARAM_KEY content. */ - DBGLOG(REQ, TRACE, ("Set: Dump PARAM_KEY content\n")); - DBGLOG(REQ, TRACE, ("Length : 0x%08lx\n", prNewKey->u4Length)); - DBGLOG(REQ, TRACE, ("Key Index : 0x%08lx\n", prNewKey->u4KeyIndex)); - DBGLOG(REQ, TRACE, ("Key Length: 0x%08lx\n", prNewKey->u4KeyLength)); - DBGLOG(REQ, TRACE, ("BSSID:\n")); - DBGLOG_MEM8(REQ, TRACE, prNewKey->arBSSID, sizeof(PARAM_MAC_ADDRESS)); - DBGLOG(REQ, TRACE, ("Key RSC:\n")); - DBGLOG_MEM8(REQ, TRACE, &prNewKey->rKeyRSC, sizeof(PARAM_KEY_RSC)); - DBGLOG(REQ, TRACE, ("Key Material:\n")); - DBGLOG_MEM8(REQ, TRACE, prNewKey->aucKeyMaterial, prNewKey->u4KeyLength); - - if (prAdapter->rWifiVar.rConnSettings.eAuthMode < AUTH_MODE_WPA) { - /* Todo:: Store the legacy wep key for OID_802_11_RELOAD_DEFAULTS */ - } - - if (prNewKey->u4KeyIndex & IS_TRANSMIT_KEY) - prAdapter->rWifiVar.rAisSpecificBssInfo.fgTransmitKeyExist = TRUE; - - prGlueInfo = prAdapter->prGlueInfo; - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, (CMD_HDR_SIZE + sizeof(CMD_802_11_KEY))); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - DBGLOG(REQ, INFO, ("ucCmdSeqNum = %d\n", ucCmdSeqNum)); - - // compose CMD_802_11_KEY cmd pkt - prCmdInfo->eCmdType = COMMAND_TYPE_NETWORK_IOCTL; - prCmdInfo->eNetworkType = NETWORK_TYPE_AIS_INDEX; - prCmdInfo->u2InfoBufLen = CMD_HDR_SIZE + sizeof(CMD_802_11_KEY); - prCmdInfo->pfCmdDoneHandler = nicCmdEventSetCommon; - prCmdInfo->pfCmdTimeoutHandler = nicOidCmdTimeoutCommon; - prCmdInfo->fgIsOid = TRUE; - prCmdInfo->ucCID = CMD_ID_ADD_REMOVE_KEY; - prCmdInfo->fgSetQuery = TRUE; - prCmdInfo->fgNeedResp = FALSE; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = u4SetBufferLen; - prCmdInfo->pvInformationBuffer = pvSetBuffer; - prCmdInfo->u4InformationBufferLength = u4SetBufferLen; - - // Setup WIFI_CMD_T - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - prCmdKey = (P_CMD_802_11_KEY)(prWifiCmd->aucBuffer); - - kalMemZero(prCmdKey, sizeof(CMD_802_11_KEY)); - - prCmdKey->ucAddRemove = 1; /* Add */ - - prCmdKey->ucTxKey = ((prNewKey->u4KeyIndex & IS_TRANSMIT_KEY) == IS_TRANSMIT_KEY) ? 1 : 0; - prCmdKey->ucKeyType = ((prNewKey->u4KeyIndex & IS_UNICAST_KEY) == IS_UNICAST_KEY) ? 1 : 0; - prCmdKey->ucIsAuthenticator = ((prNewKey->u4KeyIndex & IS_AUTHENTICATOR) == IS_AUTHENTICATOR) ? 1 : 0; - - kalMemCopy(prCmdKey->aucPeerAddr, (PUINT_8)prNewKey->arBSSID, MAC_ADDR_LEN); - - prCmdKey->ucNetType = 0; /* AIS */ - - prCmdKey->ucKeyId = (UINT_8)(prNewKey->u4KeyIndex & 0xff); - - /* Note: adjust the key length for WPA-None */ - prCmdKey->ucKeyLen = (UINT_8)prNewKey->u4KeyLength; - - kalMemCopy(prCmdKey->aucKeyMaterial, (PUINT_8)prNewKey->aucKeyMaterial, prCmdKey->ucKeyLen); - - if (prNewKey->u4KeyLength == 5) { - prCmdKey->ucAlgorithmId = CIPHER_SUITE_WEP40; - } - else if (prNewKey->u4KeyLength == 13) { - prCmdKey->ucAlgorithmId = CIPHER_SUITE_WEP104; - } - else if (prNewKey->u4KeyLength == 16) { - if (prAdapter->rWifiVar.rConnSettings.eAuthMode < AUTH_MODE_WPA) - prCmdKey->ucAlgorithmId = CIPHER_SUITE_WEP128; - else { -#if CFG_SUPPORT_802_11W - if (prCmdKey->ucKeyId >= 4) { - prCmdKey->ucAlgorithmId = CIPHER_SUITE_BIP; - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecBssInfo; - - prAisSpecBssInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - prAisSpecBssInfo->fgBipKeyInstalled = TRUE; - } - else -#endif - prCmdKey->ucAlgorithmId = CIPHER_SUITE_CCMP; - } - } - else if (prNewKey->u4KeyLength == 32) { - if (prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA_NONE) { - if (prAdapter->rWifiVar.rConnSettings.eEncStatus == ENUM_ENCRYPTION2_ENABLED) { - prCmdKey->ucAlgorithmId = CIPHER_SUITE_TKIP; - } - else if (prAdapter->rWifiVar.rConnSettings.eEncStatus == ENUM_ENCRYPTION3_ENABLED) { - prCmdKey->ucAlgorithmId = CIPHER_SUITE_CCMP; - prCmdKey->ucKeyLen = CCMP_KEY_LEN; - } - } - else { - if (rsnCheckPmkidCandicate(prAdapter)) { - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecBssInfo; - - prAisSpecBssInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - DBGLOG(RSN, TRACE, ("Add key: Prepare a timer to indicate candidate PMKID Candidate\n")); - cnmTimerStopTimer(prAdapter, &prAisSpecBssInfo->rPreauthenticationTimer); - cnmTimerStartTimer(prAdapter, &prAisSpecBssInfo->rPreauthenticationTimer, - SEC_TO_MSEC(WAIT_TIME_IND_PMKID_CANDICATE_SEC)); - } - prCmdKey->ucAlgorithmId = CIPHER_SUITE_TKIP; - } - } - - // insert into prCmdQueue - kalEnqueueCommand(prGlueInfo, (P_QUE_ENTRY_T)prCmdInfo); - - // wakeup txServiceThread later - GLUE_SET_EVENT(prGlueInfo); - - return WLAN_STATUS_PENDING; -} /* wlanoidSetAddKey */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to request the driver to remove the key at -* the specified key index. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_DATA -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetRemoveKey ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_GLUE_INFO_T prGlueInfo; - P_CMD_INFO_T prCmdInfo; - P_WIFI_CMD_T prWifiCmd; - P_PARAM_REMOVE_KEY_T prRemovedKey; - P_CMD_802_11_KEY prCmdKey; - UINT_8 ucCmdSeqNum; - - DEBUGFUNC("wlanoidSetRemoveKey"); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_REMOVE_KEY_T); - - if (u4SetBufferLen < sizeof(PARAM_REMOVE_KEY_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set remove key! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - ASSERT(pvSetBuffer); - prRemovedKey = (P_PARAM_REMOVE_KEY_T)pvSetBuffer; - - /* Dump PARAM_REMOVE_KEY content. */ - DBGLOG(REQ, INFO, ("Set: Dump PARAM_REMOVE_KEY content\n")); - DBGLOG(REQ, INFO, ("Length : 0x%08lx\n", prRemovedKey->u4Length)); - DBGLOG(REQ, INFO, ("Key Index : 0x%08lx\n", prRemovedKey->u4KeyIndex)); - DBGLOG(REQ, INFO, ("BSSID:\n")); - DBGLOG_MEM8(REQ, INFO, prRemovedKey->arBSSID, MAC_ADDR_LEN); - - /* Check bit 31: this bit should always 0 */ - if (prRemovedKey->u4KeyIndex & IS_TRANSMIT_KEY) { - /* Bit 31 should not be set */ - DBGLOG(REQ, ERROR, ("invalid key index: 0x%08lx\n", - prRemovedKey->u4KeyIndex)); - return WLAN_STATUS_INVALID_DATA; - } - - /* Check bits 8 ~ 29 should always be 0 */ - if (prRemovedKey->u4KeyIndex & BITS(8, 29)) { - /* Bit 31 should not be set */ - DBGLOG(REQ, ERROR, ("invalid key index: 0x%08lx\n", - prRemovedKey->u4KeyIndex)); - return WLAN_STATUS_INVALID_DATA; - } - - /* Clean up the Tx key flag */ - if (prRemovedKey->u4KeyIndex & IS_UNICAST_KEY) { - prAdapter->rWifiVar.rAisSpecificBssInfo.fgTransmitKeyExist = FALSE; - } - - prGlueInfo = prAdapter->prGlueInfo; - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, (CMD_HDR_SIZE + sizeof(CMD_802_11_KEY))); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - - // compose CMD_802_11_KEY cmd pkt - prCmdInfo->eCmdType = COMMAND_TYPE_NETWORK_IOCTL; - prCmdInfo->eNetworkType = NETWORK_TYPE_AIS_INDEX; - prCmdInfo->u2InfoBufLen = CMD_HDR_SIZE + sizeof(CMD_802_11_KEY); - prCmdInfo->pfCmdDoneHandler = nicCmdEventSetCommon; - prCmdInfo->pfCmdTimeoutHandler = nicOidCmdTimeoutCommon; - prCmdInfo->fgIsOid = TRUE; - prCmdInfo->ucCID = CMD_ID_ADD_REMOVE_KEY; - prCmdInfo->fgSetQuery = TRUE; - prCmdInfo->fgNeedResp = FALSE; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = sizeof(PARAM_REMOVE_KEY_T); - prCmdInfo->pvInformationBuffer = pvSetBuffer; - prCmdInfo->u4InformationBufferLength = u4SetBufferLen; - - // Setup WIFI_CMD_T - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - prCmdKey = (P_CMD_802_11_KEY)(prWifiCmd->aucBuffer); - - kalMemZero((PUINT_8)prCmdKey, sizeof(CMD_802_11_KEY)); - - prCmdKey->ucAddRemove = 0; /* Remove */ - prCmdKey->ucKeyId = (UINT_8)(prRemovedKey->u4KeyIndex & 0x000000ff); - kalMemCopy(prCmdKey->aucPeerAddr, (PUINT_8)prRemovedKey->arBSSID, MAC_ADDR_LEN); - -#if CFG_SUPPORT_802_11W - ASSERT(prCmdKey->ucKeyId < MAX_KEY_NUM + 2); -#else - //ASSERT(prCmdKey->ucKeyId < MAX_KEY_NUM); -#endif - - if (prRemovedKey->u4KeyIndex & IS_UNICAST_KEY) { - prCmdKey->ucKeyType = 1; - } - - // insert into prCmdQueue - kalEnqueueCommand(prGlueInfo, (P_QUE_ENTRY_T)prCmdInfo); - - // wakeup txServiceThread later - GLUE_SET_EVENT(prGlueInfo); - - return WLAN_STATUS_PENDING; -} /* wlanoidSetRemoveKey */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the current encryption status. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryEncryptionStatus ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - BOOLEAN fgTransmitKeyAvailable = TRUE; - ENUM_PARAM_ENCRYPTION_STATUS_T eEncStatus = 0; - - DEBUGFUNC("wlanoidQueryEncryptionStatus"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(ENUM_PARAM_ENCRYPTION_STATUS_T); - - fgTransmitKeyAvailable = prAdapter->rWifiVar.rAisSpecificBssInfo.fgTransmitKeyExist; - - switch (prAdapter->rWifiVar.rConnSettings.eEncStatus) { - case ENUM_ENCRYPTION3_ENABLED: - if (fgTransmitKeyAvailable) { - eEncStatus = ENUM_ENCRYPTION3_ENABLED; - } - else { - eEncStatus = ENUM_ENCRYPTION3_KEY_ABSENT; - } - break; - - case ENUM_ENCRYPTION2_ENABLED: - if (fgTransmitKeyAvailable) { - eEncStatus = ENUM_ENCRYPTION2_ENABLED; - break; - } - else { - eEncStatus = ENUM_ENCRYPTION2_KEY_ABSENT; - } - break; - - case ENUM_ENCRYPTION1_ENABLED: - if (fgTransmitKeyAvailable) { - eEncStatus = ENUM_ENCRYPTION1_ENABLED; - } - else { - eEncStatus = ENUM_ENCRYPTION1_KEY_ABSENT; - } - break; - - case ENUM_ENCRYPTION_DISABLED: - eEncStatus = ENUM_ENCRYPTION_DISABLED; - break; - - default: - DBGLOG(REQ, ERROR, ("Unknown Encryption Status Setting:%d\n", - prAdapter->rWifiVar.rConnSettings.eEncStatus)); - } - -#if DBG - DBGLOG(REQ, INFO, - ("Encryption status: %d Return:%d\n", - prAdapter->rWifiVar.rConnSettings.eEncStatus, - eEncStatus)); -#endif - - *(P_ENUM_PARAM_ENCRYPTION_STATUS_T)pvQueryBuffer = eEncStatus; - - return WLAN_STATUS_SUCCESS; -} /* wlanoidQueryEncryptionStatus */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set the encryption status to the driver. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_NOT_SUPPORTED -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetEncryptionStatus ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_GLUE_INFO_T prGlueInfo; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - ENUM_PARAM_ENCRYPTION_STATUS_T eEewEncrypt; - - DEBUGFUNC("wlanoidSetEncryptionStatus"); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - prGlueInfo = prAdapter->prGlueInfo; - - *pu4SetInfoLen = sizeof(ENUM_PARAM_ENCRYPTION_STATUS_T); - - //if (IS_ARB_IN_RFTEST_STATE(prAdapter)) { - // return WLAN_STATUS_SUCCESS; - //} - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set encryption status! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - eEewEncrypt = *(P_ENUM_PARAM_ENCRYPTION_STATUS_T)pvSetBuffer; - DBGLOG(REQ, TRACE, ("ENCRYPTION_STATUS %d\n", eEewEncrypt)); - - switch (eEewEncrypt) { - case ENUM_ENCRYPTION_DISABLED: /* Disable WEP, TKIP, AES */ - DBGLOG(RSN, TRACE, ("Disable Encryption\n")); - secSetCipherSuite(prAdapter, - CIPHER_FLAG_WEP40 | - CIPHER_FLAG_WEP104 | - CIPHER_FLAG_WEP128); - break; - - case ENUM_ENCRYPTION1_ENABLED: /* Enable WEP. Disable TKIP, AES */ - DBGLOG(RSN, TRACE, ("Enable Encryption1\n")); - secSetCipherSuite(prAdapter, - CIPHER_FLAG_WEP40 | - CIPHER_FLAG_WEP104 | - CIPHER_FLAG_WEP128); - break; - - case ENUM_ENCRYPTION2_ENABLED: /* Enable WEP, TKIP. Disable AES */ - secSetCipherSuite(prAdapter, - CIPHER_FLAG_WEP40 | - CIPHER_FLAG_WEP104 | - CIPHER_FLAG_WEP128 | - CIPHER_FLAG_TKIP); - DBGLOG(RSN, TRACE, ("Enable Encryption2\n")); - break; - - case ENUM_ENCRYPTION3_ENABLED: /* Enable WEP, TKIP, AES */ - secSetCipherSuite(prAdapter, - CIPHER_FLAG_WEP40 | - CIPHER_FLAG_WEP104 | - CIPHER_FLAG_WEP128 | - CIPHER_FLAG_TKIP | - CIPHER_FLAG_CCMP); - DBGLOG(RSN, TRACE, ("Enable Encryption3\n")); - break; - - default: - DBGLOG(RSN, WARN, ("Unacceptible encryption status: %d\n", - *(P_ENUM_PARAM_ENCRYPTION_STATUS_T)pvSetBuffer)); - - rStatus = WLAN_STATUS_NOT_SUPPORTED; - } - - if (rStatus == WLAN_STATUS_SUCCESS) { - /* Save the new encryption status. */ - prAdapter->rWifiVar.rConnSettings.eEncStatus = - *(P_ENUM_PARAM_ENCRYPTION_STATUS_T)pvSetBuffer; - } - - return rStatus; -} /* wlanoidSetEncryptionStatus */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to test the driver. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_INVALID_DATA -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetTest ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_802_11_TEST_T prTest; - PVOID pvTestData; - PVOID pvStatusBuffer; - UINT_32 u4StatusBufferSize; - - DEBUGFUNC("wlanoidSetTest"); - - ASSERT(prAdapter); - - ASSERT(pu4SetInfoLen); - ASSERT(pvSetBuffer); - - *pu4SetInfoLen = u4SetBufferLen; - - prTest = (P_PARAM_802_11_TEST_T)pvSetBuffer; - - DBGLOG(REQ, TRACE, ("Test - Type %ld\n", prTest->u4Type)); - - switch (prTest->u4Type) { - case 1: /* Type 1: generate an authentication event */ - pvTestData = (PVOID)&prTest->u.AuthenticationEvent; - pvStatusBuffer = (PVOID)prAdapter->aucIndicationEventBuffer; - u4StatusBufferSize = prTest->u4Length - 8; - break; - - case 2: /* Type 2: generate an RSSI status indication */ - pvTestData = (PVOID)&prTest->u.RssiTrigger; - pvStatusBuffer = (PVOID)&prAdapter->rWlanInfo.rCurrBssId.rRssi; - u4StatusBufferSize = sizeof(PARAM_RSSI); - break; - - default: - return WLAN_STATUS_INVALID_DATA; - } - - ASSERT(u4StatusBufferSize <= 180); - if (u4StatusBufferSize > 180) { - return WLAN_STATUS_INVALID_LENGTH; - } - - /* Get the contents of the StatusBuffer from the test structure. */ - kalMemCopy(pvStatusBuffer, pvTestData, u4StatusBufferSize); - - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_SPECIFIC_INDICATION, - pvStatusBuffer, - u4StatusBufferSize); - - return WLAN_STATUS_SUCCESS; -} /* wlanoidSetTest */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the driver's WPA2 status. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryCapability ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - P_PARAM_CAPABILITY_T prCap; - P_PARAM_AUTH_ENCRYPTION_T prAuthenticationEncryptionSupported; - - DEBUGFUNC("wlanoidQueryCapability"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = 4 * sizeof(UINT_32) + 14 * sizeof(PARAM_AUTH_ENCRYPTION_T); - - if (u4QueryBufferLen < *pu4QueryInfoLen) { - return WLAN_STATUS_INVALID_LENGTH; - } - - prCap = (P_PARAM_CAPABILITY_T)pvQueryBuffer; - - prCap->u4Length = *pu4QueryInfoLen; - prCap->u4Version = 2; /* WPA2 */ - prCap->u4NoOfPMKIDs = CFG_MAX_PMKID_CACHE; - prCap->u4NoOfAuthEncryptPairsSupported = 14; - - prAuthenticationEncryptionSupported = - &prCap->arAuthenticationEncryptionSupported[0]; - - // fill 14 entries of supported settings - prAuthenticationEncryptionSupported[0].eAuthModeSupported = - AUTH_MODE_OPEN; - - prAuthenticationEncryptionSupported[0].eEncryptStatusSupported = - ENUM_ENCRYPTION_DISABLED; - - prAuthenticationEncryptionSupported[1].eAuthModeSupported = - AUTH_MODE_OPEN; - prAuthenticationEncryptionSupported[1].eEncryptStatusSupported = - ENUM_ENCRYPTION1_ENABLED; - - prAuthenticationEncryptionSupported[2].eAuthModeSupported = - AUTH_MODE_SHARED; - prAuthenticationEncryptionSupported[2].eEncryptStatusSupported = - ENUM_ENCRYPTION_DISABLED; - - prAuthenticationEncryptionSupported[3].eAuthModeSupported = - AUTH_MODE_SHARED; - prAuthenticationEncryptionSupported[3].eEncryptStatusSupported = - ENUM_ENCRYPTION1_ENABLED; - - prAuthenticationEncryptionSupported[4].eAuthModeSupported = - AUTH_MODE_WPA; - prAuthenticationEncryptionSupported[4].eEncryptStatusSupported = - ENUM_ENCRYPTION2_ENABLED; - - prAuthenticationEncryptionSupported[5].eAuthModeSupported = - AUTH_MODE_WPA; - prAuthenticationEncryptionSupported[5].eEncryptStatusSupported = - ENUM_ENCRYPTION3_ENABLED; - - prAuthenticationEncryptionSupported[6].eAuthModeSupported = - AUTH_MODE_WPA_PSK; - prAuthenticationEncryptionSupported[6].eEncryptStatusSupported = - ENUM_ENCRYPTION2_ENABLED; - - prAuthenticationEncryptionSupported[7].eAuthModeSupported = - AUTH_MODE_WPA_PSK; - prAuthenticationEncryptionSupported[7].eEncryptStatusSupported = - ENUM_ENCRYPTION3_ENABLED; - - prAuthenticationEncryptionSupported[8].eAuthModeSupported = - AUTH_MODE_WPA_NONE; - prAuthenticationEncryptionSupported[8].eEncryptStatusSupported = - ENUM_ENCRYPTION2_ENABLED; - - prAuthenticationEncryptionSupported[9].eAuthModeSupported = - AUTH_MODE_WPA_NONE; - prAuthenticationEncryptionSupported[9].eEncryptStatusSupported = - ENUM_ENCRYPTION3_ENABLED; - - prAuthenticationEncryptionSupported[10].eAuthModeSupported = - AUTH_MODE_WPA2; - prAuthenticationEncryptionSupported[10].eEncryptStatusSupported = - ENUM_ENCRYPTION2_ENABLED; - - prAuthenticationEncryptionSupported[11].eAuthModeSupported = - AUTH_MODE_WPA2; - prAuthenticationEncryptionSupported[11].eEncryptStatusSupported = - ENUM_ENCRYPTION3_ENABLED; - - prAuthenticationEncryptionSupported[12].eAuthModeSupported = - AUTH_MODE_WPA2_PSK; - prAuthenticationEncryptionSupported[12].eEncryptStatusSupported = - ENUM_ENCRYPTION2_ENABLED; - - prAuthenticationEncryptionSupported[13].eAuthModeSupported = - AUTH_MODE_WPA2_PSK; - prAuthenticationEncryptionSupported[13].eEncryptStatusSupported = - ENUM_ENCRYPTION3_ENABLED; - - return WLAN_STATUS_SUCCESS; - -} /* wlanoidQueryCapability */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the PMKID in the PMK cache. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryPmkid ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - UINT_32 i; - P_PARAM_PMKID_T prPmkid; - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecBssInfo; - - DEBUGFUNC("wlanoidQueryPmkid"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - prAisSpecBssInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - - *pu4QueryInfoLen = OFFSET_OF(PARAM_PMKID_T, arBSSIDInfo) + - prAisSpecBssInfo->u4PmkidCacheCount * sizeof(PARAM_BSSID_INFO_T); - - if (u4QueryBufferLen < *pu4QueryInfoLen) { - return WLAN_STATUS_INVALID_LENGTH; - } - - prPmkid = (P_PARAM_PMKID_T)pvQueryBuffer; - - prPmkid->u4Length = *pu4QueryInfoLen; - prPmkid->u4BSSIDInfoCount = prAisSpecBssInfo->u4PmkidCacheCount; - - for (i = 0; i < prAisSpecBssInfo->u4PmkidCacheCount; i++) { - kalMemCopy(prPmkid->arBSSIDInfo[i].arBSSID, - prAisSpecBssInfo->arPmkidCache[i].rBssidInfo.arBSSID, - sizeof(PARAM_MAC_ADDRESS)); - kalMemCopy(prPmkid->arBSSIDInfo[i].arPMKID, - prAisSpecBssInfo->arPmkidCache[i].rBssidInfo.arPMKID, - sizeof(PARAM_PMKID_VALUE)); - } - - return WLAN_STATUS_SUCCESS; - -} /* wlanoidQueryPmkid */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set the PMKID to the PMK cache in the driver. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -* \retval WLAN_STATUS_INVALID_DATA -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetPmkid ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - UINT_32 i, j; - P_PARAM_PMKID_T prPmkid; - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecBssInfo; - - DEBUGFUNC("wlanoidSetPmkid"); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = u4SetBufferLen; - - /* It's possibble BSSIDInfoCount is zero, because OS wishes to clean PMKID */ - if (u4SetBufferLen < OFFSET_OF(PARAM_PMKID_T, arBSSIDInfo)) { - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - ASSERT(pvSetBuffer); - prPmkid = (P_PARAM_PMKID_T)pvSetBuffer; - - if (u4SetBufferLen < - ((prPmkid->u4BSSIDInfoCount * sizeof(PARAM_BSSID_INFO_T)) + - OFFSET_OF(PARAM_PMKID_T, arBSSIDInfo))) { - return WLAN_STATUS_INVALID_DATA; - } - - if (prPmkid->u4BSSIDInfoCount > CFG_MAX_PMKID_CACHE) { - return WLAN_STATUS_INVALID_DATA; - } - - DBGLOG(REQ, INFO, ("Count %lu\n", prPmkid->u4BSSIDInfoCount)); - - prAisSpecBssInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - - /* This OID replace everything in the PMKID cache. */ - if (prPmkid->u4BSSIDInfoCount == 0) { - prAisSpecBssInfo->u4PmkidCacheCount = 0; - kalMemZero(prAisSpecBssInfo->arPmkidCache, sizeof(PMKID_ENTRY_T) * CFG_MAX_PMKID_CACHE); - } - if ((prAisSpecBssInfo->u4PmkidCacheCount + prPmkid->u4BSSIDInfoCount > CFG_MAX_PMKID_CACHE)) { - prAisSpecBssInfo->u4PmkidCacheCount = 0; - kalMemZero(prAisSpecBssInfo->arPmkidCache, sizeof(PMKID_ENTRY_T) * CFG_MAX_PMKID_CACHE); - } - - /* - The driver can only clear its PMKID cache whenever it make a media disconnect - indication. Otherwise, it must change the PMKID cache only when set through this OID. - */ -#if CFG_RSN_MIGRATION - for (i = 0; i < prPmkid->u4BSSIDInfoCount; i++) { - /* Search for desired BSSID. If desired BSSID is found, - then set the PMKID */ - if (!rsnSearchPmkidEntry(prAdapter, - (PUINT_8)prPmkid->arBSSIDInfo[i].arBSSID, - &j)) { - /* No entry found for the specified BSSID, so add one entry */ - if (prAisSpecBssInfo->u4PmkidCacheCount < CFG_MAX_PMKID_CACHE - 1) { - j = prAisSpecBssInfo->u4PmkidCacheCount; - kalMemCopy(prAisSpecBssInfo->arPmkidCache[j].rBssidInfo.arBSSID, - prPmkid->arBSSIDInfo[i].arBSSID, - sizeof(PARAM_MAC_ADDRESS)); - prAisSpecBssInfo->u4PmkidCacheCount++; - } - else { - j = CFG_MAX_PMKID_CACHE; - } - } - - if (j < CFG_MAX_PMKID_CACHE) { - kalMemCopy(prAisSpecBssInfo->arPmkidCache[j].rBssidInfo.arPMKID, - prPmkid->arBSSIDInfo[i].arPMKID, - sizeof(PARAM_PMKID_VALUE)); - DBGLOG(RSN, TRACE, ("Add BSSID "MACSTR" idx=%d PMKID value "MACSTR"\n", - MAC2STR(prAisSpecBssInfo->arPmkidCache[j].rBssidInfo.arBSSID),j, MAC2STR(prAisSpecBssInfo->arPmkidCache[j].rBssidInfo.arPMKID))); - prAisSpecBssInfo->arPmkidCache[j].fgPmkidExist = TRUE; - } - } -#endif - return WLAN_STATUS_SUCCESS; - -} /* wlanoidSetPmkid */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the set of supported data rates that -* the radio is capable of running -* -* \param[in] prAdapter Pointer to the Adapter structure -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query -* \param[in] u4QueryBufferLen The length of the query buffer -* \param[out] pu4QueryInfoLen If the call is successful, returns the number -* of bytes written into the query buffer. If the -* call failed due to invalid length of the query -* buffer, returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQuerySupportedRates ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - PARAM_RATES eRate = { - // BSSBasicRateSet for 802.11n Non-HT rates - 0x8C, // 6M - 0x92, // 9M - 0x98, // 12M - 0xA4, // 18M - 0xB0, // 24M - 0xC8, // 36M - 0xE0, // 48M - 0xEC // 54M - }; - - DEBUGFUNC("wlanoidQuerySupportedRates"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(PARAM_RATES_EX); - - if (u4QueryBufferLen < *pu4QueryInfoLen ) { - DBGLOG(REQ, WARN, ("Invalid length %ld\n", u4QueryBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - - kalMemCopy(pvQueryBuffer, - (PVOID)&eRate, - sizeof(PARAM_RATES)); - - return WLAN_STATUS_SUCCESS; -} /* end of wlanoidQuerySupportedRates() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query current desired rates. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryDesiredRates ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryDesiredRates"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(PARAM_RATES_EX); - - if (u4QueryBufferLen < *pu4QueryInfoLen ) { - DBGLOG(REQ, WARN, ("Invalid length %ld\n", u4QueryBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - - kalMemCopy(pvQueryBuffer, - (PVOID)&(prAdapter->rWlanInfo.eDesiredRates), - sizeof(PARAM_RATES)); - - return WLAN_STATUS_SUCCESS; - -} /* end of wlanoidQueryDesiredRates() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to Set the desired rates. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_INVALID_DATA -* \retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetDesiredRates ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - UINT_32 i; - DEBUGFUNC("wlanoidSetDesiredRates"); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - if (u4SetBufferLen < sizeof(PARAM_RATES)) { - DBGLOG(REQ, WARN, ("Invalid length %ld\n", u4SetBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - - *pu4SetInfoLen = sizeof(PARAM_RATES); - - if (u4SetBufferLen < sizeof(PARAM_RATES)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - kalMemCopy((PVOID)&(prAdapter->rWlanInfo.eDesiredRates), - pvSetBuffer, - sizeof(PARAM_RATES)); - - prAdapter->rWlanInfo.eLinkAttr.ucDesiredRateLen = PARAM_MAX_LEN_RATES; - for (i = 0 ; i < PARAM_MAX_LEN_RATES ; i++) { - prAdapter->rWlanInfo.eLinkAttr.u2DesiredRate[i] = - (UINT_16) (prAdapter->rWlanInfo.eDesiredRates[i]); - } - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_LINK_ATTRIB, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_LINK_ATTRIB), - (PUINT_8)&(prAdapter->rWlanInfo.eLinkAttr), - pvSetBuffer, - u4SetBufferLen - ); - -} /* end of wlanoidSetDesiredRates() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the maximum frame size in bytes, -* not including the header. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the -* call failed due to invalid length of the query -* buffer, returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryMaxFrameSize ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryMaxFrameSize"); - - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - - if (u4QueryBufferLen < sizeof(UINT_32)) { - *pu4QueryInfoLen = sizeof(UINT_32); - return WLAN_STATUS_INVALID_LENGTH; - } - - *(PUINT_32)pvQueryBuffer = ETHERNET_MAX_PKT_SZ - ETHERNET_HEADER_SZ; - *pu4QueryInfoLen = sizeof(UINT_32); - - return WLAN_STATUS_SUCCESS; -} /* wlanoidQueryMaxFrameSize */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the maximum total packet length -* in bytes. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryMaxTotalSize ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryMaxTotalSize"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - if (u4QueryBufferLen < sizeof(UINT_32)) { - *pu4QueryInfoLen = sizeof(UINT_32); - return WLAN_STATUS_INVALID_LENGTH; - } - - *(PUINT_32)pvQueryBuffer = ETHERNET_MAX_PKT_SZ; - *pu4QueryInfoLen = sizeof(UINT_32); - - return WLAN_STATUS_SUCCESS; -} /* wlanoidQueryMaxTotalSize */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the vendor ID of the NIC. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryVendorId ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ -#if DBG - PUINT_8 cp; -#endif - DEBUGFUNC("wlanoidQueryVendorId"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - if (u4QueryBufferLen < sizeof(UINT_32)) { - *pu4QueryInfoLen = sizeof(UINT_32); - return WLAN_STATUS_INVALID_LENGTH; - } - - kalMemCopy(pvQueryBuffer, prAdapter->aucMacAddress, 3); - *((PUINT_8)pvQueryBuffer + 3) = 1; - *pu4QueryInfoLen = sizeof(UINT_32); - -#if DBG - cp = (PUINT_8)pvQueryBuffer; - DBGLOG(REQ, LOUD, ("Vendor ID=%02x-%02x-%02x-%02x\n", cp[0], cp[1], cp[2], cp[3])); -#endif - - return WLAN_STATUS_SUCCESS; -} /* wlanoidQueryVendorId */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the current RSSI value. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call failed due to invalid length of -* the query buffer, returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -* \retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryRssi ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryRssi"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(PARAM_RSSI); - - /* Check for query buffer length */ - if (u4QueryBufferLen < *pu4QueryInfoLen) { - DBGLOG(REQ, WARN, ("Too short length %ld\n", u4QueryBufferLen)); - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - if (kalGetMediaStateIndicated(prAdapter->prGlueInfo) == PARAM_MEDIA_STATE_DISCONNECTED) { - return WLAN_STATUS_ADAPTER_NOT_READY; - } - else if (prAdapter->fgIsLinkQualityValid == TRUE && - (kalGetTimeTick() - prAdapter->rLinkQualityUpdateTime) <= CFG_LINK_QUALITY_VALID_PERIOD) { - PARAM_RSSI rRssi; - - rRssi = (PARAM_RSSI)prAdapter->rLinkQuality.cRssi; // ranged from (-128 ~ 30) in unit of dBm - if(rRssi > PARAM_WHQL_RSSI_MAX_DBM) - rRssi = PARAM_WHQL_RSSI_MAX_DBM; - else if(rRssi < PARAM_WHQL_RSSI_MIN_DBM) - rRssi = PARAM_WHQL_RSSI_MIN_DBM; - - kalMemCopy(pvQueryBuffer, &rRssi, sizeof(PARAM_RSSI)); - return WLAN_STATUS_SUCCESS; - } - - #ifdef LINUX - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_GET_LINK_QUALITY, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryLinkQuality, - nicOidCmdTimeoutCommon, - *pu4QueryInfoLen, - pvQueryBuffer, - pvQueryBuffer, - u4QueryBufferLen - ); - #else - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_GET_LINK_QUALITY, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryLinkQuality, - nicOidCmdTimeoutCommon, - 0, - NULL, - pvQueryBuffer, - u4QueryBufferLen - ); - - #endif -} /* end of wlanoidQueryRssi() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the current RSSI trigger value. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call failed due to invalid length of -* the query buffer, returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryRssiTrigger ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryRssiTrigger"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - - if(prAdapter->rWlanInfo.eRssiTriggerType == ENUM_RSSI_TRIGGER_NONE) - return WLAN_STATUS_ADAPTER_NOT_READY; - - *pu4QueryInfoLen = sizeof(PARAM_RSSI); - - /* Check for query buffer length */ - if (u4QueryBufferLen < *pu4QueryInfoLen) { - DBGLOG(REQ, WARN, ("Too short length %ld\n", u4QueryBufferLen)); - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - *(PARAM_RSSI *) pvQueryBuffer = prAdapter->rWlanInfo.rRssiTriggerValue; - DBGLOG(REQ, INFO, ("RSSI trigger: %ld dBm\n", *(PARAM_RSSI *) pvQueryBuffer)); - - return WLAN_STATUS_SUCCESS; -} /* wlanoidQueryRssiTrigger */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set a trigger value of the RSSI event. -* -* \param[in] prAdapter Pointer to the Adapter structure -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns the -* amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetRssiTrigger ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - PARAM_RSSI rRssiTriggerValue; - DEBUGFUNC("wlanoidSetRssiTrigger"); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - - *pu4SetInfoLen = sizeof(PARAM_RSSI); - rRssiTriggerValue = *(PARAM_RSSI *) pvSetBuffer; - - if(rRssiTriggerValue > PARAM_WHQL_RSSI_MAX_DBM - || rRssiTriggerValue < PARAM_WHQL_RSSI_MIN_DBM) - return - - /* Save the RSSI trigger value to the Adapter structure */ - prAdapter->rWlanInfo.rRssiTriggerValue = rRssiTriggerValue; - - /* If the RSSI trigger value is equal to the current RSSI value, the - * indication triggers immediately. We need to indicate the protocol - * that an RSSI status indication event triggers. */ - if (rRssiTriggerValue == (PARAM_RSSI)(prAdapter->rLinkQuality.cRssi)) { - prAdapter->rWlanInfo.eRssiTriggerType = ENUM_RSSI_TRIGGER_TRIGGERED; - - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_SPECIFIC_INDICATION, - (PVOID) &prAdapter->rWlanInfo.rRssiTriggerValue, sizeof(PARAM_RSSI)); - } - else if(rRssiTriggerValue < (PARAM_RSSI)(prAdapter->rLinkQuality.cRssi)) - prAdapter->rWlanInfo.eRssiTriggerType = ENUM_RSSI_TRIGGER_GREATER; - else if(rRssiTriggerValue > (PARAM_RSSI)(prAdapter->rLinkQuality.cRssi)) - prAdapter->rWlanInfo.eRssiTriggerType = ENUM_RSSI_TRIGGER_LESS; - - return WLAN_STATUS_SUCCESS; -} /* wlanoidSetRssiTrigger */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set a suggested value for the number of -* bytes of received packet data that will be indicated to the protocol -* driver. We just accept the set and ignore this value. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetCurrentLookahead ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - DEBUGFUNC("wlanoidSetCurrentLookahead"); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - if (u4SetBufferLen < sizeof(UINT_32)) { - *pu4SetInfoLen = sizeof(UINT_32); - return WLAN_STATUS_INVALID_LENGTH; - } - - *pu4SetInfoLen = sizeof(UINT_32); - return WLAN_STATUS_SUCCESS; -} /* wlanoidSetCurrentLookahead */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the number of frames that the driver -* receives but does not indicate to the protocols due to errors. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuf A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryRcvError ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryRcvError"); - DBGLOG(REQ, LOUD, ("\n")); - - ASSERT(prAdapter); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in query receive error! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - *pu4QueryInfoLen = sizeof(UINT_32); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - else if (u4QueryBufferLen < sizeof(UINT_32) - || (u4QueryBufferLen > sizeof(UINT_32) && u4QueryBufferLen < sizeof(UINT_64))) { - *pu4QueryInfoLen = sizeof(UINT_64); - return WLAN_STATUS_INVALID_LENGTH; - } - -#if CFG_ENABLE_STATISTICS_BUFFERING - if(IsBufferedStatisticsUsable(prAdapter) == TRUE) { - // @FIXME, RX_ERROR_DROP_COUNT/RX_FIFO_FULL_DROP_COUNT is not calculated - if(u4QueryBufferLen == sizeof(UINT_32)) { - *pu4QueryInfoLen = sizeof(UINT_32); - *(PUINT_32) pvQueryBuffer = (UINT_32) prAdapter->rStatStruct.rFCSErrorCount.QuadPart; - } - else { - *pu4QueryInfoLen = sizeof(UINT_64); - *(PUINT_64) pvQueryBuffer = (UINT_64) prAdapter->rStatStruct.rFCSErrorCount.QuadPart; - } - - return WLAN_STATUS_SUCCESS; - } - else -#endif - { - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_GET_STATISTICS, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryRecvError, - nicOidCmdTimeoutCommon, - 0, - NULL, - pvQueryBuffer, - u4QueryBufferLen - ); - } -} /* wlanoidQueryRcvError */ - - -/*----------------------------------------------------------------------------*/ -/*! \brief This routine is called to query the number of frames that the NIC -* cannot receive due to lack of NIC receive buffer space. -* -* \param[in] pvAdapter Pointer to the Adapter structure -* \param[in] pvQueryBuf A pointer to the buffer that holds the result of the -* query buffer -* \param[in] u4QueryBufLen The length of the query buffer -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS If success; -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryRcvNoBuffer ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryRcvNoBuffer"); - DBGLOG(REQ, LOUD, ("\n")); - - ASSERT(prAdapter); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in query receive error! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - *pu4QueryInfoLen = sizeof(UINT_32); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - else if (u4QueryBufferLen < sizeof(UINT_32) - || (u4QueryBufferLen > sizeof(UINT_32) && u4QueryBufferLen < sizeof(UINT_64))) { - *pu4QueryInfoLen = sizeof(UINT_64); - return WLAN_STATUS_INVALID_LENGTH; - } - -#if CFG_ENABLE_STATISTICS_BUFFERING - if(IsBufferedStatisticsUsable(prAdapter) == TRUE) { - if(u4QueryBufferLen == sizeof(UINT_32)) { - *pu4QueryInfoLen = sizeof(UINT_32); - *(PUINT_32) pvQueryBuffer = (UINT_32) 0; //@FIXME - } - else { - *pu4QueryInfoLen = sizeof(UINT_64); - *(PUINT_64) pvQueryBuffer = (UINT_64) 0; //@FIXME - } - - return WLAN_STATUS_SUCCESS; - } - else -#endif - { - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_GET_STATISTICS, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryRecvNoBuffer, - nicOidCmdTimeoutCommon, - 0, - NULL, - pvQueryBuffer, - u4QueryBufferLen - ); - } -} /* wlanoidQueryRcvNoBuffer */ - - -/*----------------------------------------------------------------------------*/ -/*! \brief This routine is called to query the number of frames that the NIC -* received and it is CRC error. -* -* \param[in] pvAdapter Pointer to the Adapter structure -* \param[in] pvQueryBuf A pointer to the buffer that holds the result of the -* query buffer -* \param[in] u4QueryBufLen The length of the query buffer -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS If success; -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryRcvCrcError ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryRcvCrcError"); - DBGLOG(REQ, LOUD, ("\n")); - - ASSERT(prAdapter); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in query receive error! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - *pu4QueryInfoLen = sizeof(UINT_32); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - else if (u4QueryBufferLen < sizeof(UINT_32) - || (u4QueryBufferLen > sizeof(UINT_32) && u4QueryBufferLen < sizeof(UINT_64))) { - *pu4QueryInfoLen = sizeof(UINT_64); - return WLAN_STATUS_INVALID_LENGTH; - } -#if CFG_ENABLE_STATISTICS_BUFFERING - if(IsBufferedStatisticsUsable(prAdapter) == TRUE) { - if(u4QueryBufferLen == sizeof(UINT_32)) { - *pu4QueryInfoLen = sizeof(UINT_32); - *(PUINT_32) pvQueryBuffer = (UINT_32) prAdapter->rStatStruct.rFCSErrorCount.QuadPart; - } - else { - *pu4QueryInfoLen = sizeof(UINT_64); - *(PUINT_64) pvQueryBuffer = (UINT_64) prAdapter->rStatStruct.rFCSErrorCount.QuadPart; - } - - return WLAN_STATUS_SUCCESS; - } - else -#endif - { - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_GET_STATISTICS, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryRecvCrcError, - nicOidCmdTimeoutCommon, - 0, - NULL, - pvQueryBuffer, - u4QueryBufferLen - ); - } -} /* wlanoidQueryRcvCrcError */ - - -/*----------------------------------------------------------------------------*/ -/*! \brief This routine is called to query the current 802.11 statistics. -* -* \param[in] pvAdapter Pointer to the Adapter structure -* \param[in] pvQueryBuf A pointer to the buffer that holds the result of the -* query buffer -* \param[in] u4QueryBufLen The length of the query buffer -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryStatistics ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryStatistics"); - DBGLOG(REQ, LOUD, ("\n")); - - ASSERT(prAdapter); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - *pu4QueryInfoLen = sizeof(PARAM_802_11_STATISTICS_STRUCT_T); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in query receive error! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - *pu4QueryInfoLen = sizeof(UINT_32); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - else if (u4QueryBufferLen < sizeof(PARAM_802_11_STATISTICS_STRUCT_T)) { - DBGLOG(REQ, WARN, ("Too short length %ld\n", u4QueryBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - -#if CFG_ENABLE_STATISTICS_BUFFERING - if(IsBufferedStatisticsUsable(prAdapter) == TRUE) { - P_PARAM_802_11_STATISTICS_STRUCT_T prStatistics; - - *pu4QueryInfoLen = sizeof(PARAM_802_11_STATISTICS_STRUCT_T); - prStatistics = (P_PARAM_802_11_STATISTICS_STRUCT_T) pvQueryBuffer; - - prStatistics->u4Length = sizeof(PARAM_802_11_STATISTICS_STRUCT_T); - prStatistics->rTransmittedFragmentCount - = prAdapter->rStatStruct.rTransmittedFragmentCount; - prStatistics->rMulticastTransmittedFrameCount - = prAdapter->rStatStruct.rMulticastTransmittedFrameCount; - prStatistics->rFailedCount - = prAdapter->rStatStruct.rFailedCount; - prStatistics->rRetryCount - = prAdapter->rStatStruct.rRetryCount; - prStatistics->rMultipleRetryCount - = prAdapter->rStatStruct.rMultipleRetryCount; - prStatistics->rRTSSuccessCount - = prAdapter->rStatStruct.rRTSSuccessCount; - prStatistics->rRTSFailureCount - = prAdapter->rStatStruct.rRTSFailureCount; - prStatistics->rACKFailureCount - = prAdapter->rStatStruct.rACKFailureCount; - prStatistics->rFrameDuplicateCount - = prAdapter->rStatStruct.rFrameDuplicateCount; - prStatistics->rReceivedFragmentCount - = prAdapter->rStatStruct.rReceivedFragmentCount; - prStatistics->rMulticastReceivedFrameCount - = prAdapter->rStatStruct.rMulticastReceivedFrameCount; - prStatistics->rFCSErrorCount - = prAdapter->rStatStruct.rFCSErrorCount; - prStatistics->rTKIPLocalMICFailures.QuadPart - = 0; - prStatistics->rTKIPICVErrors.QuadPart - = 0; - prStatistics->rTKIPCounterMeasuresInvoked.QuadPart - = 0; - prStatistics->rTKIPReplays.QuadPart - = 0; - prStatistics->rCCMPFormatErrors.QuadPart - = 0; - prStatistics->rCCMPReplays.QuadPart - = 0; - prStatistics->rCCMPDecryptErrors.QuadPart - = 0; - prStatistics->rFourWayHandshakeFailures.QuadPart - = 0; - prStatistics->rWEPUndecryptableCount.QuadPart - = 0; - prStatistics->rWEPICVErrorCount.QuadPart - = 0; - prStatistics->rDecryptSuccessCount.QuadPart - = 0; - prStatistics->rDecryptFailureCount.QuadPart - = 0; - - return WLAN_STATUS_SUCCESS; - } - else -#endif - { - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_GET_STATISTICS, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryStatistics, - nicOidCmdTimeoutCommon, - 0, - NULL, - pvQueryBuffer, - u4QueryBufferLen - ); - } -} /* wlanoidQueryStatistics */ - - -/*----------------------------------------------------------------------------*/ -/*! \brief This routine is called to query current media streaming status. -* -* \param[in] pvAdapter Pointer to the Adapter structure -* \param[in] pvQueryBuf A pointer to the buffer that holds the result of the -* query buffer -* \param[in] u4QueryBufLen The length of the query buffer -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryMediaStreamMode( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryMediaStreamMode"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(ENUM_MEDIA_STREAM_MODE); - - if (u4QueryBufferLen < *pu4QueryInfoLen ) { - DBGLOG(REQ, WARN, ("Invalid length %ld\n", u4QueryBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - - *(P_ENUM_MEDIA_STREAM_MODE)pvQueryBuffer = - prAdapter->rWlanInfo.eLinkAttr.ucMediaStreamMode == 0 ? - ENUM_MEDIA_STREAM_OFF : ENUM_MEDIA_STREAM_ON; - - return WLAN_STATUS_SUCCESS; - -} /* wlanoidQueryMediaStreamMode */ - -/*----------------------------------------------------------------------------*/ -/*! \brief This routine is called to enter media streaming mode or exit media streaming mode -* -* \param[in] pvAdapter Pointer to the Adapter structure -* \param[in] pvQueryBuf A pointer to the buffer that holds the result of the -* query buffer -* \param[in] u4QueryBufLen The length of the query buffer -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetMediaStreamMode( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - ENUM_MEDIA_STREAM_MODE eStreamMode; - - DEBUGFUNC("wlanoidSetMediaStreamMode"); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - if (u4SetBufferLen < sizeof(ENUM_MEDIA_STREAM_MODE)) { - DBGLOG(REQ, WARN, ("Invalid length %ld\n", u4SetBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - - *pu4SetInfoLen = sizeof(ENUM_MEDIA_STREAM_MODE); - - eStreamMode = *(P_ENUM_MEDIA_STREAM_MODE)pvSetBuffer; - - if(eStreamMode == ENUM_MEDIA_STREAM_OFF) - prAdapter->rWlanInfo.eLinkAttr.ucMediaStreamMode = 0; - else - prAdapter->rWlanInfo.eLinkAttr.ucMediaStreamMode = 1; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_LINK_ATTRIB, - TRUE, - FALSE, - TRUE, - nicCmdEventSetMediaStreamMode, - nicOidCmdTimeoutCommon, - sizeof(CMD_LINK_ATTRIB), - (PUINT_8)&(prAdapter->rWlanInfo.eLinkAttr), - pvSetBuffer, - u4SetBufferLen - ); -} /* wlanoidSetMediaStreamMode */ - -/*----------------------------------------------------------------------------*/ -/*! \brief This routine is called to query the permanent MAC address of the NIC. -* -* \param[in] pvAdapter Pointer to the Adapter structure -* \param[in] pvQueryBuf A pointer to the buffer that holds the result of the -* query buffer -* \param[in] u4QueryBufLen The length of the query buffer -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryPermanentAddr ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryPermanentAddr"); - DBGLOG(INIT, LOUD, ("\n")); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - if (u4QueryBufferLen < MAC_ADDR_LEN) { - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - COPY_MAC_ADDR(pvQueryBuffer, prAdapter->rWifiVar.aucPermanentAddress); - *pu4QueryInfoLen = MAC_ADDR_LEN; - - return WLAN_STATUS_SUCCESS; -} /* wlanoidQueryPermanentAddr */ - - -/*----------------------------------------------------------------------------*/ -/*! \brief This routine is called to query the MAC address the NIC is currently using. -* -* \param[in] pvAdapter Pointer to the Adapter structure -* \param[in] pvQueryBuf A pointer to the buffer that holds the result of the -* query buffer -* \param[in] u4QueryBufLen The length of the query buffer -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryCurrentAddr ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - CMD_BASIC_CONFIG rCmdBasicConfig; - - DEBUGFUNC("wlanoidQueryCurrentAddr"); - DBGLOG(INIT, LOUD, ("\n")); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - if (u4QueryBufferLen < MAC_ADDR_LEN) { - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - kalMemZero(&rCmdBasicConfig, sizeof(CMD_BASIC_CONFIG)); - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_BASIC_CONFIG, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryAddress, - nicOidCmdTimeoutCommon, - sizeof(CMD_BASIC_CONFIG), - (PUINT_8)&rCmdBasicConfig, - pvQueryBuffer, - u4QueryBufferLen - ); - -} /* wlanoidQueryCurrentAddr */ - - -/*----------------------------------------------------------------------------*/ -/*! \brief This routine is called to query NIC link speed. -* -* \param[in] pvAdapter Pointer to the Adapter structure -* \param[in] pvQueryBuf A pointer to the buffer that holds the result of the -* query buffer -* \param[in] u4QueryBufLen The length of the query buffer -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryLinkSpeed( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryLinkSpeed"); - - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(UINT_32); - - if (u4QueryBufferLen < sizeof(UINT_32)) { - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - if (kalGetMediaStateIndicated(prAdapter->prGlueInfo) != PARAM_MEDIA_STATE_CONNECTED) { - *(PUINT_32)pvQueryBuffer = 10000; // change to unit of 100bps - return WLAN_STATUS_SUCCESS; - } - else if (prAdapter->fgIsLinkRateValid == TRUE && - (kalGetTimeTick() - prAdapter->rLinkRateUpdateTime) <= CFG_LINK_QUALITY_VALID_PERIOD) { - *(PUINT_32)pvQueryBuffer = prAdapter->rLinkQuality.u2LinkSpeed * 5000; // change to unit of 100bps - return WLAN_STATUS_SUCCESS; - } - else { - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_GET_LINK_QUALITY, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryLinkSpeed, - nicOidCmdTimeoutCommon, - 0, - NULL, - pvQueryBuffer, - u4QueryBufferLen - ); - } -} /* end of wlanoidQueryLinkSpeed() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query MCR value. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuf A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryMcrRead ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - P_PARAM_CUSTOM_MCR_RW_STRUC_T prMcrRdInfo; - CMD_ACCESS_REG rCmdAccessReg; - - DEBUGFUNC("wlanoidQueryMcrRead"); - DBGLOG(INIT, LOUD,("\n")); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(PARAM_CUSTOM_MCR_RW_STRUC_T); - - if (u4QueryBufferLen < sizeof(PARAM_CUSTOM_MCR_RW_STRUC_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - prMcrRdInfo = (P_PARAM_CUSTOM_MCR_RW_STRUC_T)pvQueryBuffer; - - /* 0x9000 - 0x9EFF reserved for FW */ -#if CFG_SUPPORT_SWCR - if((prMcrRdInfo->u4McrOffset >>16) == 0x9F00) { - swCrReadWriteCmd(prAdapter, - SWCR_READ, - (UINT_16) (prMcrRdInfo->u4McrOffset & BITS(0,15)), - &prMcrRdInfo->u4McrData); - return WLAN_STATUS_SUCCESS; - } -#endif /* CFG_SUPPORT_SWCR */ - - /* Check if access F/W Domain MCR (due to WiFiSYS is placed from 0x6000-0000*/ - if (prMcrRdInfo->u4McrOffset & 0xFFFF0000){ - // fill command - rCmdAccessReg.u4Address = prMcrRdInfo->u4McrOffset; - rCmdAccessReg.u4Data = 0; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_ACCESS_REG, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryMcrRead, - nicOidCmdTimeoutCommon, - sizeof(CMD_ACCESS_REG), - (PUINT_8)&rCmdAccessReg, - pvQueryBuffer, - u4QueryBufferLen - ); - } - else { - HAL_MCR_RD(prAdapter, - prMcrRdInfo->u4McrOffset & BITS(2,31), //address is in DWORD unit - &prMcrRdInfo->u4McrData); - - DBGLOG(INIT, TRACE, ("MCR Read: Offset = %#08lx, Data = %#08lx\n", - prMcrRdInfo->u4McrOffset, prMcrRdInfo->u4McrData)); - return WLAN_STATUS_SUCCESS; - } -} /* end of wlanoidQueryMcrRead() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to write MCR and enable specific function. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetMcrWrite ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_CUSTOM_MCR_RW_STRUC_T prMcrWrInfo; - CMD_ACCESS_REG rCmdAccessReg; - -#if CFG_STRESS_TEST_SUPPORT - P_AIS_FSM_INFO_T prAisFsmInfo; - P_BSS_INFO_T prBssInfo = &(prAdapter->rWifiVar.arBssInfo[(NETWORK_TYPE_AIS_INDEX)]); - P_STA_RECORD_T prStaRec = prBssInfo->prStaRecOfAP; - UINT_32 u4McrOffset, u4McrData; -#endif - - DEBUGFUNC("wlanoidSetMcrWrite"); - DBGLOG(INIT, LOUD,("\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_CUSTOM_MCR_RW_STRUC_T); - - if (u4SetBufferLen < sizeof(PARAM_CUSTOM_MCR_RW_STRUC_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - - prMcrWrInfo = (P_PARAM_CUSTOM_MCR_RW_STRUC_T)pvSetBuffer; - - /* 0x9000 - 0x9EFF reserved for FW */ - /* 0xFFFE reserved for FW */ - - // -- Puff Stress Test Begin -#if CFG_STRESS_TEST_SUPPORT - - // 0xFFFFFFFE for Control Rate - if (prMcrWrInfo->u4McrOffset == 0xFFFFFFFE){ - if(prMcrWrInfo->u4McrData < FIXED_RATE_NUM && prMcrWrInfo->u4McrData > 0){ - prAdapter->rWifiVar.eRateSetting = (ENUM_REGISTRY_FIXED_RATE_T)(prMcrWrInfo->u4McrData); - } - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_3); - DEBUGFUNC("[Stress Test]Complete Rate is Changed...\n"); - DBGLOG(INIT, TRACE, ("[Stress Test] Rate is Changed to index %d...\n", prAdapter->rWifiVar.eRateSetting)); - } - - // 0xFFFFFFFD for Switch Channel - else if (prMcrWrInfo->u4McrOffset == 0xFFFFFFFD){ - if(prMcrWrInfo->u4McrData <= 11 && prMcrWrInfo->u4McrData >= 1){ - prBssInfo->ucPrimaryChannel = prMcrWrInfo->u4McrData; - } - nicUpdateBss(prAdapter, prBssInfo->ucNetTypeIndex); - DBGLOG(INIT, TRACE, ("[Stress Test] Channel is switched to %d ...\n", prBssInfo->ucPrimaryChannel)); - - return WLAN_STATUS_SUCCESS; - } - - // 0xFFFFFFFFC for Control RF Band and SCO - else if(prMcrWrInfo->u4McrOffset == 0xFFFFFFFC){ - // Band - if(prMcrWrInfo->u4McrData & 0x80000000){ - //prBssInfo->eBand = BAND_5G; - //prBssInfo->ucPrimaryChannel = 52; // Bond to Channel 52 - } else { - prBssInfo->eBand = BAND_2G4; - prBssInfo->ucPrimaryChannel = 8; // Bond to Channel 6 - } - - // Bandwidth - if(prMcrWrInfo->u4McrData & 0x00010000){ - prStaRec->u2HtCapInfo |= HT_CAP_INFO_SUP_CHNL_WIDTH; - prStaRec->ucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - - if(prMcrWrInfo->u4McrData == 0x00010002){ - prBssInfo->eBssSCO = CHNL_EXT_SCB; // U20 - prBssInfo->ucPrimaryChannel += 2; - } else if (prMcrWrInfo->u4McrData == 0x00010001){ - prBssInfo->eBssSCO = CHNL_EXT_SCA; // L20 - prBssInfo->ucPrimaryChannel -= 2; - } else { - prBssInfo->eBssSCO = CHNL_EXT_SCA; // 40 - } - } - - if(prMcrWrInfo->u4McrData & 0x00000000){ - prStaRec->u2HtCapInfo &= ~HT_CAP_INFO_SUP_CHNL_WIDTH; - prBssInfo->eBssSCO = CHNL_EXT_SCN; - } - rlmBssInitForAPandIbss(prAdapter, prBssInfo); - } - - // 0xFFFFFFFB for HT Capability - else if (prMcrWrInfo->u4McrOffset == 0xFFFFFFFB){ - /* Enable HT Capability */ - if(prMcrWrInfo->u4McrData & 0x00000001){ - prStaRec->u2HtCapInfo |= HT_CAP_INFO_HT_GF; - DEBUGFUNC("[Stress Test]Enable HT capability...\n"); - }else{ - prStaRec->u2HtCapInfo &= (~HT_CAP_INFO_HT_GF); - DEBUGFUNC("[Stress Test]Disable HT capability...\n"); - } - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_3); - } - - // 0xFFFFFFFA for Enable Random Rx Reset - else if (prMcrWrInfo->u4McrOffset == 0xFFFFFFFA){ - rCmdAccessReg.u4Address = prMcrWrInfo->u4McrOffset; - rCmdAccessReg.u4Data = prMcrWrInfo->u4McrData; - - return wlanSendSetQueryCmd( - prAdapter, - CMD_ID_RANDOM_RX_RESET_EN, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_ACCESS_REG), - (PUINT_8)&rCmdAccessReg, - pvSetBuffer, - u4SetBufferLen - ); - } - - // 0xFFFFFFF9 for Disable Random Rx Reset - else if (prMcrWrInfo->u4McrOffset == 0xFFFFFFF9){ - rCmdAccessReg.u4Address = prMcrWrInfo->u4McrOffset; - rCmdAccessReg.u4Data = prMcrWrInfo->u4McrData; - - return wlanSendSetQueryCmd( - prAdapter, - CMD_ID_RANDOM_RX_RESET_DE, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_ACCESS_REG), - (PUINT_8)&rCmdAccessReg, - pvSetBuffer, - u4SetBufferLen - ); - } - - // 0xFFFFFFF8 for Enable SAPP - else if (prMcrWrInfo->u4McrOffset == 0xFFFFFFF8){ - rCmdAccessReg.u4Address = prMcrWrInfo->u4McrOffset; - rCmdAccessReg.u4Data = prMcrWrInfo->u4McrData; - - return wlanSendSetQueryCmd( - prAdapter, - CMD_ID_SAPP_EN, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_ACCESS_REG), - (PUINT_8)&rCmdAccessReg, - pvSetBuffer, - u4SetBufferLen - ); - } - - // 0xFFFFFFF7 for Disable SAPP - else if (prMcrWrInfo->u4McrOffset == 0xFFFFFFF7){ - rCmdAccessReg.u4Address = prMcrWrInfo->u4McrOffset; - rCmdAccessReg.u4Data = prMcrWrInfo->u4McrData; - - return wlanSendSetQueryCmd( - prAdapter, - CMD_ID_SAPP_DE, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_ACCESS_REG), - (PUINT_8)&rCmdAccessReg, - pvSetBuffer, - u4SetBufferLen - ); - } - - else -#endif - // -- Puff Stress Test End - - - /* Check if access F/W Domain MCR */ - if (prMcrWrInfo->u4McrOffset & 0xFFFF0000){ - - /* 0x9000 - 0x9EFF reserved for FW */ -#if CFG_SUPPORT_SWCR - if((prMcrWrInfo->u4McrOffset >> 16) == 0x9F00) { - swCrReadWriteCmd(prAdapter, - SWCR_WRITE, - (UINT_16) (prMcrWrInfo->u4McrOffset & BITS(0,15)), - &prMcrWrInfo->u4McrData); - return WLAN_STATUS_SUCCESS; - } -#endif /* CFG_SUPPORT_SWCR */ - - - #if 1 - // low power test special command - if (prMcrWrInfo->u4McrOffset == 0x11111110){ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - //DbgPrint("Enter test mode\n"); - prAdapter->fgTestMode = TRUE; - return rStatus; - } - if (prMcrWrInfo->u4McrOffset == 0x11111111){ - //DbgPrint("nicpmSetAcpiPowerD3\n"); - - nicpmSetAcpiPowerD3(prAdapter); - kalDevSetPowerState(prAdapter->prGlueInfo, (UINT_32)ParamDeviceStateD3); - return WLAN_STATUS_SUCCESS; - } - if (prMcrWrInfo->u4McrOffset == 0x11111112){ - - //DbgPrint("LP enter sleep\n"); - - // fill command - rCmdAccessReg.u4Address = prMcrWrInfo->u4McrOffset; - rCmdAccessReg.u4Data = prMcrWrInfo->u4McrData; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_ACCESS_REG, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_ACCESS_REG), - (PUINT_8)&rCmdAccessReg, - pvSetBuffer, - u4SetBufferLen - ); - } -#endif - - #if 1 - // low power test special command - if (prMcrWrInfo->u4McrOffset == 0x11111110){ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - //DbgPrint("Enter test mode\n"); - prAdapter->fgTestMode = TRUE; - return rStatus; - } - if (prMcrWrInfo->u4McrOffset == 0x11111111){ - //DbgPrint("nicpmSetAcpiPowerD3\n"); - - nicpmSetAcpiPowerD3(prAdapter); - kalDevSetPowerState(prAdapter->prGlueInfo, (UINT_32)ParamDeviceStateD3); - return WLAN_STATUS_SUCCESS; - } - if (prMcrWrInfo->u4McrOffset == 0x11111112){ - - //DbgPrint("LP enter sleep\n"); - - // fill command - rCmdAccessReg.u4Address = prMcrWrInfo->u4McrOffset; - rCmdAccessReg.u4Data = prMcrWrInfo->u4McrData; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_ACCESS_REG, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_ACCESS_REG), - (PUINT_8)&rCmdAccessReg, - pvSetBuffer, - u4SetBufferLen - ); - } - -#endif - // fill command - rCmdAccessReg.u4Address = prMcrWrInfo->u4McrOffset; - rCmdAccessReg.u4Data = prMcrWrInfo->u4McrData; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_ACCESS_REG, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_ACCESS_REG), - (PUINT_8)&rCmdAccessReg, - pvSetBuffer, - u4SetBufferLen - ); - } - else { - HAL_MCR_WR(prAdapter, - (prMcrWrInfo->u4McrOffset & BITS(2,31)), //address is in DWORD unit - prMcrWrInfo->u4McrData); - - DBGLOG(INIT, TRACE, ("MCR Write: Offset = %#08lx, Data = %#08lx\n", - prMcrWrInfo->u4McrOffset, prMcrWrInfo->u4McrData)); - - return WLAN_STATUS_SUCCESS; - } -} /* wlanoidSetMcrWrite */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query SW CTRL -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuf A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQuerySwCtrlRead ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - P_PARAM_CUSTOM_SW_CTRL_STRUC_T prSwCtrlInfo; - WLAN_STATUS rWlanStatus; - UINT_16 u2Id, u2SubId; - UINT_32 u4Data; - - CMD_SW_DBG_CTRL_T rCmdSwCtrl; - - DEBUGFUNC("wlanoidQuerySwCtrlRead"); - DBGLOG(INIT, LOUD,("\n")); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(PARAM_CUSTOM_SW_CTRL_STRUC_T); - - if (u4QueryBufferLen < sizeof(PARAM_CUSTOM_SW_CTRL_STRUC_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - prSwCtrlInfo = (P_PARAM_CUSTOM_SW_CTRL_STRUC_T)pvQueryBuffer; - - u2Id = (UINT_16)(prSwCtrlInfo->u4Id >> 16); - u2SubId = (UINT_16)(prSwCtrlInfo->u4Id & BITS(0,15)); - u4Data = 0; - rWlanStatus = WLAN_STATUS_SUCCESS; - - switch(u2Id) { - /* 0x9000 - 0x9EFF reserved for FW */ - /* 0xFFFE reserved for FW */ - -#if CFG_SUPPORT_SWCR - case 0x9F00: - swCrReadWriteCmd(prAdapter, - SWCR_READ/* Read */, - (UINT_16) u2SubId , - &u4Data); - break; -#endif /* CFG_SUPPORT_SWCR */ - - case 0xFFFF: - { - u4Data = 0x5AA56620; - } - break; - - case 0x9000: - default: - { - rCmdSwCtrl.u4Id = prSwCtrlInfo->u4Id; - rCmdSwCtrl.u4Data = 0; - rWlanStatus = wlanSendSetQueryCmd(prAdapter, - CMD_ID_SW_DBG_CTRL, - FALSE, - TRUE, - TRUE, - nicCmdEventQuerySwCtrlRead, - nicOidCmdTimeoutCommon, - sizeof(CMD_SW_DBG_CTRL_T), - (PUINT_8)&rCmdSwCtrl, - pvQueryBuffer, - u4QueryBufferLen - ); - } - } /* switch(u2Id)*/ - - prSwCtrlInfo->u4Data = u4Data; - - return rWlanStatus; - -} - /* end of wlanoidQuerySwCtrlRead() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to write SW CTRL -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetSwCtrlWrite ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_CUSTOM_SW_CTRL_STRUC_T prSwCtrlInfo; - CMD_SW_DBG_CTRL_T rCmdSwCtrl; - WLAN_STATUS rWlanStatus; - UINT_16 u2Id, u2SubId; - UINT_32 u4Data; - - DEBUGFUNC("wlanoidSetSwCtrlWrite"); - DBGLOG(INIT, LOUD,("\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_CUSTOM_SW_CTRL_STRUC_T); - - if (u4SetBufferLen < sizeof(PARAM_CUSTOM_SW_CTRL_STRUC_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - - prSwCtrlInfo = (P_PARAM_CUSTOM_SW_CTRL_STRUC_T)pvSetBuffer; - - u2Id = (UINT_16)(prSwCtrlInfo->u4Id >> 16); - u2SubId = (UINT_16)(prSwCtrlInfo->u4Id & BITS(0,15)); - u4Data = prSwCtrlInfo->u4Data; - rWlanStatus = WLAN_STATUS_SUCCESS; - - switch(u2Id) { - - /* 0x9000 - 0x9EFF reserved for FW */ - /* 0xFFFE reserved for FW */ - -#if CFG_SUPPORT_SWCR - case 0x9F00: - swCrReadWriteCmd(prAdapter, - SWCR_WRITE, - (UINT_16) u2SubId, - &u4Data); - break; -#endif /* CFG_SUPPORT_SWCR */ - - case 0x1000: - if (u2SubId == 0x8000) { - // CTIA power save mode setting (code: 0x10008000) - prAdapter->u4CtiaPowerMode = u4Data; - prAdapter->fgEnCtiaPowerMode = TRUE; - - // - { - PARAM_POWER_MODE ePowerMode; - - if (prAdapter->u4CtiaPowerMode == 0) { - // force to keep in CAM mode - ePowerMode = Param_PowerModeCAM; - } else if (prAdapter->u4CtiaPowerMode == 1) { - ePowerMode = Param_PowerModeMAX_PSP; - } else { - ePowerMode = Param_PowerModeFast_PSP; - } - - nicConfigPowerSaveProfile( - prAdapter, - NETWORK_TYPE_AIS_INDEX, - ePowerMode, - TRUE); - } - } - break; - case 0x1001: - if(u2SubId == 0x0) { - prAdapter->fgEnOnlineScan = (BOOLEAN)u4Data; - } - else if(u2SubId == 0x1) { - prAdapter->fgDisBcnLostDetection = (BOOLEAN)u4Data; - } - else if(u2SubId == 0x2) { - prAdapter->rWifiVar.fgSupportUAPSD = (BOOLEAN)u4Data; - } - else if(u2SubId == 0x3) { - prAdapter->u4UapsdAcBmp = u4Data & BITS(0,15); - prAdapter->rWifiVar.arBssInfo[u4Data>>16].rPmProfSetupInfo.ucBmpDeliveryAC = (UINT_8)prAdapter->u4UapsdAcBmp; - prAdapter->rWifiVar.arBssInfo[u4Data>>16].rPmProfSetupInfo.ucBmpTriggerAC = (UINT_8)prAdapter->u4UapsdAcBmp; - } - else if(u2SubId == 0x4) { - prAdapter->fgDisStaAgingTimeoutDetection = (BOOLEAN)u4Data; - } - else if(u2SubId == 0x5) { - prAdapter->rWifiVar.rConnSettings.uc2G4BandwidthMode = (UINT_8)u4Data; - } - - - break; - -#if CFG_SUPPORT_SWCR - case 0x1002: - if(u2SubId == 0x0) { - if (u4Data) { - u4Data = BIT(HIF_RX_PKT_TYPE_MANAGEMENT); - } - swCrFrameCheckEnable(prAdapter, u4Data); - } - else if(u2SubId == 0x1) { - BOOLEAN fgIsEnable; - UINT_8 ucType; - UINT_32 u4Timeout; - - fgIsEnable = (BOOLEAN)(u4Data & 0xff); - ucType = 0;//((u4Data>>4) & 0xf); - u4Timeout = ((u4Data>>8) & 0xff); - swCrDebugCheckEnable(prAdapter, fgIsEnable, ucType, u4Timeout); - } - break; -#endif - -#if CFG_SUPPORT_802_11W - case 0x2000: - DBGLOG(RSN, INFO, ("802.11w test 0x%x\n", u2SubId)); - if (u2SubId == 0x0) { - rsnStartSaQuery(prAdapter); - } - if (u2SubId == 0x1) { - rsnStopSaQuery(prAdapter); - } - if (u2SubId == 0x2) { - rsnSaQueryRequest(prAdapter, NULL); - } - if (u2SubId == 0x3) { - P_BSS_INFO_T prBssInfo = &(prAdapter->rWifiVar.arBssInfo[(NETWORK_TYPE_AIS_INDEX)]); - authSendDeauthFrame(prAdapter, prBssInfo->prStaRecOfAP , NULL, 7, NULL); - } - /* wext_set_mode */ - /* - if (u2SubId == 0x3) { - prAdapter->prGlueInfo->rWpaInfo.u4Mfp = RSN_AUTH_MFP_DISABLED; - } - if (u2SubId == 0x4) { - //prAdapter->rWifiVar.rAisSpecificBssInfo.fgMgmtProtection = TRUE; - prAdapter->prGlueInfo->rWpaInfo.u4Mfp = RSN_AUTH_MFP_OPTIONAL; - } - if (u2SubId == 0x5) { - //prAdapter->rWifiVar.rAisSpecificBssInfo.fgMgmtProtection = TRUE; - prAdapter->prGlueInfo->rWpaInfo.u4Mfp = RSN_AUTH_MFP_REQUIRED; - } - */ - break; -#endif - case 0xFFFF: - { - CMD_ACCESS_REG rCmdAccessReg; -#if 1 //CFG_MT6573_SMT_TEST - if (u2SubId == 0x0123) { - - DBGLOG(HAL, INFO, ("set smt fixed rate: %d \n", u4Data)); - - if((ENUM_REGISTRY_FIXED_RATE_T)(u4Data) < FIXED_RATE_NUM) { - prAdapter->rWifiVar.eRateSetting = (ENUM_REGISTRY_FIXED_RATE_T)(u4Data); - } - else { - prAdapter->rWifiVar.eRateSetting = FIXED_RATE_NONE; - } - - if(prAdapter->rWifiVar.eRateSetting == FIXED_RATE_NONE) { - /* Enable Auto (Long/Short) Preamble */ - prAdapter->rWifiVar.ePreambleType = PREAMBLE_TYPE_AUTO; - } - else if((prAdapter->rWifiVar.eRateSetting >= FIXED_RATE_MCS0_20M_400NS && - prAdapter->rWifiVar.eRateSetting <= FIXED_RATE_MCS7_20M_400NS) - || (prAdapter->rWifiVar.eRateSetting >= FIXED_RATE_MCS0_40M_400NS && - prAdapter->rWifiVar.eRateSetting <= FIXED_RATE_MCS32_400NS)) { - /* Force Short Preamble */ - prAdapter->rWifiVar.ePreambleType = PREAMBLE_TYPE_SHORT; - } - else { - /* Force Long Preamble */ - prAdapter->rWifiVar.ePreambleType = PREAMBLE_TYPE_LONG; - } - - /* abort to re-connect */ -#if 1 - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_DISCONNECT, - NULL, - 0); -#else - aisBssBeaconTimeout(prAdapter); -#endif - - return WLAN_STATUS_SUCCESS; - - } - else if (u2SubId == 0x1234) { - // 1. Disable On-Lin Scan - prAdapter->fgEnOnlineScan = FALSE; - - // 3. Disable FIFO FULL no ack - rCmdAccessReg.u4Address = 0x60140028; - rCmdAccessReg.u4Data = 0x904; - wlanSendSetQueryCmd(prAdapter, - CMD_ID_ACCESS_REG, - TRUE, //FALSE, - FALSE, //TRUE, - FALSE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_ACCESS_REG), - (PUINT_8)&rCmdAccessReg, - pvSetBuffer, - 0 - ); - - // 4. Disable Roaming - rCmdSwCtrl.u4Id = 0x90000204; - rCmdSwCtrl.u4Data = 0x0; - wlanSendSetQueryCmd(prAdapter, - CMD_ID_SW_DBG_CTRL, - TRUE, - FALSE, - FALSE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_SW_DBG_CTRL_T), - (PUINT_8)&rCmdSwCtrl, - pvSetBuffer, - u4SetBufferLen - ); - - rCmdSwCtrl.u4Id = 0x90000200; - rCmdSwCtrl.u4Data = 0x820000; - wlanSendSetQueryCmd(prAdapter, - CMD_ID_SW_DBG_CTRL, - TRUE, - FALSE, - FALSE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_SW_DBG_CTRL_T), - (PUINT_8)&rCmdSwCtrl, - pvSetBuffer, - u4SetBufferLen - ); - - // Disalbe auto tx power - // - rCmdSwCtrl.u4Id = 0xa0100003; - rCmdSwCtrl.u4Data = 0x0; - wlanSendSetQueryCmd(prAdapter, - CMD_ID_SW_DBG_CTRL, - TRUE, - FALSE, - FALSE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_SW_DBG_CTRL_T), - (PUINT_8)&rCmdSwCtrl, - pvSetBuffer, - u4SetBufferLen - ); - - - - // 2. Keep at CAM mode - { - PARAM_POWER_MODE ePowerMode; - - prAdapter->u4CtiaPowerMode = 0; - prAdapter->fgEnCtiaPowerMode = TRUE; - - ePowerMode = Param_PowerModeCAM; - rWlanStatus = nicConfigPowerSaveProfile( - prAdapter, - NETWORK_TYPE_AIS_INDEX, - ePowerMode, - TRUE); - } - - // 5. Disable Beacon Timeout Detection - prAdapter->fgDisBcnLostDetection = TRUE; - } - else if (u2SubId == 0x1235) { - - // 1. Enaable On-Lin Scan - prAdapter->fgEnOnlineScan = TRUE; - - // 3. Enable FIFO FULL no ack - rCmdAccessReg.u4Address = 0x60140028; - rCmdAccessReg.u4Data = 0x905; - wlanSendSetQueryCmd(prAdapter, - CMD_ID_ACCESS_REG, - TRUE, //FALSE, - FALSE, //TRUE, - FALSE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_ACCESS_REG), - (PUINT_8)&rCmdAccessReg, - pvSetBuffer, - 0 - ); - - // 4. Enable Roaming - rCmdSwCtrl.u4Id = 0x90000204; - rCmdSwCtrl.u4Data = 0x1; - wlanSendSetQueryCmd(prAdapter, - CMD_ID_SW_DBG_CTRL, - TRUE, - FALSE, - FALSE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_SW_DBG_CTRL_T), - (PUINT_8)&rCmdSwCtrl, - pvSetBuffer, - u4SetBufferLen - ); - - rCmdSwCtrl.u4Id = 0x90000200; - rCmdSwCtrl.u4Data = 0x820000; - wlanSendSetQueryCmd(prAdapter, - CMD_ID_SW_DBG_CTRL, - TRUE, - FALSE, - FALSE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_SW_DBG_CTRL_T), - (PUINT_8)&rCmdSwCtrl, - pvSetBuffer, - u4SetBufferLen - ); - - // Enable auto tx power - // - - rCmdSwCtrl.u4Id = 0xa0100003; - rCmdSwCtrl.u4Data = 0x1; - wlanSendSetQueryCmd(prAdapter, - CMD_ID_SW_DBG_CTRL, - TRUE, - FALSE, - FALSE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_SW_DBG_CTRL_T), - (PUINT_8)&rCmdSwCtrl, - pvSetBuffer, - u4SetBufferLen - ); - - - // 2. Keep at Fast PS - { - PARAM_POWER_MODE ePowerMode; - - prAdapter->u4CtiaPowerMode = 2; - prAdapter->fgEnCtiaPowerMode = TRUE; - - ePowerMode = Param_PowerModeFast_PSP; - rWlanStatus = nicConfigPowerSaveProfile( - prAdapter, - NETWORK_TYPE_AIS_INDEX, - ePowerMode, - TRUE); - } - - // 5. Enable Beacon Timeout Detection - prAdapter->fgDisBcnLostDetection = FALSE; - } -#endif - } - break; - - case 0x9000: - default: - { - rCmdSwCtrl.u4Id = prSwCtrlInfo->u4Id; - rCmdSwCtrl.u4Data = prSwCtrlInfo->u4Data; - rWlanStatus = wlanSendSetQueryCmd(prAdapter, - CMD_ID_SW_DBG_CTRL, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_SW_DBG_CTRL_T), - (PUINT_8)&rCmdSwCtrl, - pvSetBuffer, - u4SetBufferLen - ); - } - } /* switch(u2Id) */ - - return rWlanStatus; -} - /* wlanoidSetSwCtrlWrite */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query EEPROM value. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuf A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryEepromRead ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - P_PARAM_CUSTOM_EEPROM_RW_STRUC_T prEepromRwInfo; - CMD_ACCESS_EEPROM rCmdAccessEeprom; - - DEBUGFUNC("wlanoidQueryEepromRead"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(PARAM_CUSTOM_EEPROM_RW_STRUC_T); - - if (u4QueryBufferLen < sizeof(PARAM_CUSTOM_EEPROM_RW_STRUC_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - prEepromRwInfo = (P_PARAM_CUSTOM_EEPROM_RW_STRUC_T)pvQueryBuffer; - - kalMemZero(&rCmdAccessEeprom, sizeof(CMD_ACCESS_EEPROM)); - rCmdAccessEeprom.u2Offset = prEepromRwInfo->ucEepromIndex; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_ACCESS_EEPROM, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryEepromRead, - nicOidCmdTimeoutCommon, - sizeof(CMD_ACCESS_EEPROM), - (PUINT_8)&rCmdAccessEeprom, - pvQueryBuffer, - u4QueryBufferLen - ); - -} /* wlanoidQueryEepromRead */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to write EEPROM value. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetEepromWrite ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_CUSTOM_EEPROM_RW_STRUC_T prEepromRwInfo; - CMD_ACCESS_EEPROM rCmdAccessEeprom; - - DEBUGFUNC("wlanoidSetEepromWrite"); - DBGLOG(INIT, LOUD,("\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_CUSTOM_EEPROM_RW_STRUC_T); - - if (u4SetBufferLen < sizeof(PARAM_CUSTOM_EEPROM_RW_STRUC_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - - prEepromRwInfo = (P_PARAM_CUSTOM_EEPROM_RW_STRUC_T)pvSetBuffer; - - kalMemZero(&rCmdAccessEeprom, sizeof(CMD_ACCESS_EEPROM)); - rCmdAccessEeprom.u2Offset = prEepromRwInfo->ucEepromIndex; - rCmdAccessEeprom.u2Data = prEepromRwInfo->u2EepromData; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_ACCESS_EEPROM, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_ACCESS_EEPROM), - (PUINT_8)&rCmdAccessEeprom, - pvSetBuffer, - u4SetBufferLen - ); - -} /* wlanoidSetEepromWrite */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the number of the successfully transmitted -* packets. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuf A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryXmitOk ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryXmitOk"); - DBGLOG(REQ, LOUD, ("\n")); - - ASSERT(prAdapter); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in query receive error! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - *pu4QueryInfoLen = sizeof(UINT_32); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - else if (u4QueryBufferLen < sizeof(UINT_32) - || (u4QueryBufferLen > sizeof(UINT_32) && u4QueryBufferLen < sizeof(UINT_64))) { - *pu4QueryInfoLen = sizeof(UINT_64); - return WLAN_STATUS_INVALID_LENGTH; - } - -#if CFG_ENABLE_STATISTICS_BUFFERING - if(IsBufferedStatisticsUsable(prAdapter) == TRUE) { - if(u4QueryBufferLen == sizeof(UINT_32)) { - *pu4QueryInfoLen = sizeof(UINT_32); - *(PUINT_32) pvQueryBuffer = (UINT_32) prAdapter->rStatStruct.rTransmittedFragmentCount.QuadPart; - } - else { - *pu4QueryInfoLen = sizeof(UINT_64); - *(PUINT_64) pvQueryBuffer = (UINT_64) prAdapter->rStatStruct.rTransmittedFragmentCount.QuadPart; - } - - return WLAN_STATUS_SUCCESS; - } - else -#endif - { - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_GET_STATISTICS, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryXmitOk, - nicOidCmdTimeoutCommon, - 0, - NULL, - pvQueryBuffer, - u4QueryBufferLen - ); - } -} /* wlanoidQueryXmitOk */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the number of the successfully received -* packets. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuf A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryRcvOk ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryRcvOk"); - DBGLOG(REQ, LOUD, ("\n")); - - ASSERT(prAdapter); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in query receive error! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - *pu4QueryInfoLen = sizeof(UINT_32); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - else if (u4QueryBufferLen < sizeof(UINT_32) - || (u4QueryBufferLen > sizeof(UINT_32) && u4QueryBufferLen < sizeof(UINT_64))) { - *pu4QueryInfoLen = sizeof(UINT_64); - return WLAN_STATUS_INVALID_LENGTH; - } - -#if CFG_ENABLE_STATISTICS_BUFFERING - if(IsBufferedStatisticsUsable(prAdapter) == TRUE) { - if(u4QueryBufferLen == sizeof(UINT_32)) { - *pu4QueryInfoLen = sizeof(UINT_32); - *(PUINT_32) pvQueryBuffer = (UINT_32) prAdapter->rStatStruct.rReceivedFragmentCount.QuadPart; - } - else { - *pu4QueryInfoLen = sizeof(UINT_64); - *(PUINT_64) pvQueryBuffer = (UINT_64) prAdapter->rStatStruct.rReceivedFragmentCount.QuadPart; - } - - return WLAN_STATUS_SUCCESS; - } - else -#endif - { - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_GET_STATISTICS, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryRecvOk, - nicOidCmdTimeoutCommon, - 0, - NULL, - pvQueryBuffer, - u4QueryBufferLen - ); - } -} /* wlanoidQueryRcvOk */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the number of frames that the driver -* fails to transmit. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuf A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryXmitError ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryXmitError"); - DBGLOG(REQ, LOUD, ("\n")); - - ASSERT(prAdapter); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in query receive error! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - *pu4QueryInfoLen = sizeof(UINT_32); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - else if (u4QueryBufferLen < sizeof(UINT_32) - || (u4QueryBufferLen > sizeof(UINT_32) && u4QueryBufferLen < sizeof(UINT_64))) { - *pu4QueryInfoLen = sizeof(UINT_64); - return WLAN_STATUS_INVALID_LENGTH; - } - -#if CFG_ENABLE_STATISTICS_BUFFERING - if(IsBufferedStatisticsUsable(prAdapter) == TRUE) { - if(u4QueryBufferLen == sizeof(UINT_32)) { - *pu4QueryInfoLen = sizeof(UINT_32); - *(PUINT_32) pvQueryBuffer = (UINT_32) prAdapter->rStatStruct.rFailedCount.QuadPart; - } - else { - *pu4QueryInfoLen = sizeof(UINT_64); - *(PUINT_64) pvQueryBuffer = (UINT_64) prAdapter->rStatStruct.rFailedCount.QuadPart; - } - - return WLAN_STATUS_SUCCESS; - } - else -#endif - { - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_GET_STATISTICS, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryXmitError, - nicOidCmdTimeoutCommon, - 0, - NULL, - pvQueryBuffer, - u4QueryBufferLen - ); - } -} /* wlanoidQueryXmitError */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the number of frames successfully -* transmitted after exactly one collision. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuf A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryXmitOneCollision ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryXmitOneCollision"); - DBGLOG(REQ, LOUD, ("\n")); - - ASSERT(prAdapter); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in query receive error! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - *pu4QueryInfoLen = sizeof(UINT_32); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - else if (u4QueryBufferLen < sizeof(UINT_32) - || (u4QueryBufferLen > sizeof(UINT_32) && u4QueryBufferLen < sizeof(UINT_64))) { - *pu4QueryInfoLen = sizeof(UINT_64); - return WLAN_STATUS_INVALID_LENGTH; - } - -#if CFG_ENABLE_STATISTICS_BUFFERING - if(IsBufferedStatisticsUsable(prAdapter) == TRUE) { - if(u4QueryBufferLen == sizeof(UINT_32)) { - *pu4QueryInfoLen = sizeof(UINT_32); - *(PUINT_32) pvQueryBuffer = (UINT_32) - (prAdapter->rStatStruct.rMultipleRetryCount.QuadPart - prAdapter->rStatStruct.rRetryCount.QuadPart); - } - else { - *pu4QueryInfoLen = sizeof(UINT_64); - *(PUINT_64) pvQueryBuffer = (UINT_64) - (prAdapter->rStatStruct.rMultipleRetryCount.QuadPart - prAdapter->rStatStruct.rRetryCount.QuadPart); - } - - return WLAN_STATUS_SUCCESS; - } - else -#endif - { - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_GET_STATISTICS, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryXmitOneCollision, - nicOidCmdTimeoutCommon, - 0, - NULL, - pvQueryBuffer, - u4QueryBufferLen - ); - } -} /* wlanoidQueryXmitOneCollision */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the number of frames successfully -* transmitted after more than one collision. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuf A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryXmitMoreCollisions ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryXmitMoreCollisions"); - DBGLOG(REQ, LOUD, ("\n")); - - ASSERT(prAdapter); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in query receive error! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - *pu4QueryInfoLen = sizeof(UINT_32); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - else if (u4QueryBufferLen < sizeof(UINT_32) - || (u4QueryBufferLen > sizeof(UINT_32) && u4QueryBufferLen < sizeof(UINT_64))) { - *pu4QueryInfoLen = sizeof(UINT_64); - return WLAN_STATUS_INVALID_LENGTH; - } - -#if CFG_ENABLE_STATISTICS_BUFFERING - if(IsBufferedStatisticsUsable(prAdapter) == TRUE) { - if(u4QueryBufferLen == sizeof(UINT_32)) { - *pu4QueryInfoLen = sizeof(UINT_32); - *(PUINT_32) pvQueryBuffer = (UINT_32) (prAdapter->rStatStruct.rMultipleRetryCount.QuadPart); - } - else { - *pu4QueryInfoLen = sizeof(UINT_64); - *(PUINT_64) pvQueryBuffer = (UINT_64) (prAdapter->rStatStruct.rMultipleRetryCount.QuadPart); - } - - return WLAN_STATUS_SUCCESS; - } - else -#endif - { - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_GET_STATISTICS, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryXmitMoreCollisions, - nicOidCmdTimeoutCommon, - 0, - NULL, - pvQueryBuffer, - u4QueryBufferLen - ); - } -} /* wlanoidQueryXmitMoreCollisions */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the number of frames -* not transmitted due to excessive collisions. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryXmitMaxCollisions ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryXmitMaxCollisions"); - DBGLOG(REQ, LOUD, ("\n")); - - ASSERT(prAdapter); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in query receive error! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - *pu4QueryInfoLen = sizeof(UINT_32); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - else if (u4QueryBufferLen < sizeof(UINT_32) - || (u4QueryBufferLen > sizeof(UINT_32) && u4QueryBufferLen < sizeof(UINT_64))) { - *pu4QueryInfoLen = sizeof(UINT_64); - return WLAN_STATUS_INVALID_LENGTH; - } - -#if CFG_ENABLE_STATISTICS_BUFFERING - if(IsBufferedStatisticsUsable(prAdapter) == TRUE) { - if(u4QueryBufferLen == sizeof(UINT_32)) { - *pu4QueryInfoLen = sizeof(UINT_32); - *(PUINT_32) pvQueryBuffer = (UINT_32) prAdapter->rStatStruct.rFailedCount.QuadPart; - } - else { - *pu4QueryInfoLen = sizeof(UINT_64); - *(PUINT_64) pvQueryBuffer = (UINT_64) prAdapter->rStatStruct.rFailedCount.QuadPart; - } - - return WLAN_STATUS_SUCCESS; - } - else -#endif - { - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_GET_STATISTICS, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryXmitMaxCollisions, - nicOidCmdTimeoutCommon, - 0, - NULL, - pvQueryBuffer, - u4QueryBufferLen - ); - } -} /* wlanoidQueryXmitMaxCollisions */ - - -#define MTK_CUSTOM_OID_INTERFACE_VERSION 0x00006620 // for WPDWifi DLL -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query current the OID interface version, -* which is the interface between the application and driver. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryOidInterfaceVersion ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen) -{ - DEBUGFUNC("wlanoidQueryOidInterfaceVersion"); - - ASSERT(prAdapter); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - *(PUINT_32) pvQueryBuffer = MTK_CUSTOM_OID_INTERFACE_VERSION ; - *pu4QueryInfoLen = sizeof(UINT_32); - - DBGLOG(REQ, WARN, ("Custom OID interface version: %#08lX\n", - *(PUINT_32) pvQueryBuffer)); - - return WLAN_STATUS_SUCCESS; -} /* wlanoidQueryOidInterfaceVersion */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query current Multicast Address List. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryMulticastList( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ -#ifndef LINUX - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_MAC_MCAST_ADDR, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryMcastAddr, - nicOidCmdTimeoutCommon, - 0, - NULL, - pvQueryBuffer, - u4QueryBufferLen - ); -#else - return WLAN_STATUS_SUCCESS; -#endif -} /* end of wlanoidQueryMulticastList() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set Multicast Address List. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_MULTICAST_FULL -*/ -/*----------------------------------------------------------------------------*/ - WLAN_STATUS - wlanoidSetMulticastList( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) - { - UINT_8 ucNetTypeIndex = NETWORK_TYPE_AIS_INDEX; /* Caller should provide this information */ - CMD_MAC_MCAST_ADDR rCmdMacMcastAddr; - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - /* The data must be a multiple of the Ethernet address size. */ - if ((u4SetBufferLen % MAC_ADDR_LEN)) { - DBGLOG(REQ, WARN, ("Invalid MC list length %ld\n", u4SetBufferLen)); - - *pu4SetInfoLen = (((u4SetBufferLen + MAC_ADDR_LEN) - 1) / - MAC_ADDR_LEN) * MAC_ADDR_LEN; - - return WLAN_STATUS_INVALID_LENGTH; - } - - *pu4SetInfoLen = u4SetBufferLen; - - /* Verify if we can support so many multicast addresses. */ - if ((u4SetBufferLen / MAC_ADDR_LEN) > MAX_NUM_GROUP_ADDR) { - DBGLOG(REQ, WARN, ("Too many MC addresses\n")); - - return WLAN_STATUS_MULTICAST_FULL; - } - - /* NOTE(Kevin): Windows may set u4SetBufferLen == 0 && - * pvSetBuffer == NULL to clear exist Multicast List. - */ - if (u4SetBufferLen) { - ASSERT(pvSetBuffer); - } - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set multicast list! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - rCmdMacMcastAddr.u4NumOfGroupAddr = u4SetBufferLen / MAC_ADDR_LEN; - rCmdMacMcastAddr.ucNetTypeIndex = ucNetTypeIndex; - kalMemCopy(rCmdMacMcastAddr.arAddress, pvSetBuffer, u4SetBufferLen); - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_MAC_MCAST_ADDR, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_MAC_MCAST_ADDR), - (PUINT_8)&rCmdMacMcastAddr, - pvSetBuffer, - u4SetBufferLen - ); -} /* end of wlanoidSetMulticastList() */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set Packet Filter. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_NOT_SUPPORTED -* \retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetCurrentPacketFilter ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - UINT_32 u4NewPacketFilter; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - - DEBUGFUNC("wlanoidSetCurrentPacketFilter"); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - if (u4SetBufferLen < sizeof(UINT_32)) { - *pu4SetInfoLen = sizeof(UINT_32); - return WLAN_STATUS_INVALID_LENGTH; - } - ASSERT(pvSetBuffer); - - /* Set the new packet filter. */ - u4NewPacketFilter = *(PUINT_32) pvSetBuffer; - - DBGLOG(REQ, INFO, ("New packet filter: %#08lx\n", u4NewPacketFilter)); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set current packet filter! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - do { - /* Verify the bits of the new packet filter. If any bits are set that - we don't support, leave. */ - if (u4NewPacketFilter & ~(PARAM_PACKET_FILTER_SUPPORTED)) { - rStatus = WLAN_STATUS_NOT_SUPPORTED; - break; - } - -#if DBG - /* Need to enable or disable promiscuous support depending on the new - filter. */ - if (u4NewPacketFilter & PARAM_PACKET_FILTER_PROMISCUOUS) { - DBGLOG(REQ, INFO, ("Enable promiscuous mode\n")); - } - else { - DBGLOG(REQ, INFO, ("Disable promiscuous mode\n")); - } - - if (u4NewPacketFilter & PARAM_PACKET_FILTER_ALL_MULTICAST) { - DBGLOG(REQ, INFO, ("Enable all-multicast mode\n")); - } - else if (u4NewPacketFilter & PARAM_PACKET_FILTER_MULTICAST) { - DBGLOG(REQ, INFO, ("Enable multicast\n")); - } - else { - DBGLOG(REQ, INFO, ("Disable multicast\n")); - } - - if (u4NewPacketFilter & PARAM_PACKET_FILTER_BROADCAST) { - DBGLOG(REQ, INFO, ("Enable Broadcast\n")); - } - else { - DBGLOG(REQ, INFO, ("Disable Broadcast\n")); - } -#endif - } while (FALSE); - - if(rStatus == WLAN_STATUS_SUCCESS) { - // Store the packet filter - - prAdapter->u4OsPacketFilter &= PARAM_PACKET_FILTER_P2P_MASK; - prAdapter->u4OsPacketFilter |= u4NewPacketFilter; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_RX_FILTER, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(UINT_32), - (PUINT_8)&prAdapter->u4OsPacketFilter, - pvSetBuffer, - u4SetBufferLen - ); - } - else { - return rStatus; - } -} /* wlanoidSetCurrentPacketFilter */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query current packet filter. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryCurrentPacketFilter ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryCurrentPacketFilter"); - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - - *pu4QueryInfoLen = sizeof(UINT_32); - - if (u4QueryBufferLen >= sizeof(UINT_32)) { - ASSERT(pvQueryBuffer); - *(PUINT_32) pvQueryBuffer = prAdapter->u4OsPacketFilter; - } - - return WLAN_STATUS_SUCCESS; -} /* wlanoidQueryCurrentPacketFilter */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query ACPI device power state. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryAcpiDevicePowerState ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ -#if DBG - PPARAM_DEVICE_POWER_STATE prPowerState; -#endif - - DEBUGFUNC("wlanoidQueryAcpiDevicePowerState"); - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(PARAM_DEVICE_POWER_STATE); - -#if DBG - prPowerState = (PPARAM_DEVICE_POWER_STATE) pvQueryBuffer; - switch (*prPowerState) { - case ParamDeviceStateD0: - DBGLOG(REQ, INFO, ("Query Power State: D0\n")); - break; - case ParamDeviceStateD1: - DBGLOG(REQ, INFO, ("Query Power State: D1\n")); - break; - case ParamDeviceStateD2: - DBGLOG(REQ, INFO, ("Query Power State: D2\n")); - break; - case ParamDeviceStateD3: - DBGLOG(REQ, INFO, ("Query Power State: D3\n")); - break; - default: - break; - } -#endif - - /* Since we will disconnect the newwork, therefore we do not - need to check queue empty */ - *(PPARAM_DEVICE_POWER_STATE) pvQueryBuffer = ParamDeviceStateD3; - //WARNLOG(("Ready to transition to D3\n")); - return WLAN_STATUS_SUCCESS; - -} /* pwrmgtQueryPower */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set ACPI device power state. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetAcpiDevicePowerState ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - PPARAM_DEVICE_POWER_STATE prPowerState; - BOOLEAN fgRetValue = TRUE; - - DEBUGFUNC("wlanoidSetAcpiDevicePowerState"); - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_DEVICE_POWER_STATE); - - ASSERT(pvSetBuffer); - prPowerState = (PPARAM_DEVICE_POWER_STATE) pvSetBuffer; - switch (*prPowerState) { - case ParamDeviceStateD0: - DBGLOG(REQ, INFO, ("Set Power State: D0\n")); - kalDevSetPowerState(prAdapter->prGlueInfo, (UINT_32)ParamDeviceStateD0); - fgRetValue = nicpmSetAcpiPowerD0(prAdapter); - break; - case ParamDeviceStateD1: - DBGLOG(REQ, INFO, ("Set Power State: D1\n")); - /* no break here */ - case ParamDeviceStateD2: - DBGLOG(REQ, INFO, ("Set Power State: D2\n")); - /* no break here */ - case ParamDeviceStateD3: - DBGLOG(REQ, INFO, ("Set Power State: D3\n")); - fgRetValue = nicpmSetAcpiPowerD3(prAdapter); - kalDevSetPowerState(prAdapter->prGlueInfo, (UINT_32)ParamDeviceStateD3); - break; - default: - break; - } - - if(fgRetValue == TRUE) - return WLAN_STATUS_SUCCESS; - else - return WLAN_STATUS_FAILURE; -} /* end of wlanoidSetAcpiDevicePowerState() */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the current fragmentation threshold. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryFragThreshold ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryFragThreshold"); - - ASSERT(prAdapter); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - DBGLOG(REQ, LOUD, ("\n")); - -#if CFG_TX_FRAGMENT - - return WLAN_STATUS_SUCCESS; - -#else - - return WLAN_STATUS_NOT_SUPPORTED; -#endif /* CFG_TX_FRAGMENT */ - -} /* end of wlanoidQueryFragThreshold() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set a new fragmentation threshold to the -* driver. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_DATA -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetFragThreshold ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ -#if CFG_TX_FRAGMENT - - return WLAN_STATUS_SUCCESS; - -#else - - return WLAN_STATUS_NOT_SUPPORTED; -#endif /* CFG_TX_FRAGMENT */ - -} /* end of wlanoidSetFragThreshold() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the current RTS threshold. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryRtsThreshold ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryRtsThreshold"); - - ASSERT(prAdapter); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - DBGLOG(REQ, LOUD, ("\n")); - - if (u4QueryBufferLen < sizeof(PARAM_RTS_THRESHOLD)) { - *pu4QueryInfoLen = sizeof(PARAM_RTS_THRESHOLD); - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - *((PARAM_RTS_THRESHOLD *)pvQueryBuffer) = prAdapter->rWlanInfo.eRtsThreshold; - - return WLAN_STATUS_SUCCESS; - -} /* wlanoidQueryRtsThreshold */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set a new RTS threshold to the driver. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_DATA -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetRtsThreshold ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - PARAM_RTS_THRESHOLD *prRtsThreshold; - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_RTS_THRESHOLD); - if (u4SetBufferLen < sizeof(PARAM_RTS_THRESHOLD)) { - DBGLOG(REQ, WARN, ("Invalid length %ld\n", u4SetBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - - prRtsThreshold = (PARAM_RTS_THRESHOLD *)pvSetBuffer; - *prRtsThreshold = prAdapter->rWlanInfo.eRtsThreshold; - - return WLAN_STATUS_SUCCESS; - -} /* wlanoidSetRtsThreshold */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to turn radio off. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetDisassociate ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_MSG_AIS_ABORT_T prAisAbortMsg; - - DEBUGFUNC("wlanoidSetDisassociate"); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = 0; - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set disassociate! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - /* prepare message to AIS */ - prAdapter->rWifiVar.rConnSettings.fgIsConnReqIssued = FALSE; - - /* Send AIS Abort Message */ - prAisAbortMsg = (P_MSG_AIS_ABORT_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_AIS_ABORT_T)); - if (!prAisAbortMsg) { - ASSERT(0); - return WLAN_STATUS_FAILURE; - } - - prAisAbortMsg->rMsgHdr.eMsgId = MID_OID_AIS_FSM_JOIN_REQ; - prAisAbortMsg->ucReasonOfDisconnect = DISCONNECT_REASON_CODE_NEW_CONNECTION; - prAisAbortMsg->fgDelayIndication = FALSE; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prAisAbortMsg, - MSG_SEND_METHOD_BUF); - - /* indicate for disconnection */ - if (kalGetMediaStateIndicated(prAdapter->prGlueInfo) == PARAM_MEDIA_STATE_CONNECTED) { - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_DISCONNECT, - NULL, - 0); - } - -#if !defined(LINUX) - prAdapter->fgIsRadioOff = TRUE; -#endif - - return WLAN_STATUS_SUCCESS; -} /* wlanoidSetDisassociate */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to query the power save profile. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuf A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \return WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQuery802dot11PowerSaveProfile ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQuery802dot11PowerSaveProfile"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - - if (u4QueryBufferLen!=0) { - ASSERT(pvQueryBuffer); - -// *(PPARAM_POWER_MODE) pvQueryBuffer = (PARAM_POWER_MODE)(prAdapter->rWlanInfo.ePowerSaveMode.ucPsProfile); - *(PPARAM_POWER_MODE) pvQueryBuffer = (PARAM_POWER_MODE)(prAdapter->rWlanInfo.arPowerSaveMode[NETWORK_TYPE_AIS_INDEX].ucPsProfile); - *pu4QueryInfoLen = sizeof(PARAM_POWER_MODE); - - // hack for CTIA power mode setting function - if (prAdapter->fgEnCtiaPowerMode) { - // set to non-zero value (to prevent MMI query 0, before it intends to set 0, which will skip its following state machine) - *(PPARAM_POWER_MODE) pvQueryBuffer = (PARAM_POWER_MODE)2; - } - } - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to set the power save profile. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSet802dot11PowerSaveProfile ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS status; - PARAM_POWER_MODE ePowerMode; - DEBUGFUNC("wlanoidSet802dot11PowerSaveProfile"); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_POWER_MODE); - if (u4SetBufferLen < sizeof(PARAM_POWER_MODE)) { - DBGLOG(REQ, WARN, ("Invalid length %ld\n", u4SetBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - else if (*(PPARAM_POWER_MODE) pvSetBuffer >= Param_PowerModeMax) { - //WARNLOG(("Invalid power mode %d\n", - //*(PPARAM_POWER_MODE) pvSetBuffer)); - return WLAN_STATUS_INVALID_DATA; - } - - ePowerMode = *(PPARAM_POWER_MODE) pvSetBuffer; - - if (prAdapter->fgEnCtiaPowerMode) { - if (ePowerMode == Param_PowerModeCAM) { - - } else { - // User setting to PS mode (Param_PowerModeMAX_PSP or Param_PowerModeFast_PSP) - - if (prAdapter->u4CtiaPowerMode == 0) { - // force to keep in CAM mode - ePowerMode = Param_PowerModeCAM; - } else if (prAdapter->u4CtiaPowerMode == 1) { - ePowerMode = Param_PowerModeMAX_PSP; - } else if (prAdapter->u4CtiaPowerMode == 2) { - ePowerMode = Param_PowerModeFast_PSP; - } - } - } - - status = nicConfigPowerSaveProfile( - prAdapter, - NETWORK_TYPE_AIS_INDEX, - ePowerMode, - TRUE); - - switch (ePowerMode) { - case Param_PowerModeCAM: - DBGLOG(INIT, INFO, ("Set Wi-Fi PS mode to CAM (%d)\n", ePowerMode)); - break; - case Param_PowerModeMAX_PSP: - DBGLOG(INIT, INFO, ("Set Wi-Fi PS mode to MAX PS (%d)\n", ePowerMode)); - break; - case Param_PowerModeFast_PSP: - DBGLOG(INIT, INFO, ("Set Wi-Fi PS mode to FAST PS (%d)\n", ePowerMode)); - break; - default: - DBGLOG(INIT, INFO, ("invalid Wi-Fi PS mode setting (%d)\n", ePowerMode)); - break; - } - - return status; - -} /* end of wlanoidSetAcpiDevicePowerStateMode() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query current status of AdHoc Mode. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryAdHocMode ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - return WLAN_STATUS_SUCCESS; -} /* end of wlanoidQueryAdHocMode() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set AdHoc Mode. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_INVALID_DATA -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetAdHocMode ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - return WLAN_STATUS_SUCCESS; -} /* end of wlanoidSetAdHocMode() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query RF frequency. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryFrequency ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryFrequency"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - if (u4QueryBufferLen < sizeof(UINT_32)) { - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - if (prAdapter->rWifiVar.rConnSettings.eOPMode == NET_TYPE_INFRA) { - if (kalGetMediaStateIndicated(prAdapter->prGlueInfo) == PARAM_MEDIA_STATE_CONNECTED) { - *(PUINT_32)pvQueryBuffer = - nicChannelNum2Freq(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX].ucPrimaryChannel); - } - else { - *(PUINT_32)pvQueryBuffer = 0; - } - } - else { - *(PUINT_32)pvQueryBuffer = - nicChannelNum2Freq(prAdapter->rWifiVar.rConnSettings.ucAdHocChannelNum); - } - - return WLAN_STATUS_SUCCESS; -} /* end of wlanoidQueryFrequency() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set RF frequency by User Settings. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_INVALID_DATA -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetFrequency ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - PUINT_32 pu4FreqInKHz; - - DEBUGFUNC("wlanoidSetFrequency"); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(UINT_32); - - if (u4SetBufferLen < sizeof(UINT_32)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - pu4FreqInKHz = (PUINT_32)pvSetBuffer; - - prAdapter->rWifiVar.rConnSettings.ucAdHocChannelNum - = (UINT_8)nicFreq2ChannelNum(*pu4FreqInKHz); - prAdapter->rWifiVar.rConnSettings.eAdHocBand - = *pu4FreqInKHz < 5000000 ? BAND_2G4 : BAND_5G; - - return WLAN_STATUS_SUCCESS; -} /* end of wlanoidSetFrequency() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set 802.11 channel of the radio frequency. -* This is a proprietary function call to Lunux currently. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_INVALID_DATA -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetChannel ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - ASSERT(0); //// - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the Beacon Interval from User Settings. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryBeaconInterval ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryBeaconInterval"); - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(UINT_32); - - if (u4QueryBufferLen < sizeof(UINT_32)) { - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - if (kalGetMediaStateIndicated(prAdapter->prGlueInfo) == PARAM_MEDIA_STATE_CONNECTED) { - if (prAdapter->rWifiVar.rConnSettings.eOPMode == NET_TYPE_INFRA) { - *(PUINT_32)pvQueryBuffer = - prAdapter->rWlanInfo.rCurrBssId.rConfiguration.u4BeaconPeriod; - } - else { - *(PUINT_32)pvQueryBuffer = - (UINT_32) prAdapter->rWlanInfo.u2BeaconPeriod; - } - } - else { - if (prAdapter->rWifiVar.rConnSettings.eOPMode == NET_TYPE_INFRA) { - *(PUINT_32)pvQueryBuffer = 0; - } - else { - *(PUINT_32)pvQueryBuffer = - (UINT_32) prAdapter->rWlanInfo.u2BeaconPeriod; - } - } - - return WLAN_STATUS_SUCCESS; -} /* end of wlanoidQueryBeaconInterval() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set the Beacon Interval to User Settings. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_INVALID_DATA -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetBeaconInterval ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - PUINT_32 pu4BeaconInterval; - - DEBUGFUNC("wlanoidSetBeaconInterval"); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(UINT_32); - if (u4SetBufferLen < sizeof(UINT_32)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - pu4BeaconInterval = (PUINT_32)pvSetBuffer; - - if ((*pu4BeaconInterval < DOT11_BEACON_PERIOD_MIN) || - (*pu4BeaconInterval > DOT11_BEACON_PERIOD_MAX)) { - DBGLOG(REQ, TRACE, ("Invalid Beacon Interval = %ld\n", *pu4BeaconInterval)); - return WLAN_STATUS_INVALID_DATA; - } - - prAdapter->rWlanInfo.u2BeaconPeriod = (UINT_16)*pu4BeaconInterval; - - DBGLOG(REQ, INFO, ("Set beacon interval: %d\n", - prAdapter->rWlanInfo.u2BeaconPeriod)); - - - return WLAN_STATUS_SUCCESS; -} /* end of wlanoidSetBeaconInterval() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the ATIM window from User Settings. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryAtimWindow ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryAtimWindow"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(UINT_32); - - if (u4QueryBufferLen < sizeof(UINT_32)) { - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - if (prAdapter->rWifiVar.rConnSettings.eOPMode == NET_TYPE_INFRA) { - *(PUINT_32)pvQueryBuffer = 0; - } - else { - *(PUINT_32)pvQueryBuffer = - (UINT_32) prAdapter->rWlanInfo.u2AtimWindow; - } - - return WLAN_STATUS_SUCCESS; - -} /* end of wlanoidQueryAtimWindow() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set the ATIM window to User Settings. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_INVALID_DATA -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetAtimWindow ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - PUINT_32 pu4AtimWindow; - - DEBUGFUNC("wlanoidSetAtimWindow"); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(UINT_32); - - if (u4SetBufferLen < sizeof(UINT_32)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - pu4AtimWindow = (PUINT_32)pvSetBuffer; - - prAdapter->rWlanInfo.u2AtimWindow = (UINT_16)*pu4AtimWindow; - - return WLAN_STATUS_SUCCESS; -} /* end of wlanoidSetAtimWindow() */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to Set the MAC address which is currently used by the NIC. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_INVALID_DATA -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetCurrentAddr ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - ASSERT(0); //// - - return WLAN_STATUS_SUCCESS; -} /* end of wlanoidSetCurrentAddr() */ - - -#if CFG_TCP_IP_CHKSUM_OFFLOAD -/*----------------------------------------------------------------------------*/ -/*! -* \brief Setting the checksum offload function. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetCSUMOffload ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - UINT_32 i, u4CSUMFlags; - CMD_BASIC_CONFIG rCmdBasicConfig; - - DEBUGFUNC("wlanoidSetCSUMOffload"); - DBGLOG(INIT, LOUD, ("\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(UINT_32); - - if (u4SetBufferLen < sizeof(UINT_32)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - u4CSUMFlags = *(PUINT_32)pvSetBuffer; - - kalMemZero(&rCmdBasicConfig, sizeof(CMD_BASIC_CONFIG)); - - for(i = 0 ; i < 6 ; i++) { // set to broadcast address for not-specified - rCmdBasicConfig.rMyMacAddr[i] = 0xff; - } - - rCmdBasicConfig.ucNative80211 = 0; //@FIXME: for Vista - - if(u4CSUMFlags & CSUM_OFFLOAD_EN_TX_TCP) - rCmdBasicConfig.rCsumOffload.u2TxChecksum |= BIT(2); - - if(u4CSUMFlags & CSUM_OFFLOAD_EN_TX_UDP) - rCmdBasicConfig.rCsumOffload.u2TxChecksum |= BIT(1); - - if(u4CSUMFlags & CSUM_OFFLOAD_EN_TX_IP) - rCmdBasicConfig.rCsumOffload.u2TxChecksum |= BIT(0); - - if(u4CSUMFlags & CSUM_OFFLOAD_EN_RX_TCP) - rCmdBasicConfig.rCsumOffload.u2RxChecksum |= BIT(2); - - if(u4CSUMFlags & CSUM_OFFLOAD_EN_RX_UDP) - rCmdBasicConfig.rCsumOffload.u2RxChecksum |= BIT(1); - - if(u4CSUMFlags & (CSUM_OFFLOAD_EN_RX_IPv4 | CSUM_OFFLOAD_EN_RX_IPv6)) - rCmdBasicConfig.rCsumOffload.u2RxChecksum |= BIT(0); - - prAdapter->u4CSUMFlags = u4CSUMFlags; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_BASIC_CONFIG, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_BASIC_CONFIG), - (PUINT_8)&rCmdBasicConfig, - pvSetBuffer, - u4SetBufferLen - ); -} -#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Setting the IP address for pattern search function. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \return WLAN_STATUS_SUCCESS -* \return WLAN_STATUS_ADAPTER_NOT_READY -* \return WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetNetworkAddress( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 i, j; - P_CMD_SET_NETWORK_ADDRESS_LIST prCmdNetworkAddressList; - P_PARAM_NETWORK_ADDRESS_LIST prNetworkAddressList = (P_PARAM_NETWORK_ADDRESS_LIST)pvSetBuffer; - P_PARAM_NETWORK_ADDRESS prNetworkAddress; - P_PARAM_NETWORK_ADDRESS_IP prNetAddrIp; - UINT_32 u4IpAddressCount, u4CmdSize; - PUINT_8 pucBuf = (PUINT_8)pvSetBuffer; - - DEBUGFUNC("wlanoidSetNetworkAddress"); - DBGLOG(INIT, LOUD, ("\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = 4; - - if (u4SetBufferLen < sizeof(PARAM_NETWORK_ADDRESS_LIST)) { - return WLAN_STATUS_INVALID_DATA; - } - - *pu4SetInfoLen = 0; - u4IpAddressCount = 0; - - prNetworkAddress = prNetworkAddressList->arAddress; - for ( i = 0 ; i < prNetworkAddressList->u4AddressCount ; i++) { - if (prNetworkAddress->u2AddressType == PARAM_PROTOCOL_ID_TCP_IP && - prNetworkAddress->u2AddressLength == sizeof(PARAM_NETWORK_ADDRESS_IP)) { - u4IpAddressCount++; - } - - prNetworkAddress = (P_PARAM_NETWORK_ADDRESS) ((UINT_32) prNetworkAddress + - (UINT_32) (prNetworkAddress->u2AddressLength + OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress))); - } - - // construct payload of command packet - u4CmdSize = OFFSET_OF(CMD_SET_NETWORK_ADDRESS_LIST, arNetAddress) + - sizeof(IPV4_NETWORK_ADDRESS) * u4IpAddressCount; - if (u4IpAddressCount == 0) { - u4CmdSize = sizeof(CMD_SET_NETWORK_ADDRESS_LIST); - } - - prCmdNetworkAddressList = (P_CMD_SET_NETWORK_ADDRESS_LIST) kalMemAlloc(u4CmdSize, VIR_MEM_TYPE); - - if(prCmdNetworkAddressList == NULL) - return WLAN_STATUS_FAILURE; - - // fill P_CMD_SET_NETWORK_ADDRESS_LIST - prCmdNetworkAddressList->ucNetTypeIndex = NETWORK_TYPE_AIS_INDEX; - - /* only to set IP address to FW once ARP filter is enabled */ - if (prAdapter->fgEnArpFilter) { - prCmdNetworkAddressList->ucAddressCount = (UINT_8)u4IpAddressCount; - prNetworkAddress = prNetworkAddressList->arAddress; - - DBGLOG(REQ, INFO, ("u4IpAddressCount (%d)\n", u4IpAddressCount)); - - for (i = 0, j = 0 ; i < prNetworkAddressList->u4AddressCount ; i++) { - if (prNetworkAddress->u2AddressType == PARAM_PROTOCOL_ID_TCP_IP && - prNetworkAddress->u2AddressLength == sizeof(PARAM_NETWORK_ADDRESS_IP)) { - prNetAddrIp = (P_PARAM_NETWORK_ADDRESS_IP)prNetworkAddress->aucAddress; - - kalMemCopy(prCmdNetworkAddressList->arNetAddress[j].aucIpAddr, - &(prNetAddrIp->in_addr), - sizeof(UINT_32)); - - j++; - - pucBuf = (PUINT_8)&prNetAddrIp->in_addr; - DBGLOG(REQ, INFO, ("prNetAddrIp->in_addr:%d:%d:%d:%d\n", pucBuf[0], pucBuf[1],pucBuf[2],pucBuf[3])); - } - - prNetworkAddress = (P_PARAM_NETWORK_ADDRESS) ((UINT_32) prNetworkAddress + - (UINT_32) (prNetworkAddress->u2AddressLength + OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress))); - } - - } else { - prCmdNetworkAddressList->ucAddressCount = 0; - } - - rStatus = wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_IP_ADDRESS, - TRUE, - FALSE, - TRUE, - nicCmdEventSetIpAddress, - nicOidCmdTimeoutCommon, - u4CmdSize, - (PUINT_8)prCmdNetworkAddressList, - pvSetBuffer, - u4SetBufferLen - ); - - kalMemFree(prCmdNetworkAddressList, VIR_MEM_TYPE, u4CmdSize); - return rStatus; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Set driver to switch into RF test mode -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set, -* should be NULL -* \param[in] u4SetBufferLen The length of the set buffer, should be 0 -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \return WLAN_STATUS_SUCCESS -* \return WLAN_STATUS_ADAPTER_NOT_READY -* \return WLAN_STATUS_INVALID_DATA -* \return WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidRftestSetTestMode ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS rStatus; - CMD_TEST_CTRL_T rCmdTestCtrl; - - DEBUGFUNC("wlanoidRftestSetTestMode"); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = 0; - - if(u4SetBufferLen == 0) { - if(prAdapter->fgTestMode == FALSE) { - // switch to RF Test mode - rCmdTestCtrl.ucAction = 0; // Switch mode - rCmdTestCtrl.u.u4OpMode = 1; // RF test mode - - rStatus = wlanSendSetQueryCmd(prAdapter, - CMD_ID_TEST_MODE, - TRUE, - FALSE, - TRUE, - nicCmdEventEnterRfTest, - nicOidCmdEnterRFTestTimeout, - sizeof(CMD_TEST_CTRL_T), - (PUINT_8)&rCmdTestCtrl, - pvSetBuffer, - u4SetBufferLen); - } - else { - // already in test mode .. - rStatus = WLAN_STATUS_SUCCESS; - } - } - else { - rStatus = WLAN_STATUS_INVALID_DATA; - } - - return rStatus; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Set driver to switch into normal operation mode from RF test mode -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set -* should be NULL -* \param[in] u4SetBufferLen The length of the set buffer, should be 0 -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \return WLAN_STATUS_SUCCESS -* \return WLAN_STATUS_ADAPTER_NOT_READY -* \return WLAN_STATUS_INVALID_DATA -* \return WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidRftestSetAbortTestMode ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS rStatus; - CMD_TEST_CTRL_T rCmdTestCtrl; - - DEBUGFUNC("wlanoidRftestSetTestMode"); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = 0; - - if(u4SetBufferLen == 0) { - if(prAdapter->fgTestMode == TRUE) { - // switch to normal mode - rCmdTestCtrl.ucAction = 0; // Switch mode - rCmdTestCtrl.u.u4OpMode = 0; // normal mode - - rStatus = wlanSendSetQueryCmd(prAdapter, - CMD_ID_TEST_MODE, - TRUE, - FALSE, - TRUE, - nicCmdEventLeaveRfTest, - nicOidCmdTimeoutCommon, - sizeof(CMD_TEST_CTRL_T), - (PUINT_8)&rCmdTestCtrl, - pvSetBuffer, - u4SetBufferLen); - } - else { - // already in normal mode .. - rStatus = WLAN_STATUS_SUCCESS; - } - } - else { - rStatus = WLAN_STATUS_INVALID_DATA; - } - - return rStatus; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief query for RF test parameter -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_BUFFER_TOO_SHORT -* \retval WLAN_STATUS_NOT_SUPPORTED -* \retval WLAN_STATUS_NOT_ACCEPTED -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidRftestQueryAutoTest ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - P_PARAM_MTK_WIFI_TEST_STRUC_T prRfATInfo; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - - DEBUGFUNC("wlanoidRftestQueryAutoTest"); - - ASSERT(prAdapter); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - ASSERT(pu4QueryInfoLen); - - *pu4QueryInfoLen = sizeof(PARAM_MTK_WIFI_TEST_STRUC_T); - - if (u4QueryBufferLen != sizeof(PARAM_MTK_WIFI_TEST_STRUC_T)) { - DBGLOG(REQ, ERROR, ("Invalid data. QueryBufferLen: %ld.\n", - u4QueryBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - - prRfATInfo = (P_PARAM_MTK_WIFI_TEST_STRUC_T)pvQueryBuffer; - rStatus = rftestQueryATInfo(prAdapter, - prRfATInfo->u4FuncIndex, - prRfATInfo->u4FuncData, - pvQueryBuffer, - u4QueryBufferLen); - - return rStatus; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Set RF test parameter -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \return WLAN_STATUS_SUCCESS -* \return WLAN_STATUS_ADAPTER_NOT_READY -* \return WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidRftestSetAutoTest ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_MTK_WIFI_TEST_STRUC_T prRfATInfo; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - - DEBUGFUNC("wlanoidRftestSetAutoTest"); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_MTK_WIFI_TEST_STRUC_T); - - if (u4SetBufferLen != sizeof(PARAM_MTK_WIFI_TEST_STRUC_T)) { - DBGLOG(REQ, ERROR, ("Invalid data. SetBufferLen: %ld.\n", - u4SetBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - - prRfATInfo = (P_PARAM_MTK_WIFI_TEST_STRUC_T)pvSetBuffer; - rStatus = rftestSetATInfo(prAdapter, prRfATInfo->u4FuncIndex, prRfATInfo->u4FuncData); - - return rStatus; -} - -/* RF test OID set handler */ -WLAN_STATUS -rftestSetATInfo ( - IN P_ADAPTER_T prAdapter, - UINT_32 u4FuncIndex, - UINT_32 u4FuncData - ) -{ - P_GLUE_INFO_T prGlueInfo; - P_CMD_INFO_T prCmdInfo; - P_WIFI_CMD_T prWifiCmd; - P_CMD_TEST_CTRL_T pCmdTestCtrl; - UINT_8 ucCmdSeqNum; - - ASSERT(prAdapter); - - prGlueInfo = prAdapter->prGlueInfo; - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, (CMD_HDR_SIZE + sizeof(CMD_TEST_CTRL_T))); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - - // Setup common CMD Info Packet - prCmdInfo->eCmdType = COMMAND_TYPE_GENERAL_IOCTL; - prCmdInfo->u2InfoBufLen = CMD_HDR_SIZE + sizeof(CMD_TEST_CTRL_T); - prCmdInfo->pfCmdDoneHandler = nicCmdEventSetCommon; - prCmdInfo->pfCmdTimeoutHandler = nicOidCmdTimeoutCommon; - prCmdInfo->fgIsOid = TRUE; - prCmdInfo->ucCID = CMD_ID_TEST_MODE; - prCmdInfo->fgSetQuery = TRUE; - prCmdInfo->fgNeedResp = FALSE; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = sizeof(CMD_TEST_CTRL_T); - prCmdInfo->pvInformationBuffer = NULL; - prCmdInfo->u4InformationBufferLength = 0; - - // Setup WIFI_CMD_T (payload = CMD_TEST_CTRL_T) - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - pCmdTestCtrl = (P_CMD_TEST_CTRL_T)(prWifiCmd->aucBuffer); - pCmdTestCtrl->ucAction = 1; // Set ATInfo - pCmdTestCtrl->u.rRfATInfo.u4FuncIndex = u4FuncIndex; - pCmdTestCtrl->u.rRfATInfo.u4FuncData = u4FuncData; - - // insert into prCmdQueue - kalEnqueueCommand(prGlueInfo, (P_QUE_ENTRY_T)prCmdInfo); - - // wakeup txServiceThread later - GLUE_SET_EVENT(prAdapter->prGlueInfo); - - return WLAN_STATUS_PENDING; -} - -WLAN_STATUS -rftestQueryATInfo( - IN P_ADAPTER_T prAdapter, - UINT_32 u4FuncIndex, - UINT_32 u4FuncData, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen - ) -{ - P_GLUE_INFO_T prGlueInfo; - P_CMD_INFO_T prCmdInfo; - P_WIFI_CMD_T prWifiCmd; - P_CMD_TEST_CTRL_T pCmdTestCtrl; - UINT_8 ucCmdSeqNum; - P_EVENT_TEST_STATUS prTestStatus; - - ASSERT(prAdapter); - - prGlueInfo = prAdapter->prGlueInfo; - - if(u4FuncIndex == RF_AT_FUNCID_FW_INFO) { - /* driver implementation */ - prTestStatus = (P_EVENT_TEST_STATUS)pvQueryBuffer; - - prTestStatus->rATInfo.u4FuncData = - (prAdapter->rVerInfo.u2FwProductID << 16) | (prAdapter->rVerInfo.u2FwOwnVersion); - u4QueryBufferLen = sizeof(EVENT_TEST_STATUS); - - return WLAN_STATUS_SUCCESS; - } - else if(u4FuncIndex == RF_AT_FUNCID_DRV_INFO) { - /* driver implementation */ - prTestStatus = (P_EVENT_TEST_STATUS)pvQueryBuffer; - - prTestStatus->rATInfo.u4FuncData = CFG_DRV_OWN_VERSION; - u4QueryBufferLen = sizeof(EVENT_TEST_STATUS); - - return WLAN_STATUS_SUCCESS; - } - else { - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, (CMD_HDR_SIZE + sizeof(CMD_TEST_CTRL_T))); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - - // Setup common CMD Info Packet - prCmdInfo->eCmdType = COMMAND_TYPE_GENERAL_IOCTL; - prCmdInfo->u2InfoBufLen = CMD_HDR_SIZE + sizeof(CMD_TEST_CTRL_T); - prCmdInfo->pfCmdDoneHandler = nicCmdEventQueryRfTestATInfo; - prCmdInfo->pfCmdTimeoutHandler = nicOidCmdTimeoutCommon; - prCmdInfo->fgIsOid = TRUE; - prCmdInfo->ucCID = CMD_ID_TEST_MODE; - prCmdInfo->fgSetQuery = FALSE; - prCmdInfo->fgNeedResp = TRUE; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = sizeof(CMD_TEST_CTRL_T); - prCmdInfo->pvInformationBuffer = pvQueryBuffer; - prCmdInfo->u4InformationBufferLength = u4QueryBufferLen; - - // Setup WIFI_CMD_T (payload = CMD_TEST_CTRL_T) - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - pCmdTestCtrl = (P_CMD_TEST_CTRL_T)(prWifiCmd->aucBuffer); - pCmdTestCtrl->ucAction = 2; // Get ATInfo - pCmdTestCtrl->u.rRfATInfo.u4FuncIndex = u4FuncIndex; - pCmdTestCtrl->u.rRfATInfo.u4FuncData = u4FuncData; - - // insert into prCmdQueue - kalEnqueueCommand(prGlueInfo, (P_QUE_ENTRY_T)prCmdInfo); - - // wakeup txServiceThread later - GLUE_SET_EVENT(prAdapter->prGlueInfo); - - return WLAN_STATUS_PENDING; - } -} - -WLAN_STATUS -rftestSetFrequency( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4FreqInKHz, - IN PUINT_32 pu4SetInfoLen - ) -{ - CMD_TEST_CTRL_T rCmdTestCtrl; - - ASSERT(prAdapter); - - rCmdTestCtrl.ucAction = 5; // Set Channel Frequency - rCmdTestCtrl.u.u4ChannelFreq = u4FreqInKHz; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_TEST_MODE, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_TEST_CTRL_T), - (PUINT_8)&rCmdTestCtrl, - NULL, - 0); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief command packet generation utility -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] ucCID Command ID -* \param[in] fgSetQuery Set or Query -* \param[in] fgNeedResp Need for response -* \param[in] pfCmdDoneHandler Function pointer when command is done -* \param[in] u4SetQueryInfoLen The length of the set/query buffer -* \param[in] pucInfoBuffer Pointer to set/query buffer -* -* -* \retval WLAN_STATUS_PENDING -* \retval WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanSendSetQueryCmd ( - IN P_ADAPTER_T prAdapter, - UINT_8 ucCID, - BOOLEAN fgSetQuery, - BOOLEAN fgNeedResp, - BOOLEAN fgIsOid, - PFN_CMD_DONE_HANDLER pfCmdDoneHandler, - PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler, - UINT_32 u4SetQueryInfoLen, - PUINT_8 pucInfoBuffer, - OUT PVOID pvSetQueryBuffer, - IN UINT_32 u4SetQueryBufferLen - ) -{ - P_GLUE_INFO_T prGlueInfo; - P_CMD_INFO_T prCmdInfo; - P_WIFI_CMD_T prWifiCmd; - UINT_8 ucCmdSeqNum; - - prGlueInfo = prAdapter->prGlueInfo; - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, (CMD_HDR_SIZE + u4SetQueryInfoLen)); - - DEBUGFUNC("wlanSendSetQueryCmd"); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - DBGLOG(REQ, TRACE, ("ucCmdSeqNum =%d\n", ucCmdSeqNum)); - - // Setup common CMD Info Packet - prCmdInfo->eCmdType = COMMAND_TYPE_NETWORK_IOCTL; - prCmdInfo->eNetworkType = NETWORK_TYPE_AIS_INDEX; - prCmdInfo->u2InfoBufLen = (UINT_16)(CMD_HDR_SIZE + u4SetQueryInfoLen); - prCmdInfo->pfCmdDoneHandler = pfCmdDoneHandler; - prCmdInfo->pfCmdTimeoutHandler = pfCmdTimeoutHandler; - prCmdInfo->fgIsOid = fgIsOid; - prCmdInfo->ucCID = ucCID; - prCmdInfo->fgSetQuery = fgSetQuery; - prCmdInfo->fgNeedResp = fgNeedResp; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = u4SetQueryInfoLen; - prCmdInfo->pvInformationBuffer = pvSetQueryBuffer; - prCmdInfo->u4InformationBufferLength = u4SetQueryBufferLen; - - // Setup WIFI_CMD_T (no payload) - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - if(u4SetQueryInfoLen > 0 && pucInfoBuffer != NULL) { - kalMemCopy(prWifiCmd->aucBuffer, pucInfoBuffer, u4SetQueryInfoLen); - } - - // insert into prCmdQueue - kalEnqueueCommand(prGlueInfo, (P_QUE_ENTRY_T)prCmdInfo); - - // wakeup txServiceThread later - GLUE_SET_EVENT(prGlueInfo); - return WLAN_STATUS_PENDING; -} - - - -#if CFG_SUPPORT_WAPI -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called by WAPI ui to set wapi mode, which is needed to info the the driver -* to operation at WAPI mode while driver initialize. -* -* \param[in] prAdapter Pointer to the Adapter structure -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set -* \param[in] u4SetBufferLen The length of the set buffer -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed due to invalid length of -* the set buffer, returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_DATA If new setting value is wrong. -* \retval WLAN_STATUS_INVALID_LENGTH -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetWapiMode ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - DEBUGFUNC("wlanoidSetWapiMode"); - DBGLOG(REQ, LOUD, ("\r\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - ASSERT(pvSetBuffer); - - /* Todo:: For support WAPI and Wi-Fi at same driver, use the set wapi assoc ie at the check point */ - /* The Adapter Connection setting fgUseWapi will cleat whil oid set mode (infra), */ - /* And set fgUseWapi True while set wapi assoc ie */ - /* policay selection, add key all depend on this flag, */ - /* The fgUseWapi may remove later */ - if (*(PUINT_32)pvSetBuffer) { - prAdapter->fgUseWapi = TRUE; - } - else { - prAdapter->fgUseWapi = FALSE; - } - -#if 0 - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, (CMD_HDR_SIZE + 4)); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - - // compose CMD_BUILD_CONNECTION cmd pkt - prCmdInfo->eCmdType = COMMAND_TYPE_NETWORK_IOCTL; - prCmdInfo->eNetworkType = NETWORK_TYPE_AIS_INDEX; - prCmdInfo->u2InfoBufLen = CMD_HDR_SIZE + 4; - prCmdInfo->pfCmdDoneHandler = nicCmdEventSetCommon; - prCmdInfo->pfCmdTimeoutHandler = NULL; - prCmdInfo->fgIsOid = TRUE; - prCmdInfo->ucCID = CMD_ID_WAPI_MODE; - prCmdInfo->fgSetQuery = TRUE; - prCmdInfo->fgNeedResp = FALSE; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = u4SetBufferLen; - prCmdInfo->pvInformationBuffer = pvSetBuffer; - prCmdInfo->u4InformationBufferLength = u4SetBufferLen; - - // Setup WIFI_CMD_T - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - cp = (PUINT_8)(prWifiCmd->aucBuffer); - - kalMemCopy(cp, (PUINT_8)pvSetBuffer, 4); - - // insert into prCmdQueue - kalEnqueueCommand(prGlueInfo, (P_QUE_ENTRY_T)prCmdInfo); - - // wakeup txServiceThread later - GLUE_SET_EVENT(prGlueInfo); - - return WLAN_STATUS_PENDING; -#else - return WLAN_STATUS_SUCCESS; -#endif -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called by WAPI to set the assoc info, which is needed to add to -* Association request frame while join WAPI AP. -* -* \param[in] prAdapter Pointer to the Adapter structure -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set -* \param[in] u4SetBufferLen The length of the set buffer -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed due to invalid length of -* the set buffer, returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_DATA If new setting value is wrong. -* \retval WLAN_STATUS_INVALID_LENGTH -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetWapiAssocInfo ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_WAPI_INFO_ELEM_T prWapiInfo; - PUINT_8 cp; - UINT_16 u2AuthSuiteCount = 0; - UINT_16 u2PairSuiteCount = 0; - UINT_32 u4AuthKeyMgtSuite = 0; - UINT_32 u4PairSuite = 0; - UINT_32 u4GroupSuite = 0; - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - DEBUGFUNC("wlanoidSetWapiAssocInfo"); - DBGLOG(REQ, LOUD, ("\r\n")); - - if (u4SetBufferLen < 20 /* From EID to Group cipher */) { - prAdapter->rWifiVar.rConnSettings.fgWapiMode = FALSE; - return WLAN_STATUS_INVALID_LENGTH; - } - - prAdapter->rWifiVar.rConnSettings.fgWapiMode = TRUE; - - //if (prWapiInfo->ucElemId != ELEM_ID_WAPI) - // DBGLOG(SEC, TRACE, ("Not WAPI IE ?!\n")); - - //if (prWapiInfo->ucLength < 18) - // return WLAN_STATUS_INVALID_LENGTH; - - *pu4SetInfoLen = u4SetBufferLen; - - prWapiInfo = (P_WAPI_INFO_ELEM_T)pvSetBuffer; - - if (prWapiInfo->ucElemId != ELEM_ID_WAPI) { - DBGLOG(SEC, TRACE, ("Not WAPI IE ?! u4SetBufferLen = %d\n", u4SetBufferLen)); - prAdapter->rWifiVar.rConnSettings.fgWapiMode = FALSE; - return WLAN_STATUS_INVALID_LENGTH; - } - - if (prWapiInfo->ucLength < 18) - return WLAN_STATUS_INVALID_LENGTH; - - /* Skip Version check */ - cp = (PUINT_8)&prWapiInfo->u2AuthKeyMgtSuiteCount; - - WLAN_GET_FIELD_16(cp, &u2AuthSuiteCount); - - if (u2AuthSuiteCount>1) - return WLAN_STATUS_INVALID_LENGTH; - - cp += 2; - WLAN_GET_FIELD_32(cp, &u4AuthKeyMgtSuite); - - DBGLOG(SEC, TRACE, ("WAPI: Assoc Info auth mgt suite [%d]: %02x-%02x-%02x-%02x\n", - u2AuthSuiteCount, - (UCHAR) (u4AuthKeyMgtSuite & 0x000000FF), - (UCHAR) ((u4AuthKeyMgtSuite >> 8) & 0x000000FF), - (UCHAR) ((u4AuthKeyMgtSuite >> 16) & 0x000000FF), - (UCHAR) ((u4AuthKeyMgtSuite >> 24) & 0x000000FF))); - - if (u4AuthKeyMgtSuite != WAPI_AKM_SUITE_802_1X && - u4AuthKeyMgtSuite != WAPI_AKM_SUITE_PSK) - ASSERT(FALSE); - - cp += 4; - WLAN_GET_FIELD_16(cp, &u2PairSuiteCount); - if (u2PairSuiteCount>1) - return WLAN_STATUS_INVALID_LENGTH; - - cp += 2; - WLAN_GET_FIELD_32(cp, &u4PairSuite); - DBGLOG(SEC, TRACE, ("WAPI: Assoc Info pairwise cipher suite [%d]: %02x-%02x-%02x-%02x\n", - u2PairSuiteCount, - (UCHAR) (u4PairSuite & 0x000000FF), - (UCHAR) ((u4PairSuite >> 8) & 0x000000FF), - (UCHAR) ((u4PairSuite >> 16) & 0x000000FF), - (UCHAR) ((u4PairSuite >> 24) & 0x000000FF))); - - if (u4PairSuite != WAPI_CIPHER_SUITE_WPI) - ASSERT(FALSE); - - cp += 4; - WLAN_GET_FIELD_32(cp, &u4GroupSuite); - DBGLOG(SEC, TRACE, ("WAPI: Assoc Info group cipher suite : %02x-%02x-%02x-%02x\n", - (UCHAR) (u4GroupSuite & 0x000000FF), - (UCHAR) ((u4GroupSuite >> 8) & 0x000000FF), - (UCHAR) ((u4GroupSuite >> 16) & 0x000000FF), - (UCHAR) ((u4GroupSuite >> 24) & 0x000000FF))); - - if (u4GroupSuite != WAPI_CIPHER_SUITE_WPI) - ASSERT(FALSE); - - prAdapter->rWifiVar.rConnSettings.u4WapiSelectedAKMSuite = u4AuthKeyMgtSuite; - prAdapter->rWifiVar.rConnSettings.u4WapiSelectedPairwiseCipher = u4PairSuite; - prAdapter->rWifiVar.rConnSettings.u4WapiSelectedGroupCipher = u4GroupSuite; - - kalMemCopy(prAdapter->prGlueInfo->aucWapiAssocInfoIEs, pvSetBuffer, u4SetBufferLen); - prAdapter->prGlueInfo->u2WapiAssocInfoIESz = (UINT_16)u4SetBufferLen; - DBGLOG(SEC, TRACE, ("Assoc Info IE sz %ld\n", u4SetBufferLen)); - - return WLAN_STATUS_SUCCESS; - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set the wpi key to the driver. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_INVALID_DATA -* -* \note The setting buffer P_PARAM_WPI_KEY, which is set by NDIS, is unpacked. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetWapiKey ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_GLUE_INFO_T prGlueInfo; - P_CMD_INFO_T prCmdInfo; - P_WIFI_CMD_T prWifiCmd; - P_PARAM_WPI_KEY_T prNewKey; - P_CMD_802_11_KEY prCmdKey; - PUINT_8 pc; - UINT_8 ucCmdSeqNum; - - DEBUGFUNC("wlanoidSetWapiKey"); - DBGLOG(REQ, LOUD, ("\r\n")); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set add key! (Adapter not ready). ACPI=D%d, Radio=%d\r\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - prNewKey = (P_PARAM_WPI_KEY_T) pvSetBuffer; - - DBGLOG_MEM8(REQ, TRACE, (PUINT_8)pvSetBuffer, 560); - pc = (PUINT_8)pvSetBuffer; - - *pu4SetInfoLen = u4SetBufferLen; - - /* Exception check */ - if (prNewKey->ucKeyID != 0x1 || - prNewKey->ucKeyID != 0x0) { - prNewKey->ucKeyID = prNewKey->ucKeyID & BIT(0); - //DBGLOG(SEC, INFO, ("Invalid WAPI key ID (%d)\r\n", prNewKey->ucKeyID)); - } - - /* Dump P_PARAM_WPI_KEY_T content. */ - DBGLOG(REQ, TRACE, ("Set: Dump P_PARAM_WPI_KEY_T content\r\n")); - DBGLOG(REQ, TRACE, ("TYPE : %d\r\n", prNewKey->eKeyType)); - DBGLOG(REQ, TRACE, ("Direction : %d\r\n", prNewKey->eDirection)); - DBGLOG(REQ, TRACE, ("KeyID : %d\r\n", prNewKey->ucKeyID)); - DBGLOG(REQ, TRACE, ("AddressIndex:\r\n")); - DBGLOG_MEM8(REQ, TRACE, prNewKey->aucAddrIndex, 12); - prNewKey->u4LenWPIEK = 16; - - DBGLOG_MEM8(REQ, TRACE, (PUINT_8)prNewKey->aucWPIEK, (UINT_8)prNewKey->u4LenWPIEK); - prNewKey->u4LenWPICK = 16; - - DBGLOG(REQ, TRACE, ("CK Key(%d):\r\n", (UINT_8)prNewKey->u4LenWPICK)); - DBGLOG_MEM8(REQ, TRACE, (PUINT_8)prNewKey->aucWPICK, (UINT_8)prNewKey->u4LenWPICK); - DBGLOG(REQ, TRACE, ("PN:\r\n")); - if (prNewKey->eKeyType == 0){ - prNewKey->aucPN[0] = 0x5c; - prNewKey->aucPN[1] = 0x36; - prNewKey->aucPN[2] = 0x5c; - prNewKey->aucPN[3] = 0x36; - prNewKey->aucPN[4] = 0x5c; - prNewKey->aucPN[5] = 0x36; - prNewKey->aucPN[6] = 0x5c; - prNewKey->aucPN[7] = 0x36; - prNewKey->aucPN[8] = 0x5c; - prNewKey->aucPN[9] = 0x36; - prNewKey->aucPN[10] = 0x5c; - prNewKey->aucPN[11] = 0x36; - prNewKey->aucPN[12] = 0x5c; - prNewKey->aucPN[13] = 0x36; - prNewKey->aucPN[14] = 0x5c; - prNewKey->aucPN[15] = 0x36; - } - - DBGLOG_MEM8(REQ, TRACE, (PUINT_8)prNewKey->aucPN, 16); - - prGlueInfo = prAdapter->prGlueInfo; - - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, (CMD_HDR_SIZE + u4SetBufferLen)); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - - // compose CMD_ID_ADD_REMOVE_KEY cmd pkt - prCmdInfo->eCmdType = COMMAND_TYPE_NETWORK_IOCTL; - prCmdInfo->eNetworkType = NETWORK_TYPE_AIS_INDEX; - prCmdInfo->u2InfoBufLen = CMD_HDR_SIZE + sizeof(CMD_802_11_KEY); - prCmdInfo->pfCmdDoneHandler = nicCmdEventSetCommon; - prCmdInfo->pfCmdTimeoutHandler = nicOidCmdTimeoutCommon; - prCmdInfo->fgIsOid = TRUE; - prCmdInfo->ucCID = CMD_ID_ADD_REMOVE_KEY; - prCmdInfo->fgSetQuery = TRUE; - prCmdInfo->fgNeedResp = FALSE; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = u4SetBufferLen; - prCmdInfo->pvInformationBuffer = pvSetBuffer; - prCmdInfo->u4InformationBufferLength = u4SetBufferLen; - - // Setup WIFI_CMD_T - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - prCmdKey = (P_CMD_802_11_KEY)(prWifiCmd->aucBuffer); - - kalMemZero(prCmdKey, sizeof(CMD_802_11_KEY)); - - prCmdKey->ucAddRemove = 1; /* Add */ - - if (prNewKey->eKeyType == ENUM_WPI_PAIRWISE_KEY) { - prCmdKey->ucTxKey = 1; - prCmdKey->ucKeyType = 1; - } - - kalMemCopy(prCmdKey->aucPeerAddr, (PUINT_8)prNewKey->aucAddrIndex, MAC_ADDR_LEN); - - prCmdKey->ucNetType = 0; /* AIS */ - - prCmdKey->ucKeyId = prNewKey->ucKeyID; - - prCmdKey->ucKeyLen = 32; - - prCmdKey->ucAlgorithmId = CIPHER_SUITE_WPI; - - kalMemCopy(prCmdKey->aucKeyMaterial, (PUINT_8)prNewKey->aucWPIEK, 16); - - kalMemCopy(prCmdKey->aucKeyMaterial+16, (PUINT_8)prNewKey->aucWPICK, 16); - - kalMemCopy(prCmdKey->aucKeyRsc, (PUINT_8)prNewKey->aucPN, 16); - - // insert into prCmdQueue - kalEnqueueCommand(prGlueInfo, (P_QUE_ENTRY_T)prCmdInfo); - - // wakeup txServiceThread later - GLUE_SET_EVENT(prGlueInfo); - - return WLAN_STATUS_PENDING; -} /* wlanoidSetAddKey */ -#endif - - -#if CFG_SUPPORT_WPS2 -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called by WSC to set the assoc info, which is needed to add to -* Association request frame while join WPS AP. -* -* \param[in] prAdapter Pointer to the Adapter structure -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set -* \param[in] u4SetBufferLen The length of the set buffer -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed due to invalid length of -* the set buffer, returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_DATA If new setting value is wrong. -* \retval WLAN_STATUS_INVALID_LENGTH -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetWSCAssocInfo ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - DEBUGFUNC("wlanoidSetWSCAssocInfo"); - DBGLOG(REQ, LOUD, ("\r\n")); - - if(u4SetBufferLen == 0) - return WLAN_STATUS_INVALID_LENGTH; - - *pu4SetInfoLen = u4SetBufferLen; - - kalMemCopy(prAdapter->prGlueInfo->aucWSCAssocInfoIE, pvSetBuffer, u4SetBufferLen); - prAdapter->prGlueInfo->u2WSCAssocInfoIELen = (UINT_16)u4SetBufferLen; - DBGLOG(SEC, TRACE, ("Assoc Info IE sz %ld\n", u4SetBufferLen)); - - return WLAN_STATUS_SUCCESS; - -} -#endif - - -#if CFG_ENABLE_WAKEUP_ON_LAN -WLAN_STATUS -wlanoidSetAddWakeupPattern ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_PM_PACKET_PATTERN prPacketPattern; - - DEBUGFUNC("wlanoidSetAddWakeupPattern"); - DBGLOG(REQ, LOUD, ("\r\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_PM_PACKET_PATTERN); - - if (u4SetBufferLen < sizeof(PARAM_PM_PACKET_PATTERN)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - - prPacketPattern = (P_PARAM_PM_PACKET_PATTERN) pvSetBuffer; - - /* FIXME: - * Send the struct to firmware */ - - return WLAN_STATUS_FAILURE; -} - - -WLAN_STATUS -wlanoidSetRemoveWakeupPattern ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_PM_PACKET_PATTERN prPacketPattern; - - DEBUGFUNC("wlanoidSetAddWakeupPattern"); - DBGLOG(REQ, LOUD, ("\r\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_PM_PACKET_PATTERN); - - if (u4SetBufferLen < sizeof(PARAM_PM_PACKET_PATTERN)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - - prPacketPattern = (P_PARAM_PM_PACKET_PATTERN) pvSetBuffer; - - /* FIXME: - * Send the struct to firmware */ - - return WLAN_STATUS_FAILURE; -} - - -WLAN_STATUS -wlanoidQueryEnableWakeup ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - PUINT_32 pu4WakeupEventEnable; - - DEBUGFUNC("wlanoidQueryEnableWakeup"); - DBGLOG(REQ, LOUD, ("\r\n")); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(UINT_32); - - if (u4QueryBufferLen < sizeof(UINT_32)) { - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - pu4WakeupEventEnable = (PUINT_32)pvQueryBuffer; - - *pu4WakeupEventEnable = prAdapter->u4WakeupEventEnable; - - return WLAN_STATUS_SUCCESS; -} - -WLAN_STATUS -wlanoidSetEnableWakeup ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - PUINT_32 pu4WakeupEventEnable; - - DEBUGFUNC("wlanoidSetEnableWakup"); - DBGLOG(REQ, LOUD, ("\r\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(UINT_32); - - if (u4SetBufferLen < sizeof(UINT_32)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - - pu4WakeupEventEnable = (PUINT_32)pvSetBuffer; - prAdapter->u4WakeupEventEnable = *pu4WakeupEventEnable; - - /* FIXME: - * Send Command Event for setting wakeup-pattern / Magic Packet to firmware - * */ - - return WLAN_STATUS_FAILURE; -} -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to configure PS related settings for WMM-PS test. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetWiFiWmmPsTest ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_CUSTOM_WMM_PS_TEST_STRUC_T prWmmPsTestInfo; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - CMD_SET_WMM_PS_TEST_STRUC_T rSetWmmPsTestParam; - UINT_16 u2CmdBufLen; - P_PM_PROFILE_SETUP_INFO_T prPmProfSetupInfo; - P_BSS_INFO_T prBssInfo; - - DEBUGFUNC("wlanoidSetWiFiWmmPsTest"); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - - *pu4SetInfoLen = sizeof(PARAM_CUSTOM_WMM_PS_TEST_STRUC_T); - - prWmmPsTestInfo = (P_PARAM_CUSTOM_WMM_PS_TEST_STRUC_T) pvSetBuffer; - - rSetWmmPsTestParam.ucNetTypeIndex = NETWORK_TYPE_AIS_INDEX; - rSetWmmPsTestParam.bmfgApsdEnAc = prWmmPsTestInfo->bmfgApsdEnAc; - rSetWmmPsTestParam.ucIsEnterPsAtOnce = prWmmPsTestInfo->ucIsEnterPsAtOnce; - rSetWmmPsTestParam.ucIsDisableUcTrigger = prWmmPsTestInfo->ucIsDisableUcTrigger; - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[rSetWmmPsTestParam.ucNetTypeIndex]); - prPmProfSetupInfo = &prBssInfo->rPmProfSetupInfo; - prPmProfSetupInfo->ucBmpDeliveryAC = (rSetWmmPsTestParam.bmfgApsdEnAc >> 4) & BITS(0, 3); - prPmProfSetupInfo->ucBmpTriggerAC = rSetWmmPsTestParam.bmfgApsdEnAc & BITS(0, 3); - - u2CmdBufLen = sizeof(CMD_SET_WMM_PS_TEST_STRUC_T); - -#if 0 - /* it will apply the disable trig or not immediately */ - if (prPmInfo->ucWmmPsDisableUcPoll && prPmInfo->ucWmmPsConnWithTrig) { -// NIC_PM_WMM_PS_DISABLE_UC_TRIG(prAdapter, TRUE); - } - else { -// NIC_PM_WMM_PS_DISABLE_UC_TRIG(prAdapter, FALSE); - } -#endif - - rStatus = wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_WMM_PS_TEST_PARMS, - TRUE, - FALSE, - TRUE, - NULL, // TODO? - NULL, - u2CmdBufLen, - (PUINT_8)&rSetWmmPsTestParam, - NULL, - 0); - - - return rStatus; -} /* wlanoidSetWiFiWmmPsTest */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to configure enable/disable TX A-MPDU feature. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetTxAmpdu ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - CMD_TX_AMPDU_T rTxAmpdu; - UINT_16 u2CmdBufLen; - PBOOLEAN pfgEnable; - - DEBUGFUNC("wlanoidSetTxAmpdu"); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - - *pu4SetInfoLen = sizeof(BOOLEAN); - - pfgEnable = (PBOOLEAN) pvSetBuffer; - - rTxAmpdu.fgEnable = *pfgEnable; - - u2CmdBufLen = sizeof(CMD_TX_AMPDU_T); - - rStatus = wlanSendSetQueryCmd(prAdapter, - CMD_ID_TX_AMPDU, - TRUE, - FALSE, - TRUE, - NULL, - NULL, - u2CmdBufLen, - (PUINT_8)&rTxAmpdu, - NULL, - 0); - - - return rStatus; -} /* wlanoidSetTxAmpdu */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to configure reject/accept ADDBA Request. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetAddbaReject( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - CMD_ADDBA_REJECT_T rAddbaReject; - UINT_16 u2CmdBufLen; - PBOOLEAN pfgEnable; - - DEBUGFUNC("wlanoidSetAddbaReject"); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - - *pu4SetInfoLen = sizeof(BOOLEAN); - - pfgEnable = (PBOOLEAN) pvSetBuffer; - - rAddbaReject.fgEnable = *pfgEnable; - - u2CmdBufLen = sizeof(CMD_ADDBA_REJECT_T); - - rStatus = wlanSendSetQueryCmd(prAdapter, - CMD_ID_ADDBA_REJECT, - TRUE, - FALSE, - TRUE, - NULL, - NULL, - u2CmdBufLen, - (PUINT_8)&rAddbaReject, - NULL, - 0); - - - return rStatus; -} /* wlanoidSetAddbaReject */ - - -#if CFG_SLT_SUPPORT - -WLAN_STATUS -wlanoidQuerySLTStatus ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_SUCCESS; - P_PARAM_MTK_SLT_TEST_STRUC_T prMtkSltInfo = (P_PARAM_MTK_SLT_TEST_STRUC_T)NULL; - P_SLT_INFO_T prSltInfo = (P_SLT_INFO_T)NULL; - - DEBUGFUNC("wlanoidQuerySLTStatus"); - DBGLOG(REQ, LOUD, ("\r\n")); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - - *pu4QueryInfoLen = sizeof(PARAM_MTK_SLT_TEST_STRUC_T); - - if (u4QueryBufferLen < sizeof(PARAM_MTK_SLT_TEST_STRUC_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvQueryBuffer); - - prMtkSltInfo = (P_PARAM_MTK_SLT_TEST_STRUC_T)pvQueryBuffer; - - prSltInfo = &(prAdapter->rWifiVar.rSltInfo); - - switch (prMtkSltInfo->rSltFuncIdx) { - case ENUM_MTK_SLT_FUNC_LP_SET: - { - P_PARAM_MTK_SLT_LP_TEST_STRUC_T prLpSetting = (P_PARAM_MTK_SLT_LP_TEST_STRUC_T)NULL; - - ASSERT(prMtkSltInfo->u4FuncInfoLen == sizeof(PARAM_MTK_SLT_LP_TEST_STRUC_T)); - - prLpSetting = (P_PARAM_MTK_SLT_LP_TEST_STRUC_T)&prMtkSltInfo->unFuncInfoContent; - - prLpSetting->u4BcnRcvNum = prSltInfo->u4BeaconReceiveCnt; - } - break; - default: - // TBD... - break; - } - - return rWlanStatus; -} /* wlanoidQuerySLTStatus */ - -WLAN_STATUS -wlanoidUpdateSLTMode ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_SUCCESS; - P_PARAM_MTK_SLT_TEST_STRUC_T prMtkSltInfo = (P_PARAM_MTK_SLT_TEST_STRUC_T)NULL; - P_SLT_INFO_T prSltInfo = (P_SLT_INFO_T)NULL; - P_BSS_DESC_T prBssDesc = (P_BSS_DESC_T)NULL; - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - P_BSS_INFO_T prBssInfo = (P_BSS_INFO_T)NULL; - - /* 1. Action: Update or Initial Set - * 2. Role. - * 3. Target MAC address. - * 4. RF BW & Rate Settings - */ - - DEBUGFUNC("wlanoidUpdateSLTMode"); - DBGLOG(REQ, LOUD, ("\r\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_MTK_SLT_TEST_STRUC_T); - - if (u4SetBufferLen < sizeof(PARAM_MTK_SLT_TEST_STRUC_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - - prMtkSltInfo = (P_PARAM_MTK_SLT_TEST_STRUC_T) pvSetBuffer; - - prSltInfo = &(prAdapter->rWifiVar.rSltInfo); - prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]; - - switch (prMtkSltInfo->rSltFuncIdx) { - case ENUM_MTK_SLT_FUNC_INITIAL: /* Initialize */ - { - P_PARAM_MTK_SLT_INITIAL_STRUC_T prMtkSltInit = (P_PARAM_MTK_SLT_INITIAL_STRUC_T)NULL; - - ASSERT(prMtkSltInfo->u4FuncInfoLen == sizeof(PARAM_MTK_SLT_INITIAL_STRUC_T)); - - prMtkSltInit = (P_PARAM_MTK_SLT_INITIAL_STRUC_T)&prMtkSltInfo->unFuncInfoContent; - - if (prSltInfo->prPseudoStaRec != NULL) { - /* The driver has been initialized. */ - prSltInfo->prPseudoStaRec = NULL; - } - - - prSltInfo->prPseudoBssDesc = scanSearchExistingBssDesc(prAdapter, - BSS_TYPE_IBSS, - prMtkSltInit->aucTargetMacAddr, - prMtkSltInit->aucTargetMacAddr); - - prSltInfo->u2SiteID = prMtkSltInit->u2SiteID; - - /* Bandwidth 2.4G: Channel 1~14 - * Bandwidth 5G: *36, 40, 44, 48, 52, 56, 60, 64, - * *100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, - * 149, 153, *157, 161, - * 184, 188, 192, 196, 200, 204, 208, 212, *216 - */ - prSltInfo->ucChannel2G4 = 1 + (prSltInfo->u2SiteID % 4) * 5; - - switch (prSltInfo->ucChannel2G4) { - case 1: - prSltInfo->ucChannel5G = 36; - break; - case 6: - prSltInfo->ucChannel5G = 52; - break; - case 11: - prSltInfo->ucChannel5G = 104; - break; - case 16: - prSltInfo->ucChannel2G4 = 14; - prSltInfo->ucChannel5G = 161; - break; - default: - ASSERT(FALSE); - } - - if (prSltInfo->prPseudoBssDesc == NULL) { - do { - prSltInfo->prPseudoBssDesc = scanAllocateBssDesc(prAdapter); - - if (prSltInfo->prPseudoBssDesc == NULL) { - rWlanStatus = WLAN_STATUS_FAILURE; - break; - } - else { - prBssDesc = prSltInfo->prPseudoBssDesc; - } - } while (FALSE); - } - else { - prBssDesc = prSltInfo->prPseudoBssDesc; - } - - if (prBssDesc) { - prBssDesc->eBSSType = BSS_TYPE_IBSS; - - COPY_MAC_ADDR(prBssDesc->aucSrcAddr, prMtkSltInit->aucTargetMacAddr); - COPY_MAC_ADDR(prBssDesc->aucBSSID, prBssInfo->aucOwnMacAddr); - - prBssDesc->u2BeaconInterval = 100; - prBssDesc->u2ATIMWindow = 0; - prBssDesc->ucDTIMPeriod = 1; - - prBssDesc->u2IELength = 0; - - prBssDesc->fgIsERPPresent = TRUE; - prBssDesc->fgIsHTPresent = TRUE; - - prBssDesc->u2OperationalRateSet = BIT(RATE_36M_INDEX); - prBssDesc->u2BSSBasicRateSet = BIT(RATE_36M_INDEX); - prBssDesc->fgIsUnknownBssBasicRate = FALSE; - - prBssDesc->fgIsLargerTSF = TRUE; - - prBssDesc->eBand = BAND_2G4; - - prBssDesc->ucChannelNum = prSltInfo->ucChannel2G4; - - prBssDesc->ucPhyTypeSet = PHY_TYPE_SET_802_11ABGN; - - GET_CURRENT_SYSTIME(&prBssDesc->rUpdateTime); - } - } - break; - case ENUM_MTK_SLT_FUNC_RATE_SET: /* Update RF Settings. */ - if (prSltInfo->prPseudoStaRec == NULL) { - rWlanStatus = WLAN_STATUS_FAILURE; - } - else { - P_PARAM_MTK_SLT_TR_TEST_STRUC_T prTRSetting = (P_PARAM_MTK_SLT_TR_TEST_STRUC_T)NULL; - - ASSERT(prMtkSltInfo->u4FuncInfoLen == sizeof(PARAM_MTK_SLT_TR_TEST_STRUC_T)); - - prStaRec = prSltInfo->prPseudoStaRec; - prTRSetting = (P_PARAM_MTK_SLT_TR_TEST_STRUC_T)&prMtkSltInfo->unFuncInfoContent; - - if (prTRSetting->rNetworkType == PARAM_NETWORK_TYPE_OFDM5) { - prBssInfo->eBand = BAND_5G; - prBssInfo->ucPrimaryChannel = prSltInfo->ucChannel5G; - } - if (prTRSetting->rNetworkType == PARAM_NETWORK_TYPE_OFDM24) { - prBssInfo->eBand = BAND_2G4; - prBssInfo->ucPrimaryChannel = prSltInfo->ucChannel2G4; - } - - if ((prTRSetting->u4FixedRate & FIXED_BW_DL40) != 0) { - /* RF 40 */ - prStaRec->u2HtCapInfo |= HT_CAP_INFO_SUP_CHNL_WIDTH; /* It would controls RFBW capability in WTBL. */ - prStaRec->ucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; /* This controls RF BW, RF BW would be 40 only if - * 1. PHY_TYPE_BIT_HT is TRUE. - * 2. SCO is SCA/SCB. - */ - - /* U20/L20 Control. */ - switch (prTRSetting->u4FixedRate & 0xC000) { - case FIXED_EXT_CHNL_U20: - prBssInfo->eBssSCO = CHNL_EXT_SCB; // +2 - if (prTRSetting->rNetworkType == PARAM_NETWORK_TYPE_OFDM5) { - prBssInfo->ucPrimaryChannel += 2; - } - else { - if (prBssInfo->ucPrimaryChannel <5) { - prBssInfo->ucPrimaryChannel = 8; // For channel 1, testing L20 at channel 8. - } - } - break; - case FIXED_EXT_CHNL_L20: - default: /* 40M */ - prBssInfo->eBssSCO = CHNL_EXT_SCA; // -2 - if (prTRSetting->rNetworkType == PARAM_NETWORK_TYPE_OFDM5) { - prBssInfo->ucPrimaryChannel -= 2; - } - else { - if (prBssInfo->ucPrimaryChannel > 10) { - prBssInfo->ucPrimaryChannel = 3; // For channel 11 / 14. testing U20 at channel 3. - } - } - break; - } - } - else { - /* RF 20 */ - prStaRec->u2HtCapInfo &= ~HT_CAP_INFO_SUP_CHNL_WIDTH; - prBssInfo->eBssSCO = CHNL_EXT_SCN; - } - - prBssInfo->fgErpProtectMode = FALSE; - prBssInfo->eHtProtectMode = HT_PROTECT_MODE_NONE; - prBssInfo->eGfOperationMode = GF_MODE_NORMAL; - - nicUpdateBss(prAdapter, prBssInfo->ucNetTypeIndex); - - prStaRec->u2HtCapInfo &= ~(HT_CAP_INFO_SHORT_GI_20M | HT_CAP_INFO_SHORT_GI_40M); - - switch (prTRSetting->u4FixedRate & 0xFF) { - case RATE_OFDM_54M: - prStaRec->u2DesiredNonHTRateSet = BIT(RATE_54M_INDEX); - break; - case RATE_OFDM_48M: - prStaRec->u2DesiredNonHTRateSet = BIT(RATE_48M_INDEX); - break; - case RATE_OFDM_36M: - prStaRec->u2DesiredNonHTRateSet = BIT(RATE_36M_INDEX); - break; - case RATE_OFDM_24M: - prStaRec->u2DesiredNonHTRateSet = BIT(RATE_24M_INDEX); - break; - case RATE_OFDM_6M: - prStaRec->u2DesiredNonHTRateSet = BIT(RATE_6M_INDEX); - break; - case RATE_CCK_11M_LONG: - prStaRec->u2DesiredNonHTRateSet = BIT(RATE_11M_INDEX); - break; - case RATE_CCK_1M_LONG: - prStaRec->u2DesiredNonHTRateSet = BIT(RATE_1M_INDEX); - break; - case RATE_GF_MCS_0: - prStaRec->u2DesiredNonHTRateSet = BIT(RATE_HT_PHY_INDEX); - prStaRec->u2HtCapInfo |= HT_CAP_INFO_HT_GF; - break; - case RATE_MM_MCS_7: - prStaRec->u2DesiredNonHTRateSet = BIT(RATE_HT_PHY_INDEX); - prStaRec->u2HtCapInfo &= ~HT_CAP_INFO_HT_GF; -#if 0 // Only for Current Measurement Mode. - prStaRec->u2HtCapInfo |= (HT_CAP_INFO_SHORT_GI_20M | HT_CAP_INFO_SHORT_GI_40M); -#endif - break; - case RATE_GF_MCS_7: - prStaRec->u2DesiredNonHTRateSet = BIT(RATE_HT_PHY_INDEX); - prStaRec->u2HtCapInfo |= HT_CAP_INFO_HT_GF; - break; - default: - prStaRec->u2DesiredNonHTRateSet = BIT(RATE_36M_INDEX); - break; - } - - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_3); - - } - break; - case ENUM_MTK_SLT_FUNC_LP_SET: /* Reset LP Test Result. */ - { - P_PARAM_MTK_SLT_LP_TEST_STRUC_T prLpSetting = (P_PARAM_MTK_SLT_LP_TEST_STRUC_T)NULL; - - ASSERT(prMtkSltInfo->u4FuncInfoLen == sizeof(PARAM_MTK_SLT_LP_TEST_STRUC_T)); - - prLpSetting = (P_PARAM_MTK_SLT_LP_TEST_STRUC_T)&prMtkSltInfo->unFuncInfoContent; - - if (prSltInfo->prPseudoBssDesc == NULL) { - /* Please initial SLT Mode first. */ - break; - } - else { - prBssDesc = prSltInfo->prPseudoBssDesc; - } - - switch (prLpSetting->rLpTestMode) { - case ENUM_MTK_LP_TEST_NORMAL: - /* In normal mode, we would use target MAC address to be the BSSID. */ - COPY_MAC_ADDR(prBssDesc->aucBSSID, prBssInfo->aucOwnMacAddr); - prSltInfo->fgIsDUT = FALSE; - break; - case ENUM_MTK_LP_TEST_GOLDEN_SAMPLE: - /* 1. Lower AIFS of BCN queue. - * 2. Fixed Random Number tobe 0. - */ - prSltInfo->fgIsDUT = FALSE; - /* In LP test mode, we would use MAC address of Golden Sample to be the BSSID. */ - COPY_MAC_ADDR(prBssDesc->aucBSSID, prBssInfo->aucOwnMacAddr); - break; - case ENUM_MTK_LP_TEST_DUT: - /* 1. Enter Sleep Mode. - * 2. Fix random number a large value & enlarge AIFN of BCN queue. - */ - COPY_MAC_ADDR(prBssDesc->aucBSSID, prBssDesc->aucSrcAddr); - prSltInfo->u4BeaconReceiveCnt = 0; - prSltInfo->fgIsDUT = TRUE; - break; - } - - } - - break; - default: - break; - } - - - - - return WLAN_STATUS_FAILURE; - - - return rWlanStatus; -} /* wlanoidUpdateSLTMode */ -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query NVRAM value. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuf A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryNvramRead ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - P_PARAM_CUSTOM_NVRAM_RW_STRUCT_T prNvramRwInfo; - UINT_16 u2Data; - BOOLEAN fgStatus; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - - DEBUGFUNC("wlanoidQueryNvramRead"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(PARAM_CUSTOM_NVRAM_RW_STRUCT_T); - - if (u4QueryBufferLen < sizeof(PARAM_CUSTOM_NVRAM_RW_STRUCT_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - prNvramRwInfo = (P_PARAM_CUSTOM_NVRAM_RW_STRUCT_T)pvQueryBuffer; - - if(prNvramRwInfo->ucEepromMethod == PARAM_EEPROM_READ_METHOD_READ) { - fgStatus = kalCfgDataRead16(prAdapter->prGlueInfo, - prNvramRwInfo->ucEepromIndex << 1, /* change to byte offset */ - &u2Data); - - if(fgStatus) { - prNvramRwInfo->u2EepromData = u2Data; - DBGLOG(REQ, INFO, ("NVRAM Read: index=%#X, data=%#02X\r\n", - prNvramRwInfo->ucEepromIndex, u2Data)); - } - else{ - DBGLOG(REQ, ERROR, ("NVRAM Read Failed: index=%#x.\r\n", - prNvramRwInfo->ucEepromIndex)); - rStatus = WLAN_STATUS_FAILURE; - } - } - else if (prNvramRwInfo->ucEepromMethod == PARAM_EEPROM_READ_METHOD_GETSIZE) { - prNvramRwInfo->u2EepromData = CFG_FILE_WIFI_REC_SIZE; - DBGLOG(REQ, INFO, ("EEPROM size =%d\r\n", prNvramRwInfo->u2EepromData)); - } - - *pu4QueryInfoLen = sizeof(PARAM_CUSTOM_EEPROM_RW_STRUC_T); - - return rStatus; -} /* wlanoidQueryNvramRead */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to write NVRAM value. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetNvramWrite ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_CUSTOM_NVRAM_RW_STRUCT_T prNvramRwInfo; - BOOLEAN fgStatus; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - - - DEBUGFUNC("wlanoidSetNvramWrite"); - DBGLOG(INIT, LOUD,("\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_CUSTOM_NVRAM_RW_STRUCT_T); - - if (u4SetBufferLen < sizeof(PARAM_CUSTOM_NVRAM_RW_STRUCT_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - - prNvramRwInfo = (P_PARAM_CUSTOM_NVRAM_RW_STRUCT_T)pvSetBuffer; - - fgStatus = kalCfgDataWrite16(prAdapter->prGlueInfo, - prNvramRwInfo->ucEepromIndex << 1, /* change to byte offset */ - prNvramRwInfo->u2EepromData - ); - - if(fgStatus == FALSE){ - DBGLOG(REQ, ERROR, ("NVRAM Write Failed.\r\n")); - rStatus = WLAN_STATUS_FAILURE; - } - - return rStatus; -} /* wlanoidSetNvramWrite */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to get the config data source type. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryCfgSrcType( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - ASSERT(prAdapter); - - *pu4QueryInfoLen = sizeof(ENUM_CFG_SRC_TYPE_T); - - if(kalIsConfigurationExist(prAdapter->prGlueInfo) == TRUE) { - *(P_ENUM_CFG_SRC_TYPE_T)pvQueryBuffer = CFG_SRC_TYPE_NVRAM; - } - else { - *(P_ENUM_CFG_SRC_TYPE_T)pvQueryBuffer = CFG_SRC_TYPE_EEPROM; - } - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to get the config data source type. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryEepromType( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - ASSERT(prAdapter); - - *pu4QueryInfoLen = sizeof(P_ENUM_EEPROM_TYPE_T); - -#if CFG_SUPPORT_NIC_CAPABILITY - if(prAdapter->fgIsEepromUsed == TRUE) { - *( P_ENUM_EEPROM_TYPE_T )pvQueryBuffer = EEPROM_TYPE_PRESENT; - } - else { - *( P_ENUM_EEPROM_TYPE_T )pvQueryBuffer = EEPROM_TYPE_NO; - } -#else - *( P_ENUM_EEPROM_TYPE_T )pvQueryBuffer = EEPROM_TYPE_NO; -#endif - - return WLAN_STATUS_SUCCESS; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to get the config data source type. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetCountryCode ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - PUINT_8 pucCountry; - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(u4SetBufferLen == 2); - - *pu4SetInfoLen = 2; - - pucCountry = pvSetBuffer; - - prAdapter->rWifiVar.rConnSettings.u2CountryCode = - (((UINT_16) pucCountry[0]) << 8) | ((UINT_16) pucCountry[1]) ; - - prAdapter->prDomainInfo = NULL; /* Force to re-search country code */ - rlmDomainSendCmd(prAdapter, TRUE); - - return WLAN_STATUS_SUCCESS; -} - -#if 0 -WLAN_STATUS -wlanoidSetNoaParam ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_CUSTOM_NOA_PARAM_STRUC_T prNoaParam; - CMD_CUSTOM_NOA_PARAM_STRUC_T rCmdNoaParam; - - DEBUGFUNC("wlanoidSetNoaParam"); - DBGLOG(INIT, LOUD,("\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_CUSTOM_NOA_PARAM_STRUC_T); - - if (u4SetBufferLen < sizeof(PARAM_CUSTOM_NOA_PARAM_STRUC_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - - prNoaParam = (P_PARAM_CUSTOM_NOA_PARAM_STRUC_T)pvSetBuffer; - - kalMemZero(&rCmdNoaParam, sizeof(CMD_CUSTOM_NOA_PARAM_STRUC_T)); - rCmdNoaParam.u4NoaDurationMs = prNoaParam->u4NoaDurationMs; - rCmdNoaParam.u4NoaIntervalMs = prNoaParam->u4NoaIntervalMs; - rCmdNoaParam.u4NoaCount = prNoaParam->u4NoaCount; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_NOA_PARAM, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_CUSTOM_NOA_PARAM_STRUC_T), - (PUINT_8)&rCmdNoaParam, - pvSetBuffer, - u4SetBufferLen - ); -} - -WLAN_STATUS -wlanoidSetOppPsParam ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_CUSTOM_OPPPS_PARAM_STRUC_T prOppPsParam; - CMD_CUSTOM_OPPPS_PARAM_STRUC_T rCmdOppPsParam; - - DEBUGFUNC("wlanoidSetOppPsParam"); - DBGLOG(INIT, LOUD,("\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_CUSTOM_OPPPS_PARAM_STRUC_T); - - if (u4SetBufferLen < sizeof(PARAM_CUSTOM_OPPPS_PARAM_STRUC_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - - prOppPsParam = (P_PARAM_CUSTOM_OPPPS_PARAM_STRUC_T)pvSetBuffer; - - kalMemZero(&rCmdOppPsParam, sizeof(CMD_CUSTOM_OPPPS_PARAM_STRUC_T)); - rCmdOppPsParam.u4CTwindowMs = prOppPsParam->u4CTwindowMs; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_OPPPS_PARAM, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_CUSTOM_OPPPS_PARAM_STRUC_T), - (PUINT_8)&rCmdOppPsParam, - pvSetBuffer, - u4SetBufferLen - ); -} - -WLAN_STATUS -wlanoidSetUApsdParam ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_CUSTOM_UAPSD_PARAM_STRUC_T prUapsdParam; - CMD_CUSTOM_UAPSD_PARAM_STRUC_T rCmdUapsdParam; - P_PM_PROFILE_SETUP_INFO_T prPmProfSetupInfo; - P_BSS_INFO_T prBssInfo; - - - DEBUGFUNC("wlanoidSetUApsdParam"); - DBGLOG(INIT, LOUD,("\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_CUSTOM_UAPSD_PARAM_STRUC_T); - - if (u4SetBufferLen < sizeof(PARAM_CUSTOM_UAPSD_PARAM_STRUC_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - prPmProfSetupInfo = &prBssInfo->rPmProfSetupInfo; - - prUapsdParam = (P_PARAM_CUSTOM_UAPSD_PARAM_STRUC_T)pvSetBuffer; - - kalMemZero(&rCmdUapsdParam, sizeof(CMD_CUSTOM_OPPPS_PARAM_STRUC_T)); - rCmdUapsdParam.fgEnAPSD = prUapsdParam->fgEnAPSD; - prAdapter->rWifiVar.fgSupportUAPSD = prUapsdParam->fgEnAPSD; - - rCmdUapsdParam.fgEnAPSD_AcBe = prUapsdParam->fgEnAPSD_AcBe; - rCmdUapsdParam.fgEnAPSD_AcBk = prUapsdParam->fgEnAPSD_AcBk; - rCmdUapsdParam.fgEnAPSD_AcVo = prUapsdParam->fgEnAPSD_AcVo; - rCmdUapsdParam.fgEnAPSD_AcVi = prUapsdParam->fgEnAPSD_AcVi; - prPmProfSetupInfo->ucBmpDeliveryAC = - ((prUapsdParam->fgEnAPSD_AcBe << 0) | - (prUapsdParam->fgEnAPSD_AcBk << 1) | - (prUapsdParam->fgEnAPSD_AcVi << 2) | - (prUapsdParam->fgEnAPSD_AcVo << 3)); - prPmProfSetupInfo->ucBmpTriggerAC = - ((prUapsdParam->fgEnAPSD_AcBe << 0) | - (prUapsdParam->fgEnAPSD_AcBk << 1) | - (prUapsdParam->fgEnAPSD_AcVi << 2) | - (prUapsdParam->fgEnAPSD_AcVo << 3)); - - rCmdUapsdParam.ucMaxSpLen = prUapsdParam->ucMaxSpLen; - prPmProfSetupInfo->ucUapsdSp = prUapsdParam->ucMaxSpLen; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_UAPSD_PARAM, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_CUSTOM_OPPPS_PARAM_STRUC_T), - (PUINT_8)&rCmdUapsdParam, - pvSetBuffer, - u4SetBufferLen - ); -} -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set BT profile or BT information and the -* driver will set the built-in PTA configuration into chip. -* -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetBT ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - - P_PTA_IPC_T prPtaIpc; - - DEBUGFUNC("wlanoidSetBT.\n"); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PTA_IPC_T); - if (u4SetBufferLen != sizeof(PTA_IPC_T)) { - WARNLOG(("Invalid length %ld\n", u4SetBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail to set BT profile because of ACPI_D3\n")); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - ASSERT(pvSetBuffer); - prPtaIpc = (P_PTA_IPC_T)pvSetBuffer; - -#if CFG_SUPPORT_BCM && CFG_SUPPORT_BCM_BWCS && CFG_SUPPORT_BCM_BWCS_DEBUG - printk(KERN_INFO DRV_NAME "BCM BWCS CMD: BWCS CMD = %02x%02x%02x%02x\n", - prPtaIpc->u.aucBTPParams[0], prPtaIpc->u.aucBTPParams[1], prPtaIpc->u.aucBTPParams[2], prPtaIpc->u.aucBTPParams[3]); - - printk(KERN_INFO DRV_NAME "BCM BWCS CMD: aucBTPParams[0] = %02x, aucBTPParams[1] = %02x, aucBTPParams[2] = %02x, aucBTPParams[3] = %02x.\n", - prPtaIpc->u.aucBTPParams[0], - prPtaIpc->u.aucBTPParams[1], - prPtaIpc->u.aucBTPParams[2], - prPtaIpc->u.aucBTPParams[3]); -#endif - - wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_BWCS, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(PTA_IPC_T), - (PUINT_8)prPtaIpc, - NULL, - 0); - - return WLAN_STATUS_SUCCESS; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query current BT profile and BTCR values -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvQueryBuffer Pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryBT ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ -// P_PARAM_PTA_IPC_T prPtaIpc; -// UINT_32 u4QueryBuffLen; - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(PTA_IPC_T); - - /* Check for query buffer length */ - if (u4QueryBufferLen != sizeof(PTA_IPC_T)) { - DBGLOG(REQ, WARN, ("Invalid length %lu\n", u4QueryBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvQueryBuffer); -// prPtaIpc = (P_PTA_IPC_T)pvQueryBuffer; -// prPtaIpc->ucCmd = BT_CMD_PROFILE; -// prPtaIpc->ucLen = sizeof(prPtaIpc->u); -// nicPtaGetProfile(prAdapter, (PUINT_8)&prPtaIpc->u, &u4QueryBuffLen); - - return WLAN_STATUS_SUCCESS; -} - -#if 0 -WLAN_STATUS -wlanoidQueryBtSingleAntenna ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - P_PTA_INFO_T prPtaInfo; - PUINT_32 pu4SingleAntenna; - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(UINT_32); - - /* Check for query buffer length */ - if (u4QueryBufferLen != sizeof(UINT_32)) { - DBGLOG(REQ, WARN, ("Invalid length %lu\n", u4QueryBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvQueryBuffer); - - prPtaInfo = &prAdapter->rPtaInfo; - pu4SingleAntenna = (PUINT_32)pvQueryBuffer; - - if(prPtaInfo->fgSingleAntenna) { - //printk(KERN_WARNING DRV_NAME"Q Single Ant = 1\r\n"); - *pu4SingleAntenna = 1; - } else { - //printk(KERN_WARNING DRV_NAME"Q Single Ant = 0\r\n"); - *pu4SingleAntenna = 0; - } - - return WLAN_STATUS_SUCCESS; -} - - -WLAN_STATUS -wlanoidSetBtSingleAntenna ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - - PUINT_32 pu4SingleAntenna; - UINT_32 u4SingleAntenna; - P_PTA_INFO_T prPtaInfo; - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - prPtaInfo = &prAdapter->rPtaInfo; - - *pu4SetInfoLen = sizeof(UINT_32); - if (u4SetBufferLen != sizeof(UINT_32)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - if (IS_ARB_IN_RFTEST_STATE(prAdapter)) { - return WLAN_STATUS_SUCCESS; - } - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail to set antenna because of ACPI_D3\n")); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - ASSERT(pvSetBuffer); - pu4SingleAntenna = (PUINT_32)pvSetBuffer; - u4SingleAntenna = *pu4SingleAntenna; - - if (u4SingleAntenna == 0) { - //printk(KERN_WARNING DRV_NAME"Set Single Ant = 0\r\n"); - prPtaInfo->fgSingleAntenna = FALSE; - } else { - //printk(KERN_WARNING DRV_NAME"Set Single Ant = 1\r\n"); - prPtaInfo->fgSingleAntenna = TRUE; - } - ptaFsmRunEventSetConfig(prAdapter, &prPtaInfo->rPtaParam); - - return WLAN_STATUS_SUCCESS; -} - - -#if CFG_SUPPORT_BCM && CFG_SUPPORT_BCM_BWCS -WLAN_STATUS -wlanoidQueryPta ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - P_PTA_INFO_T prPtaInfo; - PUINT_32 pu4Pta; - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(UINT_32); - - /* Check for query buffer length */ - if (u4QueryBufferLen != sizeof(UINT_32)) { - DBGLOG(REQ, WARN, ("Invalid length %lu\n", u4QueryBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvQueryBuffer); - - prPtaInfo = &prAdapter->rPtaInfo; - pu4Pta = (PUINT_32)pvQueryBuffer; - - if(prPtaInfo->fgEnabled) { - //printk(KERN_WARNING DRV_NAME"PTA = 1\r\n"); - *pu4Pta = 1; - } else { - //printk(KERN_WARNING DRV_NAME"PTA = 0\r\n"); - *pu4Pta = 0; - } - - return WLAN_STATUS_SUCCESS; -} - - -WLAN_STATUS -wlanoidSetPta ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - PUINT_32 pu4PtaCtrl; - UINT_32 u4PtaCtrl; - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(UINT_32); - if (u4SetBufferLen != sizeof(UINT_32)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - if (IS_ARB_IN_RFTEST_STATE(prAdapter)) { - return WLAN_STATUS_SUCCESS; - } - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail to set BT setting because of ACPI_D3\n")); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - ASSERT(pvSetBuffer); - pu4PtaCtrl = (PUINT_32)pvSetBuffer; - u4PtaCtrl = *pu4PtaCtrl; - - if (u4PtaCtrl == 0) { - //printk(KERN_WARNING DRV_NAME"Set Pta= 0\r\n"); - nicPtaSetFunc(prAdapter, FALSE); - } else { - //printk(KERN_WARNING DRV_NAME"Set Pta= 1\r\n"); - nicPtaSetFunc(prAdapter, TRUE); - } - - return WLAN_STATUS_SUCCESS; -} -#endif - -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set Tx power profile. -* -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetTxPower ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - //P_SET_TXPWR_CTRL_T pTxPwr = (P_SET_TXPWR_CTRL_T)pvSetBuffer; - //UINT_32 i; - WLAN_STATUS rStatus; - - DEBUGFUNC("wlanoidSetTxPower"); - DBGLOG(REQ, LOUD, ("\r\n")); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - -#if 0 - printk("c2GLegacyStaPwrOffset=%d\n", pTxPwr->c2GLegacyStaPwrOffset); - printk("c2GHotspotPwrOffset=%d\n", pTxPwr->c2GHotspotPwrOffset); - printk("c2GP2pPwrOffset=%d\n", pTxPwr->c2GP2pPwrOffset); - printk("c2GBowPwrOffset=%d\n", pTxPwr->c2GBowPwrOffset); - printk("c5GLegacyStaPwrOffset=%d\n", pTxPwr->c5GLegacyStaPwrOffset); - printk("c5GHotspotPwrOffset=%d\n", pTxPwr->c5GHotspotPwrOffset); - printk("c5GP2pPwrOffset=%d\n", pTxPwr->c5GP2pPwrOffset); - printk("c5GBowPwrOffset=%d\n", pTxPwr->c5GBowPwrOffset); - printk("ucConcurrencePolicy=%d\n", pTxPwr->ucConcurrencePolicy); - - for (i=0; i<14;i++) - printk("acTxPwrLimit2G[%d]=%d\n", i, pTxPwr->acTxPwrLimit2G[i]); - - for (i=0; i<4;i++) - printk("acTxPwrLimit5G[%d]=%d\n", i, pTxPwr->acTxPwrLimit5G[i]); -#endif - - rStatus = wlanSendSetQueryCmd ( - prAdapter, /* prAdapter */ - CMD_ID_SET_TXPWR_CTRL, /* ucCID */ - TRUE, /* fgSetQuery */ - FALSE, /* fgNeedResp */ - TRUE, /* fgIsOid */ - NULL, /* pfCmdDoneHandler*/ - NULL, /* pfCmdTimeoutHandler */ - u4SetBufferLen, /* u4SetQueryInfoLen */ - (PUINT_8) pvSetBuffer, /* pucInfoBuffer */ - NULL, /* pvSetQueryBuffer */ - 0 /* u4SetQueryBufferLen */ - ); - - ASSERT(rStatus == WLAN_STATUS_PENDING); - - return rStatus; - -} - -WLAN_STATUS -wlanSendMemDumpCmd ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen - ) -{ - P_PARAM_CUSTOM_MEM_DUMP_STRUC_T prMemDumpInfo; - P_CMD_DUMP_MEM prCmdDumpMem; - CMD_DUMP_MEM rCmdDumpMem; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4MemSize = PARAM_MEM_DUMP_MAX_SIZE; - - UINT_32 u4RemainLeng = 0; - UINT_32 u4CurAddr = 0; - UINT_8 ucFragNum = 0; - - prCmdDumpMem = &rCmdDumpMem; - prMemDumpInfo = (P_PARAM_CUSTOM_MEM_DUMP_STRUC_T)pvQueryBuffer; - - u4RemainLeng = prMemDumpInfo->u4RemainLength; - u4CurAddr = prMemDumpInfo->u4Address + prMemDumpInfo->u4Length; - ucFragNum = prMemDumpInfo->ucFragNum + 1; - - /* Query. If request length is larger than max length, do it as ping pong. - * Send a command and wait for a event. Send next command while the event is received. - * - */ - do{ - UINT_32 u4CurLeng = 0; - - if(u4RemainLeng > u4MemSize) { - u4CurLeng = u4MemSize; - u4RemainLeng -= u4MemSize; - } else { - u4CurLeng = u4RemainLeng; - u4RemainLeng = 0; - } - - prCmdDumpMem->u4Address = u4CurAddr; - prCmdDumpMem->u4Length = u4CurLeng; - prCmdDumpMem->u4RemainLength = u4RemainLeng; - prCmdDumpMem->ucFragNum = ucFragNum; - - DBGLOG(REQ, TRACE, ("[%d] 0x%X, len %d, remain len %d\n", - ucFragNum, - prCmdDumpMem->u4Address, - prCmdDumpMem->u4Length, - prCmdDumpMem->u4RemainLength)); - - rStatus = wlanSendSetQueryCmd(prAdapter, - CMD_ID_DUMP_MEM, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryMemDump, - nicOidCmdTimeoutCommon, - sizeof(CMD_DUMP_MEM), - (PUINT_8)prCmdDumpMem, - pvQueryBuffer, - u4QueryBufferLen - ); - - }while(FALSE); - - return rStatus; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to dump memory. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuf A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryMemDump ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - P_PARAM_CUSTOM_MEM_DUMP_STRUC_T prMemDumpInfo; - - DEBUGFUNC("wlanoidQueryMemDump"); - DBGLOG(INIT, LOUD,("\n")); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(UINT_32); - - prMemDumpInfo = (P_PARAM_CUSTOM_MEM_DUMP_STRUC_T)pvQueryBuffer; - DBGLOG(REQ, TRACE, ("Dump 0x%X, len %d\n", prMemDumpInfo->u4Address, prMemDumpInfo->u4Length)); - - prMemDumpInfo->u4RemainLength = prMemDumpInfo->u4Length; - prMemDumpInfo->u4Length = 0; - prMemDumpInfo->ucFragNum = 0; - - return wlanSendMemDumpCmd( - prAdapter, - pvQueryBuffer, - u4QueryBufferLen); - -} /* end of wlanoidQueryMcrRead() */ - - -#if CFG_ENABLE_WIFI_DIRECT -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to set the p2p mode. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetP2pMode ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS status; - P_PARAM_CUSTOM_P2P_SET_STRUC_T prSetP2P = (P_PARAM_CUSTOM_P2P_SET_STRUC_T)NULL; - //P_MSG_P2P_NETDEV_REGISTER_T prP2pNetdevRegMsg = (P_MSG_P2P_NETDEV_REGISTER_T)NULL; - DEBUGFUNC("wlanoidSetP2pMode"); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_CUSTOM_P2P_SET_STRUC_T); - if (u4SetBufferLen < sizeof(PARAM_CUSTOM_P2P_SET_STRUC_T)) { - DBGLOG(REQ, WARN, ("Invalid length %ld\n", u4SetBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - - prSetP2P = (P_PARAM_CUSTOM_P2P_SET_STRUC_T) pvSetBuffer; - - printk("Set P2P enable[%ld] mode[%ld]\n", prSetP2P->u4Enable, prSetP2P->u4Mode); - - /* - * enable = 1, mode = 0 => init P2P network - * enable = 1, mode = 1 => init Soft AP network - * enable = 0 => uninit P2P/AP network - */ - - if (prSetP2P->u4Enable) { - p2pSetMode((prSetP2P->u4Mode == 1)?TRUE:FALSE); - - if (p2pLaunch(prAdapter->prGlueInfo)) { - ASSERT(prAdapter->fgIsP2PRegistered); - } - - } - else { - if (prAdapter->fgIsP2PRegistered) { - p2pRemove(prAdapter->prGlueInfo); - } - - } - - -#if 0 - prP2pNetdevRegMsg = (P_MSG_P2P_NETDEV_REGISTER_T)cnmMemAlloc( - prAdapter, - RAM_TYPE_MSG, - (sizeof(MSG_P2P_NETDEV_REGISTER_T))); - - if (prP2pNetdevRegMsg == NULL) { - ASSERT(FALSE); - status = WLAN_STATUS_RESOURCES; - return status; - } - - - prP2pNetdevRegMsg->rMsgHdr.eMsgId = MID_MNY_P2P_NET_DEV_REGISTER; - prP2pNetdevRegMsg->fgIsEnable = (prSetP2P->u4Enable == 1)?TRUE:FALSE; - prP2pNetdevRegMsg->ucMode = (UINT_8)prSetP2P->u4Mode; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prP2pNetdevRegMsg, - MSG_SEND_METHOD_BUF); -#endif - - return status; - -} -#endif - - diff --git a/drivers/net/wireless/mt5931/common/wlan_p2p.c b/drivers/net/wireless/mt5931/common/wlan_p2p.c deleted file mode 100755 index be51207a7f16..000000000000 --- a/drivers/net/wireless/mt5931/common/wlan_p2p.c +++ /dev/null @@ -1,1811 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/common/wlan_p2p.c#8 $ -*/ - -/*! \file wlan_bow.c - \brief This file contains the Wi-Fi Direct commands processing routines for - MediaTek Inc. 802.11 Wireless LAN Adapters. -*/ - - - -/* -** $Log: wlan_p2p.c $ - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 11 24 2011 yuche.tsai - * NULL - * Fix P2P IOCTL of multicast address bug, add low power driver stop control. - * - * 11 22 2011 yuche.tsai - * NULL - * Update RSSI link quality of P2P Network query method. (Bug fix) - * - * 11 19 2011 yuche.tsai - * NULL - * Add RSSI support for P2P network. - * - * 11 08 2011 yuche.tsai - * [WCXRP00001094] [Volunteer Patch][Driver] Driver version & supplicant version query & set support for service discovery version check. - * Add support for driver version query & p2p supplicant verseion set. - * For new service discovery mechanism sync. - * - * 10 18 2011 yuche.tsai - * [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch. - * Support Channle Query. - * - * 10 18 2011 yuche.tsai - * [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch. - * New 2.1 branch - - * - * 08 23 2011 yuche.tsai - * NULL - * Fix Multicast Issue of P2P. - * - * 04 27 2011 george.huang - * [WCXRP00000684] [MT6620 Wi-Fi][Driver] Support P2P setting ARP filter - * Support P2P ARP filter setting on early suspend/ late resume - * - * 04 08 2011 george.huang - * [WCXRP00000621] [MT6620 Wi-Fi][Driver] Support P2P supplicant to set power mode - * separate settings of P2P and AIS - * - * 03 22 2011 george.huang - * [WCXRP00000504] [MT6620 Wi-Fi][FW] Support Sigma CAPI for power saving related command - * link with supplicant commands - * - * 03 17 2011 wh.su - * [WCXRP00000571] [MT6620 Wi-Fi] [Driver] Not check the p2p role during set key - * Skip the p2p role for adding broadcast key issue. - * - * 03 16 2011 wh.su - * [WCXRP00000530] [MT6620 Wi-Fi] [Driver] skip doing p2pRunEventAAAComplete after send assoc response Tx Done - * fixed compiling error while enable dbg. - * - * 03 08 2011 yuche.tsai - * [WCXRP00000480] [Volunteer Patch][MT6620][Driver] WCS IE format issue[WCXRP00000509] [Volunteer Patch][MT6620][Driver] Kernal panic when remove p2p module. - * . - * - * 03 07 2011 terry.wu - * [WCXRP00000521] [MT6620 Wi-Fi][Driver] Remove non-standard debug message - * Toggle non-standard debug messages to comments. - * - * 03 07 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * rename the define to anti_pviracy. - * - * 03 05 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * add the code to get the check rsponse and indicate to app. - * - * 03 02 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * Add Security check related code. - * - * 03 02 2011 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * Fix SD Request Query Length issue. - * - * 03 02 2011 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * Service Discovery Request. - * - * 03 01 2011 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * Update Service Discovery Wlan OID related function. - * - * 03 01 2011 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * Update Service Discovery Related wlanoid function. - * - * 02 09 2011 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * Add Service Discovery Indication Related code. - * - * 01 26 2011 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * Add Service Discovery Function. - * - * 01 05 2011 cp.wu - * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery - * ioctl implementations for P2P Service Discovery - * - * 01 04 2011 cp.wu - * [WCXRP00000338] [MT6620 Wi-Fi][Driver] Separate kalMemAlloc into kmalloc and vmalloc implementations to ease physically continous memory demands - * separate kalMemAlloc() into virtually-continous and physically-continous type to ease slab system pressure - * - * 12 22 2010 cp.wu - * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery - * 1. header file restructure for more clear module isolation - * 2. add function interface definition for implementing Service Discovery callbacks - * - * 10 04 2010 cp.wu - * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only - * remove ENUM_NETWORK_TYPE_T definitions - * - * 09 28 2010 wh.su - * NULL - * [WCXRP00000069][MT6620 Wi-Fi][Driver] Fix some code for phase 1 P2P Demo. - * - * 09 21 2010 kevin.huang - * [WCXRP00000054] [MT6620 Wi-Fi][Driver] Restructure driver for second Interface - * Isolate P2P related function for Hardware Software Bundle - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 23 2010 cp.wu - * NULL - * revise constant definitions to be matched with implementation (original cmd-event definition is deprecated) - * - * 08 16 2010 cp.wu - * NULL - * add subroutines for P2P to set multicast list. - * - * 08 16 2010 george.huang - * NULL - * . - * - * 08 16 2010 george.huang - * NULL - * support wlanoidSetP2pPowerSaveProfile() in P2P - * - * 08 16 2010 george.huang - * NULL - * Support wlanoidSetNetworkAddress() for P2P - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 25 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add API in que_mgt to retrieve sta-rec index for security frames. - * - * 06 24 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 802.1x and bluetooth-over-Wi-Fi security frames are now delievered to firmware via command path instead of data path. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * 1) add timeout handler mechanism for pending command packets - * 2) add p2p add/removal key - * -** -*/ - -/****************************************************************************** -* C O M P I L E R F L A G S -******************************************************************************* -*/ - -/****************************************************************************** -* E X T E R N A L R E F E R E N C E S -******************************************************************************* -*/ -#include "precomp.h" - -/****************************************************************************** -* C O N S T A N T S -******************************************************************************* -*/ - -/****************************************************************************** -* D A T A T Y P E S -******************************************************************************* -*/ - -/****************************************************************************** -* P U B L I C D A T A -******************************************************************************* -*/ - -/****************************************************************************** -* P R I V A T E D A T A -******************************************************************************* -*/ - -/****************************************************************************** -* M A C R O S -******************************************************************************* -*/ - -/****************************************************************************** -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************* -*/ - -/****************************************************************************** -* F U N C T I O N S -******************************************************************************* -*/ -/*----------------------------------------------------------------------------*/ -/*! -* \brief command packet generation utility -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] ucCID Command ID -* \param[in] fgSetQuery Set or Query -* \param[in] fgNeedResp Need for response -* \param[in] pfCmdDoneHandler Function pointer when command is done -* \param[in] u4SetQueryInfoLen The length of the set/query buffer -* \param[in] pucInfoBuffer Pointer to set/query buffer -* -* -* \retval WLAN_STATUS_PENDING -* \retval WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSendSetQueryP2PCmd ( - IN P_ADAPTER_T prAdapter, - UINT_8 ucCID, - BOOLEAN fgSetQuery, - BOOLEAN fgNeedResp, - BOOLEAN fgIsOid, - PFN_CMD_DONE_HANDLER pfCmdDoneHandler, - PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler, - UINT_32 u4SetQueryInfoLen, - PUINT_8 pucInfoBuffer, - OUT PVOID pvSetQueryBuffer, - IN UINT_32 u4SetQueryBufferLen - ) -{ - P_GLUE_INFO_T prGlueInfo; - P_CMD_INFO_T prCmdInfo; - P_WIFI_CMD_T prWifiCmd; - UINT_8 ucCmdSeqNum; - - ASSERT(prAdapter); - - prGlueInfo = prAdapter->prGlueInfo; - ASSERT(prGlueInfo); - - DEBUGFUNC("wlanoidSendSetQueryP2PCmd"); - DBGLOG(REQ, TRACE, ("Command ID = 0x%08X\n", ucCID)); - - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, (CMD_HDR_SIZE + u4SetQueryInfoLen)); - - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - DBGLOG(REQ, TRACE, ("ucCmdSeqNum =%d\n", ucCmdSeqNum)); - - // Setup common CMD Info Packet - prCmdInfo->eCmdType = COMMAND_TYPE_NETWORK_IOCTL; - prCmdInfo->eNetworkType = NETWORK_TYPE_P2P_INDEX; - prCmdInfo->u2InfoBufLen = (UINT_16)(CMD_HDR_SIZE + u4SetQueryInfoLen); - prCmdInfo->pfCmdDoneHandler = pfCmdDoneHandler; - prCmdInfo->pfCmdTimeoutHandler = pfCmdTimeoutHandler; - prCmdInfo->fgIsOid = fgIsOid; - prCmdInfo->ucCID = ucCID; - prCmdInfo->fgSetQuery = fgSetQuery; - prCmdInfo->fgNeedResp = fgNeedResp; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = u4SetQueryInfoLen; - prCmdInfo->pvInformationBuffer = pvSetQueryBuffer; - prCmdInfo->u4InformationBufferLength = u4SetQueryBufferLen; - - // Setup WIFI_CMD_T (no payload) - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - if(u4SetQueryInfoLen > 0 && pucInfoBuffer != NULL) { - kalMemCopy(prWifiCmd->aucBuffer, pucInfoBuffer, u4SetQueryInfoLen); - } - - // insert into prCmdQueue - kalEnqueueCommand(prGlueInfo, (P_QUE_ENTRY_T)prCmdInfo); - - // wakeup txServiceThread later - GLUE_SET_EVENT(prGlueInfo); - return WLAN_STATUS_PENDING; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set a key to Wi-Fi Direct driver -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_INVALID_DATA -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetAddP2PKey( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - CMD_802_11_KEY rCmdKey; - P_PARAM_KEY_T prNewKey; - - DEBUGFUNC("wlanoidSetAddP2PKey"); - DBGLOG(REQ, INFO, ("\n")); - - ASSERT(prAdapter); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - prNewKey = (P_PARAM_KEY_T) pvSetBuffer; - - /* Verify the key structure length. */ - if (prNewKey->u4Length > u4SetBufferLen) { - DBGLOG(REQ, WARN, ("Invalid key structure length (%d) greater than total buffer length (%d)\n", - (UINT_8)prNewKey->u4Length, - (UINT_8)u4SetBufferLen)); - - *pu4SetInfoLen = u4SetBufferLen; - return WLAN_STATUS_INVALID_LENGTH; - } - /* Verify the key material length for key material buffer */ - else if (prNewKey->u4KeyLength > prNewKey->u4Length - OFFSET_OF(PARAM_KEY_T, aucKeyMaterial)) { - DBGLOG(REQ, WARN, ("Invalid key material length (%d)\n", (UINT_8)prNewKey->u4KeyLength)); - *pu4SetInfoLen = u4SetBufferLen; - return WLAN_STATUS_INVALID_DATA; - } - /* Exception check */ - else if (prNewKey->u4KeyIndex & 0x0fffff00) { - return WLAN_STATUS_INVALID_DATA; - } - /* Exception check, pairwise key must with transmit bit enabled */ - else if ((prNewKey->u4KeyIndex & BITS(30,31)) == IS_UNICAST_KEY) { - return WLAN_STATUS_INVALID_DATA; - } - else if (!(prNewKey->u4KeyLength == CCMP_KEY_LEN) && !(prNewKey->u4KeyLength == TKIP_KEY_LEN)) { - return WLAN_STATUS_INVALID_DATA; - } - /* Exception check, pairwise key must with transmit bit enabled */ - else if ((prNewKey->u4KeyIndex & BITS(30,31)) == BITS(30,31)) { - if (((prNewKey->u4KeyIndex & 0xff) != 0) || - ((prNewKey->arBSSID[0] == 0xff) && (prNewKey->arBSSID[1] == 0xff) && (prNewKey->arBSSID[2] == 0xff) && - (prNewKey->arBSSID[3] == 0xff) && (prNewKey->arBSSID[4] == 0xff) && (prNewKey->arBSSID[5] == 0xff))) { - return WLAN_STATUS_INVALID_DATA; - } - } - - *pu4SetInfoLen = u4SetBufferLen; - - // fill CMD_802_11_KEY - kalMemZero(&rCmdKey, sizeof(CMD_802_11_KEY)); - rCmdKey.ucAddRemove = 1; /* add */ - rCmdKey.ucTxKey = ((prNewKey->u4KeyIndex & IS_TRANSMIT_KEY) == IS_TRANSMIT_KEY) ? 1 : 0; - rCmdKey.ucKeyType = ((prNewKey->u4KeyIndex & IS_UNICAST_KEY) == IS_UNICAST_KEY) ? 1 : 0; - if(kalP2PGetRole(prAdapter->prGlueInfo) == 1) { /* group client */ - rCmdKey.ucIsAuthenticator = 0; - } - else { /* group owner */ - rCmdKey.ucIsAuthenticator = 1; - } - COPY_MAC_ADDR(rCmdKey.aucPeerAddr, prNewKey->arBSSID); - rCmdKey.ucNetType = NETWORK_TYPE_P2P_INDEX; - if(prNewKey->u4KeyLength == CCMP_KEY_LEN) - rCmdKey.ucAlgorithmId = CIPHER_SUITE_CCMP; // AES - else if(prNewKey->u4KeyLength == TKIP_KEY_LEN) - rCmdKey.ucAlgorithmId = CIPHER_SUITE_TKIP; // TKIP - rCmdKey.ucKeyId = (UINT_8)(prNewKey->u4KeyIndex & 0xff); - rCmdKey.ucKeyLen = (UINT_8)prNewKey->u4KeyLength; - kalMemCopy(rCmdKey.aucKeyMaterial, (PUINT_8)prNewKey->aucKeyMaterial, rCmdKey.ucKeyLen); - - return wlanoidSendSetQueryP2PCmd(prAdapter, - CMD_ID_ADD_REMOVE_KEY, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - NULL, - sizeof(CMD_802_11_KEY), - (PUINT_8)&rCmdKey, - pvSetBuffer, - u4SetBufferLen - ); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to request Wi-Fi Direct driver to remove keys -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_DATA -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_INVALID_DATA -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetRemoveP2PKey( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - CMD_802_11_KEY rCmdKey; - P_PARAM_REMOVE_KEY_T prRemovedKey; - - DEBUGFUNC("wlanoidSetRemoveP2PKey"); - ASSERT(prAdapter); - - if (u4SetBufferLen < sizeof(PARAM_REMOVE_KEY_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - prRemovedKey = (P_PARAM_REMOVE_KEY_T)pvSetBuffer; - - /* Check bit 31: this bit should always 0 */ - if (prRemovedKey->u4KeyIndex & IS_TRANSMIT_KEY) { - /* Bit 31 should not be set */ - DBGLOG(REQ, ERROR, ("invalid key index: 0x%08lx\n", - prRemovedKey->u4KeyIndex)); - return WLAN_STATUS_INVALID_DATA; - } - - /* Check bits 8 ~ 29 should always be 0 */ - if (prRemovedKey->u4KeyIndex & BITS(8, 29)) { - /* Bit 31 should not be set */ - DBGLOG(REQ, ERROR, ("invalid key index: 0x%08lx\n", - prRemovedKey->u4KeyIndex)); - return WLAN_STATUS_INVALID_DATA; - } - - /* There should not be any key operation for P2P Device */ - if(kalP2PGetRole(prAdapter->prGlueInfo) == 0) { - // return WLAN_STATUS_NOT_ACCEPTED; - } - - kalMemZero((PUINT_8)&rCmdKey, sizeof(CMD_802_11_KEY)); - - rCmdKey.ucAddRemove = 0; // remove - if(kalP2PGetRole(prAdapter->prGlueInfo) == 1) { /* group client */ - rCmdKey.ucIsAuthenticator = 0; - } - else { /* group owner */ - rCmdKey.ucIsAuthenticator = 1; - } - kalMemCopy(rCmdKey.aucPeerAddr, (PUINT_8)prRemovedKey->arBSSID, MAC_ADDR_LEN); - rCmdKey.ucNetType = NETWORK_TYPE_P2P_INDEX; - rCmdKey.ucKeyId = (UINT_8)(prRemovedKey->u4KeyIndex & 0x000000ff); - - return wlanoidSendSetQueryP2PCmd(prAdapter, - CMD_ID_ADD_REMOVE_KEY, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - NULL, - sizeof(CMD_802_11_KEY), - (PUINT_8)&rCmdKey, - pvSetBuffer, - u4SetBufferLen - ); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Setting the IP address for pattern search function. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \return WLAN_STATUS_SUCCESS -* \return WLAN_STATUS_ADAPTER_NOT_READY -* \return WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetP2pNetworkAddress( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 i, j; - P_CMD_SET_NETWORK_ADDRESS_LIST prCmdNetworkAddressList; - P_PARAM_NETWORK_ADDRESS_LIST prNetworkAddressList = (P_PARAM_NETWORK_ADDRESS_LIST)pvSetBuffer; - P_PARAM_NETWORK_ADDRESS prNetworkAddress; - P_PARAM_NETWORK_ADDRESS_IP prNetAddrIp; - UINT_32 u4IpAddressCount, u4CmdSize; - - DEBUGFUNC("wlanoidSetP2pNetworkAddress"); - DBGLOG(INIT, TRACE, ("\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = 4; - - if (u4SetBufferLen < sizeof(PARAM_NETWORK_ADDRESS_LIST)) { - return WLAN_STATUS_INVALID_DATA; - } - - *pu4SetInfoLen = 0; - u4IpAddressCount = 0; - - prNetworkAddress = prNetworkAddressList->arAddress; - for ( i = 0 ; i < prNetworkAddressList->u4AddressCount ; i++) { - if (prNetworkAddress->u2AddressType == PARAM_PROTOCOL_ID_TCP_IP && - prNetworkAddress->u2AddressLength == sizeof(PARAM_NETWORK_ADDRESS_IP)) { - u4IpAddressCount++; - } - - prNetworkAddress = (P_PARAM_NETWORK_ADDRESS) ((UINT_32) prNetworkAddress + - (UINT_32) (prNetworkAddress->u2AddressLength + OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress))); - } - - // construct payload of command packet - u4CmdSize = OFFSET_OF(CMD_SET_NETWORK_ADDRESS_LIST, arNetAddress) + - sizeof(IPV4_NETWORK_ADDRESS) * u4IpAddressCount; - - prCmdNetworkAddressList = (P_CMD_SET_NETWORK_ADDRESS_LIST) kalMemAlloc(u4CmdSize, VIR_MEM_TYPE); - - if(prCmdNetworkAddressList == NULL) - return WLAN_STATUS_FAILURE; - - // fill P_CMD_SET_NETWORK_ADDRESS_LIST - prCmdNetworkAddressList->ucNetTypeIndex = NETWORK_TYPE_P2P_INDEX; - prCmdNetworkAddressList->ucAddressCount = (UINT_8)u4IpAddressCount; - prNetworkAddress = prNetworkAddressList->arAddress; - for (i = 0, j = 0 ; i < prNetworkAddressList->u4AddressCount ; i++) { - if (prNetworkAddress->u2AddressType == PARAM_PROTOCOL_ID_TCP_IP && - prNetworkAddress->u2AddressLength == sizeof(PARAM_NETWORK_ADDRESS_IP)) { - prNetAddrIp = (P_PARAM_NETWORK_ADDRESS_IP)prNetworkAddress->aucAddress; - - kalMemCopy(prCmdNetworkAddressList->arNetAddress[j].aucIpAddr, - &(prNetAddrIp->in_addr), - sizeof(UINT_32)); - - j++; - } - - prNetworkAddress = (P_PARAM_NETWORK_ADDRESS) ((UINT_32) prNetworkAddress + - (UINT_32) (prNetworkAddress->u2AddressLength + OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress))); - } - - rStatus = wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_IP_ADDRESS, - TRUE, - FALSE, - TRUE, - nicCmdEventSetIpAddress, - nicOidCmdTimeoutCommon, - u4CmdSize, - (PUINT_8)prCmdNetworkAddressList, - pvSetBuffer, - u4SetBufferLen - ); - - kalMemFree(prCmdNetworkAddressList, VIR_MEM_TYPE, u4CmdSize); - return rStatus; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to query the power save profile. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuf A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \return WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidQueryP2pPowerSaveProfile ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryP2pPowerSaveProfile"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - - if (u4QueryBufferLen!=0) { - ASSERT(pvQueryBuffer); - - *(PPARAM_POWER_MODE) pvQueryBuffer = (PARAM_POWER_MODE)(prAdapter->rWlanInfo.arPowerSaveMode[NETWORK_TYPE_P2P_INDEX].ucPsProfile); - *pu4QueryInfoLen = sizeof(PARAM_POWER_MODE); - } - - return WLAN_STATUS_SUCCESS; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to set the power save profile. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetP2pPowerSaveProfile ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS status; - PARAM_POWER_MODE ePowerMode; - DEBUGFUNC("wlanoidSetP2pPowerSaveProfile"); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_POWER_MODE); - if (u4SetBufferLen < sizeof(PARAM_POWER_MODE)) { - DBGLOG(REQ, WARN, ("Invalid length %ld\n", u4SetBufferLen)); - return WLAN_STATUS_INVALID_LENGTH; - } - else if (*(PPARAM_POWER_MODE) pvSetBuffer >= Param_PowerModeMax) { - WARNLOG(("Invalid power mode %d\n", - *(PPARAM_POWER_MODE) pvSetBuffer)); - return WLAN_STATUS_INVALID_DATA; - } - - ePowerMode = *(PPARAM_POWER_MODE) pvSetBuffer; - - if (prAdapter->fgEnCtiaPowerMode) { - if (ePowerMode == Param_PowerModeCAM) { - - } else { - // User setting to PS mode (Param_PowerModeMAX_PSP or Param_PowerModeFast_PSP) - - if (prAdapter->u4CtiaPowerMode == 0) { - // force to keep in CAM mode - ePowerMode = Param_PowerModeCAM; - } else if (prAdapter->u4CtiaPowerMode == 1) { - ePowerMode = Param_PowerModeMAX_PSP; - } else if (prAdapter->u4CtiaPowerMode == 2) { - ePowerMode = Param_PowerModeFast_PSP; - } - } - } - - status = nicConfigPowerSaveProfile( - prAdapter, - NETWORK_TYPE_P2P_INDEX, - ePowerMode, - TRUE); - return status; -} /* end of wlanoidSetP2pPowerSaveProfile() */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to set the power save profile. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetP2pSetNetworkAddress ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 i, j; - P_CMD_SET_NETWORK_ADDRESS_LIST prCmdNetworkAddressList; - P_PARAM_NETWORK_ADDRESS_LIST prNetworkAddressList = (P_PARAM_NETWORK_ADDRESS_LIST)pvSetBuffer; - P_PARAM_NETWORK_ADDRESS prNetworkAddress; - P_PARAM_NETWORK_ADDRESS_IP prNetAddrIp; - UINT_32 u4IpAddressCount, u4CmdSize; - PUINT_8 pucBuf = (PUINT_8)pvSetBuffer; - - DEBUGFUNC("wlanoidSetP2pSetNetworkAddress"); - DBGLOG(INIT, TRACE, ("\n")); - printk("wlanoidSetP2pSetNetworkAddress (%d)\n", (INT_16)u4SetBufferLen); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = 4; - - if (u4SetBufferLen < sizeof(PARAM_NETWORK_ADDRESS_LIST)) { - return WLAN_STATUS_INVALID_DATA; - } - - *pu4SetInfoLen = 0; - u4IpAddressCount = 0; - - prNetworkAddress = prNetworkAddressList->arAddress; - for ( i = 0 ; i < prNetworkAddressList->u4AddressCount ; i++) { - if (prNetworkAddress->u2AddressType == PARAM_PROTOCOL_ID_TCP_IP && - prNetworkAddress->u2AddressLength == sizeof(PARAM_NETWORK_ADDRESS_IP)) { - u4IpAddressCount++; - } - - prNetworkAddress = (P_PARAM_NETWORK_ADDRESS) ((UINT_32) prNetworkAddress + - (UINT_32) (prNetworkAddress->u2AddressLength + OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress))); - } - - // construct payload of command packet - u4CmdSize = OFFSET_OF(CMD_SET_NETWORK_ADDRESS_LIST, arNetAddress) + - sizeof(IPV4_NETWORK_ADDRESS) * u4IpAddressCount; - - if (u4IpAddressCount == 0) { - u4CmdSize = sizeof(CMD_SET_NETWORK_ADDRESS_LIST); - } - - prCmdNetworkAddressList = (P_CMD_SET_NETWORK_ADDRESS_LIST) kalMemAlloc(u4CmdSize, VIR_MEM_TYPE); - - if(prCmdNetworkAddressList == NULL) - return WLAN_STATUS_FAILURE; - - // fill P_CMD_SET_NETWORK_ADDRESS_LIST - prCmdNetworkAddressList->ucNetTypeIndex = NETWORK_TYPE_P2P_INDEX; - - /* only to set IP address to FW once ARP filter is enabled */ - if (prAdapter->fgEnArpFilter) { - prCmdNetworkAddressList->ucAddressCount = (UINT_8)u4IpAddressCount; - prNetworkAddress = prNetworkAddressList->arAddress; - - printk("u4IpAddressCount (%ld) \n", (INT_32)u4IpAddressCount); - for (i = 0, j = 0 ; i < prNetworkAddressList->u4AddressCount ; i++) { - if (prNetworkAddress->u2AddressType == PARAM_PROTOCOL_ID_TCP_IP && - prNetworkAddress->u2AddressLength == sizeof(PARAM_NETWORK_ADDRESS_IP)) { - prNetAddrIp = (P_PARAM_NETWORK_ADDRESS_IP)prNetworkAddress->aucAddress; - - kalMemCopy(prCmdNetworkAddressList->arNetAddress[j].aucIpAddr, - &(prNetAddrIp->in_addr), - sizeof(UINT_32)); - - j++; - - pucBuf = (PUINT_8)&prNetAddrIp->in_addr; - printk("prNetAddrIp->in_addr:%d:%d:%d:%d\n", (UINT_8)pucBuf[0], (UINT_8)pucBuf[1], (UINT_8)pucBuf[2], (UINT_8)pucBuf[3]); - } - - prNetworkAddress = (P_PARAM_NETWORK_ADDRESS) ((UINT_32) prNetworkAddress + - (UINT_32) (prNetworkAddress->u2AddressLength + OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress))); - } - - } else { - prCmdNetworkAddressList->ucAddressCount = 0; - } - - rStatus = wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_IP_ADDRESS, - TRUE, - FALSE, - TRUE, - nicCmdEventSetIpAddress, - nicOidCmdTimeoutCommon, - u4CmdSize, - (PUINT_8)prCmdNetworkAddressList, - pvSetBuffer, - u4SetBufferLen - ); - - kalMemFree(prCmdNetworkAddressList, VIR_MEM_TYPE, u4CmdSize); - return rStatus; -} /* end of wlanoidSetP2pSetNetworkAddress() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set Multicast Address List. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_MULTICAST_FULL -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetP2PMulticastList( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - CMD_MAC_MCAST_ADDR rCmdMacMcastAddr; - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - /* The data must be a multiple of the Ethernet address size. */ - if ((u4SetBufferLen % MAC_ADDR_LEN)) { - DBGLOG(REQ, WARN, ("Invalid MC list length %ld\n", u4SetBufferLen)); - - *pu4SetInfoLen = (((u4SetBufferLen + MAC_ADDR_LEN) - 1) / - MAC_ADDR_LEN) * MAC_ADDR_LEN; - - return WLAN_STATUS_INVALID_LENGTH; - } - - *pu4SetInfoLen = u4SetBufferLen; - - /* Verify if we can support so many multicast addresses. */ - if ((u4SetBufferLen / MAC_ADDR_LEN) > MAX_NUM_GROUP_ADDR) { - DBGLOG(REQ, WARN, ("Too many MC addresses\n")); - - return WLAN_STATUS_MULTICAST_FULL; - } - - /* NOTE(Kevin): Windows may set u4SetBufferLen == 0 && - * pvSetBuffer == NULL to clear exist Multicast List. - */ - if (u4SetBufferLen) { - ASSERT(pvSetBuffer); - } - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set multicast list! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - rCmdMacMcastAddr.u4NumOfGroupAddr = u4SetBufferLen / MAC_ADDR_LEN; - rCmdMacMcastAddr.ucNetTypeIndex = NETWORK_TYPE_P2P_INDEX; - kalMemCopy(rCmdMacMcastAddr.arAddress, pvSetBuffer, u4SetBufferLen); - - return wlanoidSendSetQueryP2PCmd(prAdapter, - CMD_ID_MAC_MCAST_ADDR, - TRUE, - FALSE, - FALSE, // This CMD response is no need to complete the OID. Or the event would unsync. - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_MAC_MCAST_ADDR), - (PUINT_8)&rCmdMacMcastAddr, - pvSetBuffer, - u4SetBufferLen - ); - -} /* end of wlanoidSetP2PMulticastList() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to send GAS frame for P2P Service Discovery Request -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_MULTICAST_FULL -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSendP2PSDRequest( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_SUCCESS; - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - if (u4SetBufferLen) { - ASSERT(pvSetBuffer); - } - - if (u4SetBufferLen < sizeof(PARAM_P2P_SEND_SD_REQUEST)) { - *pu4SetInfoLen = sizeof(PARAM_P2P_SEND_SD_REQUEST); - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - -// rWlanStatus = p2pFsmRunEventSDRequest(prAdapter, (P_PARAM_P2P_SEND_SD_REQUEST)pvSetBuffer); - - return rWlanStatus; -} /* end of wlanoidSendP2PSDRequest() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to send GAS frame for P2P Service Discovery Response -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_MULTICAST_FULL -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSendP2PSDResponse( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_SUCCESS; - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - if (u4SetBufferLen) { - ASSERT(pvSetBuffer); - } - - if (u4SetBufferLen < sizeof(PARAM_P2P_SEND_SD_RESPONSE)) { - *pu4SetInfoLen = sizeof(PARAM_P2P_SEND_SD_RESPONSE); - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - -// rWlanStatus = p2pFsmRunEventSDResponse(prAdapter, (P_PARAM_P2P_SEND_SD_RESPONSE)pvSetBuffer); - - return rWlanStatus; -} /* end of wlanoidGetP2PSDRequest() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to get GAS frame for P2P Service Discovery Request -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_MULTICAST_FULL -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidGetP2PSDRequest( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_SUCCESS; - PUINT_8 pucPacketBuffer = NULL, pucTA = NULL; -// PUINT_8 pucChannelNum = NULL; - PUINT_16 pu2PacketLength = NULL; - P_WLAN_MAC_HEADER_T prWlanHdr = (P_WLAN_MAC_HEADER_T)NULL; - UINT_8 ucVersionNum = 0; -// UINT_8 ucChannelNum = 0, ucSeqNum = 0; - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - if (u4QueryBufferLen < sizeof(PARAM_P2P_GET_SD_REQUEST)) { - *pu4QueryInfoLen = sizeof(PARAM_P2P_GET_SD_REQUEST); - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - DBGLOG(P2P, TRACE, ("Get Service Discovery Request\n")); -#if 0 - if ((ucVersionNum = p2pFuncGetVersionNumOfSD(prAdapter)) == 0) { - P_PARAM_P2P_GET_SD_REQUEST prP2pGetSdReq = (P_PARAM_P2P_GET_SD_REQUEST)pvQueryBuffer; - - pucPacketBuffer = prP2pGetSdReq->aucPacketContent; - pu2PacketLength = &prP2pGetSdReq->u2PacketLength; - pucTA = &prP2pGetSdReq->rTransmitterAddr; - } - else { - P_PARAM_P2P_GET_SD_REQUEST_EX prP2pGetSdReqEx = (P_PARAM_P2P_GET_SD_REQUEST_EX)NULL; - - prP2pGetSdReqEx = (P_PARAM_P2P_GET_SD_REQUEST)pvQueryBuffer; - pucPacketBuffer = prP2pGetSdReqEx->aucPacketContent; - pu2PacketLength = &prP2pGetSdReqEx->u2PacketLength; - pucTA = &prP2pGetSdReqEx->rTransmitterAddr; - pucChannelNum = &prP2pGetSdReqEx->ucChannelNum; - ucSeqNum = prP2pGetSdReqEx->ucSeqNum; - } - - - rWlanStatus = p2pFuncGetServiceDiscoveryFrame(prAdapter, - pucPacketBuffer, - (u4QueryBufferLen - sizeof(PARAM_P2P_GET_SD_REQUEST)), - (PUINT_32)pu2PacketLength, - pucChannelNum, - ucSeqNum); -#else - *pu4QueryInfoLen = 0; - return rWlanStatus; -#endif - - prWlanHdr = (P_WLAN_MAC_HEADER_T)pucPacketBuffer; - - kalMemCopy(pucTA, prWlanHdr->aucAddr2, MAC_ADDR_LEN); - - if (pu4QueryInfoLen) { - if (ucVersionNum == 0) { - *pu4QueryInfoLen = (UINT_32)(sizeof(PARAM_P2P_GET_SD_REQUEST) + (*pu2PacketLength)); - } - else { - *pu4QueryInfoLen = (UINT_32)(sizeof(PARAM_P2P_GET_SD_REQUEST_EX) + (*pu2PacketLength)); - } - - } - - return rWlanStatus; -} /* end of wlanoidGetP2PSDRequest() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to get GAS frame for P2P Service Discovery Response -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_MULTICAST_FULL -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidGetP2PSDResponse( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_SUCCESS; - P_WLAN_MAC_HEADER_T prWlanHdr = (P_WLAN_MAC_HEADER_T)NULL; - //UINT_8 ucSeqNum = 0, - UINT_8 ucVersionNum = 0; - PUINT_8 pucPacketContent = (PUINT_8)NULL, pucTA = (PUINT_8)NULL; - PUINT_16 pu2PacketLength = (PUINT_16)NULL; - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - if (u4QueryBufferLen < sizeof(PARAM_P2P_GET_SD_RESPONSE)) { - *pu4QueryInfoLen = sizeof(PARAM_P2P_GET_SD_RESPONSE); - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - DBGLOG(P2P, TRACE, ("Get Service Discovery Response\n")); - -#if 0 - if ((ucVersionNum = p2pFuncGetVersionNumOfSD(prAdapter)) == 0) { - P_PARAM_P2P_GET_SD_RESPONSE prP2pGetSdRsp = (P_PARAM_P2P_GET_SD_RESPONSE)NULL; - - prP2pGetSdRsp = (P_PARAM_P2P_GET_SD_REQUEST)pvQueryBuffer; - pucPacketContent = prP2pGetSdRsp->aucPacketContent; - pucTA = &prP2pGetSdRsp->rTransmitterAddr; - pu2PacketLength = &prP2pGetSdRsp->u2PacketLength; - } - else { - P_PARAM_P2P_GET_SD_RESPONSE_EX prP2pGetSdRspEx = (P_PARAM_P2P_GET_SD_RESPONSE_EX)NULL; - - prP2pGetSdRspEx = (P_PARAM_P2P_GET_SD_RESPONSE_EX)pvQueryBuffer; - pucPacketContent = prP2pGetSdRspEx->aucPacketContent; - pucTA = &prP2pGetSdRspEx->rTransmitterAddr; - pu2PacketLength = &prP2pGetSdRspEx->u2PacketLength; - ucSeqNum = prP2pGetSdRspEx->ucSeqNum; - } - - -// rWlanStatus = p2pFuncGetServiceDiscoveryFrame(prAdapter, -// pucPacketContent, -// (u4QueryBufferLen - sizeof(PARAM_P2P_GET_SD_RESPONSE)), -// (PUINT_32)pu2PacketLength, -// NULL, -// ucSeqNum); -#else - *pu4QueryInfoLen = 0; - return rWlanStatus; -#endif - prWlanHdr = (P_WLAN_MAC_HEADER_T)pucPacketContent; - - kalMemCopy(pucTA, prWlanHdr->aucAddr2, MAC_ADDR_LEN); - - - if (pu4QueryInfoLen) { - if (ucVersionNum == 0) { - *pu4QueryInfoLen = (UINT_32)(sizeof(PARAM_P2P_GET_SD_RESPONSE) + *pu2PacketLength); - } - else { - *pu4QueryInfoLen = (UINT_32)(sizeof(PARAM_P2P_GET_SD_RESPONSE_EX) + *pu2PacketLength); - } - } - - return rWlanStatus; -} /* end of wlanoidGetP2PSDResponse() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to terminate P2P Service Discovery Phase -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_MULTICAST_FULL -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetP2PTerminateSDPhase( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_SUCCESS; - P_PARAM_P2P_TERMINATE_SD_PHASE prP2pTerminateSD = (P_PARAM_P2P_TERMINATE_SD_PHASE)NULL; - UINT_8 aucNullAddr[] = NULL_MAC_ADDR; - - do { - if ((prAdapter == NULL) || (pu4SetInfoLen == NULL)) { - break; - } - - - if ((u4SetBufferLen) && (pvSetBuffer == NULL)) { - break; - } - - if (u4SetBufferLen < sizeof(PARAM_P2P_TERMINATE_SD_PHASE)) { - *pu4SetInfoLen = sizeof(PARAM_P2P_TERMINATE_SD_PHASE); - rWlanStatus = WLAN_STATUS_BUFFER_TOO_SHORT; - break; - } - - prP2pTerminateSD = (P_PARAM_P2P_TERMINATE_SD_PHASE)pvSetBuffer; - - if (EQUAL_MAC_ADDR(prP2pTerminateSD->rPeerAddr, aucNullAddr)) { - DBGLOG(P2P, TRACE, ("Service Discovery Version 2.0\n")); -// p2pFuncSetVersionNumOfSD(prAdapter, 2); - } - - //rWlanStatus = p2pFsmRunEventSDAbort(prAdapter); - - } while (FALSE); - - - - - - return rWlanStatus; -} /* end of wlanoidSetP2PTerminateSDPhase() */ - - -#if CFG_SUPPORT_ANTI_PIRACY -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_MULTICAST_FULL -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetSecCheckRequest( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - if (u4SetBufferLen) { - ASSERT(pvSetBuffer); - } - - return wlanoidSendSetQueryP2PCmd(prAdapter, - CMD_ID_SEC_CHECK, - FALSE, - TRUE, - TRUE, - NULL, - nicOidCmdTimeoutCommon, - u4SetBufferLen, - (PUINT_8)pvSetBuffer, - pvSetBuffer, - u4SetBufferLen - ); - -} /* end of wlanoidSetSecCheckRequest() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[out] pvQueryBuffer A pointer to the buffer that holds the result of -* the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_ADAPTER_NOT_READY -* \retval WLAN_STATUS_MULTICAST_FULL -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidGetSecCheckResponse( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_SUCCESS; - //P_WLAN_MAC_HEADER_T prWlanHdr = (P_WLAN_MAC_HEADER_T)NULL; - P_GLUE_INFO_T prGlueInfo; - - prGlueInfo = prAdapter->prGlueInfo; - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - if (u4QueryBufferLen > 256) { - u4QueryBufferLen = 256; - } - - *pu4QueryInfoLen = u4QueryBufferLen; - - #if DBG - DBGLOG_MEM8(SEC, LOUD, prGlueInfo->prP2PInfo->aucSecCheckRsp, u4QueryBufferLen); - #endif - kalMemCopy((PUINT_8)(pvQueryBuffer + OFFSET_OF(IW_P2P_TRANSPORT_STRUCT, aucBuffer)), prGlueInfo->prP2PInfo->aucSecCheckRsp, u4QueryBufferLen); - - return rWlanStatus; -} /* end of wlanoidGetSecCheckResponse() */ -#endif - -WLAN_STATUS -wlanoidSetNoaParam ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_CUSTOM_NOA_PARAM_STRUC_T prNoaParam; - CMD_CUSTOM_NOA_PARAM_STRUC_T rCmdNoaParam; - - DEBUGFUNC("wlanoidSetNoaParam"); - DBGLOG(INIT, TRACE,("\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_CUSTOM_NOA_PARAM_STRUC_T); - - if (u4SetBufferLen < sizeof(PARAM_CUSTOM_NOA_PARAM_STRUC_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - - prNoaParam = (P_PARAM_CUSTOM_NOA_PARAM_STRUC_T)pvSetBuffer; - - kalMemZero(&rCmdNoaParam, sizeof(CMD_CUSTOM_NOA_PARAM_STRUC_T)); - rCmdNoaParam.u4NoaDurationMs = prNoaParam->u4NoaDurationMs; - rCmdNoaParam.u4NoaIntervalMs = prNoaParam->u4NoaIntervalMs; - rCmdNoaParam.u4NoaCount = prNoaParam->u4NoaCount; - -#if 0 - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_NOA_PARAM, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_CUSTOM_NOA_PARAM_STRUC_T), - (PUINT_8)&rCmdNoaParam, - pvSetBuffer, - u4SetBufferLen - ); -#else - return wlanoidSendSetQueryP2PCmd(prAdapter, - CMD_ID_SET_NOA_PARAM, - TRUE, - FALSE, - TRUE, - NULL, - nicOidCmdTimeoutCommon, - sizeof(CMD_CUSTOM_NOA_PARAM_STRUC_T), - (PUINT_8)&rCmdNoaParam, - pvSetBuffer, - u4SetBufferLen - ); - -#endif - -} - -WLAN_STATUS -wlanoidSetOppPsParam ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_CUSTOM_OPPPS_PARAM_STRUC_T prOppPsParam; - CMD_CUSTOM_OPPPS_PARAM_STRUC_T rCmdOppPsParam; - - DEBUGFUNC("wlanoidSetOppPsParam"); - DBGLOG(INIT, TRACE,("\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_CUSTOM_OPPPS_PARAM_STRUC_T); - - if (u4SetBufferLen < sizeof(PARAM_CUSTOM_OPPPS_PARAM_STRUC_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - - prOppPsParam = (P_PARAM_CUSTOM_OPPPS_PARAM_STRUC_T)pvSetBuffer; - - kalMemZero(&rCmdOppPsParam, sizeof(CMD_CUSTOM_OPPPS_PARAM_STRUC_T)); - rCmdOppPsParam.u4CTwindowMs = prOppPsParam->u4CTwindowMs; - -#if 0 - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_OPPPS_PARAM, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_CUSTOM_OPPPS_PARAM_STRUC_T), - (PUINT_8)&rCmdOppPsParam, - pvSetBuffer, - u4SetBufferLen - ); -#else - return wlanoidSendSetQueryP2PCmd(prAdapter, - CMD_ID_SET_NOA_PARAM, - TRUE, - FALSE, - TRUE, - NULL, - nicOidCmdTimeoutCommon, - sizeof(CMD_CUSTOM_OPPPS_PARAM_STRUC_T), - (PUINT_8)&rCmdOppPsParam, - pvSetBuffer, - u4SetBufferLen - ); - -#endif - -} - -WLAN_STATUS -wlanoidSetUApsdParam ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - P_PARAM_CUSTOM_UAPSD_PARAM_STRUC_T prUapsdParam; - CMD_CUSTOM_UAPSD_PARAM_STRUC_T rCmdUapsdParam; - P_PM_PROFILE_SETUP_INFO_T prPmProfSetupInfo; - P_BSS_INFO_T prBssInfo; - - - DEBUGFUNC("wlanoidSetUApsdParam"); - DBGLOG(INIT, TRACE,("\n")); - - ASSERT(prAdapter); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_CUSTOM_UAPSD_PARAM_STRUC_T); - - if (u4SetBufferLen < sizeof(PARAM_CUSTOM_UAPSD_PARAM_STRUC_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvSetBuffer); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - prPmProfSetupInfo = &prBssInfo->rPmProfSetupInfo; - - prUapsdParam = (P_PARAM_CUSTOM_UAPSD_PARAM_STRUC_T)pvSetBuffer; - - kalMemZero(&rCmdUapsdParam, sizeof(CMD_CUSTOM_OPPPS_PARAM_STRUC_T)); - rCmdUapsdParam.fgEnAPSD = prUapsdParam->fgEnAPSD; - prAdapter->rWifiVar.fgSupportUAPSD = prUapsdParam->fgEnAPSD; - - rCmdUapsdParam.fgEnAPSD_AcBe = prUapsdParam->fgEnAPSD_AcBe; - rCmdUapsdParam.fgEnAPSD_AcBk = prUapsdParam->fgEnAPSD_AcBk; - rCmdUapsdParam.fgEnAPSD_AcVo = prUapsdParam->fgEnAPSD_AcVo; - rCmdUapsdParam.fgEnAPSD_AcVi = prUapsdParam->fgEnAPSD_AcVi; - prPmProfSetupInfo->ucBmpDeliveryAC = - ((prUapsdParam->fgEnAPSD_AcBe << 0) | - (prUapsdParam->fgEnAPSD_AcBk << 1) | - (prUapsdParam->fgEnAPSD_AcVi << 2) | - (prUapsdParam->fgEnAPSD_AcVo << 3)); - prPmProfSetupInfo->ucBmpTriggerAC = - ((prUapsdParam->fgEnAPSD_AcBe << 0) | - (prUapsdParam->fgEnAPSD_AcBk << 1) | - (prUapsdParam->fgEnAPSD_AcVi << 2) | - (prUapsdParam->fgEnAPSD_AcVo << 3)); - - rCmdUapsdParam.ucMaxSpLen = prUapsdParam->ucMaxSpLen; - prPmProfSetupInfo->ucUapsdSp = prUapsdParam->ucMaxSpLen; - -#if 0 - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_UAPSD_PARAM, - TRUE, - FALSE, - TRUE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(CMD_CUSTOM_OPPPS_PARAM_STRUC_T), - (PUINT_8)&rCmdUapsdParam, - pvSetBuffer, - u4SetBufferLen - ); - #else - return wlanoidSendSetQueryP2PCmd(prAdapter, - CMD_ID_SET_UAPSD_PARAM, - TRUE, - FALSE, - TRUE, - NULL, - nicOidCmdTimeoutCommon, - sizeof(CMD_CUSTOM_OPPPS_PARAM_STRUC_T), - (PUINT_8)&rCmdUapsdParam, - pvSetBuffer, - u4SetBufferLen - ); - -#endif -} - - - -WLAN_STATUS -wlanoidQueryP2pOpChannel ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - - WLAN_STATUS rResult = WLAN_STATUS_FAILURE; -// PUINT_8 pucOpChnl = (PUINT_8)pvQueryBuffer; - - do { - if ((prAdapter == NULL) || (pu4QueryInfoLen == NULL)) { - break; - } - - - if ((u4QueryBufferLen) && (pvQueryBuffer == NULL)) { - break; - } - - if (u4QueryBufferLen < sizeof(UINT_8)) { - *pu4QueryInfoLen = sizeof(UINT_8); - rResult = WLAN_STATUS_BUFFER_TOO_SHORT; - break; - } - -#if 0 - if (!p2pFuncGetCurrentOpChnl(prAdapter, pucOpChnl)) { - rResult = WLAN_STATUS_INVALID_DATA; - break; - } -#else - rResult = WLAN_STATUS_INVALID_DATA; - break; -#endif - - *pu4QueryInfoLen = sizeof(UINT_8); - rResult = WLAN_STATUS_SUCCESS; - - } while (FALSE); - - return rResult; -} /* wlanoidQueryP2pOpChannel */ - -WLAN_STATUS -wlanoidQueryP2pVersion ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - WLAN_STATUS rResult = WLAN_STATUS_FAILURE; -// PUINT_8 pucVersionNum = (PUINT_8)pvQueryBuffer; - - do { - if ((prAdapter == NULL) || (pu4QueryInfoLen == NULL)) { - break; - } - - - if ((u4QueryBufferLen) && (pvQueryBuffer == NULL)) { - break; - } - - if (u4QueryBufferLen < sizeof(UINT_8)) { - *pu4QueryInfoLen = sizeof(UINT_8); - rResult = WLAN_STATUS_BUFFER_TOO_SHORT; - break; - } - - } while (FALSE); - - return rResult; -} /* wlanoidQueryP2pVersion */ - -WLAN_STATUS -wlanoidSetP2pSupplicantVersion ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS rResult = WLAN_STATUS_FAILURE; - UINT_8 ucVersionNum; - - do { - if ((prAdapter == NULL) || (pu4SetInfoLen == NULL)) { - - rResult = WLAN_STATUS_INVALID_DATA; - break; - } - - if ((u4SetBufferLen) && (pvSetBuffer == NULL)) { - rResult = WLAN_STATUS_INVALID_DATA; - break; - } - - *pu4SetInfoLen = sizeof(UINT_8); - - if (u4SetBufferLen < sizeof(UINT_8)) { - rResult = WLAN_STATUS_INVALID_LENGTH; - break; - } - - - ucVersionNum = *((PUINT_8)pvSetBuffer); - - - rResult = WLAN_STATUS_SUCCESS; - } while (FALSE); - - return rResult; -} /* wlanoidSetP2pSupplicantVersion */ - -#if CFG_SUPPORT_P2P_RSSI_QUERY -WLAN_STATUS -wlanoidQueryP2pRssi ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - DEBUGFUNC("wlanoidQueryP2pRssi"); - - ASSERT(prAdapter); - ASSERT(pu4QueryInfoLen); - if (u4QueryBufferLen) { - ASSERT(pvQueryBuffer); - } - - *pu4QueryInfoLen = sizeof(PARAM_RSSI); - - /* Check for query buffer length */ - if (u4QueryBufferLen < *pu4QueryInfoLen) { - DBGLOG(REQ, WARN, ("Too short length %ld\n", u4QueryBufferLen)); - return WLAN_STATUS_BUFFER_TOO_SHORT; - } - - if (prAdapter->fgIsP2pLinkQualityValid == TRUE && - (kalGetTimeTick() - prAdapter->rP2pLinkQualityUpdateTime) <= CFG_LINK_QUALITY_VALID_PERIOD) { - PARAM_RSSI rRssi; - - rRssi = (PARAM_RSSI)prAdapter->rP2pLinkQuality.cRssi; // ranged from (-128 ~ 30) in unit of dBm - - if(rRssi > PARAM_WHQL_RSSI_MAX_DBM) - rRssi = PARAM_WHQL_RSSI_MAX_DBM; - else if(rRssi < PARAM_WHQL_RSSI_MIN_DBM) - rRssi = PARAM_WHQL_RSSI_MIN_DBM; - - kalMemCopy(pvQueryBuffer, &rRssi, sizeof(PARAM_RSSI)); - return WLAN_STATUS_SUCCESS; - } - - #ifdef LINUX - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_GET_LINK_QUALITY, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryLinkQuality, - nicOidCmdTimeoutCommon, - *pu4QueryInfoLen, - pvQueryBuffer, - pvQueryBuffer, - u4QueryBufferLen - ); - #else - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_GET_LINK_QUALITY, - FALSE, - TRUE, - TRUE, - nicCmdEventQueryLinkQuality, - nicOidCmdTimeoutCommon, - 0, - NULL, - pvQueryBuffer, - u4QueryBufferLen - ); - - #endif -} /* wlanoidQueryP2pRssi */ -#endif - - diff --git a/drivers/net/wireless/mt5931/firmware_5931/WIFI_RAM_CODE b/drivers/net/wireless/mt5931/firmware_5931/WIFI_RAM_CODE deleted file mode 100755 index 2634f8392130ab95f1acfefe875cdfe8a56237ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 139776 zcmb4JL#!wOuD!Nx+qP}{UE8*8+qP}nwr$(@&w4hKzigWJB&R27ityiOsb^f3;gxnP zNW)xyMIm-e8(RZE{ouH7i)2~sD0=Wn7o+zXF&<%GLlO;4LfC0NIDL$#tBcFU+kkmx5wLDyMVj)gyB3)+f1u5{+wM6{ zG7T!y6*r3!=MvB9VO)-DCa9o;Mq~LrnN0A3 zkxT4q6v2*57=AnQI_xkt-P+bx<%;p*;q=kp7ER@>G*fPHFn7gM zu*F|yJf~^z1k=pUSX*jYU0Rw1o;c!H9lO5ZJm{AIASmfwG*5pFh<{X{Tvlx0bN}CZ zdbVv?&<$grWrgJNGYXeY|9|6&Zdt^%Fb}ZIoIMu{r!2JpmmY#r{tAm3U&1*6I>?K> z?jp549>|1f%*h3Sl+soeW%>V?9!OC+Xu!8zC%oxL_2mnXhX22MfcC*uZ+(o;nuOj~ z!!e4%{a^gjlar$3k^&1$vj{nhn$4R3fAP3d#)F=q#S~IXz)-)a%})Lo-qJu|f_o8C z-cG|VU5ogNBH#`IaT>sdsEftn!rF*1TR^^y6_C)#^;9w#A96#S$bZ`yafTO5&uf=O z-Y34_^>T6l?XMyDF-UvsN!{rnM*8R#)KC?Ql|;LndWn|9_2xl(FV2S;(gS&^7Lw=1 zb@peq`}VRwGac;_(0n*daueXCxKBGF1`i}d)QYbRZSLskBWRzkYOiSsYd$GPAPTSr zX2$#b7d?Y?#QRwSkJX~;5^bx^+;nm|rG-(lkca`_8^%C4kj`AU0}Z%<>A|-pAu=xUGZiB_=4@XmVCRoY#Ui&R>i^=E1pK_V|l1o=FwGlWBC!kb(aka?3`_Rn>eJ- z{?Zw?rGQ2Qet5I`)SaA&avIwBA|XWE_BcU76&}LC&gH4Cjf5;}02s_YZIdk?0VCWa zi+*`-;2}efTf@V0x_%kEiQ11RY@H9c+LI^peA9;mo43-|_6|!%A-C4g`TTr6t7jAF z1`2A{IrOcr&R9-!ntOvn?T2pzjMg){bu>3XEAtnM*!cPn6qq02?Qwvns3*U)uJbzw z9Ro<6_W(S+6Vt$4BIGO6jX|-vCX6~qTb*y{1v9Vd**UnIh5ZdYd*-g&Dk;0{skKVn z$NV?@=LCcLjwo5@=OjMFth@xp6cCqOv2ex7aEn2S`)-?#6!<*wQn6nqpLGR@4!bE$ zQ9x6GIgQ90>-eMk;cCj}0Qoir)8L%$ddBiGQmKe5xM0F-dTLV=bc)a0tg6y-6G~;m z5yp;R)L5XlgiqlLz2P;&pmQ-2Rs~fqNEae-5IGmu zV0TT#1+U^-o^WJN3a3Rf{(DgY0U=`?wi5qY|8d?;LpCjZY15w?0N^6uem_Gwq#s;< z>Er`s_UyyeU?16fFc>ln4VnB4l~^1lFem*;D>bLDB}&7AX>d>21DiBTzgsc`Se(5; zK}7VCj@if8fpXJH<0&$0?I9(RWWP44%_M5A8~GoZ|k%gH;;?6h%iv zdueb`l7?ovCJR;U+EI4xyr5)v6X$mK6uX)QY&dh)W<#Thou{$aR>GPNr_e)=X?5(_ z(8%4^MOV%Cq|uSGV+NZF$`&cZ-#rzDJ5;FZv5` zzbWgdL}b-*yPgag?*NfNnJWz)=+ijBqCE0R>`nm5;8rWHB{n1fiwwfSBg9+eGnXhi zh?K(Ofu1af^^!%lhlruLuI!DbVKZRf zQInHxCe8W7AV^vS!8F}*3_+MP#Bf{UBTm1iBCd^`-*K&3}k1?tQVe4(9ODRXTDMi@7_U_Qzm}k3@`LB9wfjlc?7va5O z6AGD#hldRoyJ^O0J=_%$YZc9%ug8f*+i*sOnUo$_RBE$;u67P_@;oqC;W>>OMEj*^ zuHH15*gRv1;MFW1H?wh>bc(;{l!SbrTZo3wa=2$vKXG?Pd5z*x%&(ZkccazPP_+sl zh+LTLpG+y=P_!E^=1OolPx4>F^@8)YZ9@SlHMh^L&F+z0K?lA-7!yr?!IMIzD2XOr z04RR(Rw{93*RIqiMHwVQj9~W>jkKoJ9>X#91q1-%b~$;6Y1bNlehpTKbPy7n zIV{+VwCV@6Q}9nx3wM8k=3+3+HkByj+b)uNFIQNmXZ0WSDE8QJX7krpwl7Sy!}vNY zZKX%@wvfbK>xShLL-DT+D2B87ApPMsI0Pm0zy$=?VOd8# zeuN+*?R^)hx<7rk%=LToV3*;}B%o=d@?u77&TZI%in*_md$pnbyRPZMBz_cqS}TW9qtdHH;yxEFtM|rZddHe@2JOj1mdF% z7WzV_;w;|YG=F=L6=QGrA8SHNJ+|h@q*AULn`56tB?dz_WU55NDZZoa6(TGOGK+rwBi$_kzs3yjF;6Uq^d>w`20ED z@wZWeBemA~uub!-j};^g`?~5X5uTBzU;*Z;%jFz$mRrt!C4uqsOPigrajKH3WSI{- z7G=kQ@;XuNOzex;@(nxp!d(jNG2tDOr2^6%W#Y!qJ+%Rlj#L6qo~WbM2`Gp|tHEN9 zR(v|(f~_86?l)5~W9_74a8nl}1ic0FfI~VwZLb+*5ccGZNd0 zB}jHPj~1u(idPh91=bFkyy^~>VB=$oVV1Y_~-C{Tx^y|~Afa>&`S zT)t>qGmQa;xoRel24(c2k=K&ARE7t#Og{rHViO<=%-A09ry4(i4rD2%c<+D^|CSx! zzb?1&@hVgg$sGQyTNNfg_-Y+cc2Iuw_oUNvq)~lU%%}(7DO>{iB7VWrHM+{YcMDCo zS7J(!{M<|}vz1H7@T4L=pyCU;5%U?e{XA0fylIxQ408LnKUap9MWf;#SsZgZ%5;%&i zxNfner}0ADfnpj@wAGnUXS)bLun#&UmL6rMypcw^z5*xadrry~JhBTeZ~%TEAmo1H zaTtA9pC@O(orwBv`x3*5f#LHpV!qsyW*$btxTnw5avrd)A-pa!czwCDH_YXZ(kdC9 zVF6~9F5)Q)i|s_tYzs@8g~E!eNz-9v`D$w@9n8URUn?}BZW3CL;;|knz6CeT@D3Ih z`w%~XAZu3ku89*eqnO^M;IFX)Z|QZ<>YYlyse>zr`Fa0G7lbu=8rAsS%%5KocY>K$7ON%#Y8*0{$KL4ymi;!>DLn$u01wC@~Q;dB;ms1ZP>SheRQErbjo_CjY!<5k&eoU?E@Dp&3 zUqu>(&>UZWk_rmilSwpgSYD0jf8?FSS?P|RAz?b=6>0T+N9XvE;WZ&gp?nrB4RYqzN$d9Oty$p(&>WLV-s_}?g zd#uv6rKRU;>CwH!YoL zzQW9oFM>J+yV)Ajprys5DFsYhmhh-6VF17m>Fl{B>J2pbWaA+%SiXe@)VTl=R5%Si zGaNw{!`(3i-Kih8Ip9ei823L#%|Vj7S#BRc%2&^zbUgtskFlu-oAmh$s%GG1UBuz& zJouk4&So2dDibU8{6nRP#hV-DRLMznQ(tFe^?xQt=BVv^9_O`pb~78RclMUCZY?8p z^WS9jS%R+OBzuqR2t;>jJ`u0pVs}GJzVn46N@dS>!maTfbAUP*&t|*63xe`5G{oSQ;zt82C(CM~2>$ zT+_~qMkpwWGdmn2&Y`Z{EfeML_6ZWs_QYwTltXCHiWa^xJS#RwF28Om&eBM2MdhNNee)YUt{;5Q7?o8^fRq=8W-~B zLawP~0iOQEctUWnAv{$P2={&1xc9G#@Oe&O81iA!sf?|Qa~JVIt5pFm@5)qSEs^;$ zrS~*TFSSRQ(9)Ux%D8hXr5&cK{JvmZ2bEz7hv)tl&ejf&LBh&bLQ0TrLajL3tGo_D zs)^LFJzZPT<6&}17mL|0D1hVed4F(Ox&dd)O!6s6k#JS- zC{!_ePlDs9*}=RmVe@}f)jjNgHS9O{@OT@{S5~XRSPz@w0TasgNTb%n0Tht#{MDl5fVPf?NE4inq{If|01CJ z?F}d%R<{*-)w%Rpu}wVF^-0N9WLKtUCog<(LQdiKDZeWH$p)}bL`$Y0v0qrD-Q&*Gu+gk9Y@;QxM2yVYIIY*sI@zV?NyR}J||px9k+7EWfZn+`d$|TUy_nxrp zXTWamvP%`^6f}=Pj`+LOK2QZ7}j?Y}~YUGUT8P4M^%} zJrqgyX4k+k`5h)eT$at4e1~?eR@jL(HVon(=C63d-&nLUH_CZQz3nIw_H|qb zf{StP=TF&)h4)kb#rjf$E?}UCiBy5}&B2uP4<7PT4m2^(`Mp}&5?VzX_mt-al}99E z5IYIo^gM3Lq07#@1VQyBr;!@K&&X0!;rg_Ht(>Q|yrhGFVF@Us2GA-u{o$av~Lzh;FPkH*sY$2qN4N&9&935Kok}OZ5 z5b{b~J`A6;Atcy73<(xp^1|>$wGM>1m=;z)zbN)#NhCFKcG0-8KA~Ed>Nd?c-wmOB zsh-;|d=>GAl7{CjDa-Kf zh@4RuhRYxrnE3u`#;Q_*KeSBySNvMi$kGTotM%pED5o2vU(}0&{nVK=$oMKV<-FG- zmZtcdutpqm^M5xZ4!s>y;IRW*21K=Er5o0&QtUa~@y<2;tku3nlg znLS77WY?n#&5m+t$OpJ1+8lFNNo0>K)~`QYTmHi)Y@zR(xsGXjyv~}aVnsJr>-gV% zNoMH$LDXAGAjnqOGVErK{Wo9Chtr9u1VS>nNk^yP8|l-><}PfPWeTWYN7iG&3WpnBbvDzMkSMiFNQDTUChaD^ zI@sWQOW)r@Lz>r6KJVm9ggS10J_#VtH^4&I0wz9MCaNM@n(yCy zI%nvo18}X)WaF!>oI$5S=FppEyq(o=CsjEYBmJ%<)qtvq$g~j*Dom@q8lIz9D}$V268

lv2`PQ0*-`vZdm~=!0L~QOJEJa)fK= zv=LsxZB0%{B+4wN^!J_MgNhvLLi*Y)AZ(F);l$jpp|N9B+P>t>{V58BpFN+typeNI zsFg_Vn?}*hTT)r?yE=QL@`0*mUqT!{CC2<~Vs@Sb%5X5!U>{cAKO?%P!`#CWAB|-a zyaDJE*EeZYOsOTsbBiinGo}f*DiaR(VxvKvJ8s-OPDF0j-CG<%>3k&tO)k*ZhV;j& z6<*pGt#x<{ztlC+f3_V&C2*s#KkVU`8mVa$^l?o4yV9Mk@DURQa1|uCu>wHhPkqem zF!PL+elHmVQ{O5!NeHTSpb(8SJuD2ufD`3^c@B7;IgATS#IwPu^0J9>6m7}Tmd$M< z%#(*5Zj~T`0PA5Z++*xLu5uiNbIP4&KWN=Q!7ldVNKVUw%s7D?`h6aHB=ZNKl$%Qa z@(m{R6r}{!-RT2Z`9YpM#t*9EC+}v%yL+W=;{Dq75DY2RhvSRXz*K(=iLk;Id?D;c zQx1&ZqzAEf0EnL;%8jN3_B;yk-kNRbY)9y^H3;475hf<)XQ6ulCq&n9cO1_e)T=Xi ziep&zzxHrn``un>fE7U_!`8ZN?3vN}2Ia@`jH{3x5}|Kd%OiPZ;MU3JJ8I_6l{uwd zPK$yBki(el*-&zFF?OO-BqTBuX}Ydad^0cEIKt;;l;nK0)~l7RC~~ROBD_Bx9~|Q% zO2TdbCq*E8!V}_wj%8^78xK)&a@amW=QOO(Gpf%h^DfXE+l<*# zcV(9^cV4hw5(2NjNj^QV2IfDR&VW?_w{|CF$=r zZNcd!jL)`rp)RZNw?P>!VA++CBWHCjai|x}>f837hdQx!q3}<~%tT@q1Y1Lc4hX_y z@lUFY9TU7fy>_!CA)RxivvS3q$N7rEk=o#Hvc2S2Nic(Y7>s3T82i_!i+`}ON)n10 zkS3nG22FPA-2@=P7V#%mni@JY;2{3GR7cR}>%$rBf;fbQRQe!qd{89$VnN43N+|07kB!wyUbcWG|clSdzIU>HX1+nCk~FF zS?HITnn42y=u{7K)nyEw&_M-n=l`{E!1BM5I$msE0&@DS4XVC?#C*p+T<4xlZ$8*J zK({FrB{Z&xVZ|yV02x2mv7>FR)hp=T48Y589M;pBHxq+#GQ z>3XF{4z`I#gf%u?&hvBPXigoP;G8jNdM}d6)w^Y1|*jffmLPJ4jYY9Q-yUde1-4o(2uG`!iFy--fh0oi0cQ=1G zyTyG!XNyzq>#W7h%Q*$KS}|UyZ1T6u+U9$#?@rW9nb)i=qKKWm1wl2pAm$&5UgPJA zZ2gjK1a9&UcKmwclRQHq0&R;M3d+}jQ}TA`#Gumqvj{KA+n&glR?B0~9?y|Tt5r@b zKCUwYKV?XTxFwwiNNdGJR9X{&o4CZ%UVn%ewt)1sHOI=1HsCoqMc#kO|>N-)~vVqn+}D-a^KeK=5J zMsWcG3rN$s$Lp+766l_$NNja>{3t)JuKsiW7;PNK-TF@U!IeqAVrdWeUR;+D5!|lL z7AGxd3^}Kj*QS2oN$>rq&={x{;cslpVD79Jp{WDcsnO zy)s8SBUbCO+l?`H`$Q&soDc|J!7NsGak}Rr$CWP#&Vk~eb)aIu4^Xhoc|DMzgZ!S( z$UK-m|9Gm6T)rlSYi;2YV_h(Ba@fR0k$mTg)rAj zzih{JvK6#{sE#>!mHv}YH_;8?&X*Tzue&O64(VK+$7c2Uh`{jaq@izwf0?bAs^p)e0BJ)dtwp?X59zrLfe^n>zAcmp!N zX^?qG+?`?MLTlOr5~8c02b48UaGu}l_)lOgxV$eo+~de|e-TKaz|!T5?_0IkBLJG_ z`P(=9Q$5d)7@L%YQY#Bobl)3BY#moC4MU?%d@7`-NcfXxa4B++JQf&bG`ZzbQG}-N zDTPIO{=fDM8;B3)e#TQM(SMUuXmZ-N#78J||BUD7|LICf5$8_%!L5UKHc%u=8wmqU z??rphS_I+y;ztme_^9{g{Buxl;4mIKca#^I+pK3eL+P`1VsE}<DTE~~S4ORe z)@BRnu_64Xb1HR8s%d)<%cnDwt#v?rG@_`VOp&Po{f%L~FED~a;J;(m(N_L(prz{d z^x_lEY*HU;c?M#(Re=G#X@m~3q632B@3Kc%PhNdc+N%s^0s+HXhTleYKuToVD4Guo zjy;2H&t$iQsv*(1%5JkQzA)(T&_e2DJth~>JiIRd<9NXXuL1Q!(8$gWKcK>EUwzR)fGBvWqwT(nQLE-!2uUy} z0fBQ|fjr&dX^Ky1zn^v*FG3A!SM%$6gHK&|?l*^=W8Z6B z9>n0kdOp%TgxvWKTVm<$esRyEt}aRq&?YhRy`D*%6XTj`EMy!~frlV3+g7N(TH`4t z{J;acFBdjMVoF6A%{I+%vJPj6@*AbsEHdXMR2@d9o`(K;ASaUUQ<2`JLA`-|@f0Y) z=GxN)vdj%Pi#~Z^pP3#5)`{WWo}yzCEt3yVCR_GH1a?HyjyE#xbkD6FcA2;l#P=we zJcntX`tH49^6Xr*z~PQ1q5(BB(5aM+t*)E!M1`^|H}W&2Efy%o3^*fKWKAK{)muCH zw77vT+u3IR#sR@QMR#WiwJ%(Uk&D?4+8$H@=zf9AKu)KHnEBcE_obSgJBNxtjSH=_ zR4N+xW*|b5vj6NuUfZ*i)z>~!EfZzgzIp%CO)QCD(Uy&3(O0e|Q(Oc1;_suDJXgQ6 z2;^!T_=YutI@hf{EfV!_@*yFFnbUwTSUZ0ZOs3DoJO7+jN6XE*QSTVdU=#+<#8%CdpLExu z8nReydho)3gl|fc8Oh9qiI9``EN(wHVad!wmKMDrQ2+cR0$Nb7#gt+Ugo0c4TNTBv zkNB?Tk*U1YR&!#qY`D@D6x4Q(S2qur0L5R(hNU-K%Np=9dsP8@u{zd78+wp^`b@R? zy89m$b0H!UOwBq(lk8YSiG4FtQPwr`0FIT@c_ucge4pP(;{|P^s)Lrb6n_jS*n&<7uyskMq^W^mk zl&2ek!cwN44@Gif|HCH85yX%gP9XR)v--;zZDr3Xm5j!M)2f;xr-S?@aC}|T$oR0z zcuH98-xd7KRH#NXSFzkHM~c3BTSM;UUox&QyXva6aJQVZvP1u)qhV)bW2qx}3uJCY zXlf;#n7odMz2I{wAB~zy^)AFm%7a}wb39VaCn{avHaAP5*KmpFWl!Zlab(XuE!Slh z?BNl1;{qNMkQ#Vm)vh-W&lr&nDGW&ArjqSKY1#t)%D+@&1G|3sri<+7 zXj^BM3D|@}ir7@WY5qlkhl1q9rD2ZGtwFY}w>;mZMtc+G(RV6*MNs+nN8 z11Ng7p+U>sp?v}>GPZB3^$SI29*teU5rb^OsdB7&s8kAYf@qtNGPQ4l74Op*n}cLb!eMQTZS zuq;)>W?~$5-zA@@HEw|xtYbG$tUuPCAd2~CS2<0C({A3GsJD&V{fpcPB zCk!mFwp0k9P^*VXBtJ7r&WS!kQJLjUp4!m6-TnZlZBPM#Mgv9eI;!Zx|z`XKV0iZ{fzAG_{E8D5w;zv&Oab zAFAmml{XAirQLQnrB;`!Z9S7FYXORL0lsq8`9?H`+`o4I6!gJQfVOrJl0xT$_{9a8 zGXzNTE;0sFTXl{{-k?v4VTsBV4jQos-(a5WUl9in5ThDL{ciU@_anM+vgAV0ni>G|-g)w287-f&{{i?!CK*aCTfE z;4|eW+h#&eMo%boM2LtJaD7WD9bp`82Xc2wkubfp#|(}Y1bT8yTOr^G<+6u46t~)j z%aT&Q4OId@he!o{%-4v_{65Il3}w!oPJAi4wjmfocw~i!j5(C24+{w3d1dCPXyzcc+un$89uo(Ld zy2Y|JJU7za@ny`#`@g5aB9hf(XVD^yOFK+;y==>pd&Bx(?1k}?HN^33s+O<%T&eoa z<-5Yt`7ft61TLretDYv?LrKY321`B^Nc<7}XoFLASVN=ct8|=0Xb#V={ywp#0Ts}= zTzC3@C^=&22LQss*7bm#g;c(8hGrLCtnVd~o3ZuZse3dk%=^+7346hg1ZozY4hq^k zxZnLhlkIC;sqfx)T7vjrSQ~VGXCyE@)l<$p#NjrZoHompsV@{Sci0*x74@5+V@wyOU4MeF=?;>1V zX?a0~Cp2NZC^N8=31r1M1pYe88iwBQs#2kg6pS(hHwe-zd9orrNaE3|k2Dttbs*FJ z)M{HR(dulD^W*w;5gIsztl(hZkEWYJYk0OYGgZ2|UY@)-0`SfvN+nFH7PkEXmtBDJ zbq1fRHLp26wBXmvIzOW!)C|nmP_@k^`|+ut@S6t=CzSxYHC^Y)T*hZ+0=70N}ql}Xa`s9? zM2qhVoIbrbX5{*Luccr`!U$Y{7woF6W?gu~BUge7x#Arn%PDWCHPBvqWI8^x6pr7c z&J8%x_O{{Fy0bLVId4p49-8piouZmNlU+61)A+o9!QlbNN)Z6z?Fm&T<_87pfXytF zN&OT<)Q$R0&MO_|auD+zgVUUseum;TN!vR>>8ha+H||=kodQo0UHdwvragurv))Jg z4yQ4+LzN=O@8f29mO-uFv1`aun|q+vZ)a92E&WVu*rB@Kjj6EK0?fVLd=>n_KT@&m zLW;lR4HSpICw)}}zI+A^E9VKixe+CfL}LcD|9o9@%_3r4m5e|Z^1u&6f$U~%)!_+i z5dfx_i`z6m61L4nX0e`5iCrE?#+lso8)2`}IqIGrBJl=A4aZia;d}rq7JpI+ zJsmb?E<~z==r9({NDXe)i%Ae^&e&}_%t5smqudr4dCZr;f?Bc!8T+$ofS^$2W>p}-L@!iQVO>7If; zeN0tkhax0WXX&Km{yX2I`x0SYMFJBWDs9a-;PQStI@HvWcVA;_m%cn?GX@^<6f8An zbDC%6wlRg|z1Luh)9mLnM+l{5o>ElWv=smKXni>YH+X!p`VhCT(V%G~{7nkHpjKD9NSj+8^ z$C*vqZTPDH#TmIpN9sU@03=OTA0o*@i^7~n>7_x!<*d=bp-10i1TM1g_rEPWR(%aZ z(tRnc9azN189SFuz5T+f#w+=bUY5h3Z9D&okTCfehHMYQvYq-t~KJhyFHg}#_D;Gti3P8j#j&nX# zlf9OZ9eV&IR8dt+v>ZzbZCY7bkzon|r9J2O=uF`k;O0@j{QxBdnaBDn@{R?Tip}ia z5717pP<0?wktg_*Lnhb=;n8tCw>?L~EdbI5A@Byz`6Ri4M5>NQ>Pf$3%L+sX(@5wv+g@p30&e)aH0I{ygT@pU@u3sldH2Pj_*yHguF zcKT6Z{~Pc>gBj`neCmYPSvK zcl%EO?~wXNhSpr>u}J#Yk}|!Jhax8&c7m^*G(gR%dET)Osb#Ot2}zbi$?%Qo$|@Y@ z(9L<@crG0{s&{PLzR!?ECdg>(MTZiB)&c0M=tUgfL?}!`PDs1z{P64at&l+9|FjcH zFQazt3fiUIi|c8jhTzxN-K!eh3iOp29@Q1f^1L5#=ZgR2#y@^EU$=|a?<*H`gjYei zx{AHW9Ks9B2Axtp%R#m;IkUW+SEa{uy~p$f^16y8%2y*t5GCO=C5L&Yii zSh2{ORUFOOlj{k{i}1yk;s2xL+8Xls%eg`Q52PMi7#Zq52J4EvE_ncMcmm zKeQ*kQQLp{b9*J7Sz!yAw3PG!mGt(W;vT@F!H|M3-p`bAi9tMJFLbG-TQu6SghE?f5zq8(UY7@?vdTOdZ&8oqMV%%n^i?HfL85diArF?vN z> zkfFWw_r1^$6lBU4J*7O7j!u*u0C_adp*sN=@b!AhDBwUv%f6m)HaVR?lQkrWKzraw z<4joRx~O7jj%IA2lUF?+j69<5#b(<_u_w zbeT19ViYp2rj4QgdZ!GV8NnF}w|H&rEc5pzxiI3UzfT^&jbV#8Y9Uo_xQF)MU$#z{ z8G{V07%<$W#XVVdEjid+t!}B&rgrd0i99$8>Qh1RBQNN@-<+c`GmbQzvOO4VbD+pj zI{bC;n4Y_0EaiXQ5g)T)y3%G_Xn%$HWISw4{_@N!W5p}yE=LiO?GML@oMejicJl@5w4_gbB<8QE8pUf ziuZoPhdhq=V|x5N%kbHzqNoQjV<#sU>BqYlPvOhoS1B!TnFq`Oi-S0laZYHW zx&#z;kDcr1zxiB=&tE|LcJLszu~iCINaO=Aq8~Er4dNrFu{H)Ox>{v&W7$lVrmS|$ zi|rqWeVZoYGcv?aCV7Q_lc=OG>Ba(q@8f_swd!56m6jgN+~{<++QaXO#jz%(VNewk z+H=06?;VLW*8)zT;6S^+wDt~x_Wwf2V0D7oF1em!@hjV3hc#7;nzJX%%x^Czo z=8BH*@drzWskyw;p9Xf;BLsug>$~OH7c~Wxg)QBngM`Y!#WwX;!;s{`o7{uAqG{JM z8lpcZ-s+5VJV~&d64IM5)f*WMAAym)@7$!?>iL_H^{2PdK`x7_C}*#pcHrXvar6kZ zEg?Bp*F4`T+|vn(h#iT5Vz4y)Rta@QST;LKm#%!|l2R~$ic>K(Ca7fOQ~Eg5k_Gm; z**xwUjrYjvL31%tLXIa&+N=_;KP!;_`tp`Q^S5EG`c?GM)6VQ$JPZd~%OD6!XFIQb z=QK85TTREG0vvC_rYj!CN@zm+)Eb>on~QRNKScnums*94yCcDrM7u^oMBGT1OMtIc z@&}gQn*V9zY_b$(-U+#0^e9)|!HLZI5a|Q-kc09t0LcwEhk+K*G-iS895aTg3*E&9&F?ml>VlNd{UpsXGl zi|MLN%J!q~^JETt{5cGq4CmzR$mqGCs}E8SXf-W|m#PFG#LkxK5ncHEfy6r^d8|(f zYHUzC)KPosLIABjO~h3)rj(Ij4CJ@62%dcuq9$D`^*2NXioB=hB!Dvk89q~xVvkMy zJ{iJ~XRsPJ1+wio3R>psOxyTn*;dm6jW}UOi#AWaFsx}BPA+Ot1P4{G*j&|3>5Td zmaJEx9!5P-uQ$arcJQPu%^gG2CUQTTC~Ix|5?qn~uxpWx71FaJ4p3{%Bln-Df~W1< z6DldPr_QQ>EwLajrgi3pL4Di{$&69X6J`jOm*y*C{b4O5wiH*d%T6KcI;gb-Ot%8B zYU^IRzQlRc?i_A1_93$Wt<*suJ>ho;;{P+J_obbtZFZer<6o*D(DQg4hiU_mp#xb- z0q&zZl@!Dy8qpTB@YohriCK+j55haYb`WeZJXvj%j2_Kw0s}KVaTD)sl@MDD)fKtJ z(0KCMTkBfGroOkES~ssznZ3RysWUAwz{Rnro>eQkIMcKg(%|PUSpX7d{y-S}yCt*> zZPUehpdPftmbmel;B4dj}8niMs4TPoHF(+ zfmXrwWB_s~c@LWnxL==r81c9M;lzlV4i2NJLbT0&uMvA)YK8z_Y{p~2T@Sfl4`2?Q z3Ha7qIzLo1#MiS>_lOAvnj~MHh5b#H{6jumY&_AY;W{TW%)%w-t$bS|;6mpd+T?;2 z*qI2#Mlwb#9u+$=(Rb6h-o=FHI7%6lWox->uuseZz=3KtEE>!~$mTKtYMY}3Re`6^ zXp37uP}0D3Djoe&aFB=)2FVY?`wN4`#9(vnrD@!(s5k zIY>xEZf>szP6K_WaAL!b&M^`-Bp1}@g^~AJmMAYa4cLewY0BOP^aI1I;C{cK*hhH1MML9 z@c~l;0jf(l{YFo#oA#BXTS#NB@RY{!bvzJU`0PUtg#=@{ge(O)41Lv5q6QR>rcI zA8zk=9x6G9d+h`&m;1cPxCdeMRd2N6c?UFk_f#}?#46nS$X8DiuTIe{I3UFg>DUMx zWKTYY)3+_2NM7e!B5W8*$6^BK1otwh4nRvb2XlbpGu*kMC`_Z47I|<>IqD7;5@;Zo z)wJ4nLcv-YSlqV`&1MM~IgD|UcFc<}>XaGCxp!;wt%Sy3K&~Q2(+_f(rBC0@boA0f zpc~oBxuY9sfnlo%ARLetmz9uvcJOs=By_z?_`W4XW;y-Mg(V>&hQc^Gy@JiP6x+J-HD~Q6rJ+mXjO)0nL<77N znJ_?hok&$76T&R_Pr0zcjv){fP(fS!UWH4XkVCJNAh@F*#)L(Zdz#o`9>Vt-Tsf;c zvW0@gco5^M5+TsAAgB|qp1t5QnX~iiwK!FijHu`uHyjfpx1~M3ymHqTAh2EwnMTL1 zopxDOmL&PZ0ha$&oQ-*HkLwb?!b4BNP#C-uY!Jpl;a$I$sru3%(Qp%_kV$)ogv7P@ zf6Y+Qm>m72uw@FY7NGcyN)H(cDj(ep>HU(6};dh@0(kSqW70 zbTv6$)Ab7uBJxd%Y}XDl+2){=XT5}gsE~&?g~u@|%xXt4@&Ou9-y#|BuiHlP#2~PJ zODml8k2S4lDQBjL?e7iw$}n{nGCkv+3lhjS7Z>T*G>Z6yF#w8~t>$($7|(bI zbc;W|3fl%Syx}eSZGzAEK5tA)qSBLVVg}rm@z7B1IRwLX8UY5gAFJ!B^0QZtQ1qtYo7^6N^g8_>~j;W^a9jqssJ zmL=YAVNI!$%H{PRob*$yQGIKq({<~u2}ksLO>qD;N2jGIl@VKIq5rPMc()I|M0@u~ zN|B@r^KQBXMRZP7Uxufhvgv#oR@Up~MZ?VK?%}M3jch(LdtS=0cRc2T6Q9~L5V+iQ zSK>IRwLX7>c76?prE`S@!+>9jYf#+!5Osu7@Or&fll7iR9T?arMoOodj& zQggr-M9!mRrd7i{tPBgXN4yWKmL{yVu=-teg|gc{-;5fZ_Lb|mTHIfv%Z(~ z(w!GF@B=?=O`^Q$pGxxo>_pe;Uml2+kPX0kK3q<*;&_d}pD% zsawVU^3yi-H>wNf;TWm!N4*nGukac7I84FZmh;f(#zhnjr_n9OpXAATZfUER!A2!U zA|@o*`DolTyHLR^;R!3{=KnBO1U(9gYAT7`Ni;JAA2mc^hXYmk<()3QPSRi5a z-8$i#q9#ozoAk+Lb`DA-M3^`nqFqccu zM+l}?KDU<4Li7D>XsWQ19ITaq0-9}F5l(6>_ zfG@Wj5uMXdbl+j-*=v@GXSy9cY9l&%470_Wa-%hF)mc?ssP0Z_cg5aCnknGn02D!% zRRIfqcFtM)zFenH7yHgA%=eWAYkXGHvOATnAFv^}?;iDqfS;X5@4k@i+h9kACeM?K zw{Euk7rTGtoz*>-3tqT1-5eqH7U5%+%FT`F#THlMRp;Uw9vw!h-oH}vAiidd+9g$~ znqo`ZQEsmdb(&-1^DW3Bk%7wymU|BYFmheeS|xhnW)^6c&$BDKQ89V+Sm&0q@`eBT zN6@O=f>et>>I5uAIRhza*y|ztzYtBpO)#LK{)*pO4ztfTcY|Nqb=en&95F<1#7_qk zwl=AS8iXJ}qVDL*hGQz-H8OKYqcDGC<9NNalFK`9fX`-&{}7XBxkE8zMgbU=pxC z$%7D1Jm?Ed?G*ZVS)kv|FYriTK#hXoz1bitO15W~cI$?sRwyNNJXa_R`mWDp68WEG zHA4Q=RzBE>Ntmm#b^`;VGX!HCTE~F$R+b%3NMud~GA~u;eE>0@Ve<@o22A+T>Y(TC z2N3x03*P3S>8WnRp@oLItG$TN&d~t)N#B0jDp{x+1$1bp87MC>u$m#i0Zr+5q=Wbx zGStFHsTU}%PkccK11_jRwZ?7qlM)8*|ELWIiL38fU(d4ZG z@{dov+TZ4St6Lu`o7HQ#HzvBA!vdlST1K#Jwq1%2l-Wp^HLeD}`X(I2iq~(XR%c)$ zWW^hXMe8=>dhci%oL4~W8ZAl(be#239cLlCNcYTI?S!1LDt)+b!(j7}bsKZsgr%T! zz|_`<;Jrl)U&*PXhSl0Y37M`E#d|Ui8*Mg{m3t}mTQ#wTxltMb65{KtsZZ#(v(j*Qyz$+W z_I#d8CXvwXA5s%rKwq+mGxW0|?H;JXRu9=eC60%4zCopaS9it)Up@z}(TU5WJf<5j zq7~Gs{$#UV17y-&R~|S>hP8BP6oCGz+@HeGT)-@NDTHC4XHCOHVPLK_l)6^%rS{QK zXsw-hw;+#JoTKx4S%pg2+s_`fcKk~v4&%)CbWn0CPqbZ|Nv_#435&JR_c1ftF$I&B zC|DAnSqX)R7uI67QbI{;k1+zUEImNOG8&~-K;>gg_l+wO9PHFAPfoMMM7&D}c`%oGVR?Y_`&&x2?$ zD$s^XP0-6bxw(Ba1NssfmIDUnnkKY#ut;jYr08<|sKHA4`P8G-unx)a_)N9bY68N2 zyEMor+%(AW$TFF|{=ct8* zrXLuzLee<@lkQ<_co)E&HnCV)@eUzWBn^hVYIN>>cI?HKb$vD$C&_*JcSX4p8@>h= zRFCwHX%VmoG|0jx!E5CUm?l-qo$@VpVB}eZzi?bEiAr&*>h^ioAd+KY_9y&AdM9H zmqgtkhy)R1<181C%f7ngQ4;V@M0yE4$`&~avq8;OYV`Vycr3C1eB)AkB#ak=;rEsz z3+V+)g5-D30^#Nit}vvJIv&;7dsYTR@+=hj%I7zr5TlWNr4#darn(?OC!Psh@E2NU zZ;mW?jn?qG`*&+$!v~-071<@M8l$;fIT-1I5H-3sDZvJ+rseK{3Vs>TG&52)~Rj2?X}S^2Gr^bof$p;g#b;Y6+MC{mt-W^tINE_sOTE`l~Efh}SpPFm!6 z>n|SYsI;=kMgI8gA@t;b0v5$84W2OkIXezqIY>i-R)vHq7g%X5l*X;Bb5f;rpOj1k z#sFa#x2`Fr*_|Hk3~(t(&{sXbWuHvCj`$5|HiZB5O8w{A`D4;(Ux+C;btZ5~%wiI~ zE!0}yPV#fF5m9h241%L`m$*Lx?41+F#_j3#fguy+%<*tYm2!OaPW%P04Q9c3*zsPk zG}{+4rATm&_du&r*C>6vZsN=E2SmQ1#e$5Quqxb;Y|rrS7$YEi|A@YF6uv4bPDtOw8SI{Lk^XpShQqCfH4nyq&cU4X z)HrybPB^A$p!dj0_hG8;_~SJ%FmpXI6>qdVNIBYiN4`^u z-+-M)0J+2K8l#0SY$Nz3g6v(gz3sgond%E!q9^Yu%l@W$h?QNF4vK*%5E*s9N`?Si zgYd%Mq{t`w;xAGOZnWQleqz86vsKI0SwvcGwbA!He~%ocA0W%#|IZ+#fmS0i9vPy1o^<(n(^*g3ME8SRM{QR8^%gcFGFsr ztUvW6KpL06VABx9ae#Do_B;Xn67DSi}%*8wD|n_<%2}se@+3<2TwS zHo#9^6-i&E$)U-4pMM(rFlyDZmrScl`MZ4hjb5yvgO0}yEE zRC~^B&`pt;Xc(XU4Yx;_@&UziMk8gSpNZ9-UyT3`&*G+vp%6(7c=OwIj6GLvc~r57 zNa55H63~GP&u_D4E|~#o65-Nrvcrdsjxu!of2WJvCCh(-TLbX*s>ldEdbD(XCxI^U zj%Wl&bey8L(nbI+a8aFtGdvA6Bd1+P``oB~Pd0vUknoV8#hAOVGANch;E~z0(|qkO zha|jznrj9vgKfe#1Qqpbx|KpFKZ?xx6I#z*ey$wqF9cFK($BFmhGp=bQHW@2DNwkS zT97Plh+}QeI5?VNo(r}bHz#HmI26dOSHcxeG6jKBlDHpjr} zgRU)JZa4)hs|u~$!J*9NQt|4+P9jW)#c-jum^%{Q*8FKwb}7lF;@e)F;)aZ3EAjMQ z%!d*X@oM7+T8`xl8g@zDnwGLMd`}+uCp^Ub&ygyx=9oaMDwc9(&~0@%w1;*+PBk9S z3HQ@$E=)iX1d+9aYD!e{cmAw=&|fh{9sBTFRPkIB;q;BjcE!jOz~Za_hcX3+7Z>Kc z($&FYxzx+W$&qEa@@?Koosdoe=+jr~R38(xZt_?Kk z4R>aW58iD6O=zez(4FK6Bqq9W167T1KcXjIR41aj_UDUG@k(RQQ3{qg`SA}w-K(h{ zp3Akc{&FVg{COg#|9di55A)qj;c{bKcivL0>9(2_c-10Xx#ip!Ae-P$uKSG(h6+V} z75Hd$$ulRg|I}|=>M%7dhX{-Ix36-+O?1w4c}vuW@K7feZMjsQpQ|dMsY`IW70M3N z-#ejCJT`;cAyE<&Qq`SEZ;O(Tp%2?^;*?7;1BoJ&l)q&gVC&xbXH~@4XOpRJ9V_qt z=0>y^TB5krggW$Re66N`1lGHzR8%0ys? zNW;>_UaE2W6Ml4pf-KB@kSkbB39J(26kKy6A>IpnwzrQ@?&f)7=vu8oGD^Fyy*<9% zcI`ti@sgMWI^Qs1t|&z53ye=<`nLR9ej>?)WRzoH$%Hq`4AbV>#hHZjN1qqAcF3wZ zXC7*khQQa>?Zv!Fl4Y3cRz09@l-6L8YS2OTWw1Bv!7WI@G&Z-EBgIBdP!*|u_81ZI zW!VE@UR(lGyN$=a)!`RjM3Gz&^>1yk;k?1?&}s9nh4ebk3WXw-X+F--;*|B zIagMs&7s=HE#g)21hMKi`_CfH^e#Og9smk!n#W@$e7+?*$Hocd<4j5M%py>}op$?6 z@I`2cj02jS{Vu(L?(%XtAQLB`4C{4&JJ>W>xzwf*mPA)5KsIBPd86r-KJ@g8pbS@;<8HY zw%(PC#wKhI!bFc)2|Khhbep1tW~DO0L_la6^TAZ^D27xvgZ3^zq?cWf-@8xHV5gDh zAsT!DviAbpRu_?Tpq2zqU`PQ@?9xT+K92uua{ruqql&C;K{hhmWZUP<0CIcy848K3 zaGOKqJ_1J1!9Xe^+(M3FWK?wwJeJ`Bx`F^uX!)3UZR2`tj#$%%Go8zZB1g0KriBT_ zmSy>r)#&wteH3Zw^&gPa1gwcgudhd6Ax1Ah3gl*PAHh`*S!B;=%{IIf-0F@@g-lwS z38MN5x-k<4%;5hyrZRw7h+%iV%-$+X69o4wusrhojdd}tR@)2y4$cSZ znb(ss7&k2Cv_S~_>@WOMIw5dSy^_16p+_o)ajPO=kAKLM$nYtFdUl2O@u(<_D1QB! z{iV^E*18}-^T?!VY4=<fJN1ozj8`1b2VDcpfJGh-nuA-p4p)?Kbdv(102hSx z7HtnOiMKy2UL&$~NL_y7>nZ@?TW zxYad@g@+}onYmxP)AOf?+R(@nxz|XS&UM&i7}z0C8XE@t(6q?7Oo)GJ3$2SIg^%j zS>w9%?OU9q4fEll*l3*nrlH$I3s&+6S~puVB0&# z)U3Gw&~q*ix9sVf>&?Xi?iX0i%lw_<6_TSOoCihXBZBE}%w%st8iZMtS6?OseszESnAAWc43 z9u4Dr2Insa`QB!91`UizbQB97ezf5*|MPhsT71%x@;!`0b6!D&%Ip|(z=vL8ZPj!D z*hiWW1}rff*^x|bUH40OhUdq{Mdkd7NFaO!o`47Y!pC`|o1&OBX1+68<6V*ek#Yz? z9iG*g7%Ar4K1YSI^DU+LRO(tyCYKs=)Og-dg}uF`5o?t9QGUaq5U<_z6_tS*&L7hx zkZC(P_`lS)Chyu+5F=%rHHkc(Ro#|LW~;&2lw%5y-)OiL=&9+eDHB%9CK*DlG2ex? z`O!(aAr0s^7*33*KqEp=7yVJ^zJEVW8ezh_+!MWe zfNJ1DSReWJY4(F@8ZTRy?;@Ze00tGyZ_OHoq@-V1r4HpRQG#u5Z~7p$VC3FqcORdG zEztWwjS{xry*L+BLh|FdR;TL%oRP=nN`U1}vi>Uuko*D|AM-tFGl? zz`#IR{C9J7W~`!HvaDUT*2_}ie#y^L3t9eCT@MPH)4y?(k=Pp&dDm8@s$A^KJTmC6 zC*P%z(h?!Q;FkRK~$YqbEgGWG5KIufek2)Cq)7Wr(H-T89oZXqWPwd~#y8p4QH)Uv)@+8J6rf1cBj!9U^4@Qvx)KF^zvw=f*6L=X*`aU$r zu*DPAsWQE>{6U{i9gve2abUyUkUS{aD7aPx$m#4eddaaVw3i2hxq2GO9-+yw4DL&(uZ%evvv6iVRvA>sg?+GP zDy9)f?x=x33km?CAe&$Zk*5ZD!<>#}^_AkMzM%l=)pv`7bC;BCJI61Wv?n5+FMo`SN}Uk!<4hgQc~IS$ zF>Y<;Ui$87Se3aFHr507gy5M|*}9OixUEw#Y7}wO`FSd;iET0q0)Dj}8KEMQ^Jc9P&Sf)U|z`SjGkUd7w%5+}3WEeTfO(NA;|? z%*;C*2_1jX@kRgitjX2pOsI8@FlSlJxuPm2(X2F)uQ_fsF7g9IWHV8ZBG3y{z-2fN zBkc4(@a3v4c*eyOg5rPmRpmi~T>*=?*hqbq{aN8OV#HUFgSQuWufsBD?0Zv?fW={7 zin#;LZ-v0Mw6X%>8+$HsWvrO%iP6Ipv)X7)8>6i#*KiluMR`BuM#hR&!(Btjuc=_@ zn&W!*{GH`-CV7SVCz@j0Gxjk53ftB$uA)1bnaD%%3}-J{SBt%&N)mO8bRLu8AgSi zQ7K`ex9sD6B0l8gJq4hK#uuUju;RPhXT*V%xSddcxXvphWWR!)X%rCht&M2u?^|pV zXTsTJ=pg{=5B^cb>e)X zVJs`eiR*HdfCTiaxL!A24rZqZFp>26jFD5nW?+Qrsgv(fK|dcJfw%EtB!*``})BzPf z6mx&do?{|bUUh{-TnFGGI|MKDjgyDQQX1V|RC9?pc>_MXqSS^-vR0{6Kb^b*P@_TX z8Mm|Lrbi-d+M;vbtrC;bniPp@-udR&7mvbMJKWWh6`$c{R`3USP@a@T1Ta2p+@S2} z$pVF<A$LmVGh@eIx zW^mqhqE??Lh5Sh(RD_RJk!*L{%x5?>zHXCW@D|yFbI#(s9P|Js$$PIEA>s>aEQhkM z7NE-Kd8A<3fIl|J8n&@?iULISXPNs!+s5x9HQ$~q_`#!@lvE@jo6<&8snStUN|%O` ze6Yn=90$V(ouKW2nogtiP0;o|e_yH%vj>*jx;)Iv4h^~YAL~nk5*}1`h2P~YBLWH~ zU%B(CL~{0DrHjiD?6oB3e5bE?tKh47V8p2u%2=k}$@=RJ)0+`T6Qq}okRw-8o=YMU zSIc&mT zgwf#cGlz`>773;bemR%~%iMRAqy{(6`JRquw4!8gH1sv2wdTaF{?6|Z6nE%9wt^_K zUD(P#S+c8u3eDWy;c!2wB+Tt&N}Awrsgt-Zvpu%e&*@0Ekn4W_LvIskDeoC7o8%Q7 z7tb+S)9(~xcIrFbW9LBN?pkg{A4xY0}SK#q39YY z&?325!UZ23Bw%3FgABzDi_a2k%U|gEp8kblB0VrdCmu^bPo(TT``4*b_UiG6C_)>vth!u`l0>5!wSBYXicCFm3?i8LNA8*-N z!~L_TN`s= zTgz$9B5J%3@IDGRx5X45MNTo1se;VDNUa~*`TEZe_5%#GQY(+i1zpE$5MnJJw?$<3 zON$%=_YmFVAr_#t*7`W0Bd?z6MCCmN*jmEb(B`S2Al;cW1k!*koDDmzFd8E6TL`GD z_=ck}X%@4h7=<*FDdvZ{%u3$UH_bpf^nVoEYBXV%NiBd+Mb0qN*IfcBDvj%7`gHK` zdN5lzYx2Wt0-OKUZg>T?9CU%oOXCJtb-)Osa9;g(J3eL8?jcnzP`Mn+2eF#nEM&=) zUaZC?F0GDQHZS+mIakpsl9&-T46MrA56~RJd|YDq78$%f2KzB%Npj7{+fj5?sC2I_ zY4NIbuncOCBcpbxWl`UeK1k|x+B?r)zp%)O)t#OrDU$uu&(p8);T5{kmkM{{AexfF zrx5<}F;g@;#}#XGr=OcV-NO84Qp74g1Idj-YWiVTNl&3d1i4_GyZ!rR`+?xD$5gW0 zj^8QafiWpT6}eHmDJH{DlUBwzZ?XpAU_C)-a-T@g|8n`cI{E(;>W(ry=|27@P%X9~ zLu+VekX*-PC09y0ai)Qs@?SahR)1MbBWifQYoboe6_b8DhmhoULSj8nRr;f|-@3h5$NWPAU0&eE%ExW{v}ca`lg$i)T{S>k!zv_5K(cJeG>M zxs-t_iK?%**2O{gB~xq;FWbP~qD?TF$( zrXPnIcPofhUo_~AH*2yBB6+=1C~BsyTO_*N4@MFp4$ZdYgiW@rg_BCHv>~^@^p;)l<-SCXH&x)Q3(YPe9y+c~te-W1USN5GafCQch-VH37 zfxx#OrfEVX+m!@|n(?0;OyUdHAvX*Q0n3>R%)eUgzZXoxJ7+fa7f38WNixp+SQZlA ztZyvu14v{fAA^6w#){4gbSa|;5KF-CFl(-5|M!q-DflBtqNfy!p#ZOtouP-uAv)t- zonJ2|5CR9+iF}@)OugpRfSa!I0!*V4q)ltg6+EXm?n45QVmaU!18o~}P@+RrL=!AB zV2Xv1aztcRR$tw#?A{vG%2&yzj7N~G&)O8til=hJNaPPZ?PqU%DXw-OwkxTlx*3Q& z{0^yeNXtFPvIpfvSDS;K+GU7gYPh;wC4YKGH3`OVnaAgQYS(*%w<> zW00Sn=Hv7VZGnn$ZH>`f7G;>RYpk79FeMA%oRWXun86^@e~I8p3VT>Z zUrYsXD4{rk=5oxW^ZwLT`s(avlb3mqKFNx{LngkztazNVr83=q=?g%1eK<0~TP zhoW*=O%F6)X$t`2CQAF~WqHH6^wzosvkAv6h`kC7ZK`_mDVkJ%{;iH{&sF7NybIpL%x1J5K~ zGpKPG<#OF%Yl2D4>8a2q|0XJAjwG~VOEFZoSr05aU&vuf* zyG!kZ?XmFhcyAYRvu1kV@CO^tPXdoFLl!G^(As9rIH7>HEW9k{7Oxv8cY#A@&@Tx$ zUb6G@Hc)Yz^a04j9bya~2FcFR9B-x52a|)kM~5vqkM8!beUy&T3Akj6oN{Ln;}XLz zFl=o|H)Dh0eXm&}*n^(%yr8B|!gB`LCclG~0fKSeLulkqUofrgA7j)JoDRe722*gv zNA>Rs$-e6if?u6MBry>3P2R3m$+r9`ZDQTrkPtc@KnO1qX2ZtiQ%!d&YJ+m4p8yl} zbQNzkOLPT>96OrXX1W=~o&7?NV&&r~*DwuS%Y!~kwEZ4)as)e=Ek3Nu6H30DF&!kX zE=!A)E;uXg8;BYYlZi?~=wkUPwtW<^B{aO#8-#yC2!a(YoWcWqa)XGQ&a^W-4Inko zynlpx3i%E7Ms2vfy}JT05ur`!!=#(jlf!X|)#B>bvg9H6X`-W#zS8qDOpCGEH4eGP zD^>OJARh`>s?paE3pdZ#M~tHVk4&uU-juBnLnCVX-dYfZ?uwzo^|td4;84mQcb|rY+jzzcpwS^rydB zvn?LRChRbI+t=OJ^to_Vg>B=bl`tI8cNdj0Q&AQ`ZoBE zCLDTf;yaZc)Mo7G5X=Z;b`0%wFMsS44^aj&P_T@=r9RL3pdV^Is zFg)ba)Kcbt)hdUJ;QUodg?2#cuF)&Kqjl49i9KTW>PNM>jIA6LRjz@LcRh|%CZlOd zdh@F@C@>E{V9zfZG&@Kum*3;i0}IzscXH;Yj7$q5G1B7?cd$(falYt@0|?(o5@ek5 zJQYFKex3=`VGMf_FA!+wOYBl12}5eUv?V+Z9o6ylA@u^68QXu{vQh{bG4&Z1o`kx5 z50YLZ54!IiSj%2!0&mPRo{L$ew;H=KDf~@szBMy;S7&av+D3bTp2h(7z+OaJ+-sEv zCj1BYBS-#gr*yeMRII!VzS{^F76ra{2IG0Gr`;cDvN^mYN}w!Zl+s|tk)9=Mtb4Jl zJ62-(BJ!d7$DcjIM5}hZG`Ut_;vXkye|08~tjkwHBn{RD`W{YEhoYe=vGi+BWJqe? zCQ_j1%0c@2cnVec2Rj2QDwR^OVld_~IdHLdU)x)qG2~5!mcX&+Zt(?IhU5A$)-6{U zu|coz2ZUN}aX10lKzPM5EriJ=zLXnE_Ilcp+vo>HMNnDyxEYxkPDmp7L$H~@BinJw za<>y2jGQ+J5ywa&SydKP7hsi@ZP@)7l66;T<=@H}xQG))l)X#MUK&eI=WH#KDbv1L z-KQ}Ir5qRDYbAGk628(Up12Ub4l>hY+dX&9hUhj(B)u8^I7AJC< z?^|n`DnFG2@MfC3o-&bkZ7@}XD}fyU9>#T8-s*K)p$OY>aAFen_{eCv9v)78MlhEpLgG%CC4oy^*dT=8@iH*y@F2?X8hq43wG1Cw_wCbU=z2-BqJa zZ``aS1b!}ZkH5-u+2Ee;S4+PqM?_v;Wckb_dg{y8GR5IoC~KZctTP>&*C4x|25j51k7q@<^ONH|Yow`TFr9r_hB`JT9N(1oy{X zH_58!Kh9JnrkwaQjPV=xQu+n;mPqwNq6=+C-xWT9#(_jwt$6_+!%_KHXF??gE#Xii z9bb`py3P-{@-ia%Wv4sJ=a3L5%q*Guz41?^31%T6GdoLDIeUB-R}!~G#}($NzNXs) zN49fNZ0Fi(S*!_(i$&(4I0#x5{0t`${FQ-Dyt(rxVt_fkNnIC6-u+@fO%9yIJh}LZ zz34XjG#T|7t9Y%6ORAWXcEsgkdMo~{@_gkVov+o7hm|rHlE&{of*fz5>aGvUt9Od? zl1$T#EHyA+zbn3rxz^p?^i}*}F$)n`64XO@-#;|$y}Fi*@ym+?Vr!odU(2PYb% z;&C~X=I!Lve?fP=b-PmW>6(O#R3&|KiZFq~8ICNyn=?r=59)co6aA>*84(%jw&Uo*9X~?1=roGxD3XE4wa&kVF|{QLX7tv z-4TOu^!E2yr$dB{@bZuT6Os9SyFkkRIlOBC|H*bdZB#%DT%E_r%BU*RkN%;q9oOxP zYI^F)4xanVAWq&{njlZqAD$wgr#dJp14nhWYEk32VG1&{nv+Vx)ULN;y)uVzE z{yQO>!Lj~+nz+3a8Yt$L&2h)!W|SbR4$2rQXlarmmWS5hO^|#RuQJvk?zv>5+@R5h z?fO(r^6QC)j@@mkb;h$$N&g%LViFKTTGT6hR4f|Uklv5k7w)lPGZLGYAa+kaR(F}? zGH9hx9^tynpR%Jj;gR;LRJv#6&&cL7VZnANmiM*?OGGDrWbz9r!tI@oDarqy9P@Y%yWHY*rqreR#?Wh#4XMglD9Fd zMndcvR>w(dGJA{Ms7$zo7!{5n6W`qU)KY0sr5^|?%jc64CTBVI9~e$ymsf@mPfyKX zjnob(+1UU$S$!jm540~J&bXx9C%gspbRi90Vv79n%{rP`oF$w3lRP-G8|cl zUDrn4a_ot+drL=k@Dthj@tT74^s zp!8H@O~~?Z{PM^`#(q0XItO5fQtF^uH$+o8>Dx!nzeBD#|uURA{s^86eB$`H@{;)fhsvg7wR)!k|JASTgw zmi&QfC_k+@&&1!aG}|d?3Qrv;*N- zX@}L&=?|I0P%0~pe6>W*qKgX}8;1_I6kuh&{A7Q;yU{k^XBwFDx|=3M-Rv}Dt$`SH zdHAXp?Z0DWRE9LzKRCDPQC4cLiJF+_?4FIX<5rKn^%^2-j7va3e|qMvUdh1S{n$BoEVs$M-RiE@6Q(!C~kSAKbkzf&1(2`^5uIZT{Dez%LvGguPz> z3c$dqsVI?Oiqm5z-TMdOo-I`zu*=xM^OmnE%l6a8VAs#tmLJG6q!iD4l(hOf@6bed zHc0njOv)?#3@GeodHknrhK3?zOh26oY{o3v0#hZlYu`@cw6E;J=GwXa@!MZwTeUiL zjwP&_4fKjqn|IW>vv}f)xiugl!*@rFtpg32-NL8Gm*xJtP3v4NT{}yDrO<6SNa33Y z+e5I`eA>Gpo0WtC+cw{}#-s-sie=R1iS^3uOc$sfwOnF<6dPKJM+&ZCGY>BcTkw55 z@vdoLV=g*$Y{_!FT`zdVZ&F$2Hx(*{p~rYqEtL>m|W_Lt) zqz|Gi(zYR*nOKtWJ-BEMml^&Mz#5q55q2H{g687A$vKHEQhb0~tTagBjm>8_wshJV z*@6SG!T?gU)9fC2)W3iO-~SnA=3%pGgicCBLzalkN*H47eGpfBC_JV{eqH=;EZ;x5#4(z4cFFIMOXHN*yNp%lHuEn2rl^ z9~fT`h~c#3r9C>Az?OucFau&`6g(0W#-CJ;`ka!FHTh(Vx{*mp>&i}%C|XQAYq{1Z z9Y%bz@H}wLxn~NiyIJ@d&~48z^q8gbg4vRy(~E=d+f_URkoY__EEFyx zr7)MZF`k!n*#T#}P;A&q@q%#0ty+koOfHmV?hm`<8TN8w!8-))!>euapmuNV0rwi3c+ndq?O&r=cERC6=ZGk?AhyHQ`-JJ)U_3Sef~WP0qF9W zsE@9p1wd0{75%j&x+Vx1XuDC8MUlYURcSwIM6E1TiBQ?JM+7#XJYs>-aAGxT9wjKh z{wjQ-oOvJ2!XmGZeW}nP@8{k{#z@QBQo1x$#O@VC5`jNatT`T5ohDfi2z)%m<7B~# zUn+bx45;M&heEFL3GQMAv%h%|_ch~YOY43m9$S0<3IL2O$%ZAK+QlLx0Af19*nTci zJd+>emd7OS<-3R=noXNyxdGwUF%bb|>gtwAzW))vu+`X#>l@ItPE@G)3v=U(k0(mi z;}=)Lx`$5G@T@=+ZOmei0x$7jdwFnf`uMQyIME8rZ#ct4rS$+|-*HGz4smc4r!@`8 z`Z#lbQBEEQ`jC&XEHWjoNK%hAgJ^rORVeCYfL4w!q7YwbOusJRVygkCLzbvfH(1Jk zfzx*cSNRh1tMuF_sYLsY!Ba!i;{RHIWH$rUYiF9Kj;uxrh1iHp~+Mi8F(D<2%FLU~t zdqWLgk#>T_391F(tQ3Waa_>&a_cqLhez;Rt_|XP%JSCp9ng|*_atx}ejoq*TTU&*_ z@kZY0Q=LSdV1U195JzG`pY(G)xMiC4rUnUx2@$u9HbWVIKY1E_bbkCQHH9@RbuD-mkVl*;#VaF;o@1=NWkV5>=}`vxWO#@3V!nxdG=|sYJ!Cz$-<|(SljF z$JzLpPBT%k3cL#ha@Y!gv=Z}6p@wBh=hgh5gJP-ks2 z9PGUH@e`FWX6ts}oQI(Dm8lowxKs7^r+Y;xM#8-d@BY@3=4^IZJF-uO7I67RZwuq! zWiRy2(|xUxR>XJH`(i_fsgU>TgntXuYCMDz9ZX9wjWhX%g<>Kg!dzLUXwC>{anAPd z#dbkAF|wFC7%jKcm#|x}7onG2v~`X!xYnF`m5#CnFo#jt*&Y^r)H#pUcKTNfHlRY1 zQ8=ViEXS3_a;X=deZ*)h`uOX;#9XJ+lePrW8aTTMd~2&>EnR|Iu+=9qRIcK?@qj4xL8mwQ&D!qOM>lT12UiM2F<+Yt#lWy?GPV!uIX0nZ zm;Y1v3GAY|$RW0eBpMetpaZ?A95k5d4W2!16MBn$925+hhqcc&QWn%f9b@(q2Tvu2 zwMTmDfB;lLtG{TtM4fX+IBvMk@(iBVhpdK_w(+YOy&wBN07KiHzXEx76uQDyvkJmu zZi^!jQga)j{aXw79b!!o)WDlCU*6dScMal@g>O^mXOHXAAP^fdLjXG1Bp(QfyHo)R zPQLNHt#LIfY{-aT%N&hQ)pGi<$V-_xSHKwNjtZuWM!JAqp0MWs9{`CZ0m(CQ9v{Qo zaR}X|Qcz{_=SvGl`1Z~d>o461f$njFkXF1Qx#E<Ni6Rdrj7>V#1!e*C-7V65kYALzi^!s}X-5X>aHrAax$*DRkrz|AmAlogjei3?S;N zZHq*<0(o`c;2k^$rbU`KQ@6*}q1i(0r+@W7#0@)aJDK+yk6z3sb9K0|%$aiaTcx}R zx%}=^s~-ORq&E1~HB8z{07dp7_#KB8Tw1^&tpYPHpnU{xWR#xjYi|OJ-ZvTbW9#aOfzB2@MBFI%bK$(!ugw}6Fzqqc zVlx*!^g+>r!ka3dQzq6o;Zd#Hi^q{h~M{_B+7hwIee?NoB28M%VqN>JBs5%?Hg07mw#l@ zRr#tC?djJeZPdGwz?jTI`(7iD>yg`B!ZgdL=b#O0ZxA!s+negqdyeOS@Q)&wr8dw` z=19YjykP={297;oXP+w8%G8qTZcD={iz1g)Bf>Q(?bV`y8xg?mc{3K7SdPWDN9v`Y z7+j?jfJNk1m0KMM{Dbc$3oICwL!2wgy#GRC$9?&2nKhe}j*9T3yDdpU8UoBd#vc?o z(Cw>OIW%ki?$+arxo;VwT6+F1XEa>@*pX2Qjtr3nDlfu*c|-4KV-}%l0K2_!iG;tI z6&W3qT2bhD*r1A;RfEQiEikoYi>Lkco>28^MljJ_)UVx-d6)h8D1cTb$bAEYM96^k z%Bs0I!i(nM50YfpdYrDi{fu-Lb3&X3Xr2%V|~Q z(!(GZ)qhd_TMm{ol$ashtg}^_bnCI{Av-*dFb7Xrje3#Z8thq>r9cAynvi9838bL0 zdcm227sP31NZJBhsr4|S!kZfPY$hTYCC|uT%^o7Qv$Kap#nL{|1Q4oa$Nn~X4{XG~ zZz;e@A>Z|B(nTPI$L4idE2GMQzA1tK$h^pCqh9Vp12LRxKpjZiLsWzLzh*TYr#8Hf zk%UKT6E;rs!eV45VQ@?Ca0$iPzkKkv`PX-pa&ccnsuL1j3qfBYZGBwBNt*m1eHB)W zb5~y!O(O9fHhY$l0Gnv z*+V$?n~+&;8IqPq%!ookdEo6y&n7%!(_t7_pZWhquL zDUW&+X;;1;LHC24NoW;i)<&f3?Hw;&LJm6UXryS#V!*;#_A04~-mTJTkCTpVVRgtn z8#1Faloo~>Q#*#)j-bD7q#@BBwpqTSA>q2q7f{i~4U3zNl0g}BA$$IyzJ)o#&&Y!^kNEcYtO@MW@pRz|*(e$CGghnwa zvTmkbx${O)Jb2ZX*#@Lvtg4qwH*T%rYmJJMM5RL_JRS6dU}29HZY24j$iROvq9VL3 zi6mZWWRXMJ%*Y75eIe^w$OQJxy@i5!P7Ug))rRyHN;e`&uZ4D|kjbA3zl*bKLsHGD zZ6gnh;f-5-hi($@ju7*nagU;5i6^mxzs2)E_ullvxLu~1DKve_^`ZDdK< z473^24>bi1nCg&IA}bX1>?&z1$jGw+n60`Oq!^?LA36h%^u(W=iz|2;sRczIjNs(F zksR_6KUC{p-B=CW#k_SULxHtg#gBAD)dHfya*Jq%X=MIgS3)-STI1_L7i2_yADMot zd?$hFJVpRF54eqnp3d}~o#EJ+w++v_(Od>kSN(GZ*?+MtYk2PWz?ua=_Z`%e zT6@BGr96930(dRcJE9?hsKXa5A0l^|XJ%x+B{d4o6tzl8C@0N{z`e^B|9x?kAtdZ~ zu}!YaLcZVm>NAiEP*Zw>gm)BwA=kjw4U=bV;lB@nD00ZOh4rY!+3@9+blWP(hFsM_ zclIfwV`LaP zR&V1=gDTvhn9c1WML192vQWxd#|xH0oc5iG-RCp0qNN5G%9O!))@&bD4Y8ezY`9`O z2+`Xcz0`4K(gU4s&F|!}7tJd?Fs2BXV`*=h2^+73`RgPjQ#%!fXaJ9=3&$oIAPL?jP1l~nHG;i{YjAjSXM(+AQmc>muc9S0S`lJ!-Jl-}L zr7v{?e-jOkRItG8;6)ycs!Y!*6tVn?YT;&p-JVs+kR?e$;Z1?2-v5DZ^Dy(R0Ks~G z%{$kOPt9v;S?^07K0c#={F=>b>UMRDE&r;Grv_1!T_qLXBx{H1 zTEUmFDr3JJ;amt;qqZ$fTdvXSh}MQDDh#M8G}?n%5xDqq;%FTg_n)4b8PjnplB0(h z>7&KHb>EI1A~}32?3vA)YiPqc#?cT-t@P$?#Ry`apz`gdQ)EUP^b10>qe)9oiVT}q zb#HH#Wxl*89eJ@t7QAuE6%1i(YSJa`VVnQ1W3sO(|B4cO0(1p#Yr7>(W}dX6%}m?+ zn+7)dz2E)ONOJQE^XB3rdr4D7_6?p^dcS)EvFB%*G|IU8FZKe&e` z){R?OlebV`jRoijwrQjfrT&)62ap>tIdN7C9vI>A23Q5=XqwpBP8vz&UuhI>lXz-% zG!o9)Hqp}MxE3m%!q{OfBkCBns1H>j^7yPdUULg@{$v`^iV}}Z52pC_cf_a~xvP8_ z5RBJY6!52^H(wjnrBa(9Ul>g`uG9in=5q?<{OmZ?VhUS4E>vWV+(wzRKWgW|LMy&q zzN@ONZbw|-ghEICI$Or+Ytn2wxL3gjNQH1CHLW@>%u%s_zm%~b09d#X8EH1(wJ1?W zhfNwENlI05cp1X)M#EYXJ=zRxsbA*?Ovzf>zOVZ_L@sM|ra_jSeKV~`;|%^<;Ks9@ z+ocP&c=Ogreid$XPkkq9mNS#vtxtaTf0R<;58&2$u5f-WI$<0iny)!U3%2W_Z^W~3 zm=;T#Iww~=)O&n%^Q;$tN_7TrmYQncQK#~y>Kfkt!N-{Psda$hNRPeAN8AlikX=pB z=yFeW??FFNuDOR58|*kl$?Rs)>xsVSChAagLydh3{p_lsSv@Y+erj8MZR~Hr-Qz8> z@Pjl6M~u1rT@Xy#5$VXdtk}C3tY65Yh-GJw0KO!bl$(*A7Dw+eTE0PNB*-Mvk!L)emZj4k^+^(MX38FMf1>+5%;I$;ZXm zQhHb@rfI+aD5cnlBZs8{PqM_6kGijoSMzG%>I%f)*d|OG@X@4kDcG5jjSApiRi9wi zf8G)iF`!If96Vh#+4S#K=X%sgnp7+w^J#%(a06P0x7D-G5oQdxzE6;|1S8H1N!eMRLQwf&V7DzCp4KNFE$t48&3ozHrj;@ zZlOWvY50kg7c+ePK&ia`{>n`+W6!427%S4q-EPZB6Bd2h=nNMlez?qWRO(T!gINY| zbA-Az-DQ^aJrb9}ze9&ETp56VXl+IL-B2ZDY1kMUn(m*Adc0Hu?2I~FB;k3--iMm>O}>b!Sf>`d0Ry>H{_^4l@0 zF@r@IzPN;Fn76UkMYBNn+Ye9<1Wu?}N?))>3V&3jYwL`aFFrOe?Ru&(NXtb+61CD! zBDP~d#~D5jbsF^oVl;aBd@YY^{r?L(qKr((Jd$BPT>T_xQ>f+9M;9|j%K2fn2OwEW5gX%?rw#tC}m*ivgEw5EI6L+p!XP}wGJ*)LB_d&(xE z3i_(k91uv^%Z#cVp+A{CF4ChVRb4UQ_*r( z@(<4jLzV=@-z@Gp%tT1tC~)tKYH&?7V`vI zEILS1M1@*trRm%t5;*Yts@LZuwq?l} zg}dm!-kye`E?a|4zz-P`K^u`C(uucK#sJ>A-8QROHlsyVh&-OBY#|iM!(DMRYXZLo zWb*LW&4jAnyW-MjuE~PCgq*ffRL=MLY$P0s5eX0jDmMHD7l;a%KVR zs+%x2?=um?RAKph75oDwub8LTW7#*Ipn{aBu$YqL-i$>~Lg_ppm^htTo@ScgQF~09h)yVI2ivjnho~`*t9f|oG!?cNXD{ z*i)LWeqr~T1}%6R6P7DX3#e4KqjE0HtY|M4t3ST%2}sHvX28(lD!s}c-J#N6-o(5; zk+Jk<9Sz8X9b@6u$Moy)hv?Pk_@%yen7aB=@vuz@sJ}I8t1VSu##W6+@ozQ}8daH<3NBmXH%0oYdPtnZAh(0om~IzP&ncLZY2p- z9H`zBx6cdiC}#q#Xwmlh^dnq%#n;aoD}64rR*Q7*Dk5761VSrkh4~nXk9;u(-TFG{ zO`l!}p^;qyo+|WRD&Goj>JF-yKrm}or_w&}y)=ExWRk1s(Zr-o!y8KVOUW$0AlnXU zNq$*a^Cn&MDlOd0)O-KY;lj&p$%$*eEQ`2Uv@`L&J?=$CG8d}$W4*g35eJR(HKiUo zZ4#atWQL(G0F0y%n$_;$ePH(}6bTr`uXZG_z>A7L^S<(o^lNm#oIm_3=8|g!Gc&jhFhwIl zdDZe?HQkyj%d#%dNq^e8cu4E-TJtR)0?byYnLE-Y^-`S%RRphSxSOV`QJVtl>qq9p zzxH+IhQPD`)KqR28K;p%ffsd<7Q zOhXWM+>Ax#3+ocEU`s%R+~Hi{=c^Fx}Q@@0# z8^I~2?FK7r0*7%95%yhfh1WH)I;ROdf!K>a)?j^ZDj+3xNI)oz7}f@ zX1lNjD_m*jmHGq;$2Qy6_BOX*WG7_ffcbio47grB#cldwV}zH6B$UHXzto<9} zm=tmw-(S9fZgB0A=f@~`8AwM8D41>`?=UnNj;%RS0^VNd?cGkVW4D0leuco{N8p8~ z{0>{_T%X)@ZheUOsj0xxdAx6`RcCl&6_|~2>hHT4DvQ`u=UStEUJ#?fPe;DiWaDA| z+s6oq%t4HmfZ%{A6r4ElkV_S z1|m>r6eTeN|0}D(lkUEj?0@1-v0;;WeO9Vn)2^P+gONf(0tk4ZuzSR&CRAuh`)EER z`7O{-vL%kJwDkwmx3F&PF>oo-%-F(?yg=LfFlrbmh8%M=9O~0ROhxe7B&;}- zW*8$qJ>(v1&Qq&3sL2+zWp_Ii8EMGtmGO9v*kYWb(Vf8Pb9(Y9=<2Ou8)-gb*) zr3I|cfFjngZV*D$F!#09*Vj^xJWEth6j(vn8i-kvHqogQ%pEeTB1jA~R5}=^2|a;M zY2lfyn9*r&dZ66?w9*u{N2= zzhT2FwO?w&4GV{6UlpPQYSy19ysjd=a?E!ST@l?~w~Zd#bwb7VRVerr$8emG zR<8%t0awfpnU-z)q%v&)XOw{1<70WOKV{2AJBzf?K@$+^JwGm*E%hJj;O72#Z8wiM zUi1Y?T)()7H<@ewN8F{w=yB7Z?3M;kH3^iFjWb4WXhwJBCds-a!~u>9QDA)_viL@p>u#`b z7fkwj+}LpJ4k{n}I^MtlUT6M0>3JmXIpLq}=0PiRichBjZft<-7{#USAbav(lp53H zfGFlw7r;))Bj`9!!U_|pldNmWp}6?t534JSjoZoY@!4HE@VwW2CNrVFu&7k5AA1?E-GFnPa1frZ`?}5AMU6JKc?hOI(n7*%8udSkU+yZ1dCz2(uJY^D(Ni z#Mr{N;XI6;SysMnnR6 zER9s)l~Ocay#fMbodl&A;zD#*;@v5^F(AR7>J3x-)YgBG2`j)!~nGb zwe6MgD+#M6yg;qe|aLYo!GqR-m)xy@}KF>i!ypXrwrjE1%6=0**;RXH8$g1 zoo-%-F(?yg=LfFlrbmg>dLj58WHr-o1nE#JK^YBGFY$a}w*= z)I$nAG;ww>eJf7_3zA9}@j(Bg4fFX#am~tq^Gm?RPeY)$O<3je@Q;2k+Cjc(pIe2Ti|dRRPL zESfMWK~m~j_2m2VJ1)-cPdV&&z`52JQUEEu9lKX%X@^5uyg!0TTdW@KB*8;z=t%s2 z{!6~Sfn+RH(WK5)*P{;A8@sfY)B*#`M_Wp(8FickMo5~o*_x4>+i3o})%E?(s<$O? zGFTiFh({iec^O_DUL@It+>V)ZqH(V~!rV8=4w8bW+O+ z4!|$3VkQz#70i1}O6MH+>2z9l9&w2yY-;TO_};$^;9bYkLBZ_xx}^?NX_W&FN~kdp zCyKDZ-_=fY9K7T;;F-;s1wm3Z$NUWl94kp46I>NsO`YImD=5I;d4K~ zhk7NIDiDC%rvoP-;!@?kATtlho@kjC3pZmiwG?%KF#Or816SAAyvHRtuI2cx-k+4n zphQd5HBL}0P&nAi_mZ-^bq%Ent({Oer`4)$eD_QmYwwH+jY!{4yLp;+vgjrE7sK!5612Q2lk%qM*`VDRA~o7jt9C|@ zb^Ad>KN54xUU-_d z)A%2#HnttXf@S87;?n7RpsDH1RmSImE{&BtPF=cGQoqsx8%l^H`}A_cs|1VF7tu2` zbp^5~v+_SSyl04BV;`p;8m^?+k(G3aC-p8C3-DNolr^L=uYd$>==+lSiW{1V_BpI+ zj3F$MmN&-3YG?MmD??O9kE$jd{4go6G-C$1Ml>j_)o(_xpje!{MqQV%dY?dgU?!q- zcOVJi7&q-z9_ThhUvL|SL5Vu0gMX!aEtNwWrMtXr7JHmp0o9tm?CBXz4i}ITRZEf& z+&o40yZIP6C6!u|ToQGWczDh&Zfrcfj}OoVF0Y$Mh;Z6d)q@<|DpO&D^`M)rS7US6 zvd)Vgrk`qRv%y@5MUr_90S2sG1$ZvvJA>>uS9%gw=ls(Ol+Dcc46HF|2m=bbI@X_M zC6JqUxCXjC@etxO{2iblsUzlk66ky9vkT)U0a__|7yqkAENf;I049*vay^~`&bl7{ z#CW5DGhAW%^&IP6+s-niSv1dsRoN5XcQ-Qfc3PDdF8jn~n6oPiR&;mc5xl+uX~$OU zbSr|v|6)D$5#;-}(D}sYUg#cQ(Rg=)8y6txjEQrAO-4_(#8^8NFAEE`m$0+Wscy{4K2PzdQvY ze;?pV86B`+$4=F!#Y0-Yk4@sI5kFpJham}=MmQ{c#9__4mtJcDBEYkuFQ%17Dx^RI zwqX(vhup8!wY)UXX|LTOi(Uy6*LJZxHf!~Hb`DlzfF3vv9A}UaL`i%(AHaUTB+J3P z_N*{TYp{YqHgo2_?f>E|;#WNs4C}fpdA{K82s9H*zqy!vkRN1VztAxoy|$|lCis2- zfRlIY>Sat{j@-GUAW^7iKAB@iTaDfyXiMZ)>+&RMo%5+e>GJCp&;HCOcO>6#K>~W& zdyPXIBt9(gOQgE!|3DmM8l9ybZ$7_$d3<>(?eR~(P&&?mkV4daYOrz{i_IuR2djN? z|KbM+#wN}ifeNZ@y&Nan3RdS0LyT0vw)6!kBRVnMO>2neYAsfjVT5IR}CaM zxLtxKdXoFI6p;({+$D~m*R0Z}rZsL;cp4Y~S=q=W5Y(hY?50G@ zh@5S|TX(ktFOZ7cQBepYn3}1l>JW)C1khK7zaw*4IGt@0E7Y*_2eot+{atUl+p%`E zO0*7VdmLu@601bMi4nwjOV!`X)P-tBtp;C<*?aX}TqhNaaApb?s=|mjD)B9wv#7jna*=TDbk1$td5$jHKQ5Cf;%;! zSNVNG>wc(^ObwS_cLXU?ZagFiYP8KUq#N(NpNeRxGUIgvI<@8Y4>=#xL+{;xp8V+k zmSE_B)HD?AO|0wkao=s5oYedRSAX1s0C4%&vmUypwY?36xTOcu1$#nm z2#`zV^w&aRAX!X+b*v8yZH%nJjEj_ANOj7kCo~I|#46abQe5aYJ;6>tvcvv)HKDe3 zo04W=9b~V5hQZGC3=|!sGXNlnVhh9sQ-&AJ{{CY$02el@0m_(o!N`x8H;ieB1!=8a_eBm6B?px#c->rFP>%B(8VZ^=eQOl8 z_>UWMH9b1i{{~y9L0T_yei8luQ=OYcyUwx|3rZoYur8I#f|!S`H6h0Qrdoqj0O-gj zlr<-Da1cO-W${x-bZ9KSkouoitSS9}vyjcS|=gIfS`(yeY z1L4HyND8=eb7vDdgZ8q>sP?Cnr`{wW!bfbA;zxX)mmTm#p=h~{I1VQB7MDlrozqjA zo+SgL)$|K=?DQ1&>tm9(Y5EBl`wSpCrPoR-CEyx^rXpB@hgAgqu$O}@jxgyjL9;KD zQHN%AibOhcoCfn zY{to63u1$DJgyTC?VXbuuEc5AZX7cLG_Aq0ll8Xhb)B~5I+xNcO!xJM&^p8R?duqD zi))2;$lvd?Wq;7`bo{?ieN1{JX-+{dXZBrL`4pMoCp5Ky=^|q(lUm1&v-t{CJgUg$ zheZ7wYiyo)a|yTgLEtmDlq6JErGh4G;RkFkWxLS@Qcr`}P$kdfIMrkeRB{&rhi=cG zN}&x3p;kLKqd>sr5wh82IF3k{7_j7b)NKn?^7}_PNZz5NspopxSGWYyN^OSVia8kI!T1VJdxu_WTV)IZ(ReSJH*8uWU%54WrU8LRKjfbr!~*vB!TW zdyH4~BB!TxzIU-jG1gbZy?zX`X3h65&}W^yw`@+8Fx2q7{=~PSX-uXR`)yOUmpF3T; zVV4+;Xi?H}^a`Hk01&ewrz!7o;6(K#$q0HK_rhp3TB9jo zPluZ)rt?Rij>KH3{yp~6Qfl9tNE8noZJU~2Q|l0%a)M=7*HwtR>RcQsO4;k(E`?$1 zJF50(UmvE-=7kuC48@La_V(4vV=^&sNZMs8-Ltlckv>#wTkn%5y{cy%S``8%t_!6v zTEzLJQNpz6^};N}P;|8U2Zwz3s=Whnfm!UzW+q!oZSuc%`2&&um@kclMx@PCnhX8R zu20>p0qof!e{S5}JNT;&DllO@E6@N(%+D*kd|QKZ+w7!+UCDW$TVqWx`y<1UrCDWY zd?T&pP4o7polY`IiFSJB>{E=K7x6sW-Uh6%0M$nh64wxWJgd*YZxno1E(ao2y~(_< z*kn&o(Lv^L=_CMkO#GCldfB^w$Nlt>?=HXgJ#@BwHMaiZ6b~WQO3TxvEQ1((;kaz* zisx&$n`FiOZKjAzb&I=qD#H-JD<3AR9=tnHX&U{7#V1yF69H7h`ncnfsF4+E{SQMk z*sI}QtS0{#Cq)!+;yK3r#9iyM(_bGF*|Hbo1;Iu5$;bx5H5rAqSU_p~MqD_mjz)l* z1Mmm-&D=MpIX9RjD$o(gCF-K7o*(d0Q`pGQpBiN6Gm*R+IwJV#^Y^9j%RBlw+0);F zvNb>KyH#7d0$~+_0djM7DJV-$@ANg{r32`a7A63u(QqNO5ChL6oJn3GW$E1R#K9!x5G4z~?SWimXHs;S zSV$Go{R-j3%fueeeJyUrM*%1kCu!;$ z&SY~!sE~_|7R#yBp1R<}RY{sc`2^AK)cdxs6avH)6Fp<*kSzI3K(ve%=_fb<8)MVg2VbvYWzC z4q#Mb;{=NxnC&uKl>C%;11eU7$w*rD5E&T;5`5O~*}zlpolQT%Cokusy0RL=4xT%2V~DTs_HJBh;Ak5nEMO;cP)ZxpBm zl4nAPuCE1qbMV-B`D2vRJ+fXRT7?d$E9W?uaBfA-cdL7pAZT_~hBEM9w089MRpUA3zR_@j%Tk%&VaWirW(&Bq1l(8(6Vcm^gP z4>cCd>;Xw66lAS{n23Aj4%!G+30(KYsN&rrQOk0FRWWppwT_g=n{~^QSJ*MbkRn#r zrU1TN;?VyckHfbx5K7<|4bcn%X8EW#x2_3$H+?6JW9e5^(d(KSxkdsElJ#3JQ=l9uuZ*@#Sp`oO^rY@v>F<>PQytNW3@Zh} zyXHvwHa;>e{;0IoOp~rE1Nv7)tU=IL_0CW1;&xg^!hL%?b?xJ?;z<3*e1nyCC=28n zQ09A6Z@;r3`(1W?KMSBcJ`$cYAsAXKVr)@hx#>sH+*e)&zlQ4sZfDumKeXdZ7u_TH z@FpgTO-}f5?m0tS{D-=PhI3oHDPfs8ukX4HquTlf*Ia@(@Ndw|h4O)Hzh9X~-Q%dQ zOr-pf%^3O(ZYJ;7G!bnaUC7_iq00^uJ?56LNiHLD`Yb*4}DOeCXbAEDko}Q*O zkEI^1fGWdC8JncNCC^E`^LB4@9GQhN5&1Msm~T9x4;$Oay6PHPCp5t9cj7k{QOu0r zP`V=I_;&t&3)eskPy)M$U>#QsH8XVp1~SPB^XLcGt&!1yo*OG(mQxldkww!hhQjRn zM=5IZa#-Lf0v=UOsx##2nnUGHw92R&QJQjkn-LHu63g1YS9aKUdJ zP1D5Zm25cWq+qz>PY$!2O)SC%6goBjUb1j*|H-c(g8Ab?42hj;*Y23vM7~a4X&b)QPS>ho)SeO}N+uJW7T|ODjDZ4wy5x^GS=#b%O z6Fxd3YgkUj*w1c?TTfO5P`#>OXv5lq&GrG5u&T4f@%Bdgf;mUXTWTvThwqlg2-^G$ z_d3E1??}VZHkDP)D$?mvxNV+(SGF4$j%r9)?^y}!^$G-shuG?e3Ptyz@t;S!Fzb;M zWmKi{iJwK7{mTm~pE$Q(z81?xG^+{r5K;<6r{$0^(o+=}%x|V&ar`xlBCCP2U@hOL zESCfk5_kfR^tLD?t5%F0o(U`H7e7UUUMo$xbaW+U>pwZ_Chc1``Ke4n75mHcz%pBzsVbZ!NtqsM>HS1|g= zQHH3>eW`W}P-UZYW2?#K2+Wn)#>H$09Opf1+xC7LD`bv+VNkS3ikRRx*4A@x>(AXi zjYhbcq7cySL{s{55Xz{!>r)A72*!;Mo+LgiX}Ng2_iIgGvk1cl$x-ZrnUbFlAr;Ib zulIgyS^7Ka6LAqKO>0+uL1ntRrsO*=^yy}vmz^Zg+o)QHT52$DwrM*Zuz^P1|JGU} zKI2aCIUfBK4W`^r`ieEv?lTNJl%&E*cDJ)$>Ui+{K`5|XVlrl_U>|*3Rj&DJK3G+p z9$o$kij0-Y`VeR%VI3$C3Y1DLdntVScmO3ajsaL_;`re!Xsl{m3?uQ>ASl<}tw_kG z^7ty7gJxe#_Dvh0Ph2o`gs?CLphCZE`=v$lO&G^QdFo- zY{y9*hEh?vXEW|$i)$}k)Vt4Vec$PbsYWtPSsx9lSe3Ppm-}pbrb`DbU9i5Z!kui0 z1U06I-_77gFKe?H*>DBlY>$M`>cL2i2k=DEzkLJE6I~Sn?WQs_|Eip}($77q%6*=rLU4krr55BVhnCGY@wn@VjX>zRHc8*EZ{FP7Ja9_3(tK`RaWRR--B z_UFT&j7WzoQ#Z=OJ(oIsceL5-jv<6YVh21{a0X2K%OlFyEbN|`#Tl#H78BN3xAYBA zl3T7AdbcTwbiyExe{`!IH}Jp+xUrZmd@j8w_Zi zT6l3`%%3FfwMHixIazYT({?m5>V^$jaq+?+Gx7ecRGZX|&O%*8%Wuu$5JCAzHQBQ< z(C8Wlg$@JX1@Jw5euscd@}K)!Z_xDwa?l&wT=ul^WDe}06b<)$ridsz+?CY-u!hk{ zGN&K_tQIc(*JoZ^G%@VAp>C@i_{3M!S>iEyw`YdYj*4}$bIoGwJRsf)z8%#8{!kk{<4IIOs z;ptF)KV66u{$`}_-pukBXc*gOxN(59#O{iyn{**b@IK2-oHBD)5H`{gS;3r>Ztgi{ zi{+K7$dg44n-MrU8@ZdY=2#bMi-8)fF z9o$?7Sr>Ue<)xfWw-qAJ+-x}jsf5)7C$F3SURpIurMQ6%&U^MkWPl-p8zC>V`k&(GI6oy z#ws)E9Sz_VA)NT9usC*|CdPZX;o)|hpuTHCNEy-riM~PObG_o3PSRd~^4;u9f3i6a zDuOHGJvBQR5fM#1-%M^cMa@&fWrE=WC@kl4j^|pI<{HIl7TZ^44%xI)@#x-`|MD}H zvJa(XG1fW2vxUq#_m>JIBCk9)N>hz7!kQOXlm@u$6g_aVP_ZLk$BRd886t<05$t2= zbuhtDQ)(${dqioQ`mnbEExl)of*>l$KeUaKv$hy$KZ9u}c|4 zN5Wwwi4FA-bscbs4>0cK5^D=vhV-<1d_+!rS;{X~|cOwU?T>HYEDHhk+WdFRx^%=BS!{KP{_u zHhDhe-IR2Ov}~pW+`qE$5+07(4q;3-aaKuxwijGwkNH0d>7DrRUP;w1JX|`0~yY3=8%Uoo@O;kV? z#W%GDBY$pG1Cjt)@0;KbdR1g%2*_J9Sx>U&vjJs>GzJr=>TK4zs{!m_nQLJ&sfE4% z8PWqj8=P;o#9=l|Ui-6`0DNJG?$4Qf&fDMvxGk2UcQ=#~nu;?JYWJX?=VheTXq;({ zCjNKA$E5buGVdqp!)www%h0?42f1LoKO!1Qw3TevDyPr3ApUlOod=}*AV{|6)S65W zP|>F%!kmLepv(-H6}&j@0CWq1}7tNf~a>Jxp`!F;Oz z5C)qohK{S2p6<^6HR){Xi1=WAY;+d;-*Osfl%~y~@8Pu*W;ssqnj$N-w{Fq>qiG%6HyKwIbNUSgaBDCTg z-+a!O0PA@Jjy~f{0Ceb;Wd}_CYyig|d)dijGdeeNzgS| z4xeZF{Ly$xS)aCU(MC2xOgLhSIA%gw9t8-w4MAk-9lgl?2% zv^E}uFobP7$20*QmmF7=56WX$ZF+3s*qzrA7uh@-0H z#$-W)j=SRuL%d-Uj}k?vV=ZX(g-P-LWw4xLq5QfZWIwPZr&Pw%mH?z5i_+9QNuMqX z-D>yNnAoLR^Y)|mf1~(2@&V?V@*kkez(+95ymjl?oi9!t5nM%e>@zH(H3*Y%ug1sK zFQdi)x_@xG|RA#u^+8nSc2q$B-6%ou{1BjQcX< z-Tkb$S=x45H(LD66*y?mqT?)G1d%Sxb zgPD=~0~GT(F#-FGVKKK$;>n&oU;I{;vrg@cy{+e>Pv242p-}knIQNQnKPLKjlAl8p z#Ev2hw^cjd#cpG5(ELX+ycc8Qd71pf=H`QX4UadvJ6mjc3WIe?#;MRf+41hZoeQP`n`?}f1li` zebhSYETg}{>uPXvt~3Vx!JZfPF=5-8;Z4^56MoGHi3nf1jxNYD=g4=WyW!72yhGQM zj!KOXhvSRJ?Tm5e(|Yz(!?w6|t0UVmI6~cv5ao*>OBm<3;v-JhuPUk%)Z8w>^CrlZ zb`H!j&qH}!R4C_u9T}BuQqq6etu_~e^vB(e*$IO{d1O1`E-5t_Lo5{*?dJe+K##wB zREqLv`@p+ZG>jeiG kQ2uB-tw+G^9ax);w?6ypCVAnd8s4iMx^spZ>JV zn;S!n1}*)SVu4s@B)+;+vf!88V?!Zt?jEq6)Z>>fN01#yXr+$`SM*1wG}QE);PefU z*#<#rL|!m>nuxdAGWaL235UNQ3bI42`TH@L5ADSBL^4z=&T~n9d!ZRaCF_0JJoQ>%DKS}OH5R`02`vQ`31)rZXo5gDJ0;Lh zrV`L5_6}Vi_-*PyN@05#a5kxBiviIlmfSs_y-(Hn&RsHG25}x+<|?~xlOAMNh6Men4xe7wq-eZj4m&9q0x2nl90+*<%4U{BEeOWzA`qB1ZC_ zyy-C11DlxX-=d65>;~eq>x%(doMm>MtL-HAp+;lKo4qeJ4wLc~iqZM&XAIioFR}0v zL2qL&U*WxmVv7%9{L5(Q(2>k0eyz>6hgoNA7j4AVBIL5D$28imNgHQr>qL`C%2AUb znBFK`!VZxz(_*e-s8Ph#@*^k0WG0+ z)U%eZ=v5Fso_RoOpadnR557Ks9TdbA#N?I=wV9r)7c%bn>Qg7Q4EK_84 zx3<*0l{p9VZyJNBZ~8GpFA8Yb80&%iA2%*O8`AGdj6@^U*d-}tntm$_7I@XGOwJR! zK#<dC!u#GNRE{T zC>ek543Wf+UwSUzfke|9Jp}pA1+m)m;?B>QAp9R_%c>~tCp5Sn{G~#1GfRbV#BjN( z*rE{blAY$+$=R12{95r+NhSYZ8wNoTfy0yQ>@45Iq|?jC@a8#vi44gxLyUwG9zX<| za$JZqxM(#m5&AVlF)y8RPBFE{o%o60PsX~M3`g4kdpW`!jtHU(I8^F5JF|w7kz}KY z<~I;Hi15$RKsXWtOMlH=v|Z9qj|*hMvN(U#`uKXCatN{+Ym46?m_t{r9Tp~2W;Js~ z`U$1fUgO4-q~tXOo&%C!XMQO~)-b3)5-IwtK#QwvoI9F!bSdO!uV~Q`kVWR^RKgt4 z378+1!Ji}wFXfUtv)W8ABRF@tEkgC_JVh;8gT(+Zi=YWS2XL&ezqM{>;|5fUbRG1I z0jigO9yK5YRIT*zAao{n(igxUXdsob{+2I2UCKj@!+B`%F_4Oo<+Q(4w}>^)Bmtq< zVuZ6`p>X-K&jx)9HshS-&&t}Ghq+#^$|=*bkRwr8B#umth`{YeH9&=>We|cLlI@z zb$Rdrm%XxM(Akdp&w=)Zhb+%^Y((E#;4ss~Sv@gS%5(Z*E`DC)=4gHnLGsxt}JHZ5g3Aa+t5~bwHmd#qX?o^6l~gg0+%Kup?+Cvp`0Nt!RPb zBsWOfSF9rA`@1U8Kh?AiJUwiGn0MOTaf__D`K| z7ZX}(7muHKjZeSxS9iV3(Wb+dL*6xFKg3q~rV8yom(PNE97ebqH2|a}q}yz=rH^kB zV?DY$tG3^pBn;j8%UvK!j(;k!@3^af%adyW`qi2`u`1c)30hu-IjUbs$|tu}yR>Wm z^7f{^Vv^A^L@%9kHIP|ym+DG%J|c$XA^4e#O?#)(HH8rtdk|IBs|8oa6H5E}p8Hej z%kbSYl~xSef|#H(vdKTA*y@#Qytxwp-fumHfMhu))r*!7<~qTUJT{{ACf8Mv@N6b z+fX`8Or)7iL2yeWum_IStDOgi%m7Kn1=h+k@8LQATowJdh;H?H2=zXDqm)#+q<;DX z{W_#5ld}F4%px*6Df=0|<2IY{tWPF0HV{wDDyM*DMpa=_c%9md?M0YGM}X*27-R$! zG|CN(klTiHUAy&JjA2aa?6GX*{ov@>dU+sRrgA{bxk-6}nW>gi6=0@xYq<~8lq;NO zA+?iGTLtjlpzuGXi5cXoM8XVPk5k+b42Y3Ru_iF>#0v@yr`g#8cO*e$7y3-x<%7qQ z8n6MjGJdN`fk&FjE#S|aUlSu$T+-0nZCBmzLfIC@BVt2U%R@~6UWs$&W90o$5E-kc zi-hNtX*$N7V)IxVt?Y^@Y3IA-+~aT@pv_#;kWO53xqSibpMi}A5$o5)&EC`TI0&6kWWBj!&rw5Xcv5XJ8Va(@k17Xuhbi&@Jm#<2d_M{5$bchmYpQgQ51$+Is8a?QPuVhV7B^dABvbqP#BLps_U6$ zm5|6q!Ls0lp0MMCP&g@R5I5Lcnf>i7O~28X?$a{+#k$*xxV<-gWL(Z9IH6(!v*@;j zu40Lz&RRVG>>@u}VRIiLu#YjOM%+v1rW>p%;0O0j)zBHa1AAvSj}BCbF;v-q=QG3Q z*9t(m;;1;YaS-UNKu|{>UNJSuNN5Ulu1a0)apgg`t5Zo8AP0&KdF`eMl0+@e(Dg~E zih7e;GZW?jF7f_flGmjpS7PjiVd~aa2zpho1VkU`p&ZTc>Rs&*!k&suD{y0*Q@Dm; zh`Sa5(>e;*QmIyswm-L!?W_g9eQoC+60-tGekT>_pIN7%Q6FWW)m2srpS5j=4%qwr z(75wQ=9f@wvg4Due$@YLvWFq)fZ7cdG%-(cFO7wmlevXC8Y%c5)yqmN6LlZexd0+w zDy%KLJ(&fMD;fgw+LwN-e=bA4`nMOLLh>8_sk4*)#7>s+yUOLXVmF%0FaQO9$qP1& zB??7|J0BYDi&y}|PQ}5|IYBxZ1AJ%zX`5SV@9Eur=9^Twuumvp&z)0@TppR*0CbA1 z#K|_z{Y7ZI4X;+DD+n~J{XNrre}R?#4ZAU6dy=qRn71VUL1L3>*SGUOu{K@acXgGQXAC2WyEyesQ3s_f-t84U9{4GItskc_x z2YddF5yrKR(hb_Ks;@Ca7Mq&D@klxp0Etn~kaka4;s0s1E;y47SW+?@)H=H%YpL^% z@6S{6J}{r!)z1f%ZZf;+5kUc%|Ubh%vS6wRFjK8*I4jyE*j#=TFOQ;wvxz6cNiZphpjvb7X zTO8*Oh1Usm1CJ`&!2{D!3mObc`1z7hyP9E`&F#5n6IjQcQpC}{iC{$PJk;ZY)kW3#p&EPlL=7q1 zQe0z|Cv&kTF6qm_G7uNCRBK8;l(GQMzcQD&Ev&i!ZQ z*SoDa)cV%p4tJh8^q$>zooXtTFUC@=b)3>IoL{R)mdI{`wDY!<=O$W-Mjf?5%~s3>kLF`qq>dBb`sn_Oi^1NZ{`d6WnDtndb>8-bUjfDj%R`a29_>u>S3ZK21))8qPly?3KmMYL8`Rm__ zPRq|AQxyN3_@$Pm@u`+u;U>%Ooom*=`1Usl;rmb{uyrAi2zhp@e8Iq~>RV+&odTvd;Q^}$wf7RQK!%N&_bV>jZv)Op{)tBYq_i!I97US3v)&)a$+E1(_TF8Vn_#1mkD?F0UEw0 z=czZuEiOz`zBqJ-e?THg5^#u;%k%r<35s!8^CFDyx?DKhhUK0|dqLr4l!<}s#TJ27 z_ENN=o%g=I(Gjx62xn;@v@icRiQpm1MkW0a%~XQn3E56X;#u~__IaA0nha|_N1nV$ zh0bjc!8X*Fd2}L-0*&Huu-UsJ4E24mq$Y?za6~|WpgAWUGaO-LqlA`Hy~#T@pj=LQ(YFA_|zz&%2*48nh1qs`_8^(=T@7 z4^|@iMcM~2Q2M}w9;uB~zXd zS>|>BGe&A9?t*GJPn^Qo%=Q%r$eLYkuHUW$hSbwb)6%G|uY?cOb~jCCOt@=d)AC3#rBNPc6-KDTAI?}FNBHrMjs+405zpEa zJOt0|2%!8HLWr03#Gs9KQ-g$@#N)CQ29+>u7D^1ioH&}O?uE&RjsL28D>aQq@(W6S z&;o&Q7-D2^`F7#Qqnv-xNZVCzM>{7CKXz+)kZ}bRR9VJJknluIV?9{>aHlJ#mA>EwG$M zkVRUt2tIAlT2nwP^iK^CX?&Udq8iptFUsVmi9jp;n=vb=htb#`9wLDw&=-R1mL$&A zKEAc!5a#KwC~fhqSlFj5Dd9QRdWQ~FLmZ=e1?5LHBn_=Rw$q_>d#V)HvTei(Skf8;nKL*#p=^gW^ zVO_l#Mga*0@%zZ!U24}}r@$O^FO0RJG~?by-4Z(p=2zH@iwCVjMTUNJp(F?2z3I&+ z-$T^Agqrz6I}wsMoIv~J-VJETyIj3p2-;N>2Wr2QC{5Joc=EmyLyA*fQ}SQ0$8^Gt zuYT87XY0!CVLK+OYzY7Kpu<}SW;m4sgX3qDw^i3Dhr97_W^naj1q;~-lxLaTON68R zfTeAM~K@AVA8oJYy}w`cFZ-(kA5@q5mFrLrKN z2}fM-JxxE%1_^9WjE3>|X0#ltlgZNYC*`@Y@VKs|uKf16HsWu|={N0yyEjf=xwv-y z=qe^}F%eH_E1QARu3M5x9qeGNYq4O}qZ&4x9Zc?PkaK%Zo3@3aB_GN?&HhuwSpr_Y zriVSvu|JOxv$|PiSmcLmm(npCTWb-XQeRRiC7y2I3I8(Sr84gV!oD zeCj8qttOdzeZfq3A<=`|&m8Ow>qBBYfxqIQJGUf8mpjAK4Cfp$XB_+bs76K_-4}`M z!tlH!Gl(j&JTGBsS%N8vJU~2j>%%QZ`@)%GLy=U}#6^aFW9w|JAdp8@M=5=8Q-7MT zm&{aHh0A&au_YPGJ?Ac$#8$TJ!hZQ$TkfYzYvWU~lIgnkcIP)# z2gC$=o9P#43R}n_dfO4@rNirF7ghfqKd@7@&OVkgr`#8l=lc=4t5fM7p-fyMfF&4H zNml5ON*|dXj8`$euv%Vm*j*y^)3BXZ*^Eg^0smU?*;hwkZUNi;Q!yKv{(=!3FruN8 z92*HD_(%$W@75EjNTQs>uK8I3&iNXO;2Degb?nlN1@szwLc!t23x0_{*9FK8f z2C$%uEc8rgzS-=Jovpr25~Klm`VY>zqD<7zDkh?brc6R>0BF+tc_nKe09y0S7mgNL zPBumV&v%~qj`an7+OYF?B{H}78;yOIwT)1#$tv(M7bG*+v3j-LqL6fCbrP#f>pnju z`9EtzU=gtu&u$Q{&=_~l+yH{4j?WZl&1YjHfwC|FL!#hlQx`DPa^u|j@L-k?xcz5m z@#!Yay9y5$5A!qrnn%qk`cxgQrKsA_Ubri4@tNw`Y8;<3w*sF^$CEC?1^JwB4rdZ^!BbVQrI0%nCM^I6BM(SbhU) z5LlBZzuPk|_C*x-H__hI0(3omH}lw&y3zCfx2deT;`h;^{kx+~ zfK^(#rOxuf4%HalJ6uZUWyztC^geiT3t8$N_hk)VDSgShlpg%NJNZ&m?R_)yYi7H) zNFy{i&v{cwdFN(IpaJ2r<$z#;Ky}`|eC;1pNhqlm`lnw!0B}1xVOXy;;3z4G#oV{) z>gzAKG}%mW=8oxz`xA2-3#lb1nnONwM$oPDJ$_{3_LIXsT&!)Xg%NYMpt7Hw+SMza z1BB;Uniy@lQR5$Itp}_mDoNw&INDlmw!`#R9HDkrDX+Pj2h!9T9_9VlBoG}vS&k`Y zIB$g%u?UEle9g`HLlKo^JOCAVMn7J1b*v&WI=|GacqWz{_bkMbPNZG;;=wq3&Q5aiI-q}eTn#dSbnK?PY)#VrW!lk7w9L_RO?8dvJNq6 zsbTeCuQFbi6)qTVD2Fyv&cT6HP>Ajyw)|6XY8>4^s~cp1jS**#{$>HI4^1Wo6U~!o zTVsG#cDFVjRPdjAiDSD0$CS2X^0wv{%E=P$^;Wc;5v}b4k}iVni4ed5Eh`FEskNXx ztce2_o^uzo^`HFgiGRt(1bd>Z2y;GUWHJj~cy~f0gw#kiss(BV6|>Qc_DUj;nbWx+=tlt#*`L|MQe6c=ghINlG$~eEk%p&CG_@W5&3H zX3Q~)%Ai)nP;XKjAK_s;oUurQ81UIr8k9$gF+OgT0rc6r3G7EkHGq+sq{36SWT-i7B32swHqki2kg)JUdvM%_1S59r*-53?ly_UK+3*;C2qkFrT&0bLsc! zZXY|De|xhYYJTdnmH5yeGH$ysr>%m*z#;(^4h4O+2xGK`WLJ(2szLo|s#bymPO?~3 zZ(&6l|F;9GcfGtq@$4^CGcgKm@iLcrqJ=tY^w@UgpClZsf$L2c1o8$mXZ<#^oTB4I zI%jfAf>sm5Ll|yJBL$Y?z!ybT$SG+3cy-KU2TyK8P!PY>Z~^E?VQ}ui(W0}kYB+6^ zm%l=Ao7}B-gM+mjR zZk2qdg;#pwhm>Fh8Kf)0zbY=sf_2UcRvZg0Jd*TX&&4*~!*7i+P@#V3<8|L8gaQ?K z=Jr66cei|tw^g3vnUdatfM9c=x^yUPe*$$ARb%zU#E+L9hQC`p7p&D3T7h zcw?PR)Hlqwk76)^fRC9H#mn1M3G6A1wsAoI;zF=WmVj<*lishkVWKEKe~eEwmi%6 zi_DX?{eG%LRi^K@{YCfpwK#s`A1`O9HokqApCZ>|6J(@G9E*7IN$48sbbx(_lW%Fo zTjY9H`VxTRqFdAeCQU#|N}l%k8&Wt@S9YelkDoqh_{Y~xi^tGmfnlr)y)9aiD-!%? z=rc~x26<-#i^Gc1!Ugp9mUyxJ|6n;hWdlIhsUz7sPOHtYSFuFF{E+dh9WvxmSu1+l z7hJ0s9K{KP!a=iF!;@iE1y)S{`2Gb7J{eOQQ=KdX{xl6!6s-wrbWZ|6q!=%vnxxF0 zw9kVR@<~)WOPoC=P+&V8pQwwh*J|h+?vJu&7Rw$pU)ymvH$Xz4W@!d4J~F||SJj0( zxRF7CbI35|~#EfEP5HL(3LKVhIM%8sJIeF}JKdQ65 zqekc$A`KA1&ky#7#GT#Z(x%=#MGN)+HA+}YDaq^w%0g#V9=TCbNy#Jwkv$WJt1(Qh}hA%4$x z1RU1?e_B09(=|ITwLf9^#v=slGmq=UNn|`;LRLO%V=*n;`p|mib@lx-A8Zi+YB0GM+PUI=f(Bbt6jH%*F!_kf(;{h_No=zBe4ZLMo8gQfF_;;++-neoU`! z*hIcxqL`r&SW4dFj)QND*tilbExK|=(6)!0TQ^4FZ+l075?&WewF>R3zw<`pBCS@PkbNS2oZ>hyRI2GD-`GNn7d8A@|o z3CGg;XW>VpIs6{x&gZcmZ;hFT%JAcX>JQE;GaBv}Vw0%oU70Ml=sQ)O8s{!Fplfrg z1GTDEEYQhb5>$@pd&px#JdZAFD9fGvwutBpB3p7!Qf>sMI60SN?i%)4{)fX~O)JM7 z`w-zv%+~pZ0TM@v#!reRcxT%+`)NK>`n&Ubf_iax9l6<~V2tJT$^9-AFm}KtkZBii zXe|n1kd^MdnjbWqWEmiu5oyNF^YB@#dF01*0#RzFC73+7lxzRQc9QS>*1WAzv24S> z)3_>sk`s!{1L|GiwgvoKQBFT67bQEx*AlAAUUCbR)IY?Yrpq1zm5YaH7K9Avd^xJU z&>FFB$MA@*EJ)<85ehrS!L-6h5}w}D7z`s;x;i+E)K)?zzg_&-&NAr4vPzgosjew{ zdeO1@-TwaQ3ps66)yS!et9N@x7c7|~+yUu_(!IsS)@xFty&tDx14cil%6YD;aWt1$ zP;CyJz*J6itt_cMQ+_c~eot&}3LqrJ#!zVHfLhje#6$0si2g;~C#ATcIqDQfVEn?W zms2(SnMx8QU>*RQn6+t&(`J$njiVwU#Rx%nW%yH+xpU_V=*ky_nvvKxnhC6*(;$n; z0qY;vy%6koe2gV!8wX;vb)uO2FQeX*+C~SanhI6N7pzqlMk0nUdVX!R*P#>S?BoPyex{U0h&lGaV|h zs`LC8nycc+nVhwEkM)7I9=teOwFWY!Om0*d4LSjR5qO^&Lrj#UzKs;TiGD=^id$~N zX&~R0nv+(=t>n8Ar3+d_<>{oJ1?vl1MpihM7$JxjOC5ribu`CXW@ofvq=*hB#8fag zL@?s0?>Yf}5qO^&Lrj#UzKs;Ti9od{WEhffyr-f&7yGX_Oz47v1DS?iDVN1|f0f!& z^Yh)tleYw!ci)WHKF+xddJ6L~M2#DK<#M8wHIn_(ZcsW#zkTb&3rzeV+iA$57< zWy0xEby6UjmI7yslwqJA&SeYpMm|Mqdjlq~w5;Vg%g=&+Zx!R{6q60GR1qS)2to+( z`~~Q&*rgevM)cxxH7l`cQw!J8D;&}CkZu|o3aduP7eFl+rejt6wJlB5^Z+3DoKH|5 zqE1+g4H)5?*(@23&9{i%m~mBqWI|SBv<*=MELH{?i#6%G+#3d`M9m3*KMXD)Ln3_8 z?7{EZ(Tx^BN35`PMW&{l3*3kQ9QWz-?AQt;l3mvt+o^b@ucu>x{jFZlsZ@|tY0T6p`}HkH&DTD;d1^ zd_UdXFoIt^6*&LM6e5MNq}8B>%DhIiB#$!XSW+FywQ~E%`a`?oWhqB#N$k5ln#EZ3 zyMxY+xK;$LoAjsdeEpM3`ZR!(aflkyb$Kx=WB@CmJ8s}LK_ZP$lJw_|G;#jks2Qs^ zL-7sFVr-+LmQ`mz_`IObOsvLd%n7lV!&vOSk06Og|8Hh`OcCQ&102-a5v~ant?*;r z;0Fc!1|;71OeRrI$B9luzou<`Mp*lhUiPaSdTFsp5DjD$AwskQ=rE>44@Aw7_ zhqhef=OW3pi(WV@t+&A7!2nu$2Gd;Fe5xbyb(CGI`NB@!6XywO%!Ck+#fUb8^FCBw%n7HWj;*fM?U=4gmYF+ zga)5&>oTaJHNGB=pMFzI2B|Zca!$n{2Zp|G7giwUSlRC?ogk2biP}*Hi_-S9#5)2UoDN zCE;QQ_lRdSr-rl7k+qZPie!4rrJ;fWZw3LiS#w0sP>xyhT5o^=dqxq9qGCBVjK(w- zr|gEI8XWC^d_-21J%+DDbzbCrVWnX(b?kO!(kObhz@$I4P_h-^je_!vJCU_7%S3au zWgI1}5Lkq0)WV{;=$@(Gnx%xe9Ww&d!j%qZV`eNzR)4SP7SAHk_Y*+uf;qpZ4o>BO z1Vd3FtNokU$>D!Yj({oROUzT>^(3(|R}4Y0{l`Up3;~Y+tsZyj`lkHYrZtm+N-Er6 z!Oa=bLq!H3t9+vlXySUo{aJVA$hz5I75(a|C`(v$#Lf+u>ArxH=rr$*0$#S;ez2Mynp-qGs^WFnC#Wld^5& ze@W3nEUtu|36h#v*KRWKI>s=#p~_%1%4ZTz6PtW&T$(WkAtJvg(3@+ZfL1v?hYfu* z_T#V~l|LYk`sslCla^SlarnMMs1OYsXp&4rGc-Y=WJY6j4 zW-y}8Q50yp(saCBFIaD^R$SVeOV!seXmY`Ka^ysYOZ+J&uq{d<67_T z|MB~P6d;?3;jhosc?PWeS#yQ*3f4o#^5ta3xaL;84ZbUpdA<_xMTA1$EjvM}>r2`z zY8?D;N{y=DW^#vHZrB!+8|p;76rd+c74l2y#EhiJcQwx~6my(hZHC?)rz*l?02fhq zk~pai3Swe^OHm_N0S%RD4()sISRSK?^UpVNhP*bZ*d3a)n7mOZP?LscVXfVv=z(7m$^mIu1utfu1F1 zuYR~-{_zGxzQIjBcq+6gB%T**kl5nDS*{p+iFVEVycKHC`rK%Vir%*&r{O=nagQ!YLdmlLQ^b*%ozc7WtSa`1(%X4?PpkB zL%^kzJ3iO$1#_xYTiU9W?Td?hiz3vX!#(*3l7*2ZsXK*IDU(7jw!Np=FlyPtJ%d@8 z8$Ho@yqIIno<-j!_zqjzqj0bf=H36ShfDh@1jFd6&$zX|4Ji`|lT0ygalKAM*A)oYEOq@Ah}K z1Y)2(2z-y7j|Q!17oz$OKKgO1M1-n!?mShCS{awDTiBAfbbpp*4PjXTEJov8v#fnA z*i9x617n>8H{hcZa|`%x?f`^mdkglgoMnn9wsu~y%rF{NCO5{7yydpQ!1LA#A#W6t zhsF=^$cbFCYO8_7j2s z`ap9HeQKnVtNlI>tcnB_dA27kn9Kgu(TXOvT3}n|_g0`*VaO0HBDp}x806m0dn&ke z`7*-T)_CI*@bfB`YJc(0!iJf{=DD}m)q#%l~OkT=FdgzVT|y%9P2=RpB`Cmd0(Lsyoh9IAu8>hY`B7tt`(Xx z)3Rr{d-gq;2AAP@cy;1GY?PAyRJuriD(GAhQPAV!B(SE8H1bWmVw>amFuh>XCJh7p z8$o~b^8^~J)~nk}O1?1nm*zug5}!U(2ee2Em`-#Jmp@+~&xGx=Wy`$*9x{ZqGZdYr)zeTZ=jpzM5U;4c+rPE&o_QIxc)YjdHe@g%hhoEo?3kdC zBeFmXhDP9PtNi$#C}#46TYi^TT|jcgp3vXK{u0*oWo$!cDlOG`EThuWv-X599!yCm z_1j5;6t)87IWnyrB0I%|T{iK}9Q0OX`4OTXDiN2Okyg|?AtXXxWA@9r;s?&o|B#R| zttwYV9a>I9kk7J-5||mRthIS>!v{wj5%-dM5o1kig~&+TIt||Qcp=MuOVEZ3k2!$M zV`Cr1O=D)&Cc$i{DSez=VSP(nPJoLKi_yd|q>LN(jHYBle}x%|MEa^N>Dk!?wUi+O zEgvUWb!}MJO0xk9&B+SXc``Sd$iXE;oH$8>(>i`$nVEUr3sEYi-SRy~VoT*HpwA*V zG&(*y9S#VMH^j}UWs8;ppXkIp64N#?`$QdN4Pd`_SmT+EO6HCXC`7^+3-bRAu4zF!_1TgG zI}G#vHg)-Kk7Z~7pT}TIUfs6yz1OkcyP>VleNbie{x{9wfU5rIw*b5g-VjpLnM_x) z4gm?d2TP5PyLCBu^-1sxZ!nyoRs3ddfa6%THKoFdX32}ihP|A1ni*(9L7fYU$g@Z) z`6*3ra={IXJj4-uG2%I2rL1js0d(sS9iQxVcDj{H&Qbx7sNp#^gy$NUM^~t1Waxnk zgEYV7@;8#I*DHSHhxGZ4Y3uN9`<^ee*XryU zncL&E4KLa;LIl5KXftmc1YEmjs7EV$2lSIC9a6FS%~3(D2IJ3D@2_VN(F)l@G_7V& z_WY@l0ev#~YDk7__{1lF%(;AS*o0{PTr37v}*ywSTK`h12M58i_n{oR$WIobbH zp&E9hKZ;-Kyow`V=-gg$fH3xCuwvLCTtb^jwPF51Som6+x%-5mejqP%VoG_)n?#m7 z1Xva9)3=Mgz8W3Ab9(O0o$utDzV^RIPO=R4+Bo9j)i&%{(ZdL!$KPL)QE49>iEAsT;QgSfypW!+oPp9 z3UlfbG%r@Zh|>E4NzrT9TGRie7OvT zK)=T7h?b=Q!7mgVa{FW24V_sGwWR%PLjE{(uj_03wNHZ=MMl&X)It5yEvsoPiY1oD`dLJuLA0#-$~Nm*K=rJ+7tM@yEp@ONqFUdD#H)o3T<&)d|79D-4RG8hJ_M z>$b)U57b8w!j@F!^*qxS=mr@8Z50Y+r(Nv!@c31H*v=L0*eo3*9;!teSPURXDk0x==O(wRV%i#wc%rEq3Or~bEhIa{a@)s(RrhMAj&e&y#_ z0`2ZDI*&8K(P^ryqZ47QSwb5J**;u&h zR)S<&32yAPFfRVRngLy6iPqHP9&&x7mWpE=4Uoj7kKioenBZ22@foyL-lK)aS4%Eg z%?pc&8UL8igg77wQPs^8L=m)~+z=#X%z|m#>K3fD$p|GWmxI%`mO_sTVPJd$lgv97 z!7gOmY%l&SL5sSB`7$=ZW$o_L(0Pr574q+8cs6Eo|^!i(fa!9h8 zs7DRuTF2KV01Z;D$C?@gO(U>Gj=K+%DAsjuI2j3O>G;a2QEdInK59l8F$tF0Iq=fD z-Viu=Z#lk46Dz8>-e`i8V)*Z3d|4a?@+M)?1lyfoE)GiP69KA*qk@(ws!#6=4$dT$%Oi#EaNBDi8;dhc-Y`I&b zHOLYdF0v>aLaXtm%&T|dABjHGWDOiOx@l4u$xF8XOiLPyJ6-Z)k*iogCR=iyKExt-sRr}F< zgu(E4?2fIpNFWmWd*;^MbZ_+=NO_V*QV<$HzN3xt?@&19XOqm4xL9YfH~*8Ua#S5u z(A=~s?O_rV)Uy;x>nY^l)!^?R{u;2;z2bqSf89_q*yQBK=R7a52b~CpiZRs)&McQo z7S@s9PNOzuG|@2&#bCNbFv9b>t$?xBj84b)Q|I~H<8KVJz&^Es-vD<7{OYtqEti4a=*Aqj)4rH$Fmi&4Z<(I@c|IREFQft83hSWvPjHOiOk{tb&{4 z6)D~<9?rv>G89t)B|zH0=h7XjP7Kld<-NFNgw%uD794O{)G{p&FQxrx#Vs?11&I40 z-G~{1oee&!RwRuT7*D-ukd4LIZ*RWbdXUoJ9y)R}Jn;7C_J7-%G-X7v|ue%>N>Lzf#oiH!SkJ6e0ap!BY^5VNL+ zZgsb@#J~A!PS~@hXJ+WOOfDi6Q&<1{`xqnO+@*)7n87NJT=5dmW?LInprVFFLWY$&wAJ}m~lR?Ao;hBsOM{Q3^V(y z^kLc6VrX#J{qIbTGG#J)pFKbyNw-P=J@PTU%v@OA1NTa*Jdp8|mktFwT`;cnfSEZ* ztycd)Jt@oXw$uc8YCp5ND}Ru((pJq|WG_c#-YufQ`Xj{|TrT4AxP7!2H7C znZVRM{!yJX%M9NtH~&o)CxbUC2$dSKCQ%taZ20Nvip8ziOM60`o;+wBfriy3536rc z2>RUT>=0Q1n@IDPYwW3%J-GZR-bkIaIp4WGc}dJaEtBF%sl z(g|XQ|L})sVGO~^dJu?9*xC=_RqX7Fa&q=5sMkT4;WVSsfk*$ca}RB?bK$zT#i$n% z^QZ-DJ|};o+ppZw#+N&c3O>hgu!Ze@`a~f`T3%$TfMdjST}^hAUr0)I15P%Fkdh~J z3#4O-l#PL)^+*tINgE_16yGNr^~7^%w9nR4s{5-v9#wVJ2nWRvk?7wBFBWvujjLoo|qxMp(6wY zJ|LgWWf__;u;`Fe=OM*y5nwo(tHTD-#u#dUoPqReHXL4HT3@lsNJW$M9%}KXPn={n zk$`bM=vIR-D$18cDKvP63YejEbQg@_-H{NP+sIWH)F@py|G{N4ku^=kcnrog?cXvu zjraVm;Ks~uFUHG*f2*QCcJ!bn?RM|60{=S^_=TZyxH$j1lS0CHQ zmPi<(Z9?{XEy2RLoKebgP{7QW9#@?XHOl$(R${_~1%>R<4?W|E)~4X^M5} zCVKi968k_ZD?!1`WvQD_acyrRHzl72-{D zn|6GAhWW?|{$i&4N*PdKDq7tmb1udVP4F7AA{Wx0HUFBPW`+qV5J@d@n6OF1xcNC9 zIlPdwDfTHvhNRr29CHAHQJb8?vTWa}WsL$^tV?I^%Is$ePn|v-dc0_Y!`fOUs*y8P zN`_8*d}g(j5f%}RX`$u_4Cfxwfc5^|U}DR<#{3LCc8lRU&pJ~6x5 zznSq>)udHl@ZSUM-ZkHj!3+&iuw?Omi3OlEpiW#nOrwA0v;M0v+Y|D03;7WuHg;7y zX*{nvt615fOUmuZ?$WbcoJVfQ-6~Z06NR%Im3~F89N`e#7=Y8G8?CX0{}|90ph=N{ zoikB2d|+`edz+R6syZdi{^H}2$t#_-n!a2W@pR1qY@ud6{n{Uq0|Nbrc1_@zDfFRK zAo&o7HI<{qBUZAd6z=}`%H6=&Y`=-ry1t=-9krayn!#MljM)%{cQb)ZXBgKcAqX}2 ze5Y0OScWB&%R+-;Fb;*>Bad;z)YZK1@XaAJF3(3veGvlf>8TDfT7$!niiONNp zwC@Z9LQEMeq7;RK+>e6@umE#EMbvEotwbh^%%<@LcUg`d@Qd{2L^Yw^M@;EueySGWrmtTub2Wd~2Hg*ui+CeWIgMM7J% z+tA{}(Pt>czEN5uKK5J1xzrl?}*Xe@Lpo)t9Sd%e2sgpl8_o98tjlnHVAhI@Pel=my?yp4YNn*^4%4;M^dD*~zW^dz0UVS{if+z7 zUXbD}d$qQQg(Z|n#Dk@u5cmA(WyDQ?h?nvoOB!V(=5wgwtOka|ysutA+t zCES+C%E+`*c&@(0$sQZ)5NL3_6bUI6Vl+bJ4K0SX{8vWD{F z`Rx3Wa2>IieJ}7QJzZ5d)&uMR-KbBez}zdFmvPhz;8H(e5daI0-CTOY-%!d-ZINI+ zecLp#VW=wvV-M~HDoY2O$5R%_j_#YZV6;Y%{Ednw(A?{%hM_Xlmtd3LMKcdFLR^v% zA|JcTqd85bCjl9(-l43b0Ij`u5F1w7RFRxbBDNoRB4}#gYXG9H-n~AH)HN+a`d}jK zTZLGwdU79T%V<#kS!1-aZu`bA_149&jJ-(2Lwj6f(U$Zp)W^|wrsK}wna4mo4n{WQku(8ZGy;Qv=e{SOr;rQQiz}8>FF8}RWGvllrP^w z61izPOu^OMiUJp`gK>}|d2tldvh?8z^>l8cq2x4S5TS3DDdym z9dj2~wJJ@UeUD{Sj_orsbS0uyHx=aCZBnf|E-=#akx&#PuTz#Cf0jZ3*z~7xoN-90 zZVdivDrm2VpKx%=W5P^W6Z|%P-_|I~eqY;qF@rircB+eQu*zL32XME%g)!34coNS4+gC&8NcjxJS%TF*u*D9LdK<^ z{J;5^#B4k;P4`(_$cXj4ufo`|!X+?22#LY52^P9Gx1Fy#R;x=KQpA*ZYPn2REOh|Qg!lRlLBik z&yHPq3UmMG)L5o`YjHpz%2asAy&n%|BB!jfmZ$%8wOQSl(c?3x8ZaC+1e)S2_-)$0@xd zo!_)ST0BhOPM|yZAl(xj#fuO)s~~LREsI7$9~{F{yJ|w5!6kWLtmW%49O_YHNAu?Y zr%Fe@=!yWj9&!mPV!2~gQf7q0)BgtHPw?~FNGFstZ6hHj!xR&jm<5A`9_aK)ThD#^tsRM#UtP-tJ?yJ$%gHICW!a` z>$&>%V?eSi96~c0c-%E_QGGxd@mzEju5QCzKh`zO48P~z6R==AexqyK0egHjtr(p! z9C6@D8NH%IOmr(Mu+ALO*N&$#-`uBN$yiOY?ywKga*EV9p>3drl3-&Ea^uh;6ywTy zxENlO;U5EhWJZJuE3@HsEsN9dJOt;O&ciDdHPLk&8jjstGY~YMRy1pFdZ9X6|w? zQYr?B*IN7A{K)L*X;SN)dseFl;r}A@;hGc0Q@pW$NwWO?%aM$>tz~gt$L@7;zMsem zz|Xqa=Y5V9*oDWkWDv*bg2!PtFIGcoUZ(rb@f&R?#lS=VCUr5<7VNwl9%KPbJ}<$h z#GV?R2z!_b^pG$z(Hw5vy|q& z#S{>uJL0I0R~0q=9f93$=J^0cy@q9ixL=XVWr>q*=)3_dpSuNpNaUUiBOPeW2*bj{sM zyjbb5z^Fq1>&VL^eU+WtI4$>UE1v27>D$1ac|OX1L3H`{z;qfUa<5HYG5|PZ0mbw9 zxLvt}uK3g?_rw6VmKPsvOoWt`Yu)}K4A~f`+rqP|m9HC2tzhdD{3Trc)UoTUsy$+jM+J3jDUoiY&B( z1x0J2SW+WgoS?cFEI(sWEg9}COuw3ExtCPVMMl*~UkKQu@eG_b8hqs$M3k?MhyIH$ z836LrfqS#{R3-2*1YYsG07Gl+<9R@@lL(&jJrARyZcurnZK;}|3Quj01W}ArGcyM$ zw=MoUmk=P)=r+vRpu+O=45blCF9<#yu5FjJGOjBqvX!Am)1-THaD%CF!eIjBDeN&m z?IaHl#*f7ck@FDYh?@KeEmc9g8)YzMx(9GD)zp^r4xN6$D_NIhjmMDBip@cY!WtAM zqIdd%E^m1cF4~qwGHWoGj?>6}?d~Rms#ph0$p zeRJUOSb!BC;_OipBl7z4Nz?f=qR>%`MSdGO_M8`XcAYN2|DuL0&a7;eGl9}Jj6EK1 zvBXx+Az*CV6_!DG!ecAwtnBCSIyyTi@iu%k6CsopWQugeUrL`rt=DVEFP&7JSd4>+l(#PlU4Qk?-;KxkWu#L+#a2mb06&CYt6K$D&~ z*U2((utX|sbH~AAoq+|yyJ}y0i3{5%=s14gf6L&FE`}1+C~*|&=n{n2Y)epSNV?yZ zG*G*GZ~oQQ0l4HB27$WG)kI@2r+d4>X#&6OS6hHH>({yIsvGg+S6_-2FKZp6^E}!# zwYkm$lSPn@(bwj{;ppm;_OB)cuYCU?APkXt9-k!BoWKHz_hYB1(rUQoGAaSAJvXGT z@%G1*N*Y5e!&2wtJYYp#M(=U*F_f4kx`lm=$Vi;hgI(=_aFn|qpF&!0V{A;YEELQN zE+2BFrEEMY-rQ#<-89+ps|wU(L2*_&RFbkz7K{wb_!*&TPaJ#+zQ=PQ52U_MY6Z>~ za2xh!I`kpFTJe~iMY0GloHU#gV0P`tD_l!WjfIauGEGD2$R|u#ntt_*L(krgpp(33 zKHpJ=F{N;JS&b2t7JEX`O5M2gH*Bh z7Y-C+4JS^Y$KMlaBKC)>xDM%pB=gW3SU)j8FlGEGI4OLGMT{r--C?}8=Y zAD*H6ZWBx5zN6G$Z2$6gkw7V=995W>EY*s?2)$Bj{Z(Dp>Y6v{OI?dyS{E;};D6QX zr0j=8s1%BBCzIf?()bi(QY)ImlgVY&zHNh$x)OantpH|MyaPc`++(vnbYfZv;x=Fw ze(S9@+L&zGi?_?H3wC?41naZ1iR-(JG@(Shh99(&ea-&ur~F8F0Vld>>H#7MPxIHu zLxW+g+&%zOFE$N60`!M*t@C?3gZS`%2^7N(^&P1-MEK9UFwa|R_0%_V^Ez0AwKuyA z&J0jw%6;HIeBY^DO@gbPdx6UAv!7AV4besFL25NeVlq=srcgB-ISin_lRd{HYsg*J zOd&WZ{_(7eri!P#8Z}KE6D!bYv`j#!8L2e}{H8->u_p%5#y{yT$;Ji3gh_=?N>R|l z8>E$urSQ3E2|N7T>{lKCs*i4Wa4fd)BMNe2$#tp*t=YjISt`7j=2j3}0Z~q8&SiO7 zNb{NfPByhSLD~h0fTBg^OHCBK$91gr>ifz(uf$~i!T*f+FW$4MIWaM=B~BkL6VF155>_`fauRXmKS@zqbZM@mxUR0u8+3WuAcs7b_QEE<&g+{mo_Fv=;O5kXFBF}3=V z2@F6aDX8UYp5E5c_=N6e9NAnd_xq4h-=Y%H12+iJ2{f5rU}Fp;*ssioXPh|-mMiZ& zkH%6KAw4xta_aT|wzF86TX2__?}473DyBE;qK$~M*%X;kID4!O`_8KuVmh$V#an&o z3#V%&@l;)(h;C`fz5pj!#54vhb;sV~WOJYHeH&!eEKsdsF^)PxTd1#CY9THaWbJ^z z;sg@XMNn0*2w2e|RC38zX_=_jJSKk*KPn>VYGn^Ajf`E1)Fv^m448Uvo^I!hrgK}> zzq-*StQkgue1Y%MjeH>J>|>Z0SajSlkI-lWKw42nsS_{hcv^Nv;^IpYPOx#Q&u7#G z{W|_z)3KyfNFy_}quKyzPI14|6 zZ%k<`@v5~=k*fs~s^iPnJLNeh78Rg0VuqaP#A5zNI4CBM?OP6)2}5in2|%hn$be}K z#wxUlI2C;>1E?o_>#J5>{X!^EF|t6DP6?$%_X#2|?@`6;&at;~ytA~d!S=lMLUIny zH2s^OpPR09hcKURJ3Y4M`0dKt@`O$B%!b`Sah^MRNAuK99q^9fq7LICvZ6?m7wtiq zKNaOPLg7<6{`tEKH`Y~{9(Y;9#G}(|d8$8|v27C(Ij7X-!{uglh~rOg5TOffZ99Cc zAs_@x8gkZ?mGI|#y~>I?6P$s4xfzC03uR`fSe|m?UD2OX_(MHXnrfeUlz~Hrl(ho#|^-m zDzt}J%cazyWtYt4t?u&~&b=<+(S=T(8k4Tq>NF|*Je$Tj+ZvK+@CJaE@UltY zc{oWejgL1~Fu_V^jw1so`#U=dWS_IE-z&O4O8CbdCmvYVOmP}vEArSsbs(q|ry+L} z`K7k6dI!Mu&ICQw6^r_QARx#$HDq?H-{*$ysYT8cUu*7yR1;?LWzb=9ClMU$Y-Fj8s zM9-Cw1<;^NYO` zO{_S44#8TF6-2c~h6oZ|MsfRxO4y~~+)fHohaCaf&Zl(|e~9D6gAd02?jh;tXN!>; z4T~h9LBsS6wU^_=GyP6|SWig?T29#yn?zf991kCMQk!z+`0p%^$PVl`zL3r+eaBoB32vEc(R@_i#|>;25JT}@ZWG0C~aI|}s0s5{X@7e%Mg z{h?q}{iY?q= zc>Gen)g!is-L>cA6Uzqm?ESJ~SDZCF3kWV`ds=#@rSCIXl|C$RjQO}mss>CfG8CKt z!m53#)dk$4C%o-~pIuZkNfM1RiBq>J70d75o8}16glknj z@y~HV@%n41hOID(8>YQ(v$x~OS^<>dY)na(p#-m{*7w6@YVJ};H^=5md&piU=SExI zN&$;#LWE7fn6^k=JU5F)jD{a&_A(}n=^C}v%nO_R>I^Q&cU?0j%(-^$<4XaXNH6`} z{pm(A5y!}($(J{$QPx|ZVs)b0%=h-^5Ezzs!PaW142;^L2YM4Xp_^i7P?KRU9dUa% zA!6p^^#a?>=De%&%TJi=HZ{+udRC@nTGdF!90_vdZUG-KD=noi6(A_zBayr%Y&Aqn zqw^!7WO0dpnrk$V9$wMNp<{0*CT0FrO!yh`=QZPvSTG(-t5sq=_p{ppEdkkkE0J2#I zmCKfQjQQ!Z&5RF&$2(SU-c?s0pcLBGBSH~(k36A z>!`Yx1jy|`tdbZlcZm8O6G)fVZxY9|>Eh%VwAGTuM^c#3vJN==LyxuzP8T-lKHr{A zF|N4vYyG3MAgMXtMt6+$t*zTr*wWa(R4d;`wJUH|e`pVc4F-UV_X!15ag;81!?I?t z)}t$Jy`)n0QFiMsu%P8FW&7yc;UcePaY)*KqVJ@{PjA>I-N; z_%t8Tb-)sj_Kx7ccKT$IiudnfhHXFkL9RXhWvh)6uQv=@LaLu}tQ0W*EEc2$g@sle zaO5STu3RqN>>A<`ISQ9Pyu2f9eyDH~f0qM~!VbcNfWr_?9)T|$5vI?FDQP%UOjY() z+%WB&!1!ZdUF+2Ko34Uyrq-Xuah~17^ATn;5>Cz_8m@ zaJCtoWM@aRB=n)Jk`oTvJe9$sX-R7qaf0!#bdO2RHYJbPM)p0)K~kB+d7l7@$qfZn zGcrPc9yzglDrh;+sQT~S)v1S3XHy<#suUkYa&uPwCqekUkDB&*D z>-I{`%&Hpr9S;lM+nuRwz$Ql_jzinr@qBfQ(nU#+i{H=p;Sgv;91IqByF@b1Kk}ou z(>}}WCo5Si80RvHFM)`@&R$_70?ZxZ{0rZ0)3Q|55~@=QCLSoq zB1Z?F`c8y~D}p$hQhnBkR6Kq}BAA1~2ntc<4YaeXdG;VYnR;0G(6#~YO*-*mNHghI zC=%ovT*)B?E$QPwmIhX53~YExJnIbUgM?Vip2pI_fzY_2QZ-!K;-A}H2H$I+OXGn}&h`^arC?K)!g&PdE6GBowTi~4AKJ@3^PsH*_ zJs1Zwj+Lh*fC{3%?cnIcpi@CE)|*GH^*)O|Z&P+w8!*Y%IS6s^nHvM9C@mhhrP zRbKN_Fyi4!;KHPMmah|^pIys%b2ct4L_uur$FAkzM;amHM>t|3t4Y8Q>AN(Qkk@B8KPae%+wx8wuE%~rU zFsZngvIBwcwu~w27hb=|1Z?woZ~C5SLDOAehUk-~L_4{0ODLF;)&G?~AX zzqK*bpm<1o%wA`HE}`2yD3_Ef&m0RDas7kp6r^n19ZhxT!i_COPIvxk0zOOXpuvdv z&h6()HV0#r2P=J#Y!m0@X?+WRXTVCMKV<6MrbS|b>J}+bWpgUDWF8l72%Cx1Ue=-U z>GM-6n+l8nNbsQ?sWF=b!nahA>TMxFt^0No*ar!=rFd62t>OK>;up174CR0f^d}L6 ze~5O(XSsF6vLW!F;WLG+fpxRbv^_brVi*tu&*u6_e5is}Dt$Q)VelgPXH zMIy8`BAAi!5gfM(N%CGgi3)W3O9`p`mjmyeZAJFgc}s-Xf52zk@4H|n(!Y=3u@v7t z590tLl-%Lw(&ARJHcu513DJpG3yn|csYKBKXE@46-dDbJAb_p>_PqHb(7Dt8f&$g6 z1#(_oUp<%~47&d*R$SIahV2&)VE5$m5>u+rc+;7PfDyag$Dhcdzn2j8@f0LOM+nvh zGa>rSTErqcQ!^J5zb8ECZe%GcaNFc)9yPfL~I<(;gv&XVa8Mw!uC1ei%Ip}!knx4#ITRM zk2?qhr&dpGtAl5S#~ym0Hrs4H@(o|?X3-6#5+83Td+N_FC&Nu|p0p)7)Dayc2U5UW zJTFoxl(b$JGXUa88Pe?32$>UBz-!YhlJzQ5Zd<0GQ51J?L?X!MM~k`z_!u*r-K+-H@$M{2?l)?EJI zIW*f3T^*k`($SFhefS;0t-aq0T{aU%2wpN)u;G8sglWLwST*9{b}waa9W5n3x$Feq zY$#v?&f3D5B{Itim0|BveM3hGnv0xh0vJb8yHV2nKuYM#*|bi{Le7-%!)9be6j10B z*suZe0m?oABH@7mTvb8Jz}O=VW2A2I71sIRBm?AsOUU)Y^Ob=VyG~3`N{jF8Hcr0d z%~M1j*;=nfMRbEXx_V=v)BM1^CNwP1fSsyncfm@*dGZosUT4E7qp0fe@Y@xONwQKD zg*he0%XO>ucAjVhamW0uTQ}78F+;q~(E}RB+w6 zr?B)m*ocvrI>&sl2Ee+qj47F8rYSlF5i+pKbm*-VV8ZfqIWPVdVsz;}`Il)65v?D+% zB1e^~p61R1oA6)NaKvI1br&ZL%xUmc|M;Dw4NOsxXg#qv+megNxjn(Y;^)y6B{5dF zW+H>+#4D}7Qd&w=`w>bz9uSofEP$+bWH@I$p(#huT`W7{{v5jD12_-~X;gA9Z}H{l zKsk-o>-*oT^-C{Rb>q-YZRgB)za|q?{ir>^_XS@3E01wV5$f+g$b~3-&I4}>X@35S z;O$Z}pDPURqJ#>MSt;Mv^?+9K^v~gZwEyG^ zd_UKJC7-K2)dw;QbLyJ%@lwZ>P@}fj!;3aSO!yzRRA{qfs*uSSF22y?ydA`iwjruw z>dHx$$v2kq|DR^t7@K`+Q;6~Zcv*p1C{7Zqc`6A#Y!&(@X7()PJfzrBBYWhMbO_@2 zS_dNVf}hqi$L&Firz%6QU&p_(H`_wNM$N*qLZ}Vv4ELfv|M|X4)@M@F9hT464lf43 zQ^5+-xMp)pwf>2% ztf3IFuq+YGBghFN>0UKfbJ4S!*1_iaQmghR@&u6<(Fn%;;=$sz>YJj!L_`3dyYv3Z zl|6hz8BUUYsF#U(2cMjby&mepE4cYXb932Zr0a6op&99<%8pnYUMRXj4&{^3x3<48NYLF@UD{JOOQ5&IMg5u`1Q`0 zdk%vb-%yycK|Mxaw5XAZpTUntO}vJjg1xb?IxQYiDVJkg(uDqqi!?*}vunxm0#1Qa zmfuii)W3$-?Nl@sp}*E@E8&o?F;tEDkx)^F*^)>mE`Z0%^v&h>GMzhZe-mSrcHI4b z6_12W574#Bu(gOxnCc-ROV6S*_@I;CT+)ZI{*~U{&eW6Ol;L3P;-Kldj^vzwdF zTi!@%Tw0--sH`iat*a(BeE4KV4fdOqDjEb5oCT;u?UThzJuPC%yztB=eA#Ex$px@6 z)4LdVX4UkMUV?;F?xD~5SEK(e0w|fX$35Kg^W0dZ;@;R6h12reO69SU?Py~@ubCpI zrxG|SYfz&D#yr!x&t0H_GOBoAT{(Wv`ZjhuEf2zTN_KQ4D6tFat=X)Wy0 zF*9Lh&=XmgqAh1+BnyYVzv(a<1GA>`I;~;MuAynMUyk7ZSp+U}lb!8Em+>{iL4=sp zW`U9Sr9fg3n!6;>W89I>QVryv(h&5TEHz_-Nl0-`375@B6xSaIdiBF+CI#utILPsmz-AZwap!2xaMr?n9#cAoMvyhW=I|k3jueS ztq#{|;@qZ%#3TDB=izICYIF4~Erm877N*QBAWN=?(ep=hQxXvMjNy8!N9YsXU7o;r zQZTzSnoWtFvlGxqw)QpeRK?8>@IieMOC?KJDN_LGtfV`e_Hb%wT%k)NvshQRT4RN( zn5X6CxO&)aPbD5<3%erXy9a29h@2(r{93QE_OfT6FhWR10XCmXHZ|&fNRN#Rpn06< zs3gPQcpzgxp3_raTq=xqC!InSx=cmF;gfcdlcU=DViLb|%vImemI6M^b%=Y+`HId} zb$_u4VR-BhhL5C+$Lv)zv1#TC7@HQI2ZFIQ15P{vvvRocfg5C!VY|6wUvW>q?al7Y zcW>(U5R0odSU9P?`O;M0{w3?%#rr0=@9%4MMQYqy{6U_aBtfnOx2^ofyWKKX11Q^b z>7f`FnVjd&wNE3C8}GM2h+GPv7hjfQ>J@rtCxJU7zR9tVR<{c-#0z4OuFyiiv9vd^ zST<&__AJc6>5R;bVAAC!9ZC2`dh)G%>AXTAZ0&J! zFr~_?$w$;S1@tRZtrZY%e=sXj0C||y?Rv;e0_x!I=T)DBBeK0k>1|~jn6DgWW8@3$ zeWl8or5)(#C`clALRE^UUh6yC#Ph8P8&YC#$>!4*$xIOf1qXmpAco|bA9zU@Xj-O~ zHbU4zj5|>OWibVn7|;omyGt7+_naFIVK|)`9Dg{<)z4Jk?yG6TmBSZ7%(jfE>=3s!v!N3KpEn75T~W!wmDC*dIC56zaqPpCEDpvCoI^)7mY|K!EI&Ez z8{GHIOo70!<%FJqR5wMwM)Fqhw_)h}6K5SUmW(Yv(tH7-8Ll`HQh_Nr0Ii^^TEczE)j%PZ@$p4LAoDb`2OJE6a!FU`v-wm*~ zZ%Y^`0f7+aD; zfc?9n-v&gxwKDNR3(5Hm-UN|qzBvw23lMRejk@9uyf==q-kj8NTc7J>-`_%h23qfr z_v0LLffpVFYeohx#n_R~2nWA)Je=55rB$R4DC=B%C&&o$``h32U+FthN&sK>?6{7u zx^K{^%QpW-t6=x2n!R?V?>|EY{5MnXJxhNC4HT!-KC8p8DXu&YHbx-GPCXlB=wvHV zHVc?l%lVG3(3ID!BK+W}`x3}{DBi;&Cz!E7=O$KCxqg`*dAc!pNxjVLyFYTK0Jj&g zw!>;N=>iblFWMs!_}!{O8txX~@tlC((1`aYb#gT;*ed=8XWS9M6T>8rMBVFIN4zmy z@@-joNUQ0j`&}rMkq0un89en!4C>7YP$<%QJOy#U;u-K6^ze&Pz;NxpIEdo#KM&`I0`x z*g?5Ix9bM zlD@Zn;=V;?E&Z*@eFfFCO4wt8(+Cw+7iB>RqzNeNtTTl_UNJ|M*dk>%7{W!q+jc`; zs4lXhe5Yz)a?Tz7+V9HBU0QF=>32#>W&s9|@UQ}Cw+DM3Yyv~S5(w%vWajySWUJcn z9_SChVx*dV(aaUb5a}lN4TMhTMVOHNOnVcg@04W!Y!*1%eABkRuYOR*O^J0rQ4RVy zD8etKNkuHt^&Nu8u1;)@p$WFw)6zt3ps_(>6~!KCE5a0-e5%aRv^ZPwLdrM+dn3Eq zA-6ZYnQm^ot}|hXymM7m2LET;tN*7!2ol_U2-Uqma)Edv@^|fV1^$z(A5*sc`Ix(t zFe7$K=_4?;GYns!hfaaLsvqKGy3^Nhx?Umxfa;Ni{I6bp zi{3IF`8lI|5L@VE`%aw6ZA(3PafQe%e?|hF-#A}2P9a~T5YM`mG-!`eRw{W%==Z>) zO|EJKEnq5}IzeQyIUBfNLc$bFZoeZ{yJt;9A2ThorBnor#6N zNVWUQVq=?TIELGWRdidifZ&Y(f7!JGU46J)DH9j@CS4hV;WG`2eImgWw5V&zR}M%AV9!-a_8oEi>>doDD{EUyI1sf91Mz!TACh8i{KD6qJ)@RYr!THFc{F%L0rG0Ujzyd+_%2ZkPr*5Mcb@Q_yJTsJhP~o_6j{e^Pj}l3#|`tL@3dJKz%P zHc{zK)w<0v8Mc#tDF=82-lFwKptPN~reWlWwAv_t3P^y7-`-GTA!j2DNi0?6d{>hd z_}VB`%*tCTfu_o3oyD^qfh(Ut^C$~ye-LK!!NDYu?Z-Gr8Fh{PgaO;=j>-o>UC&g^ zTz7fSY`y%G!8oPJq!}kan4EP@{x>qr?f6-vJJ)h%6b37nS_MzhqY{g5Y7^~kT`Clc z=WF(~WvC_lv>C!ZTG#c$8TN5>_A^bL+)Dg$p9?8Jd=2ZjSHpy{wZ|>`Sr3P|3n^kl zp5!OZ3BnXIxV>R#0BO&_yx=)4P)IOiKS1;#rR~+ zWD(Uv;6_O$G~0(kAmKBlAk^Iqfc0w;RA!LgjyUH-`$f``gKJbPA4aARq(s|y^yANAbbYDHWUuTx0AGeh^3scZr-;qI5R&vtEPXdOe z*eg^U5=)SJ4Oi?Hs`0{E8ZVXS!Om%JeSB)g?A$}Lp&!Z~uBTU>&99rD(B?AOrA=6l z2j9@HyJZ+0Tc_l0YtMS*AF1*ek~vuexQx2Q89RX&+QEsGZh#J4N>WuR@0PSjqHlRM zb3suSWvK0vW+A`1lXDbt{dJ(iDYixP(FNtn-+1&jg9LRQH@AVSTbvW=+-Xw>7?=Qs zYWD>4Qg@sPA}YMjCkGifeP+=#KpTF^=8a%5;d|I(81O=I<)K2VFJM7kFao0t?0P*s z44R_w?|7wAjoIlU><+ZSC8FNhkxf|8WkiHX7W7#LD82l)t@7p$6xVYc=or?&(%KUG zPLyCTq)VHw!bvJYtX7kwwlDI9#Zo|3oj0PGjH)o!q2SIe=xH7)r-`iv2L||8Cz5M9 zU)yl$4F_O%csa*yw1JunO_#;!qmFUU7d>nVxoS2=Nv2HDE4yG&8l(Q;GF&X9ftlW(^sC7auom)Z$#vk)`6hz61t}M`bl92w?`z0=Dxk=L@1V$Dzm#>ss@3 z%0c!8zM|p2&BjPGpv&1Y|X!Vem=x(kWyiS0?-* zQ#b$$HEgcA@J0rxNgXD_9UT4$@x61M0xl^eIAv4+y>X{t-;$$qfk^1xO8fb>Gga?a_ zH|!V@+%KDdhZBRZ&=8EH86O_e>$|I`KRiTgr1%wFS4lLZ$EdTYS>c#MQcUiR=ttTo zudYSTa@#T3JNNIT44>>`#B^OIxkCC9C_!wUolfHb%8UeyyEoH+#71rIV)|~`9bSu2 z)20t-BHm#7xV}+p^y2htzwd3^{n3J~1LT4N$DsVia^@>D8^-+7ox2t9x&W2OP>^Jg zj&d>d(XH7FmyUe^%^Bn~f#wm@{lsCInxJSo(hiJvWnC_rMt_Q!CF3FoMP||(0q3g_ zHs0ld3KRM%h-S5zm4sd}{yr>y#3V>lt@O*wZ@z@p8!)TNhZ5#j&BeY~t?h$) z_QE9iDIz$E?uEmK)F|vi4U?#q?NN`1JHdt$lJ&Eb`=5&phT%=<9{^4hJK8OSxBOuk z~jlPU8Mp+;)6?%Ct4RZg1jn3|u}O%eW0f)DH)U_Kq* zXCK7sJBK+>6=lP&VVrrSbZUr@P&4WwsCb1vdvhIPa&ILN%f zCvzP{v>y=APpvCc;ZaRhRGX6>*G*e#*hE)IU7Bj*AigR_w3VjroK%2u=F}>K-sfbE^_tOe(XWSeJ?<*yW^e|_xt63)(&bD1f4fV&h`|BjD&^ z7UTheP86BWM8Q%{$+UxlKS*kCF%YjNBhVUxl|jdfz^VR6yk zG%q`0a}E)+9X6s9GdeI1e?- zr5*t6l(nDS7YneIN&H#P}G`~h4R{x_7FL{q7$rO(9ln1%J?1=is0KC491fqMrhh|05Dtb3Q;0_2Pz(XsT6 z2zudHIjG*iAQV7_2W+<L*pP$I2& zfy8+fxNs24r1YV3`ZDb5sRh&E^uxtm#cOSn z{3f{s{~kA8Z4YC|#q-VxHA)rAa*Df7El$D!d%pvGYWRU;-nDOjN)FZ))1QU+@_MPk z$g~$@s=VA@*Fnb1#@+YQ6vN1;wT{nfc8kLImJx&1;mPTDk6Lf?S~p?mGfY^_Cm+Q& zNsNui!T2{WoCNC=W3tN;R}Sf19!KV(Sd{%qy*mTM3m6_z(CREj9#cr-%O<<%%C zF0w`f!r3-*h`vNNr5kTfjFC36uDlrrZpM5T?)Q&Xe5q{)DcsO*J$;XHd0g0t#fNC2 ztt1{udJ3miT_s(^9;x((n!jCk$&h-V%RO`}Kwi zENl`-|0T}xFVzB1?UI)BmXKZn43*jKxJE3*pWB776^>S>W|(=%S@d3j(><<+zZeTOrZ%rJjR~ zd#AU(N-f`9O2xBmzvgEGm~ZThRoV=q>4q%}_`-?Zunc;;>^nJC`~2(8&GPlmlSpW4 zf(Zp#+MXO8oXk<7p)JpM+=f7&^JT<+2+s-ZcSO2U5N1Xn8lc}R@^IJPDk zR1MXU$*cj^>Fcz~_oWj(O3+_bre&7tHG}BuNERCg|J>zW^WXwluD_M0Jij6q*``&F zP0o>ZSJn@I0k-pE|!;FOZ0Ga$G{ zTS2=T2>$u%qb3Uaq;KnRi^aBUMK??;9WdfcjJMp!tJ(+H2tK5NAEA zPHU6pCvm8$=9e>>H**R5fYo#YNtu&J8M@Wq7m>TW|IRB*Ds8HF)0k!Yc*C)x$w1^z z=Gp`*Fj&-Cw3zddPkE=z^7`11KGFu+eJxvfa(IA-i3Rm$1}+s<@OFn7xpkO?%`Mx@ zrWE2{CZ1GOICPSx?2vp*NpG3Ui5ehGo`tf@7{PI^J}2Q{I$~fQX$#Ei{(rWvCc*4O zEdZnTsmGm=uGo~FvBy4B8}xy#u#sH{#$#-HaVKfi-JunR?=#)!p2`3UjAG?>MeP%h8ODUj7T=A`sg&|YVy&?y! z2#vaLj!Cj6mc#m3;B!8h4O>>CE$7DG7Uogg-cucWaSx9@8x*qwo6dgv%%;Vep+U6*|c=G+S>T2o~EP@eC@81c#u$);oy7gt060rT)Ifa*&fA zN14pTkDWlvowp-Y4^@ELsK7TMrbxx&X>>X1&rEGI?7%MRGAr@xey!m}vRECKxk0?i zdYG(BB(OwDA~Nw#(BY2;c~1pet?Fe+A?S92M3uposScl7@mBlBVK&|Xtoif9w!(us zJgqH~-j@(r;5wD~UJ)3c5{DahWDA>;|Ij{|@HZ|^aYU2YbeWF3*C{9SzF={AI(4 zYi7O3A}-bhF>s<^W=lK|177ND8bI;^qcmz&cakDVHeq4TM`>ez4jIqWuLNlO(FI!( zW0mZDYi+D+@tw)S78}ONkA1^~=@E!q(u|{fW;+nLpMY-JVln)(XxU}_-+Z!~Ue_qC zy6euFgA)`NNR@VFNj)HU8MEEo9 zaHa`gcT}xp6TOaNR%&MZ#iuixL3juU(>L-cdK29s&a1oIRaC_jNH<00;WsXzFQi%E z3#G7}9n}(XXFT}#r@|mj6ib6x=M7roDDg?sVWKS$w+w3b!ql6==i=~h|r5`-#?IxEKwQaM)hI1K`WOr z9hlJgroYSUj!{%eUmuLMd#nGVGObXF=gG_M7plIxM5Ssc+Ff}_;-7-5MGlYF8=E*q z7`)t3!S37-8|-J;3pH}aS_K*L$`F)yeE8-Y}-qDt`S))_zgVY)Fo;%Mqo0gK^bBqWR`=I7yL z)$7fPn2mM|FVqd~J8w>w6>nLQ0+d{k{i1kcA>b|F=ysJ@xXBkp{qb`fr843Ap-d^Ny<#o&Iu}?L$^_K zZxhZoR`4Fb6ZthE>Bo||!^kD#OH6X|gD`uptD_w@pYY>MPu_`MM`v(`L?FH-+i^3j z?a6s!2r>m$pn_1*B#5fdh-<%19+qh?Jg!+SneOGnS;U6LF)%} zGp@dU#paWoFr;2`Z;0oZ&RD4-jf~rc(+fQk(PKUk_h8Y zs6(BqgBKAx+KZi^vYb(SA>X_)^lq=~gtM=ybFPqg#Qww7huxDAmIBGZ%9<9(uA2A6 z)cXri4}&>Tj>;khtbCY>Op8>qvZ=U0yvLuX@A^&MEa=~m+%qz>qEAO-PLKHnPHR^7 zKr*=4XRs&hoecZi39Zc=(yJJ|0^+XGPz;EI3(u%*k&M85CPM!LI+!!+SXm{9WutqC zV~a?C*SaAx0yl=Fm1~UEiV5*6n$nqQZWsgO-~`X1g+tUoMB9RBc>c6j+yta&PcX zj|8f+L>ozRy~2G4N`kut5apQlEp0;`qY3QS_G+cR-}@g;zo@@6uEsMp7b6O<6x2q$ zf5saerb2`HjFs(av5Oj=qXl4+K5_&E40^s&Zrl4RD@mqxM51_g5iu@ z@Yj+kG*|0Q0r~#M-$7L6^1IVS3fK@BdZi;Lb?AEYJxz1Us8by3yG~NNE|1@R3y&#G zRfKS%%K&y<|5#{<*dyY352QUB*y5b0T6&^{dIV@Bh z_Ff%;=1J`gYgaOO5!XRH?l4D*VLI{Rb)28Rh zzf#VAJ+R8XHASv_I8AtTfu?vl0*URO=oDNva(lmoBSjNI?*4MSavxQ=X#B^ca{LV0 zMVtFL-|H7R0pHl|S;CDQvVVYZP?jI~L<63HAhq``sOp;jq@hu@?Meju6Q6M>cvJdr zWc@MCod~%b;%?FR#eES@u*m-~!20nL{B?f+vNMm? z4-RF_6(exuLFx$3H$oCD)1GR@T?8WKO&h+_W_VeRX$rVgyHLgEpRb~9R6d;@Z_Yn# zy4QDLr|Cihl&fn#T&AhQXCO1Twh%*3h+|`tsDL)pIqZK`>cn9+-V&J|v z(AG-b?oe3Mi;UZmPER;4yx^U%`qk<{kKs?M|G&uQFS$^w6(cp5(hF#DOy>go_rIod z79B10BH|^s|1D>ZNiG>YMn3>kH?w;g$OafPnLU+MR8X4!HH6>KDNZ!6R`m3x-k^o? zIv~>Vie9h}ROT~1EHumZ+gIBA_QH$N(4P%pm~ni$PzeF>WapX2OI*<)#8{R0`f?u2 zC5rZU(8Xv4`h_qxNDVgFT*v@GJ6Ccq>=Y`$r0xH7z$AHn^ndOo%d&F>x3GZ_`Fh|X z@rHX~rPm6@1S)Zd!{$~JwQU6LMi0;bkJhYRz)=ssHEKFRnP{8Khq6!EC4^K8?(EMQ zbzp6ElJB67AsGMAe&+HcateF>=u4HL7bKZJ+UHS+&GmbuHhxwxn^mCd*+LVgABW%7 zw;$#)xwk-58^LG&SZ{KY;AR+!4Nj=z=3_MfHCJou)(w{%+6cO3d^q zu@E(@EIhIRbEB{kr`#J`{ZJ@-0aQo?BvV4D=3Eh_aPaK5CUC^n`K&h-yYEBAGgmVb zDRss#n<>{iIVtv}5w&$ViBRROa-0T7N!u9WahR@5+zjy&9|C~kohEFvrRJ_D5PWn< zy1|aKsBq2=QdI|+#GrEUL|JDihl)H7?WJE6Rt((lRFt#JTRWz{WyYwugnw{Tf#W~SI5uR zVlO@T`x?(6!8!O`PJx^%hL7O>HZ}38k45s({zHCChT}3#YC`}qPHTb0mB|aX{<%EV zF2D@dxbGn>m2L$&87L+z#)Jf-ei0jxqTcu`nX8{UHD#mDMC+o5=|4&wzQ@im5;ww0 z($IT$!Mb@Vx!pwZgA|R~L9PAc;=BQTlvE(>9fD)R>4KLerofsTV5>gG;~5kmY9z%Y z+M<@2NiDgqGTk>CaYedT4JTG@CX~Cv(0c2VBp$=S=coU%oDXO~8)kZT_-CO4wK~eC zs&SOJaA~WSBURI6Gl2y8*gmwhmv51BFZ}5|E$Pd7L0V6v8nnF5E{N2!n?>J9ppYFM zDK$Ev=nZ^hOJI>IiwH2fb!dhqLT{k16c+>QwZltoMhE1pR-iieQDi0dB%EhyH428Z zjf@$3{UX*zThP*589v4U{5;+z&B>6G0UAiCqjCNH7#H~a zqL@9SjT&4w%DU3ucE@w8caQ~z7&|5v+Ro=(&ZG|ysjy9eh*|lv^hTQXEe^*Es?9;s zEb9O^iTwe>AKCB4FH zz^TvDN9rb!Lo$E}k4w1rzW43VjvNmhR4RE37c?134*2(kd+On6lOXWTq=$q806Otf z-92+T8t_-J>VOsvL2ift%+fLyaYcboRiw{pG1z(f7!M54= zO*{)C@g>Os4e~O#5)>6p;$j%Z>uZZKBawaS&suV)8b`NL2NQyP@1F`kB>=o8ntaA! zZU{vRjX%#3QZksCN{dvWs{*7^|ugd+_!idB`r%wE$%Ar3^W zE>A#kgd`DgRMwVzs|{SKu4&!FkCg6iUilU=O}i4(7!2fz?s?pea+Om0<*NhXl37twayCTzX|Mn@4P z%w$Sc4uqI<1b<0%!-2*x4%k$s(}s}FQx&&1!jX{C7C z5AgA+>s)_SRp))FL%caFkXc3BnlsqCXNRXp-x@9(Vqly&`nZ$(Pr7wQW;#)cp)KJ% z?dmm%kWcbFd~Yrn2HA9v&{m@qj}_zE(cSwt#{Yn5t*#Ld!Bbe}ROvdezck!GLum6R zPCvmLf&AAJe=cdYbz6&-IcP``l0FDbDJG@6*nDAGb7|cRDK~b@p0xP9UnAb~<4KJs zVZYnRw`kIwfgAsFj=1-2kcK1Im))owtXmb9V}(Gj^c-x{umO4)))&o@BL^)qIlyfj z0f_@9v@JMn!67}2)apc5XMBbvwKoY07-BD-H^uSc5_4;MPo=p!>CYBAS?!SV=0VN5 zkrAGvuOBY?Lw1B9DgpC34)}*be+5@U$!6a@-3`8H`EBXM`cNeDr>nFl;NGpwtL~&h zN6;*{!nj}t?VT5qu0Ydfg77Q#dmE7a>ME4rK&GPmRqh_06)F+D14C628e3Q=5_9?x zh{{P|Fr^Crl1s~Is*ovEOxKkPU|HBTJOf%hU89M>pOT&S2teQ%#OcI?f^f19yh9k7 zLpLvD__~9%XGCjMI^^|Kd}r~^8XoowjT9y zH^zX?aWGj)i`KX>BM0w<_o_pjlYFw!B~k}mkUyEW(}LQgpD@)PSGN>IEn^dCNA&_q zX6VbOAQw0SOv`sRG5c+_NIq$r&t2oGpg(TeAjW*k)Y8Hmjpr0ffABoiu@0Fc`(FA9 zwKQUND}XP5vr4qEdy)`(YRncfqi#fE&KT*zpUMw^QbCy%VepVgxJc?Y;XTIj54#Wk z-;1*ap_rft*a^ddl6a7=fp-|a@D6xobcIs1hMo!A2VC9A7VPof31;?fyfIMf}ep+Am~1SPA0J`fLiL4octoR7TFa?2->w%$A^LSTzVC)1I>?LgX{jXBi-btpj}dX`GClrNlOs(*rt+M8wM zD%!k++tRUjH>XxYa(aVemC-CuDN)!wP?YH~i-6t~*=FDPMf9Xdl=oNj?$$@`E?6Ex z)v;Lr)p(;I?@+jpX0?@Owh$ir9jEv=_;s#ivbL-gEf}HaFipKpBU2U>w@ZiHaDh4U zBycW#^Xg*;Mgm5a|2R8qa=Cx!kVj4rFyjj>B03>6IM!+di5qp0jW~LwTepktH+&Cn zJ;h>}J~WWum&T_9#kNcX?}8Q2{Bn$FGJM#;NK{JeZaXOo2E0`%!iMYn9dl4x=eGCs zmH*WKSB)--lu)(W&4t47r-$Dc+Z_co$c>Y0kd=sRg-E5!H)X|@eZ8@TavX7*vs!J@ z9ILJnb?BOr_tpWfJB{xK(0}XM8_gJByqtHSZ4%0>w^n?)#`J&eZ;MaIASfQSGsIsA zmgCG53ke8`ka2kx&4Edmu&RE(AeifcW1Dh@lszS~J9jl`>_M?-BuP#Yp;1Kytbem_ z;YP)I?ezIObHnby|Ke!bhRx6&f4xwB@=t$N>P#*I-eOhKacU`lh+4no+xZj=NIjjI z|G!{6EL5=J^Gz2nHc!q$)iBLVfS{1t6)%~LAQ%^G(9_XNQGXF$kJe3Lw)&Cu{BX+e zcS(BmC@+h13n{pcXCk@)*yuRFpF|GcVU=&rDPO2k@Q-H}#shY6@>@hp9ZGSdmGkUsI4l;plL#Q>8g!JqEOkt_W3#mn1!&+LsVMjDU@oNnx37-u9@O0miF_`VvWRiq2^bnFX;S3*LRV zKTs&UeZWqnX;*@r)Wh&}N8f>@GjUzw0B{es8%HFsG}C@-<~A7phrY_N=jHd#55Xs{NbZ>7KNF+wLOPSaevBiVsV=aP952WPN6lP7&mUH?u$2#8j6 zUqm!aj+Qcow`PD7h*^=XYzByqq=2=hV3{^!DNLW?<}*GxHL^+JsdIpe?cw~3Go*M4QBTE z6*JYgyi9YI8o4noV#d5*XSQ(Nt)anJo71l3p!ND8(c*jjI$KtqzUBkaXXduNR8@o7 zg@{j|^9}8pxM-|4BW>N-qA29_R6i=Ny3igWhET^cIs(2ezXSXs|M%3ccnu4^ z66`B-p&D%M^#{jnK-~{+>;b;0#ne$0Quym3x7R;g&Nha+iTD=V^FYqvT^~^H?bZRx zV59Tacj!`sw*EK>enmrAs*6&qNc5SVZ|`qxrnQmdsf3?zGAr$z5gMPxo?@v*boU64 zG$5t>$@nr*o~VS4Lq4swwZi4w9Uk>A`2T|=l866Sa@?_*Lt;W^=QNto4KR(pd)C6n zHyS=8956m_nsCk8!Z?&kWLbqLz-J{`gf2+R^|KXTbnb~h`|Jy@zwt)cHSTa`vh^P? zFM<@&zsgN)7{lEBpV@nhJ8D!5aQZxVJ(c*W13h=2F%TEkyOIGv8Iz&y%dlU% zKj`wmGvHLa-znjd^_HnpFhKcx{8aKZvEG~a1Tv~fACoG;mw2&0M)q8pm~YdbgYZho zSs2bq?;1sQQYKntneEA`_HAWhbwAI8Tj-|lQv)pe>Wwh~zUT~!ISIcz!Z~;+Uo+vA zXlmfPQF0OoTf2Bo6z^cBhC;4Z$u@M+jGK>5YzVQX?gjn+t;`)RU$tRDPATHK%AART zWj^r)INcAjR8<*ApDRo1>r>)i$kiRQ+~r--NH@$7>A=Efv)aB$!d+O>YYDAaxn|=B z5YxLq5E+UH2%*8CFUJ9m(&k6q)7(?WjMQQ>437h*@Hn3T?F0dWKZXE1uIttKb`Ex$ zVMx!07v*m>*AN80h$$+~qb09Ls&xum@SUO30k<++kA+bt zZ0YhJ)#kw0OUH7iElrHwR)n22+$ zbVoH+t&!dt1!KCUA_0wX{wll#JTd-mc)Lbh1Wv=;6`-BvXP)0uAnL;~ydgfik{A;$ z%e&0EuQPaoM@Sdjq<6xm1pr@!iAYYFv9lE0TXO45^~6Nia({`Vs_zz68s;R!i|W;7 z7^KV7ZRx+U4fG<&3!k9`yk27PdGSh>kX;ck4RblkA1_Ut&8~041GQTRZoe7g88LcCBvZ{Lx4PzbP z85&7@I~DLs#3#D|2=tr&b#hw~PDq`2kOWs~rMaDCx^e_*1p*lhy>T3=MD6DF5E8Wj zul|)+B^yHK`I$3Q*B?uLabi zC=^St-QMS0Y8%FE8#iDI2@X`Gc%U~J-<51se3teHIov)@o6l~j$KWN0s}l!| zSIA)Z`L3t$UGVdk;C!N{S5Cxm3>4Yx1&wch^~rqIuFx0CAq3fa{+ec2qrSq*E80`q zbHB#X@=r>wlmG>3sJ)5 z-OQ>~#Q3GVDYRV=roE-UVmz|DXQxtOo>&$M$H*$d9ni?H!N-0L9i|u2QX5(6x|RUC zBA-N|Do2B;%0~cu0zOO0In|s1aOL=UK3%#3*{Nmh8SIyl$Gy2OfHRQIyQSoNRA||L zeQ@C@J``}X@fvndM6qj_eIF;}8FZisD2`M$bwkZ?N_y6nDZg8$djkUef6pnxZYP$9 zdBW#lu#w7UDisopBP^o*^Q4P{Nsq3*)!laDOmS#h$v1vwOK+TW$(RHbfxhETy?e_* zD#7+QPTp*=PF92e(INP;yUIhR3BoYml2Gpb;u$I8TeoExf{HsJtr;QymLMZmLG;O3 zjk{;s+X1VC2oz6g2H-XzX|uY#czX8v!PmC$8H+MPwUuH*h1^wWIjiep^gB9cybrC-@ebRP z7s?RJ+ahO%iI*(eWvn+fmzPSvz@Bnv*=j!;TQ}{N5LZ)8=I17Tfw&(_CTvI2N7R}O zXAid!)|ct_+<58C6vL1+(yWcTq^twhT~;V}NU-aKh|WFDnGcn7;=#Z|;}-=#1weg6 zcI%MNc+>5+^oE{qzLU1iPRMZ!-8cd z-fQ6uw(9{0U)CD|9JcKMKDf!gU`h4!@(i z^G17M^6m@Y;L=OsO&cue+Sg9djf2K(vhEk}V8f-p{lfAd|AS_=*EH2;KtDlreLL`y z>)#{(V7NK;av^%=`pC6iF-POqK^>{yE#E#&cb+nH`EHRyv<-y5q5;GM0NTBpQ&7C_ zaM2fFN|IVI_@|C+Y9Hcmdz7%Ow3`jX$;~=%TQx8zyO8MY0lsua)dbwDqWh}bueYNXnIg#xWl;$b5pP( zG`ty}NA6&*o94+BGhLN~IFg*ocL>iJpIhvU_pD|YSm}B@oo3s1KJk~bJ`dr?eRyGd6>k+!QDXH^)f&Fd zRIbr1x?fuPzOx4X9xxRS>-hQ$E115kwdz}+2fMBs(!jWjbGu}A4r-IezLAUR!7q$< z1>{4p&)UA8h(=s@Q*H@(&se-#QkU+CPJbbeCJ(8c-_!?Xa!in1;tyxwaV>7D*a5Dx1$4gHE8l>YQ0IC zNg*7nI*~#r=a(Itr-sMl-|eF156+JUXUPvkj%KA4Q%>Cb$pWZY`2##H*cOe7GnJ<8 zETb}YymDI!xIe*6bf8)Cq7RnD3;w=0{BAoEvZ(2Jyg2O@r;9Ik|2e}^H3ZZHaTpX? zfZ|a7Zf8+E#4iiaWC9+9$$_wjAWWgu%xV0GeA>%f9@Xo@K8PaUkuTMQ=1jm0EMr#* zdjvACJ&`YlkTDH|8#+di>S3^TWkcF*y1YL+c%4ley+zih94oGymAsfh!X)1;G_wjT zlRA!=pgJIYgwUflC+20nC|3^jQLKRM)Ew4vlF*t0 z{d#@@-D+qgc;h3x&6WgnYvcTeWC@&U_?JXV@;6j%N^P+HiCJ6ymm zuNFHEfGL>^U7ZvoB)s`LFny99@K@9S$+sk=W1JikgI+o5?nKFljvQq7RCVOTfUNqC zBt^$Xbx>CC)(v5s#Ty=ja=n*` zrJ(Cuu-ojT@FK~QVOwTUOe6zq>jv*_0PQ`L1gNP_`nTuw*~4bjH<=Zr2F+Lx zW(VZxqUW6Ha=q9%rBit*3476Fk-Ck5;i_>E4-9p}AK2;I2jV@hx_MjNYW2%{*@6n2 z7&kpXox@!0_Z-Cwam_xFspiBm6YlT56#mR)bjvUgRn#sGN|=NOywAtVMN{5_t0qmA z=5$B8-S3&Eju#}zhx`nMMvo(n)>V56U|2;bmpZ53K1ME>3?<79ksATnbqxI9y)< zh?f8@Tnu>_JQ+kqfSMRP6^Wtl{(_8^Q{b!#{yvhC8tze7qkVB|#Ay6$UL`l5-}A5= zY)ZtsE~5p8^`#)Vf5b=pW-M)QUz`8Y?g$=Y6~=9n`DIUkJ!6gchu6_`&P3^yX?QA$ zIo*7nat`r09P+@F(MuF^hi`WaAH7SEkNkR_p=fLF{mBAC8dkNrLf1i#7v#H_(l9||ZC4u3CTuX!XRLb3IXyeaj+OtOoIrG|?km>rhJuG_GuN)8kMESk<`vN=w3r`2M zk^E1)#XV0WfGCE z;!EtEhDX=CFI@$nwhLBkc7@^s|H|Cl>^!tijy4;uEIb8?Ct;!5fkl0-s{ZSMR)XTr zh#duW`ARzMU}b_=@iyn*f|$t6aki-A$dfp&HDELm-MTd8r`BMX!7*m`Xen#HUF&3; z4n4bxcaJi1^7cyIhl*DUg}D2ji44*XoQw639+>*HYgBh1JLpvZzXQE{A3>bZ5pNZz z>ISV@iy8~*N3`Inzpd7OvOal=0_=GODQ{qS8XPQZ2mTra27b_s%SqHxpd)A6x?W`$ z^fba0SW+4ey(s&aY?GF55o}7r%XkoRy>Ia07hFzFGwCRApQbh0k;N4AB=P}OGo*e- zPsRQCxDU{7lGy=6t;sOwpJsXjK4Pih&?e92-S{ zi80?;pN=|A2eWbCY8_)j`C4aSFo4vlJ8s!w%k5RH%HQ)PG$AHRs3 zvLAitiaOhRUJM#CA{ZAPu~UI&+*~ma4dOvqUi>pwr6;!hIOKNDL4d6|0GIXY41{Hf zJ@5st<#x-Y{RBQ>4^-!=b%TLB^N8Ij?-EdO7X2%4_k1{ZU5YCA?WNJ?ee#40@*T1Rl95rKEJKU zY!J&%voYP&8w@!{0LO4I3>XudOX0n?p9Q{v5p1BdI$U6I0uI(CcnsQN>N_$OOJ3Y~ z!*z++H;(dHM99_*E^!IhH8Gu|+u$fHyspY00(Mjn;#!dkpu!Twspj*PTV`v=(9Fp- zvheb-YJiX@uFZbldsS5o@>6LK2ylr+P>)oh6!@p>?hiM2#49Isipnu7$ArqsS`pD> z{1IXqN@uY>KQe%E3%n1D6BpPp*uHXkDRkHVJ|eTTapwJlJ(GjT^G1r#D8lW=h9@gO zpH}fM2DOhoNt+wwH_ZPj5!;pDLVeOy1J1Nu`E)lCajGsBZt-^z(S86!YM~RQX6G{$ z&QMqeQoxHInLITQsHTjLPG1Wu%>`Rb)#rNlkw@0eBq+~Em|U%ATm=DVPH12Gnc7gI zCgs#T7f&&pAR{uT*jW-0YX3mz>nvjOk7SR3Xw_{2M7r9h#k`!_s*}PftCGir5T(k> z+(IW!x3%Ocz;rnpor&~wR-LVL{ZfT{O_*;R{!o*STD3$B-pf-%4rX{3I0m;b{ksk$ zJn+)Y(%@8yIev>>jfMXM3t#F@BAk9_(gc_zBBm~}q24`Y!$5TBxtX8B26HW(rie=- z8V3407!kfr#3WQLCSLuBc$>=xgbmiMbrf z;m4cu3}%Kmq{eSJ=+^Z)?9;+Yx6PBwn~E?C*+O<3KTKraxs?dkw&e-B>p!>_HpiqY zS=#H(mlCRmJ7*W~H7i1Ig&DX6ne00X!&q) zih5~{3uhh+LwQbOigsU%(lpsYkd=5&fV$17evuqfhUnr7!1;QW@iSNx=IkNpg!JZM zkNh~FN#s#S7C0K-00W_ocn^n$RptmR^+{_d9?iBn*4IC?>e7qOy~!wp9U^*VV;mNl zfSpdB4dvxRQeZaTB|9)jpl)$kK1?kSc~HWvtP3_RJ`{srXZ=Xo#dn{;=2ly%E(bmU zKmWcYh^t+RdU1pq@=v+$mfdP0CLM+|s28Frxs~ElGYE!(3td6tF4u`QBEc z`@yER#{NCx&D0PtW>(@(qY4Dakh6ZZOM}}BeeRtMq8K}=->GWiO8|Zd+~yFO^B5EH z3kjpPAsWE)5Kn0f0*kF_>n~Sk)WupaH~}#ADQHU#vf~swtwMDCkI67pexXy_@yz(x z+CidA%SjQ&HEV}tkuQz%sCbS+4~kCWnjN4~euS2AAWSwxhQe3VmSMGaV@!|>+b-hNr86}6N@SzzPRS0 zXV5-zfNpns1SsS~^Zf5V!=Mh@sK^7;1HmqXTZoa^9m>O?rHE}-*Tl30%fp&FcG<(G zq>A87yGYyJ$)3qIF!Hhx+Vg-0P4U_o z;9{qD+q&GBc-0q<+U>l9M8wdb32ZosdghkH`$EUg$)3qIF!Hhx+Vg-0P4U`U@Rr<6 zZY`?vy8(mI9o}k(GL}L4+V(PygDl4!BZIK~7}i3fL&8!TucL_R#&{c9JEY_>lw0xZ z9wiDYOTQ;k-Ck@~*J%!KP74pn)IK0OHrj%^fFu8S+^SzMBpomsuuVyY9N>NnvAGe~ zc4|jKdB!j)J|_FPX%+Wsq76o}L@H^>R8&Fbx=>RnGq)T<2$kl)D6FO`@d>6(5e$W> z@Q|ad!1Ek~t_tk)S>wh?;djy2!)1x0Hk9J zqdvVEE>TS8PZ>Gg$vP^-;`Zya?(|g77BWi=xo-_n0nvJQnTRNo)zsTt4z6e*#RL{E z&+RLx_P+ByHfy}kn$8gbU#Vn;khCr2d}P!wy4YC+HgJ^JAET2>Yoz)5{&-80KLNR{ zArBxr48Jzv|D%s1Z__XR*i%sK#eN9ea$txoj4%Jd2z>sH-85uYfwV=32PK{gs`_{v!9khpm*D|42qif&S-z)l1*`__dIvD{^t7cyra|4>%fl~P4V&}a4#7l!+3po>&fLp^?u{ro+*OW#ES}ENjE&WaZr~WC#PT2bqNeDwgsf!k${6 zx-k@ECY&W;L6!hZ4}O3e{;p;={s#h86C8D5Rhj$VK={qnln@qqP;pROoPiqmC~b zR+HyrjSl?LJ>r7Y_7l>lxI;tJ>b4&2 zARWh#)@xHDlT%LLgIwA9%A#+DH4a{gdCvD=jy|yc2IVCWF6H;-FFx9&)bUJUVp3tS zzqhcsbQSEeT{ECBop*X>jygi=mrIKExW9EeUU+ZQ;4fYuXxJMTk3(hT;pC`E8RXW@GsM>bH1lzDrd4FRPH$Db>cBVk_uydX zyDS&PvA9`Q3YbnCUO)~)T>y_ZbLyWS4vza8;|9IqHuZnG07qys$6`579GXXi{<%lA zrf@$CL4S}1G4NsrCRE?WrN_eL$zv5$|25$^jFzT*b7B$fsarn<4Kozn zpUbaKJlP_WwF#yc0U83CMrn>HV-$@R8Bt<={$LvJu^^UaO`koV;RPaoAWB@IN&SDx zLs{&-Ly#~`6Rp{{?S9*~ZQHhO+qP}nwr$(CJ>P8q^=#(GT~<_76rvUxnJ3Tl3^u>L zzS2EOqebw*`mx12AkF^6ZwXr)@%$kJdhyO}emt|VcNLYUqAUhy#E|=MZZI^)O)5Ay z&a|tgT73{S>Ue%O9xSXE$2Yh&-N8vO`!N@2R3*SR(o`IDqAVt09}ea!UcA3I=Y9WM?VtI4e+;gBg?^NGu2AjuwZxKu2L0qlY{BI9vp z!wIsYp7*VdW*FB`JLfYMa^CPYS`hr;23e#@^hEFtCxw=0KWlg0svQ7?O8eCaT9^`33FDxNlGXx9jyi|s#F&E$ojO7bb!jT)i94?~womSg@t6rKgsVTS z%#iN&K4fKwe4wG`JnUiNlXch8^jC8WH|6A$6jc{x1Isn-5(&Shsx@}QEMwo2C%Krr z)WnWibV0Z-4BBCURAN|Cwi*%nMzGd98w3dF{1AJ$8r_Hqh7b)be-X=Z;n9ry1`R~Q z_IK}epVcOCHlVF;etU1Mt%03=?1=yc{jQrnd^9v-=INJ+-*8bE$Z=V4iy&F^2)-{nyrFn z>fTNTD>xil!moCebN;#N;2dv<6D_XaE@O)&Rnc{VJ~!Iwhw5q_HpG2@kG9^QLhoXQ zyzp>86OV1Af^oHpx356^n@9MA;ZZJ&Fi{{zL+K;=z7=qj!`ws@p;+?%X8-1nV4b3oV89=U!lu! z6@X<&;mzYe_(IswF z%xK3RqS%1Dq$WtcO|yPoxlzDh5gA#(<_`@j8S>=rEh16p> z_wD|0*%g3k5hUg^=|jI>UZ$b72#)Ug3I6vs{&48Wlr>fzGn-o*HZA2iJ=NT@XJsU- zJL(vNO!6mUB@3dYe<)M#9sa?|i2$OdwonIn+=lG&G~Z}6N29uiWe7>n zkwpUeG;#+a=Et(JTI*fp=glXcq@NV2Ca!>mfAK6Mxm>S$(_FU_Puyoy!sJxEh5y&d%8ZzW2{BP|2WmKVdVd3la<*7k;oZNRXLiDVbi3=^Tm2eirf|vp(x#ejZ3x-r%qT*R)VQ+<*mXfk+quuB@U-u;A)j z0BmqpNL@_GqaVP&<-$Y=W;I10JABFMH#a}EvuYrR<9>>udD@AozE!>(!lYmP&icl* z{)6U}(-TGI9rC$|Khm1I?j|);Am)34Y?4xPNQ^4LK%LYgGiWqKiPq4x9y6~f%Tgp? zDWSqvLee2hv0v2dN`j_MqE7G_RFl|Z;~>f3r4`iBHZZTAP_`T%$|2)%ktg;J z#p5dIK)>lB*0=ZbSx%4s*TQx7*Gzl4#HJD&M|G$pl)N!#ziR*_EFsBYF=~Ei+bl#} zx{Q2n%>H1r?$L#zkK_>Gz7%jEl0q3G8tY`k_^fcBG~LT5g7SZ`0B-`$!pqeVdg2Y+ zJ-4C?k7UZ1jzh0)=D(?lPhAaJjZ^yQiP&y*kgP#Gni1L0$NpYB%}*TiP?lQoquIM_ z1P?f(mEP-?juBe~iUMm&=JV;4NR53`>9<;`&uhmV?=?2c!(rg~tV=?0&+(6}3FCFh z&Cd9_wy3D?sr-EO9qh@2oAeV2d7MX1wLu7W2@i>!=KCB*{B z4NBibTx#POP~u2V$f#yEdbl|S=jR5-P8=|3C!cfM=*PBwXgJ=} z|AO8Ks2jZ;sJqN?pUrC_ji&c^e*%Ia?A#wFjSp-Md7y6eyt=#rm$X?E%k<(`)cJLC zV-Ej^r40D|sOaWR8Ua|m(|%1HTLU`@;bN-Dl0=Wnhat!=jw?Yo3Ky9@U`zD4_MYjp z;lAoB;;J7Oq3R(ASn-1liplRdQ0|ITWBkVPT0_ z84{GMlAe!N`@Pb5qo;$FJsncpGALqWpHMs@j-*OsCBQ!F_+h_?;9uuNBeb*)At~m0xBqN-p5qS9$Bl3`_8aL3u3yRlP-Z5Of48 zBbGpfmZo~TW#_q5>6^J+_79J;=1}sEr?QTdCrtwHCoGl)h1n zSa+O{b#wR>Bs7m}iMS=;SP%<}u&G{B4=NVYIFITlsGic*I%M?QB*C!(C0N?E?$=_N zmo&ESyGPsq^i4P@;-sEjHOuTmz?6KE)$>!7){{@!Re8yXh4&2B$f^ zGI29<^~(r8Y4)~)I30kKtu?E|1S`*8iSm=f8I=+LM#YIFvX%uj zG~G3=3bjt|E0}s`hmMWPinb&PB0<~-Th5DSKJ#~w+M8&v)SDuucVzQ`u~0et7etr= z{^*%{)ebgKN!T_y3r_VAAdLEYy+Z-Vfn3qy+R62$fcU*sqh@Ww{G;}5d}f6uVe^vH zXMo$B{Ahc4n1M7Mxq&S`vHR6{Fm7}9etu1AqRJ()M#);9VV?qqUyU`|gF<%IXwp$t z?JLsg9%)|Iea73*Nzy@spHpoG3|-Rlrfdlql5?%PJk@uEloDxF2b8?7697%c<~k-q zJ*Lgm;hxCj^xJ|mMXjOVikki5zdk1C%6+7(D&VV$pBI-P*FxjO4k#8Ilu#~@BI9Ac z+$S&W0UZdS3m7&j=BeU9R)f~u2vvuD88nD0yzkDG$=iyW%WIn= z=p{r1=MnNUupw7X2(FOs57A&~p1|SMuPB%U4;Uw^buCl_8eZcZlYi$lLs5P d>R z6vT))A;5htU{BbXhy(Fyf>j3p&U1c(WKlWFmsw_4lhG z&K^&RNYBW3!*M7?!CR{`da%cBeWz^q6=MZ(XE-;W7_jI4j!2y{HV6FesS6a6s+ z{sfk6O7%lIBKmvLv)NYkkCB*o0x>)UlnHFI=_tzaVQ=~sdC6_(gw$ga(iA76zo~FH z9^bsy4ELPj6n_ly1fS5Fi z&}auzgZO!h^K_xM$kxz@tVF6{+Zjx&MjmP-8<64W;T8>5wI)Cb_@S-4W1{SVDJoq4 zK(8T(J=a3bH3qIf|0qGL!pZ$d6Htr@%KV);? zgUY$zK*TF?e}p*}3qEv2ou$-f8FlILAz!5ezTaEdP(g%w*f^$z@M2S#*x0@YiWz~- zp(D9}5Fmd?zWACj*_jFsKZyD|jtGBw^$L^0H5V@*r6DThKZd4aB6o#m1h&XtW~+~Q z63C`Zltua$IK!gt4<|@D!Mq>G12HlHzGmi{`8MTma+0~&Uqhnj+3`RamAze-^;Z}* zM>$@E4JxJ+z+&mR-6QH|8d~Jkc_zp7^E^G+lgA2L1dFq=AcNIcMIx$mt)m=u=grZ{ zG4F>v^gh>&!>BosrTC@u0K*^8bi~y5EyGb$e`>S*o)Cp;5;IntFN zSQs&{OyNo1AJ}vW&*lanFcCg|h^X=LOK=0T*~*riBETtzsX`Ym0{jAV8j>KNf1?_K zmWapO`!?3Jy0$C0zfZ=;xvnA=3(L8U7n)5sm?EOTGavHf$@ZrSg7W{Ryx;RQ*l>P> z5y}jt1eLrhVr96L%m($>q~?40=*2a5)d#Qaxb+aQ3Ovn6+`x(lrn=QvAt0s74xzxj zmX%1R_bNRHXudUxL8d$~`ABOl-*cbGdqY{LW?cY%f0(z!#H?D~u`$917!B|Nrrf5w z)Ymyx(ZK)%+gbm4$h5o{+@zOl12gpJQ5Ah%@{=)lU30hGsAn56UWj+quNLE5n6kMk zp5WS@)D*#Iz*7cB&j-^d!Mz^pN=rNRTb+O}C7W_zxT`53@T>?O`)Dt`P~!KH`Eoo4 zk>bFv${jMl;!L@_T=Xx}m%`4gz6~Mxs>wnGm&|mDO)J3keb9%+36D{31&sE{C}EA< z4@O^3(8Y`ZDz!obWqgDn4HarP{FG^}!FV65MRzARbCTga3=%u0&5?`Ug>ypuT7_u( zmCuSf$>Z1gG|oYM&Kd8^aw@xY0i3#%j?~*zH?`C%U%nnkncewMfp%Z^zPa>NbpcHc#1Gx{MpY@nI1nBGv=D&=9yxQzQuSsAlLu$jT!otrYiy}LB8 zn&?1KJtFTa+s;U>%>_hc$feeZ$DDJb9Eb+(jnHyG@pQ5=%Kz&W_((xb+hChT7wc_4 zD<7DhN^?wkNI3GNj}$44Aa3m=SLbl-glC-Iquu-nhLEItyIvrXTEpL%P^Mqmm{v+OUX;-8(_^e48jdaiXIv%X?h8%t>@kgm7PSEA* z9Wo0RjI^G=cuE0{Lct$V85$158p;D1fCPa|yZ%4s@NBDSMOaFJTRJxuSs-!fS-s5| zW;{KULQd8BaG5;Him-%Dv&50^Ak(J+$C}(if3;jo?o8_>V`T9Q=?;?itbfGQW2sPY zDRwd}n#0^B&vubp|J=>he{&;?J_+R`vn5a>t@_Qc2Z8hZq3@ZpI69cxLiCehuPZ@Qz(!P>wICK+SGZ9EhLnzlro68 ze~@4J*5thOVzb=Kp9DdW_Ht0=n}ST~0)_WJiz5~!<>HA(MXoSsriMTuJas=m6(>HA zxVAtujsAhYwLb-vG0zjGNWdXU(D-B1a|DhSUqI=LnWw1~nv0MWdjj40W0trL8?$E- z)Im;{UyA6dwAE@cElbxU6)@?eUNsM`E&xFXDR@(O#7&lwT7OAJwHBoHMfyMvx;h5C z9pF)w+6AF$`cLlUS;dxj4*$P|p;EzCuE`Lk4X4gsOkP&BTGW`Ws7^0`fZ~JDfD`$} za=JYiMej0c^ejw0Wq?eC(b)P^lXdycBxzs;B0kLlPn_|(0&_!ZwU`4)eI2ZP z-#NSbFR+8d-gWDopW;IBq0xUTX!v?jWQ6!9v{XgZ8tpdr$5%jM2-#_i5p|1G4WMXm zX762lbE-_W9(_u{YSo=(_I{%*4>`o101GwHH@HtD*2T^UsTE*j+9{-aA4H)foo*Inp~f7AYHLF+hDh|HTk*n)GAQEwD$-q zjHR>3Plz2vC4D^KhL5+*EbuhEIdG?nJ*&wr1d+nsIdard5}-WBcRi4wqQfq1@ZoNU zE(E}az44=poMg2&UAN@Yap7q4nOLkTdPE71>E_*GIL#}SV4Yq*A@~OOYr2LH*AZ&g z1YO_kj{yqU)!}KrE(~?Y-XH?(+(g&fB7&RiT8|Z=kviHlgvn#svkAV}7QHa3xT9A3 zlS~)DE%rPoBjVpB;lWT%UkAvlNqf7m0g#RO8s91kD=m-ptr>LaV4j&E;*=LRY0Ut( zN&6?b1QOeS`vk`sP|2eCFz8V|B>29p03_pn<8P93-(|bH!TH`Ek*c> zmV`P;(hzd7HViGyGGk7g&<9RYjy0ABj13nUq=ZhDSF_cEVW9@On%eRi&6`~CScQbx zotgSA@2C{$`ApcT2KiGI_1c?NR3k4>HZpH&*R4sH;?PiEmF<@bahy%0tky1x&*u}` zd9SfgfUP{$mpp-Lvcio1PJN|y<;i4O4L4gS56dT%6WAyXy9 z9jHkY`cE~-`saLJk5Y6jfo=7JboY5=6fjp5Ai=fv6SxsPyOPilEzp#ukph3g!fG@C zY|@!mcmMhefIz-quihh4+*AqL@w_byN6m#;%u!W?Zb^{{PPTWBD4M&t14&ap!EUp_ zV)H)@AC3>sY$KP8%Lt49$E~Wv#lF5=W>mA>a9FynN(Z^}_nNP`9@8`5=FAjr)+ieE z4dF3^`92bq;ARCwM-f2Uh+U$+N(j6{4(e`!e7EF79iN!9$dt#u6fYhdwt1mr+e|{~ zi}r8xUDrE2UoTexYFy|O4aE3)kcPVDhQJ&ssruBj_xdpi2FplLB!Hem(^3tt3}x9( zCwp^pM1rYj&z}T|HcX1Vv*kbBw@l?)jzzm5$q#TPGNE~*!D0WcAri)Btjd&jcFBZ< zOseU{|K~&))E*P>>(6pol7Z)J?VP>OPCnkXLb7Bf_ZW9;3D?Kmb5J+ZM6g3z@kRyq z{I;%NA-~e4qur5?MduxBFX1lw$BBcOM92c^F=aAdKWkn`^)L;X9eo}!;>ERd8n+@8 zHF1&xU1@=k=HU6aTV7gO@wvl_^!tSiX(24lt@Woff)SFWqR|7=(Xg+&L7Eb?oBoc- ztsRV6F3IRfx*nfAJ==x)s&kDUrZu2`J(F9oVE z1SYq$G?TWF$fs*Sm@34@Ll=>-86Up^xE+I666{*$MX+_VQw*lh7SUxpnOVBt0*i{8 z@D!1M_CHfMfri-cq6oXXy;`zr_o_VaGyGCG6k5cl-mg0a5~BW}`K{%0xTl@h*vcsz z>YJ;*0EK}6onLeDpVo_Q^)wx$8oNJXKDWv%_l9Mvh(=RPovh10cC>CvhYckM+rHK$ zKozT0)U(-dS6+OBYkI%D2}G8^`8&nc);#^vi0CPelPB`#GM~doo++Gzsui12AOc~Q zbkZeR>hUxG~x5ADy^8b;uHZ0>g=O;^!)pYcO zM6_gEe7Islg{mh#O@i#!g!Ddd7qCc z8zw2}7aY&dQqqF13I?)v>zhUAeN_+JW4%Xs%kRGE{-dX|qc$qPX`L)=B=0~D;RIOq zLLHfHxv|Jdp5p?aBnylf`@%jFuFJ(f=yX5*Y>k?QZb2ww+}9EEcD!H#4~-O{LyFt+ zSLB-eA+10SPlH1wfL%=<9LAc0zJAC3b@$Cr;z!(^TGo6!2akFXow~LkyjN z-Zz@HZ6Roa?l<&{C=~h0H5O2ti4psdky+ox${G@0UX*3eo{QukM?s@iqICL=>v4M& zGG$e|WmB88W%}^`P%5CP&+OIrR8P!(9zQj~U*hZXpTBqnAl%IT{Z`;DFfal03sLNFGSi1=Q+qyVV@XqjE~AaWl$gE~ve~=6 z^$)`Wl<|eZ&P8jqJK$*>zbxBo8lVv;%xID3sTYp4OTmif;m~g>6eAr|^g=(aCuF~S z=c`CX85$vBbDQmKxdB&kRWG?0Dcg4)8N%JE^@)}PY=sm-x@#F72(c!<%{a~i$8$gG z8-4624ajg<7i<`KHI{>KfX2H>mcF?!9;tQ6-4{1yiA7fBX>T>6<(uws$vRMnI6U6Y5WE?$F}D&Im_7sm&eg(6hRyIVmW51vbO=hGZqC(bFV8rfB>A>})hDK^KN=_! zg6G4iT7U0(A`04sZDa4S+e>;H?GQ|g7fTql2u(pdTWcV$+>`Qz7Bg|NGHiaY5 z8yB6u4B|bDqV_v^jktt76&BmUX@E2_t!8A05NEz$aKA~g2e7i`c@;{pp#oIt$YF8*!h(xA^3z9^RtcD#xDd*jK6_P+=fpucW*dcgEY#)XL}S(!rNl-&T+|JWtI^@ zFs|UINt`js7bGm~Es9>KWrb*E2d5QR-9j0-n3Uz-ZF);ij8011RIws2T17;k%R`i~ zyLuD^^f1x7AH4c#26d~ZdGr+zek>R$Q=cEC2?0fp zHo|bMu6lU>%D2yMQqnYe1=e8DA$j2MNq;oZR?M!Jz|W<%609X`m6g_Dj1Iqqgh$Jx#lPq zSo$+eH-J3VCHvGP%OOK%Ohxlt7k3i3a8}AFOII_Y>lpkC4&FMxL9$8{l^2}YUN`d& zJNegA`P79uIIK(M=3eRUeGq+C_A6Z+oF9T!$Fr>U<&YxstF{Zw3YQ`O^OT8aZws{F z$B)wikkx&+XmyY!EczIL#I#$x6YaOo{Ij6Mrh|y%pzuwi$tmy(;rj^%gM}=Ke0`a! z&CMtuF*zuO^$&Occ13t1!cmeB$4Mu*J#BR zdhe7m-l@bG5OkAvJa}8!18l9lyh>cKo{76Co`Q+ekb{+oJs5XAw-|L_fef;1VMqWQ z^`TDyBTa{j^L|)nA-iF`fWALfL<$ekK|;%PZPyb{9Y2Vv7V8IcF7}vU4C6SFlS)2A z!L#kDWv{r(_SvNkTqF7Glo7%CX;5c-)zO}jg!YTX`kL}wRZRl4&xcje4MnjJv=in9 z`X_fb$o7@A{e+LS1B&4>`aGs87S*=!7}t8trIxKglUs}=2#A>@FvBg`Bg(76)kEM# z;gv?z+^H!%`|s(ZXt^i-+0Ba8e6aOEZ*1hHYxGx@q8STfq!HwhvEH(>qp3mA8DRt` zQxsdm1^(!$eU8gg8w2+(Lse_Q*$zU`)l6bA^mfdCQw|6wjP<-7kLnSamP~i^*SQHl zG1!sN7cS-Ab|?>5cVaFYiu(E2Q{YG{njv>SRpzbFc8^b?3wgwU=?YDF0?2ZR(2Dno zE-E_~Zv6eBUlCnTEgCS>xJTew?066p17-RQ^vgVJOm^SOEedlqufKR^STI{};sOY7 zDX18=YaV~OZQpUjI`*-|9AMfSr;Kt~zik*+wtuAPtLfH8Q0DBjOkMB9U$uaBs>^x$ zJYif#uz1s=alEwY)~F`VCL*R@$HH1#f`(rsoS9&Iz(G)B3Wuce)xTM>_jkM%5uR14K5T#%)FRy293``e zBOs#AwgWdyTia|Pb2sAm!cHR6WU&t~2{FnFp1x;rmu1dsxMGVH`i}2F#?kEQ=74SA zf?dqLnbE7p2Z?$RMzM#FD$2>)M^Ne+6VwktS{e{qwH)h=w~4$_F5VHjT{hCsNyNi% zD9I!B#Y6<7AUHjnQvR145uFsng`H&J4vPs%CWW1zrR712t$GAA{^-OMUH`H5Ql*Q) z7i@-slR6mtT5e+Sa~+!_q7xT1@K9N|W4MuK_98tvRkBfIyZ{{^(H=ya*312n?bOXg zgSW1)W@QU7^;6kGqN){8r4XtfJ~)(Rop?LQcrCi+lPrE);V8DpPz5A5ZVDZ{iJ#Qx zw?Yq#A=D83OWG~%H6DQMhiYDii%2KH?4YE_~ulF2Qa zXk4u55)ht&_*GxP|`ccksxpQ4vKpmor()EEnr zb8;KZL!I2%sw(X>|1t+Uz(nykxU16DQYK+_t9X*&BIl^F8oK%K4`EalGxzsTZ)t-@ z1A8}i0M<<|TgoGW^?$u7-M@id@Prxk5Fk`!P?;es?F`<`w-frjG)De;rrfp6l(G2E zYo{bnKau)9N8Z*Y;wA_xw;LsPmR{>FQRO;09-cPGVkN<*Jc4|$*1==D^)mpPJQ7~DAB}VY{Q40S(0aRcZuwA zp#C@SoHSuIP4@3!D6)L^T$f*kv(*!YyOk)k|m(bvOC6fr~c3f)9#u1Mb#o|JgEQ&MY`uC^%ornLi9^EfYI;#E}PTL7$dY=nK)SaY`4ZS;wV%Q{Ot5Z zP?3F++K$&3eLMV=8B%(PW!E zAJ_qZb)zHIdvoMHux7fCw^->X6FWT1M}#8iV&N88Wf{D}{AYU{@Nzl8HXhPfvfXfk zxNyJ-9{)++O;wmZ<>ZCk^8V_;B!FzQ{lag?jlD+U=FAGH&w#umB!q%x25yB9G#!RTn9E$h_LPXy01@oTGy~)q zOJ08rgDw3cw>5&}oE0F_lq1QDAv}Y2LKzT|81ZGseW7oG=fW1)K)cNz<0O4bPHTJC z;$|izaX4tp&4Xm{KKJ$ye%2C*1sjZs!p2HL+B+oUI;Rtg;~E zU{=S(q~l_BO{;`He7z!PcrY0Sktn^@!^dOZg{76&&g%c9^~vW+QgJp5 zsP5@KbMOgEIUSe_%P<1fjHf_hrcKx;ci|9 zu${0Y$!K<6@=osz_iNe9brcf|ZMfmQY zmqTW7LBJ4<&JzUoyq7t6nXW|u=mr=*(5p7p3E^&ARK_;t9VQ9?a_K$DoFmSzr?=a< zYT}t}-_st?uXxVFV=Eckvh?h0jtl#NKNIh3VdYgD9{#S06m4EZD7O^CDOJxdJDSLI zRNGg#j^wp7tXklMrlcYs%l(R6;LmMRJE6ry@Dd9MA1~Wy1D(zU>0%zR2^l#s@I`~N zC)YXxTyA`SGk*W@RaNAp+U;oy0$p*f6*$@I#!7Ui9@W zWpSwvx^PyAB}n)uT(Fv!X&fb`gT73kD-lQIuc`leQ_e!?vectRc#zMT9D2|>#5{}5 zyTje5@CggOn(AabIJ|5-?|~f(Vz%r<)#KZT*v3*T->?r(bH}aX^&qMZ?VL#C<+K=k z2Y7K&Ws|KNF^kblj`($m*d6)>%)BU9>sRA=~=ryLRHgI_iT) zFrzF@z-=nsFZniC?B3qBk)(x-5+|tMMT!M-N>5=fP>F0c(!B1KPnjhZU7}1G<=iii z!;Sz5HL0-g!9lTlHEAm6^*xwBL{Pw7#svd_`ZI-o1$w@NT-~b@jMMp66Sv)od6}~% zT%B{`U(x)0Y2NG>Pe&Oy3*k4L{jmdpB$ZuqffrfpL>m3GOK|!#Ud%Ev^{;YLq*2t5 z0<(!Jpo517ubUGqPtn5;&M59lTDjG8yfx25P9sK@?6gL6XpR9IX7FIV_S4bZKb3Lr z%WE=2r_gA9Z@9f~DL4!va$1(`R!_o1HMdug_i8FlBydDP>q_PM)>f!+ptCMCpQc*p zP7c_@(^UbDp)W@ISpkRiUbU?8y#2uvuC7vS*wTzoG_Pwfp(`V0NAp23q^cW^=F4#> z9~Dt>vq+0PWWFM+?Uy6yG=O_FmqZ{>2D5XhULL4QhZe6Is+XEySZvVOEoti8PnES( z9i&X>m*)S@ivJIUWq&Z zGcL&Qv=i#JN^g?4`=>($_GBK2I1HgL2jKbOSTw_$8bTBbGf@ad_y`)X6KMgCRUaij zE-Wb{dY6$b`YMOX;Pn-o2odTmyoB6+#Cb27Nc9InrZkKb zy0~YvURCGBI=&-e+-9U}QsgQvAo(RIjmkgGw8kLs!O%dbu{67_DNZZ6hp@I)22EZO zjT&b_tFXJt*8vZ5ZFjDELcZ4Q?M|U2GzTuweOr)l%Dc%!S{*jn81HJKD5{iW5)~Cn z1#%E5fJZXUxNB1{Boq@rOC@lX`YBHd`Mw|`rASGN*kDm5*-rZ`Wz$oXXcRu=swtZ& z@8HZi%=d&<0J0nJu2Zt{KPsoAJmPR%iMrSxXAXYEcG|6mBlW=Ej1H;~WCPncw@w1T ztxWGLPWYt^(QXV!DjqHgBE6hjLFpmD2GYow_Ppt9V6#lE=U>XWRfI>|+NZtNV1DYF zkmMQYgPU~&4W+z%ns+P?0g2_?YPb#&)P(hg!Y6jXNq0aVtUV1U`eEB>H zuxQ_gukHEpaa5f5i)Y%brp@4?)Q3N@u4-quGpa84kAjW@$*Y@&CyIxBv!bW%u<=?- z#-v;fi;fMeF5JDPwrO(z9`sj2a~PW~lv=`SPi&fz%(rNCxYpXFx}WvhVc`?^N8BdB zpiX;dqYSv%{q#uRYirU1ayTZ{-)98lKOa8fQE6~!@sB!*ckm^bfnU((J6YMoJguf$ zbhh%J5b2nvbFuAq+(VP@f9bxDSu5-<1>-yAC>hYPTgTYRcb>r>8}1_A@<)_*-pPlQ z?J#a_&qbp1V)kxCm@KcQ7GwG~UBqsP2Wkm5q1j9faA2_S8L}C&r_oI)m)mbPtDCSv zO#3>;+=1M}6{DkI(GMCvW$9DmTpJbgtnJP*O26-B(czrYei{BeH8mzSK$>8~X3(UF zSxOL>4(vN!D$vEe(G-1|O?}w{Qdy-$yyewcGs+77SSJ~3zc?BzJ4|GVOu0Q2M&?!j zK;l@~(oMY)SxU=u!FI=5Cbo!P$swi)K<-O|>U-lu)U&A`+SDnP>cKnw$+HK^A@^(m z;95xRM#C%U>4Zv#WVDw$#_B;@V}rHH+dI7E@u>*^$zLB=JT4-u)HKeOxF$XoHmvkYKHwHoH&8NbiZ}y zl2|Dnd#NZh-w?D|>!wc{qNaK@%A|%biWAJ7ogHa8&$e}=9-&;LwkfH2_;rA+0dFkT zETK%^TkpdNk_9poZ0g;+L!wlT{`$T#E8FUP#AW6en?T<50C~8#V7m|ErM;vch1RP< z7yIE2XY?GOrL!~LLAFF7BmMkCxXINSC355(m|)*25C$U!i@(mugL#Q0C2NsCO0?#s z@1n@sEoa${n=%#?tiI*}{w)HUmeN)GkQ{F3&u~AFNvoQ8BJzSHxjD~c%||eIcHoWG z(&BJfanJ_){L{{-+T}F3p09W^$X5czbu8og>`tR$@WB7EXguXanYcuvdTXS~3{xvP zQ+kB9dXG{BnPPriqPP#7p>p!dX(yyJFRGU^dwj0u;q3^Zetc7}?BuR(Y2#XFPS}IJDNqIQLedn%geto*)z`M9#cl7Bk~LkKYCyh{dPKCZO#01@Q@r zxatFy-8I*`B#!1NBCm7mHL!K8L$Xyzqj4|s$KOXW0%(F0M!<{7*%Ji)AH{1_`qz<8 z@dn@^{l1`+o1unHJ($%da{20z^EZo;)!f$;<6Tc&6#|XSoK@h_%G&lHIF{>Nh~vPh zlnYh^1G3^hE0eTmLzT6=0roK=Fzyh9d@e^0+K?^lxPpnEi(>4=2b$Q{2%dD12zqx2 zKi7;JT4V5}5osuNx)dphunK#VLiqa0yVF{ngF*e&|t?hh<5-lohsLIA4 zmIQ{YnMTSxg{0@KZ>fz4o(+0e6cXOTffw^}G*H6MGr_%5(Sm;3d=Jf>KQ}Wl8D`huS77D??^HnM$S=K(IDgdYJ`RsjYxCiJ})oV##WgY zO?SZp3iu~BryfX87xE0J)jT5FG+*0{bEKCCI!j=?t_ni&%rk{{DmPz$ zW9yHzQ5BDz?bJW8Q5vWY5&=wv(&T<0ti>zLMeA6Kf6i$|txg(gU0Hd~hlnWo6)2>2 zs4IqSp`2H@?1hmu-$xsYD=?qMg@g4&0W!t7u+-gCvUw_4nxnD>-UUo`ScK*TKFJAZ z+ar$MoqL~{R8a_Z4!6mH+u&9PW(9v}&a)$HM*DCZ6Q<7U7hQs>fC~7f)UH#FBZ{@r zAa9QBPAQ&}vihT5PUuO{;C?}%F7U31P+q^eP_05kEwZt=^L8FznOae77RuJ&lgKZF znWONnh^TS_=5}FU4b?C)D1BXikx(mD?4O0Ex%g}OWqlX_DF`bL>{i2cpw1C(Ly1r& zyl}JwMoXxvI^-Ii`*ksKc#JXL$>5c(KT6JKJx2nWVK%5a%tvGUUwDSee~ zAiTuQP@j49D+S_c_$Hk;1vt&d9<_jd48Is^g+HT4cOl{K-LvLtHoLQ1odGrOBr=4A zh52$dvpt{;9WJ<;jH@yJfKX?)`3bZ1)>$ngsdsMhuOEXs>NeZlf>I9!latyKA z7v8p%5U}uxe;rnv`18}pL)OaV9ya@~%kW#61rcZ&({r3>RvQpKQ${6-^|gDAj{D`r z$?2?bDTGS_@YkVgtxjbxi6(av#Yu{1bHBqujyCP3ut|)y)7C}pT^ARntqd=)UA1b7 z^-bH^UF!&L@Rajap{jDjQQ0u@N@G3T6y8)?S3(}~uuM<>Yl2;0Cd(=Q_JDTn_p}h# zI$czR)^u?4^mBKy&b|b$B=Ce)$KaKh^BsxjtH}oEkcD4|euMYo723%y*~Pi3$f5s5 zXbtmSg2ji*19JMC&wy~QIRz8RqBB=Q9NKDX9f=|J!zdJmuWd6_SUtB7xbR+P4ZBNV zq5pvZ>Aom;6aB{HV4eX@kq20;#j$`*x{}zCdklryXd++Hp{3%J(ci~~*DH|zb=9jK zgu2A)KF0jrLsB#--2`v>|J#_Z)t&s5M=MPE7b80{pn-5g^49gV`hGm_4{BCW>5Zxq zQa(@YY#>!&3&f)VGeY)%?IQuXpx;`ul%emGek%(a44tskFE#>0UU?r>-CrLA47q-o^Zv zizV}XQvhOS|32tuUl>jU3m-z&A08~FvI#&?<_FXmo?4ZZE+KN zn^@l9qa)#Glc3I{;nr=>2VrdrXdWtpjLM%Br`iR^IaHh$p7?t?s-57mfqe8b4n;~m zZ&F_XS`R}OnumGzkl$|-L2RW0hi=B5X3JAToWT@HgAjp~Px1%EJjTuVP6?B_`3vBrN7U&7OvP!G`)^+nkK(#g1fNMulq2A_SPVfjgD=RT zPa$7w1U47gca?<_)lgVI==}o!kQ=nw(E*+mz~PqKh9Uk54QfX*qtRDWABJH3IV+!L z2Y6aNit-J_x11`CdZROA=>Dxx9MBxJP7`j{j9NR9+}er=os@JptW^d}3>*u-#RLjiq-WQYW zX$-1^iAUVMx3oq-x3PU2f|PqGZ%*ej{mBF!JB|$qn2iVji9fiBu4GGsVZ?Lva$);Q zt;vMCGBO$Lz687mBe#U`y9LR#bbk71nWD{nR5t+@VPl(!$`ZRnfMjV>&l@a|Z08?> z`X%3V%VbU@RpQl^5{t%Pfm4`C2p=?-nfG~x8xE)fhB!ugi}xUm{s86XOZb_-m21i5 zz#-ctf@(D9KCqHq0Q`J!Y2pjtEAL7%5>|HQFp|VG&}=)Ob1L)D96Y5;1W=_KmUu0V zh{wq!nrio?f1|Mv-vF1MwhgUY`Tjrby+f=pJR2>#ZQHhuciXmY+qP}nwr$(CZR>vH ze|B=u@C;Ydq)nRUY5Oe1TwXgO$_E602Q9Fl&tjDBv+BDQ79=>U2-$JQH~o+R`eW_4 zl`)j)d{@4K+X}Kxx*s}P;HSTAItv&u*pg*=(1|TPLnn3Ugf$s|%E108wpdrIr50I% zqc6XX7of%tvq+R<)ES=mS2BKd2oLOpYBmYB3p2W0l^szuztAtjJYi@_5!)tkhSt>{@XRq_uJk3{#>3oygM$#RC>>gxcRaOSt#^CS2o=vOkR`FsOTQ-i zqS};N1K;9bnFEtbM%uzuVtK7Z_7$j=>ehxAr|X<0PAT23z}%%?=8!Yw`kIpL(Cq?rRgM^P9L++*wvNh{y^3u*IK8*T@5#7H;B<15LUPzx#J} zh}z@}bGCszp5vffP>eUM4h)K5@(5YeTp0NPZkI5*kw?67lM^O#1fwxxW3lFgHJIl!D9-|fM6wLDuLqK^{b)YbwihXhzhX!VpcF8zF+U0o^+VKWj+&A&S*w@of8ji>y((_P>LWGum-%2bM^@H6haBlpnJ2wrh# z%F+fTI$<9B*kjN8w*bwyFaG3>l9G(x{oO$u6=~Niyo8 zZ1-?D<2-sZp*Baget4@O-yaegD{Rs8z9$4pL{AI4rIL!ITL|`5s`CSDIGeb@TC2q4 zaU8`pBVJ0{+=GY%+zoD?s=f^}#s&0pWE2qGA;5q0-eix(Qv~(pd~KXt}2q zMTs<`@rGsjjr?WdJzVU$6~@3c!CGs+9KWzO=7^5)plQ11>#Qi;6jTd$cEDNftVf0N z7>r+cd}-jr{q$x-(Wk{zW|(!hpU8*;Xf~4L;K~QAmwkkl@ilVk+@(hZIR$y`EmR@X zL2$(ltRu`ku(8-PtDPsaCx)#^RT?>iToZP^;*VuI&cUjxYp(`&O}-wGYCi#2xU)}K zkQRQRG%6mq5jg{D$5ZZ17f#BAa@RfMu>T66F$Y#b&Hx9RN%ADDQCck=D+EP6N`wAV z%_8rlEexu{u+OJ?YoH~TXHeGa0-3p=(>GQOZ4g%GoMGZr@Yf(&zC%52yr~P8__`-h z1V7qXen2@U4(7pnBC*E0u%T17yN>?&Q^lW6)hL`-6<|zKZUIfC6WWcM51 zfs2$~Sr5PU8R}dcuR!ZdB0eLWkY4hW@=_3 zG5e3{I+ppnmSfrf3u%VTXjM;=gwW2ldb;*;1G>-J+*0J7r;Jw@2HUHJ)3R|n$zhD- z@1*!XF&HF1oYT=&QOc`le*O39rWULjb!;=ak*CahIKQs-2vo z+kgOmPhs#u?goy5je7>3exhK!3n><^YfPqQv9iLO=bqivye;O@W7X?=+Z}%TO|HEK zMCs#s*QQ8~cB$6BZ}^sFNhQ{2#F9+lb?QV58<^HVMaYpP3o$nE7%9|MtMt6o0+Yc- zpI39N@~$wHM*VwfcK8zOe&p-~*oHyp{ISc#N%ByC#gu-vA2f>>-`K1)H3$TA9zd+^ zFll;Yvg13YK^8;Gj7cf0Dl#H%RPtxAk&5^=)_w8Pr-<8aUou52oM~D4?F;ZDPfSl2 z?kQd`^)HLw@C3^PMeDuzUkoTnX@5|kdt2|o_-gJ0eYac;ya9-4HKAqG!dI4qsl|<} zJkSF?Q`G`mWcHa2dGNpZHw1p5_Xjd_FUt-Cvncmib4etq3Eht>6bjR;ei(~d1i-PS zpJcu@Z@sA024ZYP5+a|itO2|C_e7!*)8T$gepY%^(TrZug6=0NGUOkgwKWr|9A3*} z_}#NS+vU-|yn=T#7Tc;ofo;fX>Fng~(icWYlz1m4-Vf#3zvi)9%-*E3znVGM8=ds; z$B>cqRC)4EW9V<@TVh+MP={7T{|~MdB}s(8e2_Tg4Feyf_GTziXbhq}XHzF%O9VXf ze_-DQrWP(=(q^Y!22D`0P2T!J)l!t?$-uY+jQ!oUMpAe(pcq3r{%>WL-k+QGi8d0U ziY>Kz~oE29Fy&>X1XM=i8r=j-#PSg7Tz0Jq&npd-u!9 zFU3}s!84J~XTMbydo*p$>N(kOnl}TBu(3>9Y%U%E*V34UCtuI4oRYJwJ{8X~!Wdv` z$;)sE414^YJk{+&yU2x;?+WMOl+RlTFFluOdegH~%P?O2|64C}=s98(t;5k(GnT){ zSLfBE**lHCQmCc^*+2v@_iXN>e!Rb=VVBOX)tRCWvj#b?!TzSlom198BR4=oI3v@| zHF!!u9@ECziV+B)R+-zt5Gst!AQ%faMluKYel})NDc;)Q1{8#G9hTu{-q(mi@W!9c z$cML=4(#r7*l?}A!j_M_?L-VE)ACAh&YM##^w`gu)tilYLXbA;UfY-U$fk3SkP&KK zfItcaLRiSTL8n>Bjyi7TlV~8Aep)HogowdICCGVX%uRUMh1lkgqheJ9SjQ$Qv0#Lc z@fj8_Uk7vlbUvu-9EHNO)?{+HNxD%R%Rte9!%jLp0ePW!5^*Rk^b2LL8T0}=K7`)) z=?*l@hUB&YzQ^SdU~p*_aAIT0MKkJ!Ef6L0LJX}U7mQn>86w^`2oXh_>}1|-;-dU* zmGm3U5z&rX3dWkzN6{7u36a(M6l1QZ2@x<5@095MO?l3=RusVG(4i?f6j<~@S3kqV z_nr_>-0G?RcYRFig8Mb)Pw@Af+WFd?REhmBD3ra15lh)G%Tt9y}(7~r9z^bjyU@SDS<;X9nFl=+dYErYNuG%69_ zp1%19NU%}Z5v-9E>PD@&$^g)g4F-_1$1a&%_BgW}V8(V6$QP@`Q3PvC3(qi_t&7rl zA@UjUZQ&^V`>~Y%(2iOKz!kIm+iN&_S1HeiHQvR_9s<5-O(8+3^2U7g z03JAaa2<0gn?5prv#*Mr?1G1#%d)c{o1g2yz|_JjX+21W8)||TR>@0SO6Wjy+owd3 zxsrO;#O$1bz|=wGCLTqoiU

g{dsDdSciS_VyqCY}B1;WKxT=O4-EShk?0*Rd;|= z>5+YzRf_Oj(6-vH3FOf4-U*2Qki{)IDv<6UzQX@|KK>v6zx$sj!DNa*9Kn6i+al=$M2+#Em(>}F=_xkvCHPY>t&-xul$L4*Da z;p1Mf(9#~1#=i@UlMYP)173+@!Atw3s{Meo|E(#6x=4`6dX(O8iMche>YnJ-T$+>R5s5nwsis5%{ z|01`dc9y{gWl|R(+YI%)oihuNb!3EtI({g;fRwB3BleEl8OU`s>ru0V4oPi97@mTv z`>V^u0DYA2SIS=j?Iom-EyPS&Eb=?t=V~wM3>KN&+^&ks&-!O0v-!cmPccubHS4CFZpJN^_c9OG_^h1MiDNlq!+i2EB6R36TfmeDw?wV>M1@OsqEi^fRriMa3?TBz#;Ai z=p1F~$r_PtaEaEmuF>%zDRSsY7G41S+}uy(I1&E*Rj6zhqpN@dk6fD2%7!Uz8V*4( z@rg6NyuM>V7$Y0Mbj{xu`DC3tKzW{HW?!-?W%L#yF8t$L=1#qOzBYo?wl3&W^^r`f__{r%%B{UJ9KG42X!LSprAARjI&?wl=7CGhL$m>3YBAN z?#$mm%yjP7iT;9_f5fJ|90zh~07HDPzI5Cnx9 z^#ZY^L`K=K?upf-Cb;ZhX7cf4a4=h#KfU@abk5u0BXynQE^3r*4uW z=Z5F&zy#2qbB4(yigD(vG^@}qwKJu_E6J8x8(}W!pE$FpQ8uS9sHlz$FGxw(ud0P& zKvgO|;^BHDKSPdi+m=*l!(iQx1)DbM6(j}|Wh8yZpOXtQ;YOqS3AaoLUe(H|Ul~_a ziy-yF$3p=w1B~8pW@0ky=3h}Z#A){c9fF%vk<59wR?3jQ4}{7rvrk2mj{3=GnvcAK z6#F1cLC0>qdxO<*T5!;G?bvb4_SNka&t8m0VThpT(qFO(r%)lsR(TsvSh=Ql%X9?R zH-|tV{CLrou_;JpLt6s?-P*FgSL!N0?&+%rGs8>B<4a_Fx<4RKUNoY)e!DeSJi@it;b07ToACnOx1lqnqZ4SvBO~QBl>Th&V&iKzVJScFtopr5aF%AS&j%{ zYb8w{UaPCGN0Fm@q`H;W2C3H7qQdsi)`;zNDn9qNT7T&ge4~cZ6sURxhC7->8AINK z;cDp;vD#Bo?);^~#0?iIYXP*0^AsDoaEH3S?(c^e^=wniN_;e1m1KC6N?Zz_F@U2*cbeC{W3^+4a&cE<0w?6%QJZL19UkA94`%*V z7vu-x#g_E|eSNzr1~GR*uz|=9ek6iir)1?*^GX`sUpYaekZ=3|JNpsiA-O4Z1JT?t zaQ*k*rDgA3aG=|Aouu{umQPiq*ryO9!3r~;=6|?ga9r*&w zUgUwMi{!CC&61+Ff*-+ z#V&L*-jXk~AF8vu`zib;negG&i7=@@_EKJtGuSq=$yf-xEH#e#LnX2r;3tv?*?7YY zbI=0^9X)xyBA2oS#l9mhbm0DP5CwIQ>Wa*F+HfUIXg6N%R8hM&dhObvQuKnaHPsVX z-Mb}zp;R=IGFwrOSN|`EFq=j+;su@;jSr947?6twoeEPP<(;kw3qq68npX02V(uEK z>M-g1y^`L98iRnkhk=ZIVGIo)d-1U_&EO6w;}nVJCSumuf0v=f&;WlV*6*taTX~I< zueY1Av3S4{QoW8sZ21TAc}p%c?6j>Sv2o5wPD#QtuI^g4|q*2pz~ zS9`OfEv8JAlX!C(FjA1U%!GDKaVDYFKzlr7Y)Xs=I;&r}jNi5c+}!BCbJ3yy2C@qh zbqhK&3qi4RPJ!q^FTpMMhLKN^1ZLSx2%aL|aUS`~dCdrb+6ctJgy8J)IY(Y~&q1$) z&>dZ^z*(_YdGPKoP_}W7KY`5HKI!TWXqym-{s=1*3oOg#ocWo-c!=qZ^@5_~ZwZ4f zdGt^MuxpSFt<{hm`;ueYKp%RB(1gMErhAy9~E z+BK{{P_S%5F+=YQFJoM_^y5XpClS(cCgsI^ zU4@F~Q!mD1Nk#3g80!>M@om{F2V7wn%9OkO^_@xsS zE)HBI4sJDX)0uIw2J~lq-(7N5#9YdhpVTFJX@>;?*cqf!<5cBm;y_^#~@x*4TGg_+bDE* z*p~ke{7klnEcEBUnuG5CG6DECg(U3lFJ>4q0^~$P^!J#+5Y!C%2~m^vf~vmyxWQeK z<#(qei@_yW%4;ne+K`SMSQJImx(~)V}N+r$n(?ig{gqVcUF0FlcBic4bGHs zl9Z!@fOZ_rDeN>!y>Z&KYTuf&w(&eB ze2)6+ac~L3q!oIg@8mfdL|3bmEA+C2X7oT1Glm-tfnW?@cn?eovCAQFso-%gO>%;32ll^oCo+T7tjZo3EYZevT+H z^pb5*P2s}14Vx()NS0MCrpC^&2p3mK%B7GVW;Z#-rN%;-%ZoWhT-xhNB*!`1@n#(u z&|FlL)u_q$BAM*KA<{FkxnN{GdJPMWiEzBMU$G<$g9wNCySYL_+S;2W%Qt-k88k8J z)hl2da4`^586e-WPid|79l$}sCNPOgcWFdWHSA?(&p>^hp&%!lc1_CM8w52fgG~3%QR)Ltv zsj5zc1R8@H8X%-Ln1OAz0D>1Zbvf+ImD8)iQ4-0v^x(|%{v%>BBrnjR7(F3g(B29R zjU6|EE})_dj`k0EN~OZ>LM|d^C?7eF?fTDNcCXjaGG)os%HxO!hqH)guy(Yu!=giy zu_nrBJ>iu9)cH(3(f_Aj2bMlIMU0`C%8KGW>~s`nElqM0-s z5>{odnf9$}+cUI8RFgZm)J)PVtH_O%CR2|y?VNEI9(KH$u; zUYwuok}=&szTcV1>*abEABMw4L{~m*;P1@O67r@aI6TvseDCH;ppy_HBrDEIJd%@> z?SRxmNZHm!&`GQWpaCskb)p!a*zCFEm}~IiaL}8s_ZaW3#qmV^-YNCa^y}etQZi43 zl_-R&=BLO);~3$mULc0fI~cw`ppp4l2AZEPNRy*rAS6O-C+j@cXyULlr#Qg;b~{%~ z2Lf7*_lONCVTBRgI3)_;Q;OB{HT1Ypa zVqXO&E)sAoS#R5u=+*^1H-aSTwXf>Ul`4 z*}yYYGBE#mqRnfB$vRYmSpiOGg0D`0UucYpaQu%`91-B`7e`zJctw)vY}V2BptCe% zD1}|eLwUZ*`IKzw^5QeYruI`3v-yKLT_0}~l8W%4A{t~AT zc-a}1JnIjU$;4(a_yM7^Dxa}zh zeP=(%{=0(TpE`NYQH|Q%qy^)47NJ02Ee060j7bFLZn@N^H@$^tp3<{)JPNa9GM1EC z{2*?wRYXX`E;;@wSq0`y|6DRMNSAUB6*B28wj3bKY(|hAr5@;W%GX$!y>_6@mvkDYPF&5IuFmbrplTjpA)Ieh&&HXtdSm*LBuP+D zQ=GnI6be0=+i?PpUx3ZAJ=aoRc9e#{0`Qlk9 z&ggj1$^&8A_<|asu=|76Rcq|cv*%Je4+DlDWk$HKM`EXu<{`&MMctXW5-^1P8k`i* zwr!~Wi(8S8X9E>)kMlw%>Yl-s@2?GNOgbnL`!}HnN#%Xf=-56qO>tto&bA%Tf)Mv) z0BIJWdOysTvAnJLn|gT?x$hTF+4!K8^2JC>Te%9o&CBI3sotm=u&HMqvHKILG<2<5 zDT%WZ8RhHNEHiD$wJt=3QwdkbzN>+`4z!~MEpoRVp7%(UJgz4;pG8b}g}^@;PX7)O z4~do)FskszOlbNzNNjqypq8bP3v{EH?(5N?EE`$ zzGX`L<9dyqLPt&MkdDK}%cq#yyEYy0EibUezg2Yz2Sl(GL zn!|xsT@3s;6nZJ?1te~|FQWf+`%-lgzT%Oj>xiD-V8VgL+;l3tYCWC475z9@k=sfM zZGX}%M};mhhDiy&hxV$)+id@JLx_oMRc+r|A)>RePs9eiNg7X3PFw*w#EwXBmKbg)^&3i(=*p49NF#R7to-{&pr*vRUc=7L-d`SS=lJ+Go1>M3rf733kW>= zw=T4QN`xO6#f-m{sGr|%S?7*@1(%|xq5Vn?ED;i~d+O7%j_ir5XCWgBAjOQ@&Ds^G z0E9kAafg&^z@Q`@qb$R%1@(RJ-KyP|^i>&4Yj@ zl2o0J2Gq|#kIr1!$9R7P1Fp&t?o5WtjP8ss28(WBm$zjJb+NCtR(w1Oq|j-FgK)%m zUlKwW>=ai5s^{5TM(e@v9vB@-h=W2lOkpPyy&67! zdo(GbVgf-s>Qf)rGD9n2*V$^zpP^jyX!}of=j2IQf^`EveNp3u4U#nBDuIOU^T?mj z{)}Irn4iq>p#@S(JowW}d~;RxwflYkb1R!Cnx7!*h%Yhi zAx?~^U-tKrS^P(1Hi6yY5lcH93g1uG1>|!A1(udKfRSCJKcu5<_T+tKm5IexVM1Dl zfLi5*$X1mDGdYJJG&iZ8%T0+j8FAVJat)o1)_c-07w3G1cq8Lt5KS);W=tVQf{HlJ zj$GMwzgtcuV(5_Zl^Z^gY|X{7B6;?|s&d$)?>HOEe z!so)q!xI57U&C-y6dy+*>S4?MiG7P+IN~+Xid{AE?6Z?Ru4dxEz{r2>ZW5S0Ti@}` z-#g3@3MH|LFV4|2#GiTD&93tUTE3DQSWtTI@Onr))KAahw&XiYb9F&?Z9 zkB|P=H&LMDmg6i3>4Tam+?QE z9k;-jpI3l#@sGRZaJ{Db@5+nP-x?$CM!Cnv*I(lYM)+brY5WS{5a8Z^dN6+@w{oI$JUrv zO5Xu%P(KN3Dn2A?697KIRB0x$G&2crm04lVglD4gk5p8=(Bs!c9TY-50le}) zhxy`=+usJA1^_W1aI`~YO&^GXlYs~DbjP@oy7gpjS4@>FQ$?Pin?V|DXZ9N_PXB1l zoaYDQFsmqY@p+UK%YsWd@+(N>7_X6`aY5tO?S@Dr40Zr==CR+=Ve#c5%SsXUG`5O7K zy5Zvp+%^pYGdriHFY#6^xwr5>@>rtkW6njOH*O`j61XO(D4&Dqf*EHawX~Zu?@|Bp z1vo8T52LqUf03rVU0x0@;;mu$zC%ptVG4Ai2!VZALP|v>@gL!ccd~=fX+GFzCIYY2 zMOs>N3th^=v0q&U3*#cyB*m0$EqhNo-u-%v8xD+_A^Xq317Zmw_^nu`ibLM379_)v z&!WvmG0eKJ339`|WiY^%kKovjJhv5%%}G`FdB$9==)&@PiRh)N`rq(GRqBb&Y%A&> z)vqH_NnwaV9*IR&~~b{zh`{5P^2&BF{d}zC$4)}LxYOl1mm21P{#Hb z3p|63PkOjQ-SsZvmYwsvC%J!w0o@)>s(8{SAo(1g^&svRB|5m&=eWFlcDm_XXEEe@ULSG6)L!rK2n%e^Oi=EBzbTQ}qV{zvO=H`cdP& z?UB(W-NU*i0zJ_;VodzhXTF?e-k_U5qD_dc7?*?=ay>*dH=$OSk| z&7o+N@Kpl~RLZ03`Qd+dYmY2y%P~314QA$PTY3aF!%E(*$&fn7A4Owmmk;PKgh>Z~ z#Gs+Zk3Da)g*g=&_o$>$TS}ryUfPRAaW*p(ZNI|Ix3I%B6DJbQ)kY?ruW2IqF0)2O zjnu7VZ)t{*_Mm_zYrH6*^N`Yx9?Kp2C@`*}K<~+*iNaf$$ZTxk9Czd64_}KoZ9X

2XFY{rY|M{^YSH-3Dr|MuaESFL<0WOYXWKCnj~6KPNW7(x zNrda%emTUx(rqNa9;nL{jPrR##{rAK3t2B%TLu~YXkg!f@ho&9(JBYaRo^e2Uh!Ii z*$e5DAUNKaq8=E0CiQUqODdS)upn5YvGPCQE+e5!!IGSRZmLuNsYY2LPqERsZA(bd zPSASCNU&BT+TrW)o5OD)Vq5)_kG~Apg)poRoAa`^u7{xFSK55=*w?&zrWnIf?T;nz z4XQBi6`eP_AoZuXv3&<4Fq)wTW*xuc>(#C_y*wTRfv8^$av;_6#J%{>h0JJyo73oE zuhRsjJiMawF%`a0=gIR3Z#^V@If7&ybEfxe2PRe!Co2-S)P&w%HdXWD-IZ_X%lCdE zL5#~^adbIn#?*9J*@puv@$~_TxGQm&7>pY|0%&Q1eklB9eNYMFXkt5a<9P0fD^4Bl&gMW z>ZyIR6;GZpf6K@YmQ}KJu@2IxbDc#VK22}vV7|kQ-$a5xrt->^$Eo+Rg`tTAV>J&| z60TC>WB@$krH{M#eB!1M`=bH=k>lel5S2oeqn$K6JnKK+&)_GrXogz-c>K(xH%PO% zph#=KWKMyFDh}*+IPo}YtXV3mb`+QikbW{3z^_~Qclb`vmA4@Hthl?8TbpDf8`>b3 zz0?ATvF2>D0=gp2(IfgkMkbiAF1;BeVspsNL|9PC_VxflPD$Pmh4uxGFk|DUaey=VMWv20g zp#9i_!9G}LV4xl|NeJda^;~!^le+NQjemHfh?QbB9LfuFurO|^O%*^6Q4Q3ghH><} z(FgPxn>Iw-7A%I-98C8rKP3Gm41eV+R$DaMOXMxBRH>BDr+^*x&HX zwY1SRbVt2fKU37*)edF5Z`MWJJAp8sX@WiW(W20+(3KL?1xtO3?UHy8CGxcyT-Ps_dpVgvUtT zA$6xP^1KF(ynKt?E)A3OAhPQKQtMdu-D1{xiY0G_^m$+3DVWtDPUk{f8==ajBu`i_ zX60y7e>Dxjb)9&eG=brV;MHPbB8^_fv2`)dsHJEPC*iM8Mc#4yGN=4LX~JDF$DQ8S z22$`Y+}pdgN8c>ZZ?_0&U6BI+6D7z#ANT1K+&-Y8Z9h93drKdV3Ge8+Hcj#B#Ai`WeY zEBw!K4l|JK&-B^IzVgxtM8_2|ar&vU0BZ|qI6(r5(6m7m?LE85~mDjXWY&US-AOV!d$REivo=a;Z&q>p(!`_Mn|UGsKciP&`I z^x4b?*^MJRoX#0n^r6i<169-}b{Rcd2ccfP&%%-P$TlVjxS?&}TCbW4*o1rWmhUAk zi@5(ff;;D|&`U13(<|{$yah+8n+>%LAll!WDI_w>Jw*J`fl>6%FVugq`EUh12niPfEPC2WtUsf*#0e7eV2}gL6F;OA z8BH~ucI|cG^>xAB+Rw_0uFmo3&)mJWy$~ob#%AJ2c~9K!(spo3dE{MkrK+ykTsU8p zhxS}Of3VIlA8fW_1V^?;bPh7z&Az!yfgA~GF^&Bno>S(DH!4%XqhVDRuwFUd zlup-1x>NvNz80eRSpjh;c zX*GxR?q}FaQ4EKOVI?UawU`PWY!JMBEkc&%;VD^DveX#kr{pUqj=6zR+IaRh*46U4 zJxNu80HIZn`#2Z&Ce87XA7nRM*GV;pVa|I#Qt6YtBBvI*CoAznP1)r-v zlSaavvJM>OkEwMyg=}$pZ`J3hNFS7KxjO8uJ^Ph%LNrvsgmAwNl?_zjtA0`Ze_9_t zdjSZ+6Wen&V^ZoK;xLp~_Q6Hyfn2%c_xqo(;_JIiJarR`17OD{2tle4LW0BjKHU{t*&s(|~ zPcm6|$+jik9t?Qxh@$&)q=nD6DR2!O`RIA~uMFzDe#)~){Rwt^QIODV*e(ZbK(}7!xG}Qd+ z!qDC0CQD~`^!KE>KV?Q|;$YmG-@7sl=JuMbTX)M$?W zxeUWWSF_qgT@8VvW=oT6gPb zuSZ}|YVw>;6kmEIM^dZqobopFnDC?%>6f~BeEK-(eCZ8y(QtRtba2HlGM*zyj=HIdObQR6pr_1 z%)=&sGE{)SQ3AzK|ALWYG9d)|=a)3&M#-l}B{8DXhrS5xfD-7g;q}iLL^A(4^}H}) zO~|HwJ=5UeT-!Xsa}N;d5s<#A+eAG4AwnYX`EXmu?Lzk?JazHY>i&dy!>+ML^%>;B zAtiKGuvwxybFF=S@nA9}VDd#Da-k4Y;YsmO-uDHGiM%AXC3c!eD^pW0tslR+s4};) z&CXi3g$(X^c)#^(g8|3n%eKm2GMrhAMUkXPWW|+5UuqmT&o9Xp)>DI8rTNcBimS4U zO#?w$f77KNh@@9fP^F!X!_eX6M+Gc&Re2lsS5>-v-;qv-euH}w^xR3@8h71YEfX|hBm^Wr{!z#0NjorxskFUI&dx0f{X7i`u2SXWIGDU zcHfc&T1wvH+yQhX(Lj=G;HjC0eq0qo+nmMdPfh^zkS4NOS8NJHK3F*Uw z+YZ3+M4Tw-ETVj_)}BJ%xY3%kL}Q@Qp9@O1*Th>ksrH%{;`j}xP2`t+1nl(-3F_z% z=s{CwjCEq)XVcRtPOhw&b*nKlT2MQKLrO_gq~~bTlkX@6{KxHah=`z4Eb&I2|MM7S z1@Rmjmr%9UL5?u`v?V0YgWMR)AJI70&8Q`WCTn%mTtRVABy^3Ik?)s|G*aM7lq0zY z&eZ$g??W;}Ex)KCTO&(Wfu07b~STEtz)k$2DcHjgll%{@}sA z+Ob|1_Oom(wtMM3>`L?riA;kPwaaTYzGti4zSLf3vS+W;$4O`mW4)g-AW=xLud(|N ztH{GRWB(R05HRlPDVjFN*GUT4vMJ=N%!cAIp(cB7tyPpP(6c+KlQuk=)zOsBpO15E z&{%x#QRecEdiL@oB2`ZD`l&UT9wVq49`U78YdiBn2WG+xH}n;UhbPlDu*0fs4v25M z!6K@s2^APehq=#b6DfA3<)UY4%arvDiE8qR^Yq`)Ro$;)U=DG=a|pgR8Jd#cKAO>7 zlZ11De|GQ~?TOFfY4A$;+%Vzg0;^Afp%t+M&m@+O$I>~4s!)t{1srBx<_$rbw)r>t zfeCGhpdg7t7Q`+){mM5*=m6}Cv1PT9jvr&TflWX}+e78@Y8Dd37ZcZAp;!|SI9y5u zzfk`s>l1?3WIEE_u%YI1?R$VEBSmuimYxkO^Dh&d6i~;$v2lOHsy9(?Lcg$;?hv^& zr=W#he<71EU@?kTC~!=3n(5PB{X88Ue+Va1)^D91!T2^-*0ymJnmqt8EGaxH2MpZT zJ@MBzenBwEpNSc#>(1C`QMDE>)_=LgG?fq<3HI*GNz3>Fxosq?-kzA;lMhg(_LB zq_!TE(LO8TMs>LZTM=j)nfYr4JDs+kSrR)1-n z@L^p@463V7NgV>8v3CHhLf?u@Q*FW}8c^f-*8fTU>j+2!Xeg8PG!q@ju{yq4(UF!+{Gz(5G4IHFkNpN5HPYbK9xu{t>0&>d< zX??GBEbuD^MD>b2{>X?QiZu1sLA+0wh1+fCL|Gd^TG3@_X6yY@#Fy@~oZPVZ*vu*a zQbLL2OdO+g&-s^z$iv-ttF-ZU(IrGQm{+Z!1raD+uVKJD5c+U}J$()ftoMm$Zah%o zC=y@$!6xV1z%ZY00`#`iM?PC0YY)npgPkqprs9coy6`6H70UBrG*#|vuNSM8I)_kJ zbZyhD%4HaajRztf$kkLvnL(e8s1sVX3hq_>I!Xc=;K{Ve0L?O>MYpSrX;D3R(Z6F| z_Mt7ekTDi`(as64yY{u%6+S~`omL@JS%@< z5f)>&jUAHpI}e`o?Nv`VnhS2IS=Gh1u|xrYAG?E|R`{jz#HOeYvp*XJm<0N-lY0u? zgXB~4GloMjhDD|m$5GC7&f}2F9@FUYHcN@sZPLtG7UWQZpNGblo7a`K#gn9gn~AY< z3a^LTv^G6RVh~A9-Nj%=F&F#l(hDg2nfL-VTS?IA%QmGgbszV|X2__#m+}6q!+p~3 zHoW20wccn>j)ZHq*FNAX5`%V+U3Ay5;goTBVed5Lxbxm*boR#BQ5(%$x25IgW$9-< zUHEwK!lX7y{Bt&2S7-KPN7tV$f%#;R>1dNwRL|YKu9L`WlLm#9fCsbbWR(M$`8RR8 z8utGM3J}MjzxTvmo@0}G-I^!ew@HOvDH=mS*fC8h4?02Nzm%DO>C1F=-9M4hl9=H7UtzT+;Aub(7ZY|OuD=F&u-er8-MD{OYmBoY{A>jy=ShF) zdh1f>f>yxB&a$OPm@9wmKENeazC`+zfXNHR#|C?$mPauJ;hW@Z#>HdrG}7XctH`p&t>0YBj^zlbo~0br^|PBknxD6-K@R()|;jxxli1{2$Ecf;h3 zA@A9!Ou1LY>T8cYThZ-b960*1CUj4RDl6mSg8~kYDVkp3y%Hj2t1_&)*B`1MIZod^ z5B1PUcL^2(jB^CZH+F(m=PD}h-kg#~-F2HC|AF~LrWsKJ<4n%JXV~b+h>E*5ZrT%Osc9Z1nJX<}nUKAh&l{W?4g-xgi4FB?m9sEQKMWTdP zO}8!P?b8P(#3jYb6k|33L!7p5=wHX{&YooM@uES=aLedFw!|ynm=S-*-MmMbq%?_L zS02b_*XPTWC&ZXVpGP`~*8?u+-z69&CL@SOgHo7j%qGnK&nt_ ztE)d!Dx7I~Fmh!3*ScEoglcGjHVDB`(X$cJSYk0<)}T{R)u6x8%N}fN6bNu~L#c#Y zU>2SD>HiXMR>}Us>hU9P&e$+mr-vNlKa@>JqK{D|2J!|w>j{oaku(LxTwJe>UyU&Q zEp$74&!P)~zgW`LeuQF=x24=RnydX=Dip)i_V71@xhqkv8NJi=CVbUF6B;Saf+;ks z^Hvq!*9b9GC={qXM=Tcfyo2&YP486=QP5|3oy;v>rGIgI*XPTWC&ZXVpGP`~*8?u+ z9Ptd)9Trto@I2$%$PqKxaR#F3X=7)T0ItmoE3JuuGHVfzO@)$d7kePILi5D>P486= zQP5|3oy;v>rGIgIq2{(M_!6KL9zolk6?%5gU$l+~5DS+ApM7c2bC7YO78bg$D&|&n7C|1bPIQO;k2cF%i z?F3P1116bJhAN$e^K5Ra2MEeOMbRJ)8O@b1M>?a~9drJIyQD0;B$+u$%8-_oAuyQ) zx#eN~^sT#%dO~I^e{g!=<)4sOW+@uYrrFYsdoD)e6!UlKS%9jKHet#h

iY-7ct@#70iHT~1D zlRw)vLKuNH_H@7eW4^@$VNQ&&YhOGb=+oK5M_X3{o;QgyOlhP z3oz4RaLz7KKxeO|+dRgcTf7h6my$-#!G3RFl*7I_)`q)5ZF(hKscO4Q#}3Q0Ner^6 z!t`1Z>R-Y0{A7T%k^9T~h-Q0>K=!BuBzE_r)tmO$-DUk8=!vH^)pA{L*j`nd7Q|>l zYPM$^!pxu&p7rQXm_aNr`AHb}-(b<-+=VlV_};s$NYDu8_hAHD2$!SYj*3lzEV#}} zb(5m*mK0j5Q?Z#Q9NNUYdj22k)VQIxa%61Wj+oLB_k$D!Zj#&awXN0j2DwU z>usVC4P6?haq+Ub7;^Xs=|U`P{U|Kly$Lolq~cLLCOmPl=;X72gSa9zq0(Sq(|7@; zvQ)T@`*2E4-!j2;ClEZ}{?w~OC?NhTsfI*-+i#d0h)R4_6xgRD6sfu0r|>hRuW#4eM{3ycjuy|x>p`g3J2(8zqj4>zCMiy1)Na}x=_b+i+onjdm zIGJ|Xh3d{aZ8nI(smLm;1*hXEE5)%|c8UB4C$kGk884PJA2+JV8|kg25lDO%N~a)j zY)3cpr@+DVI(>sOY^Ku9Zy>!oI0nD(go7nyj@Xg%eUBg9vtHyOrGz~|sz{;|Qy{+=|v!FNMsq%I^|0{qBaZ_bkUJ%|RE!i61 z`A^Mys1jgznw(!K79Te*aiSM0PU|~`15sYU!lH=|-kP{u-@2-#az{$lbFR^VPL@h- zcXb3q_1AFTbxf>Hb$f}(p>#=FUtec(ljYy*?Qy*M7OkE5{N|lE(TvWe^*_OxY~I6eNrqR z%RjiU6ygp?yQG>y$|P+_88GwzBtukX1KUVWSnD`ShkRYDX*DPFbv;R~s+VX#IE!t+A z-jx#btjC}-$*AW}VTin5-%_zbp<;>9ibmB=(vrt z#X%80G=qVFMBUpKBK{VpFQCU9xt0HFM7@fB>U3es6?#qAZ62$T=@_)0APs2V&mnBq;LO*tCtp`P~Ektu{sMjJN=suX|$e~ zH&2`Dc%XqXiN-=b7QjI7lmK`9Obt7+Z?I=*@4oP49H0a5q|LDfh?R*!KOpT;*5$z5 zi{7!qAUomzs^!G!B5csOAbGGSZ=td(%_fLYOJmBL3=nRzC1hXMN1#6{;oOW-1rQo_ z?&K#~*dYX%)x<(ekHlNfD^&EahL8~CX@q(ZxoRzVJ0!Akm(HTa@OgUDwR!bx^!eE|T6!D(@KlMN5Wfrx!9BJyM8COBfW|#1{ zBine@+ax(mehK(n7X*h5HfJ=f`{}ZOW{svJ>;0j2318=d8zn2wF;PG?fzEf9SoHyf zP8j*@l@~6D@mYu${5Do}d#iTjvcr19&uI&q-iM9B(=TKU(K4Xwc2<+;(K({(!T?Ed8e0f!3Px3reXuCE zq6*r}jK$rN^_icUCjI?3+Tbtd!SfTK{8!z0#s{Zla@FQoSfg_fd9od%<7V#9(hlLb zaha`jW|SZA)U9h|@5__`K3qJ?N-oi|I&F8N698HFwf(_lGD_Ru3S(jlC~*VvD&&GSR2=2Uw>u=7RQwK#7hyUU#KguOp#X$TP;KZRd)0TqhV22QT?gz76 z0Mxfpo*3*kH@(H%lv9Z^y~vspm8+pAO5e3odE~l(buRHT0)O7nq^}&&<-rO(^(_K{ zKOZbp(y}PQPrW(_Nh^~3K*0?cN^}pn{JA!_4M(A^4pz=(8!L>}zmE4hcDwERDI|vMd7A!4>CF^v`(CX?M!Q;ya3f<)_xs4)_%z1`M&u7V z3*B?YzwSoDYV+946rXqn>|8`-q4*owmK^ya;5{43_EAjn;b7G*h5n>tmcD9@yDzd~ zN+ap4oa$%ukr6Lx--ywYvFnVr_+LImzI#LRbFud;qddLdIa!~TAq^zhtk_&`8KkR{ zf8pR8{FLmW6fZWAH??R}@;pRJ&7?bg-rD)GvZv?gCUAxYlcx^7+u|)|73A%SXm9z} zhrYH4i{eQ0uatMF5%&j#b6s|euXsV7ZNoEsB&82ii+CTOuUMyJt5Yb6C0MsVycAJE zfp8vZRBb2RX1O;eIqSYnmGD-aOo48dhjp;9{mp{FX)*y@==e2 zXJSIG!;#fgxL%Y#gKBpYO!4nd*E6hNhc$g!yq$b=ieo{q!8OfVuY95Msk~TrgL;~Q z5Gi@>DA0*V4*+tJJ$@{caSXN-mH9(Gz(k%i4nR@u`By`Qr!hTazPdhYxz138a2$GwaJsVF}e{h30y&I$|0z*VGIXFVD^srowH4 zgp}paMs+&3?_?D&2r6-(6u^zE`huHsOXsllApi>c&K-LhcYrO$Xqk44FPL~14*X6x z7oZX;WvMJ{Y^ljQgcKmXaxY24hnE^yTxrt8&mT>HjZR(-b~^~+HZPbq9Qse14B0AQ zC-j_Mocn}$Iwx>5U6P|_l0t;sBmVHOlY=!n&Wz>D#!{7B11)f8NLTORqmio*j58?C z#?xf`C=&MisF&vk)vd3P>UimFEaPI4!Y=vaq)h9(%x;8E1))@~U30PIw`x2uVmydd zXoHXuD(hF`ZJaSF2=E29!Ygf4lHG>qXimd;-G^1%`Qjw_m|6sDSX{rX4(`-0N=_7% zp5^X3wDVowhw^38MtA{iHU7mWlpKgMz2_HfY|$Cfy}4;}o}=pEcX%1*pp2S`_y>3_rRsTSqH~o}vBjD~ zEBW;CE2Vc9b2q5k=QqSE|}X?w^NPecPiT^>4IMe_cyP0r-QK_fNuCV*OlvXQOXOzy~eX& z*?!jlhjp%k*(N$$f_z>;zqxak)z`tY`LgSMU|EGvt8Q)rlC7CY#n0ZDCn~3^wQd)U z*kEEI?sd-F16|7CTY=1~Cvbfy%?BY07U%Uw5d99>s5vcOm`6{1PJwgEu#Y9;L3o!l zHOlqQ{C+WjF>F1+=?7<@_`1>$)(yl(V<5)6F+$@9f|7M9Ij% zx2UJhXvHzca~6xUT%VK@tJkfGdeeDP*wDkQJE?s!_+EHRfr!|_isctDd#Xo->j)4N zg=aXZM{UJo9<92KV2$V!Qwh7OYhy!>C7D-{*^6wf(z_w~8H@s5OW`5Pclr=r3f0fh zM-@4iL%U3`+6$Hdm@t;9Qd#!WIOMuMF`#|=7$ptGaIDx#%-xT`nY!nCD<)Qtp&u9xNZV5s;nzb(;E6({y#mj-CFzj}M&J(j;b zTpc;a+he|<4CZRS;VxM`?){@lHSfhH6?gRks6IjK)S< z;v2Ty;@Qd|KdaQVi($9+$oR4DcG<4fo_B)oHMDA8=U`wc@<N$x}d|9(y560kx}y8a@}vNY!{NI`|DuJO7zx>2cu@xv_r6#D&bVJ2q;Y2&jp&ebUx!$vRhIA&jBO}F9?8FT#YZ)RI zmuZsFcy3DBpee_{(rboVTk0}Z+d~kYqz7QZ#zj}K>d9|;qiBYe|68^UHHmn%y}(>w zw)bPAAqW<-ni)q+pnEiu;FnEK0oc?JFKD2AL+#h^KzpG)*>FvXB_MDVLMSC&7f z)@3BKv{&-k9KJF*k?=7eg-nOaO~pfOdvY4lE80tfr|=z5Shy^7UL!p=E)&mriN$M?ApG84Xgz(jK%b#> zV1jIFr zoQlL6-GvZw83CPgJ)(p(wu`An?-Nq?c4taEF=WMeACYe50iwC#+>^lpTuRA;=8nJ}nQz`s0=MGE0?*J#G5V$$rU n8=M@1Z-xbG$waMS#hDU>NS(a1yuCnO8x{3LprB3rcHV3Nmaa6s diff --git a/drivers/net/wireless/mt5931/include/CFG_Wifi_File.h b/drivers/net/wireless/mt5931/include/CFG_Wifi_File.h deleted file mode 100755 index dd1fce8d7bf5..000000000000 --- a/drivers/net/wireless/mt5931/include/CFG_Wifi_File.h +++ /dev/null @@ -1,251 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/CFG_Wifi_File.h#1 $ -*/ - -/*! \file CFG_Wifi_File.h - \brief Collection of NVRAM structure used for YuSu project - - In this file we collect all compiler flags and detail the driver behavior if - enable/disable such switch or adjust numeric parameters. -*/ - - - -/* -** $Log: CFG_Wifi_File.h $ - * - * 09 08 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * Use new fields ucChannelListMap and ucChannelListIndex in NVRAM - * - * 08 31 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * . - * - * 08 15 2011 cp.wu - * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree - * add MT6628-specific definitions. - * - * 08 09 2011 cp.wu - * [WCXRP00000702] [MT5931][Driver] Modify initialization sequence for E1 ASIC[WCXRP00000913] [MT6620 Wi-Fi] create repository of source code dedicated for MT6620 E6 ASIC - * add CCK-DSSS TX-PWR control field in NVRAM and CMD definition for MT5931-MP - * - * 05 27 2011 cp.wu - * [WCXRP00000749] [MT6620 Wi-Fi][Driver] Add band edge tx power control to Wi-Fi NVRAM - * update NVRAM data structure definition. - * - * 03 10 2011 cp.wu - * [WCXRP00000532] [MT6620 Wi-Fi][Driver] Migrate NVRAM configuration procedures from MT6620 E2 to MT6620 E3 - * deprecate configuration used by MT6620 E2 - * - * 10 26 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command - * 1) update NVRAM content template to ver 1.02 - * 2) add compile option for querying NIC capability (default: off) - * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting - * 4) correct auto-rate compiler error under linux (treat warning as error) - * 5) simplify usage of NVRAM and REG_INFO_T - * 6) add version checking between driver and firmware - * - * 10 25 2010 cp.wu - * [WCXRP00000133] [MT6620 Wi-Fi] [FW][Driver] Change TX power offset band definition - * follow-up for CMD_5G_PWR_OFFSET_T definition change - * - * 10 05 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * 1) add NVRAM access API - * 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option) - * 3) add OID implementation for NVRAM read/write service - * - * 09 23 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * add skeleton for NVRAM integration - * -*/ - -#ifndef _CFG_WIFI_FILE_H -#define _CFG_WIFI_FILE_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "gl_typedef.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ -// duplicated from nic_cmd_event.h to avoid header dependency -typedef struct _TX_PWR_PARAM_T { - INT_8 cTxPwr2G4Cck; /* signed, in unit of 0.5dBm */ -#if defined(MT6620) - INT_8 acReserved[3]; -#elif defined(MT5931) || defined(MT6628) - INT_8 cTxPwr2G4Dsss; /* signed, in unit of 0.5dBm */ - INT_8 acReserved[2]; -#else - #error "No valid definition!" -#endif - - INT_8 cTxPwr2G4OFDM_BPSK; - INT_8 cTxPwr2G4OFDM_QPSK; - INT_8 cTxPwr2G4OFDM_16QAM; - INT_8 cTxPwr2G4OFDM_Reserved; - INT_8 cTxPwr2G4OFDM_48Mbps; - INT_8 cTxPwr2G4OFDM_54Mbps; - - INT_8 cTxPwr2G4HT20_BPSK; - INT_8 cTxPwr2G4HT20_QPSK; - INT_8 cTxPwr2G4HT20_16QAM; - INT_8 cTxPwr2G4HT20_MCS5; - INT_8 cTxPwr2G4HT20_MCS6; - INT_8 cTxPwr2G4HT20_MCS7; - - INT_8 cTxPwr2G4HT40_BPSK; - INT_8 cTxPwr2G4HT40_QPSK; - INT_8 cTxPwr2G4HT40_16QAM; - INT_8 cTxPwr2G4HT40_MCS5; - INT_8 cTxPwr2G4HT40_MCS6; - INT_8 cTxPwr2G4HT40_MCS7; - - INT_8 cTxPwr5GOFDM_BPSK; - INT_8 cTxPwr5GOFDM_QPSK; - INT_8 cTxPwr5GOFDM_16QAM; - INT_8 cTxPwr5GOFDM_Reserved; - INT_8 cTxPwr5GOFDM_48Mbps; - INT_8 cTxPwr5GOFDM_54Mbps; - - INT_8 cTxPwr5GHT20_BPSK; - INT_8 cTxPwr5GHT20_QPSK; - INT_8 cTxPwr5GHT20_16QAM; - INT_8 cTxPwr5GHT20_MCS5; - INT_8 cTxPwr5GHT20_MCS6; - INT_8 cTxPwr5GHT20_MCS7; - - INT_8 cTxPwr5GHT40_BPSK; - INT_8 cTxPwr5GHT40_QPSK; - INT_8 cTxPwr5GHT40_16QAM; - INT_8 cTxPwr5GHT40_MCS5; - INT_8 cTxPwr5GHT40_MCS6; - INT_8 cTxPwr5GHT40_MCS7; -} TX_PWR_PARAM_T, *P_TX_PWR_PARAM_T; - -typedef struct _PWR_5G_OFFSET_T { - INT_8 cOffsetBand0; /* 4.915-4.980G */ - INT_8 cOffsetBand1; /* 5.000-5.080G */ - INT_8 cOffsetBand2; /* 5.160-5.180G */ - INT_8 cOffsetBand3; /* 5.200-5.280G */ - INT_8 cOffsetBand4; /* 5.300-5.340G */ - INT_8 cOffsetBand5; /* 5.500-5.580G */ - INT_8 cOffsetBand6; /* 5.600-5.680G */ - INT_8 cOffsetBand7; /* 5.700-5.825G */ -} PWR_5G_OFFSET_T, *P_PWR_5G_OFFSET_T; - -typedef struct _PWR_PARAM_T { - UINT_32 au4Data[28]; - UINT_32 u4RefValue1; - UINT_32 u4RefValue2; -} PWR_PARAM_T, *P_PWR_PARAM_T; - -typedef struct _MT6620_CFG_PARAM_STRUCT { - /* 256 bytes of MP data */ - UINT_16 u2Part1OwnVersion; - UINT_16 u2Part1PeerVersion; - UINT_8 aucMacAddress[6]; - UINT_8 aucCountryCode[2]; - TX_PWR_PARAM_T rTxPwr; - UINT_8 aucEFUSE[144]; - UINT_8 ucTxPwrValid; - UINT_8 ucSupport5GBand; - UINT_8 fg2G4BandEdgePwrUsed; - INT_8 cBandEdgeMaxPwrCCK; - INT_8 cBandEdgeMaxPwrOFDM20; - INT_8 cBandEdgeMaxPwrOFDM40; - - UINT_8 ucRegChannelListMap; - UINT_8 ucRegChannelListIndex; - UINT_8 aucRegSubbandInfo[36]; - - UINT_8 aucReserved2[256-240]; - - /* 256 bytes of function data */ - UINT_16 u2Part2OwnVersion; - UINT_16 u2Part2PeerVersion; - UINT_8 uc2G4BwFixed20M; - UINT_8 uc5GBwFixed20M; - UINT_8 ucEnable5GBand; - UINT_8 aucPreTailReserved; - UINT_8 aucTailReserved[256-8]; -} MT6620_CFG_PARAM_STRUCT, *P_MT6620_CFG_PARAM_STRUCT, - WIFI_CFG_PARAM_STRUCT, *P_WIFI_CFG_PARAM_STRUCT; - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -#ifndef DATA_STRUC_INSPECTING_ASSERT -#define DATA_STRUC_INSPECTING_ASSERT(expr) \ - switch (0) {case 0: case (expr): default:;} -#endif - -#define CFG_FILE_WIFI_REC_SIZE sizeof(WIFI_CFG_PARAM_STRUCT) - - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#ifndef _lint -/* We don't have to call following function to inspect the data structure. - * It will check automatically while at compile time. - * We'll need this to guarantee the same member order in different structures - * to simply handling effort in some functions. - */ -__KAL_INLINE__ VOID -nvramOffsetCheck ( - VOID - ) -{ - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, u2Part2OwnVersion) == 256); - - DATA_STRUC_INSPECTING_ASSERT( - sizeof(WIFI_CFG_PARAM_STRUCT) == 512); - - DATA_STRUC_INSPECTING_ASSERT( - (OFFSET_OF(WIFI_CFG_PARAM_STRUCT, aucEFUSE) & 0x0001) == 0); - - DATA_STRUC_INSPECTING_ASSERT( - (OFFSET_OF(WIFI_CFG_PARAM_STRUCT, aucRegSubbandInfo) & 0x0001) == 0); -} -#endif - -#endif /* _CFG_WIFI_FILE_H */ - - diff --git a/drivers/net/wireless/mt5931/include/config.h b/drivers/net/wireless/mt5931/include/config.h deleted file mode 100755 index 8b28eb5a4793..000000000000 --- a/drivers/net/wireless/mt5931/include/config.h +++ /dev/null @@ -1,1525 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/config.h#2 $ -*/ - -/*! \file "config.h" - \brief This file includes the various configurable parameters for customers - - This file ncludes the configurable parameters except the paramters indicate the turning-on/off of some features -*/ - - - -/* -** $Log: config.h $ - * - * 07 13 2012 cp.wu - * [WCXRP00001259] [MT6620 Wi-Fi][Driver][Firmware] Send a signal to firmware for termination after SDIO error has happened - * [driver domain] add force reset by host-to-device interrupt mechanism - * - * 06 13 2012 yuche.tsai - * NULL - * Update maintrunk driver. - * Add support for driver compose assoc request frame. - * - * 06 05 2012 tsaiyuan.hsu - * [WCXRP00001249] [ALPS.ICS] Daily build warning on "wlan/mgmt/swcr.c#1" - * resolve build waring for "WNM_UNIT_TEST not defined".. - * - * 06 04 2012 cp.wu - * [WCXRP00001245] [MT6620 Wi-Fi][Driver][Firmware] NPS Software Development - * discussed with WH, privacy bit in associate response is not necessary to be checked, and identified as association failure when mismatching with beacon/probe response - * - * 05 11 2012 cp.wu - * [WCXRP00001237] [MT6620 Wi-Fi][Driver] Show MAC address and MAC address source for ACS's convenience - * show MAC address & source while initiliazation - * - * 04 20 2012 cp.wu - * [WCXRP00000913] [MT6620 Wi-Fi] create repository of source code dedicated for MT6620 E6 ASIC - * correct macro - * - * 04 12 2012 terry.wu - * NULL - * Add AEE message support - * 1) Show AEE warning(red screen) if SDIO access error occurs - * - * 03 29 2012 eason.tsai - * [WCXRP00001216] [MT6628 Wi-Fi][Driver]add conditional define - * add conditional define. - * - * 03 02 2012 terry.wu - * NULL - * Enable CFG80211 Support. - * - * 01 05 2012 tsaiyuan.hsu - * [WCXRP00001157] [MT6620 Wi-Fi][FW][DRV] add timing measurement support for 802.11v - * add timing measurement support for 802.11v. - * - * 11 23 2011 cp.wu - * [WCXRP00001123] [MT6620 Wi-Fi][Driver] Add option to disable beacon content change detection - * add compile option to disable beacon content change detection. - * - * 11 18 2011 yuche.tsai - * NULL - * CONFIG P2P support RSSI query, default turned off. - * - * 10 28 2011 cp.wu - * [MT6620 Wi-Fi][Win32 Driver] Enable 5GHz support as default - * enable 5GHz as default for DaVinci trunk and V2.1 driver release . - * - * 10 18 2011 cp.wu - * [WCXRP00001022] [MT6628 Driver][Firmware Download] Add multi section independent download functionality - * surpress compiler warning for MT6628 build - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 10 03 2011 cp.wu - * [WCXRP00001022] [MT6628 Driver][Firmware Download] Add multi section independent download functionality - * enable divided firmware downloading. - * - * 10 03 2011 cp.wu - * [WCXRP00001022] [MT6628 Driver][Firmware Download] Add multi section independent download functionality - * add firmware download path in divided scatters. - * - * 10 03 2011 cp.wu - * [MT6628 Driver][Firmware Download] Add multi section independent download functionality - * add firmware downloading aggregated path. - * - * 09 28 2011 tsaiyuan.hsu - * [WCXRP00000900] [MT5931 Wi-Fi] Improve balance of TX and RX - * enlarge window size only by 4. - * - * 08 15 2011 cp.wu - * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree - * reuse firmware download logic of MT6620 for MT6628. - * - * 08 15 2011 cp.wu - * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree - * add MT6628-specific definitions. - * - * 08 15 2011 cp.wu - * [WCXRP00000913] [MT6620 Wi-Fi] create repository of source code dedicated for MT6620 E6 ASIC - * support to load different firmware image for E3/E4/E5 and E6 ASIC on win32 platforms. - * - * 08 12 2011 cp.wu - * [WCXRP00000913] [MT6620 Wi-Fi] create repository of source code dedicated for MT6620 E6 ASIC - * load WIFI_RAM_CODE_E6 for MT6620 E6 ASIC. - * - * 08 09 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings - * Add BWCS definition for MT6620. - * - * 07 28 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings - * Add BWCS cmd and event. - * - * 07 22 2011 jeffrey.chang - * [WCXRP00000864] [MT5931] Add command to adjust OSC stable time - * modify driver to set OSC stable time after f/w download - * - * 07 18 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add CMD/Event for RDD and BWCS. - * - * 07 05 2011 yuche.tsai - * [WCXRP00000821] [Volunteer Patch][WiFi Direct][Driver] WiFi Direct Connection Speed Issue - * Refine compile flag. - * - * 07 05 2011 yuche.tsai - * [WCXRP00000821] [Volunteer Patch][WiFi Direct][Driver] WiFi Direct Connection Speed Issue - * Add wifi direct connection enhancement method I, II & VI. - * - * 06 24 2011 cp.wu - * [WCXRP00000702] [MT5931][Driver] Modify initialization sequence for E1 ASIC[WCXRP00000812] [MT6620 Wi-Fi][Driver] not show NVRAM when there is no valid MAC address in NVRAM content - * increase RX buffer number to have a 2:1 ping-pong ratio - * - * 06 23 2011 eddie.chen - * [WCXRP00000810] [MT5931][DRV/FW] Adjust TxRx Buffer number and Rx buffer size - * 1. Different TX RX buffer - * 2. Enlarge RX buffer and increase the number 8->11 - * 3. Seperate the WINSZIE and RX buffer number - * 4. Fix RX maximum size in MAC - * - * 06 20 2011 terry.wu - * NULL - * Add BoW Rate Limitation. - * - * 06 17 2011 terry.wu - * NULL - * . - * - * 06 17 2011 terry.wu - * NULL - * Add BoW 11N support. - * - * 06 07 2011 yuche.tsai - * [WCXRP00000763] [Volunteer Patch][MT6620][Driver] RX Service Discovery Frame under AP mode Issue - * Add compile flag for persistent group support. - * - * 06 01 2011 cm.chang - * [WCXRP00000756] [MT6620 Wi-Fi][Driver] 1. AIS follow channel of BOW 2. Provide legal channel function - * Limit AIS to fixed channel same with BOW - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 04 14 2011 cm.chang - * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency - * Enable RX STBC capability - * - * 04 11 2011 george.huang - * [WCXRP00000628] [MT6620 Wi-Fi][FW][Driver] Modify U-APSD setting to default OFF - * . - * - * 04 08 2011 pat.lu - * [WCXRP00000623] [MT6620 Wi-Fi][Driver] use ARCH define to distinguish PC Linux driver - * Use CONFIG_X86 instead of PC_LINUX_DRIVER_USE option to have proper compile settting for PC Linux driver - * - * 04 08 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * 1. correction: RX aggregation is not limited to SDIO but for all host interface options - * 2. add forward declarations for DBG-only symbols - * - * 04 06 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * 1. do not check for pvData inside wlanNetCreate() due to it is NULL for eHPI port - * 2. update perm_addr as well for MAC address - * 3. not calling check_mem_region() anymore for eHPI - * 4. correct MSC_CS macro for 0-based notation - * - * 04 01 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * 1. simplify config.h due to aggregation options could be also applied for eHPI/SPI interface - * 2. use spin-lock instead of semaphore for protecting eHPI access because of possible access from ISR - * 3. request_irq() API has some changes between linux kernel 2.6.12 and 2.6.26 - * - * 03 29 2011 cp.wu - * [WCXRP00000598] [MT6620 Wi-Fi][Driver] Implementation of interface for communicating with user space process for RESET_START and RESET_END events - * implement kernel-to-userspace communication via generic netlink socket for whole-chip resetting mechanism - * - * 03 22 2011 pat.lu - * [WCXRP00000592] [MT6620 Wi-Fi][Driver] Support PC Linux Environment Driver Build - * Add a compiler option "PC_LINUX_DRIVER_USE" for building driver in PC Linux environment. - * - * 03 18 2011 wh.su - * [WCXRP00000530] [MT6620 Wi-Fi] [Driver] skip doing p2pRunEventAAAComplete after send assoc response Tx Done - * enable the Anti_piracy check at driver . - * - * 03 17 2011 tsaiyuan.hsu - * [WCXRP00000517] [MT6620 Wi-Fi][Driver][FW] Fine Tune Performance of Roaming - * enable roaming feature. - * - * 03 17 2011 chinglan.wang - * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature - * . - * - * 03 15 2011 cp.wu - * [WCXRP00000559] [MT6620 Wi-Fi][Driver] Combine TX/RX DMA buffers into a single one to reduce physically continuous memory consumption - * 1. deprecate CFG_HANDLE_IST_IN_SDIO_CALLBACK - * 2. Use common coalescing buffer for both TX/RX directions - * - * - * 03 15 2011 eddie.chen - * [WCXRP00000554] [MT6620 Wi-Fi][DRV] Add sw control debug counter - * Add sw debug counter for QM. - * - * 03 07 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * rename the define to anti_pviracy. - * - * 03 06 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Sync BOW Driver to latest person development branch version.. - * - * 03 02 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * Add security check code. - * - * 03 01 2011 george.huang - * [WCXRP00000495] [MT6620 Wi-Fi][FW] Support pattern filter for unwanted ARP frames - * Fix compile issue - * - * 02 25 2011 george.huang - * [WCXRP00000497] [MT6620 Wi-Fi][FW] Change default UAPSD AC assignment - * Assign all AC default to be U-APSD enabled. - * - * 02 14 2011 wh.su - * [WCXRP00000432] [MT6620 Wi-Fi][Driver] Add STA privacy check at hotspot mode - * Let the privacy check at hotspot mode default enable. - * - * 02 09 2011 wh.su - * [WCXRP00000432] [MT6620 Wi-Fi][Driver] Add STA privacy check at hotspot mode - * adding the code for check STA privacy bit at AP mode, . - * - * 02 08 2011 cp.wu - * [WCXRP00000427] [MT6620 Wi-Fi][Driver] Modify veresion information to match with release revision number - * change version number to v1.2.0.0 for preparing v1.2 software package release. - * - * 02 01 2011 yarco.yang - * [WCXRP00000417] [MT6620 Driver] Chnage CFG_HANDLE_IST_IN_SDIO_CALLBACK from 1 to 0 for Interoperability - * . - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * - * 01 19 2011 wh.su - * [WCXRP00000370] [MT6620 Wi-Fi][Driver] Disable Rx RDG for workaround pre-N ccmp issue - * Not announce support Rx RDG for wokaround pre-N ccmp construct AAD issue.. - * - * 01 15 2011 puff.wen - * NULL - * Add Stress test - * - * 01 12 2011 cp.wu - * [WCXRP00000356] [MT6620 Wi-Fi][Driver] fill mac header length for security frames 'cause hardware header translation needs such information - * fill mac header length information for 802.1x frames. - * - * 01 11 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Support BOW only for Linux. - * - * 01 10 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Enable BOW and 4 physical links. - * - * 01 08 2011 yuche.tsai - * [WCXRP00000345] [MT6620][Volunteer Patch] P2P may issue a SSID specified scan request, but the SSID length is still invalid. - * Modify CFG_SLT_SUPPORT default value. - * - * 01 08 2011 yuche.tsai - * [WCXRP00000341] [MT6620][SLT] Create Branch for SLT SW. - * Update configure flag. - * - * 12 28 2010 cp.wu - * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release - * report EEPROM used flag via NIC_CAPABILITY - * - * 12 28 2010 cp.wu - * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release - * integrate with 'EEPROM used' flag for reporting correct capability to Engineer Mode/META and other tools - * - * 12 15 2010 yuche.tsai - * NULL - * Update SLT Descriptor number configure in driver. - * - * 12 13 2010 chinglan.wang - * NULL - * Add WPS 1.0 feature flag to enable the WPS 1.0 function. - * - * 11 23 2010 george.huang - * [WCXRP00000127] [MT6620 Wi-Fi][Driver] Add a registry to disable Beacon Timeout function for SQA test by using E1 EVB - * Enable PM function by default - * - * 11 15 2010 wh.su - * [WCXRP00000171] [MT6620 Wi-Fi][Driver] Add message check code same behavior as mt5921 - * use config.mk WAPI config define. - * - * 11 08 2010 wh.su - * [WCXRP00000171] [MT6620 Wi-Fi][Driver] Add message check code same behavior as mt5921 - * use the config.mk define. - * - * 11 01 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module - * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead - * 2) Remove CNM CH-RECOVER event handling - * 3) cfg read/write API renamed with kal prefix for unified naming rules. - * - * 11 01 2010 yarco.yang - * [WCXRP00000149] [MT6620 WI-Fi][Driver]Fine tune performance on MT6516 platform - * Add code to run WlanIST in SDIO callback. - * - * 10 26 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command - * 1) update NVRAM content template to ver 1.02 - * 2) add compile option for querying NIC capability (default: off) - * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting - * 4) correct auto-rate compiler error under linux (treat warning as error) - * 5) simplify usage of NVRAM and REG_INFO_T - * 6) add version checking between driver and firmware - * - * 10 25 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * add option for enable/disable TX PWR gain adjustment (default: off) - * - * 10 20 2010 wh.su - * [WCXRP00000067] [MT6620 Wi-Fi][Driver] Support the android+ WAPI function - * enable the WAPI compiling flag as default - * - * 10 19 2010 cp.wu - * [WCXRP00000122] [MT6620 Wi-Fi][Driver] Preparation for YuSu source tree integration - * remove HIF_SDIO_ONE flags because the settings could be merged for runtime detection instead of compile-time. - * - * 10 18 2010 cp.wu - * [WCXRP00000117] [MT6620 Wi-Fi][Driver] Add logic for suspending driver when MT6620 is not responding anymore - * 1. when wlanAdapterStop() failed to send POWER CTRL command to firmware, do not poll for ready bit dis-assertion - * 2. shorten polling count for shorter response time - * 3. if bad I/O operation is detected during TX resource polling, then further operation is aborted as well - * - * 10 18 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android - * complete implementation of Android NVRAM access - * - * 10 14 2010 wh.su - * [WCXRP00000102] [MT6620 Wi-Fi] [FW] Add a compiling flag and code for support Direct GO at Android - * Add a define CFG_TEST_ANDROID_DIRECT_GO compiling flag - * - * 10 08 2010 cm.chang - * NULL - * Remove unused compiling flags (TX_RDG and TX_SGI) - * - * 10 07 2010 cp.wu - * [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection - * add firmware download for MT5931. - * - * 10 05 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * load manufacture data when CFG_SUPPORT_NVRAM is set to 1 - * - * 10 05 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * 1) add NVRAM access API - * 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option) - * 3) add OID implementation for NVRAM read/write service - * - * 10 05 2010 yarco.yang - * [WCXRP00000082] [MT6620 Wi-Fi][Driver]High throughput performance tuning - * Change CFG_IST_LOOP_COUNT from 2 to 1 to reduce unnecessary SDIO bus access - * - * 09 24 2010 cp.wu - * [WCXRP00000057] [MT6620 Wi-Fi][Driver] Modify online scan to a run-time switchable feature - * Modify online scan as a run-time adjustable option (for Windows, in registry) - * - * 09 23 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * eliminate reference of CFG_RESPONSE_MAX_PKT_SIZE - * - * 09 20 2010 cm.chang - * NULL - * Disable RX STBC by BB HEC based on MT6620E1_PHY_BUG v05.docx - * - * 09 17 2010 chinglan.wang - * NULL - * Add performance test option - * - * 09 10 2010 chinglan.wang - * NULL - * Modify for Software Migration Phase 2.10 for E2 FPGA - * - * 09 07 2010 yuche.tsai - * NULL - * Add a CFG for max common IE buffer size. - * - * 09 01 2010 cp.wu - * NULL - * restore configuration as before. - * - * 09 01 2010 cp.wu - * NULL - * HIFSYS Clock Source Workaround - * - * 08 31 2010 kevin.huang - * NULL - * Use LINK LIST operation to process SCAN result - * - * 08 30 2010 chinglan.wang - * NULL - * Enable the MT6620_FPGA_BWCS value. - * - * 08 30 2010 chinglan.wang - * NULL - * Disable the FW encryption. - * - * 08 27 2010 chinglan.wang - * NULL - * Update configuration for MT6620_E1_PRE_ALPHA_1832_0827_2010 - * - * 08 26 2010 yuche.tsai - * NULL - * Add AT GO test configure mode under WinXP. - * Please enable 1. CFG_ENABLE_WIFI_DIRECT, 2. CFG_TEST_WIFI_DIRECT_GO, 3. CFG_SUPPORT_AAA - * - * 08 25 2010 cp.wu - * NULL - * add option for enabling AIS 5GHz scan - * - * 08 25 2010 george.huang - * NULL - * update OID/ registry control path for PM related settings - * - * 08 24 2010 cp.wu - * NULL - * 1) initialize variable for enabling short premable/short time slot. - * 2) add compile option for disabling online scan - * - * 08 24 2010 cm.chang - * NULL - * Support RLM initail channel of Ad-hoc, P2P and BOW - * - * 08 23 2010 cp.wu - * NULL - * revise constant definitions to be matched with implementation (original cmd-event definition is deprecated) - * - * 08 23 2010 chinghwa.yu - * NULL - * Disable BOW Test. - * - * 08 23 2010 jeffrey.chang - * NULL - * fix config.h typo - * - * 08 23 2010 chinghwa.yu - * NULL - * Update for BOW. - * - * 08 21 2010 jeffrey.chang - * NULL - * 1) add sdio two setting - * 2) bug fix of sdio glue - * - * 08 09 2010 wh.su - * NULL - * let the firmware download default enabled. - * - * 08 07 2010 wh.su - * NULL - * adding the privacy related code for P2P network - * - * 08 05 2010 yuche.tsai - * NULL - * Add a configure flag for P2P unitest. - * - * 07 23 2010 cp.wu - * - * 1) re-enable AIS-FSM beacon timeout handling. - * 2) scan done API revised - * - * 07 23 2010 cp.wu - * - * 1) enable Ad-Hoc - * 2) disable beacon timeout handling temporally due to unexpected beacon timeout event. - * - * 07 19 2010 wh.su - * - * update for security supporting. - * - * 07 19 2010 yuche.tsai - * - * Add for SLT support. - * - * 07 16 2010 cp.wu - * - * remove work-around in case SCN is not available. - * - * 07 14 2010 yarco.yang - * - * 1. Remove CFG_MQM_MIGRATION - * 2. Add CMD_UPDATE_WMM_PARMS command - * - * 07 13 2010 cp.wu - * - * 1) MMPDUs are now sent to MT6620 by CMD queue for keeping strict order of 1X/MMPDU/CMD packets - * 2) integrate with qmGetFrameAction() for deciding which MMPDU/1X could pass checking for sending - * 2) enhance CMD_INFO_T descriptor number from 10 to 32 to avoid descriptor underflow under concurrent network operation - * - * 07 09 2010 yarco.yang - * - * [MT6620 and MT5931] SW Migration: Add ADDBA support - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * take use of RLM module for parsing/generating HT IEs for 11n capability - * - * 07 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * for first connection, if connecting failed do not enter into scan state. - * - * 06 25 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * modify Beacon/ProbeResp to complete parsing, - * because host software has looser memory usage restriction - * - * 06 23 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) add SCN compilation option. - * 2) when SCN is not turned on, BSSID_SCAN will generate a fake entry for 1st connection - * - * 06 22 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) add command warpper for STA-REC/BSS-INFO sync. - * 2) enhance command packet sending procedure for non-oid part - * 3) add command packet definitions for STA-REC/BSS-INFO sync. - * - * 06 21 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * set default compiling flag for security disable. - * - * 06 21 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Support CFG_MQM_MIGRATION flag - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * enable RX management frame handling. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add scan_fsm into building. - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 15 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add scan.c. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add management dispatching function table. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * auth.c is migrated. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add bss.c. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) eliminate CFG_CMD_EVENT_VERSION_0_9 - * 2) when disconnected, indicate nic directly (no event is needed) - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge wlan_def.h. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 31 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add config option for cfg80211. - * - * 05 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * set ATIMwindow default value to zero. - * - * 05 21 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add option for FPGA_BWCS & FPGA_V5 - * - * 05 20 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) integrate OID_GEN_NETWORK_LAYER_ADDRESSES with CMD_ID_SET_IP_ADDRESS - * 2) buffer statistics data for 2 seconds - * 3) use default value for adhoc parameters instead of 0 - * - * 05 17 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) enable CMD/EVENT ver 0.9 definition. - * 2) abandon use of ENUM_MEDIA_STATE - * - * 05 17 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add CFG_STARTUP_DEBUG for debugging starting up issue. - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add basic handling framework for wireless extension ioctls. - * - * 05 11 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * change firmware name to WIFI_RAM_CODE. - * - * 05 07 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * disable bt-over-wifi configuration, turn it on after firmware finished implementation - * - * 04 27 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add multiple physical link support - * - * 04 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * surpress compiler warning - * - * 04 22 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * re-enable power management - * - * 04 22 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * - * 1) modify rx path code for supporting Wi-Fi direct - * 2) modify config.h since Linux dont need to consider retaining packet - * - * 04 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * enable TCP/IP checksum offloading by default. - * - * 04 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * set CFG_ENABLE_FULL_PM to 1 as default to - * 1) acquire own before hardware access - * 2) set own back after hardware access - * - * 04 15 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * change firmware name - * - * 04 07 2010 cp.wu - * [WPD00003827][MT6620 Wi-Fi] Chariot fail and following ping fail, no pkt send from driver - * disable RX-enhanced response temporally, it seems the CQ is not resolved yet. - * - * 04 06 2010 cp.wu - * [WPD00003827][MT6620 Wi-Fi] Chariot fail and following ping fail, no pkt send from driver - * re-enable RX enhanced mode as WPD00003827 is resolved. - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * turn off RX_ENHANCE mode by default. - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) eliminate unused definitions - * * 2) ready bit will be polled for limited iteration - * - * 04 02 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * firmware download: Linux uses different firmware path - * - * 04 01 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * change to use WIFI_TCM_ALWAYS_ON as firmware image - * - * 03 31 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * modify the wapi related code for new driver's design. - * - * 03 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add a temporary flag for integration with CMD/EVENT v0.9. - * - * 03 25 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * firmware download load adress & start address are now configured from config.h - * * due to the different configurations on FPGA and ASIC - * - * 03 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add options for full PM support. - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * [WPD00003826] Initial import for Linux port - * initial import for Linux port - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * [WPD00003826] Initial import for Linux port - * initial import for Linux port - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port - * - * 03 16 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * turn on FW-DOWNLOAD as default for release. - * - * 03 16 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * build up basic data structure and definitions to support BT-over-WiFi - * - * 03 12 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add two option for ACK and ENCRYPTION for firmware download - * - * 03 11 2010 cp.wu - * [WPD00003821][BUG] Host driver stops processing RX packets from HIF RX0 - * add RX starvation warning debug message controlled by CFG_HIF_RX_STARVATION_WARNING - * - * 03 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * code clean: removing unused variables and structure definitions - * - * 03 05 2010 cp.wu - * [WPD00003821][BUG] Host driver stops processing RX packets from HIF RX0 - * change CFG_NUM_OF_QM_RX_PKT_NUM to 120 - * - * 03 04 2010 cp.wu - * [WPD00003821][BUG] Host driver stops processing RX packets from HIF RX0 - * . - * - * 03 04 2010 cp.wu - * [WPD00003821][BUG] Host driver stops processing RX packets from HIF RX0 - * increase RX buffer number to avoid RX buffer starvation. - * - * 02 24 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Changed the number of STA_RECs to 20 - * - * 02 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add checksum offloading support. - * - * 02 11 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. add logic for firmware download - * * 2. firmware image filename and start/load address are now retrieved from registry - * - * 02 08 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * prepare for implementing fw download logic - * - * 12 30 2009 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) According to CMD/EVENT documentation v0.8, - * * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used, - * * and result is retrieved by get ATInfo instead - * * 2) add 4 counter for recording aggregation statistics -** \main\maintrunk.MT6620WiFiDriver_Prj\25 2009-12-16 22:12:28 GMT mtk02752 -** enable interrupt enhanced response, TX/RX Aggregation as default -** \main\maintrunk.MT6620WiFiDriver_Prj\24 2009-12-10 16:38:43 GMT mtk02752 -** eliminate compile options which are obsolete or for emulation purpose -** \main\maintrunk.MT6620WiFiDriver_Prj\23 2009-12-09 13:56:26 GMT MTK02468 -** Added RX buffer reordering configurations -** \main\maintrunk.MT6620WiFiDriver_Prj\22 2009-12-04 12:09:09 GMT mtk02752 -** once enhanced intr/rx reponse is taken, RX must be access in aggregated basis -** \main\maintrunk.MT6620WiFiDriver_Prj\21 2009-11-23 17:54:50 GMT mtk02752 -** correct a typo -** \main\maintrunk.MT6620WiFiDriver_Prj\20 2009-11-17 22:40:47 GMT mtk01084 -** add defines -** \main\maintrunk.MT6620WiFiDriver_Prj\19 2009-11-17 17:33:37 GMT mtk02752 -** add coalescing buffer definition for SD1_SD3_DATAPATH_INTEGRATION -** \main\maintrunk.MT6620WiFiDriver_Prj\18 2009-11-16 20:32:40 GMT mtk02752 -** add CFG_TX_MAX_PKT_NUM for limiting queued TX packet -** \main\maintrunk.MT6620WiFiDriver_Prj\17 2009-11-16 13:34:44 GMT mtk02752 -** add SD1_SD3_DATAPATH_INTEGRATION define for source control -** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-11-13 13:54:11 GMT mtk01084 -** enable INT enhance mode by default -** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-10-30 18:17:14 GMT mtk01084 -** add new define -** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-10-29 19:47:36 GMT mtk01084 -** not use HIF loopback mode -** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-10-13 21:58:33 GMT mtk01084 -** update for new macro define -** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-09-09 17:26:08 GMT mtk01084 -** add CFG_TEST_WITH_MT5921 -** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-05-18 21:02:30 GMT mtk01426 -** Update CFG_RX_COALESCING_BUFFER_SIZE -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-04-21 09:35:51 GMT mtk01461 -** Add CFG_TX_DBG_MGT_BUF to debug MGMT Buffer depth -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-04-14 15:52:21 GMT mtk01426 -** Add OOB_DATA_PRE_FIXED_LEN define -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-04-08 16:51:08 GMT mtk01084 -** update for FW download part -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-01 10:33:37 GMT mtk01461 -** Add SW pre test flag CFG_HIF_LOOPBACK_PRETEST -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-03-23 00:29:18 GMT mtk01461 -** Fix CFG_COALESCING_BUFFER_SIZE if enable the CFG_TX_FRAGMENT -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-03-18 20:58:34 GMT mtk01426 -** Add CFG_HIF_LOOPBACK and CFG_SDIO_RX_ENHANCE -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-17 20:17:36 GMT mtk01426 -** Add CMD/Response related configure -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-16 09:08:21 GMT mtk01461 -** Update TX PATH API -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:11:21 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _CONFIG_H -#define _CONFIG_H -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -/** -#ifndef MT6620 -#define MT6620 -#endif - -#ifdef MT5931 -#undef MT5931 -#endif - -#ifdef MT6628 -#undef MT6628 -#endif -***/ //mark skynine comment - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -//2 Flags for OS capability - -#ifdef LINUX - #ifdef CONFIG_X86 - #define MTK_WCN_HIF_SDIO 0 - #else - #define MTK_WCN_HIF_SDIO 0 - #endif -#else - #define MTK_WCN_HIF_SDIO 0 -#endif - -#if (CFG_SUPPORT_AEE == 1) - #define CFG_ENABLE_AEE_MSG 1 -#else - #define CFG_ENABLE_AEE_MSG 0 -#endif - -//2 Flags for Driver Features -#define CFG_TX_FRAGMENT 1 /*!< 1: Enable TX fragmentation - 0: Disable */ -#define CFG_SUPPORT_PERFORMANCE_TEST 0 /*Only for performance Test*/ - -#define CFG_COUNTRY_CODE NULL //"US" - -#ifndef LINUX - #define CFG_FW_FILENAME L"WIFI_RAM_CODE" - #define CFG_FW_FILENAME_E6 L"WIFI_RAM_CODE_E6" -#else - #define CFG_FW_FILENAME "WIFI_RAM_CODE" -#endif - -#define CFG_SUPPORT_802_11D 1 /*!< 1(default): Enable 802.11d - 0: Disable */ - -#define CFG_SUPPORT_SPEC_MGMT 0 /* Spectrum Management (802.11h): TPC and DFS */ -#define CFG_SUPPORT_RRM 0 /* Radio Reasource Measurement (802.11k) */ -#define CFG_SUPPORT_QUIET 0 /* Quiet (802.11h) */ - - -#define CFG_SUPPORT_RX_RDG 0 /* 11n feature. RX RDG capability */ -#define CFG_SUPPORT_MFB 0 /* 802.11n MCS Feedback responder */ -#define CFG_SUPPORT_RX_STBC 1 /* 802.11n RX STBC (1SS) */ -#define CFG_SUPPORT_RX_SGI 1 /* 802.11n RX short GI for both 20M and 40M BW */ -#define CFG_SUPPORT_RX_HT_GF 1 /* 802.11n RX HT green-field capability */ - -/*------------------------------------------------------------------------------ - * SLT Option - *------------------------------------------------------------------------------ - */ -#define CFG_SLT_SUPPORT 0 - - -#ifdef NDIS60_MINIPORT - #define CFG_NATIVE_802_11 1 - - #define CFG_TX_MAX_PKT_SIZE 2304 - #define CFG_TCP_IP_CHKSUM_OFFLOAD_NDIS_60 0 /* !< 1: Enable TCP/IP header checksum offload - 0: Disable */ - #define CFG_TCP_IP_CHKSUM_OFFLOAD 0 - #define CFG_WHQL_DOT11_STATISTICS 1 - #define CFG_WHQL_ADD_REMOVE_KEY 1 - #define CFG_WHQL_CUSTOM_IE 1 - #define CFG_WHQL_SAFE_MODE_ENABLED 1 - -#else - #define CFG_TCP_IP_CHKSUM_OFFLOAD 1 /* !< 1: Enable TCP/IP header checksum offload - 0: Disable */ - #define CFG_TCP_IP_CHKSUM_OFFLOAD_NDIS_60 0 - #define CFG_TX_MAX_PKT_SIZE 1600 - #define CFG_NATIVE_802_11 0 -#endif - - -//2 Flags for Driver Parameters -/*------------------------------------------------------------------------------ - * Flags for EHPI Interface in Colibri Platform - *------------------------------------------------------------------------------ - */ -#define CFG_EHPI_FASTER_BUS_TIMING 0 /*!< 1: Do workaround for faster bus timing - 0(default): Disable */ - -/*------------------------------------------------------------------------------ - * Flags for HIFSYS Interface - *------------------------------------------------------------------------------ - */ -#ifdef _lint - #define _HIF_SDIO 1 -#endif - -#define CFG_SDIO_INTR_ENHANCE 1 /*!< 1(default): Enable SDIO ISR & TX/RX status enhance mode - 0: Disable */ -#define CFG_SDIO_RX_ENHANCE 0 /*!< 1(default): Enable SDIO ISR & TX/RX status enhance mode - 0: Disable */ -#define CFG_SDIO_TX_AGG 1 /*!< 1: Enable SDIO TX enhance mode(Multiple frames in single BLOCK CMD) - 0(default): Disable */ - -#define CFG_SDIO_RX_AGG 1 /*!< 1: Enable SDIO RX enhance mode(Multiple frames in single BLOCK CMD) - 0(default): Disable */ - -#if (CFG_SDIO_RX_AGG == 1) && (CFG_SDIO_INTR_ENHANCE == 0) - #error "CFG_SDIO_INTR_ENHANCE should be 1 once CFG_SDIO_RX_AGG equals to 1" -#elif (CFG_SDIO_INTR_ENHANCE == 1 || CFG_SDIO_RX_ENHANCE == 1) && (CFG_SDIO_RX_AGG == 0) - #error "CFG_SDIO_RX_AGG should be 1 once CFG_SDIO_INTR_ENHANCE and/or CFG_SDIO_RX_ENHANCE equals to 1" -#endif - -#define CFG_SDIO_MAX_RX_AGG_NUM 0 /*!< 1: Setting the maximum RX aggregation number - 0(default): no limited */ - -#ifdef WINDOWS_CE - #define CFG_SDIO_PATHRU_MODE 1 /*!< 1: Suport pass through (PATHRU) mode - 0: Disable */ -#else - #define CFG_SDIO_PATHRU_MODE 0 /*!< 0: Always disable if WINDOWS_CE is not defined */ -#endif - -#define CFG_MAX_RX_ENHANCE_LOOP_COUNT 3 - - -/*------------------------------------------------------------------------------ - * Flags and Parameters for Integration - *------------------------------------------------------------------------------ - */ -#if defined(MT6620) - #define MT6620_FPGA_BWCS 0 - #define MT6620_FPGA_V5 0 - - #if (MT6620_FPGA_BWCS == 1) && (MT6620_FPGA_V5 == 1) - #error - #endif - - #if (MTK_WCN_HIF_SDIO == 1) - #define CFG_MULTI_ECOVER_SUPPORT 1 - #elif !defined(LINUX) - #define CFG_MULTI_ECOVER_SUPPORT 1 - #else - #define CFG_MULTI_ECOVER_SUPPORT 0 - #endif - - #define CFG_ENABLE_CAL_LOG 0 - #define CFG_REPORT_RFBB_VERSION 0 -#elif defined(MT5931) - -#define CFG_MULTI_ECOVER_SUPPORT 0 -#define CFG_ENABLE_CAL_LOG 0 -#define CFG_REPORT_RFBB_VERSION 0 - -#elif defined(MT6628) - -#define CFG_MULTI_ECOVER_SUPPORT 0 - -#define CFG_ENABLE_CAL_LOG 1 -#define CFG_REPORT_RFBB_VERSION 1 - -#endif - -#if (MTK_WCN_HIF_SDIO == 1) -#define CFG_CHIP_RESET_SUPPORT 1 -#else -#define CFG_CHIP_RESET_SUPPORT 0 -#endif - - -/*------------------------------------------------------------------------------ - * Flags for workaround - *------------------------------------------------------------------------------ - */ -#if defined(MT6620) && (MT6620_FPGA_BWCS == 0) && (MT6620_FPGA_V5 == 0) - #define MT6620_E1_ASIC_HIFSYS_WORKAROUND 0 -#else - #define MT6620_E1_ASIC_HIFSYS_WORKAROUND 0 -#endif - -/*------------------------------------------------------------------------------ - * Flags for driver version - *------------------------------------------------------------------------------ - */ -#define CFG_DRV_OWN_VERSION ((UINT_16)((NIC_DRIVER_MAJOR_VERSION << 8) | (NIC_DRIVER_MINOR_VERSION))) -#define CFG_DRV_PEER_VERSION ((UINT_16)0x0000) - - -/*------------------------------------------------------------------------------ - * Flags for TX path which are OS dependent - *------------------------------------------------------------------------------ - */ -/*! NOTE(Kevin): If the Network buffer is non-scatter-gather like structure(without - * NETIF_F_FRAGLIST in LINUX), then we can set CFG_TX_BUFFER_IS_SCATTER_LIST to "0" - * for zero copy TX packets. - * For scatter-gather like structure, we set "1", driver will do copy frame to - * internal coalescing buffer before write it to FIFO. - */ -#if defined(LINUX) - #define CFG_TX_BUFFER_IS_SCATTER_LIST 1 /*!< 1: Do frame copy before write to TX FIFO. - Used when Network buffer is scatter-gather. - 0(default): Do not copy frame */ -#else /* WINDOWS/WINCE */ - #define CFG_TX_BUFFER_IS_SCATTER_LIST 1 -#endif /* LINUX */ - - -#if CFG_SDIO_TX_AGG || CFG_TX_BUFFER_IS_SCATTER_LIST - #define CFG_COALESCING_BUFFER_SIZE (CFG_TX_MAX_PKT_SIZE * NIC_TX_BUFF_SUM) -#else - #define CFG_COALESCING_BUFFER_SIZE (CFG_TX_MAX_PKT_SIZE) -#endif /* CFG_SDIO_TX_AGG || CFG_TX_BUFFER_IS_SCATTER_LIST */ - -/*------------------------------------------------------------------------------ - * Flags and Parameters for TX path - *------------------------------------------------------------------------------ - */ - -/*! Maximum number of SW TX packet queue */ -#define CFG_TX_MAX_PKT_NUM 256 - -/*! Maximum number of SW TX CMD packet buffer */ -#define CFG_TX_MAX_CMD_PKT_NUM 32 - -/*! Maximum number of associated STAs */ -#define CFG_NUM_OF_STA_RECORD 20 - -/*------------------------------------------------------------------------------ - * Flags and Parameters for RX path - *------------------------------------------------------------------------------ - */ - -/*! Max. descriptor number - sync. with firmware */ -#if CFG_SLT_SUPPORT -#define CFG_NUM_OF_RX0_HIF_DESC 42 -#else -#define CFG_NUM_OF_RX0_HIF_DESC 16 -#endif -#define CFG_NUM_OF_RX1_HIF_DESC 2 - -/*! Max. buffer hold by QM */ -#define CFG_NUM_OF_QM_RX_PKT_NUM 120 - -/*! Maximum number of SW RX packet buffer */ -#define CFG_RX_MAX_PKT_NUM ((CFG_NUM_OF_RX0_HIF_DESC + CFG_NUM_OF_RX1_HIF_DESC) * 3 \ - + CFG_NUM_OF_QM_RX_PKT_NUM) - -#define CFG_RX_REORDER_Q_THRESHOLD 8 - -#ifndef LINUX -#define CFG_RX_RETAINED_PKT_THRESHOLD (CFG_NUM_OF_RX0_HIF_DESC + CFG_NUM_OF_RX1_HIF_DESC + CFG_NUM_OF_QM_RX_PKT_NUM) -#else -#define CFG_RX_RETAINED_PKT_THRESHOLD 0 -#endif - -/*! Maximum RX packet size, if exceed this value, drop incoming packet */ -/* 7.2.3 Maganement frames */ -#define CFG_RX_MAX_PKT_SIZE ( 28 + 2312 + 12 /*HIF_RX_HEADER_T*/ ) //TODO: it should be 4096 under emulation mode - -/*! Minimum RX packet size, if lower than this value, drop incoming packet */ -#define CFG_RX_MIN_PKT_SIZE 10 /*!< 802.11 Control Frame is 10 bytes */ - -#if CFG_SDIO_RX_AGG - /* extra size for CS_STATUS and enhanced response */ - #define CFG_RX_COALESCING_BUFFER_SIZE ((CFG_NUM_OF_RX0_HIF_DESC + 1) \ - * CFG_RX_MAX_PKT_SIZE) -#else - #define CFG_RX_COALESCING_BUFFER_SIZE (CFG_RX_MAX_PKT_SIZE) -#endif - -/*! RX BA capability */ -#define CFG_NUM_OF_RX_BA_AGREEMENTS 8 -#define CFG_RX_BA_MAX_WINSIZE 16 -#define CFG_RX_BA_INC_SIZE 4 -#define CFG_RX_MAX_BA_TID_NUM 8 -#define CFG_RX_REORDERING_ENABLED 1 - -/*------------------------------------------------------------------------------ - * Flags and Parameters for CMD/RESPONSE - *------------------------------------------------------------------------------ - */ -#define CFG_RESPONSE_POLLING_TIMEOUT 512 - - -/*------------------------------------------------------------------------------ - * Flags and Parameters for Protocol Stack - *------------------------------------------------------------------------------ - */ -/*! Maximum number of BSS in the SCAN list */ -#define CFG_MAX_NUM_BSS_LIST 64 - -#define CFG_MAX_COMMON_IE_BUF_LEN (1500 * CFG_MAX_NUM_BSS_LIST) / 3 - -/*! Maximum size of IE buffer of each SCAN record */ -#define CFG_IE_BUFFER_SIZE 512 - -/*! Maximum number of STA records */ -#define CFG_MAX_NUM_STA_RECORD 32 - - - -/*------------------------------------------------------------------------------ - * Flags and Parameters for Power management - *------------------------------------------------------------------------------ - */ -#define CFG_ENABLE_FULL_PM 1 -#define CFG_ENABLE_WAKEUP_ON_LAN 0 - -#define CFG_INIT_POWER_SAVE_PROF ENUM_PSP_FAST_SWITCH - -#define CFG_INIT_ENABLE_PATTERN_FILTER_ARP 0 - -#define CFG_INIT_UAPSD_AC_BMP 0//(BIT(3) | BIT(2) | BIT(1) | BIT(0)) - -//#define CFG_SUPPORT_WAPI 0 -#define CFG_SUPPORT_WPS 1 -#define CFG_SUPPORT_WPS2 1 - -/*------------------------------------------------------------------------------ - * 802.11i RSN Pre-authentication PMKID cahce maximun number - *------------------------------------------------------------------------------ - */ -#define CFG_MAX_PMKID_CACHE 16 /*!< max number of PMKID cache - 16(default) : The Max PMKID cache */ - -/*------------------------------------------------------------------------------ - * Flags and Parameters for Ad-Hoc - *------------------------------------------------------------------------------ - */ -#define CFG_INIT_ADHOC_FREQ (2462000) -#define CFG_INIT_ADHOC_MODE AD_HOC_MODE_MIXED_11BG -#define CFG_INIT_ADHOC_BEACON_INTERVAL (100) -#define CFG_INIT_ADHOC_ATIM_WINDOW (0) - - -/*------------------------------------------------------------------------------ - * Flags and Parameters for Load Setup Default - *------------------------------------------------------------------------------ - */ - -/*------------------------------------------------------------------------------ - * Flags for enable 802.11A Band setting - *------------------------------------------------------------------------------ - */ - -/*------------------------------------------------------------------------------ - * Flags and Parameters for Interrupt Process - *------------------------------------------------------------------------------ - */ -#if defined(_HIF_SDIO) && defined(WINDOWS_CE) - #define CFG_IST_LOOP_COUNT 1 -#else - #define CFG_IST_LOOP_COUNT 1 -#endif /* _HIF_SDIO */ - -#define CFG_INT_WRITE_CLEAR 0 - -#if defined(LINUX) -#define CFG_DBG_GPIO_PINS 0 /* if 1, use MT6516 GPIO pin to log TX behavior */ -#endif - -//2 Flags for Driver Debug Options -/*------------------------------------------------------------------------------ - * Flags of TX Debug Option. NOTE(Kevin): Confirm with SA before modifying following flags. - *------------------------------------------------------------------------------ - */ -#define CFG_DBG_MGT_BUF 1 /*!< 1: Debug statistics usage of MGMT Buffer - 0: Disable */ - -#define CFG_HIF_STATISTICS 0 - -#define CFG_HIF_RX_STARVATION_WARNING 0 - -#define CFG_STARTUP_DEBUG 0 - -#define CFG_RX_PKTS_DUMP 1 - -/*------------------------------------------------------------------------------ - * Flags of Firmware Download Option. - *------------------------------------------------------------------------------ - */ -#define CFG_ENABLE_FW_DOWNLOAD 1 - -#define CFG_ENABLE_FW_DOWNLOAD_ACK 1 -#define CFG_ENABLE_FW_ENCRYPTION 1 - -#if defined(MT6620) || defined(MT6628) - #define CFG_ENABLE_FW_DOWNLOAD_AGGREGATION 0 - #define CFG_ENABLE_FW_DIVIDED_DOWNLOAD 1 -#else - #define CFG_ENABLE_FW_DOWNLOAD_AGGREGATION 0 - #define CFG_ENABLE_FW_DIVIDED_DOWNLOAD 0 -#endif - - - -#if defined(MT6620) - #if MT6620_FPGA_BWCS - #define CFG_FW_LOAD_ADDRESS 0x10014000 - #define CFG_OVERRIDE_FW_START_ADDRESS 0 - #define CFG_FW_START_ADDRESS 0x10014001 - #elif MT6620_FPGA_V5 - #define CFG_FW_LOAD_ADDRESS 0x10008000 - #define CFG_OVERRIDE_FW_START_ADDRESS 0 - #define CFG_FW_START_ADDRESS 0x10008001 - #else - #define CFG_FW_LOAD_ADDRESS 0x10008000 - #define CFG_OVERRIDE_FW_START_ADDRESS 0 - #define CFG_FW_START_ADDRESS 0x10008001 - #endif -#elif defined(MT5931) - #define CFG_FW_LOAD_ADDRESS 0xFF900000 - #define CFG_FW_START_ADDRESS 0x00000000 -#elif defined(MT6628) - #define CFG_FW_LOAD_ADDRESS 0x00060000 - #define CFG_OVERRIDE_FW_START_ADDRESS 0 - #define CFG_FW_START_ADDRESS 0x00060000 -#endif - - -/*------------------------------------------------------------------------------ - * Flags of Bluetooth-over-WiFi (BT 3.0 + HS) support - *------------------------------------------------------------------------------ - */ - -#ifdef LINUX - #ifdef CONFIG_X86 - #define CFG_ENABLE_BT_OVER_WIFI 0 - #else - #define CFG_ENABLE_BT_OVER_WIFI 1 - #endif -#else - #define CFG_ENABLE_BT_OVER_WIFI 0 -#endif - -#define CFG_BOW_SEPARATE_DATA_PATH 1 - -#define CFG_BOW_PHYSICAL_LINK_NUM 4 - -#define CFG_BOW_TEST 0 - -#define CFG_BOW_LIMIT_AIS_CHNL 1 - -#define CFG_BOW_SUPPORT_11N 0 - -#define CFG_BOW_RATE_LIMITATION 1 - -/*------------------------------------------------------------------------------ - * Flags of Wi-Fi Direct support - *------------------------------------------------------------------------------ - */ -#ifdef LINUX - #ifdef CONFIG_X86 - #define CFG_ENABLE_WIFI_DIRECT 0 - #define CFG_SUPPORT_802_11W 0 - #else - #define CFG_ENABLE_WIFI_DIRECT 1 - #define CFG_SUPPORT_802_11W 0 /*!< 0(default): Disable 802.11W */ - #endif -#else - #define CFG_ENABLE_WIFI_DIRECT 0 - #define CFG_SUPPORT_802_11W 0 /* Not support at WinXP */ -#endif - -#define CFG_SUPPORT_PERSISTENT_GROUP 0 - -#define CFG_TEST_WIFI_DIRECT_GO 0 - -#define CFG_TEST_ANDROID_DIRECT_GO 0 - -#define CFG_UNITEST_P2P 0 - -/* - * Enable cfg80211 option after Android 2.2(Froyo) is suggested, - * cfg80211 on linux 2.6.29 is not mature yet - */ -#define CFG_ENABLE_WIFI_DIRECT_CFG_80211 1 - -/*------------------------------------------------------------------------------ - * Configuration Flags (Linux Only) - *------------------------------------------------------------------------------ - */ -#define CFG_SUPPORT_EXT_CONFIG 0 - -/*------------------------------------------------------------------------------ - * Statistics Buffering Mechanism - *------------------------------------------------------------------------------ - */ -#if CFG_SUPPORT_PERFORMANCE_TEST -#define CFG_ENABLE_STATISTICS_BUFFERING 1 -#else -#define CFG_ENABLE_STATISTICS_BUFFERING 0 -#endif -#define CFG_STATISTICS_VALID_CYCLE 2000 -#define CFG_LINK_QUALITY_VALID_PERIOD 5000 - -/*------------------------------------------------------------------------------ - * Migration Option - *------------------------------------------------------------------------------ - */ -#define CFG_SUPPORT_ADHOC 1 -#define CFG_SUPPORT_AAA 1 - - -#if (defined(MT5931) && defined(LINUX)) -#define CFG_SUPPORT_BCM 1 -#define CFG_SUPPORT_BCM_BWCS 1 -#define CFG_SUPPORT_BCM_BWCS_DEBUG 1 -#else -#define CFG_SUPPORT_BCM 0 -#define CFG_SUPPORT_BCM_BWCS 0 -#define CFG_SUPPORT_BCM_BWCS_DEBUG 0 -#endif - -#define CFG_SUPPORT_RDD_TEST_MODE 0 - -#define CFG_SUPPORT_PWR_MGT 1 - -#define CFG_RSN_MIGRATION 1 - -#define CFG_PRIVACY_MIGRATION 1 - -#define CFG_ENABLE_HOTSPOT_PRIVACY_CHECK 1 - -#define CFG_MGMT_FRAME_HANDLING 1 - -#define CFG_MGMT_HW_ACCESS_REPLACEMENT 0 - -#if CFG_SUPPORT_PERFORMANCE_TEST - -#else - -#endif - -#define CFG_SUPPORT_AIS_5GHZ 1 -#define CFG_SUPPORT_BEACON_CHANGE_DETECTION 0 - -/*------------------------------------------------------------------------------ - * Option for NVRAM and Version Checking - *------------------------------------------------------------------------------ - */ -#define CFG_SUPPORT_NVRAM 0 -#define CFG_NVRAM_EXISTENCE_CHECK 1 -#define CFG_SW_NVRAM_VERSION_CHECK 0 -#define CFG_SUPPORT_NIC_CAPABILITY 1 - - -/*------------------------------------------------------------------------------ - * CONFIG_TITLE : Stress Test Option - * OWNER : Puff Wen - * Description : For stress test only. DO NOT enable it while normal operation - *------------------------------------------------------------------------------ - */ -#define CFG_STRESS_TEST_SUPPORT 0 - -/*------------------------------------------------------------------------------ - * Flags for LINT - *------------------------------------------------------------------------------ - */ -#define LINT_SAVE_AND_DISABLE /*lint -save -e* */ - -#define LINT_RESTORE /*lint -restore */ - -#define LINT_EXT_HEADER_BEGIN LINT_SAVE_AND_DISABLE - -#define LINT_EXT_HEADER_END LINT_RESTORE - -/*------------------------------------------------------------------------------ - * Flags of Features - *------------------------------------------------------------------------------ - */ - -#define CFG_SUPPORT_QOS 1 /* Enable/disable QoS TX, AMPDU */ -#define CFG_SUPPORT_AMPDU_TX 1 -#define CFG_SUPPORT_AMPDU_RX 1 -#define CFG_SUPPORT_TSPEC 0 /* Enable/disable TS-related Action frames handling */ -#define CFG_SUPPORT_UAPSD 1 -#define CFG_SUPPORT_UL_PSMP 0 - -#define CFG_SUPPORT_ROAMING 0 /* Roaming System */ -#define CFG_SUPPORT_SWCR 1 - -#define CFG_SUPPORT_ANTI_PIRACY 1 - -#define CFG_SUPPORT_OSC_SETTING 1 - -#if defined(MT5931) -#define CFG_SUPPORT_WHOLE_CHIP_RESET 1 /* for e3 chip only */ -#endif - -#define CFG_SUPPORT_P2P_RSSI_QUERY 0 - -#define CFG_SHOW_MACADDR_SOURCE 1 - -#define CFG_SUPPORT_802_11V 0 /* Support 802.11v Wireless Network Management */ -#define CFG_SUPPORT_802_11V_TIMING_MEASUREMENT 0 -#if (CFG_SUPPORT_802_11V_TIMING_MEASUREMENT == 1) && (CFG_SUPPORT_802_11V == 0) - #error "CFG_SUPPORT_802_11V should be 1 once CFG_SUPPORT_802_11V_TIMING_MEASUREMENT equals to 1" -#endif -#if (CFG_SUPPORT_802_11V == 0) -#define WNM_UNIT_TEST 0 -#endif - -#define CFG_DRIVER_COMPOSE_ASSOC_REQ 1 - -#define CFG_STRICT_CHECK_CAPINFO_PRIVACY 0 - -/*------------------------------------------------------------------------------ - * Flags of bus error tolerance - *------------------------------------------------------------------------------ - */ -#define CFG_FORCE_RESET_UNDER_BUS_ERROR 0 - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#endif /* _CONFIG_H */ - - diff --git a/drivers/net/wireless/mt5931/include/debug.h b/drivers/net/wireless/mt5931/include/debug.h deleted file mode 100755 index 3d5f03e16d0d..000000000000 --- a/drivers/net/wireless/mt5931/include/debug.h +++ /dev/null @@ -1,517 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/debug.h#1 $ -*/ - -/*! \file debug.h - \brief Definition of SW debugging level. - - In this file, it describes the definition of various SW debugging levels and - assert functions. -*/ - - - -/* -** $Log: debug.h $ - * - * 12 16 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * fixed the Windows DDK free build compiling error. - * - * 11 24 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * Adjust code for DBG and CONFIG_XLOG. - * - * 11 11 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * modify the xlog related code. - * - * 11 10 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * Using the new XLOG define for dum Memory. - * - * 11 03 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * Add dumpMemory8 at XLOG support. - * - * 11 02 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * adding the code for XLOG. - * - * 08 31 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * . - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * - * 01 07 2011 wh.su - * [WCXRP00000326] [MT6620][Wi-Fi][Driver] check in the binary format gl_sec.o.new instead of use change type!!! - * . - * - * 09 23 2010 cp.wu - * NULL - * add BOW index for debugging message and passing compilation - * - * 07 20 2010 wh.su - * - * adding the wapi code. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 21 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Support CFG_MQM_MIGRATION flag - * - * 06 17 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Add one more debug moduel for P2P. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add management dispatching function table. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add bss.c. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add debug module index for cnm and ais. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 17 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add CFG_STARTUP_DEBUG for debugging starting up issue. - * - * 04 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) surpress compiler warning - * 2) when acqruing LP-own, keep writing WHLPCR whenever OWN is not acquired yet -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-10-29 19:47:50 GMT mtk01084 -** add emu catagory -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-04-17 18:12:04 GMT mtk01426 -** Don't use dynamic memory allocate for debug message -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:11:29 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _DEBUG_H -#define _DEBUG_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ -#ifndef BUILD_QA_DBG -#define BUILD_QA_DBG 0 -#endif - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "gl_typedef.h" -#if CFG_SUPPORT_XLOG -#include "linux/xlog.h" -#endif - -extern UINT_8 aucDebugModule[]; -extern UINT_32 u4DebugModule; - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -/* Define debug category (class): - * (1) ERROR (2) WARN (3) STATE (4) EVENT (5) TRACE (6) INFO (7) LOUD (8) TEMP - */ -#define DBG_CLASS_ERROR BIT(0) -#define DBG_CLASS_WARN BIT(1) -#define DBG_CLASS_STATE BIT(2) -#define DBG_CLASS_EVENT BIT(3) -#define DBG_CLASS_TRACE BIT(4) -#define DBG_CLASS_INFO BIT(5) -#define DBG_CLASS_LOUD BIT(6) -#define DBG_CLASS_TEMP BIT(7) -#define DBG_CLASS_MASK BITS(0,7) - - -#if defined(LINUX) -#define DBG_PRINTF_64BIT_DEC "lld" - -#else //Windows -#define DBG_PRINTF_64BIT_DEC "I64d" - -#endif -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -/* Define debug module index */ -typedef enum _ENUM_DBG_MODULE_T { - DBG_INIT_IDX = 0, /* For driver initial */ - DBG_HAL_IDX, /* For HAL(HW) Layer */ - DBG_INTR_IDX, /* For Interrupt */ - DBG_REQ_IDX, - DBG_TX_IDX, - DBG_RX_IDX, - DBG_RFTEST_IDX, /* For RF test mode*/ - DBG_EMU_IDX, /* Developer specific */ - - DBG_SW1_IDX, /* Developer specific */ - DBG_SW2_IDX, /* Developer specific */ - DBG_SW3_IDX, /* Developer specific */ - DBG_SW4_IDX, /* Developer specific */ - - DBG_HEM_IDX, /* HEM */ - DBG_AIS_IDX, /* AIS */ - DBG_RLM_IDX, /* RLM */ - DBG_MEM_IDX, /* RLM */ - DBG_CNM_IDX, /* CNM */ - DBG_RSN_IDX, /* RSN */ - DBG_BSS_IDX, /* BSS */ - DBG_SCN_IDX, /* SCN */ - DBG_SAA_IDX, /* SAA */ - DBG_AAA_IDX, /* AAA */ - DBG_P2P_IDX, /* P2P */ - DBG_QM_IDX, /* QUE_MGT */ - DBG_SEC_IDX, /* SEC */ - DBG_BOW_IDX, /* BOW */ - DBG_WAPI_IDX, /* WAPI */ - DBG_ROAMING_IDX, /* ROAMING */ - - DBG_MODULE_NUM /* Notice the XLOG check */ -} ENUM_DBG_MODULE_T; - -//XLOG -//#define XLOG_DBG_MODULE_IDX 28 /* DBG_MODULE_NUM */ -//#if (XLOG_DBG_MODULE_IDX != XLOG_DBG_MODULE_IDX) -//#error "Please modify the DBG_MODULE_NUM and make sure this include at XLOG" -//#endif - -/* Define who owns developer specific index */ -#define DBG_YARCO_IDX DBG_SW1_IDX -#define DBG_KEVIN_IDX DBG_SW2_IDX -#define DBG_CMC_IDX DBG_SW3_IDX -#define DBG_GEORGE_IDX DBG_SW4_IDX - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -/* Debug print format string for the OS system time */ -#define OS_SYSTIME_DBG_FORMAT "0x%08x" - -/* Debug print argument for the OS system time */ -#define OS_SYSTIME_DBG_ARGUMENT(systime) (systime) - -/* Debug print format string for the MAC Address */ -#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" - -/* Debug print argument for the MAC Address */ -#define MAC2STR(a) ((PUINT_8)a)[0], ((PUINT_8)a)[1], ((PUINT_8)a)[2], \ - ((PUINT_8)a)[3], ((PUINT_8)a)[4], ((PUINT_8)a)[5] - -/* The pre-defined format to dump the value of a varaible with its name shown. */ -#define DUMPVAR(variable, format) (#variable " = " format "\n", variable) - -/* The pre-defined format to dump the MAC type value with its name shown. */ -#define DUMPMACADDR(addr) (#addr " = " MACSTR "\n", MAC2STR(addr)) - - -/* Basiclly, we just do renaming of KAL functions although they should - * be defined as "Nothing to do" if DBG=0. But in some compiler, the macro - * syntax does not support #define LOG_FUNC(x,...) - * - * A caller shall not invoke these three macros when DBG=0. - */ -#define LOG_FUNC_TIME kalPrint -#define LOG_FUNC kalPrint - -#if DBG - - #define TMP_BUF_LEN 256 - #define TMP_WBUF_LEN (TMP_BUF_LEN * 2) - - extern PINT_16 g_wbuf_p; - extern PINT_8 g_buf_p; - - /* If __FUNCTION__ is already defined by compiler, we just use it. */ - #if defined(__FUNCTION__) - #define DEBUGFUNC(_Func) - #else - #define DEBUGFUNC(_Func) static const char __FUNCTION__[] = _Func; - #endif - - /* The following macros are used for future debug message. */ - /* TODO(Kevin): We should remove INITLOG/ERRORLOG/WARNLOG macro sooner or later */ - #define INITLOG(_Fmt) \ - { \ - if (aucDebugModule[DBG_INIT_IDX] & DBG_CLASS_TRACE) { \ - LOG_FUNC("%s: ", __FUNCTION__); \ - LOG_FUNC _Fmt; \ - } \ - } - - #define ERRORLOG(_Fmt) \ - { \ - if (aucDebugModule[DBG_INIT_IDX] & DBG_CLASS_ERROR) { \ - LOG_FUNC("**Error[%s:%d]-", __FILE__, __LINE__); \ - LOG_FUNC _Fmt; \ - } \ - } - - #define WARNLOG(_Fmt) \ - { \ - if (aucDebugModule[DBG_INIT_IDX] & DBG_CLASS_WARN) { \ - LOG_FUNC("**Warning[%s:%d]-", __FILE__, __LINE__); \ - LOG_FUNC _Fmt; \ - } \ - } - - /*lint -save -e960 Multiple use of '#/##' */ - #define DBGLOG(_Module, _Class, _Fmt) \ - { \ - if (aucDebugModule[DBG_##_Module##_IDX] & DBG_CLASS_##_Class) { \ - if (DBG_CLASS_##_Class == DBG_CLASS_ERROR) { \ - LOG_FUNC_TIME("**Error[%s:%d]-", __FILE__, __LINE__); \ - LOG_FUNC("%s: (" #_Module " " #_Class ") ", __FUNCTION__); \ - } \ - else if (DBG_CLASS_##_Class == DBG_CLASS_WARN) { \ - LOG_FUNC_TIME("**Warning[%s:%d]-", __FILE__, __LINE__); \ - LOG_FUNC("%s: (" #_Module " " #_Class ") ", __FUNCTION__); \ - } \ - else if (DBG_CLASS_##_Class == DBG_CLASS_EVENT) { \ - } \ - else { \ - LOG_FUNC_TIME("%s: (" #_Module " " #_Class ") ", __FUNCTION__); \ - } \ - LOG_FUNC _Fmt; \ - } \ - } - - #define DBGLOG_MEM8(_Module, _Class, _StartAddr, _Length) \ - { \ - if (aucDebugModule[DBG_##_Module##_IDX] & DBG_CLASS_##_Class) { \ - LOG_FUNC("%s: (" #_Module " " #_Class ")\n", __FUNCTION__); \ - dumpMemory8((PUINT_8) (_StartAddr), (UINT_32) (_Length)); \ - } \ - } - - #define DBGLOG_MEM32(_Module, _Class, _StartAddr, _Length) \ - { \ - if (aucDebugModule[DBG_##_Module##_IDX] & DBG_CLASS_##_Class) { \ - LOG_FUNC("%s: (" #_Module " " #_Class ")\n", __FUNCTION__); \ - dumpMemory32((PUINT_32) (_StartAddr), (UINT_32) (_Length)); \ - } \ - } - /*lint -restore */ - - /*lint -save -e961 use of '#undef' is discouraged */ - #undef ASSERT - /*lint -restore */ - - #ifdef _lint - #define ASSERT(_exp) \ - { \ - if (!(_exp)) {do {} while (1);} \ - } - #else - #define ASSERT(_exp) \ - { \ - if (!(_exp) && !fgIsBusAccessFailed) { \ - LOG_FUNC("Assertion failed: %s:%d %s\n", __FILE__, __LINE__, #_exp); \ - kalBreakPoint(); \ - } \ - } - #endif /* _lint */ - - #define ASSERT_REPORT(_exp, _fmt) \ - { \ - if (!(_exp) && !fgIsBusAccessFailed) { \ - LOG_FUNC("Assertion failed: %s:%d %s\n", __FILE__, __LINE__, #_exp); \ - LOG_FUNC _fmt; \ - kalBreakPoint(); \ - } \ - } - - #define DISP_STRING(_str) _str - -#else /* !DBG */ - - #define DEBUGFUNC(_Func) - #define INITLOG(_Fmt) - #define ERRORLOG(_Fmt) - #define WARNLOG(_Fmt) - -#if defined(LINUX) - #define DBGLOG(_Module, _Class, _Fmt) \ - { \ - _Module##_##_Class##_LOGFUNC _Fmt; \ - } -#else - #define DBGLOG(_Module, _Class, _Fmt) -#endif - -#if CFG_SUPPORT_XLOG - #define DBGLOG_MEM8(_Module, _Class, _StartAddr, _Length) \ - { \ - _Module##_##_Class##_LOGFUNC (__FUNCTION__);\ - _Module##_##_Class##_LOGDUMP8(_StartAddr, _Length); \ - } -#else - #define DBGLOG_MEM8(_Module, _Class, _StartAddr, _Length) -#endif - #define DBGLOG_MEM32(_Module, _Class, _StartAddr, _Length) - - #undef ASSERT - -#if BUILD_QA_DBG - #if defined(LINUX) /* For debugging in Linux w/o GDB */ - #define ASSERT(_exp) \ - { \ - if (!(_exp) && !fgIsBusAccessFailed) { \ - LOG_FUNC("Assertion failed: %s:%d (%s)\n", __FILE__, __LINE__, #_exp); \ - kalBreakPoint(); \ - } \ - } - - #define ASSERT_REPORT(_exp, _fmt) \ - { \ - if (!(_exp) && !fgIsBusAccessFailed) { \ - LOG_FUNC("Assertion failed: %s:%d (%s)\n", __FILE__, __LINE__, #_exp); \ - LOG_FUNC _fmt; \ - kalBreakPoint(); \ - } \ - } - #else - #ifdef WINDOWS_CE - #define UNICODE_TEXT(_msg) TEXT(_msg) - #define ASSERT(_exp) \ - { \ - if (!(_exp) && !fgIsBusAccessFailed) { \ - TCHAR rUbuf[256]; \ - kalBreakPoint(); \ - _stprintf(rUbuf, TEXT("Assertion failed: %s:%d %s\n"), \ - UNICODE_TEXT(__FILE__), \ - __LINE__, \ - UNICODE_TEXT(#_exp)); \ - MessageBox(NULL, rUbuf, TEXT("ASSERT!"), MB_OK); \ - } \ - } - - #define ASSERT_REPORT(_exp, _fmt) \ - { \ - if (!(_exp) && !fgIsBusAccessFailed) { \ - TCHAR rUbuf[256]; \ - kalBreakPoint(); \ - _stprintf(rUbuf, TEXT("Assertion failed: %s:%d %s\n"), \ - UNICODE_TEXT(__FILE__), \ - __LINE__, \ - UNICODE_TEXT(#_exp)); \ - MessageBox(NULL, rUbuf, TEXT("ASSERT!"), MB_OK); \ - } \ - } - #else - #define ASSERT(_exp) \ - { \ - if (!(_exp) && !fgIsBusAccessFailed) { \ - kalBreakPoint(); \ - } \ - } - - #define ASSERT_REPORT(_exp, _fmt) \ - { \ - if (!(_exp) && !fgIsBusAccessFailed) { \ - kalBreakPoint(); \ - } \ - } - #endif /* WINDOWS_CE */ - #endif /* LINUX */ -#else - #define ASSERT(_exp) - #define ASSERT_REPORT(_exp, _fmt) -#endif /* BUILD_QA_DBG */ - - #define DISP_STRING(_str) "" - -#endif /* DBG */ - -#if CFG_STARTUP_DEBUG - #if defined(LINUX) -#define DBGPRINTF kalPrint - #else -#define DBGPRINTF DbgPrint - #endif -#else -#define DBGPRINTF(...) -#endif - - -/* The following macro is used for debugging packed structures. */ -#ifndef DATA_STRUC_INSPECTING_ASSERT -#define DATA_STRUC_INSPECTING_ASSERT(expr) \ - switch (0) {case 0: case (expr): default:;} -#endif - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -#if DBG -VOID -dumpMemory8 ( - IN PUINT_8 pucStartAddr, - IN UINT_32 u4Length - ); - -VOID -dumpMemory32 ( - IN PUINT_32 pu4StartAddr, - IN UINT_32 u4Length - ); -#elif CFG_SUPPORT_XLOG -VOID -dumpMemory8 ( - IN UINT_32 log_level, - IN PUINT_8 pucStartAddr, - IN UINT_32 u4Length - ); -#endif /* DBG */ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#endif /* _DEBUG_H */ - diff --git a/drivers/net/wireless/mt5931/include/link.h b/drivers/net/wireless/mt5931/include/link.h deleted file mode 100755 index deefb031a2e5..000000000000 --- a/drivers/net/wireless/mt5931/include/link.h +++ /dev/null @@ -1,414 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/link.h#1 $ -*/ - -/*! \file link.h - \brief Definition for simple doubly linked list operations. - - In this file we define the simple doubly linked list data structure and its - operation MACROs and INLINE functions. -*/ - - - -/* -** $Log: link.h $ - * - * 08 05 2010 yuche.tsai - * NULL - * Modify a MACRO of LINK_FOR_EACH_SAFE for compile error. - * - * 07 19 2010 cm.chang - * - * Set RLM parameters and enable CNM channel manager - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * [WPD00003833] [MT6620 and MT5931] Driver migration - * . - * - * - * - * - * May 4 2009 mtk01084 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * add WIFI to BORA source control -** \main\maintrunk.MT5921\8 2008-10-16 15:57:11 GMT mtk01461 -** Update driver to fix lint warning -** \main\maintrunk.MT5921\7 2008-08-10 18:47:53 GMT mtk01461 -** Update for Driver Review -** \main\maintrunk.MT5921\6 2007-12-11 00:09:00 GMT mtk01461 -** Add macro for checking valid list -** \main\maintrunk.MT5921\5 2007-11-13 14:27:01 GMT mtk01461 -** Add LINK_IS_INVALID macro -** Revision 1.1.1.1 2007/06/22 08:09:05 MTK01461 -** no message -** -*/ - -#ifndef _LINK_H -#define _LINK_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "gl_typedef.h" - - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define INVALID_LINK_POISON1 ((VOID *) 0x00100101) // May cause page fault & unalignment issue (data abort) -#define INVALID_LINK_POISON2 ((VOID *) 0x00100201) // Used to verify that nonbody uses non-initialized link entries. - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -/* Simple Doubly Linked List Structures - Entry Part */ -typedef struct _LINK_ENTRY_T { - struct _LINK_ENTRY_T *prNext, *prPrev; -} LINK_ENTRY_T, *P_LINK_ENTRY_T; - -/* Simple Doubly Linked List Structures - List Part */ -typedef struct _LINK_T { - P_LINK_ENTRY_T prNext; - P_LINK_ENTRY_T prPrev; - UINT_32 u4NumElem; -} LINK_T, *P_LINK_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -#if 0 // No one use it, temporarily mark it for [Lint - Info 773] -#define LINK_ADDR(rLink) { (P_LINK_ENTRY_T)(&(rLink)), (P_LINK_ENTRY_T)(&(rLink)), 0 } - -#define LINK_DECLARATION(rLink) \ - struct _LINK_T rLink = LINK_ADDR(rLink) -#endif - -#define LINK_INITIALIZE(prLink) \ - do { \ - ((P_LINK_T)(prLink))->prNext = (P_LINK_ENTRY_T)(prLink); \ - ((P_LINK_T)(prLink))->prPrev = (P_LINK_ENTRY_T)(prLink); \ - ((P_LINK_T)(prLink))->u4NumElem = 0; \ - } while (0) - -#define LINK_ENTRY_INITIALIZE(prEntry) \ - do { \ - ((P_LINK_ENTRY_T)(prEntry))->prNext = (P_LINK_ENTRY_T)NULL; \ - ((P_LINK_ENTRY_T)(prEntry))->prPrev = (P_LINK_ENTRY_T)NULL; \ - } while (0) - -#define LINK_ENTRY_INVALID(prEntry) \ - do { \ - ((P_LINK_ENTRY_T)(prEntry))->prNext = (P_LINK_ENTRY_T)INVALID_LINK_POISON1; \ - ((P_LINK_ENTRY_T)(prEntry))->prPrev = (P_LINK_ENTRY_T)INVALID_LINK_POISON2; \ - } while (0) - -#define LINK_IS_EMPTY(prLink) (((P_LINK_T)(prLink))->prNext == (P_LINK_ENTRY_T)(prLink)) - -/* NOTE: We should do memory zero before any LINK been initiated, so we can check - * if it is valid before parsing the LINK. - */ -#define LINK_IS_INVALID(prLink) (((P_LINK_T)(prLink))->prNext == (P_LINK_ENTRY_T)NULL) - -#define LINK_IS_VALID(prLink) (((P_LINK_T)(prLink))->prNext != (P_LINK_ENTRY_T)NULL) - - -#define LINK_ENTRY(ptr, type, member) ENTRY_OF(ptr, type, member) - -/* Insert an entry into a link list's head */ -#define LINK_INSERT_HEAD(prLink, prEntry) \ - { \ - linkAdd(prEntry, prLink); \ - ((prLink)->u4NumElem)++; \ - } - - -/* Append an entry into a link list's tail */ -#define LINK_INSERT_TAIL(prLink, prEntry) \ - { \ - linkAddTail(prEntry, prLink); \ - ((prLink)->u4NumElem)++; \ - } - -/* Peek head entry, but keep still in link list */ -#define LINK_PEEK_HEAD(prLink, _type, _member) \ - ( \ - LINK_IS_EMPTY(prLink) ? \ - NULL : LINK_ENTRY((prLink)->prNext, _type, _member) \ - ) - -/* Peek tail entry, but keep still in link list */ -#define LINK_PEEK_TAIL(prLink, _type, _member) \ - ( \ - LINK_IS_EMPTY(prLink) ? \ - NULL : LINK_ENTRY((prLink)->prPrev, _type, _member) \ - ) - -/* Get first entry from a link list */ -/* NOTE: We assume the link entry located at the beginning of "prEntry Type", - * so that we can cast the link entry to other data type without doubts. - * And this macro also decrease the total entry count at the same time. - */ -#define LINK_REMOVE_HEAD(prLink, prEntry, _P_TYPE) \ - { \ - ASSERT(prLink); \ - if (LINK_IS_EMPTY(prLink)) { \ - prEntry = (_P_TYPE)NULL; \ - } \ - else { \ - prEntry = (_P_TYPE)(((P_LINK_T)(prLink))->prNext); \ - linkDel((P_LINK_ENTRY_T)prEntry); \ - ((prLink)->u4NumElem)--; \ - } \ - } - -/* Assume the link entry located at the beginning of prEntry Type. - * And also decrease the total entry count. - */ -#define LINK_REMOVE_KNOWN_ENTRY(prLink, prEntry) \ - { \ - ASSERT(prLink); \ - ASSERT(prEntry); \ - linkDel((P_LINK_ENTRY_T)prEntry); \ - ((prLink)->u4NumElem)--; \ - } - -/* Iterate over a link list */ -#define LINK_FOR_EACH(prEntry, prLink) \ - for (prEntry = (prLink)->prNext; \ - prEntry != (P_LINK_ENTRY_T)(prLink); \ - prEntry = (P_LINK_ENTRY_T)prEntry->prNext) - -/* Iterate over a link list backwards */ -#define LINK_FOR_EACH_PREV(prEntry, prLink) \ - for (prEntry = (prLink)->prPrev; \ - prEntry != (P_LINK_ENTRY_T)(prLink); \ - prEntry = (P_LINK_ENTRY_T)prEntry->prPrev) - -/* Iterate over a link list safe against removal of link entry */ -#define LINK_FOR_EACH_SAFE(prEntry, prNextEntry, prLink) \ - for (prEntry = (prLink)->prNext, prNextEntry = prEntry->prNext; \ - prEntry != (P_LINK_ENTRY_T)(prLink); \ - prEntry = prNextEntry, prNextEntry = prEntry->prNext) - -/* Iterate over a link list of given type */ -#define LINK_FOR_EACH_ENTRY(prObj, prLink, rMember, _TYPE) \ - for (prObj = LINK_ENTRY((prLink)->prNext, _TYPE, rMember); \ - &prObj->rMember != (P_LINK_ENTRY_T)(prLink); \ - prObj = LINK_ENTRY(prObj->rMember.prNext, _TYPE, rMember)) - -/* Iterate backwards over a link list of given type */ -#define LINK_FOR_EACH_ENTRY_PREV(prObj, prLink, rMember, _TYPE) \ - for (prObj = LINK_ENTRY((prLink)->prPrev, _TYPE, rMember); \ - &prObj->rMember != (P_LINK_ENTRY_T)(prLink); \ - prObj = LINK_ENTRY(prObj->rMember.prPrev, _TYPE, rMember)) - -/* Iterate over a link list of given type safe against removal of link entry */ -#define LINK_FOR_EACH_ENTRY_SAFE(prObj, prNextObj, prLink, rMember, _TYPE) \ - for (prObj = LINK_ENTRY((prLink)->prNext, _TYPE, rMember), \ - prNextObj = LINK_ENTRY(prObj->rMember.prNext, _TYPE, rMember); \ - &prObj->rMember != (P_LINK_ENTRY_T)(prLink); \ - prObj = prNextObj, \ - prNextObj = LINK_ENTRY(prNextObj->rMember.prNext, _TYPE, rMember)) - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is only for internal link list manipulation. -* -* \param[in] prNew Pointer of new link head -* \param[in] prPrev Pointer of previous link head -* \param[in] prNext Pointer of next link head -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -__linkAdd ( - IN P_LINK_ENTRY_T prNew, - IN P_LINK_ENTRY_T prPrev, - IN P_LINK_ENTRY_T prNext - ) -{ - prNext->prPrev = prNew; - prNew->prNext = prNext; - prNew->prPrev = prPrev; - prPrev->prNext = prNew; - - return; -} /* end of __linkAdd() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will add a new entry after the specified link head. -* -* \param[in] prNew New entry to be added -* \param[in] prHead Specified link head to add it after -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -linkAdd ( - IN P_LINK_ENTRY_T prNew, - IN P_LINK_T prLink - ) -{ - __linkAdd(prNew, (P_LINK_ENTRY_T)prLink, prLink->prNext); - - return; -} /* end of linkAdd() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will add a new entry before the specified link head. -* -* \param[in] prNew New entry to be added -* \param[in] prHead Specified link head to add it before -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -linkAddTail ( - IN P_LINK_ENTRY_T prNew, - IN P_LINK_T prLink - ) -{ - __linkAdd(prNew, prLink->prPrev, (P_LINK_ENTRY_T)prLink); - - return; -} /* end of linkAddTail() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is only for internal link list manipulation. -* -* \param[in] prPrev Pointer of previous link head -* \param[in] prNext Pointer of next link head -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -__linkDel ( - IN P_LINK_ENTRY_T prPrev, - IN P_LINK_ENTRY_T prNext - ) -{ - prNext->prPrev = prPrev; - prPrev->prNext = prNext; - - return; -} /* end of __linkDel() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will delete a specified entry from link list. -* NOTE: the entry is in an initial state. -* -* \param prEntry Specified link head(entry) -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -linkDel ( - IN P_LINK_ENTRY_T prEntry - ) -{ - __linkDel(prEntry->prPrev, prEntry->prNext); - - LINK_ENTRY_INITIALIZE(prEntry); - - return; -} /* end of linkDel() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will delete a specified entry from link list and then add it -* after the specified link head. -* -* \param[in] prEntry Specified link head(entry) -* \param[in] prOtherHead Another link head to add it after -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -linkMove ( - IN P_LINK_ENTRY_T prEntry, - IN P_LINK_T prLink - ) -{ - __linkDel(prEntry->prPrev, prEntry->prNext); - linkAdd(prEntry, prLink); - - return; -} /* end of linkMove() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will delete a specified entry from link list and then add it -* before the specified link head. -* -* \param[in] prEntry Specified link head(entry) -* \param[in] prOtherHead Another link head to add it before -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -linkMoveTail ( - IN P_LINK_ENTRY_T prEntry, - IN P_LINK_T prLink - ) -{ - __linkDel(prEntry->prPrev, prEntry->prNext); - linkAddTail(prEntry, prLink); - - return; -} /* end of linkMoveTail() */ - -#endif /* _LINK_H */ - diff --git a/drivers/net/wireless/mt5931/include/mgmt/aa_fsm.h b/drivers/net/wireless/mt5931/include/mgmt/aa_fsm.h deleted file mode 100755 index 1e7630c7c7ee..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/aa_fsm.h +++ /dev/null @@ -1,251 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/aa_fsm.h#1 $ -*/ - -/*! \file aa_fsm.h - \brief Declaration of functions and finite state machine for SAA/AAA Module. - - Declaration of functions and finite state machine for SAA/AAA Module. -*/ - - - -/* -** $Log: aa_fsm.h $ - * - * 10 13 2011 cp.wu - * [MT6620 Wi-Fi][Driver] Reduce join failure count limit to 2 for faster re-join for other BSS - * 1. short join failure count limit to 2 - * 2. treat join timeout as kind of join failure as well - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * refine TX-DONE callback. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add buildable & linkable ais_fsm.c - * - * related reference are still waiting to be resolved - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h. - * - * 03 10 2010 kevin.huang - * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support - * - * Add Channel Manager for arbitration of JOIN and SCAN Req - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup - * - * 01 11 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add Deauth and Disassoc Handler - * - * Nov 24 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Revise MGMT Handler with Retain Status - * - * Nov 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -*/ - - -#ifndef _AA_FSM_H -#define _AA_FSM_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -/* Retry interval for retransmiting authentication-request MMPDU. */ -#define TX_AUTHENTICATION_RETRY_TIMEOUT_TU 100 // TU. - -/* Retry interval for retransmiting association-request MMPDU. */ -#define TX_ASSOCIATION_RETRY_TIMEOUT_TU 100 // TU. - -/* Wait for a response to a transmitted authentication-request MMPDU. */ -#define DOT11_AUTHENTICATION_RESPONSE_TIMEOUT_TU 512 // TU. - -/* Wait for a response to a transmitted association-request MMPDU. */ -#define DOT11_ASSOCIATION_RESPONSE_TIMEOUT_TU 512 // TU. - -/* The maximum time to wait for JOIN process complete. */ -#define JOIN_FAILURE_TIMEOUT_BEACON_INTERVAL 20 // Beacon Interval, 20 * 100TU = 2 sec. - -/* Retry interval for next JOIN request. */ -#define JOIN_RETRY_INTERVAL_SEC 10 // Seconds - -/* Maximum Retry Count for accept a JOIN request. */ -#define JOIN_MAX_RETRY_FAILURE_COUNT 2 // Times - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef enum _ENUM_AA_STATE_T { - AA_STATE_IDLE = 0, - SAA_STATE_SEND_AUTH1, - SAA_STATE_WAIT_AUTH2, - SAA_STATE_SEND_AUTH3, - SAA_STATE_WAIT_AUTH4, - SAA_STATE_SEND_ASSOC1, - SAA_STATE_WAIT_ASSOC2, - AAA_STATE_SEND_AUTH2, - AAA_STATE_SEND_AUTH4, // We may not use, because P2P GO didn't support WEP and 11r - AAA_STATE_SEND_ASSOC2, - AA_STATE_RESOURCE, // A state for debugging the case of out of msg buffer. - AA_STATE_NUM -} ENUM_AA_STATE_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/* Routines in saa_fsm.c */ -/*----------------------------------------------------------------------------*/ -VOID -saaFsmSteps ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN ENUM_AA_STATE_T eNextState, - IN P_SW_RFB_T prRetainedSwRfb - ); - -WLAN_STATUS -saaFsmSendEventJoinComplete ( - IN P_ADAPTER_T prAdapter, - WLAN_STATUS rJoinStatus, - P_STA_RECORD_T prStaRec, - P_SW_RFB_T prSwRfb - ); - -VOID -saaFsmRunEventStart ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -WLAN_STATUS -saaFsmRunEventTxDone ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - -VOID -saaFsmRunEventTxReqTimeOut ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -VOID -saaFsmRunEventRxRespTimeOut ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -VOID -saaFsmRunEventRxAuth ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -WLAN_STATUS -saaFsmRunEventRxAssoc ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -WLAN_STATUS -saaFsmRunEventRxDeauth ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -WLAN_STATUS -saaFsmRunEventRxDisassoc ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -VOID -saaFsmRunEventAbort ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -/*----------------------------------------------------------------------------*/ -/* Routines in aaa_fsm.c */ -/*----------------------------------------------------------------------------*/ -VOID -aaaFsmRunEventRxAuth ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -WLAN_STATUS -aaaFsmRunEventRxAssoc ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -WLAN_STATUS -aaaFsmRunEventTxDone ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _AA_FSM_H */ - - - - diff --git a/drivers/net/wireless/mt5931/include/mgmt/ais_fsm.h b/drivers/net/wireless/mt5931/include/mgmt/ais_fsm.h deleted file mode 100755 index b153256ed6f3..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/ais_fsm.h +++ /dev/null @@ -1,680 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/ais_fsm.h#1 $ -*/ - -/*! \file ais_fsm.h - \brief Declaration of functions and finite state machine for AIS Module. - - Declaration of functions and finite state machine for AIS Module. -*/ - - - -/* -** $Log: ais_fsm.h $ - * - * 11 22 2011 cp.wu - * [WCXRP00001120] [MT6620 Wi-Fi][Driver] Modify roaming to AIS state transition from synchronous to asynchronous approach to avoid incomplete state termination - * 1. change RDD related compile option brace position. - * 2. when roaming is triggered, ask AIS to transit immediately only when AIS is in Normal TR state without join timeout timer ticking - * 3. otherwise, insert AIS_REQUEST into pending request queue - * - * 04 25 2011 cp.wu - * [WCXRP00000676] [MT6620 Wi-Fi][Driver] AIS to reduce request channel period from 5 seconds to 2 seconds - * channel interval for joining is shortened to 2 seconds to avoid interruption of concurrent operating network. - * - * 02 26 2011 tsaiyuan.hsu - * [WCXRP00000391] [MT6620 Wi-Fi][FW] Add Roaming Support - * not send disassoc or deauth to leaving AP so as to improve performace of roaming. - * - * 02 22 2011 cp.wu - * [WCXRP00000487] [MT6620 Wi-Fi][Driver][AIS] Serve scan and connect request with a queue-based approach to improve response time for scanning request - * handle SCAN and RECONNECT with a FIFO approach. - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * - * 01 14 2011 cp.wu - * [WCXRP00000359] [MT6620 Wi-Fi][Driver] add an extra state to ensure DEAUTH frame is always sent - * Add an extra state to guarantee DEAUTH frame is sent then connect to new BSS. - * This change is due to WAPI AP needs DEAUTH frame as a necessary step in handshaking protocol. - * - * 11 25 2010 cp.wu - * [WCXRP00000208] [MT6620 Wi-Fi][Driver] Add scanning with specified SSID to AIS FSM - * add scanning with specified SSID facility to AIS-FSM - * - * 11 01 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module - * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead - * 2) Remove CNM CH-RECOVER event handling - * 3) cfg read/write API renamed with kal prefix for unified naming rules. - * - * 09 06 2010 cp.wu - * NULL - * 1) initialize for correct parameter even for disassociation. - * 2) AIS-FSM should have a limit on trials to build connection - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 25 2010 cp.wu - * NULL - * [AIS-FSM] IBSS no longer needs to acquire channel for beaconing, RLM/CNM will handle the channel switching when BSS information is updated - * - * 08 12 2010 kevin.huang - * NULL - * Refine bssProcessProbeRequest() and bssSendBeaconProbeResponse() - * - * 08 12 2010 cp.wu - * NULL - * [AIS-FSM] honor registry setting for adhoc running mode. (A/B/G) - * - * 08 03 2010 cp.wu - * NULL - * surpress compilation warning. - * - * 07 30 2010 cp.wu - * NULL - * 1) BoW wrapper: use definitions instead of hard-coded constant for error code - * 2) AIS-FSM: eliminate use of desired RF parameters, use prTargetBssDesc instead - * 3) add handling for RX_PKT_DESTINATION_HOST_WITH_FORWARD for GO-broadcast frames - * - * 07 26 2010 cp.wu - * - * AIS-FSM: when scan request is coming in the 1st 5 seconds of channel privilege period, just pend it til 5-sec. period finishes - * - * 07 26 2010 cp.wu - * - * AIS-FSM FIX: return channel privilege even when the privilege is not granted yet - * QM: qmGetFrameAction() won't assert when corresponding STA-REC index is not found - * - * 07 23 2010 cp.wu - * - * add AIS-FSM handling for beacon timeout event. - * - * 07 21 2010 cp.wu - * - * separate AIS-FSM states into different cases of channel request. - * - * 07 21 2010 cp.wu - * - * 1) change BG_SCAN to ONLINE_SCAN for consistent term - * 2) only clear scanning result when scan is permitted to do - * - * 07 19 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * Add Ad-Hoc support to AIS-FSM - * - * 07 14 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * Refine AIS-FSM by divided into more states - * - * 07 09 2010 cp.wu - * - * 1) separate AIS_FSM state for two kinds of scanning. (OID triggered scan, and scan-for-connection) - * 2) eliminate PRE_BSS_DESC_T, Beacon/PrebResp is now parsed in single pass - * 3) implment DRV-SCN module, currently only accepts single scan request, other request will be directly dropped by returning BUSY - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * AIS-FSM integration with CNM channel request messages - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * implementation of DRV-SCN and related mailbox message handling. - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add buildable & linkable ais_fsm.c - * - * related reference are still waiting to be resolved - * - * 06 09 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add definitions for module migration. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h. - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add Power Management - Legacy PS-POLL support. - * - * 04 23 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * reduce the backgroud ssid idle time min and max value - * - * 04 19 2010 kevin.huang - * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support - * Add Beacon Timeout Support - * * and will send Null frame to diagnose connection - * - * 03 16 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add AdHoc Mode - * - * 03 10 2010 kevin.huang - * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support - * - * * Add Channel Manager for arbitration of JOIN and SCAN Req - * - * 02 26 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Remove CFG_TEST_VIRTUAL_CMD and add support of Driver STA_RECORD_T activation - * - * 02 23 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Support dynamic channel selection - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup - * - * 01 11 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add Deauth and Disassoc Handler - * - * 01 07 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add Media disconnect indication and related postpone functions - * - * Dec 3 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add aisFsmRunEventJoinComplete() - * - * Nov 25 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add Virtual CMD & RESP for testing CMD PATH - * - * Nov 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * add aisFsmInitializeConnectionSettings() - * - * Nov 20 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add CFG_TEST_MGMT_FSM for aisFsmTest() - * - * Nov 18 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add function prototype of aisFsmInit() - * - * Nov 16 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -*/ - -#ifndef _AIS_FSM_H -#define _AIS_FSM_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define AIS_BG_SCAN_INTERVAL_MIN_SEC 2 //30 // exponential to 960 -#define AIS_BG_SCAN_INTERVAL_MAX_SEC 2 //960 // 16min - -#define AIS_DELAY_TIME_OF_DISCONNECT_SEC 10 - -#define AIS_IBSS_ALONE_TIMEOUT_SEC 20 // seconds - -#define AIS_BEACON_TIMEOUT_COUNT_ADHOC 30 -#define AIS_BEACON_TIMEOUT_COUNT_INFRA 10 -#define AIS_BEACON_TIMEOUT_GUARD_TIME_SEC 1 /* Second */ - -#define AIS_BEACON_MAX_TIMEOUT_TU 100 -#define AIS_BEACON_MIN_TIMEOUT_TU 5 -#define AIS_BEACON_MAX_TIMEOUT_VALID TRUE -#define AIS_BEACON_MIN_TIMEOUT_VALID TRUE - -#define AIS_BMC_MAX_TIMEOUT_TU 100 -#define AIS_BMC_MIN_TIMEOUT_TU 5 -#define AIS_BMC_MAX_TIMEOUT_VALID TRUE -#define AIS_BMC_MIN_TIMEOUT_VALID TRUE - -#define AIS_JOIN_CH_GRANT_THRESHOLD 10 -#define AIS_JOIN_CH_REQUEST_INTERVAL 2000 - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef enum _ENUM_AIS_STATE_T { - AIS_STATE_IDLE = 0, - AIS_STATE_SEARCH, - AIS_STATE_SCAN, - AIS_STATE_ONLINE_SCAN, - AIS_STATE_LOOKING_FOR, - AIS_STATE_WAIT_FOR_NEXT_SCAN, - AIS_STATE_REQ_CHANNEL_JOIN, - AIS_STATE_JOIN, - AIS_STATE_IBSS_ALONE, - AIS_STATE_IBSS_MERGE, - AIS_STATE_NORMAL_TR, - AIS_STATE_DISCONNECTING, - AIS_STATE_NUM -} ENUM_AIS_STATE_T; - - -typedef struct _MSG_AIS_ABORT_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 ucReasonOfDisconnect; - BOOLEAN fgDelayIndication; -} MSG_AIS_ABORT_T, *P_MSG_AIS_ABORT_T; - - -typedef struct _MSG_AIS_IBSS_PEER_FOUND_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 ucNetTypeIndex; - BOOLEAN fgIsMergeIn; /* TRUE: Merge In, FALSE: Merge Out */ - P_STA_RECORD_T prStaRec; -} MSG_AIS_IBSS_PEER_FOUND_T, *P_MSG_AIS_IBSS_PEER_FOUND_T; - -typedef enum _ENUM_AIS_REQUEST_TYPE_T { - AIS_REQUEST_SCAN, - AIS_REQUEST_RECONNECT, - AIS_REQUEST_ROAMING_SEARCH, - AIS_REQUEST_ROAMING_CONNECT, - AIS_REQUEST_NUM -} ENUM_AIS_REQUEST_TYPE_T; - -typedef struct _AIS_REQ_HDR_T { - LINK_ENTRY_T rLinkEntry; - ENUM_AIS_REQUEST_TYPE_T eReqType; -} AIS_REQ_HDR_T, *P_AIS_REQ_HDR_T; - - -typedef struct _AIS_FSM_INFO_T { - ENUM_AIS_STATE_T ePreviousState; - ENUM_AIS_STATE_T eCurrentState; - - BOOLEAN fgTryScan; - - BOOLEAN fgIsInfraChannelFinished; - BOOLEAN fgIsChannelRequested; - BOOLEAN fgIsChannelGranted; - -#if CFG_SUPPORT_ROAMING - BOOLEAN fgIsRoamingScanPending; -#endif /* CFG_SUPPORT_ROAMING */ - - UINT_8 ucAvailableAuthTypes; /* Used for AUTH_MODE_AUTO_SWITCH */ - - P_BSS_DESC_T prTargetBssDesc; /* For destination */ - - P_STA_RECORD_T prTargetStaRec; /* For JOIN Abort */ - - UINT_32 u4SleepInterval; - - TIMER_T rBGScanTimer; - - TIMER_T rIbssAloneTimer; - - TIMER_T rIndicationOfDisconnectTimer; - - TIMER_T rJoinTimeoutTimer; - - UINT_8 ucSeqNumOfReqMsg; - UINT_8 ucSeqNumOfChReq; - UINT_8 ucSeqNumOfScanReq; - - UINT_32 u4ChGrantedInterval; - - UINT_8 ucConnTrialCount; - - UINT_8 ucScanSSIDLen; - UINT_8 aucScanSSID[ELEM_MAX_LEN_SSID]; - - UINT_32 u4ScanIELength; - UINT_8 aucScanIEBuf[MAX_IE_LENGTH]; - - /* Pending Request List */ - LINK_T rPendingReqList; - -} AIS_FSM_INFO_T, *P_AIS_FSM_INFO_T; - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -#define aisChangeMediaState(_prAdapter, _eNewMediaState) \ - (_prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX].eConnectionState = (_eNewMediaState)); - - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -VOID -aisInitializeConnectionSettings ( - IN P_ADAPTER_T prAdapter, - IN P_REG_INFO_T prRegInfo - ); - -VOID -aisFsmInit ( - IN P_ADAPTER_T prAdapter - ); - -VOID -aisFsmUninit ( - IN P_ADAPTER_T prAdapter - ); - -VOID -aisFsmStateInit_JOIN ( - IN P_ADAPTER_T prAdapter, - P_BSS_DESC_T prBssDesc - ); - -BOOLEAN -aisFsmStateInit_RetryJOIN ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -VOID -aisFsmStateInit_IBSS_ALONE ( - IN P_ADAPTER_T prAdapter - ); - -VOID -aisFsmStateInit_IBSS_MERGE ( - IN P_ADAPTER_T prAdapter, - P_BSS_DESC_T prBssDesc - ); - -VOID -aisFsmStateAbort ( - IN P_ADAPTER_T prAdapter, - UINT_8 ucReasonOfDisconnect, - BOOLEAN fgDelayIndication - ); - -VOID -aisFsmStateAbort_JOIN ( - IN P_ADAPTER_T prAdapter - ); - -VOID -aisFsmStateAbort_SCAN ( - IN P_ADAPTER_T prAdapter - ); - -VOID -aisFsmStateAbort_NORMAL_TR ( - IN P_ADAPTER_T prAdapter - ); - -VOID -aisFsmStateAbort_IBSS ( - IN P_ADAPTER_T prAdapter - ); - -VOID -aisFsmSteps ( - IN P_ADAPTER_T prAdapter, - ENUM_AIS_STATE_T eNextState - ); - -/*----------------------------------------------------------------------------*/ -/* Mailbox Message Handling */ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmRunEventScanDone ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -aisFsmRunEventAbort ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -aisFsmRunEventJoinComplete ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -aisFsmRunEventFoundIBSSPeer ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -/*----------------------------------------------------------------------------*/ -/* Handling for Ad-Hoc Network */ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmCreateIBSS ( - IN P_ADAPTER_T prAdapter - ); - -VOID -aisFsmMergeIBSS ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -/*----------------------------------------------------------------------------*/ -/* Handling of Incoming Mailbox Message from CNM */ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmRunEventChGrant ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - - -/*----------------------------------------------------------------------------*/ -/* Generating Outgoing Mailbox Message to CNM */ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmReleaseCh ( - IN P_ADAPTER_T prAdapter - ); - - -/*----------------------------------------------------------------------------*/ -/* Event Indication */ -/*----------------------------------------------------------------------------*/ -VOID -aisIndicationOfMediaStateToHost ( - IN P_ADAPTER_T prAdapter, - ENUM_PARAM_MEDIA_STATE_T eConnectionState, - BOOLEAN fgDelayIndication - ); - -VOID -aisPostponedEventOfDisconnTimeout ( - IN P_ADAPTER_T prAdapter, - UINT_32 u4Param - ); - -VOID -aisUpdateBssInfoForJOIN ( - IN P_ADAPTER_T prAdapter, - P_STA_RECORD_T prStaRec, - P_SW_RFB_T prAssocRspSwRfb - ); - -VOID -aisUpdateBssInfoForCreateIBSS ( - IN P_ADAPTER_T prAdapter - ); - -VOID -aisUpdateBssInfoForMergeIBSS ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -BOOLEAN -aisValidateProbeReq ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_32 pu4ControlFlags - ); - -/*----------------------------------------------------------------------------*/ -/* Disconnection Handling */ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmDisconnect ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgDelayIndication - ); - - -/*----------------------------------------------------------------------------*/ -/* Event Handling */ -/*----------------------------------------------------------------------------*/ -VOID -aisBssBeaconTimeout ( - IN P_ADAPTER_T prAdapter - ); - -WLAN_STATUS -aisDeauthXmitComplete ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - -#if CFG_SUPPORT_ROAMING -VOID -aisFsmRunEventRoamingDiscovery ( - IN P_ADAPTER_T prAdapter, - UINT_32 u4ReqScan - ); - -ENUM_AIS_STATE_T -aisFsmRoamingScanResultsUpdate ( - IN P_ADAPTER_T prAdapter - ); - -VOID -aisFsmRoamingDisconnectPrevAP ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prTargetStaRec - ); - -VOID -aisUpdateBssInfoForRoamingAP ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prAssocRspSwRfb - ); -#endif /*CFG_SUPPORT_ROAMING */ - -/*----------------------------------------------------------------------------*/ -/* Timeout Handling */ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmRunEventBGSleepTimeOut ( - IN P_ADAPTER_T prAdapter, - UINT_32 u4Param - ); - -VOID -aisFsmRunEventIbssAloneTimeOut ( - IN P_ADAPTER_T prAdapter, - UINT_32 u4Param - ); - -VOID -aisFsmRunEventJoinTimeout ( - IN P_ADAPTER_T prAdapter, - UINT_32 u4Param - ); - -/*----------------------------------------------------------------------------*/ -/* OID/IOCTL Handling */ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmScanRequest ( - IN P_ADAPTER_T prAdapter, - IN P_PARAM_SSID_T prSsid, - IN PUINT_8 pucIe, - IN UINT_32 u4IeLength - ); - -/*----------------------------------------------------------------------------*/ -/* Internal State Checking */ -/*----------------------------------------------------------------------------*/ -BOOLEAN -aisFsmIsRequestPending ( - IN P_ADAPTER_T prAdapter, - IN ENUM_AIS_REQUEST_TYPE_T eReqType, - IN BOOLEAN bRemove - ); - -P_AIS_REQ_HDR_T -aisFsmGetNextRequest ( - IN P_ADAPTER_T prAdapter - ); - -BOOLEAN -aisFsmInsertRequest ( - IN P_ADAPTER_T prAdapter, - IN ENUM_AIS_REQUEST_TYPE_T eReqType - ); - -VOID -aisFsmFlushRequest ( - IN P_ADAPTER_T prAdapter - ); - - -#if defined(CFG_TEST_MGMT_FSM) && (CFG_TEST_MGMT_FSM != 0) -VOID -aisTest ( - VOID - ); -#endif /* CFG_TEST_MGMT_FSM */ -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _AIS_FSM_H */ - - - - diff --git a/drivers/net/wireless/mt5931/include/mgmt/assoc.h b/drivers/net/wireless/mt5931/include/mgmt/assoc.h deleted file mode 100755 index 1dbb06e73f1c..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/assoc.h +++ /dev/null @@ -1,147 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/assoc.h#1 $ -*/ - -/*! \file assoc.h - \brief This file contains the ASSOC REQ/RESP of - IEEE 802.11 family for MediaTek 802.11 Wireless LAN Adapters. -*/ - - - -/* -** $Log: assoc.h $ - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 17 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Add assocCheckTxReAssocRespFrame() proto type for P2P usage. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add buildable & linkable ais_fsm.c - * - * related reference are still waiting to be resolved - * -*/ - -#ifndef _ASSOC_H -#define _ASSOC_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/* Routines in assoc.c */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -assocSendReAssocReqFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -WLAN_STATUS -assocCheckTxReAssocReqFrame ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - -WLAN_STATUS -assocCheckTxReAssocRespFrame( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - -WLAN_STATUS -assocCheckRxReAssocRspFrameStatus ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_16 pu2StatusCode - ); - -WLAN_STATUS -assocSendDisAssocFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN UINT_16 u2ReasonCode - ); - -WLAN_STATUS -assocProcessRxDisassocFrame ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN UINT_8 aucBSSID[], - OUT PUINT_16 pu2ReasonCode - ); - -WLAN_STATUS -assocProcessRxAssocReqFrame ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_16 pu2StatusCode - ); - -WLAN_STATUS -assocSendReAssocRespFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _ASSOC_H */ - diff --git a/drivers/net/wireless/mt5931/include/mgmt/auth.h b/drivers/net/wireless/mt5931/include/mgmt/auth.h deleted file mode 100755 index 6a8bf18b063b..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/auth.h +++ /dev/null @@ -1,175 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/auth.h#1 $ -*/ - -/*! \file auth.h - \brief This file contains the authentication REQ/RESP of - IEEE 802.11 family for MediaTek 802.11 Wireless LAN Adapters. -*/ - - - -/* -** $Log: auth.h $ - * - * 04 21 2011 terry.wu - * [WCXRP00000674] [MT6620 Wi-Fi][Driver] Refine AAA authSendAuthFrame - * Add network type parameter to authSendAuthFrame. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add management dispatching function table. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * auth.c is migrated. - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add buildable & linkable ais_fsm.c - * - * related reference are still waiting to be resolved - * -*/ - -#ifndef _AUTH_H -#define _AUTH_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/* Routines in auth.c */ -/*----------------------------------------------------------------------------*/ -VOID -authAddIEChallengeText ( - IN P_ADAPTER_T prAdapter, - IN OUT P_MSDU_INFO_T prMsduInfo - ); - -#if !CFG_SUPPORT_AAA -WLAN_STATUS -authSendAuthFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN UINT_16 u2TransactionSeqNum - ); -#else -WLAN_STATUS -authSendAuthFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_SW_RFB_T prFalseAuthSwRfb, - IN UINT_16 u2TransactionSeqNum, - IN UINT_16 u2StatusCode - ); -#endif /* CFG_SUPPORT_AAA */ - -WLAN_STATUS -authCheckTxAuthFrame ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN UINT_16 u2TransactionSeqNum - ); - -WLAN_STATUS -authCheckRxAuthFrameTransSeq ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -WLAN_STATUS -authCheckRxAuthFrameStatus ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN UINT_16 u2TransactionSeqNum, - OUT PUINT_16 pu2StatusCode - ); - -VOID -authHandleIEChallengeText ( - P_ADAPTER_T prAdapter, - P_SW_RFB_T prSwRfb, - P_IE_HDR_T prIEHdr - ); - -WLAN_STATUS -authProcessRxAuth2_Auth4Frame ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -WLAN_STATUS -authSendDeauthFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prClassErrSwRfb, - IN UINT_16 u2ReasonCode, - IN PFN_TX_DONE_HANDLER pfTxDoneHandler - ); - -WLAN_STATUS -authProcessRxDeauthFrame ( - IN P_SW_RFB_T prSwRfb, - IN UINT_8 aucBSSID[], - OUT PUINT_16 pu2ReasonCode - ); - -WLAN_STATUS -authProcessRxAuth1Frame ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN UINT_8 aucExpectedBSSID[], - IN UINT_16 u2ExpectedAuthAlgNum, - IN UINT_16 u2ExpectedTransSeqNum, - OUT PUINT_16 pu2ReturnStatusCode - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _AUTH_H */ - diff --git a/drivers/net/wireless/mt5931/include/mgmt/bow_fsm.h b/drivers/net/wireless/mt5931/include/mgmt/bow_fsm.h deleted file mode 100755 index 2e63f9131163..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/bow_fsm.h +++ /dev/null @@ -1,190 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/bow_fsm.h#1 $ -*/ - -/*! \file bow_fsm.h - \brief Declaration of functions and finite state machine for BOW Module. - - Declaration of functions and finite state machine for BOW Module. -*/ - - - -/* -** $Log: bow_fsm.h $ - * - * 05 22 2011 terry.wu - * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment - * Submit missing BoW header files. - * - * 03 27 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Support multiple physical link. - * - * 02 16 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add bowNotifyAllLinkDisconnected interface and change channel grant procedure for bow starting.. - * - * 02 15 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add channel previledge into _BOW_FSM_INFO_T. - * - * 09 16 2010 chinghwa.yu - * NULL - * update bowChangeMediaState. - * - * 08 24 2010 chinghwa.yu - * NULL - * Update BOW for the 1st time. - */ - -#ifndef _BOW_FSM_H -#define _BOW_FSM_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -#define BOW_BG_SCAN_INTERVAL_MIN_SEC 2 //30 // exponential to 960 -#define BOW_BG_SCAN_INTERVAL_MAX_SEC 2 //960 // 16min - -#define BOW_DELAY_TIME_OF_DISCONNECT_SEC 10 - -#define BOW_BEACON_TIMEOUT_COUNT_STARTING 10 -#define BOW_BEACON_TIMEOUT_GUARD_TIME_SEC 1 /* Second */ - -#define BOW_BEACON_MAX_TIMEOUT_TU 100 -#define BOW_BEACON_MIN_TIMEOUT_TU 5 -#define BOW_BEACON_MAX_TIMEOUT_VALID TRUE -#define BOW_BEACON_MIN_TIMEOUT_VALID TRUE - -#define BOW_BMC_MAX_TIMEOUT_TU 100 -#define BOW_BMC_MIN_TIMEOUT_TU 5 -#define BOW_BMC_MAX_TIMEOUT_VALID TRUE -#define BOW_BMC_MIN_TIMEOUT_VALID TRUE - -#define BOW_JOIN_CH_GRANT_THRESHOLD 10 -#define BOW_JOIN_CH_REQUEST_INTERVAL 2000 - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -typedef enum _ENUM_BOW_STATE_T { - BOW_STATE_IDLE = 0, - BOW_STATE_SEARCH, - BOW_STATE_SCAN, - BOW_STATE_ONLINE_SCAN, - BOW_STATE_LOOKING_FOR, - BOW_STATE_WAIT_FOR_NEXT_SCAN, - BOW_STATE_REQ_CHANNEL_JOIN, - BOW_STATE_REQ_CHANNEL_ALONE, - BOW_STATE_REQ_CHANNEL_MERGE, - BOW_STATE_JOIN, - BOW_STATE_IBSS_ALONE, - BOW_STATE_IBSS_MERGE, - BOW_STATE_NORMAL_TR, - BOW_STATE_NUM -} ENUM_BOW_STATE_T; - -typedef struct _BOW_FSM_INFO_T { - ENUM_BOW_STATE_T ePreviousState; - ENUM_BOW_STATE_T eCurrentState; - - BOOLEAN fgTryScan; - - /* Channel Privilege */ - - BOOLEAN fgIsInfraChannelFinished; - BOOLEAN fgIsChannelRequested; - BOOLEAN fgIsChannelGranted; - BOOLEAN fgIsScanPending; - UINT_32 u4ChGrantedInterval; - - - UINT_8 ucPrimaryChannel; - ENUM_BAND_T eBand; - UINT_16 u2BeaconInterval; - - ENUM_BOW_STATE_T eReturnState; /* Return state after current activity finished or abort. */ - ENUM_BOW_STATE_T eForwardState; /* Step to next state if ACTION frame is TX successfully. */ - - P_BSS_DESC_T prTargetBss; /* BSS of target P2P Device. For Connection/Service Discovery */ - - P_STA_RECORD_T prTargetStaRec; - P_BSS_DESC_T prTargetBssDesc; /* For destination */ - - UINT_8 aucPeerAddress[6]; - - UINT_8 ucRole; - - BOOLEAN fgSupportQoS; - - BOOLEAN fgIsRsponseProbe; /* Indicate if BOW can response probe request frame. */ - - /* Sequence number of requested message. */ - UINT_8 ucSeqNumOfChReq; - UINT_8 ucSeqNumOfReqMsg; - UINT_8 ucSeqNumOfScnMsg; - UINT_8 ucSeqNumOfScanReq; - - UINT_8 ucSeqNumOfCancelMsg; - - UINT_8 ucDialogToken; - - /* Timer */ - TIMER_T rStartingBeaconTimer; /* For device discovery time of each discovery request from user.*/ - TIMER_T rStartingDiscoveryTimer; - TIMER_T rOperationListenTimer; /* For Find phase under operational state. */ - TIMER_T rFSMTimer; /* A timer used for Action frame timeout usage. */ - TIMER_T rIndicationOfDisconnectTimer; - TIMER_T rChGrantedTimer; - - UINT_8 ucAvailableAuthTypes; /* Used for AUTH_MODE_AUTO_SWITCH */ - -} BOW_FSM_INFO_T, *P_BOW_FSM_INFO_T; - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -#define bowChangeMediaState(_prAdapter, _eNewMediaState) \ - (_prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX].eConnectionState = (_eNewMediaState)); - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - - - -#endif diff --git a/drivers/net/wireless/mt5931/include/mgmt/bss.h b/drivers/net/wireless/mt5931/include/mgmt/bss.h deleted file mode 100755 index b7ff943c2763..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/bss.h +++ /dev/null @@ -1,353 +0,0 @@ -/* -** $Id: @(#) bss.h -*/ - -/*! \file "bss.h" - \brief In this file we define the function prototype used in BSS/IBSS. - - The file contains the function declarations and defines for used in BSS/IBSS. -*/ - - - -/* -** $Log: bss.h $ - * - * 07 17 2012 yuche.tsai - * NULL - * Let netdev bring up. - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 09 14 2011 yuche.tsai - * NULL - * Add P2P IE in assoc response. - * - * 03 19 2011 yuche.tsai - * [WCXRP00000581] [Volunteer Patch][MT6620][Driver] P2P IE in Assoc Req Issue - * Make assoc req to append P2P IE if wifi direct is enabled. - * - * 03 02 2011 wh.su - * [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request - * Add code to send beacon and probe response WSC IE at Auto GO. - * - * 02 23 2011 eddie.chen - * [WCXRP00000463] [MT6620 Wi-Fi][FW/Driver][Hotspot] Cannot update WMM PS STA's partital bitmap - * Fix parsing WMM INFO and bmp delivery bitmap definition. - * - * 01 31 2011 george.huang - * [WCXRP00000333] [MT5931][FW] support SRAM power control drivers - * Extend TIM PVB, from 2 to 3 octets. - * - * 11 29 2010 cp.wu - * [WCXRP00000210] [MT6620 Wi-Fi][Driver][FW] Set RCPI value in STA_REC for initial TX rate selection of auto-rate algorithm - * update ucRcpi of STA_RECORD_T for AIS when - * 1) Beacons for IBSS merge is received - * 2) Associate Response for a connecting peer is received - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 12 2010 kevin.huang - * NULL - * Update bssProcessProbeRequest() and bssSendBeaconProbeResponse() declarations - * - * 07 19 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * when IBSS is being merged-in, send command packet to PM for connected indication - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 25 2010 george.huang - * [WPD00001556]Basic power managemenet function - * Create beacon update path, with expose bssUpdateBeaconContent() - * - * 06 17 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Add CTRL FLAGS for Probe Response. - * - * 06 09 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add necessary changes to driver data paths. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h. - * - * 06 04 2010 george.huang - * [BORA00000678][MT6620]WiFi LP integration - * [PM] Support U-APSD for STA mode - * - * 05 28 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add ClientList handling API - bssClearClientList, bssAddStaRecToClientList - * - * 05 14 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Remove unused typedef. - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Fix file merge error - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add Power Management - Legacy PS-POLL support. - * - * 04 19 2010 kevin.huang - * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support - * Add Beacon Timeout Support - * * * and will send Null frame to diagnose connection - * - * 03 16 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add AdHoc Mode - * - * 02 23 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add DTIM count update while TX Beacon - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup -*/ - -#ifndef _BSS_H -#define _BSS_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -//NOTE(Kevin): change define for george -//#define MAX_LEN_TIM_PARTIAL_BMP (((MAX_ASSOC_ID + 1) + 7) / 8) /* Required bits = (MAX_ASSOC_ID + 1) */ -#define MAX_LEN_TIM_PARTIAL_BMP ((CFG_STA_REC_NUM + 7) / 8) /* reserve length greater than maximum size of STA_REC */ //obsoleted: Assume we only use AID:1~15 - -/* CTRL FLAGS for Probe Response */ -#define BSS_PROBE_RESP_USE_P2P_DEV_ADDR BIT(0) -#define BSS_PROBE_RESP_INCLUDE_P2P_IE BIT(1) - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -#define bssAssignAssocID(_prStaRec) ((_prStaRec)->ucIndex + 1) - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/* Routines for all Operation Modes */ -/*----------------------------------------------------------------------------*/ -P_STA_RECORD_T -bssCreateStaRecFromBssDesc ( - IN P_ADAPTER_T prAdapter, - IN ENUM_STA_TYPE_T eStaType, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_BSS_DESC_T prBssDesc - ); - -VOID -bssComposeNullFrame ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBuffer, - IN P_STA_RECORD_T prStaRec - ); - -VOID -bssComposeQoSNullFrame ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBuffer, - IN P_STA_RECORD_T prStaRec, - IN UINT_8 ucUP, - IN BOOLEAN fgSetEOSP - ); - -WLAN_STATUS -bssSendNullFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN PFN_TX_DONE_HANDLER pfTxDoneHandler - ); - -WLAN_STATUS -bssSendQoSNullFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN UINT_8 ucUP, - IN PFN_TX_DONE_HANDLER pfTxDoneHandler - ); - - -/*----------------------------------------------------------------------------*/ -/* Routines for both IBSS(AdHoc) and BSS(AP) */ -/*----------------------------------------------------------------------------*/ -VOID -bssGenerateExtSuppRate_IE ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - -VOID -bssBuildBeaconProbeRespFrameCommonIEs ( - IN P_MSDU_INFO_T prMsduInfo, - IN P_BSS_INFO_T prBssInfo, - IN PUINT_8 pucDestAddr - ); - -VOID -bssComposeBeaconProbeRespFrameHeaderAndFF ( - IN PUINT_8 pucBuffer, - IN PUINT_8 pucDestAddr, - IN PUINT_8 pucOwnMACAddress, - IN PUINT_8 pucBSSID, - IN UINT_16 u2BeaconInterval, - IN UINT_16 u2CapInfo - ); - -WLAN_STATUS -bssSendBeaconProbeResponse ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN PUINT_8 pucDestAddr, - IN UINT_32 u4ControlFlags - ); - -WLAN_STATUS -bssProcessProbeRequest ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -VOID -bssClearClientList ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo - ); - -VOID -bssAddStaRecToClientList ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo, - IN P_STA_RECORD_T prStaRec - ); - -VOID -bssRemoveStaRecFromClientList ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo, - IN P_STA_RECORD_T prStaRec - ); - - -/*----------------------------------------------------------------------------*/ -/* Routines for IBSS(AdHoc) only */ -/*----------------------------------------------------------------------------*/ -VOID -ibssProcessMatchedBeacon ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo, - IN P_BSS_DESC_T prBssDesc, - IN UINT_8 ucRCPI - ); - -WLAN_STATUS -ibssCheckCapabilityForAdHocMode ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc - ); - -VOID -ibssInitForAdHoc ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo - ); - -WLAN_STATUS -bssUpdateBeaconContent ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ); - - -/*----------------------------------------------------------------------------*/ -/* Routines for BSS(AP) only */ -/*----------------------------------------------------------------------------*/ -VOID -bssInitForAP ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo, - IN BOOLEAN fgIsRateUpdate - ); - -VOID -bssUpdateDTIMCount ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ); - -VOID -bssSetTIMBitmap ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo, - IN UINT_16 u2AssocId - ); - - -/*link function to p2p module for txBcnIETable*/ - -/* WMM-2.2.2 WMM ACI to AC coding */ -typedef enum _ENUM_ACI_T { - ACI_BE = 0, - ACI_BK = 1, - ACI_VI = 2, - ACI_VO = 3, - ACI_NUM -} ENUM_ACI_T, *P_ENUM_ACI_T; - -typedef enum _ENUM_AC_PRIORITY_T { - AC_BK_PRIORITY = 0, - AC_BE_PRIORITY, - AC_VI_PRIORITY, - AC_VO_PRIORITY -} ENUM_AC_PRIORITY_T, *P_ENUM_AC_PRIORITY_T; - - -#endif /* _BSS_H */ - diff --git a/drivers/net/wireless/mt5931/include/mgmt/cnm.h b/drivers/net/wireless/mt5931/include/mgmt/cnm.h deleted file mode 100755 index ec41a1155427..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/cnm.h +++ /dev/null @@ -1,323 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/cnm.h#1 $ -*/ - -/*! \file "cnm.h" - \brief -*/ - - - -/* -** $Log: cnm.h $ - * - * 06 23 2011 cp.wu - * [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module - * change parameter name from PeerAddr to BSSID - * - * 06 20 2011 cp.wu - * [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module - * 1. specify target's BSSID when requesting channel privilege. - * 2. pass BSSID information to firmware domain - * - * 04 12 2011 cm.chang - * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency - * . - * - * 03 10 2011 cm.chang - * [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module - * Add some functions to let AIS/Tethering or AIS/BOW be the same channel - * - * 01 12 2011 cm.chang - * [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module - * Provide function to decide if BSS can be activated or not - * - * 12 07 2010 cm.chang - * [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk - * 1. BSSINFO include RLM parameter - * 2. free all sta records when network is disconnected - * - * 08 24 2010 cm.chang - * NULL - * Support RLM initail channel of Ad-hoc, P2P and BOW - * - * 07 19 2010 cm.chang - * - * Set RLM parameters and enable CNM channel manager - * - * 07 13 2010 cm.chang - * - * Rename MSG_CH_RELEASE_T to MSG_CH_ABORT_T - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Rename MID_MNY_CNM_CH_RELEASE to MID_MNY_CNM_CH_ABORT - * - * 07 01 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Need bandwidth info when requesting channel privilege - * - * 07 01 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Modify CNM message handler for new flow - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add Power Management - Legacy PS-POLL support. - * - * 05 05 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add a new function to send abort message - * - * 03 16 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add AdHoc Mode - * - * 03 10 2010 kevin.huang - * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support - * Add Channel Manager for arbitration of JOIN and SCAN Req - * - * 02 08 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support partial part about cmd basic configuration - * - * Nov 18 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add prototype of cnmFsmEventInit() - * - * Nov 2 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -** -*/ - -#ifndef _CNM_H -#define _CNM_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -typedef enum _ENUM_CH_REQ_TYPE_T { - CH_REQ_TYPE_JOIN, - CH_REQ_TYPE_P2P_LISTEN, - - CH_REQ_TYPE_NUM -} ENUM_CH_REQ_TYPE_T, *P_ENUM_CH_REQ_TYPE_T; - -typedef struct _MSG_CH_REQ_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 ucNetTypeIndex; - UINT_8 ucTokenID; - UINT_8 ucPrimaryChannel; - ENUM_CHNL_EXT_T eRfSco; - ENUM_BAND_T eRfBand; - ENUM_CH_REQ_TYPE_T eReqType; - UINT_32 u4MaxInterval; /* In unit of ms */ - UINT_8 aucBSSID[6]; - UINT_8 aucReserved[2]; -} MSG_CH_REQ_T, *P_MSG_CH_REQ_T; - -typedef struct _MSG_CH_ABORT_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 ucNetTypeIndex; - UINT_8 ucTokenID; -} MSG_CH_ABORT_T, *P_MSG_CH_ABORT_T; - -typedef struct _MSG_CH_GRANT_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 ucNetTypeIndex; - UINT_8 ucTokenID; - UINT_8 ucPrimaryChannel; - ENUM_CHNL_EXT_T eRfSco; - ENUM_BAND_T eRfBand; - ENUM_CH_REQ_TYPE_T eReqType; - UINT_32 u4GrantInterval; /* In unit of ms */ -} MSG_CH_GRANT_T, *P_MSG_CH_GRANT_T; - -typedef struct _MSG_CH_REOCVER_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 ucNetTypeIndex; - UINT_8 ucTokenID; - UINT_8 ucPrimaryChannel; - ENUM_CHNL_EXT_T eRfSco; - ENUM_BAND_T eRfBand; - ENUM_CH_REQ_TYPE_T eReqType; -} MSG_CH_RECOVER_T, *P_MSG_CH_RECOVER_T; - - -typedef struct _CNM_INFO_T { - UINT_32 u4Reserved; -} CNM_INFO_T, *P_CNM_INFO_T; - -#if CFG_ENABLE_WIFI_DIRECT -/* Moved from p2p_fsm.h */ -typedef struct _DEVICE_TYPE_T { - UINT_16 u2CategoryId; /* Category ID */ - UINT_8 aucOui[4]; /* OUI */ - UINT_16 u2SubCategoryId; /* Sub Category ID */ -} __KAL_ATTRIB_PACKED__ DEVICE_TYPE_T, *P_DEVICE_TYPE_T; -#endif - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -VOID -cnmInit ( - P_ADAPTER_T prAdapter - ); - -VOID -cnmUninit ( - P_ADAPTER_T prAdapter - ); - -VOID -cnmChMngrRequestPrivilege ( - P_ADAPTER_T prAdapter, - P_MSG_HDR_T prMsgHdr - ); - -VOID -cnmChMngrAbortPrivilege ( - P_ADAPTER_T prAdapter, - P_MSG_HDR_T prMsgHdr - ); - -VOID -cnmChMngrHandleChEvent ( - P_ADAPTER_T prAdapter, - P_WIFI_EVENT_T prEvent - ); - -BOOLEAN -cnmPreferredChannel ( - P_ADAPTER_T prAdapter, - P_ENUM_BAND_T prBand, - PUINT_8 pucPrimaryChannel, - P_ENUM_CHNL_EXT_T prBssSCO - ); - -BOOLEAN -cnmAisInfraChannelFixed ( - P_ADAPTER_T prAdapter, - P_ENUM_BAND_T prBand, - PUINT_8 pucPrimaryChannel - ); - -VOID -cnmAisInfraConnectNotify ( - P_ADAPTER_T prAdapter - ); - -BOOLEAN -cnmAisIbssIsPermitted ( - P_ADAPTER_T prAdapter - ); - -BOOLEAN -cnmP2PIsPermitted ( - P_ADAPTER_T prAdapter - ); - -BOOLEAN -cnmBowIsPermitted ( - P_ADAPTER_T prAdapter - ); - -BOOLEAN -cnmBss40mBwPermitted ( - P_ADAPTER_T prAdapter, - ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#ifndef _lint -/* We don't have to call following function to inspect the data structure. - * It will check automatically while at compile time. - * We'll need this to guarantee the same member order in different structures - * to simply handling effort in some functions. - */ -__KAL_INLINE__ VOID -cnmMsgDataTypeCheck ( - VOID - ) -{ - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSG_CH_GRANT_T,rMsgHdr) == 0); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSG_CH_GRANT_T,rMsgHdr) == - OFFSET_OF(MSG_CH_RECOVER_T,rMsgHdr)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSG_CH_GRANT_T,ucNetTypeIndex) == - OFFSET_OF(MSG_CH_RECOVER_T,ucNetTypeIndex)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSG_CH_GRANT_T,ucTokenID) == - OFFSET_OF(MSG_CH_RECOVER_T,ucTokenID)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSG_CH_GRANT_T,ucPrimaryChannel) == - OFFSET_OF(MSG_CH_RECOVER_T,ucPrimaryChannel)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSG_CH_GRANT_T,eRfSco) == - OFFSET_OF(MSG_CH_RECOVER_T,eRfSco)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSG_CH_GRANT_T,eRfBand) == - OFFSET_OF(MSG_CH_RECOVER_T,eRfBand)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSG_CH_GRANT_T,eReqType) == - OFFSET_OF(MSG_CH_RECOVER_T,eReqType)); - - return; -} -#endif /* _lint */ - -#endif /* _CNM_H */ - - diff --git a/drivers/net/wireless/mt5931/include/mgmt/cnm_mem.h b/drivers/net/wireless/mt5931/include/mgmt/cnm_mem.h deleted file mode 100755 index ae08428153e1..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/cnm_mem.h +++ /dev/null @@ -1,1159 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/cnm_mem.h#1 $ -*/ - -/*! \file "cnm_mem.h" - \brief In this file we define the structure of the control unit of - packet buffer and MGT/MSG Memory Buffer. -*/ - - - -/* -** $Log: cnm_mem.h $ - * - * 03 02 2012 terry.wu - * NULL - * Snc CFG80211 modification for ICS migration from branch 2.2. - * - * 01 05 2012 tsaiyuan.hsu - * [WCXRP00001157] [MT6620 Wi-Fi][FW][DRV] add timing measurement support for 802.11v - * add timing measurement support for 802.11v. - * - * 03 17 2011 yuche.tsai - * NULL - * Resize the Secondary Device Type array when WiFi Direct is enabled. - * - * 03 16 2011 wh.su - * [WCXRP00000530] [MT6620 Wi-Fi] [Driver] skip doing p2pRunEventAAAComplete after send assoc response Tx Done - * enable the protected while at P2P start GO, and skip some security check . - * - * 01 26 2011 cm.chang - * [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument - * . - * - * 01 11 2011 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, - -Add per station flow control when STA is in PS - - - * Add per STA flow control when STA is in PS mode - * - * 12 29 2010 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, -Add per station flow control when STA is in PS - - * 1) PS flow control event - * - * 2) WMM IE in beacon, assoc resp, probe resp - * - * 12 23 2010 george.huang - * [WCXRP00000152] [MT6620 Wi-Fi] AP mode power saving function - * 1. update WMM IE parsing, with ASSOC REQ handling - * 2. extend U-APSD parameter passing from driver to FW - * - * 12 07 2010 cm.chang - * [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk - * 1. BSSINFO include RLM parameter - * 2. free all sta records when network is disconnected - * - * 11 29 2010 cm.chang - * [WCXRP00000210] [MT6620 Wi-Fi][Driver][FW] Set RCPI value in STA_REC for initial TX rate selection of auto-rate algorithm - * Sync RCPI of STA_REC to FW as reference of initial TX rate - * - * 10 18 2010 cp.wu - * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated - * 1. remove redundant variables in STA_REC structure - * 2. add STA-REC uninitialization routine for clearing pending events - * - * 09 21 2010 kevin.huang - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * Eliminate Linux Compile Warning - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 07 12 2010 cp.wu - * - * SAA will take a record for tracking request sequence number. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 07 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Support state of STA record change from 1 to 1 - * - * 07 01 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Support sync command of STA_REC - * - * 06 21 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * modify some code for concurrent network. - * - * 06 21 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Fix compile error for P2P related defination. - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 17 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Add P2P related fields. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * saa_fsm.c is migrated. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * restore utility function invoking via hem_mbox to direct calls - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add buildable & linkable ais_fsm.c - * - * related reference are still waiting to be resolved - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * hem_mbox is migrated. - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add hem_mbox.c and cnm_mem.h (but disabled some feature) for further migration - * - * 06 04 2010 george.huang - * [BORA00000678][MT6620]WiFi LP integration - * [BORA00000678] [MT6620]WiFi LP integration - * 1. add u8TimeStamp in MSDU_INFO - * 2. move fgIsRxTSFUpdated/fgIsTxTSFUpdated from static to BSS_INFO - * 3. add new member for supporting PM in STA_RECORD, which is for AP PS mode - * - * 05 31 2010 yarco.yang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add RX TSF Log Feature and ADDBA Rsp with DECLINE handling - * - * 05 28 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support checking of duplicated buffer free - * - * 05 28 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Move define of STA_REC_NUM to config.h and rename to CFG_STA_REC_NUM - * - * 05 21 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Refine txmInitWtblTxRateTable() - set TX initial rate according to AP's operation rate set - * - * 05 19 2010 yarco.yang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Fixed MAC RX Desc be overwritten issue - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add Power Management - Legacy PS-POLL support. - * - * 05 10 2010 yarco.yang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support Rx header translation for A-MSDU subframe - * - * 05 07 2010 george.huang - * [BORA00000678][MT6620]WiFi LP integration - * add more sanity check about setting timer - * - * 04 29 2010 george.huang - * [BORA00000678][MT6620]WiFi LP integration - * modify the compiling flag for RAM usage - * - * 04 28 2010 tehuang.liu - * [BORA00000605][WIFISYS] Phase3 Integration - * Modified some MQM-related data structures (SN counter, TX/RX BA table) - * - * 04 27 2010 tehuang.liu - * [BORA00000605][WIFISYS] Phase3 Integration - * Added new TX/RX BA tables in STA_REC - * - * 04 19 2010 kevin.huang - * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support - * Add Beacon Timeout Support and will send Null frame to diagnose connection - * - * 04 09 2010 tehuang.liu - * [BORA00000605][WIFISYS] Phase3 Integration - * [BORA00000644] WiFi phase 4 integration - * Added per-TID SN cache in STA_REC - * - * 03 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support power control - * - * 03 16 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add AdHoc Mode - * - * 03 11 2010 yuche.tsai - * [BORA00000343][MT6620] Emulation For TX - * . - * - * 03 05 2010 yarco.yang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Remove Emulation definition - * - * 03 04 2010 cp.wu - * [BORA00000368]Integrate HIF part into BORA - * eliminate HIF_EMULATION in cnm_mem.h - * - * 03 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add cnmStaRecChangeState() declaration. - * - * 03 03 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Remove compiling warning for some emulation flags - * - * 03 03 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * move the AIS specific variable for security to AIS specific structure. - * - * 03 03 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * Fixed the pre-authentication timer not correctly init issue, and modify the security related callback function prototype. - * - * 03 01 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * To store field AMPDU Parameters in STA_REC - * - * 02 26 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Added fgIsWmmSupported in STA_RECORD_T. - * - * 02 26 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Added fgIsUapsdSupported in STA_RECORD_T - * - * 02 13 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Added arTspecTable in STA_REC for TSPEC management - * - * 02 12 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Enable mgmt buffer debug by default - * - * 02 12 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Added BUFFER_SOURCE_BCN - * - * 02 10 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Renamed MSDU_INFO.ucFixedRateIndex as MSDU_INFO.ucFixedRateCode - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup - * - * 02 02 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Added SN info in MSDU_INFO_T - * - * 01 27 2010 wh.su - * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code - * add and fixed some security function. - * - * 01 11 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add Deauth and Disassoc Handler - * - * 01 08 2010 cp.wu - * [BORA00000368]Integrate HIF part into BORA - * 1) separate wifi_var_emu.c/.h from wifi_var.c/.h - * 2) eliminate HIF_EMULATION code sections appeared in wifi_var/cnm_mem - * 3) use cnmMemAlloc() instead to allocate SRAM buffer - * - * 12 31 2009 cp.wu - * [BORA00000368]Integrate HIF part into BORA - * 1) surpress debug message emitted from hal_hif.c - * 2) add two set of field for recording buffer process time - * - * 12 31 2009 cp.wu - * [BORA00000368]Integrate HIF part into BORA - * 1. move wifi task initialization from wifi_task.c(rom) to wifi_init.c (TCM) for integrating F/W download later - * * * * * 2. WIFI_Event_Dispatcher() prototype changed to return to suspend mode from normal operation mode - * * * * * 2. HIF emulation logic revised - * - * 12 29 2009 yuche.tsai - * [BORA00000343][MT6620] Emulation For TX - * .Using global buffer declaring by SD1 instead of using another one. - * - * 12 25 2009 tehuang.liu - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Integrated modifications for 1st connection (mainly on FW modules MQM, TXM, and RXM) - * * MQM: BA handling - * * TXM: Macros updates - * * RXM: Macros/Duplicate Removal updates - * - * 12 24 2009 yarco.yang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * 12 23 2009 cp.wu - * [BORA00000368]Integrate HIF part into BORA - * allocating SRAM for emulation purpose by ruducing MEM_BANK3_BUF_SZ - * - * 12 21 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Remove individual DATA_BUF_BLOCK_NUM definition for emulation compiling flagsu1rwduu`wvpghlqg|fh+fmdkb - * - * 12 21 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support several data buffer banks. - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * .For new FPGA memory size - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * 12 17 2009 george.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * Dec 17 2009 MTK02468 - * [BORA00000337] To check in codes for FPGA emulation - * Modified the DATA_BLOCK_SIZE from 1620 to 2048 - * - * Dec 16 2009 mtk01426 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add CFG_TEST_SEC_EMULATION flag - * - * Dec 9 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add HT cap to sta record - * - * Dec 9 2009 mtk02752 - * [BORA00000368] Integrate HIF part into BORA - * add cnmDataPktFree() for emulation loopback purpose - * - * Dec 8 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * add the buffer for key handshake 1x and cmd key order issue - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * move the tx call back function proto type to typedef.h - * - * Dec 3 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add cnmGetStaRecByAddress() and modify variable in STA_RECORD_T - * - * Dec 1 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * rename the port block flag - * - * Nov 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add variables to STA_RECORD_T for assoc/auth - * - * Nov 23 2009 mtk02468 - * [BORA00000337] To check in codes for FPGA emulation - * Fixed the value of STA_WAIT_QUEUE_NUM (from 7 to 5) - * - * Nov 20 2009 mtk02468 - * [BORA00000337] To check in codes for FPGA emulation - * Removed u2FrameLength from SW_RFB - * - * Nov 20 2009 mtk02468 - * [BORA00000337] To check in codes for FPGA emulation - * Fixed indenting - * - * Nov 20 2009 mtk02468 - * [BORA00000337] To check in codes for FPGA emulation - * Updated MSDU_INFO and SW_RFB - * - * Nov 19 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * update the variable for security - * - * Nov 18 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * remove the variable to make the compiler ok - * - * Nov 18 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * add the variable for security module - * - * Nov 16 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix typo in define of MSG_BUF_BLOCK_SIZE - * - * Nov 13 2009 mtk02468 - * [BORA00000337] To check in codes for FPGA emulation - * Let typedef STA_REC_T precede typedef MSDU_INFO_T and SW_RFB_T - * - * Nov 13 2009 mtk02468 - * [BORA00000337] To check in codes for FPGA emulation - * Modified MSDU_INFO and STA_REC for TXM and MQM - * - * Nov 12 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Rename STA_REC_T to STA_RECORD_T and add ucIndex member - * - * Nov 9 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Make sure ucBufferSource the same offset in MSDU_INFO and SW_RFB - * - * Nov 6 2009 mtk01426 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * - * - * Nov 5 2009 mtk01426 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * - * - * Nov 5 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Update comment - * - * Oct 30 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add draft content of MSDU_INFO_T and SW_RFB_T - * - * Oct 30 2009 mtk01084 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * - * - * Oct 28 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * - * - * Oct 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix lint warning - * - * Oct 21 2009 mtk01426 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add CFG_TEST_RX_EMULATION flag - * - * Oct 20 2009 mtk01426 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * - * - * Oct 9 2009 mtk02468 - * [BORA00000337] To check in codes for FPGA emulation - * Added field ucTC to MSDU_INFO_T and field pucHifRxPacket to SW_RFB_T - * - * Oct 8 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -** -*/ - -#ifndef _CNM_MEM_H -#define _CNM_MEM_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -#ifndef POWER_OF_2 -#define POWER_OF_2(n) BIT(n) -#endif - -/* Size of a basic management buffer block in power of 2 */ -#define MGT_BUF_BLOCK_SIZE_IN_POWER_OF_2 7 /* 7 to the power of 2 = 128 */ -#define MSG_BUF_BLOCK_SIZE_IN_POWER_OF_2 5 /* 5 to the power of 2 = 32 */ - -/* Size of a basic management buffer block */ -#define MGT_BUF_BLOCK_SIZE POWER_OF_2(MGT_BUF_BLOCK_SIZE_IN_POWER_OF_2) -#define MSG_BUF_BLOCK_SIZE POWER_OF_2(MSG_BUF_BLOCK_SIZE_IN_POWER_OF_2) - -/* Total size of (n) basic management buffer blocks */ -#define MGT_BUF_BLOCKS_SIZE(n) ((UINT_32)(n) << MGT_BUF_BLOCK_SIZE_IN_POWER_OF_2) -#define MSG_BUF_BLOCKS_SIZE(n) ((UINT_32)(n) << MSG_BUF_BLOCK_SIZE_IN_POWER_OF_2) - -/* Number of management buffer block */ -#define MAX_NUM_OF_BUF_BLOCKS 32 /* Range: 1~32 */ - -/* Size of overall management frame buffer */ -#define MGT_BUFFER_SIZE (MAX_NUM_OF_BUF_BLOCKS * MGT_BUF_BLOCK_SIZE) -#define MSG_BUFFER_SIZE (MAX_NUM_OF_BUF_BLOCKS * MSG_BUF_BLOCK_SIZE) - - -/* STA_REC related definitions */ -#define STA_REC_INDEX_BMCAST 0xFF -#define STA_REC_INDEX_NOT_FOUND 0xFE -#define STA_WAIT_QUEUE_NUM 5 /* Number of SW queues in each STA_REC: AC0~AC4 */ -#define SC_CACHE_INDEX_NUM 5 /* Number of SC caches in each STA_REC: AC0~AC4 */ - - -/* P2P related definitions */ -#ifdef CFG_ENABLE_WIFI_DIRECT -/* Moved from p2p_fsm.h */ -#define WPS_ATTRI_MAX_LEN_DEVICE_NAME 32 /* 0x1011 */ -#define P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT 8 /* NOTE(Kevin): Shall <= 16 */ -#endif - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -#if ((MAX_NUM_OF_BUF_BLOCKS > 32) || (MAX_NUM_OF_BUF_BLOCKS <= 0)) - #error > #define MAX_NUM_OF_MGT_BUF_BLOCKS : Out of boundary ! -#elif MAX_NUM_OF_BUF_BLOCKS > 16 - typedef UINT_32 BUF_BITMAP; -#elif MAX_NUM_OF_BUF_BLOCKS > 8 - typedef UINT_16 BUF_BITMAP; -#else - typedef UINT_8 BUF_BITMAP; -#endif /* MAX_NUM_OF_MGT_BUF_BLOCKS */ - - -/* Control variable of TX management memory pool */ -typedef struct _BUF_INFO_T { - PUINT_8 pucBuf; - -#if CFG_DBG_MGT_BUF - UINT_32 u4AllocCount; - UINT_32 u4FreeCount; - UINT_32 u4AllocNullCount; -#endif /* CFG_DBG_MGT_BUF */ - - BUF_BITMAP rFreeBlocksBitmap; - UINT_8 aucAllocatedBlockNum[MAX_NUM_OF_BUF_BLOCKS]; -} BUF_INFO_T, *P_BUF_INFO_T; - - -/* Wi-Fi divides RAM into three types - * MSG: Mailbox message (Small size) - * BUF: HW DMA buffers (HIF/MAC) - */ -typedef enum _ENUM_RAM_TYPE_T { - RAM_TYPE_MSG = 0, - RAM_TYPE_BUF -} ENUM_RAM_TYPE_T, P_ENUM_RAM_TYPE_T; - -typedef enum _ENUM_BUFFER_SOURCE_T { - BUFFER_SOURCE_HIF_TX0 =0, - BUFFER_SOURCE_HIF_TX1, - BUFFER_SOURCE_MAC_RX, - BUFFER_SOURCE_MNG, - BUFFER_SOURCE_BCN, - BUFFER_SOURCE_NUM -} ENUM_BUFFER_SOURCE_T, *P_ENUM_BUFFER_SOURCE_T; - - -typedef enum _ENUM_SEC_STATE_T { - SEC_STATE_INIT, - SEC_STATE_INITIATOR_PORT_BLOCKED, - SEC_STATE_RESPONDER_PORT_BLOCKED, - SEC_STATE_CHECK_OK, - SEC_STATE_SEND_EAPOL, - SEC_STATE_SEND_DEAUTH, - SEC_STATE_COUNTERMEASURE, - SEC_STATE_NUM -} ENUM_SEC_STATE_T; - -typedef struct _TSPEC_ENTRY_T { - UINT_8 ucStatus; - UINT_8 ucToken; /* Dialog Token in ADDTS_REQ or ADDTS_RSP */ - UINT_16 u2MediumTime; - UINT_32 u4TsInfo; - //PARAM_QOS_TS_INFO rParamTsInfo; - /* Add other retained QoS parameters below */ -} TSPEC_ENTRY_T, *P_TSPEC_ENTRY_T, TSPEC_TABLE_ENTRY_T, *P_TSPEC_TABLE_ENTRY_T; - -typedef struct _SEC_INFO_T { - - ENUM_SEC_STATE_T ePreviousState; - ENUM_SEC_STATE_T eCurrentState; - - BOOL fg2nd1xSend; - BOOL fgKeyStored; - - UINT_8 aucStoredKey[64]; - - BOOL fgAllowOnly1x; -} SEC_INFO_T, *P_SEC_INFO_T; - -#define MAX_NUM_CONCURRENT_FRAGMENTED_MSDUS 3 - -#define UPDATE_BSS_RSSI_INTERVAL_SEC 3 // Seconds - -/* Fragment information structure */ -typedef struct _FRAG_INFO_T { - UINT_16 u2NextFragSeqCtrl; - PUINT_8 pucNextFragStart; - P_SW_RFB_T pr1stFrag; - OS_SYSTIME rReceiveLifetimeLimit; /* The receive time of 1st fragment */ -} FRAG_INFO_T, *P_FRAG_INFO_T; - - -/* Define STA record structure */ -struct _STA_RECORD_T { - LINK_ENTRY_T rLinkEntry; - UINT_8 ucIndex; /* Not modify it except initializing */ - - BOOLEAN fgIsInUse; /* Indicate if this entry is in use or not */ - UINT_8 aucMacAddr[MAC_ADDR_LEN]; /* MAC address */ - - /* SAA/AAA */ - ENUM_AA_STATE_T eAuthAssocState; /* Store STATE Value used in SAA/AAA */ - UINT_8 ucAuthAssocReqSeqNum; - - ENUM_STA_TYPE_T eStaType; /* Indicate the role of this STA in - * the network (for example, P2P GO) - */ - - UINT_8 ucNetTypeIndex; /* ENUM_NETWORK_TYPE_INDEX_T */ - - UINT_8 ucStaState; /* STATE_1,2,3 */ - - UINT_8 ucPhyTypeSet; /* Available PHY Type Set of this peer - * (may deduced from received BSS_DESC_T) - */ - UINT_8 ucDesiredPhyTypeSet; /* The match result by AND operation of peer's - * PhyTypeSet and ours. - */ - BOOLEAN fgHasBasicPhyType; /* A flag to indicate a Basic Phy Type which - * is used to generate some Phy Attribute IE - * (e.g. capability, MIB) during association. - */ - UINT_8 ucNonHTBasicPhyType; /* The Basic Phy Type choosen among the - * ucDesiredPhyTypeSet. - */ - - UINT_16 u2CapInfo; /* For Infra Mode, to store Capability Info. from Association Resp(SAA). - * For AP Mode, to store Capability Info. from Association Req(AAA). - */ - UINT_16 u2AssocId; /* For Infra Mode, to store AID from Association Resp(SAA). - * For AP Mode, to store the Assigned AID(AAA). - */ - - UINT_16 u2ListenInterval; /* Listen Interval from STA(AAA) */ - - UINT_16 u2DesiredNonHTRateSet; /* Our Current Desired Rate Set after - * match with STA's Operational Rate Set - */ - - UINT_16 u2OperationalRateSet; /* Operational Rate Set of peer BSS */ - UINT_16 u2BSSBasicRateSet; /* Basic Rate Set of peer BSS */ - - BOOLEAN fgIsMerging; /* For IBSS Mode, to indicate that Merge is ongoing */ - - BOOLEAN fgDiagnoseConnection; /* For Infra/AP Mode, to diagnose the Connection with - * this peer by sending ProbeReq/Null frame */ - - /*------------------------------------------------------------------------------------------*/ - /* 802.11n HT capabilities when (prStaRec->ucPhyTypeSet & PHY_TYPE_BIT_HT) is true */ - /* They have the same definition with fields of information element */ - /*------------------------------------------------------------------------------------------*/ - UINT_8 ucMcsSet; /* MCS0~7 rate set of peer BSS */ - BOOLEAN fgSupMcs32; /* MCS32 is supported by peer BSS */ - UINT_16 u2HtCapInfo; /* HT cap info field by HT cap IE */ - UINT_8 ucAmpduParam; /* Field A-MPDU Parameters in HT cap IE */ - UINT_16 u2HtExtendedCap; /* HT extended cap field by HT cap IE */ - UINT_32 u4TxBeamformingCap; /* TX beamforming cap field by HT cap IE */ - UINT_8 ucAselCap; /* ASEL cap field by HT cap IE */ - - UINT_8 ucRCPI; /* RCPI of peer */ - - UINT_8 ucDTIMPeriod; /* Target BSS's DTIM Period, we use this - * value for setup Listen Interval - * TODO(Kevin): TBD - */ - UINT_8 ucAuthAlgNum; /* For Infra/AP Mode, the Auth Alogrithm Num used in Authentication(SAA/AAA) */ - BOOLEAN fgIsReAssoc; /* For Infra/AP Mode, to indicate ReAssoc Frame was in used(SAA/AAA) */ - - UINT_8 ucTxAuthAssocRetryCount;/* For Infra Mode, the Retry Count of TX Auth/Assod Frame(SAA) */ - UINT_8 ucTxAuthAssocRetryLimit;/* For Infra Mode, the Retry Limit of TX Auth/Assod Frame(SAA) */ - - UINT_16 u2StatusCode; /* Status of Auth/Assoc Req */ - UINT_16 u2ReasonCode; /* Reason that been Deauth/Disassoc */ - - - P_IE_CHALLENGE_TEXT_T prChallengeText; /* Point to an allocated buffer for storing Challenge Text for Shared Key Authentication */ - - TIMER_T rTxReqDoneOrRxRespTimer;/* For Infra Mode, a timer used to send a timeout event - * while waiting for TX request done or RX response. - */ - - /*------------------------------------------------------------------------------------------*/ - /* Power Management related fields (for STA/ AP/ P2P/ BOW power saving mode) */ - /*------------------------------------------------------------------------------------------*/ - BOOLEAN fgSetPwrMgtBit; /* For Infra Mode, to indicate that outgoing frame need toggle - * the Pwr Mgt Bit in its Frame Control Field. - */ - - BOOLEAN fgIsInPS; /* For AP Mode, to indicate the client PS state(PM). - * TRUE: In PS Mode; FALSE: In Active Mode. */ - - BOOLEAN fgIsInPsPollSP; /* For Infra Mode, to indicate we've sent a PS POLL to AP and start - * the PS_POLL Service Period(LP) - */ - - BOOLEAN fgIsInTriggerSP; /* For Infra Mode, to indicate we've sent a Trigger Frame to AP and start - * the Delivery Service Period(LP) - */ - - UINT_8 ucBmpDeliveryAC; /* 0: AC0, 1: AC1, 2: AC2, 3: AC3 */ - - UINT_8 ucBmpTriggerAC; /* 0: AC0, 1: AC1, 2: AC2, 3: AC3 */ - - UINT_8 ucUapsdSp; /* Max SP length */ - - /*------------------------------------------------------------------------------------------*/ - - BOOLEAN fgIsRtsEnabled; - - OS_SYSTIME rUpdateTime; /* (4) System Timestamp of Successful TX and RX */ - - OS_SYSTIME rLastJoinTime; /* (4) System Timestamp of latest JOIN process */ - - UINT_8 ucJoinFailureCount; /* Retry Count of JOIN process */ - - LINK_T arStaWaitQueue[STA_WAIT_QUEUE_NUM]; /* For TXM to defer pkt forwarding to MAC TX DMA */ - - UINT_16 au2CachedSeqCtrl[TID_NUM + 1]; /* Duplicate removal for HT STA on a per-TID basis ("+1" is for MMPDU and non-QoS) */ - -#if 0 - /* RXM */ - P_RX_BA_ENTRY_T aprRxBaTable[TID_NUM]; - - /* TXM */ - P_TX_BA_ENTRY_T aprTxBaTable[TID_NUM]; -#endif - - FRAG_INFO_T rFragInfo[MAX_NUM_CONCURRENT_FRAGMENTED_MSDUS]; - - SEC_INFO_T rSecInfo; /* The security state machine */ - - BOOLEAN fgPortBlock; /* The 802.1x Port Control flag */ - - BOOLEAN fgTransmitKeyExist; /* Unicast key exist for this STA */ - - UINT_8 ucWTEntry; - - BOOLEAN fgTxAmpduEn; /* Enable TX AMPDU for this Peer */ - BOOLEAN fgRxAmpduEn; /* Enable RX AMPDU for this Peer */ - - PUINT_8 pucAssocReqIe; - UINT_16 u2AssocReqIeLen; - /*------------------------------------------------------------------------------------------*/ - /* WMM/QoS related fields */ - /*------------------------------------------------------------------------------------------*/ - BOOLEAN fgIsQoS; /* If the STA is associated as a QSTA or QAP (for TX/RX) */ - BOOLEAN fgIsWmmSupported; /* If the peer supports WMM, set to TRUE (for association)*/ - BOOLEAN fgIsUapsdSupported; /* Set according to the scan result (for association) */ - - /*------------------------------------------------------------------------------------------*/ - /* P2P related fields */ - /*------------------------------------------------------------------------------------------*/ -#if CFG_ENABLE_WIFI_DIRECT - UINT_8 u2DevNameLen; - UINT_8 aucDevName[WPS_ATTRI_MAX_LEN_DEVICE_NAME]; - - UINT_8 aucDevAddr[MAC_ADDR_LEN]; /* P2P Device Address */ - - UINT_16 u2ConfigMethods; - - UINT_8 ucDeviceCap; - - UINT_8 ucSecondaryDevTypeCount; - - DEVICE_TYPE_T rPrimaryDevTypeBE; - - DEVICE_TYPE_T arSecondaryDevTypeBE[P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT]; -#endif /* CFG_SUPPORT_P2P */ - - - /*------------------------------------------------------------------------------------------*/ - /* QM related fields */ - /*------------------------------------------------------------------------------------------*/ - - UINT_8 ucFreeQuota; /* Per Sta flow controal. Valid when fgIsInPS is TRUE. Chnage it for per Queue flow control */ - //UINT_8 aucFreeQuotaPerQueue[NUM_OF_PER_STA_TX_QUEUES]; /* used in future */ - UINT_8 ucFreeQuotaForDelivery; - UINT_8 ucFreeQuotaForNonDelivery; - -#if 1 - /*------------------------------------------------------------------------------------------*/ - /* To be removed, this is to make que_mgt compilation success only */ - /*------------------------------------------------------------------------------------------*/ - /* When this STA_REC is in use, set to TRUE. */ - BOOLEAN fgIsValid; - - /* Per-STA Queues: [0] AC0, [1] AC1, [2] AC2, [3] AC3, [4] 802.1x */ - QUE_T arTxQueue[NUM_OF_PER_STA_TX_QUEUES]; - - /* When this STA is in PS Mode, set to TRUE. */ - //BOOLEAN fgIsPS; - - /* When this STA enters Power-Saving, FW will notify the driver with a Session ID */ - UINT_8 ucPsSessionID; - - BOOLEAN fgIsAp; - - /* Reorder Parameter reference table */ - P_RX_BA_ENTRY_T aprRxReorderParamRefTbl[CFG_RX_MAX_BA_TID_NUM]; -#endif - -#if CFG_SUPPORT_802_11V_TIMING_MEASUREMENT - TIMINGMSMT_PARAM_T rWNMTimingMsmt; -#endif -}; - -#if 0 -/* use nic_tx.h instead */ -/* MSDU_INFO and SW_RFB structure */ -typedef struct _MSDU_INFO_T { - - //4 /* ----------------MSDU_INFO and SW_RFB Common Fields------------------ */ - - LINK_ENTRY_T rLinkEntry; - PUINT_8 pucBuffer; /* Pointer to the associated buffer */ - - UINT_8 ucBufferSource; /* HIF TX0, HIF TX1, MAC RX, or MNG Pool */ - UINT_8 ucNetworkTypeIndex; /* Network type index that this TX packet is assocaited with */ - UINT_8 ucTC; /* 0 to 5 (used by HIF TX to increment the corresponding TC counter) */ - UINT_8 ucTID; /* Traffic Identification */ - - BOOLEAN fgIs802_11Frame; /* Set to TRUE for 802.11 frame */ - UINT_8 ucMacHeaderLength; - UINT_16 u2PayloadLength; - PUINT_8 pucMacHeader; /* 802.11 header */ - PUINT_8 pucPayload; /* 802.11 payload */ - - OS_SYSTIME rArrivalTime; /* System Timestamp (4) */ - P_STA_RECORD_T prStaRec; - -#if CFG_PROFILE_BUFFER_TRACING - ENUM_BUFFER_ACTIVITY_TYPE_T eActivity[2]; - UINT_32 rActivityTime[2]; -#endif -#if DBG && CFG_BUFFER_FREE_CHK - BOOLEAN fgBufferInSource; -#endif - - UINT_8 ucControlFlag; /* For specify some Control Flags, e.g. Basic Rate */ - - //4 /* -----------------------Non-Common ------------------------- */ - /* TODO: move flags to ucControlFlag */ - - BOOLEAN fgIs1xFrame; /* Set to TRUE for 802.1x frame */ - - /* TXM: For TX Done handling, callback function & parameter (5) */ - BOOLEAN fgIsTxFailed; /* Set to TRUE if transmission failure */ - - PFN_TX_DONE_HANDLER pfTxDoneHandler; - - UINT_64 u8TimeStamp; /* record the TX timestamp */ - - /* TXM: For PS forwarding control (per-STA flow control) */ - UINT_8 ucPsForwardingType; /* Delivery-enabled, non-delivery-enabled, non-PS */ - UINT_8 ucPsSessionID; /* The Power Save session id for PS forwarding control*/ - - /* TXM: For MAC TX DMA operations */ - UINT_8 ucMacTxQueIdx; /* MAC TX queue: AC0-AC6, BCM, or BCN */ - BOOLEAN fgNoAck; /* Set to true if Ack is not requred for this packet */ - BOOLEAN fgBIP; /* Set to true if BIP is used for this packet */ - UINT_8 ucFragTotalCount; - UINT_8 ucFragFinishedCount; - UINT_16 u2FragThreshold; /* Fragmentation threshold without WLAN Header & FCS */ - BOOLEAN fgFixedRate; /* If a fixed rate is used, set to TRUE. */ - UINT_8 ucFixedRateCode; /* The rate code copied to MAC TX Desc */ - UINT_8 ucFixedRateRetryLimit; /* The retry limit when a fixed rate is used */ - BOOLEAN fgIsBmcQueueEnd; /* Set to true if this packet is the end of BMC */ - - /* TXM: For flushing ACL frames */ - UINT_16 u2PalLLH; /* 802.11 PAL LLH */ - //UINT_16 u2LLH; - UINT_16 u2ACLSeq; /* u2LLH+u2ACLSeq for AM HCI flush ACL frame */ - - /* TXM for retransmitting a flushed packet */ - BOOLEAN fgIsSnAssigned; - UINT_16 u2SequenceNumber; /* To remember the Sequence Control field of this MPDU */ - -} MSDU_INFO_T, *P_MSDU_INFO_T; -#endif - -#if 0 -/* nic_rx.h */ -typedef struct _SW_RFB_T { - - //4 /* ----------------MSDU_INFO and SW_RFB Common Fields------------------ */ - - LINK_ENTRY_T rLinkEntry; - PUINT_8 pucBuffer; /* Pointer to the associated buffer */ - - UINT_8 ucBufferSource; /* HIF TX0, HIF TX1, MAC RX, or MNG Pool */ - UINT_8 ucNetworkTypeIndex; /* Network type index that this TX packet is assocaited with */ - UINT_8 ucTC; /* 0 to 5 (used by HIF TX to increment the corresponding TC counter) */ - UINT_8 ucTID; /* Traffic Identification */ - - BOOLEAN fgIs802_11Frame; /* Set to TRUE for 802.11 frame */ - UINT_8 ucMacHeaderLength; - UINT_16 u2PayloadLength; - PUINT_8 pucMacHeader; /* 802.11 header */ - PUINT_8 pucPayload; /* 802.11 payload */ - - OS_SYSTIME rArrivalTime; /* System Timestamp (4) */ - P_STA_RECORD_T prStaRec; - -#if CFG_PROFILE_BUFFER_TRACING - ENUM_BUFFER_ACTIVITY_TYPE_T eActivity[2]; - UINT_32 rActivityTime[2]; -#endif -#if DBG && CFG_BUFFER_FREE_CHK - BOOLEAN fgBufferInSource; -#endif - - UINT_8 ucControlFlag; /* For specify some Control Flags, e.g. Basic Rate */ - - //4 /* -----------------------Non-Common ------------------------- */ - - /* For composing the HIF RX Header (TODO: move flags to ucControlFlag) */ - PUINT_8 pucHifRxPacket; /* Pointer to the Response packet to HIF RX0 or RX1 */ - UINT_16 u2HifRxPacketLength; - UINT_8 ucHeaderOffset; - UINT_8 ucHifRxPortIndex; - - UINT_16 u2SequenceControl; - BOOLEAN fgIsA4Frame; /* (For MAC RX packet parsing) set to TRUE if 4 addresses are present */ - BOOLEAN fgIsBAR; - BOOLEAN fgIsQoSData; - BOOLEAN fgIsAmsduSubframe; /* Set to TRUE for A-MSDU Subframe */ - - /* For HIF RX DMA Desc */ - BOOLEAN fgTUChecksumCheckRequired; - BOOLEAN fgIPChecksumCheckRequired; - UINT_8 ucEtherTypeOffset; - -} SW_RFB_T, *P_SW_RFB_T; -#endif - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -P_MSDU_INFO_T -cnmMgtPktAlloc ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Length - ); - -VOID -cnmMgtPktFree ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - -VOID -cnmMemInit ( - IN P_ADAPTER_T prAdapter - ); - -PVOID -cnmMemAlloc ( - IN P_ADAPTER_T prAdapter, - IN ENUM_RAM_TYPE_T eRamType, - IN UINT_32 u4Length - ); - -VOID -cnmMemFree ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvMemory - ); - -VOID -cnmStaRecInit ( - IN P_ADAPTER_T prAdapter - ); - -VOID -cnmStaRecUninit ( - IN P_ADAPTER_T prAdapter - ); - -P_STA_RECORD_T -cnmStaRecAlloc ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucNetTypeIndex - ); - -VOID -cnmStaRecFree ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN BOOLEAN fgSyncToChip - ); - -VOID -cnmStaFreeAllStaByNetType ( - P_ADAPTER_T prAdapter, - ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - BOOLEAN fgSyncToChip - ); - -P_STA_RECORD_T -cnmGetStaRecByIndex ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucIndex - ); - -P_STA_RECORD_T -cnmGetStaRecByAddress ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucNetTypeIndex, - IN UINT_8 aucPeerMACAddress[] - ); - -VOID -cnmStaRecResetStatus ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ); - -VOID -cnmStaRecChangeState ( - IN P_ADAPTER_T prAdapter, - IN OUT P_STA_RECORD_T prStaRec, - IN UINT_8 ucNewState - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#ifndef _lint -/* Kevin: we don't have to call following function to inspect the data structure. - * It will check automatically while at compile time. - * We'll need this for porting driver to different RTOS. - */ -__KAL_INLINE__ VOID -cnmMemDataTypeCheck ( - VOID - ) -{ -#if 0 - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,rLinkEntry) == 0); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,rLinkEntry) == OFFSET_OF(SW_RFB_T,rLinkEntry)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,pucBuffer) == OFFSET_OF(SW_RFB_T,pucBuffer)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,ucBufferSource) == - OFFSET_OF(SW_RFB_T,ucBufferSource)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,pucMacHeader) == - OFFSET_OF(SW_RFB_T,pucMacHeader)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,ucMacHeaderLength) == - OFFSET_OF(SW_RFB_T,ucMacHeaderLength)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,pucPayload) == - OFFSET_OF(SW_RFB_T,pucPayload)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,u2PayloadLength) == - OFFSET_OF(SW_RFB_T,u2PayloadLength)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,prStaRec) == - OFFSET_OF(SW_RFB_T,prStaRec)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,ucNetworkTypeIndex) == - OFFSET_OF(SW_RFB_T,ucNetworkTypeIndex)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,ucTID) == - OFFSET_OF(SW_RFB_T,ucTID)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,fgIs802_11Frame) == - OFFSET_OF(SW_RFB_T,fgIs802_11Frame)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,ucControlFlag) == - OFFSET_OF(SW_RFB_T,ucControlFlag)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,rArrivalTime) == - OFFSET_OF(SW_RFB_T,rArrivalTime)); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,ucTC) == - OFFSET_OF(SW_RFB_T,ucTC)); - -#if CFG_PROFILE_BUFFER_TRACING - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,eActivity[0]) == - OFFSET_OF(SW_RFB_T,eActivity[0])); - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,rActivityTime[0]) == - OFFSET_OF(SW_RFB_T,rActivityTime[0])); -#endif - -#if DBG && CFG_BUFFER_FREE_CHK - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(MSDU_INFO_T,fgBufferInSource) == - OFFSET_OF(SW_RFB_T,fgBufferInSource)); -#endif - - - DATA_STRUC_INSPECTING_ASSERT( - OFFSET_OF(STA_RECORD_T,rLinkEntry) == 0); - - return; -#endif -} -#endif /* _lint */ - -#endif /* _CNM_MEM_H */ - - diff --git a/drivers/net/wireless/mt5931/include/mgmt/cnm_scan.h b/drivers/net/wireless/mt5931/include/mgmt/cnm_scan.h deleted file mode 100755 index b3d2993f801a..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/cnm_scan.h +++ /dev/null @@ -1,206 +0,0 @@ -/* -** $Id: @(#) -*/ - -/*! \file "cnm_scan.h" - \brief - -*/ - - - -/* -** $Log: cnm_scan.h $ - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 05 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * remove unused definitions. - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * implementation of DRV-SCN and related mailbox message handling. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge cnm_scan.h and hem_mbox.h - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add Power Management - Legacy PS-POLL support. - * - * 03 30 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support 2.4G OBSS scan - * - * 03 16 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add AdHoc Mode - * - * 03 10 2010 kevin.huang - * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support - * - * * * * Add Channel Manager for arbitration of JOIN and SCAN Req - * - * 02 23 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add support scan channel 1~14 and update scan result's frequency infou1rwduu`wvpghlqg|n`slk+mpdkb - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup - * - * Nov 18 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add function prototype of cnmScanInit() - * - * Nov 5 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -** -*/ - -#ifndef _CNM_SCAN_H -#define _CNM_SCAN_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define SCN_CHANNEL_DWELL_TIME_MIN_MSEC 12 -#define SCN_CHANNEL_DWELL_TIME_EXT_MSEC 98 - -#define SCN_TOTAL_PROBEREQ_NUM_FOR_FULL 3 -#define SCN_SPECIFIC_PROBEREQ_NUM_FOR_FULL 1 - -#define SCN_TOTAL_PROBEREQ_NUM_FOR_PARTIAL 2 -#define SCN_SPECIFIC_PROBEREQ_NUM_FOR_PARTIAL 1 - - -#define SCN_INTERLACED_CHANNEL_GROUPS_NUM 3 /* Used by partial scan */ - -#define SCN_PARTIAL_SCAN_NUM 3 - -#define SCN_PARTIAL_SCAN_IDLE_MSEC 100 - -#define MAXIMUM_OPERATION_CHANNEL_LIST 32 - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -/* The type of Scan Source */ -typedef enum _ENUM_SCN_REQ_SOURCE_T { - SCN_REQ_SOURCE_HEM = 0, - SCN_REQ_SOURCE_NET_FSM, - SCN_REQ_SOURCE_ROAMING, /* ROAMING Module is independent of AIS FSM */ - SCN_REQ_SOURCE_OBSS, /* 2.4G OBSS scan */ - SCN_REQ_SOURCE_NUM -} ENUM_SCN_REQ_SOURCE_T, *P_ENUM_SCN_REQ_SOURCE_T; - -typedef enum _ENUM_SCAN_PROFILE_T { - SCAN_PROFILE_FULL = 0, - SCAN_PROFILE_PARTIAL, - SCAN_PROFILE_VOIP, - SCAN_PROFILE_FULL_2G4, - SCAN_PROFILE_NUM -} ENUM_SCAN_PROFILE_T, *P_ENUM_SCAN_PROFILE_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#if 0 -VOID -cnmScanInit ( - VOID - ); - -VOID -cnmScanRunEventScanRequest ( - IN P_MSG_HDR_T prMsgHdr - ); - -BOOLEAN -cnmScanRunEventScanAbort ( - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -cnmScanProfileSelection ( - VOID - ); - -VOID -cnmScanProcessStart ( - VOID - ); - -VOID -cnmScanProcessStop ( - VOID - ); - -VOID -cnmScanRunEventReqAISAbsDone ( - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -cnmScanRunEventCancelAISAbsDone ( - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -cnmScanPartialScanTimeout ( - UINT_32 u4Param - ); - -VOID -cnmScanRunEventScnFsmComplete ( - IN P_MSG_HDR_T prMsgHdr - ); -#endif - - - -#endif /* _CNM_SCAN_H */ - - diff --git a/drivers/net/wireless/mt5931/include/mgmt/cnm_timer.h b/drivers/net/wireless/mt5931/include/mgmt/cnm_timer.h deleted file mode 100755 index b1ed2c6456ad..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/cnm_timer.h +++ /dev/null @@ -1,274 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/cnm_timer.h#1 $ -*/ - -/*! \file cnm_timer.h - \brief Declaration of timer obj and related timer macro for setup time out - event. - - In this file we declare the timer object and provide several macro for - Protocol functional blocks to setup their own time out event. -*/ - - - -/* -** $Log: cnm_timer.h $ - * - * 12 13 2011 cm.chang - * [WCXRP00001136] [All Wi-Fi][Driver] Add wake lock for pending timer - * Add wake lock if timer timeout value is smaller than 5 seconds - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * cnm_timer has been migrated. - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add hem_mbox.c and cnm_mem.h (but disabled some feature) for further migration - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge cnm_scan.h and hem_mbox.h - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge wifi_var.h, precomp.h, cnm_timer.h (data type only) - * - * 06 04 2010 george.huang - * [BORA00000678][MT6620]WiFi LP integration - * [PM] Support U-APSD for STA mode - * - * 04 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Return timer token back to COS when entering wait off state - * - * 01 08 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support longer timeout interval to 45 days from 65secu1rwduu`wvpghlqg|fh+fmdkb - * - * 01 06 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Fix system time is 32KHz instead of 1ms - * - * Nov 23 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * add the copy time function - * - * Nov 5 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix LINT warnning - * - * Oct 28 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -** -*/ - -#ifndef _CNM_TIMER_H -#define _CNM_TIMER_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#undef MSEC_PER_SEC -#define MSEC_PER_SEC 1000 -#undef USEC_PER_MSEC -#define USEC_PER_MSEC 1000 -#define USEC_PER_TU 1024 /* microsecond */ - -#define MSEC_PER_MIN (60 * MSEC_PER_SEC) - - -#define MGMT_MAX_TIMEOUT_INTERVAL ((UINT_32)0x7fffffff) - -#define WAKE_LOCK_MAX_TIME 5 /* Unit: sec */ - -/* If WAKE_LOCK_MAX_TIME is too large, the whole system may always keep awake - * because of periodic timer of OBSS scanning - */ -#if (WAKE_LOCK_MAX_TIME >= OBSS_SCAN_MIN_INTERVAL) - #error WAKE_LOCK_MAX_TIME is too large -#endif - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef VOID (*PFN_MGMT_TIMEOUT_FUNC)(P_ADAPTER_T, UINT_32); - -typedef struct _TIMER_T { - LINK_ENTRY_T rLinkEntry; - OS_SYSTIME rExpiredSysTime; - UINT_16 u2Minutes; - UINT_16 u2Reserved; - UINT_32 u4Data; - PFN_MGMT_TIMEOUT_FUNC pfMgmtTimeOutFunc; -} TIMER_T, *P_TIMER_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -/* Check if time "a" is before time "b" */ -/* In 32-bit variable, 0x00000001~0x7fffffff -> positive number, - * 0x80000000~0xffffffff -> negative number - */ -#define TIME_BEFORE_64bit(a,b) (a < b) - -#define TIME_BEFORE(a,b) ((UINT_32)((UINT_32)(a) - (UINT_32)(b)) > 0x7fffffff) - -/* #define TIME_BEFORE(a,b) ((INT_32)((INT_32)(b) - (INT_32)(a)) > 0) - * may cause UNexpect result between Free build and Check build for WinCE - */ - -#define TIME_AFTER(a,b) TIME_BEFORE(b,a) - -#define SYSTIME_TO_SEC(_systime) ((_systime) / KAL_HZ) -#define SEC_TO_SYSTIME(_sec) ((_sec) * KAL_HZ) - - -/* The macros to convert second & millisecond */ -#define MSEC_TO_SEC(_msec) ((_msec) / MSEC_PER_SEC) -#define SEC_TO_MSEC(_sec) ((UINT_32)(_sec) * MSEC_PER_SEC) - - -/* The macros to convert millisecond & microsecond */ -#define USEC_TO_MSEC(_usec) ((_usec) / USEC_PER_MSEC) -#define MSEC_TO_USEC(_msec) ((UINT_32)(_msec) * USEC_PER_MSEC) - - -/* The macros to convert TU & microsecond, TU & millisecond */ -#define TU_TO_USEC(_tu) ((_tu) * USEC_PER_TU) -#define TU_TO_MSEC(_tu) USEC_TO_MSEC( TU_TO_USEC(_tu) ) - - -/* The macros to convert TU & & OS system time, round up by 0.5 */ -#define TU_TO_SYSTIME(_tu) MSEC_TO_SYSTIME( TU_TO_MSEC(_tu) ) -#define SYSTIME_TO_TU(_systime) \ - ((SYSTIME_TO_USEC(_systime) + ((USEC_PER_TU / 2) - 1)) / USEC_PER_TU) - - -/* The macros to convert OS system time & microsecond */ -#define SYSTIME_TO_USEC(_systime) (SYSTIME_TO_MSEC(_systime) * USEC_PER_MSEC) - - -/* The macro to get the current OS system time */ -#define GET_CURRENT_SYSTIME(_systime_p) {*(_systime_p) = kalGetTimeTick();} - -/* The macro to copy the system time */ -#define COPY_SYSTIME(_destTime, _srcTime) (_destTime) = (_srcTime) - -/* The macro to get the system time difference between t1 and t2 (t1 - t2) */ -/* #define GET_SYSTIME_DIFFERENCE(_time1, _time2, _diffTime) \ - (_diffTime) = (_time1) - (_time2) */ - -/* The macro to check for the expiration, if TRUE means _currentTime >= _expirationTime */ -#define CHECK_FOR_EXPIRATION(_currentTime, _expirationTime) \ - ( ((UINT_32)(_currentTime) - (UINT_32)(_expirationTime)) <= 0x7fffffffUL) - -/* The macro to check for the timeout */ -#define CHECK_FOR_TIMEOUT(_currentTime, _timeoutStartingTime, _timeout) \ - CHECK_FOR_EXPIRATION((_currentTime), ((_timeoutStartingTime) + (_timeout))) - -/* The macro to set the expiration time with a specified timeout *//* Watch out for round up.*/ -#define SET_EXPIRATION_TIME(_expirationTime, _timeout) \ - { \ - GET_CURRENT_SYSTIME(&(_expirationTime)); \ - (_expirationTime) += (OS_SYSTIME)(_timeout); \ - } - -#define timerRenewTimer(adapter,tmr,interval) \ - timerStartTimer(adapter,tmr,interval,(tmr)->function,(tmr)->data) - -#define MGMT_INIT_TIMER(_adapter_p, _timer, _callbackFunc) \ - timerInitTimer(_adapter_p, &(_timer), (UINT_32)(_callbackFunc)) - - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -VOID -cnmTimerInitialize ( - IN P_ADAPTER_T prAdapter - ); - -VOID -cnmTimerDestroy ( - IN P_ADAPTER_T prAdapter - ); - -VOID -cnmTimerInitTimer ( - IN P_ADAPTER_T prAdapter, - IN P_TIMER_T prTimer, - IN PFN_MGMT_TIMEOUT_FUNC pfFunc, - IN UINT_32 u4Data - ); - -VOID -cnmTimerStopTimer ( - IN P_ADAPTER_T prAdapter, - IN P_TIMER_T prTimer - ); - -VOID -cnmTimerStartTimer ( - IN P_ADAPTER_T prAdapter, - IN P_TIMER_T prTimer, - IN UINT_32 u4TimeoutMs - ); - -VOID -cnmTimerDoTimeOutCheck ( - IN P_ADAPTER_T prAdapter - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -__KAL_INLINE__ -INT_32 -timerPendingTimer ( - IN P_TIMER_T prTimer - ) -{ - ASSERT(prTimer); - - return prTimer->rLinkEntry.prNext != NULL; -} - -#endif /* _CNM_TIMER_H */ - - diff --git a/drivers/net/wireless/mt5931/include/mgmt/hem_mbox.h b/drivers/net/wireless/mt5931/include/mgmt/hem_mbox.h deleted file mode 100755 index d01c9c211f87..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/hem_mbox.h +++ /dev/null @@ -1,441 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/hem_mbox.h#2 $ -*/ - -/*! \file hem_mbox.h - \brief - -*/ - - - -/* -** $Log: hem_mbox.h $ -** -** 07 26 2012 yuche.tsai -** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot -** Update driver code of ALPS.JB for hot-spot. -** -** 07 19 2012 yuche.tsai -** NULL -** Code update for JB. - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 07 18 2011 cp.wu - * [WCXRP00000858] [MT5931][Driver][Firmware] Add support for scan to search for more than one SSID in a single scanning request - * add framework in driver domain for supporting new SCAN_REQ_V2 for more than 1 SSID support as well as uProbeDelay in NDIS 6.x driver model - * - * 06 07 2011 yuche.tsai - * [WCXRP00000696] [Volunteer Patch][MT6620][Driver] Infinite loop issue when RX invitation response.[WCXRP00000763] [Volunteer Patch][MT6620][Driver] RX Service Discovery Frame under AP mode Issue - * Add invitation support. - * - * 06 02 2011 cp.wu - * [WCXRP00000681] [MT5931][Firmware] HIF code size reduction - * eliminate unused parameters for SAA-FSM - * - * 01 26 2011 cm.chang - * [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument - * Allocate system RAM if fixed message or mgmt buffer is not available - * - * 11 08 2010 cm.chang - * [WCXRP00000169] [MT6620 Wi-Fi][Driver][FW] Remove unused CNM recover message ID - * Remove CNM channel reover message ID - * - * 09 16 2010 cm.chang - * NULL - * Remove unused message ID - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 30 2010 cp.wu - * NULL - * eliminate klockwork errors - * - * 08 25 2010 george.huang - * NULL - * update OID/ registry control path for PM related settings - * - * 08 23 2010 chinghwa.yu - * NULL - * Update for BOW. - * - * 08 16 2010 cp.wu - * NULL - * add interface for RLM to trigger OBSS-SCAN. - * - * 08 11 2010 yuche.tsai - * NULL - * Add some message ID for P2P FSM under provisioning phase. - * - * 08 11 2010 yuche.tsai - * NULL - * Add Message Event ID for P2P Module. - * - * 08 05 2010 yuche.tsai - * NULL - * Check-in P2P Device Discovery Feature. - * - * 08 04 2010 cp.wu - * NULL - * remove unused mailbox message definitions. - * - * 08 02 2010 yuche.tsai - * NULL - * P2P Group Negotiation Code Check in. - * - * 07 19 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * message table should not be commented out by compilation option without modifying header file - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Rename MID_MNY_CNM_CH_RELEASE to MID_MNY_CNM_CH_ABORT - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * AIS-FSM integration with CNM channel request messages - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * implementation of DRV-SCN and related mailbox message handling. - * - * 07 01 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Modify CNM message handler for new flow - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * restore utility function invoking via hem_mbox to direct calls - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * auth.c is migrated. - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add buildable & linkable ais_fsm.c - * - * related reference are still waiting to be resolved - * - * 06 09 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add definitions for module migration. - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * hem_mbox is migrated. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge cnm_scan.h and hem_mbox.h - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add Power Management - Legacy PS-POLL support. - * - * 04 29 2010 tehuang.liu - * [BORA00000605][WIFISYS] Phase3 Integration - * Removed MID_RXM_MQM_QOS_ACTION_FRAME - * - * 04 29 2010 tehuang.liu - * [BORA00000605][WIFISYS] Phase3 Integration - * Removed MID_RXM_MQM_BA_ACTION_FRAME - * - * 03 30 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support 2.4G OBSS scan - * - * 03 16 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add AdHoc Mode - * - * 03 10 2010 kevin.huang - * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support - * - * * * * * Add Channel Manager for arbitration of JOIN and SCAN Req - * - * 03 05 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Develop partial DPD code - * - * 02 11 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Added MID_RXM_MQM_QOS_ACTION_FRAME for RXM to indicate QoS Action frames to MQM - * - * 01 11 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add Deauth and Disassoc Handler - * - * Dec 7 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Rename the parameter of mboxDummy() - * - * Dec 2 2009 MTK02468 - * [BORA00000337] To check in codes for FPGA emulation - * Added MID_RXM_MQM_BA_ACTION_FRAME - * - * Nov 24 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Remove Dummy MSG ID - * - * Nov 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add JOIN REQ related MSG ID - * - * Nov 16 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add AIS ABORT MSG ID - * - * Nov 5 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add SCN MSG IDs - * - * Oct 28 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -*/ - -#ifndef _HEM_MBOX_H -#define _HEM_MBOX_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -/* Message IDs */ -typedef enum _ENUM_MSG_ID_T { - MID_MNY_CNM_CH_REQ, /* MANY notify CNM to obtain channel privilege */ - MID_MNY_CNM_CH_ABORT, /* MANY notify CNM to abort/release channel privilege */ - - MID_CNM_AIS_CH_GRANT, /* CNM notify AIS for indicating channel granted */ - MID_CNM_P2P_CH_GRANT, /* CNM notify P2P for indicating channel granted */ - MID_CNM_BOW_CH_GRANT, /* CNM notify BOW for indicating channel granted */ - - /*--------------------------------------------------*/ - /* SCN Module Mailbox Messages */ - /*--------------------------------------------------*/ - MID_AIS_SCN_SCAN_REQ, /* AIS notify SCN for starting scan */ - MID_AIS_SCN_SCAN_REQ_V2, /* AIS notify SCN for starting scan with multiple SSID support */ - MID_AIS_SCN_SCAN_CANCEL, /* AIS notify SCN for cancelling scan */ - MID_P2P_SCN_SCAN_REQ, /* P2P notify SCN for starting scan */ - MID_P2P_SCN_SCAN_REQ_V2, /* P2P notify SCN for starting scan with multiple SSID support */ - MID_P2P_SCN_SCAN_CANCEL, /* P2P notify SCN for cancelling scan */ - MID_BOW_SCN_SCAN_REQ, /* BOW notify SCN for starting scan */ - MID_BOW_SCN_SCAN_REQ_V2, /* BOW notify SCN for starting scan with multiple SSID support */ - MID_BOW_SCN_SCAN_CANCEL, /* BOW notify SCN for cancelling scan */ - MID_RLM_SCN_SCAN_REQ, /* RLM notify SCN for starting scan (OBSS-SCAN) */ - MID_RLM_SCN_SCAN_REQ_V2, /* RLM notify SCN for starting scan (OBSS-SCAN) with multiple SSID support */ - MID_RLM_SCN_SCAN_CANCEL, /* RLM notify SCN for cancelling scan (OBSS-SCAN)*/ - MID_SCN_AIS_SCAN_DONE, /* SCN notify AIS for scan completion */ - MID_SCN_P2P_SCAN_DONE, /* SCN notify P2P for scan completion */ - MID_SCN_BOW_SCAN_DONE, /* SCN notify BOW for scan completion */ - MID_SCN_RLM_SCAN_DONE, /* SCN notify RLM for scan completion (OBSS-SCAN) */ - - /*--------------------------------------------------*/ - /* AIS Module Mailbox Messages */ - /*--------------------------------------------------*/ - MID_OID_AIS_FSM_JOIN_REQ, /* OID/IOCTL notify AIS for join */ - MID_OID_AIS_FSM_ABORT, /* OID/IOCTL notify AIS for abort */ - MID_AIS_SAA_FSM_START, /* AIS notify SAA for Starting authentication/association fsm */ - MID_AIS_SAA_FSM_ABORT, /* AIS notify SAA for Aborting authentication/association fsm */ - MID_SAA_AIS_JOIN_COMPLETE, /* SAA notify AIS for indicating join complete */ - -#if CFG_ENABLE_BT_OVER_WIFI - /*--------------------------------------------------*/ - /* BOW Module Mailbox Messages */ - /*--------------------------------------------------*/ - MID_BOW_SAA_FSM_START, /* BOW notify SAA for Starting authentication/association fsm */ - MID_BOW_SAA_FSM_ABORT, /* BOW notify SAA for Aborting authentication/association fsm */ - MID_SAA_BOW_JOIN_COMPLETE, /* SAA notify BOW for indicating join complete */ -#endif - -#if CFG_ENABLE_WIFI_DIRECT - /*--------------------------------------------------*/ - /* P2P Module Mailbox Messages */ - /*--------------------------------------------------*/ - MID_P2P_SAA_FSM_START, /* P2P notify SAA for Starting authentication/association fsm */ - MID_P2P_SAA_FSM_ABORT, /* P2P notify SAA for Aborting authentication/association fsm */ - MID_SAA_P2P_JOIN_COMPLETE, /* SAA notify P2P for indicating join complete */ - - MID_MNY_P2P_FUN_SWITCH, /* Enable P2P FSM. */ - MID_MNY_P2P_DEVICE_DISCOVERY, /* Start device discovery. */ - MID_MNY_P2P_CONNECTION_REQ, /* Connection request. */ - MID_MNY_P2P_CONNECTION_ABORT, /* Abort connection request, P2P FSM return to IDLE. */ - MID_MNY_P2P_BEACON_UPDATE, - MID_MNY_P2P_STOP_AP, - MID_MNY_P2P_CHNL_REQ, - MID_MNY_P2P_CHNL_ABORT, - MID_MNY_P2P_MGMT_TX, - MID_MNY_P2P_GROUP_DISSOLVE, - MID_MNY_P2P_MGMT_FRAME_REGISTER, - MID_MNY_P2P_NET_DEV_REGISTER, - MID_MNY_P2P_START_AP, - MID_MNY_P2P_MGMT_FRAME_UPDATE, -#endif - -#if CFG_SUPPORT_ADHOC - MID_SCN_AIS_FOUND_IBSS, /* SCN notify AIS that an IBSS Peer has been found and can merge into */ -#endif /* CFG_SUPPORT_ADHOC */ - - MID_SAA_AIS_FSM_ABORT, /* SAA notify AIS for indicating deauthentication/disassociation */ - - MID_TOTAL_NUM -} ENUM_MSG_ID_T, *P_ENUM_MSG_ID_T; - -/* Message header of inter-components */ -struct _MSG_HDR_T { - LINK_ENTRY_T rLinkEntry; - ENUM_MSG_ID_T eMsgId; -}; - -typedef VOID (*PFN_MSG_HNDL_FUNC)(P_ADAPTER_T, P_MSG_HDR_T); - -typedef struct _MSG_HNDL_ENTRY { - ENUM_MSG_ID_T eMsgId; - PFN_MSG_HNDL_FUNC pfMsgHndl; -} MSG_HNDL_ENTRY_T, *P_MSG_HNDL_ENTRY_T; - -typedef enum _EUNM_MSG_SEND_METHOD_T { - MSG_SEND_METHOD_BUF = 0, /* Message is put in the queue and will be - executed when mailbox is checked. */ - MSG_SEND_METHOD_UNBUF /* The handler function is called immediately - in the same context of the sender */ -} EUNM_MSG_SEND_METHOD_T, *P_EUNM_MSG_SEND_METHOD_T; - - -typedef enum _ENUM_MBOX_ID_T { - MBOX_ID_0 = 0, - MBOX_ID_TOTAL_NUM -} ENUM_MBOX_ID_T, *P_ENUM_MBOX_ID_T; - -/* Define Mailbox structure */ -typedef struct _MBOX_T { - LINK_T rLinkHead; -} MBOX_T, *P_MBOX_T; - -typedef struct _MSG_SAA_FSM_START_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 ucSeqNum; - P_STA_RECORD_T prStaRec; -} MSG_SAA_FSM_START_T, *P_MSG_SAA_FSM_START_T; - -typedef struct _MSG_SAA_FSM_COMP_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 ucSeqNum; - WLAN_STATUS rJoinStatus; - P_STA_RECORD_T prStaRec; - P_SW_RFB_T prSwRfb; -} MSG_SAA_FSM_COMP_T, *P_MSG_SAA_FSM_COMP_T; - -typedef struct _MSG_SAA_FSM_ABORT_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 ucSeqNum; - P_STA_RECORD_T prStaRec; -} MSG_SAA_FSM_ABORT_T, *P_MSG_SAA_FSM_ABORT_T; - -typedef struct _MSG_CONNECTION_ABORT_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 ucNetTypeIndex; -} MSG_CONNECTION_ABORT_T, *P_MSG_CONNECTION_ABORT_T; - - - -/* specific message data types */ -typedef MSG_SAA_FSM_START_T MSG_JOIN_REQ_T, *P_MSG_JOIN_REQ_T; -typedef MSG_SAA_FSM_COMP_T MSG_JOIN_COMP_T, *P_MSG_JOIN_COMP_T; -typedef MSG_SAA_FSM_ABORT_T MSG_JOIN_ABORT_T, *P_MSG_JOIN_ABORT_T; - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -VOID -mboxSetup ( - IN P_ADAPTER_T prAdapter, - IN ENUM_MBOX_ID_T eMboxId - ); - - -VOID -mboxSendMsg ( - IN P_ADAPTER_T prAdapter, - IN ENUM_MBOX_ID_T eMboxId, - IN P_MSG_HDR_T prMsg, - IN EUNM_MSG_SEND_METHOD_T eMethod - ); - -VOID -mboxRcvAllMsg ( - IN P_ADAPTER_T prAdapter, - IN ENUM_MBOX_ID_T eMboxId - ); - -VOID -mboxInitialize ( - IN P_ADAPTER_T prAdapter - ); - -VOID -mboxDestroy ( - IN P_ADAPTER_T prAdapter - ); - -VOID -mboxDummy ( - IN P_ADAPTER_T prAdapter, - P_MSG_HDR_T prMsgHdr - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _HEM_MBOX_H */ - - diff --git a/drivers/net/wireless/mt5931/include/mgmt/mib.h b/drivers/net/wireless/mt5931/include/mgmt/mib.h deleted file mode 100755 index febcfb5fc40c..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/mib.h +++ /dev/null @@ -1,157 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/mib.h#1 $ -*/ - -/*! \file mib.h - \brief This file contains the IEEE 802.11 family related MIB definition - for MediaTek 802.11 Wireless LAN Adapters. -*/ - - - -/* -** $Log: mib.h $ - * - * 11 08 2010 wh.su - * [WCXRP00000171] [MT6620 Wi-Fi][Driver] Add message check code same behavior as mt5921 - * add the message check code from mt5921. - * - * 07 24 2010 wh.su - * - * .support the Wi-Fi RSN - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h. - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup - * - * Nov 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -*/ - -#ifndef _MIB_H -#define _MIB_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -/* Entry in SMT AuthenticationAlgorithms Table: dot11AuthenticationAlgorithmsEntry */ -typedef struct _DOT11_AUTHENTICATION_ALGORITHMS_ENTRY { - BOOLEAN dot11AuthenticationAlgorithmsEnable; /* dot11AuthenticationAlgorithmsEntry 3 */ -} DOT11_AUTHENTICATION_ALGORITHMS_ENTRY, *P_DOT11_AUTHENTICATION_ALGORITHMS_ENTRY; - -/* Entry in SMT dot11RSNAConfigPairwiseCiphersTalbe Table: dot11RSNAConfigPairwiseCiphersEntry */ -typedef struct _DOT11_RSNA_CONFIG_PAIRWISE_CIPHERS_ENTRY -{ - UINT_32 dot11RSNAConfigPairwiseCipher; /* dot11RSNAConfigPairwiseCiphersEntry 2 */ - BOOLEAN dot11RSNAConfigPairwiseCipherEnabled; /* dot11RSNAConfigPairwiseCiphersEntry 3 */ -} DOT11_RSNA_CONFIG_PAIRWISE_CIPHERS_ENTRY, *P_DOT11_RSNA_CONFIG_PAIRWISE_CIPHERS_ENTRY; - -/* Entry in SMT dot11RSNAConfigAuthenticationSuitesTalbe Table: dot11RSNAConfigAuthenticationSuitesEntry */ -typedef struct _DOT11_RSNA_CONFIG_AUTHENTICATION_SUITES_ENTRY -{ - UINT_32 dot11RSNAConfigAuthenticationSuite; /* dot11RSNAConfigAuthenticationSuitesEntry 2 */ - BOOLEAN dot11RSNAConfigAuthenticationSuiteEnabled; /* dot11RSNAConfigAuthenticationSuitesEntry 3 */ -} DOT11_RSNA_CONFIG_AUTHENTICATION_SUITES_ENTRY, *P_DOT11_RSNA_CONFIG_AUTHENTICATION_SUITES_ENTRY; - -/* ----- IEEE 802.11 MIB Major sections ----- */ -typedef struct _IEEE_802_11_MIB_T { - /* dot11PrivacyTable (dot11smt 5) */ - UINT_8 dot11WEPDefaultKeyID; /* dot11PrivacyEntry 2 */ - BOOLEAN dot11TranmitKeyAvailable; - UINT_32 dot11WEPICVErrorCount; /* dot11PrivacyEntry 5 */ - UINT_32 dot11WEPExcludedCount; /* dot11PrivacyEntry 6 */ - - /* dot11RSNAConfigTable (dot11smt 8) */ - UINT_32 dot11RSNAConfigGroupCipher; /* dot11RSNAConfigEntry 4 */ - - /* dot11RSNAConfigPairwiseCiphersTable (dot11smt 9) */ - DOT11_RSNA_CONFIG_PAIRWISE_CIPHERS_ENTRY dot11RSNAConfigPairwiseCiphersTable[MAX_NUM_SUPPORTED_CIPHER_SUITES]; - - /* dot11RSNAConfigAuthenticationSuitesTable (dot11smt 10) */ - DOT11_RSNA_CONFIG_AUTHENTICATION_SUITES_ENTRY dot11RSNAConfigAuthenticationSuitesTable[MAX_NUM_SUPPORTED_AKM_SUITES]; - -#if 0 //SUPPORT_WAPI - BOOLEAN fgWapiKeyInstalled; - PARAM_WPI_KEY_T rWapiPairwiseKey[2]; - BOOLEAN fgPairwiseKeyUsed[2]; - UINT_8 ucWpiActivedPWKey; /* Must be 0 or 1, by wapi spec */ - PARAM_WPI_KEY_T rWapiGroupKey[2]; - BOOLEAN fgGroupKeyUsed[2]; -#endif -} IEEE_802_11_MIB_T, *P_IEEE_802_11_MIB_T; - -/* ------------------ IEEE 802.11 non HT PHY characteristics ---------------- */ -typedef const struct _NON_HT_PHY_ATTRIBUTE_T { - UINT_16 u2SupportedRateSet; - - BOOLEAN fgIsShortPreambleOptionImplemented; - - BOOLEAN fgIsShortSlotTimeOptionImplemented; - -} NON_HT_PHY_ATTRIBUTE_T, *P_NON_HT_PHY_ATTRIBUTE_T; - -typedef const struct _NON_HT_ADHOC_MODE_ATTRIBUTE_T { - - ENUM_PHY_TYPE_INDEX_T ePhyTypeIndex; - - UINT_16 u2BSSBasicRateSet; - -} NON_HT_ADHOC_MODE_ATTRIBUTE_T, *P_NON_HT_ADHOC_MODE_ATTRIBUTE_T; - -typedef NON_HT_ADHOC_MODE_ATTRIBUTE_T NON_HT_AP_MODE_ATTRIBUTE_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ -extern NON_HT_PHY_ATTRIBUTE_T rNonHTPhyAttributes[]; -extern NON_HT_ADHOC_MODE_ATTRIBUTE_T rNonHTAdHocModeAttributes[]; -extern NON_HT_AP_MODE_ATTRIBUTE_T rNonHTApModeAttributes[]; - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _MIB_H */ - diff --git a/drivers/net/wireless/mt5931/include/mgmt/p2p_assoc.h b/drivers/net/wireless/mt5931/include/mgmt/p2p_assoc.h deleted file mode 100755 index 270d1d63c7fb..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/p2p_assoc.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/mgmt/p2p_assoc.h#1 $ -*/ - -/*! \file p2p_assoc.h - \brief This file contains the Wi-Fi Direct ASSOC REQ/RESP of - IEEE 802.11 family for MediaTek 802.11 Wireless LAN Adapters. -*/ - - - - -#ifndef _P2P_ASSOC_H -#define _P2P_ASSOC_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -PUINT_8 -p2pBuildReAssocReqFrameCommonIEs ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN PUINT_8 pucBuffer - ); - - -#endif diff --git a/drivers/net/wireless/mt5931/include/mgmt/p2p_bss.h b/drivers/net/wireless/mt5931/include/mgmt/p2p_bss.h deleted file mode 100755 index a609476fff7d..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/p2p_bss.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/mgmt/p2p_bss.h#2 $ -*/ - -/*! \file "p2p_bss.h" - \brief In this file we define the function prototype used in p2p BSS/IBSS. - - The file contains the function declarations and defines for used in BSS/IBSS. -*/ - - - - - -#ifndef _P2P_BSS_H -#define _P2P_BSS_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - - -UINT_32 -p2pGetTxProbRspIeTableSize( - VOID - ); - -#endif - diff --git a/drivers/net/wireless/mt5931/include/mgmt/p2p_fsm.h b/drivers/net/wireless/mt5931/include/mgmt/p2p_fsm.h deleted file mode 100755 index 01d2c9c9b94f..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/p2p_fsm.h +++ /dev/null @@ -1,2740 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/mgmt/p2p_fsm.h#23 $ -*/ - -/*! \file p2p_fsm.h - \brief Declaration of functions and finite state machine for P2P Module. - - Declaration of functions and finite state machine for P2P Module. -*/ - -/******************************************************************************* -* Copyright (c) 2010 MediaTek Inc. -* -* All rights reserved. Copying, compilation, modification, distribution -* or any other use whatsoever of this material is strictly prohibited -* except in accordance with a Software License Agreement with -* MediaTek Inc. -******************************************************************************** -*/ - -/******************************************************************************* -* LEGAL DISCLAIMER -* -* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND -* AGREES THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK -* SOFTWARE") RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE -* PROVIDED TO BUYER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY -* DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT -* LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -* PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE -* ANY WARRANTY WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY -* WHICH MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK -* SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY -* WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE -* FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION OR TO -* CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. -* -* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE -* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL -* BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT -* ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY -* BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -* -* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE -* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT -* OF LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING -* THEREOF AND RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN -* FRANCISCO, CA, UNDER THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE -* (ICC). -******************************************************************************** -*/ - -/* -** $Log: p2p_fsm.h $ -** -** 08 14 2012 yuche.tsai -** NULL -** Fix compile error. -** -** 07 26 2012 yuche.tsai -** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot -** Update driver code of ALPS.JB for hot-spot. -** -** 07 19 2012 yuche.tsai -** NULL -** Code update for JB. - * - * 07 18 2012 yuche.tsai - * NULL - * add one file. - * - * 12 02 2011 yuche.tsai - * NULL - * Resolve class 3 error issue under AP mode. - * - * data frame may TX before Assoc Response TX. - * - * 11 11 2011 yuche.tsai - * NULL - * Fix work thread cancel issue. - * - * 11 11 2011 yuche.tsai - * NULL - * Fix default device name issue. - * - * 11 09 2011 yuche.tsai - * [WCXRP00001093] [Need Patch][Volunteer Patch] Service Discovery 2.0 state transition issue. - * Fix SD2.0 issue which may cause KE. (Monkey test) - * - * 11 08 2011 yuche.tsai - * [WCXRP00001094] [Volunteer Patch][Driver] Driver version & supplicant version query & set support for service discovery version check. - * Add support for driver version query & p2p supplicant verseion set. - * For new service discovery mechanism sync. - * - * 10 18 2011 yuche.tsai - * [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch. - * Support Channle Query. - * - * 10 18 2011 yuche.tsai - * [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch. - * New 2.1 branch - - * - * 09 01 2011 yuche.tsai - * NULL - * Fix channel stay interval. - * Sync channel stay interval & channel request interval under AP mode.. - * - * 08 30 2011 yuche.tsai - * [WCXRP00000953] [Volunteer Patch][Driver] Hot Spot Channel ASSERT issue. - * Fix hot spot FW assert issue when under concurrent case. (DBG enable only) - * - * 08 16 2011 cp.wu - * [WCXRP00000934] [MT6620 Wi-Fi][Driver][P2P] Wi-Fi hot spot with auto sparse channel residence - * auto channel decision for 2.4GHz hot spot mode - * - * 08 16 2011 yuche.tsai - * NULL - * Fix scan policy for Active LISTEN scan. - * - * 08 09 2011 yuche.tsai - * [WCXRP00000919] [Volunteer Patch][WiFi Direct][Driver] Invitation New Feature. - * Invitation Feature add on. - * - * 08 02 2011 yuche.tsai - * [WCXRP00000896] [Volunteer Patch][WiFi Direct][Driver] GO with multiple client, TX deauth to a disconnecting device issue. - * Support TX Deauth Issue. - * - * 07 26 2011 yuche.tsai - * [WCXRP00000875] [Volunteer Patch][WiFi Direct][Driver] MT6620 IOT issue with realtek test bed solution. - * Turn off persistent group support for V2.0 release. - * - * 07 18 2011 yuche.tsai - * [WCXRP00000856] [Volunteer Patch][WiFi Direct][Driver] MT6620 WiFi Direct IOT Issue with BCM solution. - * Fix compile error. - * - * 07 18 2011 yuche.tsai - * [WCXRP00000856] [Volunteer Patch][WiFi Direct][Driver] MT6620 WiFi Direct IOT Issue with BCM solution. - * Fix MT6620 WiFi Direct IOT Issue with BCM solution. - * - * 07 11 2011 yuche.tsai - * [WCXRP00000845] [Volunteer Patch][WiFi Direct] WiFi Direct Device Connection Robustness - * Enhance Connection Robustness. - * - * 07 08 2011 yuche.tsai - * [WCXRP00000841] [Volunteer Patch][WiFi Direct] Group Owner Setting. - * Update GO configure parameter. - * - * 07 05 2011 yuche.tsai - * [WCXRP00000821] [Volunteer Patch][WiFi Direct][Driver] WiFi Direct Connection Speed Issue - * Disable enhancement II for debugging. - * - * 07 05 2011 yuche.tsai - * [WCXRP00000821] [Volunteer Patch][WiFi Direct][Driver] WiFi Direct Connection Speed Issue - * Refine compile flag. - * - * 07 05 2011 yuche.tsai - * [WCXRP00000821] [Volunteer Patch][WiFi Direct][Driver] WiFi Direct Connection Speed Issue - * Add wifi direct connection enhancement method I, II & VI. - * - * 06 20 2011 yuche.tsai - * [WCXRP00000799] [Volunteer Patch][MT6620][Driver] Connection Indication Twice Issue. - * Fix connection indication twice issue. - * - * 06 07 2011 yuche.tsai - * [WCXRP00000763] [Volunteer Patch][MT6620][Driver] RX Service Discovery Frame under AP mode Issue - * Fix RX SD request under AP mode issue. - * - * 05 04 2011 yuche.tsai - * NULL - * Support partial persistent group function. - * - * 04 20 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove CFG_WIFI_DIRECT_MOVED. - * - * 04 08 2011 yuche.tsai - * [WCXRP00000624] [Volunteer Patch][MT6620][Driver] Add device discoverability support for GO. - * Add device discoverability support. - * - * 03 25 2011 yuche.tsai - * NULL - * Improve some error handleing. - * - * 03 22 2011 george.huang - * [WCXRP00000504] [MT6620 Wi-Fi][FW] Support Sigma CAPI for power saving related command - * link with supplicant commands - * - * 03 22 2011 yuche.tsai - * NULL - * 1.Shorten the LISTEN interval. - * 2. Fix IF address issue when we are GO - * 3. Fix LISTEN channel issue. - * - * 03 21 2011 yuche.tsai - * NULL - * Change P2P Connection Request Flow. - * - * 03 19 2011 yuche.tsai - * [WCXRP00000584] [Volunteer Patch][MT6620][Driver] Add beacon timeout support for WiFi Direct. - * Add beacon timeout support. - * - * 03 19 2011 yuche.tsai - * [WCXRP00000581] [Volunteer Patch][MT6620][Driver] P2P IE in Assoc Req Issue - * Append P2P IE in Assoc Req, so that GC can be discovered in probe response of GO. - * - * 03 18 2011 yuche.tsai - * [WCXRP00000574] [Volunteer Patch][MT6620][Driver] Modify P2P FSM Connection Flow - * Modify connection flow after Group Formation Complete, or device connect to a GO. - * Instead of request channel & connect directly, we use scan to allocate channel bandwidth & connect after RX BCN. - * - * 03 15 2011 yuche.tsai - * [WCXRP00000560] [Volunteer Patch][MT6620][Driver] P2P Connection from UI using KEY/DISPLAY issue - * Fix some configure method issue. - * - * 03 10 2011 yuche.tsai - * NULL - * Add P2P API. - * - * 03 07 2011 yuche.tsai - * [WCXRP00000502] [Volunteer Patch][MT6620][Driver] Fix group ID issue when doing Group Formation. - * . - * - * 03 07 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * rename the define to anti_pviracy. - * - * 03 05 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * add the code to get the check rsponse and indicate to app. - * - * 03 01 2011 yuche.tsai - * [WCXRP00000501] [Volunteer Patch][MT6620][Driver] No common channel issue when doing GO formation - * Update channel issue when doing GO formation.. - * - * 03 01 2011 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * Update Service Discovery Related wlanoid function. - * - * 02 18 2011 wh.su - * [WCXRP00000471] [MT6620 Wi-Fi][Driver] Add P2P Provison discovery append Config Method attribute at WSC IE - * fixed the ioctl setting that index not map to spec defined config method. - * - * 02 18 2011 yuche.tsai - * [WCXRP00000480] [Volunteer Patch][MT6620][Driver] WCS IE format issue - * Fix WSC IE BE format issue. - * - * 02 17 2011 wh.su - * [WCXRP00000471] [MT6620 Wi-Fi][Driver] Add P2P Provison discovery append Config Method attribute at WSC IE - * append the WSC IE config method attribute at provision discovery request. - * - * 02 11 2011 yuche.tsai - * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode. - * Add two function prototype. - * - * 02 10 2011 yuche.tsai - * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode. - * Support Disassoc & Deauthentication for Hot-Spot. - * - * 02 09 2011 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. - -2. Provision Discovery Request/Response - - * Add Service Discovery Indication Related code. - * - * 02 09 2011 yuche.tsai - * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode. - * Add Support for MLME deauthentication for Hot-Spot. - * - * 02 09 2011 yuche.tsai - * [WCXRP00000429] [Volunteer Patch][MT6620][Driver] Hot Spot Client Limit Issue - * Fix Client Limit Issue. - * - * 01 26 2011 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. - -2. Provision Discovery Request/Response - - * Add Service Discovery Function. - * - * 01 25 2011 terry.wu - * [WCXRP00000393] [MT6620 Wi-Fi][Driver] Add new module insert parameter - * Add a new module parameter to indicate current runnig mode, P2P or AP. - * - * 01 19 2011 george.huang - * [WCXRP00000355] [MT6620 Wi-Fi] Set WMM-PS related setting with qualifying AP capability - * Null NOA attribute setting when no related parameters. - * - * 01 12 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * Modify some behavior of AP mode. - * - * 12 22 2010 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * Fix Compile Error. - * - * 12 15 2010 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * Refine Connection Flow. - * - * 12 08 2010 yuche.tsai - * [WCXRP00000244] [MT6620][Driver] Add station record type for each client when in AP mode. - * Change STA Type under AP mode. We would tell if client is a P2P device or a legacy client by checking the P2P IE in assoc req frame. - * - * 12 02 2010 yuche.tsai - * NULL - * Update P2P Connection Policy for Invitation. - * - * 12 02 2010 yuche.tsai - * NULL - * Update P2P Connection Policy for Invitation & Provision Discovery. - * - * 11 30 2010 yuche.tsai - * NULL - * Invitation & Provision Discovery Indication. - * - * 11 30 2010 yuche.tsai - * NULL - * Update Configure Method indication & selection for Provision Discovery & GO_NEGO_REQ - * - * 11 29 2010 yuche.tsai - * NULL - * Update P2P related function for INVITATION & PROVISION DISCOVERY. - * - * 11 26 2010 george.huang - * [WCXRP00000152] [MT6620 Wi-Fi] AP mode power saving function - * Update P2P PS for NOA function. - * - * 11 25 2010 yuche.tsai - * NULL - * Update Code for Invitation Related Function. - * - * 11 17 2010 wh.su - * [WCXRP00000164] [MT6620 Wi-Fi][Driver] Support the p2p random SSID[WCXRP00000179] [MT6620 Wi-Fi][FW] Set the Tx lowest rate at wlan table for normal operation - * fixed some ASSERT check. - * - * 11 04 2010 wh.su - * [WCXRP00000164] [MT6620 Wi-Fi][Driver] Support the p2p random SSID - * adding the p2p random ssid support. - * - * 10 20 2010 wh.su - * [WCXRP00000124] [MT6620 Wi-Fi] [Driver] Support the dissolve P2P Group - * Add the code to support disconnect p2p group - * - * 10 08 2010 wh.su - * [WCXRP00000085] [MT6620 Wif-Fi] [Driver] update the modified p2p state machine - * update the frog's new p2p state machine. - * - * 10 04 2010 wh.su - * [WCXRP00000081] [MT6620][Driver] Fix the compiling error at WinXP while enable P2P - * fixed compiling error while enable p2p. - * - * 09 21 2010 kevin.huang - * [WCXRP00000054] [MT6620 Wi-Fi][Driver] Restructure driver for second Interface - * Isolate P2P related function for Hardware Software Bundle - * - * 09 10 2010 wh.su - * NULL - * fixed the compiling error at WinXP. - * - * 09 07 2010 wh.su - * NULL - * adding the code for beacon/probe req/ probe rsp wsc ie at p2p. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 26 2010 yuche.tsai - * NULL - * Add connection abort message event prototype. - * - * 08 20 2010 kevin.huang - * NULL - * Modify AAA Module for changing STA STATE 3 at p2p/bowRunEventAAAComplete() - * - * 08 16 2010 yuche.tsai - * NULL - * Fix P2P Intended Interface Address Bug. - * Extend GO Nego Timeout Time. - * - * 08 16 2010 yuche.tsai - * NULL - * Extend Listen Interval default value & remove deprecated variable. - * - * 08 16 2010 kevin.huang - * NULL - * Refine AAA functions - * - * 08 12 2010 kevin.huang - * NULL - * Refine bssProcessProbeRequest() and bssSendBeaconProbeResponse() - * - * 08 12 2010 yuche.tsai - * NULL - * Add function prototype for join complete. - * - * 08 11 2010 yuche.tsai - * NULL - * Add some function proto type for P2P FSM under provisioning phase.. - * - * 08 11 2010 yuche.tsai - * NULL - * Change P2P data structure for supporting - * 1. P2P Device discovery. - * 2. P2P Group Negotiation. - * 3. P2P JOIN - * - * 08 05 2010 yuche.tsai - * NULL - * Check-in P2P Device Discovery Feature. - * - * 08 03 2010 george.huang - * NULL - * handle event for updating NOA parameters indicated from FW - * - * 08 02 2010 yuche.tsai - * NULL - * P2P Group Negotiation Code Check in. - * - * 07 26 2010 yuche.tsai - * - * Update P2P FSM header file. - * - * 07 23 2010 cp.wu - * - * P2P/RSN/WAPI IEs need to be declared with compact structure. - * - * 07 21 2010 yuche.tsai - * - * Add for P2P Scan Result Parsing & Saving. - * - * 07 19 2010 yuche.tsai - * - * Update P2P FSM header file. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 21 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Fix some P2P function prototype. - * - * 06 17 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * First draft for migration P2P FSM from FW to Driver. - * - * 03 18 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Rename CFG flag for P2P - * - * 02 26 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Modify parameter of p2pStartGO - * - * 02 23 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add Wi-Fi Direct SSID and P2P GO Test Mode - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup -*/ - -#ifndef _P2P_FSM_H -#define _P2P_FSM_H - - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ -#define CID52_53_54 0 - - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - - - - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef enum _ENUM_P2P_STATE_T { - P2P_STATE_IDLE = 0, - P2P_STATE_SCAN, - P2P_STATE_AP_CHANNEL_DETECT, - P2P_STATE_REQING_CHANNEL, - P2P_STATE_CHNL_ON_HAND, /* Requesting Channel to Send Specific Frame. */ - P2P_STATE_GC_JOIN, /* Sending Specific Frame. May extending channel by other event. */ - P2P_STATE_NUM -} ENUM_P2P_STATE_T, *P_ENUM_P2P_STATE_T; - - -typedef enum _ENUM_CHANNEL_REQ_TYPE_T { - CHANNEL_REQ_TYPE_REMAIN_ON_CHANNEL, - CHANNEL_REQ_TYPE_GC_JOIN_REQ, - CHANNEL_REQ_TYPE_GO_START_BSS -} -ENUM_CHANNEL_REQ_TYPE_T, *P_ENUM_CHANNEL_REQ_TYPE_T; - - -typedef enum _ENUM_BUFFER_TYPE_T { - ENUM_FRAME_TYPE_EXTRA_IE_BEACON, - ENUM_FRAME_TYPE_EXTRA_IE_ASSOC_RSP, - ENUM_FRAME_TYPE_EXTRA_IE_PROBE_RSP, - ENUM_FRAME_TYPE_PROBE_RSP_TEMPLATE, - ENUM_FRAME_TYPE_BEACON_TEMPLATE, - ENUM_FRAME_IE_NUM -} ENUM_BUFFER_TYPE_T, *P_ENUM_BUFFER_TYPE_T; - -typedef enum _ENUM_HIDDEN_SSID_TYPE_T { - ENUM_HIDDEN_SSID_NONE, - ENUM_HIDDEN_SSID_LEN, - ENUM_HIDDEN_SSID_ZERO_CONTENT, - ENUM_HIDDEN_SSID_NUM -} -ENUM_HIDDEN_SSID_TYPE_T, *P_ENUM_HIDDEN_SSID_TYPE_T; - -typedef struct _P2P_SSID_STRUCT_T { - UINT_8 aucSsid[32]; - UINT_8 ucSsidLen; -} P2P_SSID_STRUCT_T, *P_P2P_SSID_STRUCT_T; - -typedef struct _P2P_STATION_INFO_T { - UINT_32 u4InactiveTime; - UINT_32 u4RxBytes; // TODO: - UINT_32 u4TxBytes; // TODO: - UINT_32 u4RxPackets; // TODO: - UINT_32 u4TxPackets; // TODO: - // TODO: Add more for requirement. -} -P2P_STATION_INFO_T, *P_P2P_STATION_INFO_T; - - -typedef struct _AP_CRYPTO_SETTINGS_T { - UINT_32 u4WpaVersion; - UINT_32 u4CipherGroup; - INT_32 i4NumOfCiphers; - UINT_32 aucCiphersPairwise[5]; - INT_32 i4NumOfAkmSuites; - UINT_32 aucAkmSuites[2]; - BOOLEAN fgIsControlPort; - UINT_16 u2ControlPortBE; - BOOLEAN fgIsControlPortEncrypt; -} AP_CRYPTO_SETTINGS_T, *P_AP_CRYPTO_SETTINGS_T; - -/*-------------------- P2P FSM ACTION STRUCT ---------------------*/ -typedef struct _P2P_CHNL_REQ_INFO_T { - BOOLEAN fgIsChannelRequested; - UINT_8 ucSeqNumOfChReq; - UINT_64 u8Cookie; - UINT_8 ucReqChnlNum; - ENUM_BAND_T eBand; - ENUM_CHNL_EXT_T eChnlSco; - UINT_32 u4MaxInterval; - ENUM_CHANNEL_REQ_TYPE_T eChannelReqType; - - UINT_8 ucOriChnlNum; - ENUM_BAND_T eOriBand; - ENUM_CHNL_EXT_T eOriChnlSco; -} P2P_CHNL_REQ_INFO_T, *P_P2P_CHNL_REQ_INFO_T; - -typedef struct _P2P_SCAN_REQ_INFO_T { - ENUM_SCAN_TYPE_T eScanType; - ENUM_SCAN_CHANNEL eChannelSet; - UINT_16 u2PassiveDewellTime; - UINT_8 ucSeqNumOfScnMsg; - BOOLEAN fgIsAbort; - BOOLEAN fgIsScanRequest; - UINT_8 ucNumChannelList; - RF_CHANNEL_INFO_T arScanChannelList[MAXIMUM_OPERATION_CHANNEL_LIST]; - UINT_32 u4BufLength; - UINT_8 aucIEBuf[MAX_IE_LENGTH]; - P2P_SSID_STRUCT_T rSsidStruct; // Currently we can only take one SSID scan request -} -P2P_SCAN_REQ_INFO_T, *P_P2P_SCAN_REQ_INFO_T; - -typedef struct _P2P_CONNECTION_REQ_INFO_T { - - BOOLEAN fgIsConnRequest; - P2P_SSID_STRUCT_T rSsidStruct; - UINT_8 aucBssid[MAC_ADDR_LEN]; - /* For ASSOC Req. */ - UINT_32 u4BufLength; - UINT_8 aucIEBuf[MAX_IE_LENGTH]; -} P2P_CONNECTION_REQ_INFO_T, *P_P2P_CONNECTION_REQ_INFO_T; - -typedef struct _P2P_MGMT_TX_REQ_INFO_T { - BOOLEAN fgIsMgmtTxRequested; - P_MSDU_INFO_T prMgmtTxMsdu; - UINT_64 u8Cookie; -} P2P_MGMT_TX_REQ_INFO_T, *P_P2P_MGMT_TX_REQ_INFO_T; - -typedef struct _P2P_BEACON_UPDATE_INFO_T { - PUINT_8 pucBcnHdr; - UINT_32 u4BcnHdrLen; - PUINT_8 pucBcnBody; - UINT_32 u4BcnBodyLen; -} -P2P_BEACON_UPDATE_INFO_T, *P_P2P_BEACON_UPDATE_INFO_T; - -typedef struct _P2P_PROBE_RSP_UPDATE_INFO_T { - P_MSDU_INFO_T prProbeRspMsduTemplate; -} P2P_PROBE_RSP_UPDATE_INFO_T, *P_P2P_PROBE_RSP_UPDATE_INFO_T; - -typedef struct _P2P_ASSOC_RSP_UPDATE_INFO_T { - PUINT_8 pucAssocRspExtIE; - UINT_16 u2AssocIELen; -} P2P_ASSOC_RSP_UPDATE_INFO_T, *P_P2P_ASSOC_RSP_UPDATE_INFO_T; - -typedef struct _P2P_JOIN_INFO_T { - UINT_32 ucSeqNumOfReqMsg; - UINT_8 ucAvailableAuthTypes; - P_STA_RECORD_T prTargetStaRec; - P2P_SSID_STRUCT_T rSsidStruct; - BOOLEAN fgIsJoinComplete; - /* For ASSOC Rsp. */ - UINT_32 u4BufLength; - UINT_8 aucIEBuf[MAX_IE_LENGTH]; -} -P2P_JOIN_INFO_T, *P_P2P_JOIN_INFO_T; - -struct _P2P_FSM_INFO_T { - /* State related. */ - ENUM_P2P_STATE_T ePreviousState; - ENUM_P2P_STATE_T eCurrentState; - - /* Channel related. */ - P2P_CHNL_REQ_INFO_T rChnlReqInfo; - - /* Scan related. */ - P2P_SCAN_REQ_INFO_T rScanReqInfo; - - /* Connection related. */ - P2P_CONNECTION_REQ_INFO_T rConnReqInfo; - - /* Mgmt tx related. */ - P2P_MGMT_TX_REQ_INFO_T rMgmtTxInfo; - - /* Beacon related. */ - P2P_BEACON_UPDATE_INFO_T rBcnContentInfo; - - /* Probe Response related. */ - P2P_PROBE_RSP_UPDATE_INFO_T rProbeRspContentInfo; - - /* Assoc Rsp related. */ - P2P_ASSOC_RSP_UPDATE_INFO_T rAssocRspContentInfo; - - /* GC Join related. */ - P2P_JOIN_INFO_T rJoinInfo; - - /* FSM Timer */ - TIMER_T rP2pFsmTimeoutTimer; - - - /* GC Target BSS. */ - P_BSS_DESC_T prTargetBss; - - /* GC Connection Request. */ - BOOLEAN fgIsConnectionRequested; - - BOOLEAN fgIsApMode; - - /* Channel grant interval. */ - UINT_32 u4GrantInterval; - - /* Packet filter for P2P module. */ - UINT_32 u4P2pPacketFilter; - - //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Prepare for use vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - /* Msg event queue. */ - LINK_T rMsgEventQueue; - -}; - - -/*---------------- Messages -------------------*/ -typedef struct _MSG_P2P_SCAN_REQUEST_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - P_P2P_SSID_STRUCT_T prSSID; - INT_32 i4SsidNum; - UINT_32 u4NumChannel; - PUINT_8 pucIEBuf; - UINT_32 u4IELen; - BOOLEAN fgIsAbort; - RF_CHANNEL_INFO_T arChannelListInfo[1]; -} MSG_P2P_SCAN_REQUEST_T, *P_MSG_P2P_SCAN_REQUEST_T; - -typedef struct _MSG_P2P_CHNL_REQUEST_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_64 u8Cookie; - UINT_32 u4Duration; - ENUM_CHNL_EXT_T eChnlSco; - RF_CHANNEL_INFO_T rChannelInfo; -} MSG_P2P_CHNL_REQUEST_T, *P_MSG_P2P_CHNL_REQUEST_T; - -typedef struct _MSG_P2P_CHNL_ABORT_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_64 u8Cookie; -} MSG_P2P_CHNL_ABORT_T, *P_MSG_P2P_CHNL_ABORT_T; - - -typedef struct _MSG_P2P_CONNECTION_REQUEST_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - P2P_SSID_STRUCT_T rSsid; - UINT_8 aucBssid[MAC_ADDR_LEN]; - ENUM_CHNL_EXT_T eChnlSco; - RF_CHANNEL_INFO_T rChannelInfo; - UINT_32 u4IELen; - UINT_8 aucIEBuf[1]; - // TODO: Auth Type, OPEN, SHARED, FT, EAP... -} MSG_P2P_CONNECTION_REQUEST_T, *P_MSG_P2P_CONNECTION_REQUEST_T; - - -typedef struct _MSG_P2P_CONNECTION_ABORT_T { - MSG_HDR_T rMsgHdr; /* Must be the first member. */ - UINT_8 aucTargetID[MAC_ADDR_LEN]; - UINT_16 u2ReasonCode; - BOOLEAN fgSendDeauth; -} MSG_P2P_CONNECTION_ABORT_T, *P_MSG_P2P_CONNECTION_ABORT_T; - -typedef struct _MSG_P2P_MGMT_TX_REQUEST_T { - MSG_HDR_T rMsgHdr; - P_MSDU_INFO_T prMgmtMsduInfo; - UINT_64 u8Cookie; /* For indication. */ - BOOLEAN fgNoneCckRate; - BOOLEAN fgIsWaitRsp; -} MSG_P2P_MGMT_TX_REQUEST_T, *P_MSG_P2P_MGMT_TX_REQUEST_T; - -typedef struct _MSG_P2P_START_AP_T { - MSG_HDR_T rMsgHdr; - UINT_32 u4DtimPeriod; - UINT_32 u4BcnInterval; - UINT_8 aucSsid[32]; - UINT_16 u2SsidLen; - UINT_8 ucHiddenSsidType; - BOOLEAN fgIsPrivacy; - AP_CRYPTO_SETTINGS_T rEncryptionSettings; - INT_32 i4InactiveTimeout; -} -MSG_P2P_START_AP_T, *P_MSG_P2P_START_AP_T; - - -typedef struct _MSG_P2P_BEACON_UPDATE_T { - MSG_HDR_T rMsgHdr; - UINT_32 u4BcnHdrLen; - UINT_32 u4BcnBodyLen; - PUINT_8 pucBcnHdr; - PUINT_8 pucBcnBody; - UINT_8 aucBuffer[1]; /* Header & Body are put here. */ -} -MSG_P2P_BEACON_UPDATE_T, *P_MSG_P2P_BEACON_UPDATE_T; - -typedef struct _MSG_P2P_MGMT_FRAME_UPDATE_T { - MSG_HDR_T rMsgHdr; - ENUM_BUFFER_TYPE_T eBufferType; - UINT_32 u4BufferLen; - UINT_8 aucBuffer[1]; -} MSG_P2P_MGMT_FRAME_UPDATE_T, *P_MSG_P2P_MGMT_FRAME_UPDATE_T; - - -typedef struct _MSG_P2P_SWITCH_OP_MODE_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - ENUM_OP_MODE_T eOpMode; -} MSG_P2P_SWITCH_OP_MODE_T, *P_MSG_P2P_SWITCH_OP_MODE_T; - -typedef struct _MSG_P2P_MGMT_FRAME_REGISTER_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_16 u2FrameType; - BOOLEAN fgIsRegister; -} -MSG_P2P_MGMT_FRAME_REGISTER_T, *P_MSG_P2P_MGMT_FRAME_REGISTER_T; - -typedef struct _MSG_P2P_NETDEV_REGISTER_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - BOOLEAN fgIsEnable; - UINT_8 ucMode; -} MSG_P2P_NETDEV_REGISTER_T, *P_MSG_P2P_NETDEV_REGISTER_T; - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -VOID -p2pFsmStateTransition( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN ENUM_P2P_STATE_T eNextState - ); - - - -VOID -p2pFsmRunEventAbort( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo - ); - - -VOID -p2pFsmRunEventScanRequest( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pFsmRunEventMgmtFrameTx( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pFsmRunEventStartAP( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pFsmRunEventNetDeviceRegister( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pFsmRunEventUpdateMgmtFrame( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pFsmRunEventBeaconUpdate( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pFsmRunEventStopAP( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pFsmRunEventChannelRequest( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - - -VOID -p2pFsmRunEventChannelAbort( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - - -VOID -p2pFsmRunEventDissolve( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - - -VOID -p2pFsmRunEventSwitchOPMode( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - - -WLAN_STATUS -p2pFsmRunEventMgmtFrameTxDone( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - - -VOID -p2pFsmRunEventMgmtFrameRegister( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - - -#if 0 -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#endif - -//3 /* --------------- WFA P2P DEFAULT PARAMETERS --------------- */ -#define P2P_WILDCARD_SSID "DIRECT-" -#define P2P_WILDCARD_SSID_LEN 7 -#define P2P_GROUP_ID_LEN 9 - -#define P2P_DRIVER_VERSION 2 /* Update when needed. */ - -#define P2P_DEFAULT_DEV_NAME "Wireless Client" -#define P2P_DEFAULT_DEV_NAME_LEN 15 -#define P2P_DEFAULT_PRIMARY_CATEGORY_ID 10 -#define P2P_DEFAULT_PRIMARY_SUB_CATEGORY_ID 5 -#define P2P_DEFAULT_CONFIG_METHOD (WPS_ATTRI_CFG_METHOD_PUSH_BUTTON | WPS_ATTRI_CFG_METHOD_KEYPAD | WPS_ATTRI_CFG_METHOD_DISPLAY) -#define P2P_DEFAULT_LISTEN_CHANNEL 1 - -#define P2P_MAX_SUPPORTED_SEC_DEV_TYPE_COUNT 0 /* NOTE(Kevin): Shall <= 16 */ -#define P2P_MAX_SUPPORTED_CHANNEL_LIST_COUNT 13 - -#define P2P_MAX_SUPPORTED_CHANNEL_LIST_SIZE 51 /* Contains 6 sub-band. */ - -#define P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT 8 /* NOTE(Kevin): Shall <= 16 */ - -#define P2P_MAXIMUM_CLIENT_COUNT 8 -#define P2P_MAXIMUM_NOA_COUNT 8 - - -#define P2P_MAXIMUM_ATTRIBUTE_LEN 251 - -#define P2P_CTWINDOW_DEFAULT 25 /* in TU=(1024usec) */ - -#define P2P_MAXIMUM_ATTRIBUTES_CACHE_SIZE 768 - -/* P2P 3.1.2.1.3 - Find Phase */ -#define P2P_MAX_DISCOVERABLE_INTERVAL 8 //3//3 -#define P2P_MIN_DISCOVERABLE_INTERVAL 5 // 1 - -#define P2P_LISTEN_SCAN_UNIT 100 // MS - -/* FSM Time Related constrain. */ -#define P2P_SERACH_STATE_PERIOD_MS 1000 // Deprecated. - -#define P2P_GO_CHANNEL_STAY_INTERVAL 1000 - -#define P2P_GO_NEGO_TIMEOUT_MS 500 -#define P2P_CONNECTION_TIMEOUT_SEC 120 - -#define P2P_INVITAION_TIMEOUT_MS 500 /* Timeout Wait Invitation Resonse. */ -#define P2P_PROVISION_DISCOVERY_TIMEOUT_MS 500 /* Timeout Wait Provision Discovery Resonse. */ - -//3 /* --------------- WFA P2P IE --------------- */ -/* P2P 4.1.1 - P2P IE format */ -#define P2P_OUI_TYPE_LEN 4 -#define P2P_IE_OUI_HDR (ELEM_HDR_LEN + P2P_OUI_TYPE_LEN) /* == OFFSET_OF(IE_P2P_T, aucP2PAttributes[0]) */ - -/* P2P 4.1.1 - General P2P Attribute */ -#define P2P_ATTRI_HDR_LEN 3 /* ID(1 octet) + Length(2 octets) */ - -/* P2P 4.1.1 - P2P Attribute ID definitions */ -#define P2P_ATTRI_ID_STATUS 0 -#define P2P_ATTRI_ID_REASON_CODE 1 -#define P2P_ATTRI_ID_P2P_CAPABILITY 2 -#define P2P_ATTRI_ID_P2P_DEV_ID 3 -#define P2P_ATTRI_ID_GO_INTENT 4 -#define P2P_ATTRI_ID_CFG_TIMEOUT 5 -#define P2P_ATTRI_ID_LISTEN_CHANNEL 6 -#define P2P_ATTRI_ID_P2P_GROUP_BSSID 7 -#define P2P_ATTRI_ID_EXT_LISTEN_TIMING 8 -#define P2P_ATTRI_ID_INTENDED_P2P_IF_ADDR 9 -#define P2P_ATTRI_ID_P2P_MANAGEABILITY 10 -#define P2P_ATTRI_ID_CHANNEL_LIST 11 -#define P2P_ATTRI_ID_NOTICE_OF_ABSENCE 12 -#define P2P_ATTRI_ID_P2P_DEV_INFO 13 -#define P2P_ATTRI_ID_P2P_GROUP_INFO 14 -#define P2P_ATTRI_ID_P2P_GROUP_ID 15 -#define P2P_ATTRI_ID_P2P_INTERFACE 16 -#define P2P_ATTRI_ID_OPERATING_CHANNEL 17 -#define P2P_ATTRI_ID_INVITATION_FLAG 18 -#define P2P_ATTRI_ID_VENDOR_SPECIFIC 221 - -/* Maximum Length of P2P Attributes */ -#define P2P_ATTRI_MAX_LEN_STATUS 1 /* 0 */ -#define P2P_ATTRI_MAX_LEN_REASON_CODE 1 /* 1 */ -#define P2P_ATTRI_MAX_LEN_P2P_CAPABILITY 2 /* 2 */ -#define P2P_ATTRI_MAX_LEN_P2P_DEV_ID 6 /* 3 */ -#define P2P_ATTRI_MAX_LEN_GO_INTENT 1 /* 4 */ -#define P2P_ATTRI_MAX_LEN_CFG_TIMEOUT 2 /* 5 */ -#if CID52_53_54 - #define P2P_ATTRI_MAX_LEN_LISTEN_CHANNEL 5 /* 6 */ -#else - #define P2P_ATTRI_MAX_LEN_LISTEN_CHANNEL 5 /* 6 */ -#endif -#define P2P_ATTRI_MAX_LEN_P2P_GROUP_BSSID 6 /* 7 */ -#define P2P_ATTRI_MAX_LEN_EXT_LISTEN_TIMING 4 /* 8 */ -#define P2P_ATTRI_MAX_LEN_INTENDED_P2P_IF_ADDR 6 /* 9 */ -#define P2P_ATTRI_MAX_LEN_P2P_MANAGEABILITY 1 /* 10 */ -//#define P2P_ATTRI_MAX_LEN_CHANNEL_LIST 3 + (n* (2 + num_of_ch)) /* 11 */ -#define P2P_ATTRI_LEN_CHANNEL_LIST 3 /* 11 */ -#define P2P_ATTRI_LEN_CHANNEL_ENTRY 2 /* 11 */ - - -//#define P2P_ATTRI_MAX_LEN_NOTICE_OF_ABSENCE 2 + (n* (13)) /* 12 */ -#define P2P_ATTRI_MAX_LEN_NOTICE_OF_ABSENCE (2 + (P2P_MAXIMUM_NOA_COUNT*(13))) /* 12 */ - -#define P2P_ATTRI_MAX_LEN_P2P_DEV_INFO 17 + (8 * (8)) + 36 /* 13 */ -//#define P2P_ATTRI_MAX_LEN_P2P_GROUP_INFO n* (25 + (m* (8)) + 32) /* 14 */ -#define P2P_ATTRI_MAX_LEN_P2P_GROUP_ID 38 /* 15 */ -#define P2P_ATTRI_MAX_LEN_P2P_INTERFACE 253 // 7 + 6* [0~41] /* 16 */ -#if CID52_53_54 - #define P2P_ATTRI_MAX_LEN_OPERATING_CHANNEL 5 /* 17 */ -#else - #define P2P_ATTRI_MAX_LEN_OPERATING_CHANNEL 5 /* 17 */ -#endif -#define P2P_ATTRI_MAX_LEN_INVITATION_FLAGS 1 /* 18 */ - -/* P2P 4.1.2 - P2P Status definitions */ -#define P2P_STATUS_SUCCESS 0 -#define P2P_STATUS_FAIL_INFO_IS_CURRENTLY_UNAVAILABLE 1 -#define P2P_STATUS_FAIL_INCOMPATIBLE_PARAM 2 -#define P2P_STATUS_FAIL_LIMIT_REACHED 3 -#define P2P_STATUS_FAIL_INVALID_PARAM 4 -#define P2P_STATUS_FAIL_UNABLE_ACCOMMODATE_REQ 5 -#define P2P_STATUS_FAIL_PREVIOUS_PROTOCOL_ERR 6 -#define P2P_STATUS_FAIL_NO_COMMON_CHANNELS 7 -#define P2P_STATUS_FAIL_UNKNOWN_P2P_GROUP 8 -#define P2P_STATUS_FAIL_SAME_INTENT_VALUE_15 9 -#define P2P_STATUS_FAIL_INCOMPATIBLE_PROVISION_METHOD 10 -#define P2P_STATUS_FAIL_REJECTED_BY_USER 11 - - -/* P2P 4.1.3 - P2P Minor Reason Code definitions */ -#define P2P_REASON_SUCCESS 0 -#define P2P_REASON_DISASSOCIATED_DUE_CROSS_CONNECTION 1 -#define P2P_REASON_DISASSOCIATED_DUE_UNMANAGEABLE 2 -#define P2P_REASON_DISASSOCIATED_DUE_NO_P2P_COEXIST_PARAM 3 -#define P2P_REASON_DISASSOCIATED_DUE_MANAGEABLE 4 - - -/* P2P 4.1.4 - Device Capability Bitmap definitions */ -#define P2P_DEV_CAPABILITY_SERVICE_DISCOVERY BIT(0) -#define P2P_DEV_CAPABILITY_CLIENT_DISCOVERABILITY BIT(1) -#define P2P_DEV_CAPABILITY_CONCURRENT_OPERATION BIT(2) -#define P2P_DEV_CAPABILITY_P2P_INFRA_MANAGED BIT(3) -#define P2P_DEV_CAPABILITY_P2P_DEVICE_LIMIT BIT(4) -#define P2P_DEV_CAPABILITY_P2P_INVITATION_PROCEDURE BIT(5) - - -/* P2P 4.1.4 - Group Capability Bitmap definitions */ -#define P2P_GROUP_CAPABILITY_P2P_GROUP_OWNER BIT(0) -#define P2P_GROUP_CAPABILITY_PERSISTENT_P2P_GROUP BIT(1) -#define P2P_GROUP_CAPABILITY_P2P_GROUP_LIMIT BIT(2) -#define P2P_GROUP_CAPABILITY_INTRA_BSS_DISTRIBUTION BIT(3) -#define P2P_GROUP_CAPABILITY_CROSS_CONNECTION BIT(4) -#define P2P_GROUP_CAPABILITY_PERSISTENT_RECONNECT BIT(5) -#define P2P_GROUP_CAPABILITY_GROUP_FORMATION BIT(6) - -/* P2P 4.1.6 - GO Intent field definitions */ -#define P2P_GO_INTENT_TIE_BREAKER_FIELD BIT(0) -#define P2P_GO_INTENT_VALUE_MASK BITS(1,7) -#define P2P_GO_INTENT_VALUE_OFFSET 1 - -/* P2P 4.1.12 - Manageability Bitmap definitions */ -#define P2P_DEVICE_MANAGEMENT BIT(0) - -/* P2P 4.1.14 - CTWindow and OppPS Parameters definitions */ -#define P2P_CTW_OPPPS_PARAM_OPPPS_FIELD BIT(7) -#define P2P_CTW_OPPPS_PARAM_CTWINDOW_MASK BITS(0,6) - - -#define ELEM_MAX_LEN_P2P_FOR_PROBE_REQ \ - (P2P_OUI_TYPE_LEN + \ - (P2P_ATTRI_HDR_LEN + P2P_ATTRI_MAX_LEN_P2P_CAPABILITY) + \ - (P2P_ATTRI_HDR_LEN + P2P_ATTRI_MAX_LEN_P2P_DEV_ID) + \ - (P2P_ATTRI_HDR_LEN + P2P_ATTRI_MAX_LEN_LISTEN_CHANNEL) + \ - (P2P_ATTRI_HDR_LEN + P2P_ATTRI_MAX_LEN_OPERATING_CHANNEL)) - -#define ELEM_MAX_LEN_P2P_FOR_ASSOC_REQ \ - (P2P_OUI_TYPE_LEN + \ - (P2P_ATTRI_HDR_LEN + P2P_ATTRI_MAX_LEN_P2P_CAPABILITY) + \ - (P2P_ATTRI_HDR_LEN + P2P_ATTRI_MAX_LEN_EXT_LISTEN_TIMING) + \ - (P2P_ATTRI_HDR_LEN + P2P_ATTRI_MAX_LEN_P2P_DEV_INFO)) - - -/* P2P 4.1.16 - P2P Client Infor Descriptor */ -#define P2P_CLIENT_INFO_DESC_HDR_LEN 1 /* Length(1 octets) */ - -/* P2P 4.1.20 - P2P Invitation Flags Attribute*/ -#define P2P_INVITATION_FLAGS_INVITATION_TYPE BIT(0) -#define P2P_INVITATION_TYPE_INVITATION 0 -#define P2P_INVITATION_TYPE_REINVOKE 1 -//3 /* --------------- WPS Data Element Definitions --------------- */ -/* P2P 4.2.2 - General WSC Attribute */ -#define WSC_ATTRI_HDR_LEN 4 /* ID(2 octet) + Length(2 octets) */ -#define WSC_ATTRI_MAX_LEN_VERSION 1 -#define WSC_ATTRI_MAX_LEN_DEVICE_PASSWORD_ID 2 -#define WSC_ATTRI_LEN_CONFIG_METHOD 2 - -/* WPS 11 - Data Element Definitions */ -#define WPS_ATTRI_ID_VERSION 0x104A -#define WPS_ATTRI_ID_CONFIGURATION_METHODS 0x1008 -#define WPS_ATTRI_ID_DEVICE_PASSWORD 0x1012 -#define WPS_ATTRI_ID_DEVICE_NAME 0x1011 -#define WPS_ATTRI_ID_PRI_DEVICE_TYPE 0x1054 -#define WPS_ATTRI_ID_SEC_DEVICE_TYPE 0x1055 - -#define WPS_MAXIMUM_ATTRIBUTES_CACHE_SIZE 300 - -#define WPS_ATTRI_MAX_LEN_DEVICE_NAME 32 /* 0x1011 */ - -#define WPS_ATTRI_CFG_METHOD_USBA BIT(0) -#define WPS_ATTRI_CFG_METHOD_ETHERNET BIT(1) -#define WPS_ATTRI_CFG_METHOD_LABEL BIT(2) -#define WPS_ATTRI_CFG_METHOD_DISPLAY BIT(3) -#define WPS_ATTRI_CFG_METHOD_EXT_NFC BIT(4) -#define WPS_ATTRI_CFG_METHOD_INT_NFC BIT(5) -#define WPS_ATTRI_CFG_METHOD_NFC_IF BIT(6) -#define WPS_ATTRI_CFG_METHOD_PUSH_BUTTON BIT(7) -#define WPS_ATTRI_CFG_METHOD_KEYPAD BIT(8) - - -#define P2P_FLAGS_PROVISION_COMPLETE 0x00000001 -#define P2P_FLAGS_PROVISION_DISCOVERY_COMPLETE 0x00000002 -#define P2P_FLAGS_PROVISION_DISCOVERY_WAIT_RESPONSE 0x00000004 -#define P2P_FLAGS_PROVISION_DISCOVERY_RESPONSE_WAIT 0x00000008 -#define P2P_FLAGS_MASK_PROVISION 0x00000017 -#define P2P_FLAGS_MASK_PROVISION_COMPLETE 0x00000015 -#define P2P_FLAGS_PROVISION_DISCOVERY_INDICATED 0x00000010 -#define P2P_FLAGS_INVITATION_TOBE_GO 0x00000100 -#define P2P_FLAGS_INVITATION_TOBE_GC 0x00000200 -#define P2P_FLAGS_INVITATION_SUCCESS 0x00000400 -#define P2P_FLAGS_INVITATION_WAITING_TARGET 0x00000800 -#define P2P_FLAGS_MASK_INVITATION 0x00000F00 -#define P2P_FLAGS_FORMATION_ON_GOING 0x00010000 -#define P2P_FLAGS_FORMATION_LOCAL_PWID_RDY 0x00020000 -#define P2P_FLAGS_FORMATION_TARGET_PWID_RDY 0x00040000 -#define P2P_FLAGS_FORMATION_COMPLETE 0x00080000 -#define P2P_FLAGS_MASK_FORMATION 0x000F0000 -#define P2P_FLAGS_DEVICE_DISCOVER_REQ 0x00100000 -#define P2P_FLAGS_DEVICE_DISCOVER_DONE 0x00200000 -#define P2P_FLAGS_DEVICE_INVITATION_WAIT 0x00400000 -#define P2P_FLAGS_DEVICE_SERVICE_DISCOVER_WAIT 0x00800000 -#define P2P_FLAGS_MASK_DEVICE_DISCOVER 0x00F00000 - -#define P2P_FLAGS_DEVICE_FORMATION_REQUEST 0x01000000 - - -/* MACRO for flag operation */ -#define SET_FLAGS(_FlagsVar, _BitsToSet) \ - (_FlagsVar) = ((_FlagsVar) | (_BitsToSet)) - -#define TEST_FLAGS(_FlagsVar, _BitsToCheck) \ - (((_FlagsVar) & (_BitsToCheck)) == (_BitsToCheck)) - -#define CLEAR_FLAGS(_FlagsVar, _BitsToClear) \ - (_FlagsVar) &= ~(_BitsToClear) - - - -#define CFG_DISABLE_WIFI_DIRECT_ENHANCEMENT_I 0 - -#define CFG_DISABLE_WIFI_DIRECT_ENHANCEMENT_II 0 - -#define CFG_DISABLE_WIFI_DIRECT_ENHANCEMENT_III 0 - -#define CFG_DISABLE_WIFI_DIRECT_ENHANCEMENT_IV 0 - -#define CFG_DISABLE_DELAY_PROVISION_DISCOVERY 0 - -#define CFG_CONNECTION_POLICY_2_0 0 - -/* Device Password ID */ -enum wps_dev_password_id { - DEV_PW_DEFAULT = 0x0000, - DEV_PW_USER_SPECIFIED = 0x0001, - DEV_PW_MACHINE_SPECIFIED = 0x0002, - DEV_PW_REKEY = 0x0003, - DEV_PW_PUSHBUTTON = 0x0004, - DEV_PW_REGISTRAR_SPECIFIED = 0x0005 -}; - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -#if defined(WINDOWS_DDK) || defined(WINDOWS_CE) -#pragma pack(1) -#endif - -//3 /* --------------- WFA P2P IE and Attributes --------------- */ - -/* P2P 4.1.1 - P2P Information Element */ -typedef struct _IE_P2P_T { - UINT_8 ucId; /* Element ID */ - UINT_8 ucLength; /* Length */ - UINT_8 aucOui[3]; /* OUI */ - UINT_8 ucOuiType; /* OUI Type */ - UINT_8 aucP2PAttributes[1]; /* P2P Attributes */ -} __KAL_ATTRIB_PACKED__ IE_P2P_T, *P_IE_P2P_T; - -/* P2P 4.1.1 - General P2P Attribute */ -typedef struct _P2P_ATTRIBUTE_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 aucBody[1]; /* Body field */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRIBUTE_T, ATTRIBUTE_HDR_T, *P_P2P_ATTRIBUTE_T, *P_ATTRIBUTE_HDR_T; - - -/* P2P 4.1.2 - P2P Status Attribute */ -typedef struct _P2P_ATTRI_STATUS_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 ucStatusCode; /* Status Code */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_STATUS_T, *P_P2P_ATTRI_STATUS_T; - - -/* P2P 4.1.3 - P2P Minor Reason Code Attribute */ -typedef struct _P2P_ATTRI_REASON_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 ucMinorReasonCode; /* Minor Reason Code */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_REASON_T, *P_P2P_ATTRI_REASON_T; - - -/* P2P 4.1.4 - P2P Capability Attribute */ -typedef struct _P2P_ATTRI_CAPABILITY_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 ucDeviceCap; /* Device Capability Bitmap */ - UINT_8 ucGroupCap; /* Group Capability Bitmap */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_CAPABILITY_T, *P_P2P_ATTRI_CAPABILITY_T; - - -/* P2P 4.1.5 - P2P Device ID Attribute */ -typedef struct _P2P_ATTRI_DEV_ID_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 aucDevAddr[MAC_ADDR_LEN]; /* P2P Device Address */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_DEV_ID_T, *P_P2P_ATTRI_DEV_ID_T; - - -/* P2P 4.1.6 - Group Owner Intent Attribute */ -typedef struct _P2P_ATTRI_GO_INTENT_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 ucGOIntent; /* Group Owner Intent */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_GO_INTENT_T, *P_P2P_ATTRI_GO_INTENT_T; - - -/* P2P 4.1.7 - Configuration Timeout Attribute */ -typedef struct _P2P_ATTRI_CFG_TIMEOUT_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 ucGOCfgTimeout; /* GO Configuration Timeout */ - UINT_8 ucClientCfgTimeout; /* Client Configuration Timeout */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_CFG_TIMEOUT_T, *P_P2P_ATTRI_CFG_TIMEOUT_T; - - -/* P2P 4.1.8 - Listen Channel Attribute */ -typedef struct _P2P_ATTRI_LISTEN_CHANNEL_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 aucCountryString[3]; /* Country String */ - UINT_8 ucOperatingClass; /* Operating Class from 802.11 Annex J/P802.11 REVmb 3.0 */ - UINT_8 ucChannelNumber; /* Channel Number */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_LISTEN_CHANNEL_T, *P_P2P_ATTRI_LISTEN_CHANNEL_T; - - -/* P2P 4.1.9 - P2P Group BSSID Attribute */ -typedef struct _P2P_ATTRI_GROUP_BSSID_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 aucBssid[MAC_ADDR_LEN]; /* P2P Group BSSID */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_GROUP_BSSID_T, *P_P2P_ATTRI_GROUP_BSSID_T; - - -/* P2P 4.1.10 - Extended Listen Timing Attribute */ -typedef struct _P2P_ATTRI_EXT_LISTEN_TIMING_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_16 u2AvailPeriod; /* Availability Period */ - UINT_16 u2AvailInterval; /* Availability Interval */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_EXT_LISTEN_TIMING_T, *P_P2P_ATTRI_EXT_LISTEN_TIMING_T; - - -/* P2P 4.1.11 - Intended P2P Interface Address Attribute */ -typedef struct _P2P_ATTRI_INTENDED_IF_ADDR_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 aucIfAddr[MAC_ADDR_LEN];/* P2P Interface Address */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_INTENDED_IF_ADDR_T, *P_P2P_ATTRI_INTENDED_IF_ADDR_T; - - -/* P2P 4.1.12 - P2P Manageability Attribute */ -typedef struct _P2P_ATTRI_MANAGEABILITY_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 ucManageability; /* P2P Manageability Bitmap */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_MANAGEABILITY_T, *P_P2P_ATTRI_MANAGEABILITY_T; - - -/* P2P 4.1.13 - Channel List Attribute */ -typedef struct _P2P_ATTRI_CHANNEL_LIST_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 aucCountryString[3]; /* Country String */ - UINT_8 aucChannelEntry[1]; /* Channel Entry List */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_CHANNEL_T, *P_P2P_ATTRI_CHANNEL_T; - -typedef struct _CHANNEL_ENTRY_FIELD_T { - UINT_8 ucRegulatoryClass; /* Regulatory Class */ - UINT_8 ucNumberOfChannels; /* Number Of Channels */ - UINT_8 aucChannelList[1]; /* Channel List */ -} __KAL_ATTRIB_PACKED__ CHANNEL_ENTRY_FIELD_T, *P_CHANNEL_ENTRY_FIELD_T; - - -/* P2P 4.1.14 - Notice of Absence Attribute */ -typedef struct _P2P_ATTRI_NOA_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 ucIndex; /* Index */ - UINT_8 ucCTWOppPSParam; /* CTWindow and OppPS Parameters */ - UINT_8 aucNoADesc[1]; /* NoA Descriptor */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_NOA_T, *P_P2P_ATTRI_NOA_T; - -typedef struct _NOA_DESCRIPTOR_T { - UINT_8 ucCountType; /* Count/Type */ - UINT_32 u4Duration; /* Duration */ - UINT_32 u4Interval; /* Interval */ - UINT_32 u4StartTime; /* Start Time */ -} __KAL_ATTRIB_PACKED__ NOA_DESCRIPTOR_T, *P_NOA_DESCRIPTOR_T; - -typedef struct _P2P_ATTRI_DEV_INFO_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 aucDevAddr[MAC_ADDR_LEN]; /* P2P Device Address */ - UINT_16 u2ConfigMethodsBE; /* Config Method */ - DEVICE_TYPE_T rPrimaryDevTypeBE; /* Primary Device Type */ - UINT_8 ucNumOfSecondaryDevType; /* Number of Secondary Device Types */ - DEVICE_TYPE_T arSecondaryDevTypeListBE[1]; /* Secondary Device Type List */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_DEV_INFO_T, *P_P2P_ATTRI_DEV_INFO_T; - -/* WPS 7.1 & 11 WPS TLV Data Format - Device Name */ -typedef struct _DEVICE_NAME_TLV_T { - UINT_16 u2Id; /* WPS Attribute Type */ - UINT_16 u2Length; /* Data Length */ - UINT_8 aucName[32]; /* Device Name */ // TODO: Fixme -} __KAL_ATTRIB_PACKED__ DEVICE_NAME_TLV_T, *P_DEVICE_NAME_TLV_T; - - -/* P2P 4.1.16 - P2P Group Info Attribute */ -typedef struct _P2P_CLIENT_INFO_DESC_T { - UINT_8 ucLength; /* Length */ - UINT_8 aucDevAddr[MAC_ADDR_LEN]; /* P2P Device Address */ - UINT_8 aucIfAddr[MAC_ADDR_LEN]; /* P2P Interface Address */ - UINT_8 ucDeviceCap; /* Device Capability Bitmap */ - UINT_16 u2ConfigMethodsBE; /* Config Method */ - DEVICE_TYPE_T rPrimaryDevTypeBE; /* Primary Device Type */ - UINT_8 ucNumOfSecondaryDevType; /* Number of Secondary Device Types */ - DEVICE_TYPE_T arSecondaryDevTypeListBE[1]; /* Secondary Device Type List */ -} __KAL_ATTRIB_PACKED__ P2P_CLIENT_INFO_DESC_T, *P_P2P_CLIENT_INFO_DESC_T; - -typedef struct _P2P_ATTRI_GROUP_INFO_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - P2P_CLIENT_INFO_DESC_T arClientDesc[1]; /* P2P Client Info Descriptors */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_GROUP_INFO_T, *P_P2P_ATTRI_GROUP_INFO_T; - - -/* P2P 4.1.17 - P2P Group ID Attribute */ -typedef struct _P2P_ATTRI_GROUP_ID_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 aucDevAddr[MAC_ADDR_LEN]; /* P2P Device Address */ - UINT_8 aucSSID[ELEM_MAX_LEN_SSID]; /* SSID */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_GROUP_ID_T, *P_P2P_ATTRI_GROUP_ID_T; - - -/* P2P 4.1.18 - P2P Interface Attribute */ -typedef struct _P2P_ATTRI_INTERFACE_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 aucDevAddr[MAC_ADDR_LEN]; /* P2P Device Address */ - UINT_8 ucIfAddrCount; /* P2P Interface Address Count */ - UINT_8 aucIfAddrList[MAC_ADDR_LEN];/* P2P Interface Address List */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_INTERFACE_T, *P_P2P_ATTRI_INTERFACE_T; - - -/* P2P 4.1.19 - Operating Channel Attribute */ -typedef struct _P2P_ATTRI_OPERATING_CHANNEL_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 aucCountryString[3]; /* Country String */ - UINT_8 ucOperatingClass; /* Operating Class from 802.11 Annex J/P802.11 REVmb 3.0 */ - UINT_8 ucChannelNumber; /* Channel Number */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_OPERATING_CHANNEL_T, *P_P2P_ATTRI_OPERATING_CHANNEL_T; - -/* P2P 4.1.20 - Invitation Flags Attribute */ -typedef struct _P2P_ATTRI_INVITATION_FLAG_T { - UINT_8 ucId; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 ucInviteFlagsBitmap; /* Invitation Flags Bitmap */ -} __KAL_ATTRIB_PACKED__ P2P_ATTRI_INVITATION_FLAG_T, *P_P2P_ATTRI_INVITATION_FLAG_T; - - - -/* P2P 4.1.1 - General WSC Attribute */ -typedef struct _WSC_ATTRIBUTE_T { - UINT_16 u2Id; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 aucBody[1]; /* Body field */ -} __KAL_ATTRIB_PACKED__ WSC_ATTRIBUTE_T, *P_WSC_ATTRIBUTE_T; - -/* WSC 1.0 Table 28 */ -typedef struct _WSC_ATTRI_VERSION_T { - UINT_16 u2Id; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_8 ucVersion; /* Version 1.0 or 1.1 */ -} __KAL_ATTRIB_PACKED__ WSC_ATTRI_VERSION_T, *P_WSC_ATTRI_VERSION_T; - -typedef struct _WSC_ATTRI_DEVICE_PASSWORD_ID_T { - UINT_16 u2Id; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_16 u2DevPasswordId; /* Device Password ID */ -} __KAL_ATTRIB_PACKED__ WSC_ATTRI_DEVICE_PASSWORD_ID_T, *P_WSC_ATTRI_DEVICE_PASSWORD_ID_T; - - -typedef struct _WSC_ATTRI_CONFIGURATION_METHOD_T { - UINT_16 u2Id; /* Attribute ID */ - UINT_16 u2Length; /* Length */ - UINT_16 u2ConfigMethods; /* Configure Methods */ -} __KAL_ATTRIB_PACKED__ WSC_ATTRI_CONFIGURATION_METHOD_T, *P_WSC_ATTRI_CONFIGURATION_METHOD_T; - - - -#if defined(WINDOWS_DDK) || defined(WINDOWS_CE) -#pragma pack() -#endif - - -//3 /* --------------- WFA P2P Attributes Handler prototype --------------- */ -typedef UINT_32 (*PFN_APPEND_ATTRI_FUNC)(P_ADAPTER_T, BOOLEAN, PUINT_16, PUINT_8, UINT_16); - -typedef VOID (*PFN_HANDLE_ATTRI_FUNC)(P_SW_RFB_T, P_P2P_ATTRIBUTE_T); - -typedef VOID (*PFN_VERIFY_ATTRI_FUNC)(P_SW_RFB_T, P_P2P_ATTRIBUTE_T, PUINT_16); - -typedef UINT_32 (*PFN_CALCULATE_VAR_ATTRI_LEN_FUNC)(P_ADAPTER_T, P_STA_RECORD_T); - - -typedef struct _APPEND_VAR_ATTRI_ENTRY_T { - UINT_16 u2EstimatedFixedAttriLen; /* For fixed length */ - PFN_CALCULATE_VAR_ATTRI_LEN_FUNC pfnCalculateVariableAttriLen; - PFN_APPEND_ATTRI_FUNC pfnAppendAttri; -} APPEND_VAR_ATTRI_ENTRY_T, *P_APPEND_VAR_ATTRI_ENTRY_T; - -typedef enum _ENUM_CONFIG_METHOD_SEL { - ENUM_CONFIG_METHOD_SEL_AUTO, - ENUM_CONFIG_METHOD_SEL_USER, - ENUM_CONFIG_METHOD_SEL_NUM -} ENUM_CONFIG_METHOD_SEL, *P_ENUM_CONFIG_METHOD_SEL; - -typedef enum _ENUM_P2P_FORMATION_POLICY { - ENUM_P2P_FORMATION_POLICY_AUTO = 0, - ENUM_P2P_FORMATION_POLICY_PASSIVE, /* Device would wait GO NEGO REQ instead of sending it actively. */ - ENUM_P2P_FORMATION_POLICY_NUM -} ENUM_P2P_FORMATION_POLICY, P_ENUM_P2P_FORMATION_POLICY; - -typedef enum _ENUM_P2P_INVITATION_POLICY { - ENUM_P2P_INVITATION_POLICY_USER = 0, - ENUM_P2P_INVITATION_POLICY_ACCEPT_FIRST, - ENUM_P2P_INVITATION_POLICY_DENY_ALL, - ENUM_P2P_INVITATION_POLICY_NUM -} ENUM_P2P_INVITATION_POLICY, P_ENUM_P2P_INVITATION_POLICY; - -//3 /* --------------- Data Structure for P2P Operation --------------- */ -//3 /* Session for CONNECTION SETTINGS of P2P */ -struct _P2P_CONNECTION_SETTINGS_T { - UINT_8 ucDevNameLen; - UINT_8 aucDevName[WPS_ATTRI_MAX_LEN_DEVICE_NAME]; - - DEVICE_TYPE_T rPrimaryDevTypeBE; - - ENUM_P2P_FORMATION_POLICY eFormationPolicy; /* Formation Policy. */ - - /*------------WSC Related Param---------------*/ - UINT_16 u2ConfigMethodsSupport; /* Prefered configure method. - * Some device may not have keypad. - */ - ENUM_CONFIG_METHOD_SEL eConfigMethodSelType; - UINT_16 u2TargetConfigMethod; /* Configure method selected by user or auto. */ - UINT_16 u2LocalConfigMethod; /* Configure method of target. */ - BOOLEAN fgIsPasswordIDRdy; - /*------------WSC Related Param---------------*/ - - UINT_8 ucClientConfigTimeout; - UINT_8 ucGoConfigTimeout; - - UINT_8 ucSecondaryDevTypeCount; -#if P2P_MAX_SUPPORTED_SEC_DEV_TYPE_COUNT - DEVICE_TYPE_T arSecondaryDevTypeBE[P2P_MAX_SUPPORTED_SEC_DEV_TYPE_COUNT]; -#endif - - -#if 0 - UINT_8 ucRfChannelListCount; -#if P2P_MAX_SUPPORTED_CHANNEL_LIST_COUNT - UINT_8 aucChannelList[P2P_MAX_SUPPORTED_CHANNEL_LIST_COUNT]; /* Channel Numbering depends on 802.11mb Annex J. */ - -#endif -#else - UINT_8 ucRfChannelListSize; -#if P2P_MAX_SUPPORTED_CHANNEL_LIST_SIZE - UINT_8 aucChannelEntriesField[P2P_MAX_SUPPORTED_CHANNEL_LIST_SIZE]; -#endif -#endif - - /* Go Intent */ - UINT_8 ucTieBreaker; - UINT_8 ucGoIntent; - - /* For Device Capability */ - BOOLEAN fgSupportServiceDiscovery; - BOOLEAN fgSupportClientDiscoverability; - BOOLEAN fgSupportConcurrentOperation; - BOOLEAN fgSupportInfraManaged; - BOOLEAN fgSupportInvitationProcedure; - - /* For Group Capability */ - BOOLEAN fgSupportPersistentP2PGroup; - BOOLEAN fgSupportIntraBSSDistribution; - BOOLEAN fgSupportCrossConnection; - BOOLEAN fgSupportPersistentReconnect; - - BOOLEAN fgP2pGroupLimit; - - BOOLEAN fgSupportOppPS; - UINT_16 u2CTWindow; - - BOOLEAN fgIsScanReqIssued; - BOOLEAN fgIsServiceDiscoverIssued; - - - /*============ Target Device Connection Settings ============*/ - - /* Discover Target Device Info. */ - BOOLEAN fgIsDevId; - BOOLEAN fgIsDevType; - - /* Encryption mode of Target Device */ - ENUM_PARAM_AUTH_MODE_T eAuthMode; - - /* SSID - * 1. AP Mode, this is the desired SSID user specified. - * 2. Client Mode, this is the target SSID to be connected to. - */ - UINT_8 aucSSID[ELEM_MAX_LEN_SSID]; - UINT_8 ucSSIDLen; - - /* Operating channel requested. */ - UINT_8 ucOperatingChnl; - ENUM_BAND_T eBand; - - /* Linten channel requested. */ - UINT_8 ucListenChnl; - - /* For device discover address/type. */ - UINT_8 aucTargetDevAddr[MAC_ADDR_LEN]; /* P2P Device Address, for P2P Device Discovery & P2P Connection. */ - -#if CFG_ENABLE_WIFI_DIRECT - P_P2P_DEVICE_DESC_T prTargetP2pDesc; -#endif - - UINT_8 ucLastStatus; /* P2P FSM would append status attribute according to this field. */ - - -#if !CFG_DISABLE_DELAY_PROVISION_DISCOVERY - UINT_8 ucLastDialogToken; - UINT_8 aucIndicateDevAddr[MAC_ADDR_LEN]; -#endif - -#if 0 - UINT_8 ucTargetRfChannelListCount; -#if P2P_MAX_SUPPORTED_CHANNEL_LIST_COUNT - UINT_8 aucTargetChannelList[P2P_MAX_SUPPORTED_CHANNEL_LIST_COUNT]; /* Channel Numbering depends on 802.11mb Annex J. */ -#endif -#endif - -}; - - -typedef struct _NOA_TIMING_T { - BOOLEAN fgIsInUse; /* Indicate if this entry is in use or not */ - UINT_8 ucCount; /* Count */ - - UINT_8 aucReserved[2]; - - UINT_32 u4Duration; /* Duration */ - UINT_32 u4Interval; /* Interval */ - UINT_32 u4StartTime; /* Start Time */ -} NOA_TIMING_T, *P_NOA_TIMING_T; - -typedef enum _ENUM_P2P_IOCTL_T { - P2P_IOCTL_IDLE = 0, - P2P_IOCTL_DEV_DISCOVER, - P2P_IOCTL_INVITATION_REQ, - P2P_IOCTL_SERV_DISCOVER, - P2P_IOCTL_WAITING, - P2P_IOCTL_NUM -} ENUM_P2P_IOCTL_T; - - - -/*---------------- Service Discovery Related -------------------*/ -typedef enum _ENUM_SERVICE_TX_TYPE_T { - ENUM_SERVICE_TX_TYPE_BY_DA, - ENUM_SERVICE_TX_TYPE_BY_CHNL, - ENUM_SERVICE_TX_TYPE_NUM -} ENUM_SERVICE_TX_TYPE_T; - - -typedef struct _SERVICE_DISCOVERY_FRAME_DATA_T { - QUE_ENTRY_T rQueueEntry; - P_MSDU_INFO_T prSDFrame; - ENUM_SERVICE_TX_TYPE_T eServiceType; - UINT_8 ucSeqNum; - union { - - UINT_8 ucChannelNum; - UINT_8 aucPeerAddr[MAC_ADDR_LEN]; - } uTypeData; - BOOLEAN fgIsTxDoneIndicate; -} SERVICE_DISCOVERY_FRAME_DATA_T, *P_SERVICE_DISCOVERY_FRAME_DATA_T; - - - - -struct _P2P_FSM_INFO_T_DEPRECATED { - /* P2P FSM State */ - ENUM_P2P_STATE_T eCurrentState; - - /* Channel */ - BOOLEAN fgIsChannelRequested; - - - - - - - - - - - ENUM_P2P_STATE_T ePreviousState; - - ENUM_P2P_STATE_T eReturnState; /* Return state after current activity finished or abort. */ - - UINT_8 aucTargetIfAddr[PARAM_MAC_ADDR_LEN]; - P_BSS_DESC_T prTargetBss; /* BSS of target P2P Device. For Connection/Service Discovery */ - - P_STA_RECORD_T prTargetStaRec; - - BOOLEAN fgIsRsponseProbe; /* Indicate if P2P FSM can response probe request frame. */ - - /* Sequence number of requested message. */ - UINT_8 ucSeqNumOfReqMsg; /* Used for SAA FSM request message. */ - - /* Channel Privilege */ - UINT_8 ucSeqNumOfChReq; /* Used for Channel Request message. */ - - - UINT_8 ucSeqNumOfScnMsg; /* Used for SCAN FSM request message. */ - UINT_8 ucSeqNumOfCancelMsg; - - UINT_8 ucDialogToken; - UINT_8 ucRxDialogToken; - - /* Timer */ - TIMER_T rDeviceDiscoverTimer; /* For device discovery time of each discovery request from user.*/ - TIMER_T rOperationListenTimer; /* For Find phase under operational state. */ - TIMER_T rFSMTimer; /* A timer used for Action frame timeout usage. */ - - TIMER_T rRejoinTimer; /* A timer used for Action frame timeout usage. */ - - - /* Flag to indicate Provisioning */ - BOOLEAN fgIsConnectionRequested; - - /* Current IOCTL. */ - ENUM_P2P_IOCTL_T eP2pIOCTL; - - UINT_8 ucAvailableAuthTypes; /* Used for AUTH_MODE_AUTO_SWITCH */ - - /*--------SERVICE DISCOVERY--------*/ - QUE_T rQueueGASRx; /* Input Request/Response. */ - QUE_T rQueueGASTx; /* Output Response. */ - P_SERVICE_DISCOVERY_FRAME_DATA_T prSDRequest; - UINT_8 ucVersionNum; /* GAS packet sequence number for...Action Frame? */ - UINT_8 ucGlobalSeqNum; /* Sequence Number of RX SD packet. */ - /*--------Service DISCOVERY--------*/ - - /*--------DEVICE DISCOVERY---------*/ - UINT_8 aucTargetGroupID[PARAM_MAC_ADDR_LEN]; - UINT_16 u2TargetGroupSsidLen; - UINT_8 aucTargetSsid[32]; - UINT_8 aucSearchingP2pDevice[PARAM_MAC_ADDR_LEN]; - UINT_8 ucDLToken; - /*----------------------------------*/ - - /* Indicating Peer Status. */ - UINT_32 u4Flags; - - /*Indicating current running mode.*/ - BOOLEAN fgIsApMode; - - - /*------------INVITATION------------*/ - ENUM_P2P_INVITATION_POLICY eInvitationRspPolicy; - /*----------------------------------*/ - -}; - - - -struct _P2P_SPECIFIC_BSS_INFO_T { - /* For GO(AP) Mode - Compose TIM IE */ - UINT_16 u2SmallestAID; - UINT_16 u2LargestAID; - UINT_8 ucBitmapCtrl; - //UINT_8 aucPartialVirtualBitmap[MAX_LEN_TIM_PARTIAL_BMP]; - - /* For GC/GO OppPS */ - BOOLEAN fgEnableOppPS; - UINT_16 u2CTWindow; - - /* For GC/GO NOA */ - UINT_8 ucNoAIndex; - UINT_8 ucNoATimingCount; /* Number of NoA Timing */ - NOA_TIMING_T arNoATiming[P2P_MAXIMUM_NOA_COUNT]; - - BOOLEAN fgIsNoaAttrExisted; - - /* For P2P Device */ - UINT_8 ucRegClass; /* Regulatory Class for channel. */ - UINT_8 ucListenChannel; /* Linten Channel only on channels 1, 6 and 11 in the 2.4 GHz. */ - - UINT_8 ucPreferredChannel; /* Operating Channel, should be one of channel list in p2p connection settings. */ - ENUM_CHNL_EXT_T eRfSco; - ENUM_BAND_T eRfBand; - - /* Extened Listen Timing. */ - UINT_16 u2AvailabilityPeriod; - UINT_16 u2AvailabilityInterval; - - -#if 0 //LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) - UINT_16 u2IELenForBCN; - UINT_8 aucBeaconIECache[P2P_MAXIMUM_ATTRIBUTES_CACHE_SIZE + WPS_MAXIMUM_ATTRIBUTES_CACHE_SIZE]; - -// UINT_16 u2IELenForProbeRsp; -// UINT_8 aucProbeRspIECache[P2P_MAXIMUM_ATTRIBUTES_CACHE_SIZE + WPS_MAXIMUM_ATTRIBUTES_CACHE_SIZE]; - - UINT_16 u2IELenForAssocRsp; - UINT_8 aucAssocRspIECache[P2P_MAXIMUM_ATTRIBUTES_CACHE_SIZE + WPS_MAXIMUM_ATTRIBUTES_CACHE_SIZE]; - -#else - UINT_16 u2AttributeLen; - UINT_8 aucAttributesCache[P2P_MAXIMUM_ATTRIBUTES_CACHE_SIZE]; - - UINT_16 u2WscAttributeLen; - UINT_8 aucWscAttributesCache[WPS_MAXIMUM_ATTRIBUTES_CACHE_SIZE]; -#endif - UINT_8 aucGroupID[MAC_ADDR_LEN]; - UINT_16 u2GroupSsidLen; - UINT_8 aucGroupSsid[ELEM_MAX_LEN_SSID]; - - PARAM_CUSTOM_NOA_PARAM_STRUC_T rNoaParam; - PARAM_CUSTOM_OPPPS_PARAM_STRUC_T rOppPsParam; - -}; - - - - - - - -typedef struct _MSG_P2P_DEVICE_DISCOVER_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_32 u4DevDiscoverTime; /* 0: Infinite, 1~X: in unit of MS. */ - BOOLEAN fgIsSpecificType; -#if CFG_ENABLE_WIFI_DIRECT - P2P_DEVICE_TYPE_T rTargetDeviceType; -#endif - UINT_8 aucTargetDeviceID[MAC_ADDR_LEN]; -} MSG_P2P_DEVICE_DISCOVER_T, *P_MSG_P2P_DEVICE_DISCOVER_T; - - - -typedef struct _MSG_P2P_INVITATION_REQUEST_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 aucDeviceID[MAC_ADDR_LEN]; /* Target Device ID to be invited. */ -} MSG_P2P_INVITATION_REQUEST_T, *P_MSG_P2P_INVITATION_REQUEST_T; - -typedef struct _MSG_P2P_FUNCTION_SWITCH_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - BOOLEAN fgIsFuncOn; -} MSG_P2P_FUNCTION_SWITCH_T, *P_MSG_P2P_FUNCTION_SWITCH_T; - -typedef struct _MSG_P2P_SERVICE_DISCOVERY_REQUEST_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 aucDeviceID[MAC_ADDR_LEN]; - BOOLEAN fgNeedTxDoneIndicate; - UINT_8 ucSeqNum; -} MSG_P2P_SERVICE_DISCOVERY_REQUEST_T, *P_MSG_P2P_SERVICE_DISCOVERY_REQUEST_T; - - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -#define p2pChangeMediaState(_prAdapter, _eNewMediaState) \ - (_prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX].eConnectionState = (_eNewMediaState)); - -#define ATTRI_ID(_fp) (((P_P2P_ATTRIBUTE_T) _fp)->ucId) -#define ATTRI_LEN(_fp) \ - (((UINT_16) ((PUINT_8)&((P_P2P_ATTRIBUTE_T) _fp)->u2Length)[0]) | \ - ((UINT_16) ((PUINT_8)&((P_P2P_ATTRIBUTE_T) _fp)->u2Length)[1] << 8)) - - -#define ATTRI_SIZE(_fp) (P2P_ATTRI_HDR_LEN + ATTRI_LEN(_fp)) - -#define P2P_ATTRI_FOR_EACH(_pucAttriBuf, _u2AttriBufLen, _u2Offset) \ - for ((_u2Offset) = 0; ((_u2Offset) < (_u2AttriBufLen)); \ - (_u2Offset) += ATTRI_SIZE(_pucAttriBuf), ((_pucAttriBuf) += ATTRI_SIZE(_pucAttriBuf)) ) - - -#define P2P_IE(_fp) ((P_IE_P2P_T) _fp) - - -#define WSC_ATTRI_ID(_fp) \ - (((UINT_16) ((PUINT_8)&((P_WSC_ATTRIBUTE_T) _fp)->u2Id)[0] << 8) | \ - ((UINT_16) ((PUINT_8)&((P_WSC_ATTRIBUTE_T) _fp)->u2Id)[1])) - -#define WSC_ATTRI_LEN(_fp) \ - (((UINT_16) ((PUINT_8)&((P_WSC_ATTRIBUTE_T) _fp)->u2Length)[0] << 8) | \ - ((UINT_16) ((PUINT_8)&((P_WSC_ATTRIBUTE_T) _fp)->u2Length)[1])) - - -#define WSC_ATTRI_SIZE(_fp) (WSC_ATTRI_HDR_LEN + WSC_ATTRI_LEN(_fp)) - -#define WSC_ATTRI_FOR_EACH(_pucAttriBuf, _u2AttriBufLen, _u2Offset) \ - for ((_u2Offset) = 0; ((_u2Offset) < (_u2AttriBufLen)); \ - (_u2Offset) += WSC_ATTRI_SIZE(_pucAttriBuf), ((_pucAttriBuf) += WSC_ATTRI_SIZE(_pucAttriBuf)) ) - -#define WSC_IE(_fp) ((P_IE_P2P_T) _fp) - - -#define WFD_ATTRI_SIZE(_fp) (P2P_ATTRI_HDR_LEN + WSC_ATTRI_LEN(_fp)) - -#define WFD_ATTRI_FOR_EACH(_pucAttriBuf, _u2AttriBufLen, _u2Offset) \ - for ((_u2Offset) = 0; ((_u2Offset) < (_u2AttriBufLen)); \ - (_u2Offset) += WFD_ATTRI_SIZE(_pucAttriBuf), ((_pucAttriBuf) += WFD_ATTRI_SIZE(_pucAttriBuf)) ) - - - - -#if DBG - #define ASSERT_BREAK(_exp) \ - { \ - if (!(_exp)) { \ - ASSERT(FALSE); \ - break; \ - } \ - } - -#else - #define ASSERT_BREAK(_exp) -#endif - - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/*======P2P State======*/ -VOID -p2pStateInit_LISTEN( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN P_P2P_SPECIFIC_BSS_INFO_T prSP2pBssInfo, - IN UINT_8 ucListenChannel - ); - -VOID -p2pStateAbort_LISTEN( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsChannelExtenstion - ); - -VOID -p2pStateAbort_SEARCH_SCAN( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsChannelExtenstion - ); - -VOID -p2pStateAbort_GO_OPERATION( - IN P_ADAPTER_T prAdapter - ); - -VOID -p2pStateAbort_GC_OPERATION( - IN P_ADAPTER_T prAdapter - ); - -VOID -p2pStateInit_CONFIGURATION( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN P_BSS_INFO_T prP2pBssInfo, - IN P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecBssInfo - ); - -VOID -p2pStateAbort_CONFIGURATION( - IN P_ADAPTER_T prAdapter - ); - -VOID -p2pStateInit_JOIN( - IN P_ADAPTER_T prAdapter - ); - -VOID -p2pStateAbort_JOIN( - IN P_ADAPTER_T prAdapter - ); - -/*====== P2P Functions ======*/ - - -VOID -p2pFuncInitGO( - IN P_ADAPTER_T prAdapter - ); - - - - - -VOID -p2pFuncDisconnect( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN BOOLEAN fgSendDeauth, - IN UINT_16 u2ReasonCode - ); - -VOID -p2pFuncSwitchOPMode( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prP2pBssInfo, - IN ENUM_OP_MODE_T eOpMode, - IN BOOLEAN fgSyncToFW - ); - -VOID -p2pFuncRunEventProvisioningComplete( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -WLAN_STATUS -p2pFuncSetGroupID( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucGroupID, - IN PUINT_8 pucSsid, - IN UINT_8 ucSsidLen - ); - - -WLAN_STATUS -p2pFuncSendDeviceDiscoverabilityReqFrame( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucDestAddr[], - IN UINT_8 ucDialogToken - ); - -WLAN_STATUS -p2pFuncSendDeviceDiscoverabilityRspFrame( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucDestAddr[], - IN UINT_8 ucDialogToken - ); - - -UINT_8 -p2pFuncGetVersionNumOfSD( - IN P_ADAPTER_T prAdapter - ); - -/*====== P2P FSM ======*/ -VOID -p2pFsmRunEventConnectionRequest( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pFsmRunEventDeviceDiscoveryRequest( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pFsmRunEventDeviceDiscoveryAbort( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pFsmRunEventRxGroupNegotiationReqFrame( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -WLAN_STATUS -p2pFsmRunEventGroupNegotiationRequestTxDone( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - -WLAN_STATUS -p2pFsmRunEventGroupNegotiationResponseTxDone( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - -WLAN_STATUS -p2pFsmRunEventGroupNegotiationConfirmTxDone( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - -WLAN_STATUS -p2pFsmRunEventProvisionDiscoveryRequestTxDone( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - -WLAN_STATUS -p2pFsmRunEventProvisionDiscoveryResponseTxDone( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - - -WLAN_STATUS -p2pFsmRunEventInvitationRequestTxDone ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - - - -VOID -p2pFsmRunEventRxDeauthentication( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prSwRfb - ); - -VOID -p2pFsmRunEventRxDisassociation( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prSwRfb - ); - -VOID -p2pFsmRunEventBeaconTimeout( - IN P_ADAPTER_T prAdapter - ); - - - -WLAN_STATUS -p2pFsmRunEventDeauthTxDone( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - - -#if 1 -#endif - - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -/*======Mail Box Event Message=====*/ - - -VOID -p2pFsmRunEventConnectionAbort( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pFsmRunEventConnectionTrigger( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - - -VOID -p2pFsmRunEventP2PFunctionSwitch( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pFsmRunEventChGrant( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pFsmRunEventJoinComplete( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pFsmRunEventConnectionPause( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pIndicationOfMediaStateToHost( - IN P_ADAPTER_T prAdapter, - IN ENUM_PARAM_MEDIA_STATE_T eConnectionState, - IN UINT_8 aucTargetAddr[] - ); - -VOID -p2pUpdateBssInfoForJOIN( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prAssocRspSwRfb - ); - -/*======Mail Box Event Message=====*/ - - -VOID -p2pFsmInit( - IN P_ADAPTER_T prAdapter - ); - -VOID -p2pFsmUninit( - IN P_ADAPTER_T prAdapter - ); - -VOID -p2pFsmSteps( - IN P_ADAPTER_T prAdapter, - IN ENUM_P2P_STATE_T eNextState - ); - -VOID -p2pStartGO( - IN P_ADAPTER_T prAdapter - ); - -VOID -p2pAssignSsid( - IN PUINT_8 pucSsid, - IN PUINT_8 pucSsidLen - ); - -VOID -p2pFsmRunEventScanDone( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -p2pFsmRunEventIOReqTimeout( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Param - ); - -VOID -p2pFsmRunEventSearchPeriodTimeout( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Param - ); - -VOID -p2pFsmRunEventFsmTimeout( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Param - ); - -VOID -p2pFsmRunEventRejoinTimeout( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Parm - ); - - - - -/*=============== P2P Function Related ================*/ - -/*=============== P2P Function Related ================*/ - - -#if CFG_TEST_WIFI_DIRECT_GO -VOID -p2pTest( - IN P_ADAPTER_T prAdapter - ); -#endif /* CFG_TEST_WIFI_DIRECT_GO */ - - - - -VOID -p2pGenerateP2P_IEForBeacon( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - -VOID -p2pGenerateP2P_IEForAssocReq( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - -VOID -p2pGenerateP2P_IEForAssocRsp( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - - -VOID -p2pGenerateP2P_IEForProbeReq( - IN P_ADAPTER_T prAdapter, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - - - - -UINT_32 -p2pCalculateP2P_IELenForBeacon( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ); - -UINT_32 -p2pCalculateP2P_IELenForAssocRsp( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ); - - -UINT_32 -p2pCalculateP2P_IELenForProbeReq( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ); - - - -VOID -p2pGenerateWSC_IEForProbeResp( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - -VOID -p2pGenerateWSC_IEForProbeReq( - IN P_ADAPTER_T prAdapter, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - - - -UINT_16 -p2pCalculateWSC_IELenForProbeReq( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ); - -UINT_32 -p2pCalculateWSC_IELenForProbeResp( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ); - -UINT_32 -p2pAppendAttriStatus( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - - - -UINT_32 -p2pAppendAttriCapability( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pAppendAttriGoIntent( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pAppendAttriCfgTimeout( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pAppendAttriGroupBssid( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - - -UINT_32 -p2pAppendAttriDeviceIDForBeacon( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pAppendAttriDeviceIDForProbeReq( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pAppendAttriDeviceIDForDeviceDiscoveryReq( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pAppendAttriListenChannel( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pAppendAttriIntendP2pIfAddr( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - - -UINT_32 -p2pAppendAttriChannelList( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pCalculateAttriLenChannelList( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -UINT_32 -p2pAppendAttriNoA( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pAppendAttriDeviceInfo( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pCalculateAttriLenDeviceInfo( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -UINT_32 -p2pAppendAttriGroupInfo( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pCalculateAttriLenGroupInfo( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - - -UINT_32 -p2pAppendAttriP2pGroupID( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pAppendAttriOperatingChannel( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pAppendAttriInvitationFlag( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - - -VOID -p2pGenerateWscIE ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucOuiType, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize, - IN APPEND_VAR_ATTRI_ENTRY_T arAppendAttriTable[], - IN UINT_32 u4AttriTableSize - ); - -UINT_32 -p2pAppendAttriWSCConfigMethod ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pAppendAttriWSCVersion ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pAppendAttriWSCGONegReqDevPasswordId ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -UINT_32 -p2pAppendAttriWSCGONegRspDevPasswordId ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -WLAN_STATUS -p2pGetWscAttriList( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucOuiType, - IN PUINT_8 pucIE, - IN UINT_16 u2IELength, - OUT PPUINT_8 ppucAttriList, - OUT PUINT_16 pu2AttriListLen - ); - -WLAN_STATUS -p2pGetAttriList ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucOuiType, - IN PUINT_8 pucIE, - IN UINT_16 u2IELength, - OUT PPUINT_8 ppucAttriList, - OUT PUINT_16 pu2AttriListLen - ); - -VOID -p2pRunEventAAATxFail ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -WLAN_STATUS -p2pRunEventAAASuccess ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - - -WLAN_STATUS -p2pRunEventAAAComplete ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -WLAN_STATUS -p2pSendProbeResponseFrame( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -BOOLEAN -p2pFsmRunEventRxProbeRequestFrame( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -VOID -p2pFsmRunEventRxProbeResponseFrame( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN P_BSS_DESC_T prBssDesc - ); - -WLAN_STATUS -p2pRxPublicActionFrame( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -WLAN_STATUS -p2pRxActionFrame( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -VOID -p2pFsmRunEventRxGroupNegotiationRspFrame( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -VOID -p2pFsmRunEventRxGroupNegotiationCfmFrame( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - - -#if 0 // frog -BOOLEAN -scanMatchFilterOfP2P ( - IN P_SW_RFB_T prSWRfb, - IN PP_BSS_DESC_T pprBssDesc - ); -#endif // frog - -VOID -p2pProcessEvent_UpdateNOAParam ( - IN P_ADAPTER_T prAdapter, - UINT_8 ucNetTypeIndex, - P_EVENT_UPDATE_NOA_PARAMS_T prEventUpdateNoaParam - ); - -VOID -p2pFuncCompleteIOCTL( - IN P_ADAPTER_T prAdapter, - IN WLAN_STATUS rWlanStatus - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#ifndef _lint -/* Kevin: we don't have to call following function to inspect the data structure. - * It will check automatically while at compile time. - * We'll need this for porting driver to different RTOS. - */ -__KAL_INLINE__ VOID -p2pDataTypeCheck ( - VOID - ) -{ - DATA_STRUC_INSPECTING_ASSERT(sizeof(IE_P2P_T) == (2+4+1)); // all UINT_8 - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRIBUTE_T) == (3+1)); - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_STATUS_T) == (3+1)); - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_REASON_T) == (3+1)); - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_CAPABILITY_T) == (3+2)); - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_DEV_ID_T) == (3+6)); - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_GO_INTENT_T) == (3+1)); - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_CFG_TIMEOUT_T) == (3+2)); -#if CID52_53_54 - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_LISTEN_CHANNEL_T) == (3+5)); -#else - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_LISTEN_CHANNEL_T) == (3+5)); -#endif - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_GROUP_BSSID_T) == (3+6)); - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_EXT_LISTEN_TIMING_T) == (3+4)); - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_INTENDED_IF_ADDR_T) == (3+6)); - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_MANAGEABILITY_T) == (3+1)); - - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_CHANNEL_T) == (3+4)); - DATA_STRUC_INSPECTING_ASSERT(sizeof(CHANNEL_ENTRY_FIELD_T) == 3); - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_NOA_T) == (3+3)); - DATA_STRUC_INSPECTING_ASSERT(sizeof(NOA_DESCRIPTOR_T) == 13); - DATA_STRUC_INSPECTING_ASSERT(sizeof(DEVICE_TYPE_T) == 8); - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_DEV_INFO_T) == (3+6+2+8+1+8)); - DATA_STRUC_INSPECTING_ASSERT(sizeof(DEVICE_NAME_TLV_T) == (4+32)); - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_CLIENT_INFO_DESC_T) == (1+6+6+1+2+8+1+8)); - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_GROUP_INFO_T) == (3+(1+6+6+1+2+8+1+8))); - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_GROUP_ID_T) == (3+38)); - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_INTERFACE_T) == (3+13)); -#if CID52_53_54 - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_OPERATING_CHANNEL_T) == (3+5)); -#else - DATA_STRUC_INSPECTING_ASSERT(sizeof(P2P_ATTRI_OPERATING_CHANNEL_T) == (3+5)); -#endif - - - return; -} -#endif /* _lint */ - -#endif /* _P2P_FSM_H */ - - - - diff --git a/drivers/net/wireless/mt5931/include/mgmt/p2p_func.h b/drivers/net/wireless/mt5931/include/mgmt/p2p_func.h deleted file mode 100755 index 6d9db0274603..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/p2p_func.h +++ /dev/null @@ -1,324 +0,0 @@ -#ifndef _P2P_FUNC_H -#define _P2P_FUNC_H - - -VOID -p2pFuncRequestScan( - IN P_ADAPTER_T prAdapter, - IN P_P2P_SCAN_REQ_INFO_T prScanReqInfo - ); - -VOID -p2pFuncCancelScan( - IN P_ADAPTER_T prAdapter, - IN P_P2P_SCAN_REQ_INFO_T prScanReqInfo - ); - - - -VOID -p2pFuncStartGO( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo, - IN PUINT_8 pucSsidBuf, - IN UINT_8 ucSsidLen, - IN UINT_8 ucChannelNum, - IN ENUM_BAND_T eBand, - IN ENUM_CHNL_EXT_T eSco, - IN BOOLEAN fgIsPureAP - ); - - - -VOID -p2pFuncAcquireCh( - IN P_ADAPTER_T prAdapter, - IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo - ); - - -VOID -p2pFuncReleaseCh( - IN P_ADAPTER_T prAdapter, - IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo - ); - -VOID -p2pFuncSetChannel( - IN P_ADAPTER_T prAdapter, - IN P_RF_CHANNEL_INFO_T prRfChannelInfo - ); - - -BOOLEAN -p2pFuncRetryJOIN( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN P_P2P_JOIN_INFO_T prJoinInfo - ); - -VOID -p2pFuncUpdateBssInfoForJOIN ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prAssocRspSwRfb - ); - - -WLAN_STATUS -p2pFuncTxMgmtFrame( - IN P_ADAPTER_T prAdapter, - IN P_P2P_MGMT_TX_REQ_INFO_T prMgmtTxReqInfo, - IN P_MSDU_INFO_T prMgmtTxMsdu, - IN UINT_64 u8Cookie - ); - -WLAN_STATUS -p2pFuncBeaconUpdate( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prP2pBssInfo, - IN P_P2P_BEACON_UPDATE_INFO_T prBcnUpdateInfo, - IN PUINT_8 pucNewBcnHdr, - IN UINT_32 u4NewHdrLen, - IN PUINT_8 pucNewBcnBody, - IN UINT_32 u4NewBodyLen - ); - - -BOOLEAN -p2pFuncValidateAuth( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN PP_STA_RECORD_T pprStaRec, - OUT PUINT_16 pu2StatusCode - ); - -BOOLEAN -p2pFuncValidateAssocReq( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_16 pu2StatusCode - ); - - -VOID -p2pFuncResetStaRecStatus( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -VOID -p2pFuncInitConnectionSettings( - IN P_ADAPTER_T prAdapter, - IN P_P2P_CONNECTION_SETTINGS_T prP2PConnSettings - ); - - -BOOLEAN -p2pFuncParseCheckForP2PInfoElem( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBuf, - OUT PUINT_8 pucOuiType - ); - - -BOOLEAN -p2pFuncValidateProbeReq( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_32 pu4ControlFlags - ); - -VOID -p2pFuncValidateRxActionFrame( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -BOOLEAN -p2pFuncIsAPMode( - IN P_P2P_FSM_INFO_T prP2pFsmInfo - ); - - -VOID -p2pFuncParseBeaconContent( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prP2pBssInfo, - IN PUINT_8 pucIEInfo, - IN UINT_32 u4IELen - ); - - -P_BSS_DESC_T -p2pFuncKeepOnConnection( - - IN P_ADAPTER_T prAdapter, - IN P_P2P_CONNECTION_REQ_INFO_T prConnReqInfo, - IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo, - IN P_P2P_SCAN_REQ_INFO_T prScanReqInfo - ); - - -VOID -p2pFuncStoreAssocRspIEBuffer( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - - -VOID -p2pFuncMgmtFrameRegister( - IN P_ADAPTER_T prAdapter, - IN UINT_16 u2FrameType, - IN BOOLEAN fgIsRegistered, - OUT PUINT_32 pu4P2pPacketFilter - ); - -VOID -p2pFuncUpdateMgmtFrameRegister( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4OsFilter - ); - - -VOID -p2pFuncGetStationInfo( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucMacAddr, - OUT P_P2P_STATION_INFO_T prStaInfo - ); - -P_MSDU_INFO_T -p2pFuncProcessP2pProbeRsp( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMgmtTxMsdu - ); - -#if 0 //LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) -UINT_32 -p2pFuncCalculateExtra_IELenForBeacon( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ); - -VOID -p2pFuncGenerateExtra_IEForBeacon( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - - -#else -UINT_32 -p2pFuncCalculateP2p_IELenForBeacon( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ); - - -VOID -p2pFuncGenerateP2p_IEForBeacon( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - - -UINT_32 -p2pFuncCalculateWSC_IELenForBeacon( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ); - -VOID -p2pFuncGenerateWSC_IEForBeacon( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); -#endif -UINT_32 -p2pFuncCalculateP2p_IELenForAssocRsp( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ); - -VOID -p2pFuncGenerateP2p_IEForAssocRsp( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - - -UINT_32 -p2pFuncCalculateP2P_IELen( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec, - IN APPEND_VAR_ATTRI_ENTRY_T arAppendAttriTable[], - IN UINT_32 u4AttriTableSize - ); - -VOID -p2pFuncGenerateP2P_IE( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize, - IN APPEND_VAR_ATTRI_ENTRY_T arAppendAttriTable[], - IN UINT_32 u4AttriTableSize - ); - - -UINT_32 -p2pFuncAppendAttriStatusForAssocRsp( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - - -UINT_32 -p2pFuncAppendAttriExtListenTiming( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ); - -VOID -p2pFuncDissolve( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prP2pBssInfo, - IN BOOLEAN fgSendDeauth, - IN UINT_16 u2ReasonCode - ); - - -P_IE_HDR_T -p2pFuncGetSpecIE( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucIEBuf, - IN UINT_16 u2BufferLen, - IN UINT_8 ucElemID, - IN PBOOLEAN pfgIsMore - ); - -P_ATTRIBUTE_HDR_T -p2pFuncGetSpecAttri( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucOuiType, - IN PUINT_8 pucIEBuf, - IN UINT_16 u2BufferLen, - IN UINT_8 ucAttriID - ); - -#endif diff --git a/drivers/net/wireless/mt5931/include/mgmt/p2p_ie.h b/drivers/net/wireless/mt5931/include/mgmt/p2p_ie.h deleted file mode 100755 index fa5b651e3ee3..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/p2p_ie.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef _P2P_IE_H -#define _P2P_IE_H - - -UINT_32 -p2pCalculate_IEForAssocReq( - - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ); - - -VOID -p2pGenerate_IEForAssocReq( - - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - - - -#endif diff --git a/drivers/net/wireless/mt5931/include/mgmt/p2p_rlm.h b/drivers/net/wireless/mt5931/include/mgmt/p2p_rlm.h deleted file mode 100755 index fe20ac38048f..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/p2p_rlm.h +++ /dev/null @@ -1,109 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/mgmt/p2p_rlm.h#1 $ -*/ - -/*! \file "rlm.h" - \brief -*/ - - - - -#ifndef _P2P_RLM_H -#define _P2P_RLM_H - - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - - -VOID -rlmBssInitForAP( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ); - -BOOLEAN -rlmUpdateBwByChListForAP ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ); - -VOID -rlmUpdateParamsForAP ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - BOOLEAN fgUpdateBeacon - ); - -VOID -rlmFuncInitialChannelList( - IN P_ADAPTER_T prAdapter - ); - -VOID -rlmFuncCommonChannelList( - IN P_ADAPTER_T prAdapter, - IN P_CHANNEL_ENTRY_FIELD_T prChannelEntryII, - IN UINT_8 ucChannelListSize - ); - -UINT_8 -rlmFuncFindOperatingClass( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucChannelNum - ); - -BOOLEAN -rlmFuncFindAvailableChannel( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucCheckChnl, - IN PUINT_8 pucSuggestChannel, - IN BOOLEAN fgIsSocialChannel, - IN BOOLEAN fgIsDefaultChannel - ); - -ENUM_CHNL_EXT_T -rlmDecideScoForAP ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ); - -#endif diff --git a/drivers/net/wireless/mt5931/include/mgmt/p2p_rlm_obss.h b/drivers/net/wireless/mt5931/include/mgmt/p2p_rlm_obss.h deleted file mode 100755 index fa93d94decde..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/p2p_rlm_obss.h +++ /dev/null @@ -1,93 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/mgmt/p2p_rlm_obss.h#1 $ -*/ - -/*! \file "rlm_obss.h" - \brief -*/ - - - -#ifndef _P2P_RLM_OBSS_H -#define _P2P_RLM_OBSS_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -VOID -rlmRspGenerateObssScanIE ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ); - -VOID -rlmProcessPublicAction ( - P_ADAPTER_T prAdapter, - P_SW_RFB_T prSwRfb - ); - -VOID -rlmProcessHtAction ( - P_ADAPTER_T prAdapter, - P_SW_RFB_T prSwRfb - ); - -VOID -rlmHandleObssStatusEventPkt ( - P_ADAPTER_T prAdapter, - P_EVENT_AP_OBSS_STATUS_T prObssStatus - ); - -UINT_8 -rlmObssChnlLevel ( - P_BSS_INFO_T prBssInfo, - ENUM_BAND_T eBand, - UINT_8 ucPriChannel, - ENUM_CHNL_EXT_T eExtend - ); - -VOID -rlmObssScanExemptionRsp ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - P_SW_RFB_T prSwRfb - ); - -#endif diff --git a/drivers/net/wireless/mt5931/include/mgmt/p2p_scan.h b/drivers/net/wireless/mt5931/include/mgmt/p2p_scan.h deleted file mode 100755 index 8ba3199f4b02..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/p2p_scan.h +++ /dev/null @@ -1,127 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/mgmt/p2p_scan.h#1 $ -*/ - -/*! \file "scan.h" - \brief - -*/ - - - - -#ifndef _P2P_SCAN_H -#define _P2P_SCAN_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - - -WLAN_STATUS -scanSendDeviceDiscoverEvent ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc, - IN P_SW_RFB_T prSwRfb - ); - -P_P2P_DEVICE_DESC_T -scanSearchTargetP2pDesc( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucDeviceID[], - IN PP_BSS_DESC_T pprBssDesc - ); - -P_P2P_DEVICE_DESC_T -scanFindP2pDeviceDesc( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc, - IN UINT_8 aucMacAddr[], - IN BOOLEAN fgIsDeviceAddr, - IN BOOLEAN fgAddIfNoFound - ); - -P_P2P_DEVICE_DESC_T -scanGetP2pDeviceDesc( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc - ); - -VOID -scnEventReturnChannel( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucScnSeqNum - ); - -BOOLEAN -scanUpdateP2pDeviceDesc ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc - ); - -VOID -scanP2pProcessBeaconAndProbeResp( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN P_WLAN_STATUS prStatus, - IN P_BSS_DESC_T prBssDesc, - IN P_WLAN_BEACON_FRAME_T prWlanBeaconFrame - ); - -VOID -scanRemoveAllP2pBssDesc( - P_ADAPTER_T prAdapter - ); - -VOID -scanRemoveP2pBssDesc( - P_ADAPTER_T prAdapter, - P_BSS_DESC_T prBssDesc - ); - - -P_BSS_DESC_T -scanP2pSearchDesc( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prP2pBssInfo, - IN P_P2P_CONNECTION_REQ_INFO_T prConnReqInfo - ); - - - -#endif diff --git a/drivers/net/wireless/mt5931/include/mgmt/p2p_state.h b/drivers/net/wireless/mt5931/include/mgmt/p2p_state.h deleted file mode 100755 index 22bcf1798ce3..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/p2p_state.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef _P2P_STATE_H -#define _P2P_STATE_H - -BOOLEAN -p2pStateInit_IDLE( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN P_BSS_INFO_T prP2pBssInfo, - OUT P_ENUM_P2P_STATE_T peNextState - ); - - -VOID -p2pStateAbort_IDLE( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN ENUM_P2P_STATE_T eNextState - ); - -VOID -p2pStateInit_SCAN( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo - ); - -VOID -p2pStateAbort_SCAN( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN ENUM_P2P_STATE_T eNextState - ); - -VOID -p2pStateInit_AP_CHANNEL_DETECT( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo - ); - -VOID -p2pStateAbort_AP_CHANNEL_DETECT( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo, - IN ENUM_P2P_STATE_T eNextState - ); - -VOID -p2pStateInit_CHNL_ON_HAND( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prP2pBssInfo, - IN P_P2P_FSM_INFO_T prP2pFsmInfo - ); - -VOID -p2pStateAbort_CHNL_ON_HAND( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN P_BSS_INFO_T prP2pBssInfo, - IN ENUM_P2P_STATE_T eNextState - ); - - -VOID -p2pStateAbort_REQING_CHANNEL( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN ENUM_P2P_STATE_T eNextState - ); - - -VOID -p2pStateInit_GC_JOIN( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN P_BSS_INFO_T prP2pBssInfo, - IN P_P2P_JOIN_INFO_T prJoinInfo, - IN P_BSS_DESC_T prBssDesc - ); - -VOID -p2pStateAbort_GC_JOIN( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN P_P2P_JOIN_INFO_T prJoinInfo, - IN ENUM_P2P_STATE_T eNextState - ); - -#endif - diff --git a/drivers/net/wireless/mt5931/include/mgmt/privacy.h b/drivers/net/wireless/mt5931/include/mgmt/privacy.h deleted file mode 100755 index 8f6ffd131803..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/privacy.h +++ /dev/null @@ -1,288 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/privacy.h#1 $ -*/ - -/*! \file privacy.h - \brief This file contains the function declaration for privacy.c. -*/ - - - -/* -** $Log: privacy.h $ - * - * 07 24 2010 wh.su - * - * .support the Wi-Fi RSN - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 21 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * modify some code for concurrent network. - * - * 06 19 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * consdier the concurrent network setting. - * - * 06 18 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * migration the security related function from firmware. - * - * 03 01 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * Refine the variable and parameter for security. - * - * 02 25 2010 wh.su - * [BORA00000626][MT6620] Refine the remove key flow for WHQL testing - * For support the WHQL test, do the remove key code refine. - * - * Dec 10 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * change the cmd return type - * - * Dec 8 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the function declaration for auth mode and encryption status setting from build connection command - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the function declaration for wapi - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the tx done callback handle function - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the function declaration for mac header privacy bit setting - * - * Dec 4 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the structure for parsing the EAPoL frame - * - * Dec 3 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adjust the class error function parameter - * - * Dec 1 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding some security function declaration - * - * Nov 19 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the ap selection structure - * - * Nov 18 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * -** -*/ - -#ifndef _PRIVACY_H -#define _PRIVACY_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define MAX_KEY_NUM 4 -#define WEP_40_LEN 5 -#define WEP_104_LEN 13 -#define LEGACY_KEY_MAX_LEN 16 -#define CCMP_KEY_LEN 16 -#define TKIP_KEY_LEN 32 -#define MAX_KEY_LEN 32 -#define MIC_RX_KEY_OFFSET 16 -#define MIC_TX_KEY_OFFSET 24 -#define MIC_KEY_LEN 8 - -#define WEP_KEY_ID_FIELD BITS(0,29) -#define KEY_ID_FIELD BITS(0,7) - -#define IS_TRANSMIT_KEY BIT(31) -#define IS_UNICAST_KEY BIT(30) -#define IS_AUTHENTICATOR BIT(28) - -#define CIPHER_SUITE_NONE 0 -#define CIPHER_SUITE_WEP40 1 -#define CIPHER_SUITE_TKIP 2 -#define CIPHER_SUITE_TKIP_WO_MIC 3 -#define CIPHER_SUITE_CCMP 4 -#define CIPHER_SUITE_WEP104 5 -#define CIPHER_SUITE_BIP 6 -#define CIPHER_SUITE_WEP128 7 -#define CIPHER_SUITE_WPI 8 - -#define WPA_KEY_INFO_KEY_TYPE BIT(3) /* 1 = Pairwise, 0 = Group key */ -#define WPA_KEY_INFO_MIC BIT(8) -#define WPA_KEY_INFO_SECURE BIT(9) - -#define MASK_2ND_EAPOL (WPA_KEY_INFO_KEY_TYPE | WPA_KEY_INFO_MIC) - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -typedef struct _IEEE_802_1X_HDR { - UINT_8 ucVersion; - UINT_8 ucType; - UINT_16 u2Length; - /* followed by length octets of data */ -} IEEE_802_1X_HDR, *P_IEEE_802_1X_HDR; - -typedef struct _EAPOL_KEY { - UINT_8 ucType; - /* Note: key_info, key_length, and key_data_length are unaligned */ - UINT_8 aucKeyInfo[2]; /* big endian */ - UINT_8 aucKeyLength[2]; /* big endian */ - UINT_8 aucReplayCounter[8]; - UINT_8 aucKeyNonce[16]; - UINT_8 aucKeyIv[16]; - UINT_8 aucKeyRsc[8]; - UINT_8 aucKeyId[8]; /* Reserved in IEEE 802.11i/RSN */ - UINT_8 aucKeyMic[16]; - UINT_8 aucKeyDataLength[2]; /* big endian */ - /* followed by key_data_length bytes of key_data */ -} EAPOL_KEY, *P_EAPOL_KEY; - -/* WPA2 PMKID candicate structure */ -typedef struct _PMKID_CANDICATE_T { - UINT_8 aucBssid[MAC_ADDR_LEN]; - UINT_32 u4PreAuthFlags; -} PMKID_CANDICATE_T, *P_PMKID_CANDICATE_T; - -#if 0 -/* WPA2 PMKID cache structure */ -typedef struct _PMKID_ENTRY_T { - PARAM_BSSID_INFO_T rBssidInfo; - BOOLEAN fgPmkidExist; -} PMKID_ENTRY_T, *P_PMKID_ENTRY_T; -#endif - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -VOID -secInit( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucNetTypeIdx - ); - -VOID -secSetPortBlocked( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta, - IN BOOLEAN fgPort - ); - -BOOL -secCheckClassError( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN P_STA_RECORD_T prStaRec - ); - -BOOL -secTxPortControlCheck( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN P_STA_RECORD_T prStaRec - ); - -BOOLEAN -secRxPortControlCheck( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSWRfb - ); - -VOID -secSetCipherSuite( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4CipherSuitesFlags - ); - -BOOL -secProcessEAPOL( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN P_STA_RECORD_T prStaRec, - IN PUINT_8 pucPayload, - IN UINT_16 u2PayloadLen - ); - -VOID -secHandleTxDoneCallback( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T pMsduInfo, - IN P_STA_RECORD_T prStaRec, - IN WLAN_STATUS rStatus - ); - -BOOLEAN -secIsProtectedFrame ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsdu, - IN P_STA_RECORD_T prStaRec - ); - -VOID -secClearPmkid( - IN P_ADAPTER_T prAdapter - ); - -BOOLEAN -secRsnKeyHandshakeEnabled( - IN P_ADAPTER_T prAdapter - ); - -BOOLEAN -secTransmitKeyExist( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ); - -BOOLEAN -secEnabledInAis( - IN P_ADAPTER_T prAdapter - ); - - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _PRIVACY_H */ - diff --git a/drivers/net/wireless/mt5931/include/mgmt/rate.h b/drivers/net/wireless/mt5931/include/mgmt/rate.h deleted file mode 100755 index 74c4bb0fc440..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/rate.h +++ /dev/null @@ -1,111 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rate.h#1 $ -*/ - -/*! \file rate.h - \brief This file contains the rate utility function of - IEEE 802.11 family for MediaTek 802.11 Wireless LAN Adapters. -*/ - - - -/* -** $Log: rate.h $ - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add buildable & linkable ais_fsm.c - * - * related reference are still waiting to be resolved - * -*/ - -#ifndef _RATE_H -#define _RATE_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/* Routines in rate.c */ -/*----------------------------------------------------------------------------*/ -VOID -rateGetRateSetFromIEs ( - IN P_IE_SUPPORTED_RATE_T prIeSupportedRate, - IN P_IE_EXT_SUPPORTED_RATE_T prIeExtSupportedRate, - OUT PUINT_16 pu2OperationalRateSet, - OUT PUINT_16 pu2BSSBasicRateSet, - OUT PBOOLEAN pfgIsUnknownBSSBasicRate - ); - -VOID -rateGetDataRatesFromRateSet ( - IN UINT_16 u2OperationalRateSet, - IN UINT_16 u2BSSBasicRateSet, - OUT PUINT_8 pucDataRates, - OUT PUINT_8 pucDataRatesLen - ); - -BOOLEAN -rateGetHighestRateIndexFromRateSet ( - IN UINT_16 u2RateSet, - OUT PUINT_8 pucHighestRateIndex - ); - -BOOLEAN -rateGetLowestRateIndexFromRateSet ( - IN UINT_16 u2RateSet, - OUT PUINT_8 pucLowestRateIndex - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _RATE_H */ - diff --git a/drivers/net/wireless/mt5931/include/mgmt/rlm.h b/drivers/net/wireless/mt5931/include/mgmt/rlm.h deleted file mode 100755 index 197202f73e76..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/rlm.h +++ /dev/null @@ -1,451 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rlm.h#2 $ -*/ - -/*! \file "rlm.h" - \brief -*/ - - - -/* -** $Log: rlm.h $ - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 09 30 2011 cm.chang - * [WCXRP00001020] [MT6620 Wi-Fi][Driver] Handle secondary channel offset of AP in 5GHz band - * . - * - * 04 12 2011 cm.chang - * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency - * . - * - * 01 13 2011 cm.chang - * [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module - * Refine function when rcv a 20/40M public action frame - * - * 01 13 2011 cm.chang - * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting - * Use SCO of BSS_INFO to replace user-defined setting variables - * - * 01 12 2011 cm.chang - * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting - * User-defined bandwidth is for 2.4G and 5G individually - * - * 12 07 2010 cm.chang - * [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk - * 1. BSSINFO include RLM parameter - * 2. free all sta records when network is disconnected - * - * 12 07 2010 cm.chang - * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant - * 1. Country code is from NVRAM or supplicant - * 2. Change band definition in CMD/EVENT. - * - * 10 18 2010 cm.chang - * [WCXRP00000114] [MT6620 Wi-Fi] [Driver] Fix compiling warning in Linux about RLM network index checking - * Enum member cannot be used as compiling option decision in Linux - * - * 09 10 2010 cm.chang - * NULL - * Always update Beacon content if FW sync OBSS info - * - * 08 31 2010 kevin.huang - * NULL - * Use LINK LIST operation to process SCAN result - * - * 08 24 2010 cm.chang - * NULL - * Support RLM initail channel of Ad-hoc, P2P and BOW - * - * 08 23 2010 chinghwa.yu - * NULL - * Update for BOW. - * - * 08 20 2010 cm.chang - * NULL - * Migrate RLM code to host from FW - * - * 08 16 2010 cp.wu - * NULL - * Replace CFG_SUPPORT_BOW by CFG_ENABLE_BT_OVER_WIFI. - * There is no CFG_SUPPORT_BOW in driver domain source. - * - * 08 02 2010 yuche.tsai - * NULL - * P2P Group Negotiation Code Check in. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Check draft RLM code for HT cap - * - * 06 28 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * 1st draft code for RLM module - * - * 06 02 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add RX HT GF compiling option - * - * 06 02 2010 chinghwa.yu - * [BORA00000563]Add WiFi CoEx BCM module - * Roll back to remove CFG_SUPPORT_BCM_TEST. - * - * 06 01 2010 chinghwa.yu - * [BORA00000563]Add WiFi CoEx BCM module - * Update BCM Test and RW configuration. - * - * 05 31 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add some compiling options to control 11n functions - * - * 05 18 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Ad-hoc Beacon should not carry HT OP and OBSS IEs - * - * 05 17 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * MT6620 does not support L-SIG TXOP - * - * 05 05 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * First draft support for 20/40M bandwidth for AP mode - * - * 04 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW - * - * 04 22 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * First draft code to support protection in AP mode - * - * 04 07 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Different invoking order for WTBL entry of associated AP - * - * 03 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Not carry HT cap when being associated with b/g only AP - * - * 03 03 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Move default value of HT capability to rlm.h - * - * 02 12 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Use bss info array for concurrent handle - * - * 01 22 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support protection and bandwidth switch - * - * 01 08 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * - * Modify the prototype of rlmRecAssocRspHtInfo() - * - * Dec 9 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add several function prototypes for HT operation - * - * Nov 18 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * - * -** -*/ - -#ifndef _RLM_H -#define _RLM_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define ELEM_EXT_CAP_DEFAULT_VAL \ - (ELEM_EXT_CAP_20_40_COEXIST_SUPPORT /*| ELEM_EXT_CAP_PSMP_CAP*/) - - -#if CFG_SUPPORT_RX_STBC - #define FIELD_HT_CAP_INFO_RX_STBC HT_CAP_INFO_RX_STBC_1_SS -#else - #define FIELD_HT_CAP_INFO_RX_STBC HT_CAP_INFO_RX_STBC_NO_SUPPORTED -#endif - -#if CFG_SUPPORT_RX_SGI - #define FIELD_HT_CAP_INFO_SGI_20M HT_CAP_INFO_SHORT_GI_20M - #define FIELD_HT_CAP_INFO_SGI_40M HT_CAP_INFO_SHORT_GI_40M -#else - #define FIELD_HT_CAP_INFO_SGI_20M 0 - #define FIELD_HT_CAP_INFO_SGI_40M 0 -#endif - -#if CFG_SUPPORT_RX_HT_GF - #define FIELD_HT_CAP_INFO_HT_GF HT_CAP_INFO_HT_GF -#else - #define FIELD_HT_CAP_INFO_HT_GF 0 -#endif - -#define HT_CAP_INFO_DEFAULT_VAL \ - (HT_CAP_INFO_SUP_CHNL_WIDTH | FIELD_HT_CAP_INFO_HT_GF | \ - FIELD_HT_CAP_INFO_SGI_20M | FIELD_HT_CAP_INFO_SGI_40M | \ - FIELD_HT_CAP_INFO_RX_STBC | HT_CAP_INFO_DSSS_CCK_IN_40M) - - - -#define AMPDU_PARAM_DEFAULT_VAL \ - (AMPDU_PARAM_MAX_AMPDU_LEN_64K | AMPDU_PARAM_MSS_NO_RESTRICIT) - - -#define SUP_MCS_TX_DEFAULT_VAL \ - SUP_MCS_TX_SET_DEFINED /* TX defined and TX/RX equal (TBD) */ - -#if CFG_SUPPORT_MFB - #define FIELD_HT_EXT_CAP_MFB HT_EXT_CAP_MCS_FEEDBACK_BOTH -#else - #define FIELD_HT_EXT_CAP_MFB HT_EXT_CAP_MCS_FEEDBACK_NO_FB -#endif - -#if CFG_SUPPORT_RX_RDG - #define FIELD_HT_EXT_CAP_RDR HT_EXT_CAP_RD_RESPONDER -#else - #define FIELD_HT_EXT_CAP_RDR 0 -#endif - -#if CFG_SUPPORT_MFB || CFG_SUPPORT_RX_RDG - #define FIELD_HT_EXT_CAP_HTC HT_EXT_CAP_HTC_SUPPORT -#else - #define FIELD_HT_EXT_CAP_HTC 0 -#endif - -#define HT_EXT_CAP_DEFAULT_VAL \ - (HT_EXT_CAP_PCO | HT_EXT_CAP_PCO_TRANS_TIME_NONE | \ - FIELD_HT_EXT_CAP_MFB | FIELD_HT_EXT_CAP_HTC | \ - FIELD_HT_EXT_CAP_RDR) - -#define TX_BEAMFORMING_CAP_DEFAULT_VAL 0 -#define ASEL_CAP_DEFAULT_VAL 0 - - -/* Define bandwidth from user setting */ -#define CONFIG_BW_20_40M 0 -#define CONFIG_BW_20M 1 /* 20MHz only */ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/* It is used for RLM module to judge if specific network is valid - * Note: Ad-hoc mode of AIS is not included now. (TBD) - */ -#define RLM_NET_PARAM_VALID(_prBssInfo) \ - (IS_BSS_ACTIVE(_prBssInfo) && \ - ((_prBssInfo)->eConnectionState == PARAM_MEDIA_STATE_CONNECTED || \ - (_prBssInfo)->eCurrentOPMode == OP_MODE_ACCESS_POINT || \ - (_prBssInfo)->eCurrentOPMode == OP_MODE_IBSS || \ - RLM_NET_IS_BOW(_prBssInfo)) \ - ) - -#define RLM_NET_IS_11N(_prBssInfo) \ - ((_prBssInfo)->ucPhyTypeSet & PHY_TYPE_SET_802_11N) -#define RLM_NET_IS_11GN(_prBssInfo) \ - ((_prBssInfo)->ucPhyTypeSet & PHY_TYPE_SET_802_11GN) - - -/* This macro is used to sweep all 3 networks */ -#define RLM_NET_FOR_EACH(_ucNetIdx) \ - for ((_ucNetIdx) = 0; \ - (_ucNetIdx) < NETWORK_TYPE_INDEX_NUM; \ - (_ucNetIdx)++) - -/* This macro is used to sweep all networks excluding BOW */ -#if CFG_ENABLE_BT_OVER_WIFI - /* Note: value of enum NETWORK_TYPE_BOW_INDEX is validated in - * rlmStuctureCheck(). - */ - #define RLM_NET_FOR_EACH_NO_BOW(_ucNetIdx) \ - for ((_ucNetIdx) = 0; \ - (_ucNetIdx) < NETWORK_TYPE_BOW_INDEX; \ - (_ucNetIdx)++) - - #define RLM_NET_IS_BOW(_prBssInfo) \ - ((_prBssInfo)->ucNetTypeIndex == NETWORK_TYPE_BOW_INDEX) - -#else - #define RLM_NET_FOR_EACH_NO_BOW(_ucNetIdx) RLM_NET_FOR_EACH(_ucNetIdx) - #define RLM_NET_IS_BOW(_prBssInfo) (FALSE) - -#endif /* end of CFG_ENABLE_BT_OVER_WIFI */ - - -/* The bandwidth modes are not used anymore. They represent if AP - * can use 20/40 bandwidth, not all modes. (20110411) - */ -#define RLM_AP_IS_BW_40_ALLOWED(_prAdapter, _prBssInfo) \ - (((_prBssInfo)->eBand == BAND_2G4 && \ - (_prAdapter)->rWifiVar.rConnSettings.uc2G4BandwidthMode \ - == CONFIG_BW_20_40M) || \ - ((_prBssInfo)->eBand == BAND_5G && \ - (_prAdapter)->rWifiVar.rConnSettings.uc5GBandwidthMode \ - == CONFIG_BW_20_40M)) - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -VOID -rlmFsmEventInit ( - P_ADAPTER_T prAdapter - ); - -VOID -rlmFsmEventUninit ( - P_ADAPTER_T prAdapter - ); - -VOID -rlmReqGenerateHtCapIE ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ); - -VOID -rlmReqGenerateExtCapIE ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ); - -VOID -rlmRspGenerateHtCapIE ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ); - -VOID -rlmRspGenerateExtCapIE ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ); - -VOID -rlmRspGenerateHtOpIE ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ); - -VOID -rlmRspGenerateErpIE ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ); - -VOID -rlmProcessBcn ( - P_ADAPTER_T prAdapter, - P_SW_RFB_T prSwRfb, - PUINT_8 pucIE, - UINT_16 u2IELength - ); - -VOID -rlmProcessAssocRsp ( - P_ADAPTER_T prAdapter, - P_SW_RFB_T prSwRfb, - PUINT_8 pucIE, - UINT_16 u2IELength - ); - -VOID -rlmFillSyncCmdParam ( - P_CMD_SET_BSS_RLM_PARAM_T prCmdBody, - P_BSS_INFO_T prBssInfo - ); - -VOID -rlmSyncOperationParams ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ); - -VOID -rlmBssInitForAPandIbss ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ); - -VOID -rlmProcessAssocReq ( - P_ADAPTER_T prAdapter, - P_SW_RFB_T prSwRfb, - PUINT_8 pucIE, - UINT_16 u2IELength - ); - -VOID -rlmBssAborted ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ); - - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#ifndef _lint -__KAL_INLINE__ VOID -rlmDataTypeCheck ( - VOID - ) -{ -#if CFG_ENABLE_BT_OVER_WIFI - DATA_STRUC_INSPECTING_ASSERT( - NETWORK_TYPE_AIS_INDEX < NETWORK_TYPE_BOW_INDEX); - - #if CFG_ENABLE_WIFI_DIRECT - DATA_STRUC_INSPECTING_ASSERT( - NETWORK_TYPE_P2P_INDEX < NETWORK_TYPE_BOW_INDEX); - #endif -#endif - - return; -} -#endif /* _lint */ - -#endif /* _RLM_H */ - - diff --git a/drivers/net/wireless/mt5931/include/mgmt/rlm_domain.h b/drivers/net/wireless/mt5931/include/mgmt/rlm_domain.h deleted file mode 100755 index fda01372bf37..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/rlm_domain.h +++ /dev/null @@ -1,358 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rlm_domain.h#1 $ -*/ - -/*! \file "rlm_domain.h" - \brief -*/ - - - -/* -** $Log: rlm_domain.h $ - * - * 09 29 2011 cm.chang - * NULL - * Change the function prototype of rlmDomainGetChnlList() - * - * 09 08 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * Use new fields ucChannelListMap and ucChannelListIndex in NVRAM - * - * 08 31 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * . - * - * 06 01 2011 cm.chang - * [WCXRP00000756] [MT6620 Wi-Fi][Driver] 1. AIS follow channel of BOW 2. Provide legal channel function - * Provide legal channel function based on domain - * - * 12 07 2010 cm.chang - * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant - * 1. Country code is from NVRAM or supplicant - * 2. Change band definition in CMD/EVENT. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 28 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * 1st draft code for RLM module - * - * 02 23 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add support scan channel 1~14 and update scan result's frequency infou1rwduu`wvpghlqg|n`slk+mpdkb - * - * 01 13 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Provide query function about full channle list. - * - * Dec 1 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Declare public rDomainInfo - * -** -*/ - -#ifndef _RLM_DOMAIN_H -#define _RLM_DOMAIN_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define MAX_SUBBAND_NUM 6 - - -#define COUNTRY_CODE_NULL ((UINT_16)0x0) - -/* ISO/IEC 3166-1 two-character country codes */ -#define COUNTRY_CODE_AG (((UINT_16) 'A' << 8) | (UINT_16) 'G') /* Antigua/Barbuda */ -#define COUNTRY_CODE_AI (((UINT_16) 'A' << 8) | (UINT_16) 'I') /* Anguilla */ -#define COUNTRY_CODE_AR (((UINT_16) 'A' << 8) | (UINT_16) 'T') /* Argentina */ -#define COUNTRY_CODE_AT (((UINT_16) 'A' << 8) | (UINT_16) 'T') /* Austria */ -#define COUNTRY_CODE_AU (((UINT_16) 'A' << 8) | (UINT_16) 'U') /* Australia */ -#define COUNTRY_CODE_AW (((UINT_16) 'A' << 8) | (UINT_16) 'W') /* Aruba */ -#define COUNTRY_CODE_BB (((UINT_16) 'B' << 8) | (UINT_16) 'B') /* Barbados */ -#define COUNTRY_CODE_BE (((UINT_16) 'B' << 8) | (UINT_16) 'E') /* Belgium */ -#define COUNTRY_CODE_BM (((UINT_16) 'B' << 8) | (UINT_16) 'M') /* Bermuda */ -#define COUNTRY_CODE_BO (((UINT_16) 'B' << 8) | (UINT_16) 'O') /* Bolivia */ -#define COUNTRY_CODE_BR (((UINT_16) 'B' << 8) | (UINT_16) 'R') /* Brazil */ -#define COUNTRY_CODE_BS (((UINT_16) 'B' << 8) | (UINT_16) 'S') /* Bahamas */ -#define COUNTRY_CODE_BY (((UINT_16) 'B' << 8) | (UINT_16) 'Y') /* Belarus */ -#define COUNTRY_CODE_CA (((UINT_16) 'C' << 8) | (UINT_16) 'A') /* Canada */ -#define COUNTRY_CODE_CH (((UINT_16) 'C' << 8) | (UINT_16) 'H') /* Switzerland */ -#define COUNTRY_CODE_CL (((UINT_16) 'C' << 8) | (UINT_16) 'L') /* Chile */ -#define COUNTRY_CODE_CN (((UINT_16) 'C' << 8) | (UINT_16) 'N') /* China */ -#define COUNTRY_CODE_CO (((UINT_16) 'C' << 8) | (UINT_16) 'O') /* Colombia */ -#define COUNTRY_CODE_CR (((UINT_16) 'C' << 8) | (UINT_16) 'R') /* Costa Rica */ -#define COUNTRY_CODE_CU (((UINT_16) 'C' << 8) | (UINT_16) 'U') /* Cuba */ -#define COUNTRY_CODE_DE (((UINT_16) 'D' << 8) | (UINT_16) 'E') /* Germany */ -#define COUNTRY_CODE_DK (((UINT_16) 'D' << 8) | (UINT_16) 'K') /* Denmark */ -#define COUNTRY_CODE_DM (((UINT_16) 'D' << 8) | (UINT_16) 'M') /* Dominica */ -#define COUNTRY_CODE_DO (((UINT_16) 'D' << 8) | (UINT_16) 'O') /* Dominican Republic */ -#define COUNTRY_CODE_EC (((UINT_16) 'E' << 8) | (UINT_16) 'C') /* Ecuador */ -#define COUNTRY_CODE_EG (((UINT_16) 'E' << 8) | (UINT_16) 'G') /* Egypt */ -#define COUNTRY_CODE_ES (((UINT_16) 'E' << 8) | (UINT_16) 'S') /* Spain */ -#define COUNTRY_CODE_EU (((UINT_16) 'E' << 8) | (UINT_16) 'U') /* ETSI (Europe) */ -#define COUNTRY_CODE_FI (((UINT_16) 'F' << 8) | (UINT_16) 'I') /* Finland */ -#define COUNTRY_CODE_FR (((UINT_16) 'F' << 8) | (UINT_16) 'R') /* France */ -#define COUNTRY_CODE_GB (((UINT_16) 'G' << 8) | (UINT_16) 'B') /* United Kingdom */ -#define COUNTRY_CODE_GD (((UINT_16) 'G' << 8) | (UINT_16) 'D') /* Grenada */ -#define COUNTRY_CODE_GR (((UINT_16) 'G' << 8) | (UINT_16) 'R') /* Greece */ -#define COUNTRY_CODE_GY (((UINT_16) 'G' << 8) | (UINT_16) 'Y') /* Guyana */ -#define COUNTRY_CODE_HK (((UINT_16) 'H' << 8) | (UINT_16) 'K') /* Hong Kong */ -#define COUNTRY_CODE_HT (((UINT_16) 'H' << 8) | (UINT_16) 'T') /* Haiti */ -#define COUNTRY_CODE_HN (((UINT_16) 'H' << 8) | (UINT_16) 'N') /* Honduras */ -#define COUNTRY_CODE_ID (((UINT_16) 'I' << 8) | (UINT_16) 'D') /* Indonesia */ -#define COUNTRY_CODE_IE (((UINT_16) 'I' << 8) | (UINT_16) 'E') /* Ireland */ -#define COUNTRY_CODE_IL (((UINT_16) 'I' << 8) | (UINT_16) 'L') /* Israel */ -#define COUNTRY_CODE_IN (((UINT_16) 'I' << 8) | (UINT_16) 'N') /* India */ -#define COUNTRY_CODE_IR (((UINT_16) 'I' << 8) | (UINT_16) 'R') /* Iran */ -#define COUNTRY_CODE_IS (((UINT_16) 'I' << 8) | (UINT_16) 'S') /* Iceland */ -#define COUNTRY_CODE_IT (((UINT_16) 'I' << 8) | (UINT_16) 'T') /* Italy */ -#define COUNTRY_CODE_JM (((UINT_16) 'J' << 8) | (UINT_16) 'M') /* Jamaica */ -#define COUNTRY_CODE_JO (((UINT_16) 'J' << 8) | (UINT_16) 'O') /* Jordan */ -#define COUNTRY_CODE_JP (((UINT_16) 'J' << 8) | (UINT_16) 'P') /* Japan */ -#define COUNTRY_CODE_KN (((UINT_16) 'K' << 8) | (UINT_16) 'N') /* Saint Kitts and Nevis */ -#define COUNTRY_CODE_KR (((UINT_16) 'K' << 8) | (UINT_16) 'R') /* South Korea */ -#define COUNTRY_CODE_KW (((UINT_16) 'K' << 8) | (UINT_16) 'W') /* Kuwait */ -#define COUNTRY_CODE_LC (((UINT_16) 'L' << 8) | (UINT_16) 'C') /* Saint Lucia */ -#define COUNTRY_CODE_LI (((UINT_16) 'L' << 8) | (UINT_16) 'I') /* Liechtenstein */ -#define COUNTRY_CODE_LK (((UINT_16) 'L' << 8) | (UINT_16) 'K') /* Sri Lanka */ -#define COUNTRY_CODE_LU (((UINT_16) 'L' << 8) | (UINT_16) 'U') /* Luxembourg */ -#define COUNTRY_CODE_MA (((UINT_16) 'M' << 8) | (UINT_16) 'A') /* Morocco */ -#define COUNTRY_CODE_MD (((UINT_16) 'M' << 8) | (UINT_16) 'D') /* Moldova */ -#define COUNTRY_CODE_MX (((UINT_16) 'M' << 8) | (UINT_16) 'X') /* Mexico */ -#define COUNTRY_CODE_MY (((UINT_16) 'M' << 8) | (UINT_16) 'Y') /* Malaysia */ -#define COUNTRY_CODE_NI (((UINT_16) 'N' << 8) | (UINT_16) 'I') /* Nicaragua */ -#define COUNTRY_CODE_NL (((UINT_16) 'N' << 8) | (UINT_16) 'L') /* Netherlands */ -#define COUNTRY_CODE_NO (((UINT_16) 'N' << 8) | (UINT_16) 'O') /* Norway */ -#define COUNTRY_CODE_NZ (((UINT_16) 'N' << 8) | (UINT_16) 'Z') /* New Zealand */ -#define COUNTRY_CODE_OM (((UINT_16) 'O' << 8) | (UINT_16) 'M') /* Oman */ -#define COUNTRY_CODE_PE (((UINT_16) 'P' << 8) | (UINT_16) 'E') /* Peru */ -#define COUNTRY_CODE_PG (((UINT_16) 'P' << 8) | (UINT_16) 'G') /* Papua New Guinea */ -#define COUNTRY_CODE_PH (((UINT_16) 'P' << 8) | (UINT_16) 'H') /* Philippines */ -#define COUNTRY_CODE_PK (((UINT_16) 'P' << 8) | (UINT_16) 'K') /* Pakistan */ -#define COUNTRY_CODE_PR (((UINT_16) 'P' << 8) | (UINT_16) 'R') /* Puerto Rico */ -#define COUNTRY_CODE_PT (((UINT_16) 'P' << 8) | (UINT_16) 'T') /* Portugal */ -#define COUNTRY_CODE_PY (((UINT_16) 'P' << 8) | (UINT_16) 'Y') /* Paraguay */ -#define COUNTRY_CODE_PZ (((UINT_16) 'P' << 8) | (UINT_16) 'Z') /* Panama */ -#define COUNTRY_CODE_RU (((UINT_16) 'R' << 8) | (UINT_16) 'U') /* Russian */ -#define COUNTRY_CODE_SA (((UINT_16) 'S' << 8) | (UINT_16) 'A') /* Saudi Arabia */ -#define COUNTRY_CODE_SE (((UINT_16) 'S' << 8) | (UINT_16) 'E') /* Sweden */ -#define COUNTRY_CODE_SG (((UINT_16) 'S' << 8) | (UINT_16) 'G') /* Singapore */ -#define COUNTRY_CODE_SR (((UINT_16) 'S' << 8) | (UINT_16) 'R') /* Suriname */ -#define COUNTRY_CODE_TW (((UINT_16) 'T' << 8) | (UINT_16) 'W') /* Taiwan */ -#define COUNTRY_CODE_TH (((UINT_16) 'T' << 8) | (UINT_16) 'H') /* Thailand */ -#define COUNTRY_CODE_TR (((UINT_16) 'T' << 8) | (UINT_16) 'R') /* Turkey */ -#define COUNTRY_CODE_TT (((UINT_16) 'T' << 8) | (UINT_16) 'T') /* Trinidad */ -#define COUNTRY_CODE_UA (((UINT_16) 'U' << 8) | (UINT_16) 'A') /* Ukraine */ -#define COUNTRY_CODE_US (((UINT_16) 'U' << 8) | (UINT_16) 'S') /* United States */ -#define COUNTRY_CODE_UY (((UINT_16) 'U' << 8) | (UINT_16) 'Y') /* Uruguay */ -#define COUNTRY_CODE_VC (((UINT_16) 'V' << 8) | (UINT_16) 'C') /* Saint Vincent */ -#define COUNTRY_CODE_VE (((UINT_16) 'V' << 8) | (UINT_16) 'E') /* Venezuela */ -#define COUNTRY_CODE_VN (((UINT_16) 'V' << 8) | (UINT_16) 'N') /* Vietnam */ - -/* dot11RegDomainsSupportValue */ -#define MIB_REG_DOMAIN_FCC 0x10 /* FCC (US) */ -#define MIB_REG_DOMAIN_IC 0x20 /* IC or DOC (Canada) */ -#define MIB_REG_DOMAIN_ETSI 0x30 /* ETSI (Europe) */ -#define MIB_REG_DOMAIN_SPAIN 0x31 /* Spain */ -#define MIB_REG_DOMAIN_FRANCE 0x32 /* France */ -#define MIB_REG_DOMAIN_JAPAN 0x40 /* MPHPT (Japan) */ -#define MIB_REG_DOMAIN_OTHER 0x00 /* other */ - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/* Define channel offset in unit of 5MHz bandwidth */ -typedef enum _ENUM_CHNL_SPAN_T { - CHNL_SPAN_5 = 1, - CHNL_SPAN_10 = 2, - CHNL_SPAN_20 = 4, - CHNL_SPAN_40 = 8 -} ENUM_CHNL_SPAN_T, *P_ENUM_CHNL_SPAN_T; - -/* Define BSS operating bandwidth */ -typedef enum _ENUM_CHNL_BW_T { - CHNL_BW_20, - CHNL_BW_20_40, - CHNL_BW_10, - CHNL_BW_5 -} ENUM_CHNL_BW_T, *P_ENUM_CHNL_BW_T; - -#if 0 -/* If channel width is CHNL_BW_20_40, the first channel will be SCA and - * the second channel is SCB, then iteratively. - * Note the final channel will not be SCA. - */ -typedef struct _DOMAIN_SUBBAND_INFO { - UINT_8 ucRegClass; - ENUM_BAND_T eBand; - ENUM_CHNL_SPAN_T eChannelSpan; - UINT_8 ucFirstChannelNum; - UINT_8 ucNumChannels; - ENUM_CHNL_BW_T eChannelBw; - BOOLEAN fgDfsNeeded; - BOOLEAN fgIbssProhibited; -} DOMAIN_SUBBAND_INFO, *P_DOMAIN_SUBBAND_INFO; - -/* Use it as all available channel list for STA */ -typedef struct _DOMAIN_INFO_ENTRY { - UINT_16 u2CountryCode; - UINT_16 u2MibRegDomainValue; - - /* If different attributes, put them into different rSubBands. - * For example, DFS shall be used or not. - */ - DOMAIN_SUBBAND_INFO rSubBand[MAX_SUBBAND_NUM]; -} DOMAIN_INFO_ENTRY, *P_DOMAIN_INFO_ENTRY; - -#else /* New definition 20110830 */ - -/* In all bands, the first channel will be SCA and the second channel is SCB, - * then iteratively. - * Note the final channel will not be SCA. - */ -typedef struct _DOMAIN_SUBBAND_INFO { - /* Note1: regulation class depends on operation bandwidth and RF band. - * For example: 2.4GHz, 1~13, 20MHz ==> regulation class = 81 - * 2.4GHz, 1~13, SCA ==> regulation class = 83 - * 2.4GHz, 1~13, SCB ==> regulation class = 84 - * Note2: TX power limit is not specified here because path loss is unknown - */ - UINT_8 ucRegClass; /* Regulation class for 20MHz */ - UINT_8 ucBand; /* Type: ENUM_BAND_T */ - UINT_8 ucChannelSpan; /* Type: ENUM_CHNL_SPAN_T */ - UINT_8 ucFirstChannelNum; - UINT_8 ucNumChannels; - UINT_8 ucReserved; /* Type: BOOLEAN (fgDfsNeeded) */ -} DOMAIN_SUBBAND_INFO, *P_DOMAIN_SUBBAND_INFO; - -/* Use it as all available channel list for STA */ -typedef struct _DOMAIN_INFO_ENTRY { - PUINT_16 pu2CountryGroup; - UINT_32 u4CountryNum; - - /* If different attributes, put them into different rSubBands. - * For example, DFS shall be used or not. - */ - DOMAIN_SUBBAND_INFO rSubBand[MAX_SUBBAND_NUM]; -} DOMAIN_INFO_ENTRY, *P_DOMAIN_INFO_ENTRY; -#endif - -/* The following definitions are not used yet */ -typedef enum _ENUM_CH_SET_2G4_T { - CH_SET_2G4_NA, - CH_SET_2G4_1_11, - CH_SET_2G4_1_13, - CH_SET_2G4_1_14, - CH_SET_2G4_NUM -} ENUM_CH_SET_2G4_T, *P_ENUM_CH_SET_2G4_T; - -typedef enum _ENUM_CH_SET_UNII_LOW_T { - CH_SET_UNII_LOW_NA, - CH_SET_UNII_LOW_36_48, - CH_SET_UNII_LOW_NUM -} ENUM_CH_SET_UNII_LOW_T, *P_ENUM_CH_SET_UNII_LOW_T; - -typedef enum _ENUM_CH_SET_UNII_MID_T { - CH_SET_UNII_MID_NA, - CH_SET_UNII_MID_52_64, - CH_SET_UNII_MID_NUM -} ENUM_CH_SET_UNII_MID_T, *P_ENUM_CH_SET_UNII_MID_T; - -typedef enum _ENUM_CH_SET_UNII_WW_T { - CH_SET_UNII_WW_NA, - CH_SET_UNII_WW_100_128, - CH_SET_UNII_WW_100_140, - CH_SET_UNII_WW_100_116_132_140, - CH_SET_UNII_WW_NUM -} ENUM_CH_SET_UNII_WW_T, *P_ENUM_CH_SET_UNII_WW_T; - -typedef enum _ENUM_CH_SET_UNII_UPPER_T { - CH_SET_UNII_UPPER_NA, - CH_SET_UNII_UPPER_149_161, - CH_SET_UNII_UPPER_149_165, - CH_SET_UNII_UPPER_149_173, - CH_SET_UNII_UPPER_NUM -} ENUM_CH_SET_UNII_UPPER_T, *P_ENUM_CH_SET_UNII_UPPER_T; - -typedef struct _COUNTRY_CH_SET_T { - ENUM_CH_SET_2G4_T e2G4; - ENUM_CH_SET_UNII_LOW_T eUniiLow; - ENUM_CH_SET_UNII_MID_T eUniiMid; - ENUM_CH_SET_UNII_WW_T eUniiWw; - ENUM_CH_SET_UNII_UPPER_T eUniiUpper; -} COUNTRY_CH_SET_T, *P_COUNTRY_CH_SET_T; - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -P_DOMAIN_INFO_ENTRY -rlmDomainGetDomainInfo ( - P_ADAPTER_T prAdapter - ); - -VOID -rlmDomainGetChnlList ( - P_ADAPTER_T prAdapter, - ENUM_BAND_T eSpecificBand, - UINT_8 ucMaxChannelNum, - PUINT_8 pucNumOfChannel, - P_RF_CHANNEL_INFO_T paucChannelList - ); - -VOID -rlmDomainSendCmd ( - P_ADAPTER_T prAdapter, - BOOLEAN fgIsOid - ); - -BOOLEAN -rlmDomainIsLegalChannel ( - P_ADAPTER_T prAdapter, - ENUM_BAND_T eBand, - UINT_8 ucChannel - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _RLM_DOMAIN_H */ - - diff --git a/drivers/net/wireless/mt5931/include/mgmt/rlm_obss.h b/drivers/net/wireless/mt5931/include/mgmt/rlm_obss.h deleted file mode 100755 index 20533c95762f..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/rlm_obss.h +++ /dev/null @@ -1,164 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rlm_obss.h#1 $ -*/ - -/*! \file "rlm_obss.h" - \brief -*/ - - - -/* -** $Log: rlm_obss.h $ - * - * 01 24 2011 cm.chang - * [WCXRP00000384] [MT6620 Wi-Fi][Driver][FW] Handle 20/40 action frame in AP mode and stop ampdu timer when sta_rec is freed - * Process received 20/40 coexistence action frame for AP mode - * - * 01 13 2011 cm.chang - * [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module - * Refine function when rcv a 20/40M public action frame - * - * 01 12 2011 cm.chang - * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting - * User-defined bandwidth is for 2.4G and 5G individually - * - * 08 24 2010 cm.chang - * NULL - * Support RLM initail channel of Ad-hoc, P2P and BOW - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 28 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * 1st draft code for RLM module - * - * 05 07 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Process 20/40 coexistence public action frame in AP mode - * - * 05 05 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * First draft support for 20/40M bandwidth for AP mode - * - * 04 07 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add virtual test for OBSS scan - * - * 03 30 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support 2.4G OBSS scan - * - * 02 13 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support PCO in STA mode - * - * 02 12 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Use bss info array for concurrent handle - * - * 01 25 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support protection and bandwidth switch -*/ - -#ifndef _RLM_OBSS_H -#define _RLM_OBSS_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define CHNL_LIST_SZ_2G 14 -#define CHNL_LIST_SZ_5G 14 - - -#define CHNL_LEVEL0 0 -#define CHNL_LEVEL1 1 -#define CHNL_LEVEL2 2 - -#define AFFECTED_CHNL_OFFSET 5 - -#define OBSS_SCAN_MIN_INTERVAL 10 /* In unit of sec */ - -#define PUBLIC_ACTION_MAX_LEN 200 /* In unit of byte */ - -/* P2P GO only */ -/* Define default OBSS Scan parameters (from MIB in spec.) */ -#define dot11OBSSScanPassiveDwell 20 -#define dot11OBSSScanActiveDwell 10 -#define dot11OBSSScanPassiveTotalPerChannel 200 -#define dot11OBSSScanActiveTotalPerChannel 20 -#define dot11BSSWidthTriggerScanInterval 300 /* Unit: sec */ -#define dot11BSSWidthChannelTransitionDelayFactor 5 -#define dot11OBSSScanActivityThreshold 25 - -#define OBSS_20_40M_TIMEOUT (dot11BSSWidthTriggerScanInterval + 10) - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/* Control MAC PCO function */ -typedef enum _ENUM_SYS_PCO_PHASE_T { - SYS_PCO_PHASE_DISABLED = 0, - SYS_PCO_PHASE_20M, - SYS_PCO_PHASE_40M -} ENUM_SYS_PCO_PHASE_T, *P_ENUM_SYS_PCO_PHASE_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -VOID -rlmObssInit ( - P_ADAPTER_T prAdapter - ); - -VOID -rlmObssScanDone ( - P_ADAPTER_T prAdapter, - P_MSG_HDR_T prMsgHdr - ); - -VOID -rlmObssTriggerScan ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _RLM_OBSS_H */ - diff --git a/drivers/net/wireless/mt5931/include/mgmt/rlm_protection.h b/drivers/net/wireless/mt5931/include/mgmt/rlm_protection.h deleted file mode 100755 index 6025b9044740..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/rlm_protection.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rlm_protection.h#1 $ -*/ - -/*! \file "rlm_protection.h" - \brief -*/ - - - -/* -** $Log: rlm_protection.h $ - * - * 08 20 2010 cm.chang - * NULL - * Migrate RLM code to host from FW - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 28 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * 1st draft code for RLM module - * - * 04 22 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * First draft code to support protection in AP mode - * - * 02 13 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support PCO in STA mode - * - * 02 12 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Use bss info array for concurrent handle - * - * 01 25 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support protection and bandwidth switch -*/ - -#ifndef _RLM_PROTECTION_H -#define _RLM_PROTECTION_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef enum _ENUM_SYS_PROTECT_MODE_T { - SYS_PROTECT_MODE_NONE = 0, /* Mode 0 */ - SYS_PROTECT_MODE_ERP, /* Mode 1 */ - SYS_PROTECT_MODE_NON_HT, /* Mode 2 */ - SYS_PROTECT_MODE_20M, /* Mode 3 */ - - SYS_PROTECT_MODE_NUM -} ENUM_SYS_PROTECT_MODE_T, *P_ENUM_SYS_PROTECT_MODE_T; - -/* This definition follows HT Protection field of HT Operation IE */ -typedef enum _ENUM_HT_PROTECT_MODE_T { - HT_PROTECT_MODE_NONE = 0, - HT_PROTECT_MODE_NON_MEMBER, - HT_PROTECT_MODE_20M, - HT_PROTECT_MODE_NON_HT, - - HT_PROTECT_MODE_NUM -} ENUM_HT_PROTECT_MODE_T, *P_ENUM_HT_PROTECT_MODE_T; - - -typedef enum _ENUM_GF_MODE_T { - GF_MODE_NORMAL = 0, - GF_MODE_PROTECT, - GF_MODE_DISALLOWED, - - GF_MODE_NUM -} ENUM_GF_MODE_T, *P_ENUM_GF_MODE_T; - -typedef enum _ENUM_RIFS_MODE_T { - RIFS_MODE_NORMAL = 0, - RIFS_MODE_DISALLOWED, - - RIFS_MODE_NUM -} ENUM_RIFS_MODE_T, *P_ENUM_RIFS_MODE_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _RLM_PROTECTION_H */ - diff --git a/drivers/net/wireless/mt5931/include/mgmt/roaming_fsm.h b/drivers/net/wireless/mt5931/include/mgmt/roaming_fsm.h deleted file mode 100755 index 2a744f7e3c68..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/roaming_fsm.h +++ /dev/null @@ -1,209 +0,0 @@ -/* -** $Id: -*/ - -/*! \file "roaming_fsm.h" - \brief This file defines the FSM for Roaming MODULE. - - This file defines the FSM for Roaming MODULE. -*/ - - - -/* -** $Log: roaming_fsm.h $ - * - * 08 31 2011 tsaiyuan.hsu - * [WCXRP00000931] [MT5931 Wi-Fi][DRV/FW] add swcr to disable roaming from driver - * remove obsolete code. - * - * 08 15 2011 tsaiyuan.hsu - * [WCXRP00000931] [MT5931 Wi-Fi][DRV/FW] add swcr to disable roaming from driver - * add swcr in driver reg, 0x9fxx0000, to disable roaming . - * - * 03 16 2011 tsaiyuan.hsu - * [WCXRP00000517] [MT6620 Wi-Fi][Driver][FW] Fine Tune Performance of Roaming - * remove obsolete definition and unused variables. - * - * 02 26 2011 tsaiyuan.hsu - * [WCXRP00000391] [MT6620 Wi-Fi][FW] Add Roaming Support - * not send disassoc or deauth to leaving AP so as to improve performace of roaming. - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * -*/ - -#ifndef _ROAMING_FSM_H -#define _ROAMING_FSM_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -/* Roaming Discovery interval, SCAN result need to be updated */ -#define ROAMING_DISCOVERY_TIMEOUT_SEC 5 // Seconds. - -//#define ROAMING_NO_SWING_RCPI_STEP 5 //rcpi -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef enum _ENUM_ROAMING_FAIL_REASON_T { - ROAMING_FAIL_REASON_CONNLIMIT = 0, - ROAMING_FAIL_REASON_NOCANDIDATE, - ROAMING_FAIL_REASON_NUM -} ENUM_ROAMING_FAIL_REASON_T; - -/* events of roaming between driver and firmware */ -typedef enum _ENUM_ROAMING_EVENT_T { - ROAMING_EVENT_START = 0, - ROAMING_EVENT_DISCOVERY, - ROAMING_EVENT_ROAM, - ROAMING_EVENT_FAIL, - ROAMING_EVENT_ABORT, - ROAMING_EVENT_NUM -} ENUM_ROAMING_EVENT_T; - -typedef struct _ROAMING_PARAM_T { - UINT_16 u2Event; - UINT_16 u2Data; -} ROAMING_PARAM_T, *P_ROAMING_PARAM_T; - -/**/ -typedef enum _ENUM_ROAMING_STATE_T { - ROAMING_STATE_IDLE = 0, - ROAMING_STATE_DECISION, - ROAMING_STATE_DISCOVERY, - ROAMING_STATE_ROAM, - ROAMING_STATE_NUM -} ENUM_ROAMING_STATE_T; - -typedef struct _ROAMING_INFO_T { - BOOLEAN fgIsEnableRoaming; - - ENUM_ROAMING_STATE_T eCurrentState; - - OS_SYSTIME rRoamingDiscoveryUpdateTime; - -} ROAMING_INFO_T, *P_ROAMING_INFO_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -#if CFG_SUPPORT_ROAMING -#define IS_ROAMING_ACTIVE(prAdapter) \ - (prAdapter->rWifiVar.rRoamingInfo.eCurrentState == ROAMING_STATE_ROAM) -#else -#define IS_ROAMING_ACTIVE(prAdapter) FALSE -#endif /* CFG_SUPPORT_ROAMING */ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -VOID -roamingFsmInit ( - IN P_ADAPTER_T prAdapter - ); - -VOID -roamingFsmUninit ( - IN P_ADAPTER_T prAdapter - ); - -VOID -roamingFsmSendCmd ( - IN P_ADAPTER_T prAdapter, - IN P_ROAMING_PARAM_T prParam - ); - -VOID -roamingFsmScanResultsUpdate ( - IN P_ADAPTER_T prAdapter - ); - -VOID -roamingFsmSteps ( - IN P_ADAPTER_T prAdapter, - IN ENUM_ROAMING_STATE_T eNextState - ); - -VOID -roamingFsmRunEventStart ( - IN P_ADAPTER_T prAdapter - ); - -VOID -roamingFsmRunEventDiscovery ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Param - ); - -VOID -roamingFsmRunEventRoam ( - IN P_ADAPTER_T prAdapter - ); - -VOID -roamingFsmRunEventFail ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Reason - ); - -VOID -roamingFsmRunEventAbort ( - IN P_ADAPTER_T prAdapter - ); - -WLAN_STATUS -roamingFsmProcessEvent ( - IN P_ADAPTER_T prAdapter, - IN P_ROAMING_PARAM_T prParam - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _ROAMING_FSM_H */ - - - - diff --git a/drivers/net/wireless/mt5931/include/mgmt/rsn.h b/drivers/net/wireless/mt5931/include/mgmt/rsn.h deleted file mode 100755 index dcb05b1fbbfb..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/rsn.h +++ /dev/null @@ -1,380 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rsn.h#1 $ -*/ - -/*! \file rsn.h - \brief The wpa/rsn related define, macro and structure are described here. -*/ - - - -/* -** $Log: rsn.h $ - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 06 22 2011 wh.su - * [WCXRP00000806] [MT6620 Wi-Fi][Driver] Move the WPA/RSN IE and WAPI IE structure to mac.h and let the sw structure not align at byte - * Move the WAPI/RSN IE to mac.h and SW structure not align to byte, - * Notice needed update P2P.ko. - * - * 03 17 2011 chinglan.wang - * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature - * . - * - * 02 09 2011 wh.su - * [WCXRP00000432] [MT6620 Wi-Fi][Driver] Add STA privacy check at hotspot mode - * adding the code for check STA privacy bit at AP mode, . - * - * 11 05 2010 wh.su - * [WCXRP00000165] [MT6620 Wi-Fi] [Pre-authentication] Assoc req rsn ie use wrong pmkid value - * fixed the.pmkid value mismatch issue - * - * 10 04 2010 wh.su - * [WCXRP00000081] [MT6620][Driver] Fix the compiling error at WinXP while enable P2P - * add a kal function for set cipher. - * - * 09 01 2010 wh.su - * NULL - * adding the wapi support for integration test. - * - * 08 30 2010 wh.su - * NULL - * remove non-used code. - * - * 08 19 2010 wh.su - * NULL - * adding the tx pkt call back handle for countermeasure. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 18 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * migration from MT6620 firmware. - * - * 03 03 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * Fixed the pre-authentication timer not correctly init issue, and modify the security related callback function prototype. - * - * 01 27 2010 wh.su - * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code - * add and fixed some security function. - * - * Dec 4 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adjust the function prototype for generate wap/rsn ie - * - * Dec 3 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adjust the function input parameter - * - * Dec 1 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding some event function declaration - * - * Nov 26 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * move the internal data structure for pmkid to rsn.h - * - * Nov 23 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the port control and class error function - * - * Nov 19 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the pmkid candidate - * - * Nov 18 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * -** -*/ - -#ifndef _RSN_H -#define _RSN_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -/* ----- Definitions for Cipher Suite Selectors ----- */ -#define RSN_CIPHER_SUITE_USE_GROUP_KEY 0x00AC0F00 -#define RSN_CIPHER_SUITE_WEP40 0x01AC0F00 -#define RSN_CIPHER_SUITE_TKIP 0x02AC0F00 -#define RSN_CIPHER_SUITE_CCMP 0x04AC0F00 -#define RSN_CIPHER_SUITE_WEP104 0x05AC0F00 -#if CFG_SUPPORT_802_11W -#define RSN_CIPHER_SUITE_AES_128_CMAC 0x06AC0F00 -#endif - -#define WPA_CIPHER_SUITE_NONE 0x00F25000 -#define WPA_CIPHER_SUITE_WEP40 0x01F25000 -#define WPA_CIPHER_SUITE_TKIP 0x02F25000 -#define WPA_CIPHER_SUITE_CCMP 0x04F25000 -#define WPA_CIPHER_SUITE_WEP104 0x05F25000 - -/* ----- Definitions for Authentication and Key Management Suite Selectors ----- */ -#define RSN_AKM_SUITE_NONE 0x00AC0F00 -#define RSN_AKM_SUITE_802_1X 0x01AC0F00 -#define RSN_AKM_SUITE_PSK 0x02AC0F00 -#if CFG_SUPPORT_802_11W -#define RSN_AKM_SUITE_802_1X_SHA256 0x05AC0F00 -#define RSN_AKM_SUITE_PSK_SHA256 0x06AC0F00 -#endif - -#define WPA_AKM_SUITE_NONE 0x00F25000 -#define WPA_AKM_SUITE_802_1X 0x01F25000 -#define WPA_AKM_SUITE_PSK 0x02F25000 - -#define ELEM_ID_RSN_LEN_FIXED 20 /* The RSN IE len for associate request */ - -#define ELEM_ID_WPA_LEN_FIXED 22 /* The RSN IE len for associate request */ - -#define MASK_RSNIE_CAP_PREAUTH BIT(0) - -#define GET_SELECTOR_TYPE(x) ((UINT_8)(((x) >> 24) & 0x000000FF)) -#define SET_SELECTOR_TYPE(x, y) x = (((x) & 0x00FFFFFF) | (((UINT_32)(y) << 24) & 0xFF000000)) - -#define AUTH_CIPHER_CCMP 0x00000008 - -/* Cihpher suite flags */ -#define CIPHER_FLAG_NONE 0x00000000 -#define CIPHER_FLAG_WEP40 0x00000001 /* BIT 1 */ -#define CIPHER_FLAG_TKIP 0x00000002 /* BIT 2 */ -#define CIPHER_FLAG_CCMP 0x00000008 /* BIT 4 */ -#define CIPHER_FLAG_WEP104 0x00000010 /* BIT 5 */ -#define CIPHER_FLAG_WEP128 0x00000020 /* BIT 6 */ - -#define WAIT_TIME_IND_PMKID_CANDICATE_SEC 6 /* seconds */ -#define TKIP_COUNTERMEASURE_SEC 60 /* seconds */ - -#if CFG_SUPPORT_802_11W -#define RSN_AUTH_MFP_DISABLED 0 /* MFP disabled */ -#define RSN_AUTH_MFP_OPTIONAL 1 /* MFP optional */ -#define RSN_AUTH_MFP_REQUIRED 2 /* MFP required */ -#endif - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/* Flags for PMKID Candidate list structure */ -#define EVENT_PMKID_CANDIDATE_PREAUTH_ENABLED 0x01 - - -#define CONTROL_FLAG_UC_MGMT_NO_ENC BIT(5) - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -#define RSN_IE(fp) ((P_RSN_INFO_ELEM_T) fp) -#define WPA_IE(fp) ((P_WPA_INFO_ELEM_T) fp) - - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -BOOLEAN -rsnParseRsnIE( - IN P_ADAPTER_T prAdapter, - IN P_RSN_INFO_ELEM_T prInfoElem, - OUT P_RSN_INFO_T prRsnInfo - ); - -BOOLEAN -rsnParseWpaIE( - IN P_ADAPTER_T prAdapter, - IN P_WPA_INFO_ELEM_T prInfoElem, - OUT P_RSN_INFO_T prWpaInfo - ); - -BOOLEAN -rsnSearchSupportedCipher( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Cipher, - OUT PUINT_32 pu4Index - ); - -BOOLEAN -rsnSearchAKMSuite( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4AkmSuite, - OUT PUINT_32 pu4Index - ); - -BOOLEAN -rsnPerformPolicySelection( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBss - ); - -VOID -rsnGenerateWpaNoneIE( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - -VOID -rsnGenerateWPAIE( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - -VOID -rsnGenerateRSNIE( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - -BOOLEAN -rsnParseCheckForWFAInfoElem( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBuf, - OUT PUINT_8 pucOuiType, - OUT PUINT_16 pu2SubTypeVersion - ); - -#if CFG_SUPPORT_AAA -void -rsnParserCheckForRSNCCMPPSK ( - P_ADAPTER_T prAdapter, - P_RSN_INFO_ELEM_T prIe, - PUINT_16 pu2StatusCode - ); -#endif - -VOID -rsnTkipHandleMICFailure( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta, - IN BOOLEAN fgErrorKeyType - ); - -VOID -rsnSelectPmkidCandidateList( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc - ); - -VOID -rsnUpdatePmkidCandidateList( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc - ); - -BOOLEAN -rsnSearchPmkidEntry( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBssid, - OUT PUINT_32 pu4EntryIndex - ); - -BOOLEAN -rsnCheckPmkidCandicate( - IN P_ADAPTER_T prAdapter - ); - -VOID -rsnCheckPmkidCache( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBss - ); - -VOID -rsnGeneratePmkidIndication( - IN P_ADAPTER_T prAdapter - ); - -VOID -rsnIndicatePmkidCand( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Parm - ); -#if CFG_SUPPORT_WPS2 -VOID -rsnGenerateWSCIE( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); -#endif - -#if CFG_SUPPORT_802_11W -UINT_32 -rsnCheckBipKeyInstalled( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -UINT_8 -rsnCheckSaQueryTimeout( - IN P_ADAPTER_T prAdapter - ); - -void -rsnStartSaQueryTimer( - IN P_ADAPTER_T prAdapter - ); - -void -rsnStartSaQuery( - IN P_ADAPTER_T prAdapter - ); - -void -rsnStopSaQuery( - IN P_ADAPTER_T prAdapter - ); - -void -rsnSaQueryRequest( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -void -rsnSaQueryAction( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -BOOLEAN -rsnCheckRxMgmt( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN UINT_8 ucSubtype - ); -#endif -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _RSN_H */ - diff --git a/drivers/net/wireless/mt5931/include/mgmt/scan.h b/drivers/net/wireless/mt5931/include/mgmt/scan.h deleted file mode 100755 index 85ab71281b58..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/scan.h +++ /dev/null @@ -1,847 +0,0 @@ -/* -** $Id: @(#) -*/ - -/*! \file "scan.h" - \brief - -*/ - - - -/* -** $Log: scan.h $ - * - * 01 16 2012 cp.wu - * [MT6620 Wi-Fi][Driver] API and behavior modification for preferred band configuration with corresponding network configuration - * add wlanSetPreferBandByNetwork() for glue layer to invoke for setting preferred band configuration corresponding to network type. - * - * 08 11 2011 cp.wu - * [WCXRP00000830] [MT6620 Wi-Fi][Firmware] Use MDRDY counter to detect empty channel for shortening scan time - * sparse channel detection: - * driver: collect sparse channel information with scan-done event - - * - * 07 18 2011 cp.wu - * [WCXRP00000858] [MT5931][Driver][Firmware] Add support for scan to search for more than one SSID in a single scanning request - * add framework in driver domain for supporting new SCAN_REQ_V2 for more than 1 SSID support as well as uProbeDelay in NDIS 6.x driver model - * - * 06 27 2011 cp.wu - * [WCXRP00000815] [MT6620 Wi-Fi][Driver] allow single BSSID with multiple SSID settings to work around some tricky AP which use space character as hidden SSID - * allow to have a single BSSID with multiple SSID to be presented in scanning result - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 02 09 2011 wh.su - * [WCXRP00000433] [MT6620 Wi-Fi][Driver] Remove WAPI structure define for avoid P2P module with structure miss-align pointer issue - * always pre-allio WAPI related structure for align p2p module. - * - * 01 14 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * Fix compile error. - * - * 09 08 2010 cp.wu - * NULL - * use static memory pool for storing IEs of scanning result. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 31 2010 kevin.huang - * NULL - * Use LINK LIST operation to process SCAN result - * - * 08 30 2010 cp.wu - * NULL - * eliminate klockwork errors - * - * 08 16 2010 cp.wu - * NULL - * add interface for RLM to trigger OBSS-SCAN. - * - * 08 12 2010 yuche.tsai - * NULL - * Add a functio prototype to find p2p descriptor of a bss descriptor directly. - * - * 08 11 2010 yuche.tsai - * NULL - * Add function prototype for return channel. - * modify data structure for scan specific device ID or TYPE. (Move from P2P Connection Settings to Scan Param) - * - * 08 05 2010 yuche.tsai - * NULL - * Check-in P2P Device Discovery Feature. - * - * 08 02 2010 yuche.tsai - * NULL - * P2P Group Negotiation Code Check in. - * - * 07 26 2010 yuche.tsai - * - * Add a option for channel time extention in scan abort command. - * - * 07 21 2010 yuche.tsai - * - * Add for P2P Scan Result Parsing & Saving. - * - * 07 19 2010 yuche.tsai - * - * Scan status "FIND" is used for P2P FSM find state. - * - * 07 19 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * SCN module is now able to handle multiple concurrent scanning requests - * - * 07 14 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * pass band with channel number information as scan parameter - * - * 07 14 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * remove timer in DRV-SCN. - * - * 07 09 2010 cp.wu - * - * 1) separate AIS_FSM state for two kinds of scanning. (OID triggered scan, and scan-for-connection) - * 2) eliminate PRE_BSS_DESC_T, Beacon/PrebResp is now parsed in single pass - * 3) implment DRV-SCN module, currently only accepts single scan request, other request will be directly dropped by returning BUSY - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add scan uninitialization procedure - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * implementation of DRV-SCN and related mailbox message handling. - * - * 06 25 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * modify Beacon/ProbeResp to complete parsing, - * because host software has looser memory usage restriction - * - * 06 17 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Add P2P related field in SCAN_PARAM_T. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * saa_fsm.c is migrated. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add management dispatching function table. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * restore utility function invoking via hem_mbox to direct calls - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * auth.c is migrated. - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add buildable & linkable ais_fsm.c - * - * related reference are still waiting to be resolved - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h. - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add Power Management - Legacy PS-POLL support. - * - * 04 13 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * - * Add new HW CH macro support - * - * 03 16 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add AdHoc Mode - * - * 03 10 2010 kevin.huang - * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support - * - * * * * * * Add Channel Manager for arbitration of JOIN and SCAN Req - * - * 02 26 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Modify scanBuildProbeReqFrameCommonIEs() to support P2P SCAN - * - * 02 23 2010 wh.su - * [BORA00000592][MT6620 Wi-Fi] Adding the security related code for driver - * refine the scan procedure, reduce the WPA and WAPI IE parsing, and move the parsing to the time for join. - * - * 02 23 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add support scan channel 1~14 and update scan result's frequency infou1rwduu`wvpghlqg|n`slk+mpdkb - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup - * - * 01 27 2010 wh.su - * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code - * add and fixed some security function. - * - * 01 07 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * - * Simplify the process of Beacon during SCAN and remove redundant variable in PRE_BSS_DESC_T - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding variable for wapi ap - * - * Dec 4 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * remove non-used secuirty variavle - * - * Dec 3 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Refine data structure of BSS_DESC_T and PRE_BSS_DESC_T - * - * Nov 24 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add eNetType to rScanParam and revise MGMT Handler with Retain Status - * - * Nov 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add ucAvailablePhyTypeSet to BSS_DESC_T - * - * Nov 20 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add aucSrcAddress to SCAN_PARAM_T for P2P's Device Address - * - * Nov 19 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the security related variable - * - * Nov 18 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the security ie filed for scan parsing - * - * Nov 16 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add scanSearchBssDescByPolicy() - * - * Nov 5 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add function declarations of scan_fsm.c - * - * Oct 30 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add scan.h to source control -** -*/ - -#ifndef _SCAN_H -#define _SCAN_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -/*! Maximum buffer size of SCAN list */ -#define SCN_MAX_BUFFER_SIZE (CFG_MAX_NUM_BSS_LIST * ALIGN_4(sizeof(BSS_DESC_T))) - -#define SCN_RM_POLICY_EXCLUDE_CONNECTED BIT(0) // Remove SCAN result except the connected one. -#define SCN_RM_POLICY_TIMEOUT BIT(1) // Remove the timeout one -#define SCN_RM_POLICY_OLDEST_HIDDEN BIT(2) // Remove the oldest one with hidden ssid -#define SCN_RM_POLICY_SMART_WEAKEST BIT(3) /* If there are more than half BSS which has the - * same ssid as connection setting, remove the weakest one from them - * Else remove the weakest one. - */ -#define SCN_RM_POLICY_ENTIRE BIT(4) // Remove entire SCAN result - -#define SCN_BSS_DESC_SAME_SSID_THRESHOLD 3 /* This is used by POLICY SMART WEAKEST, - * If exceed this value, remove weakest BSS_DESC_T - * with same SSID first in large network. - */ - -#define SCN_BSS_DESC_REMOVE_TIMEOUT_SEC 5 // Second. - /* This is used by POLICY TIMEOUT, - * If exceed this value, remove timeout BSS_DESC_T. - */ - - - - -#define SCN_PROBE_DELAY_MSEC 0 - -#define SCN_ADHOC_BSS_DESC_TIMEOUT_SEC 5 // Second. - -/*----------------------------------------------------------------------------*/ -/* MSG_SCN_SCAN_REQ */ -/*----------------------------------------------------------------------------*/ -#define SCAN_REQ_SSID_WILDCARD BIT(0) -#define SCAN_REQ_SSID_P2P_WILDCARD BIT(1) -#define SCAN_REQ_SSID_SPECIFIED BIT(2) - - -/*----------------------------------------------------------------------------*/ -/* Support Multiple SSID SCAN */ -/*----------------------------------------------------------------------------*/ -#define SCN_SSID_MAX_NUM 4 - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef enum _ENUM_SCAN_TYPE_T { - SCAN_TYPE_PASSIVE_SCAN = 0, - SCAN_TYPE_ACTIVE_SCAN, - SCAN_TYPE_NUM -} ENUM_SCAN_TYPE_T, *P_ENUM_SCAN_TYPE_T; - -typedef enum _ENUM_SCAN_STATE_T { - SCAN_STATE_IDLE = 0, - SCAN_STATE_SCANNING, - SCAN_STATE_NUM -} ENUM_SCAN_STATE_T; - -typedef enum _ENUM_SCAN_CHANNEL_T { - SCAN_CHANNEL_FULL = 0, - SCAN_CHANNEL_2G4, - SCAN_CHANNEL_5G, - SCAN_CHANNEL_P2P_SOCIAL, - SCAN_CHANNEL_SPECIFIED, - SCAN_CHANNEL_NUM -} ENUM_SCAN_CHANNEL, *P_ENUM_SCAN_CHANNEL; - -typedef struct _MSG_SCN_FSM_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_32 u4Dummy; -} MSG_SCN_FSM_T, *P_MSG_SCN_FSM_T; - - - -/*----------------------------------------------------------------------------*/ -/* BSS Descriptors */ -/*----------------------------------------------------------------------------*/ -struct _BSS_DESC_T { - LINK_ENTRY_T rLinkEntry; - - UINT_8 aucBSSID[MAC_ADDR_LEN]; - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* For IBSS, the SrcAddr is different from BSSID */ - - BOOLEAN fgIsConnecting; /* If we are going to connect to this BSS - * (JOIN or ROAMING to another BSS), don't - * remove this record from BSS List. - */ - BOOLEAN fgIsConnected; /* If we have connected to this BSS (NORMAL_TR), - * don't removed this record from BSS list. - */ - - BOOLEAN fgIsHiddenSSID; /* When this flag is TRUE, means the SSID - * of this BSS is not known yet. - */ - UINT_8 ucSSIDLen; - UINT_8 aucSSID[ELEM_MAX_LEN_SSID]; - - OS_SYSTIME rUpdateTime; - - ENUM_BSS_TYPE_T eBSSType; - - UINT_16 u2CapInfo; - - UINT_16 u2BeaconInterval; - UINT_16 u2ATIMWindow; - - UINT_16 u2OperationalRateSet; - UINT_16 u2BSSBasicRateSet; - BOOLEAN fgIsUnknownBssBasicRate; - - BOOLEAN fgIsERPPresent; - BOOLEAN fgIsHTPresent; - - UINT_8 ucPhyTypeSet; /* Available PHY Type Set of this BSS */ - - UINT_8 ucChannelNum; - - ENUM_CHNL_EXT_T eSco; /* Record bandwidth for association process - Some AP will send association resp by 40MHz BW */ - ENUM_BAND_T eBand; - - UINT_8 ucDTIMPeriod; - - BOOLEAN fgIsLargerTSF; /* This BSS's TimeStamp is larger than us(TCL == 1 in RX_STATUS_T) */ - - UINT_8 ucRCPI; - - UINT_8 ucWmmFlag; /* A flag to indicate this BSS's WMM capability */ - - /*! \brief The srbiter Search State will matched the scan result, - and saved the selected cipher and akm, and report the score, - for arbiter join state, join module will carry this target BSS - to rsn generate ie function, for gen wpa/rsn ie */ - UINT_32 u4RsnSelectedGroupCipher; - UINT_32 u4RsnSelectedPairwiseCipher; - UINT_32 u4RsnSelectedAKMSuite; - - UINT_16 u2RsnCap; - - RSN_INFO_T rRSNInfo; - RSN_INFO_T rWPAInfo; -#if 1//CFG_SUPPORT_WAPI - WAPI_INFO_T rIEWAPI; - BOOL fgIEWAPI; -#endif - BOOL fgIERSN; - BOOL fgIEWPA; - - /*! \brief RSN parameters selected for connection */ - /*! \brief The Select score for final AP selection, - 0, no sec, 1,2,3 group cipher is WEP, TKIP, CCMP */ - UINT_8 ucEncLevel; - -#if CFG_ENABLE_WIFI_DIRECT - BOOLEAN fgIsP2PPresent; - P_P2P_DEVICE_DESC_T prP2pDesc; - - UINT_8 aucIntendIfAddr[MAC_ADDR_LEN]; /* For IBSS, the SrcAddr is different from BSSID */ -// UINT_8 ucDevCapabilityBitmap; /* Device Capability Attribute. (P2P_DEV_CAPABILITY_XXXX) */ -// UINT_8 ucGroupCapabilityBitmap; /* Group Capability Attribute. (P2P_GROUP_CAPABILITY_XXXX) */ - - LINK_T rP2pDeviceList; - -// P_LINK_T prP2pDeviceList; - - /* For - * 1. P2P Capability. - * 2. P2P Device ID. ( in aucSrcAddr[] ) - * 3. NOA (TODO:) - * 4. Extend Listen Timing. (Probe Rsp) (TODO:) - * 5. P2P Device Info. (Probe Rsp) - * 6. P2P Group Info. (Probe Rsp) - */ -#endif - - BOOLEAN fgIsIEOverflow; /* The received IE length exceed the maximum IE buffer size */ - UINT_16 u2IELength; /* The byte count of aucIEBuf[] */ - - ULARGE_INTEGER u8TimeStamp; /* Place u8TimeStamp before aucIEBuf[1] to force DW align */ - - UINT_8 aucIEBuf[CFG_IE_BUFFER_SIZE]; -}; - - -typedef struct _SCAN_PARAM_T { /* Used by SCAN FSM */ - /* Active or Passive */ - ENUM_SCAN_TYPE_T eScanType; - - /* Network Type */ - ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex; - - /* Specified SSID Type */ - UINT_8 ucSSIDType; - UINT_8 ucSSIDNum; - - /* Length of Specified SSID */ - UINT_8 ucSpecifiedSSIDLen[SCN_SSID_MAX_NUM]; - - /* Specified SSID */ - UINT_8 aucSpecifiedSSID[SCN_SSID_MAX_NUM][ELEM_MAX_LEN_SSID]; - -#if CFG_ENABLE_WIFI_DIRECT - BOOLEAN fgFindSpecificDev; /* P2P: Discovery Protocol */ - UINT_8 aucDiscoverDevAddr[MAC_ADDR_LEN]; - BOOLEAN fgIsDevType; - P2P_DEVICE_TYPE_T rDiscoverDevType; - - UINT_16 u2PassiveListenInterval; - // TODO: Find Specific Device Type. -#endif /* CFG_SUPPORT_P2P */ - - BOOLEAN fgIsObssScan; - BOOLEAN fgIsScanV2; - - /* Run time flags */ - UINT_16 u2ProbeDelayTime; - - /* channel information */ - ENUM_SCAN_CHANNEL eScanChannel; - UINT_8 ucChannelListNum; - RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST]; - - /* Feedback information */ - UINT_8 ucSeqNum; - - /* Information Element */ - UINT_16 u2IELen; - UINT_8 aucIE[MAX_IE_LENGTH]; - -} SCAN_PARAM_T, *P_SCAN_PARAM_T; - -typedef struct _SCAN_INFO_T { - ENUM_SCAN_STATE_T eCurrentState; /* Store the STATE variable of SCAN FSM */ - - OS_SYSTIME rLastScanCompletedTime; - - SCAN_PARAM_T rScanParam; - - UINT_32 u4NumOfBssDesc; - - UINT_8 aucScanBuffer[SCN_MAX_BUFFER_SIZE]; - - LINK_T rBSSDescList; - - LINK_T rFreeBSSDescList; - - LINK_T rPendingMsgList; - - /* Sparse Channel Detection */ - BOOLEAN fgIsSparseChannelValid; - RF_CHANNEL_INFO_T rSparseChannel; - -} SCAN_INFO_T, *P_SCAN_INFO_T; - - -/* Incoming Mailbox Messages */ -typedef struct _MSG_SCN_SCAN_REQ_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 ucSeqNum; - UINT_8 ucNetTypeIndex; - ENUM_SCAN_TYPE_T eScanType; - UINT_8 ucSSIDType; /* BIT(0) wildcard / BIT(1) P2P-wildcard / BIT(2) specific */ - UINT_8 ucSSIDLength; - UINT_8 aucSSID[PARAM_MAX_LEN_SSID]; -#if CFG_ENABLE_WIFI_DIRECT - UINT_16 u2ChannelDwellTime; /* In TU. 1024us. */ -#endif - ENUM_SCAN_CHANNEL eScanChannel; - UINT_8 ucChannelListNum; - RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST]; - UINT_16 u2IELen; - UINT_8 aucIE[MAX_IE_LENGTH]; -} MSG_SCN_SCAN_REQ, *P_MSG_SCN_SCAN_REQ; - -typedef struct _MSG_SCN_SCAN_REQ_V2_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 ucSeqNum; - UINT_8 ucNetTypeIndex; - ENUM_SCAN_TYPE_T eScanType; - UINT_8 ucSSIDType; /* BIT(0) wildcard / BIT(1) P2P-wildcard / BIT(2) specific */ - UINT_8 ucSSIDNum; - P_PARAM_SSID_T prSsid; - UINT_16 u2ProbeDelay; - UINT_16 u2ChannelDwellTime; /* In TU. 1024us. */ - ENUM_SCAN_CHANNEL eScanChannel; - UINT_8 ucChannelListNum; - RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST]; - UINT_16 u2IELen; - UINT_8 aucIE[MAX_IE_LENGTH]; -} MSG_SCN_SCAN_REQ_V2, *P_MSG_SCN_SCAN_REQ_V2; - - -typedef struct _MSG_SCN_SCAN_CANCEL_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 ucSeqNum; - UINT_8 ucNetTypeIndex; -#if CFG_ENABLE_WIFI_DIRECT - BOOLEAN fgIsChannelExt; -#endif -} MSG_SCN_SCAN_CANCEL, *P_MSG_SCN_SCAN_CANCEL; - -/* Outgoing Mailbox Messages */ -typedef enum _ENUM_SCAN_STATUS_T { - SCAN_STATUS_DONE = 0, - SCAN_STATUS_CANCELLED, - SCAN_STATUS_FAIL, - SCAN_STATUS_BUSY, - SCAN_STATUS_NUM -} ENUM_SCAN_STATUS, *P_ENUM_SCAN_STATUS; - -typedef struct _MSG_SCN_SCAN_DONE_T { - MSG_HDR_T rMsgHdr; /* Must be the first member */ - UINT_8 ucSeqNum; - UINT_8 ucNetTypeIndex; - ENUM_SCAN_STATUS eScanStatus; -} MSG_SCN_SCAN_DONE, *P_MSG_SCN_SCAN_DONE; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/* Routines in scan.c */ -/*----------------------------------------------------------------------------*/ -VOID -scnInit ( - IN P_ADAPTER_T prAdapter - ); - -VOID -scnUninit ( - IN P_ADAPTER_T prAdapter - ); - -/* BSS-DESC Search */ -P_BSS_DESC_T -scanSearchBssDescByBssid ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucBSSID[] - ); - -P_BSS_DESC_T -scanSearchBssDescByBssidAndSsid ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucBSSID[], - IN BOOLEAN fgCheckSsid, - IN P_PARAM_SSID_T prSsid - ); - -P_BSS_DESC_T -scanSearchBssDescByTA ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucSrcAddr[] - ); - -P_BSS_DESC_T -scanSearchBssDescByTAAndSsid ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucSrcAddr[], - IN BOOLEAN fgCheckSsid, - IN P_PARAM_SSID_T prSsid - ); - - -/* BSS-DESC Search - Alternative */ -P_BSS_DESC_T -scanSearchExistingBssDesc ( - IN P_ADAPTER_T prAdapter, - IN ENUM_BSS_TYPE_T eBSSType, - IN UINT_8 aucBSSID[], - IN UINT_8 aucSrcAddr[] - ); - -P_BSS_DESC_T -scanSearchExistingBssDescWithSsid ( - IN P_ADAPTER_T prAdapter, - IN ENUM_BSS_TYPE_T eBSSType, - IN UINT_8 aucBSSID[], - IN UINT_8 aucSrcAddr[], - IN BOOLEAN fgCheckSsid, - IN P_PARAM_SSID_T prSsid - ); - - -/* BSS-DESC Allocation */ -P_BSS_DESC_T -scanAllocateBssDesc ( - IN P_ADAPTER_T prAdapter - ); - -/* BSS-DESC Removal */ -VOID -scanRemoveBssDescsByPolicy ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4RemovePolicy - ); - -VOID -scanRemoveBssDescByBssid ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucBSSID[] - ); - -VOID -scanRemoveBssDescByBandAndNetwork ( - IN P_ADAPTER_T prAdapter, - IN ENUM_BAND_T eBand, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ); - -/* BSS-DESC State Change */ -VOID -scanRemoveConnFlagOfBssDescByBssid ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucBSSID[] - ); - -#if 0 -/* BSS-DESC Insertion */ -P_BSS_DESC_T -scanAddToInternalScanResult ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSWRfb, - IN P_BSS_DESC_T prBssDesc - ); -#endif - -/* BSS-DESC Insertion - ALTERNATIVE */ -P_BSS_DESC_T -scanAddToBssDesc ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -WLAN_STATUS -scanProcessBeaconAndProbeResp ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSWRfb - ); - -VOID -scanBuildProbeReqFrameCommonIEs ( - IN P_MSDU_INFO_T prMsduInfo, - IN PUINT_8 pucDesiredSsid, - IN UINT_32 u4DesiredSsidLen, - IN UINT_16 u2SupportedRateSet - ); - -WLAN_STATUS -scanSendProbeReqFrames ( - IN P_ADAPTER_T prAdapter, - IN P_SCAN_PARAM_T prScanParam - ); - -VOID -scanUpdateBssDescForSearch ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc - ); - -P_BSS_DESC_T -scanSearchBssDescByPolicy ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ); - -WLAN_STATUS -scanAddScanResult ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc, - IN P_SW_RFB_T prSwRfb - ); - -/*----------------------------------------------------------------------------*/ -/* Routines in scan_fsm.c */ -/*----------------------------------------------------------------------------*/ -VOID -scnFsmSteps ( - IN P_ADAPTER_T prAdapter, - IN ENUM_SCAN_STATE_T eNextState - ); - -/*----------------------------------------------------------------------------*/ -/* Command Routines */ -/*----------------------------------------------------------------------------*/ -VOID -scnSendScanReq ( - IN P_ADAPTER_T prAdapter - ); - -VOID -scnSendScanReqV2 ( - IN P_ADAPTER_T prAdapter - ); - -/*----------------------------------------------------------------------------*/ -/* RX Event Handling */ -/*----------------------------------------------------------------------------*/ -VOID -scnEventScanDone( - IN P_ADAPTER_T prAdapter, - IN P_EVENT_SCAN_DONE prScanDone - ); - -/*----------------------------------------------------------------------------*/ -/* Mailbox Message Handling */ -/*----------------------------------------------------------------------------*/ -VOID -scnFsmMsgStart ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -scnFsmMsgAbort ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -scnFsmHandleScanMsg ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_SCN_SCAN_REQ prScanReqMsg - ); - -VOID -scnFsmHandleScanMsgV2 ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_SCN_SCAN_REQ_V2 prScanReqMsg - ); - -VOID -scnFsmRemovePendingMsg ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucSeqNum, - IN UINT_8 ucNetTypeIndex - ); - -/*----------------------------------------------------------------------------*/ -/* Mailbox Message Generation */ -/*----------------------------------------------------------------------------*/ -VOID -scnFsmGenerateScanDoneMsg ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucSeqNum, - IN UINT_8 ucNetTypeIndex, - IN ENUM_SCAN_STATUS eScanStatus - ); - -/*----------------------------------------------------------------------------*/ -/* Query for sparse channel */ -/*----------------------------------------------------------------------------*/ -BOOLEAN -scnQuerySparseChannel ( - IN P_ADAPTER_T prAdapter, - P_ENUM_BAND_T prSparseBand, - PUINT_8 pucSparseChannel - ); - - -#endif /* _SCAN_H */ - - diff --git a/drivers/net/wireless/mt5931/include/mgmt/sec_fsm.h b/drivers/net/wireless/mt5931/include/mgmt/sec_fsm.h deleted file mode 100755 index 17c651937abc..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/sec_fsm.h +++ /dev/null @@ -1,284 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/sec_fsm.h#1 $ -*/ - -/*! \file sec_fsm.h - \brief Declaration of functions and finite state machine for SECURITY Module. - - Function declaration for privacy.c and SEC_STATE for SECURITY FSM. -*/ - - - -/* -** $Log: sec_fsm.h $ - * - * 09 29 2010 wh.su - * [WCXRP00000072] [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue - * [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue. - * - * 09 21 2010 kevin.huang - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * Eliminate Linux Compile Warning - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 20 2010 wh.su - * NULL - * adding the eapol callback setting. - * - * 08 19 2010 wh.su - * NULL - * adding the tx pkt call back handle for countermeasure. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 21 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * modify some code for concurrent network. - * - * 06 19 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * consdier the concurrent network setting. - * - * 03 04 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * Code refine, and remove non-used code. - * - * 03 03 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * Fixed the pre-authentication timer not correctly init issue, and modify the security related callback function prototype. - * - * 03 01 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * Refine the variable and parameter for security. - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * fixed the deauth Tx done callback parameter - * - * Dec 4 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the reference function declaration - * - * Dec 3 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * delete non-used code - * - * Dec 1 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adjust the function prototype - * - * Nov 23 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adjust the function declaration - * - * Nov 19 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the security variable - * - * Nov 18 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * -** \main\maintrunk.MT5921\14 2009-04-06 15:35:47 GMT mtk01088 -** add the variable to set the disable AP selection for privacy check, for wps open networking. -** \main\maintrunk.MT5921\13 2008-11-19 11:46:01 GMT mtk01088 -** rename some variable with pre-fix to avoid the misunderstanding -** \main\maintrunk.MT5921\12 2008-08-28 20:37:11 GMT mtk01088 -** remove non-used code -** -** \main\maintrunk.MT5921\11 2008-03-18 09:51:52 GMT mtk01088 -** Add function declaration for timer to indicate pmkid candidate -** \main\maintrunk.MT5921\10 2008-02-29 15:12:08 GMT mtk01088 -** add variable for sw port control -** \main\maintrunk.MT5921\9 2008-02-29 12:37:30 GMT mtk01088 -** rename the security related function declaration -** \main\maintrunk.MT5921\8 2007-12-27 13:59:08 GMT mtk01088 -** adjust the wlan table and sec fsm init timing -** \main\maintrunk.MT5921\7 2007-11-20 10:39:49 GMT mtk01088 -** add function timer for wait EAPoL Error timeout -** \main\maintrunk.MT5921\6 2007-11-06 20:39:08 GMT mtk01088 -** rename the counter measure timer -** \main\maintrunk.MT5921\5 2007-11-06 20:14:31 GMT mtk01088 -** add a abort function -** Revision 1.5 2007/07/16 02:33:42 MTK01088 -** change the ENUM declaration structure prefix from r to e -** -** Revision 1.4 2007/07/09 06:23:10 MTK01088 -** update -** -** Revision 1.3 2007/07/04 10:09:04 MTK01088 -** adjust the state for security fsm -** change function name -** -** Revision 1.2 2007/07/03 08:13:22 MTK01088 -** change the sec fsm state -** add the event for sec fsm -** -** Revision 1.1 2007/06/27 06:20:35 MTK01088 -** add the sec fsm header file -** -** -*/ -#ifndef _SEC_FSM_H -#define _SEC_FSM_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/* TKIP CounterMeasure interval for Rejoin to Network. */ -#define COUNTER_MEASURE_TIMEOUT_INTERVAL_SEC 60 - -/* Timeout to wait the EAPoL Error Report frame Send out. */ -#define EAPOL_REPORT_SEND_TIMEOUT_INTERVAL_SEC 1 - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -typedef UINT_32 SEC_STATUS, *P_SEC_STATUS; - -#if 0 -/* WPA2 PMKID candicate structure */ -typedef struct _PMKID_CANDICATE_T { - UINT_8 aucBssid[MAC_ADDR_LEN]; /* MAC address */ - UINT_32 u4PreAuthFlags; -} PMKID_CANDICATE_T, *P_PMKID_CANDICATE_T; -#endif - -typedef SEC_STATUS (*PFN_SEC_FSM_STATE_HANDLER)(VOID); - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -#define SEC_STATE_TRANSITION_FLAG fgIsTransition -#define SEC_NEXT_STATE_VAR eNextState - -#define SEC_STATE_TRANSITION(prAdapter, prSta, eFromState, eToState) \ - { secFsmTrans_ ## eFromState ## _to_ ## eToState(prAdapter, prSta); \ - SEC_NEXT_STATE_VAR = SEC_STATE_ ## eToState; \ - SEC_STATE_TRANSITION_FLAG = (BOOLEAN)TRUE; \ - } - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/*--------------------------------------------------------------*/ -/* Routines to handle the sec check */ -/*--------------------------------------------------------------*/ -/***** Routines in sec_fsm.c *****/ -VOID -secFsmInit( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ); - -VOID -secFsmEventInit( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ); - -VOID -secFsmEventStart( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ); - -VOID -secFsmEventAbort( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ); - -BOOLEAN -secFsmEventPTKInstalled( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ); - -VOID -secFsmEvent2ndEapolTx( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ); - -VOID -secFsmEvent4ndEapolTxDone( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ); - -VOID -secFsmEventEapolTxDone ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - -VOID -secFsmEventEapolTxTimeout ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Parm - ); - -VOID -secFsmEventDeauthTxDone( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - -VOID -secFsmEventStartCounterMeasure( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ); - -VOID -secFsmEventEndOfCounterMeasure( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Parm - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#endif /* _SEC_FSM_H */ - - diff --git a/drivers/net/wireless/mt5931/include/mgmt/swcr.h b/drivers/net/wireless/mt5931/include/mgmt/swcr.h deleted file mode 100755 index 4ea322d9763d..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/swcr.h +++ /dev/null @@ -1,180 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/swcr.h#1 $ -*/ - -/*! \file "swcr.h" - \brief -*/ - - - -/* - * - */ - -#ifndef _SWCR_H -#define _SWCR_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -#define SWCR_VAR(x) ((VOID *)&x) -#define SWCR_FUNC(x) ((VOID *)x) - -#define SWCR_T_FUNC BIT(7) - -#define SWCR_L_32 3 -#define SWCR_L_16 2 -#define SWCR_L_8 1 - -#define SWCR_READ 0 -#define SWCR_WRITE 1 - -#define SWCR_MAP_NUM(x) (sizeof(x)/sizeof(x[0])) - -#define SWCR_CR_NUM 7 - -#define SWCR_GET_RW_INDEX(action,rw,index) \ - index = action & 0x7F; \ - rw = action >> 7; - - -extern UINT_32 g_au4SwCr[]; /*: 0: command other: data */ - -typedef VOID (*PFN_SWCR_RW_T)(P_ADAPTER_T prAdapter, UINT_8 ucRead, UINT_16 u2Addr, UINT_32 *pu4Data); -typedef VOID (*PFN_CMD_RW_T)(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0,UINT_8 ucOpt1); - -typedef struct _SWCR_MAP_ENTRY_T { - UINT_16 u2Type; - PVOID u4Addr; -} SWCR_MAP_ENTRY_T, *P_SWCR_MAP_ENTRY_T; - - -typedef struct _SWCR_MOD_MAP_ENTRY_T { - UINT_8 ucMapNum; - P_SWCR_MAP_ENTRY_T prSwCrMap; -} SWCR_MOD_MAP_ENTRY_T, *P_SWCR_MOD_MAP_ENTRY_T; - -typedef enum _ENUM_SWCR_DBG_TYPE_T { - SWCR_DBG_TYPE_ALL = 0, - SWCR_DBG_TYPE_TXRX, - SWCR_DBG_TYPE_RX_RATES, - SWCR_DBG_TYPE_PS, - SWCR_DBG_TYPE_NUM -} ENUM_SWCR_DBG_TYPE_T; - -typedef enum _ENUM_SWCR_DBG_ALL_T { - SWCR_DBG_ALL_TX_CNT = 0, - SWCR_DBG_ALL_TX_BCN_CNT, - SWCR_DBG_ALL_TX_FAILED_CNT, - SWCR_DBG_ALL_TX_RETRY_CNT, - SWCR_DBG_ALL_TX_AGING_TIMEOUT_CNT, - SWCR_DBG_ALL_TX_PS_OVERFLOW_CNT, - SWCR_DBG_ALL_TX_MGNT_DROP_CNT, - SWCR_DBG_ALL_TX_ERROR_CNT, - - SWCR_DBG_ALL_RX_CNT, - SWCR_DBG_ALL_RX_DROP_CNT, - SWCR_DBG_ALL_RX_DUP_DROP_CNT, - SWCR_DBG_ALL_RX_TYPE_ERROR_DROP_CNT, - SWCR_DBG_ALL_RX_CLASS_ERROR_DROP_CNT, - SWCR_DBG_ALL_RX_AMPDU_ERROR_DROP_CNT, - - SWCR_DBG_ALL_RX_STATUS_ERROR_DROP_CNT, - SWCR_DBG_ALL_RX_FORMAT_ERROR_DROP_CNT, - SWCR_DBG_ALL_RX_ICV_ERROR_DROP_CNT, - SWCR_DBG_ALL_RX_KEY_ERROR_DROP_CNT, - SWCR_DBG_ALL_RX_TKIP_ERROR_DROP_CNT, - SWCR_DBG_ALL_RX_MIC_ERROR_DROP_CNT, - SWCR_DBG_ALL_RX_BIP_ERROR_DROP_CNT, - - SWCR_DBG_ALL_RX_FCSERR_CNT, - SWCR_DBG_ALL_RX_FIFOFULL_CNT, - SWCR_DBG_ALL_RX_PFDROP_CNT, - - SWCR_DBG_ALL_PWR_PS_POLL_CNT, - SWCR_DBG_ALL_PWR_TRIGGER_NULL_CNT, - SWCR_DBG_ALL_PWR_BCN_IND_CNT, - SWCR_DBG_ALL_PWR_BCN_TIMEOUT_CNT, - SWCR_DBG_ALL_PWR_PM_STATE0, - SWCR_DBG_ALL_PWR_PM_STATE1, - SWCR_DBG_ALL_PWR_CUR_PS_PROF0, - SWCR_DBG_ALL_PWR_CUR_PS_PROF1, - - SWCR_DBG_ALL_AR_STA0_RATE, - SWCR_DBG_ALL_AR_STA0_BWGI, - SWCR_DBG_ALL_AR_STA0_RX_RATE_RCPI, - - SWCR_DBG_ALL_ROAMING_ENABLE, - SWCR_DBG_ALL_ROAMING_ROAM_CNT, - SWCR_DBG_ALL_ROAMING_INT_CNT, - - SWCR_DBG_ALL_BB_RX_MDRDY_CNT, - SWCR_DBG_ALL_BB_RX_FCSERR_CNT, - SWCR_DBG_ALL_BB_CCK_PD_CNT, - SWCR_DBG_ALL_BB_OFDM_PD_CNT, - SWCR_DBG_ALL_BB_CCK_SFDERR_CNT, - SWCR_DBG_ALL_BB_CCK_SIGERR_CNT, - SWCR_DBG_ALL_BB_OFDM_TAGERR_CNT, - SWCR_DBG_ALL_BB_OFDM_SIGERR_CNT, - - SWCR_DBG_ALL_NUM -} ENUM_SWCR_DBG_ALL_T; - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -VOID swCrReadWriteCmd( - P_ADAPTER_T prAdapter, - UINT_8 ucRead, - UINT_16 u2Addr, - UINT_32 *pu4Data - ); - -/* Debug Support */ -VOID swCrFrameCheckEnable(P_ADAPTER_T prAdapter, UINT_32 u4DumpType); -VOID swCrDebugInit(P_ADAPTER_T prAdapter); -VOID swCrDebugCheckEnable(P_ADAPTER_T prAdapter, BOOLEAN fgIsEnable, UINT_8 ucType, UINT_32 u4Timeout); -VOID swCrDebugUninit(P_ADAPTER_T prAdapter); - -#endif diff --git a/drivers/net/wireless/mt5931/include/mgmt/wapi.h b/drivers/net/wireless/mt5931/include/mgmt/wapi.h deleted file mode 100755 index a47acae67778..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/wapi.h +++ /dev/null @@ -1,120 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/wapi.h#1 $ -*/ - -/*! \file wapi.h - \brief The wapi related define, macro and structure are described here. -*/ - - - -/* -** $Log: wapi.h $ - * - * 07 20 2010 wh.su - * - * . - * - * 01 27 2010 wh.su - * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code - * add and fixed some security function. - * - * Dec 8 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * change the wapi function name and adding the generate wapi ie function - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding some wapi structure define - * - * Nov 23 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * -** \main\maintrunk.MT5921\1 2009-10-09 17:06:29 GMT mtk01088 -** -*/ - -#ifndef _WAPI_H -#define _WAPI_H - -#if CFG_SUPPORT_WAPI - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -#define WAPI_CIPHER_SUITE_WPI 0x01721400 /* WPI_SMS4 */ -#define WAPI_AKM_SUITE_802_1X 0x01721400 /* WAI */ -#define WAPI_AKM_SUITE_PSK 0x02721400 /* WAI_PSK */ - -#define ELEM_ID_WAPI 68 /* WAPI IE */ - -#define WAPI_IE(fp) ((P_WAPI_INFO_ELEM_T) fp) - - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -VOID -wapiGenerateWAPIIE( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - -BOOLEAN -wapiParseWapiIE ( - IN P_WAPI_INFO_ELEM_T prInfoElem, - OUT P_WAPI_INFO_T prWapiInfo - ); - -BOOLEAN -wapiPerformPolicySelection( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBss - ); - -//BOOLEAN -//wapiUpdateTxKeyIdx ( -// IN P_STA_RECORD_T prStaRec, -// IN UINT_8 ucWlanIdx -// ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#endif -#endif /* _WAPI_H */ - diff --git a/drivers/net/wireless/mt5931/include/mgmt/wlan_typedef.h b/drivers/net/wireless/mt5931/include/mgmt/wlan_typedef.h deleted file mode 100755 index bbf653aeb6df..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/wlan_typedef.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/wlan_typedef.h#1 $ -*/ - -/*! \file wlan_typedef.h - \brief Declaration of data type and return values of internal protocol stack. - - In this file we declare the data type and return values which will be exported - to all MGMT Protocol Stack. -*/ - - - -/* -** $Log: wlan_typedef.h $ -*/ - -#ifndef _WLAN_TYPEDEF_H -#define _WLAN_TYPEDEF_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -/* Type definition for BSS_INFO_T structure, to describe the attributes used in a - * common BSS. - */ -typedef struct _BSS_INFO_T BSS_INFO_T, *P_BSS_INFO_T; - -typedef BSS_INFO_T AIS_BSS_INFO_T, *P_AIS_BSS_INFO_T; -typedef BSS_INFO_T P2P_BSS_INFO_T, *P_P2P_BSS_INFO_T; -typedef BSS_INFO_T BOW_BSS_INFO_T, *P_BOW_BSS_INFO_T; - -typedef struct _AIS_SPECIFIC_BSS_INFO_T AIS_SPECIFIC_BSS_INFO_T, *P_AIS_SPECIFIC_BSS_INFO_T; -typedef struct _P2P_SPECIFIC_BSS_INFO_T P2P_SPECIFIC_BSS_INFO_T, *P_P2P_SPECIFIC_BSS_INFO_T; -typedef struct _BOW_SPECIFIC_BSS_INFO_T BOW_SPECIFIC_BSS_INFO_T, *P_BOW_SPECIFIC_BSS_INFO_T; - - -/* BSS related structures */ -/* Type definition for BSS_DESC_T structure, to describe parameter sets of a particular BSS */ -typedef struct _BSS_DESC_T BSS_DESC_T, *P_BSS_DESC_T, **PP_BSS_DESC_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#endif /* _WLAN_TYPEDEF_H */ - - diff --git a/drivers/net/wireless/mt5931/include/mgmt/wnm.h b/drivers/net/wireless/mt5931/include/mgmt/wnm.h deleted file mode 100755 index ac54cbc86dfa..000000000000 --- a/drivers/net/wireless/mt5931/include/mgmt/wnm.h +++ /dev/null @@ -1,100 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/MT6620_5931_WiFi_Driver/include/mgmt/wnm.h#1 $ -*/ - -/*! \file wnm.h - \brief This file contains the IEEE 802.11 family related 802.11v network management - for MediaTek 802.11 Wireless LAN Adapters. -*/ - - - -/* -** $Log: wnm.h $ - * - * 01 05 2012 tsaiyuan.hsu - * [WCXRP00001157] [MT6620 Wi-Fi][FW][DRV] add timing measurement support for 802.11v - * add timing measurement support for 802.11v. - * - * -*/ - -#ifndef _WNM_H -#define _WNM_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -typedef struct _TIMINGMSMT_PARAM_T { - BOOLEAN fgInitiator; - UINT_8 ucTrigger; - UINT_8 ucDialogToken; /* Dialog Token */ - UINT_8 ucFollowUpDialogToken; /* Follow Up Dialog Token */ - UINT_32 u4ToD; /* Timestamp of Departure [10ns] */ - UINT_32 u4ToA; /* Timestamp of Arrival [10ns] */ -} TIMINGMSMT_PARAM_T, *P_TIMINGMSMT_PARAM_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -VOID -wnmWNMAction ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -VOID -wnmReportTimingMeas ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucStaRecIndex, - IN UINT_32 u4ToD, - IN UINT_32 u4ToA - ); - -#define WNM_UNIT_TEST 1 - -#if WNM_UNIT_TEST -VOID wnmTimingMeasUnitTest1(P_ADAPTER_T prAdapter, UINT_8 ucStaRecIndex); -#endif - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _WNM_H */ - diff --git a/drivers/net/wireless/mt5931/include/nic/adapter.h b/drivers/net/wireless/mt5931/include/nic/adapter.h deleted file mode 100755 index c2413fa4a012..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/adapter.h +++ /dev/null @@ -1,1404 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/adapter.h#3 $ -*/ - -/*! \file adapter.h - \brief Definition of internal data structure for driver manipulation. - - In this file we define the internal data structure - ADAPTER_T which stands - for MiniPort ADAPTER(From Windows point of view) or stands for Network ADAPTER. -*/ - - - -/* -** $Log: adapter.h $ -** -** 08 31 2012 yuche.tsai -** [ALPS00349585] [6577JB][WiFi direct][KE]Establish p2p connection while both device have connected to AP previously,one device reboots automatically with KE -** Fix possible KE when concurrent & disconnect. -** -** 07 26 2012 yuche.tsai -** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot -** Update driver code of ALPS.JB for hot-spot. - * - * 07 17 2012 yuche.tsai - * NULL - * Let netdev bring up. - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 06 13 2012 yuche.tsai - * NULL - * Update maintrunk driver. - * Add support for driver compose assoc request frame. - * - * 03 02 2012 terry.wu - * NULL - * Snc CFG80211 modification for ICS migration from branch 2.2. - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 01 16 2012 cp.wu - * [MT6620 Wi-Fi][Driver] API and behavior modification for preferred band configuration with corresponding network configuration - * add wlanSetPreferBandByNetwork() for glue layer to invoke for setting preferred band configuration corresponding to network type. - * - * 12 13 2011 cm.chang - * [WCXRP00001136] [All Wi-Fi][Driver] Add wake lock for pending timer - * Add wake lock if timer timeout value is smaller than 5 seconds - * - * 12 02 2011 yuche.tsai - * NULL - * Resolve inorder issue under AP mode. - * - * data frame may TX before assoc response frame. - * - * 11 19 2011 yuche.tsai - * NULL - * Update RSSI for P2P. - * - * 11 18 2011 yuche.tsai - * NULL - * CONFIG P2P support RSSI query, default turned off. - * - * 11 11 2011 yuche.tsai - * NULL - * Fix work thread cancel issue. - * - * 10 21 2011 eddie.chen - * [WCXRP00001051] [MT6620 Wi-Fi][Driver/Fw] Adjust the STA aging timeout - * Add switch to ignore the STA aging timeout. - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 09 20 2011 cm.chang - * [WCXRP00000997] [MT6620 Wi-Fi][Driver][FW] Handle change of BSS preamble type and slot time - * Remove ERP member in adapter structure - * - * 09 14 2011 yuche.tsai - * NULL - * Add P2P IE in assoc response. - * - * 08 31 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * . - * - * 07 18 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add CMD/Event for RDD and BWCS. - * - * 06 23 2011 cp.wu - * [WCXRP00000812] [MT6620 Wi-Fi][Driver] not show NVRAM when there is no valid MAC address in NVRAM content - * check with firmware for valid MAC address. - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 04 12 2011 cm.chang - * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency - * . - * - * 04 08 2011 yuche.tsai - * [WCXRP00000624] [Volunteer Patch][MT6620][Driver] Add device discoverability support for GO. - * Add device discoverability support. - * Action frame callback for GO Device Discoverability Req. - * - * 04 08 2011 george.huang - * [WCXRP00000621] [MT6620 Wi-Fi][Driver] Support P2P supplicant to set power mode - * separate settings of P2P and AIS - * - * 04 08 2011 eddie.chen - * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma - * Fix for sigma - * - * 03 19 2011 yuche.tsai - * [WCXRP00000584] [Volunteer Patch][MT6620][Driver] Add beacon timeout support for WiFi Direct. - * Add beacon timeout support for WiFi Direct Network. - * - * 03 19 2011 yuche.tsai - * [WCXRP00000581] [Volunteer Patch][MT6620][Driver] P2P IE in Assoc Req Issue - * Make assoc req to append P2P IE if wifi direct is enabled. - * - * 03 17 2011 cp.wu - * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period - * use pre-allocated buffer for storing enhanced interrupt response as well - * - * 03 15 2011 cp.wu - * [WCXRP00000559] [MT6620 Wi-Fi][Driver] Combine TX/RX DMA buffers into a single one to reduce physically continuous memory consumption - * 1. deprecate CFG_HANDLE_IST_IN_SDIO_CALLBACK - * 2. Use common coalescing buffer for both TX/RX directions - * - * - * 03 10 2011 yuche.tsai - * [WCXRP00000533] [Volunteer Patch][MT6620][Driver] Provide a P2P function API for Legacy WiFi to query AP mode. - * Provide an API for Legacy WiFi to query the operation mode.. - * - * 03 05 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * add the code to get the check rsponse and indicate to app. - * - * 03 02 2011 wh.su - * [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request - * Add code to send beacon and probe response WSC IE at Auto GO. - * - * 03 02 2011 cp.wu - * [WCXRP00000503] [MT6620 Wi-Fi][Driver] Take RCPI brought by association response as initial RSSI right after connection is built. - * use RCPI brought by ASSOC-RESP after connection is built as initial RCPI to avoid using a uninitialized MAC-RX RCPI. - * - * 02 21 2011 terry.wu - * [WCXRP00000476] [MT6620 Wi-Fi][Driver] Clean P2P scan list while removing P2P - * Clean P2P scan list while removing P2P. - * - * 02 17 2011 eddie.chen - * [WCXRP00000458] [MT6620 Wi-Fi][Driver] BOW Concurrent - ProbeResp was exist in other channel - * 1) Chnage GetFrameAction decision when BSS is absent. - * 2) Check channel and resource in processing ProbeRequest - * - * 02 16 2011 cm.chang - * [WCXRP00000447] [MT6620 Wi-Fi][FW] Support new NVRAM update mechanism - * . - * - * 02 10 2011 yuche.tsai - * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode. - * Add RX deauthentication & disassociation process under Hot-Spot mode. - * - * 02 09 2011 wh.su - * [WCXRP00000433] [MT6620 Wi-Fi][Driver] Remove WAPI structure define for avoid P2P module with structure miss-align pointer issue - * always pre-allio WAPI related structure for align p2p module. - * - * 02 08 2011 yuche.tsai - * [WCXRP00000419] [Volunteer Patch][MT6620/MT5931][Driver] Provide function of disconnect to target station for AAA module. - * Provide disconnect function for AAA module. - * - * 02 01 2011 cm.chang - * [WCXRP00000415] [MT6620 Wi-Fi][Driver] Check if any memory leakage happens when uninitializing in DGB mode - * . - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * - * 01 27 2011 george.huang - * [WCXRP00000400] [MT6620 Wi-Fi] support CTIA power mode setting - * Support CTIA power mode setting. - * - * 01 27 2011 george.huang - * [WCXRP00000355] [MT6620 Wi-Fi] Set WMM-PS related setting with qualifying AP capability - * Support current measure mode, assigned by registry (XP only). - * - * 01 24 2011 cp.wu - * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving - * 1. add an extra counter for tracking pending forward frames. - * 2. notify TX service thread as well when there is pending forward frame - * 3. correct build errors leaded by introduction of Wi-Fi direct separation module - * - * 01 12 2011 cm.chang - * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting - * User-defined bandwidth is for 2.4G and 5G individually - * - * 12 29 2010 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, - -Add per station flow control when STA is in PS - - - * Add WMM parameter for broadcast. - * - * 12 29 2010 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, - -Add per station flow control when STA is in PS - - - * Add CWMin CWMax for AP to generate IE. - * - * 12 29 2010 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, -Add per station flow control when STA is in PS - - * 1) PS flow control event - * - * 2) WMM IE in beacon, assoc resp, probe resp - * - * 12 28 2010 cp.wu - * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release - * report EEPROM used flag via NIC_CAPABILITY - * - * 12 28 2010 cp.wu - * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release - * integrate with 'EEPROM used' flag for reporting correct capability to Engineer Mode/META and other tools - * - * 12 07 2010 cm.chang - * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant - * 1. Country code is from NVRAM or supplicant - * 2. Change band definition in CMD/EVENT. - * - * 11 01 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module - * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead - * 2) Remove CNM CH-RECOVER event handling - * 3) cfg read/write API renamed with kal prefix for unified naming rules. - * - * 10 27 2010 george.huang - * [WCXRP00000127] [MT6620 Wi-Fi][Driver] Add a registry to disable Beacon Timeout function for SQA test by using E1 EVB - * Support registry option for disable beacon lost detection. - * - * 10 26 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command - * 1) update NVRAM content template to ver 1.02 - * 2) add compile option for querying NIC capability (default: off) - * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting - * 4) correct auto-rate compiler error under linux (treat warning as error) - * 5) simplify usage of NVRAM and REG_INFO_T - * 6) add version checking between driver and firmware - * - * 10 08 2010 cp.wu - * [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test - * adding fixed rate support for distance test. (from registry setting) - * - * 10 06 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * code reorganization to improve isolation between GLUE and CORE layers. - * - * 10 05 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * 1) add NVRAM access API - * 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option) - * 3) add OID implementation for NVRAM read/write service - * - * 09 27 2010 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000065] Update BoW design and settings - * Update BCM/BoW design and settings. - * - * 09 24 2010 cp.wu - * [WCXRP00000057] [MT6620 Wi-Fi][Driver] Modify online scan to a run-time switchable feature - * Modify online scan as a run-time adjustable option (for Windows, in registry) - * - * 09 23 2010 cp.wu - * [WCXRP00000051] [MT6620 Wi-Fi][Driver] WHQL test fail in MAC address changed item - * use firmware reported mac address right after wlanAdapterStart() as permanent address - * - * 09 08 2010 cp.wu - * NULL - * use static memory pool for storing IEs of scanning result. - * - * 09 07 2010 yuche.tsai - * NULL - * Add a common IE buffer in P2P INFO structure. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 09 01 2010 cp.wu - * NULL - * restore configuration as before. - * - * 09 01 2010 wh.su - * NULL - * adding the wapi support for integration test. - * - * 08 31 2010 kevin.huang - * NULL - * Use LINK LIST operation to process SCAN result - * - * 08 29 2010 yuche.tsai - * NULL - * Finish SLT TX/RX & Rate Changing Support. - * - * 08 25 2010 george.huang - * NULL - * update OID/ registry control path for PM related settings - * - * 08 24 2010 cm.chang - * NULL - * Support RLM initail channel of Ad-hoc, P2P and BOW - * - * 08 23 2010 chinghwa.yu - * NULL - * Update for BOW. - * - * 08 20 2010 cm.chang - * NULL - * Migrate RLM code to host from FW - * - * 08 16 2010 yuche.tsai - * NULL - * Add an intend mode for BSS info. - * It is used to let P2P BSS Info to know which OP Mode it is going to become. - * - * 08 04 2010 george.huang - * NULL - * handle change PS mode OID/ CMD - * - * 08 02 2010 cp.wu - * NULL - * comment out deprecated members in BSS_INFO, which are only used by firmware rather than driver. - * - * 07 29 2010 cp.wu - * NULL - * eliminate u4FreqInKHz usage, combined into rConnections.ucAdHoc* - * - * 07 28 2010 cp.wu - * NULL - * 1) eliminate redundant variable eOPMode in prAdapter->rWlanInfo - * 2) change nicMediaStateChange() API prototype - * - * 07 24 2010 wh.su - * - * .support the Wi-Fi RSN - * - * 07 21 2010 yuche.tsai - * - * Add for P2P Scan Result Parsing & Saving. - * - * 07 19 2010 wh.su - * - * update for security supporting. - * - * 07 19 2010 cm.chang - * - * Set RLM parameters and enable CNM channel manager - * - * 07 19 2010 yuche.tsai - * - * Remove BSS info which is redonedent in Wifi Var.. - * - * 07 16 2010 yarco.yang - * - * 1. Support BSS Absence/Presence Event - * 2. Support STA change PS mode Event - * 3. Support BMC forwarding for AP mode. - * - * 07 14 2010 yarco.yang - * - * 1. Remove CFG_MQM_MIGRATION - * 2. Add CMD_UPDATE_WMM_PARMS command - * - * 07 09 2010 george.huang - * - * [WPD00001556] Migrate PM variables from FW to driver: for composing QoS Info - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Check draft RLM code for HT cap - * - * 06 29 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * replace g_rQM with Adpater->rQM - * - * 06 28 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * 1st draft code for RLM module - * - * 06 21 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * remove duplicate variable for migration. - * - * 06 21 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * modify some code for concurrent network. - * - * 06 21 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Add P2P FSM Info in adapter. - * - * 06 21 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Support CFG_MQM_MIGRATION flag - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 18 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * migration the security related function from firmware. - * - * 06 17 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Add P2P related field, additional include p2p_fsm.h if p2p is enabled. - * - * 06 15 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add scan.c. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add management dispatching function table. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * auth.c is migrated. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add buildable & linkable ais_fsm.c - * - * related reference are still waiting to be resolved - * - * 06 09 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add definitions for module migration. - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * cnm_timer has been migrated. - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * hem_mbox is migrated. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge wifi_var.h, precomp.h, cnm_timer.h (data type only) - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * change OID behavior to meet WHQL requirement. - * - * 05 20 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) integrate OID_GEN_NETWORK_LAYER_ADDRESSES with CMD_ID_SET_IP_ADDRESS - * 2) buffer statistics data for 2 seconds - * 3) use default value for adhoc parameters instead of 0 - * - * 05 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) do not take timeout mechanism for power mode oids - * 2) retrieve network type from connection status - * 3) after disassciation, set radio state to off - * 4) TCP option over IPv6 is supported - * - * 05 18 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement Wakeup-on-LAN except firmware integration part - * - * 04 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * reserve field of privacy filter and RTS threshold setting. - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * * * * 2) command sequence number is now increased atomically - * * * * * * 3) private data could be hold and taken use for other purpose - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * rWlanInfo should be placed at adapter rather than glue due to most operations - * * * are done in adapter layer. - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * code refine: fgTestMode should be at adapter rather than glue due to the device/fw is also involved - * - * 03 31 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * modify the wapi related code for new driver's design. - * - * 03 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) add ACPI D0/D3 state switching support - * * * 2) use more formal way to handle interrupt when the status is retrieved from enhanced RX response - * - * 03 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement OID_802_3_MULTICAST_LIST oid handling - * - * 03 02 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) the use of prPendingOid revised, all accessing are now protected by spin lock - * * * 2) ensure wlanReleasePendingOid will clear all command queues - * - * 02 09 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * move ucCmdSeqNum as instance variable - * - * 01 27 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * . - * - * 01 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. eliminate improper variable in rHifInfo - * * * 2. block TX/ordinary OID when RF test mode is engaged - * * * 3. wait until firmware finish operation when entering into and leaving from RF test mode - * * * 4. correct some HAL implementation - * - * 12 30 2009 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) According to CMD/EVENT documentation v0.8, - * * * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used, - * * * and result is retrieved by get ATInfo instead - * * * 2) add 4 counter for recording aggregation statistics - * - * 12 28 2009 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate redundant variables for connection_state -** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-12-16 18:02:03 GMT mtk02752 -** add external reference to avoid compilation error -** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-12-10 16:40:26 GMT mtk02752 -** eliminate unused member -** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-12-08 17:36:08 GMT mtk02752 -** add RF test data members into P_ADAPTER_T -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-10-13 21:58:45 GMT mtk01084 -** update for new HW architecture design -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-04-28 10:29:57 GMT mtk01461 -** Add read WTSR for SDIO_STATUS_ENHANCE mode -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-04-21 09:37:35 GMT mtk01461 -** Add prPendingCmdInfoOfOID for temporarily saving the CMD_INFO_T before en-queue to rCmdQueue -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-17 19:57:51 GMT mtk01461 -** Add MGMT Buffer Info -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-01 10:34:12 GMT mtk01461 -** Add SW pre test CFG_HIF_LOOPBACK_PRETEST -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-03-23 21:41:48 GMT mtk01461 -** Add fgIsWmmAssoc flag for TC assignment -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-19 18:32:51 GMT mtk01084 -** update for basic power management functions -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-18 20:51:52 GMT mtk01426 -** Add #if CFG_SDIO_RX_ENHANCE related data structure -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:17 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _ADAPTER_H -#define _ADAPTER_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef struct _ENHANCE_MODE_DATA_STRUCT_T SDIO_CTRL_T, *P_SDIO_CTRL_T; - -typedef struct _WLAN_INFO_T { - PARAM_BSSID_EX_T rCurrBssId; - - // Scan Result - PARAM_BSSID_EX_T arScanResult[CFG_MAX_NUM_BSS_LIST]; - PUINT_8 apucScanResultIEs[CFG_MAX_NUM_BSS_LIST]; - UINT_32 u4ScanResultNum; - - // IE pool for Scanning Result - UINT_8 aucScanIEBuf[CFG_MAX_COMMON_IE_BUF_LEN]; - UINT_32 u4ScanIEBufferUsage; - - OS_SYSTIME u4SysTime; - - // connection parameter (for Ad-Hoc) - UINT_16 u2BeaconPeriod; - UINT_16 u2AtimWindow; - - PARAM_RATES eDesiredRates; - CMD_LINK_ATTRIB eLinkAttr; -// CMD_PS_PROFILE_T ePowerSaveMode; - CMD_PS_PROFILE_T arPowerSaveMode[NETWORK_TYPE_INDEX_NUM]; - - // trigger parameter - ENUM_RSSI_TRIGGER_TYPE eRssiTriggerType; - PARAM_RSSI rRssiTriggerValue; - - // Privacy Filter - ENUM_PARAM_PRIVACY_FILTER_T ePrivacyFilter; - - // RTS Threshold - PARAM_RTS_THRESHOLD eRtsThreshold; - - // Network Type - UINT_8 ucNetworkType; - - // Network Type In Use - UINT_8 ucNetworkTypeInUse; - -} WLAN_INFO_T, *P_WLAN_INFO_T; - -/* Session for CONNECTION SETTINGS */ -typedef struct _CONNECTION_SETTINGS_T { - - UINT_8 aucMacAddress[MAC_ADDR_LEN]; - - UINT_8 ucDelayTimeOfDisconnectEvent; - - BOOLEAN fgIsConnByBssidIssued; - UINT_8 aucBSSID[MAC_ADDR_LEN]; - - BOOLEAN fgIsConnReqIssued; - UINT_8 ucSSIDLen; - UINT_8 aucSSID[ELEM_MAX_LEN_SSID]; - - ENUM_PARAM_OP_MODE_T eOPMode; - - ENUM_PARAM_CONNECTION_POLICY_T eConnectionPolicy; - - ENUM_PARAM_AD_HOC_MODE_T eAdHocMode; - - ENUM_PARAM_AUTH_MODE_T eAuthMode; - - ENUM_PARAM_ENCRYPTION_STATUS_T eEncStatus; - - BOOLEAN fgIsScanReqIssued; - - - /* MIB attributes */ - UINT_16 u2BeaconPeriod; - - UINT_16 u2RTSThreshold; /* User desired setting */ - - UINT_16 u2DesiredNonHTRateSet; /* User desired setting */ - - UINT_8 ucAdHocChannelNum; /* For AdHoc */ - - ENUM_BAND_T eAdHocBand; /* For AdHoc */ - - UINT_32 u4FreqInKHz; /* Center frequency */ - - /* ATIM windows using for IBSS power saving function */ - UINT_16 u2AtimWindow; - - /* Features */ - BOOLEAN fgIsEnableRoaming; - - BOOLEAN fgIsAdHocQoSEnable; - - ENUM_PARAM_PHY_CONFIG_T eDesiredPhyConfig; - - /* Used for AP mode for desired channel and bandwidth */ - UINT_16 u2CountryCode; - UINT_8 uc2G4BandwidthMode; /* 20/40M or 20M only */ - UINT_8 uc5GBandwidthMode; /* 20/40M or 20M only */ - - BOOLEAN fgTxShortGIDisabled; - BOOLEAN fgRxShortGIDisabled; - -#if CFG_SUPPORT_802_11D - BOOLEAN fgMultiDomainCapabilityEnabled; -#endif /* CFG_SUPPORT_802_11D*/ - - -#if 1 //CFG_SUPPORT_WAPI - BOOL fgWapiMode; - UINT_32 u4WapiSelectedGroupCipher; - UINT_32 u4WapiSelectedPairwiseCipher; - UINT_32 u4WapiSelectedAKMSuite; -#endif - - /* CR1486, CR1640 */ - /* for WPS, disable the privacy check for AP selection policy */ - BOOLEAN fgPrivacyCheckDisable; - - /* b0~3: trigger-en AC0~3. b4~7: delivery-en AC0~3 */ - UINT_8 bmfgApsdEnAc; - -} CONNECTION_SETTINGS_T, *P_CONNECTION_SETTINGS_T; - -struct _BSS_INFO_T { - - ENUM_PARAM_MEDIA_STATE_T eConnectionState; /* Connected Flag used in AIS_NORMAL_TR */ - ENUM_PARAM_MEDIA_STATE_T eConnectionStateIndicated; /* The Media State that report to HOST */ - - ENUM_OP_MODE_T eCurrentOPMode; /* Current Operation Mode - Infra/IBSS */ -#if CFG_ENABLE_WIFI_DIRECT - ENUM_OP_MODE_T eIntendOPMode; -#endif - - BOOLEAN fgIsNetActive; /* TRUE if this network has been activated */ - - UINT_8 ucNetTypeIndex; /* ENUM_NETWORK_TYPE_INDEX_T */ - - UINT_8 ucReasonOfDisconnect; /* Used by media state indication */ - - UINT_8 ucSSIDLen; /* Length of SSID */ - -#if CFG_ENABLE_WIFI_DIRECT - ENUM_HIDDEN_SSID_TYPE_T eHiddenSsidType; /* For Hidden SSID usage. */ -#endif - - UINT_8 aucSSID[ELEM_MAX_LEN_SSID]; /* SSID used in this BSS */ - - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* The BSSID of the associated BSS */ - - UINT_8 aucOwnMacAddr[MAC_ADDR_LEN];/* Owned MAC Address used in this BSS */ - - P_STA_RECORD_T prStaRecOfAP; /* For Infra Mode, and valid only if - * eConnectionState == MEDIA_STATE_CONNECTED - */ - LINK_T rStaRecOfClientList; /* For IBSS/AP Mode, all known STAs in current BSS */ - - UINT_16 u2CapInfo; /* Change Detection */ - - UINT_16 u2BeaconInterval; /* The Beacon Interval of this BSS */ - - - UINT_16 u2ATIMWindow; /* For IBSS Mode */ - - UINT_16 u2AssocId; /* For Infra Mode, it is the Assoc ID assigned by AP. - */ - - - UINT_8 ucDTIMPeriod; /* For Infra/AP Mode */ - - UINT_8 ucDTIMCount; /* For AP Mode, it is the DTIM value we should carried in - * the Beacon of next TBTT. - */ - - UINT_8 ucPhyTypeSet; /* Available PHY Type Set of this peer - * (This is deduced from received BSS_DESC_T) - */ - - UINT_8 ucNonHTBasicPhyType; /* The Basic PHY Type Index, used to setup Phy Capability */ - - UINT_8 ucConfigAdHocAPMode; /* The configuration of AdHoc/AP Mode. e.g. 11g or 11b */ - - UINT_8 ucBeaconTimeoutCount; /* For Infra/AP Mode, it is a threshold of Beacon Lost Count to - confirm connection was lost */ - - BOOLEAN fgHoldSameBssidForIBSS; /* For IBSS Mode, to keep use same BSSID to extend the life cycle of an IBSS */ - - BOOLEAN fgIsBeaconActivated; /* For AP/IBSS Mode, it is used to indicate that Beacon is sending */ - - P_MSDU_INFO_T prBeacon; /* For AP/IBSS Mode - Beacon Frame */ - - BOOLEAN fgIsIBSSMaster; /* For IBSS Mode - To indicate that we can reply ProbeResp Frame. - In current TBTT interval */ - - BOOLEAN fgIsShortPreambleAllowed; /* From Capability Info. of AssocResp Frame AND of Beacon/ProbeResp Frame */ - BOOLEAN fgUseShortPreamble; /* Short Preamble is enabled in current BSS. */ - BOOLEAN fgUseShortSlotTime; /* Short Slot Time is enabled in current BSS. */ - - UINT_16 u2OperationalRateSet; /* Operational Rate Set of current BSS */ - UINT_16 u2BSSBasicRateSet; /* Basic Rate Set of current BSS */ - - - UINT_8 ucAllSupportedRatesLen; /* Used for composing Beacon Frame in AdHoc or AP Mode */ - UINT_8 aucAllSupportedRates[RATE_NUM]; - - UINT_8 ucAssocClientCnt; /* TODO(Kevin): Number of associated clients */ - - BOOLEAN fgIsProtection; - BOOLEAN fgIsQBSS; /* fgIsWmmBSS; */ /* For Infra/AP/IBSS Mode, it is used to indicate if we support WMM in - * current BSS. */ - BOOLEAN fgIsNetAbsent; /* TRUE: BSS is absent, FALSE: BSS is present */ - - UINT_32 u4RsnSelectedGroupCipher; - UINT_32 u4RsnSelectedPairwiseCipher; - UINT_32 u4RsnSelectedAKMSuite; - UINT_16 u2RsnSelectedCapInfo; - - /*------------------------------------------------------------------------*/ - /* Power Management related information */ - /*------------------------------------------------------------------------*/ - PM_PROFILE_SETUP_INFO_T rPmProfSetupInfo; - - - /*------------------------------------------------------------------------*/ - /* WMM/QoS related information */ - /*------------------------------------------------------------------------*/ - UINT_8 ucWmmParamSetCount; /* Used to detect the change of EDCA parameters. For AP mode, the value is used in WMM IE */ - - AC_QUE_PARMS_T arACQueParms[WMM_AC_INDEX_NUM]; - - UINT_8 aucCWminLog2ForBcast[WMM_AC_INDEX_NUM]; /* For AP mode, broadcast the CWminLog2 */ - UINT_8 aucCWmaxLog2ForBcast[WMM_AC_INDEX_NUM]; /* For AP mode, broadcast the CWmaxLog2 */ - AC_QUE_PARMS_T arACQueParmsForBcast[WMM_AC_INDEX_NUM]; /* For AP mode, broadcast the value */ - - /*------------------------------------------------------------------------*/ - /* 802.11n HT operation IE when (prStaRec->ucPhyTypeSet & PHY_TYPE_BIT_HT)*/ - /* is true. They have the same definition with fields of */ - /* information element (CM) */ - /*------------------------------------------------------------------------*/ - ENUM_BAND_T eBand; - UINT_8 ucPrimaryChannel; - UINT_8 ucHtOpInfo1; - UINT_16 u2HtOpInfo2; - UINT_16 u2HtOpInfo3; - - /*------------------------------------------------------------------------*/ - /* Required protection modes (CM) */ - /*------------------------------------------------------------------------*/ - BOOLEAN fgErpProtectMode; - ENUM_HT_PROTECT_MODE_T eHtProtectMode; - ENUM_GF_MODE_T eGfOperationMode; - ENUM_RIFS_MODE_T eRifsOperationMode; - - BOOLEAN fgObssErpProtectMode; /* GO only */ - ENUM_HT_PROTECT_MODE_T eObssHtProtectMode; /* GO only */ - ENUM_GF_MODE_T eObssGfOperationMode; /* GO only */ - BOOLEAN fgObssRifsOperationMode; /* GO only */ - - /*------------------------------------------------------------------------*/ - /* OBSS to decide if 20/40M bandwidth is permitted. */ - /* The first member indicates the following channel list length. */ - /*------------------------------------------------------------------------*/ - BOOLEAN fgAssoc40mBwAllowed; - BOOLEAN fg40mBwAllowed; - ENUM_CHNL_EXT_T eBssSCO; /* Real setting for HW - * 20/40M AP mode will always set 40M, - * but its OP IE can be changed. - */ - UINT_8 auc2G_20mReqChnlList[CHNL_LIST_SZ_2G + 1]; - UINT_8 auc2G_NonHtChnlList[CHNL_LIST_SZ_2G + 1]; - UINT_8 auc2G_PriChnlList[CHNL_LIST_SZ_2G + 1]; - UINT_8 auc2G_SecChnlList[CHNL_LIST_SZ_2G + 1]; - - UINT_8 auc5G_20mReqChnlList[CHNL_LIST_SZ_5G + 1]; - UINT_8 auc5G_NonHtChnlList[CHNL_LIST_SZ_5G + 1]; - UINT_8 auc5G_PriChnlList[CHNL_LIST_SZ_5G + 1]; - UINT_8 auc5G_SecChnlList[CHNL_LIST_SZ_5G + 1]; - - TIMER_T rObssScanTimer; - UINT_16 u2ObssScanInterval; /* in unit of sec */ - - BOOLEAN fgObssActionForcedTo20M; /* GO only */ - BOOLEAN fgObssBeaconForcedTo20M; /* GO only */ - - /*------------------------------------------------------------------------*/ - /* HW Related Fields (Kevin) */ - /*------------------------------------------------------------------------*/ - UINT_8 ucHwDefaultFixedRateCode; /* The default rate code copied to MAC TX Desc */ - UINT_16 u2HwLPWakeupGuardTimeUsec; - - - UINT_8 ucBssFreeQuota; /* The value is updated from FW */ -}; - - -struct _AIS_SPECIFIC_BSS_INFO_T { - UINT_8 ucRoamingAuthTypes; /* This value indicate the roaming type used in AIS_JOIN */ - - BOOLEAN fgIsIBSSActive; - - /*! \brief Global flag to let arbiter stay at standby and not connect to any network */ - BOOLEAN fgCounterMeasure; - UINT_8 ucWEPDefaultKeyID; - BOOLEAN fgTransmitKeyExist; /* Legacy wep Transmit key exist or not */ - - /* While Do CounterMeasure procedure, check the EAPoL Error report have send out */ - BOOLEAN fgCheckEAPoLTxDone; - - UINT_32 u4RsnaLastMICFailTime; - - /* Stored the current bss wpa rsn cap filed, used for roaming policy */ - //UINT_16 u2RsnCap; - TIMER_T rPreauthenticationTimer; - - /* By the flow chart of 802.11i, - wait 60 sec before associating to same AP - or roaming to a new AP - or sending data in IBSS, - keep a timer for handle the 60 sec counterMeasure */ - TIMER_T rRsnaBlockTrafficTimer; - TIMER_T rRsnaEAPoLReportTimeoutTimer; - - /* For Keep the Tx/Rx Mic key for TKIP SW Calculate Mic */ - /* This is only one for AIS/AP */ - UINT_8 aucTxMicKey[8]; - UINT_8 aucRxMicKey[8]; - - /* Buffer for WPA2 PMKID */ - /* The PMKID cache lifetime is expire by media_disconnect_indication */ - UINT_32 u4PmkidCandicateCount; - PMKID_CANDICATE_T arPmkidCandicate[CFG_MAX_PMKID_CACHE]; - UINT_32 u4PmkidCacheCount; - PMKID_ENTRY_T arPmkidCache[CFG_MAX_PMKID_CACHE]; - BOOLEAN fgIndicatePMKID; -#if CFG_SUPPORT_802_11W - BOOLEAN fgMgmtProtection; - UINT_32 u4SaQueryStart; - UINT_32 u4SaQueryCount; - UINT_8 ucSaQueryTimedOut; - PUINT_8 pucSaQueryTransId; - TIMER_T rSaQueryTimer; - BOOLEAN fgBipKeyInstalled; -#endif -}; - -struct _BOW_SPECIFIC_BSS_INFO_T { - UINT_16 u2Reserved; /* Reserved for Data Type Check */ -}; - -#if CFG_SLT_SUPPORT -typedef struct _SLT_INFO_T { - - P_BSS_DESC_T prPseudoBssDesc; - UINT_16 u2SiteID; - UINT_8 ucChannel2G4; - UINT_8 ucChannel5G; - BOOLEAN fgIsDUT; - UINT_32 u4BeaconReceiveCnt; - /////////Deprecated///////// - P_STA_RECORD_T prPseudoStaRec; -} SLT_INFO_T, *P_SLT_INFO_T; -#endif - - -/* Major member variables for WiFi FW operation. - Variables within this region will be ready for access after WIFI function is enabled. -*/ -typedef struct _WIFI_VAR_T { - BOOLEAN fgIsRadioOff; - - BOOLEAN fgIsEnterD3ReqIssued; - - BOOLEAN fgDebugCmdResp; - - CONNECTION_SETTINGS_T rConnSettings; - - SCAN_INFO_T rScanInfo; - -#if CFG_SUPPORT_ROAMING - ROAMING_INFO_T rRoamingInfo; -#endif /* CFG_SUPPORT_ROAMING */ - - AIS_FSM_INFO_T rAisFsmInfo; - - ENUM_PWR_STATE_T aePwrState[NETWORK_TYPE_INDEX_NUM]; - - BSS_INFO_T arBssInfo[NETWORK_TYPE_INDEX_NUM]; - - AIS_SPECIFIC_BSS_INFO_T rAisSpecificBssInfo; - -#if CFG_ENABLE_WIFI_DIRECT - P_P2P_CONNECTION_SETTINGS_T prP2PConnSettings; - - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo; - - P_P2P_FSM_INFO_T prP2pFsmInfo; -#endif /* CFG_ENABLE_WIFI_DIRECT */ - -#if CFG_ENABLE_BT_OVER_WIFI - BOW_SPECIFIC_BSS_INFO_T rBowSpecificBssInfo; - BOW_FSM_INFO_T rBowFsmInfo; -#endif /* CFG_ENABLE_BT_OVER_WIFI */ - - DEAUTH_INFO_T arDeauthInfo[MAX_DEAUTH_INFO_COUNT]; - - /* Current Wi-Fi Settings and Flags */ - UINT_8 aucPermanentAddress[MAC_ADDR_LEN]; - UINT_8 aucMacAddress[MAC_ADDR_LEN]; - UINT_8 aucDeviceAddress[MAC_ADDR_LEN]; - UINT_8 aucInterfaceAddress[MAC_ADDR_LEN]; - - UINT_8 ucAvailablePhyTypeSet; - - ENUM_PHY_TYPE_INDEX_T eNonHTBasicPhyType2G4; /* Basic Phy Type used by SCN according - * to the set of Available PHY Types - */ - - ENUM_PARAM_PREAMBLE_TYPE_T ePreambleType; - ENUM_REGISTRY_FIXED_RATE_T eRateSetting; - - BOOLEAN fgIsShortSlotTimeOptionEnable; - /* User desired setting, but will honor the capability of AP */ - - BOOLEAN fgEnableJoinToHiddenSSID; - BOOLEAN fgSupportWZCDisassociation; - - BOOLEAN fgSupportQoS; - BOOLEAN fgSupportAmpduTx; - BOOLEAN fgSupportAmpduRx; - BOOLEAN fgSupportTspec; - BOOLEAN fgSupportUAPSD; - BOOLEAN fgSupportULPSMP; - -#if CFG_SLT_SUPPORT - SLT_INFO_T rSltInfo; -#endif - -} WIFI_VAR_T, *P_WIFI_VAR_T;/* end of _WIFI_VAR_T */ - -/* cnm_timer module */ -typedef struct { - LINK_T rLinkHead; - OS_SYSTIME rNextExpiredSysTime; - KAL_WAKE_LOCK_T rWakeLock; - BOOLEAN fgWakeLocked; -} ROOT_TIMER, *P_ROOT_TIMER; - - -/* FW/DRV/NVRAM version information */ -typedef struct { - - /* NVRAM or Registry */ - UINT_16 u2Part1CfgOwnVersion; - UINT_16 u2Part1CfgPeerVersion; - UINT_16 u2Part2CfgOwnVersion; - UINT_16 u2Part2CfgPeerVersion; - - /* Firmware */ - UINT_16 u2FwProductID; - UINT_16 u2FwOwnVersion; - UINT_16 u2FwPeerVersion; - -} WIFI_VER_INFO_T, *P_WIFI_VER_INFO_T; - - -#if CFG_ENABLE_WIFI_DIRECT -/* -* p2p function pointer structure -*/ - -typedef struct _P2P_FUNCTION_LINKER { - P2P_REMOVE prP2pRemove; -// NIC_P2P_MEDIA_STATE_CHANGE prNicP2pMediaStateChange; -// SCAN_UPDATE_P2P_DEVICE_DESC prScanUpdateP2pDeviceDesc; -// P2P_FSM_RUN_EVENT_RX_PROBE_RESPONSE_FRAME prP2pFsmRunEventRxProbeResponseFrame; - P2P_GENERATE_P2P_IE prP2pGenerateWSC_IEForBeacon; -// P2P_CALCULATE_WSC_IE_LEN_FOR_PROBE_RSP prP2pCalculateWSC_IELenForProbeRsp; -// P2P_GENERATE_WSC_IE_FOR_PROBE_RSP prP2pGenerateWSC_IEForProbeRsp; -// SCAN_REMOVE_P2P_BSS_DESC prScanRemoveP2pBssDesc; -// P2P_HANDLE_SEC_CHECK_RSP prP2pHandleSecCheckRsp; - P2P_NET_REGISTER prP2pNetRegister; - P2P_NET_UNREGISTER prP2pNetUnregister; - P2P_CALCULATE_P2P_IE_LEN prP2pCalculateP2p_IELenForAssocReq; /* All IEs generated from supplicant. */ - P2P_GENERATE_P2P_IE prP2pGenerateP2p_IEForAssocReq; /* All IEs generated from supplicant. */ -} P2P_FUNCTION_LINKER, *P_P2P_FUNCTION_LINKER; - - -#endif - -/* - * Major ADAPTER structure - * Major data structure for driver operation - */ -struct _ADAPTER_T { - UINT_8 ucRevID; - - UINT_16 u2NicOpChnlNum; - - BOOLEAN fgIsEnableWMM; - BOOLEAN fgIsWmmAssoc; /* This flag is used to indicate that WMM is enable in current BSS */ - - UINT_32 u4OsPacketFilter; // packet filter used by OS - - -#if CFG_TCP_IP_CHKSUM_OFFLOAD - UINT_32 u4CSUMFlags; -#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */ - - - ENUM_BAND_T aePreferBand[NETWORK_TYPE_INDEX_NUM]; - - /* ADAPTER flags */ - UINT_32 u4Flags; - UINT_32 u4HwFlags; - - BOOLEAN fgIsRadioOff; - - BOOLEAN fgIsEnterD3ReqIssued; - - UINT_8 aucMacAddress[MAC_ADDR_LEN]; - - ENUM_PHY_TYPE_INDEX_T eCurrentPhyType; /* Current selection basing on the set of Available PHY Types */ - -#if CFG_COALESCING_BUFFER_SIZE || CFG_SDIO_RX_AGG - UINT_32 u4CoalescingBufCachedSize; - PUINT_8 pucCoalescingBufCached; -#endif /* CFG_COALESCING_BUFFER_SIZE */ - - /* Buffer for CMD_INFO_T, Mgt packet and mailbox message */ - BUF_INFO_T rMgtBufInfo; - BUF_INFO_T rMsgBufInfo; - PUINT_8 pucMgtBufCached; - UINT_32 u4MgtBufCachedSize; - UINT_8 aucMsgBuf[MSG_BUFFER_SIZE]; -#if CFG_DBG_MGT_BUF - UINT_32 u4MemAllocDynamicCount; /* Debug only */ - UINT_32 u4MemFreeDynamicCount; /* Debug only */ -#endif - - STA_RECORD_T arStaRec[CFG_STA_REC_NUM]; - - /* Element for TX PATH */ - TX_CTRL_T rTxCtrl; - QUE_T rFreeCmdList; - CMD_INFO_T arHifCmdDesc[CFG_TX_MAX_CMD_PKT_NUM]; - - /* Element for RX PATH */ - RX_CTRL_T rRxCtrl; - - P_SDIO_CTRL_T prSDIOCtrl; - -#if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1) - /* Element for MT6620 E1 HIFSYS workaround */ - BOOLEAN fgIsClockGatingEnabled; -#endif - - /* Buffer for Authentication Event */ - /* Move to glue layer and refine the kal function */ - /* Reference to rsnGeneratePmkidIndication function at rsn.c */ - UINT_8 aucIndicationEventBuffer[(CFG_MAX_PMKID_CACHE * 20) + 8 ]; - - UINT_32 u4IntStatus; - - ENUM_ACPI_STATE_T rAcpiState; - - BOOLEAN fgIsIntEnable; - BOOLEAN fgIsIntEnableWithLPOwnSet; - - BOOLEAN fgIsFwOwn; - BOOLEAN fgWiFiInSleepyState; - - UINT_32 u4PwrCtrlBlockCnt; - - QUE_T rPendingCmdQueue; - - P_GLUE_INFO_T prGlueInfo; - - UINT_8 ucCmdSeqNum; - UINT_8 ucTxSeqNum; - -#if 1//CFG_SUPPORT_WAPI - BOOLEAN fgUseWapi; -#endif - - /* RF Test flags */ - BOOLEAN fgTestMode; - - /* WLAN Info for DRIVER_CORE OID query */ - WLAN_INFO_T rWlanInfo; - -#if CFG_ENABLE_WIFI_DIRECT - BOOLEAN fgIsP2PRegistered; - ENUM_NET_REG_STATE_T rP2PNetRegState; - BOOLEAN fgIsWlanLaunched; - P_P2P_INFO_T prP2pInfo; -#if CFG_SUPPORT_P2P_RSSI_QUERY - OS_SYSTIME rP2pLinkQualityUpdateTime; - BOOLEAN fgIsP2pLinkQualityValid; - EVENT_LINK_QUALITY rP2pLinkQuality; -#endif -#endif - - /* Online Scan Option */ - BOOLEAN fgEnOnlineScan; - - /* Online Scan Option */ - BOOLEAN fgDisBcnLostDetection; - - /* MAC address */ - PARAM_MAC_ADDRESS rMyMacAddr; - - /* Wake-up Event for WOL */ - UINT_32 u4WakeupEventEnable; - - /* Event Buffering */ - EVENT_STATISTICS rStatStruct; - OS_SYSTIME rStatUpdateTime; - BOOLEAN fgIsStatValid; - - EVENT_LINK_QUALITY rLinkQuality; - OS_SYSTIME rLinkQualityUpdateTime; - BOOLEAN fgIsLinkQualityValid; - OS_SYSTIME rLinkRateUpdateTime; - BOOLEAN fgIsLinkRateValid; - - /* WIFI_VAR_T */ - WIFI_VAR_T rWifiVar; - - /* MTK WLAN NIC driver IEEE 802.11 MIB */ - IEEE_802_11_MIB_T rMib; - - /* Mailboxs for inter-module communication */ - MBOX_T arMbox[MBOX_ID_TOTAL_NUM]; - - /* Timers for OID Pending Handling */ - TIMER_T rOidTimeoutTimer; - - /* Root Timer for cnm_timer module */ - ROOT_TIMER rRootTimer; - - /* RLM maintenance */ - ENUM_CHNL_EXT_T eRfSco; - ENUM_SYS_PROTECT_MODE_T eSysProtectMode; - ENUM_GF_MODE_T eSysHtGfMode; - ENUM_RIFS_MODE_T eSysTxRifsMode; - ENUM_SYS_PCO_PHASE_T eSysPcoPhase; - - P_DOMAIN_INFO_ENTRY prDomainInfo; - - /* QM */ - QUE_MGT_T rQM; - - CNM_INFO_T rCnmInfo; - - UINT_32 u4PowerMode; - - UINT_32 u4CtiaPowerMode; - BOOLEAN fgEnCtiaPowerMode; - - UINT_32 fgEnArpFilter; - - UINT_32 u4UapsdAcBmp; - - UINT_32 u4MaxSpLen; - - UINT_32 u4PsCurrentMeasureEn; - - /* Version Information */ - WIFI_VER_INFO_T rVerInfo; - - /* 5GHz support (from F/W) */ - BOOLEAN fgIsHw5GBandDisabled; - BOOLEAN fgEnable5GBand; - BOOLEAN fgIsEepromUsed; - BOOLEAN fgIsEfuseValid; - BOOLEAN fgIsEmbbededMacAddrValid; - - /* Packet Forwarding Tracking */ - INT_32 i4PendingFwdFrameCount; - -#if CFG_SUPPORT_RDD_TEST_MODE - UINT_8 ucRddStatus; -#endif - - BOOL fgDisStaAgingTimeoutDetection; - -};/* end of _ADAPTER_T */ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/* Macros for BSS_INFO_T - Flag of Net Active */ -/*----------------------------------------------------------------------------*/ -#define IS_NET_ACTIVE(_prAdapter, _NetTypeIndex) \ - (_prAdapter->rWifiVar.arBssInfo[(_NetTypeIndex)].fgIsNetActive) -#define IS_BSS_ACTIVE(_prBssInfo) ((_prBssInfo)->fgIsNetActive) - -#define IS_AIS_ACTIVE(_prAdapter) IS_NET_ACTIVE(_prAdapter, NETWORK_TYPE_AIS_INDEX) -#define IS_P2P_ACTIVE(_prAdapter) IS_NET_ACTIVE(_prAdapter, NETWORK_TYPE_P2P_INDEX) -#define IS_BOW_ACTIVE(_prAdapter) IS_NET_ACTIVE(_prAdapter, NETWORK_TYPE_BOW_INDEX) - -#define SET_NET_ACTIVE(_prAdapter, _NetTypeIndex) \ - {_prAdapter->rWifiVar.arBssInfo[(_NetTypeIndex)].fgIsNetActive = TRUE;} - -#define UNSET_NET_ACTIVE(_prAdapter, _NetTypeIndex) \ - {_prAdapter->rWifiVar.arBssInfo[(_NetTypeIndex)].fgIsNetActive = FALSE;} - -#define BSS_INFO_INIT(_prAdapter, _NetTypeIndex) \ - { UINT_8 _aucZeroMacAddr[] = NULL_MAC_ADDR; \ - P_BSS_INFO_T _prBssInfo = &(_prAdapter->rWifiVar.arBssInfo[(_NetTypeIndex)]); \ - \ - _prBssInfo->eConnectionState = PARAM_MEDIA_STATE_DISCONNECTED; \ - _prBssInfo->eConnectionStateIndicated = PARAM_MEDIA_STATE_DISCONNECTED; \ - _prBssInfo->eCurrentOPMode = OP_MODE_INFRASTRUCTURE; \ - _prBssInfo->fgIsNetActive = FALSE; \ - _prBssInfo->ucNetTypeIndex = (_NetTypeIndex); \ - _prBssInfo->ucReasonOfDisconnect = DISCONNECT_REASON_CODE_RESERVED; \ - COPY_MAC_ADDR(_prBssInfo->aucBSSID, _aucZeroMacAddr); \ - LINK_INITIALIZE(&_prBssInfo->rStaRecOfClientList); \ - _prBssInfo->fgIsBeaconActivated = FALSE; \ - _prBssInfo->ucHwDefaultFixedRateCode = RATE_CCK_1M_LONG; \ - _prBssInfo->fgIsNetAbsent = FALSE; \ - } - -#if CFG_ENABLE_BT_OVER_WIFI -#define BOW_BSS_INFO_INIT(_prAdapter, _NetTypeIndex) \ - { \ - P_BSS_INFO_T _prBssInfo = &(_prAdapter->rWifiVar.arBssInfo[(_NetTypeIndex)]); \ - \ - _prBssInfo->eConnectionState = PARAM_MEDIA_STATE_DISCONNECTED; \ - _prBssInfo->eConnectionStateIndicated = PARAM_MEDIA_STATE_DISCONNECTED; \ - _prBssInfo->eCurrentOPMode = OP_MODE_BOW; \ - _prBssInfo->ucNetTypeIndex = (_NetTypeIndex); \ - _prBssInfo->ucReasonOfDisconnect = DISCONNECT_REASON_CODE_RESERVED; \ - LINK_INITIALIZE(&_prBssInfo->rStaRecOfClientList); \ - _prBssInfo->fgIsBeaconActivated = TRUE; \ - _prBssInfo->ucHwDefaultFixedRateCode = RATE_CCK_1M_LONG; \ - _prBssInfo->fgIsNetAbsent = FALSE; \ - } -#endif - -/*----------------------------------------------------------------------------*/ -/* Macros for Power State */ -/*----------------------------------------------------------------------------*/ -#define SET_NET_PWR_STATE_IDLE(_prAdapter, _NetTypeIndex) \ - {_prAdapter->rWifiVar.aePwrState[(_NetTypeIndex)] = PWR_STATE_IDLE;} - -#define SET_NET_PWR_STATE_ACTIVE(_prAdapter, _NetTypeIndex) \ - {_prAdapter->rWifiVar.aePwrState[(_NetTypeIndex)] = PWR_STATE_ACTIVE;} - -#define SET_NET_PWR_STATE_PS(_prAdapter, _NetTypeIndex) \ - {_prAdapter->rWifiVar.aePwrState[(_NetTypeIndex)] = PWR_STATE_PS;} - -#define IS_NET_PWR_STATE_ACTIVE(_prAdapter, _NetTypeIndex) \ - (_prAdapter->rWifiVar.aePwrState[(_NetTypeIndex)] == PWR_STATE_ACTIVE) - -#define IS_NET_PWR_STATE_IDLE(_prAdapter, _NetTypeIndex) \ - (_prAdapter->rWifiVar.aePwrState[(_NetTypeIndex)] == PWR_STATE_IDLE) - -#define IS_SCN_PWR_STATE_ACTIVE(_prAdapter) \ - (_prAdapter->rWifiVar.rScanInfo.eScanPwrState == SCAN_PWR_STATE_ACTIVE) - -#define IS_SCN_PWR_STATE_IDLE(_prAdapter) \ - (_prAdapter->rWifiVar.rScanInfo.eScanPwrState == SCAN_PWR_STATE_IDLE) - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _ADAPTER_H */ - - diff --git a/drivers/net/wireless/mt5931/include/nic/bow.h b/drivers/net/wireless/mt5931/include/nic/bow.h deleted file mode 100755 index d0be930e2a61..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/bow.h +++ /dev/null @@ -1,323 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/bow.h#1 $ -*/ - - - -/* -** $Log: bow.h $ - * - * 01 16 2012 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Support BOW for 5GHz band. - * - * 05 25 2011 terry.wu - * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment - * Add BoW Cancel Scan Request and Turn On deactive network function. - * - * 05 22 2011 terry.wu - * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment - * Submit missing BoW header files. - * - * 03 27 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Support multiple physical link. - * - * 03 06 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Sync BOW Driver to latest person development branch version.. - * - * 02 10 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Fix kernel API change issue. - * Before ALPS 2.2 (2.2 included), kfifo_alloc() is - * struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, spinlock_t *lock); - * After ALPS 2.3, kfifo_alloc() is changed to - * int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask); - * - * 02 10 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Update BOW structure. - * - * 02 09 2011 cp.wu - * [WCXRP00000430] [MT6620 Wi-Fi][Firmware][Driver] Create V1.2 branch for MT6620E1 and MT6620E3 - * create V1.2 driver branch based on label MT6620_WIFI_DRIVER_V1_2_110209_1031 - * with BOW and P2P enabled as default - * - * 02 08 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Replace kfifo_get and kfifo_put with kfifo_out and kfifo_in. - * Update BOW get MAC status, remove returning event for AIS network type. - * - * 01 11 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add Activity Report definition. - * - * 10 18 2010 chinghwa.yu - * [WCXRP00000110] [MT6620 Wi-Fi] [Driver] Fix BoW Connected event size - * Fix wrong BoW event size. - * - * 07 15 2010 cp.wu - * - * sync. bluetooth-over-Wi-Fi interface to driver interface document v0.2.6. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * 1) all BT physical handles shares the same RSSI/Link Quality. - * 2) simplify BT command composing - * - * 04 28 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * change prefix for data structure used to communicate with 802.11 PAL - * to avoid ambiguous naming with firmware interface - * - * 04 27 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * basic implementation for EVENT_BT_OVER_WIFI - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * * * * * 2) command sequence number is now increased atomically - * * * * * * * 3) private data could be hold and taken use for other purpose - * - * 04 09 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * sync. with design document for interface change. - * - * 04 02 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * Wi-Fi driver no longer needs to implement 802.11 PAL, thus replaced by wrapping command/event definitions - * - * 03 16 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * correct typo. - * - * 03 16 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * update for all command/event needed to be supported by 802.11 PAL. - * - * 03 16 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * build up basic data structure and definitions to support BT-over-WiFi - * -*/ - -#ifndef _BOW_H_ -#define _BOW_H_ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -#define BOWDEVNAME "bow0" - -#define MAX_BOW_NUMBER_OF_CHANNEL_2G4 14 -#define MAX_BOW_NUMBER_OF_CHANNEL_5G 4 -#define MAX_BOW_NUMBER_OF_CHANNEL 18 //(MAX_BOW_NUMBER_OF_CHANNEL_2G4 + MAX_BOW_NUMBER_OF_CHANNEL_5G) - -#define MAX_ACTIVITY_REPORT 2 -#define MAX_ACTIVITY_REPROT_TIME 660 - -#define ACTIVITY_REPORT_STATUS_SUCCESS 0 -#define ACTIVITY_REPORT_STATUS_FAILURE 1 -#define ACTIVITY_REPORT_STATUS_TIME_INVALID 2 -#define ACTIVITY_REPORT_STATUS_OTHERS 3 - -#define ACTIVITY_REPORT_SCHEDULE_UNKNOWN 0 //Does not know the schedule of the interference -#define ACTIVITY_REPORT_SCHEDULE_KNOWN 1 - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef struct _BT_OVER_WIFI_COMMAND_HEADER_T { - UINT_8 ucCommandId; - UINT_8 ucSeqNumber; - UINT_16 u2PayloadLength; -} AMPC_COMMAND_HEADER_T, *P_AMPC_COMMAND_HEADER_T; - -typedef struct _BT_OVER_WIFI_COMMAND { - AMPC_COMMAND_HEADER_T rHeader; - UINT_8 aucPayload[0]; -} AMPC_COMMAND, *P_AMPC_COMMAND; - -typedef struct _BT_OVER_WIFI_EVENT_HEADER_T { - UINT_8 ucEventId; - UINT_8 ucSeqNumber; - UINT_16 u2PayloadLength; -} AMPC_EVENT_HEADER_T, *P_AMPC_EVENT_HEADER_T; - -typedef struct _BT_OVER_WIFI_EVENT { - AMPC_EVENT_HEADER_T rHeader; - UINT_8 aucPayload[0]; -} AMPC_EVENT, *P_AMPC_EVENT; - -typedef struct _CHANNEL_DESC_T { - UINT_8 ucChannelBand; - UINT_8 ucChannelNum; -} CHANNEL_DESC, P_CHANNEL_DESC; - -// Command Structures -typedef struct _BOW_SETUP_CONNECTION { -//Fixed to 2.4G - UINT_8 ucChannelNum; - UINT_8 ucReserved1; - UINT_8 aucPeerAddress[6]; - UINT_16 u2BeaconInterval; - UINT_8 ucTimeoutDiscovery; - UINT_8 ucTimeoutInactivity; - UINT_8 ucRole; - UINT_8 ucPAL_Capabilities; - INT_8 cMaxTxPower; - UINT_8 ucReserved2; - -//Pending, for future BOW 5G supporting. -/* UINT_8 aucPeerAddress[6]; - UINT_16 u2BeaconInterval; - UINT_8 ucTimeoutDiscovery; - UINT_8 ucTimeoutInactivity; - UINT_8 ucRole; - UINT_8 ucPAL_Capabilities; - INT_8 cMaxTxPower; - UINT_8 ucChannelListNum; - CHANNEL_DESC arChannelList[1]; -*/ -} BOW_SETUP_CONNECTION, *P_BOW_SETUP_CONNECTION; - -typedef struct _BOW_DESTROY_CONNECTION { - UINT_8 aucPeerAddress[6]; - UINT_8 aucReserved[2]; -} BOW_DESTROY_CONNECTION, *P_BOW_DESTROY_CONNECTION; - -typedef struct _BOW_SET_PTK { - UINT_8 aucPeerAddress[6]; - UINT_8 aucReserved[2]; - UINT_8 aucTemporalKey[16]; -} BOW_SET_PTK, *P_BOW_SET_PTK; - -typedef struct _BOW_READ_RSSI { - UINT_8 aucPeerAddress[6]; - UINT_8 aucReserved[2]; -} BOW_READ_RSSI, *P_BOW_READ_RSSI; - -typedef struct _BOW_READ_LINK_QUALITY { - UINT_8 aucPeerAddress[6]; - UINT_8 aucReserved[2]; -} BOW_READ_LINK_QUALITY, *P_BOW_READ_LINK_QUALITY; - -typedef struct _BOW_SHORT_RANGE_MODE { - UINT_8 aucPeerAddress[6]; - INT_8 cTxPower; - UINT_8 ucReserved; -} BOW_SHORT_RANGE_MODE, *P_BOW_SHORT_RANGE_MODE; - -// Event Structures -typedef struct _BOW_COMMAND_STATUS { - UINT_8 ucStatus; - UINT_8 ucReserved[3]; -} BOW_COMMAND_STATUS, *P_BOW_COMMAND_STATUS; - -typedef struct _BOW_MAC_STATUS { - UINT_8 aucMacAddr[6]; - UINT_8 ucAvailability; - UINT_8 ucNumOfChannel; - CHANNEL_DESC arChannelList[MAX_BOW_NUMBER_OF_CHANNEL]; -} BOW_MAC_STATUS, *P_BOW_MAC_STATUS; - -typedef struct _BOW_LINK_CONNECTED { - CHANNEL_DESC rChannel; - UINT_8 aucReserved; - UINT_8 aucPeerAddress[6]; -} BOW_LINK_CONNECTED, *P_BOW_LINK_CONNECTED; - -typedef struct _BOW_LINK_DISCONNECTED { - UINT_8 ucReason; - UINT_8 aucReserved; - UINT_8 aucPeerAddress[6]; -} BOW_LINK_DISCONNECTED, *P_BOW_LINK_DISCONNECTED; - -typedef struct _BOW_RSSI { - INT_8 cRssi; - UINT_8 aucReserved[3]; -} BOW_RSSI, *P_BOW_RSSI; - -typedef struct _BOW_LINK_QUALITY { - UINT_8 ucLinkQuality; - UINT_8 aucReserved[3]; -} BOW_LINK_QUALITY, *P_BOW_LINK_QUALITY; - -typedef enum _ENUM_BOW_CMD_ID_T { - BOW_CMD_ID_GET_MAC_STATUS = 1, - BOW_CMD_ID_SETUP_CONNECTION, - BOW_CMD_ID_DESTROY_CONNECTION, - BOW_CMD_ID_SET_PTK, - BOW_CMD_ID_READ_RSSI, - BOW_CMD_ID_READ_LINK_QUALITY, - BOW_CMD_ID_SHORT_RANGE_MODE, - BOW_CMD_ID_GET_CHANNEL_LIST, -} ENUM_BOW_CMD_ID_T, *P_ENUM_BOW_CMD_ID_T; - -typedef enum _ENUM_BOW_EVENT_ID_T { - BOW_EVENT_ID_COMMAND_STATUS = 1, - BOW_EVENT_ID_MAC_STATUS, - BOW_EVENT_ID_LINK_CONNECTED, - BOW_EVENT_ID_LINK_DISCONNECTED, - BOW_EVENT_ID_RSSI, - BOW_EVENT_ID_LINK_QUALITY, - BOW_EVENT_ID_CHANNEL_LIST, - BOW_EVENT_ID_CHANNEL_SELECTED, -} ENUM_BOW_EVENT_ID_T, *P_ENUM_BOW_EVENT_ID_T; - -typedef enum _ENUM_BOW_DEVICE_STATE { - BOW_DEVICE_STATE_DISCONNECTED = 0, - BOW_DEVICE_STATE_DISCONNECTING, - BOW_DEVICE_STATE_ACQUIRING_CHANNEL, - BOW_DEVICE_STATE_STARTING, - BOW_DEVICE_STATE_SCANNING, - BOW_DEVICE_STATE_CONNECTING, - BOW_DEVICE_STATE_CONNECTED, - BOW_DEVICE_STATE_NUM -} ENUM_BOW_DEVICE_STATE, *P_ENUM_BOW_DEVICE_STATE; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -#endif /*_BOW_H */ diff --git a/drivers/net/wireless/mt5931/include/nic/cmd_buf.h b/drivers/net/wireless/mt5931/include/nic/cmd_buf.h deleted file mode 100755 index 2bb10b9b1390..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/cmd_buf.h +++ /dev/null @@ -1,176 +0,0 @@ -/* -** $Id: -*/ - -/*! \file "cmd_buf.h" - \brief In this file we define the structure for Command Packet. - - In this file we define the structure for Command Packet and the control unit - of MGMT Memory Pool. -*/ - - - -/* -** $Log: cmd_buf.h $ - * - * 10 04 2010 cp.wu - * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only - * remove ENUM_NETWORK_TYPE_T definitions - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 07 13 2010 cp.wu - * - * 1) MMPDUs are now sent to MT6620 by CMD queue for keeping strict order of 1X/MMPDU/CMD packets - * 2) integrate with qmGetFrameAction() for deciding which MMPDU/1X could pass checking for sending - * 2) enhance CMD_INFO_T descriptor number from 10 to 32 to avoid descriptor underflow under concurrent network operation - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 01 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Enable change log -*/ - -#ifndef _CMD_BUF_H -#define _CMD_BUF_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -typedef enum _COMMAND_TYPE { - COMMAND_TYPE_GENERAL_IOCTL, - COMMAND_TYPE_NETWORK_IOCTL, - COMMAND_TYPE_SECURITY_FRAME, - COMMAND_TYPE_MANAGEMENT_FRAME, - COMMAND_TYPE_NUM -} COMMAND_TYPE, *P_COMMAND_TYPE; - -typedef VOID (*PFN_CMD_DONE_HANDLER) ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -typedef VOID (*PFN_CMD_TIMEOUT_HANDLER) ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ); - -struct _CMD_INFO_T { - QUE_ENTRY_T rQueEntry; - - COMMAND_TYPE eCmdType; - - UINT_16 u2InfoBufLen; /* This is actual CMD buffer length */ - PUINT_8 pucInfoBuffer; /* May pointer to structure in prAdapter */ - P_NATIVE_PACKET prPacket; /* only valid when it's a security frame */ - - ENUM_NETWORK_TYPE_INDEX_T eNetworkType; - UINT_8 ucStaRecIndex; /* only valid when it's a security frame */ - - PFN_CMD_DONE_HANDLER pfCmdDoneHandler; - PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler; - - BOOLEAN fgIsOid; /* Used to check if we need indicate */ - - UINT_8 ucCID; - BOOLEAN fgSetQuery; - BOOLEAN fgNeedResp; - BOOLEAN fgDriverDomainMCR; /* Access Driver Domain MCR, for CMD_ID_ACCESS_REG only */ - UINT_8 ucCmdSeqNum; - UINT_32 u4SetInfoLen; /* Indicate how many byte we read for Set OID */ - - /* information indicating by OID/ioctl */ - PVOID pvInformationBuffer; - UINT_32 u4InformationBufferLength; - - /* private data */ - UINT_32 u4PrivateData; -}; - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -VOID -cmdBufInitialize ( - IN P_ADAPTER_T prAdapter - ); - -P_CMD_INFO_T -cmdBufAllocateCmdInfo ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Length - ); - -VOID -cmdBufFreeCmdInfo ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ); - -/*----------------------------------------------------------------------------*/ -/* Routines for CMDs */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanSendSetQueryCmd ( - IN P_ADAPTER_T prAdapter, - UINT_8 ucCID, - BOOLEAN fgSetQuery, - BOOLEAN fgNeedResp, - BOOLEAN fgIsOid, - PFN_CMD_DONE_HANDLER pfCmdDoneHandler, - PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler, - UINT_32 u4SetQueryInfoLen, - PUINT_8 pucInfoBuffer, - OUT PVOID pvSetQueryBuffer, - IN UINT_32 u4SetQueryBufferLen - ); - - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#endif /* _CMD_BUF_H */ - - diff --git a/drivers/net/wireless/mt5931/include/nic/hal.h b/drivers/net/wireless/mt5931/include/nic/hal.h deleted file mode 100755 index e67727d7653d..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/hal.h +++ /dev/null @@ -1,609 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/hal.h#1 $ -*/ - -/*! \file "hal.h" - \brief The declaration of hal functions - - N/A -*/ - - - -/* -** $Log: hal.h $ - * - * 04 01 2011 tsaiyuan.hsu - * [WCXRP00000615] [MT 6620 Wi-Fi][Driver] Fix klocwork issues - * fix the klocwork issues, 57500, 57501, 57502 and 57503. - * - * 03 21 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * portability improvement - * - * 03 07 2011 terry.wu - * [WCXRP00000521] [MT6620 Wi-Fi][Driver] Remove non-standard debug message - * Toggle non-standard debug messages to comments. - * - * 11 08 2010 cp.wu - * [WCXRP00000166] [MT6620 Wi-Fi][Driver] use SDIO CMD52 for enabling/disabling interrupt to reduce transaction period - * change to use CMD52 for enabling/disabling interrupt to reduce SDIO transaction time - * - * 09 01 2010 cp.wu - * NULL - * move HIF CR initialization from where after sdioSetupCardFeature() to wlanAdapterStart() - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 15 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * change zero-padding for TX port access to HAL. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access for prGlueInfo->fgIsCardRemoved in non-glue layer - * - * 01 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. eliminate improper variable in rHifInfo - * * * * 2. block TX/ordinary OID when RF test mode is engaged - * * * * 3. wait until firmware finish operation when entering into and leaving from RF test mode - * * * * 4. correct some HAL implementation -** \main\maintrunk.MT6620WiFiDriver_Prj\17 2009-12-16 18:02:26 GMT mtk02752 -** include precomp.h -** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-12-10 16:43:16 GMT mtk02752 -** code clean -** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-11-13 13:54:15 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-11-11 10:36:01 GMT mtk01084 -** modify HAL functions -** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-11-09 22:56:28 GMT mtk01084 -** modify HW access routines -** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-10-29 19:50:09 GMT mtk01084 -** add new macro HAL_TX_PORT_WR -** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-10-23 16:08:10 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-10-13 21:58:50 GMT mtk01084 -** update for new HW architecture design -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-05-18 14:28:10 GMT mtk01084 -** fix issue in HAL_DRIVER_OWN_BY_SDIO_CMD52() -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-05-11 17:26:33 GMT mtk01084 -** modify the bit definition to check driver own status -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-28 10:30:22 GMT mtk01461 -** Fix typo -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-01 10:50:34 GMT mtk01461 -** Redefine HAL_PORT_RD/WR macro for SW pre test -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-03-24 09:46:49 GMT mtk01084 -** fix LINT error -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-23 16:53:38 GMT mtk01084 -** add HAL_DRIVER_OWN_BY_SDIO_CMD52() -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-18 20:53:13 GMT mtk01426 -** Fixed lint warn -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:20 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _HAL_H -#define _HAL_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/* Macros for flag operations for the Adapter structure */ -#define HAL_SET_FLAG(_M, _F) ((_M)->u4HwFlags |= (_F)) -#define HAL_CLEAR_FLAG(_M, _F) ((_M)->u4HwFlags &= ~(_F)) -#define HAL_TEST_FLAG(_M, _F) ((_M)->u4HwFlags & (_F)) -#define HAL_TEST_FLAGS(_M, _F) (((_M)->u4HwFlags & (_F)) == (_F)) - -#if defined(_HIF_SDIO) -#define HAL_MCR_RD(_prAdapter, _u4Offset, _pu4Value) \ - { \ - if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \ - if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \ - ASSERT(0); \ - } \ - if (kalDevRegRead(_prAdapter->prGlueInfo, _u4Offset, _pu4Value) == FALSE) {\ - HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \ - fgIsBusAccessFailed = TRUE; \ - DBGLOG(HAL, ERROR, ("HAL_MCR_RD access fail! 0x%x: 0x%x \n", _u4Offset, *_pu4Value)); \ - } \ - } else { \ - DBGLOG(HAL, WARN, ("ignore HAL_MCR_RD access! 0x%x\n", _u4Offset)); \ - } \ - } - -#define HAL_MCR_WR(_prAdapter, _u4Offset, _u4Value) \ - { \ - if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \ - if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \ - ASSERT(0); \ - } \ - if (kalDevRegWrite(_prAdapter->prGlueInfo, _u4Offset, _u4Value) == FALSE) {\ - HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \ - fgIsBusAccessFailed = TRUE; \ - DBGLOG(HAL, ERROR, ("HAL_MCR_WR access fail! 0x%x: 0x%x \n", _u4Offset, _u4Value)); \ - } \ - } else { \ - DBGLOG(HAL, WARN, ("ignore HAL_MCR_WR access! 0x%x: 0x%x \n", _u4Offset, _u4Value)); \ - } \ - } - -#define HAL_PORT_RD(_prAdapter, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \ - { \ - /*fgResult = FALSE; */\ - if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \ - ASSERT(0); \ - } \ - if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \ - if (kalDevPortRead(_prAdapter->prGlueInfo, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) == FALSE) {\ - HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \ - fgIsBusAccessFailed = TRUE; \ - DBGLOG(HAL, ERROR, ("HAL_PORT_RD access fail! 0x%x\n", _u4Port)); \ - } \ - else { \ - /*fgResult = TRUE;*/ } \ - } else { \ - DBGLOG(HAL, WARN, ("ignore HAL_PORT_RD access! 0x%x\n", _u4Port)); \ - } \ - } - -#define HAL_PORT_WR(_prAdapter, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \ - { \ - /*fgResult = FALSE; */\ - if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \ - ASSERT(0); \ - } \ - if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \ - if (kalDevPortWrite(_prAdapter->prGlueInfo, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) == FALSE) {\ - HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \ - fgIsBusAccessFailed = TRUE; \ - DBGLOG(HAL, ERROR, ("HAL_PORT_WR access fail! 0x%x\n", _u4Port)); \ - } \ - else { \ - /*fgResult = TRUE;*/ } \ - } else { \ - DBGLOG(HAL, WARN, ("ignore HAL_PORT_WR access! 0x%x\n", _u4Port)); \ - } \ - } - -#define HAL_BYTE_WR(_prAdapter, _u4Port, _ucBuf) \ - { \ - if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \ - ASSERT(0); \ - } \ - if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \ - if (kalDevWriteWithSdioCmd52(_prAdapter->prGlueInfo, _u4Port, _ucBuf) == FALSE) {\ - HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \ - fgIsBusAccessFailed = TRUE; \ - DBGLOG(HAL, ERROR, ("HAL_BYTE_WR access fail! 0x%x\n", _u4Port)); \ - } \ - else { \ - } \ - } \ - else { \ - DBGLOG(HAL, WARN, ("ignore HAL_BYTE_WR access! 0x%x\n", _u4Port)); \ - } \ - } - - -#define HAL_DRIVER_OWN_BY_SDIO_CMD52(_prAdapter, _pfgDriverIsOwnReady) \ - { \ - UINT_8 ucBuf = BIT(1); \ - if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \ - ASSERT(0); \ - } \ - if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \ - if (kalDevReadAfterWriteWithSdioCmd52(_prAdapter->prGlueInfo, MCR_WHLPCR_BYTE1, &ucBuf, 1) == FALSE) {\ - HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \ - fgIsBusAccessFailed = TRUE; \ - DBGLOG(HAL, ERROR, ("kalDevReadAfterWriteWithSdioCmd52 access fail!\n")); \ - } \ - else { \ - *_pfgDriverIsOwnReady = (ucBuf & BIT(0)) ? TRUE : FALSE; \ - } \ - } else { \ - DBGLOG(HAL, WARN, ("ignore HAL_DRIVER_OWN_BY_SDIO_CMD52 access!\n")); \ - } \ - } - -#else /* #if defined(_HIF_SDIO) */ -#define HAL_MCR_RD(_prAdapter, _u4Offset, _pu4Value) \ - { \ - if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \ - ASSERT(0); \ - } \ - kalDevRegRead(_prAdapter->prGlueInfo, _u4Offset, _pu4Value); \ - } - -#define HAL_MCR_WR(_prAdapter, _u4Offset, _u4Value) \ - { \ - if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \ - ASSERT(0); \ - } \ - kalDevRegWrite(_prAdapter->prGlueInfo, _u4Offset, _u4Value); \ - } - -#define HAL_PORT_RD(_prAdapter, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \ - { \ - if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \ - ASSERT(0); \ - } \ - kalDevPortRead(_prAdapter->prGlueInfo, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize); \ - } - -#define HAL_PORT_WR(_prAdapter, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \ - { \ - if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \ - ASSERT(0); \ - } \ - kalDevPortWrite(_prAdapter->prGlueInfo, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize); \ - } - -#define HAL_BYTE_WR(_prAdapter, _u4Port, _ucBuf) \ - { \ - if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \ - ASSERT(0); \ - } \ - kalDevWriteWithSdioCmd52(_prAdapter->prGlueInfo, _u4Port, _ucBuf); \ - } - -#endif /* #if defined(_HIF_SDIO) */ - - -#define HAL_READ_RX_PORT(prAdapter, u4PortId, u4Len, pvBuf, _u4ValidBufSize) \ - { \ - ASSERT(u4PortId < 2); \ - HAL_PORT_RD(prAdapter, \ - ((u4PortId == 0) ? MCR_WRDR0 : MCR_WRDR1), \ - u4Len, \ - pvBuf, \ - _u4ValidBufSize/*temp!!*//*4Kbyte*/) \ - } - -#define HAL_WRITE_TX_PORT(_prAdapter, _ucTxPortIdx, _u4Len, _pucBuf, _u4ValidBufSize) \ - { \ - ASSERT(_ucTxPortIdx < 2); \ - if((_u4ValidBufSize - _u4Len) >= sizeof(UINT_32)) { \ - /* fill with single dword of zero as TX-aggregation termination */ \ - *(PUINT_32) (&((_pucBuf)[ALIGN_4(_u4Len)])) = 0; \ - } \ - HAL_PORT_WR(_prAdapter, \ - (_ucTxPortIdx == 0) ? MCR_WTDR0 : MCR_WTDR1, \ - _u4Len, \ - _pucBuf, \ - _u4ValidBufSize/*temp!!*//*4KByte*/) \ - } - -/* The macro to read the given MCR several times to check if the wait - condition come true. */ -#define HAL_MCR_RD_AND_WAIT(_pAdapter, _offset, _pReadValue, _waitCondition, _waitDelay, _waitCount, _status) \ - { \ - UINT_32 count; \ - (_status) = FALSE; \ - for (count = 0; count < (_waitCount); count++) { \ - HAL_MCR_RD((_pAdapter), (_offset), (_pReadValue)); \ - if ((_waitCondition)) { \ - (_status) = TRUE; \ - break; \ - } \ - kalUdelay((_waitDelay)); \ - } \ - } - - -/* The macro to write 1 to a R/S bit and read it several times to check if the - command is done */ -#define HAL_MCR_WR_AND_WAIT(_pAdapter, _offset, _writeValue, _busyMask, _waitDelay, _waitCount, _status) \ - { \ - UINT_32 u4Temp; \ - UINT_32 u4Count = _waitCount; \ - (_status) = FALSE; \ - HAL_MCR_WR((_pAdapter), (_offset), (_writeValue)); \ - do { \ - kalUdelay((_waitDelay)); \ - HAL_MCR_RD((_pAdapter), (_offset), &u4Temp); \ - if (!(u4Temp & (_busyMask))) { \ - (_status) = TRUE; \ - break; \ - } \ - u4Count--; \ - } while (u4Count); \ - } - -#define HAL_GET_CHIP_ID_VER(_prAdapter, pu2ChipId, pu2Version) \ - { \ - UINT_32 u4Value; \ - HAL_MCR_RD(_prAdapter, \ - MCR_WCIR, \ - &u4Value); \ - *pu2ChipId = (UINT_16)(u4Value & WCIR_CHIP_ID); \ - *pu2Version = (UINT_16)(u4Value & WCIR_REVISION_ID) >> 16; \ - } - -#define HAL_WAIT_WIFI_FUNC_READY(_prAdapter) \ - { \ - UINT_32 u4Value; \ - UINT_32 i; \ - for (i = 0; i < 100; i++) { \ - HAL_MCR_RD(_prAdapter, \ - MCR_WCIR, \ - &u4Value); \ - if (u4Value & WCIR_WLAN_READY) { \ - break; \ - } \ - NdisMSleep(10); \ - } \ - } - -#define HAL_INTR_DISABLE(_prAdapter) \ - HAL_MCR_WR(_prAdapter, \ - MCR_WHLPCR, \ - WHLPCR_INT_EN_CLR) - -#define HAL_INTR_ENABLE(_prAdapter) \ - HAL_MCR_WR(_prAdapter, \ - MCR_WHLPCR, \ - WHLPCR_INT_EN_SET) - -#define HAL_INTR_ENABLE_AND_LP_OWN_SET(_prAdapter) \ - HAL_MCR_WR(_prAdapter, \ - MCR_WHLPCR, \ - (WHLPCR_INT_EN_SET | WHLPCR_FW_OWN_REQ_SET)) - -#define HAL_LP_OWN_SET(_prAdapter) \ - HAL_MCR_WR(_prAdapter, \ - MCR_WHLPCR, \ - WHLPCR_FW_OWN_REQ_SET) - -#define HAL_LP_OWN_CLR_OK(_prAdapter, _pfgResult) \ - { \ - UINT_32 i; \ - UINT_32 u4RegValue; \ - UINT_32 u4LoopCnt = 2048 / 8; \ - *_pfgResult = TRUE; \ - /* Software get LP ownership */ \ - HAL_MCR_WR(_prAdapter, \ - MCR_WHLPCR, \ - WHLPCR_FW_OWN_REQ_CLR) \ - for (i = 0; i < u4LoopCnt; i++) { \ - HAL_MCR_RD(_prAdapter, MCR_WHLPCR, &u4RegValue); \ - if (u4RegValue & WHLPCR_IS_DRIVER_OWN) { \ - break; \ - } \ - else { \ - kalUdelay(8); \ - } \ - } \ - if (i == u4LoopCnt) { \ - *_pfgResult = FALSE; \ - /*ERRORLOG(("LP cannot be own back (%ld)", u4LoopCnt));*/ \ - /* check the time of LP instructions need to perform from Sleep to On */ \ - /*ASSERT(0); */ \ - } \ - } - -#define HAL_GET_ABNORMAL_INTERRUPT_REASON_CODE(_prAdapter, pu4AbnormalReason) \ - { \ - HAL_MCR_RD(_prAdapter, \ - MCR_WASR, \ - pu4AbnormalReason); \ - } - - -#define HAL_DISABLE_RX_ENHANCE_MODE(_prAdapter) \ - { \ - UINT_32 u4Value; \ - HAL_MCR_RD(_prAdapter, \ - MCR_WHCR, \ - &u4Value); \ - HAL_MCR_WR(_prAdapter, \ - MCR_WHCR, \ - u4Value & ~WHCR_RX_ENHANCE_MODE_EN); \ - } - -#define HAL_ENABLE_RX_ENHANCE_MODE(_prAdapter) \ - { \ - UINT_32 u4Value; \ - HAL_MCR_RD(_prAdapter, \ - MCR_WHCR, \ - &u4Value); \ - HAL_MCR_WR(_prAdapter, \ - MCR_WHCR, \ - u4Value | WHCR_RX_ENHANCE_MODE_EN); \ - } - -#define HAL_CFG_MAX_HIF_RX_LEN_NUM(_prAdapter, _ucNumOfRxLen) \ - { \ - UINT_32 u4Value, ucNum; \ - ucNum = ((_ucNumOfRxLen >= 16) ? 0 : _ucNumOfRxLen); \ - u4Value = 0; \ - HAL_MCR_RD(_prAdapter, \ - MCR_WHCR, \ - &u4Value); \ - u4Value &= ~WHCR_MAX_HIF_RX_LEN_NUM; \ - u4Value |= ((((UINT_32)ucNum) << 4) & WHCR_MAX_HIF_RX_LEN_NUM); \ - HAL_MCR_WR(_prAdapter, \ - MCR_WHCR, \ - u4Value); \ - } - -#define HAL_SET_INTR_STATUS_READ_CLEAR(prAdapter) \ - { \ - UINT_32 u4Value; \ - HAL_MCR_RD(prAdapter, \ - MCR_WHCR, \ - &u4Value); \ - HAL_MCR_WR(prAdapter, \ - MCR_WHCR, \ - u4Value & ~WHCR_W_INT_CLR_CTRL); \ - prAdapter->prGlueInfo->rHifInfo.fgIntReadClear = TRUE;\ - } - -#define HAL_SET_INTR_STATUS_WRITE_1_CLEAR(prAdapter) \ - { \ - UINT_32 u4Value; \ - HAL_MCR_RD(prAdapter, \ - MCR_WHCR, \ - &u4Value); \ - HAL_MCR_WR(prAdapter, \ - MCR_WHCR, \ - u4Value | WHCR_W_INT_CLR_CTRL); \ - prAdapter->prGlueInfo->rHifInfo.fgIntReadClear = FALSE;\ - } - -/* Note: enhance mode structure may also carried inside the buffer, - if the length of the buffer is long enough */ -#define HAL_READ_INTR_STATUS(prAdapter, length, pvBuf) \ - HAL_PORT_RD(prAdapter, \ - MCR_WHISR, \ - length, \ - pvBuf, \ - length) - -#define HAL_READ_TX_RELEASED_COUNT(_prAdapter, aucTxReleaseCount) \ - { \ - PUINT_32 pu4Value = (PUINT_32)aucTxReleaseCount; \ - HAL_MCR_RD(_prAdapter, \ - MCR_WTSR0, \ - &pu4Value[0]); \ - HAL_MCR_RD(_prAdapter, \ - MCR_WTSR1, \ - &pu4Value[1]); \ - } - -#define HAL_READ_RX_LENGTH(prAdapter, pu2Rx0Len, pu2Rx1Len) \ - { \ - UINT_32 u4Value; \ - u4Value = 0; \ - HAL_MCR_RD(prAdapter, \ - MCR_WRPLR, \ - &u4Value); \ - *pu2Rx0Len = (UINT_16)u4Value; \ - *pu2Rx1Len = (UINT_16)(u4Value >> 16); \ - } - -#define HAL_GET_INTR_STATUS_FROM_ENHANCE_MODE_STRUCT(pvBuf, u2Len, pu4Status) \ - { \ - PUINT_32 pu4Buf = (PUINT_32)pvBuf; \ - *pu4Status = pu4Buf[0]; \ - } - -#define HAL_GET_TX_STATUS_FROM_ENHANCE_MODE_STRUCT(pvInBuf, pu4BufOut, u4LenBufOut) \ - { \ - PUINT_32 pu4Buf = (PUINT_32)pvInBuf; \ - ASSERT(u4LenBufOut >= 8); \ - pu4BufOut[0] = pu4Buf[1]; \ - pu4BufOut[1] = pu4Buf[2]; \ - } - -#define HAL_GET_RX_LENGTH_FROM_ENHANCE_MODE_STRUCT(pvInBuf, pu2Rx0Num, au2Rx0Len, pu2Rx1Num, au2Rx1Len) \ - { \ - PUINT_32 pu4Buf = (PUINT_32)pvInBuf; \ - ASSERT((sizeof(au2Rx0Len) / sizeof(UINT_16)) >= 16); \ - ASSERT((sizeof(au2Rx1Len) / sizeof(UINT_16)) >= 16); \ - *pu2Rx0Num = (UINT_16)pu4Buf[3]; \ - *pu2Rx1Num = (UINT_16)(pu4Buf[3] >> 16); \ - kalMemCopy(au2Rx0Len, &pu4Buf[4], 8); \ - kalMemCopy(au2Rx1Len, &pu4Buf[12], 8); \ - } - -#define HAL_GET_MAILBOX_FROM_ENHANCE_MODE_STRUCT(pvInBuf, pu4Mailbox0, pu4Mailbox1) \ - { \ - PUINT_32 pu4Buf = (PUINT_32)pvInBuf; \ - *pu4Mailbox0 = (UINT_16)pu4Buf[21]; \ - *pu4Mailbox1 = (UINT_16)pu4Buf[22]; \ - } - -#define HAL_IS_TX_DONE_INTR(u4IntrStatus) \ - ((u4IntrStatus & WHISR_TX_DONE_INT) ? TRUE : FALSE) - -#define HAL_IS_RX_DONE_INTR(u4IntrStatus) \ - ((u4IntrStatus & (WHISR_RX0_DONE_INT | WHISR_RX1_DONE_INT)) ? TRUE : FALSE) - -#define HAL_IS_ABNORMAL_INTR(u4IntrStatus) \ - ((u4IntrStatus & WHISR_ABNORMAL_INT) ? TRUE : FALSE) - -#define HAL_IS_FW_OWNBACK_INTR(u4IntrStatus) \ - ((u4IntrStatus & WHISR_FW_OWN_BACK_INT) ? TRUE : FALSE) - -#define HAL_PUT_MAILBOX(prAdapter, u4MboxId, u4Data) \ - { \ - ASSERT(u4MboxId < 2); \ - HAL_MCR_WR(prAdapter, \ - ((u4MboxId == 0) ? MCR_H2DSM0R : MCR_H2DSM1R), \ - u4Data); \ - } - -#define HAL_GET_MAILBOX(prAdapter, u4MboxId, pu4Data) \ - { \ - ASSERT(u4MboxId < 2); \ - HAL_MCR_RD(prAdapter, \ - ((u4MboxId == 0) ? MCR_D2HRM0R : MCR_D2HRM1R), \ - pu4Data); \ - } - -#define HAL_SET_MAILBOX_READ_CLEAR(prAdapter, fgEnableReadClear) \ - { \ - UINT_32 u4Value; \ - HAL_MCR_RD(prAdapter, MCR_WHCR, &u4Value);\ - HAL_MCR_WR(prAdapter, MCR_WHCR, \ - (fgEnableReadClear) ? \ - (u4Value | WHCR_W_MAILBOX_RD_CLR_EN) : \ - (u4Value & ~WHCR_W_MAILBOX_RD_CLR_EN)); \ - prAdapter->prGlueInfo->rHifInfo.fgMbxReadClear = fgEnableReadClear;\ - } - -#define HAL_GET_MAILBOX_READ_CLEAR(prAdapter) (prAdapter->prGlueInfo->rHifInfo.fgMbxReadClear) - - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - - - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _HAL_H */ - diff --git a/drivers/net/wireless/mt5931/include/nic/hif_rx.h b/drivers/net/wireless/mt5931/include/nic/hif_rx.h deleted file mode 100755 index 3895a7c3fc01..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/hif_rx.h +++ /dev/null @@ -1,227 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/hif_rx.h#1 $ -*/ - -/*! \file "hif_rx.h" - \brief Provide HIF RX Header Information between F/W and Driver - - N/A -*/ - - -/* -** $Log: hif_rx.h $ - * - * 09 01 2010 kevin.huang - * NULL - * Use LINK LIST operation to process SCAN result - * - * 07 16 2010 yarco.yang - * - * 1. Support BSS Absence/Presence Event - * 2. Support STA change PS mode Event - * 3. Support BMC forwarding for AP mode. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * follow-ups for HIF_RX_HEADER_T update: - * 1) add TCL - * 2) add RCPI - * 3) add ChannelNumber - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 09 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add necessary changes to driver data paths. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-12-10 16:44:00 GMT mtk02752 -** code clean -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-12-09 13:59:20 GMT MTK02468 -** Added HIF_RX_HDR parsing macros -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-11-24 19:54:54 GMT mtk02752 -** adopt HIF_RX_HEADER_T in new data path -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-10-29 19:51:19 GMT mtk01084 -** modify FW/ driver interface -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-28 10:33:58 GMT mtk01461 -** Add define of HW_APPENED_LEN -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-01 10:51:02 GMT mtk01461 -** Rename ENUM_HIF_RX_PKT_TYPE_T -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-19 12:05:03 GMT mtk01426 -** Remove __KAL_ATTRIB_PACKED__ and add hifDataTypeCheck() -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-17 20:18:52 GMT mtk01426 -** Add comment to HIF_RX_HEADER_T -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:23 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _HIF_RX_H -#define _HIF_RX_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -/*! HIF_RX_HEADER_T */ -// DW 0, Byte 1 -#define HIF_RX_HDR_PACKET_TYPE_MASK BITS(0,1) - -// DW 1, Byte 0 -#define HIF_RX_HDR_HEADER_LEN BITS(2,7) -#define HIF_RX_HDR_HEADER_LEN_OFFSET 2 -#define HIF_RX_HDR_HEADER_OFFSET_MASK BITS(0,1) - -// DW 1, Byte 1 -#define HIF_RX_HDR_80211_HEADER_FORMAT BIT(0) -#define HIF_RX_HDR_DO_REORDER BIT(1) -#define HIF_RX_HDR_PAL BIT(2) -#define HIF_RX_HDR_TCL BIT(3) -#define HIF_RX_HDR_NETWORK_IDX_MASK BITS(4,7) -#define HIF_RX_HDR_NETWORK_IDX_OFFSET 4 - -// DW 1, Byte 2, 3 -#define HIF_RX_HDR_SEQ_NO_MASK BITS(0,11) -#define HIF_RX_HDR_TID_MASK BITS(12,14) -#define HIF_RX_HDR_TID_OFFSET 12 -#define HIF_RX_HDR_BAR_FRAME BIT(15) - - - -#define HIF_RX_HDR_FLAG_AMP_WDS BIT(0) -#define HIF_RX_HDR_FLAG_802_11_FORMAT BIT(1) -#define HIF_RX_HDR_FLAG_BAR_FRAME BIT(2) -#define HIF_RX_HDR_FLAG_DO_REORDERING BIT(3) -#define HIF_RX_HDR_FLAG_CTRL_WARPPER_FRAME BIT(4) - -#define HIF_RX_HW_APPENDED_LEN 4 - -// For DW 2, Byte 3 - ucHwChannelNum -#define HW_CHNL_NUM_MAX_2G4 14 -#define HW_CHNL_NUM_MAX_4G_5G (255 - HW_CHNL_NUM_MAX_2G4) - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -typedef struct _HIF_RX_HEADER_T { - UINT_16 u2PacketLen; - UINT_16 u2PacketType; - UINT_8 ucHerderLenOffset; - UINT_8 uc80211_Reorder_PAL_TCL; - UINT_16 u2SeqNoTid; - UINT_8 ucStaRecIdx; - UINT_8 ucRcpi; - UINT_8 ucHwChannelNum; - UINT_8 ucReserved; -} HIF_RX_HEADER_T, *P_HIF_RX_HEADER_T; - -typedef enum _ENUM_HIF_RX_PKT_TYPE_T { - HIF_RX_PKT_TYPE_DATA = 0, - HIF_RX_PKT_TYPE_EVENT, - HIF_RX_PKT_TYPE_TX_LOOPBACK, - HIF_RX_PKT_TYPE_MANAGEMENT, - HIF_RX_PKT_TYPE_NUM -} ENUM_HIF_RX_PKT_TYPE_T, *P_ENUM_HIF_RX_PKT_TYPE_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -#define HIF_RX_HDR_SIZE sizeof(HIF_RX_HEADER_T) - -#define HIF_RX_HDR_GET_80211_FLAG(_prHifRxHdr) \ - (((((_prHifRxHdr)->uc80211_Reorder_PAL_TCL) & HIF_RX_HDR_80211_HEADER_FORMAT) ? TRUE : FALSE)) -#define HIF_RX_HDR_GET_REORDER_FLAG(_prHifRxHdr) \ - (((((_prHifRxHdr)->uc80211_Reorder_PAL_TCL) & HIF_RX_HDR_DO_REORDER) ? TRUE : FALSE)) -#define HIF_RX_HDR_GET_PAL_FLAG(_prHifRxHdr) \ - (((((_prHifRxHdr)->uc80211_Reorder_PAL_TCL) & HIF_RX_HDR_PAL) ? TRUE : FALSE)) -#define HIF_RX_HDR_GET_TCL_FLAG(_prHifRxHdr) \ - (((((_prHifRxHdr)->uc80211_Reorder_PAL_TCL) & HIF_RX_HDR_TCL) ? TRUE : FALSE)) -#define HIF_RX_HDR_GET_NETWORK_IDX(_prHifRxHdr) \ - ((((_prHifRxHdr)->uc80211_Reorder_PAL_TCL) & HIF_RX_HDR_NETWORK_IDX_MASK)\ - >> HIF_RX_HDR_NETWORK_IDX_OFFSET) - - -#define HIF_RX_HDR_GET_TID(_prHifRxHdr) \ - ((((_prHifRxHdr)->u2SeqNoTid) & HIF_RX_HDR_TID_MASK)\ - >> HIF_RX_HDR_TID_OFFSET) -#define HIF_RX_HDR_GET_SN(_prHifRxHdr) \ - (((_prHifRxHdr)->u2SeqNoTid) & HIF_RX_HDR_SEQ_NO_MASK) -#define HIF_RX_HDR_GET_BAR_FLAG(_prHifRxHdr) \ - (((((_prHifRxHdr)->u2SeqNoTid) & HIF_RX_HDR_BAR_FRAME)? TRUE: FALSE)) - - -#define HIF_RX_HDR_GET_CHNL_NUM(_prHifRxHdr) \ - ( ( ((_prHifRxHdr)->ucHwChannelNum) > HW_CHNL_NUM_MAX_4G_5G ) ? \ - ( ((_prHifRxHdr)->ucHwChannelNum) - HW_CHNL_NUM_MAX_4G_5G ) : \ - ((_prHifRxHdr)->ucHwChannelNum) ) - -/* To do: support more bands other than 2.4G and 5G */ -#define HIF_RX_HDR_GET_RF_BAND(_prHifRxHdr) \ - ( ( ((_prHifRxHdr)->ucHwChannelNum) <= HW_CHNL_NUM_MAX_2G4 ) ? \ - BAND_2G4 : BAND_5G) - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -__KAL_INLINE__ VOID -hifDataTypeCheck ( - VOID - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/* Kevin: we don't have to call following function to inspect the data structure. - * It will check automatically while at compile time. - * We'll need this for porting driver to different RTOS. - */ -__KAL_INLINE__ VOID -hifDataTypeCheck ( - VOID - ) -{ - DATA_STRUC_INSPECTING_ASSERT(sizeof(HIF_RX_HEADER_T) == 12); - - return; -} - -#endif diff --git a/drivers/net/wireless/mt5931/include/nic/hif_tx.h b/drivers/net/wireless/mt5931/include/nic/hif_tx.h deleted file mode 100755 index 3a04ce55d9be..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/hif_tx.h +++ /dev/null @@ -1,225 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/hif_tx.h#1 $ -*/ - - - -/* -** $Log: hif_tx.h $ - * - * 10 07 2010 cp.wu - * [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection - * add firmware download for MT5931. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * fill extra information for revised HIF_TX_HEADER. - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) add flag on MSDU_INFO_T for indicating BIP frame and forceBasicRate - * 2) add packet type for indicating management frames - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 03 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * code clean: removing unused variables and structure definitions - * - * 02 09 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. Permanent and current MAC address are now retrieved by CMD/EVENT packets instead of hard-coded address - * * * 2. follow MSDN defined behavior when associates to another AP - * * * 3. for firmware download, packet size could be up to 2048 bytes - * - * 01 13 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Enabled the Burst_End Indication mechanism - * - * 01 13 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * TX: fill ucWlanHeaderLength/ucPktFormtId_Flags according to info provided by prMsduInfo -** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-12-10 16:43:40 GMT mtk02752 -** code clean -** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-11-24 19:55:11 GMT mtk02752 -** adopt HIF_TX_HEADER_T in new data path -** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-11-23 17:54:13 GMT mtk02752 -** CMD_HDR_SIZE = (sizeof(WIFI_CMD_T)) to follow up CM's CMD/EVENT documentation -** -** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-11-17 22:41:10 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-11-17 17:34:07 GMT mtk02752 -** remove HIF_TX_BUFF_COUNT_TC0 (move to nic_tx.h) -** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-11-17 12:14:12 GMT mtk02752 -** add initial value for HIF_TX_BUFF_COUNT_TC5 -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-11-13 13:54:18 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-11-04 14:11:14 GMT mtk01084 -** modify SW TX data format -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-10-29 19:51:53 GMT mtk01084 -** modify FW/ driver interface -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-05-20 12:22:46 GMT mtk01461 -** Add SeqNum field to CMD Header -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-17 19:40:52 GMT mtk01461 -** Update the Log Sign -*/ - -#ifndef _HIF_TX_H -#define _HIF_TX_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -/* Maximum buffer size for individual HIF TCQ Buffer */ -#define HIF_TX_BUFF_MAX_SIZE 1552 /* Reserved field was not included */ - -/* Maximum buffer count for individual HIF TCQ */ -#define HIF_TX_BUFF_COUNT_TC0 3 -#define HIF_TX_BUFF_COUNT_TC1 3 -#define HIF_TX_BUFF_COUNT_TC2 3 -#define HIF_TX_BUFF_COUNT_TC3 3 -#define HIF_TX_BUFF_COUNT_TC4 2 - -#define TX_HDR_SIZE sizeof(HIF_TX_HEADER_T) - -#define CMD_HDR_SIZE sizeof(WIFI_CMD_T) - -#define CMD_PKT_SIZE_FOR_IMAGE 2048 /* !< 2048 Bytes CMD payload buffer */ - - -/*! NIC_HIF_TX_HEADER_T */ -// DW 0, Byte 0,1 -#define HIF_TX_HDR_TX_BYTE_COUNT_MASK BITS(0,11) -#define HIF_TX_HDR_USER_PRIORITY_OFFSET 12 - -// DW 0, Byte 2 -#define HIF_TX_HDR_ETHER_TYPE_OFFSET_MASK BITS(0,7) - -// DW 0, Byte 3 -#define HIF_TX_HDR_IP_CSUM BIT(0) -#define HIF_TX_HDR_TCP_CSUM BIT(1) -#define HIF_TX_HDR_RESOURCE_MASK BITS(2,5) -#define HIF_TX_HDR_RESOURCE_OFFSET 2 -#define HIF_TX_HDR_PACKET_TYPE_MASK BITS(6,7) -#define HIF_TX_HDR_PACKET_TYPE_OFFSET 6 - -// DW 1, Byte 0 -#define HIF_TX_HDR_WLAN_HEADER_LEN_MASK BITS(0,5) - -// DW 1, Byte 1 -#define HIF_TX_HDR_FORMAT_ID_MASK BITS(0,2) -#define HIF_TX_HDR_NETWORK_TYPE_MASK BITS(4,5) -#define HIF_TX_HDR_NETWORK_TYPE_OFFSET 4 -#define HIF_TX_HDR_FLAG_1X_FRAME_MASK BIT(6) -#define HIF_TX_HDR_FLAG_1X_FRAME_OFFSET 6 -#define HIF_TX_HDR_FLAG_802_11_FORMAT_MASK BIT(7) -#define HIF_TX_HDR_FLAG_802_11_FORMAT_OFFSET 7 - - -// DW2, Byte 3 -#define HIF_TX_HDR_PS_FORWARDING_TYPE_MASK BITS(0,1) -#define HIF_TX_HDR_PS_SESSION_ID_MASK BITS(2,4) -#define HIF_TX_HDR_PS_SESSION_ID_OFFSET 2 -#define HIF_TX_HDR_BURST_END_MASK BIT(5) -#define HIF_TX_HDR_BURST_END_OFFSET 5 - -// DW3, Byte 1 -#define HIF_TX_HDR_NEED_ACK BIT(0) -#define HIF_TX_HDR_BIP BIT(1) -#define HIF_TX_HDR_BASIC_RATE BIT(2) - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef struct _HIF_HW_TX_HEADER_T { - UINT_16 u2TxByteCount; - UINT_8 ucEtherTypeOffset; - UINT_8 ucCSflags; - UINT_8 aucBuffer[0]; -} HIF_HW_TX_HEADER_T, *P_HIF_HW_TX_HEADER_T; - -typedef struct _HIF_TX_HEADER_T { - UINT_16 u2TxByteCount_UserPriority; - UINT_8 ucEtherTypeOffset; - UINT_8 ucResource_PktType_CSflags; - UINT_8 ucWlanHeaderLength; - UINT_8 ucPktFormtId_Flags; - UINT_16 u2LLH; /* for BOW */ - UINT_16 u2SeqNo; /* for BOW */ - UINT_8 ucStaRecIdx; - UINT_8 ucForwardingType_SessionID_Reserved; - UINT_8 ucPacketSeqNo; - UINT_8 ucAck_BIP_BasicRate; - UINT_8 aucReserved[2]; -} HIF_TX_HEADER_T, *P_HIF_TX_HEADER_T; - -typedef enum _ENUM_HIF_TX_PKT_TYPE_T { - HIF_TX_PKT_TYPE_DATA = 0, - HIF_TX_PKT_TYPE_CMD, - HIF_TX_PKT_TYPE_HIF_LOOPBACK, - HIF_TX_PKT_TYPE_MANAGEMENT, - HIF_TX_PKT_TYPE_NUM -} ENUM_HIF_TX_PKT_TYPE_T, *P_ENUM_HIF_TX_PKT_TYPE_T; - -typedef enum _ENUM_HIF_OOB_CTRL_PKT_TYPE_T { - HIF_OOB_CTRL_PKT_TYPE_LOOPBACK = 1, - HIF_OOB_CTRL_PKT_TYP_NUM -} ENUM_HIF_OOB_CTRL_PKT_TYPE_T, *P_ENUM_HIF_OOB_CTRL_PKT_TYPE_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -#define TFCB_FRAME_PAD_TO_DW(u2Length) ALIGN_4(u2Length) - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -/* Kevin: we don't have to call following function to inspect the data structure. - * It will check automatically while at compile time. - */ -__KAL_INLINE__ VOID -hif_txDataTypeCheck ( - VOID - ); - -__KAL_INLINE__ VOID -hif_txDataTypeCheck ( - VOID - ) -{ - DATA_STRUC_INSPECTING_ASSERT(sizeof(HIF_TX_HEADER_T) == 16); - - return; -} - -#endif /*_HIF_TX_H */ - diff --git a/drivers/net/wireless/mt5931/include/nic/mac.h b/drivers/net/wireless/mt5931/include/nic/mac.h deleted file mode 100755 index d67780a668bc..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/mac.h +++ /dev/null @@ -1,2183 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/mac.h#1 $ -*/ - -/*! \file "mac.h" - \brief Brief description. - - Detail description. -*/ - - - -/* -** $Log: mac.h $ - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 01 05 2012 tsaiyuan.hsu - * [WCXRP00001157] [MT6620 Wi-Fi][FW][DRV] add timing measurement support for 802.11v - * add timing measurement support for 802.11v. - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 06 22 2011 wh.su - * [WCXRP00000806] [MT6620 Wi-Fi][Driver] Move the WPA/RSN IE and WAPI IE structure to mac.h and let the sw structure not align at byte - * Move the WAPI/RSN IE to mac.h and SW structure not align to byte, - * Notice needed update P2P.ko. - * - * 05 06 2011 wh.su - * [WCXRP00000699] [MT6620 Wi-Fi][Driver] Add the ie pointer check for avoid TP-LINK AP send the wrong beacon make driver got incorrect support rate set - * Add the length check before access the ie length filed. - * - * 05 06 2011 wh.su - * [WCXRP00000699] [MT6620 Wi-Fi][Driver] Add the ie pointer check for avoid TP-LINK AP send the wrong beacon make driver got incorrect support rate set - * adding the length check before processing next ie.. - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 04 12 2011 cm.chang - * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency - * . - * - * 04 08 2011 yuche.tsai - * [WCXRP00000624] [Volunteer Patch][MT6620][Driver] Add device discoverability support for GO. - * Add device discover ability support. - * - * 03 17 2011 chinglan.wang - * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature - * . - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Some action frame define is not belong to P2P. - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Add some service discovery MAC define, phase I. - * - * 12 13 2010 cp.wu - * [WCXRP00000260] [MT6620 Wi-Fi][Driver][Firmware] Create V1.1 branch for both firmware and driver - * create branch for Wi-Fi driver v1.1 - * - * 12 13 2010 cp.wu - * [WCXRP00000256] [MT6620 Wi-Fi][Driver] Eliminate potential issues which is identified by Klockwork - * suppress warning reported by Klockwork. - * - * 11 01 2010 cp.wu - * [WCXRP00000122] [MT6620 Wi-Fi][Driver] Preparation for YuSu source tree integration - * revert to previous revision. (this file is not necessary to be changed) - * - * 08 20 2010 cm.chang - * NULL - * Migrate RLM code to host from FW - * - * 08 02 2010 yuche.tsai - * NULL - * 1. Add P2P MAC define. - * 2. Add scan device found event - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 21 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Add WFA specific OUI. - * - * 06 17 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Add P2P IE ID & Vendor OUI TYPE for P2P. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge MAC.h. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 01 13 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Added OFFSET_BAR_SSC_SN -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-12-09 14:00:24 GMT MTK02468 -** Added offsets and masks for the BA Parameter Set filed -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:26 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _MAC_H -#define _MAC_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -//3 /* --------------- Constants for Ethernet/802.11 MAC --------------- */ -/* MAC Address */ -#define MAC_ADDR_LEN 6 - -#define MAC_ADDR_LOCAL_ADMIN BIT(1) - -#define ETH_P_IPV4 0x0800 -#define ETH_P_IPX 0x8137 // Novell IPX -#define ETH_P_AARP 0x80F3 // AppleTalk Address Resolution Protocol (AARP) -#define ETH_P_IPV6 0x86DD - -#define IP_VERSION_4 4 -#define IP_VERSION_6 6 - -#define IP_PROTOCOL_TCP 6 -#define IP_PROTOCOL_UDP 17 - -#define IPV4_HDR_IP_PROTOCOL_OFFSET 9 -#define IPV4_HDR_IP_CSUM_OFFSET 10 - -#define IPV6_HDR_IP_PROTOCOL_OFFSET 6 - -#define TCP_HDR_TCP_CSUM_OFFSET 16 -#define UDP_HDR_UDP_CSUM_OFFSET 6 - -#define LLC_LEN 8 // LLC(3) + SNAP(3) + EtherType(2) - -#define NULL_MAC_ADDR {0x00, 0x00, 0x00, 0x00, 0x00, 0x00} -#define BC_MAC_ADDR {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} - -/* Ethernet Frame Field Size, in byte */ -#define ETHER_HEADER_LEN 14 -#define ETHER_TYPE_LEN 2 -#define ETHER_MIN_PKT_SZ 60 -#define ETHER_MAX_PKT_SZ 1514 - -/* IEEE 802.11 WLAN Frame Field Size, in byte */ -#define WLAN_MAC_HEADER_LEN 24 /* Address 4 excluded */ -#define WLAN_MAC_HEADER_A4_LEN 30 /* Address 4 included */ -#define WLAN_MAC_HEADER_QOS_LEN 26 /* QoS Control included */ -#define WLAN_MAC_HEADER_QOS_HTC_LEN 30 /* QoS Control and HTC included */ -#define WLAN_MAC_HEADER_A4_QOS_LEN 32 /* Address 4 and QoS Control included */ -#define WLAN_MAC_HEADER_A4_QOS_HTC_LEN 36 /* Address 4, QoS Control and HTC included */ -#define WLAN_MAC_MGMT_HEADER_LEN 24 /* Address 4 excluded */ -#define WLAN_MAC_MGMT_HEADER_HTC_LEN 28 /* HTC included */ - -#define QOS_CTRL_LEN 2 -#define HT_CTRL_LEN 4 - -#define WLAN_MAC_CTS_ACK_LEN WLAN_MAC_CTS_ACK_FRAME_HEADER_LEN + FCS_LEN - -/* 6.2.1.1.2 Semantics of the service primitive */ -#define MSDU_MAX_LENGTH 2304 - -/* 7.1.3.3.3 Broadcast BSSID */ -#define BC_BSSID BC_MAC_ADDR - -/* 7.1.3.7 FCS field */ -#define FCS_LEN 4 - -/* 7.3.1.6 Listen Interval field */ -#define DEFAULT_LISTEN_INTERVAL_BY_DTIM_PERIOD 2 // In unit of AP's DTIM interval, -#define DEFAULT_LISTEN_INTERVAL 10 - -/* 7.3.2.1 Broadcast(Wildcard) SSID */ -#define BC_SSID "" -#define BC_SSID_LEN 0 - -/* 7.3.2.2 Data Rate Value */ -#define RATE_1M 2 /* 1M in unit of 500kb/s */ -#define RATE_2M 4 /* 2M */ -#define RATE_5_5M 11 /* 5.5M */ -#define RATE_11M 22 /* 11M */ -#define RATE_22M 44 /* 22M */ -#define RATE_33M 66 /* 33M */ -#define RATE_6M 12 /* 6M */ -#define RATE_9M 18 /* 9M */ -#define RATE_12M 24 /* 12M */ -#define RATE_18M 36 /* 18M */ -#define RATE_24M 48 /* 24M */ -#define RATE_36M 72 /* 36M */ -#define RATE_48M 96 /* 48M */ -#define RATE_54M 108 /* 54M */ -/* 7.3.2.14 BSS membership selector */ -#define RATE_HT_PHY 127 /* BSS Selector - Clause 20. HT PHY */ -#define RATE_MASK BITS(0,6) /* mask bits for the rate */ -#define RATE_BASIC_BIT BIT(7) /* mask bit for the rate belonging to the BSSBasicRateSet */ - -/* 8.3.2.2 TKIP MPDU formats */ -#define TKIP_MIC_LEN 8 - -/* 9.2.10 DIFS */ -#define DIFS 2 /* 2 x aSlotTime */ - -/* 11.3 STA Authentication and Association */ -#define STA_STATE_1 0 /* Accept Class 1 frames */ -#define STA_STATE_2 1 /* Accept Class 1 & 2 frames */ -#define STA_STATE_3 2 /* Accept Class 1,2 & 3 frames */ - -/* 15.4.8.5 802.11k RCPI-dBm mapping*/ -#define NDBM_LOW_BOUND_FOR_RCPI 110 -#define RCPI_LOW_BOUND 0 -#define RCPI_HIGH_BOUND 220 -#define RCPI_MEASUREMENT_NOT_AVAILABLE 255 - - -/* PHY characteristics */ -/* 17.4.4/18.3.3/19.8.4 Slot Time (aSlotTime) */ -#define SLOT_TIME_LONG 20 /* Long Slot Time */ -#define SLOT_TIME_SHORT 9 /* Short Slot Time */ - -#define SLOT_TIME_HR_DSSS SLOT_TIME_LONG /* 802.11b aSlotTime */ -#define SLOT_TIME_OFDM SLOT_TIME_SHORT /* 802.11a aSlotTime(20M Spacing) */ -#define SLOT_TIME_OFDM_10M_SPACING 13 /* 802.11a aSlotTime(10M Spacing) */ -#define SLOT_TIME_ERP_LONG SLOT_TIME_LONG /* 802.11g aSlotTime(Long) */ -#define SLOT_TIME_ERP_SHORT SLOT_TIME_SHORT /* 802.11g aSlotTime(Short) */ - -/* 17.4.4/18.3.3/19.8.4 Contention Window (aCWmin & aCWmax) */ -#define CWMIN_OFDM 15 /* 802.11a aCWmin */ -#define CWMAX_OFDM 1023 /* 802.11a aCWmax */ - -#define CWMIN_HR_DSSS 31 /* 802.11b aCWmin */ -#define CWMAX_HR_DSSS 1023 /* 802.11b aCWmax */ - -#define CWMIN_ERP_0 31 /* 802.11g aCWmin(0) - for only have 1/2/5/11Mbps Rates */ -#define CWMIN_ERP_1 15 /* 802.11g aCWmin(1) */ -#define CWMAX_ERP 1023 /* 802.11g aCWmax */ - -/* Short Inter-Frame Space (aSIFSTime) */ -/* 15.3.3 802.11b aSIFSTime */ -#define SIFS_TIME_HR_DSSS 10 -/* 17.4.4 802.11a aSIFSTime */ -#define SIFS_TIME_OFDM 16 -/* 19.8.4 802.11g aSIFSTime */ -#define SIFS_TIME_ERP 10 - -/* 15.4.6.2 Number of operating channels */ -#define CH_1 0x1 -#define CH_2 0x2 -#define CH_3 0x3 -#define CH_4 0x4 -#define CH_5 0x5 -#define CH_6 0x6 -#define CH_7 0x7 -#define CH_8 0x8 -#define CH_9 0x9 -#define CH_10 0xa -#define CH_11 0xb -#define CH_12 0xc -#define CH_13 0xd -#define CH_14 0xe - -#define MAXIMUM_OPERATION_CHANNEL_LIST 32 - - -//3 /* --------------- IEEE 802.11 PICS --------------- */ -/* Annex D - dot11OperationEntry 2 */ -#define DOT11_RTS_THRESHOLD_MIN 0 -#define DOT11_RTS_THRESHOLD_MAX 2347 // from Windows DDK -//#define DOT11_RTS_THRESHOLD_MAX 3000 // from Annex D - -#define DOT11_RTS_THRESHOLD_DEFAULT \ - DOT11_RTS_THRESHOLD_MAX - -/* Annex D - dot11OperationEntry 5 */ -#define DOT11_FRAGMENTATION_THRESHOLD_MIN 256 -#define DOT11_FRAGMENTATION_THRESHOLD_MAX 2346 // from Windows DDK -//#define DOT11_FRAGMENTATION_THRESHOLD_MAX 3000 // from Annex D - -#define DOT11_FRAGMENTATION_THRESHOLD_DEFAULT \ - DOT11_FRAGMENTATION_THRESHOLD_MAX - -/* Annex D - dot11OperationEntry 6 */ -#define DOT11_TRANSMIT_MSDU_LIFETIME_TU_MIN 1 -#define DOT11_TRANSMIT_MSDU_LIFETIME_TU_MAX 0xFFFFffff -#define DOT11_TRANSMIT_MSDU_LIFETIME_TU_DEFAULT 4095 // 802.11 define 512 - // MT5921 only aceept N <= 4095 - -/* Annex D - dot11OperationEntry 7 */ -#define DOT11_RECEIVE_LIFETIME_TU_MIN 1 -#define DOT11_RECEIVE_LIFETIME_TU_MAX 0xFFFFffff -#define DOT11_RECEIVE_LIFETIME_TU_DEFAULT 4096 // 802.11 define 512 - -/* Annex D - dot11StationConfigEntry 12 */ -#define DOT11_BEACON_PERIOD_MIN 1 // TU. -#define DOT11_BEACON_PERIOD_MAX 0xffff // TU. -#define DOT11_BEACON_PERIOD_DEFAULT 100 // TU. - -/* Annex D - dot11StationConfigEntry 13 */ -#define DOT11_DTIM_PERIOD_MIN 1 // TU. -#define DOT11_DTIM_PERIOD_MAX 255 // TU. -#define DOT11_DTIM_PERIOD_DEFAULT 1 // TU. - -/* Annex D - dot11RegDomainsSupportValue */ -#define REGULATION_DOMAIN_FCC 0x10 /* FCC (US) */ -#define REGULATION_DOMAIN_IC 0x20 /* IC or DOC (Canada) */ -#define REGULATION_DOMAIN_ETSI 0x30 /* ETSI (Europe) */ -#define REGULATION_DOMAIN_SPAIN 0x31 /* Spain */ -#define REGULATION_DOMAIN_FRANCE 0x32 /* France */ -#define REGULATION_DOMAIN_JAPAN 0x40 /* MKK (Japan) */ -#define REGULATION_DOMAIN_CHINA 0x50 /* China */ -#define REGULATION_DOMAIN_OTHER 0x00 /* Other */ - - - -//3 /* --------------- IEEE 802.11 MAC header fields --------------- */ -/* 7.1.3.1 Masks for the subfields in the Frame Control field */ -#define MASK_FC_PROTOCOL_VER BITS(0,1) -#define MASK_FC_TYPE BITS(2,3) -#define MASK_FC_SUBTYPE BITS(4,7) -#define MASK_FC_SUBTYPE_QOS_DATA BIT(7) -#define MASK_FC_TO_DS BIT(8) -#define MASK_FC_FROM_DS BIT(9) -#define MASK_FC_MORE_FRAG BIT(10) -#define MASK_FC_RETRY BIT(11) -#define MASK_FC_PWR_MGT BIT(12) -#define MASK_FC_MORE_DATA BIT(13) -#define MASK_FC_PROTECTED_FRAME BIT(14) -#define MASK_FC_ORDER BIT(15) - -#define MASK_FRAME_TYPE (MASK_FC_TYPE | MASK_FC_SUBTYPE) -#define MASK_TO_DS_FROM_DS (MASK_FC_TO_DS | MASK_FC_FROM_DS) - -#define MAX_NUM_OF_FC_SUBTYPES 16 -#define OFFSET_OF_FC_SUBTYPE 4 - - -/* 7.1.3.1.2 MAC frame types and subtypes */ -#define MAC_FRAME_TYPE_MGT 0 -#define MAC_FRAME_TYPE_CTRL BIT(2) -#define MAC_FRAME_TYPE_DATA BIT(3) -#define MAC_FRAME_TYPE_QOS_DATA (MAC_FRAME_TYPE_DATA | MASK_FC_SUBTYPE_QOS_DATA) - -#define MAC_FRAME_ASSOC_REQ (MAC_FRAME_TYPE_MGT | 0x0000) -#define MAC_FRAME_ASSOC_RSP (MAC_FRAME_TYPE_MGT | 0x0010) -#define MAC_FRAME_REASSOC_REQ (MAC_FRAME_TYPE_MGT | 0x0020) -#define MAC_FRAME_REASSOC_RSP (MAC_FRAME_TYPE_MGT | 0x0030) -#define MAC_FRAME_PROBE_REQ (MAC_FRAME_TYPE_MGT | 0x0040) -#define MAC_FRAME_PROBE_RSP (MAC_FRAME_TYPE_MGT | 0x0050) -#define MAC_FRAME_BEACON (MAC_FRAME_TYPE_MGT | 0x0080) -#define MAC_FRAME_ATIM (MAC_FRAME_TYPE_MGT | 0x0090) -#define MAC_FRAME_DISASSOC (MAC_FRAME_TYPE_MGT | 0x00A0) -#define MAC_FRAME_AUTH (MAC_FRAME_TYPE_MGT | 0x00B0) -#define MAC_FRAME_DEAUTH (MAC_FRAME_TYPE_MGT | 0x00C0) -#define MAC_FRAME_ACTION (MAC_FRAME_TYPE_MGT | 0x00D0) -#define MAC_FRAME_ACTION_NO_ACK (MAC_FRAME_TYPE_MGT | 0x00E0) - - -#define MAC_FRAME_CONTRL_WRAPPER (MAC_FRAME_TYPE_CTRL | 0x0070) -#define MAC_FRAME_BLOCK_ACK_REQ (MAC_FRAME_TYPE_CTRL | 0x0080) -#define MAC_FRAME_BLOCK_ACK (MAC_FRAME_TYPE_CTRL | 0x0090) -#define MAC_FRAME_PS_POLL (MAC_FRAME_TYPE_CTRL | 0x00A0) -#define MAC_FRAME_RTS (MAC_FRAME_TYPE_CTRL | 0x00B0) -#define MAC_FRAME_CTS (MAC_FRAME_TYPE_CTRL | 0x00C0) -#define MAC_FRAME_ACK (MAC_FRAME_TYPE_CTRL | 0x00D0) -#define MAC_FRAME_CF_END (MAC_FRAME_TYPE_CTRL | 0x00E0) -#define MAC_FRAME_CF_END_CF_ACK (MAC_FRAME_TYPE_CTRL | 0x00F0) - -#define MAC_FRAME_DATA (MAC_FRAME_TYPE_DATA | 0x0000) -#define MAC_FRAME_DATA_CF_ACK (MAC_FRAME_TYPE_DATA | 0x0010) -#define MAC_FRAME_DATA_CF_POLL (MAC_FRAME_TYPE_DATA | 0x0020) -#define MAC_FRAME_DATA_CF_ACK_CF_POLL (MAC_FRAME_TYPE_DATA | 0x0030) -#define MAC_FRAME_NULL (MAC_FRAME_TYPE_DATA | 0x0040) -#define MAC_FRAME_CF_ACK (MAC_FRAME_TYPE_DATA | 0x0050) -#define MAC_FRAME_CF_POLL (MAC_FRAME_TYPE_DATA | 0x0060) -#define MAC_FRAME_CF_ACK_CF_POLL (MAC_FRAME_TYPE_DATA | 0x0070) -#define MAC_FRAME_QOS_DATA (MAC_FRAME_TYPE_DATA | 0x0080) -#define MAC_FRAME_QOS_DATA_CF_ACK (MAC_FRAME_TYPE_DATA | 0x0090) -#define MAC_FRAME_QOS_DATA_CF_POLL (MAC_FRAME_TYPE_DATA | 0x00A0) -#define MAC_FRAME_QOS_DATA_CF_ACK_CF_POLL (MAC_FRAME_TYPE_DATA | 0x00B0) -#define MAC_FRAME_QOS_NULL (MAC_FRAME_TYPE_DATA | 0x00C0) -#define MAC_FRAME_QOS_CF_POLL (MAC_FRAME_TYPE_DATA | 0x00E0) -#define MAC_FRAME_QOS_CF_ACK_CF_POLL (MAC_FRAME_TYPE_DATA | 0x00F0) - -/* 7.1.3.2 Mask for the AID value in the Duration/ID field */ -#define MASK_DI_DURATION BITS(0,14) -#define MASK_DI_AID BITS(0,13) -#define MASK_DI_AID_MSB BITS(14,15) -#define MASK_DI_CFP_FIXED_VALUE BIT(15) - -/* 7.1.3.4 Masks for the subfields in the Sequence Control field */ -#define MASK_SC_SEQ_NUM BITS(4,15) -#define MASK_SC_SEQ_NUM_OFFSET 4 -#define MASK_SC_FRAG_NUM BITS(0,3) -#define INVALID_SEQ_CTRL_NUM 0x000F /* According to 6.2.1.1.2 - * FRAG_NUM won't equal to 15 - */ - -/* 7.1.3.5 QoS Control field */ -#define TID_NUM 16 -#define TID_MASK BITS(0,3) -#define EOSP BIT(4) -#define ACK_POLICY BITS(5,6) -#define A_MSDU_PRESENT BIT(7) - -#define MASK_QC_TID BITS(0,3) -#define MASK_QC_EOSP BIT(4) -#define MASK_QC_EOSP_OFFSET 4 -#define MASK_QC_ACK_POLICY BITS(5, 6) -#define MASK_QC_ACK_POLICY_OFFSET 5 -#define MASK_QC_A_MSDU_PRESENT BIT(7) - -/* 7.1.3.5a HT Control field */ -#define HT_CTRL_LINK_ADAPTATION_CTRL BITS(0,15) -#define HT_CTRL_CALIBRATION_POSITION BITS(16,17) -#define HT_CTRL_CALIBRATION_SEQUENCE BITS(18,19) -#define HT_CTRL_CSI_STEERING BITS(22,23) -#define HT_CTRL_NDP_ANNOUNCEMENT BIT(24) -#define HT_CTRL_AC_CONSTRAINT BIT(30) -#define HT_CTRL_RDG_MORE_PPDU BIT(31) - -#define LINK_ADAPTATION_CTRL_TRQ BIT(1) -#define LINK_ADAPTATION_CTRL_MAI_MRQ BIT(2) -#define LINK_ADAPTATION_CTRL_MAI_MSI BITS(3,5) -#define LINK_ADAPTATION_CTRL_MFSI BITS(6,8) -#define LINK_ADAPTATION_CTRL_MFB_ASELC_CMD BITS(9,11) -#define LINK_ADAPTATION_CTRL_MFB_ASELC_DATA BITS(12,15) - -/* 7.1.3.5.3 Ack Policy subfield*/ -#define ACK_POLICY_NORMAL_ACK_IMPLICIT_BA_REQ 0 -#define ACK_POLICY_NO_ACK 1 -#define ACK_POLICY_NO_EXPLICIT_ACK_PSMP_ACK 2 -#define ACK_POLICY_BA 3 - -/* 7.1.3.7 FCS field */ -#define FCS_LEN 4 - -/* 7.2.1.4 WLAN Control Frame - PS-POLL Frame */ -#define PSPOLL_FRAME_LEN 16 /* w/o FCS */ - -/* 7.2.7.1 BAR */ -#define OFFSET_BAR_SSC_SN 4 - -/* 8.3.2.2 TKIP MPDU formats */ -#define TKIP_MIC_LEN 8 - -/* 2009.11.30 mtk02468: Moved these definitions to the right place */ -#if 0 -/* Block Ack Parameter Set field */ -#define BA_PARM_BA_POLICY BIT(1) -#define BA_PARM_TID BITS(2,5) -#define BA_PARM_BUFFER_SIZE BITS(6,15) -#endif - -#define BA_POLICY_IMMEDIATE BIT(1) - -/* Block Ack Starting Sequence Control field */ -#define BA_START_SEQ_CTL_FRAG_NUM BITS(0,3) -#define BA_START_SEQ_CTL_SSN BITS(4,15) - -/* BAR Control field */ -#define BAR_CONTROL_NO_ACK_POLICY BIT(0) -#define BAR_CONTROL_MULTI_TID BIT(1) -#define BAR_CONTROL_COMPRESSED_BA BIT(2) -#define BAR_CONTROL_TID_INFO BITS(12,15) -#define BAR_CONTROL_TID_INFO_OFFSET 12 - -/* TID Value */ -#define BAR_INFO_TID_VALUE BITS(12,15) - -#define BAR_COMPRESSED_VARIANT_FRAME_LEN (16 + 4) - -//3 /* --------------- IEEE 802.11 frame body fields --------------- */ -//3 Management frame body components (I): Fixed Fields. -/* 7.3.1.1 Authentication Algorithm Number field */ -#define AUTH_ALGORITHM_NUM_FIELD_LEN 2 - -#define AUTH_ALGORITHM_NUM_OPEN_SYSTEM 0 /* Open System */ -#define AUTH_ALGORITHM_NUM_SHARED_KEY 1 /* Shared Key */ -#define AUTH_ALGORITHM_NUM_FAST_BSS_TRANSITION 2 /* Fast BSS Transition */ - -/* 7.3.1.2 Authentication Transaction Sequence Number field */ -#define AUTH_TRANSACTION_SEQENCE_NUM_FIELD_LEN 2 -#define AUTH_TRANSACTION_SEQ_1 1 -#define AUTH_TRANSACTION_SEQ_2 2 -#define AUTH_TRANSACTION_SEQ_3 3 -#define AUTH_TRANSACTION_SEQ_4 4 - -/* 7.3.1.3 Beacon Interval field */ -#define BEACON_INTERVAL_FIELD_LEN 2 - -/* 7.3.1.4 Capability Information field */ -#define CAP_INFO_FIELD_LEN 2 -#define CAP_INFO_ESS BIT(0) -#define CAP_INFO_IBSS BIT(1) -#define CAP_INFO_BSS_TYPE (CAP_INFO_ESS | CAP_INFO_IBSS) -#define CAP_INFO_CF_POLLABLE BIT(2) -#define CAP_INFO_CF_POLL_REQ BIT(3) -#define CAP_INFO_CF (CAP_INFO_CF_POLLABLE | CAP_INFO_CF_POLL_REQ) -#define CAP_INFO_PRIVACY BIT(4) -#define CAP_INFO_SHORT_PREAMBLE BIT(5) -#define CAP_INFO_PBCC BIT(6) -#define CAP_INFO_CH_AGILITY BIT(7) -#define CAP_INFO_SPEC_MGT BIT(8) -#define CAP_INFO_QOS BIT(9) -#define CAP_INFO_SHORT_SLOT_TIME BIT(10) -#define CAP_INFO_APSD BIT(11) -#define CAP_INFO_RESERVED BIT(12) -#define CAP_INFO_DSSS_OFDM BIT(13) -#define CAP_INFO_DELAYED_BLOCK_ACK BIT(14) -#define CAP_INFO_IMM_BLOCK_ACK BIT(15) -/* STA usage of CF-Pollable and CF-Poll Request subfields */ -/* STA: not CF-Pollable */ -#define CAP_CF_STA_NOT_POLLABLE 0x0000 -/* STA: CF-Pollable, not requesting on the CF-Polling list */ -#define CAP_CF_STA_NOT_ON_LIST CAP_INFO_CF_POLL_REQ -/* STA: CF-Pollable, requesting on the CF-Polling list */ -#define CAP_CF_STA_ON_LIST CAP_INFO_CF_POLLABLE -/* STA: CF-Pollable, requesting never to be polled */ -#define CAP_CF_STA_NEVER_POLLED (CAP_INFO_CF_POLLABLE | CAP_INFO_CF_POLL_REQ) - -/* AP usage of CF-Pollable and CF-Poll Request subfields */ -/* AP: No point coordinator (PC) */ -#define CAP_CF_AP_NO_PC 0x0000 -/* AP: PC at AP for delivery only (no polling) */ -#define CAP_CF_AP_DELIVERY_ONLY CAP_INFO_CF_POLL_REQ -/* AP: PC at AP for delivery and polling */ -#define CAP_CF_AP_DELIVERY_POLLING CAP_INFO_CF_POLLABLE - -/* 7.3.1.5 Current AP Address field */ -#define CURR_AP_ADDR_FIELD_LEN MAC_ADDR_LEN - -/* 7.3.1.6 Listen Interval field */ -#define LISTEN_INTERVAL_FIELD_LEN 2 - -/* 7.3.1.7 Reason Code field */ -#define REASON_CODE_FIELD_LEN 2 - -#define REASON_CODE_RESERVED 0 /* Reseved */ -#define REASON_CODE_UNSPECIFIED 1 /* Unspecified reason */ -#define REASON_CODE_PREV_AUTH_INVALID 2 /* Previous auth no longer valid */ -#define REASON_CODE_DEAUTH_LEAVING_BSS 3 /* Deauth because sending STA is leaving BSS */ -#define REASON_CODE_DISASSOC_INACTIVITY 4 /* Disassoc due to inactivity */ -#define REASON_CODE_DISASSOC_AP_OVERLOAD 5 /* Disassoc because AP is unable to handle all assoc STAs */ -#define REASON_CODE_CLASS_2_ERR 6 /* Class 2 frame rx from nonauth STA */ -#define REASON_CODE_CLASS_3_ERR 7 /* Class 3 frame rx from nonassoc STA */ -#define REASON_CODE_DISASSOC_LEAVING_BSS 8 /* Disassoc because sending STA is leaving BSS */ -#define REASON_CODE_ASSOC_BEFORE_AUTH 9 /* STA requesting (re)assoc is not auth with responding STA */ -#define REASON_CODE_DISASSOC_PWR_CAP_UNACCEPTABLE 10 /* Disassoc because the info in Power Capability is unacceptable */ -#define REASON_CODE_DISASSOC_SUP_CHS_UNACCEPTABLE 11 /* Disassoc because the info in Supported Channels is unacceptable */ -#define REASON_CODE_INVALID_INFO_ELEM 13 /* Invalid information element */ -#define REASON_CODE_MIC_FAILURE 14 /* MIC failure */ -#define REASON_CODE_4_WAY_HANDSHAKE_TIMEOUT 15 /* 4-way handshake timeout */ -#define REASON_CODE_GROUP_KEY_UPDATE_TIMEOUT 16 /* Group key update timeout */ -#define REASON_CODE_DIFFERENT_INFO_ELEM 17 /* Info element in 4-way handshake different from (Re-)associate request/Probe response/Beacon */ -#define REASON_CODE_MULTICAST_CIPHER_NOT_VALID 18 /* Multicast Cipher is not valid */ -#define REASON_CODE_UNICAST_CIPHER_NOT_VALID 19 /* Unicast Cipher is not valid */ -#define REASON_CODE_AKMP_NOT_VALID 20 /* AKMP is not valid */ -#define REASON_CODE_UNSUPPORTED_RSNE_VERSION 21 /* Unsupported RSNE version */ -#define REASON_CODE_INVALID_RSNE_CAPABILITIES 22 /* Invalid RSNE Capabilities */ -#define REASON_CODE_IEEE_802_1X_AUTH_FAILED 23 /* IEEE 802.1X Authentication failed */ -#define REASON_CODE_CIPHER_REJECT_SEC_POLICY 24 /* Cipher suite rejected because of the security policy */ -#define REASON_CODE_DISASSOC_UNSPECIFIED_QOS 32 /* Disassoc for unspecified, QoS-related reason */ -#define REASON_CODE_DISASSOC_LACK_OF_BANDWIDTH 33 /* Disassoc because QAP lacks sufficient bandwidth for this QSTA */ -#define REASON_CODE_DISASSOC_ACK_LOST_POOR_CHANNEL 34 /* Disassoc because of too many ACKs lost for AP transmissions and/or poor channel conditions */ -#define REASON_CODE_DISASSOC_TX_OUTSIDE_TXOP_LIMIT 35 /* Disassoc because QSTA is transmitting outside the limits of its TXOPs */ -#define REASON_CODE_PEER_WHILE_LEAVING 36 /* QSTA is leaving the QBSS or resetting */ -#define REASON_CODE_PEER_REFUSE_DLP 37 /* Peer does not want to use this mechanism */ -#define REASON_CODE_PEER_SETUP_REQUIRED 38 /* Frames received but a setup is reqired */ -#define REASON_CODE_PEER_TIME_OUT 39 /* Time out */ -#define REASON_CODE_PEER_CIPHER_UNSUPPORTED 45 /* Peer does not support the requested cipher suite */ - -/* 7.3.1.8 AID field */ -#define AID_FIELD_LEN 2 -#define AID_MASK BITS(0,13) -#define AID_MSB BITS(14,15) -#define AID_MIN_VALUE 1 -#define AID_MAX_VALUE 2007 - -/* 7.3.1.9 Status Code field */ -#define STATUS_CODE_FIELD_LEN 2 - -#define STATUS_CODE_RESERVED 0 /* Reserved - Used by TX Auth */ -#define STATUS_CODE_SUCCESSFUL 0 /* Successful */ -#define STATUS_CODE_UNSPECIFIED_FAILURE 1 /* Unspecified failure */ -#define STATUS_CODE_CAP_NOT_SUPPORTED 10 /* Cannot support all requested cap in the Cap Info field */ -#define STATUS_CODE_REASSOC_DENIED_WITHOUT_ASSOC 11 /* Reassoc denied due to inability to confirm that assoc exists */ -#define STATUS_CODE_ASSOC_DENIED_OUTSIDE_STANDARD 12 /* Assoc denied due to reason outside the scope of this std. */ -#define STATUS_CODE_AUTH_ALGORITHM_NOT_SUPPORTED 13 /* Responding STA does not support the specified auth algorithm */ -#define STATUS_CODE_AUTH_OUT_OF_SEQ 14 /* Rx an auth frame with auth transaction seq num out of expected seq */ -#define STATUS_CODE_AUTH_REJECTED_CHAL_FAIL 15 /* Auth rejected because of challenge failure */ -#define STATUS_CODE_AUTH_REJECTED_TIMEOUT 16 /* Auth rejected due to timeout waiting for next frame in sequence */ -#define STATUS_CODE_ASSOC_DENIED_AP_OVERLOAD 17 /* Assoc denied because AP is unable to handle additional assoc STAs */ -#define STATUS_CODE_ASSOC_DENIED_RATE_NOT_SUPPORTED 18 /* Assoc denied due to requesting STA not supporting all of basic rates */ -#define STATUS_CODE_ASSOC_DENIED_NO_SHORT_PREAMBLE 19 /* Assoc denied due to requesting STA not supporting short preamble */ -#define STATUS_CODE_ASSOC_DENIED_NO_PBCC 20 /* Assoc denied due to requesting STA not supporting PBCC */ -#define STATUS_CODE_ASSOC_DENIED_NO_CH_AGILITY 21 /* Assoc denied due to requesting STA not supporting channel agility */ -#define STATUS_CODE_ASSOC_REJECTED_NO_SPEC_MGT 22 /* Assoc rejected because Spectrum Mgt capability is required */ -#define STATUS_CODE_ASSOC_REJECTED_PWR_CAP 23 /* Assoc rejected because the info in Power Capability is unacceptable */ -#define STATUS_CODE_ASSOC_REJECTED_SUP_CHS 24 /* Assoc rejected because the info in Supported Channels is unacceptable */ -#define STATUS_CODE_ASSOC_DENIED_NO_SHORT_SLOT_TIME 25 /* Assoc denied due to requesting STA not supporting short slot time */ -#define STATUS_CODE_ASSOC_DENIED_NO_DSSS_OFDM 26 /* Assoc denied due to requesting STA not supporting DSSS-OFDM */ -#if CFG_SUPPORT_802_11W -#define STATUS_CODE_ASSOC_REJECTED_TEMPORARILY 30 /* IEEE 802.11w, Assoc denied due to the SA query */ -#define STATUS_CODE_ROBUST_MGMT_FRAME_POLICY_VIOLATION 31 /* IEEE 802.11w, Assoc denied due to the MFP select policy */ -#endif -#define STATUS_CODE_UNSPECIFIED_QOS_FAILURE 32 /* Unspecified, QoS-related failure */ -#define STATUS_CODE_ASSOC_DENIED_BANDWIDTH 33 /* Assoc denied due to insufficient bandwidth to handle another QSTA */ -#define STATUS_CODE_ASSOC_DENIED_POOR_CHANNEL 34 /* Assoc denied due to excessive frame loss rates and/or poor channel conditions */ -#define STATUS_CODE_ASSOC_DENIED_NO_QOS_FACILITY 35 /* Assoc denied due to requesting STA not supporting QoS facility */ -#define STATUS_CODE_REQ_DECLINED 37 /* Request has been declined */ -#define STATUS_CODE_REQ_INVALID_PARAMETER_VALUE 38 /* Request has not been successful as one or more parameters have invalid values */ -#define STATUS_CODE_REQ_NOT_HONORED_TSPEC 39 /* TS not created because request cannot be honored. Suggested TSPEC provided. */ -#define STATUS_CODE_INVALID_INFO_ELEMENT 40 /* Invalid information element */ -#define STATUS_CODE_INVALID_GROUP_CIPHER 41 /* Invalid group cipher */ -#define STATUS_CODE_INVALID_PAIRWISE_CIPHER 42 /* Invalid pairwise cipher */ -#define STATUS_CODE_INVALID_AKMP 43 /* Invalid AKMP */ -#define STATUS_CODE_UNSUPPORTED_RSN_IE_VERSION 44 /* Unsupported RSN information element version */ -#define STATUS_CODE_INVALID_RSN_IE_CAP 45 /* Invalid RSN information element capabilities */ -#define STATUS_CODE_CIPHER_SUITE_REJECTED 46 /* Cipher suite rejected because of security policy */ -#define STATUS_CODE_REQ_NOT_HONORED_TS_DELAY 47 /* TS not created becasue request cannot be honored. Attempt to create a TS later. */ -#define STATUS_CODE_DIRECT_LINK_NOT_ALLOWED 48 /* Direct Link is not allowed in the BSS by policy */ -#define STATUS_CODE_DESTINATION_STA_NOT_PRESENT 49 /* Destination STA is not present within this QBSS */ -#define STATUS_CODE_DESTINATION_STA_NOT_QSTA 50 /* Destination STA is not a QSTA */ -#define STATUS_CODE_ASSOC_DENIED_LARGE_LIS_INTERVAL 51 /* Association denied because the ListenInterval is too large */ - -/* proprietary definition of reserved field of Status Code */ -#define STATUS_CODE_JOIN_FAILURE 0xFFF0 /* Join failure */ -#define STATUS_CODE_JOIN_TIMEOUT 0xFFF1 /* Join timeout */ -#define STATUS_CODE_AUTH_TIMEOUT 0xFFF2 /* Authentication timeout */ -#define STATUS_CODE_ASSOC_TIMEOUT 0xFFF3 /* (Re)Association timeout */ -#define STATUS_CODE_CCX_CCKM_REASSOC_FAILURE 0xFFF4 /* CCX CCKM reassociation failure */ - - -/* 7.3.1.10 Timestamp field */ -#define TIMESTAMP_FIELD_LEN 8 - -/* 7.3.1.11 Category of Action field */ -#define CATEGORY_SPEC_MGT 0 -#define CATEGORY_QOS_ACTION 1 /* QoS action */ -#define CATEGORY_DLS_ACTION 2 /* Direct Link Protocol (DLP) action */ -#define CATEGORY_BLOCK_ACK_ACTION 3 /* Block ack action */ -#define CATEGORY_PUBLIC_ACTION 4 /* Public action */ -#define CATEGORY_RM_ACTION 5 /* Radio measurement action */ -#define CATEGORY_HT_ACTION 7 -#if CFG_SUPPORT_802_11W -#define CATEGORY_SA_QUERT_ACTION 8 -#endif -#define CATEGORY_WNM_ACTION 10 /* 802.11v Wireless Network Management */ -#define CATEGORY_UNPROTECTED_WNM_ACTION 11 /* 802.11v Wireless Network Management */ -#define CATEGORY_WME_MGT_NOTIFICATION 17 /* WME management notification */ -#define CATEGORY_VENDOR_SPECIFIC_ACTION 127 - - -/* 7.3.1.14 Block Ack Parameter Set field */ -#define BA_PARAM_SET_ACK_POLICY_MASK BIT(1) -#define BA_PARAM_SET_ACK_POLICY_MASK_OFFSET 1 -#define BA_PARAM_SET_TID_MASK BITS(2,5) -#define BA_PARAM_SET_TID_MASK_OFFSET 2 -#define BA_PARAM_SET_BUFFER_SIZE_MASK BITS(6,15) -#define BA_PARAM_SET_BUFFER_SIZE_MASK_OFFSET 6 - -#define BA_PARAM_SET_ACK_POLICY_IMMEDIATE_BA 1 -#define BA_PARAM_SET_ACK_POLICY_DELAYED_BA 0 - - -//3 Management frame body components (II): Information Elements. -/* 7.3.2 Element IDs of information elements */ -#define ELEM_HDR_LEN 2 - -#define ELEM_ID_SSID 0 /* SSID */ -#define ELEM_ID_SUP_RATES 1 /* Supported rates */ -#define ELEM_ID_FH_PARAM_SET 2 /* FH parameter set */ -#define ELEM_ID_DS_PARAM_SET 3 /* DS parameter set */ -#define ELEM_ID_CF_PARAM_SET 4 /* CF parameter set */ -#define ELEM_ID_TIM 5 /* TIM */ -#define ELEM_ID_IBSS_PARAM_SET 6 /* IBSS parameter set */ -#define ELEM_ID_COUNTRY_INFO 7 /* Country information */ -#define ELEM_ID_HOPPING_PATTERN_PARAM 8 /* Hopping pattern parameters */ -#define ELEM_ID_HOPPING_PATTERN_TABLE 9 /* Hopping pattern table */ -#define ELEM_ID_REQUEST 10 /* Request */ -#define ELEM_ID_BSS_LOAD 11 /* BSS load */ -#define ELEM_ID_EDCA_PARAM_SET 12 /* EDCA parameter set */ -#define ELEM_ID_TSPEC 13 /* Traffic specification (TSPEC) */ -#define ELEM_ID_TCLAS 14 /* Traffic classification (TCLAS) */ -#define ELEM_ID_SCHEDULE 15 /* Schedule */ -#define ELEM_ID_CHALLENGE_TEXT 16 /* Challenge text */ - -#define ELEM_ID_PWR_CONSTRAINT 32 /* Power constraint */ -#define ELEM_ID_PWR_CAP 33 /* Power capability */ -#define ELEM_ID_TPC_REQ 34 /* TPC request */ -#define ELEM_ID_TPC_REPORT 35 /* TPC report */ -#define ELEM_ID_SUP_CHS 36 /* Supported channels */ -#define ELEM_ID_CH_SW_ANNOUNCEMENT 37 /* Channel switch announcement */ -#define ELEM_ID_MEASUREMENT_REQ 38 /* Measurement request */ -#define ELEM_ID_MEASUREMENT_REPORT 39 /* Measurement report */ -#define ELEM_ID_QUIET 40 /* Quiet */ -#define ELEM_ID_IBSS_DFS 41 /* IBSS DFS */ -#define ELEM_ID_ERP_INFO 42 /* ERP information */ -#define ELEM_ID_TS_DELAY 43 /* TS delay */ -#define ELEM_ID_TCLAS_PROCESSING 44 /* TCLAS processing */ -#define ELEM_ID_HT_CAP 45 /* HT Capabilities subelement */ -#define ELEM_ID_QOS_CAP 46 /* QoS capability */ -#define ELEM_ID_RSN 48 /* RSN IE */ -#define ELEM_ID_EXTENDED_SUP_RATES 50 /* Extended supported rates */ -#if CFG_SUPPORT_802_11W -#define ELEM_ID_TIMEOUT_INTERVAL 56 /* 802.11w SA Timeout interval */ -#endif -#define ELEM_ID_HT_OP 61 /* HT Operation */ -#define ELEM_ID_SCO 62 /* Secondary Channel Offset */ -#define ELEM_ID_RRM_ENABLED_CAP 70 /* Radio Resource Management Enabled Capabilities */ -#define ELEM_ID_20_40_BSS_COEXISTENCE 72 /* 20/40 BSS Coexistence */ -#define ELEM_ID_20_40_INTOLERANT_CHNL_REPORT 73 /* 20/40 BSS Intolerant Channel Report */ -#define ELEM_ID_OBSS_SCAN_PARAMS 74 /* Overlapping BSS Scan Parameters */ -#define ELEM_ID_EXTENDED_CAP 127 /* Extended capabilities */ - -#define ELEM_ID_VENDOR 221 /* Vendor specific IE */ -#define ELEM_ID_WPA ELEM_ID_VENDOR /* WPA IE */ -#define ELEM_ID_WMM ELEM_ID_VENDOR /* WMM IE */ -#define ELEM_ID_P2P ELEM_ID_VENDOR /* WiFi Direct */ -#define ELEM_ID_WSC ELEM_ID_VENDOR /* WSC IE */ - -#define ELEM_ID_RESERVED 255 /* Reserved */ - - -/* 7.3.2.1 SSID element */ -#define ELEM_MAX_LEN_SSID 32 - -/* 7.3.2.2 Supported Rates */ -#define ELEM_MAX_LEN_SUP_RATES 8 - -/* 7.3.2.4 DS Parameter Set */ -#define ELEM_MAX_LEN_DS_PARAMETER_SET 1 - -/* 7.3.2.5 CF Parameter Set */ -#define ELEM_CF_PARM_LEN 8 - -/* 7.3.2.6 TIM */ -#define ELEM_MIX_LEN_TIM 4 -#define ELEM_MAX_LEN_TIM 254 - -/* 7.3.2.7 IBSS Parameter Set element */ -#define ELEM_MAX_LEN_IBSS_PARAMETER_SET 2 - -/* 7.3.2.8 Challenge Text element */ -#define ELEM_MIN_LEN_CHALLENGE_TEXT 1 -#define ELEM_MAX_LEN_CHALLENGE_TEXT 253 - -/* 7.3.2.9 Country Information element */ -/* Country IE should contain at least 3-bytes country code string and one subband triplet. */ -#define ELEM_MIN_LEN_COUNTRY_INFO 6 - -#define ELEM_ID_COUNTRY_INFO_TRIPLET_LEN_FIXED 3 -#define ELEM_ID_COUNTRY_INFO_SUBBAND_TRIPLET_LEN_FIXED 3 -#define ELEM_ID_COUNTRY_INFO_REGULATORY_TRIPLET_LEN_FIXED 3 - - -/* 7.3.2.13 ERP Information element */ -#define ELEM_MAX_LEN_ERP 1 -/* -- bits in the ERP Information element */ -#define ERP_INFO_NON_ERP_PRESENT BIT(0) /* NonERP_Present bit */ -#define ERP_INFO_USE_PROTECTION BIT(1) /* Use_Protection bit */ -#define ERP_INFO_BARKER_PREAMBLE_MODE BIT(2) /* Barker_Preamble_Mode bit */ - - -/* 7.3.2.14 Extended Supported Rates */ -#define ELEM_MAX_LEN_EXTENDED_SUP_RATES 255 - -/* 7.3.2.21 Measurement Request element */ -#define ELEM_RM_TYPE_BASIC_REQ 0 -#define ELEM_RM_TYPE_CCA_REQ 1 -#define ELEM_RM_TYPE_RPI_HISTOGRAM_REQ 2 -#define ELEM_RM_TYPE_CHNL_LOAD_REQ 3 -#define ELEM_RM_TYPE_NOISE_HISTOGRAM_REQ 4 -#define ELEM_RM_TYPE_BEACON_REQ 5 -#define ELEM_RM_TYPE_FRAME_REQ 6 -#define ELEM_RM_TYPE_STA_STATISTICS_REQ 7 -#define ELEM_RM_TYPE_LCI_REQ 8 -#define ELEM_RM_TYPE_TS_REQ 9 -#define ELEM_RM_TYPE_MEASURE_PAUSE_REQ 255 - -/* 7.3.2.22 Measurement Report element */ -#define ELEM_RM_TYPE_BASIC_REPORT 0 -#define ELEM_RM_TYPE_CCA_REPORT 1 -#define ELEM_RM_TYPE_RPI_HISTOGRAM_REPORT 2 -#define ELEM_RM_TYPE_CHNL_LOAD_REPORT 3 -#define ELEM_RM_TYPE_NOISE_HISTOGRAM_REPORT 4 -#define ELEM_RM_TYPE_BEACON_REPORT 5 -#define ELEM_RM_TYPE_FRAME_REPORT 6 -#define ELEM_RM_TYPE_STA_STATISTICS_REPORT 7 -#define ELEM_RM_TYPE_LCI_REPORT 8 -#define ELEM_RM_TYPE_TS_REPORT 9 - - -/* 7.3.2.25 RSN information element */ -#define ELEM_MAX_LEN_WPA 24 /* one pairwise, one AKM suite, one PMKID */ -#define ELEM_MAX_LEN_RSN 38 /* one pairwise, one AKM suite, one PMKID */ -#define ELEM_MAX_LEN_WAPI 38 /* one pairwise, one AKM suite, one BKID */ -#define ELEM_MAX_LEN_WSC 200/* one pairwise, one AKM suite, one BKID */ - -#if CFG_SUPPORT_802_11W -#define ELEM_WPA_CAP_MFPR BIT(6) -#define ELEM_WPA_CAP_MFPC BIT(7) -#endif - -/* 7.3.2.27 Extended Capabilities information element */ -#define ELEM_EXT_CAP_20_40_COEXIST_SUPPORT BIT(0) -#define ELEM_EXT_CAP_PSMP_CAP BIT(4) -#define ELEM_EXT_CAP_SERVICE_INTERVAL_GRANULARITY BIT(5) -#define ELEM_EXT_CAP_SCHEDULE_PSMP BIT(6) - -#define ELEM_MAX_LEN_EXT_CAP (3 - ELEM_HDR_LEN) - -/* 7.3.2.30 TSPEC element */ -#define TS_INFO_TRAFFIC_TYPE_MASK BIT(0) //WMM: 0 (Asynchronous TS of low-duty cycles) -#define TS_INFO_TID_OFFSET 1 -#define TS_INFO_TID_MASK BITS(1,4) -#define TS_INFO_DIRECTION_OFFSET 5 -#define TS_INFO_DIRECTION_MASK BITS(5,6) -#define TS_INFO_ACCESS_POLICY_OFFSET 7 -#define TS_INFO_ACCESS_POLICY_MASK BITS(7,8) //WMM: Bit(7,8) = (1,0) = EDCA -#define TS_INFO_AGGREGATION_MASK BIT(9) //WMM: 0 -#define TS_INFO_APSD_MASK BIT(10) -#define TS_INFO_UP_OFFSET 11 -#define TS_INFO_UP_MASK BITS(11,13) -#define TS_INFO_ACK_POLICY_OFFSET 14 -#define TS_INFO_ACK_POLICY_MASK BITS(14,15) -#define TS_INFO_SCHEDULE_MASK 16 - -/* 7.3.2.56 HT capabilities element */ -#define ELEM_MAX_LEN_HT_CAP (28 - ELEM_HDR_LEN) /* sizeof(IE_HT_CAP_T)-2 */ - -/* 7.3.2.56.2 HT capabilities Info field */ -#define HT_CAP_INFO_LDPC_CAP BIT(0) -#define HT_CAP_INFO_SUP_CHNL_WIDTH BIT(1) -#define HT_CAP_INFO_SM_POWER_SAVE BITS(2,3) -#define HT_CAP_INFO_HT_GF BIT(4) -#define HT_CAP_INFO_SHORT_GI_20M BIT(5) -#define HT_CAP_INFO_SHORT_GI_40M BIT(6) -#define HT_CAP_INFO_TX_STBC BIT(7) -#define HT_CAP_INFO_RX_STBC BITS(8,9) -#define HT_CAP_INFO_HT_DELAYED_BA BIT(10) -#define HT_CAP_INFO_MAX_AMSDU_LEN BIT(11) -#define HT_CAP_INFO_DSSS_CCK_IN_40M BIT(12) -#define HT_CAP_INFO_40M_INTOLERANT BIT(14) -#define HT_CAP_INFO_LSIG_TXOP_SUPPORT BIT(15) - -#define HT_CAP_INFO_RX_STBC_NO_SUPPORTED 0 -#define HT_CAP_INFO_RX_STBC_1_SS BIT(8) -#define HT_CAP_INFO_RX_STBC_2_SS BIT(9) -#define HT_CAP_INFO_RX_STBC_3_SS HT_CAP_INFO_RX_STBC - -/* 7.3.2.56.3 A-MPDU Parameters field */ -#define AMPDU_PARAM_MAX_AMPDU_LEN_EXP BITS(0,1) -#define AMPDU_PARAM_MIN_START_SPACING BITS(2,4) - -#define AMPDU_PARAM_MAX_AMPDU_LEN_8K 0 -#define AMPDU_PARAM_MAX_AMPDU_LEN_16K BIT(0) -#define AMPDU_PARAM_MAX_AMPDU_LEN_32K BIT(1) -#define AMPDU_PARAM_MAX_AMPDU_LEN_64K BITS(0,1) - -#define AMPDU_PARAM_MSS_NO_RESTRICIT 0 -#define AMPDU_PARAM_MSS_1_4_US BIT(2) -#define AMPDU_PARAM_MSS_1_2_US BIT(3) -#define AMPDU_PARAM_MSS_1_US BITS(2,3) -#define AMPDU_PARAM_MSS_2_US BIT(4) -#define AMPDU_PARAM_MSS_4_US (BIT(4) | BIT(2)) -#define AMPDU_PARAM_MSS_8_US (BIT(4) | BIT(3)) -#define AMPDU_PARAM_MSS_16_US BITS(2,4) - -/* 7.3.2.56.4 Supported MCS Set field (TX rate: octects 12~15) */ -#define SUP_MCS_TX_SET_DEFINED BIT(0) -#define SUP_MCS_TX_RX_SET_NOT_EQUAL BIT(1) -#define SUP_MCS_TX_MAX_NUM_SS BITS(2,3) -#define SUP_MCS_TX_UNEQUAL_MODULATION BIT(4) - -#define SUP_MCS_TX_MAX_NUM_1_SS 0 -#define SUP_MCS_TX_MAX_NUM_2_SS BIT(2) -#define SUP_MCS_TX_MAX_NUM_3_SS BIT(3) -#define SUP_MCS_TX_MAX_NUM_4_SS BITS(2,3) - -#define SUP_MCS_RX_BITMASK_OCTET_NUM 10 -#define SUP_MCS_RX_DEFAULT_HIGHEST_RATE 0 /* Not specify */ - -/* 7.3.2.56.5 HT Extended Capabilities field */ -#define HT_EXT_CAP_PCO BIT(0) -#define HT_EXT_CAP_PCO_TRANSITION_TIME BITS(1,2) -#define HT_EXT_CAP_MCS_FEEDBACK BITS(8,9) -#define HT_EXT_CAP_HTC_SUPPORT BIT(10) -#define HT_EXT_CAP_RD_RESPONDER BIT(11) - -#define HT_EXT_CAP_PCO_TRANS_TIME_NONE 0 -#define HT_EXT_CAP_PCO_TRANS_TIME_400US BIT(1) -#define HT_EXT_CAP_PCO_TRANS_TIME_1_5MS BIT(2) -#define HT_EXT_CAP_PCO_TRANS_TIME_5MS BITS(1,2) - -#define HT_EXT_CAP_MCS_FEEDBACK_NO_FB 0 -#define HT_EXT_CAP_MCS_FEEDBACK_UNSOLICITED BIT(9) -#define HT_EXT_CAP_MCS_FEEDBACK_BOTH BITS(8,9) - -/* 7.3.2.56.6 Transmit Beamforming Capabilities field */ - -/* 7.3.2.56.7 Antenna Selection Capability field */ -#define ASEL_CAP_CAPABLE BIT(0) -#define ASEL_CAP_CSI_FB_BY_TX_ASEL_CAPABLE BIT(1) -#define ASEL_CAP_ANT_INDICES_FB_BY_TX_ASEL_CAPABLE BIT(2) -#define ASEL_CAP_EXPLICIT_CSI_FB_CAPABLE BIT(3) -#define ASEL_CAP_ANT_INDICES_CAPABLE BIT(4) -#define ASEL_CAP_RX_ASEL_CAPABLE BIT(5) -#define ASEL_CAP_TX_SOUNDING_CAPABLE BIT(6) - -/* 7.3.2.57 HT Operation element */ -#define ELEM_MAX_LEN_HT_OP (24 - ELEM_HDR_LEN) /* sizeof(IE_HT_OP_T)-2 */ - -#define HT_OP_INFO1_SCO BITS(0,1) -#define HT_OP_INFO1_STA_CHNL_WIDTH BIT(2) -#define HT_OP_INFO1_RIFS_MODE BIT(3) - -#define HT_OP_INFO2_HT_PROTECTION BITS(0,1) -#define HT_OP_INFO2_NON_GF_HT_STA_PRESENT BIT(2) -#define HT_OP_INFO2_OBSS_NON_HT_STA_PRESENT BIT(4) - -#define HT_OP_INFO3_DUAL_BEACON BIT(6) -#define HT_OP_INFO3_DUAL_CTS_PROTECTION BIT(7) -#define HT_OP_INFO3_STBC_BEACON BIT(8) -#define HT_OP_INFO3_LSIG_TXOP_FULL_SUPPORT BIT(9) -#define HT_OP_INFO3_PCO_ACTIVE BIT(10) -#define HT_OP_INFO3_PCO_PHASE BIT(11) - -/* 7.3.2.59 OBSS Scan Parameter element */ -#define ELEM_MAX_LEN_OBSS_SCAN (16 - ELEM_HDR_LEN) - -/* 7.3.2.60 20/40 BSS Coexistence element */ -#define ELEM_MAX_LEN_20_40_BSS_COEXIST (3 - ELEM_HDR_LEN) - -#define BSS_COEXIST_INFO_REQ BIT(0) -#define BSS_COEXIST_40M_INTOLERANT BIT(1) -#define BSS_COEXIST_20M_REQ BIT(2) -#define BSS_COEXIST_OBSS_SCAN_EXEMPTION_REQ BIT(3) -#define BSS_COEXIST_OBSS_SCAN_EXEMPTION_GRANT BIT(4) - - -//3 Management frame body components (III): 7.4 Action frame format details. -/* 7.4.1 Spectrum Measurement Action frame details */ -#define ACTION_MEASUREMENT_REQ 0 /* Spectrum measurement request */ -#define ACTION_MEASUREMENT_REPORT 1 /* Spectrum measurement report */ -#define ACTION_TPC_REQ 2 /* TPC request */ -#define ACTION_TPC_REPORT 3 /* TPC report */ -#define ACTION_CHNL_SWITCH 4 /* Channel Switch Announcement */ - -/* 7.4.2 QoS Action frame details */ -#define ACTION_ADDTS_REQ 0 /* ADDTS request */ -#define ACTION_ADDTS_RSP 1 /* ADDTS response */ -#define ACTION_DELTS 2 /* DELTS */ -#define ACTION_SCHEDULE 3 /* Schedule */ - -#define ACTION_ADDTS_REQ_FRAME_LEN (24+3+63) /* WMM TSPEC IE: 63 */ -#define ACTION_ADDTS_RSP_FRAME_LEN (24+4+63) /* WMM Status Code: 1; WMM TSPEC IE: 63*/ - -/* 7.4.3 DLS Action frame details */ -#define ACTION_DLS_REQ 0 /* DLS request */ -#define ACTION_DLS_RSP 1 /* DLS response */ -#define ACTION_DLS_TEARDOWN 2 /* DLS teardown */ - -/* 7.4.4 Block ack Action frame details */ -#define ACTION_ADDBA_REQ 0 /* ADDBA request */ -#define ACTION_ADDBA_RSP 1 /* ADDBA response */ -#define ACTION_DELBA 2 /* DELBA */ - -#define ACTION_ADDBA_REQ_FRAME_LEN (24+9) -#define ACTION_ADDBA_RSP_FRAME_LEN (24+9) - -#define ACTION_DELBA_INITIATOR_MASK BIT(11) -#define ACTION_DELBA_TID_MASK BITS(12,15) -#define ACTION_DELBA_TID_OFFSET 12 -#define ACTION_DELBA_FRAME_LEN (24+6) - -/* 7.4.6 Radio Measurement Action frame details */ -#define ACTION_RM_REQ 0 /* Radio measurement request */ -#define ACTION_RM_REPORT 1 /* Radio measurement report */ -#define ACTION_LM_REQ 2 /* Link measurement request */ -#define ACTION_LM_REPORT 3 /* Link measurement report */ -#define ACTION_NEIGHBOR_REPORT_REQ 4 /* Neighbor report request */ -#define ACTION_NEIGHBOR_REPORT_RSP 5 /* Neighbor report response */ - -/* 7.4.7 Public Action frame details */ -#define ACTION_PUBLIC_20_40_COEXIST 0 /* 20/40 BSS coexistence */ - -#if CFG_SUPPORT_802_11W -/* SA Query Action frame (IEEE 802.11w/D8.0, 7.4.9) */ -#define ACTION_SA_QUERY_REQUEST 0 -#define ACTION_SA_QUERY_RESPONSE 1 - -#define ACTION_SA_QUERY_TR_ID_LEN 2 - -/* Timeout Interval Type */ -#define ACTION_SA_TIMEOUT_REASSOC_DEADLINE 1 -#define ACTION_SA_TIMEOUT_KEY_LIFETIME 2 -#define ACTION_SA_TIMEOUT_ASSOC_COMEBACK 3 -#endif - -/* 7.4.10.1 HT action frame details */ -#define ACTION_HT_NOTIFY_CHANNEL_WIDTH 0 /* Notify Channel Width */ -#define ACTION_HT_SM_POWER_SAVE 1 /* SM Power Save */ -#define ACTION_HT_PSMP 2 /* PSMP */ -#define ACTION_HT_SET_PCO_PHASE 3 /* Set PCO Phase */ -#define ACTION_HT_CSI 4 /* CSI */ -#define ACTION_HT_NON_COMPRESSED_BEAMFORM 5 /* Non-compressed Beamforming */ -#define ACTION_HT_COMPRESSED_BEAMFORM 6 /* Compressed Beamforming */ -#define ACTION_HT_ANT_SEL_INDICES_FB 7 /* Antenna Selection Indices Feedback */ - -/* 802.11v Wireless Network Management */ -#define ACTION_WNM_TIMING_MEASUREMENT_REQUEST 27 - -#define ACTION_UNPROTECTED_WNM_TIM 0 -#define ACTION_UNPROTECTED_WNM_TIMING_MEASUREMENT 1 - -#define ACTION_UNPROTECTED_WNM_TIMING_MEAS_LEN 12 - -//3 /* --------------- WFA frame body fields --------------- */ -#define VENDOR_OUI_WFA { 0x00, 0x50, 0xF2 } -#define VENDOR_OUI_WFA_SPECIFIC { 0x50, 0x6F, 0x9A } -#define VENDOR_OUI_TYPE_WPA 1 -#define VENDOR_OUI_TYPE_WMM 2 -#define VENDOR_OUI_TYPE_WPS 4 -#define VENDOR_OUI_TYPE_P2P 9 - -#define VENDOR_OUI_TYPE_LEN 4 /* Length of OUI and Type */ - -/* VERSION(2 octets for WPA) / SUBTYPE(1 octet)-VERSION(1 octet) fields for WMM in WFA IE */ -#define VERSION_WPA 0x0001 /* Little Endian Format */ -#define VENDOR_OUI_SUBTYPE_VERSION_WMM_INFO 0x0100 -#define VENDOR_OUI_SUBTYPE_VERSION_WMM_PARAM 0x0101 - -/* SUBTYPE(1 octet) for WMM */ -#define VENDOR_OUI_SUBTYPE_WMM_INFO 0x00 /* WMM Spec version 1.1 */ -#define VENDOR_OUI_SUBTYPE_WMM_PARAM 0x01 -#define VENDOR_OUI_SUBTYPE_WMM_TSPEC 0x02 - -/* VERSION(1 octet) for WMM */ -#define VERSION_WMM 0x01 /* WMM Spec version 1.1 */ - -/* WMM-2.1.6 QoS Control Field */ -#define WMM_QC_UP_MASK BITS(0,2) -#define WMM_QC_EOSP BIT(4) -#define WMM_QC_ACK_POLICY_MASK BITS(5, 6) -#define WMM_QC_ACK_POLICY_OFFSET 5 -#define WMM_QC_ACK_POLICY_ACKNOWLEDGE 0 -#define WMM_QC_ACK_POLICY_NOT_ACKNOWLEDGE (1 << WMM_QC_ACK_POLICY_OFFSET) - - -/* WMM-2.2.1 WMM Information Element */ -#define ELEM_MIN_LEN_WFA_OUI_TYPE_SUBTYPE 6 - - -//3 Control frame body -/* 7.2.1.7 BlockAckReq */ -#define CTRL_BAR_BAR_CONTROL_OFFSET 16 -#define CTRL_BAR_BAR_INFORMATION_OFFSET 18 - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -#if defined(WINDOWS_DDK) || defined(WINDOWS_CE) -#pragma pack(1) -#endif - -typedef struct _LLC_SNAP_HEADER_T { - UINT_8 ucDSAP; - UINT_8 ucSSAP; - UINT_8 ucControl; - UINT_8 aucCode[3]; - UINT_16 u2Type; -} __KAL_ATTRIB_PACKED__ LLC_SNAP_HEADER_T, *P_LLC_SNAP_HEADER_T; - -//3 MAC Header. -/* Ethernet Frame Header */ -typedef struct _ETH_FRAME_HEADER_T { - UINT_8 aucDestAddr[MAC_ADDR_LEN]; - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; - UINT_16 u2TypeLen; -} __KAL_ATTRIB_PACKED__ ETH_FRAME_HEADER_T, *P_ETH_FRAME_HEADER_T; - -/* Ethernet Frame Structure */ -typedef struct _ETH_FRAME_T { - UINT_8 aucDestAddr[MAC_ADDR_LEN]; - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; - UINT_16 u2TypeLen; - UINT_8 aucData[1]; -} __KAL_ATTRIB_PACKED__ ETH_FRAME_T, *P_ETH_FRAME_T; - - -/* IEEE 802.11 WLAN Frame Structure */ -/* WLAN MAC Header (without Address 4 and QoS Control fields) */ -typedef struct _WLAN_MAC_HEADER_T { - UINT_16 u2FrameCtrl; - UINT_16 u2DurationID; - UINT_8 aucAddr1[MAC_ADDR_LEN]; - UINT_8 aucAddr2[MAC_ADDR_LEN]; - UINT_8 aucAddr3[MAC_ADDR_LEN]; - UINT_16 u2SeqCtrl; -} __KAL_ATTRIB_PACKED__ WLAN_MAC_HEADER_T, *P_WLAN_MAC_HEADER_T; - - -/* WLAN MAC Header (QoS Control fields included) */ -typedef struct _WLAN_MAC_HEADER_QOS_T { - UINT_16 u2FrameCtrl; - UINT_16 u2DurationID; - UINT_8 aucAddr1[MAC_ADDR_LEN]; - UINT_8 aucAddr2[MAC_ADDR_LEN]; - UINT_8 aucAddr3[MAC_ADDR_LEN]; - UINT_16 u2SeqCtrl; - UINT_16 u2QosCtrl; -} __KAL_ATTRIB_PACKED__ WLAN_MAC_HEADER_QOS_T, *P_WLAN_MAC_HEADER_QOS_T; - - -/* WLAN MAC Header (HT Control fields included) */ -typedef struct _WLAN_MAC_HEADER_HT_T { - UINT_16 u2FrameCtrl; - UINT_16 u2DurationID; - UINT_8 aucAddr1[MAC_ADDR_LEN]; - UINT_8 aucAddr2[MAC_ADDR_LEN]; - UINT_8 aucAddr3[MAC_ADDR_LEN]; - UINT_16 u2SeqCtrl; - UINT_16 u2QosCtrl; - UINT_32 u4HtCtrl; -} __KAL_ATTRIB_PACKED__ WLAN_MAC_HEADER_HT_T, *P_WLAN_MAC_HEADER_HT_T; - - -/* WLAN MAC Header (Address 4 included) */ -typedef struct _WLAN_MAC_HEADER_A4_T { - UINT_16 u2FrameCtrl; - UINT_16 u2DurationID; - UINT_8 aucAddr1[MAC_ADDR_LEN]; - UINT_8 aucAddr2[MAC_ADDR_LEN]; - UINT_8 aucAddr3[MAC_ADDR_LEN]; - UINT_16 u2SeqCtrl; - UINT_8 aucAddr4[MAC_ADDR_LEN]; -} __KAL_ATTRIB_PACKED__ WLAN_MAC_HEADER_A4_T, *P_WLAN_MAC_HEADER_A4_T; - - -/* WLAN MAC Header (Address 4 and QoS Control fields included) */ -typedef struct _WLAN_MAC_HEADER_A4_QOS_T { - UINT_16 u2FrameCtrl; - UINT_16 u2DurationID; - UINT_8 aucAddr1[MAC_ADDR_LEN]; - UINT_8 aucAddr2[MAC_ADDR_LEN]; - UINT_8 aucAddr3[MAC_ADDR_LEN]; - UINT_16 u2SeqCtrl; - UINT_8 aucAddr4[MAC_ADDR_LEN]; - UINT_16 u2QosCtrl; -} __KAL_ATTRIB_PACKED__ WLAN_MAC_HEADER_A4_QOS_T, *P_WLAN_MAC_HEADER_A4_QOS_T; - - -typedef struct _WLAN_MAC_HEADER_A4_HT_T { - UINT_16 u2FrameCtrl; - UINT_16 u2DurationID; - UINT_8 aucAddr1[MAC_ADDR_LEN]; - UINT_8 aucAddr2[MAC_ADDR_LEN]; - UINT_8 aucAddr3[MAC_ADDR_LEN]; - UINT_16 u2SeqCtrl; - UINT_8 aucAddr4[MAC_ADDR_LEN]; - UINT_16 u2QosCtrl; - UINT_32 u4HtCtrl; -} __KAL_ATTRIB_PACKED__ WLAN_MAC_HEADER_A4_HT_T, *P_WLAN_MAC_HEADER_A4_HT_T; - - -/* 7.2.3 WLAN MAC Header for Management Frame - MMPDU */ -typedef struct _WLAN_MAC_MGMT_HEADER_T { - UINT_16 u2FrameCtrl; - UINT_16 u2Duration; - UINT_8 aucDestAddr[MAC_ADDR_LEN]; - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; - UINT_8 aucBSSID[MAC_ADDR_LEN]; - UINT_16 u2SeqCtrl; -} __KAL_ATTRIB_PACKED__ WLAN_MAC_MGMT_HEADER_T, *P_WLAN_MAC_MGMT_HEADER_T; - - -/* WLAN MAC Header for Management Frame (HT Control fields included) */ -typedef struct _WLAN_MAC_MGMT_HEADER_HT_T { - UINT_16 u2FrameCtrl; - UINT_16 u2DurationID; - UINT_8 aucAddr1[MAC_ADDR_LEN]; - UINT_8 aucAddr2[MAC_ADDR_LEN]; - UINT_8 aucAddr3[MAC_ADDR_LEN]; - UINT_16 u2SeqCtrl; - UINT_32 u4HtCtrl; -} __KAL_ATTRIB_PACKED__ WLAN_MAC_MGMT_HEADER_HT_T, *P_WLAN_MAC_MGMT_HEADER_HT_T; - -//3 WLAN CONTROL Frame -/* 7.2.1.4 WLAN Control Frame - PS-POLL Frame */ -typedef struct _CTRL_PSPOLL_FRAME_T { - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2AID; /* AID */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_8 aucTA[MAC_ADDR_LEN]; /* TA */ -} __KAL_ATTRIB_PACKED__ CTRL_PSPOLL_FRAME_T, *P_CTRL_PSPOLL_FRAME_T; - - -/* BAR */ -typedef struct _CTRL_BAR_FRAME_T { - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2DurationID; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* RA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* TA */ - UINT_16 u2BarControl; - UINT_8 aucBarInfo[2]; /* Variable size */ -} __KAL_ATTRIB_PACKED__ CTRL_BAR_FRAME_T, *P_CTRL_BAR_FRAME_T; - -//3 WLAN Management Frame. -/* 7.2.3.1 WLAN Management Frame - Beacon Frame */ -typedef struct _WLAN_BEACON_FRAME_T { - /* Beacon header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2DurationID; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* Beacon frame body */ - UINT_32 au4Timestamp[2]; /* Timestamp */ - UINT_16 u2BeaconInterval; /* Beacon Interval */ - UINT_16 u2CapInfo; /* Capability */ - UINT_8 aucInfoElem[1]; /* Various IEs, start from SSID */ -} __KAL_ATTRIB_PACKED__ WLAN_BEACON_FRAME_T, *P_WLAN_BEACON_FRAME_T; - -typedef struct _WLAN_BEACON_FRAME_BODY_T { - /* Beacon frame body */ - UINT_32 au4Timestamp[2]; /* Timestamp */ - UINT_16 u2BeaconInterval; /* Beacon Interval */ - UINT_16 u2CapInfo; /* Capability */ - UINT_8 aucInfoElem[1]; /* Various IEs, start from SSID */ -} __KAL_ATTRIB_PACKED__ WLAN_BEACON_FRAME_BODY_T, *P_WLAN_BEACON_FRAME_BODY_T; - - -/* 7.2.3.3 WLAN Management Frame - Disassociation Frame */ -typedef struct _WLAN_DISASSOC_FRAME_T { - /* Authentication MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2DurationID; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* Disassociation frame body */ - UINT_16 u2ReasonCode; /* Reason code */ - UINT_8 aucInfoElem[1]; /* Various IEs, possible no. */ -} __KAL_ATTRIB_PACKED__ WLAN_DISASSOC_FRAME_T, *P_WLAN_DISASSOC_FRAME_T; - - -/* 7.2.3.4 WLAN Management Frame - Association Request frame */ -typedef struct _WLAN_ASSOC_REQ_FRAME_T { - /* Association Request MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2DurationID; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* Association Request frame body */ - UINT_16 u2CapInfo; /* Capability information */ - UINT_16 u2ListenInterval; /* Listen interval */ - UINT_8 aucInfoElem[1]; /* Information elements, include WPA IE */ -} __KAL_ATTRIB_PACKED__ WLAN_ASSOC_REQ_FRAME_T, *P_WLAN_ASSOC_REQ_FRAME_T; - - -/* 7.2.3.5 WLAN Management Frame - Association Response frame */ -typedef struct _WLAN_ASSOC_RSP_FRAME_T { - /* Association Response MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2DurationID; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* Association Response frame body */ - UINT_16 u2CapInfo; /* Capability information */ - UINT_16 u2StatusCode; /* Status code */ - UINT_16 u2AssocId; /* Association ID */ - UINT_8 aucInfoElem[1]; /* Information elements, such as - supported rates, and etc. */ -} __KAL_ATTRIB_PACKED__ WLAN_ASSOC_RSP_FRAME_T, *P_WLAN_ASSOC_RSP_FRAME_T; - - -/* 7.2.3.6 WLAN Management Frame - Reassociation Request frame */ -typedef struct _WLAN_REASSOC_REQ_FRAME_T { - /* Reassociation Request MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2DurationID; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* Reassociation Request frame body */ - UINT_16 u2CapInfo; /* Capability information */ - UINT_16 u2ListenInterval; /* Listen interval */ - UINT_8 aucCurrentAPAddr[MAC_ADDR_LEN]; /* Current AP address */ - UINT_8 aucInfoElem[1]; /* Information elements, include WPA IE */ -} __KAL_ATTRIB_PACKED__ WLAN_REASSOC_REQ_FRAME_T, *P_WLAN_REASSOC_REQ_FRAME_T; - - -/* 7.2.3.7 WLAN Management Frame - Reassociation Response frame - (the same as Association Response frame) */ -typedef WLAN_ASSOC_RSP_FRAME_T WLAN_REASSOC_RSP_FRAME_T, *P_WLAN_REASSOC_RSP_FRAME_T; - -/* 7.2.3.9 WLAN Management Frame - Probe Response Frame */ -typedef WLAN_BEACON_FRAME_T WLAN_PROBE_RSP_FRAME_T, *P_WLAN_PROBE_RSP_FRAME_T; - -/* 7.2.3.10 WLAN Management Frame - Authentication Frame */ -typedef struct _WLAN_AUTH_FRAME_T { - /* Authentication MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2DurationID; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* Authentication frame body */ - UINT_16 u2AuthAlgNum; /* Authentication algorithm number */ - UINT_16 u2AuthTransSeqNo; /* Authentication transaction sequence number */ - UINT_16 u2StatusCode; /* Status code */ - UINT_8 aucInfoElem[1]; /* Various IEs for Fast BSS Transition */ -} __KAL_ATTRIB_PACKED__ WLAN_AUTH_FRAME_T, *P_WLAN_AUTH_FRAME_T; - - -/* 7.2.3.11 WLAN Management Frame - Deauthentication Frame */ -typedef struct _WLAN_DEAUTH_FRAME_T { - /* Authentication MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2DurationID; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* Deauthentication frame body */ - UINT_16 u2ReasonCode; /* Reason code */ - UINT_8 aucInfoElem[1]; /* Various IEs, possible no. */ -} __KAL_ATTRIB_PACKED__ WLAN_DEAUTH_FRAME_T, *P_WLAN_DEAUTH_FRAME_T; - - - -//3 Information Elements. -/* 7.3.2 Generic element format */ -typedef struct _IE_HDR_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 aucInfo[1]; -} __KAL_ATTRIB_PACKED__ IE_HDR_T, *P_IE_HDR_T; - -/* 7.3.2.1 SSID element */ -typedef struct _IE_SSID_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 aucSSID[ELEM_MAX_LEN_SSID]; -} __KAL_ATTRIB_PACKED__ IE_SSID_T, *P_IE_SSID_T; - -/* 7.3.2.2 Supported Rates element */ -typedef struct _IE_SUPPORTED_RATE_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 aucSupportedRates[ELEM_MAX_LEN_SUP_RATES]; -} __KAL_ATTRIB_PACKED__ IE_SUPPORTED_RATE_T, *P_IE_SUPPORTED_RATE_T; - -/* 7.3.2.4 DS Parameter Set element */ -typedef struct _IE_DS_PARAM_SET_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 ucCurrChnl; -} __KAL_ATTRIB_PACKED__ IE_DS_PARAM_SET_T, *P_IE_DS_PARAM_SET_T; - - -/* 7.3.2.5 CF Parameter Set element */ -typedef struct _IE_CF_PARAM_SET_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 ucCFPCount; - UINT_8 ucCFPPeriod; - UINT_16 u2CFPMaxDur; - UINT_16 u2DurRemaining; -} __KAL_ATTRIB_PACKED__ IE_CF_PARAM_SET_T, *P_IE_CF_PARAM_SET_T; - - -/* 7.3.2.6 TIM */ -typedef struct _IE_TIM_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 ucDTIMCount; - UINT_8 ucDTIMPeriod; - UINT_8 ucBitmapControl; - UINT_8 aucPartialVirtualMap[1]; -} __KAL_ATTRIB_PACKED__ IE_TIM_T, *P_IE_TIM_T; - -/* 7.3.2.7 IBSS Parameter Set element */ -typedef struct _IE_IBSS_PARAM_SET_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_16 u2ATIMWindow; -} __KAL_ATTRIB_PACKED__ IE_IBSS_PARAM_SET_T, *P_IE_IBSS_PARAM_SET_T; - -/* 7.3.2.8 Challenge Text element */ -typedef struct _IE_CHALLENGE_TEXT_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 aucChallengeText[ELEM_MAX_LEN_CHALLENGE_TEXT]; -} __KAL_ATTRIB_PACKED__ IE_CHALLENGE_TEXT_T, *P_IE_CHALLENGE_TEXT_T; - -/* 7.3.2.9 Country information element */ -#if CFG_SUPPORT_802_11D -/*! \brief COUNTRY_INFO_TRIPLET is defined for the COUNTRY_INFO_ELEM structure. */ -typedef struct _COUNTRY_INFO_TRIPLET_T { - UINT_8 ucParam1; /*!< If param1 >= 201, this triplet is referred to as - Regulatory Triplet in 802_11J. */ - UINT_8 ucParam2; - UINT_8 ucParam3; -} __KAL_ATTRIB_PACKED__ COUNTRY_INFO_TRIPLET_T, *P_COUNTRY_INFO_TRIPLET_T; - -typedef struct _COUNTRY_INFO_SUBBAND_TRIPLET_T { - UINT_8 ucFirstChnlNum; /*!< First Channel Number */ - UINT_8 ucNumOfChnl; /*!< Number of Channels */ - INT_8 cMaxTxPwrLv; /*!< Maximum Transmit Power Level */ -} __KAL_ATTRIB_PACKED__ COUNTRY_INFO_SUBBAND_TRIPLET_T, *P_COUNTRY_INFO_SUBBAND_TRIPLET_T; - -typedef struct _COUNTRY_INFO_REGULATORY_TRIPLET_T { - UINT_8 ucRegExtId; /*!< Regulatory Extension Identifier, should - be greater than or equal to 201 */ - UINT_8 ucRegClass; /*!< Regulatory Class */ - UINT_8 ucCoverageClass; /*!< Coverage Class, unsigned 1-octet value 0~31 - , 32~255 reserved */ -} __KAL_ATTRIB_PACKED__ COUNTRY_INFO_REGULATORY_TRIPLET_T, *P_COUNTRY_INFO_REGULATORY_TRIPLET_T; - -typedef struct _IE_COUNTRY_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 aucCountryStr[3]; - COUNTRY_INFO_SUBBAND_TRIPLET_T arCountryStr[1]; -} __KAL_ATTRIB_PACKED__ IE_COUNTRY_T, *P_IE_COUNTRY_T; -#endif /* CFG_SUPPORT_802_11D */ - -/* 7.3.2.13 ERP element */ -typedef struct _IE_ERP_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 ucERP; -} __KAL_ATTRIB_PACKED__ IE_ERP_T, *P_IE_ERP_T; - -/* 7.3.2.14 Extended Supported Rates element */ -typedef struct _IE_EXT_SUPPORTED_RATE_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 aucExtSupportedRates[ELEM_MAX_LEN_EXTENDED_SUP_RATES]; -} __KAL_ATTRIB_PACKED__ IE_EXT_SUPPORTED_RATE_T, *P_IE_EXT_SUPPORTED_RATE_T; - -/* 7.3.2.15 Power Constraint element */ -typedef struct _IE_POWER_CONSTRAINT_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 ucLocalPowerConstraint; /* Unit: dBm */ -} __KAL_ATTRIB_PACKED__ IE_POWER_CONSTRAINT_T, *P_IE_POWER_CONSTRAINT_T; - -/* 7.3.2.16 Power Capability element */ -typedef struct _IE_POWER_CAP_T { - UINT_8 ucId; - UINT_8 ucLength; - INT_8 cMinTxPowerCap; /* Unit: dBm */ - INT_8 cMaxTxPowerCap; /* Unit: dBm */ -} __KAL_ATTRIB_PACKED__ IE_POWER_CAP_T, *P_IE_POWER_CAP_T; - -/* 7.3.2.17 TPC request element */ -typedef struct _IE_TPC_REQ_T { - UINT_8 ucId; - UINT_8 ucLength; -} __KAL_ATTRIB_PACKED__ IE_TPC_REQ_T, *P_IE_TPC_REQ_T; - -/* 7.3.2.18 TPC report element */ -typedef struct _IE_TPC_REPORT_T { - UINT_8 ucId; - UINT_8 ucLength; - INT_8 cTxPower; /* Unit: dBm */ - INT_8 cLinkMargin; /* Unit: dB */ -} __KAL_ATTRIB_PACKED__ IE_TPC_REPORT_T, *P_IE_TPC_REPORT_T; - -/* 7.3.2.20 Channel Switch Announcement element */ -typedef struct _IE_CHNL_SWITCH_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 ucSwitchMode; - UINT_8 ucNewChannel; - UINT_8 ucSwitchCount; -} __KAL_ATTRIB_PACKED__ IE_CHNL_SWITCH_T, *P_IE_CHNL_SWITCH_T; - -/* 7.3.2.21 Measurement Request element */ -typedef struct _IE_MEASUREMENT_REQ_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 ucToken; - UINT_8 ucRequestMode; - UINT_8 ucMeasurementType; - UINT_8 aucRequestFields[1]; -} __KAL_ATTRIB_PACKED__ IE_MEASUREMENT_REQ_T, *P_IE_MEASUREMENT_REQ_T; - -typedef struct _SM_BASIC_REQ_T { - UINT_8 ucChannel; - UINT_32 au4StartTime[2]; - UINT_16 u2Duration; -} __KAL_ATTRIB_PACKED__ SM_BASIC_REQ_T, *P_SM_BASIC_REQ_T; - -/* SM_COMMON_REQ_T is not specified in Spec. Use it as common structure of SM */ -typedef SM_BASIC_REQ_T SM_REQ_COMMON_T, *P_SM_REQ_COMMON_T; -typedef SM_BASIC_REQ_T SM_CCA_REQ_T, *P_SM_CCA_REQ_T; -typedef SM_BASIC_REQ_T SM_RPI_HISTOGRAM_REQ_T, *P_SM_RPI_HISTOGRAM_REQ_T; - -typedef struct _RM_CHNL_LOAD_REQ_T { - UINT_8 ucRegulatoryClass; - UINT_8 ucChannel; - UINT_16 u2RandomInterval; - UINT_16 u2Duration; - UINT_8 aucSubElements[1]; -} __KAL_ATTRIB_PACKED__ RM_CHNL_LOAD_REQ_T, *P_RM_CHNL_LOAD_REQ_T; - -typedef RM_CHNL_LOAD_REQ_T \ - RM_NOISE_HISTOGRAM_REQ_T, *P_RM_NOISE_HISTOGRAM_REQ_T; - -typedef struct _RM_BCN_REQ_T { - UINT_8 ucRegulatoryClass; - UINT_8 ucChannel; - UINT_16 u2RandomInterval; - UINT_16 u2Duration; - UINT_8 ucMeasurementMode; - UINT_8 aucBssid[6]; - UINT_8 aucSubElements[1]; -} __KAL_ATTRIB_PACKED__ RM_BCN_REQ_T, *P_RM_BCN_REQ_T; - -typedef struct _RM_FRAME_REQ_T { - UINT_8 ucRegulatoryClass; - UINT_8 ucChannel; - UINT_16 u2RandomInterval; - UINT_16 u2Duration; - UINT_8 ucFrameReqType; - UINT_8 aucMacAddr[6]; - UINT_8 aucSubElements[1]; -} __KAL_ATTRIB_PACKED__ RM_FRAME_REQ_T, *P_RM_FRAME_REQ_T; - -typedef struct _RM_STA_STATS_REQ_T { - UINT_8 aucPeerMacAddr[6]; - UINT_16 u2RandomInterval; - UINT_16 u2Duration; - UINT_8 ucGroupID; - UINT_8 aucSubElements[1]; -} __KAL_ATTRIB_PACKED__ RM_STA_STATS_REQ_T, *P_RM_STA_STATS_REQ_T; - -typedef struct _RM_LCI_REQ_T { - UINT_8 ucLocationSubject; - UINT_8 ucLatitudeResolution; - UINT_8 ucLongitudeResolution; - UINT_8 ucAltitudeResolution; - UINT_8 aucSubElements[1]; -} __KAL_ATTRIB_PACKED__ RM_LCI_REQ_T, *P_RM_LCI_REQ_T; - -typedef struct _RM_TS_MEASURE_REQ_T { - UINT_16 u2RandomInterval; - UINT_16 u2Duration; - UINT_8 aucPeerStaAddr[6]; - UINT_8 ucTrafficID; - UINT_8 ucBin0Range; - UINT_8 aucSubElements[1]; -} __KAL_ATTRIB_PACKED__ RM_TS_MEASURE_REQ_T, *P_RM_TS_MEASURE_REQ_T; - -typedef struct _RM_MEASURE_PAUSE_REQ_T { - UINT_16 u2PauseTime; - UINT_8 aucSubElements[1]; -} __KAL_ATTRIB_PACKED__ RM_MEASURE_PAUSE_REQ_T, *P_RM_MEASURE_PAUSE_REQ_T; - -/* 7.3.2.22 Measurement Report element */ -typedef struct _IE_MEASUREMENT_REPORT_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 ucToken; - UINT_8 ucReportMode; - UINT_8 ucMeasurementType; - UINT_8 aucReportFields[1]; -} __KAL_ATTRIB_PACKED__ IE_MEASUREMENT_REPORT_T, *P_IE_MEASUREMENT_REPORT_T; - -typedef struct _SM_BASIC_REPORT_T { - UINT_8 ucChannel; - UINT_32 u4StartTime[2]; - UINT_16 u2Duration; - UINT_8 ucMap; -} __KAL_ATTRIB_PACKED__ SM_BASIC_REPORT_T, *P_SM_BASIC_REPORT_T; - -typedef struct _SM_CCA_REPORT_T { - UINT_8 ucChannel; - UINT_32 u4StartTime[2]; - UINT_16 u2Duration; - UINT_8 ucCcaBusyFraction; -} __KAL_ATTRIB_PACKED__ SM_CCA_REPORT_T, *P_SM_CCA_REPORT_T; - -typedef struct _SM_RPI_REPORT_T { - UINT_8 ucChannel; - UINT_32 u4StartTime[2]; - UINT_16 u2Duration; - UINT_8 aucRPI[8]; -} __KAL_ATTRIB_PACKED__ SM_RPI_REPORT_T, *P_SM_RPI_REPORT_T; - -typedef struct _RM_CHNL_LOAD_REPORT_T { - UINT_8 ucRegulatoryClass; - UINT_8 ucChannel; - UINT_32 u4StartTime[2]; - UINT_16 u2Duration; - UINT_8 ucChnlLoad; -} __KAL_ATTRIB_PACKED__ RM_CHNL_LOAD_REPORT_T, *P_RM_CHNL_LOAD_REPORT_T; - -typedef struct _RM_IPI_REPORT_T { - UINT_8 ucRegulatoryClass; - UINT_8 ucChannel; - UINT_32 u4StartTime[2]; - UINT_16 u2Duration; - UINT_8 ucAntennaId; - INT_8 cANPI; - UINT_8 aucIPI[11]; -} __KAL_ATTRIB_PACKED__ RM_IPI_REPORT_T, *P_RM_IPI_REPORT_T; - -/* 7.3.2.23 Quiet element */ -typedef struct _IE_QUIET_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 ucCount; - UINT_8 ucPeriod; - UINT_16 u2Duration; - UINT_16 u2Offset; -} __KAL_ATTRIB_PACKED__ IE_QUIET_T, *P_IE_QUIET_T; - -/* 7.3.2.27 Extended Capabilities element */ -typedef struct _IE_EXT_CAP_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 aucCapabilities[1]; -} __KAL_ATTRIB_PACKED__ IE_EXT_CAP_T, *P_EXT_CAP_T; - -/* 7.3.2.27 Extended Capabilities element */ -typedef struct _IE_RRM_ENABLED_CAP_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 aucCap[5]; -} __KAL_ATTRIB_PACKED__ IE_RRM_ENABLED_CAP_T, *P_IE_RRM_ENABLED_CAP_T; - -/* 7.3.2.56 HT Capabilities element */ -typedef struct _SUP_MCS_SET_FIELD { - UINT_8 aucRxMcsBitmask[SUP_MCS_RX_BITMASK_OCTET_NUM]; - UINT_16 u2RxHighestSupportedRate; - UINT_32 u4TxRateInfo; -} __KAL_ATTRIB_PACKED__ SUP_MCS_SET_FIELD, *P_SUP_MCS_SET_FIELD; - -typedef struct _IE_HT_CAP_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_16 u2HtCapInfo; - UINT_8 ucAmpduParam; - SUP_MCS_SET_FIELD rSupMcsSet; - UINT_16 u2HtExtendedCap; - UINT_32 u4TxBeamformingCap; - UINT_8 ucAselCap; -} __KAL_ATTRIB_PACKED__ IE_HT_CAP_T, *P_IE_HT_CAP_T; - -/* 7.3.2.57 HT Operation element */ -typedef struct _IE_HT_OP_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 ucPrimaryChannel; - UINT_8 ucInfo1; - UINT_16 u2Info2; - UINT_16 u2Info3; - UINT_8 aucBasicMcsSet[16]; -} __KAL_ATTRIB_PACKED__ IE_HT_OP_T, *P_IE_HT_OP_T; - -/* 7.3.2.25 RSN Information element format */ -typedef struct _RSN_INFO_ELEM_T { - UCHAR ucElemId; - UCHAR ucLength; - UINT_16 u2Version; - UINT_32 u4GroupKeyCipherSuite; - UINT_16 u2PairwiseKeyCipherSuiteCount; - UCHAR aucPairwiseKeyCipherSuite1[4]; -} __KAL_ATTRIB_PACKED__ RSN_INFO_ELEM_T, *P_RSN_INFO_ELEM_T; - -/* 7.3.2.26 WPA Information element format */ -typedef struct _WPA_INFO_ELEM_T { - UCHAR ucElemId; - UCHAR ucLength; - UCHAR aucOui[3]; - UCHAR ucOuiType; - UINT_16 u2Version; - UINT_32 u4GroupKeyCipherSuite; - UINT_16 u2PairwiseKeyCipherSuiteCount; - UCHAR aucPairwiseKeyCipherSuite1[4]; -} __KAL_ATTRIB_PACKED__ WPA_INFO_ELEM_T, *P_WPA_INFO_ELEM_T; - -/* 7.3.2.58 20/40 BSS Intolerant Channel Report element */ -typedef struct _IE_INTOLERANT_CHNL_REPORT_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 ucRegulatoryClass; - UINT_8 aucChannelList[1]; -} __KAL_ATTRIB_PACKED__ IE_INTOLERANT_CHNL_REPORT_T, *P_IE_INTOLERANT_CHNL_REPORT_T; - -/* 7.3.2.59 OBSS Scan Parameters element */ -typedef struct _IE_OBSS_SCAN_PARAM_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_16 u2ScanPassiveDwell; - UINT_16 u2ScanActiveDwell; - UINT_16 u2TriggerScanInterval; - UINT_16 u2ScanPassiveTotalPerChnl; - UINT_16 u2ScanActiveTotalPerChnl; - UINT_16 u2WidthTransDelayFactor; - UINT_16 u2ScanActivityThres; -} __KAL_ATTRIB_PACKED__ IE_OBSS_SCAN_PARAM_T, *P_IE_OBSS_SCAN_PARAM_T; - -/* 7.3.2.60 20/40 BSS Coexistence element */ -typedef struct _IE_20_40_COEXIST_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 ucData; -} __KAL_ATTRIB_PACKED__ IE_20_40_COEXIST_T, *P_IE_20_40_COEXIST_T; - - -//3 7.4 Action Frame. -/* 7.4 Action frame format */ -typedef struct _WLAN_ACTION_FRAME { - /* Action MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2DurationID; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* Action frame body */ - UINT_8 ucCategory; /* Category */ - UINT_8 ucAction; /* Action Value */ - UINT_8 ucActionDetails[1]; /* Action details */ -} __KAL_ATTRIB_PACKED__ WLAN_ACTION_FRAME, *P_WLAN_ACTION_FRAME; - -/* 7.4.1.1 Spectrum Measurement Request frame format */ -typedef struct _ACTION_SM_REQ_FRAME { - /* ADDTS Request MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* ADDTS Request frame body */ - UINT_8 ucCategory; /* Category */ - UINT_8 ucAction; /* Action Value */ - UINT_8 ucDialogToken; /* Dialog Token */ - UINT_8 aucInfoElem[1]; /* Information elements */ -} __KAL_ATTRIB_PACKED__ ACTION_SM_REQ_FRAME, *P_ACTION_SM_REQ_FRAME; - -/* 7.4.1.2 Spectrum Measurement Report frame format */ -typedef ACTION_SM_REQ_FRAME ACTION_SM_REPORT_FRAME, *P_ACTION_SM_REPORT_FRAME; - -/* 7.4.2.1 ADDTS Request frame format */ -typedef struct _ACTION_ADDTS_REQ_FRAME { - /* ADDTS Request MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* ADDTS Request frame body */ - UINT_8 ucCategory; /* Category */ - UINT_8 ucAction; /* Action Value */ - UINT_8 ucDialogToken; /* Dialog Token */ - UINT_8 aucInfoElem[1]; /* Information elements, such as - TS Delay, and etc. */ -} __KAL_ATTRIB_PACKED__ ACTION_ADDTS_REQ_FRAME, *P_ACTION_ADDTS_REQ_FRAME; - - -/* 7.4.2.2 ADDTS Response frame format */ -typedef struct _ACTION_ADDTS_RSP_FRAME { - /* ADDTS Response MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* ADDTS Response frame body */ - UINT_8 ucCategory; /* Category */ - UINT_8 ucAction; /* Action Value */ - UINT_8 ucDialogToken; /* Dialog Token */ - UINT_8 ucStatusCode; /* WMM Status Code is of one byte */ - UINT_8 aucInfoElem[1]; /* Information elements, such as - TS Delay, and etc. */ -} __KAL_ATTRIB_PACKED__ ACTION_ADDTS_RSP_FRAME, *P_ACTION_ADDTS_RSP_FRAME; - - -/* 7.4.2.3 DELTS frame format */ -typedef struct _ACTION_DELTS_FRAME { - /* DELTS MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2DurationID; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* DELTS frame body */ - UINT_8 ucCategory; /* Category */ - UINT_8 ucAction; /* Action Value */ - UINT_8 aucTsInfo[3]; /* TS Info */ -} __KAL_ATTRIB_PACKED__ ACTION_DELTS_FRAME, *P_ACTION_DELTS_FRAME; - - -/* 7.4.4.1 ADDBA Request frame format */ -typedef struct _ACTION_ADDBA_REQ_FRAME_T { - /* Action MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2DurationID; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* Action frame body */ - UINT_8 ucCategory; /* Category */ - UINT_8 ucAction; /* Action Value */ - UINT_8 ucDialogToken; /* Dialog Token chosen by the sender */ - UINT_8 aucBAParameterSet[2]; /* BA policy, TID, buffer size */ - UINT_8 aucBATimeoutValue[2]; - UINT_8 aucBAStartSeqCtrl[2]; /* SSN */ -} __KAL_ATTRIB_PACKED__ ACTION_ADDBA_REQ_FRAME_T, *P_ACTION_ADDBA_REQ_FRAME_T; - -typedef struct _ACTION_ADDBA_REQ_BODY_T{ - UINT_16 u2BAParameterSet; /* BA policy, TID, buffer size */ - UINT_16 u2BATimeoutValue; - UINT_16 u2BAStartSeqCtrl; /* SSN */ -} __KAL_ATTRIB_PACKED__ ACTION_ADDBA_REQ_BODY_T, *P_ACTION_ADDBA_REQ_BODY_T; - -/* 7.4.4.2 ADDBA Response frame format */ -typedef struct _ACTION_ADDBA_RSP_FRAME_T { - /* Action MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2DurationID; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* Action frame body */ - UINT_8 ucCategory; /* Category */ - UINT_8 ucAction; /* Action Value */ - UINT_8 ucDialogToken; /* Dialog Token chosen by the sender */ - UINT_8 aucStatusCode[2]; - UINT_8 aucBAParameterSet[2]; /* BA policy, TID, buffer size */ - UINT_8 aucBATimeoutValue[2]; -} __KAL_ATTRIB_PACKED__ ACTION_ADDBA_RSP_FRAME_T, *P_ACTION_ADDBA_RSP_FRAME_T; - -typedef struct _ACTION_ADDBA_RSP_BODY_T { - UINT_16 u2StatusCode; - UINT_16 u2BAParameterSet; /* BA policy, TID, buffer size */ - UINT_16 u2BATimeoutValue; -} __KAL_ATTRIB_PACKED__ ACTION_ADDBA_RSP_BODY_T, *P_ACTION_ADDBA_RSP_BODY_T; - -/* 7.4.4.3 DELBA frame format */ -typedef struct _ACTION_DELBA_FRAME_T { - /* Action MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2DurationID; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* Action frame body */ - UINT_8 ucCategory; /* Category */ - UINT_8 ucAction; /* Action Value */ - UINT_16 u2DelBaParameterSet; /* Bit 11 Initiator, Bits 12-15 TID */ - UINT_16 u2ReasonCode; /* 7.3.1.7 */ -} __KAL_ATTRIB_PACKED__ ACTION_DELBA_FRAME_T, *P_ACTION_DELBA_FRAME_T; - -/* 7.4.6.1 Radio Measurement Request frame format */ -typedef struct _ACTION_RM_REQ_FRAME { - /* MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* Radio Measurement Request frame body */ - UINT_8 ucCategory; /* Category */ - UINT_8 ucAction; /* Action Value */ - UINT_8 ucDialogToken; /* Dialog Token */ - UINT_16 u2Repetitions; /* Number of repetitions */ - UINT_8 aucInfoElem[1]; /* Measurement Request elements, such as - channel load request, and etc. */ -} __KAL_ATTRIB_PACKED__ ACTION_RM_REQ_FRAME, *P_ACTION_RM_REQ_FRAME; - -/* 7.4.6.2 Radio Measurement Report frame format */ -typedef struct _ACTION_RM_REPORT_FRAME { - /* MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* Radio Measurement Report frame body */ - UINT_8 ucCategory; /* Category */ - UINT_8 ucAction; /* Action Value */ - UINT_8 ucDialogToken; /* Dialog Token */ - UINT_8 aucInfoElem[1]; /* Measurement Report elements, such as - channel load report, and etc. */ -} __KAL_ATTRIB_PACKED__ ACTION_RM_REPORT_FRAME, *P_ACTION_RM_REPORT_FRAME; - -/* 7.4.7.1a 20/40 BSS Coexistence Management frame format */ -typedef struct _ACTION_20_40_COEXIST_FRAME { - /* MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* BSS Coexistence Management frame body */ - UINT_8 ucCategory; /* Category */ - UINT_8 ucAction; /* Action Value */ - - IE_20_40_COEXIST_T rBssCoexist;/* 20/40 BSS coexistence element */ - IE_INTOLERANT_CHNL_REPORT_T rChnlReport;/* Intolerant channel report */ - -} __KAL_ATTRIB_PACKED__ ACTION_20_40_COEXIST_FRAME, *P_ACTION_20_40_COEXIST_FRAME; - - -#if CFG_SUPPORT_802_11W -/* 7.4.9 SA Query Management frame format */ -typedef struct _ACTION_SA_QUERY_FRAME { - /* MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* BSS Coexistence Management frame body */ - UINT_8 ucCategory; /* Category */ - UINT_8 ucAction; /* Action Value */ - - UINT_8 ucTransId[ACTION_SA_QUERY_TR_ID_LEN]; /* Transaction id */ - -} __KAL_ATTRIB_PACKED__ ACTION_SA_QUERY_FRAME, *P_ACTION_SA_QUERY_FRAME; -#endif - -/* 7.4.10 Notify Channel Width Management frame format */ -typedef struct _ACTION_NOTIFY_CHNL_WIDTH_FRAME { - /* MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* BSS Coexistence Management frame body */ - UINT_8 ucCategory; /* Category */ - UINT_8 ucAction; /* Action Value */ - UINT_8 ucChannelWidth; /* Channel Width */ -} __KAL_ATTRIB_PACKED__ ACTION_NOTIFY_CHNL_WIDTH_FRAME, *P_ACTION_NOTIFY_CHNL_WIDTH_FRAME; - -/* 802.11v Wireless Network Management: Timing Measurement Request */ -typedef struct _ACTION_WNM_TIMING_MEAS_REQ_FRAME { - /* MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* Timing Measurement Request Management frame body */ - UINT_8 ucCategory; /* Category */ - UINT_8 ucAction; /* Action Value */ - UINT_8 ucTrigger; /* Trigger */ -} __KAL_ATTRIB_PACKED__ ACTION_WNM_TIMING_MEAS_REQ_FRAME, *P_ACTION_WNM_TIMING_MEAS_REQ_FRAME; - -/* 802.11v Wireless Network Management: Timing Measurement */ -typedef struct _ACTION_UNPROTECTED_WNM_TIMING_MEAS_FRAME { - /* MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* Timing Measurement Management frame body */ - UINT_8 ucCategory; /* Category */ - UINT_8 ucAction; /* Action Value */ - UINT_8 ucDialogToken; /* Dialog Token */ - UINT_8 ucFollowUpDialogToken; /* Follow Up Dialog Token */ - UINT_32 u4ToD; /* Timestamp of Departure [10ns] */ - UINT_32 u4ToA; /* Timestamp of Arrival [10ns] */ - UINT_8 ucMaxToDErr; /* Maximum of ToD Error [10ns] */ - UINT_8 ucMaxToAErr; /* Maximum of ToA Error [10ns] */ -} __KAL_ATTRIB_PACKED__ ACTION_UNPROTECTED_WNM_TIMING_MEAS_FRAME, *P_ACTION_UNPROTECTED_WNM_TIMING_MEAS_FRAME; - -//3 Information Elements from WFA. -typedef struct _IE_WFA_T { - UINT_8 ucId; - UINT_8 ucLength; - UINT_8 aucOui[3]; - UINT_8 ucOuiType; - UINT_8 aucOuiSubTypeVersion[2]; - /*!< Please be noted. WPA defines a 16 bit field version - instead of one subtype field and one version field*/ -} __KAL_ATTRIB_PACKED__ IE_WFA_T, *P_IE_WFA_T; - -/* WAPI Information element format */ -typedef struct _WAPI_INFO_ELEM_T { - UCHAR ucElemId; - UCHAR ucLength; - UINT_16 u2Version; - UINT_16 u2AuthKeyMgtSuiteCount; - UCHAR aucAuthKeyMgtSuite1[4]; -} __KAL_ATTRIB_PACKED__ WAPI_INFO_ELEM_T, *P_WAPI_INFO_ELEM_T; - -#if defined(WINDOWS_DDK) || defined(WINDOWS_CE) -#pragma pack() -#endif - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -/* Convert the ECWmin(max) to CWmin(max) */ -#define ECW_TO_CW(_ECW) ((1 << (_ECW)) - 1) - -/* Convert the RCPI to dBm */ -#define RCPI_TO_dBm(_rcpi) \ - ((PARAM_RSSI)(((_rcpi) > RCPI_HIGH_BOUND ? RCPI_HIGH_BOUND : (_rcpi)) >> 1) - NDBM_LOW_BOUND_FOR_RCPI) - -/* Convert the dBm to RCPI */ -#define dBm_TO_RCPI(_dbm) \ - (RCPI)( ( (((PARAM_RSSI)(_dbm) + NDBM_LOW_BOUND_FOR_RCPI) << 1) > RCPI_HIGH_BOUND) ? RCPI_HIGH_BOUND : \ - ( (((PARAM_RSSI)(_dbm) + NDBM_LOW_BOUND_FOR_RCPI) << 1) < RCPI_LOW_BOUND ? RCPI_LOW_BOUND : \ - (((PARAM_RSSI)(_dbm) + NDBM_LOW_BOUND_FOR_RCPI) << 1) ) ) - -/* Convert an unsigned char pointer to an information element pointer */ -#define IE_ID(fp) (((P_IE_HDR_T) fp)->ucId) -#define IE_LEN(fp) (((P_IE_HDR_T) fp)->ucLength) -#define IE_SIZE(fp) (ELEM_HDR_LEN + IE_LEN(fp)) - -#define SSID_IE(fp) ((P_IE_SSID_T) fp) - -#define SUP_RATES_IE(fp) ((P_IE_SUPPORTED_RATE_T) fp) - -#define DS_PARAM_IE(fp) ((P_IE_DS_PARAM_SET_T) fp) - -#define TIM_IE(fp) ((P_IE_TIM_T) fp) - -#define IBSS_PARAM_IE(fp) ((P_IE_IBSS_PARAM_SET_T) fp) - -#define ERP_INFO_IE(fp) ((P_IE_ERP_T) fp) - -#define EXT_SUP_RATES_IE(fp) ((P_IE_EXT_SUPPORTED_RATE_T) fp) - -#define WFA_IE(fp) ((P_IE_WFA_T) fp) - -#if CFG_SUPPORT_802_11D -#define COUNTRY_IE(fp) ((P_IE_COUNTRY_T) fp) -#endif - -#define EXT_CAP_IE(fp) ((P_EXT_CAP_T) fp) - -#define HT_CAP_IE(fp) ((P_IE_HT_CAP_T) fp) - -#define HT_OP_IE(fp) ((P_IE_HT_OP_T) fp) - -#define OBSS_SCAN_PARAM_IE(fp) ((P_IE_OBSS_SCAN_PARAM_T) fp) - -#define BSS_20_40_COEXIST_IE(fp) ((P_IE_20_40_COEXIST_T) fp) - -#define QUIET_IE(fp) ((P_IE_QUIET_T) fp) - - - -/* The macro to check if the MAC address is B/MCAST Address */ -#define IS_BMCAST_MAC_ADDR(_pucDestAddr) \ - ((BOOLEAN) ( ((PUINT_8)(_pucDestAddr))[0] & BIT(0) )) - -/* The macro to check if the MAC address is UCAST Address */ -#define IS_UCAST_MAC_ADDR(_pucDestAddr) \ - ((BOOLEAN) !( ((PUINT_8)(_pucDestAddr))[0] & BIT(0) )) - -/* The macro to copy the MAC address */ -#define COPY_MAC_ADDR(_pucDestAddr, _pucSrcAddr) \ - kalMemCopy(_pucDestAddr, _pucSrcAddr, MAC_ADDR_LEN) - -/* The macro to check if two MAC addresses are equal */ -#define EQUAL_MAC_ADDR(_pucDestAddr, _pucSrcAddr) \ - (!kalMemCmp(_pucDestAddr, _pucSrcAddr, MAC_ADDR_LEN)) - -/* The macro to check if two MAC addresses are not equal */ -#define UNEQUAL_MAC_ADDR(_pucDestAddr, _pucSrcAddr) \ - (kalMemCmp(_pucDestAddr, _pucSrcAddr, MAC_ADDR_LEN)) - - -/* The macro to check whether two SSIDs are equal */ -#define EQUAL_SSID(pucSsid1, ucSsidLen1, pucSsid2, ucSsidLen2) \ - ((ucSsidLen1 <= ELEM_MAX_LEN_SSID) && \ - (ucSsidLen2 <= ELEM_MAX_LEN_SSID) && \ - ((ucSsidLen1) == (ucSsidLen2)) && \ - !kalMemCmp(pucSsid1, pucSsid2, ucSsidLen1)) - -/* The macro to check whether two SSIDs are equal */ -#define UNEQUAL_SSID(pucSsid1, ucSsidLen1, pucSsid2, ucSsidLen2) \ - ((ucSsidLen1 > ELEM_MAX_LEN_SSID) || \ - (ucSsidLen2 > ELEM_MAX_LEN_SSID) || \ - ((ucSsidLen1) != (ucSsidLen2)) || \ - kalMemCmp(pucSsid1, pucSsid2, ucSsidLen1)) - -/* The macro to copy the SSID, the length of pucDestSsid should have at least 32 bytes */ -#define COPY_SSID(pucDestSsid, ucDestSsidLen, pucSrcSsid, ucSrcSsidLen) \ - do { \ - ucDestSsidLen = ucSrcSsidLen; \ - if (ucSrcSsidLen) { \ - ASSERT(ucSrcSsidLen <= ELEM_MAX_LEN_SSID); \ - kalMemCopy(pucDestSsid, pucSrcSsid, ((ucSrcSsidLen > ELEM_MAX_LEN_SSID) ? ELEM_MAX_LEN_SSID : ucSrcSsidLen)); \ - } \ - } while (FALSE) - -/* The macro to copy the IE */ -#define COPY_IE(pucDestIE, pucSrcIE) \ - do { \ - kalMemCopy((PUINT_8)pucDestIE, \ - (PUINT_8)pucSrcIE,\ - IE_SIZE(pucSrcIE)); \ - } while (FALSE) - -#define IE_FOR_EACH(_pucIEsBuf, _u2IEsBufLen, _u2Offset) \ - for ((_u2Offset) = 0; ((((_u2Offset) + 2) <= (_u2IEsBufLen)) && (((_u2Offset) + IE_SIZE(_pucIEsBuf)) <= (_u2IEsBufLen))) ; \ - (_u2Offset) += IE_SIZE(_pucIEsBuf), (_pucIEsBuf) += IE_SIZE(_pucIEsBuf)) - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _MAC_H */ - diff --git a/drivers/net/wireless/mt5931/include/nic/mt5931_reg.h b/drivers/net/wireless/mt5931/include/nic/mt5931_reg.h deleted file mode 100755 index 6cec38d71542..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/mt5931_reg.h +++ /dev/null @@ -1,336 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/MT6620_5931_WiFi_Driver/include/nic/mt5931_reg.h#3 $ -*/ - -/*! \file "mt5931_reg.h" - \brief The common register definition of mt5931 - - N/A -*/ - -/******************************************************************************* -* Copyright (c) 2010 MediaTek Inc. -* -* All rights reserved. Copying, compilation, modification, distribution -* or any other use whatsoever of this material is strictly prohibited -* except in accordance with a Software License Agreement with -* MediaTek Inc. -******************************************************************************** -*/ - -/******************************************************************************* -* LEGAL DISCLAIMER -* -* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND -* AGREES THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK -* SOFTWARE") RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE -* PROVIDED TO BUYER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY -* DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT -* LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -* PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE -* ANY WARRANTY WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY -* WHICH MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK -* SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY -* WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE -* FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION OR TO -* CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. -* -* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE -* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL -* BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT -* ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY -* BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -* -* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE -* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT -* OF LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING -* THEREOF AND RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN -* FRANCISCO, CA, UNDER THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE -* (ICC). -******************************************************************************** -*/ - -/* -** $Log: mt5931_reg.h $ - * - * 02 25 2011 cp.wu - * [WCXRP00000496] [MT5931][Driver] Apply host-triggered chip reset before initializing firmware download procedures - * apply host-triggered chip reset mechanism before initializing firmware download procedures. - * - * 02 18 2011 terry.wu - * [WCXRP00000412] [MT6620 Wi-Fi][FW/Driver] Dump firmware assert info at android kernel log - * Add WHISR_D2H_SW_ASSERT_INFO_INT to MT5931_reg. - * - * 10 07 2010 cp.wu - * [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection - * add firmware download for MT5931. - * -*/ - -#ifndef _MT5931_REG_H -#define _MT5931_REG_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -//1 MT5931 MCR Definition - -//2 Host Interface - -//4 CHIP ID Register -#define MCR_WCIR 0x0000 - -//4 HIF Low Power Control Register -#define MCR_WHLPCR 0x0004 - -//4 Control Status Register -#define MCR_WSDIOCSR 0x0008 -#define MCR_WSPICSR 0x0008 - -//4 HIF Control Register -#define MCR_WHCR 0x000C - -//4 HIF Interrupt Status Register -#define MCR_WHISR 0x0010 - -//4 HIF Interrupt Enable Register -#define MCR_WHIER 0x0014 - -//4 Abnormal Status Register -#define MCR_WASR 0x0018 - -//4 WLAN Software Interrupt Control Register -#define MCR_WSICR 0x001C - -//4 WLAN TX Status Register -#define MCR_WTSR0 0x0020 - -//4 WLAN TX Status Register -#define MCR_WTSR1 0x0024 - -//4 WLAN TX Data Register 0 -#define MCR_WTDR0 0x0028 - -//4 WLAN TX Data Register 1 -#define MCR_WTDR1 0x002C - -//4 WLAN RX Data Register 0 -#define MCR_WRDR0 0x0030 - -//4 WLAN RX Data Register 1 -#define MCR_WRDR1 0x0034 - -//4 Host to Device Send Mailbox 0 Register -#define MCR_H2DSM0R 0x0038 - -//4 Host to Device Send Mailbox 1 Register -#define MCR_H2DSM1R 0x003c - -//4 Device to Host Receive Mailbox 0 Register -#define MCR_D2HRM0R 0x0040 - -//4 Device to Host Receive Mailbox 1 Register -#define MCR_D2HRM1R 0x0044 - -//4 Device to Host Receive Mailbox 2 Register -#define MCR_D2HRM2R 0x0048 - -//4 WLAN RX Packet Length Register -#define MCR_WRPLR 0x0050 - -//4 EHPI Transaction Count Register -#define MCR_EHTCR 0x0054 - -//4 Firmware Download Data Register -#define MCR_FWDLDR 0x0080 - -//4 Firmware Download Destination Starting Address Register -#define MCR_FWDLDSAR 0x0084 - -//4 Firmware Download Status Register -#define MCR_FWDLSR 0x0088 - -//4 WLAN MCU Control & Status Register -#define MCR_WMCSR 0x008c - -//4 WLAN Firmware Download Configuration -#define MCR_FWCFG 0x0090 - - -//#if CFG_SDIO_INTR_ENHANCE -typedef struct _ENHANCE_MODE_DATA_STRUCT_T { - UINT_32 u4WHISR; - union { - struct { - UINT_8 ucTQ0Cnt; - UINT_8 ucTQ1Cnt; - UINT_8 ucTQ2Cnt; - UINT_8 ucTQ3Cnt; - UINT_8 ucTQ4Cnt; - UINT_8 ucTQ5Cnt; - UINT_16 u2Rsrv; - } u; - UINT_32 au4WTSR[2]; - } rTxInfo; - union { - struct { - UINT_16 u2NumValidRx0Len; - UINT_16 u2NumValidRx1Len; - UINT_16 au2Rx0Len[16]; - UINT_16 au2Rx1Len[16]; - } u; - UINT_32 au4RxStatusRaw[17]; - } rRxInfo; - UINT_32 u4RcvMailbox0; - UINT_32 u4RcvMailbox1; -} ENHANCE_MODE_DATA_STRUCT_T, *P_ENHANCE_MODE_DATA_STRUCT_T; -// #endif /* ENHANCE_MODE_DATA_STRUCT_T */ - - -//2 Definition in each register -//3 WCIR 0x0000 -#define WCIR_WLAN_READY BIT(21) -#define WCIR_POR_INDICATOR BIT(20) -#define WCIR_REVISION_ID BITS(16,19) -#define WCIR_CHIP_ID BITS(0,15) - -#define MTK_CHIP_REV 0x00005931 -#define MTK_CHIP_MP_REVERSION_ID 0x0 - -//3 WHLPCR 0x0004 -#define WHLPCR_FW_OWN_REQ_CLR BIT(9) -#define WHLPCR_FW_OWN_REQ_SET BIT(8) -#define WHLPCR_IS_DRIVER_OWN BIT(8) -#define WHLPCR_INT_EN_CLR BIT(1) -#define WHLPCR_INT_EN_SET BIT(0) - -//3 WSDIOCSR 0x0008 -#define WSDIOCSR_SDIO_RE_INIT_EN BIT(0) - -//3 WSPICSR 0x0008 -#define WCSR_SPI_MODE_SEL BITS(3,4) -#define WCSR_SPI_ENDIAN_BIG BIT(2) -#define WCSR_SPI_INT_OUT_MODE BIT(1) -#define WCSR_SPI_DATA_OUT_MODE BIT(0) - -//3 WHCR 0x000C -#define WHCR_RX_ENHANCE_MODE_EN BIT(16) -#define WHCR_MAX_HIF_RX_LEN_NUM BITS(4,7) -#define WHCR_W_MAILBOX_RD_CLR_EN BIT(2) -#define WHCR_W_INT_CLR_CTRL BIT(1) -#define WHCR_MCU_DBG_EN BIT(0) -#define WHCR_OFFSET_MAX_HIF_RX_LEN_NUM 4 - -//3 WHISR 0x0010 -#define WHISR_D2H_SW_INT BITS(8,31) -#define WHISR_D2H_SW_ASSERT_INFO_INT BIT(31) -#define WHISR_FW_OWN_BACK_INT BIT(4) -#define WHISR_ABNORMAL_INT BIT(3) -#define WHISR_RX1_DONE_INT BIT(2) -#define WHISR_RX0_DONE_INT BIT(1) -#define WHISR_TX_DONE_INT BIT(0) - - -//3 WHIER 0x0014 -#define WHIER_D2H_SW_INT BITS(8,31) -#define WHIER_FW_OWN_BACK_INT_EN BIT(4) -#define WHIER_ABNORMAL_INT_EN BIT(3) -#define WHIER_RX1_DONE_INT_EN BIT(2) -#define WHIER_RX0_DONE_INT_EN BIT(1) -#define WHIER_TX_DONE_INT_EN BIT(0) -#define WHIER_DEFAULT (WHIER_RX0_DONE_INT_EN | \ - WHIER_RX1_DONE_INT_EN | \ - WHIER_TX_DONE_INT_EN | \ - WHIER_ABNORMAL_INT_EN | \ - WHIER_D2H_SW_INT \ - ) - - -//3 WASR 0x0018 -#define WASR_FW_OWN_INVALID_ACCESS BIT(4) -#define WASR_RX1_UNDER_FLOW BIT(3) -#define WASR_RX0_UNDER_FLOW BIT(2) -#define WASR_TX1_OVER_FLOW BIT(1) -#define WASR_TX0_OVER_FLOW BIT(0) - - -//3 WSICR 0x001C -#define WSICR_H2D_SW_INT_SET BITS(16,31) - - -//3 WRPLR 0x0050 -#define WRPLR_RX1_PACKET_LENGTH BITS(16,31) -#define WRPLR_RX0_PACKET_LENGTH BITS(0,15) - - -//3 FWDLSR 0x0088 -#define FWDLSR_FWDL_RDY BIT(8) -#define FWDLSR_FWDL_MODE BIT(0) - - -//3 WMCSR 0x008c -#define WMCSR_CHIP_RST BIT(15) /* write */ -#define WMCSR_DL_OK BIT(15) /* read */ -#define WMCSR_DL_FAIL BIT(14) -#define WMCSR_PLLRDY BIT(13) -#define WMCSR_WF_ON BIT(12) -#define WMCSR_INI_RDY BIT(11) -#define WMCSR_WF_EN BIT(6) -#define WMCSR_SW_EN BIT(5) -#define WMCSR_SPLLEN BIT(4) -#define WMCSR_SPWREN BIT(3) -#define WMCSR_HSTOPIL BIT(2) -#define WMCSR_FWDLRST BIT(1) -#define WMCSR_FWDLEN BIT(0) - - -//3 FWCFG 0x0090 -#define FWCFG_KSEL BITS(14,15) -#define FWCFG_FLEN BITS(0,13) - - -#endif /* _MT5931_REG_H */ - diff --git a/drivers/net/wireless/mt5931/include/nic/mt6620_reg.h b/drivers/net/wireless/mt5931/include/nic/mt6620_reg.h deleted file mode 100755 index 3f2eacd3a1a2..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/mt6620_reg.h +++ /dev/null @@ -1,286 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/mt6620_reg.h#1 $ -*/ - -/*! \file "mt6620_reg.h" - \brief The common register definition of mt6620 - - N/A -*/ - - - -/* -** $Log: mt6620_reg.h $ - * - * 01 31 2011 terry.wu - * [WCXRP00000412] [MT6620 Wi-Fi][FW/Driver] Dump firmware assert info at android kernel log - * Print firmware ASSERT info at Android kernel log, driver side - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 03 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) add ACPI D0/D3 state switching support - * * * * 2) use more formal way to handle interrupt when the status is retrieved from enhanced RX response -** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-12-10 16:44:18 GMT mtk02752 -** remove 5921 definitions -** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-11-09 22:56:32 GMT mtk01084 -** modify HW register definitions -** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-11-04 14:11:04 GMT mtk01084 -** modify default IER bits -** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-10-29 19:52:32 GMT mtk01084 -** modify data struture -** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-10-23 16:08:20 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-10-13 21:58:53 GMT mtk01084 -** update for new HW architecture design -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-09-09 17:26:11 GMT mtk01084 -** add CFG_TEST_WITH_MT5921 -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-05-18 20:59:57 GMT mtk01426 -** Update WHIER_DEFAULT value -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-05-07 16:57:36 GMT mtk01426 -** Update CHIP ID to 0x6620, and WHLPCR bit definition -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-28 10:34:57 GMT mtk01461 -** Add read WTSR and fix RX STATUS is DW align for SDIO_STATUS_ENHANCE mode -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-03-24 09:46:52 GMT mtk01084 -** fix LINT error -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-23 00:32:24 GMT mtk01461 -** Define constants for TX PATH -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-18 20:54:10 GMT mtk01426 -** Add WHCR_MAX_HIF_RX_AGG_LEN_OFFSET definition -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:29 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _MT6620_REG_H -#define _MT6620_REG_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -//1 MT6620 MCR Definition - -//2 Host Interface - -//4 CHIP ID Register -#define MCR_WCIR 0x0000 - -//4 HIF Low Power Control Register -#define MCR_WHLPCR 0x0004 -//#define MCR_WHLPCR_BYTE1 0x0005 - - -//4 Control Status Register -#define MCR_WSDIOCSR 0x0008 -#define MCR_WSPICSR 0x0008 - -//4 HIF Control Register -#define MCR_WHCR 0x000C - -//4 HIF Interrupt Status Register -#define MCR_WHISR 0x0010 - -//4 HIF Interrupt Enable Register -#define MCR_WHIER 0x0014 - -//4 Abnormal Status Register -#define MCR_WASR 0x0018 - -//4 WLAN Software Interrupt Control Register -#define MCR_WSICR 0x001C - -//4 WLAN TX Status Register -#define MCR_WTSR0 0x0020 - -//4 WLAN TX Status Register -#define MCR_WTSR1 0x0024 - -//4 WLAN TX Data Register 0 -#define MCR_WTDR0 0x0028 - -//4 WLAN TX Data Register 1 -#define MCR_WTDR1 0x002C - -//4 WLAN RX Data Register 0 -#define MCR_WRDR0 0x0030 - -//4 WLAN RX Data Register 1 -#define MCR_WRDR1 0x0034 - -//4 Host to Device Send Mailbox 0 Register -#define MCR_H2DSM0R 0x0038 - -//4 Host to Device Send Mailbox 1 Register -#define MCR_H2DSM1R 0x003c - -//4 Device to Host Receive Mailbox 0 Register -#define MCR_D2HRM0R 0x0040 - -//4 Device to Host Receive Mailbox 1 Register -#define MCR_D2HRM1R 0x0044 - -//4 WLAN RX Packet Length Register -#define MCR_WRPLR 0x0048 - - - - -//temp //#if CFG_SDIO_INTR_ENHANCE -typedef struct _ENHANCE_MODE_DATA_STRUCT_T { - UINT_32 u4WHISR; - union { - struct { - UINT_8 ucTQ0Cnt; - UINT_8 ucTQ1Cnt; - UINT_8 ucTQ2Cnt; - UINT_8 ucTQ3Cnt; - UINT_8 ucTQ4Cnt; - UINT_8 ucTQ5Cnt; - UINT_16 u2Rsrv; - } u; - UINT_32 au4WTSR[2]; - } rTxInfo; - union { - struct { - UINT_16 u2NumValidRx0Len; - UINT_16 u2NumValidRx1Len; - UINT_16 au2Rx0Len[16]; - UINT_16 au2Rx1Len[16]; - } u; - UINT_32 au4RxStatusRaw[17]; - } rRxInfo; - UINT_32 u4RcvMailbox0; - UINT_32 u4RcvMailbox1; -} ENHANCE_MODE_DATA_STRUCT_T, *P_ENHANCE_MODE_DATA_STRUCT_T; -// #endif /* ENHANCE_MODE_DATA_STRUCT_T */ - - -//2 Definition in each register -//3 WCIR 0x0000 -#define WCIR_WLAN_READY BIT(21) -#define WCIR_POR_INDICATOR BIT(20) -#define WCIR_REVISION_ID BITS(16,19) -#define WCIR_CHIP_ID BITS(0,15) - -#define MTK_CHIP_REV 0x00006620 -#define MTK_CHIP_MP_REVERSION_ID 0x0 - -//3 WHLPCR 0x0004 -#define WHLPCR_FW_OWN_REQ_CLR BIT(9) -#define WHLPCR_FW_OWN_REQ_SET BIT(8) -#define WHLPCR_IS_DRIVER_OWN BIT(8) -#define WHLPCR_INT_EN_CLR BIT(1) -#define WHLPCR_INT_EN_SET BIT(0) - -//3 WSDIOCSR 0x0008 -#define WSDIOCSR_SDIO_RE_INIT_EN BIT(0) - -//3 WSPICSR 0x0008 -#define WCSR_SPI_MODE_SEL BITS(3,4) -#define WCSR_SPI_ENDIAN_BIG BIT(2) -#define WCSR_SPI_INT_OUT_MODE BIT(1) -#define WCSR_SPI_DATA_OUT_MODE BIT(0) - -//3 WHCR 0x000C -#define WHCR_RX_ENHANCE_MODE_EN BIT(16) -#define WHCR_MAX_HIF_RX_LEN_NUM BITS(4,7) -#define WHCR_W_MAILBOX_RD_CLR_EN BIT(2) -#define WHCR_W_INT_CLR_CTRL BIT(1) -#define WHCR_MCU_DBG_EN BIT(0) -#define WHCR_OFFSET_MAX_HIF_RX_LEN_NUM 4 - -//3 WHISR 0x0010 -#define WHISR_D2H_SW_INT BITS(8,31) -#define WHISR_D2H_SW_ASSERT_INFO_INT BIT(31) -#define WHISR_FW_INT_INDICATOR BIT(7) -#define WHISR_FW_OWN_BACK_INT BIT(4) -#define WHISR_ABNORMAL_INT BIT(3) -#define WHISR_RX1_DONE_INT BIT(2) -#define WHISR_RX0_DONE_INT BIT(1) -#define WHISR_TX_DONE_INT BIT(0) - - -//3 WHIER 0x0014 -#define WHIER_D2H_SW_INT BITS(8,31) -#define WHIER_FW_INT_INDICATOR_EN BIT(7) -#define WHIER_FW_OWN_BACK_INT_EN BIT(4) -#define WHIER_ABNORMAL_INT_EN BIT(3) -#define WHIER_RX1_DONE_INT_EN BIT(2) -#define WHIER_RX0_DONE_INT_EN BIT(1) -#define WHIER_TX_DONE_INT_EN BIT(0) -#define WHIER_DEFAULT (WHIER_RX0_DONE_INT_EN | \ - WHIER_RX1_DONE_INT_EN | \ - WHIER_TX_DONE_INT_EN | \ - WHIER_ABNORMAL_INT_EN | \ - WHIER_D2H_SW_INT \ - ) - - -//3 WASR 0x0018 -#define WASR_FW_OWN_INVALID_ACCESS BIT(4) -#define WASR_RX1_UNDER_FLOW BIT(3) -#define WASR_RX0_UNDER_FLOW BIT(2) -#define WASR_TX1_OVER_FLOW BIT(1) -#define WASR_TX0_OVER_FLOW BIT(0) - - -//3 WSICR 0x001C -#define WSICR_H2D_SW_INT_SET BITS(16,31) - - -//3 WTSR0 0x0044 -#define WRPLR_RX1_PACKET_LENGTH BITS(16,31) -#define WRPLR_RX0_PACKET_LENGTH BITS(0,15) - -#endif /* _MT6620_REG_H */ - diff --git a/drivers/net/wireless/mt5931/include/nic/nic.h b/drivers/net/wireless/mt5931/include/nic/nic.h deleted file mode 100755 index 64631384d9dc..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/nic.h +++ /dev/null @@ -1,724 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/nic.h#1 $ -*/ - -/*! \file "nic.h" - \brief The declaration of nic functions - - Detail description. -*/ - - - -/* -** $Log: nic.h $ - * - * 11 01 2011 chinglan.wang - * NULL - * Modify the Wi-Fi method of the flush TX queue when disconnect the AP. - * If disconnect the AP and flush all the data frame in the TX queue, WPS cannot do the 4-way handshake to connect to the AP.. - * - * 07 18 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add CMD/Event for RDD and BWCS. - * - * 05 11 2011 cp.wu - * [WCXRP00000718] [MT6620 Wi-Fi] modify the behavior of setting tx power - * ACPI APIs migrate to wlan_lib.c for glue layer to invoke. - * - * 04 11 2011 yuche.tsai - * [WCXRP00000627] [Volunteer Patch][MT6620][Driver] Pending MMPUD of P2P Network may crash system issue. - * Fix kernel panic issue when MMPDU of P2P is pending in driver. - * - * 03 02 2011 cp.wu - * [WCXRP00000503] [MT6620 Wi-Fi][Driver] Take RCPI brought by association response as initial RSSI right after connection is built. - * use RCPI brought by ASSOC-RESP after connection is built as initial RCPI to avoid using a uninitialized MAC-RX RCPI. - * - * 02 01 2011 cm.chang - * [WCXRP00000415] [MT6620 Wi-Fi][Driver] Check if any memory leakage happens when uninitializing in DGB mode - * . - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * - * 10 26 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command - * 1) update NVRAM content template to ver 1.02 - * 2) add compile option for querying NIC capability (default: off) - * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting - * 4) correct auto-rate compiler error under linux (treat warning as error) - * 5) simplify usage of NVRAM and REG_INFO_T - * 6) add version checking between driver and firmware - * - * 10 26 2010 eddie.chen - * [WCXRP00000134] [MT6620 Wi-Fi][Driver] Add a registry to enable auto rate for SQA test by using E1 EVB - * Add auto rate parameter in registry. - * - * 10 12 2010 cp.wu - * [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test - * add HT (802.11n) fixed rate support. - * - * 10 08 2010 cp.wu - * [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test - * adding fixed rate support for distance test. (from registry setting) - * - * 10 05 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * 1) add NVRAM access API - * 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option) - * 3) add OID implementation for NVRAM read/write service - * - * 10 04 2010 cp.wu - * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only - * remove ENUM_NETWORK_TYPE_T definitions - * - * 09 21 2010 cp.wu - * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated - * Do a complete reset with STA-REC null checking for RF test re-entry - * - * 09 08 2010 cp.wu - * NULL - * use static memory pool for storing IEs of scanning result. - * - * 09 01 2010 cp.wu - * NULL - * HIFSYS Clock Source Workaround - * - * 08 25 2010 george.huang - * NULL - * update OID/ registry control path for PM related settings - * - * 08 12 2010 cp.wu - * NULL - * [AIS-FSM] honor registry setting for adhoc running mode. (A/B/G) - * - * 08 03 2010 cp.wu - * NULL - * Centralize mgmt/system service procedures into independent calls. - * - * 07 28 2010 cp.wu - * NULL - * 1) eliminate redundant variable eOPMode in prAdapter->rWlanInfo - * 2) change nicMediaStateChange() API prototype - * - * 07 14 2010 yarco.yang - * - * 1. Remove CFG_MQM_MIGRATION - * 2. Add CMD_UPDATE_WMM_PARMS command - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 06 2010 george.huang - * [WPD00001556]Basic power managemenet function - * Update arguments for nicUpdateBeaconIETemplate() - * - * 07 06 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * STA-REC is maintained by CNM only. - * - * 07 05 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) ignore RSN checking when RSN is not turned on. - * 2) set STA-REC deactivation callback as NULL - * 3) add variable initialization API based on PHY configuration - * - * 06 30 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * sync. with CMD/EVENT document ver0.07. - * - * 06 29 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) sync to. CMD/EVENT document v0.03 - * 2) simplify DTIM period parsing in scan.c only, bss.c no longer parses it again. - * 3) send command packet to indicate FW-PM after - * a) 1st beacon is received after AIS has connected to an AP - * b) IBSS-ALONE has been created - * c) IBSS-MERGE has occured - * - * 06 25 2010 george.huang - * [WPD00001556]Basic power managemenet function - * Create beacon update path, with expose bssUpdateBeaconContent() - * - * 06 22 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) add command warpper for STA-REC/BSS-INFO sync. - * 2) enhance command packet sending procedure for non-oid part - * 3) add command packet definitions for STA-REC/BSS-INFO sync. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * implement TX_DONE callback path. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) eliminate CFG_CMD_EVENT_VERSION_0_9 - * 2) when disconnected, indicate nic directly (no event is needed) - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 04 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) surpress compiler warning - * 2) when acqruing LP-own, keep writing WHLPCR whenever OWN is not acquired yet - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * * * * * * * 2) command sequence number is now increased atomically - * * * * * * * * * 3) private data could be hold and taken use for other purpose - * - * 04 12 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add channel frequency <-> number conversion - * - * 03 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) add ACPI D0/D3 state switching support - * * * * * 2) use more formal way to handle interrupt when the status is retrieved from enhanced RX response - * - * 03 17 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * always process TX interrupt first then RX interrupt. - * - * 02 25 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct behavior to prevent duplicated RX handling for RX0_DONE and RX1_DONE - * - * 02 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add checksum offloading support. -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-10-13 21:58:58 GMT mtk01084 -** update for new HW architecture design -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-04-24 21:12:55 GMT mtk01104 -** Add function prototype nicRestoreSpiDefMode() -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-19 18:32:54 GMT mtk01084 -** update for basic power management functions -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:32 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _NIC_H -#define _NIC_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - - -struct _REG_ENTRY_T { - UINT_32 u4Offset; - UINT_32 u4Value; -}; - -struct _TABLE_ENTRY_T { - P_REG_ENTRY_T pu4TablePtr; - UINT_16 u2Size; -}; - -/*! INT status to event map */ -typedef struct _INT_EVENT_MAP_T { - UINT_32 u4Int; - UINT_32 u4Event; -} INT_EVENT_MAP_T, *P_INT_EVENT_MAP_T; - - -enum ENUM_INT_EVENT_T { - INT_EVENT_ABNORMAL, - INT_EVENT_SW_INT, - INT_EVENT_TX, - INT_EVENT_RX, - INT_EVENT_NUM -}; - -typedef enum _ENUM_IE_UPD_METHOD_T { - IE_UPD_METHOD_UPDATE_RANDOM, - IE_UPD_METHOD_UPDATE_ALL, - IE_UPD_METHOD_DELETE_ALL, -} ENUM_IE_UPD_METHOD_T, *P_ENUM_IE_UPD_METHOD_T; - - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/* Routines in nic.c */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicAllocateAdapterMemory ( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicReleaseAdapterMemory ( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicDisableInterrupt ( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicEnableInterrupt ( - IN P_ADAPTER_T prAdapter - ); - -WLAN_STATUS -nicProcessIST ( - IN P_ADAPTER_T prAdapter - ); - -WLAN_STATUS -nicProcessIST_impl ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4IntStatus - ); - -WLAN_STATUS -nicInitializeAdapter ( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicMCRInit ( - IN P_ADAPTER_T prAdapter - ); - -BOOL -nicVerifyChipID ( - IN P_ADAPTER_T prAdapter - ); - - -#if CFG_SDIO_INTR_ENHANCE -VOID -nicSDIOInit ( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicSDIOReadIntStatus ( - IN P_ADAPTER_T prAdapter, - OUT PUINT_32 pu4IntStatus - ); -#endif - -BOOLEAN -nicpmSetDriverOwn ( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicpmSetFWOwn ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgEnableGlobalInt - ); - -BOOLEAN -nicpmSetAcpiPowerD0 ( - IN P_ADAPTER_T prAdapter - ); - -BOOLEAN -nicpmSetAcpiPowerD3 ( - IN P_ADAPTER_T prAdapter - ); - -#if defined(_HIF_SPI) -void -nicRestoreSpiDefMode( - IN P_ADAPTER_T prAdapter - ); -#endif - -VOID -nicProcessSoftwareInterrupt( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicProcessAbnormalInterrupt ( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicPutMailbox ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4MailboxNum, - IN UINT_32 u4Data); - -VOID -nicGetMailbox ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4MailboxNum, - OUT PUINT_32 pu4Data); - -VOID -nicSetSwIntr ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4SwIntrBitmap - ); - -P_CMD_INFO_T -nicGetPendingCmdInfo ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucSeqNum - ); - -P_MSDU_INFO_T -nicGetPendingTxMsduInfo ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucSeqNum - ); - -P_MSDU_INFO_T -nicGetPendingStaMMPDU( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucStaRecIdx - ); - -VOID -nicFreePendingTxMsduInfoByNetwork ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType - ); - -UINT_8 -nicIncreaseCmdSeqNum ( - IN P_ADAPTER_T prAdapter - ); - -UINT_8 -nicIncreaseTxSeqNum ( - IN P_ADAPTER_T prAdapter - ); - -/* Media State Change */ -WLAN_STATUS -nicMediaStateChange ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType, - IN P_EVENT_CONNECTION_STATUS prConnectionStatus - ); - -/* Utility function for channel number conversion */ -UINT_32 -nicChannelNum2Freq ( - IN UINT_32 u4ChannelNum - ); - -UINT_32 -nicFreq2ChannelNum ( - IN UINT_32 u4FreqInKHz - ); - -/* firmware command wrapper */ - /* NETWORK (WIFISYS) */ -WLAN_STATUS -nicActivateNetwork( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ); - -WLAN_STATUS -nicDeactivateNetwork( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ); - - - /* BSS-INFO */ -WLAN_STATUS -nicUpdateBss( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ); - - /* BSS-INFO Indication (PM) */ -WLAN_STATUS -nicPmIndicateBssCreated( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ); - -WLAN_STATUS -nicPmIndicateBssConnected( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ); - -WLAN_STATUS -nicPmIndicateBssAbort( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ); - - /* Beacon Template Update */ -WLAN_STATUS -nicUpdateBeaconIETemplate ( - IN P_ADAPTER_T prAdapter, - IN ENUM_IE_UPD_METHOD_T eIeUpdMethod, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN UINT_16 u2Capability, - IN PUINT_8 aucIe, - IN UINT_16 u2IELen - ); - -WLAN_STATUS -nicQmUpdateWmmParms( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ); - -WLAN_STATUS -nicSetAutoTxPower( - IN P_ADAPTER_T prAdapter, - IN P_CMD_AUTO_POWER_PARAM_T prAutoPwrParam - ); - -/*----------------------------------------------------------------------------*/ -/* Calibration Control */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicUpdateTxPower( - IN P_ADAPTER_T prAdapter, - IN P_CMD_TX_PWR_T prTxPwrParam - ); - -WLAN_STATUS -nicUpdate5GOffset( - IN P_ADAPTER_T prAdapter, - IN P_CMD_5G_PWR_OFFSET_T pr5GPwrOffset - ); - -WLAN_STATUS -nicUpdateDPD( - IN P_ADAPTER_T prAdapter, - IN P_CMD_PWR_PARAM_T prDpdCalResult - ); - - -/*----------------------------------------------------------------------------*/ -/* PHY configuration */ -/*----------------------------------------------------------------------------*/ -VOID -nicSetAvailablePhyTypeSet ( - IN P_ADAPTER_T prAdapter - ); - -/*----------------------------------------------------------------------------*/ -/* MGMT and System Service Control */ -/*----------------------------------------------------------------------------*/ -VOID -nicInitSystemService ( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicResetSystemService ( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicUninitSystemService ( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicInitMGMT ( - IN P_ADAPTER_T prAdapter, - IN P_REG_INFO_T prRegInfo - ); - -VOID -nicUninitMGMT ( - IN P_ADAPTER_T prAdapter - ); - -WLAN_STATUS -nicConfigPowerSaveProfile ( - IN P_ADAPTER_T prAdapter, - ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - PARAM_POWER_MODE ePwrMode, - BOOLEAN fgEnCmdEvent - ); - -/*----------------------------------------------------------------------------*/ -/* Scan Result Processing */ -/*----------------------------------------------------------------------------*/ -VOID -nicAddScanResult ( - IN P_ADAPTER_T prAdapter, - IN PARAM_MAC_ADDRESS rMacAddr, - IN P_PARAM_SSID_T prSsid, - IN UINT_32 u4Privacy, - IN PARAM_RSSI rRssi, - IN ENUM_PARAM_NETWORK_TYPE_T eNetworkType, - IN P_PARAM_802_11_CONFIG_T prConfiguration, - IN ENUM_PARAM_OP_MODE_T eOpMode, - IN PARAM_RATES_EX rSupportedRates, - IN UINT_16 u2IELength, - IN PUINT_8 pucIEBuf - ); - -VOID -nicFreeScanResultIE ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Idx - ); - -#if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1) -/*----------------------------------------------------------------------------*/ -/* Workaround Control */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicEnableClockGating ( - IN P_ADAPTER_T prAdapter - ); - -WLAN_STATUS -nicDisableClockGating ( - IN P_ADAPTER_T prAdapter - ); -#endif - - -/*----------------------------------------------------------------------------*/ -/* Fixed Rate Hacking */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicUpdateRateParams ( - IN P_ADAPTER_T prAdapter, - IN ENUM_REGISTRY_FIXED_RATE_T eRateSetting, - IN PUINT_8 pucDesiredPhyTypeSet, - IN PUINT_16 pu2DesiredNonHTRateSet, - IN PUINT_16 pu2BSSBasicRateSet, - IN PUINT_8 pucMcsSet, - IN PUINT_8 pucSupMcs32, - IN PUINT_16 u2HtCapInfo - ); - -/*----------------------------------------------------------------------------*/ -/* Write registers */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicWriteMcr ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Address, - IN UINT_32 u4Value - ); - -/*----------------------------------------------------------------------------*/ -/* Update auto rate */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicRlmArUpdateParms( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4ArSysParam0, - IN UINT_32 u4ArSysParam1, - IN UINT_32 u4ArSysParam2, - IN UINT_32 u4ArSysParam3 - ); - -/*----------------------------------------------------------------------------*/ -/* Enable/Disable Roaming */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicRoamingUpdateParams( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4EnableRoaming - ); - - -VOID -nicPrintFirmwareAssertInfo( - IN P_ADAPTER_T prAdapter - ); - -/*----------------------------------------------------------------------------*/ -/* Link Quality Updating */ -/*----------------------------------------------------------------------------*/ -VOID -nicUpdateLinkQuality( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx, - IN P_EVENT_LINK_QUALITY prEventLinkQuality - ); - -VOID -nicUpdateRSSI( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx, - IN INT_8 cRssi, - IN INT_8 cLinkQuality - ); - -VOID -nicUpdateLinkSpeed( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx, - IN UINT_16 u2LinkSpeed - ); - -#if CFG_SUPPORT_RDD_TEST_MODE -WLAN_STATUS -nicUpdateRddTestMode( - IN P_ADAPTER_T prAdapter, - IN P_CMD_RDD_CH_T prRddChParam - ); -#endif - -#endif /* _NIC_H */ - diff --git a/drivers/net/wireless/mt5931/include/nic/nic_rx.h b/drivers/net/wireless/mt5931/include/nic/nic_rx.h deleted file mode 100755 index 49ca2991abab..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/nic_rx.h +++ /dev/null @@ -1,529 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/nic_rx.h#1 $ -*/ - -/*! \file "nic_rx.h" - \brief The declaration of the nic rx functions - -*/ - - - -/* -** $Log: nic_rx.h $ - * - * 11 07 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * add debug counters and periodically dump counters for debugging. - * - * 05 05 2011 cp.wu - * [WCXRP00000702] [MT5931][Driver] Modify initialization sequence for E1 ASIC - * add delay after whole-chip resetting for MT5931 E1 ASIC. - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 01 24 2011 cm.chang - * [WCXRP00000384] [MT6620 Wi-Fi][Driver][FW] Handle 20/40 action frame in AP mode and stop ampdu timer when sta_rec is freed - * Process received 20/40 coexistence action frame for AP mode - * - * 09 08 2010 cp.wu - * NULL - * use static memory pool for storing IEs of scanning result. - * - * 09 07 2010 yuche.tsai - * NULL - * Change prototype of API of adding P2P device to scan result. - * Additional IE buffer is saved. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 05 2010 yuche.tsai - * NULL - * Modify data structure for P2P Scan result. - * - * 08 03 2010 cp.wu - * NULL - * newly added P2P API should be declared in header file. - * - * 07 30 2010 cp.wu - * NULL - * 1) BoW wrapper: use definitions instead of hard-coded constant for error code - * 2) AIS-FSM: eliminate use of desired RF parameters, use prTargetBssDesc instead - * 3) add handling for RX_PKT_DESTINATION_HOST_WITH_FORWARD for GO-broadcast frames - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * saa_fsm.c is migrated. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add management dispatching function table. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 03 30 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * remove driver-land statistics. - * - * 03 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * generate information for OID_GEN_RCV_OK & OID_GEN_XMIT_OK - * * - * - * 03 11 2010 cp.wu - * [WPD00003821][BUG] Host driver stops processing RX packets from HIF RX0 - * add RX starvation warning debug message controlled by CFG_HIF_RX_STARVATION_WARNING - * - * 03 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * code clean: removing unused variables and structure definitions - * - * 02 25 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct behavior to prevent duplicated RX handling for RX0_DONE and RX1_DONE - * - * 02 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement host-side firmware download logic - * - * 02 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) remove unused function in nic_rx.c [which has been handled in que_mgt.c] - * * 2) firmware image length is now retrieved via NdisFileOpen - * * 3) firmware image is not structured by (P_IMG_SEC_HDR_T) anymore - * * 4) nicRxWaitResponse() revised - * * 5) another set of TQ counter default value is added for fw-download state - * * 6) Wi-Fi load address is now retrieved from registry too - * - * 12 30 2009 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) According to CMD/EVENT documentation v0.8, - * * * * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used, - * * * * and result is retrieved by get ATInfo instead - * * * * 2) add 4 counter for recording aggregation statistics -** \main\maintrunk.MT6620WiFiDriver_Prj\24 2009-12-10 16:49:09 GMT mtk02752 -** code clean -** \main\maintrunk.MT6620WiFiDriver_Prj\23 2009-12-09 14:02:37 GMT MTK02468 -** Added ucStaRecIdx in SW_RFB_T and HALF_SEQ_NO_COUNT definition (to replace HALF_SEQ_NO_CNOUT) -** \main\maintrunk.MT6620WiFiDriver_Prj\22 2009-11-27 11:07:54 GMT mtk02752 -** add flush for reset -** \main\maintrunk.MT6620WiFiDriver_Prj\21 2009-11-25 18:18:09 GMT mtk02752 -** modify nicRxAddScanResult() -** \main\maintrunk.MT6620WiFiDriver_Prj\20 2009-11-24 22:42:22 GMT mtk02752 -** add nicRxAddScanResult() to prepare to handle SCAN_RESULT event -** \main\maintrunk.MT6620WiFiDriver_Prj\19 2009-11-24 19:57:06 GMT mtk02752 -** adopt P_HIF_RX_HEADER_T -** \main\maintrunk.MT6620WiFiDriver_Prj\18 2009-11-16 21:43:04 GMT mtk02752 -** correct ENUM_RX_PKT_DESTINATION_T definitions -** \main\maintrunk.MT6620WiFiDriver_Prj\17 2009-11-16 15:28:25 GMT mtk02752 -** add ucQueuedPacketNum for indicating how many packet are queued by RX reordering buffer/forwarding path -** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-11-16 15:05:01 GMT mtk02752 -** add eTC for SW_RFB_T and structure RX_MAILBOX -** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-11-13 21:16:57 GMT mtk02752 -** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-11-13 16:59:30 GMT mtk02752 -** add handler for event packet -** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-11-13 13:45:50 GMT mtk02752 -** add port param for nicRxEnhanceReadBuffer() -** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-11-11 10:12:31 GMT mtk02752 -** nicSDIOReadIntStatus() always read sizeof(ENHANCE_MODE_DATA_STRUCT_T) for int response, thus the number should be set to 0(:=16) instead of 10 -** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-10-29 19:53:32 GMT mtk01084 -** modify structure naming -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-10-23 16:08:23 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-10-13 21:59:01 GMT mtk01084 -** update for new HW architecture design -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-05-20 12:23:33 GMT mtk01461 -** Add u4MaxEventBufferLen parameter to nicRxWaitResponse() -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-05-18 21:00:48 GMT mtk01426 -** Update SDIO_MAXIMUM_RX_STATUS value -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-28 10:36:15 GMT mtk01461 -** Remove unused define - SDIO_MAXIMUM_TX_STATUS -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-01 10:53:17 GMT mtk01461 -** Add function for HIF_LOOPBACK_PRE_TEST -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-18 20:56:19 GMT mtk01426 -** Add to support CFG_HIF_LOOPBACK and CFG_SDIO_RX_ENHANCE -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-17 20:19:56 GMT mtk01426 -** Add nicRxWaitResponse function proto type -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:35 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _NIC_RX_H -#define _NIC_RX_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define MAX_SEQ_NO 4095 -#define MAX_SEQ_NO_COUNT 4096 -#define HALF_SEQ_NO_CNOUT 2048 - -#define HALF_SEQ_NO_COUNT 2048 - -#define MT6620_FIXED_WIN_SIZE 64 -#define CFG_RX_MAX_BA_ENTRY 4 -#define CFG_RX_MAX_BA_TID_NUM 8 - -#define RX_STATUS_FLAG_MORE_PACKET BIT(30) -#define RX_STATUS_CHKSUM_MASK BITS(0,10) - -#define RX_RFB_LEN_FIELD_LEN 4 -#define RX_HEADER_OFFSET 2 - - -#if defined(_HIF_SDIO) && defined (WINDOWS_DDK) -/*! On XP, maximum Tx+Rx Statue <= 64-4(HISR)*/ - #define SDIO_MAXIMUM_RX_LEN_NUM 0 /*!< 0~15 (0: un-limited) */ -#else - #define SDIO_MAXIMUM_RX_LEN_NUM 0 /*!< 0~15 (0: un-limited) */ -#endif - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef enum _ENUM_RX_STATISTIC_COUNTER_T { - RX_MPDU_TOTAL_COUNT = 0, - RX_SIZE_ERR_DROP_COUNT, - - RX_DATA_INDICATION_COUNT, - RX_DATA_RETURNED_COUNT, - RX_DATA_RETAINED_COUNT, - - RX_DROP_TOTAL_COUNT, - RX_TYPE_ERR_DROP_COUNT, - RX_CLASS_ERR_DROP_COUNT, - RX_DST_NULL_DROP_COUNT, - -#if CFG_TCP_IP_CHKSUM_OFFLOAD || CFG_TCP_IP_CHKSUM_OFFLOAD_NDIS_60 - RX_CSUM_TCP_FAILED_COUNT, - RX_CSUM_UDP_FAILED_COUNT, - RX_CSUM_IP_FAILED_COUNT, - RX_CSUM_TCP_SUCCESS_COUNT, - RX_CSUM_UDP_SUCCESS_COUNT, - RX_CSUM_IP_SUCCESS_COUNT, - RX_CSUM_UNKNOWN_L4_PKT_COUNT, - RX_CSUM_UNKNOWN_L3_PKT_COUNT, - RX_IP_V6_PKT_CCOUNT, -#endif - RX_STATISTIC_COUNTER_NUM -} ENUM_RX_STATISTIC_COUNTER_T; - -typedef enum _ENUM_RX_PKT_DESTINATION_T { - RX_PKT_DESTINATION_HOST, /* to OS */ - RX_PKT_DESTINATION_FORWARD, /* to TX queue for forward, AP mode */ - RX_PKT_DESTINATION_HOST_WITH_FORWARD, /* to both TX and OS, AP mode broadcast packet */ - RX_PKT_DESTINATION_NULL, /* packet to be freed */ - RX_PKT_DESTINATION_NUM -} ENUM_RX_PKT_DESTINATION_T; - -struct _SW_RFB_T { - QUE_ENTRY_T rQueEntry; - PVOID pvPacket; /*!< ptr to rx Packet Descriptor */ - PUINT_8 pucRecvBuff; /*!< ptr to receive data buffer */ - P_HIF_RX_HEADER_T prHifRxHdr; - UINT_32 u4HifRxHdrFlag; - PVOID pvHeader; - UINT_16 u2PacketLen; - UINT_16 u2HeaderLen; - UINT_16 u2SSN; - UINT_8 ucTid; - UINT_8 ucWlanIdx; - UINT_8 ucPacketType; - UINT_8 ucStaRecIdx; - - ENUM_CSUM_RESULT_T aeCSUM[CSUM_TYPE_NUM]; - ENUM_RX_PKT_DESTINATION_T eDst; - ENUM_TRAFFIC_CLASS_INDEX_T eTC; /* only valid when eDst == FORWARD */ -}; - -/*! RX configuration type structure */ -typedef struct _RX_CTRL_T { - UINT_32 u4RxCachedSize; - PUINT_8 pucRxCached; - QUE_T rFreeSwRfbList; - QUE_T rReceivedRfbList; - QUE_T rIndicatedRfbList; - -#if CFG_SDIO_RX_AGG - PUINT_8 pucRxCoalescingBufPtr; -#endif - - PVOID apvIndPacket[CFG_RX_MAX_PKT_NUM]; - PVOID apvRetainedPacket[CFG_RX_MAX_PKT_NUM]; - - UINT_8 ucNumIndPacket; - UINT_8 ucNumRetainedPacket; - UINT_64 au8Statistics[RX_STATISTIC_COUNTER_NUM]; /*!< RX Counters */ - -#if CFG_HIF_STATISTICS - UINT_32 u4TotalRxAccessNum; - UINT_32 u4TotalRxPacketNum; -#endif - -#if CFG_HIF_RX_STARVATION_WARNING - UINT_32 u4QueuedCnt; - UINT_32 u4DequeuedCnt; -#endif - -#if CFG_RX_PKTS_DUMP - UINT_32 u4RxPktsDumpTypeMask; -#endif - -} RX_CTRL_T, *P_RX_CTRL_T; - -typedef struct _RX_MAILBOX_T { - UINT_32 u4RxMailbox[2]; /* for Device-to-Host Mailbox */ -} RX_MAILBOX_T, *P_RX_MAILBOX_T; - -typedef WLAN_STATUS (*PROCESS_RX_MGT_FUNCTION)(P_ADAPTER_T, P_SW_RFB_T); - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -#define RX_INC_CNT(prRxCtrl, eCounter) \ - {((P_RX_CTRL_T)prRxCtrl)->au8Statistics[eCounter]++;} - -#define RX_ADD_CNT(prRxCtrl, eCounter, u8Amount) \ - {((P_RX_CTRL_T)prRxCtrl)->au8Statistics[eCounter] += (UINT_64)u8Amount;} - -#define RX_GET_CNT(prRxCtrl, eCounter) \ - (((P_RX_CTRL_T)prRxCtrl)->au8Statistics[eCounter]) - -#define RX_RESET_ALL_CNTS(prRxCtrl) \ - {kalMemZero(&prRxCtrl->au8Statistics[0], sizeof(prRxCtrl->au8Statistics));} - -#define RX_STATUS_TEST_MORE_FLAG(flag) \ - ((BOOL)((flag & RX_STATUS_FLAG_MORE_PACKET) ? TRUE : FALSE)) - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -VOID -nicRxInitialize ( - IN P_ADAPTER_T prAdapter - ); - -#if defined(MT5931) -VOID -nicRxPostInitialize ( - IN P_ADAPTER_T prAdapter - ); -#endif - -VOID -nicRxUninitialize ( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicRxProcessRFBs ( - IN P_ADAPTER_T prAdapter - ); - -#if !CFG_SDIO_INTR_ENHANCE -VOID -nicRxReceiveRFBs ( - IN P_ADAPTER_T prAdapter - ); - -WLAN_STATUS -nicRxReadBuffer ( - IN P_ADAPTER_T prAdapter, - IN OUT P_SW_RFB_T prSwRfb - ); - -#else -VOID -nicRxSDIOReceiveRFBs ( - IN P_ADAPTER_T prAdapter - ); - -WLAN_STATUS -nicRxEnhanceReadBuffer ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4DataPort, - IN UINT_16 u2RxLength, - IN OUT P_SW_RFB_T prSwRfb - ); -#endif /* CFG_SDIO_INTR_ENHANCE */ - - -#if CFG_SDIO_RX_AGG -VOID -nicRxSDIOAggReceiveRFBs ( - IN P_ADAPTER_T prAdapter - ); -#endif - -WLAN_STATUS -nicRxSetupRFB ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prRfb - ); - -VOID -nicRxReturnRFB ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prRfb - ); - -VOID -nicProcessRxInterrupt ( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicRxProcessPktWithoutReorder ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -VOID -nicRxProcessForwardPkt ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -VOID -nicRxProcessGOBroadcastPkt ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - - -VOID -nicRxFillRFB ( - IN P_ADAPTER_T prAdapter, - IN OUT P_SW_RFB_T prSwRfb - ); - -VOID -nicRxProcessDataPacket ( - IN P_ADAPTER_T prAdapter, - IN OUT P_SW_RFB_T prSwRfb - ); - -VOID -nicRxProcessEventPacket ( - IN P_ADAPTER_T prAdapter, - IN OUT P_SW_RFB_T prSwRfb - ); - -VOID -nicRxProcessMgmtPacket ( - IN P_ADAPTER_T prAdapter, - IN OUT P_SW_RFB_T prSwRfb - ); - -#if CFG_TCP_IP_CHKSUM_OFFLOAD -VOID -nicRxFillChksumStatus( - IN P_ADAPTER_T prAdapter, - IN OUT P_SW_RFB_T prSwRfb, - IN UINT_32 u4TcpUdpIpCksStatus - ); - -VOID -nicRxUpdateCSUMStatistics ( - IN P_ADAPTER_T prAdapter, - IN const ENUM_CSUM_RESULT_T aeCSUM[] - ); -#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */ - - -VOID -nicRxQueryStatus ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBuffer, - OUT PUINT_32 pu4Count - ); - -VOID -nicRxClearStatistics ( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicRxQueryStatistics ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBuffer, - OUT PUINT_32 pu4Count - ); - -WLAN_STATUS -nicRxWaitResponse ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucPortIdx, - OUT PUINT_8 pucRspBuffer, - IN UINT_32 u4MaxRespBufferLen, - OUT PUINT_32 pu4Length - ); - -VOID -nicRxEnablePromiscuousMode ( - IN P_ADAPTER_T prAdapter - ); - - -VOID -nicRxDisablePromiscuousMode ( - IN P_ADAPTER_T prAdapter - ); - - -WLAN_STATUS -nicRxFlush ( - IN P_ADAPTER_T prAdapter - ); - -WLAN_STATUS -nicRxProcessActionFrame ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -#endif /* _NIC_RX_H */ - diff --git a/drivers/net/wireless/mt5931/include/nic/nic_tx.h b/drivers/net/wireless/mt5931/include/nic/nic_tx.h deleted file mode 100755 index 4837da4877ca..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/nic_tx.h +++ /dev/null @@ -1,646 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/nic_tx.h#1 $ -*/ - -/*! \file nic_tx.h - \brief Functions that provide TX operation in NIC's point of view. - - This file provides TX functions which are responsible for both Hardware and - Software Resource Management and keep their Synchronization. - -*/ - - - -/* -** $Log: nic_tx.h $ - * - * 11 18 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Add log counter for tx - * - * 11 10 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Add TX_DONE status detail information. - * - * 08 15 2011 cp.wu - * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree - * add MT6628-specific definitions. - * - * 04 12 2011 cp.wu - * [WCXRP00000631] [MT6620 Wi-Fi][Driver] Add an API for QM to retrieve current TC counter value and processing frame dropping cases for TC4 path - * 1. add nicTxGetResource() API for QM to make decisions. - * 2. if management frames is decided by QM for dropping, the call back is invoked to indicate such a case. - * - * 03 21 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * portability improvement - * - * 02 16 2011 cp.wu - * [WCXRP00000449] [MT6620 Wi-Fi][Driver] Refine CMD queue handling by adding an extra API for checking availble count and modify behavior - * 1. add new API: nicTxGetFreeCmdCount() - * 2. when there is insufficient command descriptor, nicTxEnqueueMsdu() will drop command packets directly - * - * 01 24 2011 cp.wu - * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving - * 1. add an extra counter for tracking pending forward frames. - * 2. notify TX service thread as well when there is pending forward frame - * 3. correct build errors leaded by introduction of Wi-Fi direct separation module - * - * 12 15 2010 yuche.tsai - * NULL - * Update SLT Descriptor number configure in driver. - * - * 11 16 2010 yarco.yang - * [WCXRP00000177] [MT5931 F/W] Performance tuning for 1st connection - * Update TX buffer count - * - * 11 03 2010 cp.wu - * [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection - * 1) use 8 buffers for MT5931 which is equipped with less memory - * 2) modify MT5931 debug level to TRACE when download is successful - * - * 10 18 2010 cp.wu - * [WCXRP00000117] [MT6620 Wi-Fi][Driver] Add logic for suspending driver when MT6620 is not responding anymore - * 1. when wlanAdapterStop() failed to send POWER CTRL command to firmware, do not poll for ready bit dis-assertion - * 2. shorten polling count for shorter response time - * 3. if bad I/O operation is detected during TX resource polling, then further operation is aborted as well - * - * 10 06 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * code reorganization to improve isolation between GLUE and CORE layers. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 30 2010 cp.wu - * NULL - * API added: nicTxPendingPackets(), for simplifying porting layer - * - * 07 26 2010 cp.wu - * - * change TC4 initial value from 2 to 4. - * - * 07 13 2010 cp.wu - * - * 1) MMPDUs are now sent to MT6620 by CMD queue for keeping strict order of 1X/MMPDU/CMD packets - * 2) integrate with qmGetFrameAction() for deciding which MMPDU/1X could pass checking for sending - * 2) enhance CMD_INFO_T descriptor number from 10 to 32 to avoid descriptor underflow under concurrent network operation - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 06 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Add MGMT Packet type for HIF_TX_HEADER - * - * 06 23 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * integrate . - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * refine TX-DONE callback. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * TX descriptors are now allocated once for reducing allocation overhead - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * specify correct value for management frames. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) add flag on MSDU_INFO_T for indicating BIP frame and forceBasicRate - * 2) add packet type for indicating management frames - * - * 06 09 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add necessary changes to driver data paths. - * - * 06 09 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add TX_PACKET_MGMT to indicate the frame is coming from management modules - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge wlan_def.h. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 03 30 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * remove driver-land statistics. - * - * 03 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * generate information for OID_GEN_RCV_OK & OID_GEN_XMIT_OK - * * * - * - * 03 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * code clean: removing unused variables and structure definitions - * - * 03 02 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Redistributed the initial TC resources for normal operation - * - * 03 02 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add mutex to avoid multiple access to qmTxQueue simultaneously. - * - * 02 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add new API: wlanProcessQueuedPackets() - * - * 02 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) remove unused function in nic_rx.c [which has been handled in que_mgt.c] - * * * 2) firmware image length is now retrieved via NdisFileOpen - * * * 3) firmware image is not structured by (P_IMG_SEC_HDR_T) anymore - * * * 4) nicRxWaitResponse() revised - * * * 5) another set of TQ counter default value is added for fw-download state - * * * 6) Wi-Fi load address is now retrieved from registry too - * - * 02 09 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. Permanent and current MAC address are now retrieved by CMD/EVENT packets instead of hard-coded address - * * * * 2. follow MSDN defined behavior when associates to another AP - * * * * 3. for firmware download, packet size could be up to 2048 bytes - * - * 01 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. eliminate improper variable in rHifInfo - * * * * * 2. block TX/ordinary OID when RF test mode is engaged - * * * * * 3. wait until firmware finish operation when entering into and leaving from RF test mode - * * * * * 4. correct some HAL implementation - * - * 01 13 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Enabled the Burst_End Indication mechanism - * - * 12 30 2009 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) According to CMD/EVENT documentation v0.8, - * * * * * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used, - * * * * * and result is retrieved by get ATInfo instead - * * * * * 2) add 4 counter for recording aggregation statistics -** \main\maintrunk.MT6620WiFiDriver_Prj\24 2009-12-10 16:53:28 GMT mtk02752 -** remove unused API -** \main\maintrunk.MT6620WiFiDriver_Prj\23 2009-11-27 11:08:00 GMT mtk02752 -** add flush for reset -** \main\maintrunk.MT6620WiFiDriver_Prj\22 2009-11-24 19:56:49 GMT mtk02752 -** remove redundant eTC -** \main\maintrunk.MT6620WiFiDriver_Prj\21 2009-11-23 22:01:08 GMT mtk02468 -** Added MSDU_INFO fields for composing HIF TX header -** \main\maintrunk.MT6620WiFiDriver_Prj\20 2009-11-17 22:40:51 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\19 2009-11-17 17:35:05 GMT mtk02752 -** + nicTxMsduInfoList() for sending MsduInfoList -** + NIC_TX_BUFF_COUNT_TC[0~5] -** \main\maintrunk.MT6620WiFiDriver_Prj\18 2009-11-17 11:07:00 GMT mtk02752 -** add nicTxAdjustTcq() API -** \main\maintrunk.MT6620WiFiDriver_Prj\17 2009-11-16 22:28:30 GMT mtk02752 -** move aucFreeBufferCount/aucMaxNumOfBuffer into another structure -** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-11-16 21:44:50 GMT mtk02752 -** + nicTxReturnMsduInfo() -** + nicTxFillMsduInfo() -** + rFreeMsduInfoList field in TX_CTRL -** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-11-16 18:00:43 GMT mtk02752 -** use P_PACKET_INFO_T for prPacket to avoid inventing another new structure for packet -** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-11-16 15:28:49 GMT mtk02752 -** add ucQueuedPacketNum for indicating how many packets are queued by per STA/AC queue -** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-11-16 10:52:01 GMT mtk02752 -** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-11-14 23:39:24 GMT mtk02752 -** interface structure redefine -** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-11-13 21:17:03 GMT mtk02752 -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-10-29 19:53:10 GMT mtk01084 -** remove strange code by Frog -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-10-13 21:59:04 GMT mtk01084 -** update for new HW architecture design -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-10-02 13:53:03 GMT mtk01725 -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-28 10:36:50 GMT mtk01461 -** Add declaration of nicTxReleaseResource() -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-17 19:58:39 GMT mtk01461 -** Move CMD_INFO_T related define and function to cmd_buf.h -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-01 10:53:53 GMT mtk01461 -** Add function for SDIO_TX_ENHANCE -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-23 00:33:27 GMT mtk01461 -** Define constants for TX PATH and add nicTxPollingResource -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-16 09:09:32 GMT mtk01461 -** Update TX PATH API -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:38 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _NIC_TX_H -#define _NIC_TX_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define NIC_TX_RESOURCE_POLLING_TIMEOUT 256 -#define NIC_TX_RESOURCE_POLLING_DELAY_MSEC 50 - -/* Maximum buffer count for individual HIF TCQ */ - -#if defined(MT6620) -#if CFG_SLT_SUPPORT - /* 20101215 mtk01725 Redistributed the initial TC resources for SLT operation */ - #define NIC_TX_BUFF_COUNT_TC0 0 // First connection: 0 - #define NIC_TX_BUFF_COUNT_TC1 16 // First connection: 32 - #define NIC_TX_BUFF_COUNT_TC2 0 // First connection: 0 - #define NIC_TX_BUFF_COUNT_TC3 0 // First connection: 0 - #define NIC_TX_BUFF_COUNT_TC4 4 // First connection: 2 - #define NIC_TX_BUFF_COUNT_TC5 0 // First connection: 0 -#else - /* 20100302 mtk02468 Redistributed the initial TC resources for normal operation */ - #define NIC_TX_BUFF_COUNT_TC0 6 // First connection: 0 - #define NIC_TX_BUFF_COUNT_TC1 8 // First connection: 32 - #define NIC_TX_BUFF_COUNT_TC2 8 // First connection: 0 - #define NIC_TX_BUFF_COUNT_TC3 8 // First connection: 0 - #define NIC_TX_BUFF_COUNT_TC4 4 // First connection: 2 - #define NIC_TX_BUFF_COUNT_TC5 2 // First connection: 0 -#endif -#elif defined(MT5931) - #define NIC_TX_BUFF_COUNT_TC0 1 // First connection: 0 - #define NIC_TX_BUFF_COUNT_TC1 14 // First connection: 32 - #define NIC_TX_BUFF_COUNT_TC2 1 // First connection: 0 - #define NIC_TX_BUFF_COUNT_TC3 1 // First connection: 0 - #define NIC_TX_BUFF_COUNT_TC4 4 // First connection: 2 - #define NIC_TX_BUFF_COUNT_TC5 1 // First connection: 0 -#elif defined(MT6628) - #define NIC_TX_BUFF_COUNT_TC0 1 // First connection: 0 - #define NIC_TX_BUFF_COUNT_TC1 20 // First connection: 32 - #define NIC_TX_BUFF_COUNT_TC2 1 // First connection: 0 - #define NIC_TX_BUFF_COUNT_TC3 1 // First connection: 0 - #define NIC_TX_BUFF_COUNT_TC4 4 // First connection: 2 - #define NIC_TX_BUFF_COUNT_TC5 1 // First connection: 0 - -#endif - -#define NIC_TX_BUFF_SUM (NIC_TX_BUFF_COUNT_TC0 + \ - NIC_TX_BUFF_COUNT_TC1 + \ - NIC_TX_BUFF_COUNT_TC2 + \ - NIC_TX_BUFF_COUNT_TC3 + \ - NIC_TX_BUFF_COUNT_TC4 + \ - NIC_TX_BUFF_COUNT_TC5) -#if CFG_ENABLE_FW_DOWNLOAD - - #define NIC_TX_INIT_BUFF_COUNT_TC0 8 - #define NIC_TX_INIT_BUFF_COUNT_TC1 0 - #define NIC_TX_INIT_BUFF_COUNT_TC2 0 - #define NIC_TX_INIT_BUFF_COUNT_TC3 0 - #define NIC_TX_INIT_BUFF_COUNT_TC4 0 - #define NIC_TX_INIT_BUFF_COUNT_TC5 0 - - #define NIC_TX_INIT_BUFF_SUM (NIC_TX_INIT_BUFF_COUNT_TC0 + \ - NIC_TX_INIT_BUFF_COUNT_TC1 + \ - NIC_TX_INIT_BUFF_COUNT_TC2 + \ - NIC_TX_INIT_BUFF_COUNT_TC3 + \ - NIC_TX_INIT_BUFF_COUNT_TC4 + \ - NIC_TX_INIT_BUFF_COUNT_TC5) - -#endif - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -//3 /* Session for TX QUEUES */ -/* The definition in this ENUM is used to categorize packet's Traffic Class according - * to the their TID(User Priority). - * In order to achieve QoS goal, a particular TC should not block the process of - * another packet with different TC. - * In current design we will have 5 categories(TCs) of SW resource. - */ -typedef enum _ENUM_TRAFFIC_CLASS_INDEX_T { - TC0_INDEX = 0, /* HIF TX0: AC0 packets */ - TC1_INDEX, /* HIF TX0: AC1 packets & non-QoS packets */ - TC2_INDEX, /* HIF TX0: AC2 packets */ - TC3_INDEX, /* HIF TX0: AC3 packets */ - TC4_INDEX, /* HIF TX1: Command packets or 802.1x packets */ - TC5_INDEX, /* HIF TX0: BMCAST packets */ - TC_NUM /* Maximum number of Traffic Classes. */ -} ENUM_TRAFFIC_CLASS_INDEX_T; - -typedef enum _ENUM_TX_STATISTIC_COUNTER_T { - TX_MPDU_TOTAL_COUNT = 0, - TX_INACTIVE_BSS_DROP, - TX_INACTIVE_STA_DROP, - TX_FORWARD_OVERFLOW_DROP, - TX_AP_BORADCAST_DROP, - TX_STATISTIC_COUNTER_NUM -} ENUM_TX_STATISTIC_COUNTER_T; - - -typedef struct _TX_TCQ_STATUS_T { - UINT_8 aucFreeBufferCount[TC_NUM]; - UINT_8 aucMaxNumOfBuffer[TC_NUM]; -} TX_TCQ_STATUS_T, *P_TX_TCQ_STATUS_T; - -typedef struct _TX_TCQ_ADJUST_T { - INT_8 acVariation[TC_NUM]; -} TX_TCQ_ADJUST_T, *P_TX_TCQ_ADJUST_T; - -typedef struct _TX_CTRL_T { - UINT_32 u4TxCachedSize; - PUINT_8 pucTxCached; - -/* Elements below is classified according to TC (Traffic Class) value. */ - - TX_TCQ_STATUS_T rTc; - - PUINT_8 pucTxCoalescingBufPtr; - - QUE_T rFreeMsduInfoList; - - /* Management Frame Tracking */ - /* number of management frames to be sent */ - INT_32 i4TxMgmtPendingNum; - - /* to tracking management frames need TX done callback */ - QUE_T rTxMgmtTxingQueue; - -#if CFG_HIF_STATISTICS - UINT_32 u4TotalTxAccessNum; - UINT_32 u4TotalTxPacketNum; -#endif - UINT_32 au4Statistics[TX_STATISTIC_COUNTER_NUM]; - - /* Number to track forwarding frames */ - INT_32 i4PendingFwdFrameCount; - -} TX_CTRL_T, *P_TX_CTRL_T; - -typedef enum _ENUM_TX_PACKET_SRC_T { - TX_PACKET_OS, - TX_PACKET_OS_OID, - TX_PACKET_FORWARDING, - TX_PACKET_MGMT, - TX_PACKET_NUM -} ENUM_TX_PACKET_SRC_T; - -typedef enum _ENUM_HIF_TX_PACKET_TYPE_T { - HIF_TX_PACKET_TYPE_DATA = 0, - HIF_TX_PACKET_TYPE_COMMAND, - HIF_TX_PACKET_TYPE_HIF_LB, - HIF_TX_PACKET_TYPE_MGMT -} ENUM_HIF_TX_PACKET_TYPE_T, *P_ENUM_HIF_TX_PACKET_TYPE_T; - -typedef enum _ENUM_TX_RESULT_CODE_T { - TX_RESULT_SUCCESS = 0, - TX_RESULT_LIFE_TIMEOUT, - TX_RESULT_RTS_ERROR, - TX_RESULT_MPDU_ERROR, - TX_RESULT_AGING_TIMEOUT, - TX_RESULT_FLUSHED, - TX_RESULT_DROPPED_IN_DRIVER = 32, - TX_RESULT_NUM -} ENUM_TX_RESULT_CODE_T, *P_ENUM_TX_RESULT_CODE_T; - -/* TX Call Back Function */ -typedef WLAN_STATUS (*PFN_TX_DONE_HANDLER) ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - -/* TX transactions could be divided into 4 kinds: - * - * 1) 802.1X / Bluetooth-over-Wi-Fi Security Frames - * [CMD_INFO_T] - [prPacket] - in skb or NDIS_PACKET form - * - * 2) MMPDU - * [CMD_INFO_T] - [prPacket] - [MSDU_INFO_T] - [prPacket] - direct buffer for frame body - * - * 3) Command Packets - * [CMD_INFO_T] - [pucInfoBuffer] - direct buffer for content of command packet - * - * 4) Normal data frame - * [MSDU_INFO_T] - [prPacket] - in skb or NDIS_PACKET form - */ - - -/* PS_FORWARDING_TYPE_NON_PS means that the receiving STA is in Active Mode -* from the perspective of host driver (maybe not synchronized with FW --> SN is needed) -*/ - -struct _MSDU_INFO_T { - QUE_ENTRY_T rQueEntry; - P_NATIVE_PACKET prPacket; - - ENUM_TX_PACKET_SRC_T eSrc; /* specify OS/FORWARD packet */ - UINT_8 ucUserPriority; - - /* For composing HIF TX header */ - UINT_8 ucTC; /* Traffic Class: 0~4 (HIF TX0), 5 (HIF TX1) */ - UINT_8 ucPacketType; /* 0: Data, 1: Command, 2: HIF Loopback 3: Management Frame */ - UINT_8 ucStaRecIndex; - UINT_8 ucNetworkType; /* See ENUM_NETWORK_TYPE_T */ - UINT_8 ucFormatID; /* 0: MAUI, Linux, Windows NDIS 5.1 */ - BOOLEAN fgIs802_1x; /* TRUE: 802.1x frame */ - BOOLEAN fgIs802_11; /* TRUE: 802.11 header is present */ - UINT_16 u2PalLLH; /* PAL Logical Link Header (for BOW network) */ - UINT_16 u2AclSN; /* ACL Sequence Number (for BOW network) */ - UINT_8 ucPsForwardingType; /* See ENUM_PS_FORWARDING_TYPE_T */ - UINT_8 ucPsSessionID; /* PS Session ID specified by the FW for the STA */ - BOOLEAN fgIsBurstEnd; /* TRUE means this is the last packet of the burst for (STA, TID) */ - BOOLEAN fgIsBIP; /* Management Frame Protection */ - BOOLEAN fgIsBasicRate; /* Force Basic Rate Transmission */ - - /* flattened from PACKET_INFO_T */ - UINT_8 ucMacHeaderLength; - UINT_8 ucLlcLength; /* w/o EtherType */ - UINT_16 u2FrameLength; - UINT_8 aucEthDestAddr[MAC_ADDR_LEN]; /* Ethernet Destination Address */ - - /* for TX done tracking */ - UINT_8 ucTxSeqNum; - PFN_TX_DONE_HANDLER pfTxDoneHandler; -}; - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -#define TX_INC_CNT(prTxCtrl, eCounter) \ - {((P_TX_CTRL_T)prTxCtrl)->au4Statistics[eCounter]++;} - -#define TX_ADD_CNT(prTxCtrl, eCounter, u8Amount) \ - {((P_TX_CTRL_T)prTxCtrl)->au4Statistics[eCounter] += (UINT_32)u8Amount;} - -#define TX_GET_CNT(prTxCtrl, eCounter) \ - (((P_TX_CTRL_T)prTxCtrl)->au4Statistics[eCounter]) - -#define TX_RESET_ALL_CNTS(prTxCtrl) \ - {kalMemZero(&prTxCtrl->au4Statistics[0], sizeof(prTxCtrl->au4Statistics));} - - - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -VOID -nicTxInitialize ( - IN P_ADAPTER_T prAdapter - ); - -WLAN_STATUS -nicTxAcquireResource ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucTC - ); - -WLAN_STATUS -nicTxPollingResource ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucTC - ); - -BOOLEAN -nicTxReleaseResource ( - IN P_ADAPTER_T prAdapter, - IN UINT_8* aucTxRlsCnt - ); - -WLAN_STATUS -nicTxResetResource ( - IN P_ADAPTER_T prAdapter - ); - -UINT_8 -nicTxGetResource ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucTC - ); - -WLAN_STATUS -nicTxMsduInfoList ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfoListHead - ); - -WLAN_STATUS -nicTxMsduQueue ( - IN P_ADAPTER_T prAdapter, - UINT_8 ucPortIdx, - P_QUE_T prQue - ); - -WLAN_STATUS -nicTxCmd ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN UINT_8 ucTC - ); - -VOID -nicTxRelease ( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicProcessTxInterrupt ( - IN P_ADAPTER_T prAdapter - ); - -VOID -nicTxFreeMsduInfoPacket ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfoListHead - ); - -VOID -nicTxReturnMsduInfo ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfoListHead - ); - -BOOLEAN -nicTxFillMsduInfo ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN P_NATIVE_PACKET prNdisPacket - ); - -WLAN_STATUS -nicTxAdjustTcq ( - IN P_ADAPTER_T prAdapter - ); - -WLAN_STATUS -nicTxFlush ( - IN P_ADAPTER_T prAdapter - ); - -#if CFG_ENABLE_FW_DOWNLOAD -WLAN_STATUS -nicTxInitCmd ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN UINT_8 ucTC - ); - -WLAN_STATUS -nicTxInitResetResource ( - IN P_ADAPTER_T prAdapter - ); -#endif - -WLAN_STATUS -nicTxEnqueueMsdu ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - -UINT_32 -nicTxGetFreeCmdCount ( - IN P_ADAPTER_T prAdapter - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _NIC_TX_H */ - - diff --git a/drivers/net/wireless/mt5931/include/nic/p2p.h b/drivers/net/wireless/mt5931/include/nic/p2p.h deleted file mode 100755 index 30bae79019e1..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/p2p.h +++ /dev/null @@ -1,195 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/nic/p2p.h#3 $ -*/ - - - -/* -** $Log: p2p.h $ - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 10 20 2010 wh.su - * [WCXRP00000124] [MT6620 Wi-Fi] [Driver] Support the dissolve P2P Group - * Add the code to support disconnect p2p group - * - * 09 21 2010 kevin.huang - * [WCXRP00000054] [MT6620 Wi-Fi][Driver] Restructure driver for second Interface - * Isolate P2P related function for Hardware Software Bundle - * - * 08 03 2010 cp.wu - * NULL - * [Wi-Fi Direct] add framework for driver hooks - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 23 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * p2p interface revised to be sync. with HAL - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 18 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add parameter to control: - * 1) auto group owner - * 2) P2P-PS parameter (CTWindow, NoA descriptors) - * - * 05 18 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * correct WPS Device Password ID definition. - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * implement get scan result. - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add basic handling framework for wireless extension ioctls. - * - * 05 14 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add ioctl framework for Wi-Fi Direct by reusing wireless extension ioctls as well - * - * 05 11 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * p2p ioctls revised. - * - * 05 10 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * implement basic wi-fi direct framework - * - * 05 07 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add basic framework for implementating P2P driver hook. - * - * -*/ - -#ifndef _P2P_H -#define _P2P_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -// refer to 'Config Methods' in WPS -#define WPS_CONFIG_USBA 0x0001 -#define WPS_CONFIG_ETHERNET 0x0002 -#define WPS_CONFIG_LABEL 0x0004 -#define WPS_CONFIG_DISPLAY 0x0008 -#define WPS_CONFIG_EXT_NFC 0x0010 -#define WPS_CONFIG_INT_NFC 0x0020 -#define WPS_CONFIG_NFC 0x0040 -#define WPS_CONFIG_PBC 0x0080 -#define WPS_CONFIG_KEYPAD 0x0100 - -// refer to 'Device Password ID' in WPS -#define WPS_DEV_PASSWORD_ID_PIN 0x0000 -#define WPS_DEV_PASSWORD_ID_USER 0x0001 -#define WPS_DEV_PASSWORD_ID_MACHINE 0x0002 -#define WPS_DEV_PASSWORD_ID_REKEY 0x0003 -#define WPS_DEV_PASSWORD_ID_PUSHBUTTON 0x0004 -#define WPS_DEV_PASSWORD_ID_REGISTRAR 0x0005 - - -#define P2P_DEVICE_TYPE_NUM 2 -#define P2P_DEVICE_NAME_LENGTH 32 -#define P2P_NETWORK_NUM 8 -#define P2P_MEMBER_NUM 8 - -#define P2P_WILDCARD_SSID "DIRECT-" - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -struct _P2P_INFO_T { - UINT_32 u4DeviceNum; - EVENT_P2P_DEV_DISCOVER_RESULT_T arP2pDiscoverResult[CFG_MAX_NUM_BSS_LIST]; - PUINT_8 pucCurrIePtr; - UINT_8 aucCommIePool[CFG_MAX_COMMON_IE_BUF_LEN]; /* A common pool for IE of all scan results. */ -}; - -typedef enum { - ENUM_P2P_PEER_GROUP, - ENUM_P2P_PEER_DEVICE, - ENUM_P2P_PEER_NUM -} ENUM_P2P_PEER_TYPE, *P_ENUM_P2P_PEER_TYPE; - -typedef struct _P2P_DEVICE_INFO { - UINT_8 aucDevAddr[PARAM_MAC_ADDR_LEN]; - UINT_8 aucIfAddr[PARAM_MAC_ADDR_LEN]; - UINT_8 ucDevCapabilityBitmap; - INT_32 i4ConfigMethod; - UINT_8 aucPrimaryDeviceType[8]; - UINT_8 aucSecondaryDeviceType[8]; - UINT_8 aucDeviceName[P2P_DEVICE_NAME_LENGTH]; -} P2P_DEVICE_INFO, *P_P2P_DEVICE_INFO; - -typedef struct _P2P_GROUP_INFO { - PARAM_SSID_T rGroupID; - P2P_DEVICE_INFO rGroupOwnerInfo; - UINT_8 ucMemberNum; - P2P_DEVICE_INFO arMemberInfo[P2P_MEMBER_NUM]; -} P2P_GROUP_INFO, *P_P2P_GROUP_INFO; - -typedef struct _P2P_NETWORK_INFO { - ENUM_P2P_PEER_TYPE eNodeType; - - union { - P2P_GROUP_INFO rGroupInfo; - P2P_DEVICE_INFO rDeviceInfo; - } node; - -} P2P_NETWORK_INFO, *P_P2P_NETWORK_INFO; - -typedef struct _P2P_NETWORK_LIST { - UINT_8 ucNetworkNum; - P2P_NETWORK_INFO rP2PNetworkInfo[P2P_NETWORK_NUM]; -} P2P_NETWORK_LIST, *P_P2P_NETWORK_LIST; - -typedef struct _P2P_DISCONNECT_INFO { - UINT_8 ucRole; - UINT_8 ucRsv[3]; -} P2P_DISCONNECT_INFO, *P_P2P_DISCONNECT_INFO; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -#endif /*_P2P_H */ diff --git a/drivers/net/wireless/mt5931/include/nic/p2p_cmd_buf.h b/drivers/net/wireless/mt5931/include/nic/p2p_cmd_buf.h deleted file mode 100755 index c59c60678d44..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/p2p_cmd_buf.h +++ /dev/null @@ -1,93 +0,0 @@ -/* -** $Id: -*/ - -/*! \file "p2p_cmd_buf.h" - \brief In this file we define the structure for Command Packet. - - In this file we define the structure for Command Packet and the control unit - of MGMT Memory Pool. -*/ - - - -/* -** $Log: p2p_cmd_buf.h $ - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 12 22 2010 cp.wu - * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery - * 1. header file restructure for more clear module isolation - * 2. add function interface definition for implementing Service Discovery callbacks -*/ - -#ifndef _P2P_CMD_BUF_H -#define _P2P_CMD_BUF_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/*--------------------------------------------------------------*/ -/* Firmware Command Packer */ -/*--------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSendSetQueryP2PCmd ( - IN P_ADAPTER_T prAdapter, - UINT_8 ucCID, - BOOLEAN fgSetQuery, - BOOLEAN fgNeedResp, - BOOLEAN fgIsOid, - PFN_CMD_DONE_HANDLER pfCmdDoneHandler, - PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler, - UINT_32 u4SetQueryInfoLen, - PUINT_8 pucInfoBuffer, - OUT PVOID pvSetQueryBuffer, - IN UINT_32 u4SetQueryBufferLen - ); - - - - -#endif /* _P2P_CMD_BUF_H */ - - diff --git a/drivers/net/wireless/mt5931/include/nic/p2p_mac.h b/drivers/net/wireless/mt5931/include/nic/p2p_mac.h deleted file mode 100755 index 9c022b0193b8..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/p2p_mac.h +++ /dev/null @@ -1,223 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/nic/p2p_mac.h#2 $ -*/ - -/*! \file "p2p_mac.h" - \brief Brief description. - - Detail description. -*/ - - - - - -#ifndef _P2P_MAC_H -#define _P2P_MAC_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -#define ACTION_PUBLIC_WIFI_DIRECT 9 -#define ACTION_GAS_INITIAL_REQUEST 10 -#define ACTION_GAS_INITIAL_RESPONSE 11 -#define ACTION_GAS_COMEBACK_REQUEST 12 -#define ACTION_GAS_COMEBACK_RESPONSE 13 - - -/* P2P 4.2.8.1 - P2P Public Action Frame Type. */ -#define P2P_PUBLIC_ACTION_GO_NEGO_REQ 0 -#define P2P_PUBLIC_ACTION_GO_NEGO_RSP 1 -#define P2P_PUBLIC_ACTION_GO_NEGO_CFM 2 -#define P2P_PUBLIC_ACTION_INVITATION_REQ 3 -#define P2P_PUBLIC_ACTION_INVITATION_RSP 4 -#define P2P_PUBLIC_ACTION_DEV_DISCOVER_REQ 5 -#define P2P_PUBLIC_ACTION_DEV_DISCOVER_RSP 6 -#define P2P_PUBLIC_ACTION_PROV_DISCOVERY_REQ 7 -#define P2P_PUBLIC_ACTION_PROV_DISCOVERY_RSP 8 - -/* P2P 4.2.9.1 - P2P Action Frame Type */ -#define P2P_ACTION_NOTICE_OF_ABSENCE 0 -#define P2P_ACTION_P2P_PRESENCE_REQ 1 -#define P2P_ACTION_P2P_PRESENCE_RSP 2 -#define P2P_ACTION_GO_DISCOVER_REQ 3 - -#define P2P_PUBLIC_ACTION_FRAME_LEN (WLAN_MAC_MGMT_HEADER_LEN+8) -#define P2P_ACTION_FRAME_LEN (WLAN_MAC_MGMT_HEADER_LEN+7) - - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - - -/* P2P 4.2.8.2 P2P Public Action Frame Format */ -typedef struct _P2P_PUBLIC_ACTION_FRAME_T { - /* MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* P2P Public Action Frame Body */ - UINT_8 ucCategory; /* Category, 0x04 */ - UINT_8 ucAction; /* Action Value, 0x09 */ - UINT_8 aucOui[3]; /* 0x50, 0x6F, 0x9A */ - UINT_8 ucOuiType; /* 0x09 */ - UINT_8 ucOuiSubtype; /* GO Nego Req/Rsp/Cfm, P2P Invittion Req/Rsp, Device Discoverability Req/Rsp */ - UINT_8 ucDialogToken; /* Dialog Token. */ - UINT_8 aucInfoElem[1]; /* P2P IE, WSC IE. */ -} __KAL_ATTRIB_PACKED__ P2P_PUBLIC_ACTION_FRAME_T, *P_P2P_PUBLIC_ACTION_FRAME_T; - - -/* P2P 4.2.9.1 - General Action Frame Format. */ -typedef struct _P2P_ACTION_FRAME_T { - /* MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* P2P Action Frame Body */ - UINT_8 ucCategory; // 0x7F - UINT_8 aucOui[3]; // 0x50, 0x6F, 0x9A - UINT_8 ucOuiType; // 0x09 - UINT_8 ucOuiSubtype; // - UINT_8 ucDialogToken; - UINT_8 aucInfoElem[1]; -} __KAL_ATTRIB_PACKED__ P2P_ACTION_FRAME_T, *P_P2P_ACTION_FRAME_T; - -/* P2P C.1 GAS Public Action Initial Request Frame Format */ -typedef struct _GAS_PUBLIC_ACTION_INITIAL_REQUEST_FRAME_T { - /* MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* P2P Public Action Frame Body */ - UINT_8 ucCategory; /* Category, 0x04 */ - UINT_8 ucAction; /* Action Value, 0x09 */ - UINT_8 ucDialogToken; /* Dialog Token. */ - UINT_8 aucInfoElem[1]; /* Advertisement IE. */ -} __KAL_ATTRIB_PACKED__ GAS_PUBLIC_ACTION_INITIAL_REQUEST_FRAME_T, *P_GAS_PUBLIC_ACTION_INITIAL_REQUEST_FRAME_T; - -/* P2P C.2 GAS Public Action Initial Response Frame Format */ -typedef struct _GAS_PUBLIC_ACTION_INITIAL_RESPONSE_FRAME_T { - /* MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* P2P Public Action Frame Body */ - UINT_8 ucCategory; /* Category, 0x04 */ - UINT_8 ucAction; /* Action Value, 0x09 */ - UINT_8 ucDialogToken; /* Dialog Token. */ - UINT_16 u2StatusCode; /* Initial Response. */ - UINT_16 u2ComebackDelay; /* Initial Response. */ /* In unit of TU. */ - UINT_8 aucInfoElem[1]; /* Advertisement IE. */ -} __KAL_ATTRIB_PACKED__ GAS_PUBLIC_ACTION_INITIAL_RESPONSE_FRAME_T, *P_GAS_PUBLIC_ACTION_INITIAL_RESPONSE_FRAME_T; - - -/* P2P C.3-1 GAS Public Action Comeback Request Frame Format */ -typedef struct _GAS_PUBLIC_ACTION_COMEBACK_REQUEST_FRAME_T { - /* MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* P2P Public Action Frame Body */ - UINT_8 ucCategory; /* Category, 0x04 */ - UINT_8 ucAction; /* Action Value, 0x09 */ - UINT_8 ucDialogToken; /* Dialog Token. */ -} __KAL_ATTRIB_PACKED__ GAS_PUBLIC_ACTION_COMEBACK_REQUEST_FRAME_T, *P_GAS_PUBLIC_ACTION_COMEBACK_REQUEST_FRAME_T; - -/* P2P C.3-2 GAS Public Action Comeback Response Frame Format */ -typedef struct _GAS_PUBLIC_ACTION_COMEBACK_RESPONSE_FRAME_T { - /* MAC header */ - UINT_16 u2FrameCtrl; /* Frame Control */ - UINT_16 u2Duration; /* Duration */ - UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */ - UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */ - UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */ - UINT_16 u2SeqCtrl; /* Sequence Control */ - /* P2P Public Action Frame Body */ - UINT_8 ucCategory; /* Category, 0x04 */ - UINT_8 ucAction; /* Action Value, 0x09 */ - UINT_8 ucDialogToken; /* Dialog Token. */ - UINT_16 u2StatusCode; /* Comeback Response. */ - UINT_8 ucFragmentID; /*Comeback Response. */ - UINT_16 u2ComebackDelay; /* Comeback Response. */ - UINT_8 aucInfoElem[1]; /* Advertisement IE. */ -} __KAL_ATTRIB_PACKED__ GAS_PUBLIC_ACTION_COMEBACK_RESPONSE_FRAME_T, *P_GAS_PUBLIC_ACTION_COMEBACK_RESPONSE_FRAME_T; - - - - -typedef struct _P2P_SD_VENDER_SPECIFIC_CONTENT_T { - /* Service Discovery Vendor-specific Content. */ - UINT_8 ucOuiSubtype; // 0x09 - UINT_16 u2ServiceUpdateIndicator; - UINT_8 aucServiceTLV[1]; -} __KAL_ATTRIB_PACKED__ P2P_SD_VENDER_SPECIFIC_CONTENT_T, *P_P2P_SD_VENDER_SPECIFIC_CONTENT_T; - - -typedef struct _P2P_SERVICE_REQUEST_TLV_T { - UINT_16 u2Length; - UINT_8 ucServiceProtocolType; - UINT_8 ucServiceTransID; - UINT_8 aucQueryData[1]; -} __KAL_ATTRIB_PACKED__ P2P_SERVICE_REQUEST_TLV_T, *P_P2P_SERVICE_REQUEST_TLV_T; - - - -typedef struct _P2P_SERVICE_RESPONSE_TLV_T { - UINT_16 u2Length; - UINT_8 ucServiceProtocolType; - UINT_8 ucServiceTransID; - UINT_8 ucStatusCode; - UINT_8 aucResponseData[1]; -} __KAL_ATTRIB_PACKED__ P2P_SERVICE_RESPONSE_TLV_T, *P_P2P_SERVICE_RESPONSE_TLV_T; - - -#endif diff --git a/drivers/net/wireless/mt5931/include/nic/p2p_nic.h b/drivers/net/wireless/mt5931/include/nic/p2p_nic.h deleted file mode 100755 index 3f1363f77d1a..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/p2p_nic.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/nic/p2p_nic.h#1 $ -*/ - -/*! \file "p2p_nic.h" - \brief The declaration of nic functions - - Detail description. -*/ - - - - - -#ifndef _P2P_NIC_H -#define _P2P_NIC_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - - -VOID -nicP2pMediaStateChange( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType, - IN P_EVENT_CONNECTION_STATUS prConnectionStatus - ); - -VOID -nicRxAddP2pDevice( - IN P_ADAPTER_T prAdapter, - IN P_EVENT_P2P_DEV_DISCOVER_RESULT_T prP2pResult, - IN PUINT_8 pucRxIEBuf, - IN UINT_16 u2RxIELength - ); - -#endif diff --git a/drivers/net/wireless/mt5931/include/nic/p2p_nic_cmd_event.h b/drivers/net/wireless/mt5931/include/nic/p2p_nic_cmd_event.h deleted file mode 100755 index fb056fff3598..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/p2p_nic_cmd_event.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/nic/p2p_nic_cmd_event.h#1 $ -*/ - -/*! \file p2p_nic_cmd_event.h - \brief -*/ - - - -#ifndef _P2P_NIC_CMD_EVENT_H -#define _P2P_NIC_CMD_EVENT_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - - -typedef struct _EVENT_P2P_DEV_DISCOVER_RESULT_T { -// UINT_8 aucCommunicateAddr[MAC_ADDR_LEN]; // Deprecated. - UINT_8 aucDeviceAddr[MAC_ADDR_LEN]; /* Device Address. */ - UINT_8 aucInterfaceAddr[MAC_ADDR_LEN]; /* Device Address. */ - UINT_8 ucDeviceCapabilityBitmap; - UINT_8 ucGroupCapabilityBitmap; - UINT_16 u2ConfigMethod; /* Configure Method. */ - P2P_DEVICE_TYPE_T rPriDevType; - UINT_8 ucSecDevTypeNum; - P2P_DEVICE_TYPE_T arSecDevType[2]; - UINT_16 u2NameLength; - UINT_8 aucName[32]; - PUINT_8 pucIeBuf; - UINT_16 u2IELength; - UINT_8 aucBSSID[MAC_ADDR_LEN]; - // TODO: Service Information or PasswordID valid? -} EVENT_P2P_DEV_DISCOVER_RESULT_T, *P_EVENT_P2P_DEV_DISCOVER_RESULT_T; - -#endif \ No newline at end of file diff --git a/drivers/net/wireless/mt5931/include/nic/que_mgt.h b/drivers/net/wireless/mt5931/include/nic/que_mgt.h deleted file mode 100755 index 65004743db8e..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/que_mgt.h +++ /dev/null @@ -1,1150 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/que_mgt.h#1 $ -*/ - -/*! \file "que_mgt.h" - \brief TX/RX queues management header file - - The main tasks of queue management include TC-based HIF TX flow control, - adaptive TC quota adjustment, HIF TX grant scheduling, Power-Save - forwarding control, RX packet reordering, and RX BA agreement management. -*/ - - - -/* -** $Log: que_mgt.h $ - * - * 08 15 2011 cp.wu - * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree - * add MT6628-specific definitions. - * - * 07 26 2011 eddie.chen - * [WCXRP00000874] [MT5931][DRV] API for query the RX reorder queued packets counter - * API for query the RX reorder queued packets counter. - * - * 06 14 2011 eddie.chen - * [WCXRP00000753] [MT5931 Wi-Fi][DRV] Adjust QM for MT5931 - * Change the parameter for WMM pass. - * - * 05 31 2011 eddie.chen - * [WCXRP00000753] [MT5931 Wi-Fi][DRV] Adjust QM for MT5931 - * Fix the QM quota in MT5931. - * - * 05 09 2011 eddie.chen - * [WCXRP00000709] [MT6620 Wi-Fi][Driver] Check free number before copying broadcast packet - * Check free number before copying broadcast packet. - * - * 04 14 2011 eddie.chen - * [WCXRP00000603] [MT6620 Wi-Fi][DRV] Fix Klocwork warning - * Check the SW RFB free. Fix the compile warning.. - * - * 04 08 2011 eddie.chen - * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma - * Fix for sigma - * - * 03 28 2011 eddie.chen - * [WCXRP00000602] [MT6620 Wi-Fi][DRV] Fix wmm parameters in beacon for BOW - * Fix wmm parameters in beacon for BOW. - * - * 03 15 2011 eddie.chen - * [WCXRP00000554] [MT6620 Wi-Fi][DRV] Add sw control debug counter - * Add sw debug counter for QM. - * - * 02 17 2011 eddie.chen - * [WCXRP00000458] [MT6620 Wi-Fi][Driver] BOW Concurrent - ProbeResp was exist in other channel - * 1) Chnage GetFrameAction decision when BSS is absent. - * 2) Check channel and resource in processing ProbeRequest - * - * 01 12 2011 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, - -Add per station flow control when STA is in PS - - - * 1) Check Bss if support QoS before adding WMMIE - * 2) Check if support prAdapter->rWifiVar QoS and uapsd in flow control - * - * 12 29 2010 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, - -Add per station flow control when STA is in PS - - - * 1) PS flow control event - * - * 2) WMM IE in beacon, assoc resp, probe resp - * - * 12 23 2010 george.huang - * [WCXRP00000152] [MT6620 Wi-Fi] AP mode power saving function - * 1. update WMM IE parsing, with ASSOC REQ handling - * 2. extend U-APSD parameter passing from driver to FW - * - * 10 04 2010 cp.wu - * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only - * remove ENUM_NETWORK_TYPE_T definitions - * - * 09 21 2010 kevin.huang - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * Eliminate Linux Compile Warning - * - * 08 04 2010 yarco.yang - * NULL - * Add TX_AMPDU and ADDBA_REJECT command - * - * 07 22 2010 george.huang - * - * Update fgIsQoS information in BSS INFO by CMD - * - * 07 16 2010 yarco.yang - * - * 1. Support BSS Absence/Presence Event - * 2. Support STA change PS mode Event - * 3. Support BMC forwarding for AP mode. - * - * 07 14 2010 yarco.yang - * - * 1. Remove CFG_MQM_MIGRATION - * 2. Add CMD_UPDATE_WMM_PARMS command - * - * 07 13 2010 yarco.yang - * - * [WPD00003849] - * [MT6620 and MT5931] SW Migration, add qmGetFrameAction() API for CMD Queue Processing - * - * 07 09 2010 yarco.yang - * - * [MT6620 and MT5931] SW Migration: Add ADDBA support - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 29 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * replace g_rQM with Adpater->rQM - * - * 06 25 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add API in que_mgt to retrieve sta-rec index for security frames. - * - * 06 23 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Merge g_arStaRec[] into adapter->arStaRec[] - * - * 06 21 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Support CFG_MQM_MIGRATION flag - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add hem_mbox.c and cnm_mem.h (but disabled some feature) for further migration - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 03 30 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Enabled adaptive TC resource control - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port - * - * 03 19 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * By default enabling dynamic STA_REC activation and decactivation - * - * 03 17 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Changed STA_REC index determination rules (DA=BMCAST always --> STA_REC_INDEX_BMCAST) - * - * 03 11 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Fixed buffer leak when processing BAR frames - * - * 02 25 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Enabled multi-STA TX path with fairness - * - * 02 24 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Enabled dynamically activating and deactivating STA_RECs - * - * 02 24 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Added code for dynamic activating and deactivating STA_RECs. - * - * 01 13 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Enabled the Burst_End Indication mechanism -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-12-09 14:04:53 GMT MTK02468 -** Added RX buffer reordering function prototypes -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-12-02 22:08:44 GMT MTK02468 -** Added macro QM_INIT_STA_REC for initialize a STA_REC -** \main\maintrunk.MT6620WiFiDriver_Prj\1 2009-11-23 21:58:43 GMT mtk02468 -** Initial version -** -*/ - -#ifndef _QUE_MGT_H -#define _QUE_MGT_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/* Queue Manager Features */ -#define QM_BURST_END_INFO_ENABLED 1 /* 1: Indicate the last TX packet to the FW for each burst */ -#define QM_FORWARDING_FAIRNESS 1 /* 1: To fairly share TX resource among active STAs */ -#define QM_ADAPTIVE_TC_RESOURCE_CTRL 1 /* 1: To adaptively adjust resource for each TC */ -#define QM_PRINT_TC_RESOURCE_CTRL 0 /* 1: To print TC resource adjustment results */ -#define QM_RX_WIN_SSN_AUTO_ADVANCING 1 /* 1: If pkt with SSN is missing, auto advance the RX reordering window */ -#define QM_RX_INIT_FALL_BEHIND_PASS 1 /* 1: Indicate the packets falling behind to OS before the frame with SSN is received */ -/* Parameters */ -#define QM_INIT_TIME_TO_UPDATE_QUE_LEN 60 /* p: Update queue lengths when p TX packets are enqueued */ -#define QM_INIT_TIME_TO_ADJUST_TC_RSC 3 /* s: Adjust the TC resource every s updates of queue lengths */ -#define QM_QUE_LEN_MOVING_AVE_FACTOR 3 /* Factor for Que Len averaging */ - -#define QM_MIN_RESERVED_TC0_RESOURCE 1 -#define QM_MIN_RESERVED_TC1_RESOURCE 1 -#define QM_MIN_RESERVED_TC2_RESOURCE 1 -#define QM_MIN_RESERVED_TC3_RESOURCE 1 -#define QM_MIN_RESERVED_TC4_RESOURCE 2 /* Resource for TC4 is not adjustable */ -#define QM_MIN_RESERVED_TC5_RESOURCE 1 - -#if defined(MT6620) - -#define QM_GUARANTEED_TC0_RESOURCE 4 -#define QM_GUARANTEED_TC1_RESOURCE 4 -#define QM_GUARANTEED_TC2_RESOURCE 9 -#define QM_GUARANTEED_TC3_RESOURCE 11 -#define QM_GUARANTEED_TC4_RESOURCE 2 /* Resource for TC4 is not adjustable */ -#define QM_GUARANTEED_TC5_RESOURCE 4 - -#elif defined(MT5931) - -#define QM_GUARANTEED_TC0_RESOURCE 4 -#define QM_GUARANTEED_TC1_RESOURCE 4 -#define QM_GUARANTEED_TC2_RESOURCE 4 -#define QM_GUARANTEED_TC3_RESOURCE 4 -#define QM_GUARANTEED_TC4_RESOURCE 2 /* Resource for TC4 is not adjustable */ -#define QM_GUARANTEED_TC5_RESOURCE 2 - -#elif defined(MT6628) - -#define QM_GUARANTEED_TC0_RESOURCE 4 -#define QM_GUARANTEED_TC1_RESOURCE 4 -#define QM_GUARANTEED_TC2_RESOURCE 6 -#define QM_GUARANTEED_TC3_RESOURCE 6 -#define QM_GUARANTEED_TC4_RESOURCE 2 /* Resource for TC4 is not adjustable */ -#define QM_GUARANTEED_TC5_RESOURCE 4 - - -#else -#error -#endif - - - -#define QM_EXTRA_RESERVED_RESOURCE_WHEN_BUSY 0 - -#define QM_TOTAL_TC_RESOURCE (\ - NIC_TX_BUFF_COUNT_TC0 + NIC_TX_BUFF_COUNT_TC1 +\ - NIC_TX_BUFF_COUNT_TC2 + NIC_TX_BUFF_COUNT_TC3 +\ - NIC_TX_BUFF_COUNT_TC5) -#define QM_AVERAGE_TC_RESOURCE 6 - -/* Note: QM_INITIAL_RESIDUAL_TC_RESOURCE shall not be less than 0 */ -#define QM_INITIAL_RESIDUAL_TC_RESOURCE (QM_TOTAL_TC_RESOURCE - \ - (QM_GUARANTEED_TC0_RESOURCE +\ - QM_GUARANTEED_TC1_RESOURCE +\ - QM_GUARANTEED_TC2_RESOURCE +\ - QM_GUARANTEED_TC3_RESOURCE +\ - QM_GUARANTEED_TC5_RESOURCE \ - )) - -/* Hard-coded network type for Phase 3: NETWORK_TYPE_AIS/P2P/BOW */ -#define QM_OPERATING_NETWORK_TYPE NETWORK_TYPE_AIS - -#define QM_TEST_MODE 0 -#define QM_TEST_TRIGGER_TX_COUNT 50 -#define QM_TEST_STA_REC_DETERMINATION 0 -#define QM_TEST_STA_REC_DEACTIVATION 0 -#define QM_TEST_FAIR_FORWARDING 0 - -#define QM_DEBUG_COUNTER 0 - -/* Per-STA Queues: [0] AC0, [1] AC1, [2] AC2, [3] AC3, [4] 802.1x */ -/* Per-Type Queues: [0] BMCAST */ -#define NUM_OF_PER_STA_TX_QUEUES 5 -#define NUM_OF_PER_TYPE_TX_QUEUES 1 - -/* These two constants are also used for FW to verify the STA_REC index */ -#define STA_REC_INDEX_BMCAST 0xFF -#define STA_REC_INDEX_NOT_FOUND 0xFE - -/* TX Queue Index */ -#define TX_QUEUE_INDEX_BMCAST 0 -#define TX_QUEUE_INDEX_NO_STA_REC 0 -#define TX_QUEUE_INDEX_AC0 0 -#define TX_QUEUE_INDEX_AC1 1 -#define TX_QUEUE_INDEX_AC2 2 -#define TX_QUEUE_INDEX_AC3 3 -#define TX_QUEUE_INDEX_802_1X 4 -#define TX_QUEUE_INDEX_NON_QOS 1 - - -//1 WMM-related -/* WMM FLAGS */ -#define WMM_FLAG_SUPPORT_WMM BIT(0) -#define WMM_FLAG_SUPPORT_WMMSA BIT(1) -#define WMM_FLAG_AC_PARAM_PRESENT BIT(2) -#define WMM_FLAG_SUPPORT_UAPSD BIT(3) - -/* WMM Admission Control Mandatory FLAGS */ -#define ACM_FLAG_ADM_NOT_REQUIRED 0 -#define ACM_FLAG_ADM_GRANTED BIT(0) -#define ACM_FLAG_ADM_REQUIRED BIT(1) - -/* WMM Power Saving FLAGS */ -#define AC_FLAG_TRIGGER_ENABLED BIT(1) -#define AC_FLAG_DELIVERY_ENABLED BIT(2) - -/* WMM-2.2.1 WMM Information Element */ -#define ELEM_MAX_LEN_WMM_INFO 7 - -/* WMM-2.2.2 WMM Parameter Element */ -#define ELEM_MAX_LEN_WMM_PARAM 24 - -/* WMM-2.2.1 WMM QoS Info field */ -#define WMM_QOS_INFO_PARAM_SET_CNT BITS(0,3) /* Sent by AP */ -#define WMM_QOS_INFO_UAPSD BIT(7) - -#define WMM_QOS_INFO_VO_UAPSD BIT(0) /* Sent by non-AP STA */ -#define WMM_QOS_INFO_VI_UAPSD BIT(1) -#define WMM_QOS_INFO_BK_UAPSD BIT(2) -#define WMM_QOS_INFO_BE_UAPSD BIT(3) -#define WMM_QOS_INFO_MAX_SP_LEN_MASK BITS(5,6) -#define WMM_QOS_INFO_MAX_SP_ALL 0 -#define WMM_QOS_INFO_MAX_SP_2 BIT(5) -#define WMM_QOS_INFO_MAX_SP_4 BIT(6) -#define WMM_QOS_INFO_MAX_SP_6 BITS(5,6) - -/* -- definitions for Max SP length field */ -#define WMM_MAX_SP_LENGTH_ALL 0 -#define WMM_MAX_SP_LENGTH_2 2 -#define WMM_MAX_SP_LENGTH_4 4 -#define WMM_MAX_SP_LENGTH_6 6 - - -/* WMM-2.2.2 WMM ACI/AIFSN field */ -/* -- subfields in the ACI/AIFSN field */ -#define WMM_ACIAIFSN_AIFSN BITS(0,3) -#define WMM_ACIAIFSN_ACM BIT(4) -#define WMM_ACIAIFSN_ACI BITS(5,6) -#define WMM_ACIAIFSN_ACI_OFFSET 5 - -/* -- definitions for ACI field */ -#define WMM_ACI_AC_BE 0 -#define WMM_ACI_AC_BK BIT(5) -#define WMM_ACI_AC_VI BIT(6) -#define WMM_ACI_AC_VO BITS(5,6) - -#define WMM_ACI(_AC) (_AC << WMM_ACIAIFSN_ACI_OFFSET) - -/* -- definitions for ECWmin/ECWmax field */ -#define WMM_ECW_WMIN_MASK BITS(0,3) -#define WMM_ECW_WMAX_MASK BITS(4,7) -#define WMM_ECW_WMAX_OFFSET 4 - -#define TXM_DEFAULT_FLUSH_QUEUE_GUARD_TIME 0 /* Unit: 64 us */ - -#define QM_RX_BA_ENTRY_MISS_TIMEOUT_MS (1000) - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -enum { - QM_DBG_CNT_00=0, - QM_DBG_CNT_01, - QM_DBG_CNT_02, - QM_DBG_CNT_03, - QM_DBG_CNT_04, - QM_DBG_CNT_05, - QM_DBG_CNT_06, - QM_DBG_CNT_07, - QM_DBG_CNT_08, - QM_DBG_CNT_09, - QM_DBG_CNT_10, - QM_DBG_CNT_11, - QM_DBG_CNT_12, - QM_DBG_CNT_13, - QM_DBG_CNT_14, - QM_DBG_CNT_15, - QM_DBG_CNT_16, - QM_DBG_CNT_17, - QM_DBG_CNT_18, - QM_DBG_CNT_19, - QM_DBG_CNT_20, - QM_DBG_CNT_21, - QM_DBG_CNT_22, - QM_DBG_CNT_23, - QM_DBG_CNT_24, - QM_DBG_CNT_25, - QM_DBG_CNT_26, - QM_DBG_CNT_27, - QM_DBG_CNT_28, - QM_DBG_CNT_29, - QM_DBG_CNT_30, - QM_DBG_CNT_31, - QM_DBG_CNT_NUM -}; - - - - -/* Used for MAC TX */ -typedef enum _ENUM_MAC_TX_QUEUE_INDEX_T { - MAC_TX_QUEUE_AC0_INDEX = 0, - MAC_TX_QUEUE_AC1_INDEX, - MAC_TX_QUEUE_AC2_INDEX, - MAC_TX_QUEUE_AC3_INDEX, - MAC_TX_QUEUE_AC4_INDEX, - MAC_TX_QUEUE_AC5_INDEX, - MAC_TX_QUEUE_AC6_INDEX, - MAC_TX_QUEUE_BCN_INDEX, - MAC_TX_QUEUE_BMC_INDEX, - MAC_TX_QUEUE_NUM -} ENUM_MAC_TX_QUEUE_INDEX_T; - -typedef struct _RX_BA_ENTRY_T { - BOOLEAN fgIsValid; - QUE_T rReOrderQue; - UINT_16 u2WinStart; - UINT_16 u2WinEnd; - UINT_16 u2WinSize; - - /* For identifying the RX BA agreement */ - UINT_8 ucStaRecIdx; - UINT_8 ucTid; - - BOOLEAN fgIsWaitingForPktWithSsn; - - //UINT_8 ucTxBufferSize; - //BOOL fgIsAcConstrain; - //BOOL fgIsBaEnabled; -} RX_BA_ENTRY_T, *P_RX_BA_ENTRY_T; - -/* The mailbox message (could be used for Host-To-Device or Device-To-Host Mailbox) */ -typedef struct _MAILBOX_MSG_T{ - UINT_32 u4Msg[2]; /* [0]: D2HRM0R or H2DRM0R, [1]: D2HRM1R or H2DRM1R */ -} MAILBOX_MSG_T, *P_MAILBOX_MSG_T; - - -/* Used for adaptively adjusting TC resources */ -typedef struct _TC_RESOURCE_CTRL_T { - /* TC0, TC1, TC2, TC3, TC5 */ - UINT_32 au4AverageQueLen[TC_NUM - 1]; -} TC_RESOURCE_CTRL_T, *P_TC_RESOURCE_CTRL_T; - -typedef struct _QUE_MGT_T{ /* Queue Management Control Info */ - - /* Per-Type Queues: [0] BMCAST or UNKNOWN-STA packets */ - QUE_T arTxQueue[NUM_OF_PER_TYPE_TX_QUEUES]; - -#if 0 - /* For TX Scheduling */ - UINT_8 arRemainingTxOppt[NUM_OF_PER_STA_TX_QUEUES]; - UINT_8 arCurrentTxStaIndex[NUM_OF_PER_STA_TX_QUEUES]; - -#endif - - /* Reordering Queue Parameters */ - RX_BA_ENTRY_T arRxBaTable[CFG_NUM_OF_RX_BA_AGREEMENTS]; - - /* Current number of activated RX BA agreements <= CFG_NUM_OF_RX_BA_AGREEMENTS */ - UINT_8 ucRxBaCount; - -#if QM_TEST_MODE - UINT_32 u4PktCount; - P_ADAPTER_T prAdapter; - -#if QM_TEST_FAIR_FORWARDING - UINT_32 u4CurrentStaRecIndexToEnqueue; -#endif - -#endif - - -#if QM_FORWARDING_FAIRNESS - /* The current TX count for a STA with respect to a TC index */ - UINT_32 au4ForwardCount[NUM_OF_PER_STA_TX_QUEUES]; - - /* The current serving STA with respect to a TC index */ - UINT_32 au4HeadStaRecIndex [NUM_OF_PER_STA_TX_QUEUES]; -#endif - -#if QM_ADAPTIVE_TC_RESOURCE_CTRL - UINT_32 au4AverageQueLen[TC_NUM]; - UINT_32 au4CurrentTcResource[TC_NUM]; - UINT_32 au4MinReservedTcResource[TC_NUM]; /* The minimum amount of resource no matter busy or idle */ - UINT_32 au4GuaranteedTcResource[TC_NUM]; /* The minimum amount of resource when extremely busy */ - - UINT_32 u4TimeToAdjustTcResource; - UINT_32 u4TimeToUpdateQueLen; - - /* Set to TRUE if the last TC adjustment has not been completely applied (i.e., waiting more TX-Done events - to align the TC quotas to the TC resource assignment) */ - BOOLEAN fgTcResourcePostAnnealing; - -#endif - -#if QM_DEBUG_COUNTER - UINT_32 au4QmDebugCounters[QM_DBG_CNT_NUM]; -#endif - - - - -} QUE_MGT_T, *P_QUE_MGT_T; - - - -typedef struct _EVENT_RX_ADDBA_T { - /* Event header */ - UINT_16 u2Length; - UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */ - UINT_8 ucEID; - UINT_8 ucSeqNum; - UINT_8 aucReserved2[2]; - - /* Fields not present in the received ADDBA_REQ */ - UINT_8 ucStaRecIdx; - - /* Fields that are present in the received ADDBA_REQ */ - UINT_8 ucDialogToken; /* Dialog Token chosen by the sender */ - UINT_16 u2BAParameterSet; /* BA policy, TID, buffer size */ - UINT_16 u2BATimeoutValue; - UINT_16 u2BAStartSeqCtrl; /* SSN */ - -} EVENT_RX_ADDBA_T, *P_EVENT_RX_ADDBA_T; - -typedef struct _EVENT_RX_DELBA_T { - /* Event header */ - UINT_16 u2Length; - UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */ - UINT_8 ucEID; - UINT_8 ucSeqNum; - UINT_8 aucReserved2[2]; - - /* Fields not present in the received ADDBA_REQ */ - UINT_8 ucStaRecIdx; - UINT_8 ucTid; -} EVENT_RX_DELBA_T, *P_EVENT_RX_DELBA_T; - - -typedef struct _EVENT_BSS_ABSENCE_PRESENCE_T { - /* Event header */ - UINT_16 u2Length; - UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */ - UINT_8 ucEID; - UINT_8 ucSeqNum; - UINT_8 aucReserved2[2]; - - /* Event Body */ - UINT_8 ucNetTypeIdx; - BOOLEAN fgIsAbsent; - UINT_8 ucBssFreeQuota; - UINT_8 aucReserved[1]; -} EVENT_BSS_ABSENCE_PRESENCE_T, *P_EVENT_BSS_ABSENCE_PRESENCE_T; - - -typedef struct _EVENT_STA_CHANGE_PS_MODE_T { - /* Event header */ - UINT_16 u2Length; - UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */ - UINT_8 ucEID; - UINT_8 ucSeqNum; - UINT_8 aucReserved2[2]; - - /* Event Body */ - UINT_8 ucStaRecIdx; - BOOLEAN fgIsInPs; - UINT_8 ucUpdateMode; - UINT_8 ucFreeQuota; -} EVENT_STA_CHANGE_PS_MODE_T, *P_EVENT_STA_CHANGE_PS_MODE_T; - -/* The free quota is used by PS only now */ -/* The event may be used by per STA flow conttrol in general */ -typedef struct _EVENT_STA_UPDATE_FREE_QUOTA_T { - /* Event header */ - UINT_16 u2Length; - UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */ - UINT_8 ucEID; - UINT_8 ucSeqNum; - UINT_8 aucReserved2[2]; - - /* Event Body */ - UINT_8 ucStaRecIdx; - UINT_8 ucUpdateMode; - UINT_8 ucFreeQuota; - UINT_8 aucReserved[1]; -} EVENT_STA_UPDATE_FREE_QUOTA_T, *P_EVENT_STA_UPDATE_FREE_QUOTA_T; - - - - -/* WMM-2.2.1 WMM Information Element */ -typedef struct _IE_WMM_INFO_T { - UINT_8 ucId; /* Element ID */ - UINT_8 ucLength; /* Length */ - UINT_8 aucOui[3]; /* OUI */ - UINT_8 ucOuiType; /* OUI Type */ - UINT_8 ucOuiSubtype; /* OUI Subtype */ - UINT_8 ucVersion; /* Version */ - UINT_8 ucQosInfo; /* QoS Info field */ - UINT_8 ucDummy[3]; /* Dummy for pack */ -} IE_WMM_INFO_T, *P_IE_WMM_INFO_T; - -/* WMM-2.2.2 WMM Parameter Element */ -typedef struct _IE_WMM_PARAM_T { - UINT_8 ucId; /* Element ID */ - UINT_8 ucLength; /* Length */ - - /* IE Body */ - UINT_8 aucOui[3]; /* OUI */ - UINT_8 ucOuiType; /* OUI Type */ - UINT_8 ucOuiSubtype; /* OUI Subtype */ - UINT_8 ucVersion; /* Version */ - - /* WMM IE Body */ - UINT_8 ucQosInfo; /* QoS Info field */ - UINT_8 ucReserved; - - /* AC Parameters */ - UINT_8 ucAciAifsn_BE; - UINT_8 ucEcw_BE; - UINT_8 aucTxopLimit_BE[2]; - - UINT_8 ucAciAifsn_BG; - UINT_8 ucEcw_BG; - UINT_8 aucTxopLimit_BG[2]; - - UINT_8 ucAciAifsn_VI; - UINT_8 ucEcw_VI; - UINT_8 aucTxopLimit_VI[2]; - - UINT_8 ucAciAifsn_VO; - UINT_8 ucEcw_VO; - UINT_8 aucTxopLimit_VO[2]; - -} IE_WMM_PARAM_T, *P_IE_WMM_PARAM_T; - -typedef struct _IE_WMM_TSPEC_T { - UINT_8 ucId; /* Element ID */ - UINT_8 ucLength; /* Length */ - UINT_8 aucOui[3]; /* OUI */ - UINT_8 ucOuiType; /* OUI Type */ - UINT_8 ucOuiSubtype; /* OUI Subtype */ - UINT_8 ucVersion; /* Version */ - /* WMM TSPEC body */ - UINT_8 aucTsInfo[3]; /* TS Info */ - UINT_8 aucTspecBodyPart[1]; /* Note: Utilize PARAM_QOS_TSPEC to fill (memory copy) */ -} IE_WMM_TSPEC_T, *P_IE_WMM_TSPEC_T; - -typedef struct _IE_WMM_HDR_T { - UINT_8 ucId; /* Element ID */ - UINT_8 ucLength; /* Length */ - UINT_8 aucOui[3]; /* OUI */ - UINT_8 ucOuiType; /* OUI Type */ - UINT_8 ucOuiSubtype; /* OUI Subtype */ - UINT_8 ucVersion; /* Version */ - UINT_8 aucBody[1]; /* IE body */ -} IE_WMM_HDR_T, *P_IE_WMM_HDR_T; - - -typedef struct _AC_QUE_PARMS_T{ - UINT_16 u2CWmin; /*!< CWmin */ - UINT_16 u2CWmax; /*!< CWmax */ - UINT_16 u2TxopLimit; /*!< TXOP limit */ - UINT_16 u2Aifsn; /*!< AIFSN */ - UINT_8 ucGuradTime; /*!< GuardTime for STOP/FLUSH. */ - BOOLEAN fgIsACMSet; -} AC_QUE_PARMS_T, *P_AC_QUE_PARMS_T; - -/* WMM ACI (AC index) */ -typedef enum _ENUM_WMM_ACI_T { - WMM_AC_BE_INDEX = 0, - WMM_AC_BK_INDEX, - WMM_AC_VI_INDEX, - WMM_AC_VO_INDEX, - WMM_AC_INDEX_NUM -} ENUM_WMM_ACI_T, *P_ENUM_WMM_ACI_T; - - -/* Used for CMD Queue Operation */ -typedef enum _ENUM_FRAME_ACTION_T { - FRAME_ACTION_DROP_PKT = 0, - FRAME_ACTION_QUEUE_PKT, - FRAME_ACTION_TX_PKT, - FRAME_ACTION_NUM -} ENUM_FRAME_ACTION_T; - - -typedef enum _ENUM_FRAME_TYPE_IN_CMD_Q_T { - FRAME_TYPE_802_1X = 0, - FRAME_TYPE_MMPDU, - FRAME_TYEP_NUM -} ENUM_FRAME_TYPE_IN_CMD_Q_T; - -typedef enum _ENUM_FREE_QUOTA_MODET_T { - FREE_QUOTA_UPDATE_MODE_INIT = 0, - FREE_QUOTA_UPDATE_MODE_OVERWRITE, - FREE_QUOTA_UPDATE_MODE_INCREASE, - FREE_QUOTA_UPDATE_MODE_DECREASE -} ENUM_FREE_QUOTA_MODET_T, *P_ENUM_FREE_QUOTA_MODET_T; - - - -typedef struct _CMD_UPDATE_WMM_PARMS_T { - AC_QUE_PARMS_T arACQueParms[AC_NUM]; - UINT_8 ucNetTypeIndex; - UINT_8 fgIsQBSS; - UINT_8 aucReserved[2]; -} CMD_UPDATE_WMM_PARMS_T, *P_CMD_UPDATE_WMM_PARMS_T; - - -typedef struct _CMD_TX_AMPDU_T { - BOOLEAN fgEnable; - UINT_8 aucReserved[3]; -} CMD_TX_AMPDU_T, *P_CMD_TX_AMPDU_T; - - -typedef struct _CMD_ADDBA_REJECT { - BOOLEAN fgEnable; - UINT_8 aucReserved[3]; -} CMD_ADDBA_REJECT_T, *P_CMD_ADDBA_REJECT_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -#define QM_TX_SET_NEXT_MSDU_INFO(_prMsduInfoPreceding, _prMsduInfoNext) \ - ((((_prMsduInfoPreceding)->rQueEntry).prNext) = (P_QUE_ENTRY_T)(_prMsduInfoNext)) - -#define QM_TX_SET_NEXT_SW_RFB(_prSwRfbPreceding, _prSwRfbNext) \ - ((((_prSwRfbPreceding)->rQueEntry).prNext) = (P_QUE_ENTRY_T)(_prSwRfbNext)) - - -#define QM_TX_GET_NEXT_MSDU_INFO(_prMsduInfo) \ - ((P_MSDU_INFO_T)(((_prMsduInfo)->rQueEntry).prNext)) - -#define QM_RX_SET_NEXT_SW_RFB(_prSwRfbPreceding, _prSwRfbNext) \ - ((((_prSwRfbPreceding)->rQueEntry).prNext) = (P_QUE_ENTRY_T)(_prSwRfbNext)) - -#define QM_RX_GET_NEXT_SW_RFB(_prSwRfb) \ - ((P_SW_RFB_T)(((_prSwRfb)->rQueEntry).prNext)) - -#if 0 -#define QM_GET_STA_REC_PTR_FROM_INDEX(_prAdapter, _ucIndex) \ - ((((_ucIndex) != STA_REC_INDEX_BMCAST) && ((_ucIndex)!= STA_REC_INDEX_NOT_FOUND)) ?\ - &(_prAdapter->arStaRec[_ucIndex]): NULL) -#endif - -#define QM_GET_STA_REC_PTR_FROM_INDEX(_prAdapter, _ucIndex) \ - cnmGetStaRecByIndex(_prAdapter,_ucIndex) - - -#define QM_TX_SET_MSDU_INFO_FOR_DATA_PACKET(\ - _prMsduInfo,\ - _ucTC,\ - _ucPacketType,\ - _ucFormatID,\ - _fgIs802_1x,\ - _fgIs802_11,\ - _u2PalLLH,\ - _u2AclSN,\ - _ucPsForwardingType,\ - _ucPsSessionID\ - ) \ -{\ - ASSERT(_prMsduInfo);\ - (_prMsduInfo)->ucTC = (_ucTC);\ - (_prMsduInfo)->ucPacketType = (_ucPacketType);\ - (_prMsduInfo)->ucFormatID = (_ucFormatID);\ - (_prMsduInfo)->fgIs802_1x = (_fgIs802_1x);\ - (_prMsduInfo)->fgIs802_11 = (_fgIs802_11);\ - (_prMsduInfo)->u2PalLLH = (_u2PalLLH);\ - (_prMsduInfo)->u2AclSN = (_u2AclSN);\ - (_prMsduInfo)->ucPsForwardingType = (_ucPsForwardingType);\ - (_prMsduInfo)->ucPsSessionID = (_ucPsSessionID);\ - (_prMsduInfo)->fgIsBurstEnd = (FALSE);\ -} - -#define QM_INIT_STA_REC(\ - _prStaRec,\ - _fgIsValid,\ - _fgIsQoS,\ - _pucMacAddr\ - )\ -{\ - ASSERT(_prStaRec);\ - (_prStaRec)->fgIsValid = (_fgIsValid);\ - (_prStaRec)->fgIsQoS = (_fgIsQoS);\ - (_prStaRec)->fgIsInPS = FALSE; \ - (_prStaRec)->ucPsSessionID = 0xFF;\ - COPY_MAC_ADDR((_prStaRec)->aucMacAddr,(_pucMacAddr));\ -} - -#if QM_ADAPTIVE_TC_RESOURCE_CTRL -#define QM_GET_TX_QUEUE_LEN(_prAdapter, _u4QueIdx) ((_prAdapter->rQM.au4AverageQueLen[(_u4QueIdx)] >> QM_QUE_LEN_MOVING_AVE_FACTOR)) -#endif - - -#define WMM_IE_OUI_TYPE(fp) (((P_IE_WMM_HDR_T)(fp))->ucOuiType) -#define WMM_IE_OUI_SUBTYPE(fp) (((P_IE_WMM_HDR_T)(fp))->ucOuiSubtype) -#define WMM_IE_OUI(fp) (((P_IE_WMM_HDR_T)(fp))->aucOui) - -#if QM_DEBUG_COUNTER -#define QM_DBG_CNT_INC(_prQM, _index) { (_prQM)->au4QmDebugCounters[(_index)]++; } -#else -#define QM_DBG_CNT_INC(_prQM, _index) {} -#endif - - - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/* Queue Management and STA_REC Initialization */ -/*----------------------------------------------------------------------------*/ - -VOID -qmInit( - IN P_ADAPTER_T prAdapter - ); - -#if QM_TEST_MODE -VOID -qmTestCases( - IN P_ADAPTER_T prAdapter - ); -#endif - -VOID -qmActivateStaRec( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -VOID -qmDeactivateStaRec( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4StaRecIdx - ); - - -/*----------------------------------------------------------------------------*/ -/* TX-Related Queue Management */ -/*----------------------------------------------------------------------------*/ - -P_MSDU_INFO_T -qmFlushTxQueues( - IN P_ADAPTER_T prAdapter - ); - -P_MSDU_INFO_T -qmFlushStaTxQueues( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4StaRecIdx - ); - -P_MSDU_INFO_T -qmEnqueueTxPackets( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfoListHead - ); - -P_MSDU_INFO_T -qmDequeueTxPackets( - IN P_ADAPTER_T prAdapter, - IN P_TX_TCQ_STATUS_T prTcqStatus - ); - -VOID -qmAdjustTcQuotas ( - IN P_ADAPTER_T prAdapter, - OUT P_TX_TCQ_ADJUST_T prTcqAdjust, - IN P_TX_TCQ_STATUS_T prTcqStatus - ); - - -#if QM_ADAPTIVE_TC_RESOURCE_CTRL -VOID -qmReassignTcResource( - IN P_ADAPTER_T prAdapter - ); - -VOID -qmUpdateAverageTxQueLen( - IN P_ADAPTER_T prAdapter - ); -#endif - - -/*----------------------------------------------------------------------------*/ -/* RX-Related Queue Management */ -/*----------------------------------------------------------------------------*/ - -VOID -qmInitRxQueues( - IN P_ADAPTER_T prAdapter - ); - -P_SW_RFB_T -qmFlushRxQueues( - IN P_ADAPTER_T prAdapter - ); - -P_SW_RFB_T -qmHandleRxPackets( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfbListHead - ); - -VOID -qmProcessPktWithReordering( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT P_QUE_T prReturnedQue - ); - -VOID -qmProcessBarFrame( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT P_QUE_T prReturnedQue - ); - -VOID -qmInsertFallWithinReorderPkt( - IN P_SW_RFB_T prSwRfb, - IN P_RX_BA_ENTRY_T prReorderQueParm, - OUT P_QUE_T prReturnedQue - ); - -VOID -qmInsertFallAheadReorderPkt( - IN P_SW_RFB_T prSwRfb, - IN P_RX_BA_ENTRY_T prReorderQueParm, - OUT P_QUE_T prReturnedQue - ); - -VOID -qmPopOutDueToFallWithin( - IN P_RX_BA_ENTRY_T prReorderQueParm, - OUT P_QUE_T prReturnedQue - ); - -VOID -qmPopOutDueToFallAhead( - IN P_RX_BA_ENTRY_T prReorderQueParm, - OUT P_QUE_T prReturnedQue - ); - - -VOID -qmHandleMailboxRxMessage( - IN MAILBOX_MSG_T prMailboxRxMsg - ); - -BOOLEAN -qmCompareSnIsLessThan( - IN UINT_32 u4SnLess, - IN UINT_32 u4SnGreater - ); - -VOID -qmHandleEventRxAddBa( - IN P_ADAPTER_T prAdapter, - IN P_WIFI_EVENT_T prEvent - ); - -VOID -qmHandleEventRxDelBa( - IN P_ADAPTER_T prAdapter, - IN P_WIFI_EVENT_T prEvent - ); - -P_RX_BA_ENTRY_T -qmLookupRxBaEntry( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucStaRecIdx, - IN UINT_8 ucTid - ); - -BOOL -qmAddRxBaEntry( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucStaRecIdx, - IN UINT_8 ucTid, - IN UINT_16 u2WinStart, - IN UINT_16 u2WinSize - ); - - -VOID -qmDelRxBaEntry( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucStaRecIdx, - IN UINT_8 ucTid, - IN BOOLEAN fgFlushToHost - ); - - -VOID -mqmProcessAssocRsp ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN PUINT_8 pucIE, - IN UINT_16 u2IELength - ); - -VOID -mqmParseEdcaParameters ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN PUINT_8 pucIE, - IN UINT_16 u2IELength, - IN BOOLEAN fgForceOverride - ); - -VOID -mqmFillAcQueParam( - IN P_IE_WMM_PARAM_T prIeWmmParam, - IN UINT_32 u4AcOffset, - OUT P_AC_QUE_PARMS_T prAcQueParams - ); - -VOID -mqmProcessScanResult( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prScanResult, - OUT P_STA_RECORD_T prStaRec - ); - - -/* Utility function: for deciding STA-REC index */ -UINT_8 -qmGetStaRecIdx( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucEthDestAddr, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType - ); - -VOID -mqmGenerateWmmInfoIE ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - -VOID -mqmGenerateWmmParamIE ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - - -ENUM_FRAME_ACTION_T -qmGetFrameAction( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType, - IN UINT_8 ucStaRecIdx, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_FRAME_TYPE_IN_CMD_Q_T eFrameType -); - -VOID -qmHandleEventBssAbsencePresence( - IN P_ADAPTER_T prAdapter, - IN P_WIFI_EVENT_T prEvent - ); - -VOID -qmHandleEventStaChangePsMode( - IN P_ADAPTER_T prAdapter, - IN P_WIFI_EVENT_T prEvent - ); - -VOID -mqmProcessAssocReq ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN PUINT_8 pucIE, - IN UINT_16 u2IELength - ); - -VOID -qmHandleEventStaUpdateFreeQuota( - IN P_ADAPTER_T prAdapter, - IN P_WIFI_EVENT_T prEvent - ); - - -VOID -qmUpdateFreeQuota( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN UINT_8 ucUpdateMode, - IN UINT_8 ucFreeQuota - ); - -VOID -qmFreeAllByNetType( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ); - -UINT_32 -qmGetRxReorderQueuedBufferCount( - IN P_ADAPTER_T prAdapter - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _QUE_MGT_H */ diff --git a/drivers/net/wireless/mt5931/include/nic/wlan_def.h b/drivers/net/wireless/mt5931/include/nic/wlan_def.h deleted file mode 100755 index 6a000d8c3532..000000000000 --- a/drivers/net/wireless/mt5931/include/nic/wlan_def.h +++ /dev/null @@ -1,1012 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/wlan_def.h#1 $ -*/ - -/*! \file "wlan_def.h" - \brief This file includes the basic definition of WLAN - -*/ - - - -/* -** $Log: wlan_def.h $ - * - * 12 05 2011 cp.wu - * [WCXRP00001131] [MT6620 Wi-Fi][Driver][AIS] Implement connect-by-BSSID path - * add CONNECT_BY_BSSID policy - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 06 22 2011 wh.su - * [WCXRP00000806] [MT6620 Wi-Fi][Driver] Move the WPA/RSN IE and WAPI IE structure to mac.h and let the sw structure not align at byte - * Move the WAPI/RSN IE to mac.h and SW structure not align to byte, - * Notice needed update P2P.ko. - * - * 04 08 2011 eddie.chen - * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma - * Fix for sigma - * - * 03 17 2011 yuche.tsai - * NULL - * Resize the Secondary Device Type array when WiFi Direct is enabled. - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Change Station Type in Station Record, Modify MACRO definition for getting station type & network type index & Role. - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Add new station type MACRO. - * - * 12 07 2010 cm.chang - * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant - * 1. Country code is from NVRAM or supplicant - * 2. Change band definition in CMD/EVENT. - * - * 10 11 2010 kevin.huang - * [WCXRP00000068] [MT6620 Wi-Fi][Driver][FW] Fix STA RECORD sync issue and remove unused code - * Update ENUM_STA_ROLE_INDEX_T by using a fixed base value - * - * 10 04 2010 cp.wu - * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only - * remove ENUM_NETWORK_TYPE_T definitions - * - * 09 14 2010 chinghwa.yu - * NULL - * Update OP_MODE_BOW and include bow_fsm.h. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 31 2010 kevin.huang - * NULL - * Use LINK LIST operation to process SCAN result - * - * 08 29 2010 yuche.tsai - * NULL - * Change P2P Descriptor List to a pointer and allocate it dynamically to avoid structure corrupt by BssDescriptor free. - * - * 08 16 2010 kevin.huang - * NULL - * Refine AAA functions - * - * 08 12 2010 kevin.huang - * NULL - * Refine bssProcessProbeRequest() and bssSendBeaconProbeResponse() - * - * 08 12 2010 yuche.tsai - * NULL - * Add a pointer in BSS Descriptor for P2P Descriptor. - * - * 08 11 2010 yuche.tsai - * NULL - * Add an Interface in BSS Descriptor. - * - * 08 05 2010 yuche.tsai - * NULL - * Modify data structure for P2P Scan result. - * - * 07 26 2010 yuche.tsai - * - * Add an operation mode for P2P device. - * - * 07 23 2010 cp.wu - * - * P2P/RSN/WAPI IEs need to be declared with compact structure. - * - * 07 21 2010 yuche.tsai - * - * Add for P2P Scan Result Parsing & Saving. - * - * 07 20 2010 wh.su - * - * adding the wapi code. - * - * 07 09 2010 cp.wu - * - * 1) separate AIS_FSM state for two kinds of scanning. (OID triggered scan, and scan-for-connection) - * 2) eliminate PRE_BSS_DESC_T, Beacon/PrebResp is now parsed in single pass - * 3) implment DRV-SCN module, currently only accepts single scan request, other request will be directly dropped by returning BUSY - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 28 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * 1st draft code for RLM module - * - * 06 25 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * modify Beacon/ProbeResp to complete parsing, - * because host software has looser memory usage restriction - * - * 06 21 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Add P2P present boolean flag in BSS & Pre-BSS descriptor. - * - * 06 18 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * migration the security related function from firmware. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * auth.c is migrated. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add buildable & linkable ais_fsm.c - * - * related reference are still waiting to be resolved - * - * 06 09 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add definitions for module migration. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * move bss related data types to wlan_def.h to avoid recursive dependency. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge wlan_def.h. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge cnm_scan.h and hem_mbox.h - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge wifi_var.h, precomp.h, cnm_timer.h (data type only) - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:40 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _WLAN_DEF_H -#define _WLAN_DEF_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -/* disconnect reason */ -#define DISCONNECT_REASON_CODE_RESERVED 0 -#define DISCONNECT_REASON_CODE_RADIO_LOST 1 -#define DISCONNECT_REASON_CODE_DEAUTHENTICATED 2 -#define DISCONNECT_REASON_CODE_DISASSOCIATED 3 -#define DISCONNECT_REASON_CODE_NEW_CONNECTION 4 - -/* The rate definitions */ -#define TX_MODE_CCK 0x00 -#define TX_MODE_OFDM 0x40 -#define TX_MODE_HT_MM 0x80 -#define TX_MODE_HT_GF 0xC0 - -#define RATE_CCK_SHORT_PREAMBLE 0x10 -#define RATE_OFDM 0x20 - -#define PHY_RATE_1M 0x0 -#define PHY_RATE_2M 0x1 -#define PHY_RATE_5_5M 0x2 -#define PHY_RATE_11M 0x3 -#define PHY_RATE_6M 0xB -#define PHY_RATE_9M 0xF -#define PHY_RATE_12M 0xA -#define PHY_RATE_18M 0xE -#define PHY_RATE_24M 0x9 -#define PHY_RATE_36M 0xD -#define PHY_RATE_48M 0x8 -#define PHY_RATE_54M 0xC -#define PHY_RATE_MCS0 0x0 -#define PHY_RATE_MCS1 0x1 -#define PHY_RATE_MCS2 0x2 -#define PHY_RATE_MCS3 0x3 -#define PHY_RATE_MCS4 0x4 -#define PHY_RATE_MCS5 0x5 -#define PHY_RATE_MCS6 0x6 -#define PHY_RATE_MCS7 0x7 -#define PHY_RATE_MCS32 0x20 - -#define RATE_CCK_1M_LONG (TX_MODE_CCK | PHY_RATE_1M) -#define RATE_CCK_2M_LONG (TX_MODE_CCK | PHY_RATE_2M) -#define RATE_CCK_5_5M_LONG (TX_MODE_CCK | PHY_RATE_5_5M) -#define RATE_CCK_11M_LONG (TX_MODE_CCK | PHY_RATE_11M) -#define RATE_CCK_2M_SHORT (TX_MODE_CCK | PHY_RATE_2M | RATE_CCK_SHORT_PREAMBLE) -#define RATE_CCK_5_5M_SHORT (TX_MODE_CCK | PHY_RATE_5_5M | RATE_CCK_SHORT_PREAMBLE) -#define RATE_CCK_11M_SHORT (TX_MODE_CCK | PHY_RATE_11M | RATE_CCK_SHORT_PREAMBLE) -#define RATE_OFDM_6M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_6M) -#define RATE_OFDM_9M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_9M) -#define RATE_OFDM_12M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_12M) -#define RATE_OFDM_18M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_18M) -#define RATE_OFDM_24M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_24M) -#define RATE_OFDM_36M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_36M) -#define RATE_OFDM_48M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_48M) -#define RATE_OFDM_54M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_54M) - -#define RATE_MM_MCS_0 (TX_MODE_HT_MM | PHY_RATE_MCS0) -#define RATE_MM_MCS_1 (TX_MODE_HT_MM | PHY_RATE_MCS1) -#define RATE_MM_MCS_2 (TX_MODE_HT_MM | PHY_RATE_MCS2) -#define RATE_MM_MCS_3 (TX_MODE_HT_MM | PHY_RATE_MCS3) -#define RATE_MM_MCS_4 (TX_MODE_HT_MM | PHY_RATE_MCS4) -#define RATE_MM_MCS_5 (TX_MODE_HT_MM | PHY_RATE_MCS5) -#define RATE_MM_MCS_6 (TX_MODE_HT_MM | PHY_RATE_MCS6) -#define RATE_MM_MCS_7 (TX_MODE_HT_MM | PHY_RATE_MCS7) -#define RATE_MM_MCS_32 (TX_MODE_HT_MM | PHY_RATE_MCS32) - -#define RATE_GF_MCS_0 (TX_MODE_HT_GF | PHY_RATE_MCS0) -#define RATE_GF_MCS_1 (TX_MODE_HT_GF | PHY_RATE_MCS1) -#define RATE_GF_MCS_2 (TX_MODE_HT_GF | PHY_RATE_MCS2) -#define RATE_GF_MCS_3 (TX_MODE_HT_GF | PHY_RATE_MCS3) -#define RATE_GF_MCS_4 (TX_MODE_HT_GF | PHY_RATE_MCS4) -#define RATE_GF_MCS_5 (TX_MODE_HT_GF | PHY_RATE_MCS5) -#define RATE_GF_MCS_6 (TX_MODE_HT_GF | PHY_RATE_MCS6) -#define RATE_GF_MCS_7 (TX_MODE_HT_GF | PHY_RATE_MCS7) -#define RATE_GF_MCS_32 (TX_MODE_HT_GF | PHY_RATE_MCS32) - -#define RATE_TX_MODE_MASK BITS(6,7) -#define RATE_TX_MODE_OFFSET 6 -#define RATE_CODE_GET_TX_MODE(_ucRateCode) ((_ucRateCode & RATE_TX_MODE_MASK) >> RATE_TX_MODE_OFFSET) -#define RATE_PHY_RATE_MASK BITS(0,5) -#define RATE_PHY_RATE_OFFSET 0 -#define RATE_CODE_GET_PHY_RATE(_ucRateCode) ((_ucRateCode & RATE_PHY_RATE_MASK) >> RATE_PHY_RATE_OFFSET) -#define RATE_PHY_RATE_SHORT_PREAMBLE BIT(4) -#define RATE_CODE_IS_SHORT_PREAMBLE(_ucRateCode) ((_ucRateCode & RATE_PHY_RATE_SHORT_PREAMBLE)?TRUE:FALSE) - - -#define CHNL_LIST_SZ_2G 14 -#define CHNL_LIST_SZ_5G 14 - -/*! CNM(STA_RECORD_T) related definition */ -#define CFG_STA_REC_NUM 20 - -/* PHY TYPE bit definitions */ -#define PHY_TYPE_BIT_HR_DSSS BIT(PHY_TYPE_HR_DSSS_INDEX) /* HR/DSSS PHY (clause 18) */ -#define PHY_TYPE_BIT_ERP BIT(PHY_TYPE_ERP_INDEX) /* ERP PHY (clause 19) */ -#define PHY_TYPE_BIT_OFDM BIT(PHY_TYPE_OFDM_INDEX) /* OFDM 5 GHz PHY (clause 17) */ -#define PHY_TYPE_BIT_HT BIT(PHY_TYPE_HT_INDEX) /* HT PHY (clause 20) */ - - -/* PHY TYPE set definitions */ -#define PHY_TYPE_SET_802_11ABGN (PHY_TYPE_BIT_OFDM | \ - PHY_TYPE_BIT_HR_DSSS | \ - PHY_TYPE_BIT_ERP | \ - PHY_TYPE_BIT_HT) - -#define PHY_TYPE_SET_802_11BGN (PHY_TYPE_BIT_HR_DSSS | \ - PHY_TYPE_BIT_ERP | \ - PHY_TYPE_BIT_HT) - -#define PHY_TYPE_SET_802_11GN (PHY_TYPE_BIT_ERP | \ - PHY_TYPE_BIT_HT) - -#define PHY_TYPE_SET_802_11AN (PHY_TYPE_BIT_OFDM | \ - PHY_TYPE_BIT_HT) - -#define PHY_TYPE_SET_802_11ABG (PHY_TYPE_BIT_OFDM | \ - PHY_TYPE_BIT_HR_DSSS | \ - PHY_TYPE_BIT_ERP) - -#define PHY_TYPE_SET_802_11BG (PHY_TYPE_BIT_HR_DSSS | \ - PHY_TYPE_BIT_ERP) - -#define PHY_TYPE_SET_802_11A (PHY_TYPE_BIT_OFDM) - -#define PHY_TYPE_SET_802_11G (PHY_TYPE_BIT_ERP) - -#define PHY_TYPE_SET_802_11B (PHY_TYPE_BIT_HR_DSSS) - -#define PHY_TYPE_SET_802_11N (PHY_TYPE_BIT_HT) - - -/* Rate set bit definitions */ -#define RATE_SET_BIT_1M BIT(RATE_1M_INDEX) /* Bit 0: 1M */ -#define RATE_SET_BIT_2M BIT(RATE_2M_INDEX) /* Bit 1: 2M */ -#define RATE_SET_BIT_5_5M BIT(RATE_5_5M_INDEX) /* Bit 2: 5.5M */ -#define RATE_SET_BIT_11M BIT(RATE_11M_INDEX) /* Bit 3: 11M */ -#define RATE_SET_BIT_22M BIT(RATE_22M_INDEX) /* Bit 4: 22M */ -#define RATE_SET_BIT_33M BIT(RATE_33M_INDEX) /* Bit 5: 33M */ -#define RATE_SET_BIT_6M BIT(RATE_6M_INDEX) /* Bit 6: 6M */ -#define RATE_SET_BIT_9M BIT(RATE_9M_INDEX) /* Bit 7: 9M */ -#define RATE_SET_BIT_12M BIT(RATE_12M_INDEX) /* Bit 8: 12M */ -#define RATE_SET_BIT_18M BIT(RATE_18M_INDEX) /* Bit 9: 18M */ -#define RATE_SET_BIT_24M BIT(RATE_24M_INDEX) /* Bit 10: 24M */ -#define RATE_SET_BIT_36M BIT(RATE_36M_INDEX) /* Bit 11: 36M */ -#define RATE_SET_BIT_48M BIT(RATE_48M_INDEX) /* Bit 12: 48M */ -#define RATE_SET_BIT_54M BIT(RATE_54M_INDEX) /* Bit 13: 54M */ -#define RATE_SET_BIT_HT_PHY BIT(RATE_HT_PHY_INDEX) /* Bit 14: BSS Selector */ - - -/* Rate set definitions */ -#define RATE_SET_HR_DSSS (RATE_SET_BIT_1M | \ - RATE_SET_BIT_2M | \ - RATE_SET_BIT_5_5M | \ - RATE_SET_BIT_11M) - -#define RATE_SET_ERP (RATE_SET_BIT_1M | \ - RATE_SET_BIT_2M | \ - RATE_SET_BIT_5_5M | \ - RATE_SET_BIT_11M | \ - RATE_SET_BIT_6M | \ - RATE_SET_BIT_9M | \ - RATE_SET_BIT_12M | \ - RATE_SET_BIT_18M | \ - RATE_SET_BIT_24M | \ - RATE_SET_BIT_36M | \ - RATE_SET_BIT_48M | \ - RATE_SET_BIT_54M) - -#define RATE_SET_ERP_P2P (RATE_SET_BIT_6M | \ - RATE_SET_BIT_9M | \ - RATE_SET_BIT_12M | \ - RATE_SET_BIT_18M | \ - RATE_SET_BIT_24M | \ - RATE_SET_BIT_36M | \ - RATE_SET_BIT_48M | \ - RATE_SET_BIT_54M) - -#define RATE_SET_OFDM (RATE_SET_BIT_6M | \ - RATE_SET_BIT_9M | \ - RATE_SET_BIT_12M | \ - RATE_SET_BIT_18M | \ - RATE_SET_BIT_24M | \ - RATE_SET_BIT_36M | \ - RATE_SET_BIT_48M | \ - RATE_SET_BIT_54M) - -#define RATE_SET_HT (RATE_SET_ERP) -//#define RATE_SET_HT (RATE_SET_ERP | RATE_SET_BIT_HT_PHY) /* NOTE(Kevin): TBD */ - - -#define RATE_SET_ALL_ABG RATE_SET_ERP - -#define BASIC_RATE_SET_HR_DSSS (RATE_SET_BIT_1M | \ - RATE_SET_BIT_2M) - -#define BASIC_RATE_SET_HR_DSSS_ERP (RATE_SET_BIT_1M | \ - RATE_SET_BIT_2M | \ - RATE_SET_BIT_5_5M | \ - RATE_SET_BIT_11M) - -#define BASIC_RATE_SET_ERP (RATE_SET_BIT_1M | \ - RATE_SET_BIT_2M | \ - RATE_SET_BIT_5_5M | \ - RATE_SET_BIT_11M | \ - RATE_SET_BIT_6M | \ - RATE_SET_BIT_12M | \ - RATE_SET_BIT_24M) - -#define BASIC_RATE_SET_OFDM (RATE_SET_BIT_6M | \ - RATE_SET_BIT_12M | \ - RATE_SET_BIT_24M) - -#define BASIC_RATE_SET_ERP_P2P (RATE_SET_BIT_6M | \ - RATE_SET_BIT_12M | \ - RATE_SET_BIT_24M) - -#define INITIAL_RATE_SET_RCPI_100 RATE_SET_ALL_ABG - -#define INITIAL_RATE_SET_RCPI_80 (RATE_SET_BIT_1M | \ - RATE_SET_BIT_2M | \ - RATE_SET_BIT_5_5M | \ - RATE_SET_BIT_11M | \ - RATE_SET_BIT_6M | \ - RATE_SET_BIT_9M | \ - RATE_SET_BIT_12M | \ - RATE_SET_BIT_24M) - -#define INITIAL_RATE_SET_RCPI_60 (RATE_SET_BIT_1M | \ - RATE_SET_BIT_2M | \ - RATE_SET_BIT_5_5M | \ - RATE_SET_BIT_11M | \ - RATE_SET_BIT_6M) - -#define INITIAL_RATE_SET(_rcpi) (INITIAL_RATE_SET_ ## _rcpi) - -#define RCPI_100 100 /* -60 dBm */ -#define RCPI_80 80 /* -70 dBm */ -#define RCPI_60 60 /* -80 dBm */ - - -/* The number of RCPI records used to calculate their average value */ -#define MAX_NUM_RCPI_RECORDS 10 - -/* The number of RCPI records used to calculate their average value */ -#define NO_RCPI_RECORDS -128 -#define MAX_RCPI_DBM 0 -#define MIN_RCPI_DBM -100 - - -#define MAC_TX_RESERVED_FIELD 0 /* NOTE(Kevin): Should defined in tx.h */ - -#define MAX_ASSOC_ID (CFG_STA_REC_NUM) /* Available AID: 1 ~ 20(STA_REC_NUM) */ - - -#define MAX_DEAUTH_INFO_COUNT 4 /* NOTE(Kevin): Used in auth.c */ -#define MIN_DEAUTH_INTERVAL_MSEC 500 /* The minimum interval if continuously send Deauth Frame */ - -/* Authentication Type */ -#define AUTH_TYPE_OPEN_SYSTEM BIT(AUTH_ALGORITHM_NUM_OPEN_SYSTEM) -#define AUTH_TYPE_SHARED_KEY BIT(AUTH_ALGORITHM_NUM_SHARED_KEY) -#define AUTH_TYPE_FAST_BSS_TRANSITION BIT(AUTH_ALGORITHM_NUM_FAST_BSS_TRANSITION) - -/* Authentication Retry Limit */ -#define TX_AUTH_ASSOCI_RETRY_LIMIT 2 -#define TX_AUTH_ASSOCI_RETRY_LIMIT_FOR_ROAMING 1 - -/* WMM-2.2.1 WMM Information Element */ -#define ELEM_MAX_LEN_WMM_INFO 7 - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef UINT_16 PHY_TYPE, *P_PHY_TYPE; -typedef UINT_8 RCPI, *P_RCPI; -typedef UINT_8 ALC_VAL, *P_ALC_VAL; - -typedef enum _ENUM_HW_BSSID_T { - BSSID_0 = 0, - BSSID_1, - BSSID_NUM -} ENUM_HW_BSSID_T; - -typedef enum _ENUM_HW_MAC_ADDR_T { - MAC_ADDR_0 = 0, - MAC_ADDR_1, - MAC_ADDR_NUM -} ENUM_HW_MAC_ADDR_T; - -typedef enum _ENUM_HW_OP_MODE_T { - HW_OP_MODE_STA = 0, - HW_OP_MODE_AP, - HW_OP_MODE_ADHOC, - HW_OP_MODE_NUM -} ENUM_HW_OP_MODE_T; - -typedef enum _ENUM_TSF_T { - ENUM_LOCAL_TSF_0, - ENUM_LOCAL_TSF_1, - ENUM_LOCAL_TSF_NUM -} ENUM_LOCAL_TSF_T, *P_ENUM_LOCAL_TSF_T; - -typedef enum _HAL_TS_HW_UPDATE_MODE { - HAL_TSF_HW_UPDATE_BY_TICK_AND_RECEIVED_FRAME, - HAL_TSF_HW_UPDATE_BY_TICK_ONLY, - HAL_TSF_HW_UPDATE_BY_RECEIVED_FRAME_ONLY, - HAL_TSF_HW_UPDATE_BY_TICK_AND_RECEIVED_FRAME_AD_HOC -} HAL_TSF_HW_UPDATE_MODE; - - -typedef enum _ENUM_AC_T { - AC0 = 0, - AC1, - AC2, - AC3, - AC_NUM -} ENUM_AC_T, *P_ENUM_AC_T; - - -/* The Type of Network been activated */ -typedef enum _ENUM_NETWORK_TYPE_INDEX_T { - NETWORK_TYPE_AIS_INDEX = 0, - NETWORK_TYPE_P2P_INDEX, - NETWORK_TYPE_BOW_INDEX, - NETWORK_TYPE_INDEX_NUM -} ENUM_NETWORK_TYPE_INDEX_T; - - -/* The Type of STA Type. */ -typedef enum _ENUM_STA_TYPE_INDEX_T { - STA_TYPE_LEGACY_INDEX = 0, - STA_TYPE_P2P_INDEX, - STA_TYPE_BOW_INDEX, - STA_TYPE_INDEX_NUM -} -ENUM_STA_TYPE_INDEX_T; - -#define STA_ROLE_BASE_INDEX 4 - -typedef enum _ENUM_STA_ROLE_INDEX_T { - STA_ROLE_ADHOC_INDEX = STA_ROLE_BASE_INDEX, //4 - STA_ROLE_CLIENT_INDEX, - STA_ROLE_AP_INDEX, - STA_ROLE_DLS_INDEX -} ENUM_STA_ROLE_INDEX_T; - -/* The Power State of a specific Network */ -typedef enum _ENUM_PWR_STATE_T { - PWR_STATE_IDLE = 0, - PWR_STATE_ACTIVE, - PWR_STATE_PS, - PWR_STATE_NUM -} ENUM_PWR_STATE_T; - -typedef enum _ENUM_PHY_TYPE_INDEX_T { - //PHY_TYPE_DSSS_INDEX, /* DSSS PHY (clause 15) -- Not used anymore */ - PHY_TYPE_HR_DSSS_INDEX = 0, /* HR/DSSS PHY (clause 18) */ - PHY_TYPE_ERP_INDEX, /* ERP PHY (clause 19) */ - PHY_TYPE_ERP_P2P_INDEX, /* ERP PHY (clause 19) w/o HR/DSSS */ - PHY_TYPE_OFDM_INDEX, /* OFDM 5 GHz PHY (clause 17) */ - PHY_TYPE_HT_INDEX, /* HT PHY (clause 20) */ - PHY_TYPE_INDEX_NUM // 5 -} ENUM_PHY_TYPE_INDEX_T, *P_ENUM_PHY_TYPE_INDEX_T; - -typedef enum _ENUM_ACPI_STATE_T { - ACPI_STATE_D0 = 0, - ACPI_STATE_D1, - ACPI_STATE_D2, - ACPI_STATE_D3 -} ENUM_ACPI_STATE_T; - -/* The operation mode of a specific Network */ -typedef enum _ENUM_OP_MODE_T { - OP_MODE_INFRASTRUCTURE = 0, /* Infrastructure/GC */ - OP_MODE_IBSS, /* AdHoc */ - OP_MODE_ACCESS_POINT, /* For GO */ - OP_MODE_P2P_DEVICE, /* P2P Device */ - OP_MODE_BOW, - OP_MODE_NUM -} ENUM_OP_MODE_T, *P_ENUM_OP_MODE_T; - -typedef enum _ENUM_CHNL_EXT_T { - CHNL_EXT_SCN = 0, - CHNL_EXT_SCA = 1, - CHNL_EXT_RES = 2, - CHNL_EXT_SCB = 3 -} ENUM_CHNL_EXT_T, *P_ENUM_CHNL_EXT_T; - -/* This starting freq of the band is unit of kHz */ -typedef enum _ENUM_BAND_T { - BAND_NULL, - BAND_2G4, - BAND_5G, - BAND_NUM -} ENUM_BAND_T, *P_ENUM_BAND_T; - -/* Provide supported channel list to other components in array format */ -typedef struct _RF_CHANNEL_INFO_T { - ENUM_BAND_T eBand; - UINT_8 ucChannelNum; -} RF_CHANNEL_INFO_T, *P_RF_CHANNEL_INFO_T; - -typedef enum _ENUM_RATE_INDEX_T { - RATE_1M_INDEX = 0, /* 1M */ - RATE_2M_INDEX, /* 2M */ - RATE_5_5M_INDEX, /* 5.5M */ - RATE_11M_INDEX, /* 11M */ - RATE_22M_INDEX, /* 22M */ - RATE_33M_INDEX, /* 33M */ - RATE_6M_INDEX, /* 6M */ - RATE_9M_INDEX, /* 9M */ - RATE_12M_INDEX, /* 12M */ - RATE_18M_INDEX, /* 18M */ - RATE_24M_INDEX, /* 24M */ - RATE_36M_INDEX, /* 36M */ - RATE_48M_INDEX, /* 48M */ - RATE_54M_INDEX, /* 54M */ - RATE_HT_PHY_INDEX, /* BSS Selector - HT PHY */ - RATE_NUM // 15 -} ENUM_RATE_INDEX_T, *P_ENUM_RATE_INDEX_T; - -typedef enum _ENUM_HT_RATE_INDEX_T { - HT_RATE_MCS0_INDEX = 0, - HT_RATE_MCS1_INDEX, - HT_RATE_MCS2_INDEX, - HT_RATE_MCS3_INDEX, - HT_RATE_MCS4_INDEX, - HT_RATE_MCS5_INDEX, - HT_RATE_MCS6_INDEX, - HT_RATE_MCS7_INDEX, - HT_RATE_MCS32_INDEX, - HT_RATE_NUM // 9 -} ENUM_HT_RATE_INDEX_T, *P_ENUM_HT_RATE_INDEX_T; - -typedef enum _ENUM_PREMABLE_OPTION_T { - PREAMBLE_DEFAULT_LONG_NONE = 0, /* LONG for PHY_TYPE_HR_DSSS, NONE for PHY_TYPE_OFDM */ - PREAMBLE_OPTION_SHORT, /* SHORT mandatory for PHY_TYPE_ERP, SHORT option for PHY_TYPE_HR_DSSS */ - PREAMBLE_HT_MIXED_MODE, - PREAMBLE_HT_GREEN_FIELD, - PREAMBLE_OPTION_NUM -} ENUM_PREMABLE_OPTION_T, *P_ENUM_PREMABLE_OPTION_T; - -typedef enum _ENUM_MODULATION_SYSTEM_T { - MODULATION_SYSTEM_CCK = 0, - MODULATION_SYSTEM_OFDM, - MODULATION_SYSTEM_HT20, - MODULATION_SYSTEM_HT40, - MODULATION_SYSTEM_NUM -} ENUM_MODULATION_SYSTEM_T, *P_ENUM_MODULATION_SYSTEM_T; - -typedef enum _ENUM_MODULATION_TYPE_T { - MODULATION_TYPE_CCK_BPSK = 0, - MODULATION_TYPE_QPSK, - MODULATION_TYPE_16QAM, - MODULATION_TYPE_64QAM, - MODULATION_TYPE_NUM -} ENUM_MODULATION_TYPE_T, *P_ENUM_MODULATION_TYPE_T; - -typedef enum _ENUM_PS_FORWARDING_TYPE_T { - PS_FORWARDING_TYPE_NON_PS = 0, - PS_FORWARDING_TYPE_DELIVERY_ENABLED, - PS_FORWARDING_TYPE_NON_DELIVERY_ENABLED, - PS_FORWARDING_MORE_DATA_ENABLED, - PS_FORWARDING_TYPE_NUM -} ENUM_PS_FORWARDING_TYPE_T, *P_ENUM_PS_FORWARDING_TYPE_T; - -typedef struct _DEAUTH_INFO_T { - UINT_8 aucRxAddr[MAC_ADDR_LEN]; - OS_SYSTIME rLastSendTime; -} DEAUTH_INFO_T, *P_DEAUTH_INFO_T; - -/*----------------------------------------------------------------------------*/ -/* Information Element (IE) handlers */ -/*----------------------------------------------------------------------------*/ -typedef VOID (*PFN_APPEND_IE_FUNC)(P_ADAPTER_T, P_MSDU_INFO_T); -typedef VOID (*PFN_HANDLE_IE_FUNC)(P_ADAPTER_T, P_SW_RFB_T, P_IE_HDR_T); -typedef VOID (*PFN_VERIFY_IE_FUNC)(P_ADAPTER_T, P_SW_RFB_T, P_IE_HDR_T, PUINT_16); -typedef UINT_32 (*PFN_CALCULATE_VAR_IE_LEN_FUNC)(P_ADAPTER_T, ENUM_NETWORK_TYPE_INDEX_T, P_STA_RECORD_T); - -typedef struct _APPEND_IE_ENTRY_T { - UINT_16 u2EstimatedIELen; - PFN_APPEND_IE_FUNC pfnAppendIE; -} APPEND_IE_ENTRY_T, *P_APPEND_IE_ENTRY_T; - -typedef struct _APPEND_VAR_IE_ENTRY_T { - UINT_16 u2EstimatedFixedIELen; /* For Fixed Length */ - PFN_CALCULATE_VAR_IE_LEN_FUNC pfnCalculateVariableIELen; - PFN_APPEND_IE_FUNC pfnAppendIE; -} APPEND_VAR_IE_ENTRY_T, *P_APPEND_VAR_IE_ENTRY_T; - -typedef struct _HANDLE_IE_ENTRY_T { - UINT_8 ucElemID; - PFN_HANDLE_IE_FUNC pfnHandleIE; -} HANDLE_IE_ENTRY_T, *P_HANDLE_IE_ENTRY_T; - -typedef struct _VERIFY_IE_ENTRY_T { - UINT_8 ucElemID; - PFN_VERIFY_IE_FUNC pfnVarifyIE; -} VERIFY_IE_ENTRY_T, *P_VERIFY_IE_ENTRY_T; - -/*----------------------------------------------------------------------------*/ -/* Parameters of User Configuration */ -/*----------------------------------------------------------------------------*/ -typedef enum _ENUM_PARAM_CONNECTION_POLICY_T { - CONNECT_BY_SSID_BEST_RSSI = 0, - CONNECT_BY_SSID_GOOD_RSSI_MIN_CH_LOAD, - CONNECT_BY_SSID_ANY, /* NOTE(Kevin): Needed by WHQL */ - CONNECT_BY_BSSID, - CONNECT_BY_CUSTOMIZED_RULE /* NOTE(Kevin): TBD */ -} ENUM_PARAM_CONNECTION_POLICY_T, *P_ENUM_PARAM_CONNECTION_POLICY_T; - -typedef enum _ENUM_PARAM_PREAMBLE_TYPE_T { - PREAMBLE_TYPE_LONG = 0, - PREAMBLE_TYPE_SHORT, - PREAMBLE_TYPE_AUTO /*!< Try preamble short first, if fail tray preamble long. */ -} ENUM_PARAM_PREAMBLE_TYPE_T, *P_ENUM_PARAM_PREAMBLE_TYPE_T; - -/* This is enum defined for user to select a phy config listed in combo box */ -typedef enum _ENUM_PARAM_PHY_CONFIG_T { - PHY_CONFIG_802_11ABG = 0, /*!< Can associated with 802.11abg AP but without n capability, Scan dual band. */ - PHY_CONFIG_802_11BG, /*!< Can associated with 802_11bg AP, Scan single band and not report 5G BSSs. */ - PHY_CONFIG_802_11G, /*!< Can associated with 802_11g only AP, Scan single band and not report 5G BSSs. */ - PHY_CONFIG_802_11A, /*!< Can associated with 802_11a only AP, Scan single band and not report 2.4G BSSs. */ - PHY_CONFIG_802_11B, /*!< Can associated with 802_11b only AP, Scan single band and not report 5G BSSs. */ - PHY_CONFIG_802_11ABGN, /*!< Can associated with 802.11abgn AP, Scan dual band. */ - PHY_CONFIG_802_11BGN, /*!< Can associated with 802_11bgn AP, Scan single band and not report 5G BSSs. */ - PHY_CONFIG_802_11AN, /*!< Can associated with 802_11an AP, Scan single band and not report 2.4G BSSs. */ - PHY_CONFIG_802_11GN, /*!< Can associated with 802_11gn AP, Scan single band and not report 5G BSSs. */ - PHY_CONFIG_NUM // 9 -} ENUM_PARAM_PHY_CONFIG_T, *P_ENUM_PARAM_PHY_CONFIG_T; - -/* This is enum defined for user to select an AP Mode */ -typedef enum _ENUM_PARAM_AP_MODE_T { - AP_MODE_11B = 0, /*!< Create 11b BSS if we support 802.11abg/802.11bg. */ - AP_MODE_MIXED_11BG, /*!< Create 11bg mixed BSS if we support 802.11abg/802.11bg/802.11g. */ - AP_MODE_11G, /*!< Create 11g only BSS if we support 802.11abg/802.11bg/802.11g. */ - AP_MODE_11G_P2P, /*!< Create 11g only BSS for P2P if we support 802.11abg/802.11bg/802.11g. */ - AP_MODE_11A, /*!< Create 11a only BSS if we support 802.11abg. */ - AP_MODE_NUM // 4 -} ENUM_PARAM_AP_MODE_T, *P_ENUM_PARAM_AP_MODE_T; - - -/* Masks for determining the Network Type or the Station Role, given the ENUM_STA_TYPE_T */ -#define NETWORK_TYPE_AIS_MASK BIT(NETWORK_TYPE_AIS_INDEX) -#define NETWORK_TYPE_P2P_MASK BIT(NETWORK_TYPE_P2P_INDEX) -#define NETWORK_TYPE_BOW_MASK BIT(NETWORK_TYPE_BOW_INDEX) -#define STA_TYPE_LEGACY_MASK BIT(STA_TYPE_LEGACY_INDEX) -#define STA_TYPE_P2P_MASK BIT(STA_TYPE_P2P_INDEX) -#define STA_TYPE_BOW_MASK BIT(STA_TYPE_BOW_INDEX) -#define STA_TYPE_ADHOC_MASK BIT(STA_ROLE_ADHOC_INDEX) -#define STA_TYPE_CLIENT_MASK BIT(STA_ROLE_CLIENT_INDEX) -#define STA_TYPE_AP_MASK BIT(STA_ROLE_AP_INDEX) -#define STA_TYPE_DLS_MASK BIT(STA_ROLE_DLS_INDEX) - -/* Macros for obtaining the Network Type or the Station Role, given the ENUM_STA_TYPE_T */ -#define IS_STA_IN_AIS(_prStaRec) ((_prStaRec)->ucNetTypeIndex == NETWORK_TYPE_AIS_INDEX) -#define IS_STA_IN_P2P(_prStaRec) ((_prStaRec)->ucNetTypeIndex == NETWORK_TYPE_P2P_INDEX) -#define IS_STA_IN_BOW(_prStaRec) ((_prStaRec)->ucNetTypeIndex == NETWORK_TYPE_BOW_INDEX) -#define IS_STA_LEGACY_TYPE(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_LEGACY_MASK) -#define IS_STA_P2P_TYPE(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_P2P_MASK) -#define IS_STA_BOW_TYPE(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_BOW_MASK) -#define IS_ADHOC_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_ADHOC_MASK) -#define IS_CLIENT_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_CLIENT_MASK) -#define IS_AP_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_AP_MASK) -#define IS_DLS_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_DLS_MASK) - -/* The ENUM_STA_TYPE_T accounts for ENUM_NETWORK_TYPE_T and ENUM_STA_ROLE_INDEX_T. - * * It is a merged version of Network Type and STA Role. - * */ -typedef enum _ENUM_STA_TYPE_T { - STA_TYPE_LEGACY_AP = (STA_TYPE_LEGACY_MASK | STA_TYPE_AP_MASK), - STA_TYPE_LEGACY_CLIENT = (STA_TYPE_LEGACY_MASK | STA_TYPE_CLIENT_MASK), - STA_TYPE_ADHOC_PEER = (STA_TYPE_LEGACY_MASK | STA_TYPE_ADHOC_MASK), -#if CFG_ENABLE_WIFI_DIRECT - STA_TYPE_P2P_GO = (STA_TYPE_P2P_MASK | STA_TYPE_AP_MASK), - STA_TYPE_P2P_GC = (STA_TYPE_P2P_MASK | STA_TYPE_CLIENT_MASK), -#endif -#if CFG_ENABLE_BT_OVER_WIFI - STA_TYPE_BOW_AP = (STA_TYPE_BOW_MASK | STA_TYPE_AP_MASK), - STA_TYPE_BOW_CLIENT = (STA_TYPE_BOW_MASK | STA_TYPE_CLIENT_MASK), -#endif - STA_TYPE_DLS_PEER = (STA_TYPE_LEGACY_MASK | STA_TYPE_DLS_MASK) -} ENUM_STA_TYPE_T, *P_ENUM_STA_TYPE_T; - -/* The type of BSS we discovered */ -typedef enum _ENUM_BSS_TYPE_T { - BSS_TYPE_INFRASTRUCTURE = 1, - BSS_TYPE_IBSS, - BSS_TYPE_P2P_DEVICE, - BSS_TYPE_BOW_DEVICE, - BSS_TYPE_NUM -} ENUM_BSS_TYPE_T, *P_ENUM_BSS_TYPE_T; - -/*----------------------------------------------------------------------------*/ -/* RSN structures */ -/*----------------------------------------------------------------------------*/ -//#if defined(WINDOWS_DDK) || defined(WINDOWS_CE) -//#pragma pack(1) -//#endif - -#define MAX_NUM_SUPPORTED_CIPHER_SUITES 8 /* max number of supported cipher suites */ -#if CFG_SUPPORT_802_11W -#define MAX_NUM_SUPPORTED_AKM_SUITES 8 /* max number of supported AKM suites */ -#else -#define MAX_NUM_SUPPORTED_AKM_SUITES 6 /* max number of supported AKM suites */ -#endif - -/* Structure of RSN Information */ -typedef struct _RSN_INFO_T { - UINT_8 ucElemId; - UINT_16 u2Version; - UINT_32 u4GroupKeyCipherSuite; - UINT_32 u4PairwiseKeyCipherSuiteCount; - UINT_32 au4PairwiseKeyCipherSuite[MAX_NUM_SUPPORTED_CIPHER_SUITES]; - UINT_32 u4AuthKeyMgtSuiteCount; - UINT_32 au4AuthKeyMgtSuite[MAX_NUM_SUPPORTED_AKM_SUITES]; - UINT_16 u2RsnCap; - BOOLEAN fgRsnCapPresent; -} /*__KAL_ATTRIB_PACKED__*/ RSN_INFO_T, *P_RSN_INFO_T; - -#define MAX_NUM_SUPPORTED_WAPI_AKM_SUITES 1 /* max number of supported AKM suites */ -#define MAX_NUM_SUPPORTED_WAPI_CIPHER_SUITES 1 /* max number of supported cipher suites */ - -/* Structure of WAPI Information */ -typedef struct _WAPI_INFO_T { - UINT_8 ucElemId; - UCHAR ucLength; - UINT_16 u2Version; - UINT_32 u4AuthKeyMgtSuiteCount; - UINT_32 au4AuthKeyMgtSuite[MAX_NUM_SUPPORTED_WAPI_AKM_SUITES]; - UINT_32 u4PairwiseKeyCipherSuiteCount; - UINT_32 au4PairwiseKeyCipherSuite[MAX_NUM_SUPPORTED_WAPI_CIPHER_SUITES]; - UINT_32 u4GroupKeyCipherSuite; - UINT_16 u2WapiCap; - UINT_16 u2Bkid; - UINT_8 aucBkid[1][16]; -} /* __KAL_ATTRIB_PACKED__*/ WAPI_INFO_T, *P_WAPI_INFO_T; - -//#if defined(WINDOWS_DDK) || defined(WINDOWS_CE) -//#pragma pack() -//#endif - - -#if CFG_ENABLE_WIFI_DIRECT - -typedef struct _P2P_DEVICE_TYPE_T { - UINT_16 u2CategoryID; - UINT_16 u2SubCategoryID; -} P2P_DEVICE_TYPE_T, *P_P2P_DEVICE_TYPE_T; - -typedef struct _P2P_DEVICE_DESC_T { - LINK_ENTRY_T rLinkEntry; - BOOLEAN fgDevInfoValid; - UINT_8 aucDeviceAddr[MAC_ADDR_LEN]; /* Device Address. */ - UINT_8 aucInterfaceAddr[MAC_ADDR_LEN]; /* Interface Address. */ - UINT_8 ucDeviceCapabilityBitmap; - UINT_8 ucGroupCapabilityBitmap; - UINT_16 u2ConfigMethod; /* Configure Method support. */ - P2P_DEVICE_TYPE_T rPriDevType; - UINT_8 ucSecDevTypeNum; - P2P_DEVICE_TYPE_T arSecDevType[8]; // Reference to P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT - UINT_16 u2NameLength; - UINT_8 aucName[32]; // Reference to WPS_ATTRI_MAX_LEN_DEVICE_NAME - // TODO: Service Information or PasswordID valid? -} P2P_DEVICE_DESC_T, *P_P2P_DEVICE_DESC_T; - -#endif - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ -static const UINT_8 aucRateIndex2RateCode[PREAMBLE_OPTION_NUM][RATE_NUM] = { - { /* Long Preamble */ - RATE_CCK_1M_LONG, /* RATE_1M_INDEX = 0 */ - RATE_CCK_2M_LONG, /* RATE_2M_INDEX */ - RATE_CCK_5_5M_LONG, /* RATE_5_5M_INDEX */ - RATE_CCK_11M_LONG, /* RATE_11M_INDEX */ - RATE_CCK_1M_LONG, /* RATE_22M_INDEX - Not supported */ - RATE_CCK_1M_LONG, /* RATE_33M_INDEX - Not supported */ - RATE_OFDM_6M, /* RATE_6M_INDEX */ - RATE_OFDM_9M, /* RATE_9M_INDEX */ - RATE_OFDM_12M, /* RATE_12M_INDEX */ - RATE_OFDM_18M, /* RATE_18M_INDEX */ - RATE_OFDM_24M, /* RATE_24M_INDEX */ - RATE_OFDM_36M, /* RATE_36M_INDEX */ - RATE_OFDM_48M, /* RATE_48M_INDEX */ - RATE_OFDM_54M, /* RATE_54M_INDEX */ - }, - { /* Short Preamble */ - RATE_CCK_1M_LONG, /* RATE_1M_INDEX = 0 */ - RATE_CCK_2M_SHORT, /* RATE_2M_INDEX */ - RATE_CCK_5_5M_SHORT, /* RATE_5_5M_INDEX */ - RATE_CCK_11M_SHORT, /* RATE_11M_INDEX */ - RATE_CCK_1M_LONG, /* RATE_22M_INDEX - Not supported */ - RATE_CCK_1M_LONG, /* RATE_33M_INDEX - Not supported */ - RATE_OFDM_6M, /* RATE_6M_INDEX */ - RATE_OFDM_9M, /* RATE_9M_INDEX */ - RATE_OFDM_12M, /* RATE_12M_INDEX */ - RATE_OFDM_18M, /* RATE_18M_INDEX */ - RATE_OFDM_24M, /* RATE_24M_INDEX */ - RATE_OFDM_36M, /* RATE_36M_INDEX */ - RATE_OFDM_48M, /* RATE_48M_INDEX */ - RATE_OFDM_54M, /* RATE_54M_INDEX */ - }, - { /* Mixed Mode(Option) */ - RATE_MM_MCS_0, /* RATE_MCS0_INDEX, */ - RATE_MM_MCS_1, /* RATE_MCS1_INDEX, */ - RATE_MM_MCS_2, /* RATE_MCS2_INDEX, */ - RATE_MM_MCS_3, /* RATE_MCS3_INDEX, */ - RATE_MM_MCS_4, /* RATE_MCS4_INDEX, */ - RATE_MM_MCS_5, /* RATE_MCS5_INDEX, */ - RATE_MM_MCS_6, /* RATE_MCS6_INDEX, */ - RATE_MM_MCS_7, /* RATE_MCS7_INDEX, */ - RATE_MM_MCS_32 /* RATE_MCS32_INDEX, */ - }, - { /* Green Field(Option) */ - RATE_GF_MCS_0, /* RATE_MCS0_INDEX, */ - RATE_GF_MCS_1, /* RATE_MCS1_INDEX, */ - RATE_GF_MCS_2, /* RATE_MCS2_INDEX, */ - RATE_GF_MCS_3, /* RATE_MCS3_INDEX, */ - RATE_GF_MCS_4, /* RATE_MCS4_INDEX, */ - RATE_GF_MCS_5, /* RATE_MCS5_INDEX, */ - RATE_GF_MCS_6, /* RATE_MCS6_INDEX, */ - RATE_GF_MCS_7, /* RATE_MCS7_INDEX, */ - RATE_GF_MCS_32 /* RATE_MCS32_INDEX, */ - } -}; - -static const UINT_8 aucRateTableSize[PREAMBLE_OPTION_NUM] = { - RATE_HT_PHY_INDEX, - RATE_HT_PHY_INDEX, - HT_RATE_NUM, - HT_RATE_NUM -}; - - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -/* Macros to get and set the wireless LAN frame fields those are 16/32 bits in - length. */ -#define WLAN_GET_FIELD_16(_memAddr_p, _value_p) \ - { \ - PUINT_8 __cp = (PUINT_8) (_memAddr_p); \ - *(PUINT_16)(_value_p) = ((UINT_16) __cp[0]) | ((UINT_16) __cp[1] << 8); \ - } - -#define WLAN_GET_FIELD_BE16(_memAddr_p, _value_p) \ - { \ - PUINT_8 __cp = (PUINT_8) (_memAddr_p); \ - *(PUINT_16)(_value_p) = ((UINT_16) __cp[0] << 8) | ((UINT_16) __cp[1]); \ - } - -#define WLAN_GET_FIELD_32(_memAddr_p, _value_p) \ - { \ - PUINT_8 __cp = (PUINT_8) (_memAddr_p); \ - *(PUINT_32)(_value_p) = ((UINT_32) __cp[0]) | ((UINT_32) __cp[1] << 8) | \ - ((UINT_32) __cp[2] << 16) | ((UINT_32) __cp[3] << 24); \ - } - -#define WLAN_GET_FIELD_64(_memAddr_p, _value_p) \ - { \ - PUINT_8 __cp = (PUINT_8) (_memAddr_p); \ - *(PUINT_64)(_value_p) = \ - ((UINT_64) __cp[0]) | ((UINT_64) __cp[1] << 8) | \ - ((UINT_64) __cp[2] << 16) | ((UINT_64) __cp[3] << 24) | \ - ((UINT_64) __cp[4] << 32) | ((UINT_64) __cp[5] << 40) | \ - ((UINT_64) __cp[6] << 48) | ((UINT_64) __cp[7] << 56); \ - } - -#define WLAN_SET_FIELD_16(_memAddr_p, _value) \ - { \ - PUINT_8 __cp = (PUINT_8) (_memAddr_p); \ - __cp[0] = (UINT_8) (_value); \ - __cp[1] = (UINT_8) ((_value) >> 8); \ - } - -#define WLAN_SET_FIELD_BE16(_memAddr_p, _value) \ - { \ - PUINT_8 __cp = (PUINT_8) (_memAddr_p); \ - __cp[0] = (UINT_8) ((_value) >> 8); \ - __cp[1] = (UINT_8) (_value); \ - } - -#define WLAN_SET_FIELD_32(_memAddr_p, _value) \ - { \ - PUINT_8 __cp = (PUINT_8) (_memAddr_p); \ - __cp[0] = (UINT_8) (_value); \ - __cp[1] = (UINT_8) ((_value) >> 8); \ - __cp[2] = (UINT_8) ((_value) >> 16); \ - __cp[3] = (UINT_8) ((_value) >> 24); \ - } - - - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _WLAN_DEF_H */ - diff --git a/drivers/net/wireless/mt5931/include/nic_cmd_event.h b/drivers/net/wireless/mt5931/include/nic_cmd_event.h deleted file mode 100755 index 3c482911d4b4..000000000000 --- a/drivers/net/wireless/mt5931/include/nic_cmd_event.h +++ /dev/null @@ -1,1888 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic_cmd_event.h#1 $ -*/ - -/*! \file "nic_cmd_event.h" - \brief This file contains the declairation file of the WLAN OID processing routines - of Windows driver for MediaTek Inc. 802.11 Wireless LAN Adapters. -*/ - - - -/* -** $Log: nic_cmd_event.h $ - * - * 03 29 2012 eason.tsai - * [WCXRP00001216] [MT6628 Wi-Fi][Driver]add conditional define - * add conditional define. - * - * 03 04 2012 eason.tsai - * NULL - * modify the cal fail report code. - * - * 01 06 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * redefine the CMD_ID_SET_TXPWR_CTRL value. - * - * 01 05 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * Adding the related ioctl / wlan oid function to set the Tx power cfg. - * - * 11 30 2011 cm.chang - * [WCXRP00001128] [MT5931 Wi-Fi][FW] Update BB/RF setting based on RF doc v0.7 for LGE spec - * 1. Add a new CMD for driver to set device mode - * 2. Update calibration parameters - * - * 11 19 2011 yuche.tsai - * NULL - * Update RSSI for P2P. - * - * 11 18 2011 yuche.tsai - * NULL - * CONFIG P2P support RSSI query, default turned off. - * - * 11 10 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Add TX_DONE status detail information. - * - * 11 08 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * check if CFG_SUPPORT_SWCR is defined to aoid compiler error. - * - * 11 07 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * add debug counters and periodically dump counters for debugging. - * - * 10 26 2011 cp.wu - * [WCXRP00001065] [MT6620 Wi-Fi][MT5931][FW][DRV] Adding parameter for controlling minimum channel dwell time for scanning - * add interface for control minimum channel dwell time for scanning. - * - * 09 20 2011 cm.chang - * [WCXRP00000997] [MT6620 Wi-Fi][Driver][FW] Handle change of BSS preamble type and slot time - * New CMD definition about RLM parameters - * - * 08 31 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * . - * - * 08 25 2011 chinghwa.yu - * [WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add DFS switch. - * - * 08 24 2011 chinghwa.yu - * [WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Update RDD test mode cases. - * - * 08 15 2011 cp.wu - * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree - * add MT6628-specific definitions. - * - * 08 11 2011 cp.wu - * [WCXRP00000830] [MT6620 Wi-Fi][Firmware] Use MDRDY counter to detect empty channel for shortening scan time - * sparse channel detection: - * driver: collect sparse channel information with scan-done event - * - * 08 09 2011 cp.wu - * [WCXRP00000702] [MT5931][Driver] Modify initialization sequence for E1 ASIC[WCXRP00000913] [MT6620 Wi-Fi] create repository of source code dedicated for MT6620 E6 ASIC - * add CCK-DSSS TX-PWR control field in NVRAM and CMD definition for MT5931-MP - * - * 08 03 2011 terry.wu - * [WCXRP00000899] [MT6620] [FW] Reply probe rsp in FW for hotspot mode - * Reply Probe Rsp in FW for Hotspot Mode. - * - * - * - * 08 03 2011 terry.wu - * [WCXRP00000899] [MT6620] [FW] Reply probe rsp in FW for hotspot mode - * Reply Probe Rsp in FW for Hotspot Mode. - * - * - * 08 03 2011 terry.wu - * [WCXRP00000899] [MT6620] [FW] Reply probe rsp in FW for hotspot mode - * Reply Probe Rsp in FW for Hotspot Mode. - * - * 08 03 2011 terry.wu - * [WCXRP00000899] [MT6620] [FW] Reply probe rsp in FW for hotspot mode - * Reply Probe Rsp in FW for Hotspot Mode. - * - * 07 28 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings - * Add BWCS cmd and event. - * - * 07 22 2011 jeffrey.chang - * [WCXRP00000864] [MT5931] Add command to adjust OSC stable time - * add osc stable time command structure - * - * 07 22 2011 jeffrey.chang - * [WCXRP00000864] [MT5931] Add command to adjust OSC stable time - * modify driver to set OSC stable time after f/w download - * - * 07 18 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add CMD/Event for RDD and BWCS. - * - * 07 18 2011 cp.wu - * [WCXRP00000858] [MT5931][Driver][Firmware] Add support for scan to search for more than one SSID in a single scanning request - * add framework in driver domain for supporting new SCAN_REQ_V2 for more than 1 SSID support as well as uProbeDelay in NDIS 6.x driver model - * - * 06 23 2011 cp.wu - * [WCXRP00000812] [MT6620 Wi-Fi][Driver] not show NVRAM when there is no valid MAC address in NVRAM content - * check with firmware for valid MAC address. - * - * 06 23 2011 cp.wu - * [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module - * change parameter name from PeerAddr to BSSID - * - * 06 20 2011 cp.wu - * [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module - * 1. specify target's BSSID when requesting channel privilege. - * 2. pass BSSID information to firmware domain - * - * 06 09 2011 tsaiyuan.hsu - * [WCXRP00000760] [MT5931 Wi-Fi][FW] Refine rxmHandleMacRxDone to reduce code size - * move send_auth at rxmHandleMacRxDone in firmware to driver to reduce code size. - * - * 05 27 2011 cp.wu - * [WCXRP00000749] [MT6620 Wi-Fi][Driver] Add band edge tx power control to Wi-Fi NVRAM - * invoke CMD_ID_SET_EDGE_TXPWR_LIMIT when there is valid data exist in NVRAM content. - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 03 31 2011 chinglan.wang - * [WCXRP00000613] [MT6620 Wi-Fi] [FW] [Driver] BssInfo can get the security mode which is WPA/WPA2/WAPI or not. - * . - * - * 03 18 2011 cm.chang - * [WCXRP00000576] [MT6620 Wi-Fi][Driver][FW] Remove P2P compile option in scan req/cancel command - * As CR title - * - * 03 17 2011 yarco.yang - * [WCXRP00000569] [MT6620 Wi-Fi][F/W][Driver] Set multicast address support current network usage - * . - * - * 03 07 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * rename the define to anti_pviracy. - * - * 03 05 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * add the code to get the check rsponse and indicate to app. - * - * 03 02 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * Add Security check related code. - * - * 03 02 2011 george.huang - * [WCXRP00000504] [MT6620 Wi-Fi][FW] Support Sigma CAPI for power saving related command - * Support UAPSD/OppPS/NoA parameter setting - * - * 02 16 2011 cm.chang - * [WCXRP00000447] [MT6620 Wi-Fi][FW] Support new NVRAM update mechanism - * . - * - * 02 10 2011 cp.wu - * [WCXRP00000434] [MT6620 Wi-Fi][Driver] Obsolete unused event packet handlers - * EVENT_ID_CONNECTION_STATUS has been obsoleted and no need to handle. - * - * 02 08 2011 eddie.chen - * [WCXRP00000426] [MT6620 Wi-Fi][FW/Driver] Add STA aging timeout and defualtHwRatein AP mode - * Add event STA agint timeout - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * - * 01 25 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * Update cmd format of BSS INFO, always sync OwnMac to FW no matter P2P is enabled or not.. - * - * 01 20 2011 eddie.chen - * [WCXRP00000374] [MT6620 Wi-Fi][DRV] SW debug control - * Add Oid for sw control debug command - * - * 01 15 2011 puff.wen - * NULL - * Add Stress test - * - * 01 12 2011 cm.chang - * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting - * Sync HT operation element information from host to FW - * - * 01 12 2011 cm.chang - * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting - * User-defined bandwidth is for 2.4G and 5G individually - * - * 12 29 2010 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, - -Add per station flow control when STA is in PS - - - * 1) PS flow control event - * - * 2) WMM IE in beacon, assoc resp, probe resp - * - * 12 28 2010 cp.wu - * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release - * report EEPROM used flag via NIC_CAPABILITY - * - * 12 28 2010 cp.wu - * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release - * integrate with 'EEPROM used' flag for reporting correct capability to Engineer Mode/META and other tools - * - * 12 23 2010 george.huang - * [WCXRP00000152] [MT6620 Wi-Fi] AP mode power saving function - * 1. update WMM IE parsing, with ASSOC REQ handling - * 2. extend U-APSD parameter passing from driver to FW - * - * 12 07 2010 cm.chang - * [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk - * 1. BSSINFO include RLM parameter - * 2. free all sta records when network is disconnected - * - * 12 07 2010 cm.chang - * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant - * 1. Country code is from NVRAM or supplicant - * 2. Change band definition in CMD/EVENT. - * - * 11 29 2010 cm.chang - * [WCXRP00000210] [MT6620 Wi-Fi][Driver][FW] Set RCPI value in STA_REC for initial TX rate selection of auto-rate algorithm - * Sync RCPI of STA_REC to FW as reference of initial TX rate - * - * 11 08 2010 cm.chang - * [WCXRP00000169] [MT6620 Wi-Fi][Driver][FW] Remove unused CNM recover message ID - * Remove CNM channel reover message ID - * - * 11 01 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module - * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead - * 2) Remove CNM CH-RECOVER event handling - * 3) cfg read/write API renamed with kal prefix for unified naming rules. - * - * 10 26 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command - * 1) update NVRAM content template to ver 1.02 - * 2) add compile option for querying NIC capability (default: off) - * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting - * 4) correct auto-rate compiler error under linux (treat warning as error) - * 5) simplify usage of NVRAM and REG_INFO_T - * 6) add version checking between driver and firmware - * - * 10 25 2010 cp.wu - * [WCXRP00000133] [MT6620 Wi-Fi] [FW][Driver] Change TX power offset band definition - * follow-up for CMD_5G_PWR_OFFSET_T definition change - * - * 10 20 2010 cp.wu - * [WCXRP00000117] [MT6620 Wi-Fi][Driver] Add logic for suspending driver when MT6620 is not responding anymore - * use OID_CUSTOM_TEST_MODE as indication for driver reset - * by dropping pending TX packets - * - * 10 20 2010 wh.su - * [WCXRP00000124] [MT6620 Wi-Fi] [Driver] Support the dissolve P2P Group - * Add the code to support disconnect p2p group - * - * 09 15 2010 cm.chang - * NULL - * Add new CMD for TX power, 5G power offset and power parameters - * - * 09 07 2010 yuche.tsai - * NULL - * Add a pointer in P2P SCAN RESULT structure. This pointer - * is pointed to a IE buffer for this P2p device. - * - * 09 07 2010 wh.su - * NULL - * adding the code for beacon/probe req/ probe rsp wsc ie at p2p. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 23 2010 chinghwa.yu - * NULL - * Update for BOW. - * - * 08 20 2010 cm.chang - * NULL - * Migrate RLM code to host from FW - * - * 08 16 2010 george.huang - * NULL - * add new CMD ID definition - * - * 08 16 2010 yuche.tsai - * NULL - * Add a field in BSS INFO cmd to change interface address for P2P. (switching between Device Addr & Interface Addr) - * - * 08 12 2010 yuche.tsai - * NULL - * Add interface address indication when indicate connection status. - * It is requested by supplicant to do 4 way handshake. - * - * 08 07 2010 wh.su - * NULL - * adding the privacy related code for P2P network - * - * 08 05 2010 yuche.tsai - * NULL - * Change data structure for P2P Device scan result, all channel time for scan command. - * - * 08 04 2010 george.huang - * NULL - * handle change PS mode OID/ CMD - * - * 08 04 2010 yarco.yang - * NULL - * Add TX_AMPDU and ADDBA_REJECT command - * - * 08 03 2010 george.huang - * NULL - * handle event for updating NOA parameters indicated from FW - * - * 08 02 2010 george.huang - * NULL - * add WMM-PS test related OID/ CMD handlers - * - * 07 28 2010 cp.wu - * NULL - * sync. CMD_BSS_INFO structure change to CMD-EVENT v0.15. - * - * 07 26 2010 yuche.tsai - * - * Add P2P Device Found Event. - * Channel extention option in scan abort command. - * - * 07 23 2010 cp.wu - * - * add AIS-FSM handling for beacon timeout event. - * - * 07 21 2010 yuche.tsai - * - * Add for P2P Scan Result Parsing & Saving. - * - * 07 20 2010 george.huang - * - * DWORD align for the CMD data structure - * - * 07 20 2010 cp.wu - * - * pass band information for scan in an efficient way by mapping ENUM_BAND_T into UINT_8.. - * - * 07 19 2010 wh.su - * - * update for security supporting. - * - * 07 19 2010 cm.chang - * - * Set RLM parameters and enable CNM channel manager - * - * 07 16 2010 yarco.yang - * - * 1. Support BSS Absence/Presence Event - * 2. Support STA change PS mode Event - * 3. Support BMC forwarding for AP mode. - * - * 07 14 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * pass band with channel number information as scan parameter - * - * 07 14 2010 yarco.yang - * - * 1. Remove CFG_MQM_MIGRATION - * 2. Add CMD_UPDATE_WMM_PARMS command - * - * 07 09 2010 cp.wu - * - * reorder members of CMD_SET_BSS_INFO. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * update prStaRecOfAP with BSS-INFO. - * - * 07 07 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Support state of STA record change from 1 to 1 - * - * 07 01 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Support sync command of STA_REC - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * implementation of DRV-SCN and related mailbox message handling. - * - * 06 30 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * sync. with CMD/EVENT document ver0.07. - * - * 06 29 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * correct variable naming for 8-bit variable used in CMD_BEACON_TEMPLATE_UPDATE. - * - * 06 29 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) sync to. CMD/EVENT document v0.03 - * 2) simplify DTIM period parsing in scan.c only, bss.c no longer parses it again. - * 3) send command packet to indicate FW-PM after - * a) 1st beacon is received after AIS has connected to an AP - * b) IBSS-ALONE has been created - * c) IBSS-MERGE has occured - * - * 06 28 2010 george.huang - * [WPD00001556]Basic power managemenet function - * Create beacon update path, with expose bssUpdateBeaconContent() - * - * 06 22 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) add command warpper for STA-REC/BSS-INFO sync. - * 2) enhance command packet sending procedure for non-oid part - * 3) add command packet definitions for STA-REC/BSS-INFO sync. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add BSS/STA_REC commands for integration. - * - * 06 21 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Add TX Done Event handle entry - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) eliminate CFG_CMD_EVENT_VERSION_0_9 - * 2) when disconnected, indicate nic directly (no event is needed) - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 20 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) integrate OID_GEN_NETWORK_LAYER_ADDRESSES with CMD_ID_SET_IP_ADDRESS - * 2) buffer statistics data for 2 seconds - * 3) use default value for adhoc parameters instead of 0 - * - * 05 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) do not take timeout mechanism for power mode oids - * 2) retrieve network type from connection status - * 3) after disassciation, set radio state to off - * 4) TCP option over IPv6 is supported - * - * 05 17 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct OID_802_11_DISASSOCIATE handling. - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * 1) add timeout handler mechanism for pending command packets - * 2) add p2p add/removal key - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * * * * * * * * 2) command sequence number is now increased atomically - * * * * * * * * * * 3) private data could be hold and taken use for other purpose - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * sync statistics data structure definition with firmware implementation - * - * 03 30 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * statistics information OIDs are now handled by querying from firmware domain - * - * 03 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * indicate media stream mode after set is done - * - * 03 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add a temporary flag for integration with CMD/EVENT v0.9. - * - * 03 25 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) correct OID_802_11_CONFIGURATION with frequency setting behavior. - * * the frequency is used for adhoc connection only - * * 2) update with SD1 v0.9 CMD/EVENT documentation - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port - * - * 03 22 2010 cp.wu - * [WPD00003824][MT6620 Wi-Fi][New Feature] Add support of large scan list - * Implement feature needed by CR: WPD00003824: refining association command by pasting scanning result - * - * 03 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) add ACPI D0/D3 state switching support - * * * * * * 2) use more formal way to handle interrupt when the status is retrieved from enhanced RX response - * - * 03 15 2010 kevin.huang - * [WPD00003820][MT6620 Wi-Fi] Modify the code for meet the WHQL test - * Add event for activate STA_RECORD_T - * - * 03 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement custom OID: EEPROM read/write access - * - * 03 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement OID_802_3_MULTICAST_LIST oid handling - * - * 02 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * move EVENT_ID_ASSOC_INFO from nic_rx.c to gl_kal_ndis_51.c - * 'cause it involves OS dependent data structure handling - * - * 02 25 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * send CMD_ID_INFRASTRUCTURE when handling OID_802_11_INFRASTRUCTURE_MODE set. - * - * 02 09 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. Permanent and current MAC address are now retrieved by CMD/EVENT packets instead of hard-coded address - * * * * * 2. follow MSDN defined behavior when associates to another AP - * * * * * 3. for firmware download, packet size could be up to 2048 bytes - * - * 01 27 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * . - * - * 01 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. eliminate improper variable in rHifInfo - * * * * * * 2. block TX/ordinary OID when RF test mode is engaged - * * * * * * 3. wait until firmware finish operation when entering into and leaving from RF test mode - * * * * * * 4. correct some HAL implementation - * - * 01 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement following 802.11 OIDs: - * * * OID_802_11_RSSI, - * * * OID_802_11_RSSI_TRIGGER, - * * * OID_802_11_STATISTICS, - * * * OID_802_11_DISASSOCIATE, - * * * OID_802_11_POWER_MODE - * - * 01 21 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement OID_802_11_MEDIA_STREAM_MODE - * - * 01 21 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement OID_802_11_SUPPORTED_RATES / OID_802_11_DESIRED_RATES - * - * 12 30 2009 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) According to CMD/EVENT documentation v0.8, - * * * * * * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used, - * * * * * * and result is retrieved by get ATInfo instead - * * * * * * 2) add 4 counter for recording aggregation statistics -** \main\maintrunk.MT6620WiFiDriver_Prj\20 2009-12-11 18:35:07 GMT mtk02752 -** add CMD added in CMD/EVEN document v0.8 -** \main\maintrunk.MT6620WiFiDriver_Prj\19 2009-12-10 16:39:37 GMT mtk02752 -** eliminate unused definitions -** \main\maintrunk.MT6620WiFiDriver_Prj\18 2009-12-10 09:55:11 GMT mtk02752 -** command ID/event ID revised -** \main\maintrunk.MT6620WiFiDriver_Prj\17 2009-12-09 13:57:37 GMT MTK02468 -** Added event ids (EVENT_ID_RX_ADDBA and EVENT_ID_RX_DELBA) -** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-12-08 17:35:39 GMT mtk02752 -** + add event ID for EVENT_ID_TEST_STATUS (rf test) -** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-12-07 23:01:09 GMT mtk02752 -** add data structure for RF_TEST -** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-12-03 16:22:56 GMT mtk01461 -** Modify the element - i4RSSI in EVENT of SCAN RESULT -** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-11-30 10:54:44 GMT mtk02752 -** 1st DW of WIFI_CMD_T is shared with HIF_TX_HEADER_T, while 1st DW of WIFI_EVENT_T is shared with HIF_RX_HEADER_T -** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-11-26 10:16:58 GMT mtk02752 -** resync EVENT_CONNECTION_STATUS -** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-11-25 21:34:01 GMT mtk02752 -** sync. EVENT_SCAN_RESULT_T with firmware -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-11-25 21:03:48 GMT mtk02752 -** refine MGMT_FRAME -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-11-25 18:17:47 GMT mtk02752 -** refine GL_WLAN_INFO_T for buffering scan result and presume max. ie length = 600 bytes -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-11-24 22:41:20 GMT mtk02752 -** add EVENT_SCAN_RESULT_T definition -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-11-23 20:29:16 GMT mtk02752 -** fix typo -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-11-23 14:46:01 GMT mtk02752 -** add new command/event structure upon CM@SD1's documentation -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-11-13 15:13:40 GMT mtk02752 -** add command definition for CMD_BUILD_CONNECTION and EVENT_CONNECTION_STATUS -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-05-20 12:22:22 GMT mtk01461 -** Add SeqNum field to Event Header -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-04-29 15:42:11 GMT mtk01461 -** Update structure of HIF_EVENT_HEADER_T and EVENT_HDR_SIZE -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-04-21 12:10:36 GMT mtk01461 -** Add Common Set CMD Callback for MCR Write and other Set OID -** \main\maintrunk.MT6620WiFiDriver_Prj\1 2009-04-21 01:40:17 GMT mtk01461 -** Command Done Handler -*/ -#ifndef _NIC_CMD_EVENT_H -#define _NIC_CMD_EVENT_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define CMD_STATUS_SUCCESS 0 -#define CMD_STATUS_REJECTED 1 -#define CMD_STATUS_UNKNOWN 2 - -#define EVENT_HDR_SIZE OFFSET_OF(WIFI_EVENT_T, aucBuffer[0]) - -#define MAX_IE_LENGTH (600) -#define MAX_WSC_IE_LENGTH (400) - -/* Action field in structure CMD_CH_PRIVILEGE_T */ -#define CMD_CH_ACTION_REQ 0 -#define CMD_CH_ACTION_ABORT 1 - -/* Status field in structure EVENT_CH_PRIVILEGE_T */ -#define EVENT_CH_STATUS_GRANT 0 - - -typedef enum _ENUM_CMD_ID_T { - CMD_ID_TEST_MODE = 1, /* 0x01 (Set) */ - CMD_ID_RESET_REQUEST, /* 0x02 (Set) */ - CMD_ID_BUILD_CONNECTION, /* 0x03 (Set) */ - CMD_ID_SCAN_REQ_V2, /* 0x04 (Set) */ - CMD_ID_NIC_POWER_CTRL, /* 0x05 (Set) */ - CMD_ID_POWER_SAVE_MODE, /* 0x06 (Set) */ - CMD_ID_LINK_ATTRIB, /* 0x07 (Set) */ - CMD_ID_ADD_REMOVE_KEY, /* 0x08 (Set) */ - CMD_ID_DEFAULT_KEY_ID, /* 0x09 (Set) */ - CMD_ID_INFRASTRUCTURE, /* 0x0a (Set) */ - CMD_ID_SET_RX_FILTER, /* 0x0b (Set) */ - CMD_ID_DOWNLOAD_BUF, /* 0x0c (Set) */ - CMD_ID_WIFI_START, /* 0x0d (Set) */ - CMD_ID_CMD_BT_OVER_WIFI, /* 0x0e (Set) */ - CMD_ID_SET_MEDIA_CHANGE_DELAY_TIME, /* 0x0f (Set) */ - CMD_ID_SEND_ADDBA_RSP, /* 0x10 (Set) */ - CMD_ID_WAPI_MODE, /* 0x11 (Set) (obsolete) */ - CMD_ID_WAPI_ASSOC_INFO, /* 0x12 (Set) (obsolete) */ - CMD_ID_SET_DOMAIN_INFO, /* 0x13 (Set) */ - CMD_ID_SET_IP_ADDRESS, /* 0x14 (Set) */ - CMD_ID_BSS_ACTIVATE_CTRL, /* 0x15 (Set) */ - CMD_ID_SET_BSS_INFO, /* 0x16 (Set) */ - CMD_ID_UPDATE_STA_RECORD, /* 0x17 (Set) */ - CMD_ID_REMOVE_STA_RECORD, /* 0x18 (Set) */ - CMD_ID_INDICATE_PM_BSS_CREATED, /* 0x19 (Set) */ - CMD_ID_INDICATE_PM_BSS_CONNECTED, /* 0x1a (Set) */ - CMD_ID_INDICATE_PM_BSS_ABORT, /* 0x1b (Set) */ - CMD_ID_UPDATE_BEACON_CONTENT, /* 0x1c (Set) */ - CMD_ID_SET_BSS_RLM_PARAM, /* 0x1d (Set) */ - CMD_ID_SCAN_REQ, /* 0x1e (Set) */ - CMD_ID_SCAN_CANCEL, /* 0x1f (Set) */ - CMD_ID_CH_PRIVILEGE, /* 0x20 (Set) */ - CMD_ID_UPDATE_WMM_PARMS, /* 0x21 (Set) */ - CMD_ID_SET_WMM_PS_TEST_PARMS, /* 0x22 (Set) */ - CMD_ID_TX_AMPDU, /* 0x23 (Set) */ - CMD_ID_ADDBA_REJECT, /* 0x24 (Set) */ - CMD_ID_SET_PS_PROFILE_ADV, /* 0x25 (Set) */ - CMD_ID_SET_RAW_PATTERN, /* 0x26 (Set) */ - CMD_ID_CONFIG_PATTERN_FUNC, /* 0x27 (Set) */ - CMD_ID_SET_TX_PWR, /* 0x28 (Set) */ - CMD_ID_SET_5G_PWR_OFFSET, /* 0x29 (Set) */ - CMD_ID_SET_PWR_PARAM, /* 0x2A (Set) */ - CMD_ID_P2P_ABORT, /* 0x2B (Set) */ -#if CFG_STRESS_TEST_SUPPORT - CMD_ID_RANDOM_RX_RESET_EN = 0x2C, /* 0x2C (Set ) */ - CMD_ID_RANDOM_RX_RESET_DE = 0x2D, /* 0x2D (Set ) */ - CMD_ID_SAPP_EN = 0x2E, /* 0x2E (Set ) */ - CMD_ID_SAPP_DE = 0x2F, /* 0x2F (Set ) */ -#endif - CMD_ID_ROAMING_TRANSIT = 0x30, /* 0x30 (Set) */ - CMD_ID_SET_PHY_PARAM, /* 0x31 (Set) */ - CMD_ID_SET_NOA_PARAM, /* 0x32 (Set) */ - CMD_ID_SET_OPPPS_PARAM, /* 0x33 (Set) */ - CMD_ID_SET_UAPSD_PARAM, /* 0x34 (Set) */ - CMD_ID_SET_SIGMA_STA_SLEEP, /* 0x35 (Set) */ - CMD_ID_SET_EDGE_TXPWR_LIMIT, /* 0x36 (Set) */ - CMD_ID_SET_DEVICE_MODE, /* 0x37 (Set) */ - CMD_ID_SET_TXPWR_CTRL, /* 0x38 (Set) */ - CMD_ID_SET_AUTOPWR_CTRL, /* 0x39 (Set) */ - - CMD_ID_GET_NIC_CAPABILITY = 0x80, /* 0x80 (Query) */ - CMD_ID_GET_LINK_QUALITY, /* 0x81 (Query) */ - CMD_ID_GET_STATISTICS, /* 0x82 (Query) */ - CMD_ID_GET_CONNECTION_STATUS, /* 0x83 (Query) */ - CMD_ID_GET_ASSOC_INFO, /* 0x84 (Query) (obsolete) */ - - CMD_ID_BASIC_CONFIG = 0xc1, /* 0xc1 (Set / Query) */ - CMD_ID_ACCESS_REG, /* 0xc2 (Set / Query) */ - CMD_ID_MAC_MCAST_ADDR, /* 0xc3 (Set / Query) */ - CMD_ID_802_11_PMKID, /* 0xc4 (Set / Query) */ - CMD_ID_ACCESS_EEPROM, /* 0xc5 (Set / Query) */ - CMD_ID_SW_DBG_CTRL, /* 0xc6 (Set / Query) */ -#if 1/* CFG_SUPPORT_ANTI_PIRACY */ - CMD_ID_SEC_CHECK, /* 0xc7 (Set / Query) */ -#endif - CMD_ID_DUMP_MEM, /* 0xc8 (Query) */ - -#if CFG_SUPPORT_RDD_TEST_MODE - CMD_ID_SET_RDD_CH = 0xE1, -#endif - - CMD_ID_SET_BWCS = 0xF1, -#if CFG_SUPPORT_OSC_SETTING && defined(MT5931) - CMD_ID_SET_OSC = 0xf2, -#endif - -} ENUM_CMD_ID_T, *P_ENUM_CMD_ID_T; - -typedef enum _ENUM_EVENT_ID_T { - EVENT_ID_CMD_RESULT = 1, /* 0x01 (Query) */ - EVENT_ID_NIC_CAPABILITY, /* 0x02 (Query) */ - EVENT_ID_CONNECTION_STATUS, /* 0x03 (Query / Unsolicited) (obsolete) */ - EVENT_ID_SCAN_RESULT, /* 0x04 (Query / Unsolicited) (obselete) */ - EVENT_ID_LINK_QUALITY, /* 0x05 (Query / Unsolicited) */ - EVENT_ID_STATISTICS, /* 0x06 (Query) */ - EVENT_ID_MIC_ERR_INFO, /* 0x07 (Unsolicited) */ - EVENT_ID_ASSOC_INFO, /* 0x08 (Query - CMD_ID_GET_ASSOC_INFO) */ - EVENT_ID_BASIC_CONFIG, /* 0x09 (Query - CMD_ID_BASIC_CONFIG) */ - EVENT_ID_ACCESS_REG, /* 0x0a (Query - CMD_ID_ACCESS_REG) */ - EVENT_ID_MAC_MCAST_ADDR, /* 0x0b (Query - CMD_ID_MAC_MCAST_ADDR) */ - EVENT_ID_802_11_PMKID, /* 0x0c (Query - CMD_ID_802_11_PMKID) */ - EVENT_ID_ACCESS_EEPROM, /* 0x0d (Query - CMD_ID_ACCESS_EEPROM) */ - EVENT_ID_SLEEPY_NOTIFY, /* 0x0e (Query) */ - EVENT_ID_BT_OVER_WIFI, /* 0x0f (Unsolicited) */ - EVENT_ID_TEST_STATUS, /* 0x10 (Query - CMD_ID_TEST_MODE) */ - EVENT_ID_RX_ADDBA, /* 0x11 (Unsolicited) (obsolete) */ - EVENT_ID_RX_DELBA, /* 0x12 (Unsolicited) (obsolete) */ - EVENT_ID_ACTIVATE_STA_REC_T, /* 0x13 (Unsolicited) */ - EVENT_ID_DEACTIVATE_STA_REC_T, /* 0x14 (Unsolicited) */ - EVENT_ID_SCAN_DONE, /* 0x15 (Unsoiicited) */ - EVENT_ID_RX_FLUSH, /* 0x16 (Unsolicited) */ - EVENT_ID_TX_DONE, /* 0x17 (Unsolicited) */ - EVENT_ID_CH_PRIVILEGE, /* 0x18 (Unsolicited) */ - EVENT_ID_BSS_ABSENCE_PRESENCE = 0x19, /* 0x19 (Unsolicited) */ - EVENT_ID_STA_CHANGE_PS_MODE, /* 0x1A (Unsolicited) */ - EVENT_ID_BSS_BEACON_TIMEOUT, /* 0x1B (Unsolicited) */ - EVENT_ID_UPDATE_NOA_PARAMS, /* 0x1C (Unsolicited) */ - EVENT_ID_AP_OBSS_STATUS, /* 0x1D (Unsolicited) */ - EVENT_ID_STA_UPDATE_FREE_QUOTA, /* 0x1E (Unsolicited) */ - EVENT_ID_SW_DBG_CTRL, /* 0x1F (Query - CMD_ID_SW_DBG_CTRL) */ - EVENT_ID_ROAMING_STATUS, /* 0x20 (Unsolicited) */ - EVENT_ID_STA_AGING_TIMEOUT, /* 0x21 (Unsolicited) */ -#if 1 /* CFG_SUPPORT_ANTI_PIRACY */ - EVENT_ID_SEC_CHECK_RSP, /* 0x22 (Unsolicited) */ -#endif - EVENT_ID_SEND_DEAUTH, /* 0x23 (Unsolicited) */ - -#if CFG_SUPPORT_RDD_TEST_MODE - EVENT_ID_UPDATE_RDD_STATUS, /* 0x24 (Unsolicited) */ -#endif - -#if CFG_SUPPORT_BCM && CFG_SUPPORT_BCM_BWCS - EVENT_ID_UPDATE_BWCS_STATUS = 0x25, /* 0x25 (Unsolicited) */ - EVENT_ID_UPDATE_BCM_DEBUG, /* 0x26 (Unsolicited) */ -#endif - EVENT_ID_RX_ERR, - EVENT_ID_DUMP_MEM -} ENUM_EVENT_ID_T, *P_ENUM_EVENT_ID_T; - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -#ifndef LINUX -typedef UINT_8 CMD_STATUS; -#endif -/* for Event Packet (via HIF-RX) */ - /* following CM's documentation v0.7 */ -typedef struct _WIFI_CMD_T { - UINT_16 u2TxByteCount_UserPriority; - UINT_8 ucEtherTypeOffset; - UINT_8 ucResource_PktType_CSflags; - UINT_8 ucCID; - UINT_8 ucSetQuery; - UINT_8 ucSeqNum; - UINT_8 aucReserved2; - - UINT_8 aucBuffer[0]; -} WIFI_CMD_T, *P_WIFI_CMD_T; - -/* for Command Packet (via HIF-TX) */ - /* following CM's documentation v0.7 */ -typedef struct _WIFI_EVENT_T { - UINT_16 u2PacketLen; - UINT_16 u2PacketType; - UINT_8 ucEID; - UINT_8 ucSeqNum; - UINT_8 aucReserved2[2]; - - UINT_8 aucBuffer[0]; -} WIFI_EVENT_T, *P_WIFI_EVENT_T; - -// CMD_ID_TEST_MODE -typedef struct _CMD_TEST_CTRL_T { - UINT_8 ucAction; - UINT_8 aucReserved[3]; - union { - UINT_32 u4OpMode; - UINT_32 u4ChannelFreq; - PARAM_MTK_WIFI_TEST_STRUC_T rRfATInfo; - } u; -} CMD_TEST_CTRL_T, *P_CMD_TEST_CTRL_T; - -// EVENT_TEST_STATUS -typedef struct _PARAM_CUSTOM_RFTEST_TX_STATUS_STRUC_T { - UINT_32 u4PktSentStatus; - UINT_32 u4PktSentCount; - UINT_16 u2AvgAlc; - UINT_8 ucCckGainControl; - UINT_8 ucOfdmGainControl; -} PARAM_CUSTOM_RFTEST_TX_STATUS_STRUC_T, *P_PARAM_CUSTOM_RFTEST_TX_STATUS_STRUC_T; - -typedef struct _PARAM_CUSTOM_RFTEST_RX_STATUS_STRUC_T { - UINT_32 u4IntRxOk; /*!< number of packets that Rx ok from interrupt */ - UINT_32 u4IntCrcErr; /*!< number of packets that CRC error from interrupt */ - UINT_32 u4IntShort; /*!< number of packets that is short preamble from interrupt */ - UINT_32 u4IntLong; /*!< number of packets that is long preamble from interrupt */ - UINT_32 u4PauRxPktCount; /*!< number of packets that Rx ok from PAU */ - UINT_32 u4PauCrcErrCount; /*!< number of packets that CRC error from PAU */ - UINT_32 u4PauRxFifoFullCount; /*!< number of packets that is short preamble from PAU */ - UINT_32 u4PauCCACount; /*!< CCA rising edge count */ -} PARAM_CUSTOM_RFTEST_RX_STATUS_STRUC_T, *P_PARAM_CUSTOM_RFTEST_RX_STATUS_STRUC_T; - -typedef union _EVENT_TEST_STATUS { - PARAM_MTK_WIFI_TEST_STRUC_T rATInfo; -// PARAM_CUSTOM_RFTEST_TX_STATUS_STRUC_T rTxStatus; -// PARAM_CUSTOM_RFTEST_RX_STATUS_STRUC_T rRxStatus; -} EVENT_TEST_STATUS, *P_EVENT_TEST_STATUS; - -// CMD_BUILD_CONNECTION -typedef struct _CMD_BUILD_CONNECTION { - UINT_8 ucInfraMode; - UINT_8 ucAuthMode; - UINT_8 ucEncryptStatus; - UINT_8 ucSsidLen; - UINT_8 aucSsid[PARAM_MAX_LEN_SSID]; - UINT_8 aucBssid[PARAM_MAC_ADDR_LEN]; - - /* Ad-hoc mode */ - UINT_16 u2BeaconPeriod; - UINT_16 u2ATIMWindow; - UINT_8 ucJoinOnly; - UINT_8 ucReserved; - UINT_32 u4FreqInKHz; - - /* for faster connection */ - UINT_8 aucScanResult[0]; -} CMD_BUILD_CONNECTION, *P_CMD_BUILD_CONNECTION; - -//CMD_ADD_REMOVE_KEY -typedef struct _CMD_802_11_KEY { - UINT_8 ucAddRemove; - UINT_8 ucTxKey; - UINT_8 ucKeyType; - UINT_8 ucIsAuthenticator; - UINT_8 aucPeerAddr[6]; - UINT_8 ucNetType; - UINT_8 ucAlgorithmId; - UINT_8 ucKeyId; - UINT_8 ucKeyLen; - UINT_8 aucReverved[2]; - UINT_8 aucKeyMaterial[32]; - UINT_8 aucKeyRsc[16]; -} CMD_802_11_KEY, *P_CMD_802_11_KEY; - -/* WPA2 PMKID cache structure */ -typedef struct _PMKID_ENTRY_T { - PARAM_BSSID_INFO_T rBssidInfo; - BOOLEAN fgPmkidExist; -} PMKID_ENTRY_T, *P_PMKID_ENTRY_T; - -typedef struct _CMD_802_11_PMKID -{ - ULONG u4BSSIDInfoCount; - P_PMKID_ENTRY_T arPMKIDInfo[1]; -} CMD_802_11_PMKID, *P_CMD_802_11_PMKID; - -// CMD_BASIC_CONFIG -typedef struct _CMD_CSUM_OFFLOAD { - UINT_16 u2RxChecksum; // bit0: IP, bit1: UDP, bit2: TCP - UINT_16 u2TxChecksum; // bit0: IP, bit1: UDP, bit2: TCP -} CMD_CSUM_OFFLOAD, *P_CMD_CSUM_OFFLOAD; - -typedef struct _CMD_BASIC_CONFIG { - PARAM_MAC_ADDRESS rMyMacAddr; - UINT_8 ucNative80211; - UINT_8 aucReserved[1]; - - CMD_CSUM_OFFLOAD rCsumOffload; -} CMD_BASIC_CONFIG, *P_CMD_BASIC_CONFIG, EVENT_BASIC_CONFIG, *P_EVENT_BASIC_CONFIG; - -// CMD_MAC_MCAST_ADDR -typedef struct _CMD_MAC_MCAST_ADDR { - UINT_32 u4NumOfGroupAddr; - UINT_8 ucNetTypeIndex; - UINT_8 aucReserved[3]; - PARAM_MAC_ADDRESS arAddress[MAX_NUM_GROUP_ADDR]; -} CMD_MAC_MCAST_ADDR, *P_CMD_MAC_MCAST_ADDR, EVENT_MAC_MCAST_ADDR, *P_EVENT_MAC_MCAST_ADDR; - -// CMD_ACCESS_EEPROM -typedef struct _CMD_ACCESS_EEPROM { - UINT_16 u2Offset; - UINT_16 u2Data; -} CMD_ACCESS_EEPROM, *P_CMD_ACCESS_EEPROM, EVENT_ACCESS_EEPROM, *P_EVENT_ACCESS_EEPROM; - -typedef struct _CMD_CUSTOM_NOA_PARAM_STRUC_T { - UINT_32 u4NoaDurationMs; - UINT_32 u4NoaIntervalMs; - UINT_32 u4NoaCount; -} CMD_CUSTOM_NOA_PARAM_STRUC_T, *P_CMD_CUSTOM_NOA_PARAM_STRUC_T; - -typedef struct _CMD_CUSTOM_OPPPS_PARAM_STRUC_T { - UINT_32 u4CTwindowMs; -} CMD_CUSTOM_OPPPS_PARAM_STRUC_T, *P_CMD_CUSTOM_OPPPS_PARAM_STRUC_T; - -typedef struct _CMD_CUSTOM_UAPSD_PARAM_STRUC_T { - UINT_8 fgEnAPSD; - UINT_8 fgEnAPSD_AcBe; - UINT_8 fgEnAPSD_AcBk; - UINT_8 fgEnAPSD_AcVo; - UINT_8 fgEnAPSD_AcVi; - UINT_8 ucMaxSpLen; - UINT_8 aucResv[2]; -} CMD_CUSTOM_UAPSD_PARAM_STRUC_T, *P_CMD_CUSTOM_UAPSD_PARAM_STRUC_T; - -// EVENT_CONNECTION_STATUS -typedef struct _EVENT_CONNECTION_STATUS { - UINT_8 ucMediaStatus; - UINT_8 ucReasonOfDisconnect; - - UINT_8 ucInfraMode; - UINT_8 ucSsidLen; - UINT_8 aucSsid[PARAM_MAX_LEN_SSID]; - UINT_8 aucBssid[PARAM_MAC_ADDR_LEN]; - UINT_8 ucAuthenMode; - UINT_8 ucEncryptStatus; - UINT_16 u2BeaconPeriod; - UINT_16 u2AID; - UINT_16 u2ATIMWindow; - UINT_8 ucNetworkType; - UINT_8 aucReserved[1]; - UINT_32 u4FreqInKHz; - -#if CFG_ENABLE_WIFI_DIRECT - UINT_8 aucInterfaceAddr[PARAM_MAC_ADDR_LEN]; -#endif - -} EVENT_CONNECTION_STATUS, *P_EVENT_CONNECTION_STATUS; - -// EVENT_NIC_CAPABILITY -typedef struct _EVENT_NIC_CAPABILITY { - UINT_16 u2ProductID; - UINT_16 u2FwVersion; - UINT_16 u2DriverVersion; - UINT_8 ucHw5GBandDisabled; - UINT_8 ucEepromUsed; - UINT_8 ucEfuseValid; - UINT_8 ucMacAddrValid; -#if CFG_REPORT_RFBB_VERSION - UINT_8 ucRfVersion; - UINT_8 ucPhyVersion; -#endif -#if CFG_ENABLE_CAL_LOG - UINT_8 ucRfCalFail; - UINT_8 ucBbCalFail; -#endif - UINT_8 aucReserved[2]; -} EVENT_NIC_CAPABILITY, *P_EVENT_NIC_CAPABILITY; - -// modified version of WLAN_BEACON_FRAME_BODY_T for simplier buffering -typedef struct _WLAN_BEACON_FRAME_BODY_T_LOCAL { - /* Beacon frame body */ - UINT_32 au4Timestamp[2]; /* Timestamp */ - UINT_16 u2BeaconInterval; /* Beacon Interval */ - UINT_16 u2CapInfo; /* Capability */ - UINT_8 aucInfoElem[MAX_IE_LENGTH]; /* Various IEs, start from SSID */ - UINT_16 u2IELength; /* This field is *NOT* carried by F/W but caculated by nic_rx */ -} WLAN_BEACON_FRAME_BODY_T_LOCAL, *P_WLAN_BEACON_FRAME_BODY_T_LOCAL; - -// EVENT_SCAN_RESULT -typedef struct _EVENT_SCAN_RESULT_T { - INT_32 i4RSSI; - UINT_32 u4LinkQuality; - UINT_32 u4DSConfig; /* Center frequency */ - UINT_32 u4DomainInfo; /* Require CM opinion */ - UINT_32 u4Reserved; - UINT_8 ucNetworkType; - UINT_8 ucOpMode; - UINT_8 aucBssid[MAC_ADDR_LEN]; - UINT_8 aucRatesEx[PARAM_MAX_LEN_RATES_EX]; - WLAN_BEACON_FRAME_BODY_T_LOCAL rBeaconFrameBody; -} EVENT_SCAN_RESULT_T, *P_EVENT_SCAN_RESULT_T; - -/* event of tkip mic error */ -typedef struct _EVENT_MIC_ERR_INFO -{ - UINT_32 u4Flags; -} EVENT_MIC_ERR_INFO, *P_EVENT_MIC_ERR_INFO; - -typedef struct _EVENT_PMKID_CANDIDATE_LIST_T -{ - UINT_32 u4Version; /*!< Version */ - UINT_32 u4NumCandidates; /*!< How many candidates follow */ - PARAM_PMKID_CANDIDATE_T arCandidateList[1]; -} EVENT_PMKID_CANDIDATE_LIST_T, *P_EVENT_PMKID_CANDIDATE_LIST_T; - - -typedef struct _EVENT_CMD_RESULT { - UINT_8 ucCmdID; - UINT_8 ucStatus; - UINT_8 aucReserved[2]; -} EVENT_CMD_RESULT, *P_EVENT_CMD_RESULT; - -#if CFG_SUPPORT_OSC_SETTING && defined(MT5931) -typedef struct _CMD_MCU_LP_PARAM_T { - UINT_16 u2OscStableTime; - UINT_8 ucReserved[6]; -} CMD_MCU_LP_PARAM_T, *P_CMD_MCU_LP_PARAM_T; -#endif - - -// CMD_ID_ACCESS_REG & EVENT_ID_ACCESS_REG -typedef struct _CMD_ACCESS_REG { - UINT_32 u4Address; - UINT_32 u4Data; -} CMD_ACCESS_REG, *P_CMD_ACCESS_REG; - -// CMD_DUMP_MEMORY -typedef struct _CMD_DUMP_MEM { - UINT_32 u4Address; - UINT_32 u4Length; - UINT_32 u4RemainLength; - UINT_8 ucFragNum; -} CMD_DUMP_MEM, *P_CMD_DUMP_MEM; - -typedef struct _EVENT_DUMP_MEM_T { - UINT_32 u4Address; - UINT_32 u4Length; - UINT_32 u4RemainLength; - UINT_8 ucFragNum; - UINT_8 aucBuffer[1]; -} EVENT_DUMP_MEM_T, *P_EVENT_DUMP_MEM_T; - -typedef struct _CMD_SW_DBG_CTRL_T { - UINT_32 u4Id; - UINT_32 u4Data; - /* Debug Support */ - UINT_32 u4DebugCnt[64]; -} CMD_SW_DBG_CTRL_T, *P_CMD_SW_DBG_CTRL_T; - - -// CMD_ID_LINK_ATTRIB -typedef struct _CMD_LINK_ATTRIB { - INT_8 cRssiTrigger; - UINT_8 ucDesiredRateLen; - UINT_16 u2DesiredRate[32]; - UINT_8 ucMediaStreamMode; - UINT_8 aucReserved[1]; -} CMD_LINK_ATTRIB, *P_CMD_LINK_ATTRIB; - -// CMD_ID_NIC_POWER_CTRL -typedef struct _CMD_NIC_POWER_CTRL { - UINT_8 ucPowerMode; - UINT_8 aucReserved[3]; -} CMD_NIC_POWER_CTRL, *P_CMD_NIC_POWER_CTRL; - -// CMD_ID_POWER_SAVE_MODE -typedef struct _CMD_PS_PROFILE_T { - UINT_8 ucNetTypeIndex; - UINT_8 ucPsProfile; - UINT_8 aucReserved[2]; -} CMD_PS_PROFILE_T, *P_CMD_PS_PROFILE_T; - - -// EVENT_LINK_QUALITY -typedef struct _EVENT_LINK_QUALITY { - INT_8 cRssi; - INT_8 cLinkQuality; - UINT_16 u2LinkSpeed; - UINT_8 ucMediumBusyPercentage; -} EVENT_LINK_QUALITY, *P_EVENT_LINK_QUALITY; - -#if CFG_SUPPORT_P2P_RSSI_QUERY -// EVENT_LINK_QUALITY -typedef struct _EVENT_LINK_QUALITY_EX { - INT_8 cRssi; - INT_8 cLinkQuality; - UINT_16 u2LinkSpeed; - UINT_8 ucMediumBusyPercentage; - UINT_8 ucIsLQ0Rdy; - INT_8 cRssiP2P; /* For P2P Network. */ - INT_8 cLinkQualityP2P; - UINT_16 u2LinkSpeedP2P; - UINT_8 ucMediumBusyPercentageP2P; - UINT_8 ucIsLQ1Rdy; -} EVENT_LINK_QUALITY_EX, *P_EVENT_LINK_QUALITY_EX; -#endif - -// EVENT_ID_STATISTICS -typedef struct _EVENT_STATISTICS { - LARGE_INTEGER rTransmittedFragmentCount; - LARGE_INTEGER rMulticastTransmittedFrameCount; - LARGE_INTEGER rFailedCount; - LARGE_INTEGER rRetryCount; - LARGE_INTEGER rMultipleRetryCount; - LARGE_INTEGER rRTSSuccessCount; - LARGE_INTEGER rRTSFailureCount; - LARGE_INTEGER rACKFailureCount; - LARGE_INTEGER rFrameDuplicateCount; - LARGE_INTEGER rReceivedFragmentCount; - LARGE_INTEGER rMulticastReceivedFrameCount; - LARGE_INTEGER rFCSErrorCount; -} EVENT_STATISTICS, *P_EVENT_STATISTICS; - -// EVENT_ID_FW_SLEEPY_NOTIFY -typedef struct _EVENT_SLEEPY_NOTIFY { - UINT_8 ucSleepyState; - UINT_8 aucReserved[3]; -} EVENT_SLEEPY_NOTIFY, *P_EVENT_SLEEPY_NOTIFY; - -typedef struct _EVENT_ACTIVATE_STA_REC_T { - UINT_8 aucMacAddr[6]; - UINT_8 ucStaRecIdx; - UINT_8 ucNetworkTypeIndex; - BOOLEAN fgIsQoS; - BOOLEAN fgIsAP; - UINT_8 aucReserved[2]; -} EVENT_ACTIVATE_STA_REC_T, *P_EVENT_ACTIVATE_STA_REC_T; - -typedef struct _EVENT_DEACTIVATE_STA_REC_T { - UINT_8 ucStaRecIdx; - UINT_8 aucReserved[3]; -} EVENT_DEACTIVATE_STA_REC_T, *P_EVENT_DEACTIVATE_STA_REC_T; - -// CMD_BT_OVER_WIFI -typedef struct _CMD_BT_OVER_WIFI { - UINT_8 ucAction; /* 0: query, 1: setup, 2: destroy */ - UINT_8 ucChannelNum; - PARAM_MAC_ADDRESS rPeerAddr; - UINT_16 u2BeaconInterval; - UINT_8 ucTimeoutDiscovery; - UINT_8 ucTimeoutInactivity; - UINT_8 ucRole; - UINT_8 PAL_Capabilities; - UINT_8 cMaxTxPower; - UINT_8 ucChannelBand; - UINT_8 ucReserved[1]; -} CMD_BT_OVER_WIFI, *P_CMD_BT_OVER_WIFI; - -// EVENT_BT_OVER_WIFI -typedef struct _EVENT_BT_OVER_WIFI { - UINT_8 ucLinkStatus; - UINT_8 ucSelectedChannel; - INT_8 cRSSI; - UINT_8 ucReserved[1]; -} EVENT_BT_OVER_WIFI, *P_EVENT_BT_OVER_WIFI; - -// Same with DOMAIN_SUBBAND_INFO -typedef struct _CMD_SUBBAND_INFO { - UINT_8 ucRegClass; - UINT_8 ucBand; - UINT_8 ucChannelSpan; - UINT_8 ucFirstChannelNum; - UINT_8 ucNumChannels; - UINT_8 aucReserved[3]; -} CMD_SUBBAND_INFO, *P_CMD_SUBBAND_INFO; - -// CMD_SET_DOMAIN_INFO -typedef struct _CMD_SET_DOMAIN_INFO_T { - UINT_16 u2CountryCode; - UINT_16 u2Reserved; - CMD_SUBBAND_INFO rSubBand[6]; - - UINT_8 uc2G4Bandwidth; /* CONFIG_BW_20_40M or CONFIG_BW_20M */ - UINT_8 uc5GBandwidth; /* CONFIG_BW_20_40M or CONFIG_BW_20M */ - UINT_8 aucReserved[2]; -} CMD_SET_DOMAIN_INFO_T, *P_CMD_SET_DOMAIN_INFO_T; - -// CMD_SET_IP_ADDRESS -typedef struct _IPV4_NETWORK_ADDRESS { - UINT_8 aucIpAddr[4]; -} IPV4_NETWORK_ADDRESS, *P_IPV4_NETWORK_ADDRESS; - -typedef struct _CMD_SET_NETWORK_ADDRESS_LIST { - UINT_8 ucNetTypeIndex; - UINT_8 ucAddressCount; - UINT_8 ucReserved[2]; - IPV4_NETWORK_ADDRESS arNetAddress[1]; -} CMD_SET_NETWORK_ADDRESS_LIST, *P_CMD_SET_NETWORK_ADDRESS_LIST; - -typedef struct _PATTERN_DESCRIPTION { - UINT_8 fgCheckBcA1; - UINT_8 fgCheckMcA1; - UINT_8 ePatternHeader; - UINT_8 fgAndOp; - UINT_8 fgNotOp; - UINT_8 ucPatternMask; - UINT_16 ucPatternOffset; - UINT_8 aucPattern[8]; -} PATTERN_DESCRIPTION, *P_PATTERN_DESCRIPTION; - -typedef struct _CMD_RAW_PATTERN_CONFIGURATION_T { - PATTERN_DESCRIPTION arPatternDesc[4]; -} CMD_RAW_PATTERN_CONFIGURATION_T, *P_CMD_RAW_PATTERN_CONFIGURATION_T; - -typedef struct _CMD_PATTERN_FUNC_CONFIG { - BOOLEAN fgBcA1En; - BOOLEAN fgMcA1En; - BOOLEAN fgBcA1MatchDrop; - BOOLEAN fgMcA1MatchDrop; -} CMD_PATTERN_FUNC_CONFIG, *P_CMD_PATTERN_FUNC_CONFIG; - - -typedef struct _EVENT_TX_DONE_T { - UINT_8 ucPacketSeq; - UINT_8 ucStatus; - UINT_16 u2SequenceNumber; - UINT_32 au4Reserved1; - UINT_32 au4Reserved2; - UINT_32 au4Reserved3; -} EVENT_TX_DONE_T, *P_EVENT_TX_DONE_T; - -typedef struct _CMD_BSS_ACTIVATE_CTRL { - UINT_8 ucNetTypeIndex; - UINT_8 ucActive; - UINT_8 aucReserved[2]; -} CMD_BSS_ACTIVATE_CTRL, *P_CMD_BSS_ACTIVATE_CTRL; - -typedef struct _CMD_SET_BSS_RLM_PARAM_T { - UINT_8 ucNetTypeIndex; - UINT_8 ucRfBand; - UINT_8 ucPrimaryChannel; - UINT_8 ucRfSco; - UINT_8 ucErpProtectMode; - UINT_8 ucHtProtectMode; - UINT_8 ucGfOperationMode; - UINT_8 ucTxRifsMode; - UINT_16 u2HtOpInfo3; - UINT_16 u2HtOpInfo2; - UINT_8 ucHtOpInfo1; - UINT_8 ucUseShortPreamble; - UINT_8 ucUseShortSlotTime; - UINT_8 ucCheckId; /* Fixed value: 0x72 */ -} CMD_SET_BSS_RLM_PARAM_T, *P_CMD_SET_BSS_RLM_PARAM_T; - -typedef struct _CMD_SET_BSS_INFO { - UINT_8 ucNetTypeIndex; - UINT_8 ucConnectionState; - UINT_8 ucCurrentOPMode; - UINT_8 ucSSIDLen; - UINT_8 aucSSID[32]; - UINT_8 aucBSSID[6]; - UINT_8 ucIsQBSS; - UINT_8 ucReserved1; - UINT_16 u2OperationalRateSet; - UINT_16 u2BSSBasicRateSet; - UINT_8 ucStaRecIdxOfAP; - UINT_8 ucReserved2; - UINT_8 ucReserved3; - UINT_8 ucNonHTBasicPhyType; /* For Slot Time and CWmin */ - UINT_8 ucAuthMode; - UINT_8 ucEncStatus; - UINT_8 ucPhyTypeSet; - UINT_8 aucOwnMac[6]; - UINT_8 fgWapiMode; - UINT_8 fgIsApMode; - UINT_8 aucRsv[1]; - CMD_SET_BSS_RLM_PARAM_T rBssRlmParam; -} CMD_SET_BSS_INFO, *P_CMD_SET_BSS_INFO; - -typedef struct _CMD_UPDATE_STA_RECORD_T { - UINT_8 ucIndex; - UINT_8 ucStaType; - UINT_8 aucMacAddr[MAC_ADDR_LEN]; - UINT_16 u2AssocId; - UINT_16 u2ListenInterval; - UINT_8 ucNetTypeIndex; - UINT_8 ucDesiredPhyTypeSet; - UINT_16 u2DesiredNonHTRateSet; - UINT_16 u2BSSBasicRateSet; - UINT_8 ucIsQoS; - UINT_8 ucIsUapsdSupported; - UINT_8 ucStaState; - UINT_8 ucMcsSet; - UINT_8 ucSupMcs32; - UINT_8 ucAmpduParam; - UINT_16 u2HtCapInfo; - UINT_16 u2HtExtendedCap; - UINT_32 u4TxBeamformingCap; - UINT_8 ucAselCap; - UINT_8 ucRCPI; - UINT_8 ucNeedResp; - UINT_8 ucUapsdAc; /* b0~3: Trigger enabled, b4~7: Delivery enabled */ - UINT_8 ucUapsdSp; /* 0: all, 1: max 2, 2: max 4, 3: max 6 */ - UINT_8 aucReserved[3]; - /* TBD */ -} CMD_UPDATE_STA_RECORD_T, *P_CMD_UPDATE_STA_RECORD_T; - -typedef struct _CMD_REMOVE_STA_RECORD_T { - UINT_8 ucIndex; - UINT_8 ucReserved; - UINT_8 aucMacAddr[MAC_ADDR_LEN]; -} CMD_REMOVE_STA_RECORD_T, *P_CMD_REMOVE_STA_RECORD_T; - -typedef struct _CMD_INDICATE_PM_BSS_CREATED_T { - UINT_8 ucNetTypeIndex; - UINT_8 ucDtimPeriod; - UINT_16 u2BeaconInterval; - UINT_16 u2AtimWindow; - UINT_8 aucReserved[2]; -} CMD_INDICATE_PM_BSS_CREATED, *P_CMD_INDICATE_PM_BSS_CREATED; - -typedef struct _CMD_INDICATE_PM_BSS_CONNECTED_T { - UINT_8 ucNetTypeIndex; - UINT_8 ucDtimPeriod; - UINT_16 u2AssocId; - UINT_16 u2BeaconInterval; - UINT_16 u2AtimWindow; - UINT_8 fgIsUapsdConnection; - UINT_8 ucBmpDeliveryAC; - UINT_8 ucBmpTriggerAC; - UINT_8 aucReserved[1]; -} CMD_INDICATE_PM_BSS_CONNECTED, *P_CMD_INDICATE_PM_BSS_CONNECTED; - -typedef struct _CMD_INDICATE_PM_BSS_ABORT { - UINT_8 ucNetTypeIndex; - UINT_8 aucReserved[3]; -} CMD_INDICATE_PM_BSS_ABORT, *P_CMD_INDICATE_PM_BSS_ABORT; - -typedef struct _CMD_BEACON_TEMPLATE_UPDATE { - UINT_8 ucUpdateMethod; // 0: update randomly, 1: update all, 2: delete all (1 and 2 will update directly without search) - UINT_8 ucNetTypeIndex; - UINT_8 aucReserved[2]; - UINT_16 u2Capability; - UINT_16 u2IELen; - UINT_8 aucIE[MAX_IE_LENGTH]; -} CMD_BEACON_TEMPLATE_UPDATE, *P_CMD_BEACON_TEMPLATE_UPDATE; - -typedef struct _CMD_SET_WMM_PS_TEST_STRUC_T { - UINT_8 ucNetTypeIndex; - UINT_8 bmfgApsdEnAc; /* b0~3: trigger-en AC0~3. b4~7: delivery-en AC0~3 */ - UINT_8 ucIsEnterPsAtOnce; /* enter PS immediately without 5 second guard after connected */ - UINT_8 ucIsDisableUcTrigger; /* not to trigger UC on beacon TIM is matched (under U-APSD) */ -} CMD_SET_WMM_PS_TEST_STRUC_T, *P_CMD_SET_WMM_PS_TEST_STRUC_T; - - -/* Definition for CHANNEL_INFO.ucBand: - * 0: Reserved - * 1: BAND_2G4 - * 2: BAND_5G - * Others: Reserved - */ -typedef struct _CHANNEL_INFO_T { - UINT_8 ucBand; - UINT_8 ucChannelNum; -} CHANNEL_INFO_T, *P_CHANNEL_INFO_T; - -typedef struct _CMD_SCAN_REQ_T { - UINT_8 ucSeqNum; - UINT_8 ucNetworkType; - UINT_8 ucScanType; - UINT_8 ucSSIDType; /* BIT(0) wildcard / BIT(1) P2P-wildcard / BIT(2) specific */ - UINT_8 ucSSIDLength; - UINT_8 aucReserved[1]; - UINT_16 u2ChannelMinDwellTime; - UINT_8 aucSSID[32]; - UINT_16 u2ChannelDwellTime; /* For P2P */ - UINT_8 ucChannelType; - UINT_8 ucChannelListNum; - CHANNEL_INFO_T arChannelList[32]; - UINT_16 u2IELen; - UINT_8 aucIE[MAX_IE_LENGTH]; -} CMD_SCAN_REQ, *P_CMD_SCAN_REQ; - -typedef struct _CMD_SCAN_REQ_V2_T { - UINT_8 ucSeqNum; - UINT_8 ucNetworkType; - UINT_8 ucScanType; - UINT_8 ucSSIDType; - PARAM_SSID_T arSSID[4]; - UINT_16 u2ProbeDelayTime; - UINT_16 u2ChannelDwellTime; /* For P2P */ - UINT_8 ucChannelType; - UINT_8 ucChannelListNum; - CHANNEL_INFO_T arChannelList[32]; - UINT_16 u2IELen; - UINT_8 aucIE[MAX_IE_LENGTH]; -} CMD_SCAN_REQ_V2, *P_CMD_SCAN_REQ_V2; - -typedef struct _CMD_SCAN_CANCEL_T { - UINT_8 ucSeqNum; - UINT_8 ucIsExtChannel; /* For P2P channel extention. */ - UINT_8 aucReserved[2]; -} CMD_SCAN_CANCEL, *P_CMD_SCAN_CANCEL; - -typedef struct _EVENT_SCAN_DONE_T { - UINT_8 ucSeqNum; - UINT_8 ucSparseChannelValid; - CHANNEL_INFO_T rSparseChannel; -} EVENT_SCAN_DONE, *P_EVENT_SCAN_DONE; - -typedef struct _CMD_CH_PRIVILEGE_T { - UINT_8 ucNetTypeIndex; - UINT_8 ucTokenID; - UINT_8 ucAction; - UINT_8 ucPrimaryChannel; - UINT_8 ucRfSco; - UINT_8 ucRfBand; - UINT_8 ucReqType; - UINT_8 ucReserved; - UINT_32 u4MaxInterval; /* In unit of ms */ - UINT_8 aucBSSID[6]; - UINT_8 aucReserved[2]; -} CMD_CH_PRIVILEGE_T, *P_CMD_CH_PRIVILEGE_T; - -typedef struct _CMD_TX_PWR_T { - INT_8 cTxPwr2G4Cck; /* signed, in unit of 0.5dBm */ -#if defined(MT6620) - INT_8 acReserved[3]; -#elif defined(MT5931) || defined(MT6628) - INT_8 cTxPwr2G4Dsss; /* signed, in unit of 0.5dBm */ - INT_8 acReserved[2]; -#else - #error "No valid definition!" -#endif - - INT_8 cTxPwr2G4OFDM_BPSK; - INT_8 cTxPwr2G4OFDM_QPSK; - INT_8 cTxPwr2G4OFDM_16QAM; - INT_8 cTxPwr2G4OFDM_Reserved; - INT_8 cTxPwr2G4OFDM_48Mbps; - INT_8 cTxPwr2G4OFDM_54Mbps; - - INT_8 cTxPwr2G4HT20_BPSK; - INT_8 cTxPwr2G4HT20_QPSK; - INT_8 cTxPwr2G4HT20_16QAM; - INT_8 cTxPwr2G4HT20_MCS5; - INT_8 cTxPwr2G4HT20_MCS6; - INT_8 cTxPwr2G4HT20_MCS7; - - INT_8 cTxPwr2G4HT40_BPSK; - INT_8 cTxPwr2G4HT40_QPSK; - INT_8 cTxPwr2G4HT40_16QAM; - INT_8 cTxPwr2G4HT40_MCS5; - INT_8 cTxPwr2G4HT40_MCS6; - INT_8 cTxPwr2G4HT40_MCS7; - - INT_8 cTxPwr5GOFDM_BPSK; - INT_8 cTxPwr5GOFDM_QPSK; - INT_8 cTxPwr5GOFDM_16QAM; - INT_8 cTxPwr5GOFDM_Reserved; - INT_8 cTxPwr5GOFDM_48Mbps; - INT_8 cTxPwr5GOFDM_54Mbps; - - INT_8 cTxPwr5GHT20_BPSK; - INT_8 cTxPwr5GHT20_QPSK; - INT_8 cTxPwr5GHT20_16QAM; - INT_8 cTxPwr5GHT20_MCS5; - INT_8 cTxPwr5GHT20_MCS6; - INT_8 cTxPwr5GHT20_MCS7; - - INT_8 cTxPwr5GHT40_BPSK; - INT_8 cTxPwr5GHT40_QPSK; - INT_8 cTxPwr5GHT40_16QAM; - INT_8 cTxPwr5GHT40_MCS5; - INT_8 cTxPwr5GHT40_MCS6; - INT_8 cTxPwr5GHT40_MCS7; -} CMD_TX_PWR_T, *P_CMD_TX_PWR_T; - -typedef struct _CMD_5G_PWR_OFFSET_T { - INT_8 cOffsetBand0; /* 4.915-4.980G */ - INT_8 cOffsetBand1; /* 5.000-5.080G */ - INT_8 cOffsetBand2; /* 5.160-5.180G */ - INT_8 cOffsetBand3; /* 5.200-5.280G */ - INT_8 cOffsetBand4; /* 5.300-5.340G */ - INT_8 cOffsetBand5; /* 5.500-5.580G */ - INT_8 cOffsetBand6; /* 5.600-5.680G */ - INT_8 cOffsetBand7; /* 5.700-5.825G */ -} CMD_5G_PWR_OFFSET_T, *P_CMD_5G_PWR_OFFSET_T; - -typedef struct _CMD_PWR_PARAM_T { - UINT_32 au4Data[28]; - UINT_32 u4RefValue1; - UINT_32 u4RefValue2; -} CMD_PWR_PARAM_T, *P_CMD_PWR_PARAM_T; - - -typedef struct _CMD_PHY_PARAM_T { - UINT_8 aucData[144]; /* eFuse content */ -} CMD_PHY_PARAM_T, *P_CMD_PHY_PARAM_T; - -typedef struct _CMD_AUTO_POWER_PARAM_T { - UINT_8 ucType; /* 0: Disable 1: Enalbe 0x10: Change paramters */ - UINT_8 ucNetTypeIndex; - UINT_8 aucReserved[2]; - UINT_8 aucLevelRcpiTh[3]; - UINT_8 aucReserved2[1]; - INT_8 aicLevelPowerOffset[3]; /* signed, in unit of 0.5dBm */ - UINT_8 aucReserved3[1]; - UINT_8 aucReserved4[8]; -} CMD_AUTO_POWER_PARAM_T, *P_CMD_AUTO_POWER_PARAM_T; - - -typedef struct _EVENT_CH_PRIVILEGE_T { - UINT_8 ucNetTypeIndex; - UINT_8 ucTokenID; - UINT_8 ucStatus; - UINT_8 ucPrimaryChannel; - UINT_8 ucRfSco; - UINT_8 ucRfBand; - UINT_8 ucReqType; - UINT_8 ucReserved; - UINT_32 u4GrantInterval; /* In unit of ms */ -} EVENT_CH_PRIVILEGE_T, *P_EVENT_CH_PRIVILEGE_T; - -typedef struct _EVENT_BSS_BEACON_TIMEOUT_T { - UINT_8 ucNetTypeIndex; - UINT_8 aucReserved[3]; -} EVENT_BSS_BEACON_TIMEOUT_T, *P_EVENT_BSS_BEACON_TIMEOUT_T; - -typedef struct _EVENT_STA_AGING_TIMEOUT_T { - UINT_8 ucStaRecIdx; - UINT_8 aucReserved[3]; -} EVENT_STA_AGING_TIMEOUT_T, *P_EVENT_STA_AGING_TIMEOUT_T; - -typedef struct _EVENT_NOA_TIMING_T { - UINT_8 fgIsInUse; /* Indicate if this entry is in use or not */ - UINT_8 ucCount; /* Count */ - UINT_8 aucReserved[2]; - - UINT_32 u4Duration; /* Duration */ - UINT_32 u4Interval; /* Interval */ - UINT_32 u4StartTime; /* Start Time */ -} EVENT_NOA_TIMING_T, *P_EVENT_NOA_TIMING_T; - -typedef struct _EVENT_UPDATE_NOA_PARAMS_T { - UINT_8 ucNetTypeIndex; - UINT_8 aucReserved[2]; - UINT_8 fgEnableOppPS; - UINT_16 u2CTWindow; - - UINT_8 ucNoAIndex; - UINT_8 ucNoATimingCount; /* Number of NoA Timing */ - EVENT_NOA_TIMING_T arEventNoaTiming[8/*P2P_MAXIMUM_NOA_COUNT*/]; -} EVENT_UPDATE_NOA_PARAMS_T, *P_EVENT_UPDATE_NOA_PARAMS_T; - -typedef struct _EVENT_AP_OBSS_STATUS_T { - UINT_8 ucNetTypeIndex; - UINT_8 ucObssErpProtectMode; - UINT_8 ucObssHtProtectMode; - UINT_8 ucObssGfOperationMode; - UINT_8 ucObssRifsOperationMode; - UINT_8 ucObssBeaconForcedTo20M; - UINT_8 aucReserved[2]; -} EVENT_AP_OBSS_STATUS_T, *P_EVENT_AP_OBSS_STATUS_T; - -typedef struct _CMD_EDGE_TXPWR_LIMIT_T { - INT_8 cBandEdgeMaxPwrCCK; - INT_8 cBandEdgeMaxPwrOFDM20; - INT_8 cBandEdgeMaxPwrOFDM40; - INT_8 cReserved; -} CMD_EDGE_TXPWR_LIMIT_T, *P_CMD_EDGE_TXPWR_LIMIT_T; - -typedef struct _CMD_SET_DEVICE_MODE_T { - UINT_16 u2ChipID; - UINT_16 u2Mode; -} CMD_SET_DEVICE_MODE_T, *P_CMD_SET_DEVICE_MODE_T; - - -#if CFG_SUPPORT_RDD_TEST_MODE -typedef struct _CMD_RDD_CH_T { - UINT_8 ucRddTestMode; - UINT_8 ucRddShutCh; - UINT_8 ucRddStartCh; - UINT_8 ucRddStopCh; - UINT_8 ucRddDfs; - UINT_8 ucReserved; - UINT_8 ucReserved1; - UINT_8 ucReserved2; -} CMD_RDD_CH_T, *P_CMD_RDD_CH_T; - -typedef struct _EVENT_RDD_STATUS_T { - UINT_8 ucRddStatus; - UINT_8 aucReserved[3]; -} EVENT_RDD_STATUS_T, *P_EVENT_RDD_STATUS_T; -#endif - -typedef struct _CMD_SET_TXPWR_CTRL_T{ - INT_8 c2GLegacyStaPwrOffset; /* Unit: 0.5dBm, default: 0*/ - INT_8 c2GHotspotPwrOffset; - INT_8 c2GP2pPwrOffset; - INT_8 c2GBowPwrOffset; - INT_8 c5GLegacyStaPwrOffset; /* Unit: 0.5dBm, default: 0*/ - INT_8 c5GHotspotPwrOffset; - INT_8 c5GP2pPwrOffset; - INT_8 c5GBowPwrOffset; - UINT_8 ucConcurrencePolicy; /* TX power policy when concurrence - in the same channel - 0: Highest power has priority - 1: Lowest power has priority */ - INT_8 acReserved1[3]; /* Must be zero */ - - /* Power limit by channel for all data rates */ - INT_8 acTxPwrLimit2G[14]; /* Channel 1~14, Unit: 0.5dBm*/ - INT_8 acTxPwrLimit5G[4]; /* UNII 1~4 */ - INT_8 acReserved2[2]; /* Must be zero */ -} CMD_SET_TXPWR_CTRL_T, *P_CMD_SET_TXPWR_CTRL_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -VOID -nicCmdEventQueryMcrRead ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryMemDump ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQuerySwCtrlRead ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - - - -VOID -nicCmdEventQueryRfTestATInfo( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventSetCommon ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventSetDisassociate ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventSetIpAddress ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryLinkQuality( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryLinkSpeed( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryStatistics( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventEnterRfTest( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventLeaveRfTest( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryAddress( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryMcastAddr( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryEepromRead( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventSetMediaStreamMode( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -/* Statistics responder */ -VOID -nicCmdEventQueryXmitOk( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryRecvOk( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryXmitError( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryRecvError( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryRecvNoBuffer( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryRecvCrcError( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryRecvErrorAlignment( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryXmitOneCollision( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryXmitMoreCollisions( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -nicCmdEventQueryXmitMaxCollisions( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -/* for timeout check */ -VOID -nicOidCmdTimeoutCommon ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ); - -VOID -nicCmdTimeoutCommon ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ); - -VOID -nicOidCmdEnterRFTestTimeout ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _NIC_CMD_EVENT_H */ - diff --git a/drivers/net/wireless/mt5931/include/nic_init_cmd_event.h b/drivers/net/wireless/mt5931/include/nic_init_cmd_event.h deleted file mode 100755 index 33886c98045a..000000000000 --- a/drivers/net/wireless/mt5931/include/nic_init_cmd_event.h +++ /dev/null @@ -1,180 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic_init_cmd_event.h#1 $ -*/ - -/*! \file "nic_init_cmd_event.h" - \brief This file contains the declairation file of the WLAN initialization routines - for MediaTek Inc. 802.11 Wireless LAN Adapters. -*/ - - - -/* -** $Log: nic_init_cmd_event.h $ - * - * 09 26 2011 cp.wu - * [WCXRP00001011] [MT6628 Wi-Fi] Firmware Download Agent: make CRC validation as an optional feature - * add definition for disabling CRC32 validation (for MT6628 only) - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 03 12 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add two option for ACK and ENCRYPTION for firmware download - * - * 03 01 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add command/event definitions for initial states - * - * 02 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement host-side firmware download logic - * - * 02 08 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * prepare for implementing fw download logic - * -*/ -#ifndef _NIC_INIT_CMD_EVENT_H -#define _NIC_INIT_CMD_EVENT_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -#include "gl_typedef.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define INIT_CMD_STATUS_SUCCESS 0 -#define INIT_CMD_STATUS_REJECTED_INVALID_PARAMS 1 -#define INIT_CMD_STATUS_REJECTED_CRC_ERROR 2 -#define INIT_CMD_STATUS_REJECTED_DECRYPT_FAIL 3 -#define INIT_CMD_STATUS_UNKNOWN 4 - -#define EVENT_HDR_SIZE OFFSET_OF(WIFI_EVENT_T, aucBuffer[0]) - -typedef enum _ENUM_INIT_CMD_ID { - INIT_CMD_ID_DOWNLOAD_BUF = 1, - INIT_CMD_ID_WIFI_START, - INIT_CMD_ID_ACCESS_REG, - INIT_CMD_ID_QUERY_PENDING_ERROR -} ENUM_INIT_CMD_ID, *P_ENUM_INIT_CMD_ID; - -typedef enum _ENUM_INIT_EVENT_ID { - INIT_EVENT_ID_CMD_RESULT = 1, - INIT_EVENT_ID_ACCESS_REG, - INIT_EVENT_ID_PENDING_ERROR -} ENUM_INIT_EVENT_ID, *P_ENUM_INIT_EVENT_ID; - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef UINT_8 CMD_STATUS; - -// commands -typedef struct _INIT_WIFI_CMD_T { - UINT_8 ucCID; - UINT_8 ucSeqNum; - UINT_16 u2Reserved; - UINT_8 aucBuffer[0]; -} INIT_WIFI_CMD_T, *P_INIT_WIFI_CMD_T; - -typedef struct _INIT_HIF_TX_HEADER_T { - UINT_16 u2TxByteCount; - UINT_8 ucEtherTypeOffset; - UINT_8 ucCSflags; - INIT_WIFI_CMD_T rInitWifiCmd; -} INIT_HIF_TX_HEADER_T, *P_INIT_HIF_TX_HEADER_T; - -#define DOWNLOAD_BUF_ENCRYPTION_MODE BIT(0) -#define DOWNLOAD_BUF_NO_CRC_CHECKING BIT(30) -#define DOWNLOAD_BUF_ACK_OPTION BIT(31) -typedef struct _INIT_CMD_DOWNLOAD_BUF { - UINT_32 u4Address; - UINT_32 u4Length; - UINT_32 u4CRC32; - UINT_32 u4DataMode; - UINT_8 aucBuffer[0]; -} INIT_CMD_DOWNLOAD_BUF, *P_INIT_CMD_DOWNLOAD_BUF; - -typedef struct _INIT_CMD_WIFI_START { - UINT_32 u4Override; - UINT_32 u4Address; -} INIT_CMD_WIFI_START, *P_INIT_CMD_WIFI_START; - -typedef struct _INIT_CMD_ACCESS_REG { - UINT_8 ucSetQuery; - UINT_8 aucReserved[3]; - UINT_32 u4Address; - UINT_32 u4Data; -} INIT_CMD_ACCESS_REG, *P_INIT_CMD_ACCESS_REG; - -// Events -typedef struct _INIT_WIFI_EVENT_T { - UINT_16 u2RxByteCount; - UINT_8 ucEID; - UINT_8 ucSeqNum; - UINT_8 aucBuffer[0]; -} INIT_WIFI_EVENT_T, *P_INIT_WIFI_EVENT_T; - -typedef struct _INIT_HIF_RX_HEADER_T { - INIT_WIFI_EVENT_T rInitWifiEvent; -} INIT_HIF_RX_HEADER_T, *P_INIT_HIF_RX_HEADER_T; - -typedef struct _INIT_EVENT_CMD_RESULT { - UINT_8 ucStatus; // 0: success - // 1: rejected by invalid param - // 2: rejected by incorrect CRC - // 3: rejected by decryption failure - // 4: unknown CMD - UINT_8 aucReserved[3]; -} INIT_EVENT_CMD_RESULT, *P_INIT_EVENT_CMD_RESULT, INIT_EVENT_PENDING_ERROR, *P_INIT_EVENT_PENDING_ERROR; - -typedef struct _INIT_EVENT_ACCESS_REG { - UINT_32 u4Address; - UINT_32 u4Data; -} INIT_EVENT_ACCESS_REG, *P_INIT_EVENT_ACCESS_REG; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _NIC_INIT_CMD_EVENT_H */ - diff --git a/drivers/net/wireless/mt5931/include/p2p_precomp.h b/drivers/net/wireless/mt5931/include/p2p_precomp.h deleted file mode 100755 index 892b5b714baf..000000000000 --- a/drivers/net/wireless/mt5931/include/p2p_precomp.h +++ /dev/null @@ -1,225 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/p2p_precomp.h#1 $ -*/ - -/*! \file p2p_precomp.h - \brief Collection of most compiler flags for p2p driver are described here. - - In this file we collect all compiler flags and detail the p2p driver behavior if - enable/disable such switch or adjust numeric parameters. -*/ - - - -#ifndef _P2P_PRECOMP_H -#define _P2P_PRECOMP_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "gl_os.h" // Include "config.h" - -#include "gl_p2p_os.h" - -#include "debug.h" - -#include "link.h" -#include "queue.h" - - -/*------------------------------------------------------------------------------ - * .\include\mgmt - *------------------------------------------------------------------------------ - */ -#include "wlan_typedef.h" - - -#include "mac.h" - -/* Dependency: mac.h (MAC_ADDR_LEN) */ -#include "wlan_def.h" - -#include "roaming_fsm.h" - - -/*------------------------------------------------------------------------------ - * .\include\nic - *------------------------------------------------------------------------------ - */ -/* Dependency: wlan_def.h (ENUM_NETWORK_TYPE_T) */ -#include "cmd_buf.h" - - -/* Dependency: mac.h (MAC_ADDR_LEN) */ -#include "nic_cmd_event.h" - - -/* Dependency: nic_cmd_event.h (P_EVENT_CONNECTION_STATUS) */ -#include "nic.h" - -#include "nic_init_cmd_event.h" - -#include "hif_rx.h" -#include "hif_tx.h" - -#include "nic_tx.h" - -/* Dependency: hif_rx.h (P_HIF_RX_HEADER_T) */ -#include "nic_rx.h" - -#include "que_mgt.h" - -#if CFG_ENABLE_WIFI_DIRECT -#include "p2p_typedef.h" -#include "p2p_cmd_buf.h" -#include "p2p_nic_cmd_event.h" -#include "p2p_mac.h" -#include "p2p_nic.h" -#endif - - -/*------------------------------------------------------------------------------ - * .\include\mgmt - *------------------------------------------------------------------------------ - */ - -#include "hem_mbox.h" - -#include "scan.h" -#include "bss.h" - -#include "wlan_lib.h" -#include "wlan_oid.h" -#include "wlan_bow.h" - -#include "wlan_p2p.h" - - - - -#include "hal.h" - -#if defined(MT6620) - #include "mt6620_reg.h" -#elif defined(MT5931) - #include "mt5931_reg.h" -#endif - -#include "rlm.h" -#include "rlm_domain.h" -#include "rlm_protection.h" -#include "rlm_obss.h" -#include "rate.h" - - -#include "aa_fsm.h" - -#include "cnm_timer.h" - -#if CFG_ENABLE_BT_OVER_WIFI -#include "bow.h" -#include "bow_fsm.h" -#endif - -#include "pwr_mgt.h" - - -#include "cnm.h" -/* Dependency: aa_fsm.h (ENUM_AA_STATE_T), p2p_fsm.h (WPS_ATTRI_MAX_LEN_DEVICE_NAME) */ -#include "cnm_mem.h" -#include "cnm_scan.h" - -#include "p2p_rlm_obss.h" -#include "p2p_bss.h" -#include "p2p.h" -/* Dependency: cnm_timer.h (TIMER_T) */ -#include "p2p_fsm.h" -#include "p2p_scan.h" -#include "p2p_state.h" -#include "p2p_func.h" -#include "p2p_rlm.h" -#include "p2p_assoc.h" -#include "p2p_ie.h" - - -#include "privacy.h" - -#include "mib.h" - -#include "auth.h" -#include "assoc.h" - - -#include "ais_fsm.h" - - -#include "adapter.h" - - -#include "que_mgt.h" -#include "rftest.h" - - -#if CFG_RSN_MIGRATION -#include "rsn.h" -#include "sec_fsm.h" -#endif - -#if CFG_SUPPORT_WAPI -#include "wapi.h" -#endif - -/*------------------------------------------------------------------------------ - * NVRAM structure - *------------------------------------------------------------------------------ - */ -#include "CFG_Wifi_File.h" - -#include "gl_p2p_kal.h" - - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /*_P2P_PRECOMP_H */ - - - diff --git a/drivers/net/wireless/mt5931/include/p2p_typedef.h b/drivers/net/wireless/mt5931/include/p2p_typedef.h deleted file mode 100755 index c8aa47fb6297..000000000000 --- a/drivers/net/wireless/mt5931/include/p2p_typedef.h +++ /dev/null @@ -1,278 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/p2p_typedef.h#1 $ -*/ - -/*! \file p2p_typedef.h - \brief Declaration of data type and return values of internal protocol stack. - - In this file we declare the data type and return values which will be exported - to all MGMT Protocol Stack. -*/ - - - - -#ifndef _P2P_TYPEDEF_H -#define _P2P_TYPEDEF_H - -#if CFG_ENABLE_WIFI_DIRECT - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/* -* type definition of pointer to p2p structure -*/ -//typedef struct _GL_P2P_INFO_T GL_P2P_INFO_T, *P_GL_P2P_INFO_T; -typedef struct _P2P_INFO_T P2P_INFO_T, *P_P2P_INFO_T; - -typedef struct _P2P_FSM_INFO_T P2P_FSM_INFO_T, *P_P2P_FSM_INFO_T; - -typedef struct _P2P_CONNECTION_SETTINGS_T P2P_CONNECTION_SETTINGS_T, *P_P2P_CONNECTION_SETTINGS_T; - - -/* Type definition for function pointer to p2p function*/ -typedef BOOLEAN (*P2P_LAUNCH)( - P_GLUE_INFO_T prGlueInfo - ); - -typedef BOOLEAN (*P2P_REMOVE)( - P_GLUE_INFO_T prGlueInfo, - BOOLEAN fgIsWlanLaunched - ); - -typedef BOOLEAN (*KAL_P2P_GET_CIPHER)( - IN P_GLUE_INFO_T prGlueInfo - ); - -typedef BOOLEAN (*KAL_P2P_GET_TKIP_CIPHER)( - IN P_GLUE_INFO_T prGlueInfo - ); - -typedef BOOLEAN (*KAL_P2P_GET_CCMP_CIPHER)( - IN P_GLUE_INFO_T prGlueInfo - ); - -typedef BOOLEAN (*KAL_P2P_GET_WSC_MODE)( - IN P_GLUE_INFO_T prGlueInfo - ); - -typedef struct net_device* (*KAL_P2P_GET_DEV_HDLR)( - P_GLUE_INFO_T prGlueInfo - ); - -typedef VOID (*KAL_P2P_SET_MULTICAST_WORK_ITEM) ( - P_GLUE_INFO_T prGlueInfo - ); - -typedef VOID (*P2P_NET_REGISTER) ( - P_GLUE_INFO_T prGlueInfo - ); - -typedef VOID (*P2P_NET_UNREGISTER) ( - P_GLUE_INFO_T prGlueInfo - ); - -typedef VOID (*KAL_P2P_UPDATE_ASSOC_INFO)( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucFrameBody, - IN UINT_32 u4FrameBodyLen, - IN BOOLEAN fgReassocRequest - ); - -typedef BOOLEAN (*P2P_VALIDATE_AUTH) ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN PP_STA_RECORD_T pprStaRec, - OUT PUINT_16 pu2StatusCode - ); - -typedef BOOLEAN (*P2P_VALIDATE_ASSOC_REQ) ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_16 pu4ControlFlags - ); - -typedef VOID (*P2P_RUN_EVENT_AAA_TX_FAIL) ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -typedef BOOLEAN (*P2P_PARSE_CHECK_FOR_P2P_INFO_ELEM)( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBuf, - OUT PUINT_8 pucOuiType - ); - - -typedef WLAN_STATUS (*P2P_RUN_EVENT_AAA_COMPLETE) ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -typedef VOID (*P2P_PROCESS_EVENT_UPDATE_NOA_PARAM) ( - IN P_ADAPTER_T prAdapter, - UINT_8 ucNetTypeIndex, - P_EVENT_UPDATE_NOA_PARAMS_T prEventUpdateNoaParam - ); - -typedef VOID (*SCAN_P2P_PROCESS_BEACON_AND_PROBE_RESP) ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN P_WLAN_STATUS prStatus, - IN P_BSS_DESC_T prBssDesc, - IN P_WLAN_BEACON_FRAME_T prWlanBeaconFrame - ); - -typedef VOID (*P2P_RX_PUBLIC_ACTION_FRAME) ( - P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - -typedef VOID (*RLM_RSP_GENERATE_OBSS_SCAN_IE) ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ); - -typedef VOID (*RLM_UPDATE_BW_BY_CH_LIST_FOR_AP)( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ); - -typedef VOID (*RLM_PROCESS_PUBLIC_ACTION)( - P_ADAPTER_T prAdapter, - P_SW_RFB_T prSwRfb - ); - -typedef VOID (*RLM_PROCESS_HT_ACTION)( - P_ADAPTER_T prAdapter, - P_SW_RFB_T prSwRfb - ); - -typedef VOID (*RLM_UPDATE_PARAMS_FOR_AP)( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - BOOLEAN fgUpdateBeacon - ); - -typedef VOID (*RLM_HANDLE_OBSS_STATUS_EVENT_PKT) ( - P_ADAPTER_T prAdapter, - P_EVENT_AP_OBSS_STATUS_T prObssStatus - ); - - -typedef BOOLEAN (*P2P_FUNC_VALIDATE_PROBE_REQ) ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_32 pu4ControlFlags - ); - -typedef VOID (*RLM_BSS_INIT_FOR_AP)( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ); - -typedef UINT_32 (*P2P_GET_PROB_RSP_IE_TABLE_SIZE)( - VOID - ); - -typedef PUINT_8 (*P2P_BUILD_REASSOC_REQ_FRAME_COMMON_IES) ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN PUINT_8 pucBuffer - ); - - -typedef VOID (*P2P_FUNC_DISCONNECT) ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN BOOLEAN fgSendDeauth, - IN UINT_16 u2ReasonCode - ); - -typedef VOID (*P2P_FSM_RUN_EVENT_RX_DEAUTH) ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prSwRfb - ); - -typedef VOID (*P2P_FSM_RUN_EVENT_RX_DISASSOC) ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prSwRfb - ); - -typedef BOOLEAN (*P2P_FUN_IS_AP_MODE) ( - IN P_P2P_FSM_INFO_T prP2pFsmInfo - ); - -typedef VOID (*P2P_FSM_RUN_EVENT_BEACON_TIMEOUT) ( - IN P_ADAPTER_T prAdapter - ); - - -typedef VOID (*P2P_FUNC_STORE_ASSOC_RSP_IE_BUFFER) ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); - - -typedef VOID (*P2P_GENERATE_P2P_IE) ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - -typedef UINT_32 (*P2P_CALCULATE_P2P_IE_LEN) ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ); - - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#endif /*CFG_ENABLE_WIFI_DIRECT*/ - -#endif /* _P2P_TYPEDEF_H */ - - diff --git a/drivers/net/wireless/mt5931/include/precomp.h b/drivers/net/wireless/mt5931/include/precomp.h deleted file mode 100755 index 0e5a8e372076..000000000000 --- a/drivers/net/wireless/mt5931/include/precomp.h +++ /dev/null @@ -1,380 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/precomp.h#2 $ -*/ - -/*! \file precomp.h - \brief Collection of most compiler flags are described here. - - In this file we collect all compiler flags and detail the driver behavior if - enable/disable such switch or adjust numeric parameters. -*/ - - - -/* -** $Log: precomp.h $ - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 01 05 2012 tsaiyuan.hsu - * [WCXRP00001157] [MT6620 Wi-Fi][FW][DRV] add timing measurement support for 802.11v - * add timing measurement support for 802.11v. - * - * 08 15 2011 cp.wu - * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree - * add MT6628-specific definitions. - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 03 15 2011 eddie.chen - * [WCXRP00000554] [MT6620 Wi-Fi][DRV] Add sw control debug counter - * Add sw debug counter for QM. - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * - * 12 13 2010 cp.wu - * [WCXRP00000260] [MT6620 Wi-Fi][Driver][Firmware] Create V1.1 branch for both firmware and driver - * create branch for Wi-Fi driver v1.1 - * - * 10 07 2010 cp.wu - * [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection - * add firmware download for MT5931. - * - * 10 05 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * 1) add NVRAM access API - * 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option) - * 3) add OID implementation for NVRAM read/write service - * - * 09 21 2010 kevin.huang - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * Isolate P2P related function for Hardware Software Bundle - * - * 09 14 2010 chinghwa.yu - * NULL - * Fix BOW_FSM_INFO_T dependence. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 07 20 2010 wh.su - * - * adding the wapi code. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Check draft RLM code for HT cap - * - * 07 01 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Modify CNM message handler for new flow - * - * 06 28 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * 1st draft code for RLM module - * - * 06 19 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * consdier the concurrent network setting. - * - * 06 18 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * migration the security related function from firmware. - * - * 06 18 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * migration from MT6620 firmware. - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add hem_mbox.c and cnm_mem.h (but disabled some feature) for further migration - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge cnm_scan.h and hem_mbox.h - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge wifi_var.h, precomp.h, cnm_timer.h (data type only) - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * 1) add timeout handler mechanism for pending command packets - * 2) add p2p add/removal key - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * * * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * * * * * * * * * 2) command sequence number is now increased atomically - * * * * * * * * * * * 3) private data could be hold and taken use for other purpose - * - * 03 16 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * build up basic data structure and definitions to support BT-over-WiFi - * - * 02 08 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * prepare for implementing fw download logic - * - * 01 27 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * . -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-12-08 11:30:58 GMT mtk02752 -** add rftest.h for implementing RF test mode in driver land -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-11-23 22:02:00 GMT mtk02468 -** Added que_mgt.h -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-10-13 21:58:36 GMT mtk01084 -** update for new macro define -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-21 09:40:11 GMT mtk01461 -** Add nic_cmd_event.h -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-17 20:00:26 GMT mtk01461 -** Add cmd_buf.h -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-19 18:32:44 GMT mtk01084 -** update for basic power management functions -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-16 09:08:25 GMT mtk01461 -** Update TX PATH API -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:11:38 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _PRECOMP_H -#define _PRECOMP_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "gl_os.h" // Include "config.h" - -#if CFG_ENABLE_WIFI_DIRECT -#include "gl_p2p_os.h" -#endif - -#include "debug.h" - -#include "link.h" -#include "queue.h" - - -/*------------------------------------------------------------------------------ - * .\include\mgmt - *------------------------------------------------------------------------------ - */ -#include "wlan_typedef.h" - -#include "mac.h" - -/* Dependency: mac.h (MAC_ADDR_LEN) */ -#include "wlan_def.h" - -#if CFG_SUPPORT_SWCR -#include "swcr.h" -#endif - -/*------------------------------------------------------------------------------ - * .\include\nic - *------------------------------------------------------------------------------ - */ -/* Dependency: wlan_def.h (ENUM_NETWORK_TYPE_T) */ -#include "cmd_buf.h" - -/* Dependency: mac.h (MAC_ADDR_LEN) */ -#include "nic_cmd_event.h" - -/* Dependency: nic_cmd_event.h (P_EVENT_CONNECTION_STATUS) */ -#include "nic.h" - -#include "nic_init_cmd_event.h" - -#include "hif_rx.h" -#include "hif_tx.h" - -#include "nic_tx.h" - -/* Dependency: hif_rx.h (P_HIF_RX_HEADER_T) */ -#include "nic_rx.h" - -#include "que_mgt.h" - -#if CFG_ENABLE_WIFI_DIRECT -#include "p2p_typedef.h" -#include "p2p_cmd_buf.h" -#include "p2p_nic_cmd_event.h" -#include "p2p_mac.h" -#include "p2p_nic.h" -#endif - - -/*------------------------------------------------------------------------------ - * .\include\mgmt - *------------------------------------------------------------------------------ - */ - -#include "hem_mbox.h" - -#include "scan.h" -#include "bss.h" - -#include "wlan_lib.h" -#include "wlan_oid.h" -#include "wlan_bow.h" - -#if CFG_ENABLE_WIFI_DIRECT -#include "wlan_p2p.h" -#endif - -#include "hal.h" - -#if defined(MT6620) - #include "mt6620_reg.h" -#elif defined(MT5931) - #include "mt5931_reg.h" -#elif defined(MT6628) - #include "mt6628_reg.h" -#endif - -#include "rlm.h" -#include "rlm_domain.h" -#include "rlm_protection.h" -#include "rlm_obss.h" -#include "rate.h" -#if CFG_SUPPORT_802_11V -#include "wnm.h" -#endif - -#include "aa_fsm.h" - -#include "cnm_timer.h" - - -#if CFG_ENABLE_BT_OVER_WIFI -#include "bow.h" -#include "bow_fsm.h" -#endif - -#include "pwr_mgt.h" - - -#include "cnm.h" -/* Dependency: aa_fsm.h (ENUM_AA_STATE_T), p2p_fsm.h (WPS_ATTRI_MAX_LEN_DEVICE_NAME) */ -#include "cnm_mem.h" -#include "cnm_scan.h" - - -#if CFG_ENABLE_WIFI_DIRECT -#include "p2p_rlm_obss.h" -#include "p2p_bss.h" -#include "p2p.h" -#include "p2p_fsm.h" -#include "p2p_scan.h" -#include "p2p_state.h" -#include "p2p_func.h" -#include "p2p_rlm.h" -#include "p2p_assoc.h" -#include "p2p_ie.h" -#endif - -#include "privacy.h" - -#include "mib.h" - -#include "auth.h" -#include "assoc.h" - -#if CFG_SUPPORT_ROAMING -#include "roaming_fsm.h" -#endif /* CFG_SUPPORT_ROAMING */ - -#include "ais_fsm.h" - - -#include "adapter.h" - - -#include "que_mgt.h" -#include "rftest.h" - - -#if CFG_RSN_MIGRATION -#include "rsn.h" -#include "sec_fsm.h" -#endif - -#if CFG_SUPPORT_WAPI -#include "wapi.h" -#endif - -/*------------------------------------------------------------------------------ - * NVRAM structure - *------------------------------------------------------------------------------ - */ -#include "CFG_Wifi_File.h" - -#if CFG_ENABLE_WIFI_DIRECT -#include "gl_p2p_kal.h" -#endif - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _PRECOMP_H */ - - diff --git a/drivers/net/wireless/mt5931/include/pwr_mgt.h b/drivers/net/wireless/mt5931/include/pwr_mgt.h deleted file mode 100755 index 4819de0fd9bb..000000000000 --- a/drivers/net/wireless/mt5931/include/pwr_mgt.h +++ /dev/null @@ -1,147 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/pwr_mgt.h#1 $ -*/ - -/*! \file "pwr_mgt.h" - \brief In this file we define the STATE and EVENT for Power Management FSM. - - The SCAN FSM is responsible for performing SCAN behavior when the Arbiter enter - ARB_STATE_SCAN. The STATE and EVENT for SCAN FSM are defined here with detail - description. -*/ - - - -/* -** $Log: pwr_mgt.h $ - * - * 07 09 2010 george.huang - * - * [WPD00001556] Migrate PM variables from FW to driver: for composing QoS Info - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 04 20 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * don't need SPIN_LOCK_PWR_CTRL anymore, it will raise IRQL - * and cause SdBusSubmitRequest running at DISPATCH_LEVEL as well. - - * - * 03 25 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * firmware download load adress & start address are now configured from config.h - * * * due to the different configurations on FPGA and ASIC -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-12-10 16:39:10 GMT mtk02752 -** disable PM macros temporally -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-10-29 19:48:37 GMT mtk01084 -** temp remove power management macro -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-08 16:51:11 GMT mtk01084 -** update for power management control macro -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-04-03 14:59:58 GMT mtk01426 -** Add #if CFG_HIF_LOOPBACK_PRETEST -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-23 16:53:10 GMT mtk01084 -** modify ACQUIRE_POWER_CONTROL_FROM_PM() and RECLAIM_POWER_CONTROL_TO_PM() macro -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-19 18:32:47 GMT mtk01084 -** update for basic power management functions -** \main\maintrunk.MT6620WiFiDriver_Prj\1 2009-03-19 15:05:20 GMT mtk01084 -** Initial version -** -*/ - -#ifndef _PWR_MGT_H -#define _PWR_MGT_H -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define PM_UAPSD_AC0 (BIT(0)) -#define PM_UAPSD_AC1 (BIT(1)) -#define PM_UAPSD_AC2 (BIT(2)) -#define PM_UAPSD_AC3 (BIT(3)) - -#define PM_UAPSD_ALL (PM_UAPSD_AC0 | PM_UAPSD_AC1 | PM_UAPSD_AC2 | PM_UAPSD_AC3) -#define PM_UAPSD_NONE 0 - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef struct _PM_PROFILE_SETUP_INFO_T { - /* Profile setup */ - UINT_8 ucBmpDeliveryAC; /* 0: AC_BE, 1: AC_BK, 2: AC_VI, 3: AC_VO */ - UINT_8 ucBmpTriggerAC; /* 0: AC_BE, 1: AC_BK, 2: AC_VI, 3: AC_VO */ - - UINT_8 ucUapsdSp; /* Number of triggered packets in UAPSD */ - -} PM_PROFILE_SETUP_INFO_T, *P_PM_PROFILE_SETUP_INFO_T; - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -#if !CFG_ENABLE_FULL_PM - #define ACQUIRE_POWER_CONTROL_FROM_PM(_prAdapter) - #define RECLAIM_POWER_CONTROL_TO_PM(_prAdapter, _fgEnableGINT_in_IST) -#else - #define ACQUIRE_POWER_CONTROL_FROM_PM(_prAdapter) \ - { \ - if (_prAdapter->fgIsFwOwn) { \ - nicpmSetDriverOwn(_prAdapter); \ - } \ - /* Increase Block to Enter Low Power Semaphore count */ \ - GLUE_INC_REF_CNT(_prAdapter->u4PwrCtrlBlockCnt); \ - } - - #define RECLAIM_POWER_CONTROL_TO_PM(_prAdapter, _fgEnableGINT_in_IST) \ - { \ - ASSERT(_prAdapter->u4PwrCtrlBlockCnt != 0); \ - /* Decrease Block to Enter Low Power Semaphore count */ \ - GLUE_DEC_REF_CNT(_prAdapter->u4PwrCtrlBlockCnt); \ - if (_prAdapter->fgWiFiInSleepyState && (_prAdapter->u4PwrCtrlBlockCnt == 0)) { \ - nicpmSetFWOwn(_prAdapter, _fgEnableGINT_in_IST); \ - } \ - } -#endif - - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _PWR_MGT_H */ - diff --git a/drivers/net/wireless/mt5931/include/queue.h b/drivers/net/wireless/mt5931/include/queue.h deleted file mode 100755 index a7773e9d592d..000000000000 --- a/drivers/net/wireless/mt5931/include/queue.h +++ /dev/null @@ -1,189 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/queue.h#1 $ -*/ - -/*! \file queue.h - \brief Definition for singly queue operations. - - In this file we define the singly queue data structure and its - queue operation MACROs. -*/ - - - -/* -** $Log: queue.h $ - * - * 07 16 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * bugfix for SCN migration - * 1) modify QUEUE_CONCATENATE_QUEUES() so it could be used to concatence with an empty queue - * 2) before AIS issues scan request, network(BSS) needs to be activated first - * 3) only invoke COPY_SSID when using specified SSID for scan - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 04 20 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * . -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:11:46 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _QUEUE_H -#define _QUEUE_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "gl_typedef.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -/* Singly Queue Structures - Entry Part */ -typedef struct _QUE_ENTRY_T { - struct _QUE_ENTRY_T *prNext; - struct _QUE_ENTRY_T *prPrev; /* For Rx buffer reordering used only */ -} QUE_ENTRY_T, *P_QUE_ENTRY_T; - -/* Singly Queue Structures - Queue Part */ -typedef struct _QUE_T { - P_QUE_ENTRY_T prHead; - P_QUE_ENTRY_T prTail; - UINT_32 u4NumElem; -} QUE_T, *P_QUE_T; - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -#define QUEUE_INITIALIZE(prQueue) \ - { \ - (prQueue)->prHead = (P_QUE_ENTRY_T)NULL; \ - (prQueue)->prTail = (P_QUE_ENTRY_T)NULL; \ - (prQueue)->u4NumElem = 0; \ - } - -#define QUEUE_IS_EMPTY(prQueue) (((P_QUE_T)(prQueue))->prHead == (P_QUE_ENTRY_T)NULL) - -#define QUEUE_IS_NOT_EMPTY(prQueue) ((prQueue)->u4NumElem > 0) - -#define QUEUE_GET_HEAD(prQueue) ((prQueue)->prHead) - -#define QUEUE_GET_TAIL(prQueue) ((prQueue)->prTail) - -#define QUEUE_GET_NEXT_ENTRY(prQueueEntry) ((prQueueEntry)->prNext) - -#define QUEUE_INSERT_HEAD(prQueue, prQueueEntry) \ - { \ - ASSERT(prQueue); \ - ASSERT(prQueueEntry); \ - (prQueueEntry)->prNext = (prQueue)->prHead; \ - (prQueue)->prHead = (prQueueEntry); \ - if ((prQueue)->prTail == (P_QUE_ENTRY_T)NULL) { \ - (prQueue)->prTail = (prQueueEntry); \ - } \ - ((prQueue)->u4NumElem)++; \ - } - -#define QUEUE_INSERT_TAIL(prQueue, prQueueEntry) \ - { \ - ASSERT(prQueue); \ - ASSERT(prQueueEntry); \ - (prQueueEntry)->prNext = (P_QUE_ENTRY_T)NULL; \ - if ((prQueue)->prTail) { \ - ((prQueue)->prTail)->prNext = (prQueueEntry); \ - } else { \ - (prQueue)->prHead = (prQueueEntry); \ - } \ - (prQueue)->prTail = (prQueueEntry); \ - ((prQueue)->u4NumElem)++; \ - } - -/* NOTE: We assume the queue entry located at the beginning of "prQueueEntry Type", - * so that we can cast the queue entry to other data type without doubts. - * And this macro also decrease the total entry count at the same time. - */ -#define QUEUE_REMOVE_HEAD(prQueue, prQueueEntry, _P_TYPE) \ - { \ - ASSERT(prQueue); \ - prQueueEntry = (_P_TYPE)((prQueue)->prHead); \ - if (prQueueEntry) { \ - (prQueue)->prHead = ((P_QUE_ENTRY_T)(prQueueEntry))->prNext; \ - if ((prQueue)->prHead == (P_QUE_ENTRY_T)NULL){ \ - (prQueue)->prTail = (P_QUE_ENTRY_T)NULL; \ - } \ - ((P_QUE_ENTRY_T)(prQueueEntry))->prNext = (P_QUE_ENTRY_T)NULL; \ - ((prQueue)->u4NumElem)--; \ - } \ - } - -#define QUEUE_MOVE_ALL(prDestQueue, prSrcQueue) \ - { \ - ASSERT(prDestQueue); \ - ASSERT(prSrcQueue); \ - *(P_QUE_T)prDestQueue = *(P_QUE_T)prSrcQueue; \ - QUEUE_INITIALIZE(prSrcQueue); \ - } - -#define QUEUE_CONCATENATE_QUEUES(prDestQueue, prSrcQueue) \ - { \ - ASSERT(prDestQueue); \ - ASSERT(prSrcQueue); \ - if (prSrcQueue->u4NumElem > 0) { \ - if ((prDestQueue)->prTail) { \ - ((prDestQueue)->prTail)->prNext = (prSrcQueue)->prHead; \ - } else { \ - (prDestQueue)->prHead = (prSrcQueue)->prHead; \ - } \ - (prDestQueue)->prTail = (prSrcQueue)->prTail; \ - ((prDestQueue)->u4NumElem) += ((prSrcQueue)->u4NumElem); \ - QUEUE_INITIALIZE(prSrcQueue); \ - } \ - } - - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _QUEUE_H */ - diff --git a/drivers/net/wireless/mt5931/include/rftest.h b/drivers/net/wireless/mt5931/include/rftest.h deleted file mode 100755 index ae6541dc2e92..000000000000 --- a/drivers/net/wireless/mt5931/include/rftest.h +++ /dev/null @@ -1,317 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/rftest.h#1 $ -*/ - -/*! \file "rftest.h" - \brief definitions for RF Productino test - -*/ - - - -/* -** $Log: rftest.h $ - * - * 12 20 2011 cp.wu - * [WCXRP00001144] [MT6620 Wi-Fi][Driver][Firmware] Add RF_FUNC_ID for exposing device and related version information - * add driver implementations for RF_AT_FUNCID_FW_INFO & RF_AT_FUNCID_DRV_INFO - * to expose version information - * - * 08 04 2010 cp.wu - * NULL - * add an extra parameter to rftestQueryATInfo 'cause it's necessary to pass u4FuncData for query request. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 04 14 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * information buffer for query oid/ioctl is now buffered in prCmdInfo - * * * * instead of glue-layer variable to improve multiple oid/ioctl capability - * - * 12 30 2009 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) According to CMD/EVENT documentation v0.8, - * * * * * * * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used, - * * * * * * * and result is retrieved by get ATInfo instead - * * * * * * * 2) add 4 counter for recording aggregation statistics -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-12-08 17:35:11 GMT mtk02752 -** * comment out RF test which is not supported on MT6620 -** + API decalre for rftest -** \main\maintrunk.MT6620WiFiDriver_Prj\1 2009-12-08 11:29:07 GMT mtk02752 -** definitions for RF test mode -** -*/ -#ifndef _RFTEST_H -#define _RFTEST_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -// Table Version -#define RF_AUTO_TEST_FUNCTION_TABLE_VERSION 0x01000001 - -// Power -#define RF_AT_PARAM_POWER_MASK BITS(0,7) -#define RF_AT_PARAM_POWER_MAX RF_AT_PARAM_POWER_MASK - -// Rate -#define RF_AT_PARAM_RATE_MCS_MASK BIT(31) -#define RF_AT_PARAM_RATE_MASK BITS(0,7) -#define RF_AT_PARAM_RATE_CCK_MAX 3 -#define RF_AT_PARAM_RATE_1M 0 -#define RF_AT_PARAM_RATE_2M 1 -#define RF_AT_PARAM_RATE_5_5M 2 -#define RF_AT_PARAM_RATE_11M 3 -#define RF_AT_PARAM_RATE_6M 4 -#define RF_AT_PARAM_RATE_9M 5 -#define RF_AT_PARAM_RATE_12M 6 -#define RF_AT_PARAM_RATE_18M 7 -#define RF_AT_PARAM_RATE_24M 8 -#define RF_AT_PARAM_RATE_36M 9 -#define RF_AT_PARAM_RATE_48M 10 -#define RF_AT_PARAM_RATE_54M 11 - -// Antenna -#define RF_AT_PARAM_ANTENNA_ID_MASK BITS(0,7) -#define RF_AT_PARAM_ANTENNA_ID_MAX 1 - -// Packet Length -#define RF_AT_PARAM_TX_80211HDR_BYTE_MAX (32) -#define RF_AT_PARAM_TX_80211PAYLOAD_BYTE_MAX (2048) - -#define RF_AT_PARAM_TX_PKTLEN_BYTE_DEFAULT 1024 -#define RF_AT_PARAM_TX_PKTLEN_BYTE_MAX \ - ((UINT_16)(RF_AT_PARAM_TX_80211HDR_BYTE_MAX + RF_AT_PARAM_TX_80211PAYLOAD_BYTE_MAX )) - -// Packet Count -#define RF_AT_PARAM_TX_PKTCNT_DEFAULT 1000 -#define RF_AT_PARAM_TX_PKTCNT_UNLIMITED 0 - -// Packet Interval -#define RF_AT_PARAM_TX_PKT_INTERVAL_US_DEFAULT 50 - -// ALC -#define RF_AT_PARAM_ALC_DISABLE 0 -#define RF_AT_PARAM_ALC_ENABLE 1 - -// TXOP -#define RF_AT_PARAM_TXOP_DEFAULT 0 -#define RF_AT_PARAM_TXOPQUE_QMASK BITS(16,31) -#define RF_AT_PARAM_TXOPQUE_TMASK BITS(0,15) -#define RF_AT_PARAM_TXOPQUE_AC0 (0<<16) -#define RF_AT_PARAM_TXOPQUE_AC1 (1<<16) -#define RF_AT_PARAM_TXOPQUE_AC2 (2<<16) -#define RF_AT_PARAM_TXOPQUE_AC3 (3<<16) -#define RF_AT_PARAM_TXOPQUE_AC4 (4<<16) -#define RF_AT_PARAM_TXOPQUE_QOFFSET 16 - -// Retry Limit -#define RF_AT_PARAM_TX_RETRY_DEFAULT 0 -#define RF_AT_PARAM_TX_RETRY_MAX 6 - -// QoS Queue -#define RF_AT_PARAM_QOSQUE_AC0 0 -#define RF_AT_PARAM_QOSQUE_AC1 1 -#define RF_AT_PARAM_QOSQUE_AC2 2 -#define RF_AT_PARAM_QOSQUE_AC3 3 -#define RF_AT_PARAM_QOSQUE_AC4 4 -#define RF_AT_PARAM_QOSQUE_DEFAULT RF_AT_PARAM_QOSQUE_AC0 - -// Bandwidth -#define RF_AT_PARAM_BANDWIDTH_20MHZ 0 -#define RF_AT_PARAM_BANDWIDTH_40MHZ 1 -#define RF_AT_PARAM_BANDWIDTH_U20_IN_40MHZ 2 -#define RF_AT_PARAM_BANDWIDTH_D20_IN_40MHZ 3 -#define RF_AT_PARAM_BANDWIDTH_DEFAULT RF_AT_PARAM_BANDWIDTH_20MHZ - -// GI (Guard Interval) -#define RF_AT_PARAM_GI_800NS 0 -#define RF_AT_PARAM_GI_400NS 1 -#define RF_AT_PARAM_GI_DEFAULT RF_AT_PARAM_GI_800NS - -// STBC -#define RF_AT_PARAM_STBC_DISABLE 0 -#define RF_AT_PARAM_STBC_ENABLE 1 - -// RIFS -#define RF_AT_PARAM_RIFS_DISABLE 0 -#define RF_AT_PARAM_RIFS_ENABLE 1 - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -// Function ID List -typedef enum _ENUM_RF_AT_FUNCID_T { - RF_AT_FUNCID_VERSION = 0, - RF_AT_FUNCID_COMMAND, - RF_AT_FUNCID_POWER, - RF_AT_FUNCID_RATE, - RF_AT_FUNCID_PREAMBLE, - RF_AT_FUNCID_ANTENNA, - RF_AT_FUNCID_PKTLEN, - RF_AT_FUNCID_PKTCNT, - RF_AT_FUNCID_PKTINTERVAL, - RF_AT_FUNCID_TEMP_COMPEN, - RF_AT_FUNCID_TXOPLIMIT, - RF_AT_FUNCID_ACKPOLICY, - RF_AT_FUNCID_PKTCONTENT, - RF_AT_FUNCID_RETRYLIMIT, - RF_AT_FUNCID_QUEUE, - RF_AT_FUNCID_BANDWIDTH, - RF_AT_FUNCID_GI, - RF_AT_FUNCID_STBC, - RF_AT_FUNCID_CHNL_FREQ, - RF_AT_FUNCID_RIFS, - RF_AT_FUNCID_TRSW_TYPE, - RF_AT_FUNCID_RF_SX_SHUTDOWN, - RF_AT_FUNCID_PLL_SHUTDOWN, - RF_AT_FUNCID_SLOW_CLK_MODE, - RF_AT_FUNCID_ADC_CLK_MODE, - RF_AT_FUNCID_MEASURE_MODE, - RF_AT_FUNCID_VOLT_COMPEN, - RF_AT_FUNCID_DPD_TX_GAIN, - RF_AT_FUNCID_DPD_MODE, - RF_AT_FUNCID_TSSI_MODE, - RF_AT_FUNCID_TX_GAIN_CODE, - RF_AT_FUNCID_TX_PWR_MODE, - - /* Query command */ - RF_AT_FUNCID_TXED_COUNT = 32, - RF_AT_FUNCID_TXOK_COUNT, - RF_AT_FUNCID_RXOK_COUNT, - RF_AT_FUNCID_RXERROR_COUNT, - RF_AT_FUNCID_RESULT_INFO, - RF_AT_FUNCID_TRX_IQ_RESULT, - RF_AT_FUNCID_TSSI_RESULT, - RF_AT_FUNCID_DPD_RESULT, - RF_AT_FUNCID_RXV_DUMP, - RF_AT_FUNCID_RX_PHY_STATIS, - RF_AT_FUNCID_MEASURE_RESULT, - RF_AT_FUNCID_TEMP_SENSOR, - RF_AT_FUNCID_VOLT_SENSOR, - RF_AT_FUNCID_READ_EFUSE, - RF_AT_FUNCID_RX_RSSI, - RF_AT_FUNCID_FW_INFO, - RF_AT_FUNCID_DRV_INFO, - - /* Set command */ - RF_AT_FUNCID_SET_DPD_RESULT = 64, - RF_AT_FUNCID_SET_CW_MODE, - RF_AT_FUNCID_SET_JAPAN_CH14_FILTER, - RF_AT_FUNCID_WRITE_EFUSE, - RF_AT_FUNCID_SET_MAC_ADDRESS - -} ENUM_RF_AT_FUNCID_T; - -// Command -typedef enum _ENUM_RF_AT_COMMAND_T { - RF_AT_COMMAND_STOPTEST = 0, - RF_AT_COMMAND_STARTTX, - RF_AT_COMMAND_STARTRX, - RF_AT_COMMAND_RESET, - RF_AT_COMMAND_OUTPUT_POWER, /* Payload */ - RF_AT_COMMAND_LO_LEAKAGE, /* Local freq is renamed to Local leakage */ - RF_AT_COMMAND_CARRIER_SUPPR, /* OFDM (LTF/STF), CCK (PI,PI/2) */ - RF_AT_COMMAND_TRX_IQ_CAL, - RF_AT_COMMAND_TSSI_CAL, - RF_AT_COMMAND_DPD_CAL, - RF_AT_COMMAND_CW, - RF_AT_COMMAND_NUM -} ENUM_RF_AT_COMMAND_T; - -// Preamble -typedef enum _ENUM_RF_AT_PREAMBLE_T { - RF_AT_PREAMBLE_NORMAL = 0, - RF_AT_PREAMBLE_CCK_SHORT, - RF_AT_PREAMBLE_11N_MM, - RF_AT_PREAMBLE_11N_GF, - RF_AT_PREAMBLE_NUM -} ENUM_RF_AT_PREAMBLE_T; - -// Ack Policy -typedef enum _ENUM_RF_AT_ACK_POLICY_T { - RF_AT_ACK_POLICY_NORMAL = 0, - RF_AT_ACK_POLICY_NOACK, - RF_AT_ACK_POLICY_NOEXPLICTACK, - RF_AT_ACK_POLICY_BLOCKACK, - RF_AT_ACK_POLICY_NUM -} ENUM_RF_AT_ACK_POLICY_T; - -typedef enum _ENUM_RF_AUTOTEST_STATE_T { - RF_AUTOTEST_STATE_STANDBY = 0, - RF_AUTOTEST_STATE_TX, - RF_AUTOTEST_STATE_RX, - RF_AUTOTEST_STATE_RESET, - RF_AUTOTEST_STATE_OUTPUT_POWER, - RF_AUTOTEST_STATE_LOCA_FREQUENCY, - RF_AUTOTEST_STATE_CARRIER_SUPRRESION, - RF_AUTOTEST_STATE_NUM -} ENUM_RF_AUTOTEST_STATE_T; - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -WLAN_STATUS -rftestSetATInfo( - IN P_ADAPTER_T prAdapter, - UINT_32 u4FuncIndex, - UINT_32 u4FuncData - ); - -WLAN_STATUS -rftestQueryATInfo( - IN P_ADAPTER_T prAdapter, - UINT_32 u4FuncIndex, - UINT_32 u4FuncData, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen - ); - -WLAN_STATUS -rftestSetFrequency( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4FreqInKHz, - IN PUINT_32 pu4SetInfoLen - ); - -#endif /* _RFTEST_H */ - - - diff --git a/drivers/net/wireless/mt5931/include/typedef.h b/drivers/net/wireless/mt5931/include/typedef.h deleted file mode 100755 index 2fba6fe88ec0..000000000000 --- a/drivers/net/wireless/mt5931/include/typedef.h +++ /dev/null @@ -1,236 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/typedef.h#1 $ -*/ - -/*! \file typedef.h - \brief Declaration of data type and return values of internal protocol stack. - - In this file we declare the data type and return values which will be exported - to the GLUE Layer. -*/ - - - -/* -** $Log: typedef.h $ - * - * 07 18 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add CMD/Event for RDD and BWCS. - * - * 12 30 2010 cp.wu - * [WCXRP00000327] [MT6620 Wi-Fi][Driver] Improve HEC WHQA 6972 workaround coverage in driver side - * host driver not to set FW-own when there is still pending interrupts - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 16 2010 kevin.huang - * NULL - * Refine AAA functions - * - * 07 19 2010 jeffrey.chang - * - * Linux port modification - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 23 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * integrate . - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 09 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add necessary changes to driver data paths. - * - * 06 09 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add definitions for module migration. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 06 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * move timer callback to glue layer. - * - * 05 31 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add cfg80211 interface, which is to replace WE, for further extension - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port - * - * 02 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add Ethernet destination address information in packet info for TX - * - * 02 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add new API: wlanProcessQueuedPackets() -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-03-23 21:41:37 GMT mtk01461 -** Update PACKET_INFO_INIT for TX Path -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-03-23 00:30:17 GMT mtk01461 -** Add parameter in PACKET_INFO_T for HIF Loopback -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-18 20:25:22 GMT mtk01461 -** Fix LINT warning -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-16 09:08:28 GMT mtk01461 -** Update TX PATH API -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:11:54 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _TYPEDEF_H -#define _TYPEDEF_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/* ieee80211.h of linux has duplicated definitions */ -#if defined(WLAN_STATUS_SUCCESS) -#undef WLAN_STATUS_SUCCESS -#endif - -#define WLAN_STATUS_SUCCESS ((WLAN_STATUS) 0x00000000L) -#define WLAN_STATUS_PENDING ((WLAN_STATUS) 0x00000103L) -#define WLAN_STATUS_NOT_ACCEPTED ((WLAN_STATUS) 0x00010003L) - -#define WLAN_STATUS_MEDIA_CONNECT ((WLAN_STATUS) 0x4001000BL) -#define WLAN_STATUS_MEDIA_DISCONNECT ((WLAN_STATUS) 0x4001000CL) -#define WLAN_STATUS_MEDIA_SPECIFIC_INDICATION ((WLAN_STATUS) 0x40010012L) - -#define WLAN_STATUS_SCAN_COMPLETE ((WLAN_STATUS) 0x60010001L) -#define WLAN_STATUS_MSDU_OK ((WLAN_STATUS) 0x60010002L) - -/* TODO(Kevin): double check if 0x60010001 & 0x60010002 is proprietary */ -#define WLAN_STATUS_ROAM_OUT_FIND_BEST ((WLAN_STATUS) 0x60010101L) -#define WLAN_STATUS_ROAM_DISCOVERY ((WLAN_STATUS) 0x60010102L) - -#define WLAN_STATUS_FAILURE ((WLAN_STATUS) 0xC0000001L) -#define WLAN_STATUS_RESOURCES ((WLAN_STATUS) 0xC000009AL) -#define WLAN_STATUS_NOT_SUPPORTED ((WLAN_STATUS) 0xC00000BBL) - -#define WLAN_STATUS_MULTICAST_FULL ((WLAN_STATUS) 0xC0010009L) -#define WLAN_STATUS_INVALID_PACKET ((WLAN_STATUS) 0xC001000FL) -#define WLAN_STATUS_ADAPTER_NOT_READY ((WLAN_STATUS) 0xC0010011L) -#define WLAN_STATUS_NOT_INDICATING ((WLAN_STATUS) 0xC0010013L) -#define WLAN_STATUS_INVALID_LENGTH ((WLAN_STATUS) 0xC0010014L) -#define WLAN_STATUS_INVALID_DATA ((WLAN_STATUS) 0xC0010015L) -#define WLAN_STATUS_BUFFER_TOO_SHORT ((WLAN_STATUS) 0xC0010016L) - -#define WLAN_STATUS_BWCS_UPDATE ((WLAN_STATUS) 0xC0010017L) - -/* NIC status flags */ -#define ADAPTER_FLAG_HW_ERR 0x00400000 - -/* Type Length */ -#define TL_IPV4 0x0008 -#define TL_IPV6 0xDD86 - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -/* Type definition for GLUE_INFO structure */ -typedef struct _GLUE_INFO_T GLUE_INFO_T, *P_GLUE_INFO_T; - -/* Type definition for WLAN STATUS */ -typedef UINT_32 WLAN_STATUS, *P_WLAN_STATUS; - -/* Type definition for ADAPTER structure */ -typedef struct _ADAPTER_T ADAPTER_T, *P_ADAPTER_T; - -/* Type definition for MESSAGE HEADER structure */ -typedef struct _MSG_HDR_T MSG_HDR_T, *P_MSG_HDR_T; - -/* Type definition for Pointer to OS Native Packet */ -typedef void *P_NATIVE_PACKET; - -/* Type definition for STA_RECORD_T structure to handle the connectivity and packet reception - * for a particular STA. - */ -typedef struct _STA_RECORD_T STA_RECORD_T, *P_STA_RECORD_T, **PP_STA_RECORD_T; - -/* CMD_INFO_T is used by Glue Layer to send a cluster of Command(OID) information to - * the TX Path to reduce the parameters of a function call. - */ -typedef struct _CMD_INFO_T CMD_INFO_T, *P_CMD_INFO_T; - -/* Following typedef should be removed later, because Glue Layer should not - * be aware of following data type. - */ -typedef struct _SW_RFB_T SW_RFB_T, *P_SW_RFB_T, **PP_SW_RFB_T; - -typedef struct _MSDU_INFO_T MSDU_INFO_T, *P_MSDU_INFO_T; - -typedef struct _REG_ENTRY_T REG_ENTRY_T, *P_REG_ENTRY_T; - -/* IST handler definition */ -typedef VOID (*IST_EVENT_FUNCTION)(P_ADAPTER_T); - -/* Type definition for function pointer of timer handler */ -typedef VOID (*PFN_TIMER_CALLBACK)(IN P_GLUE_INFO_T); - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#endif /* _TYPEDEF_H */ - - diff --git a/drivers/net/wireless/mt5931/include/wlan_bow.h b/drivers/net/wireless/mt5931/include/wlan_bow.h deleted file mode 100755 index a3c4d3849a05..000000000000 --- a/drivers/net/wireless/mt5931/include/wlan_bow.h +++ /dev/null @@ -1,547 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/wlan_bow.h#1 $ -*/ - -/*! \file "wlan_bow.h" - \brief This file contains the declairations of 802.11 PAL - command processing routines for - MediaTek Inc. 802.11 Wireless LAN Adapters. -*/ - - - -/* -** $Log: wlan_bow.h $ - * - * 05 25 2011 terry.wu - * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment - * Add BoW Cancel Scan Request and Turn On deactive network function. - * - * 05 23 2011 terry.wu - * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment - * Add some BoW error handling. - * - * 05 21 2011 terry.wu - * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment - * Protect BoW connection establishment. - * - * 05 17 2011 terry.wu - * [WCXRP00000730] [MT6620 Wi-Fi][BoW] Send deauth while disconnecting - * Send deauth while disconnecting BoW link. - * - * 05 06 2011 terry.wu - * [WCXRP00000707] [MT6620 Wi-Fi][Driver] Fix BoW Multiple Physical Link connect/disconnect issue - * Fix BoW Multiple Physical Link connect/disconnect issue. - * - * 04 15 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add BOW short range mode. - * - * 03 27 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Support multiple physical link. - * - * 03 10 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add BOW table. - * - * 02 16 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add bowNotifyAllLinkDisconnected interface and change channel grant procedure for bow starting.. - * - * 02 15 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Update bowString and channel grant. - * - * 01 11 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Update BOW Activity Report structure and bug fix. - * - * 09 27 2010 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000065] Update BoW design and settings - * Update BCM/BoW design and settings. - * - * 09 14 2010 chinghwa.yu - * NULL - * Add bowRunEventAAAComplete. - * - * 08 24 2010 chinghwa.yu - * NULL - * Update BOW for the 1st time. - * - * 07 30 2010 cp.wu - * NULL - * 1) BoW wrapper: use definitions instead of hard-coded constant for error code - * 2) AIS-FSM: eliminate use of desired RF parameters, use prTargetBssDesc instead - * 3) add handling for RX_PKT_DESTINATION_HOST_WITH_FORWARD for GO-broadcast frames - * - * 07 15 2010 cp.wu - * - * sync. bluetooth-over-Wi-Fi interface to driver interface document v0.2.6. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * 1) add timeout handler mechanism for pending command packets - * 2) add p2p add/removal key - * - * 05 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * 1) all BT physical handles shares the same RSSI/Link Quality. - * 2) simplify BT command composing - * - * 04 28 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * change prefix for data structure used to communicate with 802.11 PAL - * to avoid ambiguous naming with firmware interface - * - * 04 27 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add multiple physical link support - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * * * * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * * * * * * * * * * 2) command sequence number is now increased atomically - * * * * * * * * * * * * 3) private data could be hold and taken use for other purpose -** -*/ - -#ifndef _WLAN_BOW_H -#define _WLAN_BOW_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "nic/bow.h" -#include "nic/cmd_buf.h" - -#if CFG_ENABLE_BT_OVER_WIFI -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define BOWCMD_STATUS_SUCCESS 0 -#define BOWCMD_STATUS_FAILURE 1 -#define BOWCMD_STATUS_UNACCEPTED 2 -#define BOWCMD_STATUS_INVALID 3 -#define BOWCMD_STATUS_TIMEOUT 4 - -#define BOW_WILDCARD_SSID "AMP" -#define BOW_WILDCARD_SSID_LEN 3 -#define BOW_SSID_LEN 21 - - /* 0: query, 1: setup, 2: destroy */ -#define BOW_QUERY_CMD 0 -#define BOW_SETUP_CMD 1 -#define BOW_DESTROY_CMD 2 - -#define BOW_INITIATOR 0 -#define BOW_RESPONDER 1 - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -typedef struct _BOW_TABLE_T { - UINT_8 ucAcquireID; - BOOLEAN fgIsValid; - ENUM_BOW_DEVICE_STATE eState; - UINT_8 aucPeerAddress[6]; - //UINT_8 ucRole; - //UINT_8 ucChannelNum; - UINT_16 u2Reserved; -} BOW_TABLE_T, *P_BOW_TABLE_T; - -typedef WLAN_STATUS (*PFN_BOW_CMD_HANDLE)(P_ADAPTER_T, P_AMPC_COMMAND); - -typedef struct _BOW_CMD_T { - UINT_8 uCmdID; - PFN_BOW_CMD_HANDLE pfCmdHandle; -} BOW_CMD_T, *P_BOW_CMD_T; - -typedef struct _BOW_EVENT_ACTIVITY_REPORT_T { - UINT_8 ucReason; - UINT_8 aucReserved; - UINT_8 aucPeerAddress[6]; -} BOW_EVENT_ACTIVITY_REPORT_T, *P_BOW_EVENT_ACTIVITY_REPORT_T; - -/* -ucReason: 0: success - 1: general failure - 2: too much time (> 2/3 second totally) requested for scheduling. - Others: reserved. -*/ - -typedef struct _BOW_EVENT_SYNC_TSF_T { - UINT_64 u4TsfTime; - UINT_32 u4TsfSysTime; - UINT_32 u4ScoTime; - UINT_32 u4ScoSysTime; - } BOW_EVENT_SYNC_TSF_T, *P_BOW_EVENT_SYNC_TSF_T; - -typedef struct _BOW_ACTIVITY_REPORT_BODY_T { - UINT_32 u4StartTime; - UINT_32 u4Duration; - UINT_32 u4Periodicity; - } BOW_ACTIVITY_REPORT_BODY_T, *P_BOW_ACTIVITY_REPORT_BODY_T; - -typedef struct _BOW_ACTIVITY_REPORT_T { - UINT_8 aucPeerAddress[6]; - UINT_8 ucScheduleKnown; - UINT_8 ucNumReports; - BOW_ACTIVITY_REPORT_BODY_T arBowActivityReportBody[MAX_ACTIVITY_REPORT]; - } BOW_ACTIVITY_REPORT_T, *P_BOW_ACTIVITY_REPORT_T; - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -/*--------------------------------------------------------------*/ -/* Firmware Command Packer */ -/*--------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSendSetQueryBowCmd ( - IN P_ADAPTER_T prAdapter, - UINT_8 ucCID, - BOOLEAN fgSetQuery, - BOOLEAN fgNeedResp, - PFN_CMD_DONE_HANDLER pfCmdDoneHandler, - PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler, - UINT_32 u4SetQueryInfoLen, - PUINT_8 pucInfoBuffer, - IN UINT_8 ucSeqNumber - ); - - -/*--------------------------------------------------------------*/ -/* Command Dispatcher */ -/*--------------------------------------------------------------*/ -WLAN_STATUS -wlanbowHandleCommand( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ); - - -/*--------------------------------------------------------------*/ -/* Routines to handle command */ -/*--------------------------------------------------------------*/ -WLAN_STATUS -bowCmdGetMacStatus( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ); - -WLAN_STATUS -bowCmdSetupConnection( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ); - -WLAN_STATUS -bowCmdDestroyConnection( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ); - -WLAN_STATUS -bowCmdSetPTK( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ); - -WLAN_STATUS -bowCmdReadRSSI( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ); - -WLAN_STATUS -bowCmdReadLinkQuality( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ); - -WLAN_STATUS -bowCmdShortRangeMode( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ); - -WLAN_STATUS -bowCmdGetChannelList( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd - ); - -VOID -wlanbowCmdEventSetStatus( - IN P_ADAPTER_T prAdapter, - IN P_AMPC_COMMAND prCmd, - IN UINT_8 ucEventBuf - ); - -/*--------------------------------------------------------------*/ -/* Callbacks for event indication */ -/*--------------------------------------------------------------*/ -VOID -wlanbowCmdEventSetCommon ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -wlanbowCmdEventLinkConnected ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -wlanbowCmdEventLinkDisconnected ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -wlanbowCmdEventSetSetupConnection ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -wlanbowCmdEventReadLinkQuality ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -wlanbowCmdEventReadRssi ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -wlanbowCmdTimeoutHandler ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ); - -VOID -bowStopping( - IN P_ADAPTER_T prAdapter); - -VOID -bowStarting ( - IN P_ADAPTER_T prAdapter - ); - -VOID -bowAssignSsid ( - IN PUINT_8 pucSsid, - IN PUINT_8 pucSsidLen - ); - -BOOLEAN -bowValidateProbeReq ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_32 pu4ControlFlags - ); - -VOID -bowSendBeacon( - IN P_ADAPTER_T prAdapter, - UINT_32 u4Param - ); - -VOID -bowResponderScan( - IN P_ADAPTER_T prAdapter - ); - -VOID -bowResponderScanDone( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -bowResponderCancelScan ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsChannelExtention - ); - -VOID -bowResponderJoin( - IN P_ADAPTER_T prAdapter, - P_BSS_DESC_T prBssDesc - ); - -VOID -bowFsmRunEventJoinComplete( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -bowIndicationOfMediaStateToHost( - IN P_ADAPTER_T prAdapter, - ENUM_PARAM_MEDIA_STATE_T eConnectionState, - BOOLEAN fgDelayIndication - ); - -VOID -bowRunEventAAATxFail( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -WLAN_STATUS -bowRunEventAAAComplete( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ); - -WLAN_STATUS -bowRunEventRxDeAuth ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prSwRfb - ); - -VOID -bowDisconnectLink ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - -BOOLEAN -bowValidateAssocReq( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_16 pu2StatusCode - ); - -BOOLEAN -bowValidateAuth( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN PP_STA_RECORD_T pprStaRec, - OUT PUINT_16 pu2StatusCode - ); - -VOID -bowRunEventChGrant ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ); - -VOID -bowRequestCh ( - IN P_ADAPTER_T prAdapter - ); - -VOID -bowReleaseCh ( - IN P_ADAPTER_T prAdapter - ); - -VOID -bowChGrantedTimeout( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Param - ); - -BOOLEAN -bowNotifyAllLinkDisconnected ( - IN P_ADAPTER_T prAdapter - ); - -BOOLEAN -bowCheckBowTableIfVaild( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucPeerAddress[6] - ); - -BOOLEAN -bowGetBowTableContent( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucBowTableIdx, - OUT P_BOW_TABLE_T prBowTable - ); - -BOOLEAN -bowGetBowTableEntryByPeerAddress( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucPeerAddress[6], - OUT PUINT_8 pucBowTableIdx - ); - -BOOLEAN -bowGetBowTableFreeEntry( - IN P_ADAPTER_T prAdapter, - OUT PUINT_8 pucBowTableIdx - ); - -ENUM_BOW_DEVICE_STATE -bowGetBowTableState( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucPeerAddress[6] - ); - -BOOLEAN -bowSetBowTableState( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucPeerAddress[6], - IN ENUM_BOW_DEVICE_STATE eState - ); - - -BOOLEAN -bowSetBowTableContent( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucBowTableIdx, - IN P_BOW_TABLE_T prBowTable - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif -#endif /* _WLAN_BOW_H */ - diff --git a/drivers/net/wireless/mt5931/include/wlan_lib.h b/drivers/net/wireless/mt5931/include/wlan_lib.h deleted file mode 100755 index 5141726b1fec..000000000000 --- a/drivers/net/wireless/mt5931/include/wlan_lib.h +++ /dev/null @@ -1,1042 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/wlan_lib.h#1 $ -*/ - -/*! \file "wlan_lib.h" - \brief The declaration of the functions of the wlanAdpater objects - - Detail description. -*/ - - - -/* -** $Log: wlan_lib.h $ - * - * 06 08 2012 eason.tsai - * NULL - * Nvram context covert from 6620 to 6628 for old 6620 meta tool - * - * 01 16 2012 cp.wu - * [MT6620 Wi-Fi][Driver] API and behavior modification for preferred band configuration with corresponding network configuration - * add wlanSetPreferBandByNetwork() for glue layer to invoke for setting preferred band configuration corresponding to network type. - * - * 01 05 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * Adding the related ioctl / wlan oid function to set the Tx power cfg. - * - * 10 03 2011 cp.wu - * [WCXRP00001022] [MT6628 Driver][Firmware Download] Add multi section independent download functionality - * eliminate win32 native data types. - * - * 10 03 2011 cp.wu - * [WCXRP00001022] [MT6628 Driver][Firmware Download] Add multi section independent download functionality - * add firmware download path in divided scatters. - * - * 10 03 2011 cp.wu - * [MT6628 Driver][Firmware Download] Add multi section independent download functionality - * add firmware downloading aggregated path. - * - * 09 20 2011 tsaiyuan.hsu - * [WCXRP00000931] [MT5931 Wi-Fi][DRV/FW] add swcr to disable roaming from driver - * change window registry of driver for roaming. - * - * 09 08 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * Use new fields ucChannelListMap and ucChannelListIndex in NVRAM - * - * 08 31 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * . - * - * 08 25 2011 chinghwa.yu - * [WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add DFS switch. - * - * 08 24 2011 chinghwa.yu - * [WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Update RDD test mode cases. - * - * 08 15 2011 cp.wu - * [WCXRP00000913] [MT6620 Wi-Fi] create repository of source code dedicated for MT6620 E6 ASIC - * support to load different firmware image for E3/E4/E5 and E6 ASIC on win32 platforms. - * - * 08 02 2011 yuche.tsai - * [WCXRP00000896] [Volunteer Patch][WiFi Direct][Driver] GO with multiple client, TX deauth to a disconnecting device issue. - * Fix GO send deauth frame issue. - * - * 07 22 2011 jeffrey.chang - * [WCXRP00000864] [MT5931] Add command to adjust OSC stable time - * modify driver to set OSC stable time after f/w download - * - * 07 18 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add CMD/Event for RDD and BWCS. - * - * 05 27 2011 cp.wu - * [WCXRP00000749] [MT6620 Wi-Fi][Driver] Add band edge tx power control to Wi-Fi NVRAM - * invoke CMD_ID_SET_EDGE_TXPWR_LIMIT when there is valid data exist in NVRAM content. - * - * 05 11 2011 cp.wu - * [WCXRP00000718] [MT6620 Wi-Fi] modify the behavior of setting tx power - * ACPI APIs migrate to wlan_lib.c for glue layer to invoke. - * - * 04 18 2011 cp.wu - * [WCXRP00000636] [WHQL][MT5931 Driver] 2c_PMHibernate (hang on 2h) - * 1) add API for glue layer to query ACPI state - * 2) Windows glue should not access to hardware after switched into D3 state - * - * 03 10 2011 cp.wu - * [WCXRP00000532] [MT6620 Wi-Fi][Driver] Migrate NVRAM configuration procedures from MT6620 E2 to MT6620 E3 - * deprecate configuration used by MT6620 E2 - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * - * 01 27 2011 george.huang - * [WCXRP00000355] [MT6620 Wi-Fi] Set WMM-PS related setting with qualifying AP capability - * Support current measure mode, assigned by registry (XP only). - * - * 01 24 2011 cp.wu - * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving - * 1. add an extra counter for tracking pending forward frames. - * 2. notify TX service thread as well when there is pending forward frame - * 3. correct build errors leaded by introduction of Wi-Fi direct separation module - * - * 01 10 2011 cp.wu - * [WCXRP00000351] [MT6620 Wi-Fi][Driver] remove from scanning result in OID handling layer when the corresponding BSS is disconnected due to beacon timeout - * remove from scanning result when the BSS is disconnected due to beacon timeout. - * - * 10 27 2010 george.huang - * [WCXRP00000127] [MT6620 Wi-Fi][Driver] Add a registry to disable Beacon Timeout function for SQA test by using E1 EVB - * Support registry option for disable beacon lost detection. - * - * 10 26 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command - * 1) update NVRAM content template to ver 1.02 - * 2) add compile option for querying NIC capability (default: off) - * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting - * 4) correct auto-rate compiler error under linux (treat warning as error) - * 5) simplify usage of NVRAM and REG_INFO_T - * 6) add version checking between driver and firmware - * - * 10 26 2010 eddie.chen - * [WCXRP00000134] [MT6620 Wi-Fi][Driver] Add a registry to enable auto rate for SQA test by using E1 EVB - * Add auto rate parameter in registry. - * - * 10 18 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android - * complete implementation of Android NVRAM access - * - * 10 08 2010 cp.wu - * [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test - * adding fixed rate support for distance test. (from registry setting) - * - * 10 06 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * divide a single function into 2 part to surpress a weird compiler warning from gcc-4.4.0 - * - * 10 06 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * code reorganization to improve isolation between GLUE and CORE layers. - * - * 10 05 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * load manufacture data when CFG_SUPPORT_NVRAM is set to 1 - * - * 09 24 2010 cp.wu - * [WCXRP00000057] [MT6620 Wi-Fi][Driver] Modify online scan to a run-time switchable feature - * Modify online scan as a run-time adjustable option (for Windows, in registry) - * - * 09 23 2010 cp.wu - * [WCXRP00000051] [MT6620 Wi-Fi][Driver] WHQL test fail in MAC address changed item - * use firmware reported mac address right after wlanAdapterStart() as permanent address - * - * 09 23 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * add skeleton for NVRAM integration - * - * 08 26 2010 yuche.tsai - * NULL - * Add AT GO test configure mode under WinXP. - * Please enable 1. CFG_ENABLE_WIFI_DIRECT, 2. CFG_TEST_WIFI_DIRECT_GO, 3. CFG_SUPPORT_AAA - * - * 08 25 2010 george.huang - * NULL - * . - * - * 07 21 2010 cp.wu - * - * 1) change BG_SCAN to ONLINE_SCAN for consistent term - * 2) only clear scanning result when scan is permitted to do - * - * 07 13 2010 cp.wu - * - * 1) MMPDUs are now sent to MT6620 by CMD queue for keeping strict order of 1X/MMPDU/CMD packets - * 2) integrate with qmGetFrameAction() for deciding which MMPDU/1X could pass checking for sending - * 2) enhance CMD_INFO_T descriptor number from 10 to 32 to avoid descriptor underflow under concurrent network operation - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 24 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 802.1x and bluetooth-over-Wi-Fi security frames are now delievered to firmware via command path instead of data path. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * change MAC address updating logic. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * simplify timer usage. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * cnm_timer has been migrated. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 20 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) integrate OID_GEN_NETWORK_LAYER_ADDRESSES with CMD_ID_SET_IP_ADDRESS - * 2) buffer statistics data for 2 seconds - * 3) use default value for adhoc parameters instead of 0 - * - * 05 12 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add extra 64 adjustable parameters for CoEX scenario. - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * code refine: fgTestMode should be at adapter rather than glue due to the device/fw is also involved - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) for some OID, never do timeout expiration - * * 2) add 2 kal API for later integration - * - * 04 01 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * change to use WIFI_TCM_ALWAYS_ON as firmware image - * - * 03 31 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * modify the wapi related code for new driver's design. - * - * 03 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * always send CMD_NIC_POWER_CTRL packet when nic is being halted - * - * 03 12 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add two option for ACK and ENCRYPTION for firmware download - * - * 02 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * separate wlanProcesQueuePacket() into 2 APIs upon request - * - * 02 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add new API: wlanProcessQueuedPackets() - * - * 02 11 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. add logic for firmware download - * * * 2. firmware image filename and start/load address are now retrieved from registry - * - * 02 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) remove unused function in nic_rx.c [which has been handled in que_mgt.c] - * * * * 2) firmware image length is now retrieved via NdisFileOpen - * * * * 3) firmware image is not structured by (P_IMG_SEC_HDR_T) anymore - * * * * 4) nicRxWaitResponse() revised - * * * * 5) another set of TQ counter default value is added for fw-download state - * * * * 6) Wi-Fi load address is now retrieved from registry too - * - * 02 08 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * prepare for implementing fw download logic - * - * 01 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. eliminate improper variable in rHifInfo - * * * * * * * 2. block TX/ordinary OID when RF test mode is engaged - * * * * * * * 3. wait until firmware finish operation when entering into and leaving from RF test mode - * * * * * * * 4. correct some HAL implementation -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-12-10 16:39:55 GMT mtk02752 -** eliminate unused API -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-10-13 21:58:41 GMT mtk01084 -** update for new macro define -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-05-19 10:43:06 GMT mtk01461 -** Add wlanReleasePendingOid() -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-13 16:38:44 GMT mtk01084 -** add WIFI start function -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-08 16:51:14 GMT mtk01084 -** Update for the image download part -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-01 10:57:38 GMT mtk01461 -** Add wlanSendLeftClusteredFrames() for SDIO_TX_ENHANCE -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-23 00:31:02 GMT mtk01461 -** Add declaration of FW Image download reference code -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-16 09:08:31 GMT mtk01461 -** Update TX PATH API -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:12:04 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _WLAN_LIB_H -#define _WLAN_LIB_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "CFG_Wifi_File.h" -#include "rlm_domain.h" -#include "wlan_typedef.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -#define MAX_NUM_GROUP_ADDR 32 /* max number of group addresses */ - - - -#define TX_CS_TCP_UDP_GEN BIT(1) -#define TX_CS_IP_GEN BIT(0) - - -#define CSUM_OFFLOAD_EN_TX_TCP BIT(0) -#define CSUM_OFFLOAD_EN_TX_UDP BIT(1) -#define CSUM_OFFLOAD_EN_TX_IP BIT(2) -#define CSUM_OFFLOAD_EN_RX_TCP BIT(3) -#define CSUM_OFFLOAD_EN_RX_UDP BIT(4) -#define CSUM_OFFLOAD_EN_RX_IPv4 BIT(5) -#define CSUM_OFFLOAD_EN_RX_IPv6 BIT(6) -#define CSUM_OFFLOAD_EN_TX_MASK BITS(0,2) -#define CSUM_OFFLOAD_EN_ALL BITS(0,6) - -/* TCP, UDP, IP Checksum */ -#define RX_CS_TYPE_UDP BIT(7) -#define RX_CS_TYPE_TCP BIT(6) -#define RX_CS_TYPE_IPv6 BIT(5) -#define RX_CS_TYPE_IPv4 BIT(4) - -#define RX_CS_STATUS_UDP BIT(3) -#define RX_CS_STATUS_TCP BIT(2) -#define RX_CS_STATUS_IP BIT(0) - -#define CSUM_NOT_SUPPORTED 0x0 - -#define TXPWR_USE_PDSLOPE 0 - -/* NVRAM error code definitions */ -#define NVRAM_ERROR_VERSION_MISMATCH BIT(1) -#define NVRAM_ERROR_INVALID_TXPWR BIT(2) -#define NVRAM_ERROR_INVALID_DPD BIT(3) -#define NVRAM_ERROR_INVALID_MAC_ADDR BIT(4) - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef WLAN_STATUS (*PFN_OID_HANDLER_FUNC) ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvBuf, - IN UINT_32 u4BufLen, - OUT PUINT_32 pu4OutInfoLen - ); - -typedef enum _ENUM_CSUM_TYPE_T { - CSUM_TYPE_IPV4, - CSUM_TYPE_IPV6, - CSUM_TYPE_TCP, - CSUM_TYPE_UDP, - CSUM_TYPE_NUM -} ENUM_CSUM_TYPE_T, *P_ENUM_CSUM_TYPE_T; - -typedef enum _ENUM_CSUM_RESULT_T { - CSUM_RES_NONE, - CSUM_RES_SUCCESS, - CSUM_RES_FAILED, - CSUM_RES_NUM -} ENUM_CSUM_RESULT_T, *P_ENUM_CSUM_RESULT_T; - -typedef enum _ENUM_PHY_MODE_T { - ENUM_PHY_2G4_CCK, - ENUM_PHY_2G4_OFDM_BPSK, - ENUM_PHY_2G4_OFDM_QPSK, - ENUM_PHY_2G4_OFDM_16QAM, - ENUM_PHY_2G4_OFDM_48M, - ENUM_PHY_2G4_OFDM_54M, - ENUM_PHY_2G4_HT20_BPSK, - ENUM_PHY_2G4_HT20_QPSK, - ENUM_PHY_2G4_HT20_16QAM, - ENUM_PHY_2G4_HT20_MCS5, - ENUM_PHY_2G4_HT20_MCS6, - ENUM_PHY_2G4_HT20_MCS7, - ENUM_PHY_2G4_HT40_BPSK, - ENUM_PHY_2G4_HT40_QPSK, - ENUM_PHY_2G4_HT40_16QAM, - ENUM_PHY_2G4_HT40_MCS5, - ENUM_PHY_2G4_HT40_MCS6, - ENUM_PHY_2G4_HT40_MCS7, - ENUM_PHY_5G_OFDM_BPSK, - ENUM_PHY_5G_OFDM_QPSK, - ENUM_PHY_5G_OFDM_16QAM, - ENUM_PHY_5G_OFDM_48M, - ENUM_PHY_5G_OFDM_54M, - ENUM_PHY_5G_HT20_BPSK, - ENUM_PHY_5G_HT20_QPSK, - ENUM_PHY_5G_HT20_16QAM, - ENUM_PHY_5G_HT20_MCS5, - ENUM_PHY_5G_HT20_MCS6, - ENUM_PHY_5G_HT20_MCS7, - ENUM_PHY_5G_HT40_BPSK, - ENUM_PHY_5G_HT40_QPSK, - ENUM_PHY_5G_HT40_16QAM, - ENUM_PHY_5G_HT40_MCS5, - ENUM_PHY_5G_HT40_MCS6, - ENUM_PHY_5G_HT40_MCS7, - ENUM_PHY_MODE_NUM -} ENUM_PHY_MODE_T, *P_ENUM_PHY_MODE_T; - -typedef enum _ENUM_POWER_SAVE_POLL_MODE_T { - ENUM_POWER_SAVE_POLL_DISABLE, - ENUM_POWER_SAVE_POLL_LEGACY_NULL, - ENUM_POWER_SAVE_POLL_QOS_NULL, - ENUM_POWER_SAVE_POLL_NUM -} ENUM_POWER_SAVE_POLL_MODE_T, *P_ENUM_POWER_SAVE_POLL_MODE_T; - -typedef enum _ENUM_AC_TYPE_T { - ENUM_AC_TYPE_AC0, - ENUM_AC_TYPE_AC1, - ENUM_AC_TYPE_AC2, - ENUM_AC_TYPE_AC3, - ENUM_AC_TYPE_AC4, - ENUM_AC_TYPE_AC5, - ENUM_AC_TYPE_AC6, - ENUM_AC_TYPE_BMC, - ENUM_AC_TYPE_NUM -} ENUM_AC_TYPE_T, *P_ENUM_AC_TYPE_T; - -typedef enum _ENUM_ADV_AC_TYPE_T { - ENUM_ADV_AC_TYPE_RX_NSW, - ENUM_ADV_AC_TYPE_RX_PTA, - ENUM_ADV_AC_TYPE_RX_SP, - ENUM_ADV_AC_TYPE_TX_PTA, - ENUM_ADV_AC_TYPE_TX_RSP, - ENUM_ADV_AC_TYPE_NUM -} ENUM_ADV_AC_TYPE_T, *P_ENUM_ADV_AC_TYPE_T; - -typedef enum _ENUM_REG_CH_MAP_T { - REG_CH_MAP_COUNTRY_CODE, - REG_CH_MAP_TBL_IDX, - REG_CH_MAP_CUSTOMIZED, - REG_CH_MAP_NUM -} ENUM_REG_CH_MAP_T, *P_ENUM_REG_CH_MAP_T; - -typedef struct _SET_TXPWR_CTRL_T{ - INT_8 c2GLegacyStaPwrOffset; /* Unit: 0.5dBm, default: 0*/ - INT_8 c2GHotspotPwrOffset; - INT_8 c2GP2pPwrOffset; - INT_8 c2GBowPwrOffset; - INT_8 c5GLegacyStaPwrOffset; /* Unit: 0.5dBm, default: 0*/ - INT_8 c5GHotspotPwrOffset; - INT_8 c5GP2pPwrOffset; - INT_8 c5GBowPwrOffset; - UINT_8 ucConcurrencePolicy; /* TX power policy when concurrence - in the same channel - 0: Highest power has priority - 1: Lowest power has priority */ - INT_8 acReserved1[3]; /* Must be zero */ - - /* Power limit by channel for all data rates */ - INT_8 acTxPwrLimit2G[14]; /* Channel 1~14, Unit: 0.5dBm*/ - INT_8 acTxPwrLimit5G[4]; /* UNII 1~4 */ - INT_8 acReserved2[2]; /* Must be zero */ -} SET_TXPWR_CTRL_T, *P_SET_TXPWR_CTRL_T; - -/* For storing driver initialization value from glue layer */ -typedef struct _REG_INFO_T { - UINT_32 u4SdBlockSize; /* SDIO block size */ - UINT_32 u4SdBusWidth; /* SDIO bus width. 1 or 4 */ - UINT_32 u4SdClockRate; /* SDIO clock rate. (in unit of HZ) */ - UINT_32 u4StartAddress; /* Starting address of Wi-Fi Firmware */ - UINT_32 u4LoadAddress; /* Load address of Wi-Fi Firmware */ - UINT_16 aucFwImgFilename[65]; /* Firmware filename */ - UINT_16 aucFwImgFilenameE6[65]; /* Firmware filename for E6 */ - UINT_32 u4StartFreq; /* Start Frequency for Ad-Hoc network : in unit of KHz */ - UINT_32 u4AdhocMode; /* Default mode for Ad-Hoc network : ENUM_PARAM_AD_HOC_MODE_T */ - UINT_32 u4RddStartFreq; - UINT_32 u4RddStopFreq; - UINT_32 u4RddTestMode; - UINT_32 u4RddShutFreq; - UINT_32 u4RddDfs; - INT_32 i4HighRssiThreshold; - INT_32 i4MediumRssiThreshold; - INT_32 i4LowRssiThreshold; - INT_32 au4TxPriorityTag[ENUM_AC_TYPE_NUM]; - INT_32 au4RxPriorityTag[ENUM_AC_TYPE_NUM]; - INT_32 au4AdvPriorityTag[ENUM_ADV_AC_TYPE_NUM]; - UINT_32 u4FastPSPoll; - UINT_32 u4PTA; /* 0: disable, 1: enable */ - UINT_32 u4TXLimit; /* 0: disable, 1: enable */ - UINT_32 u4SilenceWindow; /* range: 100 - 625, unit: us */ - UINT_32 u4TXLimitThreshold; /* range: 250 - 1250, unit: us */ - UINT_32 u4PowerMode; - UINT_32 fgEnArpFilter; - UINT_32 u4PsCurrentMeasureEn; - UINT_32 u4UapsdAcBmp; - UINT_32 u4MaxSpLen; - UINT_32 fgDisOnlineScan; /* 0: enable online scan, non-zero: disable online scan*/ - UINT_32 fgDisBcnLostDetection; /* 0: enable online scan, non-zero: disable online scan*/ - UINT_32 u4FixedRate; /* 0: automatic, non-zero: fixed rate */ - UINT_32 u4ArSysParam0; - UINT_32 u4ArSysParam1; - UINT_32 u4ArSysParam2; - UINT_32 u4ArSysParam3; - UINT_32 fgDisRoaming; /* 0:enable roaming 1:disable */ - - // NVRAM - MP Data -START- - UINT_8 aucMacAddr[6]; - UINT_16 au2CountryCode[4]; /* Country code (in ISO 3166-1 expression, ex: "US", "TW") */ - TX_PWR_PARAM_T rTxPwr; - UINT_8 aucEFUSE[144]; - UINT_8 ucTxPwrValid; - UINT_8 ucSupport5GBand; - UINT_8 fg2G4BandEdgePwrUsed; - INT_8 cBandEdgeMaxPwrCCK; - INT_8 cBandEdgeMaxPwrOFDM20; - INT_8 cBandEdgeMaxPwrOFDM40; - ENUM_REG_CH_MAP_T eRegChannelListMap; - UINT_8 ucRegChannelListIndex; - DOMAIN_INFO_ENTRY rDomainInfo; - // NVRAM - MP Data -END- - - // NVRAM - Functional Data -START- - UINT_8 uc2G4BwFixed20M; - UINT_8 uc5GBwFixed20M; - UINT_8 ucEnable5GBand; - // NVRAM - Functional Data -END- - -} REG_INFO_T, *P_REG_INFO_T; - -/* for divided firmware loading */ -typedef struct _FWDL_SECTION_INFO_T -{ - UINT_32 u4Offset; - UINT_32 u4Reserved; - UINT_32 u4Length; - UINT_32 u4DestAddr; -} FWDL_SECTION_INFO_T, *P_FWDL_SECTION_INFO_T; - -typedef struct _FIRMWARE_DIVIDED_DOWNLOAD_T -{ - UINT_32 u4Signature; - UINT_32 u4CRC; /* CRC calculated without first 8 bytes included */ - UINT_32 u4NumOfEntries; - UINT_32 u4Reserved; - FWDL_SECTION_INFO_T arSection[]; -} FIRMWARE_DIVIDED_DOWNLOAD_T, *P_FIRMWARE_DIVIDED_DOWNLOAD_T; - -typedef struct _PARAM_MCR_RW_STRUC_T { - UINT_32 u4McrOffset; - UINT_32 u4McrData; -} PARAM_MCR_RW_STRUC_T, *P_PARAM_MCR_RW_STRUC_T; - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -#define BUILD_SIGN(ch0, ch1, ch2, ch3) \ - ((UINT_32)(UINT_8)(ch0) | ((UINT_32)(UINT_8)(ch1) << 8) | \ - ((UINT_32)(UINT_8)(ch2) << 16) | ((UINT_32)(UINT_8)(ch3) << 24 )) - -#define MTK_WIFI_SIGNATURE BUILD_SIGN('M', 'T', 'K', 'W') - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -P_ADAPTER_T -wlanAdapterCreate ( - IN P_GLUE_INFO_T prGlueInfo - ); - -VOID -wlanAdapterDestroy ( - IN P_ADAPTER_T prAdapter - ); - -VOID -wlanCardEjected( - IN P_ADAPTER_T prAdapter - ); - -VOID -wlanIST ( - IN P_ADAPTER_T prAdapter - ); - -BOOL -wlanISR ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgGlobalIntrCtrl - ); - -WLAN_STATUS -wlanProcessCommandQueue ( - IN P_ADAPTER_T prAdapter, - IN P_QUE_T prCmdQue - ); - -WLAN_STATUS -wlanSendCommand ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ); - -VOID -wlanReleaseCommand ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ); - -VOID -wlanReleasePendingOid ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Data - ); - -VOID -wlanReleasePendingCMDbyNetwork( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType - ); - -VOID -wlanReturnPacket ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvPacket - ); - -WLAN_STATUS -wlanQueryInformation ( - IN P_ADAPTER_T prAdapter, - IN PFN_OID_HANDLER_FUNC pfOidQryHandler, - IN PVOID pvInfoBuf, - IN UINT_32 u4InfoBufLen, - OUT PUINT_32 pu4QryInfoLen - ); - -WLAN_STATUS -wlanSetInformation ( - IN P_ADAPTER_T prAdapter, - IN PFN_OID_HANDLER_FUNC pfOidSetHandler, - IN PVOID pvInfoBuf, - IN UINT_32 u4InfoBufLen, - OUT PUINT_32 pu4SetInfoLen - ); - - -WLAN_STATUS -wlanAdapterStart ( - IN P_ADAPTER_T prAdapter, - IN P_REG_INFO_T prRegInfo, - IN PVOID pvFwImageMapFile, - IN UINT_32 u4FwImageFileLength - ); - -WLAN_STATUS -wlanAdapterStop ( - IN P_ADAPTER_T prAdapter - ); - -#if CFG_SUPPORT_WAPI -BOOLEAN -wlanQueryWapiMode( - IN P_ADAPTER_T prAdapter - ); -#endif - -VOID -wlanReturnRxPacket ( - IN PVOID pvAdapter, - IN PVOID pvPacket - ); - -VOID -wlanRxSetBroadcast ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgEnableBroadcast - ); - -BOOLEAN -wlanIsHandlerNeedHwAccess ( - IN PFN_OID_HANDLER_FUNC pfnOidHandler, - IN BOOLEAN fgSetInfo - ); - -VOID -wlanSetPromiscuousMode ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgEnablePromiscuousMode - ); - -#if CFG_ENABLE_FW_DOWNLOAD - #if CFG_ENABLE_FW_DOWNLOAD_AGGREGATION -WLAN_STATUS -wlanImageSectionDownloadAggregated ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4DestAddr, - IN UINT_32 u4ImgSecSize, - IN PUINT_8 pucImgSecBuf - ); - #endif - -WLAN_STATUS -wlanImageSectionDownload ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4DestAddr, - IN UINT_32 u4ImgSecSize, - IN PUINT_8 pucImgSecBuf - ); - -#if !CFG_ENABLE_FW_DOWNLOAD_ACK -WLAN_STATUS -wlanImageQueryStatus( - IN P_ADAPTER_T prAdapter - ); -#else -WLAN_STATUS -wlanImageSectionDownloadStatus ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucCmdSeqNum - ); -#endif - -WLAN_STATUS -wlanConfigWifiFunc ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgEnable, - IN UINT_32 u4StartAddress - ); - -UINT_32 wlanCRC32( - PUINT_8 buf, - UINT_32 len - ); - -#endif - -WLAN_STATUS -wlanSendNicPowerCtrlCmd ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucPowerMode - ); - -BOOLEAN -wlanIsHandlerAllowedInRFTest ( - IN PFN_OID_HANDLER_FUNC pfnOidHandler, - IN BOOLEAN fgSetInfo - ); - -WLAN_STATUS -wlanProcessQueuedSwRfb ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfbListHead - ); - -WLAN_STATUS -wlanProcessQueuedMsduInfo ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfoListHead - ); - -BOOLEAN -wlanoidTimeoutCheck ( - IN P_ADAPTER_T prAdapter, - IN PFN_OID_HANDLER_FUNC pfnOidHandler - ); - -VOID -wlanoidClearTimeoutCheck ( - IN P_ADAPTER_T prAdapter - ); - -WLAN_STATUS -wlanUpdateNetworkAddress ( - IN P_ADAPTER_T prAdapter - ); - -BOOLEAN -wlanQueryTestMode( - IN P_ADAPTER_T prAdapter - ); - -/* Security Frame Handling */ -BOOLEAN -wlanProcessSecurityFrame( - IN P_ADAPTER_T prAdapter, - IN P_NATIVE_PACKET prPacket - ); - -VOID -wlanSecurityFrameTxDone( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); - -VOID -wlanSecurityFrameTxTimeout( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ); - -/*----------------------------------------------------------------------------*/ -/* OID/IOCTL Handling */ -/*----------------------------------------------------------------------------*/ -VOID -wlanClearScanningResult( - IN P_ADAPTER_T prAdapter - ); - -VOID -wlanClearBssInScanningResult( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 arBSSID - ); - -#if CFG_TEST_WIFI_DIRECT_GO -VOID -wlanEnableP2pFunction( - IN P_ADAPTER_T prAdapter - ); - -VOID -wlanEnableATGO( - IN P_ADAPTER_T prAdapter - ); -#endif - - -/*----------------------------------------------------------------------------*/ -/* Address Retreive by Polling */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanQueryPermanentAddress( - IN P_ADAPTER_T prAdapter - ); - - -/*----------------------------------------------------------------------------*/ -/* NIC Capability Retrieve by Polling */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanQueryNicCapability( - IN P_ADAPTER_T prAdapter - ); - - -/*----------------------------------------------------------------------------*/ -/* PD MCR Retrieve by Polling */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanQueryPdMcr( - IN P_ADAPTER_T prAdapter, - IN P_PARAM_MCR_RW_STRUC_T prMcrRdInfo - ); -/*----------------------------------------------------------------------------*/ -/* Loading Manufacture Data */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanLoadManufactureData ( - IN P_ADAPTER_T prAdapter, - IN P_REG_INFO_T prRegInfo - ); - - -/*----------------------------------------------------------------------------*/ -/* Media Stream Mode */ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wlanResetMediaStreamMode( - IN P_ADAPTER_T prAdapter - ); - - -/*----------------------------------------------------------------------------*/ -/* Timer Timeout Check (for Glue Layer) */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanTimerTimeoutCheck( - IN P_ADAPTER_T prAdapter - ); - - -/*----------------------------------------------------------------------------*/ -/* Mailbox Message Check (for Glue Layer) */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanProcessMboxMessage( - IN P_ADAPTER_T prAdapter - ); - - -/*----------------------------------------------------------------------------*/ -/* TX Pending Packets Handling (for Glue Layer) */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanEnqueueTxPacket ( - IN P_ADAPTER_T prAdapter, - IN P_NATIVE_PACKET prNativePacket - ); - -WLAN_STATUS -wlanFlushTxPendingPackets( - IN P_ADAPTER_T prAdapter - ); - -WLAN_STATUS -wlanTxPendingPackets ( - IN P_ADAPTER_T prAdapter, - IN OUT PBOOLEAN pfgHwAccess - ); - - -/*----------------------------------------------------------------------------*/ -/* Low Power Acquire/Release (for Glue Layer) */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanAcquirePowerControl( - IN P_ADAPTER_T prAdapter - ); - -WLAN_STATUS -wlanReleasePowerControl( - IN P_ADAPTER_T prAdapter - ); - - -/*----------------------------------------------------------------------------*/ -/* Pending Packets Number Reporting (for Glue Layer) */ -/*----------------------------------------------------------------------------*/ -UINT_32 -wlanGetTxPendingFrameCount ( - IN P_ADAPTER_T prAdapter - ); - - -/*----------------------------------------------------------------------------*/ -/* ACPI state inquiry (for Glue Layer) */ -/*----------------------------------------------------------------------------*/ -ENUM_ACPI_STATE_T -wlanGetAcpiState ( - IN P_ADAPTER_T prAdapter - ); - -VOID -wlanSetAcpiState ( - IN P_ADAPTER_T prAdapter, - IN ENUM_ACPI_STATE_T ePowerState - ); - -#if CFG_SUPPORT_OSC_SETTING && defined(MT5931) -WLAN_STATUS -wlanSetMcuOscStableTime ( - IN P_ADAPTER_T prAdapter, - IN UINT_16 u2OscStableTime - ); -#endif - -VOID -wlanDefTxPowerCfg ( - IN P_ADAPTER_T prAdapter - ); - -/*----------------------------------------------------------------------------*/ -/* get ECO version from Revision ID register (for Win32) */ -/*----------------------------------------------------------------------------*/ -UINT_8 -wlanGetEcoVersion( - IN P_ADAPTER_T prAdapter - ); - -/*----------------------------------------------------------------------------*/ -/* set preferred band configuration corresponding to network type */ -/*----------------------------------------------------------------------------*/ -VOID -wlanSetPreferBandByNetwork ( - IN P_ADAPTER_T prAdapter, - IN ENUM_BAND_T eBand, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ); - -/*----------------------------------------------------------------------------*/ -/* get currently operating channel information */ -/*----------------------------------------------------------------------------*/ -UINT_8 -wlanGetChannelNumberByNetwork ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ); - -/*----------------------------------------------------------------------------*/ -/* get BSS Descriptor information */ -/*----------------------------------------------------------------------------*/ -P_BSS_DESC_T -wlanGetTargetBssDescByNetwork ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ); - -/*----------------------------------------------------------------------------*/ -/* check for system configuration to generate message on scan list */ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanCheckSystemConfiguration ( - IN P_ADAPTER_T prAdapter - ); - - -#endif /* _WLAN_LIB_H */ - diff --git a/drivers/net/wireless/mt5931/include/wlan_oid.h b/drivers/net/wireless/mt5931/include/wlan_oid.h deleted file mode 100755 index 0f5a6b6e3f25..000000000000 --- a/drivers/net/wireless/mt5931/include/wlan_oid.h +++ /dev/null @@ -1,2073 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/wlan_oid.h#2 $ -*/ - -/*! \file "wlan_oid.h" - \brief This file contains the declairation file of the WLAN OID processing routines - of Windows driver for MediaTek Inc. 802.11 Wireless LAN Adapters. -*/ - - - -/* -** $Log: wlan_oid.h $ - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 01 05 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * Adding the related ioctl / wlan oid function to set the Tx power cfg. - * - * 07 18 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add CMD/Event for RDD and BWCS. - * - * 03 22 2011 george.huang - * [WCXRP00000504] [MT6620 Wi-Fi][FW] Support Sigma CAPI for power saving related command - * link with supplicant commands - * - * 03 17 2011 chinglan.wang - * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature - * . - * - * 03 02 2011 george.huang - * [WCXRP00000504] [MT6620 Wi-Fi][FW] Support Sigma CAPI for power saving related command - * Support UAPSD/OppPS/NoA parameter setting - * - * 01 20 2011 eddie.chen - * [WCXRP00000374] [MT6620 Wi-Fi][DRV] SW debug control - * Add Oid for sw control debug command - * - * 12 07 2010 cm.chang - * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant - * 1. Country code is from NVRAM or supplicant - * 2. Change band definition in CMD/EVENT. - * - * 10 18 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android - * complete implementation of Android NVRAM access - * - * 10 08 2010 cp.wu - * [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test - * adding fixed rate support for distance test. (from registry setting) - * - * 09 23 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * add skeleton for NVRAM integration - * - * 09 08 2010 cp.wu - * NULL - * use static memory pool for storing IEs of scanning result. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 29 2010 yuche.tsai - * NULL - * Finish SLT TX/RX & Rate Changing Support. - * - * 08 04 2010 cp.wu - * NULL - * revert changelist #15371, efuse read/write access will be done by RF test approach - * - * 08 04 2010 cp.wu - * NULL - * add OID definitions for EFUSE read/write access. - * - * 08 04 2010 yarco.yang - * NULL - * Add TX_AMPDU and ADDBA_REJECT command - * - * 08 02 2010 george.huang - * NULL - * add WMM-PS test related OID/ CMD handlers - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 22 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) add command warpper for STA-REC/BSS-INFO sync. - * 2) enhance command packet sending procedure for non-oid part - * 3) add command packet definitions for STA-REC/BSS-INFO sync. - * - * 06 18 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * migration from MT6620 firmware. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge wlan_def.h. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge wifi_var.h, precomp.h, cnm_timer.h (data type only) - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 06 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * move timer callback to glue layer. - * - * 05 20 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) integrate OID_GEN_NETWORK_LAYER_ADDRESSES with CMD_ID_SET_IP_ADDRESS - * 2) buffer statistics data for 2 seconds - * 3) use default value for adhoc parameters instead of 0 - * - * 05 18 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement Wakeup-on-LAN except firmware integration part - * - * 05 17 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * MT6620 is not supporting NDIS_PACKET_TYPE_PROMISCUOUS. - * - - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * 1) add timeout handler mechanism for pending command packets - * 2) add p2p add/removal key - * - * 05 13 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add NULL OID implementation for WOL-related OIDs. - * - * 04 22 2010 cp.wu - * [WPD00003830]add OID_802_11_PRIVACY_FILTER support - * enable RX filter OID - * - * 04 14 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * information buffer for query oid/ioctl is now buffered in prCmdInfo - * * * * * instead of glue-layer variable to improve multiple oid/ioctl capability - * - * 03 31 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * modify the wapi related code for new driver's design. - * - * 03 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * indicate media stream mode after set is done - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port - * - * 03 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement custom OID: EEPROM read/write access - * - * 02 09 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. Permanent and current MAC address are now retrieved by CMD/EVENT packets instead of hard-coded address - * * * * * * 2. follow MSDN defined behavior when associates to another AP - * * * * * * 3. for firmware download, packet size could be up to 2048 bytes - * - * 01 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) implement timeout mechanism when OID is pending for longer than 1 second - * * * 2) allow OID_802_11_CONFIGURATION to be executed when RF test mode is turned on - * - * 01 27 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * . - * - * 01 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement following 802.11 OIDs: - * * * * OID_802_11_RSSI, - * * * * OID_802_11_RSSI_TRIGGER, - * * * * OID_802_11_STATISTICS, - * * * * OID_802_11_DISASSOCIATE, - * * * * OID_802_11_POWER_MODE - * - * 01 21 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement OID_802_11_MEDIA_STREAM_MODE - * - * 01 21 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement OID_802_11_SUPPORTED_RATES / OID_802_11_DESIRED_RATES -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-12-08 11:38:11 GMT mtk02752 -** add declares for RF test related APIs -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-11-24 22:41:53 GMT mtk02752 -** remove u4SysTime, MSDN 10-second will be implemented in FW side -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-11-23 20:30:13 GMT mtk02752 -** add u4SysTime field in PARAM_BSSID_EX_T -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-11-12 19:48:35 GMT mtk02752 -** allow upper layer to set a packet filter with PROMISCUOUS mode -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:12:12 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _WLAN_OID_H -#define _WLAN_OID_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -#define PARAM_MAX_LEN_SSID 32 - -#define PARAM_MAC_ADDR_LEN 6 - -#define ETHERNET_HEADER_SZ 14 -#define ETHERNET_MIN_PKT_SZ 60 -#define ETHERNET_MAX_PKT_SZ 1514 - -#define PARAM_MAX_LEN_RATES 8 -#define PARAM_MAX_LEN_RATES_EX 16 - -#define PARAM_AUTH_REQUEST_REAUTH 0x01 -#define PARAM_AUTH_REQUEST_KEYUPDATE 0x02 -#define PARAM_AUTH_REQUEST_PAIRWISE_ERROR 0x06 -#define PARAM_AUTH_REQUEST_GROUP_ERROR 0x0E - -#define PARAM_EEPROM_READ_METHOD_READ 1 -#define PARAM_EEPROM_READ_METHOD_GETSIZE 0 - -#define PARAM_WHQL_RSSI_MAX_DBM (-10) -#define PARAM_WHQL_RSSI_MIN_DBM (-200) - -#define PARAM_DEVICE_WAKE_UP_ENABLE 0x00000001 -#define PARAM_DEVICE_WAKE_ON_PATTERN_MATCH_ENABLE 0x00000002 -#define PARAM_DEVICE_WAKE_ON_MAGIC_PACKET_ENABLE 0x00000004 - -#define PARAM_WAKE_UP_MAGIC_PACKET 0x00000001 -#define PARAM_WAKE_UP_PATTERN_MATCH 0x00000002 -#define PARAM_WAKE_UP_LINK_CHANGE 0x00000004 - - -/* Packet filter bit definitioin (UINT_32 bit-wise definition) */ -#define PARAM_PACKET_FILTER_DIRECTED 0x00000001 -#define PARAM_PACKET_FILTER_MULTICAST 0x00000002 -#define PARAM_PACKET_FILTER_ALL_MULTICAST 0x00000004 -#define PARAM_PACKET_FILTER_BROADCAST 0x00000008 -#define PARAM_PACKET_FILTER_PROMISCUOUS 0x00000020 -#define PARAM_PACKET_FILTER_ALL_LOCAL 0x00000080 -#if CFG_ENABLE_WIFI_DIRECT_CFG_80211 -#define PARAM_PACKET_FILTER_P2P_MASK 0xC0000000 -#define PARAM_PACKET_FILTER_PROBE_REQ 0x80000000 -#define PARAM_PACKET_FILTER_ACTION_FRAME 0x40000000 -#endif - -#if CFG_SLT_SUPPORT -#define PARAM_PACKET_FILTER_SUPPORTED (PARAM_PACKET_FILTER_DIRECTED | \ - PARAM_PACKET_FILTER_MULTICAST | \ - PARAM_PACKET_FILTER_BROADCAST | \ - PARAM_PACKET_FILTER_ALL_MULTICAST) -#else -#define PARAM_PACKET_FILTER_SUPPORTED (PARAM_PACKET_FILTER_DIRECTED | \ - PARAM_PACKET_FILTER_MULTICAST | \ - PARAM_PACKET_FILTER_BROADCAST) -#endif - -#define PARAM_MEM_DUMP_MAX_SIZE 2048 - -#define BT_PROFILE_PARAM_LEN 8 -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/* Parameters of User Configuration which match to NDIS5.1 */ -/*----------------------------------------------------------------------------*/ -/* NDIS_802_11_AUTHENTICATION_MODE */ -typedef enum _ENUM_PARAM_AUTH_MODE_T -{ - AUTH_MODE_OPEN, /*!< Open system */ - AUTH_MODE_SHARED, /*!< Shared key */ - AUTH_MODE_AUTO_SWITCH, /*!< Either open system or shared key */ - AUTH_MODE_WPA, - AUTH_MODE_WPA_PSK, - AUTH_MODE_WPA_NONE, /*!< For Ad hoc */ - AUTH_MODE_WPA2, - AUTH_MODE_WPA2_PSK, - AUTH_MODE_NUM /*!< Upper bound, not real case */ -} ENUM_PARAM_AUTH_MODE_T, *P_ENUM_PARAM_AUTH_MODE_T; - -/* NDIS_802_11_ENCRYPTION_STATUS *//* Encryption types */ -typedef enum _ENUM_WEP_STATUS_T -{ - ENUM_WEP_ENABLED, - ENUM_ENCRYPTION1_ENABLED = ENUM_WEP_ENABLED, - ENUM_WEP_DISABLED, - ENUM_ENCRYPTION_DISABLED = ENUM_WEP_DISABLED, - ENUM_WEP_KEY_ABSENT, - ENUM_ENCRYPTION1_KEY_ABSENT = ENUM_WEP_KEY_ABSENT, - ENUM_WEP_NOT_SUPPORTED, - ENUM_ENCRYPTION_NOT_SUPPORTED = ENUM_WEP_NOT_SUPPORTED, - ENUM_ENCRYPTION2_ENABLED, - ENUM_ENCRYPTION2_KEY_ABSENT, - ENUM_ENCRYPTION3_ENABLED, - ENUM_ENCRYPTION3_KEY_ABSENT -} ENUM_PARAM_ENCRYPTION_STATUS_T, *P_ENUM_PARAM_ENCRYPTION_STATUS_T; - - - -typedef UINT_8 PARAM_MAC_ADDRESS[PARAM_MAC_ADDR_LEN]; - -typedef UINT_32 PARAM_KEY_INDEX; -typedef UINT_64 PARAM_KEY_RSC; -typedef INT_32 PARAM_RSSI; - -typedef UINT_32 PARAM_FRAGMENTATION_THRESHOLD; -typedef UINT_32 PARAM_RTS_THRESHOLD; - -typedef UINT_8 PARAM_RATES[PARAM_MAX_LEN_RATES]; -typedef UINT_8 PARAM_RATES_EX[PARAM_MAX_LEN_RATES_EX]; - -typedef enum _ENUM_PARAM_PHY_TYPE_T { - PHY_TYPE_802_11ABG = 0, /*!< Can associated with 802.11abg AP, Scan dual band. */ - PHY_TYPE_802_11BG, /*!< Can associated with 802_11bg AP, Scan single band and not report 802_11a BSSs. */ - PHY_TYPE_802_11G, /*!< Can associated with 802_11g only AP, Scan single band and not report 802_11ab BSSs. */ - PHY_TYPE_802_11A, /*!< Can associated with 802_11a only AP, Scan single band and not report 802_11bg BSSs. */ - PHY_TYPE_802_11B, /*!< Can associated with 802_11b only AP, Scan single band and not report 802_11ag BSSs. */ - PHY_TYPE_NUM // 5 -} ENUM_PARAM_PHY_TYPE_T, *P_ENUM_PARAM_PHY_TYPE_T; - -typedef enum _ENUM_PARAM_OP_MODE_T { - NET_TYPE_IBSS = 0, /*!< Try to merge/establish an AdHoc, do periodic SCAN for merging. */ - NET_TYPE_INFRA, /*!< Try to join an Infrastructure, do periodic SCAN for joining. */ - NET_TYPE_AUTO_SWITCH, /*!< Try to join an Infrastructure, if fail then try to merge or - establish an AdHoc, do periodic SCAN for joining or merging. */ - NET_TYPE_DEDICATED_IBSS, /*!< Try to merge an AdHoc first, if fail then establish AdHoc permanently, no more SCAN. */ - NET_TYPE_NUM // 4 -} ENUM_PARAM_OP_MODE_T, *P_ENUM_PARAM_OP_MODE_T; - -typedef struct _PARAM_SSID_T { - UINT_32 u4SsidLen; /*!< SSID length in bytes. Zero length is broadcast(any) SSID */ - UINT_8 aucSsid[PARAM_MAX_LEN_SSID]; -} PARAM_SSID_T, *P_PARAM_SSID_T; - -/* This is enum defined for user to select an AdHoc Mode */ -typedef enum _ENUM_PARAM_AD_HOC_MODE_T { - AD_HOC_MODE_11B = 0, /*!< Create 11b IBSS if we support 802.11abg/802.11bg. */ - AD_HOC_MODE_MIXED_11BG, /*!< Create 11bg mixed IBSS if we support 802.11abg/802.11bg/802.11g. */ - AD_HOC_MODE_11G, /*!< Create 11g only IBSS if we support 802.11abg/802.11bg/802.11g. */ - AD_HOC_MODE_11A, /*!< Create 11a only IBSS if we support 802.11abg. */ - AD_HOC_MODE_NUM // 4 -} ENUM_PARAM_AD_HOC_MODE_T, *P_ENUM_PARAM_AD_HOC_MODE_T; - - -typedef enum _ENUM_PARAM_MEDIA_STATE_T { - PARAM_MEDIA_STATE_CONNECTED, - PARAM_MEDIA_STATE_DISCONNECTED, - PARAM_MEDIA_STATE_TO_BE_INDICATED // for following MSDN re-association behavior -} ENUM_PARAM_MEDIA_STATE_T, *P_ENUM_PARAM_MEDIA_STATE_T; - - -typedef enum _ENUM_PARAM_NETWORK_TYPE_T { - PARAM_NETWORK_TYPE_FH, - PARAM_NETWORK_TYPE_DS, - PARAM_NETWORK_TYPE_OFDM5, - PARAM_NETWORK_TYPE_OFDM24, - PARAM_NETWORK_TYPE_AUTOMODE, - PARAM_NETWORK_TYPE_NUM /*!< Upper bound, not real case */ -} ENUM_PARAM_NETWORK_TYPE_T, *P_ENUM_PARAM_NETWORK_TYPE_T; - - -typedef struct _PARAM_NETWORK_TYPE_LIST { - UINT_32 NumberOfItems; /*!< At least 1 */ - ENUM_PARAM_NETWORK_TYPE_T eNetworkType [1]; -} PARAM_NETWORK_TYPE_LIST, *PPARAM_NETWORK_TYPE_LIST; - -typedef enum _ENUM_PARAM_PRIVACY_FILTER_T -{ - PRIVACY_FILTER_ACCEPT_ALL, - PRIVACY_FILTER_8021xWEP, - PRIVACY_FILTER_NUM -} ENUM_PARAM_PRIVACY_FILTER_T, *P_ENUM_PARAM_PRIVACY_FILTER_T; - -typedef enum _ENUM_RELOAD_DEFAULTS -{ - ENUM_RELOAD_WEP_KEYS -} PARAM_RELOAD_DEFAULTS, *P_PARAM_RELOAD_DEFAULTS; - -typedef struct _PARAM_PM_PACKET_PATTERN -{ - UINT_32 Priority; // Importance of the given pattern. - UINT_32 Reserved; // Context information for transports. - UINT_32 MaskSize; // Size in bytes of the pattern mask. - UINT_32 PatternOffset; // Offset from beginning of this - // structure to the pattern bytes. - UINT_32 PatternSize; // Size in bytes of the pattern. - UINT_32 PatternFlags; // Flags (TBD). -} PARAM_PM_PACKET_PATTERN, *P_PARAM_PM_PACKET_PATTERN; - -/*--------------------------------------------------------------*/ -/*! \brief Struct definition to indicate specific event. */ -/*--------------------------------------------------------------*/ -typedef enum _ENUM_STATUS_TYPE_T -{ - ENUM_STATUS_TYPE_AUTHENTICATION, - ENUM_STATUS_TYPE_MEDIA_STREAM_MODE, - ENUM_STATUS_TYPE_CANDIDATE_LIST, - ENUM_STATUS_TYPE_NUM /*!< Upper bound, not real case */ -} ENUM_STATUS_TYPE_T, *P_ENUM_STATUS_TYPE_T; - - -typedef struct _PARAM_802_11_CONFIG_FH_T { - UINT_32 u4Length; /*!< Length of structure */ - UINT_32 u4HopPattern; /*!< Defined as 802.11 */ - UINT_32 u4HopSet; /*!< to one if non-802.11 */ - UINT_32 u4DwellTime; /*!< In unit of Kusec */ -} PARAM_802_11_CONFIG_FH_T, *P_PARAM_802_11_CONFIG_FH_T; - -typedef struct _PARAM_802_11_CONFIG_T { - UINT_32 u4Length; /*!< Length of structure */ - UINT_32 u4BeaconPeriod; /*!< In unit of Kusec */ - UINT_32 u4ATIMWindow; /*!< In unit of Kusec */ - UINT_32 u4DSConfig; /*!< Channel frequency in unit of kHz */ - PARAM_802_11_CONFIG_FH_T rFHConfig; -} PARAM_802_11_CONFIG_T, *P_PARAM_802_11_CONFIG_T; - -typedef struct _PARAM_STATUS_INDICATION_T -{ - ENUM_STATUS_TYPE_T eStatusType; -} PARAM_STATUS_INDICATION_T, *P_PARAM_STATUS_INDICATION_T; - -typedef struct _PARAM_AUTH_REQUEST_T -{ - UINT_32 u4Length; /*!< Length of this struct */ - PARAM_MAC_ADDRESS arBssid; - UINT_32 u4Flags; /*!< Definitions are as follows */ -} PARAM_AUTH_REQUEST_T, *P_PARAM_AUTH_REQUEST_T; - -typedef struct _PARAM_AUTH_EVENT_T -{ - PARAM_STATUS_INDICATION_T rStatus; - PARAM_AUTH_REQUEST_T arRequest[1]; -} PARAM_AUTH_EVENT_T, *P_PARAM_AUTH_EVENT_T; - -/*! \brief Capabilities, privacy, rssi and IEs of each BSSID */ -typedef struct _PARAM_BSSID_EX_T { - UINT_32 u4Length; /*!< Length of structure */ - PARAM_MAC_ADDRESS arMacAddress; /*!< BSSID */ - UINT_8 Reserved[2]; - PARAM_SSID_T rSsid; /*!< SSID */ - UINT_32 u4Privacy; /*!< Need WEP encryption */ - PARAM_RSSI rRssi; /*!< in dBm */ - PARAM_RSSI AvgRssiX8; - PARAM_RSSI AvgRssi; - ENUM_PARAM_NETWORK_TYPE_T eNetworkTypeInUse; - PARAM_802_11_CONFIG_T rConfiguration; - ENUM_PARAM_OP_MODE_T eOpMode; - PARAM_RATES_EX rSupportedRates; - UINT_32 u4IELength; - UINT_8 aucIEs[1]; -} PARAM_BSSID_EX_T, *P_PARAM_BSSID_EX_T; - -/*! hold a table of mac and AvgRssiX8*/ -typedef struct _TABLE_RSSI_ { - PARAM_MAC_ADDRESS arMacAddress; /*!< BSSID */ - PARAM_RSSI AvgRssiX8; - PARAM_RSSI AvgRssi; -} TABLE_RSSI; - -#define MAX_SCAN_RSSI_NUM 128 -extern TABLE_RSSI mTABLE_RSSI[MAX_SCAN_RSSI_NUM]; - -typedef struct _PARAM_BSSID_LIST_EX { - UINT_32 u4NumberOfItems; /*!< at least 1 */ - PARAM_BSSID_EX_T arBssid[1]; -} PARAM_BSSID_LIST_EX_T, *P_PARAM_BSSID_LIST_EX_T; - - -typedef struct _PARAM_WEP_T -{ - UINT_32 u4Length; /*!< Length of structure */ - UINT_32 u4KeyIndex; /*!< 0: pairwise key, others group keys */ - UINT_32 u4KeyLength; /*!< Key length in bytes */ - UINT_8 aucKeyMaterial[32]; /*!< Key content by above setting */ -} PARAM_WEP_T, *P_PARAM_WEP_T; - -/*! \brief Key mapping of BSSID */ -typedef struct _PARAM_KEY_T -{ - UINT_32 u4Length; /*!< Length of structure */ - UINT_32 u4KeyIndex; /*!< KeyID */ - UINT_32 u4KeyLength; /*!< Key length in bytes */ - PARAM_MAC_ADDRESS arBSSID; /*!< MAC address */ - PARAM_KEY_RSC rKeyRSC; - UINT_8 aucKeyMaterial[32]; /*!< Key content by above setting */ -} PARAM_KEY_T, *P_PARAM_KEY_T; - -typedef struct _PARAM_REMOVE_KEY_T -{ - UINT_32 u4Length; /*!< Length of structure */ - UINT_32 u4KeyIndex; /*!< KeyID */ - PARAM_MAC_ADDRESS arBSSID; /*!< MAC address */ -} PARAM_REMOVE_KEY_T, *P_PARAM_REMOVE_KEY_T; - -#if CFG_SUPPORT_WAPI -typedef enum _ENUM_KEY_TYPE { - ENUM_WPI_PAIRWISE_KEY = 0, - ENUM_WPI_GROUP_KEY -} ENUM_KEY_TYPE; - -typedef enum _ENUM_WPI_PROTECT_TYPE -{ - ENUM_WPI_NONE, - ENUM_WPI_RX, - ENUM_WPI_TX, - ENUM_WPI_RX_TX -} ENUM_WPI_PROTECT_TYPE; - -typedef struct _PARAM_WPI_KEY_T { - ENUM_KEY_TYPE eKeyType; - ENUM_WPI_PROTECT_TYPE eDirection; - UINT_8 ucKeyID; - UINT_8 aucRsv[3]; - UINT_8 aucAddrIndex[12]; - UINT_32 u4LenWPIEK; - UINT_8 aucWPIEK[256]; - UINT_32 u4LenWPICK; - UINT_8 aucWPICK[256]; - UINT_8 aucPN[16]; -} PARAM_WPI_KEY_T, *P_PARAM_WPI_KEY_T; -#endif - - -typedef enum _PARAM_POWER_MODE -{ - Param_PowerModeCAM, - Param_PowerModeMAX_PSP, - Param_PowerModeFast_PSP, - Param_PowerModeMax /* Upper bound, not real case */ -} PARAM_POWER_MODE, *PPARAM_POWER_MODE; - -typedef enum _PARAM_DEVICE_POWER_STATE -{ - ParamDeviceStateUnspecified = 0, - ParamDeviceStateD0, - ParamDeviceStateD1, - ParamDeviceStateD2, - ParamDeviceStateD3, - ParamDeviceStateMaximum -} PARAM_DEVICE_POWER_STATE, *PPARAM_DEVICE_POWER_STATE; - -#if CFG_SUPPORT_802_11D - -/*! \brief The enumeration definitions for OID_IPN_MULTI_DOMAIN_CAPABILITY */ -typedef enum _PARAM_MULTI_DOMAIN_CAPABILITY { - ParamMultiDomainCapDisabled, - ParamMultiDomainCapEnabled -} PARAM_MULTI_DOMAIN_CAPABILITY, *P_PARAM_MULTI_DOMAIN_CAPABILITY; -#endif - -typedef struct _COUNTRY_STRING_ENTRY { - UINT_8 aucCountryCode[2]; - UINT_8 aucEnvironmentCode[2]; -} COUNTRY_STRING_ENTRY, *P_COUNTRY_STRING_ENTRY; - -/* Power management related definition and enumerations */ -#define UAPSD_NONE 0 -#define UAPSD_AC0 (BIT(0) | BIT(4)) -#define UAPSD_AC1 (BIT(1) | BIT(5)) -#define UAPSD_AC2 (BIT(2) | BIT(6)) -#define UAPSD_AC3 (BIT(3) | BIT(7)) -#define UAPSD_ALL (UAPSD_AC0 | UAPSD_AC1 | UAPSD_AC2 | UAPSD_AC3) - -typedef enum _ENUM_POWER_SAVE_PROFILE_T -{ - ENUM_PSP_CONTINUOUS_ACTIVE = 0, - ENUM_PSP_CONTINUOUS_POWER_SAVE, - ENUM_PSP_FAST_SWITCH, - ENUM_PSP_NUM -} ENUM_POWER_SAVE_PROFILE_T, *PENUM_POWER_SAVE_PROFILE_T; - - -/*--------------------------------------------------------------*/ -/*! \brief Set/Query testing type. */ -/*--------------------------------------------------------------*/ -typedef struct _PARAM_802_11_TEST_T -{ - UINT_32 u4Length; - UINT_32 u4Type; - union - { - PARAM_AUTH_EVENT_T AuthenticationEvent; - PARAM_RSSI RssiTrigger; - } u; -} PARAM_802_11_TEST_T, *P_PARAM_802_11_TEST_T; - - - -/*--------------------------------------------------------------*/ -/*! \brief Set/Query authentication and encryption capability. */ -/*--------------------------------------------------------------*/ -typedef struct _PARAM_AUTH_ENCRYPTION_T -{ - ENUM_PARAM_AUTH_MODE_T eAuthModeSupported; - ENUM_PARAM_ENCRYPTION_STATUS_T eEncryptStatusSupported; -} PARAM_AUTH_ENCRYPTION_T, *P_PARAM_AUTH_ENCRYPTION_T; - -typedef struct _PARAM_CAPABILITY_T -{ - UINT_32 u4Length; - UINT_32 u4Version; - UINT_32 u4NoOfPMKIDs; - UINT_32 u4NoOfAuthEncryptPairsSupported; - PARAM_AUTH_ENCRYPTION_T arAuthenticationEncryptionSupported[1]; -} PARAM_CAPABILITY_T, *P_PARAM_CAPABILITY_T; - -typedef UINT_8 PARAM_PMKID_VALUE[16]; - -typedef struct _PARAM_BSSID_INFO_T -{ - PARAM_MAC_ADDRESS arBSSID; - PARAM_PMKID_VALUE arPMKID; -} PARAM_BSSID_INFO_T, *P_PARAM_BSSID_INFO_T; - -typedef struct _PARAM_PMKID_T -{ - UINT_32 u4Length; - UINT_32 u4BSSIDInfoCount; - PARAM_BSSID_INFO_T arBSSIDInfo[1]; -} PARAM_PMKID_T, *P_PARAM_PMKID_T; - -/*! \brief PMKID candidate lists. */ -typedef struct _PARAM_PMKID_CANDIDATE_T { - PARAM_MAC_ADDRESS arBSSID; - UINT_32 u4Flags; -} PARAM_PMKID_CANDIDATE_T, *P_PARAM_PMKID_CANDIDATE_T; - -//#ifdef LINUX -typedef struct _PARAM_PMKID_CANDIDATE_LIST_T -{ - UINT_32 u4Version; /*!< Version */ - UINT_32 u4NumCandidates; /*!< How many candidates follow */ - PARAM_PMKID_CANDIDATE_T arCandidateList[1]; -} PARAM_PMKID_CANDIDATE_LIST_T, *P_PARAM_PMKID_CANDIDATE_LIST_T; -//#endif - -typedef struct _PARAM_CUSTOM_MCR_RW_STRUC_T { - UINT_32 u4McrOffset; - UINT_32 u4McrData; -} PARAM_CUSTOM_MCR_RW_STRUC_T, *P_PARAM_CUSTOM_MCR_RW_STRUC_T; - -typedef struct _PARAM_CUSTOM_MEM_DUMP_STRUC_T { - UINT_32 u4Address; - UINT_32 u4Length; - UINT_32 u4RemainLength; - UINT_8 ucFragNum; -} PARAM_CUSTOM_MEM_DUMP_STRUC_T, *P_PARAM_CUSTOM_MEM_DUMP_STRUC_T; - - -typedef struct _PARAM_CUSTOM_SW_CTRL_STRUC_T { - UINT_32 u4Id; - UINT_32 u4Data; -} PARAM_CUSTOM_SW_CTRL_STRUC_T, *P_PARAM_CUSTOM_SW_CTRL_STRUC_T; - - -typedef struct _PARAM_CUSTOM_EEPROM_RW_STRUC_T { - UINT_8 ucEepromMethod; /* For read only read: 1, query size: 0*/ - UINT_8 ucEepromIndex; - UINT_8 reserved; - UINT_16 u2EepromData; -} PARAM_CUSTOM_EEPROM_RW_STRUC_T, *P_PARAM_CUSTOM_EEPROM_RW_STRUC_T, - PARAM_CUSTOM_NVRAM_RW_STRUCT_T, *P_PARAM_CUSTOM_NVRAM_RW_STRUCT_T; - -typedef struct _PARAM_CUSTOM_WMM_PS_TEST_STRUC_T { - UINT_8 bmfgApsdEnAc; /* b0~3: trigger-en AC0~3. b4~7: delivery-en AC0~3 */ - UINT_8 ucIsEnterPsAtOnce; /* enter PS immediately without 5 second guard after connected */ - UINT_8 ucIsDisableUcTrigger; /* not to trigger UC on beacon TIM is matched (under U-APSD) */ - UINT_8 reserved; -} PARAM_CUSTOM_WMM_PS_TEST_STRUC_T, *P_PARAM_CUSTOM_WMM_PS_TEST_STRUC_T; - -typedef struct _PARAM_CUSTOM_NOA_PARAM_STRUC_T { - UINT_32 u4NoaDurationMs; - UINT_32 u4NoaIntervalMs; - UINT_32 u4NoaCount; -} PARAM_CUSTOM_NOA_PARAM_STRUC_T, *P_PARAM_CUSTOM_NOA_PARAM_STRUC_T; - -typedef struct _PARAM_CUSTOM_OPPPS_PARAM_STRUC_T { - UINT_32 u4CTwindowMs; -} PARAM_CUSTOM_OPPPS_PARAM_STRUC_T, *P_PARAM_CUSTOM_OPPPS_PARAM_STRUC_T; - -typedef struct _PARAM_CUSTOM_UAPSD_PARAM_STRUC_T { - UINT_8 fgEnAPSD; - UINT_8 fgEnAPSD_AcBe; - UINT_8 fgEnAPSD_AcBk; - UINT_8 fgEnAPSD_AcVo; - UINT_8 fgEnAPSD_AcVi; - UINT_8 ucMaxSpLen; - UINT_8 aucResv[2]; -} PARAM_CUSTOM_UAPSD_PARAM_STRUC_T, *P_PARAM_CUSTOM_UAPSD_PARAM_STRUC_T; - -typedef struct _PARAM_CUSTOM_P2P_SET_STRUC_T { - UINT_32 u4Enable; - UINT_32 u4Mode; -} PARAM_CUSTOM_P2P_SET_STRUC_T, *P_PARAM_CUSTOM_P2P_SET_STRUC_T; - -typedef enum _ENUM_CFG_SRC_TYPE_T { - CFG_SRC_TYPE_EEPROM, - CFG_SRC_TYPE_NVRAM, - CFG_SRC_TYPE_UNKNOWN, - CFG_SRC_TYPE_NUM -} ENUM_CFG_SRC_TYPE_T, *P_ENUM_CFG_SRC_TYPE_T; - -typedef enum _ENUM_EEPROM_TYPE_T { - EEPROM_TYPE_NO, - EEPROM_TYPE_PRESENT, - EEPROM_TYPE_NUM -} ENUM_EEPROM_TYPE_T, *P_ENUM_EEPROM_TYPE_T; - -typedef struct _PARAM_QOS_TSINFO { - UINT_8 ucTrafficType; /* Traffic Type: 1 for isochronous 0 for asynchronous */ - UINT_8 ucTid; /* TSID: must be between 8 ~ 15 */ - UINT_8 ucDirection; /* direction */ - UINT_8 ucAccessPolicy; /* access policy */ - UINT_8 ucAggregation; /* aggregation */ - UINT_8 ucApsd; /* APSD */ - UINT_8 ucuserPriority; /* user priority */ - UINT_8 ucTsInfoAckPolicy; /* TSINFO ACK policy */ - UINT_8 ucSchedule; /* Schedule */ -} PARAM_QOS_TSINFO, *P_PARAM_QOS_TSINFO; - -typedef struct _PARAM_QOS_TSPEC { - PARAM_QOS_TSINFO rTsInfo; /* TS info field */ - UINT_16 u2NominalMSDUSize; /* nominal MSDU size */ - UINT_16 u2MaxMSDUsize; /* maximum MSDU size */ - UINT_32 u4MinSvcIntv; /* minimum service interval */ - UINT_32 u4MaxSvcIntv; /* maximum service interval */ - UINT_32 u4InactIntv; /* inactivity interval */ - UINT_32 u4SpsIntv; /* suspension interval */ - UINT_32 u4SvcStartTime; /* service start time */ - UINT_32 u4MinDataRate; /* minimum Data rate */ - UINT_32 u4MeanDataRate; /* mean data rate */ - UINT_32 u4PeakDataRate; /* peak data rate */ - UINT_32 u4MaxBurstSize; /* maximum burst size */ - UINT_32 u4DelayBound; /* delay bound */ - UINT_32 u4MinPHYRate; /* minimum PHY rate */ - UINT_16 u2Sba; /* surplus bandwidth allowance */ - UINT_16 u2MediumTime; /* medium time */ -} PARAM_QOS_TSPEC, *P_PARAM_QOS_TSPEC; - -typedef struct _PARAM_QOS_ADDTS_REQ_INFO { - PARAM_QOS_TSPEC rTspec; -} PARAM_QOS_ADDTS_REQ_INFO, *P_PARAM_QOS_ADDTS_REQ_INFO; - -typedef struct _PARAM_VOIP_CONFIG { - UINT_32 u4VoipTrafficInterval; /* 0: disable VOIP configuration */ -} PARAM_VOIP_CONFIG, *P_PARAM_VOIP_CONFIG; - -/*802.11 Statistics Struct*/ -typedef struct _PARAM_802_11_STATISTICS_STRUCT_T { - UINT_32 u4Length; // Length of structure - LARGE_INTEGER rTransmittedFragmentCount; - LARGE_INTEGER rMulticastTransmittedFrameCount; - LARGE_INTEGER rFailedCount; - LARGE_INTEGER rRetryCount; - LARGE_INTEGER rMultipleRetryCount; - LARGE_INTEGER rRTSSuccessCount; - LARGE_INTEGER rRTSFailureCount; - LARGE_INTEGER rACKFailureCount; - LARGE_INTEGER rFrameDuplicateCount; - LARGE_INTEGER rReceivedFragmentCount; - LARGE_INTEGER rMulticastReceivedFrameCount; - LARGE_INTEGER rFCSErrorCount; - LARGE_INTEGER rTKIPLocalMICFailures; - LARGE_INTEGER rTKIPICVErrors; - LARGE_INTEGER rTKIPCounterMeasuresInvoked; - LARGE_INTEGER rTKIPReplays; - LARGE_INTEGER rCCMPFormatErrors; - LARGE_INTEGER rCCMPReplays; - LARGE_INTEGER rCCMPDecryptErrors; - LARGE_INTEGER rFourWayHandshakeFailures; - LARGE_INTEGER rWEPUndecryptableCount; - LARGE_INTEGER rWEPICVErrorCount; - LARGE_INTEGER rDecryptSuccessCount; - LARGE_INTEGER rDecryptFailureCount; -} PARAM_802_11_STATISTICS_STRUCT_T, *P_PARAM_802_11_STATISTICS_STRUCT_T; - -/* Linux Network Device Statistics Struct */ -typedef struct _PARAM_LINUX_NETDEV_STATISTICS_T { - UINT_32 u4RxPackets; - UINT_32 u4TxPackets; - UINT_32 u4RxBytes; - UINT_32 u4TxBytes; - UINT_32 u4RxErrors; - UINT_32 u4TxErrors; - UINT_32 u4Multicast; -} PARAM_LINUX_NETDEV_STATISTICS_T, *P_PARAM_LINUX_NETDEV_STATISTICS_T; - - -typedef struct _PARAM_MTK_WIFI_TEST_STRUC_T { - UINT_32 u4FuncIndex; - UINT_32 u4FuncData; -} PARAM_MTK_WIFI_TEST_STRUC_T, *P_PARAM_MTK_WIFI_TEST_STRUC_T; - - -/* 802.11 Media stream constraints */ -typedef enum _ENUM_MEDIA_STREAM_MODE { - ENUM_MEDIA_STREAM_OFF, - ENUM_MEDIA_STREAM_ON -} ENUM_MEDIA_STREAM_MODE, *P_ENUM_MEDIA_STREAM_MODE; - -/* for NDIS 5.1 Media Streaming Change */ -typedef struct _PARAM_MEDIA_STREAMING_INDICATION { - PARAM_STATUS_INDICATION_T rStatus; - ENUM_MEDIA_STREAM_MODE eMediaStreamMode; -} PARAM_MEDIA_STREAMING_INDICATION, *P_PARAM_MEDIA_STREAMING_INDICATION; - - -#define PARAM_PROTOCOL_ID_DEFAULT 0x00 -#define PARAM_PROTOCOL_ID_TCP_IP 0x02 -#define PARAM_PROTOCOL_ID_IPX 0x06 -#define PARAM_PROTOCOL_ID_NBF 0x07 -#define PARAM_PROTOCOL_ID_MAX 0x0F -#define PARAM_PROTOCOL_ID_MASK 0x0F - -/* for NDIS OID_GEN_NETWORK_LAYER_ADDRESSES */ -typedef struct _PARAM_NETWORK_ADDRESS_IP -{ - UINT_16 sin_port; - UINT_32 in_addr; - UINT_8 sin_zero[8]; -} PARAM_NETWORK_ADDRESS_IP, *P_PARAM_NETWORK_ADDRESS_IP; - -typedef struct _PARAM_NETWORK_ADDRESS { - UINT_16 u2AddressLength; // length in bytes of Address[] in this - UINT_16 u2AddressType; // type of this address (PARAM_PROTOCOL_ID_XXX above) - UINT_8 aucAddress[1]; // actually AddressLength bytes long -} PARAM_NETWORK_ADDRESS, *P_PARAM_NETWORK_ADDRESS; - -// The following is used with OID_GEN_NETWORK_LAYER_ADDRESSES to set network layer addresses on an interface - -typedef struct _PARAM_NETWORK_ADDRESS_LIST -{ - UINT_32 u4AddressCount; // number of addresses following - UINT_16 u2AddressType; // type of this address (NDIS_PROTOCOL_ID_XXX above) - PARAM_NETWORK_ADDRESS arAddress[1]; // actually AddressCount elements long -} PARAM_NETWORK_ADDRESS_LIST, *P_PARAM_NETWORK_ADDRESS_LIST; - -#if CFG_SLT_SUPPORT - -#define FIXED_BW_LG20 0x0000 -#define FIXED_BW_UL20 0x2000 -#define FIXED_BW_DL40 0x3000 - -#define FIXED_EXT_CHNL_U20 0x4000 // For AGG register. -#define FIXED_EXT_CHNL_L20 0xC000 // For AGG regsiter. - -typedef enum _ENUM_MTK_LP_TEST_MODE_T { - ENUM_MTK_LP_TEST_NORMAL, - ENUM_MTK_LP_TEST_GOLDEN_SAMPLE, - ENUM_MTK_LP_TEST_DUT, - ENUM_MTK_LP_TEST_MODE_NUM -} ENUM_MTK_LP_TEST_MODE_T, *P_ENUM_MTK_LP_TEST_MODE_T; - -typedef enum _ENUM_MTK_SLT_FUNC_IDX_T { - ENUM_MTK_SLT_FUNC_DO_NOTHING, - ENUM_MTK_SLT_FUNC_INITIAL, - ENUM_MTK_SLT_FUNC_RATE_SET, - ENUM_MTK_SLT_FUNC_LP_SET, - ENUM_MTK_SLT_FUNC_NUM -} ENUM_MTK_SLT_FUNC_IDX_T, *P_ENUM_MTK_SLT_FUNC_IDX_T; - -typedef struct _PARAM_MTK_SLT_LP_TEST_STRUC_T { - ENUM_MTK_LP_TEST_MODE_T rLpTestMode; - UINT_32 u4BcnRcvNum; -} PARAM_MTK_SLT_LP_TEST_STRUC_T, *P_PARAM_MTK_SLT_LP_TEST_STRUC_T; - -typedef struct _PARAM_MTK_SLT_TR_TEST_STRUC_T { - ENUM_PARAM_NETWORK_TYPE_T rNetworkType; // Network Type OFDM5G or OFDM2.4G - UINT_32 u4FixedRate; // Fixed Rate including BW -} PARAM_MTK_SLT_TR_TEST_STRUC_T, *P_PARAM_MTK_SLT_TR_TEST_STRUC_T; - -typedef struct _PARAM_MTK_SLT_INITIAL_STRUC_T { - UINT_8 aucTargetMacAddr[PARAM_MAC_ADDR_LEN]; - UINT_16 u2SiteID; -} PARAM_MTK_SLT_INITIAL_STRUC_T, *P_PARAM_MTK_SLT_INITIAL_STRUC_T; - -typedef struct _PARAM_MTK_SLT_TEST_STRUC_T { - ENUM_MTK_SLT_FUNC_IDX_T rSltFuncIdx; - UINT_32 u4Length; /* Length of structure, - including myself */ - UINT_32 u4FuncInfoLen; /* Include following content - field and myself */ - union { - PARAM_MTK_SLT_INITIAL_STRUC_T rMtkInitTest; - PARAM_MTK_SLT_LP_TEST_STRUC_T rMtkLpTest; - PARAM_MTK_SLT_TR_TEST_STRUC_T rMtkTRTest; - } unFuncInfoContent; - -} PARAM_MTK_SLT_TEST_STRUC_T, *P_PARAM_MTK_SLT_TEST_STRUC_T; - -#endif - -/*--------------------------------------------------------------*/ -/*! \brief For Fixed Rate Configuration (Registry) */ -/*--------------------------------------------------------------*/ -typedef enum _ENUM_REGISTRY_FIXED_RATE_T { - FIXED_RATE_NONE, - FIXED_RATE_1M, - FIXED_RATE_2M, - FIXED_RATE_5_5M, - FIXED_RATE_11M, - FIXED_RATE_6M, - FIXED_RATE_9M, - FIXED_RATE_12M, - FIXED_RATE_18M, - FIXED_RATE_24M, - FIXED_RATE_36M, - FIXED_RATE_48M, - FIXED_RATE_54M, - FIXED_RATE_MCS0_20M_800NS, - FIXED_RATE_MCS1_20M_800NS, - FIXED_RATE_MCS2_20M_800NS, - FIXED_RATE_MCS3_20M_800NS, - FIXED_RATE_MCS4_20M_800NS, - FIXED_RATE_MCS5_20M_800NS, - FIXED_RATE_MCS6_20M_800NS, - FIXED_RATE_MCS7_20M_800NS, - FIXED_RATE_MCS0_20M_400NS, - FIXED_RATE_MCS1_20M_400NS, - FIXED_RATE_MCS2_20M_400NS, - FIXED_RATE_MCS3_20M_400NS, - FIXED_RATE_MCS4_20M_400NS, - FIXED_RATE_MCS5_20M_400NS, - FIXED_RATE_MCS6_20M_400NS, - FIXED_RATE_MCS7_20M_400NS, - FIXED_RATE_MCS0_40M_800NS, - FIXED_RATE_MCS1_40M_800NS, - FIXED_RATE_MCS2_40M_800NS, - FIXED_RATE_MCS3_40M_800NS, - FIXED_RATE_MCS4_40M_800NS, - FIXED_RATE_MCS5_40M_800NS, - FIXED_RATE_MCS6_40M_800NS, - FIXED_RATE_MCS7_40M_800NS, - FIXED_RATE_MCS32_800NS, - FIXED_RATE_MCS0_40M_400NS, - FIXED_RATE_MCS1_40M_400NS, - FIXED_RATE_MCS2_40M_400NS, - FIXED_RATE_MCS3_40M_400NS, - FIXED_RATE_MCS4_40M_400NS, - FIXED_RATE_MCS5_40M_400NS, - FIXED_RATE_MCS6_40M_400NS, - FIXED_RATE_MCS7_40M_400NS, - FIXED_RATE_MCS32_400NS, - FIXED_RATE_NUM -} ENUM_REGISTRY_FIXED_RATE_T, *P_ENUM_REGISTRY_FIXED_RATE_T; - -typedef enum _ENUM_BT_CMD_T { - BT_CMD_PROFILE = 0, - BT_CMD_UPDATE, - BT_CMD_NUM -} ENUM_BT_CMD_T; - -typedef enum _ENUM_BT_PROFILE_T { - BT_PROFILE_CUSTOM = 0, - BT_PROFILE_SCO, - BT_PROFILE_ACL, - BT_PROFILE_MIXED, - BT_PROFILE_NO_CONNECTION, - BT_PROFILE_NUM -} ENUM_BT_PROFILE_T; - -typedef struct _PTA_PROFILE_T { - ENUM_BT_PROFILE_T eBtProfile; - union { - UINT_8 aucBTPParams[BT_PROFILE_PARAM_LEN]; - /* 0: sco reserved slot time, - 1: sco idle slot time, - 2: acl throughput, - 3: bt tx power, - 4: bt rssi - 5: VoIP interval - 6: BIT(0) Use this field, BIT(1) 0 apply single/ 1 dual PTA setting. - */ - UINT_32 au4Btcr[4]; - } u; -} PTA_PROFILE_T, *P_PTA_PROFILE_T; - -typedef struct _PTA_IPC_T { - UINT_8 ucCmd; - UINT_8 ucLen; - union { - PTA_PROFILE_T rProfile; - UINT_8 aucBTPParams[BT_PROFILE_PARAM_LEN]; - } u; -} PARAM_PTA_IPC_T, *P_PARAM_PTA_IPC_T, PTA_IPC_T, *P_PTA_IPC_T; - -/*--------------------------------------------------------------*/ -/*! \brief CFG80211 Scan Request Container */ -/*--------------------------------------------------------------*/ - -typedef struct _PARAM_SCAN_REQUEST_EXT_T { - PARAM_SSID_T rSsid; - UINT_32 u4IELength; - PUINT_8 pucIE; -} PARAM_SCAN_REQUEST_EXT_T, *P_PARAM_SCAN_REQUEST_EXT_T; - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -/*--------------------------------------------------------------*/ -/* Routines to set parameters or query information. */ -/*--------------------------------------------------------------*/ -/***** Routines in wlan_oid.c *****/ -WLAN_STATUS -wlanoidQueryNetworkTypesSupported( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryNetworkTypeInUse( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetNetworkTypeInUse ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryBssid( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetBssidListScan( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetBssidListScanExt ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryBssidList( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetBssid( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetSsid( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQuerySsid( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryInfrastructureMode( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetInfrastructureMode( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryAuthMode( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetAuthMode( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -#if 0 -WLAN_STATUS -wlanoidQueryPrivacyFilter ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - - -WLAN_STATUS -wlanoidSetPrivacyFilter ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); -#endif - -WLAN_STATUS -wlanoidSetEncryptionStatus( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryEncryptionStatus( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetAddWep( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetRemoveWep( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetAddKey( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetRemoveKey( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetReloadDefaults( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetTest( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryCapability( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryFrequency ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetFrequency ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - - -WLAN_STATUS -wlanoidQueryAtimWindow ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetAtimWindow ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - - -WLAN_STATUS -wlanoidSetChannel ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryRssi( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryRssiTrigger( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetRssiTrigger( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryRtsThreshold ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetRtsThreshold ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQuery802dot11PowerSaveProfile ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSet802dot11PowerSaveProfile ( - IN P_ADAPTER_T prAdapter, - IN PVOID prSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryPmkid( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetPmkid( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQuerySupportedRates( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryDesiredRates ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetDesiredRates ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryPermanentAddr ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuf, - IN UINT_32 u4QueryBufLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryCurrentAddr ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuf, - IN UINT_32 u4QueryBufLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryPermanentAddr ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuf, - IN UINT_32 u4QueryBufLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryLinkSpeed( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryMcrRead ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryMemDump ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetMcrWrite ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - - -WLAN_STATUS -wlanoidQuerySwCtrlRead ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetSwCtrlWrite ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - - -WLAN_STATUS -wlanoidQueryEepromRead ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetEepromWrite ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryRfTestRxStatus ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryRfTestTxStatus ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryOidInterfaceVersion ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryVendorId( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryMulticastList( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetMulticastList( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryRcvError ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryRcvNoBuffer ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryRcvCrcError ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryStatistics ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -#ifdef LINUX - -WLAN_STATUS -wlanoidQueryStatisticsForLinux ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -#endif - -WLAN_STATUS -wlanoidQueryMediaStreamMode( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetMediaStreamMode( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryRcvOk( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryXmitOk( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryXmitError ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryXmitOneCollision ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryXmitMoreCollisions ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryXmitMaxCollisions ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - - -WLAN_STATUS -wlanoidSetCurrentPacketFilter( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryCurrentPacketFilter ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - - -WLAN_STATUS -wlanoidSetAcpiDevicePowerState ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryAcpiDevicePowerState ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - - -WLAN_STATUS -wlanoidSetDisassociate ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryFragThreshold ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetFragThreshold ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - - -WLAN_STATUS -wlanoidQueryAdHocMode ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetAdHocMode ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryBeaconInterval ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetBeaconInterval ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetCurrentAddr ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -#if CFG_TCP_IP_CHKSUM_OFFLOAD -WLAN_STATUS -wlanoidSetCSUMOffload ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen -); -#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */ - -WLAN_STATUS -wlanoidSetNetworkAddress ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryMaxFrameSize ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryMaxTotalSize ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetCurrentLookahead ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -/* RF Test related APIs */ -WLAN_STATUS -wlanoidRftestSetTestMode ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidRftestSetAbortTestMode ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidRftestQueryAutoTest ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidRftestSetAutoTest ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -#if CFG_SUPPORT_WAPI -WLAN_STATUS -wlanoidSetWapiMode ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetWapiAssocInfo ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetWapiKey( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); -#endif - -#if CFG_SUPPORT_WPS2 -WLAN_STATUS -wlanoidSetWSCAssocInfo ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); -#endif - -#if CFG_ENABLE_WAKEUP_ON_LAN -WLAN_STATUS -wlanoidSetAddWakeupPattern ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetRemoveWakeupPattern ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryEnableWakeup ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 u4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetEnableWakeup ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); -#endif - -WLAN_STATUS -wlanoidSetWiFiWmmPsTest ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetTxAmpdu ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetAddbaReject( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryNvramRead ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetNvramWrite ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryCfgSrcType( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryEepromType( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetCountryCode ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanSendMemDumpCmd ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen - ); - -#if CFG_SLT_SUPPORT - -WLAN_STATUS -wlanoidQuerySLTStatus( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidUpdateSLTMode( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -#endif - -#if 0 -WLAN_STATUS -wlanoidSetNoaParam ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetOppPsParam ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetUApsdParam ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); -#endif - -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetBT ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryBT ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetTxPower ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -/* -WLAN_STATUS -wlanoidQueryBtSingleAntenna ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetBtSingleAntenna ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetPta ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryPta ( - IN P_ADAPTER_T prAdapter, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); -*/ - -#if CFG_ENABLE_WIFI_DIRECT -WLAN_STATUS -wlanoidSetP2pMode ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); -#endif - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _WLAN_OID_H */ - diff --git a/drivers/net/wireless/mt5931/include/wlan_p2p.h b/drivers/net/wireless/mt5931/include/wlan_p2p.h deleted file mode 100755 index 4dc0a46a81a3..000000000000 --- a/drivers/net/wireless/mt5931/include/wlan_p2p.h +++ /dev/null @@ -1,424 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/wlan_p2p.h#3 $ -*/ - -/*! \file "wlan_p2p.h" - \brief This file contains the declairations of Wi-Fi Direct command - processing routines for MediaTek Inc. 802.11 Wireless LAN Adapters. -*/ - - - -/* -** $Log: wlan_p2p.h $ - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 11 19 2011 yuche.tsai - * NULL - * Add RSSI support for P2P network. - * - * 11 08 2011 yuche.tsai - * [WCXRP00001094] [Volunteer Patch][Driver] Driver version & supplicant version query & set support for service discovery version check. - * Add support for driver version query & p2p supplicant verseion set. - * For new service discovery mechanism sync. - * - * 10 18 2011 yuche.tsai - * [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch. - * Support Channle Query. - * - * 10 18 2011 yuche.tsai - * [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch. - * New 2.1 branch - - * - * 04 27 2011 george.huang - * [WCXRP00000684] [MT6620 Wi-Fi][Driver] Support P2P setting ARP filter - * Support P2P ARP filter setting on early suspend/ late resume - * - * 04 08 2011 george.huang - * [WCXRP00000621] [MT6620 Wi-Fi][Driver] Support P2P supplicant to set power mode - * separate settings of P2P and AIS - * - * 03 22 2011 george.huang - * [WCXRP00000504] [MT6620 Wi-Fi][FW] Support Sigma CAPI for power saving related command - * link with supplicant commands - * - * 03 07 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * rename the define to anti_pviracy. - * - * 03 02 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * Add Security check related code. - * - * 01 05 2011 cp.wu - * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery - * ioctl implementations for P2P Service Discovery - * - * 12 22 2010 cp.wu - * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery - * 1. header file restructure for more clear module isolation - * 2. add function interface definition for implementing Service Discovery callbacks - * - * 09 21 2010 kevin.huang - * [WCXRP00000054] [MT6620 Wi-Fi][Driver] Restructure driver for second Interface - * Isolate P2P related function for Hardware Software Bundle - * - * 08 16 2010 cp.wu - * NULL - * add subroutines for P2P to set multicast list. - * - * 08 16 2010 george.huang - * NULL - * support wlanoidSetP2pPowerSaveProfile() in P2P - * - * 08 16 2010 george.huang - * NULL - * Support wlanoidSetNetworkAddress() for P2P - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 17 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * MT6620 is not supporting NDIS_PACKET_TYPE_PROMISCUOUS. - * - - * -** -*/ - -#ifndef _WLAN_P2P_H -#define _WLAN_P2P_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -#if CFG_ENABLE_WIFI_DIRECT -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/* Service Discovery */ -typedef struct _PARAM_P2P_SEND_SD_RESPONSE { - PARAM_MAC_ADDRESS rReceiverAddr; - UINT_8 fgNeedTxDoneIndication; - UINT_8 ucChannelNum; - UINT_16 u2PacketLength; - UINT_8 aucPacketContent[0]; /*native 802.11*/ -} PARAM_P2P_SEND_SD_RESPONSE, *P_PARAM_P2P_SEND_SD_RESPONSE; - -typedef struct _PARAM_P2P_GET_SD_REQUEST { - PARAM_MAC_ADDRESS rTransmitterAddr; - UINT_16 u2PacketLength; - UINT_8 aucPacketContent[0]; /*native 802.11*/ -} PARAM_P2P_GET_SD_REQUEST, *P_PARAM_P2P_GET_SD_REQUEST; - -typedef struct _PARAM_P2P_GET_SD_REQUEST_EX { - PARAM_MAC_ADDRESS rTransmitterAddr; - UINT_16 u2PacketLength; - UINT_8 ucChannelNum; /* Channel Number Where SD Request is received. */ - UINT_8 ucSeqNum; /* Get SD Request by sequence number. */ - UINT_8 aucPacketContent[0]; /*native 802.11*/ -} PARAM_P2P_GET_SD_REQUEST_EX, *P_PARAM_P2P_GET_SD_REQUEST_EX; - -typedef struct _PARAM_P2P_SEND_SD_REQUEST { - PARAM_MAC_ADDRESS rReceiverAddr; - UINT_8 fgNeedTxDoneIndication; - UINT_8 ucVersionNum; /* Indicate the Service Discovery Supplicant Version. */ - UINT_16 u2PacketLength; - UINT_8 aucPacketContent[0]; /*native 802.11*/ -} PARAM_P2P_SEND_SD_REQUEST, *P_PARAM_P2P_SEND_SD_REQUEST; - -/* Service Discovery 1.0. */ -typedef struct _PARAM_P2P_GET_SD_RESPONSE { - PARAM_MAC_ADDRESS rTransmitterAddr; - UINT_16 u2PacketLength; - UINT_8 aucPacketContent[0]; /*native 802.11*/ -} PARAM_P2P_GET_SD_RESPONSE, *P_PARAM_P2P_GET_SD_RESPONSE; - -/* Service Discovery 2.0. */ -typedef struct _PARAM_P2P_GET_SD_RESPONSE_EX { - PARAM_MAC_ADDRESS rTransmitterAddr; - UINT_16 u2PacketLength; - UINT_8 ucSeqNum; /* Get SD Response by sequence number. */ - UINT_8 aucPacketContent[0]; /*native 802.11*/ -} PARAM_P2P_GET_SD_RESPONSE_EX, *P_PARAM_P2P_GET_SD_RESPONSE_EX; - - -typedef struct _PARAM_P2P_TERMINATE_SD_PHASE { - PARAM_MAC_ADDRESS rPeerAddr; -} PARAM_P2P_TERMINATE_SD_PHASE, *P_PARAM_P2P_TERMINATE_SD_PHASE; - - -/*! \brief Key mapping of BSSID */ -typedef struct _P2P_PARAM_KEY_T -{ - UINT_32 u4Length; /*!< Length of structure */ - UINT_32 u4KeyIndex; /*!< KeyID */ - UINT_32 u4KeyLength; /*!< Key length in bytes */ - PARAM_MAC_ADDRESS arBSSID; /*!< MAC address */ - PARAM_KEY_RSC rKeyRSC; - UINT_8 aucKeyMaterial[32]; /*!< Key content by above setting */ -} P2P_PARAM_KEY_T, *P_P2P_PARAM_KEY_T; - -#if CONFIG_NL80211_TESTMODE - -typedef struct _NL80211_DRIVER_TEST_PRE_PARAMS { - UINT_16 idx_mode; - UINT_16 idx; - UINT_32 value; -} NL80211_DRIVER_TEST_PRE_PARAMS, *P_NL80211_DRIVER_TEST_PRE_PARAMS; - - -typedef struct _NL80211_DRIVER_TEST_PARAMS { - UINT_32 index; - UINT_32 buflen; -} NL80211_DRIVER_TEST_PARAMS, *P_NL80211_DRIVER_TEST_PARAMS; - - -/* P2P Sigma*/ -typedef struct _NL80211_DRIVER_P2P_SIGMA_PARAMS { - NL80211_DRIVER_TEST_PARAMS hdr; - UINT_32 idx; - UINT_32 value; -}NL80211_DRIVER_P2P_SIGMA_PARAMS, *P_NL80211_DRIVER_P2P_SIGMA_PARAMS; - - -/* Hotspot Client Management */ -typedef struct _NL80211_DRIVER_hotspot_block_PARAMS { - NL80211_DRIVER_TEST_PARAMS hdr; - UINT_8 ucblocked; - UINT_8 aucBssid[MAC_ADDR_LEN]; -}NL80211_DRIVER_hotspot_block_PARAMS, *P_NL80211_DRIVER_hotspot_block_PARAMS; - -#endif - - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/*--------------------------------------------------------------*/ -/* Routines to handle command */ -/*--------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSetAddP2PKey( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetRemoveP2PKey( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetNetworkAddress( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetP2PMulticastList( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -/*--------------------------------------------------------------*/ -/* Service Discovery Subroutines */ -/*--------------------------------------------------------------*/ -WLAN_STATUS -wlanoidSendP2PSDRequest( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSendP2PSDResponse( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidGetP2PSDRequest( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidGetP2PSDResponse( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 puQueryInfoLen - ); - -WLAN_STATUS -wlanoidSetP2PTerminateSDPhase( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -#if CFG_SUPPORT_ANTI_PIRACY -WLAN_STATUS -wlanoidSetSecCheckRequest( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidGetSecCheckResponse( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); -#endif - -WLAN_STATUS -wlanoidSetNoaParam ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetOppPsParam ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetUApsdParam ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryP2pPowerSaveProfile ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetP2pPowerSaveProfile ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidSetP2pSetNetworkAddress ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -WLAN_STATUS -wlanoidQueryP2pOpChannel( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidQueryP2pVersion( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -WLAN_STATUS -wlanoidSetP2pSupplicantVersion( - IN P_ADAPTER_T prAdapter, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -#if CFG_SUPPORT_P2P_RSSI_QUERY -WLAN_STATUS -wlanoidQueryP2pRssi( - IN P_ADAPTER_T prAdapter, - IN PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); -#endif - - -/*--------------------------------------------------------------*/ -/* Callbacks for event indication */ -/*--------------------------------------------------------------*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif -#endif /* _WLAN_P2P_H */ - diff --git a/drivers/net/wireless/mt5931/mgmt/aaa_fsm.c b/drivers/net/wireless/mt5931/mgmt/aaa_fsm.c deleted file mode 100755 index 1d1479378e3a..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/aaa_fsm.c +++ /dev/null @@ -1,1490 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/aaa_fsm.c#2 $ -*/ - -/*! \file "aaa_fsm.c" - \brief This file defines the FSM for AAA MODULE. - - This file defines the FSM for AAA MODULE. -*/ - - - -/* -** $Log: aaa_fsm.c $ - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 06 13 2012 yuche.tsai - * NULL - * Update maintrunk driver. - * Add support for driver compose assoc request frame. - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 02 22 2012 yuche.tsai - * NULL - * Solve sigma test 5.1.3 issue, assoc response should have P2P IE. - * - * 12 02 2011 yuche.tsai - * NULL - * Resolve inorder issue under AP mode. - * - * data frame may TX before assoc response frame. - * - * 11 18 2011 yuche.tsai - * NULL - * CONFIG P2P support RSSI query, default turned off. - * - * 06 17 2011 terry.wu - * NULL - * Add BoW 11N support. - * - * 06 02 2011 eddie.chen - * [WCXRP00000759] [MT6620 Wi-Fi][DRV] Update RCPI in AAA - * Update RCPI when receiving Assoc request. - * - * 04 21 2011 terry.wu - * [WCXRP00000674] [MT6620 Wi-Fi][Driver] Refine AAA authSendAuthFrame - * Add network type parameter to authSendAuthFrame. - * - * 04 15 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add BOW short range mode. - * - * 04 09 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Change Link connection event procedure and change skb length check to 1512 bytes. - * - * 03 09 2011 wh.su - * [WCXRP00000530] [MT6620 Wi-Fi] [Driver] skip doing p2pRunEventAAAComplete after send assoc response Tx Done - * Skip to call p2pRunEventAAAComplete to avoid indicate STA connect twice. - * - * 03 04 2011 terry.wu - * [WCXRP00000515] [MT6620 Wi-Fi][Driver] Surpress compiler warning which is identified by GNU compiler collection - * Remove unused variable. - * - * 02 16 2011 yuche.tsai - * [WCXRP00000429] [Volunteer Patch][MT6620][Driver] Hot Spot Client Limit Issue - * Add more check after RX assoc frame under Hot-Spot mode. - * - * 02 09 2011 yuche.tsai - * [WCXRP00000429] [Volunteer Patch][MT6620][Driver] Hot Spot Client Limit Issue - * Fix Client Limit Issue. - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Change Station Type in Station Record, Modify MACRO definition for getting station type & network type index & Role. - * - * 01 15 2011 puff.wen - * NULL - * [On behalf of Frog] Add CFG_ENABLE_WIFI_DIRECT to p2pRunEventAAAComplete - * - * 01 14 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * Modify AAA flow according to CM's comment. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 29 2010 yuche.tsai - * NULL - * Fix Compile warning, type cast from UINT_32 to UINT_16. - * - * 08 26 2010 yuche.tsai - * NULL - * In P2P AT GO test mode under WinXP, we would not indicate connected event to host. - * - * 08 24 2010 cm.chang - * NULL - * Support RLM initail channel of Ad-hoc, P2P and BOW - * - * 08 23 2010 chinghwa.yu - * NULL - * Update for BOW. - * - * 08 20 2010 kevin.huang - * NULL - * Modify AAA Module for changing STA STATE 3 at p2p/bowRunEventAAAComplete() - * - * 08 17 2010 yuche.tsai - * NULL - * Fix bug while enabling P2P GO. - * - * 08 16 2010 kevin.huang - * NULL - * Refine AAA functions - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * refine TX-DONE callback. - * - * 06 21 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * modify due to P2P functino call prototype change. - * - * 06 17 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * First draft for migration P2P FSM from FW to Driver. - * - * 04 02 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Modify CFG flags - * - * 02 26 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * add support of Driver STA_RECORD_T activation - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#if 0 -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will send Event to AIS/BOW/P2P -* -* @param[in] rJoinStatus To indicate JOIN success or failure. -* @param[in] prStaRec Pointer to the STA_RECORD_T -* @param[in] prSwRfb Pointer to the SW_RFB_T - -* @return none -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -aaaFsmSendEventJoinComplete ( - WLAN_STATUS rJoinStatus, - P_STA_RECORD_T prStaRec, - P_SW_RFB_T prSwRfb - ) -{ - P_MSG_SAA_JOIN_COMP_T prJoinCompMsg; - - - ASSERT(prStaRec); - - prJoinCompMsg = cnmMemAlloc(RAM_TYPE_TCM, sizeof(MSG_SAA_JOIN_COMP_T)); - if (!prJoinCompMsg) { - return WLAN_STATUS_RESOURCES; - } - - if (IS_STA_IN_AIS(prStaRec)) { - prJoinCompMsg->rMsgHdr.eMsgId = MID_SAA_AIS_JOIN_COMPLETE; - } - else if (IS_STA_IN_P2P(prStaRec)) { - prJoinCompMsg->rMsgHdr.eMsgId = MID_SAA_P2P_JOIN_COMPLETE; - } - else if (IS_STA_IN_BOW(prStaRec)) { - prJoinCompMsg->rMsgHdr.eMsgId = MID_SAA_BOW_JOIN_COMPLETE; - } - else { - ASSERT(0); - } - - prJoinCompMsg->rJoinStatus = rJoinStatus; - prJoinCompMsg->prStaRec = prStaRec; - prJoinCompMsg->prSwRfb = prSwRfb; - - mboxSendMsg(MBOX_ID_0, - (P_MSG_HDR_T)prJoinCompMsg, - MSG_SEND_METHOD_BUF); - - return WLAN_STATUS_SUCCESS; - -} /* end of saaFsmSendEventJoinComplete() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will handle the Start Event to AAA FSM. -* -* @param[in] prMsgHdr Message of Join Request for a particular STA. -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -aaaFsmRunEventStart ( - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_SAA_JOIN_REQ_T prJoinReqMsg; - P_STA_RECORD_T prStaRec; - P_AIS_BSS_INFO_T prAisBssInfo; - - - ASSERT(prMsgHdr); - - prJoinReqMsg = (P_MSG_SAA_JOIN_REQ_T)prMsgHdr; - prStaRec = prJoinReqMsg->prStaRec; - - ASSERT(prStaRec); - - DBGLOG(SAA, LOUD, ("EVENT-START: Trigger SAA FSM\n")); - - cnmMemFree(prMsgHdr); - - //4 <1> Validation of SAA Start Event - if (!IS_AP_STA(prStaRec->eStaType)) { - - DBGLOG(SAA, ERROR, ("EVENT-START: STA Type - %d was not supported.\n", prStaRec->eStaType)); - - /* Ignore the return value because don't care the prSwRfb */ - saaFsmSendEventJoinComplete(WLAN_STATUS_FAILURE, prStaRec, NULL); - - return; - } - - //4 <2> The previous JOIN process is not completed ? - if (prStaRec->eAuthAssocState != AA_STATE_IDLE) { - DBGLOG(SAA, ERROR, ("EVENT-START: Reentry of SAA Module.\n")); - prStaRec->eAuthAssocState = AA_STATE_IDLE; - } - - //4 <3> Reset Status Code and Time - /* Update Station Record - Status/Reason Code */ - prStaRec->u2StatusCode = STATUS_CODE_SUCCESSFUL; - - /* Update the record join time. */ - GET_CURRENT_SYSTIME(&prStaRec->rLastJoinTime); - - prStaRec->ucTxAuthAssocRetryCount = 0; - - if (prStaRec->prChallengeText) { - cnmMemFree(prStaRec->prChallengeText); - prStaRec->prChallengeText = (P_IE_CHALLENGE_TEXT_T)NULL; - } - - cnmTimerStopTimer(&prStaRec->rTxReqDoneOrRxRespTimer); - - prStaRec->ucStaState = STA_STATE_1; - - /* Trigger SAA MODULE */ - saaFsmSteps(prStaRec, SAA_STATE_SEND_AUTH1, (P_SW_RFB_T)NULL); - - return; -} /* end of saaFsmRunEventStart() */ -#endif - - -#if CFG_SUPPORT_AAA -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will process the Rx Auth Request Frame and then -* trigger AAA FSM. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prSwRfb Pointer to the SW_RFB_T structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aaaFsmRunEventRxAuth ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_BSS_INFO_T prBssInfo; - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - UINT_16 u2StatusCode; - BOOLEAN fgReplyAuth = FALSE; - ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex; - - - ASSERT(prAdapter); - - do { - - - //4 <1> Check P2P network conditions -#if CFG_ENABLE_WIFI_DIRECT - if(prAdapter->fgIsP2PRegistered){ - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - if (prBssInfo->fgIsNetActive) { - - //4 <1.1> Validate Auth Frame by Auth Algorithm/Transation Seq - if (WLAN_STATUS_SUCCESS == - authProcessRxAuth1Frame(prAdapter, - prSwRfb, - prBssInfo->aucBSSID, - AUTH_ALGORITHM_NUM_OPEN_SYSTEM, - AUTH_TRANSACTION_SEQ_1, - &u2StatusCode)) { - - if (STATUS_CODE_SUCCESSFUL == u2StatusCode) { - //4 <1.2> Validate Auth Frame for Network Specific Conditions - fgReplyAuth = p2pFuncValidateAuth( - prAdapter, - prSwRfb, - &prStaRec, - &u2StatusCode); - } - else { - fgReplyAuth = TRUE; - } - eNetTypeIndex = NETWORK_TYPE_P2P_INDEX; - break; - } - } - } -#endif /* CFG_ENABLE_WIFI_DIRECT */ - - //4 <2> Check BOW network conditions -#if CFG_ENABLE_BT_OVER_WIFI - { - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]); - - if ((prBssInfo->fgIsNetActive) && - (OP_MODE_BOW == prBssInfo->eCurrentOPMode)) { - - //4 <2.1> Validate Auth Frame by Auth Algorithm/Transation Seq - /* Check if for this BSSID */ - if (WLAN_STATUS_SUCCESS == - authProcessRxAuth1Frame(prAdapter, - prSwRfb, - prBssInfo->aucBSSID, - AUTH_ALGORITHM_NUM_OPEN_SYSTEM, - AUTH_TRANSACTION_SEQ_1, - &u2StatusCode)) { - - if (STATUS_CODE_SUCCESSFUL == u2StatusCode) { - - //4 <2.2> Validate Auth Frame for Network Specific Conditions - fgReplyAuth = bowValidateAuth(prAdapter, prSwRfb, &prStaRec, &u2StatusCode); - - } - else { - - fgReplyAuth = TRUE; - } - eNetTypeIndex = NETWORK_TYPE_BOW_INDEX; - /* TODO(Kevin): Allocate a STA_RECORD_T for new client */ - break; - } - } - } -#endif /* CFG_ENABLE_BT_OVER_WIFI */ - - return; - } while (FALSE); - - if(prStaRec) { - /* update RCPI */ - prStaRec->ucRCPI = prSwRfb->prHifRxHdr->ucRcpi; - } - - //4 <3> Update STA_RECORD_T and reply Auth_2(Response to Auth_1) Frame - if (fgReplyAuth) { - - if (prStaRec) { - - if (u2StatusCode == STATUS_CODE_SUCCESSFUL) { - if (prStaRec->eAuthAssocState != AA_STATE_IDLE) { - DBGLOG(AAA, WARN, ("Previous AuthAssocState (%d) != IDLE.\n", - prStaRec->eAuthAssocState)); - } - - prStaRec->eAuthAssocState = AAA_STATE_SEND_AUTH2; - } - else { - prStaRec->eAuthAssocState = AA_STATE_IDLE; - - /* NOTE(Kevin): Change to STATE_1 */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - } - - /* Update the record join time. */ - GET_CURRENT_SYSTIME(&prStaRec->rUpdateTime); - - /* Update Station Record - Status/Reason Code */ - prStaRec->u2StatusCode = u2StatusCode; - - prStaRec->ucAuthAlgNum = AUTH_ALGORITHM_NUM_OPEN_SYSTEM; - } - else { - /* NOTE(Kevin): We should have STA_RECORD_T if the status code was successful */ - ASSERT(!(u2StatusCode == STATUS_CODE_SUCCESSFUL)); - } - - /* NOTE: Ignore the return status for AAA */ - //4 <4> Reply Auth - authSendAuthFrame(prAdapter, - prStaRec, - eNetTypeIndex, - prSwRfb, - AUTH_TRANSACTION_SEQ_2, - u2StatusCode); - - } - - return; -} /* end of aaaFsmRunEventRxAuth() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will process the Rx (Re)Association Request Frame and then -* trigger AAA FSM. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prSwRfb Pointer to the SW_RFB_T structure. -* -* @retval WLAN_STATUS_SUCCESS Always return success -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -aaaFsmRunEventRxAssoc ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_BSS_INFO_T prBssInfo; - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - UINT_16 u2StatusCode = STATUS_CODE_RESERVED; - BOOLEAN fgReplyAssocResp = FALSE; - - - ASSERT(prAdapter); - - do { - - //4 <1> Check if we have the STA_RECORD_T for incoming Assoc Req - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - - /* We should have the corresponding Sta Record. */ - if ((!prStaRec) || (!prStaRec->fgIsInUse)) { - ASSERT(0); // Only for debug phase - break; - } - - if (!IS_CLIENT_STA(prStaRec)) { - break; - } - - if (prStaRec->ucStaState == STA_STATE_3) { - /* Do Reassocation */ - } - else if ((prStaRec->ucStaState == STA_STATE_2) && - (prStaRec->eAuthAssocState == AAA_STATE_SEND_AUTH2)) { - /* Normal case */ - } - else { - DBGLOG(AAA, WARN, ("Previous AuthAssocState (%d) != SEND_AUTH2.\n", - prStaRec->eAuthAssocState)); - break; - } - - /* update RCPI */ - prStaRec->ucRCPI = prSwRfb->prHifRxHdr->ucRcpi; - - //4 <2> Check P2P network conditions -#if CFG_ENABLE_WIFI_DIRECT - if ((prAdapter->fgIsP2PRegistered) && (IS_STA_IN_P2P(prStaRec))) { - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - if (prBssInfo->fgIsNetActive) { - - //4 <2.1> Validate Assoc Req Frame and get Status Code - /* Check if for this BSSID */ - if (WLAN_STATUS_SUCCESS == - assocProcessRxAssocReqFrame(prAdapter, - prSwRfb, - &u2StatusCode)) { - - if (STATUS_CODE_SUCCESSFUL == u2StatusCode) { - //4 <2.2> Validate Assoc Req Frame for Network Specific Conditions - fgReplyAssocResp = p2pFuncValidateAssocReq( - prAdapter, - prSwRfb, - (PUINT_16)&u2StatusCode); - } - else { - fgReplyAssocResp = TRUE; - } - - break; - } - } - } -#endif /* CFG_ENABLE_WIFI_DIRECT */ - - //4 <3> Check BOW network conditions -#if CFG_ENABLE_BT_OVER_WIFI - if (IS_STA_IN_BOW(prStaRec)) { - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]); - - if ((prBssInfo->fgIsNetActive) && - (OP_MODE_BOW == prBssInfo->eCurrentOPMode)){ - - //4 <3.1> Validate Auth Frame by Auth Algorithm/Transation Seq - /* Check if for this BSSID */ - if (WLAN_STATUS_SUCCESS == - assocProcessRxAssocReqFrame(prAdapter, - prSwRfb, - &u2StatusCode)) { - - if (STATUS_CODE_SUCCESSFUL == u2StatusCode) { - - //4 <3.2> Validate Auth Frame for Network Specific Conditions - fgReplyAssocResp = bowValidateAssocReq(prAdapter, prSwRfb, &u2StatusCode); - - } - else { - - fgReplyAssocResp = TRUE; - } - - /* TODO(Kevin): Allocate a STA_RECORD_T for new client */ - break; - } - } - } -#endif /* CFG_ENABLE_BT_OVER_WIFI */ - - return WLAN_STATUS_SUCCESS; // To release the SW_RFB_T - } while (FALSE); - - - //4 <4> Update STA_RECORD_T and reply Assoc Resp Frame - if (fgReplyAssocResp) { - UINT_16 u2IELength; - PUINT_8 pucIE; - - if ((((P_WLAN_ASSOC_REQ_FRAME_T)(prSwRfb->pvHeader))->u2FrameCtrl & MASK_FRAME_TYPE) == - MAC_FRAME_REASSOC_REQ) { - - u2IELength = prSwRfb->u2PacketLen - - (UINT_16)OFFSET_OF(WLAN_REASSOC_REQ_FRAME_T, aucInfoElem[0]); - - pucIE = ((P_WLAN_REASSOC_REQ_FRAME_T)(prSwRfb->pvHeader))->aucInfoElem; - } - else { - u2IELength = prSwRfb->u2PacketLen - - (UINT_16)OFFSET_OF(WLAN_ASSOC_REQ_FRAME_T, aucInfoElem[0]); - - pucIE = ((P_WLAN_ASSOC_REQ_FRAME_T)(prSwRfb->pvHeader))->aucInfoElem; - } - - rlmProcessAssocReq(prAdapter, prSwRfb, pucIE, u2IELength); - - //4 <4.1> Assign Association ID - if (u2StatusCode == STATUS_CODE_SUCCESSFUL) { - -#if CFG_ENABLE_WIFI_DIRECT - if ((prAdapter->fgIsP2PRegistered) && (IS_STA_IN_P2P(prStaRec))) { - if (p2pRunEventAAAComplete(prAdapter, prStaRec) == WLAN_STATUS_SUCCESS) { - prStaRec->u2AssocId = bssAssignAssocID(prStaRec); - //prStaRec->eAuthAssocState = AA_STATE_IDLE; - prStaRec->eAuthAssocState = AAA_STATE_SEND_ASSOC2; // NOTE(Kevin): for TX done - - /* NOTE(Kevin): Method A: Change to STATE_3 before handle TX Done */ - //cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_3); - } - else { - /* Client List FULL. */ - u2StatusCode = STATUS_CODE_REQ_DECLINED; - - prStaRec->u2AssocId = 0; /* Invalid Assocation ID */ - - /* If (Re)association fail, the peer can try Assocation w/o Auth immediately */ - prStaRec->eAuthAssocState = AAA_STATE_SEND_AUTH2; - - /* NOTE(Kevin): Better to change state here, not at TX Done */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_2); - } - } -#endif - -#if CFG_ENABLE_BT_OVER_WIFI - if ((IS_STA_IN_BOW(prStaRec))) { - -// if (bowRunEventAAAComplete(prAdapter, prStaRec) == WLAN_STATUS_SUCCESS) { - prStaRec->u2AssocId = bssAssignAssocID(prStaRec); - prStaRec->eAuthAssocState = AAA_STATE_SEND_ASSOC2; // NOTE(Kevin): for TX done - - /* NOTE(Kevin): Method A: Change to STATE_3 before handle TX Done */ - //cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_3); - } -#if 0 - else { - /* Client List FULL. */ - u2StatusCode = STATUS_CODE_REQ_DECLINED; - - prStaRec->u2AssocId = 0; /* Invalid Assocation ID */ - - /* If (Re)association fail, the peer can try Assocation w/o Auth immediately */ - prStaRec->eAuthAssocState = AAA_STATE_SEND_AUTH2; - - /* NOTE(Kevin): Better to change state here, not at TX Done */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_2); - } - } -#endif -#endif - } - else { - prStaRec->u2AssocId = 0; /* Invalid Assocation ID */ - - /* If (Re)association fail, the peer can try Assocation w/o Auth immediately */ - prStaRec->eAuthAssocState = AAA_STATE_SEND_AUTH2; - - /* NOTE(Kevin): Better to change state here, not at TX Done */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_2); - } - - /* Update the record join time. */ - GET_CURRENT_SYSTIME(&prStaRec->rUpdateTime); - - /* Update Station Record - Status/Reason Code */ - prStaRec->u2StatusCode = u2StatusCode; - - /* NOTE: Ignore the return status for AAA */ - //4 <4.2> Reply Assoc Resp - assocSendReAssocRespFrame(prAdapter, prStaRec); - - } - - return WLAN_STATUS_SUCCESS; - -} /* end of aaaFsmRunEventRxAssoc() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will handle TxDone(Auth2/AssocReq) Event of AAA FSM. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prMsduInfo Pointer to the MSDU_INFO_T. -* @param[in] rTxDoneStatus Return TX status of the Auth1/Auth3/AssocReq frame. -* -* @retval WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -aaaFsmRunEventTxDone ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ) -{ - P_STA_RECORD_T prStaRec; - P_BSS_INFO_T prBssInfo; - - - ASSERT(prAdapter); - ASSERT(prMsduInfo); - - DBGLOG(AAA, LOUD, ("EVENT-TX DONE: Current Time = %ld\n", kalGetTimeTick())); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - if ((!prStaRec) || (!prStaRec->fgIsInUse)) { - return WLAN_STATUS_SUCCESS; /* For the case of replying ERROR STATUS CODE */ - } - - ASSERT(prStaRec->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]); - - switch (prStaRec->eAuthAssocState) { - case AAA_STATE_SEND_AUTH2: - { - /* Strictly check the outgoing frame is matched with current AA STATE */ - if (authCheckTxAuthFrame(prAdapter, - prMsduInfo, - AUTH_TRANSACTION_SEQ_2) != WLAN_STATUS_SUCCESS) { - break; - } - - if (STATUS_CODE_SUCCESSFUL == prStaRec->u2StatusCode) { - if (TX_RESULT_SUCCESS == rTxDoneStatus) { - - /* NOTE(Kevin): Change to STATE_2 at TX Done */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_2); - } - else { - - prStaRec->eAuthAssocState = AA_STATE_IDLE; - - /* NOTE(Kevin): Change to STATE_1 */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - -#if CFG_ENABLE_WIFI_DIRECT - if ((prAdapter->fgIsP2PRegistered) && - (IS_STA_IN_P2P(prStaRec))) { - p2pRunEventAAATxFail(prAdapter, prStaRec); - } -#endif /* CFG_ENABLE_WIFI_DIRECT */ - -#if CFG_ENABLE_BT_OVER_WIFI - if (IS_STA_IN_BOW(prStaRec)) { - bowRunEventAAATxFail(prAdapter, prStaRec); - } -#endif /* CFG_ENABLE_BT_OVER_WIFI */ - } - - } - /* NOTE(Kevin): Ignore the TX Done Event of Auth Frame with Error Status Code */ - - } - break; - - case AAA_STATE_SEND_ASSOC2: - { - /* Strictly check the outgoing frame is matched with current SAA STATE */ - if (assocCheckTxReAssocRespFrame(prAdapter, prMsduInfo) != WLAN_STATUS_SUCCESS) { - break; - } - - if (STATUS_CODE_SUCCESSFUL == prStaRec->u2StatusCode) { - if (TX_RESULT_SUCCESS == rTxDoneStatus) { - - prStaRec->eAuthAssocState = AA_STATE_IDLE; - - /* NOTE(Kevin): Change to STATE_3 at TX Done */ -#if CFG_ENABLE_WIFI_DIRECT - if ((prAdapter->fgIsP2PRegistered) && - (IS_STA_IN_P2P(prStaRec))) { - p2pRunEventAAASuccess(prAdapter, prStaRec); - } -#endif /* CFG_ENABLE_WIFI_DIRECT */ - -#if CFG_ENABLE_BT_OVER_WIFI - - if (IS_STA_IN_BOW(prStaRec)) - { - bowRunEventAAAComplete(prAdapter, prStaRec); - } -#endif /* CFG_ENABLE_BT_OVER_WIFI */ - - } - else { - - prStaRec->eAuthAssocState = AAA_STATE_SEND_AUTH2; - - /* NOTE(Kevin): Change to STATE_2 */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_2); - -#if CFG_ENABLE_WIFI_DIRECT - if ((prAdapter->fgIsP2PRegistered) && - (IS_STA_IN_P2P(prStaRec))) { - p2pRunEventAAATxFail(prAdapter, prStaRec); - } -#endif /* CFG_ENABLE_WIFI_DIRECT */ - -#if CFG_ENABLE_BT_OVER_WIFI - if (IS_STA_IN_BOW(prStaRec)) { - bowRunEventAAATxFail(prAdapter, prStaRec); - } -#endif /* CFG_ENABLE_BT_OVER_WIFI */ - - } - } - /* NOTE(Kevin): Ignore the TX Done Event of Auth Frame with Error Status Code */ - } - break; - - default: - break; /* Ignore other cases */ - } - - - return WLAN_STATUS_SUCCESS; - -} /* end of aaaFsmRunEventTxDone() */ -#endif /* CFG_SUPPORT_AAA */ - - -#if 0 /* TODO(Kevin): for abort event, just reset the STA_RECORD_T. */ -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will send ABORT Event to JOIN FSM. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -saaFsmRunEventAbort ( - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_JOIN_INFO_T prJoinInfo; - P_STA_RECORD_T prStaRec; - - DEBUGFUNC("joinFsmRunEventAbort"); - - - ASSERT(prAdapter); - prJoinInfo = &prAdapter->rJoinInfo; - - DBGLOG(JOIN, EVENT, ("JOIN EVENT: ABORT\n")); - - - /* NOTE(Kevin): when reach here, the ARB_STATE should be in ARB_STATE_JOIN. */ - ASSERT(prJoinInfo->prBssDesc); - - //4 <1> Update Flags and Elements of JOIN Module. - /* Reset Send Auth/(Re)Assoc Frame Count */ - prJoinInfo->ucTxAuthAssocRetryCount = 0; - - /* Cancel all JOIN relative Timer */ - ARB_CANCEL_TIMER(prAdapter, - prJoinInfo->rTxRequestTimer); - - ARB_CANCEL_TIMER(prAdapter, - prJoinInfo->rRxResponseTimer); - - ARB_CANCEL_TIMER(prAdapter, - prJoinInfo->rJoinTimer); - - //4 <2> Update the associated STA_RECORD_T during JOIN. - /* Get a Station Record if possible, TA == BSSID for AP */ - prStaRec = staRecGetStaRecordByAddr(prAdapter, - prJoinInfo->prBssDesc->aucBSSID); - if (prStaRec) { - - /* Update Station Record - Class 1 Flag */ - prStaRec->ucStaState = STA_STATE_1; - } -#if DBG - else { - ASSERT(0); /* Shouldn't happened, because we already add this STA_RECORD_T at JOIN_STATE_INIT */ - } -#endif /* DBG */ - - //4 <3> Pull back to IDLE. - joinFsmSteps(prAdapter, JOIN_STATE_IDLE); - - //4 <4> If we are in Roaming, recover the settings of previous BSS. - /* NOTE: JOIN FAIL - - * Restore original setting from current BSS_INFO_T. - */ - if (prAdapter->eConnectionState == MEDIA_STATE_CONNECTED) { - joinAdoptParametersFromCurrentBss(prAdapter); - } - - return; -} /* end of joinFsmRunEventAbort() */ -#endif - - -/* TODO(Kevin): following code will be modified and move to AIS FSM */ -#if 0 -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will send Join Timeout Event to JOIN FSM. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* -* \retval WLAN_STATUS_FAILURE Fail because of Join Timeout -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -joinFsmRunEventJoinTimeOut ( - IN P_ADAPTER_T prAdapter - ) -{ - P_JOIN_INFO_T prJoinInfo; - P_STA_RECORD_T prStaRec; - - DEBUGFUNC("joinFsmRunEventJoinTimeOut"); - - - ASSERT(prAdapter); - prJoinInfo = &prAdapter->rJoinInfo; - - DBGLOG(JOIN, EVENT, ("JOIN EVENT: JOIN TIMEOUT\n")); - - /* Get a Station Record if possible, TA == BSSID for AP */ - prStaRec = staRecGetStaRecordByAddr(prAdapter, - prJoinInfo->prBssDesc->aucBSSID); - - /* We have renew this Sta Record when in JOIN_STATE_INIT */ - ASSERT(prStaRec); - - /* Record the Status Code of Authentication Request */ - prStaRec->u2StatusCode = STATUS_CODE_JOIN_TIMEOUT; - - /* Increase Failure Count */ - prStaRec->ucJoinFailureCount++; - - /* Reset Send Auth/(Re)Assoc Frame Count */ - prJoinInfo->ucTxAuthAssocRetryCount = 0; - - /* Cancel other JOIN relative Timer */ - ARB_CANCEL_TIMER(prAdapter, - prJoinInfo->rTxRequestTimer); - - ARB_CANCEL_TIMER(prAdapter, - prJoinInfo->rRxResponseTimer); - - /* Restore original setting from current BSS_INFO_T */ - if (prAdapter->eConnectionState == MEDIA_STATE_CONNECTED) { - joinAdoptParametersFromCurrentBss(prAdapter); - } - - /* Pull back to IDLE */ - joinFsmSteps(prAdapter, JOIN_STATE_IDLE); - - return WLAN_STATUS_FAILURE; - -} /* end of joinFsmRunEventJoinTimeOut() */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will adopt the parameters from Peer BSS. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -joinAdoptParametersFromPeerBss ( - IN P_ADAPTER_T prAdapter - ) -{ - P_JOIN_INFO_T prJoinInfo; - P_BSS_DESC_T prBssDesc; - - DEBUGFUNC("joinAdoptParametersFromPeerBss"); - - - ASSERT(prAdapter); - prJoinInfo = &prAdapter->rJoinInfo; - prBssDesc = prJoinInfo->prBssDesc; - - //4 <1> Adopt Peer BSS' PHY TYPE - prAdapter->eCurrentPhyType = prBssDesc->ePhyType; - - DBGLOG(JOIN, INFO, ("Target BSS[%s]'s PhyType = %s\n", - prBssDesc->aucSSID, (prBssDesc->ePhyType == PHY_TYPE_ERP_INDEX) ? "ERP" : "HR_DSSS")); - - - //4 <2> Adopt Peer BSS' Frequency(Band/Channel) - DBGLOG(JOIN, INFO, ("Target BSS's Channel = %d, Band = %d\n", - prBssDesc->ucChannelNum, prBssDesc->eBand)); - - nicSwitchChannel(prAdapter, - prBssDesc->eBand, - prBssDesc->ucChannelNum, - 10); - - prJoinInfo->fgIsParameterAdopted = TRUE; - - return; -} /* end of joinAdoptParametersFromPeerBss() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will adopt the parameters from current associated BSS. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -joinAdoptParametersFromCurrentBss ( - IN P_ADAPTER_T prAdapter - ) -{ - //P_JOIN_INFO_T prJoinInfo = &prAdapter->rJoinInfo; - P_BSS_INFO_T prBssInfo; - - - ASSERT(prAdapter); - prBssInfo = &prAdapter->rBssInfo; - - //4 <1> Adopt current BSS' PHY TYPE - prAdapter->eCurrentPhyType = prBssInfo->ePhyType; - - //4 <2> Adopt current BSS' Frequency(Band/Channel) - DBGLOG(JOIN, INFO, ("Current BSS's Channel = %d, Band = %d\n", - prBssInfo->ucChnl, prBssInfo->eBand)); - - nicSwitchChannel(prAdapter, - prBssInfo->eBand, - prBssInfo->ucChnl, - 10); - return; -} /* end of joinAdoptParametersFromCurrentBss() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will update all the SW variables and HW MCR registers after -* the association with target BSS. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -joinComplete ( - IN P_ADAPTER_T prAdapter - ) -{ - P_JOIN_INFO_T prJoinInfo; - P_BSS_DESC_T prBssDesc; - P_PEER_BSS_INFO_T prPeerBssInfo; - P_BSS_INFO_T prBssInfo; - P_CONNECTION_SETTINGS_T prConnSettings; - P_STA_RECORD_T prStaRec; - P_TX_CTRL_T prTxCtrl; -#if CFG_SUPPORT_802_11D - P_IE_COUNTRY_T prIECountry; -#endif - - DEBUGFUNC("joinComplete"); - - - ASSERT(prAdapter); - prJoinInfo = &prAdapter->rJoinInfo; - prBssDesc = prJoinInfo->prBssDesc; - prPeerBssInfo = &prAdapter->rPeerBssInfo; - prBssInfo = &prAdapter->rBssInfo; - prConnSettings = &prAdapter->rConnSettings; - prTxCtrl = &prAdapter->rTxCtrl; - -//4 <1> Update Connecting & Connected Flag of BSS_DESC_T. - /* Remove previous AP's Connection Flags if have */ - scanRemoveConnectionFlagOfBssDescByBssid(prAdapter, prBssInfo->aucBSSID); - - prBssDesc->fgIsConnected = TRUE; /* Mask as Connected */ - - if (prBssDesc->fgIsHiddenSSID) { - /* NOTE(Kevin): This is for the case of Passive Scan and the target BSS didn't - * broadcast SSID on its Beacon Frame. - */ - COPY_SSID(prBssDesc->aucSSID, - prBssDesc->ucSSIDLen, - prAdapter->rConnSettings.aucSSID, - prAdapter->rConnSettings.ucSSIDLen); - - if (prBssDesc->ucSSIDLen) { - prBssDesc->fgIsHiddenSSID = FALSE; - } -#if DBG - else { - ASSERT(0); - } -#endif /* DBG */ - - DBGLOG(JOIN, INFO, ("Hidden SSID! - Update SSID : %s\n", prBssDesc->aucSSID)); - } - - -//4 <2> Update BSS_INFO_T from BSS_DESC_T - //4 <2.A> PHY Type - prBssInfo->ePhyType = prBssDesc->ePhyType; - - //4 <2.B> BSS Type - prBssInfo->eBSSType = BSS_TYPE_INFRASTRUCTURE; - - //4 <2.C> BSSID - COPY_MAC_ADDR(prBssInfo->aucBSSID, prBssDesc->aucBSSID); - - DBGLOG(JOIN, INFO, ("JOIN to BSSID: ["MACSTR"]\n", MAC2STR(prBssDesc->aucBSSID))); - - - //4 <2.D> SSID - COPY_SSID(prBssInfo->aucSSID, - prBssInfo->ucSSIDLen, - prBssDesc->aucSSID, - prBssDesc->ucSSIDLen); - - //4 <2.E> Channel / Band information. - prBssInfo->eBand = prBssDesc->eBand; - prBssInfo->ucChnl = prBssDesc->ucChannelNum; - - //4 <2.F> RSN/WPA information. - secFsmRunEventStart(prAdapter); - prBssInfo->u4RsnSelectedPairwiseCipher = prBssDesc->u4RsnSelectedPairwiseCipher; - prBssInfo->u4RsnSelectedGroupCipher = prBssDesc->u4RsnSelectedGroupCipher; - prBssInfo->u4RsnSelectedAKMSuite = prBssDesc->u4RsnSelectedAKMSuite; - - if (secRsnKeyHandshakeEnabled()) { - prBssInfo->fgIsWPAorWPA2Enabled = TRUE; - } - else { - prBssInfo->fgIsWPAorWPA2Enabled = FALSE; - } - - //4 <2.G> Beacon interval. - prBssInfo->u2BeaconInterval = prBssDesc->u2BeaconInterval; - - //4 <2.H> DTIM period. - prBssInfo->ucDtimPeriod = prBssDesc->ucDTIMPeriod; - - //4 <2.I> ERP Information - if ((prBssInfo->ePhyType == PHY_TYPE_ERP_INDEX) && // Our BSS's PHY_TYPE is ERP now. - (prBssDesc->fgIsERPPresent)) { - - prBssInfo->fgIsERPPresent = TRUE; - prBssInfo->ucERP = prBssDesc->ucERP; /* Save the ERP for later check */ - } - else { /* Some AP, may send ProbeResp without ERP IE. Thus prBssDesc->fgIsERPPresent is FALSE. */ - prBssInfo->fgIsERPPresent = FALSE; - prBssInfo->ucERP = 0; - } - -#if CFG_SUPPORT_802_11D - //4 <2.J> Country inforamtion of the associated AP - if (prConnSettings->fgMultiDomainCapabilityEnabled) { - DOMAIN_INFO_ENTRY rDomainInfo; - if (domainGetDomainInfoByScanResult(prAdapter, &rDomainInfo)) { - if (prBssDesc->prIECountry) { - prIECountry = prBssDesc->prIECountry; - - domainParseCountryInfoElem(prIECountry, &prBssInfo->rDomainInfo); - - /* use the domain get from the BSS info */ - prBssInfo->fgIsCountryInfoPresent = TRUE; - nicSetupOpChnlList(prAdapter, prBssInfo->rDomainInfo.u2CountryCode, FALSE); - } else { - /* use the domain get from the scan result */ - prBssInfo->fgIsCountryInfoPresent = TRUE; - nicSetupOpChnlList(prAdapter, rDomainInfo.u2CountryCode, FALSE); - } - } - } -#endif - - //4 <2.K> Signal Power of the associated AP - prBssInfo->rRcpi = prBssDesc->rRcpi; - prBssInfo->rRssi = RCPI_TO_dBm(prBssInfo->rRcpi); - GET_CURRENT_SYSTIME(&prBssInfo->rRssiLastUpdateTime); - - //4 <2.L> Capability Field of the associated AP - prBssInfo->u2CapInfo = prBssDesc->u2CapInfo; - - DBGLOG(JOIN, INFO, ("prBssInfo-> fgIsERPPresent = %d, ucERP = %02x, rRcpi = %d, rRssi = %ld\n", - prBssInfo->fgIsERPPresent, prBssInfo->ucERP, prBssInfo->rRcpi, prBssInfo->rRssi)); - - -//4 <3> Update BSS_INFO_T from PEER_BSS_INFO_T & NIC RATE FUNC - //4 <3.A> Association ID - prBssInfo->u2AssocId = prPeerBssInfo->u2AssocId; - - //4 <3.B> WMM Infomation - if (prAdapter->fgIsEnableWMM && - (prPeerBssInfo->rWmmInfo.ucWmmFlag & WMM_FLAG_SUPPORT_WMM)) { - - prBssInfo->fgIsWmmAssoc = TRUE; - prTxCtrl->rTxQForVoipAccess = TXQ_AC3; - - qosWmmInfoInit(&prBssInfo->rWmmInfo, (prBssInfo->ePhyType == PHY_TYPE_HR_DSSS_INDEX) ? TRUE : FALSE); - - if (prPeerBssInfo->rWmmInfo.ucWmmFlag & WMM_FLAG_AC_PARAM_PRESENT) { - kalMemCopy(&prBssInfo->rWmmInfo, - &prPeerBssInfo->rWmmInfo, - sizeof(WMM_INFO_T)); - } - else { - kalMemCopy(&prBssInfo->rWmmInfo, - &prPeerBssInfo->rWmmInfo, - sizeof(WMM_INFO_T) - sizeof(prPeerBssInfo->rWmmInfo.arWmmAcParams)); - } - } - else { - prBssInfo->fgIsWmmAssoc = FALSE; - prTxCtrl->rTxQForVoipAccess = TXQ_AC1; - - kalMemZero(&prBssInfo->rWmmInfo, sizeof(WMM_INFO_T)); - } - - - //4 <3.C> Operational Rate Set & BSS Basic Rate Set - prBssInfo->u2OperationalRateSet = prPeerBssInfo->u2OperationalRateSet; - prBssInfo->u2BSSBasicRateSet = prPeerBssInfo->u2BSSBasicRateSet; - - - //4 <3.D> Short Preamble - if (prBssInfo->fgIsERPPresent) { - - /* NOTE(Kevin 2007/12/24): Truth Table. - * Short Preamble Bit in - * Final Driver Setting(Short) - * TRUE FALSE FALSE FALSE(shouldn't have such case, use the AssocResp) - * TRUE FALSE TRUE FALSE - * FALSE FALSE FALSE FALSE(shouldn't have such case, use the AssocResp) - * FALSE FALSE TRUE FALSE - * TRUE TRUE FALSE TRUE(follow ERP) - * TRUE TRUE TRUE FALSE(follow ERP) - * FALSE TRUE FALSE FALSE(shouldn't have such case, and we should set to FALSE) - * FALSE TRUE TRUE FALSE(we should set to FALSE) - */ - if ((prPeerBssInfo->fgIsShortPreambleAllowed) && - ((prConnSettings->ePreambleType == PREAMBLE_TYPE_SHORT) || /* Short Preamble Option Enable is TRUE */ - ((prConnSettings->ePreambleType == PREAMBLE_TYPE_AUTO) && - (prBssDesc->u2CapInfo & CAP_INFO_SHORT_PREAMBLE)))) { - - prBssInfo->fgIsShortPreambleAllowed = TRUE; - - if (prBssInfo->ucERP & ERP_INFO_BARKER_PREAMBLE_MODE) { - prBssInfo->fgUseShortPreamble = FALSE; - } - else { - prBssInfo->fgUseShortPreamble = TRUE; - } - } - else { - prBssInfo->fgIsShortPreambleAllowed = FALSE; - prBssInfo->fgUseShortPreamble = FALSE; - } - } - else { - /* NOTE(Kevin 2007/12/24): Truth Table. - * Short Preamble Bit in - * Final Driver Setting(Short) - * TRUE FALSE FALSE - * FALSE FALSE FALSE - * TRUE TRUE TRUE - * FALSE TRUE(status success) TRUE - * --> Honor the result of prPeerBssInfo. - */ - - prBssInfo->fgIsShortPreambleAllowed = prBssInfo->fgUseShortPreamble = - prPeerBssInfo->fgIsShortPreambleAllowed; - } - - DBGLOG(JOIN, INFO, ("prBssInfo->fgIsShortPreambleAllowed = %d, prBssInfo->fgUseShortPreamble = %d\n", - prBssInfo->fgIsShortPreambleAllowed, prBssInfo->fgUseShortPreamble)); - - - //4 <3.E> Short Slot Time - prBssInfo->fgUseShortSlotTime = - prPeerBssInfo->fgUseShortSlotTime; /* AP support Short Slot Time */ - - DBGLOG(JOIN, INFO, ("prBssInfo->fgUseShortSlotTime = %d\n", - prBssInfo->fgUseShortSlotTime)); - - nicSetSlotTime(prAdapter, - prBssInfo->ePhyType, - ((prConnSettings->fgIsShortSlotTimeOptionEnable && - prBssInfo->fgUseShortSlotTime) ? TRUE : FALSE)); - - - //4 <3.F> Update Tx Rate for Control Frame - bssUpdateTxRateForControlFrame(prAdapter); - - - //4 <3.G> Save the available Auth Types during Roaming (Design for Fast BSS Transition). - //if (prAdapter->fgIsEnableRoaming) /* NOTE(Kevin): Always prepare info for roaming */ - { - - if (prJoinInfo->ucCurrAuthAlgNum == AUTH_ALGORITHM_NUM_OPEN_SYSTEM) { - prJoinInfo->ucRoamingAuthTypes |= AUTH_TYPE_OPEN_SYSTEM; - } - else if (prJoinInfo->ucCurrAuthAlgNum == AUTH_ALGORITHM_NUM_SHARED_KEY) { - prJoinInfo->ucRoamingAuthTypes |= AUTH_TYPE_SHARED_KEY; - } - - prBssInfo->ucRoamingAuthTypes = prJoinInfo->ucRoamingAuthTypes; - - - /* Set the stable time of the associated BSS. We won't do roaming decision - * during the stable time. - */ - SET_EXPIRATION_TIME(prBssInfo->rRoamingStableExpirationTime, - SEC_TO_SYSTIME(ROAMING_STABLE_TIMEOUT_SEC)); - } - - - //4 <3.H> Update Parameter for TX Fragmentation Threshold -#if CFG_TX_FRAGMENT - txFragInfoUpdate(prAdapter); -#endif /* CFG_TX_FRAGMENT */ - - -//4 <4> Update STA_RECORD_T - /* Get a Station Record if possible */ - prStaRec = staRecGetStaRecordByAddr(prAdapter, - prBssDesc->aucBSSID); - - if (prStaRec) { - UINT_16 u2OperationalRateSet, u2DesiredRateSet; - - //4 <4.A> Desired Rate Set - u2OperationalRateSet = (rPhyAttributes[prBssInfo->ePhyType].u2SupportedRateSet & - prBssInfo->u2OperationalRateSet); - - u2DesiredRateSet = (u2OperationalRateSet & prConnSettings->u2DesiredRateSet); - if (u2DesiredRateSet) { - prStaRec->u2DesiredRateSet = u2DesiredRateSet; - } - else { - /* For Error Handling - The Desired Rate Set is not covered in Operational Rate Set. */ - prStaRec->u2DesiredRateSet = u2OperationalRateSet; - } - - /* Try to set the best initial rate for this entry */ - if (!rateGetBestInitialRateIndex(prStaRec->u2DesiredRateSet, - prStaRec->rRcpi, - &prStaRec->ucCurrRate1Index)) { - - if (!rateGetLowestRateIndexFromRateSet(prStaRec->u2DesiredRateSet, - &prStaRec->ucCurrRate1Index)) { - ASSERT(0); - } - } - - DBGLOG(JOIN, INFO, ("prStaRec->ucCurrRate1Index = %d\n", - prStaRec->ucCurrRate1Index)); - - //4 <4.B> Preamble Mode - prStaRec->fgIsShortPreambleOptionEnable = - prBssInfo->fgUseShortPreamble; - - //4 <4.C> QoS Flag - prStaRec->fgIsQoS = prBssInfo->fgIsWmmAssoc; - } -#if DBG - else { - ASSERT(0); - } -#endif /* DBG */ - - -//4 <5> Update NIC - //4 <5.A> Update BSSID & Operation Mode - nicSetupBSS(prAdapter, prBssInfo); - - //4 <5.B> Update WLAN Table. - if (nicSetHwBySta(prAdapter, prStaRec) == FALSE) { - ASSERT(FALSE); - } - - //4 <5.C> Update Desired Rate Set for BT. -#if CFG_TX_FRAGMENT - if (prConnSettings->fgIsEnableTxAutoFragmentForBT) { - txRateSetInitForBT(prAdapter, prStaRec); - } -#endif /* CFG_TX_FRAGMENT */ - - //4 <5.D> TX AC Parameter and TX/RX Queue Control - if (prBssInfo->fgIsWmmAssoc) { - -#if CFG_TX_AGGREGATE_HW_FIFO - nicTxAggregateTXQ(prAdapter, FALSE); -#endif /* CFG_TX_AGGREGATE_HW_FIFO */ - - qosUpdateWMMParametersAndAssignAllowedACI(prAdapter, &prBssInfo->rWmmInfo); - } - else { - -#if CFG_TX_AGGREGATE_HW_FIFO - nicTxAggregateTXQ(prAdapter, TRUE); -#endif /* CFG_TX_AGGREGATE_HW_FIFO */ - - nicTxNonQoSAssignDefaultAdmittedTXQ(prAdapter); - - nicTxNonQoSUpdateTXQParameters(prAdapter, - prBssInfo->ePhyType); - } - -#if CFG_TX_STOP_WRITE_TX_FIFO_UNTIL_JOIN - { - prTxCtrl->fgBlockTxDuringJoin = FALSE; - - #if !CFG_TX_AGGREGATE_HW_FIFO /* TX FIFO AGGREGATE already do flush once */ - nicTxFlushStopQueues(prAdapter, (UINT_8)TXQ_DATA_MASK, (UINT_8)NULL); - #endif /* CFG_TX_AGGREGATE_HW_FIFO */ - - nicTxRetransmitOfSendWaitQue(prAdapter); - - if (prTxCtrl->fgIsPacketInOsSendQueue) { - nicTxRetransmitOfOsSendQue(prAdapter); - } - - #if CFG_SDIO_TX_ENHANCE - halTxLeftClusteredMpdu(prAdapter); - #endif /* CFG_SDIO_TX_ENHANCE */ - - } -#endif /* CFG_TX_STOP_WRITE_TX_FIFO_UNTIL_JOIN */ - - -//4 <6> Setup CONNECTION flag. - prAdapter->eConnectionState = MEDIA_STATE_CONNECTED; - prAdapter->eConnectionStateIndicated = MEDIA_STATE_CONNECTED; - - if (prJoinInfo->fgIsReAssoc) { - prAdapter->fgBypassPortCtrlForRoaming = TRUE; - } - else { - prAdapter->fgBypassPortCtrlForRoaming = FALSE; - } - - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_CONNECT, - (PVOID)NULL, - 0); - - return; -} /* end of joinComplete() */ -#endif - diff --git a/drivers/net/wireless/mt5931/mgmt/ais_fsm.c b/drivers/net/wireless/mt5931/mgmt/ais_fsm.c deleted file mode 100755 index f903fbd65bd3..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/ais_fsm.c +++ /dev/null @@ -1,4599 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/ais_fsm.c#1 $ -*/ - -/*! \file "aa_fsm.c" - \brief This file defines the FSM for SAA and AAA MODULE. - - This file defines the FSM for SAA and AAA MODULE. -*/ - - - -/* -** $Log: ais_fsm.c $ - * - * 04 20 2012 cp.wu - * [WCXRP00000913] [MT6620 Wi-Fi] create repository of source code dedicated for MT6620 E6 ASIC - * correct macro - * - * 01 16 2012 cp.wu - * [MT6620 Wi-Fi][Driver] API and behavior modification for preferred band configuration with corresponding network configuration - * add wlanSetPreferBandByNetwork() for glue layer to invoke for setting preferred band configuration corresponding to network type. - * - * 11 24 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * Adjust code for DBG and CONFIG_XLOG. - * - * 11 22 2011 cp.wu - * [WCXRP00001120] [MT6620 Wi-Fi][Driver] Modify roaming to AIS state transition from synchronous to asynchronous approach to avoid incomplete state termination - * 1. change RDD related compile option brace position. - * 2. when roaming is triggered, ask AIS to transit immediately only when AIS is in Normal TR state without join timeout timer ticking - * 3. otherwise, insert AIS_REQUEST into pending request queue - * - * 11 11 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * modify the xlog related code. - * - * 11 04 2011 cp.wu - * [WCXRP00001086] [MT6620 Wi-Fi][Driver] On Android, indicate an extra DISCONNECT for REASSOCIATED cases as an explicit trigger for Android framework - * correct reference to BSSID field in Association-Response frame. - * - * 11 04 2011 cp.wu - * [WCXRP00001086] [MT6620 Wi-Fi][Driver] On Android, indicate an extra DISCONNECT for REASSOCIATED cases as an explicit trigger for Android framework - * 1. for DEAUTH/DISASSOC cases, indicate for DISCONNECTION immediately. - * 2. (Android only) when reassociation-and-non-roaming cases happened, indicate an extra DISCONNECT indication to Android Wi-Fi framework - * - * 11 02 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * adding the code for XLOG. - * - * 10 26 2011 tsaiyuan.hsu - * [WCXRP00001064] [MT6620 Wi-Fi][DRV]] add code with roaming awareness when disconnecting AIS network - * be aware roaming when disconnecting AIS network. - * - * 10 25 2011 cm.chang - * [WCXRP00001058] [All Wi-Fi][Driver] Fix sta_rec's phyTypeSet and OBSS scan in AP mode - * STA_REC shall be NULL for Beacon's MSDU - * - * 10 13 2011 cp.wu - * [MT6620 Wi-Fi][Driver] Reduce join failure count limit to 2 for faster re-join for other BSS - * 1. short join failure count limit to 2 - * 2. treat join timeout as kind of join failure as well - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 09 30 2011 cm.chang - * [WCXRP00001020] [MT6620 Wi-Fi][Driver] Handle secondary channel offset of AP in 5GHz band - * . - * - * 09 20 2011 tsaiyuan.hsu - * [WCXRP00000931] [MT5931 Wi-Fi][DRV/FW] add swcr to disable roaming from driver - * change window registry of driver for roaming. - * - * 09 20 2011 cm.chang - * [WCXRP00000997] [MT6620 Wi-Fi][Driver][FW] Handle change of BSS preamble type and slot time - * Handle client mode about preamble type and slot time - * - * 09 08 2011 tsaiyuan.hsu - * [WCXRP00000972] [MT6620 Wi-Fi][DRV]] check if roaming occurs after join failure to avoid state incosistence. - * check if roaming occurs after join failure to avoid deactivation of network. - * - * 08 24 2011 chinghwa.yu - * [WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Update RDD test mode cases. - * - * 08 16 2011 tsaiyuan.hsu - * [WCXRP00000931] [MT5931 Wi-Fi][DRV/FW] add swcr to disable roaming from driver - * EnableRoaming in registry is deprecated. - * - * 08 16 2011 tsaiyuan.hsu - * [WCXRP00000931] [MT5931 Wi-Fi][DRV/FW] add swcr to disable roaming from driver - * use registry to enable or disable roaming. - * - * 07 07 2011 cp.wu - * [WCXRP00000840] [MT6620 Wi-Fi][Driver][AIS] Stop timer for joining when channel is released due to join failure count exceeding limit - * stop timer when joining operation is failed due to try count exceeds limitation - * - * 06 28 2011 cp.wu - * [WCXRP00000815] [MT6620 Wi-Fi][Driver] allow single BSSID with multiple SSID settings to work around some tricky AP which use space character as hidden SSID - * do not handle SCAN request immediately after connected to increase the probability of receiving 1st beacon frame. - * - * 06 23 2011 cp.wu - * [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module - * change parameter name from PeerAddr to BSSID - * - * 06 20 2011 cp.wu - * [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module - * 1. specify target's BSSID when requesting channel privilege. - * 2. pass BSSID information to firmware domain - * - * 06 16 2011 cp.wu - * [WCXRP00000782] [MT6620 Wi-Fi][AIS] Treat connection at higher priority over scanning to avoid WZC connection timeout - * ensure DEAUTH is always sent before establish a new connection - * - * 06 16 2011 cp.wu - * [WCXRP00000782] [MT6620 Wi-Fi][AIS] Treat connection at higher priority over scanning to avoid WZC connection timeout - * typo fix: a right brace is missed. - * - * 06 16 2011 cp.wu - * [WCXRP00000782] [MT6620 Wi-Fi][AIS] Treat connection at higher priority over scanning to avoid WZC connection timeout - * When RECONNECT request is identified as disconnected, it is necessary to check for pending scan request. - * - * 06 16 2011 cp.wu - * [WCXRP00000757] [MT6620 Wi-Fi][Driver][SCN] take use of RLM API to filter out BSS in disallowed channels - * mark fgIsTransition as TRUE for state rolling. - * - * 06 16 2011 cp.wu - * [WCXRP00000782] [MT6620 Wi-Fi][AIS] Treat connection at higher priority over scanning to avoid WZC connection timeout - * always check for pending scan after switched into NORMAL_TR state. - * - * 06 14 2011 cp.wu - * [WCXRP00000782] [MT6620 Wi-Fi][AIS] Treat connection at higher priority over scanning to avoid WZC connection timeout - * always treat connection request at higher priority over scanning request - * - * 06 09 2011 tsaiyuan.hsu - * [WCXRP00000760] [MT5931 Wi-Fi][FW] Refine rxmHandleMacRxDone to reduce code size - * move send_auth at rxmHandleMacRxDone in firmware to driver to reduce code size. - * - * 06 02 2011 cp.wu - * [WCXRP00000681] [MT5931][Firmware] HIF code size reduction - * eliminate unused parameters for SAA-FSM - * - * 05 18 2011 cp.wu - * [WCXRP00000732] [MT6620 Wi-Fi][AIS] No need to switch back to IDLE state when DEAUTH frame is dropped due to bss disconnection - * change SCAN handling behavior when followed by a CONNECT/DISCONNECT requests by pending instead of dropping. - * - * 05 17 2011 cp.wu - * [WCXRP00000732] [MT6620 Wi-Fi][AIS] No need to switch back to IDLE state when DEAUTH frame is dropped due to bss disconnection - * when TX DONE status is TX_RESULT_DROPPED_IN_DRIVER, no need to switch back to IDLE state. - * - * 04 14 2011 cm.chang - * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency - * . - * - * 04 13 2011 george.huang - * [WCXRP00000628] [MT6620 Wi-Fi][FW][Driver] Modify U-APSD setting to default OFF - * remove assert - * - * 03 18 2011 cp.wu - * [WCXRP00000575] [MT6620 Wi-Fi][Driver][AIS] reduce memory usage when generating mailbox message for scan request - * when there is no IE needed for probe request, then request a smaller memory for mailbox message - * - * 03 17 2011 chinglan.wang - * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature - * . - * - * 03 17 2011 chinglan.wang - * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature - * . - * - * 03 16 2011 tsaiyuan.hsu - * [WCXRP00000517] [MT6620 Wi-Fi][Driver][FW] Fine Tune Performance of Roaming - * remove obsolete definition and unused variables. - * - * 03 11 2011 cp.wu - * [WCXRP00000535] [MT6620 Wi-Fi][Driver] Fixed channel operation when AIS and Tethering are operating concurrently - * When fixed channel operation is necessary, AIS-FSM would scan and only connect for BSS on the specific channel - * - * 03 09 2011 tsaiyuan.hsu - * [WCXRP00000517] [MT6620 Wi-Fi][Driver][FW] Fine Tune Performance of Roaming - * avoid clearing fgIsScanReqIssued so as to add scan results. - * - * 03 07 2011 terry.wu - * [WCXRP00000521] [MT6620 Wi-Fi][Driver] Remove non-standard debug message - * Toggle non-standard debug messages to comments. - * - * 03 04 2011 tsaiyuan.hsu - * [WCXRP00000517] [MT6620 Wi-Fi][Driver][FW] Fine Tune Performance of Roaming - * reset retry conter of attemp to connect to ap after completion of join. - * - * 03 04 2011 cp.wu - * [WCXRP00000515] [MT6620 Wi-Fi][Driver] Surpress compiler warning which is identified by GNU compiler collection - * surpress compile warning occured when compiled by GNU compiler collection. - * - * 03 02 2011 cp.wu - * [WCXRP00000503] [MT6620 Wi-Fi][Driver] Take RCPI brought by association response as initial RSSI right after connection is built. - * use RCPI brought by ASSOC-RESP after connection is built as initial RCPI to avoid using a uninitialized MAC-RX RCPI. - * - * 02 26 2011 tsaiyuan.hsu - * [WCXRP00000391] [MT6620 Wi-Fi][FW] Add Roaming Support - * not send disassoc or deauth to leaving AP so as to improve performace of roaming. - * - * 02 23 2011 cp.wu - * [WCXRP00000487] [MT6620 Wi-Fi][Driver][AIS] Serve scan and connect request with a queue-based approach to improve response time for scanning request - * when handling reconnect request, set fgTryScan as TRUE - * - * 02 22 2011 cp.wu - * [WCXRP00000487] [MT6620 Wi-Fi][Driver][AIS] Serve scan and connect request with a queue-based approach to improve response time for scanning request - * handle SCAN and RECONNECT with a FIFO approach. - * - * 02 09 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * Check if prRegInfo is null or not before initializing roaming parameters. - * - * 02 01 2011 cp.wu - * [WCXRP00000416] [MT6620 Wi-Fi][Driver] treat "unable to find BSS" as connection trial to prevent infinite reconnection trials - * treat "unable to find BSS" as connection trial to prevent infinite reconnection trials. - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * - * 01 26 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * . - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Fix Compile Error when DBG is disabled. - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Change Station Type in Station Record, Modify MACRO definition for getting station type & network type index & Role. - * - * 01 14 2011 cp.wu - * [WCXRP00000359] [MT6620 Wi-Fi][Driver] add an extra state to ensure DEAUTH frame is always sent - * Add an extra state to guarantee DEAUTH frame is sent then connect to new BSS. - * This change is due to WAPI AP needs DEAUTH frame as a necessary step in handshaking protocol. - * - * 01 11 2011 cp.wu - * [WCXRP00000307] [MT6620 Wi-Fi][SQA]WHQL test .2c_wlan_adhoc case fail. - * [IBSS] when merged in, the bss state should be updated to firmware to pass WHQL adhoc failed item - * - * 01 10 2011 cp.wu - * [WCXRP00000351] [MT6620 Wi-Fi][Driver] remove from scanning result in OID handling layer when the corresponding BSS is disconnected due to beacon timeout - * remove from scanning result when the BSS is disconnected due to beacon timeout. - * - * 01 03 2011 cp.wu - * [WCXRP00000337] [MT6620 Wi-FI][Driver] AIS-FSM not to invoke cnmStaRecResetStatus directly 'cause it frees all belonging STA-RECs - * do not invoke cnmStaRecResetStatus() directly, nicUpdateBss will do the things after bss is disconnected - * - * 12 30 2010 cp.wu - * [WCXRP00000270] [MT6620 Wi-Fi][Driver] Clear issues after concurrent networking support has been merged - * do not need to manipulate prStaRec after indicating BSS disconnection to firmware, 'cause all STA-RECs belongs to BSS has been freed already - * - * 12 27 2010 cp.wu - * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release - * add DEBUGFUNC() macro invoking for more detailed debugging information - * - * 12 23 2010 george.huang - * [WCXRP00000152] [MT6620 Wi-Fi] AP mode power saving function - * 1. update WMM IE parsing, with ASSOC REQ handling - * 2. extend U-APSD parameter passing from driver to FW - * - * 12 17 2010 cp.wu - * [WCXRP00000270] [MT6620 Wi-Fi][Driver] Clear issues after concurrent networking support has been merged - * before BSS disconnection is indicated to firmware, all correlated peer should be cleared and freed - * - * 12 07 2010 cm.chang - * [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk - * 1. BSSINFO include RLM parameter - * 2. free all sta records when network is disconnected - * - * 11 25 2010 yuche.tsai - * NULL - * Update SLT Function for QoS Support and not be affected by fixed rate function. - * - * 11 25 2010 cp.wu - * [WCXRP00000208] [MT6620 Wi-Fi][Driver] Add scanning with specified SSID to AIS FSM - * add scanning with specified SSID facility to AIS-FSM - * - * 11 01 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module - * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead - * 2) Remove CNM CH-RECOVER event handling - * 3) cfg read/write API renamed with kal prefix for unified naming rules. - * - * 10 26 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command - * 1) update NVRAM content template to ver 1.02 - * 2) add compile option for querying NIC capability (default: off) - * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting - * 4) correct auto-rate compiler error under linux (treat warning as error) - * 5) simplify usage of NVRAM and REG_INFO_T - * 6) add version checking between driver and firmware - * - * 10 14 2010 wh.su - * [WCXRP00000097] [MT6620 Wi-Fi] [Driver] Fixed the P2P not setting the fgIsChannelExt value make scan not abort - * initial the fgIsChannelExt value. - * - * 10 08 2010 cp.wu - * [WCXRP00000087] [MT6620 Wi-Fi][Driver] Cannot connect to 5GHz AP, driver will cause FW assert. - * correct erroneous logic: specifying eBand with incompatible eSco - * - * 10 04 2010 cp.wu - * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only - * remove ENUM_NETWORK_TYPE_T definitions - * - * 09 27 2010 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000065] Update BoW design and settings - * Update BCM/BoW design and settings. - * - * 09 23 2010 cp.wu - * [WCXRP00000049] [MT6620 Wi-Fi][Driver] Adhoc cannot be created successfully. - * keep IBSS-ALONE state retrying until further instruction is received - * - * 09 21 2010 cp.wu - * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated - * Do a complete reset with STA-REC null checking for RF test re-entry - * - * 09 09 2010 yuche.tsai - * NULL - * Fix NULL IE Beacon issue. Sync Beacon Content to FW before enable beacon. - * Both in IBSS Create & IBSS Merge - * - * 09 09 2010 cp.wu - * NULL - * frequency is in unit of KHz thus no need to divide 1000 once more. - * - * 09 06 2010 cp.wu - * NULL - * 1) initialize for correct parameter even for disassociation. - * 2) AIS-FSM should have a limit on trials to build connection - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 30 2010 cp.wu - * NULL - * eliminate klockwork errors - * - * 08 29 2010 yuche.tsai - * NULL - * Finish SLT TX/RX & Rate Changing Support. - * - * 08 25 2010 cp.wu - * NULL - * add option for enabling AIS 5GHz scan - * - * 08 25 2010 cp.wu - * NULL - * [AIS-FSM] IBSS no longer needs to acquire channel for beaconing, RLM/CNM will handle the channel switching when BSS information is updated - * - * 08 25 2010 george.huang - * NULL - * update OID/ registry control path for PM related settings - * - * 08 24 2010 cm.chang - * NULL - * Support RLM initail channel of Ad-hoc, P2P and BOW - * - * 08 20 2010 cm.chang - * NULL - * Migrate RLM code to host from FW - * - * 08 12 2010 cp.wu - * NULL - * check-in missed files. - * - * 08 12 2010 kevin.huang - * NULL - * Refine bssProcessProbeRequest() and bssSendBeaconProbeResponse() - * - * 08 09 2010 cp.wu - * NULL - * reset fgIsScanReqIssued when abort request is received right after join completion. - * - * 08 03 2010 cp.wu - * NULL - * surpress compilation warning. - * - * 08 02 2010 cp.wu - * NULL - * comment out deprecated members in BSS_INFO, which are only used by firmware rather than driver. - * - * 07 30 2010 cp.wu - * NULL - * 1) BoW wrapper: use definitions instead of hard-coded constant for error code - * 2) AIS-FSM: eliminate use of desired RF parameters, use prTargetBssDesc instead - * 3) add handling for RX_PKT_DESTINATION_HOST_WITH_FORWARD for GO-broadcast frames - * - * 07 29 2010 cp.wu - * NULL - * eliminate u4FreqInKHz usage, combined into rConnections.ucAdHoc* - * - * 07 29 2010 cp.wu - * NULL - * allocate on MGMT packet for IBSS beaconing. - * - * 07 29 2010 cp.wu - * NULL - * [AIS-FSM] fix: when join failed, release channel privilege as well - * - * 07 28 2010 cp.wu - * NULL - * reuse join-abort sub-procedure to reduce code size. - * - * 07 28 2010 cp.wu - * NULL - * 1) eliminate redundant variable eOPMode in prAdapter->rWlanInfo - * 2) change nicMediaStateChange() API prototype - * - * 07 26 2010 cp.wu - * - * AIS-FSM: when scan request is coming in the 1st 5 seconds of channel privilege period, just pend it til 5-sec. period finishes - * - * 07 26 2010 cp.wu - * - * AIS-FSM FIX: return channel privilege even when the privilege is not granted yet - * QM: qmGetFrameAction() won't assert when corresponding STA-REC index is not found - * - * 07 26 2010 cp.wu - * - * re-commit code logic being overwriten. - * - * 07 24 2010 wh.su - * - * .support the Wi-Fi RSN - * - * 07 23 2010 cp.wu - * - * 1) re-enable AIS-FSM beacon timeout handling. - * 2) scan done API revised - * - * 07 23 2010 cp.wu - * - * 1) enable Ad-Hoc - * 2) disable beacon timeout handling temporally due to unexpected beacon timeout event. - * - * 07 23 2010 cp.wu - * - * indicate scan done for linux wireless extension - * - * 07 23 2010 cp.wu - * - * add AIS-FSM handling for beacon timeout event. - * - * 07 22 2010 cp.wu - * - * 1) refine AIS-FSM indent. - * 2) when entering RF Test mode, flush 802.1X frames as well - * 3) when entering D3 state, flush 802.1X frames as well - * - * 07 21 2010 cp.wu - * - * separate AIS-FSM states into different cases of channel request. - * - * 07 21 2010 cp.wu - * - * 1) change BG_SCAN to ONLINE_SCAN for consistent term - * 2) only clear scanning result when scan is permitted to do - * - * 07 20 2010 cp.wu - * - * 1) [AIS] when new scan is issued, clear currently available scanning result except the connected one - * 2) refine disconnection behaviour when issued during BG-SCAN process - * - * 07 20 2010 cp.wu - * - * 1) bugfix: do not stop timer for join after switched into normal_tr state, for providing chance for DHCP handshasking - * 2) modify rsnPerformPolicySelection() invoking - * - * 07 19 2010 cp.wu - * - * 1) init AIS_BSS_INFO as channel number = 1 with band = 2.4GHz - * 2) correct typo - * - * 07 19 2010 wh.su - * - * update for security supporting. - * - * 07 19 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * when IBSS is being merged-in, send command packet to PM for connected indication - * - * 07 19 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * Add Ad-Hoc support to AIS-FSM - * - * 07 19 2010 jeffrey.chang - * - * Linux port modification - * - * 07 16 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * bugfix for SCN migration - * 1) modify QUEUE_CONCATENATE_QUEUES() so it could be used to concatence with an empty queue - * 2) before AIS issues scan request, network(BSS) needs to be activated first - * 3) only invoke COPY_SSID when using specified SSID for scan - * - * 07 15 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * for AIS scanning, driver specifies no extra IE for probe request - * - * 07 15 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * driver no longer generates probe request frames - * - * 07 14 2010 yarco.yang - * - * Remove CFG_MQM_MIGRATION - * - * 07 14 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * Refine AIS-FSM by divided into more states - * - * 07 13 2010 cm.chang - * - * Rename MSG_CH_RELEASE_T to MSG_CH_ABORT_T - * - * 07 09 2010 cp.wu - * - * 1) separate AIS_FSM state for two kinds of scanning. (OID triggered scan, and scan-for-connection) - * 2) eliminate PRE_BSS_DESC_T, Beacon/PrebResp is now parsed in single pass - * 3) implment DRV-SCN module, currently only accepts single scan request, other request will be directly dropped by returning BUSY - * - * 07 09 2010 george.huang - * - * [WPD00001556] Migrate PM variables from FW to driver: for composing QoS Info - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * take use of RLM module for parsing/generating HT IEs for 11n capability - * - * 07 08 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Rename MID_MNY_CNM_CH_RELEASE to MID_MNY_CNM_CH_ABORT - * - * 07 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * for first connection, if connecting failed do not enter into scan state. - * - * 07 06 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * once STA-REC is allocated and updated, invoke cnmStaRecChangeState() to sync. with firmware. - * - * 07 06 2010 george.huang - * [WPD00001556]Basic power managemenet function - * Update arguments for nicUpdateBeaconIETemplate() - * - * 07 06 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * STA-REC is maintained by CNM only. - * - * 07 05 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * remove unused definitions. - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * AIS-FSM integration with CNM channel request messages - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * implementation of DRV-SCN and related mailbox message handling. - * - * 06 30 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * sync. with CMD/EVENT document ver0.07. - * - * 06 29 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) sync to. CMD/EVENT document v0.03 - * 2) simplify DTIM period parsing in scan.c only, bss.c no longer parses it again. - * 3) send command packet to indicate FW-PM after - * a) 1st beacon is received after AIS has connected to an AP - * b) IBSS-ALONE has been created - * c) IBSS-MERGE has occured - * - * 06 25 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * modify Beacon/ProbeResp to complete parsing, - * because host software has looser memory usage restriction - * - * 06 23 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * integrate . - * - * 06 22 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * comment out RLM APIs by CFG_RLM_MIGRATION. - * - * 06 22 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) add command warpper for STA-REC/BSS-INFO sync. - * 2) enhance command packet sending procedure for non-oid part - * 3) add command packet definitions for STA-REC/BSS-INFO sync. - * - * 06 21 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Support CFG_MQM_MIGRATION flag - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add scan_fsm into building. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * RSN/PRIVACY compilation flag awareness correction - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 18 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * migration from MT6620 firmware. - * - * 06 15 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add scan.c. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * restore utility function invoking via hem_mbox to direct calls - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * auth.c is migrated. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add bss.c. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * change to enqueue TX frame infinitely. - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) eliminate CFG_CMD_EVENT_VERSION_0_9 - * 2) when disconnected, indicate nic directly (no event is needed) - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add buildable & linkable ais_fsm.c - * - * related reference are still waiting to be resolved - * - * 06 01 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add conditionial compiling flag to choose default available bandwidth - * - * 05 28 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add ClientList handling API - bssClearClientList, bssAddStaRecToClientList - * - * 05 24 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Refine authSendAuthFrame() for NULL STA_RECORD_T case and minimum deauth interval. - * - * 05 21 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Fix compile error if CFG_CMD_EVENT_VER_009 == 0 for prEventConnStatus->ucNetworkType. - * - * 05 21 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Refine txmInitWtblTxRateTable() - set TX initial rate according to AP's operation rate set - * - * 05 17 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Call pmAbort() and add ucNetworkType field in EVENT_CONNECTION_STATUS - * - * 05 14 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Fix compile warning - define of MQM_WMM_PARSING was removed - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add Power Management - Legacy PS-POLL support. - * - * 04 28 2010 tehuang.liu - * [BORA00000605][WIFISYS] Phase3 Integration - * Removed the use of compiling flag MQM_WMM_PARSING - * - * 04 27 2010 kevin.huang - * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support - * - * Fix typo - * - * 04 27 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add Set Slot Time and Beacon Timeout Support for AdHoc Mode - * - * 04 19 2010 kevin.huang - * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support - * Add Send Deauth for Class 3 Error and Leave Network Support - * - * 04 15 2010 wh.su - * [BORA00000680][MT6620] Support the statistic for Microsoft os query - * fixed the protected bit at cap info for ad-hoc. - * - * 04 13 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add new HW CH macro support - * - * 04 07 2010 chinghwa.yu - * [BORA00000563]Add WiFi CoEx BCM module - * Add TX Power Control RCPI function. - * - * 03 29 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * move the wlan table alloc / free to change state function. - * - * 03 25 2010 wh.su - * [BORA00000676][MT6620] Support the frequency setting and query at build connection / connection event - * modify the build connection and status event structure bu CMD_EVENT doc 0.09 draft, default is disable. - * - * 03 24 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * fixed some WHQL testing error. - * - * 03 24 2010 kevin.huang - * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support - * Add Set / Unset POWER STATE in AIS Network - * - * 03 16 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add AdHoc Mode - * - * 03 10 2010 kevin.huang - * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support - * Add Channel Manager for arbitration of JOIN and SCAN Req - * - * 03 03 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add PHY_CONFIG to change Phy Type - * - * 03 03 2010 chinghwa.yu - * [BORA00000563]Add WiFi CoEx BCM module - * Use bcmWiFiNotify to replace wifi_send_msg to pass infomation to BCM module. - * - * 03 03 2010 chinghwa.yu - * [BORA00000563]Add WiFi CoEx BCM module - * Remove wmt_task definition and add PTA function. - * - * 03 02 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Init TXM and MQM testing procedures in aisFsmRunEventJoinComplete() - * - * 03 01 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Modified aisUpdateBssInfo() to call TXM's functions for setting WTBL TX parameters - * - * 03 01 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * clear the pmkid cache while indicate media disconnect. - * - * 02 26 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * . - * - * 02 26 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Enabled MQM parsing WMM IEs for non-AP mode - * - * 02 26 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Remove CFG_TEST_VIRTUAL_CMD and add support of Driver STA_RECORD_T activation - * - * 02 25 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * use the Rx0 dor event indicate. - * - * 02 23 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Support dynamic channel selection - * - * 02 23 2010 wh.su - * [BORA00000621][MT6620 Wi-Fi] Add the RSSI indicate to avoid XP stalled for query rssi value - * Adding the RSSI event support, using the HAL function to get the rcpi value and tranlsate to RSSI and indicate to driver - * - * 02 12 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Use bss info array for concurrent handle - * - * 02 05 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Revise data structure to share the same BSS_INFO_T for avoiding coding error - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup - * - * 01 27 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Set max AMDPU size supported by the peer to 64 KB, removed mqmInit() and mqmTxSendAddBaReq() function calls in aisUpdateBssInfo() - * - * 01 27 2010 wh.su - * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code - * add and fixed some security function. - * - * 01 22 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support protection and bandwidth switch - * - * 01 20 2010 kevin.huang - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Add PHASE_2_INTEGRATION_WORK_AROUND and CFG_SUPPORT_BCM flags - * - * 01 15 2010 tehuang.liu - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Configured the AMPDU factor to 3 for the APu1rwduu`wvpghlqg|q`mpdkb+ilp - * - * 01 14 2010 chinghwa.yu - * [BORA00000563]Add WiFi CoEx BCM module - * Add WiFi BCM module for the 1st time. - * - * 01 11 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add Deauth and Disassoc Handler - * - * 01 07 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * - * Refine JOIN Complete and seperate the function of Media State indication - * - * 01 04 2010 tehuang.liu - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * For working out the first connection Chariot-verified version - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * Dec 10 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the sample code to update the wlan table rate, - * - * Dec 10 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Different function prototype of wifi_send_msg() - * - * Dec 9 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Call rlm related function to process HT info when join complete - * - * Dec 9 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * default the acquired wlan table entry code off - * - * Dec 9 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the code to acquired the wlan table entry, and a sample code to update the BA bit at table - * - * Dec 7 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix the problem of prSwRfb overwrited by event packet in aisFsmRunEventJoinComplete() - * - * Dec 4 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the code to integrate the security related code - * - * Dec 3 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Remove redundant declaration - * - * Dec 3 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add code for JOIN init and JOIN complete - * - * Nov 30 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Rename u4RSSI to i4RSSI - * - * Nov 30 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Revise ENUM_MEDIA_STATE to ENUM_PARAM_MEDIA_STATE - * - * Nov 30 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add fgIsScanReqIssued to CONNECTION_SETTINGS_T - * - * Nov 26 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Revise Virtual CMD handler due to structure changed - * - * Nov 25 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add Virtual CMD & RESP for testing CMD PATH - * - * Nov 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add aisFsmInitializeConnectionSettings() - * - * Nov 20 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add CFG_TEST_MGMT_FSM flag for aisFsmTest() - * - * Nov 16 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define AIS_ROAMING_CONNECTION_TRIAL_LIMIT 2 - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ -#if DBG -/*lint -save -e64 Type mismatch */ -static PUINT_8 apucDebugAisState[AIS_STATE_NUM] = { - (PUINT_8)DISP_STRING("AIS_STATE_IDLE"), - (PUINT_8)DISP_STRING("AIS_STATE_SEARCH"), - (PUINT_8)DISP_STRING("AIS_STATE_SCAN"), - (PUINT_8)DISP_STRING("AIS_STATE_ONLINE_SCAN"), - (PUINT_8)DISP_STRING("AIS_STATE_LOOKING_FOR"), - (PUINT_8)DISP_STRING("AIS_STATE_WAIT_FOR_NEXT_SCAN"), - (PUINT_8)DISP_STRING("AIS_STATE_REQ_CHANNEL_JOIN"), - (PUINT_8)DISP_STRING("AIS_STATE_JOIN"), - (PUINT_8)DISP_STRING("AIS_STATE_IBSS_ALONE"), - (PUINT_8)DISP_STRING("AIS_STATE_IBSS_MERGE"), - (PUINT_8)DISP_STRING("AIS_STATE_NORMAL_TR"), - (PUINT_8)DISP_STRING("AIS_STATE_DISCONNECTING") -}; -/*lint -restore */ -#endif /* DBG */ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/*! -* @brief the function is used to initialize the value of the connection settings for -* AIS network -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisInitializeConnectionSettings ( - IN P_ADAPTER_T prAdapter, - IN P_REG_INFO_T prRegInfo - ) -{ - P_CONNECTION_SETTINGS_T prConnSettings; - UINT_8 aucAnyBSSID[] = BC_BSSID; - UINT_8 aucZeroMacAddr[] = NULL_MAC_ADDR; - - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - - /* Setup default values for operation */ - COPY_MAC_ADDR(prConnSettings->aucMacAddress, aucZeroMacAddr); - - prConnSettings->ucDelayTimeOfDisconnectEvent = AIS_DELAY_TIME_OF_DISCONNECT_SEC; - - COPY_MAC_ADDR(prConnSettings->aucBSSID, aucAnyBSSID); - prConnSettings->fgIsConnByBssidIssued = FALSE; - - prConnSettings->fgIsConnReqIssued = FALSE; - - prConnSettings->ucSSIDLen = 0; - - prConnSettings->eOPMode = NET_TYPE_INFRA; - - prConnSettings->eConnectionPolicy = CONNECT_BY_SSID_BEST_RSSI; - - if(prRegInfo) { - prConnSettings->ucAdHocChannelNum = (UINT_8) nicFreq2ChannelNum(prRegInfo->u4StartFreq); - prConnSettings->eAdHocBand = prRegInfo->u4StartFreq < 5000000 ? BAND_2G4 : BAND_5G; - prConnSettings->eAdHocMode = (ENUM_PARAM_AD_HOC_MODE_T) (prRegInfo->u4AdhocMode); - } - - prConnSettings->eAuthMode = AUTH_MODE_OPEN; - - prConnSettings->eEncStatus = ENUM_ENCRYPTION_DISABLED; - - prConnSettings->fgIsScanReqIssued = FALSE; - - /* MIB attributes */ - prConnSettings->u2BeaconPeriod = DOT11_BEACON_PERIOD_DEFAULT; - - prConnSettings->u2RTSThreshold = DOT11_RTS_THRESHOLD_DEFAULT; - - prConnSettings->u2DesiredNonHTRateSet = RATE_SET_ALL_ABG; - - //prConnSettings->u4FreqInKHz; /* Center frequency */ - - - /* Set U-APSD AC */ - prConnSettings->bmfgApsdEnAc = PM_UAPSD_NONE; - - secInit(prAdapter, NETWORK_TYPE_AIS_INDEX); - - /* Features */ - prConnSettings->fgIsEnableRoaming = FALSE; -#if CFG_SUPPORT_ROAMING - if(prRegInfo) { - prConnSettings->fgIsEnableRoaming = ((prRegInfo->fgDisRoaming > 0)?(FALSE):(TRUE)); - } -#endif /* CFG_SUPPORT_ROAMING */ - - prConnSettings->fgIsAdHocQoSEnable = FALSE; - - prConnSettings->eDesiredPhyConfig = PHY_CONFIG_802_11ABGN; - - /* Set default bandwidth modes */ - prConnSettings->uc2G4BandwidthMode = CONFIG_BW_20M; - prConnSettings->uc5GBandwidthMode = CONFIG_BW_20_40M; - - return; -} /* end of aisFsmInitializeConnectionSettings() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief the function is used to initialize the value in AIS_FSM_INFO_T for -* AIS FSM operation -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmInit ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_BSS_INFO_T prAisBssInfo; - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecificBssInfo; - - DEBUGFUNC("aisFsmInit()"); - DBGLOG(SW1, INFO, ("->aisFsmInit()\n")); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - prAisSpecificBssInfo = &(prAdapter->rWifiVar.rAisSpecificBssInfo); - - //4 <1> Initiate FSM - prAisFsmInfo->ePreviousState = AIS_STATE_IDLE; - prAisFsmInfo->eCurrentState = AIS_STATE_IDLE; - - prAisFsmInfo->ucAvailableAuthTypes = 0; - - prAisFsmInfo->prTargetBssDesc = (P_BSS_DESC_T)NULL; - - prAisFsmInfo->ucSeqNumOfReqMsg = 0; - prAisFsmInfo->ucSeqNumOfChReq = 0; - prAisFsmInfo->ucSeqNumOfScanReq = 0; - - prAisFsmInfo->fgIsInfraChannelFinished = TRUE; -#if CFG_SUPPORT_ROAMING - prAisFsmInfo->fgIsRoamingScanPending = FALSE; -#endif /* CFG_SUPPORT_ROAMING */ - prAisFsmInfo->fgIsChannelRequested = FALSE; - prAisFsmInfo->fgIsChannelGranted = FALSE; - - //4 <1.1> Initiate FSM - Timer INIT - cnmTimerInitTimer(prAdapter, - &prAisFsmInfo->rBGScanTimer, - (PFN_MGMT_TIMEOUT_FUNC)aisFsmRunEventBGSleepTimeOut, - (UINT_32)NULL); - - cnmTimerInitTimer(prAdapter, - &prAisFsmInfo->rIbssAloneTimer, - (PFN_MGMT_TIMEOUT_FUNC)aisFsmRunEventIbssAloneTimeOut, - (UINT_32)NULL); - - cnmTimerInitTimer(prAdapter, - &prAisFsmInfo->rIndicationOfDisconnectTimer, - (PFN_MGMT_TIMEOUT_FUNC)aisPostponedEventOfDisconnTimeout, - (UINT_32)NULL); - - cnmTimerInitTimer(prAdapter, - &prAisFsmInfo->rJoinTimeoutTimer, - (PFN_MGMT_TIMEOUT_FUNC)aisFsmRunEventJoinTimeout, - (UINT_32)NULL); - - //4 <1.2> Initiate PWR STATE - SET_NET_PWR_STATE_IDLE(prAdapter, NETWORK_TYPE_AIS_INDEX); - - - //4 <2> Initiate BSS_INFO_T - common part - BSS_INFO_INIT(prAdapter, NETWORK_TYPE_AIS_INDEX); - COPY_MAC_ADDR(prAisBssInfo->aucOwnMacAddr, prAdapter->rWifiVar.aucMacAddress); - - //4 <3> Initiate BSS_INFO_T - private part - /* TODO */ - prAisBssInfo->eBand = BAND_2G4; - prAisBssInfo->ucPrimaryChannel = 1; - prAisBssInfo->prStaRecOfAP = (P_STA_RECORD_T)NULL; - - //4 <4> Allocate MSDU_INFO_T for Beacon - prAisBssInfo->prBeacon = cnmMgtPktAlloc(prAdapter, - OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem[0]) + MAX_IE_LENGTH); - - if (prAisBssInfo->prBeacon) { - prAisBssInfo->prBeacon->eSrc = TX_PACKET_MGMT; - prAisBssInfo->prBeacon->ucStaRecIndex = 0xFF; /* NULL STA_REC */ - } - else { - ASSERT(0); - } - -#if 0 - prAisBssInfo->rPmProfSetupInfo.ucBmpDeliveryAC = PM_UAPSD_ALL; - prAisBssInfo->rPmProfSetupInfo.ucBmpTriggerAC = PM_UAPSD_ALL; - prAisBssInfo->rPmProfSetupInfo.ucUapsdSp = WMM_MAX_SP_LENGTH_2; -#else - if (prAdapter->u4UapsdAcBmp == 0) { - prAdapter->u4UapsdAcBmp = CFG_INIT_UAPSD_AC_BMP; - //ASSERT(prAdapter->u4UapsdAcBmp); - } - prAisBssInfo->rPmProfSetupInfo.ucBmpDeliveryAC = (UINT_8)prAdapter->u4UapsdAcBmp; - prAisBssInfo->rPmProfSetupInfo.ucBmpTriggerAC =(UINT_8) prAdapter->u4UapsdAcBmp; - prAisBssInfo->rPmProfSetupInfo.ucUapsdSp = (UINT_8)prAdapter->u4MaxSpLen; -#endif - - /* request list initialization */ - LINK_INITIALIZE(&prAisFsmInfo->rPendingReqList); - - //DBGPRINTF("[2] ucBmpDeliveryAC:0x%x, ucBmpTriggerAC:0x%x, ucUapsdSp:0x%x", - //prAisBssInfo->rPmProfSetupInfo.ucBmpDeliveryAC, - //prAisBssInfo->rPmProfSetupInfo.ucBmpTriggerAC, - //prAisBssInfo->rPmProfSetupInfo.ucUapsdSp); - - return; -} /* end of aisFsmInit() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief the function is used to uninitialize the value in AIS_FSM_INFO_T for -* AIS FSM operation -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmUninit ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_BSS_INFO_T prAisBssInfo; - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecificBssInfo; - - DEBUGFUNC("aisFsmUninit()"); - DBGLOG(SW1, INFO, ("->aisFsmUninit()\n")); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - prAisSpecificBssInfo = &(prAdapter->rWifiVar.rAisSpecificBssInfo); - - //4 <1> Stop all timers - cnmTimerStopTimer(prAdapter, &prAisFsmInfo->rBGScanTimer); - cnmTimerStopTimer(prAdapter, &prAisFsmInfo->rIbssAloneTimer); - cnmTimerStopTimer(prAdapter, &prAisFsmInfo->rIndicationOfDisconnectTimer); - cnmTimerStopTimer(prAdapter, &prAisFsmInfo->rJoinTimeoutTimer); - - //4 <2> flush pending request - aisFsmFlushRequest(prAdapter); - - //4 <3> Reset driver-domain BSS-INFO - if(prAisBssInfo->prBeacon) { - cnmMgtPktFree(prAdapter, prAisBssInfo->prBeacon); - prAisBssInfo->prBeacon = NULL; - } - -#if CFG_SUPPORT_802_11W - rsnStopSaQuery(prAdapter); -#endif - - return; -} /* end of aisFsmUninit() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Initialization of JOIN STATE -* -* @param[in] prBssDesc The pointer of BSS_DESC_T which is the BSS we will try to join with. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmStateInit_JOIN ( - IN P_ADAPTER_T prAdapter, - P_BSS_DESC_T prBssDesc - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_BSS_INFO_T prAisBssInfo; - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecificBssInfo; - P_CONNECTION_SETTINGS_T prConnSettings; - P_STA_RECORD_T prStaRec; - P_MSG_JOIN_REQ_T prJoinReqMsg; - - DEBUGFUNC("aisFsmStateInit_JOIN()"); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - prAisSpecificBssInfo = &(prAdapter->rWifiVar.rAisSpecificBssInfo); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - - ASSERT(prBssDesc); - - //4 <1> We are going to connect to this BSS. - prBssDesc->fgIsConnecting = TRUE; - - - //4 <2> Setup corresponding STA_RECORD_T - prStaRec = bssCreateStaRecFromBssDesc(prAdapter, - STA_TYPE_LEGACY_AP, - NETWORK_TYPE_AIS_INDEX, - prBssDesc); - - prAisFsmInfo->prTargetStaRec = prStaRec; - - //4 <2.1> sync. to firmware domain - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - - //4 <3> Update ucAvailableAuthTypes which we can choice during SAA - if (prAisBssInfo->eConnectionState == PARAM_MEDIA_STATE_DISCONNECTED) { - - prStaRec->fgIsReAssoc = FALSE; - - switch (prConnSettings->eAuthMode) { - case AUTH_MODE_OPEN: /* Note: Omit break here. */ - case AUTH_MODE_WPA: - case AUTH_MODE_WPA_PSK: - case AUTH_MODE_WPA2: - case AUTH_MODE_WPA2_PSK: - prAisFsmInfo->ucAvailableAuthTypes = (UINT_8)AUTH_TYPE_OPEN_SYSTEM; - break; - - - case AUTH_MODE_SHARED: - prAisFsmInfo->ucAvailableAuthTypes = (UINT_8)AUTH_TYPE_SHARED_KEY; - break; - - - case AUTH_MODE_AUTO_SWITCH: - DBGLOG(AIS, LOUD, ("JOIN INIT: eAuthMode == AUTH_MODE_AUTO_SWITCH\n")); - prAisFsmInfo->ucAvailableAuthTypes = (UINT_8)(AUTH_TYPE_OPEN_SYSTEM | - AUTH_TYPE_SHARED_KEY); - break; - - default: - ASSERT(!(prConnSettings->eAuthMode == AUTH_MODE_WPA_NONE)); - DBGLOG(AIS, ERROR, ("JOIN INIT: Auth Algorithm : %d was not supported by JOIN\n", - prConnSettings->eAuthMode)); - /* TODO(Kevin): error handling ? */ - return; - } - - /* TODO(tyhsu): Assume that Roaming Auth Type is equal to ConnSettings eAuthMode */ - prAisSpecificBssInfo->ucRoamingAuthTypes = prAisFsmInfo->ucAvailableAuthTypes; - - prStaRec->ucTxAuthAssocRetryLimit = TX_AUTH_ASSOCI_RETRY_LIMIT; - - } - else { - ASSERT(prBssDesc->eBSSType == BSS_TYPE_INFRASTRUCTURE); - ASSERT(!prBssDesc->fgIsConnected); - - DBGLOG(AIS, LOUD, ("JOIN INIT: AUTH TYPE = %d for Roaming\n", - prAisSpecificBssInfo->ucRoamingAuthTypes)); - - - prStaRec->fgIsReAssoc = TRUE; /* We do roaming while the medium is connected */ - - /* TODO(Kevin): We may call a sub function to acquire the Roaming Auth Type */ - prAisFsmInfo->ucAvailableAuthTypes = prAisSpecificBssInfo->ucRoamingAuthTypes; - - prStaRec->ucTxAuthAssocRetryLimit = TX_AUTH_ASSOCI_RETRY_LIMIT_FOR_ROAMING; - } - - - //4 <4> Use an appropriate Authentication Algorithm Number among the ucAvailableAuthTypes - if (prAisFsmInfo->ucAvailableAuthTypes & - (UINT_8)AUTH_TYPE_OPEN_SYSTEM) { - - DBGLOG(AIS, LOUD, ("JOIN INIT: Try to do Authentication with AuthType == OPEN_SYSTEM.\n")); - prAisFsmInfo->ucAvailableAuthTypes &= - ~(UINT_8)AUTH_TYPE_OPEN_SYSTEM; - - prStaRec->ucAuthAlgNum = (UINT_8)AUTH_ALGORITHM_NUM_OPEN_SYSTEM; - } - else if (prAisFsmInfo->ucAvailableAuthTypes & - (UINT_8)AUTH_TYPE_SHARED_KEY) { - - DBGLOG(AIS, LOUD, ("JOIN INIT: Try to do Authentication with AuthType == SHARED_KEY.\n")); - - prAisFsmInfo->ucAvailableAuthTypes &= - ~(UINT_8)AUTH_TYPE_SHARED_KEY; - - prStaRec->ucAuthAlgNum = (UINT_8)AUTH_ALGORITHM_NUM_SHARED_KEY; - } - else if (prAisFsmInfo->ucAvailableAuthTypes & - (UINT_8)AUTH_TYPE_FAST_BSS_TRANSITION) { - - DBGLOG(AIS, LOUD, ("JOIN INIT: Try to do Authentication with AuthType == FAST_BSS_TRANSITION.\n")); - - prAisFsmInfo->ucAvailableAuthTypes &= - ~(UINT_8)AUTH_TYPE_FAST_BSS_TRANSITION; - - prStaRec->ucAuthAlgNum = (UINT_8)AUTH_ALGORITHM_NUM_FAST_BSS_TRANSITION; - } - else { - ASSERT(0); - } - - //4 <5> Overwrite Connection Setting for eConnectionPolicy == ANY (Used by Assoc Req) - if (prConnSettings->eConnectionPolicy == CONNECT_BY_SSID_ANY) { - - if (prBssDesc->ucSSIDLen) { - COPY_SSID(prConnSettings->aucSSID, - prConnSettings->ucSSIDLen, - prBssDesc->aucSSID, - prBssDesc->ucSSIDLen); - } - } - - //4 <6> Send a Msg to trigger SAA to start JOIN process. - prJoinReqMsg = (P_MSG_JOIN_REQ_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_JOIN_REQ_T)); - if (!prJoinReqMsg) { - - ASSERT(0); // Can't trigger SAA FSM - return; - } - - prJoinReqMsg->rMsgHdr.eMsgId = MID_AIS_SAA_FSM_START; - prJoinReqMsg->ucSeqNum = ++prAisFsmInfo->ucSeqNumOfReqMsg; - prJoinReqMsg->prStaRec = prStaRec; - - if (1) { - int j; - P_FRAG_INFO_T prFragInfo; - for (j = 0; j < MAX_NUM_CONCURRENT_FRAGMENTED_MSDUS; j++) { - prFragInfo = &prStaRec->rFragInfo[j]; - - if (prFragInfo->pr1stFrag) { - //nicRxReturnRFB(prAdapter, prFragInfo->pr1stFrag); - prFragInfo->pr1stFrag = (P_SW_RFB_T)NULL; - } - } - } - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prJoinReqMsg, - MSG_SEND_METHOD_BUF); - - return; -} /* end of aisFsmInit_JOIN() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Retry JOIN for AUTH_MODE_AUTO_SWITCH -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @retval TRUE We will retry JOIN -* @retval FALSE We will not retry JOIN -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -aisFsmStateInit_RetryJOIN ( - IN P_ADAPTER_T prAdapter, - P_STA_RECORD_T prStaRec - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_MSG_JOIN_REQ_T prJoinReqMsg; - - DEBUGFUNC("aisFsmStateInit_RetryJOIN()"); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - - /* Retry other AuthType if possible */ - if (!prAisFsmInfo->ucAvailableAuthTypes) { - return FALSE; - } - - if (prAisFsmInfo->ucAvailableAuthTypes & - (UINT_8)AUTH_TYPE_SHARED_KEY) { - - DBGLOG(AIS, INFO, ("RETRY JOIN INIT: Retry Authentication with AuthType == SHARED_KEY.\n")); - - prAisFsmInfo->ucAvailableAuthTypes &= - ~(UINT_8)AUTH_TYPE_SHARED_KEY; - - prStaRec->ucAuthAlgNum = (UINT_8)AUTH_ALGORITHM_NUM_SHARED_KEY; - } - else { - DBGLOG(AIS, ERROR, ("RETRY JOIN INIT: Retry Authentication with Unexpected AuthType.\n")); - ASSERT(0); - } - - prAisFsmInfo->ucAvailableAuthTypes = 0; /* No more available Auth Types */ - - /* Trigger SAA to start JOIN process. */ - prJoinReqMsg = (P_MSG_JOIN_REQ_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_JOIN_REQ_T)); - if (!prJoinReqMsg) { - - ASSERT(0); // Can't trigger SAA FSM - return FALSE; - } - - prJoinReqMsg->rMsgHdr.eMsgId = MID_AIS_SAA_FSM_START; - prJoinReqMsg->ucSeqNum = ++prAisFsmInfo->ucSeqNumOfReqMsg; - prJoinReqMsg->prStaRec = prStaRec; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prJoinReqMsg, - MSG_SEND_METHOD_BUF); - - return TRUE; - -}/* end of aisFsmRetryJOIN() */ - - -#if CFG_SUPPORT_ADHOC -/*----------------------------------------------------------------------------*/ -/*! -* @brief State Initialization of AIS_STATE_IBSS_ALONE -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmStateInit_IBSS_ALONE ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_CONNECTION_SETTINGS_T prConnSettings; - P_BSS_INFO_T prAisBssInfo; - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - - //4 <1> Check if IBSS was created before ? - if (prAisBssInfo->fgIsBeaconActivated) { - - //4 <2> Start IBSS Alone Timer for periodic SCAN and then SEARCH -#if !CFG_SLT_SUPPORT - cnmTimerStartTimer(prAdapter, - &prAisFsmInfo->rIbssAloneTimer, - SEC_TO_MSEC(AIS_IBSS_ALONE_TIMEOUT_SEC)); -#endif - } - - aisFsmCreateIBSS(prAdapter); - - return; -} /* end of aisFsmStateInit_IBSS_ALONE() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief State Initialization of AIS_STATE_IBSS_MERGE -* -* @param[in] prBssDesc The pointer of BSS_DESC_T which is the IBSS we will try to merge with. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmStateInit_IBSS_MERGE ( - IN P_ADAPTER_T prAdapter, - P_BSS_DESC_T prBssDesc - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_CONNECTION_SETTINGS_T prConnSettings; - P_BSS_INFO_T prAisBssInfo; - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - - - ASSERT(prBssDesc); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - - //4 <1> We will merge with to this BSS immediately. - prBssDesc->fgIsConnecting = FALSE; - prBssDesc->fgIsConnected = TRUE; - - //4 <2> Setup corresponding STA_RECORD_T - prStaRec = bssCreateStaRecFromBssDesc(prAdapter, - STA_TYPE_ADHOC_PEER, - NETWORK_TYPE_AIS_INDEX, - prBssDesc); - - prStaRec->fgIsMerging = TRUE; - - prAisFsmInfo->prTargetStaRec = prStaRec; - - //4 <2.1> sync. to firmware domain - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - - //4 <3> IBSS-Merge - aisFsmMergeIBSS(prAdapter, prStaRec); - - return; -} /* end of aisFsmStateInit_IBSS_MERGE() */ - -#endif /* CFG_SUPPORT_ADHOC */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Process of JOIN Abort -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmStateAbort_JOIN ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_MSG_JOIN_ABORT_T prJoinAbortMsg; - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - - /* 1. Abort JOIN process */ - prJoinAbortMsg = (P_MSG_JOIN_ABORT_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_JOIN_ABORT_T)); - if (!prJoinAbortMsg) { - - ASSERT(0); // Can't abort SAA FSM - return; - } - - prJoinAbortMsg->rMsgHdr.eMsgId = MID_AIS_SAA_FSM_ABORT; - prJoinAbortMsg->ucSeqNum = prAisFsmInfo->ucSeqNumOfReqMsg; - prJoinAbortMsg->prStaRec = prAisFsmInfo->prTargetStaRec; - - scanRemoveConnFlagOfBssDescByBssid(prAdapter, prAisFsmInfo->prTargetStaRec->aucMacAddr); - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prJoinAbortMsg, - MSG_SEND_METHOD_BUF); - - /* 2. Return channel privilege */ - aisFsmReleaseCh(prAdapter); - - /* 3.1 stop join timeout timer */ - cnmTimerStopTimer(prAdapter, &prAisFsmInfo->rJoinTimeoutTimer); - - /* 3.2 reset local variable */ - prAisFsmInfo->fgIsInfraChannelFinished = TRUE; - - return; -} /* end of aisFsmAbortJOIN() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Process of SCAN Abort -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmStateAbort_SCAN ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_MSG_SCN_SCAN_CANCEL prScanCancelMsg; - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - - /* Abort JOIN process. */ - prScanCancelMsg = (P_MSG_SCN_SCAN_CANCEL)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_SCN_SCAN_CANCEL)); - if (!prScanCancelMsg) { - - ASSERT(0); // Can't abort SCN FSM - return; - } - - prScanCancelMsg->rMsgHdr.eMsgId = MID_AIS_SCN_SCAN_CANCEL; - prScanCancelMsg->ucSeqNum = prAisFsmInfo->ucSeqNumOfScanReq; - prScanCancelMsg->ucNetTypeIndex = (UINT_8)NETWORK_TYPE_AIS_INDEX; -#if CFG_ENABLE_WIFI_DIRECT - if(prAdapter->fgIsP2PRegistered) { - prScanCancelMsg->fgIsChannelExt = FALSE; - } -#endif - - /* unbuffered message to guarantee scan is cancelled in sequence */ - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prScanCancelMsg, - MSG_SEND_METHOD_UNBUF); - - return; -} /* end of aisFsmAbortSCAN() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Process of NORMAL_TR Abort -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmStateAbort_NORMAL_TR ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - - ASSERT(prAdapter); - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - - /* TODO(Kevin): Do abort other MGMT func */ - - /* 1. Release channel to CNM */ - aisFsmReleaseCh(prAdapter); - - /* 2.1 stop join timeout timer */ - cnmTimerStopTimer(prAdapter, &prAisFsmInfo->rJoinTimeoutTimer); - - /* 2.2 reset local variable */ - prAisFsmInfo->fgIsInfraChannelFinished = TRUE; - - return; -} /* end of aisFsmAbortNORMAL_TR() */ - - -#if CFG_SUPPORT_ADHOC -/*----------------------------------------------------------------------------*/ -/*! -* @brief Process of NORMAL_TR Abort -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmStateAbort_IBSS ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_BSS_DESC_T prBssDesc; - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - - // reset BSS-DESC - if (prAisFsmInfo->prTargetStaRec) { - prBssDesc = scanSearchBssDescByTA(prAdapter, - prAisFsmInfo->prTargetStaRec->aucMacAddr); - - if (prBssDesc) { - prBssDesc->fgIsConnected = FALSE; - prBssDesc->fgIsConnecting = FALSE; - } - } - - // release channel privilege - aisFsmReleaseCh(prAdapter); - - return; -} -#endif /* CFG_SUPPORT_ADHOC */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief The Core FSM engine of AIS(Ad-hoc, Infra STA) -* -* @param[in] eNextState Enum value of next AIS STATE -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmSteps ( - IN P_ADAPTER_T prAdapter, - ENUM_AIS_STATE_T eNextState - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_BSS_INFO_T prAisBssInfo; - P_CONNECTION_SETTINGS_T prConnSettings; - P_BSS_DESC_T prBssDesc; - P_MSG_CH_REQ_T prMsgChReq; - P_MSG_SCN_SCAN_REQ prScanReqMsg; - P_AIS_REQ_HDR_T prAisReq; - ENUM_BAND_T eBand; - UINT_8 ucChannel; - UINT_16 u2ScanIELen; - - BOOLEAN fgIsTransition = (BOOLEAN)FALSE; - - DEBUGFUNC("aisFsmSteps()"); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - - do { - - /* Do entering Next State */ - prAisFsmInfo->ePreviousState = prAisFsmInfo->eCurrentState; - -#if DBG - DBGLOG(AIS, STATE, ("TRANSITION: [%s] -> [%s]\n", - apucDebugAisState[prAisFsmInfo->eCurrentState], - apucDebugAisState[eNextState])); -#else - DBGLOG(AIS, STATE, ("[%d] TRANSITION: [%d] -> [%d]\n", - DBG_AIS_IDX, - prAisFsmInfo->eCurrentState, - eNextState)); -#endif - /* NOTE(Kevin): This is the only place to change the eCurrentState(except initial) */ - prAisFsmInfo->eCurrentState = eNextState; - - fgIsTransition = (BOOLEAN)FALSE; - - /* Do tasks of the State that we just entered */ - switch (prAisFsmInfo->eCurrentState) { - /* NOTE(Kevin): we don't have to rearrange the sequence of following - * switch case. Instead I would like to use a common lookup table of array - * of function pointer to speed up state search. - */ - case AIS_STATE_IDLE: - - prAisReq = aisFsmGetNextRequest(prAdapter); - - if(prAisReq == NULL || prAisReq->eReqType == AIS_REQUEST_RECONNECT) { - if (prConnSettings->fgIsConnReqIssued) { - - prAisFsmInfo->fgTryScan = TRUE; - - SET_NET_ACTIVE(prAdapter, NETWORK_TYPE_AIS_INDEX); - SET_NET_PWR_STATE_ACTIVE(prAdapter, NETWORK_TYPE_AIS_INDEX); - - // sync with firmware - nicActivateNetwork(prAdapter, NETWORK_TYPE_AIS_INDEX); - - // reset trial count - prAisFsmInfo->ucConnTrialCount = 0; - - eNextState = AIS_STATE_SEARCH; - fgIsTransition = TRUE; - } - else { - UNSET_NET_ACTIVE(prAdapter, NETWORK_TYPE_AIS_INDEX); - SET_NET_PWR_STATE_IDLE(prAdapter, NETWORK_TYPE_AIS_INDEX); - - // sync with firmware - nicDeactivateNetwork(prAdapter, NETWORK_TYPE_AIS_INDEX); - - // check for other pending request - if(prAisReq) { - if(aisFsmIsRequestPending(prAdapter, AIS_REQUEST_SCAN, TRUE) == TRUE) { - wlanClearScanningResult(prAdapter); - eNextState = AIS_STATE_SCAN; - - fgIsTransition = TRUE; - } - } - } - - if(prAisReq) { - /* free the message */ - cnmMemFree(prAdapter, prAisReq); - } - } - else if(prAisReq->eReqType == AIS_REQUEST_SCAN) { -#if CFG_SUPPORT_ROAMING - prAisFsmInfo->fgIsRoamingScanPending = FALSE; -#endif /* CFG_SUPPORT_ROAMING */ - wlanClearScanningResult(prAdapter); - - eNextState = AIS_STATE_SCAN; - fgIsTransition = TRUE; - - /* free the message */ - cnmMemFree(prAdapter, prAisReq); - } - else if(prAisReq->eReqType == AIS_REQUEST_ROAMING_CONNECT || prAisReq->eReqType == AIS_REQUEST_ROAMING_SEARCH) { - /* ignore */ - /* free the message */ - cnmMemFree(prAdapter, prAisReq); - } - - prAisFsmInfo->u4SleepInterval = AIS_BG_SCAN_INTERVAL_MIN_SEC; - - break; - - case AIS_STATE_SEARCH: - //4 <1> Search for a matched candidate and save it to prTargetBssDesc. -#if CFG_SLT_SUPPORT - prBssDesc = prAdapter->rWifiVar.rSltInfo.prPseudoBssDesc; -#else - prBssDesc = scanSearchBssDescByPolicy(prAdapter, NETWORK_TYPE_AIS_INDEX); -#endif - - // we are under Roaming Condition. - if (prAisBssInfo->eConnectionState == PARAM_MEDIA_STATE_CONNECTED) { - if(prAisFsmInfo->ucConnTrialCount > AIS_ROAMING_CONNECTION_TRIAL_LIMIT) { -#if CFG_SUPPORT_ROAMING - roamingFsmRunEventFail(prAdapter, ROAMING_FAIL_REASON_CONNLIMIT); -#endif /* CFG_SUPPORT_ROAMING */ - // reset retry count - prAisFsmInfo->ucConnTrialCount = 0; - - // abort connection trial - prConnSettings->fgIsConnReqIssued = FALSE; - - eNextState = AIS_STATE_NORMAL_TR; - fgIsTransition = TRUE; - - break; - } - } - - //4 <2> We are not under Roaming Condition. - if (prAisBssInfo->eConnectionState == PARAM_MEDIA_STATE_DISCONNECTED) { - - //4 <2.a> If we have the matched one - if (prBssDesc) { - - //4 Stored the Selected BSS security cipher. For later asoc req compose IE - prAisBssInfo->u4RsnSelectedGroupCipher = - prBssDesc->u4RsnSelectedGroupCipher; - prAisBssInfo->u4RsnSelectedPairwiseCipher = - prBssDesc->u4RsnSelectedPairwiseCipher; - prAisBssInfo->u4RsnSelectedAKMSuite = - prBssDesc->u4RsnSelectedAKMSuite; - - //4 Do STATE transition and update current Operation Mode. - if (prBssDesc->eBSSType == BSS_TYPE_INFRASTRUCTURE) { - - prAisBssInfo->eCurrentOPMode = OP_MODE_INFRASTRUCTURE; - - /* Record the target BSS_DESC_T for next STATE. */ - prAisFsmInfo->prTargetBssDesc = prBssDesc; - - /* Transit to channel acquire */ - eNextState = AIS_STATE_REQ_CHANNEL_JOIN; - fgIsTransition = TRUE; - - // increase connection trial count - prAisFsmInfo->ucConnTrialCount++; - } -#if CFG_SUPPORT_ADHOC - else if (prBssDesc->eBSSType == BSS_TYPE_IBSS) { - - prAisBssInfo->eCurrentOPMode = OP_MODE_IBSS; - - /* Record the target BSS_DESC_T for next STATE. */ - prAisFsmInfo->prTargetBssDesc = prBssDesc; - - eNextState = AIS_STATE_IBSS_MERGE; - fgIsTransition = TRUE; - } -#endif /* CFG_SUPPORT_ADHOC */ - else { - ASSERT(0); - eNextState = AIS_STATE_WAIT_FOR_NEXT_SCAN; - fgIsTransition = TRUE; - } - } - //4 <2.b> If we don't have the matched one - else { - - // increase connection trial count for infrastructure connection - if (prConnSettings->eOPMode == NET_TYPE_INFRA) { - prAisFsmInfo->ucConnTrialCount++; - } - - //4 Try to SCAN - if (prAisFsmInfo->fgTryScan) { - eNextState = AIS_STATE_LOOKING_FOR; - - fgIsTransition = TRUE; - } - //4 We've do SCAN already, now wait in some STATE. - else { - if (prConnSettings->eOPMode == NET_TYPE_INFRA) { - - /* issue reconnect request, and retreat to idle state for scheduling */ - aisFsmInsertRequest(prAdapter, AIS_REQUEST_RECONNECT); - - eNextState = AIS_STATE_IDLE; - fgIsTransition = TRUE; - } -#if CFG_SUPPORT_ADHOC - else if ((prConnSettings->eOPMode == NET_TYPE_IBSS) - || (prConnSettings->eOPMode == NET_TYPE_AUTO_SWITCH) - || (prConnSettings->eOPMode == NET_TYPE_DEDICATED_IBSS)) { - - prAisBssInfo->eCurrentOPMode = OP_MODE_IBSS; - prAisFsmInfo->prTargetBssDesc = NULL; - - eNextState = AIS_STATE_IBSS_ALONE; - fgIsTransition = TRUE; - } -#endif /* CFG_SUPPORT_ADHOC */ - else { - ASSERT(0); - eNextState = AIS_STATE_WAIT_FOR_NEXT_SCAN; - fgIsTransition = TRUE; - } - } - } - } - //4 <3> We are under Roaming Condition. - else { // prAdapter->eConnectionState == MEDIA_STATE_CONNECTED. - - //4 <3.a> This BSS_DESC_T is our AP. - /* NOTE(Kevin 2008/05/16): Following cases will go back to NORMAL_TR. - * CASE I: During Roaming, APP(WZC/NDISTEST) change the connection - * settings. That make we can NOT match the original AP, so the - * prBssDesc is NULL. - * CASE II: The same reason as CASE I. Because APP change the - * eOPMode to other network type in connection setting - * (e.g. NET_TYPE_IBSS), so the BssDesc become the IBSS node. - * (For CASE I/II, before WZC/NDISTEST set the OID_SSID, it will change - * other parameters in connection setting first. So if we do roaming - * at the same time, it will hit these cases.) - * - * CASE III: Normal case, we can't find other candidate to roam - * out, so only the current AP will be matched. - */ - if ((!prBssDesc) || /* CASE I */ - (prBssDesc->eBSSType != BSS_TYPE_INFRASTRUCTURE) || /* CASE II */ - (prBssDesc->fgIsConnected) /* CASE III */) { -#if DBG - if ((prBssDesc) && - (prBssDesc->fgIsConnected)) { - ASSERT(EQUAL_MAC_ADDR(prBssDesc->aucBSSID, prAisBssInfo->aucBSSID)); - } -#endif /* DBG */ - /* We already associated with it, go back to NORMAL_TR */ - /* TODO(Kevin): Roaming Fail */ -#if CFG_SUPPORT_ROAMING - roamingFsmRunEventFail(prAdapter, ROAMING_FAIL_REASON_NOCANDIDATE); -#endif /* CFG_SUPPORT_ROAMING */ - - /* Retreat to NORMAL_TR state */ - eNextState = AIS_STATE_NORMAL_TR; - fgIsTransition = TRUE; - } - //4 <3.b> Try to roam out for JOIN this BSS_DESC_T. - else { -#if DBG - ASSERT(UNEQUAL_MAC_ADDR(prBssDesc->aucBSSID, prAisBssInfo->aucBSSID)); -#endif /* DBG */ - - //4 Record the target BSS_DESC_T for next STATE. - prAisFsmInfo->prTargetBssDesc = prBssDesc; - - // tyhsu: increase connection trial count - prAisFsmInfo->ucConnTrialCount++; - - /* Transit to channel acquire */ - eNextState = AIS_STATE_REQ_CHANNEL_JOIN; - fgIsTransition = TRUE; - } - } - - break; - - case AIS_STATE_WAIT_FOR_NEXT_SCAN: - - DBGLOG(AIS, LOUD, ("SCAN: Idle Begin - Current Time = %ld\n", kalGetTimeTick())); - - cnmTimerStartTimer(prAdapter, - &prAisFsmInfo->rBGScanTimer, - SEC_TO_MSEC(prAisFsmInfo->u4SleepInterval)); - - SET_NET_PWR_STATE_IDLE(prAdapter, NETWORK_TYPE_AIS_INDEX); - - if (prAisFsmInfo->u4SleepInterval < AIS_BG_SCAN_INTERVAL_MAX_SEC) { - prAisFsmInfo->u4SleepInterval <<= 1; - } - break; - - case AIS_STATE_SCAN: - case AIS_STATE_ONLINE_SCAN: - case AIS_STATE_LOOKING_FOR: - - if(!IS_NET_ACTIVE(prAdapter, NETWORK_TYPE_AIS_INDEX)) { - SET_NET_ACTIVE(prAdapter, NETWORK_TYPE_AIS_INDEX); - - // sync with firmware - nicActivateNetwork(prAdapter, NETWORK_TYPE_AIS_INDEX); - } - - /* IE length decision */ - if(prAisFsmInfo->u4ScanIELength > 0) { - u2ScanIELen = (UINT_16)prAisFsmInfo->u4ScanIELength; - } - else { -#if CFG_SUPPORT_WPS2 - u2ScanIELen = prAdapter->prGlueInfo->u2WSCIELen; -#else - u2ScanIELen = 0; -#endif - } - - prScanReqMsg = (P_MSG_SCN_SCAN_REQ)cnmMemAlloc(prAdapter, - RAM_TYPE_MSG, - OFFSET_OF(MSG_SCN_SCAN_REQ, aucIE) + u2ScanIELen); - if (!prScanReqMsg) { - ASSERT(0); // Can't trigger SCAN FSM - return; - } - - prScanReqMsg->rMsgHdr.eMsgId = MID_AIS_SCN_SCAN_REQ; - prScanReqMsg->ucSeqNum = ++prAisFsmInfo->ucSeqNumOfScanReq; - prScanReqMsg->ucNetTypeIndex = (UINT_8)NETWORK_TYPE_AIS_INDEX; - -#if CFG_SUPPORT_RDD_TEST_MODE - prScanReqMsg->eScanType = SCAN_TYPE_PASSIVE_SCAN; -#else - prScanReqMsg->eScanType = SCAN_TYPE_ACTIVE_SCAN; -#endif - - if(prAisFsmInfo->eCurrentState == AIS_STATE_SCAN - || prAisFsmInfo->eCurrentState == AIS_STATE_ONLINE_SCAN) { - if(prAisFsmInfo->ucScanSSIDLen == 0) { - /* Scan for all available SSID */ - prScanReqMsg->ucSSIDType = SCAN_REQ_SSID_WILDCARD; - } - else { - prScanReqMsg->ucSSIDType = SCAN_REQ_SSID_SPECIFIED; - COPY_SSID(prScanReqMsg->aucSSID, - prScanReqMsg->ucSSIDLength, - prAisFsmInfo->aucScanSSID, - prAisFsmInfo->ucScanSSIDLen); - } - } - else { - /* Scan for determined SSID */ - prScanReqMsg->ucSSIDType = SCAN_REQ_SSID_SPECIFIED; - COPY_SSID(prScanReqMsg->aucSSID, - prScanReqMsg->ucSSIDLength, - prConnSettings->aucSSID, - prConnSettings->ucSSIDLen); - } - - /* check if tethering is running and need to fix on specific channel */ - if(cnmAisInfraChannelFixed(prAdapter, &eBand, &ucChannel) == TRUE) { - prScanReqMsg->eScanChannel = SCAN_CHANNEL_SPECIFIED; - prScanReqMsg->ucChannelListNum = 1; - prScanReqMsg->arChnlInfoList[0].eBand - = eBand;; - prScanReqMsg->arChnlInfoList[0].ucChannelNum - = ucChannel; - } - else if(prAdapter->aePreferBand[NETWORK_TYPE_AIS_INDEX] == BAND_NULL) { - if(prAdapter->fgEnable5GBand == TRUE) { - prScanReqMsg->eScanChannel = SCAN_CHANNEL_FULL; - } - else { - prScanReqMsg->eScanChannel = SCAN_CHANNEL_2G4; - } - } - else if(prAdapter->aePreferBand[NETWORK_TYPE_AIS_INDEX] == BAND_2G4) { - prScanReqMsg->eScanChannel = SCAN_CHANNEL_2G4; - } - else if(prAdapter->aePreferBand[NETWORK_TYPE_AIS_INDEX] == BAND_5G) { - prScanReqMsg->eScanChannel = SCAN_CHANNEL_5G; - } - else { - prScanReqMsg->eScanChannel = SCAN_CHANNEL_FULL; - ASSERT(0); - } - - if(prAisFsmInfo->u4ScanIELength > 0) { - kalMemCopy(prScanReqMsg->aucIE, prAisFsmInfo->aucScanIEBuf, prAisFsmInfo->u4ScanIELength); - } - else { -#if CFG_SUPPORT_WPS2 - if(prAdapter->prGlueInfo->u2WSCIELen > 0) { - kalMemCopy(prScanReqMsg->aucIE, &prAdapter->prGlueInfo->aucWSCIE, prAdapter->prGlueInfo->u2WSCIELen); - } - } -#endif - - prScanReqMsg->u2IELen = u2ScanIELen; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prScanReqMsg, - MSG_SEND_METHOD_BUF); - - prAisFsmInfo->fgTryScan = FALSE; /* Will enable background sleep for infrastructure */ - - break; - - case AIS_STATE_REQ_CHANNEL_JOIN: - /* send message to CNM for acquiring channel */ - prMsgChReq = (P_MSG_CH_REQ_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_CH_REQ_T)); - if (!prMsgChReq) { - ASSERT(0); // Can't indicate CNM for channel acquiring - return; - } - - prMsgChReq->rMsgHdr.eMsgId = MID_MNY_CNM_CH_REQ; - prMsgChReq->ucNetTypeIndex = NETWORK_TYPE_AIS_INDEX; - prMsgChReq->ucTokenID = ++prAisFsmInfo->ucSeqNumOfChReq; - prMsgChReq->eReqType = CH_REQ_TYPE_JOIN; - prMsgChReq->u4MaxInterval = AIS_JOIN_CH_REQUEST_INTERVAL; - prMsgChReq->ucPrimaryChannel = prAisFsmInfo->prTargetBssDesc->ucChannelNum; - prMsgChReq->eRfSco = prAisFsmInfo->prTargetBssDesc->eSco; - prMsgChReq->eRfBand = prAisFsmInfo->prTargetBssDesc->eBand; - COPY_MAC_ADDR(prMsgChReq->aucBSSID, prAisFsmInfo->prTargetBssDesc->aucBSSID); - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prMsgChReq, - MSG_SEND_METHOD_BUF); - - prAisFsmInfo->fgIsChannelRequested = TRUE; - break; - - case AIS_STATE_JOIN: - aisFsmStateInit_JOIN(prAdapter, prAisFsmInfo->prTargetBssDesc); - break; - -#if CFG_SUPPORT_ADHOC - case AIS_STATE_IBSS_ALONE: - aisFsmStateInit_IBSS_ALONE(prAdapter); - break; - - case AIS_STATE_IBSS_MERGE: - aisFsmStateInit_IBSS_MERGE(prAdapter, prAisFsmInfo->prTargetBssDesc); - break; -#endif /* CFG_SUPPORT_ADHOC */ - - case AIS_STATE_NORMAL_TR: - if(prAisFsmInfo->fgIsInfraChannelFinished == FALSE) { - /* Don't do anything when rJoinTimeoutTimer is still ticking */ - } - else { - /* 1. Process for pending scan */ - if(aisFsmIsRequestPending(prAdapter, AIS_REQUEST_SCAN, TRUE) == TRUE) { - wlanClearScanningResult(prAdapter); - eNextState = AIS_STATE_ONLINE_SCAN; - fgIsTransition = TRUE; - } - /* 2. Process for pending roaming scan */ - else if(aisFsmIsRequestPending(prAdapter, AIS_REQUEST_ROAMING_SEARCH, TRUE) == TRUE) { - eNextState = AIS_STATE_LOOKING_FOR; - fgIsTransition = TRUE; - } - /* 3. Process for pending roaming scan */ - else if(aisFsmIsRequestPending(prAdapter, AIS_REQUEST_ROAMING_CONNECT, TRUE) == TRUE) { - eNextState = AIS_STATE_SEARCH; - fgIsTransition = TRUE; - } - } - - break; - - case AIS_STATE_DISCONNECTING: - /* send for deauth frame for disconnection */ - authSendDeauthFrame(prAdapter, - prAisBssInfo->prStaRecOfAP, - (P_SW_RFB_T)NULL, - REASON_CODE_DEAUTH_LEAVING_BSS, - aisDeauthXmitComplete); - break; - - default: - ASSERT(0); /* Make sure we have handle all STATEs */ - break; - - } - } - while (fgIsTransition); - - return; - -} /* end of aisFsmSteps() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmRunEventScanDone ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_SCN_SCAN_DONE prScanDoneMsg; - P_AIS_FSM_INFO_T prAisFsmInfo; - ENUM_AIS_STATE_T eNextState; - UINT_8 ucSeqNumOfCompMsg; - P_CONNECTION_SETTINGS_T prConnSettings; - - DEBUGFUNC("aisFsmRunEventScanDone()"); - - ASSERT(prAdapter); - ASSERT(prMsgHdr); - - DBGLOG(AIS, LOUD, ("EVENT-SCAN DONE: Current Time = %ld\n", kalGetTimeTick())); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - - prScanDoneMsg = (P_MSG_SCN_SCAN_DONE)prMsgHdr; - ASSERT(prScanDoneMsg->ucNetTypeIndex == (UINT_8)NETWORK_TYPE_AIS_INDEX); - - ucSeqNumOfCompMsg = prScanDoneMsg->ucSeqNum; - cnmMemFree(prAdapter, prMsgHdr); - - eNextState = prAisFsmInfo->eCurrentState; - - if (ucSeqNumOfCompMsg != prAisFsmInfo->ucSeqNumOfScanReq) { - DBGLOG(AIS, WARN, ("SEQ NO of AIS SCN DONE MSG is not matched.\n")); - } - else { - switch (prAisFsmInfo->eCurrentState) { - case AIS_STATE_SCAN: - prConnSettings->fgIsScanReqIssued = FALSE; - - /* reset scan IE buffer */ - prAisFsmInfo->u4ScanIELength = 0; - - kalScanDone(prAdapter->prGlueInfo, KAL_NETWORK_TYPE_AIS_INDEX, WLAN_STATUS_SUCCESS); - eNextState = AIS_STATE_IDLE; - - break; - - case AIS_STATE_ONLINE_SCAN: - prConnSettings->fgIsScanReqIssued = FALSE; - - /* reset scan IE buffer */ - prAisFsmInfo->u4ScanIELength = 0; - - kalScanDone(prAdapter->prGlueInfo, KAL_NETWORK_TYPE_AIS_INDEX, WLAN_STATUS_SUCCESS); -#if CFG_SUPPORT_ROAMING - eNextState = aisFsmRoamingScanResultsUpdate(prAdapter); -#else - eNextState = AIS_STATE_NORMAL_TR; -#endif /* CFG_SUPPORT_ROAMING */ - - break; - - case AIS_STATE_LOOKING_FOR: -#if CFG_SUPPORT_ROAMING - eNextState = aisFsmRoamingScanResultsUpdate(prAdapter); -#else - eNextState = AIS_STATE_SEARCH; -#endif /* CFG_SUPPORT_ROAMING */ - break; - - default: - break; - - } - } - - if (eNextState != prAisFsmInfo->eCurrentState) { - aisFsmSteps(prAdapter, eNextState); - } - - return; -} /* end of aisFsmRunEventScanDone() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmRunEventAbort ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_AIS_ABORT_T prAisAbortMsg; - P_AIS_FSM_INFO_T prAisFsmInfo; - UINT_8 ucReasonOfDisconnect; - BOOLEAN fgDelayIndication; - - DEBUGFUNC("aisFsmRunEventAbort()"); - - ASSERT(prAdapter); - ASSERT(prMsgHdr); - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - - //4 <1> Extract information of Abort Message and then free memory. - prAisAbortMsg = (P_MSG_AIS_ABORT_T)prMsgHdr; - ucReasonOfDisconnect = prAisAbortMsg->ucReasonOfDisconnect; - fgDelayIndication = prAisAbortMsg->fgDelayIndication; - - cnmMemFree(prAdapter, prMsgHdr); - -#if DBG - DBGLOG(AIS, LOUD, ("EVENT-ABORT: Current State %s\n", - apucDebugAisState[prAisFsmInfo->eCurrentState])); -#else - DBGLOG(AIS, LOUD, ("[%d] EVENT-ABORT: Current State [%d]\n", - DBG_AIS_IDX, - prAisFsmInfo->eCurrentState)); -#endif - - //4 <2> clear previous pending connection request and insert new one - aisFsmIsRequestPending(prAdapter, AIS_REQUEST_RECONNECT, TRUE); - aisFsmInsertRequest(prAdapter, AIS_REQUEST_RECONNECT); - - if(prAisFsmInfo->eCurrentState != AIS_STATE_DISCONNECTING) { - //4 <3> invoke abort handler - aisFsmStateAbort(prAdapter, ucReasonOfDisconnect, fgDelayIndication); - } - - return; -} /* end of aisFsmRunEventAbort() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function handles AIS-FSM abort event/command -* -* \param[in] prAdapter Pointer of ADAPTER_T -* ucReasonOfDisconnect Reason for disonnection -* fgDelayIndication Option to delay disconnection indication -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmStateAbort ( - IN P_ADAPTER_T prAdapter, - UINT_8 ucReasonOfDisconnect, - BOOLEAN fgDelayIndication - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_BSS_INFO_T prAisBssInfo; - P_CONNECTION_SETTINGS_T prConnSettings; - BOOLEAN fgIsCheckConnected; - - ASSERT(prAdapter); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - fgIsCheckConnected = FALSE; - - //4 <1> Save information of Abort Message and then free memory. - prAisBssInfo->ucReasonOfDisconnect = ucReasonOfDisconnect; - - //4 <2> Abort current job. - switch (prAisFsmInfo->eCurrentState) { - case AIS_STATE_IDLE: - case AIS_STATE_SEARCH: - break; - - case AIS_STATE_WAIT_FOR_NEXT_SCAN: - /* Do cancel timer */ - cnmTimerStopTimer(prAdapter, &prAisFsmInfo->rBGScanTimer); - - /* in case roaming is triggered */ - fgIsCheckConnected = TRUE; - break; - - case AIS_STATE_SCAN: - /* Do abort SCAN */ - aisFsmStateAbort_SCAN(prAdapter); - - /* queue for later handling */ - if(aisFsmIsRequestPending(prAdapter, AIS_REQUEST_SCAN, FALSE) == FALSE) { - aisFsmInsertRequest(prAdapter, AIS_REQUEST_SCAN); - } - - break; - - case AIS_STATE_LOOKING_FOR: - /* Do abort SCAN */ - aisFsmStateAbort_SCAN(prAdapter); - - /* in case roaming is triggered */ - fgIsCheckConnected = TRUE; - break; - - case AIS_STATE_REQ_CHANNEL_JOIN: - /* Release channel to CNM */ - aisFsmReleaseCh(prAdapter); - - /* in case roaming is triggered */ - fgIsCheckConnected = TRUE; - break; - - case AIS_STATE_JOIN: - /* Do abort JOIN */ - aisFsmStateAbort_JOIN(prAdapter); - - /* in case roaming is triggered */ - fgIsCheckConnected = TRUE; - break; - -#if CFG_SUPPORT_ADHOC - case AIS_STATE_IBSS_ALONE: - case AIS_STATE_IBSS_MERGE: - aisFsmStateAbort_IBSS(prAdapter); - break; -#endif /* CFG_SUPPORT_ADHOC */ - - case AIS_STATE_ONLINE_SCAN: - /* Do abort SCAN */ - aisFsmStateAbort_SCAN(prAdapter); - - /* queue for later handling */ - if(aisFsmIsRequestPending(prAdapter, AIS_REQUEST_SCAN, FALSE) == FALSE) { - aisFsmInsertRequest(prAdapter, AIS_REQUEST_SCAN); - } - - fgIsCheckConnected = TRUE; - break; - - case AIS_STATE_NORMAL_TR: - fgIsCheckConnected = TRUE; - break; - - case AIS_STATE_DISCONNECTING: - /* Do abort NORMAL_TR */ - aisFsmStateAbort_NORMAL_TR(prAdapter); - - break; - - default: - break; - } - - if (fgIsCheckConnected && - (PARAM_MEDIA_STATE_CONNECTED == prAisBssInfo->eConnectionState)) { - - /* switch into DISCONNECTING state for sending DEAUTH if necessary */ - if (prAisBssInfo->eCurrentOPMode == OP_MODE_INFRASTRUCTURE && - prAisBssInfo->ucReasonOfDisconnect == DISCONNECT_REASON_CODE_NEW_CONNECTION && - prAisBssInfo->prStaRecOfAP && - prAisBssInfo->prStaRecOfAP->fgIsInUse) { - aisFsmSteps(prAdapter, AIS_STATE_DISCONNECTING); - - return; - } - else { - /* Do abort NORMAL_TR */ - aisFsmStateAbort_NORMAL_TR(prAdapter); - } - } - - aisFsmDisconnect(prAdapter, fgDelayIndication); - - return; - -} /* end of aisFsmStateAbort() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will handle the Join Complete Event from SAA FSM for AIS FSM -* -* @param[in] prMsgHdr Message of Join Complete of SAA FSM. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmRunEventJoinComplete ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_JOIN_COMP_T prJoinCompMsg; - P_AIS_FSM_INFO_T prAisFsmInfo; - ENUM_AIS_STATE_T eNextState; - P_STA_RECORD_T prStaRec; - P_SW_RFB_T prAssocRspSwRfb; - - DEBUGFUNC("aisFsmRunEventJoinComplete()"); - - ASSERT(prMsgHdr); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prJoinCompMsg = (P_MSG_JOIN_COMP_T)prMsgHdr; - prStaRec = prJoinCompMsg->prStaRec; - prAssocRspSwRfb = prJoinCompMsg->prSwRfb; - - eNextState = prAisFsmInfo->eCurrentState; - - // Check State and SEQ NUM - if (prAisFsmInfo->eCurrentState == AIS_STATE_JOIN) { - P_BSS_INFO_T prAisBssInfo; - - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - - // Check SEQ NUM - if (prJoinCompMsg->ucSeqNum == prAisFsmInfo->ucSeqNumOfReqMsg) { - - - //4 <1> JOIN was successful - if (prJoinCompMsg->rJoinStatus == WLAN_STATUS_SUCCESS) { - - //1. Reset retry count - prAisFsmInfo->ucConnTrialCount = 0; - - // Completion of roaming - if (prAisBssInfo->eConnectionState == PARAM_MEDIA_STATE_CONNECTED) { - -#if CFG_SUPPORT_ROAMING - //2. Deactivate previous BSS - aisFsmRoamingDisconnectPrevAP(prAdapter, prStaRec); - - //3. Update bss based on roaming staRec - aisUpdateBssInfoForRoamingAP(prAdapter, prStaRec, prAssocRspSwRfb); -#endif /* CFG_SUPPORT_ROAMING */ - } - else { - //4 <1.1> Change FW's Media State immediately. - aisChangeMediaState(prAdapter, PARAM_MEDIA_STATE_CONNECTED); - - //4 <1.2> Deactivate previous AP's STA_RECORD_T in Driver if have. - if ((prAisBssInfo->prStaRecOfAP) && - (prAisBssInfo->prStaRecOfAP != prStaRec) && - (prAisBssInfo->prStaRecOfAP->fgIsInUse)) { - - cnmStaRecChangeState(prAdapter, prAisBssInfo->prStaRecOfAP, STA_STATE_1); - } - - //4 <1.3> Update BSS_INFO_T - aisUpdateBssInfoForJOIN(prAdapter, prStaRec, prAssocRspSwRfb); - - //4 <1.4> Activate current AP's STA_RECORD_T in Driver. - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_3); - - //4 <1.5> Update RSSI if necessary - nicUpdateRSSI(prAdapter, NETWORK_TYPE_AIS_INDEX, (INT_8)(RCPI_TO_dBm(prStaRec->ucRCPI)), 0); - - //4 <1.6> Indicate Connected Event to Host immediately. - /* Require BSSID, Association ID, Beacon Interval.. from AIS_BSS_INFO_T */ - aisIndicationOfMediaStateToHost(prAdapter, PARAM_MEDIA_STATE_CONNECTED, FALSE); - } - -#if CFG_SUPPORT_ROAMING - roamingFsmRunEventStart(prAdapter); -#endif /* CFG_SUPPORT_ROAMING */ - - //4 <1.7> Set the Next State of AIS FSM - eNextState = AIS_STATE_NORMAL_TR; - } - //4 <2> JOIN was not successful - else { - //4 <2.1> Redo JOIN process with other Auth Type if possible - if (aisFsmStateInit_RetryJOIN(prAdapter, prStaRec) == FALSE) { - P_BSS_DESC_T prBssDesc; - - /* 1. Increase Failure Count */ - prStaRec->ucJoinFailureCount++; - - /* 2. release channel */ - aisFsmReleaseCh(prAdapter); - - /* 3.1 stop join timeout timer */ - cnmTimerStopTimer(prAdapter, &prAisFsmInfo->rJoinTimeoutTimer); - - /* 3.2 reset local variable */ - prAisFsmInfo->fgIsInfraChannelFinished = TRUE; - - prBssDesc = scanSearchBssDescByBssid(prAdapter, prStaRec->aucMacAddr); - - ASSERT(prBssDesc); - ASSERT(prBssDesc->fgIsConnecting); - - if(prBssDesc) { - prBssDesc->fgIsConnecting = FALSE; - } - - /* 3.3 Free STA-REC */ - if(prStaRec != prAisBssInfo->prStaRecOfAP) { - cnmStaRecFree(prAdapter, prStaRec, FALSE); - } - - if (prAisBssInfo->eConnectionState == PARAM_MEDIA_STATE_CONNECTED) { -#if CFG_SUPPORT_ROAMING - eNextState = AIS_STATE_WAIT_FOR_NEXT_SCAN; -#endif /* CFG_SUPPORT_ROAMING */ - } - else { - /* 4. send reconnect request */ - aisFsmInsertRequest(prAdapter, AIS_REQUEST_RECONNECT); - - eNextState = AIS_STATE_IDLE; - } - } - } - } -#if DBG - else { - DBGLOG(AIS, WARN, ("SEQ NO of AIS JOIN COMP MSG is not matched.\n")); - } -#endif /* DBG */ - - } - - if (eNextState != prAisFsmInfo->eCurrentState) { - aisFsmSteps(prAdapter, eNextState); - } - - if (prAssocRspSwRfb) { - nicRxReturnRFB(prAdapter, prAssocRspSwRfb); - } - - cnmMemFree(prAdapter, prMsgHdr); - - return; -} /* end of aisFsmRunEventJoinComplete() */ - - -#if CFG_SUPPORT_ADHOC -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will handle the Grant Msg of IBSS Create which was sent by -* CNM to indicate that channel was changed for creating IBSS. -* -* @param[in] prAdapter Pointer of ADAPTER_T -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmCreateIBSS ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - - ASSERT(prAdapter); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - - do { - // Check State - if (prAisFsmInfo->eCurrentState == AIS_STATE_IBSS_ALONE) { - aisUpdateBssInfoForCreateIBSS(prAdapter); - } - } - while (FALSE); - - return; -} /* end of aisFsmCreateIBSS() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will handle the Grant Msg of IBSS Merge which was sent by -* CNM to indicate that channel was changed for merging IBSS. -* -* @param[in] prAdapter Pointer of ADAPTER_T -* @param[in] prStaRec Pointer of STA_RECORD_T for merge -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmMergeIBSS ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - ENUM_AIS_STATE_T eNextState; - P_BSS_INFO_T prAisBssInfo; - - ASSERT(prAdapter); - ASSERT(prStaRec); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - - do { - - eNextState = prAisFsmInfo->eCurrentState; - - switch (prAisFsmInfo->eCurrentState) { - case AIS_STATE_IBSS_MERGE: - { - P_BSS_DESC_T prBssDesc; - - //4 <1.1> Change FW's Media State immediately. - aisChangeMediaState(prAdapter, PARAM_MEDIA_STATE_CONNECTED); - - //4 <1.2> Deactivate previous Peers' STA_RECORD_T in Driver if have. - bssClearClientList(prAdapter, prAisBssInfo); - - //4 <1.3> Unmark connection flag of previous BSS_DESC_T. - if ((prBssDesc = scanSearchBssDescByBssid(prAdapter, prAisBssInfo->aucBSSID)) != NULL) { - prBssDesc->fgIsConnecting = FALSE; - prBssDesc->fgIsConnected = FALSE; - } - - //4 <1.4> Update BSS_INFO_T - aisUpdateBssInfoForMergeIBSS(prAdapter, prStaRec); - - //4 <1.5> Add Peers' STA_RECORD_T to Client List - bssAddStaRecToClientList(prAdapter, prAisBssInfo, prStaRec); - - //4 <1.6> Activate current Peer's STA_RECORD_T in Driver. - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_3); - prStaRec->fgIsMerging = FALSE; - - //4 <1.7> Enable other features - - //4 <1.8> Indicate Connected Event to Host immediately. - aisIndicationOfMediaStateToHost(prAdapter, PARAM_MEDIA_STATE_CONNECTED, FALSE); - - //4 <1.9> Set the Next State of AIS FSM - eNextState = AIS_STATE_NORMAL_TR; - - //4 <1.10> Release channel privilege - aisFsmReleaseCh(prAdapter); - -#if CFG_SLT_SUPPORT - prAdapter->rWifiVar.rSltInfo.prPseudoStaRec = prStaRec; -#endif - } - break; - - default: - break; - } - - if (eNextState != prAisFsmInfo->eCurrentState) { - aisFsmSteps(prAdapter, eNextState); - } - - } - while (FALSE); - - return; -} /* end of aisFsmMergeIBSS() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will handle the Notification of existing IBSS was found -* from SCN. -* -* @param[in] prMsgHdr Message of Notification of an IBSS was present. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmRunEventFoundIBSSPeer ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_AIS_IBSS_PEER_FOUND_T prAisIbssPeerFoundMsg; - P_AIS_FSM_INFO_T prAisFsmInfo; - ENUM_AIS_STATE_T eNextState; - P_STA_RECORD_T prStaRec; - P_BSS_INFO_T prAisBssInfo; - P_BSS_DESC_T prBssDesc; - BOOLEAN fgIsMergeIn; - - - ASSERT(prMsgHdr); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - - prAisIbssPeerFoundMsg = (P_MSG_AIS_IBSS_PEER_FOUND_T)prMsgHdr; - - ASSERT(prAisIbssPeerFoundMsg->ucNetTypeIndex == NETWORK_TYPE_AIS_INDEX); - - prStaRec = prAisIbssPeerFoundMsg->prStaRec; - ASSERT(prStaRec); - - fgIsMergeIn = prAisIbssPeerFoundMsg->fgIsMergeIn; - - cnmMemFree(prAdapter, prMsgHdr); - - - eNextState = prAisFsmInfo->eCurrentState; - switch (prAisFsmInfo->eCurrentState) { - case AIS_STATE_IBSS_ALONE: - { - //4 <1> An IBSS Peer 'merged in'. - if (fgIsMergeIn) { - - //4 <1.1> Change FW's Media State immediately. - aisChangeMediaState(prAdapter, PARAM_MEDIA_STATE_CONNECTED); - - //4 <1.2> Add Peers' STA_RECORD_T to Client List - bssAddStaRecToClientList(prAdapter, prAisBssInfo, prStaRec); - -#if CFG_SLT_SUPPORT - //4 <1.3> Mark connection flag of BSS_DESC_T. - if ((prBssDesc = scanSearchBssDescByTA(prAdapter, prStaRec->aucMacAddr)) != NULL) { - prBssDesc->fgIsConnecting = FALSE; - prBssDesc->fgIsConnected = TRUE; - } - else { - ASSERT(0); // Should be able to find a BSS_DESC_T here. - } - - //4 <1.4> Activate current Peer's STA_RECORD_T in Driver. - prStaRec->fgIsQoS = TRUE; /* TODO(Kevin): TBD */ -#else - //4 <1.3> Mark connection flag of BSS_DESC_T. - if ((prBssDesc = scanSearchBssDescByBssid(prAdapter, prAisBssInfo->aucBSSID)) != NULL) { - prBssDesc->fgIsConnecting = FALSE; - prBssDesc->fgIsConnected = TRUE; - } - else { - ASSERT(0); // Should be able to find a BSS_DESC_T here. - } - - - //4 <1.4> Activate current Peer's STA_RECORD_T in Driver. - prStaRec->fgIsQoS = FALSE; /* TODO(Kevin): TBD */ - -#endif - - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_3); - prStaRec->fgIsMerging = FALSE; - - //4 <1.6> sync. to firmware - nicUpdateBss(prAdapter, NETWORK_TYPE_AIS_INDEX); - - //4 <1.7> Indicate Connected Event to Host immediately. - aisIndicationOfMediaStateToHost(prAdapter, PARAM_MEDIA_STATE_CONNECTED, FALSE); - - //4 <1.8> indicate PM for connected - nicPmIndicateBssConnected(prAdapter, NETWORK_TYPE_AIS_INDEX); - - //4 <1.9> Set the Next State of AIS FSM - eNextState = AIS_STATE_NORMAL_TR; - - //4 <1.10> Release channel privilege - aisFsmReleaseCh(prAdapter); - } - //4 <2> We need 'merge out' to this IBSS - else { - - //4 <2.1> Get corresponding BSS_DESC_T - prBssDesc = scanSearchBssDescByTA(prAdapter, prStaRec->aucMacAddr); - - prAisFsmInfo->prTargetBssDesc = prBssDesc; - - //4 <2.2> Set the Next State of AIS FSM - eNextState = AIS_STATE_IBSS_MERGE; - } - } - break; - - case AIS_STATE_NORMAL_TR: - { - - //4 <3> An IBSS Peer 'merged in'. - if (fgIsMergeIn) { - - //4 <3.1> Add Peers' STA_RECORD_T to Client List - bssAddStaRecToClientList(prAdapter, prAisBssInfo, prStaRec); - -#if CFG_SLT_SUPPORT - //4 <3.2> Activate current Peer's STA_RECORD_T in Driver. - prStaRec->fgIsQoS = TRUE; /* TODO(Kevin): TBD */ -#else - //4 <3.2> Activate current Peer's STA_RECORD_T in Driver. - prStaRec->fgIsQoS = FALSE; /* TODO(Kevin): TBD */ -#endif - - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_3); - prStaRec->fgIsMerging = FALSE; - - } - //4 <4> We need 'merge out' to this IBSS - else { - - //4 <4.1> Get corresponding BSS_DESC_T - prBssDesc = scanSearchBssDescByTA(prAdapter, prStaRec->aucMacAddr); - - prAisFsmInfo->prTargetBssDesc = prBssDesc; - - //4 <4.2> Set the Next State of AIS FSM - eNextState = AIS_STATE_IBSS_MERGE; - - } - } - break; - - default: - break; - } - - if (eNextState != prAisFsmInfo->eCurrentState) { - aisFsmSteps(prAdapter, eNextState); - } - - return; -} /* end of aisFsmRunEventFoundIBSSPeer() */ -#endif /* CFG_SUPPORT_ADHOC */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will indicate the Media State to HOST -* -* @param[in] eConnectionState Current Media State -* @param[in] fgDelayIndication Set TRUE for postponing the Disconnect Indication. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisIndicationOfMediaStateToHost ( - IN P_ADAPTER_T prAdapter, - ENUM_PARAM_MEDIA_STATE_T eConnectionState, - BOOLEAN fgDelayIndication - ) -{ - EVENT_CONNECTION_STATUS rEventConnStatus; - P_CONNECTION_SETTINGS_T prConnSettings; - P_BSS_INFO_T prAisBssInfo; - P_AIS_FSM_INFO_T prAisFsmInfo; - - DEBUGFUNC("aisIndicationOfMediaStateToHost()"); - - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - - // NOTE(Kevin): Move following line to aisChangeMediaState() macro per CM's request. - //prAisBssInfo->eConnectionState = eConnectionState; - - /* For indicating the Disconnect Event only if current media state is - * disconnected and we didn't do indication yet. - */ - if (prAisBssInfo->eConnectionState == PARAM_MEDIA_STATE_DISCONNECTED) { - if (prAisBssInfo->eConnectionStateIndicated == eConnectionState) { - return; - } - } - - if (!fgDelayIndication) { - //4 <0> Cancel Delay Timer - cnmTimerStopTimer(prAdapter, &prAisFsmInfo->rIndicationOfDisconnectTimer); - - //4 <1> Fill EVENT_CONNECTION_STATUS - rEventConnStatus.ucMediaStatus = (UINT_8)eConnectionState; - - if (eConnectionState == PARAM_MEDIA_STATE_CONNECTED) { - rEventConnStatus.ucReasonOfDisconnect = DISCONNECT_REASON_CODE_RESERVED; - - if (prAisBssInfo->eCurrentOPMode == OP_MODE_INFRASTRUCTURE) { - rEventConnStatus.ucInfraMode = (UINT_8)NET_TYPE_INFRA; - rEventConnStatus.u2AID = prAisBssInfo->u2AssocId; - rEventConnStatus.u2ATIMWindow = 0; - } - else if (prAisBssInfo->eCurrentOPMode == OP_MODE_IBSS) { - rEventConnStatus.ucInfraMode = (UINT_8)NET_TYPE_IBSS; - rEventConnStatus.u2AID = 0; - rEventConnStatus.u2ATIMWindow = prAisBssInfo->u2ATIMWindow; - } - else { - ASSERT(0); - } - - COPY_SSID(rEventConnStatus.aucSsid, - rEventConnStatus.ucSsidLen, - prConnSettings->aucSSID, - prConnSettings->ucSSIDLen); - - COPY_MAC_ADDR(rEventConnStatus.aucBssid, prAisBssInfo->aucBSSID); - - rEventConnStatus.u2BeaconPeriod = prAisBssInfo->u2BeaconInterval; - rEventConnStatus.u4FreqInKHz = nicChannelNum2Freq(prAisBssInfo->ucPrimaryChannel); - - switch (prAisBssInfo->ucNonHTBasicPhyType) { - case PHY_TYPE_HR_DSSS_INDEX: - rEventConnStatus.ucNetworkType = (UINT_8)PARAM_NETWORK_TYPE_DS; - break; - - case PHY_TYPE_ERP_INDEX: - rEventConnStatus.ucNetworkType = (UINT_8)PARAM_NETWORK_TYPE_OFDM24; - break; - - case PHY_TYPE_OFDM_INDEX: - rEventConnStatus.ucNetworkType = (UINT_8)PARAM_NETWORK_TYPE_OFDM5; - break; - - default: - ASSERT(0); - rEventConnStatus.ucNetworkType = (UINT_8)PARAM_NETWORK_TYPE_DS; - break; - } - } - else { - /* Deactivate previous Peers' STA_RECORD_T in Driver if have. */ - bssClearClientList(prAdapter, prAisBssInfo); - - #if CFG_PRIVACY_MIGRATION - /* Clear the pmkid cache while media disconnect */ - secClearPmkid(prAdapter); - #endif - - rEventConnStatus.ucReasonOfDisconnect = prAisBssInfo->ucReasonOfDisconnect; - } - - //4 <2> Indication - nicMediaStateChange(prAdapter, NETWORK_TYPE_AIS_INDEX, &rEventConnStatus); - prAisBssInfo->eConnectionStateIndicated = eConnectionState; - } - else { - /* NOTE: Only delay the Indication of Disconnect Event */ - ASSERT(eConnectionState == PARAM_MEDIA_STATE_DISCONNECTED); - - DBGLOG(AIS, INFO, ("Postpone the indication of Disconnect for %d seconds\n", - prConnSettings->ucDelayTimeOfDisconnectEvent)); - - cnmTimerStartTimer(prAdapter, - &prAisFsmInfo->rIndicationOfDisconnectTimer, - SEC_TO_MSEC(prConnSettings->ucDelayTimeOfDisconnectEvent)); - } - - return; -} /* end of aisIndicationOfMediaStateToHost() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will indicate an Event of "Media Disconnect" to HOST -* -* @param[in] u4Param Unused timer parameter -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisPostponedEventOfDisconnTimeout ( - IN P_ADAPTER_T prAdapter, - UINT_32 u4Param - ) -{ - P_BSS_INFO_T prAisBssInfo; - P_CONNECTION_SETTINGS_T prConnSettings; - - - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - - //4 <1> Deactivate previous AP's STA_RECORD_T in Driver if have. - if (prAisBssInfo->prStaRecOfAP) { - //cnmStaRecChangeState(prAdapter, prAisBssInfo->prStaRecOfAP, STA_STATE_1); - - prAisBssInfo->prStaRecOfAP = (P_STA_RECORD_T)NULL; - } - - //4 <2> Remove pending connection request - aisFsmIsRequestPending(prAdapter, AIS_REQUEST_RECONNECT, TRUE); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - /* Set Connection Request Issued Flag */ - prConnSettings->fgIsConnReqIssued = FALSE; - - //4 <3> Indicate Disconnected Event to Host immediately. - aisIndicationOfMediaStateToHost(prAdapter, PARAM_MEDIA_STATE_DISCONNECTED, FALSE); - - return; -} /* end of aisPostponedEventOfDisconnTimeout() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will update the contain of BSS_INFO_T for AIS network once -* the association was completed. -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* @param[in] prAssocRspSwRfb Pointer to SW RFB of ASSOC RESP FRAME. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisUpdateBssInfoForJOIN ( - IN P_ADAPTER_T prAdapter, - P_STA_RECORD_T prStaRec, - P_SW_RFB_T prAssocRspSwRfb - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_BSS_INFO_T prAisBssInfo; - P_CONNECTION_SETTINGS_T prConnSettings; - P_WLAN_ASSOC_RSP_FRAME_T prAssocRspFrame; - P_BSS_DESC_T prBssDesc; - UINT_16 u2IELength; - PUINT_8 pucIE; - - DEBUGFUNC("aisUpdateBssInfoForJOIN()"); - - ASSERT(prStaRec); - ASSERT(prAssocRspSwRfb); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - prAssocRspFrame = (P_WLAN_ASSOC_RSP_FRAME_T) prAssocRspSwRfb->pvHeader; - - - DBGLOG(AIS, INFO, ("Update AIS_BSS_INFO_T and apply settings to MAC\n")); - - - //3 <1> Update BSS_INFO_T from AIS_FSM_INFO_T or User Settings - //4 <1.1> Setup Operation Mode - prAisBssInfo->eCurrentOPMode = OP_MODE_INFRASTRUCTURE; - - //4 <1.2> Setup SSID - COPY_SSID(prAisBssInfo->aucSSID, - prAisBssInfo->ucSSIDLen, - prConnSettings->aucSSID, - prConnSettings->ucSSIDLen); - - //4 <1.3> Setup Channel, Band - prAisBssInfo->ucPrimaryChannel = prAisFsmInfo->prTargetBssDesc->ucChannelNum; - prAisBssInfo->eBand = prAisFsmInfo->prTargetBssDesc->eBand; - - - //3 <2> Update BSS_INFO_T from STA_RECORD_T - //4 <2.1> Save current AP's STA_RECORD_T and current AID - prAisBssInfo->prStaRecOfAP = prStaRec; - prAisBssInfo->u2AssocId = prStaRec->u2AssocId; - - //4 <2.2> Setup Capability - prAisBssInfo->u2CapInfo = prStaRec->u2CapInfo; /* Use AP's Cap Info as BSS Cap Info */ - - if (prAisBssInfo->u2CapInfo & CAP_INFO_SHORT_PREAMBLE) { - prAisBssInfo->fgIsShortPreambleAllowed = TRUE; - } - else { - prAisBssInfo->fgIsShortPreambleAllowed = FALSE; - } - - //4 <2.3> Setup PHY Attributes and Basic Rate Set/Operational Rate Set - prAisBssInfo->ucPhyTypeSet = prStaRec->ucDesiredPhyTypeSet; - - prAisBssInfo->ucNonHTBasicPhyType = prStaRec->ucNonHTBasicPhyType; - - prAisBssInfo->u2OperationalRateSet = prStaRec->u2OperationalRateSet; - prAisBssInfo->u2BSSBasicRateSet = prStaRec->u2BSSBasicRateSet; - - - //3 <3> Update BSS_INFO_T from SW_RFB_T (Association Resp Frame) - //4 <3.1> Setup BSSID - COPY_MAC_ADDR(prAisBssInfo->aucBSSID, prAssocRspFrame->aucBSSID); - - - u2IELength = (UINT_16) ((prAssocRspSwRfb->u2PacketLen - prAssocRspSwRfb->u2HeaderLen) - - (OFFSET_OF(WLAN_ASSOC_RSP_FRAME_T, aucInfoElem[0]) - WLAN_MAC_MGMT_HEADER_LEN)); - pucIE = prAssocRspFrame->aucInfoElem; - - - //4 <3.2> Parse WMM and setup QBSS flag - /* Parse WMM related IEs and configure HW CRs accordingly */ - mqmProcessAssocRsp(prAdapter, prAssocRspSwRfb, pucIE, u2IELength); - - prAisBssInfo->fgIsQBSS = prStaRec->fgIsQoS; - - //3 <4> Update BSS_INFO_T from BSS_DESC_T - prBssDesc = scanSearchBssDescByBssid(prAdapter, prAssocRspFrame->aucBSSID); - if(prBssDesc) { - prBssDesc->fgIsConnecting = FALSE; - prBssDesc->fgIsConnected = TRUE; - - //4 <4.1> Setup MIB for current BSS - prAisBssInfo->u2BeaconInterval = prBssDesc->u2BeaconInterval; - } - else { - // should never happen - ASSERT(0); - } - - /* NOTE: Defer ucDTIMPeriod updating to when beacon is received after connection */ - prAisBssInfo->ucDTIMPeriod = 0; - prAisBssInfo->u2ATIMWindow = 0; - - prAisBssInfo->ucBeaconTimeoutCount = AIS_BEACON_TIMEOUT_COUNT_INFRA; - - //4 <4.2> Update HT information and set channel - /* Record HT related parameters in rStaRec and rBssInfo - * Note: it shall be called before nicUpdateBss() - */ - rlmProcessAssocRsp(prAdapter, prAssocRspSwRfb, pucIE, u2IELength); - - //4 <4.3> Sync with firmware for BSS-INFO - nicUpdateBss(prAdapter, NETWORK_TYPE_AIS_INDEX); - - //4 <4.4> *DEFER OPERATION* nicPmIndicateBssConnected() will be invoked - //inside scanProcessBeaconAndProbeResp() after 1st beacon is received - - return; -} /* end of aisUpdateBssInfoForJOIN() */ - - -#if CFG_SUPPORT_ADHOC -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will create an Ad-Hoc network and start sending Beacon Frames. -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisUpdateBssInfoForCreateIBSS ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_BSS_INFO_T prAisBssInfo; - P_CONNECTION_SETTINGS_T prConnSettings; - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - - if (prAisBssInfo->fgIsBeaconActivated) { - return; - } - - //3 <1> Update BSS_INFO_T per Network Basis - //4 <1.1> Setup Operation Mode - prAisBssInfo->eCurrentOPMode = OP_MODE_IBSS; - - //4 <1.2> Setup SSID - COPY_SSID(prAisBssInfo->aucSSID, - prAisBssInfo->ucSSIDLen, - prConnSettings->aucSSID, - prConnSettings->ucSSIDLen); - - //4 <1.3> Clear current AP's STA_RECORD_T and current AID - prAisBssInfo->prStaRecOfAP = (P_STA_RECORD_T)NULL; - prAisBssInfo->u2AssocId = 0; - - //4 <1.4> Setup Channel, Band and Phy Attributes - prAisBssInfo->ucPrimaryChannel = prConnSettings->ucAdHocChannelNum; - prAisBssInfo->eBand = prConnSettings->eAdHocBand; - - if (prAisBssInfo->eBand == BAND_2G4) { - - prAisBssInfo->ucPhyTypeSet = - prAdapter->rWifiVar.ucAvailablePhyTypeSet & PHY_TYPE_SET_802_11BGN; /* Depend on eBand */ - - prAisBssInfo->ucConfigAdHocAPMode = AD_HOC_MODE_MIXED_11BG; /* Depend on eCurrentOPMode and ucPhyTypeSet */ - } - else { - - prAisBssInfo->ucPhyTypeSet = - prAdapter->rWifiVar.ucAvailablePhyTypeSet & PHY_TYPE_SET_802_11AN; /* Depend on eBand */ - - prAisBssInfo->ucConfigAdHocAPMode = AD_HOC_MODE_11A; /* Depend on eCurrentOPMode and ucPhyTypeSet */ - } - - //4 <1.5> Setup MIB for current BSS - prAisBssInfo->u2BeaconInterval = prConnSettings->u2BeaconPeriod; - prAisBssInfo->ucDTIMPeriod = 0; - prAisBssInfo->u2ATIMWindow = prConnSettings->u2AtimWindow; - - prAisBssInfo->ucBeaconTimeoutCount = AIS_BEACON_TIMEOUT_COUNT_ADHOC; - -#if CFG_PRIVACY_MIGRATION - if (prConnSettings->eEncStatus == ENUM_ENCRYPTION1_ENABLED || - prConnSettings->eEncStatus == ENUM_ENCRYPTION2_ENABLED || - prConnSettings->eEncStatus == ENUM_ENCRYPTION3_ENABLED) { - prAisBssInfo->fgIsProtection = TRUE; - } - else { - prAisBssInfo->fgIsProtection = FALSE; - } -#else - prAisBssInfo->fgIsProtection = FALSE; -#endif - - //3 <2> Update BSS_INFO_T common part - ibssInitForAdHoc(prAdapter, prAisBssInfo); - - - - //3 <3> Set MAC HW - //4 <3.1> Setup channel and bandwidth - rlmBssInitForAPandIbss(prAdapter, prAisBssInfo); - - //4 <3.2> use command packets to inform firmware - nicUpdateBss(prAdapter, NETWORK_TYPE_AIS_INDEX); - - //4 <3.3> enable beaconing - bssUpdateBeaconContent(prAdapter, NETWORK_TYPE_AIS_INDEX); - - //4 <3.4> Update AdHoc PM parameter - nicPmIndicateBssCreated(prAdapter, NETWORK_TYPE_AIS_INDEX); - - //3 <4> Set ACTIVE flag. - prAisBssInfo->fgIsBeaconActivated = TRUE; - prAisBssInfo->fgHoldSameBssidForIBSS = TRUE; - - //3 <5> Start IBSS Alone Timer - cnmTimerStartTimer(prAdapter, - &prAisFsmInfo->rIbssAloneTimer, - SEC_TO_MSEC(AIS_IBSS_ALONE_TIMEOUT_SEC)); - - return; - -} /* end of aisCreateIBSS() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will update the contain of BSS_INFO_T for AIS network once -* the existing IBSS was found. -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisUpdateBssInfoForMergeIBSS ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_BSS_INFO_T prAisBssInfo; - P_CONNECTION_SETTINGS_T prConnSettings; - P_BSS_DESC_T prBssDesc; - //UINT_16 u2IELength; - //PUINT_8 pucIE; - - - ASSERT(prStaRec); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - - cnmTimerStopTimer(prAdapter, &prAisFsmInfo->rIbssAloneTimer); - - if (!prAisBssInfo->fgIsBeaconActivated) { - - //3 <1> Update BSS_INFO_T per Network Basis - //4 <1.1> Setup Operation Mode - prAisBssInfo->eCurrentOPMode = OP_MODE_IBSS; - - //4 <1.2> Setup SSID - COPY_SSID(prAisBssInfo->aucSSID, - prAisBssInfo->ucSSIDLen, - prConnSettings->aucSSID, - prConnSettings->ucSSIDLen); - - //4 <1.3> Clear current AP's STA_RECORD_T and current AID - prAisBssInfo->prStaRecOfAP = (P_STA_RECORD_T)NULL; - prAisBssInfo->u2AssocId = 0; - } - - //3 <2> Update BSS_INFO_T from STA_RECORD_T - //4 <2.1> Setup Capability - prAisBssInfo->u2CapInfo = prStaRec->u2CapInfo; /* Use Peer's Cap Info as IBSS Cap Info */ - - if (prAisBssInfo->u2CapInfo & CAP_INFO_SHORT_PREAMBLE) { - prAisBssInfo->fgIsShortPreambleAllowed = TRUE; - prAisBssInfo->fgUseShortPreamble = TRUE; - } - else { - prAisBssInfo->fgIsShortPreambleAllowed = FALSE; - prAisBssInfo->fgUseShortPreamble = FALSE; - } - - // 7.3.1.4 For IBSS, the Short Slot Time subfield shall be set to 0. - prAisBssInfo->fgUseShortSlotTime = FALSE; /* Set to FALSE for AdHoc */ - prAisBssInfo->u2CapInfo &= ~CAP_INFO_SHORT_SLOT_TIME; - - if (prAisBssInfo->u2CapInfo & CAP_INFO_PRIVACY) { - prAisBssInfo->fgIsProtection= TRUE; - } - else { - prAisBssInfo->fgIsProtection = FALSE; - } - - //4 <2.2> Setup PHY Attributes and Basic Rate Set/Operational Rate Set - prAisBssInfo->ucPhyTypeSet = prStaRec->ucDesiredPhyTypeSet; - - prAisBssInfo->ucNonHTBasicPhyType = prStaRec->ucNonHTBasicPhyType; - - prAisBssInfo->u2OperationalRateSet = prStaRec->u2OperationalRateSet; - prAisBssInfo->u2BSSBasicRateSet = prStaRec->u2BSSBasicRateSet; - - rateGetDataRatesFromRateSet(prAisBssInfo->u2OperationalRateSet, - prAisBssInfo->u2BSSBasicRateSet, - prAisBssInfo->aucAllSupportedRates, - &prAisBssInfo->ucAllSupportedRatesLen); - - //3 <3> X Update BSS_INFO_T from SW_RFB_T (Association Resp Frame) - - - //3 <4> Update BSS_INFO_T from BSS_DESC_T - prBssDesc = scanSearchBssDescByTA(prAdapter, prStaRec->aucMacAddr); - if(prBssDesc) { - prBssDesc->fgIsConnecting = FALSE; - prBssDesc->fgIsConnected = TRUE; - - //4 <4.1> Setup BSSID - COPY_MAC_ADDR(prAisBssInfo->aucBSSID, prBssDesc->aucBSSID); - - //4 <4.2> Setup Channel, Band - prAisBssInfo->ucPrimaryChannel = prBssDesc->ucChannelNum; - prAisBssInfo->eBand = prBssDesc->eBand; - - //4 <4.3> Setup MIB for current BSS - prAisBssInfo->u2BeaconInterval = prBssDesc->u2BeaconInterval; - prAisBssInfo->ucDTIMPeriod = 0; - prAisBssInfo->u2ATIMWindow = 0; /* TBD(Kevin) */ - - prAisBssInfo->ucBeaconTimeoutCount = AIS_BEACON_TIMEOUT_COUNT_ADHOC; - } - else { - // should never happen - ASSERT(0); - } - - - //3 <5> Set MAC HW - //4 <5.1> Find Lowest Basic Rate Index for default TX Rate of MMPDU - { - UINT_8 ucLowestBasicRateIndex; - - if (!rateGetLowestRateIndexFromRateSet(prAisBssInfo->u2BSSBasicRateSet, - &ucLowestBasicRateIndex)) { - - if (prAisBssInfo->ucPhyTypeSet & PHY_TYPE_BIT_OFDM) { - ucLowestBasicRateIndex = RATE_6M_INDEX; - } - else { - ucLowestBasicRateIndex = RATE_1M_INDEX; - } - } - - prAisBssInfo->ucHwDefaultFixedRateCode = - aucRateIndex2RateCode[prAisBssInfo->fgUseShortPreamble][ucLowestBasicRateIndex]; - } - - //4 <5.2> Setup channel and bandwidth - rlmBssInitForAPandIbss(prAdapter, prAisBssInfo); - - //4 <5.3> use command packets to inform firmware - nicUpdateBss(prAdapter, NETWORK_TYPE_AIS_INDEX); - - //4 <5.4> enable beaconing - bssUpdateBeaconContent(prAdapter, NETWORK_TYPE_AIS_INDEX); - - //4 <5.5> Update AdHoc PM parameter - nicPmIndicateBssConnected(prAdapter, NETWORK_TYPE_AIS_INDEX); - - //3 <6> Set ACTIVE flag. - prAisBssInfo->fgIsBeaconActivated = TRUE; - prAisBssInfo->fgHoldSameBssidForIBSS = TRUE; - - return; -} /* end of aisUpdateBssInfoForMergeIBSS() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will validate the Rx Probe Request Frame and then return -* result to BSS to indicate if need to send the corresponding Probe Response -* Frame if the specified conditions were matched. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prSwRfb Pointer to SW RFB data structure. -* @param[out] pu4ControlFlags Control flags for replying the Probe Response -* -* @retval TRUE Reply the Probe Response -* @retval FALSE Don't reply the Probe Response -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -aisValidateProbeReq ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_32 pu4ControlFlags - ) -{ - P_WLAN_MAC_MGMT_HEADER_T prMgtHdr; - P_BSS_INFO_T prBssInfo; - P_IE_SSID_T prIeSsid = (P_IE_SSID_T)NULL; - PUINT_8 pucIE; - UINT_16 u2IELength; - UINT_16 u2Offset = 0; - BOOLEAN fgReplyProbeResp = FALSE; - - - ASSERT(prSwRfb); - ASSERT(pu4ControlFlags); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - - //4 <1> Parse Probe Req IE and Get IE ptr (SSID, Supported Rate IE, ...) - prMgtHdr = (P_WLAN_MAC_MGMT_HEADER_T)prSwRfb->pvHeader; - - u2IELength = prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen; - pucIE = (PUINT_8)((UINT_32)prSwRfb->pvHeader + prSwRfb->u2HeaderLen); - - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - if (ELEM_ID_SSID == IE_ID(pucIE)) { - if ((!prIeSsid) && - (IE_LEN(pucIE) <= ELEM_MAX_LEN_SSID)) { - prIeSsid = (P_IE_SSID_T)pucIE; - } - break; - } - } /* end of IE_FOR_EACH */ - - //4 <2> Check network conditions - - if (prBssInfo->eCurrentOPMode == OP_MODE_IBSS) { - - if ((prIeSsid) && - ((prIeSsid->ucLength == BC_SSID_LEN) || /* WILDCARD SSID */ - EQUAL_SSID(prBssInfo->aucSSID, prBssInfo->ucSSIDLen, /* CURRENT SSID */ - prIeSsid->aucSSID, prIeSsid->ucLength)) ) { - fgReplyProbeResp = TRUE; - } - } - - return fgReplyProbeResp; - -} /* end of aisValidateProbeReq() */ - -#endif /* CFG_SUPPORT_ADHOC */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will modify and update necessary information to firmware -* for disconnection handling -* -* @param[in] prAdapter Pointer to the Adapter structure. -* -* @retval None -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmDisconnect ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgDelayIndication - ) -{ - P_BSS_INFO_T prAisBssInfo; - - ASSERT(prAdapter); - - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - - nicPmIndicateBssAbort(prAdapter, NETWORK_TYPE_AIS_INDEX); - -#if CFG_SUPPORT_ADHOC - if (prAisBssInfo->fgIsBeaconActivated) { - nicUpdateBeaconIETemplate(prAdapter, - IE_UPD_METHOD_DELETE_ALL, - NETWORK_TYPE_AIS_INDEX, - 0, - NULL, - 0); - - prAisBssInfo->fgIsBeaconActivated = FALSE; - } -#endif - - rlmBssAborted(prAdapter, prAisBssInfo); - - //4 <3> Unset the fgIsConnected flag of BSS_DESC_T and send Deauth if needed. - if (PARAM_MEDIA_STATE_CONNECTED == prAisBssInfo->eConnectionState) { - - if (prAisBssInfo->ucReasonOfDisconnect == DISCONNECT_REASON_CODE_RADIO_LOST) { - scanRemoveBssDescByBssid(prAdapter, prAisBssInfo->aucBSSID); - - /* remove from scanning results as well */ - wlanClearBssInScanningResult(prAdapter, prAisBssInfo->aucBSSID); - - /* trials for re-association */ - if (fgDelayIndication) { - aisFsmIsRequestPending(prAdapter, AIS_REQUEST_RECONNECT, TRUE); - aisFsmInsertRequest(prAdapter, AIS_REQUEST_RECONNECT); - } - } - else { - scanRemoveConnFlagOfBssDescByBssid(prAdapter, prAisBssInfo->aucBSSID); - } - - if (fgDelayIndication) { - if (OP_MODE_IBSS != prAisBssInfo->eCurrentOPMode) { - prAisBssInfo->fgHoldSameBssidForIBSS = FALSE; - } - } - else { - prAisBssInfo->fgHoldSameBssidForIBSS = FALSE; - } - } - else { - prAisBssInfo->fgHoldSameBssidForIBSS = FALSE; - } - - - //4 <4> Change Media State immediately. - aisChangeMediaState(prAdapter, PARAM_MEDIA_STATE_DISCONNECTED); - - //4 <4.1> sync. with firmware - nicUpdateBss(prAdapter, NETWORK_TYPE_AIS_INDEX); - - if (!fgDelayIndication) { - //4 <5> Deactivate previous AP's STA_RECORD_T or all Clients in Driver if have. - if (prAisBssInfo->prStaRecOfAP) { - //cnmStaRecChangeState(prAdapter, prAisBssInfo->prStaRecOfAP, STA_STATE_1); - - prAisBssInfo->prStaRecOfAP = (P_STA_RECORD_T)NULL; - } - } - -#if CFG_SUPPORT_ROAMING - roamingFsmRunEventAbort(prAdapter); - - /* clear pending roaming connection request */ - aisFsmIsRequestPending(prAdapter, AIS_REQUEST_ROAMING_SEARCH, TRUE); - aisFsmIsRequestPending(prAdapter, AIS_REQUEST_ROAMING_CONNECT, TRUE); -#endif /* CFG_SUPPORT_ROAMING */ - - //4 <6> Indicate Disconnected Event to Host - aisIndicationOfMediaStateToHost(prAdapter, - PARAM_MEDIA_STATE_DISCONNECTED, - fgDelayIndication); - - - //4 <7> Trigger AIS FSM - aisFsmSteps(prAdapter, AIS_STATE_IDLE); - - return; -} /* end of aisFsmDisconnect() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will indicate an Event of "Background Scan Time-Out" to AIS FSM. -* -* @param[in] u4Param Unused timer parameter -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmRunEventBGSleepTimeOut ( - IN P_ADAPTER_T prAdapter, - UINT_32 u4Param - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - ENUM_AIS_STATE_T eNextState; - - DEBUGFUNC("aisFsmRunEventBGSleepTimeOut()"); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - - eNextState = prAisFsmInfo->eCurrentState; - - switch (prAisFsmInfo->eCurrentState) { - case AIS_STATE_WAIT_FOR_NEXT_SCAN: - DBGLOG(AIS, LOUD, ("EVENT - SCAN TIMER: Idle End - Current Time = %ld\n", kalGetTimeTick())); - - eNextState = AIS_STATE_LOOKING_FOR; - - SET_NET_PWR_STATE_ACTIVE(prAdapter, NETWORK_TYPE_AIS_INDEX); - - break; - - default: - break; - } - - /* Call aisFsmSteps() when we are going to change AIS STATE */ - if (eNextState != prAisFsmInfo->eCurrentState) { - aisFsmSteps(prAdapter, eNextState); - } - - return; -} /* end of aisFsmBGSleepTimeout() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will indicate an Event of "IBSS ALONE Time-Out" to AIS FSM. -* -* @param[in] u4Param Unused timer parameter -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmRunEventIbssAloneTimeOut ( - IN P_ADAPTER_T prAdapter, - UINT_32 u4Param - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - ENUM_AIS_STATE_T eNextState; - - DEBUGFUNC("aisFsmRunEventIbssAloneTimeOut()"); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - eNextState = prAisFsmInfo->eCurrentState; - - switch(prAisFsmInfo->eCurrentState) { - case AIS_STATE_IBSS_ALONE: - - /* There is no one participate in our AdHoc during this TIMEOUT Interval - * so go back to search for a valid IBSS again. - */ - - DBGLOG(AIS, LOUD, ("EVENT-IBSS ALONE TIMER: Start pairing\n")); - - prAisFsmInfo->fgTryScan = TRUE; - - /* abort timer */ - aisFsmReleaseCh(prAdapter); - - /* Pull back to SEARCH to find candidate again */ - eNextState = AIS_STATE_SEARCH; - - break; - - default: - break; - } - - - /* Call aisFsmSteps() when we are going to change AIS STATE */ - if (eNextState != prAisFsmInfo->eCurrentState) { - aisFsmSteps(prAdapter, eNextState); - } - - return; -} /* end of aisIbssAloneTimeOut() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will indicate an Event of "Join Time-Out" to AIS FSM. -* -* @param[in] u4Param Unused timer parameter -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmRunEventJoinTimeout ( - IN P_ADAPTER_T prAdapter, - UINT_32 u4Param - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - ENUM_AIS_STATE_T eNextState; - - DEBUGFUNC("aisFsmRunEventJoinTimeout()"); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - eNextState = prAisFsmInfo->eCurrentState; - - switch(prAisFsmInfo->eCurrentState) { - case AIS_STATE_JOIN: - DBGLOG(AIS, LOUD, ("EVENT- JOIN TIMEOUT\n")); - - /* 1. Do abort JOIN */ - aisFsmStateAbort_JOIN(prAdapter); - - /* 2. Increase Join Failure Count */ - prAisFsmInfo->prTargetStaRec->ucJoinFailureCount++; - - if(prAisFsmInfo->prTargetStaRec->ucJoinFailureCount < JOIN_MAX_RETRY_FAILURE_COUNT) { - /* 3.1 Retreat to AIS_STATE_SEARCH state for next try */ - eNextState = AIS_STATE_SEARCH; - } - else { - /* 3.2 Retreat to AIS_STATE_WAIT_FOR_NEXT_SCAN state for next try */ - eNextState = AIS_STATE_WAIT_FOR_NEXT_SCAN; - } - break; - - case AIS_STATE_NORMAL_TR: - /* 1. release channel */ - aisFsmReleaseCh(prAdapter); - prAisFsmInfo->fgIsInfraChannelFinished = TRUE; - - /* 2. process if there is pending scan */ - if(aisFsmIsRequestPending(prAdapter, AIS_REQUEST_SCAN, TRUE) == TRUE) { - wlanClearScanningResult(prAdapter); - eNextState = AIS_STATE_ONLINE_SCAN; - } - - break; - - default: - /* release channel */ - aisFsmReleaseCh(prAdapter); - break; - - } - - - /* Call aisFsmSteps() when we are going to change AIS STATE */ - if (eNextState != prAisFsmInfo->eCurrentState) { - aisFsmSteps(prAdapter, eNextState); - } - - return; -} /* end of aisFsmRunEventJoinTimeout() */ - - -#if defined(CFG_TEST_MGMT_FSM) && (CFG_TEST_MGMT_FSM != 0) -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisTest ( - VOID - ) -{ - P_MSG_AIS_ABORT_T prAisAbortMsg; - P_CONNECTION_SETTINGS_T prConnSettings; - UINT_8 aucSSID[]="pci-11n"; - UINT_8 ucSSIDLen=7; - - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - - /* Set Connection Request Issued Flag */ - prConnSettings->fgIsConnReqIssued = TRUE; - prConnSettings->ucSSIDLen = ucSSIDLen; - kalMemCopy(prConnSettings->aucSSID, aucSSID, ucSSIDLen); - - prAisAbortMsg = (P_MSG_AIS_ABORT_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_AIS_ABORT_T)); - if (!prAisAbortMsg) { - - ASSERT(0); // Can't trigger SCAN FSM - return; - } - - prAisAbortMsg->rMsgHdr.eMsgId = MID_HEM_AIS_FSM_ABORT; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prAisAbortMsg, - MSG_SEND_METHOD_BUF); - - wifi_send_msg(INDX_WIFI, MSG_ID_WIFI_IST, 0); - - return; -} -#endif /* CFG_TEST_MGMT_FSM */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is used to handle OID_802_11_BSSID_LIST_SCAN -* -* \param[in] prAdapter Pointer of ADAPTER_T -* \param[in] prSsid Pointer of SSID_T if specified -* \param[in] pucIe Pointer to buffer of extra information elements to be attached -* \param[in] u4IeLength Length of information elements -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmScanRequest ( - IN P_ADAPTER_T prAdapter, - IN P_PARAM_SSID_T prSsid, - IN PUINT_8 pucIe, - IN UINT_32 u4IeLength - ) -{ - P_CONNECTION_SETTINGS_T prConnSettings; - P_BSS_INFO_T prAisBssInfo; - P_AIS_FSM_INFO_T prAisFsmInfo; - - DEBUGFUNC("aisFsmScanRequest()"); - - ASSERT(prAdapter); - ASSERT(u4IeLength <= MAX_IE_LENGTH); - - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - - if (!prConnSettings->fgIsScanReqIssued) { - prConnSettings->fgIsScanReqIssued = TRUE; - - if(prSsid == NULL) { - prAisFsmInfo->ucScanSSIDLen = 0; - } - else { - COPY_SSID(prAisFsmInfo->aucScanSSID, - prAisFsmInfo->ucScanSSIDLen, - prSsid->aucSsid, - (UINT_8)prSsid->u4SsidLen); - } - - if(u4IeLength > 0 && u4IeLength <= MAX_IE_LENGTH ) { - prAisFsmInfo->u4ScanIELength = u4IeLength; - if(NULL != pucIe) - kalMemCopy(prAisFsmInfo->aucScanIEBuf, pucIe, u4IeLength); - DBGLOG(AIS, WARN, ("u4IeLength in aisFsmScanRequest is: %d\n",u4IeLength)); - } - else { - prAisFsmInfo->u4ScanIELength = 0; - } - - if(prAisFsmInfo->eCurrentState == AIS_STATE_NORMAL_TR) { - if(prAisBssInfo->eCurrentOPMode == OP_MODE_INFRASTRUCTURE - && prAisFsmInfo->fgIsInfraChannelFinished == FALSE) { - // 802.1x might not finished yet, pend it for later handling .. - aisFsmInsertRequest(prAdapter, AIS_REQUEST_SCAN); - } - else { - if(prAisFsmInfo->fgIsChannelGranted == TRUE) { - DBGLOG(AIS, WARN, ("Scan Request with channel granted for join operation: %d, %d", - prAisFsmInfo->fgIsChannelGranted, - prAisFsmInfo->fgIsChannelRequested)); - } - - /* start online scan */ - wlanClearScanningResult(prAdapter); - aisFsmSteps(prAdapter, AIS_STATE_ONLINE_SCAN); - } - } - else if(prAisFsmInfo->eCurrentState == AIS_STATE_IDLE) { - wlanClearScanningResult(prAdapter); - aisFsmSteps(prAdapter, AIS_STATE_SCAN); - } - else { - aisFsmInsertRequest(prAdapter, AIS_REQUEST_SCAN); - } - } - else { - DBGLOG(AIS, WARN, ("Scan Request dropped. (state: %d)\n", prAisFsmInfo->eCurrentState)); - } - - return; -} /* end of aisFsmScanRequest() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is invoked when CNM granted channel privilege -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmRunEventChGrant ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_BSS_INFO_T prAisBssInfo; - P_AIS_FSM_INFO_T prAisFsmInfo; - P_MSG_CH_GRANT_T prMsgChGrant; - UINT_8 ucTokenID; - UINT_32 u4GrantInterval; - - ASSERT(prAdapter); - ASSERT(prMsgHdr); - - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prMsgChGrant = (P_MSG_CH_GRANT_T)prMsgHdr; - - ucTokenID = prMsgChGrant->ucTokenID; - u4GrantInterval = prMsgChGrant->u4GrantInterval; - - /* 1. free message */ - cnmMemFree(prAdapter, prMsgHdr); - - if(prAisFsmInfo->eCurrentState == AIS_STATE_REQ_CHANNEL_JOIN && - prAisFsmInfo->ucSeqNumOfChReq == ucTokenID) { - /* 2. channel privilege has been approved */ - prAisFsmInfo->u4ChGrantedInterval = u4GrantInterval; - - /* 3. state transition to join/ibss-alone/ibss-merge */ - /* 3.1 set timeout timer in cases join could not be completed */ - cnmTimerStartTimer(prAdapter, - &prAisFsmInfo->rJoinTimeoutTimer, - prAisFsmInfo->u4ChGrantedInterval - AIS_JOIN_CH_GRANT_THRESHOLD); - /* 3.2 set local variable to indicate join timer is ticking */ - prAisFsmInfo->fgIsInfraChannelFinished = FALSE; - - /* 3.3 switch to join state */ - aisFsmSteps(prAdapter, AIS_STATE_JOIN); - - prAisFsmInfo->fgIsChannelGranted = TRUE; - } - else { /* mismatched grant */ - /* 2. return channel privilege to CNM immediately */ - aisFsmReleaseCh(prAdapter); - } - - return; -} /* end of aisFsmRunEventChGrant() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is to inform CNM that channel privilege -* has been released -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmReleaseCh ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_MSG_CH_ABORT_T prMsgChAbort; - - ASSERT(prAdapter); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - - if(prAisFsmInfo->fgIsChannelGranted == TRUE - || prAisFsmInfo->fgIsChannelRequested == TRUE) { - - prAisFsmInfo->fgIsChannelRequested = FALSE; - prAisFsmInfo->fgIsChannelGranted = FALSE; - - /* 1. return channel privilege to CNM immediately */ - prMsgChAbort = (P_MSG_CH_ABORT_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_CH_ABORT_T)); - if (!prMsgChAbort) { - ASSERT(0); // Can't release Channel to CNM - return; - } - - prMsgChAbort->rMsgHdr.eMsgId = MID_MNY_CNM_CH_ABORT; - prMsgChAbort->ucNetTypeIndex = NETWORK_TYPE_AIS_INDEX; - prMsgChAbort->ucTokenID = prAisFsmInfo->ucSeqNumOfChReq; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prMsgChAbort, - MSG_SEND_METHOD_BUF); - } - - return; -} /* end of aisFsmReleaseCh() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is to inform AIS that corresponding beacon has not -* been received for a while and probing is not successful -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisBssBeaconTimeout ( - IN P_ADAPTER_T prAdapter - ) -{ - P_BSS_INFO_T prAisBssInfo; - BOOLEAN fgDoAbortIndication = FALSE; - - ASSERT(prAdapter); - - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - - //4 <1> Diagnose Connection for Beacon Timeout Event - if (PARAM_MEDIA_STATE_CONNECTED == prAisBssInfo->eConnectionState) { - if (OP_MODE_INFRASTRUCTURE == prAisBssInfo->eCurrentOPMode) { - P_STA_RECORD_T prStaRec = prAisBssInfo->prStaRecOfAP; - - if (prStaRec) { - fgDoAbortIndication = TRUE; - } - } - else if (OP_MODE_IBSS == prAisBssInfo->eCurrentOPMode) { - fgDoAbortIndication = TRUE; - } - } - - //4 <2> invoke abort handler - if (fgDoAbortIndication) { - aisFsmStateAbort(prAdapter, DISCONNECT_REASON_CODE_RADIO_LOST, TRUE); - } - - return; -} /* end of aisBssBeaconTimeout() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is to inform AIS that DEAUTH frame has been -* sent and thus state machine could go ahead -* -* \param[in] prAdapter Pointer of ADAPTER_T -* \param[in] prMsduInfo Pointer of MSDU_INFO_T for DEAUTH frame -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -aisDeauthXmitComplete ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - - ASSERT(prAdapter); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - - if(prAisFsmInfo->eCurrentState == AIS_STATE_DISCONNECTING) { - if(rTxDoneStatus != TX_RESULT_DROPPED_IN_DRIVER) { - aisFsmStateAbort(prAdapter, DISCONNECT_REASON_CODE_NEW_CONNECTION, FALSE); - } - } - else { - DBGLOG(AIS, WARN, ("DEAUTH frame transmitted without further handling")); - } - - return WLAN_STATUS_SUCCESS; - -} /* end of aisDeauthXmitComplete() */ - -#if CFG_SUPPORT_ROAMING -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will indicate an Event of "Looking for a candidate due to weak signal" to AIS FSM. -* -* @param[in] u4ReqScan Requesting Scan or not -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmRunEventRoamingDiscovery ( - IN P_ADAPTER_T prAdapter, - UINT_32 u4ReqScan - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_CONNECTION_SETTINGS_T prConnSettings; - ENUM_AIS_REQUEST_TYPE_T eAisRequest; - - DBGLOG(AIS, LOUD, ("aisFsmRunEventRoamingDiscovery()\n")); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - - /* search candidates by best rssi */ - prConnSettings->eConnectionPolicy = CONNECT_BY_SSID_BEST_RSSI; - - /* results are still new */ - if (!u4ReqScan) { - roamingFsmRunEventRoam(prAdapter); - eAisRequest = AIS_REQUEST_ROAMING_CONNECT; - } - else { - if(prAisFsmInfo->eCurrentState == AIS_STATE_ONLINE_SCAN - || prAisFsmInfo->eCurrentState == AIS_STATE_LOOKING_FOR) { - eAisRequest = AIS_REQUEST_ROAMING_CONNECT; - } - else { - eAisRequest = AIS_REQUEST_ROAMING_SEARCH; - } - } - - if(prAisFsmInfo->eCurrentState == AIS_STATE_NORMAL_TR && prAisFsmInfo->fgIsInfraChannelFinished == TRUE) { - if(eAisRequest == AIS_REQUEST_ROAMING_SEARCH) { - aisFsmSteps(prAdapter, AIS_STATE_LOOKING_FOR); - } - else { - aisFsmSteps(prAdapter, AIS_STATE_SEARCH); - } - } - else { - aisFsmIsRequestPending(prAdapter, AIS_REQUEST_ROAMING_SEARCH, TRUE); - aisFsmIsRequestPending(prAdapter, AIS_REQUEST_ROAMING_CONNECT, TRUE); - - aisFsmInsertRequest(prAdapter, eAisRequest); - } - - return; -} /* end of aisFsmRunEventRoamingDiscovery() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Update the time of ScanDone for roaming and transit to Roam state. -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -ENUM_AIS_STATE_T -aisFsmRoamingScanResultsUpdate ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_ROAMING_INFO_T prRoamingFsmInfo; - ENUM_AIS_STATE_T eNextState; - - DBGLOG(AIS, LOUD, ("->aisFsmRoamingScanResultsUpdate()\n")); - - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - prRoamingFsmInfo = (P_ROAMING_INFO_T)&(prAdapter->rWifiVar.rRoamingInfo); - - roamingFsmScanResultsUpdate(prAdapter); - - eNextState = prAisFsmInfo->eCurrentState; - if (prRoamingFsmInfo->eCurrentState == ROAMING_STATE_DISCOVERY) { - roamingFsmRunEventRoam(prAdapter); - eNextState = AIS_STATE_SEARCH; - } - else if (prAisFsmInfo->eCurrentState == AIS_STATE_LOOKING_FOR) { - eNextState = AIS_STATE_SEARCH; - } - else if (prAisFsmInfo->eCurrentState == AIS_STATE_ONLINE_SCAN) { - eNextState = AIS_STATE_NORMAL_TR; - } - - return eNextState; -} /* end of aisFsmRoamingScanResultsUpdate() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will modify and update necessary information to firmware -* for disconnection of last AP before switching to roaming bss. -* -* @param IN prAdapter Pointer to the Adapter structure. -* prTargetStaRec Target of StaRec of roaming -* -* @retval None -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmRoamingDisconnectPrevAP ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prTargetStaRec - ) -{ - P_BSS_INFO_T prAisBssInfo; - - DBGLOG(AIS, LOUD, ("aisFsmRoamingDisconnectPrevAP()")); - - ASSERT(prAdapter); - - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - - nicPmIndicateBssAbort(prAdapter, NETWORK_TYPE_AIS_INDEX); - - /* Not invoke rlmBssAborted() here to avoid prAisBssInfo->fg40mBwAllowed - * to be reset. RLM related parameters will be reset again when handling - * association response in rlmProcessAssocRsp(). 20110413 - */ - //rlmBssAborted(prAdapter, prAisBssInfo); - - //4 <3> Unset the fgIsConnected flag of BSS_DESC_T and send Deauth if needed. - if (PARAM_MEDIA_STATE_CONNECTED == prAisBssInfo->eConnectionState) { - scanRemoveConnFlagOfBssDescByBssid(prAdapter, prAisBssInfo->aucBSSID); - } - - //4 <4> Change Media State immediately. - aisChangeMediaState(prAdapter, PARAM_MEDIA_STATE_DISCONNECTED); - - //4 <4.1> sync. with firmware - prTargetStaRec->ucNetTypeIndex = 0xff; /* Virtial NetType */ - nicUpdateBss(prAdapter, NETWORK_TYPE_AIS_INDEX); - prTargetStaRec->ucNetTypeIndex = NETWORK_TYPE_AIS_INDEX; /* Virtial NetType */ - - return; -} /* end of aisFsmRoamingDisconnectPrevAP() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will update the contain of BSS_INFO_T for AIS network once -* the roaming was completed. -* -* @param IN prAdapter Pointer to the Adapter structure. -* prStaRec StaRec of roaming AP -* prAssocRspSwRfb -* -* @retval None -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisUpdateBssInfoForRoamingAP ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prAssocRspSwRfb - ) -{ - P_BSS_INFO_T prAisBssInfo; - - DBGLOG(AIS, LOUD, ("aisUpdateBssInfoForRoamingAP()")); - - ASSERT(prAdapter); - - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - - //4 <1.1> Change FW's Media State immediately. - aisChangeMediaState(prAdapter, PARAM_MEDIA_STATE_CONNECTED); - - //4 <1.2> Deactivate previous AP's STA_RECORD_T in Driver if have. - if ((prAisBssInfo->prStaRecOfAP) && - (prAisBssInfo->prStaRecOfAP != prStaRec) && - (prAisBssInfo->prStaRecOfAP->fgIsInUse)) { - cnmStaRecChangeState(prAdapter, prAisBssInfo->prStaRecOfAP, STA_STATE_1); - } - - //4 <1.3> Update BSS_INFO_T - aisUpdateBssInfoForJOIN(prAdapter, prStaRec, prAssocRspSwRfb); - - //4 <1.4> Activate current AP's STA_RECORD_T in Driver. - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_3); - - //4 <1.6> Indicate Connected Event to Host immediately. - /* Require BSSID, Association ID, Beacon Interval.. from AIS_BSS_INFO_T */ - aisIndicationOfMediaStateToHost(prAdapter, PARAM_MEDIA_STATE_CONNECTED, FALSE); - - return; -} /* end of aisFsmRoamingUpdateBss() */ - -#endif /* CFG_SUPPORT_ROAMING */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Check if there is any pending request and remove it (optional) -* -* @param prAdapter -* eReqType -* bRemove -* -* @return TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -aisFsmIsRequestPending ( - IN P_ADAPTER_T prAdapter, - IN ENUM_AIS_REQUEST_TYPE_T eReqType, - IN BOOLEAN bRemove - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_AIS_REQ_HDR_T prPendingReqHdr, prPendingReqHdrNext; - - ASSERT(prAdapter); - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - - /* traverse through pending request list */ - LINK_FOR_EACH_ENTRY_SAFE(prPendingReqHdr, - prPendingReqHdrNext, - &(prAisFsmInfo->rPendingReqList), - rLinkEntry, - AIS_REQ_HDR_T) { - /* check for specified type */ - if(prPendingReqHdr->eReqType == eReqType) { - /* check if need to remove */ - if(bRemove == TRUE) { - LINK_REMOVE_KNOWN_ENTRY(&(prAisFsmInfo->rPendingReqList), &(prPendingReqHdr->rLinkEntry)); - - cnmMemFree(prAdapter, prPendingReqHdr); - } - - return TRUE; - } - } - - return FALSE; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Get next pending request -* -* @param prAdapter -* -* @return P_AIS_REQ_HDR_T -*/ -/*----------------------------------------------------------------------------*/ -P_AIS_REQ_HDR_T -aisFsmGetNextRequest ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_FSM_INFO_T prAisFsmInfo; - P_AIS_REQ_HDR_T prPendingReqHdr; - - ASSERT(prAdapter); - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - - LINK_REMOVE_HEAD(&(prAisFsmInfo->rPendingReqList), prPendingReqHdr, P_AIS_REQ_HDR_T); - - return prPendingReqHdr; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Insert a new request -* -* @param prAdapter -* eReqType -* -* @return TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -aisFsmInsertRequest ( - IN P_ADAPTER_T prAdapter, - IN ENUM_AIS_REQUEST_TYPE_T eReqType - ) -{ - P_AIS_REQ_HDR_T prAisReq; - P_AIS_FSM_INFO_T prAisFsmInfo; - - ASSERT(prAdapter); - prAisFsmInfo = &(prAdapter->rWifiVar.rAisFsmInfo); - - prAisReq = (P_AIS_REQ_HDR_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(AIS_REQ_HDR_T)); - - if(!prAisReq) { - ASSERT(0); // Can't generate new message - return FALSE; - } - - prAisReq->eReqType = eReqType; - - /* attach request into pending request list */ - LINK_INSERT_TAIL(&prAisFsmInfo->rPendingReqList, &prAisReq->rLinkEntry); - - return TRUE; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Flush all pending requests -* -* @param prAdapter -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -aisFsmFlushRequest ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_REQ_HDR_T prAisReq; - - ASSERT(prAdapter); - - while((prAisReq = aisFsmGetNextRequest(prAdapter)) != NULL) { - cnmMemFree(prAdapter, prAisReq); - } - - return; -} - - diff --git a/drivers/net/wireless/mt5931/mgmt/assoc.c b/drivers/net/wireless/mt5931/mgmt/assoc.c deleted file mode 100755 index c4d26fb100c2..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/assoc.c +++ /dev/null @@ -1,2044 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/assoc.c#3 $ -*/ - -/*! \file "assoc.c" - \brief This file includes the association-related functions. - - This file includes the association-related functions. -*/ - - - -/*\ -** $Log: assoc.c $ -** -** 07 27 2012 yuche.tsai -** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot -** Fix wifi direct connection issue. - * - * 07 17 2012 yuche.tsai - * NULL - * Let netdev bring up. - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 06 13 2012 yuche.tsai - * NULL - * Update maintrunk driver. - * Add support for driver compose assoc request frame. - * - * 06 08 2012 cp.wu - * [WCXRP00001245] [MT6620 Wi-Fi][Driver][Firmware] NPS Software Development - * add a pair of brace for compilation success. - * - * 06 04 2012 cp.wu - * [WCXRP00001245] [MT6620 Wi-Fi][Driver][Firmware] NPS Software Development - * discussed with WH, privacy bit in associate response is not necessary to be checked, and identified as association failure when mismatching with beacon/probe response - * - * 03 14 2012 wh.su - * [WCXRP00001173] [MT6620 Wi-Fi][Driver] Adding the ICS Tethering WPA2-PSK supporting - * Add code from 2.2 - * - * 03 09 2012 terry.wu - * NULL - * Fix build error. - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 01 16 2012 yuche.tsai - * NULL - * Update Driver for wifi driect gc join IE update issue. - * - * 11 10 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * change the debug module level. - * - * 10 25 2011 cm.chang - * [WCXRP00001058] [All Wi-Fi][Driver] Fix sta_rec's phyTypeSet and OBSS scan in AP mode - * Fix PhyTypeSet in STA_REC in AP mode - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 09 19 2011 yuche.tsai - * NULL - * Fix KE when enable hot-spot & any one client connect to this hot-spot. - * - * 09 14 2011 yuche.tsai - * NULL - * Add P2P IE in assoc response. - * - * 07 15 2011 terry.wu - * [WCXRP00000855] [MT6620 Wi-Fi] [Driver] Workaround for Kingnet 710 AP wrong AID assignment - * Update workaround for Kingnet AP. - * - * 07 15 2011 terry.wu - * [WCXRP00000855] [MT6620 Wi-Fi] [Driver] Workaround for Kingnet 710 AP wrong AID assignment - * Workaround for Kingnet 710 AP wrong AID assignment. - * - * 05 02 2011 eddie.chen - * [WCXRP00000603] [MT6620 Wi-Fi][DRV] Fix Klocwork warning[WCXRP00000672] [MT6620 Wi-Fi][FW] Fix the PS event allocation - * Check STA when rx assoc. - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 03 19 2011 yuche.tsai - * [WCXRP00000581] [Volunteer Patch][MT6620][Driver] P2P IE in Assoc Req Issue - * Make assoc req to append P2P IE if wifi direct is enabled. - * - * 03 17 2011 chinglan.wang - * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature - * . - * - * 03 16 2011 wh.su - * [WCXRP00000530] [MT6620 Wi-Fi] [Driver] skip doing p2pRunEventAAAComplete after send assoc response Tx Done - * enable the protected while at P2P start GO, and skip some security check . - * - * 03 14 2011 wh.su - * [WCXRP00000545] [MT6620 Wi-Fi] [Driver] Fixed the p2p not enable, received a assoc rsp cause the rx assoc execute a null function - * Modify file for avoid assert at BOW recieve a assoc response frame but no p2p fucntion. - * - * 03 08 2011 terry.wu - * [WCXRP00000524] [MT6620 Wi-Fi][Driver] Fix p2p assoc request containing wrong IE format - * Fix p2p assoc request containing wrong IE format. - * - * 03 02 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * add code to let the beacon and probe response for Auto GO WSC . - * - * 02 15 2011 yuche.tsai - * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode. - * Fix RX disassoc issue under Hot-spot mode. - * - * 02 09 2011 wh.su - * [WCXRP00000432] [MT6620 Wi-Fi][Driver] Add STA privacy check at hotspot mode - * adding the code for check STA privacy bit at AP mode, . - * - * 02 08 2011 eddie.chen - * [WCXRP00000426] [MT6620 Wi-Fi][FW/Driver] Add STA aging timeout and defualtHwRatein AP mode - * Add event STA agint timeout - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Change Station Type in Station Record, Modify MACRO definition for getting station type & network type index & Role. - * - * 01 12 2011 yuche.tsai - * [WCXRP00000353] [Volunteer Patch][MT6620][Driver] Desired Non-HT Rate Set update when STA record is created under AP Mode. - * Update Phy Type Set. When legacy client is connected, it can use 11b rate, - * but if the P2P device is connected, 11b rate is not allowed. - * - * 01 11 2011 yuche.tsai - * [WCXRP00000353] [Volunteer Patch][MT6620][Driver] Desired Non-HT Rate Set update when STA record is created under AP Mode. - * Update Desired Non-HT Rate Set. - * - * 12 30 2010 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, - -Add per station flow control when STA is in PS - - - * Recover the code that was coverwritted.. - * - * 12 29 2010 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, -Add per station flow control when STA is in PS - - * 1) PS flow control event - * - * 2) WMM IE in beacon, assoc resp, probe resp - * - * 11 04 2010 wh.su - * [WCXRP00000164] [MT6620 Wi-Fi][Driver] Support the p2p random SSID - * adding the p2p random ssid support. - * - * 10 18 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * use definition macro to replace hard-coded constant - * - * 09 28 2010 wh.su - * NULL - * [WCXRP00000069][MT6620 Wi-Fi][Driver] Fix some code for phase 1 P2P Demo. - * - * 09 27 2010 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000065] Update BoW design and settings - * Update BCM/BoW design and settings. - * - * 09 16 2010 cm.chang - * NULL - * Change conditional compiling options for BOW - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 09 01 2010 wh.su - * NULL - * adding the wapi support for integration test. - * - * 08 30 2010 cp.wu - * NULL - * eliminate klockwork errors - * - * 08 16 2010 yuche.tsai - * NULL - * Add SSID IE in assoc req frame which is sent by P2P GC. - * - * 08 16 2010 kevin.huang - * NULL - * Refine AAA functions - * - * 08 03 2010 cp.wu - * NULL - * surpress compilation warning. - * - * 07 20 2010 wh.su - * - * adding the wapi code. - * - * 07 09 2010 yarco.yang - * - * [MT6620 and MT5931] SW Migration: Add ADDBA support - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * take use of RLM module for parsing/generating HT IEs for 11n capability - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * comment out RSN IE generation by CFG_RSN_MIGRATION compilation flag. - * - * 06 28 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * send MMPDU in basic rate. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add scan_fsm into building. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * specify correct value for management frames. - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 18 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * migration from MT6620 firmware. - * - * 06 15 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * revised. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add management dispatching function table. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * auth.c is migrated. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 05 24 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Update assocProcessRxAssocReqFrame() to avoid redundant SSID IE {0,0} for IOT. - * - * 05 14 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Fix compile warning - macro > 10 line, initial value of an array - * - * 04 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW - * - * 04 22 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * First draft code to support protection in AP mode - * - * 04 19 2010 kevin.huang - * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support - * Add Beacon Timeout Support - * * * * * * * * and will send Null frame to diagnose connection - * - * 04 16 2010 wh.su - * [BORA00000680][MT6620] Support the statistic for Microsoft os query - * adding the wpa-none for ibss beacon. - * - * 03 25 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Remove compiling warning - * - * 03 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Not carry HT cap when being associated with b/g only AP - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup - * - * 01 28 2010 wh.su - * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code - * fixed the compiling warning.u1rwduu`wvpghlqg|rm+vp - * - * 01 27 2010 wh.su - * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code - * add and fixed some security function. - * - * 01 11 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add Deauth and Disassoc Handler - * - * 01 07 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Update Assoc ID for PS - * - * 01 04 2010 tehuang.liu - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * For working out the first connection Chariot-verified version - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * Dec 12 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Use new constant definition ELEM_MAX_LEN_EXT_CAP - * - * Dec 9 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Modify assoc req IE talbe for HT cap IE - * - * Dec 7 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * update the assocComposeReAssocReqFrameHeader() and fix the u2EstimatedFrameLen in assocSendReAssocReqFrame() - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * remove some space line - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the sending disassoc frame function - * - * Dec 4 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the txassocReq IE table, adding for WPA/RSN - * - * Dec 3 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix eNetType not init in send AssocReq function - * - * Dec 3 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Integrate the send Assoc with TXM - * - * Dec 1 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the code to indicate the assoc request and assoc response (now disable) - * - * Nov 24 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Remove unused variables - * - * Nov 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ -APPEND_VAR_IE_ENTRY_T txAssocReqIETable[] = { - { (ELEM_HDR_LEN + ELEM_MAX_LEN_HT_CAP), NULL, rlmReqGenerateHtCapIE },/* 45 */ -#if CFG_SUPPORT_WPS2 - { (ELEM_HDR_LEN + ELEM_MAX_LEN_WSC), NULL, rsnGenerateWSCIE }, /* 221 */ -#endif -#if CFG_SUPPORT_WAPI - { (ELEM_HDR_LEN + ELEM_MAX_LEN_WAPI), NULL, wapiGenerateWAPIIE }, /* 68 */ -#endif -#if CFG_RSN_MIGRATION - { (ELEM_HDR_LEN + ELEM_MAX_LEN_WPA), NULL, rsnGenerateWPAIE }, /* 221 */ -#endif - { (ELEM_HDR_LEN + ELEM_MAX_LEN_EXT_CAP), NULL, rlmReqGenerateExtCapIE }, /* 127 */ - { (ELEM_HDR_LEN + ELEM_MAX_LEN_WMM_INFO), NULL, mqmGenerateWmmInfoIE }, /* 221 */ -#if CFG_RSN_MIGRATION - { (ELEM_HDR_LEN + ELEM_MAX_LEN_RSN), NULL, rsnGenerateRSNIE }, /* 48 */ -#endif -}; - -#if CFG_SUPPORT_AAA -VERIFY_IE_ENTRY_T rxAssocReqIETable[] = { - { ELEM_ID_RESERVED, NULL } /* 255 */ -}; - - -APPEND_VAR_IE_ENTRY_T txAssocRespIETable[] = { - { (ELEM_HDR_LEN + ELEM_MAX_LEN_ERP), NULL, rlmRspGenerateErpIE }, /* 42 */ - { (ELEM_HDR_LEN + ELEM_MAX_LEN_HT_CAP), NULL, rlmRspGenerateHtCapIE }, /* 45 */ - { (ELEM_HDR_LEN + ELEM_MAX_LEN_HT_OP), NULL, rlmRspGenerateHtOpIE }, /* 61 */ -#if CFG_ENABLE_WIFI_DIRECT - { (ELEM_HDR_LEN + ELEM_MAX_LEN_OBSS_SCAN), NULL, rlmRspGenerateObssScanIE }, /* 74 */ - { (0), p2pFuncCalculateP2p_IELenForAssocRsp, p2pFuncGenerateP2p_IEForAssocRsp }, /* 221 */ -#endif - { (ELEM_HDR_LEN + ELEM_MAX_LEN_EXT_CAP), NULL, rlmRspGenerateExtCapIE }, /* 127 */ - { (ELEM_HDR_LEN + ELEM_MAX_LEN_WMM_PARAM), NULL, mqmGenerateWmmParamIE } /* 221 */ -}; -#endif - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to compose the Capability Info Field. -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @retval Capability Info Field -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ UINT_16 -assocBuildCapabilityInfo ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ) -{ - UINT_32 u4NonHTPhyType; - UINT_16 u2CapInfo; - - - ASSERT(prStaRec); - - - /* Set up our requested capabilities. */ - u2CapInfo = CAP_INFO_ESS; - u2CapInfo |= CAP_CF_STA_NOT_POLLABLE; - - if (prStaRec->u2CapInfo & CAP_INFO_PRIVACY) { - u2CapInfo |= CAP_INFO_PRIVACY; - } - - - /* 7.3.1.4 */ - if (prStaRec->fgHasBasicPhyType) { - u4NonHTPhyType = prStaRec->ucNonHTBasicPhyType; - - if ( (rNonHTPhyAttributes[u4NonHTPhyType].fgIsShortPreambleOptionImplemented) && - ( (prAdapter->rWifiVar.ePreambleType == PREAMBLE_TYPE_SHORT) || /* Short Preamble Option Enable is TRUE */ - ((prAdapter->rWifiVar.ePreambleType == PREAMBLE_TYPE_AUTO) && - (prStaRec->u2CapInfo & CAP_INFO_SHORT_PREAMBLE)) ) ) { - - /* Case I: Implemented == TRUE and Short Preamble Option Enable == TRUE. - * Case II: Implemented == TRUE and Short Preamble == AUTO (depends on - * BSS_DESC_T's capability) - */ - u2CapInfo |= CAP_INFO_SHORT_PREAMBLE; - } - - if (rNonHTPhyAttributes[u4NonHTPhyType].fgIsShortSlotTimeOptionImplemented && - prAdapter->rWifiVar.fgIsShortSlotTimeOptionEnable) { - u2CapInfo |= CAP_INFO_SHORT_SLOT_TIME; - } - } - - DBGLOG(SAA, LOUD, ("ASSOC REQ: Compose Capability = 0x%04x for Target BSS ["MACSTR"].\n", - u2CapInfo, MAC2STR(prStaRec->aucMacAddr))); - - - return u2CapInfo; - -} /* end of assocBuildCapabilityInfo() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to compose Common Information Elements for Association -* Request Frame. -* -* @param[in] prMsduInfo Pointer to the composed MSDU_INFO_T. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -assocBuildReAssocReqFrameCommonIEs ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - P_CONNECTION_SETTINGS_T prConnSettings; - P_STA_RECORD_T prStaRec; - PUINT_8 pucBuffer; - UINT_16 u2SupportedRateSet; - UINT_8 aucAllSupportedRates[RATE_NUM] = {0}; - UINT_8 ucAllSupportedRatesLen; - UINT_8 ucSupRatesLen; - UINT_8 ucExtSupRatesLen; - - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - ASSERT(prMsduInfo); - ASSERT(prMsduInfo->eSrc == TX_PACKET_MGMT); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - ASSERT(prStaRec); - - if(!prStaRec) { - return; - } - - pucBuffer = (PUINT_8)((UINT_32)prMsduInfo->prPacket + - (UINT_32)prMsduInfo->u2FrameLength); - ASSERT(pucBuffer); - - if (IS_STA_IN_AIS(prStaRec)) { - - /* Fill the SSID element. */ - SSID_IE(pucBuffer)->ucId = ELEM_ID_SSID; - - /* NOTE(Kevin): We copy the SSID from CONNECTION_SETTINGS for the case of - * Passive Scan and the target BSS didn't broadcast SSID on its Beacon Frame. - */ - - COPY_SSID(SSID_IE(pucBuffer)->aucSSID, - SSID_IE(pucBuffer)->ucLength, - prConnSettings->aucSSID, - prConnSettings->ucSSIDLen); - - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - pucBuffer += IE_SIZE(pucBuffer); - - } -#if CFG_ENABLE_WIFI_DIRECT - else if((prAdapter->fgIsP2PRegistered) && - (IS_STA_IN_P2P(prStaRec))) { - pucBuffer = p2pBuildReAssocReqFrameCommonIEs(prAdapter, prMsduInfo, pucBuffer); - } -#endif -#if CFG_ENABLE_BT_OVER_WIFI - else if (IS_STA_IN_BOW(prStaRec)) { - - SSID_IE(pucBuffer)->ucId = ELEM_ID_SSID; - - /* NOTE(Kevin): We copy the SSID from CONNECTION_SETTINGS for the case of - * Passive Scan and the target BSS didn't broadcast SSID on its Beacon Frame. - */ - - COPY_SSID(SSID_IE(pucBuffer)->aucSSID, - SSID_IE(pucBuffer)->ucLength, - prConnSettings->aucSSID, - prConnSettings->ucSSIDLen); - - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - pucBuffer += IE_SIZE(pucBuffer); - } -#endif - - else { - /* TODO(Kevin): For other network */ - } - - /* NOTE(Kevin 2008/12/19): 16.3.6.3 MLME-ASSOCIATE.indication - - * SupportedRates - The set of data rates that are supported by the STA - * that is requesting association. - * Original(Portable Driver): Only send the Rates that we'll support. - * New: Send the Phy Rates if the result of following & operation == NULL. - */ - //rateGetDataRatesFromRateSet((prBssDesc->u2OperationalRateSet & - // rPhyAttributes[prBssDesc->ePhyType].u2SupportedRateSet), - - if (prStaRec->fgHasBasicPhyType) { - UINT_32 u4NonHTPhyType; - - - u4NonHTPhyType = prStaRec->ucNonHTBasicPhyType; - - u2SupportedRateSet = (prStaRec->u2OperationalRateSet & - rNonHTPhyAttributes[u4NonHTPhyType].u2SupportedRateSet); - - ASSERT(u2SupportedRateSet); - - if (!u2SupportedRateSet) { - u2SupportedRateSet = rNonHTPhyAttributes[u4NonHTPhyType].u2SupportedRateSet; - } - - /* TODO(Kevin): For P2P, we shouldn't send support rate set which contains 11b rate */ - - rateGetDataRatesFromRateSet(u2SupportedRateSet, - 0, - aucAllSupportedRates, - &ucAllSupportedRatesLen); - - ucSupRatesLen = ((ucAllSupportedRatesLen > ELEM_MAX_LEN_SUP_RATES) ? - ELEM_MAX_LEN_SUP_RATES : ucAllSupportedRatesLen); - - ucExtSupRatesLen = ucAllSupportedRatesLen - ucSupRatesLen; - - - /* Fill the Supported Rates element. */ - if (ucSupRatesLen) { - SUP_RATES_IE(pucBuffer)->ucId = ELEM_ID_SUP_RATES; - SUP_RATES_IE(pucBuffer)->ucLength = ucSupRatesLen; - kalMemCopy(SUP_RATES_IE(pucBuffer)->aucSupportedRates, - aucAllSupportedRates, - ucSupRatesLen); - - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - pucBuffer += IE_SIZE(pucBuffer); - } - - - /* Fill the Extended Supported Rates element. */ - if (ucExtSupRatesLen) { - - EXT_SUP_RATES_IE(pucBuffer)->ucId = ELEM_ID_EXTENDED_SUP_RATES; - EXT_SUP_RATES_IE(pucBuffer)->ucLength = ucExtSupRatesLen; - - kalMemCopy(EXT_SUP_RATES_IE(pucBuffer)->aucExtSupportedRates, - &aucAllSupportedRates[ucSupRatesLen], - ucExtSupRatesLen); - - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - pucBuffer += IE_SIZE(pucBuffer); - } - } - - return; -} /* end of assocBuildReAssocReqFrameCommonIEs() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will compose the (Re)Association Request frame header and -* its fixed fields -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* @param[in] pucBuffer Pointer to the frame buffer. -* @param[in] aucMACAddress Given Our MAC Address. -* @param[in out] pu2PayloadLen Return the length of the composed fixed fields -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -assocComposeReAssocReqFrameHeaderAndFF ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN PUINT_8 pucBuffer, - IN UINT_8 aucMACAddress[], - IN OUT PUINT_16 pu2PayloadLen - ) -{ - P_WLAN_ASSOC_REQ_FRAME_T prAssocFrame; - BOOLEAN fgIsReAssoc; - - UINT_16 u2FrameCtrl; - UINT_16 u2CapInfo; - UINT_16 u2ListenInterval; - - - ASSERT(prStaRec); - ASSERT(pucBuffer); - ASSERT(aucMACAddress); - ASSERT(pu2PayloadLen); - - prAssocFrame = (P_WLAN_ASSOC_REQ_FRAME_T)pucBuffer; - fgIsReAssoc = prStaRec->fgIsReAssoc; - - //4 <1> Compose the frame header of the (Re)Association Request frame. - /* Fill the Frame Control field. */ - if (fgIsReAssoc) { - u2FrameCtrl = MAC_FRAME_REASSOC_REQ; - } - else { - u2FrameCtrl = MAC_FRAME_ASSOC_REQ; - } - WLAN_SET_FIELD_16(&prAssocFrame->u2FrameCtrl, u2FrameCtrl); - - /* Fill the DA field with Target BSSID. */ - COPY_MAC_ADDR(prAssocFrame->aucDestAddr, prStaRec->aucMacAddr); - - /* Fill the SA field with our MAC Address. */ - COPY_MAC_ADDR(prAssocFrame->aucSrcAddr, aucMACAddress); - - /* Fill the BSSID field with Target BSSID. */ - COPY_MAC_ADDR(prAssocFrame->aucBSSID, prStaRec->aucMacAddr); - - /* Clear the SEQ/FRAG_NO field(HW won't overide the FRAG_NO, so we need to clear it). */ - prAssocFrame->u2SeqCtrl = 0; - - - //4 <2> Compose the frame body's common fixed field part of the (Re)Association Request frame. - u2CapInfo = assocBuildCapabilityInfo(prAdapter, prStaRec); - - /* Fill the Capability Information field. */ - WLAN_SET_FIELD_16(&prAssocFrame->u2CapInfo, u2CapInfo); - - - /* Calculate the listen interval for the maximum power mode. Currently, we - set it to the value 2 times DTIM period. */ - if (prStaRec->ucDTIMPeriod) { - u2ListenInterval = prStaRec->ucDTIMPeriod * DEFAULT_LISTEN_INTERVAL_BY_DTIM_PERIOD; - } - else { - DBGLOG(SAA, TRACE, ("Use default listen interval\n")); - u2ListenInterval = DEFAULT_LISTEN_INTERVAL; - } - prStaRec->u2ListenInterval = u2ListenInterval; - - /* Fill the Listen Interval field. */ - WLAN_SET_FIELD_16(&prAssocFrame->u2ListenInterval, u2ListenInterval); - - - //4 <3> Compose the Current AP Address field for ReAssociation Request frame. - /* Fill the Current AP Address field. */ - if (prStaRec->fgIsReAssoc) { - if (IS_STA_IN_AIS(prStaRec)) { - - P_AIS_BSS_INFO_T prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - P_WLAN_REASSOC_REQ_FRAME_T prReAssocFrame = - (P_WLAN_REASSOC_REQ_FRAME_T)prAssocFrame; - - COPY_MAC_ADDR(prReAssocFrame->aucCurrentAPAddr, prAisBssInfo->aucBSSID); - } - else { - ASSERT(0); /* We don't support ReAssociation for other network */ - } - - *pu2PayloadLen = (CAP_INFO_FIELD_LEN + - LISTEN_INTERVAL_FIELD_LEN + - CURR_AP_ADDR_FIELD_LEN); - } - else { - *pu2PayloadLen = (CAP_INFO_FIELD_LEN + - LISTEN_INTERVAL_FIELD_LEN); - } - - return; -} /* end of assocComposeReAssocReqFrame() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will send the (Re)Association Request frame -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @retval WLAN_STATUS_RESOURCES No available resource for frame composing. -* @retval WLAN_STATUS_SUCCESS Successfully send frame to TX Module -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -assocSendReAssocReqFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ) -{ - P_MSDU_INFO_T prMsduInfo; - P_BSS_INFO_T prBssInfo; - - UINT_16 u2PayloadLen; - UINT_16 u2EstimatedFrameLen; - UINT_16 u2EstimatedExtraIELen; - BOOLEAN fgIsReAssoc; - UINT_32 i; - - - ASSERT(prStaRec); - - //4 <1> Allocate a PKT_INFO_T for Authentication Frame - fgIsReAssoc = prStaRec->fgIsReAssoc; - - /* Init with MGMT Header Length + Length of Fixed Fields + Common IE Length */ - if (fgIsReAssoc) { - u2EstimatedFrameLen = MAC_TX_RESERVED_FIELD + \ - WLAN_MAC_MGMT_HEADER_LEN + \ - CAP_INFO_FIELD_LEN + \ - LISTEN_INTERVAL_FIELD_LEN + \ - CURR_AP_ADDR_FIELD_LEN + \ - (ELEM_HDR_LEN + ELEM_MAX_LEN_SSID) + \ - (ELEM_HDR_LEN + ELEM_MAX_LEN_SUP_RATES) + \ - (ELEM_HDR_LEN + (RATE_NUM - ELEM_MAX_LEN_SUP_RATES)); - } - else { - u2EstimatedFrameLen = MAC_TX_RESERVED_FIELD + \ - WLAN_MAC_MGMT_HEADER_LEN + \ - CAP_INFO_FIELD_LEN + \ - LISTEN_INTERVAL_FIELD_LEN + \ - (ELEM_HDR_LEN + ELEM_MAX_LEN_SSID) + \ - (ELEM_HDR_LEN + ELEM_MAX_LEN_SUP_RATES) + \ - (ELEM_HDR_LEN + (RATE_NUM - ELEM_MAX_LEN_SUP_RATES)); - } - - /* + Extra IE Length */ - u2EstimatedExtraIELen = 0; - -#if CFG_ENABLE_WIFI_DIRECT_CFG_80211 && CFG_ENABLE_WIFI_DIRECT - if (prStaRec->ucNetTypeIndex == NETWORK_TYPE_P2P_INDEX) { - if ((prAdapter->fgIsP2PRegistered)) { - u2EstimatedExtraIELen = p2pCalculate_IEForAssocReq(prAdapter, - prStaRec->ucNetTypeIndex, - prStaRec); - } - else { - DBGLOG(P2P, TRACE, ("Function Linker Lost.\n")); - ASSERT(FALSE); - } - } - else { - for (i = 0; i < sizeof(txAssocReqIETable)/sizeof(APPEND_VAR_IE_ENTRY_T); i++) { - if (txAssocReqIETable[i].u2EstimatedFixedIELen != 0) { - u2EstimatedExtraIELen += txAssocReqIETable[i].u2EstimatedFixedIELen; - } - else { - u2EstimatedExtraIELen += (UINT_16)txAssocReqIETable[i].pfnCalculateVariableIELen(prAdapter, - prStaRec->ucNetTypeIndex, - prStaRec); - } - } - } -#else - for (i = 0; i < sizeof(txAssocReqIETable)/sizeof(APPEND_VAR_IE_ENTRY_T); i++) { - if (txAssocReqIETable[i].u2EstimatedFixedIELen != 0) { - u2EstimatedExtraIELen += txAssocReqIETable[i].u2EstimatedFixedIELen; - } - else { - u2EstimatedExtraIELen += (UINT_16)txAssocReqIETable[i].pfnCalculateVariableIELen(prAdapter, - prStaRec->ucNetTypeIndex, - prStaRec); - } - } -#endif - - u2EstimatedFrameLen += u2EstimatedExtraIELen; - - /* Allocate a MSDU_INFO_T */ - if ( (prMsduInfo = cnmMgtPktAlloc(prAdapter, u2EstimatedFrameLen)) == NULL) { - DBGLOG(SAA, WARN, ("No PKT_INFO_T for sending (Re)Assoc Request.\n")); - return WLAN_STATUS_RESOURCES; - } - - //4 <2> Compose (Re)Association Request frame header and fixed fields in MSDU_INfO_T. - ASSERT(prStaRec->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]); - - - /* Compose Header and Fixed Field */ - assocComposeReAssocReqFrameHeaderAndFF(prAdapter, - prStaRec, - (PUINT_8)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD), - prBssInfo->aucOwnMacAddr, - &u2PayloadLen); - - //4 <3> Update information of MSDU_INFO_T - prMsduInfo->eSrc = TX_PACKET_MGMT; - prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_MGMT; - prMsduInfo->ucStaRecIndex = prStaRec->ucIndex; - prMsduInfo->ucNetworkType = prStaRec->ucNetTypeIndex; - prMsduInfo->ucMacHeaderLength = WLAN_MAC_MGMT_HEADER_LEN; - prMsduInfo->fgIs802_1x = FALSE; - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = WLAN_MAC_MGMT_HEADER_LEN + u2PayloadLen; - prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMsduInfo->pfTxDoneHandler = saaFsmRunEventTxDone; - prMsduInfo->fgIsBasicRate = TRUE; - - //4 <4> Compose the frame body's IEs of the (Re)Association Request frame. - assocBuildReAssocReqFrameCommonIEs(prAdapter, prMsduInfo); - - - //4 <5> Compose IEs in MSDU_INFO_T -#if CFG_ENABLE_WIFI_DIRECT_CFG_80211 && CFG_ENABLE_WIFI_DIRECT - if (prStaRec->ucNetTypeIndex == NETWORK_TYPE_P2P_INDEX) { - if ((prAdapter->fgIsP2PRegistered)) { - p2pGenerate_IEForAssocReq(prAdapter, prMsduInfo); - } - else { - DBGLOG(P2P, TRACE, ("Function Linker Lost.\n")); - ASSERT(FALSE); - } - } - else { - /* Append IE */ - for (i = 0; i < sizeof(txAssocReqIETable)/sizeof(APPEND_VAR_IE_ENTRY_T); i++) { - if (txAssocReqIETable[i].pfnAppendIE) { - txAssocReqIETable[i].pfnAppendIE(prAdapter, prMsduInfo); - } - } - } -#else - /* Append IE */ - for (i = 0; i < sizeof(txAssocReqIETable)/sizeof(APPEND_VAR_IE_ENTRY_T); i++) { - if (txAssocReqIETable[i].pfnAppendIE) { - txAssocReqIETable[i].pfnAppendIE(prAdapter, prMsduInfo); - } - } -#endif - - //4 <6> Update the (Re)association request information - if (IS_STA_IN_AIS(prStaRec)) { - P_WLAN_ASSOC_REQ_FRAME_T prAssocFrame; - - prAssocFrame = (P_WLAN_ASSOC_REQ_FRAME_T)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD); - -#if CFG_RSN_MIGRATION - kalUpdateReAssocReqInfo(prAdapter->prGlueInfo, - (PUINT_8)&prAssocFrame->u2CapInfo, - prMsduInfo->u2FrameLength - offsetof(WLAN_ASSOC_REQ_FRAME_T, u2CapInfo), - fgIsReAssoc); -#endif - } - -#if CFG_ENABLE_WIFI_DIRECT - if ((prAdapter->fgIsP2PRegistered) && (IS_STA_IN_P2P(prStaRec))) { - P_WLAN_ASSOC_REQ_FRAME_T prAssocFrame; - - prAssocFrame = (P_WLAN_ASSOC_REQ_FRAME_T)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD); - - - kalP2PUpdateAssocInfo( - prAdapter->prGlueInfo, - (PUINT_8)&prAssocFrame->u2CapInfo, - prMsduInfo->u2FrameLength - offsetof(WLAN_ASSOC_REQ_FRAME_T, u2CapInfo), - fgIsReAssoc); - } -#endif - - /* TODO(Kevin): Also release the unused tail room of the composed MMPDU */ - - //4 <6> Enqueue the frame to send this (Re)Association request frame. - nicTxEnqueueMsdu(prAdapter, prMsduInfo); - - return WLAN_STATUS_SUCCESS; -} /* end of assocSendReAssocReqFrame() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will strictly check the TX (Re)Association Request frame for -* SAA event handling. -* -* @param[in] prMsduInfo Pointer of MSDU_INFO_T -* -* @retval WLAN_STATUS_FAILURE This is not the frame we should handle at current state. -* @retval WLAN_STATUS_SUCCESS This is the frame we should handle. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -assocCheckTxReAssocReqFrame ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - P_WLAN_ASSOC_REQ_FRAME_T prAssocReqFrame; - P_STA_RECORD_T prStaRec; - UINT_16 u2TxFrameCtrl; - - - ASSERT(prMsduInfo); - ASSERT(prMsduInfo->eSrc == TX_PACKET_MGMT); - - prAssocReqFrame = (P_WLAN_ASSOC_REQ_FRAME_T)(prMsduInfo->prPacket); - ASSERT(prAssocReqFrame); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - ASSERT(prStaRec); - - if(!prStaRec) { - return WLAN_STATUS_INVALID_PACKET; - } - - //WLAN_GET_FIELD_16(&prAssocReqFrame->u2FrameCtrl, &u2TxFrameCtrl) - u2TxFrameCtrl = prAssocReqFrame->u2FrameCtrl; // NOTE(Kevin): Optimized for ARM - u2TxFrameCtrl &= MASK_FRAME_TYPE; - if (prStaRec->fgIsReAssoc) { - if (u2TxFrameCtrl != MAC_FRAME_REASSOC_REQ) { - return WLAN_STATUS_FAILURE; - } - } - else { - if (u2TxFrameCtrl != MAC_FRAME_ASSOC_REQ) { - return WLAN_STATUS_FAILURE; - } - } - - return WLAN_STATUS_SUCCESS; - -} /* end of assocCheckTxReAssocReqFrame() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will strictly check the TX (Re)Association Response frame for -* AAA event handling. -* -* @param[in] prMsduInfo Pointer of MSDU_INFO_T -* -* @retval WLAN_STATUS_FAILURE This is not the frame we should handle at current state. -* @retval WLAN_STATUS_SUCCESS This is the frame we should handle. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -assocCheckTxReAssocRespFrame ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - P_WLAN_ASSOC_RSP_FRAME_T prAssocRspFrame; - P_STA_RECORD_T prStaRec; - UINT_16 u2TxFrameCtrl; - - - ASSERT(prMsduInfo); - ASSERT(prMsduInfo->eSrc == TX_PACKET_MGMT); - - prAssocRspFrame = (P_WLAN_ASSOC_RSP_FRAME_T)(prMsduInfo->prPacket); - ASSERT(prAssocRspFrame); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - ASSERT(prStaRec); - - if(!prStaRec) { - return WLAN_STATUS_INVALID_PACKET; - } - - //WLAN_GET_FIELD_16(&prAssocFrame->u2FrameCtrl, &u2TxFrameCtrl) - u2TxFrameCtrl = prAssocRspFrame->u2FrameCtrl; // NOTE(Kevin): Optimized for ARM - u2TxFrameCtrl &= MASK_FRAME_TYPE; - if (prStaRec->fgIsReAssoc) { - if (u2TxFrameCtrl != MAC_FRAME_REASSOC_RSP) { - return WLAN_STATUS_FAILURE; - } - } - else { - if (u2TxFrameCtrl != MAC_FRAME_ASSOC_RSP) { - return WLAN_STATUS_FAILURE; - } - } - - return WLAN_STATUS_SUCCESS; - -} /* end of assocCheckTxReAssocRespFrame() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will validate the incoming (Re)Association Frame and take out -* the status code. -* -* @param[in] prSwRfb Pointer to SW RFB data structure. -* @param[out] pu2StatusCode Pointer to store the Status Code from Authentication. -* -* @retval WLAN_STATUS_FAILURE This is not the frame we should handle at current state. -* @retval WLAN_STATUS_SUCCESS This is the frame we should handle. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -assocCheckRxReAssocRspFrameStatus ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_16 pu2StatusCode - ) -{ - P_STA_RECORD_T prStaRec; - P_WLAN_ASSOC_RSP_FRAME_T prAssocRspFrame; - UINT_16 u2RxFrameCtrl; - UINT_16 u2RxCapInfo; - UINT_16 u2RxStatusCode; - UINT_16 u2RxAssocId; - - - ASSERT(prSwRfb); - ASSERT(pu2StatusCode); - - if ((prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen) < (CAP_INFO_FIELD_LEN + - STATUS_CODE_FIELD_LEN + - AID_FIELD_LEN)) { - ASSERT(0); - return WLAN_STATUS_FAILURE; - } - - DBGLOG(SAA, LOUD, ("prSwRfb->u2PayloadLength = %d\n", prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen)); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - ASSERT(prStaRec); - - if(!prStaRec) { - return WLAN_STATUS_INVALID_PACKET; - } - - //4 <1> locate the (Re)Assocation Resp Frame. - prAssocRspFrame = (P_WLAN_ASSOC_RSP_FRAME_T) prSwRfb->pvHeader; - - //4 <2> Parse the Header of (Re)Assocation Resp Frame. - //WLAN_GET_FIELD_16(&prAssocRspFrame->u2FrameCtrl, &u2RxFrameCtrl); - u2RxFrameCtrl = prAssocRspFrame->u2FrameCtrl; // NOTE(Kevin): Optimized for ARM - u2RxFrameCtrl &= MASK_FRAME_TYPE; - if (prStaRec->fgIsReAssoc) { - if (u2RxFrameCtrl != MAC_FRAME_REASSOC_RSP) { - return WLAN_STATUS_FAILURE; - } - } - else { - if (u2RxFrameCtrl != MAC_FRAME_ASSOC_RSP) { - return WLAN_STATUS_FAILURE; - } - } - - //4 <3> Parse the Fixed Fields of (Re)Assocation Resp Frame Body. - //WLAN_GET_FIELD_16(&prAssocRspFrame->u2CapInfo, &u2RxCapInfo); - u2RxCapInfo = prAssocRspFrame->u2CapInfo; // NOTE(Kevin): Optimized for ARM - - //WLAN_GET_FIELD_16(&prAssocRspFrame->u2StatusCode, &u2RxStatusCode); - u2RxStatusCode = prAssocRspFrame->u2StatusCode; // NOTE(Kevin): Optimized for ARM - - //4 <4> Check CAP_INFO - /* NOTE(Kevin): CM suggest to add MGMT workaround for those APs didn't check - * the CAP Privacy Bit to overcome a corner case that the Privacy Bit - * of our SCAN result didn't consist with AP's Association Resp. - */ - if (u2RxStatusCode == STATUS_CODE_SUCCESSFUL) { -#if CFG_SUPPORT_WAPI - if (prAdapter->rWifiVar.rConnSettings.fgWapiMode) { - /* WAPI AP allow the customer use WZC to join mode, the privacy bit is 0 */ - /* even at WAI & WAPI_PSK mode, but the assoc respose set the privacy bit set 1 */ - DBGLOG(SEC, TRACE, ("Workaround the WAPI AP allow the customer to use WZC to join\n")); - } - else -#endif -#if CFG_ENABLE_WIFI_DIRECT - if (prAdapter->fgIsP2PRegistered && 1) { - /* Todo:: Fixed this */ - } - else -#endif - { - } - -#if CFG_STRICT_CHECK_CAPINFO_PRIVACY - if ((prStaRec->u2CapInfo & CAP_INFO_PRIVACY) ^ (u2RxCapInfo & CAP_INFO_PRIVACY)) { - u2RxStatusCode = STATUS_CODE_CAP_NOT_SUPPORTED; - } -#endif - } - - if (u2RxStatusCode == STATUS_CODE_SUCCESSFUL) { -#if CFG_RSN_MIGRATION - /* Update the information in the structure used to query and set - OID_802_11_ASSOCIATION_INFORMATION. */ - kalUpdateReAssocRspInfo(prAdapter->prGlueInfo, - (PUINT_8)&prAssocRspFrame->u2CapInfo, - (UINT_32)(prSwRfb->u2PacketLen)); -#endif - } - - //4 <5> Update CAP_INFO and ASSOC_ID - if (u2RxStatusCode == STATUS_CODE_SUCCESSFUL) { - prStaRec->u2CapInfo = u2RxCapInfo; - - //WLAN_GET_FIELD_16(&prAssocRspFrame->u2AssocId, &u2RxAssocId); - u2RxAssocId = prAssocRspFrame->u2AssocId; // NOTE(Kevin): Optimized for ARM - - /* 20110715 Workaround for Kingnet 710 AP (Realtek 8186) - * This AP raises the bit 6&7 not bit 14&15 in AID field. - * It cause wrong AID assignment. - * For AID = 2 - * Normal case: 0xC002(1100 0000 0000 0010) => 2 - * Kingnet 710: 0x00C2(0000 0000 1100 0010) => 194 - * workaround: mask bit 6&7 for this AP - */ - if((u2RxAssocId & BIT(6)) && - (u2RxAssocId & BIT(7)) && - !(u2RxAssocId & BITS(8, 15))) { - prStaRec->u2AssocId = u2RxAssocId & ~BITS(6,7); - } else { - prStaRec->u2AssocId = u2RxAssocId & ~AID_MSB; -#if CFG_SUPPORT_802_11W - if (prStaRec->ucNetTypeIndex == NETWORK_TYPE_AIS_INDEX) { - P_AIS_SPECIFIC_BSS_INFO_T prBssSpecInfo; - - prBssSpecInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - ASSERT(prBssSpecInfo); - - prBssSpecInfo->ucSaQueryTimedOut = 0; - } -#endif - } - } - -#if CFG_SUPPORT_802_11W - if (u2RxStatusCode == STATUS_CODE_AUTH_ALGORITHM_NOT_SUPPORTED){ - DBGLOG(SAA, INFO, ("AP rejected due the authentication algorithm not support\n")); - } - else if (u2RxStatusCode == STATUS_CODE_ASSOC_REJECTED_TEMPORARILY) { - PUINT_8 pucIE, pucTime; - UINT_16 u2IELength; - UINT_16 u2Offset = 0; - - u2IELength = prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen; - pucIE = (PUINT_8)((UINT_32)prSwRfb->pvHeader + prSwRfb->u2HeaderLen); - - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - if (ELEM_ID_TIMEOUT_INTERVAL == IE_ID(pucIE) && IE_LEN(pucIE) == 5) { - pucTime = ((P_IE_HDR_T)pucIE)->aucInfo; - if (pucTime[0] == ACTION_SA_TIMEOUT_ASSOC_COMEBACK) { - UINT_32 tu; - WLAN_GET_FIELD_32(pucTime + 1, &tu); - DBGLOG(SAA, INFO, ("AP rejected association temporarily; comeback duration %u TU " - "(%u ms)\n", tu, TU_TO_MSEC(tu))); - if (tu > TX_ASSOCIATION_RETRY_TIMEOUT_TU) { - DBGLOG(SAA, INFO, ("Update timer based on comeback duration\n")); - //ieee80211_reschedule_timer(wpa_s, ms); - } - } - break; - } - } /* end of IE_FOR_EACH */ - } -#endif - *pu2StatusCode = u2RxStatusCode; - - return WLAN_STATUS_SUCCESS; - -} /* end of assocCheckRxReAssocRspFrameStatus() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will compose the Disassociation frame -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* @param[in] pucBuffer Pointer to the frame buffer. -* @param[in] aucMACAddress Given Our MAC Address. -* @param[in] u2ReasonCode The reason code of disassociation -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -assocComposeDisassocFrame ( - IN P_STA_RECORD_T prStaRec, - IN PUINT_8 pucBuffer, - IN UINT_8 aucMACAddress[], - IN UINT_16 u2ReasonCode - ) -{ - P_WLAN_DISASSOC_FRAME_T prDisAssocFrame; - UINT_16 u2FrameCtrl; - - ASSERT(pucBuffer); - ASSERT(pucBuffer); - ASSERT(aucMACAddress); - - prDisAssocFrame = (P_WLAN_DISASSOC_FRAME_T)pucBuffer; - - //4 <1> Compose the frame header of the DisAssociation frame. - /* Fill the Frame Control field. */ - u2FrameCtrl = MAC_FRAME_DISASSOC; - - WLAN_SET_FIELD_16(&prDisAssocFrame->u2FrameCtrl, u2FrameCtrl); - - /* Fill the DA field with Target BSSID. */ - COPY_MAC_ADDR(prDisAssocFrame->aucDestAddr, prStaRec->aucMacAddr); - - /* Fill the SA field with our MAC Address. */ - COPY_MAC_ADDR(prDisAssocFrame->aucSrcAddr, aucMACAddress); - - /* Fill the BSSID field with Target BSSID. */ - COPY_MAC_ADDR(prDisAssocFrame->aucBSSID, prStaRec->aucMacAddr); - - /* Clear the SEQ/FRAG_NO field(HW won't overide the FRAG_NO, so we need to clear it). */ - prDisAssocFrame->u2SeqCtrl = 0; - - //4 <2> Compose the frame body's fixed field part of the Disassociation frame. - /* Fill the Reason Code field. */ - WLAN_SET_FIELD_16(&prDisAssocFrame->u2ReasonCode, u2ReasonCode); - - return; -} /* end of assocComposeDisassocFrame() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will send the Disassociation frame -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* @param[in] u2ReasonCode The reason code of disassociation -* -* @retval WLAN_STATUS_RESOURCES No available resource for frame composing. -* @retval WLAN_STATUS_SUCCESS Successfully send frame to TX Module -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -assocSendDisAssocFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN UINT_16 u2ReasonCode - ) -{ - PUINT_8 pucMacAddress; - P_MSDU_INFO_T prMsduInfo; - UINT_16 u2PayloadLen; - UINT_16 u2EstimatedFrameLen; - //UINT_32 u4Status = WLAN_STATUS_SUCCESS; - - - ASSERT(prStaRec); - - //4 <1> Allocate a PKT_INFO_T for Disassociation Frame - /* Init with MGMT Header Length + Length of Fixed Fields + IE Length */ - u2EstimatedFrameLen = MAC_TX_RESERVED_FIELD + \ - WLAN_MAC_MGMT_HEADER_LEN + \ - REASON_CODE_FIELD_LEN; - - /* Allocate a MSDU_INFO_T */ - if ( (prMsduInfo = cnmMgtPktAlloc(prAdapter, u2EstimatedFrameLen)) == NULL) { - DBGLOG(SAA, WARN, ("No PKT_INFO_T for sending DisAssoc.\n")); - return WLAN_STATUS_RESOURCES; - } - - //4 <2> Compose Disassociation frame header and fixed fields in MSDU_INfO_T. - ASSERT(prStaRec->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - - pucMacAddress = prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex].aucOwnMacAddr; - - /* Compose Header and Fixed Field */ - assocComposeDisassocFrame(prStaRec, - (PUINT_8)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD), - pucMacAddress, - u2ReasonCode); - -#if CFG_SUPPORT_802_11W - if (rsnCheckBipKeyInstalled(prAdapter, prStaRec)) { - P_WLAN_DISASSOC_FRAME_T prDisassocFrame; - - prDisassocFrame = (P_WLAN_DEAUTH_FRAME_T)(PUINT_8)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD); - - prDisassocFrame->u2FrameCtrl |= MASK_FC_PROTECTED_FRAME; - DBGLOG(TX, WARN, ("assocSendDisAssocFrame with protection\n")); - } -#endif - - u2PayloadLen = REASON_CODE_FIELD_LEN; - - //4 <3> Update information of MSDU_INFO_T - ASSERT(prStaRec->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - - prMsduInfo->eSrc = TX_PACKET_MGMT; - prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_MGMT; - prMsduInfo->ucStaRecIndex = prStaRec->ucIndex; - prMsduInfo->ucNetworkType = prStaRec->ucNetTypeIndex; - prMsduInfo->ucMacHeaderLength = WLAN_MAC_MGMT_HEADER_LEN; - prMsduInfo->fgIs802_1x = FALSE; - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = WLAN_MAC_MGMT_HEADER_LEN + u2PayloadLen; - prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMsduInfo->pfTxDoneHandler = NULL; - prMsduInfo->fgIsBasicRate = TRUE; - - //4 <4> Enqueue the frame to send this (Re)Association request frame. - nicTxEnqueueMsdu(prAdapter, prMsduInfo); - - return WLAN_STATUS_SUCCESS; -} /* end of assocSendDisAssocFrame() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will parse and process the incoming Disassociation frame -* if the given BSSID is matched. -* -* @param[in] prSwRfb Pointer to SW RFB data structure. -* @param[in] aucBSSID Given BSSID -* @param[out] pu2ReasonCode Pointer to store the Reason Code from Deauthentication. -* -* @retval WLAN_STATUS_FAILURE This is not the frame we should handle at current state. -* @retval WLAN_STATUS_SUCCESS This is the frame we should handle. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -assocProcessRxDisassocFrame ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN UINT_8 aucBSSID[], - OUT PUINT_16 pu2ReasonCode - ) -{ - P_WLAN_DISASSOC_FRAME_T prDisassocFrame; - UINT_16 u2RxReasonCode; - - - ASSERT(prSwRfb); - ASSERT(aucBSSID); - ASSERT(pu2ReasonCode); - - //4 <1> locate the Disassociation Frame. - prDisassocFrame = (P_WLAN_DISASSOC_FRAME_T) prSwRfb->pvHeader; - - //4 <2> Parse the Header of Disassociation Frame. - if ((prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen) < REASON_CODE_FIELD_LEN) { - ASSERT(0); - return WLAN_STATUS_FAILURE; - } - - /* Check if this Disassoc Frame is coming from Target BSSID */ - if (UNEQUAL_MAC_ADDR(prDisassocFrame->aucBSSID, aucBSSID)) { - DBGLOG(SAA, LOUD, ("Ignore Disassoc Frame from other BSS ["MACSTR"]\n", - MAC2STR(prDisassocFrame->aucSrcAddr))); - return WLAN_STATUS_FAILURE; - } - - //4 <3> Parse the Fixed Fields of Deauthentication Frame Body. - WLAN_GET_FIELD_16(&prDisassocFrame->u2ReasonCode, &u2RxReasonCode); - *pu2ReasonCode = u2RxReasonCode; - - return WLAN_STATUS_SUCCESS; - -} /* end of assocProcessRxDisassocFrame() */ - - -#if CFG_SUPPORT_AAA -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will parse and process the incoming Association Req frame -* and return a Status Code. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prSwRfb Pointer to SW RFB data structure. -* @param[out] pu2StatusCode Pointer to store the Status Code for carried in Association Response. -* -* @retval WLAN_STATUS_FAILURE This is not the frame we should handle at current state. -* @retval WLAN_STATUS_SUCCESS This is the frame we should handle. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -assocProcessRxAssocReqFrame ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_16 pu2StatusCode - ) -{ - P_WLAN_ASSOC_REQ_FRAME_T prAssocReqFrame; - P_STA_RECORD_T prStaRec; - P_BSS_INFO_T prBssInfo; - P_IE_SSID_T prIeSsid = (P_IE_SSID_T)NULL; - P_RSN_INFO_ELEM_T prIeRsn = (P_RSN_INFO_ELEM_T)NULL; - P_IE_SUPPORTED_RATE_T prIeSupportedRate = (P_IE_SUPPORTED_RATE_T)NULL; - P_IE_EXT_SUPPORTED_RATE_T prIeExtSupportedRate = (P_IE_EXT_SUPPORTED_RATE_T)NULL; - PUINT_8 pucIE, pucIEStart; - UINT_16 u2IELength; - UINT_16 u2Offset = 0; - UINT_16 u2StatusCode = STATUS_CODE_SUCCESSFUL; - UINT_16 u2RxFrameCtrl; - UINT_16 u2BSSBasicRateSet; - BOOLEAN fgIsUnknownBssBasicRate; - UINT_32 i; - - - ASSERT(prAdapter); - ASSERT(prSwRfb); - ASSERT(pu2StatusCode); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - - if (prStaRec == NULL) { - return WLAN_STATUS_FAILURE; - } - - //4 <1> locate the Association Req Frame. - prAssocReqFrame = (P_WLAN_ASSOC_REQ_FRAME_T) prSwRfb->pvHeader; - - //4 <2> Parse the Header of Association Req Frame. - if ((prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen) < - (CAP_INFO_FIELD_LEN + LISTEN_INTERVAL_FIELD_LEN)) { - ASSERT(0); - return WLAN_STATUS_FAILURE; - } - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]); - - /* Check if this Disassoc Frame is coming from Target BSSID */ - if (UNEQUAL_MAC_ADDR(prAssocReqFrame->aucBSSID, prBssInfo->aucBSSID)) { - return WLAN_STATUS_FAILURE; /* Just Ignore this MMPDU */ - } - - //WLAN_GET_FIELD_16(&prAssocReqFrame->u2FrameCtrl, &u2RxFrameCtrl); - u2RxFrameCtrl = prAssocReqFrame->u2FrameCtrl; // NOTE(Kevin): Optimized for ARM - u2RxFrameCtrl &= MASK_FRAME_TYPE; - if (MAC_FRAME_REASSOC_REQ == u2RxFrameCtrl) { - prStaRec->fgIsReAssoc = TRUE; - - u2IELength = (prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen) - - (UINT_16)(OFFSET_OF(WLAN_REASSOC_REQ_FRAME_T, aucInfoElem[0]) - WLAN_MAC_MGMT_HEADER_LEN); - - pucIEStart = pucIE = ((P_WLAN_REASSOC_REQ_FRAME_T)(prSwRfb->pvHeader))->aucInfoElem; - } - else { - prStaRec->fgIsReAssoc = FALSE; - - u2IELength = (prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen) - - (UINT_16)(OFFSET_OF(WLAN_ASSOC_REQ_FRAME_T, aucInfoElem[0]) - WLAN_MAC_MGMT_HEADER_LEN); - - pucIEStart = pucIE = prAssocReqFrame->aucInfoElem; - } - - - //4 <3> Parse the Fixed Fields of Assoc Req Frame Body. - prStaRec->u2CapInfo = prAssocReqFrame->u2CapInfo; - -#if CFG_ENABLE_WIFI_DIRECT && CFG_ENABLE_HOTSPOT_PRIVACY_CHECK - if (prAdapter->fgIsP2PRegistered && IS_STA_IN_P2P(prStaRec)) { - if (((prStaRec->u2CapInfo & CAP_INFO_PRIVACY) && - !kalP2PGetCipher(prAdapter->prGlueInfo))) { - u2StatusCode = STATUS_CODE_CAP_NOT_SUPPORTED; - DBGLOG(RSN, TRACE, ("STA Assoc req privacy bit check fail\n")); - return WLAN_STATUS_SUCCESS; - } - } -#endif - - prStaRec->u2ListenInterval = prAssocReqFrame->u2ListenInterval; - prStaRec->ucPhyTypeSet = 0; - - /* Might be legacy client or p2p gc. */ - prStaRec->eStaType = STA_TYPE_LEGACY_CLIENT; - - //4 <4> Parse the IE of Assoc Req Frame Body. - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - switch (IE_ID(pucIE)) { - case ELEM_ID_SSID: - if ((!prIeSsid) && /* NOTE(Kevin): Get SSID once */ - (IE_LEN(pucIE) <= ELEM_MAX_LEN_SSID)) { - prIeSsid = (P_IE_SSID_T)pucIE; - } - break; - - case ELEM_ID_SUP_RATES: - if ((!prIeSupportedRate) && (IE_LEN(pucIE) <= RATE_NUM)) { - prIeSupportedRate = SUP_RATES_IE(pucIE); - } - break; - - case ELEM_ID_EXTENDED_SUP_RATES: - if (!prIeExtSupportedRate) - prIeExtSupportedRate = EXT_SUP_RATES_IE(pucIE); - break; - case ELEM_ID_HT_CAP: - prStaRec->ucPhyTypeSet |= PHY_TYPE_BIT_HT; - break; - case ELEM_ID_RSN: - #if CFG_ENABLE_WIFI_DIRECT && CFG_ENABLE_HOTSPOT_PRIVACY_CHECK - if (prAdapter->fgIsP2PRegistered && IS_STA_IN_P2P(prStaRec)) { - prIeRsn = RSN_IE(pucIE); - rsnParserCheckForRSNCCMPPSK(prAdapter, prIeRsn, &u2StatusCode); - if (u2StatusCode != STATUS_CODE_SUCCESSFUL) { - *pu2StatusCode = u2StatusCode; - return WLAN_STATUS_SUCCESS; - } - } - #endif - break; - case ELEM_ID_VENDOR: - #if CFG_ENABLE_WIFI_DIRECT - { - if ((prAdapter->fgIsP2PRegistered)) { - UINT_8 ucOuiType = 0; - - p2pFuncParseCheckForP2PInfoElem(prAdapter, pucIE, &ucOuiType); - - if (ucOuiType == VENDOR_OUI_TYPE_P2P) { - DBGLOG(P2P, TRACE, ("Target Client is a P2P group client\n")); - prStaRec->eStaType = STA_TYPE_P2P_GC; - } - } - } - #endif - break; - default: - for (i = 0; i < (sizeof(rxAssocReqIETable) / sizeof(VERIFY_IE_ENTRY_T)); i++) { - - if ((IE_ID(pucIE)) == rxAssocReqIETable[i].ucElemID) { - rxAssocReqIETable[i].pfnVarifyIE(prAdapter, prSwRfb, (P_IE_HDR_T)pucIE, &u2StatusCode); - - if (u2StatusCode != STATUS_CODE_SUCCESSFUL) { - *pu2StatusCode = u2StatusCode; - return WLAN_STATUS_SUCCESS; - } - } - } - - break; - } - } /* end of IE_FOR_EACH */ - - // parsing for WMM related information (2010/12/21) - mqmProcessAssocReq( - prAdapter, - prSwRfb, - pucIEStart, - u2IELength); - - do { - if (prIeSsid) { - if (UNEQUAL_SSID(prBssInfo->aucSSID, prBssInfo->ucSSIDLen, - prIeSsid->aucSSID, prIeSsid->ucLength)) { - - u2StatusCode = STATUS_CODE_UNSPECIFIED_FAILURE; - break; - } - } - else { - u2StatusCode = STATUS_CODE_UNSPECIFIED_FAILURE; - break; - } - - prStaRec->u2OperationalRateSet = 0; - prStaRec->u2BSSBasicRateSet = 0; - - if (prIeSupportedRate || prIeExtSupportedRate) { - rateGetRateSetFromIEs(prIeSupportedRate, - prIeExtSupportedRate, - &prStaRec->u2OperationalRateSet, - &u2BSSBasicRateSet, /* Ignore any Basic Bit */ - &fgIsUnknownBssBasicRate); - - if ((prBssInfo->u2BSSBasicRateSet & prStaRec->u2OperationalRateSet) != - prBssInfo->u2BSSBasicRateSet) { - - u2StatusCode = STATUS_CODE_ASSOC_DENIED_RATE_NOT_SUPPORTED; - break; - } - - /* Accpet the Sta, update BSSBasicRateSet from Bss */ - - prStaRec->u2BSSBasicRateSet = prBssInfo->u2BSSBasicRateSet; - - prStaRec->u2DesiredNonHTRateSet = (prStaRec->u2OperationalRateSet & RATE_SET_ALL_ABG); - - if (BAND_2G4 == HIF_RX_HDR_GET_RF_BAND(prSwRfb->prHifRxHdr)) { - #if 0 /* Marked by CMC 20111024 */ - /* check if support 11n */ - if (!(u2BSSBasicRateSet & RATE_SET_BIT_HT_PHY)) { - - if (prStaRec->u2OperationalRateSet & RATE_SET_OFDM) { - prStaRec->ucPhyTypeSet |= PHY_TYPE_BIT_ERP; - } - - - if (!(u2BSSBasicRateSet & RATE_SET_OFDM)) { - if (prStaRec->u2OperationalRateSet & RATE_SET_HR_DSSS) { - prStaRec->ucPhyTypeSet |= PHY_TYPE_BIT_HR_DSSS; - } - - } - - } - #else - if (prStaRec->u2OperationalRateSet & RATE_SET_OFDM) { - prStaRec->ucPhyTypeSet |= PHY_TYPE_BIT_ERP; - } - if (prStaRec->u2OperationalRateSet & RATE_SET_HR_DSSS) { - prStaRec->ucPhyTypeSet |= PHY_TYPE_BIT_HR_DSSS; - } - #endif - } - else { /* (BAND_5G == prBssDesc->eBande) */ - #if 0 /* Marked by CMC 20111024 */ - if (!(u2BSSBasicRateSet & RATE_SET_BIT_HT_PHY)) { - - prStaRec->ucPhyTypeSet |= PHY_TYPE_BIT_OFDM; - } - ASSERT((prStaRec->u2OperationalRateSet & RATE_SET_HR_DSSS) == 0); - #else - if (prStaRec->u2OperationalRateSet & RATE_SET_OFDM) { - prStaRec->ucPhyTypeSet |= PHY_TYPE_BIT_OFDM; - } - #endif - } - - } - else { - ASSERT(0); - u2StatusCode = STATUS_CODE_ASSOC_DENIED_RATE_NOT_SUPPORTED; - break; - } - -#if CFG_ENABLE_WIFI_DIRECT && CFG_ENABLE_HOTSPOT_PRIVACY_CHECK - if (prAdapter->fgIsP2PRegistered && IS_STA_IN_P2P(prStaRec)) { - if (prIeRsn) { - if (!kalP2PGetCipher(prAdapter->prGlueInfo)) { - u2StatusCode = STATUS_CODE_CIPHER_SUITE_REJECTED; - break; - } - } - else { - prStaRec->rSecInfo.fgAllowOnly1x = FALSE; - if (kalP2PGetCipher(prAdapter->prGlueInfo)) { - //Only Allow 1x - prStaRec->rSecInfo.fgAllowOnly1x = TRUE; - break; - } - } - } -#endif - - } while (FALSE); - -#if CFG_ENABLE_WIFI_DIRECT - if (prAdapter->fgIsP2PRegistered && IS_STA_IN_P2P(prStaRec)) { - #if 1 /* ICS */ - { - PUINT_8 cp = (PUINT_8)&prAssocReqFrame->u2CapInfo; - if (prStaRec->fgIsReAssoc) - cp += 10; - else - cp += 4; - if (prStaRec->pucAssocReqIe) { - kalMemFree(prStaRec->pucAssocReqIe, VIR_MEM_TYPE, prStaRec->u2AssocReqIeLen); - prStaRec->pucAssocReqIe = NULL; - } - prStaRec->u2AssocReqIeLen = u2IELength; - if (u2IELength) { - prStaRec->pucAssocReqIe = kalMemAlloc(u2IELength, VIR_MEM_TYPE); - kalMemCopy(prStaRec->pucAssocReqIe, cp, u2IELength); - } - } - #endif - kalP2PUpdateAssocInfo(prAdapter->prGlueInfo, (PUINT_8)&prAssocReqFrame->u2CapInfo, u2IELength + (prStaRec->fgIsReAssoc ? 10 : 4), prStaRec->fgIsReAssoc); - } -#endif - - *pu2StatusCode = u2StatusCode; - - return WLAN_STATUS_SUCCESS; - -} /* end of assocProcessRxAssocReqFrame() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to compose Common Information Elements for Association -* Response Frame. -* -* @param[in] prMsduInfo Pointer to the composed MSDU_INFO_T. -* @param[in] prBssInfo Pointer to the BSS_INFO_T. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -assocBuildReAssocRespFrameCommonIEs ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN P_BSS_INFO_T prBssInfo - ) -{ - PUINT_8 pucBuffer; - P_STA_RECORD_T prStaRec; - UINT_8 ucSupRatesLen; - UINT_8 ucExtSupRatesLen; - - - ASSERT(prMsduInfo); - ASSERT(prMsduInfo->eSrc == TX_PACKET_MGMT); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - ASSERT(prStaRec); - - - pucBuffer = (PUINT_8)((UINT_32)prMsduInfo->prPacket + - (UINT_32)prMsduInfo->u2FrameLength); - ASSERT(pucBuffer); - - if (prBssInfo->ucAllSupportedRatesLen > ELEM_MAX_LEN_SUP_RATES) { - - ucSupRatesLen = ELEM_MAX_LEN_SUP_RATES; - ucExtSupRatesLen = prBssInfo->ucAllSupportedRatesLen - ELEM_MAX_LEN_SUP_RATES; - } - else { - ucSupRatesLen = prBssInfo->ucAllSupportedRatesLen; - ucExtSupRatesLen = 0; - } - - /* Fill the Supported Rates element. */ - if (ucSupRatesLen) { - SUP_RATES_IE(pucBuffer)->ucId = ELEM_ID_SUP_RATES; - SUP_RATES_IE(pucBuffer)->ucLength = ucSupRatesLen; - kalMemCopy(SUP_RATES_IE(pucBuffer)->aucSupportedRates, - prBssInfo->aucAllSupportedRates, - ucSupRatesLen); - - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - pucBuffer += IE_SIZE(pucBuffer); - } - - - /* Fill the Extended Supported Rates element. */ - if (ucExtSupRatesLen) { - - EXT_SUP_RATES_IE(pucBuffer)->ucId = ELEM_ID_EXTENDED_SUP_RATES; - EXT_SUP_RATES_IE(pucBuffer)->ucLength = ucExtSupRatesLen; - - kalMemCopy(EXT_SUP_RATES_IE(pucBuffer)->aucExtSupportedRates, - &prBssInfo->aucAllSupportedRates[ucSupRatesLen], - ucExtSupRatesLen); - - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - } - - return; -} /* end of assocBuildReAssocRespFrameCommonIEs() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will compose the (Re)Association Response frame -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* @param[in] pucBuffer Pointer to the frame buffer. -* @param[in] aucBssid Given BSSID. -* @param[in] u2CapInfo Capability Field of current BSS. -* @param[in out] pu2PayloadLen Return the length of the composed fixed fields -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -assocComposeReAssocRespFrameHeaderAndFF ( - IN P_STA_RECORD_T prStaRec, - IN PUINT_8 pucBuffer, - IN UINT_8 aucBSSID[], - IN UINT_16 u2CapInfo, - IN OUT PUINT_16 pu2PayloadLen - ) -{ - P_WLAN_ASSOC_RSP_FRAME_T prAssocRspFrame; - BOOLEAN fgIsReAssoc; - - UINT_16 u2FrameCtrl; - - - ASSERT(prStaRec); - ASSERT(pucBuffer); - ASSERT(aucBSSID); - ASSERT(pu2PayloadLen); - - prAssocRspFrame = (P_WLAN_ASSOC_RSP_FRAME_T)pucBuffer; - fgIsReAssoc = prStaRec->fgIsReAssoc; - - //4 <1> Compose the frame header of the (Re)Association Request frame. - /* Fill the Frame Control field. */ - if (fgIsReAssoc) { - u2FrameCtrl = MAC_FRAME_REASSOC_RSP; - } - else { - u2FrameCtrl = MAC_FRAME_ASSOC_RSP; - } - //WLAN_SET_FIELD_16(&prAssocFrame->u2FrameCtrl, u2FrameCtrl); - prAssocRspFrame->u2FrameCtrl = u2FrameCtrl; // NOTE(Kevin): Optimized for ARM - - /* Fill the DA field with Target MAC Address. */ - COPY_MAC_ADDR(prAssocRspFrame->aucDestAddr, prStaRec->aucMacAddr); - - /* Fill the SA field with current BSSID. */ - COPY_MAC_ADDR(prAssocRspFrame->aucSrcAddr, aucBSSID); - - /* Fill the BSSID field with current BSSID. */ - COPY_MAC_ADDR(prAssocRspFrame->aucBSSID, aucBSSID); - - /* Clear the SEQ/FRAG_NO field(HW won't overide the FRAG_NO, so we need to clear it). */ - prAssocRspFrame->u2SeqCtrl = 0; - - - //4 <2> Compose the frame body's common fixed field part of the (Re)Association Request frame. - /* Fill the Capability Information field. */ - //WLAN_SET_FIELD_16(&prAssocFrame->u2CapInfo, u2CapInfo); - prAssocRspFrame->u2CapInfo = u2CapInfo; // NOTE(Kevin): Optimized for ARM - - //WLAN_SET_FIELD_16(&prAssocFrame->u2StatusCode, prStaRec->u2StatusCode); - prAssocRspFrame->u2StatusCode = prStaRec->u2StatusCode; // NOTE(Kevin): Optimized for ARM - - //WLAN_SET_FIELD_16(&prAssocFrame->u2AssocId, ((prStaRec->u2AssocId & AID_MASK) | AID_MSB)); - prAssocRspFrame->u2AssocId = - ((prStaRec->u2AssocId & AID_MASK) | AID_MSB); // NOTE(Kevin): Optimized for ARM - - *pu2PayloadLen = (CAP_INFO_FIELD_LEN + - STATUS_CODE_FIELD_LEN + - AID_FIELD_LEN); - - return; -} /* end of assocComposeReAssocRespFrameHeaderAndFF() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will send the (Re)Association Resp frame -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @retval WLAN_STATUS_RESOURCES No available resource for frame composing. -* @retval WLAN_STATUS_SUCCESS Successfully send frame to TX Module -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -assocSendReAssocRespFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ) -{ - P_BSS_INFO_T prBssInfo; - P_MSDU_INFO_T prMsduInfo; - - UINT_16 u2PayloadLen; - UINT_16 u2EstimatedFrameLen; - UINT_16 u2EstimatedExtraIELen; - BOOLEAN fgIsReAssoc; - UINT_32 i; - - - ASSERT(prStaRec); - - - //4 <1> Allocate a PKT_INFO_T for Authentication Frame - fgIsReAssoc = prStaRec->fgIsReAssoc; - - /* Init with MGMT Header Length + Length of Fixed Fields + Common IE Length */ - u2EstimatedFrameLen = MAC_TX_RESERVED_FIELD + \ - WLAN_MAC_MGMT_HEADER_LEN + \ - CAP_INFO_FIELD_LEN + \ - STATUS_CODE_FIELD_LEN + \ - AID_FIELD_LEN + \ - (ELEM_HDR_LEN + ELEM_MAX_LEN_SUP_RATES) + \ - (ELEM_HDR_LEN + (RATE_NUM - ELEM_MAX_LEN_SUP_RATES)); - - /* + Extra IE Length */ - u2EstimatedExtraIELen = 0; - - for (i = 0; i < sizeof(txAssocRespIETable)/sizeof(APPEND_VAR_IE_ENTRY_T); i++) { - if (txAssocRespIETable[i].u2EstimatedFixedIELen != 0) { - u2EstimatedExtraIELen += txAssocRespIETable[i].u2EstimatedFixedIELen; - } - else if (txAssocRespIETable[i].pfnCalculateVariableIELen != NULL) { - u2EstimatedExtraIELen += (UINT_16)txAssocRespIETable[i].pfnCalculateVariableIELen(prAdapter, - prStaRec->ucNetTypeIndex, - prStaRec); - } - - } - - u2EstimatedFrameLen += u2EstimatedExtraIELen; - - /* Allocate a MSDU_INFO_T */ - if ( (prMsduInfo = cnmMgtPktAlloc(prAdapter, u2EstimatedFrameLen)) == NULL) { - DBGLOG(AAA, WARN, ("No PKT_INFO_T for sending (Re)Assoc Response.\n")); - return WLAN_STATUS_RESOURCES; - } - - //4 <2> Compose (Re)Association Request frame header and fixed fields in MSDU_INfO_T. - ASSERT(prStaRec->ucNetTypeIndex != NETWORK_TYPE_AIS_INDEX); - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]); - - /* Compose Header and Fixed Field */ - assocComposeReAssocRespFrameHeaderAndFF(prStaRec, - (PUINT_8)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD), - prBssInfo->aucBSSID, - prBssInfo->u2CapInfo, - &u2PayloadLen); - - //4 <3> Update information of MSDU_INFO_T - ASSERT(prStaRec->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - - prMsduInfo->eSrc = TX_PACKET_MGMT; - prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_MGMT; - prMsduInfo->ucStaRecIndex = prStaRec->ucIndex; - prMsduInfo->ucNetworkType = prStaRec->ucNetTypeIndex; - prMsduInfo->ucMacHeaderLength = WLAN_MAC_MGMT_HEADER_LEN; - prMsduInfo->fgIs802_1x = FALSE; - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = WLAN_MAC_MGMT_HEADER_LEN + u2PayloadLen; - prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMsduInfo->pfTxDoneHandler = aaaFsmRunEventTxDone; - prMsduInfo->fgIsBasicRate = TRUE; - - //4 <4> Compose the frame body's IEs of the (Re)Association Request frame. - assocBuildReAssocRespFrameCommonIEs(prAdapter, prMsduInfo, prBssInfo); - - - //4 <5> Compose IEs in MSDU_INFO_T - - /* Append IE */ - for (i = 0; i < sizeof(txAssocRespIETable)/sizeof(APPEND_VAR_IE_ENTRY_T); i++) { - if (txAssocRespIETable[i].pfnAppendIE) { - txAssocRespIETable[i].pfnAppendIE(prAdapter, prMsduInfo); - } - } - - /* TODO(Kevin): Also release the unused tail room of the composed MMPDU */ - - //4 <6> Enqueue the frame to send this (Re)Association request frame. - nicTxEnqueueMsdu(prAdapter, prMsduInfo); - - return WLAN_STATUS_SUCCESS; - -} /* end of assocSendReAssocRespFrame() */ -#endif /* CFG_SUPPORT_AAA */ - - diff --git a/drivers/net/wireless/mt5931/mgmt/auth.c b/drivers/net/wireless/mt5931/mgmt/auth.c deleted file mode 100755 index 9938ebc09823..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/auth.c +++ /dev/null @@ -1,1350 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/auth.c#1 $ -*/ - -/*! \file "auth.c" - \brief This file includes the authentication-related functions. - - This file includes the authentication-related functions. -*/ - - - -/* -** $Log: auth.c $ - * - * 02 13 2012 cp.wu - * NULL - * show error message only instead of raise assertion when - * received authentication frame is carrying illegal parameters. - * - * 11 09 2011 yuche.tsai - * NULL - * Fix a network index & station record index issue when TX deauth frame. - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 06 22 2011 yuche.tsai - * NULL - * Fix coding error. - * - * 06 20 2011 yuche.tsai - * [WCXRP00000796] [Volunteer Patch][MT6620][Driver] Add BC deauth frame TX feature. - * BC deauth support. - * - * 04 21 2011 terry.wu - * [WCXRP00000674] [MT6620 Wi-Fi][Driver] Refine AAA authSendAuthFrame - * Add network type parameter to authSendAuthFrame. - * - * 04 15 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add BOW short range mode. - * - * 02 08 2011 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * 1. Fix Service Disocvery Logical issue. - * 2. Fix a NULL pointer access violation issue when sending deauthentication packet to a class error station. - * - * 01 24 2011 cp.wu - * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving - * 1. add an extra counter for tracking pending forward frames. - * 2. notify TX service thread as well when there is pending forward frame - * 3. correct build errors leaded by introduction of Wi-Fi direct separation module - * - * 01 21 2011 terry.wu - * [WCXRP00000381] [MT6620 Wi-Fi][Driver] Kernel panic when replying unaccept Auth in AP mode - * In AP mode, use STA_REC_INDEX_NOT_FOUND(0xFE) instead of StaRec index when replying an unaccept Auth frame. - * - * 10 18 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * use definition macro to replace hard-coded constant - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 30 2010 cp.wu - * NULL - * eliminate klockwork errors - * - * 08 16 2010 cp.wu - * NULL - * Replace CFG_SUPPORT_BOW by CFG_ENABLE_BT_OVER_WIFI. - * There is no CFG_SUPPORT_BOW in driver domain source. - * - * 08 16 2010 kevin.huang - * NULL - * Refine AAA functions - * - * 08 03 2010 cp.wu - * NULL - * surpress compilation warning. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 28 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * send MMPDU in basic rate. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * specify correct value for management frames. - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add management dispatching function table. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * auth.c is migrated. - * - * 05 28 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Update authSendDeauthFrame() for correct the value of eNetTypeIndex in MSDU_INFO_T - * - * 05 24 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Check Net is active before sending Deauth frame. - * - * 05 24 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Refine authSendAuthFrame() for NULL STA_RECORD_T case and minimum deauth interval. - * - * 04 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW - * - * 04 19 2010 kevin.huang - * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support - * Add Send Deauth for Class 3 Error and Leave Network Support - * - * 02 23 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Fix compile warning - * - * 02 05 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add debug message for abnormal authentication frame from AP - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup - * - * 01 11 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add Deauth and Disassoc Handler - * - * 01 07 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * - * Fix the Debug Label - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * Dec 7 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Update the authComposeAuthFrameHeader() - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the send deauth frame function - * - * Dec 3 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Integrate send Auth with TXM - * - * Nov 24 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Revise MGMT Handler with Retain Status - * - * Nov 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ -APPEND_IE_ENTRY_T txAuthIETable[] = { - { (ELEM_HDR_LEN + ELEM_MAX_LEN_CHALLENGE_TEXT), authAddIEChallengeText } -}; - -HANDLE_IE_ENTRY_T rxAuthIETable[] = { - { ELEM_ID_CHALLENGE_TEXT, authHandleIEChallengeText } -}; - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will compose the Authentication frame header and fixed fields. -* -* @param[in] pucBuffer Pointer to the frame buffer. -* @param[in] aucPeerMACAddress Given Peer MAC Address. -* @param[in] aucMACAddress Given Our MAC Address. -* @param[in] u2AuthAlgNum Authentication Algorithm Number -* @param[in] u2TransactionSeqNum Transaction Sequence Number -* @param[in] u2StatusCode Status Code -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -authComposeAuthFrameHeaderAndFF ( - IN PUINT_8 pucBuffer, - IN UINT_8 aucPeerMACAddress[], - IN UINT_8 aucMACAddress[], - IN UINT_16 u2AuthAlgNum, - IN UINT_16 u2TransactionSeqNum, - IN UINT_16 u2StatusCode - ) -{ - P_WLAN_AUTH_FRAME_T prAuthFrame; - UINT_16 u2FrameCtrl; - - - ASSERT(pucBuffer); - ASSERT(aucPeerMACAddress); - ASSERT(aucMACAddress); - - prAuthFrame = (P_WLAN_AUTH_FRAME_T)pucBuffer; - - //4 <1> Compose the frame header of the Authentication frame. - /* Fill the Frame Control field. */ - u2FrameCtrl = MAC_FRAME_AUTH; - - /* If this frame is the third frame in the shared key authentication - * sequence, it shall be encrypted. - */ - if ((u2AuthAlgNum == AUTH_ALGORITHM_NUM_SHARED_KEY) && - (u2TransactionSeqNum == AUTH_TRANSACTION_SEQ_3)) { - - u2FrameCtrl |= MASK_FC_PROTECTED_FRAME; /* HW will also detect this bit for applying encryption */ - } - - //WLAN_SET_FIELD_16(&prAuthFrame->u2FrameCtrl, u2FrameCtrl); - prAuthFrame->u2FrameCtrl = u2FrameCtrl; // NOTE(Kevin): Optimized for ARM - - /* Fill the DA field with Target BSSID. */ - COPY_MAC_ADDR(prAuthFrame->aucDestAddr, aucPeerMACAddress); - - /* Fill the SA field with our MAC Address. */ - COPY_MAC_ADDR(prAuthFrame->aucSrcAddr, aucMACAddress); - - switch (u2TransactionSeqNum) { - case AUTH_TRANSACTION_SEQ_1: - case AUTH_TRANSACTION_SEQ_3: - - /* Fill the BSSID field with Target BSSID. */ - COPY_MAC_ADDR(prAuthFrame->aucBSSID, aucPeerMACAddress); - break; - - case AUTH_TRANSACTION_SEQ_2: - case AUTH_TRANSACTION_SEQ_4: - - /* Fill the BSSID field with Current BSSID. */ - COPY_MAC_ADDR(prAuthFrame->aucBSSID, aucMACAddress); - break; - - default: - ASSERT(0); - } - - /* Clear the SEQ/FRAG_NO field. */ - prAuthFrame->u2SeqCtrl = 0; - - - //4 <2> Compose the frame body's fixed field part of the Authentication frame. - /* Fill the Authentication Algorithm Number field. */ - //WLAN_SET_FIELD_16(&prAuthFrame->u2AuthAlgNum, u2AuthAlgNum); - prAuthFrame->u2AuthAlgNum = u2AuthAlgNum; // NOTE(Kevin): Optimized for ARM - - /* Fill the Authentication Transaction Sequence Number field. */ - //WLAN_SET_FIELD_16(&prAuthFrame->u2AuthTransSeqNo, u2TransactionSeqNum); - prAuthFrame->u2AuthTransSeqNo = u2TransactionSeqNum; // NOTE(Kevin): Optimized for ARM - - /* Fill the Status Code field. */ - //WLAN_SET_FIELD_16(&prAuthFrame->u2StatusCode, u2StatusCode); - prAuthFrame->u2StatusCode = u2StatusCode; // NOTE(Kevin): Optimized for ARM - - return; -} /* end of authComposeAuthFrameHeaderAndFF() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will append Challenge Text IE to the Authentication frame -* -* @param[in] prMsduInfo Pointer to the composed MSDU_INFO_T. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -authAddIEChallengeText ( - IN P_ADAPTER_T prAdapter, - IN OUT P_MSDU_INFO_T prMsduInfo - ) -{ - P_WLAN_AUTH_FRAME_T prAuthFrame; - P_STA_RECORD_T prStaRec; - UINT_16 u2TransactionSeqNum; - - - ASSERT(prMsduInfo); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - if(!prStaRec) { - return; - } - - ASSERT(prStaRec); - - /* For Management, frame header and payload are in a continuous buffer */ - prAuthFrame = (P_WLAN_AUTH_FRAME_T)prMsduInfo->prPacket; - - WLAN_GET_FIELD_16(&prAuthFrame->u2AuthTransSeqNo, &u2TransactionSeqNum) - - /* Only consider SEQ_3 for Challenge Text */ - if ((u2TransactionSeqNum == AUTH_TRANSACTION_SEQ_3) && - (prStaRec->ucAuthAlgNum == AUTH_ALGORITHM_NUM_SHARED_KEY) && - (prStaRec->prChallengeText != NULL)) { - - COPY_IE(((UINT_32)(prMsduInfo->prPacket) + prMsduInfo->u2FrameLength), - (prStaRec->prChallengeText)); - - prMsduInfo->u2FrameLength += IE_SIZE(prStaRec->prChallengeText); - } - - return; - -} /* end of authAddIEChallengeText() */ - - -#if !CFG_SUPPORT_AAA -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will send the Authenticiation frame -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* @param[in] u2TransactionSeqNum Transaction Sequence Number -* -* @retval WLAN_STATUS_RESOURCES No available resource for frame composing. -* @retval WLAN_STATUS_SUCCESS Successfully send frame to TX Module -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -authSendAuthFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN UINT_16 u2TransactionSeqNum - ) -{ - P_MSDU_INFO_T prMsduInfo; - P_BSS_INFO_T prBssInfo; - UINT_16 u2EstimatedFrameLen; - UINT_16 u2EstimatedExtraIELen; - UINT_16 u2PayloadLen; - UINT_32 i; - - - DBGLOG(SAA, LOUD, ("Send Auth Frame\n")); - - ASSERT(prStaRec); - - //4 <1> Allocate a PKT_INFO_T for Authentication Frame - /* Init with MGMT Header Length + Length of Fixed Fields */ - u2EstimatedFrameLen = (MAC_TX_RESERVED_FIELD + - WLAN_MAC_MGMT_HEADER_LEN + - AUTH_ALGORITHM_NUM_FIELD_LEN + - AUTH_TRANSACTION_SEQENCE_NUM_FIELD_LEN + - STATUS_CODE_FIELD_LEN); - - /* + Extra IE Length */ - u2EstimatedExtraIELen = 0; - - for (i = 0; i < sizeof(txAuthIETable)/sizeof(APPEND_IE_ENTRY_T); i++) { - u2EstimatedExtraIELen += txAuthIETable[i].u2EstimatedIELen; - } - - u2EstimatedFrameLen += u2EstimatedExtraIELen; - - /* Allocate a MSDU_INFO_T */ - if ( (prMsduInfo = cnmMgtPktAlloc(prAdapter, u2EstimatedFrameLen)) == NULL) { - DBGLOG(SAA, WARN, ("No PKT_INFO_T for sending Auth Frame.\n")); - return WLAN_STATUS_RESOURCES; - } - - //4 <2> Compose Authentication Request frame header and fixed fields in MSDU_INfO_T. - ASSERT(prStaRec->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]); - - /* Compose Header and some Fixed Fields */ - authComposeAuthFrameHeaderAndFF( - (PUINT_8)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD), - prStaRec->aucMacAddr, - prBssInfo->aucOwnMacAddr, - prStaRec->ucAuthAlgNum, - u2TransactionSeqNum, - STATUS_CODE_RESERVED); - - u2PayloadLen = (AUTH_ALGORITHM_NUM_FIELD_LEN + - AUTH_TRANSACTION_SEQENCE_NUM_FIELD_LEN + - STATUS_CODE_FIELD_LEN); - - //4 <3> Update information of MSDU_INFO_T - prMsduInfo->eSrc = TX_PACKET_MGMT; - prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_MGMT; - prMsduInfo->ucStaRecIndex = prStaRec->ucIndex; - prMsduInfo->ucNetworkType = prStaRec->ucNetTypeIndex; - prMsduInfo->ucMacHeaderLength = WLAN_MAC_MGMT_HEADER_LEN; - prMsduInfo->fgIs802_1x = FALSE; - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = WLAN_MAC_MGMT_HEADER_LEN + u2PayloadLen; - prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMsduInfo->pfTxDoneHandler = saaFsmRunEventTxDone; - prMsduInfo->fgIsBasicRate = TRUE; - - //4 <4> Compose IEs in MSDU_INFO_T - for (i = 0; i < sizeof(txAuthIETable)/sizeof(APPEND_IE_ENTRY_T); i++) { - if (txAuthIETable[i].pfnAppendIE) { - txAuthIETable[i].pfnAppendIE(prAdapter, prMsduInfo); - } - } - - /* TODO(Kevin): Also release the unused tail room of the composed MMPDU */ - - //4 <6> Inform TXM to send this Authentication frame. - nicTxEnqueueMsdu(prAdapter, prMsduInfo); - - return WLAN_STATUS_SUCCESS; -} /* end of authSendAuthFrame() */ - -#else - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will send the Authenticiation frame -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* @param[in] u2TransactionSeqNum Transaction Sequence Number -* -* @retval WLAN_STATUS_RESOURCES No available resource for frame composing. -* @retval WLAN_STATUS_SUCCESS Successfully send frame to TX Module -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -authSendAuthFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_SW_RFB_T prFalseAuthSwRfb, - IN UINT_16 u2TransactionSeqNum, - IN UINT_16 u2StatusCode - ) -{ - PUINT_8 pucReceiveAddr; - PUINT_8 pucTransmitAddr; - P_MSDU_INFO_T prMsduInfo; - P_BSS_INFO_T prBssInfo; - /*get from input parameter*/ - //ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex = NETWORK_TYPE_AIS_INDEX; - PFN_TX_DONE_HANDLER pfTxDoneHandler = (PFN_TX_DONE_HANDLER)NULL; - UINT_16 u2EstimatedFrameLen; - UINT_16 u2EstimatedExtraIELen; - UINT_16 u2PayloadLen; - UINT_16 ucAuthAlgNum; - UINT_32 i; - - - DBGLOG(SAA, LOUD, ("Send Auth Frame %d, Status Code = %d\n", - u2TransactionSeqNum, u2StatusCode)); - - //4 <1> Allocate a PKT_INFO_T for Authentication Frame - /* Init with MGMT Header Length + Length of Fixed Fields */ - u2EstimatedFrameLen = (MAC_TX_RESERVED_FIELD + - WLAN_MAC_MGMT_HEADER_LEN + - AUTH_ALGORITHM_NUM_FIELD_LEN + - AUTH_TRANSACTION_SEQENCE_NUM_FIELD_LEN + - STATUS_CODE_FIELD_LEN); - - /* + Extra IE Length */ - u2EstimatedExtraIELen = 0; - - for (i = 0; i < sizeof(txAuthIETable)/sizeof(APPEND_IE_ENTRY_T); i++) { - u2EstimatedExtraIELen += txAuthIETable[i].u2EstimatedIELen; - } - - u2EstimatedFrameLen += u2EstimatedExtraIELen; - - /* Allocate a MSDU_INFO_T */ - if ( (prMsduInfo = cnmMgtPktAlloc(prAdapter, u2EstimatedFrameLen)) == NULL) { - DBGLOG(SAA, WARN, ("No PKT_INFO_T for sending Auth Frame.\n")); - return WLAN_STATUS_RESOURCES; - } - - //4 <2> Compose Authentication Request frame header and fixed fields in MSDU_INfO_T. - if (prStaRec) { - ASSERT(prStaRec->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]); - - pucTransmitAddr = prBssInfo->aucOwnMacAddr; - - pucReceiveAddr = prStaRec->aucMacAddr; - - ucAuthAlgNum = prStaRec->ucAuthAlgNum; - - switch (u2TransactionSeqNum) { - case AUTH_TRANSACTION_SEQ_1: - case AUTH_TRANSACTION_SEQ_3: - pfTxDoneHandler = saaFsmRunEventTxDone; - break; - - case AUTH_TRANSACTION_SEQ_2: - case AUTH_TRANSACTION_SEQ_4: - pfTxDoneHandler = aaaFsmRunEventTxDone; - break; - } - - } - else { /* For Error Status Code */ - P_WLAN_AUTH_FRAME_T prFalseAuthFrame; - - - ASSERT(prFalseAuthSwRfb); - prFalseAuthFrame = (P_WLAN_AUTH_FRAME_T)prFalseAuthSwRfb->pvHeader; - - ASSERT(u2StatusCode != STATUS_CODE_SUCCESSFUL); - - pucTransmitAddr = prFalseAuthFrame->aucDestAddr; - - pucReceiveAddr = prFalseAuthFrame->aucSrcAddr; - - ucAuthAlgNum = prFalseAuthFrame->u2AuthAlgNum; - - u2TransactionSeqNum = (prFalseAuthFrame->u2AuthTransSeqNo + 1); - } - - /* Compose Header and some Fixed Fields */ - authComposeAuthFrameHeaderAndFF((PUINT_8)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD), - pucReceiveAddr, - pucTransmitAddr, - ucAuthAlgNum, - u2TransactionSeqNum, - u2StatusCode); - - u2PayloadLen = (AUTH_ALGORITHM_NUM_FIELD_LEN + - AUTH_TRANSACTION_SEQENCE_NUM_FIELD_LEN + - STATUS_CODE_FIELD_LEN); - - //4 <3> Update information of MSDU_INFO_T - prMsduInfo->eSrc = TX_PACKET_MGMT; - prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_MGMT; - if(prStaRec) { - prMsduInfo->ucStaRecIndex = prStaRec->ucIndex; - } - else { - prMsduInfo->ucStaRecIndex = STA_REC_INDEX_NOT_FOUND; //false Auth frame - } - prMsduInfo->ucNetworkType = (UINT_8)eNetTypeIndex; - prMsduInfo->ucMacHeaderLength = WLAN_MAC_MGMT_HEADER_LEN; - prMsduInfo->fgIs802_1x = FALSE; - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = WLAN_MAC_MGMT_HEADER_LEN + u2PayloadLen; - prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMsduInfo->pfTxDoneHandler = pfTxDoneHandler; - prMsduInfo->fgIsBasicRate = TRUE; - - //4 <4> Compose IEs in MSDU_INFO_T - for (i = 0; i < sizeof(txAuthIETable)/sizeof(APPEND_IE_ENTRY_T); i++) { - if (txAuthIETable[i].pfnAppendIE) { - txAuthIETable[i].pfnAppendIE(prAdapter, prMsduInfo); - } - } - - /* TODO(Kevin): Also release the unused tail room of the composed MMPDU */ - - //4 <6> Inform TXM to send this Authentication frame. - nicTxEnqueueMsdu(prAdapter, prMsduInfo); - - return WLAN_STATUS_SUCCESS; -} /* end of authSendAuthFrame() */ - -#endif /* CFG_SUPPORT_AAA */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will strictly check the TX Authentication frame for SAA/AAA event -* handling. -* -* @param[in] prMsduInfo Pointer of MSDU_INFO_T -* @param[in] u2TransactionSeqNum Transaction Sequence Number -* -* @retval WLAN_STATUS_FAILURE This is not the frame we should handle at current state. -* @retval WLAN_STATUS_SUCCESS This is the frame we should handle. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -authCheckTxAuthFrame ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN UINT_16 u2TransactionSeqNum - ) -{ - P_WLAN_AUTH_FRAME_T prAuthFrame; - P_STA_RECORD_T prStaRec; - UINT_16 u2TxFrameCtrl; - UINT_16 u2TxAuthAlgNum; - UINT_16 u2TxTransactionSeqNum; - - - ASSERT(prMsduInfo); - - prAuthFrame = (P_WLAN_AUTH_FRAME_T)(prMsduInfo->prPacket); - ASSERT(prAuthFrame); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - ASSERT(prStaRec); - - if(!prStaRec) { - return WLAN_STATUS_INVALID_PACKET; - } - - //WLAN_GET_FIELD_16(&prAuthFrame->u2FrameCtrl, &u2TxFrameCtrl) - u2TxFrameCtrl = prAuthFrame->u2FrameCtrl; // NOTE(Kevin): Optimized for ARM - u2TxFrameCtrl &= MASK_FRAME_TYPE; - if (u2TxFrameCtrl != MAC_FRAME_AUTH) { - return WLAN_STATUS_FAILURE; - } - - //WLAN_GET_FIELD_16(&prAuthFrame->u2AuthAlgNum, &u2TxAuthAlgNum) - u2TxAuthAlgNum = prAuthFrame->u2AuthAlgNum; // NOTE(Kevin): Optimized for ARM - if (u2TxAuthAlgNum != (UINT_16)(prStaRec->ucAuthAlgNum)) { - return WLAN_STATUS_FAILURE; - } - - //WLAN_GET_FIELD_16(&prAuthFrame->u2AuthTransSeqNo, &u2TxTransactionSeqNum) - u2TxTransactionSeqNum = prAuthFrame->u2AuthTransSeqNo; // NOTE(Kevin): Optimized for ARM - if (u2TxTransactionSeqNum != u2TransactionSeqNum) { - return WLAN_STATUS_FAILURE; - } - - return WLAN_STATUS_SUCCESS; - -} /* end of authCheckTxAuthFrame() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will check the incoming Auth Frame's Transaction Sequence -* Number before delivering it to the corresponding SAA or AAA Module. -* -* @param[in] prSwRfb Pointer to the SW_RFB_T structure. -* -* @retval WLAN_STATUS_SUCCESS Always not retain authentication frames -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -authCheckRxAuthFrameTransSeq ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_WLAN_AUTH_FRAME_T prAuthFrame; - UINT_16 u2RxTransactionSeqNum; - - - ASSERT(prSwRfb); - - //4 <1> locate the Authentication Frame. - prAuthFrame = (P_WLAN_AUTH_FRAME_T) prSwRfb->pvHeader; - - //4 <2> Parse the Header of Authentication Frame. - if ((prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen) < (AUTH_ALGORITHM_NUM_FIELD_LEN + - AUTH_TRANSACTION_SEQENCE_NUM_FIELD_LEN + - STATUS_CODE_FIELD_LEN)) { - ASSERT(0); - return WLAN_STATUS_SUCCESS; - } - - //4 <3> Parse the Fixed Fields of Authentication Frame Body. - //WLAN_GET_FIELD_16(&prAuthFrame->u2AuthTransSeqNo, &u2RxTransactionSeqNum); - u2RxTransactionSeqNum = prAuthFrame->u2AuthTransSeqNo; // NOTE(Kevin): Optimized for ARM - - switch (u2RxTransactionSeqNum) { - case AUTH_TRANSACTION_SEQ_2: - case AUTH_TRANSACTION_SEQ_4: - saaFsmRunEventRxAuth(prAdapter, prSwRfb); - break; - - case AUTH_TRANSACTION_SEQ_1: - case AUTH_TRANSACTION_SEQ_3: -#if CFG_SUPPORT_AAA - aaaFsmRunEventRxAuth(prAdapter, prSwRfb); -#endif /* CFG_SUPPORT_AAA */ - break; - - default: - DBGLOG(SAA, WARN, ("Strange Authentication Packet: Auth Trans Seq No = %d, Error Status Code = %d\n", - u2RxTransactionSeqNum, prAuthFrame->u2StatusCode)); - break; - } - - return WLAN_STATUS_SUCCESS; - -} /* end of authCheckRxAuthFrameTransSeq() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will validate the incoming Authentication Frame and take -* the status code out. -* -* @param[in] prSwRfb Pointer to SW RFB data structure. -* @param[in] u2TransactionSeqNum Transaction Sequence Number -* @param[out] pu2StatusCode Pointer to store the Status Code from Authentication. -* -* @retval WLAN_STATUS_FAILURE This is not the frame we should handle at current state. -* @retval WLAN_STATUS_SUCCESS This is the frame we should handle. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -authCheckRxAuthFrameStatus ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN UINT_16 u2TransactionSeqNum, - OUT PUINT_16 pu2StatusCode - ) -{ - P_STA_RECORD_T prStaRec; - P_WLAN_AUTH_FRAME_T prAuthFrame; - UINT_16 u2RxAuthAlgNum; - UINT_16 u2RxTransactionSeqNum; - //UINT_16 u2RxStatusCode; // NOTE(Kevin): Optimized for ARM - - - ASSERT(prSwRfb); - ASSERT(pu2StatusCode); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - ASSERT(prStaRec); - - if(!prStaRec) { - return WLAN_STATUS_INVALID_PACKET; - } - - //4 <1> locate the Authentication Frame. - prAuthFrame = (P_WLAN_AUTH_FRAME_T) prSwRfb->pvHeader; - - //4 <2> Parse the Fixed Fields of Authentication Frame Body. - //WLAN_GET_FIELD_16(&prAuthFrame->u2AuthAlgNum, &u2RxAuthAlgNum); - u2RxAuthAlgNum = prAuthFrame->u2AuthAlgNum; // NOTE(Kevin): Optimized for ARM - if (u2RxAuthAlgNum != (UINT_16)prStaRec->ucAuthAlgNum) { - DBGLOG(SAA, LOUD, ("Discard Auth frame with auth type = %d, current = %d\n", - u2RxAuthAlgNum, prStaRec->ucAuthAlgNum)); - return WLAN_STATUS_FAILURE; - } - - //WLAN_GET_FIELD_16(&prAuthFrame->u2AuthTransSeqNo, &u2RxTransactionSeqNum); - u2RxTransactionSeqNum = prAuthFrame->u2AuthTransSeqNo; // NOTE(Kevin): Optimized for ARM - if (u2RxTransactionSeqNum != u2TransactionSeqNum) { - DBGLOG(SAA, LOUD, ("Discard Auth frame with Transaction Seq No = %d\n", - u2RxTransactionSeqNum)); - return WLAN_STATUS_FAILURE; - } - - //4 <3> Get the Status code - //WLAN_GET_FIELD_16(&prAuthFrame->u2StatusCode, &u2RxStatusCode); - //*pu2StatusCode = u2RxStatusCode; - *pu2StatusCode = prAuthFrame->u2StatusCode; // NOTE(Kevin): Optimized for ARM - - return WLAN_STATUS_SUCCESS; - -} /* end of authCheckRxAuthFrameStatus() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will handle the Challenge Text IE from the Authentication frame -* -* @param[in] prSwRfb Pointer to SW RFB data structure. -* @param[in] prIEHdr Pointer to start address of IE -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -authHandleIEChallengeText ( - P_ADAPTER_T prAdapter, - P_SW_RFB_T prSwRfb, - P_IE_HDR_T prIEHdr - ) -{ - P_WLAN_AUTH_FRAME_T prAuthFrame; - P_STA_RECORD_T prStaRec; - UINT_16 u2TransactionSeqNum; - - - ASSERT(prSwRfb); - ASSERT(prIEHdr); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - ASSERT(prStaRec); - - if(!prStaRec) { - return; - } - - /* For Management, frame header and payload are in a continuous buffer */ - prAuthFrame = (P_WLAN_AUTH_FRAME_T)prSwRfb->pvHeader; - - //WLAN_GET_FIELD_16(&prAuthFrame->u2AuthTransSeqNo, &u2TransactionSeqNum) - u2TransactionSeqNum = prAuthFrame->u2AuthTransSeqNo; // NOTE(Kevin): Optimized for ARM - - /* Only consider SEQ_2 for Challenge Text */ - if ((u2TransactionSeqNum == AUTH_TRANSACTION_SEQ_2) && - (prStaRec->ucAuthAlgNum == AUTH_ALGORITHM_NUM_SHARED_KEY)) { - - /* Free previous allocated TCM memory */ - if (prStaRec->prChallengeText) { - ASSERT(0); - cnmMemFree(prAdapter, prStaRec->prChallengeText); - prStaRec->prChallengeText = (P_IE_CHALLENGE_TEXT_T)NULL; - } - - if ( ( prStaRec->prChallengeText = cnmMemAlloc(prAdapter, RAM_TYPE_MSG, IE_SIZE(prIEHdr)) ) == NULL) { - return; - } - - /* Save the Challenge Text from Auth Seq 2 Frame, before sending Auth Seq 3 Frame */ - COPY_IE(prStaRec->prChallengeText, prIEHdr); - } - - return; - -} /* end of authAddIEChallengeText() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will parse and process the incoming Authentication frame. -* -* @param[in] prSwRfb Pointer to SW RFB data structure. -* -* @retval WLAN_STATUS_SUCCESS This is the frame we should handle. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -authProcessRxAuth2_Auth4Frame ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_WLAN_AUTH_FRAME_T prAuthFrame; - PUINT_8 pucIEsBuffer; - UINT_16 u2IEsLen; - UINT_16 u2Offset; - UINT_8 ucIEID; - UINT_32 i; - - - ASSERT(prSwRfb); - - prAuthFrame = (P_WLAN_AUTH_FRAME_T) prSwRfb->pvHeader; - - pucIEsBuffer = &prAuthFrame->aucInfoElem[0]; - u2IEsLen = (prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen) - - (AUTH_ALGORITHM_NUM_FIELD_LEN + - AUTH_TRANSACTION_SEQENCE_NUM_FIELD_LEN + - STATUS_CODE_FIELD_LEN); - - IE_FOR_EACH(pucIEsBuffer, u2IEsLen, u2Offset) { - ucIEID = IE_ID(pucIEsBuffer); - - for (i = 0; i < (sizeof(rxAuthIETable) / sizeof(HANDLE_IE_ENTRY_T)); i++) { - - if (ucIEID == rxAuthIETable[i].ucElemID) { - rxAuthIETable[i].pfnHandleIE(prAdapter, prSwRfb, (P_IE_HDR_T)pucIEsBuffer); - } - } - } - - return WLAN_STATUS_SUCCESS; - -} /* end of authProcessRxAuth2_Auth4Frame() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will compose the Deauthentication frame -* -* @param[in] pucBuffer Pointer to the frame buffer. -* @param[in] aucPeerMACAddress Given Peer MAC Address. -* @param[in] aucMACAddress Given Our MAC Address. -* @param[in] u2StatusCode Status Code -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -authComposeDeauthFrameHeaderAndFF ( - IN PUINT_8 pucBuffer, - IN UINT_8 aucPeerMACAddress[], - IN UINT_8 aucMACAddress[], - IN UINT_8 aucBssid[], - IN UINT_16 u2ReasonCode - ) -{ - P_WLAN_DEAUTH_FRAME_T prDeauthFrame; - UINT_16 u2FrameCtrl; - - ASSERT(pucBuffer); - ASSERT(aucPeerMACAddress); - ASSERT(aucMACAddress); - ASSERT(aucBssid); - - prDeauthFrame = (P_WLAN_DEAUTH_FRAME_T)pucBuffer; - - //4 <1> Compose the frame header of the Deauthentication frame. - /* Fill the Frame Control field. */ - u2FrameCtrl = MAC_FRAME_DEAUTH; - - //WLAN_SET_FIELD_16(&prDeauthFrame->u2FrameCtrl, u2FrameCtrl); - prDeauthFrame->u2FrameCtrl = u2FrameCtrl; // NOTE(Kevin): Optimized for ARM - - /* Fill the DA field with Target BSSID. */ - COPY_MAC_ADDR(prDeauthFrame->aucDestAddr, aucPeerMACAddress); - - /* Fill the SA field with our MAC Address. */ - COPY_MAC_ADDR(prDeauthFrame->aucSrcAddr, aucMACAddress); - - /* Fill the BSSID field with Target BSSID. */ - COPY_MAC_ADDR(prDeauthFrame->aucBSSID, aucBssid); - - /* Clear the SEQ/FRAG_NO field(HW won't overide the FRAG_NO, so we need to clear it). */ - prDeauthFrame->u2SeqCtrl = 0; - - //4 <2> Compose the frame body's fixed field part of the Authentication frame. - /* Fill the Status Code field. */ - //WLAN_SET_FIELD_16(&prDeauthFrame->u2ReasonCode, u2ReasonCode); - prDeauthFrame->u2ReasonCode = u2ReasonCode; // NOTE(Kevin): Optimized for ARM - - return; -} /* end of authComposeDeauthFrameHeaderAndFF() */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will send the Deauthenticiation frame -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* @param[in] prClassErrSwRfb Pointer to the SW_RFB_T which is Class Error. -* @param[in] u2ReasonCode A reason code to indicate why to leave BSS. -* @param[in] pfTxDoneHandler TX Done call back function -* -* @retval WLAN_STATUS_RESOURCES No available resource for frame composing. -* @retval WLAN_STATUS_SUCCESS Successfully send frame to TX Module -* @retval WLAN_STATUS_FAILURE Didn't send Deauth frame for various reasons. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -authSendDeauthFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prClassErrSwRfb, - IN UINT_16 u2ReasonCode, - IN PFN_TX_DONE_HANDLER pfTxDoneHandler - ) -{ - P_WLAN_MAC_HEADER_A4_T prWlanMacHeader = NULL; - PUINT_8 pucReceiveAddr; - PUINT_8 pucTransmitAddr; - PUINT_8 pucBssid = NULL; - - ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex = NETWORK_TYPE_AIS_INDEX; - P_MSDU_INFO_T prMsduInfo; - UINT_16 u2EstimatedFrameLen; - UINT_16 u2RxFrameCtrl; - P_BSS_INFO_T prBssInfo; - - P_DEAUTH_INFO_T prDeauthInfo; - OS_SYSTIME rCurrentTime; - INT_32 i4NewEntryIndex, i; - UINT_8 ucStaRecIdx = STA_REC_INDEX_NOT_FOUND; - -#if CFG_ENABLE_WIFI_DIRECT - UINT_8 aucBMC[] = BC_MAC_ADDR; -#endif - - /* NOTE(Kevin): The best way to reply the Deauth is according to the incoming data - * frame - */ - //4 <1> Find the Receiver Address first. - if (prClassErrSwRfb) { - BOOLEAN fgIsAbleToSendDeauth = FALSE; - - prWlanMacHeader = (P_WLAN_MAC_HEADER_A4_T) prClassErrSwRfb->pvHeader; - - //WLAN_GET_FIELD_16(&prWlanMacHeader->u2FrameCtrl, &u2RxFrameCtrl); - u2RxFrameCtrl = prWlanMacHeader->u2FrameCtrl; // NOTE(Kevin): Optimized for ARM - - /* TODO(Kevin): Currently we won't send Deauth for IBSS node. How about DLS ? */ - if ((prWlanMacHeader->u2FrameCtrl & MASK_TO_DS_FROM_DS) == 0) { - return WLAN_STATUS_FAILURE; - } - - /* Check if corresponding BSS is able to send Deauth */ - for (i = NETWORK_TYPE_AIS_INDEX; i < NETWORK_TYPE_INDEX_NUM; i++) { - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[i]); - - if (IS_NET_ACTIVE(prAdapter, i) && - (EQUAL_MAC_ADDR(prWlanMacHeader->aucAddr1, prBssInfo->aucOwnMacAddr))) { - { - fgIsAbleToSendDeauth = TRUE; - eNetTypeIndex = (ENUM_NETWORK_TYPE_INDEX_T)i; - break; - } - } - } - - if (!fgIsAbleToSendDeauth) { - return WLAN_STATUS_FAILURE; - } - - pucReceiveAddr = prWlanMacHeader->aucAddr2; - - } - else if (prStaRec) { - - pucReceiveAddr = prStaRec->aucMacAddr; - } - else { -#if CFG_ENABLE_WIFI_DIRECT - pucReceiveAddr = aucBMC; -#else - return WLAN_STATUS_FAILURE; -#endif - } - - //4 <2> Check if already send a Deauth frame in MIN_DEAUTH_INTERVAL_MSEC - GET_CURRENT_SYSTIME(&rCurrentTime); - - i4NewEntryIndex = -1; - for (i = 0; i < MAX_DEAUTH_INFO_COUNT; i++) { - prDeauthInfo = &(prAdapter->rWifiVar.arDeauthInfo[i]); - - - /* For continuously sending Deauth frame, the minimum interval is - * MIN_DEAUTH_INTERVAL_MSEC. - */ - if (CHECK_FOR_TIMEOUT(rCurrentTime, - prDeauthInfo->rLastSendTime, - MSEC_TO_SYSTIME(MIN_DEAUTH_INTERVAL_MSEC))) { - - i4NewEntryIndex = i; - } - else if (EQUAL_MAC_ADDR(pucReceiveAddr, prDeauthInfo->aucRxAddr) && - (!pfTxDoneHandler)) { - - return WLAN_STATUS_FAILURE; - } - } - - //4 <3> Update information. - if (i4NewEntryIndex > 0) { - - prDeauthInfo = &(prAdapter->rWifiVar.arDeauthInfo[i4NewEntryIndex]); - - COPY_MAC_ADDR(prDeauthInfo->aucRxAddr, pucReceiveAddr); - prDeauthInfo->rLastSendTime = rCurrentTime; - } - else { - /* NOTE(Kevin): for the case of AP mode, we may encounter this case - * if deauth all the associated clients. - */ - DBGLOG(SAA, WARN, ("No unused DEAUTH_INFO_T !\n")); - } - - //4 <4> Allocate a PKT_INFO_T for Deauthentication Frame - /* Init with MGMT Header Length + Length of Fixed Fields + IE Length */ - u2EstimatedFrameLen = (MAC_TX_RESERVED_FIELD + - WLAN_MAC_MGMT_HEADER_LEN + - REASON_CODE_FIELD_LEN); - - /* Allocate a MSDU_INFO_T */ - if ( (prMsduInfo = cnmMgtPktAlloc(prAdapter, u2EstimatedFrameLen)) == NULL) { - DBGLOG(SAA, WARN, ("No PKT_INFO_T for sending Deauth Request.\n")); - return WLAN_STATUS_RESOURCES; - } - - //4 <5> Find the Transmitter Address and BSSID. - if (prClassErrSwRfb) { - - /* The TA of Deauth is the A1 of RX frame */ - pucTransmitAddr = prWlanMacHeader->aucAddr1; - - switch (prWlanMacHeader->u2FrameCtrl & MASK_TO_DS_FROM_DS) { - - case MASK_FC_FROM_DS: - /* The BSSID of Deauth is the A2 of RX frame */ - pucBssid = prWlanMacHeader->aucAddr2; - break; - - case MASK_FC_TO_DS: - /* The BSSID of Deauth is the A1 of RX frame */ - pucBssid = prWlanMacHeader->aucAddr1; - break; - - case MASK_TO_DS_FROM_DS: - /* TODO(Kevin): Consider BOW, now we set the BSSID of Deauth - * to the A2 of RX frame for temporary solution. - */ - pucBssid = prWlanMacHeader->aucAddr2; - break; - - /* No Default */ - } - - } - else if (prStaRec) { - eNetTypeIndex = prStaRec->ucNetTypeIndex; - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[eNetTypeIndex]); - - pucTransmitAddr = prBssInfo->aucOwnMacAddr; - - pucBssid = prBssInfo->aucBSSID; - } -#if CFG_ENABLE_WIFI_DIRECT - else { - if (prAdapter->fgIsP2PRegistered) { - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - ucStaRecIdx = STA_REC_INDEX_BMCAST; - - pucTransmitAddr = prBssInfo->aucOwnMacAddr; - - pucBssid = prBssInfo->aucBSSID; - - eNetTypeIndex = NETWORK_TYPE_P2P_INDEX; - } - else { - return WLAN_STATUS_FAILURE; - } - } - -#endif - - //4 <6> compose Deauthentication frame header and some fixed fields */ - authComposeDeauthFrameHeaderAndFF( - (PUINT_8)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD), - pucReceiveAddr, - pucTransmitAddr, - pucBssid, - u2ReasonCode); - -#if CFG_SUPPORT_802_11W - if (rsnCheckBipKeyInstalled(prAdapter, prStaRec)) { - P_WLAN_DEAUTH_FRAME_T prDeauthFrame; - - prDeauthFrame = (P_WLAN_DEAUTH_FRAME_T)(PUINT_8)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD); - - prDeauthFrame->u2FrameCtrl |= MASK_FC_PROTECTED_FRAME; - DBGLOG(TX, WARN, ("authSendDeauthFrame with protection\n")); - } -#endif - - //4 <7> Update information of MSDU_INFO_T - prMsduInfo->eSrc = TX_PACKET_MGMT; - prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_MGMT; - prMsduInfo->ucStaRecIndex = ((prStaRec == NULL)?ucStaRecIdx:prStaRec->ucIndex); - prMsduInfo->ucNetworkType = (UINT_8)eNetTypeIndex; - prMsduInfo->ucMacHeaderLength = WLAN_MAC_MGMT_HEADER_LEN; - prMsduInfo->fgIs802_1x = FALSE; - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = WLAN_MAC_MGMT_HEADER_LEN + REASON_CODE_FIELD_LEN; - prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMsduInfo->pfTxDoneHandler = pfTxDoneHandler; - prMsduInfo->fgIsBasicRate = TRUE; - - //4 <8> Inform TXM to send this Deauthentication frame. - nicTxEnqueueMsdu(prAdapter, prMsduInfo); - - return WLAN_STATUS_SUCCESS; -} /* end of authSendDeauthFrame() */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will parse and process the incoming Deauthentication frame -* if the given BSSID is matched. -* -* @param[in] prSwRfb Pointer to SW RFB data structure. -* @param[in] aucBSSID Given BSSID -* @param[out] pu2ReasonCode Pointer to store the Reason Code from Deauthentication. -* -* @retval WLAN_STATUS_FAILURE This is not the frame we should handle at current state. -* @retval WLAN_STATUS_SUCCESS This is the frame we should handle. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -authProcessRxDeauthFrame ( - IN P_SW_RFB_T prSwRfb, - IN UINT_8 aucBSSID[], - OUT PUINT_16 pu2ReasonCode - ) -{ - P_WLAN_DEAUTH_FRAME_T prDeauthFrame; - UINT_16 u2RxReasonCode; - - - ASSERT(prSwRfb); - ASSERT(aucBSSID); - ASSERT(pu2ReasonCode); - - //4 <1> locate the Deauthentication Frame. - prDeauthFrame = (P_WLAN_DEAUTH_FRAME_T) prSwRfb->pvHeader; - - //4 <2> Parse the Header of Deauthentication Frame. -#if 0 // Kevin: Seems redundant - WLAN_GET_FIELD_16(&prDeauthFrame->u2FrameCtrl, &u2RxFrameCtrl) - u2RxFrameCtrl &= MASK_FRAME_TYPE; - if (u2RxFrameCtrl != MAC_FRAME_DEAUTH) { - return WLAN_STATUS_FAILURE; - } -#endif - - if ((prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen) < REASON_CODE_FIELD_LEN) { - ASSERT(0); - return WLAN_STATUS_FAILURE; - } - - /* Check if this Deauth Frame is coming from Target BSSID */ - if (UNEQUAL_MAC_ADDR(prDeauthFrame->aucBSSID, aucBSSID)) { - DBGLOG(SAA, LOUD, ("Ignore Deauth Frame from other BSS ["MACSTR"]\n", - MAC2STR(prDeauthFrame->aucSrcAddr))); - return WLAN_STATUS_FAILURE; - } - - //4 <3> Parse the Fixed Fields of Deauthentication Frame Body. - WLAN_GET_FIELD_16(&prDeauthFrame->u2ReasonCode, &u2RxReasonCode); - *pu2ReasonCode = u2RxReasonCode; - - return WLAN_STATUS_SUCCESS; - -} /* end of authProcessRxDeauthFrame() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will parse and process the incoming Authentication frame. -* -* @param[in] prSwRfb Pointer to SW RFB data structure. -* @param[in] aucExpectedBSSID Given Expected BSSID. -* @param[in] u2ExpectedAuthAlgNum Given Expected Authentication Algorithm Number -* @param[in] u2ExpectedTransSeqNum Given Expected Transaction Sequence Number. -* @param[out] pu2ReturnStatusCode Return Status Code. -* -* @retval WLAN_STATUS_SUCCESS This is the frame we should handle. -* @retval WLAN_STATUS_FAILURE The frame we will ignore. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -authProcessRxAuth1Frame ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN UINT_8 aucExpectedBSSID[], - IN UINT_16 u2ExpectedAuthAlgNum, - IN UINT_16 u2ExpectedTransSeqNum, - OUT PUINT_16 pu2ReturnStatusCode - ) -{ - P_WLAN_AUTH_FRAME_T prAuthFrame; - UINT_16 u2ReturnStatusCode = STATUS_CODE_SUCCESSFUL; - - - ASSERT(prSwRfb); - ASSERT(aucExpectedBSSID); - ASSERT(pu2ReturnStatusCode); - - //4 <1> locate the Authentication Frame. - prAuthFrame = (P_WLAN_AUTH_FRAME_T) prSwRfb->pvHeader; - - //4 <2> Check the BSSID - if (UNEQUAL_MAC_ADDR(prAuthFrame->aucBSSID, aucExpectedBSSID)) { - return WLAN_STATUS_FAILURE; /* Just Ignore this MMPDU */ - } - - //4 <3> Parse the Fixed Fields of Authentication Frame Body. - if (prAuthFrame->u2AuthAlgNum != u2ExpectedAuthAlgNum) { - u2ReturnStatusCode = STATUS_CODE_AUTH_ALGORITHM_NOT_SUPPORTED; - } - - if (prAuthFrame->u2AuthTransSeqNo != u2ExpectedTransSeqNum) { - u2ReturnStatusCode = STATUS_CODE_AUTH_OUT_OF_SEQ; - } - - *pu2ReturnStatusCode = u2ReturnStatusCode; - - return WLAN_STATUS_SUCCESS; - -} /* end of authProcessRxAuth1Frame() */ - - diff --git a/drivers/net/wireless/mt5931/mgmt/bss.c b/drivers/net/wireless/mt5931/mgmt/bss.c deleted file mode 100755 index 263f18b88eb7..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/bss.c +++ /dev/null @@ -1,2776 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/bss.c#3 $ -*/ - -/*! \file "bss.c" - \brief This file contains the functions for creating BSS(AP)/IBSS(AdHoc). - - This file contains the functions for BSS(AP)/IBSS(AdHoc). We may create a BSS/IBSS - network, or merge with exist IBSS network and sending Beacon Frame or reply - the Probe Response Frame for received Probe Request Frame. -*/ - - - -/* -** $Log: bss.c $ -** -** 08 29 2012 chinglan.wang -** [ALPS00349664] [6577JB][WIFI] Phone can not connect to AP secured with AES via WPS in 802.11n Only -** . -** -** 07 26 2012 yuche.tsai -** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot -** Update driver code of ALPS.JB for hot-spot. - * - * 07 17 2012 yuche.tsai - * NULL - * Let netdev bring up. - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 06 14 2012 chinglan.wang - * NULL - * Fix the losing of the HT IE in assoc request.. - * - * 06 13 2012 yuche.tsai - * NULL - * Update maintrunk driver. - * Add support for driver compose assoc request frame. - * - * 03 08 2012 yuche.tsai - * NULL - * Fix FW assert when start Hot-Spot. - * - * 03 02 2012 terry.wu - * NULL - * Snc CFG80211 modification for ICS migration from branch 2.2. - * - * 01 20 2012 chinglan.wang - * 03 02 2012 terry.wu - * NULL - * Fix the WPA-PSK TKIP and WPA2-PSK AES security mode bug. - * - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 01 15 2012 yuche.tsai - * NULL - * Fix wrong basic rate issue. - * - * 01 13 2012 yuche.tsai - * NULL - * WiFi Hot Spot Tethering for ICS ALPHA testing version. - * - * 11 03 2011 cm.chang - * [WCXRP00000997] [MT6620 Wi-Fi][Driver][FW] Handle change of BSS preamble type and slot time - * Always set short slot time to TRUE initially in AP mode - * - * 11 03 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * change the DBGLOG for "\n" and "\r\n". LABEL to LOUD for XLOG - * - * 09 14 2011 yuche.tsai - * NULL - * Add P2P IE in assoc response. - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 04 12 2011 eddie.chen - * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma - * Fix the sta index in processing security frame - * Simple flow control for TC4 to avoid mgt frames for PS STA to occupy the TC4 - * Add debug message. - * - * 04 08 2011 eddie.chen - * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma - * Fix for sigma - * - * 03 29 2011 eddie.chen - * [WCXRP00000608] [MT6620 Wi-Fi][DRV] Change wmm parameters in beacon - * Change wmm parameters in beacon. - * - * 03 29 2011 yuche.tsai - * [WCXRP00000607] [Volunteer Patch][MT6620][Driver] Coding Style Fix for klocwork scan. - * Fix klocwork issue. - * - * 03 19 2011 yuche.tsai - * [WCXRP00000581] [Volunteer Patch][MT6620][Driver] P2P IE in Assoc Req Issue - * Make assoc req to append P2P IE if wifi direct is enabled. - * - * 03 11 2011 chinglan.wang - * [WCXRP00000537] [MT6620 Wi-Fi][Driver] Can not connect to 802.11b/g/n mixed AP with WEP security. - * . - * - * 03 03 2011 george.huang - * [WCXRP00000508] [MT6620 Wi-Fi][Driver] aware of beacon MSDU will be free, after BSS deactivated - * . - * - * 03 03 2011 george.huang - * [WCXRP00000508] [MT6620 Wi-Fi][Driver] aware of beacon MSDU will be free, after BSS deactivated - * modify to handle if beacon MSDU been released when BSS deactivated - * - * 03 02 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * add code to let the beacon and probe response for Auto GO WSC . - * - * 03 02 2011 wh.su - * [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request - * Add code to send beacon and probe response WSC IE at Auto GO. - * - * 02 17 2011 eddie.chen - * [WCXRP00000458] [MT6620 Wi-Fi][Driver] BOW Concurrent - ProbeResp was exist in other channel - * 1) Chnage GetFrameAction decision when BSS is absent. - * 2) Check channel and resource in processing ProbeRequest - * - * 02 12 2011 yuche.tsai - * [WCXRP00000441] [Volunteer Patch][MT6620][Driver] BoW can not create desired station type when Hot Spot is enabled. - * bss should create station record type according to callers input. - * - * 02 11 2011 terry.wu - * [WCXRP00000383] [MT6620 Wi-Fi][Driver] Separate WiFi and P2P driver into two modules - * In p2p link function, check networktype before calling p2p function. - * - * 02 11 2011 terry.wu - * [WCXRP00000383] [MT6620 Wi-Fi][Driver] Separate WiFi and P2P driver into two modules - * Modify p2p link function to avoid assert. - * - * 01 26 2011 cm.chang - * [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument - * . - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Change Station Type in Station Record, Modify MACRO definition for getting station type & network type index & Role. - * - * 01 25 2011 eddie.chen - * [WCXRP00000385] [MT6620 Wi-Fi][DRV] Add destination decision for forwarding packets - * Fix the compile error in windows. - * - * 01 24 2011 eddie.chen - * [WCXRP00000385] [MT6620 Wi-Fi][DRV] Add destination decision for forwarding packets - * Add destination decision in AP mode. - * - * 01 24 2011 terry.wu - * [WCXRP00000383] [MT6620 Wi-Fi][Driver] Separate WiFi and P2P driver into two modules - * .Fix typo and missing entry - * - * 12 30 2010 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, - -Add per station flow control when STA is in PS - - - * Fix prBssInfo->aucCWminLog to prBssInfo->aucCWminLogForBcast - * - * 12 29 2010 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, - -Add per station flow control when STA is in PS - - - * Add WMM parameter for broadcast. - * - * 12 29 2010 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, -Add per station flow control when STA is in PS - - * 1) PS flow control event - * - * 2) WMM IE in beacon, assoc resp, probe resp - * - * 11 29 2010 cp.wu - * [WCXRP00000210] [MT6620 Wi-Fi][Driver][FW] Set RCPI value in STA_REC for initial TX rate selection of auto-rate algorithm - * update ucRcpi of STA_RECORD_T for AIS when - * 1) Beacons for IBSS merge is received - * 2) Associate Response for a connecting peer is received - * - * 10 18 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * use definition macro to replace hard-coded constant - * - * 10 08 2010 wh.su - * [WCXRP00000085] [MT6620 Wif-Fi] [Driver] update the modified p2p state machine - * update the frog's new p2p state machine. - * - * 09 28 2010 wh.su - * NULL - * [WCXRP00000069][MT6620 Wi-Fi][Driver] Fix some code for phase 1 P2P Demo. - * - * 09 27 2010 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000065] Update BoW design and settings - * Update BCM/BoW design and settings. - * - * 09 16 2010 cm.chang - * NULL - * Change conditional compiling options for BOW - * - * 09 10 2010 cm.chang - * NULL - * Always update Beacon content if FW sync OBSS info - * - * 09 07 2010 wh.su - * NULL - * adding the code for beacon/probe req/ probe rsp wsc ie at p2p. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 31 2010 kevin.huang - * NULL - * Use LINK LIST operation to process SCAN result - * - * 08 30 2010 cp.wu - * NULL - * eliminate klockwork errors - * - * 08 29 2010 yuche.tsai - * NULL - * Finish SLT TX/RX & Rate Changing Support. - * - * 08 24 2010 cm.chang - * NULL - * Support RLM initail channel of Ad-hoc, P2P and BOW - * - * 08 16 2010 yuche.tsai - * NULL - * Before composing Beacon IE, assign network type index for msdu info, - * this information is needed by RLM module while composing some RLM related IE field. - * - * 08 16 2010 cp.wu - * NULL - * Replace CFG_SUPPORT_BOW by CFG_ENABLE_BT_OVER_WIFI. - * There is no CFG_SUPPORT_BOW in driver domain source. - * - * 08 16 2010 kevin.huang - * NULL - * Refine AAA functions - * - * 08 12 2010 kevin.huang - * NULL - * Fix undefined pucDestAddr in bssUpdateBeaconContent() - * - * 08 12 2010 kevin.huang - * NULL - * Refine bssProcessProbeRequest() and bssSendBeaconProbeResponse() - * - * 08 11 2010 cp.wu - * NULL - * 1) do not use in-stack variable for beacon updating. (for MAUI porting) - * 2) extending scanning result to 64 instead of 48 - * - * 08 02 2010 yuche.tsai - * NULL - * P2P Group Negotiation Code Check in. - * - * 08 02 2010 george.huang - * NULL - * add WMM-PS test related OID/ CMD handlers - * - * 07 26 2010 yuche.tsai - * - * Add support to RX probe response for P2P. - * - * 07 20 2010 cp.wu - * - * 1) bugfix: do not stop timer for join after switched into normal_tr state, for providing chance for DHCP handshasking - * 2) modify rsnPerformPolicySelection() invoking - * - * 07 19 2010 wh.su - * - * update for security supporting. - * - * 07 19 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * when IBSS is being merged-in, send command packet to PM for connected indication - * - * 07 19 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * Add Ad-Hoc support to AIS-FSM - * - * 07 14 2010 yarco.yang - * - * 1. Remove CFG_MQM_MIGRATION - * 2. Add CMD_UPDATE_WMM_PARMS command - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 06 2010 george.huang - * [WPD00001556]Basic power managemenet function - * Update arguments for nicUpdateBeaconIETemplate() - * - * 06 29 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) sync to. CMD/EVENT document v0.03 - * 2) simplify DTIM period parsing in scan.c only, bss.c no longer parses it again. - * 3) send command packet to indicate FW-PM after - * a) 1st beacon is received after AIS has connected to an AP - * b) IBSS-ALONE has been created - * c) IBSS-MERGE has occured - * - * 06 28 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * send MMPDU in basic rate. - * - * 06 25 2010 george.huang - * [WPD00001556]Basic power managemenet function - * Create beacon update path, with expose bssUpdateBeaconContent() - * - * 06 21 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Fix compile error while enable WIFI_DIRECT support. - * - * 06 21 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Support CFG_MQM_MIGRATION flag - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * enable RX management frame handling. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * specify correct value for management frames. - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 15 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * correct when ADHOC support is turned on. - * - * 06 15 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add scan.c. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add management dispatching function table. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * auth.c is migrated. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * fix compilation error when WIFI_DIRECT is turned on - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add bss.c. - * - * 06 04 2010 george.huang - * [BORA00000678][MT6620]WiFi LP integration - * [PM] Support U-APSD for STA mode - * - * 05 28 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add ClientList handling API - bssClearClientList, bssAddStaRecToClientList - * - * 05 24 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Update bssProcessProbeRequest() to avoid redundant SSID IE {0,0} for IOT. - * - * 05 21 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Refine txmInitWtblTxRateTable() - set TX initial rate according to AP's operation rate set - * - * 05 18 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Ad-hoc Beacon should not carry HT OP and OBSS IEs - * - * 05 14 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Use TX MGMT Frame API for sending PS NULL frame to avoid the TX Burst Mechanism in TX FW Frame API - * - * 05 14 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Seperate Beacon and ProbeResp IE array - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add Power Management - Legacy PS-POLL support. - * - * 04 28 2010 tehuang.liu - * [BORA00000605][WIFISYS] Phase3 Integration - * Removed the use of compiling flag MQM_WMM_PARSING - * - * 04 27 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add Set Slot Time and Beacon Timeout Support for AdHoc Mode - * - * 04 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW - * - * 04 22 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * First draft code to support protection in AP mode - * - * 04 20 2010 kevin.huang - * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support - * Fix restart Beacon Timeout Func after connection diagnosis - * - * 04 19 2010 kevin.huang - * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support - * Add Beacon Timeout Support and will send Null frame to diagnose connection - * - * 04 16 2010 wh.su - * [BORA00000680][MT6620] Support the statistic for Microsoft os query - * adding the wpa-none for ibss beacon. - * - * 04 15 2010 wh.su - * [BORA00000680][MT6620] Support the statistic for Microsoft os query - * fixed the protected bit at cap info for ad-hoc. - * - * 03 18 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Rename the CFG flags - * - * 03 16 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add AdHoc Mode - * - * 02 26 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Update outgoing beacon's TX data rate - * - * 02 23 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add DTIM count update while TX Beacon - * - * 02 05 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Modify code due to define - BAND_24G and specific BSS_INFO_T was changed - * - * 02 05 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Revise data structure to share the same BSS_INFO_T for avoiding coding error - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ -#if (CFG_SUPPORT_ADHOC) || (CFG_SUPPORT_AAA) -APPEND_VAR_IE_ENTRY_T txBcnIETable[] = { - { (ELEM_HDR_LEN + (RATE_NUM - ELEM_MAX_LEN_SUP_RATES)), NULL, bssGenerateExtSuppRate_IE } /* 50 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_ERP), NULL, rlmRspGenerateErpIE } /* 42 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_HT_CAP), NULL, rlmRspGenerateHtCapIE } /* 45 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_HT_OP), NULL, rlmRspGenerateHtOpIE } /* 61 */ -#if CFG_ENABLE_WIFI_DIRECT - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_OBSS_SCAN), NULL, rlmRspGenerateObssScanIE } /* 74 */ -#endif - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_EXT_CAP), NULL, rlmRspGenerateExtCapIE } /* 127 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_WPA), NULL, rsnGenerateWpaNoneIE } /* 221 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_WMM_PARAM), NULL, mqmGenerateWmmParamIE } /* 221 */ -#if CFG_ENABLE_WIFI_DIRECT - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_WPA), NULL, rsnGenerateWPAIE } /* 221 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_RSN), NULL, rsnGenerateRSNIE } /* 48 */ -#if 0 //LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) - ,{ 0, p2pFuncCalculateExtra_IELenForBeacon, p2pFuncGenerateExtra_IEForBeacon } /* 221 */ -#else - ,{ 0, p2pFuncCalculateP2p_IELenForBeacon, p2pFuncGenerateP2p_IEForBeacon } /* 221 */ - ,{ 0, p2pFuncCalculateWSC_IELenForBeacon, p2pFuncGenerateWSC_IEForBeacon } /* 221 */ -#endif -#endif /* CFG_ENABLE_WIFI_DIRECT */ -}; - - -APPEND_VAR_IE_ENTRY_T txProbRspIETable[] = { - { (ELEM_HDR_LEN + (RATE_NUM - ELEM_MAX_LEN_SUP_RATES)), NULL, bssGenerateExtSuppRate_IE } /* 50 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_ERP), NULL, rlmRspGenerateErpIE } /* 42 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_HT_CAP), NULL, rlmRspGenerateHtCapIE } /* 45 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_HT_OP), NULL, rlmRspGenerateHtOpIE } /* 61 */ -#if CFG_ENABLE_WIFI_DIRECT - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_RSN), NULL, rsnGenerateRSNIE } /* 48 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_OBSS_SCAN), NULL, rlmRspGenerateObssScanIE } /* 74 */ -#endif - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_EXT_CAP), NULL, rlmRspGenerateExtCapIE } /* 127 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_WPA), NULL, rsnGenerateWpaNoneIE } /* 221 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_WMM_PARAM), NULL, mqmGenerateWmmParamIE } /* 221 */ -}; - -#endif /* CFG_SUPPORT_ADHOC || CFG_SUPPORT_AAA */ - - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/* Routines for all Operation Modes */ -/*----------------------------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will create or reset a STA_RECORD_T by given BSS_DESC_T for -* Infrastructure or AdHoc Mode. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] eStaType Assign STA Type for this STA_RECORD_T -* @param[in] eNetTypeIndex Assign Net Type Index for this STA_RECORD_T -* @param[in] prBssDesc Received Beacon/ProbeResp from this STA -* -* @retval Pointer to STA_RECORD_T -*/ -/*----------------------------------------------------------------------------*/ -P_STA_RECORD_T -bssCreateStaRecFromBssDesc ( - IN P_ADAPTER_T prAdapter, - IN ENUM_STA_TYPE_T eStaType, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_BSS_DESC_T prBssDesc - ) -{ - P_STA_RECORD_T prStaRec; - UINT_8 ucNonHTPhyTypeSet; - - - ASSERT(prBssDesc); - - //4 <1> Get a valid STA_RECORD_T - prStaRec = cnmGetStaRecByAddress(prAdapter, (UINT_8) eNetTypeIndex, - prBssDesc->aucSrcAddr); - if (!prStaRec) { - - prStaRec = cnmStaRecAlloc(prAdapter, (UINT_8) eNetTypeIndex); - - /* TODO(Kevin): Error handling of allocation of STA_RECORD_T for - * exhausted case and do removal of unused STA_RECORD_T. - */ - - if(!prStaRec) { - ASSERT(FALSE); - return NULL; - } - - ASSERT(prStaRec); - - prStaRec->ucJoinFailureCount = 0; - /* TODO(Kevin): If this is an old entry, we may also reset the ucJoinFailureCount to 0. - */ - - COPY_MAC_ADDR(prStaRec->aucMacAddr, prBssDesc->aucSrcAddr); - } - - - //4 <2> Setup STA TYPE and NETWORK - prStaRec->eStaType = eStaType; - - prStaRec->ucNetTypeIndex = eNetTypeIndex; - - - //4 <3> Update information from BSS_DESC_T to current P_STA_RECORD_T - prStaRec->u2CapInfo = prBssDesc->u2CapInfo; - - prStaRec->u2OperationalRateSet = prBssDesc->u2OperationalRateSet; - prStaRec->u2BSSBasicRateSet = prBssDesc->u2BSSBasicRateSet; - - prStaRec->ucPhyTypeSet = prBssDesc->ucPhyTypeSet; - - if (!((prAdapter->rWifiVar.rConnSettings.eEncStatus == ENUM_ENCRYPTION3_ENABLED) || - (prAdapter->rWifiVar.rConnSettings.eEncStatus == ENUM_ENCRYPTION3_KEY_ABSENT) || - (prAdapter->rWifiVar.rConnSettings.eEncStatus == ENUM_ENCRYPTION_DISABLED) || - (prAdapter->prGlueInfo->u2WSCAssocInfoIELen) || - (prAdapter->prGlueInfo->u2WapiAssocInfoIESz))) { - DBGLOG(BSS, INFO, ("Ignore the HT Bit for TKIP as pairwise cipher configed!\n")); - prStaRec->ucPhyTypeSet &= ~PHY_TYPE_BIT_HT; - } - - prStaRec->ucDesiredPhyTypeSet = prStaRec->ucPhyTypeSet & prAdapter->rWifiVar.ucAvailablePhyTypeSet; - - ucNonHTPhyTypeSet = prStaRec->ucDesiredPhyTypeSet & PHY_TYPE_SET_802_11ABG; - - /* Check for Target BSS's non HT Phy Types */ - if (ucNonHTPhyTypeSet) { - - if (ucNonHTPhyTypeSet & PHY_TYPE_BIT_ERP) { - prStaRec->ucNonHTBasicPhyType = PHY_TYPE_ERP_INDEX; - } - else if (ucNonHTPhyTypeSet & PHY_TYPE_BIT_OFDM) { - prStaRec->ucNonHTBasicPhyType = PHY_TYPE_OFDM_INDEX; - } - else /* if (ucNonHTPhyTypeSet & PHY_TYPE_HR_DSSS_INDEX) */ { - prStaRec->ucNonHTBasicPhyType = PHY_TYPE_HR_DSSS_INDEX; - } - - prStaRec->fgHasBasicPhyType = TRUE; - } - else { - /* Use mandatory for 11N only BSS */ - ASSERT(prStaRec->ucPhyTypeSet & PHY_TYPE_SET_802_11N); - - { - /* TODO(Kevin): which value should we set for 11n ? ERP ? */ - prStaRec->ucNonHTBasicPhyType = PHY_TYPE_HR_DSSS_INDEX; - } - - prStaRec->fgHasBasicPhyType = FALSE; - } - - /* Update non HT Desired Rate Set */ - { - P_CONNECTION_SETTINGS_T prConnSettings; - - - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - - prStaRec->u2DesiredNonHTRateSet = - (prStaRec->u2OperationalRateSet & prConnSettings->u2DesiredNonHTRateSet); - } - - //4 <4> Update information from BSS_DESC_T to current P_STA_RECORD_T - if (IS_AP_STA(prStaRec)) { - /* do not need to parse IE for DTIM, - * which have been parsed before inserting into BSS_DESC_T - */ - if (prBssDesc->ucDTIMPeriod) { - prStaRec->ucDTIMPeriod = prBssDesc->ucDTIMPeriod; - } - else { - prStaRec->ucDTIMPeriod = 0; // Means that TIM was not parsed. - } - } - - - //4 <5> Update default value - prStaRec->fgDiagnoseConnection = FALSE; - - - //4 <6> Update default value for other Modules - /* Determine fgIsWmmSupported and fgIsUapsdSupported in STA_REC */ - mqmProcessScanResult(prAdapter, prBssDesc, prStaRec); - - return prStaRec; - -} /* end of bssCreateStaRecFromBssDesc() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will compose the Null Data frame. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] pucBuffer Pointer to the frame buffer. -* @param[in] prStaRec Pointer to the STA_RECORD_T. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bssComposeNullFrame ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBuffer, - IN P_STA_RECORD_T prStaRec - ) -{ - P_WLAN_MAC_HEADER_T prNullFrame; - P_BSS_INFO_T prBssInfo; - UINT_16 u2FrameCtrl; - - - ASSERT(pucBuffer); - ASSERT(prStaRec); - ASSERT(prStaRec->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]); - - ASSERT(prBssInfo); - - prNullFrame = (P_WLAN_MAC_HEADER_T)pucBuffer; - - //4 <1> Decide the Frame Control Field - u2FrameCtrl = MAC_FRAME_NULL; - - if (IS_AP_STA(prStaRec)) { - u2FrameCtrl |= MASK_FC_TO_DS; - - if (prStaRec->fgSetPwrMgtBit) { - u2FrameCtrl |= MASK_FC_PWR_MGT; - } - } - else if (IS_CLIENT_STA(prStaRec)) { - u2FrameCtrl |= MASK_FC_FROM_DS; - } - else if (IS_DLS_STA(prStaRec)) { - /* TODO(Kevin) */ - } - else { - /* NOTE(Kevin): We won't send Null frame for IBSS */ - ASSERT(0); - return; - } - - //4 <2> Compose the Null frame - /* Fill the Frame Control field. */ - //WLAN_SET_FIELD_16(&prNullFrame->u2FrameCtrl, u2FrameCtrl); - prNullFrame->u2FrameCtrl = u2FrameCtrl; // NOTE(Kevin): Optimized for ARM - - /* Fill the Address 1 field with Target Peer Address. */ - COPY_MAC_ADDR(prNullFrame->aucAddr1, prStaRec->aucMacAddr); - - /* Fill the Address 2 field with our MAC Address. */ - COPY_MAC_ADDR(prNullFrame->aucAddr2, prBssInfo->aucOwnMacAddr); - - /* Fill the Address 3 field with Target BSSID. */ - COPY_MAC_ADDR(prNullFrame->aucAddr3, prBssInfo->aucBSSID); - - /* Clear the SEQ/FRAG_NO field(HW won't overide the FRAG_NO, so we need to clear it). */ - prNullFrame->u2SeqCtrl = 0; - - return; - -} /* end of bssComposeNullFrameHeader() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will compose the QoS Null Data frame. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] pucBuffer Pointer to the frame buffer. -* @param[in] prStaRec Pointer to the STA_RECORD_T. -* @param[in] ucUP User Priority. -* @param[in] fgSetEOSP Set the EOSP bit. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bssComposeQoSNullFrame ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBuffer, - IN P_STA_RECORD_T prStaRec, - IN UINT_8 ucUP, - IN BOOLEAN fgSetEOSP - ) -{ - P_WLAN_MAC_HEADER_QOS_T prQoSNullFrame; - P_BSS_INFO_T prBssInfo; - UINT_16 u2FrameCtrl; - UINT_16 u2QosControl; - - - ASSERT(pucBuffer); - ASSERT(prStaRec); - ASSERT(prStaRec->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]); - - ASSERT(prBssInfo); - - prQoSNullFrame = (P_WLAN_MAC_HEADER_QOS_T)pucBuffer; - - //4 <1> Decide the Frame Control Field - u2FrameCtrl = MAC_FRAME_QOS_NULL; - - if (IS_AP_STA(prStaRec)) { - u2FrameCtrl |= MASK_FC_TO_DS; - - if (prStaRec->fgSetPwrMgtBit) { - u2FrameCtrl |= MASK_FC_PWR_MGT; - } - } - else if (IS_CLIENT_STA(prStaRec)) { - u2FrameCtrl |= MASK_FC_FROM_DS; - } - else if (IS_DLS_STA(prStaRec)) { - /* TODO(Kevin) */ - } - else { - /* NOTE(Kevin): We won't send QoS Null frame for IBSS */ - ASSERT(0); - return; - } - - //4 <2> Compose the QoS Null frame - /* Fill the Frame Control field. */ - //WLAN_SET_FIELD_16(&prQoSNullFrame->u2FrameCtrl, u2FrameCtrl); - prQoSNullFrame->u2FrameCtrl = u2FrameCtrl; // NOTE(Kevin): Optimized for ARM - - /* Fill the Address 1 field with Target Peer Address. */ - COPY_MAC_ADDR(prQoSNullFrame->aucAddr1, prStaRec->aucMacAddr); - - /* Fill the Address 2 field with our MAC Address. */ - COPY_MAC_ADDR(prQoSNullFrame->aucAddr2, prBssInfo->aucOwnMacAddr); - - /* Fill the Address 3 field with Target BSSID. */ - COPY_MAC_ADDR(prQoSNullFrame->aucAddr3, prBssInfo->aucBSSID); - - /* Clear the SEQ/FRAG_NO field(HW won't overide the FRAG_NO, so we need to clear it). */ - prQoSNullFrame->u2SeqCtrl = 0; - - u2QosControl = (UINT_16)(ucUP & WMM_QC_UP_MASK); - - if (fgSetEOSP) { - u2QosControl |= WMM_QC_EOSP; - } - - //WLAN_SET_FIELD_16(&prQoSNullFrame->u2QosCtrl, u2QosControl); - prQoSNullFrame->u2QosCtrl = u2QosControl; // NOTE(Kevin): Optimized for ARM - - return; - -} /* end of bssComposeQoSNullFrameHeader() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Send the Null Frame -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prStaRec Pointer to the STA_RECORD_T -* @param[in] pfTxDoneHandler TX Done call back function -* -* @retval WLAN_STATUS_RESOURCE No available resources to send frame. -* @retval WLAN_STATUS_SUCCESS Succe]ss. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -bssSendNullFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN PFN_TX_DONE_HANDLER pfTxDoneHandler - ) -{ - P_MSDU_INFO_T prMsduInfo; - UINT_16 u2EstimatedFrameLen; - - - //4 <1> Allocate a PKT_INFO_T for Null Frame - /* Init with MGMT Header Length */ - u2EstimatedFrameLen = MAC_TX_RESERVED_FIELD + \ - WLAN_MAC_HEADER_LEN; - - /* Allocate a MSDU_INFO_T */ - if ( (prMsduInfo = cnmMgtPktAlloc(prAdapter, u2EstimatedFrameLen)) == NULL) { - DBGLOG(BSS, WARN, ("No PKT_INFO_T for sending Null Frame.\n")); - return WLAN_STATUS_RESOURCES; - } - - //4 <2> Compose Null frame in MSDU_INfO_T. - bssComposeNullFrame(prAdapter, - (PUINT_8)((UINT_32)prMsduInfo->prPacket + MAC_TX_RESERVED_FIELD), - prStaRec); -#if 0 - //4 <3> Update information of MSDU_INFO_T - TXM_SET_DATA_PACKET( \ - /* STA_REC ptr */ prStaRec, \ - /* MSDU_INFO ptr */ prMsduInfo, \ - /* MAC HDR ptr */ (prMsduInfo->pucBuffer + MAC_TX_RESERVED_FIELD), \ - /* MAC HDR length */ WLAN_MAC_HEADER_LEN, \ - /* PAYLOAD ptr */ (prMsduInfo->pucBuffer + MAC_TX_RESERVED_FIELD + WLAN_MAC_HEADER_LEN), \ - /* PAYLOAD length */ 0, \ - /* Network Type Index */(UINT_8)prStaRec->ucNetTypeIndex, \ - /* TID */ 0 /* BE: AC1 */, \ - /* Flag 802.11 */ TRUE,\ - /* Pkt arrival time */ 0 /* TODO: Obtain the system time */, \ - /* Resource TC */ 0 /* Irrelevant */, \ - /* Flag 802.1x */ FALSE,\ - /* TX-done callback */ pfTxDoneHandler, \ - /* PS forwarding type*/ PS_FORWARDING_TYPE_NON_PS, \ - /* PS Session ID */ 0 /* Irrelevant */, \ - /* Flag fixed rate */ TRUE, \ - /* Fixed tx rate */ g_aprBssInfo[prStaRec->ucNetTypeIndex]->ucHwDefaultFixedRateCode, \ - /* Fixed-rate retry */ BSS_DEFAULT_CONN_TEST_NULL_FRAME_RETRY_LIMIT, \ - /* PAL LLH */ 0 /* Irrelevant */,\ - /* ACL SN */ 0 /* Irrelevant */,\ - /* Flag No Ack */ FALSE \ - ); - - /* Terminate with a NULL pointer */ - NIC_HIF_TX_SET_NEXT_MSDU_INFO(prMsduInfo,NULL); - - /* TODO(Kevin): Also release the unused tail room of the composed MMPDU */ - - /* Indicate the packet to TXM */ - //4 <4> Inform TXM to send this Null frame. - txmSendFwDataPackets(prMsduInfo); -#endif - - prMsduInfo->eSrc = TX_PACKET_MGMT; - prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_DATA; - prMsduInfo->ucStaRecIndex = prStaRec->ucIndex; - prMsduInfo->ucNetworkType = prStaRec->ucNetTypeIndex; - prMsduInfo->ucMacHeaderLength = WLAN_MAC_HEADER_LEN; - prMsduInfo->fgIs802_1x = FALSE; - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = WLAN_MAC_HEADER_LEN; - prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMsduInfo->pfTxDoneHandler = pfTxDoneHandler; - prMsduInfo->fgIsBasicRate = FALSE; - - //4 <4> Inform TXM to send this Null frame. - nicTxEnqueueMsdu(prAdapter, prMsduInfo); - - return WLAN_STATUS_SUCCESS; - -} /* end of bssSendNullFrame() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Send the QoS Null Frame -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prStaRec Pointer to the STA_RECORD_T -* @param[in] pfTxDoneHandler TX Done call back function -* -* @retval WLAN_STATUS_RESOURCE No available resources to send frame. -* @retval WLAN_STATUS_SUCCESS Success. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -bssSendQoSNullFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN UINT_8 ucUP, - IN PFN_TX_DONE_HANDLER pfTxDoneHandler - ) -{ - P_MSDU_INFO_T prMsduInfo; - UINT_16 u2EstimatedFrameLen; - - - //4 <1> Allocate a PKT_INFO_T for Null Frame - /* Init with MGMT Header Length */ - u2EstimatedFrameLen = MAC_TX_RESERVED_FIELD + \ - WLAN_MAC_HEADER_QOS_LEN; - - /* Allocate a MSDU_INFO_T */ - if ( (prMsduInfo = cnmMgtPktAlloc(prAdapter, u2EstimatedFrameLen)) == NULL) { - DBGLOG(BSS, WARN, ("No PKT_INFO_T for sending Null Frame.\n")); - return WLAN_STATUS_RESOURCES; - } - - //4 <2> Compose Null frame in MSDU_INfO_T. - bssComposeQoSNullFrame(prAdapter, - (PUINT_8)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD), - prStaRec, - ucUP, - FALSE); -#if 0 - //4 <3> Update information of MSDU_INFO_T - TXM_SET_DATA_PACKET( \ - /* STA_REC ptr */ prStaRec, \ - /* MSDU_INFO ptr */ prMsduInfo, \ - /* MAC HDR ptr */ (prMsduInfo->pucBuffer + MAC_TX_RESERVED_FIELD), \ - /* MAC HDR length */ WLAN_MAC_HEADER_QOS_LEN, \ - /* PAYLOAD ptr */ (prMsduInfo->pucBuffer + MAC_TX_RESERVED_FIELD + WLAN_MAC_HEADER_QOS_LEN), \ - /* PAYLOAD length */ 0, \ - /* Network Type Index */(UINT_8)prStaRec->ucNetTypeIndex, \ - /* TID */ 0 /* BE: AC1 */, \ - /* Flag 802.11 */ TRUE,\ - /* Pkt arrival time */ 0 /* TODO: Obtain the system time */, \ - /* Resource TC */ 0 /* Irrelevant */, \ - /* Flag 802.1x */ FALSE,\ - /* TX-done callback */ pfTxDoneHandler, \ - /* PS forwarding type*/ PS_FORWARDING_TYPE_NON_PS, \ - /* PS Session ID */ 0 /* Irrelevant */, \ - /* Flag fixed rate */ TRUE, \ - /* Fixed tx rate */ g_aprBssInfo[prStaRec->ucNetTypeIndex]->ucHwDefaultFixedRateCode, \ - /* Fixed-rate retry */ TXM_DEFAULT_DATA_FRAME_RETRY_LIMIT, \ - /* PAL LLH */ 0 /* Irrelevant */,\ - /* ACL SN */ 0 /* Irrelevant */,\ - /* Flag No Ack */ FALSE \ - ); - - /* Terminate with a NULL pointer */ - NIC_HIF_TX_SET_NEXT_MSDU_INFO(prMsduInfo,NULL); - - /* TODO(Kevin): Also release the unused tail room of the composed MMPDU */ - - /* Indicate the packet to TXM */ - //4 <4> Inform TXM to send this Null frame. - txmSendFwDataPackets(prMsduInfo); -#endif - - prMsduInfo->eSrc = TX_PACKET_MGMT; - prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_MGMT; - prMsduInfo->ucStaRecIndex = prStaRec->ucIndex; - prMsduInfo->ucNetworkType = prStaRec->ucNetTypeIndex; - prMsduInfo->ucMacHeaderLength = WLAN_MAC_HEADER_QOS_LEN; - prMsduInfo->fgIs802_1x = FALSE; - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = WLAN_MAC_HEADER_QOS_LEN; - prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMsduInfo->pfTxDoneHandler = pfTxDoneHandler; - prMsduInfo->fgIsBasicRate = TRUE; - - //4 <4> Inform TXM to send this Null frame. - nicTxEnqueueMsdu(prAdapter, prMsduInfo); - - return WLAN_STATUS_SUCCESS; - -} /* end of bssSendQoSNullFrame() */ - - -#if (CFG_SUPPORT_ADHOC) || (CFG_SUPPORT_AAA) -/*----------------------------------------------------------------------------*/ -/* Routines for both IBSS(AdHoc) and BSS(AP) */ -/*----------------------------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to generate Information Elements of Extended -* Support Rate -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prMsduInfo Pointer to the composed MSDU_INFO_T. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bssGenerateExtSuppRate_IE ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - P_BSS_INFO_T prBssInfo; - PUINT_8 pucBuffer; - UINT_8 ucExtSupRatesLen; - - - ASSERT(prMsduInfo); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prMsduInfo->ucNetworkType]); - ASSERT(prBssInfo); - - pucBuffer = (PUINT_8)((UINT_32)prMsduInfo->prPacket + - (UINT_32)prMsduInfo->u2FrameLength); - ASSERT(pucBuffer); - - if (prBssInfo->ucAllSupportedRatesLen > ELEM_MAX_LEN_SUP_RATES) { - - ucExtSupRatesLen = prBssInfo->ucAllSupportedRatesLen - ELEM_MAX_LEN_SUP_RATES; - } - else { - ucExtSupRatesLen = 0; - } - - /* Fill the Extended Supported Rates element. */ - if (ucExtSupRatesLen) { - - EXT_SUP_RATES_IE(pucBuffer)->ucId = ELEM_ID_EXTENDED_SUP_RATES; - EXT_SUP_RATES_IE(pucBuffer)->ucLength = ucExtSupRatesLen; - - kalMemCopy(EXT_SUP_RATES_IE(pucBuffer)->aucExtSupportedRates, - &prBssInfo->aucAllSupportedRates[ELEM_MAX_LEN_SUP_RATES], - ucExtSupRatesLen); - - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - } - - return; -} /* end of bssGenerateExtSuppRate_IE() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to compose Common Information Elements for Beacon -* or Probe Response Frame. -* -* @param[in] prMsduInfo Pointer to the composed MSDU_INFO_T. -* @param[in] prBssInfo Pointer to the BSS_INFO_T. -* @param[in] pucDestAddr Pointer to the Destination Address, if NULL, means Beacon. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bssBuildBeaconProbeRespFrameCommonIEs ( - IN P_MSDU_INFO_T prMsduInfo, - IN P_BSS_INFO_T prBssInfo, - IN PUINT_8 pucDestAddr - ) -{ - PUINT_8 pucBuffer; - UINT_8 ucSupRatesLen; - - - ASSERT(prMsduInfo); - ASSERT(prBssInfo); - - pucBuffer = (PUINT_8)((UINT_32)prMsduInfo->prPacket + - (UINT_32)prMsduInfo->u2FrameLength); - ASSERT(pucBuffer); - - /* Compose the frame body of the Probe Response frame. */ - //4 <1> Fill the SSID element. - SSID_IE(pucBuffer)->ucId = ELEM_ID_SSID; - SSID_IE(pucBuffer)->ucLength = prBssInfo->ucSSIDLen; - if (prBssInfo->ucSSIDLen) { - kalMemCopy(SSID_IE(pucBuffer)->aucSSID, prBssInfo->aucSSID, prBssInfo->ucSSIDLen); - } - - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - pucBuffer += IE_SIZE(pucBuffer); - - - //4 <2> Fill the Supported Rates element. - if (prBssInfo->ucAllSupportedRatesLen > ELEM_MAX_LEN_SUP_RATES) { - - ucSupRatesLen = ELEM_MAX_LEN_SUP_RATES; - } - else { - ucSupRatesLen = prBssInfo->ucAllSupportedRatesLen; - } - - if (ucSupRatesLen) { - SUP_RATES_IE(pucBuffer)->ucId = ELEM_ID_SUP_RATES; - SUP_RATES_IE(pucBuffer)->ucLength = ucSupRatesLen; - kalMemCopy(SUP_RATES_IE(pucBuffer)->aucSupportedRates, - prBssInfo->aucAllSupportedRates, - ucSupRatesLen); - - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - pucBuffer += IE_SIZE(pucBuffer); - } - - - //4 <3> Fill the DS Parameter Set element. - if (prBssInfo->eBand == BAND_2G4) { - DS_PARAM_IE(pucBuffer)->ucId = ELEM_ID_DS_PARAM_SET; - DS_PARAM_IE(pucBuffer)->ucLength = ELEM_MAX_LEN_DS_PARAMETER_SET; - DS_PARAM_IE(pucBuffer)->ucCurrChnl = prBssInfo->ucPrimaryChannel; - - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - pucBuffer += IE_SIZE(pucBuffer); - } - - - //4 <4> IBSS Parameter Set element, ID: 6 - if (prBssInfo->eCurrentOPMode == OP_MODE_IBSS) { - IBSS_PARAM_IE(pucBuffer)->ucId = ELEM_ID_IBSS_PARAM_SET; - IBSS_PARAM_IE(pucBuffer)->ucLength = ELEM_MAX_LEN_IBSS_PARAMETER_SET; - WLAN_SET_FIELD_16(&(IBSS_PARAM_IE(pucBuffer)->u2ATIMWindow), prBssInfo->u2ATIMWindow); - - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - pucBuffer += IE_SIZE(pucBuffer); - } - - - //4 <5> TIM element, ID: 5 - if ((!pucDestAddr) && // For Beacon only. - (prBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT)) { - -#if CFG_ENABLE_WIFI_DIRECT - /*no fgIsP2PRegistered protect*/ - if (prBssInfo->ucNetTypeIndex == NETWORK_TYPE_P2P_INDEX) { -#if 0 - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo; - UINT_8 ucBitmapControl = 0; - UINT_32 u4N1, u4N2; - - - prP2pSpecificBssInfo = &(prAdapter->rWifiVar.rP2pSpecificBssInfo); - - // Clear existing value. - prP2pSpecificBssInfo->ucBitmapCtrl = 0; - kalMemZero(prP2pSpecificBssInfo->aucPartialVirtualBitmap, - sizeof(prP2pSpecificBssInfo->aucPartialVirtualBitmap)); - - - // IEEE 802.11 2007 - 7.3.2.6 - TIM_IE(pucBuffer)->ucId = ELEM_ID_TIM; - TIM_IE(pucBuffer)->ucDTIMCount = prBssInfo->ucDTIMCount; - TIM_IE(pucBuffer)->ucDTIMPeriod = prBssInfo->ucDTIMPeriod; - - // Setup DTIM Count for next TBTT. - if (prBssInfo->ucDTIMCount == 0) { - //3 *** pmQueryBufferedBCAST(); - } - - //3 *** pmQueryBufferedPSNode(); - /* TODO(Kevin): Call PM Module here to loop all STA_RECORD_Ts and it - * will call bssSetTIMBitmap to toggle the Bitmap. - */ - - // Set Virtual Bitmap for UCAST - u4N1 = (prP2pSpecificBssInfo->u2SmallestAID >> 4) << 1; // Find the largest even number. - u4N2 = prP2pSpecificBssInfo->u2LargestAID >> 3; // Find the smallest number. - - ASSERT(u4N2 >= u4N1); - - kalMemCopy(TIM_IE(pucBuffer)->aucPartialVirtualMap, - &prP2pSpecificBssInfo->aucPartialVirtualBitmap[u4N1], - ((u4N2 - u4N1) + 1)); - - // Set Virtual Bitmap for BMCAST - // BMC bit only indicated when DTIM count == 0. - if (prBssInfo->ucDTIMCount == 0) { - ucBitmapControl = prP2pSpecificBssInfo->ucBitmapCtrl; - } - TIM_IE(pucBuffer)->ucBitmapControl = ucBitmapControl | (UINT_8)u4N1; - - TIM_IE(pucBuffer)->ucLength = ((u4N2 - u4N1) + 4); - - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); -#else - - // IEEE 802.11 2007 - 7.3.2.6 - TIM_IE(pucBuffer)->ucId = ELEM_ID_TIM; - TIM_IE(pucBuffer)->ucLength = (3 + MAX_LEN_TIM_PARTIAL_BMP)/*((u4N2 - u4N1) + 4)*/; // NOTE: fixed PVB length (AID is allocated from 8 ~ 15 only) - TIM_IE(pucBuffer)->ucDTIMCount = 0/*prBssInfo->ucDTIMCount*/; // will be overwrite by FW - TIM_IE(pucBuffer)->ucDTIMPeriod = prBssInfo->ucDTIMPeriod; - TIM_IE(pucBuffer)->ucBitmapControl = 0/*ucBitmapControl | (UINT_8)u4N1*/; // will be overwrite by FW - - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - -#endif - - } - else -#endif /* CFG_ENABLE_WIFI_DIRECT */ - { - /* NOTE(Kevin): 1. AIS - Didn't Support AP Mode. - * 2. BOW - Didn't Support BCAST and PS. - */ - } - - - - } - - return; -} /* end of bssBuildBeaconProbeRespFrameCommonIEs() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will compose the Beacon/Probe Response frame header and -* its fixed fields. -* -* @param[in] pucBuffer Pointer to the frame buffer. -* @param[in] pucDestAddr Pointer to the Destination Address, if NULL, means Beacon. -* @param[in] pucOwnMACAddress Given Our MAC Address. -* @param[in] pucBSSID Given BSSID of the BSS. -* @param[in] u2BeaconInterval Given Beacon Interval. -* @param[in] u2CapInfo Given Capability Info. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bssComposeBeaconProbeRespFrameHeaderAndFF ( - IN PUINT_8 pucBuffer, - IN PUINT_8 pucDestAddr, - IN PUINT_8 pucOwnMACAddress, - IN PUINT_8 pucBSSID, - IN UINT_16 u2BeaconInterval, - IN UINT_16 u2CapInfo - ) -{ - P_WLAN_BEACON_FRAME_T prBcnProbRspFrame; - UINT_8 aucBCAddr[] = BC_MAC_ADDR; - UINT_16 u2FrameCtrl; - - DEBUGFUNC("bssComposeBeaconProbeRespFrameHeaderAndFF"); - //DBGLOG(INIT, LOUD, ("\n")); - - - ASSERT(pucBuffer); - ASSERT(pucOwnMACAddress); - ASSERT(pucBSSID); - - prBcnProbRspFrame = (P_WLAN_BEACON_FRAME_T)pucBuffer; - - //4 <1> Compose the frame header of the Beacon /ProbeResp frame. - /* Fill the Frame Control field. */ - if (pucDestAddr) { - u2FrameCtrl = MAC_FRAME_PROBE_RSP; - } - else { - u2FrameCtrl = MAC_FRAME_BEACON; - pucDestAddr = aucBCAddr; - } - //WLAN_SET_FIELD_16(&prBcnProbRspFrame->u2FrameCtrl, u2FrameCtrl); - prBcnProbRspFrame->u2FrameCtrl = u2FrameCtrl; // NOTE(Kevin): Optimized for ARM - - /* Fill the DA field with BCAST MAC ADDR or TA of ProbeReq. */ - COPY_MAC_ADDR(prBcnProbRspFrame->aucDestAddr, pucDestAddr); - - /* Fill the SA field with our MAC Address. */ - COPY_MAC_ADDR(prBcnProbRspFrame->aucSrcAddr, pucOwnMACAddress); - - /* Fill the BSSID field with current BSSID. */ - COPY_MAC_ADDR(prBcnProbRspFrame->aucBSSID, pucBSSID); - - /* Clear the SEQ/FRAG_NO field(HW won't overide the FRAG_NO, so we need to clear it). */ - prBcnProbRspFrame->u2SeqCtrl = 0; - - - //4 <2> Compose the frame body's common fixed field part of the Beacon /ProbeResp frame. - /* MAC will update TimeStamp field */ - - /* Fill the Beacon Interval field. */ - //WLAN_SET_FIELD_16(&prBcnProbRspFrame->u2BeaconInterval, u2BeaconInterval); - prBcnProbRspFrame->u2BeaconInterval = u2BeaconInterval; // NOTE(Kevin): Optimized for ARM - - /* Fill the Capability Information field. */ - //WLAN_SET_FIELD_16(&prBcnProbRspFrame->u2CapInfo, u2CapInfo); - prBcnProbRspFrame->u2CapInfo = u2CapInfo; // NOTE(Kevin): Optimized for ARM - - return; -} /* end of bssComposeBeaconProbeRespFrameHeaderAndFF() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Update the Beacon Frame Template to FW for AIS AdHoc and P2P GO. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] eNetTypeIndex Specify which network reply the Probe Response. -* -* @retval WLAN_STATUS_SUCCESS Success. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -bssUpdateBeaconContent ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ) -{ - P_BSS_INFO_T prBssInfo; - P_MSDU_INFO_T prMsduInfo; - P_WLAN_BEACON_FRAME_T prBcnFrame; - UINT_32 i; - - DEBUGFUNC("bssUpdateBeaconContent"); - DBGLOG(INIT, LOUD, ("\n")); - - ASSERT(eNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[eNetTypeIndex]); - - //4 <1> Allocate a PKT_INFO_T for Beacon Frame - /* Allocate a MSDU_INFO_T */ - // For Beacon - prMsduInfo = prBssInfo->prBeacon; - - // beacon prMsduInfo will be NULLify once BSS deactivated, so skip if it is - if (prMsduInfo == NULL) { - return WLAN_STATUS_SUCCESS; - } - - //4 <2> Compose header - bssComposeBeaconProbeRespFrameHeaderAndFF( - (PUINT_8)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD), - NULL, - prBssInfo->aucOwnMacAddr, - prBssInfo->aucBSSID, - prBssInfo->u2BeaconInterval, - prBssInfo->u2CapInfo); - - - prMsduInfo->u2FrameLength = (WLAN_MAC_MGMT_HEADER_LEN + - (TIMESTAMP_FIELD_LEN + BEACON_INTERVAL_FIELD_LEN + CAP_INFO_FIELD_LEN)); - - prMsduInfo->ucNetworkType = eNetTypeIndex; - - //4 <3> Compose the frame body's Common IEs of the Beacon frame. - bssBuildBeaconProbeRespFrameCommonIEs(prMsduInfo, prBssInfo, NULL); - - - //4 <4> Compose IEs in MSDU_INFO_T - - /* Append IE for Beacon */ - for (i = 0; i < sizeof(txBcnIETable)/sizeof(APPEND_VAR_IE_ENTRY_T); i++) { - if (txBcnIETable[i].pfnAppendIE) { - txBcnIETable[i].pfnAppendIE(prAdapter, prMsduInfo); - } - } - - prBcnFrame = (P_WLAN_BEACON_FRAME_T)prMsduInfo->prPacket; - - return nicUpdateBeaconIETemplate(prAdapter, - IE_UPD_METHOD_UPDATE_ALL, - eNetTypeIndex, - prBssInfo->u2CapInfo, - (PUINT_8)prBcnFrame->aucInfoElem, - prMsduInfo->u2FrameLength - OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem)); - - -} /* end of bssUpdateBeaconContent() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Send the Beacon Frame(for BOW) or Probe Response Frame according to the given -* Destination Address. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] eNetTypeIndex Specify which network reply the Probe Response. -* @param[in] pucDestAddr Pointer to the Destination Address to reply -* @param[in] u4ControlFlags Control flags for information on Probe Response. -* -* @retval WLAN_STATUS_RESOURCE No available resources to send frame. -* @retval WLAN_STATUS_SUCCESS Success. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -bssSendBeaconProbeResponse ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN PUINT_8 pucDestAddr, - IN UINT_32 u4ControlFlags - ) -{ - P_BSS_INFO_T prBssInfo; - P_MSDU_INFO_T prMsduInfo; - UINT_16 u2EstimatedFrameLen; - UINT_16 u2EstimatedFixedIELen; - UINT_16 u2EstimatedExtraIELen; - P_APPEND_VAR_IE_ENTRY_T prIeArray = NULL; - UINT_32 u4IeArraySize = 0; - UINT_32 i; - - - ASSERT(eNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[eNetTypeIndex]); - - - if (!pucDestAddr) { // For Beacon - prIeArray = &txBcnIETable[0]; - u4IeArraySize = sizeof(txBcnIETable)/sizeof(APPEND_VAR_IE_ENTRY_T); - } - else { - prIeArray = &txProbRspIETable[0]; - u4IeArraySize = sizeof(txProbRspIETable)/sizeof(APPEND_VAR_IE_ENTRY_T); - } - - - //4 <1> Allocate a PKT_INFO_T for Beacon /Probe Response Frame - /* Allocate a MSDU_INFO_T */ - - /* Init with MGMT Header Length + Length of Fixed Fields + Common IE Fields */ - u2EstimatedFrameLen = MAC_TX_RESERVED_FIELD + \ - WLAN_MAC_MGMT_HEADER_LEN + \ - TIMESTAMP_FIELD_LEN + \ - BEACON_INTERVAL_FIELD_LEN + \ - CAP_INFO_FIELD_LEN + \ - (ELEM_HDR_LEN + ELEM_MAX_LEN_SSID) + \ - (ELEM_HDR_LEN + ELEM_MAX_LEN_SUP_RATES) + \ - (ELEM_HDR_LEN + ELEM_MAX_LEN_DS_PARAMETER_SET) + \ - (ELEM_HDR_LEN + ELEM_MAX_LEN_IBSS_PARAMETER_SET) + \ - (ELEM_HDR_LEN + (3 + MAX_LEN_TIM_PARTIAL_BMP)); - - /* + Extra IE Length */ - u2EstimatedExtraIELen = 0; - - for (i = 0; i < u4IeArraySize; i++) { - u2EstimatedFixedIELen = prIeArray[i].u2EstimatedFixedIELen; - - if (u2EstimatedFixedIELen) { - u2EstimatedExtraIELen += u2EstimatedFixedIELen; - } - else { - ASSERT(prIeArray[i].pfnCalculateVariableIELen); - - u2EstimatedExtraIELen += (UINT_16) - prIeArray[i].pfnCalculateVariableIELen(prAdapter, eNetTypeIndex, NULL); - } - } - - u2EstimatedFrameLen += u2EstimatedExtraIELen; - - if ( (prMsduInfo = cnmMgtPktAlloc(prAdapter, u2EstimatedFrameLen)) == NULL) { - DBGLOG(BSS, WARN, ("No PKT_INFO_T for sending %s.\n", - ((!pucDestAddr)?"Beacon":"Probe Response"))); - return WLAN_STATUS_RESOURCES; - } - - - //4 <2> Compose Beacon/Probe Response frame header and fixed fields in MSDU_INfO_T. - /* Compose Header and Fixed Field */ -#if CFG_ENABLE_WIFI_DIRECT - if (u4ControlFlags & BSS_PROBE_RESP_USE_P2P_DEV_ADDR) { - if(prAdapter->fgIsP2PRegistered) { - bssComposeBeaconProbeRespFrameHeaderAndFF( - (PUINT_8)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD), - pucDestAddr, - prAdapter->rWifiVar.aucDeviceAddress, - prAdapter->rWifiVar.aucDeviceAddress, - DOT11_BEACON_PERIOD_DEFAULT, - (prBssInfo->u2CapInfo & ~(CAP_INFO_ESS | CAP_INFO_IBSS))); - } - } - else -#endif /* CFG_ENABLE_WIFI_DIRECT */ - { - bssComposeBeaconProbeRespFrameHeaderAndFF( - (PUINT_8)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD), - pucDestAddr, - prBssInfo->aucOwnMacAddr, - prBssInfo->aucBSSID, - prBssInfo->u2BeaconInterval, - prBssInfo->u2CapInfo); - } - - - //4 <3> Update information of MSDU_INFO_T - prMsduInfo->eSrc = TX_PACKET_MGMT; - prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_MGMT; - prMsduInfo->ucStaRecIndex = 0xFF; - prMsduInfo->ucNetworkType = (UINT_8)eNetTypeIndex; - prMsduInfo->ucMacHeaderLength = WLAN_MAC_MGMT_HEADER_LEN; - prMsduInfo->fgIs802_1x = FALSE; - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = (WLAN_MAC_MGMT_HEADER_LEN + - TIMESTAMP_FIELD_LEN + BEACON_INTERVAL_FIELD_LEN + CAP_INFO_FIELD_LEN); - prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMsduInfo->pfTxDoneHandler = NULL; - prMsduInfo->fgIsBasicRate = TRUE; - - - //4 <4> Compose the frame body's Common IEs of the Beacon/ProbeResp frame. - bssBuildBeaconProbeRespFrameCommonIEs(prMsduInfo, prBssInfo, pucDestAddr); - - - //4 <5> Compose IEs in MSDU_INFO_T - - /* Append IE */ - for (i = 0; i < u4IeArraySize; i++) { - if (prIeArray[i].pfnAppendIE) { - prIeArray[i].pfnAppendIE(prAdapter, prMsduInfo); - } - } - - /* TODO(Kevin): Also release the unused tail room of the composed MMPDU */ - - //4 <6> Inform TXM to send this Beacon /Probe Response frame. - nicTxEnqueueMsdu(prAdapter, prMsduInfo); - - return WLAN_STATUS_SUCCESS; - -} /* end of bssSendBeaconProbeResponse() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will process the Rx Probe Request Frame and then send -* back the corresponding Probe Response Frame if the specified conditions -* were matched. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prSwRfb Pointer to SW RFB data structure. -* -* @retval WLAN_STATUS_SUCCESS Always return success -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -bssProcessProbeRequest ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_WLAN_MAC_MGMT_HEADER_T prMgtHdr; - P_BSS_INFO_T prBssInfo; - ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex; - UINT_8 aucBCBSSID[] = BC_BSSID; - BOOLEAN fgIsBcBssid; - BOOLEAN fgReplyProbeResp; - UINT_32 u4CtrlFlagsForProbeResp = 0; - ENUM_BAND_T eBand; - UINT_8 ucHwChannelNum; - - - ASSERT(prSwRfb); - - //4 <1> Parse Probe Req and Get BSSID - prMgtHdr = (P_WLAN_MAC_MGMT_HEADER_T)prSwRfb->pvHeader; - - if (EQUAL_MAC_ADDR(aucBCBSSID, prMgtHdr->aucBSSID)) { - fgIsBcBssid = TRUE; - } - else { - fgIsBcBssid = FALSE; - } - - - //4 <2> Check network conditions before reply Probe Response Frame (Consider Concurrent) - for (eNetTypeIndex = NETWORK_TYPE_AIS_INDEX; eNetTypeIndex < NETWORK_TYPE_INDEX_NUM; eNetTypeIndex++) { - - if (!IS_NET_ACTIVE(prAdapter, eNetTypeIndex)) { - continue; - } - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[eNetTypeIndex]); - - if ((!fgIsBcBssid) && - UNEQUAL_MAC_ADDR(prBssInfo->aucBSSID, prMgtHdr->aucBSSID)) { - continue; - } - - eBand = HIF_RX_HDR_GET_RF_BAND(prSwRfb->prHifRxHdr); - ucHwChannelNum = HIF_RX_HDR_GET_CHNL_NUM(prSwRfb->prHifRxHdr); - - if(prBssInfo->eBand != eBand) { - continue; - } - - if(prBssInfo->ucPrimaryChannel != ucHwChannelNum) { - continue; - } - - fgReplyProbeResp = FALSE; - - if (NETWORK_TYPE_AIS_INDEX == eNetTypeIndex) { - -#if CFG_SUPPORT_ADHOC - fgReplyProbeResp = aisValidateProbeReq(prAdapter, prSwRfb, &u4CtrlFlagsForProbeResp); -#endif - } -#if CFG_ENABLE_WIFI_DIRECT - else if ((prAdapter->fgIsP2PRegistered) && - (NETWORK_TYPE_P2P_INDEX == eNetTypeIndex)) { - - fgReplyProbeResp = p2pFuncValidateProbeReq(prAdapter, prSwRfb, &u4CtrlFlagsForProbeResp); - } -#endif -#if CFG_ENABLE_BT_OVER_WIFI - else if (NETWORK_TYPE_BOW_INDEX == eNetTypeIndex) { - - fgReplyProbeResp = bowValidateProbeReq(prAdapter, prSwRfb, &u4CtrlFlagsForProbeResp); - } -#endif - - if (fgReplyProbeResp) { - if(nicTxGetFreeCmdCount(prAdapter) > (CFG_TX_MAX_CMD_PKT_NUM/2) ){ - /* Resource margin is enough */ - bssSendBeaconProbeResponse(prAdapter, eNetTypeIndex, prMgtHdr->aucSrcAddr, u4CtrlFlagsForProbeResp); - } - } - } - - return WLAN_STATUS_SUCCESS; - -} /* end of bssProcessProbeRequest() */ - - -#if 0 // NOTE(Kevin): condition check should move to P2P_FSM.c -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will process the Rx Probe Request Frame and then send -* back the corresponding Probe Response Frame if the specified conditions -* were matched. -* -* @param[in] prSwRfb Pointer to SW RFB data structure. -* -* @retval WLAN_STATUS_SUCCESS Always return success -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -bssProcessProbeRequest ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_WLAN_MAC_MGMT_HEADER_T prMgtHdr; - P_BSS_INFO_T prBssInfo; - P_IE_SSID_T prIeSsid = (P_IE_SSID_T)NULL; - P_IE_SUPPORTED_RATE_T prIeSupportedRate = (P_IE_SUPPORTED_RATE_T)NULL; - P_IE_EXT_SUPPORTED_RATE_T prIeExtSupportedRate = (P_IE_EXT_SUPPORTED_RATE_T)NULL; - PUINT_8 pucIE; - UINT_16 u2IELength; - UINT_16 u2Offset = 0; - UINT_8 aucBCBSSID[] = BC_BSSID; - ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex; - BOOLEAN fgReplyProbeResp; -#if CFG_ENABLE_WIFI_DIRECT - BOOLEAN fgP2PTargetDeviceFound; - UINT_8 aucP2PWildcardSSID[] = P2P_WILDCARD_SSID; -#endif - - ASSERT(prSwRfb); - - //4 <1> Parse Probe Req and Get SSID IE ptr - prMgtHdr = (P_WLAN_MAC_MGMT_HEADER_T)prSwRfb->pvHeader; - - u2IELength = prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen; - pucIE = (PUINT_8)((UINT_32)prSwRfb->pvHeader + prSwRfb->u2HeaderLen); - - prIeSsid = (P_IE_SSID_T)NULL; - - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - switch (IE_ID(pucIE)) { - case ELEM_ID_SSID: - if ((!prIeSsid) && - (IE_LEN(pucIE) <= ELEM_MAX_LEN_SSID)) { - prIeSsid = (P_IE_SSID_T)pucIE; - } - break; - - case ELEM_ID_SUP_RATES: - /* NOTE(Kevin): Buffalo WHR-G54S's supported rate set IE exceed 8. - * IE_LEN(pucIE) == 12, "1(B), 2(B), 5.5(B), 6(B), 9(B), 11(B), - * 12(B), 18(B), 24(B), 36(B), 48(B), 54(B)" - */ - // if (IE_LEN(pucIE) <= ELEM_MAX_LEN_SUP_RATES) { - if (IE_LEN(pucIE) <= RATE_NUM) { - prIeSupportedRate = SUP_RATES_IE(pucIE); - } - break; - - case ELEM_ID_EXTENDED_SUP_RATES: - prIeExtSupportedRate = EXT_SUP_RATES_IE(pucIE); - break; - -#if CFG_ENABLE_WIFI_DIRECT - // TODO: P2P IE & WCS IE parsing for P2P. - case ELEM_ID_P2P: - - break; -#endif - - /* no default */ - } - } /* end of IE_FOR_EACH */ - - //4 <2> Check network conditions before reply Probe Response Frame (Consider Concurrent) - for (eNetTypeIndex = NETWORK_TYPE_AIS_INDEX; eNetTypeIndex < NETWORK_TYPE_INDEX_NUM; eNetTypeIndex++) { - - if (!IS_NET_ACTIVE(prAdapter, eNetTypeIndex)) { - continue; - } - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[eNetTypeIndex]); - - if (UNEQUAL_MAC_ADDR(aucBCBSSID, prMgtHdr->aucBSSID) && - UNEQUAL_MAC_ADDR(prBssInfo->aucBSSID, prMgtHdr->aucBSSID)) { - /* BSSID not Wildcard BSSID. */ - continue; - } - - fgReplyProbeResp = FALSE; - - if (NETWORK_TYPE_AIS_INDEX == eNetTypeIndex) { - - if (prBssInfo->eCurrentOPMode == OP_MODE_IBSS) { - - /* TODO(Kevin): Check if we are IBSS Master. */ - if (TRUE) { - - if (prIeSsid) { - if ((prIeSsid->ucLength == BC_SSID_LEN) || /* WILDCARD SSID */ - EQUAL_SSID(prBssInfo->aucSSID, prBssInfo->ucSSIDLen, - prIeSsid->aucSSID, prIeSsid->ucLength)) { - fgReplyProbeResp = TRUE; - } - } - } - } - } -#if CFG_ENABLE_WIFI_DIRECT - else if (NETWORK_TYPE_P2P_INDEX == eNetTypeIndex) { - - // TODO(Kevin): Move following lines to p2p_fsm.c - - if ((prIeSsid) && - ((prIeSsid->ucLength == BC_SSID_LEN) || - (EQUAL_SSID(aucP2PWildcardSSID, - P2P_WILDCARD_SSID_LEN, - prIeSsid->aucSSID, - prIeSsid->ucLength)))) { -// if (p2pFsmRunEventRxProbeRequestFrame(prAdapter, prMgtHdr->aucSrcAddr, pucIE, u2IELength)) { - if (p2pFsmRunEventRxProbeRequestFrame(prAdapter, prSwRfb)) { - /* Extand channel request time & cancel scan request. */ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - - // TODO: RX probe request may not caused by LISTEN state. - // TODO: It can be GO. - /* Generally speaking, cancel a non-exist scan request is fine. - * We can check P2P FSM here for only LISTEN state. - */ - - P_MSG_SCN_SCAN_CANCEL prScanCancelMsg; - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - /* Abort JOIN process. */ - prScanCancelMsg = (P_MSG_SCN_SCAN_CANCEL)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_SCN_SCAN_CANCEL)); - if (!prScanCancelMsg) { - ASSERT(0); // Can't abort SCN FSM - continue; - } - - prScanCancelMsg->rMsgHdr.eMsgId = MID_P2P_SCN_SCAN_CANCEL; - prScanCancelMsg->ucSeqNum = prP2pFsmInfo->ucSeqNumOfScnMsg; - prScanCancelMsg->ucNetTypeIndex = (UINT_8)NETWORK_TYPE_P2P_INDEX; - prScanCancelMsg->fgIsChannelExt = TRUE; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prScanCancelMsg, - MSG_SEND_METHOD_BUF); - } - } - else { - /* 1. Probe Request without SSID. - * 2. Probe Request with SSID not Wildcard SSID & not P2P Wildcard SSID. - */ - continue; - } - -#if 0 // Frog - if (prAdapter->rWifiVar.prP2pFsmInfo->eCurrentState == P2P_STATE_LISTEN) { - // P2P 2.4.1 - P2P Devices shall not respond to Probe Request frames which only contain 11b rates only. - if (prIeSupportedRate || prIeExtSupportedRate) { - UINT_16 u2OperationalRateSet, u2BSSBasicRateSet; - BOOLEAN fgIsUnknownBssBasicRate; - - rateGetRateSetFromIEs(prIeSupportedRate, - prIeExtSupportedRate, - &u2OperationalRateSet, - &u2BSSBasicRateSet, /* Ignore any Basic Bit */ - &fgIsUnknownBssBasicRate); - - if (u2OperationalRateSet & ~RATE_SET_HR_DSSS) { - continue; - } - } - } - - // TODO: Check channel time before first check point to: - /* If Target device is selected: - * 1. Send XXXX request frame. - * else - * 1. Send Probe Response frame. - */ - - if (prBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT) { - /* TODO(Kevin): During PROVISION state, can we reply Probe Response ? */ - - /* TODO(Kevin): - * If we are GO, accept legacy client --> accept Wildcard SSID - * If we are in Listen State, accept only P2P Device --> check P2P IE and WPS IE - */ - if (TRUE /* We are GO */) { - if (prIeSsid) { - UINT_8 aucSSID[]=P2P_WILDCARD_SSID; - - if ((prIeSsid->ucLength == BC_SSID_LEN) || /* WILDCARD SSID */ - EQUAL_SSID(prBssInfo->aucSSID, prBssInfo->ucSSIDLen, - prIeSsid->aucSSID, prIeSsid->ucLength) || - EQUAL_SSID(aucSSID, P2P_WILDCARD_SSID_LEN, - prIeSsid->aucSSID, prIeSsid->ucLength)) { - fgReplyProbeResp = TRUE; - } - } - } -// else if (FALSE /* We are in Listen State */) { -// } - - /* TODO(Kevin): Check P2P IE and WPS IE */ - } -#endif - } -#endif -#if CFG_ENABLE_BT_OVER_WIFI - else if (NETWORK_TYPE_BOW_INDEX == eNetTypeIndex) { - - if (prBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT) { - /* TODO(Kevin): TBD */ - } - } -#endif - else { - ASSERT(eNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - } - - if (fgReplyProbeResp) { - bssSendBeaconProbeResponse(prAdapter, eNetTypeIndex, prMgtHdr->aucSrcAddr); - } - - } - - return WLAN_STATUS_SUCCESS; - -} /* end of bssProcessProbeRequest() */ -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to clear the client list for AdHoc or AP Mode -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prBssInfo Given related BSS_INFO_T. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bssClearClientList ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo - ) -{ - P_LINK_T prStaRecOfClientList; - - - ASSERT(prBssInfo); - - prStaRecOfClientList = &prBssInfo->rStaRecOfClientList; - - if (!LINK_IS_EMPTY(prStaRecOfClientList)) { - P_STA_RECORD_T prPeerStaRec; - - LINK_FOR_EACH_ENTRY(prPeerStaRec, prStaRecOfClientList, rLinkEntry, STA_RECORD_T) { - cnmStaRecChangeState(prAdapter, prPeerStaRec, STA_STATE_1); - } - - LINK_INITIALIZE(prStaRecOfClientList); - } - - return; -} /* end of bssClearClientList() */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to Add a STA_RECORD_T to the client list for AdHoc or AP Mode -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prBssInfo Given related BSS_INFO_T. -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bssAddStaRecToClientList ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo, - IN P_STA_RECORD_T prStaRec - ) -{ - P_LINK_T prStaRecOfClientList; - - - ASSERT(prBssInfo); - - prStaRecOfClientList = &prBssInfo->rStaRecOfClientList; - - if (!LINK_IS_EMPTY(prStaRecOfClientList)) { - P_STA_RECORD_T prCurrStaRec; - - LINK_FOR_EACH_ENTRY(prCurrStaRec, prStaRecOfClientList, rLinkEntry, STA_RECORD_T) { - - if (prCurrStaRec == prStaRec) { - DBGLOG(BSS, WARN, ("Current Client List already contains that STA_RECORD_T["MACSTR"]\n", - MAC2STR(prStaRec->aucMacAddr))); - return; - } - } - } - - LINK_INSERT_TAIL(prStaRecOfClientList, &prStaRec->rLinkEntry); - - return; -} /* end of bssAddStaRecToClientList() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to Remove a STA_RECORD_T from the client list for AdHoc or AP Mode -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bssRemoveStaRecFromClientList ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo, - IN P_STA_RECORD_T prStaRec - ) -{ - P_LINK_T prStaRecOfClientList; - - - ASSERT(prBssInfo); - - prStaRecOfClientList = &prBssInfo->rStaRecOfClientList; - - if (!LINK_IS_EMPTY(prStaRecOfClientList)) { - P_STA_RECORD_T prCurrStaRec; - - LINK_FOR_EACH_ENTRY(prCurrStaRec, prStaRecOfClientList, rLinkEntry, STA_RECORD_T) { - - if (prCurrStaRec == prStaRec) { - - LINK_REMOVE_KNOWN_ENTRY(prStaRecOfClientList, &prStaRec->rLinkEntry); - - return; - } - } - } - - DBGLOG(BSS, INFO, ("Current Client List didn't contain that STA_RECORD_T["MACSTR"] before removing.\n", - MAC2STR(prStaRec->aucMacAddr))); - - return; -} /* end of bssRemoveStaRecFromClientList() */ -#endif /* CFG_SUPPORT_ADHOC || CFG_SUPPORT_AAA */ - - -#if CFG_SUPPORT_ADHOC -/*----------------------------------------------------------------------------*/ -/* Routines for IBSS(AdHoc) only */ -/*----------------------------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to process Beacons from current Ad-Hoc network peers. -* We also process Beacons from other Ad-Hoc network during SCAN. If it has -* the same SSID and we'll decide to merge into it if it has a larger TSF. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prBssInfo Pointer to the BSS_INFO_T. -* @param[in] prBSSDesc Pointer to the BSS Descriptor. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -ibssProcessMatchedBeacon ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo, - IN P_BSS_DESC_T prBssDesc, - IN UINT_8 ucRCPI - ) -{ - P_STA_RECORD_T prStaRec = NULL; - - BOOLEAN fgIsCheckCapability = FALSE; - BOOLEAN fgIsCheckTSF = FALSE; - BOOLEAN fgIsGoingMerging = FALSE; - BOOLEAN fgIsSameBSSID; - - - ASSERT(prBssInfo); - ASSERT(prBssDesc); - - //4 <1> Process IBSS Beacon only after we create or merge with other IBSS. - if (!prBssInfo->fgIsBeaconActivated) { - return; - } - - //4 <2> Get the STA_RECORD_T of TA. - prStaRec = cnmGetStaRecByAddress(prAdapter, - (UINT_8) NETWORK_TYPE_AIS_INDEX, - prBssDesc->aucSrcAddr); - - fgIsSameBSSID = UNEQUAL_MAC_ADDR(prBssInfo->aucBSSID, prBssDesc->aucBSSID) ? FALSE : TRUE; - - - //4 <3> IBSS Merge Decision Flow for Processing Beacon. - if (fgIsSameBSSID) { - - /* Same BSSID: - * Case I. This is a new TA and it has decide to merged with us. - * a) If fgIsMerging == FALSE - we will send msg to notify AIS. - * b) If fgIsMerging == TRUE - already notify AIS. - * Case II. This is an old TA and we've already merged together. - */ - if (!prStaRec) { - - /* For Case I - Check this IBSS's capability first before adding this Sta Record. */ - fgIsCheckCapability = TRUE; - - /* If check is passed, then we perform merging with this new IBSS */ - fgIsGoingMerging = TRUE; - - } - else { - - ASSERT((prStaRec->ucNetTypeIndex == NETWORK_TYPE_AIS_INDEX) && - IS_ADHOC_STA(prStaRec)); - - if (prStaRec->ucStaState != STA_STATE_3) { - - if (!prStaRec->fgIsMerging) { - - /* For Case I - Check this IBSS's capability first before adding this Sta Record. */ - fgIsCheckCapability = TRUE; - - /* If check is passed, then we perform merging with this new IBSS */ - fgIsGoingMerging = TRUE; - } - else { - /* For Case II - Update rExpirationTime of Sta Record */ - GET_CURRENT_SYSTIME(&prStaRec->rUpdateTime); - } - } - else { - /* For Case II - Update rExpirationTime of Sta Record */ - GET_CURRENT_SYSTIME(&prStaRec->rUpdateTime); - } - - } - } - else { - - /* Unequal BSSID: - * Case III. This is a new TA and we need to compare the TSF and get the winner. - * Case IV. This is an old TA and it merge into a new IBSS before we do the same thing. - * We need to compare the TSF to get the winner. - * Case V. This is an old TA and it restart a new IBSS. We also need to - * compare the TSF to get the winner. - */ - - /* For Case III, IV & V - We'll always check this new IBSS's capability first - * before merging into new IBSS. - */ - fgIsCheckCapability = TRUE; - - /* If check is passed, we need to perform TSF check to decide the major BSSID */ - fgIsCheckTSF = TRUE; - - /* For Case IV & V - We won't update rExpirationTime of Sta Record */ - } - - - //4 <7> Check this BSS_DESC_T's capability. - if (fgIsCheckCapability) { - BOOLEAN fgIsCapabilityMatched = FALSE; - - do { - if (!(prBssDesc->ucPhyTypeSet & (prAdapter->rWifiVar.ucAvailablePhyTypeSet))) { - DBGLOG(BSS, LOUD, - ("IBSS MERGE: Ignore Peer MAC: "MACSTR" - Unsupported Phy.\n", - MAC2STR(prBssDesc->aucSrcAddr))); - - break; - } - - if (prBssDesc->fgIsUnknownBssBasicRate) { - DBGLOG(BSS, LOUD, - ("IBSS MERGE: Ignore Peer MAC: "MACSTR" - Unknown Basic Rate.\n", - MAC2STR(prBssDesc->aucSrcAddr))); - - break; - } - - if (ibssCheckCapabilityForAdHocMode(prAdapter, prBssDesc) == WLAN_STATUS_FAILURE) { - DBGLOG(BSS, LOUD, - ("IBSS MERGE: Ignore Peer MAC: "MACSTR" - Capability is not matched.\n", - MAC2STR(prBssDesc->aucSrcAddr))); - - break; - } - - fgIsCapabilityMatched = TRUE; - } - while (FALSE); - - if (!fgIsCapabilityMatched) { - - if (prStaRec) { - /* For Case II - We merge this STA_RECORD in RX Path. - * Case IV & V - They change their BSSID after we merge with them. - */ - - DBGLOG(BSS, LOUD, - ("IBSS MERGE: Ignore Peer MAC: "MACSTR" - Capability is not matched.\n", - MAC2STR(prBssDesc->aucSrcAddr))); - } - - return; - } - - DBGLOG(BSS, LOUD, - ("IBSS MERGE: Peer MAC: "MACSTR" - Check capability was passed.\n", - MAC2STR(prBssDesc->aucSrcAddr))); - } - - - if (fgIsCheckTSF) { -#if CFG_SLT_SUPPORT - fgIsGoingMerging = TRUE; -#else - if (prBssDesc->fgIsLargerTSF) { - fgIsGoingMerging = TRUE; - } - else { - return; - } -#endif - } - - - if (fgIsGoingMerging) { - P_MSG_AIS_IBSS_PEER_FOUND_T prAisIbssPeerFoundMsg; - - - //4 <1> We will merge with to this BSS immediately. - prBssDesc->fgIsConnecting = TRUE; - prBssDesc->fgIsConnected = FALSE; - - //4 <2> Setup corresponding STA_RECORD_T - prStaRec = bssCreateStaRecFromBssDesc(prAdapter, - STA_TYPE_ADHOC_PEER, - NETWORK_TYPE_AIS_INDEX, - prBssDesc); - - if(!prStaRec) { - // no memory ? - return; - } - - prStaRec->fgIsMerging = TRUE; - - /* update RCPI */ - prStaRec->ucRCPI = ucRCPI; - - //4 <3> Send Merge Msg to CNM to obtain the channel privilege. - prAisIbssPeerFoundMsg = (P_MSG_AIS_IBSS_PEER_FOUND_T) - cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_AIS_IBSS_PEER_FOUND_T)); - - if (!prAisIbssPeerFoundMsg) { - - ASSERT(0); // Can't send Merge Msg - return; - } - - prAisIbssPeerFoundMsg->rMsgHdr.eMsgId = MID_SCN_AIS_FOUND_IBSS; - prAisIbssPeerFoundMsg->ucNetTypeIndex = (UINT_8)NETWORK_TYPE_AIS_INDEX; - prAisIbssPeerFoundMsg->prStaRec = prStaRec; - - /* Inform AIS to do STATE TRANSITION - * For Case I - If AIS in IBSS_ALONE, let it jump to NORMAL_TR after we know the new member. - * For Case III, IV - Now this new BSSID wins the TSF, follow it. - */ - if (fgIsSameBSSID) { - prAisIbssPeerFoundMsg->fgIsMergeIn = TRUE; - } - else { -#if CFG_SLT_SUPPORT - prAisIbssPeerFoundMsg->fgIsMergeIn = TRUE; -#else - prAisIbssPeerFoundMsg->fgIsMergeIn = (prBssDesc->fgIsLargerTSF) ? FALSE: TRUE; -#endif - } - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prAisIbssPeerFoundMsg, - MSG_SEND_METHOD_BUF); - - } - - return; -} /* end of ibssProcessMatchedBeacon() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will check the Capability for Ad-Hoc to decide if we are -* able to merge with(same capability). -* -* @param[in] prBSSDesc Pointer to the BSS Descriptor. -* -* @retval WLAN_STATUS_FAILURE Can't pass the check of Capability. -* @retval WLAN_STATUS_SUCCESS Pass the check of Capability. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -ibssCheckCapabilityForAdHocMode ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc - ) -{ - P_CONNECTION_SETTINGS_T prConnSettings; - WLAN_STATUS rStatus = WLAN_STATUS_FAILURE; - - - ASSERT(prBssDesc); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - - do { - //4 <1> Check the BSS Basic Rate Set for current AdHoc Mode - if ((prConnSettings->eAdHocMode == AD_HOC_MODE_11B) && - (prBssDesc->u2BSSBasicRateSet & ~RATE_SET_HR_DSSS)) { - break; - } - else if ((prConnSettings->eAdHocMode == AD_HOC_MODE_11A) && - (prBssDesc->u2BSSBasicRateSet & ~RATE_SET_OFDM)) { - break; - } - - //4 <2> Check the Short Slot Time. -#if 0 // Do not check ShortSlotTime until Wi-Fi define such policy - if (prConnSettings->eAdHocMode == AD_HOC_MODE_11G) { - if (((prConnSettings->fgIsShortSlotTimeOptionEnable) && - !(prBssDesc->u2CapInfo & CAP_INFO_SHORT_SLOT_TIME)) || - (!(prConnSettings->fgIsShortSlotTimeOptionEnable) && - (prBssDesc->u2CapInfo & CAP_INFO_SHORT_SLOT_TIME))) { - break; - } - } -#endif - - //4 <3> Check the ATIM window setting. - if (prBssDesc->u2ATIMWindow) { - DBGLOG(BSS, INFO, ("AdHoc PS was not supported(ATIM Window: %d)\n", - prBssDesc->u2ATIMWindow)); - break; - } - -#if CFG_RSN_MIGRATION - //4 <4> Check the Security setting. - if (!rsnPerformPolicySelection(prAdapter, prBssDesc)) { - break; - } -#endif - - rStatus = WLAN_STATUS_SUCCESS; - } - while (FALSE); - - return rStatus; - -} /* end of ibssCheckCapabilityForAdHocMode() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will initial the BSS_INFO_T for IBSS Mode. -* -* @param[in] prBssInfo Pointer to the BSS_INFO_T. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -ibssInitForAdHoc ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo - ) -{ - UINT_8 ucLowestBasicRateIndex; - UINT_8 aucBSSID[MAC_ADDR_LEN]; - PUINT_16 pu2BSSID = (PUINT_16)&aucBSSID[0]; - UINT_32 i; - - - ASSERT(prBssInfo); - ASSERT(prBssInfo->eCurrentOPMode == OP_MODE_IBSS); - - - //4 <1> Setup PHY Attributes and Basic Rate Set/Operational Rate Set - prBssInfo->ucNonHTBasicPhyType = (UINT_8) - rNonHTAdHocModeAttributes[prBssInfo->ucConfigAdHocAPMode].ePhyTypeIndex; - prBssInfo->u2BSSBasicRateSet = - rNonHTAdHocModeAttributes[prBssInfo->ucConfigAdHocAPMode].u2BSSBasicRateSet; - - - prBssInfo->u2OperationalRateSet = - rNonHTPhyAttributes[prBssInfo->ucNonHTBasicPhyType].u2SupportedRateSet; - - rateGetDataRatesFromRateSet(prBssInfo->u2OperationalRateSet, - prBssInfo->u2BSSBasicRateSet, - prBssInfo->aucAllSupportedRates, - &prBssInfo->ucAllSupportedRatesLen); - - //4 <2> Setup BSSID - if (!prBssInfo->fgHoldSameBssidForIBSS) { - - for (i = 0; i < sizeof(aucBSSID)/sizeof(UINT_16); i++) { - pu2BSSID[i] = (UINT_16)(kalRandomNumber() & 0xFFFF); - } - - aucBSSID[0] &= ~0x01; // 7.1.3.3.3 - The individual/group bit of the address is set to 0. - aucBSSID[0] |= 0x02; // 7.1.3.3.3 - The universal/local bit of the address is set to 1. - - COPY_MAC_ADDR(prBssInfo->aucBSSID, aucBSSID); - } - - - //4 <3> Setup Capability - Short Preamble - if (rNonHTPhyAttributes[prBssInfo->ucNonHTBasicPhyType].fgIsShortPreambleOptionImplemented && - ((prAdapter->rWifiVar.ePreambleType == PREAMBLE_TYPE_SHORT) || /* Short Preamble Option Enable is TRUE */ - (prAdapter->rWifiVar.ePreambleType == PREAMBLE_TYPE_AUTO)) ) { - - prBssInfo->fgIsShortPreambleAllowed = TRUE; - prBssInfo->fgUseShortPreamble = TRUE; - } - else { - prBssInfo->fgIsShortPreambleAllowed = FALSE; - prBssInfo->fgUseShortPreamble = FALSE; - } - - - //4 <4> Setup Capability - Short Slot Time - // 7.3.1.4 For IBSS, the Short Slot Time subfield shall be set to 0. - prBssInfo->fgUseShortSlotTime = FALSE; /* Set to FALSE for AdHoc */ - - - //4 <5> Compoase Capability - prBssInfo->u2CapInfo = CAP_INFO_IBSS; - - if (prBssInfo->fgIsProtection) { - prBssInfo->u2CapInfo |= CAP_INFO_PRIVACY; - } - - if (prBssInfo->fgIsShortPreambleAllowed) { - prBssInfo->u2CapInfo |= CAP_INFO_SHORT_PREAMBLE; - } - - if (prBssInfo->fgUseShortSlotTime) { - prBssInfo->u2CapInfo |= CAP_INFO_SHORT_SLOT_TIME; - } - - - //4 <6> Find Lowest Basic Rate Index for default TX Rate of MMPDU - rateGetLowestRateIndexFromRateSet(prBssInfo->u2BSSBasicRateSet, &ucLowestBasicRateIndex); - - prBssInfo->ucHwDefaultFixedRateCode = - aucRateIndex2RateCode[PREAMBLE_DEFAULT_LONG_NONE][ucLowestBasicRateIndex]; - - return; -} /* end of ibssInitForAdHoc() */ - -#endif /* CFG_SUPPORT_ADHOC */ - - -#if CFG_SUPPORT_AAA - -/*----------------------------------------------------------------------------*/ -/* Routines for BSS(AP) only */ -/*----------------------------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will initial the BSS_INFO_T for AP Mode. -* -* @param[in] prBssInfo Given related BSS_INFO_T. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bssInitForAP ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo, - IN BOOLEAN fgIsRateUpdate - ) -{ - UINT_8 ucLowestBasicRateIndex; - - P_AC_QUE_PARMS_T prACQueParms; - - ENUM_WMM_ACI_T eAci; - - UINT_8 auCWminLog2ForBcast[WMM_AC_INDEX_NUM] = { 4/*BE*/, 4 /*BK*/, 3/*VO*/, 2/*VI*/}; - UINT_8 auCWmaxLog2ForBcast[WMM_AC_INDEX_NUM] = { 10, 10, 4, 3}; - UINT_8 auAifsForBcast[WMM_AC_INDEX_NUM] = { 3, 7, 2, 2 }; - UINT_8 auTxopForBcast[WMM_AC_INDEX_NUM] = { 0, 0, 94, 47 }; /* If the AP is OFDM */ - - UINT_8 auCWminLog2[WMM_AC_INDEX_NUM] = { 4 /*BE*/, 4 /*BK*/, 3 /*VO*/, 2 /*VI*/}; - UINT_8 auCWmaxLog2[WMM_AC_INDEX_NUM] = { 7, 10, 4, 3}; - UINT_8 auAifs[WMM_AC_INDEX_NUM] = { 3, 7, 1, 1 }; - UINT_8 auTxop[WMM_AC_INDEX_NUM] = { 0, 0, 94, 47 }; /* If the AP is OFDM */ - - DEBUGFUNC("bssInitForAP"); - DBGLOG(BSS, LOUD,("\n")); - - ASSERT(prBssInfo); - ASSERT((prBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT) || (prBssInfo->eCurrentOPMode == OP_MODE_BOW)); - -#if 0 - prAdapter->rWifiVar.rConnSettings.fgRxShortGIDisabled = TRUE; - prAdapter->rWifiVar.rConnSettings.uc2G4BandwidthMode = CONFIG_BW_20M; - prAdapter->rWifiVar.rConnSettings.uc5GBandwidthMode = CONFIG_BW_20M; -#endif - - - //4 <1> Setup PHY Attributes and Basic Rate Set/Operational Rate Set - prBssInfo->ucNonHTBasicPhyType = (UINT_8) - rNonHTApModeAttributes[prBssInfo->ucConfigAdHocAPMode].ePhyTypeIndex; - prBssInfo->u2BSSBasicRateSet = - rNonHTApModeAttributes[prBssInfo->ucConfigAdHocAPMode].u2BSSBasicRateSet; - - - prBssInfo->u2OperationalRateSet = - rNonHTPhyAttributes[prBssInfo->ucNonHTBasicPhyType].u2SupportedRateSet; - - if (fgIsRateUpdate) { - rateGetDataRatesFromRateSet(prBssInfo->u2OperationalRateSet, - prBssInfo->u2BSSBasicRateSet, - prBssInfo->aucAllSupportedRates, - &prBssInfo->ucAllSupportedRatesLen); - } - - //4 <2> Setup BSSID - COPY_MAC_ADDR(prBssInfo->aucBSSID, prBssInfo->aucOwnMacAddr); - - - //4 <3> Setup Capability - Short Preamble - if (rNonHTPhyAttributes[prBssInfo->ucNonHTBasicPhyType].fgIsShortPreambleOptionImplemented && - ((prAdapter->rWifiVar.ePreambleType == PREAMBLE_TYPE_SHORT) || /* Short Preamble Option Enable is TRUE */ - (prAdapter->rWifiVar.ePreambleType == PREAMBLE_TYPE_AUTO)) ) { - - prBssInfo->fgIsShortPreambleAllowed = TRUE; - prBssInfo->fgUseShortPreamble = TRUE; - } - else { - prBssInfo->fgIsShortPreambleAllowed = FALSE; - prBssInfo->fgUseShortPreamble = FALSE; - } - - - //4 <4> Setup Capability - Short Slot Time - prBssInfo->fgUseShortSlotTime = TRUE; - - //4 <5> Compoase Capability - prBssInfo->u2CapInfo = CAP_INFO_ESS; - - if (prBssInfo->fgIsProtection) { - prBssInfo->u2CapInfo |= CAP_INFO_PRIVACY; - } - - if (prBssInfo->fgIsShortPreambleAllowed) { - prBssInfo->u2CapInfo |= CAP_INFO_SHORT_PREAMBLE; - } - - if (prBssInfo->fgUseShortSlotTime) { - prBssInfo->u2CapInfo |= CAP_INFO_SHORT_SLOT_TIME; - } - - - //4 <6> Find Lowest Basic Rate Index for default TX Rate of MMPDU - rateGetLowestRateIndexFromRateSet(prBssInfo->u2BSSBasicRateSet, &ucLowestBasicRateIndex); - - prBssInfo->ucHwDefaultFixedRateCode = - aucRateIndex2RateCode[PREAMBLE_DEFAULT_LONG_NONE][ucLowestBasicRateIndex]; - - - //4 <7> Fill the EDCA - - prACQueParms = prBssInfo->arACQueParmsForBcast; - - for(eAci = 0; eAci < WMM_AC_INDEX_NUM; eAci++){ - - prACQueParms[eAci].fgIsACMSet = FALSE; - prACQueParms[eAci].u2Aifsn = auAifsForBcast[eAci]; - prACQueParms[eAci].u2CWmin = BIT(auCWminLog2ForBcast[eAci])-1; - prACQueParms[eAci].u2CWmax = BIT(auCWmaxLog2ForBcast[eAci])-1; - prACQueParms[eAci].u2TxopLimit = auTxopForBcast[eAci]; - - prBssInfo->aucCWminLog2ForBcast[eAci] = auCWminLog2ForBcast[eAci] ; /* used to send WMM IE */ - prBssInfo->aucCWmaxLog2ForBcast[eAci] = auCWmaxLog2ForBcast[eAci] ; - - DBGLOG(BSS, INFO, ("Bcast: eAci = %d, ACM = %d, Aifsn = %d, CWmin = %d, CWmax = %d, TxopLimit = %d\n", - eAci,prACQueParms[eAci].fgIsACMSet , - prACQueParms[eAci].u2Aifsn, - prACQueParms[eAci].u2CWmin, - prACQueParms[eAci].u2CWmax, - prACQueParms[eAci].u2TxopLimit)); - - } - - prACQueParms = prBssInfo->arACQueParms; - - for(eAci = 0; eAci < WMM_AC_INDEX_NUM; eAci++){ - - prACQueParms[eAci].fgIsACMSet = FALSE; - prACQueParms[eAci].u2Aifsn = auAifs[eAci]; - prACQueParms[eAci].u2CWmin = BIT(auCWminLog2[eAci])-1; - prACQueParms[eAci].u2CWmax = BIT(auCWmaxLog2[eAci])-1; - prACQueParms[eAci].u2TxopLimit = auTxop[eAci]; - - DBGLOG(BSS, INFO, ("eAci = %d, ACM = %d, Aifsn = %d, CWmin = %d, CWmax = %d, TxopLimit = %d\n", - eAci,prACQueParms[eAci].fgIsACMSet , - prACQueParms[eAci].u2Aifsn, - prACQueParms[eAci].u2CWmin, - prACQueParms[eAci].u2CWmax, - prACQueParms[eAci].u2TxopLimit)); - } - - /* Note: Caller should update the EDCA setting to HW by nicQmUpdateWmmParms() it there is no AIS network */ - /* Note: In E2, only 4 HW queues. The the Edca parameters should be folow by AIS network */ - /* Note: In E3, 8 HW queues. the Wmm parameters should be updated to right queues according to BSS */ - - - return; -} /* end of bssInitForAP() */ - -#if 0 -/*----------------------------------------------------------------------------*/ -/*! -* @brief Update DTIM Count -* -* @param[in] eNetTypeIndex Specify which network to update -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bssUpdateDTIMCount ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ) -{ - P_BSS_INFO_T prBssInfo; - - - ASSERT(eNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[eNetTypeIndex]); - - if (prBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT) { - - // Setup DTIM Count for next TBTT. - if (prBssInfo->ucDTIMCount > 0) { - prBssInfo->ucDTIMCount--; - } - else { - - ASSERT(prBssInfo->ucDTIMPeriod > 0); - - prBssInfo->ucDTIMCount = prBssInfo->ucDTIMPeriod - 1; - } - } - - return; -} /* end of bssUpdateDTIMIE() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to set the Virtual Bitmap in TIM Information Elements -* -* @param[in] prBssInfo Pointer to the BSS_INFO_T. -* @param[in] u2AssocId The association id to set in Virtual Bitmap. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -bssSetTIMBitmap ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo, - IN UINT_16 u2AssocId - ) -{ - - ASSERT(prBssInfo); - - if (prBssInfo->ucNetTypeIndex == NETWORK_TYPE_P2P_INDEX) { - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo; - - - prP2pSpecificBssInfo = &(prAdapter->rWifiVar.rP2pSpecificBssInfo); - - /* Use Association ID == 0 for BMCAST indication */ - if (u2AssocId == 0) { - - prP2pSpecificBssInfo->ucBitmapCtrl |= (UINT_8)BIT(0); - } - else { - PUINT_8 pucPartialVirtualBitmap; - UINT_8 ucBitmapToSet; - - - pucPartialVirtualBitmap = &prP2pSpecificBssInfo->aucPartialVirtualBitmap[(u2AssocId >> 3)]; // (u2AssocId / 8) - ucBitmapToSet = (UINT_8) BIT((u2AssocId % 8)); - - if (*pucPartialVirtualBitmap & ucBitmapToSet) { - /* The virtual bitmap has been set */ - return; - } - - *pucPartialVirtualBitmap |= ucBitmapToSet; - - // Update u2SmallestAID and u2LargestAID - if ((u2AssocId < prP2pSpecificBssInfo->u2SmallestAID) || - (prP2pSpecificBssInfo->u2SmallestAID == 0)) { - prP2pSpecificBssInfo->u2SmallestAID = u2AssocId; - } - - if ((u2AssocId > prP2pSpecificBssInfo->u2LargestAID) || - (prP2pSpecificBssInfo->u2LargestAID == 0)) { - prP2pSpecificBssInfo->u2LargestAID = u2AssocId; - } - } - } - - return; -} /* end of bssSetTIMBitmap() */ -#endif - -#endif /* CFG_SUPPORT_AAA */ - - -VOID -bssCreateStaRecFromAuth ( - IN P_ADAPTER_T prAdapter - ) -{ - -} - - -VOID -bssUpdateStaRecFromAssocReq ( - IN P_ADAPTER_T prAdapter - ) -{ - -} - - diff --git a/drivers/net/wireless/mt5931/mgmt/cnm.c b/drivers/net/wireless/mt5931/mgmt/cnm.c deleted file mode 100755 index 1af871d96310..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/cnm.c +++ /dev/null @@ -1,775 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/cnm.c#2 $ -*/ - -/*! \file "cnm.c" - \brief Module of Concurrent Network Management - - Module of Concurrent Network Management -*/ - - - -/* -** $Log: cnm.c $ - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 11 15 2011 cm.chang - * NULL - * Fix possible wrong message when P2P is unregistered - * - * 11 14 2011 yuche.tsai - * [WCXRP00001107] [Volunteer Patch][Driver] Large Network Type index assert in FW issue. - * Fix large network type index assert in FW issue. - * - * 11 10 2011 cm.chang - * NULL - * Modify debug message for XLOG - * - * 11 08 2011 cm.chang - * NULL - * Add RLM and CNM debug message for XLOG - * - * 11 01 2011 cm.chang - * [WCXRP00001077] [All Wi-Fi][Driver] Fix wrong preferred channel for AP and BOW - * Only check AIS channel for P2P and BOW - * - * 10 25 2011 cm.chang - * [WCXRP00001058] [All Wi-Fi][Driver] Fix sta_rec's phyTypeSet and OBSS scan in AP mode - * Extension channel of some 5G AP will not follow regulation requirement - * - * 09 30 2011 cm.chang - * [WCXRP00001020] [MT6620 Wi-Fi][Driver] Handle secondary channel offset of AP in 5GHz band - * . - * - * 09 01 2011 cm.chang - * [WCXRP00000937] [MT6620 Wi-Fi][Driver][FW] cnm.c line #848 assert when doing monkey test - * Print message only in Linux platform for monkey testing - * - * 06 23 2011 cp.wu - * [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module - * change parameter name from PeerAddr to BSSID - * - * 06 20 2011 cp.wu - * [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module - * 1. specify target's BSSID when requesting channel privilege. - * 2. pass BSSID information to firmware domain - * - * 06 01 2011 cm.chang - * [WCXRP00000756] [MT6620 Wi-Fi][Driver] 1. AIS follow channel of BOW 2. Provide legal channel function - * Limit AIS to fixed channel same with BOW - * - * 04 12 2011 cm.chang - * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency - * . - * - * 03 10 2011 cm.chang - * [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module - * Check if P2P network index is Tethering AP - * - * 03 10 2011 cm.chang - * [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module - * Add some functions to let AIS/Tethering or AIS/BOW be the same channel - * - * 02 17 2011 cm.chang - * [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module - * When P2P registried, invoke BOW deactivate function - * - * 01 12 2011 cm.chang - * [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module - * Provide function to decide if BSS can be activated or not - * - * 12 07 2010 cm.chang - * [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk - * 1. BSSINFO include RLM parameter - * 2. free all sta records when network is disconnected - * - * 12 07 2010 cm.chang - * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant - * 1. Country code is from NVRAM or supplicant - * 2. Change band definition in CMD/EVENT. - * - * 11 08 2010 cm.chang - * [WCXRP00000169] [MT6620 Wi-Fi][Driver][FW] Remove unused CNM recover message ID - * Remove CNM channel reover message ID - * - * 10 13 2010 cm.chang - * [WCXRP00000094] [MT6620 Wi-Fi][Driver] Connect to 2.4GHz AP, Driver crash. - * Add exception handle when cmd buffer is not available - * - * 08 24 2010 cm.chang - * NULL - * Support RLM initail channel of Ad-hoc, P2P and BOW - * - * 07 19 2010 wh.su - * - * update for security supporting. - * - * 07 19 2010 cm.chang - * - * Set RLM parameters and enable CNM channel manager - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Rename MID_MNY_CNM_CH_RELEASE to MID_MNY_CNM_CH_ABORT - * - * 07 01 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Fix wrong message ID for channel grant to requester - * - * 07 01 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Modify CNM message handler for new flow - * - * 06 07 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Set 20/40M bandwidth of AP HT OP before association process - * - * 05 31 2010 yarco.yang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add RX TSF Log Feature and ADDBA Rsp with DECLINE handling - * - * 05 21 2010 yarco.yang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support TCP/UDP/IP Checksum offload feature - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add Power Management - Legacy PS-POLL support. - * - * 05 05 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add a new function to send abort message - * - * 04 27 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * BMC mac address shall be ignored in basic config command - * - * 04 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW - * - * 04 22 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support change of MAC address by host command - * - * 04 16 2010 wh.su - * [BORA00000680][MT6620] Support the statistic for Microsoft os query - * adding the wpa-none for ibss beacon. - * - * 04 07 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Fix bug for OBSS scan - * - * 03 30 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support 2.4G OBSS scan - * - * 03 16 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add AdHoc Mode - * - * 03 10 2010 kevin.huang - * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support - * - * * * * * * * * * * Add Channel Manager for arbitration of JOIN and SCAN Req - * - * 02 25 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * use the Rx0 dor event indicate. - * - * 02 08 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support partial part about cmd basic configuration - * - * Dec 10 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Remove conditional compiling FPGA_V5 - * - * Nov 18 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add function cnmFsmEventInit() - * - * Nov 2 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to initialize variables in CNM_INFO_T. -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmInit ( - P_ADAPTER_T prAdapter - ) -{ - return; -} /* end of cnmInit() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to initialize variables in CNM_INFO_T. -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmUninit ( - P_ADAPTER_T prAdapter - ) -{ - return; -} /* end of cnmUninit() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Before handle the message from other module, it need to obtain -* the Channel privilege from Channel Manager -* -* @param[in] prMsgHdr The message need to be handled. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmChMngrRequestPrivilege ( - P_ADAPTER_T prAdapter, - P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_CH_REQ_T prMsgChReq; - P_CMD_CH_PRIVILEGE_T prCmdBody; - WLAN_STATUS rStatus; - - ASSERT(prAdapter); - ASSERT(prMsgHdr); - - prMsgChReq = (P_MSG_CH_REQ_T) prMsgHdr; - - prCmdBody = (P_CMD_CH_PRIVILEGE_T) - cnmMemAlloc(prAdapter, RAM_TYPE_BUF, sizeof(CMD_CH_PRIVILEGE_T)); - ASSERT(prCmdBody); - - /* To do: exception handle */ - if (!prCmdBody) { - DBGLOG(CNM, ERROR, ("ChReq: fail to get buf (net=%d, token=%d)\n", - prMsgChReq->ucNetTypeIndex, prMsgChReq->ucTokenID)); - - cnmMemFree(prAdapter, prMsgHdr); - return; - } - - DBGLOG(CNM, INFO, ("ChReq net=%d token=%d b=%d c=%d s=%d\n", - prMsgChReq->ucNetTypeIndex, prMsgChReq->ucTokenID, - prMsgChReq->eRfBand, prMsgChReq->ucPrimaryChannel, - prMsgChReq->eRfSco)); - - prCmdBody->ucNetTypeIndex = prMsgChReq->ucNetTypeIndex; - prCmdBody->ucTokenID = prMsgChReq->ucTokenID; - prCmdBody->ucAction = CMD_CH_ACTION_REQ; /* Request */ - prCmdBody->ucPrimaryChannel = prMsgChReq->ucPrimaryChannel; - prCmdBody->ucRfSco = (UINT_8) prMsgChReq->eRfSco; - prCmdBody->ucRfBand = (UINT_8) prMsgChReq->eRfBand; - prCmdBody->ucReqType = (UINT_8) prMsgChReq->eReqType; - prCmdBody->ucReserved = 0; - prCmdBody->u4MaxInterval= prMsgChReq->u4MaxInterval; - COPY_MAC_ADDR(prCmdBody->aucBSSID, prMsgChReq->aucBSSID); - - ASSERT(prCmdBody->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - - /* For monkey testing 20110901 */ - if (prCmdBody->ucNetTypeIndex >= NETWORK_TYPE_INDEX_NUM) { - DBGLOG(CNM, ERROR, ("CNM: ChReq with wrong netIdx=%d\n\n", - prCmdBody->ucNetTypeIndex)); - } - - rStatus = wlanSendSetQueryCmd ( - prAdapter, /* prAdapter */ - CMD_ID_CH_PRIVILEGE, /* ucCID */ - TRUE, /* fgSetQuery */ - FALSE, /* fgNeedResp */ - FALSE, /* fgIsOid */ - NULL, /* pfCmdDoneHandler */ - NULL, /* pfCmdTimeoutHandler */ - sizeof(CMD_CH_PRIVILEGE_T), /* u4SetQueryInfoLen */ - (PUINT_8) prCmdBody, /* pucInfoBuffer */ - NULL, /* pvSetQueryBuffer */ - 0 /* u4SetQueryBufferLen */ - ); - - ASSERT(rStatus == WLAN_STATUS_PENDING); - - cnmMemFree(prAdapter, prCmdBody); - cnmMemFree(prAdapter, prMsgHdr); - - return; -} /* end of cnmChMngrRequestPrivilege() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Before deliver the message to other module, it need to release -* the Channel privilege to Channel Manager. -* -* @param[in] prMsgHdr The message need to be delivered -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmChMngrAbortPrivilege ( - P_ADAPTER_T prAdapter, - P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_CH_ABORT_T prMsgChAbort; - P_CMD_CH_PRIVILEGE_T prCmdBody; - WLAN_STATUS rStatus; - - ASSERT(prAdapter); - ASSERT(prMsgHdr); - - prMsgChAbort = (P_MSG_CH_ABORT_T) prMsgHdr; - - prCmdBody = (P_CMD_CH_PRIVILEGE_T) - cnmMemAlloc(prAdapter, RAM_TYPE_BUF, sizeof(CMD_CH_PRIVILEGE_T)); - ASSERT(prCmdBody); - - /* To do: exception handle */ - if (!prCmdBody) { - DBGLOG(CNM, ERROR, ("ChAbort: fail to get buf (net=%d, token=%d)\n", - prMsgChAbort->ucNetTypeIndex, prMsgChAbort->ucTokenID)); - - cnmMemFree(prAdapter, prMsgHdr); - return; - } - - DBGLOG(CNM, INFO, ("ChAbort net=%d token=%d\n", - prMsgChAbort->ucNetTypeIndex, prMsgChAbort->ucTokenID)); - - prCmdBody->ucNetTypeIndex = prMsgChAbort->ucNetTypeIndex; - prCmdBody->ucTokenID = prMsgChAbort->ucTokenID; - prCmdBody->ucAction = CMD_CH_ACTION_ABORT; /* Abort */ - - ASSERT(prCmdBody->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - - /* For monkey testing 20110901 */ - if (prCmdBody->ucNetTypeIndex >= NETWORK_TYPE_INDEX_NUM) { - DBGLOG(CNM, ERROR, ("CNM: ChAbort with wrong netIdx=%d\n\n", - prCmdBody->ucNetTypeIndex)); - } - - rStatus = wlanSendSetQueryCmd ( - prAdapter, /* prAdapter */ - CMD_ID_CH_PRIVILEGE, /* ucCID */ - TRUE, /* fgSetQuery */ - FALSE, /* fgNeedResp */ - FALSE, /* fgIsOid */ - NULL, /* pfCmdDoneHandler */ - NULL, /* pfCmdTimeoutHandler */ - sizeof(CMD_CH_PRIVILEGE_T), /* u4SetQueryInfoLen */ - (PUINT_8) prCmdBody, /* pucInfoBuffer */ - NULL, /* pvSetQueryBuffer */ - 0 /* u4SetQueryBufferLen */ - ); - - ASSERT(rStatus == WLAN_STATUS_PENDING); - - cnmMemFree(prAdapter, prCmdBody); - cnmMemFree(prAdapter, prMsgHdr); - - return; -} /* end of cnmChMngrAbortPrivilege() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmChMngrHandleChEvent ( - P_ADAPTER_T prAdapter, - P_WIFI_EVENT_T prEvent - ) -{ - P_EVENT_CH_PRIVILEGE_T prEventBody; - P_MSG_CH_GRANT_T prChResp; - - ASSERT(prAdapter); - ASSERT(prEvent); - - prEventBody = (P_EVENT_CH_PRIVILEGE_T) (prEvent->aucBuffer); - prChResp = (P_MSG_CH_GRANT_T) - cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_CH_GRANT_T)); - ASSERT(prChResp); - - /* To do: exception handle */ - if (!prChResp) { - DBGLOG(CNM, ERROR, ("ChGrant: fail to get buf (net=%d, token=%d)\n", - prEventBody->ucNetTypeIndex, prEventBody->ucTokenID)); - - return; - } - - DBGLOG(CNM, INFO, ("ChGrant net=%d token=%d ch=%d sco=%d\n", - prEventBody->ucNetTypeIndex, prEventBody->ucTokenID, - prEventBody->ucPrimaryChannel, prEventBody->ucRfSco)); - - ASSERT(prEventBody->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - ASSERT(prEventBody->ucStatus == EVENT_CH_STATUS_GRANT); - - /* Decide message ID based on network and response status */ - if (prEventBody->ucNetTypeIndex == NETWORK_TYPE_AIS_INDEX) { - prChResp->rMsgHdr.eMsgId = MID_CNM_AIS_CH_GRANT; - } -#if CFG_ENABLE_WIFI_DIRECT - else if ((prAdapter->fgIsP2PRegistered) && - (prEventBody->ucNetTypeIndex == NETWORK_TYPE_P2P_INDEX)) { - prChResp->rMsgHdr.eMsgId = MID_CNM_P2P_CH_GRANT; - } -#endif -#if CFG_ENABLE_BT_OVER_WIFI - else if (prEventBody->ucNetTypeIndex == NETWORK_TYPE_BOW_INDEX) { - prChResp->rMsgHdr.eMsgId = MID_CNM_BOW_CH_GRANT; - } -#endif - else { - cnmMemFree(prAdapter, prChResp); - return; - } - - prChResp->ucNetTypeIndex = prEventBody->ucNetTypeIndex; - prChResp->ucTokenID = prEventBody->ucTokenID; - prChResp->ucPrimaryChannel = prEventBody->ucPrimaryChannel; - prChResp->eRfSco = (ENUM_CHNL_EXT_T) prEventBody->ucRfSco; - prChResp->eRfBand = (ENUM_BAND_T) prEventBody->ucRfBand; - prChResp->eReqType = (ENUM_CH_REQ_TYPE_T) prEventBody->ucReqType; - prChResp->u4GrantInterval = prEventBody->u4GrantInterval; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prChResp, - MSG_SEND_METHOD_BUF); -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is invoked for P2P or BOW networks -* -* @param (none) -* -* @return TRUE: suggest to adopt the returned preferred channel -* FALSE: No suggestion. Caller should adopt its preference -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -cnmPreferredChannel ( - P_ADAPTER_T prAdapter, - P_ENUM_BAND_T prBand, - PUINT_8 pucPrimaryChannel, - P_ENUM_CHNL_EXT_T prBssSCO - ) -{ - P_BSS_INFO_T prBssInfo; - - ASSERT(prAdapter); - ASSERT(prBand); - ASSERT(pucPrimaryChannel); - ASSERT(prBssSCO); - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]; - - if (RLM_NET_PARAM_VALID(prBssInfo)) { - *prBand = prBssInfo->eBand; - *pucPrimaryChannel = prBssInfo->ucPrimaryChannel; - *prBssSCO = prBssInfo->eBssSCO; - - return TRUE; - } - - return FALSE; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief -* -* @param (none) -* -* @return TRUE: available channel is limited to return value -* FALSE: no limited -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -cnmAisInfraChannelFixed ( - P_ADAPTER_T prAdapter, - P_ENUM_BAND_T prBand, - PUINT_8 pucPrimaryChannel - ) -{ -#if CFG_ENABLE_WIFI_DIRECT ||(CFG_ENABLE_BT_OVER_WIFI && CFG_BOW_LIMIT_AIS_CHNL) - P_BSS_INFO_T prBssInfo; -#endif - -#if CFG_ENABLE_WIFI_DIRECT - if (IS_NET_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX) && - p2pFuncIsAPMode(prAdapter->rWifiVar.prP2pFsmInfo)) { - - ASSERT(prAdapter->fgIsP2PRegistered); - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]; - - *prBand = prBssInfo->eBand; - *pucPrimaryChannel = prBssInfo->ucPrimaryChannel; - - return TRUE; - } -#endif - -#if CFG_ENABLE_BT_OVER_WIFI && CFG_BOW_LIMIT_AIS_CHNL - if (IS_NET_ACTIVE(prAdapter, NETWORK_TYPE_BOW_INDEX)) { - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]; - - *prBand = prBssInfo->eBand; - *pucPrimaryChannel = prBssInfo->ucPrimaryChannel; - - return TRUE; - } -#endif - - return FALSE; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmAisInfraConnectNotify ( - P_ADAPTER_T prAdapter - ) -{ -#if CFG_ENABLE_BT_OVER_WIFI - P_BSS_INFO_T prAisBssInfo, prBowBssInfo; - - prAisBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]; - prBowBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]; - - if (RLM_NET_PARAM_VALID(prAisBssInfo) && RLM_NET_PARAM_VALID(prBowBssInfo)){ - if (prAisBssInfo->eBand != prBowBssInfo->eBand || - prAisBssInfo->ucPrimaryChannel != prBowBssInfo->ucPrimaryChannel) { - - /* Notify BOW to do deactivation */ - bowNotifyAllLinkDisconnected(prAdapter); - } - } -#endif -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief -* -* @param (none) -* -* @return TRUE: permitted -* FALSE: Not permitted -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -cnmAisIbssIsPermitted ( - P_ADAPTER_T prAdapter - ) -{ -#if CFG_ENABLE_WIFI_DIRECT - if (IS_NET_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX)) { - return FALSE; - } -#endif - -#if CFG_ENABLE_BT_OVER_WIFI - if (IS_NET_ACTIVE(prAdapter, NETWORK_TYPE_BOW_INDEX)) { - return FALSE; - } -#endif - - return TRUE; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief -* -* @param (none) -* -* @return TRUE: permitted -* FALSE: Not permitted -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -cnmP2PIsPermitted ( - P_ADAPTER_T prAdapter - ) -{ - P_BSS_INFO_T prBssInfo; - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]; - - if (IS_BSS_ACTIVE(prBssInfo) && - prBssInfo->eCurrentOPMode == OP_MODE_IBSS) { - return FALSE; - } - -#if CFG_ENABLE_BT_OVER_WIFI - if (IS_NET_ACTIVE(prAdapter, NETWORK_TYPE_BOW_INDEX)) { - /* Notify BOW to do deactivation */ - bowNotifyAllLinkDisconnected(prAdapter); - } -#endif - - return TRUE; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief -* -* @param (none) -* -* @return TRUE: permitted -* FALSE: Not permitted -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -cnmBowIsPermitted ( - P_ADAPTER_T prAdapter - ) -{ - P_BSS_INFO_T prBssInfo; - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]; - - if (IS_BSS_ACTIVE(prBssInfo) && - prBssInfo->eCurrentOPMode == OP_MODE_IBSS) { - return FALSE; - } - -#if CFG_ENABLE_WIFI_DIRECT - if (IS_NET_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX)) { - return FALSE; - } -#endif - - return TRUE; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief -* -* @param (none) -* -* @return TRUE: permitted -* FALSE: Not permitted -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -cnmBss40mBwPermitted ( - P_ADAPTER_T prAdapter, - ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx - ) -{ - P_BSS_INFO_T prBssInfo; - UINT_8 i; - - /* Note: To support real-time decision instead of current activated-time, - * the STA roaming case shall be considered about synchronization - * problem. Another variable fgAssoc40mBwAllowed is added to - * represent HT capability when association - */ - for (i = 0; i < NETWORK_TYPE_INDEX_NUM; i++) { - if (i != (UINT_8) eNetTypeIdx) { - prBssInfo = &prAdapter->rWifiVar.arBssInfo[i]; - - if (IS_BSS_ACTIVE(prBssInfo) && (prBssInfo->fg40mBwAllowed || - prBssInfo->fgAssoc40mBwAllowed)) { - return FALSE; - } - } - } - - return TRUE; -} - - diff --git a/drivers/net/wireless/mt5931/mgmt/cnm_mem.c b/drivers/net/wireless/mt5931/mgmt/cnm_mem.c deleted file mode 100755 index a1a50baf5382..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/cnm_mem.c +++ /dev/null @@ -1,1292 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/cnm_mem.c#2 $ -*/ - -/*! \file "cnm_mem.c" - \brief This file contain the management function of packet buffers and - generic memory alloc/free functioin for mailbox message. - - A data packet has a fixed size of buffer, but a management - packet can be equipped with a variable size of buffer. -*/ - - - -/* -** $Log: cnm_mem.c $ - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 03 14 2012 wh.su - * [WCXRP00001173] [MT6620 Wi-Fi][Driver] Adding the ICS Tethering WPA2-PSK supporting - * Add code from 2.2 - * - * 11 17 2011 tsaiyuan.hsu - * [WCXRP00001115] [MT6620 Wi-Fi][DRV] avoid deactivating staRec when changing state 3 to 3. - * initialize fgNeedResp. - * - * 11 17 2011 tsaiyuan.hsu - * [WCXRP00001115] [MT6620 Wi-Fi][DRV] avoid deactivating staRec when changing state 3 to 3. - * avoid deactivating staRec when changing state from 3 to 3. - * - * 02 01 2011 cm.chang - * [WCXRP00000415] [MT6620 Wi-Fi][Driver] Check if any memory leakage happens when uninitializing in DGB mode - * . - * - * 01 26 2011 cm.chang - * [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument - * Allocate system RAM if fixed message or mgmt buffer is not available - * - * 01 26 2011 cm.chang - * [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument - * . - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Change Station Type in Station Record, Modify MACRO definition for getting station type & network type index & Role. - * - * 12 13 2010 cp.wu - * [WCXRP00000260] [MT6620 Wi-Fi][Driver][Firmware] Create V1.1 branch for both firmware and driver - * create branch for Wi-Fi driver v1.1 - * - * 12 07 2010 cm.chang - * [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk - * 1. BSSINFO include RLM parameter - * 2. free all sta records when network is disconnected - * - * 11 29 2010 cm.chang - * [WCXRP00000210] [MT6620 Wi-Fi][Driver][FW] Set RCPI value in STA_REC for initial TX rate selection of auto-rate algorithm - * Sync RCPI of STA_REC to FW as reference of initial TX rate - * - * 11 25 2010 yuche.tsai - * NULL - * Update SLT Function for QoS Support and not be affected by fixed rate function. - * - * 10 18 2010 cp.wu - * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated - * 1. remove redundant variables in STA_REC structure - * 2. add STA-REC uninitialization routine for clearing pending events - * - * 10 13 2010 cm.chang - * [WCXRP00000094] [MT6620 Wi-Fi][Driver] Connect to 2.4GHz AP, Driver crash. - * Add exception handle when cmd buffer is not available - * - * 10 12 2010 cp.wu - * [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test - * add HT (802.11n) fixed rate support. - * - * 10 08 2010 cp.wu - * [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test - * adding fixed rate support for distance test. (from registry setting) - * - * 09 24 2010 wh.su - * NULL - * [WCXRP00005002][MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning. - * - * 09 21 2010 cp.wu - * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated - * Do a complete reset with STA-REC null checking for RF test re-entry - * - * 09 16 2010 cm.chang - * NULL - * Change conditional compiling options for BOW - * - * 09 10 2010 cm.chang - * NULL - * Always update Beacon content if FW sync OBSS info - * - * 08 24 2010 cm.chang - * NULL - * Support RLM initail channel of Ad-hoc, P2P and BOW - * - * 08 23 2010 chinghwa.yu - * NULL - * Update for BOW. - * - * 08 20 2010 cm.chang - * NULL - * Migrate RLM code to host from FW - * - * 08 19 2010 wh.su - * NULL - * adding the tx pkt call back handle for countermeasure. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Check draft RLM code for HT cap - * - * 07 07 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Support state of STA record change from 1 to 1 - * - * 07 05 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Fix correct structure size in cnmStaSendDeactivateCmd() - * - * 07 05 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) ignore RSN checking when RSN is not turned on. - * 2) set STA-REC deactivation callback as NULL - * 3) add variable initialization API based on PHY configuration - * - * 07 02 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * spin lock target revised - * - * 07 02 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * change inner loop index from i to k. - * - * 07 01 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Support sync command of STA_REC - * - * 06 23 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Merge g_arStaRec[] into adapter->arStaRec[] - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 05 31 2010 yarco.yang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add RX TSF Log Feature and ADDBA Rsp with DECLINE handling - * - * 05 28 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support checking of duplicated buffer free - * - * 05 28 2010 wh.su - * [BORA00000626][MT6620] Refine the remove key flow for WHQL testing - * fixed the ad-hoc wpa-none send non-encrypted frame issue. - * - * 05 28 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Move define of STA_REC_NUM to config.h and rename to CFG_STA_REC_NUM - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add Power Management - Legacy PS-POLL support. - * - * 04 28 2010 tehuang.liu - * [BORA00000605][WIFISYS] Phase3 Integration - * Modified some MQM-related data structures (SN counter, TX/RX BA table) - * - * 04 27 2010 tehuang.liu - * [BORA00000605][WIFISYS] Phase3 Integration - * Added new TX/RX BA tables in STA_REC - * - * 04 27 2010 tehuang.liu - * [BORA00000605][WIFISYS] Phase3 Integration - * Notify MQM, TXM, and RXM upon disconnection . - * - * 04 26 2010 tehuang.liu - * [BORA00000605][WIFISYS] Phase3 Integration - * Call mqm, txm, rxm functions upon disconnection - * - * 04 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW - * - * 04 22 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * First draft code to support protection in AP mode - * - * 04 19 2010 kevin.huang - * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support - * Add Beacon Timeout Support - * * * * * * * * * * and will send Null frame to diagnose connection - * - * 04 09 2010 tehuang.liu - * [BORA00000605][WIFISYS] Phase3 Integration - * [BORA00000644] WiFi phase 4 integration - * * Added per-TID SN cache in STA_REC - * - * 04 07 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Different invoking order for WTBL entry of associated AP - * - * 03 29 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * move the wlan table alloc / free to change state function. - * - * 03 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support power control - * - * 03 03 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Initialize StaRec->arStaWaitQueue - * - * 03 03 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add debug message when no available pkt buffer - * - * 03 01 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Fixed STA_REC initialization bug: prStaRec->au2CachedSeqCtrl[k] - * - * 02 26 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Added fgIsWmmSupported in STA_RECORD_T. - * - * 02 26 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Added fgIsUapsdSupported in STA_RECORD_T - * - * 02 26 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * add support of Driver STA_RECORD_T activation - * - * 02 13 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Added arTspecTable in STA_REC for TSPEC management - * - * 02 12 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Enable mgmt buffer debug by default - * - * 02 12 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Added BUFFER_SOURCE_BCN - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup - * - * 01 11 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add Deauth and Disassoc Handler - * - * 01 08 2010 cp.wu - * [BORA00000368]Integrate HIF part into BORA - * 1) separate wifi_var_emu.c/.h from wifi_var.c/.h - * * * * * * * * * 2) eliminate HIF_EMULATION code sections appeared in wifi_var/cnm_mem - * * * * * * * * * 3) use cnmMemAlloc() instead to allocate SRAM buffer - * - * 12 25 2009 tehuang.liu - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Integrated modifications for 1st connection (mainly on FW modules MQM, TXM, and RXM) - * * * * * * * MQM: BA handling - * * * * * * * TXM: Macros updates - * * * * * * * RXM: Macros/Duplicate Removal updates - * - * 12 24 2009 yarco.yang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * 12 21 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support several data buffer banks. - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * .For new FPGA memory size - * - * Dec 9 2009 MTK02468 - * [BORA00000337] To check in codes for FPGA emulation - * Removed DBGPRINT - * - * Dec 9 2009 mtk02752 - * [BORA00000368] Integrate HIF part into BORA - * add cnmDataPktFree() for emulation loopback purpose - * - * Dec 3 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix warning of null pointer - * - * Dec 3 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add cnmGetStaRecByAddress() and add fgIsInUse flag in STA_RECORD_T - * - * Nov 23 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Assign ucBufferSource in function cnmMgtPktAlloc() - * - * Nov 23 2009 mtk02468 - * [BORA00000337] To check in codes for FPGA emulation - * Added packet redispatch function calls - * - * Nov 13 2009 mtk01084 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * enable packet re-usable in current emulation driver - * - * Nov 12 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * 1. Add new function cnmGetStaRecByIndex() - * 2. Rename STA_REC_T to STA_RECORD_T - * - * Nov 9 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Call cnmDataPktDispatch() in cnmPktFree() - * - * Nov 2 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Remove definition of pragma section code - * - * Oct 28 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * - * - * Oct 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix lint warning - * - * Oct 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix typo - * - * Oct 12 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * - * - * Oct 8 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -static VOID -cnmStaRecHandleEventPkt ( - P_ADAPTER_T prAdapter, - P_CMD_INFO_T prCmdInfo, - PUINT_8 pucEventBuf - ); - -static VOID -cnmStaSendUpdateCmd ( - P_ADAPTER_T prAdapter, - P_STA_RECORD_T prStaRec, - BOOLEAN fgNeedResp - ); - -static VOID -cnmStaSendRemoveCmd ( - P_ADAPTER_T prAdapter, - P_STA_RECORD_T prStaRec - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -P_MSDU_INFO_T -cnmMgtPktAlloc ( - P_ADAPTER_T prAdapter, - UINT_32 u4Length - ) -{ - P_MSDU_INFO_T prMsduInfo; - P_QUE_T prQueList; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - prQueList = &prAdapter->rTxCtrl.rFreeMsduInfoList; - - /* Get a free MSDU_INFO_T */ - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_MSDU_INFO_LIST); - QUEUE_REMOVE_HEAD(prQueList, prMsduInfo, P_MSDU_INFO_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_MSDU_INFO_LIST); - - if (prMsduInfo) { - prMsduInfo->prPacket = cnmMemAlloc(prAdapter, RAM_TYPE_BUF, u4Length); - prMsduInfo->eSrc = TX_PACKET_MGMT; - - if (prMsduInfo->prPacket == NULL) { - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_MSDU_INFO_LIST); - QUEUE_INSERT_TAIL(prQueList, &prMsduInfo->rQueEntry); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_MSDU_INFO_LIST); - prMsduInfo = NULL; - } - } - -#if DBG - if (prMsduInfo == NULL) { - DBGLOG(MEM, WARN, ("\n")); - DBGLOG(MEM, WARN, ("MgtDesc#=%ld\n", prQueList->u4NumElem)); - -#if CFG_DBG_MGT_BUF - DBGLOG(MEM, WARN, ("rMgtBufInfo: alloc#=%ld, free#=%ld, null#=%ld\n", - prAdapter->rMgtBufInfo.u4AllocCount, - prAdapter->rMgtBufInfo.u4FreeCount, - prAdapter->rMgtBufInfo.u4AllocNullCount)); -#endif - - DBGLOG(MEM, WARN, ("\n")); - } -#endif - - return prMsduInfo; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmMgtPktFree ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ) -{ - P_QUE_T prQueList; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - ASSERT(prMsduInfo); - - prQueList = &prAdapter->rTxCtrl.rFreeMsduInfoList; - - ASSERT(prMsduInfo->prPacket); - if (prMsduInfo->prPacket) { - cnmMemFree(prAdapter, prMsduInfo->prPacket); - prMsduInfo->prPacket = NULL; - } - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_MSDU_INFO_LIST); - QUEUE_INSERT_TAIL(prQueList, &prMsduInfo->rQueEntry) - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_MSDU_INFO_LIST); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is used to initial the MGMT/MSG memory pool. -* -* \param (none) -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmMemInit ( - P_ADAPTER_T prAdapter - ) -{ - P_BUF_INFO_T prBufInfo; - - /* Initialize Management buffer pool */ - prBufInfo = &prAdapter->rMgtBufInfo; - kalMemZero(prBufInfo, sizeof(prAdapter->rMgtBufInfo)); - prBufInfo->pucBuf = prAdapter->pucMgtBufCached; - - /* Setup available memory blocks. 1 indicates FREE */ - prBufInfo->rFreeBlocksBitmap = - (BUF_BITMAP) BITS(0, MAX_NUM_OF_BUF_BLOCKS - 1); - - - /* Initialize Message buffer pool */ - prBufInfo = &prAdapter->rMsgBufInfo; - kalMemZero(prBufInfo, sizeof(prAdapter->rMsgBufInfo)); - prBufInfo->pucBuf = &prAdapter->aucMsgBuf[0]; - - /* Setup available memory blocks. 1 indicates FREE */ - prBufInfo->rFreeBlocksBitmap = - (BUF_BITMAP) BITS(0, MAX_NUM_OF_BUF_BLOCKS - 1); - - return; - -} /* end of cnmMemInit() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Allocate MGMT/MSG memory pool. -* -* \param[in] eRamType Target RAM type. -* TCM blk_sz= 16bytes, BUF blk_sz= 256bytes -* \param[in] u4Length Length of the buffer to allocate. -* -* \retval !NULL Pointer to the start address of allocated memory. -* \retval NULL Fail to allocat memory -*/ -/*----------------------------------------------------------------------------*/ -PVOID -cnmMemAlloc ( - IN P_ADAPTER_T prAdapter, - IN ENUM_RAM_TYPE_T eRamType, - IN UINT_32 u4Length - ) -{ - P_BUF_INFO_T prBufInfo; - BUF_BITMAP rRequiredBitmap; - UINT_32 u4BlockNum; - UINT_32 i, u4BlkSzInPower; - PVOID pvMemory; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - ASSERT(u4Length); - - if (eRamType == RAM_TYPE_MSG && u4Length <= 256) { - prBufInfo = &prAdapter->rMsgBufInfo; - u4BlkSzInPower = MSG_BUF_BLOCK_SIZE_IN_POWER_OF_2; - - u4Length += (MSG_BUF_BLOCK_SIZE - 1); - u4BlockNum = u4Length >> MSG_BUF_BLOCK_SIZE_IN_POWER_OF_2; - - ASSERT(u4BlockNum <= MAX_NUM_OF_BUF_BLOCKS); - } - else { - eRamType = RAM_TYPE_BUF; - - prBufInfo = &prAdapter->rMgtBufInfo; - u4BlkSzInPower = MGT_BUF_BLOCK_SIZE_IN_POWER_OF_2; - - u4Length += (MGT_BUF_BLOCK_SIZE - 1); - u4BlockNum = u4Length >> MGT_BUF_BLOCK_SIZE_IN_POWER_OF_2; - - ASSERT(u4BlockNum <= MAX_NUM_OF_BUF_BLOCKS); - } - -#if CFG_DBG_MGT_BUF - prBufInfo->u4AllocCount++; -#endif - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, - eRamType == RAM_TYPE_MSG ? SPIN_LOCK_MSG_BUF : SPIN_LOCK_MGT_BUF); - - if ((u4BlockNum > 0) && (u4BlockNum <= MAX_NUM_OF_BUF_BLOCKS)) { - - /* Convert number of block into bit cluster */ - rRequiredBitmap = BITS(0, u4BlockNum-1); - - for (i = 0; i <= (MAX_NUM_OF_BUF_BLOCKS - u4BlockNum); i++) { - - /* Have available memory blocks */ - if ((prBufInfo->rFreeBlocksBitmap & rRequiredBitmap) - == rRequiredBitmap) { - - /* Clear corresponding bits of allocated memory blocks */ - prBufInfo->rFreeBlocksBitmap &= ~rRequiredBitmap; - - /* Store how many blocks be allocated */ - prBufInfo->aucAllocatedBlockNum[i] = (UINT_8) u4BlockNum; - - KAL_RELEASE_SPIN_LOCK(prAdapter, - eRamType == RAM_TYPE_MSG ? - SPIN_LOCK_MSG_BUF : SPIN_LOCK_MGT_BUF); - - /* Return the start address of allocated memory */ - return (PVOID)(prBufInfo->pucBuf + (i << u4BlkSzInPower)); - - } - - rRequiredBitmap <<= 1; - } - } - -#ifdef LINUX - pvMemory = (PVOID)kalMemAlloc(u4Length, VIR_MEM_TYPE); -#else - pvMemory = (PVOID)NULL; -#endif - -#if CFG_DBG_MGT_BUF - prBufInfo->u4AllocNullCount++; - - if (pvMemory) { - prAdapter->u4MemAllocDynamicCount++; - } -#endif - - KAL_RELEASE_SPIN_LOCK(prAdapter, - eRamType == RAM_TYPE_MSG ? SPIN_LOCK_MSG_BUF : SPIN_LOCK_MGT_BUF); - - return pvMemory; - -} /* end of cnmMemAlloc() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Release memory to MGT/MSG memory pool. -* -* \param pucMemory Start address of previous allocated memory -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmMemFree ( - IN P_ADAPTER_T prAdapter, - IN PVOID pvMemory - ) -{ - P_BUF_INFO_T prBufInfo; - UINT_32 u4BlockIndex; - BUF_BITMAP rAllocatedBlocksBitmap; - ENUM_RAM_TYPE_T eRamType; - KAL_SPIN_LOCK_DECLARATION(); - - - ASSERT(prAdapter); - ASSERT(pvMemory); - if (!pvMemory) { - return; - } - - /* Judge it belongs to which RAM type */ - if ( ((UINT_32)pvMemory >= (UINT_32)&prAdapter->aucMsgBuf[0]) && - ((UINT_32)pvMemory <= (UINT_32)&prAdapter->aucMsgBuf[MSG_BUFFER_SIZE-1])) { - - prBufInfo = &prAdapter->rMsgBufInfo; - u4BlockIndex = ((UINT_32)pvMemory - (UINT_32)prBufInfo->pucBuf) - >> MSG_BUF_BLOCK_SIZE_IN_POWER_OF_2; - ASSERT(u4BlockIndex < MAX_NUM_OF_BUF_BLOCKS); - eRamType = RAM_TYPE_MSG; - } - else if ( ((UINT_32)pvMemory >= (UINT_32)prAdapter->pucMgtBufCached) && - ((UINT_32)pvMemory <= ((UINT_32)prAdapter->pucMgtBufCached + MGT_BUFFER_SIZE -1))) { - prBufInfo = &prAdapter->rMgtBufInfo; - u4BlockIndex = ((UINT_32)pvMemory - (UINT_32)prBufInfo->pucBuf) - >> MGT_BUF_BLOCK_SIZE_IN_POWER_OF_2; - ASSERT(u4BlockIndex < MAX_NUM_OF_BUF_BLOCKS); - eRamType = RAM_TYPE_BUF; - } - else { - #ifdef LINUX - /* For Linux, it is supported because size is not needed */ - kalMemFree(pvMemory, VIR_MEM_TYPE, 0); - #else - /* For Windows, it is not supported because of no size argument */ - ASSERT(0); - #endif - - #if CFG_DBG_MGT_BUF - prAdapter->u4MemFreeDynamicCount++; - #endif - return; - } - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, - eRamType == RAM_TYPE_MSG ? SPIN_LOCK_MSG_BUF : SPIN_LOCK_MGT_BUF); - -#if CFG_DBG_MGT_BUF - prBufInfo->u4FreeCount++; -#endif - - /* Convert number of block into bit cluster */ - ASSERT(prBufInfo->aucAllocatedBlockNum[u4BlockIndex] > 0); - - rAllocatedBlocksBitmap = - BITS(0, prBufInfo->aucAllocatedBlockNum[u4BlockIndex] - 1); - rAllocatedBlocksBitmap <<= u4BlockIndex; - - /* Clear saved block count for this memory segment */ - prBufInfo->aucAllocatedBlockNum[u4BlockIndex] = 0; - - /* Set corresponding bit of released memory block */ - prBufInfo->rFreeBlocksBitmap |= rAllocatedBlocksBitmap; - - KAL_RELEASE_SPIN_LOCK(prAdapter, - eRamType == RAM_TYPE_MSG ? SPIN_LOCK_MSG_BUF : SPIN_LOCK_MGT_BUF); - - return; - -} /* end of cnmMemFree() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmStaRecInit ( - P_ADAPTER_T prAdapter - ) -{ - P_STA_RECORD_T prStaRec; - UINT_16 i; - - for (i = 0; i < CFG_STA_REC_NUM; i++) { - prStaRec = &prAdapter->arStaRec[i]; - - prStaRec->ucIndex = (UINT_8) i; - prStaRec->fgIsInUse = FALSE; - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmStaRecUninit ( - IN P_ADAPTER_T prAdapter - ) -{ - P_STA_RECORD_T prStaRec; - UINT_16 i; - - for (i = 0; i < CFG_STA_REC_NUM; i++) { - prStaRec = &prAdapter->arStaRec[i]; - - if (prStaRec->fgIsInUse) { - cnmStaRecFree(prAdapter, prStaRec, FALSE); - } - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -P_STA_RECORD_T -cnmStaRecAlloc ( - P_ADAPTER_T prAdapter, - UINT_8 ucNetTypeIndex - ) -{ - P_STA_RECORD_T prStaRec; - UINT_16 i, k; - - ASSERT(prAdapter); - - for (i = 0; i < CFG_STA_REC_NUM; i++) { - prStaRec = &prAdapter->arStaRec[i]; - - if (!prStaRec->fgIsInUse) { - /*---- Initialize STA_REC_T here ----*/ - kalMemZero(prStaRec, sizeof(STA_RECORD_T)); - prStaRec->ucIndex = (UINT_8) i; - prStaRec->ucNetTypeIndex = ucNetTypeIndex; - prStaRec->fgIsInUse = TRUE; - - if (prStaRec->pucAssocReqIe) { - kalMemFree(prStaRec->pucAssocReqIe, VIR_MEM_TYPE, prStaRec->u2AssocReqIeLen); - prStaRec->pucAssocReqIe = NULL; - prStaRec->u2AssocReqIeLen = 0; - } - - /* Initialize the SN caches for duplicate detection */ - for (k = 0; k < TID_NUM + 1; k++) { - prStaRec->au2CachedSeqCtrl[k] = 0xFFFF; - } - - /* Initialize SW TX queues in STA_REC */ - for (k = 0; k < STA_WAIT_QUEUE_NUM; k++) { - LINK_INITIALIZE(&prStaRec->arStaWaitQueue[k]); - } - - /* Default enable TX/RX AMPDU */ - prStaRec->fgTxAmpduEn = TRUE; - prStaRec->fgRxAmpduEn = TRUE; - - for (k = 0; k < NUM_OF_PER_STA_TX_QUEUES; k++) { - QUEUE_INITIALIZE(&prStaRec->arTxQueue[k]); - } - - break; - } - } - - return (i < CFG_STA_REC_NUM) ? prStaRec : NULL; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmStaRecFree ( - P_ADAPTER_T prAdapter, - P_STA_RECORD_T prStaRec, - BOOLEAN fgSyncToChip - ) -{ - ASSERT(prAdapter); - ASSERT(prStaRec); - - /* To do: free related resources, e.g. timers, buffers, etc */ - cnmTimerStopTimer(prAdapter, &prStaRec->rTxReqDoneOrRxRespTimer); - prStaRec->fgTransmitKeyExist = FALSE; - prStaRec->fgSetPwrMgtBit = FALSE; - - if (prStaRec->pucAssocReqIe) { - kalMemFree(prStaRec->pucAssocReqIe, VIR_MEM_TYPE, prStaRec->u2AssocReqIeLen); - prStaRec->pucAssocReqIe = NULL; - prStaRec->u2AssocReqIeLen = 0; - } - - qmDeactivateStaRec(prAdapter, prStaRec->ucIndex); - - if (fgSyncToChip) { - cnmStaSendRemoveCmd(prAdapter, prStaRec); - } - - prStaRec->fgIsInUse = FALSE; - - return; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmStaFreeAllStaByNetType ( - P_ADAPTER_T prAdapter, - ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - BOOLEAN fgSyncToChip - ) -{ - P_STA_RECORD_T prStaRec; - UINT_16 i; - - for (i = 0; i < CFG_STA_REC_NUM; i++) { - prStaRec = (P_STA_RECORD_T) &prAdapter->arStaRec[i]; - - if (prStaRec->fgIsInUse && - prStaRec->ucNetTypeIndex == (UINT_8) eNetTypeIndex) { - - cnmStaRecFree(prAdapter, prStaRec, fgSyncToChip); - } - } /* end of for loop */ -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -P_STA_RECORD_T -cnmGetStaRecByIndex ( - P_ADAPTER_T prAdapter, - UINT_8 ucIndex - ) -{ - P_STA_RECORD_T prStaRec; - - ASSERT(prAdapter); - - prStaRec = (ucIndex < CFG_STA_REC_NUM) ? - &prAdapter->arStaRec[ucIndex] : NULL; - - if (prStaRec && prStaRec->fgIsInUse == FALSE) { - prStaRec = NULL; - } - - return prStaRec; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Get STA_RECORD_T by Peer MAC Address(Usually TA). -* -* @param[in] pucPeerMacAddr Given Peer MAC Address. -* -* @retval Pointer to STA_RECORD_T, if found. NULL, if not found -*/ -/*----------------------------------------------------------------------------*/ -P_STA_RECORD_T -cnmGetStaRecByAddress ( - P_ADAPTER_T prAdapter, - UINT_8 ucNetTypeIndex, - PUINT_8 pucPeerMacAddr - ) -{ - P_STA_RECORD_T prStaRec; - UINT_16 i; - - ASSERT(prAdapter); - ASSERT(pucPeerMacAddr); - - for (i = 0; i < CFG_STA_REC_NUM; i++) { - prStaRec = &prAdapter->arStaRec[i]; - - if (prStaRec->fgIsInUse && - prStaRec->ucNetTypeIndex == ucNetTypeIndex && - EQUAL_MAC_ADDR(prStaRec->aucMacAddr, pucPeerMacAddr)) { - break; - } - } - - return (i < CFG_STA_REC_NUM) ? prStaRec : NULL; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Reset the Status and Reason Code Field to 0 of all Station Records for -* the specified Network Type -* -* @param[in] eNetType Specify Network Type -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmStaRecResetStatus ( - P_ADAPTER_T prAdapter, - ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ) -{ - cnmStaFreeAllStaByNetType(prAdapter, eNetTypeIndex, FALSE); - -#if 0 - P_STA_RECORD_T prStaRec; - UINT_16 i; - - ASSERT(prAdapter); - - for (i = 0; i < CFG_STA_REC_NUM; i++) { - prStaRec = &prAdapter->arStaRec[i]; - - if (prStaRec->fgIsInUse) { - if ((NETWORK_TYPE_AIS_INDEX == eNetTypeIndex) && - IS_STA_IN_AIS(prStaRec->eStaType)) { - - prStaRec->u2StatusCode = STATUS_CODE_SUCCESSFUL; - prStaRec->u2ReasonCode = REASON_CODE_RESERVED; - prStaRec->ucJoinFailureCount = 0; - prStaRec->fgTransmitKeyExist = FALSE; - - prStaRec->fgSetPwrMgtBit = FALSE; - } - - /* TODO(Kevin): For P2P and BOW */ - } - } - - return; -#endif -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will change the ucStaState of STA_RECORD_T and also do -* event indication to HOST to sync the STA_RECORD_T in driver. -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* @param[in] u4NewState New STATE to change. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmStaRecChangeState ( - P_ADAPTER_T prAdapter, - P_STA_RECORD_T prStaRec, - UINT_8 ucNewState - ) -{ - BOOLEAN fgNeedResp; - - ASSERT(prAdapter); - ASSERT(prStaRec); - ASSERT(prStaRec->fgIsInUse); - - /* Do nothing when following state transitions happen, - * other 6 conditions should be sync to FW, including 1-->1, 3-->3 - */ - if ((ucNewState == STA_STATE_2 && prStaRec->ucStaState != STA_STATE_3) || - (ucNewState == STA_STATE_1 && prStaRec->ucStaState == STA_STATE_2)) { - prStaRec->ucStaState = ucNewState; - return; - } - - fgNeedResp = FALSE; - if (ucNewState == STA_STATE_3) { - secFsmEventStart(prAdapter, prStaRec); - if (ucNewState != prStaRec->ucStaState) { - fgNeedResp = TRUE; - } - } - else { - if (ucNewState != prStaRec->ucStaState && - prStaRec->ucStaState == STA_STATE_3) { - qmDeactivateStaRec(prAdapter, prStaRec->ucIndex); - } - fgNeedResp = FALSE; - } - prStaRec->ucStaState = ucNewState; - - cnmStaSendUpdateCmd(prAdapter, prStaRec, fgNeedResp); - -#if CFG_ENABLE_WIFI_DIRECT - /* To do: Confirm if it is invoked here or other location, but it should - * be invoked after state sync of STA_REC - * Update system operation parameters for AP mode - */ - if (prAdapter->fgIsP2PRegistered && (IS_STA_IN_P2P(prStaRec))) { - P_BSS_INFO_T prBssInfo; - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]; - - if (prBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT) { - rlmUpdateParamsForAP(prAdapter, prBssInfo, FALSE); - } - } -#endif - return; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief -* -* @param[in] -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -static VOID -cnmStaRecHandleEventPkt ( - P_ADAPTER_T prAdapter, - P_CMD_INFO_T prCmdInfo, - PUINT_8 pucEventBuf - ) -{ - P_EVENT_ACTIVATE_STA_REC_T prEventContent; - P_STA_RECORD_T prStaRec; - - prEventContent = (P_EVENT_ACTIVATE_STA_REC_T) pucEventBuf; - prStaRec = cnmGetStaRecByIndex(prAdapter, prEventContent->ucStaRecIdx); - - if (prStaRec && prStaRec->ucStaState == STA_STATE_3 && - !kalMemCmp(&prStaRec->aucMacAddr[0], &prEventContent->aucMacAddr[0], - MAC_ADDR_LEN)) { - - qmActivateStaRec(prAdapter, prStaRec); - } - -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief -* -* @param[in] -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -static VOID -cnmStaSendUpdateCmd ( - P_ADAPTER_T prAdapter, - P_STA_RECORD_T prStaRec, - BOOLEAN fgNeedResp - ) -{ - P_CMD_UPDATE_STA_RECORD_T prCmdContent; - WLAN_STATUS rStatus; - - ASSERT(prAdapter); - ASSERT(prStaRec); - ASSERT(prStaRec->fgIsInUse); - - /* To do: come out a mechanism to limit one STA_REC sync once for AP mode - * to avoid buffer empty case when many STAs are associated - * simultaneously. - */ - - /* To do: how to avoid 2 times of allocated memory. Use Stack? - * One is here, the other is in wlanSendQueryCmd() - */ - prCmdContent = cnmMemAlloc(prAdapter, - RAM_TYPE_BUF, sizeof(CMD_UPDATE_STA_RECORD_T)); - ASSERT(prCmdContent); - - /* To do: exception handle */ - if (!prCmdContent) { - return; - } - - prCmdContent->ucIndex = prStaRec->ucIndex; - prCmdContent->ucStaType = (UINT_8) prStaRec->eStaType; - kalMemCopy(&prCmdContent->aucMacAddr[0], &prStaRec->aucMacAddr[0], - MAC_ADDR_LEN); - prCmdContent->u2AssocId = prStaRec->u2AssocId; - prCmdContent->u2ListenInterval = prStaRec->u2ListenInterval; - prCmdContent->ucNetTypeIndex = prStaRec->ucNetTypeIndex; - - prCmdContent->ucDesiredPhyTypeSet = prStaRec->ucDesiredPhyTypeSet; - prCmdContent->u2DesiredNonHTRateSet = prStaRec->u2DesiredNonHTRateSet; - prCmdContent->u2BSSBasicRateSet = prStaRec->u2BSSBasicRateSet; - prCmdContent->ucMcsSet = prStaRec->ucMcsSet; - prCmdContent->ucSupMcs32 = (UINT_8) prStaRec->fgSupMcs32; - prCmdContent->u2HtCapInfo = prStaRec->u2HtCapInfo; - prCmdContent->ucNeedResp = (UINT_8) fgNeedResp; - -#if !CFG_SLT_SUPPORT - if(prAdapter->rWifiVar.eRateSetting != FIXED_RATE_NONE) { - /* override rate configuration */ - nicUpdateRateParams(prAdapter, - prAdapter->rWifiVar.eRateSetting, - &(prCmdContent->ucDesiredPhyTypeSet), - &(prCmdContent->u2DesiredNonHTRateSet), - &(prCmdContent->u2BSSBasicRateSet), - &(prCmdContent->ucMcsSet), - &(prCmdContent->ucSupMcs32), - &(prCmdContent->u2HtCapInfo)); - } -#endif - - prCmdContent->ucIsQoS = prStaRec->fgIsQoS; - prCmdContent->ucIsUapsdSupported = prStaRec->fgIsUapsdSupported; - prCmdContent->ucStaState = prStaRec->ucStaState; - - prCmdContent->ucAmpduParam = prStaRec->ucAmpduParam; - prCmdContent->u2HtExtendedCap = prStaRec->u2HtExtendedCap; - prCmdContent->u4TxBeamformingCap = prStaRec->u4TxBeamformingCap; - prCmdContent->ucAselCap = prStaRec->ucAselCap; - prCmdContent->ucRCPI = prStaRec->ucRCPI; - - prCmdContent->ucUapsdAc = prStaRec->ucBmpTriggerAC | (prStaRec->ucBmpDeliveryAC << 4); - prCmdContent->ucUapsdSp = prStaRec->ucUapsdSp; - - rStatus = wlanSendSetQueryCmd ( - prAdapter, /* prAdapter */ - CMD_ID_UPDATE_STA_RECORD, /* ucCID */ - TRUE, /* fgSetQuery */ - fgNeedResp, /* fgNeedResp */ - FALSE, /* fgIsOid */ - fgNeedResp? cnmStaRecHandleEventPkt : NULL, - NULL, /* pfCmdTimeoutHandler */ - sizeof(CMD_UPDATE_STA_RECORD_T), /* u4SetQueryInfoLen */ - (PUINT_8) prCmdContent, /* pucInfoBuffer */ - NULL, /* pvSetQueryBuffer */ - 0 /* u4SetQueryBufferLen */ - ); - - ASSERT(rStatus == WLAN_STATUS_PENDING); - - cnmMemFree(prAdapter, prCmdContent); -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief -* -* @param[in] -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -static VOID -cnmStaSendRemoveCmd ( - P_ADAPTER_T prAdapter, - P_STA_RECORD_T prStaRec - ) -{ - CMD_REMOVE_STA_RECORD_T rCmdContent; - WLAN_STATUS rStatus; - - ASSERT(prAdapter); - ASSERT(prStaRec); - - rCmdContent.ucIndex = prStaRec->ucIndex; - kalMemCopy(&rCmdContent.aucMacAddr[0], &prStaRec->aucMacAddr[0], - MAC_ADDR_LEN); - - rStatus = wlanSendSetQueryCmd ( - prAdapter, /* prAdapter */ - CMD_ID_REMOVE_STA_RECORD, /* ucCID */ - TRUE, /* fgSetQuery */ - FALSE, /* fgNeedResp */ - FALSE, /* fgIsOid */ - NULL, /* pfCmdDoneHandler */ - NULL, /* pfCmdTimeoutHandler */ - sizeof(CMD_REMOVE_STA_RECORD_T), /* u4SetQueryInfoLen */ - (PUINT_8) &rCmdContent, /* pucInfoBuffer */ - NULL, /* pvSetQueryBuffer */ - 0 /* u4SetQueryBufferLen */ - ); - - ASSERT(rStatus == WLAN_STATUS_PENDING); -} - - diff --git a/drivers/net/wireless/mt5931/mgmt/cnm_timer.c b/drivers/net/wireless/mt5931/mgmt/cnm_timer.c deleted file mode 100755 index 2e8a8d7fa1b8..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/cnm_timer.c +++ /dev/null @@ -1,531 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/cnm_timer.c#1 $ -*/ - -/*! \file "cnm_timer.c" - \brief - -*/ - - - -/* -** $Log: cnm_timer.c $ - * - * 12 13 2011 cm.chang - * [WCXRP00001136] [All Wi-Fi][Driver] Add wake lock for pending timer - * Add wake lock if timer timeout value is smaller than 5 seconds - * - * 02 24 2011 cp.wu - * [WCXRP00000490] [MT6620 Wi-Fi][Driver][Win32] modify kalMsleep() implementation because NdisMSleep() won't sleep long enough for specified interval such as 500ms - * modify cnm_timer and hem_mbox APIs to be thread safe to ease invoking restrictions - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * cnm_timer has been migrated. - * - * 05 28 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support sleep notification to host - * - * 05 19 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add some checking assertions - * - * 04 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Return timer token back to COS when entering wait off state - * - * 01 11 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Remove compiling warning - * - * 01 08 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support longer timeout interval to 45 days from 65secu1rwduu`wvpghlqg|fh+fmdkb - * - * 01 06 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Fix system time is 32KHz instead of 1ms - * - * 01 04 2010 tehuang.liu - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * For working out the first connection Chariot-verified version - * - * Dec 3 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Place rRootTimer.rNextExpiredSysTime = rExpiredSysTime; before set timer - * - * Oct 30 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * In cnmTimerInitialize(), just stop timer if it was already created. - * - * Oct 30 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Move the external reference for Lint to precomp.h - * - * Oct 30 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix lint warning - * - * Oct 28 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set the time to do the time out check. -* -* \param[in] rTimeout Time out interval from current time. -* -* \retval TRUE Success. -* -*/ -/*----------------------------------------------------------------------------*/ -static BOOLEAN -cnmTimerSetTimer ( - IN P_ADAPTER_T prAdapter, - IN OS_SYSTIME rTimeout - ) -{ - P_ROOT_TIMER prRootTimer; - BOOLEAN fgNeedWakeLock; - - ASSERT(prAdapter); - - prRootTimer = &prAdapter->rRootTimer; - - kalSetTimer(prAdapter->prGlueInfo, rTimeout); - - if (rTimeout <= SEC_TO_SYSTIME(WAKE_LOCK_MAX_TIME)) { - fgNeedWakeLock = TRUE; - - if (!prRootTimer->fgWakeLocked) { - KAL_WAKE_LOCK(prAdapter, &prRootTimer->rWakeLock); - prRootTimer->fgWakeLocked = TRUE; - } - } - else { - fgNeedWakeLock = FALSE; - } - - return fgNeedWakeLock; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routines is called to initialize a root timer. -* -* \param[in] prAdapter -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmTimerInitialize ( - IN P_ADAPTER_T prAdapter - ) -{ - P_ROOT_TIMER prRootTimer; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - - prRootTimer = &prAdapter->rRootTimer; - - /* Note: glue layer have configured timer */ - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER); - LINK_INITIALIZE(&prRootTimer->rLinkHead); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER); - - KAL_WAKE_LOCK_INIT(prAdapter, &prRootTimer->rWakeLock, "WLAN Timer"); - prRootTimer->fgWakeLocked = FALSE; - return; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routines is called to destroy a root timer. -* When WIFI is off, the token shall be returned back to system. -* -* \param[in] -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmTimerDestroy ( - IN P_ADAPTER_T prAdapter - ) -{ - P_ROOT_TIMER prRootTimer; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - - prRootTimer = &prAdapter->rRootTimer; - - if (prRootTimer->fgWakeLocked) { - KAL_WAKE_UNLOCK(prAdapter, &prRootTimer->rWakeLock); - prRootTimer->fgWakeLocked = FALSE; - } - KAL_WAKE_LOCK_DESTROY(prAdapter, &prRootTimer->rWakeLock); - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER); - LINK_INITIALIZE(&prRootTimer->rLinkHead); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER); - - /* Note: glue layer will be responsible for timer destruction */ - - return; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routines is called to initialize a timer. -* -* \param[in] prTimer Pointer to a timer structure. -* \param[in] pfnFunc Pointer to the call back function. -* \param[in] u4Data Parameter for call back function. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmTimerInitTimer ( - IN P_ADAPTER_T prAdapter, - IN P_TIMER_T prTimer, - IN PFN_MGMT_TIMEOUT_FUNC pfFunc, - IN UINT_32 u4Data - ) -{ - ASSERT(prAdapter); - - ASSERT(prTimer); - -#if DBG - /* Note: NULL function pointer is permitted for HEM POWER */ - if (pfFunc == NULL) { - DBGLOG(CNM, WARN, ("Init timer with NULL callback function!\n")); - } -#endif - -#if DBG - ASSERT(prAdapter->rRootTimer.rLinkHead.prNext); - { - P_LINK_T prTimerList; - P_LINK_ENTRY_T prLinkEntry; - P_TIMER_T prPendingTimer; - - prTimerList = &(prAdapter->rRootTimer.rLinkHead); - - LINK_FOR_EACH(prLinkEntry, prTimerList) { - prPendingTimer = LINK_ENTRY(prLinkEntry, TIMER_T, rLinkEntry); - ASSERT(prPendingTimer); - ASSERT(prPendingTimer != prTimer); - } - } -#endif - - LINK_ENTRY_INITIALIZE(&prTimer->rLinkEntry); - - prTimer->pfMgmtTimeOutFunc = pfFunc; - prTimer->u4Data = u4Data; - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routines is called to stop a timer. -* -* \param[in] prTimer Pointer to a timer structure. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -static VOID -cnmTimerStopTimer_impl ( - IN P_ADAPTER_T prAdapter, - IN P_TIMER_T prTimer, - IN BOOLEAN fgAcquireSpinlock - ) -{ - P_ROOT_TIMER prRootTimer; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - ASSERT(prTimer); - - prRootTimer = &prAdapter->rRootTimer; - - if (fgAcquireSpinlock) { - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER); - } - - if (timerPendingTimer(prTimer)) { - LINK_REMOVE_KNOWN_ENTRY(&prRootTimer->rLinkHead, - &prTimer->rLinkEntry); - - /* Reduce dummy timeout for power saving, especially HIF activity. - * If two or more timers exist and being removed timer is smallest, - * this dummy timeout will still happen, but it is OK. - */ - if (LINK_IS_EMPTY(&prRootTimer->rLinkHead)) { - kalCancelTimer(prAdapter->prGlueInfo); - - if (fgAcquireSpinlock && prRootTimer->fgWakeLocked) { - KAL_WAKE_UNLOCK(prAdapter, &prRootTimer->rWakeLock); - prRootTimer->fgWakeLocked = FALSE; - } - } - } - - if (fgAcquireSpinlock) { - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER); - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routines is called to stop a timer. -* -* \param[in] prTimer Pointer to a timer structure. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmTimerStopTimer ( - IN P_ADAPTER_T prAdapter, - IN P_TIMER_T prTimer - ) -{ - ASSERT(prAdapter); - ASSERT(prTimer); - - cnmTimerStopTimer_impl(prAdapter, prTimer, TRUE); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routines is called to start a timer with wake_lock. -* -* \param[in] prTimer Pointer to a timer structure. -* \param[in] u4TimeoutMs Timeout to issue the timer and call back function -* (unit: ms). -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmTimerStartTimer ( - IN P_ADAPTER_T prAdapter, - IN P_TIMER_T prTimer, - IN UINT_32 u4TimeoutMs - ) -{ - P_ROOT_TIMER prRootTimer; - P_LINK_T prTimerList; - OS_SYSTIME rExpiredSysTime, rTimeoutSystime; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - ASSERT(prTimer); - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER); - - prRootTimer = &prAdapter->rRootTimer; - prTimerList= &prRootTimer->rLinkHead; - - /* If timeout interval is larger than 1 minute, the mod value is set - * to the timeout value first, then per minutue. - */ - if (u4TimeoutMs > MSEC_PER_MIN) { - ASSERT(u4TimeoutMs <= ((UINT_32)0xFFFF * MSEC_PER_MIN)); - - prTimer->u2Minutes = (UINT_16)(u4TimeoutMs / MSEC_PER_MIN); - u4TimeoutMs -= (prTimer->u2Minutes * MSEC_PER_MIN); - if (u4TimeoutMs == 0) { - u4TimeoutMs = MSEC_PER_MIN; - prTimer->u2Minutes--; - } - } - else { - prTimer->u2Minutes = 0; - } - - /* The assertion check if MSEC_TO_SYSTIME() may be overflow. */ - ASSERT(u4TimeoutMs < (((UINT_32)0x80000000 - MSEC_PER_SEC) / KAL_HZ)); - rTimeoutSystime = MSEC_TO_SYSTIME(u4TimeoutMs); - rExpiredSysTime = kalGetTimeTick() + rTimeoutSystime; - - /* If no timer pending or the fast time interval is used. */ - if (LINK_IS_EMPTY(prTimerList) || - TIME_BEFORE(rExpiredSysTime, prRootTimer->rNextExpiredSysTime)) { - - prRootTimer->rNextExpiredSysTime = rExpiredSysTime; - cnmTimerSetTimer(prAdapter, rTimeoutSystime); - } - - /* Add this timer to checking list */ - prTimer->rExpiredSysTime = rExpiredSysTime; - - if (!timerPendingTimer(prTimer)) { - LINK_INSERT_TAIL(prTimerList, &prTimer->rLinkEntry); - } - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER); - - return; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routines is called to check the timer list. -* -* \param[in] -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cnmTimerDoTimeOutCheck ( - IN P_ADAPTER_T prAdapter - ) -{ - P_ROOT_TIMER prRootTimer; - P_LINK_T prTimerList; - P_LINK_ENTRY_T prLinkEntry; - P_TIMER_T prTimer; - OS_SYSTIME rCurSysTime; - PFN_MGMT_TIMEOUT_FUNC pfMgmtTimeOutFunc; - UINT_32 u4TimeoutData; - BOOLEAN fgNeedWakeLock; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - - /* acquire spin lock */ - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER); - - prRootTimer = &prAdapter->rRootTimer; - prTimerList= &prRootTimer->rLinkHead; - - rCurSysTime = kalGetTimeTick(); - - /* Set the permitted max timeout value for new one */ - prRootTimer->rNextExpiredSysTime = rCurSysTime + MGMT_MAX_TIMEOUT_INTERVAL; - - LINK_FOR_EACH(prLinkEntry, prTimerList) { - prTimer = LINK_ENTRY(prLinkEntry, TIMER_T, rLinkEntry); - ASSERT(prTimer); - - /* Check if this entry is timeout. */ - if (!TIME_BEFORE(rCurSysTime, prTimer->rExpiredSysTime)) { - cnmTimerStopTimer_impl(prAdapter, prTimer, FALSE); - - pfMgmtTimeOutFunc = prTimer->pfMgmtTimeOutFunc; - u4TimeoutData = prTimer->u4Data; - - if (prTimer->u2Minutes > 0) { - prTimer->u2Minutes--; - prTimer->rExpiredSysTime = - rCurSysTime + MSEC_TO_SYSTIME(MSEC_PER_MIN); - LINK_INSERT_TAIL(prTimerList, &prTimer->rLinkEntry); - } - else if (pfMgmtTimeOutFunc) { - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER); - (pfMgmtTimeOutFunc)(prAdapter, u4TimeoutData); - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER); - } - - /* Search entire list again because of nest del and add timers - * and current MGMT_TIMER could be volatile after stopped - */ - prLinkEntry = (P_LINK_ENTRY_T)prTimerList; - - prRootTimer->rNextExpiredSysTime = - rCurSysTime + MGMT_MAX_TIMEOUT_INTERVAL; - } - else if (TIME_BEFORE(prTimer->rExpiredSysTime, - prRootTimer->rNextExpiredSysTime)) { - prRootTimer->rNextExpiredSysTime = prTimer->rExpiredSysTime; - } - } /* end of for loop */ - - /* Setup the prNext timeout event. It is possible the timer was already - * set in the above timeout callback function. - */ - fgNeedWakeLock = FALSE; - if (!LINK_IS_EMPTY(prTimerList)) { - ASSERT(TIME_AFTER(prRootTimer->rNextExpiredSysTime, rCurSysTime)); - - fgNeedWakeLock = cnmTimerSetTimer(prAdapter, (OS_SYSTIME) - ((INT_32)prRootTimer->rNextExpiredSysTime - (INT_32)rCurSysTime)); - } - - if (prRootTimer->fgWakeLocked && !fgNeedWakeLock) { - KAL_WAKE_UNLOCK(prAdapter, &prRootTimer->rWakeLock); - prRootTimer->fgWakeLocked = FALSE; - } - - /* release spin lock */ - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER); -} - - diff --git a/drivers/net/wireless/mt5931/mgmt/hem_mbox.c b/drivers/net/wireless/mt5931/mgmt/hem_mbox.c deleted file mode 100755 index b6c627f16215..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/hem_mbox.c +++ /dev/null @@ -1,827 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/hem_mbox.c#3 $ -*/ - -/*! \file "hem_mbox.c" - \brief - -*/ - - - -/* -** $Log: hem_mbox.c $ -** -** 08 31 2012 yuche.tsai -** [ALPS00349585] [6577JB][WiFi direct][KE]Establish p2p connection while both device have connected to AP previously,one device reboots automatically with KE -** Fix possible KE when concurrent & disconnect. -** -** 07 26 2012 yuche.tsai -** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot -** Update driver code of ALPS.JB for hot-spot. -** -** 07 19 2012 yuche.tsai -** NULL -** Code update for JB. - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 05 03 2012 cp.wu - * [WCXRP00001231] [MT6620 Wi-Fi][MT5931][Driver] Correct SCAN_V2 related debugging facilities within hem_mbox.c - * correct for debug message string table by adding missed scan_v2 related definitions. - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 01 17 2012 yuche.tsai - * NULL - * Update mgmt frame filter setting. - * Please also update FW 2.1 - * - * 01 13 2012 yuche.tsai - * NULL - * WiFi Hot Spot Tethering for ICS ALPHA testing version. - * - * 11 24 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * Adjust code for DBG and CONFIG_XLOG. - * - * 11 15 2011 cm.chang - * NULL - * Add exception handle for NULL function pointer of mailbox message - * - * 11 11 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * modify the xlog related code. - * - * 11 02 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * adding the code for XLOG. - * - * 07 18 2011 cp.wu - * [WCXRP00000858] [MT5931][Driver][Firmware] Add support for scan to search for more than one SSID in a single scanning request - * add framework in driver domain for supporting new SCAN_REQ_V2 for more than 1 SSID support as well as uProbeDelay in NDIS 6.x driver model - * - * 06 07 2011 yuche.tsai - * [WCXRP00000696] [Volunteer Patch][MT6620][Driver] Infinite loop issue when RX invitation response.[WCXRP00000763] [Volunteer Patch][MT6620][Driver] RX Service Discovery Frame under AP mode Issue - * Add invitation support. - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 03 29 2011 cm.chang - * [WCXRP00000606] [MT6620 Wi-Fi][Driver][FW] Fix klocwork warning - * As CR title - * - * 02 24 2011 cp.wu - * [WCXRP00000490] [MT6620 Wi-Fi][Driver][Win32] modify kalMsleep() implementation because NdisMSleep() won't sleep long enough for specified interval such as 500ms - * modify cnm_timer and hem_mbox APIs to be thread safe to ease invoking restrictions - * - * 02 15 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Update bowString and channel grant. - * - * 01 26 2011 cm.chang - * [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument - * Allocate system RAM if fixed message or mgmt buffer is not available - * - * 01 26 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * . - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Fix Compile Error when DBG is disabled. - * - * 01 24 2011 cp.wu - * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving - * 1. add an extra counter for tracking pending forward frames. - * 2. notify TX service thread as well when there is pending forward frame - * 3. correct build errors leaded by introduction of Wi-Fi direct separation module - * - * 12 08 2010 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Support concurrent networks. - * - * 11 08 2010 cm.chang - * [WCXRP00000169] [MT6620 Wi-Fi][Driver][FW] Remove unused CNM recover message ID - * Remove CNM channel reover message ID - * - * 11 01 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module - * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead - * 2) Remove CNM CH-RECOVER event handling - * 3) cfg read/write API renamed with kal prefix for unified naming rules. - * - * 10 08 2010 wh.su - * [WCXRP00000085] [MT6620 Wif-Fi] [Driver] update the modified p2p state machine - * update the frog's new p2p state machine. - * - * 09 28 2010 wh.su - * NULL - * [WCXRP00000069][MT6620 Wi-Fi][Driver] Fix some code for phase 1 P2P Demo. - * - * 09 16 2010 cm.chang - * NULL - * Remove unused message ID - * - * 08 30 2010 cp.wu - * NULL - * eliminate klockwork errors - * - * 08 26 2010 yuche.tsai - * NULL - * Add P2P Connection Abort Event Message handler. - * - * 08 25 2010 george.huang - * NULL - * update OID/ registry control path for PM related settings - * - * 08 24 2010 yarco.yang - * NULL - * Fixed Driver ASSERT at mboxInitMsgMap() - * - * 08 24 2010 chinghwa.yu - * NULL - * Update for MID_SCN_BOW_SCAN_DONE mboxDummy. - * Update saa_fsm for BOW. - * - * 08 23 2010 chinghwa.yu - * NULL - * Add CFG_ENABLE_BT_OVER_WIFI. - * - * 08 23 2010 chinghwa.yu - * NULL - * Update for BOW. - * - * 08 16 2010 cp.wu - * NULL - * add interface for RLM to trigger OBSS-SCAN. - * - * 08 16 2010 yuche.tsai - * NULL - * Add debug message for newly add P2P message. - * - * 08 11 2010 yuche.tsai - * NULL - * Add some function entry for P2P FSM under provisioning phase.. - * - * 08 11 2010 yuche.tsai - * NULL - * Add some events to P2P Module. - * - * 08 05 2010 yuche.tsai - * NULL - * Add message box event for P2P device switch on & device discovery. - * - * 08 04 2010 cp.wu - * NULL - * remove unused mailbox message definitions. - * - * 08 02 2010 yuche.tsai - * NULL - * P2P Group Negotiation Code Check in. - * - * 07 19 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * message table should not be commented out by compilation option without modifying header file - * - * 07 19 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * Add Ad-Hoc support to AIS-FSM - * - * 07 19 2010 yuche.tsai - * - * Add wifi direct scan done callback. - * - * 07 09 2010 cp.wu - * - * change handler of MID_MNY_CNM_CONNECTION_ABORT from NULL to mboxDummy. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Rename MID_MNY_CNM_CH_RELEASE to MID_MNY_CNM_CH_ABORT - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * AIS-FSM integration with CNM channel request messages - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * implementation of DRV-SCN and related mailbox message handling. - * - * 07 01 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Modify CNM message handler for new flow - * - * 06 15 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * enable currently migrated message call-backs. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * restore utility function invoking via hem_mbox to direct calls - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add buildable & linkable ais_fsm.c - * - * related reference are still waiting to be resolved - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * hem_mbox is migrated. - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add hem_mbox.c and cnm_mem.h (but disabled some feature) for further migration - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Fix file merge error - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add Power Management - Legacy PS-POLL support. - * - * 04 29 2010 tehuang.liu - * [BORA00000605][WIFISYS] Phase3 Integration - * Removed MID_RXM_MQM_QOS_ACTION_FRAME - * - * 04 29 2010 tehuang.liu - * [BORA00000605][WIFISYS] Phase3 Integration - * Removed MID_RXM_MQM_BA_ACTION_FRAME - * - * 04 27 2010 tehuang.liu - * [BORA00000605][WIFISYS] Phase3 Integration - * MID_RXM_MQM_BA_ACTION_FRAME - * - * 03 30 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support 2.4G OBSS scan - * - * 03 16 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add AdHoc Mode - * - * 03 10 2010 kevin.huang - * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support - * - * * * * * * * * * * * * * * Add Channel Manager for arbitration of JOIN and SCAN Req - * - * 03 05 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Develop partial DPD code - * - * 02 11 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Updated arMsgMapTable for MID_RXM_MQM_QOS_ACTION_FRAME - * - * 01 11 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add Deauth and Disassoc Handler - * - * Dec 9 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add hemRunEventScanDone() to arMsgMapTable[] - * - * Dec 4 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix mboxDummy() didn't free prMsgHdr - * - * Dec 3 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add saaAisJoinComplete event handler - * - * Dec 2 2009 MTK02468 - * [BORA00000337] To check in codes for FPGA emulation - * Fixed the handler function name in arMsgMapTable for MID_RXM_MQM_BA_ACTION_FRAME - * - * Dec 2 2009 MTK02468 - * [BORA00000337] To check in codes for FPGA emulation - * Added MID_RXM_MQM_BA_ACTION_FRAME to MsgMapTable - * - * Nov 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Revise MSG Handler (remove dummy and add for SAA) - * - * Nov 16 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add aisFsmRunEventAbort() event handler - * - * Nov 11 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix typo - * - * Nov 10 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add more MSG_HNDL_ENTRY_T to avoid ASSERT() in mboxInitMsgMap() - * - * Nov 5 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add SCN message and function entry to arMsgMapTable[] - * - * Nov 2 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix sorting algorithm in mboxInitMsgMap() - * - * Oct 28 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ -#if DBG -/*lint -save -e64 Type mismatch */ -static PUINT_8 apucDebugMsg[] = { - (PUINT_8)DISP_STRING("MID_MNY_CNM_CH_REQ"), - (PUINT_8)DISP_STRING("MID_MNY_CNM_CH_ABORT"), - (PUINT_8)DISP_STRING("MID_CNM_AIS_CH_GRANT"), - (PUINT_8)DISP_STRING("MID_CNM_P2P_CH_GRANT"), - (PUINT_8)DISP_STRING("MID_CNM_BOW_CH_GRANT"), - - (PUINT_8)DISP_STRING("MID_AIS_SCN_SCAN_REQ"), - (PUINT_8)DISP_STRING("MID_AIS_SCN_SCAN_REQ_V2"), - (PUINT_8)DISP_STRING("MID_AIS_SCN_SCAN_CANCEL"), - (PUINT_8)DISP_STRING("MID_P2P_SCN_SCAN_REQ"), - (PUINT_8)DISP_STRING("MID_P2P_SCN_SCAN_REQ_V2"), - (PUINT_8)DISP_STRING("MID_P2P_SCN_SCAN_CANCEL"), - (PUINT_8)DISP_STRING("MID_BOW_SCN_SCAN_REQ"), - (PUINT_8)DISP_STRING("MID_BOW_SCN_SCAN_REQ_V2"), - (PUINT_8)DISP_STRING("MID_BOW_SCN_SCAN_CANCEL"), - (PUINT_8)DISP_STRING("MID_RLM_SCN_SCAN_REQ"), - (PUINT_8)DISP_STRING("MID_RLM_SCN_SCAN_REQ_V2"), - (PUINT_8)DISP_STRING("MID_RLM_SCN_SCAN_CANCEL"), - (PUINT_8)DISP_STRING("MID_SCN_AIS_SCAN_DONE"), - (PUINT_8)DISP_STRING("MID_SCN_P2P_SCAN_DONE"), - (PUINT_8)DISP_STRING("MID_SCN_BOW_SCAN_DONE"), - (PUINT_8)DISP_STRING("MID_SCN_RLM_SCAN_DONE"), - - (PUINT_8)DISP_STRING("MID_OID_AIS_FSM_JOIN_REQ"), - (PUINT_8)DISP_STRING("MID_OID_AIS_FSM_ABORT"), - (PUINT_8)DISP_STRING("MID_AIS_SAA_FSM_START"), - (PUINT_8)DISP_STRING("MID_AIS_SAA_FSM_ABORT"), - (PUINT_8)DISP_STRING("MID_SAA_AIS_JOIN_COMPLETE"), - -#if CFG_ENABLE_BT_OVER_WIFI - (PUINT_8)DISP_STRING("MID_BOW_SAA_FSM_START"), - (PUINT_8)DISP_STRING("MID_BOW_SAA_FSM_ABORT"), - (PUINT_8)DISP_STRING("MID_SAA_BOW_JOIN_COMPLETE"), -#endif - -#if CFG_ENABLE_WIFI_DIRECT - (PUINT_8)DISP_STRING("MID_P2P_SAA_FSM_START"), - (PUINT_8)DISP_STRING("MID_P2P_SAA_FSM_ABORT"), - (PUINT_8)DISP_STRING("MID_SAA_P2P_JOIN_COMPLETE"), - - (PUINT_8)DISP_STRING("MID_MNY_P2P_FUN_SWITCH"), - (PUINT_8)DISP_STRING("MID_MNY_P2P_DEVICE_DISCOVERY"), - (PUINT_8)DISP_STRING("MID_MNY_P2P_CONNECTION_REQ"), - (PUINT_8)DISP_STRING("MID_MNY_P2P_CONNECTION_ABORT"), - (PUINT_8)DISP_STRING("MID_MNY_P2P_BEACON_UPDATE"), - (PUINT_8)DISP_STRING("MID_MNY_P2P_STOP_AP"), - (PUINT_8)DISP_STRING("MID_MNY_P2P_CHNL_REQ"), - (PUINT_8)DISP_STRING("MID_MNY_P2P_CHNL_ABORT"), - (PUINT_8)DISP_STRING("MID_MNY_P2P_MGMT_TX"), - (PUINT_8)DISP_STRING("MID_MNY_P2P_GROUP_DISSOLVE"), - (PUINT_8)DISP_STRING("MID_MNY_P2P_MGMT_FRAME_REGISTER"), - (PUINT_8)DISP_STRING("MID_MNY_P2P_NET_DEV_REGISTER"), - (PUINT_8)DISP_STRING("MID_MNY_P2P_START_AP"), - (PUINT_8)DISP_STRING("MID_MNY_P2P_UPDATE_IE_BUF"), - #endif - -#if CFG_SUPPORT_ADHOC - //(PUINT_8)DISP_STRING("MID_AIS_CNM_CREATE_IBSS_REQ"), - //(PUINT_8)DISP_STRING("MID_CNM_AIS_CREATE_IBSS_GRANT"), - //(PUINT_8)DISP_STRING("MID_AIS_CNM_MERGE_IBSS_REQ"), - //(PUINT_8)DISP_STRING("MID_CNM_AIS_MERGE_IBSS_GRANT"), - (PUINT_8)DISP_STRING("MID_SCN_AIS_FOUND_IBSS"), -#endif /* CFG_SUPPORT_ADHOC */ - - (PUINT_8)DISP_STRING("MID_SAA_AIS_FSM_ABORT") -}; -/*lint -restore */ -#endif /* DBG */ - -/* This message entry will be re-ordered based on the message ID order - * by invoking mboxInitMsgMap() - */ -static MSG_HNDL_ENTRY_T arMsgMapTable[] = { - { MID_MNY_CNM_CH_REQ, cnmChMngrRequestPrivilege }, - { MID_MNY_CNM_CH_ABORT, cnmChMngrAbortPrivilege }, - { MID_CNM_AIS_CH_GRANT, aisFsmRunEventChGrant }, -#if CFG_ENABLE_WIFI_DIRECT - { MID_CNM_P2P_CH_GRANT, p2pFsmRunEventChGrant }, /*set in gl_p2p_init.c*/ -#else - { MID_CNM_P2P_CH_GRANT, mboxDummy }, -#endif - -#if CFG_ENABLE_BT_OVER_WIFI - { MID_CNM_BOW_CH_GRANT, bowRunEventChGrant }, -#else - { MID_CNM_BOW_CH_GRANT, mboxDummy }, -#endif - - /*--------------------------------------------------*/ - /* SCN Module Mailbox Messages */ - /*--------------------------------------------------*/ - { MID_AIS_SCN_SCAN_REQ, scnFsmMsgStart }, - { MID_AIS_SCN_SCAN_REQ_V2, scnFsmMsgStart }, - { MID_AIS_SCN_SCAN_CANCEL, scnFsmMsgAbort }, - { MID_P2P_SCN_SCAN_REQ, scnFsmMsgStart }, - { MID_P2P_SCN_SCAN_REQ_V2, scnFsmMsgStart }, - { MID_P2P_SCN_SCAN_CANCEL, scnFsmMsgAbort }, - { MID_BOW_SCN_SCAN_REQ, scnFsmMsgStart }, - { MID_BOW_SCN_SCAN_REQ_V2, scnFsmMsgStart }, - { MID_BOW_SCN_SCAN_CANCEL, scnFsmMsgAbort }, - { MID_RLM_SCN_SCAN_REQ, scnFsmMsgStart }, - { MID_RLM_SCN_SCAN_REQ_V2, scnFsmMsgStart }, - { MID_RLM_SCN_SCAN_CANCEL, scnFsmMsgAbort }, - { MID_SCN_AIS_SCAN_DONE, aisFsmRunEventScanDone }, -#if CFG_ENABLE_WIFI_DIRECT - { MID_SCN_P2P_SCAN_DONE, p2pFsmRunEventScanDone }, /*set in gl_p2p_init.c*/ -#else - { MID_SCN_P2P_SCAN_DONE, mboxDummy }, -#endif - -#if CFG_ENABLE_BT_OVER_WIFI - { MID_SCN_BOW_SCAN_DONE, bowResponderScanDone }, -#else - { MID_SCN_BOW_SCAN_DONE, mboxDummy }, -#endif - { MID_SCN_RLM_SCAN_DONE, rlmObssScanDone }, - - /*--------------------------------------------------*/ - /* AIS Module Mailbox Messages */ - /*--------------------------------------------------*/ - { MID_OID_AIS_FSM_JOIN_REQ, aisFsmRunEventAbort }, - { MID_OID_AIS_FSM_ABORT, aisFsmRunEventAbort }, - { MID_AIS_SAA_FSM_START, saaFsmRunEventStart }, - { MID_AIS_SAA_FSM_ABORT, saaFsmRunEventAbort }, - { MID_SAA_AIS_JOIN_COMPLETE, aisFsmRunEventJoinComplete }, - -#if CFG_ENABLE_BT_OVER_WIFI - /*--------------------------------------------------*/ - /* BOW Module Mailbox Messages */ - /*--------------------------------------------------*/ - { MID_BOW_SAA_FSM_START, saaFsmRunEventStart }, - { MID_BOW_SAA_FSM_ABORT, saaFsmRunEventAbort }, - { MID_SAA_BOW_JOIN_COMPLETE, bowFsmRunEventJoinComplete }, -#endif - -#if CFG_ENABLE_WIFI_DIRECT /*set in gl_p2p_init.c*/ - { MID_P2P_SAA_FSM_START, saaFsmRunEventStart }, - { MID_P2P_SAA_FSM_ABORT, saaFsmRunEventAbort }, - { MID_SAA_P2P_JOIN_COMPLETE, p2pFsmRunEventJoinComplete },// TODO: p2pFsmRunEventJoinComplete - - { MID_MNY_P2P_FUN_SWITCH, p2pFsmRunEventSwitchOPMode }, - { MID_MNY_P2P_DEVICE_DISCOVERY, p2pFsmRunEventScanRequest }, - { MID_MNY_P2P_CONNECTION_REQ, p2pFsmRunEventConnectionRequest }, - { MID_MNY_P2P_CONNECTION_ABORT, p2pFsmRunEventConnectionAbort }, - { MID_MNY_P2P_BEACON_UPDATE, p2pFsmRunEventBeaconUpdate }, - { MID_MNY_P2P_STOP_AP, p2pFsmRunEventStopAP }, - { MID_MNY_P2P_CHNL_REQ, p2pFsmRunEventChannelRequest }, - { MID_MNY_P2P_CHNL_ABORT, p2pFsmRunEventChannelAbort }, - { MID_MNY_P2P_MGMT_TX, p2pFsmRunEventMgmtFrameTx }, - { MID_MNY_P2P_GROUP_DISSOLVE, p2pFsmRunEventDissolve }, - { MID_MNY_P2P_MGMT_FRAME_REGISTER, p2pFsmRunEventMgmtFrameRegister }, - { MID_MNY_P2P_NET_DEV_REGISTER, p2pFsmRunEventNetDeviceRegister }, - { MID_MNY_P2P_START_AP, p2pFsmRunEventStartAP }, - { MID_MNY_P2P_MGMT_FRAME_UPDATE, p2pFsmRunEventUpdateMgmtFrame }, -#endif - -#if CFG_SUPPORT_ADHOC - { MID_SCN_AIS_FOUND_IBSS, aisFsmRunEventFoundIBSSPeer }, -#endif /* CFG_SUPPORT_ADHOC */ - - { MID_SAA_AIS_FSM_ABORT, aisFsmRunEventAbort } -}; - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -#if DBG -#define MBOX_HNDL_MSG(prAdapter, prMsg) do { \ - ASSERT(arMsgMapTable[prMsg->eMsgId].pfMsgHndl); \ - if (arMsgMapTable[prMsg->eMsgId].pfMsgHndl) { \ - DBGLOG(CNM, LOUD, ("DO MSG [%d: %s]\n", prMsg->eMsgId, apucDebugMsg[prMsg->eMsgId])); \ - arMsgMapTable[prMsg->eMsgId].pfMsgHndl(prAdapter, prMsg); \ - } \ - else { \ - DBGLOG(CNM, ERROR, ("NULL fptr for MSG [%d]\n", prMsg->eMsgId)); \ - cnmMemFree(prAdapter, prMsg); \ - } \ -} while (0) -#else -#define MBOX_HNDL_MSG(prAdapter, prMsg) do { \ - ASSERT(arMsgMapTable[prMsg->eMsgId].pfMsgHndl); \ - if (arMsgMapTable[prMsg->eMsgId].pfMsgHndl) { \ - DBGLOG(CNM, LOUD, ("DO MSG [%d]\n", prMsg->eMsgId)); \ - arMsgMapTable[prMsg->eMsgId].pfMsgHndl(prAdapter, prMsg); \ - } \ - else { \ - DBGLOG(CNM, ERROR, ("NULL fptr for MSG [%d]\n", prMsg->eMsgId)); \ - cnmMemFree(prAdapter, prMsg); \ - } \ -} while (0) -#endif -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -mboxInitMsgMap ( - VOID - ) -{ - UINT_32 i, idx; - MSG_HNDL_ENTRY_T rTempEntry; - - ASSERT((sizeof(arMsgMapTable) / sizeof(MSG_HNDL_ENTRY_T)) == MID_TOTAL_NUM); - - for (i = 0; i < MID_TOTAL_NUM; i++) { - if (arMsgMapTable[i].eMsgId == (ENUM_MSG_ID_T) i) { - continue; - } - for (idx = i + 1; idx < MID_TOTAL_NUM; idx++) { - if (arMsgMapTable[idx].eMsgId == (ENUM_MSG_ID_T) i) { - break; - } - } - ASSERT(idx < MID_TOTAL_NUM); - if (idx >= MID_TOTAL_NUM) { - continue; - } - - /* Swap target entry and current entry */ - rTempEntry.eMsgId = arMsgMapTable[idx].eMsgId; - rTempEntry.pfMsgHndl= arMsgMapTable[idx].pfMsgHndl; - - arMsgMapTable[idx].eMsgId = arMsgMapTable[i].eMsgId; - arMsgMapTable[idx].pfMsgHndl = arMsgMapTable[i].pfMsgHndl; - - arMsgMapTable[i].eMsgId = rTempEntry.eMsgId; - arMsgMapTable[i].pfMsgHndl = rTempEntry.pfMsgHndl; - } - - /* Verify the correctness of final message map */ - for (i = 0; i < MID_TOTAL_NUM; i++) { - ASSERT(arMsgMapTable[i].eMsgId == (ENUM_MSG_ID_T) i); - while (arMsgMapTable[i].eMsgId != (ENUM_MSG_ID_T) i); - } - -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -mboxSetup ( - IN P_ADAPTER_T prAdapter, - IN ENUM_MBOX_ID_T eMboxId - ) -{ - P_MBOX_T prMbox; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(eMboxId < MBOX_ID_TOTAL_NUM); - ASSERT(prAdapter); - - prMbox = &(prAdapter->arMbox[eMboxId]); - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX); - LINK_INITIALIZE(&prMbox->rLinkHead); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -mboxSendMsg ( - IN P_ADAPTER_T prAdapter, - IN ENUM_MBOX_ID_T eMboxId, - IN P_MSG_HDR_T prMsg, - IN EUNM_MSG_SEND_METHOD_T eMethod - ) -{ - P_MBOX_T prMbox; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(eMboxId < MBOX_ID_TOTAL_NUM); - ASSERT(prMsg); - ASSERT(prAdapter); - - prMbox = &(prAdapter->arMbox[eMboxId]); - - switch (eMethod) { - case MSG_SEND_METHOD_BUF: - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX); - LINK_INSERT_TAIL(&prMbox->rLinkHead, &prMsg->rLinkEntry); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX); - - // to wake up main service thread - GLUE_SET_EVENT(prAdapter->prGlueInfo); - - break; - - case MSG_SEND_METHOD_UNBUF: - MBOX_HNDL_MSG(prAdapter, prMsg); - break; - - default: - ASSERT(0); - break; - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -mboxRcvAllMsg ( - IN P_ADAPTER_T prAdapter, - ENUM_MBOX_ID_T eMboxId - ) -{ - P_MBOX_T prMbox; - P_MSG_HDR_T prMsg; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(eMboxId < MBOX_ID_TOTAL_NUM); - ASSERT(prAdapter); - - prMbox = &(prAdapter->arMbox[eMboxId]); - - while (!LINK_IS_EMPTY(&prMbox->rLinkHead) ) { - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX); - LINK_REMOVE_HEAD(&prMbox->rLinkHead, prMsg, P_MSG_HDR_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX); - - ASSERT(prMsg); - MBOX_HNDL_MSG(prAdapter, prMsg); - } - -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -mboxInitialize ( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_32 i; - - ASSERT(prAdapter); - - /* Initialize Mailbox */ - mboxInitMsgMap(); - - /* Setup/initialize each mailbox */ - for (i = 0; i < MBOX_ID_TOTAL_NUM; i++) { - mboxSetup(prAdapter, i); - } - -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -mboxDestroy ( - IN P_ADAPTER_T prAdapter - ) -{ - P_MBOX_T prMbox; - P_MSG_HDR_T prMsg; - UINT_8 i; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - - for (i = 0; i < MBOX_ID_TOTAL_NUM; i++) { - prMbox = &(prAdapter->arMbox[i]); - - while (!LINK_IS_EMPTY(&prMbox->rLinkHead) ) { - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX); - LINK_REMOVE_HEAD(&prMbox->rLinkHead, prMsg, P_MSG_HDR_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX); - - ASSERT(prMsg); - cnmMemFree(prAdapter, prMsg); - } - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This is dummy function to prevent empty arMsgMapTable[] for compiling. -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -mboxDummy ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - ASSERT(prAdapter); - - cnmMemFree(prAdapter, prMsgHdr); - - return; -} - diff --git a/drivers/net/wireless/mt5931/mgmt/mib.c b/drivers/net/wireless/mt5931/mgmt/mib.c deleted file mode 100755 index 270bdf97a71e..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/mib.c +++ /dev/null @@ -1,102 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/mib.c#1 $ -*/ - -/*! \file "mib.c" - \brief This file includes the mib default vale and functions. -*/ - - - -/* -** $Log: mib.c $ - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add mib.c. - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup - * - * Nov 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ -NON_HT_PHY_ATTRIBUTE_T rNonHTPhyAttributes[] = { - {RATE_SET_HR_DSSS, TRUE, FALSE }, /* For PHY_TYPE_HR_DSSS_INDEX(0) */ - {RATE_SET_ERP, TRUE, TRUE }, /* For PHY_TYPE_ERP_INDEX(1) */ - {RATE_SET_ERP_P2P, TRUE, TRUE }, /* For PHY_TYPE_ERP_P2P_INDEX(2) */ - {RATE_SET_OFDM, FALSE, FALSE }, /* For PHY_TYPE_OFDM_INDEX(3) */ -}; - -NON_HT_ADHOC_MODE_ATTRIBUTE_T rNonHTAdHocModeAttributes[AD_HOC_MODE_NUM] = { - {PHY_TYPE_HR_DSSS_INDEX, BASIC_RATE_SET_HR_DSSS}, /* For AD_HOC_MODE_11B(0) */ - {PHY_TYPE_ERP_INDEX, BASIC_RATE_SET_HR_DSSS_ERP}, /* For AD_HOC_MODE_MIXED_11BG(1) */ - {PHY_TYPE_ERP_INDEX, BASIC_RATE_SET_ERP}, /* For AD_HOC_MODE_11G(2) */ - {PHY_TYPE_OFDM_INDEX, BASIC_RATE_SET_OFDM}, /* For AD_HOC_MODE_11A(3) */ -}; - -NON_HT_AP_MODE_ATTRIBUTE_T rNonHTApModeAttributes[AP_MODE_NUM] = { - {PHY_TYPE_HR_DSSS_INDEX, BASIC_RATE_SET_HR_DSSS}, /* For AP_MODE_11B(0) */ - {PHY_TYPE_ERP_INDEX, BASIC_RATE_SET_HR_DSSS_ERP}, /* For AP_MODE_MIXED_11BG(1) */ - {PHY_TYPE_ERP_INDEX, BASIC_RATE_SET_ERP}, /* For AP_MODE_11G(2) */ - {PHY_TYPE_ERP_P2P_INDEX, BASIC_RATE_SET_ERP_P2P}, /* For AP_MODE_11G_P2P(3) */ - {PHY_TYPE_OFDM_INDEX, BASIC_RATE_SET_OFDM}, /* For AP_MODE_11A(4) */ -}; - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - - diff --git a/drivers/net/wireless/mt5931/mgmt/p2p_assoc.c b/drivers/net/wireless/mt5931/mgmt/p2p_assoc.c deleted file mode 100755 index d03d8338a261..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/p2p_assoc.c +++ /dev/null @@ -1,99 +0,0 @@ -/* -** $Id: @(#) p2p_assoc.c@@ -*/ - -/*! \file "p2p_assoc.c" - \brief This file includes the Wi-Fi Direct association-related functions. - - This file includes the association-related functions. -*/ - - - - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to compose Common Information Elements for P2P Association -* Request Frame. -* -* @param[in] prMsduInfo Pointer to the composed MSDU_INFO_T. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -PUINT_8 -p2pBuildReAssocReqFrameCommonIEs( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN PUINT_8 pucBuffer - ) -{ - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL; - - prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - - /* Fill the SSID element. */ - SSID_IE(pucBuffer)->ucId = ELEM_ID_SSID; - - /* NOTE(Kevin): We copy the SSID from CONNECTION_SETTINGS for the case of - * Passive Scan and the target BSS didn't broadcast SSID on its Beacon Frame. - */ - - COPY_SSID(SSID_IE(pucBuffer)->aucSSID, - SSID_IE(pucBuffer)->ucLength, - prP2pConnSettings->aucSSID, - prP2pConnSettings->ucSSIDLen); - - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - pucBuffer += IE_SIZE(pucBuffer); - return pucBuffer; -} - - diff --git a/drivers/net/wireless/mt5931/mgmt/p2p_bss.c b/drivers/net/wireless/mt5931/mgmt/p2p_bss.c deleted file mode 100755 index d9aa1a130034..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/p2p_bss.c +++ /dev/null @@ -1,66 +0,0 @@ -/* -** $Id: @(#) p2p_bss.c@@ -*/ - -/*! \file "p2p_bss.c" - \brief This file contains the functions for creating p2p BSS(AP). - - This file contains the functions for BSS(AP). We may create a BSS - network, or merge with exist IBSS network and sending Beacon Frame or reply - the Probe Response Frame for received Probe Request Frame. -*/ - - - - - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - - - diff --git a/drivers/net/wireless/mt5931/mgmt/p2p_fsm.c b/drivers/net/wireless/mt5931/mgmt/p2p_fsm.c deleted file mode 100755 index 6a72f32a5c0f..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/p2p_fsm.c +++ /dev/null @@ -1,3379 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/mgmt/p2p_fsm.c#61 $ -*/ - -/*! \file "p2p_fsm.c" - \brief This file defines the FSM for P2P Module. - - This file defines the FSM for P2P Module. -*/ - -/******************************************************************************* -* Copyright (c) 2010 MediaTek Inc. -* -* All rights reserved. Copying, compilation, modification, distribution -* or any other use whatsoever of this material is strictly prohibited -* except in accordance with a Software License Agreement with -* MediaTek Inc. -******************************************************************************** -*/ - -/******************************************************************************* -* LEGAL DISCLAIMER -* -* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND -* AGREES THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK -* SOFTWARE") RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE -* PROVIDED TO BUYER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY -* DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT -* LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -* PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE -* ANY WARRANTY WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY -* WHICH MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK -* SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY -* WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE -* FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION OR TO -* CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. -* -* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE -* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL -* BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT -* ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY -* BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -* -* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE -* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT -* OF LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING -* THEREOF AND RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN -* FRANCISCO, CA, UNDER THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE -* (ICC). -******************************************************************************** -*/ - -/* -** $Log: p2p_fsm.c $ -** -** 08 31 2012 yuche.tsai -** [ALPS00349585] [6577JB][WiFi direct][KE]Establish p2p connection while both device have connected to AP previously,one device reboots automatically with KE -** Fix possible KE when concurrent & disconnect. -** -** 08 21 2012 yuche.tsai -** NULL -** fix disconnect indication. -** -** 08 16 2012 yuche.tsai -** NULL -** Fix compile warning. -** -** 08 14 2012 yuche.tsai -** NULL -** Fix p2p bug find on ALPS.JB trunk. -** -** 07 27 2012 yuche.tsai -** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot -** Update for driver unload KE issue. -** -** 07 26 2012 yuche.tsai -** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot -** Update driver code of ALPS.JB for hot-spot. -** -** 07 19 2012 yuche.tsai -** NULL -** Code update for JB. - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 07 05 2011 yuche.tsai - * [WCXRP00000821] [Volunteer Patch][WiFi Direct][Driver] WiFi Direct Connection Speed Issue - * Fix the compile flag of enhancement. - * - * 07 05 2011 yuche.tsai - * [WCXRP00000808] [Volunteer Patch][MT6620][Driver/FW] Device discoverability issue fix - * Change device discoverability methodology. From driver SCAN to FW lock channel. - * - * 07 05 2011 yuche.tsai - * [WCXRP00000821] [Volunteer Patch][WiFi Direct][Driver] WiFi Direct Connection Speed Issue - * Add wifi direct connection enhancement method I, II & VI. - * - * 07 05 2011 yuche.tsai - * [WCXRP00000833] [Volunteer Patch][WiFi Direct][Driver] Service Discovery Frame RX Indicate Issue - * Fix Service Discovery Race Condition Issue. - * - * 06 23 2011 cp.wu - * [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module - * change parameter name from PeerAddr to BSSID - * - * 06 21 2011 yuche.tsai - * [WCXRP00000799] [Volunteer Patch][MT6620][Driver] Connection Indication Twice Issue. - * Fix an issue of accepting connection of GO. - * - * 06 21 2011 yuche.tsai - * [WCXRP00000775] [Volunteer Patch][MT6620][Driver] Dynamic enable SD capability - * Drop GAS frame when SD is not enabled. - * - * 06 20 2011 yuche.tsai - * NULL - * Fix compile error. - * - * 06 20 2011 yuche.tsai - * [WCXRP00000799] [Volunteer Patch][MT6620][Driver] Connection Indication Twice Issue. - * Fix connection indication twice issue. - * - * 06 20 2011 cp.wu - * [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module - * 1. specify target's BSSID when requesting channel privilege. - * 2. pass BSSID information to firmware domain - * - * 06 20 2011 yuche.tsai - * [WCXRP00000795] [Volunteer Patch][MT6620][Driver] GO can not connect second device issue - * Solve P2P GO can not formation with second device issue. - * - * 06 14 2011 yuche.tsai - * NULL - * Change disconnect feature. - * - * 06 10 2011 yuche.tsai - * [WCXRP00000775] [Volunteer Patch][MT6620][Driver] Dynamic enable SD capability[WCXRP00000776] [Need Patch][MT6620][Driver] MT6620 response probe request of P2P device with P2P IE under Hot Spot mode. - * 1. Dynamic enable SD capability after P2P supplicant ready. - * 2. Avoid response probe respone with p2p IE when under hot spot mode. - * - * 06 07 2011 yuche.tsai - * [WCXRP00000763] [Volunteer Patch][MT6620][Driver] RX Service Discovery Frame under AP mode Issue - * Fix RX SD request under AP mode issue. - * - * 06 02 2011 cp.wu - * [WCXRP00000681] [MT5931][Firmware] HIF code size reduction - * eliminate unused parameters for SAA-FSM - * - * 05 26 2011 yuche.tsai - * [WCXRP00000745] Support accepting connection after one Group Connection Lost. - -After Group Formation & lost connection, if MT6620 behave as: - -1. GO: It would keep under GO state until been dissolved by supplicant. - - At this time, other P2P device can use join method to join this group. - - -2. GC: It would keep on searching target GO or target device until been dissolved by supplicant. - -At this time, it would ignore other P2P device formation request. - - --- - -Modification: Make driver to accept GO NEGO REQ at this time, to let user decide to accept new connection or not. - - * [Volunteer Patch][MT6620][Driver] - * Driver would indicate connection request, if password ID is not ready but connection request is issued. - * - * 05 18 2011 yuche.tsai - * [WCXRP00000728] [Volunteer Patch][MT6620][Driver] Service Discovery Request TX issue. - * A solution for both connection request & IO control. - * - * 05 16 2011 yuche.tsai - * [WCXRP00000728] [Volunteer Patch][MT6620][Driver] Service Discovery Request TX issue. - * Fix SD request can not send out issue. - * - * 05 09 2011 terry.wu - * [WCXRP00000711] [MT6620 Wi-Fi][Driver] Set Initial value of StaType in StaRec for Hotspot Client - * Set initial value of StaType in StaRec for hotspot client. - * - * 05 04 2011 yuche.tsai - * [WCXRP00000697] [Volunteer Patch][MT6620][Driver] - * Bug fix for p2p descriptor is NULL if BSS descriptor is found first. - * - * 05 04 2011 yuche.tsai - * NULL - * Support partial persistent group function. - * - * 05 02 2011 yuche.tsai - * [WCXRP00000693] [Volunteer Patch][MT6620][Driver] Clear Formation Flag after TX lifetime timeout. - * Clear formation flag after formation timeout. - * - * 04 20 2011 yuche.tsai - * [WCXRP00000668] [Volunteer Patch][MT6620][Driver] Possible race condition when add scan & query scan result at the same time. - * Fix side effect while starting ATGO. - * - * 04 20 2011 yuche.tsai - * NULL - * Fix ASSERT issue in FW, side effect of last change. - * - * 04 19 2011 yuche.tsai - * [WCXRP00000668] [Volunteer Patch][MT6620][Driver] Possible race condition when add scan & query scan result at the same time. - * Workaround for multiple device connection, before invitation ready. - * - * 04 19 2011 yuche.tsai - * [WCXRP00000665] [Wifi Direct][MT6620 E4] When use Ralink's dongle to establish wifi direct connection with PBC. But 6573 always not pop accept option to establish connection. - * Support connection indication when GO NEGO REQ doesn't have configure method, instead it has PasswordID. - * - * 04 18 2011 yuche.tsai - * NULL - * Fix error. - * - * 04 14 2011 yuche.tsai - * [WCXRP00000646] [Volunteer Patch][MT6620][FW/Driver] Sigma Test Modification for some test case. - * Fix a connection issue. - * - * 04 14 2011 yuche.tsai - * [WCXRP00000646] [Volunteer Patch][MT6620][FW/Driver] Sigma Test Modification for some test case. - * Fix the channel issue of AP mode. - * - * 04 14 2011 yuche.tsai - * [WCXRP00000646] [Volunteer Patch][MT6620][FW/Driver] Sigma Test Modification for some test case. - * Connection flow refine for Sigma test. - * - * 04 09 2011 yuche.tsai - * [WCXRP00000624] [Volunteer Patch][MT6620][Driver] Add device discoverability support for GO. - * Fix Device discoverability related issue. - * - * 04 09 2011 yuche.tsai - * [WCXRP00000624] [Volunteer Patch][MT6620][Driver] Add device discoverability support for GO. - * Fix bug for Device Discoverability. - * - * 04 08 2011 yuche.tsai - * [WCXRP00000624] [Volunteer Patch][MT6620][Driver] Add device discoverability support for GO. - * Fix compile error. - * - * 04 08 2011 yuche.tsai - * [WCXRP00000624] [Volunteer Patch][MT6620][Driver] Add device discoverability support for GO. - * Add device discoverability support. - * - * 03 28 2011 yuche.tsai - * NULL - * Fix a possible issue for retry join when media status connected. - * - * 03 25 2011 yuche.tsai - * NULL - * Improve some error handleing. - * - * 03 24 2011 yuche.tsai - * NULL - * Assign AID before change STA_REC state to state 3. - * - * 03 23 2011 yuche.tsai - * NULL - * Fix Response Rate Issue when TX Auth Rsp Frame under P2P Mode. - * - * 03 23 2011 yuche.tsai - * NULL - * Fix issue of connection to one GC. - * - * 03 23 2011 yuche.tsai - * NULL - * Fix ASSERT issue when starting Hot-spot. - * - * 03 22 2011 yuche.tsai - * NULL - * When Target Information is not available, change to passive mode. - * - * 03 22 2011 yuche.tsai - * NULL - * Fix one connection issue while using Keypad to connect a GO. - * - * 03 22 2011 yuche.tsai - * NULL - * 1. Fix two issues that may cause kernel panic. - * - * 03 22 2011 yuche.tsai - * NULL - * Fix GC connect to other device issue. - * - * 03 22 2011 yuche.tsai - * NULL - * 1.Shorten the LISTEN interval. - * 2. Fix IF address issue when we are GO - * 3. Fix LISTEN channel issue. - * - * 03 22 2011 yuche.tsai - * NULL - * Modify formation policy setting. - * - * 03 21 2011 yuche.tsai - * NULL - * Solve Listen State doesn't response probe response issue. - * - * 03 21 2011 yuche.tsai - * NULL - * Change P2P Connection Request Flow. - * - * 03 19 2011 yuche.tsai - * [WCXRP00000584] [Volunteer Patch][MT6620][Driver] Add beacon timeout support for WiFi Direct. - * Add beacon timeout support. - * - * 03 19 2011 yuche.tsai - * [WCXRP00000583] [Volunteer Patch][MT6620][Driver] P2P connection of the third peer issue - * Indicate the correct Group SSID when join on Group. - * - * 03 19 2011 yuche.tsai - * [WCXRP00000583] [Volunteer Patch][MT6620][Driver] P2P connection of the third peer issue - * Support the third P2P device to join GO/GC group. - * - * 03 19 2011 yuche.tsai - * [WCXRP00000581] [Volunteer Patch][MT6620][Driver] P2P IE in Assoc Req Issue - * Append P2P IE in Assoc Req, so that GC can be discovered in probe response of GO. - * - * 03 18 2011 yuche.tsai - * [WCXRP00000578] [Volunteer Patch][MT6620][Driver] Separate Connection Request from general IOCTL - * Separate connection request from general IOCTL. - * - * 03 18 2011 yuche.tsai - * [WCXRP00000574] [Volunteer Patch][MT6620][Driver] Modify P2P FSM Connection Flow - * Modify connection flow after Group Formation Complete, or device connect to a GO. - * Instead of request channel & connect directly, we use scan to allocate channel bandwidth & connect after RX BCN. - * - * 03 17 2011 yuche.tsai - * NULL - * When AIS is connect to an AP, Hot Spot would be enabled under fixed same channel. - * - * 03 17 2011 yuche.tsai - * NULL - * Solve the Group Info IE in Probe Response incorrect issue. - * - * 03 17 2011 yuche.tsai - * NULL - * Release Channel after Join Complete. - * - * 03 16 2011 wh.su - * [WCXRP00000530] [MT6620 Wi-Fi] [Driver] skip doing p2pRunEventAAAComplete after send assoc response Tx Done - * enable the protected while at P2P start GO, and skip some security check . - * - * 03 15 2011 yuche.tsai - * [WCXRP00000560] [Volunteer Patch][MT6620][Driver] P2P Connection from UI using KEY/DISPLAY issue - * Fix local configure method issue. - * - * 03 15 2011 yuche.tsai - * [WCXRP00000560] [Volunteer Patch][MT6620][Driver] P2P Connection from UI using KEY/DISPLAY issue - * Fix some configure method issue. - * - * 03 14 2011 yuche.tsai - * NULL - * . - * - * 03 14 2011 yuche.tsai - * NULL - * Fix password ID issue. - * - * 03 10 2011 yuche.tsai - * NULL - * Add P2P API. - * - * 03 08 2011 yuche.tsai - * [WCXRP00000480] [Volunteer Patch][MT6620][Driver] WCS IE format issue[WCXRP00000509] [Volunteer Patch][MT6620][Driver] Kernal panic when remove p2p module. - * . - * - * 03 07 2011 yuche.tsai - * [WCXRP00000502] [Volunteer Patch][MT6620][Driver] Fix group ID issue when doing Group Formation. - * . - * - * 03 07 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * rename the define to anti_pviracy. - * - * 03 05 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * add the code to get the check rsponse and indicate to app. - * - * 03 04 2011 wh.su - * [WCXRP00000510] [MT6620 Wi-Fi] [Driver] Fixed the CTIA enter test mode issue - * fixed the p2p action frame type check for device request indication. - * - * 03 02 2011 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * Fix Service Discovery RX packet buffer pointer. - * - * 03 01 2011 yuche.tsai - * [WCXRP00000501] [Volunteer Patch][MT6620][Driver] No common channel issue when doing GO formation - * Update channel issue when doing GO formation.. - * - * 03 01 2011 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * Update Service Discovery Related wlanoid function. - * - * 02 21 2011 yuche.tsai - * [WCXRP00000481] [Volunteer Patch][MT6620][FW] Scan hang under concurrent case. - * Fix all BE issue of WSC or P2P IE. - * - * 02 18 2011 wh.su - * [WCXRP00000471] [MT6620 Wi-Fi][Driver] Add P2P Provison discovery append Config Method attribute at WSC IE - * fixed the wsc config method mapping to driver used config method issue. - * - * 02 18 2011 yuche.tsai - * [WCXRP00000479] [Volunteer Patch][MT6620][Driver] Probe Response of P2P using 11b rate. - * Update basic rate to FW, after P2P is initialed. - * - * 02 18 2011 yuche.tsai - * [WCXRP00000478] [Volunteer Patch][MT6620][Driver] Probe request frame during search phase do not contain P2P wildcard SSID. - * Use P2P Wildcard SSID when scan type of P2P_WILDCARD_SSID is set. - * - * 02 18 2011 yuche.tsai - * [WCXRP00000480] [Volunteer Patch][MT6620][Driver] WCS IE format issue - * Fix WSC IE BE format issue. - * - * 02 17 2011 wh.su - * [WCXRP00000471] [MT6620 Wi-Fi][Driver] Add P2P Provison discovery append Config Method attribute at WSC IE - * append the WSC IE config method attribute at provision discovery request. - * - * 02 16 2011 wh.su - * [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request - * fixed the probe request send out without WSC IE issue (at P2P). - * - * 02 16 2011 yuche.tsai - * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode. - * If two station connected to the Hot-Spot and one disconnect, FW would get into an infinite loop - * - * 02 15 2011 yuche.tsai - * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode. - * Fix re-connection issue after RX deauthentication. - * - * 02 15 2011 yuche.tsai - * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode. - * Fix conneciton issue after disconnect with AP. - * - * 02 12 2011 yuche.tsai - * [WCXRP00000441] [Volunteer Patch][MT6620][Driver] BoW can not create desired station type when Hot Spot is enabled. - * P2P Create Station Type according to Target BSS capability. - * - * 02 10 2011 yuche.tsai - * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode. - * Support Disassoc & Deauthentication for Hot-Spot. - * - * 02 09 2011 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * Add Service Discovery Indication Related code. - * - * 02 09 2011 yuche.tsai - * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode. - * Add Support for MLME deauthentication for Hot-Spot. - * - * 02 09 2011 yuche.tsai - * [WCXRP00000429] [Volunteer Patch][MT6620][Driver] Hot Spot Client Limit Issue - * Fix Client Limit Issue. - * - * 02 08 2011 yuche.tsai - * [WCXRP00000419] [Volunteer Patch][MT6620/MT5931][Driver] Provide function of disconnect to target station for AAA module. - * Disconnect every station client when disolve on P2P group. - * - * 02 08 2011 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * 1. Fix Service Disocvery Logical issue. - * 2. Fix a NULL pointer access violation issue when sending deauthentication packet to a class error station. - * - * 02 08 2011 yuche.tsai - * [WCXRP00000419] [Volunteer Patch][MT6620/MT5931][Driver] Provide function of disconnect to target station for AAA module. - * Workaround of disable P2P network. - * - * 02 08 2011 yuche.tsai - * [WCXRP00000421] [Volunteer Patch][MT6620][Driver] Fix incorrect SSID length Issue - * 1. Fixed SSID wrong length issue. - * 2. Under Hot Spot configuration, there won't be any P2P IE. - * 3. Under Hot Spot configuration, P2P FSM won't get into LISTEN state first. - * - * 01 27 2011 yuche.tsai - * [WCXRP00000399] [Volunteer Patch][MT6620/MT5931][Driver] Fix scan side effect after P2P module separate. - * Modify Start GO flow. - * - * 01 27 2011 yuche.tsai - * [WCXRP00000399] [Volunteer Patch][MT6620/MT5931][Driver] Fix scan side effect after P2P module separate. - * Fix desire phy type set issue. - * - * 01 27 2011 yuche.tsai - * [WCXRP00000399] [Volunteer Patch][MT6620/MT5931][Driver] Fix scan side effect after P2P module separate. - * Add desire phy type set phase I. - * - * 01 26 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Fix P2P Disconnect Issue. - * - * 01 26 2011 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * Add Service Discovery Function. - * - * 01 26 2011 cm.chang - * [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument - * . - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Fix compile error when DBG is disabled. - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Change Station Type Definition. - * - * 01 19 2011 yuche.tsai - * [WCXRP00000353] [Volunteer Patch][MT6620][Driver] Desired Non-HT Rate Set update when STA record is created under AP Mode. - * Add P2P QoS Support. - * - * 01 19 2011 george.huang - * [WCXRP00000355] [MT6620 Wi-Fi] Set WMM-PS related setting with qualifying AP capability - * Null NOA attribute setting when no related parameters. - * - * 01 14 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * Modify AAA flow according to CM's comment. - * - * 01 13 2011 yuche.tsai - * [WCXRP00000353] [Volunteer Patch][MT6620][Driver] Desired Non-HT Rate Set update when STA record is created under AP Mode. - * Resolve Channel ZERO issue. (Uninitialized default channel) - * - * 01 13 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * Update P2P State Debug Message. - * - * 01 12 2011 yuche.tsai - * [WCXRP00000353] [Volunteer Patch][MT6620][Driver] Desired Non-HT Rate Set update when STA record is created under AP Mode. - * Fix bug when allocating message buffer. - * - * 01 12 2011 yuche.tsai - * [WCXRP00000353] [Volunteer Patch][MT6620][Driver] Desired Non-HT Rate Set update when STA record is created under AP Mode. - * Update Phy Type Set. When legacy client is connected, it can use 11b rate, - * but if the P2P device is connected, 11b rate is not allowed. - * - * 01 12 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * 1. Modify Channel Acquire Time of AP mode from 5s to 1s. - * 2. Call cnmP2pIsPermit() before active P2P network. - * 3. Add channel selection support for AP mode. - * - * 01 12 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * Fix Bug of reference to NULL pointer. - * - * 01 12 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * Modify some behavior of AP mode. - * - * 01 12 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * Fix bug of wrong pointer check. - * - * 01 12 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * Fix Compile Error. - * - * 01 11 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * Add station record into client list before change it state from STATE_2 to STATE_3. - * - * 01 05 2011 yuche.tsai - * [WCXRP00000345] [MT6620][Volunteer Patch] P2P may issue a SSID specified scan request, but the SSID length is still invalid. - * Specify SSID Type when issue a scan request. - * - * 01 05 2011 cp.wu - * [WCXRP00000338] [MT6620 Wi-Fi][Driver] Separate kalMemAlloc into kmalloc and vmalloc implementations to ease physically continous memory demands - * correct typo - * - * 01 05 2011 george.huang - * [WCXRP00000343] [MT6620 Wi-Fi] Add TSF reset path for concurrent operation - * modify NOA update path for preventing assertion false alarm. - * - * 01 04 2011 cp.wu - * [WCXRP00000338] [MT6620 Wi-Fi][Driver] Separate kalMemAlloc into kmalloc and vmalloc implementations to ease physically continous memory demands - * separate kalMemAlloc() into virtually-continous and physically-continous type to ease slab system pressure - * - * 01 03 2011 wh.su - * [WCXRP00000326] [MT6620][Wi-Fi][Driver] check in the binary format gl_sec.o.new instead of use change type!!! - * let the p2p ap mode acept a legacy device join. - * - * 12 22 2010 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * Fix Compile Error. - * - * 12 15 2010 yuche.tsai - * [WCXRP00000245] 1. Invitation Request/Response. -2. Provision Discovery Request/Response - - * Refine Connection Flow. - * - * 12 08 2010 yuche.tsai - * [WCXRP00000245] [MT6620][Driver] Invitation & Provision Discovery Feature Check-in - * [WCXRP000000245][MT6620][Driver] Invitation Request Feature Add - * - * 12 08 2010 yuche.tsai - * [WCXRP00000244] [MT6620][Driver] Add station record type for each client when in AP mode. - * Change STA Type under AP mode. We would tell if client is a P2P device or a legacy client by checking the P2P IE in assoc req frame. - * - * 12 07 2010 cm.chang - * [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk - * The order of invoking nicUpdateBss() and rlm functions - * - * 12 02 2010 yuche.tsai - * NULL - * Update P2P Connection Policy for Invitation. - * - * 12 02 2010 yuche.tsai - * NULL - * Update P2P Connection Policy for Invitation & Provision Discovery. - * - * 11 30 2010 yuche.tsai - * NULL - * Invitation & Provision Discovery Indication. - * - * 11 30 2010 yuche.tsai - * NULL - * Update Configure Method indication & selection for Provision Discovery & GO_NEGO_REQ - * - * 11 30 2010 yuche.tsai - * NULL - * Update RCIP value when RX assoc request frame. - * - * 11 29 2010 yuche.tsai - * NULL - * Update P2P related function for INVITATION & PROVISION DISCOVERY. - * - * 11 26 2010 george.huang - * [WCXRP00000152] [MT6620 Wi-Fi] AP mode power saving function - * Update P2P PS for NOA function. - * - * 11 25 2010 yuche.tsai - * NULL - * Update Code for Invitation Related Function. - * - * 11 17 2010 wh.su - * [WCXRP00000164] [MT6620 Wi-Fi][Driver] Support the p2p random SSID[WCXRP00000179] [MT6620 Wi-Fi][FW] Set the Tx lowest rate at wlan table for normal operation - * fixed some ASSERT check. - * - * 11 05 2010 wh.su - * [WCXRP00000164] [MT6620 Wi-Fi][Driver] Support the p2p random SSID - * fixed the p2p role code error. - * - * 11 04 2010 wh.su - * [WCXRP00000164] [MT6620 Wi-Fi][Driver] Support the p2p random SSID - * adding the p2p random ssid support. - * - * 10 20 2010 wh.su - * [WCXRP00000124] [MT6620 Wi-Fi] [Driver] Support the dissolve P2P Group - * fixed the ASSERT check error - * - * 10 20 2010 wh.su - * [WCXRP00000124] [MT6620 Wi-Fi] [Driver] Support the dissolve P2P Group - * Add the code to support disconnect p2p group - * - * 10 19 2010 wh.su - * [WCXRP00000085] [MT6620 Wif-Fi] [Driver] update the modified p2p state machine[WCXRP00000102] [MT6620 Wi-Fi] [FW] Add a compiling flag and code for support Direct GO at Android - * fixed the compiling error. - * - * 10 14 2010 wh.su - * [WCXRP00000102] [MT6620 Wi-Fi] [FW] Add a compiling flag and code for support Direct GO at Android - * adding a code to support Direct GO with a compiling flag . - * - * 10 08 2010 cp.wu - * [WCXRP00000087] [MT6620 Wi-Fi][Driver] Cannot connect to 5GHz AP, driver will cause FW assert. - * correct erroneous logic: specifying eBand with incompatible eSco - * - * 10 08 2010 wh.su - * [WCXRP00000085] [MT6620 Wif-Fi] [Driver] update the modified p2p state machine - * fixed the compiling error. - * - * 10 08 2010 wh.su - * [WCXRP00000085] [MT6620 Wif-Fi] [Driver] update the modified p2p state machine - * update the frog's new p2p state machine. - * - * 09 10 2010 wh.su - * NULL - * fixed the compiling error at WinXP. - * - * 09 07 2010 yuche.tsai - * NULL - * Reset Common IE Buffer of P2P INFO when scan request is issued. - * If an action frame other than public action frame is received, return direcly. - * - * 09 07 2010 wh.su - * NULL - * adding the code for beacon/probe req/ probe rsp wsc ie at p2p. - * - * 09 06 2010 wh.su - * NULL - * let the p2p can set the privacy bit at beacon and rsn ie at assoc req at key handshake state. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 26 2010 yuche.tsai - * NULL - * Add P2P Connection Abort Event Message handler. - * - * 08 24 2010 cm.chang - * NULL - * Support RLM initail channel of Ad-hoc, P2P and BOW - * - * 08 23 2010 yuche.tsai - * NULL - * 1. Fix Interface Address from GO Nego Req/Rsp is not correct. - * 2. Fix GO mode does not change media state after station connected. - * 3. Fix STA don't response probe request when there is a connection request. - * - * 08 20 2010 cm.chang - * NULL - * Migrate RLM code to host from FW - * - * 08 20 2010 kevin.huang - * NULL - * Modify AAA Module for changing STA STATE 3 at p2p/bowRunEventAAAComplete() - * - * 08 20 2010 yuche.tsai - * NULL - * Add Glue Layer indication. - * - * 08 17 2010 yuche.tsai - * NULL - * Fix compile warning under Linux. - * - * 08 17 2010 yuche.tsai - * NULL - * Fix some P2P FSM bug. - * - * 08 16 2010 yuche.tsai - * NULL - * Add random Interface Address Generation support. - * - * 08 16 2010 yuche.tsai - * NULL - * Fix some P2P FSM bug. - * - * 08 16 2010 yuche.tsai - * NULL - * Update P2P FSM code for GO Nego. - * - * 08 16 2010 kevin.huang - * NULL - * Refine AAA functions - * - * 08 12 2010 kevin.huang - * NULL - * Refine bssProcessProbeRequest() and bssSendBeaconProbeResponse() - * - * 08 12 2010 yuche.tsai - * NULL - * Join complete indication. - * - * 08 11 2010 yuche.tsai - * NULL - * Add two boolean in connection request. - * Based on these two boolean value, P2P FSM should - * decide to do invitation or group formation or start a GO directly. - * - * 08 11 2010 yuche.tsai - * NULL - * Update P2P FSM, currently P2P Device Discovery is verified. - * - * 08 05 2010 yuche.tsai - * NULL - * Update P2P FSM for group formation. - * - * 08 03 2010 george.huang - * NULL - * handle event for updating NOA parameters indicated from FW - * - * 08 03 2010 cp.wu - * NULL - * limit build always needs spin-lock declaration. - * - * 08 02 2010 yuche.tsai - * NULL - * P2P Group Negotiation Code Check in. - * - * 07 26 2010 yuche.tsai - * - * Add P2P FSM code check in. - * - * 07 21 2010 yuche.tsai - * - * Add P2P Scan & Scan Result Parsing & Saving. - * - * 07 19 2010 yuche.tsai - * - * Update P2P FSM. - * - * 07 09 2010 george.huang - * - * [WPD00001556] Migrate PM variables from FW to driver: for composing QoS Info - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 21 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Fix compile error while enable WIFI_DIRECT support. - * - * 06 21 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Update P2P Function call. - * - * 06 17 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * First draft for migration P2P FSM from FW to Driver. - * - * 04 19 2010 kevin.huang - * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support - * Add Beacon Timeout Support and will send Null frame to diagnose connection - * - * 03 18 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Rename CFG flag for P2P - * - * 02 26 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add code to test P2P GO - * - * 02 23 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add Wi-Fi Direct SSID and P2P GO Test Mode - * - * 02 05 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Modify code due to BAND_24G define was changed - * - * 02 05 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Revise data structure to share the same BSS_INFO_T for avoiding coding error - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -#if CFG_ENABLE_WIFI_DIRECT - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ -#if DBG -/*lint -save -e64 Type mismatch */ -static PUINT_8 apucDebugP2pState[P2P_STATE_NUM] = { - (PUINT_8)DISP_STRING("P2P_STATE_IDLE"), - (PUINT_8)DISP_STRING("P2P_STATE_SCAN"), - (PUINT_8)DISP_STRING("P2P_STATE_AP_CHANNEL_DETECT"), - (PUINT_8)DISP_STRING("P2P_STATE_REQING_CHANNEL"), - (PUINT_8)DISP_STRING("P2P_STATE_CHNL_ON_HAND"), - (PUINT_8)DISP_STRING("P2P_STATE_GC_JOIN") -}; -/*lint -restore */ -#endif /* DBG */ - - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/* p2pStateXXX : Processing P2P FSM related action. - * p2pFSMXXX : Control P2P FSM flow. - * p2pFuncXXX : Function for doing one thing. - */ -VOID -p2pFsmInit ( - IN P_ADAPTER_T prAdapter - ) -{ - - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - - do { - ASSERT_BREAK(prAdapter != NULL); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - ASSERT_BREAK(prP2pFsmInfo != NULL); - - LINK_INITIALIZE(&(prP2pFsmInfo->rMsgEventQueue)); - - prP2pFsmInfo->eCurrentState = prP2pFsmInfo->ePreviousState = P2P_STATE_IDLE; - prP2pFsmInfo->prTargetBss = NULL; - - cnmTimerInitTimer(prAdapter, - &(prP2pFsmInfo->rP2pFsmTimeoutTimer), - (PFN_MGMT_TIMEOUT_FUNC)p2pFsmRunEventFsmTimeout, - (UINT_32)prP2pFsmInfo); - - //4 <2> Initiate BSS_INFO_T - common part - BSS_INFO_INIT(prAdapter, NETWORK_TYPE_P2P_INDEX); - - - //4 <2.1> Initiate BSS_INFO_T - Setup HW ID - prP2pBssInfo->ucConfigAdHocAPMode = AP_MODE_11G_P2P; - prP2pBssInfo->ucHwDefaultFixedRateCode = RATE_OFDM_6M; - - - prP2pBssInfo->ucNonHTBasicPhyType = (UINT_8) - rNonHTApModeAttributes[prP2pBssInfo->ucConfigAdHocAPMode].ePhyTypeIndex; - prP2pBssInfo->u2BSSBasicRateSet = - rNonHTApModeAttributes[prP2pBssInfo->ucConfigAdHocAPMode].u2BSSBasicRateSet; - - prP2pBssInfo->u2OperationalRateSet = - rNonHTPhyAttributes[prP2pBssInfo->ucNonHTBasicPhyType].u2SupportedRateSet; - - rateGetDataRatesFromRateSet(prP2pBssInfo->u2OperationalRateSet, - prP2pBssInfo->u2BSSBasicRateSet, - prP2pBssInfo->aucAllSupportedRates, - &prP2pBssInfo->ucAllSupportedRatesLen); - - prP2pBssInfo->prBeacon = cnmMgtPktAlloc(prAdapter, - OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem[0]) + MAX_IE_LENGTH); - - if (prP2pBssInfo->prBeacon) { - prP2pBssInfo->prBeacon->eSrc = TX_PACKET_MGMT; - prP2pBssInfo->prBeacon->ucStaRecIndex = 0xFF; /* NULL STA_REC */ - prP2pBssInfo->prBeacon->ucNetworkType = NETWORK_TYPE_P2P_INDEX; - } - else { - /* Out of memory. */ - ASSERT(FALSE); - } - - prP2pBssInfo->eCurrentOPMode = OP_MODE_NUM; - - prP2pBssInfo->rPmProfSetupInfo.ucBmpDeliveryAC = PM_UAPSD_ALL; - prP2pBssInfo->rPmProfSetupInfo.ucBmpTriggerAC = PM_UAPSD_ALL; - prP2pBssInfo->rPmProfSetupInfo.ucUapsdSp = WMM_MAX_SP_LENGTH_2; - prP2pBssInfo->ucPrimaryChannel = P2P_DEFAULT_LISTEN_CHANNEL; - prP2pBssInfo->eBand = BAND_2G4; - prP2pBssInfo->eBssSCO = CHNL_EXT_SCN; - - if (prAdapter->rWifiVar.fgSupportQoS) { - prP2pBssInfo->fgIsQBSS = TRUE; - } - else { - prP2pBssInfo->fgIsQBSS = FALSE; - } - - SET_NET_PWR_STATE_IDLE(prAdapter, NETWORK_TYPE_P2P_INDEX); - - p2pFsmStateTransition(prAdapter, prP2pFsmInfo, P2P_STATE_IDLE); - - } while (FALSE); - - return; -} /* p2pFsmInit */ - - - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief The function is used to uninitialize the value in P2P_FSM_INFO_T for -* P2P FSM operation -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFsmUninit ( - IN P_ADAPTER_T prAdapter - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - - do { - ASSERT_BREAK(prAdapter != NULL); - - DEBUGFUNC("p2pFsmUninit()"); - DBGLOG(P2P, INFO, ("->p2pFsmUninit()\n")); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - p2pFuncSwitchOPMode(prAdapter, prP2pBssInfo, OP_MODE_P2P_DEVICE, TRUE); - - p2pFsmRunEventAbort(prAdapter, prP2pFsmInfo); - - p2pStateAbort_IDLE(prAdapter, prP2pFsmInfo, P2P_STATE_NUM); - - UNSET_NET_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX); - - wlanAcquirePowerControl(prAdapter); - - /* Release all pending CMD queue. */ - DBGLOG(P2P, TRACE, ("p2pFsmUninit: wlanProcessCommandQueue, num of element:%d\n", prAdapter->prGlueInfo->rCmdQueue.u4NumElem)); - wlanProcessCommandQueue(prAdapter, &prAdapter->prGlueInfo->rCmdQueue); - - wlanReleasePowerControl(prAdapter); - - /* Release pending mgmt frame, - * mgmt frame may be pending by CMD without resource. - */ - kalClearMgmtFramesByNetType(prAdapter->prGlueInfo, NETWORK_TYPE_P2P_INDEX); - - /* Clear PendingCmdQue*/ - wlanReleasePendingCMDbyNetwork(prAdapter, NETWORK_TYPE_P2P_INDEX); - - if (prP2pBssInfo->prBeacon) { - cnmMgtPktFree(prAdapter, prP2pBssInfo->prBeacon); - prP2pBssInfo->prBeacon = NULL; - } - - } while (FALSE); - - return; - -} /* end of p2pFsmUninit() */ - -VOID -p2pFsmStateTransition ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN ENUM_P2P_STATE_T eNextState - ) -{ - BOOLEAN fgIsTransOut = (BOOLEAN)FALSE; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL)); - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - prP2pSpecificBssInfo = prAdapter->rWifiVar.prP2pSpecificBssInfo; - - if (!IS_BSS_ACTIVE(prP2pBssInfo)) { - if (!cnmP2PIsPermitted(prAdapter)) { - return; - } - - SET_NET_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX); - nicActivateNetwork(prAdapter, NETWORK_TYPE_P2P_INDEX); - } - - fgIsTransOut = fgIsTransOut?FALSE:TRUE; - - if (!fgIsTransOut) { - DBGLOG(P2P, STATE, ("TRANSITION: [%s] -> [%s]\n", - apucDebugP2pState[prP2pFsmInfo->eCurrentState], - apucDebugP2pState[eNextState])); - - /* Transition into current state. */ - prP2pFsmInfo->ePreviousState = prP2pFsmInfo->eCurrentState; - prP2pFsmInfo->eCurrentState = eNextState; - } - - - switch (prP2pFsmInfo->eCurrentState) { - case P2P_STATE_IDLE: - if (fgIsTransOut) { - - p2pStateAbort_IDLE(prAdapter, - prP2pFsmInfo, - eNextState); - } - else { - fgIsTransOut = p2pStateInit_IDLE(prAdapter, - prP2pFsmInfo, - prP2pBssInfo, - &eNextState); - } - - break; - case P2P_STATE_SCAN: - if (fgIsTransOut) { - - // Scan done / scan canceled. - p2pStateAbort_SCAN(prAdapter, prP2pFsmInfo, eNextState); - } - else { - // Initial scan request. - p2pStateInit_SCAN(prAdapter, prP2pFsmInfo); - } - - break; - case P2P_STATE_AP_CHANNEL_DETECT: - if (fgIsTransOut) { - // Scan done - // Get sparse channel result. - p2pStateAbort_AP_CHANNEL_DETECT(prAdapter, - prP2pFsmInfo, - prP2pSpecificBssInfo, - eNextState); - } - - else { - // Initial passive scan request. - p2pStateInit_AP_CHANNEL_DETECT(prAdapter, prP2pFsmInfo); - } - - break; - case P2P_STATE_REQING_CHANNEL: - if (fgIsTransOut) { - - // Channel on hand / Channel canceled. - p2pStateAbort_REQING_CHANNEL(prAdapter, prP2pFsmInfo, eNextState); - } - else { - // Initial channel request. - p2pFuncAcquireCh(prAdapter, &(prP2pFsmInfo->rChnlReqInfo)); - } - - break; - case P2P_STATE_CHNL_ON_HAND: - if (fgIsTransOut) { - p2pStateAbort_CHNL_ON_HAND(prAdapter, prP2pFsmInfo, prP2pBssInfo, eNextState); - } - else { - // Initial channel ready. - // Send channel ready event. - // Start a FSM timer. - p2pStateInit_CHNL_ON_HAND(prAdapter, prP2pBssInfo, prP2pFsmInfo); - } - - break; - case P2P_STATE_GC_JOIN: - if (fgIsTransOut) { - - // Join complete / join canceled. - p2pStateAbort_GC_JOIN(prAdapter, - prP2pFsmInfo, - &(prP2pFsmInfo->rJoinInfo), - eNextState); - } - else { - ASSERT(prP2pFsmInfo->prTargetBss != NULL); - - // Send request to SAA module. - p2pStateInit_GC_JOIN(prAdapter, - prP2pFsmInfo, - prP2pBssInfo, - &(prP2pFsmInfo->rJoinInfo), - prP2pFsmInfo->prTargetBss); - } - - break; - default: - break; - } - - } while (fgIsTransOut); - -} /* p2pFsmStateTransition */ - - -VOID -p2pFsmRunEventSwitchOPMode ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - P_MSG_P2P_SWITCH_OP_MODE_T prSwitchOpMode = (P_MSG_P2P_SWITCH_OP_MODE_T)prMsgHdr; - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prSwitchOpMode != NULL)); - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventSwitchOPMode\n")); - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - - if (prSwitchOpMode->eOpMode >= OP_MODE_NUM) { - ASSERT(FALSE); - break; - } - - /* P2P Device / GC. */ - p2pFuncSwitchOPMode(prAdapter, - prP2pBssInfo, - prSwitchOpMode->eOpMode, - TRUE); - - } while (FALSE); - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - -} /* p2pFsmRunEventSwitchOPMode */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is used to handle scan done event during Device Discovery. -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFsmRunEventScanDone ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_P2P_SCAN_REQ_INFO_T prScanReqInfo = (P_P2P_SCAN_REQ_INFO_T)NULL; - P_MSG_SCN_SCAN_DONE prScanDoneMsg = (P_MSG_SCN_SCAN_DONE)NULL; - ENUM_P2P_STATE_T eNextState = P2P_STATE_NUM; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsgHdr != NULL)); - - - /* This scan done event is either for "SCAN" phase or "SEARCH" state or "LISTEN" state. - * The scan done for SCAN phase & SEARCH state doesn't imply Device - * Discovery over. - */ - DBGLOG(P2P, TRACE, ("P2P Scan Done Event\n")); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo == NULL) { - break; - } - - - prScanReqInfo = &(prP2pFsmInfo->rScanReqInfo); - prScanDoneMsg = (P_MSG_SCN_SCAN_DONE)prMsgHdr; - - if (prScanDoneMsg->ucSeqNum != prScanReqInfo->ucSeqNumOfScnMsg) { - /* Scan Done message sequence number mismatch. - * Ignore this event. (P2P FSM issue two scan events.) - */ - /* The scan request has been cancelled. - * Ignore this message. It is possible. - */ - DBGLOG(P2P, TRACE, ("P2P Scan Don SeqNum:%d <-> P2P Fsm SCAN Msg:%d\n", - prScanDoneMsg->ucSeqNum, - prScanReqInfo->ucSeqNumOfScnMsg)); - - break; - } - - - switch (prP2pFsmInfo->eCurrentState) { - case P2P_STATE_SCAN: - { - P_P2P_CONNECTION_REQ_INFO_T prConnReqInfo = &(prP2pFsmInfo->rConnReqInfo); - - prScanReqInfo->fgIsAbort = FALSE; - - if (prConnReqInfo->fgIsConnRequest) { - - if ((prP2pFsmInfo->prTargetBss = p2pFuncKeepOnConnection(prAdapter, - &prP2pFsmInfo->rConnReqInfo, - &prP2pFsmInfo->rChnlReqInfo, - &prP2pFsmInfo->rScanReqInfo)) == NULL) { - eNextState = P2P_STATE_SCAN; - } - else { - eNextState = P2P_STATE_REQING_CHANNEL; - } - - } - else { - eNextState = P2P_STATE_IDLE; - } - - } - break; - case P2P_STATE_AP_CHANNEL_DETECT: - eNextState = P2P_STATE_REQING_CHANNEL; - break; - default: - /* Unexpected channel scan done event without being chanceled. */ - ASSERT(FALSE); - break; - } - - prScanReqInfo->fgIsScanRequest = FALSE; - - p2pFsmStateTransition(prAdapter, - prP2pFsmInfo, - eNextState); - - } while (FALSE); - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - return; -} /* p2pFsmRunEventScanDone */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is call when channel is granted by CNM module from FW. -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFsmRunEventChGrant ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL; - P_MSG_CH_GRANT_T prMsgChGrant = (P_MSG_CH_GRANT_T)NULL; - UINT_8 ucTokenID = 0; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsgHdr != NULL)); - - DBGLOG(P2P, TRACE, ("P2P Run Event Channel Grant\n")); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo == NULL) { - break; - } - - prMsgChGrant = (P_MSG_CH_GRANT_T)prMsgHdr; - ucTokenID = prMsgChGrant->ucTokenID; - prP2pFsmInfo->u4GrantInterval = prMsgChGrant->u4GrantInterval; - - prChnlReqInfo = &(prP2pFsmInfo->rChnlReqInfo); - - if (ucTokenID == prChnlReqInfo->ucSeqNumOfChReq) { - ENUM_P2P_STATE_T eNextState = P2P_STATE_NUM; - - switch (prP2pFsmInfo->eCurrentState) { - case P2P_STATE_REQING_CHANNEL: - switch (prChnlReqInfo->eChannelReqType) { - case CHANNEL_REQ_TYPE_REMAIN_ON_CHANNEL: - eNextState = P2P_STATE_CHNL_ON_HAND; - break; - case CHANNEL_REQ_TYPE_GC_JOIN_REQ: - eNextState = P2P_STATE_GC_JOIN; - break; - case CHANNEL_REQ_TYPE_GO_START_BSS: - eNextState = P2P_STATE_IDLE; - break; - default: - break; - } - - p2pFsmStateTransition(prAdapter, - prP2pFsmInfo, - eNextState); - break; - default: - /* Channel is granted under unexpected state. - * Driver should cancel channel privileagea before leaving the states. - */ - ASSERT(FALSE); - break; - } - - } - else { - /* Channel requsted, but released. */ - ASSERT(!prChnlReqInfo->fgIsChannelRequested); - } - } while (FALSE); - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - return; - -} /* p2pFsmRunEventChGrant */ - - -VOID -p2pFsmRunEventChannelRequest ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL; - P_MSG_P2P_CHNL_REQUEST_T prP2pChnlReqMsg = (P_MSG_P2P_CHNL_REQUEST_T)NULL; - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - ENUM_P2P_STATE_T eNextState = P2P_STATE_NUM; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsgHdr != NULL)); - - prP2pChnlReqMsg = (P_MSG_P2P_CHNL_REQUEST_T)prMsgHdr; - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo == NULL) { - break; - } - - prChnlReqInfo = &(prP2pFsmInfo->rChnlReqInfo); - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventChannelRequest\n")); - - /* Special case of time renewing for same frequency. */ - if ((prP2pFsmInfo->eCurrentState == P2P_STATE_CHNL_ON_HAND) && - (prChnlReqInfo->ucReqChnlNum == prP2pChnlReqMsg->rChannelInfo.ucChannelNum) && - (prChnlReqInfo->eBand == prP2pChnlReqMsg->rChannelInfo.eBand) && - (prChnlReqInfo->eChnlSco == prP2pChnlReqMsg->eChnlSco)) { - - ASSERT(prChnlReqInfo->fgIsChannelRequested == TRUE); - ASSERT(prChnlReqInfo->eChannelReqType == CHANNEL_REQ_TYPE_REMAIN_ON_CHANNEL); - - prChnlReqInfo->u8Cookie = prP2pChnlReqMsg->u8Cookie; - prChnlReqInfo->u4MaxInterval = prP2pChnlReqMsg->u4Duration; - - /* Re-enter the state. */ - eNextState = P2P_STATE_CHNL_ON_HAND; - } - else { - - // Make sure the state is in IDLE state. - p2pFsmRunEventAbort(prAdapter, prP2pFsmInfo); - - prChnlReqInfo->u8Cookie = prP2pChnlReqMsg->u8Cookie; /* Cookie can only be assign after abort.(for indication) */ - prChnlReqInfo->ucReqChnlNum = prP2pChnlReqMsg->rChannelInfo.ucChannelNum; - prChnlReqInfo->eBand = prP2pChnlReqMsg->rChannelInfo.eBand; - prChnlReqInfo->eChnlSco = prP2pChnlReqMsg->eChnlSco; - prChnlReqInfo->u4MaxInterval = prP2pChnlReqMsg->u4Duration; - prChnlReqInfo->eChannelReqType = CHANNEL_REQ_TYPE_REMAIN_ON_CHANNEL; - - eNextState = P2P_STATE_REQING_CHANNEL; - } - - p2pFsmStateTransition(prAdapter, prP2pFsmInfo, eNextState); - - } while (FALSE); - - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - return; -} /* p2pFsmRunEventChannelRequest */ - - -VOID -p2pFsmRunEventChannelAbort ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_MSG_P2P_CHNL_ABORT_T prChnlAbortMsg = (P_MSG_P2P_CHNL_ABORT_T)NULL; - P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsgHdr != NULL)); - - prChnlAbortMsg = (P_MSG_P2P_CHNL_ABORT_T)prMsgHdr; - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo == NULL) { - break; - } - - prChnlReqInfo = &prP2pFsmInfo->rChnlReqInfo; - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventChannelAbort\n")); - - if ((prChnlAbortMsg->u8Cookie == prChnlReqInfo->u8Cookie) && - (prChnlReqInfo->fgIsChannelRequested)) { - - ASSERT((prP2pFsmInfo->eCurrentState == P2P_STATE_REQING_CHANNEL || - (prP2pFsmInfo->eCurrentState == P2P_STATE_CHNL_ON_HAND))); - - p2pFsmStateTransition(prAdapter, prP2pFsmInfo, P2P_STATE_IDLE); - } - - } while (FALSE); - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - return; -} /* p2pFsmRunEventChannelAbort */ - - - -VOID -p2pFsmRunEventScanRequest ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_MSG_P2P_SCAN_REQUEST_T prP2pScanReqMsg = (P_MSG_P2P_SCAN_REQUEST_T)NULL; - P_P2P_SCAN_REQ_INFO_T prScanReqInfo = (P_P2P_SCAN_REQ_INFO_T)NULL; - UINT_32 u4ChnlListSize = 0; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsgHdr != NULL)); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo == NULL) { - break; - } - - prP2pScanReqMsg = (P_MSG_P2P_SCAN_REQUEST_T)prMsgHdr; - prScanReqInfo = &(prP2pFsmInfo->rScanReqInfo); - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventScanRequest\n")); - - // Make sure the state is in IDLE state. - p2pFsmRunEventAbort(prAdapter, prP2pFsmInfo); - - ASSERT(prScanReqInfo->fgIsScanRequest == FALSE); - - prScanReqInfo->fgIsAbort = TRUE; - prScanReqInfo->eScanType = SCAN_TYPE_ACTIVE_SCAN; - prScanReqInfo->eChannelSet = SCAN_CHANNEL_SPECIFIED; - - // Channel List - prScanReqInfo->ucNumChannelList = prP2pScanReqMsg->u4NumChannel; - DBGLOG(P2P, TRACE, ("Scan Request Channel List Number: %d\n", prScanReqInfo->ucNumChannelList)); - if (prScanReqInfo->ucNumChannelList > MAXIMUM_OPERATION_CHANNEL_LIST) { - DBGLOG(P2P, TRACE, ("Channel List Number Overloaded: %d, change to: %d\n", - prScanReqInfo->ucNumChannelList, - MAXIMUM_OPERATION_CHANNEL_LIST)); - prScanReqInfo->ucNumChannelList = MAXIMUM_OPERATION_CHANNEL_LIST; - } - - u4ChnlListSize = sizeof(RF_CHANNEL_INFO_T) * prScanReqInfo->ucNumChannelList; - kalMemCopy(prScanReqInfo->arScanChannelList, prP2pScanReqMsg->arChannelListInfo, u4ChnlListSize); - - // TODO: I only take the first SSID. Multiple SSID may be needed in the future. - // SSID - if (prP2pScanReqMsg->i4SsidNum >= 1) { - - kalMemCopy(&(prScanReqInfo->rSsidStruct), - prP2pScanReqMsg->prSSID, - sizeof(P2P_SSID_STRUCT_T)); - } - else { - prScanReqInfo->rSsidStruct.ucSsidLen = 0; - } - - // IE Buffer - kalMemCopy(prScanReqInfo->aucIEBuf, - prP2pScanReqMsg->pucIEBuf, - prP2pScanReqMsg->u4IELen); - - prScanReqInfo->u4BufLength = prP2pScanReqMsg->u4IELen; - - p2pFsmStateTransition(prAdapter, prP2pFsmInfo, P2P_STATE_SCAN); - - - - } while (FALSE); - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - -} /* p2pFsmRunEventScanRequest */ - - -VOID -p2pFsmRunEventScanAbort ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - - do { - ASSERT_BREAK(prAdapter != NULL); - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventScanAbort\n")); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo->eCurrentState == P2P_STATE_SCAN) { - P_P2P_SCAN_REQ_INFO_T prScanReqInfo = &(prP2pFsmInfo->rScanReqInfo); - - prScanReqInfo->fgIsAbort = TRUE; - - p2pFsmStateTransition(prAdapter, prP2pFsmInfo, P2P_STATE_IDLE); - } - - } while (FALSE); - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - return; -} /* p2pFsmRunEventScanAbort */ - - - - - -VOID -p2pFsmRunEventAbort ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo - ) -{ - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - do { - ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL)); - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventAbort\n")); - - if (prP2pFsmInfo->eCurrentState != P2P_STATE_IDLE) { - - if (prP2pFsmInfo->eCurrentState == P2P_STATE_SCAN) { - - P_P2P_SCAN_REQ_INFO_T prScanReqInfo = &(prP2pFsmInfo->rScanReqInfo); - - prScanReqInfo->fgIsAbort = TRUE; - } - else if (prP2pFsmInfo->eCurrentState == P2P_STATE_REQING_CHANNEL) { - /* 2012/08/06: frog - * Prevent Start GO. - */ - prP2pBssInfo->eIntendOPMode = OP_MODE_NUM; - } - - // For other state, is there any special action that should be take before leaving? - - p2pFsmStateTransition(prAdapter, prP2pFsmInfo, P2P_STATE_IDLE); - } - else { - /* P2P State IDLE. */ - P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = &(prP2pFsmInfo->rChnlReqInfo); - - if (prChnlReqInfo->fgIsChannelRequested) { - p2pFuncReleaseCh(prAdapter, prChnlReqInfo); - } - - cnmTimerStopTimer(prAdapter, &(prP2pFsmInfo->rP2pFsmTimeoutTimer)); - } - - - } while (FALSE); - - return; -} /* p2pFsmRunEventAbort */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is used to handle FSM Timeout. -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFsmRunEventFsmTimeout ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Param - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)u4Param; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL)); - - DBGLOG(P2P, TRACE, ("P2P FSM Timeout Event\n")); - - switch (prP2pFsmInfo->eCurrentState) { - case P2P_STATE_IDLE: - { - P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = &prP2pFsmInfo->rChnlReqInfo; - if (prChnlReqInfo->fgIsChannelRequested) { - p2pFuncReleaseCh(prAdapter, prChnlReqInfo); - } - else if (IS_NET_PWR_STATE_IDLE(prAdapter, NETWORK_TYPE_P2P_INDEX)) { - UNSET_NET_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX); - nicDeactivateNetwork(prAdapter, NETWORK_TYPE_P2P_INDEX); - } - - } - break; - -// case P2P_STATE_SCAN: -// break; -// case P2P_STATE_AP_CHANNEL_DETECT: -// break; -// case P2P_STATE_REQING_CHANNEL: -// break; - case P2P_STATE_CHNL_ON_HAND: - { - p2pFsmStateTransition(prAdapter, prP2pFsmInfo, P2P_STATE_IDLE); - } - break; -// case P2P_STATE_GC_JOIN: -// break; - default: - break; - } - - } while (FALSE); - - return; -} /* p2pFsmRunEventFsmTimeout */ - -VOID -p2pFsmRunEventMgmtFrameTx ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_MSG_P2P_MGMT_TX_REQUEST_T prMgmtTxMsg = (P_MSG_P2P_MGMT_TX_REQUEST_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsgHdr != NULL)); - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventMgmtFrameTx\n")); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo == NULL) { - break; - } - - prMgmtTxMsg = (P_MSG_P2P_MGMT_TX_REQUEST_T)prMsgHdr; - - p2pFuncTxMgmtFrame(prAdapter, - &prP2pFsmInfo->rMgmtTxInfo, - prMgmtTxMsg->prMgmtMsduInfo, - prMgmtTxMsg->u8Cookie); - - - - } while (FALSE); - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - return; - -} /* p2pFsmRunEventMgmtTx */ - - -VOID -p2pFsmRunEventStartAP ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - P_MSG_P2P_START_AP_T prP2pStartAPMsg = (P_MSG_P2P_START_AP_T)NULL; - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsgHdr != NULL)); - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventStartAP\n")); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo == NULL) { - break; - } - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - prP2pStartAPMsg = (P_MSG_P2P_START_AP_T)prMsgHdr; - prP2pSpecificBssInfo = prAdapter->rWifiVar.prP2pSpecificBssInfo; - - - if (prP2pStartAPMsg->u4BcnInterval) { - DBGLOG(P2P, TRACE, ("Beacon interval updated to :%ld \n", prP2pStartAPMsg->u4BcnInterval)); - prP2pBssInfo->u2BeaconInterval = (UINT_16)prP2pStartAPMsg->u4BcnInterval; - } - else if (prP2pBssInfo->u2BeaconInterval == 0) { - prP2pBssInfo->u2BeaconInterval = DOT11_BEACON_PERIOD_DEFAULT; - } - - if (prP2pStartAPMsg->u4DtimPeriod) { - DBGLOG(P2P, TRACE, ("DTIM interval updated to :%ld \n", prP2pStartAPMsg->u4DtimPeriod)); - prP2pBssInfo->ucDTIMPeriod = (UINT_8)prP2pStartAPMsg->u4DtimPeriod; - } - else if (prP2pBssInfo->ucDTIMPeriod == 0) { - prP2pBssInfo->ucDTIMPeriod = DOT11_DTIM_PERIOD_DEFAULT; - } - - if (prP2pStartAPMsg->u2SsidLen != 0) { - kalMemCopy(prP2pBssInfo->aucSSID, prP2pStartAPMsg->aucSsid, prP2pStartAPMsg->u2SsidLen); - kalMemCopy(prP2pSpecificBssInfo->aucGroupSsid, prP2pStartAPMsg->aucSsid, prP2pStartAPMsg->u2SsidLen); - prP2pBssInfo->ucSSIDLen = prP2pSpecificBssInfo->u2GroupSsidLen = prP2pStartAPMsg->u2SsidLen; - } - - - prP2pBssInfo->eHiddenSsidType = prP2pStartAPMsg->ucHiddenSsidType; - - - // TODO: JB - /* Privacy & inactive timeout. */ - - if ((prP2pBssInfo->eCurrentOPMode != OP_MODE_ACCESS_POINT) || - (prP2pBssInfo->eIntendOPMode != OP_MODE_NUM)) { - UINT_8 ucPreferedChnl = 0; - ENUM_BAND_T eBand = BAND_NULL; - ENUM_CHNL_EXT_T eSco = CHNL_EXT_SCN; - ENUM_P2P_STATE_T eNextState = P2P_STATE_SCAN; - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - - - if(prP2pFsmInfo->eCurrentState != P2P_STATE_SCAN && - prP2pFsmInfo->eCurrentState != P2P_STATE_IDLE) { - // Make sure the state is in IDLE state. - p2pFsmRunEventAbort(prAdapter, prP2pFsmInfo); - } - - // 20120118: Moved to p2pFuncSwitchOPMode(). - //SET_NET_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX); - - /* Leave IDLE state. */ - SET_NET_PWR_STATE_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX); - - // sync with firmware - //DBGLOG(P2P, INFO, ("Activate P2P Network. \n")); - //nicActivateNetwork(prAdapter, NETWORK_TYPE_P2P_INDEX); - - - /* Key to trigger P2P FSM to allocate channel for AP mode. */ - prP2pBssInfo->eIntendOPMode = OP_MODE_ACCESS_POINT; - - /* Sparse Channel to decide which channel to use. */ - if ((cnmPreferredChannel(prAdapter, - &eBand, - &ucPreferedChnl, - &eSco) == FALSE) && (prP2pConnSettings->ucOperatingChnl == 0)) { - // Sparse Channel Detection using passive mode. - eNextState = P2P_STATE_AP_CHANNEL_DETECT; - } - else { - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = prAdapter->rWifiVar.prP2pSpecificBssInfo; - P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = &prP2pFsmInfo->rChnlReqInfo; - - -#if 1 - /* 2012-01-27: frog - Channel set from upper layer is the first priority. */ - /* Becuase the channel & beacon is decided by p2p_supplicant. */ - if (prP2pConnSettings->ucOperatingChnl != 0) { - prP2pSpecificBssInfo->ucPreferredChannel = prP2pConnSettings->ucOperatingChnl; - prP2pSpecificBssInfo->eRfBand = prP2pConnSettings->eBand; - } - - else { - ASSERT(ucPreferedChnl != 0); - prP2pSpecificBssInfo->ucPreferredChannel = ucPreferedChnl; - prP2pSpecificBssInfo->eRfBand = eBand; - } -#else - if (ucPreferedChnl) { - prP2pSpecificBssInfo->ucPreferredChannel = ucPreferedChnl; - prP2pSpecificBssInfo->eRfBand = eBand; - } - else { - ASSERT(prP2pConnSettings->ucOperatingChnl != 0); - prP2pSpecificBssInfo->ucPreferredChannel = prP2pConnSettings->ucOperatingChnl; - prP2pSpecificBssInfo->eRfBand = prP2pConnSettings->eBand; - } - -#endif - prChnlReqInfo->ucReqChnlNum = prP2pSpecificBssInfo->ucPreferredChannel; - prChnlReqInfo->eBand = prP2pSpecificBssInfo->eRfBand; - prChnlReqInfo->eChannelReqType = CHANNEL_REQ_TYPE_GO_START_BSS; - } - - /* If channel is specified, use active scan to shorten the scan time. */ - p2pFsmStateTransition(prAdapter, - prAdapter->rWifiVar.prP2pFsmInfo, - eNextState); - } - - - - } while (FALSE); - - - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - return; -} /* p2pFsmRunEventStartAP */ - -VOID -p2pFsmRunEventNetDeviceRegister ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_P2P_NETDEV_REGISTER_T prNetDevRegisterMsg = (P_MSG_P2P_NETDEV_REGISTER_T)NULL; - - - do { - - ASSERT_BREAK((prAdapter != NULL) && (prMsgHdr != NULL)); - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventNetDeviceRegister\n")); - - prNetDevRegisterMsg = (P_MSG_P2P_NETDEV_REGISTER_T)prMsgHdr; - - if (prNetDevRegisterMsg->fgIsEnable) { - p2pSetMode((prNetDevRegisterMsg->ucMode == 1)?TRUE:FALSE); - - if (p2pLaunch(prAdapter->prGlueInfo)) { - ASSERT(prAdapter->fgIsP2PRegistered); - } - - } - else { - if (prAdapter->fgIsP2PRegistered) { - p2pRemove(prAdapter->prGlueInfo); - } - - } - } while (FALSE); - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - return; -} /* p2pFsmRunEventNetDeviceRegister */ - - -VOID -p2pFsmRunEventUpdateMgmtFrame ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_P2P_MGMT_FRAME_UPDATE_T prP2pMgmtFrameUpdateMsg = (P_MSG_P2P_MGMT_FRAME_UPDATE_T)NULL; - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsgHdr != NULL)); - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventUpdateMgmtFrame\n")); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo == NULL) { - break; - } - - prP2pMgmtFrameUpdateMsg = (P_MSG_P2P_MGMT_FRAME_UPDATE_T)prMsgHdr; - - switch (prP2pMgmtFrameUpdateMsg->eBufferType) { - case ENUM_FRAME_TYPE_EXTRA_IE_BEACON: - break; - case ENUM_FRAME_TYPE_EXTRA_IE_ASSOC_RSP: - break; - case ENUM_FRAME_TYPE_EXTRA_IE_PROBE_RSP: - break; - case ENUM_FRAME_TYPE_PROBE_RSP_TEMPLATE: - break; - case ENUM_FRAME_TYPE_BEACON_TEMPLATE: - break; - default: - break; - } - - } while (FALSE); - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - return; -} /* p2pFsmRunEventUpdateMgmtFrame */ - - -VOID -p2pFsmRunEventBeaconUpdate ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - P_MSG_P2P_BEACON_UPDATE_T prBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsgHdr != NULL)); - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventBeaconUpdate\n")); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo == NULL) { - break; - } - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - prBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)prMsgHdr; - - - p2pFuncBeaconUpdate(prAdapter, - prP2pBssInfo, - &prP2pFsmInfo->rBcnContentInfo, - prBcnUpdateMsg->pucBcnHdr, - prBcnUpdateMsg->u4BcnHdrLen, - prBcnUpdateMsg->pucBcnBody, - prBcnUpdateMsg->u4BcnBodyLen); - - if ((prP2pBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT) && - (prP2pBssInfo->eIntendOPMode == OP_MODE_NUM)) { - /* AP is created, Beacon Update. */ - //nicPmIndicateBssAbort(prAdapter, NETWORK_TYPE_P2P_INDEX); - - bssUpdateBeaconContent(prAdapter, NETWORK_TYPE_P2P_INDEX); - - //nicPmIndicateBssCreated(prAdapter, NETWORK_TYPE_P2P_INDEX); - } - - - - } while (FALSE); - - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - -} /* p2pFsmRunEventBeaconUpdate */ - - -VOID -p2pFsmRunEventStopAP ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL)); - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventStopAP\n")); - - if ((prP2pBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT) - && (prP2pBssInfo->eIntendOPMode == OP_MODE_NUM)) { - /* AP is created, Beacon Update. */ - - p2pFuncDissolve(prAdapter, prP2pBssInfo, TRUE, REASON_CODE_DEAUTH_LEAVING_BSS); - - DBGLOG(P2P, TRACE, ("Stop Beaconing\n")); - nicPmIndicateBssAbort(prAdapter, NETWORK_TYPE_P2P_INDEX); - - /* Reset RLM related field of BSSINFO. */ - rlmBssAborted(prAdapter, prP2pBssInfo); - } - - - - // 20120118: Moved to p2pFuncSwitchOPMode(). - //UNSET_NET_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX); - - /* Enter IDLE state. */ - SET_NET_PWR_STATE_IDLE(prAdapter, NETWORK_TYPE_P2P_INDEX); - - DBGLOG(P2P, INFO, ("Re activate P2P Network. \n")); - nicDeactivateNetwork(prAdapter, NETWORK_TYPE_P2P_INDEX); - - nicActivateNetwork(prAdapter, NETWORK_TYPE_P2P_INDEX); - - p2pFsmRunEventAbort(prAdapter, prAdapter->rWifiVar.prP2pFsmInfo); -// p2pFsmStateTransition(prAdapter, prAdapter->rWifiVar.prP2pFsmInfo, P2P_STATE_IDLE); - - } while (FALSE); - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - -} /* p2pFsmRunEventStopAP */ - -VOID -p2pFsmRunEventConnectionRequest ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL; - P_MSG_P2P_CONNECTION_REQUEST_T prConnReqMsg = (P_MSG_P2P_CONNECTION_REQUEST_T)NULL; - P_P2P_CONNECTION_REQ_INFO_T prConnReqInfo = (P_P2P_CONNECTION_REQ_INFO_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsgHdr != NULL)); - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo == NULL) { - break; - } - - prConnReqMsg = (P_MSG_P2P_CONNECTION_REQUEST_T)prMsgHdr; - - prConnReqInfo = &(prP2pFsmInfo->rConnReqInfo); - prChnlReqInfo = &(prP2pFsmInfo->rChnlReqInfo); - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventConnectionRequest\n")); - - if (prP2pBssInfo->eCurrentOPMode != OP_MODE_INFRASTRUCTURE) { - break; - } - - SET_NET_PWR_STATE_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX); - - - // Make sure the state is in IDLE state. - p2pFsmRunEventAbort(prAdapter, prP2pFsmInfo); - - // Update connection request information. - prConnReqInfo->fgIsConnRequest = TRUE; - COPY_MAC_ADDR(prConnReqInfo->aucBssid, prConnReqMsg->aucBssid); - kalMemCopy(&(prConnReqInfo->rSsidStruct), &(prConnReqMsg->rSsid), sizeof(P2P_SSID_STRUCT_T)); - kalMemCopy(prConnReqInfo->aucIEBuf, prConnReqMsg->aucIEBuf, prConnReqMsg->u4IELen); - prConnReqInfo->u4BufLength = prConnReqMsg->u4IELen; - - /* Find BSS Descriptor first. */ - prP2pFsmInfo->prTargetBss = scanP2pSearchDesc(prAdapter, - prP2pBssInfo, - prConnReqInfo); - - if (prP2pFsmInfo->prTargetBss == NULL) { - /* Update scan parameter... to scan target device. */ - P_P2P_SCAN_REQ_INFO_T prScanReqInfo = &(prP2pFsmInfo->rScanReqInfo); - - prScanReqInfo->ucNumChannelList = 1; - prScanReqInfo->eScanType = SCAN_TYPE_ACTIVE_SCAN; - prScanReqInfo->eChannelSet = SCAN_CHANNEL_SPECIFIED; - prScanReqInfo->arScanChannelList[0].ucChannelNum = prConnReqMsg->rChannelInfo.ucChannelNum; - kalMemCopy(&(prScanReqInfo->rSsidStruct), &(prConnReqMsg->rSsid), sizeof(P2P_SSID_STRUCT_T)); - prScanReqInfo->u4BufLength = 0; /* Prevent other P2P ID in IE. */ - prScanReqInfo->fgIsAbort = TRUE; - - p2pFsmStateTransition(prAdapter, prP2pFsmInfo, P2P_STATE_SCAN); - } - else { - prChnlReqInfo->u8Cookie = 0; - prChnlReqInfo->ucReqChnlNum = prConnReqMsg->rChannelInfo.ucChannelNum; - prChnlReqInfo->eBand = prConnReqMsg->rChannelInfo.eBand; - prChnlReqInfo->eChnlSco = prConnReqMsg->eChnlSco; - prChnlReqInfo->u4MaxInterval = AIS_JOIN_CH_REQUEST_INTERVAL; - prChnlReqInfo->eChannelReqType = CHANNEL_REQ_TYPE_GC_JOIN_REQ; - - p2pFsmStateTransition(prAdapter, prP2pFsmInfo, P2P_STATE_REQING_CHANNEL); - } - - - } while (FALSE); - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - return; - -} /* p2pFsmRunEventConnectionRequest */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is used to handle Connection Request from Supplicant. -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFsmRunEventConnectionAbort ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - P_MSG_P2P_CONNECTION_ABORT_T prDisconnMsg = (P_MSG_P2P_CONNECTION_ABORT_T)NULL; - //P_STA_RECORD_T prTargetStaRec = (P_STA_RECORD_T)NULL; - - do { - - ASSERT_BREAK((prAdapter != NULL) && (prMsgHdr != NULL)); - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventConnectionAbort: Connection Abort.\n")); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo == NULL) { - break; - } - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - prDisconnMsg = (P_MSG_P2P_CONNECTION_ABORT_T)prMsgHdr; - - switch (prP2pBssInfo->eCurrentOPMode) { - case OP_MODE_INFRASTRUCTURE: - { - UINT_8 aucBCBSSID[] = BC_BSSID; - - if (!prP2pBssInfo->prStaRecOfAP) { - DBGLOG(P2P, TRACE, ("GO's StaRec is NULL\n")); - break; - } - if (UNEQUAL_MAC_ADDR(prP2pBssInfo->prStaRecOfAP->aucMacAddr, prDisconnMsg->aucTargetID) && - UNEQUAL_MAC_ADDR(prDisconnMsg->aucTargetID, aucBCBSSID)) { - DBGLOG(P2P, TRACE, ("Unequal MAC ADDR ["MACSTR":"MACSTR"]\n", - MAC2STR(prP2pBssInfo->prStaRecOfAP->aucMacAddr), - MAC2STR(prDisconnMsg->aucTargetID))); - break; - } - - - kalP2PGCIndicateConnectionStatus(prAdapter->prGlueInfo, NULL, NULL, 0, 0); - - /* Stop rejoin timer if it is started. */ - // TODO: If it has. - - p2pFuncDisconnect(prAdapter, prP2pBssInfo->prStaRecOfAP, prDisconnMsg->fgSendDeauth, prDisconnMsg->u2ReasonCode); - - //prTargetStaRec = prP2pBssInfo->prStaRecOfAP; - - /* Fix possible KE when RX Beacon & call nicPmIndicateBssConnected(). hit prStaRecOfAP == NULL. */ - p2pChangeMediaState(prAdapter, PARAM_MEDIA_STATE_DISCONNECTED); - - prP2pBssInfo->prStaRecOfAP = NULL; - - SET_NET_PWR_STATE_IDLE(prAdapter, NETWORK_TYPE_P2P_INDEX); - - p2pFsmStateTransition(prAdapter, prP2pFsmInfo, P2P_STATE_IDLE); - - } - break; - case OP_MODE_ACCESS_POINT: - { - P_LINK_T prStaRecOfClientList = &prP2pBssInfo->rStaRecOfClientList; - /* Search specific client device, and disconnect. */ - /* 1. Send deauthentication frame. */ - /* 2. Indication: Device disconnect. */ - P_LINK_ENTRY_T prLinkEntry = (P_LINK_ENTRY_T)NULL; - P_STA_RECORD_T prCurrStaRec = (P_STA_RECORD_T)NULL; - - DBGLOG(P2P, TRACE, ("Disconnecting with Target ID: "MACSTR"\n", MAC2STR(prDisconnMsg->aucTargetID))); - - LINK_FOR_EACH(prLinkEntry, prStaRecOfClientList) { - prCurrStaRec = LINK_ENTRY(prLinkEntry, STA_RECORD_T, rLinkEntry); - - ASSERT(prCurrStaRec); - - if (EQUAL_MAC_ADDR(prCurrStaRec->aucMacAddr, prDisconnMsg->aucTargetID)) { - - DBGLOG(P2P, TRACE, ("Disconnecting: "MACSTR"\n", MAC2STR(prCurrStaRec->aucMacAddr))); - - /* Remove STA from client list. */ - LINK_REMOVE_KNOWN_ENTRY(prStaRecOfClientList, &prCurrStaRec->rLinkEntry); - - /* Glue layer indication. */ - //kalP2PGOStationUpdate(prAdapter->prGlueInfo, prCurrStaRec, FALSE); - - /* Send deauth & do indication. */ - p2pFuncDisconnect(prAdapter, prCurrStaRec, prDisconnMsg->fgSendDeauth, prDisconnMsg->u2ReasonCode); - - //prTargetStaRec = prCurrStaRec; - - break; - } - } - - } - break; - case OP_MODE_P2P_DEVICE: - default: - ASSERT(FALSE); - break; - } - - } while (FALSE); - - //20120830 moved into p2pFuncDisconnect() - //if ((!prDisconnMsg->fgSendDeauth) && (prTargetStaRec)) { - // cnmStaRecFree(prAdapter, prTargetStaRec, TRUE); - //} - - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - return; -} /* p2pFsmRunEventConnectionAbort */ - - -VOID -p2pFsmRunEventDissolve ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - - // TODO: - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventDissolve\n")); - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - return; -} -WLAN_STATUS -p2pFsmRunEventDeauthTxDone ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ) -{ - - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - ENUM_PARAM_MEDIA_STATE_T eOriMediaStatus; - - do { - - ASSERT_BREAK((prAdapter != NULL) && - (prMsduInfo != NULL)); - - DBGLOG(P2P, TRACE, ("Deauth TX Done\n")); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - if (prStaRec == NULL) { - DBGLOG(P2P, TRACE, ("Station Record NULL, Index:%d\n", prMsduInfo->ucStaRecIndex)); - break; - } - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - eOriMediaStatus = prP2pBssInfo->eConnectionState; - - /* Change station state. */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - - /* Reset Station Record Status. */ - p2pFuncResetStaRecStatus(prAdapter, prStaRec); - - /**/ - cnmStaRecFree(prAdapter, prStaRec, TRUE); - - if ((prP2pBssInfo->eCurrentOPMode != OP_MODE_ACCESS_POINT) || - (prP2pBssInfo->rStaRecOfClientList.u4NumElem == 0)) { - DBGLOG(P2P, TRACE, ("No More Client, Media Status DISCONNECTED\n")); - p2pChangeMediaState(prAdapter, PARAM_MEDIA_STATE_DISCONNECTED); - } - - if (eOriMediaStatus != prP2pBssInfo->eConnectionState) { - /* Update Disconnected state to FW. */ - nicUpdateBss(prAdapter, NETWORK_TYPE_P2P_INDEX); - } - - - } while (FALSE); - - return WLAN_STATUS_SUCCESS; -} /* p2pFsmRunEventDeauthTxDone */ - - -WLAN_STATUS -p2pFsmRunEventMgmtFrameTxDone ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_P2P_MGMT_TX_REQ_INFO_T prMgmtTxReqInfo = (P_P2P_MGMT_TX_REQ_INFO_T)NULL; - BOOLEAN fgIsSuccess = FALSE; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsduInfo != NULL)); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - prMgmtTxReqInfo = &(prP2pFsmInfo->rMgmtTxInfo); - - if (rTxDoneStatus != TX_RESULT_SUCCESS) { - DBGLOG(P2P, TRACE, ("Mgmt Frame TX Fail, Status:%d.\n", rTxDoneStatus)); - } - else { - fgIsSuccess = TRUE; - DBGLOG(P2P, TRACE, ("Mgmt Frame TX Done.\n")); - } - - - if (prMgmtTxReqInfo->prMgmtTxMsdu == prMsduInfo) { - kalP2PIndicateMgmtTxStatus(prAdapter->prGlueInfo, - prMgmtTxReqInfo->u8Cookie, - fgIsSuccess, - prMsduInfo->prPacket, - (UINT_32)prMsduInfo->u2FrameLength); - - prMgmtTxReqInfo->prMgmtTxMsdu = NULL; - } - - } while (FALSE); - - return WLAN_STATUS_SUCCESS; - -} /* p2pFsmRunEventMgmtFrameTxDone */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is called when JOIN complete message event is received from SAA. -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFsmRunEventJoinComplete ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_P2P_JOIN_INFO_T prJoinInfo = (P_P2P_JOIN_INFO_T)NULL; - P_MSG_JOIN_COMP_T prJoinCompMsg = (P_MSG_JOIN_COMP_T)NULL; - P_SW_RFB_T prAssocRspSwRfb = (P_SW_RFB_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsgHdr != NULL)); - - DBGLOG(P2P, TRACE, ("P2P Join Complete\n")); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo == NULL) { - break; - } - - - prJoinInfo = &(prP2pFsmInfo->rJoinInfo); - prJoinCompMsg = (P_MSG_JOIN_COMP_T)prMsgHdr; - prAssocRspSwRfb = prJoinCompMsg->prSwRfb; - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - if (prP2pBssInfo->eCurrentOPMode == OP_MODE_INFRASTRUCTURE) { - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - - prStaRec = prJoinCompMsg->prStaRec; - - /* Check SEQ NUM */ - if (prJoinCompMsg->ucSeqNum == prJoinInfo->ucSeqNumOfReqMsg) { - ASSERT(prStaRec == prJoinInfo->prTargetStaRec); - prJoinInfo->fgIsJoinComplete = TRUE; - - if (prJoinCompMsg->rJoinStatus == WLAN_STATUS_SUCCESS) { - - //4 <1.1> Change FW's Media State immediately. - p2pChangeMediaState(prAdapter, PARAM_MEDIA_STATE_CONNECTED); - - //4 <1.2> Deactivate previous AP's STA_RECORD_T in Driver if have. - if ((prP2pBssInfo->prStaRecOfAP) && - (prP2pBssInfo->prStaRecOfAP != prStaRec)) { - cnmStaRecChangeState(prAdapter, prP2pBssInfo->prStaRecOfAP, STA_STATE_1); - - cnmStaRecFree(prAdapter, prP2pBssInfo->prStaRecOfAP, TRUE); - - prP2pBssInfo->prStaRecOfAP = NULL; - } - - //4 <1.3> Update BSS_INFO_T - p2pFuncUpdateBssInfoForJOIN(prAdapter, prP2pFsmInfo->prTargetBss, prStaRec, prAssocRspSwRfb); - - //4 <1.4> Activate current AP's STA_RECORD_T in Driver. - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_3); - -#if CFG_SUPPORT_P2P_RSSI_QUERY - //<1.5> Update RSSI if necessary - nicUpdateRSSI(prAdapter, NETWORK_TYPE_P2P_INDEX, (INT_8)(RCPI_TO_dBm(prStaRec->ucRCPI)), 0); -#endif - - //4 <1.6> Indicate Connected Event to Host immediately. - /* Require BSSID, Association ID, Beacon Interval.. from AIS_BSS_INFO_T */ - //p2pIndicationOfMediaStateToHost(prAdapter, PARAM_MEDIA_STATE_CONNECTED, prStaRec->aucMacAddr); - kalP2PGCIndicateConnectionStatus(prAdapter->prGlueInfo, - &prP2pFsmInfo->rConnReqInfo, - prJoinInfo->aucIEBuf, - prJoinInfo->u4BufLength, - prStaRec->u2StatusCode); - - } - else { - /* Join Fail*/ - //4 <2.1> Redo JOIN process with other Auth Type if possible - if (p2pFuncRetryJOIN(prAdapter, prStaRec, prJoinInfo) == FALSE) { - P_BSS_DESC_T prBssDesc; - - /* Increase Failure Count */ - prStaRec->ucJoinFailureCount++; - - prBssDesc = prP2pFsmInfo->prTargetBss; - - ASSERT(prBssDesc); - ASSERT(prBssDesc->fgIsConnecting); - - prBssDesc->fgIsConnecting = FALSE; - - kalP2PGCIndicateConnectionStatus(prAdapter->prGlueInfo, - &prP2pFsmInfo->rConnReqInfo, - prJoinInfo->aucIEBuf, - prJoinInfo->u4BufLength, - prStaRec->u2StatusCode); - - } - - } - } - } - - if (prAssocRspSwRfb) { - nicRxReturnRFB(prAdapter, prAssocRspSwRfb); - } - - if (prP2pFsmInfo->eCurrentState == P2P_STATE_GC_JOIN) { - /* Return to IDLE state. */ - p2pFsmStateTransition(prAdapter, prP2pFsmInfo, P2P_STATE_IDLE); - } - - } while (FALSE); - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - return; - -} /* p2pFsmRunEventJoinComplete */ - - - -VOID -p2pFsmRunEventMgmtFrameRegister ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_P2P_MGMT_FRAME_REGISTER_T prMgmtFrameRegister = (P_MSG_P2P_MGMT_FRAME_REGISTER_T)NULL; - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsgHdr != NULL)); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo == NULL) { - break; - } - - prMgmtFrameRegister = (P_MSG_P2P_MGMT_FRAME_REGISTER_T)prMsgHdr; - - p2pFuncMgmtFrameRegister(prAdapter, - prMgmtFrameRegister->u2FrameType, - prMgmtFrameRegister->fgIsRegister, - &prP2pFsmInfo->u4P2pPacketFilter); - - - } while (FALSE); - - if (prMsgHdr) { - cnmMemFree(prAdapter, prMsgHdr); - } - - return; - -} /* p2pFsmRunEventMgmtFrameRegister */ - - - - -#if 0 -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#endif - - - - - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is call when RX deauthentication frame from the AIR. -* If we are under STA mode, we would go back to P2P Device. -* If we are under AP mode, we would stay in AP mode until disconnect event from HOST. -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFsmRunEventRxDeauthentication ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prSwRfb - ) -{ - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - UINT_16 u2ReasonCode = 0; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prSwRfb != NULL)); - - if (prStaRec == NULL) { - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - } - - if (!prStaRec) { - break; - } - - - prP2pBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]; - - if (prStaRec->ucStaState == STA_STATE_1) { - break; - } - - DBGLOG(P2P, TRACE, ("RX Deauth\n")); - - switch (prP2pBssInfo->eCurrentOPMode) { - case OP_MODE_INFRASTRUCTURE: - if (authProcessRxDeauthFrame(prSwRfb, - prStaRec->aucMacAddr, - &u2ReasonCode) == WLAN_STATUS_SUCCESS) { - P_WLAN_DEAUTH_FRAME_T prDeauthFrame = (P_WLAN_DEAUTH_FRAME_T)prSwRfb->pvHeader; - UINT_16 u2IELength = 0; - - if (prP2pBssInfo->prStaRecOfAP != prStaRec) { - break; - } - - - prStaRec->u2ReasonCode = u2ReasonCode; - u2IELength = prSwRfb->u2PacketLen - (WLAN_MAC_HEADER_LEN + REASON_CODE_FIELD_LEN); - - ASSERT(prP2pBssInfo->prStaRecOfAP == prStaRec); - - /* Indicate disconnect to Host. */ - kalP2PGCIndicateConnectionStatus(prAdapter->prGlueInfo, - NULL, - prDeauthFrame->aucInfoElem, - u2IELength, - u2ReasonCode); - - prP2pBssInfo->prStaRecOfAP = NULL; - - p2pFuncDisconnect(prAdapter, prStaRec, FALSE, u2ReasonCode); - } - break; - case OP_MODE_ACCESS_POINT: - /* Delete client from client list. */ - if (authProcessRxDeauthFrame(prSwRfb, - prP2pBssInfo->aucBSSID, - &u2ReasonCode) == WLAN_STATUS_SUCCESS) { - P_LINK_T prStaRecOfClientList = (P_LINK_T)NULL; - P_LINK_ENTRY_T prLinkEntry = (P_LINK_ENTRY_T)NULL; - P_STA_RECORD_T prCurrStaRec = (P_STA_RECORD_T)NULL; - - prStaRecOfClientList = &prP2pBssInfo->rStaRecOfClientList; - - LINK_FOR_EACH(prLinkEntry, prStaRecOfClientList) { - prCurrStaRec = LINK_ENTRY(prLinkEntry, STA_RECORD_T, rLinkEntry); - - ASSERT(prCurrStaRec); - - if (EQUAL_MAC_ADDR(prCurrStaRec->aucMacAddr, prStaRec->aucMacAddr)) { - - /* Remove STA from client list. */ - LINK_REMOVE_KNOWN_ENTRY(prStaRecOfClientList, &prCurrStaRec->rLinkEntry); - - /* Indicate to Host. */ - //kalP2PGOStationUpdate(prAdapter->prGlueInfo, prStaRec, FALSE); - - /* Indicate disconnect to Host. */ - p2pFuncDisconnect(prAdapter, prStaRec, FALSE, u2ReasonCode); - - break; - } - } - } - break; - case OP_MODE_P2P_DEVICE: - default: - /* Findout why someone sent deauthentication frame to us. */ - ASSERT(FALSE); - break; - } - - DBGLOG(P2P, TRACE, ("Deauth Reason:%d\n", u2ReasonCode)); - - } while (FALSE); - - return; -} /* p2pFsmRunEventRxDeauthentication */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is call when RX deauthentication frame from the AIR. -* If we are under STA mode, we would go back to P2P Device. -* If we are under AP mode, we would stay in AP mode until disconnect event from HOST. -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFsmRunEventRxDisassociation ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prSwRfb - ) -{ - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - UINT_16 u2ReasonCode = 0; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prSwRfb != NULL)); - - if (prStaRec == NULL) { - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - } - - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - if (prStaRec->ucStaState == STA_STATE_1) { - - break; - } - - DBGLOG(P2P, TRACE, ("RX Disassoc\n")); - - switch (prP2pBssInfo->eCurrentOPMode) { - case OP_MODE_INFRASTRUCTURE: - if (assocProcessRxDisassocFrame(prAdapter, - prSwRfb, - prStaRec->aucMacAddr, - &prStaRec->u2ReasonCode) == WLAN_STATUS_SUCCESS) { - P_WLAN_DISASSOC_FRAME_T prDisassocFrame = (P_WLAN_DISASSOC_FRAME_T)prSwRfb->pvHeader; - UINT_16 u2IELength = 0; - - ASSERT(prP2pBssInfo->prStaRecOfAP == prStaRec); - - if (prP2pBssInfo->prStaRecOfAP != prStaRec) { - break; - } - - - u2IELength = prSwRfb->u2PacketLen - (WLAN_MAC_HEADER_LEN + REASON_CODE_FIELD_LEN); - - /* Indicate disconnect to Host. */ - kalP2PGCIndicateConnectionStatus(prAdapter->prGlueInfo, - NULL, - prDisassocFrame->aucInfoElem, - u2IELength, - prStaRec->u2ReasonCode); - - prP2pBssInfo->prStaRecOfAP = NULL; - - p2pFuncDisconnect(prAdapter, prStaRec, FALSE, prStaRec->u2ReasonCode); - - } - break; - case OP_MODE_ACCESS_POINT: - /* Delete client from client list. */ - if (assocProcessRxDisassocFrame(prAdapter, - prSwRfb, - prP2pBssInfo->aucBSSID, - &u2ReasonCode) == WLAN_STATUS_SUCCESS) { - P_LINK_T prStaRecOfClientList = (P_LINK_T)NULL; - P_LINK_ENTRY_T prLinkEntry = (P_LINK_ENTRY_T)NULL; - P_STA_RECORD_T prCurrStaRec = (P_STA_RECORD_T)NULL; - - prStaRecOfClientList = &prP2pBssInfo->rStaRecOfClientList; - - LINK_FOR_EACH(prLinkEntry, prStaRecOfClientList) { - prCurrStaRec = LINK_ENTRY(prLinkEntry, STA_RECORD_T, rLinkEntry); - - ASSERT(prCurrStaRec); - - if (EQUAL_MAC_ADDR(prCurrStaRec->aucMacAddr, prStaRec->aucMacAddr)) { - - /* Remove STA from client list. */ - LINK_REMOVE_KNOWN_ENTRY(prStaRecOfClientList, &prCurrStaRec->rLinkEntry); - - /* Indicate to Host. */ - //kalP2PGOStationUpdate(prAdapter->prGlueInfo, prStaRec, FALSE); - - /* Indicate disconnect to Host. */ - p2pFuncDisconnect(prAdapter, prStaRec, FALSE, u2ReasonCode); - - break; - } - } - } - break; - case OP_MODE_P2P_DEVICE: - default: - ASSERT(FALSE); - break; - } - - - } while (FALSE); - - return; -} /* p2pFsmRunEventRxDisassociation */ - - - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is called when a probe request frame is received. -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return boolean value if probe response frame is accepted & need cancel scan request. -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFsmRunEventRxProbeResponseFrame ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN P_BSS_DESC_T prBssDesc - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL; - P_WLAN_MAC_MGMT_HEADER_T prMgtHdr = (P_WLAN_MAC_MGMT_HEADER_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prSwRfb != NULL) && (prBssDesc != NULL)); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - prP2pBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]; - - /* There is a connection request. */ - prMgtHdr = (P_WLAN_MAC_MGMT_HEADER_T)prSwRfb->pvHeader; - - } while (FALSE); - - return; -} /* p2pFsmRunEventRxProbeResponseFrame */ - - - - - - -VOID -p2pFsmRunEventBeaconTimeout ( - IN P_ADAPTER_T prAdapter - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - - do { - ASSERT_BREAK(prAdapter != NULL); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - DBGLOG(P2P, TRACE, ("p2pFsmRunEventBeaconTimeout: Beacon Timeout\n")); - - /* Only client mode would have beacon lost event. */ - ASSERT(prP2pBssInfo->eCurrentOPMode == OP_MODE_INFRASTRUCTURE); - - if (prP2pBssInfo->eConnectionState == PARAM_MEDIA_STATE_CONNECTED) { - /* Indicate disconnect to Host. */ - kalP2PGCIndicateConnectionStatus(prAdapter->prGlueInfo, - NULL, - NULL, - 0, - REASON_CODE_DISASSOC_INACTIVITY); - - if (prP2pBssInfo->prStaRecOfAP != NULL) { - P_STA_RECORD_T prStaRec = prP2pBssInfo->prStaRecOfAP; - - prP2pBssInfo->prStaRecOfAP = NULL; - - p2pFuncDisconnect(prAdapter, prStaRec, FALSE, REASON_CODE_DISASSOC_LEAVING_BSS); - - //20120830 moved into p2pFuncDisconnect() - //cnmStaRecFree(prAdapter, prP2pBssInfo->prStaRecOfAP, TRUE); - - - } - } - } while (FALSE); - - return; -} /* p2pFsmRunEventBeaconTimeout */ - - - - - - - - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to generate P2P IE for Beacon frame. -* -* @param[in] prMsduInfo Pointer to the composed MSDU_INFO_T. -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pGenerateP2P_IEForAssocReq ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsduInfo != NULL)); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - if (IS_STA_P2P_TYPE(prStaRec)) { - // TODO: - } - - } while (FALSE); - - return; - -} /* end of p2pGenerateP2P_IEForAssocReq() */ - - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to generate P2P IE for Probe Request frame. -* -* @param[in] prMsduInfo Pointer to the composed MSDU_INFO_T. -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pGenerateP2P_IEForProbeReq ( - IN P_ADAPTER_T prAdapter, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ) -{ - ASSERT(prAdapter); - ASSERT(pucBuf); - - // TODO: - - return; - -} /* end of p2pGenerateP2P_IEForProbReq() */ - - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to calculate P2P IE length for Beacon frame. -* -* @param[in] eNetTypeIndex Specify which network -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @return The length of P2P IE added -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -p2pCalculateP2P_IELenForProbeReq ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ) -{ - - if (eNetTypeIndex != NETWORK_TYPE_P2P_INDEX) { - return 0; - } - - // TODO: - - return 0; - -} /* end of p2pCalculateP2P_IELenForProbeReq() */ - - - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will indiate the Event of Tx Fail of AAA Module. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pRunEventAAATxFail ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ) -{ - P_BSS_INFO_T prBssInfo; - - - ASSERT(prAdapter); - ASSERT(prStaRec); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]); - - bssRemoveStaRecFromClientList(prAdapter, prBssInfo, prStaRec); - - p2pFuncDisconnect(prAdapter, prStaRec, FALSE, REASON_CODE_UNSPECIFIED); - - - //20120830 moved into p2puUncDisconnect. - //cnmStaRecFree(prAdapter, prStaRec, TRUE); - - return; -} /* p2pRunEventAAATxFail */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will indiate the Event of Successful Completion of AAA Module. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -p2pRunEventAAAComplete ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - ENUM_PARAM_MEDIA_STATE_T eOriMediaState; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prStaRec != NULL)); - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - eOriMediaState = prP2pBssInfo->eConnectionState; - - bssRemoveStaRecFromClientList(prAdapter, prP2pBssInfo, prStaRec); - - if (prP2pBssInfo->rStaRecOfClientList.u4NumElem >= P2P_MAXIMUM_CLIENT_COUNT || - kalP2PMaxClients(prAdapter->prGlueInfo, prP2pBssInfo->rStaRecOfClientList.u4NumElem)) { - rStatus = WLAN_STATUS_RESOURCES; - break; - } - - bssAddStaRecToClientList(prAdapter, prP2pBssInfo, prStaRec); - - prStaRec->u2AssocId = bssAssignAssocID(prStaRec); - - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_3); - - p2pChangeMediaState(prAdapter, PARAM_MEDIA_STATE_CONNECTED); - - /* Update Connected state to FW. */ - if (eOriMediaState != prP2pBssInfo->eConnectionState) { - nicUpdateBss(prAdapter, NETWORK_TYPE_P2P_INDEX); - } - - } while (FALSE); - - return rStatus; -} /* p2pRunEventAAAComplete */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will indiate the Event of Successful Completion of AAA Module. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -p2pRunEventAAASuccess ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prStaRec != NULL)); - - /* Glue layer indication. */ - kalP2PGOStationUpdate(prAdapter->prGlueInfo, prStaRec, TRUE); - - } while (FALSE); - - return rStatus; -} /* p2pRunEventAAASuccess */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -p2pRxPublicActionFrame ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_SUCCESS; - P_P2P_PUBLIC_ACTION_FRAME_T prPublicActionFrame = (P_P2P_PUBLIC_ACTION_FRAME_T)NULL; - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - - ASSERT(prSwRfb); - ASSERT(prAdapter); - - - - prPublicActionFrame = (P_P2P_PUBLIC_ACTION_FRAME_T)prSwRfb->pvHeader; - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - DBGLOG(P2P, TRACE, ("RX Public Action Frame Token:%d.\n", prPublicActionFrame->ucDialogToken)); - - if (prPublicActionFrame->ucCategory != CATEGORY_PUBLIC_ACTION) { - return rWlanStatus; - } - - switch (prPublicActionFrame->ucAction) { - case ACTION_PUBLIC_WIFI_DIRECT: - break; - case ACTION_GAS_INITIAL_REQUEST: - case ACTION_GAS_INITIAL_RESPONSE: - case ACTION_GAS_COMEBACK_REQUEST: - case ACTION_GAS_COMEBACK_RESPONSE: - break; - default: - break; - } - - return rWlanStatus; -} /* p2pRxPublicActionFrame */ - - - -WLAN_STATUS -p2pRxActionFrame ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_SUCCESS; - P_P2P_ACTION_FRAME_T prP2pActionFrame = (P_P2P_ACTION_FRAME_T)NULL; - UINT_8 aucOui[3] = VENDOR_OUI_WFA_SPECIFIC; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prSwRfb != NULL)); - - prP2pActionFrame = (P_P2P_ACTION_FRAME_T)prSwRfb->pvHeader; - - if (prP2pActionFrame->ucCategory != CATEGORY_VENDOR_SPECIFIC_ACTION) { - DBGLOG(P2P, TRACE, ("RX Action Frame but not vendor specific.\n")); - break; - } - - - if ((prP2pActionFrame->ucOuiType != VENDOR_OUI_TYPE_P2P) || - (prP2pActionFrame->aucOui[0] != aucOui[0]) || - (prP2pActionFrame->aucOui[1] != aucOui[1]) || - (prP2pActionFrame->aucOui[2] != aucOui[2])) { - DBGLOG(P2P, TRACE, ("RX Vendor Specific Action Frame but not P2P Type or not WFA OUI.\n")); - break; - } - - } while (FALSE); - - return rWlanStatus; -} /* p2pRxActionFrame */ - - -VOID -p2pProcessEvent_UpdateNOAParam ( - IN P_ADAPTER_T prAdapter, - UINT_8 ucNetTypeIndex, - P_EVENT_UPDATE_NOA_PARAMS_T prEventUpdateNoaParam - ) -{ - P_BSS_INFO_T prBssInfo = (P_BSS_INFO_T)NULL; - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo; - UINT_32 i; - BOOLEAN fgNoaAttrExisted = FALSE; - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[ucNetTypeIndex]); - prP2pSpecificBssInfo = prAdapter->rWifiVar.prP2pSpecificBssInfo; - - prP2pSpecificBssInfo->fgEnableOppPS = prEventUpdateNoaParam->fgEnableOppPS; - prP2pSpecificBssInfo->u2CTWindow = prEventUpdateNoaParam->u2CTWindow; - prP2pSpecificBssInfo->ucNoAIndex = prEventUpdateNoaParam->ucNoAIndex; - prP2pSpecificBssInfo->ucNoATimingCount = prEventUpdateNoaParam->ucNoATimingCount; - - fgNoaAttrExisted |= prP2pSpecificBssInfo->fgEnableOppPS; - - - ASSERT(prP2pSpecificBssInfo->ucNoATimingCount <= P2P_MAXIMUM_NOA_COUNT); - - for (i = 0; i < prP2pSpecificBssInfo->ucNoATimingCount; i++) { - // in used - prP2pSpecificBssInfo->arNoATiming[i].fgIsInUse = - prEventUpdateNoaParam->arEventNoaTiming[i].fgIsInUse; - // count - prP2pSpecificBssInfo->arNoATiming[i].ucCount = - prEventUpdateNoaParam->arEventNoaTiming[i].ucCount; - // duration - prP2pSpecificBssInfo->arNoATiming[i].u4Duration = - prEventUpdateNoaParam->arEventNoaTiming[i].u4Duration; - // interval - prP2pSpecificBssInfo->arNoATiming[i].u4Interval = - prEventUpdateNoaParam->arEventNoaTiming[i].u4Interval; - // start time - prP2pSpecificBssInfo->arNoATiming[i].u4StartTime = - prEventUpdateNoaParam->arEventNoaTiming[i].u4StartTime; - - fgNoaAttrExisted |= prP2pSpecificBssInfo->arNoATiming[i].fgIsInUse; - } - - prP2pSpecificBssInfo->fgIsNoaAttrExisted = fgNoaAttrExisted; - - // update beacon content by the change - bssUpdateBeaconContent(prAdapter, ucNetTypeIndex); -} - -#endif /* CFG_ENABLE_WIFI_DIRECT */ - diff --git a/drivers/net/wireless/mt5931/mgmt/p2p_func.c b/drivers/net/wireless/mt5931/mgmt/p2p_func.c deleted file mode 100755 index 0a61d7591c59..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/p2p_func.c +++ /dev/null @@ -1,3378 +0,0 @@ -#include "precomp.h" - -APPEND_VAR_ATTRI_ENTRY_T txAssocRspAttributesTable[] = { - { (P2P_ATTRI_HDR_LEN + P2P_ATTRI_MAX_LEN_STATUS) , NULL, p2pFuncAppendAttriStatusForAssocRsp } /* 0 */ // Status - ,{ (P2P_ATTRI_HDR_LEN + P2P_ATTRI_MAX_LEN_EXT_LISTEN_TIMING), NULL, p2pFuncAppendAttriExtListenTiming } /* 8 */ -}; - - -APPEND_VAR_IE_ENTRY_T txProbeRspIETable[] = { - { (ELEM_HDR_LEN + (RATE_NUM - ELEM_MAX_LEN_SUP_RATES)), NULL, bssGenerateExtSuppRate_IE } /* 50 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_ERP), NULL, rlmRspGenerateErpIE } /* 42 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_HT_CAP), NULL, rlmRspGenerateHtCapIE } /* 45 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_HT_OP), NULL, rlmRspGenerateHtOpIE } /* 61 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_RSN), NULL, rsnGenerateRSNIE } /* 48 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_OBSS_SCAN), NULL, rlmRspGenerateObssScanIE } /* 74 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_EXT_CAP), NULL, rlmRspGenerateExtCapIE } /* 127 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_WPA), NULL, rsnGenerateWpaNoneIE } /* 221 */ - ,{ (ELEM_HDR_LEN + ELEM_MAX_LEN_WMM_PARAM), NULL, mqmGenerateWmmParamIE } /* 221 */ -}; - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Function for requesting scan. There is an option to do ACTIVE or PASSIVE scan. -* -* @param eScanType - Specify the scan type of the scan request. It can be an ACTIVE/PASSIVE -* Scan. -* eChannelSet - Specify the prefered channel set. -* A FULL scan would request a legacy full channel normal scan.(usually ACTIVE). -* A P2P_SOCIAL scan would scan 1+6+11 channels.(usually ACTIVE) -* A SPECIFIC scan would only 1/6/11 channels scan. (Passive Listen/Specific Search) -* ucChannelNum - A specific channel number. (Only when channel is specified) -* eBand - A specific band. (Only when channel is specified) -* -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFuncRequestScan ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_SCAN_REQ_INFO_T prScanReqInfo - ) -{ - - P_MSG_SCN_SCAN_REQ prScanReq = (P_MSG_SCN_SCAN_REQ)NULL; - - DEBUGFUNC("p2pFuncRequestScan()"); - - do { - ASSERT_BREAK((prAdapter != NULL) && - (prScanReqInfo != NULL)); - - if (prScanReqInfo->eChannelSet == SCAN_CHANNEL_SPECIFIED) { - ASSERT_BREAK(prScanReqInfo->ucNumChannelList > 0); - DBGLOG(P2P, LOUD, ("P2P Scan Request Channel:%d\n", prScanReqInfo->arScanChannelList[0].ucChannelNum)); - } - - prScanReq = (P_MSG_SCN_SCAN_REQ)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_SCN_SCAN_REQ)); - if (!prScanReq) { - ASSERT(0); // Can't trigger SCAN FSM - break; - } - - prScanReq->rMsgHdr.eMsgId = MID_P2P_SCN_SCAN_REQ; - prScanReq->ucSeqNum = ++prScanReqInfo->ucSeqNumOfScnMsg; - prScanReq->ucNetTypeIndex = (UINT_8)NETWORK_TYPE_P2P_INDEX; - prScanReq->eScanType = prScanReqInfo->eScanType; - prScanReq->eScanChannel = prScanReqInfo->eChannelSet; - prScanReq->u2IELen = 0; - - /* Copy IE for Probe Request. */ - kalMemCopy(prScanReq->aucIE, prScanReqInfo->aucIEBuf, prScanReqInfo->u4BufLength); - prScanReq->u2IELen = (UINT_16)prScanReqInfo->u4BufLength; - - prScanReq->u2ChannelDwellTime = prScanReqInfo->u2PassiveDewellTime; - - switch (prScanReqInfo->eChannelSet) { - case SCAN_CHANNEL_SPECIFIED: - { - UINT_32 u4Idx = 0; - P_RF_CHANNEL_INFO_T prDomainInfo = (P_RF_CHANNEL_INFO_T)prScanReqInfo->arScanChannelList; - - if (prScanReqInfo->ucNumChannelList > MAXIMUM_OPERATION_CHANNEL_LIST) { - prScanReqInfo->ucNumChannelList = MAXIMUM_OPERATION_CHANNEL_LIST; - } - - - for (u4Idx = 0; u4Idx < prScanReqInfo->ucNumChannelList; u4Idx++) { - prScanReq->arChnlInfoList[u4Idx].ucChannelNum = prDomainInfo->ucChannelNum; - prScanReq->arChnlInfoList[u4Idx].eBand = prDomainInfo->eBand; - prDomainInfo++; - } - - prScanReq->ucChannelListNum = prScanReqInfo->ucNumChannelList; - } - case SCAN_CHANNEL_FULL: - case SCAN_CHANNEL_2G4: - case SCAN_CHANNEL_P2P_SOCIAL: - { - UINT_8 aucP2pSsid[] = P2P_WILDCARD_SSID; - - COPY_SSID(prScanReq->aucSSID, - prScanReq->ucSSIDLength, - prScanReqInfo->rSsidStruct.aucSsid, - prScanReqInfo->rSsidStruct.ucSsidLen); - - /* For compatible. */ - if (EQUAL_SSID(aucP2pSsid, P2P_WILDCARD_SSID_LEN, prScanReq->aucSSID, prScanReq->ucSSIDLength)) { - prScanReq->ucSSIDType = SCAN_REQ_SSID_P2P_WILDCARD; - } - else if (prScanReq->ucSSIDLength != 0) { - prScanReq->ucSSIDType = SCAN_REQ_SSID_SPECIFIED; - } - } - break; - default: - /* Currently there is no other scan channel set. */ - ASSERT(FALSE); - break; - } - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prScanReq, - MSG_SEND_METHOD_BUF); - - } while (FALSE); - - return; -} /* p2pFuncRequestScan */ - -VOID -p2pFuncCancelScan ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_SCAN_REQ_INFO_T prScanInfo - ) -{ - P_MSG_SCN_SCAN_CANCEL prScanCancelMsg = (P_MSG_SCN_SCAN_CANCEL)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prScanInfo != NULL)); - - if (!prScanInfo->fgIsScanRequest) { - break; - } - - - if (prScanInfo->ucSeqNumOfScnMsg) { - /* There is a channel privilege on hand. */ - DBGLOG(P2P, TRACE, ("P2P Cancel Scan\n")); - - prScanCancelMsg = (P_MSG_SCN_SCAN_CANCEL)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_SCN_SCAN_CANCEL)); - if (!prScanCancelMsg) { - /* Buffer not enough, can not cancel scan request. */ - DBGLOG(P2P, TRACE, ("Buffer not enough, can not cancel scan.\n")); - ASSERT(FALSE); - break; - } - - prScanCancelMsg->rMsgHdr.eMsgId = MID_P2P_SCN_SCAN_CANCEL; - prScanCancelMsg->ucNetTypeIndex = NETWORK_TYPE_P2P_INDEX; - prScanCancelMsg->ucSeqNum = prScanInfo->ucSeqNumOfScnMsg++; - prScanCancelMsg->fgIsChannelExt = FALSE; - prScanInfo->fgIsScanRequest = FALSE; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prScanCancelMsg, - MSG_SEND_METHOD_BUF); - - - } - - - } while (FALSE); - - return; -} /* p2pFuncCancelScan */ - - -VOID -p2pFuncSwitchOPMode ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prP2pBssInfo, - IN ENUM_OP_MODE_T eOpMode, - IN BOOLEAN fgSyncToFW - ) -{ - do { - ASSERT_BREAK((prAdapter != NULL) && - (prP2pBssInfo != NULL) && - (eOpMode < OP_MODE_NUM)); - - if (prP2pBssInfo->eCurrentOPMode != eOpMode) { - DBGLOG(P2P, TRACE, ("p2pFuncSwitchOPMode: Switch to from %d, to %d.\n", prP2pBssInfo->eCurrentOPMode, eOpMode)); - - switch (prP2pBssInfo->eCurrentOPMode) { - case OP_MODE_ACCESS_POINT: - p2pFuncDissolve(prAdapter, prP2pBssInfo, TRUE, REASON_CODE_DEAUTH_LEAVING_BSS); - - p2pFsmRunEventStopAP(prAdapter, NULL); - break; - default: - break; - } - - - prP2pBssInfo->eIntendOPMode = eOpMode; - prP2pBssInfo->eCurrentOPMode = eOpMode; - switch (eOpMode) { - case OP_MODE_INFRASTRUCTURE: - DBGLOG(P2P, TRACE, ("p2pFuncSwitchOPMode: Switch to Client.\n")); - case OP_MODE_ACCESS_POINT: -// if (!IS_BSS_ACTIVE(prP2pBssInfo)) { -// SET_NET_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX); -// nicActivateNetwork(prAdapter, NETWORK_TYPE_P2P_INDEX); -// } - - /* Change interface address. */ - if (eOpMode == OP_MODE_ACCESS_POINT) { - DBGLOG(P2P, TRACE, ("p2pFuncSwitchOPMode: Switch to AP.\n")); - prP2pBssInfo->ucSSIDLen = 0; - } - - COPY_MAC_ADDR(prP2pBssInfo->aucOwnMacAddr, prAdapter->rWifiVar.aucInterfaceAddress); - COPY_MAC_ADDR(prP2pBssInfo->aucBSSID, prAdapter->rWifiVar.aucInterfaceAddress); - - - break; - case OP_MODE_P2P_DEVICE: - { - /* Change device address. */ - DBGLOG(P2P, TRACE, ("p2pFuncSwitchOPMode: Switch back to P2P Device.\n")); - -// if (!IS_BSS_ACTIVE(prP2pBssInfo)) { -// SET_NET_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX); -// nicActivateNetwork(prAdapter, NETWORK_TYPE_P2P_INDEX); -// } - - p2pChangeMediaState(prAdapter, PARAM_MEDIA_STATE_DISCONNECTED); - - COPY_MAC_ADDR(prP2pBssInfo->aucOwnMacAddr, prAdapter->rWifiVar.aucDeviceAddress); - COPY_MAC_ADDR(prP2pBssInfo->aucBSSID, prAdapter->rWifiVar.aucDeviceAddress); - - - } - break; - default: -// if (IS_BSS_ACTIVE(prP2pBssInfo)) { -// UNSET_NET_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX); - -// nicDeactivateNetwork(prAdapter, NETWORK_TYPE_P2P_INDEX); -// } - ASSERT(FALSE); - break; - } - - if (1) { - P2P_DISCONNECT_INFO rP2PDisInfo; - - rP2PDisInfo.ucRole = 2; - wlanSendSetQueryCmd(prAdapter, - CMD_ID_P2P_ABORT, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(P2P_DISCONNECT_INFO), - (PUINT_8)&rP2PDisInfo, - NULL, - 0); - } - - - DBGLOG(P2P, TRACE, ("The device address is changed to " MACSTR " \n", MAC2STR(prP2pBssInfo->aucOwnMacAddr))); - DBGLOG(P2P, TRACE, ("The BSSID is changed to " MACSTR " \n", MAC2STR(prP2pBssInfo->aucBSSID))); - - /* Update BSS INFO to FW. */ - if ((fgSyncToFW) && (eOpMode != OP_MODE_ACCESS_POINT)) { - nicUpdateBss(prAdapter, NETWORK_TYPE_P2P_INDEX); - } - } - - } while (FALSE); - - return; -} /* p2pFuncSwitchOPMode */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will start a P2P Group Owner and send Beacon Frames. -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFuncStartGO ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo, - IN PUINT_8 pucSsidBuf, - IN UINT_8 ucSsidLen, - IN UINT_8 ucChannelNum, - IN ENUM_BAND_T eBand, - IN ENUM_CHNL_EXT_T eSco, - IN BOOLEAN fgIsPureAP - ) -{ - do { - ASSERT_BREAK((prAdapter != NULL) && (prBssInfo != NULL)); - - ASSERT(prBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT); - - DBGLOG(P2P, TRACE, ("p2pFuncStartGO:\n")); - - /* AP mode started. */ - p2pFuncSwitchOPMode(prAdapter, prBssInfo, prBssInfo->eIntendOPMode, FALSE); - - prBssInfo->eIntendOPMode = OP_MODE_NUM; - - //4 <1.1> Assign SSID - COPY_SSID(prBssInfo->aucSSID, - prBssInfo->ucSSIDLen, - pucSsidBuf, - ucSsidLen); - - DBGLOG(P2P, TRACE, ("GO SSID:%s \n", prBssInfo->aucSSID)); - - //4 <1.2> Clear current AP's STA_RECORD_T and current AID - prBssInfo->prStaRecOfAP = (P_STA_RECORD_T)NULL; - prBssInfo->u2AssocId = 0; - - - //4 <1.3> Setup Channel, Band and Phy Attributes - prBssInfo->ucPrimaryChannel = ucChannelNum; - prBssInfo->eBand = eBand; - prBssInfo->eBssSCO = eSco; - - DBGLOG(P2P, TRACE, ("GO Channel:%d \n", ucChannelNum)); - - - if (prBssInfo->eBand == BAND_5G) { - prBssInfo->ucPhyTypeSet = (prAdapter->rWifiVar.ucAvailablePhyTypeSet & PHY_TYPE_SET_802_11AN); /* Depend on eBand */ - prBssInfo->ucConfigAdHocAPMode = AP_MODE_11A; /* Depend on eCurrentOPMode and ucPhyTypeSet */ - } - else if (fgIsPureAP) { - prBssInfo->ucPhyTypeSet = (prAdapter->rWifiVar.ucAvailablePhyTypeSet & PHY_TYPE_SET_802_11BGN); /* Depend on eBand */ - prBssInfo->ucConfigAdHocAPMode = AP_MODE_MIXED_11BG; /* Depend on eCurrentOPMode and ucPhyTypeSet */ - } - else { - prBssInfo->ucPhyTypeSet = (prAdapter->rWifiVar.ucAvailablePhyTypeSet & PHY_TYPE_SET_802_11GN); /* Depend on eBand */ - prBssInfo->ucConfigAdHocAPMode = AP_MODE_11G_P2P; /* Depend on eCurrentOPMode and ucPhyTypeSet */ - } - - - prBssInfo->ucNonHTBasicPhyType = (UINT_8) - rNonHTApModeAttributes[prBssInfo->ucConfigAdHocAPMode].ePhyTypeIndex; - prBssInfo->u2BSSBasicRateSet = - rNonHTApModeAttributes[prBssInfo->ucConfigAdHocAPMode].u2BSSBasicRateSet; - prBssInfo->u2OperationalRateSet = - rNonHTPhyAttributes[prBssInfo->ucNonHTBasicPhyType].u2SupportedRateSet; - - if (prBssInfo->ucAllSupportedRatesLen == 0) { - rateGetDataRatesFromRateSet(prBssInfo->u2OperationalRateSet, - prBssInfo->u2BSSBasicRateSet, - prBssInfo->aucAllSupportedRates, - &prBssInfo->ucAllSupportedRatesLen); - } - - //4 <1.5> Setup MIB for current BSS - prBssInfo->u2ATIMWindow = 0; - prBssInfo->ucBeaconTimeoutCount = 0; - - //3 <2> Update BSS_INFO_T common part -#if CFG_SUPPORT_AAA - if (!fgIsPureAP) { - prBssInfo->fgIsProtection = TRUE; /* Always enable protection at P2P GO */ - kalP2PSetCipher(prAdapter->prGlueInfo, IW_AUTH_CIPHER_CCMP); - } - else { - if (kalP2PGetCipher(prAdapter->prGlueInfo)) - prBssInfo->fgIsProtection = TRUE; - } - - // 20120106 frog: I want separate OP_Mode & Beacon TX Function. - //p2pFuncSwitchOPMode(prAdapter, prBssInfo, OP_MODE_ACCESS_POINT, FALSE); - - bssInitForAP(prAdapter, prBssInfo, FALSE); - - nicQmUpdateWmmParms(prAdapter, NETWORK_TYPE_P2P_INDEX); -#endif /* CFG_SUPPORT_AAA */ - - - //3 <3> Set MAC HW - //4 <3.1> Setup channel and bandwidth - rlmBssInitForAPandIbss(prAdapter, prBssInfo); - - //4 <3.2> Reset HW TSF Update Mode and Beacon Mode - nicUpdateBss(prAdapter, NETWORK_TYPE_P2P_INDEX); - - //4 <3.3> Update Beacon again for network phy type confirmed. - bssUpdateBeaconContent(prAdapter, NETWORK_TYPE_P2P_INDEX); - - //4 <3.4> Setup BSSID - nicPmIndicateBssCreated(prAdapter, NETWORK_TYPE_P2P_INDEX); - - } while (FALSE); - - return; -} /* p2pFuncStartGO() */ - - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is to inform CNM that channel privilege -* has been released -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFuncReleaseCh ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo - ) -{ - P_MSG_CH_ABORT_T prMsgChRelease = (P_MSG_CH_ABORT_T)NULL; - - DEBUGFUNC("p2pFuncReleaseCh()"); - - do { - ASSERT_BREAK((prAdapter != NULL) && (prChnlReqInfo != NULL)); - - if (!prChnlReqInfo->fgIsChannelRequested) { - break; - } - else { - DBGLOG(P2P, TRACE, ("P2P Release Channel\n")); - prChnlReqInfo->fgIsChannelRequested = FALSE; - } - - /* 1. return channel privilege to CNM immediately */ - prMsgChRelease = (P_MSG_CH_ABORT_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_CH_ABORT_T)); - if (!prMsgChRelease) { - ASSERT(0); // Can't release Channel to CNM - break; - } - - prMsgChRelease->rMsgHdr.eMsgId = MID_MNY_CNM_CH_ABORT; - prMsgChRelease->ucNetTypeIndex = NETWORK_TYPE_P2P_INDEX; - prMsgChRelease->ucTokenID = prChnlReqInfo->ucSeqNumOfChReq++; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prMsgChRelease, - MSG_SEND_METHOD_BUF); - - } while (FALSE); - - return; -} /* p2pFuncReleaseCh */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Process of CHANNEL_REQ_JOIN Initial. Enter CHANNEL_REQ_JOIN State. -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFuncAcquireCh ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo - ) -{ - P_MSG_CH_REQ_T prMsgChReq = (P_MSG_CH_REQ_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prChnlReqInfo != NULL)); - - p2pFuncReleaseCh(prAdapter, prChnlReqInfo); - - /* send message to CNM for acquiring channel */ - prMsgChReq = (P_MSG_CH_REQ_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_CH_REQ_T)); - - if (!prMsgChReq) { - ASSERT(0); // Can't indicate CNM for channel acquiring - break; - } - - prMsgChReq->rMsgHdr.eMsgId = MID_MNY_CNM_CH_REQ; - prMsgChReq->ucNetTypeIndex = NETWORK_TYPE_P2P_INDEX; - prMsgChReq->ucTokenID = ++prChnlReqInfo->ucSeqNumOfChReq; - prMsgChReq->eReqType = CH_REQ_TYPE_JOIN; - prMsgChReq->u4MaxInterval = prChnlReqInfo->u4MaxInterval; - - prMsgChReq->ucPrimaryChannel = prChnlReqInfo->ucReqChnlNum; - prMsgChReq->eRfSco = prChnlReqInfo->eChnlSco; - prMsgChReq->eRfBand = prChnlReqInfo->eBand; - - kalMemZero(prMsgChReq->aucBSSID, MAC_ADDR_LEN); - - /* Channel request join BSSID. */ - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prMsgChReq, - MSG_SEND_METHOD_BUF); - - prChnlReqInfo->fgIsChannelRequested = TRUE; - - } while (FALSE); - - return; -} /* p2pFuncAcquireCh */ - -#if 0 -WLAN_STATUS -p2pFuncBeaconUpdate( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBcnHdr, - IN UINT_32 u4HdrLen, - IN PUINT_8 pucBcnBody, - IN UINT_32 u4BodyLen, - IN UINT_32 u4DtimPeriod, - IN UINT_32 u4BcnInterval) -{ - WLAN_STATUS rResultStatus = WLAN_STATUS_INVALID_DATA; - P_WLAN_BEACON_FRAME_T prBcnFrame = (P_WLAN_BEACON_FRAME_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - P_MSDU_INFO_T prBcnMsduInfo = (P_MSDU_INFO_T)NULL; - PUINT_8 pucTIMBody = (PUINT_8)NULL; - UINT_16 u2FrameLength = 0, UINT_16 u2OldBodyLen = 0; - UINT_8 aucIEBuf[MAX_IE_LENGTH]; - - do { - ASSERT_BREAK(prAdapter != NULL); - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - prBcnMsduInfo = prP2pBssInfo->prBeacon - - ASSERT_BREAK(prBcnMsduInfo != NULL); - - /* TODO: Find TIM IE pointer. */ - prBcnFrame = prBcnMsduInfo->prPacket; - - ASSERT_BREAK(prBcnFrame != NULL); - - do { - /* Ori header. */ - UINT_16 u2IELength = 0, u2Offset = 0; - PUINT_8 pucIEBuf = prBcnFrame->aucInfoElem; - - u2IELength = prBcnMsduInfo->u2FrameLength - prBcnMsduInfo->ucMacHeaderLength; - - IE_FOR_EACH(pucIEBuf, u2IELength, u2Offset) { - if ((IE_ID(pucIEBuf) == ELEM_ID_TIM) || - ((IE_ID(pucIEBuf) > ELEM_ID_IBSS_PARAM_SET)) { - pucTIMBody = pucIEBuf; - break - } - u2FrameLength += IE_SIZE(pucIEBuf); - } - - if (pucTIMBody == NULL) { - pucTIMBody = pucIEBuf; - } - - /* Body not change. */ - u2OldBodyLen = (UINT_16)((UINT_32)pucTIMBody - (UINT_32)prBcnFrame->aucInfoElem); - - // Move body. - kalMemCmp(aucIEBuf, pucTIMBody, u2OldBodyLen); - } while (FALSE); - - - if (pucBcnHdr) { - kalMemCopy(prBcnMsduInfo->prPacket, pucBcnHdr, u4HdrLen); - - pucTIMBody = (PUINT_8)((UINT_32)prBcnMsduInfo->prPacket + u4HdrLen); - - prBcnMsduInfo->ucMacHeaderLength = (WLAN_MAC_MGMT_HEADER_LEN + - (TIMESTAMP_FIELD_LEN + BEACON_INTERVAL_FIELD_LEN + CAP_INFO_FIELD_LEN)); - - u2FrameLength = u4HdrLen; /* Header + Partial Body. */ - - } - else { - /* Header not change. */ - u2FrameLength += prBcnMsduInfo->ucMacHeaderLength; - } - - - if (pucBcnBody) { - kalMemCopy(pucTIMBody, pucBcnBody, u4BodyLen); - u2FrameLength += (UINT_16)u4BodyLen; - } - else { - kalMemCopy(pucTIMBody, aucIEBuf, u2OldBodyLen); - u2FrameLength += u2OldBodyLen; - } - - /* Frame Length */ - prBcnMsduInfo->u2FrameLength = u2FrameLength; - - prBcnMsduInfo->fgIs802_11 = TRUE; - prBcnMsduInfo->ucNetworkType = NETWORK_TYPE_P2P_INDEX; - - prP2pBssInfo->u2BeaconInterval = (UINT_16)u4BcnInterval; - prP2pBssInfo->ucDTIMPeriod = (UINT_8)u4DtimPeriod; - prP2pBssInfo->u2CapInfo = prBcnFrame->u2CapInfo; - prBcnMsduInfo->ucPacketType = 3; - - rResultStatus = nicUpdateBeaconIETemplate(prAdapter, - IE_UPD_METHOD_UPDATE_ALL, - NETWORK_TYPE_P2P_INDEX, - prP2pBssInfo->u2CapInfo, - (PUINT_8)prBcnFrame->aucInfoElem, - prBcnMsduInfo->u2FrameLength - OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem)); - - if (prP2pBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT) { - /* AP is created, Beacon Update. */ - nicPmIndicateBssAbort(prAdapter, NETWORK_TYPE_P2P_INDEX); - - nicPmIndicateBssCreated(prAdapter, NETWORK_TYPE_P2P_INDEX); - } - - } while (FALSE); - - return rResultStatus; -} /* p2pFuncBeaconUpdate */ - -#else -WLAN_STATUS -p2pFuncBeaconUpdate ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prP2pBssInfo, - IN P_P2P_BEACON_UPDATE_INFO_T prBcnUpdateInfo, - IN PUINT_8 pucNewBcnHdr, - IN UINT_32 u4NewHdrLen, - IN PUINT_8 pucNewBcnBody, - IN UINT_32 u4NewBodyLen - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_SUCCESS; - P_WLAN_BEACON_FRAME_T prBcnFrame = (P_WLAN_BEACON_FRAME_T)NULL; - P_MSDU_INFO_T prBcnMsduInfo = (P_MSDU_INFO_T)NULL; - PUINT_8 pucIEBuf = (PUINT_8)NULL; - UINT_8 aucIEBuf[MAX_IE_LENGTH]; - - do { - ASSERT_BREAK((prAdapter != NULL) && - (prP2pBssInfo != NULL) && - (prBcnUpdateInfo != NULL)); - - prBcnMsduInfo = prP2pBssInfo->prBeacon; - -#if DBG - if (prBcnUpdateInfo->pucBcnHdr != NULL) { - ASSERT((UINT_32)prBcnUpdateInfo->pucBcnHdr == ((UINT_32)prBcnMsduInfo->prPacket + MAC_TX_RESERVED_FIELD)); - } - - if (prBcnUpdateInfo->pucBcnBody != NULL) { - ASSERT((UINT_32)prBcnUpdateInfo->pucBcnBody == ((UINT_32)prBcnUpdateInfo->pucBcnHdr + (UINT_32)prBcnUpdateInfo->u4BcnHdrLen)); - } -#endif - prBcnFrame = (P_WLAN_BEACON_FRAME_T)((UINT_32)prBcnMsduInfo->prPacket + MAC_TX_RESERVED_FIELD); - - if (!pucNewBcnBody) { - /* Old body. */ - pucNewBcnBody = prBcnUpdateInfo->pucBcnBody; - ASSERT(u4NewBodyLen == 0); - u4NewBodyLen = prBcnUpdateInfo->u4BcnBodyLen; - } - else { - prBcnUpdateInfo->u4BcnBodyLen = u4NewBodyLen; - } - - /* Temp buffer body part. */ - kalMemCopy(aucIEBuf, pucNewBcnBody, u4NewBodyLen); - - if (pucNewBcnHdr) { - kalMemCopy(prBcnFrame, pucNewBcnHdr, u4NewHdrLen); - prBcnUpdateInfo->pucBcnHdr = (PUINT_8)prBcnFrame; - prBcnUpdateInfo->u4BcnHdrLen = u4NewHdrLen; - } - - pucIEBuf = (PUINT_8)((UINT_32)prBcnUpdateInfo->pucBcnHdr + (UINT_32)prBcnUpdateInfo->u4BcnHdrLen); - kalMemCopy(pucIEBuf, aucIEBuf, u4NewBodyLen); - prBcnUpdateInfo->pucBcnBody = pucIEBuf; - - /* Frame Length */ - prBcnMsduInfo->u2FrameLength = (UINT_16)(prBcnUpdateInfo->u4BcnHdrLen + prBcnUpdateInfo->u4BcnBodyLen); - - prBcnMsduInfo->ucPacketType = 3; - prBcnMsduInfo->fgIs802_11 = TRUE; - prBcnMsduInfo->ucNetworkType = NETWORK_TYPE_P2P_INDEX; - - - /* Update BSS INFO related information. */ - COPY_MAC_ADDR(prP2pBssInfo->aucOwnMacAddr, prBcnFrame->aucSrcAddr); - COPY_MAC_ADDR(prP2pBssInfo->aucBSSID, prBcnFrame->aucBSSID); - prP2pBssInfo->u2CapInfo = prBcnFrame->u2CapInfo; - - p2pFuncParseBeaconContent(prAdapter, - prP2pBssInfo, - (PUINT_8)prBcnFrame->aucInfoElem, - (prBcnMsduInfo->u2FrameLength - OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem))); - -#if 1 - //bssUpdateBeaconContent(prAdapter, NETWORK_TYPE_P2P_INDEX); -#else - nicUpdateBeaconIETemplate(prAdapter, - IE_UPD_METHOD_UPDATE_ALL, - NETWORK_TYPE_P2P_INDEX, - prBcnFrame->u2CapInfo, - (PUINT_8)prBcnFrame->aucInfoElem, - (prBcnMsduInfo->u2FrameLength - OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem))); -#endif - } while (FALSE); - - return rWlanStatus; -} /* p2pFuncBeaconUpdate */ - -#endif - -// TODO: We do not apply IE in deauth frame set from upper layer now. -WLAN_STATUS -p2pFuncDeauth ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucPeerMacAddr, - IN UINT_16 u2ReasonCode, - IN PUINT_8 pucIEBuf, - IN UINT_16 u2IELen, - IN BOOLEAN fgSendDeauth - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_FAILURE; - P_STA_RECORD_T prCliStaRec = (P_STA_RECORD_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - BOOLEAN fgIsStaFound = FALSE; - - do { - ASSERT_BREAK((prAdapter != NULL) && (pucPeerMacAddr != NULL)); - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - prCliStaRec = cnmGetStaRecByAddress(prAdapter, - NETWORK_TYPE_P2P_INDEX, - pucPeerMacAddr); - - switch (prP2pBssInfo->eCurrentOPMode) { - case OP_MODE_ACCESS_POINT: - { - P_LINK_T prStaRecOfClientList = (P_LINK_T)NULL; - P_LINK_ENTRY_T prLinkEntry = (P_LINK_ENTRY_T)NULL; - - prStaRecOfClientList = &(prP2pBssInfo->rStaRecOfClientList); - - LINK_FOR_EACH(prLinkEntry, prStaRecOfClientList) { - if ((UINT_32)prCliStaRec == (UINT_32)prLinkEntry) { - LINK_REMOVE_KNOWN_ENTRY(prStaRecOfClientList, &prCliStaRec->rLinkEntry); - fgIsStaFound = TRUE; - break; - } - } - - } - break; - case OP_MODE_INFRASTRUCTURE: - ASSERT(prCliStaRec == prP2pBssInfo->prStaRecOfAP); - if (prCliStaRec != prP2pBssInfo->prStaRecOfAP) { - break; - } - prP2pBssInfo->prStaRecOfAP = NULL; - fgIsStaFound = TRUE; - break; - default: - break; - } - - if (fgIsStaFound) { - p2pFuncDisconnect(prAdapter, prCliStaRec, fgSendDeauth, u2ReasonCode); - } - - rWlanStatus = WLAN_STATUS_SUCCESS; - } while (FALSE); - - return rWlanStatus; -} /* p2pFuncDeauth */ - -// TODO: We do not apply IE in disassoc frame set from upper layer now. -WLAN_STATUS -p2pFuncDisassoc ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucPeerMacAddr, - IN UINT_16 u2ReasonCode, - IN PUINT_8 pucIEBuf, - IN UINT_16 u2IELen, - IN BOOLEAN fgSendDisassoc - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_FAILURE; - P_STA_RECORD_T prCliStaRec = (P_STA_RECORD_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - BOOLEAN fgIsStaFound = FALSE; - - do { - ASSERT_BREAK((prAdapter != NULL) && (pucPeerMacAddr != NULL)); - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - prCliStaRec = cnmGetStaRecByAddress(prAdapter, - NETWORK_TYPE_P2P_INDEX, - pucPeerMacAddr); - - switch (prP2pBssInfo->eCurrentOPMode) { - case OP_MODE_ACCESS_POINT: - { - P_LINK_T prStaRecOfClientList = (P_LINK_T)NULL; - P_LINK_ENTRY_T prLinkEntry = (P_LINK_ENTRY_T)NULL; - - prStaRecOfClientList = &(prP2pBssInfo->rStaRecOfClientList); - - LINK_FOR_EACH(prLinkEntry, prStaRecOfClientList) { - if ((UINT_32)prCliStaRec == (UINT_32)prLinkEntry) { - LINK_REMOVE_KNOWN_ENTRY(prStaRecOfClientList, &prCliStaRec->rLinkEntry); - fgIsStaFound = TRUE; - //p2pFuncDisconnect(prAdapter, prCliStaRec, fgSendDisassoc, u2ReasonCode); - break; - } - } - - } - break; - case OP_MODE_INFRASTRUCTURE: - ASSERT(prCliStaRec == prP2pBssInfo->prStaRecOfAP); - if (prCliStaRec != prP2pBssInfo->prStaRecOfAP) { - break; - } - - //p2pFuncDisconnect(prAdapter, prCliStaRec, fgSendDisassoc, u2ReasonCode); - prP2pBssInfo->prStaRecOfAP = NULL; - fgIsStaFound = TRUE; - break; - default: - break; - } - - if (fgIsStaFound) { - - p2pFuncDisconnect(prAdapter, prCliStaRec, fgSendDisassoc, u2ReasonCode); - //20120830 moved into p2pFuncDisconnect(). - //cnmStaRecFree(prAdapter, prCliStaRec, TRUE); - - } - - rWlanStatus = WLAN_STATUS_SUCCESS; - } while (FALSE); - - return rWlanStatus; -} /* p2pFuncDisassoc */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to dissolve from group or one group. (Would not change P2P FSM.) -* 1. GC: Disconnect from AP. (Send Deauth) -* 2. GO: Disconnect all STA -* -* @param[in] prAdapter Pointer to the adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFuncDissolve ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prP2pBssInfo, - IN BOOLEAN fgSendDeauth, - IN UINT_16 u2ReasonCode - ) -{ - DEBUGFUNC("p2pFuncDissolve()"); - - do { - - ASSERT_BREAK((prAdapter != NULL) && (prP2pBssInfo != NULL)); - - switch (prP2pBssInfo->eCurrentOPMode) { - case OP_MODE_INFRASTRUCTURE: - /* Reset station record status. */ - if (prP2pBssInfo->prStaRecOfAP) { - kalP2PGCIndicateConnectionStatus(prAdapter->prGlueInfo, - NULL, - NULL, - 0, - REASON_CODE_DEAUTH_LEAVING_BSS); - - // 2012/02/14 frog: After formation before join group, prStaRecOfAP is NULL. - p2pFuncDisconnect(prAdapter, - prP2pBssInfo->prStaRecOfAP, - fgSendDeauth, - u2ReasonCode); - } - - /* Fix possible KE when RX Beacon & call nicPmIndicateBssConnected(). hit prStaRecOfAP == NULL. */ - p2pChangeMediaState(prAdapter, PARAM_MEDIA_STATE_DISCONNECTED); - - prP2pBssInfo->prStaRecOfAP = NULL; - - break; - case OP_MODE_ACCESS_POINT: - /* Under AP mode, we would net send deauthentication frame to each STA. - * We only stop the Beacon & let all stations timeout. - */ - { - P_LINK_T prStaRecOfClientList = (P_LINK_T)NULL; - - /* Send deauth. */ - authSendDeauthFrame(prAdapter, - NULL, - (P_SW_RFB_T)NULL, - u2ReasonCode, - (PFN_TX_DONE_HANDLER)NULL); - - prStaRecOfClientList = &prP2pBssInfo->rStaRecOfClientList; - - while (!LINK_IS_EMPTY(prStaRecOfClientList)) { - P_STA_RECORD_T prCurrStaRec; - - LINK_REMOVE_HEAD(prStaRecOfClientList, prCurrStaRec, P_STA_RECORD_T); - - /* Indicate to Host. */ - //kalP2PGOStationUpdate(prAdapter->prGlueInfo, prCurrStaRec, FALSE); - - p2pFuncDisconnect(prAdapter, prCurrStaRec, TRUE, u2ReasonCode); - - } - - } - - break; - default: - return; // 20110420 -- alreay in Device Mode. - } - - /* Make the deauth frame send to FW ASAP. */ - wlanAcquirePowerControl(prAdapter); - wlanProcessCommandQueue(prAdapter, &prAdapter->prGlueInfo->rCmdQueue); - wlanReleasePowerControl(prAdapter); - - kalMdelay(100); - - /* Change Connection Status. */ - p2pChangeMediaState(prAdapter, PARAM_MEDIA_STATE_DISCONNECTED); - - } while (FALSE); - - return; -} /* p2pFuncDissolve */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to dissolve from group or one group. (Would not change P2P FSM.) -* 1. GC: Disconnect from AP. (Send Deauth) -* 2. GO: Disconnect all STA -* -* @param[in] prAdapter Pointer to the adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFuncDisconnect ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN BOOLEAN fgSendDeauth, - IN UINT_16 u2ReasonCode - ) -{ - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - ENUM_PARAM_MEDIA_STATE_T eOriMediaStatus; - - DBGLOG(P2P, TRACE, ("p2pFuncDisconnect()")); - - do { - ASSERT_BREAK((prAdapter != NULL) && (prStaRec != NULL)); - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - eOriMediaStatus = prP2pBssInfo->eConnectionState; - - /* Indicate disconnect. */ - // TODO: -// kalP2PGOStationUpdate -// kalP2PGCIndicateConnectionStatus - //p2pIndicationOfMediaStateToHost(prAdapter, PARAM_MEDIA_STATE_DISCONNECTED, prStaRec->aucMacAddr); - if (prP2pBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT) { - kalP2PGOStationUpdate(prAdapter->prGlueInfo, prStaRec, FALSE); - } - - if (fgSendDeauth) { - /* Send deauth. */ - authSendDeauthFrame(prAdapter, - prStaRec, - (P_SW_RFB_T)NULL, - u2ReasonCode, - (PFN_TX_DONE_HANDLER)p2pFsmRunEventDeauthTxDone); - } - else { - /* Change station state. */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - - /* Reset Station Record Status. */ - p2pFuncResetStaRecStatus(prAdapter, prStaRec); - - cnmStaRecFree(prAdapter, prStaRec, TRUE); - - if ((prP2pBssInfo->eCurrentOPMode != OP_MODE_ACCESS_POINT) || - (prP2pBssInfo->rStaRecOfClientList.u4NumElem == 0)) { - DBGLOG(P2P, TRACE, ("No More Client, Media Status DISCONNECTED\n")); - p2pChangeMediaState(prAdapter, PARAM_MEDIA_STATE_DISCONNECTED); - } - - if (eOriMediaStatus != prP2pBssInfo->eConnectionState) { - /* Update Disconnected state to FW. */ - nicUpdateBss(prAdapter, NETWORK_TYPE_P2P_INDEX); - } - - } - - if (prP2pBssInfo->eCurrentOPMode != OP_MODE_ACCESS_POINT) { - /* GO: It would stop Beacon TX. GC: Stop all BSS related PS function. */ - nicPmIndicateBssAbort(prAdapter, NETWORK_TYPE_P2P_INDEX); - - /* Reset RLM related field of BSSINFO. */ - rlmBssAborted(prAdapter, prP2pBssInfo); - } - - } while (FALSE); - - return; - -} /* p2pFuncDisconnect */ - - - - - - -WLAN_STATUS -p2pFuncTxMgmtFrame ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_MGMT_TX_REQ_INFO_T prMgmtTxReqInfo, - IN P_MSDU_INFO_T prMgmtTxMsdu, - IN UINT_64 u8Cookie - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_SUCCESS; - P_MSDU_INFO_T prTxMsduInfo = (P_MSDU_INFO_T)NULL; - P_WLAN_MAC_HEADER_T prWlanHdr = (P_WLAN_MAC_HEADER_T)NULL; - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMgmtTxReqInfo != NULL)); - - if (prMgmtTxReqInfo->fgIsMgmtTxRequested) { - - // 1. prMgmtTxReqInfo->prMgmtTxMsdu != NULL - /* Packet on driver, not done yet, drop it. */ - if ((prTxMsduInfo = prMgmtTxReqInfo->prMgmtTxMsdu) != NULL) { - - kalP2PIndicateMgmtTxStatus(prAdapter->prGlueInfo, - prMgmtTxReqInfo->u8Cookie, - FALSE, - prTxMsduInfo->prPacket, - (UINT_32)prTxMsduInfo->u2FrameLength); - - // Leave it to TX Done handler. - //cnmMgtPktFree(prAdapter, prTxMsduInfo); - prMgmtTxReqInfo->prMgmtTxMsdu = NULL; - } - - // 2. prMgmtTxReqInfo->prMgmtTxMsdu == NULL - /* Packet transmitted, wait tx done. (cookie issue) */ - // 20120105 frog - use another u8cookie to store this value. - - } - - ASSERT(prMgmtTxReqInfo->prMgmtTxMsdu == NULL); - - - - prWlanHdr = (P_WLAN_MAC_HEADER_T)((UINT_32)prMgmtTxMsdu->prPacket + MAC_TX_RESERVED_FIELD); - prStaRec = cnmGetStaRecByAddress(prAdapter, NETWORK_TYPE_P2P_INDEX, prWlanHdr->aucAddr1); - prMgmtTxMsdu->ucNetworkType = (UINT_8)NETWORK_TYPE_P2P_INDEX; - - switch (prWlanHdr->u2FrameCtrl & MASK_FRAME_TYPE) { - case MAC_FRAME_PROBE_RSP: - prMgmtTxMsdu = p2pFuncProcessP2pProbeRsp(prAdapter, prMgmtTxMsdu); - break; - default: - break; - } - - - prMgmtTxReqInfo->u8Cookie = u8Cookie; - prMgmtTxReqInfo->prMgmtTxMsdu = prMgmtTxMsdu; - prMgmtTxReqInfo->fgIsMgmtTxRequested = TRUE; - - prMgmtTxMsdu->eSrc = TX_PACKET_MGMT; - prMgmtTxMsdu->ucPacketType = HIF_TX_PACKET_TYPE_MGMT; - prMgmtTxMsdu->ucStaRecIndex = (prStaRec != NULL)?(prStaRec->ucIndex):(0xFF); - if (prStaRec != NULL) { - DBGLOG(P2P, TRACE, ("Mgmt with station record: "MACSTR" .\n", MAC2STR(prStaRec->aucMacAddr))); - } - - prMgmtTxMsdu->ucMacHeaderLength = WLAN_MAC_MGMT_HEADER_LEN; // TODO: undcertain. - prMgmtTxMsdu->fgIs802_1x = FALSE; - prMgmtTxMsdu->fgIs802_11 = TRUE; - prMgmtTxMsdu->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMgmtTxMsdu->pfTxDoneHandler = p2pFsmRunEventMgmtFrameTxDone; - prMgmtTxMsdu->fgIsBasicRate = TRUE; - DBGLOG(P2P, TRACE, ("Mgmt seq NO. %d .\n", prMgmtTxMsdu->ucTxSeqNum)); - - nicTxEnqueueMsdu(prAdapter, prMgmtTxMsdu); - - } while (FALSE); - - return rWlanStatus; -} /* p2pFuncTxMgmtFrame */ - - - -VOID -p2pFuncSetChannel ( - IN P_ADAPTER_T prAdapter, - IN P_RF_CHANNEL_INFO_T prRfChannelInfo - ) -{ - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prRfChannelInfo != NULL)); - - prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - - prP2pConnSettings->ucOperatingChnl = prRfChannelInfo->ucChannelNum; - prP2pConnSettings->eBand = prRfChannelInfo->eBand; - - - } while (FALSE); - - return; -} -/* p2pFuncSetChannel */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Retry JOIN for AUTH_MODE_AUTO_SWITCH -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @retval TRUE We will retry JOIN -* @retval FALSE We will not retry JOIN -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -p2pFuncRetryJOIN ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN P_P2P_JOIN_INFO_T prJoinInfo - ) -{ - P_MSG_JOIN_REQ_T prJoinReqMsg = (P_MSG_JOIN_REQ_T)NULL; - BOOLEAN fgRetValue = FALSE; - - do { - ASSERT_BREAK((prAdapter != NULL) && - (prStaRec != NULL) && - (prJoinInfo != NULL)); - - /* Retry other AuthType if possible */ - if (!prJoinInfo->ucAvailableAuthTypes) { - break; - } - - if (prJoinInfo->ucAvailableAuthTypes & - (UINT_8)AUTH_TYPE_SHARED_KEY) { - - DBGLOG(P2P, INFO, ("RETRY JOIN INIT: Retry Authentication with AuthType == SHARED_KEY.\n")); - - prJoinInfo->ucAvailableAuthTypes &= - ~(UINT_8)AUTH_TYPE_SHARED_KEY; - - prStaRec->ucAuthAlgNum = (UINT_8)AUTH_ALGORITHM_NUM_SHARED_KEY; - } - else { - DBGLOG(P2P, ERROR, ("RETRY JOIN INIT: Retry Authentication with Unexpected AuthType.\n")); - ASSERT(0); - break; - } - - prJoinInfo->ucAvailableAuthTypes = 0; /* No more available Auth Types */ - - /* Trigger SAA to start JOIN process. */ - prJoinReqMsg = (P_MSG_JOIN_REQ_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_JOIN_REQ_T)); - if (!prJoinReqMsg) { - ASSERT(0); // Can't trigger SAA FSM - break; - } - - prJoinReqMsg->rMsgHdr.eMsgId = MID_P2P_SAA_FSM_START; - prJoinReqMsg->ucSeqNum = ++prJoinInfo->ucSeqNumOfReqMsg; - prJoinReqMsg->prStaRec = prStaRec; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prJoinReqMsg, - MSG_SEND_METHOD_BUF); - - - fgRetValue = TRUE; - } while (FALSE); - - return fgRetValue; - - - -}/* end of p2pFuncRetryJOIN() */ - - - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will update the contain of BSS_INFO_T for AIS network once -* the association was completed. -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* @param[in] prAssocRspSwRfb Pointer to SW RFB of ASSOC RESP FRAME. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFuncUpdateBssInfoForJOIN ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prAssocRspSwRfb - ) -{ - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL; - P_WLAN_ASSOC_RSP_FRAME_T prAssocRspFrame = (P_WLAN_ASSOC_RSP_FRAME_T)NULL; - UINT_16 u2IELength; - PUINT_8 pucIE; - - DEBUGFUNC("p2pUpdateBssInfoForJOIN()"); - - ASSERT(prAdapter); - ASSERT(prStaRec); - ASSERT(prAssocRspSwRfb); - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - prAssocRspFrame = (P_WLAN_ASSOC_RSP_FRAME_T) prAssocRspSwRfb->pvHeader; - - DBGLOG(P2P, INFO, ("Update P2P_BSS_INFO_T and apply settings to MAC\n")); - - //3 <1> Update BSS_INFO_T from AIS_FSM_INFO_T or User Settings - //4 <1.1> Setup Operation Mode - prP2pBssInfo->eCurrentOPMode = OP_MODE_INFRASTRUCTURE; - - //4 <1.2> Setup SSID - COPY_SSID(prP2pBssInfo->aucSSID, - prP2pBssInfo->ucSSIDLen, - prP2pConnSettings->aucSSID, - prP2pConnSettings->ucSSIDLen); - - if (prBssDesc == NULL) { - /* Target BSS NULL. */ - DBGLOG(P2P, TRACE,("Target BSS NULL\n")); - return; - } - - - if (UNEQUAL_MAC_ADDR(prBssDesc->aucBSSID, prAssocRspFrame->aucBSSID)) { - ASSERT(FALSE); - } - - //4 <1.3> Setup Channel, Band - prP2pBssInfo->ucPrimaryChannel = prBssDesc->ucChannelNum; - prP2pBssInfo->eBand = prBssDesc->eBand; - - - //3 <2> Update BSS_INFO_T from STA_RECORD_T - //4 <2.1> Save current AP's STA_RECORD_T and current AID - prP2pBssInfo->prStaRecOfAP = prStaRec; - prP2pBssInfo->u2AssocId = prStaRec->u2AssocId; - - //4 <2.2> Setup Capability - prP2pBssInfo->u2CapInfo = prStaRec->u2CapInfo; /* Use AP's Cap Info as BSS Cap Info */ - - if (prP2pBssInfo->u2CapInfo & CAP_INFO_SHORT_PREAMBLE) { - prP2pBssInfo->fgIsShortPreambleAllowed = TRUE; - } - else { - prP2pBssInfo->fgIsShortPreambleAllowed = FALSE; - } - - //4 <2.3> Setup PHY Attributes and Basic Rate Set/Operational Rate Set - prP2pBssInfo->ucPhyTypeSet = prStaRec->ucDesiredPhyTypeSet; - - prP2pBssInfo->ucNonHTBasicPhyType = prStaRec->ucNonHTBasicPhyType; - - prP2pBssInfo->u2OperationalRateSet = prStaRec->u2OperationalRateSet; - prP2pBssInfo->u2BSSBasicRateSet = prStaRec->u2BSSBasicRateSet; - - - //3 <3> Update BSS_INFO_T from SW_RFB_T (Association Resp Frame) - //4 <3.1> Setup BSSID - COPY_MAC_ADDR(prP2pBssInfo->aucBSSID, prAssocRspFrame->aucBSSID); - - - u2IELength = (UINT_16) ((prAssocRspSwRfb->u2PacketLen - prAssocRspSwRfb->u2HeaderLen) - - (OFFSET_OF(WLAN_ASSOC_RSP_FRAME_T, aucInfoElem[0]) - WLAN_MAC_MGMT_HEADER_LEN)); - pucIE = prAssocRspFrame->aucInfoElem; - - - //4 <3.2> Parse WMM and setup QBSS flag - /* Parse WMM related IEs and configure HW CRs accordingly */ - mqmProcessAssocRsp(prAdapter, prAssocRspSwRfb, pucIE, u2IELength); - - prP2pBssInfo->fgIsQBSS = prStaRec->fgIsQoS; - - //3 <4> Update BSS_INFO_T from BSS_DESC_T - ASSERT(prBssDesc); - - prBssDesc->fgIsConnecting = FALSE; - prBssDesc->fgIsConnected = TRUE; - - //4 <4.1> Setup MIB for current BSS - prP2pBssInfo->u2BeaconInterval = prBssDesc->u2BeaconInterval; - /* NOTE: Defer ucDTIMPeriod updating to when beacon is received after connection */ - prP2pBssInfo->ucDTIMPeriod = 0; - prP2pBssInfo->u2ATIMWindow = 0; - - prP2pBssInfo->ucBeaconTimeoutCount = AIS_BEACON_TIMEOUT_COUNT_INFRA; - - //4 <4.2> Update HT information and set channel - /* Record HT related parameters in rStaRec and rBssInfo - * Note: it shall be called before nicUpdateBss() - */ - rlmProcessAssocRsp(prAdapter, prAssocRspSwRfb, pucIE, u2IELength); - - //4 <4.3> Sync with firmware for BSS-INFO - nicUpdateBss(prAdapter, NETWORK_TYPE_P2P_INDEX); - - //4 <4.4> *DEFER OPERATION* nicPmIndicateBssConnected() will be invoked - //inside scanProcessBeaconAndProbeResp() after 1st beacon is received - - return; -} /* end of p2pUpdateBssInfoForJOIN() */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will validate the Rx Auth Frame and then return -* the status code to AAA to indicate if need to perform following actions -* when the specified conditions were matched. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prSwRfb Pointer to SW RFB data structure. -* @param[in] pprStaRec Pointer to pointer of STA_RECORD_T structure. -* @param[out] pu2StatusCode The Status Code of Validation Result -* -* @retval TRUE Reply the Auth -* @retval FALSE Don't reply the Auth -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -p2pFuncValidateAuth ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN PP_STA_RECORD_T pprStaRec, - OUT PUINT_16 pu2StatusCode - ) -{ - BOOLEAN fgReplyAuth = TRUE; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - P_WLAN_AUTH_FRAME_T prAuthFrame = (P_WLAN_AUTH_FRAME_T)NULL; - - DBGLOG(P2P, TRACE, ("p2pValidate Authentication Frame\n")) - - do { - ASSERT_BREAK((prAdapter != NULL) && - (prSwRfb != NULL) && - (pprStaRec != NULL) && - (pu2StatusCode != NULL)); - - /* P2P 3.2.8 */ - *pu2StatusCode = STATUS_CODE_REQ_DECLINED; - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - prAuthFrame = (P_WLAN_AUTH_FRAME_T)prSwRfb->pvHeader; - - - if (prP2pBssInfo->eCurrentOPMode != OP_MODE_ACCESS_POINT) { - /* We are not under AP Mode yet. */ - fgReplyAuth = FALSE; - DBGLOG(P2P, WARN, ("Current OP mode is not under AP mode. (%d)\n", prP2pBssInfo->eCurrentOPMode)); - break; - } - - prStaRec = cnmGetStaRecByAddress(prAdapter, - (UINT_8) NETWORK_TYPE_P2P_INDEX, - prAuthFrame->aucSrcAddr); - - if (!prStaRec) { - prStaRec = cnmStaRecAlloc(prAdapter, - (UINT_8) NETWORK_TYPE_P2P_INDEX); - - /* TODO(Kevin): Error handling of allocation of STA_RECORD_T for - * exhausted case and do removal of unused STA_RECORD_T. - */ - /* Sent a message event to clean un-used STA_RECORD_T. */ - ASSERT(prStaRec); - - COPY_MAC_ADDR(prStaRec->aucMacAddr, prAuthFrame->aucSrcAddr); - - prSwRfb->ucStaRecIdx = prStaRec->ucIndex; - - prStaRec->u2BSSBasicRateSet = prP2pBssInfo->u2BSSBasicRateSet; - - prStaRec->u2DesiredNonHTRateSet = RATE_SET_ERP_P2P; - - prStaRec->u2OperationalRateSet = RATE_SET_ERP_P2P; - prStaRec->ucPhyTypeSet = PHY_TYPE_SET_802_11GN; - prStaRec->eStaType = STA_TYPE_P2P_GC; - - /* NOTE(Kevin): Better to change state here, not at TX Done */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - } - else { - prSwRfb->ucStaRecIdx = prStaRec->ucIndex; - - if ((prStaRec->ucStaState > STA_STATE_1) && (IS_STA_IN_P2P(prStaRec))) { - - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - - p2pFuncResetStaRecStatus(prAdapter, prStaRec); - - bssRemoveStaRecFromClientList(prAdapter, prP2pBssInfo, prStaRec); - } - - } - - if (prP2pBssInfo->rStaRecOfClientList.u4NumElem >= P2P_MAXIMUM_CLIENT_COUNT || - kalP2PMaxClients(prAdapter->prGlueInfo, prP2pBssInfo->rStaRecOfClientList.u4NumElem)) { - /* GROUP limit full. */ - /* P2P 3.2.8 */ - DBGLOG(P2P, WARN, ("Group Limit Full. (%d)\n", (INT_16)prP2pBssInfo->rStaRecOfClientList.u4NumElem)); - cnmStaRecFree(prAdapter, prStaRec, FALSE); - break; - } - else { - /* Hotspot Blacklist */ - if(prAuthFrame->aucSrcAddr) { - if(kalP2PCmpBlackList(prAdapter->prGlueInfo, prAuthFrame->aucSrcAddr)) { - fgReplyAuth = FALSE; - return fgReplyAuth; - } - } - } - - //prStaRec->eStaType = STA_TYPE_INFRA_CLIENT; - prStaRec->eStaType = STA_TYPE_P2P_GC; - - prStaRec->ucNetTypeIndex = NETWORK_TYPE_P2P_INDEX; - - /* Update Station Record - Status/Reason Code */ - prStaRec->u2StatusCode = STATUS_CODE_SUCCESSFUL; - - prStaRec->ucJoinFailureCount = 0; - - *pprStaRec = prStaRec; - - *pu2StatusCode = STATUS_CODE_SUCCESSFUL; - - } while (FALSE); - - - return fgReplyAuth; - -} /* p2pFuncValidateAuth */ - - - - -VOID -p2pFuncResetStaRecStatus ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ) -{ - do { - if ((prAdapter == NULL) || (prStaRec == NULL)) { - ASSERT(FALSE); - break; - } - - - prStaRec->u2StatusCode = STATUS_CODE_SUCCESSFUL; - prStaRec->u2ReasonCode = REASON_CODE_RESERVED; - prStaRec->ucJoinFailureCount = 0; - prStaRec->fgTransmitKeyExist = FALSE; - - prStaRec->fgSetPwrMgtBit = FALSE; - - } while (FALSE); - - return; -} /* p2pFuncResetStaRecStatus */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief The function is used to initialize the value of the connection settings for -* P2P network -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFuncInitConnectionSettings ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_CONNECTION_SETTINGS_T prP2PConnSettings - ) -{ - P_DEVICE_TYPE_T prDevType; - UINT_8 aucDefaultDevName[] = P2P_DEFAULT_DEV_NAME; - UINT_8 aucWfaOui[] = VENDOR_OUI_WFA; - - ASSERT(prP2PConnSettings); - - /* Setup Default Device Name */ - prP2PConnSettings->ucDevNameLen = P2P_DEFAULT_DEV_NAME_LEN; - kalMemCopy(prP2PConnSettings->aucDevName, aucDefaultDevName, sizeof(aucDefaultDevName)); - - /* Setup Primary Device Type (Big-Endian) */ - prDevType = &prP2PConnSettings->rPrimaryDevTypeBE; - - prDevType->u2CategoryId = HTONS(P2P_DEFAULT_PRIMARY_CATEGORY_ID); - prDevType->u2SubCategoryId = HTONS(P2P_DEFAULT_PRIMARY_SUB_CATEGORY_ID); - - prDevType->aucOui[0] = aucWfaOui[0]; - prDevType->aucOui[1] = aucWfaOui[1]; - prDevType->aucOui[2] = aucWfaOui[2]; - prDevType->aucOui[3] = VENDOR_OUI_TYPE_WPS; - - /* Setup Secondary Device Type */ - prP2PConnSettings->ucSecondaryDevTypeCount = 0; - - /* Setup Default Config Method */ - prP2PConnSettings->eConfigMethodSelType = ENUM_CONFIG_METHOD_SEL_AUTO; - prP2PConnSettings->u2ConfigMethodsSupport = P2P_DEFAULT_CONFIG_METHOD; - prP2PConnSettings->u2TargetConfigMethod = 0; - prP2PConnSettings->u2LocalConfigMethod = 0; - prP2PConnSettings->fgIsPasswordIDRdy = FALSE; - - /* For Device Capability */ - prP2PConnSettings->fgSupportServiceDiscovery = FALSE; - prP2PConnSettings->fgSupportClientDiscoverability = TRUE; - prP2PConnSettings->fgSupportConcurrentOperation = TRUE; - prP2PConnSettings->fgSupportInfraManaged = FALSE; - prP2PConnSettings->fgSupportInvitationProcedure = FALSE; - - /* For Group Capability */ -#if CFG_SUPPORT_PERSISTENT_GROUP - prP2PConnSettings->fgSupportPersistentP2PGroup = TRUE; -#else - prP2PConnSettings->fgSupportPersistentP2PGroup = FALSE; -#endif - prP2PConnSettings->fgSupportIntraBSSDistribution = TRUE; - prP2PConnSettings->fgSupportCrossConnection = TRUE; - prP2PConnSettings->fgSupportPersistentReconnect = FALSE; - - prP2PConnSettings->fgSupportOppPS = FALSE; - prP2PConnSettings->u2CTWindow = P2P_CTWINDOW_DEFAULT; - - /* For Connection Settings. */ - prP2PConnSettings->eAuthMode = AUTH_MODE_OPEN; - - prP2PConnSettings->prTargetP2pDesc = NULL; - prP2PConnSettings->ucSSIDLen = 0; - - /* Misc */ - prP2PConnSettings->fgIsScanReqIssued = FALSE; - prP2PConnSettings->fgIsServiceDiscoverIssued = FALSE; - prP2PConnSettings->fgP2pGroupLimit = FALSE; - prP2PConnSettings->ucOperatingChnl = 0; - prP2PConnSettings->ucListenChnl = 0; - prP2PConnSettings->ucTieBreaker = (UINT_8)(kalRandomNumber() & 0x1); - - prP2PConnSettings->eFormationPolicy = ENUM_P2P_FORMATION_POLICY_AUTO; - - return; -} /* p2pFuncInitConnectionSettings */ - - - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will validate the Rx Assoc Req Frame and then return -* the status code to AAA to indicate if need to perform following actions -* when the specified conditions were matched. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prSwRfb Pointer to SW RFB data structure. -* @param[out] pu2StatusCode The Status Code of Validation Result -* -* @retval TRUE Reply the Assoc Resp -* @retval FALSE Don't reply the Assoc Resp -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -p2pFuncValidateAssocReq ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_16 pu2StatusCode - ) -{ - BOOLEAN fgReplyAssocResp = TRUE; - P_WLAN_ASSOC_REQ_FRAME_T prAssocReqFrame = (P_WLAN_ASSOC_REQ_FRAME_T)NULL; - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - - /* TODO(Kevin): Call P2P functions to check .. - 2. Check we can accept connection from thsi peer - a. If we are in PROVISION state, only accept the peer we do the GO formation previously. - b. If we are in OPERATION state, only accept the other peer when P2P_GROUP_LIMIT is 0. - 3. Check Black List here. - */ - - do { - ASSERT_BREAK((prAdapter != NULL) && - (prSwRfb != NULL) && - (pu2StatusCode != NULL)); - - *pu2StatusCode = STATUS_CODE_REQ_DECLINED; - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - prAssocReqFrame = (P_WLAN_ASSOC_REQ_FRAME_T)prSwRfb->pvHeader; - - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - - if (prStaRec == NULL) { - /* Station record should be ready while RX AUTH frame. */ - fgReplyAssocResp = FALSE; - ASSERT(FALSE); - break; - } - else { - prStaRec->ucRCPI = prSwRfb->prHifRxHdr->ucRcpi; - } - - prStaRec->u2DesiredNonHTRateSet &= prP2pBssInfo->u2OperationalRateSet; - prStaRec->ucDesiredPhyTypeSet = prStaRec->ucPhyTypeSet & prP2pBssInfo->ucPhyTypeSet; - - if (prStaRec->ucDesiredPhyTypeSet == 0) { - /* The station only support 11B rate. */ - *pu2StatusCode = STATUS_CODE_ASSOC_DENIED_RATE_NOT_SUPPORTED; - break; - } - - *pu2StatusCode = STATUS_CODE_SUCCESSFUL; - - } while (FALSE); - - return fgReplyAssocResp; - -} /* p2pFuncValidateAssocReq */ - - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to check the P2P IE -* -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -p2pFuncParseCheckForP2PInfoElem ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBuf, - OUT PUINT_8 pucOuiType - ) -{ - UINT_8 aucWfaOui[] = VENDOR_OUI_WFA_SPECIFIC; - P_IE_WFA_T prWfaIE = (P_IE_WFA_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (pucBuf != NULL) && (pucOuiType != NULL)); - - prWfaIE = (P_IE_WFA_T)pucBuf; - - if (IE_LEN(pucBuf) <= ELEM_MIN_LEN_WFA_OUI_TYPE_SUBTYPE) { - break; - } - else if (prWfaIE->aucOui[0] != aucWfaOui[0] || - prWfaIE->aucOui[1] != aucWfaOui[1] || - prWfaIE->aucOui[2] != aucWfaOui[2]) { - break; - } - - *pucOuiType = prWfaIE->ucOuiType; - - return TRUE; - } while (FALSE); - - return FALSE; -} /* p2pFuncParseCheckForP2PInfoElem */ - - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will validate the Rx Probe Request Frame and then return -* result to BSS to indicate if need to send the corresponding Probe Response -* Frame if the specified conditions were matched. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prSwRfb Pointer to SW RFB data structure. -* @param[out] pu4ControlFlags Control flags for replying the Probe Response -* -* @retval TRUE Reply the Probe Response -* @retval FALSE Don't reply the Probe Response -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -p2pFuncValidateProbeReq ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT PUINT_32 pu4ControlFlags - ) -{ - BOOLEAN fgIsReplyProbeRsp = FALSE; - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - - DEBUGFUNC("p2pFuncValidateProbeReq"); - - do { - - ASSERT_BREAK((prAdapter != NULL) && (prSwRfb != NULL)); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo->u4P2pPacketFilter & PARAM_PACKET_FILTER_PROBE_REQ) { - /* Leave the probe response to p2p_supplicant. */ - kalP2PIndicateRxMgmtFrame(prAdapter->prGlueInfo, prSwRfb); - } - - } while (FALSE); - - return fgIsReplyProbeRsp; - -} /* end of p2pFuncValidateProbeReq() */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will validate the Rx Probe Request Frame and then return -* result to BSS to indicate if need to send the corresponding Probe Response -* Frame if the specified conditions were matched. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prSwRfb Pointer to SW RFB data structure. -* @param[out] pu4ControlFlags Control flags for replying the Probe Response -* -* @retval TRUE Reply the Probe Response -* @retval FALSE Don't reply the Probe Response -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFuncValidateRxActionFrame ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - - DEBUGFUNC("p2pFuncValidateProbeReq"); - - do { - - ASSERT_BREAK((prAdapter != NULL) && (prSwRfb != NULL)); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - if (prP2pFsmInfo->u4P2pPacketFilter & PARAM_PACKET_FILTER_ACTION_FRAME) { - /* Leave the probe response to p2p_supplicant. */ - kalP2PIndicateRxMgmtFrame(prAdapter->prGlueInfo, prSwRfb); - } - - } while (FALSE); - - return; - -} /* p2pFuncValidateRxMgmtFrame */ - - - - -BOOLEAN -p2pFuncIsAPMode ( - IN P_P2P_FSM_INFO_T prP2pFsmInfo - ) -{ - if (prP2pFsmInfo) { - return prP2pFsmInfo->fgIsApMode; - } - else { - return FALSE; - } -} -/* p2pFuncIsAPMode */ - - - -VOID -p2pFuncParseBeaconContent ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prP2pBssInfo, - IN PUINT_8 pucIEInfo, - IN UINT_32 u4IELen - ) -{ - PUINT_8 pucIE = (PUINT_8)NULL; - UINT_16 u2Offset = 0; - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; - BOOL ucNewSecMode = FALSE; - BOOL ucOldSecMode = FALSE; - - do { - ASSERT_BREAK((prAdapter != NULL) && - (prP2pBssInfo != NULL)); - - if (u4IELen == 0) { - break; - } - - prP2pSpecificBssInfo = prAdapter->rWifiVar.prP2pSpecificBssInfo; - prP2pSpecificBssInfo->u2AttributeLen = 0; - - ASSERT_BREAK(pucIEInfo != NULL); - - pucIE = pucIEInfo; - - ucOldSecMode = kalP2PGetCipher(prAdapter->prGlueInfo); - - IE_FOR_EACH(pucIE, u4IELen, u2Offset) { - switch (IE_ID(pucIE)) { - case ELEM_ID_SSID: /* 0 */ /* V */ /* Done */ - { - DBGLOG(P2P, TRACE, ("SSID update\n")); - - /* Update when starting GO. */ - COPY_SSID(prP2pBssInfo->aucSSID, - prP2pBssInfo->ucSSIDLen, - SSID_IE(pucIE)->aucSSID, - SSID_IE(pucIE)->ucLength); - - COPY_SSID(prP2pSpecificBssInfo->aucGroupSsid, - prP2pSpecificBssInfo->u2GroupSsidLen, - SSID_IE(pucIE)->aucSSID, - SSID_IE(pucIE)->ucLength); - - } - break; - case ELEM_ID_SUP_RATES: /* 1 */ /* V */ /* Done */ - { - DBGLOG(P2P, TRACE, ("Support Rate IE\n")); - kalMemCopy(prP2pBssInfo->aucAllSupportedRates, - SUP_RATES_IE(pucIE)->aucSupportedRates, - SUP_RATES_IE(pucIE)->ucLength); - - prP2pBssInfo->ucAllSupportedRatesLen = SUP_RATES_IE(pucIE)->ucLength; - - DBGLOG_MEM8(P2P, TRACE, SUP_RATES_IE(pucIE)->aucSupportedRates, SUP_RATES_IE(pucIE)->ucLength); - } - break; - case ELEM_ID_DS_PARAM_SET: /* 3 */ /* V */ /* Done */ - { - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - - DBGLOG(P2P, TRACE, ("DS PARAM IE\n")); - - ASSERT(prP2pConnSettings->ucOperatingChnl == DS_PARAM_IE(pucIE)->ucCurrChnl); - - if (prP2pConnSettings->eBand != BAND_2G4) { - ASSERT(FALSE); - break; - } - - //prP2pBssInfo->ucPrimaryChannel = DS_PARAM_IE(pucIE)->ucCurrChnl; - - //prP2pBssInfo->eBand = BAND_2G4; - } - break; - case ELEM_ID_TIM: /* 5 */ /* V */ - DBGLOG(P2P, TRACE, ("TIM IE\n")); - TIM_IE(pucIE)->ucDTIMPeriod = prP2pBssInfo->ucDTIMPeriod; - break; - case ELEM_ID_ERP_INFO: /* 42 */ /* V */ - { -#if 1 - /* This IE would dynamic change due to FW detection change is required. */ - DBGLOG(P2P, TRACE, ("ERP IE will be over write by driver\n")); - DBGLOG(P2P, TRACE, (" ucERP: %x. \n", ERP_INFO_IE(pucIE)->ucERP)); - -#else - /* This IE would dynamic change due to FW detection change is required. */ - DBGLOG(P2P, TRACE, ("ERP IE.\n")); - - prP2pBssInfo->ucPhyTypeSet |= PHY_TYPE_SET_802_11GN; - - ASSERT(prP2pBssInfo->eBand == BAND_2G4); - - prP2pBssInfo->fgObssErpProtectMode = ((ERP_INFO_IE(pucIE)->ucERP & ERP_INFO_USE_PROTECTION)? TRUE : FALSE); - - prP2pBssInfo->fgErpProtectMode = ((ERP_INFO_IE(pucIE)->ucERP & (ERP_INFO_USE_PROTECTION | ERP_INFO_NON_ERP_PRESENT))? TRUE : FALSE); -#endif - - } - break; - case ELEM_ID_HT_CAP: /* 45 */ /* V */ - { -#if 1 - DBGLOG(P2P, TRACE, ("HT CAP IE would be overwritten by driver\n")); - - DBGLOG(P2P, TRACE, ("HT Cap Info:%x, AMPDU Param:%x\n", HT_CAP_IE(pucIE)->u2HtCapInfo, HT_CAP_IE(pucIE)->ucAmpduParam)); - - DBGLOG(P2P, TRACE, ("HT Extended Cap Info:%x, TX Beamforming Cap Info:%lx, Ant Selection Cap Info%x \n", - HT_CAP_IE(pucIE)->u2HtExtendedCap, - HT_CAP_IE(pucIE)->u4TxBeamformingCap, - HT_CAP_IE(pucIE)->ucAselCap)); -#else - prP2pBssInfo->ucPhyTypeSet |= PHY_TYPE_SET_802_11N; - - /* u2HtCapInfo */ - if ((HT_CAP_IE(pucIE)->u2HtCapInfo & - (HT_CAP_INFO_SUP_CHNL_WIDTH | HT_CAP_INFO_SHORT_GI_40M | HT_CAP_INFO_DSSS_CCK_IN_40M)) == 0) { - prP2pBssInfo->fgAssoc40mBwAllowed = FALSE; - } - else { - prP2pBssInfo->fgAssoc40mBwAllowed = TRUE; - } - - if ((HT_CAP_IE(pucIE)->u2HtCapInfo & - (HT_CAP_INFO_SHORT_GI_20M | HT_CAP_INFO_SHORT_GI_40M)) == 0) { - prAdapter->rWifiVar.rConnSettings.fgRxShortGIDisabled = TRUE; - } - else { - prAdapter->rWifiVar.rConnSettings.fgRxShortGIDisabled = FALSE; - } - - /* ucAmpduParam */ - DBGLOG(P2P, TRACE, ("AMPDU setting from supplicant:0x%x, & default value:0x%x\n", (UINT_8)HT_CAP_IE(pucIE)->ucAmpduParam, (UINT_8)AMPDU_PARAM_DEFAULT_VAL)); - - /* rSupMcsSet */ - /* Can do nothing. the field is default value from other configuration. */ - //HT_CAP_IE(pucIE)->rSupMcsSet; - - /* u2HtExtendedCap */ - ASSERT(HT_CAP_IE(pucIE)->u2HtExtendedCap == (HT_EXT_CAP_DEFAULT_VAL & ~(HT_EXT_CAP_PCO | HT_EXT_CAP_PCO_TRANS_TIME_NONE))); - - /* u4TxBeamformingCap */ - ASSERT(HT_CAP_IE(pucIE)->u4TxBeamformingCap == TX_BEAMFORMING_CAP_DEFAULT_VAL); - - /* ucAselCap */ - ASSERT(HT_CAP_IE(pucIE)->ucAselCap == ASEL_CAP_DEFAULT_VAL); -#endif - } - break; - case ELEM_ID_RSN: /* 48 */ /* V */ - { - RSN_INFO_T rRsnIe; - - DBGLOG(P2P, TRACE, ("RSN IE\n")); - kalP2PSetCipher(prAdapter->prGlueInfo, IW_AUTH_CIPHER_CCMP); - ucNewSecMode = TRUE; - - if (rsnParseRsnIE(prAdapter, RSN_IE(pucIE), &rRsnIe)) { - prP2pBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]; - prP2pBssInfo->u4RsnSelectedGroupCipher = RSN_CIPHER_SUITE_CCMP; - prP2pBssInfo->u4RsnSelectedPairwiseCipher = RSN_CIPHER_SUITE_CCMP; - prP2pBssInfo->u4RsnSelectedAKMSuite = RSN_AKM_SUITE_PSK; - prP2pBssInfo->u2RsnSelectedCapInfo = rRsnIe.u2RsnCap; - } - } - break; - case ELEM_ID_EXTENDED_SUP_RATES: /* 50 */ /* V */ - /* Be attention, ELEM_ID_SUP_RATES should be placed before ELEM_ID_EXTENDED_SUP_RATES. */ - DBGLOG(P2P, TRACE, ("Ex Support Rate IE\n")); - kalMemCopy(&(prP2pBssInfo->aucAllSupportedRates[prP2pBssInfo->ucAllSupportedRatesLen]), - EXT_SUP_RATES_IE(pucIE)->aucExtSupportedRates, - EXT_SUP_RATES_IE(pucIE)->ucLength); - - DBGLOG_MEM8(P2P, TRACE, EXT_SUP_RATES_IE(pucIE)->aucExtSupportedRates, EXT_SUP_RATES_IE(pucIE)->ucLength); - - prP2pBssInfo->ucAllSupportedRatesLen += EXT_SUP_RATES_IE(pucIE)->ucLength; - break; - case ELEM_ID_HT_OP: /* 61 */ /* V */ // TODO: - { -#if 1 - DBGLOG(P2P, TRACE, ("HT OP IE would be overwritten by driver\n")); - - DBGLOG(P2P, TRACE, (" Primary Channel: %x, Info1: %x, Info2: %x, Info3: %x\n", - HT_OP_IE(pucIE)->ucPrimaryChannel, - HT_OP_IE(pucIE)->ucInfo1, - HT_OP_IE(pucIE)->u2Info2, - HT_OP_IE(pucIE)->u2Info3)); -#else - UINT_16 u2Info2 = 0; - prP2pBssInfo->ucPhyTypeSet |= PHY_TYPE_SET_802_11N; - - DBGLOG(P2P, TRACE, ("HT OP IE\n")); - - /* ucPrimaryChannel. */ - ASSERT(HT_OP_IE(pucIE)->ucPrimaryChannel == prP2pBssInfo->ucPrimaryChannel); - - /* ucInfo1 */ - prP2pBssInfo->ucHtOpInfo1 = HT_OP_IE(pucIE)->ucInfo1; - - /* u2Info2 */ - u2Info2 = HT_OP_IE(pucIE)->u2Info2; - - if (u2Info2 & HT_OP_INFO2_NON_GF_HT_STA_PRESENT) { - ASSERT(prP2pBssInfo->eGfOperationMode != GF_MODE_NORMAL); - u2Info2 &= ~HT_OP_INFO2_NON_GF_HT_STA_PRESENT; - } - - if (u2Info2 & HT_OP_INFO2_OBSS_NON_HT_STA_PRESENT) { - prP2pBssInfo->eObssHtProtectMode = HT_PROTECT_MODE_NON_MEMBER; - u2Info2 &= ~HT_OP_INFO2_OBSS_NON_HT_STA_PRESENT; - } - - switch (u2Info2 & HT_OP_INFO2_HT_PROTECTION) { - case HT_PROTECT_MODE_NON_HT: - prP2pBssInfo->eHtProtectMode = HT_PROTECT_MODE_NON_HT; - break; - case HT_PROTECT_MODE_NON_MEMBER: - prP2pBssInfo->eHtProtectMode = HT_PROTECT_MODE_NONE; - prP2pBssInfo->eObssHtProtectMode = HT_PROTECT_MODE_NON_MEMBER; - break; - default: - prP2pBssInfo->eHtProtectMode = HT_OP_IE(pucIE)->u2Info2; - break; - } - - /* u2Info3 */ - prP2pBssInfo->u2HtOpInfo3 = HT_OP_IE(pucIE)->u2Info3; - - /* aucBasicMcsSet */ - DBGLOG_MEM8(P2P, TRACE, HT_OP_IE(pucIE)->aucBasicMcsSet, 16); -#endif - } - break; - case ELEM_ID_OBSS_SCAN_PARAMS: /* 74 */ /* V */ - { - DBGLOG(P2P, TRACE, ("ELEM_ID_OBSS_SCAN_PARAMS IE would be replaced by driver\n")); - } - break; - case ELEM_ID_EXTENDED_CAP: /* 127 */ /* V */ - { - DBGLOG(P2P, TRACE, ("ELEM_ID_EXTENDED_CAP IE would be replaced by driver\n")); - } - break; - case ELEM_ID_VENDOR: /* 221 */ /* V */ - DBGLOG(P2P, TRACE, ("Vender Specific IE\n")); - { - UINT_8 ucOuiType; - UINT_16 u2SubTypeVersion; - if (rsnParseCheckForWFAInfoElem(prAdapter, pucIE, &ucOuiType, &u2SubTypeVersion)) { - if ((ucOuiType == VENDOR_OUI_TYPE_WPA) && - (u2SubTypeVersion == VERSION_WPA)) { - kalP2PSetCipher(prAdapter->prGlueInfo, IW_AUTH_CIPHER_TKIP); - ucNewSecMode = TRUE; - } - else if ((ucOuiType == VENDOR_OUI_TYPE_WPS)) { - kalP2PUpdateWSC_IE(prAdapter->prGlueInfo, 0, pucIE, IE_SIZE(pucIE)); - } - - // WMM here. - } - else if (p2pFuncParseCheckForP2PInfoElem(prAdapter, pucIE, &ucOuiType)) { - // TODO Store the whole P2P IE & generate later. - // Be aware that there may be one or more P2P IE. - if (ucOuiType == VENDOR_OUI_TYPE_P2P) { - kalMemCopy(&prP2pSpecificBssInfo->aucAttributesCache[prP2pSpecificBssInfo->u2AttributeLen], - pucIE, - IE_SIZE(pucIE)); - - prP2pSpecificBssInfo->u2AttributeLen += IE_SIZE(pucIE); - } - } - else { - - kalMemCopy(&prP2pSpecificBssInfo->aucAttributesCache[prP2pSpecificBssInfo->u2AttributeLen], - pucIE, - IE_SIZE(pucIE)); - - prP2pSpecificBssInfo->u2AttributeLen += IE_SIZE(pucIE); - DBGLOG(P2P, TRACE, ("Driver unprocessed Vender Specific IE\n")); - ASSERT(FALSE); - } - - // TODO: Store other Vender IE except for WMM Param. - } - break; - default: - DBGLOG(P2P, TRACE, ("Unprocessed element ID:%d \n", IE_ID(pucIE))); - break; - } - } - - if (!ucNewSecMode && ucOldSecMode) - kalP2PSetCipher(prAdapter->prGlueInfo, IW_AUTH_CIPHER_NONE); - - } while (FALSE); - - return; -} /* p2pFuncParseBeaconContent */ - - - - -P_BSS_DESC_T -p2pFuncKeepOnConnection ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_CONNECTION_REQ_INFO_T prConnReqInfo, - IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo, - IN P_P2P_SCAN_REQ_INFO_T prScanReqInfo - ) -{ - P_BSS_DESC_T prTargetBss = (P_BSS_DESC_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && - (prConnReqInfo != NULL) && - (prChnlReqInfo != NULL) && - (prScanReqInfo != NULL)); - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - if (prP2pBssInfo->eCurrentOPMode != OP_MODE_INFRASTRUCTURE) { - break; - } - - // Update connection request information. - ASSERT(prConnReqInfo->fgIsConnRequest == TRUE); - - /* Find BSS Descriptor first. */ - prTargetBss = scanP2pSearchDesc(prAdapter, - prP2pBssInfo, - prConnReqInfo); - - if (prTargetBss == NULL) { - /* Update scan parameter... to scan target device. */ - prScanReqInfo->ucNumChannelList = 1; - prScanReqInfo->eScanType = SCAN_TYPE_ACTIVE_SCAN; - prScanReqInfo->eChannelSet = SCAN_CHANNEL_FULL; - prScanReqInfo->u4BufLength = 0; /* Prevent other P2P ID in IE. */ - prScanReqInfo->fgIsAbort = TRUE; - } - else { - prChnlReqInfo->u8Cookie = 0; - prChnlReqInfo->ucReqChnlNum = prTargetBss->ucChannelNum; - prChnlReqInfo->eBand = prTargetBss->eBand; - prChnlReqInfo->eChnlSco = prTargetBss->eSco; - prChnlReqInfo->u4MaxInterval = AIS_JOIN_CH_REQUEST_INTERVAL; - prChnlReqInfo->eChannelReqType = CHANNEL_REQ_TYPE_GC_JOIN_REQ; - } - - } while (FALSE); - - return prTargetBss; -} /* p2pFuncKeepOnConnection */ - -/* Currently Only for ASSOC Response Frame. */ -VOID -p2pFuncStoreAssocRspIEBuffer ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_P2P_JOIN_INFO_T prJoinInfo = (P_P2P_JOIN_INFO_T)NULL; - P_WLAN_ASSOC_RSP_FRAME_T prAssocRspFrame = (P_WLAN_ASSOC_RSP_FRAME_T)NULL; - INT_16 i2IELen = 0; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prSwRfb != NULL)); - - prAssocRspFrame = (P_WLAN_ASSOC_RSP_FRAME_T)prSwRfb->pvHeader; - - if (prAssocRspFrame->u2FrameCtrl != MAC_FRAME_ASSOC_RSP) { - break; - } - - i2IELen = prSwRfb->u2PacketLen - (WLAN_MAC_HEADER_LEN + - CAP_INFO_FIELD_LEN + - STATUS_CODE_FIELD_LEN + - AID_FIELD_LEN); - - - if (i2IELen <= 0) { - break; - } - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - prJoinInfo = &(prP2pFsmInfo->rJoinInfo); - prJoinInfo->u4BufLength = (UINT_32)i2IELen; - - kalMemCopy(prJoinInfo->aucIEBuf, prAssocRspFrame->aucInfoElem, prJoinInfo->u4BufLength); - - } while (FALSE); - - - return; -} /* p2pFuncStoreAssocRspIEBuffer */ - - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set Packet Filter. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] pvSetBuffer Pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_NOT_SUPPORTED -* \retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFuncMgmtFrameRegister ( - IN P_ADAPTER_T prAdapter, - IN UINT_16 u2FrameType, - IN BOOLEAN fgIsRegistered, - OUT PUINT_32 pu4P2pPacketFilter - ) -{ - UINT_32 u4NewPacketFilter = 0; - - DEBUGFUNC("p2pFuncMgmtFrameRegister"); - - do { - ASSERT_BREAK(prAdapter != NULL); - - if (pu4P2pPacketFilter) { - u4NewPacketFilter = *pu4P2pPacketFilter; - } - - switch (u2FrameType) { - case MAC_FRAME_PROBE_REQ: - if (fgIsRegistered) { - u4NewPacketFilter |= PARAM_PACKET_FILTER_PROBE_REQ; - DBGLOG(P2P, TRACE, ("Open packet filer probe request\n")); - } - else { - u4NewPacketFilter &= ~PARAM_PACKET_FILTER_PROBE_REQ; - DBGLOG(P2P, TRACE, ("Close packet filer probe request\n")); - } - break; - case MAC_FRAME_ACTION: - if (fgIsRegistered) { - u4NewPacketFilter |= PARAM_PACKET_FILTER_ACTION_FRAME; - DBGLOG(P2P, TRACE, ("Open packet filer action frame.\n")); - } - else { - u4NewPacketFilter &= ~PARAM_PACKET_FILTER_ACTION_FRAME; - DBGLOG(P2P, TRACE, ("Close packet filer action frame.\n")); - } - break; - default: - DBGLOG(P2P, TRACE, ("Ask frog to add code for mgmt:%x\n", u2FrameType)); - break; - } - - if (pu4P2pPacketFilter) { - *pu4P2pPacketFilter = u4NewPacketFilter; - } - -// u4NewPacketFilter |= prAdapter->u4OsPacketFilter; - - prAdapter->u4OsPacketFilter &= ~PARAM_PACKET_FILTER_P2P_MASK; - prAdapter->u4OsPacketFilter |= u4NewPacketFilter; - - DBGLOG(P2P, TRACE, ("P2P Set PACKET filter:0x%lx\n", prAdapter->u4OsPacketFilter)); - - wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_RX_FILTER, - TRUE, - FALSE, - FALSE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(UINT_32), - (PUINT_8)&prAdapter->u4OsPacketFilter, - &u4NewPacketFilter, - sizeof(u4NewPacketFilter) - ); - - } while (FALSE); - - return; -} /* p2pFuncMgmtFrameRegister */ - - -VOID -p2pFuncUpdateMgmtFrameRegister ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4OsFilter - ) -{ - - do { - - prAdapter->rWifiVar.prP2pFsmInfo->u4P2pPacketFilter = u4OsFilter; - - if ((prAdapter->u4OsPacketFilter & PARAM_PACKET_FILTER_P2P_MASK) ^ u4OsFilter) { - - prAdapter->u4OsPacketFilter &= ~PARAM_PACKET_FILTER_P2P_MASK; - - prAdapter->u4OsPacketFilter |= (u4OsFilter & PARAM_PACKET_FILTER_P2P_MASK); - - wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_RX_FILTER, - TRUE, - FALSE, - FALSE, - nicCmdEventSetCommon, - nicOidCmdTimeoutCommon, - sizeof(UINT_32), - (PUINT_8)&prAdapter->u4OsPacketFilter, - &u4OsFilter, - sizeof(u4OsFilter) - ); - DBGLOG(P2P, TRACE, ("P2P Set PACKET filter:0x%lx\n", prAdapter->u4OsPacketFilter)); - } - - } while (FALSE); - - - - - return; -} /* p2pFuncUpdateMgmtFrameRegister */ - - -VOID -p2pFuncGetStationInfo ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucMacAddr, - OUT P_P2P_STATION_INFO_T prStaInfo - ) -{ - - do { - ASSERT_BREAK((prAdapter != NULL) && - (pucMacAddr != NULL) && - (prStaInfo != NULL)); - - prStaInfo->u4InactiveTime = 0; - prStaInfo->u4RxBytes = 0; - prStaInfo->u4TxBytes = 0; - prStaInfo->u4RxPackets = 0; - prStaInfo->u4TxPackets = 0; - // TODO: - - } while (FALSE); - - return; -} /* p2pFuncGetStationInfo */ - -P_MSDU_INFO_T -p2pFuncProcessP2pProbeRsp ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMgmtTxMsdu - ) -{ - P_MSDU_INFO_T prRetMsduInfo = prMgmtTxMsdu; - P_WLAN_PROBE_RSP_FRAME_T prProbeRspFrame = (P_WLAN_PROBE_RSP_FRAME_T)NULL; - PUINT_8 pucIEBuf = (PUINT_8)NULL; - UINT_16 u2Offset = 0, u2IELength = 0, u2ProbeRspHdrLen = 0; - BOOLEAN fgIsP2PIE = FALSE, fgIsWSCIE = FALSE; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - UINT_16 u2EstimateSize = 0, u2EstimatedExtraIELen = 0; - UINT_32 u4IeArraySize = 0, u4Idx = 0; - - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMgmtTxMsdu != NULL)); - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - //3 Make sure this is probe response frame. - prProbeRspFrame = (P_WLAN_PROBE_RSP_FRAME_T)((UINT_32)prMgmtTxMsdu->prPacket + MAC_TX_RESERVED_FIELD); - ASSERT_BREAK((prProbeRspFrame->u2FrameCtrl & MASK_FRAME_TYPE) == MAC_FRAME_PROBE_RSP); - - //3 Get the importent P2P IE. - u2ProbeRspHdrLen = (WLAN_MAC_MGMT_HEADER_LEN + TIMESTAMP_FIELD_LEN + BEACON_INTERVAL_FIELD_LEN + CAP_INFO_FIELD_LEN); - pucIEBuf = prProbeRspFrame->aucInfoElem; - u2IELength = prMgmtTxMsdu->u2FrameLength - u2ProbeRspHdrLen; - IE_FOR_EACH(pucIEBuf, u2IELength, u2Offset) { - switch (IE_ID(pucIEBuf)) { - case ELEM_ID_SSID: - { - - COPY_SSID(prP2pBssInfo->aucSSID, - prP2pBssInfo->ucSSIDLen, - SSID_IE(pucIEBuf)->aucSSID, - SSID_IE(pucIEBuf)->ucLength); - } - break; - case ELEM_ID_VENDOR: - { - UINT_8 ucOuiType = 0; - UINT_16 u2SubTypeVersion = 0; - if (rsnParseCheckForWFAInfoElem(prAdapter, pucIEBuf, &ucOuiType, &u2SubTypeVersion)) { - if (ucOuiType == VENDOR_OUI_TYPE_WPS) { - kalP2PUpdateWSC_IE(prAdapter->prGlueInfo, 2, pucIEBuf, IE_SIZE(pucIEBuf)); - fgIsWSCIE = TRUE; - } - - } - - else if (p2pFuncParseCheckForP2PInfoElem(prAdapter, pucIEBuf, &ucOuiType)) { - if (ucOuiType == VENDOR_OUI_TYPE_P2P) { - //2 Note(frog): I use WSC IE buffer for Probe Request to store the P2P IE for Probe Response. - kalP2PUpdateWSC_IE(prAdapter->prGlueInfo, 1, pucIEBuf, IE_SIZE(pucIEBuf)); - fgIsP2PIE = TRUE; - } - - } - - } - break; - default: - break; - } - - } - - - //3 Check the total size & current frame. - u2EstimateSize = WLAN_MAC_MGMT_HEADER_LEN + \ - TIMESTAMP_FIELD_LEN + \ - BEACON_INTERVAL_FIELD_LEN + \ - CAP_INFO_FIELD_LEN + \ - (ELEM_HDR_LEN + ELEM_MAX_LEN_SSID) + \ - (ELEM_HDR_LEN + ELEM_MAX_LEN_SUP_RATES) + \ - (ELEM_HDR_LEN + ELEM_MAX_LEN_DS_PARAMETER_SET); - - u2EstimatedExtraIELen = 0; - - u4IeArraySize = sizeof(txProbeRspIETable)/sizeof(APPEND_VAR_IE_ENTRY_T); - for (u4Idx = 0; u4Idx < u4IeArraySize; u4Idx++) { - if (txProbeRspIETable[u4Idx].u2EstimatedFixedIELen) { - u2EstimatedExtraIELen += txProbeRspIETable[u4Idx].u2EstimatedFixedIELen; - } - - else { - ASSERT(txProbeRspIETable[u4Idx].pfnCalculateVariableIELen); - - u2EstimatedExtraIELen += (UINT_16)(txProbeRspIETable[u4Idx].pfnCalculateVariableIELen(prAdapter, - NETWORK_TYPE_P2P_INDEX, - NULL)); - } - - } - - - if (fgIsWSCIE) { - u2EstimatedExtraIELen += kalP2PCalWSC_IELen(prAdapter->prGlueInfo, 2); - } - - if (fgIsP2PIE) { - u2EstimatedExtraIELen += kalP2PCalWSC_IELen(prAdapter->prGlueInfo, 1); - } - - - - - if ((u2EstimateSize += u2EstimatedExtraIELen) > (prRetMsduInfo->u2FrameLength)) { - prRetMsduInfo = cnmMgtPktAlloc(prAdapter, u2EstimateSize); - - if (prRetMsduInfo == NULL) { - DBGLOG(P2P, WARN, ("No packet for sending new probe response, use original one\n")); - prRetMsduInfo = prMgmtTxMsdu; - break; - } - - - prRetMsduInfo->ucNetworkType = NETWORK_TYPE_P2P_INDEX; - } - - - //3 Compose / Re-compose probe response frame. - bssComposeBeaconProbeRespFrameHeaderAndFF( - (PUINT_8)((UINT_32)(prRetMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD), - prProbeRspFrame->aucDestAddr, - prProbeRspFrame->aucSrcAddr, - prProbeRspFrame->aucBSSID, - prProbeRspFrame->u2BeaconInterval, - prProbeRspFrame->u2CapInfo); - - prRetMsduInfo->u2FrameLength = (WLAN_MAC_MGMT_HEADER_LEN + TIMESTAMP_FIELD_LEN + BEACON_INTERVAL_FIELD_LEN + CAP_INFO_FIELD_LEN); - - bssBuildBeaconProbeRespFrameCommonIEs(prRetMsduInfo, - prP2pBssInfo, - prProbeRspFrame->aucDestAddr); - - - for (u4Idx = 0; u4Idx < u4IeArraySize; u4Idx++) { - if (txProbeRspIETable[u4Idx].pfnAppendIE) { - txProbeRspIETable[u4Idx].pfnAppendIE(prAdapter, prRetMsduInfo); - } - - } - - - if (fgIsWSCIE) { - kalP2PGenWSC_IE(prAdapter->prGlueInfo, - 2, - (PUINT_8)((UINT_32)prRetMsduInfo->prPacket + (UINT_32)prRetMsduInfo->u2FrameLength)); - - prRetMsduInfo->u2FrameLength += (UINT_16)kalP2PCalWSC_IELen(prAdapter->prGlueInfo, 2); - } - - if (fgIsP2PIE) { - kalP2PGenWSC_IE(prAdapter->prGlueInfo, - 1, - (PUINT_8)((UINT_32)prRetMsduInfo->prPacket + (UINT_32)prRetMsduInfo->u2FrameLength)); - - prRetMsduInfo->u2FrameLength += (UINT_16)kalP2PCalWSC_IELen(prAdapter->prGlueInfo, 1); - } - - - } while (FALSE); - - if (prRetMsduInfo != prMgmtTxMsdu) { - cnmMgtPktFree(prAdapter, prMgmtTxMsdu); - } - - - return prRetMsduInfo; -} /* p2pFuncProcessP2pProbeRsp */ - - -#if 0 //LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) -UINT_32 -p2pFuncCalculateExtra_IELenForBeacon ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ) -{ - - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpeBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; - UINT_32 u4IELen = 0; - - do { - ASSERT_BREAK((prAdapter != NULL) && (eNetTypeIndex == NETWORK_TYPE_P2P_INDEX)); - - if (p2pFuncIsAPMode(prAdapter->rWifiVar.prP2pFsmInfo)) { - break; - } - - prP2pSpeBssInfo = prAdapter->rWifiVar.prP2pSpecificBssInfo; - - u4IELen = prP2pSpeBssInfo->u2IELenForBCN; - - } while (FALSE); - - return u4IELen; -} /* p2pFuncCalculateP2p_IELenForBeacon */ - -VOID -p2pFuncGenerateExtra_IEForBeacon ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpeBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; - PUINT_8 pucIEBuf = (PUINT_8)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsduInfo != NULL)); - - prP2pSpeBssInfo = prAdapter->rWifiVar.prP2pSpecificBssInfo; - - if (p2pFuncIsAPMode(prAdapter->rWifiVar.prP2pFsmInfo)) { - - break; - } - - pucIEBuf = (PUINT_8)((UINT_32)prMsduInfo->prPacket + (UINT_32)prMsduInfo->u2FrameLength); - - kalMemCopy(pucIEBuf, prP2pSpeBssInfo->aucBeaconIECache, prP2pSpeBssInfo->u2IELenForBCN); - - prMsduInfo->u2FrameLength += prP2pSpeBssInfo->u2IELenForBCN; - - } while (FALSE); - - return; -} /* p2pFuncGenerateExtra_IEForBeacon */ - - -#else -UINT_32 -p2pFuncCalculateP2p_IELenForBeacon ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ) -{ - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpeBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; - UINT_32 u4IELen = 0; - - do { - ASSERT_BREAK((prAdapter != NULL) && (eNetTypeIndex == NETWORK_TYPE_P2P_INDEX)); - - if (!prAdapter->fgIsP2PRegistered) { - break; - } - - - if (p2pFuncIsAPMode(prAdapter->rWifiVar.prP2pFsmInfo)) { - break; - } - - prP2pSpeBssInfo = prAdapter->rWifiVar.prP2pSpecificBssInfo; - - u4IELen = prP2pSpeBssInfo->u2AttributeLen; - - } while (FALSE); - - return u4IELen; -} /* p2pFuncCalculateP2p_IELenForBeacon */ - - -VOID -p2pFuncGenerateP2p_IEForBeacon ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpeBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; - PUINT_8 pucIEBuf = (PUINT_8)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsduInfo != NULL)); - - if (!prAdapter->fgIsP2PRegistered) { - break; - } - - prP2pSpeBssInfo = prAdapter->rWifiVar.prP2pSpecificBssInfo; - - if (p2pFuncIsAPMode(prAdapter->rWifiVar.prP2pFsmInfo)) { - - break; - } - - pucIEBuf = (PUINT_8)((UINT_32)prMsduInfo->prPacket + (UINT_32)prMsduInfo->u2FrameLength); - - kalMemCopy(pucIEBuf, prP2pSpeBssInfo->aucAttributesCache, prP2pSpeBssInfo->u2AttributeLen); - - prMsduInfo->u2FrameLength += prP2pSpeBssInfo->u2AttributeLen; - - } while (FALSE); - - return; -} /* p2pFuncGenerateP2p_IEForBeacon */ - - - - - -UINT_32 -p2pFuncCalculateWSC_IELenForBeacon ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ) -{ - if (eNetTypeIndex != NETWORK_TYPE_P2P_INDEX) { - return 0; - } - - return kalP2PCalWSC_IELen(prAdapter->prGlueInfo, 0); -} /* p2pFuncCalculateP2p_IELenForBeacon */ - - -VOID -p2pFuncGenerateWSC_IEForBeacon ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - PUINT_8 pucBuffer; - UINT_16 u2IELen = 0; - ASSERT(prAdapter); - ASSERT(prMsduInfo); - - if (prMsduInfo->ucNetworkType != NETWORK_TYPE_P2P_INDEX) { - return; - } - - u2IELen = (UINT_16)kalP2PCalWSC_IELen(prAdapter->prGlueInfo, 0); - - pucBuffer = (PUINT_8)((UINT_32)prMsduInfo->prPacket + - (UINT_32)prMsduInfo->u2FrameLength); - - ASSERT(pucBuffer); - - // TODO: Check P2P FSM State. - kalP2PGenWSC_IE(prAdapter->prGlueInfo, - 0, - pucBuffer); - - prMsduInfo->u2FrameLength += u2IELen; - - return; -} /* p2pFuncGenerateP2p_IEForBeacon */ - -#endif -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to calculate P2P IE length for Beacon frame. -* -* @param[in] eNetTypeIndex Specify which network -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @return The length of P2P IE added -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -p2pFuncCalculateP2p_IELenForAssocRsp ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ) -{ - - if (eNetTypeIndex != NETWORK_TYPE_P2P_INDEX) { - return 0; - } - - return p2pFuncCalculateP2P_IELen(prAdapter, - eNetTypeIndex, - prStaRec, - txAssocRspAttributesTable, - sizeof(txAssocRspAttributesTable)/sizeof(APPEND_VAR_ATTRI_ENTRY_T)); - -} /* p2pFuncCalculateP2p_IELenForAssocRsp */ - - - - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to generate P2P IE for Beacon frame. -* -* @param[in] prMsduInfo Pointer to the composed MSDU_INFO_T. -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pFuncGenerateP2p_IEForAssocRsp ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsduInfo != NULL)); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - if (IS_STA_P2P_TYPE(prStaRec)) { - DBGLOG(P2P, TRACE, ("Generate NULL P2P IE for Assoc Rsp.\n")); - - p2pFuncGenerateP2P_IE(prAdapter, - TRUE, - &prMsduInfo->u2FrameLength, - prMsduInfo->prPacket, - 1500, - txAssocRspAttributesTable, - sizeof(txAssocRspAttributesTable)/sizeof(APPEND_VAR_ATTRI_ENTRY_T)); - } - else { - - DBGLOG(P2P, TRACE, ("Legacy device, no P2P IE.\n")); - } - - } while (FALSE); - - return; - -} /* p2pFuncGenerateP2p_IEForAssocRsp */ - - - - -UINT_32 -p2pFuncCalculateP2P_IELen ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec, - IN APPEND_VAR_ATTRI_ENTRY_T arAppendAttriTable[], - IN UINT_32 u4AttriTableSize - ) -{ - - UINT_32 u4OverallAttriLen, u4Dummy; - UINT_16 u2EstimatedFixedAttriLen; - UINT_32 i; - - - /* Overall length of all Attributes */ - u4OverallAttriLen = 0; - - for (i = 0; i < u4AttriTableSize; i++) { - u2EstimatedFixedAttriLen = arAppendAttriTable[i].u2EstimatedFixedAttriLen; - - if (u2EstimatedFixedAttriLen) { - u4OverallAttriLen += u2EstimatedFixedAttriLen; - } - else { - ASSERT(arAppendAttriTable[i].pfnCalculateVariableAttriLen); - - u4OverallAttriLen += - arAppendAttriTable[i].pfnCalculateVariableAttriLen(prAdapter, prStaRec); - } - } - - u4Dummy = u4OverallAttriLen; - u4OverallAttriLen += P2P_IE_OUI_HDR; - - for (;(u4Dummy > P2P_MAXIMUM_ATTRIBUTE_LEN);) { - u4OverallAttriLen += P2P_IE_OUI_HDR; - u4Dummy -= P2P_MAXIMUM_ATTRIBUTE_LEN; - } - - return u4OverallAttriLen; -} /* p2pFuncCalculateP2P_IELen */ - - -VOID -p2pFuncGenerateP2P_IE ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize, - IN APPEND_VAR_ATTRI_ENTRY_T arAppendAttriTable[], - IN UINT_32 u4AttriTableSize - ) -{ - PUINT_8 pucBuffer = (PUINT_8)NULL; - P_IE_P2P_T prIeP2P = (P_IE_P2P_T)NULL; - UINT_32 u4OverallAttriLen; - UINT_32 u4AttriLen; - UINT_8 aucWfaOui[] = VENDOR_OUI_WFA_SPECIFIC; - UINT_8 aucTempBuffer[P2P_MAXIMUM_ATTRIBUTE_LEN]; - UINT_32 i; - - - do { - ASSERT_BREAK((prAdapter != NULL) && (pucBuf != NULL)); - - pucBuffer = (PUINT_8)((UINT_32)pucBuf + (*pu2Offset)); - - ASSERT_BREAK(pucBuffer != NULL); - - /* Check buffer length is still enough. */ - ASSERT_BREAK((u2BufSize - (*pu2Offset)) >= P2P_IE_OUI_HDR); - - prIeP2P = (P_IE_P2P_T)pucBuffer; - - prIeP2P->ucId = ELEM_ID_P2P; - - prIeP2P->aucOui[0] = aucWfaOui[0]; - prIeP2P->aucOui[1] = aucWfaOui[1]; - prIeP2P->aucOui[2] = aucWfaOui[2]; - prIeP2P->ucOuiType = VENDOR_OUI_TYPE_P2P; - - (*pu2Offset) += P2P_IE_OUI_HDR; - - /* Overall length of all Attributes */ - u4OverallAttriLen = 0; - - - for (i = 0; i < u4AttriTableSize; i++) { - - if (arAppendAttriTable[i].pfnAppendAttri) { - u4AttriLen = arAppendAttriTable[i].pfnAppendAttri(prAdapter, fgIsAssocFrame, pu2Offset, pucBuf, u2BufSize); - - u4OverallAttriLen += u4AttriLen; - - if (u4OverallAttriLen > P2P_MAXIMUM_ATTRIBUTE_LEN) { - u4OverallAttriLen -= P2P_MAXIMUM_ATTRIBUTE_LEN; - - prIeP2P->ucLength = (VENDOR_OUI_TYPE_LEN + P2P_MAXIMUM_ATTRIBUTE_LEN); - - pucBuffer = (PUINT_8)((UINT_32)prIeP2P + (VENDOR_OUI_TYPE_LEN + P2P_MAXIMUM_ATTRIBUTE_LEN)); - - prIeP2P = (P_IE_P2P_T)((UINT_32)prIeP2P + - (ELEM_HDR_LEN + (VENDOR_OUI_TYPE_LEN + P2P_MAXIMUM_ATTRIBUTE_LEN))); - - kalMemCopy(aucTempBuffer, pucBuffer, u4OverallAttriLen); - - prIeP2P->ucId = ELEM_ID_P2P; - - prIeP2P->aucOui[0] = aucWfaOui[0]; - prIeP2P->aucOui[1] = aucWfaOui[1]; - prIeP2P->aucOui[2] = aucWfaOui[2]; - prIeP2P->ucOuiType = VENDOR_OUI_TYPE_P2P; - - kalMemCopy(prIeP2P->aucP2PAttributes, aucTempBuffer, u4OverallAttriLen); - (*pu2Offset) += P2P_IE_OUI_HDR; - } - - } - - } - - prIeP2P->ucLength = (UINT_8)(VENDOR_OUI_TYPE_LEN + u4OverallAttriLen); - - - } while (FALSE); - - return; -} /* p2pFuncGenerateP2P_IE */ - -UINT_32 -p2pFuncAppendAttriStatusForAssocRsp ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ) -{ - PUINT_8 pucBuffer; - P_P2P_ATTRI_STATUS_T prAttriStatus; - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL; - UINT_32 u4AttriLen = 0; - - ASSERT(prAdapter); - ASSERT(pucBuf); - - prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - - if (fgIsAssocFrame) { - return u4AttriLen; - } - - // TODO: For assoc request P2P IE check in driver & return status in P2P IE. - - pucBuffer = (PUINT_8)((UINT_32)pucBuf + - (UINT_32)(*pu2Offset)); - - ASSERT(pucBuffer); - prAttriStatus = (P_P2P_ATTRI_STATUS_T)pucBuffer; - - ASSERT(u2BufSize >= ((*pu2Offset) + (UINT_16)u4AttriLen)); - - - - - prAttriStatus->ucId = P2P_ATTRI_ID_STATUS; - WLAN_SET_FIELD_16(&prAttriStatus->u2Length, P2P_ATTRI_MAX_LEN_STATUS); - - prAttriStatus->ucStatusCode = P2P_STATUS_FAIL_PREVIOUS_PROTOCOL_ERR; - - u4AttriLen = (P2P_ATTRI_HDR_LEN + P2P_ATTRI_MAX_LEN_STATUS); - - (*pu2Offset) += (UINT_16)u4AttriLen; - - return u4AttriLen; -} /* p2pFuncAppendAttriStatusForAssocRsp */ - -UINT_32 -p2pFuncAppendAttriExtListenTiming ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgIsAssocFrame, - IN PUINT_16 pu2Offset, - IN PUINT_8 pucBuf, - IN UINT_16 u2BufSize - ) -{ - UINT_32 u4AttriLen = 0; - P_P2P_ATTRI_EXT_LISTEN_TIMING_T prP2pExtListenTiming = (P_P2P_ATTRI_EXT_LISTEN_TIMING_T)NULL; - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; - PUINT_8 pucBuffer = NULL; - - ASSERT(prAdapter); - ASSERT(pucBuf); - - if (fgIsAssocFrame) { - return u4AttriLen; - } - - // TODO: For extend listen timing. - - prP2pSpecificBssInfo = prAdapter->rWifiVar.prP2pSpecificBssInfo; - - u4AttriLen = (P2P_ATTRI_HDR_LEN + P2P_ATTRI_MAX_LEN_EXT_LISTEN_TIMING); - - ASSERT(u2BufSize >= ((*pu2Offset) + (UINT_16)u4AttriLen)); - - pucBuffer = (PUINT_8)((UINT_32)pucBuf + - (UINT_32)(*pu2Offset)); - - ASSERT(pucBuffer); - - prP2pExtListenTiming = (P_P2P_ATTRI_EXT_LISTEN_TIMING_T)pucBuffer; - - prP2pExtListenTiming->ucId = P2P_ATTRI_ID_EXT_LISTEN_TIMING; - WLAN_SET_FIELD_16(&prP2pExtListenTiming->u2Length, P2P_ATTRI_MAX_LEN_EXT_LISTEN_TIMING); - WLAN_SET_FIELD_16(&prP2pExtListenTiming->u2AvailInterval, prP2pSpecificBssInfo->u2AvailabilityInterval); - WLAN_SET_FIELD_16(&prP2pExtListenTiming->u2AvailPeriod, prP2pSpecificBssInfo->u2AvailabilityPeriod); - - (*pu2Offset) += (UINT_16)u4AttriLen; - - return u4AttriLen; -} /* p2pFuncAppendAttriExtListenTiming */ - - -P_IE_HDR_T -p2pFuncGetSpecIE ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucIEBuf, - IN UINT_16 u2BufferLen, - IN UINT_8 ucElemID, - IN PBOOLEAN pfgIsMore - ) -{ - P_IE_HDR_T prTargetIE = (P_IE_HDR_T)NULL; - PUINT_8 pucIE = (PUINT_8)NULL; - UINT_16 u2Offset = 0; - - - do { - ASSERT_BREAK((prAdapter != NULL) - && (pucIEBuf != NULL)); - - pucIE = pucIEBuf; - - if (pfgIsMore) { - *pfgIsMore = FALSE; - } - - - IE_FOR_EACH(pucIE, u2BufferLen, u2Offset) { - if (IE_ID(pucIE) == ucElemID) { - if ((prTargetIE) && (pfgIsMore)) { - - *pfgIsMore = TRUE; - break; - } - else { - prTargetIE = (P_IE_HDR_T)pucIE; - - if (pfgIsMore == NULL) { - break; - } - - } - - } - } - - } while (FALSE); - - return prTargetIE; -} /* p2pFuncGetSpecIE */ - - - -P_ATTRIBUTE_HDR_T -p2pFuncGetSpecAttri ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucOuiType, - IN PUINT_8 pucIEBuf, - IN UINT_16 u2BufferLen, - IN UINT_8 ucAttriID - ) -{ - P_IE_P2P_T prP2pIE = (P_IE_P2P_T)NULL; - P_ATTRIBUTE_HDR_T prTargetAttri = (P_ATTRIBUTE_HDR_T)NULL; - BOOLEAN fgIsMore = FALSE; - PUINT_8 pucIE = (PUINT_8)NULL, pucAttri = (PUINT_8)NULL; - UINT_16 u2OffsetAttri = 0; - UINT_8 aucWfaOui[] = VENDOR_OUI_WFA_SPECIFIC; - - do { - ASSERT_BREAK((prAdapter != NULL) - && (pucIEBuf != NULL)); - - pucIE = pucIEBuf; - - do { - prP2pIE = (P_IE_P2P_T)p2pFuncGetSpecIE(prAdapter, - pucIE, - u2BufferLen, - ELEM_ID_VENDOR, - &fgIsMore); - - if (prP2pIE) { - if (prP2pIE->ucOuiType == ucOuiType) { - switch (ucOuiType) { - case VENDOR_OUI_TYPE_WPS: - aucWfaOui[0] = 0x00; - aucWfaOui[1] = 0x50; - aucWfaOui[2] = 0xF2; - break; - case VENDOR_OUI_TYPE_P2P: - break; - case VENDOR_OUI_TYPE_WPA: - case VENDOR_OUI_TYPE_WMM: - default: - break; - } - - - if ((prP2pIE->aucOui[0] == aucWfaOui[0]) && - (prP2pIE->aucOui[1] == aucWfaOui[1]) && - (prP2pIE->aucOui[2] == aucWfaOui[2])) { - - pucAttri = prP2pIE->aucP2PAttributes; - - if (ucOuiType == VENDOR_OUI_TYPE_WPS) { - WSC_ATTRI_FOR_EACH(pucAttri, (IE_LEN(prP2pIE) - P2P_IE_OUI_HDR), u2OffsetAttri) { - if (WSC_ATTRI_ID(pucAttri) == ucAttriID) { - prTargetAttri = (P_ATTRIBUTE_HDR_T)pucAttri; - break; - } - - } - - } - - else if (ucOuiType == VENDOR_OUI_TYPE_P2P) { - P2P_ATTRI_FOR_EACH(pucAttri, (IE_LEN(prP2pIE) - P2P_IE_OUI_HDR), u2OffsetAttri) { - if (ATTRI_ID(pucAttri) == ucAttriID) { - prTargetAttri = (P_ATTRIBUTE_HDR_T)pucAttri; - break; - } - - } - - } - - else { - // Possible WiFi Display or else. - ASSERT(FALSE); - } - } - - - } - - } - - - pucIE = (PUINT_8)((UINT_32)prP2pIE + IE_LEN(prP2pIE)); - - } while (fgIsMore); - - } while (FALSE); - - return prTargetAttri; -} -/* p2pFuncGetSpecAttri */ - - -WLAN_STATUS -p2pFuncGenerateBeaconProbeRsp ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prBssInfo, - IN P_MSDU_INFO_T prMsduInfo, - IN BOOLEAN fgIsProbeRsp - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_SUCCESS; - P_WLAN_BEACON_FRAME_T prBcnFrame = (P_WLAN_BEACON_FRAME_T)NULL; -// P_APPEND_VAR_IE_ENTRY_T prAppendIeTable = (P_APPEND_VAR_IE_ENTRY_T)NULL; - - - do { - - ASSERT_BREAK((prAdapter != NULL) && - (prBssInfo != NULL) && - (prMsduInfo != NULL)); - - -// txBcnIETable - -// txProbeRspIETable - - - - prBcnFrame = (P_WLAN_BEACON_FRAME_T)prMsduInfo->prPacket; - - return nicUpdateBeaconIETemplate(prAdapter, - IE_UPD_METHOD_UPDATE_ALL, - NETWORK_TYPE_P2P_INDEX, - prBssInfo->u2CapInfo, - (PUINT_8)prBcnFrame->aucInfoElem, - prMsduInfo->u2FrameLength - OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem)); - - } while (FALSE); - - return rWlanStatus; -} /* p2pFuncGenerateBeaconProbeRsp */ - - -WLAN_STATUS -p2pFuncComposeBeaconProbeRspTemplate ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBcnBuffer, - IN UINT_32 u4BcnBufLen, - IN BOOLEAN fgIsProbeRsp, - IN P_P2P_PROBE_RSP_UPDATE_INFO_T prP2pProbeRspInfo, - IN BOOLEAN fgSynToFW - ) -{ - WLAN_STATUS rWlanStatus = WLAN_STATUS_SUCCESS; - P_MSDU_INFO_T prMsduInfo = (P_MSDU_INFO_T)NULL; - P_WLAN_MAC_HEADER_T prWlanBcnFrame = (P_WLAN_MAC_HEADER_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - - PUINT_8 pucBuffer = (PUINT_8)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (pucBcnBuffer != NULL)); - - prWlanBcnFrame = (P_WLAN_MAC_HEADER_T)pucBcnBuffer; - - if ((prWlanBcnFrame->u2FrameCtrl != MAC_FRAME_BEACON) && (!fgIsProbeRsp)) { - rWlanStatus = WLAN_STATUS_INVALID_DATA; - break; - } - - else if (prWlanBcnFrame->u2FrameCtrl != MAC_FRAME_PROBE_RSP) { - rWlanStatus = WLAN_STATUS_INVALID_DATA; - break; - } - - - - if (fgIsProbeRsp) { - ASSERT_BREAK(prP2pProbeRspInfo != NULL); - - if (!prP2pProbeRspInfo->prProbeRspMsduTemplate) { - cnmMgtPktFree(prAdapter, prP2pProbeRspInfo->prProbeRspMsduTemplate); - } - - prP2pProbeRspInfo->prProbeRspMsduTemplate = cnmMgtPktAlloc(prAdapter, u4BcnBufLen); - - prMsduInfo = prP2pProbeRspInfo->prProbeRspMsduTemplate; - - prMsduInfo->eSrc = TX_PACKET_MGMT; - prMsduInfo->ucStaRecIndex = 0xFF; - prMsduInfo->ucNetworkType = NETWORK_TYPE_P2P_INDEX; - - } - else { - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - prMsduInfo = prP2pBssInfo->prBeacon; - - if (prMsduInfo == NULL) { - rWlanStatus = WLAN_STATUS_FAILURE; - break; - } - - if (u4BcnBufLen > (OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem[0]) + MAX_IE_LENGTH)) { - /* Unexpected error, buffer overflow. */ - ASSERT(FALSE); - break; - } - - } - - - pucBuffer = (PUINT_8)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD); - - kalMemCopy(pucBuffer, pucBcnBuffer, u4BcnBufLen); - - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = (UINT_16)u4BcnBufLen; - - if (fgSynToFW) { - rWlanStatus = p2pFuncGenerateBeaconProbeRsp(prAdapter, prP2pBssInfo, prMsduInfo, fgIsProbeRsp); - } - - } while (FALSE); - - return rWlanStatus; - -} /* p2pFuncComposeBeaconTemplate */ - - - - - - - - - - - - - - - - - - - diff --git a/drivers/net/wireless/mt5931/mgmt/p2p_ie.c b/drivers/net/wireless/mt5931/mgmt/p2p_ie.c deleted file mode 100755 index 6a658df56efe..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/p2p_ie.c +++ /dev/null @@ -1,72 +0,0 @@ -#include "p2p_precomp.h" - - - -UINT_32 -p2pCalculate_IEForAssocReq ( - - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN P_STA_RECORD_T prStaRec - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_P2P_CONNECTION_REQ_INFO_T prConnReqInfo = (P_P2P_CONNECTION_REQ_INFO_T)NULL; - UINT_32 u4RetValue = 0; - - do { - ASSERT_BREAK((eNetTypeIndex == NETWORK_TYPE_P2P_INDEX) && (prAdapter != NULL)); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - prConnReqInfo = &(prP2pFsmInfo->rConnReqInfo); - - u4RetValue = prConnReqInfo->u4BufLength; - - } -while (FALSE); - - return u4RetValue; -} /* p2pCalculate_IEForAssocReq */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to generate P2P IE for Beacon frame. -* -* @param[in] prMsduInfo Pointer to the composed MSDU_INFO_T. -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pGenerate_IEForAssocReq ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - P_P2P_CONNECTION_REQ_INFO_T prConnReqInfo = (P_P2P_CONNECTION_REQ_INFO_T)NULL; - PUINT_8 pucIEBuf = (PUINT_8)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prMsduInfo != NULL)); - - prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo; - - prConnReqInfo = &(prP2pFsmInfo->rConnReqInfo); - - pucIEBuf = (PUINT_8)((UINT_32)prMsduInfo->prPacket + (UINT_32)prMsduInfo->u2FrameLength); - - kalMemCopy(pucIEBuf, prConnReqInfo->aucIEBuf, prConnReqInfo->u4BufLength); - - prMsduInfo->u2FrameLength += prConnReqInfo->u4BufLength; - - } while (FALSE); - - return; - -} /* p2pGenerate_IEForAssocReq */ - - diff --git a/drivers/net/wireless/mt5931/mgmt/p2p_rlm.c b/drivers/net/wireless/mt5931/mgmt/p2p_rlm.c deleted file mode 100755 index 98941d1414e1..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/p2p_rlm.c +++ /dev/null @@ -1,1014 +0,0 @@ -/* -** $Id: @(#) p2p_rlm.c@@ -*/ - -/*! \file "p2p_rlm.c" - \brief - -*/ - - - - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -#include "precomp.h" - -extern VOID -rlmSyncOperationParams ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ); - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Init AP Bss -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmBssInitForAP( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ) -{ - ENUM_BAND_T eBand; - UINT_8 ucChannel; - ENUM_CHNL_EXT_T eSCO; - - ASSERT(prAdapter); - ASSERT(prBssInfo); - - if (prBssInfo->eCurrentOPMode != OP_MODE_ACCESS_POINT) { - return; - } - - /* Operation band, channel shall be ready before invoking this function. - * Bandwidth may be ready if other network is connected - */ - prBssInfo->fg40mBwAllowed = FALSE; - prBssInfo->fgAssoc40mBwAllowed = FALSE; - prBssInfo->eBssSCO = CHNL_EXT_SCN; - - if (RLM_AP_IS_BW_40_ALLOWED(prAdapter, prBssInfo)) { - /* In this case, the first BSS's SCO is 40MHz and known, so AP can - * apply 40MHz bandwidth, but the first BSS's SCO may be changed - * later if its Beacon lost timeout occurs - */ - if (cnmPreferredChannel(prAdapter, &eBand, &ucChannel, &eSCO) && - eSCO != CHNL_EXT_SCN && ucChannel == prBssInfo->ucPrimaryChannel && - eBand == prBssInfo->eBand) { - prBssInfo->eBssSCO = eSCO; - } - else if (cnmBss40mBwPermitted(prAdapter, prBssInfo->ucNetTypeIndex)) { - prBssInfo->eBssSCO = rlmDecideScoForAP(prAdapter, prBssInfo); - } - - if (prBssInfo->eBssSCO != CHNL_EXT_SCN) { - prBssInfo->fg40mBwAllowed = TRUE; - prBssInfo->fgAssoc40mBwAllowed = TRUE; - - prBssInfo->ucHtOpInfo1 = (UINT_8) - (((UINT_32) prBssInfo->eBssSCO) | HT_OP_INFO1_STA_CHNL_WIDTH); - - rlmUpdateBwByChListForAP(prAdapter, prBssInfo); - } - } - - DBGLOG(RLM, INFO, ("WLAN AP SCO=%d\n", prBssInfo->eBssSCO)); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief For probe response (GO, IBSS) and association response -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmRspGenerateObssScanIE ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ) -{ - P_BSS_INFO_T prBssInfo; - P_IE_OBSS_SCAN_PARAM_T prObssScanIe; - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - - ASSERT(prAdapter); - ASSERT(prMsduInfo); - ASSERT(IS_NET_ACTIVE(prAdapter, prMsduInfo->ucNetworkType)); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prMsduInfo->ucNetworkType]; - ASSERT(prBssInfo); - - if (RLM_NET_IS_11N(prBssInfo) && !RLM_NET_IS_BOW(prBssInfo) && - prBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT && - (!prStaRec || (prStaRec->ucPhyTypeSet & PHY_TYPE_SET_802_11N)) && - prBssInfo->eBand == BAND_2G4 && - prBssInfo->eBssSCO != CHNL_EXT_SCN) { - - prObssScanIe = (P_IE_OBSS_SCAN_PARAM_T) - (((PUINT_8) prMsduInfo->prPacket) + prMsduInfo->u2FrameLength); - - /* Add 20/40 BSS coexistence IE */ - prObssScanIe->ucId = ELEM_ID_OBSS_SCAN_PARAMS; - prObssScanIe->ucLength = sizeof(IE_OBSS_SCAN_PARAM_T) - ELEM_HDR_LEN; - - prObssScanIe->u2ScanPassiveDwell = - dot11OBSSScanPassiveDwell; - prObssScanIe->u2ScanActiveDwell = - dot11OBSSScanActiveDwell; - prObssScanIe->u2TriggerScanInterval = - dot11BSSWidthTriggerScanInterval; - prObssScanIe->u2ScanPassiveTotalPerChnl = - dot11OBSSScanPassiveTotalPerChannel; - prObssScanIe->u2ScanActiveTotalPerChnl = - dot11OBSSScanActiveTotalPerChannel; - prObssScanIe->u2WidthTransDelayFactor = - dot11BSSWidthChannelTransitionDelayFactor; - prObssScanIe->u2ScanActivityThres = - dot11OBSSScanActivityThreshold; - - ASSERT(IE_SIZE(prObssScanIe) <= (ELEM_HDR_LEN+ ELEM_MAX_LEN_OBSS_SCAN)); - - prMsduInfo->u2FrameLength += IE_SIZE(prObssScanIe); - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P GO. -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rlmUpdateBwByChListForAP ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ) -{ - UINT_8 ucLevel; - BOOLEAN fgBwChange; - - ASSERT(prAdapter); - ASSERT(prBssInfo); - - fgBwChange = FALSE; - - if (prBssInfo->eBssSCO == CHNL_EXT_SCN) { - return fgBwChange; - } - - ucLevel = rlmObssChnlLevel(prBssInfo, prBssInfo->eBand, - prBssInfo->ucPrimaryChannel, prBssInfo->eBssSCO); - - if (ucLevel == CHNL_LEVEL0) { - /* Forced to 20MHz, so extended channel is SCN and STA width is zero */ - prBssInfo->fgObssActionForcedTo20M = TRUE; - - if (prBssInfo->ucHtOpInfo1 != (UINT_8) CHNL_EXT_SCN) { - prBssInfo->ucHtOpInfo1 = (UINT_8) CHNL_EXT_SCN; - fgBwChange = TRUE; - } - - cnmTimerStartTimer(prAdapter, &prBssInfo->rObssScanTimer, - OBSS_20_40M_TIMEOUT * MSEC_PER_SEC); - } - - /* Clear up all channel lists */ - prBssInfo->auc2G_20mReqChnlList[0] = 0; - prBssInfo->auc2G_NonHtChnlList[0] = 0; - prBssInfo->auc2G_PriChnlList[0] = 0; - prBssInfo->auc2G_SecChnlList[0] = 0; - prBssInfo->auc5G_20mReqChnlList[0] = 0; - prBssInfo->auc5G_NonHtChnlList[0] = 0; - prBssInfo->auc5G_PriChnlList[0] = 0; - prBssInfo->auc5G_SecChnlList[0] = 0; - - return fgBwChange; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmProcessPublicAction ( - P_ADAPTER_T prAdapter, - P_SW_RFB_T prSwRfb - ) -{ - P_ACTION_20_40_COEXIST_FRAME prRxFrame; - P_IE_20_40_COEXIST_T prCoexist; - P_IE_INTOLERANT_CHNL_REPORT_T prChnlReport; - P_BSS_INFO_T prBssInfo; - P_STA_RECORD_T prStaRec; - PUINT_8 pucIE; - UINT_16 u2IELength, u2Offset; - UINT_8 i, j; - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - prRxFrame = (P_ACTION_20_40_COEXIST_FRAME) prSwRfb->pvHeader; - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - - if (prRxFrame->ucAction != ACTION_PUBLIC_20_40_COEXIST || - !prStaRec || prStaRec->ucStaState != STA_STATE_3 || - prSwRfb->u2PacketLen < (WLAN_MAC_MGMT_HEADER_LEN + 5) || - HIF_RX_HDR_GET_NETWORK_IDX(prSwRfb->prHifRxHdr) != - NETWORK_TYPE_P2P_INDEX) { - return; - } - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]; - ASSERT(prBssInfo); - - if (!IS_BSS_ACTIVE(prBssInfo) || - prBssInfo->eCurrentOPMode != OP_MODE_ACCESS_POINT || - prBssInfo->eBssSCO == CHNL_EXT_SCN) { - return; - } - - prCoexist = &prRxFrame->rBssCoexist; - if (prCoexist->ucData & (BSS_COEXIST_40M_INTOLERANT|BSS_COEXIST_20M_REQ)) { - ASSERT(prBssInfo->auc2G_20mReqChnlList[0] <= CHNL_LIST_SZ_2G); - for (i = 1; i <= prBssInfo->auc2G_20mReqChnlList[0] && - i <= CHNL_LIST_SZ_2G; i++) { - if (prBssInfo->auc2G_20mReqChnlList[i] == - prBssInfo->ucPrimaryChannel) { - break; - } - } - if ((i > prBssInfo->auc2G_20mReqChnlList[0]) && - (i <= CHNL_LIST_SZ_2G)){ - prBssInfo->auc2G_20mReqChnlList[i] = prBssInfo->ucPrimaryChannel; - prBssInfo->auc2G_20mReqChnlList[0]++; - } - } - - /* Process intolerant channel report IE */ - pucIE = (PUINT_8) &prRxFrame->rChnlReport; - u2IELength = prSwRfb->u2PacketLen - (WLAN_MAC_MGMT_HEADER_LEN + 5); - - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - switch (IE_ID(pucIE)) { - case ELEM_ID_20_40_INTOLERANT_CHNL_REPORT: - prChnlReport = (P_IE_INTOLERANT_CHNL_REPORT_T) pucIE; - - if (prChnlReport->ucLength <= 1) { - break; - } - - /* To do: process regulatory class. Now we assume 2.4G band */ - - for (j = 0; j < prChnlReport->ucLength - 1; j++) { - /* Update non-HT channel list */ - ASSERT(prBssInfo->auc2G_NonHtChnlList[0] <= CHNL_LIST_SZ_2G); - for (i = 1; i <= prBssInfo->auc2G_NonHtChnlList[0] && - i <= CHNL_LIST_SZ_2G; i++) { - if (prBssInfo->auc2G_NonHtChnlList[i] == - prChnlReport->aucChannelList[j]) { - break; - } - } - if ((i > prBssInfo->auc2G_NonHtChnlList[0]) && - (i <= CHNL_LIST_SZ_2G)) { - prBssInfo->auc2G_NonHtChnlList[i] = - prChnlReport->aucChannelList[j]; - prBssInfo->auc2G_NonHtChnlList[0]++; - } - } - break; - - default: - break; - } - } /* end of IE_FOR_EACH */ - - if (rlmUpdateBwByChListForAP(prAdapter, prBssInfo)) { - bssUpdateBeaconContent(prAdapter, prBssInfo->ucNetTypeIndex); - rlmSyncOperationParams(prAdapter, prBssInfo); - } - - /* Check if OBSS scan exemption response should be sent */ - if (prCoexist->ucData & BSS_COEXIST_OBSS_SCAN_EXEMPTION_REQ) { - rlmObssScanExemptionRsp(prAdapter, prBssInfo, prSwRfb); - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmProcessHtAction ( - P_ADAPTER_T prAdapter, - P_SW_RFB_T prSwRfb - ) -{ - P_ACTION_NOTIFY_CHNL_WIDTH_FRAME prRxFrame; - P_STA_RECORD_T prStaRec; - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - prRxFrame = (P_ACTION_NOTIFY_CHNL_WIDTH_FRAME) prSwRfb->pvHeader; - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - - if (prRxFrame->ucAction != ACTION_HT_NOTIFY_CHANNEL_WIDTH || - !prStaRec || prStaRec->ucStaState != STA_STATE_3 || - prSwRfb->u2PacketLen < sizeof(ACTION_NOTIFY_CHNL_WIDTH_FRAME)) { - return; - } - - /* To do: depending regulation class 13 and 14 based on spec - * Note: (ucChannelWidth==1) shall restored back to original capability, - * not current setting to 40MHz BW here - */ - if (prRxFrame->ucChannelWidth == 0) { - prStaRec->u2HtCapInfo &= ~HT_CAP_INFO_SUP_CHNL_WIDTH; - } - else if (prRxFrame->ucChannelWidth == 1) { - prStaRec->u2HtCapInfo |= HT_CAP_INFO_SUP_CHNL_WIDTH; - } - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_3); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmHandleObssStatusEventPkt ( - P_ADAPTER_T prAdapter, - P_EVENT_AP_OBSS_STATUS_T prObssStatus - ) -{ - P_BSS_INFO_T prBssInfo; - - ASSERT(prAdapter); - ASSERT(prObssStatus); - ASSERT(prObssStatus->ucNetTypeIndex == NETWORK_TYPE_P2P_INDEX); - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prObssStatus->ucNetTypeIndex]; - ASSERT(prBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT); - - prBssInfo->fgObssErpProtectMode = - (BOOLEAN) prObssStatus->ucObssErpProtectMode; - prBssInfo->eObssHtProtectMode = - (ENUM_HT_PROTECT_MODE_T) prObssStatus->ucObssHtProtectMode; - prBssInfo->eObssGfOperationMode = - (ENUM_GF_MODE_T) prObssStatus->ucObssGfOperationMode; - prBssInfo->fgObssRifsOperationMode = - (BOOLEAN) prObssStatus->ucObssRifsOperationMode; - prBssInfo->fgObssBeaconForcedTo20M = - (BOOLEAN) prObssStatus->ucObssBeaconForcedTo20M; - - /* Check if Beacon content need to be updated */ - rlmUpdateParamsForAP(prAdapter, prBssInfo, TRUE); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief It is only for AP mode in NETWORK_TYPE_P2P_INDEX. -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmUpdateParamsForAP ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - BOOLEAN fgUpdateBeacon - ) -{ - P_LINK_T prStaList; - P_STA_RECORD_T prStaRec; - BOOLEAN fgErpProtectMode, fgSta40mIntolerant; - BOOLEAN fgUseShortPreamble, fgUseShortSlotTime; - ENUM_HT_PROTECT_MODE_T eHtProtectMode; - ENUM_GF_MODE_T eGfOperationMode; - UINT_8 ucHtOpInfo1; - - ASSERT(prAdapter); - ASSERT(prBssInfo); - - if (!IS_BSS_ACTIVE(prBssInfo) || - prBssInfo->eCurrentOPMode != OP_MODE_ACCESS_POINT) { - return; - } - - fgErpProtectMode = FALSE; - eHtProtectMode = HT_PROTECT_MODE_NONE; - eGfOperationMode = GF_MODE_NORMAL; - fgSta40mIntolerant = FALSE; - fgUseShortPreamble = prBssInfo->fgIsShortPreambleAllowed; - fgUseShortSlotTime = TRUE; - ucHtOpInfo1 = (UINT_8) CHNL_EXT_SCN; - - prStaList = &prBssInfo->rStaRecOfClientList; - - LINK_FOR_EACH_ENTRY(prStaRec, prStaList, rLinkEntry, STA_RECORD_T) { - ASSERT(prStaRec); - if (prStaRec->fgIsInUse && prStaRec->ucStaState == STA_STATE_3 && - prStaRec->ucNetTypeIndex == prBssInfo->ucNetTypeIndex) { - if (!(prStaRec->ucPhyTypeSet & - (PHY_TYPE_SET_802_11GN | PHY_TYPE_SET_802_11A))) { - /* B-only mode, so mode 1 (ERP protection) */ - fgErpProtectMode = TRUE; - } - - if (!(prStaRec->ucPhyTypeSet & PHY_TYPE_SET_802_11N)) { - /* BG-only or A-only */ - eHtProtectMode = HT_PROTECT_MODE_NON_HT; - } - else if (!(prStaRec->u2HtCapInfo & HT_CAP_INFO_SUP_CHNL_WIDTH)) { - /* 20MHz-only */ - if (eHtProtectMode == HT_PROTECT_MODE_NONE) { - eHtProtectMode = HT_PROTECT_MODE_20M; - } - } - - if (!(prStaRec->u2HtCapInfo & HT_CAP_INFO_HT_GF)) { - eGfOperationMode = GF_MODE_PROTECT; - } - - if (!(prStaRec->u2CapInfo & CAP_INFO_SHORT_PREAMBLE)) { - fgUseShortPreamble = FALSE; - } - - if (!(prStaRec->u2CapInfo & CAP_INFO_SHORT_SLOT_TIME)) { - fgUseShortSlotTime = FALSE; - } - - if (prStaRec->u2HtCapInfo & HT_CAP_INFO_40M_INTOLERANT) { - fgSta40mIntolerant = TRUE; - } - } - } /* end of LINK_FOR_EACH_ENTRY */ - - /* Check if HT operation IE about 20/40M bandwidth shall be updated */ - if (prBssInfo->eBssSCO != CHNL_EXT_SCN) { - if (/*!LINK_IS_EMPTY(prStaList) && */ !fgSta40mIntolerant && - !prBssInfo->fgObssActionForcedTo20M && - !prBssInfo->fgObssBeaconForcedTo20M) { - - ucHtOpInfo1 = (UINT_8) - (((UINT_32) prBssInfo->eBssSCO) | HT_OP_INFO1_STA_CHNL_WIDTH); - } - } - - /* Check if any new parameter may be updated */ - if (prBssInfo->fgErpProtectMode != fgErpProtectMode || - prBssInfo->eHtProtectMode != eHtProtectMode || - prBssInfo->eGfOperationMode != eGfOperationMode || - prBssInfo->ucHtOpInfo1 != ucHtOpInfo1 || - prBssInfo->fgUseShortPreamble != fgUseShortPreamble || - prBssInfo->fgUseShortSlotTime != fgUseShortSlotTime) { - - prBssInfo->fgErpProtectMode = fgErpProtectMode; - prBssInfo->eHtProtectMode = eHtProtectMode; - prBssInfo->eGfOperationMode = eGfOperationMode; - prBssInfo->ucHtOpInfo1 = ucHtOpInfo1; - prBssInfo->fgUseShortPreamble = fgUseShortPreamble; - prBssInfo->fgUseShortSlotTime = fgUseShortSlotTime; - - if (fgUseShortSlotTime) { - prBssInfo->u2CapInfo |= CAP_INFO_SHORT_SLOT_TIME; - } - else { - prBssInfo->u2CapInfo &= ~CAP_INFO_SHORT_SLOT_TIME; - } - - rlmSyncOperationParams(prAdapter, prBssInfo); - fgUpdateBeacon = TRUE; - } - - /* Update Beacon content if related IE content is changed */ - if (fgUpdateBeacon) { - bssUpdateBeaconContent(prAdapter, prBssInfo->ucNetTypeIndex); - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Initial the channel list from the domain information. -* This function is called after P2P initial and Domain information changed. -* Make sure the device is disconnected while changing domain information. -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return boolean value if probe response frame is -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmFuncInitialChannelList ( - IN P_ADAPTER_T prAdapter - ) -{ - P_P2P_CONNECTION_SETTINGS_T prP2pConnSetting = (P_P2P_CONNECTION_SETTINGS_T)NULL; - P_DOMAIN_INFO_ENTRY prDomainInfoEntry = (P_DOMAIN_INFO_ENTRY)NULL; - P_DOMAIN_SUBBAND_INFO prDomainSubBand = (P_DOMAIN_SUBBAND_INFO)NULL; - P_CHANNEL_ENTRY_FIELD_T prChannelEntryField = (P_CHANNEL_ENTRY_FIELD_T)NULL; - UINT_32 u4Idx = 0, u4IdxII = 0; - UINT_8 ucBufferSize = P2P_MAX_SUPPORTED_CHANNEL_LIST_SIZE; -#if 0 - UINT_8 ucSocialChnlSupport = 0, ucAutoChnl = 0; -#endif - - do { - ASSERT_BREAK(prAdapter != NULL); - - prP2pConnSetting = prAdapter->rWifiVar.prP2PConnSettings; -#if 0 - ucAutoChnl = prP2pConnSetting->ucOperatingChnl; -#endif - - prDomainInfoEntry = rlmDomainGetDomainInfo(prAdapter); - - ASSERT_BREAK((prDomainInfoEntry != NULL) && (prP2pConnSetting != NULL)); - - prChannelEntryField = (P_CHANNEL_ENTRY_FIELD_T)prP2pConnSetting->aucChannelEntriesField; - - for (u4Idx = 0; u4Idx < MAX_SUBBAND_NUM; u4Idx++) { - prDomainSubBand = &prDomainInfoEntry->rSubBand[u4Idx]; - - - if (((prDomainSubBand->ucBand == BAND_5G) && (!prAdapter->fgEnable5GBand)) || - (prDomainSubBand->ucBand == BAND_NULL)) { - continue; - } - - - if (ucBufferSize < (P2P_ATTRI_LEN_CHANNEL_ENTRY + prDomainSubBand->ucNumChannels)) { - /* Buffer is not enough to include all supported channels. */ - break; // for - } - - prChannelEntryField->ucRegulatoryClass = prDomainSubBand->ucRegClass; - prChannelEntryField->ucNumberOfChannels = prDomainSubBand->ucNumChannels; - - for (u4IdxII = 0; u4IdxII < prDomainSubBand->ucNumChannels; u4IdxII++) { - prChannelEntryField->aucChannelList[u4IdxII] = prDomainSubBand->ucFirstChannelNum + - (u4IdxII * prDomainSubBand->ucChannelSpan); - -#if 0 - switch (prChannelEntryField->aucChannelList[u4IdxII]) { - case 1: - ucSocialChnlSupport = 1; - break; - case 6: - ucSocialChnlSupport = 6; - break; - case 11: - ucSocialChnlSupport = 11; - break; - default: - break; - } - -#endif - } - - if (ucBufferSize >= (P2P_ATTRI_LEN_CHANNEL_ENTRY + prChannelEntryField->ucNumberOfChannels)) { - ucBufferSize -= (P2P_ATTRI_LEN_CHANNEL_ENTRY + prChannelEntryField->ucNumberOfChannels); - } - else { - break; - } - - - prChannelEntryField = (P_CHANNEL_ENTRY_FIELD_T)((UINT_32)prChannelEntryField + - P2P_ATTRI_LEN_CHANNEL_ENTRY + - (UINT_32)prChannelEntryField->ucNumberOfChannels); - - } - -#if 0 - if (prP2pConnSetting->ucListenChnl == 0) { - prP2pConnSetting->ucListenChnl = P2P_DEFAULT_LISTEN_CHANNEL; - - if (ucSocialChnlSupport != 0) { - /* 1. User Not Set LISTEN channel. - * 2. Social channel is not empty. - */ - prP2pConnSetting->ucListenChnl = ucSocialChnlSupport; - } - } - -#endif - - // TODO: 20110921 frog - - /* If LISTEN channel is not set, - * a random supported channel would be set. - * If no social channel is supported, DEFAULT channel would be set. - */ - - prP2pConnSetting->ucRfChannelListSize = P2P_MAX_SUPPORTED_CHANNEL_LIST_SIZE - ucBufferSize; - -#if 0 - if (prP2pConnSetting->ucOperatingChnl == 0) { /* User not set OPERATE channel. */ - - if (scnQuerySparseChannel(prAdapter, NULL, &ucAutoChnl)) { - break; // while - } - - ucBufferSize = prP2pConnSetting->ucRfChannelListSize; - - prChannelEntryField = (P_CHANNEL_ENTRY_FIELD_T)prP2pConnSetting->aucChannelEntriesField; - - while (ucBufferSize != 0) { - if (prChannelEntryField->ucNumberOfChannels != 0) { - ucAutoChnl = prChannelEntryField->aucChannelList[0]; - break; // while - } - - else { - prChannelEntryField = (P_CHANNEL_ENTRY_FIELD_T)((UINT_32)prChannelEntryField + - P2P_ATTRI_LEN_CHANNEL_ENTRY + - (UINT_32)prChannelEntryField->ucNumberOfChannels); - - ucBufferSize -= (P2P_ATTRI_LEN_CHANNEL_ENTRY + prChannelEntryField->ucNumberOfChannels); - } - - } - - - - } - -#endif - /* We assume user would not set a channel not in the channel list. - * If so, the operating channel still depends on target deivce supporting capability. - */ - - // TODO: 20110921 frog - - /* If the Operating channel is not set, a channel from supported channel list is set automatically. - * If there is no supported channel in channel list, a DEFAULT channel is set. - */ - - } while (FALSE); - -#if 0 - prP2pConnSetting->ucOperatingChnl = ucAutoChnl; -#endif - return; -} /* rlmFuncInitialChannelList */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Find a common channel list from the local channel list info & target channel list info. -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return boolean value if probe response frame is -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmFuncCommonChannelList ( - IN P_ADAPTER_T prAdapter, - IN P_CHANNEL_ENTRY_FIELD_T prChannelEntryII, - IN UINT_8 ucChannelListSize - ) -{ - P_P2P_CONNECTION_SETTINGS_T prP2pConnSetting = (P_P2P_CONNECTION_SETTINGS_T)NULL; - P_CHANNEL_ENTRY_FIELD_T prChannelEntryI = (P_CHANNEL_ENTRY_FIELD_T)NULL, prChannelEntryIII = (P_CHANNEL_ENTRY_FIELD_T)NULL; - UINT_8 aucCommonChannelList[P2P_MAX_SUPPORTED_CHANNEL_LIST_SIZE]; - UINT_8 ucOriChnlSize = 0, ucNewChnlSize = 0; - - - do { - - ASSERT_BREAK(prAdapter != NULL); - - prP2pConnSetting = prAdapter->rWifiVar.prP2PConnSettings; - - prChannelEntryIII = (P_CHANNEL_ENTRY_FIELD_T)aucCommonChannelList; - - while (ucChannelListSize > 0) { - - prChannelEntryI = (P_CHANNEL_ENTRY_FIELD_T)prP2pConnSetting->aucChannelEntriesField; - ucOriChnlSize = prP2pConnSetting->ucRfChannelListSize; - - while (ucOriChnlSize > 0) { - if (prChannelEntryI->ucRegulatoryClass == prChannelEntryII->ucRegulatoryClass) { - prChannelEntryIII->ucRegulatoryClass = prChannelEntryI->ucRegulatoryClass; - // TODO: Currently we assume that the regulatory class the same, the channels are the same. - kalMemCopy(prChannelEntryIII->aucChannelList, prChannelEntryII->aucChannelList, prChannelEntryII->ucNumberOfChannels); - prChannelEntryIII->ucNumberOfChannels = prChannelEntryII->ucNumberOfChannels; - - ucNewChnlSize += P2P_ATTRI_LEN_CHANNEL_ENTRY + prChannelEntryIII->ucNumberOfChannels; - - prChannelEntryIII = (P_CHANNEL_ENTRY_FIELD_T)((UINT_32)prChannelEntryIII + - P2P_ATTRI_LEN_CHANNEL_ENTRY + - (UINT_32)prChannelEntryIII->ucNumberOfChannels); - } - - ucOriChnlSize -= (P2P_ATTRI_LEN_CHANNEL_ENTRY + prChannelEntryI->ucNumberOfChannels); - - prChannelEntryI = (P_CHANNEL_ENTRY_FIELD_T)((UINT_32)prChannelEntryI + - P2P_ATTRI_LEN_CHANNEL_ENTRY + - (UINT_32)prChannelEntryI->ucNumberOfChannels); - - - } - - - ucChannelListSize -= (P2P_ATTRI_LEN_CHANNEL_ENTRY + prChannelEntryII->ucNumberOfChannels); - - prChannelEntryII = (P_CHANNEL_ENTRY_FIELD_T)((UINT_32)prChannelEntryII + - P2P_ATTRI_LEN_CHANNEL_ENTRY + - (UINT_32)prChannelEntryII->ucNumberOfChannels); - - - } - - - kalMemCopy(prP2pConnSetting->aucChannelEntriesField, aucCommonChannelList, ucNewChnlSize); - prP2pConnSetting->ucRfChannelListSize = ucNewChnlSize; - - } while (FALSE); - - return; -} /* rlmFuncCommonChannelList */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -UINT_8 -rlmFuncFindOperatingClass ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucChannelNum - ) -{ - UINT_8 ucRegulatoryClass = 0, ucBufferSize = 0; - P_P2P_CONNECTION_SETTINGS_T prP2pConnSetting = (P_P2P_CONNECTION_SETTINGS_T)NULL; - P_CHANNEL_ENTRY_FIELD_T prChannelEntryField = (P_CHANNEL_ENTRY_FIELD_T)NULL; - UINT_32 u4Idx = 0; - - do { - ASSERT_BREAK(prAdapter != NULL); - - prP2pConnSetting = prAdapter->rWifiVar.prP2PConnSettings; - ucBufferSize = prP2pConnSetting->ucRfChannelListSize; - prChannelEntryField = (P_CHANNEL_ENTRY_FIELD_T)prP2pConnSetting->aucChannelEntriesField; - - while (ucBufferSize != 0) { - - for (u4Idx = 0; u4Idx < prChannelEntryField->ucNumberOfChannels; u4Idx++) { - if (prChannelEntryField->aucChannelList[u4Idx] == ucChannelNum) { - ucRegulatoryClass = prChannelEntryField->ucRegulatoryClass; - break; - } - - } - - - if (ucRegulatoryClass != 0) { - break; //while - } - else { - prChannelEntryField = (P_CHANNEL_ENTRY_FIELD_T)((UINT_32)prChannelEntryField + - P2P_ATTRI_LEN_CHANNEL_ENTRY + - (UINT_32)prChannelEntryField->ucNumberOfChannels); - - ucBufferSize -= (P2P_ATTRI_LEN_CHANNEL_ENTRY + prChannelEntryField->ucNumberOfChannels); - } - - } - - - } while (FALSE); - - return ucRegulatoryClass; -} /* rlmFuncFindOperatingClass */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rlmFuncFindAvailableChannel ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucCheckChnl, - IN PUINT_8 pucSuggestChannel, - IN BOOLEAN fgIsSocialChannel, - IN BOOLEAN fgIsDefaultChannel - ) -{ - BOOLEAN fgIsResultAvailable = FALSE; - P_CHANNEL_ENTRY_FIELD_T prChannelEntry = (P_CHANNEL_ENTRY_FIELD_T)NULL; - P_P2P_CONNECTION_SETTINGS_T prP2pConnSetting = (P_P2P_CONNECTION_SETTINGS_T)NULL; - UINT_8 ucBufferSize = 0, ucIdx = 0, ucChannelSelected = 0; - - do { - ASSERT_BREAK(prAdapter != NULL); - - if (fgIsDefaultChannel) { - ucChannelSelected = P2P_DEFAULT_LISTEN_CHANNEL; - } - - - prP2pConnSetting = prAdapter->rWifiVar.prP2PConnSettings; - ucBufferSize = prP2pConnSetting->ucRfChannelListSize; - prChannelEntry = (P_CHANNEL_ENTRY_FIELD_T)prP2pConnSetting->aucChannelEntriesField; - - while ((ucBufferSize != 0) && (!fgIsResultAvailable)) { - - for (ucIdx = 0; ucIdx < prChannelEntry->ucNumberOfChannels; ucIdx++) { - if ((!fgIsSocialChannel) || - (prChannelEntry->aucChannelList[ucIdx] == 1) || - (prChannelEntry->aucChannelList[ucIdx] == 6) || - (prChannelEntry->aucChannelList[ucIdx] == 11)) { - - if (prChannelEntry->aucChannelList[ucIdx] <= 11) { - /* 2.4G. */ - ucChannelSelected = prChannelEntry->aucChannelList[ucIdx]; - } - else if ((prChannelEntry->aucChannelList[ucIdx] < 52) && - (prChannelEntry->aucChannelList[ucIdx] > 14)) { - /* 2.4G + 5G. */ - ucChannelSelected = prChannelEntry->aucChannelList[ucIdx]; - } - - if (ucChannelSelected == ucCheckChnl) { - fgIsResultAvailable = TRUE; - break; - } - } - - } - - - ucBufferSize -= (P2P_ATTRI_LEN_CHANNEL_ENTRY + prChannelEntry->ucNumberOfChannels); - - prChannelEntry = (P_CHANNEL_ENTRY_FIELD_T)((UINT_32)prChannelEntry + - P2P_ATTRI_LEN_CHANNEL_ENTRY + - (UINT_32)prChannelEntry->ucNumberOfChannels); - - } - - - - if ((!fgIsResultAvailable) && (pucSuggestChannel != NULL)) { - DBGLOG(P2P, TRACE, ("The request channel %d is not available, sugguested channel:%d\n", ucCheckChnl, ucChannelSelected)); - // Given a suggested channel. - *pucSuggestChannel = ucChannelSelected; - } - - - } while (FALSE); - - return fgIsResultAvailable; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -ENUM_CHNL_EXT_T -rlmDecideScoForAP ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ) -{ - P_DOMAIN_SUBBAND_INFO prSubband; - P_DOMAIN_INFO_ENTRY prDomainInfo; - UINT_8 ucSecondChannel, i, j; - ENUM_CHNL_EXT_T eSCO; - - eSCO = CHNL_EXT_SCN; - - if (prBssInfo->eBand == BAND_2G4) { - if (prBssInfo->ucPrimaryChannel != 14) { - eSCO = (prBssInfo->ucPrimaryChannel > 7) ? - CHNL_EXT_SCB : CHNL_EXT_SCA; - } - } - else { - prDomainInfo = rlmDomainGetDomainInfo(prAdapter); - ASSERT(prDomainInfo); - - for (i = 0; i < MAX_SUBBAND_NUM; i++) { - prSubband = &prDomainInfo->rSubBand[i]; - if (prSubband->ucBand == prBssInfo->eBand) { - for (j = 0; j < prSubband->ucNumChannels; j++) { - if ((prSubband->ucFirstChannelNum + j*prSubband->ucChannelSpan) - == prBssInfo->ucPrimaryChannel) { - eSCO = (j & 1) ? CHNL_EXT_SCB : CHNL_EXT_SCA; - break; - } - } - - if (j < prSubband->ucNumChannels) { - break; /* Found */ - } - } - } - } - - /* Check if it is boundary channel and 40MHz BW is permitted */ - if (eSCO != CHNL_EXT_SCN) { - ucSecondChannel = (eSCO == CHNL_EXT_SCA) ? - (prBssInfo->ucPrimaryChannel+ 4) : (prBssInfo->ucPrimaryChannel- 4); - - if (!rlmDomainIsLegalChannel(prAdapter, prBssInfo->eBand, ucSecondChannel)){ - eSCO = CHNL_EXT_SCN; - } - } - - return eSCO; -} - diff --git a/drivers/net/wireless/mt5931/mgmt/p2p_rlm_obss.c b/drivers/net/wireless/mt5931/mgmt/p2p_rlm_obss.c deleted file mode 100755 index f9045373157b..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/p2p_rlm_obss.c +++ /dev/null @@ -1,374 +0,0 @@ -/* -** $Id: @(#) gl_p2p_cfg80211.c@@ -*/ - -/*! \file gl_p2p_cfg80211.c - \brief Main routines of Linux driver interface for Wi-Fi Direct - using cfg80211 interface - - This file contains the main routines of Linux driver for MediaTek Inc. 802.11 - Wireless LAN Adapters. -*/ - - - - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - - -#include "precomp.h" - - -static UINT_8 -rlmObssChnlLevelIn2G4 ( - P_BSS_INFO_T prBssInfo, - UINT_8 ucPriChannel, - ENUM_CHNL_EXT_T eExtend - ); - -static UINT_8 -rlmObssChnlLevelIn5G ( - P_BSS_INFO_T prBssInfo, - UINT_8 ucPriChannel, - ENUM_CHNL_EXT_T eExtend - ); - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Different concurrent network has itself channel lists, and -* concurrent networks should have been recorded in channel lists. -* If role of active P2P is GO, assume associated AP of AIS will -* record our Beacon for P2P GO because of same channel. -* -* Note: If we have scenario of different channel in the future, -* the internal FW communication channel shall be established. -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -UINT_8 -rlmObssChnlLevel ( - P_BSS_INFO_T prBssInfo, - ENUM_BAND_T eBand, - UINT_8 ucPriChannel, - ENUM_CHNL_EXT_T eExtend - ) -{ - UINT_8 ucChannelLevel; - - ASSERT(prBssInfo); - - if (eBand == BAND_2G4) { - ucChannelLevel = rlmObssChnlLevelIn2G4(prBssInfo, ucPriChannel,eExtend); - - /* (TBD) If concurrent networks permit different channel, extra - * channel judgement should be added. Please refer to - * previous version of this file. - */ - } - else if (eBand == BAND_5G) { - ucChannelLevel = rlmObssChnlLevelIn5G(prBssInfo, ucPriChannel,eExtend); - - /* (TBD) If concurrent networks permit different channel, extra - * channel judgement should be added. Please refer to - * previous version of this file. - */ - } - else { - ucChannelLevel = CHNL_LEVEL0; - } - - return ucChannelLevel; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -static UINT_8 -rlmObssChnlLevelIn2G4 ( - P_BSS_INFO_T prBssInfo, - UINT_8 ucPriChannel, - ENUM_CHNL_EXT_T eExtend - ) -{ - UINT_8 i, ucChannelLevel; - UINT_8 ucSecChannel, ucCenterChannel; - UINT_8 ucAffectedChnl_L, ucAffectedChnl_H; - - ASSERT(prBssInfo); - - ucChannelLevel = CHNL_LEVEL2; - - /* Calculate center channel for 2.4G band */ - if (eExtend == CHNL_EXT_SCA) { - ucCenterChannel = ucPriChannel + 2; - ucSecChannel = ucPriChannel + 4; - } - else if (eExtend == CHNL_EXT_SCB) { - ucCenterChannel = ucPriChannel - 2; - ucSecChannel = ucPriChannel - 4; - } - else { - return CHNL_LEVEL0; - } - ASSERT(ucCenterChannel >= 1 && ucCenterChannel <= 14); - - /* Calculated low/upper channels in affected freq range */ - ucAffectedChnl_L = (ucCenterChannel <= AFFECTED_CHNL_OFFSET) ? - 1 : (ucCenterChannel - AFFECTED_CHNL_OFFSET); - - ucAffectedChnl_H = (ucCenterChannel >= (14 - AFFECTED_CHNL_OFFSET)) ? - 14 : (ucCenterChannel + AFFECTED_CHNL_OFFSET); - - - /* Check intolerant (Non-HT) channel list */ - ASSERT(prBssInfo->auc2G_NonHtChnlList[0] <= CHNL_LIST_SZ_2G); - for (i = 1; i <= prBssInfo->auc2G_NonHtChnlList[0] && - i <= CHNL_LIST_SZ_2G; i++) { - if ((prBssInfo->auc2G_NonHtChnlList[i] >= ucAffectedChnl_L && - prBssInfo->auc2G_NonHtChnlList[i] <= ucAffectedChnl_H) && - prBssInfo->auc2G_NonHtChnlList[i] != ucPriChannel) { - - ucChannelLevel = CHNL_LEVEL0; - goto L_2G4_level_end; - } - } - - /* Check 20M BW request channel list */ - ASSERT(prBssInfo->auc2G_20mReqChnlList[0] <= CHNL_LIST_SZ_2G); - for (i = 1; i <= prBssInfo->auc2G_20mReqChnlList[0] && - i <= CHNL_LIST_SZ_2G; i++) { - if ((prBssInfo->auc2G_20mReqChnlList[i] >= ucAffectedChnl_L && - prBssInfo->auc2G_20mReqChnlList[i] <= ucAffectedChnl_H)) { - - ucChannelLevel = CHNL_LEVEL0; - goto L_2G4_level_end; - } - } - - /* Check 2.4G primary channel list */ - ASSERT(prBssInfo->auc2G_PriChnlList[0] <= CHNL_LIST_SZ_2G); - for (i = 1; i <= prBssInfo->auc2G_PriChnlList[0] && - i <= CHNL_LIST_SZ_2G; i++) { - if ((prBssInfo->auc2G_PriChnlList[i] >= ucAffectedChnl_L && - prBssInfo->auc2G_PriChnlList[i] <= ucAffectedChnl_H) && - prBssInfo->auc2G_PriChnlList[i] != ucPriChannel) { - - ucChannelLevel = CHNL_LEVEL0; - goto L_2G4_level_end; - } - } - - /* Check 2.4G secondary channel list */ - ASSERT(prBssInfo->auc2G_SecChnlList[0] <= CHNL_LIST_SZ_2G); - for (i = 1; i <= prBssInfo->auc2G_SecChnlList[0] && - i <= CHNL_LIST_SZ_2G; i++) { - if ((prBssInfo->auc2G_SecChnlList[i] >= ucAffectedChnl_L && - prBssInfo->auc2G_SecChnlList[i] <= ucAffectedChnl_H) && - prBssInfo->auc2G_SecChnlList[i] != ucSecChannel) { - - ucChannelLevel = CHNL_LEVEL0; - goto L_2G4_level_end; - } - } - -L_2G4_level_end: - - return ucChannelLevel; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -static UINT_8 -rlmObssChnlLevelIn5G ( - P_BSS_INFO_T prBssInfo, - UINT_8 ucPriChannel, - ENUM_CHNL_EXT_T eExtend - ) -{ - UINT_8 i, ucChannelLevel; - UINT_8 ucSecChannel; - - ASSERT(prBssInfo); - - ucChannelLevel = CHNL_LEVEL2; - - /* Calculate center channel for 2.4G band */ - if (eExtend == CHNL_EXT_SCA) { - ucSecChannel = ucPriChannel + 4; - } - else if (eExtend == CHNL_EXT_SCB) { - ucSecChannel = ucPriChannel - 4; - } - else { - return CHNL_LEVEL0; - } - ASSERT(ucSecChannel >= 36); - - /* Check 5G primary channel list */ - ASSERT(prBssInfo->auc5G_PriChnlList[0] <= CHNL_LIST_SZ_5G); - for (i = 1; i <= prBssInfo->auc5G_PriChnlList[0] && - i <= CHNL_LIST_SZ_5G; i++) { - if (prBssInfo->auc5G_PriChnlList[i] == ucSecChannel) { - - ucChannelLevel = CHNL_LEVEL0; - goto L_5G_level_end; - } - else if (prBssInfo->auc5G_PriChnlList[i] == ucPriChannel) { - ucChannelLevel = CHNL_LEVEL1; - } - } - - /* Check non-HT channel list */ - ASSERT(prBssInfo->auc5G_NonHtChnlList[0] <= CHNL_LIST_SZ_5G); - for (i = 1; i <= prBssInfo->auc5G_NonHtChnlList[0] && - i <= CHNL_LIST_SZ_5G; i++) { - if (prBssInfo->auc5G_NonHtChnlList[i] == ucSecChannel) { - - ucChannelLevel = CHNL_LEVEL0; - goto L_5G_level_end; - } - else if (prBssInfo->auc5G_NonHtChnlList[i] == ucPriChannel) { - ucChannelLevel = CHNL_LEVEL1; - } - } - - /* Check secondary channel list */ - ASSERT(prBssInfo->auc5G_SecChnlList[0] <= CHNL_LIST_SZ_5G); - for (i = 1; i <= prBssInfo->auc5G_SecChnlList[0] && - i <= CHNL_LIST_SZ_5G; i++) { - if (prBssInfo->auc5G_SecChnlList[i] == ucPriChannel) { - - ucChannelLevel = CHNL_LEVEL0; - goto L_5G_level_end; - } - } - -L_5G_level_end: - - return ucChannelLevel; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmObssScanExemptionRsp ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - P_SW_RFB_T prSwRfb - ) -{ - P_MSDU_INFO_T prMsduInfo; - P_ACTION_20_40_COEXIST_FRAME prTxFrame; - - /* To do: need an algorithm to do judgement. Now always reject request */ - - prMsduInfo = (P_MSDU_INFO_T) - cnmMgtPktAlloc(prAdapter, PUBLIC_ACTION_MAX_LEN); - if (prMsduInfo == NULL) { - return; - } - - DBGLOG(RLM, INFO, ("Send 20/40 coexistence rsp frame!\n")); - - prTxFrame = (P_ACTION_20_40_COEXIST_FRAME) prMsduInfo->prPacket; - - prTxFrame->u2FrameCtrl = MAC_FRAME_ACTION; - COPY_MAC_ADDR(prTxFrame->aucDestAddr, - ((P_ACTION_20_40_COEXIST_FRAME) prSwRfb->pvHeader)->aucSrcAddr); - COPY_MAC_ADDR(prTxFrame->aucSrcAddr, prBssInfo->aucOwnMacAddr); - COPY_MAC_ADDR(prTxFrame->aucBSSID, prBssInfo->aucBSSID); - - prTxFrame->ucCategory = CATEGORY_PUBLIC_ACTION; - prTxFrame->ucAction = ACTION_PUBLIC_20_40_COEXIST; - - /* To do: find correct algorithm */ - prTxFrame->rBssCoexist.ucId = ELEM_ID_20_40_BSS_COEXISTENCE; - prTxFrame->rBssCoexist.ucLength = 1; - prTxFrame->rBssCoexist.ucData = 0; - - ASSERT((WLAN_MAC_HEADER_LEN + 5) <= PUBLIC_ACTION_MAX_LEN); - - prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_MGMT; - prMsduInfo->ucStaRecIndex =prSwRfb->ucStaRecIdx; - prMsduInfo->ucNetworkType = prBssInfo->ucNetTypeIndex; - prMsduInfo->ucMacHeaderLength = WLAN_MAC_MGMT_HEADER_LEN; - prMsduInfo->fgIs802_1x = FALSE; - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = WLAN_MAC_MGMT_HEADER_HTC_LEN + 5; - prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMsduInfo->pfTxDoneHandler = NULL; - prMsduInfo->fgIsBasicRate = FALSE; - - /* Send them to HW queue */ - nicTxEnqueueMsdu(prAdapter, prMsduInfo); -} - - - diff --git a/drivers/net/wireless/mt5931/mgmt/p2p_scan.c b/drivers/net/wireless/mt5931/mgmt/p2p_scan.c deleted file mode 100755 index 6e7a18e87aa0..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/p2p_scan.c +++ /dev/null @@ -1,831 +0,0 @@ -/* -** $Id: @(#) p2p_scan.c@@ -*/ - -/*! \file "p2p_scan.c" - \brief This file defines the p2p scan profile and the processing function of - scan result for SCAN Module. - - The SCAN Profile selection is part of SCAN MODULE and responsible for defining - SCAN Parameters - e.g. MIN_CHANNEL_TIME, number of scan channels. - In this file we also define the process of SCAN Result including adding, searching - and removing SCAN record from the list. -*/ - - - - - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -P_P2P_DEVICE_DESC_T -scanSearchTargetP2pDesc ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucDeviceID[], - IN PP_BSS_DESC_T pprBssDesc - ) -{ - - P_P2P_DEVICE_DESC_T prTargetP2pDesc = (P_P2P_DEVICE_DESC_T)NULL; - P_SCAN_INFO_T prScanInfo = (P_SCAN_INFO_T)NULL; - P_LINK_T prBSSDescList; - P_BSS_DESC_T prBssDesc = (P_BSS_DESC_T)NULL; - - - ASSERT(prAdapter); - ASSERT(aucDeviceID); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prBSSDescList = &prScanInfo->rBSSDescList; - - //4 <1> The outer loop to search for a candidate. - LINK_FOR_EACH_ENTRY(prBssDesc, prBSSDescList, rLinkEntry, BSS_DESC_T) { - - /* Loop for each prBssDesc */ - prTargetP2pDesc = scanFindP2pDeviceDesc(prAdapter, - prBssDesc, - aucDeviceID, - TRUE, - FALSE); - - if (prTargetP2pDesc != NULL) { - break; - } - } - - if ((pprBssDesc) && (prTargetP2pDesc != NULL)) { - /* Only valid if prTargetP2pDesc is not NULL. */ - *pprBssDesc = prBssDesc; - } - - return prTargetP2pDesc; -} /* scanSearchTargetP2pDesc */ - - - - -VOID -scanInvalidAllP2pClientDevice ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc - ) -{ - P_LINK_ENTRY_T prLinkEntry = (P_LINK_ENTRY_T)NULL; - P_P2P_DEVICE_DESC_T prTargetDesc = (P_P2P_DEVICE_DESC_T)NULL; - - LINK_FOR_EACH(prLinkEntry, &prBssDesc->rP2pDeviceList) { - prTargetDesc = LINK_ENTRY(prLinkEntry, P2P_DEVICE_DESC_T, rLinkEntry); - - if (prTargetDesc->fgDevInfoValid) { - prTargetDesc->fgDevInfoValid = FALSE; - } - } - - return; -} /* scanRenewP2pClientDevice */ - -VOID -scanRemoveInvalidP2pClientDevice ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc - ) -{ - P_LINK_ENTRY_T prLinkEntry = (P_LINK_ENTRY_T)NULL, prNexEntry = (P_LINK_ENTRY_T)NULL; - P_P2P_DEVICE_DESC_T prTargetDesc = (P_P2P_DEVICE_DESC_T)NULL; - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL; - - prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - - LINK_FOR_EACH_SAFE(prLinkEntry, prNexEntry, &prBssDesc->rP2pDeviceList) { - prTargetDesc = LINK_ENTRY(prLinkEntry, P2P_DEVICE_DESC_T, rLinkEntry); - - if (!prTargetDesc->fgDevInfoValid) { - LINK_REMOVE_KNOWN_ENTRY(&prBssDesc->rP2pDeviceList, prLinkEntry); - if ((prP2pConnSettings) && - (prP2pConnSettings->prTargetP2pDesc == prTargetDesc)) { - prP2pConnSettings->prTargetP2pDesc = NULL; - } - kalMemFree(prTargetDesc, VIR_MEM_TYPE, sizeof(P2P_DEVICE_DESC_T)); - } - } - - return; -} /* scanRenewP2pClientDevice */ - - - -P_P2P_DEVICE_DESC_T -scanFindP2pDeviceDesc ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc, - IN UINT_8 aucMacAddr[], - IN BOOLEAN fgIsDeviceAddr, - IN BOOLEAN fgAddIfNoFound - ) -{ - - P_P2P_DEVICE_DESC_T prTargetDesc = (P_P2P_DEVICE_DESC_T)NULL; - P_LINK_ENTRY_T prLinkEntry = (P_LINK_ENTRY_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && - (prBssDesc != NULL) && - (aucMacAddr != NULL)); - - LINK_FOR_EACH(prLinkEntry, &prBssDesc->rP2pDeviceList) { - prTargetDesc = LINK_ENTRY(prLinkEntry, P2P_DEVICE_DESC_T, rLinkEntry); - - if (fgIsDeviceAddr) { - if (EQUAL_MAC_ADDR(prTargetDesc->aucDeviceAddr, aucMacAddr)) { - break; - } - } - else { - if (EQUAL_MAC_ADDR(prTargetDesc->aucInterfaceAddr, aucMacAddr)) { - break; - } - } - - prTargetDesc = NULL; - } - - if ((fgAddIfNoFound) && (prTargetDesc == NULL)) { - /* Target Not Found. */ - // TODO: Use memory pool in the future. - prTargetDesc = kalMemAlloc(sizeof(P2P_DEVICE_DESC_T), VIR_MEM_TYPE); - - if (prTargetDesc) { - kalMemZero(prTargetDesc, sizeof(P2P_DEVICE_DESC_T)); - LINK_ENTRY_INITIALIZE(&(prTargetDesc->rLinkEntry)); - COPY_MAC_ADDR(prTargetDesc->aucDeviceAddr, aucMacAddr); - LINK_INSERT_TAIL(&prBssDesc->rP2pDeviceList, &prTargetDesc->rLinkEntry); - prTargetDesc->fgDevInfoValid = TRUE; - } - else { - ASSERT(FALSE); - } - } - - } while (FALSE); - - return prTargetDesc; -} /* scanFindP2pDeviceDesc */ - - -P_P2P_DEVICE_DESC_T -scanGetP2pDeviceDesc ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc - ) -{ - - P_P2P_DEVICE_DESC_T prTargetDesc = (P_P2P_DEVICE_DESC_T)NULL; - - ASSERT(prAdapter); - ASSERT(prBssDesc); - - if (prBssDesc->prP2pDesc == NULL) { - - prTargetDesc = kalMemAlloc(sizeof(P2P_DEVICE_DESC_T), VIR_MEM_TYPE); - - if (prTargetDesc) { - kalMemZero(prTargetDesc, sizeof(P2P_DEVICE_DESC_T)); - LINK_ENTRY_INITIALIZE(&(prTargetDesc->rLinkEntry)); - LINK_INSERT_TAIL(&prBssDesc->rP2pDeviceList, &prTargetDesc->rLinkEntry); - prTargetDesc->fgDevInfoValid = TRUE; - prBssDesc->prP2pDesc = prTargetDesc; - /* We are not sure the SrcAddr is Device Address or Interface Address. */ - COPY_MAC_ADDR(prTargetDesc->aucDeviceAddr, prBssDesc->aucSrcAddr); - COPY_MAC_ADDR(prTargetDesc->aucInterfaceAddr, prBssDesc->aucSrcAddr); - } - else { - - ASSERT(FALSE); - } - } - else { - prTargetDesc = prBssDesc->prP2pDesc; - } - - - return prTargetDesc; - -} /* scanFindP2pDeviceDesc */ - - -#if 0 -/*----------------------------------------------------------------------------*/ -/*! -* @brief Convert the Beacon or ProbeResp Frame in SW_RFB_T to Event Packet -* -* @param[in] prSwRfb Pointer to the receiving SW_RFB_T structure. -* -* @retval WLAN_STATUS_SUCCESS It is a valid Scan Result and been sent to the host. -* @retval WLAN_STATUS_FAILURE It is not a valid Scan Result. -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -scanUpdateP2pDeviceDesc ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc - ) -{ - P_P2P_DEVICE_DESC_T prP2pDesc = (P_P2P_DEVICE_DESC_T)NULL; - P_P2P_ATTRIBUTE_T prP2pAttribute = (P_P2P_ATTRIBUTE_T)NULL; - UINT_16 u2AttributeLen = 0; - UINT_32 u4Idx = 0; - BOOLEAN fgUpdateDevInfo = FALSE; - - P_DEVICE_NAME_TLV_T prP2pDevName = (P_DEVICE_NAME_TLV_T)NULL; - P_P2P_ATTRI_GROUP_INFO_T prP2pAttriGroupInfo = (P_P2P_ATTRI_GROUP_INFO_T)NULL; - - ASSERT(prAdapter); - - prP2pDesc = scanGetP2pDeviceDesc(prAdapter, prBssDesc); - - if (!prP2pDesc) { - ASSERT(FALSE); - return fgUpdateDevInfo; - } - - p2pGetP2PAttriList(prAdapter, prBssDesc->aucIEBuf, prBssDesc->u2IELength, (PPUINT_8)&prP2pAttribute, &u2AttributeLen); - - while (u2AttributeLen >= P2P_ATTRI_HDR_LEN) { - switch (prP2pAttribute->ucId) { - case P2P_ATTRI_ID_P2P_CAPABILITY: /* Beacon, Probe Response */ - { - P_P2P_ATTRI_CAPABILITY_T prP2pAttriCapability = (P_P2P_ATTRI_CAPABILITY_T)NULL; - - prP2pAttriCapability = (P_P2P_ATTRI_CAPABILITY_T)prP2pAttribute; - ASSERT(prP2pAttriCapability->u2Length == 2); - - prP2pDesc->ucDeviceCapabilityBitmap = prP2pAttriCapability->ucDeviceCap; - prP2pDesc->ucGroupCapabilityBitmap = prP2pAttriCapability->ucGroupCap; - } - break; - case P2P_ATTRI_ID_P2P_DEV_ID: /* Beacon */ - { - P_P2P_ATTRI_DEV_ID_T prP2pAttriDevID = (P_P2P_ATTRI_DEV_ID_T)NULL; - - prP2pAttriDevID = (P_P2P_ATTRI_DEV_ID_T)prP2pAttribute; - ASSERT(prP2pAttriDevID->u2Length == P2P_ATTRI_MAX_LEN_P2P_DEV_ID); - - kalMemCopy(prP2pDesc->aucDeviceAddr, prP2pAttriDevID->aucDevAddr, MAC_ADDR_LEN); - } - break; - case P2P_ATTRI_ID_P2P_DEV_INFO: /* Probe Response */ - { - P_P2P_ATTRI_DEV_INFO_T prP2pAttriDevInfo = (P_P2P_ATTRI_DEV_INFO_T)NULL; - P_P2P_DEVICE_TYPE_T prP2pDevType = (P_P2P_DEVICE_TYPE_T)NULL; - UINT_16 u2NameLen = 0, u2Id = 0; - - fgUpdateDevInfo = TRUE; - - prP2pAttriDevInfo = (P_P2P_ATTRI_DEV_INFO_T)prP2pAttribute; - - kalMemCopy(prP2pDesc->aucDeviceAddr, prP2pAttriDevInfo->aucDevAddr, MAC_ADDR_LEN); - - WLAN_GET_FIELD_BE16(&prP2pAttriDevInfo->u2ConfigMethodsBE, &prP2pDesc->u2ConfigMethod); - - prP2pDevType = &prP2pDesc->rPriDevType; - WLAN_GET_FIELD_BE16(&prP2pAttriDevInfo->rPrimaryDevTypeBE.u2CategoryId, &prP2pDevType->u2CategoryID); - WLAN_GET_FIELD_BE16(&prP2pAttriDevInfo->rPrimaryDevTypeBE.u2SubCategoryId, &prP2pDevType->u2SubCategoryID); - - ASSERT(prP2pAttriDevInfo->ucNumOfSecondaryDevType <= P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT); // TODO: Fixme if secondary device type is more than 2. - prP2pDesc->ucSecDevTypeNum = 0; - for (u4Idx = 0; u4Idx < prP2pAttriDevInfo->ucNumOfSecondaryDevType; u4Idx++) { - if (u4Idx < P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT) { - prP2pDevType = &(prP2pDesc->arSecDevType[u4Idx]); - WLAN_GET_FIELD_BE16(&prP2pAttriDevInfo->arSecondaryDevTypeListBE[u4Idx].u2CategoryId, &prP2pDevType->u2CategoryID); - WLAN_GET_FIELD_BE16(&prP2pAttriDevInfo->arSecondaryDevTypeListBE[u4Idx].u2SubCategoryId, &prP2pDevType->u2SubCategoryID); - prP2pDesc->ucSecDevTypeNum++; - } - - } - prP2pDevName = (P_DEVICE_NAME_TLV_T)((PUINT_8)prP2pAttriDevInfo->arSecondaryDevTypeListBE + (u4Idx * sizeof(DEVICE_TYPE_T))); - WLAN_GET_FIELD_BE16(&prP2pDevName->u2Length, &u2NameLen); - WLAN_GET_FIELD_BE16(&prP2pDevName->u2Id, &u2Id); - ASSERT(u2Id == WPS_ATTRI_ID_DEVICE_NAME); - if (u2NameLen > WPS_ATTRI_MAX_LEN_DEVICE_NAME) { - u2NameLen = WPS_ATTRI_MAX_LEN_DEVICE_NAME; - } - prP2pDesc->u2NameLength = u2NameLen; - kalMemCopy(prP2pDesc->aucName, prP2pDevName->aucName, prP2pDesc->u2NameLength); - } - break; - case P2P_ATTRI_ID_P2P_GROUP_INFO: /* Probe Response */ - prP2pAttriGroupInfo = (P_P2P_ATTRI_GROUP_INFO_T)prP2pAttribute; - break; - case P2P_ATTRI_ID_NOTICE_OF_ABSENCE: - break; - case P2P_ATTRI_ID_EXT_LISTEN_TIMING: - // TODO: Not implement yet. - //ASSERT(FALSE); - break; - default: - break; - } - - u2AttributeLen -= (prP2pAttribute->u2Length + P2P_ATTRI_HDR_LEN); - - prP2pAttribute = (P_P2P_ATTRIBUTE_T)((UINT_32)prP2pAttribute + (prP2pAttribute->u2Length + P2P_ATTRI_HDR_LEN)); - - } - - - if (prP2pAttriGroupInfo != NULL) { - P_P2P_CLIENT_INFO_DESC_T prClientInfoDesc = (P_P2P_CLIENT_INFO_DESC_T)NULL; - P_P2P_DEVICE_TYPE_T prP2pDevType = (P_P2P_DEVICE_TYPE_T)NULL; - - scanInvalidAllP2pClientDevice(prAdapter, prBssDesc); - - /* GO/Device itself. */ - prP2pDesc->fgDevInfoValid = TRUE; - - prClientInfoDesc = (P_P2P_CLIENT_INFO_DESC_T)prP2pAttriGroupInfo->arClientDesc; - u2AttributeLen = prP2pAttriGroupInfo->u2Length; - - - while (u2AttributeLen > 0) { - prP2pDesc = scanFindP2pDeviceDesc(prAdapter, prBssDesc, prClientInfoDesc->aucDevAddr, TRUE, TRUE); - - if (!prP2pDesc) { - ASSERT(FALSE); - break; /* while */ - } - - prP2pDesc->fgDevInfoValid = TRUE; - - /* Basic size for P2P client info descriptor. */ - ASSERT(u2AttributeLen >= 25); - if (u2AttributeLen < 25) { - DBGLOG(P2P, WARN, ("Length incorrect warning.\n")); - break; - } - COPY_MAC_ADDR(prP2pDesc->aucInterfaceAddr, prClientInfoDesc->aucIfAddr); - - prP2pDesc->ucDeviceCapabilityBitmap = prClientInfoDesc->ucDeviceCap; - - WLAN_GET_FIELD_BE16(&prClientInfoDesc->u2ConfigMethodsBE, &prP2pDesc->u2ConfigMethod); - - prP2pDevType = &(prP2pDesc->rPriDevType); - WLAN_GET_FIELD_BE16(&prClientInfoDesc->rPrimaryDevTypeBE.u2CategoryId, &prP2pDevType->u2CategoryID); - WLAN_GET_FIELD_BE16(&prClientInfoDesc->rPrimaryDevTypeBE.u2SubCategoryId, &prP2pDevType->u2SubCategoryID); - - ASSERT(prClientInfoDesc->ucNumOfSecondaryDevType <= P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT); - prP2pDesc->ucSecDevTypeNum = 0; - for (u4Idx = 0; u4Idx < prClientInfoDesc->ucNumOfSecondaryDevType; u4Idx++) { - if (u4Idx < P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT) { - prP2pDevType = &(prP2pDesc->arSecDevType[u4Idx]); - WLAN_GET_FIELD_BE16(&prClientInfoDesc->arSecondaryDevTypeListBE[u4Idx].u2CategoryId, &prP2pDevType->u2CategoryID); - WLAN_GET_FIELD_BE16(&prClientInfoDesc->arSecondaryDevTypeListBE[u4Idx].u2SubCategoryId, &prP2pDevType->u2SubCategoryID); - prP2pDesc->ucSecDevTypeNum++; - } - - } - prP2pDevName = (P_DEVICE_NAME_TLV_T)(prClientInfoDesc->arSecondaryDevTypeListBE + (u4Idx * sizeof(DEVICE_TYPE_T))); - WLAN_GET_FIELD_BE16(&prP2pDevName->u2Length, &prP2pDesc->u2NameLength); - if (prP2pDesc->u2NameLength > WPS_ATTRI_MAX_LEN_DEVICE_NAME) { - prP2pDesc->u2NameLength = WPS_ATTRI_MAX_LEN_DEVICE_NAME; - } - - kalMemCopy(prP2pDesc->aucName, prP2pDevName->aucName, prP2pDesc->u2NameLength); - - u2AttributeLen -= (prClientInfoDesc->ucLength + P2P_CLIENT_INFO_DESC_HDR_LEN); - prClientInfoDesc = (P_P2P_CLIENT_INFO_DESC_T)((UINT_32)prClientInfoDesc + (UINT_32)prClientInfoDesc->ucLength + P2P_CLIENT_INFO_DESC_HDR_LEN); - } - - scanRemoveInvalidP2pClientDevice(prAdapter, prBssDesc); - } - - return fgUpdateDevInfo; -} /* end of scanAddP2pDeviceInfo() */ - -#endif - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Convert the Beacon or ProbeResp Frame in SW_RFB_T to Event Packet -* -* @param[in] prSwRfb Pointer to the receiving SW_RFB_T structure. -* -* @retval WLAN_STATUS_SUCCESS It is a valid Scan Result and been sent to the host. -* @retval WLAN_STATUS_FAILURE It is not a valid Scan Result. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -scanSendDeviceDiscoverEvent ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc, - IN P_SW_RFB_T prSwRfb - ) -{ - EVENT_P2P_DEV_DISCOVER_RESULT_T rEventDevInfo; -#if 1 - P_LINK_ENTRY_T prLinkEntry = (P_LINK_ENTRY_T)NULL; - P_P2P_DEVICE_DESC_T prTargetDesc = (P_P2P_DEVICE_DESC_T)NULL; - - LINK_FOR_EACH(prLinkEntry, &prBssDesc->rP2pDeviceList) { - prTargetDesc = LINK_ENTRY(prLinkEntry, P2P_DEVICE_DESC_T, rLinkEntry); - - COPY_MAC_ADDR(rEventDevInfo.aucDeviceAddr, prTargetDesc->aucDeviceAddr); - COPY_MAC_ADDR(rEventDevInfo.aucInterfaceAddr, prTargetDesc->aucInterfaceAddr); - - rEventDevInfo.ucDeviceCapabilityBitmap = prTargetDesc->ucDeviceCapabilityBitmap; - rEventDevInfo.ucGroupCapabilityBitmap = prTargetDesc->ucGroupCapabilityBitmap; - rEventDevInfo.u2ConfigMethod = prTargetDesc->u2ConfigMethod; - - kalMemCopy(&rEventDevInfo.rPriDevType, - &prTargetDesc->rPriDevType, - sizeof(P2P_DEVICE_TYPE_T)); - - kalMemCopy(rEventDevInfo.arSecDevType, - prTargetDesc->arSecDevType, - (prTargetDesc->ucSecDevTypeNum * sizeof(P2P_DEVICE_TYPE_T))); - - rEventDevInfo.ucSecDevTypeNum = prTargetDesc->ucSecDevTypeNum; - - rEventDevInfo.u2NameLength = prTargetDesc->u2NameLength; - kalMemCopy(rEventDevInfo.aucName, - prTargetDesc->aucName, - prTargetDesc->u2NameLength); - - COPY_MAC_ADDR(rEventDevInfo.aucBSSID, prBssDesc->aucBSSID); - - if (prTargetDesc == prBssDesc->prP2pDesc) { - nicRxAddP2pDevice(prAdapter, - &rEventDevInfo, - prBssDesc->aucIEBuf, - prBssDesc->u2IELength); - } - else { - nicRxAddP2pDevice(prAdapter, - &rEventDevInfo, - NULL, - 0); - } - } - - kalP2PIndicateFound(prAdapter->prGlueInfo); - -#else - - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; - P_P2P_ATTRIBUTE_T prP2pAttribute = (P_P2P_ATTRIBUTE_T)NULL; - UINT_16 u2AttributeLen = 0; - UINT_32 u4Idx = 0; - P_P2P_ATTRI_GROUP_INFO_T prP2pAttriGroupInfo = (P_P2P_ATTRI_GROUP_INFO_T)NULL; - P_DEVICE_NAME_TLV_T prP2pDevName = (P_DEVICE_NAME_TLV_T)NULL; - - ASSERT(prAdapter); - - prP2pSpecificBssInfo = &prAdapter->rWifiVar.rP2pSpecificBssInfo; - -#if 1 - p2pGetP2PAttriList(prAdapter, prBssDesc->aucIEBuf, prBssDesc->u2IELength, (PPUINT_8)&prP2pAttribute, &u2AttributeLen); -#else - prP2pAttribute = (P_P2P_ATTRIBUTE_T)&prP2pSpecificBssInfo->aucAttributesCache[0]; - u2AttributeLen = prP2pSpecificBssInfo->u2AttributeLen; -#endif - rEventDevInfo.fgDevInfoValid = FALSE; - - while (u2AttributeLen >= P2P_ATTRI_HDR_LEN) { - switch (prP2pAttribute->ucId) { - case P2P_ATTRI_ID_P2P_CAPABILITY: - { - P_P2P_ATTRI_CAPABILITY_T prP2pAttriCapability = (P_P2P_ATTRI_CAPABILITY_T)NULL; - - prP2pAttriCapability = (P_P2P_ATTRI_CAPABILITY_T)prP2pAttribute; - ASSERT(prP2pAttriCapability->u2Length == 2); - rEventDevInfo.ucDeviceCapabilityBitmap = prP2pAttriCapability->ucDeviceCap; - rEventDevInfo.ucGroupCapabilityBitmap = prP2pAttriCapability->ucGroupCap; - } - break; - case P2P_ATTRI_ID_P2P_DEV_ID: - { - P_P2P_ATTRI_DEV_ID_T prP2pAttriDevID = (P_P2P_ATTRI_DEV_ID_T)NULL; - - prP2pAttriDevID = (P_P2P_ATTRI_DEV_ID_T)prP2pAttribute; - ASSERT(prP2pAttriDevID->u2Length == 6); - kalMemCopy(rEventDevInfo.aucCommunicateAddr, prP2pAttriDevID->aucDevAddr, MAC_ADDR_LEN); - } - break; - case P2P_ATTRI_ID_P2P_DEV_INFO: - { - P_P2P_ATTRI_DEV_INFO_T prP2pAttriDevInfo = (P_P2P_ATTRI_DEV_INFO_T)NULL; - P_P2P_DEVICE_TYPE_T prP2pDevType = (P_P2P_DEVICE_TYPE_T)NULL; - - prP2pAttriDevInfo = (P_P2P_ATTRI_DEV_INFO_T)prP2pAttribute; - rEventDevInfo.fgDevInfoValid = TRUE; - kalMemCopy(rEventDevInfo.aucCommunicateAddr, prP2pAttriDevInfo->aucDevAddr, MAC_ADDR_LEN); - rEventDevInfo.u2ConfigMethod = prP2pAttriDevInfo->u2ConfigMethodsBE; - - prP2pDevType = &rEventDevInfo.rPriDevType; - prP2pDevType->u2CategoryID = prP2pAttriDevInfo->rPrimaryDevTypeBE.u2CategoryId; - prP2pDevType->u2SubCategoryID = prP2pAttriDevInfo->rPrimaryDevTypeBE.u2SubCategoryId; - - ASSERT(prP2pAttriDevInfo->ucNumOfSecondaryDevType <= 2); // TODO: Fixme if secondary device type is more than 2. - for (u4Idx = 0; u4Idx < prP2pAttriDevInfo->ucNumOfSecondaryDevType; u4Idx++) { - // TODO: Current sub device type can only support 2. - prP2pDevType = &rEventDevInfo.arSecDevType[u4Idx]; - prP2pDevType->u2CategoryID = prP2pAttriDevInfo->rPrimaryDevTypeBE.u2CategoryId; - prP2pDevType->u2SubCategoryID = prP2pAttriDevInfo->rPrimaryDevTypeBE.u2SubCategoryId; - } - - prP2pDevName = (P_DEVICE_NAME_TLV_T)(prP2pAttriDevInfo->arSecondaryDevTypeListBE + (u4Idx * sizeof(DEVICE_TYPE_T))); - ASSERT(prP2pDevName->u2Id == 0x1011); - ASSERT(prP2pDevName->u2Length <= 32); // TODO: Fixme if device name length is longer than 32 bytes. - kalMemCopy(rEventDevInfo.aucName, prP2pDevName->aucName, prP2pDevName->u2Length); - } - break; - case P2P_ATTRI_ID_P2P_GROUP_INFO: - prP2pAttriGroupInfo = (P_P2P_ATTRI_GROUP_INFO_T)prP2pAttribute; - break; - } - - u2AttributeLen -= (prP2pAttribute->u2Length + P2P_ATTRI_HDR_LEN); - - prP2pAttribute = (P_P2P_ATTRIBUTE_T)((UINT_32)prP2pAttribute + (prP2pAttribute->u2Length + P2P_ATTRI_HDR_LEN)); - - } - - nicRxAddP2pDevice(prAdapter, - &rEventDevInfo); - - if (prP2pAttriGroupInfo != NULL) { - P_P2P_CLIENT_INFO_DESC_T prClientInfoDesc = (P_P2P_CLIENT_INFO_DESC_T)NULL; - P_P2P_DEVICE_TYPE_T prP2pDevType = (P_P2P_DEVICE_TYPE_T)NULL; - - prClientInfoDesc = prP2pAttriGroupInfo->arClientDesc; - u2AttributeLen = prP2pAttriGroupInfo->u2Length; - - while (u2AttributeLen > 0) { - /* Basic size for P2P client info descriptor. */ - ASSERT(u2AttributeLen >= 25); - rEventDevInfo.fgDevInfoValid = TRUE; - kalMemCopy(rEventDevInfo.aucCommunicateAddr, prClientInfoDesc->aucIfAddr, MAC_ADDR_LEN); - rEventDevInfo.ucDeviceCapabilityBitmap = prClientInfoDesc->ucDeviceCap; - rEventDevInfo.u2ConfigMethod = prClientInfoDesc->u2ConfigMethodsBE; - - prP2pDevType = &rEventDevInfo.rPriDevType; - prP2pDevType->u2CategoryID = prClientInfoDesc->rPrimaryDevTypeBE.u2CategoryId; - prP2pDevType->u2SubCategoryID = prClientInfoDesc->rPrimaryDevTypeBE.u2SubCategoryId; - - ASSERT(prClientInfoDesc->ucNumOfSecondaryDevType <= 2); // TODO: Fixme if secondary device type is more than 2. - for (u4Idx = 0; u4Idx < prClientInfoDesc->ucNumOfSecondaryDevType; u4Idx++) { - // TODO: Current sub device type can only support 2. - prP2pDevType = &rEventDevInfo.arSecDevType[u4Idx]; - prP2pDevType->u2CategoryID = prClientInfoDesc->arSecondaryDevTypeListBE[u4Idx].u2CategoryId; - prP2pDevType->u2SubCategoryID = prClientInfoDesc->arSecondaryDevTypeListBE[u4Idx].u2SubCategoryId; - } - - prP2pDevName = (P_DEVICE_NAME_TLV_T)(prClientInfoDesc->arSecondaryDevTypeListBE + (u4Idx * sizeof(DEVICE_TYPE_T))); - ASSERT(prP2pDevName->u2Id == 0x1011); - ASSERT(prP2pDevName->u2Length <= 32); // TODO: Fixme if device name length is longer than 32 bytes. - kalMemCopy(&rEventDevInfo.aucName, prP2pDevName->aucName, prP2pDevName->u2Length); - - nicRxAddP2pDevice(prAdapter, - &rEventDevInfo); - - u2AttributeLen -= prP2pAttriGroupInfo->u2Length; - prP2pAttriGroupInfo = prP2pAttriGroupInfo + prP2pAttriGroupInfo->u2Length + 1; - } - - } -#endif - return WLAN_STATUS_SUCCESS; -} /* scanSendDeviceDiscoverEvent */ - -VOID -scanP2pProcessBeaconAndProbeResp( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN P_WLAN_STATUS prStatus, - IN P_BSS_DESC_T prBssDesc, - IN P_WLAN_BEACON_FRAME_T prWlanBeaconFrame - ) -{ - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL; - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - - if (prBssDesc->fgIsP2PPresent) { - - if ((!prP2pBssInfo->ucDTIMPeriod) && // First time. - (prP2pBssInfo->eCurrentOPMode == OP_MODE_INFRASTRUCTURE) && // P2P GC - (prP2pBssInfo->eConnectionState == PARAM_MEDIA_STATE_CONNECTED) && // Connected - ((prWlanBeaconFrame->u2FrameCtrl & MASK_FRAME_TYPE) == MAC_FRAME_BEACON) && // TX Beacon - EQUAL_SSID(prBssDesc->aucSSID, // SSID Match - prBssDesc->ucSSIDLen, - prP2pConnSettings->aucSSID, - prP2pConnSettings->ucSSIDLen)) { - - - prP2pBssInfo->ucDTIMPeriod = prBssDesc->ucDTIMPeriod; - nicPmIndicateBssConnected(prAdapter, NETWORK_TYPE_P2P_INDEX); - } - - do { - RF_CHANNEL_INFO_T rChannelInfo; - - ASSERT_BREAK((prSwRfb != NULL) && (prBssDesc != NULL)); - - if (((prWlanBeaconFrame->u2FrameCtrl & MASK_FRAME_TYPE) != MAC_FRAME_PROBE_RSP)) { - // Only report Probe Response frame to supplicant. - /* Probe response collect much more information. */ - break; - } - - rChannelInfo.ucChannelNum = prBssDesc->ucChannelNum; - rChannelInfo.eBand = prBssDesc->eBand; - - kalP2PIndicateBssInfo(prAdapter->prGlueInfo, - (PUINT_8)prSwRfb->pvHeader, - (UINT_32)prSwRfb->u2PacketLen, - &rChannelInfo, - RCPI_TO_dBm(prBssDesc->ucRCPI)); - - - } while (FALSE); - } -} - -VOID -scnEventReturnChannel ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucScnSeqNum - ) -{ - - CMD_SCAN_CANCEL rCmdScanCancel; - - /* send cancel message to firmware domain */ - rCmdScanCancel.ucSeqNum = ucScnSeqNum; - rCmdScanCancel.ucIsExtChannel = (UINT_8) FALSE; - - wlanSendSetQueryCmd(prAdapter, - CMD_ID_SCAN_CANCEL, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_SCAN_CANCEL), - (PUINT_8)&rCmdScanCancel, - NULL, - 0); - - return; -} /* scnEventReturnChannel */ - -VOID -scanRemoveAllP2pBssDesc( - IN P_ADAPTER_T prAdapter - ) -{ - P_LINK_T prBSSDescList; - P_BSS_DESC_T prBssDesc; - P_BSS_DESC_T prBSSDescNext; - - ASSERT(prAdapter); - - prBSSDescList = &(prAdapter->rWifiVar.rScanInfo.rBSSDescList); - - /* Search BSS Desc from current SCAN result list. */ - LINK_FOR_EACH_ENTRY_SAFE(prBssDesc, prBSSDescNext, prBSSDescList, rLinkEntry, BSS_DESC_T) { - scanRemoveP2pBssDesc(prAdapter, prBssDesc); - } -} /* scanRemoveAllP2pBssDesc */ - -VOID -scanRemoveP2pBssDesc( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc - ) -{ - - return; -} /* scanRemoveP2pBssDesc */ - - -P_BSS_DESC_T -scanP2pSearchDesc ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prP2pBssInfo, - IN P_P2P_CONNECTION_REQ_INFO_T prConnReqInfo - ) -{ - P_BSS_DESC_T prCandidateBssDesc = (P_BSS_DESC_T)NULL, prBssDesc = (P_BSS_DESC_T)NULL; - P_LINK_T prBssDescList = (P_LINK_T)NULL; - - do { - if ((prAdapter == NULL) || - (prP2pBssInfo == NULL) || - (prConnReqInfo == NULL)) { - break; - } - - - prBssDescList = &(prAdapter->rWifiVar.rScanInfo.rBSSDescList); - - DBGLOG(P2P, LOUD, ("Connecting to BSSID: "MACSTR"\n", MAC2STR(prConnReqInfo->aucBssid))); - DBGLOG(P2P, LOUD, ("Connecting to SSID:%s, length:%d\n", - prConnReqInfo->rSsidStruct.aucSsid, - prConnReqInfo->rSsidStruct.ucSsidLen)); - - LINK_FOR_EACH_ENTRY(prBssDesc, prBssDescList, rLinkEntry, BSS_DESC_T) { - DBGLOG(P2P, LOUD, ("Checking BSS: "MACSTR"\n", MAC2STR(prBssDesc->aucBSSID))); - - if (prBssDesc->eBSSType != BSS_TYPE_INFRASTRUCTURE) { - DBGLOG(P2P, LOUD, ("Ignore mismatch BSS type.\n")); - continue; - } - - - if (UNEQUAL_MAC_ADDR(prBssDesc->aucBSSID, prConnReqInfo->aucBssid)) { - DBGLOG(P2P, LOUD, ("Ignore mismatch BSSID.\n")); - continue; - } - - - /* SSID should be the same? SSID is vary for each connection. so... */ - if (UNEQUAL_SSID(prConnReqInfo->rSsidStruct.aucSsid, - prConnReqInfo->rSsidStruct.ucSsidLen, - prBssDesc->aucSSID, - prBssDesc->ucSSIDLen)) { - - DBGLOG(P2P, TRACE, ("Connecting to BSSID: "MACSTR"\n", MAC2STR(prConnReqInfo->aucBssid))); - DBGLOG(P2P, TRACE, ("Connecting to SSID:%s, length:%d\n", - prConnReqInfo->rSsidStruct.aucSsid, - prConnReqInfo->rSsidStruct.ucSsidLen)); - DBGLOG(P2P, TRACE, ("Checking SSID:%s, length:%d\n", - prBssDesc->aucSSID, - prBssDesc->ucSSIDLen)); - DBGLOG(P2P, TRACE, ("Ignore mismatch SSID, (But BSSID match).\n")); - ASSERT(FALSE); - break; - } - - /* Final decision. */ - prCandidateBssDesc = prBssDesc; - break; - } - - - - } while (FALSE); - - return prCandidateBssDesc; -} /* scanP2pSearchDesc */ - - - - diff --git a/drivers/net/wireless/mt5931/mgmt/p2p_state.c b/drivers/net/wireless/mt5931/mgmt/p2p_state.c deleted file mode 100755 index da30ecff152b..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/p2p_state.c +++ /dev/null @@ -1,575 +0,0 @@ -#include "p2p_precomp.h" - - -BOOLEAN -p2pStateInit_IDLE ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN P_BSS_INFO_T prP2pBssInfo, - OUT P_ENUM_P2P_STATE_T peNextState - ) -{ - BOOLEAN fgIsTransOut = FALSE; -// P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && - (prP2pFsmInfo != NULL) && - (prP2pBssInfo != NULL) && - (peNextState != NULL)); - - if ((prP2pBssInfo->eIntendOPMode == OP_MODE_ACCESS_POINT) && IS_NET_PWR_STATE_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX)) { - P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = &(prP2pFsmInfo->rChnlReqInfo); - - fgIsTransOut = TRUE; - prChnlReqInfo->eChannelReqType = CHANNEL_REQ_TYPE_GO_START_BSS; - *peNextState = P2P_STATE_REQING_CHANNEL; - - } - else { -#if 0 - else if (IS_NET_PWR_STATE_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX)) { - - ASSERT((prP2pBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT) || - (prP2pBssInfo->eCurrentOPMode == OP_MODE_INFRASTRUCTURE)); - - prChnlReqInfo = &prP2pFsmInfo->rChnlReqInfo; - - if (prChnlReqInfo->fgIsChannelRequested) { - /* Start a timer for return channel. */ - DBGLOG(P2P, TRACE, ("start a GO channel timer.\n")); - } - - } - -#endif - cnmTimerStartTimer(prAdapter, &(prP2pFsmInfo->rP2pFsmTimeoutTimer), 5000); - } - - } while (FALSE); - - return fgIsTransOut; -} /* p2pStateInit_IDLE */ - - -VOID -p2pStateAbort_IDLE ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN ENUM_P2P_STATE_T eNextState - ) -{ - - P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && - (prP2pFsmInfo != NULL)); - - prChnlReqInfo = &prP2pFsmInfo->rChnlReqInfo; - - - if (prChnlReqInfo->fgIsChannelRequested) { - /* Release channel before timeout. */ - p2pFuncReleaseCh(prAdapter, prChnlReqInfo); - } - - - /* Stop timer for leaving this state. */ - cnmTimerStopTimer(prAdapter, &(prP2pFsmInfo->rP2pFsmTimeoutTimer)); - - } while (FALSE); - - return; -} /* p2pStateAbort_IDLE */ - - - -VOID -p2pStateInit_CHNL_ON_HAND ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_INFO_T prP2pBssInfo, - IN P_P2P_FSM_INFO_T prP2pFsmInfo - ) -{ - P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL)); - - prChnlReqInfo = &(prP2pFsmInfo->rChnlReqInfo); - - /* Store the original channel info. */ - prChnlReqInfo->ucOriChnlNum = prP2pBssInfo->ucPrimaryChannel; - prChnlReqInfo->eOriBand = prP2pBssInfo->eBand; - prChnlReqInfo->eOriChnlSco = prP2pBssInfo->eBssSCO; - - /* RX Probe Request would check primary channel.*/ - prP2pBssInfo->ucPrimaryChannel = prChnlReqInfo->ucReqChnlNum; - prP2pBssInfo->eBand = prChnlReqInfo->eBand; - prP2pBssInfo->eBssSCO = prChnlReqInfo->eChnlSco; - - - DBGLOG(P2P, TRACE, ("start a channel on hand timer.\n")); - cnmTimerStartTimer(prAdapter, - &(prP2pFsmInfo->rP2pFsmTimeoutTimer), - prChnlReqInfo->u4MaxInterval); - - kalP2PIndicateChannelReady(prAdapter->prGlueInfo, - prChnlReqInfo->u8Cookie, - prChnlReqInfo->ucReqChnlNum, - prChnlReqInfo->eBand, - prChnlReqInfo->eChnlSco, - prChnlReqInfo->u4MaxInterval); - - } while (FALSE); - - return; -} /* p2pStateInit_CHNL_ON_HAND */ - - -VOID -p2pStateAbort_CHNL_ON_HAND ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN P_BSS_INFO_T prP2pBssInfo, - IN ENUM_P2P_STATE_T eNextState - ) -{ - P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL; - - - do { - ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL)); - - prChnlReqInfo = &(prP2pFsmInfo->rChnlReqInfo); - - cnmTimerStopTimer(prAdapter, &(prP2pFsmInfo->rP2pFsmTimeoutTimer)); - - /* Restore the original channel info. */ - prP2pBssInfo->ucPrimaryChannel = prChnlReqInfo->ucOriChnlNum; - prP2pBssInfo->eBand = prChnlReqInfo->eOriBand; - prP2pBssInfo->eBssSCO = prChnlReqInfo->eOriChnlSco; - - if (eNextState != P2P_STATE_CHNL_ON_HAND) { - /* Indicate channel return. */ - kalP2PIndicateChannelExpired(prAdapter->prGlueInfo, &prP2pFsmInfo->rChnlReqInfo); - - // Return Channel. - p2pFuncReleaseCh(prAdapter, &(prP2pFsmInfo->rChnlReqInfo)); - } - - } while (FALSE); - return; -} /* p2pStateAbort_CHNL_ON_HAND */ - - -VOID -p2pStateAbort_REQING_CHANNEL ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN ENUM_P2P_STATE_T eNextState - ) -{ - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; - - do { - - ASSERT_BREAK((prAdapter != NULL) && - (prP2pFsmInfo != NULL) && - (eNextState < P2P_STATE_NUM)); - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - prP2pSpecificBssInfo = prAdapter->rWifiVar.prP2pSpecificBssInfo; - - if (eNextState == P2P_STATE_IDLE) { - if (prP2pBssInfo->eIntendOPMode == OP_MODE_ACCESS_POINT) { - /* Intend to be AP. */ - /* Setup for AP mode. */ - p2pFuncStartGO(prAdapter, - prP2pBssInfo, - prP2pSpecificBssInfo->aucGroupSsid, - prP2pSpecificBssInfo->u2GroupSsidLen, - prP2pSpecificBssInfo->ucPreferredChannel, - prP2pSpecificBssInfo->eRfBand, - prP2pSpecificBssInfo->eRfSco, - prP2pFsmInfo->fgIsApMode); - - } - else { - // Return Channel. - p2pFuncReleaseCh(prAdapter, &(prP2pFsmInfo->rChnlReqInfo)); - } - - } - - - } while (FALSE); - - return; -} /* p2pStateInit_AP_CHANNEL_DETECT */ - - -VOID -p2pStateInit_AP_CHANNEL_DETECT ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo - ) -{ - P_P2P_SCAN_REQ_INFO_T prScanReqInfo = (P_P2P_SCAN_REQ_INFO_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL)); - - prScanReqInfo = &(prP2pFsmInfo->rScanReqInfo); - - prScanReqInfo->eScanType = SCAN_TYPE_PASSIVE_SCAN; - prScanReqInfo->eChannelSet = SCAN_CHANNEL_2G4; - prScanReqInfo->u2PassiveDewellTime = 50; // 50ms for passive channel load detection - prScanReqInfo->fgIsAbort = TRUE; - prScanReqInfo->fgIsScanRequest = TRUE; - prScanReqInfo->ucNumChannelList = 0; - prScanReqInfo->u4BufLength = 0; - prScanReqInfo->rSsidStruct.ucSsidLen = 0; - - p2pFuncRequestScan(prAdapter, prScanReqInfo); - - } while (FALSE); - - return; -} /* p2pStateInit_AP_CHANNEL_DETECT */ - - - -VOID -p2pStateAbort_AP_CHANNEL_DETECT ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo, - IN ENUM_P2P_STATE_T eNextState - ) -{ - P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL; - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL; - - do { - - if (eNextState == P2P_STATE_REQING_CHANNEL) { - UINT_8 ucPreferedChnl = 0; - ENUM_BAND_T eBand = BAND_NULL; - ENUM_CHNL_EXT_T eSco = CHNL_EXT_SCN; - - prChnlReqInfo = &(prP2pFsmInfo->rChnlReqInfo); - - /* Determine the channel for AP. */ - if (cnmPreferredChannel(prAdapter, - &eBand, - &ucPreferedChnl, - &eSco) == FALSE) { - - prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - - if ((ucPreferedChnl = prP2pConnSettings->ucOperatingChnl) == 0) { - - if (scnQuerySparseChannel(prAdapter, &eBand, &ucPreferedChnl) == FALSE) { - - // What to do? - ASSERT(FALSE); - // TODO: Pick up a valid channel from channel list. - } - } - } - - - prChnlReqInfo->eChannelReqType = CHANNEL_REQ_TYPE_GO_START_BSS; - prChnlReqInfo->ucReqChnlNum = prP2pSpecificBssInfo->ucPreferredChannel = ucPreferedChnl; - prChnlReqInfo->eBand = prP2pSpecificBssInfo->eRfBand = eBand; - prChnlReqInfo->eChnlSco = prP2pSpecificBssInfo->eRfSco = eSco; - } - else { - p2pFuncCancelScan(prAdapter, &(prP2pFsmInfo->rScanReqInfo)); - } - - - } while (FALSE); - - return; -} /* p2pStateAbort_AP_CHANNEL_DETECT */ - - -VOID -p2pStateInit_SCAN ( - - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo - ) -{ - P_P2P_SCAN_REQ_INFO_T prScanReqInfo = (P_P2P_SCAN_REQ_INFO_T)NULL; - - do { - - ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL)); - - prScanReqInfo = &prP2pFsmInfo->rScanReqInfo; - - prScanReqInfo->fgIsScanRequest = TRUE; - - p2pFuncRequestScan(prAdapter, prScanReqInfo); - - } while (FALSE); - return; -} /* p2pStateInit_SCAN */ - - -VOID -p2pStateAbort_SCAN ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN ENUM_P2P_STATE_T eNextState - ) -{ - do { - ASSERT_BREAK(prAdapter != NULL); - - // 1. Scan cancel. (Make sure the scan request is invalid. - p2pFuncCancelScan(prAdapter, &(prP2pFsmInfo->rScanReqInfo)); - - // Scan done indication. - kalP2PIndicateScanDone(prAdapter->prGlueInfo, prP2pFsmInfo->rScanReqInfo.fgIsAbort); - } while (FALSE); - - return; -} /* p2pStateAbort_SCAN */ - - -VOID -p2pStateInit_GC_JOIN ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN P_BSS_INFO_T prP2pBssInfo, - IN P_P2P_JOIN_INFO_T prJoinInfo, - IN P_BSS_DESC_T prBssDesc - ) -{ - P_MSG_JOIN_REQ_T prJoinReqMsg = (P_MSG_JOIN_REQ_T)NULL; - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL; - - do { - ASSERT_BREAK((prAdapter != NULL) && - (prP2pFsmInfo != NULL) && - (prP2pBssInfo != NULL) && - (prJoinInfo != NULL) && - (prBssDesc != NULL)); - - prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - - if (prBssDesc->ucSSIDLen) { - COPY_SSID(prP2pConnSettings->aucSSID, - prP2pConnSettings->ucSSIDLen, - prBssDesc->aucSSID, - prBssDesc->ucSSIDLen); - } - - - // Setup a join timer. - DBGLOG(P2P, TRACE, ("Start a join init timer\n")); - cnmTimerStartTimer(prAdapter, - &(prP2pFsmInfo->rP2pFsmTimeoutTimer), - (prP2pFsmInfo->u4GrantInterval - AIS_JOIN_CH_GRANT_THRESHOLD)); - - //2 <1> We are goin to connect to this BSS - prBssDesc->fgIsConnecting = TRUE; - - //2 <2> Setup corresponding STA_RECORD_T - prStaRec = bssCreateStaRecFromBssDesc(prAdapter, - (prBssDesc->fgIsP2PPresent?(STA_TYPE_P2P_GO):(STA_TYPE_LEGACY_AP)), - NETWORK_TYPE_P2P_INDEX, - prBssDesc); - - if (prStaRec == NULL) { - DBGLOG(P2P, TRACE, ("Create station record fail\n")); - break; - } - - - prJoinInfo->prTargetStaRec = prStaRec; - prJoinInfo->fgIsJoinComplete = FALSE; - prJoinInfo->u4BufLength = 0; - - //2 <2.1> Sync. to FW domain - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - - - if (prP2pBssInfo->eConnectionState == PARAM_MEDIA_STATE_DISCONNECTED) { - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL; - - prStaRec->fgIsReAssoc = FALSE; - - prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - - switch (prP2pConnSettings->eAuthMode) { - case AUTH_MODE_OPEN: /* Note: Omit break here. */ - case AUTH_MODE_WPA: - case AUTH_MODE_WPA_PSK: - case AUTH_MODE_WPA2: - case AUTH_MODE_WPA2_PSK: - prJoinInfo->ucAvailableAuthTypes = (UINT_8)AUTH_TYPE_OPEN_SYSTEM; - break; - case AUTH_MODE_SHARED: - prJoinInfo->ucAvailableAuthTypes = (UINT_8)AUTH_TYPE_SHARED_KEY; - break; - case AUTH_MODE_AUTO_SWITCH: - DBGLOG(P2P, LOUD, ("JOIN INIT: eAuthMode == AUTH_MODE_AUTO_SWITCH\n")); - prJoinInfo->ucAvailableAuthTypes = (UINT_8)(AUTH_TYPE_OPEN_SYSTEM | - AUTH_TYPE_SHARED_KEY); - break; - default: - ASSERT(!(prP2pConnSettings->eAuthMode == AUTH_MODE_WPA_NONE)); - DBGLOG(P2P, ERROR, ("JOIN INIT: Auth Algorithm : %d was not supported by JOIN\n", - prP2pConnSettings->eAuthMode)); - /* TODO(Kevin): error handling ? */ - return; - } - prStaRec->ucTxAuthAssocRetryLimit = TX_AUTH_ASSOCI_RETRY_LIMIT; - } - else { - ASSERT(FALSE); - // TODO: Shall we considering ROAMIN case for P2P Device?. - } - - - //2 <4> Use an appropriate Authentication Algorithm Number among the ucAvailableAuthTypes. - if (prJoinInfo->ucAvailableAuthTypes & - (UINT_8)AUTH_TYPE_OPEN_SYSTEM) { - - DBGLOG(P2P, TRACE, ("JOIN INIT: Try to do Authentication with AuthType == OPEN_SYSTEM.\n")); - - prJoinInfo->ucAvailableAuthTypes &= - ~(UINT_8)AUTH_TYPE_OPEN_SYSTEM; - - prStaRec->ucAuthAlgNum = (UINT_8)AUTH_ALGORITHM_NUM_OPEN_SYSTEM; - } - else if (prJoinInfo->ucAvailableAuthTypes & - (UINT_8)AUTH_TYPE_SHARED_KEY) { - - DBGLOG(P2P, TRACE, ("JOIN INIT: Try to do Authentication with AuthType == SHARED_KEY.\n")); - - prJoinInfo->ucAvailableAuthTypes &= - ~(UINT_8)AUTH_TYPE_SHARED_KEY; - - prStaRec->ucAuthAlgNum = (UINT_8)AUTH_ALGORITHM_NUM_SHARED_KEY; - } - else if (prJoinInfo->ucAvailableAuthTypes & - (UINT_8)AUTH_TYPE_FAST_BSS_TRANSITION) { - - DBGLOG(P2P, TRACE, ("JOIN INIT: Try to do Authentication with AuthType == FAST_BSS_TRANSITION.\n")); - - prJoinInfo->ucAvailableAuthTypes &= - ~(UINT_8)AUTH_TYPE_FAST_BSS_TRANSITION; - - prStaRec->ucAuthAlgNum = (UINT_8)AUTH_ALGORITHM_NUM_FAST_BSS_TRANSITION; - } - else { - ASSERT(0); - } - - - //4 <5> Overwrite Connection Setting for eConnectionPolicy == ANY (Used by Assoc Req) - if (prBssDesc->ucSSIDLen) { - COPY_SSID(prJoinInfo->rSsidStruct.aucSsid, - prJoinInfo->rSsidStruct.ucSsidLen, - prBssDesc->aucSSID, - prBssDesc->ucSSIDLen); - } - - //2 <5> Backup desired channel. - - //2 <6> Send a Msg to trigger SAA to start JOIN process. - prJoinReqMsg = (P_MSG_JOIN_REQ_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_JOIN_REQ_T)); - - if (!prJoinReqMsg) { - DBGLOG(P2P, TRACE, ("Allocation Join Message Fail\n")); - ASSERT(FALSE); - return; - } - - prJoinReqMsg->rMsgHdr.eMsgId = MID_P2P_SAA_FSM_START; - prJoinReqMsg->ucSeqNum = ++prJoinInfo->ucSeqNumOfReqMsg; - prJoinReqMsg->prStaRec = prStaRec; - - // TODO: Consider fragmentation info in station record. - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prJoinReqMsg, - MSG_SEND_METHOD_BUF); - - - - - } while (FALSE); - - return; -} /* p2pStateInit_GC_JOIN */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Process of JOIN Abort. Leave JOIN State & Abort JOIN. -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pStateAbort_GC_JOIN ( - IN P_ADAPTER_T prAdapter, - IN P_P2P_FSM_INFO_T prP2pFsmInfo, - IN P_P2P_JOIN_INFO_T prJoinInfo, - IN ENUM_P2P_STATE_T eNextState - ) -{ - P_MSG_JOIN_ABORT_T prJoinAbortMsg = (P_MSG_JOIN_ABORT_T)NULL; - - - do { - ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL) && (prJoinInfo != NULL)); - - if (prJoinInfo->fgIsJoinComplete == FALSE) { - - prJoinAbortMsg = (P_MSG_JOIN_ABORT_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_JOIN_ABORT_T)); - if (!prJoinAbortMsg) { - DBGLOG(P2P, TRACE, ("Fail to allocate join abort message buffer\n")); - ASSERT(FALSE); - return; - } - - prJoinAbortMsg->rMsgHdr.eMsgId = MID_P2P_SAA_FSM_ABORT; - prJoinAbortMsg->ucSeqNum = prJoinInfo->ucSeqNumOfReqMsg; - prJoinAbortMsg->prStaRec = prJoinInfo->prTargetStaRec; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prJoinAbortMsg, - MSG_SEND_METHOD_BUF); - - } - - /* Stop Join Timer. */ - cnmTimerStopTimer(prAdapter, &(prP2pFsmInfo->rP2pFsmTimeoutTimer)); - - /* Release channel requested. */ - p2pFuncReleaseCh(prAdapter, &(prP2pFsmInfo->rChnlReqInfo)); - - } while (FALSE); - - return; - -} /* p2pStateAbort_GC_JOIN */ - - - diff --git a/drivers/net/wireless/mt5931/mgmt/privacy.c b/drivers/net/wireless/mt5931/mgmt/privacy.c deleted file mode 100755 index 66b33a631b71..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/privacy.c +++ /dev/null @@ -1,1024 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/privacy.c#1 $ -*/ - -/*! \file "privacy.c" - \brief This file including the protocol layer privacy function. - - This file provided the macros and functions library support for the - protocol layer security setting from rsn.c and nic_privacy.c - -*/ - - - -/* -** $Log: privacy.c $ - * - * 11 10 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * change the debug module level. - * - * 10 20 2011 terry.wu - * NULL - * Fix Hotspot deauth send failed. - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 06 28 2011 tsaiyuan.hsu - * [WCXRP00000819] [MT6620 Wi-Fi][Driver] check if staRec is NULL or not in secCheckClassError - * check if staRec is NULL or not in secCheckClassError. - * - * 06 09 2011 tsaiyuan.hsu - * [WCXRP00000760] [MT5931 Wi-Fi][FW] Refine rxmHandleMacRxDone to reduce code size - * move send_auth at rxmHandleMacRxDone in firmware to driver to reduce code size. - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Change Station Type in Station Record, Modify MACRO definition for getting station type & network type index & Role. - * - * 11 04 2010 wh.su - * [WCXRP00000164] [MT6620 Wi-Fi][Driver] Support the p2p random SSID - * adding the p2p random ssid support. - * - * 10 04 2010 cp.wu - * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only - * remove ENUM_NETWORK_TYPE_T definitions - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 09 01 2010 wh.su - * NULL - * adding the wapi support for integration test. - * - * 07 24 2010 wh.su - * - * .support the Wi-Fi RSN - * - * 07 20 2010 wh.su - * - * adding the wapi code. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 21 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * modify some code for concurrent network. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * [WPD00003833][MT6620 and MT5931] Driver migration - * enable RX management frame handling. - * - * 06 19 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * adding the compiling flag for migration. - * - * 06 19 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * consdier the concurrent network setting. - * - * 06 18 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * migration the security related function from firmware. - * - * 05 28 2010 wh.su - * [BORA00000626][MT6620] Refine the remove key flow for WHQL testing - * fixed the ad-hoc wpa-none send non-encrypted frame issue. - * - * 05 24 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Refine authSendAuthFrame() for NULL STA_RECORD_T case and minimum deauth interval. - * - * 04 29 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * adjsut the pre-authentication code. - * - * 04 22 2010 wh.su - * [BORA00000626][MT6620] Refine the remove key flow for WHQL testing - * fixed the wpi same key id rx issue and fixed the remove wep key issue. - * - * 04 19 2010 kevin.huang - * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support - * Add Send Deauth for Class 3 Error and Leave Network Support - * - * 04 15 2010 wh.su - * [BORA00000680][MT6620] Support the statistic for Microsoft os query - * remove the assert code for allow ad-hoc pkt. - * - * 04 13 2010 wh.su - * [BORA00000680][MT6620] Support the statistic for Microsoft os query - * fixed the Klocwork error and refine the class error message. - * - * 03 04 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * Code refine, and remove non-used code. - * - * 03 03 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * move the AIS specific variable for security to AIS specific structure. - * - * 03 03 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * Fixed the pre-authentication timer not correctly init issue, and modify the security related callback function prototype. - * - * 03 01 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * Refine the variable and parameter for security. - * - * 02 26 2010 wh.su - * [BORA00000626][MT6620] Refine the remove key flow for WHQL testing - * change the waning message shown level, and clear the global transmit flag for CMD INFRASTRUCTURE. - * - * 02 25 2010 wh.su - * [BORA00000626][MT6620] Refine the remove key flow for WHQL testing - * For support the WHQL test, do the remove key code refine. - * - * 01 27 2010 wh.su - * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code - * add and fixed some security function. - * - * 12 25 2009 tehuang.liu - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Integrated modifications for 1st connection (mainly on FW modules MQM, TXM, and RXM) - * * * * * * * * * MQM: BA handling - * * * * * * * * * TXM: Macros updates - * * * * * * * * * RXM: Macros/Duplicate Removal updates - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * Dec 11 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * modify the cmd with result return - * - * Dec 11 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * fixed the value not initialize issue - * - * Dec 10 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * change the cmd return type - * - * Dec 8 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the function to update the auth mode and encryption status for cmd build connection - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding some code for wapi mode - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the call to check the 4th and eapol error report frame - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * rename the function name - * - * Dec 4 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the code for parsing the EAPoL frame, and do some code refine - * - * Dec 3 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the class error check - * - * Dec 3 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the cmd_802_11_pmkid code - * - * Dec 1 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * doing some function rename, and adding the code for cmd CMD_ADD_REMOVE_KEY - * - * Nov 23 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the clear pmkid function - * - * Nov 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix eStaType check for AIS - * - * Nov 19 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the ap selection related code - * - * Nov 18 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -#if CFG_PRIVACY_MIGRATION - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to initialize the privacy-related -* parameters. -* -* \param[in] prAdapter Pointer to the Adapter structure -* \param[in] ucNetTypeIdx Pointer to netowrk type index -* -* \retval NONE -*/ -/*----------------------------------------------------------------------------*/ -VOID -secInit ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucNetTypeIdx - ) -{ - UINT_8 i; - P_CONNECTION_SETTINGS_T prConnSettings; - P_BSS_INFO_T prBssInfo; - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecBssInfo; - - DEBUGFUNC("secInit"); - - ASSERT(prAdapter); - - prConnSettings = &prAdapter->rWifiVar.rConnSettings; - prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]; - prAisSpecBssInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - - prBssInfo->u4RsnSelectedGroupCipher = 0; - prBssInfo->u4RsnSelectedPairwiseCipher = 0; - prBssInfo->u4RsnSelectedAKMSuite = 0; - -#if CFG_ENABLE_WIFI_DIRECT - prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]; - - prBssInfo->u4RsnSelectedGroupCipher = RSN_CIPHER_SUITE_CCMP; - prBssInfo->u4RsnSelectedPairwiseCipher = RSN_CIPHER_SUITE_CCMP; - prBssInfo->u4RsnSelectedAKMSuite = RSN_AKM_SUITE_PSK; -#endif - -#if CFG_ENABLE_BT_OVER_WIFI - prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX]; - - prBssInfo->u4RsnSelectedGroupCipher = RSN_CIPHER_SUITE_CCMP; - prBssInfo->u4RsnSelectedPairwiseCipher = RSN_CIPHER_SUITE_CCMP; - prBssInfo->u4RsnSelectedAKMSuite = RSN_AKM_SUITE_PSK; -#endif - - prAdapter->rMib.dot11RSNAConfigPairwiseCiphersTable[0].dot11RSNAConfigPairwiseCipher = - WPA_CIPHER_SUITE_WEP40; - prAdapter->rMib.dot11RSNAConfigPairwiseCiphersTable[1].dot11RSNAConfigPairwiseCipher = - WPA_CIPHER_SUITE_TKIP; - prAdapter->rMib.dot11RSNAConfigPairwiseCiphersTable[2].dot11RSNAConfigPairwiseCipher = - WPA_CIPHER_SUITE_CCMP; - prAdapter->rMib.dot11RSNAConfigPairwiseCiphersTable[3].dot11RSNAConfigPairwiseCipher = - WPA_CIPHER_SUITE_WEP104; - - prAdapter->rMib.dot11RSNAConfigPairwiseCiphersTable[4].dot11RSNAConfigPairwiseCipher = - RSN_CIPHER_SUITE_WEP40; - prAdapter->rMib.dot11RSNAConfigPairwiseCiphersTable[5].dot11RSNAConfigPairwiseCipher = - RSN_CIPHER_SUITE_TKIP; - prAdapter->rMib.dot11RSNAConfigPairwiseCiphersTable[6].dot11RSNAConfigPairwiseCipher = - RSN_CIPHER_SUITE_CCMP; - prAdapter->rMib.dot11RSNAConfigPairwiseCiphersTable[7].dot11RSNAConfigPairwiseCipher = - RSN_CIPHER_SUITE_WEP104; - - for (i = 0; i < MAX_NUM_SUPPORTED_CIPHER_SUITES; i ++) { - prAdapter->rMib.dot11RSNAConfigPairwiseCiphersTable[i].dot11RSNAConfigPairwiseCipherEnabled = - FALSE; - } - - prAdapter->rMib.dot11RSNAConfigAuthenticationSuitesTable[0].dot11RSNAConfigAuthenticationSuite = - WPA_AKM_SUITE_NONE; - prAdapter->rMib.dot11RSNAConfigAuthenticationSuitesTable[1].dot11RSNAConfigAuthenticationSuite = - WPA_AKM_SUITE_802_1X; - prAdapter->rMib.dot11RSNAConfigAuthenticationSuitesTable[2].dot11RSNAConfigAuthenticationSuite = - WPA_AKM_SUITE_PSK; - prAdapter->rMib.dot11RSNAConfigAuthenticationSuitesTable[3].dot11RSNAConfigAuthenticationSuite = - RSN_AKM_SUITE_NONE; - prAdapter->rMib.dot11RSNAConfigAuthenticationSuitesTable[4].dot11RSNAConfigAuthenticationSuite = - RSN_AKM_SUITE_802_1X; - prAdapter->rMib.dot11RSNAConfigAuthenticationSuitesTable[5].dot11RSNAConfigAuthenticationSuite = - RSN_AKM_SUITE_PSK; - -#if CFG_SUPPORT_802_11W - prAdapter->rMib.dot11RSNAConfigAuthenticationSuitesTable[6].dot11RSNAConfigAuthenticationSuite = - RSN_AKM_SUITE_802_1X_SHA256; - prAdapter->rMib.dot11RSNAConfigAuthenticationSuitesTable[7].dot11RSNAConfigAuthenticationSuite = - RSN_AKM_SUITE_PSK_SHA256; -#endif - - for (i = 0; i < MAX_NUM_SUPPORTED_AKM_SUITES; i ++) { - prAdapter->rMib.dot11RSNAConfigAuthenticationSuitesTable[i].dot11RSNAConfigAuthenticationSuiteEnabled = - FALSE; - } - - secClearPmkid(prAdapter); - - cnmTimerInitTimer(prAdapter, - &prAisSpecBssInfo->rPreauthenticationTimer, - (PFN_MGMT_TIMEOUT_FUNC)rsnIndicatePmkidCand, - (UINT_32)NULL); - -#if CFG_SUPPORT_802_11W - cnmTimerInitTimer(prAdapter, - &prAisSpecBssInfo->rSaQueryTimer, - (PFN_MGMT_TIMEOUT_FUNC)rsnStartSaQueryTimer, - (UINT_32)NULL); -#endif - - prAisSpecBssInfo->fgCounterMeasure = FALSE; - prAisSpecBssInfo->ucWEPDefaultKeyID = 0; - - - #if 0 - for (i=0;iarWtbl[i].fgUsed = FALSE; - g_prWifiVar->arWtbl[i].prSta = NULL; - g_prWifiVar->arWtbl[i].ucNetTypeIdx = NETWORK_TYPE_INDEX_NUM; - - } - nicPrivacyInitialize((UINT_8)NETWORK_TYPE_INDEX_NUM); - #endif -} /* secInit */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will indicate an Event of "Rx Class Error" to SEC_FSM for -* JOIN Module. -* -* \param[in] prAdapter Pointer to the Adapter structure -* \param[in] prSwRfb Pointer to the SW RFB. -* -* \return FALSE Class Error -*/ -/*----------------------------------------------------------------------------*/ -BOOL -secCheckClassError ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN P_STA_RECORD_T prStaRec - ) -{ - ASSERT(prAdapter); - ASSERT(prSwRfb); - //ASSERT(prStaRec); - - //prStaRec = &(g_arStaRec[prSwRfb->ucStaRecIdx]); - - if ((prStaRec) && 1 /* RXM_IS_DATA_FRAME(prSwRfb) */) { - ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex = prStaRec->ucNetTypeIndex; - - if (IS_NET_ACTIVE(prAdapter, eNetTypeIndex)) { - P_BSS_INFO_T prBssInfo; - prBssInfo = &prAdapter->rWifiVar.arBssInfo[eNetTypeIndex]; - - if ((STA_STATE_3 != prStaRec->ucStaState) && - IS_BSS_ACTIVE(prBssInfo) && - prBssInfo->fgIsNetAbsent == FALSE) { - /*(IS_AP_STA(prStaRec) || IS_CLIENT_STA(prStaRec))) {*/ - - if (WLAN_STATUS_SUCCESS == authSendDeauthFrame(prAdapter, - prStaRec, - NULL, - REASON_CODE_CLASS_3_ERR, - (PFN_TX_DONE_HANDLER)NULL)) { - - DBGLOG(RSN, INFO, ("Send Deauth to MAC:["MACSTR"] for Rx Class 3 Error.\n", - MAC2STR(prStaRec->aucMacAddr))); - } - - return FALSE; - } - - return secRxPortControlCheck(prAdapter, prSwRfb); - } - } - - return FALSE; -} /* end of secCheckClassError() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to setting the sta port status. -* -* \param[in] prAdapter Pointer to the Adapter structure -* \param[in] prSta Pointer to the sta -* \param[in] fgPortBlock The port status -* -* \retval none -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -secSetPortBlocked ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta, - IN BOOLEAN fgPortBlock - ) -{ - if (prSta == NULL) - return ; - - prSta->fgPortBlock = fgPortBlock; - - DBGLOG(RSN, TRACE, ("The STA "MACSTR" port %s\n", MAC2STR(prSta->aucMacAddr), fgPortBlock == TRUE ? "BLOCK" :" OPEN")); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to report the sta port status. -* -* \param[in] prAdapter Pointer to the Adapter structure -* \param[in] prSta Pointer to the sta -* \param[out] fgPortBlock The port status -* -* \return TRUE sta exist, FALSE sta not exist -* -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -secGetPortStatus ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta, - OUT PBOOLEAN pfgPortStatus - ) -{ - if (prSta == NULL) - return FALSE; - - *pfgPortStatus = prSta->fgPortBlock; - - return TRUE; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to handle Peer device Tx Security process MSDU. -* -* \param[in] prMsduInfo pointer to the packet info pointer -* -* \retval TRUE Accept the packet -* \retval FALSE Refuse the MSDU packet due port blocked -* -*/ -/*----------------------------------------------------------------------------*/ -BOOL /* ENUM_PORT_CONTROL_RESULT */ -secTxPortControlCheck( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN P_STA_RECORD_T prStaRec - ) -{ - ASSERT(prAdapter); - ASSERT(prMsduInfo); - ASSERT(prStaRec); - - if (prStaRec) { - - /* Todo:: */ - if (prMsduInfo->fgIs802_1x) - return TRUE; - - if (prStaRec->fgPortBlock == TRUE) { - DBGLOG(INIT, TRACE, ("Drop Tx packet due Port Control!\n")); - return FALSE; - } - -#if CFG_SUPPORT_WAPI - if (prAdapter->rWifiVar.rConnSettings.fgWapiMode) { - return TRUE; - } -#endif - if (IS_STA_IN_AIS(prStaRec)) { - if (!prAdapter->rWifiVar.rAisSpecificBssInfo.fgTransmitKeyExist && - (prAdapter->rWifiVar.rConnSettings.eEncStatus == ENUM_ENCRYPTION1_ENABLED)){ - DBGLOG(INIT, TRACE, ("Drop Tx packet due the key is removed!!!\n")); - return FALSE; - } - } - } - - return TRUE; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to handle The Rx Security process MSDU. -* -* \param[in] prAdapter Pointer to the Adapter structure -* \param[in] prSWRfb SW rfb pinter -* -* \retval TRUE Accept the packet -* \retval FALSE Refuse the MSDU packet due port control -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -secRxPortControlCheck ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSWRfb - ) -{ - ASSERT(prSWRfb); - -#if 0 - /* whsu:Todo: Process MGMT and DATA */ - if (prSWRfb->prStaRec) { - if (prSWRfb->prStaRec->fgPortBlock == TRUE) { - if (1 /* prSWRfb->fgIsDataFrame and not 1x*/ && - (g_prWifiVar->rConnSettings.eAuthMode >= AUTH_MODE_WPA)){ - //DBGLOG(SEC, WARN, ("Drop Rx data due port control !\r\n")); - return TRUE; /* Todo: whsu FALSE; */ - } - //if (!RX_STATUS_IS_PROTECT(prSWRfb->prRxStatus)) { - // DBGLOG(RSN, WARN, ("Drop rcv non-encrypted data frame!\n")); - // return FALSE; - //} - } - } - else { - } -#endif - return TRUE; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine will enable/disable the cipher suite -* -* \param[in] prAdapter Pointer to the adapter object data area. -* \param[in] u4CipherSuitesFlags flag for cipher suite -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -secSetCipherSuite ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4CipherSuitesFlags - ) -{ - UINT_32 i; - P_DOT11_RSNA_CONFIG_PAIRWISE_CIPHERS_ENTRY prEntry; - P_IEEE_802_11_MIB_T prMib; - - ASSERT(prAdapter); - - prMib = &prAdapter->rMib; - - ASSERT(prMib); - - if (u4CipherSuitesFlags == CIPHER_FLAG_NONE) { - /* Disable all the pairwise cipher suites. */ - for (i = 0; i < MAX_NUM_SUPPORTED_CIPHER_SUITES; i++) { - prMib->dot11RSNAConfigPairwiseCiphersTable[i].dot11RSNAConfigPairwiseCipherEnabled = - FALSE; - } - - /* Update the group cipher suite. */ - prMib->dot11RSNAConfigGroupCipher = WPA_CIPHER_SUITE_NONE; - - return; - } - - for (i = 0; i < MAX_NUM_SUPPORTED_CIPHER_SUITES; i++) { - prEntry = &prMib->dot11RSNAConfigPairwiseCiphersTable[i]; - - switch (prEntry->dot11RSNAConfigPairwiseCipher) { - case WPA_CIPHER_SUITE_WEP40: - case RSN_CIPHER_SUITE_WEP40: - if (u4CipherSuitesFlags & CIPHER_FLAG_WEP40) { - prEntry->dot11RSNAConfigPairwiseCipherEnabled = TRUE; - } - else { - prEntry->dot11RSNAConfigPairwiseCipherEnabled = FALSE; - } - break; - - case WPA_CIPHER_SUITE_TKIP: - case RSN_CIPHER_SUITE_TKIP: - if (u4CipherSuitesFlags & CIPHER_FLAG_TKIP) { - prEntry->dot11RSNAConfigPairwiseCipherEnabled = TRUE; - } - else { - prEntry->dot11RSNAConfigPairwiseCipherEnabled = FALSE; - } - break; - - case WPA_CIPHER_SUITE_CCMP: - case RSN_CIPHER_SUITE_CCMP: - if (u4CipherSuitesFlags & CIPHER_FLAG_CCMP) { - prEntry->dot11RSNAConfigPairwiseCipherEnabled = TRUE; - } - else { - prEntry->dot11RSNAConfigPairwiseCipherEnabled = FALSE; - } - break; - - case WPA_CIPHER_SUITE_WEP104: - case RSN_CIPHER_SUITE_WEP104: - if (u4CipherSuitesFlags & CIPHER_FLAG_WEP104) { - prEntry->dot11RSNAConfigPairwiseCipherEnabled = TRUE; - } - else { - prEntry->dot11RSNAConfigPairwiseCipherEnabled = FALSE; - } - break; - default: - break; - } - } - - /* Update the group cipher suite. */ - if (rsnSearchSupportedCipher(prAdapter, WPA_CIPHER_SUITE_CCMP, &i)) { - prMib->dot11RSNAConfigGroupCipher = WPA_CIPHER_SUITE_CCMP; - } - else if (rsnSearchSupportedCipher(prAdapter, WPA_CIPHER_SUITE_TKIP, &i)) { - prMib->dot11RSNAConfigGroupCipher = WPA_CIPHER_SUITE_TKIP; - } - else if (rsnSearchSupportedCipher(prAdapter, WPA_CIPHER_SUITE_WEP104, &i)) { - prMib->dot11RSNAConfigGroupCipher = WPA_CIPHER_SUITE_WEP104; - } - else if (rsnSearchSupportedCipher(prAdapter, WPA_CIPHER_SUITE_WEP40, &i)) { - prMib->dot11RSNAConfigGroupCipher = WPA_CIPHER_SUITE_WEP40; - } - else { - prMib->dot11RSNAConfigGroupCipher = WPA_CIPHER_SUITE_NONE; - } - -} /* secSetCipherSuite */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to handle The 2nd Tx EAPoL Frame. -* -* \param[in] prAdapter Pointer to the Adapter structure -* \param[in] prMsduInfo pointer to the packet info pointer -* \param[in] pucPayload pointer to the 1x hdr -* \param[in] u2PayloadLen the 1x payload length -* -* \retval TRUE Accept the packet -* \retval FALSE Refuse the MSDU packet due port control -* -*/ -/*----------------------------------------------------------------------------*/ -BOOL -secProcessEAPOL ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN P_STA_RECORD_T prStaRec, - IN PUINT_8 pucPayload, - IN UINT_16 u2PayloadLen -) -{ - P_EAPOL_KEY prEapol = (P_EAPOL_KEY)NULL; - P_IEEE_802_1X_HDR pr1xHdr; - UINT_16 u2KeyInfo; - - ASSERT(prMsduInfo); - ASSERT(prStaRec); - - //prStaRec = &(g_arStaRec[prMsduInfo->ucStaRecIndex]); - ASSERT(prStaRec); - - if (prStaRec && IS_AP_STA(prStaRec)) { - pr1xHdr = (P_IEEE_802_1X_HDR)pucPayload; - if ((pr1xHdr->ucType == 3) /* EAPoL key */ && ((u2PayloadLen - 4) > sizeof(EAPOL_KEY))) { - prEapol = (P_EAPOL_KEY)((PUINT_32)(pucPayload + 4)); - WLAN_GET_FIELD_BE16(prEapol->aucKeyInfo, &u2KeyInfo); - if ((prEapol->ucType == 254) && (u2KeyInfo & MASK_2ND_EAPOL)) { - if (u2KeyInfo & WPA_KEY_INFO_SECURE) { - /* 4th EAPoL check at secHandleTxDoneCallback() */ - //DBGLOG(RSN, TRACE, ("Tx 4th EAPoL frame\r\n")); - } - else if (u2PayloadLen == 123 /* Not include LLC */) { - DBGLOG(RSN, INFO, ("Tx 2nd EAPoL frame\r\n")); - secFsmEvent2ndEapolTx(prAdapter, prStaRec); - } - } - } - } - - return TRUE; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will handle the 4th EAPoL Tx done and mic Error Report frame. -* -* \param[in] prAdapter Pointer to the Adapter structure -* \param[in] pMsduInfo Pointer to the Msdu Info -* \param[in] rStatus The Tx done status -* -* \return - -*/ -/*----------------------------------------------------------------------------*/ -VOID -secHandleTxDoneCallback( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN P_STA_RECORD_T prStaRec, - IN WLAN_STATUS rStatus - ) -{ - PUINT_8 pucPayload; - P_IEEE_802_1X_HDR pr1xHdr = (P_IEEE_802_1X_HDR)NULL; - P_EAPOL_KEY prEapol = (P_EAPOL_KEY)NULL; - UINT_16 u2KeyInfo; - UINT_16 u2PayloadLen; - - DEBUGFUNC("secHandleTxDoneCallback"); - - ASSERT(prMsduInfo); - //Todo:: Notice if using the TX free immediate after send to firmware, the payload may not correcttly!!!! - - ASSERT(prStaRec); - - //Todo:: This call back may not need because the order of set key and send 4th 1x can be make sure - //Todo:: Notice the LLC offset - #if 1 - pucPayload = (PUINT_8)prMsduInfo->prPacket; - ASSERT(pucPayload); - - u2PayloadLen = prMsduInfo->u2FrameLength; - - if (0 /* prMsduInfo->fgIs1xFrame */) { - - if (prStaRec && IS_AP_STA(prStaRec)) { - pr1xHdr = (P_IEEE_802_1X_HDR)(PUINT_32)(pucPayload + 8); - if ((pr1xHdr->ucType == 3) /* EAPoL key */ && ((u2PayloadLen - 4) > sizeof(EAPOL_KEY))) { - prEapol = (P_EAPOL_KEY)(PUINT_32)(pucPayload + 12); - WLAN_GET_FIELD_BE16(prEapol->aucKeyInfo, &u2KeyInfo); - if ((prEapol->ucType == 254) && (u2KeyInfo & MASK_2ND_EAPOL)) { - if (prStaRec->rSecInfo.fg2nd1xSend == TRUE && u2PayloadLen == 107 /* include LLC *//* u2KeyInfo & WPA_KEY_INFO_SECURE */) { - DBGLOG(RSN, INFO, ("Tx 4th EAPoL frame\r\n")); - secFsmEvent4ndEapolTxDone(prAdapter, prStaRec); - } - else if (prAdapter->rWifiVar.rAisSpecificBssInfo.fgCheckEAPoLTxDone){ - DBGLOG(RSN, INFO, ("Tx EAPoL Error report frame\r\n")); - //secFsmEventEapolTxDone(prAdapter, (UINT_32)prMsduInfo->prStaRec); - } - } - } - } - - } - #endif -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to initialize the pmkid parameters. -* -* \param[in] prAdapter Pointer to the Adapter structure -* -* \retval NONE -*/ -/*----------------------------------------------------------------------------*/ -VOID -secClearPmkid ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecBssInfo; - - DEBUGFUNC("secClearPmkid"); - - prAisSpecBssInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - DBGLOG(RSN, TRACE, ("secClearPmkid\n")); - prAisSpecBssInfo->u4PmkidCandicateCount = 0; - prAisSpecBssInfo->u4PmkidCacheCount = 0; - kalMemZero((PVOID)prAisSpecBssInfo->arPmkidCandicate, sizeof(PMKID_CANDICATE_T) * CFG_MAX_PMKID_CACHE); - kalMemZero((PVOID)prAisSpecBssInfo->arPmkidCache, sizeof(PMKID_ENTRY_T) * CFG_MAX_PMKID_CACHE); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Whether WPA, or WPA2 but not WPA-None is enabled. -* -* \param[in] prAdapter Pointer to the Adapter structure -* -* \retval BOOLEAN -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -secRsnKeyHandshakeEnabled ( - IN P_ADAPTER_T prAdapter - ) -{ - P_CONNECTION_SETTINGS_T prConnSettings; - - ASSERT(prAdapter); - - prConnSettings = &prAdapter->rWifiVar.rConnSettings; - - ASSERT(prConnSettings); - - ASSERT(prConnSettings->eEncStatus < ENUM_ENCRYPTION3_KEY_ABSENT); - - if (prConnSettings->eEncStatus == ENUM_ENCRYPTION_DISABLED) { - return FALSE; - } - - ASSERT(prConnSettings->eAuthMode < AUTH_MODE_NUM); - if ((prConnSettings->eAuthMode >= AUTH_MODE_WPA) && - (prConnSettings->eAuthMode != AUTH_MODE_WPA_NONE)) { - return TRUE; - } - - return FALSE; -} /* secRsnKeyHandshakeEnabled */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Return whether the transmit key alread installed. -* -* \param[in] prAdapter Pointer to the Adapter structure -* \param[in] prSta Pointer the sta record -* -* \retval TRUE Default key or Transmit key installed -* FALSE Default key or Transmit key not installed -* -* \note: -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -secTransmitKeyExist ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - ASSERT(prSta); - - if (prSta->fgTransmitKeyExist){ - return TRUE; - } - else { - return FALSE; - } -} /* secTransmitKeyExist */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Whether 802.11 privacy is enabled. -* -* \param[in] prAdapter Pointer to the Adapter structure -* -* \retval BOOLEAN -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -secEnabledInAis ( - IN P_ADAPTER_T prAdapter - ) -{ - DEBUGFUNC("secEnabled"); - - ASSERT(prAdapter->rWifiVar.rConnSettings.eEncStatus < ENUM_ENCRYPTION3_KEY_ABSENT); - - switch (prAdapter->rWifiVar.rConnSettings.eEncStatus) { - case ENUM_ENCRYPTION_DISABLED: - return FALSE; - case ENUM_ENCRYPTION1_ENABLED: - case ENUM_ENCRYPTION2_ENABLED: - case ENUM_ENCRYPTION3_ENABLED: - return TRUE; - default: - DBGLOG(RSN, TRACE, ("Unknown encryption setting %d\n", - prAdapter->rWifiVar.rConnSettings.eEncStatus)); - break; - } - return FALSE; -} /* secEnabled */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set the privacy bit at mac header for TxM -* -* \param[in] prAdapter Pointer to the Adapter structure -* \param[in] prMsdu the msdu for known the sta record -* -* \return TRUE the privacy need to set -* FALSE the privacy no need to set -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -secIsProtectedFrame ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsdu, - IN P_STA_RECORD_T prStaRec - ) -{ - ASSERT(prAdapter); - - ASSERT(prMsdu); - - ASSERT(prStaRec); - //prStaRec = &(g_arStaRec[prMsdu->ucStaRecIndex]); - - if (prStaRec == NULL) { - if (prAdapter->rWifiVar.rAisSpecificBssInfo.fgTransmitKeyExist) - return TRUE; - return FALSE; /* No privacy bit */ - } - - /* Todo:: */ - if (0 /* prMsdu->fgIs1xFrame */){ - if (IS_STA_IN_AIS(prStaRec) && - prAdapter->rWifiVar.rConnSettings.eAuthMode < AUTH_MODE_WPA) { - DBGLOG(RSN, LOUD, ("For AIS Legacy 1x, always not encryped\n")); - return FALSE; - } - else if (!prStaRec->fgTransmitKeyExist) { - DBGLOG(RSN, LOUD, ("1x Not Protected.\n")); - return FALSE; - } - else if (prStaRec->rSecInfo.fgKeyStored) { - DBGLOG(RSN, LOUD, ("1x not Protected due key stored!\n")); - return FALSE; - } - else { - DBGLOG(RSN, LOUD, ("1x Protected.\n")); - return TRUE; - } - } - else { - if (!prStaRec->fgTransmitKeyExist) { - /* whsu , check for AIS only */ - if (prAdapter->rWifiVar.rConnSettings.eAuthMode < AUTH_MODE_WPA && - prAdapter->rWifiVar.rAisSpecificBssInfo.fgTransmitKeyExist){ - DBGLOG(RSN, LOUD, ("Protected\n")); - return TRUE; - } - } - else { - DBGLOG(RSN, LOUD, ("Protected.\n")); - return TRUE; - } - } - - /* No sec or key is removed!!! */ - return FALSE; -} -#endif diff --git a/drivers/net/wireless/mt5931/mgmt/rate.c b/drivers/net/wireless/mt5931/mgmt/rate.c deleted file mode 100755 index c63fe7b7d641..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/rate.c +++ /dev/null @@ -1,547 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/rate.c#1 $ -*/ - -/*! \file "rate.c" - \brief This file contains the transmission rate handling routines. - - This file contains the transmission rate handling routines for setting up - ACK/CTS Rate, Highest Tx Rate, Lowest Tx Rate, Initial Tx Rate and do - conversion between Rate Set and Data Rates. -*/ - - - -/* -** $Log: rate.c $ - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add rate.c. - * - * 03 16 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add AdHoc Mode - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * Nov 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Update comments - * - * Nov 16 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix DBGLOG - * - * Nov 5 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -** \main\maintrunk.MT5921\12 2008-12-19 17:19:32 GMT mtk01461 -** Fix the problem that do not ASSERT the length of Supported Rate IE == 8 -** \main\maintrunk.MT5921\11 2008-12-01 18:17:42 GMT mtk01088 -** fixed the lint "possible using null pointer" warning -** \main\maintrunk.MT5921\10 2008-08-20 00:16:36 GMT mtk01461 -** Update for Driver Review -** \main\maintrunk.MT5921\9 2008-04-13 21:17:13 GMT mtk01461 -** Revise GEN Link Speed OID -** \main\maintrunk.MT5921\8 2008-03-28 10:40:13 GMT mtk01461 -** Add rateGetRateSetFromDataRates() for set desired rate OID -** \main\maintrunk.MT5921\7 2008-03-26 09:16:20 GMT mtk01461 -** Add adopt operational rate as ACK rate if BasicRateSet was not found -** Add comments -** \main\maintrunk.MT5921\6 2008-02-21 15:01:39 GMT mtk01461 -** Add initial rate according rx signal quality support -** \main\maintrunk.MT5921\5 2008-01-07 15:06:44 GMT mtk01461 -** Fix typo of rate adaptation of CtrlResp Frame -** \main\maintrunk.MT5921\4 2007-10-25 18:05:12 GMT mtk01461 -** Add VOIP SCAN Support & Refine Roaming -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -/* The list of valid data rates. */ -const UINT_8 aucDataRate[] = { - RATE_1M, /* RATE_1M_INDEX = 0 */ - RATE_2M, /* RATE_2M_INDEX */ - RATE_5_5M, /* RATE_5_5M_INDEX */ - RATE_11M, /* RATE_11M_INDEX */ - RATE_22M, /* RATE_22M_INDEX */ - RATE_33M, /* RATE_33M_INDEX */ - RATE_6M, /* RATE_6M_INDEX */ - RATE_9M, /* RATE_9M_INDEX */ - RATE_12M, /* RATE_12M_INDEX */ - RATE_18M, /* RATE_18M_INDEX */ - RATE_24M, /* RATE_24M_INDEX */ - RATE_36M, /* RATE_36M_INDEX */ - RATE_48M, /* RATE_48M_INDEX */ - RATE_54M, /* RATE_54M_INDEX */ - RATE_HT_PHY /* RATE_HT_PHY_INDEX */ -}; - -static const UINT_8 aucDefaultAckCtsRateIndex[RATE_NUM] = { - RATE_1M_INDEX, /* RATE_1M_INDEX = 0 */ - RATE_2M_INDEX, /* RATE_2M_INDEX */ - RATE_5_5M_INDEX, /* RATE_5_5M_INDEX */ - RATE_11M_INDEX, /* RATE_11M_INDEX */ - RATE_1M_INDEX, /* RATE_22M_INDEX - Not supported */ - RATE_1M_INDEX, /* RATE_33M_INDEX - Not supported */ - RATE_6M_INDEX, /* RATE_6M_INDEX */ - RATE_6M_INDEX, /* RATE_9M_INDEX */ - RATE_12M_INDEX, /* RATE_12M_INDEX */ - RATE_12M_INDEX, /* RATE_18M_INDEX */ - RATE_24M_INDEX, /* RATE_24M_INDEX */ - RATE_24M_INDEX, /* RATE_36M_INDEX */ - RATE_24M_INDEX, /* RATE_48M_INDEX */ - RATE_24M_INDEX /* RATE_54M_INDEX */ -}; - -const BOOLEAN afgIsOFDMRate[RATE_NUM] = { - FALSE, /* RATE_1M_INDEX = 0 */ - FALSE, /* RATE_2M_INDEX */ - FALSE, /* RATE_5_5M_INDEX */ - FALSE, /* RATE_11M_INDEX */ - FALSE, /* RATE_22M_INDEX - Not supported */ - FALSE, /* RATE_33M_INDEX - Not supported */ - TRUE, /* RATE_6M_INDEX */ - TRUE, /* RATE_9M_INDEX */ - TRUE, /* RATE_12M_INDEX */ - TRUE, /* RATE_18M_INDEX */ - TRUE, /* RATE_24M_INDEX */ - TRUE, /* RATE_36M_INDEX */ - TRUE, /* RATE_48M_INDEX */ - TRUE /* RATE_54M_INDEX */ -}; - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/*! -* @brief Convert the given Supported Rate & Extended Supported Rate IE to the -* Operational Rate Set and Basic Rate Set, and also check if any Basic -* Rate Code is unknown by driver. -* -* @param[in] prIeSupportedRate Pointer to the Supported Rate IE -* @param[in] prIeExtSupportedRate Pointer to the Ext Supported Rate IE -* @param[out] pu2OperationalRateSet Pointer to the Operational Rate Set -* @param[out] pu2BSSBasicRateSet Pointer to the Basic Rate Set -* @param[out] pfgIsUnknownBSSBasicRate Pointer to a Flag to indicate that Basic -* Rate Set has unknown Rate Code -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -rateGetRateSetFromIEs ( - IN P_IE_SUPPORTED_RATE_T prIeSupportedRate, - IN P_IE_EXT_SUPPORTED_RATE_T prIeExtSupportedRate, - OUT PUINT_16 pu2OperationalRateSet, - OUT PUINT_16 pu2BSSBasicRateSet, - OUT PBOOLEAN pfgIsUnknownBSSBasicRate - ) -{ - UINT_16 u2OperationalRateSet = 0; - UINT_16 u2BSSBasicRateSet = 0; - BOOLEAN fgIsUnknownBSSBasicRate = FALSE; - UINT_8 ucRate; - UINT_32 i, j; - - - ASSERT(pu2OperationalRateSet); - ASSERT(pu2BSSBasicRateSet); - ASSERT(pfgIsUnknownBSSBasicRate); - - if (prIeSupportedRate) { - /* NOTE(Kevin): Buffalo WHR-G54S's supported rate set IE exceed 8. - * IE_LEN(pucIE) == 12, "1(B), 2(B), 5.5(B), 6(B), 9(B), 11(B), - * 12(B), 18(B), 24(B), 36(B), 48(B), 54(B)" - */ - //ASSERT(prIeSupportedRate->ucLength <= ELEM_MAX_LEN_SUP_RATES); - ASSERT(prIeSupportedRate->ucLength <= RATE_NUM); - - for (i = 0; i < prIeSupportedRate->ucLength; i++) { - ucRate = prIeSupportedRate->aucSupportedRates[i] & RATE_MASK; - - /* Search all valid data rates */ - for (j = 0; j < sizeof(aucDataRate)/sizeof(UINT_8); j++) { - if (ucRate == aucDataRate[j]) { - u2OperationalRateSet |= BIT(j); - - if (prIeSupportedRate->aucSupportedRates[i] & RATE_BASIC_BIT) { - u2BSSBasicRateSet |= BIT(j); - } - - break; - } - } - - if ((j == sizeof(aucDataRate)/sizeof(UINT_8)) && - (prIeSupportedRate->aucSupportedRates[i] & RATE_BASIC_BIT)) { - fgIsUnknownBSSBasicRate = TRUE; /* A data rate not list in the aucDataRate[] */ - } - } - } - - - if (prIeExtSupportedRate) { - //ASSERT(prIeExtSupportedRate->ucLength <= ELEM_MAX_LEN_EXTENDED_SUP_RATES); - - for (i = 0; i < prIeExtSupportedRate->ucLength; i++) { - ucRate = prIeExtSupportedRate->aucExtSupportedRates[i] & RATE_MASK; - - /* Search all valid data rates */ - for (j = 0; j < sizeof(aucDataRate)/sizeof(UINT_8); j++) { - if (ucRate == aucDataRate[j]) { - u2OperationalRateSet |= BIT(j); - - if (prIeExtSupportedRate->aucExtSupportedRates[i] & RATE_BASIC_BIT) { - u2BSSBasicRateSet |= BIT(j); - } - - break; - } - } - - if ((j == sizeof(aucDataRate)/sizeof(UINT_8)) && - (prIeExtSupportedRate->aucExtSupportedRates[i] & RATE_BASIC_BIT)) { - fgIsUnknownBSSBasicRate = TRUE; /* A data rate not list in the aucDataRate[] */ - } - } - } - - *pu2OperationalRateSet = u2OperationalRateSet; - *pu2BSSBasicRateSet = u2BSSBasicRateSet; - *pfgIsUnknownBSSBasicRate = fgIsUnknownBSSBasicRate; - - return; - -} /* end of rateGetRateSetFromIEs() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Convert the given Operational Rate Set & Basic Rate Set to the Rate Code -* Format for used in (Ext)Supportec Rate IE. -* -* @param[in] u2OperationalRateSet Operational Rate Set -* @param[in] u2BSSBasicRateSet Basic Rate Set -* @param[out] pucDataRates Pointer to the Data Rate Buffer -* @param[out] pucDataRatesLen Pointer to the Data Rate Buffer Length -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -rateGetDataRatesFromRateSet ( - IN UINT_16 u2OperationalRateSet, - IN UINT_16 u2BSSBasicRateSet, - OUT PUINT_8 pucDataRates, - OUT PUINT_8 pucDataRatesLen - ) -{ - UINT_32 i, j; - - - ASSERT(pucDataRates); - ASSERT(pucDataRatesLen); - - ASSERT(u2BSSBasicRateSet == (u2OperationalRateSet & u2BSSBasicRateSet)); - - for (i = RATE_1M_INDEX, j = 0; i < RATE_NUM; i++) { - if (u2OperationalRateSet & BIT(i)) { - - *(pucDataRates + j) = aucDataRate[i]; - - if (u2BSSBasicRateSet & BIT(i)) { - *(pucDataRates + j) |= RATE_BASIC_BIT; - } - - j++; - } - } - - *pucDataRatesLen = (UINT_8)j; - - return; - -} /* end of rateGetDataRatesFromRateSet() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Get the highest rate from given Rate Set. -* -* \param[in] u2RateSet Rate Set -* \param[out] pucHighestRateIndex Pointer to buffer of the Highest Rate Index -* -* \retval TRUE Highest Rate Index was found -* \retval FALSE Highest Rate Index was not found -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rateGetHighestRateIndexFromRateSet ( - IN UINT_16 u2RateSet, - OUT PUINT_8 pucHighestRateIndex - ) -{ - INT_32 i; - - - ASSERT(pucHighestRateIndex); - - for (i = RATE_54M_INDEX; i >= RATE_1M_INDEX; i--) { - if (u2RateSet & BIT(i)) { - *pucHighestRateIndex = (UINT_8)i; - return TRUE; - } - } - - return FALSE; - -} /* end of rateGetHighestRateIndexFromRateSet() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Get the lowest rate from given Rate Set. -* -* \param[in] u2RateSet Rate Set -* \param[out] pucLowestRateIndex Pointer to buffer of the Lowest Rate Index -* -* \retval TRUE Lowest Rate Index was found -* \retval FALSE Lowest Rate Index was not found -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rateGetLowestRateIndexFromRateSet ( - IN UINT_16 u2RateSet, - OUT PUINT_8 pucLowestRateIndex - ) -{ - UINT_32 i; - - ASSERT(pucLowestRateIndex); - - for (i = RATE_1M_INDEX; i <= RATE_54M_INDEX; i++) { - if (u2RateSet & BIT(i)) { - *pucLowestRateIndex = (UINT_8)i; - return TRUE; - } - } - - return FALSE; - -} /* end of rateGetLowestRateIndexFromRateSet() */ - - -#if 0 // NOTE(Kevin): For reference -/*----------------------------------------------------------------------------*/ -/*! -* \brief Convert the given Data Rates to the Rate Set. -* -* \param[in] pucDataRates Pointer to the Data Rates -* \param[in] ucDataRatesLen Length of given Data Rates -* \param[out] pu2RateSet Pointer to the Rate Set -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -rateGetRateSetFromDataRates ( - IN PUINT_8 pucDataRates, - IN UINT_8 ucDataRatesLen, - OUT PUINT_16 pu2RateSet - ) -{ - UINT_16 u2RateSet = 0; - UINT_8 ucRate; - UINT_32 i, j; - - - ASSERT(pucDataRates); - ASSERT(pu2RateSet); - - if (pucDataRates) { - for (i = 0; i < ucDataRatesLen; i++) { - ucRate = pucDataRates[i] & RATE_MASK; - - /* Search all valid data rates */ - for (j = 0; j < sizeof(aucDataRate)/sizeof(UINT_8); j++) { - if (ucRate == aucDataRate[j]) { - u2RateSet |= BIT(j); - break; - } - } - } - } - - *pu2RateSet = u2RateSet; - - return; - -} /* end of rateGetRateSetFromDataRates() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Parse the Operational Rate Set and Basic Rate Set to get the corresponding -* ACK/CTS(Respnose) TX Rates. -* -* \param[in] u2OperationalRateSet Operational Rate Set -* \param[in] u2BSSBasicRateSet Basic Rate Set -* \param[out] aucAckCtsRateIndex Pointer to the Ack/Cts Data Rate Buffer -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -rateSetAckCtsDataRatesFromRateSet ( - IN UINT_16 u2OperationalRateSet, - IN UINT_16 u2BSSBasicRateSet, - IN OUT UINT_8 aucAckCtsRateIndex[] - ) -{ - INT_32 i,j; - - - ASSERT(aucAckCtsRateIndex); - ASSERT(u2BSSBasicRateSet == (u2OperationalRateSet & u2BSSBasicRateSet)); - - /* Setup default ACK/CTS response rate */ - kalMemCopy(aucAckCtsRateIndex, (PVOID)aucDefaultAckCtsRateIndex, sizeof(aucDefaultAckCtsRateIndex)); - - - for (i = RATE_54M_INDEX; i >= RATE_1M_INDEX; i--) { - if (u2OperationalRateSet & BIT(i)) { - for (j = i; j >= RATE_1M_INDEX; j--) { - if (u2BSSBasicRateSet & BIT(j)) { - if ((afgIsOFDMRate[i] && afgIsOFDMRate[j]) || (!afgIsOFDMRate[i] && !afgIsOFDMRate[j])) // Reply ACK Frame at the same Modulation Scheme. - aucAckCtsRateIndex[i] = (UINT_8)j; - break; - } - } - - /* NOTE(Kevin 2008/03/25): Following code is used for those AP which has - * NULL BasicRateSet. - * e.g. If input Operational Rate Set = [18M 12M 9M], Basic Rate Set = NULL. - * Originally we'll get Ack Rate for [18M 12M 9M] is [12M 12M "6M"]. - * Now we'll get Ack Rate for [18M 12M 9M] is [12M 12M 9M], - * The Ack Rate for Tx Rates which are not list in Operational Rate Set is still - * use highest mandatory rate as default. - */ - if (j < RATE_1M_INDEX) { /* The ACK/CTS rate was not found in BasicRateSet */ - if (!(BIT(aucAckCtsRateIndex[i]) & u2OperationalRateSet)) { - aucAckCtsRateIndex[i] = (UINT_8)i; - } - } - } - } - - return; - -} /* end of rateSetAckCtsDataRatesFromRateSet() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Get the proper initial rate from Rate Set according to given RCPI value -* -* \param[in] u2RateSet Rate Set -* \param[in] rRcpi RCPI value from AP or Peer STA -* \param[out] pucInitialRateIndex Pointer to buffer of the initial Rate Index -* -* \retval TRUE Initial Rate Index was found -* \retval FALSE Initial Rate Index was not found -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rateGetBestInitialRateIndex ( - IN UINT_16 u2RateSet, - IN RCPI rRcpi, - OUT PUINT_8 pucInitialRateIndex - ) -{ - UINT_16 u2InitRateSet; - INT_32 i; - - - ASSERT(pucInitialRateIndex); - - DBGLOG(MGT, TRACE, ("rRcpi = %d\n", rRcpi)); - - if (rRcpi >= RCPI_100) { /* Best Signal */ - u2InitRateSet = INITIAL_RATE_SET(RCPI_100); - } - else if (rRcpi >= RCPI_80) { /* Better Signal */ - u2InitRateSet = INITIAL_RATE_SET(RCPI_80); - } - else if (rRcpi >= RCPI_60) { /* Good Signal */ - u2InitRateSet = INITIAL_RATE_SET(RCPI_60); - } - else { /* Worse Signal */ - /* NOTE(Kevin): If return FALSE, we should assign the BSS Basic Rate Index - * (prBssInfo->ucBasicRateIndex) to the initial rate. It was determined in - * function - bssUpdateTxRateForControlFrame(). - */ - return FALSE; - } - - u2RateSet &= u2InitRateSet; - - for (i = RATE_54M_INDEX; i >= RATE_1M_INDEX; i--) { - if (u2RateSet & BIT(i)) { - *pucInitialRateIndex = (UINT_8)i; - return TRUE; - } - } - - return FALSE; - -} /* end of rateGetBestInitialRateIndex() */ -#endif - diff --git a/drivers/net/wireless/mt5931/mgmt/rlm.c b/drivers/net/wireless/mt5931/mgmt/rlm.c deleted file mode 100755 index 1954f88e48dd..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/rlm.c +++ /dev/null @@ -1,1723 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/rlm.c#2 $ -*/ - -/*! \file "rlm.c" - \brief - -*/ - - - -/* -** $Log: rlm.c $ - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 11 15 2011 cm.chang - * NULL - * Check length HT cap IE about RX associate request frame - * - * 11 10 2011 cm.chang - * NULL - * Modify debug message for XLOG - * - * 11 08 2011 cm.chang - * NULL - * Add RLM and CNM debug message for XLOG - * - * 11 03 2011 cm.chang - * [WCXRP00000997] [MT6620 Wi-Fi][Driver][FW] Handle change of BSS preamble type and slot time - * Fix preamble type of STA mode - * - * 10 25 2011 cm.chang - * [WCXRP00001058] [All Wi-Fi][Driver] Fix sta_rec's phyTypeSet and OBSS scan in AP mode - * Not send ERP IE if peer STA is 802.11b-only - * - * 10 11 2011 cm.chang - * [WCXRP00001031] [All Wi-Fi][Driver] Check HT IE length to avoid wrong SCO parameter - * Ignore HT OP IE if its length field is not valid - * - * 09 28 2011 cm.chang - * NULL - * Add length check to reduce possibility to adopt wrong IE - * - * 09 20 2011 cm.chang - * [WCXRP00000997] [MT6620 Wi-Fi][Driver][FW] Handle change of BSS preamble type and slot time - * Handle client mode about preamble type and slot time - * - * 09 01 2011 cm.chang - * [WCXRP00000971] [MT6620 Wi-Fi][Driver][FW] Not set Beacon timeout interval when CPTT - * Final channel number only adopts the field from assoc response - * - * 06 10 2011 cm.chang - * [WCXRP00000773] [MT6620 Wi-Fi][Driver] Workaround some AP fill primary channel field with its secondary channel - * If DS IE exists, ignore the primary channel field in HT OP IE - * - * 05 03 2011 cm.chang - * [WCXRP00000691] [MT6620 Wi-Fi][Driver] Workaround about AP's wrong HT capability IE to have wrong channel number - * Fix compiling error - * - * 05 02 2011 cm.chang - * [WCXRP00000691] [MT6620 Wi-Fi][Driver] Workaround about AP's wrong HT capability IE to have wrong channel number - * Refine range of valid channel number - * - * 05 02 2011 cm.chang - * [WCXRP00000691] [MT6620 Wi-Fi][Driver] Workaround about AP's wrong HT capability IE to have wrong channel number - * Check if channel is valided before record ing BSS channel - * - * 04 14 2011 cm.chang - * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency - * . - * - * 04 12 2011 cm.chang - * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency - * . - * - * 03 29 2011 cm.chang - * [WCXRP00000606] [MT6620 Wi-Fi][Driver][FW] Fix klocwork warning - * As CR title - * - * 01 24 2011 cm.chang - * [WCXRP00000384] [MT6620 Wi-Fi][Driver][FW] Handle 20/40 action frame in AP mode and stop ampdu timer when sta_rec is freed - * Process received 20/40 coexistence action frame for AP mode - * - * 12 13 2010 cp.wu - * [WCXRP00000260] [MT6620 Wi-Fi][Driver][Firmware] Create V1.1 branch for both firmware and driver - * create branch for Wi-Fi driver v1.1 - * - * 12 07 2010 cm.chang - * [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk - * 1. BSSINFO include RLM parameter - * 2. free all sta records when network is disconnected - * - * 12 07 2010 cm.chang - * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant - * 1. Country code is from NVRAM or supplicant - * 2. Change band definition in CMD/EVENT. - * - * 10 15 2010 cm.chang - * [WCXRP00000094] [MT6620 Wi-Fi][Driver] Connect to 2.4GHz AP, Driver crash. - * Add exception handle when no mgmt buffer in free build - * - * 10 08 2010 cm.chang - * NULL - * When 20M only setting, ignore OBSS IE - * - * 09 16 2010 cm.chang - * NULL - * Change conditional compiling options for BOW - * - * 09 10 2010 cm.chang - * NULL - * Always update Beacon content if FW sync OBSS info - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 24 2010 cm.chang - * NULL - * Support RLM initail channel of Ad-hoc, P2P and BOW - * - * 08 23 2010 cp.wu - * NULL - * revise constant definitions to be matched with implementation (original cmd-event definition is deprecated) - * - * 08 23 2010 chinghwa.yu - * NULL - * Temporary add rlmUpdateParamByStaForBow() and rlmBssInitForBow(). - * - * 08 23 2010 chinghwa.yu - * NULL - * Add CFG_ENABLE_BT_OVER_WIFI. - * - * 08 23 2010 chinghwa.yu - * NULL - * Update for BOW. - * - * 08 20 2010 cm.chang - * NULL - * Migrate RLM code to host from FW - * - * 08 02 2010 yuche.tsai - * NULL - * P2P Group Negotiation Code Check in. - * - * 07 26 2010 yuche.tsai - * - * Fix compile error while enabling WiFi Direct function. - * - * 07 21 2010 yuche.tsai - * - * Add P2P Scan & Scan Result Parsing & Saving. - * - * 07 19 2010 cm.chang - * - * Set RLM parameters and enable CNM channel manager - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * take use of RLM module for parsing/generating HT IEs for 11n capability - * - * 07 08 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Check draft RLM code for HT cap - * - * 06 05 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Fix channel ID definition in RFB status to primary channel instead of center channel - * - * 06 02 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add TX short GI compiling option - * - * 06 02 2010 chinghwa.yu - * [BORA00000563]Add WiFi CoEx BCM module - * Roll back to remove CFG_SUPPORT_BCM_TEST. - * - * 06 01 2010 chinghwa.yu - * [BORA00000563]Add WiFi CoEx BCM module - * Update BCM Test and RW configuration. - * - * 05 31 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add some compiling options to control 11n functions - * - * 05 28 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Set RTS threshold of 2K bytes initially - * - * 05 18 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Ad-hoc Beacon should not carry HT OP and OBSS IEs - * - * 05 07 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Process 20/40 coexistence public action frame in AP mode - * - * 05 05 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * First draft support for 20/40M bandwidth for AP mode - * - * 04 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW - * - * 04 22 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * First draft code to support protection in AP mode - * - * 04 13 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Utilize status of swRfb to know channel number and band - * - * 04 07 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Different invoking order for WTBL entry of associated AP - * - * 04 07 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add virtual test for OBSS scan - * - * 04 02 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Process Beacon only ready for infra STA now - * - * 03 30 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support 2.4G OBSS scan - * - * 03 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Not carry HT cap when being associated with b/g only AP - * - * 03 24 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * fixed some WHQL testing error. - * - * 03 15 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Provide draft measurement and quiet functions - * - * 03 09 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * If bss is not 11n network, zero WTBL HT parameters - * - * 03 03 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * To support CFG_SUPPORT_BCM_STP - * - * 03 02 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Generate HT IE only depending on own phyTypeSet - * - * 03 02 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Not fill HT related IE if BssInfo does not include 11n phySet - * - * 03 01 2010 tehuang.liu - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * To store field AMPDU Parameters in STA_REC - * - * 02 26 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Enable RDG RX, but disable RDG TX for IOT and LongNAV - * - * 02 12 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Use bss info array for concurrent handle - * - * 02 05 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup - * - * 01 22 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support protection and bandwidth switch - * - * 01 07 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Modify the parameter of rlmRecAssocRspHtInfo function - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * Dec 12 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix prBssInfo->ucPrimaryChannel handle for assoc resp - * - * Dec 9 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add some function to process HT operation - * - * Nov 28 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Call rlmStatisticsInit() to handle MIB counters - * - * Nov 18 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * - * -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -static VOID -rlmFillHtCapIE ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - P_MSDU_INFO_T prMsduInfo - ); - -static VOID -rlmFillExtCapIE ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - P_MSDU_INFO_T prMsduInfo - ); - -static VOID -rlmFillHtOpIE ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - P_MSDU_INFO_T prMsduInfo - ); - -static UINT_8 -rlmRecIeInfoForClient ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - PUINT_8 pucIE, - UINT_16 u2IELength - ); - -static BOOLEAN -rlmRecBcnFromNeighborForClient ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - P_SW_RFB_T prSwRfb, - PUINT_8 pucIE, - UINT_16 u2IELength - ); - -static BOOLEAN -rlmRecBcnInfoForClient ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - P_SW_RFB_T prSwRfb, - PUINT_8 pucIE, - UINT_16 u2IELength - ); - -static VOID -rlmBssReset ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmFsmEventInit ( - P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - /* Note: assume TIMER_T structures are reset to zero or stopped - * before invoking this function. - */ - - /* Initialize OBSS FSM */ - rlmObssInit(prAdapter); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmFsmEventUninit ( - P_ADAPTER_T prAdapter - ) -{ - P_BSS_INFO_T prBssInfo; - UINT_8 ucNetIdx; - - ASSERT(prAdapter); - - RLM_NET_FOR_EACH(ucNetIdx) { - prBssInfo = &prAdapter->rWifiVar.arBssInfo[ucNetIdx]; - ASSERT(prBssInfo); - - /* Note: all RLM timers will also be stopped. - * Now only one OBSS scan timer. - */ - rlmBssReset(prAdapter, prBssInfo); - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief For probe request, association request -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmReqGenerateHtCapIE ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ) -{ - P_BSS_INFO_T prBssInfo; - P_STA_RECORD_T prStaRec; - - ASSERT(prAdapter); - ASSERT(prMsduInfo); - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prMsduInfo->ucNetworkType]; - ASSERT(prBssInfo); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - if ((prAdapter->rWifiVar.ucAvailablePhyTypeSet & PHY_TYPE_SET_802_11N) && - (!prStaRec || (prStaRec->ucPhyTypeSet & PHY_TYPE_SET_802_11N))) { - - rlmFillHtCapIE(prAdapter, prBssInfo, prMsduInfo); - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief For probe request, association request -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmReqGenerateExtCapIE ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ) -{ - P_BSS_INFO_T prBssInfo; - P_STA_RECORD_T prStaRec; - - ASSERT(prAdapter); - ASSERT(prMsduInfo); - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prMsduInfo->ucNetworkType]; - ASSERT(prBssInfo); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - if ((prAdapter->rWifiVar.ucAvailablePhyTypeSet & PHY_TYPE_SET_802_11N) && - (!prStaRec || (prStaRec->ucPhyTypeSet & PHY_TYPE_SET_802_11N))) { - - rlmFillExtCapIE(prAdapter, prBssInfo, prMsduInfo); - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief For probe response (GO, IBSS) and association response -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmRspGenerateHtCapIE ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ) -{ - P_BSS_INFO_T prBssInfo; - P_STA_RECORD_T prStaRec; - - ASSERT(prAdapter); - ASSERT(prMsduInfo); - ASSERT(IS_NET_ACTIVE(prAdapter, prMsduInfo->ucNetworkType)); - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prMsduInfo->ucNetworkType]; - ASSERT(prBssInfo); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - if (RLM_NET_IS_11N(prBssInfo) && - (!prStaRec || (prStaRec->ucPhyTypeSet & PHY_TYPE_SET_802_11N))) { - - rlmFillHtCapIE(prAdapter, prBssInfo, prMsduInfo); - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief For probe response (GO, IBSS) and association response -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmRspGenerateExtCapIE ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ) -{ - P_BSS_INFO_T prBssInfo; - P_STA_RECORD_T prStaRec; - - ASSERT(prAdapter); - ASSERT(prMsduInfo); - ASSERT(IS_NET_ACTIVE(prAdapter, prMsduInfo->ucNetworkType)); - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prMsduInfo->ucNetworkType]; - ASSERT(prBssInfo); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - if (RLM_NET_IS_11N(prBssInfo) && - (!prStaRec || (prStaRec->ucPhyTypeSet & PHY_TYPE_SET_802_11N))) { - - rlmFillExtCapIE(prAdapter, prBssInfo, prMsduInfo); - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief For probe response (GO, IBSS) and association response -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmRspGenerateHtOpIE ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ) -{ - P_BSS_INFO_T prBssInfo; - P_STA_RECORD_T prStaRec; - - ASSERT(prAdapter); - ASSERT(prMsduInfo); - ASSERT(IS_NET_ACTIVE(prAdapter, prMsduInfo->ucNetworkType)); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prMsduInfo->ucNetworkType]; - ASSERT(prBssInfo); - - if (RLM_NET_IS_11N(prBssInfo) && - (!prStaRec || (prStaRec->ucPhyTypeSet & PHY_TYPE_SET_802_11N))) { - - rlmFillHtOpIE(prAdapter, prBssInfo, prMsduInfo); - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief For probe response (GO, IBSS) and association response -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmRspGenerateErpIE ( - P_ADAPTER_T prAdapter, - P_MSDU_INFO_T prMsduInfo - ) -{ - P_BSS_INFO_T prBssInfo; - P_STA_RECORD_T prStaRec; - P_IE_ERP_T prErpIe; - - ASSERT(prAdapter); - ASSERT(prMsduInfo); - ASSERT(IS_NET_ACTIVE(prAdapter, prMsduInfo->ucNetworkType)); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prMsduInfo->ucNetworkType]; - ASSERT(prBssInfo); - - if (RLM_NET_IS_11GN(prBssInfo) && prBssInfo->eBand == BAND_2G4 && - (!prStaRec || (prStaRec->ucPhyTypeSet & PHY_TYPE_SET_802_11GN))) { - prErpIe = (P_IE_ERP_T) - (((PUINT_8) prMsduInfo->prPacket) + prMsduInfo->u2FrameLength); - - /* Add ERP IE */ - prErpIe->ucId = ELEM_ID_ERP_INFO; - prErpIe->ucLength = 1; - - prErpIe->ucERP = prBssInfo->fgObssErpProtectMode ? - ERP_INFO_USE_PROTECTION : 0; - - if (prBssInfo->fgErpProtectMode) { - prErpIe->ucERP |= - (ERP_INFO_NON_ERP_PRESENT | ERP_INFO_USE_PROTECTION); - } - - /* Handle barker preamble */ - if (!prBssInfo->fgUseShortPreamble) { - prErpIe->ucERP |= ERP_INFO_BARKER_PREAMBLE_MODE; - } - - ASSERT(IE_SIZE(prErpIe) <= (ELEM_HDR_LEN+ ELEM_MAX_LEN_ERP)); - - prMsduInfo->u2FrameLength += IE_SIZE(prErpIe); - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -static VOID -rlmFillHtCapIE ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - P_MSDU_INFO_T prMsduInfo - ) -{ - P_IE_HT_CAP_T prHtCap; - P_SUP_MCS_SET_FIELD prSupMcsSet; - BOOLEAN fg40mAllowed; - - ASSERT(prAdapter); - ASSERT(prBssInfo); - ASSERT(prMsduInfo); - - fg40mAllowed = prBssInfo->fgAssoc40mBwAllowed; - - prHtCap = (P_IE_HT_CAP_T) - (((PUINT_8) prMsduInfo->prPacket) + prMsduInfo->u2FrameLength); - - /* Add HT capabilities IE */ - prHtCap->ucId = ELEM_ID_HT_CAP; - prHtCap->ucLength = sizeof(IE_HT_CAP_T) - ELEM_HDR_LEN; - - prHtCap->u2HtCapInfo = HT_CAP_INFO_DEFAULT_VAL; - if (!fg40mAllowed) { - prHtCap->u2HtCapInfo &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH | - HT_CAP_INFO_SHORT_GI_40M | HT_CAP_INFO_DSSS_CCK_IN_40M); - } - if (prAdapter->rWifiVar.rConnSettings.fgRxShortGIDisabled) { - prHtCap->u2HtCapInfo &= - ~(HT_CAP_INFO_SHORT_GI_20M | HT_CAP_INFO_SHORT_GI_40M); - } - - prHtCap->ucAmpduParam = AMPDU_PARAM_DEFAULT_VAL; - - prSupMcsSet = &prHtCap->rSupMcsSet; - kalMemZero((PVOID)&prSupMcsSet->aucRxMcsBitmask[0], - SUP_MCS_RX_BITMASK_OCTET_NUM); - - prSupMcsSet->aucRxMcsBitmask[0] = BITS(0, 7); - - if (fg40mAllowed) { - prSupMcsSet->aucRxMcsBitmask[32/8] = BIT(0); /* MCS32 */ - } - prSupMcsSet->u2RxHighestSupportedRate = SUP_MCS_RX_DEFAULT_HIGHEST_RATE; - prSupMcsSet->u4TxRateInfo = SUP_MCS_TX_DEFAULT_VAL; - - prHtCap->u2HtExtendedCap = HT_EXT_CAP_DEFAULT_VAL; - if (!fg40mAllowed || prBssInfo->eCurrentOPMode != OP_MODE_INFRASTRUCTURE) { - prHtCap->u2HtExtendedCap &= - ~(HT_EXT_CAP_PCO | HT_EXT_CAP_PCO_TRANS_TIME_NONE); - } - - prHtCap->u4TxBeamformingCap = TX_BEAMFORMING_CAP_DEFAULT_VAL; - - prHtCap->ucAselCap = ASEL_CAP_DEFAULT_VAL; - - - ASSERT(IE_SIZE(prHtCap) <= (ELEM_HDR_LEN + ELEM_MAX_LEN_HT_CAP)); - - prMsduInfo->u2FrameLength += IE_SIZE(prHtCap); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -static VOID -rlmFillExtCapIE ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - P_MSDU_INFO_T prMsduInfo - ) -{ - P_EXT_CAP_T prExtCap; - BOOLEAN fg40mAllowed; - - ASSERT(prAdapter); - ASSERT(prMsduInfo); - - fg40mAllowed = prBssInfo->fgAssoc40mBwAllowed; - - /* Add Extended Capabilities IE */ - prExtCap = (P_EXT_CAP_T) - (((PUINT_8) prMsduInfo->prPacket) + prMsduInfo->u2FrameLength); - - prExtCap->ucId = ELEM_ID_EXTENDED_CAP; - prExtCap->ucLength = 1; - prExtCap->aucCapabilities[0] = ELEM_EXT_CAP_DEFAULT_VAL; - - if (!fg40mAllowed) { - prExtCap->aucCapabilities[0] &= ~ELEM_EXT_CAP_20_40_COEXIST_SUPPORT; - } - - if (prBssInfo->eCurrentOPMode != OP_MODE_INFRASTRUCTURE) { - prExtCap->aucCapabilities[0] &= ~ELEM_EXT_CAP_PSMP_CAP; - } - - ASSERT(IE_SIZE(prExtCap) <= (ELEM_HDR_LEN + ELEM_MAX_LEN_EXT_CAP)); - - prMsduInfo->u2FrameLength += IE_SIZE(prExtCap); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -static VOID -rlmFillHtOpIE ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - P_MSDU_INFO_T prMsduInfo - ) -{ - P_IE_HT_OP_T prHtOp; - UINT_16 i; - - ASSERT(prAdapter); - ASSERT(prBssInfo); - ASSERT(prMsduInfo); - - prHtOp = (P_IE_HT_OP_T) - (((PUINT_8) prMsduInfo->prPacket) + prMsduInfo->u2FrameLength); - - /* Add HT operation IE */ - prHtOp->ucId = ELEM_ID_HT_OP; - prHtOp->ucLength = sizeof(IE_HT_OP_T) - ELEM_HDR_LEN; - - /* RIFS and 20/40 bandwidth operations are included */ - prHtOp->ucPrimaryChannel = prBssInfo->ucPrimaryChannel; - prHtOp->ucInfo1 = prBssInfo->ucHtOpInfo1; - - /* Decide HT protection mode field */ - if (prBssInfo->eHtProtectMode == HT_PROTECT_MODE_NON_HT) { - prHtOp->u2Info2 = (UINT_8) HT_PROTECT_MODE_NON_HT; - } - else if (prBssInfo->eObssHtProtectMode == HT_PROTECT_MODE_NON_MEMBER) { - prHtOp->u2Info2 = (UINT_8) HT_PROTECT_MODE_NON_MEMBER; - } - else { - /* It may be SYS_PROTECT_MODE_NONE or SYS_PROTECT_MODE_20M */ - prHtOp->u2Info2 = (UINT_8) prBssInfo->eHtProtectMode; - } - - if (prBssInfo->eGfOperationMode != GF_MODE_NORMAL) { - /* It may be GF_MODE_PROTECT or GF_MODE_DISALLOWED - * Note: it will also be set in ad-hoc network - */ - prHtOp->u2Info2 |= HT_OP_INFO2_NON_GF_HT_STA_PRESENT; - } - - if (0 /* Regulatory class 16 */ && - prBssInfo->eObssHtProtectMode == HT_PROTECT_MODE_NON_MEMBER) { - /* (TBD) It is HT_PROTECT_MODE_NON_MEMBER, so require protection - * although it is possible to have no protection by spec. - */ - prHtOp->u2Info2 |= HT_OP_INFO2_OBSS_NON_HT_STA_PRESENT; - } - - prHtOp->u2Info3 = prBssInfo->u2HtOpInfo3; /* To do: handle L-SIG TXOP */ - - /* No basic MCSx are needed temporarily */ - for (i = 0; i < 16; i++) { - prHtOp->aucBasicMcsSet[i] = 0; - } - - ASSERT(IE_SIZE(prHtOp) <= (ELEM_HDR_LEN + ELEM_MAX_LEN_HT_OP)); - - prMsduInfo->u2FrameLength += IE_SIZE(prHtOp); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function should be invoked to update parameters of associated AP. -* (Association response and Beacon) -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -static UINT_8 -rlmRecIeInfoForClient ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - PUINT_8 pucIE, - UINT_16 u2IELength - ) -{ - UINT_16 u2Offset; - P_STA_RECORD_T prStaRec; - P_IE_HT_CAP_T prHtCap; - P_IE_HT_OP_T prHtOp; - P_IE_OBSS_SCAN_PARAM_T prObssScnParam; - UINT_8 ucERP, ucPrimaryChannel; -#if CFG_SUPPORT_QUIET && 0 - BOOLEAN fgHasQuietIE = FALSE; -#endif - - ASSERT(prAdapter); - ASSERT(prBssInfo); - ASSERT(pucIE); - - prStaRec = prBssInfo->prStaRecOfAP; - ASSERT(prStaRec); - if (!prStaRec) { - return 0; - } - - prBssInfo->fgUseShortPreamble = prBssInfo->fgIsShortPreambleAllowed; - ucPrimaryChannel = 0; - prObssScnParam = NULL; - - /* Note: HT-related members in staRec may not be zero before, so - * if following IE does not exist, they are still not zero. - * These HT-related parameters are vaild only when the corresponding - * BssInfo supports 802.11n, i.e., RLM_NET_IS_11N() - */ - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - switch (IE_ID(pucIE)) { - case ELEM_ID_HT_CAP: - if (!RLM_NET_IS_11N(prBssInfo) || - IE_LEN(pucIE) != (sizeof(IE_HT_CAP_T) - 2)) { - break; - } - prHtCap = (P_IE_HT_CAP_T) pucIE; - prStaRec->ucMcsSet = prHtCap->rSupMcsSet.aucRxMcsBitmask[0]; - prStaRec->fgSupMcs32 = - (prHtCap->rSupMcsSet.aucRxMcsBitmask[32/8] & BIT(0)) ? - TRUE : FALSE; - - prStaRec->u2HtCapInfo = prHtCap->u2HtCapInfo; - prStaRec->ucAmpduParam = prHtCap->ucAmpduParam; - prStaRec->u2HtExtendedCap = prHtCap->u2HtExtendedCap; - prStaRec->u4TxBeamformingCap = prHtCap->u4TxBeamformingCap; - prStaRec->ucAselCap = prHtCap->ucAselCap; - break; - - case ELEM_ID_HT_OP: - if (!RLM_NET_IS_11N(prBssInfo) || - IE_LEN(pucIE) != (sizeof(IE_HT_OP_T) - 2)) { - break; - } - prHtOp = (P_IE_HT_OP_T) pucIE; - /* Workaround that some APs fill primary channel field by its - * secondary channel, but its DS IE is correct 20110610 - */ - if (ucPrimaryChannel == 0) { - ucPrimaryChannel = prHtOp->ucPrimaryChannel; - } - prBssInfo->ucHtOpInfo1 = prHtOp->ucInfo1; - prBssInfo->u2HtOpInfo2 = prHtOp->u2Info2; - prBssInfo->u2HtOpInfo3 = prHtOp->u2Info3; - - if (!prBssInfo->fg40mBwAllowed) { - prBssInfo->ucHtOpInfo1 &= - ~(HT_OP_INFO1_SCO | HT_OP_INFO1_STA_CHNL_WIDTH); - } - - if ((prBssInfo->ucHtOpInfo1 & HT_OP_INFO1_SCO) != CHNL_EXT_RES) { - prBssInfo->eBssSCO = (ENUM_CHNL_EXT_T) - (prBssInfo->ucHtOpInfo1 & HT_OP_INFO1_SCO); - } - - prBssInfo->eHtProtectMode = (ENUM_HT_PROTECT_MODE_T) - (prBssInfo->u2HtOpInfo2 & HT_OP_INFO2_HT_PROTECTION); - - /* To do: process regulatory class 16 */ - if ((prBssInfo->u2HtOpInfo2 & HT_OP_INFO2_OBSS_NON_HT_STA_PRESENT) - && 0 /* && regulatory class is 16 */) { - prBssInfo->eGfOperationMode = GF_MODE_DISALLOWED; - } - else if (prBssInfo->u2HtOpInfo2&HT_OP_INFO2_NON_GF_HT_STA_PRESENT) { - prBssInfo->eGfOperationMode = GF_MODE_PROTECT; - } - else { - prBssInfo->eGfOperationMode = GF_MODE_NORMAL; - } - - prBssInfo->eRifsOperationMode = - (prBssInfo->ucHtOpInfo1 & HT_OP_INFO1_RIFS_MODE) ? - RIFS_MODE_NORMAL : RIFS_MODE_DISALLOWED; - - break; - - case ELEM_ID_20_40_BSS_COEXISTENCE: - if (!RLM_NET_IS_11N(prBssInfo)) { - break; - } - /* To do: store if scanning exemption grant to BssInfo */ - break; - - case ELEM_ID_OBSS_SCAN_PARAMS: - if (!RLM_NET_IS_11N(prBssInfo) || - IE_LEN(pucIE) != (sizeof(IE_OBSS_SCAN_PARAM_T) - 2)) { - break; - } - /* Store OBSS parameters to BssInfo */ - prObssScnParam = (P_IE_OBSS_SCAN_PARAM_T) pucIE; - break; - - case ELEM_ID_EXTENDED_CAP: - if (!RLM_NET_IS_11N(prBssInfo)) { - break; - } - /* To do: store extended capability (PSMP, coexist) to BssInfo */ - break; - - case ELEM_ID_ERP_INFO: - if (IE_LEN(pucIE) != (sizeof(IE_ERP_T) - 2) || - prBssInfo->eBand != BAND_2G4) { - break; - } - ucERP = ERP_INFO_IE(pucIE)->ucERP; - prBssInfo->fgErpProtectMode = - (ucERP & ERP_INFO_USE_PROTECTION) ? TRUE : FALSE; - - if (ucERP & ERP_INFO_BARKER_PREAMBLE_MODE) { - prBssInfo->fgUseShortPreamble = FALSE; - } - break; - - case ELEM_ID_DS_PARAM_SET: - if (IE_LEN(pucIE) == ELEM_MAX_LEN_DS_PARAMETER_SET) { - ucPrimaryChannel = DS_PARAM_IE(pucIE)->ucCurrChnl; - } - break; - - #if CFG_SUPPORT_QUIET && 0 - /* Note: RRM code should be moved to independent RRM function by - * component design rule. But we attach it to RLM temporarily - */ - case ELEM_ID_QUIET: - rrmQuietHandleQuietIE(prBssInfo, (P_IE_QUIET_T) pucIE); - fgHasQuietIE = TRUE; - break; - #endif - default: - break; - } /* end of switch */ - } /* end of IE_FOR_EACH */ - - /* Some AP will have wrong channel number (255) when running time. - * Check if correct channel number information. 20110501 - */ - if ((prBssInfo->eBand == BAND_2G4 && ucPrimaryChannel > 14) || - (prBssInfo->eBand != BAND_2G4 && (ucPrimaryChannel >= 200 || - ucPrimaryChannel <= 14))) { - ucPrimaryChannel = 0; - } - -#if CFG_SUPPORT_QUIET && 0 - if (!fgHasQuietIE) { - rrmQuietIeNotExist(prAdapter, prBssInfo); - } -#endif - - /* Check if OBSS scan process will launch */ - if (!prAdapter->fgEnOnlineScan || !prObssScnParam || - !(prStaRec->u2HtCapInfo & HT_CAP_INFO_SUP_CHNL_WIDTH) || - prBssInfo->eBand != BAND_2G4 || !prBssInfo->fg40mBwAllowed) { - - /* Note: it is ok not to stop rObssScanTimer() here */ - prBssInfo->u2ObssScanInterval = 0; - } - else { - if (prObssScnParam->u2TriggerScanInterval < OBSS_SCAN_MIN_INTERVAL) { - prObssScnParam->u2TriggerScanInterval = OBSS_SCAN_MIN_INTERVAL; - } - if (prBssInfo->u2ObssScanInterval != - prObssScnParam->u2TriggerScanInterval) { - - prBssInfo->u2ObssScanInterval = - prObssScnParam->u2TriggerScanInterval; - - /* Start timer to trigger OBSS scanning */ - cnmTimerStartTimer(prAdapter, &prBssInfo->rObssScanTimer, - prBssInfo->u2ObssScanInterval * MSEC_PER_SEC); - } - } - - return ucPrimaryChannel; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief AIS or P2P GC. -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -static BOOLEAN -rlmRecBcnFromNeighborForClient ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - P_SW_RFB_T prSwRfb, - PUINT_8 pucIE, - UINT_16 u2IELength - ) -{ - UINT_16 u2Offset, i; - UINT_8 ucPriChannel, ucSecChannel; - ENUM_CHNL_EXT_T eSCO; - BOOLEAN fgHtBss, fg20mReq; - - ASSERT(prAdapter); - ASSERT(prBssInfo && prSwRfb); - ASSERT(pucIE); - - /* Record it to channel list to change 20/40 bandwidth */ - ucPriChannel = 0; - eSCO = CHNL_EXT_SCN; - - fgHtBss = FALSE; - fg20mReq = FALSE; - - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - switch (IE_ID(pucIE)) { - case ELEM_ID_HT_CAP: - { - P_IE_HT_CAP_T prHtCap; - - if (IE_LEN(pucIE) != (sizeof(IE_HT_CAP_T) - 2)) { - break; - } - - prHtCap = (P_IE_HT_CAP_T) pucIE; - if (prHtCap->u2HtCapInfo & HT_CAP_INFO_40M_INTOLERANT) { - fg20mReq = TRUE; - } - fgHtBss = TRUE; - break; - } - case ELEM_ID_HT_OP: - { - P_IE_HT_OP_T prHtOp; - - if (IE_LEN(pucIE) != (sizeof(IE_HT_OP_T) - 2)) { - break; - } - - prHtOp = (P_IE_HT_OP_T) pucIE; - /* Workaround that some APs fill primary channel field by its - * secondary channel, but its DS IE is correct 20110610 - */ - if (ucPriChannel == 0) { - ucPriChannel = prHtOp->ucPrimaryChannel; - } - - if ((prHtOp->ucInfo1 & HT_OP_INFO1_SCO) != CHNL_EXT_RES) { - eSCO = (ENUM_CHNL_EXT_T) (prHtOp->ucInfo1 & HT_OP_INFO1_SCO); - } - break; - } - case ELEM_ID_20_40_BSS_COEXISTENCE: - { - P_IE_20_40_COEXIST_T prCoexist; - - if (IE_LEN(pucIE) != (sizeof(IE_20_40_COEXIST_T) - 2)) { - break; - } - - prCoexist = (P_IE_20_40_COEXIST_T) pucIE; - if (prCoexist->ucData & BSS_COEXIST_40M_INTOLERANT) { - fg20mReq = TRUE; - } - break; - } - case ELEM_ID_DS_PARAM_SET: - if (IE_LEN(pucIE) != (sizeof(IE_DS_PARAM_SET_T) - 2)) { - break; - } - ucPriChannel = DS_PARAM_IE(pucIE)->ucCurrChnl; - break; - - default: - break; - } - } - - - /* To do: Update channel list and 5G band. All channel lists have the same - * update procedure. We should give it the entry pointer of desired - * channel list. - */ - if (HIF_RX_HDR_GET_RF_BAND(prSwRfb->prHifRxHdr) != BAND_2G4) { - return FALSE; - } - - if (ucPriChannel == 0 || ucPriChannel > 14) { - ucPriChannel = HIF_RX_HDR_GET_CHNL_NUM(prSwRfb->prHifRxHdr); - } - - if (fgHtBss) { - ASSERT(prBssInfo->auc2G_PriChnlList[0] <= CHNL_LIST_SZ_2G); - for (i = 1; i <= prBssInfo->auc2G_PriChnlList[0] && - i <= CHNL_LIST_SZ_2G; i++) { - if (prBssInfo->auc2G_PriChnlList[i] == ucPriChannel) { - break; - } - } - if ((i > prBssInfo->auc2G_PriChnlList[0]) && (i <= CHNL_LIST_SZ_2G)) { - prBssInfo->auc2G_PriChnlList[i] = ucPriChannel; - prBssInfo->auc2G_PriChnlList[0]++; - } - - /* Update secondary channel */ - if (eSCO != CHNL_EXT_SCN) { - ucSecChannel = (eSCO == CHNL_EXT_SCA) ? - (ucPriChannel + 4) : (ucPriChannel - 4); - - ASSERT(prBssInfo->auc2G_SecChnlList[0] <= CHNL_LIST_SZ_2G); - for (i = 1; i <= prBssInfo->auc2G_SecChnlList[0] && - i <= CHNL_LIST_SZ_2G; i++) { - if (prBssInfo->auc2G_SecChnlList[i] == ucSecChannel) { - break; - } - } - if ((i > prBssInfo->auc2G_SecChnlList[0])&& (i <= CHNL_LIST_SZ_2G)){ - prBssInfo->auc2G_SecChnlList[i] = ucSecChannel; - prBssInfo->auc2G_SecChnlList[0]++; - } - } - - /* Update 20M bandwidth request channels */ - if (fg20mReq) { - ASSERT(prBssInfo->auc2G_20mReqChnlList[0] <= CHNL_LIST_SZ_2G); - for (i = 1; i <= prBssInfo->auc2G_20mReqChnlList[0] && - i <= CHNL_LIST_SZ_2G; i++) { - if (prBssInfo->auc2G_20mReqChnlList[i] == ucPriChannel) { - break; - } - } - if ((i > prBssInfo->auc2G_20mReqChnlList[0]) && - (i <= CHNL_LIST_SZ_2G)){ - prBssInfo->auc2G_20mReqChnlList[i] = ucPriChannel; - prBssInfo->auc2G_20mReqChnlList[0]++; - } - } - } - else { - /* Update non-HT channel list */ - ASSERT(prBssInfo->auc2G_NonHtChnlList[0] <= CHNL_LIST_SZ_2G); - for (i = 1; i <= prBssInfo->auc2G_NonHtChnlList[0] && - i <= CHNL_LIST_SZ_2G; i++) { - if (prBssInfo->auc2G_NonHtChnlList[i] == ucPriChannel) { - break; - } - } - if ((i > prBssInfo->auc2G_NonHtChnlList[0]) && (i <= CHNL_LIST_SZ_2G)) { - prBssInfo->auc2G_NonHtChnlList[i] = ucPriChannel; - prBssInfo->auc2G_NonHtChnlList[0]++; - } - - } - - return FALSE; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief AIS or P2P GC. -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -static BOOLEAN -rlmRecBcnInfoForClient ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo, - P_SW_RFB_T prSwRfb, - PUINT_8 pucIE, - UINT_16 u2IELength - ) -{ - ASSERT(prAdapter); - ASSERT(prBssInfo && prSwRfb); - ASSERT(pucIE); - -#if 0 /* SW migration 2010/8/20 */ - /* Note: we shall not update parameters when scanning, otherwise - * channel and bandwidth will not be correct or asserted failure - * during scanning. - * Note: remove channel checking. All received Beacons should be processed - * if measurement or other actions are executed in adjacent channels - * and Beacon content checking mechanism is not disabled. - */ - if (IS_SCAN_ACTIVE() - /* || prBssInfo->ucPrimaryChannel != CHNL_NUM_BY_SWRFB(prSwRfb) */) { - return FALSE; - } -#endif - - /* Handle change of slot time */ - prBssInfo->u2CapInfo = - ((P_WLAN_BEACON_FRAME_T)(prSwRfb->pvHeader))->u2CapInfo; - prBssInfo->fgUseShortSlotTime = - (prBssInfo->u2CapInfo & CAP_INFO_SHORT_SLOT_TIME) ? TRUE : FALSE; - - rlmRecIeInfoForClient(prAdapter, prBssInfo, pucIE, u2IELength); - - return TRUE; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmProcessBcn ( - P_ADAPTER_T prAdapter, - P_SW_RFB_T prSwRfb, - PUINT_8 pucIE, - UINT_16 u2IELength - ) -{ - P_BSS_INFO_T prBssInfo; - BOOLEAN fgNewParameter; - UINT_8 ucNetIdx; - - ASSERT(prAdapter); - ASSERT(prSwRfb); - ASSERT(pucIE); - - fgNewParameter = FALSE; - - /* When concurrent networks exist, GO shall have the same handle as - * the other BSS, so the Beacon shall be procesed for bandwidth and - * protection mechanism. - * Note1: we do not have 2 AP (GO) cases simultaneously now. - * Note2: If we are GO, concurrent AIS AP should detect it and reflect - * action in its Beacon, so AIS STA just follows Beacon from AP. - */ - RLM_NET_FOR_EACH_NO_BOW(ucNetIdx) { - prBssInfo = &prAdapter->rWifiVar.arBssInfo[ucNetIdx]; - ASSERT(prBssInfo); - - if (IS_BSS_ACTIVE(prBssInfo)) { - if (prBssInfo->eCurrentOPMode == OP_MODE_INFRASTRUCTURE && - prBssInfo->eConnectionState == PARAM_MEDIA_STATE_CONNECTED) { - /* P2P client or AIS infra STA */ - if (EQUAL_MAC_ADDR(prBssInfo->aucBSSID, - ((P_WLAN_MAC_MGMT_HEADER_T) - (prSwRfb->pvHeader))->aucBSSID)) { - - fgNewParameter = rlmRecBcnInfoForClient(prAdapter, - prBssInfo, prSwRfb, pucIE, u2IELength); - } - else { - fgNewParameter = rlmRecBcnFromNeighborForClient(prAdapter, - prBssInfo, prSwRfb, pucIE, u2IELength); - } - } - #if CFG_ENABLE_WIFI_DIRECT - else if (prAdapter->fgIsP2PRegistered && - (prBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT || - prBssInfo->eCurrentOPMode == OP_MODE_P2P_DEVICE)) { - /* AP scan to check if 20/40M bandwidth is permitted */ - rlmRecBcnFromNeighborForClient(prAdapter, - prBssInfo, prSwRfb, pucIE, u2IELength); - } - #endif - else if (prBssInfo->eCurrentOPMode == OP_MODE_IBSS) { - /* To do: Ad-hoc */ - } - - /* Appy new parameters if necessary */ - if (fgNewParameter) { - rlmSyncOperationParams(prAdapter, prBssInfo); - fgNewParameter = FALSE; - } - } /* end of IS_BSS_ACTIVE() */ - } /* end of RLM_NET_FOR_EACH_NO_BOW */ -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function should be invoked after judging successful association. -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmProcessAssocRsp ( - P_ADAPTER_T prAdapter, - P_SW_RFB_T prSwRfb, - PUINT_8 pucIE, - UINT_16 u2IELength - ) -{ - P_BSS_INFO_T prBssInfo; - P_STA_RECORD_T prStaRec; - UINT_8 ucPriChannel; - - ASSERT(prAdapter); - ASSERT(prSwRfb); - ASSERT(pucIE); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - ASSERT(prStaRec); - if (!prStaRec) { - return; - } - ASSERT(prStaRec->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]; - ASSERT(prStaRec == prBssInfo->prStaRecOfAP); - - /* To do: the invoked function is used to clear all members. It may be - * done by center mechanism in invoker. - */ - rlmBssReset(prAdapter, prBssInfo); - - prBssInfo->fgUseShortSlotTime = - (prBssInfo->u2CapInfo & CAP_INFO_SHORT_SLOT_TIME) ? TRUE : FALSE; - - if ((ucPriChannel = - rlmRecIeInfoForClient(prAdapter, prBssInfo, pucIE, u2IELength)) > 0) { - prBssInfo->ucPrimaryChannel = ucPriChannel; - } - - if (!RLM_NET_IS_11N(prBssInfo) || - !(prStaRec->u2HtCapInfo & HT_CAP_INFO_SUP_CHNL_WIDTH)) { - prBssInfo->fg40mBwAllowed = FALSE; - } - - /* Note: Update its capabilities to WTBL by cnmStaRecChangeState(), which - * shall be invoked afterwards. - * Update channel, bandwidth and protection mode by nicUpdateBss() - */ -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function should be invoked after judging successful association. -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmFillSyncCmdParam ( - P_CMD_SET_BSS_RLM_PARAM_T prCmdBody, - P_BSS_INFO_T prBssInfo - ) -{ - ASSERT(prCmdBody && prBssInfo); - if (!prCmdBody || !prBssInfo) { - return; - } - - prCmdBody->ucNetTypeIndex = prBssInfo->ucNetTypeIndex; - prCmdBody->ucRfBand = (UINT_8) prBssInfo->eBand; - prCmdBody->ucPrimaryChannel = prBssInfo->ucPrimaryChannel; - prCmdBody->ucRfSco = (UINT_8) prBssInfo->eBssSCO; - prCmdBody->ucErpProtectMode = (UINT_8) prBssInfo->fgErpProtectMode; - prCmdBody->ucHtProtectMode = (UINT_8) prBssInfo->eHtProtectMode; - prCmdBody->ucGfOperationMode = (UINT_8) prBssInfo->eGfOperationMode; - prCmdBody->ucTxRifsMode = (UINT_8) prBssInfo->eRifsOperationMode; - prCmdBody->u2HtOpInfo3 = prBssInfo->u2HtOpInfo3; - prCmdBody->u2HtOpInfo2 = prBssInfo->u2HtOpInfo2; - prCmdBody->ucHtOpInfo1 = prBssInfo->ucHtOpInfo1; - prCmdBody->ucUseShortPreamble = prBssInfo->fgUseShortPreamble; - prCmdBody->ucUseShortSlotTime = prBssInfo->fgUseShortSlotTime; - prCmdBody->ucCheckId = 0x72; - - if (RLM_NET_PARAM_VALID(prBssInfo)) { - DBGLOG(RLM, INFO, ("N=%d b=%d c=%d s=%d e=%d h=%d I=0x%02x l=%d p=%d\n", - prCmdBody->ucNetTypeIndex, prCmdBody->ucRfBand, - prCmdBody->ucPrimaryChannel, prCmdBody->ucRfSco, - prCmdBody->ucErpProtectMode, prCmdBody->ucHtProtectMode, - prCmdBody->ucHtOpInfo1, prCmdBody->ucUseShortSlotTime, - prCmdBody->ucUseShortPreamble)); - } - else { - DBGLOG(RLM, INFO, ("N=%d closed\n", prCmdBody->ucNetTypeIndex)); - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will operation parameters based on situations of -* concurrent networks. Channel, bandwidth, protection mode, supported -* rate will be modified. -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmSyncOperationParams ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ) -{ - P_CMD_SET_BSS_RLM_PARAM_T prCmdBody; - WLAN_STATUS rStatus; - - ASSERT(prAdapter); - ASSERT(prBssInfo); - - prCmdBody = (P_CMD_SET_BSS_RLM_PARAM_T) - cnmMemAlloc(prAdapter, RAM_TYPE_BUF, sizeof(CMD_SET_BSS_RLM_PARAM_T)); - ASSERT(prCmdBody); - - /* To do: exception handle */ - if (!prCmdBody) { - DBGLOG(RLM, WARN, ("No buf for sync RLM params (Net=%d)\n", - prBssInfo->ucNetTypeIndex)); - return; - } - - rlmFillSyncCmdParam(prCmdBody, prBssInfo); - - rStatus = wlanSendSetQueryCmd ( - prAdapter, /* prAdapter */ - CMD_ID_SET_BSS_RLM_PARAM, /* ucCID */ - TRUE, /* fgSetQuery */ - FALSE, /* fgNeedResp */ - FALSE, /* fgIsOid */ - NULL, /* pfCmdDoneHandler */ - NULL, /* pfCmdTimeoutHandler */ - sizeof(CMD_SET_BSS_RLM_PARAM_T), /* u4SetQueryInfoLen */ - (PUINT_8) prCmdBody, /* pucInfoBuffer */ - NULL, /* pvSetQueryBuffer */ - 0 /* u4SetQueryBufferLen */ - ); - - ASSERT(rStatus == WLAN_STATUS_PENDING); - - cnmMemFree(prAdapter, prCmdBody); -} - -#if CFG_SUPPORT_AAA -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function should be invoked after judging successful association. -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmProcessAssocReq ( - P_ADAPTER_T prAdapter, - P_SW_RFB_T prSwRfb, - PUINT_8 pucIE, - UINT_16 u2IELength - ) -{ - P_BSS_INFO_T prBssInfo; - P_STA_RECORD_T prStaRec; - UINT_16 u2Offset; - P_IE_HT_CAP_T prHtCap; - - ASSERT(prAdapter); - ASSERT(prSwRfb); - ASSERT(pucIE); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - ASSERT(prStaRec); - if (!prStaRec) { - return; - } - ASSERT(prStaRec->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM); - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]; - - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - switch (IE_ID(pucIE)) { - case ELEM_ID_HT_CAP: - if (!RLM_NET_IS_11N(prBssInfo) || - IE_LEN(pucIE) != (sizeof(IE_HT_CAP_T) - 2)) { - break; - } - prHtCap = (P_IE_HT_CAP_T) pucIE; - prStaRec->ucMcsSet = prHtCap->rSupMcsSet.aucRxMcsBitmask[0]; - prStaRec->fgSupMcs32 = - (prHtCap->rSupMcsSet.aucRxMcsBitmask[32/8] & BIT(0)) ? - TRUE : FALSE; - - prStaRec->u2HtCapInfo = prHtCap->u2HtCapInfo; - prStaRec->ucAmpduParam = prHtCap->ucAmpduParam; - prStaRec->u2HtExtendedCap = prHtCap->u2HtExtendedCap; - prStaRec->u4TxBeamformingCap = prHtCap->u4TxBeamformingCap; - prStaRec->ucAselCap = prHtCap->ucAselCap; - break; - - default: - break; - } /* end of switch */ - } /* end of IE_FOR_EACH */ -} -#endif /* CFG_SUPPORT_AAA */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief It is for both STA and AP modes -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmBssInitForAPandIbss ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ) -{ - ASSERT(prAdapter); - ASSERT(prBssInfo); - -#if CFG_ENABLE_WIFI_DIRECT - if (prAdapter->fgIsP2PRegistered && - prBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT) { - - rlmBssInitForAP(prAdapter, prBssInfo); - } -#endif -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief It is for both STA and AP modes -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmBssAborted ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ) -{ - ASSERT(prAdapter); - ASSERT(prBssInfo); - - rlmBssReset(prAdapter, prBssInfo); - - prBssInfo->fg40mBwAllowed = FALSE; - prBssInfo->fgAssoc40mBwAllowed = FALSE; - - /* Assume FW state is updated by CMD_ID_SET_BSS_INFO, so - * the sync CMD is not needed here. - */ -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief All RLM timers will also be stopped. -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -static VOID -rlmBssReset ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ) -{ - ASSERT(prAdapter); - ASSERT(prBssInfo); - - /* HT related parameters */ - prBssInfo->ucHtOpInfo1 = 0; /* RIFS disabled. 20MHz */ - prBssInfo->u2HtOpInfo2 = 0; - prBssInfo->u2HtOpInfo3 = 0; - - prBssInfo->eBssSCO = 0; - prBssInfo->fgErpProtectMode = 0; - prBssInfo->eHtProtectMode = 0; - prBssInfo->eGfOperationMode = 0; - prBssInfo->eRifsOperationMode = 0; - - /* OBSS related parameters */ - prBssInfo->auc2G_20mReqChnlList[0] = 0; - prBssInfo->auc2G_NonHtChnlList[0] = 0; - prBssInfo->auc2G_PriChnlList[0] = 0; - prBssInfo->auc2G_SecChnlList[0] = 0; - prBssInfo->auc5G_20mReqChnlList[0] = 0; - prBssInfo->auc5G_NonHtChnlList[0] = 0; - prBssInfo->auc5G_PriChnlList[0] = 0; - prBssInfo->auc5G_SecChnlList[0] = 0; - - /* All RLM timers will also be stopped */ - cnmTimerStopTimer(prAdapter, &prBssInfo->rObssScanTimer); - prBssInfo->u2ObssScanInterval = 0; - - prBssInfo->fgObssErpProtectMode = 0; /* GO only */ - prBssInfo->eObssHtProtectMode = 0; /* GO only */ - prBssInfo->eObssGfOperationMode = 0; /* GO only */ - prBssInfo->fgObssRifsOperationMode = 0; /* GO only */ - prBssInfo->fgObssActionForcedTo20M = 0; /* GO only */ - prBssInfo->fgObssBeaconForcedTo20M = 0; /* GO only */ -} - diff --git a/drivers/net/wireless/mt5931/mgmt/rlm_domain.c b/drivers/net/wireless/mt5931/mgmt/rlm_domain.c deleted file mode 100755 index b5f34388469b..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/rlm_domain.c +++ /dev/null @@ -1,681 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/rlm_domain.c#1 $ -*/ - -/*! \file "rlm_domain.c" - \brief - -*/ - - - -/* -** $Log: rlm_domain.c $ - * - * 11 10 2011 cm.chang - * NULL - * Modify debug message for XLOG - * - * 09 29 2011 cm.chang - * NULL - * Change the function prototype of rlmDomainGetChnlList() - * - * 09 23 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * Let channel number to zero if band is illegal - * - * 09 22 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * Exclude channel list with illegal band - * - * 09 15 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * Use defined country group to have a change to add new group - * - * 09 08 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * Use new fields ucChannelListMap and ucChannelListIndex in NVRAM - * - * 08 31 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * . - * - * 06 01 2011 cm.chang - * [WCXRP00000756] [MT6620 Wi-Fi][Driver] 1. AIS follow channel of BOW 2. Provide legal channel function - * Provide legal channel function based on domain - * - * 03 19 2011 yuche.tsai - * [WCXRP00000584] [Volunteer Patch][MT6620][Driver] Add beacon timeout support for WiFi Direct. - * Add beacon timeout support for WiFi Direct Network. - * - * 03 02 2011 terry.wu - * [WCXRP00000505] [MT6620 Wi-Fi][Driver/FW] WiFi Direct Integration - * Export rlmDomainGetDomainInfo for p2p driver. - * - * 01 12 2011 cm.chang - * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting - * User-defined bandwidth is for 2.4G and 5G individually - * - * 12 07 2010 cm.chang - * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant - * 1. Country code is from NVRAM or supplicant - * 2. Change band definition in CMD/EVENT. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Check draft RLM code for HT cap - * - * 03 25 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Filter out not supported RF freq when reporting available chnl list - * - * 01 22 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support protection and bandwidth switch - * - * 01 13 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Provide query function about full channle list. - * - * Dec 1 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * - * -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/* The following country or domain shall be set from host driver. - * And host driver should pass specified DOMAIN_INFO_ENTRY to MT6620 as - * the channel list of being a STA to do scanning/searching AP or being an - * AP to choose an adequate channel if auto-channel is set. - */ - -/* Define mapping tables between country code and its channel set - */ -static const UINT_16 g_u2CountryGroup0[] = -{ - COUNTRY_CODE_US, COUNTRY_CODE_BS, COUNTRY_CODE_BB, COUNTRY_CODE_BO, COUNTRY_CODE_DM, - COUNTRY_CODE_DO, COUNTRY_CODE_HT, COUNTRY_CODE_PR, COUNTRY_CODE_TH, COUNTRY_CODE_TW, - COUNTRY_CODE_AI, COUNTRY_CODE_AG, COUNTRY_CODE_AW, COUNTRY_CODE_BM, COUNTRY_CODE_CU, - COUNTRY_CODE_GD, COUNTRY_CODE_GY, COUNTRY_CODE_JM, COUNTRY_CODE_KN, COUNTRY_CODE_LC, - COUNTRY_CODE_VC, COUNTRY_CODE_TT, COUNTRY_CODE_SR -}; -static const UINT_16 g_u2CountryGroup1[] = -{ - COUNTRY_CODE_BR, COUNTRY_CODE_EC, COUNTRY_CODE_HK, COUNTRY_CODE_MX, COUNTRY_CODE_PE, - COUNTRY_CODE_CR, COUNTRY_CODE_MD, COUNTRY_CODE_NI, COUNTRY_CODE_PZ -}; -static const UINT_16 g_u2CountryGroup2[] = {COUNTRY_CODE_CO, COUNTRY_CODE_PY}; -static const UINT_16 g_u2CountryGroup3[] = {COUNTRY_CODE_JP}; -static const UINT_16 g_u2CountryGroup4[] = -{ - COUNTRY_CODE_CN, COUNTRY_CODE_UY, COUNTRY_CODE_MA -}; -static const UINT_16 g_u2CountryGroup5[] = {COUNTRY_CODE_AR}; -static const UINT_16 g_u2CountryGroup6[] = {COUNTRY_CODE_AU, COUNTRY_CODE_NZ}; -static const UINT_16 g_u2CountryGroup7[] = {COUNTRY_CODE_RU}; -static const UINT_16 g_u2CountryGroup8[] = -{ - COUNTRY_CODE_ID, COUNTRY_CODE_HN, COUNTRY_CODE_PG, COUNTRY_CODE_PK -}; -static const UINT_16 g_u2CountryGroup9[] = {COUNTRY_CODE_CA}; -static const UINT_16 g_u2CountryGroup10[] = -{ - COUNTRY_CODE_CL, COUNTRY_CODE_IN, COUNTRY_CODE_SA, COUNTRY_CODE_SG, COUNTRY_CODE_VE, - COUNTRY_CODE_MY, COUNTRY_CODE_VN, COUNTRY_CODE_EG -}; -static const UINT_16 g_u2CountryGroup11[] = {COUNTRY_CODE_IL, COUNTRY_CODE_UA}; -static const UINT_16 g_u2CountryGroup12[] = {COUNTRY_CODE_JO, COUNTRY_CODE_KW}; -static const UINT_16 g_u2CountryGroup13[] = {COUNTRY_CODE_KR, COUNTRY_CODE_OM}; -static const UINT_16 g_u2CountryGroup14[] = -{ - COUNTRY_CODE_EU - /* When country code is not found, this domain info will be used. - * So mark all country codes to reduce search time. 20110908 - */ - /*, COUNTRY_CODE_PH, COUNTRY_CODE_TR, COUNTRY_CODE_IR, COUNTRY_CODE_BY, - COUNTRY_CODE_LK */ -}; - - -DOMAIN_INFO_ENTRY arSupportedRegDomains[] = { - { - (PUINT_16) g_u2CountryGroup0, sizeof(g_u2CountryGroup0) / 2, - { - { 81, BAND_2G4, CHNL_SPAN_5, 1, 11, FALSE }, /* CH_SET_2G4_1_11 */ - - { 115, BAND_5G, CHNL_SPAN_20, 36, 4, FALSE }, /* CH_SET_UNII_LOW_36_48 */ - { 118, BAND_5G, CHNL_SPAN_20, 52, 4, FALSE }, /* CH_SET_UNII_MID_52_64 */ - { 121, BAND_5G, CHNL_SPAN_20, 100, 11, FALSE }, /* CH_SET_UNII_WW_100_140 */ - { 125, BAND_5G, CHNL_SPAN_20, 149, 5, FALSE }, /* CH_SET_UNII_UPPER_149_165 */ - { 0, BAND_NULL, 0, 0, 0, FALSE } - } - }, - { - (PUINT_16) g_u2CountryGroup1, sizeof(g_u2CountryGroup1) / 2, - { - { 81, BAND_2G4, CHNL_SPAN_5, 1, 13, FALSE }, /* CH_SET_2G4_1_13 */ - - { 115, BAND_5G, CHNL_SPAN_20, 36, 4, FALSE }, /* CH_SET_UNII_LOW_36_48 */ - { 118, BAND_5G, CHNL_SPAN_20, 52, 4, FALSE }, /* CH_SET_UNII_MID_52_64 */ - { 121, BAND_5G, CHNL_SPAN_20, 100, 11, FALSE }, /* CH_SET_UNII_WW_100_140 */ - { 125, BAND_5G, CHNL_SPAN_20, 149, 5, FALSE }, /* CH_SET_UNII_UPPER_149_165 */ - { 0, BAND_NULL, 0, 0, 0, FALSE } - } - }, - { - (PUINT_16) g_u2CountryGroup2, sizeof(g_u2CountryGroup2) / 2, - { - { 81, BAND_2G4, CHNL_SPAN_5, 1, 13, FALSE }, /* CH_SET_2G4_1_13 */ - - { 115, BAND_5G, CHNL_SPAN_20, 36, 4, FALSE }, /* CH_SET_UNII_LOW_36_48 */ - { 118, BAND_5G, CHNL_SPAN_20, 52, 4, FALSE }, /* CH_SET_UNII_MID_52_64 */ - { 121, BAND_5G, CHNL_SPAN_20, 100, 11, FALSE }, /* CH_SET_UNII_WW_100_140 */ - { 125, BAND_NULL, 0, 0, 0, FALSE }, /* CH_SET_UNII_UPPER_NA */ - { 0, BAND_NULL, 0, 0, 0, FALSE } - } - }, - { - (PUINT_16) g_u2CountryGroup3, sizeof(g_u2CountryGroup3) / 2, - { - { 81, BAND_2G4, CHNL_SPAN_5, 1, 13, FALSE }, /* CH_SET_2G4_1_14 */ - { 82, BAND_2G4, CHNL_SPAN_5, 14, 1, FALSE }, - - { 115, BAND_5G, CHNL_SPAN_20, 36, 4, FALSE }, /* CH_SET_UNII_LOW_36_48 */ - { 118, BAND_5G, CHNL_SPAN_20, 52, 4, FALSE }, /* CH_SET_UNII_MID_52_64 */ - { 121, BAND_5G, CHNL_SPAN_20, 100, 11, FALSE }, /* CH_SET_UNII_WW_100_140 */ - { 125, BAND_NULL, 0, 0, 0, FALSE } /* CH_SET_UNII_UPPER_NA */ - } - }, - { - (PUINT_16) g_u2CountryGroup4, sizeof(g_u2CountryGroup4) / 2, - { - { 81, BAND_2G4, CHNL_SPAN_5, 1, 13, FALSE }, /* CH_SET_2G4_1_13 */ - - { 115, BAND_NULL, 0, 0, 0, FALSE }, /* CH_SET_UNII_LOW_NA */ - { 118, BAND_5G, CHNL_SPAN_20, 52, 4, FALSE }, /* CH_SET_UNII_MID_52_64 */ - { 121, BAND_5G, CHNL_SPAN_20, 100, 11, FALSE }, /* CH_SET_UNII_WW_100_140 */ - { 125, BAND_5G, CHNL_SPAN_20, 149, 5, FALSE }, /* CH_SET_UNII_UPPER_149_165 */ - { 0, BAND_NULL, 0, 0, 0, FALSE } - } - }, - { - (PUINT_16) g_u2CountryGroup5, sizeof(g_u2CountryGroup5) / 2, - { - { 81, BAND_2G4, CHNL_SPAN_5, 1, 13, FALSE }, /* CH_SET_2G4_1_13 */ - - { 115, BAND_NULL, 0, 0, 0, FALSE }, /* CH_SET_UNII_LOW_NA */ - { 118, BAND_5G, CHNL_SPAN_20, 52, 4, FALSE }, /* CH_SET_UNII_MID_52_64 */ - { 121, BAND_NULL, 0, 0, 0, FALSE }, /* CH_SET_UNII_WW_NA */ - { 125, BAND_5G, CHNL_SPAN_20, 149, 5, FALSE }, /* CH_SET_UNII_UPPER_149_165 */ - { 0, BAND_NULL, 0, 0, 0, FALSE } - } - }, - { - (PUINT_16) g_u2CountryGroup6, sizeof(g_u2CountryGroup6) / 2, - { - { 81, BAND_2G4, CHNL_SPAN_5, 1, 11, FALSE }, /* CH_SET_2G4_1_11 */ - - { 115, BAND_5G, CHNL_SPAN_20, 36, 4, FALSE }, /* CH_SET_UNII_LOW_36_48 */ - { 118, BAND_5G, CHNL_SPAN_20, 52, 4, FALSE }, /* CH_SET_UNII_MID_52_64 */ - { 121, BAND_5G, CHNL_SPAN_20, 100, 11, FALSE }, /* CH_SET_UNII_WW_100_140 */ - { 125, BAND_5G, CHNL_SPAN_20, 149, 4, FALSE }, /* CH_SET_UNII_UPPER_149_161 */ - { 0, BAND_NULL, 0, 0, 0, FALSE } - } - }, - { - (PUINT_16) g_u2CountryGroup7, sizeof(g_u2CountryGroup7) / 2, - { - { 81, BAND_2G4, CHNL_SPAN_5, 1, 13, FALSE }, /* CH_SET_2G4_1_13 */ - - { 115, BAND_5G, CHNL_SPAN_20, 36, 4, FALSE }, /* CH_SET_UNII_LOW_36_48 */ - { 118, BAND_5G, CHNL_SPAN_20, 52, 4, FALSE }, /* CH_SET_UNII_MID_52_64 */ - { 121, BAND_5G, CHNL_SPAN_20, 100, 11, FALSE }, /* CH_SET_UNII_WW_100_140 */ - { 125, BAND_5G, CHNL_SPAN_20, 149, 4, FALSE }, /* CH_SET_UNII_UPPER_149_161 */ - { 0, BAND_NULL, 0, 0, 0, FALSE } - } - }, - { - (PUINT_16) g_u2CountryGroup8, sizeof(g_u2CountryGroup8) / 2, - { - { 81, BAND_2G4, CHNL_SPAN_5, 1, 13, FALSE }, /* CH_SET_2G4_1_13 */ - - { 115, BAND_NULL, 0, 0, 0, FALSE }, /* CH_SET_UNII_LOW_NA */ - { 118, BAND_NULL, 0, 0, 0, FALSE }, /* CH_SET_UNII_MID_NA */ - { 121, BAND_NULL, 0, 0, 0, FALSE }, /* CH_SET_UNII_WW_NA */ - { 125, BAND_5G, CHNL_SPAN_20, 149, 4, FALSE }, /* CH_SET_UNII_UPPER_149_161 */ - { 0, BAND_NULL, 0, 0, 0, FALSE } - } - }, - { - (PUINT_16) g_u2CountryGroup9, sizeof(g_u2CountryGroup9) / 2, - { - { 81, BAND_2G4, CHNL_SPAN_5, 1, 11, FALSE }, /* CH_SET_2G4_1_11 */ - - { 115, BAND_5G, CHNL_SPAN_20, 36, 4, FALSE }, /* CH_SET_UNII_LOW_36_48 */ - { 118, BAND_5G, CHNL_SPAN_20, 52, 4, FALSE }, /* CH_SET_UNII_MID_52_64 */ - { 121, BAND_5G, CHNL_SPAN_20, 100, 5, FALSE }, /* CH_SET_UNII_WW_100_116_132_140 */ - { 121, BAND_5G, CHNL_SPAN_20, 132, 5, FALSE }, - { 125, BAND_5G, CHNL_SPAN_20, 149, 5, FALSE }, /* CH_SET_UNII_UPPER_149_165 */ - } - }, - { - (PUINT_16) g_u2CountryGroup10, sizeof(g_u2CountryGroup10) / 2, - { - { 81, BAND_2G4, CHNL_SPAN_5, 1, 13, FALSE }, /* CH_SET_2G4_1_13 */ - - { 115, BAND_5G, CHNL_SPAN_20, 36, 4, FALSE }, /* CH_SET_UNII_LOW_36_48 */ - { 118, BAND_5G, CHNL_SPAN_20, 52, 4, FALSE }, /* CH_SET_UNII_MID_52_64 */ - { 121, BAND_NULL, 0, 0, 0, FALSE }, /* CH_SET_UNII_WW_NA */ - { 125, BAND_5G, CHNL_SPAN_20, 149, 5, FALSE }, /* CH_SET_UNII_UPPER_149_165 */ - { 0, BAND_NULL, 0, 0, 0, FALSE } - } - }, - { - (PUINT_16) g_u2CountryGroup11, sizeof(g_u2CountryGroup11) / 2, - { - { 81, BAND_2G4, CHNL_SPAN_5, 1, 13, FALSE }, /* CH_SET_2G4_1_13 */ - - { 115, BAND_5G, CHNL_SPAN_20, 36, 4, FALSE }, /* CH_SET_UNII_LOW_36_48 */ - { 118, BAND_5G, CHNL_SPAN_20, 52, 4, FALSE }, /* CH_SET_UNII_MID_52_64 */ - { 121, BAND_NULL, 0, 0, 0, FALSE }, /* CH_SET_UNII_WW_NA */ - { 125, BAND_NULL, 0, 0, 0, FALSE }, /* CH_SET_UNII_UPPER_NA */ - { 0, BAND_NULL, 0, 0, 0, FALSE } - } - }, - { - (PUINT_16) g_u2CountryGroup12, sizeof(g_u2CountryGroup12) / 2, - { - { 81, BAND_2G4, CHNL_SPAN_5, 1, 13, FALSE }, /* CH_SET_2G4_1_13 */ - - { 115, BAND_5G, CHNL_SPAN_20, 36, 4, FALSE }, /* CH_SET_UNII_LOW_36_48 */ - { 118, BAND_NULL, 0, 0, 0, FALSE }, /* CH_SET_UNII_MID_NA */ - { 121, BAND_NULL, 0, 0, 0, FALSE }, /* CH_SET_UNII_WW_NA */ - { 125, BAND_NULL, 0, 0, 0, FALSE }, /* CH_SET_UNII_UPPER_NA */ - { 0, BAND_NULL, 0, 0, 0, FALSE } - } - }, - { - (PUINT_16) g_u2CountryGroup13, sizeof(g_u2CountryGroup13) / 2, - { - { 81, BAND_2G4, CHNL_SPAN_5, 1, 13, FALSE }, /* CH_SET_2G4_1_13 */ - - { 115, BAND_5G, CHNL_SPAN_20, 36, 4, FALSE }, /* CH_SET_UNII_LOW_36_48 */ - { 118, BAND_5G, CHNL_SPAN_20, 52, 4, FALSE }, /* CH_SET_UNII_MID_52_64 */ - { 121, BAND_5G, CHNL_SPAN_20, 100, 8, FALSE }, /* CH_SET_UNII_WW_100_128 */ - { 125, BAND_5G, CHNL_SPAN_20, 149, 5, FALSE }, /* CH_SET_UNII_UPPER_149_165 */ - { 0, BAND_NULL, 0, 0, 0, FALSE } - } - }, - { - /* Note: The final one is for Europe union now. */ - (PUINT_16) g_u2CountryGroup14, sizeof(g_u2CountryGroup14) / 2, - { - { 81, BAND_2G4, CHNL_SPAN_5, 1, 13, FALSE }, /* CH_SET_2G4_1_13 */ - - { 115, BAND_5G, CHNL_SPAN_20, 36, 4, FALSE }, /* CH_SET_UNII_LOW_36_48 */ - { 118, BAND_5G, CHNL_SPAN_20, 52, 4, FALSE }, /* CH_SET_UNII_MID_52_64 */ - { 121, BAND_5G, CHNL_SPAN_20, 100, 11, FALSE }, /* CH_SET_UNII_WW_100_140 */ - { 125, BAND_5G, CHNL_SPAN_20, 149, 7, FALSE }, /* CH_SET_UNII_UPPER_149_173 */ - { 0, BAND_NULL, 0, 0, 0, FALSE } - } - } -}; - -#if 0 -COUNTRY_CH_SET_T arCountryChSets[] = { - /* idx=0: US, Bahamas, Barbados, Bolivia(Voluntary), Dominica (the Commonwealth of Dominica), - The Dominican Republic, Haiti */ - {CH_SET_2G4_1_11, CH_SET_UNII_LOW_36_48, CH_SET_UNII_MID_52_64, - CH_SET_UNII_WW_100_140, CH_SET_UNII_UPPER_149_165}, - /* idx=1: Brazil, Ecuador, Hong Kong, Mexico, Peru */ - {CH_SET_2G4_1_13, CH_SET_UNII_LOW_36_48, CH_SET_UNII_MID_52_64, - CH_SET_UNII_WW_100_140, CH_SET_UNII_UPPER_149_165}, - /* idx=2: JP1, Colombia(Voluntary), Paraguay */ - {CH_SET_2G4_1_13, CH_SET_UNII_LOW_36_48, CH_SET_UNII_MID_52_64, - CH_SET_UNII_WW_100_140, CH_SET_UNII_UPPER_NA}, - /* idx=3: JP2 */ - {CH_SET_2G4_1_14, CH_SET_UNII_LOW_36_48, CH_SET_UNII_MID_52_64, - CH_SET_UNII_WW_100_140, CH_SET_UNII_UPPER_NA}, - /* idx=4: CN, Uruguay, Morocco */ - {CH_SET_2G4_1_13, CH_SET_UNII_LOW_NA, CH_SET_UNII_MID_NA, - CH_SET_UNII_WW_NA, CH_SET_UNII_UPPER_149_165}, - /* idx=5: Argentina */ - {CH_SET_2G4_1_13, CH_SET_UNII_LOW_NA, CH_SET_UNII_MID_52_64, - CH_SET_UNII_WW_NA, CH_SET_UNII_UPPER_149_165}, - /* idx=6: Australia, New Zealand */ - {CH_SET_2G4_1_11, CH_SET_UNII_LOW_36_48, CH_SET_UNII_MID_52_64, - CH_SET_UNII_WW_100_140, CH_SET_UNII_UPPER_149_161}, - /* idx=7: Russia */ - {CH_SET_2G4_1_13, CH_SET_UNII_LOW_36_48, CH_SET_UNII_MID_52_64, - CH_SET_UNII_WW_100_140, CH_SET_UNII_UPPER_149_161}, - /* idx=8: Indonesia */ - {CH_SET_2G4_1_13, CH_SET_UNII_LOW_NA, CH_SET_UNII_MID_NA, - CH_SET_UNII_WW_NA, CH_SET_UNII_UPPER_149_161}, - /* idx=9: Canada */ - {CH_SET_2G4_1_11, CH_SET_UNII_LOW_36_48, CH_SET_UNII_MID_52_64, - CH_SET_UNII_WW_100_116_132_140, CH_SET_UNII_UPPER_149_165}, - /* idx=10: Chile, India, Saudi Arabia, Singapore */ - {CH_SET_2G4_1_13, CH_SET_UNII_LOW_36_48, CH_SET_UNII_MID_52_64, - CH_SET_UNII_WW_NA, CH_SET_UNII_UPPER_149_165}, - /* idx=11: Israel, Ukraine */ - {CH_SET_2G4_1_13, CH_SET_UNII_LOW_36_48, CH_SET_UNII_MID_52_64, - CH_SET_UNII_WW_NA, CH_SET_UNII_UPPER_NA}, - /* idx=12: Jordan, Kuwait */ - {CH_SET_2G4_1_13, CH_SET_UNII_LOW_36_48, CH_SET_UNII_MID_NA, - CH_SET_UNII_WW_NA, CH_SET_UNII_UPPER_NA}, - /* idx=13: South Korea */ - {CH_SET_2G4_1_13, CH_SET_UNII_LOW_36_48, CH_SET_UNII_MID_52_64, - CH_SET_UNII_WW_100_128, CH_SET_UNII_UPPER_149_165}, - /* idx=14: Taiwan */ - {CH_SET_2G4_1_11, CH_SET_UNII_LOW_NA, CH_SET_UNII_MID_52_64, - CH_SET_UNII_WW_100_140, CH_SET_UNII_UPPER_149_165}, - /* idx=15: EU all countries */ - {CH_SET_2G4_1_13, CH_SET_UNII_LOW_36_48, CH_SET_UNII_MID_52_64, - CH_SET_UNII_WW_100_140, CH_SET_UNII_UPPER_149_173} -}; -#endif - - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in/out] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -P_DOMAIN_INFO_ENTRY -rlmDomainGetDomainInfo ( - P_ADAPTER_T prAdapter - ) -{ -#define REG_DOMAIN_DEF_IDX 14 /* EU (Europe Union) */ -#define REG_DOMAIN_GROUP_NUM \ - (sizeof(arSupportedRegDomains) / sizeof(DOMAIN_INFO_ENTRY)) - - UINT_16 i, j; - P_DOMAIN_INFO_ENTRY prDomainInfo; - P_REG_INFO_T prRegInfo; - UINT_16 u2TargetCountryCode; - - ASSERT(prAdapter); - - if (prAdapter->prDomainInfo) { - return prAdapter->prDomainInfo; - } - - prRegInfo = &prAdapter->prGlueInfo->rRegInfo; - - DBGLOG(RLM, INFO, ("Domain: map=%d, idx=%d, code=0x%04x\n", - prRegInfo->eRegChannelListMap, prRegInfo->ucRegChannelListIndex, - prAdapter->rWifiVar.rConnSettings.u2CountryCode)); - - if (prRegInfo->eRegChannelListMap == REG_CH_MAP_TBL_IDX && - prRegInfo->ucRegChannelListIndex < REG_DOMAIN_GROUP_NUM) { - prDomainInfo = &arSupportedRegDomains[prRegInfo->ucRegChannelListIndex]; - goto L_set_domain_info; - } - else if (prRegInfo->eRegChannelListMap == REG_CH_MAP_CUSTOMIZED) { - prDomainInfo = &prRegInfo->rDomainInfo; - goto L_set_domain_info; - } - - u2TargetCountryCode = prAdapter->rWifiVar.rConnSettings.u2CountryCode; - - /* If no matched country code, the final one will be used - * The final one is for Europe union now. - */ - for (i = 0; i < REG_DOMAIN_GROUP_NUM; i++) { - prDomainInfo = &arSupportedRegDomains[i]; - - ASSERT((prDomainInfo->u4CountryNum && prDomainInfo->pu2CountryGroup) || - prDomainInfo->u4CountryNum == 0); - - for (j = 0; j < prDomainInfo->u4CountryNum; j++) { - if (prDomainInfo->pu2CountryGroup[j] == u2TargetCountryCode) { - break; - } - } - if (j < prDomainInfo->u4CountryNum) { - break; /* Found */ - } - } - - DATA_STRUC_INSPECTING_ASSERT(REG_DOMAIN_DEF_IDX < REG_DOMAIN_GROUP_NUM); - - if (i >= REG_DOMAIN_GROUP_NUM) { - prDomainInfo = &arSupportedRegDomains[REG_DOMAIN_DEF_IDX]; - } - -L_set_domain_info: - - prAdapter->prDomainInfo = prDomainInfo; - return prDomainInfo; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in/out] The input variable pointed by pucNumOfChannel is the max -* arrary size. The return value indciates meaning list size. -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmDomainGetChnlList ( - P_ADAPTER_T prAdapter, - ENUM_BAND_T eSpecificBand, - UINT_8 ucMaxChannelNum, - PUINT_8 pucNumOfChannel, - P_RF_CHANNEL_INFO_T paucChannelList - ) -{ - UINT_8 i, j, ucNum; - P_DOMAIN_SUBBAND_INFO prSubband; - P_DOMAIN_INFO_ENTRY prDomainInfo; - - ASSERT(prAdapter); - ASSERT(paucChannelList); - ASSERT(pucNumOfChannel); - - /* If no matched country code, the final one will be used */ - prDomainInfo = rlmDomainGetDomainInfo(prAdapter); - ASSERT(prDomainInfo); - - ucNum = 0; - for (i = 0; i < MAX_SUBBAND_NUM; i++) { - prSubband = &prDomainInfo->rSubBand[i]; - - if (prSubband->ucBand == BAND_NULL || prSubband->ucBand >= BAND_NUM || - (prSubband->ucBand == BAND_5G && !prAdapter->fgEnable5GBand)) { - continue; - } - - if (eSpecificBand == BAND_NULL || prSubband->ucBand == eSpecificBand) { - for (j = 0; j < prSubband->ucNumChannels; j++) { - if (ucNum >= ucMaxChannelNum) { - break; - } - paucChannelList[ucNum].eBand = prSubband->ucBand; - paucChannelList[ucNum].ucChannelNum = - prSubband->ucFirstChannelNum + j * prSubband->ucChannelSpan; - ucNum++; - } - } - } - - *pucNumOfChannel = ucNum; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief -* -* @param[in] -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmDomainSendCmd ( - P_ADAPTER_T prAdapter, - BOOLEAN fgIsOid - ) -{ - P_DOMAIN_INFO_ENTRY prDomainInfo; - P_CMD_SET_DOMAIN_INFO_T prCmd; - WLAN_STATUS rStatus; - UINT_8 i; - P_DOMAIN_SUBBAND_INFO prSubBand; - - prDomainInfo = rlmDomainGetDomainInfo(prAdapter); - ASSERT(prDomainInfo); - - prCmd = cnmMemAlloc(prAdapter, RAM_TYPE_BUF, sizeof(CMD_SET_DOMAIN_INFO_T)); - ASSERT(prCmd); - - /* To do: exception handle */ - if (!prCmd) { - DBGLOG(RLM, ERROR, ("Domain: no buf to send cmd\n")); - return; - } - kalMemZero(prCmd, sizeof(CMD_SET_DOMAIN_INFO_T)); - - prCmd->u2CountryCode = prAdapter->rWifiVar.rConnSettings.u2CountryCode; - prCmd->u2Reserved = 0; - prCmd->uc2G4Bandwidth = - prAdapter->rWifiVar.rConnSettings.uc2G4BandwidthMode; - prCmd->uc5GBandwidth = - prAdapter->rWifiVar.rConnSettings.uc5GBandwidthMode; - - for (i = 0; i < 6; i++) { - prSubBand = &prDomainInfo->rSubBand[i]; - - prCmd->rSubBand[i].ucRegClass = prSubBand->ucRegClass; - prCmd->rSubBand[i].ucBand = prSubBand->ucBand; - - if (prSubBand->ucBand != BAND_NULL && prSubBand->ucBand < BAND_NUM) { - prCmd->rSubBand[i].ucChannelSpan = prSubBand->ucChannelSpan; - prCmd->rSubBand[i].ucFirstChannelNum = prSubBand->ucFirstChannelNum; - prCmd->rSubBand[i].ucNumChannels = prSubBand->ucNumChannels; - } - } - - /* Update domain info to chip */ - rStatus = wlanSendSetQueryCmd ( - prAdapter, /* prAdapter */ - CMD_ID_SET_DOMAIN_INFO, /* ucCID */ - TRUE, /* fgSetQuery */ - FALSE, /* fgNeedResp */ - fgIsOid, /* fgIsOid */ - NULL, /* pfCmdDoneHandler*/ - NULL, /* pfCmdTimeoutHandler */ - sizeof(CMD_SET_DOMAIN_INFO_T), /* u4SetQueryInfoLen */ - (PUINT_8) prCmd, /* pucInfoBuffer */ - NULL, /* pvSetQueryBuffer */ - 0 /* u4SetQueryBufferLen */ - ); - - ASSERT(rStatus == WLAN_STATUS_PENDING); - - cnmMemFree(prAdapter, prCmd); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in/out] -* -* \return TRUE Legal channel -* FALSE Illegal channel for current regulatory domain -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rlmDomainIsLegalChannel ( - P_ADAPTER_T prAdapter, - ENUM_BAND_T eBand, - UINT_8 ucChannel - ) -{ - UINT_8 i, j; - P_DOMAIN_SUBBAND_INFO prSubband; - P_DOMAIN_INFO_ENTRY prDomainInfo; - - prDomainInfo = rlmDomainGetDomainInfo(prAdapter); - ASSERT(prDomainInfo); - - for (i = 0; i < MAX_SUBBAND_NUM; i++) { - prSubband = &prDomainInfo->rSubBand[i]; - - if (prSubband->ucBand == BAND_5G && !prAdapter->fgEnable5GBand) { - continue; - } - - if (prSubband->ucBand == eBand) { - for (j = 0; j < prSubband->ucNumChannels; j++) { - if ((prSubband->ucFirstChannelNum + j*prSubband->ucChannelSpan) - == ucChannel) { - return TRUE; - } - } - } - } - - return FALSE; -} - diff --git a/drivers/net/wireless/mt5931/mgmt/rlm_obss.c b/drivers/net/wireless/mt5931/mgmt/rlm_obss.c deleted file mode 100755 index 143d72104a24..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/rlm_obss.c +++ /dev/null @@ -1,461 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/rlm_obss.c#2 $ -*/ - -/*! \file "rlm_obss.c" - \brief - -*/ - - - -/* -** $Log: rlm_obss.c $ - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 11 15 2011 cm.chang - * NULL - * Avoid possible OBSS scan when BSS is switched - * - * 11 08 2011 cm.chang - * NULL - * Add RLM and CNM debug message for XLOG - * - * 10 25 2011 cm.chang - * [WCXRP00001058] [All Wi-Fi][Driver] Fix sta_rec's phyTypeSet and OBSS scan in AP mode - * Regulation class is changed to 81 in 20_40_coexistence action frame - * - * 04 12 2011 cm.chang - * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency - * . - * - * 03 29 2011 cm.chang - * [WCXRP00000606] [MT6620 Wi-Fi][Driver][FW] Fix klocwork warning - * As CR title - * - * 01 24 2011 cm.chang - * [WCXRP00000384] [MT6620 Wi-Fi][Driver][FW] Handle 20/40 action frame in AP mode and stop ampdu timer when sta_rec is freed - * Process received 20/40 coexistence action frame for AP mode - * - * 01 13 2011 cm.chang - * [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module - * Refine function when rcv a 20/40M public action frame - * - * 01 13 2011 cm.chang - * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting - * Use SCO of BSS_INFO to replace user-defined setting variables - * - * 01 12 2011 cm.chang - * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting - * User-defined bandwidth is for 2.4G and 5G individually - * - * 10 18 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * use definition macro to replace hard-coded constant - * - * 09 16 2010 cm.chang - * NULL - * Change conditional compiling options for BOW - * - * 09 10 2010 cm.chang - * NULL - * Always update Beacon content if FW sync OBSS info - * - * 08 24 2010 cm.chang - * NULL - * Support RLM initail channel of Ad-hoc, P2P and BOW - * - * 08 20 2010 cm.chang - * NULL - * Migrate RLM code to host from FW - * - * 07 26 2010 yuche.tsai - * - * Fix compile error while enabling WiFi Direct function. - * - * 07 21 2010 yuche.tsai - * - * Add P2P Scan & Scan Result Parsing & Saving. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Check draft RLM code for HT cap - * - * 05 07 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Process 20/40 coexistence public action frame in AP mode - * - * 05 05 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * First draft support for 20/40M bandwidth for AP mode - * - * 04 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW - * - * 04 13 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add more ASSERT to check exception - * - * 04 07 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add virtual test for OBSS scan - * - * 03 30 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support 2.4G OBSS scan - * - * 03 03 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * To support CFG_SUPPORT_BCM_STP - * - * 02 13 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support PCO in STA mode - * - * 02 12 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Use bss info array for concurrent handle - * - * 02 05 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup - * - * 01 25 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support protection and bandwidth switch -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -static VOID -rlmObssScanTimeout ( - P_ADAPTER_T prAdapter, - UINT_32 u4Data - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmObssInit ( - P_ADAPTER_T prAdapter - ) -{ - P_BSS_INFO_T prBssInfo; - UINT_8 ucNetIdx; - - RLM_NET_FOR_EACH(ucNetIdx) { - prBssInfo = &prAdapter->rWifiVar.arBssInfo[ucNetIdx]; - ASSERT(prBssInfo); - - cnmTimerInitTimer(prAdapter, &prBssInfo->rObssScanTimer, - rlmObssScanTimeout, (UINT_32) prBssInfo); - } /* end of RLM_NET_FOR_EACH */ -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rlmObssUpdateChnlLists ( - P_ADAPTER_T prAdapter, - P_SW_RFB_T prSwRfb - ) -{ - return TRUE; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmObssScanDone ( - P_ADAPTER_T prAdapter, - P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_SCN_SCAN_DONE prScanDoneMsg; - P_BSS_INFO_T prBssInfo; - P_MSDU_INFO_T prMsduInfo; - P_ACTION_20_40_COEXIST_FRAME prTxFrame; - UINT_16 i, u2PayloadLen; - - ASSERT(prMsgHdr); - - prScanDoneMsg = (P_MSG_SCN_SCAN_DONE) prMsgHdr; - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prScanDoneMsg->ucNetTypeIndex]; - ASSERT(prBssInfo); - - DBGLOG(RLM, INFO, ("OBSS Scan Done (NetIdx=%d, Mode=%d)\n", - prScanDoneMsg->ucNetTypeIndex, prBssInfo->eCurrentOPMode)); - - cnmMemFree(prAdapter, prMsgHdr); - -#if CFG_ENABLE_WIFI_DIRECT - /* AP mode */ - if ((prAdapter->fgIsP2PRegistered) && - (IS_NET_ACTIVE(prAdapter, prBssInfo->ucNetTypeIndex)) && - (prBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT)) { - return; - } -#endif - - /* STA mode */ - if (prBssInfo->eCurrentOPMode != OP_MODE_INFRASTRUCTURE || - !RLM_NET_PARAM_VALID(prBssInfo) || prBssInfo->u2ObssScanInterval == 0) { - DBGLOG(RLM, WARN, ("OBSS Scan Done (NetIdx=%d) -- Aborted!!\n", - prBssInfo->ucNetTypeIndex)); - return; - } - - /* To do: check 2.4G channel list to decide if obss mgmt should be - * sent to associated AP. Note: how to handle concurrent network? - * To do: invoke rlmObssChnlLevel() to decide if 20/40 BSS coexistence - * management frame is needed. - */ - if ((prBssInfo->auc2G_20mReqChnlList[0] > 0 || - prBssInfo->auc2G_NonHtChnlList[0] > 0) && - (prMsduInfo = (P_MSDU_INFO_T) cnmMgtPktAlloc(prAdapter, - MAC_TX_RESERVED_FIELD + PUBLIC_ACTION_MAX_LEN)) != NULL) { - - DBGLOG(RLM, INFO, ("Send 20/40 coexistence mgmt(20mReq=%d, NonHt=%d)\n", - prBssInfo->auc2G_20mReqChnlList[0], - prBssInfo->auc2G_NonHtChnlList[0])); - - prTxFrame = (P_ACTION_20_40_COEXIST_FRAME) - ((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD); - - prTxFrame->u2FrameCtrl = MAC_FRAME_ACTION; - COPY_MAC_ADDR(prTxFrame->aucDestAddr, prBssInfo->aucBSSID); - COPY_MAC_ADDR(prTxFrame->aucSrcAddr, prBssInfo->aucOwnMacAddr); - COPY_MAC_ADDR(prTxFrame->aucBSSID, prBssInfo->aucBSSID); - - prTxFrame->ucCategory = CATEGORY_PUBLIC_ACTION; - prTxFrame->ucAction = ACTION_PUBLIC_20_40_COEXIST; - - /* To do: find correct algorithm */ - prTxFrame->rBssCoexist.ucId = ELEM_ID_20_40_BSS_COEXISTENCE; - prTxFrame->rBssCoexist.ucLength = 1; - prTxFrame->rBssCoexist.ucData = - (prBssInfo->auc2G_20mReqChnlList[0] > 0) ? BSS_COEXIST_20M_REQ : 0; - - u2PayloadLen = 2 + 3; - - if (prBssInfo->auc2G_NonHtChnlList[0] > 0) { - ASSERT(prBssInfo->auc2G_NonHtChnlList[0] <= CHNL_LIST_SZ_2G); - - prTxFrame->rChnlReport.ucId = ELEM_ID_20_40_INTOLERANT_CHNL_REPORT; - prTxFrame->rChnlReport.ucLength = - prBssInfo->auc2G_NonHtChnlList[0] + 1; - prTxFrame->rChnlReport.ucRegulatoryClass = 81; /* 2.4GHz, ch1~13 */ - for (i = 0; i < prBssInfo->auc2G_NonHtChnlList[0] && - i < CHNL_LIST_SZ_2G; i++) { - prTxFrame->rChnlReport.aucChannelList[i] = - prBssInfo->auc2G_NonHtChnlList[i+1]; - } - - u2PayloadLen += IE_SIZE(&prTxFrame->rChnlReport); - } - ASSERT((WLAN_MAC_HEADER_LEN + u2PayloadLen) <= PUBLIC_ACTION_MAX_LEN); - - /* Clear up channel lists in 2.4G band */ - prBssInfo->auc2G_20mReqChnlList[0] = 0; - prBssInfo->auc2G_NonHtChnlList[0] = 0; - - - //4 Update information of MSDU_INFO_T - prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_MGMT; /* Management frame */ - prMsduInfo->ucStaRecIndex = prBssInfo->prStaRecOfAP->ucIndex; - prMsduInfo->ucNetworkType = prBssInfo->ucNetTypeIndex; - prMsduInfo->ucMacHeaderLength = WLAN_MAC_MGMT_HEADER_LEN; - prMsduInfo->fgIs802_1x = FALSE; - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = WLAN_MAC_MGMT_HEADER_LEN + u2PayloadLen; - prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMsduInfo->pfTxDoneHandler = NULL; - prMsduInfo->fgIsBasicRate = FALSE; - - //4 Enqueue the frame to send this action frame. - nicTxEnqueueMsdu(prAdapter, prMsduInfo); - } /* end of prMsduInfo != NULL */ - - if (prBssInfo->u2ObssScanInterval > 0) { - DBGLOG(RLM, INFO, ("Set OBSS timer (NetIdx=%d, %d sec)\n", - prBssInfo->ucNetTypeIndex, prBssInfo->u2ObssScanInterval)); - - cnmTimerStartTimer(prAdapter, &prBssInfo->rObssScanTimer, - prBssInfo->u2ObssScanInterval * MSEC_PER_SEC); - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -static VOID -rlmObssScanTimeout ( - P_ADAPTER_T prAdapter, - UINT_32 u4Data - ) -{ - P_BSS_INFO_T prBssInfo; - - prBssInfo = (P_BSS_INFO_T) u4Data; - ASSERT(prBssInfo); - -#if CFG_ENABLE_WIFI_DIRECT - /* AP mode */ - if (prAdapter->fgIsP2PRegistered && - (IS_NET_ACTIVE(prAdapter, prBssInfo->ucNetTypeIndex)) && - (prBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT)) { - - prBssInfo->fgObssActionForcedTo20M = FALSE; - - /* Check if Beacon content need to be updated */ - rlmUpdateParamsForAP(prAdapter, prBssInfo, FALSE); - - return; - } -#endif /* end of CFG_ENABLE_WIFI_DIRECT */ - - - /* STA mode */ - if (prBssInfo->eCurrentOPMode != OP_MODE_INFRASTRUCTURE || - !RLM_NET_PARAM_VALID(prBssInfo) || prBssInfo->u2ObssScanInterval == 0) { - DBGLOG(RLM, WARN, ("OBSS Scan timeout (NetIdx=%d) -- Aborted!!\n", - prBssInfo->ucNetTypeIndex)); - return; - } - - rlmObssTriggerScan(prAdapter, prBssInfo); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rlmObssTriggerScan ( - P_ADAPTER_T prAdapter, - P_BSS_INFO_T prBssInfo - ) -{ - P_MSG_SCN_SCAN_REQ prScanReqMsg; - - ASSERT(prBssInfo); - - prScanReqMsg = (P_MSG_SCN_SCAN_REQ) - cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_SCN_SCAN_REQ)); - ASSERT(prScanReqMsg); - - if (!prScanReqMsg) { - DBGLOG(RLM, WARN, ("No buf for OBSS scan (NetIdx=%d)!!\n", - prBssInfo->ucNetTypeIndex)); - - cnmTimerStartTimer(prAdapter, &prBssInfo->rObssScanTimer, - prBssInfo->u2ObssScanInterval * MSEC_PER_SEC); - return; - } - - /* It is ok that ucSeqNum is set to fixed value because the same network - * OBSS scan interval is limited to OBSS_SCAN_MIN_INTERVAL (min 10 sec) - * and scan module don't care seqNum of OBSS scanning - */ - prScanReqMsg->rMsgHdr.eMsgId = MID_RLM_SCN_SCAN_REQ; - prScanReqMsg->ucSeqNum = 0x33; - prScanReqMsg->ucNetTypeIndex = prBssInfo->ucNetTypeIndex; - prScanReqMsg->eScanType = SCAN_TYPE_ACTIVE_SCAN; - prScanReqMsg->ucSSIDType = SCAN_REQ_SSID_WILDCARD; - prScanReqMsg->ucSSIDLength = 0; - prScanReqMsg->eScanChannel = SCAN_CHANNEL_2G4; - prScanReqMsg->u2IELen = 0; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prScanReqMsg, - MSG_SEND_METHOD_BUF); - - DBGLOG(RLM, INFO, ("Timeout to trigger OBSS scan (NetIdx=%d)!!\n", - prBssInfo->ucNetTypeIndex)); -} - - diff --git a/drivers/net/wireless/mt5931/mgmt/rlm_protection.c b/drivers/net/wireless/mt5931/mgmt/rlm_protection.c deleted file mode 100755 index 27ffda023bf8..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/rlm_protection.c +++ /dev/null @@ -1,108 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/rlm_protection.c#1 $ -*/ - -/*! \file "rlm_protection.c" - \brief - -*/ - - - -/* -** $Log: rlm_protection.c $ - * - * 08 20 2010 cm.chang - * NULL - * Migrate RLM code to host from FW - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Check draft RLM code for HT cap - * - * 05 28 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Set RTS threshold of 2K bytes initially - * - * 04 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW - * - * 04 22 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * First draft code to support protection in AP mode - * - * 03 31 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Enable RTS threshold temporarily for AMPDU - * - * 03 16 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add AdHoc Mode - * - * 03 03 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * To support CFG_SUPPORT_BCM_STP - * - * 02 13 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support PCO in STA mode - * - * 02 12 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Use bss info array for concurrent handle - * - * 01 25 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support protection and bandwidth switch -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - diff --git a/drivers/net/wireless/mt5931/mgmt/roaming_fsm.c b/drivers/net/wireless/mt5931/mgmt/roaming_fsm.c deleted file mode 100755 index c941873eb8f3..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/roaming_fsm.c +++ /dev/null @@ -1,583 +0,0 @@ -/* -** $Id: -*/ - -/*! \file "roaming_fsm.c" - \brief This file defines the FSM for Roaming MODULE. - - This file defines the FSM for Roaming MODULE. -*/ - - - -/* -** $Log: roaming_fsm.c $ - * - * 11 24 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * Adjust code for DBG and CONFIG_XLOG. - * - * 11 11 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * modify the xlog related code. - * - * 11 02 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * adding the code for XLOG. - * - * 08 31 2011 tsaiyuan.hsu - * [WCXRP00000931] [MT5931 Wi-Fi][DRV/FW] add swcr to disable roaming from driver - * remove obsolete code. - * - * 08 15 2011 tsaiyuan.hsu - * [WCXRP00000931] [MT5931 Wi-Fi][DRV/FW] add swcr to disable roaming from driver - * add swcr in driver reg, 0x9fxx0000, to disable roaming . - * - * 03 16 2011 tsaiyuan.hsu - * [WCXRP00000517] [MT6620 Wi-Fi][Driver][FW] Fine Tune Performance of Roaming - * remove obsolete definition and unused variables. - * - * 02 26 2011 tsaiyuan.hsu - * [WCXRP00000391] [MT6620 Wi-Fi][FW] Add Roaming Support - * not send disassoc or deauth to leaving AP so as to improve performace of roaming. - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -#if CFG_SUPPORT_ROAMING -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -#if DBG -/*lint -save -e64 Type mismatch */ -static PUINT_8 apucDebugRoamingState[ROAMING_STATE_NUM] = { - (PUINT_8)DISP_STRING("ROAMING_STATE_IDLE"), - (PUINT_8)DISP_STRING("ROAMING_STATE_DECISION"), - (PUINT_8)DISP_STRING("ROAMING_STATE_DISCOVERY"), - (PUINT_8)DISP_STRING("ROAMING_STATE_ROAM") -}; -/*lint -restore */ -#endif /* DBG */ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -#define ROAMING_ENABLE_CHECK(_roam) \ - { \ - if (!(_roam->fgIsEnableRoaming)) {return;} \ - } - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Initialize the value in ROAMING_FSM_INFO_T for ROAMING FSM operation -* -* @param [IN P_ADAPTER_T] prAdapter -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -roamingFsmInit ( - IN P_ADAPTER_T prAdapter - ) -{ - P_ROAMING_INFO_T prRoamingFsmInfo; - P_CONNECTION_SETTINGS_T prConnSettings; - - DBGLOG(ROAMING, LOUD, ("->roamingFsmInit(): Current Time = %ld\n", kalGetTimeTick())); - - prRoamingFsmInfo = (P_ROAMING_INFO_T)&(prAdapter->rWifiVar.rRoamingInfo); - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - - //4 <1> Initiate FSM - prRoamingFsmInfo->fgIsEnableRoaming = prConnSettings->fgIsEnableRoaming; - prRoamingFsmInfo->eCurrentState = ROAMING_STATE_IDLE; - prRoamingFsmInfo->rRoamingDiscoveryUpdateTime = 0; - - return; -} /* end of roamingFsmInit() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Uninitialize the value in AIS_FSM_INFO_T for AIS FSM operation -* -* @param [IN P_ADAPTER_T] prAdapter -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -roamingFsmUninit ( - IN P_ADAPTER_T prAdapter - ) -{ - P_ROAMING_INFO_T prRoamingFsmInfo; - - DBGLOG(ROAMING, LOUD, ("->roamingFsmUninit(): Current Time = %ld\n", kalGetTimeTick())); - - prRoamingFsmInfo = (P_ROAMING_INFO_T)&(prAdapter->rWifiVar.rRoamingInfo); - - prRoamingFsmInfo->eCurrentState = ROAMING_STATE_IDLE; - - return; -} /* end of roamingFsmUninit() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Send commands to firmware -* -* @param [IN P_ADAPTER_T] prAdapter -* [IN P_ROAMING_PARAM_T] prParam -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -roamingFsmSendCmd ( - IN P_ADAPTER_T prAdapter, - IN P_ROAMING_PARAM_T prParam - ) -{ - P_ROAMING_INFO_T prRoamingFsmInfo; - WLAN_STATUS rStatus; - - DBGLOG(ROAMING, LOUD, ("->roamingFsmSendCmd(): Current Time = %ld\n", kalGetTimeTick())); - - prRoamingFsmInfo = (P_ROAMING_INFO_T)&(prAdapter->rWifiVar.rRoamingInfo); - - rStatus = wlanSendSetQueryCmd ( - prAdapter, /* prAdapter */ - CMD_ID_ROAMING_TRANSIT, /* ucCID */ - TRUE, /* fgSetQuery */ - FALSE, /* fgNeedResp */ - FALSE, /* fgIsOid */ - NULL, /* pfCmdDoneHandler */ - NULL, /* pfCmdTimeoutHandler */ - sizeof(ROAMING_PARAM_T), /* u4SetQueryInfoLen */ - (PUINT_8) prParam, /* pucInfoBuffer */ - NULL, /* pvSetQueryBuffer */ - 0 /* u4SetQueryBufferLen */ - ); - - ASSERT(rStatus == WLAN_STATUS_PENDING); - - return; -} /* end of roamingFsmSendCmd() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Update the recent time when ScanDone occurred -* -* @param [IN P_ADAPTER_T] prAdapter -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -roamingFsmScanResultsUpdate ( - IN P_ADAPTER_T prAdapter - ) -{ - P_ROAMING_INFO_T prRoamingFsmInfo; - - prRoamingFsmInfo = (P_ROAMING_INFO_T)&(prAdapter->rWifiVar.rRoamingInfo); - - /* Check Roaming Conditions */ - ROAMING_ENABLE_CHECK(prRoamingFsmInfo); - - DBGLOG(ROAMING, LOUD, ("->roamingFsmScanResultsUpdate(): Current Time = %ld\n", kalGetTimeTick())); - - GET_CURRENT_SYSTIME(&prRoamingFsmInfo->rRoamingDiscoveryUpdateTime); - - return; -} /* end of roamingFsmScanResultsUpdate() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief The Core FSM engine of ROAMING for AIS Infra. -* -* @param [IN P_ADAPTER_T] prAdapter -* [IN ENUM_ROAMING_STATE_T] eNextState Enum value of next AIS STATE -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -roamingFsmSteps ( - IN P_ADAPTER_T prAdapter, - IN ENUM_ROAMING_STATE_T eNextState - ) -{ - P_ROAMING_INFO_T prRoamingFsmInfo; - ENUM_ROAMING_STATE_T ePreviousState; - BOOLEAN fgIsTransition = (BOOLEAN)FALSE; - - prRoamingFsmInfo = (P_ROAMING_INFO_T)&(prAdapter->rWifiVar.rRoamingInfo); - - do { - - /* Do entering Next State */ -#if DBG - DBGLOG(ROAMING, STATE, ("TRANSITION: [%s] -> [%s]\n", - apucDebugRoamingState[prRoamingFsmInfo->eCurrentState], - apucDebugRoamingState[eNextState])); -#else - DBGLOG(ROAMING, STATE, ("[%d] TRANSITION: [%d] -> [%d]\n", - DBG_ROAMING_IDX, - prRoamingFsmInfo->eCurrentState, - eNextState)); -#endif - /* NOTE(Kevin): This is the only place to change the eCurrentState(except initial) */ - ePreviousState = prRoamingFsmInfo->eCurrentState; - prRoamingFsmInfo->eCurrentState = eNextState; - - fgIsTransition = (BOOLEAN)FALSE; - - /* Do tasks of the State that we just entered */ - switch (prRoamingFsmInfo->eCurrentState) { - /* NOTE(Kevin): we don't have to rearrange the sequence of following - * switch case. Instead I would like to use a common lookup table of array - * of function pointer to speed up state search. - */ - case ROAMING_STATE_IDLE: - case ROAMING_STATE_DECISION: - break; - - case ROAMING_STATE_DISCOVERY: - { - OS_SYSTIME rCurrentTime; - - GET_CURRENT_SYSTIME(&rCurrentTime); - if (CHECK_FOR_TIMEOUT(rCurrentTime, prRoamingFsmInfo->rRoamingDiscoveryUpdateTime, - SEC_TO_SYSTIME(ROAMING_DISCOVERY_TIMEOUT_SEC))) { - DBGLOG(ROAMING, LOUD, ("roamingFsmSteps: DiscoveryUpdateTime Timeout")); - aisFsmRunEventRoamingDiscovery(prAdapter, TRUE); - } - else { - DBGLOG(ROAMING, LOUD, ("roamingFsmSteps: DiscoveryUpdateTime Updated")); - aisFsmRunEventRoamingDiscovery(prAdapter, FALSE); - } - } - break; - - case ROAMING_STATE_ROAM: - break; - - default: - ASSERT(0); /* Make sure we have handle all STATEs */ - } - } - while (fgIsTransition); - - return; - -} /* end of roamingFsmSteps() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Transit to Decision state after join completion -* -* @param [IN P_ADAPTER_T] prAdapter -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -roamingFsmRunEventStart ( - IN P_ADAPTER_T prAdapter - ) -{ - P_ROAMING_INFO_T prRoamingFsmInfo; - ENUM_ROAMING_STATE_T eNextState; - P_BSS_INFO_T prAisBssInfo; - ROAMING_PARAM_T rParam; - - prRoamingFsmInfo = (P_ROAMING_INFO_T)&(prAdapter->rWifiVar.rRoamingInfo); - - /* Check Roaming Conditions */ - ROAMING_ENABLE_CHECK(prRoamingFsmInfo); - - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - if (prAisBssInfo->eCurrentOPMode != OP_MODE_INFRASTRUCTURE) { - return; - } - - DBGLOG(ROAMING, EVENT, ("EVENT-ROAMING START: Current Time = %ld\n", kalGetTimeTick())); - - /* IDLE, ROAM -> DECISION */ - /* Errors as DECISION, DISCOVERY -> DECISION */ - if (!(prRoamingFsmInfo->eCurrentState == ROAMING_STATE_IDLE - || prRoamingFsmInfo->eCurrentState == ROAMING_STATE_ROAM)) { - return; - } - - eNextState = ROAMING_STATE_DECISION; - if (eNextState != prRoamingFsmInfo->eCurrentState) { - rParam.u2Event = ROAMING_EVENT_START; - roamingFsmSendCmd(prAdapter, (P_ROAMING_PARAM_T) &rParam); - - /* Step to next state */ - roamingFsmSteps(prAdapter, eNextState); - } - - return; -} /* end of roamingFsmRunEventStart() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Transit to Discovery state when deciding to find a candidate -* -* @param [IN P_ADAPTER_T] prAdapter -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -roamingFsmRunEventDiscovery ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Param - ) -{ - P_ROAMING_INFO_T prRoamingFsmInfo; - ENUM_ROAMING_STATE_T eNextState; - - prRoamingFsmInfo = (P_ROAMING_INFO_T)&(prAdapter->rWifiVar.rRoamingInfo); - - /* Check Roaming Conditions */ - ROAMING_ENABLE_CHECK(prRoamingFsmInfo); - - DBGLOG(ROAMING, EVENT, ("EVENT-ROAMING DISCOVERY: Current Time = %ld\n", kalGetTimeTick())); - - /* DECISION -> DISCOVERY */ - /* Errors as IDLE, DISCOVERY, ROAM -> DISCOVERY */ - if (prRoamingFsmInfo->eCurrentState != ROAMING_STATE_DECISION) { - return; - } - - eNextState = ROAMING_STATE_DISCOVERY; - /* DECISION -> DISCOVERY */ - if (eNextState != prRoamingFsmInfo->eCurrentState) { - P_BSS_INFO_T prAisBssInfo; - P_BSS_DESC_T prBssDesc; - - // sync. rcpi with firmware - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - prBssDesc = scanSearchBssDescByBssid(prAdapter, prAisBssInfo->aucBSSID); - if (prBssDesc) { - prBssDesc->ucRCPI = (UINT_8)(u4Param&0xff); - } - - roamingFsmSteps(prAdapter, eNextState); - } - - return; -} /* end of roamingFsmRunEventDiscovery() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Transit to Roam state after Scan Done -* -* @param [IN P_ADAPTER_T] prAdapter -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -roamingFsmRunEventRoam ( - IN P_ADAPTER_T prAdapter - ) -{ - P_ROAMING_INFO_T prRoamingFsmInfo; - ENUM_ROAMING_STATE_T eNextState; - ROAMING_PARAM_T rParam; - - prRoamingFsmInfo = (P_ROAMING_INFO_T)&(prAdapter->rWifiVar.rRoamingInfo); - - /* Check Roaming Conditions */ - ROAMING_ENABLE_CHECK(prRoamingFsmInfo); - - DBGLOG(ROAMING, EVENT, ("EVENT-ROAMING ROAM: Current Time = %ld\n", kalGetTimeTick())); - - /* IDLE, ROAM -> DECISION */ - /* Errors as IDLE, DECISION, ROAM -> ROAM */ - if (prRoamingFsmInfo->eCurrentState != ROAMING_STATE_DISCOVERY) { - return; - } - - eNextState = ROAMING_STATE_ROAM; - /* DISCOVERY -> ROAM */ - if (eNextState != prRoamingFsmInfo->eCurrentState) { - rParam.u2Event = ROAMING_EVENT_ROAM; - roamingFsmSendCmd(prAdapter, (P_ROAMING_PARAM_T) &rParam); - - /* Step to next state */ - roamingFsmSteps(prAdapter, eNextState); - } - - return; -} /* end of roamingFsmRunEventRoam() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Transit to Decision state as being failed to find out any candidate -* -* @param [IN P_ADAPTER_T] prAdapter -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -roamingFsmRunEventFail ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Param - ) -{ - P_ROAMING_INFO_T prRoamingFsmInfo; - ENUM_ROAMING_STATE_T eNextState; - ROAMING_PARAM_T rParam; - - prRoamingFsmInfo = (P_ROAMING_INFO_T)&(prAdapter->rWifiVar.rRoamingInfo); - - /* Check Roaming Conditions */ - ROAMING_ENABLE_CHECK(prRoamingFsmInfo); - - DBGLOG(ROAMING, EVENT, ("EVENT-ROAMING FAIL: reason %x Current Time = %ld\n", u4Param, kalGetTimeTick())); - - /* IDLE, ROAM -> DECISION */ - /* Errors as IDLE, DECISION, DISCOVERY -> DECISION */ - if (prRoamingFsmInfo->eCurrentState != ROAMING_STATE_ROAM) { - return; - } - - eNextState = ROAMING_STATE_DECISION; - /* ROAM -> DECISION */ - if (eNextState != prRoamingFsmInfo->eCurrentState) { - rParam.u2Event = ROAMING_EVENT_FAIL; - rParam.u2Data = (UINT_16)(u4Param&0xffff); - roamingFsmSendCmd(prAdapter, (P_ROAMING_PARAM_T) &rParam); - - /* Step to next state */ - roamingFsmSteps(prAdapter, eNextState); - } - - return; -} /* end of roamingFsmRunEventFail() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Transit to Idle state as beging aborted by other moduels, AIS -* -* @param [IN P_ADAPTER_T] prAdapter -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -roamingFsmRunEventAbort ( - IN P_ADAPTER_T prAdapter - ) -{ - P_ROAMING_INFO_T prRoamingFsmInfo; - ENUM_ROAMING_STATE_T eNextState; - ROAMING_PARAM_T rParam; - - prRoamingFsmInfo = (P_ROAMING_INFO_T)&(prAdapter->rWifiVar.rRoamingInfo); - - ROAMING_ENABLE_CHECK(prRoamingFsmInfo); - - DBGLOG(ROAMING, EVENT, ("EVENT-ROAMING ABORT: Current Time = %ld\n", kalGetTimeTick())); - - eNextState = ROAMING_STATE_IDLE; - /* IDLE, DECISION, DISCOVERY, ROAM -> IDLE */ - if (eNextState != prRoamingFsmInfo->eCurrentState) { - rParam.u2Event = ROAMING_EVENT_ABORT; - roamingFsmSendCmd(prAdapter, (P_ROAMING_PARAM_T) &rParam); - - /* Step to next state */ - roamingFsmSteps(prAdapter, eNextState); - } - - return; -} /* end of roamingFsmRunEventAbort() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Process events from firmware -* -* @param [IN P_ADAPTER_T] prAdapter -* [IN P_ROAMING_PARAM_T] prParam -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -roamingFsmProcessEvent ( - IN P_ADAPTER_T prAdapter, - IN P_ROAMING_PARAM_T prParam - ) -{ - DBGLOG(ROAMING, LOUD, ("ROAMING Process Events: Current Time = %ld\n", kalGetTimeTick())); - - if (ROAMING_EVENT_DISCOVERY == prParam->u2Event) { - roamingFsmRunEventDiscovery(prAdapter, prParam->u2Data); - } - - return WLAN_STATUS_SUCCESS; -} - -#endif diff --git a/drivers/net/wireless/mt5931/mgmt/rsn.c b/drivers/net/wireless/mt5931/mgmt/rsn.c deleted file mode 100755 index ea3e8a10e70a..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/rsn.c +++ /dev/null @@ -1,2617 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/rsn.c#2 $ -*/ - -/*! \file "rsn.c" - \brief This file including the 802.11i, wpa and wpa2(rsn) related function. - - This file provided the macros and functions library support the wpa/rsn ie parsing, - cipher and AKM check to help the AP seleced deciding, tkip mic error handler and rsn PMKID support. -*/ - - - -/* -** $Log: rsn.c $ - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 03 09 2012 chinglan.wang - * NULL - * Fix the condition error. - * - * 03 02 2012 terry.wu - * NULL - * Snc CFG80211 modification for ICS migration from branch 2.2. - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 11 11 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * modify the xlog related code. - * - * 11 10 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * change the debug module level. - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 03 17 2011 chinglan.wang - * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature - * . - * - * 02 09 2011 wh.su - * [WCXRP00000432] [MT6620 Wi-Fi][Driver] Add STA privacy check at hotspot mode - * adding the code for check STA privacy bit at AP mode, . - * - * 12 24 2010 chinglan.wang - * NULL - * [MT6620][Wi-Fi] Modify the key management in the driver for WPS function. - * - * 12 13 2010 cp.wu - * [WCXRP00000260] [MT6620 Wi-Fi][Driver][Firmware] Create V1.1 branch for both firmware and driver - * create branch for Wi-Fi driver v1.1 - * - * 11 05 2010 wh.su - * [WCXRP00000165] [MT6620 Wi-Fi] [Pre-authentication] Assoc req rsn ie use wrong pmkid value - * fixed the.pmkid value mismatch issue - * - * 11 03 2010 wh.su - * [WCXRP00000124] [MT6620 Wi-Fi] [Driver] Support the dissolve P2P Group - * Refine the HT rate disallow TKIP pairwise cipher . - * - * 10 04 2010 cp.wu - * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only - * remove ENUM_NETWORK_TYPE_T definitions - * - * 09 29 2010 yuche.tsai - * NULL - * Fix compile error, remove unused pointer in rsnGenerateRSNIE(). - * - * 09 28 2010 wh.su - * NULL - * [WCXRP00000069][MT6620 Wi-Fi][Driver] Fix some code for phase 1 P2P Demo. - * - * 09 24 2010 wh.su - * NULL - * [WCXRP00005002][MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning. - * - * 09 06 2010 wh.su - * NULL - * let the p2p can set the privacy bit at beacon and rsn ie at assoc req at key handshake state. - * - * 08 30 2010 wh.su - * NULL - * remove non-used code. - * - * 08 19 2010 wh.su - * NULL - * adding the tx pkt call back handle for countermeasure. - * - * 07 24 2010 wh.su - * - * .support the Wi-Fi RSN - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 21 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * modify some code for concurrent network. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * [WPD00003833][MT6620 and MT5931] Driver migration - * enable RX management frame handling. - * - * 06 19 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * consdier the concurrent network setting. - * - * 06 18 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * [WPD00003840] [MT6620 5931] Security migration - * migration from firmware. - * - * 05 27 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * not indiate pmkid candidate while no new one scaned. - * - * 04 29 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * adjsut the pre-authentication code. - * - * 03 03 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * move the AIS specific variable for security to AIS specific structure. - * - * 03 03 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * Fixed the pre-authentication timer not correctly init issue, and modify the security related callback function prototype. - * - * 01 27 2010 wh.su - * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code - * add and fixed some security function. - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * Dec 8 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * change the name - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * using the Rx0 port to indicate event - * - * Dec 4 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * refine the code for generate the WPA/RSN IE for assoc req - * - * Dec 3 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adjust code for pmkid event - * - * Dec 1 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the code for event (mic error and pmkid indicate) and do some function rename - * - * Nov 23 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding some security function - * - * Nov 19 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding some security feature, including pmkid - * - * Nov 18 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -#if CFG_RSN_MIGRATION - -//extern PHY_ATTRIBUTE_T rPhyAttributes[]; - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to parse RSN IE. -* -* \param[in] prInfoElem Pointer to the RSN IE -* \param[out] prRsnInfo Pointer to the BSSDescription structure to store the -** RSN information from the given RSN IE -* -* \retval TRUE - Succeeded -* \retval FALSE - Failed -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rsnParseRsnIE ( - IN P_ADAPTER_T prAdapter, - IN P_RSN_INFO_ELEM_T prInfoElem, - OUT P_RSN_INFO_T prRsnInfo - ) -{ - UINT_32 i; - INT_32 u4RemainRsnIeLen; - UINT_16 u2Version; - UINT_16 u2Cap = 0; - UINT_32 u4GroupSuite = RSN_CIPHER_SUITE_CCMP; - UINT_16 u2PairSuiteCount = 0; - UINT_16 u2AuthSuiteCount = 0; - PUINT_8 pucPairSuite = NULL; - PUINT_8 pucAuthSuite = NULL; - PUINT_8 cp; - - DEBUGFUNC("rsnParseRsnIE"); - - ASSERT(prInfoElem); - ASSERT(prRsnInfo); - - /* Verify the length of the RSN IE. */ - if (prInfoElem->ucLength < 2) { - DBGLOG(RSN, TRACE, ("RSN IE length too short (length=%d)\n", prInfoElem->ucLength)); - return FALSE; - } - - /* Check RSN version: currently, we only support version 1. */ - WLAN_GET_FIELD_16(&prInfoElem->u2Version, &u2Version); - if (u2Version != 1) { - DBGLOG(RSN, TRACE,("Unsupported RSN IE version: %d\n", u2Version)); - return FALSE; - } - - cp = (PUCHAR) &prInfoElem->u4GroupKeyCipherSuite; - u4RemainRsnIeLen = (INT_32) prInfoElem->ucLength - 2; - - do { - if (u4RemainRsnIeLen == 0) { - break; - } - - /* Parse the Group Key Cipher Suite field. */ - if (u4RemainRsnIeLen < 4) { - DBGLOG(RSN, TRACE, ("Fail to parse RSN IE in group cipher suite (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - WLAN_GET_FIELD_32(cp, &u4GroupSuite); - cp += 4; - u4RemainRsnIeLen -= 4; - - if (u4RemainRsnIeLen == 0) { - break; - } - - /* Parse the Pairwise Key Cipher Suite Count field. */ - if (u4RemainRsnIeLen < 2) { - DBGLOG(RSN, TRACE,("Fail to parse RSN IE in pairwise cipher suite count (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - WLAN_GET_FIELD_16(cp, &u2PairSuiteCount); - cp += 2; - u4RemainRsnIeLen -= 2; - - /* Parse the Pairwise Key Cipher Suite List field. */ - i = (UINT_32) u2PairSuiteCount * 4; - if (u4RemainRsnIeLen < (INT_32) i) { - DBGLOG(RSN, TRACE,("Fail to parse RSN IE in pairwise cipher suite list (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - pucPairSuite = cp; - - cp += i; - u4RemainRsnIeLen -= (INT_32) i; - - if (u4RemainRsnIeLen == 0) { - break; - } - - /* Parse the Authentication and Key Management Cipher Suite Count field. */ - if (u4RemainRsnIeLen < 2) { - DBGLOG(RSN, TRACE,("Fail to parse RSN IE in auth & key mgt suite count (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - WLAN_GET_FIELD_16(cp, &u2AuthSuiteCount); - cp += 2; - u4RemainRsnIeLen -= 2; - - /* Parse the Authentication and Key Management Cipher Suite List - field. */ - i = (UINT_32) u2AuthSuiteCount * 4; - if (u4RemainRsnIeLen < (INT_32) i) { - DBGLOG(RSN, TRACE, ("Fail to parse RSN IE in auth & key mgt suite list (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - pucAuthSuite = cp; - - cp += i; - u4RemainRsnIeLen -= (INT_32) i; - - if (u4RemainRsnIeLen == 0) { - break; - } - - /* Parse the RSN u2Capabilities field. */ - if (u4RemainRsnIeLen < 2) { - DBGLOG(RSN, TRACE, ("Fail to parse RSN IE in RSN capabilities (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - WLAN_GET_FIELD_16(cp, &u2Cap); - } while (FALSE); - - /* Save the RSN information for the BSS. */ - prRsnInfo->ucElemId = ELEM_ID_RSN; - - prRsnInfo->u2Version = u2Version; - - prRsnInfo->u4GroupKeyCipherSuite = u4GroupSuite; - - DBGLOG(RSN, LOUD, ("RSN: version %d, group key cipher suite %02x-%02x-%02x-%02x\n", - u2Version, (UCHAR) (u4GroupSuite & 0x000000FF), - (UCHAR) ((u4GroupSuite >> 8) & 0x000000FF), - (UCHAR) ((u4GroupSuite >> 16) & 0x000000FF), - (UCHAR) ((u4GroupSuite >> 24) & 0x000000FF))); - - if (pucPairSuite) { - /* The information about the pairwise key cipher suites is present. */ - if (u2PairSuiteCount > MAX_NUM_SUPPORTED_CIPHER_SUITES) { - u2PairSuiteCount = MAX_NUM_SUPPORTED_CIPHER_SUITES; - } - - prRsnInfo->u4PairwiseKeyCipherSuiteCount = (UINT_32) u2PairSuiteCount; - - for (i = 0; i < (UINT_32) u2PairSuiteCount; i++) { - WLAN_GET_FIELD_32(pucPairSuite, - &prRsnInfo->au4PairwiseKeyCipherSuite[i]); - pucPairSuite += 4; - - DBGLOG(RSN, LOUD, ("RSN: pairwise key cipher suite [%d]: %02x-%02x-%02x-%02x\n", - (UINT_8)i, (UCHAR) (prRsnInfo->au4PairwiseKeyCipherSuite[i] & 0x000000FF), - (UCHAR) ((prRsnInfo->au4PairwiseKeyCipherSuite[i] >> 8) & 0x000000FF), - (UCHAR) ((prRsnInfo->au4PairwiseKeyCipherSuite[i] >> 16) & 0x000000FF), - (UCHAR) ((prRsnInfo->au4PairwiseKeyCipherSuite[i] >> 24) & 0x000000FF))); - } - } - else { - /* The information about the pairwise key cipher suites is not present. - Use the default chipher suite for RSN: CCMP. */ - prRsnInfo->u4PairwiseKeyCipherSuiteCount = 1; - prRsnInfo->au4PairwiseKeyCipherSuite[0] = RSN_CIPHER_SUITE_CCMP; - - DBGLOG(RSN, LOUD, ("RSN: pairwise key cipher suite: %02x-%02x-%02x-%02x (default)\n", - (UCHAR) (prRsnInfo->au4PairwiseKeyCipherSuite[0] & 0x000000FF), - (UCHAR) ((prRsnInfo->au4PairwiseKeyCipherSuite[0] >> 8) & 0x000000FF), - (UCHAR) ((prRsnInfo->au4PairwiseKeyCipherSuite[0] >> 16) & 0x000000FF), - (UCHAR) ((prRsnInfo->au4PairwiseKeyCipherSuite[0] >> 24) & 0x000000FF))); - } - - if (pucAuthSuite) { - /* The information about the authentication and key management suites - is present. */ - if (u2AuthSuiteCount > MAX_NUM_SUPPORTED_AKM_SUITES) { - u2AuthSuiteCount = MAX_NUM_SUPPORTED_AKM_SUITES; - } - - prRsnInfo->u4AuthKeyMgtSuiteCount = (UINT_32) u2AuthSuiteCount; - - for (i = 0; i < (UINT_32) u2AuthSuiteCount; i++) { - WLAN_GET_FIELD_32(pucAuthSuite, &prRsnInfo->au4AuthKeyMgtSuite[i]); - pucAuthSuite += 4; - - DBGLOG(RSN, LOUD, ("RSN: AKM suite [%d]: %02x-%02x-%02x-%02x\n", - (UINT_8)i, (UCHAR) (prRsnInfo->au4AuthKeyMgtSuite[i] & 0x000000FF), - (UCHAR) ((prRsnInfo->au4AuthKeyMgtSuite[i] >> 8) & 0x000000FF), - (UCHAR) ((prRsnInfo->au4AuthKeyMgtSuite[i] >> 16) & 0x000000FF), - (UCHAR) ((prRsnInfo->au4AuthKeyMgtSuite[i] >> 24) & 0x000000FF))); - } - } - else { - /* The information about the authentication and key management suites - is not present. Use the default AKM suite for RSN. */ - prRsnInfo->u4AuthKeyMgtSuiteCount = 1; - prRsnInfo->au4AuthKeyMgtSuite[0] = RSN_AKM_SUITE_802_1X; - - DBGLOG(RSN, LOUD, ("RSN: AKM suite: %02x-%02x-%02x-%02x (default)\n", - (UCHAR) (prRsnInfo->au4AuthKeyMgtSuite[0] & 0x000000FF), - (UCHAR) ((prRsnInfo->au4AuthKeyMgtSuite[0] >> 8) & 0x000000FF), - (UCHAR) ((prRsnInfo->au4AuthKeyMgtSuite[0] >> 16) & 0x000000FF), - (UCHAR) ((prRsnInfo->au4AuthKeyMgtSuite[0] >> 24) & 0x000000FF))); - } - - prRsnInfo->u2RsnCap = u2Cap; -#if CFG_SUPPORT_802_11W - prRsnInfo->fgRsnCapPresent = TRUE; -#endif - DBGLOG(RSN, LOUD, ("RSN cap: 0x%04x\n", prRsnInfo->u2RsnCap)); - - return TRUE; -} /* rsnParseRsnIE */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to parse WPA IE. -* -* \param[in] prInfoElem Pointer to the WPA IE. -* \param[out] prWpaInfo Pointer to the BSSDescription structure to store the -* WPA information from the given WPA IE. -* -* \retval TRUE Succeeded. -* \retval FALSE Failed. -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rsnParseWpaIE ( - IN P_ADAPTER_T prAdapter, - IN P_WPA_INFO_ELEM_T prInfoElem, - OUT P_RSN_INFO_T prWpaInfo - ) -{ - UINT_32 i; - INT_32 u4RemainWpaIeLen; - UINT_16 u2Version; - UINT_16 u2Cap = 0; - UINT_32 u4GroupSuite = WPA_CIPHER_SUITE_TKIP; - UINT_16 u2PairSuiteCount = 0; - UINT_16 u2AuthSuiteCount = 0; - PUCHAR pucPairSuite = NULL; - PUCHAR pucAuthSuite = NULL; - PUCHAR cp; - BOOLEAN fgCapPresent = FALSE; - - DEBUGFUNC("rsnParseWpaIE"); - - ASSERT(prInfoElem); - ASSERT(prWpaInfo); - - /* Verify the length of the WPA IE. */ - if (prInfoElem->ucLength < 6) { - DBGLOG(RSN, TRACE,("WPA IE length too short (length=%d)\n", prInfoElem->ucLength)); - return FALSE; - } - - /* Check WPA version: currently, we only support version 1. */ - WLAN_GET_FIELD_16(&prInfoElem->u2Version, &u2Version); - if (u2Version != 1) { - DBGLOG(RSN, TRACE, ("Unsupported WPA IE version: %d\n", u2Version)); - return FALSE; - } - - cp = (PUCHAR) &prInfoElem->u4GroupKeyCipherSuite; - u4RemainWpaIeLen = (INT_32) prInfoElem->ucLength - 6; - - do { - if (u4RemainWpaIeLen == 0) { - break; - } - - /* WPA_OUI : 4 - Version : 2 - GroupSuite : 4 - PairwiseCount: 2 - PairwiseSuite: 4 * pairSuiteCount - AuthCount : 2 - AuthSuite : 4 * authSuiteCount - Cap : 2 */ - - /* Parse the Group Key Cipher Suite field. */ - if (u4RemainWpaIeLen < 4) { - DBGLOG(RSN, TRACE,("Fail to parse WPA IE in group cipher suite (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - WLAN_GET_FIELD_32(cp, &u4GroupSuite); - cp += 4; - u4RemainWpaIeLen -= 4; - - if (u4RemainWpaIeLen == 0) { - break; - } - - /* Parse the Pairwise Key Cipher Suite Count field. */ - if (u4RemainWpaIeLen < 2) { - DBGLOG(RSN, TRACE,("Fail to parse WPA IE in pairwise cipher suite count (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - WLAN_GET_FIELD_16(cp, &u2PairSuiteCount); - cp += 2; - u4RemainWpaIeLen -= 2; - - /* Parse the Pairwise Key Cipher Suite List field. */ - i = (UINT_32) u2PairSuiteCount * 4; - if (u4RemainWpaIeLen < (INT_32) i) { - DBGLOG(RSN, TRACE,("Fail to parse WPA IE in pairwise cipher suite list (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - pucPairSuite = cp; - - cp += i; - u4RemainWpaIeLen -= (INT_32) i; - - if (u4RemainWpaIeLen == 0) { - break; - } - - /* Parse the Authentication and Key Management Cipher Suite Count - field. */ - if (u4RemainWpaIeLen < 2) { - DBGLOG(RSN, TRACE,("Fail to parse WPA IE in auth & key mgt suite count (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - WLAN_GET_FIELD_16(cp, &u2AuthSuiteCount); - cp += 2; - u4RemainWpaIeLen -= 2; - - /* Parse the Authentication and Key Management Cipher Suite List - field. */ - i = (UINT_32) u2AuthSuiteCount * 4; - if (u4RemainWpaIeLen < (INT_32) i) { - DBGLOG(RSN, TRACE, ("Fail to parse WPA IE in auth & key mgt suite list (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - pucAuthSuite = cp; - - cp += i; - u4RemainWpaIeLen -= (INT_32) i; - - if (u4RemainWpaIeLen == 0) { - break; - } - - /* Parse the WPA u2Capabilities field. */ - if (u4RemainWpaIeLen < 2) { - DBGLOG(RSN, TRACE, ("Fail to parse WPA IE in WPA capabilities (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - fgCapPresent = TRUE; - WLAN_GET_FIELD_16(cp, &u2Cap); - u4RemainWpaIeLen -= 2; - } while (FALSE); - - /* Save the WPA information for the BSS. */ - - prWpaInfo->ucElemId = ELEM_ID_WPA; - - prWpaInfo->u2Version = u2Version; - - prWpaInfo->u4GroupKeyCipherSuite = u4GroupSuite; - - DBGLOG(RSN, LOUD, ("WPA: version %d, group key cipher suite %02x-%02x-%02x-%02x\n", - u2Version, (UCHAR) (u4GroupSuite & 0x000000FF), - (UCHAR) ((u4GroupSuite >> 8) & 0x000000FF), - (UCHAR) ((u4GroupSuite >> 16) & 0x000000FF), - (UCHAR) ((u4GroupSuite >> 24) & 0x000000FF))); - - if (pucPairSuite) { - /* The information about the pairwise key cipher suites is present. */ - if (u2PairSuiteCount > MAX_NUM_SUPPORTED_CIPHER_SUITES) { - u2PairSuiteCount = MAX_NUM_SUPPORTED_CIPHER_SUITES; - } - - prWpaInfo->u4PairwiseKeyCipherSuiteCount = (UINT_32) u2PairSuiteCount; - - for (i = 0; i < (UINT_32) u2PairSuiteCount; i++) { - WLAN_GET_FIELD_32(pucPairSuite, - &prWpaInfo->au4PairwiseKeyCipherSuite[i]); - pucPairSuite += 4; - - DBGLOG(RSN, LOUD, ("WPA: pairwise key cipher suite [%d]: %02x-%02x-%02x-%02x\n", - (UINT_8)i, (UCHAR) (prWpaInfo->au4PairwiseKeyCipherSuite[i] & 0x000000FF), - (UCHAR) ((prWpaInfo->au4PairwiseKeyCipherSuite[i] >> 8) & 0x000000FF), - (UCHAR) ((prWpaInfo->au4PairwiseKeyCipherSuite[i] >> 16) & 0x000000FF), - (UCHAR) ((prWpaInfo->au4PairwiseKeyCipherSuite[i] >> 24) & 0x000000FF))); - } - } - else { - /* The information about the pairwise key cipher suites is not present. - Use the default chipher suite for WPA: TKIP. */ - prWpaInfo->u4PairwiseKeyCipherSuiteCount = 1; - prWpaInfo->au4PairwiseKeyCipherSuite[0] = WPA_CIPHER_SUITE_TKIP; - - DBGLOG(RSN, LOUD, ("WPA: pairwise key cipher suite: %02x-%02x-%02x-%02x (default)\n", - (UCHAR) (prWpaInfo->au4PairwiseKeyCipherSuite[0] & 0x000000FF), - (UCHAR) ((prWpaInfo->au4PairwiseKeyCipherSuite[0] >> 8) & 0x000000FF), - (UCHAR) ((prWpaInfo->au4PairwiseKeyCipherSuite[0] >> 16) & 0x000000FF), - (UCHAR) ((prWpaInfo->au4PairwiseKeyCipherSuite[0] >> 24) & 0x000000FF))); - } - - if (pucAuthSuite) { - /* The information about the authentication and key management suites - is present. */ - if (u2AuthSuiteCount > MAX_NUM_SUPPORTED_AKM_SUITES) { - u2AuthSuiteCount = MAX_NUM_SUPPORTED_AKM_SUITES; - } - - prWpaInfo->u4AuthKeyMgtSuiteCount = (UINT_32) u2AuthSuiteCount; - - for (i = 0; i < (UINT_32) u2AuthSuiteCount; i++) { - WLAN_GET_FIELD_32(pucAuthSuite, &prWpaInfo->au4AuthKeyMgtSuite[i]); - pucAuthSuite += 4; - - DBGLOG(RSN, LOUD, ("WPA: AKM suite [%d]: %02x-%02x-%02x-%02x\n", - (UINT_8)i, (UCHAR) (prWpaInfo->au4AuthKeyMgtSuite[i] & 0x000000FF), - (UCHAR) ((prWpaInfo->au4AuthKeyMgtSuite[i] >> 8) & 0x000000FF), - (UCHAR) ((prWpaInfo->au4AuthKeyMgtSuite[i] >> 16) & 0x000000FF), - (UCHAR) ((prWpaInfo->au4AuthKeyMgtSuite[i] >> 24) & 0x000000FF))); - } - } - else { - /* The information about the authentication and key management suites - is not present. Use the default AKM suite for WPA. */ - prWpaInfo->u4AuthKeyMgtSuiteCount = 1; - prWpaInfo->au4AuthKeyMgtSuite[0] = WPA_AKM_SUITE_802_1X; - - DBGLOG(RSN, LOUD, ("WPA: AKM suite: %02x-%02x-%02x-%02x (default)\n", - (UCHAR) (prWpaInfo->au4AuthKeyMgtSuite[0] & 0x000000FF), - (UCHAR) ((prWpaInfo->au4AuthKeyMgtSuite[0] >> 8) & 0x000000FF), - (UCHAR) ((prWpaInfo->au4AuthKeyMgtSuite[0] >> 16) & 0x000000FF), - (UCHAR) ((prWpaInfo->au4AuthKeyMgtSuite[0] >> 24) & 0x000000FF))); - } - - if (fgCapPresent) { - prWpaInfo->fgRsnCapPresent = TRUE; - prWpaInfo->u2RsnCap = u2Cap; - DBGLOG(RSN, LOUD, ("WPA: RSN cap: 0x%04x\n", prWpaInfo->u2RsnCap)); - } - else { - prWpaInfo->fgRsnCapPresent = FALSE; - prWpaInfo->u2RsnCap = 0; - } - - return TRUE; -} /* rsnParseWpaIE */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to search the desired pairwise -* cipher suite from the MIB Pairwise Cipher Suite -* configuration table. -* -* \param[in] u4Cipher The desired pairwise cipher suite to be searched -* \param[out] pu4Index Pointer to the index of the desired pairwise cipher in -* the table -* -* \retval TRUE - The desired pairwise cipher suite is found in the table. -* \retval FALSE - The desired pairwise cipher suite is not found in the -* table. -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rsnSearchSupportedCipher ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Cipher, - OUT PUINT_32 pu4Index - ) -{ - UINT_8 i; - P_DOT11_RSNA_CONFIG_PAIRWISE_CIPHERS_ENTRY prEntry; - - DEBUGFUNC("rsnSearchSupportedCipher"); - - ASSERT(pu4Index); - - for (i = 0; i < MAX_NUM_SUPPORTED_CIPHER_SUITES; i++) { - prEntry = &prAdapter->rMib.dot11RSNAConfigPairwiseCiphersTable[i]; - if (prEntry->dot11RSNAConfigPairwiseCipher == u4Cipher && - prEntry->dot11RSNAConfigPairwiseCipherEnabled) { - *pu4Index = i; - return TRUE; - } - } - return FALSE; -} /* rsnSearchSupportedCipher */ - - -/*----------------------------------------------------------------------------*/ -/*! -* -* \brief This routine is called to search the desired -* authentication and key management (AKM) suite from the -* MIB Authentication and Key Management Suites table. -* -* \param[in] u4AkmSuite The desired AKM suite to be searched -* \param[out] pu4Index Pointer to the index of the desired AKM suite in the -* table -* -* \retval TRUE The desired AKM suite is found in the table. -* \retval FALSE The desired AKM suite is not found in the table. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rsnSearchAKMSuite ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4AkmSuite, - OUT PUINT_32 pu4Index - ) -{ - UINT_8 i; - P_DOT11_RSNA_CONFIG_AUTHENTICATION_SUITES_ENTRY prEntry; - - DEBUGFUNC("rsnSearchAKMSuite"); - - ASSERT(pu4Index); - - for (i = 0; i < MAX_NUM_SUPPORTED_AKM_SUITES; i++) { - prEntry = &prAdapter->rMib.dot11RSNAConfigAuthenticationSuitesTable[i]; - if (prEntry->dot11RSNAConfigAuthenticationSuite == u4AkmSuite && - prEntry->dot11RSNAConfigAuthenticationSuiteEnabled) { - *pu4Index = i; - return TRUE; - } - } - return FALSE; -} /* rsnSearchAKMSuite */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to perform RSNA or TSN policy -* selection for a given BSS. -* -* \param[in] prBss Pointer to the BSS description -* -* \retval TRUE - The RSNA/TSN policy selection for the given BSS is -* successful. The selected pairwise and group cipher suites -* are returned in the BSS description. -* \retval FALSE - The RSNA/TSN policy selection for the given BSS is failed. -* The driver shall not attempt to join the given BSS. -* -* \note The Encrypt status matched score will save to bss for final ap select. -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rsnPerformPolicySelection ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBss - ) -{ -#if CFG_SUPPORT_802_11W - INT_32 i; - UINT_32 j; -#else - UINT_32 i, j; -#endif - BOOLEAN fgSuiteSupported; - UINT_32 u4PairwiseCipher = 0; - UINT_32 u4GroupCipher = 0; - UINT_32 u4AkmSuite = 0; - P_RSN_INFO_T prBssRsnInfo; - ENUM_NETWORK_TYPE_INDEX_T eNetwotkType; - BOOLEAN fgIsWpsActive = (BOOLEAN)FALSE; - - DEBUGFUNC("rsnPerformPolicySelection"); - - ASSERT(prBss); - - DBGLOG(RSN, TRACE, ("rsnPerformPolicySelection\n")); - //Todo:: - eNetwotkType = NETWORK_TYPE_AIS_INDEX; - - prBss->u4RsnSelectedPairwiseCipher = 0; - prBss->u4RsnSelectedGroupCipher = 0; - prBss->u4RsnSelectedAKMSuite = 0; - prBss->ucEncLevel = 0; - -#if CFG_SUPPORT_WPS - fgIsWpsActive = kalWSCGetActiveState(prAdapter->prGlueInfo); - - /* CR1640, disable the AP select privacy check */ - if ( fgIsWpsActive && - (prAdapter->rWifiVar.rConnSettings.eAuthMode < AUTH_MODE_WPA) && - (prAdapter->rWifiVar.rConnSettings.eOPMode == NET_TYPE_INFRA)) { - DBGLOG(RSN, TRACE,("-- Skip the Protected BSS check\n")); - return TRUE; - } -#endif - - /* Protection is not required in this BSS. */ - if ((prBss->u2CapInfo & CAP_INFO_PRIVACY) == 0 ) { - - if (secEnabledInAis(prAdapter) == FALSE) { - DBGLOG(RSN, TRACE,("-- No Protected BSS\n")); - return TRUE; - } - else { - DBGLOG(RSN, TRACE,("-- Protected BSS\n")); - return FALSE; - } - } - - /* Protection is required in this BSS. */ - if ((prBss->u2CapInfo & CAP_INFO_PRIVACY) != 0) { - if (secEnabledInAis(prAdapter) == FALSE) { - DBGLOG(RSN, TRACE,("-- Protected BSS\n")); - return FALSE; - } - } - - if (prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA || - prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA_PSK || - prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA_NONE) { - - if (prBss->fgIEWPA) { - prBssRsnInfo = &prBss->rWPAInfo; - } - else { - DBGLOG(RSN, TRACE, ("WPA Information Element does not exist.\n")); - return FALSE; - } - } - else if (prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA2 || - prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA2_PSK) { - - if (prBss->fgIERSN) { - prBssRsnInfo = &prBss->rRSNInfo; - } - else { - DBGLOG(RSN, TRACE, ("RSN Information Element does not exist.\n")); - return FALSE; - } - } - else if (prAdapter->rWifiVar.rConnSettings.eEncStatus != ENUM_ENCRYPTION1_ENABLED) { - /* If the driver is configured to use WEP only, ignore this BSS. */ - DBGLOG(RSN, TRACE, ("-- Not WEP-only legacy BSS\n")); - return FALSE; - } - else if (prAdapter->rWifiVar.rConnSettings.eEncStatus == ENUM_ENCRYPTION1_ENABLED) { - /* If the driver is configured to use WEP only, use this BSS. */ - DBGLOG(RSN, TRACE, ("-- WEP-only legacy BSS\n")); - return TRUE; - } - - if (prBssRsnInfo->u4PairwiseKeyCipherSuiteCount == 1 && - GET_SELECTOR_TYPE(prBssRsnInfo->au4PairwiseKeyCipherSuite[0]) == - CIPHER_SUITE_NONE) { - /* Since the pairwise cipher use the same cipher suite as the group - cipher in the BSS, we check the group cipher suite against the - current encryption status. */ - fgSuiteSupported = FALSE; - - switch (prBssRsnInfo->u4GroupKeyCipherSuite) { - case WPA_CIPHER_SUITE_CCMP: - case RSN_CIPHER_SUITE_CCMP: - if (prAdapter->rWifiVar.rConnSettings.eEncStatus == - ENUM_ENCRYPTION3_ENABLED) { - fgSuiteSupported = TRUE; - } - break; - - case WPA_CIPHER_SUITE_TKIP: - case RSN_CIPHER_SUITE_TKIP: - if (prAdapter->rWifiVar.rConnSettings.eEncStatus == - ENUM_ENCRYPTION2_ENABLED) { - fgSuiteSupported = TRUE; - } - break; - - case WPA_CIPHER_SUITE_WEP40: - case WPA_CIPHER_SUITE_WEP104: - if (prAdapter->rWifiVar.rConnSettings.eEncStatus == - ENUM_ENCRYPTION1_ENABLED) { - fgSuiteSupported = TRUE; - } - break; - } - - if (fgSuiteSupported) { - u4PairwiseCipher = WPA_CIPHER_SUITE_NONE; - u4GroupCipher = prBssRsnInfo->u4GroupKeyCipherSuite; - } -#if DBG - else { - DBGLOG(RSN, TRACE, ("Inproper encryption status %d for group-key-only BSS\n", - prAdapter->rWifiVar.rConnSettings.eEncStatus)); - } -#endif - } - else { - fgSuiteSupported = FALSE; - - DBGLOG(RSN, TRACE, ("eEncStatus %d %d 0x%x\n", prAdapter->rWifiVar.rConnSettings.eEncStatus, - prBssRsnInfo->u4PairwiseKeyCipherSuiteCount, - prBssRsnInfo->au4PairwiseKeyCipherSuite[0])); - /* Select pairwise/group ciphers */ - switch (prAdapter->rWifiVar.rConnSettings.eEncStatus) - { - case ENUM_ENCRYPTION3_ENABLED: - for (i = 0; i < prBssRsnInfo->u4PairwiseKeyCipherSuiteCount; i++) { - if (GET_SELECTOR_TYPE(prBssRsnInfo->au4PairwiseKeyCipherSuite[i]) - == CIPHER_SUITE_CCMP) { - u4PairwiseCipher = prBssRsnInfo->au4PairwiseKeyCipherSuite[i]; - } - } - u4GroupCipher = prBssRsnInfo->u4GroupKeyCipherSuite; - break; - - case ENUM_ENCRYPTION2_ENABLED: - for (i = 0; i < prBssRsnInfo->u4PairwiseKeyCipherSuiteCount; i++) { - if (GET_SELECTOR_TYPE(prBssRsnInfo->au4PairwiseKeyCipherSuite[i]) - == CIPHER_SUITE_TKIP) { - u4PairwiseCipher = prBssRsnInfo->au4PairwiseKeyCipherSuite[i]; - } - } - if (GET_SELECTOR_TYPE(prBssRsnInfo->u4GroupKeyCipherSuite) == - CIPHER_SUITE_CCMP) { - DBGLOG(RSN, TRACE, ("Cannot join CCMP BSS\n")); - } - else { - u4GroupCipher = prBssRsnInfo->u4GroupKeyCipherSuite; - } - break; - - case ENUM_ENCRYPTION1_ENABLED: - for (i = 0; i < prBssRsnInfo->u4PairwiseKeyCipherSuiteCount; i++) { - if (GET_SELECTOR_TYPE(prBssRsnInfo->au4PairwiseKeyCipherSuite[i]) - == CIPHER_SUITE_WEP40 || - GET_SELECTOR_TYPE(prBssRsnInfo->au4PairwiseKeyCipherSuite[i]) - == CIPHER_SUITE_WEP104) { - u4PairwiseCipher = prBssRsnInfo->au4PairwiseKeyCipherSuite[i]; - } - } - if (GET_SELECTOR_TYPE(prBssRsnInfo->u4GroupKeyCipherSuite) == - CIPHER_SUITE_CCMP || - GET_SELECTOR_TYPE(prBssRsnInfo->u4GroupKeyCipherSuite) == - CIPHER_SUITE_TKIP) { - DBGLOG(RSN, TRACE, ("Cannot join CCMP/TKIP BSS\n")); - } - else { - u4GroupCipher = prBssRsnInfo->u4GroupKeyCipherSuite; - } - break; - - default: - break; - } - } - - /* Exception handler */ - /* If we cannot find proper pairwise and group cipher suites to join the - BSS, do not check the supported AKM suites. */ - if (u4PairwiseCipher == 0 || u4GroupCipher == 0) { - DBGLOG(RSN, TRACE, ("Failed to select pairwise/group cipher (0x%08lx/0x%08lx)\n", - u4PairwiseCipher, u4GroupCipher)); - return FALSE; - } - -#if CFG_ENABLE_WIFI_DIRECT - if ((prAdapter->fgIsP2PRegistered) && - (eNetwotkType == NETWORK_TYPE_P2P_INDEX)) { - if (u4PairwiseCipher != RSN_CIPHER_SUITE_CCMP || - u4GroupCipher != RSN_CIPHER_SUITE_CCMP || - u4AkmSuite != RSN_AKM_SUITE_PSK) { - DBGLOG(RSN, TRACE, ("Failed to select pairwise/group cipher for P2P network (0x%08lx/0x%08lx)\n", - u4PairwiseCipher, u4GroupCipher)); - return FALSE; - } - } -#endif - -#if CFG_ENABLE_BT_OVER_WIFI - if (eNetwotkType == NETWORK_TYPE_BOW_INDEX) { - if (u4PairwiseCipher != RSN_CIPHER_SUITE_CCMP || - u4GroupCipher != RSN_CIPHER_SUITE_CCMP || - u4AkmSuite != RSN_AKM_SUITE_PSK) { - } - DBGLOG(RSN, TRACE, ("Failed to select pairwise/group cipher for BT over Wi-Fi network (0x%08lx/0x%08lx)\n", - u4PairwiseCipher, u4GroupCipher)); - return FALSE; - } -#endif - - - /* Verify if selected pairwisse cipher is supported */ - fgSuiteSupported = rsnSearchSupportedCipher(prAdapter, u4PairwiseCipher, &i); - - /* Verify if selected group cipher is supported */ - if (fgSuiteSupported) { - fgSuiteSupported = rsnSearchSupportedCipher(prAdapter, u4GroupCipher, &i); - } - - if (!fgSuiteSupported) { - DBGLOG(RSN, TRACE, ("Failed to support selected pairwise/group cipher (0x%08lx/0x%08lx)\n", - u4PairwiseCipher, u4GroupCipher)); - return FALSE; - } - - /* Select AKM */ - /* If the driver cannot support any authentication suites advertised in - the given BSS, we fail to perform RSNA policy selection. */ - /* Attempt to find any overlapping supported AKM suite. */ -#if CFG_SUPPORT_802_11W - if (i != 0) - for (i = (prBssRsnInfo->u4AuthKeyMgtSuiteCount - 1); i >= 0; i--) -#else - for (i = 0; i < prBssRsnInfo->u4AuthKeyMgtSuiteCount; i++) -#endif - { - if (rsnSearchAKMSuite(prAdapter, - prBssRsnInfo->au4AuthKeyMgtSuite[i], - &j)) { - u4AkmSuite = prBssRsnInfo->au4AuthKeyMgtSuite[i]; - break; - } - } - - if (u4AkmSuite == 0) { - DBGLOG(RSN, TRACE, ("Cannot support any AKM suites\n")); - return FALSE; - } - - DBGLOG(RSN, TRACE, ("Selected pairwise/group cipher: %02x-%02x-%02x-%02x/%02x-%02x-%02x-%02x\n", - (UINT_8) (u4PairwiseCipher & 0x000000FF), - (UINT_8) ((u4PairwiseCipher >> 8) & 0x000000FF), - (UINT_8) ((u4PairwiseCipher >> 16) & 0x000000FF), - (UINT_8) ((u4PairwiseCipher >> 24) & 0x000000FF), - (UINT_8) (u4GroupCipher & 0x000000FF), - (UINT_8) ((u4GroupCipher >> 8) & 0x000000FF), - (UINT_8) ((u4GroupCipher >> 16) & 0x000000FF), - (UINT_8) ((u4GroupCipher >> 24) & 0x000000FF))); - - DBGLOG(RSN, TRACE, ("Selected AKM suite: %02x-%02x-%02x-%02x\n", - (UINT_8) (u4AkmSuite & 0x000000FF), - (UINT_8) ((u4AkmSuite >> 8) & 0x000000FF), - (UINT_8) ((u4AkmSuite >> 16) & 0x000000FF), - (UINT_8) ((u4AkmSuite >> 24) & 0x000000FF))); - -#if CFG_SUPPORT_802_11W - DBGLOG(RSN, TRACE, ("MFP setting = %d\n ", kalGetMfpSetting(prAdapter->prGlueInfo))); - - if (kalGetMfpSetting(prAdapter->prGlueInfo) == RSN_AUTH_MFP_REQUIRED) { - if (!prBssRsnInfo->fgRsnCapPresent) { - DBGLOG(RSN, TRACE, ("Skip RSN IE, No MFP Required Capability.\n")); - return FALSE; - } - else if (!(prBssRsnInfo->u2RsnCap & ELEM_WPA_CAP_MFPC)) { - DBGLOG(RSN, TRACE, ("Skip RSN IE, No MFP Required\n")); - return FALSE; - } - prAdapter->rWifiVar.rAisSpecificBssInfo.fgMgmtProtection = TRUE; - } - else if (kalGetMfpSetting(prAdapter->prGlueInfo) == RSN_AUTH_MFP_OPTIONAL) { - if (prBssRsnInfo->u2RsnCap && ((prBssRsnInfo->u2RsnCap & ELEM_WPA_CAP_MFPR) || - (prBssRsnInfo->u2RsnCap & ELEM_WPA_CAP_MFPC))) { - prAdapter->rWifiVar.rAisSpecificBssInfo.fgMgmtProtection = TRUE; - } - else { - prAdapter->rWifiVar.rAisSpecificBssInfo.fgMgmtProtection = FALSE; - } - } - else { - if (prBssRsnInfo->fgRsnCapPresent && (prBssRsnInfo->u2RsnCap & ELEM_WPA_CAP_MFPR)) { - DBGLOG(RSN, TRACE, ("Skip RSN IE, No MFP Required Capability\n")); - return FALSE; - } - prAdapter->rWifiVar.rAisSpecificBssInfo.fgMgmtProtection = FALSE; - } - DBGLOG(RSN, TRACE, ("fgMgmtProtection = %d\n ", prAdapter->rWifiVar.rAisSpecificBssInfo.fgMgmtProtection)); -#endif - - if (GET_SELECTOR_TYPE(u4GroupCipher) == CIPHER_SUITE_CCMP){ - prBss->ucEncLevel = 3; - } - else if (GET_SELECTOR_TYPE(u4GroupCipher) == CIPHER_SUITE_TKIP){ - prBss->ucEncLevel = 2; - } - else if (GET_SELECTOR_TYPE(u4GroupCipher) == CIPHER_SUITE_WEP40 || - GET_SELECTOR_TYPE(u4GroupCipher) == CIPHER_SUITE_WEP104) { - prBss->ucEncLevel = 1; - } - else { - ASSERT(FALSE); - } - prBss->u4RsnSelectedPairwiseCipher = u4PairwiseCipher; - prBss->u4RsnSelectedGroupCipher = u4GroupCipher; - prBss->u4RsnSelectedAKMSuite = u4AkmSuite; - - return TRUE; - -} /* rsnPerformPolicySelection */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to generate WPA IE for beacon frame. -* -* \param[in] pucIeStartAddr Pointer to put the generated WPA IE. -* -* \return The append WPA-None IE length -* \note -* Called by: JOIN module, compose beacon IE -*/ -/*----------------------------------------------------------------------------*/ -VOID -rsnGenerateWpaNoneIE ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - UINT_32 i; - P_WPA_INFO_ELEM_T prWpaIE; - UINT_32 u4Suite; - UINT_16 u2SuiteCount; - PUINT_8 cp, cp2; - UINT_8 ucExpendedLen = 0; - PUINT_8 pucBuffer; - ENUM_NETWORK_TYPE_INDEX_T eNetworkId; - - DEBUGFUNC("rsnGenerateWpaNoneIE"); - - ASSERT(prMsduInfo); - - if (prAdapter->rWifiVar.rConnSettings.eAuthMode != AUTH_MODE_WPA_NONE) { - return; - } - - eNetworkId = (ENUM_NETWORK_TYPE_INDEX_T)prMsduInfo->ucNetworkType; - - if (eNetworkId != NETWORK_TYPE_AIS_INDEX) - return; - - pucBuffer = (PUINT_8)((UINT_32)prMsduInfo->prPacket + - (UINT_32)prMsduInfo->u2FrameLength); - - ASSERT(pucBuffer); - - prWpaIE = (P_WPA_INFO_ELEM_T)(pucBuffer); - - /* Start to construct a WPA IE. */ - /* Fill the Element ID field. */ - prWpaIE->ucElemId = ELEM_ID_WPA; - - /* Fill the OUI and OUI Type fields. */ - prWpaIE->aucOui[0] = 0x00; - prWpaIE->aucOui[1] = 0x50; - prWpaIE->aucOui[2] = 0xF2; - prWpaIE->ucOuiType = VENDOR_OUI_TYPE_WPA; - - /* Fill the Version field. */ - WLAN_SET_FIELD_16(&prWpaIE->u2Version, 1); /* version 1 */ - ucExpendedLen = 6; - - /* Fill the Pairwise Key Cipher Suite List field. */ - u2SuiteCount = 0; - cp = (PUINT_8)&prWpaIE->aucPairwiseKeyCipherSuite1[0]; - - if (rsnSearchSupportedCipher(prAdapter, WPA_CIPHER_SUITE_CCMP, &i)) { - u4Suite = WPA_CIPHER_SUITE_CCMP; - } - else if (rsnSearchSupportedCipher(prAdapter, WPA_CIPHER_SUITE_TKIP, &i)) { - u4Suite = WPA_CIPHER_SUITE_TKIP; - } - else if (rsnSearchSupportedCipher(prAdapter, WPA_CIPHER_SUITE_WEP104, &i)) { - u4Suite = WPA_CIPHER_SUITE_WEP104; - } - else if (rsnSearchSupportedCipher(prAdapter, WPA_CIPHER_SUITE_WEP40, &i)) { - u4Suite = WPA_CIPHER_SUITE_WEP40; - } - else { - u4Suite = WPA_CIPHER_SUITE_TKIP; - } - - WLAN_SET_FIELD_32(cp, u4Suite); - u2SuiteCount++; - ucExpendedLen += 4; - cp += 4; - - /* Fill the Group Key Cipher Suite field as the same in pair-wise key. */ - WLAN_SET_FIELD_32(&prWpaIE->u4GroupKeyCipherSuite, u4Suite); - ucExpendedLen += 4; - - /* Fill the Pairwise Key Cipher Suite Count field. */ - WLAN_SET_FIELD_16(&prWpaIE->u2PairwiseKeyCipherSuiteCount, u2SuiteCount); - ucExpendedLen += 2; - - cp2 = cp; - - /* Fill the Authentication and Key Management Suite List field. */ - u2SuiteCount = 0; - cp += 2; - - if (rsnSearchAKMSuite(prAdapter, WPA_AKM_SUITE_802_1X, &i)) { - u4Suite = WPA_AKM_SUITE_802_1X; - } - else if (rsnSearchAKMSuite(prAdapter, WPA_AKM_SUITE_PSK, &i)) { - u4Suite = WPA_AKM_SUITE_PSK; - } - else { - u4Suite = WPA_AKM_SUITE_NONE; - } - - /* This shall be the only avaiable value for current implementation */ - ASSERT(u4Suite == WPA_AKM_SUITE_NONE); - - WLAN_SET_FIELD_32(cp, u4Suite); - u2SuiteCount++; - ucExpendedLen += 4; - cp += 4; - - /* Fill the Authentication and Key Management Suite Count field. */ - WLAN_SET_FIELD_16(cp2, u2SuiteCount); - ucExpendedLen += 2; - - /* Fill the Length field. */ - prWpaIE->ucLength = (UINT_8)ucExpendedLen; - - /* Increment the total IE length for the Element ID and Length fields. */ - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - -} /* rsnGenerateWpaNoneIE */ - - -/*----------------------------------------------------------------------------*/ -/*! -* -* \brief This routine is called to generate WPA IE for -* associate request frame. -* -* \param[in] prCurrentBss The Selected BSS description -* -* \retval The append WPA IE length -* -* \note -* Called by: AIS module, Associate request -*/ -/*----------------------------------------------------------------------------*/ -VOID -rsnGenerateWPAIE ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - PUCHAR cp; - PUINT_8 pucBuffer; - ENUM_NETWORK_TYPE_INDEX_T eNetworkId; - - DEBUGFUNC("rsnGenerateWPAIE"); - - ASSERT(prMsduInfo); - - pucBuffer = (PUINT_8)((UINT_32)prMsduInfo->prPacket + - (UINT_32)prMsduInfo->u2FrameLength); - - ASSERT(pucBuffer); - - eNetworkId = (ENUM_NETWORK_TYPE_INDEX_T)prMsduInfo->ucNetworkType; - - //if (eNetworkId != NETWORK_TYPE_AIS_INDEX) - // return; - -#if CFG_ENABLE_WIFI_DIRECT - if ((1 /* prCurrentBss->fgIEWPA */ && - ((prAdapter->fgIsP2PRegistered) && - (eNetworkId == NETWORK_TYPE_P2P_INDEX) && - (kalP2PGetTkipCipher(prAdapter->prGlueInfo)))) || - ((prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA) || - (prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA_PSK))) -#else - if ((1 /* prCurrentBss->fgIEWPA */ && - ((prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA) || - (prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA_PSK)))) -#endif - { - /* Construct a WPA IE for association request frame. */ - WPA_IE(pucBuffer)->ucElemId = ELEM_ID_WPA; - WPA_IE(pucBuffer)->ucLength = ELEM_ID_WPA_LEN_FIXED; - WPA_IE(pucBuffer)->aucOui[0] = 0x00; - WPA_IE(pucBuffer)->aucOui[1] = 0x50; - WPA_IE(pucBuffer)->aucOui[2] = 0xF2; - WPA_IE(pucBuffer)->ucOuiType = VENDOR_OUI_TYPE_WPA; - WLAN_SET_FIELD_16(&WPA_IE(pucBuffer)->u2Version, 1); - -#if CFG_ENABLE_WIFI_DIRECT - if (prAdapter->fgIsP2PRegistered && eNetworkId == NETWORK_TYPE_P2P_INDEX) - { - WLAN_SET_FIELD_32(&WPA_IE(pucBuffer)->u4GroupKeyCipherSuite, WPA_CIPHER_SUITE_TKIP); - } - else -#endif - WLAN_SET_FIELD_32(&WPA_IE(pucBuffer)->u4GroupKeyCipherSuite, - prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX].u4RsnSelectedGroupCipher); - - cp = (PUCHAR) &WPA_IE(pucBuffer)->aucPairwiseKeyCipherSuite1[0]; - - WLAN_SET_FIELD_16(&WPA_IE(pucBuffer)->u2PairwiseKeyCipherSuiteCount, 1); -#if CFG_ENABLE_WIFI_DIRECT - if (prAdapter->fgIsP2PRegistered && eNetworkId == NETWORK_TYPE_P2P_INDEX) - { - WLAN_SET_FIELD_32(cp, WPA_CIPHER_SUITE_TKIP); - } - else -#endif - WLAN_SET_FIELD_32(cp, prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX].u4RsnSelectedPairwiseCipher); - cp += 4; - - WLAN_SET_FIELD_16(cp, 1); - cp += 2; -#if CFG_ENABLE_WIFI_DIRECT - if (prAdapter->fgIsP2PRegistered && eNetworkId == NETWORK_TYPE_P2P_INDEX) - { - WLAN_SET_FIELD_32(cp, WPA_AKM_SUITE_PSK); - } - else -#endif - WLAN_SET_FIELD_32(cp, prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX].u4RsnSelectedAKMSuite); - cp += 4; - - WPA_IE(pucBuffer)->ucLength = ELEM_ID_WPA_LEN_FIXED; - - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - } - -} /* rsnGenerateWPAIE */ - - -/*----------------------------------------------------------------------------*/ -/*! -* -* \brief This routine is called to generate RSN IE for -* associate request frame. -* -* \param[in] prMsduInfo The Selected BSS description -* -* \retval The append RSN IE length -* -* \note -* Called by: AIS module, P2P module, BOW module Associate request -*/ -/*----------------------------------------------------------------------------*/ -VOID -rsnGenerateRSNIE ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - UINT_32 u4Entry; - PUCHAR cp; - //UINT_8 ucExpendedLen = 0; - PUINT_8 pucBuffer; - ENUM_NETWORK_TYPE_INDEX_T eNetworkId; - P_STA_RECORD_T prStaRec; - - DEBUGFUNC("rsnGenerateRSNIE"); - - ASSERT(prMsduInfo); - - pucBuffer = (PUINT_8)((UINT_32)prMsduInfo->prPacket + - (UINT_32)prMsduInfo->u2FrameLength); - - ASSERT(pucBuffer); - - /* Todo:: network id */ - eNetworkId = (ENUM_NETWORK_TYPE_INDEX_T)prMsduInfo->ucNetworkType; - - if ( -#if CFG_ENABLE_WIFI_DIRECT - ((prAdapter->fgIsP2PRegistered) && - (eNetworkId == NETWORK_TYPE_P2P_INDEX) && - (kalP2PGetCcmpCipher(prAdapter->prGlueInfo))) || -#endif -#if CFG_ENABLE_BT_OVER_WIFI - (eNetworkId == NETWORK_TYPE_BOW_INDEX) || -#endif - (eNetworkId == NETWORK_TYPE_AIS_INDEX /* prCurrentBss->fgIERSN */ && - ((prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA2) || - (prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA2_PSK)))) - { - /* Construct a RSN IE for association request frame. */ - RSN_IE(pucBuffer)->ucElemId = ELEM_ID_RSN; - RSN_IE(pucBuffer)->ucLength = ELEM_ID_RSN_LEN_FIXED; - WLAN_SET_FIELD_16(&RSN_IE(pucBuffer)->u2Version, 1); // Version - WLAN_SET_FIELD_32(&RSN_IE(pucBuffer)->u4GroupKeyCipherSuite, - prAdapter->rWifiVar.arBssInfo[eNetworkId].u4RsnSelectedGroupCipher); // Group key suite - cp = (PUCHAR) &RSN_IE(pucBuffer)->aucPairwiseKeyCipherSuite1[0]; - WLAN_SET_FIELD_16(&RSN_IE(pucBuffer)->u2PairwiseKeyCipherSuiteCount, 1); - WLAN_SET_FIELD_32(cp, prAdapter->rWifiVar.arBssInfo[eNetworkId].u4RsnSelectedPairwiseCipher); - cp += 4; - WLAN_SET_FIELD_16(cp, 1); // AKM suite count - cp += 2; - WLAN_SET_FIELD_32(cp, prAdapter->rWifiVar.arBssInfo[eNetworkId].u4RsnSelectedAKMSuite); // AKM suite - cp += 4; - WLAN_SET_FIELD_16(cp, prAdapter->rWifiVar.arBssInfo[eNetworkId].u2RsnSelectedCapInfo); // Capabilities -#if CFG_SUPPORT_802_11W - if (eNetworkId == NETWORK_TYPE_AIS_INDEX && prAdapter->rWifiVar.rAisSpecificBssInfo.fgMgmtProtection) { - if (kalGetMfpSetting(prAdapter->prGlueInfo) == RSN_AUTH_MFP_REQUIRED) { - WLAN_SET_FIELD_16(cp, ELEM_WPA_CAP_MFPC | ELEM_WPA_CAP_MFPR); // Capabilities - } - else if (kalGetMfpSetting(prAdapter->prGlueInfo) == RSN_AUTH_MFP_OPTIONAL) { - WLAN_SET_FIELD_16(cp, ELEM_WPA_CAP_MFPC); // Capabilities - } - } -#endif - cp += 2; - - if (eNetworkId == NETWORK_TYPE_AIS_INDEX) - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - if (eNetworkId == NETWORK_TYPE_AIS_INDEX && - rsnSearchPmkidEntry(prAdapter, prStaRec->aucMacAddr, &u4Entry)) { - //DBGLOG(RSN, TRACE, ("Add Pmk at assoc req\n")); - //DBGLOG(RSN, TRACE, ("addr " MACSTR" PMKID "MACSTR"\n", - // MAC2STR(prAdapter->rWifiVar.rAisSpecificBssInfo.arPmkidCache[u4Entry].rBssidInfo.arBSSID), MAC2STR(prAdapter->rWifiVar.rAisSpecificBssInfo.arPmkidCache[u4Entry].rBssidInfo.arPMKID))); - if (prAdapter->rWifiVar.rAisSpecificBssInfo.arPmkidCache[u4Entry].fgPmkidExist) { - RSN_IE(pucBuffer)->ucLength = 38; - WLAN_SET_FIELD_16(cp, 1); // PMKID count - cp += 2; - DBGLOG(RSN, TRACE, ("BSSID "MACSTR" ind=%d\n", MAC2STR(prStaRec->aucMacAddr), u4Entry)); - DBGLOG(RSN, TRACE, ("use PMKID "MACSTR"\n", MAC2STR(prAdapter->rWifiVar.rAisSpecificBssInfo.arPmkidCache[u4Entry].rBssidInfo.arPMKID))); - kalMemCopy(cp, (PVOID)prAdapter->rWifiVar.rAisSpecificBssInfo.arPmkidCache[u4Entry].rBssidInfo.arPMKID, - sizeof(PARAM_PMKID_VALUE)); - //ucExpendedLen = 40; - } - else { - WLAN_SET_FIELD_16(cp, 0); // PMKID count - //ucExpendedLen = ELEM_ID_RSN_LEN_FIXED + 2; -#if CFG_SUPPORT_802_11W - cp += 2; - RSN_IE(pucBuffer)->ucLength += 2; -#endif - } - } - else { - WLAN_SET_FIELD_16(cp, 0); // PMKID count - //ucExpendedLen = ELEM_ID_RSN_LEN_FIXED + 2; -#if CFG_SUPPORT_802_11W - cp += 2; - RSN_IE(pucBuffer)->ucLength += 2; -#endif - } - -#if CFG_SUPPORT_802_11W - if ((eNetworkId == NETWORK_TYPE_AIS_INDEX) && (kalGetMfpSetting(prAdapter->prGlueInfo) != RSN_AUTH_MFP_DISABLED) /* (mgmt_group_cipher == WPA_CIPHER_AES_128_CMAC) */ ) { - WLAN_SET_FIELD_32(cp, RSN_CIPHER_SUITE_AES_128_CMAC); - cp += 4; - RSN_IE(pucBuffer)->ucLength += 4; - } -#endif - prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer); - } - -} /* rsnGenerateRSNIE */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Parse the given IE buffer and check if it is WFA IE and return Type and -* SubType for further process. -* -* \param[in] pucBuf Pointer to the buffer of WFA Information Element. -* \param[out] pucOuiType Pointer to the storage of OUI Type. -* \param[out] pu2SubTypeVersion Pointer to the storage of OUI SubType and Version. - -* \retval TRUE Parse IE ok -* \retval FALSE Parse IE fail -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rsnParseCheckForWFAInfoElem ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBuf, - OUT PUINT_8 pucOuiType, - OUT PUINT_16 pu2SubTypeVersion - ) -{ - UINT_8 aucWfaOui[] = VENDOR_OUI_WFA; - P_IE_WFA_T prWfaIE; - - ASSERT(pucBuf); - ASSERT(pucOuiType); - ASSERT(pu2SubTypeVersion); - prWfaIE = (P_IE_WFA_T)pucBuf; - - do { - if (IE_LEN(pucBuf) <= ELEM_MIN_LEN_WFA_OUI_TYPE_SUBTYPE) { - break; - } - else if (prWfaIE->aucOui[0] != aucWfaOui[0] || - prWfaIE->aucOui[1] != aucWfaOui[1] || - prWfaIE->aucOui[2] != aucWfaOui[2]) { - break; - } - - *pucOuiType = prWfaIE->ucOuiType; - WLAN_GET_FIELD_16(&prWfaIE->aucOuiSubTypeVersion[0], pu2SubTypeVersion); - - return TRUE; - } - while (FALSE); - - return FALSE; - -} /* end of rsnParseCheckForWFAInfoElem() */ - -#if CFG_SUPPORT_AAA -/*----------------------------------------------------------------------------*/ -/*! -* \brief Parse the given IE buffer and check if it is RSN IE with CCMP PSK -* -* \param[in] prAdapter Pointer to Adapter -* \param[in] prSwRfb Pointer to the rx buffer -* \param[in] pIE Pointer rthe buffer of Information Element. -* \param[out] prStatusCode Pointer to the return status code. - -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -void -rsnParserCheckForRSNCCMPPSK( - P_ADAPTER_T prAdapter, - P_RSN_INFO_ELEM_T prIe, - PUINT_16 pu2StatusCode - ) -{ - - RSN_INFO_T rRsnIe; - - ASSERT(prAdapter); - ASSERT(prIe); - ASSERT(pu2StatusCode); - - *pu2StatusCode = STATUS_CODE_INVALID_INFO_ELEMENT; - - if (rsnParseRsnIE(prAdapter, prIe, &rRsnIe)) { - if ((rRsnIe.u4PairwiseKeyCipherSuiteCount != 1) || (rRsnIe.au4PairwiseKeyCipherSuite[0] != RSN_CIPHER_SUITE_CCMP)) { - *pu2StatusCode = STATUS_CODE_INVALID_PAIRWISE_CIPHER; - return; - } - if ((rRsnIe.u4GroupKeyCipherSuite != RSN_CIPHER_SUITE_CCMP)) { - *pu2StatusCode = STATUS_CODE_INVALID_GROUP_CIPHER; - return; - } - if ((rRsnIe.u4AuthKeyMgtSuiteCount != 1) || (rRsnIe.au4AuthKeyMgtSuite[0] != RSN_AKM_SUITE_PSK)) { - *pu2StatusCode = STATUS_CODE_INVALID_AKMP; - return; - } - - DBGLOG(RSN, TRACE, ("RSN with CCMP-PSK\n" )); - *pu2StatusCode = WLAN_STATUS_SUCCESS; - } - -} -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to generate an authentication event to NDIS. -* -* \param[in] u4Flags Authentication event: \n -* PARAM_AUTH_REQUEST_REAUTH 0x01 \n -* PARAM_AUTH_REQUEST_KEYUPDATE 0x02 \n -* PARAM_AUTH_REQUEST_PAIRWISE_ERROR 0x06 \n -* PARAM_AUTH_REQUEST_GROUP_ERROR 0x0E \n -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -rsnGenMicErrorEvent ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgFlags - ) -{ - P_PARAM_AUTH_EVENT_T prAuthEvent; - - DEBUGFUNC("rsnGenMicErrorEvent"); - - prAuthEvent = (P_PARAM_AUTH_EVENT_T)prAdapter->aucIndicationEventBuffer; - - /* Status type: Authentication Event */ - prAuthEvent->rStatus.eStatusType = ENUM_STATUS_TYPE_AUTHENTICATION; - - /* Authentication request */ - prAuthEvent->arRequest[0].u4Length = sizeof(PARAM_AUTH_REQUEST_T); - kalMemCopy((PVOID)prAuthEvent->arRequest[0].arBssid, (PVOID)prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX].aucBSSID, MAC_ADDR_LEN); - - if (fgFlags == TRUE) - prAuthEvent->arRequest[0].u4Flags = PARAM_AUTH_REQUEST_GROUP_ERROR; - else - prAuthEvent->arRequest[0].u4Flags = PARAM_AUTH_REQUEST_PAIRWISE_ERROR; - - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_SPECIFIC_INDICATION, - (PVOID)prAuthEvent, - sizeof(PARAM_STATUS_INDICATION_T) + sizeof(PARAM_AUTH_REQUEST_T)); - -} /* rsnGenMicErrorEvent */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to handle TKIP MIC failures. -* -* \param[in] adapter_p Pointer to the adapter object data area. -* \param[in] prSta Pointer to the STA which occur MIC Error -* \param[in] fgErrorKeyType type of error key -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rsnTkipHandleMICFailure ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta, - IN BOOLEAN fgErrorKeyType - ) -{ - //UINT_32 u4RsnaCurrentMICFailTime; - //P_AIS_SPECIFIC_BSS_INFO_T prAisSpecBssInfo; - - DEBUGFUNC("rsnTkipHandleMICFailure"); - - ASSERT(prAdapter); -#if 1 - rsnGenMicErrorEvent(prAdapter,/* prSta,*/ fgErrorKeyType); - - /* Generate authentication request event. */ - DBGLOG(RSN, INFO, ("Generate TKIP MIC error event (type: 0%d)\n", - fgErrorKeyType)); -#else - ASSERT(prSta); - - prAisSpecBssInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - - /* Record the MIC error occur time. */ - GET_CURRENT_SYSTIME(&u4RsnaCurrentMICFailTime); - - /* Generate authentication request event. */ - DBGLOG(RSN, INFO, ("Generate TKIP MIC error event (type: 0%d)\n", - fgErrorKeyType)); - - /* If less than 60 seconds have passed since a previous TKIP MIC failure, - disassociate from the AP and wait for 60 seconds before (re)associating - with the same AP. */ - if (prAisSpecBssInfo->u4RsnaLastMICFailTime != 0 && - !CHECK_FOR_TIMEOUT(u4RsnaCurrentMICFailTime, - prAisSpecBssInfo->u4RsnaLastMICFailTime, - SEC_TO_SYSTIME(TKIP_COUNTERMEASURE_SEC))) { - /* If less than 60 seconds expired since last MIC error, we have to - block traffic. */ - - DBGLOG(RSN, INFO, ("Start blocking traffic!\n")); - rsnGenMicErrorEvent( prAdapter,/* prSta,*/ fgErrorKeyType); - - secFsmEventStartCounterMeasure(prAdapter, prSta); - } - else { - rsnGenMicErrorEvent( prAdapter,/* prSta,*/ fgErrorKeyType); - DBGLOG(RSN, INFO, ("First TKIP MIC error!\n")); - } - - COPY_SYSTIME(prAisSpecBssInfo->u4RsnaLastMICFailTime, u4RsnaCurrentMICFailTime); -#endif -} /* rsnTkipHandleMICFailure */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is called to select a list of BSSID from -* the scan results for PMKID candidate list. -* -* \param[in] prBssDesc the BSS Desc at scan result list -* \param[out] pu4CandidateCount Pointer to the number of selected candidates. -* It is set to zero if no BSSID matches our requirement. -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rsnSelectPmkidCandidateList ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc - ) -{ - P_CONNECTION_SETTINGS_T prConnSettings; - P_AIS_BSS_INFO_T prAisBssInfo; - - DEBUGFUNC("rsnSelectPmkidCandidateList"); - - ASSERT(prBssDesc); - - prConnSettings = &prAdapter->rWifiVar.rConnSettings; - prAisBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]; - - /* Search a BSS with the same SSID from the given BSS description set. */ - //DBGLOG(RSN, TRACE, ("Check scan result ["MACSTR"]\n", - // MAC2STR(prBssDesc->aucBSSID))); - - if (UNEQUAL_SSID(prBssDesc->aucSSID, prBssDesc->ucSSIDLen, - prConnSettings->aucSSID, prConnSettings->ucSSIDLen)) { - DBGLOG(RSN, TRACE, ("-- SSID not matched\n")); - return; - } - -#if 0 - if ((prBssDesc->u2BSSBasicRateSet & - ~(rPhyAttributes[prAisBssInfo->ePhyType].u2SupportedRateSet)) || - prBssDesc->fgIsUnknownBssBasicRate) { - DBGLOG(RSN, TRACE, ("-- Rate set not matched\n")); - return; - } - - if (/* prBssDesc->u4RsnSelectedPairwiseCipher != prAisBssInfo->u4RsnSelectedPairwiseCipher ||*/ - prBssDesc->u4RsnSelectedGroupCipher != prAisBssInfo->u4RsnSelectedGroupCipher /*|| - prBssDesc->u4RsnSelectedAKMSuite != prAisBssInfo->u4RsnSelectedAKMSuite */) { - DBGLOG(RSN, TRACE, ("-- Encrypt status not matched for PMKID \n")); - return; - } -#endif - - rsnUpdatePmkidCandidateList(prAdapter, prBssDesc); - -} /* rsnSelectPmkidCandidateList */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is called to select a list of BSSID from -* the scan results for PMKID candidate list. -* -* \param[in] prBssDesc the BSS DESC at scan result list -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rsnUpdatePmkidCandidateList ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc - ) -{ - UINT_32 i; - P_CONNECTION_SETTINGS_T prConnSettings; - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecBssInfo; - - DEBUGFUNC("rsnUpdatePmkidCandidateList"); - - ASSERT(prBssDesc); - - prConnSettings = &prAdapter->rWifiVar.rConnSettings; - prAisSpecBssInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - - if (UNEQUAL_SSID(prBssDesc->aucSSID, prBssDesc->ucSSIDLen, - prConnSettings->aucSSID, prConnSettings->ucSSIDLen)) { - DBGLOG(RSN, TRACE, ("-- SSID not matched\n")); - return; - } - - for (i = 0; i < CFG_MAX_PMKID_CACHE; i++) { - if (EQUAL_MAC_ADDR(prBssDesc->aucBSSID, prAisSpecBssInfo->arPmkidCandicate[i].aucBssid)) - return; - } - - /* If the number of selected BSSID exceed MAX_NUM_PMKID_CACHE(16), - then we only store MAX_NUM_PMKID_CACHE(16) in PMKID cache */ - if ((prAisSpecBssInfo->u4PmkidCandicateCount + 1) > CFG_MAX_PMKID_CACHE) { - prAisSpecBssInfo->u4PmkidCandicateCount --; - } - - i = prAisSpecBssInfo->u4PmkidCandicateCount; - - COPY_MAC_ADDR((PVOID)prAisSpecBssInfo->arPmkidCandicate[i].aucBssid, - (PVOID)prBssDesc->aucBSSID); - - if (prBssDesc->u2RsnCap & MASK_RSNIE_CAP_PREAUTH) { - prAisSpecBssInfo->arPmkidCandicate[i].u4PreAuthFlags = 1; - DBGLOG(RSN, TRACE, ("Add " MACSTR " with pre-auth to candidate list\n", - MAC2STR(prAisSpecBssInfo->arPmkidCandicate[i].aucBssid))); - } - else { - prAisSpecBssInfo->arPmkidCandicate[i].u4PreAuthFlags = 0; - DBGLOG(RSN, TRACE, ("Add " MACSTR " without pre-auth to candidate list\n", - MAC2STR(prAisSpecBssInfo->arPmkidCandicate[i].aucBssid))); - } - - prAisSpecBssInfo->u4PmkidCandicateCount ++; - -} /* rsnUpdatePmkidCandidateList */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to search the desired entry in -* PMKID cache according to the BSSID -* -* \param[in] pucBssid Pointer to the BSSID -* \param[out] pu4EntryIndex Pointer to place the found entry index -* -* \retval TRUE, if found one entry for specified BSSID -* \retval FALSE, if not found -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rsnSearchPmkidEntry ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBssid, - OUT PUINT_32 pu4EntryIndex - ) -{ - UINT_32 i; - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecBssInfo; - - DEBUGFUNC("rsnSearchPmkidEntry"); - - ASSERT(pucBssid); - ASSERT(pu4EntryIndex); - - prAisSpecBssInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - - if (prAisSpecBssInfo->u4PmkidCacheCount > CFG_MAX_PMKID_CACHE) { - return FALSE; - } - - ASSERT(prAisSpecBssInfo->u4PmkidCacheCount <= CFG_MAX_PMKID_CACHE); - - /* Search for desired BSSID */ - for (i = 0; i < prAisSpecBssInfo->u4PmkidCacheCount; i++) { - if (!kalMemCmp(prAisSpecBssInfo->arPmkidCache[i].rBssidInfo.arBSSID, pucBssid, - MAC_ADDR_LEN)) { - break; - } - } - - /* If desired BSSID is found, then set the PMKID */ - if (i < prAisSpecBssInfo->u4PmkidCacheCount) { - *pu4EntryIndex = i; - - return TRUE; - } - - return FALSE; -} /* rsnSearchPmkidEntry */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to check if there is difference -* between PMKID candicate list and PMKID cache. If there -* is new candicate that no cache entry is available, then -* add a new entry for the new candicate in the PMKID cache -* and set the PMKID indication flag to TRUE. -* -* \retval TRUE, if new member in the PMKID candicate list -* \retval FALSe, if no new member in the PMKID candicate list -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rsnCheckPmkidCandicate ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecBssInfo; - UINT_32 i; // Index for PMKID candicate - UINT_32 j; // Indix for PMKID cache - BOOLEAN status = FALSE; - - DEBUGFUNC("rsnCheckPmkidCandicate"); - - prAisSpecBssInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - - /* Check for each candicate */ - for (i = 0; i < prAisSpecBssInfo->u4PmkidCandicateCount; i++) { - for (j = 0; j < prAisSpecBssInfo->u4PmkidCacheCount; j++) { - if (!kalMemCmp(prAisSpecBssInfo->arPmkidCache[j].rBssidInfo.arBSSID, - prAisSpecBssInfo->arPmkidCandicate[i].aucBssid, - MAC_ADDR_LEN)) { - //DBGLOG(RSN, TRACE, (MACSTR" at PMKID cache!!\n", MAC2STR(prAisSpecBssInfo->arPmkidCandicate[i].aucBssid))); - break; - } - } - - /* No entry found in PMKID cache for the candicate, add new one */ - if (j == prAisSpecBssInfo->u4PmkidCacheCount && prAisSpecBssInfo->u4PmkidCacheCount < CFG_MAX_PMKID_CACHE) { - DBGLOG(RSN, TRACE, ("Add "MACSTR" to PMKID cache!!\n", MAC2STR(prAisSpecBssInfo->arPmkidCandicate[i].aucBssid))); - kalMemCopy((PVOID)prAisSpecBssInfo->arPmkidCache[prAisSpecBssInfo->u4PmkidCacheCount].rBssidInfo.arBSSID, - (PVOID)prAisSpecBssInfo->arPmkidCandicate[i].aucBssid, - MAC_ADDR_LEN); - prAisSpecBssInfo->arPmkidCache[prAisSpecBssInfo->u4PmkidCacheCount].fgPmkidExist = FALSE; - prAisSpecBssInfo->u4PmkidCacheCount++; - - status = TRUE; - } - } - - return status; -} /* rsnCheckPmkidCandicate */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is called to wait a duration to indicate the pre-auth AP candicate -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -rsnIndicatePmkidCand ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Parm - ) -{ - DBGLOG(RSN, EVENT, ("Security - Time to indicate the PMKID cand.\n")); - - /* If the authentication mode is WPA2 and indication PMKID flag - is available, then we indicate the PMKID candidate list to NDIS and - clear the flag, indicatePMKID */ - - if (prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX].eConnectionState == PARAM_MEDIA_STATE_CONNECTED && - prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA2) { - rsnGeneratePmkidIndication(prAdapter); - } - - return; -} /* end of rsnIndicatePmkidCand() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to check the BSS Desc at scan result -* with pre-auth cap at wpa2 mode. If there -* is candicate that no cache entry is available, then -* add a new entry for the new candicate in the PMKID cache -* and set the PMKID indication flag to TRUE. -* -* \param[in] prBss The BSS Desc at scan result -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rsnCheckPmkidCache ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBss - ) -{ - P_AIS_BSS_INFO_T prAisBssInfo; - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecBssInfo; - P_CONNECTION_SETTINGS_T prConnSettings; - - DEBUGFUNC("rsnCheckPmkidCandicate"); - - ASSERT(prBss); - - prConnSettings = &prAdapter->rWifiVar.rConnSettings; - prAisBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]; - prAisSpecBssInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - - if ((prAisBssInfo->eConnectionState == PARAM_MEDIA_STATE_CONNECTED) && - (prConnSettings->eAuthMode == AUTH_MODE_WPA2)) { - rsnSelectPmkidCandidateList(prAdapter, prBss); - - /* Set indication flag of PMKID to TRUE, and then connHandleNetworkConnection() - will indicate this later */ - if (rsnCheckPmkidCandicate(prAdapter)) { - DBGLOG(RSN, TRACE, ("Prepare a timer to indicate candidate PMKID Candidate\n")); - cnmTimerStopTimer(prAdapter, &prAisSpecBssInfo->rPreauthenticationTimer); - cnmTimerStartTimer(prAdapter, &prAisSpecBssInfo->rPreauthenticationTimer, - SEC_TO_MSEC(WAIT_TIME_IND_PMKID_CANDICATE_SEC)); - } - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to generate an PMKID candidate list -* indication to NDIS. -* -* \param[in] prAdapter Pointer to the adapter object data area. -* \param[in] u4Flags PMKID candidate list event: -* PARAM_PMKID_CANDIDATE_PREAUTH_ENABLED 0x01 -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -rsnGeneratePmkidIndication ( - IN P_ADAPTER_T prAdapter - ) -{ - P_PARAM_STATUS_INDICATION_T prStatusEvent; - P_PARAM_PMKID_CANDIDATE_LIST_T prPmkidEvent; - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecificBssInfo; - UINT_8 i, j = 0, count = 0; - UINT_32 u4LenOfUsedBuffer; - - DEBUGFUNC("rsnGeneratePmkidIndication"); - - ASSERT(prAdapter); - - prStatusEvent = - (P_PARAM_STATUS_INDICATION_T)prAdapter->aucIndicationEventBuffer; - - /* Status type: PMKID Candidatelist Event */ - prStatusEvent->eStatusType = ENUM_STATUS_TYPE_CANDIDATE_LIST; - ASSERT(prStatusEvent); - - prPmkidEvent = (P_PARAM_PMKID_CANDIDATE_LIST_T)(&prStatusEvent->eStatusType + 1); - ASSERT(prPmkidEvent); - - prAisSpecificBssInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - ASSERT(prAisSpecificBssInfo); - - for (i = 0; i < prAisSpecificBssInfo->u4PmkidCandicateCount; i++) { - for (j = 0; j < prAisSpecificBssInfo->u4PmkidCacheCount; j++) { - if (EQUAL_MAC_ADDR( prAisSpecificBssInfo->arPmkidCache[j].rBssidInfo.arBSSID, - prAisSpecificBssInfo->arPmkidCandicate[i].aucBssid) && - (prAisSpecificBssInfo->arPmkidCache[j].fgPmkidExist == TRUE)){ - break; - } - } - if (count >= CFG_MAX_PMKID_CACHE) { - break; - } - - if (j == prAisSpecificBssInfo->u4PmkidCacheCount) { - kalMemCopy((PVOID)prPmkidEvent->arCandidateList[count].arBSSID, - (PVOID)prAisSpecificBssInfo->arPmkidCandicate[i].aucBssid, - PARAM_MAC_ADDR_LEN); - prPmkidEvent->arCandidateList[count].u4Flags = - prAisSpecificBssInfo->arPmkidCandicate[i].u4PreAuthFlags; - DBGLOG(RSN, TRACE, (MACSTR" %d\n", MAC2STR(prPmkidEvent->arCandidateList[count].arBSSID), - prPmkidEvent->arCandidateList[count].u4Flags)); - count++; - } - } - - /* PMKID Candidate List */ - prPmkidEvent->u4Version = 1; - prPmkidEvent->u4NumCandidates = count; - DBGLOG(RSN, TRACE, ("rsnGeneratePmkidIndication #%d\n", prPmkidEvent->u4NumCandidates)); - u4LenOfUsedBuffer = sizeof(ENUM_STATUS_TYPE_T) + (2 * sizeof(UINT_32)) + - (count * sizeof(PARAM_PMKID_CANDIDATE_T)); - //dumpMemory8((PUINT_8)prAdapter->aucIndicationEventBuffer, u4LenOfUsedBuffer); - - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_SPECIFIC_INDICATION, - (PVOID) prAdapter->aucIndicationEventBuffer, - u4LenOfUsedBuffer); - -} /* rsnGeneratePmkidIndication */ -#endif - -#if CFG_SUPPORT_WPS2 -/*----------------------------------------------------------------------------*/ -/*! -* -* \brief This routine is called to generate WSC IE for -* associate request frame. -* -* \param[in] prCurrentBss The Selected BSS description -* -* \retval The append WSC IE length -* -* \note -* Called by: AIS module, Associate request -*/ -/*----------------------------------------------------------------------------*/ -VOID -rsnGenerateWSCIE ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - PUINT_8 pucBuffer; - - ASSERT(prAdapter); - ASSERT(prMsduInfo); - - if (prMsduInfo->ucNetworkType != NETWORK_TYPE_AIS_INDEX) - return; - - pucBuffer = (PUINT_8)((UINT_32)prMsduInfo->prPacket + - (UINT_32)prMsduInfo->u2FrameLength); - - /* ASSOC INFO IE ID: 221 :0xDD */ - if (prAdapter->prGlueInfo->u2WSCAssocInfoIELen) { - kalMemCopy(pucBuffer, &prAdapter->prGlueInfo->aucWSCAssocInfoIE, prAdapter->prGlueInfo->u2WSCAssocInfoIELen); - prMsduInfo->u2FrameLength += prAdapter->prGlueInfo->u2WSCAssocInfoIELen; - } - -} -#endif - - -#if CFG_SUPPORT_802_11W - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to check if the Bip Key installed or not -* -* \param[in] -* prAdapter -* -* \return -* TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -rsnCheckBipKeyInstalled ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ) -{ - if (prStaRec && prStaRec->ucNetTypeIndex == (UINT_8)NETWORK_TYPE_AIS_INDEX) - return prAdapter->rWifiVar.rAisSpecificBssInfo.fgBipKeyInstalled; - else - return FALSE; -} - -/*----------------------------------------------------------------------------*/ -/*! -* -* \brief This routine is called to check the Sa query timeout. -* -* -* \note -* Called by: AIS module, Handle by Sa Quert timeout -*/ -/*----------------------------------------------------------------------------*/ -UINT_8 -rsnCheckSaQueryTimeout ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_SPECIFIC_BSS_INFO_T prBssSpecInfo; - UINT_32 now; - - prBssSpecInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - ASSERT(prBssSpecInfo); - - GET_CURRENT_SYSTIME(&now); - - if (CHECK_FOR_TIMEOUT(now, - prBssSpecInfo->u4SaQueryStart, - TU_TO_MSEC(1000))) { - LOG_FUNC("association SA Query timed out\n"); - - prBssSpecInfo->ucSaQueryTimedOut = 1; - kalMemFree(prBssSpecInfo->pucSaQueryTransId, VIR_MEM_TYPE, prBssSpecInfo->u4SaQueryCount * ACTION_SA_QUERY_TR_ID_LEN); - prBssSpecInfo->pucSaQueryTransId = NULL; - prBssSpecInfo->u4SaQueryCount = 0; - cnmTimerStopTimer(prAdapter, &prBssSpecInfo->rSaQueryTimer); - /* Re-connect */ - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_DISCONNECT, - NULL, - 0); - - return 1; - } - - return 0; -} - -/*----------------------------------------------------------------------------*/ -/*! -* -* \brief This routine is called to start the 802.11w sa query timer. -* -* -* \note -* Called by: AIS module, Handle Rx mgmt request -*/ -/*----------------------------------------------------------------------------*/ -void rsnStartSaQueryTimer ( - IN P_ADAPTER_T prAdapter - ) -{ - P_BSS_INFO_T prBssInfo; - P_AIS_SPECIFIC_BSS_INFO_T prBssSpecInfo; - P_MSDU_INFO_T prMsduInfo; - P_ACTION_SA_QUERY_FRAME prTxFrame; - UINT_16 u2PayloadLen; - PUINT_8 pucTmp = NULL; - UINT_8 ucTransId[ACTION_SA_QUERY_TR_ID_LEN]; - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]; - ASSERT(prBssInfo); - - prBssSpecInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - ASSERT(prBssSpecInfo); - - LOG_FUNC("MFP: Start Sa Query\n"); - - if (prBssSpecInfo->u4SaQueryCount > 0 && - rsnCheckSaQueryTimeout(prAdapter)) { - LOG_FUNC("MFP: u4SaQueryCount count =%d\n", prBssSpecInfo->u4SaQueryCount); - return; - } - - prMsduInfo = (P_MSDU_INFO_T) cnmMgtPktAlloc(prAdapter, - MAC_TX_RESERVED_FIELD + PUBLIC_ACTION_MAX_LEN); - - if (!prMsduInfo) - return; - - prTxFrame = (P_ACTION_SA_QUERY_FRAME) - ((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD); - - prTxFrame->u2FrameCtrl = MAC_FRAME_ACTION; - prTxFrame->u2FrameCtrl |= MASK_FC_PROTECTED_FRAME; - - COPY_MAC_ADDR(prTxFrame->aucDestAddr, prBssInfo->aucBSSID); - COPY_MAC_ADDR(prTxFrame->aucSrcAddr, prBssInfo->aucOwnMacAddr); - COPY_MAC_ADDR(prTxFrame->aucBSSID, prBssInfo->aucBSSID); - - prTxFrame->ucCategory = CATEGORY_SA_QUERT_ACTION; - prTxFrame->ucAction = ACTION_SA_QUERY_REQUEST; - - if (prBssSpecInfo->u4SaQueryCount == 0) { - GET_CURRENT_SYSTIME(&prBssSpecInfo->u4SaQueryStart); - } - - if (prBssSpecInfo->u4SaQueryCount) { - pucTmp = kalMemAlloc(prBssSpecInfo->u4SaQueryCount * ACTION_SA_QUERY_TR_ID_LEN, VIR_MEM_TYPE); - if (!pucTmp) { - DBGLOG(RSN, INFO, ("MFP: Fail to alloc tmp buffer for backup sa query id\n")); - return; - } - kalMemCopy(pucTmp, prBssSpecInfo->pucSaQueryTransId, prBssSpecInfo->u4SaQueryCount * ACTION_SA_QUERY_TR_ID_LEN); - } - - kalMemFree(prBssSpecInfo->pucSaQueryTransId, VIR_MEM_TYPE, prBssSpecInfo->u4SaQueryCount * ACTION_SA_QUERY_TR_ID_LEN); - - ucTransId[0] = (UINT_8)(kalRandomNumber() & 0xFF); - ucTransId[1] = (UINT_8)(kalRandomNumber() & 0xFF); - - kalMemCopy(prTxFrame->ucTransId, ucTransId, ACTION_SA_QUERY_TR_ID_LEN); - - prBssSpecInfo->u4SaQueryCount++; - - prBssSpecInfo->pucSaQueryTransId = kalMemAlloc(prBssSpecInfo->u4SaQueryCount * ACTION_SA_QUERY_TR_ID_LEN, VIR_MEM_TYPE); - if (!prBssSpecInfo->pucSaQueryTransId) { - DBGLOG(RSN, INFO, ("MFP: Fail to alloc buffer for sa query id list\n")); - return; - } - - if (pucTmp) { - kalMemCopy(prBssSpecInfo->pucSaQueryTransId, pucTmp, (prBssSpecInfo->u4SaQueryCount - 1) * ACTION_SA_QUERY_TR_ID_LEN); - kalMemCopy(&prBssSpecInfo->pucSaQueryTransId[(prBssSpecInfo->u4SaQueryCount - 1) * ACTION_SA_QUERY_TR_ID_LEN], - ucTransId, ACTION_SA_QUERY_TR_ID_LEN); - kalMemFree(pucTmp, VIR_MEM_TYPE, (prBssSpecInfo->u4SaQueryCount - 1) * ACTION_SA_QUERY_TR_ID_LEN); - } - else { - kalMemCopy(prBssSpecInfo->pucSaQueryTransId, ucTransId, ACTION_SA_QUERY_TR_ID_LEN); - } - - u2PayloadLen = 2 + ACTION_SA_QUERY_TR_ID_LEN; - - //4 Update information of MSDU_INFO_T - prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_MGMT; /* Management frame */ - prMsduInfo->ucStaRecIndex = prBssInfo->prStaRecOfAP->ucIndex; - prMsduInfo->ucNetworkType = prBssInfo->ucNetTypeIndex; - prMsduInfo->ucMacHeaderLength = WLAN_MAC_MGMT_HEADER_LEN; - prMsduInfo->fgIs802_1x = FALSE; - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = WLAN_MAC_MGMT_HEADER_LEN + u2PayloadLen; - prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMsduInfo->pfTxDoneHandler = NULL; - prMsduInfo->fgIsBasicRate = FALSE; - - //4 Enqueue the frame to send this action frame. - nicTxEnqueueMsdu(prAdapter, prMsduInfo); - - DBGLOG(RSN, TRACE, ("Set SA Query timer %d (%d sec)\n", prBssSpecInfo->u4SaQueryCount, prBssInfo->u2ObssScanInterval)); - - cnmTimerStartTimer(prAdapter, &prBssSpecInfo->rSaQueryTimer, - TU_TO_MSEC(201)); - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* -* \brief This routine is called to start the 802.11w sa query. -* -* -* \note -* Called by: AIS module, Handle Rx mgmt request -*/ -/*----------------------------------------------------------------------------*/ -void rsnStartSaQuery ( - IN P_ADAPTER_T prAdapter - ) -{ - rsnStartSaQueryTimer(prAdapter); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* -* \brief This routine is called to stop the 802.11w sa query. -* -* -* \note -* Called by: AIS module, Handle Rx mgmt request -*/ -/*----------------------------------------------------------------------------*/ -void rsnStopSaQuery ( - IN P_ADAPTER_T prAdapter - ) -{ - P_AIS_SPECIFIC_BSS_INFO_T prBssSpecInfo; - - prBssSpecInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - ASSERT(prBssSpecInfo); - - cnmTimerStopTimer(prAdapter, &prBssSpecInfo->rSaQueryTimer); - kalMemFree(prBssSpecInfo->pucSaQueryTransId, VIR_MEM_TYPE, prBssSpecInfo->u4SaQueryCount * ACTION_SA_QUERY_TR_ID_LEN); - prBssSpecInfo->pucSaQueryTransId = NULL; - prBssSpecInfo->u4SaQueryCount = 0; -} - -/*----------------------------------------------------------------------------*/ -/*! -* -* \brief This routine is called to process the 802.11w sa query action frame. -* -* -* \note -* Called by: AIS module, Handle Rx mgmt request -*/ -/*----------------------------------------------------------------------------*/ -void -rsnSaQueryRequest ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_BSS_INFO_T prBssInfo; - P_MSDU_INFO_T prMsduInfo; - P_ACTION_SA_QUERY_FRAME prRxFrame = NULL; - UINT_16 u2PayloadLen; - P_STA_RECORD_T prStaRec; - P_ACTION_SA_QUERY_FRAME prTxFrame; - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]; - ASSERT(prBssInfo); - - prRxFrame = (P_ACTION_SA_QUERY_FRAME)prSwRfb->pvHeader; - if (!prRxFrame) - return; - - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - - DBGLOG(RSN, TRACE, ("IEEE 802.11: Received SA Query Request from " - MACSTR"\n", MAC2STR(prStaRec->aucMacAddr))); - - DBGLOG_MEM8(RSN, TRACE, prRxFrame->ucTransId, - ACTION_SA_QUERY_TR_ID_LEN); - - if (kalGetMediaStateIndicated(prAdapter->prGlueInfo) == PARAM_MEDIA_STATE_DISCONNECTED) { - DBGLOG(RSN, TRACE, ("IEEE 802.11: Ignore SA Query Request " - "from unassociated STA " MACSTR"\n", MAC2STR(prStaRec->aucMacAddr))); - return; - } - DBGLOG(RSN, TRACE, ("IEEE 802.11: Sending SA Query Response to " - MACSTR"\n", MAC2STR(prStaRec->aucMacAddr))); - - prMsduInfo = (P_MSDU_INFO_T) cnmMgtPktAlloc(prAdapter, - MAC_TX_RESERVED_FIELD + PUBLIC_ACTION_MAX_LEN); - - if (!prMsduInfo) - return; - - prTxFrame = (P_ACTION_SA_QUERY_FRAME) - ((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD); - - prTxFrame->u2FrameCtrl = MAC_FRAME_ACTION; - /* SA Query always with protected */ - prTxFrame->u2FrameCtrl |= MASK_FC_PROTECTED_FRAME; - - COPY_MAC_ADDR(prTxFrame->aucDestAddr, prBssInfo->aucBSSID); - COPY_MAC_ADDR(prTxFrame->aucSrcAddr, prBssInfo->aucOwnMacAddr); - COPY_MAC_ADDR(prTxFrame->aucBSSID, prBssInfo->aucBSSID); - - prTxFrame->ucCategory = CATEGORY_SA_QUERT_ACTION; - prTxFrame->ucAction = ACTION_SA_QUERY_RESPONSE; - - kalMemCopy(prTxFrame->ucTransId, - prRxFrame->ucTransId, - ACTION_SA_QUERY_TR_ID_LEN); - - u2PayloadLen = 2 + ACTION_SA_QUERY_TR_ID_LEN; - - //4 Update information of MSDU_INFO_T - prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_MGMT; /* Management frame */ - prMsduInfo->ucStaRecIndex = prBssInfo->prStaRecOfAP->ucIndex; - prMsduInfo->ucNetworkType = prBssInfo->ucNetTypeIndex; - prMsduInfo->ucMacHeaderLength = WLAN_MAC_MGMT_HEADER_LEN; - prMsduInfo->fgIs802_1x = FALSE; - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = WLAN_MAC_MGMT_HEADER_LEN + u2PayloadLen; - prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMsduInfo->pfTxDoneHandler = NULL; - prMsduInfo->fgIsBasicRate = FALSE; - - //4 Enqueue the frame to send this action frame. - nicTxEnqueueMsdu(prAdapter, prMsduInfo); - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* -* \brief This routine is called to process the 802.11w sa query action frame. -* -* -* \note -* Called by: AIS module, Handle Rx mgmt request -*/ -/*----------------------------------------------------------------------------*/ -void -rsnSaQueryAction ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_AIS_SPECIFIC_BSS_INFO_T prBssSpecInfo; - P_ACTION_SA_QUERY_FRAME prRxFrame; - P_STA_RECORD_T prStaRec; - UINT_32 i; - - prBssSpecInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - ASSERT(prBssSpecInfo); - - prRxFrame = (P_ACTION_SA_QUERY_FRAME) prSwRfb->pvHeader; - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - - if (prSwRfb->u2PacketLen < ACTION_SA_QUERY_TR_ID_LEN) { - DBGLOG(RSN, TRACE, ("IEEE 802.11: Too short SA Query Action " - "frame (len=%lu)\n", (unsigned long) prSwRfb->u2PacketLen)); - return; - } - - if (prRxFrame->ucAction == ACTION_SA_QUERY_REQUEST) { - rsnSaQueryRequest(prAdapter, prSwRfb); - return; - } - - if (prRxFrame->ucAction != ACTION_SA_QUERY_RESPONSE) { - DBGLOG(RSN, TRACE, ("IEEE 802.11: Unexpected SA Query " - "Action %d\n", prRxFrame->ucAction)); - return; - } - - DBGLOG(RSN, TRACE, ("IEEE 802.11: Received SA Query Response from " - MACSTR"\n", MAC2STR(prStaRec->aucMacAddr))); - - DBGLOG_MEM8(RSN, TRACE, prRxFrame->ucTransId, - ACTION_SA_QUERY_TR_ID_LEN); - - /* MLME-SAQuery.confirm */ - - for (i = 0; i < prBssSpecInfo->u4SaQueryCount; i++) { - if (kalMemCmp(prBssSpecInfo->pucSaQueryTransId + - i * ACTION_SA_QUERY_TR_ID_LEN, - prRxFrame->ucTransId, - ACTION_SA_QUERY_TR_ID_LEN) == 0) - break; - } - - if (i >= prBssSpecInfo->u4SaQueryCount) { - DBGLOG(RSN, TRACE, ("IEEE 802.11: No matching SA Query " - "transaction identifier found\n")); - return; - } - - DBGLOG(RSN, TRACE, ("Reply to pending SA Query received\n")); - - rsnStopSaQuery(prAdapter); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* -* \brief This routine is called to process the 802.11w mgmt frame. -* -* -* \note -* Called by: AIS module, Handle Rx mgmt request -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -rsnCheckRxMgmt ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN UINT_8 ucSubtype - ) -{ - P_HIF_RX_HEADER_T prHifRxHdr; - BOOLEAN fgUnicast = TRUE; - BOOLEAN fgRobustAction = FALSE; - - prHifRxHdr = prSwRfb->prHifRxHdr; - - if ((HIF_RX_HDR_GET_NETWORK_IDX(prHifRxHdr) == NETWORK_TYPE_AIS_INDEX) && - prAdapter->rWifiVar.rAisSpecificBssInfo.fgMgmtProtection /* Use MFP */) { - - P_WLAN_ASSOC_REQ_FRAME_T prAssocReqFrame; - prAssocReqFrame = (P_WLAN_ASSOC_REQ_FRAME_T) prSwRfb->pvHeader; - - if (prAssocReqFrame->aucDestAddr[0] & BIT(0)) - fgUnicast = FALSE; - - LOG_FUNC("QM RX MGT: rsnCheckRxMgmt = %d 0x%x %d ucSubtype=%x\n", fgUnicast, prHifRxHdr->ucReserved, (prHifRxHdr->ucReserved & CONTROL_FLAG_UC_MGMT_NO_ENC), ucSubtype); - - if (prHifRxHdr->ucReserved & CONTROL_FLAG_UC_MGMT_NO_ENC) { - /* "Dropped unprotected Robust Action frame from an MFP STA" */ - /* exclude Public Action */ - if (ucSubtype == 13 /* 0x1011: MAC_FRAME_ACTION */) - { - UINT_8 ucAction = *prSwRfb->pucRecvBuff; - if (ucAction != CATEGORY_PUBLIC_ACTION && ucAction != CATEGORY_HT_ACTION) { -#if DBG && CFG_RX_PKTS_DUMP - LOG_FUNC("QM RX MGT: UnProtected Robust Action frame = %d\n", ucAction); -#endif - fgRobustAction = TRUE; - return TRUE; - } - } - if (fgUnicast && ((ucSubtype == 10 /* 0x1010: MAC_FRAME_DISASSOC */) || (ucSubtype == 12 /* 0x1100: MAC_FRAME_DEAUTH */))) { - LOG_FUNC("QM RX MGT: rsnStartSaQuery\n"); - /* MFP test plan 5.3.3.5 */ - rsnStartSaQuery(prAdapter); - return TRUE; - } - } -#if 0 - else { - if (fgUnicast && ((ucSubtype == MAC_FRAME_DISASSOC) || (ucSubtype == MAC_FRAME_DEAUTH))) { - /* This done by function handler */ - //kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - // WLAN_STATUS_MEDIA_DISCONNECT, - // NULL, - // 0); - } - } -#endif - } - return FALSE; -} -#endif - diff --git a/drivers/net/wireless/mt5931/mgmt/saa_fsm.c b/drivers/net/wireless/mt5931/mgmt/saa_fsm.c deleted file mode 100755 index 65eee2b53fe3..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/saa_fsm.c +++ /dev/null @@ -1,2022 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/saa_fsm.c#2 $ -*/ - -/*! \file "saa_fsm.c" - \brief This file defines the FSM for SAA MODULE. - - This file defines the FSM for SAA MODULE. -*/ - - - -/* -** $Log: saa_fsm.c $ - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 04 20 2012 cp.wu - * [WCXRP00000913] [MT6620 Wi-Fi] create repository of source code dedicated for MT6620 E6 ASIC - * correct macro - * - * 11 24 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * Adjust code for DBG and CONFIG_XLOG. - * - * 11 11 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * modify the xlog related code. - * - * 11 04 2011 cp.wu - * [WCXRP00001086] [MT6620 Wi-Fi][Driver] On Android, indicate an extra DISCONNECT for REASSOCIATED cases as an explicit trigger for Android framework - * 1. for DEAUTH/DISASSOC cases, indicate for DISCONNECTION immediately. - * 2. (Android only) when reassociation-and-non-roaming cases happened, indicate an extra DISCONNECT indication to Android Wi-Fi framework - * - * 11 02 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * adding the code for XLOG. - * - * 09 30 2011 cm.chang - * [WCXRP00001020] [MT6620 Wi-Fi][Driver] Handle secondary channel offset of AP in 5GHz band - * Add debug message about 40MHz bandwidth allowed - * - * 05 12 2011 cp.wu - * [WCXRP00000720] [MT6620 Wi-Fi][Driver] Do not do any further operation in case STA-REC has been invalidated before SAA-FSM starts to roll - * check for valid STA-REC before SAA-FSM starts to roll. - * - * 04 21 2011 terry.wu - * [WCXRP00000674] [MT6620 Wi-Fi][Driver] Refine AAA authSendAuthFrame - * Add network type parameter to authSendAuthFrame. - * - * 04 15 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add BOW short range mode. - * - * 04 14 2011 cm.chang - * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency - * . - * - * 03 31 2011 puff.wen - * NULL - * . - * - * 02 10 2011 yuche.tsai - * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode. - * Add RX deauthentication & disassociation process under Hot-Spot mode. - * - * 01 26 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * . - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Fix compile error of after Station Type Macro modification. - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Change Station Type in Station Record, Modify MACRO definition for getting station type & network type index & Role. - * - * 11 29 2010 cp.wu - * [WCXRP00000210] [MT6620 Wi-Fi][Driver][FW] Set RCPI value in STA_REC for initial TX rate selection of auto-rate algorithm - * update ucRcpi of STA_RECORD_T for AIS when - * 1) Beacons for IBSS merge is received - * 2) Associate Response for a connecting peer is received - * - * 10 18 2010 cp.wu - * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated - * 1. remove redundant variables in STA_REC structure - * 2. add STA-REC uninitialization routine for clearing pending events - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 30 2010 cp.wu - * NULL - * eliminate klockwork errors - * - * 08 24 2010 chinghwa.yu - * NULL - * Update for MID_SCN_BOW_SCAN_DONE mboxDummy. - * Update saa_fsm for BOW. - * - * 08 16 2010 cp.wu - * NULL - * Replace CFG_SUPPORT_BOW by CFG_ENABLE_BT_OVER_WIFI. - * There is no CFG_SUPPORT_BOW in driver domain source. - * - * 08 02 2010 yuche.tsai - * NULL - * Add support for P2P join event start. - * - * 07 12 2010 cp.wu - * - * SAA will take a record for tracking request sequence number. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * AIS-FSM integration with CNM channel request messages - * - * 06 23 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * sync. with main branch for reseting to state 1 when associating with another AP - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * refine TX-DONE callback. - * - * 06 21 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * remove duplicate variable for migration. - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 18 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * migration the security related function from firmware. - * - * 06 17 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Fix compile error when enable WiFi Direct function. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * saa_fsm.c is migrated. - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add Power Management - Legacy PS-POLL support. - * - * 04 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW - * - * 04 19 2010 kevin.huang - * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support - * - * * * Add Connection Policy - Any and Rx Burst Deauth Support for WHQL - * - * 03 10 2010 kevin.huang - * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support - * Add Channel Manager for arbitration of JOIN and SCAN Req - * - * 02 26 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add support of Driver STA_RECORD_T activation - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup - * - * 01 27 2010 wh.su - * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code - * add and fixed some security function. - * - * 01 12 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Fix compile warning due to declared but not used - * - * 01 11 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add Deauth and Disassoc Handler - * - * 01 08 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Refine Debug Label - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * Dec 3 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Update comment - * - * Dec 1 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * rename the function - * - * Nov 24 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Revise MGMT Handler with Retain Status - * - * Nov 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ -#if DBG -/*lint -save -e64 Type mismatch */ -static PUINT_8 apucDebugAAState[AA_STATE_NUM] = { - (PUINT_8)DISP_STRING("AA_STATE_IDLE"), - (PUINT_8)DISP_STRING("SAA_STATE_SEND_AUTH1"), - (PUINT_8)DISP_STRING("SAA_STATE_WAIT_AUTH2"), - (PUINT_8)DISP_STRING("SAA_STATE_SEND_AUTH3"), - (PUINT_8)DISP_STRING("SAA_STATE_WAIT_AUTH4"), - (PUINT_8)DISP_STRING("SAA_STATE_SEND_ASSOC1"), - (PUINT_8)DISP_STRING("SAA_STATE_WAIT_ASSOC2"), - (PUINT_8)DISP_STRING("AAA_STATE_SEND_AUTH2"), - (PUINT_8)DISP_STRING("AAA_STATE_SEND_AUTH4"), - (PUINT_8)DISP_STRING("AAA_STATE_SEND_ASSOC2"), - (PUINT_8)DISP_STRING("AA_STATE_RESOURCE") -}; -/*lint -restore */ -#endif /* DBG */ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/*! -* @brief The Core FSM engine of SAA Module. -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* @param[in] eNextState The value of Next State -* @param[in] prRetainedSwRfb Pointer to the retained SW_RFB_T for JOIN Success -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -saaFsmSteps ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN ENUM_AA_STATE_T eNextState, - IN P_SW_RFB_T prRetainedSwRfb - ) -{ - ENUM_AA_STATE_T ePreviousState; - BOOLEAN fgIsTransition; - - - ASSERT(prStaRec); - if(!prStaRec) { - return; - } - - do { - -#if DBG - DBGLOG(SAA, STATE, ("TRANSITION: [%s] -> [%s]\n", - apucDebugAAState[prStaRec->eAuthAssocState], - apucDebugAAState[eNextState])); -#else - DBGLOG(SAA, STATE, ("[%d] TRANSITION: [%d] -> [%d]\n", - DBG_SAA_IDX, - prStaRec->eAuthAssocState, - eNextState)); -#endif - ePreviousState = prStaRec->eAuthAssocState; - - /* NOTE(Kevin): This is the only place to change the eAuthAssocState(except initial) */ - prStaRec->eAuthAssocState = eNextState; - - - fgIsTransition = (BOOLEAN)FALSE; - switch (prStaRec->eAuthAssocState) { - case AA_STATE_IDLE: - { - if (ePreviousState != prStaRec->eAuthAssocState) { /* Only trigger this event once */ - - if (prRetainedSwRfb) { - - if (saaFsmSendEventJoinComplete(prAdapter, - WLAN_STATUS_SUCCESS, - prStaRec, - prRetainedSwRfb) == WLAN_STATUS_SUCCESS) { - } - else { - eNextState = AA_STATE_RESOURCE; - fgIsTransition = TRUE; - } - } - else { - if (saaFsmSendEventJoinComplete(prAdapter, - WLAN_STATUS_FAILURE, - prStaRec, - NULL) == WLAN_STATUS_RESOURCES) { - eNextState = AA_STATE_RESOURCE; - fgIsTransition = TRUE; - } - } - - } - - /* Free allocated TCM memory */ - if (prStaRec->prChallengeText) { - cnmMemFree(prAdapter, prStaRec->prChallengeText); - prStaRec->prChallengeText = (P_IE_CHALLENGE_TEXT_T)NULL; - } - } - break; - - case SAA_STATE_SEND_AUTH1: - { - /* Do tasks in INIT STATE */ - if (prStaRec->ucTxAuthAssocRetryCount >= - prStaRec->ucTxAuthAssocRetryLimit) { - - /* Record the Status Code of Authentication Request */ - prStaRec->u2StatusCode = STATUS_CODE_AUTH_TIMEOUT; - - eNextState = AA_STATE_IDLE; - fgIsTransition = TRUE; - } - else { - prStaRec->ucTxAuthAssocRetryCount++; - - /* Update Station Record - Class 1 Flag */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - -#if !CFG_SUPPORT_AAA - if (authSendAuthFrame(prAdapter, - prStaRec, - AUTH_TRANSACTION_SEQ_1) != WLAN_STATUS_SUCCESS) -#else - if (authSendAuthFrame( - prAdapter, - prStaRec, - prStaRec->ucNetTypeIndex, - NULL, - AUTH_TRANSACTION_SEQ_1, - STATUS_CODE_RESERVED) != WLAN_STATUS_SUCCESS) -#endif /* CFG_SUPPORT_AAA */ - { - - cnmTimerInitTimer(prAdapter, - &prStaRec->rTxReqDoneOrRxRespTimer, - (PFN_MGMT_TIMEOUT_FUNC)saaFsmRunEventTxReqTimeOut, - (UINT_32)prStaRec); - - cnmTimerStartTimer(prAdapter, - &prStaRec->rTxReqDoneOrRxRespTimer, - TU_TO_MSEC(TX_AUTHENTICATION_RETRY_TIMEOUT_TU)); - } - } - } - break; - - case SAA_STATE_WAIT_AUTH2: - break; - - case SAA_STATE_SEND_AUTH3: - { - /* Do tasks in INIT STATE */ - if (prStaRec->ucTxAuthAssocRetryCount >= - prStaRec->ucTxAuthAssocRetryLimit) { - - /* Record the Status Code of Authentication Request */ - prStaRec->u2StatusCode = STATUS_CODE_AUTH_TIMEOUT; - - eNextState = AA_STATE_IDLE; - fgIsTransition = TRUE; - } - else { - prStaRec->ucTxAuthAssocRetryCount++; - -#if !CFG_SUPPORT_AAA - if (authSendAuthFrame(prAdapter, - prStaRec, - AUTH_TRANSACTION_SEQ_3) != WLAN_STATUS_SUCCESS) -#else - if (authSendAuthFrame(prAdapter, - prStaRec, - prStaRec->ucNetTypeIndex, - NULL, - AUTH_TRANSACTION_SEQ_3, - STATUS_CODE_RESERVED) != WLAN_STATUS_SUCCESS) -#endif /* CFG_SUPPORT_AAA */ - { - - cnmTimerInitTimer(prAdapter, - &prStaRec->rTxReqDoneOrRxRespTimer, - (PFN_MGMT_TIMEOUT_FUNC)saaFsmRunEventTxReqTimeOut, - (UINT_32)prStaRec); - - cnmTimerStartTimer(prAdapter, - &prStaRec->rTxReqDoneOrRxRespTimer, - TU_TO_MSEC(TX_AUTHENTICATION_RETRY_TIMEOUT_TU)); - } - } - } - break; - - case SAA_STATE_WAIT_AUTH4: - break; - - case SAA_STATE_SEND_ASSOC1: - /* Do tasks in INIT STATE */ - if (prStaRec->ucTxAuthAssocRetryCount >= - prStaRec->ucTxAuthAssocRetryLimit) { - - /* Record the Status Code of Authentication Request */ - prStaRec->u2StatusCode = STATUS_CODE_ASSOC_TIMEOUT; - - eNextState = AA_STATE_IDLE; - fgIsTransition = TRUE; - } - else { - prStaRec->ucTxAuthAssocRetryCount++; - - if (assocSendReAssocReqFrame(prAdapter, prStaRec) != WLAN_STATUS_SUCCESS) { - - cnmTimerInitTimer(prAdapter, - &prStaRec->rTxReqDoneOrRxRespTimer, - (PFN_MGMT_TIMEOUT_FUNC)saaFsmRunEventTxReqTimeOut, - (UINT_32)prStaRec); - - cnmTimerStartTimer(prAdapter, - &prStaRec->rTxReqDoneOrRxRespTimer, - TU_TO_MSEC(TX_ASSOCIATION_RETRY_TIMEOUT_TU)); - } - } - - break; - - case SAA_STATE_WAIT_ASSOC2: - break; - - case AA_STATE_RESOURCE: - /* TODO(Kevin) Can setup a timer and send message later */ - break; - - default: - DBGLOG(SAA, ERROR, ("Unknown AA STATE\n")); - ASSERT(0); - break; - } - - } - while (fgIsTransition); - - return; - -} /* end of saaFsmSteps() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will send Event to AIS/BOW/P2P -* -* @param[in] rJoinStatus To indicate JOIN success or failure. -* @param[in] prStaRec Pointer to the STA_RECORD_T -* @param[in] prSwRfb Pointer to the SW_RFB_T - -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -saaFsmSendEventJoinComplete ( - IN P_ADAPTER_T prAdapter, - IN WLAN_STATUS rJoinStatus, - IN P_STA_RECORD_T prStaRec, - IN P_SW_RFB_T prSwRfb - ) -{ - P_BSS_INFO_T prBssInfo; - - ASSERT(prStaRec); - if(!prStaRec) { - return WLAN_STATUS_INVALID_PACKET; - } - - /* Store limitation about 40Mhz bandwidth capability during association */ - if (prStaRec->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM) { - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]; - - if (rJoinStatus == WLAN_STATUS_SUCCESS) { - prBssInfo->fg40mBwAllowed = prBssInfo->fgAssoc40mBwAllowed; - } - prBssInfo->fgAssoc40mBwAllowed = FALSE; - } - - if(prStaRec->ucNetTypeIndex == NETWORK_TYPE_AIS_INDEX) { - P_MSG_SAA_FSM_COMP_T prSaaFsmCompMsg; - - prSaaFsmCompMsg = cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_SAA_FSM_COMP_T)); - if (!prSaaFsmCompMsg) { - return WLAN_STATUS_RESOURCES; - } - - prSaaFsmCompMsg->rMsgHdr.eMsgId = MID_SAA_AIS_JOIN_COMPLETE; - prSaaFsmCompMsg->ucSeqNum = prStaRec->ucAuthAssocReqSeqNum; - prSaaFsmCompMsg->rJoinStatus = rJoinStatus; - prSaaFsmCompMsg->prStaRec = prStaRec; - prSaaFsmCompMsg->prSwRfb = prSwRfb; - - /* NOTE(Kevin): Set to UNBUF for immediately JOIN complete */ - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prSaaFsmCompMsg, - MSG_SEND_METHOD_UNBUF); - - return WLAN_STATUS_SUCCESS; - } -#if CFG_ENABLE_WIFI_DIRECT - else if ((prAdapter->fgIsP2PRegistered) && - (IS_STA_IN_P2P(prStaRec))) { - P_MSG_SAA_FSM_COMP_T prSaaFsmCompMsg; - - prSaaFsmCompMsg = cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_SAA_FSM_COMP_T)); - if (!prSaaFsmCompMsg) { - return WLAN_STATUS_RESOURCES; - } - - prSaaFsmCompMsg->rMsgHdr.eMsgId = MID_SAA_P2P_JOIN_COMPLETE; - prSaaFsmCompMsg->ucSeqNum = prStaRec->ucAuthAssocReqSeqNum; - prSaaFsmCompMsg->rJoinStatus = rJoinStatus; - prSaaFsmCompMsg->prStaRec = prStaRec; - prSaaFsmCompMsg->prSwRfb = prSwRfb; - - /* NOTE(Kevin): Set to UNBUF for immediately JOIN complete */ - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prSaaFsmCompMsg, - MSG_SEND_METHOD_UNBUF); - - return WLAN_STATUS_SUCCESS; - } -#endif -#if CFG_ENABLE_BT_OVER_WIFI - else if(prStaRec->ucNetTypeIndex == NETWORK_TYPE_BOW_INDEX) { - //@TODO: BOW handler - - P_MSG_SAA_FSM_COMP_T prSaaFsmCompMsg; - - prSaaFsmCompMsg = cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_SAA_FSM_COMP_T)); - if (!prSaaFsmCompMsg) { - return WLAN_STATUS_RESOURCES; - } - - prSaaFsmCompMsg->rMsgHdr.eMsgId = MID_SAA_BOW_JOIN_COMPLETE; - prSaaFsmCompMsg->ucSeqNum = prStaRec->ucAuthAssocReqSeqNum; - prSaaFsmCompMsg->rJoinStatus = rJoinStatus; - prSaaFsmCompMsg->prStaRec = prStaRec; - prSaaFsmCompMsg->prSwRfb = prSwRfb; - - /* NOTE(Kevin): Set to UNBUF for immediately JOIN complete */ - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prSaaFsmCompMsg, - MSG_SEND_METHOD_UNBUF); - - return WLAN_STATUS_SUCCESS; - } -#endif - else { - ASSERT(0); - return WLAN_STATUS_FAILURE; - } - -} /* end of saaFsmSendEventJoinComplete() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will handle the Start Event to SAA FSM. -* -* @param[in] prMsgHdr Message of Join Request for a particular STA. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -saaFsmRunEventStart ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_SAA_FSM_START_T prSaaFsmStartMsg; - P_STA_RECORD_T prStaRec; - P_BSS_INFO_T prBssInfo; - - ASSERT(prAdapter); - ASSERT(prMsgHdr); - - prSaaFsmStartMsg = (P_MSG_SAA_FSM_START_T)prMsgHdr; - prStaRec = prSaaFsmStartMsg->prStaRec; - - if((!prStaRec) || (prStaRec->fgIsInUse == FALSE)) { - cnmMemFree(prAdapter, prMsgHdr); - return; - } - - ASSERT(prStaRec); - - DBGLOG(SAA, LOUD, ("EVENT-START: Trigger SAA FSM.\n")); - - /* record sequence number of request message */ - prStaRec->ucAuthAssocReqSeqNum = prSaaFsmStartMsg->ucSeqNum; - - cnmMemFree(prAdapter, prMsgHdr); - - //4 <1> Validation of SAA Start Event - if (!IS_AP_STA(prStaRec)) { - - DBGLOG(SAA, ERROR, ("EVENT-START: STA Type - %d was not supported.\n", prStaRec->eStaType)); - - /* Ignore the return value because don't care the prSwRfb */ - saaFsmSendEventJoinComplete(prAdapter, WLAN_STATUS_FAILURE, prStaRec, NULL); - - return; - } - - //4 <2> The previous JOIN process is not completed ? - if (prStaRec->eAuthAssocState != AA_STATE_IDLE) { - DBGLOG(SAA, ERROR, ("EVENT-START: Reentry of SAA Module.\n")); - prStaRec->eAuthAssocState = AA_STATE_IDLE; - } - - //4 <3> Reset Status Code and Time - /* Update Station Record - Status/Reason Code */ - prStaRec->u2StatusCode = STATUS_CODE_SUCCESSFUL; - - /* Update the record join time. */ - GET_CURRENT_SYSTIME(&prStaRec->rLastJoinTime); - - prStaRec->ucTxAuthAssocRetryCount = 0; - - if (prStaRec->prChallengeText) { - cnmMemFree(prAdapter, prStaRec->prChallengeText); - prStaRec->prChallengeText = (P_IE_CHALLENGE_TEXT_T)NULL; - } - - cnmTimerStopTimer(prAdapter, &prStaRec->rTxReqDoneOrRxRespTimer); - -#if CFG_PRIVACY_MIGRATION - //4 <4> Init the sec fsm - secFsmInit(prAdapter, prStaRec); -#endif - - //4 <5> Reset the STA STATE - /* Update Station Record - Class 1 Flag */ - /* NOTE(Kevin): Moved to AIS FSM for Reconnect issue - - * We won't deactivate the same STA_RECORD_T and then activate it again for the - * case of reconnection. - */ - //cnmStaRecChangeState(prStaRec, STA_STATE_1); - - //4 <6> Decide if this BSS 20/40M bandwidth is allowed - if (prStaRec->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM) { - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]; - - if ((prAdapter->rWifiVar.ucAvailablePhyTypeSet & PHY_TYPE_SET_802_11N) - && (prStaRec->ucPhyTypeSet & PHY_TYPE_SET_802_11N)) { - prBssInfo->fgAssoc40mBwAllowed = - cnmBss40mBwPermitted(prAdapter, prBssInfo->ucNetTypeIndex); - } - else { - prBssInfo->fgAssoc40mBwAllowed = FALSE; - } - DBGLOG(RLM, INFO, ("STA 40mAllowed=%d\n", prBssInfo->fgAssoc40mBwAllowed)); - } - - //4 <7> Trigger SAA FSM - saaFsmSteps(prAdapter, prStaRec, SAA_STATE_SEND_AUTH1, (P_SW_RFB_T)NULL); - - return; -} /* end of saaFsmRunEventStart() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will handle TxDone(Auth1/Auth3/AssocReq) Event of SAA FSM. -* -* @param[in] prMsduInfo Pointer to the MSDU_INFO_T. -* @param[in] rTxDoneStatus Return TX status of the Auth1/Auth3/AssocReq frame. -* -* @retval WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -saaFsmRunEventTxDone ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ) -{ - - P_STA_RECORD_T prStaRec; - ENUM_AA_STATE_T eNextState; - - - ASSERT(prMsduInfo); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - if(!prStaRec) { - return WLAN_STATUS_INVALID_PACKET; - } - - ASSERT(prStaRec); - - DBGLOG(SAA, LOUD, ("EVENT-TX DONE: Current Time = %ld\n", kalGetTimeTick())); - - eNextState = prStaRec->eAuthAssocState; - - switch (prStaRec->eAuthAssocState) { - case SAA_STATE_SEND_AUTH1: - { - /* Strictly check the outgoing frame is matched with current AA STATE */ - if (authCheckTxAuthFrame(prAdapter, - prMsduInfo, - AUTH_TRANSACTION_SEQ_1) != WLAN_STATUS_SUCCESS) { - break; - } - - if (rTxDoneStatus == TX_RESULT_SUCCESS) { - eNextState = SAA_STATE_WAIT_AUTH2; - - cnmTimerStopTimer(prAdapter, - &prStaRec->rTxReqDoneOrRxRespTimer); - - cnmTimerInitTimer(prAdapter, - &prStaRec->rTxReqDoneOrRxRespTimer, - (PFN_MGMT_TIMEOUT_FUNC)saaFsmRunEventRxRespTimeOut, - (UINT_32)prStaRec); - - cnmTimerStartTimer(prAdapter, - &prStaRec->rTxReqDoneOrRxRespTimer, - TU_TO_MSEC(DOT11_AUTHENTICATION_RESPONSE_TIMEOUT_TU)); - } - - /* if TX was successful, change to next state. - * if TX was failed, do retry if possible. - */ - saaFsmSteps(prAdapter, prStaRec, eNextState, (P_SW_RFB_T)NULL); - } - break; - - case SAA_STATE_SEND_AUTH3: - { - /* Strictly check the outgoing frame is matched with current JOIN STATE */ - if (authCheckTxAuthFrame(prAdapter, - prMsduInfo, - AUTH_TRANSACTION_SEQ_3) != WLAN_STATUS_SUCCESS) { - break; - } - - if (rTxDoneStatus == TX_RESULT_SUCCESS) { - eNextState = SAA_STATE_WAIT_AUTH4; - - cnmTimerStopTimer(prAdapter, - &prStaRec->rTxReqDoneOrRxRespTimer); - - cnmTimerInitTimer(prAdapter, - &prStaRec->rTxReqDoneOrRxRespTimer, - (PFN_MGMT_TIMEOUT_FUNC)saaFsmRunEventRxRespTimeOut, - (UINT_32)prStaRec); - - cnmTimerStartTimer(prAdapter, - &prStaRec->rTxReqDoneOrRxRespTimer, - TU_TO_MSEC(DOT11_AUTHENTICATION_RESPONSE_TIMEOUT_TU)); - } - - /* if TX was successful, change to next state. - * if TX was failed, do retry if possible. - */ - saaFsmSteps(prAdapter, prStaRec, eNextState, (P_SW_RFB_T)NULL); - } - break; - - case SAA_STATE_SEND_ASSOC1: - { - /* Strictly check the outgoing frame is matched with current SAA STATE */ - if (assocCheckTxReAssocReqFrame(prAdapter, prMsduInfo) != WLAN_STATUS_SUCCESS) { - break; - } - - if (rTxDoneStatus == TX_RESULT_SUCCESS) { - eNextState = SAA_STATE_WAIT_ASSOC2; - - cnmTimerStopTimer(prAdapter, &prStaRec->rTxReqDoneOrRxRespTimer); - - cnmTimerInitTimer(prAdapter, - &prStaRec->rTxReqDoneOrRxRespTimer, - (PFN_MGMT_TIMEOUT_FUNC)saaFsmRunEventRxRespTimeOut, - (UINT_32)prStaRec); - - cnmTimerStartTimer(prAdapter, - &(prStaRec->rTxReqDoneOrRxRespTimer), - TU_TO_MSEC(DOT11_ASSOCIATION_RESPONSE_TIMEOUT_TU)); - } - - /* if TX was successful, change to next state. - * if TX was failed, do retry if possible. - */ - saaFsmSteps(prAdapter, prStaRec, eNextState, (P_SW_RFB_T)NULL); - } - break; - - default: - break; /* Ignore other cases */ - } - - - return WLAN_STATUS_SUCCESS; - -} /* end of saaFsmRunEventTxDone() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will send Tx Request Timeout Event to SAA FSM. -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -saaFsmRunEventTxReqTimeOut ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ) -{ - ASSERT(prStaRec); - if(!prStaRec) { - return; - } - - DBGLOG(SAA, LOUD, ("EVENT-TIMER: TX REQ TIMEOUT, Current Time = %ld\n", kalGetTimeTick())); - - switch (prStaRec->eAuthAssocState) { - case SAA_STATE_SEND_AUTH1: - case SAA_STATE_SEND_AUTH3: - case SAA_STATE_SEND_ASSOC1: - saaFsmSteps(prAdapter, prStaRec, prStaRec->eAuthAssocState, (P_SW_RFB_T)NULL); - break; - - default: - return; - } - - return; -} /* end of saaFsmRunEventTxReqTimeOut() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will send Rx Response Timeout Event to SAA FSM. -* -* @param[in] prStaRec Pointer to the STA_RECORD_T -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -saaFsmRunEventRxRespTimeOut ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ) -{ - ENUM_AA_STATE_T eNextState; - - - DBGLOG(SAA, LOUD, ("EVENT-TIMER: RX RESP TIMEOUT, Current Time = %ld\n", kalGetTimeTick())); - - ASSERT(prStaRec); - if(!prStaRec) { - return; - } - - eNextState = prStaRec->eAuthAssocState; - - switch (prStaRec->eAuthAssocState) { - case SAA_STATE_WAIT_AUTH2: - /* Record the Status Code of Authentication Request */ - prStaRec->u2StatusCode = STATUS_CODE_AUTH_TIMEOUT; - - /* Pull back to earlier state to do retry */ - eNextState = SAA_STATE_SEND_AUTH1; - break; - - case SAA_STATE_WAIT_AUTH4: - /* Record the Status Code of Authentication Request */ - prStaRec->u2StatusCode = STATUS_CODE_AUTH_TIMEOUT; - - /* Pull back to earlier state to do retry */ - eNextState = SAA_STATE_SEND_AUTH3; - break; - - case SAA_STATE_WAIT_ASSOC2: - /* Record the Status Code of Authentication Request */ - prStaRec->u2StatusCode = STATUS_CODE_ASSOC_TIMEOUT; - - /* Pull back to earlier state to do retry */ - eNextState = SAA_STATE_SEND_ASSOC1; - break; - - default: - break; /* Ignore other cases */ - } - - - if (eNextState != prStaRec->eAuthAssocState) { - saaFsmSteps(prAdapter, prStaRec, eNextState, (P_SW_RFB_T)NULL); - } - - return; -} /* end of saaFsmRunEventRxRespTimeOut() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will process the Rx Auth Response Frame and then -* trigger SAA FSM. -* -* @param[in] prSwRfb Pointer to the SW_RFB_T structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -saaFsmRunEventRxAuth ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_STA_RECORD_T prStaRec; - UINT_16 u2StatusCode; - ENUM_AA_STATE_T eNextState; - - - ASSERT(prSwRfb); - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - - /* We should have the corresponding Sta Record. */ - if (!prStaRec) { - ASSERT(0); - return; - } - - if (!IS_AP_STA(prStaRec)) { - return; - } - - switch(prStaRec->eAuthAssocState) { - case SAA_STATE_SEND_AUTH1: - case SAA_STATE_WAIT_AUTH2: - /* Check if the incoming frame is what we are waiting for */ - if (authCheckRxAuthFrameStatus(prAdapter, - prSwRfb, - AUTH_TRANSACTION_SEQ_2, - &u2StatusCode) == WLAN_STATUS_SUCCESS) { - - cnmTimerStopTimer(prAdapter, &prStaRec->rTxReqDoneOrRxRespTimer); - - /* Record the Status Code of Authentication Request */ - prStaRec->u2StatusCode = u2StatusCode; - - if (u2StatusCode == STATUS_CODE_SUCCESSFUL) { - - authProcessRxAuth2_Auth4Frame(prAdapter, prSwRfb); - - if (prStaRec->ucAuthAlgNum == - (UINT_8)AUTH_ALGORITHM_NUM_SHARED_KEY) { - - eNextState = SAA_STATE_SEND_AUTH3; - } - else { - /* Update Station Record - Class 2 Flag */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_2); - - eNextState = SAA_STATE_SEND_ASSOC1; - } - } - else { - DBGLOG(SAA, INFO, ("Auth Req was rejected by ["MACSTR"], Status Code = %d\n", - MAC2STR(prStaRec->aucMacAddr), u2StatusCode)); - - eNextState = AA_STATE_IDLE; - } - - /* Reset Send Auth/(Re)Assoc Frame Count */ - prStaRec->ucTxAuthAssocRetryCount = 0; - - saaFsmSteps(prAdapter, prStaRec, eNextState, (P_SW_RFB_T)NULL); - } - break; - - case SAA_STATE_SEND_AUTH3: - case SAA_STATE_WAIT_AUTH4: - /* Check if the incoming frame is what we are waiting for */ - if (authCheckRxAuthFrameStatus(prAdapter, - prSwRfb, - AUTH_TRANSACTION_SEQ_4, - &u2StatusCode) == WLAN_STATUS_SUCCESS) { - - cnmTimerStopTimer(prAdapter, &prStaRec->rTxReqDoneOrRxRespTimer); - - /* Record the Status Code of Authentication Request */ - prStaRec->u2StatusCode = u2StatusCode; - - if (u2StatusCode == STATUS_CODE_SUCCESSFUL) { - - authProcessRxAuth2_Auth4Frame(prAdapter, prSwRfb); /* Add for 802.11r handling */ - - /* Update Station Record - Class 2 Flag */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_2); - - eNextState = SAA_STATE_SEND_ASSOC1; - } - else { - DBGLOG(SAA, INFO, ("Auth Req was rejected by ["MACSTR"], Status Code = %d\n", - MAC2STR(prStaRec->aucMacAddr), u2StatusCode)); - - eNextState = AA_STATE_IDLE; - } - - /* Reset Send Auth/(Re)Assoc Frame Count */ - prStaRec->ucTxAuthAssocRetryCount = 0; - - saaFsmSteps(prAdapter, prStaRec, eNextState, (P_SW_RFB_T)NULL); - } - break; - - default: - break; /* Ignore other cases */ - } - - return; -} /* end of saaFsmRunEventRxAuth() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will process the Rx (Re)Association Response Frame and then -* trigger SAA FSM. -* -* @param[in] prSwRfb Pointer to the SW_RFB_T structure. -* -* @retval WLAN_STATUS_SUCCESS if the status code was not success -* @retval WLAN_STATUS_BUFFER_RETAINED if the status code was success -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -saaFsmRunEventRxAssoc ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_STA_RECORD_T prStaRec; - UINT_16 u2StatusCode; - ENUM_AA_STATE_T eNextState; - P_SW_RFB_T prRetainedSwRfb = (P_SW_RFB_T)NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - - - ASSERT(prSwRfb); - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - - /* We should have the corresponding Sta Record. */ - if (!prStaRec) { - ASSERT(0); - return rStatus; - } - - if (!IS_AP_STA(prStaRec)) { - return rStatus; - } - - switch (prStaRec->eAuthAssocState) { - case SAA_STATE_SEND_ASSOC1: - case SAA_STATE_WAIT_ASSOC2: - /* TRUE if the incoming frame is what we are waiting for */ - if (assocCheckRxReAssocRspFrameStatus(prAdapter, - prSwRfb, - &u2StatusCode) == WLAN_STATUS_SUCCESS) { - - cnmTimerStopTimer(prAdapter, &prStaRec->rTxReqDoneOrRxRespTimer); - - - /* Record the Status Code of Authentication Request */ - prStaRec->u2StatusCode = u2StatusCode; - - if (u2StatusCode == STATUS_CODE_SUCCESSFUL) { - - /* Update Station Record - Class 3 Flag */ - /* NOTE(Kevin): Moved to AIS FSM for roaming issue - - * We should deactivate the STA_RECORD_T of previous AP before - * activate new one in Driver. - */ - //cnmStaRecChangeState(prStaRec, STA_STATE_3); - - prStaRec->ucJoinFailureCount = 0; // Clear history. - - prRetainedSwRfb = prSwRfb; - rStatus = WLAN_STATUS_PENDING; - } - else { - DBGLOG(SAA, INFO, ("Assoc Req was rejected by ["MACSTR"], Status Code = %d\n", - MAC2STR(prStaRec->aucMacAddr), u2StatusCode)); - } - - /* Reset Send Auth/(Re)Assoc Frame Count */ - prStaRec->ucTxAuthAssocRetryCount = 0; - - /* update RCPI */ - prStaRec->ucRCPI = prSwRfb->prHifRxHdr->ucRcpi; - - eNextState = AA_STATE_IDLE; - - saaFsmSteps(prAdapter, prStaRec, eNextState, prRetainedSwRfb); - } - break; - - default: - break; /* Ignore other cases */ - } - - return rStatus; - -} /* end of saaFsmRunEventRxAssoc() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will check the incoming Deauth Frame. -* -* @param[in] prSwRfb Pointer to the SW_RFB_T structure. -* -* @retval WLAN_STATUS_SUCCESS Always not retain deauthentication frames -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -saaFsmRunEventRxDeauth ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_STA_RECORD_T prStaRec; -#if DBG - P_WLAN_DEAUTH_FRAME_T prDeauthFrame; -#endif /* DBG */ - - - ASSERT(prSwRfb); - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - -#if DBG - prDeauthFrame = (P_WLAN_DEAUTH_FRAME_T) prSwRfb->pvHeader; - - DBGLOG(SAA, INFO, ("Rx Deauth frame from BSSID=["MACSTR"].\n", - MAC2STR(prDeauthFrame->aucBSSID))); -#endif /* DBG */ - - do { - - /* We should have the corresponding Sta Record. */ - if (!prStaRec) { - break; - } - - if (IS_STA_IN_AIS(prStaRec)) { - P_AIS_BSS_INFO_T prAisBssInfo; - - - if (!IS_AP_STA(prStaRec)) { - break; - } - - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - - if (prStaRec->ucStaState > STA_STATE_1) { - - /* Check if this is the AP we are associated or associating with */ - if (authProcessRxDeauthFrame(prSwRfb, - prStaRec->aucMacAddr, - &prStaRec->u2ReasonCode) == WLAN_STATUS_SUCCESS) { - - if (STA_STATE_3 == prStaRec->ucStaState) { - P_MSG_AIS_ABORT_T prAisAbortMsg; - - /* NOTE(Kevin): Change state immediately to avoid starvation of - * MSG buffer because of too many deauth frames before changing - * the STA state. - */ - cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1); - - prAisAbortMsg = (P_MSG_AIS_ABORT_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_AIS_ABORT_T)); - if (!prAisAbortMsg) { - break; - } - - prAisAbortMsg->rMsgHdr.eMsgId = MID_SAA_AIS_FSM_ABORT; - prAisAbortMsg->ucReasonOfDisconnect = DISCONNECT_REASON_CODE_DEAUTHENTICATED; - prAisAbortMsg->fgDelayIndication = FALSE; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prAisAbortMsg, - MSG_SEND_METHOD_BUF); - } - else { - - /* TODO(Kevin): Joining Abort */ - } - - } - - } - - } -#if CFG_ENABLE_WIFI_DIRECT - else if (prAdapter->fgIsP2PRegistered && IS_STA_IN_P2P(prStaRec)) { - /* TODO(Kevin) */ - p2pFsmRunEventRxDeauthentication(prAdapter, prStaRec, prSwRfb); - } -#endif -#if CFG_ENABLE_BT_OVER_WIFI - else if (IS_STA_IN_BOW(prStaRec)) { - bowRunEventRxDeAuth(prAdapter, prStaRec, prSwRfb); - } -#endif - else { - ASSERT(0); - } - - } while (FALSE); - - return WLAN_STATUS_SUCCESS; - -} /* end of saaFsmRunEventRxDeauth() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will check the incoming Disassociation Frame. -* -* @param[in] prSwRfb Pointer to the SW_RFB_T structure. -* -* @retval WLAN_STATUS_SUCCESS Always not retain disassociation frames -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -saaFsmRunEventRxDisassoc ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_STA_RECORD_T prStaRec; -#if DBG - P_WLAN_DISASSOC_FRAME_T prDisassocFrame; -#endif /* DBG */ - - - ASSERT(prSwRfb); - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - -#if DBG - prDisassocFrame = (P_WLAN_DISASSOC_FRAME_T) prSwRfb->pvHeader; - - DBGLOG(SAA, INFO, ("Rx Disassoc frame from BSSID=["MACSTR"].\n", - MAC2STR(prDisassocFrame->aucBSSID))); -#endif /* DBG */ - - do { - - /* We should have the corresponding Sta Record. */ - if (!prStaRec) { - break; - } - - if (IS_STA_IN_AIS(prStaRec)) { - P_AIS_BSS_INFO_T prAisBssInfo; - - - if (!IS_AP_STA(prStaRec)) { - break; - } - - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - - if (prStaRec->ucStaState > STA_STATE_1) { - - /* Check if this is the AP we are associated or associating with */ - if (assocProcessRxDisassocFrame(prAdapter, - prSwRfb, - prStaRec->aucMacAddr, - &prStaRec->u2ReasonCode) == WLAN_STATUS_SUCCESS) { - - if (STA_STATE_3 == prStaRec->ucStaState) { - P_MSG_AIS_ABORT_T prAisAbortMsg; - - prAisAbortMsg = (P_MSG_AIS_ABORT_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_AIS_ABORT_T)); - if (!prAisAbortMsg) { - break; - } - - prAisAbortMsg->rMsgHdr.eMsgId = MID_SAA_AIS_FSM_ABORT; - prAisAbortMsg->ucReasonOfDisconnect = DISCONNECT_REASON_CODE_DISASSOCIATED; - prAisAbortMsg->fgDelayIndication = FALSE; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prAisAbortMsg, - MSG_SEND_METHOD_BUF); - } - else { - - /* TODO(Kevin): Joining Abort */ - } - - } - - } - - } -#if CFG_ENABLE_WIFI_DIRECT - else if (prAdapter->fgIsP2PRegistered && IS_STA_IN_P2P(prStaRec)) { - /* TODO(Kevin) */ - p2pFsmRunEventRxDisassociation(prAdapter, prStaRec, prSwRfb); - } -#endif -#if CFG_ENABLE_BT_OVER_WIFI - else if (IS_STA_IN_BOW(prStaRec)) { - /* TODO(Kevin) */ - } -#endif - else { - ASSERT(0); - } - - } while (FALSE); - - return WLAN_STATUS_SUCCESS; - -} /* end of saaFsmRunEventRxDisassoc() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will handle the Abort Event to SAA FSM. -* -* @param[in] prMsgHdr Message of Abort Request for a particular STA. -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -saaFsmRunEventAbort ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_SAA_FSM_ABORT_T prSaaFsmAbortMsg; - P_STA_RECORD_T prStaRec; - - - ASSERT(prMsgHdr); - - prSaaFsmAbortMsg = (P_MSG_SAA_FSM_ABORT_T)prMsgHdr; - prStaRec = prSaaFsmAbortMsg->prStaRec; - - ASSERT(prStaRec); - if(!prStaRec) { - cnmMemFree(prAdapter, prMsgHdr); - return; - } - - DBGLOG(SAA, LOUD, ("EVENT-ABORT: Stop SAA FSM.\n")); - - cnmMemFree(prAdapter, prMsgHdr); - - - /* Reset Send Auth/(Re)Assoc Frame Count */ - prStaRec->ucTxAuthAssocRetryCount = 0; - - /* Cancel JOIN relative Timer */ - cnmTimerStopTimer(prAdapter, &prStaRec->rTxReqDoneOrRxRespTimer); - - if (prStaRec->eAuthAssocState != AA_STATE_IDLE) { -#if DBG - DBGLOG(SAA, LOUD, ("EVENT-ABORT: Previous Auth/Assoc State == %s.\n", - apucDebugAAState[prStaRec->eAuthAssocState])); -#else - DBGLOG(SAA, LOUD, ("EVENT-ABORT: Previous Auth/Assoc State == %d.\n", - prStaRec->eAuthAssocState)); -#endif - } - -#if 0 - /* For the Auth/Assoc State to IDLE */ - prStaRec->eAuthAssocState = AA_STATE_IDLE; -#else - /* Free this StaRec */ - cnmStaRecFree(prAdapter, prStaRec, FALSE); -#endif - - return; -} /* end of saaFsmRunEventAbort() */ - - -/* TODO(Kevin): following code will be modified and move to AIS FSM */ -#if 0 -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will send Join Timeout Event to JOIN FSM. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* -* \retval WLAN_STATUS_FAILURE Fail because of Join Timeout -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -joinFsmRunEventJoinTimeOut ( - IN P_ADAPTER_T prAdapter - ) -{ - P_JOIN_INFO_T prJoinInfo; - P_STA_RECORD_T prStaRec; - - DEBUGFUNC("joinFsmRunEventJoinTimeOut"); - - - ASSERT(prAdapter); - prJoinInfo = &prAdapter->rJoinInfo; - - DBGLOG(JOIN, EVENT, ("JOIN EVENT: JOIN TIMEOUT\n")); - - /* Get a Station Record if possible, TA == BSSID for AP */ - prStaRec = staRecGetStaRecordByAddr(prAdapter, - prJoinInfo->prBssDesc->aucBSSID); - - /* We have renew this Sta Record when in JOIN_STATE_INIT */ - ASSERT(prStaRec); - - /* Record the Status Code of Authentication Request */ - prStaRec->u2StatusCode = STATUS_CODE_JOIN_TIMEOUT; - - /* Increase Failure Count */ - prStaRec->ucJoinFailureCount++; - - /* Reset Send Auth/(Re)Assoc Frame Count */ - prJoinInfo->ucTxAuthAssocRetryCount = 0; - - /* Cancel other JOIN relative Timer */ - ARB_CANCEL_TIMER(prAdapter, - prJoinInfo->rTxRequestTimer); - - ARB_CANCEL_TIMER(prAdapter, - prJoinInfo->rRxResponseTimer); - - /* Restore original setting from current BSS_INFO_T */ - if (prAdapter->eConnectionState == MEDIA_STATE_CONNECTED) { - joinAdoptParametersFromCurrentBss(prAdapter); - } - - /* Pull back to IDLE */ - joinFsmSteps(prAdapter, JOIN_STATE_IDLE); - - return WLAN_STATUS_FAILURE; - -} /* end of joinFsmRunEventJoinTimeOut() */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will adopt the parameters from Peer BSS. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -joinAdoptParametersFromPeerBss ( - IN P_ADAPTER_T prAdapter - ) -{ - P_JOIN_INFO_T prJoinInfo; - P_BSS_DESC_T prBssDesc; - - DEBUGFUNC("joinAdoptParametersFromPeerBss"); - - - ASSERT(prAdapter); - prJoinInfo = &prAdapter->rJoinInfo; - prBssDesc = prJoinInfo->prBssDesc; - - //4 <1> Adopt Peer BSS' PHY TYPE - prAdapter->eCurrentPhyType = prBssDesc->ePhyType; - - DBGLOG(JOIN, INFO, ("Target BSS[%s]'s PhyType = %s\n", - prBssDesc->aucSSID, (prBssDesc->ePhyType == PHY_TYPE_ERP_INDEX) ? "ERP" : "HR_DSSS")); - - - //4 <2> Adopt Peer BSS' Frequency(Band/Channel) - DBGLOG(JOIN, INFO, ("Target BSS's Channel = %d, Band = %d\n", - prBssDesc->ucChannelNum, prBssDesc->eBand)); - - nicSwitchChannel(prAdapter, - prBssDesc->eBand, - prBssDesc->ucChannelNum, - 10); - - prJoinInfo->fgIsParameterAdopted = TRUE; - - return; -} /* end of joinAdoptParametersFromPeerBss() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will adopt the parameters from current associated BSS. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -joinAdoptParametersFromCurrentBss ( - IN P_ADAPTER_T prAdapter - ) -{ - //P_JOIN_INFO_T prJoinInfo = &prAdapter->rJoinInfo; - P_BSS_INFO_T prBssInfo; - - - ASSERT(prAdapter); - prBssInfo = &prAdapter->rBssInfo; - - //4 <1> Adopt current BSS' PHY TYPE - prAdapter->eCurrentPhyType = prBssInfo->ePhyType; - - //4 <2> Adopt current BSS' Frequency(Band/Channel) - DBGLOG(JOIN, INFO, ("Current BSS's Channel = %d, Band = %d\n", - prBssInfo->ucChnl, prBssInfo->eBand)); - - nicSwitchChannel(prAdapter, - prBssInfo->eBand, - prBssInfo->ucChnl, - 10); - return; -} /* end of joinAdoptParametersFromCurrentBss() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will update all the SW variables and HW MCR registers after -* the association with target BSS. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -joinComplete ( - IN P_ADAPTER_T prAdapter - ) -{ - P_JOIN_INFO_T prJoinInfo; - P_BSS_DESC_T prBssDesc; - P_PEER_BSS_INFO_T prPeerBssInfo; - P_BSS_INFO_T prBssInfo; - P_CONNECTION_SETTINGS_T prConnSettings; - P_STA_RECORD_T prStaRec; - P_TX_CTRL_T prTxCtrl; -#if CFG_SUPPORT_802_11D - P_IE_COUNTRY_T prIECountry; -#endif - - DEBUGFUNC("joinComplete"); - - - ASSERT(prAdapter); - prJoinInfo = &prAdapter->rJoinInfo; - prBssDesc = prJoinInfo->prBssDesc; - prPeerBssInfo = &prAdapter->rPeerBssInfo; - prBssInfo = &prAdapter->rBssInfo; - prConnSettings = &prAdapter->rConnSettings; - prTxCtrl = &prAdapter->rTxCtrl; - -//4 <1> Update Connecting & Connected Flag of BSS_DESC_T. - /* Remove previous AP's Connection Flags if have */ - scanRemoveConnectionFlagOfBssDescByBssid(prAdapter, prBssInfo->aucBSSID); - - prBssDesc->fgIsConnected = TRUE; /* Mask as Connected */ - - if (prBssDesc->fgIsHiddenSSID) { - /* NOTE(Kevin): This is for the case of Passive Scan and the target BSS didn't - * broadcast SSID on its Beacon Frame. - */ - COPY_SSID(prBssDesc->aucSSID, - prBssDesc->ucSSIDLen, - prAdapter->rConnSettings.aucSSID, - prAdapter->rConnSettings.ucSSIDLen); - - if (prBssDesc->ucSSIDLen) { - prBssDesc->fgIsHiddenSSID = FALSE; - } -#if DBG - else { - ASSERT(0); - } -#endif /* DBG */ - - DBGLOG(JOIN, INFO, ("Hidden SSID! - Update SSID : %s\n", prBssDesc->aucSSID)); - } - - -//4 <2> Update BSS_INFO_T from BSS_DESC_T - //4 <2.A> PHY Type - prBssInfo->ePhyType = prBssDesc->ePhyType; - - //4 <2.B> BSS Type - prBssInfo->eBSSType = BSS_TYPE_INFRASTRUCTURE; - - //4 <2.C> BSSID - COPY_MAC_ADDR(prBssInfo->aucBSSID, prBssDesc->aucBSSID); - - DBGLOG(JOIN, INFO, ("JOIN to BSSID: ["MACSTR"]\n", MAC2STR(prBssDesc->aucBSSID))); - - - //4 <2.D> SSID - COPY_SSID(prBssInfo->aucSSID, - prBssInfo->ucSSIDLen, - prBssDesc->aucSSID, - prBssDesc->ucSSIDLen); - - //4 <2.E> Channel / Band information. - prBssInfo->eBand = prBssDesc->eBand; - prBssInfo->ucChnl = prBssDesc->ucChannelNum; - - //4 <2.F> RSN/WPA information. - secFsmRunEventStart(prAdapter); - prBssInfo->u4RsnSelectedPairwiseCipher = prBssDesc->u4RsnSelectedPairwiseCipher; - prBssInfo->u4RsnSelectedGroupCipher = prBssDesc->u4RsnSelectedGroupCipher; - prBssInfo->u4RsnSelectedAKMSuite = prBssDesc->u4RsnSelectedAKMSuite; - - if (secRsnKeyHandshakeEnabled()) { - prBssInfo->fgIsWPAorWPA2Enabled = TRUE; - } - else { - prBssInfo->fgIsWPAorWPA2Enabled = FALSE; - } - - //4 <2.G> Beacon interval. - prBssInfo->u2BeaconInterval = prBssDesc->u2BeaconInterval; - - //4 <2.H> DTIM period. - prBssInfo->ucDtimPeriod = prBssDesc->ucDTIMPeriod; - - //4 <2.I> ERP Information - if ((prBssInfo->ePhyType == PHY_TYPE_ERP_INDEX) && // Our BSS's PHY_TYPE is ERP now. - (prBssDesc->fgIsERPPresent)) { - - prBssInfo->fgIsERPPresent = TRUE; - prBssInfo->ucERP = prBssDesc->ucERP; /* Save the ERP for later check */ - } - else { /* Some AP, may send ProbeResp without ERP IE. Thus prBssDesc->fgIsERPPresent is FALSE. */ - prBssInfo->fgIsERPPresent = FALSE; - prBssInfo->ucERP = 0; - } - -#if CFG_SUPPORT_802_11D - //4 <2.J> Country inforamtion of the associated AP - if (prConnSettings->fgMultiDomainCapabilityEnabled) { - DOMAIN_INFO_ENTRY rDomainInfo; - if (domainGetDomainInfoByScanResult(prAdapter, &rDomainInfo)) { - if (prBssDesc->prIECountry) { - prIECountry = prBssDesc->prIECountry; - - domainParseCountryInfoElem(prIECountry, &prBssInfo->rDomainInfo); - - /* use the domain get from the BSS info */ - prBssInfo->fgIsCountryInfoPresent = TRUE; - nicSetupOpChnlList(prAdapter, prBssInfo->rDomainInfo.u2CountryCode, FALSE); - } else { - /* use the domain get from the scan result */ - prBssInfo->fgIsCountryInfoPresent = TRUE; - nicSetupOpChnlList(prAdapter, rDomainInfo.u2CountryCode, FALSE); - } - } - } -#endif - - //4 <2.K> Signal Power of the associated AP - prBssInfo->rRcpi = prBssDesc->rRcpi; - prBssInfo->rRssi = RCPI_TO_dBm(prBssInfo->rRcpi); - GET_CURRENT_SYSTIME(&prBssInfo->rRssiLastUpdateTime); - - //4 <2.L> Capability Field of the associated AP - prBssInfo->u2CapInfo = prBssDesc->u2CapInfo; - - DBGLOG(JOIN, INFO, ("prBssInfo-> fgIsERPPresent = %d, ucERP = %02x, rRcpi = %d, rRssi = %ld\n", - prBssInfo->fgIsERPPresent, prBssInfo->ucERP, prBssInfo->rRcpi, prBssInfo->rRssi)); - - -//4 <3> Update BSS_INFO_T from PEER_BSS_INFO_T & NIC RATE FUNC - //4 <3.A> Association ID - prBssInfo->u2AssocId = prPeerBssInfo->u2AssocId; - - //4 <3.B> WMM Infomation - if (prAdapter->fgIsEnableWMM && - (prPeerBssInfo->rWmmInfo.ucWmmFlag & WMM_FLAG_SUPPORT_WMM)) { - - prBssInfo->fgIsWmmAssoc = TRUE; - prTxCtrl->rTxQForVoipAccess = TXQ_AC3; - - qosWmmInfoInit(&prBssInfo->rWmmInfo, (prBssInfo->ePhyType == PHY_TYPE_HR_DSSS_INDEX) ? TRUE : FALSE); - - if (prPeerBssInfo->rWmmInfo.ucWmmFlag & WMM_FLAG_AC_PARAM_PRESENT) { - kalMemCopy(&prBssInfo->rWmmInfo, - &prPeerBssInfo->rWmmInfo, - sizeof(WMM_INFO_T)); - } - else { - kalMemCopy(&prBssInfo->rWmmInfo, - &prPeerBssInfo->rWmmInfo, - sizeof(WMM_INFO_T) - sizeof(prPeerBssInfo->rWmmInfo.arWmmAcParams)); - } - } - else { - prBssInfo->fgIsWmmAssoc = FALSE; - prTxCtrl->rTxQForVoipAccess = TXQ_AC1; - - kalMemZero(&prBssInfo->rWmmInfo, sizeof(WMM_INFO_T)); - } - - - //4 <3.C> Operational Rate Set & BSS Basic Rate Set - prBssInfo->u2OperationalRateSet = prPeerBssInfo->u2OperationalRateSet; - prBssInfo->u2BSSBasicRateSet = prPeerBssInfo->u2BSSBasicRateSet; - - - //4 <3.D> Short Preamble - if (prBssInfo->fgIsERPPresent) { - - /* NOTE(Kevin 2007/12/24): Truth Table. - * Short Preamble Bit in - * Final Driver Setting(Short) - * TRUE FALSE FALSE FALSE(shouldn't have such case, use the AssocResp) - * TRUE FALSE TRUE FALSE - * FALSE FALSE FALSE FALSE(shouldn't have such case, use the AssocResp) - * FALSE FALSE TRUE FALSE - * TRUE TRUE FALSE TRUE(follow ERP) - * TRUE TRUE TRUE FALSE(follow ERP) - * FALSE TRUE FALSE FALSE(shouldn't have such case, and we should set to FALSE) - * FALSE TRUE TRUE FALSE(we should set to FALSE) - */ - if ((prPeerBssInfo->fgIsShortPreambleAllowed) && - ((prConnSettings->ePreambleType == PREAMBLE_TYPE_SHORT) || /* Short Preamble Option Enable is TRUE */ - ((prConnSettings->ePreambleType == PREAMBLE_TYPE_AUTO) && - (prBssDesc->u2CapInfo & CAP_INFO_SHORT_PREAMBLE)))) { - - prBssInfo->fgIsShortPreambleAllowed = TRUE; - - if (prBssInfo->ucERP & ERP_INFO_BARKER_PREAMBLE_MODE) { - prBssInfo->fgUseShortPreamble = FALSE; - } - else { - prBssInfo->fgUseShortPreamble = TRUE; - } - } - else { - prBssInfo->fgIsShortPreambleAllowed = FALSE; - prBssInfo->fgUseShortPreamble = FALSE; - } - } - else { - /* NOTE(Kevin 2007/12/24): Truth Table. - * Short Preamble Bit in - * Final Driver Setting(Short) - * TRUE FALSE FALSE - * FALSE FALSE FALSE - * TRUE TRUE TRUE - * FALSE TRUE(status success) TRUE - * --> Honor the result of prPeerBssInfo. - */ - - prBssInfo->fgIsShortPreambleAllowed = prBssInfo->fgUseShortPreamble = - prPeerBssInfo->fgIsShortPreambleAllowed; - } - - DBGLOG(JOIN, INFO, ("prBssInfo->fgIsShortPreambleAllowed = %d, prBssInfo->fgUseShortPreamble = %d\n", - prBssInfo->fgIsShortPreambleAllowed, prBssInfo->fgUseShortPreamble)); - - - //4 <3.E> Short Slot Time - prBssInfo->fgUseShortSlotTime = - prPeerBssInfo->fgUseShortSlotTime; /* AP support Short Slot Time */ - - DBGLOG(JOIN, INFO, ("prBssInfo->fgUseShortSlotTime = %d\n", - prBssInfo->fgUseShortSlotTime)); - - nicSetSlotTime(prAdapter, - prBssInfo->ePhyType, - ((prConnSettings->fgIsShortSlotTimeOptionEnable && - prBssInfo->fgUseShortSlotTime) ? TRUE : FALSE)); - - - //4 <3.F> Update Tx Rate for Control Frame - bssUpdateTxRateForControlFrame(prAdapter); - - - //4 <3.G> Save the available Auth Types during Roaming (Design for Fast BSS Transition). - //if (prAdapter->fgIsEnableRoaming) /* NOTE(Kevin): Always prepare info for roaming */ - { - - if (prJoinInfo->ucCurrAuthAlgNum == AUTH_ALGORITHM_NUM_OPEN_SYSTEM) { - prJoinInfo->ucRoamingAuthTypes |= AUTH_TYPE_OPEN_SYSTEM; - } - else if (prJoinInfo->ucCurrAuthAlgNum == AUTH_ALGORITHM_NUM_SHARED_KEY) { - prJoinInfo->ucRoamingAuthTypes |= AUTH_TYPE_SHARED_KEY; - } - - prBssInfo->ucRoamingAuthTypes = prJoinInfo->ucRoamingAuthTypes; - - - /* Set the stable time of the associated BSS. We won't do roaming decision - * during the stable time. - */ - SET_EXPIRATION_TIME(prBssInfo->rRoamingStableExpirationTime, - SEC_TO_SYSTIME(ROAMING_STABLE_TIMEOUT_SEC)); - } - - - //4 <3.H> Update Parameter for TX Fragmentation Threshold -#if CFG_TX_FRAGMENT - txFragInfoUpdate(prAdapter); -#endif /* CFG_TX_FRAGMENT */ - - -//4 <4> Update STA_RECORD_T - /* Get a Station Record if possible */ - prStaRec = staRecGetStaRecordByAddr(prAdapter, - prBssDesc->aucBSSID); - - if (prStaRec) { - UINT_16 u2OperationalRateSet, u2DesiredRateSet; - - //4 <4.A> Desired Rate Set - u2OperationalRateSet = (rPhyAttributes[prBssInfo->ePhyType].u2SupportedRateSet & - prBssInfo->u2OperationalRateSet); - - u2DesiredRateSet = (u2OperationalRateSet & prConnSettings->u2DesiredRateSet); - if (u2DesiredRateSet) { - prStaRec->u2DesiredRateSet = u2DesiredRateSet; - } - else { - /* For Error Handling - The Desired Rate Set is not covered in Operational Rate Set. */ - prStaRec->u2DesiredRateSet = u2OperationalRateSet; - } - - /* Try to set the best initial rate for this entry */ - if (!rateGetBestInitialRateIndex(prStaRec->u2DesiredRateSet, - prStaRec->rRcpi, - &prStaRec->ucCurrRate1Index)) { - - if (!rateGetLowestRateIndexFromRateSet(prStaRec->u2DesiredRateSet, - &prStaRec->ucCurrRate1Index)) { - ASSERT(0); - } - } - - DBGLOG(JOIN, INFO, ("prStaRec->ucCurrRate1Index = %d\n", - prStaRec->ucCurrRate1Index)); - - //4 <4.B> Preamble Mode - prStaRec->fgIsShortPreambleOptionEnable = - prBssInfo->fgUseShortPreamble; - - //4 <4.C> QoS Flag - prStaRec->fgIsQoS = prBssInfo->fgIsWmmAssoc; - } -#if DBG - else { - ASSERT(0); - } -#endif /* DBG */ - - -//4 <5> Update NIC - //4 <5.A> Update BSSID & Operation Mode - nicSetupBSS(prAdapter, prBssInfo); - - //4 <5.B> Update WLAN Table. - if (nicSetHwBySta(prAdapter, prStaRec) == FALSE) { - ASSERT(FALSE); - } - - //4 <5.C> Update Desired Rate Set for BT. -#if CFG_TX_FRAGMENT - if (prConnSettings->fgIsEnableTxAutoFragmentForBT) { - txRateSetInitForBT(prAdapter, prStaRec); - } -#endif /* CFG_TX_FRAGMENT */ - - //4 <5.D> TX AC Parameter and TX/RX Queue Control - if (prBssInfo->fgIsWmmAssoc) { - -#if CFG_TX_AGGREGATE_HW_FIFO - nicTxAggregateTXQ(prAdapter, FALSE); -#endif /* CFG_TX_AGGREGATE_HW_FIFO */ - - qosUpdateWMMParametersAndAssignAllowedACI(prAdapter, &prBssInfo->rWmmInfo); - } - else { - -#if CFG_TX_AGGREGATE_HW_FIFO - nicTxAggregateTXQ(prAdapter, TRUE); -#endif /* CFG_TX_AGGREGATE_HW_FIFO */ - - nicTxNonQoSAssignDefaultAdmittedTXQ(prAdapter); - - nicTxNonQoSUpdateTXQParameters(prAdapter, - prBssInfo->ePhyType); - } - -#if CFG_TX_STOP_WRITE_TX_FIFO_UNTIL_JOIN - { - prTxCtrl->fgBlockTxDuringJoin = FALSE; - - #if !CFG_TX_AGGREGATE_HW_FIFO /* TX FIFO AGGREGATE already do flush once */ - nicTxFlushStopQueues(prAdapter, (UINT_8)TXQ_DATA_MASK, (UINT_8)NULL); - #endif /* CFG_TX_AGGREGATE_HW_FIFO */ - - nicTxRetransmitOfSendWaitQue(prAdapter); - - if (prTxCtrl->fgIsPacketInOsSendQueue) { - nicTxRetransmitOfOsSendQue(prAdapter); - } - - #if CFG_SDIO_TX_ENHANCE - halTxLeftClusteredMpdu(prAdapter); - #endif /* CFG_SDIO_TX_ENHANCE */ - - } -#endif /* CFG_TX_STOP_WRITE_TX_FIFO_UNTIL_JOIN */ - - -//4 <6> Setup CONNECTION flag. - prAdapter->eConnectionState = MEDIA_STATE_CONNECTED; - prAdapter->eConnectionStateIndicated = MEDIA_STATE_CONNECTED; - - if (prJoinInfo->fgIsReAssoc) { - prAdapter->fgBypassPortCtrlForRoaming = TRUE; - } - else { - prAdapter->fgBypassPortCtrlForRoaming = FALSE; - } - - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_CONNECT, - (PVOID)NULL, - 0); - - return; -} /* end of joinComplete() */ -#endif - diff --git a/drivers/net/wireless/mt5931/mgmt/scan.c b/drivers/net/wireless/mt5931/mgmt/scan.c deleted file mode 100755 index 0e89b493497a..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/scan.c +++ /dev/null @@ -1,3025 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/scan.c#3 $ -*/ - -/*! \file "scan.c" - \brief This file defines the scan profile and the processing function of - scan result for SCAN Module. - - The SCAN Profile selection is part of SCAN MODULE and responsible for defining - SCAN Parameters - e.g. MIN_CHANNEL_TIME, number of scan channels. - In this file we also define the process of SCAN Result including adding, searching - and removing SCAN record from the list. -*/ - - - -/* -** $Log: scan.c $ - * - * 07 17 2012 yuche.tsai - * NULL - * Let netdev bring up. - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 06 25 2012 cp.wu - * [WCXRP00001258] [MT6620][MT5931][MT6628][Driver] Do not use stale scan result for deciding connection target - * drop off scan result which is older than 5 seconds when choosing which BSS to join - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 01 16 2012 cp.wu - * [WCXRP00001169] [MT6620 Wi-Fi][Driver] API and behavior modification for preferred band configuration with corresponding network configuration - * correct typo. - * - * 01 16 2012 cp.wu - * [MT6620 Wi-Fi][Driver] API and behavior modification for preferred band configuration with corresponding network configuration - * add wlanSetPreferBandByNetwork() for glue layer to invoke for setting preferred band configuration corresponding to network type. - * - * 12 05 2011 cp.wu - * [WCXRP00001131] [MT6620 Wi-Fi][Driver][AIS] Implement connect-by-BSSID path - * add CONNECT_BY_BSSID policy - * - * 11 23 2011 cp.wu - * [WCXRP00001123] [MT6620 Wi-Fi][Driver] Add option to disable beacon content change detection - * add compile option to disable beacon content change detection. - * - * 11 04 2011 cp.wu - * [WCXRP00001085] [MT6628 Wi-Fi][Driver] deprecate old BSS-DESC if timestamp is reset with received beacon/probe response frames - * deprecate old BSS-DESC when timestamp in received beacon/probe response frames showed a smaller value than before - * - * 10 11 2011 cm.chang - * [WCXRP00001031] [All Wi-Fi][Driver] Check HT IE length to avoid wrong SCO parameter - * Ignore HT OP IE if its length field is not valid - * - * 09 30 2011 cp.wu - * [WCXRP00001021] [MT5931][Driver] Correct scan result generation for conversion between BSS type and operation mode - * correct type casting issue. - * - * 08 23 2011 yuche.tsai - * NULL - * Fix multicast address list issue. - * - * 08 11 2011 cp.wu - * [WCXRP00000830] [MT6620 Wi-Fi][Firmware] Use MDRDY counter to detect empty channel for shortening scan time - * sparse channel detection: - * driver: collect sparse channel information with scan-done event - * - * 08 10 2011 cp.wu - * [WCXRP00000922] [MT6620 Wi-Fi][Driver] traverse whole BSS-DESC list for removing - * traverse whole BSS-DESC list because BSSID is not unique anymore. - * - * 07 12 2011 cp.wu - * [WCXRP00000815] [MT6620 Wi-Fi][Driver] allow single BSSID with multiple SSID settings to work around some tricky AP which use space character as hidden SSID - * for multiple BSS descriptior detecting issue: - * 1) check BSSID for infrastructure network - * 2) check SSID for AdHoc network - * - * 07 12 2011 cp.wu - * [WCXRP00000815] [MT6620 Wi-Fi][Driver] allow single BSSID with multiple SSID settings to work around some tricky AP which use space character as hidden SSID - * check for BSSID for beacons used to update DTIM - * - * 07 12 2011 cp.wu - * [WCXRP00000815] [MT6620 Wi-Fi][Driver] allow single BSSID with multiple SSID settings to work around some tricky AP which use space character as hidden SSID - * do not check BSS descriptor for connected flag due to linksys's hidden SSID will use another BSS descriptor and never connected - * - * 07 11 2011 cp.wu - * [WCXRP00000815] [MT6620 Wi-Fi][Driver] allow single BSSID with multiple SSID settings to work around some tricky AP which use space character as hidden SSID - * just pass beacons with the same BSSID. - * - * 07 11 2011 wh.su - * [WCXRP00000849] [MT6620 Wi-Fi][Driver] Remove some of the WAPI define for make sure the value is initialize, for customer not enable WAPI - * For make sure wapi initial value is set. - * - * 06 28 2011 cp.wu - * [WCXRP00000815] [MT6620 Wi-Fi][Driver] allow single BSSID with multiple SSID settings to work around some tricky AP which use space character as hidden SSID - * Do not check for SSID as beacon content change due to the existence of single BSSID with multiple SSID AP configuration - * - * 06 27 2011 cp.wu - * [WCXRP00000815] [MT6620 Wi-Fi][Driver] allow single BSSID with multiple SSID settings to work around some tricky AP which use space character as hidden SSID - * 1. correct logic - * 2. replace only BSS-DESC which doesn't have a valid SSID. - * - * 06 27 2011 cp.wu - * [WCXRP00000815] [MT6620 Wi-Fi][Driver] allow single BSSID with multiple SSID settings to work around some tricky AP which use space character as hidden SSID - * remove unused temporal variable reference. - * - * 06 27 2011 cp.wu - * [WCXRP00000815] [MT6620 Wi-Fi][Driver] allow single BSSID with multiple SSID settings to work around some tricky AP which use space character as hidden SSID - * allow to have a single BSSID with multiple SSID to be presented in scanning result - * - * 06 02 2011 cp.wu - * [WCXRP00000757] [MT6620 Wi-Fi][Driver][SCN] take use of RLM API to filter out BSS in disallowed channels - * filter out BSS in disallowed channel by - * 1. do not add to scan result array if BSS is at disallowed channel - * 2. do not allow to search for BSS-DESC in disallowed channels - * - * 05 02 2011 cm.chang - * [WCXRP00000691] [MT6620 Wi-Fi][Driver] Workaround about AP's wrong HT capability IE to have wrong channel number - * Refine range of valid channel number - * - * 05 02 2011 cp.wu - * [MT6620 Wi-Fi][Driver] Take parsed result for channel information instead of hardware channel number passed from firmware domain - * take parsed result for generating scanning result with channel information. - * - * 05 02 2011 cm.chang - * [WCXRP00000691] [MT6620 Wi-Fi][Driver] Workaround about AP's wrong HT capability IE to have wrong channel number - * Check if channel is valided before record ing BSS channel - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 04 14 2011 cm.chang - * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency - * . - * - * 04 12 2011 eddie.chen - * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma - * Fix the sta index in processing security frame - * Simple flow control for TC4 to avoid mgt frames for PS STA to occupy the TC4 - * Add debug message. - * - * 03 25 2011 yuche.tsai - * NULL - * Always update Bss Type, for Bss Type for P2P Network is changing every time. - * - * 03 23 2011 yuche.tsai - * NULL - * Fix concurrent issue when AIS scan result would overwrite p2p scan result. - * - * 03 14 2011 cp.wu - * [WCXRP00000535] [MT6620 Wi-Fi][Driver] Fixed channel operation when AIS and Tethering are operating concurrently - * filtering out other BSS coming from adjacent channels - * - * 03 11 2011 chinglan.wang - * [WCXRP00000537] [MT6620 Wi-Fi][Driver] Can not connect to 802.11b/g/n mixed AP with WEP security. - * . - * - * 03 11 2011 cp.wu - * [WCXRP00000535] [MT6620 Wi-Fi][Driver] Fixed channel operation when AIS and Tethering are operating concurrently - * When fixed channel operation is necessary, AIS-FSM would scan and only connect for BSS on the specific channel - * - * 02 24 2011 cp.wu - * [WCXRP00000490] [MT6620 Wi-Fi][Driver][Win32] modify kalMsleep() implementation because NdisMSleep() won't sleep long enough for specified interval such as 500ms - * implement beacon change detection by checking SSID and supported rate. - * - * 02 22 2011 yuche.tsai - * [WCXRP00000480] [Volunteer Patch][MT6620][Driver] WCS IE format issue - * Fix WSC big endian issue. - * - * 02 21 2011 terry.wu - * [WCXRP00000476] [MT6620 Wi-Fi][Driver] Clean P2P scan list while removing P2P - * Clean P2P scan list while removing P2P. - * - * 01 27 2011 yuche.tsai - * [WCXRP00000399] [Volunteer Patch][MT6620/MT5931][Driver] Fix scan side effect after P2P module separate. - * Fix scan channel extension issue when p2p module is not registered. - * - * 01 26 2011 cm.chang - * [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument - * . - * - * 01 21 2011 cp.wu - * [WCXRP00000380] [MT6620 Wi-Fi][Driver] SSID information should come from buffered BSS_DESC_T rather than using beacon-carried information - * SSID should come from buffered prBssDesc rather than beacon-carried information - * - * 01 14 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * Fix compile error. - * - * 01 14 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * Memfree for P2P Descriptor & P2P Descriptor List. - * - * 01 14 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * Free P2P Descriptor List & Descriptor under BSS Descriptor. - * - * 01 04 2011 cp.wu - * [WCXRP00000338] [MT6620 Wi-Fi][Driver] Separate kalMemAlloc into kmalloc and vmalloc implementations to ease physically continous memory demands - * 1) correct typo in scan.c - * 2) TX descriptors, RX descriptos and management buffer should use virtually continous buffer instead of physically contineous one - * - * 01 04 2011 cp.wu - * [WCXRP00000338] [MT6620 Wi-Fi][Driver] Separate kalMemAlloc into kmalloc and vmalloc implementations to ease physically continous memory demands - * separate kalMemAlloc() into virtually-continous and physically-continous type to ease slab system pressure - * - * 12 31 2010 cp.wu - * [WCXRP00000327] [MT6620 Wi-Fi][Driver] Improve HEC WHQA 6972 workaround coverage in driver side - * while being unloaded, clear all pending interrupt then set LP-own to firmware - * - * 12 21 2010 cp.wu - * [WCXRP00000280] [MT6620 Wi-Fi][Driver] Enable BSS selection with best RCPI policy in SCN module - * SCN: enable BEST RSSI selection policy support - * - * 11 29 2010 cp.wu - * [WCXRP00000210] [MT6620 Wi-Fi][Driver][FW] Set RCPI value in STA_REC for initial TX rate selection of auto-rate algorithm - * update ucRcpi of STA_RECORD_T for AIS when - * 1) Beacons for IBSS merge is received - * 2) Associate Response for a connecting peer is received - * - * 11 03 2010 wh.su - * [WCXRP00000124] [MT6620 Wi-Fi] [Driver] Support the dissolve P2P Group - * Refine the HT rate disallow TKIP pairwise cipher . - * - * 10 12 2010 cp.wu - * [WCXRP00000091] [MT6620 Wi-Fi][Driver] Add scanning logic to filter out beacons which is received on the folding frequency - * trust HT IE if available for 5GHz band - * - * 10 11 2010 cp.wu - * [WCXRP00000091] [MT6620 Wi-Fi][Driver] Add scanning logic to filter out beacons which is received on the folding frequency - * add timing and strenght constraint for filtering out beacons with same SSID/TA but received on different channels - * - * 10 08 2010 wh.su - * [WCXRP00000085] [MT6620 Wif-Fi] [Driver] update the modified p2p state machine - * update the frog's new p2p state machine. - * - * 10 01 2010 yuche.tsai - * NULL - * [MT6620 P2P] Fix Big Endian Issue when parse P2P device name TLV. - * - * 09 24 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * eliminate unused variables which lead gcc to argue - * - * 09 08 2010 cp.wu - * NULL - * use static memory pool for storing IEs of scanning result. - * - * 09 07 2010 yuche.tsai - * NULL - * When indicate scan result, append IE buffer information in the scan result. - * - * 09 03 2010 yuche.tsai - * NULL - * 1. Update Beacon RX count when running SLT. - * 2. Ignore Beacon when running SLT, would not update information from Beacon. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 31 2010 kevin.huang - * NULL - * Use LINK LIST operation to process SCAN result - * - * 08 29 2010 yuche.tsai - * NULL - * 1. Fix P2P Descriptor List to be a link list, to avoid link corrupt after Bss Descriptor Free. - * 2.. Fix P2P Device Name Length BE issue. - * - * 08 23 2010 yuche.tsai - * NULL - * Add P2P Device Found Indication to supplicant - * - * 08 20 2010 cp.wu - * NULL - * reset BSS_DESC_T variables before parsing IE due to peer might have been reconfigured. - * - * 08 20 2010 yuche.tsai - * NULL - * Workaround for P2P Descriptor Infinite loop issue. - * - * 08 16 2010 cp.wu - * NULL - * Replace CFG_SUPPORT_BOW by CFG_ENABLE_BT_OVER_WIFI. - * There is no CFG_SUPPORT_BOW in driver domain source. - * - * 08 16 2010 yuche.tsai - * NULL - * Modify code of processing Probe Resonse frame for P2P. - * - * 08 12 2010 yuche.tsai - * NULL - * Add function to get P2P descriptor of BSS descriptor directly. - * - * 08 11 2010 yuche.tsai - * NULL - * Modify Scan result processing for P2P module. - * - * 08 05 2010 yuche.tsai - * NULL - * Update P2P Device Discovery result add function. - * - * 08 03 2010 cp.wu - * NULL - * surpress compilation warning. - * - * 07 26 2010 yuche.tsai - * - * Add support for Probe Request & Response parsing. - * - * 07 21 2010 cp.wu - * - * 1) change BG_SCAN to ONLINE_SCAN for consistent term - * 2) only clear scanning result when scan is permitted to do - * - * 07 21 2010 yuche.tsai - * - * Fix compile error for SCAN module while disabling P2P feature. - * - * 07 21 2010 yuche.tsai - * - * Add P2P Scan & Scan Result Parsing & Saving. - * - * 07 19 2010 wh.su - * - * update for security supporting. - * - * 07 19 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * Add Ad-Hoc support to AIS-FSM - * - * 07 19 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * SCN module is now able to handle multiple concurrent scanning requests - * - * 07 15 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * driver no longer generates probe request frames - * - * 07 14 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * remove timer in DRV-SCN. - * - * 07 09 2010 cp.wu - * - * 1) separate AIS_FSM state for two kinds of scanning. (OID triggered scan, and scan-for-connection) - * 2) eliminate PRE_BSS_DESC_T, Beacon/PrebResp is now parsed in single pass - * 3) implment DRV-SCN module, currently only accepts single scan request, other request will be directly dropped by returning BUSY - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * take use of RLM module for parsing/generating HT IEs for 11n capability - * - * 07 05 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) ignore RSN checking when RSN is not turned on. - * 2) set STA-REC deactivation callback as NULL - * 3) add variable initialization API based on PHY configuration - * - * 07 05 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * correct BSS_DESC_T initialization after allocated. - * - * 07 02 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) for event packet, no need to fill RFB. - * 2) when wlanAdapterStart() failed, no need to initialize state machines - * 3) after Beacon/ProbeResp parsing, corresponding BSS_DESC_T should be marked as IE-parsed - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add scan uninitialization procedure - * - * 06 30 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * if beacon/probe-resp is received in 2.4GHz bands and there is ELEM_ID_DS_PARAM_SET IE available, - * trust IE instead of RMAC information - * - * 06 29 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) sync to. CMD/EVENT document v0.03 - * 2) simplify DTIM period parsing in scan.c only, bss.c no longer parses it again. - * 3) send command packet to indicate FW-PM after - * a) 1st beacon is received after AIS has connected to an AP - * b) IBSS-ALONE has been created - * c) IBSS-MERGE has occured - * - * 06 28 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * send MMPDU in basic rate. - * - * 06 25 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * modify Beacon/ProbeResp to complete parsing, - * because host software has looser memory usage restriction - * - * 06 23 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * integrate . - * - * 06 22 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * comment out RLM APIs by CFG_RLM_MIGRATION. - * - * 06 21 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Update P2P Function call. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * RSN/PRIVACY compilation flag awareness correction - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * specify correct value for management frames. - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 18 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * migration from MT6620 firmware. - * - * 06 17 2010 yuche.tsai - * [WPD00003839][MT6620 5931][P2P] Feature migration - * Fix compile error when enable P2P function. - * - * 06 15 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * correct when ADHOC support is turned on. - * - * 06 15 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add scan.c. - * - * 06 04 2010 george.huang - * [BORA00000678][MT6620]WiFi LP integration - * [PM] Support U-APSD for STA mode - * - * 05 28 2010 wh.su - * [BORA00000680][MT6620] Support the statistic for Microsoft os query - * adding the TKIP disallow join a HT AP code. - * - * 05 14 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add more chance of JOIN retry for BG_SCAN - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add Power Management - Legacy PS-POLL support. - * - * 04 29 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * adjsut the pre-authentication code. - * - * 04 27 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add Set Slot Time and Beacon Timeout Support for AdHoc Mode - * - * 04 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW - * - * 04 19 2010 kevin.huang - * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support - * Add Beacon Timeout Support and will send Null frame to diagnose connection - * - * 04 13 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add new HW CH macro support - * - * 04 06 2010 wh.su - * [BORA00000680][MT6620] Support the statistic for Microsoft os query - * fixed the firmware return the broadcast frame at wrong tc. - * - * 03 29 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * let the rsn wapi IE always parsing. - * - * 03 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Not carry HT cap when being associated with b/g only AP - * - * 03 18 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Solve the compile warning for 'return non-void' function - * - * 03 16 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Add AdHoc Mode - * - * 03 10 2010 kevin.huang - * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support - * - * * * * * * * * * * * * * * * * Add Channel Manager for arbitration of JOIN and SCAN Req - * - * 03 03 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * move the AIS specific variable for security to AIS specific structure. - * - * 03 01 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * Refine the variable and parameter for security. - * - * 02 26 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Fix No PKT_INFO_T issue - * - * 02 26 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Update outgoing ProbeRequest Frame's TX data rate - * - * 02 23 2010 wh.su - * [BORA00000592][MT6620 Wi-Fi] Adding the security related code for driver - * refine the scan procedure, reduce the WPA and WAPI IE parsing, and move the parsing to the time for join. - * - * 02 23 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add support scan channel 1~14 and update scan result's frequency infou1rwduu`wvpghlqg|n`slk+mpdkb - * - * 02 04 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup - * - * 01 27 2010 wh.su - * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code - * add and fixed some security function. - * - * 01 22 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Support protection and bandwidth switch - * - * 01 20 2010 kevin.huang - * [BORA00000569][WIFISYS] Phase 2 Integration Test - * Add PHASE_2_INTEGRATION_WORK_AROUND and CFG_SUPPORT_BCM flags - * - * 01 11 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add Deauth and Disassoc Handler - * - * 01 08 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * - * Refine Beacon processing, add read RF channel from RX Status - * - * 01 04 2010 tehuang.liu - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * For working out the first connection Chariot-verified version - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * Dec 12 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Modify u2EstimatedExtraIELen for probe request - * - * Dec 9 2009 mtk01104 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add HT cap IE to probe request - * - * Dec 7 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix lint warning - * - * - * Dec 3 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Update the process of SCAN Result by adding more Phy Attributes - * - * Dec 1 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adjust the function and code for meet the new define - * - * Nov 30 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Rename u4RSSI to i4RSSI - * - * Nov 30 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Report event of scan result to host - * - * Nov 26 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix SCAN Record update - * - * Nov 24 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Revise MGMT Handler with Retain Status and Integrate with TXM - * - * Nov 23 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add (Ext)Support Rate Set IE to ProbeReq - * - * Nov 20 2009 mtk02468 - * [BORA00000337] To check in codes for FPGA emulation - * Removed the use of SW_RFB->u2FrameLength - * - * Nov 20 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix uninitial aucMacAddress[] for ProbeReq - * - * Nov 16 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add scanSearchBssDescByPolicy() - * - * Nov 5 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Add Send Probe Request Frame - * - * Oct 30 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define REPLICATED_BEACON_TIME_THRESHOLD (3000) -#define REPLICATED_BEACON_FRESH_PERIOD (10000) -#define REPLICATED_BEACON_STRENGTH_THRESHOLD (32) - -#define ROAMING_NO_SWING_RCPI_STEP (10) - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used by SCN to initialize its variables -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -scnInit ( - IN P_ADAPTER_T prAdapter - ) -{ - P_SCAN_INFO_T prScanInfo; - P_BSS_DESC_T prBSSDesc; - PUINT_8 pucBSSBuff; - UINT_32 i; - - - ASSERT(prAdapter); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - pucBSSBuff = &prScanInfo->aucScanBuffer[0]; - - - DBGLOG(SCN, INFO, ("->scnInit()\n")); - - //4 <1> Reset STATE and Message List - prScanInfo->eCurrentState = SCAN_STATE_IDLE; - - prScanInfo->rLastScanCompletedTime = (OS_SYSTIME)0; - - LINK_INITIALIZE(&prScanInfo->rPendingMsgList); - - - //4 <2> Reset link list of BSS_DESC_T - kalMemZero((PVOID) pucBSSBuff, SCN_MAX_BUFFER_SIZE); - - LINK_INITIALIZE(&prScanInfo->rFreeBSSDescList); - LINK_INITIALIZE(&prScanInfo->rBSSDescList); - - for (i = 0; i < CFG_MAX_NUM_BSS_LIST; i++) { - - prBSSDesc = (P_BSS_DESC_T)pucBSSBuff; - - LINK_INSERT_TAIL(&prScanInfo->rFreeBSSDescList, &prBSSDesc->rLinkEntry); - - pucBSSBuff += ALIGN_4(sizeof(BSS_DESC_T)); - } - /* Check if the memory allocation consist with this initialization function */ - ASSERT(((UINT_32)pucBSSBuff - (UINT_32)&prScanInfo->aucScanBuffer[0]) == SCN_MAX_BUFFER_SIZE); - - /* reset freest channel information */ - prScanInfo->fgIsSparseChannelValid = FALSE; - - return; -} /* end of scnInit() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used by SCN to uninitialize its variables -* -* @param (none) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -scnUninit ( - IN P_ADAPTER_T prAdapter - ) -{ - P_SCAN_INFO_T prScanInfo; - - - ASSERT(prAdapter); - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - - DBGLOG(SCN, INFO, ("->scnUninit()\n")); - - //4 <1> Reset STATE and Message List - prScanInfo->eCurrentState = SCAN_STATE_IDLE; - - prScanInfo->rLastScanCompletedTime = (OS_SYSTIME)0; - - /* NOTE(Kevin): Check rPendingMsgList ? */ - - //4 <2> Reset link list of BSS_DESC_T - LINK_INITIALIZE(&prScanInfo->rFreeBSSDescList); - LINK_INITIALIZE(&prScanInfo->rBSSDescList); - - return; -} /* end of scnUninit() */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Find the corresponding BSS Descriptor according to given BSSID -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] aucBSSID Given BSSID. -* -* @return Pointer to BSS Descriptor, if found. NULL, if not found -*/ -/*----------------------------------------------------------------------------*/ -P_BSS_DESC_T -scanSearchBssDescByBssid ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucBSSID[] - ) -{ - return scanSearchBssDescByBssidAndSsid(prAdapter, - aucBSSID, - FALSE, - NULL); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Find the corresponding BSS Descriptor according to given BSSID -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] aucBSSID Given BSSID. -* @param[in] fgCheckSsid Need to check SSID or not. (for multiple SSID with single BSSID cases) -* @param[in] prSsid Specified SSID -* -* @return Pointer to BSS Descriptor, if found. NULL, if not found -*/ -/*----------------------------------------------------------------------------*/ -P_BSS_DESC_T -scanSearchBssDescByBssidAndSsid ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucBSSID[], - IN BOOLEAN fgCheckSsid, - IN P_PARAM_SSID_T prSsid - ) -{ - P_SCAN_INFO_T prScanInfo; - P_LINK_T prBSSDescList; - P_BSS_DESC_T prBssDesc; - P_BSS_DESC_T prDstBssDesc = (P_BSS_DESC_T)NULL; - - - ASSERT(prAdapter); - ASSERT(aucBSSID); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - - prBSSDescList = &prScanInfo->rBSSDescList; - - /* Search BSS Desc from current SCAN result list. */ - LINK_FOR_EACH_ENTRY(prBssDesc, prBSSDescList, rLinkEntry, BSS_DESC_T) { - - if (EQUAL_MAC_ADDR(prBssDesc->aucBSSID, aucBSSID)) { - if(fgCheckSsid == FALSE || prSsid == NULL) { - return prBssDesc; - } - else { - if(EQUAL_SSID(prBssDesc->aucSSID, - prBssDesc->ucSSIDLen, - prSsid->aucSsid, - prSsid->u4SsidLen)) { - return prBssDesc; - } - else if(prDstBssDesc == NULL && prBssDesc->fgIsHiddenSSID == TRUE) { - prDstBssDesc = prBssDesc; - } - else { - /* 20120206 frog: Equal BSSID but not SSID, SSID not hidden, SSID must be updated. */ - COPY_SSID(prBssDesc->aucSSID, - prBssDesc->ucSSIDLen, - prSsid->aucSsid, - prSsid->u4SsidLen); - return prBssDesc; - } - } - } - } - - return prDstBssDesc; - -} /* end of scanSearchBssDescByBssid() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Find the corresponding BSS Descriptor according to given Transmitter Address. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] aucSrcAddr Given Source Address(TA). -* -* @return Pointer to BSS Descriptor, if found. NULL, if not found -*/ -/*----------------------------------------------------------------------------*/ -P_BSS_DESC_T -scanSearchBssDescByTA ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucSrcAddr[] - ) -{ - return scanSearchBssDescByTAAndSsid(prAdapter, - aucSrcAddr, - FALSE, - NULL); -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Find the corresponding BSS Descriptor according to given Transmitter Address. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] aucSrcAddr Given Source Address(TA). -* @param[in] fgCheckSsid Need to check SSID or not. (for multiple SSID with single BSSID cases) -* @param[in] prSsid Specified SSID -* -* @return Pointer to BSS Descriptor, if found. NULL, if not found -*/ -/*----------------------------------------------------------------------------*/ -P_BSS_DESC_T -scanSearchBssDescByTAAndSsid ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucSrcAddr[], - IN BOOLEAN fgCheckSsid, - IN P_PARAM_SSID_T prSsid - ) -{ - P_SCAN_INFO_T prScanInfo; - P_LINK_T prBSSDescList; - P_BSS_DESC_T prBssDesc; - P_BSS_DESC_T prDstBssDesc = (P_BSS_DESC_T)NULL; - - - ASSERT(prAdapter); - ASSERT(aucSrcAddr); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - - prBSSDescList = &prScanInfo->rBSSDescList; - - /* Search BSS Desc from current SCAN result list. */ - LINK_FOR_EACH_ENTRY(prBssDesc, prBSSDescList, rLinkEntry, BSS_DESC_T) { - - if (EQUAL_MAC_ADDR(prBssDesc->aucSrcAddr, aucSrcAddr)) { - if(fgCheckSsid == FALSE || prSsid == NULL) { - return prBssDesc; - } - else { - if(EQUAL_SSID(prBssDesc->aucSSID, - prBssDesc->ucSSIDLen, - prSsid->aucSsid, - prSsid->u4SsidLen)) { - return prBssDesc; - } - else if(prDstBssDesc == NULL && prBssDesc->fgIsHiddenSSID == TRUE) { - prDstBssDesc = prBssDesc; - } - } - } - } - - return prDstBssDesc; - -} /* end of scanSearchBssDescByTA() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Find the corresponding BSS Descriptor according to -* given eBSSType, BSSID and Transmitter Address -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] eBSSType BSS Type of incoming Beacon/ProbeResp frame. -* @param[in] aucBSSID Given BSSID of Beacon/ProbeResp frame. -* @param[in] aucSrcAddr Given source address (TA) of Beacon/ProbeResp frame. -* -* @return Pointer to BSS Descriptor, if found. NULL, if not found -*/ -/*----------------------------------------------------------------------------*/ -P_BSS_DESC_T -scanSearchExistingBssDesc ( - IN P_ADAPTER_T prAdapter, - IN ENUM_BSS_TYPE_T eBSSType, - IN UINT_8 aucBSSID[], - IN UINT_8 aucSrcAddr[] - ) -{ - return scanSearchExistingBssDescWithSsid(prAdapter, - eBSSType, - aucBSSID, - aucSrcAddr, - FALSE, - NULL); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Find the corresponding BSS Descriptor according to -* given eBSSType, BSSID and Transmitter Address -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] eBSSType BSS Type of incoming Beacon/ProbeResp frame. -* @param[in] aucBSSID Given BSSID of Beacon/ProbeResp frame. -* @param[in] aucSrcAddr Given source address (TA) of Beacon/ProbeResp frame. -* @param[in] fgCheckSsid Need to check SSID or not. (for multiple SSID with single BSSID cases) -* @param[in] prSsid Specified SSID -* -* @return Pointer to BSS Descriptor, if found. NULL, if not found -*/ -/*----------------------------------------------------------------------------*/ -P_BSS_DESC_T -scanSearchExistingBssDescWithSsid ( - IN P_ADAPTER_T prAdapter, - IN ENUM_BSS_TYPE_T eBSSType, - IN UINT_8 aucBSSID[], - IN UINT_8 aucSrcAddr[], - IN BOOLEAN fgCheckSsid, - IN P_PARAM_SSID_T prSsid - ) -{ - P_SCAN_INFO_T prScanInfo; - P_BSS_DESC_T prBssDesc, prIBSSBssDesc; - - ASSERT(prAdapter); - ASSERT(aucSrcAddr); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - - - switch (eBSSType) { - case BSS_TYPE_P2P_DEVICE: - fgCheckSsid = FALSE; - case BSS_TYPE_INFRASTRUCTURE: - case BSS_TYPE_BOW_DEVICE: - { - prBssDesc = scanSearchBssDescByBssidAndSsid(prAdapter, aucBSSID, fgCheckSsid, prSsid); - - /* if (eBSSType == prBssDesc->eBSSType) */ - - return prBssDesc; - } - - case BSS_TYPE_IBSS: - { - prIBSSBssDesc = scanSearchBssDescByBssidAndSsid(prAdapter, aucBSSID, fgCheckSsid, prSsid); - prBssDesc = scanSearchBssDescByTAAndSsid(prAdapter, aucSrcAddr, fgCheckSsid, prSsid); - - /* NOTE(Kevin): - * Rules to maintain the SCAN Result: - * For AdHoc - - * CASE I We have TA1(BSSID1), but it change its BSSID to BSSID2 - * -> Update TA1 entry's BSSID. - * CASE II We have TA1(BSSID1), and get TA1(BSSID1) again - * -> Update TA1 entry's contain. - * CASE III We have a SCAN result TA1(BSSID1), and TA2(BSSID2). Sooner or - * later, TA2 merge into TA1, we get TA2(BSSID1) - * -> Remove TA2 first and then replace TA1 entry's TA with TA2, Still have only one entry of BSSID. - * CASE IV We have a SCAN result TA1(BSSID1), and another TA2 also merge into BSSID1. - * -> Replace TA1 entry's TA with TA2, Still have only one entry. - * CASE V New IBSS - * -> Add this one to SCAN result. - */ - if (prBssDesc) { - if ((!prIBSSBssDesc) || // CASE I - (prBssDesc == prIBSSBssDesc)) { // CASE II - - return prBssDesc; - } - else { // CASE III - P_LINK_T prBSSDescList; - P_LINK_T prFreeBSSDescList; - - - prBSSDescList = &prScanInfo->rBSSDescList; - prFreeBSSDescList = &prScanInfo->rFreeBSSDescList; - - /* Remove this BSS Desc from the BSS Desc list */ - LINK_REMOVE_KNOWN_ENTRY(prBSSDescList, prBssDesc); - - /* Return this BSS Desc to the free BSS Desc list. */ - LINK_INSERT_TAIL(prFreeBSSDescList, &prBssDesc->rLinkEntry); - - return prIBSSBssDesc; - } - } - - if (prIBSSBssDesc) { // CASE IV - - return prIBSSBssDesc; - } - - // CASE V - break; // Return NULL; - } - - default: - break; - } - - - return (P_BSS_DESC_T)NULL; - -} /* end of scanSearchExistingBssDesc() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Delete BSS Descriptors from current list according to given Remove Policy. -* -* @param[in] u4RemovePolicy Remove Policy. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -scanRemoveBssDescsByPolicy ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4RemovePolicy - ) -{ - P_CONNECTION_SETTINGS_T prConnSettings; - P_SCAN_INFO_T prScanInfo; - P_LINK_T prBSSDescList; - P_LINK_T prFreeBSSDescList; - P_BSS_DESC_T prBssDesc; - - - ASSERT(prAdapter); - - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prBSSDescList = &prScanInfo->rBSSDescList; - prFreeBSSDescList = &prScanInfo->rFreeBSSDescList; - - //DBGLOG(SCN, TRACE, ("Before Remove - Number Of SCAN Result = %ld\n", - //prBSSDescList->u4NumElem)); - - if (u4RemovePolicy & SCN_RM_POLICY_TIMEOUT) { - P_BSS_DESC_T prBSSDescNext; - OS_SYSTIME rCurrentTime; - - - GET_CURRENT_SYSTIME(&rCurrentTime); - - /* Search BSS Desc from current SCAN result list. */ - LINK_FOR_EACH_ENTRY_SAFE(prBssDesc, prBSSDescNext, prBSSDescList, rLinkEntry, BSS_DESC_T) { - - if ((u4RemovePolicy & SCN_RM_POLICY_EXCLUDE_CONNECTED) && - (prBssDesc->fgIsConnected || prBssDesc->fgIsConnecting)) { - /* Don't remove the one currently we are connected. */ - continue; - } - - if (CHECK_FOR_TIMEOUT(rCurrentTime, prBssDesc->rUpdateTime, - SEC_TO_SYSTIME(SCN_BSS_DESC_REMOVE_TIMEOUT_SEC)) ) { - - //DBGLOG(SCN, TRACE, ("Remove TIMEOUT BSS DESC(%#x): MAC: "MACSTR", Current Time = %08lx, Update Time = %08lx\n", - //prBssDesc, MAC2STR(prBssDesc->aucBSSID), rCurrentTime, prBssDesc->rUpdateTime)); - - /* Remove this BSS Desc from the BSS Desc list */ - LINK_REMOVE_KNOWN_ENTRY(prBSSDescList, prBssDesc); - - /* Return this BSS Desc to the free BSS Desc list. */ - LINK_INSERT_TAIL(prFreeBSSDescList, &prBssDesc->rLinkEntry); - } - } - } - else if (u4RemovePolicy & SCN_RM_POLICY_OLDEST_HIDDEN) { - P_BSS_DESC_T prBssDescOldest = (P_BSS_DESC_T)NULL; - - - /* Search BSS Desc from current SCAN result list. */ - LINK_FOR_EACH_ENTRY(prBssDesc, prBSSDescList, rLinkEntry, BSS_DESC_T) { - - if ((u4RemovePolicy & SCN_RM_POLICY_EXCLUDE_CONNECTED) && - (prBssDesc->fgIsConnected || prBssDesc->fgIsConnecting)) { - /* Don't remove the one currently we are connected. */ - continue; - } - - if (!prBssDesc->fgIsHiddenSSID) { - continue; - } - - if (!prBssDescOldest) { /* 1st element */ - prBssDescOldest = prBssDesc; - continue; - } - - if (TIME_BEFORE(prBssDesc->rUpdateTime, prBssDescOldest->rUpdateTime)) { - prBssDescOldest = prBssDesc; - } - } - - if (prBssDescOldest) { - - //DBGLOG(SCN, TRACE, ("Remove OLDEST HIDDEN BSS DESC(%#x): MAC: "MACSTR", Update Time = %08lx\n", - //prBssDescOldest, MAC2STR(prBssDescOldest->aucBSSID), prBssDescOldest->rUpdateTime)); - - /* Remove this BSS Desc from the BSS Desc list */ - LINK_REMOVE_KNOWN_ENTRY(prBSSDescList, prBssDescOldest); - - /* Return this BSS Desc to the free BSS Desc list. */ - LINK_INSERT_TAIL(prFreeBSSDescList, &prBssDescOldest->rLinkEntry); - } - } - else if (u4RemovePolicy & SCN_RM_POLICY_SMART_WEAKEST) { - P_BSS_DESC_T prBssDescWeakest = (P_BSS_DESC_T)NULL; - P_BSS_DESC_T prBssDescWeakestSameSSID = (P_BSS_DESC_T)NULL; - UINT_32 u4SameSSIDCount = 0; - - - /* Search BSS Desc from current SCAN result list. */ - LINK_FOR_EACH_ENTRY(prBssDesc, prBSSDescList, rLinkEntry, BSS_DESC_T) { - - if ((u4RemovePolicy & SCN_RM_POLICY_EXCLUDE_CONNECTED) && - (prBssDesc->fgIsConnected || prBssDesc->fgIsConnecting)) { - /* Don't remove the one currently we are connected. */ - continue; - } - - if ((!prBssDesc->fgIsHiddenSSID) && - (EQUAL_SSID(prBssDesc->aucSSID, - prBssDesc->ucSSIDLen, - prConnSettings->aucSSID, - prConnSettings->ucSSIDLen))) { - - u4SameSSIDCount++; - - if (!prBssDescWeakestSameSSID) { - prBssDescWeakestSameSSID = prBssDesc; - } - else if (prBssDesc->ucRCPI < prBssDescWeakestSameSSID->ucRCPI) { - prBssDescWeakestSameSSID = prBssDesc; - } - } - - if (!prBssDescWeakest) { /* 1st element */ - prBssDescWeakest = prBssDesc; - continue; - } - - if (prBssDesc->ucRCPI < prBssDescWeakest->ucRCPI) { - prBssDescWeakest = prBssDesc; - } - - } - - if ((u4SameSSIDCount >= SCN_BSS_DESC_SAME_SSID_THRESHOLD) && - (prBssDescWeakestSameSSID)) { - prBssDescWeakest = prBssDescWeakestSameSSID; - } - - if (prBssDescWeakest) { - - //DBGLOG(SCN, TRACE, ("Remove WEAKEST BSS DESC(%#x): MAC: "MACSTR", Update Time = %08lx\n", - //prBssDescOldest, MAC2STR(prBssDescOldest->aucBSSID), prBssDescOldest->rUpdateTime)); - - /* Remove this BSS Desc from the BSS Desc list */ - LINK_REMOVE_KNOWN_ENTRY(prBSSDescList, prBssDescWeakest); - - /* Return this BSS Desc to the free BSS Desc list. */ - LINK_INSERT_TAIL(prFreeBSSDescList, &prBssDescWeakest->rLinkEntry); - } - } - else if (u4RemovePolicy & SCN_RM_POLICY_ENTIRE) { - P_BSS_DESC_T prBSSDescNext; - - LINK_FOR_EACH_ENTRY_SAFE(prBssDesc, prBSSDescNext, prBSSDescList, rLinkEntry, BSS_DESC_T) { - - if ((u4RemovePolicy & SCN_RM_POLICY_EXCLUDE_CONNECTED) && - (prBssDesc->fgIsConnected || prBssDesc->fgIsConnecting)) { - /* Don't remove the one currently we are connected. */ - continue; - } - - /* Remove this BSS Desc from the BSS Desc list */ - LINK_REMOVE_KNOWN_ENTRY(prBSSDescList, prBssDesc); - - /* Return this BSS Desc to the free BSS Desc list. */ - LINK_INSERT_TAIL(prFreeBSSDescList, &prBssDesc->rLinkEntry); - } - - } - - return; - -} /* end of scanRemoveBssDescsByPolicy() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Delete BSS Descriptors from current list according to given BSSID. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] aucBSSID Given BSSID. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -scanRemoveBssDescByBssid ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucBSSID[] - ) -{ - P_SCAN_INFO_T prScanInfo; - P_LINK_T prBSSDescList; - P_LINK_T prFreeBSSDescList; - P_BSS_DESC_T prBssDesc = (P_BSS_DESC_T)NULL; - P_BSS_DESC_T prBSSDescNext; - - - ASSERT(prAdapter); - ASSERT(aucBSSID); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prBSSDescList = &prScanInfo->rBSSDescList; - prFreeBSSDescList = &prScanInfo->rFreeBSSDescList; - - /* Check if such BSS Descriptor exists in a valid list */ - LINK_FOR_EACH_ENTRY_SAFE(prBssDesc, prBSSDescNext, prBSSDescList, rLinkEntry, BSS_DESC_T) { - - if (EQUAL_MAC_ADDR(prBssDesc->aucBSSID, aucBSSID)) { - - /* Remove this BSS Desc from the BSS Desc list */ - LINK_REMOVE_KNOWN_ENTRY(prBSSDescList, prBssDesc); - - /* Return this BSS Desc to the free BSS Desc list. */ - LINK_INSERT_TAIL(prFreeBSSDescList, &prBssDesc->rLinkEntry); - - /* BSSID is not unique, so need to traverse whols link-list */ - } - } - - return; -} /* end of scanRemoveBssDescByBssid() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Delete BSS Descriptors from current list according to given band configuration -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] eBand Given band -* @param[in] eNetTypeIndex AIS - Remove IBSS/Infrastructure BSS -* BOW - Remove BOW BSS -* P2P - Remove P2P BSS -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -scanRemoveBssDescByBandAndNetwork ( - IN P_ADAPTER_T prAdapter, - IN ENUM_BAND_T eBand, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ) -{ - P_SCAN_INFO_T prScanInfo; - P_LINK_T prBSSDescList; - P_LINK_T prFreeBSSDescList; - P_BSS_DESC_T prBssDesc = (P_BSS_DESC_T)NULL; - P_BSS_DESC_T prBSSDescNext; - BOOLEAN fgToRemove; - - ASSERT(prAdapter); - ASSERT(eBand <= BAND_NUM); - ASSERT(eNetTypeIndex <= NETWORK_TYPE_INDEX_NUM); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prBSSDescList = &prScanInfo->rBSSDescList; - prFreeBSSDescList = &prScanInfo->rFreeBSSDescList; - - - if(eBand == BAND_NULL) { - return; /* no need to do anything, keep all scan result */ - } - - /* Check if such BSS Descriptor exists in a valid list */ - LINK_FOR_EACH_ENTRY_SAFE(prBssDesc, prBSSDescNext, prBSSDescList, rLinkEntry, BSS_DESC_T) { - fgToRemove = FALSE; - - if(prBssDesc->eBand == eBand) { - switch (eNetTypeIndex) { - case NETWORK_TYPE_AIS_INDEX: - if((prBssDesc->eBSSType == BSS_TYPE_INFRASTRUCTURE) - || (prBssDesc->eBSSType == BSS_TYPE_IBSS)) { - fgToRemove = TRUE; - } - break; - - case NETWORK_TYPE_P2P_INDEX: - if(prBssDesc->eBSSType == BSS_TYPE_P2P_DEVICE) { - fgToRemove = TRUE; - } - break; - - case NETWORK_TYPE_BOW_INDEX: - if(prBssDesc->eBSSType == BSS_TYPE_BOW_DEVICE) { - fgToRemove = TRUE; - } - break; - - default: - ASSERT(0); - break; - } - } - - if(fgToRemove == TRUE) { - /* Remove this BSS Desc from the BSS Desc list */ - LINK_REMOVE_KNOWN_ENTRY(prBSSDescList, prBssDesc); - - /* Return this BSS Desc to the free BSS Desc list. */ - LINK_INSERT_TAIL(prFreeBSSDescList, &prBssDesc->rLinkEntry); - } - } - - return; -} /* end of scanRemoveBssDescByBand() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Clear the CONNECTION FLAG of a specified BSS Descriptor. -* -* @param[in] aucBSSID Given BSSID. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -scanRemoveConnFlagOfBssDescByBssid ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 aucBSSID[] - ) -{ - P_SCAN_INFO_T prScanInfo; - P_LINK_T prBSSDescList; - P_BSS_DESC_T prBssDesc = (P_BSS_DESC_T)NULL; - - - ASSERT(prAdapter); - ASSERT(aucBSSID); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prBSSDescList = &prScanInfo->rBSSDescList; - - /* Search BSS Desc from current SCAN result list. */ - LINK_FOR_EACH_ENTRY(prBssDesc, prBSSDescList, rLinkEntry, BSS_DESC_T) { - - if (EQUAL_MAC_ADDR(prBssDesc->aucBSSID, aucBSSID)) { - prBssDesc->fgIsConnected = FALSE; - prBssDesc->fgIsConnecting = FALSE; - - /* BSSID is not unique, so need to traverse whols link-list */ - } - } - - return; - -} /* end of scanRemoveConnectionFlagOfBssDescByBssid() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Allocate new BSS_DESC_T -* -* @param[in] prAdapter Pointer to the Adapter structure. -* -* @return Pointer to BSS Descriptor, if has free space. NULL, if has no space. -*/ -/*----------------------------------------------------------------------------*/ -P_BSS_DESC_T -scanAllocateBssDesc ( - IN P_ADAPTER_T prAdapter - ) -{ - P_SCAN_INFO_T prScanInfo; - P_LINK_T prFreeBSSDescList; - P_BSS_DESC_T prBssDesc; - - - ASSERT(prAdapter); - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - - prFreeBSSDescList = &prScanInfo->rFreeBSSDescList; - - LINK_REMOVE_HEAD(prFreeBSSDescList, prBssDesc, P_BSS_DESC_T); - - if (prBssDesc) { - P_LINK_T prBSSDescList; - - kalMemZero(prBssDesc, sizeof(BSS_DESC_T)); - -#if CFG_ENABLE_WIFI_DIRECT - LINK_INITIALIZE(&(prBssDesc->rP2pDeviceList)); - prBssDesc->fgIsP2PPresent = FALSE; -#endif /* CFG_ENABLE_WIFI_DIRECT */ - - prBSSDescList = &prScanInfo->rBSSDescList; - - /* NOTE(Kevin): In current design, this new empty BSS_DESC_T will be - * inserted to BSSDescList immediately. - */ - LINK_INSERT_TAIL(prBSSDescList, &prBssDesc->rLinkEntry); - } - - return prBssDesc; - -} /* end of scanAllocateBssDesc() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This API parses Beacon/ProbeResp frame and insert extracted BSS_DESC_T -* with IEs into prAdapter->rWifiVar.rScanInfo.aucScanBuffer -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prSwRfb Pointer to the receiving frame buffer. -* -* @return Pointer to BSS Descriptor -* NULL if the Beacon/ProbeResp frame is invalid -*/ -/*----------------------------------------------------------------------------*/ -P_BSS_DESC_T -scanAddToBssDesc ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_BSS_DESC_T prBssDesc = NULL; - UINT_16 u2CapInfo; - ENUM_BSS_TYPE_T eBSSType = BSS_TYPE_INFRASTRUCTURE; - - PUINT_8 pucIE; - UINT_16 u2IELength; - UINT_16 u2Offset = 0; - - P_WLAN_BEACON_FRAME_T prWlanBeaconFrame = (P_WLAN_BEACON_FRAME_T)NULL; - P_IE_SSID_T prIeSsid = (P_IE_SSID_T)NULL; - P_IE_SUPPORTED_RATE_T prIeSupportedRate = (P_IE_SUPPORTED_RATE_T)NULL; - P_IE_EXT_SUPPORTED_RATE_T prIeExtSupportedRate = (P_IE_EXT_SUPPORTED_RATE_T)NULL; - P_HIF_RX_HEADER_T prHifRxHdr; - UINT_8 ucHwChannelNum = 0; - UINT_8 ucIeDsChannelNum = 0; - UINT_8 ucIeHtChannelNum = 0; - BOOLEAN fgIsValidSsid = FALSE, fgEscape = FALSE; - PARAM_SSID_T rSsid; - UINT_64 u8Timestamp; - - UINT_32 i; - UINT_8 ucSSIDChar; - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - prWlanBeaconFrame = (P_WLAN_BEACON_FRAME_T)prSwRfb->pvHeader; - - WLAN_GET_FIELD_16(&prWlanBeaconFrame->u2CapInfo, &u2CapInfo); - WLAN_GET_FIELD_64(&prWlanBeaconFrame->au4Timestamp[0], &u8Timestamp); - - // decide BSS type - switch (u2CapInfo & CAP_INFO_BSS_TYPE) { - case CAP_INFO_ESS: - /* It can also be Group Owner of P2P Group. */ - eBSSType = BSS_TYPE_INFRASTRUCTURE; - break; - - case CAP_INFO_IBSS: - eBSSType = BSS_TYPE_IBSS; - break; - case 0: - /* The P2P Device shall set the ESS bit of the Capabilities field in the Probe Response fame to 0 and IBSS bit to 0. (3.1.2.1.1) */ - eBSSType = BSS_TYPE_P2P_DEVICE; - break; - -#if CFG_ENABLE_BT_OVER_WIFI - // @TODO: add rule to identify BOW beacons -#endif - - default: - return NULL; - } - - //4 <1.1> Pre-parse SSID IE - pucIE = prWlanBeaconFrame->aucInfoElem; - u2IELength = (prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen) - - (UINT_16)OFFSET_OF(WLAN_BEACON_FRAME_BODY_T, aucInfoElem[0]); - - if (u2IELength > CFG_IE_BUFFER_SIZE) { - u2IELength = CFG_IE_BUFFER_SIZE; - } - - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - switch (IE_ID(pucIE)) { - case ELEM_ID_SSID: - if (IE_LEN(pucIE) <= ELEM_MAX_LEN_SSID) { - ucSSIDChar = '\0'; - - /* D-Link DWL-900AP+ */ - if (IE_LEN(pucIE) == 0) { - fgIsValidSsid = FALSE; - } - /* Cisco AP1230A - (IE_LEN(pucIE) == 1) && (SSID_IE(pucIE)->aucSSID[0] == '\0') */ - /* Linksys WRK54G/ASUS WL520g - (IE_LEN(pucIE) == n) && (SSID_IE(pucIE)->aucSSID[0~(n-1)] == '\0') */ - else { - for (i = 0; i < IE_LEN(pucIE); i++) { - ucSSIDChar |= SSID_IE(pucIE)->aucSSID[i]; - } - - if (ucSSIDChar) { - fgIsValidSsid = TRUE; - } - } - - /* Update SSID to BSS Descriptor only if SSID is not hidden. */ - if (fgIsValidSsid == TRUE) { - COPY_SSID(rSsid.aucSsid, - rSsid.u4SsidLen, - SSID_IE(pucIE)->aucSSID, - SSID_IE(pucIE)->ucLength); - } - } - fgEscape = TRUE; - break; - default: - break; - } - - if(fgEscape == TRUE) { - break; - } - } - - - //4 <1.2> Replace existing BSS_DESC_T or allocate a new one - prBssDesc = scanSearchExistingBssDescWithSsid(prAdapter, - eBSSType, - (PUINT_8)prWlanBeaconFrame->aucBSSID, - (PUINT_8)prWlanBeaconFrame->aucSrcAddr, - fgIsValidSsid, - fgIsValidSsid == TRUE ? &rSsid : NULL); - - if (prBssDesc == (P_BSS_DESC_T)NULL) { - do { - //4 <1.2.1> First trial of allocation - prBssDesc = scanAllocateBssDesc(prAdapter); - if (prBssDesc) { - break; - } - - //4 <1.2.2> Hidden is useless, remove the oldest hidden ssid. (for passive scan) - scanRemoveBssDescsByPolicy(prAdapter, - (SCN_RM_POLICY_EXCLUDE_CONNECTED | SCN_RM_POLICY_OLDEST_HIDDEN)); - - //4 <1.2.3> Second tail of allocation - prBssDesc = scanAllocateBssDesc(prAdapter); - if (prBssDesc) { - break; - } - - //4 <1.2.4> Remove the weakest one - /* If there are more than half of BSS which has the same ssid as connection - * setting, remove the weakest one from them. - * Else remove the weakest one. - */ - scanRemoveBssDescsByPolicy(prAdapter, - (SCN_RM_POLICY_EXCLUDE_CONNECTED | SCN_RM_POLICY_SMART_WEAKEST)); - - //4 <1.2.5> reallocation - prBssDesc = scanAllocateBssDesc(prAdapter); - if (prBssDesc) { - break; - } - - //4 <1.2.6> no space, should not happen - //ASSERT(0); // still no space available ? - return NULL; - - } - while(FALSE); - - } - else { - OS_SYSTIME rCurrentTime; - - // WCXRP00000091 - // if the received strength is much weaker than the original one, - // ignore it due to it might be received on the folding frequency - - GET_CURRENT_SYSTIME(&rCurrentTime); - - prBssDesc->eBSSType = eBSSType; - - if(HIF_RX_HDR_GET_CHNL_NUM(prSwRfb->prHifRxHdr) != prBssDesc->ucChannelNum && - prBssDesc->ucRCPI > prSwRfb->prHifRxHdr->ucRcpi) { - - // for signal strength is too much weaker and previous beacon is not stale - if((prBssDesc->ucRCPI - prSwRfb->prHifRxHdr->ucRcpi) >= REPLICATED_BEACON_STRENGTH_THRESHOLD && - rCurrentTime - prBssDesc->rUpdateTime <= REPLICATED_BEACON_FRESH_PERIOD) { - return prBssDesc; - } - // for received beacons too close in time domain - else if(rCurrentTime - prBssDesc->rUpdateTime <= REPLICATED_BEACON_TIME_THRESHOLD) { - return prBssDesc; - } - } - - /* if Timestamp has been reset, re-generate BSS DESC 'cause AP should have reset itself */ - if(prBssDesc->eBSSType == BSS_TYPE_INFRASTRUCTURE && u8Timestamp < prBssDesc->u8TimeStamp.QuadPart) { - scanRemoveBssDescByBssid(prAdapter, prBssDesc->aucBSSID); - - prBssDesc = scanAllocateBssDesc(prAdapter); - if (!prBssDesc) { - return NULL; - } - } - } - - /* NOTE: Keep consistency of Scan Record during JOIN process */ - if (prBssDesc->fgIsConnecting) { - return prBssDesc; - } - - //4 <2> Get information from Fixed Fields - prBssDesc->eBSSType = eBSSType; /* Update the latest BSS type information. */ - - COPY_MAC_ADDR(prBssDesc->aucSrcAddr, prWlanBeaconFrame->aucSrcAddr); - - COPY_MAC_ADDR(prBssDesc->aucBSSID, prWlanBeaconFrame->aucBSSID); - - prBssDesc->u8TimeStamp.QuadPart = u8Timestamp; - - WLAN_GET_FIELD_16(&prWlanBeaconFrame->u2BeaconInterval, &prBssDesc->u2BeaconInterval); - - prBssDesc->u2CapInfo = u2CapInfo; - - - //4 <2.1> Retrieve IEs for later parsing - u2IELength = (prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen) - - (UINT_16)OFFSET_OF(WLAN_BEACON_FRAME_BODY_T, aucInfoElem[0]); - - if (u2IELength > CFG_IE_BUFFER_SIZE) { - u2IELength = CFG_IE_BUFFER_SIZE; - prBssDesc->fgIsIEOverflow = TRUE; - } - else { - prBssDesc->fgIsIEOverflow = FALSE; - } - prBssDesc->u2IELength = u2IELength; - - kalMemCopy(prBssDesc->aucIEBuf, prWlanBeaconFrame->aucInfoElem, u2IELength); - - //4 <2.2> reset prBssDesc variables in case that AP has been reconfigured - prBssDesc->fgIsERPPresent = FALSE; - prBssDesc->fgIsHTPresent = FALSE; - prBssDesc->eSco = CHNL_EXT_SCN; - prBssDesc->fgIEWAPI = FALSE; -#if CFG_RSN_MIGRATION - prBssDesc->fgIERSN = FALSE; -#endif -#if CFG_PRIVACY_MIGRATION - prBssDesc->fgIEWPA = FALSE; -#endif - - - //4 <3.1> Full IE parsing on SW_RFB_T - pucIE = prWlanBeaconFrame->aucInfoElem; - - - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - - switch (IE_ID(pucIE)) { - case ELEM_ID_SSID: - if ((!prIeSsid) && /* NOTE(Kevin): for Atheros IOT #1 */ - (IE_LEN(pucIE) <= ELEM_MAX_LEN_SSID)) { - BOOLEAN fgIsHiddenSSID = FALSE; - ucSSIDChar = '\0'; - - - prIeSsid = (P_IE_SSID_T)pucIE; - - /* D-Link DWL-900AP+ */ - if (IE_LEN(pucIE) == 0) { - fgIsHiddenSSID = TRUE; - } - /* Cisco AP1230A - (IE_LEN(pucIE) == 1) && (SSID_IE(pucIE)->aucSSID[0] == '\0') */ - /* Linksys WRK54G/ASUS WL520g - (IE_LEN(pucIE) == n) && (SSID_IE(pucIE)->aucSSID[0~(n-1)] == '\0') */ - else { - for (i = 0; i < IE_LEN(pucIE); i++) { - ucSSIDChar |= SSID_IE(pucIE)->aucSSID[i]; - } - - if (!ucSSIDChar) { - fgIsHiddenSSID = TRUE; - } - } - - /* Update SSID to BSS Descriptor only if SSID is not hidden. */ - if (!fgIsHiddenSSID) { - COPY_SSID(prBssDesc->aucSSID, - prBssDesc->ucSSIDLen, - SSID_IE(pucIE)->aucSSID, - SSID_IE(pucIE)->ucLength); - } - - } - break; - - case ELEM_ID_SUP_RATES: - /* NOTE(Kevin): Buffalo WHR-G54S's supported rate set IE exceed 8. - * IE_LEN(pucIE) == 12, "1(B), 2(B), 5.5(B), 6(B), 9(B), 11(B), - * 12(B), 18(B), 24(B), 36(B), 48(B), 54(B)" - */ - /* TP-LINK will set extra and incorrect ie with ELEM_ID_SUP_RATES */ - if ((!prIeSupportedRate) && (IE_LEN(pucIE) <= RATE_NUM)) { - prIeSupportedRate = SUP_RATES_IE(pucIE); - } - break; - - case ELEM_ID_DS_PARAM_SET: - if (IE_LEN(pucIE) == ELEM_MAX_LEN_DS_PARAMETER_SET) { - ucIeDsChannelNum = DS_PARAM_IE(pucIE)->ucCurrChnl; - } - break; - - case ELEM_ID_TIM: - if (IE_LEN(pucIE) <= ELEM_MAX_LEN_TIM) { - prBssDesc->ucDTIMPeriod = TIM_IE(pucIE)->ucDTIMPeriod; - } - break; - - case ELEM_ID_IBSS_PARAM_SET: - if (IE_LEN(pucIE) == ELEM_MAX_LEN_IBSS_PARAMETER_SET){ - prBssDesc->u2ATIMWindow = IBSS_PARAM_IE(pucIE)->u2ATIMWindow; - } - break; - -#if 0 //CFG_SUPPORT_802_11D - case ELEM_ID_COUNTRY_INFO: - prBssDesc->prIECountry = (P_IE_COUNTRY_T)pucIE; - break; -#endif - - case ELEM_ID_ERP_INFO: - if (IE_LEN(pucIE) == ELEM_MAX_LEN_ERP) { - prBssDesc->fgIsERPPresent = TRUE; - } - break; - - case ELEM_ID_EXTENDED_SUP_RATES: - if (!prIeExtSupportedRate) { - prIeExtSupportedRate = EXT_SUP_RATES_IE(pucIE); - } - break; - -#if CFG_RSN_MIGRATION - case ELEM_ID_RSN: - if (rsnParseRsnIE(prAdapter, RSN_IE(pucIE), &prBssDesc->rRSNInfo)) { - prBssDesc->fgIERSN = TRUE; - prBssDesc->u2RsnCap = prBssDesc->rRSNInfo.u2RsnCap; - if (prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA2) { - rsnCheckPmkidCache(prAdapter, prBssDesc); - } - } - break; -#endif - - case ELEM_ID_HT_CAP: - prBssDesc->fgIsHTPresent = TRUE; - break; - - case ELEM_ID_HT_OP: - if (IE_LEN(pucIE) != (sizeof(IE_HT_OP_T) - 2)) { - break; - } - - if ((((P_IE_HT_OP_T) pucIE)->ucInfo1 & HT_OP_INFO1_SCO) != CHNL_EXT_RES) { - prBssDesc->eSco = (ENUM_CHNL_EXT_T) - (((P_IE_HT_OP_T) pucIE)->ucInfo1 & HT_OP_INFO1_SCO); - } - ucIeHtChannelNum = ((P_IE_HT_OP_T) pucIE)->ucPrimaryChannel; - - break; - -#if CFG_SUPPORT_WAPI - case ELEM_ID_WAPI: - if (wapiParseWapiIE(WAPI_IE(pucIE), &prBssDesc->rIEWAPI)) { - prBssDesc->fgIEWAPI = TRUE; - } - break; -#endif - - case ELEM_ID_VENDOR: // ELEM_ID_P2P, ELEM_ID_WMM - { - UINT_8 ucOuiType; - UINT_16 u2SubTypeVersion; -#if CFG_PRIVACY_MIGRATION - if (rsnParseCheckForWFAInfoElem(prAdapter, pucIE, &ucOuiType, &u2SubTypeVersion)) { - if ((ucOuiType == VENDOR_OUI_TYPE_WPA) && - (u2SubTypeVersion == VERSION_WPA)) { - - if (rsnParseWpaIE(prAdapter, WPA_IE(pucIE), &prBssDesc->rWPAInfo)) { - prBssDesc->fgIEWPA = TRUE; - } - } - } -#endif - -#if CFG_ENABLE_WIFI_DIRECT - if(prAdapter->fgIsP2PRegistered) { - if (p2pFuncParseCheckForP2PInfoElem(prAdapter, pucIE, &ucOuiType)) { - if (ucOuiType == VENDOR_OUI_TYPE_P2P) { - prBssDesc->fgIsP2PPresent = TRUE; - } - } - } -#endif /* CFG_ENABLE_WIFI_DIRECT */ - } - break; - - /* no default */ - } - } - - - //4 <3.2> Save information from IEs - SSID - /* Update Flag of Hidden SSID for used in SEARCH STATE. */ - - /* NOTE(Kevin): in current driver, the ucSSIDLen == 0 represent - * all cases of hidden SSID. - * If the fgIsHiddenSSID == TRUE, it means we didn't get the ProbeResp with - * valid SSID. - */ - if (prBssDesc->ucSSIDLen == 0) { - prBssDesc->fgIsHiddenSSID = TRUE; - } - else { - prBssDesc->fgIsHiddenSSID = FALSE; - } - - - //4 <3.3> Check rate information in related IEs. - if (prIeSupportedRate || prIeExtSupportedRate) { - rateGetRateSetFromIEs(prIeSupportedRate, - prIeExtSupportedRate, - &prBssDesc->u2OperationalRateSet, - &prBssDesc->u2BSSBasicRateSet, - &prBssDesc->fgIsUnknownBssBasicRate); - } - - - //4 <4> Update information from HIF RX Header - { - prHifRxHdr = prSwRfb->prHifRxHdr; - - ASSERT(prHifRxHdr); - - //4 <4.1> Get TSF comparison result - prBssDesc->fgIsLargerTSF = HIF_RX_HDR_GET_TCL_FLAG(prHifRxHdr); - - //4 <4.2> Get Band information - prBssDesc->eBand = HIF_RX_HDR_GET_RF_BAND(prHifRxHdr); - - //4 <4.2> Get channel and RCPI information - ucHwChannelNum = HIF_RX_HDR_GET_CHNL_NUM(prHifRxHdr); - - if (BAND_2G4 == prBssDesc->eBand) { - - /* Update RCPI if in right channel */ - if (ucIeDsChannelNum >= 1 && ucIeDsChannelNum <= 14) { - - // Receive Beacon/ProbeResp frame from adjacent channel. - if ((ucIeDsChannelNum == ucHwChannelNum) || - (prHifRxHdr->ucRcpi > prBssDesc->ucRCPI)) { - prBssDesc->ucRCPI = prHifRxHdr->ucRcpi; - } - - // trust channel information brought by IE - prBssDesc->ucChannelNum = ucIeDsChannelNum; - } - else if(ucIeHtChannelNum >= 1 && ucIeHtChannelNum <= 14) { - // Receive Beacon/ProbeResp frame from adjacent channel. - if ((ucIeHtChannelNum == ucHwChannelNum) || - (prHifRxHdr->ucRcpi > prBssDesc->ucRCPI)) { - prBssDesc->ucRCPI = prHifRxHdr->ucRcpi; - } - - // trust channel information brought by IE - prBssDesc->ucChannelNum = ucIeHtChannelNum; - } - else { - prBssDesc->ucRCPI = prHifRxHdr->ucRcpi; - - prBssDesc->ucChannelNum = ucHwChannelNum; - } - } - // 5G Band - else { - if(ucIeHtChannelNum >= 1 && ucIeHtChannelNum < 200) { - // Receive Beacon/ProbeResp frame from adjacent channel. - if ((ucIeHtChannelNum == ucHwChannelNum) || - (prHifRxHdr->ucRcpi > prBssDesc->ucRCPI)) { - prBssDesc->ucRCPI = prHifRxHdr->ucRcpi; - } - - // trust channel information brought by IE - prBssDesc->ucChannelNum = ucIeHtChannelNum; - } - else { - /* Always update RCPI */ - prBssDesc->ucRCPI = prHifRxHdr->ucRcpi; - - prBssDesc->ucChannelNum = ucHwChannelNum; - } - } - } - - - //4 <5> PHY type setting - prBssDesc->ucPhyTypeSet = 0; - - if (BAND_2G4 == prBssDesc->eBand) { - /* check if support 11n */ - if (prBssDesc->fgIsHTPresent) { - prBssDesc->ucPhyTypeSet |= PHY_TYPE_BIT_HT; - } - - /* if not 11n only */ - if (!(prBssDesc->u2BSSBasicRateSet & RATE_SET_BIT_HT_PHY)) { - /* check if support 11g */ - if ((prBssDesc->u2OperationalRateSet & RATE_SET_OFDM) || - prBssDesc->fgIsERPPresent) { - prBssDesc->ucPhyTypeSet |= PHY_TYPE_BIT_ERP; - } - - /* if not 11g only */ - if (!(prBssDesc->u2BSSBasicRateSet & RATE_SET_OFDM)) { - /* check if support 11b */ - if ((prBssDesc->u2OperationalRateSet & RATE_SET_HR_DSSS)) { - prBssDesc->ucPhyTypeSet |= PHY_TYPE_BIT_HR_DSSS; - } - } - } - } - else { /* (BAND_5G == prBssDesc->eBande) */ - /* check if support 11n */ - if (prBssDesc->fgIsHTPresent) { - prBssDesc->ucPhyTypeSet |= PHY_TYPE_BIT_HT; - } - - /* if not 11n only */ - if (!(prBssDesc->u2BSSBasicRateSet & RATE_SET_BIT_HT_PHY)) { - /* Support 11a definitely */ - prBssDesc->ucPhyTypeSet |= PHY_TYPE_BIT_OFDM; - - ASSERT(!(prBssDesc->u2OperationalRateSet & RATE_SET_HR_DSSS)); - } - } - - - //4 <6> Update BSS_DESC_T's Last Update TimeStamp. - GET_CURRENT_SYSTIME(&prBssDesc->rUpdateTime); - - return prBssDesc; -} - -#if RSSI_ENHANCE - -extern int numOfTblRssi; -extern TABLE_RSSI mTABLE_RSSI[MAX_SCAN_RSSI_NUM]; -extern int mTblRssiStatus[MAX_SCAN_RSSI_NUM]; - -#define RSSI_DEG(x...) //printk(x) - -PARAM_RSSI processAvgRssi(UINT_8 ucRCPI, PARAM_MAC_ADDRESS rMacAddr) -{ - int bFound, i; - PARAM_RSSI rRssi = RCPI_TO_dBm(ucRCPI); - PARAM_RSSI rRssi2 = rRssi; - PARAM_RSSI AvgRssiX8, AvgRssi; - - if(rRssi < -40) - rRssi += 8; - - RSSI_DEG("---- processAvgRssi ---- \n"); - - bFound = FALSE; - for(i = 0; i < numOfTblRssi; i++) { - RSSI_DEG("-%02x:%02x:%02x:%02x:%02x:%02x\n", - mTABLE_RSSI[i].arMacAddress[0], mTABLE_RSSI[i].arMacAddress[1], mTABLE_RSSI[i].arMacAddress[2], mTABLE_RSSI[i].arMacAddress[3], mTABLE_RSSI[i].arMacAddress[4], mTABLE_RSSI[i].arMacAddress[5]); - if(EQUAL_MAC_ADDR(rMacAddr, mTABLE_RSSI[i].arMacAddress)) { - bFound = TRUE; - AvgRssiX8 = mTABLE_RSSI[i].AvgRssiX8; - AvgRssi = mTABLE_RSSI[i].AvgRssi; - mTblRssiStatus[i] = 1; - break; - } - } - - if(!bFound) { - AvgRssiX8 = rRssi << 3; - AvgRssi = rRssi; - } else { - AvgRssiX8 = (AvgRssiX8 - AvgRssi) + rRssi; - } - - AvgRssi = AvgRssiX8 >> 3; - - if(!bFound) { - COPY_MAC_ADDR(mTABLE_RSSI[numOfTblRssi].arMacAddress, rMacAddr); - mTABLE_RSSI[numOfTblRssi].AvgRssi = AvgRssi; - mTABLE_RSSI[numOfTblRssi].AvgRssiX8 = AvgRssiX8; - numOfTblRssi++; - mTblRssiStatus[i] = 1; - } else { - mTABLE_RSSI[i].AvgRssi = AvgRssi; - mTABLE_RSSI[i].AvgRssiX8 = AvgRssiX8; - } - - RSSI_DEG("results : %02x:%02x:%02x:%02x:%02x:%02x %d -> %d\n", - rMacAddr[0], rMacAddr[1], rMacAddr[2], rMacAddr[3], rMacAddr[4], rMacAddr[5], rRssi2, AvgRssi); - - return AvgRssi; -} - -void sortAvgRssi(void) -{ - int i, index = 0; - - RSSI_DEG("---- sortAvgRssi numOfTblRssi = %d ---- \n", numOfTblRssi); - - for(i = 0; i < numOfTblRssi; i++) { - if(mTblRssiStatus[i] == 1) { - memmove(&mTABLE_RSSI[index++], &mTABLE_RSSI[i], sizeof(TABLE_RSSI)); - } - } - numOfTblRssi = index; - - RSSI_DEG("--numOfTblRssi = %d.\n", numOfTblRssi); - - for(i = 0; i < numOfTblRssi; i++) { - mTblRssiStatus[i] = 0; - } -} - -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Convert the Beacon or ProbeResp Frame in SW_RFB_T to scan result for query -* -* @param[in] prSwRfb Pointer to the receiving SW_RFB_T structure. -* -* @retval WLAN_STATUS_SUCCESS It is a valid Scan Result and been sent to the host. -* @retval WLAN_STATUS_FAILURE It is not a valid Scan Result. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -scanAddScanResult ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBssDesc, - IN P_SW_RFB_T prSwRfb - ) -{ - P_SCAN_INFO_T prScanInfo; - UINT_8 aucRatesEx[PARAM_MAX_LEN_RATES_EX]; - P_WLAN_BEACON_FRAME_T prWlanBeaconFrame; - PARAM_MAC_ADDRESS rMacAddr; - PARAM_SSID_T rSsid; - ENUM_PARAM_NETWORK_TYPE_T eNetworkType; - PARAM_802_11_CONFIG_T rConfiguration; - ENUM_PARAM_OP_MODE_T eOpMode; - UINT_8 ucRateLen = 0; - UINT_32 i; - PARAM_RSSI AvgRssi; - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - - if (prBssDesc->eBand == BAND_2G4) { - if ((prBssDesc->u2OperationalRateSet & RATE_SET_OFDM) - || prBssDesc->fgIsERPPresent) { - eNetworkType = PARAM_NETWORK_TYPE_OFDM24; - } - else { - eNetworkType = PARAM_NETWORK_TYPE_DS; - } - } - else { - ASSERT(prBssDesc->eBand == BAND_5G); - eNetworkType = PARAM_NETWORK_TYPE_OFDM5; - } - - if(prBssDesc->eBSSType == BSS_TYPE_P2P_DEVICE) { - /* NOTE(Kevin): Not supported by WZC(TBD) */ - return WLAN_STATUS_FAILURE; - } - - prWlanBeaconFrame = (P_WLAN_BEACON_FRAME_T)prSwRfb->pvHeader; - COPY_MAC_ADDR(rMacAddr, prWlanBeaconFrame->aucBSSID); - COPY_SSID(rSsid.aucSsid, - rSsid.u4SsidLen, - prBssDesc->aucSSID, - prBssDesc->ucSSIDLen); - - rConfiguration.u4Length = sizeof(PARAM_802_11_CONFIG_T); - rConfiguration.u4BeaconPeriod = (UINT_32) prWlanBeaconFrame->u2BeaconInterval; - rConfiguration.u4ATIMWindow = prBssDesc->u2ATIMWindow; - rConfiguration.u4DSConfig = nicChannelNum2Freq(prBssDesc->ucChannelNum); - rConfiguration.rFHConfig.u4Length = sizeof(PARAM_802_11_CONFIG_FH_T); - - rateGetDataRatesFromRateSet(prBssDesc->u2OperationalRateSet, - 0, - aucRatesEx, - &ucRateLen); - - /* NOTE(Kevin): Set unused entries, if any, at the end of the array to 0. - * from OID_802_11_BSSID_LIST - */ - for (i = ucRateLen; i < sizeof(aucRatesEx) / sizeof(aucRatesEx[0]) ; i++) { - aucRatesEx[i] = 0; - } - - switch(prBssDesc->eBSSType) { - case BSS_TYPE_IBSS: - eOpMode = NET_TYPE_IBSS; - break; - - case BSS_TYPE_INFRASTRUCTURE: - case BSS_TYPE_P2P_DEVICE: - case BSS_TYPE_BOW_DEVICE: - default: - eOpMode = NET_TYPE_INFRA; - break; - } - -#if RSSI_ENHANCE - AvgRssi = processAvgRssi(prBssDesc->ucRCPI, rMacAddr); -#endif - - kalIndicateBssInfo(prAdapter->prGlueInfo, - (PUINT_8)prSwRfb->pvHeader, - prSwRfb->u2PacketLen, - prBssDesc->ucChannelNum, -#if RSSI_ENHANCE - AvgRssi); -#else - RCPI_TO_dBm(prBssDesc->ucRCPI)); -#endif - - nicAddScanResult(prAdapter, - rMacAddr, - &rSsid, - prWlanBeaconFrame->u2CapInfo & CAP_INFO_PRIVACY ? 1 : 0, - RCPI_TO_dBm(prBssDesc->ucRCPI), - eNetworkType, - &rConfiguration, - eOpMode, - aucRatesEx, - prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen, - (PUINT_8)((UINT_32)(prSwRfb->pvHeader) + WLAN_MAC_MGMT_HEADER_LEN)); - - return WLAN_STATUS_SUCCESS; - -} /* end of scanAddScanResult() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Parse the content of given Beacon or ProbeResp Frame. -* -* @param[in] prSwRfb Pointer to the receiving SW_RFB_T structure. -* -* @retval WLAN_STATUS_SUCCESS if not report this SW_RFB_T to host -* @retval WLAN_STATUS_PENDING if report this SW_RFB_T to host as scan result -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -scanProcessBeaconAndProbeResp ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_CONNECTION_SETTINGS_T prConnSettings; - P_BSS_DESC_T prBssDesc = (P_BSS_DESC_T)NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - P_BSS_INFO_T prAisBssInfo; - P_WLAN_BEACON_FRAME_T prWlanBeaconFrame = (P_WLAN_BEACON_FRAME_T)NULL; -#if CFG_SLT_SUPPORT - P_SLT_INFO_T prSltInfo = (P_SLT_INFO_T)NULL; -#endif - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - //4 <0> Ignore invalid Beacon Frame - if ((prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen) < - (TIMESTAMP_FIELD_LEN + BEACON_INTERVAL_FIELD_LEN + CAP_INFO_FIELD_LEN)) { -#ifndef _lint - ASSERT(0); -#endif /* _lint */ - return rStatus; - } - -#if CFG_SLT_SUPPORT - prSltInfo = &prAdapter->rWifiVar.rSltInfo; - - if (prSltInfo->fgIsDUT) { - DBGLOG(P2P, INFO, ("\n\rBCN: RX\n")); - prSltInfo->u4BeaconReceiveCnt++; - return WLAN_STATUS_SUCCESS; - } - else { - return WLAN_STATUS_SUCCESS; - } -#endif - - - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]); - prWlanBeaconFrame = (P_WLAN_BEACON_FRAME_T)prSwRfb->pvHeader; - - //4 <1> Parse and add into BSS_DESC_T - prBssDesc = scanAddToBssDesc(prAdapter, prSwRfb); - - if (prBssDesc) { - - //4 <1.1> Beacon Change Detection for Connected BSS - if(prAisBssInfo->eConnectionState == PARAM_MEDIA_STATE_CONNECTED && - ((prBssDesc->eBSSType == BSS_TYPE_INFRASTRUCTURE && prConnSettings->eOPMode != NET_TYPE_IBSS) - || (prBssDesc->eBSSType == BSS_TYPE_IBSS && prConnSettings->eOPMode != NET_TYPE_INFRA)) && - EQUAL_MAC_ADDR(prBssDesc->aucBSSID, prAisBssInfo->aucBSSID) && - EQUAL_SSID(prBssDesc->aucSSID, prBssDesc->ucSSIDLen, prAisBssInfo->aucSSID, prAisBssInfo->ucSSIDLen)) { - BOOLEAN fgNeedDisconnect = FALSE; - -#if CFG_SUPPORT_BEACON_CHANGE_DETECTION - // <1.1.2> check if supported rate differs - if(prAisBssInfo->u2OperationalRateSet != prBssDesc->u2OperationalRateSet) { - fgNeedDisconnect = TRUE; - } -#endif - - // <1.1.3> beacon content change detected, disconnect immediately - if(fgNeedDisconnect == TRUE) { - aisBssBeaconTimeout(prAdapter); - } - } - - //4 <1.1> Update AIS_BSS_INFO - if(((prBssDesc->eBSSType == BSS_TYPE_INFRASTRUCTURE && prConnSettings->eOPMode != NET_TYPE_IBSS) - || (prBssDesc->eBSSType == BSS_TYPE_IBSS && prConnSettings->eOPMode != NET_TYPE_INFRA))) { - if (prAisBssInfo->eConnectionState == PARAM_MEDIA_STATE_CONNECTED) { - - /* *not* checking prBssDesc->fgIsConnected anymore, - * due to Linksys AP uses " " as hidden SSID, and would have different BSS descriptor */ - if ((!prAisBssInfo->ucDTIMPeriod) && - EQUAL_MAC_ADDR(prBssDesc->aucBSSID, prAisBssInfo->aucBSSID) && - (prAisBssInfo->eCurrentOPMode == OP_MODE_INFRASTRUCTURE) && - ((prWlanBeaconFrame->u2FrameCtrl & MASK_FRAME_TYPE) == MAC_FRAME_BEACON)) { - - prAisBssInfo->ucDTIMPeriod = prBssDesc->ucDTIMPeriod; - - /* sync with firmware for beacon information */ - nicPmIndicateBssConnected(prAdapter, NETWORK_TYPE_AIS_INDEX); - } - } - -#if CFG_SUPPORT_ADHOC - if (EQUAL_SSID(prBssDesc->aucSSID, - prBssDesc->ucSSIDLen, - prConnSettings->aucSSID, - prConnSettings->ucSSIDLen) && - (prBssDesc->eBSSType == BSS_TYPE_IBSS) && - (prAisBssInfo->eCurrentOPMode == OP_MODE_IBSS)) { - - ibssProcessMatchedBeacon(prAdapter, prAisBssInfo, prBssDesc, prSwRfb->prHifRxHdr->ucRcpi); - } -#endif /* CFG_SUPPORT_ADHOC */ - } - - rlmProcessBcn(prAdapter, - prSwRfb, - ((P_WLAN_BEACON_FRAME_T)(prSwRfb->pvHeader))->aucInfoElem, - (prSwRfb->u2PacketLen - prSwRfb->u2HeaderLen) - - (UINT_16)(OFFSET_OF(WLAN_BEACON_FRAME_BODY_T, aucInfoElem[0]))); - - //4 <3> Send SW_RFB_T to HIF when we perform SCAN for HOST - if(prBssDesc->eBSSType == BSS_TYPE_INFRASTRUCTURE - || prBssDesc->eBSSType == BSS_TYPE_IBSS) { - /* for AIS, send to host */ - if (prConnSettings->fgIsScanReqIssued && - rlmDomainIsLegalChannel(prAdapter, prBssDesc->eBand, prBssDesc->ucChannelNum) == TRUE) { - ENUM_BAND_T eBand; - UINT_8 ucChannel; - BOOLEAN fgAddToScanResult; - - /* check ucChannelNum/eBand for adjacement channel filtering */ - if(cnmAisInfraChannelFixed(prAdapter, &eBand, &ucChannel) == TRUE && - (eBand != prBssDesc->eBand || ucChannel != prBssDesc->ucChannelNum)) { - fgAddToScanResult = FALSE; - } - else { - fgAddToScanResult = TRUE; - } - - if(fgAddToScanResult == TRUE) { - rStatus = scanAddScanResult(prAdapter, prBssDesc, prSwRfb); - } - } - } - -#if CFG_ENABLE_WIFI_DIRECT - if(prAdapter->fgIsP2PRegistered) { - scanP2pProcessBeaconAndProbeResp( - prAdapter, - prSwRfb, - &rStatus, - prBssDesc, - prWlanBeaconFrame); - } -#endif - } - - return rStatus; - -} /* end of scanProcessBeaconAndProbeResp() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Search the Candidate of BSS Descriptor for JOIN(Infrastructure) or -* MERGE(AdHoc) according to current Connection Policy. -* -* \return Pointer to BSS Descriptor, if found. NULL, if not found -*/ -/*----------------------------------------------------------------------------*/ -P_BSS_DESC_T -scanSearchBssDescByPolicy ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex - ) -{ - P_CONNECTION_SETTINGS_T prConnSettings; - P_BSS_INFO_T prBssInfo; - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecBssInfo; - P_SCAN_INFO_T prScanInfo; - - P_LINK_T prBSSDescList; - - P_BSS_DESC_T prBssDesc = (P_BSS_DESC_T)NULL; - P_BSS_DESC_T prPrimaryBssDesc = (P_BSS_DESC_T)NULL; - P_BSS_DESC_T prCandidateBssDesc = (P_BSS_DESC_T)NULL; - - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - P_STA_RECORD_T prPrimaryStaRec; - P_STA_RECORD_T prCandidateStaRec = (P_STA_RECORD_T)NULL; - - OS_SYSTIME rCurrentTime; - - /* The first one reach the check point will be our candidate */ - BOOLEAN fgIsFindFirst = (BOOLEAN)FALSE; - - BOOLEAN fgIsFindBestRSSI = (BOOLEAN)FALSE; - BOOLEAN fgIsFindBestEncryptionLevel = (BOOLEAN)FALSE; - //BOOLEAN fgIsFindMinChannelLoad = (BOOLEAN)FALSE; - - /* TODO(Kevin): Support Min Channel Load */ - //UINT_8 aucChannelLoad[CHANNEL_NUM] = {0}; - - BOOLEAN fgIsFixedChannel; - ENUM_BAND_T eBand; - UINT_8 ucChannel; - - ASSERT(prAdapter); - - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[eNetTypeIndex]); - - prAisSpecBssInfo = &(prAdapter->rWifiVar.rAisSpecificBssInfo); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prBSSDescList = &prScanInfo->rBSSDescList; - - GET_CURRENT_SYSTIME(&rCurrentTime); - - /* check for fixed channel operation */ - if(eNetTypeIndex == NETWORK_TYPE_AIS_INDEX) { - fgIsFixedChannel = cnmAisInfraChannelFixed(prAdapter, &eBand, &ucChannel); - } - else { - fgIsFixedChannel = FALSE; - } - -#if DBG - if (prConnSettings->ucSSIDLen < ELEM_MAX_LEN_SSID) { - prConnSettings->aucSSID[prConnSettings->ucSSIDLen] = '\0'; - } -#endif - - DBGLOG(SCN, INFO, ("SEARCH: Num Of BSS_DESC_T = %d, Look for SSID: %s\n", - prBSSDescList->u4NumElem, prConnSettings->aucSSID)); - - - //4 <1> The outer loop to search for a candidate. - LINK_FOR_EACH_ENTRY(prBssDesc, prBSSDescList, rLinkEntry, BSS_DESC_T) { - - /* TODO(Kevin): Update Minimum Channel Load Information here */ - - DBGLOG(SCN, INFO, ("SEARCH: ["MACSTR"], SSID:%s\n", - MAC2STR(prBssDesc->aucBSSID), prBssDesc->aucSSID)); - - - //4 <2> Check PHY Type and attributes - //4 <2.1> Check Unsupported BSS PHY Type - if (!(prBssDesc->ucPhyTypeSet & (prAdapter->rWifiVar.ucAvailablePhyTypeSet))) { - - DBGLOG(SCN, INFO, ("SEARCH: Ignore unsupported ucPhyTypeSet = %x\n", - prBssDesc->ucPhyTypeSet)); - continue; - } - - //4 <2.2> Check if has unknown NonHT BSS Basic Rate Set. - if (prBssDesc->fgIsUnknownBssBasicRate) { - - continue; - } - - //4 <2.3> Check if fixed operation cases should be aware - if (fgIsFixedChannel == TRUE && - (prBssDesc->eBand != eBand || prBssDesc->ucChannelNum != ucChannel)) { - continue; - } - - //4 <2.4> Check if the channel is legal under regulatory domain - if(rlmDomainIsLegalChannel(prAdapter, prBssDesc->eBand, prBssDesc->ucChannelNum) == FALSE) { - continue; - } - - //4 <2.5> Check if this BSS_DESC_T is stale - if (CHECK_FOR_TIMEOUT(rCurrentTime, prBssDesc->rUpdateTime, - SEC_TO_SYSTIME(SCN_BSS_DESC_REMOVE_TIMEOUT_SEC)) ) { - - continue; - } - - //4 <3> Check if reach the excessive join retry limit - /* NOTE(Kevin): STA_RECORD_T is recorded by TA. */ - prStaRec = cnmGetStaRecByAddress(prAdapter, (UINT_8) eNetTypeIndex, - prBssDesc->aucSrcAddr); - - if (prStaRec) { - /* NOTE(Kevin): - * The Status Code is the result of a Previous Connection Request, we use this as SCORE for choosing a proper - * candidate (Also used for compare see <6>) - * The Reason Code is an indication of the reason why AP reject us, we use this Code for "Reject" - * a SCAN result to become our candidate(Like a blacklist). - */ -#if 0 /* TODO(Kevin): */ - if (prStaRec->u2ReasonCode != REASON_CODE_RESERVED) { - DBGLOG(SCN, INFO, ("SEARCH: Ignore BSS with previous Reason Code = %d\n", - prStaRec->u2ReasonCode)); - continue; - } - else -#endif - if (prStaRec->u2StatusCode != STATUS_CODE_SUCCESSFUL) { - /* NOTE(Kevin): greedy association - after timeout, we'll still - * try to associate to the AP whose STATUS of conection attempt - * was not success. - * We may also use (ucJoinFailureCount x JOIN_RETRY_INTERVAL_SEC) for - * time bound. - */ - if ((prStaRec->ucJoinFailureCount < JOIN_MAX_RETRY_FAILURE_COUNT) || - (CHECK_FOR_TIMEOUT(rCurrentTime, - prStaRec->rLastJoinTime, - SEC_TO_SYSTIME(JOIN_RETRY_INTERVAL_SEC)))) { - - /* NOTE(Kevin): Every JOIN_RETRY_INTERVAL_SEC interval, we can retry - * JOIN_MAX_RETRY_FAILURE_COUNT times. - */ - if (prStaRec->ucJoinFailureCount >= JOIN_MAX_RETRY_FAILURE_COUNT) { - prStaRec->ucJoinFailureCount = 0; - } - DBGLOG(SCN, INFO, ("SEARCH: Try to join BSS again which has Status Code = %d (Curr = %ld/Last Join = %ld)\n", - prStaRec->u2StatusCode, rCurrentTime, prStaRec->rLastJoinTime)); - } - else { - DBGLOG(SCN, INFO, ("SEARCH: Ignore BSS which reach maximum Join Retry Count = %d \n", - JOIN_MAX_RETRY_FAILURE_COUNT)); - continue; - } - - } - } - - - //4 <4> Check for various NETWORK conditions - if (eNetTypeIndex == NETWORK_TYPE_AIS_INDEX) { - - //4 <4.1> Check BSS Type for the corresponding Operation Mode in Connection Setting - /* NOTE(Kevin): For NET_TYPE_AUTO_SWITCH, we will always pass following check. */ - if (((prConnSettings->eOPMode == NET_TYPE_INFRA) && - (prBssDesc->eBSSType != BSS_TYPE_INFRASTRUCTURE)) || - ((prConnSettings->eOPMode == NET_TYPE_IBSS || prConnSettings->eOPMode == NET_TYPE_DEDICATED_IBSS) && - (prBssDesc->eBSSType != BSS_TYPE_IBSS))) { - - DBGLOG(SCN, INFO, ("SEARCH: Ignore eBSSType = %s\n", - ((prBssDesc->eBSSType == BSS_TYPE_INFRASTRUCTURE) ? - "INFRASTRUCTURE" : "IBSS"))); - continue; - } - - //4 <4.2> Check AP's BSSID if OID_802_11_BSSID has been set. - if ((prConnSettings->fgIsConnByBssidIssued) && - (prBssDesc->eBSSType == BSS_TYPE_INFRASTRUCTURE)) { - - if (UNEQUAL_MAC_ADDR(prConnSettings->aucBSSID, prBssDesc->aucBSSID)) { - - DBGLOG(SCN, INFO, ("SEARCH: Ignore due to BSSID was not matched!\n")); - continue; - } - } - -#if CFG_SUPPORT_ADHOC - //4 <4.3> Check for AdHoc Mode - if (prBssDesc->eBSSType == BSS_TYPE_IBSS) { - OS_SYSTIME rCurrentTime; - - //4 <4.3.1> Check if this SCAN record has been updated recently for IBSS. - /* NOTE(Kevin): Because some STA may change its BSSID frequently after it - * create the IBSS - e.g. IPN2220, so we need to make sure we get the new one. - * For BSS, if the old record was matched, however it won't be able to pass - * the Join Process later. - */ - GET_CURRENT_SYSTIME(&rCurrentTime); - if (CHECK_FOR_TIMEOUT(rCurrentTime, prBssDesc->rUpdateTime, - SEC_TO_SYSTIME(SCN_ADHOC_BSS_DESC_TIMEOUT_SEC))) { - DBGLOG(SCN, LOUD, ("SEARCH: Skip old record of BSS Descriptor - BSSID:["MACSTR"]\n\n", - MAC2STR(prBssDesc->aucBSSID))); - continue; - } - - //4 <4.3.2> Check Peer's capability - if (ibssCheckCapabilityForAdHocMode(prAdapter, prBssDesc) == WLAN_STATUS_FAILURE) { - - DBGLOG(SCN, INFO, - ("SEARCH: Ignore BSS DESC MAC: "MACSTR", Capability is not supported for current AdHoc Mode.\n", - MAC2STR(prPrimaryBssDesc->aucBSSID))); - - continue; - } - - - //4 <4.3.3> Compare TSF - if (prBssInfo->fgIsBeaconActivated && - UNEQUAL_MAC_ADDR(prBssInfo->aucBSSID, prBssDesc->aucBSSID)) { - - DBGLOG(SCN, LOUD, - ("SEARCH: prBssDesc->fgIsLargerTSF = %d\n", - prBssDesc->fgIsLargerTSF)); - - if (!prBssDesc->fgIsLargerTSF) { - DBGLOG(SCN, INFO, - ("SEARCH: Ignore BSS DESC MAC: ["MACSTR"], Smaller TSF\n", MAC2STR(prBssDesc->aucBSSID))); - continue; - } - } - } -#endif /* CFG_SUPPORT_ADHOC */ - - } - - - - -#if 0 /* TODO(Kevin): For IBSS */ - //4 <2.c> Check if this SCAN record has been updated recently for IBSS. - /* NOTE(Kevin): Because some STA may change its BSSID frequently after it - * create the IBSS, so we need to make sure we get the new one. - * For BSS, if the old record was matched, however it won't be able to pass - * the Join Process later. - */ - if (prBssDesc->eBSSType == BSS_TYPE_IBSS) { - OS_SYSTIME rCurrentTime; - - GET_CURRENT_SYSTIME(&rCurrentTime); - if (CHECK_FOR_TIMEOUT(rCurrentTime, prBssDesc->rUpdateTime, - SEC_TO_SYSTIME(BSS_DESC_TIMEOUT_SEC))) { - DBGLOG(SCAN, TRACE, ("Skip old record of BSS Descriptor - BSSID:["MACSTR"]\n\n", - MAC2STR(prBssDesc->aucBSSID))); - continue; - } - } - - if ((prBssDesc->eBSSType == BSS_TYPE_INFRASTRUCTURE) && - (prAdapter->eConnectionState == MEDIA_STATE_CONNECTED)) { - OS_SYSTIME rCurrentTime; - - GET_CURRENT_SYSTIME(&rCurrentTime); - if (CHECK_FOR_TIMEOUT(rCurrentTime, prBssDesc->rUpdateTime, - SEC_TO_SYSTIME(BSS_DESC_TIMEOUT_SEC))) { - DBGLOG(SCAN, TRACE, ("Skip old record of BSS Descriptor - BSSID:["MACSTR"]\n\n", - MAC2STR(prBssDesc->aucBSSID))); - continue; - } - } - - - //4 <4B> Check for IBSS AdHoc Mode. - /* Skip if one or more BSS Basic Rate are not supported by current AdHocMode */ - if (prPrimaryBssDesc->eBSSType == BSS_TYPE_IBSS) { - //4 <4B.1> Check if match the Capability of current IBSS AdHoc Mode. - if (ibssCheckCapabilityForAdHocMode(prAdapter, prPrimaryBssDesc) == WLAN_STATUS_FAILURE) { - - DBGLOG(SCAN, TRACE, - ("Ignore BSS DESC MAC: "MACSTR", Capability is not supported for current AdHoc Mode.\n", - MAC2STR(prPrimaryBssDesc->aucBSSID))); - - continue; - } - - - //4 <4B.2> IBSS Merge Decision Flow for SEARCH STATE. - if (prAdapter->fgIsIBSSActive && - UNEQUAL_MAC_ADDR(prBssInfo->aucBSSID, prPrimaryBssDesc->aucBSSID)) { - - if (!fgIsLocalTSFRead) { - NIC_GET_CURRENT_TSF(prAdapter, &rCurrentTsf); - - DBGLOG(SCAN, TRACE, - ("\n\nCurrent TSF : %08lx-%08lx\n\n", - rCurrentTsf.u.HighPart, rCurrentTsf.u.LowPart)); - } - - if (rCurrentTsf.QuadPart > prPrimaryBssDesc->u8TimeStamp.QuadPart) { - DBGLOG(SCAN, TRACE, - ("Ignore BSS DESC MAC: ["MACSTR"], Current BSSID: ["MACSTR"].\n", - MAC2STR(prPrimaryBssDesc->aucBSSID), MAC2STR(prBssInfo->aucBSSID))); - - DBGLOG(SCAN, TRACE, - ("\n\nBSS's TSF : %08lx-%08lx\n\n", - prPrimaryBssDesc->u8TimeStamp.u.HighPart, prPrimaryBssDesc->u8TimeStamp.u.LowPart)); - - prPrimaryBssDesc->fgIsLargerTSF = FALSE; - continue; - } - else { - prPrimaryBssDesc->fgIsLargerTSF = TRUE; - } - - } - } - - //4 <5> Check the Encryption Status. - if (rsnPerformPolicySelection(prPrimaryBssDesc)) { - - if (prPrimaryBssDesc->ucEncLevel > 0) { - fgIsFindBestEncryptionLevel = TRUE; - - fgIsFindFirst = FALSE; - } - } - else { - /* Can't pass the Encryption Status Check, get next one */ - continue; - } - - /* For RSN Pre-authentication, update the PMKID canidate list for - same SSID and encrypt status */ - /* Update PMKID candicate list. */ - if (prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA2) { - rsnUpdatePmkidCandidateList(prPrimaryBssDesc); - if (prAdapter->rWifiVar.rAisBssInfo.u4PmkidCandicateCount) { - prAdapter->rWifiVar.rAisBssInfo.fgIndicatePMKID = rsnCheckPmkidCandicate(); - } - } - -#endif - - - prPrimaryBssDesc = (P_BSS_DESC_T)NULL; - - //4 <6> Check current Connection Policy. - switch (prConnSettings->eConnectionPolicy) { - case CONNECT_BY_SSID_BEST_RSSI: - /* Choose Hidden SSID to join only if the `fgIsEnableJoin...` is TRUE */ - if (prAdapter->rWifiVar.fgEnableJoinToHiddenSSID && prBssDesc->fgIsHiddenSSID) { - /* NOTE(Kevin): following if () statement means that - * If Target is hidden, then we won't connect when user specify SSID_ANY policy. - */ - if (prConnSettings->ucSSIDLen) { - prPrimaryBssDesc = prBssDesc; - - fgIsFindBestRSSI = TRUE; - } - - } - else if (EQUAL_SSID(prBssDesc->aucSSID, - prBssDesc->ucSSIDLen, - prConnSettings->aucSSID, - prConnSettings->ucSSIDLen)) { - prPrimaryBssDesc = prBssDesc; - - fgIsFindBestRSSI = TRUE; - } - break; - - case CONNECT_BY_SSID_ANY: - /* NOTE(Kevin): In this policy, we don't know the desired - * SSID from user, so we should exclude the Hidden SSID from scan list. - * And because we refuse to connect to Hidden SSID node at the beginning, so - * when the JOIN Module deal with a BSS_DESC_T which has fgIsHiddenSSID == TRUE, - * then the Connection Settings must be valid without doubt. - */ - if (!prBssDesc->fgIsHiddenSSID) { - prPrimaryBssDesc = prBssDesc; - - fgIsFindFirst = TRUE; - } - break; - - case CONNECT_BY_BSSID: - if(EQUAL_MAC_ADDR(prBssDesc->aucBSSID, prConnSettings->aucBSSID)) { - prPrimaryBssDesc = prBssDesc; - } - break; - - default: - break; - } - - - /* Primary Candidate was not found */ - if (prPrimaryBssDesc == NULL) { - continue; - } - - //4 <7> Check the Encryption Status. - if (prPrimaryBssDesc->eBSSType == BSS_TYPE_INFRASTRUCTURE) { -#if CFG_SUPPORT_WAPI - if (prAdapter->rWifiVar.rConnSettings.fgWapiMode) { - if (wapiPerformPolicySelection(prAdapter, prPrimaryBssDesc)) { - fgIsFindFirst = TRUE; - } - else { - /* Can't pass the Encryption Status Check, get next one */ - continue; - } - } - else -#endif -#if CFG_RSN_MIGRATION - if (rsnPerformPolicySelection(prAdapter, prPrimaryBssDesc)) { - if (prAisSpecBssInfo->fgCounterMeasure) { - DBGLOG(RSN, INFO, ("Skip while at counter measure period!!!\n")); - continue; - } - - if (prPrimaryBssDesc->ucEncLevel > 0) { - fgIsFindBestEncryptionLevel = TRUE; - - fgIsFindFirst = FALSE; - } - -#if 0 - /* Update PMKID candicate list. */ - if (prAdapter->rWifiVar.rConnSettings.eAuthMode == AUTH_MODE_WPA2) { - rsnUpdatePmkidCandidateList(prPrimaryBssDesc); - if (prAisSpecBssInfo->u4PmkidCandicateCount) { - if (rsnCheckPmkidCandicate()) { - DBGLOG(RSN, WARN, ("Prepare a timer to indicate candidate "MACSTR"\n", - MAC2STR(prAisSpecBssInfo->arPmkidCache[prAisSpecBssInfo->u4PmkidCacheCount].rBssidInfo.aucBssid))); - cnmTimerStopTimer(&prAisSpecBssInfo->rPreauthenticationTimer); - cnmTimerStartTimer(&prAisSpecBssInfo->rPreauthenticationTimer, - SEC_TO_MSEC(WAIT_TIME_IND_PMKID_CANDICATE_SEC)); - } - } - } -#endif - } - else { - /* Can't pass the Encryption Status Check, get next one */ - continue; - } -#endif - } - else { - /* Todo:: P2P and BOW Policy Selection */ - } - - prPrimaryStaRec = prStaRec; - - //4 <8> Compare the Candidate and the Primary Scan Record. - if (!prCandidateBssDesc) { - prCandidateBssDesc = prPrimaryBssDesc; - prCandidateStaRec = prPrimaryStaRec; - - //4 <8.1> Condition - Get the first matched one. - if (fgIsFindFirst) { - break; - } - } - else { -#if 0 /* TODO(Kevin): For security(TBD) */ - //4 <6B> Condition - Choose the one with best Encryption Score. - if (fgIsFindBestEncryptionLevel) { - if (prCandidateBssDesc->ucEncLevel < - prPrimaryBssDesc->ucEncLevel) { - - prCandidateBssDesc = prPrimaryBssDesc; - prCandidateStaRec = prPrimaryStaRec; - continue; - } - } - - /* If reach here, that means they have the same Encryption Score. - */ - - //4 <6C> Condition - Give opportunity to the one we didn't connect before. - // For roaming, only compare the candidates other than current associated BSSID. - if (!prCandidateBssDesc->fgIsConnected && !prPrimaryBssDesc->fgIsConnected) { - if ((prCandidateStaRec != (P_STA_RECORD_T)NULL) && - (prCandidateStaRec->u2StatusCode != STATUS_CODE_SUCCESSFUL)) { - - DBGLOG(SCAN, TRACE, ("So far -BSS DESC MAC: "MACSTR" has nonzero Status Code = %d\n", - MAC2STR(prCandidateBssDesc->aucBSSID), prCandidateStaRec->u2StatusCode)); - - if (prPrimaryStaRec != (P_STA_RECORD_T)NULL) { - if (prPrimaryStaRec->u2StatusCode != STATUS_CODE_SUCCESSFUL) { - - /* Give opportunity to the one with smaller rLastJoinTime */ - if (TIME_BEFORE(prCandidateStaRec->rLastJoinTime, - prPrimaryStaRec->rLastJoinTime)) { - continue; - } - /* We've connect to CANDIDATE recently, let us try PRIMARY now */ - else { - prCandidateBssDesc = prPrimaryBssDesc; - prCandidateStaRec = prPrimaryStaRec; - continue; - } - } - /* PRIMARY's u2StatusCode = 0 */ - else { - prCandidateBssDesc = prPrimaryBssDesc; - prCandidateStaRec = prPrimaryStaRec; - continue; - } - } - /* PRIMARY has no StaRec - We didn't connet to PRIMARY before */ - else { - prCandidateBssDesc = prPrimaryBssDesc; - prCandidateStaRec = prPrimaryStaRec; - continue; - } - } - else { - if ((prPrimaryStaRec != (P_STA_RECORD_T)NULL) && - (prPrimaryStaRec->u2StatusCode != STATUS_CODE_SUCCESSFUL)) { - continue; - } - } - } -#endif - - - //4 <6D> Condition - Visible SSID win Hidden SSID. - if (prCandidateBssDesc->fgIsHiddenSSID) { - if (!prPrimaryBssDesc->fgIsHiddenSSID) { - prCandidateBssDesc = prPrimaryBssDesc; /* The non Hidden SSID win. */ - prCandidateStaRec = prPrimaryStaRec; - continue; - } - } - else { - if (prPrimaryBssDesc->fgIsHiddenSSID) { - continue; - } - } - - - //4 <6E> Condition - Choose the one with better RCPI(RSSI). - if (fgIsFindBestRSSI) { - /* TODO(Kevin): We shouldn't compare the actual value, we should - * allow some acceptable tolerance of some RSSI percentage here. - */ - DBGLOG(SCN, TRACE, ("Candidate ["MACSTR"]: RCPI = %d, Primary ["MACSTR"]: RCPI = %d\n", - MAC2STR(prCandidateBssDesc->aucBSSID), prCandidateBssDesc->ucRCPI, - MAC2STR(prPrimaryBssDesc->aucBSSID), prPrimaryBssDesc->ucRCPI)); - - ASSERT(!(prCandidateBssDesc->fgIsConnected && - prPrimaryBssDesc->fgIsConnected)); - - /* NOTE: To prevent SWING, we do roaming only if target AP has at least 5dBm larger than us. */ - if (prCandidateBssDesc->fgIsConnected) { - if (prCandidateBssDesc->ucRCPI + ROAMING_NO_SWING_RCPI_STEP <= prPrimaryBssDesc->ucRCPI) { - - prCandidateBssDesc = prPrimaryBssDesc; - prCandidateStaRec = prPrimaryStaRec; - continue; - } - } - else if (prPrimaryBssDesc->fgIsConnected) { - if (prCandidateBssDesc->ucRCPI < prPrimaryBssDesc->ucRCPI + ROAMING_NO_SWING_RCPI_STEP) { - - prCandidateBssDesc = prPrimaryBssDesc; - prCandidateStaRec = prPrimaryStaRec; - continue; - } - } - else if (prCandidateBssDesc->ucRCPI < prPrimaryBssDesc->ucRCPI) { - prCandidateBssDesc = prPrimaryBssDesc; - prCandidateStaRec = prPrimaryStaRec; - continue; - } - } - -#if 0 - /* If reach here, that means they have the same Encryption Score, and - * both RSSI value are close too. - */ - //4 <6F> Seek the minimum Channel Load for less interference. - if (fgIsFindMinChannelLoad) { - - /* TODO(Kevin): Check which one has minimum channel load in its channel */ - } -#endif - } - } - - return prCandidateBssDesc; - -} /* end of scanSearchBssDescByPolicy() */ - - diff --git a/drivers/net/wireless/mt5931/mgmt/scan_fsm.c b/drivers/net/wireless/mt5931/mgmt/scan_fsm.c deleted file mode 100755 index 98a97aaac135..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/scan_fsm.c +++ /dev/null @@ -1,1113 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/scan_fsm.c#1 $ -*/ - -/*! \file "scan_fsm.c" - \brief This file defines the state transition function for SCAN FSM. - - The SCAN FSM is part of SCAN MODULE and responsible for performing basic SCAN - behavior as metioned in IEEE 802.11 2007 11.1.3.1 & 11.1.3.2 . -*/ - - - -/* -** $Log: scan_fsm.c $ - * - * 06 13 2012 yuche.tsai - * NULL - * Update maintrunk driver. - * Add support for driver compose assoc request frame. - * - * 11 24 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * Adjust code for DBG and CONFIG_XLOG. - * - * 11 14 2011 yuche.tsai - * [WCXRP00001095] [Volunteer Patch][Driver] Always Scan before enable Hot-Spot. - * Fix bug when unregister P2P network.. - * - * 11 11 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * modify the xlog related code. - * - * 11 02 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * adding the code for XLOG. - * - * 08 11 2011 cp.wu - * [WCXRP00000830] [MT6620 Wi-Fi][Firmware] Use MDRDY counter to detect empty channel for shortening scan time - * sparse channel detection: - * driver: collect sparse channel information with scan-done event - - * - * 07 18 2011 cp.wu - * [WCXRP00000858] [MT5931][Driver][Firmware] Add support for scan to search for more than one SSID in a single scanning request - * free mailbox message afte parsing is completed. - * - * 07 18 2011 cp.wu - * [WCXRP00000858] [MT5931][Driver][Firmware] Add support for scan to search for more than one SSID in a single scanning request - * add framework in driver domain for supporting new SCAN_REQ_V2 for more than 1 SSID support as well as uProbeDelay in NDIS 6.x driver model - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 03 29 2011 cp.wu - * [WCXRP00000604] [MT6620 Wi-Fi][Driver] Surpress Klockwork Warning - * surpress klock warning with code path rewritten - * - * 03 18 2011 cm.chang - * [WCXRP00000576] [MT6620 Wi-Fi][Driver][FW] Remove P2P compile option in scan req/cancel command - * As CR title - * - * 02 18 2011 yuche.tsai - * [WCXRP00000478] [Volunteer Patch][MT6620][Driver] Probe request frame during search phase do not contain P2P wildcard SSID. - * Take P2P wildcard SSID into consideration. - * - * 01 27 2011 yuche.tsai - * [WCXRP00000399] [Volunteer Patch][MT6620/MT5931][Driver] Fix scan side effect after P2P module separate. - * Fix scan channel extension issue when p2p module is not registered. - * - * 01 26 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * . - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Fix Compile Error when DBG is disabled. - * - * 12 07 2010 cm.chang - * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant - * 1. Country code is from NVRAM or supplicant - * 2. Change band definition in CMD/EVENT. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 30 2010 cp.wu - * NULL - * eliminate klockwork errors - * - * 08 16 2010 cp.wu - * NULL - * add interface for RLM to trigger OBSS-SCAN. - * - * 08 16 2010 yuche.tsai - * NULL - * Fix bug for processing queued scan request. - * - * 08 11 2010 yuche.tsai - * NULL - * Add a function for returning channel. - * - * 08 05 2010 yuche.tsai - * NULL - * Update SCAN FSM for support P2P Device discovery scan. - * - * 08 03 2010 cp.wu - * NULL - * surpress compilation warning. - * - * 07 26 2010 yuche.tsai - * - * Add option of channel extension while cancelling scan request. - * - * 07 21 2010 yuche.tsai - * - * Add P2P Scan & Scan Result Parsing & Saving. - * - * 07 20 2010 cp.wu - * - * pass band information for scan in an efficient way by mapping ENUM_BAND_T into UINT_8.. - * - * 07 19 2010 cp.wu - * - * due to FW/DRV won't be sync. precisely, some strict assertions should be eased. - * - * 07 19 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * SCN module is now able to handle multiple concurrent scanning requests - * - * 07 16 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * bugfix for SCN migration - * 1) modify QUEUE_CONCATENATE_QUEUES() so it could be used to concatence with an empty queue - * 2) before AIS issues scan request, network(BSS) needs to be activated first - * 3) only invoke COPY_SSID when using specified SSID for scan - * - * 07 15 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * driver no longer generates probe request frames - * - * 07 14 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * pass band with channel number information as scan parameter - * - * 07 14 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * remove timer in DRV-SCN. - * - * 07 09 2010 cp.wu - * - * 1) separate AIS_FSM state for two kinds of scanning. (OID triggered scan, and scan-for-connection) - * 2) eliminate PRE_BSS_DESC_T, Beacon/PrebResp is now parsed in single pass - * 3) implment DRV-SCN module, currently only accepts single scan request, other request will be directly dropped by returning BUSY - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * take use of RLM module for parsing/generating HT IEs for 11n capability - * - * 07 02 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * when returning to SCAN_IDLE state, send a correct message to source FSM. - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * implementation of DRV-SCN and related mailbox message handling. - * - * 06 22 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * comment out RLM APIs by CFG_RLM_MIGRATION. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add scan_fsm into building. - * - * 05 14 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Refine the order of Stop TX Queue and Switch Channel - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Update pause/resume/flush API to new Bitmap API - * - * 05 12 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Add Power Management - Legacy PS-POLL support. - * - * 03 18 2010 kevin.huang - * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support - * Ignore the PROBE_DELAY state if the value of Probe Delay == 0 - * - * 03 10 2010 kevin.huang - * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support - * Add Channel Manager for arbitration of JOIN and SCAN Req - * - * 02 23 2010 kevin.huang - * [BORA00000603][WIFISYS] [New Feature] AAA Module Support - * Add support scan channel 1~14 and update scan result's frequency infou1rwduu`wvpghlqg|n`slk+mpdkb - * - * 01 08 2010 kevin.huang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * Add set RX Filter to receive BCN from different BSSID during SCAN - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * Nov 25 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Remove flag of CFG_TEST_MGMT_FSM - * - * Nov 20 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Change parameter of scanSendProbeReqFrames() - * - * Nov 16 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Update scnFsmSteps() - * - * Nov 5 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * Fix typo - * - * Nov 5 2009 mtk01461 - * [BORA00000018] Integrate WIFI part into BORA for the 1st time - * -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ -#if DBG -/*lint -save -e64 Type mismatch */ -static PUINT_8 apucDebugScanState[SCAN_STATE_NUM] = { - (PUINT_8)DISP_STRING("SCAN_STATE_IDLE"), - (PUINT_8)DISP_STRING("SCAN_STATE_SCANNING"), -}; -/*lint -restore */ -#endif /* DBG */ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -scnFsmSteps ( - IN P_ADAPTER_T prAdapter, - IN ENUM_SCAN_STATE_T eNextState - ) -{ - P_SCAN_INFO_T prScanInfo; - P_SCAN_PARAM_T prScanParam; - P_MSG_HDR_T prMsgHdr; - - BOOLEAN fgIsTransition = (BOOLEAN)FALSE; - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prScanParam = &prScanInfo->rScanParam; - - do { - -#if DBG - DBGLOG(SCN, STATE, ("TRANSITION: [%s] -> [%s]\n", - apucDebugScanState[prScanInfo->eCurrentState], - apucDebugScanState[eNextState])); -#else - DBGLOG(SCN, STATE, ("[%d] TRANSITION: [%d] -> [%d]\n", - DBG_SCN_IDX, - prScanInfo->eCurrentState, - eNextState)); -#endif - - /* NOTE(Kevin): This is the only place to change the eCurrentState(except initial) */ - prScanInfo->eCurrentState = eNextState; - - fgIsTransition = (BOOLEAN)FALSE; - - switch (prScanInfo->eCurrentState) { - case SCAN_STATE_IDLE: - /* check for pending scanning requests */ - if(!LINK_IS_EMPTY(&(prScanInfo->rPendingMsgList))) { - // load next message from pending list as scan parameters - LINK_REMOVE_HEAD(&(prScanInfo->rPendingMsgList), prMsgHdr, P_MSG_HDR_T); - - if(prMsgHdr->eMsgId == MID_AIS_SCN_SCAN_REQ - || prMsgHdr->eMsgId == MID_BOW_SCN_SCAN_REQ - || prMsgHdr->eMsgId == MID_P2P_SCN_SCAN_REQ - || prMsgHdr->eMsgId == MID_RLM_SCN_SCAN_REQ) { - scnFsmHandleScanMsg(prAdapter, (P_MSG_SCN_SCAN_REQ)prMsgHdr); - } - else { - scnFsmHandleScanMsgV2(prAdapter, (P_MSG_SCN_SCAN_REQ_V2)prMsgHdr); - } - - /* switch to next state */ - eNextState = SCAN_STATE_SCANNING; - fgIsTransition = TRUE; - - cnmMemFree(prAdapter, prMsgHdr); - } - break; - - case SCAN_STATE_SCANNING: - if(prScanParam->fgIsScanV2 == FALSE) { - scnSendScanReq(prAdapter); - } - else { - scnSendScanReqV2(prAdapter); - } - break; - - default: - ASSERT(0); - break; - - } - } - while (fgIsTransition); - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Generate CMD_ID_SCAN_REQ command -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -scnSendScanReq ( - IN P_ADAPTER_T prAdapter - ) -{ - P_SCAN_INFO_T prScanInfo; - P_SCAN_PARAM_T prScanParam; - CMD_SCAN_REQ rCmdScanReq; - UINT_32 i; - - ASSERT(prAdapter); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prScanParam = &prScanInfo->rScanParam; - - // send command packet for scan - kalMemZero(&rCmdScanReq, sizeof(CMD_SCAN_REQ)); - - rCmdScanReq.ucSeqNum = prScanParam->ucSeqNum; - rCmdScanReq.ucNetworkType = (UINT_8)prScanParam->eNetTypeIndex; - rCmdScanReq.ucScanType = (UINT_8)prScanParam->eScanType; - rCmdScanReq.ucSSIDType = prScanParam->ucSSIDType; - - if(prScanParam->ucSSIDNum == 1) { - COPY_SSID(rCmdScanReq.aucSSID, - rCmdScanReq.ucSSIDLength, - prScanParam->aucSpecifiedSSID[0], - prScanParam->ucSpecifiedSSIDLen[0]); - } - - rCmdScanReq.ucChannelType = (UINT_8)prScanParam->eScanChannel; - - if (prScanParam->eScanChannel == SCAN_CHANNEL_SPECIFIED) { - /* P2P would use: - * 1. Specified Listen Channel of passive scan for LISTEN state. - * 2. Specified Listen Channel of Target Device of active scan for SEARCH state. (Target != NULL) - */ - rCmdScanReq.ucChannelListNum = prScanParam->ucChannelListNum; - - for(i = 0 ; i < rCmdScanReq.ucChannelListNum ; i++) { - rCmdScanReq.arChannelList[i].ucBand = - (UINT_8) prScanParam->arChnlInfoList[i].eBand; - - rCmdScanReq.arChannelList[i].ucChannelNum = - (UINT_8)prScanParam->arChnlInfoList[i].ucChannelNum; - } - } - -#if CFG_ENABLE_WIFI_DIRECT - if(prScanParam->eNetTypeIndex == NETWORK_TYPE_P2P_INDEX) { - rCmdScanReq.u2ChannelDwellTime = prScanParam->u2PassiveListenInterval; - } -#endif -#if RSSI_ENHANCE - //add by gwl - rCmdScanReq.u2ChannelDwellTime = 200; - rCmdScanReq.u2ChannelMinDwellTime = 200; -#endif - if(prScanParam->u2IELen <= MAX_IE_LENGTH) { - rCmdScanReq.u2IELen = prScanParam->u2IELen; - } - else { - rCmdScanReq.u2IELen = MAX_IE_LENGTH; - } - - if (prScanParam->u2IELen) { - kalMemCopy(rCmdScanReq.aucIE, - prScanParam->aucIE, - sizeof(UINT_8) * rCmdScanReq.u2IELen); - } - - wlanSendSetQueryCmd(prAdapter, - CMD_ID_SCAN_REQ, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - OFFSET_OF(CMD_SCAN_REQ, aucIE) + rCmdScanReq.u2IELen, - (PUINT_8)&rCmdScanReq, - NULL, - 0); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Generate CMD_ID_SCAN_REQ_V2 command -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -scnSendScanReqV2 ( - IN P_ADAPTER_T prAdapter - ) -{ - P_SCAN_INFO_T prScanInfo; - P_SCAN_PARAM_T prScanParam; - CMD_SCAN_REQ_V2 rCmdScanReq; - UINT_32 i; - - ASSERT(prAdapter); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prScanParam = &prScanInfo->rScanParam; - - // send command packet for scan - kalMemZero(&rCmdScanReq, sizeof(CMD_SCAN_REQ_V2)); - - rCmdScanReq.ucSeqNum = prScanParam->ucSeqNum; - rCmdScanReq.ucNetworkType = (UINT_8)prScanParam->eNetTypeIndex; - rCmdScanReq.ucScanType = (UINT_8)prScanParam->eScanType; - rCmdScanReq.ucSSIDType = prScanParam->ucSSIDType; - - for (i = 0 ; i < prScanParam->ucSSIDNum; i++) { - COPY_SSID(rCmdScanReq.arSSID[i].aucSsid, - rCmdScanReq.arSSID[i].u4SsidLen, - prScanParam->aucSpecifiedSSID[i], - prScanParam->ucSpecifiedSSIDLen[i]); - } - - rCmdScanReq.u2ProbeDelayTime = (UINT_8)prScanParam->u2ProbeDelayTime; - rCmdScanReq.ucChannelType = (UINT_8)prScanParam->eScanChannel; - - if (prScanParam->eScanChannel == SCAN_CHANNEL_SPECIFIED) { - /* P2P would use: - * 1. Specified Listen Channel of passive scan for LISTEN state. - * 2. Specified Listen Channel of Target Device of active scan for SEARCH state. (Target != NULL) - */ - rCmdScanReq.ucChannelListNum = prScanParam->ucChannelListNum; - - for(i = 0 ; i < rCmdScanReq.ucChannelListNum ; i++) { - rCmdScanReq.arChannelList[i].ucBand = - (UINT_8) prScanParam->arChnlInfoList[i].eBand; - - rCmdScanReq.arChannelList[i].ucChannelNum = - (UINT_8)prScanParam->arChnlInfoList[i].ucChannelNum; - } - } - -#if CFG_ENABLE_WIFI_DIRECT - if(prScanParam->eNetTypeIndex == NETWORK_TYPE_P2P_INDEX) { - rCmdScanReq.u2ChannelDwellTime = prScanParam->u2PassiveListenInterval; - } -#endif - - if(prScanParam->u2IELen <= MAX_IE_LENGTH) { - rCmdScanReq.u2IELen = prScanParam->u2IELen; - } - else { - rCmdScanReq.u2IELen = MAX_IE_LENGTH; - } - - if (prScanParam->u2IELen) { - kalMemCopy(rCmdScanReq.aucIE, - prScanParam->aucIE, - sizeof(UINT_8) * rCmdScanReq.u2IELen); - } - - wlanSendSetQueryCmd(prAdapter, - CMD_ID_SCAN_REQ_V2, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - OFFSET_OF(CMD_SCAN_REQ_V2, aucIE) + rCmdScanReq.u2IELen, - (PUINT_8)&rCmdScanReq, - NULL, - 0); - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -scnFsmMsgStart ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_SCAN_INFO_T prScanInfo; - P_SCAN_PARAM_T prScanParam; - - ASSERT(prMsgHdr); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prScanParam = &prScanInfo->rScanParam; - - - if (prScanInfo->eCurrentState == SCAN_STATE_IDLE) { - if(prMsgHdr->eMsgId == MID_AIS_SCN_SCAN_REQ - || prMsgHdr->eMsgId == MID_BOW_SCN_SCAN_REQ - || prMsgHdr->eMsgId == MID_P2P_SCN_SCAN_REQ - || prMsgHdr->eMsgId == MID_RLM_SCN_SCAN_REQ) { - scnFsmHandleScanMsg(prAdapter, (P_MSG_SCN_SCAN_REQ)prMsgHdr); - } - else if(prMsgHdr->eMsgId == MID_AIS_SCN_SCAN_REQ_V2 - || prMsgHdr->eMsgId == MID_BOW_SCN_SCAN_REQ_V2 - || prMsgHdr->eMsgId == MID_P2P_SCN_SCAN_REQ_V2 - || prMsgHdr->eMsgId == MID_RLM_SCN_SCAN_REQ_V2) { - scnFsmHandleScanMsgV2(prAdapter, (P_MSG_SCN_SCAN_REQ_V2)prMsgHdr); - } - else { - // should not deliver to this function - ASSERT(0); - } - - cnmMemFree(prAdapter, prMsgHdr); - scnFsmSteps(prAdapter, SCAN_STATE_SCANNING); - } - else { - LINK_INSERT_TAIL(&prScanInfo->rPendingMsgList, &prMsgHdr->rLinkEntry); - } - - return; -} - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -scnFsmMsgAbort ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_HDR_T prMsgHdr - ) -{ - P_MSG_SCN_SCAN_CANCEL prScanCancel; - P_SCAN_INFO_T prScanInfo; - P_SCAN_PARAM_T prScanParam; - CMD_SCAN_CANCEL rCmdScanCancel; - - ASSERT(prMsgHdr); - - prScanCancel = (P_MSG_SCN_SCAN_CANCEL)prMsgHdr; - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prScanParam = &prScanInfo->rScanParam; - - if (prScanInfo->eCurrentState != SCAN_STATE_IDLE) { - if(prScanCancel->ucSeqNum == prScanParam->ucSeqNum && - prScanCancel->ucNetTypeIndex == (UINT_8)prScanParam->eNetTypeIndex) { - /* send cancel message to firmware domain */ - rCmdScanCancel.ucSeqNum = prScanParam->ucSeqNum; - -#if CFG_ENABLE_WIFI_DIRECT - if(prScanParam->eNetTypeIndex == NETWORK_TYPE_P2P_INDEX) { - rCmdScanCancel.ucIsExtChannel = (UINT_8) prScanCancel->fgIsChannelExt; - } - else { - rCmdScanCancel.ucIsExtChannel = (UINT_8) FALSE; - } -#endif - - wlanSendSetQueryCmd(prAdapter, - CMD_ID_SCAN_CANCEL, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_SCAN_CANCEL), - (PUINT_8)&rCmdScanCancel, - NULL, - 0); - - /* generate scan-done event for caller */ - scnFsmGenerateScanDoneMsg(prAdapter, - prScanParam->ucSeqNum, - (UINT_8)prScanParam->eNetTypeIndex, - SCAN_STATUS_CANCELLED); - - /* switch to next pending scan */ - scnFsmSteps(prAdapter, SCAN_STATE_IDLE); - } - else { - scnFsmRemovePendingMsg(prAdapter, prScanCancel->ucSeqNum, prScanCancel->ucNetTypeIndex); - } - } - - cnmMemFree(prAdapter, prMsgHdr); - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Scan Message Parsing (Legacy) -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -scnFsmHandleScanMsg ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_SCN_SCAN_REQ prScanReqMsg - ) -{ - P_SCAN_INFO_T prScanInfo; - P_SCAN_PARAM_T prScanParam; - UINT_32 i; - - ASSERT(prAdapter); - ASSERT(prScanReqMsg); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prScanParam = &prScanInfo->rScanParam; - - prScanParam->eScanType = prScanReqMsg->eScanType; - prScanParam->eNetTypeIndex = (ENUM_NETWORK_TYPE_INDEX_T)prScanReqMsg->ucNetTypeIndex; - prScanParam->ucSSIDType = prScanReqMsg->ucSSIDType; - if (prScanParam->ucSSIDType & (SCAN_REQ_SSID_SPECIFIED | SCAN_REQ_SSID_P2P_WILDCARD)) { - prScanParam->ucSSIDNum = 1; - - COPY_SSID(prScanParam->aucSpecifiedSSID[0], - prScanParam->ucSpecifiedSSIDLen[0], - prScanReqMsg->aucSSID, - prScanReqMsg->ucSSIDLength); - - // reset SSID length to zero for rest array entries - for(i = 1 ; i < SCN_SSID_MAX_NUM ; i++) { - prScanParam->ucSpecifiedSSIDLen[i] = 0; - } - } - else { - prScanParam->ucSSIDNum = 0; - - for(i = 0 ; i < SCN_SSID_MAX_NUM ; i++) { - prScanParam->ucSpecifiedSSIDLen[i] = 0; - } - } - - prScanParam->u2ProbeDelayTime = 0; - prScanParam->eScanChannel = prScanReqMsg->eScanChannel; - if(prScanParam->eScanChannel == SCAN_CHANNEL_SPECIFIED) { - if(prScanReqMsg->ucChannelListNum <= MAXIMUM_OPERATION_CHANNEL_LIST) { - prScanParam->ucChannelListNum = prScanReqMsg->ucChannelListNum; - } - else { - prScanParam->ucChannelListNum = MAXIMUM_OPERATION_CHANNEL_LIST; - } - - kalMemCopy(prScanParam->arChnlInfoList, - prScanReqMsg->arChnlInfoList, - sizeof(RF_CHANNEL_INFO_T) * prScanParam->ucChannelListNum); - } - - if(prScanReqMsg->u2IELen <= MAX_IE_LENGTH) { - prScanParam->u2IELen = prScanReqMsg->u2IELen; - } - else { - prScanParam->u2IELen = MAX_IE_LENGTH; - } - - if(prScanParam->u2IELen) { - kalMemCopy(prScanParam->aucIE, prScanReqMsg->aucIE, prScanParam->u2IELen); - } - -#if CFG_ENABLE_WIFI_DIRECT - if(prScanParam->eNetTypeIndex == NETWORK_TYPE_P2P_INDEX) { - prScanParam->u2PassiveListenInterval = prScanReqMsg->u2ChannelDwellTime; - } -#endif - prScanParam->ucSeqNum = prScanReqMsg->ucSeqNum; - - if(prScanReqMsg->rMsgHdr.eMsgId == MID_RLM_SCN_SCAN_REQ) { - prScanParam->fgIsObssScan = TRUE; - } - else { - prScanParam->fgIsObssScan = FALSE; - } - - prScanParam->fgIsScanV2 = FALSE; - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Scan Message Parsing - V2 with multiple SSID support -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -scnFsmHandleScanMsgV2 ( - IN P_ADAPTER_T prAdapter, - IN P_MSG_SCN_SCAN_REQ_V2 prScanReqMsg - ) -{ - P_SCAN_INFO_T prScanInfo; - P_SCAN_PARAM_T prScanParam; - UINT_32 i; - - ASSERT(prAdapter); - ASSERT(prScanReqMsg); - ASSERT(prScanReqMsg->ucSSIDNum <= SCN_SSID_MAX_NUM); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prScanParam = &prScanInfo->rScanParam; - - prScanParam->eScanType = prScanReqMsg->eScanType; - prScanParam->eNetTypeIndex = (ENUM_NETWORK_TYPE_INDEX_T)prScanReqMsg->ucNetTypeIndex; - prScanParam->ucSSIDType = prScanReqMsg->ucSSIDType; - prScanParam->ucSSIDNum = prScanReqMsg->ucSSIDNum; - - for(i = 0 ; i < prScanReqMsg->ucSSIDNum ; i++) { - COPY_SSID(prScanParam->aucSpecifiedSSID[i], - prScanParam->ucSpecifiedSSIDLen[i], - prScanReqMsg->prSsid[i].aucSsid, - (UINT_8)prScanReqMsg->prSsid[i].u4SsidLen); - } - - prScanParam->u2ProbeDelayTime = prScanReqMsg->u2ProbeDelay; - prScanParam->eScanChannel = prScanReqMsg->eScanChannel; - if(prScanParam->eScanChannel == SCAN_CHANNEL_SPECIFIED) { - if(prScanReqMsg->ucChannelListNum <= MAXIMUM_OPERATION_CHANNEL_LIST) { - prScanParam->ucChannelListNum = prScanReqMsg->ucChannelListNum; - } - else { - prScanParam->ucChannelListNum = MAXIMUM_OPERATION_CHANNEL_LIST; - } - - kalMemCopy(prScanParam->arChnlInfoList, - prScanReqMsg->arChnlInfoList, - sizeof(RF_CHANNEL_INFO_T) * prScanParam->ucChannelListNum); - } - - if(prScanReqMsg->u2IELen <= MAX_IE_LENGTH) { - prScanParam->u2IELen = prScanReqMsg->u2IELen; - } - else { - prScanParam->u2IELen = MAX_IE_LENGTH; - } - - if(prScanParam->u2IELen) { - kalMemCopy(prScanParam->aucIE, prScanReqMsg->aucIE, prScanParam->u2IELen); - } - -#if CFG_ENABLE_WIFI_DIRECT - if(prScanParam->eNetTypeIndex == NETWORK_TYPE_P2P_INDEX) { - prScanParam->u2PassiveListenInterval = prScanReqMsg->u2ChannelDwellTime; - } -#endif - prScanParam->ucSeqNum = prScanReqMsg->ucSeqNum; - - if(prScanReqMsg->rMsgHdr.eMsgId == MID_RLM_SCN_SCAN_REQ) { - prScanParam->fgIsObssScan = TRUE; - } - else { - prScanParam->fgIsObssScan = FALSE; - } - - prScanParam->fgIsScanV2 = TRUE; - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Remove pending scan request -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -scnFsmRemovePendingMsg ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucSeqNum, - IN UINT_8 ucNetTypeIndex - ) -{ - P_SCAN_INFO_T prScanInfo; - P_SCAN_PARAM_T prScanParam; - P_MSG_HDR_T prPendingMsgHdr, prPendingMsgHdrNext, prRemoveMsgHdr = NULL; - P_LINK_ENTRY_T prRemoveLinkEntry = NULL; - - ASSERT(prAdapter); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prScanParam = &prScanInfo->rScanParam; - - /* traverse through rPendingMsgList for removal */ - LINK_FOR_EACH_ENTRY_SAFE(prPendingMsgHdr, - prPendingMsgHdrNext, - &(prScanInfo->rPendingMsgList), - rLinkEntry, - MSG_HDR_T) { - if(prPendingMsgHdr->eMsgId == MID_AIS_SCN_SCAN_REQ - || prPendingMsgHdr->eMsgId == MID_BOW_SCN_SCAN_REQ - || prPendingMsgHdr->eMsgId == MID_P2P_SCN_SCAN_REQ - || prPendingMsgHdr->eMsgId == MID_RLM_SCN_SCAN_REQ) { - P_MSG_SCN_SCAN_REQ prScanReqMsg = (P_MSG_SCN_SCAN_REQ)prPendingMsgHdr; - - if(ucSeqNum == prScanReqMsg->ucSeqNum && - ucNetTypeIndex == prScanReqMsg->ucNetTypeIndex) { - prRemoveLinkEntry = &(prScanReqMsg->rMsgHdr.rLinkEntry); - prRemoveMsgHdr = prPendingMsgHdr; - } - } - else if(prPendingMsgHdr->eMsgId == MID_AIS_SCN_SCAN_REQ_V2 - || prPendingMsgHdr->eMsgId == MID_BOW_SCN_SCAN_REQ_V2 - || prPendingMsgHdr->eMsgId == MID_P2P_SCN_SCAN_REQ_V2 - || prPendingMsgHdr->eMsgId == MID_RLM_SCN_SCAN_REQ_V2) { - P_MSG_SCN_SCAN_REQ_V2 prScanReqMsgV2 = (P_MSG_SCN_SCAN_REQ_V2)prPendingMsgHdr; - - if(ucSeqNum == prScanReqMsgV2->ucSeqNum && - ucNetTypeIndex == prScanReqMsgV2->ucNetTypeIndex) { - prRemoveLinkEntry = &(prScanReqMsgV2->rMsgHdr.rLinkEntry); - prRemoveMsgHdr = prPendingMsgHdr; - } - } - - if(prRemoveLinkEntry) { - /* generate scan-done event for caller */ - scnFsmGenerateScanDoneMsg(prAdapter, - ucSeqNum, - ucNetTypeIndex, - SCAN_STATUS_CANCELLED); - - /* remove from pending list */ - LINK_REMOVE_KNOWN_ENTRY(&(prScanInfo->rPendingMsgList), prRemoveLinkEntry); - cnmMemFree(prAdapter, prRemoveMsgHdr); - - break; - } - } - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -scnEventScanDone ( - IN P_ADAPTER_T prAdapter, - IN P_EVENT_SCAN_DONE prScanDone - ) -{ - P_SCAN_INFO_T prScanInfo; - P_SCAN_PARAM_T prScanParam; - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prScanParam = &prScanInfo->rScanParam; - - // buffer empty channel information - if(prScanParam->eScanChannel == SCAN_CHANNEL_FULL - || prScanParam->eScanChannel == SCAN_CHANNEL_2G4) { - if(prScanDone->ucSparseChannelValid) { - prScanInfo->fgIsSparseChannelValid = TRUE; - prScanInfo->rSparseChannel.eBand = (ENUM_BAND_T)prScanDone->rSparseChannel.ucBand; - prScanInfo->rSparseChannel.ucChannelNum = prScanDone->rSparseChannel.ucChannelNum; - } - else { - prScanInfo->fgIsSparseChannelValid = FALSE; - } - } - - if(prScanInfo->eCurrentState == SCAN_STATE_SCANNING && - prScanDone->ucSeqNum == prScanParam->ucSeqNum) { - /* generate scan-done event for caller */ - scnFsmGenerateScanDoneMsg(prAdapter, - prScanParam->ucSeqNum, - (UINT_8)prScanParam->eNetTypeIndex, - SCAN_STATUS_DONE); - - /* switch to next pending scan */ - scnFsmSteps(prAdapter, SCAN_STATE_IDLE); - } - else { - DBGLOG(SCN, LOUD, ("Unexpected SCAN-DONE event: SeqNum = %d, Current State = %d\n", - prScanDone->ucSeqNum, - prScanInfo->eCurrentState)); - } - - return; -} /* end of scnEventScanDone */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -scnFsmGenerateScanDoneMsg ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucSeqNum, - IN UINT_8 ucNetTypeIndex, - IN ENUM_SCAN_STATUS eScanStatus - ) -{ - P_SCAN_INFO_T prScanInfo; - P_SCAN_PARAM_T prScanParam; - P_MSG_SCN_SCAN_DONE prScanDoneMsg; - - ASSERT(prAdapter); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - prScanParam = &prScanInfo->rScanParam; - - prScanDoneMsg = (P_MSG_SCN_SCAN_DONE)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_SCN_SCAN_DONE)); - if (!prScanDoneMsg) { - ASSERT(0); // Can't indicate SCAN FSM Complete - return; - } - - if(prScanParam->fgIsObssScan == TRUE) { - prScanDoneMsg->rMsgHdr.eMsgId = MID_SCN_RLM_SCAN_DONE; - } - else { - switch((ENUM_NETWORK_TYPE_INDEX_T)ucNetTypeIndex) { - case NETWORK_TYPE_AIS_INDEX: - prScanDoneMsg->rMsgHdr.eMsgId = MID_SCN_AIS_SCAN_DONE; - break; - -#if CFG_ENABLE_WIFI_DIRECT - case NETWORK_TYPE_P2P_INDEX: - prScanDoneMsg->rMsgHdr.eMsgId = MID_SCN_P2P_SCAN_DONE; - break; -#endif - -#if CFG_ENABLE_BT_OVER_WIFI - case NETWORK_TYPE_BOW_INDEX: - prScanDoneMsg->rMsgHdr.eMsgId = MID_SCN_BOW_SCAN_DONE; - break; -#endif - - default: - DBGLOG(SCN, LOUD, ("Unexpected Network Type: %d\n", ucNetTypeIndex)); - ASSERT(0); - break; - } - } - - prScanDoneMsg->ucSeqNum = ucSeqNum; - prScanDoneMsg->ucNetTypeIndex = ucNetTypeIndex; - prScanDoneMsg->eScanStatus = eScanStatus; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prScanDoneMsg, - MSG_SEND_METHOD_BUF); - -} /* end of scnFsmGenerateScanDoneMsg() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Query for most sparse channel -* -* \param[in] -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -scnQuerySparseChannel ( - IN P_ADAPTER_T prAdapter, - P_ENUM_BAND_T prSparseBand, - PUINT_8 pucSparseChannel - ) -{ - P_SCAN_INFO_T prScanInfo; - - ASSERT(prAdapter); - - prScanInfo = &(prAdapter->rWifiVar.rScanInfo); - - if(prScanInfo->fgIsSparseChannelValid == TRUE) { - if(prSparseBand) { - *prSparseBand = prScanInfo->rSparseChannel.eBand; - } - - if(pucSparseChannel) { - *pucSparseChannel = prScanInfo->rSparseChannel.ucChannelNum; - } - - return TRUE; - } - else { - return FALSE; - } -} - diff --git a/drivers/net/wireless/mt5931/mgmt/sec_fsm.c b/drivers/net/wireless/mt5931/mgmt/sec_fsm.c deleted file mode 100755 index 862b9fa64661..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/sec_fsm.c +++ /dev/null @@ -1,1255 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/sec_fsm.c#1 $ -*/ - -/*! \file "sec_fsm.c" - \brief This is the file implement security check state machine. - - In security module, do the port control check after success join to an AP, - and the path to NORMAL TR, the state machine handle these state transition. -*/ - - - -/* -** $Log: sec_fsm.c $ - * - * 11 24 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * Adjust code for DBG and CONFIG_XLOG. - * - * 11 11 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * modify the xlog related code. - * - * 11 10 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * change the debug module level. - * - * 11 02 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * adding the code for XLOG. - * - * 03 29 2011 wh.su - * [WCXRP00000248] [MT6620 Wi-Fi][FW]Fixed the Klockwork error - * fixed the kclocwork error. - * - * 01 26 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * . - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Fix Compile Error when DBG is disabled. - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Change Station Type in Station Record, Modify MACRO definition for getting station type & network type index & Role. - * - * 09 29 2010 wh.su - * [WCXRP00000072] [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue - * [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue. - * - * 09 24 2010 wh.su - * NULL - * [WCXRP00005002][MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 20 2010 wh.su - * NULL - * adding the eapol callback setting. - * - * 08 19 2010 wh.su - * NULL - * adding the tx pkt call back handle for countermeasure. - * - * 07 19 2010 wh.su - * - * fixed the compilng error at debug mode. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 21 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * modify some code for concurrent network. - * - * 06 19 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * consdier the concurrent network setting. - * - * 05 28 2010 wh.su - * [BORA00000626][MT6620] Refine the remove key flow for WHQL testing - * fixed the ad-hoc wpa-none send non-encrypted frame issue. - * - * 05 24 2010 kevin.huang - * [BORA00000794][WIFISYS][New Feature]Power Management Support - * Refine authSendAuthFrame() for NULL STA_RECORD_T case and minimum deauth interval. - * - * 04 24 2010 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW - * - * 04 13 2010 wh.su - * [BORA00000680][MT6620] Support the statistic for Microsoft os query - * fixed the Klocwork error and refine the class error message. - * - * 03 03 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * move the AIS specific variable for security to AIS specific structure. - * - * 03 03 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * Fixed the pre-authentication timer not correctly init issue, and modify the security related callback function prototype. - * - * 03 01 2010 wh.su - * [BORA00000605][WIFISYS] Phase3 Integration - * Refine the variable and parameter for security. - * - * 01 27 2010 wh.su - * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code - * add and fixed some security function. - * - * 01 13 2010 wh.su - * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code - * fixed the compiling warning - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * refine some code - * - * Dec 4 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * refine the code - * - * Dec 1 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * code refine - * - * Nov 23 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adjust the function name - * - * Nov 19 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adjust the state machine, to meet the firmware security design v1.1 - * - * Nov 18 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -#if CFG_RSN_MIGRATION - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ -#if DBG -/*lint -save -e64 Type mismatch */ -static PUINT_8 apucDebugSecState[SEC_STATE_NUM] = { - (PUINT_8)DISP_STRING("SEC_STATE_INIT"), - (PUINT_8)DISP_STRING("SEC_STATE_INITIATOR_PORT_BLOCKED"), - (PUINT_8)DISP_STRING("SEC_STATE_RESPONDER_PORT_BLOCKED"), - (PUINT_8)DISP_STRING("SEC_STATE_CHECK_OK"), - (PUINT_8)DISP_STRING("SEC_STATE_SEND_EAPOL"), - (PUINT_8)DISP_STRING("SEC_STATE_SEND_DEAUTH"), - (PUINT_8)DISP_STRING("SEC_STATE_COUNTERMEASURE"), -}; -/*lint -restore */ -#endif /* DBG */ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will do initialization of Security FSM and all variables in -* SEC_INFO_T. -* -* \param[in] prSta Pointer to the STA record -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -secFsmInit ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - P_SEC_INFO_T prSecInfo; - P_AIS_SPECIFIC_BSS_INFO_T prAisSpecBssInfo; - - ASSERT(prSta); - - prSecInfo = &prSta->rSecInfo; - - #if 1 /* MT6620 */ - //At MT5921, is ok, but at MT6620, firmware base ASIC, the firmware - //will lost these data, thus, driver have to keep the wep material and - //setting to firmware while awake from D3. - #endif - - prSecInfo->eCurrentState = SEC_STATE_INIT; - - prSecInfo->fg2nd1xSend = FALSE; - prSecInfo->fgKeyStored = FALSE; - - if (IS_STA_IN_AIS(prSta)) { - prAisSpecBssInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - - prAisSpecBssInfo->u4RsnaLastMICFailTime = 0; - prAisSpecBssInfo->fgCheckEAPoLTxDone = FALSE; - - cnmTimerInitTimer(prAdapter, - &prAdapter->rWifiVar.rAisSpecificBssInfo.rRsnaEAPoLReportTimeoutTimer, - (PFN_MGMT_TIMEOUT_FUNC)secFsmEventEapolTxTimeout, - (UINT_32)prSta); - - cnmTimerInitTimer(prAdapter, - &prAdapter->rWifiVar.rAisSpecificBssInfo.rRsnaBlockTrafficTimer, - (PFN_MGMT_TIMEOUT_FUNC)secFsmEventEndOfCounterMeasure, - (UINT_32)prSta); - - } - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will do uninitialization of Security FSM and all variables in -* SEC_INFO_T. -* -* \param[in] prSta Pointer to the STA record -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID /* whsu:Todo: */ -secFsmUnInit ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - P_SEC_INFO_T prSecInfo; - - ASSERT(prSta); - - prSecInfo = &prSta->rSecInfo; - - prSecInfo->fg2nd1xSend = FALSE; - prSecInfo->fgKeyStored = FALSE; - - //nicPrivacyRemoveWlanTable(prSta->ucWTEntry); - - if (IS_STA_IN_AIS(prSta)) { - cnmTimerStopTimer(prAdapter, - &prAdapter->rWifiVar.rAisSpecificBssInfo.rRsnaEAPoLReportTimeoutTimer); - cnmTimerStopTimer(prAdapter, - &prAdapter->rWifiVar.rAisSpecificBssInfo.rRsnaBlockTrafficTimer); - } - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will do action part while in STATE transition of -* STANDBY to CHECK_OK. -* -* \param[in] prSta Pointer to the Sta record -* -* \return - none -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -secFsmTrans_INIT_to_CHECK_OK ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - secSetPortBlocked(prAdapter, prSta, FALSE); - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will do action part while in STATE transition of -* INIT to INITIATOR_PORT_BLOCKED. -* -* \param[in] prSta Pointer to the Sta record -* -* \return - none -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -secFsmTrans_INIT_to_INITIATOR_PORT_BLOCKED ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will do action part while in STATE transition of -* INIT to RESPONDER_PORT_BLOCKED. -* -* \param[in] prSta Pointer to the Sta record -* -* \return - none -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -secFsmTrans_INIT_to_RESPONDER_PORT_BLOCKED ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will do action part while in STATE transition of -* INITIATOR_PORT_BLOCKED to CHECK_OK. -* -* \param[in] prSta Pointer to the Sta record -* -* \return - none -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -secFsmTrans_INITIATOR_PORT_BLOCKED_to_CHECK_OK ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - secSetPortBlocked(prAdapter, prSta, FALSE); - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will do action part while in STATE transition of -* RESPONDER_PORT_BLOCKED to CHECK_OK. -* -* \param[in] prSta Pointer to the Sta record -* -* \return - none -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -secFsmTrans_RESPONDER_PORT_BLOCKED_to_CHECK_OK ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - secSetPortBlocked(prAdapter, prSta, FALSE); - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will do action part while in STATE transition of -* CHECK_OK to SEND_EAPOL -* -* \param[in] prSta Pointer to the Sta record -* -* \return - -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -secFsmTrans_CHECK_OK_to_SEND_EAPOL ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - - P_AIS_SPECIFIC_BSS_INFO_T prAisBssInfo; - - ASSERT(prAdapter); - - ASSERT(prSta); - - prAisBssInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - - ASSERT(prAisBssInfo); - - if (!IS_STA_IN_AIS(prSta)) { - DBGLOG(RSN, INFO, ("Counter Measure should occur at AIS network!!\n")); - //ASSERT(0); - return; - } - - prAisBssInfo->fgCheckEAPoLTxDone = TRUE; - - //cnmTimerStartTimer(prAdapter, - // &prAisBssInfo->rRsnaEAPoLReportTimeoutTimer, - // SEC_TO_MSEC(EAPOL_REPORT_SEND_TIMEOUT_INTERVAL_SEC)); - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will do action part while in STATE transition of -* SEND_EAPOL to SEND_DEAUTH. -* -* \param[in] prSta Pointer to the Sta record -* -* \return - none -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -secFsmTrans_SEND_EAPOL_to_SEND_DEAUTH ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - - if (!IS_STA_IN_AIS(prSta)) { - DBGLOG(RSN, INFO, ("Counter Measure should occur at AIS network!!\n")); - //ASSERT(0); - return; - } - - /* Compose deauth frame to AP, a call back function for tx done */ - if (authSendDeauthFrame(prAdapter, - prSta, - (P_SW_RFB_T)NULL, - REASON_CODE_MIC_FAILURE, - (PFN_TX_DONE_HANDLER)secFsmEventDeauthTxDone) != WLAN_STATUS_SUCCESS) { - ASSERT(FALSE); - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will do action part while in STATE transition of -* SEND_DEAUTH to COUNTERMEASURE. -* -* \param[in] prSta Pointer to the Sta record -* -* \return - -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -secFsmTrans_SEND_DEAUTH_to_COUNTERMEASURE ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - ASSERT(prAdapter); - ASSERT(prSta); - - if (!IS_STA_IN_AIS(prSta)) { - DBGLOG(RSN, INFO, ("Counter Measure should occur at AIS network!!\n")); - //ASSERT(0); - return; - } - - //Start the 60 sec timer - cnmTimerStartTimer(prAdapter, - &prAdapter->rWifiVar.rAisSpecificBssInfo.rRsnaBlockTrafficTimer, - SEC_TO_MSEC(COUNTER_MEASURE_TIMEOUT_INTERVAL_SEC)); - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will do action part while in STATE transition of -* SEND_DEAUTH to COUNTERMEASURE. -* -* \param[in] prSta Pointer to the Sta record -* -* \return - -*/ -/*----------------------------------------------------------------------------*/ -__KAL_INLINE__ VOID -secFsmTrans_COUNTERMEASURE_to_INIT ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - - //Clear the counter measure flag - return; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief The Core FSM engine of security module. -* -* \param[in] prSta Pointer to the Sta record -* \param[in] eNextState Enum value of next sec STATE -* -* \return - -*/ -/*----------------------------------------------------------------------------*/ -VOID -secFsmSteps ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta, - IN ENUM_SEC_STATE_T eNextState - ) -{ - P_SEC_INFO_T prSecInfo; - BOOLEAN fgIsTransition = (BOOLEAN)FALSE; - - ASSERT(prSta); - - prSecInfo = &prSta->rSecInfo; - ASSERT(prSecInfo); - - DEBUGFUNC("secFsmSteps"); - do { - /* Do entering Next State */ - prSecInfo->ePreviousState = prSecInfo->eCurrentState; - - /* Do entering Next State */ -#if DBG - DBGLOG(RSN, STATE, ("\n"MACSTR" TRANSITION: [%s] -> [%s]\n\n", - MAC2STR(prSta->aucMacAddr), - apucDebugSecState[prSecInfo->eCurrentState], - apucDebugSecState[eNextState])); -#else - DBGLOG(RSN, STATE, ("\n"MACSTR" [%d] TRANSITION: [%d] -> [%d]\n\n", - MAC2STR(prSta->aucMacAddr), - DBG_RSN_IDX, - prSecInfo->eCurrentState, - eNextState)); -#endif - prSecInfo->eCurrentState = eNextState; - - fgIsTransition = (BOOLEAN)FALSE; -#if 0 - /* Do tasks of the State that we just entered */ - switch (prSecInfo->eCurrentState) { - case SEC_STATE_INIT: - break; - case SEC_STATE_INITIATOR_PORT_BLOCKED: - break; - case SEC_STATE_RESPONDER_PORT_BLOCKED: - break; - case SEC_STATE_CHECK_OK: - break; - case SEC_STATE_SEND_EAPOL: - break; - case SEC_STATE_SEND_DEAUTH: - break; - case SEC_STATE_COUNTERMEASURE: - break; - default: - ASSERT(0); /* Make sure we have handle all STATEs */ - break; - } -#endif - } - while (fgIsTransition); - - return; - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will do initialization of Security FSM and all variables in -* SEC_INFO_T. -* -* \param[in] prSta Pointer to the Sta record -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -secFsmEventStart ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - P_SEC_INFO_T prSecInfo; - BOOLEAN fgIsTransition = (BOOLEAN)FALSE; - ENUM_SEC_STATE_T eNextState; - - DBGLOG(RSN, TRACE, ("secFsmRunEventStart\n")); - - ASSERT(prSta); - - if (!prSta) - return; - - if (!IS_STA_IN_AIS(prSta)) - return; - - DBGLOG(RSN, TRACE, ("secFsmRunEventStart for sta "MACSTR" network %d\n", - MAC2STR(prSta->aucMacAddr), prSta->ucNetTypeIndex)); - - prSecInfo = (P_SEC_INFO_T)&prSta->rSecInfo; - - eNextState = prSecInfo->eCurrentState; - - secSetPortBlocked(prAdapter, prSta, TRUE); - - //prSta->fgTransmitKeyExist = FALSE; - //whsu:: nicPrivacySetStaDefaultWTIdx(prSta); - -#if 1 /* Since the 1x and key can set to firmware in order, always enter the check ok state */ - SEC_STATE_TRANSITION(prAdapter, prSta, INIT, CHECK_OK); -#else - if (IS_STA_IN_AIS(prSta->eStaType)) { - if (secRsnKeyHandshakeEnabled(prAdapter) == TRUE -#if CFG_SUPPORT_WAPI - || (prAdapter->rWifiVar.rConnSettings.fgWapiMode) -#endif - ) { - prSta->fgTransmitKeyExist = FALSE; - //nicPrivacyInitialize(prSta->ucNetTypeIndex); - SEC_STATE_TRANSITION(prAdapter, prSta, INIT, INITIATOR_PORT_BLOCKED); - } - else { - SEC_STATE_TRANSITION(prAdapter, prSta, INIT, CHECK_OK); - } - } -#if CFG_ENABLE_WIFI_DIRECT || CFG_ENABLE_BT_OVER_WIFI - #if CFG_ENABLE_WIFI_DIRECT && CFG_ENABLE_BT_OVER_WIFI - else if ((prSta->eStaType == STA_TYPE_BOW_CLIENT) || - (prSta->eStaType == STA_TYPE_P2P_GC)) - #elif CFG_ENABLE_WIFI_DIRECT - else if (prSta->eStaType == STA_TYPE_P2P_GC) - #elif CFG_ENABLE_BT_OVER_WIFI - else if (prSta->eStaType == STA_TYPE_BOW_CLIENT) - #endif - { - SEC_STATE_TRANSITION(prAdapter, prSta, INIT, RESPONDER_PORT_BLOCKED); - } -#endif - else { - SEC_STATE_TRANSITION(prAdapter, prSta, INIT, INITIATOR_PORT_BLOCKED); - } -#endif - if (prSecInfo->eCurrentState != eNextState) { - secFsmSteps(prAdapter, prSta, eNextState); - } - - return; -} /* secFsmRunEventStart */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function called by reset procedure to force the sec fsm enter -* idle state -* -* \param[in] ucNetTypeIdx The Specific Network type index -* \param[in] prSta Pointer to the Sta record -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -secFsmEventAbort ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - P_SEC_INFO_T prSecInfo; - - DBGLOG(RSN, TRACE, ("secFsmEventAbort for sta "MACSTR" network %d\n", - MAC2STR(prSta->aucMacAddr), prSta->ucNetTypeIndex)); - - ASSERT(prSta); - - if (!prSta) - return; - - if (!IS_STA_IN_AIS(prSta)) - return; - - prSecInfo = (P_SEC_INFO_T)&prSta->rSecInfo; - - prSta->fgTransmitKeyExist = FALSE; - - secSetPortBlocked(prAdapter, prSta, TRUE); - - if (prSecInfo == NULL) - return; - - if (IS_STA_IN_AIS(prSta)) { - - prAdapter->rWifiVar.rAisSpecificBssInfo.fgTransmitKeyExist = FALSE; - - if (prSecInfo->eCurrentState == SEC_STATE_SEND_EAPOL) { - if (prAdapter->rWifiVar.rAisSpecificBssInfo.fgCheckEAPoLTxDone == FALSE) { - DBGLOG(RSN, TRACE, ("EAPOL STATE not match the flag\n")); - //cnmTimerStopTimer(prAdapter, &prAdapter->rWifiVar.rAisSpecificBssInfo.rRsnaEAPoLReportTimeoutTimer); - } - } - } - prSecInfo->eCurrentState = SEC_STATE_INIT; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will indicate an Event of "2nd EAPoL Tx is sending" to Sec FSM. -* -* \param[in] prSta Pointer to the Sta record -* -* \return - -*/ -/*----------------------------------------------------------------------------*/ -VOID -secFsmEvent2ndEapolTx ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - P_SEC_INFO_T prSecInfo; - ENUM_SEC_STATE_T eNextState; - //BOOLEAN fgIsTransition = (BOOLEAN)FALSE; - - DEBUGFUNC("secFsmRunEvent2ndEapolTx"); - - ASSERT(prSta); - - prSecInfo = &prSta->rSecInfo; - eNextState = prSecInfo->eCurrentState; - -#if DBG - DBGLOG(RSN, TRACE, (MACSTR" Sec state %s\n", MAC2STR(prSta->aucMacAddr), - apucDebugSecState[prSecInfo->eCurrentState])); -#else - DBGLOG(RSN, TRACE, (MACSTR" Sec state [%d]\n", MAC2STR(prSta->aucMacAddr), prSecInfo->eCurrentState)); -#endif - - switch(prSecInfo->eCurrentState) { - case SEC_STATE_INITIATOR_PORT_BLOCKED : - case SEC_STATE_CHECK_OK : - prSecInfo->fg2nd1xSend = TRUE; - break; - default: -#if DBG - DBGLOG(RSN, WARN, ("Rcv 2nd EAPoL at %s\n", apucDebugSecState[prSecInfo->eCurrentState])); -#else - DBGLOG(RSN, WARN, ("Rcv 2nd EAPoL at [%d]\n", prSecInfo->eCurrentState)); -#endif - break; - } - - if (prSecInfo->eCurrentState != eNextState) { - secFsmSteps(prAdapter, prSta, eNextState); - } - - return; - -}/* secFsmRunEvent2ndEapolTx */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will indicate an Event of "4th EAPoL Tx is Tx done" to Sec FSM. -* -* \param[in] prSta Pointer to the Sta record -* -* \return - -*/ -/*----------------------------------------------------------------------------*/ -VOID -secFsmEvent4ndEapolTxDone ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - P_SEC_INFO_T prSecInfo; - ENUM_SEC_STATE_T eNextState; - BOOLEAN fgIsTransition = (BOOLEAN)FALSE; - P_CMD_802_11_KEY prStoredKey; - - DEBUGFUNC("secFsmRunEvent4ndEapolTx"); - - ASSERT(prSta); - - prSecInfo = &prSta->rSecInfo; - eNextState = prSecInfo->eCurrentState; - -#if DBG - DBGLOG(RSN, TRACE, (MACSTR " Sec state %s\n", MAC2STR(prSta->aucMacAddr), - apucDebugSecState[prSecInfo->eCurrentState])); -#else - DBGLOG(RSN, TRACE, (MACSTR " Sec state [%d]\n", MAC2STR(prSta->aucMacAddr), prSecInfo->eCurrentState)); -#endif - - switch(prSecInfo->eCurrentState) { - case SEC_STATE_INITIATOR_PORT_BLOCKED : - case SEC_STATE_CHECK_OK : - prSecInfo->fg2nd1xSend = FALSE; - if (prSecInfo->fgKeyStored) { - prStoredKey = (P_CMD_802_11_KEY)prSecInfo->aucStoredKey; - - //prSta = rxmLookupStaRecIndexFromTA(prStoredKey->aucPeerAddr); - //if (nicPrivacySetKeyEntry(prStoredKey, prSta->ucWTEntry) == FALSE) - // DBGLOG(RSN, WARN, ("nicPrivacySetKeyEntry() fail,..\n")); - - //key update - prSecInfo->fgKeyStored = FALSE; - prSta->fgTransmitKeyExist = TRUE; - } - if (prSecInfo->eCurrentState == SEC_STATE_INITIATOR_PORT_BLOCKED) { - SEC_STATE_TRANSITION(prAdapter, prSta, INITIATOR_PORT_BLOCKED, CHECK_OK); - } - break; - default: - -#if DBG - DBGLOG(RSN, WARN, ("Rcv thh EAPoL Tx done at %s\n", apucDebugSecState[prSecInfo->eCurrentState])); -#else - DBGLOG(RSN, WARN, ("Rcv thh EAPoL Tx done at [%d]\n", prSecInfo->eCurrentState)); -#endif - break; - } - - if (prSecInfo->eCurrentState != eNextState) { - secFsmSteps(prAdapter, prSta, eNextState); - } - - return; - -}/* secFsmRunEvent4ndEapolTx */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will indicate an Event of "Pairwise key installed" to SEC FSM. -* -* \param[in] prSta Pointer to the Sta record -* -* \retval TRUE The key can be installed to HW -* \retval FALSE The kay conflict with the current key, abort it -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -secFsmEventPTKInstalled ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - P_SEC_INFO_T prSecInfo; - ENUM_SEC_STATE_T eNextState; - BOOLEAN fgStatus = TRUE; - BOOLEAN fgIsTransition = (BOOLEAN)FALSE; - - ASSERT(prSta); - - prSecInfo = &prSta->rSecInfo; - if (prSecInfo == NULL) - return TRUE; /* Not PTK */ - -#if DBG - DBGLOG(RSN, TRACE, (MACSTR " Sec state %s\n", MAC2STR(prSta->aucMacAddr), - apucDebugSecState[prSecInfo->eCurrentState])); -#else - DBGLOG(RSN, TRACE, (MACSTR " Sec state [%d]\n", MAC2STR(prSta->aucMacAddr), prSecInfo->eCurrentState)); -#endif - - eNextState = prSecInfo->eCurrentState; - - switch(prSecInfo->eCurrentState) { - case SEC_STATE_INIT: - /* Legacy wep, wpa-none */ - break; - - case SEC_STATE_INITIATOR_PORT_BLOCKED: - if (prSecInfo->fg2nd1xSend) { - } - else { - SEC_STATE_TRANSITION(prAdapter, prSta, INITIATOR_PORT_BLOCKED, CHECK_OK); - } - break; - - case SEC_STATE_RESPONDER_PORT_BLOCKED: - SEC_STATE_TRANSITION(prAdapter, prSta, RESPONDER_PORT_BLOCKED, CHECK_OK); - break; - - - case SEC_STATE_CHECK_OK: - break; - - default: - fgStatus = FALSE; - break; - } - - if (prSecInfo->eCurrentState != eNextState) { - secFsmSteps(prAdapter, prSta, eNextState); - } - - return fgStatus; - -} /* end of secFsmRunEventPTKInstalled() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will indicate an Event of "Counter Measure" to SEC FSM. -* -* \param[in] prSta Pointer to the Sta record -* -* \return - -*/ -/*----------------------------------------------------------------------------*/ -VOID -secFsmEventStartCounterMeasure ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prSta - ) -{ - P_SEC_INFO_T prSecInfo; - ENUM_SEC_STATE_T eNextState; - BOOLEAN fgIsTransition = (BOOLEAN)FALSE; - - DEBUGFUNC("secFsmRunEventStartCounterMeasure"); - - ASSERT(prSta); - - if (!IS_STA_IN_AIS(prSta)) { - DBGLOG(RSN, INFO, ("Counter Measure should occur at AIS network!!\n")); - //ASSERT(0); - return; - } - - prSecInfo = &prSta->rSecInfo; - - eNextState = prSecInfo->eCurrentState; - -#if DBG - DBGLOG(RSN, TRACE, (MACSTR " Sec state %s\n", MAC2STR(prSta->aucMacAddr), - apucDebugSecState[prSecInfo->eCurrentState])); -#else - DBGLOG(RSN, TRACE, (MACSTR " Sec state [%d]\n", MAC2STR(prSta->aucMacAddr), prSecInfo->eCurrentState)); -#endif - - prAdapter->rWifiVar.rAisSpecificBssInfo.u4RsnaLastMICFailTime = 0; - - switch(prSecInfo->eCurrentState) { - case SEC_STATE_CHECK_OK: - { - prAdapter->rWifiVar.rAisSpecificBssInfo.fgCounterMeasure = TRUE; - - // dls port control - SEC_STATE_TRANSITION(prAdapter, prSta, CHECK_OK, SEND_EAPOL); - } - break; - - default: - break; - } - - /* Call arbFsmSteps() when we are going to change ARB STATE */ - if (prSecInfo->eCurrentState != eNextState) { - secFsmSteps(prAdapter, prSta, eNextState); - } - - return; - -} /* secFsmRunEventStartCounterMeasure */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will indicate an Event of "802.1x EAPoL Tx Done" to Sec FSM. -* -* \param[in] prSta Pointer to the Sta record -* -* \return - -*/ -/*----------------------------------------------------------------------------*/ -VOID -secFsmEventEapolTxDone ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ) -{ - P_SEC_INFO_T prSecInfo; - ENUM_SEC_STATE_T eNextState; - BOOLEAN fgIsTransition = (BOOLEAN)FALSE; - P_AIS_SPECIFIC_BSS_INFO_T prAisBssInfo; - - DEBUGFUNC("secFsmRunEventEapolTxDone"); - - ASSERT(prStaRec); - - if (rTxDoneStatus != TX_RESULT_SUCCESS) { - DBGLOG(RSN, INFO, ("Error EAPoL fram fail to send!!\n")); - //ASSERT(0); - return; - } - - if (!IS_STA_IN_AIS(prStaRec)) { - DBGLOG(RSN, INFO, ("Counter Measure should occur at AIS network!!\n")); - //ASSERT(0); - return; - } - - prAisBssInfo = &prAdapter->rWifiVar.rAisSpecificBssInfo; - - ASSERT(prAisBssInfo); - - prSecInfo = &prStaRec->rSecInfo; - eNextState = prSecInfo->eCurrentState; - -#if DBG - DBGLOG(RSN, TRACE, (MACSTR " Sec state %s\n", MAC2STR(prStaRec->aucMacAddr), - apucDebugSecState[prSecInfo->eCurrentState])); -#else - DBGLOG(RSN, TRACE, (MACSTR " Sec state [%d]\n", MAC2STR(prStaRec->aucMacAddr), prSecInfo->eCurrentState)); -#endif - - switch(prSecInfo->eCurrentState) { - case SEC_STATE_SEND_EAPOL: - if (prAisBssInfo->fgCheckEAPoLTxDone == FALSE) { - ASSERT(0); - } - - prAisBssInfo->fgCheckEAPoLTxDone = FALSE; - //cnmTimerStopTimer(prAdapter, &prAisBssInfo->rRsnaEAPoLReportTimeoutTimer); - - SEC_STATE_TRANSITION(prAdapter, prStaRec, SEND_EAPOL, SEND_DEAUTH); - break; - default: - break; - } - - if (prSecInfo->eCurrentState != eNextState) { - secFsmSteps(prAdapter, prStaRec, eNextState); - } - - return; - -}/* secFsmRunEventEapolTxDone */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will indicate an Event of "Deauth frame Tx Done" to Sec FSM. -* -* \param[in] pMsduInfo Pointer to the Msdu Info -* \param[in] rStatus The Tx done status -* -* \return - -* -* \note after receive deauth frame, callback function call this -*/ -/*----------------------------------------------------------------------------*/ -VOID -secFsmEventDeauthTxDone ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ) -{ - P_STA_RECORD_T prStaRec; - P_SEC_INFO_T prSecInfo; - ENUM_SEC_STATE_T eNextState; - BOOLEAN fgIsTransition = (BOOLEAN)FALSE; - - DEBUGFUNC("secFsmRunEventDeauthTxDone"); - - ASSERT(prMsduInfo); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - ASSERT(prStaRec); - - if (!prStaRec) - return; - - if (!IS_STA_IN_AIS(prStaRec)) { - DBGLOG(RSN, INFO, ("Counter Measure should occur at AIS network!!\n")); - //ASSERT(0); - return; - } - - prSecInfo = (P_SEC_INFO_T)&prStaRec->rSecInfo; - -#if DBG - DBGLOG(RSN, TRACE, (MACSTR " Sec state %s\n", MAC2STR(prStaRec->aucMacAddr), - apucDebugSecState[prSecInfo->eCurrentState])); -#else - DBGLOG(RSN, TRACE, (MACSTR " Sec state [%d]\n", MAC2STR(prStaRec->aucMacAddr), prSecInfo->eCurrentState)); -#endif - - switch(prSecInfo->eCurrentState) { - case SEC_STATE_SEND_DEAUTH: - - DBGLOG(RSN, TRACE, ("Set timer %d\n", COUNTER_MEASURE_TIMEOUT_INTERVAL_SEC)); - - SEC_STATE_TRANSITION(prAdapter, prStaRec, SEND_DEAUTH, COUNTERMEASURE); - - break; - - default: - ASSERT(0); - break; - } - - return; -}/* secFsmRunEventDeauthTxDone */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will check the eapol error frame fail to send issue. -* -* \param[in] prSta Pointer to the Sta record -* -* \return - -*/ -/*----------------------------------------------------------------------------*/ -VOID -secFsmEventEapolTxTimeout ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Parm - ) -{ - P_STA_RECORD_T prStaRec; - - DEBUGFUNC("secFsmRunEventEapolTxTimeout"); - - prStaRec = (P_STA_RECORD_T)u4Parm; - - ASSERT(prStaRec); - - /* Todo:: How to handle the Eapol Error fail to send case? */ - ASSERT(0); - - return; - -}/* secFsmEventEapolTxTimeout */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will stop the counterMeasure duration. -* -* \param[in] prSta Pointer to the Sta record -* -* \return - -*/ -/*----------------------------------------------------------------------------*/ -VOID -secFsmEventEndOfCounterMeasure ( - IN P_ADAPTER_T prAdapter, - UINT_32 u4Parm - ) -{ - P_STA_RECORD_T prSta; - P_SEC_INFO_T prSecInfo; - ENUM_SEC_STATE_T eNextState; - BOOLEAN fgIsTransition = (BOOLEAN)FALSE; - - DEBUGFUNC("secFsmRunEventEndOfCounterMeasure"); - - prSta = (P_STA_RECORD_T)u4Parm; - - ASSERT(prSta); - - if (!IS_STA_IN_AIS(prSta)) { - DBGLOG(RSN, INFO, ("Counter Measure should occur at AIS network!!\n")); - //ASSERT(0); - return; - } - - prSecInfo = &prSta->rSecInfo; - eNextState = prSecInfo->eCurrentState; - -#if DBG - DBGLOG(RSN, TRACE, (MACSTR " Sec state %s\n", MAC2STR(prSta->aucMacAddr), - apucDebugSecState[prSecInfo->eCurrentState])); -#else - DBGLOG(RSN, TRACE, (MACSTR " Sec state [%d]\n", MAC2STR(prSta->aucMacAddr), prSecInfo->eCurrentState)); -#endif - - switch(prSecInfo->eCurrentState) { - case SEC_STATE_SEND_DEAUTH: - { - prAdapter->rWifiVar.rAisSpecificBssInfo.fgCounterMeasure = FALSE; - - SEC_STATE_TRANSITION(prAdapter, prSta, COUNTERMEASURE, INIT); - } - break; - - default: - ASSERT(0); - } - - /* Call arbFsmSteps() when we are going to change ARB STATE */ - if (prSecInfo->eCurrentState != eNextState) { - secFsmSteps(prAdapter, prSta, eNextState); - } - - return; -}/* end of secFsmRunEventEndOfCounterMeasure */ -#endif diff --git a/drivers/net/wireless/mt5931/mgmt/swcr.c b/drivers/net/wireless/mt5931/mgmt/swcr.c deleted file mode 100755 index 0a65bb0b579f..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/swcr.c +++ /dev/null @@ -1,1268 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/swcr.c#1 $ -*/ - -/*! \file "swcr.c" - \brief - -*/ - - - -/* -** $Log: swcr.c $ - * - * 06 04 2012 tsaiyuan.hsu - * [WCXRP00001249] [ALPS.ICS] Daily build warning on "wlan/mgmt/swcr.c#1" - * resolve build waring for "WNM_UNIT_TEST not defined". - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 01 05 2012 tsaiyuan.hsu - * [WCXRP00001157] [MT6620 Wi-Fi][FW][DRV] add timing measurement support for 802.11v - * add timing measurement support for 802.11v. - * - * 11 22 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * keep debug counter setting after wake up. - * - * 11 15 2011 cm.chang - * NULL - * Fix compiling warning - * - * 11 11 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * fix debug counters of rx in driver. - * - * 11 11 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * add debug counters of bb and ar for xlog. - * - * 11 10 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Modify the QM xlog level and remove LOG_FUNC. - * - * 11 08 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * add debug counters, eCurPsProf, for PS. - * - * 11 07 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * add debug counters and periodically dump counters for debugging. - * - * 11 03 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * change the DBGLOG for "\n" and "\r\n". LABEL to LOUD for XLOG - * - * 08 31 2011 tsaiyuan.hsu - * [WCXRP00000931] [MT5931 Wi-Fi][DRV/FW] add swcr to disable roaming from driver - * remove obsolete code. - * - * 08 15 2011 tsaiyuan.hsu - * [WCXRP00000931] [MT5931 Wi-Fi][DRV/FW] add swcr to disable roaming from driver - * add swcr in driver reg, 0x9fxx0000, to disable roaming . - * - * 05 11 2011 eddie.chen - * [WCXRP00000709] [MT6620 Wi-Fi][Driver] Check free number before copying broadcast packet - * Fix dest type when GO packet copying. - * - * 05 09 2011 eddie.chen - * [WCXRP00000709] [MT6620 Wi-Fi][Driver] Check free number before copying broadcast packet - * Check free number before copying broadcast packet. - * - * 04 14 2011 eddie.chen - * [WCXRP00000603] [MT6620 Wi-Fi][DRV] Fix Klocwork warning - * Check the SW RFB free. Fix the compile warning.. - * - * 04 12 2011 eddie.chen - * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma - * Fix the sta index in processing security frame - * Simple flow control for TC4 to avoid mgt frames for PS STA to occupy the TC4 - * Add debug message. - * - * 03 28 2011 eddie.chen - * [WCXRP00000603] [MT6620 Wi-Fi][DRV] Fix Klocwork warning - * Fix Klockwork warning. - * - * 03 15 2011 eddie.chen - * [WCXRP00000554] [MT6620 Wi-Fi][DRV] Add sw control debug counter - * Add sw debug counter for QM. - * - * 01 11 2011 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, -Add per station flow control when STA is in PS - - * Add swcr for test. - * -* -*/ - - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -#if CFG_SUPPORT_SWCR - -#ifdef __GNUC__ -#pragma GCC diagnostic ignored "-Wformat" -#endif -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ -#if 0 -extern SWCR_MAP_ENTRY_T g_arRlmArSwCrMap[]; -SWCR_MOD_MAP_ENTRY_T g_arSwCrAllMaps[] = { - { SWCR_MAP_NUM(g_arRlmArSwCrMap), g_arRlmArSwCrMap}, /* 0x00nn */ - {0,NULL} -}; -#endif - -VOID swCtrlCmdCategory0(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0,UINT_8 ucOpt1); -VOID swCtrlCmdCategory1(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0,UINT_8 ucOpt1); -VOID testPsCmdCategory0(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0,UINT_8 ucOpt1); -VOID testPsCmdCategory1(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0,UINT_8 ucOpt1); -void testWNMCmdCategory0(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0,UINT_8 ucOpt1); -VOID swCtrlSwCr(P_ADAPTER_T prAdapter, UINT_8 ucRead, UINT_16 u2Addr, UINT_32 *pu4Data); - -/* Support Debug */ -VOID swCrDebugCheck(P_ADAPTER_T prAdapter, P_CMD_SW_DBG_CTRL_T prCmdSwCtrl); -VOID swCrDebugCheckTimeout( - IN P_ADAPTER_T prAdapter, - UINT_32 u4Param); -VOID swCrDebugQuery( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ); -VOID swCrDebugQueryTimeout( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo); - -UINT_32 g_au4SwCr[SWCR_CR_NUM]; /*: 0: command other: data */ - -/* JB mDNS Filter*/ -UINT_32 g_u4mDNSRXFilter = 0; /* [31] 0: stop 1: start, [3] IPv6 [2] IPv4*/ - -static TIMER_T g_rSwcrDebugTimer; -static BOOLEAN g_fgSwcrDebugTimer = FALSE; -static UINT_32 g_u4SwcrDebugCheckTimeout = 0; -static ENUM_SWCR_DBG_TYPE_T g_ucSwcrDebugCheckType = 0; -static UINT_32 g_u4SwcrDebugFrameDumpType = 0; - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ -#define TEST_PS 1 - -const static PFN_CMD_RW_T g_arSwCtrlCmd[] ={ - swCtrlCmdCategory0, - swCtrlCmdCategory1 -#if TEST_PS - , testPsCmdCategory0 - , testPsCmdCategory1 -#endif -#if CFG_SUPPORT_802_11V -#if (CFG_SUPPORT_802_11V_TIMING_MEASUREMENT ==1) && (WNM_UNIT_TEST ==1) - , testWNMCmdCategory0 -#endif -#endif -}; - - -const PFN_SWCR_RW_T g_arSwCrModHandle[] = { - swCtrlSwCr, - NULL -}; - - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -enum { - SWCTRL_MAGIC, - SWCTRL_DEBUG, - SWCTRL_WIFI_VAR, - SWCTRL_ENABLE_INT, - SWCTRL_DISABLE_INT, - SWCTRL_TXM_INFO, - SWCTRL_RXM_INFO, - SWCTRL_DUMP_BSS, - SWCTRL_QM_INFO, - SWCTRL_DUMP_ALL_QUEUE_LEN, - SWCTRL_DUMP_MEM, - SWCTRL_TX_CTRL_INFO, - SWCTRL_DUMP_QUEUE, - SWCTRL_DUMP_QM_DBG_CNT, - SWCTRL_QM_DBG_CNT, - SWCTRL_RX_PKTS_DUMP, - SWCTRL_RX_MDNS_FILTER, - SWCTRL_CATA0_INDEX_NUM -}; - -enum { - SWCTRL_STA_INFO, - SWCTRL_DUMP_STA, - SWCTRL_STA_QUE_INFO, - SWCTRL_CATA1_INDEX_NUM -}; - -/* JB mDNS Filter*/ -#define RX_MDNS_FILTER_START (1<<31) -#define RX_MDNS_FILTER_IPV4 (1<<2) -#define RX_MDNS_FILTER_IPV6 (1<<3) -typedef enum _ENUM_SWCR_RX_MDNS_FILTER_CMD_T { - SWCR_RX_MDNS_FILTER_CMD_STOP = 0, - SWCR_RX_MDNS_FILTER_CMD_START, - SWCR_RX_MDNS_FILTER_CMD_ADD, - SWCR_RX_MDNS_FILTER_CMD_REMOVE, - SWCR_RX_MDNS_FILTER_NUM -} ENUM_SWCR_RX_MDNS_FILTER_CMD_T; - -#if TEST_PS -enum { - TEST_PS_MAGIC, - TEST_PS_SETUP_BSS, - TEST_PS_ENABLE_BEACON, - TEST_PS_TRIGGER_BMC, - TEST_PS_SEND_NULL, - TEST_PS_BUFFER_BMC, - TEST_PS_UPDATE_BEACON, - TEST_PS_CATA0_INDEX_NUM -}; - -enum { - TEST_PS_STA_PS, - TEST_PS_STA_ENTER_PS, - TEST_PS_STA_EXIT_PS, - TEST_PS_STA_TRIGGER_PSPOLL, - TEST_PS_STA_TRIGGER_FRAME, - TEST_PS_CATA1_INDEX_NUM -}; -#endif - -#if CFG_SUPPORT_802_11V -#if WNM_UNIT_TEST -enum { - TEST_WNM_TIMING_MEAS, - TEST_WNM_CATA0_INDEX_NUM -}; -#endif -#endif - - -#define _SWCTRL_MAGIC 0x66201642 - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -void dumpQueue(P_ADAPTER_T prAdapter) -{ - - P_TX_CTRL_T prTxCtrl; - P_QUE_MGT_T prQM; - P_GLUE_INFO_T prGlueInfo; - UINT_32 i; - UINT_32 j; - - - DEBUGFUNC("dumpQueue"); - - prTxCtrl = &prAdapter->rTxCtrl; - prQM = &prAdapter->rQM; - prGlueInfo = prAdapter->prGlueInfo; - - for(i = TC0_INDEX; i<=TC5_INDEX; i++) { - DBGLOG(SW4, INFO,( "TC %u\n",i)); - DBGLOG(SW4, INFO,( "Max %u Free %u\n", - prTxCtrl->rTc.aucMaxNumOfBuffer[i], prTxCtrl->rTc.aucFreeBufferCount[i])); - - DBGLOG(SW4, INFO,("Average %u minReserved %u CurrentTcResource %u GuaranteedTcResource %u\n", - QM_GET_TX_QUEUE_LEN(prAdapter, i), - prQM->au4MinReservedTcResource[i], - prQM->au4CurrentTcResource[i], - prQM->au4GuaranteedTcResource[i])); - - } - - - for(i = 0; iau4HeadStaRecIndex[i],prQM->au4ForwardCount[i])); - } - - DBGLOG(SW4, INFO,( "BMC or unknown TxQueue Len %u\n",prQM->arTxQueue[0].u4NumElem)); - DBGLOG(SW4, INFO,( "Pending %d\n",prGlueInfo->i4TxPendingFrameNum)); - DBGLOG(SW4, INFO,( "Pending Security %d\n",prGlueInfo->i4TxPendingSecurityFrameNum)); -#if defined(LINUX) - for(i=0;i<4;i++){ - for(j=0;jai4TxPendingFrameNumPerQueue[i][j])); - } - } -#endif - - DBGLOG(SW4, INFO,( " rFreeSwRfbList %u\n", prAdapter->rRxCtrl.rFreeSwRfbList.u4NumElem)); - DBGLOG(SW4, INFO,( " rReceivedRfbList %u\n", prAdapter->rRxCtrl.rReceivedRfbList.u4NumElem)); - DBGLOG(SW4, INFO,( " rIndicatedRfbList %u\n", prAdapter->rRxCtrl.rIndicatedRfbList.u4NumElem)); - DBGLOG(SW4, INFO,( " ucNumIndPacket %u\n", prAdapter->rRxCtrl.ucNumIndPacket)); - DBGLOG(SW4, INFO,( " ucNumRetainedPacket %u\n", prAdapter->rRxCtrl.ucNumRetainedPacket)); - - -} - - -void dumpSTA(P_ADAPTER_T prAdapter, P_STA_RECORD_T prStaRec) -{ - UINT_8 ucWTEntry; - UINT_32 i; - P_BSS_INFO_T prBssInfo; - - DEBUGFUNC("dumpSTA"); - - ASSERT(prStaRec); - ucWTEntry = prStaRec->ucWTEntry; - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]; - ASSERT(prBssInfo); - - DBGLOG(SW4, INFO,("Mac address: " MACSTR " Rcpi %u" "\n", MAC2STR(prStaRec->aucMacAddr),prStaRec->ucRCPI)); - - DBGLOG(SW4, INFO,("Idx %u Wtbl %u Used %u State %u Bss Phy 0x%x Sta DesiredPhy 0x%x\n", - prStaRec->ucIndex, ucWTEntry, - prStaRec->fgIsInUse,prStaRec->ucStaState, - prBssInfo->ucPhyTypeSet, - prStaRec->ucDesiredPhyTypeSet)); - - DBGLOG(SW4, INFO,("Sta Operation 0x%x DesiredNontHtRateSet 0x%x Mcs 0x%x u2HtCapInfo 0x%x\n", - prStaRec->u2OperationalRateSet,prStaRec->u2DesiredNonHTRateSet,prStaRec->ucMcsSet, prStaRec->u2HtCapInfo)); - - - for(i = 0; iarTxQueue[i].u4NumElem)); - } - - DBGLOG(SW4, INFO, ("BmpDeliveryAC %x\n",prStaRec->ucBmpDeliveryAC)); - DBGLOG(SW4, INFO, ("BmpTriggerAC %x\n",prStaRec->ucBmpTriggerAC)); - DBGLOG(SW4, INFO, ("UapsdSpSupproted %u\n",prStaRec->fgIsUapsdSupported)); - DBGLOG(SW4, INFO, ("IsQoS %u\n",prStaRec->fgIsQoS)); - DBGLOG(SW4, INFO, ("AssocId %u\n",prStaRec->u2AssocId)); - - DBGLOG(SW4, INFO, ("fgIsInPS %u\n",prStaRec->fgIsInPS)); - DBGLOG(SW4, INFO, ("ucFreeQuota %u\n",prStaRec->ucFreeQuota)); - DBGLOG(SW4, INFO, ("ucFreeQuotaForDelivery %u\n",prStaRec->ucFreeQuotaForDelivery)); - DBGLOG(SW4, INFO, ("ucFreeQuotaForNonDelivery %u\n",prStaRec->ucFreeQuotaForNonDelivery)); - - -#if 0 - DBGLOG(SW4, INFO, ("IsQmmSup %u\n",prStaRec->fgIsWmmSupported)); - DBGLOG(SW4, INFO, ("IsUapsdSup %u\n",prStaRec->fgIsUapsdSupported)); - DBGLOG(SW4, INFO, ("AvailabaleDeliverPkts %u\n",prStaRec->ucAvailableDeliverPkts)); - DBGLOG(SW4, INFO, ("BmpDeliverPktsAC %u\n",prStaRec->u4BmpDeliverPktsAC)); - DBGLOG(SW4, INFO, ("BmpBufferAC %u\n",prStaRec->u4BmpBufferAC)); - DBGLOG(SW4, INFO, ("BmpNonDeliverPktsAC %u\n",prStaRec->u4BmpNonDeliverPktsAC)); -#endif - - for(i=0;iaprRxReorderParamRefTbl[i]){ - DBGLOG(SW4, INFO,("RxReorder fgIsValid: %u\n",prStaRec->aprRxReorderParamRefTbl[i]->fgIsValid)); - DBGLOG(SW4, INFO,("RxReorder Tid: %u\n",prStaRec->aprRxReorderParamRefTbl[i]->ucTid)); - DBGLOG(SW4, INFO,("RxReorder rReOrderQue Len: %u\n", prStaRec->aprRxReorderParamRefTbl[i]->rReOrderQue.u4NumElem)); - DBGLOG(SW4, INFO,("RxReorder WinStart: %u\n", prStaRec->aprRxReorderParamRefTbl[i]->u2WinStart)); - DBGLOG(SW4, INFO,("RxReorder WinEnd: %u\n", prStaRec->aprRxReorderParamRefTbl[i]->u2WinEnd)); - DBGLOG(SW4, INFO,("RxReorder WinSize: %u\n", prStaRec->aprRxReorderParamRefTbl[i]->u2WinSize)); - } - } - -} - - -VOID dumpBss(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo) -{ - - DBGLOG(SW4, INFO, ("SSID %s\n",prBssInfo->aucSSID)); - DBGLOG(SW4, INFO, ("OWN " MACSTR"\n",MAC2STR(prBssInfo->aucOwnMacAddr))); - DBGLOG(SW4, INFO, ("BSSID " MACSTR"\n",MAC2STR(prBssInfo->aucBSSID))); - DBGLOG(SW4, INFO, ("ucNetTypeIndex %u\n",prBssInfo->ucNetTypeIndex)); - DBGLOG(SW4, INFO, ("eConnectionState %u\n",prBssInfo->eConnectionState)); - DBGLOG(SW4, INFO, ("eCurrentOPMode %u\n",prBssInfo->eCurrentOPMode)); - DBGLOG(SW4, INFO, ("fgIsQBSS %u\n",prBssInfo->fgIsQBSS)); - DBGLOG(SW4, INFO, ("fgIsShortPreambleAllowed %u\n",prBssInfo->fgIsShortPreambleAllowed)); - DBGLOG(SW4, INFO, ("fgUseShortPreamble %u\n",prBssInfo->fgUseShortPreamble)); - DBGLOG(SW4, INFO, ("fgUseShortSlotTime %u\n",prBssInfo->fgUseShortSlotTime)); - DBGLOG(SW4, INFO, ("ucNonHTBasicPhyType %x\n",prBssInfo->ucNonHTBasicPhyType)); - DBGLOG(SW4, INFO, ("u2OperationalRateSet %x\n",prBssInfo->u2OperationalRateSet)); - DBGLOG(SW4, INFO, ("u2BSSBasicRateSet %x\n",prBssInfo->u2BSSBasicRateSet)); - DBGLOG(SW4, INFO, ("ucPhyTypeSet %x\n",prBssInfo->ucPhyTypeSet)); - DBGLOG(SW4, INFO, ("rStaRecOfClientList %d\n",prBssInfo->rStaRecOfClientList.u4NumElem)); - DBGLOG(SW4, INFO, ("u2CapInfo %x\n",prBssInfo->u2CapInfo)); - DBGLOG(SW4, INFO, ("u2ATIMWindow %x\n",prBssInfo->u2ATIMWindow)); - DBGLOG(SW4, INFO, ("u2AssocId %x\n",prBssInfo->u2AssocId)); - DBGLOG(SW4, INFO, ("ucDTIMPeriod %x\n",prBssInfo->ucDTIMPeriod)); - DBGLOG(SW4, INFO, ("ucDTIMCount %x\n",prBssInfo->ucDTIMCount)); - DBGLOG(SW4, INFO, ("fgIsNetAbsent %x\n", prBssInfo->fgIsNetAbsent)); - DBGLOG(SW4, INFO, ("eBand %d\n", prBssInfo->eBand)); - DBGLOG(SW4, INFO, ("ucPrimaryChannel %d\n", prBssInfo->ucPrimaryChannel)); - DBGLOG(SW4, INFO, ("ucHtOpInfo1 %d\n", prBssInfo->ucHtOpInfo1)); - DBGLOG(SW4, INFO, ("ucHtOpInfo2 %d\n", prBssInfo->u2HtOpInfo2)); - DBGLOG(SW4, INFO, ("ucHtOpInfo3 %d\n", prBssInfo->u2HtOpInfo3)); - DBGLOG(SW4, INFO, ("fgErpProtectMode %d\n", prBssInfo->fgErpProtectMode)); - DBGLOG(SW4, INFO, ("eHtProtectMode %d\n", prBssInfo->eHtProtectMode)); - DBGLOG(SW4, INFO, ("eGfOperationMode %d\n", prBssInfo->eGfOperationMode)); - DBGLOG(SW4, INFO, ("eRifsOperationMode %d\n", prBssInfo->eRifsOperationMode)); - DBGLOG(SW4, INFO, ("fgObssErpProtectMode %d\n", prBssInfo->fgObssErpProtectMode)); - DBGLOG(SW4, INFO, ("eObssHtProtectMode %d\n", prBssInfo->eObssHtProtectMode)); - DBGLOG(SW4, INFO, ("eObssGfProtectMode %d\n", prBssInfo->eObssGfOperationMode)); - DBGLOG(SW4, INFO, ("fgObssRifsOperationMode %d\n", prBssInfo->fgObssRifsOperationMode)); - DBGLOG(SW4, INFO, ("fgAssoc40mBwAllowed %d\n", prBssInfo->fgAssoc40mBwAllowed)); - DBGLOG(SW4, INFO, ("fg40mBwAllowed %d\n", prBssInfo->fg40mBwAllowed)); - DBGLOG(SW4, INFO, ("eBssSCO %d\n", prBssInfo->eBssSCO)); - - -} - - - -VOID swCtrlCmdCategory0(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0,UINT_8 ucOpt1) -{ - UINT_8 ucIndex,ucRead; - UINT_32 i; - - DEBUGFUNC("swCtrlCmdCategory0"); - - SWCR_GET_RW_INDEX(ucAction,ucRead,ucIndex); - - i=0; - - if(ucIndex>=SWCTRL_CATA0_INDEX_NUM) return; - - if(ucRead == SWCR_WRITE) { - switch(ucIndex) { - case SWCTRL_DEBUG: -#if DBG - aucDebugModule[ucOpt0] = (UINT_8)g_au4SwCr[1]; -#endif - break; - case SWCTRL_WIFI_VAR: - break; - -#if QM_DEBUG_COUNTER - case SWCTRL_DUMP_QM_DBG_CNT: - for(i=0;irQM.au4QmDebugCounters[i] = 0; - } - break; - case SWCTRL_QM_DBG_CNT: - prAdapter->rQM.au4QmDebugCounters[ucOpt0] = g_au4SwCr[1]; - - break; -#endif -#if CFG_RX_PKTS_DUMP - case SWCTRL_RX_PKTS_DUMP: - //DBGLOG(SW4, INFO,("SWCTRL_RX_PKTS_DUMP: mask %x\n", g_au4SwCr[1])); - prAdapter->rRxCtrl.u4RxPktsDumpTypeMask = g_au4SwCr[1]; - break; -#endif - case SWCTRL_RX_MDNS_FILTER: - { - UINT_32 u4rxfilter; - BOOLEAN fgUpdate = FALSE; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - - if (ucOpt0 == SWCR_RX_MDNS_FILTER_CMD_STOP) { - g_u4mDNSRXFilter &= ~(RX_MDNS_FILTER_START); - - u4rxfilter = prAdapter->u4OsPacketFilter; - fgUpdate = TRUE; - } - else if (ucOpt0 == SWCR_RX_MDNS_FILTER_CMD_START) { - g_u4mDNSRXFilter |= (RX_MDNS_FILTER_START); - - u4rxfilter = prAdapter->u4OsPacketFilter; - if ((g_u4mDNSRXFilter & RX_MDNS_FILTER_IPV4) && - (g_u4mDNSRXFilter & RX_MDNS_FILTER_IPV6)) { - u4rxfilter &= ~(PARAM_PACKET_FILTER_ALL_MULTICAST| - PARAM_PACKET_FILTER_MULTICAST); - } - else { - u4rxfilter |= PARAM_PACKET_FILTER_ALL_MULTICAST; - } - fgUpdate = TRUE; - } - else if (ucOpt0 == SWCR_RX_MDNS_FILTER_CMD_ADD) { - if (ucOpt1 < 31) { - g_u4mDNSRXFilter |= (1<rQM; - switch(ucOpt0) { - case 0: - g_au4SwCr[1] = (QM_GET_TX_QUEUE_LEN(prAdapter, ucOpt1)) ; - g_au4SwCr[2] = prQM->au4MinReservedTcResource[ucOpt1] ; - g_au4SwCr[3] = prQM->au4CurrentTcResource[ucOpt1]; - g_au4SwCr[4] = prQM->au4GuaranteedTcResource[ucOpt1]; - break; - - case 1: - g_au4SwCr[1] = prQM->au4ForwardCount[ucOpt1]; - g_au4SwCr[2] = prQM->au4HeadStaRecIndex[ucOpt1]; - break; - - case 2: - g_au4SwCr[1] = prQM->arTxQueue[ucOpt1].u4NumElem; /* only one */ - - - break; - } - - } - case SWCTRL_TX_CTRL_INFO: - { - P_TX_CTRL_T prTxCtrl; - prTxCtrl = &prAdapter->rTxCtrl; - switch(ucOpt0) { - case 0: - g_au4SwCr[1] = prAdapter->rTxCtrl.rTc.aucFreeBufferCount[ucOpt1]; - g_au4SwCr[2] = prAdapter->rTxCtrl.rTc.aucMaxNumOfBuffer[ucOpt1]; - break; - } - - } - break; - case SWCTRL_DUMP_QUEUE: - dumpQueue(prAdapter); - - break; -#if QM_DEBUG_COUNTER - case SWCTRL_DUMP_QM_DBG_CNT: - for(i=0;irQM.au4QmDebugCounters[i])); - } - break; - - case SWCTRL_QM_DBG_CNT: - g_au4SwCr[1] = prAdapter->rQM.au4QmDebugCounters[ucOpt0]; - break; -#endif - case SWCTRL_DUMP_BSS: - { - dumpBss(prAdapter, &(prAdapter->rWifiVar.arBssInfo[ucOpt0])) ; - } - break; - - default: - break; - } - - } -} - - -VOID swCtrlCmdCategory1(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0,UINT_8 ucOpt1) -{ - UINT_8 ucIndex,ucRead; - UINT_8 ucWTEntry; - P_STA_RECORD_T prStaRec; - - DEBUGFUNC("swCtrlCmdCategory1"); - - SWCR_GET_RW_INDEX(ucAction,ucRead,ucIndex); - - if(ucOpt0>=CFG_STA_REC_NUM) return; - - //prStaRec = cnmGetStaRecByIndex (prAdapter, ucOpt0); - prStaRec = &prAdapter->arStaRec[ucOpt0]; - ucWTEntry = prStaRec->ucWTEntry; - if(ucRead == SWCR_WRITE) { - } - else { - /* Read */ - switch(ucIndex) { - case SWCTRL_STA_QUE_INFO: - { - g_au4SwCr[1] = prStaRec->arTxQueue[ucOpt1].u4NumElem; - } - break; - case SWCTRL_STA_INFO: - switch(ucOpt1) { - case 0: - g_au4SwCr[1] = prStaRec->fgIsInPS; - break; - } - - break; - - case SWCTRL_DUMP_STA: - { - dumpSTA(prAdapter, prStaRec); - } - break; - - default: - - break; - } - } - - -} - -#if TEST_PS - -VOID -testPsSendQoSNullFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN UINT_8 ucUP, - IN UINT_8 ucNetTypeIndex, - IN BOOLEAN fgBMC, - IN BOOLEAN fgIsBurstEnd, - IN BOOLEAN ucPacketType, - IN BOOLEAN ucPsSessionID, - IN BOOLEAN fgSetEOSP - ) -{ - P_MSDU_INFO_T prMsduInfo; - UINT_16 u2EstimatedFrameLen; - P_WLAN_MAC_HEADER_QOS_T prQoSNullFrame; - - - DEBUGFUNC("testPsSendQoSNullFrame"); - DBGLOG(SW4, LOUD, ("\n")); - - //4 <1> Allocate a PKT_INFO_T for Null Frame - /* Init with MGMT Header Length */ - u2EstimatedFrameLen = MAC_TX_RESERVED_FIELD + \ - WLAN_MAC_HEADER_QOS_LEN; - - /* Allocate a MSDU_INFO_T */ - if ( (prMsduInfo = cnmMgtPktAlloc(prAdapter, u2EstimatedFrameLen)) == NULL) { - DBGLOG(SW4, WARN, ("No PKT_INFO_T for sending Null Frame.\n")); - return ; - } - - //4 <2> Compose Null frame in MSDU_INfO_T. - bssComposeQoSNullFrame(prAdapter, - (PUINT_8)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD), - prStaRec, - ucUP, - fgSetEOSP); - - - prMsduInfo->eSrc = TX_PACKET_MGMT; - //prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_DATA; - prMsduInfo->ucPacketType = ucPacketType; - prMsduInfo->ucStaRecIndex = prStaRec->ucIndex; - prMsduInfo->ucNetworkType = ucNetTypeIndex; - prMsduInfo->ucMacHeaderLength = WLAN_MAC_HEADER_QOS_LEN; - prMsduInfo->fgIs802_1x = FALSE; - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = WLAN_MAC_HEADER_QOS_LEN; - prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMsduInfo->pfTxDoneHandler = NULL; - prMsduInfo->fgIsBasicRate = TRUE; - prMsduInfo->fgIsBurstEnd = fgIsBurstEnd; - prMsduInfo->ucUserPriority = ucUP; - prMsduInfo->ucPsSessionID = ucPsSessionID /* 0~7 Test 7 means NOACK*/; - - prQoSNullFrame = (P_WLAN_MAC_HEADER_QOS_T)( (PUINT_8)((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD) ); - - if(fgBMC) { - prQoSNullFrame->aucAddr1[0] = 0xfd; - } - else { - prQoSNullFrame->aucAddr1[5] = 0xdd; - } - - //4 <4> Inform TXM to send this Null frame. - nicTxEnqueueMsdu(prAdapter, prMsduInfo); - -} - - - -VOID -testPsSetupBss( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucNetworkTypeIndex - ) -{ - P_BSS_INFO_T prBssInfo; - UINT_8 _aucZeroMacAddr[] = NULL_MAC_ADDR; - - DEBUGFUNC("testPsSetupBss()"); - DBGLOG(SW4, INFO, ("index %d\n", ucNetworkTypeIndex)); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[ucNetworkTypeIndex]); - - //4 <1.2> Initiate PWR STATE - //SET_NET_PWR_STATE_IDLE(prAdapter, ucNetworkTypeIndex); - - - //4 <2> Initiate BSS_INFO_T - common part - BSS_INFO_INIT(prAdapter, ucNetworkTypeIndex); - - prBssInfo->eConnectionState = PARAM_MEDIA_STATE_DISCONNECTED; - prBssInfo->eConnectionStateIndicated = PARAM_MEDIA_STATE_DISCONNECTED; - prBssInfo->eCurrentOPMode = OP_MODE_ACCESS_POINT; - prBssInfo->fgIsNetActive = TRUE; - prBssInfo->ucNetTypeIndex = (ucNetworkTypeIndex); - prBssInfo->ucReasonOfDisconnect = DISCONNECT_REASON_CODE_RESERVED; - - prBssInfo->ucPhyTypeSet = PHY_TYPE_SET_802_11BG; /* Depend on eBand */ - prBssInfo->ucConfigAdHocAPMode = AP_MODE_MIXED_11BG; /* Depend on eCurrentOPMode and ucPhyTypeSet */ - prBssInfo->u2BSSBasicRateSet = RATE_SET_ERP; - prBssInfo->u2OperationalRateSet = RATE_SET_OFDM; - prBssInfo->fgErpProtectMode = FALSE; - prBssInfo->fgIsQBSS = TRUE; - - //4 <1.5> Setup MIB for current BSS - prBssInfo->u2BeaconInterval = 100; - prBssInfo->ucDTIMPeriod = DOT11_DTIM_PERIOD_DEFAULT; - prBssInfo->u2ATIMWindow = 0; - - prBssInfo->ucBeaconTimeoutCount = 0; - - - bssInitForAP (prAdapter,prBssInfo, TRUE); - - COPY_MAC_ADDR(prBssInfo->aucBSSID, _aucZeroMacAddr); - LINK_INITIALIZE(&prBssInfo->rStaRecOfClientList); - prBssInfo->fgIsBeaconActivated = TRUE; - prBssInfo->ucHwDefaultFixedRateCode = RATE_CCK_1M_LONG; - - - COPY_MAC_ADDR(prBssInfo->aucOwnMacAddr, prAdapter->rWifiVar.aucMacAddress); - - //4 <3> Initiate BSS_INFO_T - private part - /* TODO */ - prBssInfo->eBand = BAND_2G4; - prBssInfo->ucPrimaryChannel = 1; - prBssInfo->prStaRecOfAP = (P_STA_RECORD_T)NULL; - - - //prBssInfo->fgErpProtectMode = eErpProectMode; - //prBssInfo->eHtProtectMode = eHtProtectMode; - //prBssInfo->eGfOperationMode = eGfOperationMode; - - - //4 <4> Allocate MSDU_INFO_T for Beacon - prBssInfo->prBeacon = cnmMgtPktAlloc(prAdapter, - OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem[0]) + MAX_IE_LENGTH); - - if (prBssInfo->prBeacon) { - prBssInfo->prBeacon->eSrc = TX_PACKET_MGMT; - prBssInfo->prBeacon->ucNetworkType = ucNetworkTypeIndex; - } - else { - DBGLOG(SW4, INFO, ("prBeacon allocation fail\n")); - } - -#if 0 - prBssInfo->rPmProfSetupInfo.ucBmpDeliveryAC = PM_UAPSD_ALL; - prBssInfo->rPmProfSetupInfo.ucBmpTriggerAC = PM_UAPSD_ALL; - prBssInfo->rPmProfSetupInfo.ucUapsdSp = WMM_MAX_SP_LENGTH_2; -#else - prBssInfo->rPmProfSetupInfo.ucBmpDeliveryAC = (UINT_8)prAdapter->u4UapsdAcBmp; - prBssInfo->rPmProfSetupInfo.ucBmpTriggerAC =(UINT_8) prAdapter->u4UapsdAcBmp; - prBssInfo->rPmProfSetupInfo.ucUapsdSp = (UINT_8)prAdapter->u4MaxSpLen; -#endif - -#if 0 - for(eAci = 0; eAci < WMM_AC_INDEX_NUM; eAci++){ - - prBssInfo->arACQueParms[eAci].fgIsACMSet = FALSE; - prBssInfo->arACQueParms[eAci].u2Aifsn = (UINT_16) eAci; - prBssInfo->arACQueParms[eAci].u2CWmin = 7; - prBssInfo->arACQueParms[eAci].u2CWmax = 31; - prBssInfo->arACQueParms[eAci].u2TxopLimit = eAci+1; - DBGLOG(SW4, INFO, ("MQM: eAci = %d, ACM = %d, Aifsn = %d, CWmin = %d, CWmax = %d, TxopLimit = %d\n", - eAci,prBssInfo->arACQueParms[eAci].fgIsACMSet , - prBssInfo->arACQueParms[eAci].u2Aifsn, - prBssInfo->arACQueParms[eAci].u2CWmin, - prBssInfo->arACQueParms[eAci].u2CWmax, - prBssInfo->arACQueParms[eAci].u2TxopLimit)); - - } -#endif - - - DBGLOG(SW4, INFO, ("[2] ucBmpDeliveryAC:0x%x, ucBmpTriggerAC:0x%x, ucUapsdSp:0x%x", - prBssInfo->rPmProfSetupInfo.ucBmpDeliveryAC, - prBssInfo->rPmProfSetupInfo.ucBmpTriggerAC, - prBssInfo->rPmProfSetupInfo.ucUapsdSp)); - - return; -} - - - - -VOID testPsCmdCategory0(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0,UINT_8 ucOpt1) -{ - UINT_8 ucIndex,ucRead; - P_STA_RECORD_T prStaRec; - - DEBUGFUNC("testPsCmdCategory0"); - SWCR_GET_RW_INDEX(ucAction,ucRead,ucIndex); - - DBGLOG(SW4, LOUD, ("Read %u Index %u\n",ucRead,ucIndex)); - - prStaRec = cnmGetStaRecByIndex (prAdapter, 0); - - if(ucIndex>=TEST_PS_CATA0_INDEX_NUM) return; - - if(ucRead == SWCR_WRITE) { - switch(ucIndex) { - case TEST_PS_SETUP_BSS: - testPsSetupBss(prAdapter, ucOpt0) ; - break; - - case TEST_PS_ENABLE_BEACON: - break; - - case TEST_PS_TRIGGER_BMC: - //txmForwardQueuedBmcPkts (ucOpt0); - break; - case TEST_PS_SEND_NULL: - { - - testPsSendQoSNullFrame (prAdapter,prStaRec, - (UINT_8)(g_au4SwCr[1] & 0xFF), /* UP */ - ucOpt0, - (BOOLEAN)((g_au4SwCr[1] >>8)& 0xFF), /* BMC*/ - (BOOLEAN)((g_au4SwCr[1] >>16)& 0xFF), /* BurstEnd*/ - (BOOLEAN)((g_au4SwCr[1] >>24)& 0xFF), /* Packet type*/ - (UINT_8)((g_au4SwCr[2] )& 0xFF), /* PS sesson ID 7: NOACK */ - FALSE /* EOSP */ - ); - } - break; - case TEST_PS_BUFFER_BMC: - //g_aprBssInfo[ucOpt0]->fgApToBufferBMC = (g_au4SwCr[1] & 0xFF); - break; - case TEST_PS_UPDATE_BEACON: - bssUpdateBeaconContent(prAdapter, ucOpt0 /*networktype*/ ); - break; - - default: - break; - } - } - else { - switch(ucIndex) { - - case TEST_PS_MAGIC: - g_au4SwCr[1] = 0x88660011 ; - break; - - } - } -} - -#endif //TEST_PS - -#if TEST_PS - -VOID testPsCmdCategory1(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0,UINT_8 ucOpt1) -{ - UINT_8 ucIndex,ucRead; - UINT_8 ucWTEntry; - P_STA_RECORD_T prStaRec; - - DEBUGFUNC("testPsCmdCategory1"); - - SWCR_GET_RW_INDEX(ucAction,ucRead,ucIndex); - - if(ucOpt0>=CFG_STA_REC_NUM) return; - - prStaRec = cnmGetStaRecByIndex (prAdapter, ucOpt0); - ucWTEntry = prStaRec->ucWTEntry; - if(ucRead == SWCR_WRITE) { - - switch(ucIndex) { - case TEST_PS_STA_PS: - prStaRec->fgIsInPS = (BOOLEAN) (g_au4SwCr[1] & 0x1); - prStaRec->fgIsQoS = (BOOLEAN) (g_au4SwCr[1] >>8 & 0xFF); - prStaRec->fgIsUapsdSupported = (BOOLEAN) (g_au4SwCr[1] >>16 & 0xFF); - prStaRec->ucBmpDeliveryAC = (BOOLEAN) (g_au4SwCr[1] >>24 & 0xFF); - break; - - } - - } - else { - /* Read */ - switch(ucIndex) { - default: - break; - } - } - - -} - -#endif //TEST_PS - -#if CFG_SUPPORT_802_11V -#if (CFG_SUPPORT_802_11V_TIMING_MEASUREMENT ==1) && (WNM_UNIT_TEST ==1) -VOID testWNMCmdCategory0(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0,UINT_8 ucOpt1) -{ - UINT_8 ucIndex,ucRead; - P_STA_RECORD_T prStaRec; - - DEBUGFUNC("testWNMCmdCategory0"); - SWCR_GET_RW_INDEX(ucAction,ucRead,ucIndex); - - DBGLOG(SW4, INFO, ("Read %u Index %u\n",ucRead,ucIndex)); - - if(ucIndex>=TEST_WNM_CATA0_INDEX_NUM) return; - - if(ucRead == SWCR_WRITE) { - switch(ucIndex) { - case TEST_WNM_TIMING_MEAS: - wnmTimingMeasUnitTest1(prAdapter, ucOpt0) ; - break; - - default: - break; - } - } -} -#endif //TEST_WNM -#endif //CFG_SUPPORT_802_11V - -VOID swCtrlSwCr(P_ADAPTER_T prAdapter, UINT_8 ucRead, UINT_16 u2Addr, UINT_32 *pu4Data) -{ - /* According other register STAIDX */ - UINT_8 ucOffset; - ucOffset = (u2Addr>>2) & 0x3F; - - if(ucOffset>= SWCR_CR_NUM) return; - - if(ucRead==SWCR_WRITE) { - g_au4SwCr[ucOffset] = *pu4Data; - if(ucOffset==0x0) { - /* Commmand [31:24]: Category */ - /* Commmand [23:23]: 1(W) 0(R) */ - /* Commmand [22:16]: Index */ - /* Commmand [15:08]: Option0 */ - /* Commmand [07:00]: Option1 */ - UINT_8 ucCate; - UINT_32 u4Cmd; - u4Cmd = g_au4SwCr[0]; - ucCate = (UINT_8)(u4Cmd >> 24) ; - if(ucCate < sizeof(g_arSwCtrlCmd)/sizeof(g_arSwCtrlCmd[0])) { - if(g_arSwCtrlCmd[ucCate]!=NULL) { - g_arSwCtrlCmd[ucCate](prAdapter, ucCate, (UINT_8)(u4Cmd>>16 & 0xFF),(UINT_8)((u4Cmd>>8) & 0xFF), (UINT_8)(u4Cmd&0xFF)); - } - } - } - } - else { - *pu4Data = g_au4SwCr[ucOffset]; - } -} - -VOID swCrReadWriteCmd(P_ADAPTER_T prAdapter, UINT_8 ucRead, UINT_16 u2Addr, UINT_32 *pu4Data) -{ - UINT_8 ucMod; - - ucMod = u2Addr >>8; - /* Address [15:8] MOD ID */ - /* Address [7:0] OFFSET */ - - DEBUGFUNC("swCrReadWriteCmd"); - DBGLOG(SW4, INFO, ("%u addr 0x%x data 0x%x\n",ucRead,u2Addr,*pu4Data)); - - if(ucMod < (sizeof(g_arSwCrModHandle)/sizeof(g_arSwCrModHandle[0])) ) { - - if(g_arSwCrModHandle[ucMod]!=NULL) { - g_arSwCrModHandle[ucMod](prAdapter, ucRead, u2Addr, pu4Data); - } - } /* ucMod */ -} - -/* Debug Support */ -VOID swCrFrameCheckEnable(P_ADAPTER_T prAdapter, UINT_32 u4DumpType) -{ - g_u4SwcrDebugFrameDumpType = u4DumpType; - prAdapter->rRxCtrl.u4RxPktsDumpTypeMask = u4DumpType; -} - -VOID swCrDebugInit(P_ADAPTER_T prAdapter) -{ - // frame dump - if (g_u4SwcrDebugFrameDumpType) { - swCrFrameCheckEnable(prAdapter, g_u4SwcrDebugFrameDumpType); - } - - // debug counter - g_fgSwcrDebugTimer = FALSE; - - cnmTimerInitTimer(prAdapter, - &g_rSwcrDebugTimer, - (PFN_MGMT_TIMEOUT_FUNC)swCrDebugCheckTimeout, - (UINT_32) NULL); - - if (g_u4SwcrDebugCheckTimeout) { - swCrDebugCheckEnable(prAdapter, TRUE, g_ucSwcrDebugCheckType, g_u4SwcrDebugCheckTimeout); - } -} - -VOID swCrDebugUninit(P_ADAPTER_T prAdapter) -{ - cnmTimerStopTimer(prAdapter, &g_rSwcrDebugTimer); - - g_fgSwcrDebugTimer = FALSE; -} - -VOID swCrDebugCheckEnable(P_ADAPTER_T prAdapter, BOOLEAN fgIsEnable, UINT_8 ucType, UINT_32 u4Timeout) -{ - if (fgIsEnable) { - g_ucSwcrDebugCheckType = ucType; - g_u4SwcrDebugCheckTimeout = u4Timeout; - if (g_fgSwcrDebugTimer == FALSE) { - swCrDebugCheckTimeout(prAdapter, 0); - } - } - else { - cnmTimerStopTimer(prAdapter, &g_rSwcrDebugTimer); - g_u4SwcrDebugCheckTimeout = 0; - } - - g_fgSwcrDebugTimer = fgIsEnable; -} - -VOID swCrDebugCheck(P_ADAPTER_T prAdapter, P_CMD_SW_DBG_CTRL_T prCmdSwCtrl) -{ - P_RX_CTRL_T prRxCtrl; - P_TX_CTRL_T prTxCtrl; - - ASSERT(prAdapter); - - prTxCtrl = &prAdapter->rTxCtrl; - prRxCtrl = &prAdapter->rRxCtrl; - - // dump counters - if (prCmdSwCtrl) { - if (prCmdSwCtrl->u4Data == SWCR_DBG_TYPE_ALL) { - - // TX Counter from fw - DBGLOG(SW4, INFO, ("TX0\n" \ - "%08x %08x %08x %08x\n" \ - "%08x %08x %08x %08x\n", - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_TX_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_TX_BCN_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_TX_FAILED_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_TX_RETRY_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_TX_AGING_TIMEOUT_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_TX_PS_OVERFLOW_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_TX_MGNT_DROP_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_TX_ERROR_CNT])); -#if 1 - // TX Counter from drv - DBGLOG(SW4, INFO, ("TX1\n" \ - "%08x %08x %08x %08x\n", - (UINT_32)TX_GET_CNT(prTxCtrl, TX_INACTIVE_BSS_DROP), - (UINT_32)TX_GET_CNT(prTxCtrl, TX_INACTIVE_STA_DROP), - (UINT_32)TX_GET_CNT(prTxCtrl, TX_FORWARD_OVERFLOW_DROP), - (UINT_32)TX_GET_CNT(prTxCtrl, TX_AP_BORADCAST_DROP))); -#endif - - // RX Counter - DBGLOG(SW4, INFO, ("RX0\n" \ - "%08x %08x %08x %08x\n" \ - "%08x %08x %08x %08x\n" \ - "%08x %08x %08x %08x\n" \ - "%08x %08x %08x %08x\n", - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_DROP_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_DUP_DROP_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_TYPE_ERROR_DROP_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_CLASS_ERROR_DROP_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_AMPDU_ERROR_DROP_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_STATUS_ERROR_DROP_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_FORMAT_ERROR_DROP_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_ICV_ERROR_DROP_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_KEY_ERROR_DROP_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_TKIP_ERROR_DROP_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_MIC_ERROR_DROP_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_BIP_ERROR_DROP_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_FCSERR_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_FIFOFULL_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_RX_PFDROP_CNT])); - - DBGLOG(SW4, INFO, ("RX1\n" \ - "%08x %08x %08x %08x\n" \ - "%08x %08x %08x %08x\n", - (UINT_32)RX_GET_CNT(prRxCtrl, RX_MPDU_TOTAL_COUNT), - (UINT_32)RX_GET_CNT(prRxCtrl, RX_DATA_INDICATION_COUNT), - (UINT_32)RX_GET_CNT(prRxCtrl, RX_DATA_RETURNED_COUNT), - (UINT_32)RX_GET_CNT(prRxCtrl, RX_DATA_RETAINED_COUNT), - (UINT_32)RX_GET_CNT(prRxCtrl, RX_DROP_TOTAL_COUNT), - (UINT_32)RX_GET_CNT(prRxCtrl, RX_TYPE_ERR_DROP_COUNT), - (UINT_32)RX_GET_CNT(prRxCtrl, RX_CLASS_ERR_DROP_COUNT), - (UINT_32)RX_GET_CNT(prRxCtrl, RX_DST_NULL_DROP_COUNT))); - - DBGLOG(SW4, INFO, ("PWR\n" \ - "%08x %08x %08x %08x\n" \ - "%08x %08x %08x %08x\n", - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_PWR_PS_POLL_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_PWR_TRIGGER_NULL_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_PWR_BCN_IND_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_PWR_BCN_TIMEOUT_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_PWR_PM_STATE0], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_PWR_PM_STATE1], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_PWR_CUR_PS_PROF0], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_PWR_CUR_PS_PROF1])); - - DBGLOG(SW4, INFO, ("ARM\n" \ - "%08x %08x %08x %08x\n" \ - "%08x %08x\n", - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_AR_STA0_RATE], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_AR_STA0_BWGI], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_AR_STA0_RX_RATE_RCPI], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_ROAMING_ENABLE], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_ROAMING_ROAM_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_ROAMING_INT_CNT])); - - DBGLOG(SW4, INFO, ("BB\n" \ - "%08x %08x %08x %08x\n" \ - "%08x %08x %08x %08x\n", - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_BB_RX_MDRDY_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_BB_RX_FCSERR_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_BB_CCK_PD_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_BB_OFDM_PD_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_BB_CCK_SFDERR_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_BB_CCK_SIGERR_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_BB_OFDM_TAGERR_CNT], - prCmdSwCtrl->u4DebugCnt[SWCR_DBG_ALL_BB_OFDM_SIGERR_CNT])); - - } - } - - // start the next check - if (g_u4SwcrDebugCheckTimeout) { - cnmTimerStartTimer(prAdapter, &g_rSwcrDebugTimer, g_u4SwcrDebugCheckTimeout * MSEC_PER_SEC); - } -} - -VOID swCrDebugCheckTimeout( - IN P_ADAPTER_T prAdapter, - UINT_32 u4Param) -{ - CMD_SW_DBG_CTRL_T rCmdSwCtrl; - WLAN_STATUS rStatus; - - rCmdSwCtrl.u4Id = (0xb000<<16) + g_ucSwcrDebugCheckType; - rCmdSwCtrl.u4Data = 0; - rStatus = wlanSendSetQueryCmd ( - prAdapter, /* prAdapter */ - CMD_ID_SW_DBG_CTRL, /* ucCID */ - FALSE, /* fgSetQuery */ - TRUE, /* fgNeedResp */ - FALSE, /* fgIsOid */ - swCrDebugQuery, /* pfCmdDoneHandler */ - swCrDebugQueryTimeout, /* pfCmdTimeoutHandler */ - sizeof(CMD_SW_DBG_CTRL_T), /* u4SetQueryInfoLen */ - (PUINT_8)&rCmdSwCtrl, /* pucInfoBuffer */ - NULL, /* pvSetQueryBuffer */ - 0 /* u4SetQueryBufferLen */ - ); - - ASSERT(rStatus == WLAN_STATUS_PENDING); - - return; -} - -VOID swCrDebugQuery( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - ASSERT(prAdapter); - - swCrDebugCheck(prAdapter, (P_CMD_SW_DBG_CTRL_T)(pucEventBuf)); -} - -VOID swCrDebugQueryTimeout( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo) -{ - ASSERT(prAdapter); - - swCrDebugCheck(prAdapter, NULL); -} - -#endif /* CFG_SUPPORT_SWCR */ - - diff --git a/drivers/net/wireless/mt5931/mgmt/wapi.c b/drivers/net/wireless/mt5931/mgmt/wapi.c deleted file mode 100755 index abf807d31193..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/wapi.c +++ /dev/null @@ -1,514 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/wapi.c#1 $ -*/ - -/*! \file "wapi.c" - \brief This file including the WAPI related function. - - This file provided the macros and functions library support the wapi ie parsing, - cipher and AKM check to help the AP seleced deciding. -*/ - - - -/* -** $Log: wapi.c $ - * - * 11 10 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * change the debug module level. - * - * 10 20 2010 wh.su - * [WCXRP00000067] [MT6620 Wi-Fi][Driver] Support the android+ WAPI function - * fixed the network type - * - * 09 01 2010 wh.su - * NULL - * adding the wapi support for integration test. - * - * 07 20 2010 wh.su - * - * . - * - * 04 06 2010 wh.su - * [BORA00000680][MT6620] Support the statistic for Microsoft os query - * fixed the firmware return the broadcast frame at wrong tc. - * - * 03 03 2010 wh.su - * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize - * move the AIS specific variable for security to AIS specific structure. - * - * 12 18 2009 cm.chang - * [BORA00000018]Integrate WIFI part into BORA for the 1st time - * . - * - * Dec 8 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the function to check and update the default wapi tx - * - * Dec 7 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * adding the generate wapi ie function, and replace the tabe by space - * - * Nov 23 2009 mtk01088 - * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code - * -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -#include "precomp.h" -#if CFG_SUPPORT_WAPI - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* -* \brief This routine is called to generate WPA IE for -* associate request frame. -* -* \param[in] prCurrentBss The Selected BSS description -* -* \retval The append WPA IE length -* -* \note -* Called by: AIS module, Associate request -*/ -/*----------------------------------------------------------------------------*/ -VOID -wapiGenerateWAPIIE ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - PUINT_8 pucBuffer; - - ASSERT(prAdapter); - ASSERT(prMsduInfo); - - if (prMsduInfo->ucNetworkType != NETWORK_TYPE_AIS_INDEX) - return; - - pucBuffer = (PUINT_8)((UINT_32)prMsduInfo->prPacket + - (UINT_32)prMsduInfo->u2FrameLength); - - /* ASSOC INFO IE ID: 68 :0x44 */ - if (/* prWlanInfo->fgWapiMode && */ prAdapter->prGlueInfo->u2WapiAssocInfoIESz) { - kalMemCopy(pucBuffer, &prAdapter->prGlueInfo->aucWapiAssocInfoIEs, prAdapter->prGlueInfo->u2WapiAssocInfoIESz); - prMsduInfo->u2FrameLength += prAdapter->prGlueInfo->u2WapiAssocInfoIESz; - } - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to parse WAPI IE. -* -* \param[in] prInfoElem Pointer to the RSN IE -* \param[out] prRsnInfo Pointer to the BSSDescription structure to store the -** WAPI information from the given WAPI IE -* -* \retval TRUE - Succeeded -* \retval FALSE - Failed -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wapiParseWapiIE ( - IN P_WAPI_INFO_ELEM_T prInfoElem, - OUT P_WAPI_INFO_T prWapiInfo - ) -{ - UINT_32 i; - INT_32 u4RemainWapiIeLen; - UINT_16 u2Version; - UINT_16 u2Cap = 0; - UINT_32 u4GroupSuite = WAPI_CIPHER_SUITE_WPI; - UINT_16 u2PairSuiteCount = 0; - UINT_16 u2AuthSuiteCount = 0; - PUCHAR pucPairSuite = NULL; - PUCHAR pucAuthSuite = NULL; - PUCHAR cp; - - DEBUGFUNC("wapiParseWapiIE"); - - ASSERT(prInfoElem); - ASSERT(prWapiInfo); - - /* Verify the length of the WAPI IE. */ - if (prInfoElem->ucLength < 6) { - DBGLOG(SEC, TRACE, ("WAPI IE length too short (length=%d)\n", prInfoElem->ucLength)); - return FALSE; - } - - /* Check WAPI version: currently, we only support version 1. */ - WLAN_GET_FIELD_16(&prInfoElem->u2Version, &u2Version); - if (u2Version != 1) { - DBGLOG(SEC, TRACE, ("Unsupported WAPI IE version: %d\n", u2Version)); - return FALSE; - } - - cp = (PUCHAR) &prInfoElem->u2AuthKeyMgtSuiteCount; - u4RemainWapiIeLen = (INT_32) prInfoElem->ucLength - 2; - - do { - if (u4RemainWapiIeLen == 0) { - break; - } - - /* - AuthCount : 2 - AuthSuite : 4 * authSuiteCount - PairwiseCount: 2 - PairwiseSuite: 4 * pairSuiteCount - GroupSuite : 4 - Cap : 2 */ - - /* Parse the Authentication and Key Management Cipher Suite Count - field. */ - if (u4RemainWapiIeLen < 2) { - DBGLOG(SEC, TRACE, ("Fail to parse WAPI IE in auth & key mgt suite count (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - WLAN_GET_FIELD_16(cp, &u2AuthSuiteCount); - cp += 2; - u4RemainWapiIeLen -= 2; - - /* Parse the Authentication and Key Management Cipher Suite List - field. */ - i = (UINT_32) u2AuthSuiteCount * 4; - if (u4RemainWapiIeLen < (INT_32) i) { - DBGLOG(SEC, TRACE, ("Fail to parse WAPI IE in auth & key mgt suite list (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - pucAuthSuite = cp; - - cp += i; - u4RemainWapiIeLen -= (INT_32) i; - - if (u4RemainWapiIeLen == 0) { - break; - } - - /* Parse the Pairwise Key Cipher Suite Count field. */ - if (u4RemainWapiIeLen < 2) { - DBGLOG(SEC, TRACE, ("Fail to parse WAPI IE in pairwise cipher suite count (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - WLAN_GET_FIELD_16(cp, &u2PairSuiteCount); - cp += 2; - u4RemainWapiIeLen -= 2; - - /* Parse the Pairwise Key Cipher Suite List field. */ - i = (UINT_32) u2PairSuiteCount * 4; - if (u4RemainWapiIeLen < (INT_32) i) { - DBGLOG(SEC, TRACE, ("Fail to parse WAPI IE in pairwise cipher suite list (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - pucPairSuite = cp; - - cp += i; - u4RemainWapiIeLen -= (INT_32) i; - - /* Parse the Group Key Cipher Suite field. */ - if (u4RemainWapiIeLen < 4) { - DBGLOG(SEC, TRACE, ("Fail to parse WAPI IE in group cipher suite (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - WLAN_GET_FIELD_32(cp, &u4GroupSuite); - cp += 4; - u4RemainWapiIeLen -= 4; - - /* Parse the WAPI u2Capabilities field. */ - if (u4RemainWapiIeLen < 2) { - DBGLOG(SEC, TRACE, ("Fail to parse WAPI IE in WAPI capabilities (IE len: %d)\n", - prInfoElem->ucLength)); - return FALSE; - } - - WLAN_GET_FIELD_16(cp, &u2Cap); - u4RemainWapiIeLen -= 2; - - /* Todo:: BKID support */ - } while (FALSE); - - /* Save the WAPI information for the BSS. */ - - prWapiInfo->ucElemId = ELEM_ID_WAPI; - - prWapiInfo->u2Version = u2Version; - - prWapiInfo->u4GroupKeyCipherSuite = u4GroupSuite; - - DBGLOG(SEC, LOUD, ("WAPI: version %d, group key cipher suite %02x-%02x-%02x-%02x\n", - u2Version, (UCHAR) (u4GroupSuite & 0x000000FF), - (UCHAR) ((u4GroupSuite >> 8) & 0x000000FF), - (UCHAR) ((u4GroupSuite >> 16) & 0x000000FF), - (UCHAR) ((u4GroupSuite >> 24) & 0x000000FF))); - - if (pucPairSuite) { - /* The information about the pairwise key cipher suites is present. */ - if (u2PairSuiteCount > MAX_NUM_SUPPORTED_CIPHER_SUITES) { - u2PairSuiteCount = MAX_NUM_SUPPORTED_CIPHER_SUITES; - } - - prWapiInfo->u4PairwiseKeyCipherSuiteCount = (UINT_32) u2PairSuiteCount; - - for (i = 0; i < (UINT_32) u2PairSuiteCount; i++) { - WLAN_GET_FIELD_32(pucPairSuite, - &prWapiInfo->au4PairwiseKeyCipherSuite[i]); - pucPairSuite += 4; - - DBGLOG(SEC, LOUD,("WAPI: pairwise key cipher suite [%d]: %02x-%02x-%02x-%02x\n", - (UINT_8)i, (UCHAR) (prWapiInfo->au4PairwiseKeyCipherSuite[i] & 0x000000FF), - (UCHAR) ((prWapiInfo->au4PairwiseKeyCipherSuite[i] >> 8) & 0x000000FF), - (UCHAR) ((prWapiInfo->au4PairwiseKeyCipherSuite[i] >> 16) & 0x000000FF), - (UCHAR) ((prWapiInfo->au4PairwiseKeyCipherSuite[i] >> 24) & 0x000000FF))); - } - } - else { - /* The information about the pairwise key cipher suites is not present. - Use the default chipher suite for WAPI: WPI. */ - prWapiInfo->u4PairwiseKeyCipherSuiteCount = 1; - prWapiInfo->au4PairwiseKeyCipherSuite[0] = WAPI_CIPHER_SUITE_WPI; - - DBGLOG(SEC, LOUD, ("WAPI: pairwise key cipher suite: %02x-%02x-%02x-%02x (default)\n", - (UCHAR) (prWapiInfo->au4PairwiseKeyCipherSuite[0] & 0x000000FF), - (UCHAR) ((prWapiInfo->au4PairwiseKeyCipherSuite[0] >> 8) & 0x000000FF), - (UCHAR) ((prWapiInfo->au4PairwiseKeyCipherSuite[0] >> 16) & 0x000000FF), - (UCHAR) ((prWapiInfo->au4PairwiseKeyCipherSuite[0] >> 24) & 0x000000FF))); - } - - if (pucAuthSuite) { - /* The information about the authentication and key management suites - is present. */ - if (u2AuthSuiteCount > MAX_NUM_SUPPORTED_AKM_SUITES) { - u2AuthSuiteCount = MAX_NUM_SUPPORTED_AKM_SUITES; - } - - prWapiInfo->u4AuthKeyMgtSuiteCount = (UINT_32) u2AuthSuiteCount; - - for (i = 0; i < (UINT_32) u2AuthSuiteCount; i++) { - WLAN_GET_FIELD_32(pucAuthSuite, &prWapiInfo->au4AuthKeyMgtSuite[i]); - pucAuthSuite += 4; - - DBGLOG(SEC, LOUD, ("WAPI: AKM suite [%d]: %02x-%02x-%02x-%02x\n", - (UINT_8)i, (UCHAR) (prWapiInfo->au4AuthKeyMgtSuite[i] & 0x000000FF), - (UCHAR) ((prWapiInfo->au4AuthKeyMgtSuite[i] >> 8) & 0x000000FF), - (UCHAR) ((prWapiInfo->au4AuthKeyMgtSuite[i] >> 16) & 0x000000FF), - (UCHAR) ((prWapiInfo->au4AuthKeyMgtSuite[i] >> 24) & 0x000000FF))); - } - } - else { - /* The information about the authentication and key management suites - is not present. Use the default AKM suite for WAPI. */ - prWapiInfo->u4AuthKeyMgtSuiteCount = 1; - prWapiInfo->au4AuthKeyMgtSuite[0] = WAPI_AKM_SUITE_802_1X; - - DBGLOG(SEC, LOUD, ("WAPI: AKM suite: %02x-%02x-%02x-%02x (default)\n", - (UCHAR) (prWapiInfo->au4AuthKeyMgtSuite[0] & 0x000000FF), - (UCHAR) ((prWapiInfo->au4AuthKeyMgtSuite[0] >> 8) & 0x000000FF), - (UCHAR) ((prWapiInfo->au4AuthKeyMgtSuite[0] >> 16) & 0x000000FF), - (UCHAR) ((prWapiInfo->au4AuthKeyMgtSuite[0] >> 24) & 0x000000FF))); - } - - prWapiInfo->u2WapiCap = u2Cap; - DBGLOG(SEC, LOUD, ("WAPI: cap: 0x%04x\n", prWapiInfo->u2WapiCap)); - - return TRUE; -} /* wapiParseWapiIE */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to perform WAPI policy selection for a given BSS. -* -* \param[in] prAdapter Pointer to the adapter object data area. -* \param[in] prBss Pointer to the BSS description -* -* \retval TRUE - The WAPI policy selection for the given BSS is -* successful. The selected pairwise and group cipher suites -* are returned in the BSS description. -* \retval FALSE - The WAPI policy selection for the given BSS is failed. -* The driver shall not attempt to join the given BSS. -* -* \note The Encrypt status matched score will save to bss for final ap select. -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wapiPerformPolicySelection ( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prBss - ) -{ - UINT_32 i; - UINT_32 u4PairwiseCipher = 0; - UINT_32 u4GroupCipher = 0; - UINT_32 u4AkmSuite = 0; - P_WAPI_INFO_T prBssWapiInfo; - P_WLAN_INFO_T prWlanInfo; - - DEBUGFUNC("wapiPerformPolicySelection"); - - ASSERT(prBss); - - /* Notice!!!! WAPI AP not set the privacy bit for WAI and WAI-PSK at WZC configuration mode */ - prWlanInfo = &prAdapter->rWlanInfo; - - if (prBss->fgIEWAPI) { - prBssWapiInfo = &prBss->rIEWAPI; - } - else { - if (prAdapter->rWifiVar.rConnSettings.fgWapiMode == FALSE) { - DBGLOG(SEC, TRACE,("-- No Protected BSS\n")); - return TRUE; - } - else { - DBGLOG(SEC, TRACE, ("WAPI Information Element does not exist.\n")); - return FALSE; - } - } - - /* Select pairwise/group ciphers */ - for (i = 0; i < prBssWapiInfo->u4PairwiseKeyCipherSuiteCount; i++) { - if (prBssWapiInfo->au4PairwiseKeyCipherSuite[i] == - prAdapter->rWifiVar.rConnSettings.u4WapiSelectedPairwiseCipher) { - u4PairwiseCipher = prBssWapiInfo->au4PairwiseKeyCipherSuite[i]; - } - } - if (prBssWapiInfo->u4GroupKeyCipherSuite == - prAdapter->rWifiVar.rConnSettings.u4WapiSelectedGroupCipher) - u4GroupCipher = prBssWapiInfo->u4GroupKeyCipherSuite; - - /* Exception handler */ - /* If we cannot find proper pairwise and group cipher suites to join the - BSS, do not check the supported AKM suites. */ - if (u4PairwiseCipher == 0 || u4GroupCipher == 0) { - DBGLOG(SEC, TRACE, ("Failed to select pairwise/group cipher (0x%08lx/0x%08lx)\n", - u4PairwiseCipher, u4GroupCipher)); - return FALSE; - } - - /* Select AKM */ - /* If the driver cannot support any authentication suites advertised in - the given BSS, we fail to perform RSNA policy selection. */ - /* Attempt to find any overlapping supported AKM suite. */ - for (i = 0; i < prBssWapiInfo->u4AuthKeyMgtSuiteCount; i++) { - if (prBssWapiInfo->au4AuthKeyMgtSuite[i] == prAdapter->rWifiVar.rConnSettings.u4WapiSelectedAKMSuite) { - u4AkmSuite = prBssWapiInfo->au4AuthKeyMgtSuite[i]; - break; - } - } - - if (u4AkmSuite == 0) { - DBGLOG(SEC, TRACE, ("Cannot support any AKM suites\n")); - return FALSE; - } - - DBGLOG(SEC, TRACE, ("Selected pairwise/group cipher: %02x-%02x-%02x-%02x/%02x-%02x-%02x-%02x\n", - (UINT_8) (u4PairwiseCipher & 0x000000FF), - (UINT_8) ((u4PairwiseCipher >> 8) & 0x000000FF), - (UINT_8) ((u4PairwiseCipher >> 16) & 0x000000FF), - (UINT_8) ((u4PairwiseCipher >> 24) & 0x000000FF), - (UINT_8) (u4GroupCipher & 0x000000FF), - (UINT_8) ((u4GroupCipher >> 8) & 0x000000FF), - (UINT_8) ((u4GroupCipher >> 16) & 0x000000FF), - (UINT_8) ((u4GroupCipher >> 24) & 0x000000FF))); - - DBGLOG(SEC, TRACE, ("Selected AKM suite: %02x-%02x-%02x-%02x\n", - (UINT_8) (u4AkmSuite & 0x000000FF), - (UINT_8) ((u4AkmSuite >> 8) & 0x000000FF), - (UINT_8) ((u4AkmSuite >> 16) & 0x000000FF), - (UINT_8) ((u4AkmSuite >> 24) & 0x000000FF))); - - return TRUE; -} /* wapiPerformPolicySelection */ - -#if 0 -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is use for wapi mode, to update the current wpi tx idx ? 0 :1 . -* -* \param[in] prStaRec Pointer to the Sta record -* \param[out] ucWlanIdx The Rx status->wlanidx field -* -* \retval TRUE - Succeeded -* \retval FALSE - Failed -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wapiUpdateTxKeyIdx ( - IN P_STA_RECORD_T prStaRec, - IN UINT_8 ucWlanIdx - ) -{ - UINT_8 ucKeyId; - - if ((ucWlanIdx & BITS(0, 3)) == CIPHER_SUITE_WPI) { - - ucKeyId = ((ucWlanIdx & BITS(4, 5)) >> 4); - - if (ucKeyId != g_prWifiVar->rAisSpecificBssInfo.ucWpiActivedPWKey) { - DBGLOG(RSN, STATE, ("Change wapi key index from %d->%d\n", g_prWifiVar->rAisSpecificBssInfo.ucWpiActivedPWKey, ucKeyId)); - g_prWifiVar->rAisSpecificBssInfo.ucWpiActivedPWKey = ucKeyId; - - prStaRec->ucWTEntry = - (ucKeyId == WTBL_AIS_BSSID_WAPI_IDX_0) ? WTBL_AIS_BSSID_WAPI_IDX_0 : WTBL_AIS_BSSID_WAPI_IDX_1; - } - } -} -#endif -#endif - diff --git a/drivers/net/wireless/mt5931/mgmt/wnm.c b/drivers/net/wireless/mt5931/mgmt/wnm.c deleted file mode 100755 index c6871df87ce7..000000000000 --- a/drivers/net/wireless/mt5931/mgmt/wnm.c +++ /dev/null @@ -1,349 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/MT6620_5931_WiFi_Driver/mgmt/wnm.c#1 $ -*/ - -/*! \file "wnm.c" - \brief This file includes the 802.11v default vale and functions. -*/ - - - -/* -** $Log: wnm.c $ - * - * 01 05 2012 tsaiyuan.hsu - * [WCXRP00001157] [MT6620 Wi-Fi][FW][DRV] add timing measurement support for 802.11v - * add timing measurement support for 802.11v. - * - * -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -#if CFG_SUPPORT_802_11V - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -#define WNM_MAX_TOD_ERROR 0 -#define WNM_MAX_TOA_ERROR 0 -#define MICRO_TO_10NANO(x) ((x)*100) -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -static UINT_8 ucTimingMeasToken = 0; - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -WLAN_STATUS -wnmRunEventTimgingMeasTxDone ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ); - -VOID -wnmComposeTimingMeasFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN PFN_TX_DONE_HANDLER pfTxDoneHandler - ); - -VOID -wnmTimingMeasRequest ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ); -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* -* \brief This routine is called to process the 802.11v wnm category action frame. -* -* -* \note -* Called by: Handle Rx mgmt request -*/ -/*----------------------------------------------------------------------------*/ -VOID -wnmWNMAction ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_WLAN_ACTION_FRAME prRxFrame; - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - prRxFrame = (P_WLAN_ACTION_FRAME) prSwRfb->pvHeader; - -#if CFG_SUPPORT_802_11V_TIMING_MEASUREMENT - if (prRxFrame->ucAction == ACTION_WNM_TIMING_MEASUREMENT_REQUEST) { - wnmTimingMeasRequest(prAdapter, prSwRfb); - return; - } -#endif - - DBGLOG(WNM, TRACE, ("Unsupport WNM action frame: %d\n", prRxFrame->ucAction)); -} - -#if CFG_SUPPORT_802_11V_TIMING_MEASUREMENT -/*----------------------------------------------------------------------------*/ -/*! -* -* \brief This routine is called to report timing measurement data. -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -wnmReportTimingMeas ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucStaRecIndex, - IN UINT_32 u4ToD, - IN UINT_32 u4ToA - ) -{ - P_STA_RECORD_T prStaRec; - - prStaRec = cnmGetStaRecByIndex(prAdapter, ucStaRecIndex); - - if ((!prStaRec) || (!prStaRec->fgIsInUse)) { - return; - } - - DBGLOG(WNM, TRACE, ("wnmReportTimingMeas: u4ToD %x u4ToA %x", u4ToD, u4ToA)); - - if (!prStaRec->rWNMTimingMsmt.ucTrigger) - return; - - prStaRec->rWNMTimingMsmt.u4ToD = MICRO_TO_10NANO(u4ToD); - prStaRec->rWNMTimingMsmt.u4ToA = MICRO_TO_10NANO(u4ToA); -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will handle TxDone(TimingMeasurement) Event. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prMsduInfo Pointer to the MSDU_INFO_T. -* @param[in] rTxDoneStatus Return TX status of the Timing Measurement frame. -* -* @retval WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -wnmRunEventTimgingMeasTxDone ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_TX_RESULT_CODE_T rTxDoneStatus - ) -{ - P_STA_RECORD_T prStaRec; - - ASSERT(prAdapter); - ASSERT(prMsduInfo); - - DBGLOG(WNM, LOUD, ("EVENT-TX DONE: Current Time = %ld\n", kalGetTimeTick())); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - if ((!prStaRec) || (!prStaRec->fgIsInUse)) { - return WLAN_STATUS_SUCCESS; /* For the case of replying ERROR STATUS CODE */ - } - - DBGLOG(WNM, TRACE, ("wnmRunEventTimgingMeasTxDone: ucDialog %d ucFollowUp %d u4ToD %x u4ToA %x", - prStaRec->rWNMTimingMsmt.ucDialogToken, - prStaRec->rWNMTimingMsmt.ucFollowUpDialogToken, - prStaRec->rWNMTimingMsmt.u4ToD, - prStaRec->rWNMTimingMsmt.u4ToA)); - - prStaRec->rWNMTimingMsmt.ucFollowUpDialogToken = prStaRec->rWNMTimingMsmt.ucDialogToken; - prStaRec->rWNMTimingMsmt.ucDialogToken = ++ucTimingMeasToken; - - wnmComposeTimingMeasFrame(prAdapter, prStaRec, NULL); - - return WLAN_STATUS_SUCCESS; - -} /* end of wnmRunEventTimgingMeasTxDone() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will compose the Timing Measurement frame. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] prStaRec Pointer to the STA_RECORD_T. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -wnmComposeTimingMeasFrame ( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN PFN_TX_DONE_HANDLER pfTxDoneHandler - ) -{ - P_MSDU_INFO_T prMsduInfo; - P_BSS_INFO_T prBssInfo; - P_ACTION_UNPROTECTED_WNM_TIMING_MEAS_FRAME prTxFrame; - UINT_16 u2PayloadLen; - - prBssInfo = &prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]; - ASSERT(prBssInfo); - - prMsduInfo = (P_MSDU_INFO_T) cnmMgtPktAlloc(prAdapter, - MAC_TX_RESERVED_FIELD + PUBLIC_ACTION_MAX_LEN); - - if (!prMsduInfo) - return; - - prTxFrame = (P_ACTION_UNPROTECTED_WNM_TIMING_MEAS_FRAME) - ((UINT_32)(prMsduInfo->prPacket) + MAC_TX_RESERVED_FIELD); - - prTxFrame->u2FrameCtrl = MAC_FRAME_ACTION; - - COPY_MAC_ADDR(prTxFrame->aucDestAddr, prStaRec->aucMacAddr); - COPY_MAC_ADDR(prTxFrame->aucSrcAddr, prBssInfo->aucOwnMacAddr); - COPY_MAC_ADDR(prTxFrame->aucBSSID, prBssInfo->aucBSSID); - - prTxFrame->ucCategory = CATEGORY_UNPROTECTED_WNM_ACTION; - prTxFrame->ucAction = ACTION_UNPROTECTED_WNM_TIMING_MEASUREMENT; - - //3 Compose the frame body's frame. - prTxFrame->ucDialogToken = prStaRec->rWNMTimingMsmt.ucDialogToken; - prTxFrame->ucFollowUpDialogToken = prStaRec->rWNMTimingMsmt.ucFollowUpDialogToken; - prTxFrame->u4ToD = prStaRec->rWNMTimingMsmt.u4ToD; - prTxFrame->u4ToA = prStaRec->rWNMTimingMsmt.u4ToA; - prTxFrame->ucMaxToDErr = WNM_MAX_TOD_ERROR; - prTxFrame->ucMaxToAErr = WNM_MAX_TOA_ERROR; - - u2PayloadLen = 2 + ACTION_UNPROTECTED_WNM_TIMING_MEAS_LEN; - - //4 Update information of MSDU_INFO_T - prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_MGMT; /* Management frame */ - prMsduInfo->ucStaRecIndex = prStaRec->ucIndex; - prMsduInfo->ucNetworkType = prStaRec->ucNetTypeIndex; - prMsduInfo->ucMacHeaderLength = WLAN_MAC_MGMT_HEADER_LEN; - prMsduInfo->fgIs802_1x = FALSE; - prMsduInfo->fgIs802_11 = TRUE; - prMsduInfo->u2FrameLength = WLAN_MAC_MGMT_HEADER_LEN + u2PayloadLen; - prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter); - prMsduInfo->pfTxDoneHandler = pfTxDoneHandler; - prMsduInfo->fgIsBasicRate = FALSE; - - DBGLOG(WNM, TRACE, ("wnmComposeTimingMeasFrame: ucDialogToken %d ucFollowUpDialogToken %d u4ToD %x u4ToA %x\n", - prTxFrame->ucDialogToken, prTxFrame->ucFollowUpDialogToken, - prTxFrame->u4ToD, prTxFrame->u4ToA)); - - //4 Enqueue the frame to send this action frame. - nicTxEnqueueMsdu(prAdapter, prMsduInfo); - - return; - -} /* end of wnmComposeTimingMeasFrame() */ - -/*----------------------------------------------------------------------------*/ -/*! -* -* \brief This routine is called to process the 802.11v timing measurement request. -* -* -* \note -* Handle Rx mgmt request -*/ -/*----------------------------------------------------------------------------*/ -VOID -wnmTimingMeasRequest ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_ACTION_WNM_TIMING_MEAS_REQ_FRAME prRxFrame = NULL; - P_STA_RECORD_T prStaRec; - - prRxFrame = (P_ACTION_WNM_TIMING_MEAS_REQ_FRAME)prSwRfb->pvHeader; - if (!prRxFrame) - return; - - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - if ((!prStaRec) || (!prStaRec->fgIsInUse)) { - return; - } - - DBGLOG(WNM, TRACE, ("IEEE 802.11: Received Timing Measuremen Request from " - MACSTR"\n", MAC2STR(prStaRec->aucMacAddr))); - - // reset timing msmt - prStaRec->rWNMTimingMsmt.fgInitiator = TRUE; - prStaRec->rWNMTimingMsmt.ucTrigger = prRxFrame->ucTrigger; - if (!prRxFrame->ucTrigger) - return; - - prStaRec->rWNMTimingMsmt.ucDialogToken = ++ucTimingMeasToken; - prStaRec->rWNMTimingMsmt.ucFollowUpDialogToken = 0; - - wnmComposeTimingMeasFrame(prAdapter, prStaRec, wnmRunEventTimgingMeasTxDone); -} - -#if WNM_UNIT_TEST -VOID wnmTimingMeasUnitTest1(P_ADAPTER_T prAdapter, UINT_8 ucStaRecIndex) -{ - P_STA_RECORD_T prStaRec; - - prStaRec = cnmGetStaRecByIndex(prAdapter, ucStaRecIndex); - if ((!prStaRec) || (!prStaRec->fgIsInUse)) { - return; - } - - DBGLOG(WNM, INFO, ("IEEE 802.11v: Test Timing Measuremen Request from " - MACSTR"\n", MAC2STR(prStaRec->aucMacAddr))); - - prStaRec->rWNMTimingMsmt.fgInitiator = TRUE; - prStaRec->rWNMTimingMsmt.ucTrigger = 1; - - prStaRec->rWNMTimingMsmt.ucDialogToken = ++ucTimingMeasToken; - prStaRec->rWNMTimingMsmt.ucFollowUpDialogToken = 0; - - wnmComposeTimingMeasFrame(prAdapter, prStaRec, wnmRunEventTimgingMeasTxDone); -} -#endif - -#endif /* CFG_SUPPORT_802_11V_TIMING_MEASUREMENT */ - -#endif /* CFG_SUPPORT_802_11V */ diff --git a/drivers/net/wireless/mt5931/nic/cmd_buf.c b/drivers/net/wireless/mt5931/nic/cmd_buf.c deleted file mode 100755 index 62653abf608a..000000000000 --- a/drivers/net/wireless/mt5931/nic/cmd_buf.c +++ /dev/null @@ -1,218 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/nic/cmd_buf.c#1 $ -*/ - -/*! \file "cmd_buf.c" - \brief This file contain the management function of internal Command Buffer - for CMD_INFO_T. - - We'll convert the OID into Command Packet and then send to FW. Thus we need - to copy the OID information to Command Buffer for following reasons. - 1. The data structure of OID information may not equal to the data structure of - Command, we cannot use the OID buffer directly. - 2. If the Command was not generated by driver we also need a place to store the - information. - 3. Because the CMD is NOT FIFO when doing memory allocation (CMD will be generated - from OID or interrupt handler), thus we'll use the Block style of Memory Allocation - here. -*/ - - - -/* -** $Log: cmd_buf.c $ - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 02 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. clear prPendingCmdInfo properly - * * 2. while allocating memory for cmdinfo, no need to add extra 4 bytes. -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-10-13 21:59:08 GMT mtk01084 -** remove un-neceasary spaces -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-05-20 12:24:26 GMT mtk01461 -** Increase CMD Buffer - HIF_RX_HW_APPENDED_LEN when doing CMD_INFO_T allocation -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-04-21 09:41:08 GMT mtk01461 -** Add init of Driver Domain MCR flag and fix lint MTK WARN -** \main\maintrunk.MT6620WiFiDriver_Prj\1 2009-04-17 19:51:45 GMT mtk01461 -** allocation function of CMD_INFO_T -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to initial the MGMT memory pool for CMD Packet. -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cmdBufInitialize ( - IN P_ADAPTER_T prAdapter - ) -{ - P_CMD_INFO_T prCmdInfo; - UINT_32 i; - - ASSERT(prAdapter); - - QUEUE_INITIALIZE(&prAdapter->rFreeCmdList); - - for (i = 0; i < CFG_TX_MAX_CMD_PKT_NUM; i++) { - prCmdInfo = &prAdapter->arHifCmdDesc[i]; - QUEUE_INSERT_TAIL(&prAdapter->rFreeCmdList, &prCmdInfo->rQueEntry); - } - -} /* end of cmdBufInitialize() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Allocate CMD_INFO_T from a free list and MGMT memory pool. -* -* @param[in] prAdapter Pointer to the Adapter structure. -* @param[in] u4Length Length of the frame buffer to allocate. -* -* @retval NULL Pointer to the valid CMD Packet handler -* @retval !NULL Fail to allocat CMD Packet -*/ -/*----------------------------------------------------------------------------*/ -P_CMD_INFO_T -cmdBufAllocateCmdInfo ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Length - ) -{ - P_CMD_INFO_T prCmdInfo; - KAL_SPIN_LOCK_DECLARATION(); - - DEBUGFUNC("cmdBufAllocateCmdInfo"); - - - ASSERT(prAdapter); - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_RESOURCE); - QUEUE_REMOVE_HEAD(&prAdapter->rFreeCmdList, prCmdInfo, P_CMD_INFO_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_RESOURCE); - - if (prCmdInfo) { - /* Setup initial value in CMD_INFO_T */ - /* Start address of allocated memory */ - prCmdInfo->pucInfoBuffer = - cnmMemAlloc(prAdapter, RAM_TYPE_BUF, u4Length); - - if (prCmdInfo->pucInfoBuffer == NULL) { - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_RESOURCE); - QUEUE_INSERT_TAIL(&prAdapter->rFreeCmdList, &prCmdInfo->rQueEntry); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_RESOURCE); - - prCmdInfo = NULL; - } - else { - prCmdInfo->u2InfoBufLen = 0; - prCmdInfo->fgIsOid = FALSE; - prCmdInfo->fgDriverDomainMCR = FALSE; - } - } - - return prCmdInfo; - -} /* end of cmdBufAllocateCmdInfo() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to free the CMD Packet to the MGMT memory pool. -* -* @param prAdapter Pointer to the Adapter structure. -* @param prCmdInfo CMD Packet handler -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -cmdBufFreeCmdInfo ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ) -{ - KAL_SPIN_LOCK_DECLARATION(); - - DEBUGFUNC("cmdBufFreeCmdInfo"); - - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - if (prCmdInfo) { - if (prCmdInfo->pucInfoBuffer) { - cnmMemFree(prAdapter, prCmdInfo->pucInfoBuffer); - prCmdInfo->pucInfoBuffer = NULL; - } - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_RESOURCE); - QUEUE_INSERT_TAIL(&prAdapter->rFreeCmdList, &prCmdInfo->rQueEntry); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_RESOURCE); - } - - return; - -} /* end of cmdBufFreeCmdPacket() */ - - diff --git a/drivers/net/wireless/mt5931/nic/nic.c b/drivers/net/wireless/mt5931/nic/nic.c deleted file mode 100755 index 139c71bae6af..000000000000 --- a/drivers/net/wireless/mt5931/nic/nic.c +++ /dev/null @@ -1,4421 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/nic/nic.c#2 $ -*/ - -/*! \file nic.c - \brief Functions that provide operation in NIC's (Network Interface Card) point of view. - - This file includes functions which unite multiple hal(Hardware) operations - and also take the responsibility of Software Resource Management in order - to keep the synchronization with Hardware Manipulation. -*/ - - - -/* -** $Log: nic.c $ - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 05 02 2012 terry.wu - * NULL - * Set the default value of AP StaRec index to "STA_REC_INDEX_NOT_FOUND" in update firmware bss command. - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 11 28 2011 cp.wu - * [WCXRP00001125] [MT6620 Wi-Fi][Firmware] Strengthen Wi-Fi power off sequence to have a clearroom environment when returining to ROM code - * 1. Due to firmware now stops HIF DMA for powering off, do not try to receive any packet from firmware - * 2. Take use of prAdapter->fgIsEnterD3ReqIssued for tracking whether it is powering off or not - * - * 11 22 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * keep debug counter setting after wake up. - * - * 11 19 2011 yuche.tsai - * NULL - * Update RSSI for P2P. - * - * 11 18 2011 yuche.tsai - * NULL - * CONFIG P2P support RSSI query, default turned off. - * - * 11 07 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * add debug counters and periodically dump counters for debugging. - * - * 11 04 2011 cp.wu - * [WCXRP00001079] [MT5931][Driver] Release pending MMPDU only when BSS is being deactivated - * pre-check for NULL before calling MMPDU free function - * - * 11 03 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * change the DBGLOG for "\n" and "\r\n". LABEL to LOUD for XLOG - * - * 11 01 2011 chinglan.wang - * NULL - * Modify the Wi-Fi method of the flush TX queue when disconnect the AP. - * If disconnect the AP and flush all the data frame in the TX queue, WPS cannot do the 4-way handshake to connect to the AP.. - * - * 10 11 2011 terry.wu - * NULL - * Rewrite Assert Dump Function for Portability. - * - * 09 20 2011 cm.chang - * [WCXRP00000997] [MT6620 Wi-Fi][Driver][FW] Handle change of BSS preamble type and slot time - * New CMD definition about RLM parameters - * - * 08 15 2011 cp.wu - * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree - * reuse firmware download logic of MT6620 for MT6628. - * - * 08 03 2011 terry.wu - * [WCXRP00000899] [MT6620] [FW] Reply probe rsp in FW for hotspot mode - * Reply Probe Rsp in FW for Hotspot Mode. - * - * - * - * 08 03 2011 terry.wu - * [WCXRP00000899] [MT6620] [FW] Reply probe rsp in FW for hotspot mode - * Reply Probe Rsp in FW for Hotspot Mode. - * - * - * 08 03 2011 terry.wu - * [WCXRP00000899] [MT6620] [FW] Reply probe rsp in FW for hotspot mode - * Reply Probe Rsp in FW for Hotspot Mode. - * - * 08 03 2011 terry.wu - * [WCXRP00000899] [MT6620] [FW] Reply probe rsp in FW for hotspot mode - * Reply Probe Rsp in FW for Hotspot Mode. - * - * 08 02 2011 yuche.tsai - * [WCXRP00000896] [Volunteer Patch][WiFi Direct][Driver] GO with multiple client, TX deauth to a disconnecting device issue. - * Fix GO send deauth frame issue. - * - * 07 18 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add CMD/Event for RDD and BWCS. - * - * 07 11 2011 wh.su - * [WCXRP00000849] [MT6620 Wi-Fi][Driver] Remove some of the WAPI define for make sure the value is initialize, for customer not enable WAPI - * For make sure wapi initial value is set. - * - * 06 27 2011 cp.wu - * [WCXRP00000815] [MT6620 Wi-Fi][Driver] allow single BSSID with multiple SSID settings to work around some tricky AP which use space character as hidden SSID - * 1. correct logic - * 2. replace only BSS-DESC which doesn't have a valid SSID. - * - * 06 27 2011 cp.wu - * [WCXRP00000815] [MT6620 Wi-Fi][Driver] allow single BSSID with multiple SSID settings to work around some tricky AP which use space character as hidden SSID - * allow to have a single BSSID with multiple SSID to be presented in scanning result - * - * 05 12 2011 puff.wen - * NULL - * FW Assert information dump to driver - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 04 15 2011 cp.wu - * [WCXRP00000651] [MT6620 Wi-Fi][Driver] Refine RSSI buffering mechanism - * ROLLBACK due to the special design is to workaround incorrect initial RCPI value coming from firmware domain. - * - * 04 14 2011 cm.chang - * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency - * . - * - * 04 14 2011 cp.wu - * [WCXRP00000598] [MT6620 Wi-Fi][Driver] Implementation of interface for communicating with user space process for RESET_START and RESET_END events - * 1. add code to put whole-chip resetting trigger when abnormal firmware assertion is detected - * 2. add dummy function for both Win32 and Linux part. - * - * 04 12 2011 cp.wu - * [WCXRP00000635] [MT6620 Wi-Fi][Driver] Clear pending security frames when QM clear pending data frames for dedicated network type - * clear pending security frames for dedicated network type when BSS is being deactivated/disconnected - * - * 04 12 2011 wh.su - * NULL - * enable the p2p check the cipher to set the bssInfo auth mode. - * - * 04 12 2011 wh.su - * NULL - * prepare the code for sync the auth mode and encryption status for P2P and BOW. - * - * 04 11 2011 yuche.tsai - * [WCXRP00000627] [Volunteer Patch][MT6620][Driver] Pending MMPUD of P2P Network may crash system issue. - * Fix kernel panic issue when MMPDU of P2P is pending in driver. - * - * 04 10 2011 george.huang - * [WCXRP00000621] [MT6620 Wi-Fi][Driver] Support P2P supplicant to set power mode - * Fix compiler issue. - * - * 04 08 2011 george.huang - * [WCXRP00000621] [MT6620 Wi-Fi][Driver] Support P2P supplicant to set power mode - * separate settings of P2P and AIS - * - * 04 08 2011 eddie.chen - * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma - * Fix for sigma - * - * 04 07 2011 cp.wu - * [WCXRP00000616] [MT6620 Wi-Fi][Driver] Free memory to pool and kernel in case any unexpected failure happend inside wlanAdapterStart - * . - * - * 04 07 2011 cp.wu - * [WCXRP00000616] [MT6620 Wi-Fi][Driver] Free memory to pool and kernel in case any unexpected failure happend inside wlanAdapterStart - * implementation of internal error handling of nicAllocateAdapterMemory. - * - * 03 31 2011 chinglan.wang - * [WCXRP00000613] [MT6620 Wi-Fi] [FW] [Driver] BssInfo can get the security mode which is WPA/WPA2/WAPI or not. - * . - * - * 03 21 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * portability improvement - * - * 03 17 2011 cp.wu - * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period - * use pre-allocated buffer for storing enhanced interrupt response as well - * - * 03 16 2011 cp.wu - * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period - * 1. pre-allocate physical continuous buffer while module is being loaded - * 2. use pre-allocated physical continuous buffer for TX/RX DMA transfer - * - * The windows part remained the same as before, but added similiar APIs to hide the difference. - * - * 03 15 2011 cp.wu - * [WCXRP00000559] [MT6620 Wi-Fi][Driver] Combine TX/RX DMA buffers into a single one to reduce physically continuous memory consumption - * 1. deprecate CFG_HANDLE_IST_IN_SDIO_CALLBACK - * 2. Use common coalescing buffer for both TX/RX directions - * - * - * 03 10 2011 cm.chang - * [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module - * Add some functions to let AIS/Tethering or AIS/BOW be the same channel - * - * 03 07 2011 terry.wu - * [WCXRP00000521] [MT6620 Wi-Fi][Driver] Remove non-standard debug message - * Toggle non-standard debug messages to comments. - * - * 03 02 2011 cp.wu - * [WCXRP00000503] [MT6620 Wi-Fi][Driver] Take RCPI brought by association response as initial RSSI right after connection is built. - * use RCPI brought by ASSOC-RESP after connection is built as initial RCPI to avoid using a uninitialized MAC-RX RCPI. - * - * 02 08 2011 terry.wu - * [WCXRP00000412] [MT6620 Wi-Fi][FW/Driver] Dump firmware assert info at android kernel log - * Use kalPrint to print firmware assert info. - * - * 02 01 2011 terry.wu - * [WCXRP00000412] [MT6620 Wi-Fi][FW/Driver] Dump firmware assert info at android kernel log - * . - * - * 02 01 2011 cm.chang - * [WCXRP00000415] [MT6620 Wi-Fi][Driver] Check if any memory leakage happens when uninitializing in DGB mode - * . - * - * 01 31 2011 terry.wu - * [WCXRP00000412] [MT6620 Wi-Fi][FW/Driver] Dump firmware assert info at android kernel log - * Print firmware ASSERT info at Android kernel log, driver side - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * - * 01 26 2011 cm.chang - * [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument - * Allocate system RAM if fixed message or mgmt buffer is not available - * - * 01 24 2011 cp.wu - * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving - * 1. add an extra counter for tracking pending forward frames. - * 2. notify TX service thread as well when there is pending forward frame - * 3. correct build errors leaded by introduction of Wi-Fi direct separation module - * - * 01 19 2011 cp.wu - * [WCXRP00000372] [MT6620 Wi-Fi][Driver] Check bus access failure inside nicProcessIST() - * check bus error and/or card removal when retrieving interrupt status from HAL - * - * 01 04 2011 cp.wu - * [WCXRP00000338] [MT6620 Wi-Fi][Driver] Separate kalMemAlloc into kmalloc and vmalloc implementations to ease physically continous memory demands - * 1) correct typo in scan.c - * 2) TX descriptors, RX descriptos and management buffer should use virtually continous buffer instead of physically contineous one - * - * 01 04 2011 cp.wu - * [WCXRP00000338] [MT6620 Wi-Fi][Driver] Separate kalMemAlloc into kmalloc and vmalloc implementations to ease physically continous memory demands - * separate kalMemAlloc() into virtually-continous and physically-continous type to ease slab system pressure - * - * 12 30 2010 cp.wu - * [WCXRP00000327] [MT6620 Wi-Fi][Driver] Improve HEC WHQA 6972 workaround coverage in driver side - * host driver not to set FW-own when there is still pending interrupts - * - * 12 17 2010 cp.wu - * [WCXRP00000270] [MT6620 Wi-Fi][Driver] Clear issues after concurrent networking support has been merged - * before BSS disconnection is indicated to firmware, all correlated peer should be cleared and freed - * - * 12 07 2010 cm.chang - * [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk - * 1. BSSINFO include RLM parameter - * 2. free all sta records when network is disconnected - * - * 12 02 2010 eddie.chen - * [WCXRP00000218] [MT6620 Wi-Fi][Driver] Add auto rate window control in registry - * Add more control value but dont use it now. - * - * 11 30 2010 eddie.chen - * [WCXRP00000218] [MT6620 Wi-Fi][Driver] Add auto rate window control in registry - * Add auto rate check window in registry - * - * 11 10 2010 eddie.chen - * [WCXRP00000156] [MT6620][FW] Change Auto rate window to 64 and add throughput swcr - * Use autorate parameter 1 as phy rate mask. - * - * 11 08 2010 cp.wu - * [WCXRP00000166] [MT6620 Wi-Fi][Driver] use SDIO CMD52 for enabling/disabling interrupt to reduce transaction period - * change to use CMD52 for enabling/disabling interrupt to reduce SDIO transaction time - * - * 10 26 2010 eddie.chen - * [WCXRP00000134] [MT6620 Wi-Fi][Driver] Add a registry to enable auto rate for SQA test by using E1 EVB - * Add auto rate parameter in registry. - * - * 10 18 2010 cp.wu - * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated - * 1. remove redundant variables in STA_REC structure - * 2. add STA-REC uninitialization routine for clearing pending events - * - * 10 18 2010 cp.wu - * [WCXRP00000103] [MT6620 Wi-Fi][Driver] Driver crashed when using WZC to connect to AP#B with connection with AP#A - * reset ptrs when IEs are going to be dropped - * - * 10 12 2010 cp.wu - * [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test - * add HT (802.11n) fixed rate support. - * - * 10 08 2010 cp.wu - * [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test - * adding fixed rate support for distance test. (from registry setting) - * - * 10 07 2010 cp.wu - * [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection - * add firmware download for MT5931. - * - * 10 05 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * load manufacture data when CFG_SUPPORT_NVRAM is set to 1 - * - * 10 04 2010 cp.wu - * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only - * remove ENUM_NETWORK_TYPE_T definitions - * - * 09 21 2010 cp.wu - * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated - * Do a complete reset with STA-REC null checking for RF test re-entry - * - * 09 08 2010 cp.wu - * NULL - * use static memory pool for storing IEs of scanning result. - * - * 09 06 2010 cp.wu - * NULL - * Androi/Linux: return current operating channel information - * - * 09 01 2010 cp.wu - * NULL - * HIFSYS Clock Source Workaround - * - * 08 26 2010 yuche.tsai - * NULL - * Fix someones coding error while enable WIFI_DIRECT. - * - * 08 25 2010 george.huang - * NULL - * update OID/ registry control path for PM related settings - * - * 08 24 2010 cm.chang - * NULL - * Support RLM initail channel of Ad-hoc, P2P and BOW - * - * 08 24 2010 chinghwa.yu - * NULL - * Update BOW for the 1st time. - * - * 08 23 2010 chinghwa.yu - * NULL - * Update for BOW. - * - * 08 20 2010 yuche.tsai - * NULL - * Add state change indication. - * - * 08 16 2010 yuche.tsai - * NULL - * Add support for P2P BSS update info. - * - * 08 12 2010 cp.wu - * NULL - * [removing debugging] not to dump beacon content. - * - * 08 12 2010 cp.wu - * NULL - * [AIS-FSM] honor registry setting for adhoc running mode. (A/B/G) - * - * 08 11 2010 cp.wu - * NULL - * 1) do not use in-stack variable for beacon updating. (for MAUI porting) - * 2) extending scanning result to 64 instead of 48 - * - * 08 04 2010 yarco.yang - * NULL - * Add TX_AMPDU and ADDBA_REJECT command - * - * 08 03 2010 cp.wu - * NULL - * surpress compilation warning. - * - * 08 03 2010 cp.wu - * NULL - * Centralize mgmt/system service procedures into independent calls. - * - * 07 28 2010 cp.wu - * NULL - * 1) eliminate redundant variable eOPMode in prAdapter->rWlanInfo - * 2) change nicMediaStateChange() API prototype - * - * 07 28 2010 cp.wu - * NULL - * sync. CMD_BSS_INFO structure change to CMD-EVENT v0.15. - * - * 07 24 2010 wh.su - * - * .support the Wi-Fi RSN - * - * 07 23 2010 cp.wu - * - * FIX: structure of CMD_SET_BSS_INFO has been changed but no follow-ups are done. - * - * 07 22 2010 george.huang - * - * . - * - * 07 22 2010 george.huang - * - * Update fgIsQoS information in BSS INFO by CMD - * - * 07 19 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * Add Ad-Hoc support to AIS-FSM - * - * 07 14 2010 yarco.yang - * - * 1. Remove CFG_MQM_MIGRATION - * 2. Add CMD_UPDATE_WMM_PARMS command - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * update prStaRecOfAP with BSS-INFO. - * - * 07 06 2010 george.huang - * [WPD00001556]Basic power managemenet function - * Update arguments for nicUpdateBeaconIETemplate() - * - * 07 06 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * STA-REC is maintained by CNM only. - * - * 07 05 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) ignore RSN checking when RSN is not turned on. - * 2) set STA-REC deactivation callback as NULL - * 3) add variable initialization API based on PHY configuration - * - * 07 01 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Support sync command of STA_REC - * - * 06 30 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * sync. with CMD/EVENT document ver0.07. - * - * 06 29 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * correct variable naming for 8-bit variable used in CMD_BEACON_TEMPLATE_UPDATE. - * - * 06 29 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) sync to. CMD/EVENT document v0.03 - * 2) simplify DTIM period parsing in scan.c only, bss.c no longer parses it again. - * 3) send command packet to indicate FW-PM after - * a) 1st beacon is received after AIS has connected to an AP - * b) IBSS-ALONE has been created - * c) IBSS-MERGE has occured - * - * 06 25 2010 george.huang - * [WPD00001556]Basic power managemenet function - * Create beacon update path, with expose bssUpdateBeaconContent() - * - * 06 22 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * fill fgIsUapsdConnection when indicating BSS-CREATE with AIS-STA mode. - * - * 06 22 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) add command warpper for STA-REC/BSS-INFO sync. - * 2) enhance command packet sending procedure for non-oid part - * 3) add command packet definitions for STA-REC/BSS-INFO sync. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * implement TX_DONE callback path. - * - * 06 21 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * remove duplicate variable for migration. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * TX descriptors are now allocated once for reducing allocation overhead - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) eliminate CFG_CMD_EVENT_VERSION_0_9 - * 2) when disconnected, indicate nic directly (no event is needed) - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 04 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) surpress compiler warning - * 2) when acqruing LP-own, keep writing WHLPCR whenever OWN is not acquired yet - * - * 04 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * surpress compiler warning - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * * * * * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * * * * * * * * * * * 2) command sequence number is now increased atomically - * * * * * * * * * * * * * 3) private data could be hold and taken use for other purpose - * - * 04 12 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add channel frequency <-> number conversion - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access for prGlueInfo->fgIsCardRemoved in non-glue layer - * - * 04 06 2010 cp.wu - * [WPD00003827][MT6620 Wi-Fi] Chariot fail and following ping fail, no pkt send from driver - * correct nicProcessIST_impl() for interrupt status brought up by RX enhanced response - * - * 03 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) add ACPI D0/D3 state switching support - * * * * * * * 2) use more formal way to handle interrupt when the status is retrieved from enhanced RX response - * - * 03 17 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * always process TX interrupt first then RX interrupt. - * - * 02 25 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct behavior to prevent duplicated RX handling for RX0_DONE and RX1_DONE - * - * 02 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add checksum offloading support. -** \main\maintrunk.MT6620WiFiDriver_Prj\27 2009-12-16 18:03:43 GMT mtk02752 -** handling enhanced response which fields are fetched at different moments -** \main\maintrunk.MT6620WiFiDriver_Prj\26 2009-12-15 17:00:29 GMT mtk02752 -** if RX enhanced response is used, D2H interrupt status should be coming from buffered result as well -** \main\maintrunk.MT6620WiFiDriver_Prj\25 2009-12-15 12:01:55 GMT mtk02752 -** if TX_DONE bit is not set but WTSR0/WTSR1 is non-zero, then set TX_DONE bit due to time latency of interrupt status enhanced response -** \main\maintrunk.MT6620WiFiDriver_Prj\24 2009-12-10 16:52:52 GMT mtk02752 -** code clean -** \main\maintrunk.MT6620WiFiDriver_Prj\23 2009-11-24 20:51:01 GMT mtk02752 -** integrate with SD1 by invoking qmHandleMailboxRxMessage() -** \main\maintrunk.MT6620WiFiDriver_Prj\22 2009-11-16 17:32:33 GMT mtk02752 -** prepare code for invoking rxHandleMailboxRxMessage() -** \main\maintrunk.MT6620WiFiDriver_Prj\21 2009-11-11 10:36:08 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\20 2009-11-09 22:56:41 GMT mtk01084 -** modify HW access routines -** \main\maintrunk.MT6620WiFiDriver_Prj\19 2009-10-30 18:17:20 GMT mtk01084 -** prevent warning -** \main\maintrunk.MT6620WiFiDriver_Prj\18 2009-10-29 19:54:57 GMT mtk01084 -** init HIF -** \main\maintrunk.MT6620WiFiDriver_Prj\17 2009-10-23 16:08:30 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-10-13 21:59:12 GMT mtk01084 -** update for new HW design -** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-09-09 17:26:15 GMT mtk01084 -** modify for CFG_TEST_WITH_MT5921 -** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-05-19 10:55:22 GMT mtk01461 -** Unmask the unused HISR -** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-05-18 15:59:13 GMT mtk01084 -** remove debug purpose code -** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-05-18 14:05:02 GMT mtk01084 -** update for WIFI ownback part on initial -** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-05-04 21:32:57 GMT mtk01084 -** add temporarily code to set driver own on adapter initialization -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-04-28 10:35:41 GMT mtk01461 -** Add init of TX aggregation and fix RX STATUS is DW align for SDIO_STATUS_ENHANCE mode -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-04-24 21:12:10 GMT mtk01104 -** Add function nicRestoreSpiDefMode() -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-04-21 09:43:31 GMT mtk01461 -** Revise for MTK coding style - nicInitializeAdapter() -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-17 19:52:47 GMT mtk01461 -** Update allocate Adapter Memory for MGMT Memory pool -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-01 10:57:08 GMT mtk01461 -** Refine the order of release memory from pucRxCoalescingBufCached -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-03-19 18:32:57 GMT mtk01084 -** update for basic power management functions -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-18 21:00:14 GMT mtk01426 -** Add CFG_SDIO_RX_ENHANCE support -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-16 09:10:27 GMT mtk01461 -** Update TX PATH API -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:25:59 GMT mtk01426 -** Init for develop -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -const UINT_8 aucPhyCfg2PhyTypeSet[PHY_CONFIG_NUM] = -{ - PHY_TYPE_SET_802_11ABG, /* PHY_CONFIG_802_11ABG */ - PHY_TYPE_SET_802_11BG, /* PHY_CONFIG_802_11BG */ - PHY_TYPE_SET_802_11G, /* PHY_CONFIG_802_11G */ - PHY_TYPE_SET_802_11A, /* PHY_CONFIG_802_11A */ - PHY_TYPE_SET_802_11B, /* PHY_CONFIG_802_11B */ - PHY_TYPE_SET_802_11ABGN, /* PHY_CONFIG_802_11ABGN */ - PHY_TYPE_SET_802_11BGN, /* PHY_CONFIG_802_11BGN */ - PHY_TYPE_SET_802_11AN, /* PHY_CONFIG_802_11AN */ - PHY_TYPE_SET_802_11GN /* PHY_CONFIG_802_11GN */ -}; - -#if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1) - #define REQ_GATING_ENABLE_H2D_INT BIT(31) - #define REQ_GATING_DISABLE_H2D_INT BIT(30) - #define ACK_GATING_ENABLE_D2H_INT BIT(31) - #define ACK_GATING_DISABLE_D2H_INT BIT(30) - - #define GATING_CONTROL_POLL_LIMIT 64 -#endif - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -static INT_EVENT_MAP_T arIntEventMapTable[] = { - {WHISR_ABNORMAL_INT, INT_EVENT_ABNORMAL}, - {WHISR_D2H_SW_INT, INT_EVENT_SW_INT}, - {WHISR_TX_DONE_INT, INT_EVENT_TX}, - {(WHISR_RX0_DONE_INT | WHISR_RX1_DONE_INT), INT_EVENT_RX} -}; - -static const UINT_8 ucIntEventMapSize = (sizeof(arIntEventMapTable) / sizeof(INT_EVENT_MAP_T)); - -static IST_EVENT_FUNCTION apfnEventFuncTable[] = { - nicProcessAbnormalInterrupt, /*!< INT_EVENT_ABNORMAL */ - nicProcessSoftwareInterrupt, /*!< INT_EVENT_SW_INT */ - nicProcessTxInterrupt, /*!< INT_EVENT_TX */ - nicProcessRxInterrupt, /*!< INT_EVENT_RX */ -}; -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -/*! This macro is used to reduce coding errors inside nicAllocateAdapterMemory() - * and also enhance the readability. - */ -#define LOCAL_NIC_ALLOCATE_MEMORY(pucMem, u4Size, eMemType, pucComment) \ - { \ - DBGLOG(INIT, INFO, ("Allocating %ld bytes for %s.\n", u4Size, pucComment)); \ - if ((pucMem = (PUINT_8)kalMemAlloc(u4Size, eMemType)) == (PUINT_8)NULL) { \ - DBGLOG(INIT, ERROR, ("Could not allocate %ld bytes for %s.\n", u4Size, pucComment)); \ - break; \ - } \ - ASSERT(((UINT_32)pucMem % 4) == 0); \ - DBGLOG(INIT, INFO, ("Virtual Address = %08lx for %s.\n", (UINT_32)pucMem, pucComment)); \ - } - - - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This routine is responsible for the allocation of the data structures -* inside the Adapter structure, include: -* 1. SW_RFB_Ts -* 2. Common coalescing buffer for TX PATH. -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @retval WLAN_STATUS_SUCCESS - Has enough memory. -* @retval WLAN_STATUS_RESOURCES - Memory is not enough. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicAllocateAdapterMemory ( - IN P_ADAPTER_T prAdapter - ) -{ - WLAN_STATUS status = WLAN_STATUS_RESOURCES; - P_RX_CTRL_T prRxCtrl; - P_TX_CTRL_T prTxCtrl; - - DEBUGFUNC("nicAllocateAdapterMemory"); - - ASSERT(prAdapter); - prRxCtrl = &prAdapter->rRxCtrl; - prTxCtrl = &prAdapter->rTxCtrl; - - do { - //4 <0> Reset all Memory Handler - #if CFG_DBG_MGT_BUF - prAdapter->u4MemFreeDynamicCount = 0; - prAdapter->u4MemAllocDynamicCount = 0; - #endif - prAdapter->pucMgtBufCached = (PUINT_8)NULL; - prRxCtrl->pucRxCached = (PUINT_8)NULL; - prAdapter->prSDIOCtrl = (P_SDIO_CTRL_T)NULL; - - - //4 <1> Memory for Management Memory Pool and CMD_INFO_T - /* Allocate memory for the CMD_INFO_T and its MGMT memory pool. */ - prAdapter->u4MgtBufCachedSize = MGT_BUFFER_SIZE; - - LOCAL_NIC_ALLOCATE_MEMORY(prAdapter->pucMgtBufCached, - prAdapter->u4MgtBufCachedSize, - VIR_MEM_TYPE, - "COMMON MGMT MEMORY POOL"); - - //4 <2> Memory for RX Descriptor - /* Initialize the number of rx buffers we will have in our queue. */ - /* We may setup ucRxPacketDescriptors by GLUE Layer, and using - * this variable directly. - */ - /* Allocate memory for the SW receive structures. */ - prRxCtrl->u4RxCachedSize = CFG_RX_MAX_PKT_NUM * \ - ALIGN_4(sizeof(SW_RFB_T)); - - LOCAL_NIC_ALLOCATE_MEMORY(prRxCtrl->pucRxCached, - prRxCtrl->u4RxCachedSize, - VIR_MEM_TYPE, - "SW_RFB_T"); - - //4 <3> Memory for TX DEscriptor - prTxCtrl->u4TxCachedSize = CFG_TX_MAX_PKT_NUM * \ - ALIGN_4(sizeof(MSDU_INFO_T)); - - LOCAL_NIC_ALLOCATE_MEMORY(prTxCtrl->pucTxCached, - prTxCtrl->u4TxCachedSize, - VIR_MEM_TYPE, - "MSDU_INFO_T"); - - //4 <4> Memory for Common Coalescing Buffer -#if CFG_COALESCING_BUFFER_SIZE || CFG_SDIO_RX_AGG - prAdapter->pucCoalescingBufCached = (PUINT_8)NULL; - - /* Allocate memory for the common coalescing buffer. */ - prAdapter->u4CoalescingBufCachedSize = CFG_COALESCING_BUFFER_SIZE > CFG_RX_COALESCING_BUFFER_SIZE ? - CFG_COALESCING_BUFFER_SIZE : CFG_RX_COALESCING_BUFFER_SIZE; - - prAdapter->pucCoalescingBufCached = - kalAllocateIOBuffer(prAdapter->u4CoalescingBufCachedSize); - - if(prAdapter->pucCoalescingBufCached == NULL) { - DBGLOG(INIT, ERROR, ("Could not allocate %ld bytes for coalescing buffer.\n", prAdapter->u4CoalescingBufCachedSize)); - break; - } -#endif /* CFG_COALESCING_BUFFER_SIZE */ - - //4 <5> Memory for enhanced interrupt response - prAdapter->prSDIOCtrl = (P_SDIO_CTRL_T) - kalAllocateIOBuffer(sizeof(ENHANCE_MODE_DATA_STRUCT_T)); - - if(prAdapter->prSDIOCtrl == NULL) { - DBGLOG(INIT, ERROR, ("Could not allocate %ld bytes for interrupt response.\n", sizeof(ENHANCE_MODE_DATA_STRUCT_T))); - break; - } - - status = WLAN_STATUS_SUCCESS; - - } - while(FALSE); - - if(status != WLAN_STATUS_SUCCESS) { - nicReleaseAdapterMemory(prAdapter); - } - - return status; - -} /* end of nicAllocateAdapterMemory() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This routine is responsible for releasing the allocated memory by -* nicAllocatedAdapterMemory(). -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicReleaseAdapterMemory ( - IN P_ADAPTER_T prAdapter - ) -{ - P_TX_CTRL_T prTxCtrl; - P_RX_CTRL_T prRxCtrl; - - ASSERT(prAdapter); - prTxCtrl = &prAdapter->rTxCtrl; - prRxCtrl = &prAdapter->rRxCtrl; - - //4 <5> Memory for enhanced interrupt response - if (prAdapter->prSDIOCtrl) { - kalReleaseIOBuffer((PVOID)prAdapter->prSDIOCtrl, sizeof(ENHANCE_MODE_DATA_STRUCT_T)); - prAdapter->prSDIOCtrl = (P_SDIO_CTRL_T)NULL; - } - - //4 <4> Memory for Common Coalescing Buffer -#if CFG_COALESCING_BUFFER_SIZE || CFG_SDIO_RX_AGG - if (prAdapter->pucCoalescingBufCached) { - kalReleaseIOBuffer((PVOID)prAdapter->pucCoalescingBufCached, prAdapter->u4CoalescingBufCachedSize); - prAdapter->pucCoalescingBufCached = (PUINT_8)NULL; - } -#endif /* CFG_COALESCING_BUFFER_SIZE */ - - //4 <3> Memory for TX Descriptor - if (prTxCtrl->pucTxCached) { - kalMemFree((PVOID)prTxCtrl->pucTxCached, - VIR_MEM_TYPE, - prTxCtrl->u4TxCachedSize); - prTxCtrl->pucTxCached = (PUINT_8)NULL; - } - - //4 <2> Memory for RX Descriptor - if (prRxCtrl->pucRxCached) { - kalMemFree((PVOID)prRxCtrl->pucRxCached, - VIR_MEM_TYPE, - prRxCtrl->u4RxCachedSize); - prRxCtrl->pucRxCached = (PUINT_8)NULL; - } - - //4 <1> Memory for Management Memory Pool - if (prAdapter->pucMgtBufCached) { - kalMemFree((PVOID)prAdapter->pucMgtBufCached, - VIR_MEM_TYPE, - prAdapter->u4MgtBufCachedSize); - prAdapter->pucMgtBufCached = (PUINT_8)NULL; - } - -#if CFG_DBG_MGT_BUF - /* Check if all allocated memories are free */ - ASSERT(prAdapter->u4MemFreeDynamicCount == - prAdapter->u4MemAllocDynamicCount); -#endif - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief disable global interrupt -* -* @param prAdapter pointer to the Adapter handler -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicDisableInterrupt ( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - HAL_BYTE_WR(prAdapter, MCR_WHLPCR, WHLPCR_INT_EN_CLR); - - prAdapter->fgIsIntEnable = FALSE; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief enable global interrupt -* -* @param prAdapter pointer to the Adapter handler -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicEnableInterrupt ( - IN P_ADAPTER_T prAdapter - ) -{ - BOOLEAN fgIsIntEnableCache; - - - ASSERT(prAdapter); - fgIsIntEnableCache = prAdapter->fgIsIntEnable; - - prAdapter->fgIsIntEnable = TRUE; // NOTE(Kevin): It must be placed before MCR GINT write. - - /* If need enable INT and also set LPOwn at the same time. */ - if (prAdapter->fgIsIntEnableWithLPOwnSet) { - prAdapter->fgIsIntEnableWithLPOwnSet = FALSE; /* NOTE(Kevin): It's better to place it - * before MCR GINT write. - */ - /* If INT was enabled, only set LPOwn */ - if (fgIsIntEnableCache) { - HAL_MCR_WR(prAdapter, MCR_WHLPCR, WHLPCR_FW_OWN_REQ_SET); - prAdapter->fgIsFwOwn = TRUE; - } - /* If INT was not enabled, enable it and also set LPOwn now */ - else { - HAL_MCR_WR(prAdapter, MCR_WHLPCR, WHLPCR_FW_OWN_REQ_SET | - WHLPCR_INT_EN_SET); - prAdapter->fgIsFwOwn = TRUE; - } - } - /* If INT was not enabled, enable it now */ - else if (!fgIsIntEnableCache) { - HAL_BYTE_WR(prAdapter, MCR_WHLPCR, WHLPCR_INT_EN_SET); - } - - return; -} /* end of nicEnableInterrupt() */ - - -#if CFG_SDIO_INTR_ENHANCE -/*----------------------------------------------------------------------------*/ -/*! -* @brief For SDIO enhance mode, set the max rx len and tx status -* -* @param prAdapter a pointer to adapter private data structure. -* -* @return - none -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicSDIOInit ( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_32 u4Value = 0; - - ASSERT(prAdapter); - - //4 <1> Check STATUS Buffer is DW alignment. - ASSERT( IS_ALIGN_4( (UINT_32)&prAdapter->prSDIOCtrl->u4WHISR ) ); - - //4 <2> Setup STATUS count. - { - HAL_MCR_RD(prAdapter, MCR_WHCR, &u4Value); - - //4 <2.1> Setup the number of maximum RX length to be report - u4Value &= ~(WHCR_MAX_HIF_RX_LEN_NUM); - u4Value |= ((SDIO_MAXIMUM_RX_LEN_NUM << WHCR_OFFSET_MAX_HIF_RX_LEN_NUM)); - - //4 <2.2> Setup RX enhancement mode -#if CFG_SDIO_RX_ENHANCE - u4Value |= WHCR_RX_ENHANCE_MODE_EN; -#else - u4Value &= ~WHCR_RX_ENHANCE_MODE_EN; -#endif /* CFG_SDIO_RX_AGG */ - - HAL_MCR_WR(prAdapter, MCR_WHCR, u4Value); - } - - return; - -} /* end of nicSDIOInit() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Read interrupt status from hardware -* -* @param prAdapter pointer to the Adapter handler -* @param the interrupts -* -* @return N/A -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicSDIOReadIntStatus ( - IN P_ADAPTER_T prAdapter, - OUT PUINT_32 pu4IntStatus - ) -{ - P_SDIO_CTRL_T prSDIOCtrl; - - DEBUGFUNC("nicSDIOReadIntStatus"); - - ASSERT(prAdapter); - ASSERT(pu4IntStatus); - - prSDIOCtrl = prAdapter->prSDIOCtrl; - ASSERT(prSDIOCtrl); - - HAL_PORT_RD(prAdapter, - MCR_WHISR, - sizeof(ENHANCE_MODE_DATA_STRUCT_T), - (PUINT_8)prSDIOCtrl, - sizeof(ENHANCE_MODE_DATA_STRUCT_T)); - - if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - *pu4IntStatus = 0; - return; - } - - /* workaround */ - if((prSDIOCtrl->u4WHISR & WHISR_TX_DONE_INT) == 0 && - (prSDIOCtrl->rTxInfo.au4WTSR[0] | prSDIOCtrl->rTxInfo.au4WTSR[1])) { - prSDIOCtrl->u4WHISR |= WHISR_TX_DONE_INT; - } - - if((prSDIOCtrl->u4WHISR & BIT(31)) == 0 && - HAL_GET_MAILBOX_READ_CLEAR(prAdapter) == TRUE && - (prSDIOCtrl->u4RcvMailbox0 != 0 || prSDIOCtrl->u4RcvMailbox1 != 0)) { - prSDIOCtrl->u4WHISR |= BIT(31); - } - - *pu4IntStatus = prSDIOCtrl->u4WHISR; - - return; -} /* end of nicSDIOReadIntStatus() */ -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* @brief The function used to read interrupt status and then invoking -* dispatching procedure for the appropriate functions -* corresponding to specific interrupt bits -* -* @param prAdapter pointer to the Adapter handler -* -* @retval WLAN_STATUS_SUCCESS -* @retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicProcessIST ( - IN P_ADAPTER_T prAdapter - ) -{ - WLAN_STATUS u4Status = WLAN_STATUS_SUCCESS; - UINT_32 u4IntStatus = 0; - UINT_32 i; - - DEBUGFUNC("nicProcessIST"); - //DBGLOG(INIT, LOUD, ("\n")); - - ASSERT(prAdapter); - - if (prAdapter->rAcpiState == ACPI_STATE_D3) { - DBGLOG(REQ, WARN, ("Fail in set nicProcessIST! (Adapter not ready). ACPI=D%d, Radio=%d\n", - prAdapter->rAcpiState, prAdapter->fgIsRadioOff)); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - -#if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1) - if(prAdapter->fgIsClockGatingEnabled == TRUE) { - nicDisableClockGating(prAdapter); - } -#endif - - for (i = 0; i < CFG_IST_LOOP_COUNT; i++) { - -#if CFG_SDIO_INTR_ENHANCE - nicSDIOReadIntStatus(prAdapter, &u4IntStatus); -#else - HAL_MCR_RD(prAdapter, MCR_WHISR, &u4IntStatus); -#endif /* CFG_SDIO_INTR_ENHANCE */ - - //DBGLOG(INIT, TRACE, ("u4IntStatus: 0x%x\n", u4IntStatus)); - - if (u4IntStatus & ~(WHIER_DEFAULT | WHIER_FW_OWN_BACK_INT_EN)) { - DBGLOG(INTR, WARN, ("Un-handled HISR %#x, HISR = %#x (HIER:0x%x)\n", - (u4IntStatus & ~WHIER_DEFAULT), u4IntStatus, WHIER_DEFAULT)); - u4IntStatus &= WHIER_DEFAULT; - } - - nicProcessIST_impl(prAdapter, u4IntStatus); - - if(u4IntStatus == 0) { - if(i == 0) { - u4Status = WLAN_STATUS_NOT_INDICATING; - } - break; - } - } - -#if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1) - if(prAdapter->fgIsClockGatingEnabled == FALSE) { - nicEnableClockGating(prAdapter); - } -#endif - - return u4Status; -} /* end of nicProcessIST() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief The function used to dispatch the appropriate functions for specific -* interrupt bits -* -* @param prAdapter pointer to the Adapter handler -* u4IntStatus interrupt status bits -* -* @retval WLAN_STATUS_SUCCESS -* @retval WLAN_STATUS_ADAPTER_NOT_READY -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicProcessIST_impl ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4IntStatus - ) -{ - UINT_32 u4IntCount = 0; - P_INT_EVENT_MAP_T prIntEventMap = NULL; - - ASSERT(prAdapter); - - prAdapter->u4IntStatus = u4IntStatus; - - /* Process each of the interrupt status consequently */ - prIntEventMap = &arIntEventMapTable[0]; - for (u4IntCount = 0; u4IntCount < ucIntEventMapSize; prIntEventMap++, u4IntCount++) { - if (prIntEventMap->u4Int & prAdapter->u4IntStatus) { - if(prIntEventMap->u4Event == INT_EVENT_RX && - prAdapter->fgIsEnterD3ReqIssued == TRUE) { - // ignore - } - else if (apfnEventFuncTable[prIntEventMap->u4Event] != NULL) { - apfnEventFuncTable[prIntEventMap->u4Event](prAdapter); - } - else { - DBGLOG(INTR , WARN, - ("Empty INTR handler! ISAR bit#: %ld, event:%d, func: 0x%x\n", - prIntEventMap->u4Int, prIntEventMap->u4Event, apfnEventFuncTable[prIntEventMap->u4Event])); - - ASSERT(0); // to trap any NULL interrupt handler - } - prAdapter->u4IntStatus &= ~prIntEventMap->u4Int; - } - } - - return WLAN_STATUS_SUCCESS; -} /* end of nicProcessIST_impl() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Verify the CHIP ID -* -* @param prAdapter a pointer to adapter private data structure. -* -* -* @retval TRUE CHIP ID is the same as the setting compiled -* @retval FALSE CHIP ID is different from the setting compiled -*/ -/*----------------------------------------------------------------------------*/ -BOOL -nicVerifyChipID ( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_32 u4CIR = 0; - - ASSERT(prAdapter); - - HAL_MCR_RD(prAdapter, MCR_WCIR, &u4CIR ); - - DBGLOG(INIT, TRACE,("Chip ID: 0x%x\n", u4CIR & WCIR_CHIP_ID)); - DBGLOG(INIT, TRACE,("Revision ID: 0x%x\n", ((u4CIR & WCIR_REVISION_ID) >> 16))); - - if ((u4CIR & WCIR_CHIP_ID) != MTK_CHIP_REV) { - return FALSE; - } - - prAdapter->ucRevID = (UINT_8)(((u4CIR & WCIR_REVISION_ID) >> 16) & 0xF) ; - - return TRUE; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Initialize the MCR to the appropriate init value, and verify the init -* value -* -* @param prAdapter a pointer to adapter private data structure. -* -* @return - -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicMCRInit ( - IN P_ADAPTER_T prAdapter - ) -{ - - ASSERT(prAdapter); - - //4 <0> Initial value -} - -VOID -nicHifInit ( - IN P_ADAPTER_T prAdapter - ) -{ - - ASSERT(prAdapter); -#if 0 - /* reset event */ - nicPutMailbox(prAdapter, 0, 0x52455345); // RESE - nicPutMailbox(prAdapter, 1, 0x545F5746); // T_WF - nicSetSwIntr(prAdapter, BIT(16)); -#endif -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Initialize the Adapter soft variable -* -* @param prAdapter pointer to the Adapter handler -* -* @return (none) -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicInitializeAdapter ( - IN P_ADAPTER_T prAdapter - ) -{ - WLAN_STATUS u4Status = WLAN_STATUS_SUCCESS; - - ASSERT(prAdapter); - - prAdapter->fgIsIntEnableWithLPOwnSet = FALSE; - - do { - if (!nicVerifyChipID(prAdapter)) { - u4Status = WLAN_STATUS_FAILURE; - break; - } - - //4 <1> MCR init - nicMCRInit(prAdapter); - - #if CFG_SDIO_INTR_ENHANCE - nicSDIOInit(prAdapter); - #endif /* CFG_SDIO_INTR_ENHANCE */ - - HAL_MCR_WR(prAdapter, MCR_WHIER, WHIER_DEFAULT); - - - //4 <2> init FW HIF - nicHifInit(prAdapter); - } - while (FALSE); - - - return u4Status; -} - - -#if defined(_HIF_SPI) -/*----------------------------------------------------------------------------*/ -/*! -* \brief Restore the SPI Mode Select to default mode, -* this is important while driver is unload, and this must be last mcr -* since the operation will let the hif use 8bit mode access -* -* \param[in] prAdapter a pointer to adapter private data structure. -* \param[in] eGPIO2_Mode GPIO2 operation mode -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -void -nicRestoreSpiDefMode ( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - HAL_MCR_WR(prAdapter, MCR_WCSR, SPICSR_8BIT_MODE_DATA); - -} -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Process rx interrupt. When the rx -* Interrupt is asserted, it means there are frames in queue. -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicProcessAbnormalInterrupt ( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_32 u4Value; - - HAL_MCR_RD(prAdapter, MCR_WASR, &u4Value); - DBGLOG(REQ, WARN, ("MCR_WASR: 0x%x \n", u4Value)); -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief . -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicProcessFwOwnBackInterrupt( - IN P_ADAPTER_T prAdapter - ) -{ - - return; -} /* end of nicProcessFwOwnBackInterrupt() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief . -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicProcessSoftwareInterrupt( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_32 u4IntrBits; - - ASSERT(prAdapter); - - u4IntrBits = prAdapter->u4IntStatus & BITS(8, 31); - - if((u4IntrBits & WHISR_D2H_SW_ASSERT_INFO_INT) != 0) { - nicPrintFirmwareAssertInfo(prAdapter); -#if CFG_CHIP_RESET_SUPPORT - glSendResetRequest(); -#endif - } - -#if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1) - ASSERT((u4IntrBits & (ACK_GATING_ENABLE_D2H_INT | ACK_GATING_DISABLE_D2H_INT)) - != (ACK_GATING_ENABLE_D2H_INT | ACK_GATING_DISABLE_D2H_INT)); - - if(u4IntrBits & ACK_GATING_ENABLE_D2H_INT) { - prAdapter->fgIsClockGatingEnabled = TRUE; - } - - if(u4IntrBits & ACK_GATING_DISABLE_D2H_INT) { - prAdapter->fgIsClockGatingEnabled = FALSE; - - // Indicate Service Thread for TX - if(kalGetTxPendingCmdCount(prAdapter->prGlueInfo) > 0 - || wlanGetTxPendingFrameCount(prAdapter) > 0) { - kalSetEvent(prAdapter->prGlueInfo); - } - } -#endif - - DBGLOG(REQ, WARN, ("u4IntrBits: 0x%x \n", u4IntrBits)); - - return; -} /* end of nicProcessSoftwareInterrupt() */ - -VOID -nicPutMailbox ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4MailboxNum, - IN UINT_32 u4Data - ) -{ - if (u4MailboxNum == 0) { - HAL_MCR_WR(prAdapter, MCR_H2DSM0R, u4Data); - } else if (u4MailboxNum == 1) { - HAL_MCR_WR(prAdapter, MCR_H2DSM1R, u4Data); - } else { - ASSERT(0); - } -} - -VOID -nicGetMailbox ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4MailboxNum, - OUT PUINT_32 pu4Data - ) -{ - if (u4MailboxNum == 0) { - HAL_MCR_RD(prAdapter, MCR_D2HRM0R, pu4Data); - } else if (u4MailboxNum == 1) { - HAL_MCR_RD(prAdapter, MCR_D2HRM1R, pu4Data); - } else { - ASSERT(0); - } -} - -VOID -nicSetSwIntr ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4SwIntrBitmap - ) -{ - /* NOTE: - * SW interrup in HW bit 16 is mapping to SW bit 0 (shift 16bit in HW transparancy) - * SW interrupt valid from b0~b15 - */ - ASSERT((u4SwIntrBitmap & BITS(0, 15)) == 0); -// DBGLOG(INIT, TRACE, ("u4SwIntrBitmap: 0x%08x\n", u4SwIntrBitmap)); - - HAL_MCR_WR(prAdapter, MCR_WSICR, u4SwIntrBitmap); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This procedure is used to dequeue from prAdapter->rPendingCmdQueue -* with specified sequential number -* -* @param prAdapter Pointer of ADAPTER_T -* ucSeqNum Sequential Number -* -* @retval - P_CMD_INFO_T -*/ -/*----------------------------------------------------------------------------*/ -P_CMD_INFO_T -nicGetPendingCmdInfo ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucSeqNum - ) -{ - P_QUE_T prCmdQue; - QUE_T rTempCmdQue; - P_QUE_T prTempCmdQue = &rTempCmdQue; - P_QUE_ENTRY_T prQueueEntry = (P_QUE_ENTRY_T)NULL; - P_CMD_INFO_T prCmdInfo = (P_CMD_INFO_T)NULL; - - GLUE_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_PENDING); - - prCmdQue = &prAdapter->rPendingCmdQueue; - QUEUE_MOVE_ALL(prTempCmdQue, prCmdQue); - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - while (prQueueEntry) { - prCmdInfo = (P_CMD_INFO_T)prQueueEntry; - - if(prCmdInfo->ucCmdSeqNum == ucSeqNum) - break; - else { - QUEUE_INSERT_TAIL(prCmdQue, prQueueEntry); - - prCmdInfo = NULL; - } - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - } - QUEUE_CONCATENATE_QUEUES(prCmdQue, prTempCmdQue); - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_PENDING); - - return prCmdInfo; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This procedure is used to dequeue from prAdapter->rTxCtrl.rTxMgmtTxingQueue -* with specified sequential number -* -* @param prAdapter Pointer of ADAPTER_T -* ucSeqNum Sequential Number -* -* @retval - P_MSDU_INFO_T -*/ -/*----------------------------------------------------------------------------*/ -P_MSDU_INFO_T -nicGetPendingTxMsduInfo ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucSeqNum - ) -{ - P_QUE_T prTxingQue; - QUE_T rTempQue; - P_QUE_T prTempQue = &rTempQue; - P_QUE_ENTRY_T prQueueEntry = (P_QUE_ENTRY_T)NULL; - P_MSDU_INFO_T prMsduInfo = (P_MSDU_INFO_T)NULL; - - GLUE_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TXING_MGMT_LIST); - - prTxingQue = &(prAdapter->rTxCtrl.rTxMgmtTxingQueue); - QUEUE_MOVE_ALL(prTempQue, prTxingQue); - - QUEUE_REMOVE_HEAD(prTempQue, prQueueEntry, P_QUE_ENTRY_T); - while (prQueueEntry) { - prMsduInfo = (P_MSDU_INFO_T)prQueueEntry; - - if(prMsduInfo->ucTxSeqNum == ucSeqNum) - break; - else { - QUEUE_INSERT_TAIL(prTxingQue, prQueueEntry); - - prMsduInfo = NULL; - } - - QUEUE_REMOVE_HEAD(prTempQue, prQueueEntry, P_QUE_ENTRY_T); - } - QUEUE_CONCATENATE_QUEUES(prTxingQue, prTempQue); - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TXING_MGMT_LIST); - - return prMsduInfo; -} - -P_MSDU_INFO_T -nicGetPendingStaMMPDU ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucStaRecIdx - ) -{ - P_MSDU_INFO_T prMsduInfoListHead = (P_MSDU_INFO_T)NULL; - P_QUE_T prTxingQue = (P_QUE_T)NULL; - QUE_T rTempQue; - P_QUE_T prTempQue = &rTempQue; - P_QUE_ENTRY_T prQueueEntry = (P_QUE_ENTRY_T)NULL; - P_MSDU_INFO_T prMsduInfo = (P_MSDU_INFO_T)NULL; - - GLUE_SPIN_LOCK_DECLARATION(); - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TXING_MGMT_LIST); - do { - if (prAdapter == NULL) { - - ASSERT(FALSE); - break; - } - - prTxingQue = &(prAdapter->rTxCtrl.rTxMgmtTxingQueue); - QUEUE_MOVE_ALL(prTempQue, prTxingQue); - - QUEUE_REMOVE_HEAD(prTempQue, prQueueEntry, P_QUE_ENTRY_T); - while (prQueueEntry) { - prMsduInfo = (P_MSDU_INFO_T)prQueueEntry; - - if ((prMsduInfo->ucStaRecIndex == ucStaRecIdx) && (prMsduInfo->pfTxDoneHandler != NULL)) { - QM_TX_SET_NEXT_MSDU_INFO(prMsduInfo, - prMsduInfoListHead); - prMsduInfoListHead = prMsduInfo; - } - else { - QUEUE_INSERT_TAIL(prTxingQue, prQueueEntry); - - prMsduInfo = NULL; - } - - - QUEUE_REMOVE_HEAD(prTempQue, prQueueEntry, P_QUE_ENTRY_T); - } - - } while (FALSE); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TXING_MGMT_LIST); - - - return prMsduInfoListHead; -} /* nicGetPendingStaMMPDU */ - - -VOID -nicFreePendingTxMsduInfoByNetwork ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType - ) -{ - P_QUE_T prTxingQue; - QUE_T rTempQue; - P_QUE_T prTempQue = &rTempQue; - P_QUE_ENTRY_T prQueueEntry = (P_QUE_ENTRY_T)NULL; - P_MSDU_INFO_T prMsduInfoListHead = (P_MSDU_INFO_T)NULL; - P_MSDU_INFO_T prMsduInfoListTail = (P_MSDU_INFO_T)NULL; - P_MSDU_INFO_T prMsduInfo = (P_MSDU_INFO_T)NULL; - - GLUE_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TXING_MGMT_LIST); - - prTxingQue = &(prAdapter->rTxCtrl.rTxMgmtTxingQueue); - QUEUE_MOVE_ALL(prTempQue, prTxingQue); - - QUEUE_REMOVE_HEAD(prTempQue, prQueueEntry, P_QUE_ENTRY_T); - while (prQueueEntry) { - prMsduInfo = (P_MSDU_INFO_T)prQueueEntry; - - if((ENUM_NETWORK_TYPE_INDEX_T)(prMsduInfo->ucNetworkType) == eNetworkType) { - if(prMsduInfoListHead == NULL) { - prMsduInfoListHead = prMsduInfoListTail = prMsduInfo; - } - else { - QM_TX_SET_NEXT_MSDU_INFO(prMsduInfoListTail, prMsduInfo); - prMsduInfoListTail = prMsduInfo; - } - } - else { - QUEUE_INSERT_TAIL(prTxingQue, prQueueEntry); - - prMsduInfo = NULL; - } - - QUEUE_REMOVE_HEAD(prTempQue, prQueueEntry, P_QUE_ENTRY_T); - } - QUEUE_CONCATENATE_QUEUES(prTxingQue, prTempQue); - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TXING_MGMT_LIST); - - /* free */ - if(prMsduInfoListHead) { - nicTxFreeMsduInfoPacket(prAdapter, prMsduInfoListHead); - } - - return; - -} /* end of nicFreePendingTxMsduInfoByNetwork() */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This procedure is used to retrieve a CMD sequence number atomically -* -* @param prAdapter Pointer of ADAPTER_T -* -* @retval - UINT_8 -*/ -/*----------------------------------------------------------------------------*/ -UINT_8 -nicIncreaseCmdSeqNum ( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_8 ucRetval; - - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_SEQ_NUM); - - prAdapter->ucCmdSeqNum++; - ucRetval = prAdapter->ucCmdSeqNum; - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_SEQ_NUM); - - return ucRetval; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This procedure is used to retrieve a TX sequence number atomically -* -* @param prAdapter Pointer of ADAPTER_T -* -* @retval - UINT_8 -*/ -/*----------------------------------------------------------------------------*/ -UINT_8 -nicIncreaseTxSeqNum ( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_8 ucRetval; - - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_SEQ_NUM); - - prAdapter->ucTxSeqNum++; - ucRetval = prAdapter->ucTxSeqNum; - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_SEQ_NUM); - - return ucRetval; -} - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to handle -* media state change event -* -* @param -* -* @retval -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicMediaStateChange ( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType, - IN P_EVENT_CONNECTION_STATUS prConnectionStatus - ) -{ - P_GLUE_INFO_T prGlueInfo; - - ASSERT(prAdapter); - prGlueInfo = prAdapter->prGlueInfo; - - switch(eNetworkType) { - case NETWORK_TYPE_AIS_INDEX: - if (prConnectionStatus->ucMediaStatus == PARAM_MEDIA_STATE_DISCONNECTED) { // disconnected - if(kalGetMediaStateIndicated(prGlueInfo) != PARAM_MEDIA_STATE_DISCONNECTED) { - - kalIndicateStatusAndComplete(prGlueInfo, - WLAN_STATUS_MEDIA_DISCONNECT, - NULL, - 0); - - prAdapter->rWlanInfo.u4SysTime = kalGetTimeTick(); - } - - /* reset buffered link quality information */ - prAdapter->fgIsLinkQualityValid = FALSE; - prAdapter->fgIsLinkRateValid = FALSE; - } - else if(prConnectionStatus->ucMediaStatus == PARAM_MEDIA_STATE_CONNECTED) { // connected - prAdapter->rWlanInfo.u4SysTime = kalGetTimeTick(); - - // fill information for association result - prAdapter->rWlanInfo.rCurrBssId.rSsid.u4SsidLen - = prConnectionStatus->ucSsidLen; - kalMemCopy(prAdapter->rWlanInfo.rCurrBssId.rSsid.aucSsid, - prConnectionStatus->aucSsid, - prConnectionStatus->ucSsidLen); - kalMemCopy(prAdapter->rWlanInfo.rCurrBssId.arMacAddress, - prConnectionStatus->aucBssid, - MAC_ADDR_LEN); - prAdapter->rWlanInfo.rCurrBssId.u4Privacy - = prConnectionStatus->ucEncryptStatus; // @FIXME - prAdapter->rWlanInfo.rCurrBssId.rRssi - = 0; //@FIXME - prAdapter->rWlanInfo.rCurrBssId.eNetworkTypeInUse - = PARAM_NETWORK_TYPE_AUTOMODE; //@FIXME - prAdapter->rWlanInfo.rCurrBssId.rConfiguration.u4BeaconPeriod - = prConnectionStatus->u2BeaconPeriod; - prAdapter->rWlanInfo.rCurrBssId.rConfiguration.u4ATIMWindow - = prConnectionStatus->u2ATIMWindow; - prAdapter->rWlanInfo.rCurrBssId.rConfiguration.u4DSConfig - = prConnectionStatus->u4FreqInKHz; - prAdapter->rWlanInfo.ucNetworkType - = prConnectionStatus->ucNetworkType; - prAdapter->rWlanInfo.rCurrBssId.eOpMode - = (ENUM_PARAM_OP_MODE_T) prConnectionStatus->ucInfraMode; - - // always indicate to OS according to MSDN (re-association/roaming) - if(kalGetMediaStateIndicated(prGlueInfo) != PARAM_MEDIA_STATE_CONNECTED) { - kalIndicateStatusAndComplete(prGlueInfo, - WLAN_STATUS_MEDIA_CONNECT, - NULL, - 0); - } - else { - /* connected -> connected : roaming ? */ - kalIndicateStatusAndComplete(prGlueInfo, - WLAN_STATUS_ROAM_OUT_FIND_BEST, - NULL, - 0); - } - } - break; - -#if CFG_ENABLE_BT_OVER_WIFI - case NETWORK_TYPE_BOW_INDEX: - break; -#endif - -#if CFG_ENABLE_WIFI_DIRECT - case NETWORK_TYPE_P2P_INDEX: - break; -#endif - default: - ASSERT(0); - } - - return WLAN_STATUS_SUCCESS; -} /* nicMediaStateChange */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to convert between -* frequency and channel number -* -* @param u4ChannelNum -* -* @retval - Frequency in unit of KHz, 0 for invalid channel number -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -nicChannelNum2Freq ( - UINT_32 u4ChannelNum - ) -{ - UINT_32 u4ChannelInMHz; - - if(u4ChannelNum >= 1 && u4ChannelNum <= 13) { - u4ChannelInMHz = 2412 + (u4ChannelNum - 1) * 5; - } - else if(u4ChannelNum == 14) { - u4ChannelInMHz = 2484; - } - else if(u4ChannelNum == 133) { - u4ChannelInMHz = 3665; // 802.11y - } - else if(u4ChannelNum == 137) { - u4ChannelInMHz = 3685; // 802.11y - } - else if(u4ChannelNum >= 34 && u4ChannelNum <= 165) { - u4ChannelInMHz = 5000 + u4ChannelNum * 5; - } - else if(u4ChannelNum >= 183 && u4ChannelNum <= 196) { - u4ChannelInMHz = 4000 + u4ChannelNum * 5; - } - else { - u4ChannelInMHz = 0; - } - - return 1000 * u4ChannelInMHz; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to convert between -* frequency and channel number -* -* @param u4FreqInKHz -* -* @retval - Frequency Number, 0 for invalid freqency -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -nicFreq2ChannelNum ( - UINT_32 u4FreqInKHz - ) -{ - switch(u4FreqInKHz) { - case 2412000: - return 1; - case 2417000: - return 2; - case 2422000: - return 3; - case 2427000: - return 4; - case 2432000: - return 5; - case 2437000: - return 6; - case 2442000: - return 7; - case 2447000: - return 8; - case 2452000: - return 9; - case 2457000: - return 10; - case 2462000: - return 11; - case 2467000: - return 12; - case 2472000: - return 13; - case 2484000: - return 14; - case 3665000: - return 133; // 802.11y - case 3685000: - return 137; // 802.11y - case 4915000: - return 183; - case 4920000: - return 184; - case 4925000: - return 185; - case 4930000: - return 186; - case 4935000: - return 187; - case 4940000: - return 188; - case 4945000: - return 189; - case 4960000: - return 192; - case 4980000: - return 196; - case 5170000: - return 34; - case 5180000: - return 36; - case 5190000: - return 38; - case 5200000: - return 40; - case 5210000: - return 42; - case 5220000: - return 44; - case 5230000: - return 46; - case 5240000: - return 48; - case 5250000: - return 50; - case 5260000: - return 52; - case 5270000: - return 54; - case 5280000: - return 56; - case 5290000: - return 58; - case 5300000: - return 60; - case 5320000: - return 64; - case 5500000: - return 100; - case 5520000: - return 104; - case 5540000: - return 108; - case 5560000: - return 112; - case 5580000: - return 116; - case 5600000: - return 120; - case 5620000: - return 124; - case 5640000: - return 128; - case 5660000: - return 132; - case 5680000: - return 136; - case 5700000: - return 140; - case 5745000: - return 149; - case 5765000: - return 153; - case 5785000: - return 157; - case 5805000: - return 161; - case 5825000: - return 165; - default: - return 0; - } -} - - -/* firmware command wrapper */ -/* NETWORK (WIFISYS) */ -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to activate WIFISYS for specified network -* -* @param prAdapter Pointer of ADAPTER_T -* eNetworkTypeIdx Index of network type -* -* @retval - -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicActivateNetwork( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ) -{ - CMD_BSS_ACTIVATE_CTRL rCmdActivateCtrl; - P_BSS_INFO_T prBssInfo; - - ASSERT(prAdapter); - ASSERT(eNetworkTypeIdx < NETWORK_TYPE_INDEX_NUM); - - rCmdActivateCtrl.ucNetTypeIndex = (UINT_8)eNetworkTypeIdx; - rCmdActivateCtrl.ucActive = 1; - - if (((UINT_8) eNetworkTypeIdx) < NETWORK_TYPE_INDEX_NUM) { - prBssInfo = &prAdapter->rWifiVar.arBssInfo[eNetworkTypeIdx]; - prBssInfo->fg40mBwAllowed = FALSE; - prBssInfo->fgAssoc40mBwAllowed = FALSE; - } - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_BSS_ACTIVATE_CTRL, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_BSS_ACTIVATE_CTRL), - (PUINT_8)&rCmdActivateCtrl, - NULL, - 0); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to deactivate WIFISYS for specified network -* -* @param prAdapter Pointer of ADAPTER_T -* eNetworkTypeIdx Index of network type -* -* @retval - -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicDeactivateNetwork( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ) -{ - WLAN_STATUS u4Status; - CMD_BSS_ACTIVATE_CTRL rCmdActivateCtrl; - - ASSERT(prAdapter); - ASSERT(eNetworkTypeIdx < NETWORK_TYPE_INDEX_NUM); - - rCmdActivateCtrl.ucNetTypeIndex = (UINT_8)eNetworkTypeIdx; - rCmdActivateCtrl.ucActive = 0; - - u4Status = wlanSendSetQueryCmd(prAdapter, - CMD_ID_BSS_ACTIVATE_CTRL, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_BSS_ACTIVATE_CTRL), - (PUINT_8)&rCmdActivateCtrl, - NULL, - 0); - - /* free all correlated station records */ - cnmStaFreeAllStaByNetType(prAdapter, eNetworkTypeIdx, FALSE); - qmFreeAllByNetType(prAdapter, eNetworkTypeIdx); - nicFreePendingTxMsduInfoByNetwork(prAdapter, eNetworkTypeIdx); - kalClearSecurityFramesByNetType(prAdapter->prGlueInfo, eNetworkTypeIdx); - - return u4Status; -} - - -/* BSS-INFO */ -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to sync bss info with firmware -* when a new BSS has been connected or disconnected -* -* @param prAdapter Pointer of ADAPTER_T -* eNetworkTypeIdx Index of BSS-INFO type -* -* @retval - -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicUpdateBss( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ) -{ - WLAN_STATUS u4Status; - P_BSS_INFO_T prBssInfo; - CMD_SET_BSS_INFO rCmdSetBssInfo; - - ASSERT(prAdapter); - ASSERT(eNetworkTypeIdx < NETWORK_TYPE_INDEX_NUM); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[eNetworkTypeIdx]); - - kalMemZero(&rCmdSetBssInfo, sizeof(CMD_SET_BSS_INFO)); - - rCmdSetBssInfo.ucNetTypeIndex = (UINT_8)eNetworkTypeIdx; - rCmdSetBssInfo.ucConnectionState = (UINT_8)prBssInfo->eConnectionState; - rCmdSetBssInfo.ucCurrentOPMode = (UINT_8)prBssInfo->eCurrentOPMode; - rCmdSetBssInfo.ucSSIDLen = (UINT_8)prBssInfo->ucSSIDLen; - kalMemCopy(rCmdSetBssInfo.aucSSID, prBssInfo->aucSSID, prBssInfo->ucSSIDLen); - COPY_MAC_ADDR(rCmdSetBssInfo.aucBSSID, prBssInfo->aucBSSID); - rCmdSetBssInfo.ucIsQBSS = (UINT_8)prBssInfo->fgIsQBSS; - rCmdSetBssInfo.ucNonHTBasicPhyType = prBssInfo->ucNonHTBasicPhyType; - rCmdSetBssInfo.u2OperationalRateSet = prBssInfo->u2OperationalRateSet; - rCmdSetBssInfo.u2BSSBasicRateSet = prBssInfo->u2BSSBasicRateSet; - rCmdSetBssInfo.ucPhyTypeSet = prBssInfo->ucPhyTypeSet; -#if CFG_ENABLE_WIFI_DIRECT - if(prAdapter->fgIsP2PRegistered) { - COPY_MAC_ADDR(rCmdSetBssInfo.aucOwnMac, prBssInfo->aucOwnMacAddr); - } -#endif - - rlmFillSyncCmdParam(&rCmdSetBssInfo.rBssRlmParam, prBssInfo); - - rCmdSetBssInfo.fgWapiMode = (UINT_8)FALSE; - - if(rCmdSetBssInfo.ucNetTypeIndex == NETWORK_TYPE_AIS_INDEX) { - P_CONNECTION_SETTINGS_T prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - - rCmdSetBssInfo.ucAuthMode = (UINT_8)prConnSettings->eAuthMode; - rCmdSetBssInfo.ucEncStatus = (UINT_8)prConnSettings->eEncStatus; - rCmdSetBssInfo.fgWapiMode = (UINT_8)prConnSettings->fgWapiMode; - } -#if CFG_ENABLE_BT_OVER_WIFI - else if(rCmdSetBssInfo.ucNetTypeIndex == NETWORK_TYPE_BOW_INDEX) { - //P_CONNECTION_SETTINGS_T prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - rCmdSetBssInfo.ucAuthMode = (UINT_8)AUTH_MODE_WPA2_PSK; - rCmdSetBssInfo.ucEncStatus = (UINT_8)ENUM_ENCRYPTION3_KEY_ABSENT; - } -#endif - else { -#if CFG_ENABLE_WIFI_DIRECT - if(prAdapter->fgIsP2PRegistered) { - if (kalP2PGetCipher(prAdapter->prGlueInfo)) { - rCmdSetBssInfo.ucAuthMode = (UINT_8)AUTH_MODE_WPA2_PSK; - rCmdSetBssInfo.ucEncStatus = (UINT_8)ENUM_ENCRYPTION3_KEY_ABSENT; - } - else { - rCmdSetBssInfo.ucAuthMode = (UINT_8)AUTH_MODE_OPEN; - rCmdSetBssInfo.ucEncStatus = (UINT_8)ENUM_ENCRYPTION_DISABLED; - } - rCmdSetBssInfo.fgIsApMode = p2pFuncIsAPMode(prAdapter->rWifiVar.prP2pFsmInfo); - } -#else - rCmdSetBssInfo.ucAuthMode = (UINT_8)AUTH_MODE_WPA2_PSK; - rCmdSetBssInfo.ucEncStatus = (UINT_8)ENUM_ENCRYPTION3_KEY_ABSENT; -#endif - } - - if(eNetworkTypeIdx == NETWORK_TYPE_AIS_INDEX && - prBssInfo->eCurrentOPMode == OP_MODE_INFRASTRUCTURE && - prBssInfo->prStaRecOfAP != NULL) { - rCmdSetBssInfo.ucStaRecIdxOfAP = prBssInfo->prStaRecOfAP->ucIndex; - - cnmAisInfraConnectNotify(prAdapter); - } -#if CFG_ENABLE_WIFI_DIRECT - else if ((prAdapter->fgIsP2PRegistered) && - (eNetworkTypeIdx == NETWORK_TYPE_P2P_INDEX) && - (prBssInfo->eCurrentOPMode == OP_MODE_INFRASTRUCTURE) && - (prBssInfo->prStaRecOfAP != NULL)) { - rCmdSetBssInfo.ucStaRecIdxOfAP = prBssInfo->prStaRecOfAP->ucIndex; - } -#endif - -#if CFG_ENABLE_BT_OVER_WIFI - else if (eNetworkTypeIdx == NETWORK_TYPE_BOW_INDEX && - prBssInfo->eCurrentOPMode == OP_MODE_BOW && - prBssInfo->prStaRecOfAP != NULL) { - rCmdSetBssInfo.ucStaRecIdxOfAP = prBssInfo->prStaRecOfAP->ucIndex; - } -#endif - else { - rCmdSetBssInfo.ucStaRecIdxOfAP = STA_REC_INDEX_NOT_FOUND; - } - - u4Status = wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_BSS_INFO, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_SET_BSS_INFO), - (PUINT_8)&rCmdSetBssInfo, - NULL, - 0); - - /* if BSS-INFO is going to be disconnected state, free all correlated station records */ - if(prBssInfo->eConnectionState == PARAM_MEDIA_STATE_DISCONNECTED) { - /* clear client list */ - bssClearClientList(prAdapter, prBssInfo); - - /* free all correlated station records */ - cnmStaFreeAllStaByNetType(prAdapter, eNetworkTypeIdx, FALSE); - qmFreeAllByNetType(prAdapter, eNetworkTypeIdx); - kalClearSecurityFramesByNetType(prAdapter->prGlueInfo, eNetworkTypeIdx); - } - - return u4Status; -} - - -/* BSS-INFO Indication (PM) */ -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to indicate PM that -* a BSS has been created. (for AdHoc / P2P-GO) -* -* @param prAdapter Pointer of ADAPTER_T -* eNetworkTypeIdx Index of BSS-INFO -* -* @retval - -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicPmIndicateBssCreated( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ) -{ - P_BSS_INFO_T prBssInfo; - CMD_INDICATE_PM_BSS_CREATED rCmdIndicatePmBssCreated; - - ASSERT(prAdapter); - ASSERT(eNetworkTypeIdx < NETWORK_TYPE_INDEX_NUM); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[eNetworkTypeIdx]); - - rCmdIndicatePmBssCreated.ucNetTypeIndex = (UINT_8)eNetworkTypeIdx; - rCmdIndicatePmBssCreated.ucDtimPeriod = prBssInfo->ucDTIMPeriod; - rCmdIndicatePmBssCreated.u2BeaconInterval = prBssInfo->u2BeaconInterval; - rCmdIndicatePmBssCreated.u2AtimWindow = prBssInfo->u2ATIMWindow; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_INDICATE_PM_BSS_CREATED, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_INDICATE_PM_BSS_CREATED), - (PUINT_8)&rCmdIndicatePmBssCreated, - NULL, - 0); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to indicate PM that -* a BSS has been connected -* -* @param prAdapter Pointer of ADAPTER_T -* eNetworkTypeIdx Index of BSS-INFO -* -* @retval - -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicPmIndicateBssConnected( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ) -{ - P_BSS_INFO_T prBssInfo; - CMD_INDICATE_PM_BSS_CONNECTED rCmdIndicatePmBssConnected; - - ASSERT(prAdapter); - ASSERT(eNetworkTypeIdx < NETWORK_TYPE_INDEX_NUM); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[eNetworkTypeIdx]); - - rCmdIndicatePmBssConnected.ucNetTypeIndex = (UINT_8)eNetworkTypeIdx; - rCmdIndicatePmBssConnected.ucDtimPeriod = prBssInfo->ucDTIMPeriod; - rCmdIndicatePmBssConnected.u2AssocId = prBssInfo->u2AssocId; - rCmdIndicatePmBssConnected.u2BeaconInterval = prBssInfo->u2BeaconInterval; - rCmdIndicatePmBssConnected.u2AtimWindow = prBssInfo->u2ATIMWindow; - - rCmdIndicatePmBssConnected.ucBmpDeliveryAC = prBssInfo->rPmProfSetupInfo.ucBmpDeliveryAC; - rCmdIndicatePmBssConnected.ucBmpTriggerAC = prBssInfo->rPmProfSetupInfo.ucBmpTriggerAC; - - //DBGPRINTF("nicPmIndicateBssConnected: ucBmpDeliveryAC:0x%x, ucBmpTriggerAC:0x%x", - //rCmdIndicatePmBssConnected.ucBmpDeliveryAC, - //rCmdIndicatePmBssConnected.ucBmpTriggerAC); - - if ((eNetworkTypeIdx == NETWORK_TYPE_AIS_INDEX) -#if CFG_ENABLE_WIFI_DIRECT - || ((eNetworkTypeIdx == NETWORK_TYPE_P2P_INDEX) && (prAdapter->fgIsP2PRegistered)) -#endif - ) { - if(prBssInfo->eCurrentOPMode == OP_MODE_INFRASTRUCTURE) { - rCmdIndicatePmBssConnected.fgIsUapsdConnection = (UINT_8)prBssInfo->prStaRecOfAP->fgIsUapsdSupported; - } - else { - rCmdIndicatePmBssConnected.fgIsUapsdConnection = 0; //@FIXME - } - } - else { - rCmdIndicatePmBssConnected.fgIsUapsdConnection = 0; - } - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_INDICATE_PM_BSS_CONNECTED, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_INDICATE_PM_BSS_CONNECTED), - (PUINT_8)&rCmdIndicatePmBssConnected, - NULL, - 0); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to indicate PM that -* a BSS has been disconnected -* -* @param prAdapter Pointer of ADAPTER_T -* eNetworkTypeIdx Index of BSS-INFO -* -* @retval - -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicPmIndicateBssAbort( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ) -{ - CMD_INDICATE_PM_BSS_ABORT rCmdIndicatePmBssAbort; - - ASSERT(prAdapter); - ASSERT(eNetworkTypeIdx < NETWORK_TYPE_INDEX_NUM); - - rCmdIndicatePmBssAbort.ucNetTypeIndex = (UINT_8)eNetworkTypeIdx; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_INDICATE_PM_BSS_ABORT, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_INDICATE_PM_BSS_ABORT), - (PUINT_8)&rCmdIndicatePmBssAbort, - NULL, - 0); -} - -WLAN_STATUS -nicConfigPowerSaveProfile ( - IN P_ADAPTER_T prAdapter, - ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - PARAM_POWER_MODE ePwrMode, - BOOLEAN fgEnCmdEvent - ) -{ - DEBUGFUNC("nicConfigPowerSaveProfile"); - DBGLOG(INIT, TRACE, ("eNetTypeIndex:%d, ePwrMode:%d, fgEnCmdEvent:%d\n", - eNetTypeIndex, ePwrMode, fgEnCmdEvent)); - - ASSERT(prAdapter); - - if (eNetTypeIndex >= NETWORK_TYPE_INDEX_NUM) { - ASSERT(0); - return WLAN_STATUS_NOT_SUPPORTED; - } - -// prAdapter->rWlanInfo.ePowerSaveMode.ucNetTypeIndex = eNetTypeIndex; -// prAdapter->rWlanInfo.ePowerSaveMode.ucPsProfile = (UINT_8)ePwrMode; - prAdapter->rWlanInfo.arPowerSaveMode[eNetTypeIndex].ucNetTypeIndex = eNetTypeIndex; - prAdapter->rWlanInfo.arPowerSaveMode[eNetTypeIndex].ucPsProfile = (UINT_8)ePwrMode; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_POWER_SAVE_MODE, - TRUE, - FALSE, - TRUE, - (fgEnCmdEvent ? nicCmdEventSetCommon : NULL), - (fgEnCmdEvent ? nicOidCmdTimeoutCommon : NULL), - sizeof(CMD_PS_PROFILE_T), - (PUINT_8)&(prAdapter->rWlanInfo.arPowerSaveMode[eNetTypeIndex]), - NULL, - sizeof(PARAM_POWER_MODE) - ); - -} /* end of wlanoidSetAcpiDevicePowerStateMode() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to indicate firmware domain -* for beacon generation parameters -* -* @param prAdapter Pointer of ADAPTER_T -* eIeUpdMethod, Update Method -* eNetTypeIndex Index of Network -* u2Capability Capability -* aucIe Pointer to buffer of IEs -* u2IELen Length of IEs -* -* @retval - WLAN_STATUS_SUCCESS -* WLAN_STATUS_FAILURE -* WLAN_STATUS_PENDING -* WLAN_STATUS_INVALID_DATA -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicUpdateBeaconIETemplate ( - IN P_ADAPTER_T prAdapter, - IN ENUM_IE_UPD_METHOD_T eIeUpdMethod, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, - IN UINT_16 u2Capability, - IN PUINT_8 aucIe, - IN UINT_16 u2IELen - ) -{ - P_CMD_BEACON_TEMPLATE_UPDATE prCmdBcnUpdate; - UINT_16 u2CmdBufLen = 0; - P_GLUE_INFO_T prGlueInfo; - P_CMD_INFO_T prCmdInfo; - P_WIFI_CMD_T prWifiCmd; - UINT_8 ucCmdSeqNum; - - DEBUGFUNC("wlanUpdateBeaconIETemplate"); - DBGLOG(INIT, LOUD, ("\n")); - - ASSERT(prAdapter); - prGlueInfo = prAdapter->prGlueInfo; - - if (u2IELen > MAX_IE_LENGTH) { - return WLAN_STATUS_INVALID_DATA; - } - - if (eIeUpdMethod == IE_UPD_METHOD_UPDATE_RANDOM - || eIeUpdMethod == IE_UPD_METHOD_UPDATE_ALL) { - u2CmdBufLen = OFFSET_OF(CMD_BEACON_TEMPLATE_UPDATE, aucIE) + u2IELen; - } - else if (eIeUpdMethod == IE_UPD_METHOD_DELETE_ALL) { - u2CmdBufLen = OFFSET_OF(CMD_BEACON_TEMPLATE_UPDATE, u2IELen); - } - else { - ASSERT(0); - return WLAN_STATUS_FAILURE; - } - - // prepare command info - prCmdInfo = cmdBufAllocateCmdInfo(prAdapter, (CMD_HDR_SIZE + u2CmdBufLen)); - if (!prCmdInfo) { - DBGLOG(INIT, ERROR, ("Allocate CMD_INFO_T ==> FAILED.\n")); - return WLAN_STATUS_FAILURE; - } - - // increase command sequence number - ucCmdSeqNum = nicIncreaseCmdSeqNum(prAdapter); - DBGLOG(REQ, TRACE, ("ucCmdSeqNum =%d\n", ucCmdSeqNum)); - - // Setup common CMD Info Packet - prCmdInfo->eCmdType = COMMAND_TYPE_NETWORK_IOCTL; - prCmdInfo->eNetworkType = eNetTypeIndex; - prCmdInfo->u2InfoBufLen = (UINT_16)(CMD_HDR_SIZE + u2CmdBufLen); - prCmdInfo->pfCmdDoneHandler = NULL; //@FIXME - prCmdInfo->pfCmdTimeoutHandler = NULL; //@FIXME - prCmdInfo->fgIsOid = FALSE; - prCmdInfo->ucCID = CMD_ID_UPDATE_BEACON_CONTENT; - prCmdInfo->fgSetQuery = TRUE; - prCmdInfo->fgNeedResp = FALSE; - prCmdInfo->fgDriverDomainMCR = FALSE; - prCmdInfo->ucCmdSeqNum = ucCmdSeqNum; - prCmdInfo->u4SetInfoLen = u2CmdBufLen; - prCmdInfo->pvInformationBuffer = NULL; - prCmdInfo->u4InformationBufferLength = 0; - - // Setup WIFI_CMD_T (no payload) - prWifiCmd = (P_WIFI_CMD_T)(prCmdInfo->pucInfoBuffer); - prWifiCmd->u2TxByteCount_UserPriority = prCmdInfo->u2InfoBufLen; - prWifiCmd->ucCID = prCmdInfo->ucCID; - prWifiCmd->ucSetQuery = prCmdInfo->fgSetQuery; - prWifiCmd->ucSeqNum = prCmdInfo->ucCmdSeqNum; - - prCmdBcnUpdate = (P_CMD_BEACON_TEMPLATE_UPDATE)(prWifiCmd->aucBuffer); - - // fill beacon updating command - prCmdBcnUpdate->ucUpdateMethod = (UINT_8) eIeUpdMethod; - prCmdBcnUpdate->ucNetTypeIndex = (UINT_8) eNetTypeIndex; - prCmdBcnUpdate->u2Capability = u2Capability; - prCmdBcnUpdate->u2IELen = u2IELen; - if(u2IELen > 0 ) { - kalMemCopy(prCmdBcnUpdate->aucIE, aucIe, u2IELen); - } - - // insert into prCmdQueue - kalEnqueueCommand(prGlueInfo, (P_QUE_ENTRY_T)prCmdInfo); - - // wakeup txServiceThread later - GLUE_SET_EVENT(prGlueInfo); - return WLAN_STATUS_PENDING; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to initialization PHY related -* varaibles -* -* @param prAdapter Pointer of ADAPTER_T -* -* @retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicSetAvailablePhyTypeSet ( - IN P_ADAPTER_T prAdapter - ) -{ - P_CONNECTION_SETTINGS_T prConnSettings; - - ASSERT(prAdapter); - - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - - if (prConnSettings->eDesiredPhyConfig >= PHY_CONFIG_NUM) { - ASSERT(0); - return; - } - - prAdapter->rWifiVar.ucAvailablePhyTypeSet = - aucPhyCfg2PhyTypeSet[prConnSettings->eDesiredPhyConfig]; - - if (prAdapter->rWifiVar.ucAvailablePhyTypeSet & PHY_TYPE_BIT_ERP) { - prAdapter->rWifiVar.eNonHTBasicPhyType2G4 = PHY_TYPE_ERP_INDEX; - } - /* NOTE(Kevin): Because we don't have N only mode, TBD */ - else /* if (ucNonHTPhyTypeSet & PHY_TYPE_HR_DSSS_INDEX) */ { - prAdapter->rWifiVar.eNonHTBasicPhyType2G4 = PHY_TYPE_HR_DSSS_INDEX; - } - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to update WMM Parms -* -* @param prAdapter Pointer of ADAPTER_T -* eNetworkTypeIdx Index of BSS-INFO -* -* @retval - -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicQmUpdateWmmParms( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ) -{ - P_BSS_INFO_T prBssInfo; - CMD_UPDATE_WMM_PARMS_T rCmdUpdateWmmParms; - - ASSERT(prAdapter); - ASSERT(eNetworkTypeIdx < NETWORK_TYPE_INDEX_NUM); - - DBGLOG(QM, EVENT, ("sizeof(AC_QUE_PARMS_T): %d \n", sizeof(AC_QUE_PARMS_T))); - DBGLOG(QM, EVENT, ("sizeof(CMD_UPDATE_WMM_PARMS): %d \n", sizeof(CMD_UPDATE_WMM_PARMS_T))); - DBGLOG(QM, EVENT, ("sizeof(WIFI_CMD_T): %d \n", sizeof(WIFI_CMD_T))); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[eNetworkTypeIdx]); - rCmdUpdateWmmParms.ucNetTypeIndex = (UINT_8)eNetworkTypeIdx; - kalMemCopy(&rCmdUpdateWmmParms.arACQueParms[0], &prBssInfo->arACQueParms[0], - (sizeof(AC_QUE_PARMS_T)*AC_NUM)); - - rCmdUpdateWmmParms.fgIsQBSS = prBssInfo->fgIsQBSS; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_UPDATE_WMM_PARMS, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_UPDATE_WMM_PARMS_T), - (PUINT_8)&rCmdUpdateWmmParms, - NULL, - 0); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to update TX power gain corresponding to -* each band/modulation combination -* -* @param prAdapter Pointer of ADAPTER_T -* prTxPwrParam Pointer of TX power parameters -* -* @retval WLAN_STATUS_PENDING -* WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicUpdateTxPower( - IN P_ADAPTER_T prAdapter, - IN P_CMD_TX_PWR_T prTxPwrParam - ) -{ - DEBUGFUNC("nicUpdateTxPower"); - - ASSERT(prAdapter); - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_TX_PWR, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_TX_PWR_T), - (PUINT_8)prTxPwrParam, - NULL, - 0); -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to set auto tx power parameter -* -* @param prAdapter Pointer of ADAPTER_T -* prTxPwrParam Pointer of Auto TX power parameters -* -* @retval WLAN_STATUS_PENDING -* WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicSetAutoTxPower( - IN P_ADAPTER_T prAdapter, - IN P_CMD_AUTO_POWER_PARAM_T prAutoPwrParam - ) -{ - DEBUGFUNC("nicSetAutoTxPower"); - - ASSERT(prAdapter); - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_AUTOPWR_CTRL, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_AUTO_POWER_PARAM_T), - (PUINT_8)prAutoPwrParam, - NULL, - 0); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to update TX power gain corresponding to -* each band/modulation combination -* -* @param prAdapter Pointer of ADAPTER_T -* prTxPwrParam Pointer of TX power parameters -* -* @retval WLAN_STATUS_PENDING -* WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicSetAutoTxPowerControl( - IN P_ADAPTER_T prAdapter, - IN P_CMD_TX_PWR_T prTxPwrParam - ) -{ - DEBUGFUNC("nicUpdateTxPower"); - - ASSERT(prAdapter); - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_TX_PWR, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_TX_PWR_T), - (PUINT_8)prTxPwrParam, - NULL, - 0); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to update power offset around 5GHz band -* -* @param prAdapter Pointer of ADAPTER_T -* pr5GPwrOffset Pointer of 5GHz power offset parameter -* -* @retval WLAN_STATUS_PENDING -* WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicUpdate5GOffset( - IN P_ADAPTER_T prAdapter, - IN P_CMD_5G_PWR_OFFSET_T pr5GPwrOffset - ) -{ - DEBUGFUNC("nicUpdate5GOffset"); - - ASSERT(prAdapter); - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_5G_PWR_OFFSET, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_5G_PWR_OFFSET_T), - (PUINT_8)pr5GPwrOffset, - NULL, - 0); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to update DPD calibration result -* -* @param prAdapter Pointer of ADAPTER_T -* pr5GPwrOffset Pointer of parameter for DPD calibration result -* -* @retval WLAN_STATUS_PENDING -* WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicUpdateDPD( - IN P_ADAPTER_T prAdapter, - IN P_CMD_PWR_PARAM_T prDpdCalResult - ) -{ - DEBUGFUNC("nicUpdateDPD"); - - ASSERT(prAdapter); - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_PWR_PARAM, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_PWR_PARAM_T), - (PUINT_8)prDpdCalResult, - NULL, - 0); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function starts system service such as timer and -* memory pools -* -* @param prAdapter Pointer of ADAPTER_T -* -* @retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicInitSystemService ( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - // <1> Initialize MGMT Memory pool and STA_REC - cnmMemInit(prAdapter); - cnmStaRecInit(prAdapter); - cmdBufInitialize(prAdapter); - - // <2> Mailbox Initialization - mboxInitialize(prAdapter); - - // <3> Timer Initialization - cnmTimerInitialize(prAdapter); - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function reset some specific system service, -* such as STA-REC -* -* @param prAdapter Pointer of ADAPTER_T -* -* @retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicResetSystemService ( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to update WMM Parms -* -* @param prAdapter Pointer of ADAPTER_T -* -* @retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicUninitSystemService ( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - /* Timer Destruction */ - cnmTimerDestroy(prAdapter); - - /* Mailbox Destruction */ - mboxDestroy(prAdapter); - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to update WMM Parms -* -* @param prAdapter Pointer of ADAPTER_T -* -* @retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicInitMGMT ( - IN P_ADAPTER_T prAdapter, - IN P_REG_INFO_T prRegInfo - ) -{ - ASSERT(prAdapter); - - /* CNM Module - initialization */ - cnmInit(prAdapter); - - /* RLM Module - initialization */ - rlmFsmEventInit(prAdapter); - - /* SCN Module - initialization */ - scnInit(prAdapter); - - /* AIS Module - intiailization */ - aisInitializeConnectionSettings(prAdapter, prRegInfo); - aisFsmInit(prAdapter); - -#if CFG_SUPPORT_ROAMING - /* Roaming Module - intiailization */ - roamingFsmInit(prAdapter); -#endif /* CFG_SUPPORT_ROAMING */ - -#if CFG_SUPPORT_SWCR - swCrDebugInit(prAdapter); -#endif /* CFG_SUPPORT_SWCR */ - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to update WMM Parms -* -* @param prAdapter Pointer of ADAPTER_T -* -* @retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicUninitMGMT ( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - -#if CFG_SUPPORT_SWCR - swCrDebugUninit(prAdapter); -#endif /* CFG_SUPPORT_SWCR */ - -#if CFG_SUPPORT_ROAMING - /* Roaming Module - unintiailization */ - roamingFsmUninit(prAdapter); -#endif /* CFG_SUPPORT_ROAMING */ - - /* AIS Module - unintiailization */ - aisFsmUninit(prAdapter); - - /* SCN Module - unintiailization */ - scnUninit(prAdapter); - - /* RLM Module - uninitialization */ - rlmFsmEventUninit(prAdapter); - - /* CNM Module - uninitialization */ - cnmUninit(prAdapter); - - return; -} - - -#if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1) -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is to inform firmware to enable MCU clock gating -* -* @param prAdapter Pointer of ADAPTER_T -* -* @retval none -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicEnableClockGating ( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_32 i, u4WHISR = 0; - - ASSERT(prAdapter); - - if(prAdapter->fgIsClockGatingEnabled == TRUE) { - return WLAN_STATUS_SUCCESS; - } - else { - nicSetSwIntr(prAdapter, REQ_GATING_ENABLE_H2D_INT); - - i = 0; - while(i < GATING_CONTROL_POLL_LIMIT) { - if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - return WLAN_STATUS_FAILURE; - } - - HAL_READ_INTR_STATUS(prAdapter, sizeof(UINT_32), (PUINT_8)&u4WHISR); - - if(u4WHISR & ACK_GATING_ENABLE_D2H_INT) { - prAdapter->fgIsClockGatingEnabled = TRUE; - return WLAN_STATUS_SUCCESS; - } - } - - ASSERT(0); - return WLAN_STATUS_PENDING; - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is to inform firmware to disable MCU clock gating -* -* @param prAdapter Pointer of ADAPTER_T -* -* @retval none -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicDisableClockGating ( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_32 i, u4WHISR = 0; - - ASSERT(prAdapter); - - if(prAdapter->fgIsClockGatingEnabled == FALSE) { - return WLAN_STATUS_SUCCESS; - } - else { - nicSetSwIntr(prAdapter, REQ_GATING_DISABLE_H2D_INT); - - i = 0; - while(i < GATING_CONTROL_POLL_LIMIT) { - if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - return WLAN_STATUS_FAILURE; - } - - HAL_READ_INTR_STATUS(prAdapter, sizeof(UINT_32), (PUINT_8)&u4WHISR); - - if(u4WHISR & ACK_GATING_DISABLE_D2H_INT) { - prAdapter->fgIsClockGatingEnabled = FALSE; - return WLAN_STATUS_SUCCESS; - } - } - - ASSERT(0); - return WLAN_STATUS_PENDING; - } -} -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is invoked to buffer scan result -* -* @param prAdapter Pointer to the Adapter structure. -* @param rMacAddr BSSID -* @param prSsid Pointer to SSID -* @param u4Privacy Privacy settings (0: Open / 1: WEP/WPA/WPA2 enabled) -* @param rRssi Received Strength (-10 ~ -200 dBm) -* @param eNetworkType Network Type (a/b/g) -* @param prConfiguration Network Parameter -* @param eOpMode Infra/Ad-Hoc -* @param rSupportedRates Supported basic rates -* @param u2IELength IE Length -* @param pucIEBuf Pointer to Information Elements(IEs) -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicAddScanResult ( - IN P_ADAPTER_T prAdapter, - IN PARAM_MAC_ADDRESS rMacAddr, - IN P_PARAM_SSID_T prSsid, - IN UINT_32 u4Privacy, - IN PARAM_RSSI rRssi, - IN ENUM_PARAM_NETWORK_TYPE_T eNetworkType, - IN P_PARAM_802_11_CONFIG_T prConfiguration, - IN ENUM_PARAM_OP_MODE_T eOpMode, - IN PARAM_RATES_EX rSupportedRates, - IN UINT_16 u2IELength, - IN PUINT_8 pucIEBuf - ) -{ - BOOLEAN bReplace; - UINT_32 i; - UINT_32 u4IdxWeakest = 0; - PARAM_RSSI rWeakestRssi; - UINT_32 u4BufferSize; - - ASSERT(prAdapter); - - rWeakestRssi = (PARAM_RSSI)INT_MAX; - u4BufferSize = sizeof(prAdapter->rWlanInfo.aucScanIEBuf) / sizeof(prAdapter->rWlanInfo.aucScanIEBuf[0]); - - bReplace = FALSE; - - // decide to replace or add - for(i = 0 ; i < prAdapter->rWlanInfo.u4ScanResultNum ; i++) { - // find weakest entry && not connected one - if(UNEQUAL_MAC_ADDR(prAdapter->rWlanInfo.arScanResult[i].arMacAddress, prAdapter->rWlanInfo.rCurrBssId.arMacAddress) - && prAdapter->rWlanInfo.arScanResult[i].rRssi < rWeakestRssi) { - u4IdxWeakest = i; - rWeakestRssi = prAdapter->rWlanInfo.arScanResult[i].rRssi; - } - - if(prAdapter->rWlanInfo.arScanResult[i].eOpMode == eOpMode && - EQUAL_MAC_ADDR(&(prAdapter->rWlanInfo.arScanResult[i].arMacAddress), rMacAddr) && - (EQUAL_SSID(prAdapter->rWlanInfo.arScanResult[i].rSsid.aucSsid, - prAdapter->rWlanInfo.arScanResult[i].rSsid.u4SsidLen, - prSsid->aucSsid, - prSsid->u4SsidLen) - || prAdapter->rWlanInfo.arScanResult[i].rSsid.u4SsidLen == 0)) { - // replace entry - bReplace = TRUE; - - // free IE buffer then zero - nicFreeScanResultIE(prAdapter, i); - kalMemZero(&(prAdapter->rWlanInfo.arScanResult[i]), OFFSET_OF(PARAM_BSSID_EX_T, aucIEs)); - - // then fill buffer - prAdapter->rWlanInfo.arScanResult[i].u4Length = - OFFSET_OF(PARAM_BSSID_EX_T, aucIEs) + u2IELength; - COPY_MAC_ADDR(prAdapter->rWlanInfo.arScanResult[i].arMacAddress, rMacAddr); - COPY_SSID(prAdapter->rWlanInfo.arScanResult[i].rSsid.aucSsid, - prAdapter->rWlanInfo.arScanResult[i].rSsid.u4SsidLen, - prSsid->aucSsid, - prSsid->u4SsidLen); - prAdapter->rWlanInfo.arScanResult[i].u4Privacy = u4Privacy; - prAdapter->rWlanInfo.arScanResult[i].rRssi = rRssi; - prAdapter->rWlanInfo.arScanResult[i].eNetworkTypeInUse = eNetworkType; - kalMemCopy(&(prAdapter->rWlanInfo.arScanResult[i].rConfiguration), - prConfiguration, - sizeof(PARAM_802_11_CONFIG_T)); - prAdapter->rWlanInfo.arScanResult[i].eOpMode = eOpMode; - kalMemCopy((prAdapter->rWlanInfo.arScanResult[i].rSupportedRates), - rSupportedRates, - sizeof(PARAM_RATES_EX)); - prAdapter->rWlanInfo.arScanResult[i].u4IELength = (UINT_32)u2IELength; - - // IE - allocate buffer and update pointer - if(u2IELength > 0) { - if(ALIGN_4(u2IELength) + prAdapter->rWlanInfo.u4ScanIEBufferUsage <= u4BufferSize) { - kalMemCopy(&(prAdapter->rWlanInfo.aucScanIEBuf[prAdapter->rWlanInfo.u4ScanIEBufferUsage]), - pucIEBuf, - u2IELength); - - prAdapter->rWlanInfo.apucScanResultIEs[i] = - &(prAdapter->rWlanInfo.aucScanIEBuf[prAdapter->rWlanInfo.u4ScanIEBufferUsage]); - - prAdapter->rWlanInfo.u4ScanIEBufferUsage += ALIGN_4(u2IELength); - } - else { - // buffer is not enough - prAdapter->rWlanInfo.arScanResult[i].u4Length -= u2IELength; - prAdapter->rWlanInfo.arScanResult[i].u4IELength = 0; - prAdapter->rWlanInfo.apucScanResultIEs[i] = NULL; - } - } - else { - prAdapter->rWlanInfo.apucScanResultIEs[i] = NULL; - } - - break; - } - } - - if (bReplace == FALSE) { - if (prAdapter->rWlanInfo.u4ScanResultNum < (CFG_MAX_NUM_BSS_LIST - 1)) { - i = prAdapter->rWlanInfo.u4ScanResultNum; - - // zero - kalMemZero(&(prAdapter->rWlanInfo.arScanResult[i]), - OFFSET_OF(PARAM_BSSID_EX_T, aucIEs)); - - // then fill buffer - prAdapter->rWlanInfo.arScanResult[i].u4Length = - OFFSET_OF(PARAM_BSSID_EX_T, aucIEs) + u2IELength; - COPY_MAC_ADDR(prAdapter->rWlanInfo.arScanResult[i].arMacAddress, rMacAddr); - COPY_SSID(prAdapter->rWlanInfo.arScanResult[i].rSsid.aucSsid, - prAdapter->rWlanInfo.arScanResult[i].rSsid.u4SsidLen, - prSsid->aucSsid, - prSsid->u4SsidLen); - prAdapter->rWlanInfo.arScanResult[i].u4Privacy = u4Privacy; - prAdapter->rWlanInfo.arScanResult[i].rRssi = rRssi; - prAdapter->rWlanInfo.arScanResult[i].eNetworkTypeInUse = eNetworkType; - kalMemCopy(&(prAdapter->rWlanInfo.arScanResult[i].rConfiguration), - prConfiguration, - sizeof(PARAM_802_11_CONFIG_T)); - prAdapter->rWlanInfo.arScanResult[i].eOpMode = eOpMode; - kalMemCopy((prAdapter->rWlanInfo.arScanResult[i].rSupportedRates), - rSupportedRates, - sizeof(PARAM_RATES_EX)); - prAdapter->rWlanInfo.arScanResult[i].u4IELength = (UINT_32)u2IELength; - - // IE - allocate buffer and update pointer - if(u2IELength > 0) { - if(ALIGN_4(u2IELength) + prAdapter->rWlanInfo.u4ScanIEBufferUsage <= u4BufferSize) { - kalMemCopy(&(prAdapter->rWlanInfo.aucScanIEBuf[prAdapter->rWlanInfo.u4ScanIEBufferUsage]), - pucIEBuf, - u2IELength); - - prAdapter->rWlanInfo.apucScanResultIEs[i] = - &(prAdapter->rWlanInfo.aucScanIEBuf[prAdapter->rWlanInfo.u4ScanIEBufferUsage]); - - prAdapter->rWlanInfo.u4ScanIEBufferUsage += ALIGN_4(u2IELength); - } - else { - // buffer is not enough - prAdapter->rWlanInfo.arScanResult[i].u4Length -= u2IELength; - prAdapter->rWlanInfo.arScanResult[i].u4IELength = 0; - prAdapter->rWlanInfo.apucScanResultIEs[i] = NULL; - } - } - else { - prAdapter->rWlanInfo.apucScanResultIEs[i] = NULL; - } - - prAdapter->rWlanInfo.u4ScanResultNum++; - } - else if(rWeakestRssi != (PARAM_RSSI)INT_MAX) { - // replace weakest one - i = u4IdxWeakest; - - // free IE buffer then zero - nicFreeScanResultIE(prAdapter, i); - kalMemZero(&(prAdapter->rWlanInfo.arScanResult[i]), - OFFSET_OF(PARAM_BSSID_EX_T, aucIEs)); - - // then fill buffer - prAdapter->rWlanInfo.arScanResult[i].u4Length = - OFFSET_OF(PARAM_BSSID_EX_T, aucIEs) + u2IELength; - COPY_MAC_ADDR(prAdapter->rWlanInfo.arScanResult[i].arMacAddress, rMacAddr); - COPY_SSID(prAdapter->rWlanInfo.arScanResult[i].rSsid.aucSsid, - prAdapter->rWlanInfo.arScanResult[i].rSsid.u4SsidLen, - prSsid->aucSsid, - prSsid->u4SsidLen); - prAdapter->rWlanInfo.arScanResult[i].u4Privacy = u4Privacy; - prAdapter->rWlanInfo.arScanResult[i].rRssi = rRssi; - prAdapter->rWlanInfo.arScanResult[i].eNetworkTypeInUse = eNetworkType; - kalMemCopy(&(prAdapter->rWlanInfo.arScanResult[i].rConfiguration), - prConfiguration, - sizeof(PARAM_802_11_CONFIG_T)); - prAdapter->rWlanInfo.arScanResult[i].eOpMode = eOpMode; - kalMemCopy((prAdapter->rWlanInfo.arScanResult[i].rSupportedRates), - rSupportedRates, - sizeof(PARAM_RATES_EX)); - prAdapter->rWlanInfo.arScanResult[i].u4IELength = (UINT_32)u2IELength; - - if(u2IELength > 0) { - // IE - allocate buffer and update pointer - if(ALIGN_4(u2IELength) + prAdapter->rWlanInfo.u4ScanIEBufferUsage <= u4BufferSize) { - kalMemCopy(&(prAdapter->rWlanInfo.aucScanIEBuf[prAdapter->rWlanInfo.u4ScanIEBufferUsage]), - pucIEBuf, - u2IELength); - - prAdapter->rWlanInfo.apucScanResultIEs[i] = - &(prAdapter->rWlanInfo.aucScanIEBuf[prAdapter->rWlanInfo.u4ScanIEBufferUsage]); - - prAdapter->rWlanInfo.u4ScanIEBufferUsage += ALIGN_4(u2IELength); - } - else { - // buffer is not enough - prAdapter->rWlanInfo.arScanResult[i].u4Length -= u2IELength; - prAdapter->rWlanInfo.arScanResult[i].u4IELength = 0; - prAdapter->rWlanInfo.apucScanResultIEs[i] = NULL; - } - } - else { - prAdapter->rWlanInfo.apucScanResultIEs[i] = NULL; - } - } - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is invoked to free IE buffer for dedicated scan result -* -* @param prAdapter Pointer to the Adapter structure. -* @param u4Idx Index of Scan Result -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicFreeScanResultIE ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Idx - ) -{ - UINT_32 i; - PUINT_8 pucPivot, pucMovePivot; - UINT_32 u4MoveSize, u4FreeSize, u4ReserveSize; - - ASSERT(prAdapter); - ASSERT(u4Idx < CFG_MAX_NUM_BSS_LIST); - - if(prAdapter->rWlanInfo.arScanResult[u4Idx].u4IELength == 0 - || prAdapter->rWlanInfo.apucScanResultIEs[u4Idx] == NULL) { - return; - } - - u4FreeSize = ALIGN_4(prAdapter->rWlanInfo.arScanResult[u4Idx].u4IELength); - - pucPivot = prAdapter->rWlanInfo.apucScanResultIEs[u4Idx]; - pucMovePivot = (PUINT_8)((UINT_32)(prAdapter->rWlanInfo.apucScanResultIEs[u4Idx]) + u4FreeSize); - - u4ReserveSize = ((UINT_32)pucPivot) - (UINT_32)(&(prAdapter->rWlanInfo.aucScanIEBuf[0])); - u4MoveSize = prAdapter->rWlanInfo.u4ScanIEBufferUsage - u4ReserveSize - u4FreeSize; - - // 1. rest of buffer to move forward - kalMemCopy(pucPivot, pucMovePivot, u4MoveSize); - - // 1.1 modify pointers - for(i = 0 ; i < prAdapter->rWlanInfo.u4ScanResultNum ; i++) { - if(i != u4Idx) { - if(prAdapter->rWlanInfo.apucScanResultIEs[i] >= pucMovePivot) { - prAdapter->rWlanInfo.apucScanResultIEs[i] = - (PUINT_8)((UINT_32)(prAdapter->rWlanInfo.apucScanResultIEs[i]) - u4FreeSize); - } - } - } - - // 1.2 reset the freed one - prAdapter->rWlanInfo.arScanResult[u4Idx].u4IELength = 0; - prAdapter->rWlanInfo.apucScanResultIEs[i] = NULL; - - // 2. reduce IE buffer usage - prAdapter->rWlanInfo.u4ScanIEBufferUsage -= u4FreeSize; - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is to hack parameters for WLAN TABLE for -* fixed rate settings -* -* @param prAdapter Pointer to the Adapter structure. -* @param eRateSetting -* @param pu2DesiredNonHTRateSet, -* @param pu2BSSBasicRateSet, -* @param pucMcsSet -* @param pucSupMcs32 -* @param pu2HtCapInfo -* -* @return WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicUpdateRateParams ( - IN P_ADAPTER_T prAdapter, - IN ENUM_REGISTRY_FIXED_RATE_T eRateSetting, - IN PUINT_8 pucDesiredPhyTypeSet, - IN PUINT_16 pu2DesiredNonHTRateSet, - IN PUINT_16 pu2BSSBasicRateSet, - IN PUINT_8 pucMcsSet, - IN PUINT_8 pucSupMcs32, - IN PUINT_16 pu2HtCapInfo - ) -{ - ASSERT(prAdapter); - ASSERT(eRateSetting > FIXED_RATE_NONE && eRateSetting < FIXED_RATE_NUM); - - switch(prAdapter->rWifiVar.eRateSetting) { - case FIXED_RATE_1M: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HR_DSSS; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_1M; - *pu2BSSBasicRateSet = RATE_SET_BIT_1M; - *pucMcsSet = 0; - *pucSupMcs32 = 0; - *pu2HtCapInfo = 0; - break; - - case FIXED_RATE_2M: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HR_DSSS; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_2M; - *pu2BSSBasicRateSet = RATE_SET_BIT_2M; - *pucMcsSet = 0; - *pucSupMcs32 = 0; - *pu2HtCapInfo = 0; - break; - - case FIXED_RATE_5_5M: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HR_DSSS; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_5_5M; - *pu2BSSBasicRateSet = RATE_SET_BIT_5_5M; - *pucMcsSet = 0; - *pucSupMcs32 = 0; - *pu2HtCapInfo = 0; - break; - - case FIXED_RATE_11M: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HR_DSSS; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_11M; - *pu2BSSBasicRateSet = RATE_SET_BIT_11M; - *pucMcsSet = 0; - *pucSupMcs32 = 0; - *pu2HtCapInfo = 0; - break; - - case FIXED_RATE_6M: - if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_ERP) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_ERP; - } - else if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_OFDM) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_OFDM; - } - - *pu2DesiredNonHTRateSet = RATE_SET_BIT_6M; - *pu2BSSBasicRateSet = RATE_SET_BIT_6M; - *pucMcsSet = 0; - *pucSupMcs32 = 0; - *pu2HtCapInfo = 0; - break; - - case FIXED_RATE_9M: - if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_ERP) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_ERP; - } - else if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_OFDM) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_OFDM; - } - - *pu2DesiredNonHTRateSet = RATE_SET_BIT_9M; - *pu2BSSBasicRateSet = RATE_SET_BIT_9M; - *pucMcsSet = 0; - *pucSupMcs32 = 0; - *pu2HtCapInfo = 0; - break; - - case FIXED_RATE_12M: - if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_ERP) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_ERP; - } - else if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_OFDM) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_OFDM; - } - - *pu2DesiredNonHTRateSet = RATE_SET_BIT_12M; - *pu2BSSBasicRateSet = RATE_SET_BIT_12M; - *pucMcsSet = 0; - *pucSupMcs32 = 0; - *pu2HtCapInfo = 0; - break; - - case FIXED_RATE_18M: - if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_ERP) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_ERP; - } - else if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_OFDM) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_OFDM; - } - - *pu2DesiredNonHTRateSet = RATE_SET_BIT_18M; - *pu2BSSBasicRateSet = RATE_SET_BIT_18M; - *pucMcsSet = 0; - *pucSupMcs32 = 0; - *pu2HtCapInfo = 0; - break; - - case FIXED_RATE_24M: - if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_ERP) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_ERP; - } - else if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_OFDM) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_OFDM; - } - - *pu2DesiredNonHTRateSet = RATE_SET_BIT_24M; - *pu2BSSBasicRateSet = RATE_SET_BIT_24M; - *pucMcsSet = 0; - *pucSupMcs32 = 0; - *pu2HtCapInfo = 0; - break; - - case FIXED_RATE_36M: - if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_ERP) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_ERP; - } - else if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_OFDM) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_OFDM; - } - - *pu2DesiredNonHTRateSet = RATE_SET_BIT_36M; - *pu2BSSBasicRateSet = RATE_SET_BIT_36M; - *pucMcsSet = 0; - *pucSupMcs32 = 0; - *pu2HtCapInfo = 0; - break; - - case FIXED_RATE_48M: - if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_ERP) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_ERP; - } - else if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_OFDM) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_OFDM; - } - - *pu2DesiredNonHTRateSet = RATE_SET_BIT_48M; - *pu2BSSBasicRateSet = RATE_SET_BIT_48M; - *pucMcsSet = 0; - *pucSupMcs32 = 0; - *pu2HtCapInfo = 0; - break; - - case FIXED_RATE_54M: - if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_ERP) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_ERP; - } - else if((*pucDesiredPhyTypeSet) | PHY_TYPE_BIT_OFDM) { - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_OFDM; - } - - *pu2DesiredNonHTRateSet = RATE_SET_BIT_54M; - *pu2BSSBasicRateSet = RATE_SET_BIT_54M; - *pucMcsSet = 0; - *pucSupMcs32 = 0; - *pu2HtCapInfo = 0; - break; - - case FIXED_RATE_MCS0_20M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS0_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - break; - - case FIXED_RATE_MCS1_20M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS1_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - break; - - case FIXED_RATE_MCS2_20M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS2_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - break; - - case FIXED_RATE_MCS3_20M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS3_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - break; - - case FIXED_RATE_MCS4_20M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS4_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - break; - - case FIXED_RATE_MCS5_20M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS5_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - break; - - case FIXED_RATE_MCS6_20M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS6_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - break; - - case FIXED_RATE_MCS7_20M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS7_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - break; - - case FIXED_RATE_MCS0_20M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS0_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SHORT_GI_20M; - break; - - case FIXED_RATE_MCS1_20M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS1_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SHORT_GI_20M; - break; - - case FIXED_RATE_MCS2_20M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS2_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SHORT_GI_20M; - break; - - case FIXED_RATE_MCS3_20M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS3_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SHORT_GI_20M; - break; - - case FIXED_RATE_MCS4_20M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS4_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SHORT_GI_20M; - break; - - case FIXED_RATE_MCS5_20M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS5_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SHORT_GI_20M; - break; - - case FIXED_RATE_MCS6_20M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS6_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SHORT_GI_20M; - break; - - case FIXED_RATE_MCS7_20M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS7_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SHORT_GI_20M; - break; - - case FIXED_RATE_MCS0_40M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS0_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SUP_CHNL_WIDTH; - break; - - case FIXED_RATE_MCS1_40M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS1_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SUP_CHNL_WIDTH; - break; - - case FIXED_RATE_MCS2_40M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS2_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SUP_CHNL_WIDTH; - break; - - case FIXED_RATE_MCS3_40M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS3_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SUP_CHNL_WIDTH; - break; - - case FIXED_RATE_MCS4_40M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS4_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SUP_CHNL_WIDTH; - break; - - case FIXED_RATE_MCS5_40M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS5_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SUP_CHNL_WIDTH; - break; - - case FIXED_RATE_MCS6_40M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS6_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SUP_CHNL_WIDTH; - break; - - case FIXED_RATE_MCS7_40M_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS7_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SUP_CHNL_WIDTH; - break; - - case FIXED_RATE_MCS32_800NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS32_INDEX; - *pucSupMcs32 = 1; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_SHORT_GI_40M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= HT_CAP_INFO_SUP_CHNL_WIDTH; - break; - - case FIXED_RATE_MCS0_40M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS0_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= (HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M); - break; - - case FIXED_RATE_MCS1_40M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS1_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= (HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M); - break; - - case FIXED_RATE_MCS2_40M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS2_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= (HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M); - break; - - case FIXED_RATE_MCS3_40M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS3_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= (HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M); - break; - - case FIXED_RATE_MCS4_40M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS4_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= (HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M); - break; - - case FIXED_RATE_MCS5_40M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS5_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= (HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M); - break; - - case FIXED_RATE_MCS6_40M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS6_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= (HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M); - break; - - case FIXED_RATE_MCS7_40M_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS7_INDEX; - *pucSupMcs32 = 0; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= (HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M); - break; - - case FIXED_RATE_MCS32_400NS: - *pucDesiredPhyTypeSet = PHY_TYPE_BIT_HT; - *pu2DesiredNonHTRateSet = RATE_SET_BIT_HT_PHY; - *pu2BSSBasicRateSet = RATE_SET_BIT_HT_PHY; - *pucMcsSet = HT_RATE_MCS32_INDEX; - *pucSupMcs32 = 1; - (*pu2HtCapInfo) &= ~(HT_CAP_INFO_SHORT_GI_20M - | HT_CAP_INFO_HT_GF); - (*pu2HtCapInfo) |= (HT_CAP_INFO_SUP_CHNL_WIDTH - | HT_CAP_INFO_SHORT_GI_40M); - break; - - default: - ASSERT(0); - } - - return WLAN_STATUS_SUCCESS; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to write the register -* -* @param u4Address Register address -* u4Value the value to be written -* -* @retval WLAN_STATUS_SUCCESS -* WLAN_STATUS_FAILURE -*/ -/*----------------------------------------------------------------------------*/ - -WLAN_STATUS -nicWriteMcr ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4Address, - IN UINT_32 u4Value - ) -{ - CMD_ACCESS_REG rCmdAccessReg; - - rCmdAccessReg.u4Address = u4Address; - rCmdAccessReg.u4Data = u4Value; - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_ACCESS_REG, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_ACCESS_REG), - (PUINT_8)&rCmdAccessReg, - NULL, - 0 - ); - -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to modify the auto rate parameters -* -* @param u4ArSysParam0 see description below -* u4ArSysParam1 -* u4ArSysParam2 -* u4ArSysParam3 -* -* -* @retval WLAN_STATUS_SUCCESS -* WLAN_STATUS_FAILURE -* -* @note -* ArSysParam0[0:3] -> auto rate version (0:disable 1:version1 2:version2) -* ArSysParam0[4:5]-> auto bw version (0:disable 1:version1 2:version2) -* ArSysParam0[6:7]-> auto gi version (0:disable 1:version1 2:version2) -* ArSysParam0[8:15]-> HT rate clear mask -* ArSysParam0[16:31]-> Legacy rate clear mask -* ArSysParam1[0:7]-> Auto Rate check weighting window -* ArSysParam1[8:15]-> Auto Rate v1 Force Rate down -* ArSysParam1[16:23]-> Auto Rate v1 PerH -* ArSysParam1[24:31]-> Auto Rate v1 PerL -* -* Examples -* ArSysParam0 = 1, -* Enable auto rate version 1 -* -* ArSysParam0 = 983041, -* Enable auto rate version 1 -* Remove CCK 1M, 2M, 5.5M, 11M -* -* ArSysParam0 = 786433 -* Enable auto rate version 1 -* Remove CCK 5.5M 11M -*/ -/*----------------------------------------------------------------------------*/ - - -WLAN_STATUS -nicRlmArUpdateParms( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4ArSysParam0, - IN UINT_32 u4ArSysParam1, - IN UINT_32 u4ArSysParam2, - IN UINT_32 u4ArSysParam3 - ) -{ - UINT_8 ucArVer,ucAbwVer,ucAgiVer; - UINT_16 u2HtClrMask; - UINT_16 u2LegacyClrMask; - UINT_8 ucArCheckWindow; - UINT_8 ucArPerL; - UINT_8 ucArPerH; - UINT_8 ucArPerForceRateDownPer; - - ucArVer = (UINT_8)(u4ArSysParam0 & BITS(0,3)); - ucAbwVer = (UINT_8)((u4ArSysParam0 & BITS(4,5)) >>4); - ucAgiVer = (UINT_8)((u4ArSysParam0 & BITS(6,7)) >>6); - u2HtClrMask = (UINT_16) ((u4ArSysParam0 & BITS(8,15)) >> 8); - u2LegacyClrMask = (UINT_16) ((u4ArSysParam0 & BITS(16,31)) >> 16); - -#if 0 - ucArCheckWindow = (UINT_8) (u4ArSysParam1 & BITS(0,7)); - ucArPerForceRateDownPer = (UINT_8) ((u4ArSysParam1 & BITS(8,15)>>8)); - ucArPerH = (UINT_8) ((u4ArSysParam1 & BITS(16,23)) >>16); - ucArPerL = (UINT_8) ((u4ArSysParam1 & BITS(24,31)) >>24); -#endif - - ucArCheckWindow = (UINT_8) (u4ArSysParam1 & BITS(0,7)); - ucArPerForceRateDownPer = (UINT_8) (((u4ArSysParam1>>8) & BITS(0,7))); - ucArPerH = (UINT_8) (((u4ArSysParam1>>16) & BITS(0,7))); - ucArPerL = (UINT_8) (((u4ArSysParam1>>24) & BITS(0,7))); - - - DBGLOG(INIT, INFO, ("ArParam %u %u %u %u\n", u4ArSysParam0, u4ArSysParam1, u4ArSysParam2, u4ArSysParam3)); - DBGLOG(INIT, INFO, ("ArVer %u AbwVer %u AgiVer %u\n", ucArVer, ucAbwVer, ucAgiVer)); - DBGLOG(INIT, INFO, ("HtMask %x LegacyMask %x\n", u2HtClrMask, u2LegacyClrMask)); - DBGLOG(INIT, INFO, ("CheckWin %u RateDownPer %u PerH %u PerL %u\n", ucArCheckWindow, ucArPerForceRateDownPer, ucArPerH, ucArPerL)); - -#define SWCR_DATA_ADDR(MOD,ADDR) (0x90000000+(MOD<<8)+(ADDR)) -#define SWCR_DATA_CMD(CATE,WRITE,INDEX,OPT0,OPT1) ( (CATE<<24) | (WRITE<<23) | (INDEX<<16) | (OPT0 <<8) | OPT1 ) -#define SWCR_DATA0 0x0 -#define SWCR_DATA1 0x4 -#define SWCR_DATA2 0x8 -#define SWCR_DATA3 0xC -#define SWCR_DATA4 0x10 -#define SWCR_WRITE 1 -#define SWCR_READ 0 - - if(ucArVer > 0) { - /* dummy = WiFi.WriteMCR(&h90000104, &h00000001) */ - /* dummy = WiFi.WriteMCR(&h90000100, &h00850000)*/ - - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA1),1); - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA0),SWCR_DATA_CMD(0,SWCR_WRITE,5,0,0)); - } - else { - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA1),0); - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA0),SWCR_DATA_CMD(0,SWCR_WRITE,5,0,0)) ; - } - - /* ucArVer 0: none 1:PER 2:Rcpi */ - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA1),ucArVer); - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA0),SWCR_DATA_CMD(0,SWCR_WRITE,7,0,0)); - - /* Candidate rate Ht mask */ - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA1),u2HtClrMask); - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA0),SWCR_DATA_CMD(0,SWCR_WRITE,0x1c,0,0)); - - /* Candidate rate legacy mask */ - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA1),u2LegacyClrMask); - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA0),SWCR_DATA_CMD(0,SWCR_WRITE,0x1d,0,0)); - -#if 0 - if(ucArCheckWindow!=0) { - /* TX DONE MCS INDEX CHECK STA RATE DOWN TH */ - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA1),ucArCheckWindow); - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA0),SWCR_DATA_CMD(0,SWCR_WRITE,0x14,0,0)); - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA1),ucArCheckWindow); - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA0),SWCR_DATA_CMD(0,SWCR_WRITE,0xc,0,0)); - } - - if(ucArPerForceRateDownPer !=0) { - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA1),ucArPerForceRateDownPer); - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA0),SWCR_DATA_CMD(0,SWCR_WRITE,0x18,0,0)); - } - if(ucArPerH !=0) { - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA1),ucArPerH); - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA0),SWCR_DATA_CMD(0,SWCR_WRITE,0x1,0,0)); - } - if(ucArPerL !=0) { - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA1),ucArPerL); - nicWriteMcr (prAdapter, SWCR_DATA_ADDR(1/*MOD*/,SWCR_DATA0),SWCR_DATA_CMD(0,SWCR_WRITE,0x2,0,0)); - } -#endif - - - - return WLAN_STATUS_SUCCESS; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This utility function is used to enable roaming -* -* @param u4EnableRoaming -* -* -* @retval WLAN_STATUS_SUCCESS -* WLAN_STATUS_FAILURE -* -* @note -* u4EnableRoaming -> Enable Romaing -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicRoamingUpdateParams( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4EnableRoaming - ) -{ - P_CONNECTION_SETTINGS_T prConnSettings; - - prConnSettings = &(prAdapter->rWifiVar.rConnSettings); - prConnSettings->fgIsEnableRoaming = ((u4EnableRoaming>0)?(TRUE):(FALSE)); - - return WLAN_STATUS_SUCCESS; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief dump firmware Assert message -* -* \param[in] -* prAdapter -* -* \return -* TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicPrintFirmwareAssertInfo( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_32 u4MailBox0, u4MailBox1; - UINT_32 line = 0; - UINT_8 aucAssertFile[7]; - UINT_32 u4ChipId; - -#if CFG_SDIO_INTR_ENHANCE - u4MailBox0 = prAdapter->prSDIOCtrl->u4RcvMailbox0; - u4MailBox1 = prAdapter->prSDIOCtrl->u4RcvMailbox1; -#else - nicGetMailbox(prAdapter, 0, &u4MailBox0); - nicGetMailbox(prAdapter, 1, &u4MailBox1); -#endif - - line = u4MailBox0 & 0x0000FFFF; - - u4MailBox0 = ((u4MailBox0 >> 16) & 0x0000FFFF); - - kalMemCopy(&aucAssertFile[0], &u4MailBox0, 2); - kalMemCopy(&aucAssertFile[2], &u4MailBox1, 4); - - aucAssertFile[6] = '\0'; - -#if defined(MT6620) - u4ChipId = 6620; -#elif defined(MT5931) - u4ChipId = 5931; -#elif defined(MT6628) - u4ChipId = 6628; -#endif - - kalPrint("\n[MT%ld][wifi][Firmware] Assert at \"%s\" #%ld\n\n", - u4ChipId, - aucAssertFile, - line); - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to update Link Quality information -* -* @param prAdapter Pointer of Adapter Data Structure -* eNetTypeIdx -* prEventLinkQuality -* cRssi -* cLinkQuality -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicUpdateLinkQuality( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx, - IN P_EVENT_LINK_QUALITY prEventLinkQuality - ) -{ - ASSERT(prAdapter); - ASSERT(eNetTypeIdx < NETWORK_TYPE_INDEX_NUM); - ASSERT(prEventLinkQuality); - - switch(eNetTypeIdx) { - case NETWORK_TYPE_AIS_INDEX: - if(prAdapter->rWifiVar.arBssInfo[eNetTypeIdx].eConnectionState == PARAM_MEDIA_STATE_CONNECTED) { - /* check is to prevent RSSI to be updated by incorrect initial RSSI from hardware */ - /* buffer statistics for further query */ - if(prAdapter->fgIsLinkQualityValid == FALSE - || (kalGetTimeTick() - prAdapter->rLinkQualityUpdateTime) > CFG_LINK_QUALITY_VALID_PERIOD) { - nicUpdateRSSI(prAdapter, eNetTypeIdx, prEventLinkQuality->cRssi, prEventLinkQuality->cLinkQuality); - } - - if(prAdapter->fgIsLinkRateValid == FALSE - || (kalGetTimeTick() - prAdapter->rLinkRateUpdateTime) > CFG_LINK_QUALITY_VALID_PERIOD) { - nicUpdateLinkSpeed(prAdapter, eNetTypeIdx, prEventLinkQuality->u2LinkSpeed); - } - } - break; -#if CFG_ENABLE_WIFI_DIRECT && CFG_SUPPORT_P2P_RSSI_QUERY - case NETWORK_TYPE_P2P_INDEX: - if (prAdapter->fgIsP2pLinkQualityValid == FALSE - || (kalGetTimeTick() - prAdapter->rP2pLinkQualityUpdateTime) > CFG_LINK_QUALITY_VALID_PERIOD) { - P_EVENT_LINK_QUALITY_EX prEventLQEx = (P_EVENT_LINK_QUALITY_EX)prEventLinkQuality; - - nicUpdateRSSI(prAdapter, NETWORK_TYPE_P2P_INDEX, prEventLQEx->cRssiP2P, prEventLQEx->cLinkQualityP2P); - } - break; -#endif - default: - break; - - } - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to update RSSI and Link Quality information -* -* @param prAdapter Pointer of Adapter Data Structure -* eNetTypeIdx -* cRssi -* cLinkQuality -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicUpdateRSSI( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx, - IN INT_8 cRssi, - IN INT_8 cLinkQuality - ) -{ - ASSERT(prAdapter); - ASSERT(eNetTypeIdx < NETWORK_TYPE_INDEX_NUM); - - switch(eNetTypeIdx) { - case NETWORK_TYPE_AIS_INDEX: - if(prAdapter->rWifiVar.arBssInfo[eNetTypeIdx].eConnectionState == PARAM_MEDIA_STATE_CONNECTED) { - prAdapter->fgIsLinkQualityValid = TRUE; - prAdapter->rLinkQualityUpdateTime = kalGetTimeTick(); - - prAdapter->rLinkQuality.cRssi = cRssi; - prAdapter->rLinkQuality.cLinkQuality = cLinkQuality; - - /* indicate to glue layer */ - kalUpdateRSSI(prAdapter->prGlueInfo, - KAL_NETWORK_TYPE_AIS_INDEX, - prAdapter->rLinkQuality.cRssi, - prAdapter->rLinkQuality.cLinkQuality); - } - - break; -#if CFG_ENABLE_WIFI_DIRECT -#if CFG_SUPPORT_P2P_RSSI_QUERY - case NETWORK_TYPE_P2P_INDEX: - prAdapter->fgIsP2pLinkQualityValid = TRUE; - prAdapter->rP2pLinkQualityUpdateTime = kalGetTimeTick(); - - prAdapter->rP2pLinkQuality.cRssi= cRssi; - prAdapter->rP2pLinkQuality.cLinkQuality= cLinkQuality; - - kalUpdateRSSI(prAdapter->prGlueInfo, - KAL_NETWORK_TYPE_P2P_INDEX, - cRssi, - cLinkQuality); - break; -#endif -#endif - default: - break; - - } - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called to update Link Quality information -* -* @param prAdapter Pointer of Adapter Data Structure -* eNetTypeIdx -* prEventLinkQuality -* cRssi -* cLinkQuality -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicUpdateLinkSpeed( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx, - IN UINT_16 u2LinkSpeed - ) -{ - ASSERT(prAdapter); - ASSERT(eNetTypeIdx < NETWORK_TYPE_INDEX_NUM); - - switch(eNetTypeIdx) { - case NETWORK_TYPE_AIS_INDEX: - if(prAdapter->rWifiVar.arBssInfo[eNetTypeIdx].eConnectionState == PARAM_MEDIA_STATE_CONNECTED) { - /* buffer statistics for further query */ - prAdapter->fgIsLinkRateValid = TRUE; - prAdapter->rLinkRateUpdateTime = kalGetTimeTick(); - - prAdapter->rLinkQuality.u2LinkSpeed = u2LinkSpeed; - } - break; - - default: - break; - - } - - return; -} - -#if CFG_SUPPORT_RDD_TEST_MODE -WLAN_STATUS -nicUpdateRddTestMode( - IN P_ADAPTER_T prAdapter, - IN P_CMD_RDD_CH_T prRddChParam - ) -{ - DEBUGFUNC("nicUpdateRddTestMode.\n"); - - ASSERT(prAdapter); - -// aisFsmScanRequest(prAdapter, NULL); - - return wlanSendSetQueryCmd(prAdapter, - CMD_ID_SET_RDD_CH, - TRUE, - FALSE, - FALSE, - NULL, - NULL, - sizeof(CMD_RDD_CH_T), - (PUINT_8)prRddChParam, - NULL, - 0); -} -#endif - diff --git a/drivers/net/wireless/mt5931/nic/nic_cmd_event.c b/drivers/net/wireless/mt5931/nic/nic_cmd_event.c deleted file mode 100755 index c9743946d88c..000000000000 --- a/drivers/net/wireless/mt5931/nic/nic_cmd_event.c +++ /dev/null @@ -1,1651 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/nic/nic_cmd_event.c#1 $ -*/ - -/*! \file nic_cmd_event.c - \brief Callback functions for Command packets. - - Various Event packet handlers which will be setup in the callback function of - a command packet. -*/ - - - -/* -** $Log: nic_cmd_event.c $ - * - * 04 10 2012 yuche.tsai - * NULL - * Update address for wifi direct connection issue. - * - * 06 15 2011 cm.chang - * [WCXRP00000785] [MT6620 Wi-Fi][Driver][FW] P2P/BOW MAC address is XOR with AIS MAC address - * P2P/BOW mac address XOR with local bit instead of OR - * - * 03 05 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * add the code to get the check rsponse and indicate to app. - * - * 03 02 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * Add security check code. - * - * 02 24 2011 cp.wu - * [WCXRP00000493] [MT6620 Wi-Fi][Driver] Do not indicate redundant disconnection to host when entering into RF test mode - * only indicate DISCONNECTION to host when entering RF test if necessary (connected -> disconnected cases) - * - * 01 20 2011 eddie.chen - * [WCXRP00000374] [MT6620 Wi-Fi][DRV] SW debug control - * Add Oid for sw control debug command - * - * 12 31 2010 cp.wu - * [WCXRP00000335] [MT6620 Wi-Fi][Driver] change to use milliseconds sleep instead of delay to avoid blocking to system scheduling - * change to use msleep() and shorten waiting interval to reduce blocking to other task while Wi-Fi driver is being loaded - * - * 12 01 2010 cp.wu - * [WCXRP00000223] MT6620 Wi-Fi][Driver][FW] Adopt NVRAM parameters when enter/exit RF test mode - * reload NVRAM settings before entering RF test mode and leaving from RF test mode. - * - * 11 01 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module - * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead - * 2) Remove CNM CH-RECOVER event handling - * 3) cfg read/write API renamed with kal prefix for unified naming rules. - * - * 10 20 2010 cp.wu - * [WCXRP00000117] [MT6620 Wi-Fi][Driver] Add logic for suspending driver when MT6620 is not responding anymore - * use OID_CUSTOM_TEST_MODE as indication for driver reset - * by dropping pending TX packets - * - * 10 18 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android - * complete implementation of Android NVRAM access - * - * 09 21 2010 cp.wu - * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated - * Do a complete reset with STA-REC null checking for RF test re-entry - * - * 09 15 2010 yuche.tsai - * NULL - * Start to test AT GO only when P2P state is not IDLE. - * - * 09 09 2010 yuche.tsai - * NULL - * Add AT GO Test mode after MAC address available. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 30 2010 cp.wu - * NULL - * eliminate klockwork errors - * - * 08 16 2010 cp.wu - * NULL - * Replace CFG_SUPPORT_BOW by CFG_ENABLE_BT_OVER_WIFI. - * There is no CFG_SUPPORT_BOW in driver domain source. - * - * 08 12 2010 cp.wu - * NULL - * [AIS-FSM] honor registry setting for adhoc running mode. (A/B/G) - * - * 08 11 2010 yuche.tsai - * NULL - * Add support for P2P Device Address query from FW. - * - * 08 03 2010 cp.wu - * NULL - * Centralize mgmt/system service procedures into independent calls. - * - * 08 02 2010 cp.wu - * NULL - * reset FSMs before entering RF test mode. - * - * 07 22 2010 cp.wu - * - * 1) refine AIS-FSM indent. - * 2) when entering RF Test mode, flush 802.1X frames as well - * 3) when entering D3 state, flush 802.1X frames as well - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 05 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) change fake BSS_DESC from channel 6 to channel 1 due to channel switching is not done yet. - * 2) after MAC address is queried from firmware, all related variables in driver domain should be updated as well - * - * 06 21 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * remove duplicate variable for migration. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 29 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * change upon request: indicate as disconnected in driver domain when leaving from RF test mode - * - * 05 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * do not clear scanning list array after disassociation - * - * 05 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) disable NETWORK_LAYER_ADDRESSES handling temporally. - * 2) finish statistics OIDs - * - * 05 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * change OID behavior to meet WHQL requirement. - * - * 05 20 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) integrate OID_GEN_NETWORK_LAYER_ADDRESSES with CMD_ID_SET_IP_ADDRESS - * 2) buffer statistics data for 2 seconds - * 3) use default value for adhoc parameters instead of 0 - * - * 05 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) do not take timeout mechanism for power mode oids - * 2) retrieve network type from connection status - * 3) after disassciation, set radio state to off - * 4) TCP option over IPv6 is supported - * - * 05 17 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct OID_802_11_DISASSOCIATE handling. - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * 1) add timeout handler mechanism for pending command packets - * 2) add p2p add/removal key - * - * 04 16 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * treat BUS access failure as kind of card removal. - * - * 04 14 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * information buffer for query oid/ioctl is now buffered in prCmdInfo - * * * * * * instead of glue-layer variable to improve multiple oid/ioctl capability - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * * * * * * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * * * * * * * * * * * * 2) command sequence number is now increased atomically - * * * * * * * * * * * * * * 3) private data could be hold and taken use for other purpose - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * accessing to firmware load/start address, and access to OID handling information - * are now handled in glue layer - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * rWlanInfo should be placed at adapter rather than glue due to most operations - * * * * are done in adapter layer. - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add KAL API: kalFlushPendingTxPackets(), and take use of the API - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access to prGlueInfo->rWlanInfo.eLinkAttr.ucMediaStreamMode from non-glue layer. - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * improve none-glude code portability - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * sync statistics data structure definition with firmware implementation - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * code refine: fgTestMode should be at adapter rather than glue due to the device/fw is also involved - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access for prGlueInfo->fgIsCardRemoved in non-glue layer - * - * 03 30 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * statistics information OIDs are now handled by querying from firmware domain - * - * 03 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * indicate media stream mode after set is done - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port - * - * 03 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement custom OID: EEPROM read/write access - * - * 03 03 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement OID_802_3_MULTICAST_LIST oid handling - * - * 02 25 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * limit RSSI return value to microsoft defined range. - * - * 02 09 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. Permanent and current MAC address are now retrieved by CMD/EVENT packets instead of hard-coded address - * * * * * * * 2. follow MSDN defined behavior when associates to another AP - * * * * * * * 3. for firmware download, packet size could be up to 2048 bytes - * - * 01 29 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * block until firmware finished RF test enter/leave then indicate completion to upper layer - * - * 01 29 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * when entering RF test mode and leaving from RF test mode, wait for W_FUNC_RDY bit to be asserted forever until it is set or card is removed. - * - * 01 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. eliminate improper variable in rHifInfo - * * * * * * * * 2. block TX/ordinary OID when RF test mode is engaged - * * * * * * * * 3. wait until firmware finish operation when entering into and leaving from RF test mode - * * * * * * * * 4. correct some HAL implementation - * - * 01 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Under WinXP with SDIO, use prGlueInfo->rHifInfo.pvInformationBuffer instead of prGlueInfo->pvInformationBuffer - * - * 01 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement following 802.11 OIDs: - * * * * * OID_802_11_RSSI, - * * * * * OID_802_11_RSSI_TRIGGER, - * * * * * OID_802_11_STATISTICS, - * * * * * OID_802_11_DISASSOCIATE, - * * * * * OID_802_11_POWER_MODE - * - * 01 21 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement OID_802_11_MEDIA_STREAM_MODE - * - * 12 30 2009 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) According to CMD/EVENT documentation v0.8, - * * * * * * * * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used, - * * * * * * * * and result is retrieved by get ATInfo instead - * * * * * * * * 2) add 4 counter for recording aggregation statistics -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-12-10 16:47:47 GMT mtk02752 -** only handle MCR read when accessing FW domain register -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-12-08 17:37:28 GMT mtk02752 -** * refine nicCmdEventQueryMcrRead -** + add TxStatus/RxStatus for RF test QueryInformation OIDs -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-12-02 22:05:45 GMT mtk02752 -** kalOidComplete() will decrease i4OidPendingCount -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-12-01 23:02:57 GMT mtk02752 -** remove unnecessary spin locks -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-12-01 22:51:18 GMT mtk02752 -** maintein i4OidPendingCount -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-11-30 10:55:03 GMT mtk02752 -** modify for compatibility -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-11-23 14:46:32 GMT mtk02752 -** add another version of command-done handler upon new event structure -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-04-29 15:42:33 GMT mtk01461 -** Add comment -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-04-21 19:32:42 GMT mtk01461 -** Add nicCmdEventSetCommon() for general set OID -** \main\maintrunk.MT6620WiFiDriver_Prj\1 2009-04-21 01:40:35 GMT mtk01461 -** Command Done Handler -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -VOID -nicCmdEventQueryMcrRead ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - UINT_32 u4QueryInfoLen; - P_PARAM_CUSTOM_MCR_RW_STRUC_T prMcrRdInfo; - P_GLUE_INFO_T prGlueInfo; - P_CMD_ACCESS_REG prCmdAccessReg; - - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - ASSERT(pucEventBuf); - - //4 <2> Update information of OID - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - prCmdAccessReg = (P_CMD_ACCESS_REG)(pucEventBuf); - - u4QueryInfoLen = sizeof(PARAM_CUSTOM_MCR_RW_STRUC_T); - - prMcrRdInfo = (P_PARAM_CUSTOM_MCR_RW_STRUC_T) prCmdInfo->pvInformationBuffer; - prMcrRdInfo->u4McrOffset = prCmdAccessReg->u4Address; - prMcrRdInfo->u4McrData = prCmdAccessReg->u4Data; - - kalOidComplete(prGlueInfo, prCmdInfo->fgSetQuery, u4QueryInfoLen, WLAN_STATUS_SUCCESS); - } - - return; - -} - - -VOID -nicCmdEventQuerySwCtrlRead ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - UINT_32 u4QueryInfoLen; - P_PARAM_CUSTOM_SW_CTRL_STRUC_T prSwCtrlInfo; - P_GLUE_INFO_T prGlueInfo; - P_CMD_SW_DBG_CTRL_T prCmdSwCtrl; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - ASSERT(pucEventBuf); - - //4 <2> Update information of OID - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - prCmdSwCtrl = (P_CMD_SW_DBG_CTRL_T)(pucEventBuf); - - u4QueryInfoLen = sizeof(PARAM_CUSTOM_SW_CTRL_STRUC_T); - - prSwCtrlInfo = (P_PARAM_CUSTOM_SW_CTRL_STRUC_T) prCmdInfo->pvInformationBuffer; - prSwCtrlInfo->u4Id = prCmdSwCtrl->u4Id; - prSwCtrlInfo->u4Data = prCmdSwCtrl->u4Data; - - kalOidComplete(prGlueInfo, prCmdInfo->fgSetQuery, u4QueryInfoLen, WLAN_STATUS_SUCCESS); - } - - return; - -} - - - -VOID -nicCmdEventSetCommon ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - if (prCmdInfo->fgIsOid) { - /* Update Set Infomation Length */ - kalOidComplete(prAdapter->prGlueInfo, - prCmdInfo->fgSetQuery, - prCmdInfo->u4InformationBufferLength, - WLAN_STATUS_SUCCESS); - } - - return; -} - -VOID -nicCmdEventSetDisassociate ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - if (prCmdInfo->fgIsOid) { - /* Update Set Infomation Length */ - kalOidComplete(prAdapter->prGlueInfo, - prCmdInfo->fgSetQuery, - 0, - WLAN_STATUS_SUCCESS); - } - - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_DISCONNECT, - NULL, - 0); - -#if !defined(LINUX) - prAdapter->fgIsRadioOff = TRUE; -#endif - - return; -} - -VOID -nicCmdEventSetIpAddress ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - UINT_32 u4Count; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - u4Count = (prCmdInfo->u4SetInfoLen - OFFSET_OF(CMD_SET_NETWORK_ADDRESS_LIST, arNetAddress)) - / sizeof(IPV4_NETWORK_ADDRESS) ; - - if (prCmdInfo->fgIsOid) { - /* Update Set Infomation Length */ - kalOidComplete(prAdapter->prGlueInfo, - prCmdInfo->fgSetQuery, - OFFSET_OF(PARAM_NETWORK_ADDRESS_LIST, arAddress) + u4Count * - (OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress) + sizeof(PARAM_NETWORK_ADDRESS_IP)), - WLAN_STATUS_SUCCESS); - } - - return; -} - -VOID -nicCmdEventQueryRfTestATInfo( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_EVENT_TEST_STATUS prTestStatus, prQueryBuffer; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4QueryInfoLen; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prTestStatus = (P_EVENT_TEST_STATUS)pucEventBuf; - - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - prQueryBuffer = (P_EVENT_TEST_STATUS) prCmdInfo->pvInformationBuffer; - - kalMemCopy(prQueryBuffer, prTestStatus, sizeof(EVENT_TEST_STATUS)); - - u4QueryInfoLen = sizeof(EVENT_TEST_STATUS); - - /* Update Query Infomation Length */ - kalOidComplete(prGlueInfo, - prCmdInfo->fgSetQuery, - u4QueryInfoLen, - WLAN_STATUS_SUCCESS); - } - - return; -} - -VOID -nicCmdEventQueryLinkQuality( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - PARAM_RSSI rRssi, *prRssi; - P_EVENT_LINK_QUALITY prLinkQuality; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4QueryInfoLen; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prLinkQuality = (P_EVENT_LINK_QUALITY)pucEventBuf; - - rRssi = (PARAM_RSSI)prLinkQuality->cRssi; // ranged from (-128 ~ 30) in unit of dBm - - if(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX].eConnectionState == PARAM_MEDIA_STATE_CONNECTED) { - if(rRssi > PARAM_WHQL_RSSI_MAX_DBM) - rRssi = PARAM_WHQL_RSSI_MAX_DBM; - else if(rRssi < PARAM_WHQL_RSSI_MIN_DBM) - rRssi = PARAM_WHQL_RSSI_MIN_DBM; - } - else { - rRssi = PARAM_WHQL_RSSI_MIN_DBM; - } - - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - prRssi = (PARAM_RSSI *) prCmdInfo->pvInformationBuffer; - - kalMemCopy(prRssi, &rRssi, sizeof(PARAM_RSSI)); - u4QueryInfoLen = sizeof(PARAM_RSSI); - - kalOidComplete(prGlueInfo, - prCmdInfo->fgSetQuery, - u4QueryInfoLen, - WLAN_STATUS_SUCCESS); - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This routine is in response of OID_GEN_LINK_SPEED query request -* -* @param prAdapter Pointer to the Adapter structure. -* @param prCmdInfo Pointer to the pending command info -* @param pucEventBuf -* -* @retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicCmdEventQueryLinkSpeed( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_EVENT_LINK_QUALITY prLinkQuality; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4QueryInfoLen; - PUINT_32 pu4LinkSpeed; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prLinkQuality = (P_EVENT_LINK_QUALITY)pucEventBuf; - - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - pu4LinkSpeed = (PUINT_32)(prCmdInfo->pvInformationBuffer); - - if(prLinkQuality->u2LinkSpeed == 0) { - *pu4LinkSpeed = 10000; /* 10K * 100bps = 1Mbps */ - } - else { - *pu4LinkSpeed = prLinkQuality->u2LinkSpeed * 5000; - } - - u4QueryInfoLen = sizeof(UINT_32); - - kalOidComplete(prGlueInfo, - prCmdInfo->fgSetQuery, - u4QueryInfoLen, - WLAN_STATUS_SUCCESS); - } -} - - -VOID -nicCmdEventQueryStatistics( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_PARAM_802_11_STATISTICS_STRUCT_T prStatistics; - P_EVENT_STATISTICS prEventStatistics; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4QueryInfoLen; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prEventStatistics = (P_EVENT_STATISTICS)pucEventBuf; - - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - - u4QueryInfoLen = sizeof(PARAM_802_11_STATISTICS_STRUCT_T); - prStatistics = (P_PARAM_802_11_STATISTICS_STRUCT_T) prCmdInfo->pvInformationBuffer; - - prStatistics->u4Length = sizeof(PARAM_802_11_STATISTICS_STRUCT_T); - prStatistics->rTransmittedFragmentCount - = prEventStatistics->rTransmittedFragmentCount; - prStatistics->rMulticastTransmittedFrameCount - = prEventStatistics->rMulticastTransmittedFrameCount; - prStatistics->rFailedCount - = prEventStatistics->rFailedCount; - prStatistics->rRetryCount - = prEventStatistics->rRetryCount; - prStatistics->rMultipleRetryCount - = prEventStatistics->rMultipleRetryCount; - prStatistics->rRTSSuccessCount - = prEventStatistics->rRTSSuccessCount; - prStatistics->rRTSFailureCount - = prEventStatistics->rRTSFailureCount; - prStatistics->rACKFailureCount - = prEventStatistics->rACKFailureCount; - prStatistics->rFrameDuplicateCount - = prEventStatistics->rFrameDuplicateCount; - prStatistics->rReceivedFragmentCount - = prEventStatistics->rReceivedFragmentCount; - prStatistics->rMulticastReceivedFrameCount - = prEventStatistics->rMulticastReceivedFrameCount; - prStatistics->rFCSErrorCount - = prEventStatistics->rFCSErrorCount; - prStatistics->rTKIPLocalMICFailures.QuadPart - = 0; - prStatistics->rTKIPICVErrors.QuadPart - = 0; - prStatistics->rTKIPCounterMeasuresInvoked.QuadPart - = 0; - prStatistics->rTKIPReplays.QuadPart - = 0; - prStatistics->rCCMPFormatErrors.QuadPart - = 0; - prStatistics->rCCMPReplays.QuadPart - = 0; - prStatistics->rCCMPDecryptErrors.QuadPart - = 0; - prStatistics->rFourWayHandshakeFailures.QuadPart - = 0; - prStatistics->rWEPUndecryptableCount.QuadPart - = 0; - prStatistics->rWEPICVErrorCount.QuadPart - = 0; - prStatistics->rDecryptSuccessCount.QuadPart - = 0; - prStatistics->rDecryptFailureCount.QuadPart - = 0; - - kalOidComplete(prGlueInfo, - prCmdInfo->fgSetQuery, - u4QueryInfoLen, - WLAN_STATUS_SUCCESS); - } -} - -VOID -nicCmdEventEnterRfTest( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - UINT_32 u4WHISR = 0, u4Value = 0; - UINT_8 aucTxCount[8]; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - // [driver-land] - prAdapter->fgTestMode = TRUE; - - // 0. always indicate disconnection - if(kalGetMediaStateIndicated(prAdapter->prGlueInfo) != PARAM_MEDIA_STATE_DISCONNECTED) { - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_DISCONNECT, - NULL, - 0); - } - - // 1. Remove pending TX - nicTxRelease(prAdapter); - - // 1.1 clear pending Security / Management Frames - kalClearSecurityFrames(prAdapter->prGlueInfo); - kalClearMgmtFrames(prAdapter->prGlueInfo); - - // 1.2 clear pending TX packet queued in glue layer - kalFlushPendingTxPackets(prAdapter->prGlueInfo); - - // 2. Reset driver-domain FSMs - nicUninitMGMT(prAdapter); - - nicResetSystemService(prAdapter); - nicInitMGMT(prAdapter, NULL); - - // 3. Disable Interrupt - HAL_INTR_DISABLE(prAdapter); - - // 4. Block til firmware completed entering into RF test mode - kalMsleep(500); - while(1) { - HAL_MCR_RD(prAdapter, MCR_WCIR, &u4Value); - - if (u4Value & WCIR_WLAN_READY) { - break; - } - else if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - if (prCmdInfo->fgIsOid) { - /* Update Set Infomation Length */ - kalOidComplete(prAdapter->prGlueInfo, - prCmdInfo->fgSetQuery, - prCmdInfo->u4SetInfoLen, - WLAN_STATUS_NOT_SUPPORTED); - - } - return; - } - else - kalMsleep(10); - } - - // 5. Clear Interrupt Status - HAL_READ_INTR_STATUS(prAdapter, 4, (PUINT_8)&u4WHISR); - if(HAL_IS_TX_DONE_INTR(u4WHISR)) { - HAL_READ_TX_RELEASED_COUNT(prAdapter, aucTxCount); - } - - // 6. Reset TX Counter - nicTxResetResource(prAdapter); - - // 7. Re-enable Interrupt - HAL_INTR_ENABLE(prAdapter); - - // 8. completion indication - if (prCmdInfo->fgIsOid) { - /* Update Set Infomation Length */ - kalOidComplete(prAdapter->prGlueInfo, - prCmdInfo->fgSetQuery, - prCmdInfo->u4SetInfoLen, - WLAN_STATUS_SUCCESS); - } - -#if CFG_SUPPORT_NVRAM - // 9. load manufacture data - wlanLoadManufactureData(prAdapter, kalGetConfiguration(prAdapter->prGlueInfo)); -#endif - - return; -} - -VOID -nicCmdEventLeaveRfTest( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - UINT_32 u4WHISR = 0, u4Value = 0; - UINT_8 aucTxCount[8]; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - // 1. Disable Interrupt - HAL_INTR_DISABLE(prAdapter); - - // 2. Block til firmware completed leaving from RF test mode - kalMsleep(500); - while(1) { - HAL_MCR_RD(prAdapter, MCR_WCIR, &u4Value); - - if (u4Value & WCIR_WLAN_READY) { - break; - } - else if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - if (prCmdInfo->fgIsOid) { - /* Update Set Infomation Length */ - kalOidComplete(prAdapter->prGlueInfo, - prCmdInfo->fgSetQuery, - prCmdInfo->u4SetInfoLen, - WLAN_STATUS_NOT_SUPPORTED); - - } - return; - } - else { - kalMsleep(10); - } - } - - // 3. Clear Interrupt Status - HAL_READ_INTR_STATUS(prAdapter, 4, (PUINT_8)&u4WHISR); - if(HAL_IS_TX_DONE_INTR(u4WHISR)) { - HAL_READ_TX_RELEASED_COUNT(prAdapter, aucTxCount); - } - - // 4. Reset TX Counter - nicTxResetResource(prAdapter); - - // 5. Re-enable Interrupt - HAL_INTR_ENABLE(prAdapter); - - // 6. set driver-land variable - prAdapter->fgTestMode = FALSE; - - // 7. completion indication - if (prCmdInfo->fgIsOid) { - /* Update Set Infomation Length */ - kalOidComplete(prAdapter->prGlueInfo, - prCmdInfo->fgSetQuery, - prCmdInfo->u4SetInfoLen, - WLAN_STATUS_SUCCESS); - } - - /* 8. Indicate as disconnected */ - if(kalGetMediaStateIndicated(prAdapter->prGlueInfo) != PARAM_MEDIA_STATE_DISCONNECTED) { - - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_DISCONNECT, - NULL, - 0); - - prAdapter->rWlanInfo.u4SysTime = kalGetTimeTick(); - } - -#if CFG_SUPPORT_NVRAM - /* 9. load manufacture data */ - wlanLoadManufactureData(prAdapter, kalGetConfiguration(prAdapter->prGlueInfo)); -#endif - - /* 10. Override network address */ - wlanUpdateNetworkAddress(prAdapter); - - return; -} - -VOID -nicCmdEventQueryAddress( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - UINT_32 u4QueryInfoLen; - P_GLUE_INFO_T prGlueInfo; - P_EVENT_BASIC_CONFIG prEventBasicConfig; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - ASSERT(pucEventBuf); - - prEventBasicConfig = (P_EVENT_BASIC_CONFIG)(pucEventBuf); - - // copy to adapter - kalMemCopy(&(prAdapter->rMyMacAddr), &(prEventBasicConfig->rMyMacAddr), MAC_ADDR_LEN); - - //4 <2> Update information of OID - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - - kalMemCopy(prCmdInfo->pvInformationBuffer, &(prEventBasicConfig->rMyMacAddr), MAC_ADDR_LEN); - u4QueryInfoLen = MAC_ADDR_LEN; - - kalOidComplete(prGlueInfo, prCmdInfo->fgSetQuery, u4QueryInfoLen, WLAN_STATUS_SUCCESS); - } - - //4 <3> Update new MAC address and all 3 networks - COPY_MAC_ADDR(prAdapter->rWifiVar.aucMacAddress, prAdapter->rMyMacAddr); - COPY_MAC_ADDR(prAdapter->rWifiVar.aucDeviceAddress, prAdapter->rMyMacAddr); - prAdapter->rWifiVar.aucDeviceAddress[0] ^= MAC_ADDR_LOCAL_ADMIN; - - COPY_MAC_ADDR(prAdapter->rWifiVar.aucInterfaceAddress, prAdapter->rMyMacAddr); - prAdapter->rWifiVar.aucInterfaceAddress[0] ^= MAC_ADDR_LOCAL_ADMIN; - - COPY_MAC_ADDR(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX].aucOwnMacAddr, - prAdapter->rMyMacAddr); - -#if CFG_ENABLE_WIFI_DIRECT - if(prAdapter->fgIsP2PRegistered) { - COPY_MAC_ADDR(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX].aucOwnMacAddr, - prAdapter->rWifiVar.aucDeviceAddress); - } -#endif - -#if CFG_ENABLE_BT_OVER_WIFI - COPY_MAC_ADDR(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX].aucOwnMacAddr, - prAdapter->rWifiVar.aucDeviceAddress); -#endif - -#if CFG_TEST_WIFI_DIRECT_GO - if (prAdapter->rWifiVar.prP2pFsmInfo->eCurrentState == P2P_STATE_IDLE) { - wlanEnableP2pFunction(prAdapter); - - wlanEnableATGO(prAdapter); - } -#endif - - kalUpdateMACAddress(prAdapter->prGlueInfo, prAdapter->rWifiVar.aucMacAddress); - - return; -} - -VOID -nicCmdEventQueryMcastAddr( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - UINT_32 u4QueryInfoLen; - P_GLUE_INFO_T prGlueInfo; - P_EVENT_MAC_MCAST_ADDR prEventMacMcastAddr; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - ASSERT(pucEventBuf); - - //4 <2> Update information of OID - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - prEventMacMcastAddr = (P_EVENT_MAC_MCAST_ADDR)(pucEventBuf); - - u4QueryInfoLen = prEventMacMcastAddr->u4NumOfGroupAddr * MAC_ADDR_LEN; - - // buffer length check - if (prCmdInfo->u4InformationBufferLength < u4QueryInfoLen) { - kalOidComplete(prGlueInfo, prCmdInfo->fgSetQuery, u4QueryInfoLen, WLAN_STATUS_BUFFER_TOO_SHORT); - } - else { - kalMemCopy(prCmdInfo->pvInformationBuffer, - prEventMacMcastAddr->arAddress, - prEventMacMcastAddr->u4NumOfGroupAddr * MAC_ADDR_LEN); - - kalOidComplete(prGlueInfo, prCmdInfo->fgSetQuery, u4QueryInfoLen, WLAN_STATUS_SUCCESS); - } - } -} - -VOID -nicCmdEventQueryEepromRead( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - UINT_32 u4QueryInfoLen; - P_PARAM_CUSTOM_EEPROM_RW_STRUC_T prEepromRdInfo; - P_GLUE_INFO_T prGlueInfo; - P_EVENT_ACCESS_EEPROM prEventAccessEeprom; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - ASSERT(pucEventBuf); - - //4 <2> Update information of OID - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - prEventAccessEeprom = (P_EVENT_ACCESS_EEPROM)(pucEventBuf); - - u4QueryInfoLen = sizeof(PARAM_CUSTOM_EEPROM_RW_STRUC_T); - - prEepromRdInfo = (P_PARAM_CUSTOM_EEPROM_RW_STRUC_T) prCmdInfo->pvInformationBuffer; - prEepromRdInfo->ucEepromIndex = (UINT_8)(prEventAccessEeprom->u2Offset); - prEepromRdInfo->u2EepromData = prEventAccessEeprom->u2Data; - - kalOidComplete(prGlueInfo, prCmdInfo->fgSetQuery, u4QueryInfoLen, WLAN_STATUS_SUCCESS); - } - - return; - -} - - -VOID -nicCmdEventSetMediaStreamMode( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - PARAM_MEDIA_STREAMING_INDICATION rParamMediaStreamIndication; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - if (prCmdInfo->fgIsOid) { - /* Update Set Infomation Length */ - kalOidComplete(prAdapter->prGlueInfo, - prCmdInfo->fgSetQuery, - prCmdInfo->u4SetInfoLen, - WLAN_STATUS_SUCCESS); - } - - rParamMediaStreamIndication.rStatus.eStatusType = - ENUM_STATUS_TYPE_MEDIA_STREAM_MODE; - rParamMediaStreamIndication.eMediaStreamMode = - prAdapter->rWlanInfo.eLinkAttr.ucMediaStreamMode == 0 ? - ENUM_MEDIA_STREAM_OFF : ENUM_MEDIA_STREAM_ON; - - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_SPECIFIC_INDICATION, - (PVOID)&rParamMediaStreamIndication, - sizeof(PARAM_MEDIA_STREAMING_INDICATION)); -} - - -/* Statistics responder */ -VOID -nicCmdEventQueryXmitOk( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_EVENT_STATISTICS prEventStatistics; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4QueryInfoLen; - PUINT_32 pu4Data; - PUINT_64 pu8Data; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prEventStatistics = (P_EVENT_STATISTICS)pucEventBuf; - - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - - if(prCmdInfo->u4InformationBufferLength == sizeof(UINT_32)) { - u4QueryInfoLen = sizeof(UINT_32); - - pu4Data = (PUINT_32) prCmdInfo->pvInformationBuffer; - *pu4Data = (UINT_32) prEventStatistics->rTransmittedFragmentCount.QuadPart; - } - else { - u4QueryInfoLen = sizeof(UINT_64); - - pu8Data = (PUINT_64) prCmdInfo->pvInformationBuffer; - *pu8Data = prEventStatistics->rTransmittedFragmentCount.QuadPart; - } - - kalOidComplete(prGlueInfo, - prCmdInfo->fgSetQuery, - u4QueryInfoLen, - WLAN_STATUS_SUCCESS); - } -} - - -VOID -nicCmdEventQueryRecvOk( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_EVENT_STATISTICS prEventStatistics; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4QueryInfoLen; - PUINT_32 pu4Data; - PUINT_64 pu8Data; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prEventStatistics = (P_EVENT_STATISTICS)pucEventBuf; - - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - - if(prCmdInfo->u4InformationBufferLength == sizeof(UINT_32)) { - u4QueryInfoLen = sizeof(UINT_32); - - pu4Data = (PUINT_32) prCmdInfo->pvInformationBuffer; - *pu4Data = (UINT_32) prEventStatistics->rReceivedFragmentCount.QuadPart; - } - else { - u4QueryInfoLen = sizeof(UINT_64); - - pu8Data = (PUINT_64) prCmdInfo->pvInformationBuffer; - *pu8Data = prEventStatistics->rReceivedFragmentCount.QuadPart; - } - - kalOidComplete(prGlueInfo, - prCmdInfo->fgSetQuery, - u4QueryInfoLen, - WLAN_STATUS_SUCCESS); - } -} - -VOID -nicCmdEventQueryXmitError( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_EVENT_STATISTICS prEventStatistics; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4QueryInfoLen; - PUINT_32 pu4Data; - PUINT_64 pu8Data; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prEventStatistics = (P_EVENT_STATISTICS)pucEventBuf; - - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - - if(prCmdInfo->u4InformationBufferLength == sizeof(UINT_32)) { - u4QueryInfoLen = sizeof(UINT_32); - - pu4Data = (PUINT_32) prCmdInfo->pvInformationBuffer; - *pu4Data = (UINT_32) prEventStatistics->rFailedCount.QuadPart; - } - else { - u4QueryInfoLen = sizeof(UINT_64); - - pu8Data = (PUINT_64) prCmdInfo->pvInformationBuffer; - *pu8Data = (UINT_64) prEventStatistics->rFailedCount.QuadPart; - } - - kalOidComplete(prGlueInfo, - prCmdInfo->fgSetQuery, - u4QueryInfoLen, - WLAN_STATUS_SUCCESS); - } -} - - -VOID -nicCmdEventQueryRecvError( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_EVENT_STATISTICS prEventStatistics; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4QueryInfoLen; - PUINT_32 pu4Data; - PUINT_64 pu8Data; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prEventStatistics = (P_EVENT_STATISTICS)pucEventBuf; - - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - - if(prCmdInfo->u4InformationBufferLength == sizeof(UINT_32)) { - u4QueryInfoLen = sizeof(UINT_32); - - pu4Data = (PUINT_32) prCmdInfo->pvInformationBuffer; - *pu4Data = (UINT_32) prEventStatistics->rFCSErrorCount.QuadPart; - // @FIXME, RX_ERROR_DROP_COUNT/RX_FIFO_FULL_DROP_COUNT is not calculated - } - else { - u4QueryInfoLen = sizeof(UINT_64); - - pu8Data = (PUINT_64) prCmdInfo->pvInformationBuffer; - *pu8Data = prEventStatistics->rFCSErrorCount.QuadPart; - // @FIXME, RX_ERROR_DROP_COUNT/RX_FIFO_FULL_DROP_COUNT is not calculated - } - - kalOidComplete(prGlueInfo, - prCmdInfo->fgSetQuery, - u4QueryInfoLen, - WLAN_STATUS_SUCCESS); - } -} - - -VOID -nicCmdEventQueryRecvNoBuffer( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_EVENT_STATISTICS prEventStatistics; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4QueryInfoLen; - PUINT_32 pu4Data; - PUINT_64 pu8Data; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prEventStatistics = (P_EVENT_STATISTICS)pucEventBuf; - - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - - if(prCmdInfo->u4InformationBufferLength == sizeof(UINT_32)) { - u4QueryInfoLen = sizeof(UINT_32); - - pu4Data = (PUINT_32) prCmdInfo->pvInformationBuffer; - *pu4Data = 0; // @FIXME? - } - else { - u4QueryInfoLen = sizeof(UINT_64); - - pu8Data = (PUINT_64) prCmdInfo->pvInformationBuffer; - *pu8Data = 0; //@FIXME? - } - - kalOidComplete(prGlueInfo, - prCmdInfo->fgSetQuery, - u4QueryInfoLen, - WLAN_STATUS_SUCCESS); - } -} - - -VOID -nicCmdEventQueryRecvCrcError( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_EVENT_STATISTICS prEventStatistics; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4QueryInfoLen; - PUINT_32 pu4Data; - PUINT_64 pu8Data; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prEventStatistics = (P_EVENT_STATISTICS)pucEventBuf; - - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - - if(prCmdInfo->u4InformationBufferLength == sizeof(UINT_32)) { - u4QueryInfoLen = sizeof(UINT_32); - - pu4Data = (PUINT_32) prCmdInfo->pvInformationBuffer; - *pu4Data = (UINT_32) prEventStatistics->rFCSErrorCount.QuadPart; - } - else { - u4QueryInfoLen = sizeof(UINT_64); - - pu8Data = (PUINT_64) prCmdInfo->pvInformationBuffer; - *pu8Data = prEventStatistics->rFCSErrorCount.QuadPart; - } - - kalOidComplete(prGlueInfo, - prCmdInfo->fgSetQuery, - u4QueryInfoLen, - WLAN_STATUS_SUCCESS); - } -} - - -VOID -nicCmdEventQueryRecvErrorAlignment( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_EVENT_STATISTICS prEventStatistics; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4QueryInfoLen; - PUINT_32 pu4Data; - PUINT_64 pu8Data; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prEventStatistics = (P_EVENT_STATISTICS)pucEventBuf; - - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - - if(prCmdInfo->u4InformationBufferLength == sizeof(UINT_32)) { - u4QueryInfoLen = sizeof(UINT_32); - - pu4Data = (PUINT_32) prCmdInfo->pvInformationBuffer; - *pu4Data = (UINT_32) 0; //@FIXME - } - else { - u4QueryInfoLen = sizeof(UINT_64); - - pu8Data = (PUINT_64) prCmdInfo->pvInformationBuffer; - *pu8Data = 0; //@FIXME - } - - kalOidComplete(prGlueInfo, - prCmdInfo->fgSetQuery, - u4QueryInfoLen, - WLAN_STATUS_SUCCESS); - } -} - - -VOID -nicCmdEventQueryXmitOneCollision( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_EVENT_STATISTICS prEventStatistics; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4QueryInfoLen; - PUINT_32 pu4Data; - PUINT_64 pu8Data; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prEventStatistics = (P_EVENT_STATISTICS)pucEventBuf; - - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - - if(prCmdInfo->u4InformationBufferLength == sizeof(UINT_32)) { - u4QueryInfoLen = sizeof(UINT_32); - - pu4Data = (PUINT_32) prCmdInfo->pvInformationBuffer; - *pu4Data = (UINT_32) (prEventStatistics->rMultipleRetryCount.QuadPart - prEventStatistics->rRetryCount.QuadPart); - } - else { - u4QueryInfoLen = sizeof(UINT_64); - - pu8Data = (PUINT_64) prCmdInfo->pvInformationBuffer; - *pu8Data = (UINT_64) (prEventStatistics->rMultipleRetryCount.QuadPart - prEventStatistics->rRetryCount.QuadPart); - } - - kalOidComplete(prGlueInfo, - prCmdInfo->fgSetQuery, - u4QueryInfoLen, - WLAN_STATUS_SUCCESS); - } -} - - -VOID -nicCmdEventQueryXmitMoreCollisions( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_EVENT_STATISTICS prEventStatistics; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4QueryInfoLen; - PUINT_32 pu4Data; - PUINT_64 pu8Data; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prEventStatistics = (P_EVENT_STATISTICS)pucEventBuf; - - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - - if(prCmdInfo->u4InformationBufferLength == sizeof(UINT_32)) { - u4QueryInfoLen = sizeof(UINT_32); - - pu4Data = (PUINT_32) prCmdInfo->pvInformationBuffer; - *pu4Data = (UINT_32) prEventStatistics->rMultipleRetryCount.QuadPart; - } - else { - u4QueryInfoLen = sizeof(UINT_64); - - pu8Data = (PUINT_64) prCmdInfo->pvInformationBuffer; - *pu8Data = (UINT_64) prEventStatistics->rMultipleRetryCount.QuadPart; - } - - kalOidComplete(prGlueInfo, - prCmdInfo->fgSetQuery, - u4QueryInfoLen, - WLAN_STATUS_SUCCESS); - } -} - - -VOID -nicCmdEventQueryXmitMaxCollisions( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - P_EVENT_STATISTICS prEventStatistics; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4QueryInfoLen; - PUINT_32 pu4Data; - PUINT_64 pu8Data; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prEventStatistics = (P_EVENT_STATISTICS)pucEventBuf; - - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - - if(prCmdInfo->u4InformationBufferLength == sizeof(UINT_32)) { - u4QueryInfoLen = sizeof(UINT_32); - - pu4Data = (PUINT_32) prCmdInfo->pvInformationBuffer; - *pu4Data = (UINT_32) prEventStatistics->rFailedCount.QuadPart; - } - else { - u4QueryInfoLen = sizeof(UINT_64); - - pu8Data = (PUINT_64) prCmdInfo->pvInformationBuffer; - *pu8Data = (UINT_64) prEventStatistics->rFailedCount.QuadPart; - } - - kalOidComplete(prGlueInfo, - prCmdInfo->fgSetQuery, - u4QueryInfoLen, - WLAN_STATUS_SUCCESS); - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called when command by OID/ioctl has been timeout -* -* @param prAdapter Pointer to the Adapter structure. -* @param prCmdInfo Pointer to the command information -* -* @return TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicOidCmdTimeoutCommon ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ) -{ - ASSERT(prAdapter); - - kalOidComplete(prAdapter->prGlueInfo, - prCmdInfo->fgSetQuery, - 0, - WLAN_STATUS_FAILURE); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is a generic command timeout handler -* -* @param pfnOidHandler Pointer to the OID handler -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicCmdTimeoutCommon ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ) -{ - ASSERT(prAdapter); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called when command for entering RF test has -* failed sending due to timeout (highly possibly by firmware crash) -* -* @param prAdapter Pointer to the Adapter structure. -* @param prCmdInfo Pointer to the command information -* -* @return none -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicOidCmdEnterRFTestTimeout ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo - ) -{ - ASSERT(prAdapter); - - // 1. Remove pending TX frames - nicTxRelease(prAdapter); - - // 1.1 clear pending Security / Management Frames - kalClearSecurityFrames(prAdapter->prGlueInfo); - kalClearMgmtFrames(prAdapter->prGlueInfo); - - // 1.2 clear pending TX packet queued in glue layer - kalFlushPendingTxPackets(prAdapter->prGlueInfo); - - // 2. indiate for OID failure - kalOidComplete(prAdapter->prGlueInfo, - prCmdInfo->fgSetQuery, - 0, - WLAN_STATUS_FAILURE); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is called when command for memory dump has -* replied a event. -* -* @param prAdapter Pointer to the Adapter structure. -* @param prCmdInfo Pointer to the command information -* @param pucEventBuf Pointer to event buffer -* -* @return none -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicCmdEventQueryMemDump ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN PUINT_8 pucEventBuf - ) -{ - UINT_32 u4QueryInfoLen; - P_PARAM_CUSTOM_MEM_DUMP_STRUC_T prMemDumpInfo; - P_GLUE_INFO_T prGlueInfo; - P_EVENT_DUMP_MEM_T prEventDumpMem; - static UINT_8 aucPath[256]; - static UINT_32 u4CurTimeTick; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - ASSERT(pucEventBuf); - - //4 <2> Update information of OID - if (prCmdInfo->fgIsOid) { - prGlueInfo = prAdapter->prGlueInfo; - prEventDumpMem = (P_EVENT_DUMP_MEM_T)(pucEventBuf); - - u4QueryInfoLen = sizeof(P_PARAM_CUSTOM_MEM_DUMP_STRUC_T); - - prMemDumpInfo = (P_PARAM_CUSTOM_MEM_DUMP_STRUC_T) prCmdInfo->pvInformationBuffer; - prMemDumpInfo->u4Address = prEventDumpMem->u4Address; - prMemDumpInfo->u4Length = prEventDumpMem->u4Length; - prMemDumpInfo->u4RemainLength = prEventDumpMem->u4RemainLength; - prMemDumpInfo->ucFragNum = prEventDumpMem->ucFragNum; - -#if 0 - do{ - UINT_32 i = 0; - printk("Rx dump address 0x%X, Length %d, FragNum %d, remain %d\n", - prEventDumpMem->u4Address, - prEventDumpMem->u4Length, - prEventDumpMem->ucFragNum, - prEventDumpMem->u4RemainLength); -#if 0 - for(i = 0; i < prEventDumpMem->u4Length; i++) { - printk("%02X ", prEventDumpMem->aucBuffer[i]); - if(i % 32 == 31) { - printk("\n"); - } - } -#endif - }while(FALSE); -#endif - - if(prEventDumpMem->ucFragNum == 1) { - /* Store memory dump into sdcard, - * path /sdcard/dump___.hex - */ - u4CurTimeTick = kalGetTimeTick(); - sprintf(aucPath, "/sdcard/dump_%ld_0x%08lX_%ld.hex", - u4CurTimeTick, - prEventDumpMem->u4Address, - prEventDumpMem->u4Length + prEventDumpMem->u4RemainLength); - kalWriteToFile(aucPath, FALSE, &prEventDumpMem->aucBuffer[0], prEventDumpMem->u4Length); - } - else { - /* Append current memory dump to the hex file */ - kalWriteToFile(aucPath, TRUE, &prEventDumpMem->aucBuffer[0], prEventDumpMem->u4Length); - } - - if(prEventDumpMem->u4RemainLength == 0 || - prEventDumpMem->u4Address == 0xFFFFFFFF) { - /* The request is finished or firmware response a error */ - /* Reply time tick to iwpriv */ - *((PUINT_32)prCmdInfo->pvInformationBuffer) = u4CurTimeTick; - kalOidComplete(prGlueInfo, prCmdInfo->fgSetQuery, u4QueryInfoLen, WLAN_STATUS_SUCCESS); - } - else { - /* The memory dump request is not finished, Send next command*/ - wlanSendMemDumpCmd( - prAdapter, - prCmdInfo->pvInformationBuffer, - prCmdInfo->u4InformationBufferLength); - } - } - - return; - -} - - - - diff --git a/drivers/net/wireless/mt5931/nic/nic_pwr_mgt.c b/drivers/net/wireless/mt5931/nic/nic_pwr_mgt.c deleted file mode 100755 index c7f30fbe9e50..000000000000 --- a/drivers/net/wireless/mt5931/nic/nic_pwr_mgt.c +++ /dev/null @@ -1,801 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/nic/nic_pwr_mgt.c#1 $ -*/ - -/*! \file "nic_pwr_mgt.c" - \brief In this file we define the STATE and EVENT for Power Management FSM. - - The SCAN FSM is responsible for performing SCAN behavior when the Arbiter enter - ARB_STATE_SCAN. The STATE and EVENT for SCAN FSM are defined here with detail - description. -*/ - - - -/* -** $Log: nic_pwr_mgt.c $ - * - * 11 28 2011 cp.wu - * [WCXRP00001125] [MT6620 Wi-Fi][Firmware] Strengthen Wi-Fi power off sequence to have a clearroom environment when returining to ROM code - * 1. Due to firmware now stops HIF DMA for powering off, do not try to receive any packet from firmware - * 2. Take use of prAdapter->fgIsEnterD3ReqIssued for tracking whether it is powering off or not - * - * 10 03 2011 cp.wu - * [WCXRP00001022] [MT6628 Driver][Firmware Download] Add multi section independent download functionality - * add firmware download path in divided scatters. - * - * 08 15 2011 cp.wu - * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree - * reuse firmware download logic of MT6620 for MT6628. - * - * 05 11 2011 cp.wu - * [WCXRP00000718] [MT6620 Wi-Fi] modify the behavior of setting tx power - * ACPI APIs migrate to wlan_lib.c for glue layer to invoke. - * - * 04 29 2011 cp.wu - * [WCXRP00000636] [WHQL][MT5931 Driver] 2c_PMHibernate (hang on 2h) - * fix for compilation error when applied with FW_DOWNLOAD = 0 - * - * 04 18 2011 cp.wu - * [WCXRP00000636] [WHQL][MT5931 Driver] 2c_PMHibernate (hang on 2h) - * 1) add API for glue layer to query ACPI state - * 2) Windows glue should not access to hardware after switched into D3 state - * - * 04 13 2011 cp.wu - * [WCXRP00000639] [WHQL][MT5931 Driver] 2c_PMStandby test item can not complete - * refine for MT5931/MT6620 logic separation. - * - * 04 13 2011 cp.wu - * [WCXRP00000639] [WHQL][MT5931 Driver] 2c_PMStandby test item can not complete - * bugfix: firmware download procedure for ACPI state transition is not complete. - * - * 03 15 2011 cp.wu - * [WCXRP00000559] [MT6620 Wi-Fi][Driver] Combine TX/RX DMA buffers into a single one to reduce physically continuous memory consumption - * 1. deprecate CFG_HANDLE_IST_IN_SDIO_CALLBACK - * 2. Use common coalescing buffer for both TX/RX directions - * - * - * 03 07 2011 terry.wu - * [WCXRP00000521] [MT6620 Wi-Fi][Driver] Remove non-standard debug message - * Toggle non-standard debug messages to comments. - * - * 12 31 2010 cp.wu - * [WCXRP00000335] [MT6620 Wi-Fi][Driver] change to use milliseconds sleep instead of delay to avoid blocking to system scheduling - * change to use msleep() and shorten waiting interval to reduce blocking to other task while Wi-Fi driver is being loaded - * - * 12 31 2010 cp.wu - * [WCXRP00000327] [MT6620 Wi-Fi][Driver] Improve HEC WHQA 6972 workaround coverage in driver side - * check success or failure for setting fw-own - * - * 12 30 2010 cp.wu - * [WCXRP00000327] [MT6620 Wi-Fi][Driver] Improve HEC WHQA 6972 workaround coverage in driver side - * host driver not to set FW-own when there is still pending interrupts - * - * 10 07 2010 cp.wu - * [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection - * add firmware download for MT5931. - * - * 09 21 2010 cp.wu - * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated - * Do a complete reset with STA-REC null checking for RF test re-entry - * - * 08 30 2010 cp.wu - * NULL - * eliminate klockwork errors - * - * 08 30 2010 cp.wu - * NULL - * reset ACPI power state before waking up MT6620 Wi-Fi firmware. - * - * 08 12 2010 cp.wu - * NULL - * [AIS-FSM] honor registry setting for adhoc running mode. (A/B/G) - * - * 08 03 2010 cp.wu - * NULL - * Centralize mgmt/system service procedures into independent calls. - * - * 07 22 2010 cp.wu - * - * 1) refine AIS-FSM indent. - * 2) when entering RF Test mode, flush 802.1X frames as well - * 3) when entering D3 state, flush 802.1X frames as well - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * change MAC address updating logic. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) when acquiring LP-own, write for clr-own with lower frequency compared to read poll - * 2) correct address list parsing - * - * 05 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * sleepy notify is only used for sleepy state, - * while wake-up state is automatically set when host needs to access device - * - * 05 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct hibernation problem. - * - * 04 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) surpress compiler warning - * 2) when acqruing LP-own, keep writing WHLPCR whenever OWN is not acquired yet - * - * 04 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * surpress compiler warning - * - * 04 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * when acquiring driver-own, wait for up to 8 seconds. - * - * 04 21 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * add for private ioctl support - * - * 04 20 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) remove redundant firmware image unloading - * * 2) use compile-time macros to separate logic related to accquiring own - * - * 04 16 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * treat BUS access failure as kind of card removal. - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * accessing to firmware load/start address, and access to OID handling information - * * are now handled in glue layer - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * ePowerCtrl is not necessary as a glue variable. - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add KAL API: kalFlushPendingTxPackets(), and take use of the API - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access for prGlueInfo->fgIsCardRemoved in non-glue layer - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port - * - * 03 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * always send CMD_NIC_POWER_CTRL packet when nic is being halted - * - * 03 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct typo. - * - * 03 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) add ACPI D0/D3 state switching support - * * * * * * * * 2) use more formal way to handle interrupt when the status is retrieved from enhanced RX response - * - * 03 08 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) add another spin-lock to protect MsduInfoList due to it might be accessed by different thread. - * * 2) change own-back acquiring procedure to wait for up to 16.67 seconds -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-10-13 21:59:15 GMT mtk01084 -** update for new HW design -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-09-09 17:26:36 GMT mtk01084 -** remove CMD52 access -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-05-18 14:50:29 GMT mtk01084 -** modify lines in nicpmSetDriverOwn() -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-23 16:55:37 GMT mtk01084 -** modify nicpmSetDriverOwn() -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-19 18:33:00 GMT mtk01084 -** update for basic power management functions -** \main\maintrunk.MT6620WiFiDriver_Prj\1 2009-03-19 15:05:32 GMT mtk01084 -** Initial version -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to process the POWER ON procedure. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicpmSetFWOwn ( - IN P_ADAPTER_T prAdapter, - IN BOOLEAN fgEnableGlobalInt - ) -{ - UINT_32 u4RegValue; - - ASSERT(prAdapter); - - if(prAdapter->fgIsFwOwn == TRUE) { - return; - } - else { - if(nicProcessIST(prAdapter) != WLAN_STATUS_NOT_INDICATING) { - // pending interrupts - return; - } - } - - if (fgEnableGlobalInt) { - prAdapter->fgIsIntEnableWithLPOwnSet = TRUE; - } - else { - HAL_MCR_WR(prAdapter, MCR_WHLPCR, WHLPCR_FW_OWN_REQ_SET); - - HAL_MCR_RD(prAdapter, MCR_WHLPCR, &u4RegValue); - if(u4RegValue & WHLPCR_FW_OWN_REQ_SET) { - // if set firmware own not successful (possibly pending interrupts), - // indicate an own clear event - HAL_MCR_WR(prAdapter, MCR_WHLPCR, WHLPCR_FW_OWN_REQ_CLR); - - return; - } - - prAdapter->fgIsFwOwn = TRUE; - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to process the POWER OFF procedure. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -nicpmSetDriverOwn ( - IN P_ADAPTER_T prAdapter - ) -{ -#define LP_OWN_BACK_TOTAL_DELAY_MS 8192 //exponential of 2 -#define LP_OWN_BACK_LOOP_DELAY_MS 1 //exponential of 2 -#define LP_OWN_BACK_CLR_OWN_ITERATION 256 //exponential of 2 - - BOOLEAN fgStatus = TRUE; - UINT_32 i, u4CurrTick, u4RegValue = 0; - - ASSERT(prAdapter); - - if(prAdapter->fgIsFwOwn == FALSE) - return fgStatus; - - u4CurrTick = kalGetTimeTick(); - i = 0; - while(1) { - HAL_MCR_RD(prAdapter, MCR_WHLPCR, &u4RegValue); - - if (u4RegValue & WHLPCR_FW_OWN_REQ_SET) { - prAdapter->fgIsFwOwn = FALSE; - break; - } - else if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE - || (kalGetTimeTick() - u4CurrTick) > LP_OWN_BACK_TOTAL_DELAY_MS) { - //ERRORLOG(("LP cannot be own back (for %ld ms)", kalGetTimeTick() - u4CurrTick)); - fgStatus = FALSE; - break; - } - else { - if((i & (LP_OWN_BACK_CLR_OWN_ITERATION - 1)) == 0) { - /* Software get LP ownership - per 256 iterations */ - HAL_MCR_WR(prAdapter, MCR_WHLPCR, WHLPCR_FW_OWN_REQ_CLR); - } - - /* Delay for LP engine to complete its operation. */ - kalMsleep(LP_OWN_BACK_LOOP_DELAY_MS); - i++; - } - } - - return fgStatus; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to set ACPI power mode to D0. -* -* \param[in] pvAdapter Pointer to the Adapter structure. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -nicpmSetAcpiPowerD0 ( - IN P_ADAPTER_T prAdapter - ) -{ - WLAN_STATUS u4Status = WLAN_STATUS_SUCCESS; - UINT_32 u4Value = 0, u4WHISR = 0; - UINT_8 aucTxCount[8]; - UINT_32 i; -#if CFG_ENABLE_FW_DOWNLOAD - UINT_32 u4FwImgLength, u4FwLoadAddr, u4ImgSecSize; - PVOID prFwMappingHandle; - PVOID pvFwImageMapFile = NULL; - #if CFG_ENABLE_FW_DIVIDED_DOWNLOAD - UINT_32 j; - P_FIRMWARE_DIVIDED_DOWNLOAD_T prFwHead; - BOOLEAN fgValidHead; - const UINT_32 u4CRCOffset = offsetof(FIRMWARE_DIVIDED_DOWNLOAD_T, u4NumOfEntries); - #endif -#endif - - DEBUGFUNC("nicpmSetAcpiPowerD0"); - - ASSERT(prAdapter); - - do { - /* 0. Reset variables in ADAPTER_T */ - prAdapter->fgIsFwOwn = TRUE; - prAdapter->fgWiFiInSleepyState = FALSE; - prAdapter->rAcpiState = ACPI_STATE_D0; - prAdapter->fgIsEnterD3ReqIssued = FALSE; - -#if defined(MT6620) || defined(MT6628) - /* 1. Request Ownership to enter F/W download state */ - ACQUIRE_POWER_CONTROL_FROM_PM(prAdapter); - #if !CFG_ENABLE_FULL_PM - nicpmSetDriverOwn(prAdapter); - #endif - - /* 2. Initialize the Adapter */ - if ( (u4Status = nicInitializeAdapter(prAdapter)) != WLAN_STATUS_SUCCESS ) { - DBGLOG(INIT, ERROR, ("nicInitializeAdapter failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } -#endif - - #if CFG_ENABLE_FW_DOWNLOAD - prFwMappingHandle = kalFirmwareImageMapping(prAdapter->prGlueInfo, &pvFwImageMapFile, &u4FwImgLength); - if(!prFwMappingHandle) { - DBGLOG(INIT, ERROR,("Fail to load FW image from file!\n")); - pvFwImageMapFile = NULL; - } - - #if defined(MT6620) || defined(MT6628) - if (pvFwImageMapFile) { - /* 3.1 disable interrupt, download is done by polling mode only */ - nicDisableInterrupt(prAdapter); - - /* 3.2 Initialize Tx Resource to fw download state */ - nicTxInitResetResource(prAdapter); - - /* 3.3 FW download here */ - u4FwLoadAddr = kalGetFwLoadAddress(prAdapter->prGlueInfo); - - #if CFG_ENABLE_FW_DIVIDED_DOWNLOAD - // 3a. parse file header for decision of divided firmware download or not - prFwHead = (P_FIRMWARE_DIVIDED_DOWNLOAD_T)pvFwImageMapFile; - - if(prFwHead->u4Signature == MTK_WIFI_SIGNATURE && - prFwHead->u4CRC == wlanCRC32((PUINT_8)pvFwImageMapFile + u4CRCOffset, u4FwImgLength - u4CRCOffset)) { - fgValidHead = TRUE; - } - else { - fgValidHead = FALSE; - } - - /* 3b. engage divided firmware downloading */ - if(fgValidHead == TRUE) { - for(i = 0 ; i < prFwHead->u4NumOfEntries ; i++) { - #if CFG_ENABLE_FW_DOWNLOAD_AGGREGATION - if(wlanImageSectionDownloadAggregated(prAdapter, - prFwHead->arSection[i].u4DestAddr, - prFwHead->arSection[i].u4Length, - (PUINT_8)pvFwImageMapFile + prFwHead->arSection[i].u4Offset) != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, ERROR, ("Firmware scatter download failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - } - #else - for(j = 0 ; j < prFwHead->arSection[i].u4Length ; j += CMD_PKT_SIZE_FOR_IMAGE) { - if(j + CMD_PKT_SIZE_FOR_IMAGE < prFwHead->arSection[i].u4Length) - u4ImgSecSize = CMD_PKT_SIZE_FOR_IMAGE; - else - u4ImgSecSize = prFwHead->arSection[i].u4Length - j; - - if(wlanImageSectionDownload(prAdapter, - prFwHead->arSection[i].u4DestAddr + j, - u4ImgSecSize, - (PUINT_8)pvFwImageMapFile + prFwHead->arSection[i].u4Offset + j) != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, ERROR, ("Firmware scatter download failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - } - #endif - /* escape from loop if any pending error occurs */ - if(u4Status == WLAN_STATUS_FAILURE) { - break; - } - } - } - else - #endif - #if CFG_ENABLE_FW_DOWNLOAD_AGGREGATION - if(wlanImageSectionDownloadAggregated(prAdapter, - u4FwLoadAddr, - u4FwImgLength, - (PUINT_8)pvFwImageMapFile) != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, ERROR, ("Firmware scatter download failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - } - #else - for (i = 0; i < u4FwImgLength ; i += CMD_PKT_SIZE_FOR_IMAGE) { - if(i + CMD_PKT_SIZE_FOR_IMAGE < u4FwImgLength) - u4ImgSecSize = CMD_PKT_SIZE_FOR_IMAGE; - else - u4ImgSecSize = u4FwImgLength - i; - - if(wlanImageSectionDownload(prAdapter, - u4FwLoadAddr + i, - u4ImgSecSize, - (PUINT_8)pvFwImageMapFile + i) != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, ERROR, ("wlanImageSectionDownload failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - } - #endif - - if(u4Status != WLAN_STATUS_SUCCESS) { - kalFirmwareImageUnmapping(prAdapter->prGlueInfo, prFwMappingHandle, pvFwImageMapFile); - break; - } - - #if !CFG_ENABLE_FW_DOWNLOAD_ACK - // Send INIT_CMD_ID_QUERY_PENDING_ERROR command and wait for response - if(wlanImageQueryStatus(prAdapter) != WLAN_STATUS_SUCCESS) { - kalFirmwareImageUnmapping(prAdapter->prGlueInfo, prFwMappingHandle, pvFwImageMapFile); - u4Status = WLAN_STATUS_FAILURE; - break; - } - #endif - - kalFirmwareImageUnmapping(prAdapter->prGlueInfo, prFwMappingHandle, pvFwImageMapFile); - } - else { - u4Status = WLAN_STATUS_FAILURE; - break; - } - - /* 4. send Wi-Fi Start command */ - #if CFG_OVERRIDE_FW_START_ADDRESS - wlanConfigWifiFunc(prAdapter, - TRUE, - kalGetFwStartAddress(prAdapter->prGlueInfo)); - #else - wlanConfigWifiFunc(prAdapter, - FALSE, - 0); - #endif - - #elif defined(MT5931) - if (pvFwImageMapFile) { - DBGLOG(INIT, TRACE, ("Download Address: 0x%08X\n", kalGetFwLoadAddress(prAdapter->prGlueInfo))); - DBGLOG(INIT, TRACE, ("Firmware Length: 0x%08X\n", u4FwImgLength)); - - do { - /* 1.0 whole-chip reset except HIFSYS */ - HAL_MCR_WR(prAdapter, MCR_WMCSR, WMCSR_CHIP_RST); - HAL_MCR_WR(prAdapter, MCR_WMCSR, 0); - - /* 1.1 wait for INIT_RDY */ - i = 0; - while(1) { - HAL_MCR_RD(prAdapter, MCR_WMCSR, &u4Value); - - if (u4Value & WMCSR_INI_RDY) { - DBGLOG(INIT, TRACE, ("INIT-RDY detected\n")); - break; - } - else if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - u4Status = WLAN_STATUS_FAILURE; - break; - } - else if(i >= CFG_RESPONSE_POLLING_TIMEOUT) { - DBGLOG(INIT, ERROR, ("Waiting for Init Ready bit: Timeout\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - else { - i++; - kalMsleep(10); - } - } - - /* 1.2 set KSEL/FLEN */ - HAL_MCR_WR(prAdapter, MCR_FWCFG, u4FwImgLength >> 6); - - /* 1.3 enable FWDL_EN */ - HAL_MCR_WR(prAdapter, MCR_WMCSR, WMCSR_FWDLEN); - - /* 1.4 wait for PLL_RDY */ - i = 0; - while(1) { - HAL_MCR_RD(prAdapter, MCR_WMCSR, &u4Value); - - if (u4Value & WMCSR_PLLRDY) { - DBGLOG(INIT, TRACE, ("PLL-RDY detected\n")); - break; - } - else if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - u4Status = WLAN_STATUS_FAILURE; - break; - } - else if(i >= CFG_RESPONSE_POLLING_TIMEOUT) { - DBGLOG(INIT, ERROR, ("Waiting for PLL Ready bit: Timeout\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - else { - i++; - kalMsleep(10); - } - } - - /* 2.1 turn on HIFSYS firmware download mode */ - HAL_MCR_WR(prAdapter, MCR_FWDLSR, FWDLSR_FWDL_MODE); - - /* 2.2 set starting address */ - u4FwLoadAddr = kalGetFwLoadAddress(prAdapter->prGlueInfo); - HAL_MCR_WR(prAdapter, MCR_FWDLDSAR, u4FwLoadAddr); - - /* 3. upload firmware */ - for (i = 0; i < u4FwImgLength ; i += CMD_PKT_SIZE_FOR_IMAGE) { - if(i + CMD_PKT_SIZE_FOR_IMAGE < u4FwImgLength) - u4ImgSecSize = CMD_PKT_SIZE_FOR_IMAGE; - else - u4ImgSecSize = u4FwImgLength - i; - - if(wlanImageSectionDownload(prAdapter, - u4FwLoadAddr + i, - u4ImgSecSize, - (PUINT_8)pvFwImageMapFile + i) != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, ERROR, ("Firmware scatter download failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - } - - /* 4.1 poll FWDL_OK & FWDL_FAIL bits */ - i = 0; - while(1) { - HAL_MCR_RD(prAdapter, MCR_WMCSR, &u4Value); - - if (u4Value & WMCSR_DL_OK) { - DBGLOG(INIT, TRACE, ("DL_OK detected\n")); - break; - } - else if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE - || (u4Value & WMCSR_DL_FAIL)) { - DBGLOG(INIT, ERROR, ("DL_FAIL detected: 0x%08X\n", u4Value)); - u4Status = WLAN_STATUS_FAILURE; - break; - } - else if(i >= CFG_RESPONSE_POLLING_TIMEOUT) { - DBGLOG(INIT, ERROR, ("Waiting for DL_OK/DL_FAIL bit: Timeout\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - else { - i++; - kalMsleep(10); - } - } - - /* 4.2 turn off HIFSYS download mode */ - HAL_MCR_WR(prAdapter, MCR_FWDLSR, 0); - - } while (FALSE); - } - else { - DBGLOG(INIT, ERROR, ("No Firmware found!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - - #endif - #endif - - /* 5. check Wi-Fi FW asserts ready bit */ - DBGLOG(INIT, TRACE, ("wlanAdapterStart(): Waiting for Ready bit..\n")); - i = 0; - while(1) { - HAL_MCR_RD(prAdapter, MCR_WCIR, &u4Value); - - if (u4Value & WCIR_WLAN_READY) { - DBGLOG(INIT, TRACE, ("Ready bit asserted\n")); - break; - } - else if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - u4Status = WLAN_STATUS_FAILURE; - break; - } - else if(i >= CFG_RESPONSE_POLLING_TIMEOUT) { - DBGLOG(INIT, ERROR, ("Waiting for Ready bit: Timeout\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } - else { - i++; - kalMsleep(10); - } - } - -#if defined(MT5931) - // Acquire LP-OWN - ACQUIRE_POWER_CONTROL_FROM_PM(prAdapter); - #if !CFG_ENABLE_FULL_PM - nicpmSetDriverOwn(prAdapter); - #endif - - /* 2. Initialize the Adapter */ - if ( (u4Status = nicInitializeAdapter(prAdapter)) != WLAN_STATUS_SUCCESS ) { - DBGLOG(INIT, ERROR, ("nicInitializeAdapter failed!\n")); - u4Status = WLAN_STATUS_FAILURE; - break; - } -#endif - - if(u4Status == WLAN_STATUS_SUCCESS) { - // 6.1 reset interrupt status - HAL_READ_INTR_STATUS(prAdapter, 4, (PUINT_8)&u4WHISR); - if(HAL_IS_TX_DONE_INTR(u4WHISR)) { - HAL_READ_TX_RELEASED_COUNT(prAdapter, aucTxCount); - } - - /* 6.2 reset TX Resource for normal operation */ - nicTxResetResource(prAdapter); - - /* 6.3 Enable interrupt */ - nicEnableInterrupt(prAdapter); - - /* 6.4 Override network address */ - wlanUpdateNetworkAddress(prAdapter); - - /* 6.5 indicate disconnection as default status */ - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_DISCONNECT, - NULL, - 0); - } - - RECLAIM_POWER_CONTROL_TO_PM(prAdapter, FALSE); - - /* MGMT Initialization */ - nicInitMGMT(prAdapter, NULL); - - } while(FALSE); - - if(u4Status != WLAN_STATUS_SUCCESS) { - return FALSE; - } - else { - return TRUE; - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This routine is used to set ACPI power mode to D3. -* -* @param prAdapter pointer to the Adapter handler -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -nicpmSetAcpiPowerD3 ( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_32 i; - - ASSERT(prAdapter); - - /* 1. MGMT - unitialization */ - nicUninitMGMT(prAdapter); - - /* 2. Disable Interrupt */ - nicDisableInterrupt(prAdapter); - - /* 3. emit CMD_NIC_POWER_CTRL command packet */ - wlanSendNicPowerCtrlCmd(prAdapter, 1); - - /* 4. Clear Interrupt Status */ - i = 0; - while(i < CFG_IST_LOOP_COUNT && nicProcessIST(prAdapter) != WLAN_STATUS_NOT_INDICATING) { - i++; - }; - - /* 5. Remove pending TX */ - nicTxRelease(prAdapter); - - // 5.1 clear pending Security / Management Frames - kalClearSecurityFrames(prAdapter->prGlueInfo); - kalClearMgmtFrames(prAdapter->prGlueInfo); - - // 5.2 clear pending TX packet queued in glue layer - kalFlushPendingTxPackets(prAdapter->prGlueInfo); - - /* 6. Set Onwership to F/W */ - nicpmSetFWOwn(prAdapter, FALSE); - - /* 7. Set variables */ - prAdapter->rAcpiState = ACPI_STATE_D3; - - return TRUE; -} - diff --git a/drivers/net/wireless/mt5931/nic/nic_rx.c b/drivers/net/wireless/mt5931/nic/nic_rx.c deleted file mode 100755 index f1799ff7f4b6..000000000000 --- a/drivers/net/wireless/mt5931/nic/nic_rx.c +++ /dev/null @@ -1,3529 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/nic/nic_rx.c#3 $ -*/ - -/*! \file nic_rx.c - \brief Functions that provide many rx-related functions - - This file includes the functions used to process RFB and dispatch RFBs to - the appropriate related rx functions for protocols. -*/ - - - -/* -** $Log: nic_rx.c $ -** -** 08 31 2012 yuche.tsai -** [ALPS00349585] [6577JB][WiFi direct][KE]Establish p2p connection while both device have connected to AP previously,one device reboots automatically with KE -** Fix possible KE when concurrent & disconnect. - * - * 07 17 2012 yuche.tsai - * NULL - * Let netdev bring up. - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 02 14 2012 cp.wu - * NULL - * remove another assertion by error message dump - * - * 01 05 2012 tsaiyuan.hsu - * [WCXRP00001157] [MT6620 Wi-Fi][FW][DRV] add timing measurement support for 802.11v - * add timing measurement support for 802.11v. - * - * 11 19 2011 yuche.tsai - * NULL - * Update RSSI for P2P. - * - * 11 18 2011 yuche.tsai - * NULL - * CONFIG P2P support RSSI query, default turned off. - * - * 11 17 2011 tsaiyuan.hsu - * [WCXRP00001115] [MT6620 Wi-Fi][DRV] avoid deactivating staRec when changing state 3 to 3. - * avoid deactivating staRec when changing state from 3 to 3. - * - * 11 11 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * modify the xlog related code. - * - * 11 10 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Modify the QM xlog level and remove LOG_FUNC. - * - * 11 09 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Add xlog for beacon timeout and sta aging timeout. - * - * 11 08 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Add xlog function. - * - * 11 07 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * add debug counters and periodically dump counters for debugging. - * - * 10 21 2011 eddie.chen - * [WCXRP00001051] [MT6620 Wi-Fi][Driver/Fw] Adjust the STA aging timeout - * Add switch to ignore the STA aging timeout. - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 08 26 2011 cp.wu - * [WCXRP00000958] [MT6620 Wi-Fi][Driver] Extend polling timeout from 25ms to 1sec due to RF calibration might took up to 600ms - * extend polling RX response timeout period from 25ms to 1000ms. - * - * 08 11 2011 cp.wu - * [WCXRP00000830] [MT6620 Wi-Fi][Firmware] Use MDRDY counter to detect empty channel for shortening scan time - * sparse channel detection: - * driver: collect sparse channel information with scan-done event - * - * 07 28 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings - * Add BWCS cmd and event. - * - * 07 27 2011 cp.wu - * [WCXRP00000876] [MT5931][Drver] Decide to retain according to currently availble RX counter and QUE_MGT used count - * correct comment. - * - * 07 27 2011 cp.wu - * [WCXRP00000876] [MT5931][Drver] Decide to retain according to currently availble RX counter and QUE_MGT used count - * take use of QUE_MGT exported function to estimate currently RX buffer usage count. - * - * 07 18 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add CMD/Event for RDD and BWCS. - * - * 06 09 2011 tsaiyuan.hsu - * [WCXRP00000760] [MT5931 Wi-Fi][FW] Refine rxmHandleMacRxDone to reduce code size - * move send_auth at rxmHandleMacRxDone in firmware to driver to reduce code size. - * - * 05 11 2011 eddie.chen - * [WCXRP00000709] [MT6620 Wi-Fi][Driver] Check free number before copying broadcast packet - * Fix dest type when GO packet copying. - * - * 05 09 2011 eddie.chen - * [WCXRP00000709] [MT6620 Wi-Fi][Driver] Check free number before copying broadcast packet - * Check free number before copying broadcast packet. - * - * 05 05 2011 cp.wu - * [WCXRP00000702] [MT5931][Driver] Modify initialization sequence for E1 ASIC - * add delay after whole-chip resetting for MT5931 E1 ASIC. - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 04 12 2011 cm.chang - * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency - * . - * - * 04 08 2011 yuche.tsai - * [WCXRP00000624] [Volunteer Patch][MT6620][Driver] Add device discoverability support for GO. - * Add device discoverability support for GO. - * - * 04 01 2011 tsaiyuan.hsu - * [WCXRP00000615] [MT 6620 Wi-Fi][Driver] Fix klocwork issues - * fix the klocwork issues, 57500, 57501, 57502 and 57503. - * - * 03 19 2011 yuche.tsai - * [WCXRP00000584] [Volunteer Patch][MT6620][Driver] Add beacon timeout support for WiFi Direct. - * Add beacon timeout support for WiFi Direct Network. - * - * 03 18 2011 wh.su - * [WCXRP00000530] [MT6620 Wi-Fi] [Driver] skip doing p2pRunEventAAAComplete after send assoc response Tx Done - * enable the Anti_piracy check at driver . - * - * 03 17 2011 cp.wu - * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period - * use pre-allocated buffer for storing enhanced interrupt response as well - * - * 03 15 2011 cp.wu - * [WCXRP00000559] [MT6620 Wi-Fi][Driver] Combine TX/RX DMA buffers into a single one to reduce physically continuous memory consumption - * 1. deprecate CFG_HANDLE_IST_IN_SDIO_CALLBACK - * 2. Use common coalescing buffer for both TX/RX directions - * - * - * 03 07 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * rename the define to anti_pviracy. - * - * 03 05 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * add the code to get the check rsponse and indicate to app. - * - * 03 02 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * Add security check code. - * - * 03 02 2011 cp.wu - * [WCXRP00000503] [MT6620 Wi-Fi][Driver] Take RCPI brought by association response as initial RSSI right after connection is built. - * use RCPI brought by ASSOC-RESP after connection is built as initial RCPI to avoid using a uninitialized MAC-RX RCPI. - * - * 02 10 2011 yuche.tsai - * [WCXRP00000419] [Volunteer Patch][MT6620/MT5931][Driver] Provide function of disconnect to target station for AAA module. - * Remove Station Record after Aging timeout. - * - * 02 10 2011 cp.wu - * [WCXRP00000434] [MT6620 Wi-Fi][Driver] Obsolete unused event packet handlers - * EVENT_ID_CONNECTION_STATUS has been obsoleted and no need to handle. - * - * 02 09 2011 yuche.tsai - * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode. - * Add MLME deauthentication support for Hot-Spot mode. - * - * 02 09 2011 eddie.chen - * [WCXRP00000426] [MT6620 Wi-Fi][FW/Driver] Add STA aging timeout and defualtHwRatein AP mode - * Adjust variable order. - * - * 02 08 2011 eddie.chen - * [WCXRP00000426] [MT6620 Wi-Fi][FW/Driver] Add STA aging timeout and defualtHwRatein AP mode - * Add event STA agint timeout - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * - * 01 26 2011 cm.chang - * [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument - * . - * - * 01 24 2011 eddie.chen - * [WCXRP00000385] [MT6620 Wi-Fi][DRV] Add destination decision for forwarding packets - * Remove comments. - * - * 01 24 2011 eddie.chen - * [WCXRP00000385] [MT6620 Wi-Fi][DRV] Add destination decision for forwarding packets - * Add destination decision in AP mode. - * - * 01 24 2011 cm.chang - * [WCXRP00000384] [MT6620 Wi-Fi][Driver][FW] Handle 20/40 action frame in AP mode and stop ampdu timer when sta_rec is freed - * Process received 20/40 coexistence action frame for AP mode - * - * 01 24 2011 cp.wu - * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving - * 1. add an extra counter for tracking pending forward frames. - * 2. notify TX service thread as well when there is pending forward frame - * 3. correct build errors leaded by introduction of Wi-Fi direct separation module - * - * 01 12 2011 cp.wu - * [WCXRP00000357] [MT6620 Wi-Fi][Driver][Bluetooth over Wi-Fi] add another net device interface for BT AMP - * implementation of separate BT_OVER_WIFI data path. - * - * 12 29 2010 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, -Add per station flow control when STA is in PS - - * 1) PS flow control event - * - * 2) WMM IE in beacon, assoc resp, probe resp - * - * 12 15 2010 george.huang - * [WCXRP00000152] [MT6620 Wi-Fi] AP mode power saving function - * update beacon for NoA - * - * 11 01 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module - * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead - * 2) Remove CNM CH-RECOVER event handling - * 3) cfg read/write API renamed with kal prefix for unified naming rules. - * - * 10 27 2010 george.huang - * [WCXRP00000127] [MT6620 Wi-Fi][Driver] Add a registry to disable Beacon Timeout function for SQA test by using E1 EVB - * Support registry option for disable beacon lost detection. - * - * 10 20 2010 wh.su - * NULL - * add a cmd to reset the p2p key - * - * 10 20 2010 wh.su - * [WCXRP00000124] [MT6620 Wi-Fi] [Driver] Support the dissolve P2P Group - * Add the code to support disconnect p2p group - * - * 09 29 2010 wh.su - * [WCXRP00000072] [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue - * fixed compilier error. - * - * 09 29 2010 wh.su - * [WCXRP00000072] [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue - * [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue. - * - * 09 23 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * eliminate reference of CFG_RESPONSE_MAX_PKT_SIZE - * - * 09 21 2010 cp.wu - * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated - * release RX packet to packet pool when in RF test mode - * - * 09 21 2010 cp.wu - * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated - * Do a complete reset with STA-REC null checking for RF test re-entry - * - * 09 08 2010 cp.wu - * NULL - * use static memory pool for storing IEs of scanning result. - * - * 09 07 2010 yuche.tsai - * NULL - * Add a common buffer, store the IE of a P2P device in this common buffer. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 31 2010 kevin.huang - * NULL - * Use LINK LIST operation to process SCAN result - * - * 08 30 2010 cp.wu - * NULL - * eliminate klockwork errors - * - * 08 20 2010 cm.chang - * NULL - * Migrate RLM code to host from FW - * - * 08 20 2010 yuche.tsai - * NULL - * When enable WiFi Direct function, check each packet to tell which interface to indicate. - * - * 08 05 2010 yuche.tsai - * NULL - * Add P2P Device Discovery Function. - * - * 08 03 2010 cp.wu - * NULL - * surpress compilation warning. - * - * 08 03 2010 george.huang - * NULL - * handle event for updating NOA parameters indicated from FW - * - * 08 02 2010 yuche.tsai - * NULL - * Add support API for RX public action frame. - * - * 08 02 2010 jeffrey.chang - * NULL - * 1) modify tx service thread to avoid busy looping - * 2) add spin lock declartion for linux build - * - * 07 30 2010 cp.wu - * NULL - * 1) BoW wrapper: use definitions instead of hard-coded constant for error code - * 2) AIS-FSM: eliminate use of desired RF parameters, use prTargetBssDesc instead - * 3) add handling for RX_PKT_DESTINATION_HOST_WITH_FORWARD for GO-broadcast frames - * - * 07 26 2010 yuche.tsai - * - * Update Device Capability Bitmap & Group Capability Bitmap from 16 bits to 8 bits. - * - * 07 24 2010 wh.su - * - * .support the Wi-Fi RSN - * - * 07 23 2010 cp.wu - * - * add AIS-FSM handling for beacon timeout event. - * - * 07 21 2010 yuche.tsai - * - * Add P2P Scan & Scan Result Parsing & Saving. - * - * 07 19 2010 cm.chang - * - * Set RLM parameters and enable CNM channel manager - * - * 07 19 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration. - * Add Ad-Hoc support to AIS-FSM - * - * 07 19 2010 jeffrey.chang - * - * Linux port modification - * - * 07 16 2010 yarco.yang - * - * 1. Support BSS Absence/Presence Event - * 2. Support STA change PS mode Event - * 3. Support BMC forwarding for AP mode. - * - * 07 15 2010 cp.wu - * - * sync. bluetooth-over-Wi-Fi interface to driver interface document v0.2.6. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * fill ucStaRecIdx into SW_RFB_T. - * - * 07 02 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) for event packet, no need to fill RFB. - * 2) when wlanAdapterStart() failed, no need to initialize state machines - * 3) after Beacon/ProbeResp parsing, corresponding BSS_DESC_T should be marked as IE-parsed - * - * 07 01 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * implementation of DRV-SCN and related mailbox message handling. - * - * 06 29 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * replace g_rQM with Adpater->rQM - * - * 06 23 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Merge g_arStaRec[] into adapter->arStaRec[] - * - * 06 22 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) add command warpper for STA-REC/BSS-INFO sync. - * 2) enhance command packet sending procedure for non-oid part - * 3) add command packet definitions for STA-REC/BSS-INFO sync. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * refine TX-DONE callback. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * implement TX_DONE callback path. - * - * 06 21 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Add TX Done Event handle entry - * - * 06 21 2010 wh.su - * [WPD00003840][MT6620 5931] Security migration - * remove duplicate variable for migration. - * - * 06 15 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * . - * - * 06 15 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * . - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * saa_fsm.c is migrated. - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add management dispatching function table. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) eliminate CFG_CMD_EVENT_VERSION_0_9 - * 2) when disconnected, indicate nic directly (no event is needed) - * - * 06 08 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * cnm_timer has been migrated. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * merge wlan_def.h. - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * sync with MT6620 driver for scan result replacement policy - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 20 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) integrate OID_GEN_NETWORK_LAYER_ADDRESSES with CMD_ID_SET_IP_ADDRESS - * 2) buffer statistics data for 2 seconds - * 3) use default value for adhoc parameters instead of 0 - * - * 05 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) do not take timeout mechanism for power mode oids - * 2) retrieve network type from connection status - * 3) after disassciation, set radio state to off - * 4) TCP option over IPv6 is supported - * - * 04 29 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * fixing the PMKID candicate indicate code. - * - * 04 28 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * change prefix for data structure used to communicate with 802.11 PAL - * to avoid ambiguous naming with firmware interface - * - * 04 27 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * basic implementation for EVENT_BT_OVER_WIFI - * - * 04 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * surpress compiler warning - * - * 04 22 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * - * 1) modify rx path code for supporting Wi-Fi direct - * 2) modify config.h since Linux dont need to consider retaining packet - * - * 04 16 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * treat BUS access failure as kind of card removal. - * - * 04 14 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * nicRxProcessEvent packet doesn't access spin-lock directly from now on. - * - * 04 14 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * do not need to release the spin lock due to it is done inside nicGetPendingCmdInfo() - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * * * * * * * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * * * * * * * * * * * * * 2) command sequence number is now increased atomically - * * * * * * * * * * * * * * * 3) private data could be hold and taken use for other purpose - * - * 04 12 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add channel frequency <-> number conversion - * - * 04 09 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * 1) add spinlock - * 2) add KAPI for handling association info - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * rWlanInfo should be placed at adapter rather than glue due to most operations - * * * * * are done in adapter layer. - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access to prGlueInfo->eParamMediaStateIndicated from non-glue layer - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access for prGlueInfo->fgIsCardRemoved in non-glue layer - * - * 04 01 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * improve Linux supplicant compliance - * - * 03 31 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * fix ioctl which may cause cmdinfo memory leak - * - * 03 30 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * remove driver-land statistics. - * - * 03 29 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * improve none-glue code portability - * - * 03 28 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * rWlanInfo is modified before data is indicated to OS - * - * 03 28 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * rWlanInfo is modified before data is indicated to OS - * - * 03 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add a temporary flag for integration with CMD/EVENT v0.9. - * - * 03 25 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) correct OID_802_11_CONFIGURATION with frequency setting behavior. - * * * the frequency is used for adhoc connection only - * * * 2) update with SD1 v0.9 CMD/EVENT documentation - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port - * - * 03 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * . - * - * 03 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * generate information for OID_GEN_RCV_OK & OID_GEN_XMIT_OK - * * * * - * - * 03 19 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) add ACPI D0/D3 state switching support - * * * * * * * * * 2) use more formal way to handle interrupt when the status is retrieved from enhanced RX response - * - * 03 15 2010 kevin.huang - * [WPD00003820][MT6620 Wi-Fi] Modify the code for meet the WHQL test - * Add event for activate STA_RECORD_T - * - * 03 12 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct fgSetQuery/fgNeedResp check - * - * 03 11 2010 cp.wu - * [WPD00003821][BUG] Host driver stops processing RX packets from HIF RX0 - * add RX starvation warning debug message controlled by CFG_HIF_RX_STARVATION_WARNING - * - * 03 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * code clean: removing unused variables and structure definitions - * - * 03 08 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) add another spin-lock to protect MsduInfoList due to it might be accessed by different thread. - * * * 2) change own-back acquiring procedure to wait for up to 16.67 seconds - * - * 03 02 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) the use of prPendingOid revised, all accessing are now protected by spin lock - * * * * 2) ensure wlanReleasePendingOid will clear all command queues - * - * 03 02 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add mutex to avoid multiple access to qmTxQueue simultaneously. - * - * 02 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * move EVENT_ID_ASSOC_INFO from nic_rx.c to gl_kal_ndis_51.c - * * 'cause it involves OS dependent data structure handling - * - * 02 25 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * correct behavior to prevent duplicated RX handling for RX0_DONE and RX1_DONE - * - * 02 24 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Updated API interfaces for qmHandleEventRxAddBa() and qmHandleEventRxDelBa() - * - * 02 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement host-side firmware download logic - * - * 02 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) remove unused function in nic_rx.c [which has been handled in que_mgt.c] - * * * * * 2) firmware image length is now retrieved via NdisFileOpen - * * * * * 3) firmware image is not structured by (P_IMG_SEC_HDR_T) anymore - * * * * * 4) nicRxWaitResponse() revised - * * * * * 5) another set of TQ counter default value is added for fw-download state - * * * * * 6) Wi-Fi load address is now retrieved from registry too - * - * 02 09 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. Permanent and current MAC address are now retrieved by CMD/EVENT packets instead of hard-coded address - * * * * * * * * 2. follow MSDN defined behavior when associates to another AP - * * * * * * * * 3. for firmware download, packet size could be up to 2048 bytes - * - * 01 27 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * . - * - * 01 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * implement following 802.11 OIDs: - * * * * * * OID_802_11_RSSI, - * * * * * * OID_802_11_RSSI_TRIGGER, - * * * * * * OID_802_11_STATISTICS, - * * * * * * OID_802_11_DISASSOCIATE, - * * * * * * OID_802_11_POWER_MODE - * - * 12 30 2009 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) According to CMD/EVENT documentation v0.8, - * * * * * * * * * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used, - * * * * * * * * * and result is retrieved by get ATInfo instead - * * * * * * * * * 2) add 4 counter for recording aggregation statistics - * - * 12 23 2009 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add a precheck: if free sw rfb is not enough, do not invoke read transactionu1rwduu`wvpghlqg|fu+rp - * - * 12 22 2009 cp.wu - * [WPD00003809][Bug] Host driver will crash when processing reordered MSDUs - * The root cause is pointer accessing by mistake. After dequeued from reordering-buffer, handling logic should access returned pointer instead of pointer which has been passed in before. -** \main\maintrunk.MT6620WiFiDriver_Prj\58 2009-12-17 13:40:33 GMT mtk02752 -** always update prAdapter->rSDIOCtrl when enhanced response is read by RX -** \main\maintrunk.MT6620WiFiDriver_Prj\57 2009-12-16 18:01:38 GMT mtk02752 -** if interrupt enhanced response is fetched by RX enhanced response, RX needs to invoke interrupt handlers too -** \main\maintrunk.MT6620WiFiDriver_Prj\56 2009-12-16 14:16:52 GMT mtk02752 -** \main\maintrunk.MT6620WiFiDriver_Prj\55 2009-12-15 20:03:12 GMT mtk02752 -** ASSERT when RX FreeSwRfb is not enough -** \main\maintrunk.MT6620WiFiDriver_Prj\54 2009-12-15 17:01:29 GMT mtk02752 -** when CFG_SDIO_RX_ENHANCE is enabled, after enhanced response is read, rx procedure should process 1) TX_DONE_INT 2) D2H INT as well -** \main\maintrunk.MT6620WiFiDriver_Prj\53 2009-12-14 20:45:28 GMT mtk02752 -** when CFG_SDIO_RX_ENHANCE is set, TC counter must be updated each time RX enhance response is read -** -** \main\maintrunk.MT6620WiFiDriver_Prj\52 2009-12-14 11:34:16 GMT mtk02752 -** correct a trivial logic issue -** \main\maintrunk.MT6620WiFiDriver_Prj\51 2009-12-14 10:28:25 GMT mtk02752 -** add a protection to avoid out-of-boundary access -** \main\maintrunk.MT6620WiFiDriver_Prj\50 2009-12-10 16:55:18 GMT mtk02752 -** code clean -** \main\maintrunk.MT6620WiFiDriver_Prj\49 2009-12-09 14:06:47 GMT MTK02468 -** Added parsing event packets with EVENT_ID_RX_ADDBA or EVENT_ID_RX_DELBA -** \main\maintrunk.MT6620WiFiDriver_Prj\48 2009-12-08 17:37:51 GMT mtk02752 -** handle EVENT_ID_TEST_STATUS as well -** \main\maintrunk.MT6620WiFiDriver_Prj\47 2009-12-04 17:59:11 GMT mtk02752 -** to pass free-build compilation check -** \main\maintrunk.MT6620WiFiDriver_Prj\46 2009-12-04 12:09:52 GMT mtk02752 -** correct trivial mistake -** \main\maintrunk.MT6620WiFiDriver_Prj\45 2009-12-04 11:53:37 GMT mtk02752 -** all API should be compilable under SD1_SD3_DATAPATH_INTEGRATION == 0 -** \main\maintrunk.MT6620WiFiDriver_Prj\44 2009-12-03 16:19:48 GMT mtk01461 -** Fix the Connected Event -** \main\maintrunk.MT6620WiFiDriver_Prj\43 2009-11-30 10:56:18 GMT mtk02752 -** 1st DW of WIFI_EVENT_T is shared with HIF_RX_HEADER_T -** \main\maintrunk.MT6620WiFiDriver_Prj\42 2009-11-30 10:11:27 GMT mtk02752 -** implement replacement for bss scan result -** \main\maintrunk.MT6620WiFiDriver_Prj\41 2009-11-27 11:08:05 GMT mtk02752 -** add flush for reset -** \main\maintrunk.MT6620WiFiDriver_Prj\40 2009-11-26 09:38:59 GMT mtk02752 -** \main\maintrunk.MT6620WiFiDriver_Prj\39 2009-11-26 09:29:40 GMT mtk02752 -** enable packet forwarding path (for AP mode) -** \main\maintrunk.MT6620WiFiDriver_Prj\38 2009-11-25 21:37:00 GMT mtk02752 -** sync. with EVENT_SCAN_RESULT_T change, and add an assert for checking event size -** \main\maintrunk.MT6620WiFiDriver_Prj\37 2009-11-25 20:17:41 GMT mtk02752 -** fill HIF_TX_HEADER_T.u2SeqNo -** \main\maintrunk.MT6620WiFiDriver_Prj\36 2009-11-25 18:18:57 GMT mtk02752 -** buffer scan result to prGlueInfo->rWlanInfo.arScanResult directly. -** \main\maintrunk.MT6620WiFiDriver_Prj\35 2009-11-24 22:42:45 GMT mtk02752 -** add nicRxAddScanResult() to prepare to handle SCAN_RESULT event (not implemented yet) -** \main\maintrunk.MT6620WiFiDriver_Prj\34 2009-11-24 20:51:41 GMT mtk02752 -** integrate with SD1's data path API -** \main\maintrunk.MT6620WiFiDriver_Prj\33 2009-11-24 19:56:17 GMT mtk02752 -** adopt P_HIF_RX_HEADER_T in new path -** \main\maintrunk.MT6620WiFiDriver_Prj\32 2009-11-23 20:31:21 GMT mtk02752 -** payload to send into pfCmdDoneHandler() will not include WIFI_EVENT_T -** \main\maintrunk.MT6620WiFiDriver_Prj\31 2009-11-23 17:51:34 GMT mtk02752 -** when event packet corresponding to some pendingOID is received, pendingOID should be cleared -** \main\maintrunk.MT6620WiFiDriver_Prj\30 2009-11-23 14:46:54 GMT mtk02752 -** implement nicRxProcessEventPacket() -** \main\maintrunk.MT6620WiFiDriver_Prj\29 2009-11-17 22:40:54 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\28 2009-11-16 21:48:22 GMT mtk02752 -** add SD1_SD3_DATAPATH_INTEGRATION data path handling -** \main\maintrunk.MT6620WiFiDriver_Prj\27 2009-11-16 15:41:18 GMT mtk01084 -** modify the length to be read in emu mode -** \main\maintrunk.MT6620WiFiDriver_Prj\26 2009-11-13 17:00:12 GMT mtk02752 -** add blank function for event packet -** \main\maintrunk.MT6620WiFiDriver_Prj\25 2009-11-13 13:54:24 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\24 2009-11-11 14:41:51 GMT mtk02752 -** fix typo -** \main\maintrunk.MT6620WiFiDriver_Prj\23 2009-11-11 14:33:46 GMT mtk02752 -** add protection when there is no packet avilable -** \main\maintrunk.MT6620WiFiDriver_Prj\22 2009-11-11 12:33:36 GMT mtk02752 -** add RX1 read path for aggregated/enhanced/normal packet read procedures -** \main\maintrunk.MT6620WiFiDriver_Prj\21 2009-11-11 10:36:18 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\20 2009-11-04 14:11:08 GMT mtk01084 -** modify lines in RX aggregation -** \main\maintrunk.MT6620WiFiDriver_Prj\19 2009-10-30 18:17:23 GMT mtk01084 -** modify RX aggregation handling -** \main\maintrunk.MT6620WiFiDriver_Prj\18 2009-10-29 19:56:12 GMT mtk01084 -** modify HAL part -** \main\maintrunk.MT6620WiFiDriver_Prj\17 2009-10-23 16:08:34 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-10-13 21:59:20 GMT mtk01084 -** update for new HW design -** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-10-02 13:59:08 GMT mtk01725 -** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-05-21 23:39:05 GMT mtk01461 -** Fix the paste error of RX STATUS in OOB of HIF Loopback CTRL -** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-05-20 12:25:32 GMT mtk01461 -** Fix process of Read Done, and add u4MaxEventBufferLen to nicRxWaitResponse() -** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-05-18 21:13:18 GMT mtk01426 -** Fixed compiler error -** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-05-18 21:05:29 GMT mtk01426 -** Fixed nicRxSDIOAggReceiveRFBs() ASSERT issue -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-04-28 10:38:43 GMT mtk01461 -** Fix RX STATUS is DW align for SDIO_STATUS_ENHANCE mode and refine nicRxSDIOAggeceiveRFBs() for RX Aggregation -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-04-22 09:12:17 GMT mtk01461 -** Fix nicRxProcessHIFLoopbackPacket(), the size of HIF CTRL LENTH field is 1 byte -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-04-14 15:51:26 GMT mtk01426 -** Update RX OOB Setting -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-03 14:58:58 GMT mtk01426 -** Fixed logical error -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-01 10:58:31 GMT mtk01461 -** Rename the HIF_PKT_TYPE_DATA -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-03-23 21:51:18 GMT mtk01461 -** Fix u4HeaderOffset in nicRxProcessHIFLoopbackPacket() -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-18 21:02:58 GMT mtk01426 -** Add CFG_SDIO_RX_ENHANCE and CFG_HIF_LOOPBACK support -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-17 20:20:59 GMT mtk01426 -** Add nicRxWaitResponse function -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:26:01 GMT mtk01426 -** Init for develop -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -#ifndef LINUX -#include -#else -#include -#endif - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define RX_RESPONSE_TIMEOUT (1000) - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -#if CFG_MGMT_FRAME_HANDLING -static PROCESS_RX_MGT_FUNCTION apfnProcessRxMgtFrame[MAX_NUM_OF_FC_SUBTYPES] = { - #if CFG_SUPPORT_AAA - aaaFsmRunEventRxAssoc, /* subtype 0000: Association request */ - #else - NULL, /* subtype 0000: Association request */ - #endif /* CFG_SUPPORT_AAA */ - saaFsmRunEventRxAssoc, /* subtype 0001: Association response */ - #if CFG_SUPPORT_AAA - aaaFsmRunEventRxAssoc, /* subtype 0010: Reassociation request */ - #else - NULL, /* subtype 0010: Reassociation request */ - #endif /* CFG_SUPPORT_AAA */ - saaFsmRunEventRxAssoc, /* subtype 0011: Reassociation response */ - #if CFG_SUPPORT_ADHOC - bssProcessProbeRequest, /* subtype 0100: Probe request */ - #else - NULL, /* subtype 0100: Probe request */ - #endif /* CFG_SUPPORT_ADHOC */ - scanProcessBeaconAndProbeResp, /* subtype 0101: Probe response */ - NULL, /* subtype 0110: reserved */ - NULL, /* subtype 0111: reserved */ - scanProcessBeaconAndProbeResp, /* subtype 1000: Beacon */ - NULL, /* subtype 1001: ATIM */ - saaFsmRunEventRxDisassoc, /* subtype 1010: Disassociation */ - authCheckRxAuthFrameTransSeq, /* subtype 1011: Authentication */ - saaFsmRunEventRxDeauth, /* subtype 1100: Deauthentication */ - nicRxProcessActionFrame, /* subtype 1101: Action */ - NULL, /* subtype 1110: reserved */ - NULL /* subtype 1111: reserved */ -}; -#endif - - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/*! -* @brief Initialize the RFBs -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxInitialize ( - IN P_ADAPTER_T prAdapter - ) -{ - P_RX_CTRL_T prRxCtrl; - PUINT_8 pucMemHandle; - P_SW_RFB_T prSwRfb = (P_SW_RFB_T)NULL; - UINT_32 i; - - DEBUGFUNC("nicRxInitialize"); - - ASSERT(prAdapter); - prRxCtrl = &prAdapter->rRxCtrl; - - //4 <0> Clear allocated memory. - kalMemZero((PVOID) prRxCtrl->pucRxCached, prRxCtrl->u4RxCachedSize); - - //4 <1> Initialize the RFB lists - QUEUE_INITIALIZE(&prRxCtrl->rFreeSwRfbList); - QUEUE_INITIALIZE(&prRxCtrl->rReceivedRfbList); - QUEUE_INITIALIZE(&prRxCtrl->rIndicatedRfbList); - - pucMemHandle = prRxCtrl->pucRxCached; - for (i = CFG_RX_MAX_PKT_NUM; i != 0; i--) { - prSwRfb = (P_SW_RFB_T)pucMemHandle; - - nicRxSetupRFB(prAdapter, prSwRfb); - nicRxReturnRFB(prAdapter, prSwRfb); - - pucMemHandle += ALIGN_4(sizeof(SW_RFB_T)); - } - - ASSERT(prRxCtrl->rFreeSwRfbList.u4NumElem == CFG_RX_MAX_PKT_NUM); - /* Check if the memory allocation consist with this initialization function */ - ASSERT((UINT_32)(pucMemHandle - prRxCtrl->pucRxCached) == prRxCtrl->u4RxCachedSize); - - //4 <2> Clear all RX counters - RX_RESET_ALL_CNTS(prRxCtrl); - -#if CFG_SDIO_RX_AGG - prRxCtrl->pucRxCoalescingBufPtr = prAdapter->pucCoalescingBufCached; - #if !defined(MT5931) - HAL_CFG_MAX_HIF_RX_LEN_NUM(prAdapter, CFG_SDIO_MAX_RX_AGG_NUM); - #endif -#else - #if !defined(MT5931) - HAL_CFG_MAX_HIF_RX_LEN_NUM(prAdapter, 1); - #endif -#endif - -#if CFG_HIF_STATISTICS - prRxCtrl->u4TotalRxAccessNum = 0; - prRxCtrl->u4TotalRxPacketNum = 0; -#endif - -#if CFG_HIF_RX_STARVATION_WARNING - prRxCtrl->u4QueuedCnt = 0; - prRxCtrl->u4DequeuedCnt = 0; -#endif - - return; -} /* end of nicRxInitialize() */ - - -#if defined(MT5931) -/*----------------------------------------------------------------------------*/ -/*! -* @brief Initialize HIF RX control registers explicitly -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxPostInitialize ( - IN P_ADAPTER_T prAdapter - ) -{ - P_RX_CTRL_T prRxCtrl; - DEBUGFUNC("nicRxPostInitialize"); - - ASSERT(prAdapter); - prRxCtrl = &prAdapter->rRxCtrl; - -#if CFG_SDIO_RX_AGG - HAL_CFG_MAX_HIF_RX_LEN_NUM(prAdapter, CFG_SDIO_MAX_RX_AGG_NUM); -#else - HAL_CFG_MAX_HIF_RX_LEN_NUM(prAdapter, 1); -#endif - -} /* end of nicRxPostInitialize() */ -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Uninitialize the RFBs -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxUninitialize ( - IN P_ADAPTER_T prAdapter - ) -{ - P_RX_CTRL_T prRxCtrl; - P_SW_RFB_T prSwRfb = (P_SW_RFB_T)NULL; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - prRxCtrl = &prAdapter->rRxCtrl; - ASSERT(prRxCtrl); - - nicRxFlush(prAdapter); - - do { - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - QUEUE_REMOVE_HEAD(&prRxCtrl->rReceivedRfbList, prSwRfb, P_SW_RFB_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - if (prSwRfb){ - if (prSwRfb->pvPacket) { - kalPacketFree(prAdapter->prGlueInfo, prSwRfb->pvPacket); - } - prSwRfb->pvPacket = NULL; - } - else { - break; - } - }while (TRUE); - - do { - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - QUEUE_REMOVE_HEAD(&prRxCtrl->rFreeSwRfbList, prSwRfb, P_SW_RFB_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - if (prSwRfb){ - if (prSwRfb->pvPacket) { - kalPacketFree(prAdapter->prGlueInfo, prSwRfb->pvPacket); - } - prSwRfb->pvPacket = NULL; - } - else { - break; - } - }while (TRUE); - - return; -} /* end of nicRxUninitialize() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Fill RFB -* -* @param prAdapter pointer to the Adapter handler -* @param prSWRfb specify the RFB to receive rx data -* -* @return (none) -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxFillRFB ( - IN P_ADAPTER_T prAdapter, - IN OUT P_SW_RFB_T prSwRfb - ) -{ - P_HIF_RX_HEADER_T prHifRxHdr; - - UINT_32 u4PktLen = 0; - UINT_32 u4MacHeaderLen; - UINT_32 u4HeaderOffset; - - DEBUGFUNC("nicRxFillRFB"); - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - prHifRxHdr = prSwRfb->prHifRxHdr; - ASSERT(prHifRxHdr); - - u4PktLen= prHifRxHdr->u2PacketLen; - - u4HeaderOffset = (UINT_32)(prHifRxHdr->ucHerderLenOffset & HIF_RX_HDR_HEADER_OFFSET_MASK); - u4MacHeaderLen = (UINT_32)(prHifRxHdr->ucHerderLenOffset & HIF_RX_HDR_HEADER_LEN) - >> HIF_RX_HDR_HEADER_LEN_OFFSET; - - //DBGLOG(RX, TRACE, ("u4HeaderOffset = %d, u4MacHeaderLen = %d\n", - // u4HeaderOffset, u4MacHeaderLen)); - - prSwRfb->u2HeaderLen = (UINT_16)u4MacHeaderLen; - prSwRfb->pvHeader = (PUINT_8)prHifRxHdr + HIF_RX_HDR_SIZE + u4HeaderOffset; - prSwRfb->u2PacketLen = (UINT_16)(u4PktLen - (HIF_RX_HDR_SIZE + u4HeaderOffset)); - - //DBGLOG(RX, TRACE, ("Dump Rx packet, u2PacketLen = %d\n", prSwRfb->u2PacketLen)); - //DBGLOG_MEM8(RX, TRACE, prSwRfb->pvHeader, prSwRfb->u2PacketLen); - -#if 0 - if (prHifRxHdr->ucReorder & HIF_RX_HDR_80211_HEADER_FORMAT){ - prSwRfb->u4HifRxHdrFlag |= HIF_RX_HDR_FLAG_802_11_FORMAT; - DBGLOG(RX, TRACE, ("HIF_RX_HDR_FLAG_802_11_FORMAT\n")); - } - - if (prHifRxHdr->ucReorder & HIF_RX_HDR_DO_REORDER){ - prSwRfb->u4HifRxHdrFlag |= HIF_RX_HDR_FLAG_DO_REORDERING; - DBGLOG(RX, TRACE, ("HIF_RX_HDR_FLAG_DO_REORDERING\n")); - - /* Get Seq. No and TID, Wlan Index info */ - if (prHifRxHdr->u2SeqNoTid & HIF_RX_HDR_BAR_FRAME){ - prSwRfb->u4HifRxHdrFlag |= HIF_RX_HDR_FLAG_BAR_FRAME; - DBGLOG(RX, TRACE, ("HIF_RX_HDR_FLAG_BAR_FRAME\n")); - } - - prSwRfb->u2SSN = prHifRxHdr->u2SeqNoTid & HIF_RX_HDR_SEQ_NO_MASK; - prSwRfb->ucTid = (UINT_8)((prHifRxHdr->u2SeqNoTid & HIF_RX_HDR_TID_MASK) - >> HIF_RX_HDR_TID_OFFSET); - DBGLOG(RX, TRACE, ("u2SSN = %d, ucTid = %d\n", - prSwRfb->u2SSN, prSwRfb->ucTid)); - } - - if (prHifRxHdr->ucReorder & HIF_RX_HDR_WDS){ - prSwRfb->u4HifRxHdrFlag |= HIF_RX_HDR_FLAG_AMP_WDS; - DBGLOG(RX, TRACE, ("HIF_RX_HDR_FLAG_AMP_WDS\n")); - } -#endif -} - - -#if CFG_TCP_IP_CHKSUM_OFFLOAD || CFG_TCP_IP_CHKSUM_OFFLOAD_NDIS_60 -/*----------------------------------------------------------------------------*/ -/*! -* @brief Fill checksum status in RFB -* -* @param prAdapter pointer to the Adapter handler -* @param prSWRfb the RFB to receive rx data -* @param u4TcpUdpIpCksStatus specify the Checksum status -* -* @return (none) -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxFillChksumStatus( - IN P_ADAPTER_T prAdapter, - IN OUT P_SW_RFB_T prSwRfb, - IN UINT_32 u4TcpUdpIpCksStatus -) -{ - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - if (prAdapter->u4CSUMFlags != CSUM_NOT_SUPPORTED){ - if (u4TcpUdpIpCksStatus & RX_CS_TYPE_IPv4) { // IPv4 packet - prSwRfb->aeCSUM[CSUM_TYPE_IPV6] = CSUM_RES_NONE; - if(u4TcpUdpIpCksStatus & RX_CS_STATUS_IP) { //IP packet csum failed - prSwRfb->aeCSUM[CSUM_TYPE_IPV4] = CSUM_RES_FAILED; - } else { - prSwRfb->aeCSUM[CSUM_TYPE_IPV4] = CSUM_RES_SUCCESS; - } - - if (u4TcpUdpIpCksStatus & RX_CS_TYPE_TCP) { //TCP packet - prSwRfb->aeCSUM[CSUM_TYPE_UDP] = CSUM_RES_NONE; - if(u4TcpUdpIpCksStatus & RX_CS_STATUS_TCP) { //TCP packet csum failed - prSwRfb->aeCSUM[CSUM_TYPE_TCP] = CSUM_RES_FAILED; - } else { - prSwRfb->aeCSUM[CSUM_TYPE_TCP] = CSUM_RES_SUCCESS; - } - } - else if (u4TcpUdpIpCksStatus & RX_CS_TYPE_UDP) { //UDP packet - prSwRfb->aeCSUM[CSUM_TYPE_TCP] = CSUM_RES_NONE; - if(u4TcpUdpIpCksStatus & RX_CS_STATUS_UDP) { //UDP packet csum failed - prSwRfb->aeCSUM[CSUM_TYPE_UDP] = CSUM_RES_FAILED; - } else { - prSwRfb->aeCSUM[CSUM_TYPE_UDP] = CSUM_RES_SUCCESS; - } - } - else { - prSwRfb->aeCSUM[CSUM_TYPE_UDP] = CSUM_RES_NONE; - prSwRfb->aeCSUM[CSUM_TYPE_TCP] = CSUM_RES_NONE; - } - } - else if (u4TcpUdpIpCksStatus & RX_CS_TYPE_IPv6) {//IPv6 packet - prSwRfb->aeCSUM[CSUM_TYPE_IPV4] = CSUM_RES_NONE; - prSwRfb->aeCSUM[CSUM_TYPE_IPV6] = CSUM_RES_SUCCESS; - - if (u4TcpUdpIpCksStatus & RX_CS_TYPE_TCP) { //TCP packet - prSwRfb->aeCSUM[CSUM_TYPE_UDP] = CSUM_RES_NONE; - if(u4TcpUdpIpCksStatus & RX_CS_STATUS_TCP) { //TCP packet csum failed - prSwRfb->aeCSUM[CSUM_TYPE_TCP] = CSUM_RES_FAILED; - } else { - prSwRfb->aeCSUM[CSUM_TYPE_TCP] = CSUM_RES_SUCCESS; - } - } - else if (u4TcpUdpIpCksStatus & RX_CS_TYPE_UDP) { //UDP packet - prSwRfb->aeCSUM[CSUM_TYPE_TCP] = CSUM_RES_NONE; - if(u4TcpUdpIpCksStatus & RX_CS_STATUS_UDP) { //UDP packet csum failed - prSwRfb->aeCSUM[CSUM_TYPE_UDP] = CSUM_RES_FAILED; - } else { - prSwRfb->aeCSUM[CSUM_TYPE_UDP] = CSUM_RES_SUCCESS; - } - } - else { - prSwRfb->aeCSUM[CSUM_TYPE_UDP] = CSUM_RES_NONE; - prSwRfb->aeCSUM[CSUM_TYPE_TCP] = CSUM_RES_NONE; - } - } - else { - prSwRfb->aeCSUM[CSUM_TYPE_IPV4] = CSUM_RES_NONE; - prSwRfb->aeCSUM[CSUM_TYPE_IPV6] = CSUM_RES_NONE; - } - } - -} -#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Process packet doesn't need to do buffer reordering -* -* @param prAdapter pointer to the Adapter handler -* @param prSWRfb the RFB to receive rx data -* -* @return (none) -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxProcessPktWithoutReorder ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_RX_CTRL_T prRxCtrl; - P_TX_CTRL_T prTxCtrl; - BOOL fgIsRetained = FALSE; - UINT_32 u4CurrentRxBufferCount; - P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL; - - DEBUGFUNC("nicRxProcessPktWithoutReorder"); - //DBGLOG(RX, TRACE, ("\n")); - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - prRxCtrl = &prAdapter->rRxCtrl; - ASSERT(prRxCtrl); - - prTxCtrl = &prAdapter->rTxCtrl; - ASSERT(prTxCtrl); - - u4CurrentRxBufferCount = prRxCtrl->rFreeSwRfbList.u4NumElem; - /* QM USED = $A, AVAILABLE COUNT = $B, INDICATED TO OS = $C - * TOTAL = $A + $B + $C - * - * Case #1 (Retain) - * ------------------------------------------------------- - * $A + $B < THRESHOLD := $A + $B + $C < THRESHOLD + $C := $TOTAL - THRESHOLD < $C - * => $C used too much, retain - * - * Case #2 (Non-Retain) - * ------------------------------------------------------- - * $A + $B > THRESHOLD := $A + $B + $C > THRESHOLD + $C := $TOTAL - THRESHOLD > $C - * => still availble for $C to use - * - */ - fgIsRetained = (((u4CurrentRxBufferCount + - qmGetRxReorderQueuedBufferCount(prAdapter) + - prTxCtrl->i4PendingFwdFrameCount) < CFG_RX_RETAINED_PKT_THRESHOLD) ? - TRUE : FALSE); - - //DBGLOG(RX, INFO, ("fgIsRetained = %d\n", fgIsRetained)); - - if (kalProcessRxPacket(prAdapter->prGlueInfo, - prSwRfb->pvPacket, - prSwRfb->pvHeader, - (UINT_32)prSwRfb->u2PacketLen, - fgIsRetained, - prSwRfb->aeCSUM) != WLAN_STATUS_SUCCESS) { - DBGLOG(RX, ERROR, ("kalProcessRxPacket return value != WLAN_STATUS_SUCCESS\n")); - ASSERT(0); - - nicRxReturnRFB(prAdapter, prSwRfb); - return; - } - else { - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - - if (prStaRec) { -#if CFG_ENABLE_WIFI_DIRECT - if (prStaRec->ucNetTypeIndex == NETWORK_TYPE_P2P_INDEX && - prAdapter->fgIsP2PRegistered == TRUE) { - GLUE_SET_PKT_FLAG_P2P(prSwRfb->pvPacket); - } -#endif -#if CFG_ENABLE_BT_OVER_WIFI - if (prStaRec->ucNetTypeIndex == NETWORK_TYPE_BOW_INDEX) { - GLUE_SET_PKT_FLAG_PAL(prSwRfb->pvPacket); - } -#endif - } - prRxCtrl->apvIndPacket[prRxCtrl->ucNumIndPacket] = prSwRfb->pvPacket; - prRxCtrl->ucNumIndPacket++; - } - - if (fgIsRetained) { - prRxCtrl->apvRetainedPacket[prRxCtrl->ucNumRetainedPacket] = prSwRfb->pvPacket; - prRxCtrl->ucNumRetainedPacket++; - /* TODO : error handling of nicRxSetupRFB */ - nicRxSetupRFB(prAdapter, prSwRfb); - nicRxReturnRFB(prAdapter, prSwRfb); - } - else{ - prSwRfb->pvPacket = NULL; - nicRxReturnRFB(prAdapter, prSwRfb); - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Process forwarding data packet -* -* @param prAdapter pointer to the Adapter handler -* @param prSWRfb the RFB to receive rx data -* -* @return (none) -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxProcessForwardPkt ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_MSDU_INFO_T prMsduInfo, prRetMsduInfoList; - P_TX_CTRL_T prTxCtrl; - P_RX_CTRL_T prRxCtrl; - KAL_SPIN_LOCK_DECLARATION(); - - DEBUGFUNC("nicRxProcessForwardPkt"); - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - prTxCtrl = &prAdapter->rTxCtrl; - prRxCtrl = &prAdapter->rRxCtrl; - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_MSDU_INFO_LIST); - QUEUE_REMOVE_HEAD(&prTxCtrl->rFreeMsduInfoList, prMsduInfo, P_MSDU_INFO_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_MSDU_INFO_LIST); - - if(prMsduInfo && kalProcessRxPacket(prAdapter->prGlueInfo, - prSwRfb->pvPacket, - prSwRfb->pvHeader, - (UINT_32)prSwRfb->u2PacketLen, - prRxCtrl->rFreeSwRfbList.u4NumElem < CFG_RX_RETAINED_PKT_THRESHOLD ? TRUE : FALSE, - prSwRfb->aeCSUM) == WLAN_STATUS_SUCCESS) { - - prMsduInfo->eSrc = TX_PACKET_FORWARDING; - // pack into MSDU_INFO_T - nicTxFillMsduInfo(prAdapter, prMsduInfo, (P_NATIVE_PACKET)(prSwRfb->pvPacket)); - // Overwrite the ucNetworkType - prMsduInfo->ucNetworkType = HIF_RX_HDR_GET_NETWORK_IDX(prSwRfb->prHifRxHdr); - - // release RX buffer (to rIndicatedRfbList) - prSwRfb->pvPacket = NULL; - nicRxReturnRFB(prAdapter, prSwRfb); - - // increase forward frame counter - GLUE_INC_REF_CNT(prTxCtrl->i4PendingFwdFrameCount); - - // send into TX queue - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_QM_TX_QUEUE); - prRetMsduInfoList = qmEnqueueTxPackets(prAdapter, prMsduInfo); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_QM_TX_QUEUE); - - if(prRetMsduInfoList != NULL) { // TX queue refuses queuing the packet - nicTxFreeMsduInfoPacket(prAdapter, prRetMsduInfoList); - nicTxReturnMsduInfo(prAdapter, prRetMsduInfoList); - } - /* indicate service thread for sending */ - if(prTxCtrl->i4PendingFwdFrameCount > 0) { - kalSetEvent(prAdapter->prGlueInfo); - } - } - else { // no TX resource - nicRxReturnRFB(prAdapter, prSwRfb); - } - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Process broadcast data packet for both host and forwarding -* -* @param prAdapter pointer to the Adapter handler -* @param prSWRfb the RFB to receive rx data -* -* @return (none) -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxProcessGOBroadcastPkt ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_SW_RFB_T prSwRfbDuplicated; - P_TX_CTRL_T prTxCtrl; - P_RX_CTRL_T prRxCtrl; - P_HIF_RX_HEADER_T prHifRxHdr; - - KAL_SPIN_LOCK_DECLARATION(); - - DEBUGFUNC("nicRxProcessGOBroadcastPkt"); - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - prTxCtrl = &prAdapter->rTxCtrl; - prRxCtrl = &prAdapter->rRxCtrl; - - prHifRxHdr = prSwRfb->prHifRxHdr; - ASSERT(prHifRxHdr); - - ASSERT(CFG_NUM_OF_QM_RX_PKT_NUM >= 16); - - if( prRxCtrl->rFreeSwRfbList.u4NumElem - >= (CFG_RX_MAX_PKT_NUM - (CFG_NUM_OF_QM_RX_PKT_NUM - 16 /* Reserved for others */) ) ) { - - /* 1. Duplicate SW_RFB_T */ - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - QUEUE_REMOVE_HEAD(&prRxCtrl->rFreeSwRfbList, prSwRfbDuplicated, P_SW_RFB_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - - if(prSwRfbDuplicated){ - kalMemCopy(prSwRfbDuplicated->pucRecvBuff, - prSwRfb->pucRecvBuff, - ALIGN_4(prHifRxHdr->u2PacketLen + HIF_RX_HW_APPENDED_LEN)); - - prSwRfbDuplicated->ucPacketType = HIF_RX_PKT_TYPE_DATA; - prSwRfbDuplicated->ucStaRecIdx = (UINT_8)(prHifRxHdr->ucStaRecIdx); - nicRxFillRFB(prAdapter, prSwRfbDuplicated); - - /* 2. Modify eDst */ - prSwRfbDuplicated->eDst = RX_PKT_DESTINATION_FORWARD; - - /* 4. Forward */ - nicRxProcessForwardPkt(prAdapter, prSwRfbDuplicated); - } - } - else { - DBGLOG(RX, WARN, ("Stop to forward BMC packet due to less free Sw Rfb %u\n", prRxCtrl->rFreeSwRfbList.u4NumElem)); - } - - /* 3. Indicate to host */ - prSwRfb->eDst = RX_PKT_DESTINATION_HOST; - nicRxProcessPktWithoutReorder(prAdapter, prSwRfb); - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Process HIF data packet -* -* @param prAdapter pointer to the Adapter handler -* @param prSWRfb the RFB to receive rx data -* -* @return (none) -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxProcessDataPacket ( - IN P_ADAPTER_T prAdapter, - IN OUT P_SW_RFB_T prSwRfb - ) -{ - P_RX_CTRL_T prRxCtrl; - P_SW_RFB_T prRetSwRfb, prNextSwRfb; - P_HIF_RX_HEADER_T prHifRxHdr; - P_STA_RECORD_T prStaRec; - - DEBUGFUNC("nicRxProcessDataPacket"); - //DBGLOG(INIT, TRACE, ("\n")); - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - prHifRxHdr = prSwRfb->prHifRxHdr; - prRxCtrl = &prAdapter->rRxCtrl; - - nicRxFillRFB(prAdapter, prSwRfb); - -#if 1 /* Check 1x Pkt */ - if (prSwRfb->u2PacketLen > 14) { - PUINT_8 pc = (PUINT_8)prSwRfb->pvHeader; - UINT_16 u2Etype = 0; - - u2Etype = (pc[ETH_TYPE_LEN_OFFSET] << 8) | (pc[ETH_TYPE_LEN_OFFSET + 1]); - -#if CFG_SUPPORT_WAPI - if (u2Etype == ETH_P_1X || u2Etype == ETH_WPI_1X) { - DBGLOG(RSN, INFO, ("R1X len=%d\n", prSwRfb->u2PacketLen)); - } -#else - if (u2Etype == ETH_P_1X) { - DBGLOG(RSN, INFO, ("R1X len=%d\n", prSwRfb->u2PacketLen)); - } -#endif - else if (u2Etype == ETH_P_PRE_1X) { - DBGLOG(RSN, INFO, ("Pre R1X len=%d\n", prSwRfb->u2PacketLen)); - } - } -#endif - -#if CFG_TCP_IP_CHKSUM_OFFLOAD || CFG_TCP_IP_CHKSUM_OFFLOAD_NDIS_60 - { - UINT_32 u4TcpUdpIpCksStatus; - - u4TcpUdpIpCksStatus = *((PUINT_32)((UINT_32)prHifRxHdr + - (UINT_32)(ALIGN_4(prHifRxHdr->u2PacketLen)))); - nicRxFillChksumStatus(prAdapter, prSwRfb, u4TcpUdpIpCksStatus); - - } -#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */ - - prStaRec = cnmGetStaRecByIndex(prAdapter, prHifRxHdr->ucStaRecIdx); - if(secCheckClassError(prAdapter, prSwRfb, prStaRec) == TRUE && - prAdapter->fgTestMode == FALSE) { -#if CFG_HIF_RX_STARVATION_WARNING - prRxCtrl->u4QueuedCnt++; -#endif - - if((prRetSwRfb = qmHandleRxPackets(prAdapter, prSwRfb)) != NULL) { - do { - // save next first - prNextSwRfb = (P_SW_RFB_T)QUEUE_GET_NEXT_ENTRY((P_QUE_ENTRY_T)prRetSwRfb); - - switch(prRetSwRfb->eDst) { - case RX_PKT_DESTINATION_HOST: - nicRxProcessPktWithoutReorder(prAdapter, prRetSwRfb); - break; - - case RX_PKT_DESTINATION_FORWARD: - nicRxProcessForwardPkt(prAdapter, prRetSwRfb); - break; - - case RX_PKT_DESTINATION_HOST_WITH_FORWARD: - nicRxProcessGOBroadcastPkt(prAdapter, prRetSwRfb); - break; - - case RX_PKT_DESTINATION_NULL: - nicRxReturnRFB(prAdapter, prRetSwRfb); - RX_INC_CNT(prRxCtrl, RX_DST_NULL_DROP_COUNT); - RX_INC_CNT(prRxCtrl, RX_DROP_TOTAL_COUNT); - break; - - default: - break; - } -#if CFG_HIF_RX_STARVATION_WARNING - prRxCtrl->u4DequeuedCnt++; -#endif - prRetSwRfb = prNextSwRfb; - } while(prRetSwRfb); - } - } - else { - nicRxReturnRFB(prAdapter, prSwRfb); - RX_INC_CNT(prRxCtrl, RX_CLASS_ERR_DROP_COUNT); - RX_INC_CNT(prRxCtrl, RX_DROP_TOTAL_COUNT); - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Process HIF event packet -* -* @param prAdapter pointer to the Adapter handler -* @param prSWRfb the RFB to receive rx data -* -* @return (none) -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxProcessEventPacket ( - IN P_ADAPTER_T prAdapter, - IN OUT P_SW_RFB_T prSwRfb - ) -{ - P_CMD_INFO_T prCmdInfo; - P_MSDU_INFO_T prMsduInfo; - P_WIFI_EVENT_T prEvent; - P_GLUE_INFO_T prGlueInfo; - - DEBUGFUNC("nicRxProcessEventPacket"); - //DBGLOG(INIT, TRACE, ("\n")); - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - prEvent = (P_WIFI_EVENT_T) prSwRfb->pucRecvBuff; - prGlueInfo = prAdapter->prGlueInfo; - - // Event Handling - switch(prEvent->ucEID) { - case EVENT_ID_CMD_RESULT: - prCmdInfo = nicGetPendingCmdInfo(prAdapter, prEvent->ucSeqNum); - - if(prCmdInfo != NULL) { - P_EVENT_CMD_RESULT prCmdResult; - prCmdResult = (P_EVENT_CMD_RESULT) ((PUINT_8)prEvent + EVENT_HDR_SIZE); - - /* CMD_RESULT should be only in response to Set commands */ - ASSERT(prCmdInfo->fgSetQuery == FALSE || prCmdInfo->fgNeedResp == TRUE); - - if(prCmdResult->ucStatus == 0) { // success - if(prCmdInfo->pfCmdDoneHandler) { - prCmdInfo->pfCmdDoneHandler(prAdapter, prCmdInfo, prEvent->aucBuffer); - } - else if(prCmdInfo->fgIsOid == TRUE) { - kalOidComplete(prAdapter->prGlueInfo, prCmdInfo->fgSetQuery, 0, WLAN_STATUS_SUCCESS); - } - } - else if(prCmdResult->ucStatus == 1) { // reject - if(prCmdInfo->fgIsOid == TRUE) - kalOidComplete(prAdapter->prGlueInfo, prCmdInfo->fgSetQuery, 0, WLAN_STATUS_FAILURE); - } - else if(prCmdResult->ucStatus == 2) { // unknown CMD - if(prCmdInfo->fgIsOid == TRUE) - kalOidComplete(prAdapter->prGlueInfo, prCmdInfo->fgSetQuery, 0, WLAN_STATUS_NOT_SUPPORTED); - } - - // return prCmdInfo - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - } - - break; - -#if 0 - case EVENT_ID_CONNECTION_STATUS: - /* OBSELETE */ - { - P_EVENT_CONNECTION_STATUS prConnectionStatus; - prConnectionStatus = (P_EVENT_CONNECTION_STATUS) (prEvent->aucBuffer); - - DbgPrint("RX EVENT: EVENT_ID_CONNECTION_STATUS = %d\n", prConnectionStatus->ucMediaStatus); - if (prConnectionStatus->ucMediaStatus == PARAM_MEDIA_STATE_DISCONNECTED) { // disconnected - if(kalGetMediaStateIndicated(prGlueInfo) != PARAM_MEDIA_STATE_DISCONNECTED) { - - kalIndicateStatusAndComplete(prGlueInfo, - WLAN_STATUS_MEDIA_DISCONNECT, - NULL, - 0); - - prAdapter->rWlanInfo.u4SysTime = kalGetTimeTick(); - } - } - else if(prConnectionStatus->ucMediaStatus == PARAM_MEDIA_STATE_CONNECTED) { // connected - prAdapter->rWlanInfo.u4SysTime = kalGetTimeTick(); - - // fill information for association result - prAdapter->rWlanInfo.rCurrBssId.rSsid.u4SsidLen - = prConnectionStatus->ucSsidLen; - kalMemCopy(prAdapter->rWlanInfo.rCurrBssId.rSsid.aucSsid, - prConnectionStatus->aucSsid, - prConnectionStatus->ucSsidLen); - - kalMemCopy(prAdapter->rWlanInfo.rCurrBssId.arMacAddress, - prConnectionStatus->aucBssid, - MAC_ADDR_LEN); - - prAdapter->rWlanInfo.rCurrBssId.u4Privacy - = prConnectionStatus->ucEncryptStatus; // @FIXME - prAdapter->rWlanInfo.rCurrBssId.rRssi - = 0; //@FIXME - prAdapter->rWlanInfo.rCurrBssId.eNetworkTypeInUse - = PARAM_NETWORK_TYPE_AUTOMODE; //@FIXME - prAdapter->rWlanInfo.rCurrBssId.rConfiguration.u4BeaconPeriod - = prConnectionStatus->u2BeaconPeriod; - prAdapter->rWlanInfo.rCurrBssId.rConfiguration.u4ATIMWindow - = prConnectionStatus->u2ATIMWindow; - prAdapter->rWlanInfo.rCurrBssId.rConfiguration.u4DSConfig - = prConnectionStatus->u4FreqInKHz; - prAdapter->rWlanInfo.ucNetworkType - = prConnectionStatus->ucNetworkType; - - switch(prConnectionStatus->ucInfraMode) { - case 0: - prAdapter->rWlanInfo.rCurrBssId.eOpMode = NET_TYPE_IBSS; - break; - case 1: - prAdapter->rWlanInfo.rCurrBssId.eOpMode = NET_TYPE_INFRA; - break; - case 2: - default: - prAdapter->rWlanInfo.rCurrBssId.eOpMode = NET_TYPE_AUTO_SWITCH; - break; - } - // always indicate to OS according to MSDN (re-association/roaming) - kalIndicateStatusAndComplete(prGlueInfo, - WLAN_STATUS_MEDIA_CONNECT, - NULL, - 0); - } - } - break; - - case EVENT_ID_SCAN_RESULT: - /* OBSELETE */ - break; -#endif - - case EVENT_ID_RX_ADDBA: - /* The FW indicates that an RX BA agreement will be established */ - qmHandleEventRxAddBa(prAdapter, prEvent); - break; - - case EVENT_ID_RX_DELBA: - /* The FW indicates that an RX BA agreement has been deleted */ - qmHandleEventRxDelBa(prAdapter, prEvent); - break; - - case EVENT_ID_LINK_QUALITY: -#if CFG_ENABLE_WIFI_DIRECT && CFG_SUPPORT_P2P_RSSI_QUERY - if (prEvent->u2PacketLen == EVENT_HDR_SIZE + sizeof(EVENT_LINK_QUALITY_EX)) { - P_EVENT_LINK_QUALITY_EX prLqEx = (P_EVENT_LINK_QUALITY_EX)(prEvent->aucBuffer); - - if (prLqEx->ucIsLQ0Rdy) { - nicUpdateLinkQuality(prAdapter, NETWORK_TYPE_AIS_INDEX, (P_EVENT_LINK_QUALITY)prLqEx); - } - if (prLqEx->ucIsLQ1Rdy) { - nicUpdateLinkQuality(prAdapter, NETWORK_TYPE_P2P_INDEX, (P_EVENT_LINK_QUALITY)prLqEx); - } - } - else { - /* For old FW, P2P may invoke link quality query, and make driver flag becone TRUE. */ - DBGLOG(P2P, WARN, ("Old FW version, not support P2P RSSI query.\n")); - - /* Must not use NETWORK_TYPE_P2P_INDEX, cause the structure is mismatch. */ - nicUpdateLinkQuality(prAdapter, NETWORK_TYPE_AIS_INDEX, (P_EVENT_LINK_QUALITY)(prEvent->aucBuffer)); - } -#else - nicUpdateLinkQuality(prAdapter, NETWORK_TYPE_AIS_INDEX, (P_EVENT_LINK_QUALITY)(prEvent->aucBuffer)); -#endif - - /* command response handling */ - prCmdInfo = nicGetPendingCmdInfo(prAdapter, prEvent->ucSeqNum); - - if(prCmdInfo != NULL) { - if (prCmdInfo->pfCmdDoneHandler) { - prCmdInfo->pfCmdDoneHandler(prAdapter, prCmdInfo, prEvent->aucBuffer); - } - else if(prCmdInfo->fgIsOid) { - kalOidComplete(prAdapter->prGlueInfo, prCmdInfo->fgSetQuery, 0, WLAN_STATUS_SUCCESS); - } - - // return prCmdInfo - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - } - - #ifndef LINUX - if(prAdapter->rWlanInfo.eRssiTriggerType == ENUM_RSSI_TRIGGER_GREATER && - prAdapter->rWlanInfo.rRssiTriggerValue >= (PARAM_RSSI)(prAdapter->rLinkQuality.cRssi)) { - prAdapter->rWlanInfo.eRssiTriggerType = ENUM_RSSI_TRIGGER_TRIGGERED; - - kalIndicateStatusAndComplete(prGlueInfo, - WLAN_STATUS_MEDIA_SPECIFIC_INDICATION, - (PVOID) &(prAdapter->rWlanInfo.rRssiTriggerValue), sizeof(PARAM_RSSI)); - } - else if(prAdapter->rWlanInfo.eRssiTriggerType == ENUM_RSSI_TRIGGER_LESS && - prAdapter->rWlanInfo.rRssiTriggerValue <= (PARAM_RSSI)(prAdapter->rLinkQuality.cRssi)) { - prAdapter->rWlanInfo.eRssiTriggerType = ENUM_RSSI_TRIGGER_TRIGGERED; - - kalIndicateStatusAndComplete(prGlueInfo, - WLAN_STATUS_MEDIA_SPECIFIC_INDICATION, - (PVOID) &(prAdapter->rWlanInfo.rRssiTriggerValue), sizeof(PARAM_RSSI)); - } - #endif - - break; - - case EVENT_ID_MIC_ERR_INFO: - { - P_EVENT_MIC_ERR_INFO prMicError; - //P_PARAM_AUTH_EVENT_T prAuthEvent; - P_STA_RECORD_T prStaRec; - - DBGLOG(RSN, EVENT, ("EVENT_ID_MIC_ERR_INFO\n")); - - prMicError = (P_EVENT_MIC_ERR_INFO)(prEvent->aucBuffer); - prStaRec = cnmGetStaRecByAddress(prAdapter, - (UINT_8) NETWORK_TYPE_AIS_INDEX, - prAdapter->rWlanInfo.rCurrBssId.arMacAddress); - ASSERT(prStaRec); - - if (prStaRec) { - rsnTkipHandleMICFailure(prAdapter, prStaRec, (BOOLEAN)prMicError->u4Flags); - } - else { - DBGLOG(RSN, INFO, ("No STA rec!!\n")); - } -#if 0 - prAuthEvent = (P_PARAM_AUTH_EVENT_T)prAdapter->aucIndicationEventBuffer; - - /* Status type: Authentication Event */ - prAuthEvent->rStatus.eStatusType = ENUM_STATUS_TYPE_AUTHENTICATION; - - /* Authentication request */ - prAuthEvent->arRequest[0].u4Length = sizeof(PARAM_AUTH_REQUEST_T); - kalMemCopy((PVOID)prAuthEvent->arRequest[0].arBssid, - (PVOID)prAdapter->rWlanInfo.rCurrBssId.arMacAddress, /* whsu:Todo? */ - PARAM_MAC_ADDR_LEN); - - if (prMicError->u4Flags != 0) { - prAuthEvent->arRequest[0].u4Flags = PARAM_AUTH_REQUEST_GROUP_ERROR; - } - else { - prAuthEvent->arRequest[0].u4Flags = PARAM_AUTH_REQUEST_PAIRWISE_ERROR; - } - - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_SPECIFIC_INDICATION, - (PVOID)prAuthEvent, - sizeof(PARAM_STATUS_INDICATION_T) + sizeof(PARAM_AUTH_REQUEST_T)); -#endif - } - break; - - case EVENT_ID_ASSOC_INFO: - { - P_EVENT_ASSOC_INFO prAssocInfo; - prAssocInfo = (P_EVENT_ASSOC_INFO)(prEvent->aucBuffer); - - kalHandleAssocInfo(prAdapter->prGlueInfo, prAssocInfo); - } - break; - - case EVENT_ID_802_11_PMKID: - { - P_PARAM_AUTH_EVENT_T prAuthEvent; - PUINT_8 cp; - UINT_32 u4LenOfUsedBuffer; - - prAuthEvent = (P_PARAM_AUTH_EVENT_T)prAdapter->aucIndicationEventBuffer; - - prAuthEvent->rStatus.eStatusType = ENUM_STATUS_TYPE_CANDIDATE_LIST; - - u4LenOfUsedBuffer = (UINT_32)(prEvent->u2PacketLen - 8); - - prAuthEvent->arRequest[0].u4Length = u4LenOfUsedBuffer; - - cp = (PUINT_8)&prAuthEvent->arRequest[0]; - - /* Status type: PMKID Candidatelist Event */ - kalMemCopy(cp, (P_EVENT_PMKID_CANDIDATE_LIST_T)(prEvent->aucBuffer), prEvent->u2PacketLen - 8); - - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_MEDIA_SPECIFIC_INDICATION, - (PVOID)prAuthEvent, - sizeof(PARAM_STATUS_INDICATION_T) + u4LenOfUsedBuffer); - } - break; - -#if 0 - case EVENT_ID_ACTIVATE_STA_REC_T: - { - P_EVENT_ACTIVATE_STA_REC_T prActivateStaRec; - prActivateStaRec = (P_EVENT_ACTIVATE_STA_REC_T)(prEvent->aucBuffer); - - DbgPrint("RX EVENT: EVENT_ID_ACTIVATE_STA_REC_T Index:%d, MAC:["MACSTR"]\n", - prActivateStaRec->ucStaRecIdx, - MAC2STR(prActivateStaRec->aucMacAddr)); - - qmActivateStaRec(prAdapter, - (UINT_32)prActivateStaRec->ucStaRecIdx, - ((prActivateStaRec->fgIsQoS) ? TRUE: FALSE), - prActivateStaRec->ucNetworkTypeIndex, - ((prActivateStaRec->fgIsAP) ? TRUE: FALSE), - prActivateStaRec->aucMacAddr); - - } - break; - - case EVENT_ID_DEACTIVATE_STA_REC_T: - { - P_EVENT_DEACTIVATE_STA_REC_T prDeactivateStaRec; - prDeactivateStaRec = (P_EVENT_DEACTIVATE_STA_REC_T)(prEvent->aucBuffer); - - DbgPrint("RX EVENT: EVENT_ID_DEACTIVATE_STA_REC_T Index:%d, MAC:["MACSTR"]\n", - prDeactivateStaRec->ucStaRecIdx); - - qmDeactivateStaRec(prAdapter, - prDeactivateStaRec->ucStaRecIdx); - } - break; -#endif - - case EVENT_ID_SCAN_DONE: - scnEventScanDone(prAdapter, (P_EVENT_SCAN_DONE)(prEvent->aucBuffer)); - break; - - case EVENT_ID_TX_DONE: - { - P_EVENT_TX_DONE_T prTxDone; - prTxDone = (P_EVENT_TX_DONE_T)(prEvent->aucBuffer); - - DBGLOG(INIT, TRACE,("EVENT_ID_TX_DONE PacketSeq:%u ucStatus: %u SN: %u\n", - prTxDone->ucPacketSeq, prTxDone->ucStatus, prTxDone->u2SequenceNumber)); - - /* call related TX Done Handler */ - prMsduInfo = nicGetPendingTxMsduInfo(prAdapter, prTxDone->ucPacketSeq); - -#if CFG_SUPPORT_802_11V_TIMING_MEASUREMENT - DBGLOG(INIT, TRACE, ("EVENT_ID_TX_DONE u4TimeStamp = %x u2AirDelay = %x\n", - prTxDone->au4Reserved1, prTxDone->au4Reserved2)); - - wnmReportTimingMeas(prAdapter, prMsduInfo->ucStaRecIndex, - prTxDone->au4Reserved1, prTxDone->au4Reserved1 + prTxDone->au4Reserved2); -#endif - - if(prMsduInfo) { - prMsduInfo->pfTxDoneHandler(prAdapter, prMsduInfo, (ENUM_TX_RESULT_CODE_T)(prTxDone->ucStatus)); - - cnmMgtPktFree(prAdapter, prMsduInfo); - } - } - break; - - case EVENT_ID_SLEEPY_NOTIFY: - { - P_EVENT_SLEEPY_NOTIFY prEventSleepyNotify; - prEventSleepyNotify = (P_EVENT_SLEEPY_NOTIFY)(prEvent->aucBuffer); - - //DBGLOG(RX, INFO, ("ucSleepyState = %d\n", prEventSleepyNotify->ucSleepyState)); - - prAdapter->fgWiFiInSleepyState = (BOOLEAN)(prEventSleepyNotify->ucSleepyState); - } - break; - case EVENT_ID_BT_OVER_WIFI: -#if CFG_ENABLE_BT_OVER_WIFI - { - UINT_8 aucTmp[sizeof(AMPC_EVENT) + sizeof(BOW_LINK_DISCONNECTED)]; - P_EVENT_BT_OVER_WIFI prEventBtOverWifi; - P_AMPC_EVENT prBowEvent; - P_BOW_LINK_CONNECTED prBowLinkConnected; - P_BOW_LINK_DISCONNECTED prBowLinkDisconnected; - - prEventBtOverWifi = (P_EVENT_BT_OVER_WIFI)(prEvent->aucBuffer); - - // construct event header - prBowEvent = (P_AMPC_EVENT)aucTmp; - - if(prEventBtOverWifi->ucLinkStatus == 0) { - // Connection - prBowEvent->rHeader.ucEventId = BOW_EVENT_ID_LINK_CONNECTED; - prBowEvent->rHeader.ucSeqNumber = 0; - prBowEvent->rHeader.u2PayloadLength = sizeof(BOW_LINK_CONNECTED); - - // fill event body - prBowLinkConnected = (P_BOW_LINK_CONNECTED)(prBowEvent->aucPayload); - prBowLinkConnected->rChannel.ucChannelNum = prEventBtOverWifi->ucSelectedChannel; - kalMemZero(prBowLinkConnected->aucPeerAddress, MAC_ADDR_LEN); //@FIXME - - kalIndicateBOWEvent(prAdapter->prGlueInfo, prBowEvent); - } - else { - // Disconnection - prBowEvent->rHeader.ucEventId = BOW_EVENT_ID_LINK_DISCONNECTED; - prBowEvent->rHeader.ucSeqNumber = 0; - prBowEvent->rHeader.u2PayloadLength = sizeof(BOW_LINK_DISCONNECTED); - - // fill event body - prBowLinkDisconnected = (P_BOW_LINK_DISCONNECTED)(prBowEvent->aucPayload); - prBowLinkDisconnected->ucReason = 0; //@FIXME - kalMemZero(prBowLinkDisconnected->aucPeerAddress, MAC_ADDR_LEN); //@FIXME - - kalIndicateBOWEvent(prAdapter->prGlueInfo, prBowEvent); - } - } - break; -#endif - case EVENT_ID_STATISTICS: - /* buffer statistics for further query */ - prAdapter->fgIsStatValid = TRUE; - prAdapter->rStatUpdateTime = kalGetTimeTick(); - kalMemCopy(&prAdapter->rStatStruct, prEvent->aucBuffer, sizeof(EVENT_STATISTICS)); - - /* command response handling */ - prCmdInfo = nicGetPendingCmdInfo(prAdapter, prEvent->ucSeqNum); - - if(prCmdInfo != NULL) { - if (prCmdInfo->pfCmdDoneHandler) { - prCmdInfo->pfCmdDoneHandler(prAdapter, prCmdInfo, prEvent->aucBuffer); - } - else if(prCmdInfo->fgIsOid) { - kalOidComplete(prAdapter->prGlueInfo, prCmdInfo->fgSetQuery, 0, WLAN_STATUS_SUCCESS); - } - - // return prCmdInfo - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - } - - break; - - case EVENT_ID_CH_PRIVILEGE: - cnmChMngrHandleChEvent(prAdapter, prEvent); - break; - - case EVENT_ID_BSS_ABSENCE_PRESENCE: - qmHandleEventBssAbsencePresence(prAdapter, prEvent); - break; - - case EVENT_ID_STA_CHANGE_PS_MODE: - qmHandleEventStaChangePsMode(prAdapter, prEvent); - break; -#if CFG_ENABLE_WIFI_DIRECT - case EVENT_ID_STA_UPDATE_FREE_QUOTA: - qmHandleEventStaUpdateFreeQuota(prAdapter, prEvent); - break; -#endif - case EVENT_ID_BSS_BEACON_TIMEOUT: - DBGLOG(INIT, INFO,("EVENT_ID_BSS_BEACON_TIMEOUT\n")); - - if (prAdapter->fgDisBcnLostDetection == FALSE) { - P_EVENT_BSS_BEACON_TIMEOUT_T prEventBssBeaconTimeout; - prEventBssBeaconTimeout = (P_EVENT_BSS_BEACON_TIMEOUT_T)(prEvent->aucBuffer); - - if(prEventBssBeaconTimeout->ucNetTypeIndex == NETWORK_TYPE_AIS_INDEX) { - aisBssBeaconTimeout(prAdapter); - } -#if CFG_ENABLE_WIFI_DIRECT - else if((prAdapter->fgIsP2PRegistered) && - (prEventBssBeaconTimeout->ucNetTypeIndex == NETWORK_TYPE_P2P_INDEX)) { - - p2pFsmRunEventBeaconTimeout(prAdapter); - } -#endif -#if CFG_ENABLE_BT_OVER_WIFI - else if(prEventBssBeaconTimeout->ucNetTypeIndex == NETWORK_TYPE_BOW_INDEX) { - } -#endif - else { - DBGLOG(RX, ERROR, ("EVENT_ID_BSS_BEACON_TIMEOUT: (ucNetTypeIdx = %d)\n", - prEventBssBeaconTimeout->ucNetTypeIndex)); - } - } - - break; - case EVENT_ID_UPDATE_NOA_PARAMS: -#if CFG_ENABLE_WIFI_DIRECT - if(prAdapter->fgIsP2PRegistered){ - P_EVENT_UPDATE_NOA_PARAMS_T prEventUpdateNoaParam; - prEventUpdateNoaParam = (P_EVENT_UPDATE_NOA_PARAMS_T)(prEvent->aucBuffer); - - if (prEventUpdateNoaParam->ucNetTypeIndex == NETWORK_TYPE_P2P_INDEX) { - p2pProcessEvent_UpdateNOAParam(prAdapter, - prEventUpdateNoaParam->ucNetTypeIndex, - prEventUpdateNoaParam); - } else { - ASSERT(0); - } - } -#else - ASSERT(0); -#endif - break; - - case EVENT_ID_STA_AGING_TIMEOUT: -#if CFG_ENABLE_WIFI_DIRECT - { - if (prAdapter->fgDisStaAgingTimeoutDetection == FALSE) { - P_EVENT_STA_AGING_TIMEOUT_T prEventStaAgingTimeout; - P_STA_RECORD_T prStaRec; - P_BSS_INFO_T prBssInfo = (P_BSS_INFO_T)NULL; - - prEventStaAgingTimeout = (P_EVENT_STA_AGING_TIMEOUT_T)(prEvent->aucBuffer); - prStaRec = cnmGetStaRecByIndex(prAdapter, prEventStaAgingTimeout->ucStaRecIdx); - if (prStaRec == NULL) { - break; - } - - DBGLOG(INIT, INFO,("EVENT_ID_STA_AGING_TIMEOUT %u " MACSTR "\n", - prEventStaAgingTimeout->ucStaRecIdx, MAC2STR(prStaRec->aucMacAddr))); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]); - - bssRemoveStaRecFromClientList(prAdapter, prBssInfo, prStaRec); - - /* Call False Auth */ - if (prAdapter->fgIsP2PRegistered) { - p2pFuncDisconnect(prAdapter, prStaRec, TRUE, REASON_CODE_DISASSOC_INACTIVITY); - } - - - } /* gDisStaAgingTimeoutDetection */ - - } -#endif - break; - - case EVENT_ID_AP_OBSS_STATUS: -#if CFG_ENABLE_WIFI_DIRECT - if(prAdapter->fgIsP2PRegistered){ - rlmHandleObssStatusEventPkt(prAdapter, (P_EVENT_AP_OBSS_STATUS_T) prEvent->aucBuffer); - } -#endif - break; - - case EVENT_ID_ROAMING_STATUS: -#if CFG_SUPPORT_ROAMING - { - P_ROAMING_PARAM_T prParam; - - prParam = (P_ROAMING_PARAM_T)(prEvent->aucBuffer); - roamingFsmProcessEvent(prAdapter, prParam); - } -#endif /* CFG_SUPPORT_ROAMING */ - break; - case EVENT_ID_SEND_DEAUTH: -#if DBG - { - P_WLAN_MAC_HEADER_T prWlanMacHeader; - - prWlanMacHeader = (P_WLAN_MAC_HEADER_T)&prEvent->aucBuffer[0]; - DBGLOG(RX, INFO, ("nicRx: aucAddr1: "MACSTR"\n", MAC2STR(prWlanMacHeader->aucAddr1))); - DBGLOG(RX, INFO, ("nicRx: aucAddr2: "MACSTR"\n", MAC2STR(prWlanMacHeader->aucAddr2))); - } -#endif - /* receive packets without StaRec */ - prSwRfb->pvHeader = (P_WLAN_MAC_HEADER_T)&prEvent->aucBuffer[0]; - if (WLAN_STATUS_SUCCESS == authSendDeauthFrame(prAdapter, - NULL, - prSwRfb, - REASON_CODE_CLASS_3_ERR, - (PFN_TX_DONE_HANDLER)NULL)) { - DBGLOG(RX, INFO, ("Send Deauth Error\n")); - } - break; - -#if CFG_SUPPORT_RDD_TEST_MODE - case EVENT_ID_UPDATE_RDD_STATUS: - { - P_EVENT_RDD_STATUS_T prEventRddStatus; - - prEventRddStatus = (P_EVENT_RDD_STATUS_T) (prEvent->aucBuffer); - - prAdapter->ucRddStatus = prEventRddStatus->ucRddStatus; - } - - break; -#endif - -#if CFG_SUPPORT_BCM && CFG_SUPPORT_BCM_BWCS - case EVENT_ID_UPDATE_BWCS_STATUS: - { - P_PTA_IPC_T prEventBwcsStatus; - - prEventBwcsStatus = (P_PTA_IPC_T) (prEvent->aucBuffer); - -#if CFG_SUPPORT_BCM_BWCS_DEBUG - printk(KERN_INFO DRV_NAME "BCM BWCS Event: %02x%02x%02x%02x\n", prEventBwcsStatus->u.aucBTPParams[0], - prEventBwcsStatus->u.aucBTPParams[1], - prEventBwcsStatus->u.aucBTPParams[2], - prEventBwcsStatus->u.aucBTPParams[3]); - - printk(KERN_INFO DRV_NAME "BCM BWCS Event: aucBTPParams[0] = %02x, aucBTPParams[1] = %02x, aucBTPParams[2] = %02x, aucBTPParams[3] = %02x\n", - prEventBwcsStatus->u.aucBTPParams[0], - prEventBwcsStatus->u.aucBTPParams[1], - prEventBwcsStatus->u.aucBTPParams[2], - prEventBwcsStatus->u.aucBTPParams[3]); -#endif - - kalIndicateStatusAndComplete(prAdapter->prGlueInfo, - WLAN_STATUS_BWCS_UPDATE, - (PVOID) prEventBwcsStatus, - sizeof(PTA_IPC_T)); - } - - break; - - case EVENT_ID_UPDATE_BCM_DEBUG: - { - P_PTA_IPC_T prEventBwcsStatus; - - prEventBwcsStatus = (P_PTA_IPC_T) (prEvent->aucBuffer); - -#if CFG_SUPPORT_BCM_BWCS_DEBUG - printk(KERN_INFO DRV_NAME "BCM FW status: %02x%02x%02x%02x\n", prEventBwcsStatus->u.aucBTPParams[0], - prEventBwcsStatus->u.aucBTPParams[1], - prEventBwcsStatus->u.aucBTPParams[2], - prEventBwcsStatus->u.aucBTPParams[3]); - - printk(KERN_INFO DRV_NAME "BCM FW status: aucBTPParams[0] = %02x, aucBTPParams[1] = %02x, aucBTPParams[2] = %02x, aucBTPParams[3] = %02x\n", - prEventBwcsStatus->u.aucBTPParams[0], - prEventBwcsStatus->u.aucBTPParams[1], - prEventBwcsStatus->u.aucBTPParams[2], - prEventBwcsStatus->u.aucBTPParams[3]); -#endif - } - - break; -#endif - - case EVENT_ID_ACCESS_REG: - case EVENT_ID_NIC_CAPABILITY: - case EVENT_ID_BASIC_CONFIG: - case EVENT_ID_MAC_MCAST_ADDR: - case EVENT_ID_ACCESS_EEPROM: - case EVENT_ID_TEST_STATUS: - default: - prCmdInfo = nicGetPendingCmdInfo(prAdapter, prEvent->ucSeqNum); - - if(prCmdInfo != NULL) { - if (prCmdInfo->pfCmdDoneHandler) { - prCmdInfo->pfCmdDoneHandler(prAdapter, prCmdInfo, prEvent->aucBuffer); - } - else if(prCmdInfo->fgIsOid) { - kalOidComplete(prAdapter->prGlueInfo, prCmdInfo->fgSetQuery, 0, WLAN_STATUS_SUCCESS); - } - - // return prCmdInfo - cmdBufFreeCmdInfo(prAdapter, prCmdInfo); - } - - break; - } - - nicRxReturnRFB(prAdapter, prSwRfb); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief nicRxProcessMgmtPacket is used to dispatch management frames -* to corresponding modules -* -* @param prAdapter Pointer to the Adapter structure. -* @param prSWRfb the RFB to receive rx data -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxProcessMgmtPacket ( - IN P_ADAPTER_T prAdapter, - IN OUT P_SW_RFB_T prSwRfb - ) -{ - UINT_8 ucSubtype; -#if CFG_SUPPORT_802_11W - BOOL fgMfgDrop = FALSE; -#endif - ASSERT(prAdapter); - ASSERT(prSwRfb); - - nicRxFillRFB(prAdapter, prSwRfb); - - ucSubtype = (*(PUINT_8)(prSwRfb->pvHeader) & MASK_FC_SUBTYPE )>> OFFSET_OF_FC_SUBTYPE; - -#if CFG_RX_PKTS_DUMP - { - P_HIF_RX_HEADER_T prHifRxHdr; - UINT_16 u2TxFrameCtrl; - - prHifRxHdr = prSwRfb->prHifRxHdr; - u2TxFrameCtrl = (*(PUINT_8)(prSwRfb->pvHeader) & MASK_FRAME_TYPE); - if (prAdapter->rRxCtrl.u4RxPktsDumpTypeMask & BIT(HIF_RX_PKT_TYPE_MANAGEMENT)) { - if (u2TxFrameCtrl == MAC_FRAME_BEACON || - u2TxFrameCtrl == MAC_FRAME_PROBE_RSP) { - - DBGLOG(SW4, INFO, ("QM RX MGT: net %u sta idx %u wlan idx %u ssn %u ptype %u subtype %u 11 %u\n", - HIF_RX_HDR_GET_NETWORK_IDX(prHifRxHdr), - prHifRxHdr->ucStaRecIdx, - prSwRfb->ucWlanIdx, - HIF_RX_HDR_GET_SN(prHifRxHdr), /* The new SN of the frame */ - prSwRfb->ucPacketType, - ucSubtype, - HIF_RX_HDR_GET_80211_FLAG(prHifRxHdr))); - - DBGLOG_MEM8(SW4, TRACE, (PUINT_8)prSwRfb->pvHeader, prSwRfb->u2PacketLen); - } - } - } -#endif - - if(prAdapter->fgTestMode == FALSE) { -#if CFG_MGMT_FRAME_HANDLING -#if CFG_SUPPORT_802_11W - fgMfgDrop = rsnCheckRxMgmt(prAdapter, prSwRfb, ucSubtype); - if (fgMfgDrop) { - #if DBG - LOG_FUNC("QM RX MGT: Drop Unprotected Mgmt frame!!!\n"); - #endif - nicRxReturnRFB(prAdapter, prSwRfb); - RX_INC_CNT(prRxCtrl, RX_DROP_TOTAL_COUNT); - return; - } - else -#endif - if(apfnProcessRxMgtFrame[ucSubtype]) { - switch(apfnProcessRxMgtFrame[ucSubtype](prAdapter, prSwRfb)){ - case WLAN_STATUS_PENDING: - return; - case WLAN_STATUS_SUCCESS: - case WLAN_STATUS_FAILURE: - break; - - default: - DBGLOG(RX, WARN, ("Unexpected MMPDU(0x%02X) returned with abnormal status\n", ucSubtype)); - break; - } - } -#endif - } - - nicRxReturnRFB(prAdapter, prSwRfb); -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief nicProcessRFBs is used to process RFBs in the rReceivedRFBList queue. -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxProcessRFBs ( - IN P_ADAPTER_T prAdapter - ) -{ - P_RX_CTRL_T prRxCtrl; - P_SW_RFB_T prSwRfb = (P_SW_RFB_T)NULL; - KAL_SPIN_LOCK_DECLARATION(); - - DEBUGFUNC("nicRxProcessRFBs"); - - ASSERT(prAdapter); - - prRxCtrl = &prAdapter->rRxCtrl; - ASSERT(prRxCtrl); - - prRxCtrl->ucNumIndPacket = 0; - prRxCtrl->ucNumRetainedPacket = 0; - - do { - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - QUEUE_REMOVE_HEAD(&prRxCtrl->rReceivedRfbList, prSwRfb, P_SW_RFB_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - - if (prSwRfb){ - switch(prSwRfb->ucPacketType){ - case HIF_RX_PKT_TYPE_DATA: - nicRxProcessDataPacket(prAdapter, prSwRfb); - break; - - case HIF_RX_PKT_TYPE_EVENT: - nicRxProcessEventPacket(prAdapter, prSwRfb); - break; - - case HIF_RX_PKT_TYPE_TX_LOOPBACK: - DBGLOG(RX, ERROR, ("ucPacketType = %d\n", prSwRfb->ucPacketType)); - break; - - case HIF_RX_PKT_TYPE_MANAGEMENT: - nicRxProcessMgmtPacket(prAdapter, prSwRfb); - break; - - default: - RX_INC_CNT(prRxCtrl, RX_TYPE_ERR_DROP_COUNT); - RX_INC_CNT(prRxCtrl, RX_DROP_TOTAL_COUNT); - DBGLOG(RX, ERROR, ("ucPacketType = %d\n", prSwRfb->ucPacketType)); - break; - } - } - else { - break; - } - }while(TRUE); - - if (prRxCtrl->ucNumIndPacket > 0) { - RX_ADD_CNT(prRxCtrl, RX_DATA_INDICATION_COUNT, prRxCtrl->ucNumIndPacket); - RX_ADD_CNT(prRxCtrl, RX_DATA_RETAINED_COUNT, prRxCtrl->ucNumRetainedPacket); - - //DBGLOG(RX, INFO, ("%d packets indicated, Retained cnt = %d\n", - // prRxCtrl->ucNumIndPacket, prRxCtrl->ucNumRetainedPacket)); - #if CFG_NATIVE_802_11 - kalRxIndicatePkts(prAdapter->prGlueInfo, (UINT_32)prRxCtrl->ucNumIndPacket, (UINT_32)prRxCtrl->ucNumRetainedPacket); - #else - kalRxIndicatePkts(prAdapter->prGlueInfo, prRxCtrl->apvIndPacket, (UINT_32)prRxCtrl->ucNumIndPacket); - #endif - } - -} /* end of nicRxProcessRFBs() */ - - -#if !CFG_SDIO_INTR_ENHANCE -/*----------------------------------------------------------------------------*/ -/*! -* @brief Read the rx data from data port and setup RFB -* -* @param prAdapter pointer to the Adapter handler -* @param prSWRfb the RFB to receive rx data -* -* @retval WLAN_STATUS_SUCCESS: SUCCESS -* @retval WLAN_STATUS_FAILURE: FAILURE -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicRxReadBuffer ( - IN P_ADAPTER_T prAdapter, - IN OUT P_SW_RFB_T prSwRfb - ) -{ - P_RX_CTRL_T prRxCtrl; - PUINT_8 pucBuf; - P_HIF_RX_HEADER_T prHifRxHdr; - UINT_32 u4PktLen = 0, u4ReadBytes; - WLAN_STATUS u4Status = WLAN_STATUS_SUCCESS; - BOOL fgResult = TRUE; - UINT_32 u4RegValue; - UINT_32 rxNum; - - DEBUGFUNC("nicRxReadBuffer"); - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - prRxCtrl = &prAdapter->rRxCtrl; - ASSERT(prRxCtrl); - - pucBuf = prSwRfb->pucRecvBuff; - prHifRxHdr = prSwRfb->prHifRxHdr; - ASSERT(pucBuf); - DBGLOG(RX, TRACE, ("pucBuf= 0x%x, prHifRxHdr= 0x%x\n", pucBuf, prHifRxHdr)); - - do { - /* Read the RFB DW length and packet length */ - HAL_MCR_RD(prAdapter, MCR_WRPLR, &u4RegValue); - if (!fgResult) { - DBGLOG(RX, ERROR, ("Read RX Packet Lentgh Error\n")); - return WLAN_STATUS_FAILURE; - } - - //20091021 move the line to get the HIF RX header (for RX0/1) - if(u4RegValue == 0) { - DBGLOG(RX, ERROR, ("No RX packet\n")); - return WLAN_STATUS_FAILURE; - } - - u4PktLen = u4RegValue & BITS(0, 15); - if(u4PktLen != 0) { - rxNum = 0; - } - else { - rxNum = 1; - u4PktLen = (u4RegValue & BITS(16, 31)) >> 16; - } - - DBGLOG(RX, TRACE, ("RX%d: u4PktLen = %d\n", rxNum, u4PktLen)); - - //4 <4> Read Entire RFB and packet, include HW appended DW (Checksum Status) - u4ReadBytes = ALIGN_4(u4PktLen) + 4; - HAL_READ_RX_PORT(prAdapter, rxNum, u4ReadBytes, pucBuf, CFG_RX_MAX_PKT_SIZE); - - //20091021 move the line to get the HIF RX header - //u4PktLen = (UINT_32)prHifRxHdr->u2PacketLen; - if (u4PktLen != (UINT_32)prHifRxHdr->u2PacketLen) { - DBGLOG(RX, ERROR, ("Read u4PktLen = %d, prHifRxHdr->u2PacketLen: %d\n", - u4PktLen, prHifRxHdr->u2PacketLen)); - #if DBG - dumpMemory8((PUINT_8)prHifRxHdr, (prHifRxHdr->u2PacketLen > 4096) ? 4096 : prHifRxHdr->u2PacketLen); - #endif - ASSERT(0); - } - /* u4PktLen is byte unit, not inlude HW appended DW */ - - prSwRfb->ucPacketType = (UINT_8)(prHifRxHdr->u2PacketType & HIF_RX_HDR_PACKET_TYPE_MASK); - DBGLOG(RX, TRACE, ("ucPacketType = %d\n", prSwRfb->ucPacketType)); - - prSwRfb->ucStaRecIdx = (UINT_8)(prHifRxHdr->ucStaRecIdx); - - /* fgResult will be updated in MACRO */ - if (!fgResult) { - return WLAN_STATUS_FAILURE; - } - - DBGLOG(RX, TRACE, ("Dump RX buffer, length = 0x%x\n", u4ReadBytes)); - DBGLOG_MEM8(RX, TRACE, pucBuf, u4ReadBytes); - }while(FALSE); - - return u4Status; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Read frames from the data port, fill RFB -* and put each frame into the rReceivedRFBList queue. -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxReceiveRFBs ( - IN P_ADAPTER_T prAdapter - ) -{ - P_RX_CTRL_T prRxCtrl; - P_SW_RFB_T prSwRfb = (P_SW_RFB_T)NULL; - P_HIF_RX_HEADER_T prHifRxHdr; - - UINT_32 u4HwAppendDW; - - KAL_SPIN_LOCK_DECLARATION(); - - DEBUGFUNC("nicRxReceiveRFBs"); - - ASSERT(prAdapter); - - prRxCtrl = &prAdapter->rRxCtrl; - ASSERT(prRxCtrl); - - do { - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - QUEUE_REMOVE_HEAD(&prRxCtrl->rFreeSwRfbList, prSwRfb, P_SW_RFB_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - - if (!prSwRfb) { - DBGLOG(RX, TRACE, ("No More RFB\n")); - break; - } - - // need to consider - if (nicRxReadBuffer(prAdapter, prSwRfb) == WLAN_STATUS_FAILURE) { - DBGLOG(RX, TRACE, ("halRxFillRFB failed\n")); - nicRxReturnRFB(prAdapter, prSwRfb); - break; - } - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - QUEUE_INSERT_TAIL(&prRxCtrl->rReceivedRfbList, &prSwRfb->rQueEntry); - RX_INC_CNT(prRxCtrl, RX_MPDU_TOTAL_COUNT); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - - prHifRxHdr = prSwRfb->prHifRxHdr; - u4HwAppendDW = *((PUINT_32)((UINT_32)prHifRxHdr + - (UINT_32)(ALIGN_4(prHifRxHdr->u2PacketLen)))); - DBGLOG(RX, TRACE, ("u4HwAppendDW = 0x%x\n", u4HwAppendDW)); - DBGLOG(RX, TRACE, ("u2PacketLen = 0x%x\n", prHifRxHdr->u2PacketLen)); - } -// while (RX_STATUS_TEST_MORE_FLAG(u4HwAppendDW)); - while (FALSE); - - return; - -} /* end of nicReceiveRFBs() */ - -#else -/*----------------------------------------------------------------------------*/ -/*! -* @brief Read frames from the data port, fill RFB -* and put each frame into the rReceivedRFBList queue. -* -* @param prAdapter Pointer to the Adapter structure. -* @param u4DataPort Specify which port to read -* @param u2RxLength Specify to the the rx packet length in Byte. -* @param prSwRfb the RFB to receive rx data. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ - -WLAN_STATUS -nicRxEnhanceReadBuffer ( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4DataPort, - IN UINT_16 u2RxLength, - IN OUT P_SW_RFB_T prSwRfb - ) -{ - P_RX_CTRL_T prRxCtrl; - PUINT_8 pucBuf; - P_HIF_RX_HEADER_T prHifRxHdr; - UINT_32 u4PktLen = 0; - WLAN_STATUS u4Status = WLAN_STATUS_FAILURE; - BOOL fgResult = TRUE; - - DEBUGFUNC("nicRxEnhanceReadBuffer"); - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - prRxCtrl = &prAdapter->rRxCtrl; - ASSERT(prRxCtrl); - - pucBuf = prSwRfb->pucRecvBuff; - ASSERT(pucBuf); - - prHifRxHdr = prSwRfb->prHifRxHdr; - ASSERT(prHifRxHdr); - - //DBGLOG(RX, TRACE, ("u2RxLength = %d\n", u2RxLength)); - - do { - //4 <1> Read RFB frame from MCR_WRDR0, include HW appended DW - HAL_READ_RX_PORT(prAdapter, - u4DataPort, - ALIGN_4(u2RxLength + HIF_RX_HW_APPENDED_LEN), - pucBuf, - CFG_RX_MAX_PKT_SIZE); - - if (!fgResult) { - DBGLOG(RX, ERROR, ("Read RX Packet Lentgh Error\n")); - break; - } - - u4PktLen = (UINT_32)(prHifRxHdr->u2PacketLen); - //DBGLOG(RX, TRACE, ("u4PktLen = %d\n", u4PktLen)); - - prSwRfb->ucPacketType = (UINT_8)(prHifRxHdr->u2PacketType & HIF_RX_HDR_PACKET_TYPE_MASK); - //DBGLOG(RX, TRACE, ("ucPacketType = %d\n", prSwRfb->ucPacketType)); - - prSwRfb->ucStaRecIdx = (UINT_8)(prHifRxHdr->ucStaRecIdx); - - //4 <2> if the RFB dw size or packet size is zero - if (u4PktLen == 0) { - DBGLOG(RX, ERROR, ("Packet Length = %d\n", u4PktLen)); - ASSERT(0); - break; - } - - //4 <3> if the packet is too large or too small - if (u4PktLen > CFG_RX_MAX_PKT_SIZE) { - DBGLOG(RX, TRACE, ("Read RX Packet Lentgh Error (%d)\n", u4PktLen)); - ASSERT(0); - break; - } - - u4Status = WLAN_STATUS_SUCCESS; - } - while (FALSE); - - DBGLOG_MEM8(RX, TRACE, pucBuf, ALIGN_4(u2RxLength + HIF_RX_HW_APPENDED_LEN)); - return u4Status; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Read frames from the data port for SDIO -* I/F, fill RFB and put each frame into the rReceivedRFBList queue. -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxSDIOReceiveRFBs ( - IN P_ADAPTER_T prAdapter - ) -{ - P_SDIO_CTRL_T prSDIOCtrl; - P_RX_CTRL_T prRxCtrl; - P_SW_RFB_T prSwRfb = (P_SW_RFB_T)NULL; - UINT_32 i, rxNum; - UINT_16 u2RxPktNum, u2RxLength = 0, u2Tmp = 0; - KAL_SPIN_LOCK_DECLARATION(); - - DEBUGFUNC("nicRxSDIOReceiveRFBs"); - - ASSERT(prAdapter); - - prSDIOCtrl = prAdapter->prSDIOCtrl; - ASSERT(prSDIOCtrl); - - prRxCtrl = &prAdapter->rRxCtrl; - ASSERT(prRxCtrl); - - for (rxNum = 0 ; rxNum < 2 ; rxNum++) { - u2RxPktNum = (rxNum == 0 ? prSDIOCtrl->rRxInfo.u.u2NumValidRx0Len : prSDIOCtrl->rRxInfo.u.u2NumValidRx1Len); - - if(u2RxPktNum == 0) { - continue; - } - - for (i = 0; i < u2RxPktNum; i++) { - if(rxNum == 0) { - HAL_READ_RX_LENGTH(prAdapter, &u2RxLength, &u2Tmp); - } - else if(rxNum == 1) { - HAL_READ_RX_LENGTH(prAdapter, &u2Tmp, &u2RxLength); - } - - if (!u2RxLength) { - break; - } - - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - QUEUE_REMOVE_HEAD(&prRxCtrl->rFreeSwRfbList, prSwRfb, P_SW_RFB_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - - if (!prSwRfb) { - DBGLOG(RX, TRACE, ("No More RFB\n")); - break; - } - ASSERT(prSwRfb); - - if (nicRxEnhanceReadBuffer(prAdapter, rxNum, u2RxLength, prSwRfb) == WLAN_STATUS_FAILURE) { - DBGLOG(RX, TRACE, ("nicRxEnhanceRxReadBuffer failed\n")); - nicRxReturnRFB(prAdapter, prSwRfb); - break; - } - - //prSDIOCtrl->au4RxLength[i] = 0; - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - QUEUE_INSERT_TAIL(&prRxCtrl->rReceivedRfbList, &prSwRfb->rQueEntry); - RX_INC_CNT(prRxCtrl, RX_MPDU_TOTAL_COUNT); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - } - } - - prSDIOCtrl->rRxInfo.u.u2NumValidRx0Len = 0; - prSDIOCtrl->rRxInfo.u.u2NumValidRx1Len = 0; - - return; -}/* end of nicRxSDIOReceiveRFBs() */ - -#endif /* CFG_SDIO_INTR_ENHANCE */ - - - -#if CFG_SDIO_RX_AGG -/*----------------------------------------------------------------------------*/ -/*! -* @brief Read frames from the data port for SDIO with Rx aggregation enabled -* I/F, fill RFB and put each frame into the rReceivedRFBList queue. -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxSDIOAggReceiveRFBs ( - IN P_ADAPTER_T prAdapter - ) -{ - P_ENHANCE_MODE_DATA_STRUCT_T prEnhDataStr; - P_RX_CTRL_T prRxCtrl; - P_SDIO_CTRL_T prSDIOCtrl; - P_SW_RFB_T prSwRfb = (P_SW_RFB_T)NULL; - UINT_32 u4RxLength; - UINT_32 i, rxNum; - UINT_32 u4RxAggCount = 0, u4RxAggLength = 0; - UINT_32 u4RxAvailAggLen, u4CurrAvailFreeRfbCnt; - PUINT_8 pucSrcAddr; - P_HIF_RX_HEADER_T prHifRxHdr; - BOOL fgResult = TRUE; - BOOLEAN fgIsRxEnhanceMode; - UINT_16 u2RxPktNum; -#if CFG_SDIO_RX_ENHANCE - UINT_32 u4MaxLoopCount = CFG_MAX_RX_ENHANCE_LOOP_COUNT; -#endif - - KAL_SPIN_LOCK_DECLARATION(); - - DEBUGFUNC("nicRxSDIOAggReceiveRFBs"); - - ASSERT(prAdapter); - prEnhDataStr = prAdapter->prSDIOCtrl; - prRxCtrl = &prAdapter->rRxCtrl; - prSDIOCtrl = prAdapter->prSDIOCtrl; - -#if CFG_SDIO_RX_ENHANCE - fgIsRxEnhanceMode = TRUE; -#else - fgIsRxEnhanceMode = FALSE; -#endif - - do { -#if CFG_SDIO_RX_ENHANCE - /* to limit maximum loop for RX */ - u4MaxLoopCount--; - if (u4MaxLoopCount == 0) { - break; - } -#endif - - if(prEnhDataStr->rRxInfo.u.u2NumValidRx0Len == 0 && - prEnhDataStr->rRxInfo.u.u2NumValidRx1Len == 0) { - break; - } - - for(rxNum = 0 ; rxNum < 2 ; rxNum++) { - u2RxPktNum = (rxNum == 0 ? prEnhDataStr->rRxInfo.u.u2NumValidRx0Len : prEnhDataStr->rRxInfo.u.u2NumValidRx1Len); - //DBGLOG(RX, TRACE, ("RxPktNum %d in rxPort %d\n", u2RxPktNum, rxNum)); - - // if this assertion happened, it is most likely a F/W bug - ASSERT(u2RxPktNum <= 16); - - if (u2RxPktNum > 16) - continue; - - if(u2RxPktNum == 0) - continue; - - #if CFG_HIF_STATISTICS - prRxCtrl->u4TotalRxAccessNum++; - prRxCtrl->u4TotalRxPacketNum += u2RxPktNum; - #endif - - u4CurrAvailFreeRfbCnt = prRxCtrl->rFreeSwRfbList.u4NumElem; - - // if SwRfb is not enough, abort reading this time - if(u4CurrAvailFreeRfbCnt < u2RxPktNum) { - #if CFG_HIF_RX_STARVATION_WARNING - DbgPrint("FreeRfb is not enough: %d available, need %d\n", u4CurrAvailFreeRfbCnt, u2RxPktNum); - DbgPrint("Queued Count: %d / Dequeud Count: %d\n", prRxCtrl->u4QueuedCnt, prRxCtrl->u4DequeuedCnt); - #endif - continue; - } - -#if CFG_SDIO_RX_ENHANCE - u4RxAvailAggLen = CFG_RX_COALESCING_BUFFER_SIZE - (sizeof(ENHANCE_MODE_DATA_STRUCT_T) + 4/* extra HW padding */); -#else - u4RxAvailAggLen = CFG_RX_COALESCING_BUFFER_SIZE; -#endif - u4RxAggCount = 0; - - for (i = 0; i < u2RxPktNum ; i++) { - u4RxLength = (rxNum == 0 ? - (UINT_32)prEnhDataStr->rRxInfo.u.au2Rx0Len[i] : - (UINT_32)prEnhDataStr->rRxInfo.u.au2Rx1Len[i]); - - if (!u4RxLength) { - ASSERT(0); - break; - } - - if (ALIGN_4(u4RxLength + HIF_RX_HW_APPENDED_LEN) < u4RxAvailAggLen) { - if (u4RxAggCount < u4CurrAvailFreeRfbCnt) { - u4RxAvailAggLen -= ALIGN_4(u4RxLength + HIF_RX_HW_APPENDED_LEN); - u4RxAggCount++; - } - else { - // no FreeSwRfb for rx packet - ASSERT(0); - break; - } - } - else { - // CFG_RX_COALESCING_BUFFER_SIZE is not large enough - ASSERT(0); - break; - } - } - - u4RxAggLength = (CFG_RX_COALESCING_BUFFER_SIZE - u4RxAvailAggLen); - //DBGLOG(RX, INFO, ("u4RxAggCount = %d, u4RxAggLength = %d\n", - // u4RxAggCount, u4RxAggLength)); - - HAL_READ_RX_PORT(prAdapter, - rxNum, - u4RxAggLength, - prRxCtrl->pucRxCoalescingBufPtr, - CFG_RX_COALESCING_BUFFER_SIZE); - if (!fgResult) { - DBGLOG(RX, ERROR, ("Read RX Agg Packet Error\n")); - continue; - } - - pucSrcAddr = prRxCtrl->pucRxCoalescingBufPtr; - for (i = 0; i < u4RxAggCount; i++) { - UINT_16 u2PktLength; - - u2PktLength = (rxNum == 0 ? - prEnhDataStr->rRxInfo.u.au2Rx0Len[i] : - prEnhDataStr->rRxInfo.u.au2Rx1Len[i]); - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - QUEUE_REMOVE_HEAD(&prRxCtrl->rFreeSwRfbList, prSwRfb, P_SW_RFB_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - - ASSERT(prSwRfb); - kalMemCopy(prSwRfb->pucRecvBuff, pucSrcAddr, - ALIGN_4(u2PktLength + HIF_RX_HW_APPENDED_LEN)); - - prHifRxHdr = prSwRfb->prHifRxHdr; - ASSERT(prHifRxHdr); - - prSwRfb->ucPacketType = (UINT_8)(prHifRxHdr->u2PacketType & HIF_RX_HDR_PACKET_TYPE_MASK); - //DBGLOG(RX, TRACE, ("ucPacketType = %d\n", prSwRfb->ucPacketType)); - - prSwRfb->ucStaRecIdx = (UINT_8)(prHifRxHdr->ucStaRecIdx); - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - QUEUE_INSERT_TAIL(&prRxCtrl->rReceivedRfbList, &prSwRfb->rQueEntry); - RX_INC_CNT(prRxCtrl, RX_MPDU_TOTAL_COUNT); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - - pucSrcAddr += ALIGN_4(u2PktLength + HIF_RX_HW_APPENDED_LEN); - //prEnhDataStr->au4RxLength[i] = 0; - } - -#if CFG_SDIO_RX_ENHANCE - kalMemCopy(prAdapter->prSDIOCtrl, (pucSrcAddr + 4), sizeof(ENHANCE_MODE_DATA_STRUCT_T)); - - /* do the same thing what nicSDIOReadIntStatus() does */ - if((prSDIOCtrl->u4WHISR & WHISR_TX_DONE_INT) == 0 && - (prSDIOCtrl->rTxInfo.au4WTSR[0] | prSDIOCtrl->rTxInfo.au4WTSR[1])) { - prSDIOCtrl->u4WHISR |= WHISR_TX_DONE_INT; - } - - if((prSDIOCtrl->u4WHISR & BIT(31)) == 0 && - HAL_GET_MAILBOX_READ_CLEAR(prAdapter) == TRUE && - (prSDIOCtrl->u4RcvMailbox0 != 0 || prSDIOCtrl->u4RcvMailbox1 != 0)) { - prSDIOCtrl->u4WHISR |= BIT(31); - } - - /* dispatch to interrupt handler with RX bits masked */ - nicProcessIST_impl(prAdapter, prSDIOCtrl->u4WHISR & (~(WHISR_RX0_DONE_INT | WHISR_RX1_DONE_INT))); -#endif - } - -#if !CFG_SDIO_RX_ENHANCE - prEnhDataStr->rRxInfo.u.u2NumValidRx0Len = 0; - prEnhDataStr->rRxInfo.u.u2NumValidRx1Len = 0; -#endif - } - while ((prEnhDataStr->rRxInfo.u.u2NumValidRx0Len - || prEnhDataStr->rRxInfo.u.u2NumValidRx1Len) - && fgIsRxEnhanceMode); - - return; -} -#endif /* CFG_SDIO_RX_AGG */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Setup a RFB and allocate the os packet to the RFB -* -* @param prAdapter Pointer to the Adapter structure. -* @param prSwRfb Pointer to the RFB -* -* @retval WLAN_STATUS_SUCCESS -* @retval WLAN_STATUS_RESOURCES -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicRxSetupRFB ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - PVOID pvPacket; - PUINT_8 pucRecvBuff; - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - if (!prSwRfb->pvPacket) { - kalMemZero(prSwRfb, sizeof(SW_RFB_T)); - pvPacket = kalPacketAlloc(prAdapter->prGlueInfo, CFG_RX_MAX_PKT_SIZE, - &pucRecvBuff); - if (pvPacket == NULL) { - return WLAN_STATUS_RESOURCES; - } - - prSwRfb->pvPacket = pvPacket; - prSwRfb->pucRecvBuff= (PVOID)pucRecvBuff; - } - else { - kalMemZero(((PUINT_8)prSwRfb + OFFSET_OF(SW_RFB_T, prHifRxHdr)), - (sizeof(SW_RFB_T)-OFFSET_OF(SW_RFB_T, prHifRxHdr))); - } - - prSwRfb->prHifRxHdr = (P_HIF_RX_HEADER_T)(prSwRfb->pucRecvBuff); - - return WLAN_STATUS_SUCCESS; - -} /* end of nicRxSetupRFB() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This routine is called to put a RFB back onto the "RFB with Buffer" list -* or "RFB without buffer" list according to pvPacket. -* -* @param prAdapter Pointer to the Adapter structure. -* @param prSwRfb Pointer to the RFB -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxReturnRFB ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_RX_CTRL_T prRxCtrl; - P_QUE_ENTRY_T prQueEntry; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - ASSERT(prSwRfb); - prRxCtrl = &prAdapter->rRxCtrl; - prQueEntry = &prSwRfb->rQueEntry; - - ASSERT(prQueEntry); - - /* The processing on this RFB is done, so put it back on the tail of - our list */ - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - - if (prSwRfb->pvPacket) { - QUEUE_INSERT_TAIL(&prRxCtrl->rFreeSwRfbList, prQueEntry); - } - else { - QUEUE_INSERT_TAIL(&prRxCtrl->rIndicatedRfbList, prQueEntry); - } - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_RX_QUE); - return; -} /* end of nicRxReturnRFB() */ - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Process rx interrupt. When the rx -* Interrupt is asserted, it means there are frames in queue. -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicProcessRxInterrupt ( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - -#if CFG_SDIO_INTR_ENHANCE - #if CFG_SDIO_RX_AGG - nicRxSDIOAggReceiveRFBs(prAdapter); - #else - nicRxSDIOReceiveRFBs(prAdapter); - #endif -#else - nicRxReceiveRFBs(prAdapter); -#endif /* CFG_SDIO_INTR_ENHANCE */ - - nicRxProcessRFBs(prAdapter); - - return; - -} /* end of nicProcessRxInterrupt() */ - - -#if CFG_TCP_IP_CHKSUM_OFFLOAD -/*----------------------------------------------------------------------------*/ -/*! -* @brief Used to update IP/TCP/UDP checksum statistics of RX Module. -* -* @param prAdapter Pointer to the Adapter structure. -* @param aeCSUM The array of checksum result. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxUpdateCSUMStatistics ( - IN P_ADAPTER_T prAdapter, - IN const ENUM_CSUM_RESULT_T aeCSUM[] - ) -{ - P_RX_CTRL_T prRxCtrl; - - ASSERT(prAdapter); - ASSERT(aeCSUM); - - prRxCtrl = &prAdapter->rRxCtrl; - ASSERT(prRxCtrl); - - if ((aeCSUM[CSUM_TYPE_IPV4] == CSUM_RES_SUCCESS) || - (aeCSUM[CSUM_TYPE_IPV6] == CSUM_RES_SUCCESS)) { - - RX_INC_CNT(prRxCtrl, RX_CSUM_IP_SUCCESS_COUNT); - } - else if ((aeCSUM[CSUM_TYPE_IPV4] == CSUM_RES_FAILED) || - (aeCSUM[CSUM_TYPE_IPV6] == CSUM_RES_FAILED)) { - - RX_INC_CNT(prRxCtrl, RX_CSUM_IP_FAILED_COUNT); - } - else if ((aeCSUM[CSUM_TYPE_IPV4] == CSUM_RES_NONE) && - (aeCSUM[CSUM_TYPE_IPV6] == CSUM_RES_NONE)) { - - RX_INC_CNT(prRxCtrl, RX_CSUM_UNKNOWN_L3_PKT_COUNT); - } - else { - ASSERT(0); - } - - if (aeCSUM[CSUM_TYPE_TCP] == CSUM_RES_SUCCESS) { - RX_INC_CNT(prRxCtrl, RX_CSUM_TCP_SUCCESS_COUNT); - } - else if (aeCSUM[CSUM_TYPE_TCP] == CSUM_RES_FAILED) { - RX_INC_CNT(prRxCtrl, RX_CSUM_TCP_FAILED_COUNT); - } - else if (aeCSUM[CSUM_TYPE_UDP] == CSUM_RES_SUCCESS) { - RX_INC_CNT(prRxCtrl, RX_CSUM_UDP_SUCCESS_COUNT); - } - else if (aeCSUM[CSUM_TYPE_UDP] == CSUM_RES_FAILED) { - RX_INC_CNT(prRxCtrl, RX_CSUM_UDP_FAILED_COUNT); - } - else if ((aeCSUM[CSUM_TYPE_UDP] == CSUM_RES_NONE) && - (aeCSUM[CSUM_TYPE_TCP] == CSUM_RES_NONE)) { - - RX_INC_CNT(prRxCtrl, RX_CSUM_UNKNOWN_L4_PKT_COUNT); - } - else { - ASSERT(0); - } - - return; -} /* end of nicRxUpdateCSUMStatistics() */ -#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to query current status of RX Module. -* -* @param prAdapter Pointer to the Adapter structure. -* @param pucBuffer Pointer to the message buffer. -* @param pu4Count Pointer to the buffer of message length count. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxQueryStatus ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBuffer, - OUT PUINT_32 pu4Count - ) -{ - P_RX_CTRL_T prRxCtrl; - PUINT_8 pucCurrBuf = pucBuffer; - - - ASSERT(prAdapter); - prRxCtrl = &prAdapter->rRxCtrl; - ASSERT(prRxCtrl); - - //if (pucBuffer) {} /* For Windows, we'll print directly instead of sprintf() */ - ASSERT(pu4Count); - - SPRINTF(pucCurrBuf, ("\n\nRX CTRL STATUS:")); - SPRINTF(pucCurrBuf, ("\n===============")); - SPRINTF(pucCurrBuf, ("\nFREE RFB w/i BUF LIST :%9ld", prRxCtrl->rFreeSwRfbList.u4NumElem)); - SPRINTF(pucCurrBuf, ("\nFREE RFB w/o BUF LIST :%9ld", prRxCtrl->rIndicatedRfbList.u4NumElem)); - SPRINTF(pucCurrBuf, ("\nRECEIVED RFB LIST :%9ld", prRxCtrl->rReceivedRfbList.u4NumElem)); - - SPRINTF(pucCurrBuf, ("\n\n")); - - //*pu4Count = (UINT_32)((UINT_32)pucCurrBuf - (UINT_32)pucBuffer); - - return; -} /* end of nicRxQueryStatus() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Clear RX related counters -* -* @param prAdapter Pointer of Adapter Data Structure -* -* @return - (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxClearStatistics ( - IN P_ADAPTER_T prAdapter - ) -{ - P_RX_CTRL_T prRxCtrl; - - ASSERT(prAdapter); - prRxCtrl = &prAdapter->rRxCtrl; - ASSERT(prRxCtrl); - - RX_RESET_ALL_CNTS(prRxCtrl); - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to query current statistics of RX Module. -* -* @param prAdapter Pointer to the Adapter structure. -* @param pucBuffer Pointer to the message buffer. -* @param pu4Count Pointer to the buffer of message length count. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxQueryStatistics ( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucBuffer, - OUT PUINT_32 pu4Count - ) -{ - P_RX_CTRL_T prRxCtrl; - PUINT_8 pucCurrBuf = pucBuffer; - - ASSERT(prAdapter); - prRxCtrl = &prAdapter->rRxCtrl; - ASSERT(prRxCtrl); - - //if (pucBuffer) {} /* For Windows, we'll print directly instead of sprintf() */ - ASSERT(pu4Count); - -#define SPRINTF_RX_COUNTER(eCounter) \ - SPRINTF(pucCurrBuf, ("%-30s : %ld\n", #eCounter, (UINT_32)prRxCtrl->au8Statistics[eCounter])) - - SPRINTF_RX_COUNTER(RX_MPDU_TOTAL_COUNT); - SPRINTF_RX_COUNTER(RX_SIZE_ERR_DROP_COUNT); - SPRINTF_RX_COUNTER(RX_DATA_INDICATION_COUNT); - SPRINTF_RX_COUNTER(RX_DATA_RETURNED_COUNT); - SPRINTF_RX_COUNTER(RX_DATA_RETAINED_COUNT); - -#if CFG_TCP_IP_CHKSUM_OFFLOAD || CFG_TCP_IP_CHKSUM_OFFLOAD_NDIS_60 - SPRINTF_RX_COUNTER(RX_CSUM_TCP_FAILED_COUNT); - SPRINTF_RX_COUNTER(RX_CSUM_UDP_FAILED_COUNT); - SPRINTF_RX_COUNTER(RX_CSUM_IP_FAILED_COUNT); - SPRINTF_RX_COUNTER(RX_CSUM_TCP_SUCCESS_COUNT); - SPRINTF_RX_COUNTER(RX_CSUM_UDP_SUCCESS_COUNT); - SPRINTF_RX_COUNTER(RX_CSUM_IP_SUCCESS_COUNT); - SPRINTF_RX_COUNTER(RX_CSUM_UNKNOWN_L4_PKT_COUNT); - SPRINTF_RX_COUNTER(RX_CSUM_UNKNOWN_L3_PKT_COUNT); - SPRINTF_RX_COUNTER(RX_IP_V6_PKT_CCOUNT); -#endif - - //*pu4Count = (UINT_32)(pucCurrBuf - pucBuffer); - - nicRxClearStatistics(prAdapter); - - return; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Read the Response data from data port -* -* @param prAdapter pointer to the Adapter handler -* @param pucRspBuffer pointer to the Response buffer -* -* @retval WLAN_STATUS_SUCCESS: Response packet has been read -* @retval WLAN_STATUS_FAILURE: Read Response packet timeout or error occurred -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicRxWaitResponse ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucPortIdx, - OUT PUINT_8 pucRspBuffer, - IN UINT_32 u4MaxRespBufferLen, - OUT PUINT_32 pu4Length - ) -{ - UINT_32 u4Value = 0, u4PktLen = 0, i = 0; - WLAN_STATUS u4Status = WLAN_STATUS_SUCCESS; - BOOL fgResult = TRUE; - UINT_32 u4Time, u4Current; - - DEBUGFUNC("nicRxWaitResponse"); - - ASSERT(prAdapter); - ASSERT(pucRspBuffer); - ASSERT(ucPortIdx < 2); - - u4Time = (UINT_32)kalGetTimeTick(); - - do { - /* Read the packet length */ - HAL_MCR_RD(prAdapter, MCR_WRPLR, &u4Value); - - if (!fgResult) { - DBGLOG(RX, ERROR, ("Read Response Packet Error\n")); - return WLAN_STATUS_FAILURE; - } - - if(ucPortIdx == 0) { - u4PktLen = u4Value & 0xFFFF; - } - else { - u4PktLen = (u4Value >> 16) & 0xFFFF; - } - - DBGLOG(RX, TRACE, ("i = %d, u4PktLen = %d\n", i, u4PktLen)); - - if (u4PktLen == 0) { - /* timeout exceeding check */ - u4Current = (UINT_32)kalGetTimeTick(); - - if((u4Current > u4Time) && ((u4Current - u4Time) > RX_RESPONSE_TIMEOUT)) { - return WLAN_STATUS_FAILURE; - } - else if(u4Current < u4Time && ((u4Current + (0xFFFFFFFF - u4Time)) > RX_RESPONSE_TIMEOUT)) { - return WLAN_STATUS_FAILURE; - } - - /* Response packet is not ready */ - kalUdelay(50); - - i++; - } - else if (u4PktLen > u4MaxRespBufferLen) { - DBGLOG(RX, WARN, ("Not enough Event Buffer: required length = 0x%x, available buffer length = %d\n", - u4PktLen, u4MaxRespBufferLen)); - - return WLAN_STATUS_FAILURE; - } - else { - HAL_PORT_RD(prAdapter, - ucPortIdx == 0 ? MCR_WRDR0 : MCR_WRDR1, - u4PktLen, - pucRspBuffer, - u4MaxRespBufferLen); - - /* fgResult will be updated in MACRO */ - if (!fgResult) { - DBGLOG(RX, ERROR, ("Read Response Packet Error\n")); - return WLAN_STATUS_FAILURE; - } - - DBGLOG(RX, TRACE, ("Dump Response buffer, length = 0x%x\n", - u4PktLen)); - DBGLOG_MEM8(RX, TRACE, pucRspBuffer, u4PktLen); - - *pu4Length = u4PktLen; - break; - } - } while(TRUE); - - return u4Status; -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Set filter to enable Promiscuous Mode -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxEnablePromiscuousMode ( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - return; -} /* end of nicRxEnablePromiscuousMode() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Set filter to disable Promiscuous Mode -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxDisablePromiscuousMode ( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - return; -} /* end of nicRxDisablePromiscuousMode() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief this function flushes all packets queued in reordering module -* -* @param prAdapter Pointer to the Adapter structure. -* -* @retval WLAN_STATUS_SUCCESS Flushed successfully -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicRxFlush ( - IN P_ADAPTER_T prAdapter - ) -{ - P_SW_RFB_T prSwRfb; - - ASSERT(prAdapter); - - if((prSwRfb = qmFlushRxQueues(prAdapter)) != NULL) { - do { - P_SW_RFB_T prNextSwRfb; - - // save next first - prNextSwRfb = (P_SW_RFB_T)QUEUE_GET_NEXT_ENTRY((P_QUE_ENTRY_T)prSwRfb); - - // free - nicRxReturnRFB(prAdapter, prSwRfb); - - prSwRfb = prNextSwRfb; - } while(prSwRfb); - } - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief -* -* @param -* -* @retval -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicRxProcessActionFrame ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb - ) -{ - P_WLAN_ACTION_FRAME prActFrame; - - ASSERT(prAdapter); - ASSERT(prSwRfb); - - if (prSwRfb->u2PacketLen < sizeof(WLAN_ACTION_FRAME) - 1) { - return WLAN_STATUS_INVALID_PACKET; - } - prActFrame = (P_WLAN_ACTION_FRAME) prSwRfb->pvHeader; - - switch (prActFrame->ucCategory) { - case CATEGORY_PUBLIC_ACTION: - - #if CFG_ENABLE_WIFI_DIRECT - if (prAdapter->fgIsP2PRegistered) { - rlmProcessPublicAction(prAdapter, prSwRfb); - - p2pFuncValidateRxActionFrame( - prAdapter, prSwRfb); - - } - #endif - break; - - case CATEGORY_HT_ACTION: - #if CFG_ENABLE_WIFI_DIRECT - if (prAdapter->fgIsP2PRegistered) { - rlmProcessHtAction(prAdapter, prSwRfb); - } - #endif - break; - case CATEGORY_VENDOR_SPECIFIC_ACTION: - #if CFG_ENABLE_WIFI_DIRECT - if (prAdapter->fgIsP2PRegistered) { - p2pFuncValidateRxActionFrame(prAdapter, prSwRfb); - } - #endif - break; -#if CFG_SUPPORT_802_11W - case CATEGORY_SA_QUERT_ACTION: - { - P_HIF_RX_HEADER_T prHifRxHdr; - - prHifRxHdr = prSwRfb->prHifRxHdr; - - if ((HIF_RX_HDR_GET_NETWORK_IDX(prHifRxHdr) == NETWORK_TYPE_AIS_INDEX) && - prAdapter->rWifiVar.rAisSpecificBssInfo.fgMgmtProtection /* Use MFP */ - ) { - if (!(prHifRxHdr->ucReserved & CONTROL_FLAG_UC_MGMT_NO_ENC)) { - /* MFP test plan 5.3.3.4 */ - rsnSaQueryAction(prAdapter, prSwRfb); - } - else { - DBGLOG(RSN, TRACE, ("Un-Protected SA Query, do nothing\n")); - } - } - } - break; -#endif -#if CFG_SUPPORT_802_11V - case CATEGORY_WNM_ACTION: - { - wnmWNMAction(prAdapter, prSwRfb); - } - break; -#endif - default: - break; - } /* end of switch case */ - - return WLAN_STATUS_SUCCESS; -} - - diff --git a/drivers/net/wireless/mt5931/nic/nic_tx.c b/drivers/net/wireless/mt5931/nic/nic_tx.c deleted file mode 100755 index 5f626798b1e6..000000000000 --- a/drivers/net/wireless/mt5931/nic/nic_tx.c +++ /dev/null @@ -1,1981 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/nic/nic_tx.c#1 $ -*/ - -/*! \file nic_tx.c - \brief Functions that provide TX operation in NIC Layer. - - This file provides TX functions which are responsible for both Hardware and - Software Resource Management and keep their Synchronization. -*/ - - - -/* -** $Log: nic_tx.c $ - * - * 06 13 2012 yuche.tsai - * NULL - * Update maintrunk driver. - * Add support for driver compose assoc request frame. - * - * 11 18 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Add log counter for tx - * - * 11 09 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Add xlog for beacon timeout and sta aging timeout. - * - * 11 08 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Add xlog function. - * - * 05 17 2011 cp.wu - * [WCXRP00000732] [MT6620 Wi-Fi][AIS] No need to switch back to IDLE state when DEAUTH frame is dropped due to bss disconnection - * when TX DONE status is TX_RESULT_DROPPED_IN_DRIVER, no need to switch back to IDLE state. - * - * 04 12 2011 eddie.chen - * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma - * Fix the sta index in processing security frame - * Simple flow control for TC4 to avoid mgt frames for PS STA to occupy the TC4 - * Add debug message. - * - * 04 12 2011 cp.wu - * [WCXRP00000631] [MT6620 Wi-Fi][Driver] Add an API for QM to retrieve current TC counter value and processing frame dropping cases for TC4 path - * remove unused variables. - * - * 04 12 2011 cp.wu - * [WCXRP00000631] [MT6620 Wi-Fi][Driver] Add an API for QM to retrieve current TC counter value and processing frame dropping cases for TC4 path - * 1. add nicTxGetResource() API for QM to make decisions. - * 2. if management frames is decided by QM for dropping, the call back is invoked to indicate such a case. - * - * 03 17 2011 cp.wu - * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period - * use pre-allocated buffer for storing enhanced interrupt response as well - * - * 03 15 2011 cp.wu - * [WCXRP00000559] [MT6620 Wi-Fi][Driver] Combine TX/RX DMA buffers into a single one to reduce physically continuous memory consumption - * 1. deprecate CFG_HANDLE_IST_IN_SDIO_CALLBACK - * 2. Use common coalescing buffer for both TX/RX directions - * - * - * 02 16 2011 cp.wu - * [WCXRP00000449] [MT6620 Wi-Fi][Driver] Refine CMD queue handling by adding an extra API for checking availble count and modify behavior - * 1. add new API: nicTxGetFreeCmdCount() - * 2. when there is insufficient command descriptor, nicTxEnqueueMsdu() will drop command packets directly - * - * 01 24 2011 cp.wu - * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving - * 1. add an extra counter for tracking pending forward frames. - * 2. notify TX service thread as well when there is pending forward frame - * 3. correct build errors leaded by introduction of Wi-Fi direct separation module - * - * 01 12 2011 cp.wu - * [WCXRP00000356] [MT6620 Wi-Fi][Driver] fill mac header length for security frames 'cause hardware header translation needs such information - * fill mac header length information for 802.1x frames. - * - * 12 31 2010 cp.wu - * [WCXRP00000335] [MT6620 Wi-Fi][Driver] change to use milliseconds sleep instead of delay to avoid blocking to system scheduling - * change to use msleep() and shorten waiting interval to reduce blocking to other task while Wi-Fi driver is being loaded - * - * 11 01 2010 yarco.yang - * [WCXRP00000149] [MT6620 WI-Fi][Driver]Fine tune performance on MT6516 platform - * Add GPIO debug function - * - * 10 18 2010 cp.wu - * [WCXRP00000117] [MT6620 Wi-Fi][Driver] Add logic for suspending driver when MT6620 is not responding anymore - * 1. when wlanAdapterStop() failed to send POWER CTRL command to firmware, do not poll for ready bit dis-assertion - * 2. shorten polling count for shorter response time - * 3. if bad I/O operation is detected during TX resource polling, then further operation is aborted as well - * - * 10 06 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * code reorganization to improve isolation between GLUE and CORE layers. - * - * 09 29 2010 wh.su - * [WCXRP00000072] [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue - * [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue. - * - * 09 27 2010 wh.su - * NULL - * since the u2TxByteCount_UserPriority will or another setting, keep the overall buffer for avoid error - * - * 09 24 2010 wh.su - * NULL - * [WCXRP000000058][MT6620 Wi-Fi][Driver] Fail to handshake with WAPI AP due the 802.1x frame send to fw with extra bytes padding. - * - * 09 01 2010 cp.wu - * NULL - * HIFSYS Clock Source Workaround - * - * 08 30 2010 cp.wu - * NULL - * API added: nicTxPendingPackets(), for simplifying porting layer - * - * 08 30 2010 cp.wu - * NULL - * eliminate klockwork errors - * - * 08 20 2010 wh.su - * NULL - * adding the eapol callback setting. - * - * 08 18 2010 yarco.yang - * NULL - * 1. Fixed HW checksum offload function not work under Linux issue. - * 2. Add debug message. - * - * 08 05 2010 yuche.tsai - * NULL - * . - * - * 08 03 2010 cp.wu - * NULL - * surpress compilation warning. - * - * 08 02 2010 jeffrey.chang - * NULL - * 1) modify tx service thread to avoid busy looping - * 2) add spin lock declartion for linux build - * - * 07 29 2010 cp.wu - * NULL - * simplify post-handling after TX_DONE interrupt is handled. - * - * 07 19 2010 jeffrey.chang - * - * Linux port modification - * - * 07 13 2010 cp.wu - * - * 1) MMPDUs are now sent to MT6620 by CMD queue for keeping strict order of 1X/MMPDU/CMD packets - * 2) integrate with qmGetFrameAction() for deciding which MMPDU/1X could pass checking for sending - * 2) enhance CMD_INFO_T descriptor number from 10 to 32 to avoid descriptor underflow under concurrent network operation - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 29 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * replace g_rQM with Adpater->rQM - * - * 06 25 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add API in que_mgt to retrieve sta-rec index for security frames. - * - * 06 24 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 802.1x and bluetooth-over-Wi-Fi security frames are now delievered to firmware via command path instead of data path. - * - * 06 23 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Merge g_arStaRec[] into adapter->arStaRec[] - * - * 06 22 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) add command warpper for STA-REC/BSS-INFO sync. - * 2) enhance command packet sending procedure for non-oid part - * 3) add command packet definitions for STA-REC/BSS-INFO sync. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add checking for TX descriptor poll. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * TX descriptors are now allocated once for reducing allocation overhead - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 15 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * change zero-padding for TX port access to HAL. - * - * 06 15 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * . - * - * 06 15 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * . - * - * 06 14 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * fill extra information for revised HIF_TX_HEADER. - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 10 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * change to enqueue TX frame infinitely. - * - * 06 09 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add TX_PACKET_MGMT to indicate the frame is coming from management modules - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 10 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * fill network type field while doing frame identification. - * - * 04 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * surpress compiler warning - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * Tag the packet for QoS on Tx path - * - * 03 30 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * remove driver-land statistics. - * - * 03 29 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * improve none-glue code portability - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port - * - * 03 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * generate information for OID_GEN_RCV_OK & OID_GEN_XMIT_OK - * * * * * - * -* 03 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * code clean: removing unused variables and structure definitions - * - * 03 08 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) add another spin-lock to protect MsduInfoList due to it might be accessed by different thread. - * * * * 2) change own-back acquiring procedure to wait for up to 16.67 seconds - * - * 03 02 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add mutex to avoid multiple access to qmTxQueue simultaneously. - * - * 02 26 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * avoid refering to NDIS-specific data structure directly from non-glue layer. - * - * 02 24 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add Ethernet destination address information in packet info for TX - * - * 02 10 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) remove unused function in nic_rx.c [which has been handled in que_mgt.c] - * * * * * * 2) firmware image length is now retrieved via NdisFileOpen - * * * * * * 3) firmware image is not structured by (P_IMG_SEC_HDR_T) anymore - * * * * * * 4) nicRxWaitResponse() revised - * * * * * * 5) another set of TQ counter default value is added for fw-download state - * * * * * * 6) Wi-Fi load address is now retrieved from registry too - * - * 02 09 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. Permanent and current MAC address are now retrieved by CMD/EVENT packets instead of hard-coded address - * * * * * * * * * 2. follow MSDN defined behavior when associates to another AP - * * * * * * * * * 3. for firmware download, packet size could be up to 2048 bytes - * - * 02 08 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * prepare for implementing fw download logic - * - * 01 27 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. eliminate improper variable in rHifInfo - * * * * * * * * * 2. block TX/ordinary OID when RF test mode is engaged - * * * * * * * * * 3. wait until firmware finish operation when entering into and leaving from RF test mode - * * * * * * * * * 4. correct some HAL implementation - * - * 01 13 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Enabled the Burst_End Indication mechanism - * - * 01 13 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * TX: fill ucWlanHeaderLength/ucPktFormtId_Flags according to info provided by prMsduInfo - * - * 12 30 2009 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) According to CMD/EVENT documentation v0.8, - * * * * * * * * * * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used, - * * * * * * * * * * and result is retrieved by get ATInfo instead - * * * * * * * * * * 2) add 4 counter for recording aggregation statistics -** \main\maintrunk.MT6620WiFiDriver_Prj\44 2009-12-10 16:52:15 GMT mtk02752 -** remove unused API -** \main\maintrunk.MT6620WiFiDriver_Prj\43 2009-12-07 22:44:24 GMT mtk02752 -** correct assertion criterion -** \main\maintrunk.MT6620WiFiDriver_Prj\42 2009-12-07 21:15:52 GMT mtk02752 -** correct trivial mistake -** \main\maintrunk.MT6620WiFiDriver_Prj\41 2009-12-04 15:47:21 GMT mtk02752 -** + always append a dword of zero on TX path to avoid TX aggregation to triggered on uninitialized data -** + add more assertion for packet size check -** \main\maintrunk.MT6620WiFiDriver_Prj\40 2009-12-04 14:51:55 GMT mtk02752 -** nicTxMsduInfo(): save ptr for next entry before attaching to qDataPort -** \main\maintrunk.MT6620WiFiDriver_Prj\39 2009-12-04 11:54:54 GMT mtk02752 -** add 2 assertion for size check -** \main\maintrunk.MT6620WiFiDriver_Prj\38 2009-12-03 16:20:35 GMT mtk01461 -** Add debug message -** \main\maintrunk.MT6620WiFiDriver_Prj\37 2009-11-30 10:57:10 GMT mtk02752 -** 1st DW of WIFI_CMD_T is shared with HIF_TX_HEADER_T -** \main\maintrunk.MT6620WiFiDriver_Prj\36 2009-11-30 09:20:43 GMT mtk02752 -** use TC4 instead of TC5 for command packet -** \main\maintrunk.MT6620WiFiDriver_Prj\35 2009-11-27 11:08:11 GMT mtk02752 -** add flush for reset -** \main\maintrunk.MT6620WiFiDriver_Prj\34 2009-11-26 20:31:22 GMT mtk02752 -** fill prMsduInfo->ucUserPriority -** \main\maintrunk.MT6620WiFiDriver_Prj\33 2009-11-25 21:04:33 GMT mtk02752 -** fill u2SeqNo -** \main\maintrunk.MT6620WiFiDriver_Prj\32 2009-11-24 20:52:12 GMT mtk02752 -** integration with SD1's data path API -** \main\maintrunk.MT6620WiFiDriver_Prj\31 2009-11-24 19:54:25 GMT mtk02752 -** nicTxRetransmitOfOsSendQue & nicTxData but changed to use nicTxMsduInfoList -** \main\maintrunk.MT6620WiFiDriver_Prj\30 2009-11-23 17:53:18 GMT mtk02752 -** add nicTxCmd() for SD1_SD3_DATAPATH_INTEGRATION, which will append only HIF_TX_HEADER. seqNum, WIFI_CMD_T will be created inside oid handler -** \main\maintrunk.MT6620WiFiDriver_Prj\29 2009-11-20 15:10:24 GMT mtk02752 -** use TxAccquireResource instead of accessing TCQ directly. -** \main\maintrunk.MT6620WiFiDriver_Prj\28 2009-11-17 22:40:57 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\27 2009-11-17 17:35:40 GMT mtk02752 -** add nicTxMsduInfoList () implementation -** \main\maintrunk.MT6620WiFiDriver_Prj\26 2009-11-17 11:07:10 GMT mtk02752 -** add nicTxAdjustTcq() implementation -** \main\maintrunk.MT6620WiFiDriver_Prj\25 2009-11-16 22:28:38 GMT mtk02752 -** move aucFreeBufferCount/aucMaxNumOfBuffer into another structure -** \main\maintrunk.MT6620WiFiDriver_Prj\24 2009-11-16 21:45:32 GMT mtk02752 -** add SD1_SD3_DATAPATH_INTEGRATION data path handling -** \main\maintrunk.MT6620WiFiDriver_Prj\23 2009-11-13 13:29:56 GMT mtk01084 -** modify TX hdr format, fix tx retransmission issue -** \main\maintrunk.MT6620WiFiDriver_Prj\22 2009-11-11 10:36:21 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\21 2009-11-04 14:11:11 GMT mtk01084 -** modify TX SW data structure -** \main\maintrunk.MT6620WiFiDriver_Prj\20 2009-10-29 19:56:17 GMT mtk01084 -** modify HAL part -** \main\maintrunk.MT6620WiFiDriver_Prj\19 2009-10-13 21:59:23 GMT mtk01084 -** update for new HW design -** \main\maintrunk.MT6620WiFiDriver_Prj\18 2009-10-02 14:00:18 GMT mtk01725 -** \main\maintrunk.MT6620WiFiDriver_Prj\17 2009-05-20 12:26:06 GMT mtk01461 -** Assign SeqNum to CMD Packet -** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-05-19 10:54:04 GMT mtk01461 -** Add debug message -** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-05-12 09:41:55 GMT mtk01461 -** Fix Query Command need resp issue -** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-04-29 15:44:38 GMT mtk01461 -** Move OS dependent code to kalQueryTxOOBData() -** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-04-28 10:40:03 GMT mtk01461 -** Add nicTxReleaseResource() for SDIO_STATUS_ENHANCE, and also fix the TX aggregation issue for 1x packet to TX1 port -** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-04-21 09:50:47 GMT mtk01461 -** Update nicTxCmd() for moving wait RESP function call to wlanSendCommand() -** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-04-17 19:56:32 GMT mtk01461 -** Move the CMD_INFO_T related function to cmd_buf.c -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-04-17 18:14:40 GMT mtk01426 -** Update OOB query for TX packet -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-04-14 15:51:32 GMT mtk01426 -** Support PKGUIO -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-04-02 17:26:40 GMT mtk01461 -** Add virtual OOB for HIF LOOPBACK SW PRETEST -** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-01 10:54:43 GMT mtk01461 -** Add function for SDIO_TX_ENHANCE -** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-03-23 21:53:47 GMT mtk01461 -** Add code for retransmit of rOsSendQueue, mpSendPacket(), and add code for TX Checksum offload, Loopback Test. -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-03-23 00:33:51 GMT mtk01461 -** Add code for TX Data & Cmd Packet -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-18 20:25:40 GMT mtk01461 -** Fix LINT warning -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-16 09:10:30 GMT mtk01461 -** Update TX PATH API -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:26:04 GMT mtk01426 -** Init for develop -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will initial all variables in regard to SW TX Queues and -* all free lists of MSDU_INFO_T and SW_TFCB_T. -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicTxInitialize ( - IN P_ADAPTER_T prAdapter - ) -{ - P_TX_CTRL_T prTxCtrl; - PUINT_8 pucMemHandle; - P_MSDU_INFO_T prMsduInfo; - UINT_32 i; - KAL_SPIN_LOCK_DECLARATION(); - - DEBUGFUNC("nicTxInitialize"); - - ASSERT(prAdapter); - prTxCtrl = &prAdapter->rTxCtrl; - - //4 <1> Initialization of Traffic Class Queue Parameters - nicTxResetResource(prAdapter); - -#if CFG_SDIO_TX_AGG - prTxCtrl->pucTxCoalescingBufPtr = prAdapter->pucCoalescingBufCached; -#endif /* CFG_SDIO_TX_AGG */ - - // allocate MSDU_INFO_T and link it into rFreeMsduInfoList - QUEUE_INITIALIZE(&prTxCtrl->rFreeMsduInfoList); - - pucMemHandle = prTxCtrl->pucTxCached; - for (i = 0 ; i < CFG_TX_MAX_PKT_NUM ; i++) { - prMsduInfo = (P_MSDU_INFO_T)pucMemHandle; - kalMemZero(prMsduInfo, sizeof(MSDU_INFO_T)); - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_MSDU_INFO_LIST); - QUEUE_INSERT_TAIL(&prTxCtrl->rFreeMsduInfoList, (P_QUE_ENTRY_T)prMsduInfo); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_MSDU_INFO_LIST); - - pucMemHandle += ALIGN_4(sizeof(MSDU_INFO_T)); - } - - ASSERT(prTxCtrl->rFreeMsduInfoList.u4NumElem == CFG_TX_MAX_PKT_NUM); - /* Check if the memory allocation consist with this initialization function */ - ASSERT((UINT_32)(pucMemHandle - prTxCtrl->pucTxCached) == prTxCtrl->u4TxCachedSize); - - QUEUE_INITIALIZE(&prTxCtrl->rTxMgmtTxingQueue); - prTxCtrl->i4TxMgmtPendingNum = 0; - -#if CFG_HIF_STATISTICS - prTxCtrl->u4TotalTxAccessNum = 0; - prTxCtrl->u4TotalTxPacketNum = 0; -#endif - - prTxCtrl->i4PendingFwdFrameCount = 0; - - qmInit(prAdapter); - - TX_RESET_ALL_CNTS(prTxCtrl); - - return; -} /* end of nicTxInitialize() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Driver maintain a variable that is synchronous with the usage of individual -* TC Buffer Count. This function will check if has enough TC Buffer for incoming -* packet and then update the value after promise to provide the resources. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] ucTC Specify the resource of TC -* -* \retval WLAN_STATUS_SUCCESS Resource is available and been assigned. -* \retval WLAN_STATUS_RESOURCES Resource is not available. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicTxAcquireResource ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucTC - ) -{ - P_TX_CTRL_T prTxCtrl; - WLAN_STATUS u4Status = WLAN_STATUS_RESOURCES; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - prTxCtrl = &prAdapter->rTxCtrl; - - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_RESOURCE); - -// DbgPrint("nicTxAcquireResource prTxCtrl->rTc.aucFreeBufferCount[%d]=%d\n", ucTC, prTxCtrl->rTc.aucFreeBufferCount[ucTC]); - - if (prTxCtrl->rTc.aucFreeBufferCount[ucTC]) { - - prTxCtrl->rTc.aucFreeBufferCount[ucTC]--; - - DBGLOG(TX, EVENT, ("Acquire: TC = %d aucFreeBufferCount = %d\n", - ucTC, prTxCtrl->rTc.aucFreeBufferCount[ucTC])); - - u4Status = WLAN_STATUS_SUCCESS; - } - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_RESOURCE); - - return u4Status; - -}/* end of nicTxAcquireResourceAndTFCBs() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Driver maintain a variable that is synchronous with the usage of individual -* TC Buffer Count. This function will do polling if FW has return the resource. -* Used when driver start up before enable interrupt. -* -* @param prAdapter Pointer to the Adapter structure. -* @param ucTC Specify the resource of TC -* -* @retval WLAN_STATUS_SUCCESS Resource is available. -* @retval WLAN_STATUS_FAILURE Resource is not available. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicTxPollingResource ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucTC - ) -{ - P_TX_CTRL_T prTxCtrl; - WLAN_STATUS u4Status = WLAN_STATUS_FAILURE; - INT_32 i = NIC_TX_RESOURCE_POLLING_TIMEOUT; - UINT_32 au4WTSR[2]; - - ASSERT(prAdapter); - prTxCtrl = &prAdapter->rTxCtrl; - - if (ucTC >= TC_NUM) { - return WLAN_STATUS_FAILURE; - } - - if (prTxCtrl->rTc.aucFreeBufferCount[ucTC] > 0) { - return WLAN_STATUS_SUCCESS; - } - - while (i-- > 0) { - HAL_READ_TX_RELEASED_COUNT(prAdapter, au4WTSR); - - if(kalIsCardRemoved(prAdapter->prGlueInfo) == TRUE - || fgIsBusAccessFailed == TRUE) { - u4Status = WLAN_STATUS_FAILURE; - break; - } - else if (nicTxReleaseResource(prAdapter, (PUINT_8)au4WTSR)) { - if (prTxCtrl->rTc.aucFreeBufferCount[ucTC] > 0) { - u4Status = WLAN_STATUS_SUCCESS; - break; - } - else { - kalMsleep(NIC_TX_RESOURCE_POLLING_DELAY_MSEC); - } - } - else { - kalMsleep(NIC_TX_RESOURCE_POLLING_DELAY_MSEC); - } - } - -#if DBG - { - INT_32 i4Times = NIC_TX_RESOURCE_POLLING_TIMEOUT - (i+1); - - if (i4Times) { - DBGLOG(TX, TRACE, ("Polling MCR_WTSR delay %d times, %d msec\n", - i4Times, (i4Times * NIC_TX_RESOURCE_POLLING_DELAY_MSEC))); - } - } -#endif /* DBG */ - - return u4Status; - -} /* end of nicTxPollingResource() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Driver maintain a variable that is synchronous with the usage of individual -* TC Buffer Count. This function will release TC Buffer count according to -* the given TX_STATUS COUNTER after TX Done. -* -* \param[in] prAdapter Pointer to the Adapter structure. -* \param[in] u4TxStatusCnt Value of TX STATUS -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -nicTxReleaseResource ( - IN P_ADAPTER_T prAdapter, - IN UINT_8* aucTxRlsCnt - ) -{ - PUINT_32 pu4Tmp = (PUINT_32)aucTxRlsCnt; - P_TX_CTRL_T prTxCtrl; - BOOLEAN bStatus = FALSE; - UINT_32 i; - - KAL_SPIN_LOCK_DECLARATION(); - - - ASSERT(prAdapter); - prTxCtrl = &prAdapter->rTxCtrl; - - // DBGLOG(TX, TRACE, ("\n")); - - if (pu4Tmp[0] | pu4Tmp[1]) { - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_RESOURCE); - for (i = 0; i < TC_NUM; i++) { - prTxCtrl->rTc.aucFreeBufferCount[i] += aucTxRlsCnt[i]; - - if ((i==1) || (i==5)){ - DBGLOG(TX, EVENT, ("Release: i = %d aucFreeBufferCount = %d\n", - i, prTxCtrl->rTc.aucFreeBufferCount[i])); - } - } - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_RESOURCE); -#if 0 - for (i = 0; i < TC_NUM; i++) { - DBGLOG(INIT, TRACE, ("aucFreeBufferCount[%d]: %d, aucMaxNumOfBuffer[%d]: %d\n", - i, prTxCtrl->rTc.aucFreeBufferCount[i], i, prTxCtrl->rTc.aucMaxNumOfBuffer[i])); - } - DbgPrint("prTxCtrl->rTc.aucFreeBufferCount[0]=%d\n", prTxCtrl->rTc.aucFreeBufferCount[0]); - DbgPrint("prTxCtrl->rTc.aucFreeBufferCount[1]=%d\n", prTxCtrl->rTc.aucFreeBufferCount[1]); - DbgPrint("prTxCtrl->rTc.aucFreeBufferCount[2]=%d\n", prTxCtrl->rTc.aucFreeBufferCount[2]); - DbgPrint("prTxCtrl->rTc.aucFreeBufferCount[3]=%d\n", prTxCtrl->rTc.aucFreeBufferCount[3]); - DbgPrint("prTxCtrl->rTc.aucFreeBufferCount[4]=%d\n", prTxCtrl->rTc.aucFreeBufferCount[4]); - DbgPrint("prTxCtrl->rTc.aucFreeBufferCount[5]=%d\n", prTxCtrl->rTc.aucFreeBufferCount[5]); -#endif - ASSERT(prTxCtrl->rTc.aucFreeBufferCount[TC0_INDEX] <= prTxCtrl->rTc.aucMaxNumOfBuffer[TC0_INDEX]); - ASSERT(prTxCtrl->rTc.aucFreeBufferCount[TC1_INDEX] <= prTxCtrl->rTc.aucMaxNumOfBuffer[TC1_INDEX]); - ASSERT(prTxCtrl->rTc.aucFreeBufferCount[TC2_INDEX] <= prTxCtrl->rTc.aucMaxNumOfBuffer[TC2_INDEX]); - ASSERT(prTxCtrl->rTc.aucFreeBufferCount[TC3_INDEX] <= prTxCtrl->rTc.aucMaxNumOfBuffer[TC3_INDEX]); - ASSERT(prTxCtrl->rTc.aucFreeBufferCount[TC4_INDEX] <= prTxCtrl->rTc.aucMaxNumOfBuffer[TC4_INDEX]); - ASSERT(prTxCtrl->rTc.aucFreeBufferCount[TC5_INDEX] <= prTxCtrl->rTc.aucMaxNumOfBuffer[TC5_INDEX]); - bStatus = TRUE; - } - - return bStatus; -} /* end of nicTxReleaseResource() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Reset TC Buffer Count to initialized value -* -* \param[in] prAdapter Pointer to the Adapter structure. -* -* @return WLAN_STATUS_SUCCESS -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicTxResetResource ( - IN P_ADAPTER_T prAdapter - ) -{ - P_TX_CTRL_T prTxCtrl; - - KAL_SPIN_LOCK_DECLARATION(); - - DEBUGFUNC("nicTxResetResource"); - - ASSERT(prAdapter); - prTxCtrl = &prAdapter->rTxCtrl; - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_RESOURCE); - - prTxCtrl->rTc.aucMaxNumOfBuffer[TC0_INDEX] = NIC_TX_BUFF_COUNT_TC0; - prTxCtrl->rTc.aucFreeBufferCount[TC0_INDEX] = NIC_TX_BUFF_COUNT_TC0; - - prTxCtrl->rTc.aucMaxNumOfBuffer[TC1_INDEX] = NIC_TX_BUFF_COUNT_TC1; - prTxCtrl->rTc.aucFreeBufferCount[TC1_INDEX] = NIC_TX_BUFF_COUNT_TC1; - - prTxCtrl->rTc.aucMaxNumOfBuffer[TC2_INDEX] = NIC_TX_BUFF_COUNT_TC2; - prTxCtrl->rTc.aucFreeBufferCount[TC2_INDEX] = NIC_TX_BUFF_COUNT_TC2; - - prTxCtrl->rTc.aucMaxNumOfBuffer[TC3_INDEX] = NIC_TX_BUFF_COUNT_TC3; - prTxCtrl->rTc.aucFreeBufferCount[TC3_INDEX] = NIC_TX_BUFF_COUNT_TC3; - - prTxCtrl->rTc.aucMaxNumOfBuffer[TC4_INDEX] = NIC_TX_BUFF_COUNT_TC4; - prTxCtrl->rTc.aucFreeBufferCount[TC4_INDEX] = NIC_TX_BUFF_COUNT_TC4; - - prTxCtrl->rTc.aucMaxNumOfBuffer[TC5_INDEX] = NIC_TX_BUFF_COUNT_TC5; - prTxCtrl->rTc.aucFreeBufferCount[TC5_INDEX] = NIC_TX_BUFF_COUNT_TC5; - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_RESOURCE); - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Driver maintain a variable that is synchronous with the usage of individual -* TC Buffer Count. This function will return the value for other component -* which needs this information for making decisions -* -* @param prAdapter Pointer to the Adapter structure. -* @param ucTC Specify the resource of TC -* -* @retval UINT_8 The number of corresponding TC number -*/ -/*----------------------------------------------------------------------------*/ -UINT_8 -nicTxGetResource ( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucTC - ) -{ - P_TX_CTRL_T prTxCtrl; - - ASSERT(prAdapter); - prTxCtrl = &prAdapter->rTxCtrl; - - ASSERT(prTxCtrl); - - if (ucTC >= TC_NUM) { - return 0; - } - else { - return prTxCtrl->rTc.aucFreeBufferCount[ucTC]; - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief In this function, we'll aggregate frame(PACKET_INFO_T) -* corresponding to HIF TX port -* -* @param prAdapter Pointer to the Adapter structure. -* @param prMsduInfoListHead a link list of P_MSDU_INFO_T -* -* @retval WLAN_STATUS_SUCCESS Bus access ok. -* @retval WLAN_STATUS_FAILURE Bus access fail. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicTxMsduInfoList ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfoListHead - ) -{ - P_MSDU_INFO_T prMsduInfo, prNextMsduInfo; - QUE_T qDataPort0, qDataPort1; - WLAN_STATUS status; - - ASSERT(prAdapter); - ASSERT(prMsduInfoListHead); - - prMsduInfo = prMsduInfoListHead; - - QUEUE_INITIALIZE(&qDataPort0); - QUEUE_INITIALIZE(&qDataPort1); - - // Separate MSDU_INFO_T lists into 2 categories: for Port#0 & Port#1 - while(prMsduInfo) { - prNextMsduInfo = (P_MSDU_INFO_T)QUEUE_GET_NEXT_ENTRY((P_QUE_ENTRY_T)prMsduInfo); -#if DBG && 0 - LOG_FUNC("nicTxMsduInfoList Acquire TC %d net %u mac len %u len %u Type %u 1x %u 11 %u\n", - prMsduInfo->ucTC, - prMsduInfo->ucNetworkType, - prMsduInfo->ucMacHeaderLength, - prMsduInfo->u2FrameLength, - prMsduInfo->ucPacketType, - prMsduInfo->fgIs802_1x, - prMsduInfo->fgIs802_11 ); - - LOG_FUNC("Dest Mac: " MACSTR "\n", - MAC2STR(prMsduInfo->aucEthDestAddr)); -#endif - - switch(prMsduInfo->ucTC) { - case TC0_INDEX: - case TC1_INDEX: - case TC2_INDEX: - case TC3_INDEX: - case TC5_INDEX: // Broadcast/multicast data packets - QUEUE_GET_NEXT_ENTRY((P_QUE_ENTRY_T)prMsduInfo) = NULL; - QUEUE_INSERT_TAIL(&qDataPort0, (P_QUE_ENTRY_T)prMsduInfo); - status = nicTxAcquireResource(prAdapter, prMsduInfo->ucTC); - ASSERT(status == WLAN_STATUS_SUCCESS) - - break; - - case TC4_INDEX: // Command or 802.1x packets - QUEUE_GET_NEXT_ENTRY((P_QUE_ENTRY_T)prMsduInfo) = NULL; - QUEUE_INSERT_TAIL(&qDataPort1, (P_QUE_ENTRY_T)prMsduInfo); - - status = nicTxAcquireResource(prAdapter, prMsduInfo->ucTC); - ASSERT(status == WLAN_STATUS_SUCCESS) - - break; - - default: - ASSERT(0); - break; - } - - prMsduInfo = prNextMsduInfo; - } - - if(qDataPort0.u4NumElem > 0) { - nicTxMsduQueue(prAdapter, 0, &qDataPort0); - } - - if(qDataPort1.u4NumElem > 0) { - nicTxMsduQueue(prAdapter, 1, &qDataPort1); - } - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief In this function, we'll write frame(PACKET_INFO_T) into HIF. -* -* @param prAdapter Pointer to the Adapter structure. -* @param ucPortIdx Port Number -* @param prQue a link list of P_MSDU_INFO_T -* -* @retval WLAN_STATUS_SUCCESS Bus access ok. -* @retval WLAN_STATUS_FAILURE Bus access fail. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicTxMsduQueue ( - IN P_ADAPTER_T prAdapter, - UINT_8 ucPortIdx, - P_QUE_T prQue - ) -{ - P_MSDU_INFO_T prMsduInfo, prNextMsduInfo; - HIF_TX_HEADER_T rHwTxHeader; - P_NATIVE_PACKET prNativePacket; - UINT_16 u2OverallBufferLength; - UINT_8 ucEtherTypeOffsetInWord; - PUINT_8 pucOutputBuf = (PUINT_8)NULL; /* Pointer to Transmit Data Structure Frame */ - UINT_32 u4TxHdrSize; - UINT_32 u4ValidBufSize; - UINT_32 u4TotalLength; - P_TX_CTRL_T prTxCtrl; - QUE_T rFreeQueue; -#if CFG_TCP_IP_CHKSUM_OFFLOAD - UINT_8 ucChksumFlag; -#endif - - ASSERT(prAdapter); - ASSERT(ucPortIdx < 2); - ASSERT(prQue); - - prTxCtrl = &prAdapter->rTxCtrl; - u4ValidBufSize = prAdapter->u4CoalescingBufCachedSize; - -#if CFG_HIF_STATISTICS - prTxCtrl->u4TotalTxAccessNum++; - prTxCtrl->u4TotalTxPacketNum += prQue->u4NumElem; -#endif - - QUEUE_INITIALIZE(&rFreeQueue); - - if(prQue->u4NumElem > 0) { - prMsduInfo = (P_MSDU_INFO_T)QUEUE_GET_HEAD(prQue); - pucOutputBuf = prTxCtrl->pucTxCoalescingBufPtr; - u4TotalLength = 0; - - while(prMsduInfo) { - - // DBGLOG(TX, TRACE, ("SN %d, len %d\n", prMsduInfo->ucTxSeqNum, prMsduInfo->u2FrameLength)); - - kalMemZero(&rHwTxHeader, sizeof(rHwTxHeader)); - - prNativePacket = prMsduInfo->prPacket; - - ASSERT(prNativePacket); - - u4TxHdrSize = TX_HDR_SIZE; - - u2OverallBufferLength = ((prMsduInfo->u2FrameLength + TX_HDR_SIZE) & - (UINT_16)HIF_TX_HDR_TX_BYTE_COUNT_MASK); - - rHwTxHeader.u2TxByteCount_UserPriority = u2OverallBufferLength; - rHwTxHeader.u2TxByteCount_UserPriority |= - ((UINT_16)prMsduInfo->ucUserPriority << HIF_TX_HDR_USER_PRIORITY_OFFSET); - - if (prMsduInfo->fgIs802_11) { - ucEtherTypeOffsetInWord = - (TX_HDR_SIZE + prMsduInfo->ucMacHeaderLength + prMsduInfo->ucLlcLength) >> 1; - } - else { - ucEtherTypeOffsetInWord = - ((ETHER_HEADER_LEN - ETHER_TYPE_LEN) + TX_HDR_SIZE) >> 1; - } - - rHwTxHeader.ucEtherTypeOffset = - ucEtherTypeOffsetInWord & HIF_TX_HDR_ETHER_TYPE_OFFSET_MASK; - - rHwTxHeader.ucResource_PktType_CSflags = (prMsduInfo->ucTC) << HIF_TX_HDR_RESOURCE_OFFSET; - rHwTxHeader.ucResource_PktType_CSflags |= - (UINT_8)(((prMsduInfo->ucPacketType) << HIF_TX_HDR_PACKET_TYPE_OFFSET) & - (HIF_TX_HDR_PACKET_TYPE_MASK)); - -#if CFG_TCP_IP_CHKSUM_OFFLOAD - if (prMsduInfo->eSrc == TX_PACKET_OS - || prMsduInfo->eSrc == TX_PACKET_FORWARDING) { - if (prAdapter->u4CSUMFlags & - (CSUM_OFFLOAD_EN_TX_TCP | - CSUM_OFFLOAD_EN_TX_UDP | - CSUM_OFFLOAD_EN_TX_IP)) { - kalQueryTxChksumOffloadParam(prNativePacket, &ucChksumFlag); - - if (ucChksumFlag & TX_CS_IP_GEN) { - rHwTxHeader.ucResource_PktType_CSflags |= (UINT_8)HIF_TX_HDR_IP_CSUM; - } - - if (ucChksumFlag & TX_CS_TCP_UDP_GEN) { - rHwTxHeader.ucResource_PktType_CSflags |= (UINT_8)HIF_TX_HDR_TCP_CSUM; - } - } - } -#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */ - - rHwTxHeader.u2LLH = prMsduInfo->u2PalLLH; - rHwTxHeader.ucStaRecIdx = prMsduInfo->ucStaRecIndex; - rHwTxHeader.ucForwardingType_SessionID_Reserved = - (prMsduInfo->ucPsForwardingType) | ((prMsduInfo->ucPsSessionID) << HIF_TX_HDR_PS_SESSION_ID_OFFSET) - | ((prMsduInfo->fgIsBurstEnd)? HIF_TX_HDR_BURST_END_MASK : 0); - - rHwTxHeader.ucWlanHeaderLength = (prMsduInfo->ucMacHeaderLength & HIF_TX_HDR_WLAN_HEADER_LEN_MASK); - rHwTxHeader.ucPktFormtId_Flags = - (prMsduInfo->ucFormatID & HIF_TX_HDR_FORMAT_ID_MASK) - | ((prMsduInfo->ucNetworkType << HIF_TX_HDR_NETWORK_TYPE_OFFSET) & HIF_TX_HDR_NETWORK_TYPE_MASK) - | ((prMsduInfo->fgIs802_1x << HIF_TX_HDR_FLAG_1X_FRAME_OFFSET) & HIF_TX_HDR_FLAG_1X_FRAME_MASK) - | ((prMsduInfo->fgIs802_11 << HIF_TX_HDR_FLAG_802_11_FORMAT_OFFSET) & HIF_TX_HDR_FLAG_802_11_FORMAT_MASK); - - rHwTxHeader.u2SeqNo = prMsduInfo->u2AclSN; - - if(prMsduInfo->pfTxDoneHandler) { - rHwTxHeader.ucPacketSeqNo = prMsduInfo->ucTxSeqNum; - rHwTxHeader.ucAck_BIP_BasicRate = HIF_TX_HDR_NEED_ACK; - } - else { - rHwTxHeader.ucPacketSeqNo = 0; - rHwTxHeader.ucAck_BIP_BasicRate = 0; - } - - if(prMsduInfo->fgIsBIP) { - rHwTxHeader.ucAck_BIP_BasicRate |= HIF_TX_HDR_BIP; - } - - if(prMsduInfo->fgIsBasicRate) { - rHwTxHeader.ucAck_BIP_BasicRate |= HIF_TX_HDR_BASIC_RATE; - } - -#if CFG_SDIO_TX_AGG - // attach to coalescing buffer - kalMemCopy(pucOutputBuf + u4TotalLength, &rHwTxHeader, u4TxHdrSize); - u4TotalLength += u4TxHdrSize; - - if (prMsduInfo->eSrc == TX_PACKET_OS - || prMsduInfo->eSrc == TX_PACKET_FORWARDING) { - kalCopyFrame(prAdapter->prGlueInfo, - prNativePacket, - pucOutputBuf + u4TotalLength); - } - else if(prMsduInfo->eSrc == TX_PACKET_MGMT) { - kalMemCopy(pucOutputBuf + u4TotalLength, - prNativePacket, - prMsduInfo->u2FrameLength); - } - else { - ASSERT(0); - } - - u4TotalLength += ALIGN_4(prMsduInfo->u2FrameLength); - -#else - kalMemCopy(pucOutputBuf, &rHwTxHeader, u4TxHdrSize); - - /* Copy Frame Body */ - if (prMsduInfo->eSrc == TX_PACKET_OS - || prMsduInfo->eSrc == TX_PACKET_FORWARDING) { - kalCopyFrame(prAdapter->prGlueInfo, - prNativePacket, - pucOutputBuf + u4TxHdrSize); - } - else if(prMsduInfo->eSrc == TX_PACKET_MGMT) { - kalMemCopy(pucOutputBuf + u4TxHdrSize, - prNativePacket, - prMsduInfo->u2FrameLength); - } - else { - ASSERT(0); - } - - ASSERT(u2OverallBufferLength <= u4ValidBufSize); - - HAL_WRITE_TX_PORT(prAdapter, - ucPortIdx, - (UINT_32)u2OverallBufferLength, - (PUINT_8)pucOutputBuf, - u4ValidBufSize); - - // send immediately -#endif - prNextMsduInfo = (P_MSDU_INFO_T) - QUEUE_GET_NEXT_ENTRY(&prMsduInfo->rQueEntry); - - if (prMsduInfo->eSrc == TX_PACKET_MGMT) { - GLUE_DEC_REF_CNT(prTxCtrl->i4TxMgmtPendingNum); - - if (prMsduInfo->pfTxDoneHandler == NULL) { - cnmMgtPktFree(prAdapter, prMsduInfo); - } - else { - KAL_SPIN_LOCK_DECLARATION(); - DBGLOG(INIT, TRACE,("Wait TxSeqNum:%d\n", prMsduInfo->ucTxSeqNum)); - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TXING_MGMT_LIST); - QUEUE_INSERT_TAIL(&(prTxCtrl->rTxMgmtTxingQueue), (P_QUE_ENTRY_T)prMsduInfo); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TXING_MGMT_LIST); - } - } - else { - /* only free MSDU when it is not a MGMT frame */ - QUEUE_INSERT_TAIL(&rFreeQueue, (P_QUE_ENTRY_T)prMsduInfo); - - if (prMsduInfo->eSrc == TX_PACKET_OS) { - kalSendComplete(prAdapter->prGlueInfo, - prNativePacket, - WLAN_STATUS_SUCCESS); - } - else if(prMsduInfo->eSrc == TX_PACKET_FORWARDING) { - GLUE_DEC_REF_CNT(prTxCtrl->i4PendingFwdFrameCount); - } - } - - prMsduInfo = prNextMsduInfo; - } - -#if CFG_SDIO_TX_AGG - ASSERT(u4TotalLength <= u4ValidBufSize); - - #if CFG_DBG_GPIO_PINS - { - /* Start port write */ - mtk_wcn_stp_debug_gpio_assert(IDX_TX_PORT_WRITE, DBG_TIE_LOW); - kalUdelay(1); - mtk_wcn_stp_debug_gpio_assert(IDX_TX_PORT_WRITE, DBG_TIE_HIGH); - } - #endif - - // send coalescing buffer - HAL_WRITE_TX_PORT(prAdapter, - ucPortIdx, - u4TotalLength, - (PUINT_8)pucOutputBuf, - u4ValidBufSize); -#endif - - // return - nicTxReturnMsduInfo(prAdapter, (P_MSDU_INFO_T)QUEUE_GET_HEAD(&rFreeQueue)); - } - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief In this function, we'll write Command(CMD_INFO_T) into HIF. -* -* @param prAdapter Pointer to the Adapter structure. -* @param prPacketInfo Pointer of CMD_INFO_T -* @param ucTC Specify the resource of TC -* -* @retval WLAN_STATUS_SUCCESS Bus access ok. -* @retval WLAN_STATUS_FAILURE Bus access fail. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicTxCmd ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN UINT_8 ucTC - ) -{ - P_WIFI_CMD_T prWifiCmd; - UINT_16 u2OverallBufferLength; - PUINT_8 pucOutputBuf = (PUINT_8)NULL; /* Pointer to Transmit Data Structure Frame */ - UINT_8 ucPortIdx; - HIF_TX_HEADER_T rHwTxHeader; - P_NATIVE_PACKET prNativePacket; - UINT_8 ucEtherTypeOffsetInWord; - P_MSDU_INFO_T prMsduInfo; - P_TX_CTRL_T prTxCtrl; - - KAL_SPIN_LOCK_DECLARATION(); - - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - - prTxCtrl = &prAdapter->rTxCtrl; - pucOutputBuf = prTxCtrl->pucTxCoalescingBufPtr; - - // <1> Assign Data Port - if (ucTC != TC4_INDEX) { - ucPortIdx = 0; - } - else { - // Broadcast/multicast data frames, 1x frames, command packets, MMPDU - ucPortIdx = 1; - } - - if(prCmdInfo->eCmdType == COMMAND_TYPE_SECURITY_FRAME) { - // <2> Compose HIF_TX_HEADER - kalMemZero(&rHwTxHeader, sizeof(rHwTxHeader)); - - prNativePacket = prCmdInfo->prPacket; - - ASSERT(prNativePacket); - - u2OverallBufferLength = TFCB_FRAME_PAD_TO_DW((prCmdInfo->u2InfoBufLen + TX_HDR_SIZE) - & (UINT_16)HIF_TX_HDR_TX_BYTE_COUNT_MASK); - - rHwTxHeader.u2TxByteCount_UserPriority = ((prCmdInfo->u2InfoBufLen + TX_HDR_SIZE) - & (UINT_16)HIF_TX_HDR_TX_BYTE_COUNT_MASK); - ucEtherTypeOffsetInWord = ((ETHER_HEADER_LEN - ETHER_TYPE_LEN) + TX_HDR_SIZE) >> 1; - - rHwTxHeader.ucEtherTypeOffset = - ucEtherTypeOffsetInWord & HIF_TX_HDR_ETHER_TYPE_OFFSET_MASK; - - rHwTxHeader.ucResource_PktType_CSflags = (ucTC << HIF_TX_HDR_RESOURCE_OFFSET); - - rHwTxHeader.ucStaRecIdx = prCmdInfo->ucStaRecIndex; - rHwTxHeader.ucForwardingType_SessionID_Reserved = HIF_TX_HDR_BURST_END_MASK; - - rHwTxHeader.ucWlanHeaderLength = (ETH_HLEN & HIF_TX_HDR_WLAN_HEADER_LEN_MASK); - rHwTxHeader.ucPktFormtId_Flags = - (((UINT_8)(prCmdInfo->eNetworkType) << HIF_TX_HDR_NETWORK_TYPE_OFFSET) & HIF_TX_HDR_NETWORK_TYPE_MASK) - | ((1 << HIF_TX_HDR_FLAG_1X_FRAME_OFFSET) & HIF_TX_HDR_FLAG_1X_FRAME_MASK); - - rHwTxHeader.u2SeqNo = 0; - rHwTxHeader.ucPacketSeqNo = 0; - rHwTxHeader.ucAck_BIP_BasicRate = 0; - - // <2.3> Copy HIF TX HEADER - kalMemCopy((PVOID)&pucOutputBuf[0], (PVOID)&rHwTxHeader, TX_HDR_SIZE); - - // <3> Copy Frame Body Copy - kalCopyFrame(prAdapter->prGlueInfo, - prNativePacket, - pucOutputBuf + TX_HDR_SIZE); - } - else if(prCmdInfo->eCmdType == COMMAND_TYPE_MANAGEMENT_FRAME) { - prMsduInfo = (P_MSDU_INFO_T)prCmdInfo->prPacket; - - ASSERT(prMsduInfo->fgIs802_11 == TRUE); - ASSERT(prMsduInfo->eSrc == TX_PACKET_MGMT); - - // <2> Compose HIF_TX_HEADER - kalMemZero(&rHwTxHeader, sizeof(rHwTxHeader)); - - u2OverallBufferLength = ((prMsduInfo->u2FrameLength + TX_HDR_SIZE) & - (UINT_16)HIF_TX_HDR_TX_BYTE_COUNT_MASK); - - rHwTxHeader.u2TxByteCount_UserPriority = u2OverallBufferLength; - rHwTxHeader.u2TxByteCount_UserPriority |= - ((UINT_16)prMsduInfo->ucUserPriority << HIF_TX_HDR_USER_PRIORITY_OFFSET); - - ucEtherTypeOffsetInWord = - (TX_HDR_SIZE + prMsduInfo->ucMacHeaderLength + prMsduInfo->ucLlcLength) >> 1; - - rHwTxHeader.ucEtherTypeOffset = - ucEtherTypeOffsetInWord & HIF_TX_HDR_ETHER_TYPE_OFFSET_MASK; - - rHwTxHeader.ucResource_PktType_CSflags = (prMsduInfo->ucTC) << HIF_TX_HDR_RESOURCE_OFFSET; - rHwTxHeader.ucResource_PktType_CSflags |= - (UINT_8)(((prMsduInfo->ucPacketType) << HIF_TX_HDR_PACKET_TYPE_OFFSET) & - (HIF_TX_HDR_PACKET_TYPE_MASK)); - - rHwTxHeader.u2LLH = prMsduInfo->u2PalLLH; - rHwTxHeader.ucStaRecIdx = prMsduInfo->ucStaRecIndex; - rHwTxHeader.ucForwardingType_SessionID_Reserved = - (prMsduInfo->ucPsForwardingType) | ((prMsduInfo->ucPsSessionID) << HIF_TX_HDR_PS_SESSION_ID_OFFSET) - | ((prMsduInfo->fgIsBurstEnd)? HIF_TX_HDR_BURST_END_MASK : 0); - - rHwTxHeader.ucWlanHeaderLength = (prMsduInfo->ucMacHeaderLength & HIF_TX_HDR_WLAN_HEADER_LEN_MASK); - rHwTxHeader.ucPktFormtId_Flags = - (prMsduInfo->ucFormatID & HIF_TX_HDR_FORMAT_ID_MASK) - | ((prMsduInfo->ucNetworkType << HIF_TX_HDR_NETWORK_TYPE_OFFSET) & HIF_TX_HDR_NETWORK_TYPE_MASK) - | ((prMsduInfo->fgIs802_1x << HIF_TX_HDR_FLAG_1X_FRAME_OFFSET) & HIF_TX_HDR_FLAG_1X_FRAME_MASK) - | ((prMsduInfo->fgIs802_11 << HIF_TX_HDR_FLAG_802_11_FORMAT_OFFSET) & HIF_TX_HDR_FLAG_802_11_FORMAT_MASK); - - rHwTxHeader.u2SeqNo = prMsduInfo->u2AclSN; - - if(prMsduInfo->pfTxDoneHandler) { - rHwTxHeader.ucPacketSeqNo = prMsduInfo->ucTxSeqNum; - rHwTxHeader.ucAck_BIP_BasicRate = HIF_TX_HDR_NEED_ACK; - } - else { - rHwTxHeader.ucPacketSeqNo = 0; - rHwTxHeader.ucAck_BIP_BasicRate = 0; - } - - if(prMsduInfo->fgIsBIP) { - rHwTxHeader.ucAck_BIP_BasicRate |= HIF_TX_HDR_BIP; - } - - if(prMsduInfo->fgIsBasicRate) { - rHwTxHeader.ucAck_BIP_BasicRate |= HIF_TX_HDR_BASIC_RATE; - } - - // <2.3> Copy HIF TX HEADER - kalMemCopy((PVOID)&pucOutputBuf[0], (PVOID)&rHwTxHeader, TX_HDR_SIZE); - - // <3> Copy Frame Body - kalMemCopy(pucOutputBuf + TX_HDR_SIZE, - prMsduInfo->prPacket, - prMsduInfo->u2FrameLength); - - // <4> Management Frame Post-Processing - GLUE_DEC_REF_CNT(prTxCtrl->i4TxMgmtPendingNum); - - if (prMsduInfo->pfTxDoneHandler == NULL) { - cnmMgtPktFree(prAdapter, prMsduInfo); - } - else { - - DBGLOG(INIT, TRACE,("Wait Cmd TxSeqNum:%d\n", prMsduInfo->ucTxSeqNum)); - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TXING_MGMT_LIST); - QUEUE_INSERT_TAIL(&(prTxCtrl->rTxMgmtTxingQueue), (P_QUE_ENTRY_T)prMsduInfo); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TXING_MGMT_LIST); - } - } - else { - prWifiCmd = (P_WIFI_CMD_T)prCmdInfo->pucInfoBuffer; - - // <2> Compose the Header of Transmit Data Structure for CMD Packet - u2OverallBufferLength = TFCB_FRAME_PAD_TO_DW( - (prCmdInfo->u2InfoBufLen) & (UINT_16)HIF_TX_HDR_TX_BYTE_COUNT_MASK); - - prWifiCmd->u2TxByteCount_UserPriority = u2OverallBufferLength; - prWifiCmd->ucEtherTypeOffset = 0; - prWifiCmd->ucResource_PktType_CSflags = (ucTC << HIF_TX_HDR_RESOURCE_OFFSET) - | (UINT_8)((HIF_TX_PKT_TYPE_CMD << HIF_TX_HDR_PACKET_TYPE_OFFSET) & (HIF_TX_HDR_PACKET_TYPE_MASK)); - - - // <3> Copy CMD Header to command buffer (by using pucCoalescingBufCached) - kalMemCopy((PVOID)&pucOutputBuf[0], - (PVOID)prCmdInfo->pucInfoBuffer, - prCmdInfo->u2InfoBufLen); - - ASSERT(u2OverallBufferLength <= prAdapter->u4CoalescingBufCachedSize); - } - - // <4> Write frame to data port - HAL_WRITE_TX_PORT(prAdapter, - ucPortIdx, - (UINT_32)u2OverallBufferLength, - (PUINT_8)pucOutputBuf, - (UINT_32)prAdapter->u4CoalescingBufCachedSize); - - return WLAN_STATUS_SUCCESS; -} /* end of nicTxCmd() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function will clean up all the pending frames in internal SW Queues -* by return the pending TX packet to the system. -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicTxRelease ( - IN P_ADAPTER_T prAdapter - ) -{ - P_TX_CTRL_T prTxCtrl; - P_MSDU_INFO_T prMsduInfo; - - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - - prTxCtrl = &prAdapter->rTxCtrl; - - nicTxFlush(prAdapter); - - // free MSDU_INFO_T from rTxMgmtMsduInfoList - do { - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TXING_MGMT_LIST); - QUEUE_REMOVE_HEAD(&prTxCtrl->rTxMgmtTxingQueue, prMsduInfo, P_MSDU_INFO_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TXING_MGMT_LIST); - - if(prMsduInfo) { - // the packet must be mgmt frame with tx done callback - ASSERT(prMsduInfo->eSrc == TX_PACKET_MGMT); - ASSERT(prMsduInfo->pfTxDoneHandler != NULL); - - // invoke done handler - prMsduInfo->pfTxDoneHandler(prAdapter, prMsduInfo, TX_RESULT_LIFE_TIMEOUT); - - cnmMgtPktFree(prAdapter, prMsduInfo); - } - else { - break; - } - } while(TRUE); - - return; -} /* end of nicTxRelease() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Process the TX Done interrupt and pull in more pending frames in SW -* Queues for transmission. -* -* @param prAdapter Pointer to the Adapter structure. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicProcessTxInterrupt( - IN P_ADAPTER_T prAdapter - ) -{ - P_TX_CTRL_T prTxCtrl; -#if CFG_SDIO_INTR_ENHANCE - P_SDIO_CTRL_T prSDIOCtrl; -#else - UINT_32 au4TxCount[2]; -#endif /* CFG_SDIO_INTR_ENHANCE */ - - ASSERT(prAdapter); - - prTxCtrl = &prAdapter->rTxCtrl; - ASSERT(prTxCtrl); - - /* Get the TX STATUS */ -#if CFG_SDIO_INTR_ENHANCE - - prSDIOCtrl = prAdapter->prSDIOCtrl; - #if DBG - //dumpMemory8((PUINT_8)prSDIOCtrl, sizeof(SDIO_CTRL_T)); - #endif - - nicTxReleaseResource(prAdapter, (PUINT_8)&prSDIOCtrl->rTxInfo); - kalMemZero(&prSDIOCtrl->rTxInfo, sizeof(prSDIOCtrl->rTxInfo)); - -#else - - HAL_MCR_RD(prAdapter, MCR_WTSR0, &au4TxCount[0]); - HAL_MCR_RD(prAdapter, MCR_WTSR1, &au4TxCount[1]); - DBGLOG(EMU, TRACE, ("MCR_WTSR0: 0x%x, MCR_WTSR1: 0x%x\n", au4TxCount[0], au4TxCount[1])); - - nicTxReleaseResource(prAdapter, (PUINT_8)au4TxCount); - -#endif /* CFG_SDIO_INTR_ENHANCE */ - - nicTxAdjustTcq(prAdapter); - - // Indicate Service Thread - if(kalGetTxPendingCmdCount(prAdapter->prGlueInfo) > 0 - || wlanGetTxPendingFrameCount(prAdapter) > 0) { - kalSetEvent(prAdapter->prGlueInfo); - } - - return; -} /* end of nicProcessTxInterrupt() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief this function frees packet of P_MSDU_INFO_T linked-list -* -* @param prAdapter Pointer to the Adapter structure. -* @param prMsduInfoList a link list of P_MSDU_INFO_T -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicTxFreeMsduInfoPacket ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfoListHead - ) -{ - P_NATIVE_PACKET prNativePacket; - P_MSDU_INFO_T prMsduInfo = prMsduInfoListHead; - P_TX_CTRL_T prTxCtrl; - - - ASSERT(prAdapter); - ASSERT(prMsduInfoListHead); - - prTxCtrl = &prAdapter->rTxCtrl; - - while(prMsduInfo) { - prNativePacket = prMsduInfo->prPacket; - - if(prMsduInfo->eSrc == TX_PACKET_OS) { - kalSendComplete(prAdapter->prGlueInfo, - prNativePacket, - WLAN_STATUS_FAILURE); - } - else if(prMsduInfo->eSrc == TX_PACKET_MGMT) { - if (prMsduInfo->pfTxDoneHandler) { - prMsduInfo->pfTxDoneHandler(prAdapter, prMsduInfo, TX_RESULT_DROPPED_IN_DRIVER); - } - cnmMemFree(prAdapter, prNativePacket); - } - else if(prMsduInfo->eSrc == TX_PACKET_FORWARDING) { - GLUE_DEC_REF_CNT(prTxCtrl->i4PendingFwdFrameCount); - } - - prMsduInfo = (P_MSDU_INFO_T)QUEUE_GET_NEXT_ENTRY((P_QUE_ENTRY_T)prMsduInfo); - } - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief this function returns P_MSDU_INFO_T of MsduInfoList to TxCtrl->rfreeMsduInfoList -* -* @param prAdapter Pointer to the Adapter structure. -* @param prMsduInfoList a link list of P_MSDU_INFO_T -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicTxReturnMsduInfo ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfoListHead - ) -{ - P_TX_CTRL_T prTxCtrl; - P_MSDU_INFO_T prMsduInfo = prMsduInfoListHead, prNextMsduInfo; - - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - - prTxCtrl = &prAdapter->rTxCtrl; - ASSERT(prTxCtrl); - - while(prMsduInfo) { - prNextMsduInfo = (P_MSDU_INFO_T)QUEUE_GET_NEXT_ENTRY((P_QUE_ENTRY_T)prMsduInfo); - - switch(prMsduInfo->eSrc) { - case TX_PACKET_FORWARDING: - wlanReturnPacket(prAdapter, prMsduInfo->prPacket); - break; - case TX_PACKET_OS: - case TX_PACKET_OS_OID: - case TX_PACKET_MGMT: - default: - break; - } - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_MSDU_INFO_LIST); - QUEUE_INSERT_TAIL(&prTxCtrl->rFreeMsduInfoList, (P_QUE_ENTRY_T)prMsduInfo); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_MSDU_INFO_LIST); - prMsduInfo = prNextMsduInfo; - }; - - return; -} - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief this function fills packet information to P_MSDU_INFO_T -* -* @param prAdapter Pointer to the Adapter structure. -* @param prMsduInfo P_MSDU_INFO_T -* @param prPacket P_NATIVE_PACKET -* -* @retval TRUE Success to extract information -* @retval FALSE Fail to extract correct information -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -nicTxFillMsduInfo ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo, - IN P_NATIVE_PACKET prPacket - ) -{ - P_GLUE_INFO_T prGlueInfo; - UINT_8 ucPriorityParam; - UINT_8 ucMacHeaderLen; - UINT_8 aucEthDestAddr[PARAM_MAC_ADDR_LEN]; - BOOLEAN fgIs1x = FALSE; - BOOLEAN fgIsPAL = FALSE; - UINT_32 u4PacketLen; - ULONG u4SysTime; - UINT_8 ucNetworkType; - - - ASSERT(prAdapter); - - prGlueInfo = prAdapter->prGlueInfo; - ASSERT(prGlueInfo); - - if (kalQoSFrameClassifierAndPacketInfo(prGlueInfo, - prPacket, - &ucPriorityParam, - &u4PacketLen, - aucEthDestAddr, - &fgIs1x, - &fgIsPAL, - &ucNetworkType) == FALSE) { - return FALSE; - } - - /* Save the value of Priority Parameter */ - GLUE_SET_PKT_TID(prPacket, ucPriorityParam); - - if (fgIs1x) { - GLUE_SET_PKT_FLAG_1X(prPacket); - } - - if (fgIsPAL) { - GLUE_SET_PKT_FLAG_PAL(prPacket); - } - - ucMacHeaderLen = ETH_HLEN; - - /* Save the value of Header Length */ - GLUE_SET_PKT_HEADER_LEN(prPacket, ucMacHeaderLen); - - /* Save the value of Frame Length */ - GLUE_SET_PKT_FRAME_LEN(prPacket, (UINT_16)u4PacketLen); - - /* Save the value of Arrival Time*/ - u4SysTime = (OS_SYSTIME)kalGetTimeTick(); - GLUE_SET_PKT_ARRIVAL_TIME(prPacket, u4SysTime); - - prMsduInfo->prPacket = prPacket; - prMsduInfo->fgIs802_1x = fgIs1x; - prMsduInfo->fgIs802_11 = FALSE; - prMsduInfo->ucNetworkType = ucNetworkType; - prMsduInfo->ucUserPriority = ucPriorityParam; - prMsduInfo->ucMacHeaderLength = ucMacHeaderLen; - prMsduInfo->u2FrameLength = (UINT_16)u4PacketLen; - COPY_MAC_ADDR(prMsduInfo->aucEthDestAddr, aucEthDestAddr); - - return TRUE; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief this function update TCQ values by passing current status to txAdjustTcQuotas -* -* @param prAdapter Pointer to the Adapter structure. -* -* @retval WLAN_STATUS_SUCCESS Updated successfully -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicTxAdjustTcq ( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_32 u4Num; - TX_TCQ_ADJUST_T rTcqAdjust; - P_TX_CTRL_T prTxCtrl; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - - prTxCtrl = &prAdapter->rTxCtrl; - ASSERT(prTxCtrl); - - qmAdjustTcQuotas(prAdapter, &rTcqAdjust, &prTxCtrl->rTc); - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_RESOURCE); - - for (u4Num = 0 ; u4Num < TC_NUM ; u4Num++) { - prTxCtrl->rTc.aucFreeBufferCount[u4Num] += rTcqAdjust.acVariation[u4Num]; - prTxCtrl->rTc.aucMaxNumOfBuffer[u4Num] += rTcqAdjust.acVariation[u4Num]; - - ASSERT(prTxCtrl->rTc.aucFreeBufferCount[u4Num] >= 0); - ASSERT(prTxCtrl->rTc.aucMaxNumOfBuffer[u4Num] >= 0); - } - - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TX_RESOURCE); - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief this function flushes all packets queued in STA/AC queue -* -* @param prAdapter Pointer to the Adapter structure. -* -* @retval WLAN_STATUS_SUCCESS Flushed successfully -*/ -/*----------------------------------------------------------------------------*/ - -WLAN_STATUS -nicTxFlush ( - IN P_ADAPTER_T prAdapter - ) -{ - P_MSDU_INFO_T prMsduInfo; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - - // ask Per STA/AC queue to be fllushed and return all queued packets - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_QM_TX_QUEUE); - prMsduInfo = qmFlushTxQueues(prAdapter); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_QM_TX_QUEUE); - - if(prMsduInfo != NULL) { - nicTxFreeMsduInfoPacket(prAdapter, prMsduInfo); - nicTxReturnMsduInfo(prAdapter, prMsduInfo); - } - - return WLAN_STATUS_SUCCESS; -} - - -#if CFG_ENABLE_FW_DOWNLOAD -/*----------------------------------------------------------------------------*/ -/*! -* \brief In this function, we'll write Command(CMD_INFO_T) into HIF. -* However this function is used for INIT_CMD. -* -* In order to avoid further maintainance issues, these 2 functions are separated -* -* @param prAdapter Pointer to the Adapter structure. -* @param prPacketInfo Pointer of CMD_INFO_T -* @param ucTC Specify the resource of TC -* -* @retval WLAN_STATUS_SUCCESS Bus access ok. -* @retval WLAN_STATUS_FAILURE Bus access fail. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicTxInitCmd ( - IN P_ADAPTER_T prAdapter, - IN P_CMD_INFO_T prCmdInfo, - IN UINT_8 ucTC - ) -{ - P_INIT_HIF_TX_HEADER_T prInitTxHeader; - UINT_16 u2OverallBufferLength; - PUINT_8 pucOutputBuf = (PUINT_8)NULL; /* Pointer to Transmit Data Structure Frame */ - UINT_32 ucPortIdx; - P_TX_CTRL_T prTxCtrl; - - ASSERT(prAdapter); - ASSERT(prCmdInfo); - ASSERT(ucTC == TC0_INDEX); - - prTxCtrl = &prAdapter->rTxCtrl; - pucOutputBuf = prTxCtrl->pucTxCoalescingBufPtr; - prInitTxHeader = (P_INIT_HIF_TX_HEADER_T)prCmdInfo->pucInfoBuffer; - - // <1> Compose the Header of Transmit Data Structure for CMD Packet - u2OverallBufferLength = TFCB_FRAME_PAD_TO_DW( - (prCmdInfo->u2InfoBufLen) & (UINT_16)HIF_TX_HDR_TX_BYTE_COUNT_MASK); - - prInitTxHeader->u2TxByteCount = u2OverallBufferLength; - prInitTxHeader->ucEtherTypeOffset = 0; - prInitTxHeader->ucCSflags = 0; - - // <2> Assign Data Port - if (ucTC != TC4_INDEX) { - ucPortIdx = 0; - } - else { // Broadcast/multicast data packets - ucPortIdx = 1; - } - - // <3> Copy CMD Header to command buffer (by using pucCoalescingBufCached) - kalMemCopy((PVOID)&pucOutputBuf[0], - (PVOID)prCmdInfo->pucInfoBuffer, - prCmdInfo->u2InfoBufLen); - - ASSERT(u2OverallBufferLength <= prAdapter->u4CoalescingBufCachedSize); - - // <4> Write frame to data port - HAL_WRITE_TX_PORT(prAdapter, - ucPortIdx, - (UINT_32)u2OverallBufferLength, - (PUINT_8)pucOutputBuf, - (UINT_32)prAdapter->u4CoalescingBufCachedSize); - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief In this function, we'll reset TX resource counter to initial value used -* in F/W download state -* -* @param prAdapter Pointer to the Adapter structure. -* -* @retval WLAN_STATUS_SUCCESS Reset is done successfully. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicTxInitResetResource ( - IN P_ADAPTER_T prAdapter - ) -{ - P_TX_CTRL_T prTxCtrl; - - DEBUGFUNC("nicTxInitResetResource"); - - ASSERT(prAdapter); - prTxCtrl = &prAdapter->rTxCtrl; - - prTxCtrl->rTc.aucMaxNumOfBuffer[TC0_INDEX] = NIC_TX_INIT_BUFF_COUNT_TC0; - prTxCtrl->rTc.aucFreeBufferCount[TC0_INDEX] = NIC_TX_INIT_BUFF_COUNT_TC0; - - prTxCtrl->rTc.aucMaxNumOfBuffer[TC1_INDEX] = NIC_TX_INIT_BUFF_COUNT_TC1; - prTxCtrl->rTc.aucFreeBufferCount[TC1_INDEX] = NIC_TX_INIT_BUFF_COUNT_TC1; - - prTxCtrl->rTc.aucMaxNumOfBuffer[TC2_INDEX] = NIC_TX_INIT_BUFF_COUNT_TC2; - prTxCtrl->rTc.aucFreeBufferCount[TC2_INDEX] = NIC_TX_INIT_BUFF_COUNT_TC2; - - prTxCtrl->rTc.aucMaxNumOfBuffer[TC3_INDEX] = NIC_TX_INIT_BUFF_COUNT_TC3; - prTxCtrl->rTc.aucFreeBufferCount[TC3_INDEX] = NIC_TX_INIT_BUFF_COUNT_TC3; - - prTxCtrl->rTc.aucMaxNumOfBuffer[TC4_INDEX] = NIC_TX_INIT_BUFF_COUNT_TC4; - prTxCtrl->rTc.aucFreeBufferCount[TC4_INDEX] = NIC_TX_INIT_BUFF_COUNT_TC4; - - prTxCtrl->rTc.aucMaxNumOfBuffer[TC5_INDEX] = NIC_TX_INIT_BUFF_COUNT_TC5; - prTxCtrl->rTc.aucFreeBufferCount[TC5_INDEX] = NIC_TX_INIT_BUFF_COUNT_TC5; - - return WLAN_STATUS_SUCCESS; - -} - -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief this function enqueues MSDU_INFO_T into queue management, -* or command queue -* -* @param prAdapter Pointer to the Adapter structure. -* prMsduInfo Pointer to MSDU -* -* @retval WLAN_STATUS_SUCCESS Reset is done successfully. -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -nicTxEnqueueMsdu ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - P_TX_CTRL_T prTxCtrl; - P_MSDU_INFO_T prNextMsduInfo, prRetMsduInfo, prMsduInfoHead; - QUE_T qDataPort0, qDataPort1; - P_CMD_INFO_T prCmdInfo; - WLAN_STATUS u4Status = WLAN_STATUS_SUCCESS; - KAL_SPIN_LOCK_DECLARATION(); - - ASSERT(prAdapter); - ASSERT(prMsduInfo); - - prTxCtrl = &prAdapter->rTxCtrl; - ASSERT(prTxCtrl); - - QUEUE_INITIALIZE(&qDataPort0); - QUEUE_INITIALIZE(&qDataPort1); - - /* check how many management frame are being queued */ - while(prMsduInfo) { - prNextMsduInfo = (P_MSDU_INFO_T)QUEUE_GET_NEXT_ENTRY((P_QUE_ENTRY_T)prMsduInfo); - - QUEUE_GET_NEXT_ENTRY((P_QUE_ENTRY_T)prMsduInfo) = NULL; - - if(prMsduInfo->eSrc == TX_PACKET_MGMT) { - // MMPDU: force stick to TC4 - prMsduInfo->ucTC = TC4_INDEX; - - QUEUE_INSERT_TAIL(&qDataPort1, (P_QUE_ENTRY_T)prMsduInfo); - } - else { - QUEUE_INSERT_TAIL(&qDataPort0, (P_QUE_ENTRY_T)prMsduInfo); - } - - prMsduInfo = prNextMsduInfo; - } - - if(qDataPort0.u4NumElem) { - /* send to QM */ - KAL_SPIN_LOCK_DECLARATION(); - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_QM_TX_QUEUE); - prRetMsduInfo = qmEnqueueTxPackets(prAdapter, (P_MSDU_INFO_T)QUEUE_GET_HEAD(&qDataPort0)); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_QM_TX_QUEUE); - - /* post-process for dropped packets */ - if(prRetMsduInfo != NULL) { // unable to enqueue - nicTxFreeMsduInfoPacket(prAdapter, prRetMsduInfo); - nicTxReturnMsduInfo(prAdapter, prRetMsduInfo); - } - } - - if(qDataPort1.u4NumElem) { - prMsduInfoHead = (P_MSDU_INFO_T)QUEUE_GET_HEAD(&qDataPort1); - - if(qDataPort1.u4NumElem > nicTxGetFreeCmdCount(prAdapter)) { - // not enough descriptors for sending - u4Status = WLAN_STATUS_FAILURE; - - // free all MSDUs - while(prMsduInfoHead) { - prNextMsduInfo = (P_MSDU_INFO_T) QUEUE_GET_NEXT_ENTRY(&prMsduInfoHead->rQueEntry); - - if (prMsduInfoHead->pfTxDoneHandler != NULL) { - prMsduInfoHead->pfTxDoneHandler(prAdapter, prMsduInfoHead, TX_RESULT_DROPPED_IN_DRIVER); - } - - - cnmMgtPktFree(prAdapter, prMsduInfoHead); - - prMsduInfoHead = prNextMsduInfo; - } - } - else { - /* send to command queue */ - while(prMsduInfoHead) { - prNextMsduInfo = (P_MSDU_INFO_T) QUEUE_GET_NEXT_ENTRY(&prMsduInfoHead->rQueEntry); - - KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_RESOURCE); - QUEUE_REMOVE_HEAD(&prAdapter->rFreeCmdList, prCmdInfo, P_CMD_INFO_T); - KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_CMD_RESOURCE); - - if (prCmdInfo) { - GLUE_INC_REF_CNT(prTxCtrl->i4TxMgmtPendingNum); - - kalMemZero(prCmdInfo, sizeof(CMD_INFO_T)); - - prCmdInfo->eCmdType = COMMAND_TYPE_MANAGEMENT_FRAME; - prCmdInfo->u2InfoBufLen = prMsduInfoHead->u2FrameLength; - prCmdInfo->pucInfoBuffer = NULL; - prCmdInfo->prPacket = (P_NATIVE_PACKET)prMsduInfoHead; - prCmdInfo->ucStaRecIndex = prMsduInfoHead->ucStaRecIndex; - prCmdInfo->eNetworkType = prMsduInfoHead->ucNetworkType; - prCmdInfo->pfCmdDoneHandler = NULL; - prCmdInfo->pfCmdTimeoutHandler = NULL; - prCmdInfo->fgIsOid = FALSE; - prCmdInfo->fgSetQuery = TRUE; - prCmdInfo->fgNeedResp = FALSE; - - kalEnqueueCommand(prAdapter->prGlueInfo, (P_QUE_ENTRY_T)prCmdInfo); - } - else { - /* Cmd free count is larger than expected, but allocation fail. */ - ASSERT(0); - - u4Status = WLAN_STATUS_FAILURE; - cnmMgtPktFree(prAdapter, prMsduInfoHead); - } - - prMsduInfoHead = prNextMsduInfo; - } - } - } - - /* indicate service thread for sending */ - if(prTxCtrl->i4TxMgmtPendingNum > 0 - || kalGetTxPendingFrameCount(prAdapter->prGlueInfo) > 0) { - kalSetEvent(prAdapter->prGlueInfo); - } - - return u4Status; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief this function returns available count in command queue -* -* @param prAdapter Pointer to the Adapter structure. -* -* @retval -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -nicTxGetFreeCmdCount ( - IN P_ADAPTER_T prAdapter - ) -{ - ASSERT(prAdapter); - - return prAdapter->rFreeCmdList.u4NumElem; -} - diff --git a/drivers/net/wireless/mt5931/nic/p2p_nic.c b/drivers/net/wireless/mt5931/nic/p2p_nic.c deleted file mode 100755 index 592318b00454..000000000000 --- a/drivers/net/wireless/mt5931/nic/p2p_nic.c +++ /dev/null @@ -1,203 +0,0 @@ -/* -** $Id: @(#) p2p_nic.c@@ -*/ - -/*! \file p2p_nic.c - \brief Wi-Fi Direct Functions that provide operation in NIC's (Network Interface Card) point of view. - - This file includes functions which unite multiple hal(Hardware) operations - and also take the responsibility of Software Resource Management in order - to keep the synchronization with Hardware Manipulation. -*/ - - - - - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief When Probe Rsp & Beacon frame is received and decide a P2P device, -* this function will be invoked to buffer scan result -* -* @param prAdapter Pointer to the Adapter structure. -* @param prEventScanResult Pointer of EVENT_SCAN_RESULT_T. -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -nicRxAddP2pDevice ( - IN P_ADAPTER_T prAdapter, - IN P_EVENT_P2P_DEV_DISCOVER_RESULT_T prP2pResult, - IN PUINT_8 pucRxIEBuf, - IN UINT_16 u2RxIELength - ) -{ - P_P2P_INFO_T prP2pInfo = (P_P2P_INFO_T)NULL; - P_EVENT_P2P_DEV_DISCOVER_RESULT_T prTargetResult = (P_EVENT_P2P_DEV_DISCOVER_RESULT_T)NULL; - UINT_32 u4Idx = 0; - BOOLEAN bUpdate = FALSE; - - PUINT_8 pucIeBuf = (PUINT_8)NULL; - UINT_16 u2IELength = 0; - UINT_8 zeroMac[] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; - - ASSERT(prAdapter); - - prP2pInfo = prAdapter->prP2pInfo; - - for (u4Idx = 0; u4Idx < prP2pInfo->u4DeviceNum; u4Idx++) { - prTargetResult = &prP2pInfo->arP2pDiscoverResult[u4Idx]; - - if (EQUAL_MAC_ADDR(prTargetResult->aucDeviceAddr, prP2pResult->aucDeviceAddr)) { - bUpdate = TRUE; - - /* Backup OLD buffer result. */ - pucIeBuf = prTargetResult->pucIeBuf; - u2IELength = prTargetResult->u2IELength; - - /* Update Device Info. */ - // zero - kalMemZero(prTargetResult, sizeof(EVENT_P2P_DEV_DISCOVER_RESULT_T)); - - // then buffer - kalMemCopy(prTargetResult, - (PVOID)prP2pResult, - sizeof(EVENT_P2P_DEV_DISCOVER_RESULT_T)); - - /* See if new IE length is longer or not. */ - if ((u2RxIELength > u2IELength) && (u2IELength != 0)) { - /* Buffer is not enough. */ - u2RxIELength = u2IELength; - } - else if ((u2IELength == 0) && (u2RxIELength != 0)) { - /* RX new IE buf. */ - ASSERT(pucIeBuf == NULL); - pucIeBuf = prP2pInfo->pucCurrIePtr; - - if (((UINT_32)prP2pInfo->pucCurrIePtr + (UINT_32)u2RxIELength) > - (UINT_32)&prP2pInfo->aucCommIePool[CFG_MAX_COMMON_IE_BUF_LEN]) { - /* Common Buffer is no enough. */ - u2RxIELength = (UINT_16)((UINT_32)&prP2pInfo->aucCommIePool[CFG_MAX_COMMON_IE_BUF_LEN] - (UINT_32)prP2pInfo->pucCurrIePtr); - } - - /* Step to next buffer address. */ - prP2pInfo->pucCurrIePtr = (PUINT_8)((UINT_32)prP2pInfo->pucCurrIePtr + (UINT_32)u2RxIELength); - } - - /* Restore buffer pointer. */ - prTargetResult->pucIeBuf = pucIeBuf; - - if (pucRxIEBuf) { - /* If new received IE is availabe. - * Replace the old one & update new IE length. - */ - kalMemCopy(pucIeBuf, pucRxIEBuf, u2RxIELength); - prTargetResult->u2IELength = u2RxIELength; - } - else { - /* There is no new IE information, keep the old one. */ - prTargetResult->u2IELength = u2IELength; - } - } - } - - if (!bUpdate) { - /* We would flush the whole scan result after each scan request is issued. - * If P2P device is too many, it may over the scan list. - */ - if ((u4Idx < CFG_MAX_NUM_BSS_LIST) && (UNEQUAL_MAC_ADDR(zeroMac, prP2pResult->aucDeviceAddr))) { /* whsu:XXX */ - prTargetResult = &prP2pInfo->arP2pDiscoverResult[u4Idx]; - - // zero - kalMemZero(prTargetResult, sizeof(EVENT_P2P_DEV_DISCOVER_RESULT_T)); - - // then buffer - kalMemCopy(prTargetResult, - (PVOID)prP2pResult, - sizeof(EVENT_P2P_DEV_DISCOVER_RESULT_T)); - - //printk("DVC FND %d " MACSTR", " MACSTR "\n", prP2pInfo->u4DeviceNum, MAC2STR(prP2pResult->aucDeviceAddr), MAC2STR(prTargetResult->aucDeviceAddr)); - - if (u2RxIELength) { - prTargetResult->pucIeBuf = prP2pInfo->pucCurrIePtr; - - if (((UINT_32)prP2pInfo->pucCurrIePtr + (UINT_32)u2RxIELength) > - (UINT_32)&prP2pInfo->aucCommIePool[CFG_MAX_COMMON_IE_BUF_LEN]) { - /* Common Buffer is no enough. */ - u2IELength = (UINT_16)((UINT_32)&prP2pInfo->aucCommIePool[CFG_MAX_COMMON_IE_BUF_LEN] - (UINT_32)prP2pInfo->pucCurrIePtr); - } - else { - u2IELength = u2RxIELength; - } - - prP2pInfo->pucCurrIePtr = (PUINT_8)((UINT_32)prP2pInfo->pucCurrIePtr + (UINT_32)u2IELength); - - kalMemCopy((PVOID)prTargetResult->pucIeBuf, (PVOID)pucRxIEBuf, (UINT_32)u2IELength); - prTargetResult->u2IELength = u2IELength; - } - else { - prTargetResult->pucIeBuf = NULL; - prTargetResult->u2IELength = 0; - } - - prP2pInfo->u4DeviceNum++; - - } - else { - // TODO: Fixme to replace an old one. (?) - ASSERT(FALSE); - } - } -} /* nicRxAddP2pDevice */ - - - diff --git a/drivers/net/wireless/mt5931/nic/que_mgt.c b/drivers/net/wireless/mt5931/nic/que_mgt.c deleted file mode 100755 index 74ae5aba8126..000000000000 --- a/drivers/net/wireless/mt5931/nic/que_mgt.c +++ /dev/null @@ -1,4802 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/nic/que_mgt.c#1 $ -*/ - -/*! \file "que_mgt.c" - \brief TX/RX queues management - - The main tasks of queue management include TC-based HIF TX flow control, - adaptive TC quota adjustment, HIF TX grant scheduling, Power-Save - forwarding control, RX packet reordering, and RX BA agreement management. -*/ - - - -/* -** $Log: que_mgt.c $ - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 02 23 2012 eddie.chen - * [WCXRP00001194] [MT6620][DRV/FW] follow admission control bit to change the enqueue rule - * Change the enqueue policy when ACM = 1. - * - * 11 22 2011 yuche.tsai - * NULL - * Code refine, remove one #if 0 code. - * - * 11 19 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Add xlog for tx - * - * 11 18 2011 yuche.tsai - * NULL - * CONFIG P2P support RSSI query, default turned off. - * - * 11 18 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Fix xlog format to hex format - * - * 11 17 2011 tsaiyuan.hsu - * [WCXRP00001115] [MT6620 Wi-Fi][DRV] avoid deactivating staRec when changing state 3 to 3. - * avoid deactivating staRec when changing state from 3 to 3. - * - * 11 11 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * add debug msg for xlog. - * - * 11 11 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * add debug counters of bb and ar for xlog. - * - * 11 10 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Use short name for xlog. - * - * 11 10 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Modify the QM xlog level and remove LOG_FUNC. - * - * 11 10 2011 chinglan.wang - * NULL - * [WiFi WPS]Can't switch to new AP via WPS PBC when there existing a connection to another AP. - * - * 11 09 2011 chinglan.wang - * NULL - * [WiFi direct]Can't make P2P connect via PBC. - * - * 11 08 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Add xlog function. - * - * 11 07 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * add debug counters and periodically dump counters for debugging. - * - * 11 01 2011 chinglan.wang - * NULL - * Modify the Wi-Fi method of the flush TX queue when disconnect the AP. - * If disconnect the AP and flush all the data frame in the TX queue, WPS cannot do the 4-way handshake to connect to the AP.. - * - * 10 25 2011 wh.su - * [WCXRP00001059] [MT6620 Wi-Fi][Driver][P2P] Fixed sometimes data (1x) will not indicate to upper layer due ba check un-expect - * let the Rx BA accept even the sta not valid. - * - * 09 28 2011 tsaiyuan.hsu - * [WCXRP00000900] [MT5931 Wi-Fi] Improve balance of TX and RX - * enlarge window size only by 4. - * - * 09 01 2011 tsaiyuan.hsu - * [WCXRP00000900] [MT5931 Wi-Fi] Improve balance of TX and RX - * set rx window size as twice buffer size. - * - * 08 23 2011 yuche.tsai - * NULL - * Fix multicast address list issue. - * - * 08 03 2011 tsaiyuan.hsu - * [WCXRP00000900] [MT5931 Wi-Fi] Improve balance of TX and RX - * force window size at least 16. - * - * 08 02 2011 yuche.tsai - * [WCXRP00000896] [Volunteer Patch][WiFi Direct][Driver] GO with multiple client, TX deauth to a disconnecting device issue. - * Fix GO send deauth frame issue. - * - * 07 26 2011 eddie.chen - * [WCXRP00000874] [MT5931][DRV] API for query the RX reorder queued packets counter - * API for query the RX reorder queued packets counter. - * - * 07 07 2011 eddie.chen - * [WCXRP00000834] [MT6620 Wi-Fi][DRV] Send 1x packet when peer STA is in PS. - * Add setEvent when free quota is updated. - * - * 07 05 2011 eddie.chen - * [WCXRP00000834] [MT6620 Wi-Fi][DRV] Send 1x packet when peer STA is in PS. - * Send 1x when peer STA is in PS. - * - * 05 31 2011 eddie.chen - * [WCXRP00000753] [MT5931 Wi-Fi][DRV] Adjust QM for MT5931 - * Fix the QM quota in MT5931. - * - * 05 11 2011 eddie.chen - * [WCXRP00000709] [MT6620 Wi-Fi][Driver] Check free number before copying broadcast packet - * Fix dest type when GO packet copying. - * - * 05 09 2011 yuche.tsai - * [WCXRP00000712] [Volunteer Patch][MT6620][Driver] Sending deauth issue when Hot spot is disabled. (GO is dissolved) - * Deauthentication frame is not bound to network active status. - * - * 05 09 2011 eddie.chen - * [WCXRP00000709] [MT6620 Wi-Fi][Driver] Check free number before copying broadcast packet - * Check free number before copying broadcast packet. - * - * 04 14 2011 eddie.chen - * [WCXRP00000603] [MT6620 Wi-Fi][DRV] Fix Klocwork warning - * Check the SW RFB free. Fix the compile warning.. - * - * 04 12 2011 eddie.chen - * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma - * Fix the sta index in processing security frame - * Simple flow control for TC4 to avoid mgt frames for PS STA to occupy the TC4 - * Add debug message. - * - * 04 11 2011 yuche.tsai - * [WCXRP00000627] [Volunteer Patch][MT6620][Driver] Pending MMPUD of P2P Network may crash system issue. - * Fix kernel panic issue when MMPDU of P2P is pending in driver. - * - * 04 08 2011 eddie.chen - * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma - * Fix for sigma - * - * 03 28 2011 eddie.chen - * [WCXRP00000603] [MT6620 Wi-Fi][DRV] Fix Klocwork warning - * Fix Klockwork warning. - * - * 03 28 2011 eddie.chen - * [WCXRP00000602] [MT6620 Wi-Fi][DRV] Fix wmm parameters in beacon for BOW - * Fix wmm parameters in beacon for BOW. - * - * 03 15 2011 eddie.chen - * [WCXRP00000554] [MT6620 Wi-Fi][DRV] Add sw control debug counter - * Add sw debug counter for QM. - * - * 02 23 2011 eddie.chen - * [WCXRP00000463] [MT6620 Wi-Fi][FW/Driver][Hotspot] Cannot update WMM PS STA's partital bitmap - * Fix parsing WMM INFO and bmp delivery bitmap definition. - * - * 02 17 2011 eddie.chen - * [WCXRP00000458] [MT6620 Wi-Fi][Driver] BOW Concurrent - ProbeResp was exist in other channel - * 1) Chnage GetFrameAction decision when BSS is absent. - * 2) Check channel and resource in processing ProbeRequest - * - * 02 08 2011 eddie.chen - * [WCXRP00000426] [MT6620 Wi-Fi][FW/Driver] Add STA aging timeout and defualtHwRatein AP mode - * Add event STA agint timeout - * - * 01 27 2011 tsaiyuan.hsu - * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support - * add roaming fsm - * 1. not support 11r, only use strength of signal to determine roaming. - * 2. not enable CFG_SUPPORT_ROAMING until completion of full test. - * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw - * 4. assume that change of link quality in smooth way. - * - * 01 25 2011 yuche.tsai - * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record. - * Change Station Type in Station Record, Modify MACRO definition for getting station type & network type index & Role. - * - * 01 24 2011 eddie.chen - * [WCXRP00000385] [MT6620 Wi-Fi][DRV] Add destination decision for forwarding packets - * Remove comments. - * - * 01 24 2011 eddie.chen - * [WCXRP00000385] [MT6620 Wi-Fi][DRV] Add destination decision for forwarding packets - * Add destination decision in AP mode. - * - * 01 14 2011 wh.su - * [WCXRP00000099] [MT6620 Wi-Fi] [Driver] workaround to let the de-authentication can be send out[WCXRP00000326] [MT6620][Wi-Fi][Driver] check in the binary format gl_sec.o.new instead of use change type!!! - * Allow 802.1x can be send even the net is not active due the drver / fw sync issue. - * - * 01 13 2011 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, -Add per station flow control when STA is in PS - * Fix typo and compile error. - * - * 01 12 2011 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, -Add per station flow control when STA is in PS - * Fix WMM parameter condition for STA - * - * 01 12 2011 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, -Add per station flow control when STA is in PS - * 1) Check Bss if support QoS before adding WMMIE - * 2) Check if support prAdapter->rWifiVar QoS and uapsd in flow control - * - * 01 12 2011 george.huang - * [WCXRP00000355] [MT6620 Wi-Fi] Set WMM-PS related setting with qualifying AP capability - * Update MQM for WMM IE generation method - * - * 01 11 2011 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, -Add per station flow control when STA is in PS - - * Add per STA flow control when STA is in PS mode - * - * 01 03 2011 george.huang - * [WCXRP00000152] [MT6620 Wi-Fi] AP mode power saving function - * update prStaRec->fgIsUapsdSupported flag. - * - * 12 29 2010 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, -Add per station flow control when STA is in PS - - * Add WMM parameter for broadcast. - * - * 12 29 2010 eddie.chen - * [WCXRP00000322] Add WMM IE in beacon, -Add per station flow control when STA is in PS - - * 1) PS flow control event - * - * 2) WMM IE in beacon, assoc resp, probe resp - * - * 12 23 2010 george.huang - * [WCXRP00000152] [MT6620 Wi-Fi] AP mode power saving function - * 1. update WMM IE parsing, with ASSOC REQ handling - * 2. extend U-APSD parameter passing from driver to FW - * - * 10 14 2010 wh.su - * [WCXRP00000099] [MT6620 Wi-Fi] [Driver] workaround to let the de-authentication can be send out - * use the #14 and modify the add code for check MMPDU. - * - * 10 14 2010 wh.su - * [WCXRP00000099] [MT6620 Wi-Fi] [Driver] workaround to let the de-authentication can be send out - * only MMPDU not check the netActive flag. - * - * 10 14 2010 wh.su - * [WCXRP00000099] [MT6620 Wi-Fi] [Driver] workaround to let the de-authentication can be send out - * not check the netActive flag for mgmt . - * - * 10 04 2010 cp.wu - * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only - * remove ENUM_NETWORK_TYPE_T definitions - * - * 09 21 2010 kevin.huang - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * Eliminate Linux Compile Warning - * - * 08 30 2010 yarco.yang - * NULL - * Fixed klockwork error message - * - * 08 18 2010 yarco.yang - * NULL - * 1. Fixed HW checksum offload function not work under Linux issue. - * 2. Add debug message. - * - * 08 10 2010 yarco.yang - * NULL - * Code refine - * - * 08 06 2010 yarco.yang - * NULL - * Update qmGetFrameAction() to allow P2P MGMT frame w/o STA_Record still can perform TX action - * - * 07 26 2010 cp.wu - * - * AIS-FSM FIX: return channel privilege even when the privilege is not granted yet - * QM: qmGetFrameAction() won't assert when corresponding STA-REC index is not found - * - * 07 20 2010 yarco.yang - * - * Add to SetEvent when BSS is from Absent to Present or STA from PS to Awake - * - * 07 16 2010 yarco.yang - * - * 1. Support BSS Absence/Presence Event - * 2. Support STA change PS mode Event - * 3. Support BMC forwarding for AP mode. - * - * 07 14 2010 yarco.yang - * - * 1. Remove CFG_MQM_MIGRATION - * 2. Add CMD_UPDATE_WMM_PARMS command - * - * 07 13 2010 yarco.yang - * - * [WPD00003849] - * [MT6620 and MT5931] SW Migration, add qmGetFrameAction() API for CMD Queue Processing - * - * 07 09 2010 yarco.yang - * - * [MT6620 and MT5931] SW Migration: Add ADDBA support - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 07 08 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * . - * - * 07 06 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Use fgInUse instead of fgIsValid for De-queue judgement - * - * 07 06 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * For MMPDU, STA_REC will be decided by caller module - * - * 07 06 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Add MGMT Packet type for HIF_TX_HEADER - * - * 06 29 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * replace g_rQM with Adpater->rQM - * - * 06 25 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * add API in que_mgt to retrieve sta-rec index for security frames. - * - * 06 23 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Merge g_arStaRec[] into adapter->arStaRec[] - * - * 06 21 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Support CFG_MQM_MIGRATION flag - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 03 31 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Refined the debug msg - * - * 03 30 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * comment out one assertion which refer to undefined data member. - * - * 03 30 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Enabled adaptive TC resource control - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port - * -* 03 17 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Changed STA_REC index determination rules (DA=BMCAST always --> STA_REC_INDEX_BMCAST) - * - * 03 11 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Fixed buffer leak when processing BAR frames - * - * 03 02 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * For TX packets with STA_REC index = STA_REC_INDEX_NOT_FOUND, use TC5 - * - * 03 01 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Fixed STA_REC index determination bug (fgIsValid shall be checked) - * - * 02 25 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Refined function qmDetermineStaRecIndex() for BMCAST packets - * - * 02 25 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Enabled multi-STA TX path with fairness - * - * 02 24 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Enabled dynamically activating and deactivating STA_RECs - * - * 02 24 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Added code for dynamic activating and deactivating STA_RECs. - * - * 01 13 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Enabled the 802.1x path - * - * 01 13 2010 tehuang.liu - * [WPD00001943]Create WiFi test driver framework on WinXP - * Enabled the Burst_End Indication mechanism -** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-12-14 15:01:37 GMT MTK02468 -** Fixed casting for qmAddRxBaEntry() -** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-12-10 16:51:03 GMT mtk02752 -** remove SD1_SD3.. flag -** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-12-09 14:07:25 GMT MTK02468 -** Added RX buffer reordering functions -** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-12-04 13:34:16 GMT MTK02468 -** Modified Flush Queue function to let queues be reinitialized -** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-12-04 13:18:25 GMT MTK02468 -** Added flushing per-Type queues code -** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-12-02 23:39:49 GMT MTK02468 -** Added Debug msgs and fixed incorrect assert -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-11-26 23:50:27 GMT MTK02468 -** Bug fixing (qmDequeueTxPackets local variable initialization) -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-11-26 09:39:25 GMT mtk02752 -** correct and surpress PREfast warning -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-11-23 22:10:55 GMT mtk02468 -** Used SD1_SD3_DATAPATH_INTEGRATION -** \main\maintrunk.MT6620WiFiDriver_Prj\1 2009-11-23 22:02:30 GMT mtk02468 -** Initial version -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ -OS_SYSTIME g_arMissTimeout[CFG_STA_REC_NUM][CFG_RX_MAX_BA_TID_NUM]; -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -__KAL_INLINE__ VOID -qmDetermineStaRecIndex( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ); - -__KAL_INLINE__ VOID -qmDequeueTxPacketsFromPerStaQueues( - IN P_ADAPTER_T prAdapter, - OUT P_QUE_T prQue, - IN UINT_8 ucTC, - IN UINT_8 ucCurrentAvailableQuota, - IN UINT_8 ucTotalQuota - ); - -__KAL_INLINE__ VOID -qmDequeueTxPacketsFromPerTypeQueues( - IN P_ADAPTER_T prAdapter, - OUT P_QUE_T prQue, - IN UINT_8 ucTC, - IN UINT_8 ucMaxNum - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Init Queue Managment for TX -* -* \param[in] (none) -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -qmInit( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_32 u4QueArrayIdx; - UINT_32 i; - - P_QUE_MGT_T prQM = &prAdapter->rQM; - - //DbgPrint("QM: Enter qmInit()\n"); -#if CFG_SUPPORT_QOS - prAdapter->rWifiVar.fgSupportQoS = TRUE; -#else - prAdapter->rWifiVar.fgSupportQoS = FALSE; -#endif - -#if CFG_SUPPORT_AMPDU_RX - prAdapter->rWifiVar.fgSupportAmpduRx = TRUE; -#else - prAdapter->rWifiVar.fgSupportAmpduRx = FALSE; -#endif - -#if CFG_SUPPORT_AMPDU_TX - prAdapter->rWifiVar.fgSupportAmpduTx = TRUE; -#else - prAdapter->rWifiVar.fgSupportAmpduTx = FALSE; -#endif - -#if CFG_SUPPORT_TSPEC - prAdapter->rWifiVar.fgSupportTspec = TRUE; -#else - prAdapter->rWifiVar.fgSupportTspec = FALSE; -#endif - -#if CFG_SUPPORT_UAPSD - prAdapter->rWifiVar.fgSupportUAPSD= TRUE; -#else - prAdapter->rWifiVar.fgSupportUAPSD = FALSE; -#endif - -#if CFG_SUPPORT_UL_PSMP - prAdapter->rWifiVar.fgSupportULPSMP = TRUE; -#else - prAdapter->rWifiVar.fgSupportULPSMP = FALSE; -#endif - - //4 <2> Initialize other TX queues (queues not in STA_RECs) - for(u4QueArrayIdx = 0; u4QueArrayIdx < NUM_OF_PER_TYPE_TX_QUEUES; u4QueArrayIdx++){ - QUEUE_INITIALIZE(&(prQM->arTxQueue[u4QueArrayIdx])); - } - - //4 <3> Initialize the RX BA table and RX queues - /* Initialize the RX Reordering Parameters and Queues */ - for(u4QueArrayIdx = 0; u4QueArrayIdx < CFG_NUM_OF_RX_BA_AGREEMENTS; u4QueArrayIdx++){ - prQM->arRxBaTable[u4QueArrayIdx].fgIsValid = FALSE; - QUEUE_INITIALIZE(&(prQM->arRxBaTable[u4QueArrayIdx].rReOrderQue)); - prQM->arRxBaTable[u4QueArrayIdx].u2WinStart = 0xFFFF; - prQM->arRxBaTable[u4QueArrayIdx].u2WinEnd = 0xFFFF; - - prQM->arRxBaTable[u4QueArrayIdx].fgIsWaitingForPktWithSsn = FALSE; - - } - prQM->ucRxBaCount = 0; - kalMemSet(&g_arMissTimeout, 0, sizeof(g_arMissTimeout)); - -#if QM_ADAPTIVE_TC_RESOURCE_CTRL - //4 <4> Initialize TC resource control variables - for(i = 0; i < TC_NUM; i++){ - prQM->au4AverageQueLen[i] = 0; - } - prQM->u4TimeToAdjustTcResource = QM_INIT_TIME_TO_ADJUST_TC_RSC; - prQM->u4TimeToUpdateQueLen = QM_INIT_TIME_TO_UPDATE_QUE_LEN; - -// ASSERT(prQM->u4TimeToAdjust && prQM->u4TimeToUpdateQueLen); - - prQM->au4CurrentTcResource[TC0_INDEX] = NIC_TX_BUFF_COUNT_TC0; - prQM->au4CurrentTcResource[TC1_INDEX] = NIC_TX_BUFF_COUNT_TC1; - prQM->au4CurrentTcResource[TC2_INDEX] = NIC_TX_BUFF_COUNT_TC2; - prQM->au4CurrentTcResource[TC3_INDEX] = NIC_TX_BUFF_COUNT_TC3; - prQM->au4CurrentTcResource[TC4_INDEX] = NIC_TX_BUFF_COUNT_TC4; /* Not adjustable (TX port 1)*/ - prQM->au4CurrentTcResource[TC5_INDEX] = NIC_TX_BUFF_COUNT_TC5; - - prQM->au4MinReservedTcResource[TC0_INDEX] = QM_MIN_RESERVED_TC0_RESOURCE; - prQM->au4MinReservedTcResource[TC1_INDEX] = QM_MIN_RESERVED_TC1_RESOURCE; - prQM->au4MinReservedTcResource[TC2_INDEX] = QM_MIN_RESERVED_TC2_RESOURCE; - prQM->au4MinReservedTcResource[TC3_INDEX] = QM_MIN_RESERVED_TC3_RESOURCE; - prQM->au4MinReservedTcResource[TC4_INDEX] = QM_MIN_RESERVED_TC4_RESOURCE; /* Not adjustable (TX port 1)*/ - prQM->au4MinReservedTcResource[TC5_INDEX] = QM_MIN_RESERVED_TC5_RESOURCE; - - - prQM->au4GuaranteedTcResource[TC0_INDEX] = QM_GUARANTEED_TC0_RESOURCE; - prQM->au4GuaranteedTcResource[TC1_INDEX] = QM_GUARANTEED_TC1_RESOURCE; - prQM->au4GuaranteedTcResource[TC2_INDEX] = QM_GUARANTEED_TC2_RESOURCE; - prQM->au4GuaranteedTcResource[TC3_INDEX] = QM_GUARANTEED_TC3_RESOURCE; - prQM->au4GuaranteedTcResource[TC4_INDEX] = QM_GUARANTEED_TC4_RESOURCE; - prQM->au4GuaranteedTcResource[TC5_INDEX] = QM_GUARANTEED_TC5_RESOURCE; - - prQM->fgTcResourcePostAnnealing = FALSE; - - ASSERT(QM_INITIAL_RESIDUAL_TC_RESOURCE < 64); -#endif - -#if QM_TEST_MODE - prQM->u4PktCount = 0; - -#if QM_TEST_FAIR_FORWARDING - - prQM->u4CurrentStaRecIndexToEnqueue = 0; - { - UINT_8 aucMacAddr[MAC_ADDR_LEN]; - P_STA_RECORD_T prStaRec; - - /* Irrelevant in case this STA is an AIS AP (see qmDetermineStaRecIndex()) */ - aucMacAddr[0] = 0x11; - aucMacAddr[1] = 0x22; - aucMacAddr[2] = 0xAA; - aucMacAddr[3] = 0xBB; - aucMacAddr[4] = 0xCC; - aucMacAddr[5] = 0xDD; - - prStaRec = &prAdapter->arStaRec[1]; - ASSERT(prStaRec); - - prStaRec->fgIsValid = TRUE; - prStaRec->fgIsQoS = TRUE; - prStaRec->fgIsInPS = FALSE; - prStaRec->ucPsSessionID = 0xFF; - prStaRec->ucNetTypeIndex = NETWORK_TYPE_AIS_INDEX; - prStaRec->fgIsAp = TRUE; - COPY_MAC_ADDR((prStaRec)->aucMacAddr,aucMacAddr); - - } - -#endif - -#endif - -#if QM_FORWARDING_FAIRNESS -{ - UINT_32 i; - for (i=0; i < NUM_OF_PER_STA_TX_QUEUES; i++){ - prQM->au4ForwardCount[i] = 0; - prQM->au4HeadStaRecIndex[i] = 0; - } -} -#endif - -} - -#if QM_TEST_MODE -VOID -qmTestCases( - IN P_ADAPTER_T prAdapter - ) -{ - P_QUE_MGT_T prQM = &prAdapter->rQM; - - DbgPrint("QM: ** TEST MODE **\n"); - - if(QM_TEST_STA_REC_DETERMINATION){ - if(prAdapter->arStaRec[0].fgIsValid){ - prAdapter->arStaRec[0].fgIsValid = FALSE; - DbgPrint("QM: (Test) Deactivate STA_REC[0]\n"); - } - else{ - prAdapter->arStaRec[0].fgIsValid = TRUE; - DbgPrint("QM: (Test) Activate STA_REC[0]\n"); - } - } - - if(QM_TEST_STA_REC_DEACTIVATION){ - /* Note that QM_STA_REC_HARD_CODING shall be set to 1 for this test */ - - if(prAdapter->arStaRec[0].fgIsValid){ - - DbgPrint("QM: (Test) Deactivate STA_REC[0]\n"); - qmDeactivateStaRec(prAdapter,0); - } - else{ - - UINT_8 aucMacAddr[MAC_ADDR_LEN]; - - /* Irrelevant in case this STA is an AIS AP (see qmDetermineStaRecIndex()) */ - aucMacAddr[0] = 0x11; - aucMacAddr[1] = 0x22; - aucMacAddr[2] = 0xAA; - aucMacAddr[3] = 0xBB; - aucMacAddr[4] = 0xCC; - aucMacAddr[5] = 0xDD; - - DbgPrint("QM: (Test) Activate STA_REC[0]\n"); - qmActivateStaRec( - prAdapter, /* Adapter pointer */ - 0, /* STA_REC index from FW */ - TRUE, /* fgIsQoS */ - NETWORK_TYPE_AIS_INDEX, /* Network type */ - TRUE, /* fgIsAp */ - aucMacAddr /* MAC address */ - ); - } - } - - if(QM_TEST_FAIR_FORWARDING){ - if(prAdapter->arStaRec[1].fgIsValid){ - prQM->u4CurrentStaRecIndexToEnqueue ++; - prQM->u4CurrentStaRecIndexToEnqueue %= 2; - DbgPrint("QM: (Test) Switch to STA_REC[%ld]\n", prQM->u4CurrentStaRecIndexToEnqueue); - } - } - -} -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Activate a STA_REC -* -* \param[in] prAdapter Pointer to the Adapter instance -* \param[in] u4StaRecIdx The index of the STA_REC -* \param[in] fgIsQoS Set to TRUE if this is a QoS STA -* \param[in] pucMacAddr The MAC address of the STA -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -qmActivateStaRec( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec - ) -{ - - //4 <1> Deactivate first - ASSERT(prStaRec); - - if(prStaRec->fgIsValid){ /* The STA_REC has been activated */ - DBGLOG(QM, WARN, ("QM: (WARNING) Activating a STA_REC which has been activated \n")); - DBGLOG(QM, WARN, ("QM: (WARNING) Deactivating a STA_REC before re-activating \n")); - qmDeactivateStaRec(prAdapter, prStaRec->ucIndex); // To flush TX/RX queues and del RX BA agreements - } - - //4 <2> Activate the STA_REC - /* Init the STA_REC */ - prStaRec->fgIsValid = TRUE; - prStaRec->fgIsInPS = FALSE; - prStaRec->ucPsSessionID = 0xFF; - prStaRec->fgIsAp = (IS_AP_STA(prStaRec)) ? TRUE : FALSE;; - - /* Done in qmInit() or qmDeactivateStaRec() */ -#if 0 - /* At the beginning, no RX BA agreements have been established */ - for(i =0; iaprRxReorderParamRefTbl)[i] = NULL; - } -#endif - - DBGLOG(QM, INFO, ("QM: +STA[%ld]\n", prStaRec->ucIndex)); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Deactivate a STA_REC -* -* \param[in] prAdapter Pointer to the Adapter instance -* \param[in] u4StaRecIdx The index of the STA_REC -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -qmDeactivateStaRec( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4StaRecIdx - ) -{ - P_STA_RECORD_T prStaRec; - UINT_32 i; - P_MSDU_INFO_T prFlushedTxPacketList = NULL; - - ASSERT(u4StaRecIdx < CFG_NUM_OF_STA_RECORD); - - prStaRec = &prAdapter->arStaRec[u4StaRecIdx]; - ASSERT(prStaRec); - - //4<1> Flush TX queues - prFlushedTxPacketList = qmFlushStaTxQueues(prAdapter, u4StaRecIdx); - - if(prFlushedTxPacketList){ - wlanProcessQueuedMsduInfo(prAdapter, prFlushedTxPacketList); - } - - //4 <2> Flush RX queues and delete RX BA agreements - for(i =0; i < CFG_RX_MAX_BA_TID_NUM; i++){ - /* Delete the RX BA entry with TID = i */ - qmDelRxBaEntry(prAdapter, (UINT_8)u4StaRecIdx, (UINT_8)i, FALSE); - } - - //4 <3> Deactivate the STA_REC - prStaRec->fgIsValid = FALSE; - prStaRec->fgIsInPS = FALSE; - - DBGLOG(QM, INFO, ("QM: -STA[%ld]\n", u4StaRecIdx)); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Deactivate a STA_REC -* -* \param[in] prAdapter Pointer to the Adapter instance -* \param[in] u4StaRecIdx The index of the network -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ - -VOID -qmFreeAllByNetType( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ) -{ - - P_QUE_MGT_T prQM; - P_QUE_T prQue; - QUE_T rNeedToFreeQue; - QUE_T rTempQue; - P_QUE_T prNeedToFreeQue; - P_QUE_T prTempQue; - P_MSDU_INFO_T prMsduInfo; - - - prQM = &prAdapter->rQM; - prQue = &prQM->arTxQueue[TX_QUEUE_INDEX_BMCAST]; - - QUEUE_INITIALIZE(&rNeedToFreeQue); - QUEUE_INITIALIZE(&rTempQue); - - prNeedToFreeQue = &rNeedToFreeQue; - prTempQue = &rTempQue; - - QUEUE_MOVE_ALL(prTempQue, prQue); - - QUEUE_REMOVE_HEAD(prTempQue, prMsduInfo, P_MSDU_INFO_T); - while (prMsduInfo) { - - if(prMsduInfo->ucNetworkType == eNetworkTypeIdx) { - QUEUE_INSERT_TAIL(prNeedToFreeQue, (P_QUE_ENTRY_T)prMsduInfo); - } - else { - QUEUE_INSERT_TAIL(prQue, (P_QUE_ENTRY_T)prMsduInfo); - } - - QUEUE_REMOVE_HEAD(prTempQue, prMsduInfo, P_MSDU_INFO_T); - } - if(QUEUE_IS_NOT_EMPTY(prNeedToFreeQue)) { - wlanProcessQueuedMsduInfo(prAdapter, (P_MSDU_INFO_T)QUEUE_GET_HEAD(prNeedToFreeQue)); - } - -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Flush all TX queues -* -* \param[in] (none) -* -* \return The flushed packets (in a list of MSDU_INFOs) -*/ -/*----------------------------------------------------------------------------*/ -P_MSDU_INFO_T -qmFlushTxQueues( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_8 ucStaArrayIdx; - UINT_8 ucQueArrayIdx; - - P_MSDU_INFO_T prMsduInfoListHead; - P_MSDU_INFO_T prMsduInfoListTail; - - P_QUE_MGT_T prQM = &prAdapter->rQM; - - DBGLOG(QM, TRACE, ("QM: Enter qmFlushTxQueues()\n")); - - prMsduInfoListHead = NULL; - prMsduInfoListTail = NULL; - - /* Concatenate all MSDU_INFOs in per-STA queues */ - for(ucStaArrayIdx = 0; ucStaArrayIdx < CFG_NUM_OF_STA_RECORD; ucStaArrayIdx++){ - - /* Always check each STA_REC when flushing packets no matter it is inactive or active */ - #if 0 - if(!prAdapter->arStaRec[ucStaArrayIdx].fgIsValid){ - continue; /* Continue to check the next STA_REC */ - } - #endif - - for(ucQueArrayIdx = 0; ucQueArrayIdx < NUM_OF_PER_STA_TX_QUEUES; ucQueArrayIdx++){ - if(QUEUE_IS_EMPTY(&(prAdapter->arStaRec[ucStaArrayIdx].arTxQueue[ucQueArrayIdx]))){ - continue; /* Continue to check the next TX queue of the same STA */ - } - - if(!prMsduInfoListHead){ - - /* The first MSDU_INFO is found */ - prMsduInfoListHead =(P_MSDU_INFO_T) - QUEUE_GET_HEAD(&prAdapter->arStaRec[ucStaArrayIdx].arTxQueue[ucQueArrayIdx]); - prMsduInfoListTail =(P_MSDU_INFO_T) - QUEUE_GET_TAIL(&prAdapter->arStaRec[ucStaArrayIdx].arTxQueue[ucQueArrayIdx]); - } - else{ - /* Concatenate the MSDU_INFO list with the existing list */ - QM_TX_SET_NEXT_MSDU_INFO(prMsduInfoListTail, - QUEUE_GET_HEAD(&prAdapter->arStaRec[ucStaArrayIdx].arTxQueue[ucQueArrayIdx])); - - prMsduInfoListTail = (P_MSDU_INFO_T) - QUEUE_GET_TAIL(&prAdapter->arStaRec[ucStaArrayIdx].arTxQueue[ucQueArrayIdx]); - } - - QUEUE_INITIALIZE(&prAdapter->arStaRec[ucStaArrayIdx].arTxQueue[ucQueArrayIdx]); - } - } - - /* Flush per-Type queues */ - for(ucQueArrayIdx = 0; ucQueArrayIdx < NUM_OF_PER_TYPE_TX_QUEUES; ucQueArrayIdx++){ - - if(QUEUE_IS_EMPTY(&(prQM->arTxQueue[ucQueArrayIdx]))){ - continue; /* Continue to check the next TX queue of the same STA */ - } - - if(!prMsduInfoListHead){ - - /* The first MSDU_INFO is found */ - prMsduInfoListHead =(P_MSDU_INFO_T) - QUEUE_GET_HEAD(&prQM->arTxQueue[ucQueArrayIdx]); - prMsduInfoListTail =(P_MSDU_INFO_T) - QUEUE_GET_TAIL(&prQM->arTxQueue[ucQueArrayIdx]); - } - else{ - /* Concatenate the MSDU_INFO list with the existing list */ - QM_TX_SET_NEXT_MSDU_INFO(prMsduInfoListTail, - QUEUE_GET_HEAD(&prQM->arTxQueue[ucQueArrayIdx])); - - prMsduInfoListTail = (P_MSDU_INFO_T) - QUEUE_GET_TAIL(&prQM->arTxQueue[ucQueArrayIdx]); - } - - QUEUE_INITIALIZE(&prQM->arTxQueue[ucQueArrayIdx]); - - } - - if(prMsduInfoListTail){ - /* Terminate the MSDU_INFO list with a NULL pointer */ - QM_TX_SET_NEXT_MSDU_INFO(prMsduInfoListTail, NULL); - } - - return prMsduInfoListHead; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Flush TX packets for a particular STA -* -* \param[in] u4StaRecIdx STA_REC index -* -* \return The flushed packets (in a list of MSDU_INFOs) -*/ -/*----------------------------------------------------------------------------*/ -P_MSDU_INFO_T -qmFlushStaTxQueues( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4StaRecIdx - ) -{ - UINT_8 ucQueArrayIdx; - P_MSDU_INFO_T prMsduInfoListHead; - P_MSDU_INFO_T prMsduInfoListTail; - P_STA_RECORD_T prStaRec; - - DBGLOG(QM, TRACE, ("QM: Enter qmFlushStaTxQueues(%ld)\n", u4StaRecIdx)); - - ASSERT(u4StaRecIdx < CFG_NUM_OF_STA_RECORD); - - prMsduInfoListHead = NULL; - prMsduInfoListTail = NULL; - - prStaRec = &prAdapter->arStaRec[u4StaRecIdx]; - ASSERT(prStaRec); - - /* No matter whether this is an activated STA_REC, do flush */ -#if 0 - if(!prStaRec->fgIsValid){ - return NULL; - } -#endif - - /* Concatenate all MSDU_INFOs in TX queues of this STA_REC */ - for(ucQueArrayIdx = 0; ucQueArrayIdx < NUM_OF_PER_STA_TX_QUEUES; ucQueArrayIdx++){ - if(QUEUE_IS_EMPTY(&(prStaRec->arTxQueue[ucQueArrayIdx]))){ - continue; - } - - if(!prMsduInfoListHead){ - /* The first MSDU_INFO is found */ - prMsduInfoListHead =(P_MSDU_INFO_T) - QUEUE_GET_HEAD(&prStaRec->arTxQueue[ucQueArrayIdx]); - prMsduInfoListTail =(P_MSDU_INFO_T) - QUEUE_GET_TAIL(&prStaRec->arTxQueue[ucQueArrayIdx]); } - else{ - /* Concatenate the MSDU_INFO list with the existing list */ - QM_TX_SET_NEXT_MSDU_INFO(prMsduInfoListTail, - QUEUE_GET_HEAD(&prStaRec->arTxQueue[ucQueArrayIdx])); - - prMsduInfoListTail = - (P_MSDU_INFO_T)QUEUE_GET_TAIL(&prStaRec->arTxQueue[ucQueArrayIdx]); - } - - QUEUE_INITIALIZE(&prStaRec->arTxQueue[ucQueArrayIdx]); - - } - -#if 0 - if(prMsduInfoListTail){ - /* Terminate the MSDU_INFO list with a NULL pointer */ - QM_TX_SET_NEXT_MSDU_INFO(prMsduInfoListTail, nicGetPendingStaMMPDU(prAdapter, (UINT_8)u4StaRecIdx)); - } - else { - prMsduInfoListHead = nicGetPendingStaMMPDU(prAdapter, (UINT_8)u4StaRecIdx); - } -#endif - - return prMsduInfoListHead; - -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Flush RX packets -* -* \param[in] (none) -* -* \return The flushed packets (in a list of SW_RFBs) -*/ -/*----------------------------------------------------------------------------*/ -P_SW_RFB_T -qmFlushRxQueues( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_32 i; - P_SW_RFB_T prSwRfbListHead; - P_SW_RFB_T prSwRfbListTail; - P_QUE_MGT_T prQM = &prAdapter->rQM; - - prSwRfbListHead = prSwRfbListTail = NULL; - - DBGLOG(QM, TRACE, ("QM: Enter qmFlushRxQueues()\n")); - - for(i =0; iarRxBaTable[i].rReOrderQue))){ - if(!prSwRfbListHead){ - - /* The first MSDU_INFO is found */ - prSwRfbListHead =(P_SW_RFB_T) - QUEUE_GET_HEAD(&(prQM->arRxBaTable[i].rReOrderQue)); - prSwRfbListTail =(P_SW_RFB_T) - QUEUE_GET_TAIL(&(prQM->arRxBaTable[i].rReOrderQue)); - } - else{ - /* Concatenate the MSDU_INFO list with the existing list */ - QM_TX_SET_NEXT_MSDU_INFO(prSwRfbListTail, - QUEUE_GET_HEAD(&(prQM->arRxBaTable[i].rReOrderQue))); - - prSwRfbListTail = (P_SW_RFB_T) - QUEUE_GET_TAIL(&(prQM->arRxBaTable[i].rReOrderQue)); - } - - QUEUE_INITIALIZE(&(prQM->arRxBaTable[i].rReOrderQue)); - - } - else{ - continue; - } - } - - if(prSwRfbListTail){ - /* Terminate the MSDU_INFO list with a NULL pointer */ - QM_TX_SET_NEXT_SW_RFB(prSwRfbListTail, NULL); - } - return prSwRfbListHead; - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Flush RX packets with respect to a particular STA -* -* \param[in] u4StaRecIdx STA_REC index -* \param[in] u4Tid TID -* -* \return The flushed packets (in a list of SW_RFBs) -*/ -/*----------------------------------------------------------------------------*/ -P_SW_RFB_T -qmFlushStaRxQueue( - IN P_ADAPTER_T prAdapter, - IN UINT_32 u4StaRecIdx, - IN UINT_32 u4Tid - ) -{ - //UINT_32 i; - P_SW_RFB_T prSwRfbListHead; - P_SW_RFB_T prSwRfbListTail; - P_RX_BA_ENTRY_T prReorderQueParm; - P_STA_RECORD_T prStaRec; - - DBGLOG(QM, TRACE, ("QM: Enter qmFlushStaRxQueues(%ld)\n", u4StaRecIdx)); - - prSwRfbListHead = prSwRfbListTail = NULL; - - prStaRec = &prAdapter->arStaRec[u4StaRecIdx]; - ASSERT(prStaRec); - - /* No matter whether this is an activated STA_REC, do flush */ -#if 0 - if(!prStaRec->fgIsValid){ - return NULL; - } -#endif - - /* Obtain the RX BA Entry pointer */ - prReorderQueParm = ((prStaRec->aprRxReorderParamRefTbl)[u4Tid]); - - /* Note: For each queued packet, prCurrSwRfb->eDst equals RX_PKT_DESTINATION_HOST */ - if(prReorderQueParm){ - - if(QUEUE_IS_NOT_EMPTY(&(prReorderQueParm->rReOrderQue))){ - - prSwRfbListHead =(P_SW_RFB_T) - QUEUE_GET_HEAD(&(prReorderQueParm->rReOrderQue)); - prSwRfbListTail =(P_SW_RFB_T) - QUEUE_GET_TAIL(&(prReorderQueParm->rReOrderQue)); - - - QUEUE_INITIALIZE(&(prReorderQueParm->rReOrderQue)); - - } - } - - if(prSwRfbListTail){ - /* Terminate the MSDU_INFO list with a NULL pointer */ - QM_TX_SET_NEXT_SW_RFB(prSwRfbListTail, NULL); - } - return prSwRfbListHead; - - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Enqueue TX packets -* -* \param[in] prMsduInfoListHead Pointer to the list of TX packets -* -* \return The freed packets, which are not enqueued -*/ -/*----------------------------------------------------------------------------*/ -P_MSDU_INFO_T -qmEnqueueTxPackets( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfoListHead - ) -{ - P_MSDU_INFO_T prMsduInfoReleaseList; - P_MSDU_INFO_T prCurrentMsduInfo; - P_MSDU_INFO_T prNextMsduInfo; - - P_STA_RECORD_T prStaRec; - P_QUE_T prTxQue; - QUE_T rNotEnqueuedQue; - - - UINT_8 ucPacketType; - UINT_8 ucTC; - P_QUE_MGT_T prQM = &prAdapter->rQM; - UINT_8 aucNextUP[WMM_AC_INDEX_NUM] = { 1 /* BEtoBK*/, 1 /*na*/, 0/*VItoBE*/ , 4 /*VOtoVI*/}; - - DBGLOG(QM, LOUD, ("Enter qmEnqueueTxPackets\n")); - - ASSERT(prMsduInfoListHead); - -#if QM_ADAPTIVE_TC_RESOURCE_CTRL - { - //UINT_32 i; - //4 <0> Update TC resource control related variables - /* Keep track of the queue length */ - if (--prQM->u4TimeToUpdateQueLen == 0){ - prQM->u4TimeToUpdateQueLen = QM_INIT_TIME_TO_UPDATE_QUE_LEN; - qmUpdateAverageTxQueLen(prAdapter); - } - } -#endif - - /* Push TX packets into STA_REC (for UNICAST) or prAdapter->rQM (for BMCAST) */ - prStaRec = NULL; - prMsduInfoReleaseList = NULL; - prCurrentMsduInfo = NULL; - QUEUE_INITIALIZE(&rNotEnqueuedQue); - prNextMsduInfo = prMsduInfoListHead; - - do{ - P_BSS_INFO_T prBssInfo; - BOOLEAN fgCheckACMAgain; - ENUM_WMM_ACI_T eAci = WMM_AC_BE_INDEX; - prCurrentMsduInfo = prNextMsduInfo; - prNextMsduInfo = QM_TX_GET_NEXT_MSDU_INFO(prCurrentMsduInfo); - ucTC = TC1_INDEX; - - //4 <1> Lookup the STA_REC index - /* The ucStaRecIndex will be set in this function */ - qmDetermineStaRecIndex(prAdapter, prCurrentMsduInfo); - ucPacketType = HIF_TX_PACKET_TYPE_DATA; - - DBGLOG(QM, LOUD , ("***** ucStaRecIndex = %d *****\n", - prCurrentMsduInfo->ucStaRecIndex)); - - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prCurrentMsduInfo->ucNetworkType]); - - if(IS_NET_ACTIVE(prAdapter, prCurrentMsduInfo->ucNetworkType)) { - - switch (prCurrentMsduInfo->ucStaRecIndex){ - case STA_REC_INDEX_BMCAST: - prTxQue = &prQM->arTxQueue[TX_QUEUE_INDEX_BMCAST]; - ucTC = TC5_INDEX; -#if 0 - if(prCurrentMsduInfo->ucNetworkType == NETWORK_TYPE_P2P_INDEX - && prCurrentMsduInfo->eSrc != TX_PACKET_MGMT - ) { - if(LINK_IS_EMPTY(&prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX].rStaRecOfClientList)) { - prTxQue = &rNotEnqueuedQue; - TX_INC_CNT(&prAdapter->rTxCtrl,TX_AP_BORADCAST_DROP); - } - } -#endif - - QM_DBG_CNT_INC(prQM, QM_DBG_CNT_23); - break; - - case STA_REC_INDEX_NOT_FOUND: - ucTC = TC5_INDEX; - - if(prCurrentMsduInfo->eSrc == TX_PACKET_FORWARDING) { - - /* if the packet is the forward type. the packet should be freed */ - DBGLOG(QM, TRACE, ("Forwarding packet but Sta is STA_REC_INDEX_NOT_FOUND\n")); - //prTxQue = &rNotEnqueuedQue; - } - prTxQue = &prQM->arTxQueue[TX_QUEUE_INDEX_NO_STA_REC]; - QM_DBG_CNT_INC(prQM, QM_DBG_CNT_24); - - break; - - default: - prStaRec = QM_GET_STA_REC_PTR_FROM_INDEX(prAdapter, prCurrentMsduInfo->ucStaRecIndex); - - ASSERT(prStaRec); - ASSERT(prStaRec->fgIsValid); - - if(prCurrentMsduInfo->ucUserPriority < 8) { - QM_DBG_CNT_INC(prQM, prCurrentMsduInfo->ucUserPriority + 15); - /* QM_DBG_CNT_15 */ /* QM_DBG_CNT_16 */ /* QM_DBG_CNT_17 */ /* QM_DBG_CNT_18 */ - /* QM_DBG_CNT_19 */ /* QM_DBG_CNT_20 */ /* QM_DBG_CNT_21 */ /* QM_DBG_CNT_22 */ - } - - eAci = WMM_AC_BE_INDEX; - do { - fgCheckACMAgain = FALSE; - if (prStaRec->fgIsQoS){ - switch(prCurrentMsduInfo->ucUserPriority){ - case 1: - case 2: - prTxQue = &prStaRec->arTxQueue[TX_QUEUE_INDEX_AC0]; - ucTC = TC0_INDEX; - eAci = WMM_AC_BK_INDEX; - break; - case 0: - case 3: - prTxQue = &prStaRec->arTxQueue[TX_QUEUE_INDEX_AC1]; - ucTC = TC1_INDEX; - eAci = WMM_AC_BE_INDEX; - break; - case 4: - case 5: - prTxQue = &prStaRec->arTxQueue[TX_QUEUE_INDEX_AC2]; - ucTC = TC2_INDEX; - eAci = WMM_AC_VI_INDEX; - break; - case 6: - case 7: - prTxQue = &prStaRec->arTxQueue[TX_QUEUE_INDEX_AC3]; - ucTC = TC3_INDEX; - eAci = WMM_AC_VO_INDEX; - break; - default: - prTxQue = &prStaRec->arTxQueue[TX_QUEUE_INDEX_AC1]; - ucTC = TC1_INDEX; - eAci = WMM_AC_BE_INDEX; - ASSERT(0); - break; - } - if(prBssInfo->arACQueParms[eAci].fgIsACMSet && eAci != WMM_AC_BK_INDEX) { - prCurrentMsduInfo->ucUserPriority = aucNextUP[eAci]; - fgCheckACMAgain = TRUE; - } - } - else{ - prTxQue = &prStaRec->arTxQueue[TX_QUEUE_INDEX_AC1]; - ucTC = TC1_INDEX; - } - } - while(fgCheckACMAgain); - - //LOG_FUNC ("QoS %u UP %u TC %u",prStaRec->fgIsQoS,prCurrentMsduInfo->ucUserPriority, ucTC); - - break; /*default */ - } /* switch (prCurrentMsduInfo->ucStaRecIndex) */ - - if(prCurrentMsduInfo->eSrc == TX_PACKET_FORWARDING) { - if(prTxQue->u4NumElem > 32) { - DBGLOG(QM, INFO, ("Drop the Packet for full Tx queue (forwarding) Bss %u\n", prCurrentMsduInfo->ucNetworkType)); - prTxQue = &rNotEnqueuedQue; - TX_INC_CNT(&prAdapter->rTxCtrl,TX_FORWARD_OVERFLOW_DROP); - } - } - - } - else { - - DBGLOG(QM, INFO, ("Drop the Packet for inactive Bss %u\n", prCurrentMsduInfo->ucNetworkType)); - QM_DBG_CNT_INC(prQM, QM_DBG_CNT_31); - prTxQue = &rNotEnqueuedQue; - TX_INC_CNT(&prAdapter->rTxCtrl,TX_INACTIVE_BSS_DROP); - } - - //4 <3> Fill the MSDU_INFO for constructing HIF TX header - - /* TODO: Fill MSDU_INFO according to the network type, - * EtherType, and STA status (for PS forwarding control). - */ - - /* Note that the Network Type Index and STA_REC index are determined in - * qmDetermineStaRecIndex(prCurrentMsduInfo). - */ - QM_TX_SET_MSDU_INFO_FOR_DATA_PACKET( - prCurrentMsduInfo, /* MSDU_INFO ptr */ - ucTC, /* TC tag */ - ucPacketType, /* Packet Type */ - 0, /* Format ID */ - prCurrentMsduInfo->fgIs802_1x, /* Flag 802.1x */ - prCurrentMsduInfo->fgIs802_11, /* Flag 802.11 */ - 0, /* PAL LLH */ - 0, /* ACL SN */ - PS_FORWARDING_TYPE_NON_PS, /* PS Forwarding Type */ - 0 /* PS Session ID */ - ); - - //4 <4> Enqueue the packet - QUEUE_INSERT_TAIL(prTxQue, (P_QUE_ENTRY_T)prCurrentMsduInfo); - - -#if QM_TEST_MODE - if (++prQM->u4PktCount == QM_TEST_TRIGGER_TX_COUNT){ - prQM->u4PktCount = 0; - qmTestCases(prAdapter); - } - -#endif - - DBGLOG(QM, LOUD, ("Current queue length = %u\n", prTxQue->u4NumElem)); - }while(prNextMsduInfo); - - if( QUEUE_IS_NOT_EMPTY(&rNotEnqueuedQue) ) { - QM_TX_SET_NEXT_MSDU_INFO((P_MSDU_INFO_T)QUEUE_GET_TAIL(&rNotEnqueuedQue), NULL); - prMsduInfoReleaseList = (P_MSDU_INFO_T)QUEUE_GET_HEAD(&rNotEnqueuedQue); - } - - - return prMsduInfoReleaseList; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Determine the STA_REC index for a packet -* -* \param[in] prMsduInfo Pointer to the packet -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -static VOID -qmDetermineStaRecIndex( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - UINT_32 i; - - P_STA_RECORD_T prTempStaRec; - //P_QUE_MGT_T prQM = &prAdapter->rQM; - - prTempStaRec = NULL; - - ASSERT(prMsduInfo); - - //4 <1> DA = BMCAST - if (IS_BMCAST_MAC_ADDR(prMsduInfo->aucEthDestAddr)){ - /* For intrastructure mode and P2P (playing as a GC), BMCAST frames shall be sent to the AP. - * FW shall take care of this. The host driver is not able to distinguish these cases. */ - prMsduInfo->ucStaRecIndex = STA_REC_INDEX_BMCAST; - DBGLOG(QM, LOUD, ("TX with DA = BMCAST\n")); - return; - } - - - //4 <2> Check if an AP STA is present - for (i = 0; i < CFG_NUM_OF_STA_RECORD; i++){ - prTempStaRec = &(prAdapter->arStaRec[i]); - - if((prTempStaRec->ucNetTypeIndex == prMsduInfo->ucNetworkType) - && (prTempStaRec->fgIsAp) - && (prTempStaRec->fgIsValid)){ - prMsduInfo->ucStaRecIndex = prTempStaRec->ucIndex; - return; - } - } - - - - - //4 <3> Not BMCAST, No AP --> Compare DA (i.e., to see whether this is a unicast frame to a client) - for (i = 0; i < CFG_NUM_OF_STA_RECORD; i++){ - prTempStaRec = &(prAdapter->arStaRec[i]); - if (prTempStaRec->fgIsValid){ - if (EQUAL_MAC_ADDR(prTempStaRec->aucMacAddr, prMsduInfo->aucEthDestAddr)){ - prMsduInfo->ucStaRecIndex = prTempStaRec->ucIndex; - return; - } - } - } - - - //4 <4> No STA found, Not BMCAST --> Indicate NOT_FOUND to FW - prMsduInfo->ucStaRecIndex = STA_REC_INDEX_NOT_FOUND; - DBGLOG(QM, LOUD, ("QM: TX with STA_REC_INDEX_NOT_FOUND\n")); - - -#if (QM_TEST_MODE && QM_TEST_FAIR_FORWARDING) - prMsduInfo->ucStaRecIndex = (UINT_8)prQM->u4CurrentStaRecIndexToEnqueue; -#endif -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Dequeue TX packets from a STA_REC for a particular TC -* -* \param[out] prQue The queue to put the dequeued packets -* \param[in] ucTC The TC index (TC0_INDEX to TC5_INDEX) -* \param[in] ucMaxNum The maximum amount of dequeued packets -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -static VOID -qmDequeueTxPacketsFromPerStaQueues( - IN P_ADAPTER_T prAdapter, - OUT P_QUE_T prQue, - IN UINT_8 ucTC, - IN UINT_8 ucCurrentQuota, - IN UINT_8 ucTotalQuota - ) -{ - -#if QM_FORWARDING_FAIRNESS - UINT_32 i; /* Loop for */ - - PUINT_32 pu4HeadStaRecIndex; /* The Head STA index */ - PUINT_32 pu4HeadStaRecForwardCount; /* The total forwarded packets for the head STA */ - - P_STA_RECORD_T prStaRec; /* The current focused STA */ - P_BSS_INFO_T prBssInfo; /* The Bss for current focused STA */ - P_QUE_T prCurrQueue; /* The current TX queue to dequeue */ - P_MSDU_INFO_T prDequeuedPkt; /* The dequeued packet */ - - UINT_32 u4ForwardCount; /* To remember the total forwarded packets for a STA */ - UINT_32 u4MaxForwardCount; /* The maximum number of packets a STA can forward */ - UINT_32 u4Resource; /* The TX resource amount */ - - BOOLEAN fgChangeHeadSta; /* Whether a new head STA shall be determined at the end of the function */ - P_QUE_MGT_T prQM = &prAdapter->rQM; - - PUINT_8 pucFreeQuota; - - DBGLOG(QM, LOUD, ("Enter qmDequeueTxPacketsFromPerStaQueues (TC = %u)\n", ucTC)); - - ASSERT(ucTC == TC0_INDEX || ucTC == TC1_INDEX || - ucTC == TC2_INDEX || ucTC == TC3_INDEX || - ucTC == TC4_INDEX - ); - - if(!ucCurrentQuota){ - DBGLOG(TX, LOUD, ("@@@@@ TC = %u ucCurrentQuota = %u @@@@@\n", - ucTC, ucCurrentQuota)); - return; - } - - u4Resource = ucCurrentQuota; - - //4 <1> Determine the head STA - /* The head STA shall be an active STA */ - - pu4HeadStaRecIndex = &(prQM->au4HeadStaRecIndex[ucTC]); - pu4HeadStaRecForwardCount = &(prQM->au4ForwardCount[ucTC]); - - DBGLOG(QM, LOUD, ("(Fairness) TID = %u Init Head STA = %u Resource = %u\n", - ucTC, *pu4HeadStaRecIndex, u4Resource)); - - - /* From STA[x] to STA[x+1] to STA[x+2] to ... to STA[x] */ - for (i=0; i < CFG_NUM_OF_STA_RECORD + 1; i++){ - prStaRec = &prAdapter->arStaRec[(*pu4HeadStaRecIndex)]; - ASSERT(prStaRec); - - /* Only Data frame (1x was not included) will be queued in */ - if (prStaRec->fgIsValid){ - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]); - - ASSERT(prBssInfo->ucNetTypeIndex == prStaRec->ucNetTypeIndex); - - /* Determine how many packets the head STA is allowed to send in a round */ - - QM_DBG_CNT_INC(prQM, QM_DBG_CNT_25); - u4MaxForwardCount = ucTotalQuota; -#if CFG_ENABLE_WIFI_DIRECT - - pucFreeQuota = NULL; - if(prStaRec->fgIsInPS && (ucTC!=TC4_INDEX)) { - // TODO: Change the threshold in coorperation with the PS forwarding mechanism - // u4MaxForwardCount = ucTotalQuota; - /* Per STA flow control when STA in PS mode */ - /* The PHASE 1: only update from ucFreeQuota (now) */ - /* XXX The PHASE 2: Decide by ucFreeQuota and ucBmpDeliveryAC (per queue ) aucFreeQuotaPerQueue[] */ - /* NOTE: other method to set u4Resource */ - - if(prStaRec->fgIsQoS && prStaRec->fgIsUapsdSupported - /* && prAdapter->rWifiVar.fgSupportQoS - && prAdapter->rWifiVar.fgSupportUAPSD*/) { - - if( prStaRec->ucBmpTriggerAC & BIT(ucTC)) { - u4MaxForwardCount = prStaRec->ucFreeQuotaForDelivery; - pucFreeQuota = &prStaRec->ucFreeQuotaForDelivery; - } - else { - u4MaxForwardCount = prStaRec->ucFreeQuotaForNonDelivery; - pucFreeQuota = &prStaRec->ucFreeQuotaForNonDelivery; - } - - } - else { - ASSERT(prStaRec->ucFreeQuotaForDelivery == 0); - u4MaxForwardCount = prStaRec->ucFreeQuotaForNonDelivery; - pucFreeQuota = &prStaRec->ucFreeQuotaForNonDelivery; - } - - } /* fgIsInPS */ -#endif /* CFG_ENABLE_WIFI_DIRECT */ - -#if CFG_ENABLE_WIFI_DIRECT - if(prBssInfo->fgIsNetAbsent && (ucTC!=TC4_INDEX)) { - if(u4MaxForwardCount > prBssInfo->ucBssFreeQuota) { - u4MaxForwardCount = prBssInfo->ucBssFreeQuota; - } - } - -#endif /* CFG_ENABLE_WIFI_DIRECT */ - - /* Determine whether the head STA can continue to forward packets in this round */ - if((*pu4HeadStaRecForwardCount) < u4MaxForwardCount){ - break; - } - - } /* prStaRec->fgIsValid */ - else{ - /* The current Head STA has been deactivated, so search for a new head STA */ - prStaRec = NULL; - prBssInfo = NULL; - (*pu4HeadStaRecIndex) ++; - (*pu4HeadStaRecIndex) %= CFG_NUM_OF_STA_RECORD; - - /* Reset the forwarding count before searching (since this is for a new selected STA) */ - (*pu4HeadStaRecForwardCount) = 0; - } - } /* i < CFG_NUM_OF_STA_RECORD + 1 */ - - /* All STA_RECs are inactive, so exit */ - if (!prStaRec){ - /* Under concurrent, it is possible that there is no candidcated STA.*/ - //DBGLOG(TX, EVENT, ("All STA_RECs are inactive\n")); - return; - } - - DBGLOG(QM, LOUD, ("(Fairness) TID = %u Round Head STA = %lu\n", - ucTC, *pu4HeadStaRecIndex)); - - //4 <2> Dequeue packets from the head STA - - prCurrQueue = &prStaRec->arTxQueue[ucTC]; - prDequeuedPkt = NULL; - fgChangeHeadSta = FALSE; - - while(prCurrQueue){ - - -#if QM_DEBUG_COUNTER - - if(ucTC <= TC4_INDEX) { - if(QUEUE_IS_EMPTY(prCurrQueue)) { - QM_DBG_CNT_INC(prQM, ucTC); - /* QM_DBG_CNT_00 */ /* QM_DBG_CNT_01 */ /* QM_DBG_CNT_02 */ /* QM_DBG_CNT_03 */ /* QM_DBG_CNT_04 */ - } - if(u4Resource == 0) { - QM_DBG_CNT_INC(prQM, ucTC + 5); - /* QM_DBG_CNT_05 */ /* QM_DBG_CNT_06 */ /* QM_DBG_CNT_07 */ /* QM_DBG_CNT_08 */ /* QM_DBG_CNT_09 */ - } - if(((*pu4HeadStaRecForwardCount) >= u4MaxForwardCount)) { - QM_DBG_CNT_INC(prQM, ucTC + 10); - /* QM_DBG_CNT_10 */ /* QM_DBG_CNT_11 */ /* QM_DBG_CNT_12 */ /* QM_DBG_CNT_13 */ /* QM_DBG_CNT_14 */ - } - } -#endif - - - /* Three cases to break: (1) No resource (2) No packets (3) Fairness */ - if (QUEUE_IS_EMPTY(prCurrQueue) || ((*pu4HeadStaRecForwardCount) >= u4MaxForwardCount)){ - fgChangeHeadSta = TRUE; - break; - } - else if (u4Resource == 0){ - break; - } - else{ - - QUEUE_REMOVE_HEAD(prCurrQueue, prDequeuedPkt, P_MSDU_INFO_T); -#if DBG && 0 - LOG_FUNC("Deq0 TC %d queued %u net %u mac len %u len %u Type %u 1x %u 11 %u\n", - prDequeuedPkt->ucTC, - prCurrQueue->u4NumElem, - prDequeuedPkt->ucNetworkType, - prDequeuedPkt->ucMacHeaderLength, - prDequeuedPkt->u2FrameLength, - prDequeuedPkt->ucPacketType, - prDequeuedPkt->fgIs802_1x, - prDequeuedPkt->fgIs802_11 ); - - LOG_FUNC("Dest Mac: " MACSTR "\n", - MAC2STR(prDequeuedPkt->aucEthDestAddr)); - -#if LINUX - { - struct sk_buff *prSkb = (struct sk_buff *) prDequeuedPkt->prPacket; - dumpMemory8((PUINT_8)prSkb->data,prSkb->len); - } -#endif - -#endif - - ASSERT(prDequeuedPkt->ucTC == ucTC); - - if(!QUEUE_IS_EMPTY(prCurrQueue)) { - /* XXX: check all queues for STA */ - prDequeuedPkt->ucPsForwardingType = PS_FORWARDING_MORE_DATA_ENABLED; - } - - QUEUE_INSERT_TAIL(prQue,(P_QUE_ENTRY_T)prDequeuedPkt); - u4Resource--; - (*pu4HeadStaRecForwardCount) ++; - - -#if CFG_ENABLE_WIFI_DIRECT - /* XXX The PHASE 2: decrease from aucFreeQuotaPerQueue[] */ - if(prStaRec->fgIsInPS && (ucTC!=TC4_INDEX)) { - ASSERT(pucFreeQuota); - ASSERT(*pucFreeQuota>0); - if(*pucFreeQuota>0) { - *pucFreeQuota = *pucFreeQuota - 1; - } - } -#endif /* CFG_ENABLE_WIFI_DIRECT */ - -#if CFG_ENABLE_WIFI_DIRECT - if(prBssInfo->fgIsNetAbsent && (ucTC!=TC4_INDEX)) { - if(prBssInfo->ucBssFreeQuota>0) { - prBssInfo->ucBssFreeQuota--; - } - } -#endif /* CFG_ENABLE_WIFI_DIRECT */ - - } - } - - if (*pu4HeadStaRecForwardCount){ - DBGLOG(QM, LOUD, ("TC = %u Round Head STA = %lu, u4HeadStaRecForwardCount = %lu\n", ucTC, *pu4HeadStaRecIndex, (*pu4HeadStaRecForwardCount))); - } - -#if QM_BURST_END_INFO_ENABLED - /* Let FW know which packet is the last one dequeued from the STA */ - if (prDequeuedPkt){ - prDequeuedPkt->fgIsBurstEnd = TRUE; - } -#endif - - - //4 <3> Dequeue from the other STAs if there is residual TX resource - - /* Check all of the STAs to continue forwarding packets (including the head STA) */ - for (i= 0; i< CFG_NUM_OF_STA_RECORD; i++){ - /* Break in case no reasource is available */ - if (u4Resource == 0){ - break; - } - - /* The current head STA will be examined when i = CFG_NUM_OF_STA_RECORD-1 */ - prStaRec = &prAdapter->arStaRec[((*pu4HeadStaRecIndex) + i + 1) % CFG_NUM_OF_STA_RECORD]; - ASSERT(prStaRec); - - if (prStaRec->fgIsValid) { - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]); - ASSERT(prBssInfo->ucNetTypeIndex == prStaRec->ucNetTypeIndex); - - DBGLOG(QM, LOUD, ("(Fairness) TID = %u Sharing STA = %u Resource = %lu\n", - ucTC, prStaRec->ucIndex, u4Resource)); - - prCurrQueue = &prStaRec->arTxQueue[ucTC]; - u4ForwardCount = 0; - u4MaxForwardCount = ucTotalQuota; - -#if CFG_ENABLE_WIFI_DIRECT - pucFreeQuota = NULL; - if(prStaRec->fgIsInPS && (ucTC!=TC4_INDEX)) { - // TODO: Change the threshold in coorperation with the PS forwarding mechanism - // u4MaxForwardCount = ucTotalQuota; - /* Per STA flow control when STA in PS mode */ - /* The PHASE 1: only update from ucFreeQuota (now) */ - /* XXX The PHASE 2: Decide by ucFreeQuota and ucBmpDeliveryAC (per queue ) aucFreeQuotaPerQueue[] */ - /* NOTE: other method to set u4Resource */ - if(prStaRec->fgIsQoS && prStaRec->fgIsUapsdSupported - /* && prAdapter->rWifiVar.fgSupportQoS - && prAdapter->rWifiVar.fgSupportUAPSD*/) { - - if( prStaRec->ucBmpTriggerAC & BIT(ucTC)) { - u4MaxForwardCount = prStaRec->ucFreeQuotaForDelivery; - pucFreeQuota = &prStaRec->ucFreeQuotaForDelivery; - } - else { - u4MaxForwardCount = prStaRec->ucFreeQuotaForNonDelivery; - pucFreeQuota = &prStaRec->ucFreeQuotaForNonDelivery; - } - - } - else { - ASSERT(prStaRec->ucFreeQuotaForDelivery == 0); - u4MaxForwardCount = prStaRec->ucFreeQuotaForNonDelivery; - pucFreeQuota = &prStaRec->ucFreeQuotaForNonDelivery; - } - - } -#endif /* CFG_ENABLE_WIFI_DIRECT */ -#if CFG_ENABLE_WIFI_DIRECT - if(prBssInfo->fgIsNetAbsent && (ucTC!=TC4_INDEX)) { - if(u4MaxForwardCount > prBssInfo->ucBssFreeQuota) { - u4MaxForwardCount = prBssInfo->ucBssFreeQuota; - } - } - -#endif /* CFG_ENABLE_WIFI_DIRECT */ - } /* prStaRec->fgIsValid */ - else{ - prBssInfo = NULL; - /* Invalid STA, so check the next STA */ - continue; - } - - while(prCurrQueue){ - /* Three cases to break: (1) No resource (2) No packets (3) Fairness */ - if ((u4Resource == 0) || QUEUE_IS_EMPTY(prCurrQueue) || (u4ForwardCount >= u4MaxForwardCount)){ - break; - } - else{ - - QUEUE_REMOVE_HEAD(prCurrQueue, prDequeuedPkt, P_MSDU_INFO_T); - -#if DBG && 0 - DBGLOG(QM, LOUD, ("Deq0 TC %d queued %u net %u mac len %u len %u Type %u 1x %u 11 %u\n", - prDequeuedPkt->ucTC, - prCurrQueue->u4NumElem, - prDequeuedPkt->ucNetworkType, - prDequeuedPkt->ucMacHeaderLength, - prDequeuedPkt->u2FrameLength, - prDequeuedPkt->ucPacketType, - prDequeuedPkt->fgIs802_1x, - prDequeuedPkt->fgIs802_11 )); - - DBGLOG(QM, LOUD,("Dest Mac: " MACSTR "\n", - MAC2STR(prDequeuedPkt->aucEthDestAddr))); - -#if LINUX - { - struct sk_buff *prSkb = (struct sk_buff *) prDequeuedPkt->prPacket; - dumpMemory8((PUINT_8)prSkb->data,prSkb->len); - } -#endif - -#endif - - - ASSERT(prDequeuedPkt->ucTC == ucTC); - - if(!QUEUE_IS_EMPTY(prCurrQueue)) { - prDequeuedPkt->ucPsForwardingType = PS_FORWARDING_MORE_DATA_ENABLED; - } - - QUEUE_INSERT_TAIL(prQue,(P_QUE_ENTRY_T)prDequeuedPkt); - u4Resource--; - u4ForwardCount ++; - -#if CFG_ENABLE_WIFI_DIRECT - /* XXX The PHASE 2: decrease from aucFreeQuotaPerQueue[] */ - if(prStaRec->fgIsInPS && (ucTC!=TC4_INDEX)) { - ASSERT(pucFreeQuota); - ASSERT(*pucFreeQuota>0); - if(*pucFreeQuota>0) { - *pucFreeQuota = *pucFreeQuota - 1; - } - } -#endif /* CFG_ENABLE_WIFI_DIRECT */ - - -#if CFG_ENABLE_WIFI_DIRECT - ASSERT(prBssInfo->ucNetTypeIndex == prStaRec->ucNetTypeIndex); - if(prBssInfo->fgIsNetAbsent && (ucTC!=TC4_INDEX)) { - if(prBssInfo->ucBssFreeQuota>0) { - prBssInfo->ucBssFreeQuota--; - } - } -#endif /* CFG_ENABLE_WIFI_DIRECT */ - - } - } - -#if QM_BURST_END_INFO_ENABLED - /* Let FW know which packet is the last one dequeued from the STA */ - if (u4ForwardCount){ - prDequeuedPkt->fgIsBurstEnd = TRUE; - } -#endif - } - - - if (fgChangeHeadSta){ - (*pu4HeadStaRecIndex) ++; - (*pu4HeadStaRecIndex) %= CFG_NUM_OF_STA_RECORD; - (*pu4HeadStaRecForwardCount) = 0; - DBGLOG(QM, LOUD, ("(Fairness) TID = %u Scheduled Head STA = %lu Left Resource = %lu\n", - ucTC, (*pu4HeadStaRecIndex), u4Resource)); - } - - -/***************************************************************************************/ -#else - UINT_8 ucStaRecIndex; - P_STA_RECORD_T prStaRec; - P_QUE_T prCurrQueue; - UINT_8 ucPktCount; - P_MSDU_INFO_T prDequeuedPkt; - - DBGLOG(QM, LOUD, ("Enter qmDequeueTxPacketsFromPerStaQueues (TC = %u)\n", ucTC)); - - if (ucCurrentQuota == 0){ - return; - } - - //4 <1> Determine the queue index and the head STA - - /* The head STA */ - ucStaRecIndex = 0; /* TODO: Get the current head STA */ - prStaRec = QM_GET_STA_REC_PTR_FROM_INDEX(prAdapter, ucStaRecIndex); - ASSERT(prStaRec); - - if(prStaRec == NULL) { - return; - } - - /* The queue to pull out packets */ - ASSERT(ucTC == TC0_INDEX || ucTC == TC1_INDEX || - ucTC == TC2_INDEX || ucTC == TC3_INDEX || - ucTC == TC4_INDEX - ); - prCurrQueue = &prStaRec->arTxQueue[ucTC]; - - ucPktCount = ucCurrentQuota; - prDequeuedPkt = NULL; - - //4 <2> Dequeue packets for the head STA - while(TRUE){ - if (!(prStaRec->fgIsValid) || ucPktCount ==0 || QUEUE_IS_EMPTY(prCurrQueue)){ - break; - - } - else{ - - QUEUE_REMOVE_HEAD(prCurrQueue, prDequeuedPkt, P_MSDU_INFO_T); - //DbgPrint("QM: Remove Queue Head, TC= %d\n", prDequeuedPkt->ucTC); - ASSERT(prDequeuedPkt->ucTC == ucTC); - - QUEUE_INSERT_TAIL(prQue,(P_QUE_ENTRY_T)prDequeuedPkt); - ucPktCount--; - } - } - - //DbgPrint("QM: Remaining number of queued packets = %d\n", prCurrQueue->u4NumElem); - -#if QM_BURST_END_INFO_ENABLED - if (prDequeuedPkt){ - prDequeuedPkt->fgIsBurstEnd = TRUE; - } - -#endif - - //4 <3> Update scheduling info - /* TODO */ - - //4 <4> Utilize the remainaing TX opportunities for non-head STAs - /* TODO */ -#endif -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Dequeue TX packets from a per-Type-based Queue for a particular TC -* -* \param[out] prQue The queue to put the dequeued packets -* \param[in] ucTC The TC index (Shall always be TC5_INDEX) -* \param[in] ucMaxNum The maximum amount of dequeued packets -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -static VOID -qmDequeueTxPacketsFromPerTypeQueues( - IN P_ADAPTER_T prAdapter, - OUT P_QUE_T prQue, - IN UINT_8 ucTC, - IN UINT_8 ucMaxNum - ) -{ - //UINT_8 ucQueIndex; - //UINT_8 ucStaRecIndex; - P_BSS_INFO_T prBssInfo; - P_BSS_INFO_T parBssInfo; - P_QUE_T prCurrQueue; - UINT_8 ucPktCount; - P_MSDU_INFO_T prDequeuedPkt; - P_MSDU_INFO_T prBurstEndPkt; - QUE_T rMergeQue; - P_QUE_T prMergeQue; - P_QUE_MGT_T prQM; - - DBGLOG(QM, LOUD, ("Enter qmDequeueTxPacketsFromPerTypeQueues (TC = %d, Max = %d)\n", ucTC, ucMaxNum)); - - /* TC5: Broadcast/Multicast data packets */ - ASSERT(ucTC == TC5_INDEX); - - if (ucMaxNum == 0){ - return; - } - - prQM = &prAdapter->rQM; - //4 <1> Determine the queue - - prCurrQueue = &prQM->arTxQueue[TX_QUEUE_INDEX_BMCAST]; - ucPktCount = ucMaxNum; - prDequeuedPkt = NULL; - prBurstEndPkt = NULL; - - parBssInfo = prAdapter->rWifiVar.arBssInfo; - - QUEUE_INITIALIZE(&rMergeQue); - prMergeQue = &rMergeQue; - - //4 <2> Dequeue packets - while(TRUE){ - if(ucPktCount ==0 || QUEUE_IS_EMPTY(prCurrQueue)){ - break; - } - else{ - QUEUE_REMOVE_HEAD(prCurrQueue, prDequeuedPkt, P_MSDU_INFO_T); - ASSERT(prDequeuedPkt->ucTC == ucTC); - - ASSERT(prDequeuedPkt->ucNetworkType < NETWORK_TYPE_INDEX_NUM); - - prBssInfo = &parBssInfo[prDequeuedPkt->ucNetworkType]; - - if(IS_BSS_ACTIVE(prBssInfo)) { - if( !prBssInfo->fgIsNetAbsent){ - QUEUE_INSERT_TAIL(prQue,(P_QUE_ENTRY_T)prDequeuedPkt); - prBurstEndPkt = prDequeuedPkt; - ucPktCount--; - QM_DBG_CNT_INC(prQM, QM_DBG_CNT_26); -#if DBG && 0 - LOG_FUNC("DeqType TC %d queued %u net %u mac len %u len %u Type %u 1x %u 11 %u\n", - prDequeuedPkt->ucTC, - prCurrQueue->u4NumElem, - prDequeuedPkt->ucNetworkType, - prDequeuedPkt->ucMacHeaderLength, - prDequeuedPkt->u2FrameLength, - prDequeuedPkt->ucPacketType, - prDequeuedPkt->fgIs802_1x, - prDequeuedPkt->fgIs802_11 ); - - LOG_FUNC("Dest Mac: " MACSTR "\n", - MAC2STR(prDequeuedPkt->aucEthDestAddr)); - -#if LINUX - { - struct sk_buff *prSkb = (struct sk_buff *) prDequeuedPkt->prPacket; - dumpMemory8((PUINT_8)prSkb->data,prSkb->len); - } -#endif - -#endif - } - else { - QUEUE_INSERT_TAIL(prMergeQue,(P_QUE_ENTRY_T)prDequeuedPkt); - } - } - else { - QM_TX_SET_NEXT_MSDU_INFO(prDequeuedPkt, NULL); - wlanProcessQueuedMsduInfo(prAdapter,prDequeuedPkt); - } - } - } - - if(QUEUE_IS_NOT_EMPTY(prMergeQue)) { - QUEUE_CONCATENATE_QUEUES(prMergeQue, prCurrQueue); - QUEUE_MOVE_ALL(prCurrQueue, prMergeQue); - QM_TX_SET_NEXT_MSDU_INFO((P_MSDU_INFO_T)QUEUE_GET_TAIL(prCurrQueue), NULL); - } - -#if QM_BURST_END_INFO_ENABLED - if (prBurstEndPkt){ - prBurstEndPkt->fgIsBurstEnd = TRUE; - } -#endif -} /* qmDequeueTxPacketsFromPerTypeQueues */ - - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Dequeue TX packets to send to HIF TX -* -* \param[in] prTcqStatus Info about the maximum amount of dequeued packets -* -* \return The list of dequeued TX packets -*/ -/*----------------------------------------------------------------------------*/ -P_MSDU_INFO_T -qmDequeueTxPackets( - IN P_ADAPTER_T prAdapter, - IN P_TX_TCQ_STATUS_T prTcqStatus - ) -{ - - INT_32 i; - P_MSDU_INFO_T prReturnedPacketListHead; - QUE_T rReturnedQue; - - DBGLOG(QM, LOUD, ("Enter qmDequeueTxPackets\n")); - - QUEUE_INITIALIZE(&rReturnedQue); - - prReturnedPacketListHead = NULL; - - /* TC0 to TC4: AC0~AC3, 802.1x (commands packets are not handled by QM) */ - for(i = TC4_INDEX; i >= TC0_INDEX; i--){ - DBGLOG(QM, LOUD, ("Dequeue packets from Per-STA queue[%u]\n", i)); - - qmDequeueTxPacketsFromPerStaQueues( - prAdapter, - &rReturnedQue, - (UINT_8)i, - prTcqStatus->aucFreeBufferCount[i], - prTcqStatus->aucMaxNumOfBuffer[i] - ); - - /* The aggregate number of dequeued packets */ - DBGLOG(QM, LOUD, ("DQA)[%u](%lu)\n", i, rReturnedQue.u4NumElem)); - } - - - /* TC5 (BMCAST or STA-NOT-FOUND packets) */ - qmDequeueTxPacketsFromPerTypeQueues( - prAdapter, - &rReturnedQue, - TC5_INDEX, - prTcqStatus->aucFreeBufferCount[TC5_INDEX] - ); - - DBGLOG(QM, LOUD, ("Current total number of dequeued packets = %u\n", rReturnedQue.u4NumElem)); - - if (QUEUE_IS_NOT_EMPTY(&rReturnedQue)){ - prReturnedPacketListHead = (P_MSDU_INFO_T)QUEUE_GET_HEAD(&rReturnedQue); - QM_TX_SET_NEXT_MSDU_INFO((P_MSDU_INFO_T)QUEUE_GET_TAIL(&rReturnedQue), NULL); - } - - return prReturnedPacketListHead; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Adjust the TC quotas according to traffic demands -* -* \param[out] prTcqAdjust The resulting adjustment -* \param[in] prTcqStatus Info about the current TC quotas and counters -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -qmAdjustTcQuotas ( - IN P_ADAPTER_T prAdapter, - OUT P_TX_TCQ_ADJUST_T prTcqAdjust, - IN P_TX_TCQ_STATUS_T prTcqStatus - ) -{ -#if QM_ADAPTIVE_TC_RESOURCE_CTRL - UINT_32 i; - P_QUE_MGT_T prQM = &prAdapter->rQM; - - /* Must initialize */ - for (i = 0; i < TC_NUM; i++){ - prTcqAdjust->acVariation[i]= 0; - } - - //4 <1> If TC resource is not just adjusted, exit directly - if (!prQM->fgTcResourcePostAnnealing){ - return; - } - - //4 <2> Adjust TcqStatus according to the updated prQM->au4CurrentTcResource - else{ - INT_32 i4TotalExtraQuota = 0; - INT_32 ai4ExtraQuota[TC_NUM]; - BOOLEAN fgResourceRedistributed = TRUE; - - /* Obtain the free-to-distribute resource */ - for (i = 0; i < TC_NUM; i++){ - ai4ExtraQuota[i] = (INT_32)prTcqStatus->aucMaxNumOfBuffer[i] - (INT_32)prQM->au4CurrentTcResource[i]; - - if (ai4ExtraQuota[i] > 0){ /* The resource shall be reallocated to other TCs */ - if (ai4ExtraQuota[i] > prTcqStatus->aucFreeBufferCount[i]){ - ai4ExtraQuota[i] = prTcqStatus->aucFreeBufferCount[i]; - fgResourceRedistributed = FALSE; - } - - i4TotalExtraQuota += ai4ExtraQuota[i]; - prTcqAdjust->acVariation[i] = (INT_8)(-ai4ExtraQuota[i]); - } - } - - /* Distribute quotas to TCs which need extra resource according to prQM->au4CurrentTcResource */ - for (i = 0; i < TC_NUM; i++){ - if (ai4ExtraQuota[i] < 0){ - if ((-ai4ExtraQuota[i]) > i4TotalExtraQuota){ - ai4ExtraQuota[i] = (-i4TotalExtraQuota); - fgResourceRedistributed = FALSE; - } - - i4TotalExtraQuota += ai4ExtraQuota[i]; - prTcqAdjust->acVariation[i] = (INT_8)(-ai4ExtraQuota[i]); - } - } - - /* In case some TC is waiting for TX Done, continue to adjust TC quotas upon TX Done */ - prQM->fgTcResourcePostAnnealing = (!fgResourceRedistributed); - -#if QM_PRINT_TC_RESOURCE_CTRL - DBGLOG(QM, LOUD, ("QM: Curr Quota [0]=%u [1]=%u [2]=%u [3]=%u [4]=%u [5]=%u\n", - prTcqStatus->aucFreeBufferCount[0], - prTcqStatus->aucFreeBufferCount[1], - prTcqStatus->aucFreeBufferCount[2], - prTcqStatus->aucFreeBufferCount[3], - prTcqStatus->aucFreeBufferCount[4], - prTcqStatus->aucFreeBufferCount[5] - )); -#endif - } - -#else - UINT_32 i; - for (i = 0; i < TC_NUM; i++){ - prTcqAdjust->acVariation[i]= 0; - } - -#endif -} - -#if QM_ADAPTIVE_TC_RESOURCE_CTRL -/*----------------------------------------------------------------------------*/ -/*! -* \brief Update the average TX queue length for the TC resource control mechanism -* -* \param (none) -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -qmUpdateAverageTxQueLen( - IN P_ADAPTER_T prAdapter - ) -{ - INT_32 u4CurrQueLen, i, k; - P_STA_RECORD_T prStaRec; - P_QUE_MGT_T prQM = &prAdapter->rQM; - - //4 <1> Update the queue lengths for TC0 to TC3 (skip TC4) and TC5 */ - for (i = 0; i < NUM_OF_PER_STA_TX_QUEUES - 1; i++){ - u4CurrQueLen = 0; - - for (k = 0; k < CFG_NUM_OF_STA_RECORD; k++){ - prStaRec = &prAdapter->arStaRec[k]; - ASSERT(prStaRec); - - /* If the STA is activated, get the queue length */ - if (prStaRec->fgIsValid && - (!prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex].fgIsNetAbsent) - ) - { - - u4CurrQueLen += (prStaRec->arTxQueue[i].u4NumElem); - } - } - - if (prQM->au4AverageQueLen[i] == 0){ - prQM->au4AverageQueLen[i] = (u4CurrQueLen << QM_QUE_LEN_MOVING_AVE_FACTOR); - } - else{ - prQM->au4AverageQueLen[i] -= (prQM->au4AverageQueLen[i] >> QM_QUE_LEN_MOVING_AVE_FACTOR); - prQM->au4AverageQueLen[i] += (u4CurrQueLen); - } - - } - - /* Update the queue length for TC5 (BMCAST) */ - u4CurrQueLen = prQM->arTxQueue[TX_QUEUE_INDEX_BMCAST].u4NumElem; - - if (prQM->au4AverageQueLen[TC_NUM-1] == 0){ - prQM->au4AverageQueLen[TC_NUM-1] = (u4CurrQueLen << QM_QUE_LEN_MOVING_AVE_FACTOR); - } - else{ - prQM->au4AverageQueLen[TC_NUM-1] -= (prQM->au4AverageQueLen[TC_NUM-1] >> QM_QUE_LEN_MOVING_AVE_FACTOR); - prQM->au4AverageQueLen[TC_NUM-1] += (u4CurrQueLen); - } - - - //4 <2> Adjust TC resource assignment - /* Check whether it is time to adjust the TC resource assignment */ - if (--prQM->u4TimeToAdjustTcResource == 0){ - /* The last assignment has not been completely applied */ - if (prQM->fgTcResourcePostAnnealing){ - /* Upon the next qmUpdateAverageTxQueLen function call, do this check again */ - prQM->u4TimeToAdjustTcResource = 1; - } - - /* The last assignment has been applied */ - else{ - prQM->u4TimeToAdjustTcResource = QM_INIT_TIME_TO_ADJUST_TC_RSC; - qmReassignTcResource(prAdapter); - } - } - - /* Debug */ -#if QM_PRINT_TC_RESOURCE_CTRL - for (i=0; i= 100){ - DBGLOG(QM, LOUD, ("QM: QueLen [%ld %ld %ld %ld %ld %ld]\n", - QM_GET_TX_QUEUE_LEN(prAdapter, 0), - QM_GET_TX_QUEUE_LEN(prAdapter, 1), - QM_GET_TX_QUEUE_LEN(prAdapter, 2), - QM_GET_TX_QUEUE_LEN(prAdapter, 3), - QM_GET_TX_QUEUE_LEN(prAdapter, 4), - QM_GET_TX_QUEUE_LEN(prAdapter, 5) - )); - break; - } - } -#endif - -} - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Assign TX resource for each TC according to TX queue length and current assignment -* -* \param (none) -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -qmReassignTcResource( - IN P_ADAPTER_T prAdapter - ) -{ - INT_32 i4TotalResourceDemand = 0; - UINT_32 u4ResidualResource = 0; - UINT_32 i; - INT_32 ai4PerTcResourceDemand[TC_NUM]; - UINT_32 u4ShareCount = 0; - UINT_32 u4Share = 0 ; - P_QUE_MGT_T prQM = &prAdapter->rQM; - - /* Note: After the new assignment is obtained, set prQM->fgTcResourcePostAnnealing to TRUE to - * start the TC-quota adjusting procedure, which will be invoked upon every TX Done - */ - - //4 <1> Determine the demands - /* Determine the amount of extra resource to fulfill all of the demands */ - for (i=0; iau4MinReservedTcResource[i] - prQM->au4CurrentTcResource[i]); - - /* If there are queued packets, allocate extra resource for the TC (for TCP consideration) */ - if (QM_GET_TX_QUEUE_LEN(prAdapter, i)){ - ai4PerTcResourceDemand[i] += QM_EXTRA_RESERVED_RESOURCE_WHEN_BUSY; - } - - i4TotalResourceDemand += ai4PerTcResourceDemand[i]; - } - - //4 <2> Case 1: Demand <= Total Resource - if (i4TotalResourceDemand <= 0){ - //4 <2.1> Satisfy every TC - for (i = 0; i < TC_NUM; i++){ - /* Skip TC4 (not adjustable) */ - if (i == TC4_INDEX) { - continue; - } - - prQM->au4CurrentTcResource[i] += ai4PerTcResourceDemand[i]; - } - - //4 <2.2> Share the residual resource evenly - u4ShareCount= (TC_NUM - 1); /* excluding TC4 */ - u4ResidualResource = (UINT_32)(-i4TotalResourceDemand); - u4Share = (u4ResidualResource/u4ShareCount); - - for (i=0; iau4CurrentTcResource[i] += u4Share; - - /* Every TC is fully satisfied */ - ai4PerTcResourceDemand[i] = 0; - - /* The left resource will be allocated to TC3 */ - u4ResidualResource -= u4Share; - } - - //4 <2.3> Allocate the left resource to TC3 (VO) - prQM->au4CurrentTcResource[TC3_INDEX] += (u4ResidualResource); - - } - - //4 <3> Case 2: Demand > Total Resource --> Guarantee a minimum amount of resource for each TC - else{ - u4ResidualResource = QM_INITIAL_RESIDUAL_TC_RESOURCE; - - //4 <3.1> Allocated resouce amount = minimum of (guaranteed, total demand) - for (i=0; iau4CurrentTcResource[i] + ai4PerTcResourceDemand[i] < prQM->au4GuaranteedTcResource[i]){ - prQM->au4CurrentTcResource[i] += ai4PerTcResourceDemand[i]; - u4ResidualResource += (prQM->au4GuaranteedTcResource[i] - prQM->au4CurrentTcResource[i]); - ai4PerTcResourceDemand[i] = 0; - } - - /* The demand can not be fulfilled with the guaranteed resource amount */ - else{ - ai4PerTcResourceDemand[i] -= (prQM->au4GuaranteedTcResource[i] - prQM->au4CurrentTcResource[i]); - prQM->au4CurrentTcResource[i] = prQM->au4GuaranteedTcResource[i]; - u4ShareCount++; - } - } - - //4 <3.2> Allocate the residual resource - do{ - /* If there is no resource left, exit directly */ - if (u4ResidualResource == 0){ - break; - } - - /* This shall not happen */ - if (u4ShareCount == 0){ - prQM->au4CurrentTcResource[TC1_INDEX] += u4ResidualResource; - DBGLOG(QM, ERROR, ("QM: (Error) u4ShareCount = 0\n")); - break; - } - - /* Share the residual resource evenly */ - u4Share = (u4ResidualResource / u4ShareCount); - if(u4Share){ - for (i=0; iau4CurrentTcResource[i] += u4Share; - u4ResidualResource -= u4Share; - ai4PerTcResourceDemand[i] -= u4Share; - } - else{ - prQM->au4CurrentTcResource[i] += ai4PerTcResourceDemand[i]; - u4ResidualResource -= ai4PerTcResourceDemand[i]; - ai4PerTcResourceDemand[i] = 0; - } - } - } - } - - /* By priority, allocate the left resource that is not divisible by u4Share */ - if (u4ResidualResource == 0){ - break; - } - - if (ai4PerTcResourceDemand[TC3_INDEX]){ /* VO */ - prQM->au4CurrentTcResource[TC3_INDEX]++; - if (--u4ResidualResource == 0) { - break; - } - } - - if (ai4PerTcResourceDemand[TC2_INDEX]){ /* VI */ - prQM->au4CurrentTcResource[TC2_INDEX]++; - if (--u4ResidualResource == 0) { - break; - } - } - - if (ai4PerTcResourceDemand[TC5_INDEX]){ /* BMCAST */ - prQM->au4CurrentTcResource[TC5_INDEX]++; - if (--u4ResidualResource == 0) { - break; - } - } - - if (ai4PerTcResourceDemand[TC1_INDEX]){ /* BE */ - prQM->au4CurrentTcResource[TC1_INDEX]++; - if (--u4ResidualResource == 0) { - break; - } - } - - if (ai4PerTcResourceDemand[TC0_INDEX]){ /* BK */ - prQM->au4CurrentTcResource[TC0_INDEX]++; - if (--u4ResidualResource == 0) { - break; - } - } - - /* Allocate the left resource */ - prQM->au4CurrentTcResource[TC3_INDEX] += u4ResidualResource; - - }while(FALSE); - } - - prQM->fgTcResourcePostAnnealing = TRUE; - -#if QM_PRINT_TC_RESOURCE_CTRL - /* Debug print */ - DBGLOG(QM, LOUD, ("QM: TC Rsc %ld %ld %ld %ld %ld %ld\n", - prQM->au4CurrentTcResource[0], - prQM->au4CurrentTcResource[1], - prQM->au4CurrentTcResource[2], - prQM->au4CurrentTcResource[3], - prQM->au4CurrentTcResource[4], - prQM->au4CurrentTcResource[5] - )); -#endif - -} - -#endif - - -/*----------------------------------------------------------------------------*/ -/* RX-Related Queue Management */ -/*----------------------------------------------------------------------------*/ -/*----------------------------------------------------------------------------*/ -/*! -* \brief Init Queue Managment for RX -* -* \param[in] (none) -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -qmInitRxQueues( - IN P_ADAPTER_T prAdapter - ) -{ - //DbgPrint("QM: Enter qmInitRxQueues()\n"); - /* TODO */ -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Handle RX packets (buffer reordering) -* -* \param[in] prSwRfbListHead The list of RX packets -* -* \return The list of packets which are not buffered for reordering -*/ -/*----------------------------------------------------------------------------*/ -P_SW_RFB_T -qmHandleRxPackets( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfbListHead - ) -{ - -#if CFG_RX_REORDERING_ENABLED - //UINT_32 i; - P_SW_RFB_T prCurrSwRfb; - P_SW_RFB_T prNextSwRfb; - P_HIF_RX_HEADER_T prHifRxHdr; - QUE_T rReturnedQue; - PUINT_8 pucEthDestAddr; - - //DbgPrint("QM: Enter qmHandleRxPackets()\n"); - - DEBUGFUNC("qmHandleRxPackets"); - - ASSERT(prSwRfbListHead); - - QUEUE_INITIALIZE(&rReturnedQue); - prNextSwRfb = prSwRfbListHead; - - do{ - prCurrSwRfb = prNextSwRfb; - prNextSwRfb = QM_RX_GET_NEXT_SW_RFB(prCurrSwRfb); - - prHifRxHdr = prCurrSwRfb->prHifRxHdr; // TODO: (Tehuang) Use macro to obtain the pointer - - /* TODO: (Tehuang) Check if relaying */ - prCurrSwRfb->eDst = RX_PKT_DESTINATION_HOST; - - /* Decide the Destination */ -#if CFG_RX_PKTS_DUMP - if (prAdapter->rRxCtrl.u4RxPktsDumpTypeMask & BIT(HIF_RX_PKT_TYPE_DATA)) { - DBGLOG(SW4, INFO, ("QM RX DATA: net %u sta idx %u wlan idx %u ssn %u tid %u ptype %u 11 %u\n", - HIF_RX_HDR_GET_NETWORK_IDX(prHifRxHdr), - prHifRxHdr->ucStaRecIdx, - prCurrSwRfb->ucWlanIdx, - HIF_RX_HDR_GET_SN(prHifRxHdr), /* The new SN of the frame */ - HIF_RX_HDR_GET_TID(prHifRxHdr), - prCurrSwRfb->ucPacketType, - HIF_RX_HDR_GET_80211_FLAG(prHifRxHdr))); - - DBGLOG_MEM8(SW4, TRACE, (PUINT_8)prCurrSwRfb->pvHeader, prCurrSwRfb->u2PacketLen); - } -#endif - // DBGLOG(RX, TRACE, ("SN=%d, TID=%d\n", HIF_RX_HDR_GET_SN(prHifRxHdr), HIF_RX_HDR_GET_TID(prHifRxHdr))); - - if (!HIF_RX_HDR_GET_80211_FLAG(prHifRxHdr)){ - - UINT_8 ucNetTypeIdx; - P_BSS_INFO_T prBssInfo; - - pucEthDestAddr = prCurrSwRfb->pvHeader; - ucNetTypeIdx = HIF_RX_HDR_GET_NETWORK_IDX(prHifRxHdr); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[ucNetTypeIdx]); - //DBGLOG_MEM8(QM, TRACE,prCurrSwRfb->pvHeader, 16); - // - - if( prAdapter->rRxCtrl.rFreeSwRfbList.u4NumElem - > (CFG_RX_MAX_PKT_NUM - CFG_NUM_OF_QM_RX_PKT_NUM) ) { - - if(IS_BSS_ACTIVE(prBssInfo)) { - if(OP_MODE_ACCESS_POINT == prBssInfo->eCurrentOPMode) { - if (IS_BMCAST_MAC_ADDR(pucEthDestAddr)){ - prCurrSwRfb->eDst = RX_PKT_DESTINATION_HOST_WITH_FORWARD; - } - else if(UNEQUAL_MAC_ADDR(prBssInfo->aucOwnMacAddr,pucEthDestAddr)) { - prCurrSwRfb->eDst = RX_PKT_DESTINATION_FORWARD; - /* TODO : need to check the dst mac is valid */ - /* If src mac is invalid, the packet will be freed in fw */ - } - } /* OP_MODE_ACCESS_POINT */ - } - else { - DBGLOG(QM, TRACE, ("Mark NULL the Packet for inactive Bss %u\n",ucNetTypeIdx)); - prCurrSwRfb->eDst = RX_PKT_DESTINATION_NULL; - QUEUE_INSERT_TAIL(&rReturnedQue, (P_QUE_ENTRY_T)prCurrSwRfb); - continue; - } - - } - else { - /* Dont not occupy other SW RFB */ - DBGLOG(QM, TRACE, ("Mark NULL the Packet for less Free Sw Rfb\n")); - prCurrSwRfb->eDst = RX_PKT_DESTINATION_NULL; - QUEUE_INSERT_TAIL(&rReturnedQue, (P_QUE_ENTRY_T)prCurrSwRfb); - continue; - } - - } - - /* BAR frame */ - if(HIF_RX_HDR_GET_BAR_FLAG(prHifRxHdr)){ - prCurrSwRfb->eDst = RX_PKT_DESTINATION_NULL; - qmProcessBarFrame(prAdapter, prCurrSwRfb, &rReturnedQue); - } - /* Reordering is not required for this packet, return it without buffering */ - else if(!HIF_RX_HDR_GET_REORDER_FLAG(prHifRxHdr)){ -#if 0 - if (!HIF_RX_HDR_GET_80211_FLAG(prHifRxHdr)){ - UINT_8 ucNetTypeIdx; - P_BSS_INFO_T prBssInfo; - - pucEthDestAddr = prCurrSwRfb->pvHeader; - ucNetTypeIdx = HIF_RX_HDR_GET_NETWORK_IDX(prHifRxHdr); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[ucNetTypeIdx]); - - if (IS_BMCAST_MAC_ADDR(pucEthDestAddr) && (OP_MODE_ACCESS_POINT == prBssInfo->eCurrentOPMode)){ - prCurrSwRfb->eDst = RX_PKT_DESTINATION_HOST_WITH_FORWARD; - } - } -#endif - QUEUE_INSERT_TAIL(&rReturnedQue, (P_QUE_ENTRY_T)prCurrSwRfb); - } - /* Reordering is required for this packet */ - else{ - /* If this packet should dropped or indicated to the host immediately, - * it should be enqueued into the rReturnedQue with specific flags. If - * this packet should be buffered for reordering, it should be enqueued - * into the reordering queue in the STA_REC rather than into the - * rReturnedQue. - */ - qmProcessPktWithReordering(prAdapter, prCurrSwRfb, &rReturnedQue); - - } - }while(prNextSwRfb); - - - /* The returned list of SW_RFBs must end with a NULL pointer */ - if(QUEUE_IS_NOT_EMPTY(&rReturnedQue)){ - QM_TX_SET_NEXT_MSDU_INFO((P_SW_RFB_T)QUEUE_GET_TAIL(&rReturnedQue), NULL); - } - - return (P_SW_RFB_T)QUEUE_GET_HEAD(&rReturnedQue); - -#else - - //DbgPrint("QM: Enter qmHandleRxPackets()\n"); - return prSwRfbListHead; - -#endif - -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Reorder the received packet -* -* \param[in] prSwRfb The RX packet to process -* \param[out] prReturnedQue The queue for indicating packets -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -qmProcessPktWithReordering( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT P_QUE_T prReturnedQue - ) -{ - - - P_STA_RECORD_T prStaRec; - P_HIF_RX_HEADER_T prHifRxHdr; - P_RX_BA_ENTRY_T prReorderQueParm; - - UINT_32 u4SeqNo; - UINT_32 u4WinStart; - UINT_32 u4WinEnd; - P_QUE_T prReorderQue; - //P_SW_RFB_T prReorderedSwRfb; - - DEBUGFUNC("qmProcessPktWithReordering"); - - ASSERT(prSwRfb); - ASSERT(prReturnedQue); - ASSERT(prSwRfb->prHifRxHdr); - - prHifRxHdr = prSwRfb->prHifRxHdr; - prSwRfb->ucStaRecIdx = prHifRxHdr->ucStaRecIdx; - prSwRfb->u2SSN = HIF_RX_HDR_GET_SN(prHifRxHdr); /* The new SN of the frame */ - prSwRfb->ucTid = (UINT_8)(HIF_RX_HDR_GET_TID(prHifRxHdr)); - //prSwRfb->eDst = RX_PKT_DESTINATION_HOST; - - /* Incorrect STA_REC index */ - if(prSwRfb->ucStaRecIdx >= CFG_NUM_OF_STA_RECORD){ - prSwRfb->eDst = RX_PKT_DESTINATION_NULL; - QUEUE_INSERT_TAIL(prReturnedQue,(P_QUE_ENTRY_T)prSwRfb); - DBGLOG(QM, WARN,("Reordering for a NULL STA_REC, ucStaRecIdx = %d\n", - prSwRfb->ucStaRecIdx)); - //ASSERT(0); - return; - } - - /* Check whether the STA_REC is activated */ - prStaRec = &(prAdapter->arStaRec[prSwRfb->ucStaRecIdx]); - ASSERT(prStaRec); - -#if 0 - if(!(prStaRec->fgIsValid)){ - /* TODO: (Tehuang) Handle the Host-FW sync issue. */ - prSwRfb->eDst = RX_PKT_DESTINATION_NULL; - QUEUE_INSERT_TAIL(prReturnedQue,(P_QUE_ENTRY_T)prSwRfb); - DBGLOG(QM, WARN, ("Reordering for an invalid STA_REC \n")); - //ASSERT(0); - return; - } -#endif - - /* Check whether the BA agreement exists */ - prReorderQueParm = ((prStaRec->aprRxReorderParamRefTbl)[prSwRfb->ucTid]); - if(!prReorderQueParm){ - /* TODO: (Tehuang) Handle the Host-FW sync issue.*/ - prSwRfb->eDst = RX_PKT_DESTINATION_NULL; - QUEUE_INSERT_TAIL(prReturnedQue,(P_QUE_ENTRY_T)prSwRfb); - DBGLOG(QM, WARN,("Reordering for a NULL ReorderQueParm \n")); - //ASSERT(0); - return; - } - - - - /* Start to reorder packets */ - u4SeqNo = (UINT_32)(prSwRfb->u2SSN); - prReorderQue = &(prReorderQueParm->rReOrderQue); - u4WinStart = (UINT_32)(prReorderQueParm->u2WinStart); - u4WinEnd = (UINT_32)(prReorderQueParm->u2WinEnd); - - /* Debug */ - //DbgPrint("QM:(R)[%d](%ld){%ld,%ld}\n", prSwRfb->ucTid, u4SeqNo, u4WinStart, u4WinEnd); - - /* Case 1: Fall within */ - if /* 0 - start - sn - end - 4095 */ - (((u4WinStart <= u4SeqNo) && (u4SeqNo <= u4WinEnd)) - /* 0 - end - start - sn - 4095 */ - || ((u4WinEnd < u4WinStart) && (u4WinStart <= u4SeqNo)) - /* 0 - sn - end - start - 4095 */ - || ((u4SeqNo <= u4WinEnd) && (u4WinEnd < u4WinStart))){ - - qmInsertFallWithinReorderPkt(prSwRfb, prReorderQueParm, prReturnedQue); - -#if QM_RX_WIN_SSN_AUTO_ADVANCING - if(prReorderQueParm->fgIsWaitingForPktWithSsn){ - /* Let the first received packet pass the reorder check */ - DBGLOG(QM, LOUD, ("QM:(A)[%d](%ld){%ld,%ld}\n", prSwRfb->ucTid, u4SeqNo, u4WinStart, u4WinEnd)); - - prReorderQueParm->u2WinStart = (UINT_16)u4SeqNo; - prReorderQueParm->u2WinEnd = - ((prReorderQueParm->u2WinStart) + (prReorderQueParm->u2WinSize) - 1) % MAX_SEQ_NO_COUNT; - prReorderQueParm->fgIsWaitingForPktWithSsn = FALSE; - } -#endif - - - qmPopOutDueToFallWithin(prReorderQueParm, prReturnedQue); - } - /* Case 2: Fall ahead */ - else if - /* 0 - start - end - sn - (start+2048) - 4095 */ - (((u4WinStart < u4WinEnd) - && (u4WinEnd < u4SeqNo) - && (u4SeqNo < (u4WinStart + HALF_SEQ_NO_COUNT))) - /* 0 - sn - (start+2048) - start - end - 4095 */ - || ((u4SeqNo < u4WinStart) - && (u4WinStart < u4WinEnd) - && ((u4SeqNo + MAX_SEQ_NO_COUNT) < (u4WinStart + HALF_SEQ_NO_COUNT))) - /* 0 - end - sn - (start+2048) - start - 4095 */ - || ((u4WinEnd < u4SeqNo) - && (u4SeqNo < u4WinStart) - && ((u4SeqNo + MAX_SEQ_NO_COUNT) < (u4WinStart + HALF_SEQ_NO_COUNT)))){ - - -#if QM_RX_WIN_SSN_AUTO_ADVANCING - if(prReorderQueParm->fgIsWaitingForPktWithSsn){ - prReorderQueParm->fgIsWaitingForPktWithSsn = FALSE; - } -#endif - - qmInsertFallAheadReorderPkt(prSwRfb, prReorderQueParm, prReturnedQue); - - /* Advance the window after inserting a new tail */ - prReorderQueParm->u2WinEnd = (UINT_16)u4SeqNo; - prReorderQueParm->u2WinStart = - (((prReorderQueParm->u2WinEnd) - (prReorderQueParm->u2WinSize) + MAX_SEQ_NO_COUNT + 1) - % MAX_SEQ_NO_COUNT); - - qmPopOutDueToFallAhead(prReorderQueParm, prReturnedQue); - - } - /* Case 3: Fall behind */ - else{ - -#if QM_RX_WIN_SSN_AUTO_ADVANCING - #if QM_RX_INIT_FALL_BEHIND_PASS - if(prReorderQueParm->fgIsWaitingForPktWithSsn){ - //?? prSwRfb->eDst = RX_PKT_DESTINATION_HOST; - QUEUE_INSERT_TAIL(prReturnedQue,(P_QUE_ENTRY_T)prSwRfb); - //DbgPrint("QM:(P)[%d](%ld){%ld,%ld}\n", prSwRfb->ucTid, u4SeqNo, u4WinStart, u4WinEnd); - return; - } - #endif -#endif - - /* An erroneous packet */ - prSwRfb->eDst = RX_PKT_DESTINATION_NULL; - QUEUE_INSERT_TAIL(prReturnedQue,(P_QUE_ENTRY_T)prSwRfb); - //DbgPrint("QM:(D)[%d](%ld){%ld,%ld}\n", prSwRfb->ucTid, u4SeqNo, u4WinStart, u4WinEnd); - return; - } - - return; - -} - - -VOID -qmProcessBarFrame( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - OUT P_QUE_T prReturnedQue - ) -{ - - P_STA_RECORD_T prStaRec; - P_HIF_RX_HEADER_T prHifRxHdr; - P_RX_BA_ENTRY_T prReorderQueParm; - - UINT_32 u4SSN; - UINT_32 u4WinStart; - UINT_32 u4WinEnd; - P_QUE_T prReorderQue; - //P_SW_RFB_T prReorderedSwRfb; - - ASSERT(prSwRfb); - ASSERT(prReturnedQue); - ASSERT(prSwRfb->prHifRxHdr); - - prHifRxHdr = prSwRfb->prHifRxHdr; - prSwRfb->ucStaRecIdx = prHifRxHdr->ucStaRecIdx; - prSwRfb->u2SSN = HIF_RX_HDR_GET_SN(prHifRxHdr); /* The new SSN */ - prSwRfb->ucTid = (UINT_8)(HIF_RX_HDR_GET_TID(prHifRxHdr)); - - prSwRfb->eDst = RX_PKT_DESTINATION_NULL; - QUEUE_INSERT_TAIL(prReturnedQue,(P_QUE_ENTRY_T)prSwRfb); - - /* Incorrect STA_REC index */ - if(prSwRfb->ucStaRecIdx >= CFG_NUM_OF_STA_RECORD){ - DBGLOG(QM, WARN, ("QM: (Warning) BAR for a NULL STA_REC, ucStaRecIdx = %d\n", - prSwRfb->ucStaRecIdx)); - //ASSERT(0); - return; - } - - /* Check whether the STA_REC is activated */ - prStaRec = &(prAdapter->arStaRec[prSwRfb->ucStaRecIdx]); - ASSERT(prStaRec); - -#if 0 - if(!(prStaRec->fgIsValid)){ - /* TODO: (Tehuang) Handle the Host-FW sync issue. */ - DbgPrint("QM: (Warning) BAR for an invalid STA_REC \n"); - //ASSERT(0); - return; - } -#endif - - /* Check whether the BA agreement exists */ - prReorderQueParm = ((prStaRec->aprRxReorderParamRefTbl)[prSwRfb->ucTid]); - if(!prReorderQueParm){ - /* TODO: (Tehuang) Handle the Host-FW sync issue.*/ - DBGLOG(QM, WARN, ("QM: (Warning) BAR for a NULL ReorderQueParm \n")); - //ASSERT(0); - return; - } - - - u4SSN = (UINT_32)(prSwRfb->u2SSN); - prReorderQue = &(prReorderQueParm->rReOrderQue); - u4WinStart = (UINT_32)(prReorderQueParm->u2WinStart); - u4WinEnd = (UINT_32)(prReorderQueParm->u2WinEnd); - - if(qmCompareSnIsLessThan(u4WinStart,u4SSN)){ - prReorderQueParm->u2WinStart = (UINT_16)u4SSN; - prReorderQueParm->u2WinEnd = - ((prReorderQueParm->u2WinStart) + (prReorderQueParm->u2WinSize) - 1) % MAX_SEQ_NO_COUNT; - DBGLOG(QM, TRACE, ("QM:(BAR)[%d](%ld){%d,%d}\n", prSwRfb->ucTid, u4SSN, prReorderQueParm->u2WinStart, prReorderQueParm->u2WinEnd)); - qmPopOutDueToFallAhead(prReorderQueParm, prReturnedQue); - } - else{ - DBGLOG(QM, TRACE, ("QM:(BAR)(%d)(%ld){%ld,%ld}\n", prSwRfb->ucTid, u4SSN, u4WinStart, u4WinEnd)); - } -} - - - -VOID -qmInsertFallWithinReorderPkt( - IN P_SW_RFB_T prSwRfb, - IN P_RX_BA_ENTRY_T prReorderQueParm, - OUT P_QUE_T prReturnedQue - ) -{ - P_SW_RFB_T prExaminedQueuedSwRfb; - P_QUE_T prReorderQue; - ASSERT(prSwRfb); - ASSERT(prReorderQueParm); - ASSERT(prReturnedQue); - - prReorderQue = &(prReorderQueParm->rReOrderQue); - prExaminedQueuedSwRfb = (P_SW_RFB_T)QUEUE_GET_HEAD(prReorderQue); - - /* There are no packets queued in the Reorder Queue */ - if(prExaminedQueuedSwRfb == NULL){ - ((P_QUE_ENTRY_T)prSwRfb)->prPrev = NULL; - ((P_QUE_ENTRY_T)prSwRfb)->prNext = NULL; - prReorderQue->prHead = (P_QUE_ENTRY_T)prSwRfb; - prReorderQue->prTail = (P_QUE_ENTRY_T)prSwRfb; - prReorderQue->u4NumElem ++; - } - - /* Determine the insert position */ - else{ - do{ - /* Case 1: Terminate. A duplicate packet */ - if(((prExaminedQueuedSwRfb->u2SSN) == (prSwRfb->u2SSN))){ - prSwRfb->eDst = RX_PKT_DESTINATION_NULL; - QUEUE_INSERT_TAIL(prReturnedQue,(P_QUE_ENTRY_T)prSwRfb); - return; - } - - /* Case 2: Terminate. The insert point is found */ - else if(qmCompareSnIsLessThan( - (prSwRfb->u2SSN),(prExaminedQueuedSwRfb->u2SSN))){ - break; - } - - /* Case 3: Insert point not found. Check the next SW_RFB in the Reorder Queue */ - else{ - prExaminedQueuedSwRfb = - (P_SW_RFB_T)(((P_QUE_ENTRY_T)prExaminedQueuedSwRfb)->prNext); - } - }while(prExaminedQueuedSwRfb); - - /* Update the Reorder Queue Parameters according to the found insert position */ - if(prExaminedQueuedSwRfb == NULL){ - /* The received packet shall be placed at the tail */ - ((P_QUE_ENTRY_T)prSwRfb)->prPrev = prReorderQue->prTail; - ((P_QUE_ENTRY_T)prSwRfb)->prNext = NULL; - (prReorderQue->prTail)->prNext = (P_QUE_ENTRY_T)(prSwRfb); - prReorderQue->prTail = (P_QUE_ENTRY_T)(prSwRfb); - } - else{ - ((P_QUE_ENTRY_T)prSwRfb)->prPrev = ((P_QUE_ENTRY_T)prExaminedQueuedSwRfb)->prPrev; - ((P_QUE_ENTRY_T)prSwRfb)->prNext = (P_QUE_ENTRY_T)prExaminedQueuedSwRfb; - if(((P_QUE_ENTRY_T)prExaminedQueuedSwRfb) == (prReorderQue->prHead)){ - /* The received packet will become the head */ - prReorderQue->prHead = (P_QUE_ENTRY_T)prSwRfb; - } - else{ - (((P_QUE_ENTRY_T)prExaminedQueuedSwRfb)->prPrev)->prNext = (P_QUE_ENTRY_T)prSwRfb; - } - ((P_QUE_ENTRY_T)prExaminedQueuedSwRfb)->prPrev = (P_QUE_ENTRY_T)prSwRfb; - } - - prReorderQue->u4NumElem ++; - - } - -} - - -VOID -qmInsertFallAheadReorderPkt( - IN P_SW_RFB_T prSwRfb, - IN P_RX_BA_ENTRY_T prReorderQueParm, - OUT P_QUE_T prReturnedQue - ) -{ - P_QUE_T prReorderQue; - ASSERT(prSwRfb); - ASSERT(prReorderQueParm); - ASSERT(prReturnedQue); - - prReorderQue = &(prReorderQueParm->rReOrderQue); - - /* There are no packets queued in the Reorder Queue */ - if(QUEUE_IS_EMPTY(prReorderQue)){ - ((P_QUE_ENTRY_T)prSwRfb)->prPrev = NULL; - ((P_QUE_ENTRY_T)prSwRfb)->prNext = NULL; - prReorderQue->prHead = (P_QUE_ENTRY_T)prSwRfb; - } - else{ - ((P_QUE_ENTRY_T)prSwRfb)->prPrev = prReorderQue->prTail; - ((P_QUE_ENTRY_T)prSwRfb)->prNext = NULL; - (prReorderQue->prTail)->prNext = (P_QUE_ENTRY_T)(prSwRfb); - } - prReorderQue->prTail = (P_QUE_ENTRY_T)prSwRfb; - prReorderQue->u4NumElem ++; - -} - - -VOID -qmPopOutDueToFallWithin( - IN P_RX_BA_ENTRY_T prReorderQueParm, - OUT P_QUE_T prReturnedQue - ) -{ - P_SW_RFB_T prReorderedSwRfb; - P_QUE_T prReorderQue; - BOOLEAN fgDequeuHead, fgMissing; - OS_SYSTIME rCurrentTime, *prMissTimeout; - - prReorderQue = &(prReorderQueParm->rReOrderQue); - fgMissing = FALSE; - rCurrentTime = 0; - prMissTimeout = &(g_arMissTimeout[prReorderQueParm->ucStaRecIdx][prReorderQueParm->ucTid]); - if (*prMissTimeout) { - fgMissing = TRUE; - GET_CURRENT_SYSTIME(&rCurrentTime); - } - - /* Check whether any packet can be indicated to the higher layer */ - while(TRUE){ - if(QUEUE_IS_EMPTY(prReorderQue)){ - break; - } - - /* Always examine the head packet */ - prReorderedSwRfb = (P_SW_RFB_T)QUEUE_GET_HEAD(prReorderQue); - fgDequeuHead = FALSE; - - /* SN == WinStart, so the head packet shall be indicated (advance the window) */ - if((prReorderedSwRfb->u2SSN) == (prReorderQueParm->u2WinStart)){ - - fgDequeuHead = TRUE; - prReorderQueParm->u2WinStart = - (((prReorderedSwRfb->u2SSN) + 1)% MAX_SEQ_NO_COUNT); - } - /* SN > WinStart, break to update WinEnd */ - else{ - if (TRUE == fgMissing && - CHECK_FOR_TIMEOUT(rCurrentTime, (*prMissTimeout), - //MSEC_TO_SEC(QM_RX_BA_ENTRY_MISS_TIMEOUT_MS))) { - MSEC_TO_SYSTIME(QM_RX_BA_ENTRY_MISS_TIMEOUT_MS))) { - DBGLOG(QM, TRACE, ("RX BA timeout, next tid %d, SSN %d\n", - prReorderQueParm->ucTid, prReorderedSwRfb->u2SSN)); - fgDequeuHead = TRUE; - prReorderQueParm->u2WinStart = (((prReorderedSwRfb->u2SSN) + 1) % MAX_SEQ_NO_COUNT); - fgMissing = FALSE; - - } - else { - break; - } - } - - - /* Dequeue the head packet */ - if(fgDequeuHead){ - - if(((P_QUE_ENTRY_T)prReorderedSwRfb)->prNext == NULL){ - prReorderQue->prHead = NULL; - prReorderQue->prTail = NULL; - } - else{ - prReorderQue->prHead = ((P_QUE_ENTRY_T)prReorderedSwRfb)->prNext; - (((P_QUE_ENTRY_T)prReorderedSwRfb)->prNext)->prPrev = NULL; - } - prReorderQue->u4NumElem --; - //DbgPrint("QM: [%d] %d (%d)\n", prReorderQueParm->ucTid, prReorderedSwRfb->u2PacketLen, prReorderedSwRfb->u2SSN); - QUEUE_INSERT_TAIL(prReturnedQue,(P_QUE_ENTRY_T)prReorderedSwRfb); - } - } - - if (QUEUE_IS_EMPTY(prReorderQue)) { - *prMissTimeout = 0; - } - else { - if (FALSE == fgMissing) { - GET_CURRENT_SYSTIME(prMissTimeout); - } - } - /* After WinStart has been determined, update the WinEnd */ - prReorderQueParm->u2WinEnd = - (((prReorderQueParm->u2WinStart) + (prReorderQueParm->u2WinSize) -1 )% MAX_SEQ_NO_COUNT); - -} - -VOID -qmPopOutDueToFallAhead( - IN P_RX_BA_ENTRY_T prReorderQueParm, - OUT P_QUE_T prReturnedQue - ) -{ - P_SW_RFB_T prReorderedSwRfb; - P_QUE_T prReorderQue; - BOOLEAN fgDequeuHead; - - prReorderQue = &(prReorderQueParm->rReOrderQue); - - /* Check whether any packet can be indicated to the higher layer */ - while(TRUE){ - if(QUEUE_IS_EMPTY(prReorderQue)){ - break; - } - - /* Always examine the head packet */ - prReorderedSwRfb = (P_SW_RFB_T)QUEUE_GET_HEAD(prReorderQue); - fgDequeuHead = FALSE; - - /* SN == WinStart, so the head packet shall be indicated (advance the window) */ - if((prReorderedSwRfb->u2SSN) == (prReorderQueParm->u2WinStart)){ - - fgDequeuHead = TRUE; - prReorderQueParm->u2WinStart = - (((prReorderedSwRfb->u2SSN) + 1)% MAX_SEQ_NO_COUNT); - } - - /* SN < WinStart, so the head packet shall be indicated (do not advance the window) */ - else if(qmCompareSnIsLessThan( - (UINT_32)(prReorderedSwRfb->u2SSN), - (UINT_32)(prReorderQueParm->u2WinStart))){ - - fgDequeuHead = TRUE; - - } - - /* SN > WinStart, break to update WinEnd */ - else{ - break; - } - - - /* Dequeue the head packet */ - if(fgDequeuHead){ - - if(((P_QUE_ENTRY_T)prReorderedSwRfb)->prNext == NULL){ - prReorderQue->prHead = NULL; - prReorderQue->prTail = NULL; - } - else{ - prReorderQue->prHead = ((P_QUE_ENTRY_T)prReorderedSwRfb)->prNext; - (((P_QUE_ENTRY_T)prReorderedSwRfb)->prNext)->prPrev = NULL; - } - prReorderQue->u4NumElem --; - //DbgPrint("QM: [%d] %d (%d)\n", prReorderQueParm->ucTid, prReorderedSwRfb->u2PacketLen, prReorderedSwRfb->u2SSN); - QUEUE_INSERT_TAIL(prReturnedQue,(P_QUE_ENTRY_T)prReorderedSwRfb); - } - } - - /* After WinStart has been determined, update the WinEnd */ - prReorderQueParm->u2WinEnd = - (((prReorderQueParm->u2WinStart) + (prReorderQueParm->u2WinSize) -1)% MAX_SEQ_NO_COUNT); - -} - -BOOLEAN -qmCompareSnIsLessThan( - IN UINT_32 u4SnLess, - IN UINT_32 u4SnGreater - ) -{ - /* 0 <---> SnLess <--(gap>2048)--> SnGreater : SnLess > SnGreater */ - if((u4SnLess + HALF_SEQ_NO_COUNT) <= u4SnGreater){ /* Shall be <= */ - return FALSE; - } - - /* 0 <---> SnGreater <--(gap>2048)--> SnLess : SnLess < SnGreater */ - else if((u4SnGreater + HALF_SEQ_NO_COUNT) < u4SnLess){ - return TRUE; - } - - /* 0 <---> SnGreater <--(gap<2048)--> SnLess : SnLess > SnGreater */ - /* 0 <---> SnLess <--(gap<2048)--> SnGreater : SnLess < SnGreater */ - else{ - return (u4SnLess < u4SnGreater); - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Handle Mailbox RX messages -* -* \param[in] prMailboxRxMsg The received Mailbox message from the FW -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -qmHandleMailboxRxMessage( - IN MAILBOX_MSG_T prMailboxRxMsg - ) -{ - //DbgPrint("QM: Enter qmHandleMailboxRxMessage()\n"); - /* TODO */ -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Handle ADD RX BA Event from the FW -* -* \param[in] prAdapter Adapter pointer -* \param[in] prEvent The event packet from the FW -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -qmHandleEventRxAddBa( - IN P_ADAPTER_T prAdapter, - IN P_WIFI_EVENT_T prEvent - ) -{ - P_EVENT_RX_ADDBA_T prEventRxAddBa; - P_STA_RECORD_T prStaRec; - UINT_32 u4Tid; - UINT_32 u4WinSize; - - DBGLOG(QM, INFO, ("QM:Event +RxBa\n")); - - prEventRxAddBa = (P_EVENT_RX_ADDBA_T)prEvent; - prStaRec = QM_GET_STA_REC_PTR_FROM_INDEX(prAdapter, prEventRxAddBa->ucStaRecIdx); - - if(!prStaRec){ - /* Invalid STA_REC index, discard the event packet */ - //ASSERT(0); - DBGLOG(QM, INFO, ("QM: (Warning) RX ADDBA Event for a NULL STA_REC\n")); - return; - } - -#if 0 - if(!(prStaRec->fgIsValid)){ - /* TODO: (Tehuang) Handle the Host-FW synchronization issue */ - DBGLOG(QM, WARN, ("QM: (Warning) RX ADDBA Event for an invalid STA_REC\n")); - //ASSERT(0); - //return; - } -#endif - - u4Tid = (((prEventRxAddBa->u2BAParameterSet)& BA_PARAM_SET_TID_MASK) - >> BA_PARAM_SET_TID_MASK_OFFSET); - - u4WinSize = (((prEventRxAddBa->u2BAParameterSet)& BA_PARAM_SET_BUFFER_SIZE_MASK) - >> BA_PARAM_SET_BUFFER_SIZE_MASK_OFFSET); - - if(!qmAddRxBaEntry( - prAdapter, - prStaRec->ucIndex, - (UINT_8)u4Tid, - (prEventRxAddBa->u2BAStartSeqCtrl >> OFFSET_BAR_SSC_SN), - (UINT_16)u4WinSize)){ - - /* FW shall ensure the availabiilty of the free-to-use BA entry */ - DBGLOG(QM, ERROR, ("QM: (Error) qmAddRxBaEntry() failure\n")); - ASSERT(0); - } - -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Handle DEL RX BA Event from the FW -* -* \param[in] prAdapter Adapter pointer -* \param[in] prEvent The event packet from the FW -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -qmHandleEventRxDelBa( - IN P_ADAPTER_T prAdapter, - IN P_WIFI_EVENT_T prEvent - ) -{ - P_EVENT_RX_DELBA_T prEventRxDelBa; - P_STA_RECORD_T prStaRec; - - //DbgPrint("QM:Event -RxBa\n"); - - prEventRxDelBa = (P_EVENT_RX_DELBA_T)prEvent; - prStaRec = QM_GET_STA_REC_PTR_FROM_INDEX(prAdapter, prEventRxDelBa->ucStaRecIdx); - - if(!prStaRec){ - /* Invalid STA_REC index, discard the event packet */ - //ASSERT(0); - return; - } - -#if 0 - if(!(prStaRec->fgIsValid)){ - /* TODO: (Tehuang) Handle the Host-FW synchronization issue */ - //ASSERT(0); - return; - } -#endif - - qmDelRxBaEntry(prAdapter, prStaRec->ucIndex, prEventRxDelBa->ucTid, TRUE); - -} - -P_RX_BA_ENTRY_T -qmLookupRxBaEntry( - IN P_ADAPTER_T prAdapter, - UINT_8 ucStaRecIdx, - UINT_8 ucTid - ) -{ - int i; - P_QUE_MGT_T prQM = &prAdapter->rQM; - - //DbgPrint("QM: Enter qmLookupRxBaEntry()\n"); - - for(i=0; iarRxBaTable[i].fgIsValid){ - if((prQM->arRxBaTable[i].ucStaRecIdx == ucStaRecIdx) && - (prQM->arRxBaTable[i].ucTid == ucTid)){ - return &prQM->arRxBaTable[i]; - } - } - } - return NULL; -} - -BOOL -qmAddRxBaEntry( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucStaRecIdx, - IN UINT_8 ucTid, - IN UINT_16 u2WinStart, - IN UINT_16 u2WinSize - ) -{ - int i; - P_RX_BA_ENTRY_T prRxBaEntry = NULL; - P_STA_RECORD_T prStaRec; - P_QUE_MGT_T prQM = &prAdapter->rQM; - - ASSERT(ucStaRecIdx < CFG_NUM_OF_STA_RECORD); - - if(ucStaRecIdx >= CFG_NUM_OF_STA_RECORD){ - /* Invalid STA_REC index, discard the event packet */ - DBGLOG(QM, WARN, ("QM: (WARNING) RX ADDBA Event for a invalid ucStaRecIdx = %d\n", ucStaRecIdx)); - return FALSE; - } - - prStaRec = &prAdapter->arStaRec[ucStaRecIdx]; - ASSERT(prStaRec); - - //if(!(prStaRec->fgIsValid)){ - // DbgPrint("QM: (WARNING) Invalid STA when adding an RX BA \n"); - // return FALSE; - //} - - //4 <1> Delete before adding - /* Remove the BA entry for the same (STA, TID) tuple if it exists */ - if(qmLookupRxBaEntry(prAdapter, ucStaRecIdx,ucTid)){ - qmDelRxBaEntry(prAdapter, ucStaRecIdx, ucTid, TRUE); /* prQM->ucRxBaCount-- */ - } - - //4 <2> Add a new BA entry - /* No available entry to store the BA agreement info. Retrun FALSE. */ - if(prQM->ucRxBaCount >= CFG_NUM_OF_RX_BA_AGREEMENTS){ - DBGLOG(QM, ERROR, ("QM: **failure** (limited resource, ucRxBaCount=%d)\n", prQM->ucRxBaCount)); - return FALSE; - } - else{ - /* Find the free-to-use BA entry */ - for(i=0; iarRxBaTable[i].fgIsValid){ - prRxBaEntry = &(prQM->arRxBaTable[i]); - prQM->ucRxBaCount++; - DBGLOG(QM, LOUD, ("QM: ucRxBaCount=%d\n", prQM->ucRxBaCount)); - break; - } - } - - /* If a free-to-use entry is found, configure it and associate it with the STA_REC */ - u2WinSize += CFG_RX_BA_INC_SIZE; - if(prRxBaEntry){ - prRxBaEntry->ucStaRecIdx = ucStaRecIdx; - prRxBaEntry->ucTid = ucTid; - prRxBaEntry->u2WinStart = u2WinStart; - prRxBaEntry->u2WinSize= u2WinSize; - prRxBaEntry->u2WinEnd = ((u2WinStart + u2WinSize - 1) % MAX_SEQ_NO_COUNT); - prRxBaEntry->fgIsValid = TRUE; - prRxBaEntry->fgIsWaitingForPktWithSsn = TRUE; - - g_arMissTimeout[ucStaRecIdx][ucTid] = 0; - - DBGLOG(QM, INFO, ("QM: +RxBA(STA=%d TID=%d WinStart=%d WinEnd=%d WinSize=%d)\n", - ucStaRecIdx, ucTid, - prRxBaEntry->u2WinStart, prRxBaEntry->u2WinEnd, prRxBaEntry->u2WinSize)); - - /* Update the BA entry reference table for per-packet lookup */ - prStaRec->aprRxReorderParamRefTbl[ucTid] = prRxBaEntry; - } - else{ - /* This shall not happen because FW should keep track of the usage of RX BA entries */ - DBGLOG(QM, ERROR, ("QM: **AddBA Error** (ucRxBaCount=%d)\n", prQM->ucRxBaCount)); - return FALSE; - } - } - - return TRUE; -} -VOID -qmDelRxBaEntry( - IN P_ADAPTER_T prAdapter, - IN UINT_8 ucStaRecIdx, - IN UINT_8 ucTid, - IN BOOLEAN fgFlushToHost - ) -{ - P_RX_BA_ENTRY_T prRxBaEntry; - P_STA_RECORD_T prStaRec; - P_SW_RFB_T prFlushedPacketList = NULL; - P_QUE_MGT_T prQM = &prAdapter->rQM; - - ASSERT(ucStaRecIdx < CFG_NUM_OF_STA_RECORD); - - prStaRec = &prAdapter->arStaRec[ucStaRecIdx]; - ASSERT(prStaRec); - -#if 0 - if(!(prStaRec->fgIsValid)){ - DbgPrint("QM: (WARNING) Invalid STA when deleting an RX BA \n"); - return; - } -#endif - - /* Remove the BA entry for the same (STA, TID) tuple if it exists */ - prRxBaEntry = prStaRec->aprRxReorderParamRefTbl[ucTid]; - - if(prRxBaEntry){ - - prFlushedPacketList = qmFlushStaRxQueue(prAdapter, ucStaRecIdx, ucTid); - - if(prFlushedPacketList){ - - if(fgFlushToHost) { - wlanProcessQueuedSwRfb(prAdapter, prFlushedPacketList); - } - else { - - P_SW_RFB_T prSwRfb; - P_SW_RFB_T prNextSwRfb; - prSwRfb = prFlushedPacketList; - - do { - prNextSwRfb = (P_SW_RFB_T)QUEUE_GET_NEXT_ENTRY((P_QUE_ENTRY_T)prSwRfb); - nicRxReturnRFB(prAdapter, prSwRfb); - prSwRfb = prNextSwRfb; - } while(prSwRfb); - - } - - - } -#if ((QM_TEST_MODE == 0) && (QM_TEST_STA_REC_DEACTIVATION == 0)) - /* Update RX BA entry state. Note that RX queue flush is not done here */ - prRxBaEntry->fgIsValid = FALSE; - prQM->ucRxBaCount--; - - /* Debug */ - #if 0 - DbgPrint("QM: ucRxBaCount=%d\n", prQM->ucRxBaCount); - #endif - - /* Update STA RX BA table */ - prStaRec->aprRxReorderParamRefTbl[ucTid] = NULL; -#endif - - DBGLOG(QM, INFO, ("QM: -RxBA(STA=%d,TID=%d)\n", ucStaRecIdx, ucTid)); - - } - - - /* Debug */ - #if CFG_HIF_RX_STARVATION_WARNING - { - P_RX_CTRL_T prRxCtrl; - prRxCtrl = &prAdapter->rRxCtrl; - DBGLOG(QM, TRACE, ("QM: (RX DEBUG) Enqueued: %d / Dequeued: %d\n", prRxCtrl->u4QueuedCnt, prRxCtrl->u4DequeuedCnt)); - } - #endif -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To process WMM related IEs in ASSOC_RSP -* -* \param[in] prAdapter Adapter pointer -* \param[in] prSwRfb The received frame -* \param[in] pucIE The pointer to the first IE in the frame -* \param[in] u2IELength The total length of IEs in the frame -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -mqmProcessAssocReq ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN PUINT_8 pucIE, - IN UINT_16 u2IELength - ) -{ - P_STA_RECORD_T prStaRec; - UINT_16 u2Offset; - PUINT_8 pucIEStart; - UINT_8 aucWfaOui[] = VENDOR_OUI_WFA; - P_IE_WMM_INFO_T prIeWmmInfo; - - DEBUGFUNC("mqmProcessAssocReq"); - - ASSERT(prSwRfb); - ASSERT(pucIE); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - ASSERT(prStaRec); - - if(prStaRec == NULL) { - return; - } - - prStaRec->fgIsQoS = FALSE; - prStaRec->fgIsWmmSupported = prStaRec->fgIsUapsdSupported = FALSE; - - pucIEStart = pucIE; - - /* If the device does not support QoS or if WMM is not supported by the peer, exit.*/ - if (!prAdapter->rWifiVar.fgSupportQoS) { - return; - } - - - /* Determine whether QoS is enabled with the association */ - else{ - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - switch (IE_ID(pucIE)) { - case ELEM_ID_WMM: - - if((WMM_IE_OUI_TYPE(pucIE) == VENDOR_OUI_TYPE_WMM) && - (!kalMemCmp(WMM_IE_OUI(pucIE),aucWfaOui,3))){ - - switch(WMM_IE_OUI_SUBTYPE(pucIE)){ - case VENDOR_OUI_SUBTYPE_WMM_INFO: - { - - UINT_8 ucQosInfo; - UINT_8 ucQosInfoAC; - UINT_8 ucBmpAC; - if(IE_LEN(pucIE) != 7){ - break; /* WMM Info IE with a wrong length */ - } - prStaRec->fgIsQoS = TRUE; - prStaRec->fgIsWmmSupported = TRUE; - - prIeWmmInfo = (P_IE_WMM_INFO_T)pucIE; - ucQosInfo = prIeWmmInfo->ucQosInfo; - ucQosInfoAC = ucQosInfo & BITS(0, 3); - - prStaRec->fgIsUapsdSupported = ((ucQosInfoAC)? TRUE: FALSE) & - prAdapter->rWifiVar.fgSupportUAPSD; - - ucBmpAC = 0; - - if( ucQosInfoAC & WMM_QOS_INFO_VO_UAPSD) { - ucBmpAC |= BIT(ACI_VO); - } - if( ucQosInfoAC & WMM_QOS_INFO_VI_UAPSD) { - ucBmpAC |= BIT(ACI_VI); - } - if( ucQosInfoAC & WMM_QOS_INFO_BE_UAPSD) { - ucBmpAC |= BIT(ACI_BE); - } - if( ucQosInfoAC & WMM_QOS_INFO_BK_UAPSD) { - ucBmpAC |= BIT(ACI_BK); - } - - prStaRec->ucBmpTriggerAC = prStaRec->ucBmpDeliveryAC = ucBmpAC; - - prStaRec->ucUapsdSp = (ucQosInfo & WMM_QOS_INFO_MAX_SP_LEN_MASK) >> 5; - - } - break; - - default: - /* Other WMM QoS IEs. Ignore any */ - break; - } - } - /* else: VENDOR_OUI_TYPE_WPA, VENDOR_OUI_TYPE_WPS */ - - break; - - case ELEM_ID_HT_CAP: - /* Some client won't put the WMM IE if client is 802.11n */ - if (IE_LEN(pucIE) == (sizeof(IE_HT_CAP_T) - 2)) { - prStaRec->fgIsQoS = TRUE; - } - break; - default: - break; - } - } - - DBGLOG(QM, TRACE, ("MQM: Assoc_Req Parsing (QoS Enabled=%d)\n", prStaRec->fgIsQoS)); - - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To process WMM related IEs in ASSOC_RSP -* -* \param[in] prAdapter Adapter pointer -* \param[in] prSwRfb The received frame -* \param[in] pucIE The pointer to the first IE in the frame -* \param[in] u2IELength The total length of IEs in the frame -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -mqmProcessAssocRsp ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN PUINT_8 pucIE, - IN UINT_16 u2IELength - ) -{ - P_STA_RECORD_T prStaRec; - UINT_16 u2Offset; - PUINT_8 pucIEStart; - UINT_8 aucWfaOui[] = VENDOR_OUI_WFA; - - DEBUGFUNC("mqmProcessAssocRsp"); - - ASSERT(prSwRfb); - ASSERT(pucIE); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - ASSERT(prStaRec); - - if(prStaRec == NULL) { - return; - } - - prStaRec->fgIsQoS = FALSE; - - pucIEStart = pucIE; - - DBGLOG(QM, TRACE, ("QM: (fgIsWmmSupported=%d, fgSupportQoS=%d)\n", - prStaRec->fgIsWmmSupported, prAdapter->rWifiVar.fgSupportQoS)); - - /* If the device does not support QoS or if WMM is not supported by the peer, exit.*/ - //if((!prAdapter->rWifiVar.fgSupportQoS) || (!prStaRec->fgIsWmmSupported)) - if((!prAdapter->rWifiVar.fgSupportQoS)) - { - return; - } - - /* Determine whether QoS is enabled with the association */ - else{ - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - switch (IE_ID(pucIE)) { - case ELEM_ID_WMM: - if((WMM_IE_OUI_TYPE(pucIE) == VENDOR_OUI_TYPE_WMM) && - (!kalMemCmp(WMM_IE_OUI(pucIE),aucWfaOui,3))){ - - switch(WMM_IE_OUI_SUBTYPE(pucIE)){ - case VENDOR_OUI_SUBTYPE_WMM_PARAM: - if(IE_LEN(pucIE) != 24){ - break; /* WMM Info IE with a wrong length */ - } - prStaRec->fgIsQoS = TRUE; - break; - - case VENDOR_OUI_SUBTYPE_WMM_INFO: - if(IE_LEN(pucIE) != 7){ - break; /* WMM Info IE with a wrong length */ - } - prStaRec->fgIsQoS = TRUE; - break; - - default: - /* Other WMM QoS IEs. Ignore any */ - break; - } - } - /* else: VENDOR_OUI_TYPE_WPA, VENDOR_OUI_TYPE_WPS */ - break; - - case ELEM_ID_HT_CAP: - /* Some AP won't put the WMM IE if client is 802.11n */ - if ( IE_LEN(pucIE) == (sizeof(IE_HT_CAP_T) - 2)) { - prStaRec->fgIsQoS = TRUE; - } - break; - default: - break; - } - } - - /* Parse AC parameters and write to HW CRs */ - if((prStaRec->fgIsQoS) && (prStaRec->eStaType == STA_TYPE_LEGACY_AP)){ - mqmParseEdcaParameters(prAdapter, prSwRfb, pucIEStart, u2IELength, TRUE); - } - - DBGLOG(QM, TRACE, ("MQM: Assoc_Rsp Parsing (QoS Enabled=%d)\n", prStaRec->fgIsQoS)); - if(prStaRec->fgIsWmmSupported) { - nicQmUpdateWmmParms(prAdapter, prStaRec->ucNetTypeIndex); - } - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To parse WMM Parameter IE (in BCN or Assoc_Rsp) -* -* \param[in] prAdapter Adapter pointer -* \param[in] prSwRfb The received frame -* \param[in] pucIE The pointer to the first IE in the frame -* \param[in] u2IELength The total length of IEs in the frame -* \param[in] fgForceOverride TRUE: If EDCA parameters are found, always set to HW CRs. -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -mqmParseEdcaParameters ( - IN P_ADAPTER_T prAdapter, - IN P_SW_RFB_T prSwRfb, - IN PUINT_8 pucIE, - IN UINT_16 u2IELength, - IN BOOLEAN fgForceOverride - ) -{ - P_STA_RECORD_T prStaRec; - UINT_16 u2Offset; - UINT_8 aucWfaOui[] = VENDOR_OUI_WFA; - P_BSS_INFO_T prBssInfo; - - DEBUGFUNC("mqmParseEdcaParameters"); - - ASSERT(prSwRfb); - ASSERT(pucIE); - - prStaRec = cnmGetStaRecByIndex(prAdapter, prSwRfb->ucStaRecIdx); - ASSERT(prStaRec); - - if(prStaRec == NULL) { - return; - } - - DBGLOG(QM, TRACE, ("QM: (fgIsWmmSupported=%d, fgIsQoS=%d)\n", - prStaRec->fgIsWmmSupported, prStaRec->fgIsQoS)); - - if((!prAdapter->rWifiVar.fgSupportQoS) || (!prStaRec->fgIsWmmSupported) || (!prStaRec->fgIsQoS)){ - return; - } - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]); - - /* Goal: Obtain the EDCA parameters */ - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - switch (IE_ID(pucIE)) { - case ELEM_ID_WMM: - - if((WMM_IE_OUI_TYPE(pucIE) == VENDOR_OUI_TYPE_WMM) && - (!kalMemCmp(WMM_IE_OUI(pucIE),aucWfaOui,3))){ - - switch(WMM_IE_OUI_SUBTYPE(pucIE)){ - case VENDOR_OUI_SUBTYPE_WMM_PARAM: - if(IE_LEN(pucIE) != 24){ - break; /* WMM Param IE with a wrong length */ - } - else{ - P_AC_QUE_PARMS_T prAcQueParams; - P_IE_WMM_PARAM_T prIeWmmParam; - ENUM_WMM_ACI_T eAci; - PUINT_8 pucWmmParamSetCount; - //int i; - - pucWmmParamSetCount = &(prBssInfo->ucWmmParamSetCount); - - prIeWmmParam = (P_IE_WMM_PARAM_T)pucIE; - - /* Check the Parameter Set Count to determine whether EDCA parameters have been changed */ - if(!fgForceOverride){ - if(*pucWmmParamSetCount == (prIeWmmParam->ucQosInfo & WMM_QOS_INFO_PARAM_SET_CNT)){ - break; /* Ignore the IE without updating HW CRs */ - } - } - - /* Update Parameter Set Count */ - *pucWmmParamSetCount = (prIeWmmParam->ucQosInfo & WMM_QOS_INFO_PARAM_SET_CNT); - - /* Update EDCA parameters */ - for(eAci = 0; eAci < WMM_AC_INDEX_NUM; eAci++){ - - prAcQueParams = &prBssInfo->arACQueParms[eAci]; - mqmFillAcQueParam(prIeWmmParam, eAci, prAcQueParams); - - prAcQueParams->fgIsACMSet = - (prAcQueParams->u2Aifsn & WMM_ACIAIFSN_ACM) ? TRUE : FALSE; - prAcQueParams->u2Aifsn &= WMM_ACIAIFSN_AIFSN; - - DBGLOG(QM, LOUD, ("MQM: eAci = %d, ACM = %d, Aifsn = %d, CWmin = %d, CWmax = %d, TxopLimit = %d\n", - eAci, prAcQueParams->fgIsACMSet, - prAcQueParams->u2Aifsn, prAcQueParams->u2CWmin, - prAcQueParams->u2CWmax, prAcQueParams->u2TxopLimit)); - } - } - break; - - default: - /* Other WMM QoS IEs. Ignore */ - break; - } - - } - /* else: VENDOR_OUI_TYPE_WPA, VENDOR_OUI_TYPE_WPS, ... (not cared) */ - break; - default: - break; - } - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is used for parsing EDCA parameters specified in the WMM Parameter IE -* -* \param[in] prAdapter Adapter pointer -* \param[in] prIeWmmParam The pointer to the WMM Parameter IE -* \param[in] u4AcOffset The offset specifying the AC queue for parsing -* \param[in] prHwAcParams The parameter structure used to configure the HW CRs -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -mqmFillAcQueParam( - IN P_IE_WMM_PARAM_T prIeWmmParam, - IN UINT_32 u4AcOffset, - OUT P_AC_QUE_PARMS_T prAcQueParams - ) -{ - prAcQueParams->u2Aifsn = *((PUINT_8)(&(prIeWmmParam->ucAciAifsn_BE)) + (u4AcOffset * 4)); - - prAcQueParams->u2CWmax = - BIT(((*((PUINT_8)(&(prIeWmmParam->ucEcw_BE)) + (u4AcOffset * 4))) & WMM_ECW_WMAX_MASK) - >> WMM_ECW_WMAX_OFFSET)-1; - - prAcQueParams->u2CWmin = - BIT((*((PUINT_8)(&(prIeWmmParam->ucEcw_BE)) + (u4AcOffset * 4))) & WMM_ECW_WMIN_MASK)-1; - - WLAN_GET_FIELD_16(((PUINT_8)(&(prIeWmmParam->aucTxopLimit_BE)) + (u4AcOffset * 4)),&(prAcQueParams->u2TxopLimit)); - - prAcQueParams->ucGuradTime = TXM_DEFAULT_FLUSH_QUEUE_GUARD_TIME; - - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To parse WMM/11n related IEs in scan results (only for AP peers) -* -* \param[in] prAdapter Adapter pointer -* \param[in] prScanResult The scan result which shall be parsed to obtain needed info -* \param[out] prStaRec The obtained info is stored in the STA_REC -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -mqmProcessScanResult( - IN P_ADAPTER_T prAdapter, - IN P_BSS_DESC_T prScanResult, - OUT P_STA_RECORD_T prStaRec - ) -{ - PUINT_8 pucIE; - UINT_16 u2IELength; - UINT_16 u2Offset; - UINT_8 aucWfaOui[] = VENDOR_OUI_WFA; - - DEBUGFUNC("mqmProcessScanResult"); - - ASSERT(prScanResult); - ASSERT(prStaRec); - - /* Reset the flag before parsing */ - prStaRec->fgIsWmmSupported = prStaRec->fgIsUapsdSupported = FALSE; - - if (!prAdapter->rWifiVar.fgSupportQoS){ - return; - } - - u2IELength = prScanResult->u2IELength; - pucIE = prScanResult->aucIEBuf; - - /* Goal: Determine whether the peer supports WMM/QoS and UAPSDU */ - IE_FOR_EACH(pucIE, u2IELength, u2Offset) { - switch (IE_ID(pucIE)) { - case ELEM_ID_WMM: - if((WMM_IE_OUI_TYPE(pucIE) == VENDOR_OUI_TYPE_WMM) && - (!kalMemCmp(WMM_IE_OUI(pucIE),aucWfaOui,3))){ - - switch(WMM_IE_OUI_SUBTYPE(pucIE)){ - case VENDOR_OUI_SUBTYPE_WMM_PARAM: - if(IE_LEN(pucIE) != 24){ - break; /* WMM Param IE with a wrong length */ - } - else{ - prStaRec->fgIsWmmSupported = TRUE; - prStaRec->fgIsUapsdSupported = (((((P_IE_WMM_PARAM_T)pucIE)->ucQosInfo) & WMM_QOS_INFO_UAPSD)? TRUE: FALSE); - } - break; - - case VENDOR_OUI_SUBTYPE_WMM_INFO: - if(IE_LEN(pucIE) != 7){ - break; /* WMM Info IE with a wrong length */ - } - else{ - prStaRec->fgIsWmmSupported = TRUE; - prStaRec->fgIsUapsdSupported = (((((P_IE_WMM_INFO_T)pucIE)->ucQosInfo) & WMM_QOS_INFO_UAPSD)? TRUE: FALSE); - } - break; - - default: - /* A WMM QoS IE that doesn't matter. Ignore it. */ - break; - } - } - /* else: VENDOR_OUI_TYPE_WPA, VENDOR_OUI_TYPE_WPS, ... (not cared) */ - - break; - - default: - /* A WMM IE that doesn't matter. Ignore it. */ - break; - } - } - DBGLOG(QM, LOUD, ("MQM: Scan Result Parsing (WMM=%d, UAPSD=%d)\n", - prStaRec->fgIsWmmSupported, prStaRec->fgIsUapsdSupported)); - -} - -UINT_8 -qmGetStaRecIdx( - IN P_ADAPTER_T prAdapter, - IN PUINT_8 pucEthDestAddr, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType - ) -{ - UINT_32 i; - P_STA_RECORD_T prTempStaRec; - - prTempStaRec = NULL; - - ASSERT(prAdapter); - - //4 <1> DA = BMCAST - if(IS_BMCAST_MAC_ADDR(pucEthDestAddr)){ - return STA_REC_INDEX_BMCAST; - } - - - //4 <2> Check if an AP STA is present - for(i = 0; i < CFG_NUM_OF_STA_RECORD; i++){ - prTempStaRec = &(prAdapter->arStaRec[i]); - if((prTempStaRec->ucNetTypeIndex == eNetworkType) - && (prTempStaRec->fgIsAp) - && (prTempStaRec->fgIsValid)){ - return prTempStaRec->ucIndex; - } - } - - //4 <3> Not BMCAST, No AP --> Compare DA (i.e., to see whether this is a unicast frame to a client) - for(i = 0; i < CFG_NUM_OF_STA_RECORD; i++){ - prTempStaRec = &(prAdapter->arStaRec[i]); - if(prTempStaRec->fgIsValid){ - if(EQUAL_MAC_ADDR(prTempStaRec->aucMacAddr, pucEthDestAddr)){ - return prTempStaRec->ucIndex; - } - } - } - - - //4 <4> No STA found, Not BMCAST --> Indicate NOT_FOUND to FW - return STA_REC_INDEX_NOT_FOUND; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Generate the WMM Info IE -* -* \param[in] prAdapter Adapter pointer -* @param prMsduInfo The TX MMPDU -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -mqmGenerateWmmInfoIE ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - P_IE_WMM_INFO_T prIeWmmInfo; - UINT_32 ucUapsd[] = { - WMM_QOS_INFO_BE_UAPSD, - WMM_QOS_INFO_BK_UAPSD, - WMM_QOS_INFO_VI_UAPSD, - WMM_QOS_INFO_VO_UAPSD - }; - UINT_8 aucWfaOui[] = VENDOR_OUI_WFA; - - P_PM_PROFILE_SETUP_INFO_T prPmProfSetupInfo; - P_BSS_INFO_T prBssInfo; - P_STA_RECORD_T prStaRec; - - DEBUGFUNC("mqmGenerateWmmInfoIE"); - - ASSERT(prMsduInfo); - - /* In case QoS is not turned off, exit directly */ - if(!prAdapter->rWifiVar.fgSupportQoS){ - return; - } - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - ASSERT(prStaRec); - - if(prStaRec == NULL) { - return; - } - - if(!prStaRec->fgIsWmmSupported) { - return; - } - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prStaRec->ucNetTypeIndex]); - - prPmProfSetupInfo = &prBssInfo->rPmProfSetupInfo; - - prIeWmmInfo = (P_IE_WMM_INFO_T) - ((PUINT_8) prMsduInfo->prPacket + prMsduInfo->u2FrameLength); - - prIeWmmInfo->ucId = ELEM_ID_WMM; - prIeWmmInfo->ucLength = ELEM_MAX_LEN_WMM_INFO; - - /* WMM-2.2.1 WMM Information Element Field Values */ - prIeWmmInfo->aucOui[0] = aucWfaOui[0]; - prIeWmmInfo->aucOui[1] = aucWfaOui[1]; - prIeWmmInfo->aucOui[2] = aucWfaOui[2]; - prIeWmmInfo->ucOuiType = VENDOR_OUI_TYPE_WMM; - prIeWmmInfo->ucOuiSubtype = VENDOR_OUI_SUBTYPE_WMM_INFO; - - prIeWmmInfo->ucVersion = VERSION_WMM; - prIeWmmInfo->ucQosInfo = 0; - - /* UAPSD intial queue configurations (delivery and trigger enabled)*/ -// if(prAdapter->rWifiVar.fgSupportUAPSD){ - if(prAdapter->rWifiVar.fgSupportUAPSD && prStaRec->fgIsUapsdSupported){ - - UINT_8 ucQosInfo = 0; - UINT_8 i; - - - /* Static U-APSD setting */ - for(i = ACI_BE; i <= ACI_VO; i++){ - if (prPmProfSetupInfo->ucBmpDeliveryAC & prPmProfSetupInfo->ucBmpTriggerAC & BIT(i)){ - ucQosInfo |= (UINT_8)ucUapsd[i]; - } - } - - - if (prPmProfSetupInfo->ucBmpDeliveryAC & prPmProfSetupInfo->ucBmpTriggerAC) { - switch (prPmProfSetupInfo->ucUapsdSp) { - case WMM_MAX_SP_LENGTH_ALL: - ucQosInfo |= WMM_QOS_INFO_MAX_SP_ALL; - break; - - case WMM_MAX_SP_LENGTH_2: - ucQosInfo |= WMM_QOS_INFO_MAX_SP_2; - break; - - case WMM_MAX_SP_LENGTH_4: - ucQosInfo |= WMM_QOS_INFO_MAX_SP_4; - break; - - case WMM_MAX_SP_LENGTH_6: - ucQosInfo |= WMM_QOS_INFO_MAX_SP_6; - break; - - default: - DBGLOG(QM, INFO, ("MQM: Incorrect SP length \n")); - ucQosInfo |= WMM_QOS_INFO_MAX_SP_2; - break; - } - } - prIeWmmInfo->ucQosInfo = ucQosInfo; - - } - - /* Increment the total IE length for the Element ID and Length fields. */ - prMsduInfo->u2FrameLength += IE_SIZE(prIeWmmInfo); - -} - - -#if 0 -/*----------------------------------------------------------------------------*/ -/*! -* @brief log2 calculation for CW -* -* @param[in] val value -* -* @return log2(val) -*/ -/*----------------------------------------------------------------------------*/ - -UINT_32 cwlog2(UINT_32 val) { - - UINT_32 n; - n=0; - - while (val >= 512) { n+= 9; val = val >> 9; } - while (val >= 16) { n+= 4; val >>= 4; } - while (val >= 2) { n+= 1; val >>= 1; } - return n; -} -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Generate the WMM Param IE -* -* \param[in] prAdapter Adapter pointer -* @param prMsduInfo The TX MMPDU -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -mqmGenerateWmmParamIE ( - IN P_ADAPTER_T prAdapter, - IN P_MSDU_INFO_T prMsduInfo - ) -{ - P_IE_WMM_PARAM_T prIeWmmParam; - - UINT_8 aucWfaOui[] = VENDOR_OUI_WFA; - - UINT_8 aucACI[] = { - WMM_ACI_AC_BE, - WMM_ACI_AC_BK, - WMM_ACI_AC_VI, - WMM_ACI_AC_VO - }; - - P_BSS_INFO_T prBssInfo; - P_STA_RECORD_T prStaRec; - ENUM_WMM_ACI_T eAci; - - DEBUGFUNC("mqmGenerateWmmParamIE"); - DBGLOG(QM, LOUD,("\n")); - - ASSERT(prMsduInfo); - - /* In case QoS is not turned off, exit directly */ - if(!prAdapter->rWifiVar.fgSupportQoS){ - return; - } - - prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex); - - if(prStaRec) { - if(!prStaRec->fgIsQoS) { - return; - } - } - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prMsduInfo->ucNetworkType]); - - if(!prBssInfo->fgIsQBSS) { return; } - -#if 0 // 20120220 frog: update beacon content & change OP mode is a separate event for P2P network. - if( prBssInfo->eCurrentOPMode != OP_MODE_ACCESS_POINT && - prBssInfo->eCurrentOPMode != OP_MODE_BOW) - { - return; - } -#endif - - prIeWmmParam = (P_IE_WMM_PARAM_T) - ((PUINT_8) prMsduInfo->prPacket + prMsduInfo->u2FrameLength); - - prIeWmmParam->ucId = ELEM_ID_WMM; - prIeWmmParam->ucLength = ELEM_MAX_LEN_WMM_PARAM; - - /* WMM-2.2.1 WMM Information Element Field Values */ - prIeWmmParam->aucOui[0] = aucWfaOui[0]; - prIeWmmParam->aucOui[1] = aucWfaOui[1]; - prIeWmmParam->aucOui[2] = aucWfaOui[2]; - prIeWmmParam->ucOuiType = VENDOR_OUI_TYPE_WMM; - prIeWmmParam->ucOuiSubtype = VENDOR_OUI_SUBTYPE_WMM_PARAM; - - prIeWmmParam->ucVersion = VERSION_WMM; - prIeWmmParam->ucQosInfo = (prBssInfo->ucWmmParamSetCount & WMM_QOS_INFO_PARAM_SET_CNT); - - /* UAPSD intial queue configurations (delivery and trigger enabled)*/ - if(prAdapter->rWifiVar.fgSupportUAPSD){ - - prIeWmmParam->ucQosInfo |= WMM_QOS_INFO_UAPSD; - - } - - /* EDCA parameter */ - - for(eAci = 0; eAci < WMM_AC_INDEX_NUM; eAci++){ - - //DBGLOG(QM, LOUD, ("MQM: eAci = %d, ACM = %d, Aifsn = %d, CWmin = %d, CWmax = %d, TxopLimit = %d\n", - // eAci,prBssInfo->arACQueParmsForBcast[eAci].fgIsACMSet , - // prBssInfo->arACQueParmsForBcast[eAci].u2Aifsn, - // prBssInfo->arACQueParmsForBcast[eAci].u2CWmin, - // prBssInfo->arACQueParmsForBcast[eAci].u2CWmax, - // prBssInfo->arACQueParmsForBcast[eAci].u2TxopLimit)); - - *( ((PUINT_8)(&prIeWmmParam->ucAciAifsn_BE)) + (eAci <<2) ) = (UINT_8) (aucACI[eAci] - | (prBssInfo->arACQueParmsForBcast[eAci].fgIsACMSet ? WMM_ACIAIFSN_ACM:0 ) - | (prBssInfo->arACQueParmsForBcast[eAci].u2Aifsn & (WMM_ACIAIFSN_AIFSN))); -#if 1 - *( ((PUINT_8)(&prIeWmmParam->ucEcw_BE)) + (eAci <<2) ) = (UINT_8) (0 - | (((prBssInfo->aucCWminLog2ForBcast[eAci] )) & WMM_ECW_WMIN_MASK) - | ((((prBssInfo->aucCWmaxLog2ForBcast[eAci] )) << WMM_ECW_WMAX_OFFSET ) & WMM_ECW_WMAX_MASK) - ); -#else - *( ((PUINT_8)(&prIeWmmParam->ucEcw_BE)) + (eAci <<2) ) = (UINT_8) (0 - | (cwlog2((prBssInfo->arACQueParmsForBcast[eAci].u2CWmin + 1)) & WMM_ECW_WMIN_MASK) - | ((cwlog2((prBssInfo->arACQueParmsForBcast[eAci].u2CWmax + 1)) << WMM_ECW_WMAX_OFFSET ) & WMM_ECW_WMAX_MASK) - ); -#endif - - WLAN_SET_FIELD_16( ((PUINT_8)(prIeWmmParam->aucTxopLimit_BE)) + (eAci<<2) - , prBssInfo->arACQueParmsForBcast[eAci].u2TxopLimit); - - } - - /* Increment the total IE length for the Element ID and Length fields. */ - prMsduInfo->u2FrameLength += IE_SIZE(prIeWmmParam); - -} - - - - -ENUM_FRAME_ACTION_T -qmGetFrameAction( - IN P_ADAPTER_T prAdapter, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType, - IN UINT_8 ucStaRecIdx, - IN P_MSDU_INFO_T prMsduInfo, - IN ENUM_FRAME_TYPE_IN_CMD_Q_T eFrameType -) -{ - P_BSS_INFO_T prBssInfo; - P_STA_RECORD_T prStaRec; - P_WLAN_MAC_HEADER_T prWlanFrame; - UINT_16 u2TxFrameCtrl; - - DEBUGFUNC("qmGetFrameAction"); - -#if (NIC_TX_BUFF_COUNT_TC4 > 2) -#define QM_MGMT_QUUEUD_THRESHOLD 2 -#else -#define QM_MGMT_QUUEUD_THRESHOLD 1 -#endif - - DATA_STRUC_INSPECTING_ASSERT(QM_MGMT_QUUEUD_THRESHOLD <= (NIC_TX_BUFF_COUNT_TC4)); - DATA_STRUC_INSPECTING_ASSERT(QM_MGMT_QUUEUD_THRESHOLD > 0); - - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[eNetworkType]); - prStaRec = QM_GET_STA_REC_PTR_FROM_INDEX(prAdapter, ucStaRecIdx); - - /* XXX Check BOW P2P AIS time ot set active */ - if (!IS_BSS_ACTIVE(prBssInfo)) { - if (eFrameType == FRAME_TYPE_MMPDU) { - prWlanFrame = (P_WLAN_MAC_HEADER_T) prMsduInfo->prPacket; - u2TxFrameCtrl = (prWlanFrame->u2FrameCtrl) & MASK_FRAME_TYPE; // Optimized for ARM - if ((u2TxFrameCtrl == MAC_FRAME_DEAUTH) && (prMsduInfo->pfTxDoneHandler == NULL)) { - return FRAME_ACTION_TX_PKT; - } - - } - - DBGLOG(QM, INFO, ("Drop packets Action (Inactive %u).\n",prBssInfo->ucNetTypeIndex)); - TX_INC_CNT(&prAdapter->rTxCtrl, TX_INACTIVE_BSS_DROP); - return FRAME_ACTION_DROP_PKT; - } - - /* TODO Handle disconnect issue */ - - /* P2P probe Request frame */ - do { - if(eFrameType == FRAME_TYPE_MMPDU) { - ASSERT(prMsduInfo!=NULL); - prWlanFrame = (P_WLAN_MAC_HEADER_T) prMsduInfo->prPacket; - u2TxFrameCtrl = (prWlanFrame->u2FrameCtrl) & MASK_FRAME_TYPE; // Optimized for ARM - - if (u2TxFrameCtrl == MAC_FRAME_BEACON ) { - if( prBssInfo->fgIsNetAbsent) { - return FRAME_ACTION_DROP_PKT; - } - } - else if (u2TxFrameCtrl == MAC_FRAME_PROBE_RSP) { - if( prBssInfo->fgIsNetAbsent) { - break; - } - } - else if (u2TxFrameCtrl == MAC_FRAME_DEAUTH) { - if( prBssInfo->fgIsNetAbsent) { - break; - } - DBGLOG(P2P, LOUD, ("Sending DEAUTH Frame\n")); - return FRAME_ACTION_TX_PKT; - } - /* MMPDU with prStaRec && fgIsInUse not check fgIsNetActive */ - else if(u2TxFrameCtrl == MAC_FRAME_ASSOC_REQ - || u2TxFrameCtrl == MAC_FRAME_AUTH - || u2TxFrameCtrl == MAC_FRAME_REASSOC_REQ - || u2TxFrameCtrl == MAC_FRAME_PROBE_REQ - || u2TxFrameCtrl == MAC_FRAME_ACTION) { - - if(prStaRec){ - if(prStaRec->fgIsInPS) { - if( nicTxGetResource (prAdapter, TC4_INDEX)>= QM_MGMT_QUUEUD_THRESHOLD) { - return FRAME_ACTION_TX_PKT; - } - else { - return FRAME_ACTION_QUEUE_PKT; - } - } - } - return FRAME_ACTION_TX_PKT; - } - - if (!prStaRec){ - return FRAME_ACTION_TX_PKT; - } - else { - if (!prStaRec->fgIsInUse) { - return FRAME_ACTION_DROP_PKT; - } - } - - } /* FRAME_TYPE_MMPDU */ - else if ((eFrameType == FRAME_TYPE_802_1X)){ - - if (!prStaRec){ - return FRAME_ACTION_TX_PKT; - } - else { - if (!prStaRec->fgIsInUse) { - return FRAME_ACTION_DROP_PKT; - } - if(prStaRec->fgIsInPS) { - if( nicTxGetResource (prAdapter, TC4_INDEX)>= QM_MGMT_QUUEUD_THRESHOLD) { - return FRAME_ACTION_TX_PKT; - } - else { - return FRAME_ACTION_QUEUE_PKT; - } - } - } - - } /* FRAME_TYPE_802_1X */ - else if ((!IS_BSS_ACTIVE(prBssInfo)) - || (!prStaRec) - || (!prStaRec->fgIsInUse)){ - return FRAME_ACTION_DROP_PKT; - } - }while(0); - - if (prBssInfo->fgIsNetAbsent){ - DBGLOG(QM, LOUD, ("Queue packets (Absent %u).\n",prBssInfo->ucNetTypeIndex)); - return FRAME_ACTION_QUEUE_PKT; - } - - if (prStaRec && prStaRec->fgIsInPS){ - DBGLOG(QM, LOUD, ("Queue packets (PS %u).\n",prStaRec->fgIsInPS)); - return FRAME_ACTION_QUEUE_PKT; - } - else { - switch (eFrameType){ - case FRAME_TYPE_802_1X: - if (!prStaRec->fgIsValid){ - return FRAME_ACTION_QUEUE_PKT; - } - break; - - case FRAME_TYPE_MMPDU: - break; - - default: - ASSERT(0); - } - } - - return FRAME_ACTION_TX_PKT; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Handle BSS change operation Event from the FW -* -* \param[in] prAdapter Adapter pointer -* \param[in] prEvent The event packet from the FW -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -qmHandleEventBssAbsencePresence( - IN P_ADAPTER_T prAdapter, - IN P_WIFI_EVENT_T prEvent - ) -{ - P_EVENT_BSS_ABSENCE_PRESENCE_T prEventBssStatus; - P_BSS_INFO_T prBssInfo; - BOOLEAN fgIsNetAbsentOld; - - prEventBssStatus = (P_EVENT_BSS_ABSENCE_PRESENCE_T)prEvent; - prBssInfo = &(prAdapter->rWifiVar.arBssInfo[prEventBssStatus->ucNetTypeIdx]); - fgIsNetAbsentOld = prBssInfo->fgIsNetAbsent; - prBssInfo->fgIsNetAbsent = prEventBssStatus->fgIsAbsent; - prBssInfo->ucBssFreeQuota = prEventBssStatus->ucBssFreeQuota; - - //DBGLOG(QM, TRACE, ("qmHandleEventBssAbsencePresence (ucNetTypeIdx=%d, fgIsAbsent=%d, FreeQuota=%d)\n", - // prEventBssStatus->ucNetTypeIdx, prBssInfo->fgIsNetAbsent, prBssInfo->ucBssFreeQuota)); - - DBGLOG(QM, TRACE, ("NAF=%d,%d,%d\n", - prEventBssStatus->ucNetTypeIdx, prBssInfo->fgIsNetAbsent, prBssInfo->ucBssFreeQuota)); - - if(!prBssInfo->fgIsNetAbsent) { - QM_DBG_CNT_INC(&(prAdapter->rQM),QM_DBG_CNT_27); - } - else { - QM_DBG_CNT_INC(&(prAdapter->rQM),QM_DBG_CNT_28); - } - /* From Absent to Present */ - if ((fgIsNetAbsentOld) && (!prBssInfo->fgIsNetAbsent)){ - kalSetEvent(prAdapter->prGlueInfo); - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Handle STA change PS mode Event from the FW -* -* \param[in] prAdapter Adapter pointer -* \param[in] prEvent The event packet from the FW -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -qmHandleEventStaChangePsMode( - IN P_ADAPTER_T prAdapter, - IN P_WIFI_EVENT_T prEvent - ) -{ - P_EVENT_STA_CHANGE_PS_MODE_T prEventStaChangePsMode; - P_STA_RECORD_T prStaRec; - BOOLEAN fgIsInPSOld; - - //DbgPrint("QM:Event -RxBa\n"); - - prEventStaChangePsMode = (P_EVENT_STA_CHANGE_PS_MODE_T)prEvent; - prStaRec = QM_GET_STA_REC_PTR_FROM_INDEX(prAdapter, prEventStaChangePsMode->ucStaRecIdx); - ASSERT(prStaRec); - - if(prStaRec) { - - fgIsInPSOld = prStaRec->fgIsInPS; - prStaRec->fgIsInPS = prEventStaChangePsMode->fgIsInPs; - - qmUpdateFreeQuota( - prAdapter, - prStaRec, - prEventStaChangePsMode->ucUpdateMode, - prEventStaChangePsMode->ucFreeQuota); - - //DBGLOG(QM, TRACE, ("qmHandleEventStaChangePsMode (ucStaRecIdx=%d, fgIsInPs=%d)\n", - // prEventStaChangePsMode->ucStaRecIdx, prStaRec->fgIsInPS)); - - - //DBGLOG(QM, TRACE, ("PS=%d,%d\n", - // prEventStaChangePsMode->ucStaRecIdx, prStaRec->fgIsInPS)); - - /* From PS to Awake */ - if ((fgIsInPSOld) && (!prStaRec->fgIsInPS)){ - kalSetEvent(prAdapter->prGlueInfo); - } - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Update STA free quota Event from FW -* -* \param[in] prAdapter Adapter pointer -* \param[in] prEvent The event packet from the FW -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -qmHandleEventStaUpdateFreeQuota( - IN P_ADAPTER_T prAdapter, - IN P_WIFI_EVENT_T prEvent - ) -{ - P_EVENT_STA_UPDATE_FREE_QUOTA_T prEventStaUpdateFreeQuota; - P_STA_RECORD_T prStaRec; - - - prEventStaUpdateFreeQuota = (P_EVENT_STA_UPDATE_FREE_QUOTA_T)prEvent; - prStaRec = QM_GET_STA_REC_PTR_FROM_INDEX(prAdapter, prEventStaUpdateFreeQuota->ucStaRecIdx); - ASSERT(prStaRec); - - if(prStaRec) { - if(prStaRec->fgIsInPS) { - qmUpdateFreeQuota( - prAdapter, - prStaRec, - prEventStaUpdateFreeQuota->ucUpdateMode, - prEventStaUpdateFreeQuota->ucFreeQuota); - - kalSetEvent(prAdapter->prGlueInfo); - } -#if 0 - DBGLOG(QM, TRACE, ("qmHandleEventStaUpdateFreeQuota (ucStaRecIdx=%d, ucUpdateMode=%d, ucFreeQuota=%d)\n", - prEventStaUpdateFreeQuota->ucStaRecIdx, - prEventStaUpdateFreeQuota->ucUpdateMode, - prEventStaUpdateFreeQuota->ucFreeQuota)); -#endif - - DBGLOG(QM, TRACE, ("UFQ=%d,%d,%d\n", - prEventStaUpdateFreeQuota->ucStaRecIdx, - prEventStaUpdateFreeQuota->ucUpdateMode, - prEventStaUpdateFreeQuota->ucFreeQuota)); - - - } - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Update STA free quota -* -* \param[in] prStaRec the STA -* \param[in] ucUpdateMode the method to update free quota -* \param[in] ucFreeQuota the value for update -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -qmUpdateFreeQuota( - IN P_ADAPTER_T prAdapter, - IN P_STA_RECORD_T prStaRec, - IN UINT_8 ucUpdateMode, - IN UINT_8 ucFreeQuota - ) -{ - - UINT_8 ucFreeQuotaForNonDelivery; - UINT_8 ucFreeQuotaForDelivery; - - ASSERT(prStaRec); - DBGLOG(QM, LOUD, ("qmUpdateFreeQuota orig ucFreeQuota=%d Mode %u New %u\n", - prStaRec->ucFreeQuota, ucUpdateMode, ucFreeQuota )); - - if(!prStaRec->fgIsInPS)return; - - switch (ucUpdateMode) { - case FREE_QUOTA_UPDATE_MODE_INIT: - case FREE_QUOTA_UPDATE_MODE_OVERWRITE: - prStaRec->ucFreeQuota = ucFreeQuota; - break; - case FREE_QUOTA_UPDATE_MODE_INCREASE: - prStaRec->ucFreeQuota += ucFreeQuota; - break; - case FREE_QUOTA_UPDATE_MODE_DECREASE: - prStaRec->ucFreeQuota -= ucFreeQuota; - break; - default: - ASSERT(0); - } - - DBGLOG(QM, LOUD, ("qmUpdateFreeQuota new ucFreeQuota=%d)\n", - prStaRec->ucFreeQuota )); - - ucFreeQuota = prStaRec->ucFreeQuota; - - ucFreeQuotaForNonDelivery = 0; - ucFreeQuotaForDelivery = 0; - - if(ucFreeQuota > 0) { - if( prStaRec->fgIsQoS && prStaRec->fgIsUapsdSupported - /* && prAdapter->rWifiVar.fgSupportQoS - && prAdapter->rWifiVar.fgSupportUAPSD*/) { - /* XXX We should assign quota to aucFreeQuotaPerQueue[NUM_OF_PER_STA_TX_QUEUES] */ - - if(prStaRec->ucFreeQuotaForNonDelivery > 0 && prStaRec->ucFreeQuotaForDelivery > 0) { - ucFreeQuotaForNonDelivery = ucFreeQuota>>1; - ucFreeQuotaForDelivery = ucFreeQuota - ucFreeQuotaForNonDelivery; - } - else if(prStaRec->ucFreeQuotaForNonDelivery == 0 && prStaRec->ucFreeQuotaForDelivery == 0) { - ucFreeQuotaForNonDelivery = ucFreeQuota>>1; - ucFreeQuotaForDelivery = ucFreeQuota - ucFreeQuotaForNonDelivery; - } - else if(prStaRec->ucFreeQuotaForNonDelivery > 0) { - /* NonDelivery is not busy */ - if(ucFreeQuota >= 3 ) { - ucFreeQuotaForNonDelivery = 2; - ucFreeQuotaForDelivery = ucFreeQuota - ucFreeQuotaForNonDelivery ; - } - else { - ucFreeQuotaForDelivery = ucFreeQuota; - ucFreeQuotaForNonDelivery = 0; - } - } - else if(prStaRec->ucFreeQuotaForDelivery > 0) { - /* Delivery is not busy */ - if(ucFreeQuota >= 3 ) { - ucFreeQuotaForDelivery = 2; - ucFreeQuotaForNonDelivery = ucFreeQuota - ucFreeQuotaForDelivery; - } - else { - ucFreeQuotaForNonDelivery = ucFreeQuota; - ucFreeQuotaForDelivery = 0; - } - } - - } - else { - /* !prStaRec->fgIsUapsdSupported */ - ucFreeQuotaForNonDelivery = ucFreeQuota; - ucFreeQuotaForDelivery = 0; - } - } /* ucFreeQuota > 0 */ - - prStaRec->ucFreeQuotaForDelivery = ucFreeQuotaForDelivery; - prStaRec->ucFreeQuotaForNonDelivery = ucFreeQuotaForNonDelivery; - - DBGLOG(QM, LOUD, ("new QuotaForDelivery = %d QuotaForNonDelivery = %d\n", - prStaRec->ucFreeQuotaForDelivery, prStaRec->ucFreeQuotaForNonDelivery )); - -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Return the reorder queued RX packets -* -* \param[in] (none) -* -* \return The number of queued RX packets -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -qmGetRxReorderQueuedBufferCount( - IN P_ADAPTER_T prAdapter - ) -{ - UINT_32 i, u4Total; - P_QUE_MGT_T prQM = &prAdapter->rQM; - u4Total = 0; - /* XXX The summation may impact the performance */ - for(i =0; iarRxBaTable[i].rReOrderQue.u4NumElem; -#if DBG && 0 - if(QUEUE_IS_EMPTY(&(prQM->arRxBaTable[i].rReOrderQue))){ - ASSERT(prQM->arRxBaTable[i].rReOrderQue == 0); - } -#endif - } - ASSERT(u4Total <=( CFG_NUM_OF_QM_RX_PKT_NUM*2)); - return u4Total; -} - - diff --git a/drivers/net/wireless/mt5931/os/linux/gl_bow.c b/drivers/net/wireless/mt5931/os/linux/gl_bow.c deleted file mode 100755 index bdd30aa9ee72..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/gl_bow.c +++ /dev/null @@ -1,1369 +0,0 @@ -/* -** $Id: @(#) gl_bow.c@@ -*/ - -/*! \file gl_bow.c - \brief Main routines of Linux driver interface for 802.11 PAL (BT 3.0 + HS) - - This file contains the main routines of Linux driver for MediaTek Inc. 802.11 - Wireless LAN Adapters. -*/ - - - -/* -** $Log: gl_bow.c $ - * - * 02 16 2012 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * [ALPS00235223] [Rose][ICS][Cross Feature][AEE-IPANIC]The device reboot automatically and then the "KE" pops up after you turn on the "Airplane mode".(once) - * - * [Root Cause] - * PAL operates BOW char dev poll after BOW char dev is registered. - * - * [Solution] - * Rejects PAL char device operation after BOW is unregistered or when wlan GLUE_FLAG_HALT is set. - * - * This is a workaround for BOW driver robustness, happens only in ICS. - * - * Root cause should be fixed by CR [ALPS00231570] - * - * 02 03 2012 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * [ALPS00118114] [Rose][ICS][Free Test][Bluetooth]The "KE" pops up after you turn on the airplane mode.(5/5) - * - * [Root Cause] - * PAL operates BOW char dev poll after BOW char dev is registered. - * - * [Solution] - * Rejects PAL char device operation after BOW is unregistered. - * - * Happens only in ICS. - * - * Notified PAL owener to reivew MTKBT/PAL closing BOW char dev procedure. - * - * [Side Effect] - * None. - * - * 01 16 2012 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Support BOW for 5GHz band. - * - * 11 10 2011 cp.wu - * [WCXRP00001098] [MT6620 Wi-Fi][Driver] Replace printk by DBG LOG macros in linux porting layer - * 1. eliminaite direct calls to printk in porting layer. - * 2. replaced by DBGLOG, which would be XLOG on ALPS platforms. - * - * 10 25 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Modify ampc0 char device for major number 151 for all MT6575 projects. - * - * 07 28 2011 cp.wu - * [WCXRP00000884] [MT6620 Wi-Fi][Driver] Deprecate ioctl interface by unlocked ioctl - * unlocked_ioctl returns as long instead of int. - * - * 07 28 2011 cp.wu - * [WCXRP00000884] [MT6620 Wi-Fi][Driver] Deprecate ioctl interface by unlocked ioctl - * migrate to unlocked ioctl interface - * - * 04 12 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add WMM IE for BOW initiator data. - * - * 04 10 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Change Link disconnection event procedure for hotspot and change skb length check to 1514 bytes. - * - * 04 09 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Change Link connection event procedure and change skb length check to 1512 bytes. - * - * 03 27 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Support multiple physical link. - * - * 03 06 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Sync BOW Driver to latest person development branch version.. - * - * 03 03 2011 jeffrey.chang - * [WCXRP00000512] [MT6620 Wi-Fi][Driver] modify the net device relative functions to support the H/W multiple queue - * support concurrent network - * - * 03 03 2011 jeffrey.chang - * [WCXRP00000512] [MT6620 Wi-Fi][Driver] modify the net device relative functions to support the H/W multiple queue - * replace alloc_netdev to alloc_netdev_mq for BoW - * - * 03 03 2011 jeffrey.chang - * [WCXRP00000512] [MT6620 Wi-Fi][Driver] modify the net device relative functions to support the H/W multiple queue - * modify net device relative functions to support multiple H/W queues - * - * 02 15 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Update net register and BOW for concurrent features. - * - * 02 10 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Fix kernel API change issue. - * Before ALPS 2.2 (2.2 included), kfifo_alloc() is - * struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, spinlock_t *lock); - * After ALPS 2.3, kfifo_alloc() is changed to - * int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask); - * - * 02 09 2011 cp.wu - * [WCXRP00000430] [MT6620 Wi-Fi][Firmware][Driver] Create V1.2 branch for MT6620E1 and MT6620E3 - * create V1.2 driver branch based on label MT6620_WIFI_DRIVER_V1_2_110209_1031 - * with BOW and P2P enabled as default - * - * 02 08 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Replace kfifo_get and kfifo_put with kfifo_out and kfifo_in. - * Update BOW get MAC status, remove returning event for AIS network type. - * - * 01 12 2011 cp.wu - * [WCXRP00000357] [MT6620 Wi-Fi][Driver][Bluetooth over Wi-Fi] add another net device interface for BT AMP - * implementation of separate BT_OVER_WIFI data path. - * - * 01 12 2011 cp.wu - * [WCXRP00000356] [MT6620 Wi-Fi][Driver] fill mac header length for security frames 'cause hardware header translation needs such information - * fill mac header length information for 802.1x frames. - * - * 11 11 2010 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Fix BoW timer assert issue. - * - * 09 14 2010 chinghwa.yu - * NULL - * Add bowRunEventAAAComplete. - * - * 09 14 2010 cp.wu - * NULL - * correct typo: POLLOUT instead of POLL_OUT - * - * 09 13 2010 cp.wu - * NULL - * add waitq for poll() and read(). - * - * 08 24 2010 chinghwa.yu - * NULL - * Update BOW for the 1st time. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 05 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * change variable names for multiple physical link to match with coding convention - * - * 05 05 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * multiple BoW interfaces need to compare with peer address - * - * 04 28 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * change prefix for data structure used to communicate with 802.11 PAL - * to avoid ambiguous naming with firmware interface - * - * 04 28 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * fix kalIndicateBOWEvent. - * - * 04 27 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add multiple physical link support - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * * * * * * * * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * * * * * * * * * * * * * * 2) command sequence number is now increased atomically - * * * * * * * * * * * * * * * * 3) private data could be hold and taken use for other purpose -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "gl_os.h" -#include "debug.h" -#include "wlan_lib.h" -#include "gl_wext.h" -#include "precomp.h" -#include -#include "bss.h" - -#if CFG_ENABLE_BT_OVER_WIFI - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -/* @FIXME if there is command/event with payload length > 28 */ -#define MAX_BUFFER_SIZE (64) - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -#if CFG_BOW_TEST - UINT_32 g_u4PrevSysTime = 0; - UINT_32 g_u4CurrentSysTime = 0; - UINT_32 g_arBowRevPalPacketTime[11]; -#endif - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -// forward declarations -static ssize_t -mt6620_ampc_read( - IN struct file *filp, - IN char __user *buf, - IN size_t size, - IN OUT loff_t *ppos); - -static ssize_t -mt6620_ampc_write( - IN struct file *filp, - OUT const char __user *buf, - IN size_t size, - IN OUT loff_t *ppos); - -static long -mt6620_ampc_ioctl( - IN struct file *filp, - IN unsigned int cmd, - IN OUT unsigned long arg); - -static unsigned int -mt6620_ampc_poll( - IN struct file *filp, - IN poll_table *wait); - -static int -mt6620_ampc_open( - IN struct inode *inodep, - IN struct file *filp); - -static int -mt6620_ampc_release( - IN struct inode *inodep, - IN struct file *filp); - - -// character file operations -static const struct file_operations mt6620_ampc_fops = { - //.owner = THIS_MODULE, - .read = mt6620_ampc_read, - .write = mt6620_ampc_write, - .unlocked_ioctl = mt6620_ampc_ioctl, - .poll = mt6620_ampc_poll, - .open = mt6620_ampc_open, - .release = mt6620_ampc_release, -}; - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Register for character device to communicate with 802.11 PAL -* -* \param[in] prGlueInfo Pointer to glue info -* -* \return TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -glRegisterAmpc ( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - if(prGlueInfo->rBowInfo.fgIsRegistered == TRUE) { - return FALSE; - } - else { -#if 0 - // 1. allocate major number dynamically - - if(alloc_chrdev_region(&(prGlueInfo->rBowInfo.u4DeviceNumber), - 0, // first minor number - 1, // number - GLUE_BOW_DEVICE_NAME) !=0) - - return FALSE; -#endif - -#if 1 - -#if defined (CONFIG_AMPC_CDEV_NUM) - prGlueInfo->rBowInfo.u4DeviceNumber = MKDEV(CONFIG_AMPC_CDEV_NUM, 0); -#else - prGlueInfo->rBowInfo.u4DeviceNumber = MKDEV(226, 0); -#endif - - if(register_chrdev_region(prGlueInfo->rBowInfo.u4DeviceNumber, - 1, // number - GLUE_BOW_DEVICE_NAME) !=0) - - return FALSE; -#endif - - // 2. spin-lock initialization - // spin_lock_init(&(prGlueInfo->rBowInfo.rSpinLock)); - - // 3. initialize kfifo -/* prGlueInfo->rBowInfo.prKfifo = kfifo_alloc(GLUE_BOW_KFIFO_DEPTH, - GFP_KERNEL, - &(prGlueInfo->rBowInfo.rSpinLock));*/ - if ((kfifo_alloc((struct kfifo *) &(prGlueInfo->rBowInfo.rKfifo), GLUE_BOW_KFIFO_DEPTH, GFP_KERNEL))) - goto fail_kfifo_alloc; - -// if(prGlueInfo->rBowInfo.prKfifo == NULL) - if(&(prGlueInfo->rBowInfo.rKfifo) == NULL) - goto fail_kfifo_alloc; - - // 4. initialize cdev - cdev_init(&(prGlueInfo->rBowInfo.cdev), &mt6620_ampc_fops); - // prGlueInfo->rBowInfo.cdev.owner = THIS_MODULE; - prGlueInfo->rBowInfo.cdev.ops = &mt6620_ampc_fops; - - // 5. add character device - if(cdev_add(&(prGlueInfo->rBowInfo.cdev), - prGlueInfo->rBowInfo.u4DeviceNumber, - 1)) - goto fail_cdev_add; - - - // 6. in queue initialization - init_waitqueue_head(&(prGlueInfo->rBowInfo.outq)); - - // 7. finish - prGlueInfo->rBowInfo.fgIsRegistered = TRUE; - return TRUE; - -fail_cdev_add: - kfifo_free(&(prGlueInfo->rBowInfo.rKfifo)); -// kfifo_free(prGlueInfo->rBowInfo.prKfifo); -fail_kfifo_alloc: - unregister_chrdev_region(prGlueInfo->rBowInfo.u4DeviceNumber, 1); - return FALSE; - } -} /* end of glRegisterAmpc */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Unregister character device for communicating with 802.11 PAL -* -* \param[in] prGlueInfo Pointer to glue info -* -* \return TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -glUnregisterAmpc ( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - if(prGlueInfo->rBowInfo.fgIsRegistered == FALSE) { - return FALSE; - } - else { - prGlueInfo->rBowInfo.fgIsRegistered = FALSE; - - // 1. free netdev if necessary -#if CFG_BOW_SEPARATE_DATA_PATH - kalUninitBowDevice(prGlueInfo); -#endif - - // 2. removal of character device - cdev_del(&(prGlueInfo->rBowInfo.cdev)); - - // 3. free kfifo -// kfifo_free(prGlueInfo->rBowInfo.prKfifo); - kfifo_free(&(prGlueInfo->rBowInfo.rKfifo)); -// prGlueInfo->rBowInfo.prKfifo = NULL; -// prGlueInfo->rBowInfo.rKfifo = NULL; - - // 4. free device number - unregister_chrdev_region(prGlueInfo->rBowInfo.u4DeviceNumber, 1); - - return TRUE; - } -} /* end of glUnregisterAmpc */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief read handler for character device to communicate with 802.11 PAL -* -* \param[in] -* \return -* Follows Linux Character Device Interface -* -*/ -/*----------------------------------------------------------------------------*/ -static ssize_t -mt6620_ampc_read( - IN struct file *filp, - IN char __user *buf, - IN size_t size, - IN OUT loff_t *ppos) -{ - UINT_8 aucBuffer[MAX_BUFFER_SIZE]; - ssize_t retval; - - P_GLUE_INFO_T prGlueInfo; - prGlueInfo = (P_GLUE_INFO_T)(filp->private_data); - - ASSERT(prGlueInfo); - - if ((prGlueInfo->rBowInfo.fgIsRegistered == FALSE) || (prGlueInfo->u4Flag & GLUE_FLAG_HALT)) { - return -EFAULT; - } - - // size check -// if(kfifo_len(prGlueInfo->rBowInfo.prKfifo) >= size) - if(kfifo_len(&(prGlueInfo->rBowInfo.rKfifo)) >= size) - retval = size; - else - retval = kfifo_len(&(prGlueInfo->rBowInfo.rKfifo)); -// retval = kfifo_len(prGlueInfo->rBowInfo.prKfifo); - -// kfifo_get(prGlueInfo->rBowInfo.prKfifo, aucBuffer, retval); -// kfifo_out(prGlueInfo->rBowInfo.prKfifo, aucBuffer, retval); - if (!(kfifo_out(&(prGlueInfo->rBowInfo.rKfifo), aucBuffer, retval))) - retval = -EIO; - - if(copy_to_user(buf, aucBuffer, retval)) - retval = -EIO; - - return retval; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief write handler for character device to communicate with 802.11 PAL -* -* \param[in] -* \return -* Follows Linux Character Device Interface -* -*/ -/*----------------------------------------------------------------------------*/ -static ssize_t -mt6620_ampc_write( - IN struct file *filp, - OUT const char __user *buf, - IN size_t size, - IN OUT loff_t *ppos) -{ -#if CFG_BOW_TEST - UINT_8 i; -#endif - - UINT_8 aucBuffer[MAX_BUFFER_SIZE]; - P_AMPC_COMMAND prCmd; - P_GLUE_INFO_T prGlueInfo; - - prGlueInfo = (P_GLUE_INFO_T)(filp->private_data); - ASSERT(prGlueInfo); - - if ((prGlueInfo->rBowInfo.fgIsRegistered == FALSE) || (prGlueInfo->u4Flag & GLUE_FLAG_HALT)) { - return -EFAULT; - } - - if(size > MAX_BUFFER_SIZE) - return -EINVAL; - else if(copy_from_user(aucBuffer, buf, size)) - return -EIO; - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("AMP driver CMD buffer size : %d.\n", size)); - - for(i = 0; i < MAX_BUFFER_SIZE; i++) - { - DBGLOG(BOW, EVENT, ("AMP write content : 0x%x.\n", aucBuffer[i])); - } - - DBGLOG(BOW, EVENT, ("BoW CMD write.\n")); -#endif - - prCmd = (P_AMPC_COMMAND) aucBuffer; - - #if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("AMP write content payload length : %d.\n", prCmd->rHeader.u2PayloadLength)); - - DBGLOG(BOW, EVENT, ("AMP write content header length : %d.\n", sizeof(AMPC_COMMAND_HEADER_T))); - #endif - - // size check - if(prCmd->rHeader.u2PayloadLength + sizeof(AMPC_COMMAND_HEADER_T) != size) - { - #if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("Wrong CMD total length.\n")); - #endif - - return -EINVAL; - } - - if(wlanbowHandleCommand(prGlueInfo->prAdapter, prCmd) == WLAN_STATUS_SUCCESS) - return size; - else - return -EINVAL; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief ioctl handler for character device to communicate with 802.11 PAL -* -* \param[in] -* \return -* Follows Linux Character Device Interface -* -*/ -/*----------------------------------------------------------------------------*/ -static long -mt6620_ampc_ioctl( - IN struct file *filp, - IN unsigned int cmd, - IN OUT unsigned long arg) -{ - int err = 0; - P_GLUE_INFO_T prGlueInfo; - prGlueInfo = (P_GLUE_INFO_T)(filp->private_data); - - ASSERT(prGlueInfo); - - if ((prGlueInfo->rBowInfo.fgIsRegistered == FALSE) || (prGlueInfo->u4Flag & GLUE_FLAG_HALT)) { - return -EFAULT; - } - - // permission check - if(_IOC_DIR(cmd) & _IOC_READ) - err = !access_ok(VERIFY_WRITE, (void __user *)arg, _IOC_SIZE(cmd)); - else if (_IOC_DIR(cmd) & _IOC_WRITE) - err = !access_ok(VERIFY_READ, (void __user *)arg, _IOC_SIZE(cmd)); - if (err) - return -EFAULT; - - // no ioctl is implemented yet - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief ioctl handler for character device to communicate with 802.11 PAL -* -* \param[in] -* \return -* Follows Linux Character Device Interface -* -*/ -/*----------------------------------------------------------------------------*/ -static unsigned int -mt6620_ampc_poll( - IN struct file *filp, - IN poll_table *wait) -{ - unsigned int retval; - P_GLUE_INFO_T prGlueInfo; - prGlueInfo = (P_GLUE_INFO_T)(filp->private_data); - - ASSERT(prGlueInfo); - - if ((prGlueInfo->rBowInfo.fgIsRegistered == FALSE) || (prGlueInfo->u4Flag & GLUE_FLAG_HALT)) { - return -EFAULT; - } - - poll_wait(filp, &prGlueInfo->rBowInfo.outq, wait); - - retval = (POLLOUT | POLLWRNORM); // always accepts incoming command packets - -// DBGLOG(BOW, EVENT, ("mt6620_ampc_pol, POLLOUT | POLLWRNORM, %x\n", retval)); - -// if(kfifo_len(prGlueInfo->rBowInfo.prKfifo) > 0) - if(kfifo_len(&(prGlueInfo->rBowInfo.rKfifo)) > 0) - { - retval |= (POLLIN | POLLRDNORM); - -// DBGLOG(BOW, EVENT, ("mt6620_ampc_pol, POLLIN | POLLRDNORM, %x\n", retval)); - - } - - return retval; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief open handler for character device to communicate with 802.11 PAL -* -* \param[in] -* \return -* Follows Linux Character Device Interface -* -*/ -/*----------------------------------------------------------------------------*/ -static int -mt6620_ampc_open( - IN struct inode *inodep, - IN struct file *filp) -{ - P_GLUE_INFO_T prGlueInfo; - P_GL_BOW_INFO prBowInfo; - - prBowInfo = container_of(inodep->i_cdev, GL_BOW_INFO, cdev); - ASSERT(prBowInfo); - - prGlueInfo = container_of(prBowInfo, GLUE_INFO_T, rBowInfo); - ASSERT(prGlueInfo); - - // set-up private data - filp->private_data = prGlueInfo; - - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief close handler for character device to communicate with 802.11 PAL -* -* \param[in] -* \return -* Follows Linux Character Device Interface -* -*/ -/*----------------------------------------------------------------------------*/ -static int -mt6620_ampc_release( - IN struct inode *inodep, - IN struct file *filp) -{ - P_GLUE_INFO_T prGlueInfo; - prGlueInfo = (P_GLUE_INFO_T)(filp->private_data); - - ASSERT(prGlueInfo); - - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to indicate event for Bluetooth over Wi-Fi -* -* \param[in] -* prGlueInfo -* prEvent -* \return -* none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalIndicateBOWEvent( - IN P_GLUE_INFO_T prGlueInfo, - IN P_AMPC_EVENT prEvent - ) -{ - size_t u4AvailSize, u4EventSize; - - ASSERT(prGlueInfo); - ASSERT(prEvent); - - // check device - if ((prGlueInfo->rBowInfo.fgIsRegistered == FALSE) || (prGlueInfo->u4Flag & GLUE_FLAG_HALT)) { - return; - } - -/* u4AvailSize = - GLUE_BOW_KFIFO_DEPTH - kfifo_len(prGlueInfo->rBowInfo.prKfifo);*/ - - u4AvailSize = - GLUE_BOW_KFIFO_DEPTH - kfifo_len(&(prGlueInfo->rBowInfo.rKfifo)); - - - u4EventSize = - prEvent->rHeader.u2PayloadLength + sizeof(AMPC_EVENT_HEADER_T); - - // check kfifo availability - if(u4AvailSize < u4EventSize) { - DBGLOG(BOW, EVENT, ("[bow] no space for event: %d/%d\n", - u4EventSize, - u4AvailSize)); - return; - } - - // queue into kfifo -// kfifo_put(prGlueInfo->rBowInfo.prKfifo, (PUINT_8)prEvent, u4EventSize); -// kfifo_in(prGlueInfo->rBowInfo.prKfifo, (PUINT_8)prEvent, u4EventSize); - kfifo_in(&(prGlueInfo->rBowInfo.rKfifo), (PUINT_8)prEvent, u4EventSize); - wake_up_interruptible(&(prGlueInfo->rBowInfo.outq)); - - return; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to retrieve Bluetooth-over-Wi-Fi state from glue layer -* -* \param[in] -* prGlueInfo -* rPeerAddr -* \return -* ENUM_BOW_DEVICE_STATE -*/ -/*----------------------------------------------------------------------------*/ -ENUM_BOW_DEVICE_STATE -kalGetBowState ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_8 aucPeerAddress[6] - ) -{ - UINT_8 i; - - ASSERT(prGlueInfo); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("kalGetBowState.\n")); -#endif - - for(i = 0 ; i < CFG_BOW_PHYSICAL_LINK_NUM ; i++) - { - if(EQUAL_MAC_ADDR(prGlueInfo->rBowInfo.arPeerAddr, aucPeerAddress) == 0) - { - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("kalGetBowState, aucPeerAddress %x, %x:%x:%x:%x:%x:%x.\n", i, - aucPeerAddress[0], - aucPeerAddress[1], - aucPeerAddress[2], - aucPeerAddress[3], - aucPeerAddress[4], - aucPeerAddress[5])); - - DBGLOG(BOW, EVENT, ("kalGetBowState, prGlueInfo->rBowInfo.aeState %x, %x.\n", i, prGlueInfo->rBowInfo.aeState[i])); - -#endif - - return prGlueInfo->rBowInfo.aeState[i]; - } - } - - return BOW_DEVICE_STATE_DISCONNECTED; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to set Bluetooth-over-Wi-Fi state in glue layer -* -* \param[in] -* prGlueInfo -* eBowState -* rPeerAddr -* \return -* none -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalSetBowState ( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_BOW_DEVICE_STATE eBowState, - IN UINT_8 aucPeerAddress[6] - ) -{ - UINT_8 i; - - ASSERT(prGlueInfo); - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("kalSetBowState.\n")); - - DBGLOG(BOW, EVENT, ("kalSetBowState, prGlueInfo->rBowInfo.arPeerAddr, %x:%x:%x:%x:%x:%x.\n", - prGlueInfo->rBowInfo.arPeerAddr[0], - prGlueInfo->rBowInfo.arPeerAddr[1], - prGlueInfo->rBowInfo.arPeerAddr[2], - prGlueInfo->rBowInfo.arPeerAddr[3], - prGlueInfo->rBowInfo.arPeerAddr[4], - prGlueInfo->rBowInfo.arPeerAddr[5])); - - DBGLOG(BOW, EVENT, ("kalSetBowState, aucPeerAddress, %x:%x:%x:%x:%x:%x.\n", - aucPeerAddress[0], - aucPeerAddress[1], - aucPeerAddress[2], - aucPeerAddress[3], - aucPeerAddress[4], - aucPeerAddress[5])); -#endif - - for(i = 0 ; i < CFG_BOW_PHYSICAL_LINK_NUM ; i++) - { - if(EQUAL_MAC_ADDR(prGlueInfo->rBowInfo.arPeerAddr, aucPeerAddress) == 0) - { - prGlueInfo->rBowInfo.aeState[i] = eBowState; - -#if CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("kalSetBowState, aucPeerAddress %x, %x:%x:%x:%x:%x:%x.\n", i, - aucPeerAddress[0], - aucPeerAddress[1], - aucPeerAddress[2], - aucPeerAddress[3], - aucPeerAddress[4], - aucPeerAddress[5])); - - DBGLOG(BOW, EVENT, ("kalSetBowState, prGlueInfo->rBowInfo.aeState %x, %x.\n", i, prGlueInfo->rBowInfo.aeState[i])); -#endif - - return TRUE; - } - } - - return FALSE; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to retrieve Bluetooth-over-Wi-Fi global state -* -* \param[in] -* prGlueInfo -* -* \return -* BOW_DEVICE_STATE_DISCONNECTED -* in case there is no BoW connection or -* BoW connection under initialization -* -* BOW_DEVICE_STATE_STARTING -* in case there is no BoW connection but -* some BoW connection under initialization -* -* BOW_DEVICE_STATE_CONNECTED -* in case there is any BoW connection available -*/ -/*----------------------------------------------------------------------------*/ -ENUM_BOW_DEVICE_STATE -kalGetBowGlobalState ( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - UINT_32 i; - - ASSERT(prGlueInfo); - - -//Henry, can reduce this logic to indentify state change - - for(i = 0 ; i < CFG_BOW_PHYSICAL_LINK_NUM ; i++) { - if(prGlueInfo->rBowInfo.aeState[i] == BOW_DEVICE_STATE_CONNECTED) { - return BOW_DEVICE_STATE_CONNECTED; - } - } - - for(i = 0 ; i < CFG_BOW_PHYSICAL_LINK_NUM ; i++) { - if(prGlueInfo->rBowInfo.aeState[i] == BOW_DEVICE_STATE_STARTING) { - return BOW_DEVICE_STATE_STARTING; - } - } - - return BOW_DEVICE_STATE_DISCONNECTED; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to retrieve Bluetooth-over-Wi-Fi operating frequency -* -* \param[in] -* prGlueInfo -* -* \return -* in unit of KHz -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -kalGetBowFreqInKHz( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - return prGlueInfo->rBowInfo.u4FreqInKHz; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to retrieve Bluetooth-over-Wi-Fi role -* -* \param[in] -* prGlueInfo -* -* \return -* 0: Responder -* 1: Initiator -*/ -/*----------------------------------------------------------------------------*/ -UINT_8 -kalGetBowRole( - IN P_GLUE_INFO_T prGlueInfo, - IN PARAM_MAC_ADDRESS rPeerAddr - ) -{ - UINT_32 i; - - ASSERT(prGlueInfo); - - for(i = 0 ; i < CFG_BOW_PHYSICAL_LINK_NUM ; i++) { - if(EQUAL_MAC_ADDR(prGlueInfo->rBowInfo.arPeerAddr[i], rPeerAddr) == 0) { - return prGlueInfo->rBowInfo.aucRole[i]; - } - } - - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to set Bluetooth-over-Wi-Fi role -* -* \param[in] -* prGlueInfo -* ucRole -* 0: Responder -* 1: Initiator -* \return -* none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalSetBowRole( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_8 ucRole, - IN PARAM_MAC_ADDRESS rPeerAddr - ) -{ - UINT_32 i; - - ASSERT(prGlueInfo); - ASSERT(ucRole <= 1); - - for(i = 0 ; i < CFG_BOW_PHYSICAL_LINK_NUM ; i++) { - if(EQUAL_MAC_ADDR(prGlueInfo->rBowInfo.arPeerAddr[i], rPeerAddr) == 0) { - prGlueInfo->rBowInfo.aucRole[i] = ucRole; //Henry, 0 : Responder, 1 : Initiator - } - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to get available Bluetooth-over-Wi-Fi physical link number -* -* \param[in] -* prGlueInfo -* \return -* UINT_32 -* how many physical links are aviailable -*/ -/*----------------------------------------------------------------------------*/ -UINT_8 -kalGetBowAvailablePhysicalLinkCount( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - UINT_8 i; - UINT_8 ucLinkCount = 0; - - ASSERT(prGlueInfo); - - for(i = 0 ; i < CFG_BOW_PHYSICAL_LINK_NUM ; i++) { - if(prGlueInfo->rBowInfo.aeState[i] == BOW_DEVICE_STATE_DISCONNECTED) { - ucLinkCount++; - } - } - -#if 0//CFG_BOW_TEST - DBGLOG(BOW, EVENT, ("kalGetBowAvailablePhysicalLinkCount, ucLinkCount, %c.\n", ucLinkCount)); -#endif - - return ucLinkCount; -} - -#if CFG_BOW_SEPARATE_DATA_PATH - -/* Net Device Hooks */ -/*----------------------------------------------------------------------------*/ -/*! - * \brief A function for net_device open (ifup) - * - * \param[in] prDev Pointer to struct net_device. - * - * \retval 0 The execution succeeds. - * \retval < 0 The execution failed. - */ -/*----------------------------------------------------------------------------*/ -static int -bowOpen( - IN struct net_device *prDev - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - P_ADAPTER_T prAdapter = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - /* 2. carrier on & start TX queue */ - netif_carrier_on(prDev); - netif_tx_start_all_queues(prDev); - - return 0; /* success */ -} - - -/*----------------------------------------------------------------------------*/ -/*! - * \brief A function for net_device stop (ifdown) - * - * \param[in] prDev Pointer to struct net_device. - * - * \retval 0 The execution succeeds. - * \retval < 0 The execution failed. - */ -/*----------------------------------------------------------------------------*/ -static int -bowStop( - IN struct net_device *prDev - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - P_ADAPTER_T prAdapter = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - /* 1. stop TX queue */ - netif_tx_stop_all_queues(prDev); - - /* 2. turn of carrier */ - if(netif_carrier_ok(prDev)) { - netif_carrier_off(prDev); - } - - return 0; -}; - - -/*----------------------------------------------------------------------------*/ -/*! - * \brief This function is TX entry point of NET DEVICE. - * - * \param[in] prSkb Pointer of the sk_buff to be sent - * \param[in] prDev Pointer to struct net_device - * - * \retval NETDEV_TX_OK - on success. - * \retval NETDEV_TX_BUSY - on failure, packet will be discarded by upper layer. - */ -/*----------------------------------------------------------------------------*/ -static int -bowHardStartXmit( - IN struct sk_buff *prSkb, - IN struct net_device *prDev - ) -{ - P_GLUE_INFO_T prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - - P_QUE_ENTRY_T prQueueEntry = NULL; - P_QUE_T prTxQueue = NULL; - UINT_16 u2QueueIdx = 0; - UINT_8 ucDSAP, ucSSAP, ucControl; - UINT_8 aucOUI[3]; - PUINT_8 aucLookAheadBuf = NULL; - -#if CFG_BOW_TEST - UINT_32 i; -#endif - - GLUE_SPIN_LOCK_DECLARATION(); - - ASSERT(prSkb); - ASSERT(prDev); - ASSERT(prGlueInfo); - - aucLookAheadBuf = prSkb->data; - - ucDSAP = *(PUINT_8) &aucLookAheadBuf[ETH_LLC_OFFSET]; - ucSSAP = *(PUINT_8) &aucLookAheadBuf[ETH_LLC_OFFSET + 1]; - ucControl = *(PUINT_8) &aucLookAheadBuf[ETH_LLC_OFFSET + 2]; - aucOUI[0] = *(PUINT_8) &aucLookAheadBuf[ETH_SNAP_OFFSET]; - aucOUI[1] = *(PUINT_8) &aucLookAheadBuf[ETH_SNAP_OFFSET + 1]; - aucOUI[2] = *(PUINT_8) &aucLookAheadBuf[ETH_SNAP_OFFSET + 2]; - - if (!(ucDSAP == ETH_LLC_DSAP_SNAP && - ucSSAP == ETH_LLC_SSAP_SNAP && - ucControl == ETH_LLC_CONTROL_UNNUMBERED_INFORMATION && - aucOUI[0] == ETH_SNAP_BT_SIG_OUI_0 && - aucOUI[1] == ETH_SNAP_BT_SIG_OUI_1 && - aucOUI[2] == ETH_SNAP_BT_SIG_OUI_2) || (prSkb->len > 1514)) - { - -#if CFG_BOW_TEST - DBGLOG(BOW, TRACE, ("Invalid BOW packet, skip tx\n")); -#endif - - dev_kfree_skb(prSkb); - return NETDEV_TX_OK; - } - - if (prGlueInfo->u4Flag & GLUE_FLAG_HALT) { - DBGLOG(BOW, TRACE, ("GLUE_FLAG_HALT skip tx\n")); - dev_kfree_skb(prSkb); - return NETDEV_TX_OK; - } - - prQueueEntry = (P_QUE_ENTRY_T) GLUE_GET_PKT_QUEUE_ENTRY(prSkb); - prTxQueue = &prGlueInfo->rTxQueue; - -#if CFG_BOW_TEST - DBGLOG(BOW, TRACE, ("Tx sk_buff->len: %d\n", prSkb->len)); - DBGLOG(BOW, TRACE, ("Tx sk_buff->data_len: %d\n", prSkb->data_len)); - DBGLOG(BOW, TRACE, ("Tx sk_buff->data:\n")); - - for(i = 0; i < prSkb->len; i++) - { - DBGLOG(BOW, TRACE, ("%4x", prSkb->data[i])); - - if((i+1)%16 ==0) - { - DBGLOG(BOW, TRACE, ("\n")); - } - } - - DBGLOG(BOW, TRACE, ("\n"); -#endif - -#if CFG_BOW_TEST -// g_u4CurrentSysTime = (OS_SYSTIME)kalGetTimeTick(); - - g_u4CurrentSysTime = (OS_SYSTIME) jiffies_to_usecs(jiffies); - - i = g_u4CurrentSysTime - g_u4PrevSysTime; - - if ( (i >> 10) > 0) - { - i = 10; - } - else - { - i = i >> 7; - } - - g_arBowRevPalPacketTime[i]++; - - g_u4PrevSysTime = g_u4CurrentSysTime; - -#endif - - if (wlanProcessSecurityFrame(prGlueInfo->prAdapter, (P_NATIVE_PACKET) prSkb) == FALSE) { - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_TX_QUE); - QUEUE_INSERT_TAIL(prTxQueue, prQueueEntry); - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_TX_QUE); - - - GLUE_INC_REF_CNT(prGlueInfo->i4TxPendingFrameNum); - GLUE_INC_REF_CNT(prGlueInfo->ai4TxPendingFrameNumPerQueue[NETWORK_TYPE_BOW_INDEX][u2QueueIdx]); - - if (prGlueInfo->ai4TxPendingFrameNumPerQueue[NETWORK_TYPE_BOW_INDEX][u2QueueIdx] >= CFG_TX_STOP_NETIF_PER_QUEUE_THRESHOLD) { - netif_stop_subqueue(prDev, u2QueueIdx); - } - } - else { - GLUE_INC_REF_CNT(prGlueInfo->i4TxPendingSecurityFrameNum); - } - - kalSetEvent(prGlueInfo); - - /* For Linux, we'll always return OK FLAG, because we'll free this skb by ourself */ - return NETDEV_TX_OK; -} - - -// callbacks for netdevice -static const struct net_device_ops bow_netdev_ops = { - .ndo_open = bowOpen, - .ndo_stop = bowStop, - .ndo_start_xmit = bowHardStartXmit, -}; - -/*----------------------------------------------------------------------------*/ -/*! -* \brief initialize net device for Bluetooth-over-Wi-Fi -* -* \param[in] -* prGlueInfo -* prDevName -* -* \return -* TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalInitBowDevice( - IN P_GLUE_INFO_T prGlueInfo, - IN const char *prDevName - ) -{ - P_ADAPTER_T prAdapter; - P_GL_HIF_INFO_T prHif; - PARAM_MAC_ADDRESS rMacAddr; - - ASSERT(prGlueInfo); - ASSERT(prGlueInfo->rBowInfo.fgIsRegistered == TRUE); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - prHif = &prGlueInfo->rHifInfo; - ASSERT(prHif); - - if(prGlueInfo->rBowInfo.fgIsNetRegistered == FALSE) { - prGlueInfo->rBowInfo.prDevHandler = alloc_netdev_mq(sizeof(P_GLUE_INFO_T), prDevName, ether_setup, CFG_MAX_TXQ_NUM); - - if (!prGlueInfo->rBowInfo.prDevHandler) { - return FALSE; - } - else { - /* 1. setup netdev */ - /* 1.1 Point to shared glue structure */ - *((P_GLUE_INFO_T *) netdev_priv(prGlueInfo->rBowInfo.prDevHandler)) = prGlueInfo; - - /* 1.2 fill hardware address */ - COPY_MAC_ADDR(rMacAddr, prAdapter->rMyMacAddr); - rMacAddr[0] |= 0x2; // change to local administrated address - memcpy(prGlueInfo->rBowInfo.prDevHandler->dev_addr, rMacAddr, ETH_ALEN); - memcpy(prGlueInfo->rBowInfo.prDevHandler->perm_addr, prGlueInfo->rBowInfo.prDevHandler->dev_addr, ETH_ALEN); - - /* 1.3 register callback functions */ - prGlueInfo->rBowInfo.prDevHandler->netdev_ops = &bow_netdev_ops; - -#if (MTK_WCN_HIF_SDIO == 0) - SET_NETDEV_DEV(prGlueInfo->rBowInfo.prDevHandler, &(prHif->func->dev)); -#endif - - register_netdev(prGlueInfo->rBowInfo.prDevHandler); - - /* 2. net device initialize */ - netif_carrier_off(prGlueInfo->rBowInfo.prDevHandler); - netif_tx_stop_all_queues(prGlueInfo->rBowInfo.prDevHandler); - - /* 3. finish */ - prGlueInfo->rBowInfo.fgIsNetRegistered = TRUE; - } - } - - return TRUE; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief uninitialize net device for Bluetooth-over-Wi-Fi -* -* \param[in] -* prGlueInfo -* -* \return -* TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalUninitBowDevice( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - //ASSERT(prGlueInfo->rBowInfo.fgIsRegistered == TRUE); - - if(prGlueInfo->rBowInfo.fgIsNetRegistered == TRUE) { - - prGlueInfo->rBowInfo.fgIsNetRegistered = FALSE; - - if(netif_carrier_ok(prGlueInfo->rBowInfo.prDevHandler)) { - netif_carrier_off(prGlueInfo->rBowInfo.prDevHandler); - } - - netif_tx_stop_all_queues(prGlueInfo->rBowInfo.prDevHandler); - - /* netdevice unregistration & free */ - unregister_netdev(prGlueInfo->rBowInfo.prDevHandler); - free_netdev(prGlueInfo->rBowInfo.prDevHandler); - prGlueInfo->rBowInfo.prDevHandler = NULL; - - return TRUE; - - } - else { - return FALSE; - } -} - -#endif // CFG_BOW_SEPARATE_DATA_PATH -#endif // CFG_ENABLE_BT_OVER_WIFI - diff --git a/drivers/net/wireless/mt5931/os/linux/gl_cfg80211.c b/drivers/net/wireless/mt5931/os/linux/gl_cfg80211.c deleted file mode 100755 index 8c8649b45443..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/gl_cfg80211.c +++ /dev/null @@ -1,1661 +0,0 @@ -/* -** $Id: @(#) gl_cfg80211.c@@ -*/ - -/*! \file gl_cfg80211.c - \brief Main routines for supporintg MT6620 cfg80211 control interface - - This file contains the support routines of Linux driver for MediaTek Inc. 802.11 - Wireless LAN Adapters. -*/ - -/******************************************************************************* -* Copyright (c) 2007 MediaTek Inc. -* -* All rights reserved. Copying, compilation, modification, distribution -* or any other use whatsoever of this material is strictly prohibited -* except in accordance with a Software License Agreement with -* MediaTek Inc. -******************************************************************************** -*/ - -/******************************************************************************* -* LEGAL DISCLAIMER -* -* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND -* AGREES THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK -* SOFTWARE") RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE -* PROVIDED TO BUYER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY -* DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT -* LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -* PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE -* ANY WARRANTY WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY -* WHICH MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK -* SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY -* WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE -* FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION OR TO -* CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. -* -* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE -* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL -* BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT -* ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY -* BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -* -* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE -* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT -* OF LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING -* THEREOF AND RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN -* FRANCISCO, CA, UNDER THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE -* (ICC). -******************************************************************************** -*/ - -/* -** $Log: gl_cfg80211.c $ -** -** 08 29 2012 chinglan.wang -** [ALPS00349655] [Need Patch] [Volunteer Patch] [ALPS.JB] Daily build warning on [mt6575_phone_mhl-eng] -** . - * -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "gl_os.h" -#include "debug.h" -#include "wlan_lib.h" -#include "gl_wext.h" -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -#if CFG_SUPPORT_WAPI - extern UINT_8 keyStructBuf[1024]; /* add/remove key shared buffer */ -#else - extern UINT_8 keyStructBuf[100]; /* add/remove key shared buffer */ -#endif - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#if RSSI_ENHANCE - -#define RSSI_DEG(x...) //printk(x) - -#define RSSI_ENHANCE_VALUE (10) -#define MAX_COUNT_OF_RSSI_HISTORY (8) -typedef struct _RSSI_HISTORY_T -{ - int counts; - int history[MAX_COUNT_OF_RSSI_HISTORY]; -} RSSI_HISTORY_T, *P_RSSI_HISTORY_T; - -RSSI_HISTORY_T gRssiHistory; - -extern void initScanRssiHistory(void); -void initRssiHistory(void) -{ - printk("initRssiHistory.\n"); - memset(&gRssiHistory, 0, sizeof(RSSI_HISTORY_T)); -} - -int processRssiHistory(int newRssi) -{ - int rstRssi, i, total = 0; - int index = gRssiHistory.counts; - int *history = &gRssiHistory.history[0]; - - RSSI_DEG("---- newRssi = %d\n", newRssi); - - if(index != 0) { - if(abs(newRssi-history[index-1]) >= 10) { // rssi change too much, discard history rssi - index = 0; - } - } - - // save new rssi - if(index >= MAX_COUNT_OF_RSSI_HISTORY) { - memmove(&history[0], &history[1], (MAX_COUNT_OF_RSSI_HISTORY-1)*sizeof(int)); - history[MAX_COUNT_OF_RSSI_HISTORY-1] = newRssi; - } else { - history[index++] = newRssi; - } - gRssiHistory.counts = index; - - // calc result rssi - for(i = 0; i < index; i++) { - RSSI_DEG("%d, ", history[i]); - total += history[i]; - } - RSSI_DEG("\n"); - - rstRssi = total/gRssiHistory.counts; - rstRssi += RSSI_ENHANCE_VALUE; - RSSI_DEG("---- rstRssi = %d\n", rstRssi); - - if(rstRssi > -10) - rstRssi = -10; - - return rstRssi; -} - -#endif - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for change STA type between - * 1. Infrastructure Client (Non-AP STA) - * 2. Ad-Hoc IBSS - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_change_iface ( - struct wiphy *wiphy, - struct net_device *ndev, - enum nl80211_iftype type, - u32 *flags, - struct vif_params *params - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - ENUM_PARAM_OP_MODE_T eOpMode; - UINT_32 u4BufLen; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - - if(type == NL80211_IFTYPE_STATION) { - eOpMode = NET_TYPE_INFRA; - } - else if(type == NL80211_IFTYPE_ADHOC) { - eOpMode = NET_TYPE_IBSS; - } - else { - return -EINVAL; - } - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetInfrastructureMode, - &eOpMode, - sizeof(eOpMode), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(REQ, WARN, ("set infrastructure mode error:%lx\n", rStatus)); - } - - /* reset wpa info */ - prGlueInfo->rWpaInfo.u4WpaVersion = IW_AUTH_WPA_VERSION_DISABLED; - prGlueInfo->rWpaInfo.u4KeyMgmt = 0; - prGlueInfo->rWpaInfo.u4CipherGroup = IW_AUTH_CIPHER_NONE; - prGlueInfo->rWpaInfo.u4CipherPairwise = IW_AUTH_CIPHER_NONE; - prGlueInfo->rWpaInfo.u4AuthAlg = IW_AUTH_ALG_OPEN_SYSTEM; -#if CFG_SUPPORT_802_11W - prGlueInfo->rWpaInfo.u4Mfp = IW_AUTH_MFP_DISABLED; -#endif - - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for adding key - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_add_key ( - struct wiphy *wiphy, - struct net_device *ndev, - u8 key_index, - bool pairwise, - const u8 *mac_addr, - struct key_params *params - ) -{ - PARAM_KEY_T rKey; - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - INT_32 i4Rslt = -EINVAL; - UINT_32 u4BufLen = 0; - UINT_8 tmp1[8]; - UINT_8 tmp2[8]; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - - kalMemZero(&rKey, sizeof(PARAM_KEY_T)); - - rKey.u4KeyIndex = key_index; - - if(mac_addr) { - COPY_MAC_ADDR(rKey.arBSSID, mac_addr); - if ((rKey.arBSSID[0] == 0x00) && (rKey.arBSSID[1] == 0x00) && (rKey.arBSSID[2] == 0x00) && - (rKey.arBSSID[3] == 0x00) && (rKey.arBSSID[4] == 0x00) && (rKey.arBSSID[5] == 0x00)) { - rKey.arBSSID[0] = 0xff; - rKey.arBSSID[1] = 0xff; - rKey.arBSSID[2] = 0xff; - rKey.arBSSID[3] = 0xff; - rKey.arBSSID[4] = 0xff; - rKey.arBSSID[5] = 0xff; - } - if (rKey.arBSSID[0] != 0xFF) { - rKey.u4KeyIndex |= BIT(31); - if ((rKey.arBSSID[0] != 0x00) || (rKey.arBSSID[1] != 0x00) || (rKey.arBSSID[2] != 0x00) || - (rKey.arBSSID[3] != 0x00) || (rKey.arBSSID[4] != 0x00) || (rKey.arBSSID[5] != 0x00)) - rKey.u4KeyIndex |= BIT(30); - } - } - else { - rKey.arBSSID[0] = 0xff; - rKey.arBSSID[1] = 0xff; - rKey.arBSSID[2] = 0xff; - rKey.arBSSID[3] = 0xff; - rKey.arBSSID[4] = 0xff; - rKey.arBSSID[5] = 0xff; - //rKey.u4KeyIndex |= BIT(31); //Enable BIT 31 will make tx use bc key id, should use pairwise key id 0 - } - - if(params->key) { - //rKey.aucKeyMaterial[0] = kalMemAlloc(params->key_len, VIR_MEM_TYPE); - kalMemCopy(rKey.aucKeyMaterial, params->key, params->key_len); - if (params->key_len == 32) { - kalMemCopy(tmp1, ¶ms->key[16], 8); - kalMemCopy(tmp2, ¶ms->key[24], 8); - kalMemCopy(&rKey.aucKeyMaterial[16], tmp2, 8); - kalMemCopy(&rKey.aucKeyMaterial[24], tmp1, 8); - } - } - - rKey.u4KeyLength = params->key_len; - rKey.u4Length = ((UINT_32)&(((P_P2P_PARAM_KEY_T)0)->aucKeyMaterial)) + rKey.u4KeyLength; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetAddKey, - &rKey, - rKey.u4Length, - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus == WLAN_STATUS_SUCCESS) - i4Rslt = 0; - - return i4Rslt; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for getting key for specified STA - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_get_key ( - struct wiphy *wiphy, - struct net_device *ndev, - u8 key_index, - bool pairwise, - const u8 *mac_addr, - void *cookie, - void (*callback)(void *cookie, struct key_params*) - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - -#if 1 - printk("--> %s()\n", __func__); -#endif - - /* not implemented */ - - return -EINVAL; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for removing key for specified STA - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_del_key ( - struct wiphy *wiphy, - struct net_device *ndev, - u8 key_index, - bool pairwise, - const u8 *mac_addr - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - PARAM_REMOVE_KEY_T rRemoveKey; - UINT_32 u4BufLen = 0; - INT_32 i4Rslt = -EINVAL; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - - kalMemZero(&rRemoveKey, sizeof(PARAM_REMOVE_KEY_T)); - if(mac_addr) - COPY_MAC_ADDR(rRemoveKey.arBSSID, mac_addr); - rRemoveKey.u4KeyIndex = key_index; - rRemoveKey.u4Length = sizeof(PARAM_REMOVE_KEY_T); - - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetRemoveKey, - &rRemoveKey, - rRemoveKey.u4Length, - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(REQ, WARN, ("remove key error:%lx\n", rStatus)); - } - else { - i4Rslt = 0; - } - - return i4Rslt; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for setting default key on an interface - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_set_default_key ( - struct wiphy *wiphy, - struct net_device *ndev, - u8 key_index, - bool unicast, - bool multicast - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - -#if 1 - printk("--> %s()\n", __func__); -#endif - - /* not implemented */ - - return -EINVAL; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for getting station information such as RSSI - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ - -int -mtk_cfg80211_get_station ( - struct wiphy *wiphy, - struct net_device *ndev, - u8 *mac, - struct station_info *sinfo - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus; - PARAM_MAC_ADDRESS arBssid; - UINT_32 u4BufLen, u4Rate; - INT_32 i4Rssi; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - - kalMemZero(arBssid, MAC_ADDR_LEN); - wlanQueryInformation(prGlueInfo->prAdapter, - wlanoidQueryBssid, - &arBssid[0], - sizeof(arBssid), - &u4BufLen); - - /* 1. check BSSID */ - if(UNEQUAL_MAC_ADDR(arBssid, mac)) { - /* wrong MAC address */ - DBGLOG(REQ, WARN, ("incorrect BSSID: ["MACSTR"] currently connected BSSID["MACSTR"]\n", - MAC2STR(mac), MAC2STR(arBssid))); - return -ENOENT; - } - - /* 2. fill TX rate */ - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryLinkSpeed, - &u4Rate, - sizeof(u4Rate), - TRUE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(REQ, WARN, ("unable to retrieve link speed\n")); - } - else { - sinfo->filled |= STATION_INFO_TX_BITRATE; - sinfo->txrate.legacy = u4Rate / 1000; /* convert from 100bps to 100kbps */ - } - - if(prGlueInfo->eParamMediaStateIndicated != PARAM_MEDIA_STATE_CONNECTED) { - /* not connected */ - DBGLOG(REQ, WARN, ("not yet connected\n")); - } - else { - /* 3. fill RSSI */ - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryRssi, - &i4Rssi, - sizeof(i4Rssi), - TRUE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(REQ, WARN, ("unable to retrieve link speed\n")); - } - else { - #if RSSI_ENHANCE - i4Rssi = processRssiHistory(i4Rssi); - #endif - sinfo->filled |= STATION_INFO_SIGNAL; - sinfo->signal = i4Rssi; /* dBm */ - } - } - - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for requesting to do a scan - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_scan ( - struct wiphy *wiphy, - struct net_device *ndev, - struct cfg80211_scan_request *request - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus; - UINT_32 u4BufLen; - PARAM_SCAN_REQUEST_EXT_T rScanRequest; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - - kalMemZero(&rScanRequest, sizeof(PARAM_SCAN_REQUEST_EXT_T)); - - /* check if there is any pending scan not yet finished */ - if(prGlueInfo->prScanRequest != NULL) { - return -EBUSY; - } - - if(request->n_ssids == 0) { - rScanRequest.rSsid.u4SsidLen = 0; - } - else if(request->n_ssids == 1) { - COPY_SSID(rScanRequest.rSsid.aucSsid, rScanRequest.rSsid.u4SsidLen, request->ssids[0].ssid, request->ssids[0].ssid_len); - } - else { - return -EINVAL; - } - - if(request->ie_len > 0) { - rScanRequest.u4IELength = request->ie_len; - rScanRequest.pucIE = (PUINT_8)(request->ie); - } - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetBssidListScanExt, - &rScanRequest, - sizeof(PARAM_SCAN_REQUEST_EXT_T), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(REQ, WARN, ("scan error:%lx\n", rStatus)); - return -EINVAL; - } - - prGlueInfo->prScanRequest = request; - - return 0; -} - -static UINT_8 wepBuf[48]; - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for requesting to connect to - * the ESS with the specified parameters - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_connect ( - struct wiphy *wiphy, - struct net_device *ndev, - struct cfg80211_connect_params *sme - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus; - UINT_32 u4BufLen; - ENUM_PARAM_ENCRYPTION_STATUS_T eEncStatus; - ENUM_PARAM_AUTH_MODE_T eAuthMode; - UINT_32 cipher; - PARAM_SSID_T rNewSsid; - BOOLEAN fgCarryWPSIE = FALSE; - ENUM_PARAM_OP_MODE_T eOpMode; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - -#if RSSI_ENHANCE - initRssiHistory(); -#endif - - if (prGlueInfo->prAdapter->rWifiVar.rConnSettings.eOPMode > NET_TYPE_AUTO_SWITCH) - eOpMode = NET_TYPE_AUTO_SWITCH; - else - eOpMode = prGlueInfo->prAdapter->rWifiVar.rConnSettings.eOPMode; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetInfrastructureMode, - &eOpMode, - sizeof(eOpMode), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, INFO, ("wlanoidSetInfrastructureMode fail 0x%lx\n", rStatus)); - return -EFAULT; - } - - /* after set operation mode, key table are cleared */ - - /* reset wpa info */ - prGlueInfo->rWpaInfo.u4WpaVersion = IW_AUTH_WPA_VERSION_DISABLED; - prGlueInfo->rWpaInfo.u4KeyMgmt = 0; - prGlueInfo->rWpaInfo.u4CipherGroup = IW_AUTH_CIPHER_NONE; - prGlueInfo->rWpaInfo.u4CipherPairwise = IW_AUTH_CIPHER_NONE; - prGlueInfo->rWpaInfo.u4AuthAlg = IW_AUTH_ALG_OPEN_SYSTEM; -#if CFG_SUPPORT_802_11W - prGlueInfo->rWpaInfo.u4Mfp = IW_AUTH_MFP_DISABLED; -#endif - - if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_1) - prGlueInfo->rWpaInfo.u4WpaVersion = IW_AUTH_WPA_VERSION_WPA; - else if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_2) - prGlueInfo->rWpaInfo.u4WpaVersion = IW_AUTH_WPA_VERSION_WPA2; - else - prGlueInfo->rWpaInfo.u4WpaVersion = IW_AUTH_WPA_VERSION_DISABLED; - - switch (sme->auth_type) { - case NL80211_AUTHTYPE_OPEN_SYSTEM: - prGlueInfo->rWpaInfo.u4AuthAlg = IW_AUTH_ALG_OPEN_SYSTEM; - break; - case NL80211_AUTHTYPE_SHARED_KEY: - prGlueInfo->rWpaInfo.u4AuthAlg = IW_AUTH_ALG_SHARED_KEY; - break; - default: - prGlueInfo->rWpaInfo.u4AuthAlg = IW_AUTH_ALG_OPEN_SYSTEM | IW_AUTH_ALG_SHARED_KEY; - break; - } - - if (sme->crypto.n_ciphers_pairwise) { - switch (sme->crypto.ciphers_pairwise[0]) { - case WLAN_CIPHER_SUITE_WEP40: - prGlueInfo->rWpaInfo.u4CipherPairwise = IW_AUTH_CIPHER_WEP40; - break; - case WLAN_CIPHER_SUITE_WEP104: - prGlueInfo->rWpaInfo.u4CipherPairwise = IW_AUTH_CIPHER_WEP104; - break; - case WLAN_CIPHER_SUITE_TKIP: - prGlueInfo->rWpaInfo.u4CipherPairwise = IW_AUTH_CIPHER_TKIP; - break; - case WLAN_CIPHER_SUITE_CCMP: - prGlueInfo->rWpaInfo.u4CipherPairwise = IW_AUTH_CIPHER_CCMP; - break; - case WLAN_CIPHER_SUITE_AES_CMAC: - prGlueInfo->rWpaInfo.u4CipherPairwise = IW_AUTH_CIPHER_CCMP; - break; - default: - DBGLOG(REQ, WARN, ("invalid cipher pairwise (%d)\n", - sme->crypto.ciphers_pairwise[0])); - return -EINVAL; - } - } - - if (sme->crypto.cipher_group) { - switch (sme->crypto.cipher_group) { - case WLAN_CIPHER_SUITE_WEP40: - prGlueInfo->rWpaInfo.u4CipherGroup = IW_AUTH_CIPHER_WEP40; - break; - case WLAN_CIPHER_SUITE_WEP104: - prGlueInfo->rWpaInfo.u4CipherGroup = IW_AUTH_CIPHER_WEP104; - break; - case WLAN_CIPHER_SUITE_TKIP: - prGlueInfo->rWpaInfo.u4CipherGroup = IW_AUTH_CIPHER_TKIP; - break; - case WLAN_CIPHER_SUITE_CCMP: - prGlueInfo->rWpaInfo.u4CipherGroup = IW_AUTH_CIPHER_CCMP; - break; - case WLAN_CIPHER_SUITE_AES_CMAC: - prGlueInfo->rWpaInfo.u4CipherGroup = IW_AUTH_CIPHER_CCMP; - break; - default: - DBGLOG(REQ, WARN, ("invalid cipher group (%d)\n", - sme->crypto.cipher_group)); - return -EINVAL; - } - } - - if (sme->crypto.n_akm_suites) { - if (prGlueInfo->rWpaInfo.u4WpaVersion == IW_AUTH_WPA_VERSION_WPA) { - switch (sme->crypto.akm_suites[0]) { - case WLAN_AKM_SUITE_8021X: - eAuthMode = AUTH_MODE_WPA; - break; - case WLAN_AKM_SUITE_PSK: - eAuthMode = AUTH_MODE_WPA_PSK; - break; - default: - DBGLOG(REQ, WARN, ("invalid cipher group (%d)\n", - sme->crypto.cipher_group)); - return -EINVAL; - } - } else if (prGlueInfo->rWpaInfo.u4WpaVersion == IW_AUTH_WPA_VERSION_WPA2) { - switch (sme->crypto.akm_suites[0]) { - case WLAN_AKM_SUITE_8021X: - eAuthMode = AUTH_MODE_WPA2; - break; - case WLAN_AKM_SUITE_PSK: - eAuthMode = AUTH_MODE_WPA2_PSK; - break; - default: - DBGLOG(REQ, WARN, ("invalid cipher group (%d)\n", - sme->crypto.cipher_group)); - return -EINVAL; - } - } - } - - if (prGlueInfo->rWpaInfo.u4WpaVersion == IW_AUTH_WPA_VERSION_DISABLED) { - eAuthMode = (prGlueInfo->rWpaInfo.u4AuthAlg == IW_AUTH_ALG_OPEN_SYSTEM) ? - AUTH_MODE_OPEN : AUTH_MODE_AUTO_SWITCH; - } - - prGlueInfo->rWpaInfo.fgPrivacyInvoke = sme->privacy; - - //prGlueInfo->prAdapter->rWifiVar.rConnSettings.fgWapiMode = FALSE; - //prGlueInfo->prAdapter->prGlueInfo->u2WapiAssocInfoIESz = 0; - prGlueInfo->fgWpsActive = FALSE; - //prGlueInfo->prAdapter->prGlueInfo->u2WSCAssocInfoIELen = 0; - - if (sme->ie && sme->ie_len > 0) { - WLAN_STATUS rStatus; - UINT_32 u4BufLen; - PUINT_8 prDesiredIE = NULL; - -#if CFG_SUPPORT_WAPI - rStatus = kalIoctl(prGlueInfo, - wlanoidSetWapiAssocInfo, - sme->ie, - sme->ie_len, - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(SEC, WARN, ("[wapi] set wapi assoc info error:%lx\n", rStatus)); - } -#endif -#if CFG_SUPPORT_WPS2 - if (wextSrchDesiredWPSIE(sme->ie, - sme->ie_len, - 0xDD, - (PUINT_8 *)&prDesiredIE)) { - prGlueInfo->fgWpsActive = TRUE; - fgCarryWPSIE = TRUE; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetWSCAssocInfo, - prDesiredIE, - IE_SIZE(prDesiredIE), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(SEC, WARN, ("WSC] set WSC assoc info error:%lx\n", rStatus)); - } - } -#endif - } - - /* clear WSC Assoc IE buffer in case WPS IE is not detected */ - if(fgCarryWPSIE == FALSE) { - kalMemZero(&prGlueInfo->aucWSCAssocInfoIE, 200); - prGlueInfo->u2WSCAssocInfoIELen = 0; - } - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetAuthMode, - &eAuthMode, - sizeof(eAuthMode), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(REQ, WARN, ("set auth mode error:%lx\n", rStatus)); - } - - cipher = prGlueInfo->rWpaInfo.u4CipherGroup | prGlueInfo->rWpaInfo.u4CipherPairwise; - - if (prGlueInfo->rWpaInfo.fgPrivacyInvoke) { - if (cipher & IW_AUTH_CIPHER_CCMP) { - eEncStatus = ENUM_ENCRYPTION3_ENABLED; - } - else if (cipher & IW_AUTH_CIPHER_TKIP) { - eEncStatus = ENUM_ENCRYPTION2_ENABLED; - } - else if (cipher & (IW_AUTH_CIPHER_WEP104 | IW_AUTH_CIPHER_WEP40)) { - eEncStatus = ENUM_ENCRYPTION1_ENABLED; - } - else if (cipher & IW_AUTH_CIPHER_NONE){ - if (prGlueInfo->rWpaInfo.fgPrivacyInvoke) - eEncStatus = ENUM_ENCRYPTION1_ENABLED; - else - eEncStatus = ENUM_ENCRYPTION_DISABLED; - } - else { - eEncStatus = ENUM_ENCRYPTION_DISABLED; - } - } - else { - eEncStatus = ENUM_ENCRYPTION_DISABLED; - } - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetEncryptionStatus, - &eEncStatus, - sizeof(eEncStatus), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(REQ, WARN, ("set encryption mode error:%lx\n", rStatus)); - } - - if (sme->key_len != 0 && prGlueInfo->rWpaInfo.u4WpaVersion == IW_AUTH_WPA_VERSION_DISABLED) { - P_PARAM_WEP_T prWepKey = (P_PARAM_WEP_T) wepBuf; - - kalMemSet(prWepKey, 0, sizeof(prWepKey)); - prWepKey->u4Length = 12 + sme->key_len; - prWepKey->u4KeyLength = (UINT_32) sme->key_len; - prWepKey->u4KeyIndex = (UINT_32) sme->key_idx; - prWepKey->u4KeyIndex |= BIT(31); - if (prWepKey->u4KeyLength > 32) { - DBGLOG(REQ, WARN, ("Too long key length (%u)\n", prWepKey->u4KeyLength)); - return -EINVAL; - } - kalMemCopy(prWepKey->aucKeyMaterial, sme->key, prWepKey->u4KeyLength); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetAddWep, - prWepKey, - prWepKey->u4Length, - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, INFO, ("wlanoidSetAddWep fail 0x%lx\n", rStatus)); - return -EFAULT; - } - } - - if(sme->ssid_len > 0) { - /* connect by SSID */ - COPY_SSID(rNewSsid.aucSsid, rNewSsid.u4SsidLen, sme->ssid, sme->ssid_len); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetSsid, - (PVOID) &rNewSsid, - sizeof(PARAM_SSID_T), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(REQ, WARN, ("set SSID:%lx\n", rStatus)); - return -EINVAL; - } - } - else { - /* connect by BSSID */ - rStatus = kalIoctl(prGlueInfo, - wlanoidSetBssid, - (PVOID) sme->bssid, - sizeof(MAC_ADDR_LEN), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(REQ, WARN, ("set BSSID:%lx\n", rStatus)); - return -EINVAL; - } - } - - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for requesting to disconnect from - * currently connected ESS - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_disconnect ( - struct wiphy *wiphy, - struct net_device *ndev, - u16 reason_code - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus; - UINT_32 u4BufLen; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - -#if RSSI_ENHANCE - initRssiHistory(); - initScanRssiHistory(); -#endif - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetDisassociate, - NULL, - 0, - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(REQ, WARN, ("disassociate error:%lx\n", rStatus)); - return -EFAULT; - } - - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for requesting to join an IBSS group - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_join_ibss ( - struct wiphy *wiphy, - struct net_device *ndev, - struct cfg80211_ibss_params *params - ) -{ - PARAM_SSID_T rNewSsid; - P_GLUE_INFO_T prGlueInfo = NULL; - UINT_32 u4ChnlFreq; /* Store channel or frequency information */ - UINT_32 u4BufLen = 0; - WLAN_STATUS rStatus; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - - /* set channel */ - if(params->channel) { - u4ChnlFreq = nicChannelNum2Freq(params->channel->hw_value); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetFrequency, - &u4ChnlFreq, - sizeof(u4ChnlFreq), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - if (rStatus != WLAN_STATUS_SUCCESS) { - return -EFAULT; - } - } - - /* set SSID */ - kalMemCopy(rNewSsid.aucSsid, params->ssid, params->ssid_len); - rStatus = kalIoctl(prGlueInfo, - wlanoidSetSsid, - (PVOID) &rNewSsid, - sizeof(PARAM_SSID_T), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(REQ, WARN, ("set SSID:%lx\n", rStatus)); - return -EFAULT; - } - - return 0; - - - return -EINVAL; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for requesting to leave from IBSS group - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_leave_ibss ( - struct wiphy *wiphy, - struct net_device *ndev - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus; - UINT_32 u4BufLen; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetDisassociate, - NULL, - 0, - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(REQ, WARN, ("disassociate error:%lx\n", rStatus)); - return -EFAULT; - } - - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for requesting to configure - * WLAN power managemenet - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_set_power_mgmt ( - struct wiphy *wiphy, - struct net_device *ndev, - bool enabled, - int timeout - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus; - UINT_32 u4BufLen; - PARAM_POWER_MODE ePowerMode; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - - if(enabled) { - if(timeout == -1) { - ePowerMode = Param_PowerModeFast_PSP; - } - else { - ePowerMode = Param_PowerModeMAX_PSP; - } - } - else { - ePowerMode = Param_PowerModeCAM; - } - - rStatus = kalIoctl(prGlueInfo, - wlanoidSet802dot11PowerSaveProfile, - &ePowerMode, - sizeof(ePowerMode), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(REQ, WARN, ("set_power_mgmt error:%lx\n", rStatus)); - return -EFAULT; - } - - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for requesting to cache - * a PMKID for a BSSID - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_set_pmksa ( - struct wiphy *wiphy, - struct net_device *ndev, - struct cfg80211_pmksa *pmksa - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus; - UINT_32 u4BufLen; - P_PARAM_PMKID_T prPmkid; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - - prPmkid =(P_PARAM_PMKID_T)kalMemAlloc(8 + sizeof(PARAM_BSSID_INFO_T), VIR_MEM_TYPE); - if (!prPmkid) { - DBGLOG(INIT, INFO, ("Can not alloc memory for IW_PMKSA_ADD\n")); - return -ENOMEM; - } - - prPmkid->u4Length = 8 + sizeof(PARAM_BSSID_INFO_T); - prPmkid->u4BSSIDInfoCount = 1; - kalMemCopy(prPmkid->arBSSIDInfo->arBSSID, pmksa->bssid, 6); - kalMemCopy(prPmkid->arBSSIDInfo->arPMKID, pmksa->pmkid, IW_PMKID_LEN); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetPmkid, - prPmkid, - sizeof(PARAM_PMKID_T), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, INFO, ("add pmkid error:%lx\n", rStatus)); - } - kalMemFree(prPmkid, VIR_MEM_TYPE, 8 + sizeof(PARAM_BSSID_INFO_T)); - - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for requesting to remove - * a cached PMKID for a BSSID - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_del_pmksa ( - struct wiphy *wiphy, - struct net_device *ndev, - struct cfg80211_pmksa *pmksa - ) -{ - - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for requesting to flush - * all cached PMKID - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_flush_pmksa ( - struct wiphy *wiphy, - struct net_device *ndev - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus; - UINT_32 u4BufLen; - P_PARAM_PMKID_T prPmkid; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - - prPmkid =(P_PARAM_PMKID_T)kalMemAlloc(8, VIR_MEM_TYPE); - if (!prPmkid) { - DBGLOG(INIT, INFO, ("Can not alloc memory for IW_PMKSA_FLUSH\n")); - return -ENOMEM; - } - - prPmkid->u4Length = 8; - prPmkid->u4BSSIDInfoCount = 0; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetPmkid, - prPmkid, - sizeof(PARAM_PMKID_T), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, INFO, ("flush pmkid error:%lx\n", rStatus)); - } - kalMemFree(prPmkid, VIR_MEM_TYPE, 8); - - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for requesting to stay on a - * specified channel - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_remain_on_channel ( - struct wiphy *wiphy, - struct net_device *ndev, - struct ieee80211_channel *chan, - enum nl80211_channel_type channel_type, - unsigned int duration, - u64 *cookie - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - -#if 1 - printk("--> %s()\n", __func__); -#endif - - /* not implemented */ - - return -EINVAL; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for requesting to cancel staying - * on a specified channel - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_cancel_remain_on_channel ( - struct wiphy *wiphy, - struct net_device *ndev, - u64 cookie - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - -#if 1 - printk("--> %s()\n", __func__); -#endif - - /* not implemented */ - - return -EINVAL; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for requesting to send a management frame - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_mgmt_tx ( - struct wiphy *wiphy, - struct net_device *ndev, - struct ieee80211_channel *channel, - bool offscan, - enum nl80211_channel_type channel_type, - bool channel_type_valid, - unsigned int wait, - const u8 *buf, - size_t len, - bool no_cck, - bool dont_wait_for_ack, - u64 *cookie - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - -#if 1 - printk("--> %s()\n", __func__); -#endif - - /* not implemented */ - - return -EINVAL; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for requesting to cancel the wait time - * from transmitting a management frame on another channel - * - * @param - * - * @retval 0: successful - * others: failure - */ -/*----------------------------------------------------------------------------*/ -int -mtk_cfg80211_mgmt_tx_cancel_wait ( - struct wiphy *wiphy, - struct net_device *ndev, - u64 cookie - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - ASSERT(prGlueInfo); - -#if 1 - printk("--> %s()\n", __func__); -#endif - - /* not implemented */ - - return -EINVAL; -} - - -#if CONFIG_NL80211_TESTMODE - -#if CFG_SUPPORT_WAPI -int -mtk_cfg80211_testmode_set_key_ext( - IN struct wiphy *wiphy, - IN void *data, - IN int len) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - P_NL80211_DRIVER_SET_KEY_EXTS prParams = (P_NL80211_DRIVER_SET_KEY_EXTS)NULL; - struct iw_encode_exts *prIWEncExt = (struct iw_encode_exts *)NULL; - WLAN_STATUS rstatus = WLAN_STATUS_SUCCESS; - int fgIsValid = 0; - UINT_32 u4BufLen = 0; - - P_PARAM_WPI_KEY_T prWpiKey = (P_PARAM_WPI_KEY_T) keyStructBuf; - memset(keyStructBuf, 0, sizeof(keyStructBuf)); - - ASSERT(wiphy); - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); -#if 1 - printk("--> %s()\n", __func__); -#endif - - if(data && len) { - prParams = (P_NL80211_DRIVER_SET_KEY_EXTS)data; - } - - if(prParams) { - prIWEncExt = (struct iw_encode_exts *) &prParams->ext; - } - - if (prIWEncExt->alg == IW_ENCODE_ALG_SMS4) { - /* KeyID */ - prWpiKey->ucKeyID = prParams->key_index; - prWpiKey->ucKeyID --; - if (prWpiKey->ucKeyID > 1) { - /* key id is out of range */ - //printk(KERN_INFO "[wapi] add key error: key_id invalid %d\n", prWpiKey->ucKeyID); - return -EINVAL; - } - - if (prIWEncExt->key_len != 32) { - /* key length not valid */ - //printk(KERN_INFO "[wapi] add key error: key_len invalid %d\n", prIWEncExt->key_len); - return -EINVAL; - } - - //printk(KERN_INFO "[wapi] %d ext_flags %d\n", prEnc->flags, prIWEncExt->ext_flags); - - if (prIWEncExt->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { - prWpiKey->eKeyType = ENUM_WPI_GROUP_KEY; - prWpiKey->eDirection = ENUM_WPI_RX; - } - else if (prIWEncExt->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { - prWpiKey->eKeyType = ENUM_WPI_PAIRWISE_KEY; - prWpiKey->eDirection = ENUM_WPI_RX_TX; - } - -//#if CFG_SUPPORT_WAPI - //handle_sec_msg_final(prIWEncExt->key, 32, prIWEncExt->key, NULL); -//#endif - /* PN */ - memcpy(prWpiKey->aucPN, prIWEncExt->tx_seq, IW_ENCODE_SEQ_MAX_SIZE * 2); - - /* BSSID */ - memcpy(prWpiKey->aucAddrIndex, prIWEncExt->addr, 6); - - memcpy(prWpiKey->aucWPIEK, prIWEncExt->key, 16); - prWpiKey->u4LenWPIEK = 16; - - memcpy(prWpiKey->aucWPICK, &prIWEncExt->key[16], 16); - prWpiKey->u4LenWPICK = 16; - - rstatus = kalIoctl(prGlueInfo, - wlanoidSetWapiKey, - prWpiKey, - sizeof(PARAM_WPI_KEY_T), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rstatus != WLAN_STATUS_SUCCESS) { - //printk(KERN_INFO "[wapi] add key error:%lx\n", rStatus); - fgIsValid = -EFAULT; - } - - } - return fgIsValid; -} -#endif - - -int -mtk_cfg80211_testmode_sw_cmd( - IN struct wiphy *wiphy, - IN void *data, - IN int len) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - P_NL80211_DRIVER_SW_CMD_PARAMS prParams = (P_NL80211_DRIVER_SW_CMD_PARAMS)NULL; - WLAN_STATUS rstatus = WLAN_STATUS_SUCCESS; - int fgIsValid = 0; - UINT_32 u4SetInfoLen = 0; - - ASSERT(wiphy); - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - -#if 1 - printk("--> %s()\n", __func__); -#endif - - if(data && len) - prParams = (P_NL80211_DRIVER_SW_CMD_PARAMS)data; - - if(prParams) { - if(prParams->set == 1){ - rstatus = kalIoctl(prGlueInfo, - (PFN_OID_HANDLER_FUNC)wlanoidSetSwCtrlWrite, - &prParams->adr, - (UINT_32)8, - FALSE, - FALSE, - TRUE, - FALSE, - &u4SetInfoLen); - } - } - - if (WLAN_STATUS_SUCCESS != rstatus) { - fgIsValid = -EFAULT; - } - - return fgIsValid; -} - -int mtk_cfg80211_testmode_cmd( - IN struct wiphy *wiphy, - IN void *data, - IN int len - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - P_NL80211_DRIVER_TEST_MODE_PARAMS prParams = (P_NL80211_DRIVER_TEST_MODE_PARAMS)NULL; - BOOLEAN fgIsValid = 0; - - ASSERT(wiphy); - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); - -#if 1 - printk("--> %s()\n", __func__); -#endif - - if(data && len) - prParams = (P_NL80211_DRIVER_TEST_MODE_PARAMS)data; - - /* Clear the version byte */ - prParams->index = prParams->index & ~ BITS(24,31); - - if(prParams){ - switch(prParams->index){ - case 1: /* SW cmd */ - if(mtk_cfg80211_testmode_sw_cmd(wiphy, data, len)) - fgIsValid = TRUE; - break; - case 2: /* WAPI */ -#if CFG_SUPPORT_WAPI - if(mtk_cfg80211_testmode_set_key_ext(wiphy, data, len)) - fgIsValid = TRUE; -#endif - break; - default: - fgIsValid = TRUE; - break; - } - } - - - return fgIsValid; -} -#endif - diff --git a/drivers/net/wireless/mt5931/os/linux/gl_init.c b/drivers/net/wireless/mt5931/os/linux/gl_init.c deleted file mode 100755 index d7a817fbae13..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/gl_init.c +++ /dev/null @@ -1,3399 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/gl_init.c#7 $ -*/ - -/*! \file gl_init.c - \brief Main routines of Linux driver - - This file contains the main routines of Linux driver for MediaTek Inc. 802.11 - Wireless LAN Adapters. -*/ - - - -/* -** $Log: gl_init.c $ - * - * 07 17 2012 yuche.tsai - * NULL - * Fix compile error. - * - * 07 17 2012 yuche.tsai - * NULL - * Fix compile error for JB. - * - * 07 17 2012 yuche.tsai - * NULL - * Let netdev bring up. - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 06 13 2012 yuche.tsai - * NULL - * Update maintrunk driver. - * Add support for driver compose assoc request frame. - * - * 05 25 2012 yuche.tsai - * NULL - * Fix reset KE issue. - * - * 05 11 2012 cp.wu - * [WCXRP00001237] [MT6620 Wi-Fi][Driver] Show MAC address and MAC address source for ACS's convenience - * show MAC address & source while initiliazation - * - * 03 02 2012 terry.wu - * NULL - * EXPORT_SYMBOL(rsnParseCheckForWFAInfoElem);. - * - * 03 02 2012 terry.wu - * NULL - * Snc CFG80211 modification for ICS migration from branch 2.2. - * - * 03 02 2012 terry.wu - * NULL - * Sync CFG80211 modification from branch 2,2. - * - * 03 02 2012 terry.wu - * NULL - * Enable CFG80211 Support. - * - * 12 22 2011 george.huang - * [WCXRP00000905] [MT6628 Wi-Fi][FW] Code refinement for ROM/ RAM module dependency - * using global variable instead of stack for setting wlanoidSetNetworkAddress(), due to buffer may be released before TX thread handling - * - * 11 18 2011 yuche.tsai - * NULL - * CONFIG P2P support RSSI query, default turned off. - * - * 11 14 2011 yuche.tsai - * [WCXRP00001107] [Volunteer Patch][Driver] Large Network Type index assert in FW issue. - * Fix large network type index assert in FW issue. - * - * 11 14 2011 cm.chang - * NULL - * Fix compiling warning - * - * 11 11 2011 yuche.tsai - * NULL - * Fix work thread cancel issue. - * - * 11 10 2011 cp.wu - * [WCXRP00001098] [MT6620 Wi-Fi][Driver] Replace printk by DBG LOG macros in linux porting layer - * 1. eliminaite direct calls to printk in porting layer. - * 2. replaced by DBGLOG, which would be XLOG on ALPS platforms. - * - * 10 06 2011 eddie.chen - * [WCXRP00001027] [MT6628 Wi-Fi][Firmware/Driver] Tx fragmentation - * Add rlmDomainGetChnlList symbol. - * - * 09 22 2011 cm.chang - * NULL - * Safer writng stype to avoid unitialized regitry structure - * - * 09 21 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * Avoid possible structure alignment problem - * - * 09 20 2011 chinglan.wang - * [WCXRP00000989] [WiFi Direct] [Driver] Add a new io control API to start the formation for the sigma test. - * . - * - * 09 08 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * Use new fields ucChannelListMap and ucChannelListIndex in NVRAM - * - * 08 31 2011 cm.chang - * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code - * . - * - * 08 11 2011 cp.wu - * [WCXRP00000830] [MT6620 Wi-Fi][Firmware] Use MDRDY counter to detect empty channel for shortening scan time - * expose scnQuerySparseChannel() for P2P-FSM. - * - * 08 11 2011 cp.wu - * [WCXRP00000830] [MT6620 Wi-Fi][Firmware] Use MDRDY counter to detect empty channel for shortening scan time - * sparse channel detection: - * driver: collect sparse channel information with scan-done event - * - * 08 02 2011 yuche.tsai - * [WCXRP00000896] [Volunteer Patch][WiFi Direct][Driver] GO with multiple client, TX deauth to a disconnecting device issue. - * Fix GO send deauth frame issue. - * - * 07 07 2011 wh.su - * [WCXRP00000839] [MT6620 Wi-Fi][Driver] Add the dumpMemory8 and dumpMemory32 EXPORT_SYMBOL - * Add the dumpMemory8 symbol export for debug mode. - * - * 07 06 2011 terry.wu - * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment - * Improve BoW connection establishment speed. - * - * 07 05 2011 yuche.tsai - * [WCXRP00000821] [Volunteer Patch][WiFi Direct][Driver] WiFi Direct Connection Speed Issue - * Export one symbol for enhancement. - * - * 06 13 2011 eddie.chen - * [WCXRP00000779] [MT6620 Wi-Fi][DRV] Add tx rx statistics in linux and use netif_rx_ni - * Add tx rx statistics and netif_rx_ni. - * - * 05 27 2011 cp.wu - * [WCXRP00000749] [MT6620 Wi-Fi][Driver] Add band edge tx power control to Wi-Fi NVRAM - * invoke CMD_ID_SET_EDGE_TXPWR_LIMIT when there is valid data exist in NVRAM content. - * - * 05 18 2011 cp.wu - * [WCXRP00000734] [MT6620 Wi-Fi][Driver] Pass PHY_PARAM in NVRAM to firmware domain - * pass PHY_PARAM in NVRAM from driver to firmware. - * - * 05 09 2011 jeffrey.chang - * [WCXRP00000710] [MT6620 Wi-Fi] Support pattern filter update function on IP address change - * support ARP filter through kernel notifier - * - * 05 03 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Use kalMemAlloc to allocate event buffer for kalIndicateBOWEvent. - * - * 04 27 2011 george.huang - * [WCXRP00000684] [MT6620 Wi-Fi][Driver] Support P2P setting ARP filter - * Support P2P ARP filter setting on early suspend/ late resume - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 04 15 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add BOW short range mode. - * - * 04 14 2011 yuche.tsai - * [WCXRP00000646] [Volunteer Patch][MT6620][FW/Driver] Sigma Test Modification for some test case. - * Modify some driver connection flow or behavior to pass Sigma test more easier.. - * - * 04 12 2011 cm.chang - * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency - * . - * - * 04 11 2011 george.huang - * [WCXRP00000621] [MT6620 Wi-Fi][Driver] Support P2P supplicant to set power mode - * export wlan functions to p2p - * - * 04 08 2011 pat.lu - * [WCXRP00000623] [MT6620 Wi-Fi][Driver] use ARCH define to distinguish PC Linux driver - * Use CONFIG_X86 instead of PC_LINUX_DRIVER_USE option to have proper compile settting for PC Linux driver - * - * 04 08 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * glBusFreeIrq() should use the same pvCookie as glBusSetIrq() or request_irq()/free_irq() won't work as a pair. - * - * 04 08 2011 eddie.chen - * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma - * Fix for sigma - * - * 04 06 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * 1. do not check for pvData inside wlanNetCreate() due to it is NULL for eHPI port - * 2. update perm_addr as well for MAC address - * 3. not calling check_mem_region() anymore for eHPI - * 4. correct MSC_CS macro for 0-based notation - * - * 03 29 2011 cp.wu - * [WCXRP00000598] [MT6620 Wi-Fi][Driver] Implementation of interface for communicating with user space process for RESET_START and RESET_END events - * fix typo. - * - * 03 29 2011 cp.wu - * [WCXRP00000598] [MT6620 Wi-Fi][Driver] Implementation of interface for communicating with user space process for RESET_START and RESET_END events - * implement kernel-to-userspace communication via generic netlink socket for whole-chip resetting mechanism - * - * 03 23 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * apply multi-queue operation only for linux kernel > 2.6.26 - * - * 03 22 2011 pat.lu - * [WCXRP00000592] [MT6620 Wi-Fi][Driver] Support PC Linux Environment Driver Build - * Add a compiler option "PC_LINUX_DRIVER_USE" for building driver in PC Linux environment. - * - * 03 21 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * portability for compatible with linux 2.6.12. - * - * 03 21 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * improve portability for awareness of early version of linux kernel and wireless extension. - * - * 03 21 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * portability improvement - * - * 03 18 2011 jeffrey.chang - * [WCXRP00000512] [MT6620 Wi-Fi][Driver] modify the net device relative functions to support the H/W multiple queue - * remove early suspend functions - * - * 03 17 2011 cp.wu - * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period - * reverse order to prevent probing racing. - * - * 03 16 2011 cp.wu - * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period - * 1. pre-allocate physical continuous buffer while module is being loaded - * 2. use pre-allocated physical continuous buffer for TX/RX DMA transfer - * - * The windows part remained the same as before, but added similiar APIs to hide the difference. - * - * 03 15 2011 jeffrey.chang - * [WCXRP00000558] [MT6620 Wi-Fi][MT6620 Wi-Fi][Driver] refine the queue selection algorithm for WMM - * refine the queue_select function - * - * 03 10 2011 cp.wu - * [WCXRP00000532] [MT6620 Wi-Fi][Driver] Migrate NVRAM configuration procedures from MT6620 E2 to MT6620 E3 - * deprecate configuration used by MT6620 E2 - * - * 03 10 2011 terry.wu - * [WCXRP00000505] [MT6620 Wi-Fi][Driver/FW] WiFi Direct Integration - * Remove unnecessary assert and message. - * - * 03 08 2011 terry.wu - * [WCXRP00000505] [MT6620 Wi-Fi][Driver/FW] WiFi Direct Integration - * Export nicQmUpdateWmmParms. - * - * 03 03 2011 jeffrey.chang - * [WCXRP00000512] [MT6620 Wi-Fi][Driver] modify the net device relative functions to support the H/W multiple queue - * support concurrent network - * - * 03 03 2011 jeffrey.chang - * [WCXRP00000512] [MT6620 Wi-Fi][Driver] modify the net device relative functions to support the H/W multiple queue - * modify net device relative functions to support multiple H/W queues - * - * 02 24 2011 george.huang - * [WCXRP00000495] [MT6620 Wi-Fi][FW] Support pattern filter for unwanted ARP frames - * Support ARP filter during suspended - * - * 02 21 2011 cp.wu - * [WCXRP00000482] [MT6620 Wi-Fi][Driver] Simplify logic for checking NVRAM existence in driver domain - * simplify logic for checking NVRAM existence only once. - * - * 02 17 2011 terry.wu - * [WCXRP00000459] [MT6620 Wi-Fi][Driver] Fix deference null pointer problem in wlanRemove - * Fix deference a null pointer problem in wlanRemove. - * - * 02 16 2011 jeffrey.chang - * NULL - * fix compilig error - * - * 02 16 2011 jeffrey.chang - * NULL - * Add query ipv4 and ipv6 address during early suspend and late resume - * - * 02 15 2011 jeffrey.chang - * NULL - * to support early suspend in android - * - * 02 11 2011 yuche.tsai - * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode. - * Add one more export symbol. - * - * 02 10 2011 yuche.tsai - * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode. - * Add RX deauthentication & disassociation process under Hot-Spot mode. - * - * 02 09 2011 terry.wu - * [WCXRP00000383] [MT6620 Wi-Fi][Driver] Separate WiFi and P2P driver into two modules - * Halt p2p module init and exit until TxThread finished p2p register and unregister. - * - * 02 08 2011 george.huang - * [WCXRP00000422] [MT6620 Wi-Fi][Driver] support query power mode OID handler - * Support querying power mode OID. - * - * 02 08 2011 yuche.tsai - * [WCXRP00000421] [Volunteer Patch][MT6620][Driver] Fix incorrect SSID length Issue - * Export Deactivation Network. - * - * 02 01 2011 jeffrey.chang - * [WCXRP00000414] KAL Timer is not unregistered when driver not loaded - * Unregister the KAL timer during driver unloading - * - * 01 26 2011 cm.chang - * [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument - * Allocate system RAM if fixed message or mgmt buffer is not available - * - * 01 19 2011 cp.wu - * [WCXRP00000371] [MT6620 Wi-Fi][Driver] make linux glue layer portable for Android 2.3.1 with Linux 2.6.35.7 - * add compile option to check linux version 2.6.35 for different usage of system API to improve portability - * - * 01 12 2011 cp.wu - * [WCXRP00000357] [MT6620 Wi-Fi][Driver][Bluetooth over Wi-Fi] add another net device interface for BT AMP - * implementation of separate BT_OVER_WIFI data path. - * - * 01 10 2011 cp.wu - * [WCXRP00000349] [MT6620 Wi-Fi][Driver] make kalIoctl() of linux port as a thread safe API to avoid potential issues due to multiple access - * use mutex to protect kalIoctl() for thread safe. - * - * 01 04 2011 cp.wu - * [WCXRP00000338] [MT6620 Wi-Fi][Driver] Separate kalMemAlloc into kmalloc and vmalloc implementations to ease physically continous memory demands - * separate kalMemAlloc() into virtually-continous and physically-continous type to ease slab system pressure - * - * 12 15 2010 cp.wu - * [WCXRP00000265] [MT6620 Wi-Fi][Driver] Remove set_mac_address routine from legacy Wi-Fi Android driver - * remove set MAC address. MAC address is always loaded from NVRAM instead. - * - * 12 10 2010 kevin.huang - * [WCXRP00000128] [MT6620 Wi-Fi][Driver] Add proc support to Android Driver for debug and driver status check - * Add Linux Proc Support - * - * 11 01 2010 yarco.yang - * [WCXRP00000149] [MT6620 WI-Fi][Driver]Fine tune performance on MT6516 platform - * Add GPIO debug function - * - * 11 01 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module - * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead - * 2) Remove CNM CH-RECOVER event handling - * 3) cfg read/write API renamed with kal prefix for unified naming rules. - * - * 10 26 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command - * 1) update NVRAM content template to ver 1.02 - * 2) add compile option for querying NIC capability (default: off) - * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting - * 4) correct auto-rate compiler error under linux (treat warning as error) - * 5) simplify usage of NVRAM and REG_INFO_T - * 6) add version checking between driver and firmware - * - * 10 21 2010 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * . - * - * 10 19 2010 jeffrey.chang - * [WCXRP00000120] [MT6620 Wi-Fi][Driver] Refine linux kernel module to the license of MTK propietary and enable MTK HIF by default - * Refine linux kernel module to the license of MTK and enable MTK HIF - * - * 10 18 2010 jeffrey.chang - * [WCXRP00000106] [MT6620 Wi-Fi][Driver] Enable setting multicast callback in Android - * . - * - * 10 18 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android - * complete implementation of Android NVRAM access - * - * 09 27 2010 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000065] Update BoW design and settings - * Update BCM/BoW design and settings. - * - * 09 23 2010 cp.wu - * [WCXRP00000051] [MT6620 Wi-Fi][Driver] WHQL test fail in MAC address changed item - * use firmware reported mac address right after wlanAdapterStart() as permanent address - * - * 09 21 2010 kevin.huang - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * Eliminate Linux Compile Warning - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 09 01 2010 wh.su - * NULL - * adding the wapi support for integration test. - * - * 08 18 2010 yarco.yang - * NULL - * 1. Fixed HW checksum offload function not work under Linux issue. - * 2. Add debug message. - * - * 08 16 2010 yarco.yang - * NULL - * Support Linux x86 - * - * 08 02 2010 jeffrey.chang - * NULL - * 1) modify tx service thread to avoid busy looping - * 2) add spin lock declartion for linux build - * - * 07 29 2010 jeffrey.chang - * NULL - * fix memory leak for module unloading - * - * 07 28 2010 jeffrey.chang - * NULL - * 1) remove unused spinlocks - * 2) enable encyption ioctls - * 3) fix scan ioctl which may cause supplicant to hang - * - * 07 23 2010 jeffrey.chang - * - * bug fix: allocate regInfo when disabling firmware download - * - * 07 23 2010 jeffrey.chang - * - * use glue layer api to decrease or increase counter atomically - * - * 07 22 2010 jeffrey.chang - * - * add new spinlock - * - * 07 19 2010 jeffrey.chang - * - * modify cmd/data path for new design - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 26 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * 1) Modify set mac address code - * 2) remove power managment macro - * - * 05 10 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * implement basic wi-fi direct framework - * - * 05 07 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * prevent supplicant accessing driver during resume - * - * 05 07 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add basic framework for implementating P2P driver hook. - * - * 04 27 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * 1) fix firmware download bug - * 2) remove query statistics for acelerating firmware download - * - * 04 27 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * follow Linux's firmware framework, and remove unused kal API - * - * 04 21 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * add for private ioctl support - * - * 04 19 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * Query statistics from firmware - * - * 04 19 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * modify tcp/ip checksum offload flags - * - * 04 16 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * fix tcp/ip checksum offload bug - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * * * * * * * * * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * * * * * * * * * * * * * * * 2) command sequence number is now increased atomically - * * * * * * * * * * * * * * * * * 3) private data could be hold and taken use for other purpose - * - * 04 09 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * fix spinlock usage - * - * 04 07 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * Set MAC address from firmware - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * rWlanInfo should be placed at adapter rather than glue due to most operations - * * * * * * are done in adapter layer. - * - * 04 07 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * (1)improve none-glue code portability - * * (2) disable set Multicast address during atomic context - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * adding debug module - * - * 03 31 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * modify the wapi related code for new driver's design. - * - * 03 30 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * emulate NDIS Pending OID facility - * - * 03 26 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * fix f/w download start and load address by using config.h - * - * 03 26 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * [WPD00003826] Initial import for Linux port - * adding firmware download support - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port -** \main\maintrunk.MT5921\52 2009-10-27 22:49:59 GMT mtk01090 -** Fix compile error for Linux EHPI driver -** \main\maintrunk.MT5921\51 2009-10-20 17:38:22 GMT mtk01090 -** Refine driver unloading and clean up procedure. Block requests, stop main thread and clean up queued requests, and then stop hw. -** \main\maintrunk.MT5921\50 2009-10-08 10:33:11 GMT mtk01090 -** Avoid accessing private data of net_device directly. Replace with netdev_priv(). Add more checking for input parameters and pointers. -** \main\maintrunk.MT5921\49 2009-09-28 20:19:05 GMT mtk01090 -** Add private ioctl to carry OID structures. Restructure public/private ioctl interfaces to Linux kernel. -** \main\maintrunk.MT5921\48 2009-09-03 13:58:46 GMT mtk01088 -** remove non-used code -** \main\maintrunk.MT5921\47 2009-09-03 11:40:25 GMT mtk01088 -** adding the module parameter for wapi -** \main\maintrunk.MT5921\46 2009-08-18 22:56:41 GMT mtk01090 -** Add Linux SDIO (with mmc core) support. -** Add Linux 2.6.21, 2.6.25, 2.6.26. -** Fix compile warning in Linux. -** \main\maintrunk.MT5921\45 2009-07-06 20:53:00 GMT mtk01088 -** adding the code to check the wapi 1x frame -** \main\maintrunk.MT5921\44 2009-06-23 23:18:55 GMT mtk01090 -** Add build option BUILD_USE_EEPROM and compile option CFG_SUPPORT_EXT_CONFIG for NVRAM support -** \main\maintrunk.MT5921\43 2009-02-16 23:46:51 GMT mtk01461 -** Revise the order of increasing u4TxPendingFrameNum because of CFG_TX_RET_TX_CTRL_EARLY -** \main\maintrunk.MT5921\42 2009-01-22 13:11:59 GMT mtk01088 -** set the tid and 1x value at same packet reserved field -** \main\maintrunk.MT5921\41 2008-10-20 22:43:53 GMT mtk01104 -** Fix wrong variable name "prDev" in wlanStop() -** \main\maintrunk.MT5921\40 2008-10-16 15:37:10 GMT mtk01461 -** add handle WLAN_STATUS_SUCCESS in wlanHardStartXmit() for CFG_TX_RET_TX_CTRL_EARLY -** \main\maintrunk.MT5921\39 2008-09-25 15:56:21 GMT mtk01461 -** Update driver for Code review -** \main\maintrunk.MT5921\38 2008-09-05 17:25:07 GMT mtk01461 -** Update Driver for Code Review -** \main\maintrunk.MT5921\37 2008-09-02 10:57:06 GMT mtk01461 -** Update driver for code review -** \main\maintrunk.MT5921\36 2008-08-05 01:53:28 GMT mtk01461 -** Add support for linux statistics -** \main\maintrunk.MT5921\35 2008-08-04 16:52:58 GMT mtk01461 -** Fix ASSERT if removing module in BG_SSID_SCAN state -** \main\maintrunk.MT5921\34 2008-06-13 22:52:24 GMT mtk01461 -** Revise status code handling in wlanHardStartXmit() for WLAN_STATUS_SUCCESS -** \main\maintrunk.MT5921\33 2008-05-30 18:56:53 GMT mtk01461 -** Not use wlanoidSetCurrentAddrForLinux() -** \main\maintrunk.MT5921\32 2008-05-30 14:39:40 GMT mtk01461 -** Remove WMM Assoc Flag -** \main\maintrunk.MT5921\31 2008-05-23 10:26:40 GMT mtk01084 -** modify wlanISR interface -** \main\maintrunk.MT5921\30 2008-05-03 18:52:36 GMT mtk01461 -** Fix Unset Broadcast filter when setMulticast -** \main\maintrunk.MT5921\29 2008-05-03 15:17:26 GMT mtk01461 -** Move Query Media Status to GLUE -** \main\maintrunk.MT5921\28 2008-04-24 22:48:21 GMT mtk01461 -** Revise set multicast function by using windows oid style for LP own back -** \main\maintrunk.MT5921\27 2008-04-24 12:00:08 GMT mtk01461 -** Fix multicast setting in Linux and add comment -** \main\maintrunk.MT5921\26 2008-03-28 10:40:22 GMT mtk01461 -** Fix set mac address func in Linux -** \main\maintrunk.MT5921\25 2008-03-26 15:37:26 GMT mtk01461 -** Add set MAC Address -** \main\maintrunk.MT5921\24 2008-03-26 14:24:53 GMT mtk01461 -** For Linux, set net_device has feature with checksum offload by default -** \main\maintrunk.MT5921\23 2008-03-11 14:50:52 GMT mtk01461 -** Fix typo -** \main\maintrunk.MT5921\22 2008-02-29 15:35:20 GMT mtk01088 -** add 1x decide code for sw port control -** \main\maintrunk.MT5921\21 2008-02-21 15:01:54 GMT mtk01461 -** Rearrange the set off place of GLUE spin lock in HardStartXmit -** \main\maintrunk.MT5921\20 2008-02-12 23:26:50 GMT mtk01461 -** Add debug option - Packet Order for Linux and add debug level - Event -** \main\maintrunk.MT5921\19 2007-12-11 00:11:12 GMT mtk01461 -** Fix SPIN_LOCK protection -** \main\maintrunk.MT5921\18 2007-11-30 17:02:25 GMT mtk01425 -** 1. Set Rx multicast packets mode before setting the address list -** \main\maintrunk.MT5921\17 2007-11-26 19:44:24 GMT mtk01461 -** Add OS_TIMESTAMP to packet -** \main\maintrunk.MT5921\16 2007-11-21 15:47:20 GMT mtk01088 -** fixed the unload module issue -** \main\maintrunk.MT5921\15 2007-11-07 18:37:38 GMT mtk01461 -** Fix compile warnning -** \main\maintrunk.MT5921\14 2007-11-02 01:03:19 GMT mtk01461 -** Unify TX Path for Normal and IBSS Power Save + IBSS neighbor learning -** \main\maintrunk.MT5921\13 2007-10-30 10:42:33 GMT mtk01425 -** 1. Refine for multicast list -** \main\maintrunk.MT5921\12 2007-10-25 18:08:13 GMT mtk01461 -** Add VOIP SCAN Support & Refine Roaming -** Revision 1.4 2007/07/05 07:25:33 MTK01461 -** Add Linux initial code, modify doc, add 11BB, RF init code -** -** Revision 1.3 2007/06/27 02:18:50 MTK01461 -** Update SCAN_FSM, Initial(Can Load Module), Proc(Can do Reg R/W), TX API -** -** Revision 1.2 2007/06/25 06:16:24 MTK01461 -** Update illustrations, gl_init.c, gl_kal.c, gl_kal.h, gl_os.h and RX API -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "gl_os.h" -#include "debug.h" -#include "wlan_lib.h" -#include "gl_wext.h" -#include "gl_cfg80211.h" -#include "precomp.h" - -#if defined(CONFIG_WIFI_CONTROL_FUNC) -#include -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) -#include -#else -#include -#endif -#endif /* CONFIG_WIFI_CONTROL_FUNC */ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -//#define MAX_IOREQ_NUM 10 -#if 1//def RK2818 - int driver_start_ok = 0; -#endif - -BOOLEAN fgIsUnderEarlierSuspend = false; - -struct semaphore g_halt_sem; -int g_u4HaltFlag = 0; - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -/* Tasklet mechanism is like buttom-half in Linux. We just want to - * send a signal to OS for interrupt defer processing. All resources - * are NOT allowed reentry, so txPacket, ISR-DPC and ioctl must avoid preempty. - */ -typedef struct _WLANDEV_INFO_T { - struct net_device *prDev; -} WLANDEV_INFO_T, *P_WLANDEV_INFO_T; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -MODULE_AUTHOR(NIC_AUTHOR); -MODULE_DESCRIPTION(NIC_DESC); -MODULE_SUPPORTED_DEVICE(NIC_NAME); - -/* WCNCR 00002676, -keep OS wake up for 100ms after sdio interrupt happen, -make sure that RX & TX procedure isn't suspended -*/ -KAL_WAKE_LOCK_T isr_wakelock; - -#if 0 - MODULE_LICENSE("MTK Propietary"); -#else - MODULE_LICENSE("GPL"); -#endif - -#define NIC_INF_NAME "wlan%d" /* interface name */ - -#if DBG - UINT_8 aucDebugModule[DBG_MODULE_NUM]; - UINT_32 u4DebugModule = 0; -#endif /* DBG */ - -//4 2007/06/26, mikewu, now we don't use this, we just fix the number of wlan device to 1 -static WLANDEV_INFO_T arWlanDevInfo[CFG_MAX_WLAN_DEVICES] = {{0}}; -static UINT_32 u4WlanDevNum = 0; /* How many NICs coexist now */ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ -#if CFG_ENABLE_WIFI_DIRECT -static SUB_MODULE_HANDLER rSubModHandler[SUB_MODULE_NUM] = {{NULL}}; -#endif - -#define CHAN2G(_channel, _freq, _flags) \ - { \ - .band = IEEE80211_BAND_2GHZ, \ - .center_freq = (_freq), \ - .hw_value = (_channel), \ - .flags = (_flags), \ - .max_antenna_gain = 0, \ - .max_power = 30, \ - } -static struct ieee80211_channel mtk_2ghz_channels[] = { - CHAN2G(1, 2412, 0), - CHAN2G(2, 2417, 0), - CHAN2G(3, 2422, 0), - CHAN2G(4, 2427, 0), - CHAN2G(5, 2432, 0), - CHAN2G(6, 2437, 0), - CHAN2G(7, 2442, 0), - CHAN2G(8, 2447, 0), - CHAN2G(9, 2452, 0), - CHAN2G(10, 2457, 0), - CHAN2G(11, 2462, 0), - CHAN2G(12, 2467, 0), - CHAN2G(13, 2472, 0), - CHAN2G(14, 2484, 0), -}; - -#define CHAN5G(_channel, _flags) \ - { \ - .band = IEEE80211_BAND_5GHZ, \ - .center_freq = 5000 + (5 * (_channel)), \ - .hw_value = (_channel), \ - .flags = (_flags), \ - .max_antenna_gain = 0, \ - .max_power = 30, \ - } -static struct ieee80211_channel mtk_5ghz_channels[] = { - CHAN5G(34, 0), CHAN5G(36, 0), - CHAN5G(38, 0), CHAN5G(40, 0), - CHAN5G(42, 0), CHAN5G(44, 0), - CHAN5G(46, 0), CHAN5G(48, 0), - CHAN5G(52, 0), CHAN5G(56, 0), - CHAN5G(60, 0), CHAN5G(64, 0), - CHAN5G(100, 0), CHAN5G(104, 0), - CHAN5G(108, 0), CHAN5G(112, 0), - CHAN5G(116, 0), CHAN5G(120, 0), - CHAN5G(124, 0), CHAN5G(128, 0), - CHAN5G(132, 0), CHAN5G(136, 0), - CHAN5G(140, 0), CHAN5G(149, 0), - CHAN5G(153, 0), CHAN5G(157, 0), - CHAN5G(161, 0), CHAN5G(165, 0), - CHAN5G(169, 0), CHAN5G(173, 0), - CHAN5G(184, 0), CHAN5G(188, 0), - CHAN5G(192, 0), CHAN5G(196, 0), - CHAN5G(200, 0), CHAN5G(204, 0), - CHAN5G(208, 0), CHAN5G(212, 0), - CHAN5G(216, 0), -}; - -/* for cfg80211 - rate table */ -static struct ieee80211_rate mtk_rates[] = { - RATETAB_ENT(10, 0x1000, 0), - RATETAB_ENT(20, 0x1001, 0), - RATETAB_ENT(55, 0x1002, 0), - RATETAB_ENT(110, 0x1003, 0), /* 802.11b */ - RATETAB_ENT(60, 0x2000, 0), - RATETAB_ENT(90, 0x2001, 0), - RATETAB_ENT(120, 0x2002, 0), - RATETAB_ENT(180, 0x2003, 0), - RATETAB_ENT(240, 0x2004, 0), - RATETAB_ENT(360, 0x2005, 0), - RATETAB_ENT(480, 0x2006, 0), - RATETAB_ENT(540, 0x2007, 0), /* 802.11a/g */ -}; - -#define mtk_a_rates (mtk_rates + 4) -#define mtk_a_rates_size (sizeof(mtk_rates) / sizeof(mtk_rates[0]) - 4) -#define mtk_g_rates (mtk_rates + 0) -#define mtk_g_rates_size (sizeof(mtk_rates) / sizeof(mtk_rates[0]) - 0) - -#define MT6620_MCS_INFO \ -{ \ - .rx_mask = {0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0},\ - .rx_highest = 0, \ - .tx_params = IEEE80211_HT_MCS_TX_DEFINED, \ -} - -#define MT6620_HT_CAP \ -{ \ - .ht_supported = true, \ - .cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 \ - | IEEE80211_HT_CAP_SM_PS \ - | IEEE80211_HT_CAP_GRN_FLD \ - | IEEE80211_HT_CAP_SGI_20 \ - | IEEE80211_HT_CAP_SGI_40, \ - .ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K, \ - .ampdu_density = IEEE80211_HT_MPDU_DENSITY_NONE, \ - .mcs = MT6620_MCS_INFO, \ -} - -/* public for both Legacy Wi-Fi / P2P access */ -struct ieee80211_supported_band mtk_band_2ghz = { - .band = IEEE80211_BAND_2GHZ, - .channels = mtk_2ghz_channels, - .n_channels = ARRAY_SIZE(mtk_2ghz_channels), - .bitrates = mtk_g_rates, - .n_bitrates = mtk_g_rates_size, - .ht_cap = MT6620_HT_CAP, -}; - -/* public for both Legacy Wi-Fi / P2P access */ -struct ieee80211_supported_band mtk_band_5ghz = { - .band = IEEE80211_BAND_5GHZ, - .channels = mtk_5ghz_channels, - .n_channels = ARRAY_SIZE(mtk_5ghz_channels), - .bitrates = mtk_a_rates, - .n_bitrates = mtk_a_rates_size, - .ht_cap = MT6620_HT_CAP, -}; - -static const UINT_32 mtk_cipher_suites[] = { - /* keep WEP first, it may be removed below */ - WLAN_CIPHER_SUITE_WEP40, - WLAN_CIPHER_SUITE_WEP104, - WLAN_CIPHER_SUITE_TKIP, - WLAN_CIPHER_SUITE_CCMP, - - /* keep last -- depends on hw flags! */ - WLAN_CIPHER_SUITE_AES_CMAC -}; - -static struct cfg80211_ops mtk_wlan_ops = { - .change_virtual_intf = mtk_cfg80211_change_iface, - .add_key = mtk_cfg80211_add_key, - .get_key = mtk_cfg80211_get_key, - .del_key = mtk_cfg80211_del_key, - .set_default_key = mtk_cfg80211_set_default_key, - .get_station = mtk_cfg80211_get_station, - .scan = mtk_cfg80211_scan, - .connect = mtk_cfg80211_connect, - .disconnect = mtk_cfg80211_disconnect, - .join_ibss = mtk_cfg80211_join_ibss, - .leave_ibss = mtk_cfg80211_leave_ibss, - .set_power_mgmt = mtk_cfg80211_set_power_mgmt, - .set_pmksa = mtk_cfg80211_set_pmksa, - .del_pmksa = mtk_cfg80211_del_pmksa, - .flush_pmksa = mtk_cfg80211_flush_pmksa, - - /* Action Frame TX/RX */ - .remain_on_channel = mtk_cfg80211_remain_on_channel, - .cancel_remain_on_channel = mtk_cfg80211_cancel_remain_on_channel, - .mgmt_tx = mtk_cfg80211_mgmt_tx, - .mgmt_tx_cancel_wait = mtk_cfg80211_mgmt_tx_cancel_wait, - #ifdef CONFIG_NL80211_TESTMODE - .testmode_cmd = mtk_cfg80211_testmode_cmd, - #endif -}; - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -#if defined(CONFIG_HAS_EARLYSUSPEND) -extern int glRegisterEarlySuspend( - struct early_suspend *prDesc, - early_suspend_callback wlanSuspend, - late_resume_callback wlanResume); - -extern int glUnregisterEarlySuspend(struct early_suspend *prDesc); -#endif - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/** - * Functions for Android WiFi card detection - */ -#if defined(CONFIG_WIFI_CONTROL_FUNC) - -static int g_wifidev_registered = 0; -static struct semaphore wifi_control_sem; -static struct wifi_platform_data *wifi_control_data = NULL; -static struct resource *wifi_irqres = NULL; - -static int wifi_add_dev(void); -static void wifi_del_dev(void); - -#define ANDROID_ERR(x) printk x -#define ANDROID_TRACE(x) printk x - -int wl_android_wifictrl_func_add(void) -{ - int ret = 0; - sema_init(&wifi_control_sem, 0); - - ret = wifi_add_dev(); - if (ret) { - ANDROID_ERR(("%s: platform_driver_register failed\n", __FUNCTION__)); - return ret; - } - g_wifidev_registered = 1; - - /* Waiting callback after platform_driver_register is done or exit with error */ - if (down_timeout(&wifi_control_sem, msecs_to_jiffies(1000)) != 0) { - ret = -EINVAL; - ANDROID_ERR(("%s: platform_driver_register timeout\n", __FUNCTION__)); - } - - printk("wl_android_wifictrl_func_add success.\n"); - return ret; -} - -void wl_android_wifictrl_func_del(void) -{ - if (g_wifidev_registered) - { - wifi_del_dev(); - g_wifidev_registered = 0; - } -} - -int wifi_set_power(int on, unsigned long msec) -{ - ANDROID_ERR(("%s = %d\n", __FUNCTION__, on)); - if (wifi_control_data && wifi_control_data->set_power) { - wifi_control_data->set_power(on); - } - if (msec) - msleep(msec); - return 0; -} - -int wifi_set_reset(int on, unsigned long msec) -{ - ANDROID_ERR(("%s = %d\n", __FUNCTION__, on)); - if (wifi_control_data && wifi_control_data->set_reset) { - wifi_control_data->set_reset(on); - } - if (msec) - msleep(msec); - return 0; -} - -static int wifi_set_carddetect(int on) -{ - ANDROID_ERR(("%s = %d\n", __FUNCTION__, on)); - if (wifi_control_data && wifi_control_data->set_carddetect) { - wifi_control_data->set_carddetect(on); - } - return 0; -} - -static int wifi_probe(struct platform_device *pdev) -{ - struct wifi_platform_data *wifi_ctrl = - (struct wifi_platform_data *)(pdev->dev.platform_data); - - ANDROID_ERR(("## %s\n", __FUNCTION__)); - wifi_irqres = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "bcmdhd_wlan_irq"); - if (wifi_irqres == NULL) - wifi_irqres = platform_get_resource_byname(pdev, - IORESOURCE_IRQ, "bcm4329_wlan_irq"); - wifi_control_data = wifi_ctrl; - - //wifi_set_power(0, 0); - //wifi_set_reset(0, 10); - - wifi_set_power(1, 0); - //wifi_set_reset(1, 12); /* Power On */ - - wifi_set_carddetect(1); /* CardDetect (0->1) */ - - up(&wifi_control_sem); - return 0; -} - -static int wifi_remove(struct platform_device *pdev) -{ - struct wifi_platform_data *wifi_ctrl = - (struct wifi_platform_data *)(pdev->dev.platform_data); - - ANDROID_ERR(("## %s\n", __FUNCTION__)); - wifi_control_data = wifi_ctrl; - - wifi_set_power(0, 0); /* Power Off */ - //wifi_set_reset(0, 0); - - wifi_set_carddetect(0); /* CardDetect (1->0) */ - - return 0; -} - -static int wifi_suspend(struct platform_device *pdev, pm_message_t state) -{ - ANDROID_TRACE(("##> %s\n", __FUNCTION__)); - return 0; -} - -static int wifi_resume(struct platform_device *pdev) -{ - ANDROID_TRACE(("##> %s\n", __FUNCTION__)); - return 0; -} - -static struct platform_driver wifi_device = { - .probe = wifi_probe, - .remove = wifi_remove, - .suspend = wifi_suspend, - .resume = wifi_resume, - .driver = { - .name = "bcmdhd_wlan", - } -}; - -static struct platform_driver wifi_device_legacy = { - .probe = wifi_probe, - .remove = wifi_remove, - .suspend = wifi_suspend, - .resume = wifi_resume, - .driver = { - .name = "bcm4329_wlan", - } -}; - -static int wifi_add_dev(void) -{ - ANDROID_TRACE(("## Calling platform_driver_register\n")); - platform_driver_register(&wifi_device); - platform_driver_register(&wifi_device_legacy); - return 0; -} - -static void wifi_del_dev(void) -{ - ANDROID_TRACE(("## Unregister platform_driver_register\n")); - platform_driver_unregister(&wifi_device); - platform_driver_unregister(&wifi_device_legacy); -} -#endif /* defined(CONFIG_WIFI_CONTROL_FUNC) */ - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31) -/*----------------------------------------------------------------------------*/ -/*! -* \brief Override the implementation of select queue -* -* \param[in] dev Pointer to struct net_device -* \param[in] skb Pointer to struct skb_buff -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -unsigned int _cfg80211_classify8021d(struct sk_buff *skb) -{ - unsigned int dscp = 0; - - /* skb->priority values from 256->263 are magic values - * directly indicate a specific 802.1d priority. This is - * to allow 802.1d priority to be passed directly in from - * tags - */ - - if (skb->priority >= 256 && skb->priority <= 263) { - return skb->priority - 256; - } - switch (skb->protocol) { - case htons(ETH_P_IP): - dscp = ip_hdr(skb)->tos & 0xfc; - break; - } - return dscp >> 5; -} - - -static const UINT_16 au16Wlan1dToQueueIdx[8] = { 1, 0, 0, 1, 2, 2, 3, 3 }; - -static UINT_16 -wlanSelectQueue( - struct net_device *dev, - struct sk_buff *skb) -{ - skb->priority = _cfg80211_classify8021d(skb); - - return au16Wlan1dToQueueIdx[skb->priority]; -} -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Load NVRAM data and translate it into REG_INFO_T -* -* \param[in] prGlueInfo Pointer to struct GLUE_INFO_T -* \param[out] prRegInfo Pointer to struct REG_INFO_T -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -static void -glLoadNvram ( - IN P_GLUE_INFO_T prGlueInfo, - OUT P_REG_INFO_T prRegInfo - ) -{ - UINT_32 i, j; - UINT_8 aucTmp[2]; - PUINT_8 pucDest; - - ASSERT(prGlueInfo); - ASSERT(prRegInfo); - - if((!prGlueInfo) || (!prRegInfo)) { - return; - } - - if(kalCfgDataRead16(prGlueInfo, - sizeof(WIFI_CFG_PARAM_STRUCT) - sizeof(UINT_16), - (PUINT_16)aucTmp) == TRUE) { - prGlueInfo->fgNvramAvailable = TRUE; - - // load MAC Address - for (i = 0 ; i < sizeof(PARAM_MAC_ADDR_LEN) ; i += sizeof(UINT_16)) { - kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, aucMacAddress) + i, - (PUINT_16) (((PUINT_8)prRegInfo->aucMacAddr) + i)); - } - - // load country code - kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, aucCountryCode[0]), - (PUINT_16)aucTmp); - - // cast to wide characters - prRegInfo->au2CountryCode[0] = (UINT_16) aucTmp[0]; - prRegInfo->au2CountryCode[1] = (UINT_16) aucTmp[1]; - - // load default normal TX power - for (i = 0 ; i < sizeof(TX_PWR_PARAM_T) ; i += sizeof(UINT_16)) { - kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, rTxPwr) + i, - (PUINT_16) (((PUINT_8)&(prRegInfo->rTxPwr)) + i)); - } - - // load feature flags - kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, ucTxPwrValid), - (PUINT_16)aucTmp); - prRegInfo->ucTxPwrValid = aucTmp[0]; - prRegInfo->ucSupport5GBand = aucTmp[1]; - - kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, uc2G4BwFixed20M), - (PUINT_16)aucTmp); - prRegInfo->uc2G4BwFixed20M = aucTmp[0]; - prRegInfo->uc5GBwFixed20M = aucTmp[1]; - - kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, ucEnable5GBand), - (PUINT_16)aucTmp); - prRegInfo->ucEnable5GBand = aucTmp[0]; - - /* load EFUSE overriding part */ - for (i = 0 ; i < sizeof(prRegInfo->aucEFUSE) ; i += sizeof(UINT_16)) { - kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, aucEFUSE) + i, - (PUINT_16) (((PUINT_8)&(prRegInfo->aucEFUSE)) + i)); - } - - /* load band edge tx power control */ - kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, fg2G4BandEdgePwrUsed), - (PUINT_16)aucTmp); - prRegInfo->fg2G4BandEdgePwrUsed = (BOOLEAN)aucTmp[0]; - if (aucTmp[0]) { - prRegInfo->cBandEdgeMaxPwrCCK = (INT_8)aucTmp[1]; - - kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, cBandEdgeMaxPwrOFDM20), - (PUINT_16)aucTmp); - prRegInfo->cBandEdgeMaxPwrOFDM20 = (INT_8)aucTmp[0]; - prRegInfo->cBandEdgeMaxPwrOFDM40 = (INT_8)aucTmp[1]; - } - - /* load regulation subbands */ - kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, ucRegChannelListMap), - (PUINT_16)aucTmp); - prRegInfo->eRegChannelListMap = (ENUM_REG_CH_MAP_T) aucTmp[0]; - prRegInfo->ucRegChannelListIndex = aucTmp[1]; - - if (prRegInfo->eRegChannelListMap == REG_CH_MAP_CUSTOMIZED) { - for (i = 0 ; i < MAX_SUBBAND_NUM; i++) { - pucDest = (PUINT_8) &prRegInfo->rDomainInfo.rSubBand[i]; - for (j = 0; j < 6; j += sizeof(UINT_16)) { - kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, aucRegSubbandInfo) - + (i * 6 + j), - (PUINT_16)aucTmp); - - *pucDest++ = aucTmp[0]; - *pucDest++ = aucTmp[1]; - } - } - } - } - else { - prGlueInfo->fgNvramAvailable = FALSE; - } - - return; -} - - -#if CFG_ENABLE_WIFI_DIRECT -/*----------------------------------------------------------------------------*/ -/*! -* \brief called by txthread, run sub module init function -* -* \param[in] prGlueInfo Pointer to struct GLUE_INFO_T -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanSubModRunInit( - P_GLUE_INFO_T prGlueInfo - ) -{ - /*now, we only have p2p module*/ - if(rSubModHandler[P2P_MODULE].fgIsInited == FALSE) { - rSubModHandler[P2P_MODULE].subModInit(prGlueInfo); - rSubModHandler[P2P_MODULE].fgIsInited = TRUE; - } - -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief called by txthread, run sub module exit function -* -* \param[in] prGlueInfo Pointer to struct GLUE_INFO_T -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanSubModRunExit( - P_GLUE_INFO_T prGlueInfo - ) -{ - /*now, we only have p2p module*/ - if(rSubModHandler[P2P_MODULE].fgIsInited == TRUE) { - rSubModHandler[P2P_MODULE].subModExit(prGlueInfo); - rSubModHandler[P2P_MODULE].fgIsInited = FALSE; - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief set sub module init flag, force TxThread to run sub modle init -* -* \param[in] prGlueInfo Pointer to struct GLUE_INFO_T -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wlanSubModInit( - P_GLUE_INFO_T prGlueInfo - ) -{ - //4 Mark HALT, notify main thread to finish current job - prGlueInfo->u4Flag |= GLUE_FLAG_SUB_MOD_INIT; - /* wake up main thread */ - wake_up_interruptible(&prGlueInfo->waitq); - /* wait main thread finish sub module INIT*/ - wait_for_completion_interruptible(&prGlueInfo->rSubModComp); - -#if 0 - if(prGlueInfo->prAdapter->fgIsP2PRegistered) { - p2pNetRegister(prGlueInfo); - } -#endif - - return TRUE; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief set sub module exit flag, force TxThread to run sub modle exit -* -* \param[in] prGlueInfo Pointer to struct GLUE_INFO_T -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wlanSubModExit( - P_GLUE_INFO_T prGlueInfo - ) -{ -#if 0 - if(prGlueInfo->prAdapter->fgIsP2PRegistered) { - p2pNetUnregister(prGlueInfo); - } -#endif - - //4 Mark HALT, notify main thread to finish current job - prGlueInfo->u4Flag |= GLUE_FLAG_SUB_MOD_EXIT; - /* wake up main thread */ - wake_up_interruptible(&prGlueInfo->waitq); - /* wait main thread finish sub module EXIT */ - wait_for_completion_interruptible(&prGlueInfo->rSubModComp); - - return TRUE; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief set by sub module, indicate sub module is already inserted -* -* \param[in] rSubModInit, function pointer point to sub module init function -* \param[in] rSubModExit, function pointer point to sub module exit function -* \param[in] eSubModIdx, sub module index -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -wlanSubModRegisterInitExit( - SUB_MODULE_INIT rSubModInit, - SUB_MODULE_EXIT rSubModExit, - ENUM_SUB_MODULE_IDX_T eSubModIdx - ) -{ - rSubModHandler[eSubModIdx].subModInit = rSubModInit; - rSubModHandler[eSubModIdx].subModExit = rSubModExit; - rSubModHandler[eSubModIdx].fgIsInited = FALSE; -} - -#if 0 -/*----------------------------------------------------------------------------*/ -/*! -* \brief check wlan is launched or not -* -* \param[in] (none) -* -* \return TRUE, wlan is already started -* FALSE, wlan is not started yet -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wlanIsLaunched( - VOID - ) -{ - struct net_device *prDev = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - - //4 <0> Sanity check - ASSERT(u4WlanDevNum <= CFG_MAX_WLAN_DEVICES); - if (0 == u4WlanDevNum) { - return FALSE; - } - - prDev = arWlanDevInfo[u4WlanDevNum-1].prDev; - - ASSERT(prDev); - if (NULL == prDev) { - return FALSE; - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - if (NULL == prGlueInfo) { - return FALSE; - } - - return prGlueInfo->prAdapter->fgIsWlanLaunched; -} - -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Export wlan GLUE_INFO_T pointer to p2p module -* -* \param[in] prGlueInfo Pointer to struct GLUE_INFO_T -* -* \return TRUE: get GlueInfo pointer successfully -* FALSE: wlan is not started yet -*/ -/*---------------------------------------------------------------------------*/ -BOOLEAN -wlanExportGlueInfo( - P_GLUE_INFO_T *prGlueInfoExpAddr - ) -{ - struct net_device *prDev = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - - if (0 == u4WlanDevNum) { - return FALSE; - } - - prDev = arWlanDevInfo[u4WlanDevNum-1].prDev; - if (NULL == prDev) { - return FALSE; - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - if (NULL == prGlueInfo) { - return FALSE; - } - - if(FALSE == prGlueInfo->prAdapter->fgIsWlanLaunched) { - return FALSE; - } - - *prGlueInfoExpAddr = prGlueInfo; - return TRUE; -} - -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Release prDev from wlandev_array and free tasklet object related to it. -* -* \param[in] prDev Pointer to struct net_device -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -static void -wlanClearDevIdx ( - struct net_device *prDev - ) -{ - int i; - - ASSERT(prDev); - - for (i = 0; i < CFG_MAX_WLAN_DEVICES; i++) { - if (arWlanDevInfo[i].prDev == prDev) { - arWlanDevInfo[i].prDev = NULL; - u4WlanDevNum--; - } - } - - return; -} /* end of wlanClearDevIdx() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Allocate an unique interface index, net_device::ifindex member for this -* wlan device. Store the net_device in wlandev_array, and initialize -* tasklet object related to it. -* -* \param[in] prDev Pointer to struct net_device -* -* \retval >= 0 The device number. -* \retval -1 Fail to get index. -*/ -/*----------------------------------------------------------------------------*/ -static int -wlanGetDevIdx ( - struct net_device *prDev - ) -{ - int i; - - ASSERT(prDev); - - for (i = 0; i < CFG_MAX_WLAN_DEVICES; i++) { - if (arWlanDevInfo[i].prDev == (struct net_device *) NULL) { - /* Reserve 2 bytes space to store one digit of - * device number and NULL terminator. - */ - arWlanDevInfo[i].prDev = prDev; - u4WlanDevNum++; - return i; - } - } - - return -1; -} /* end of wlanGetDevIdx() */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief A method of struct net_device, a primary SOCKET interface to configure -* the interface lively. Handle an ioctl call on one of our devices. -* Everything Linux ioctl specific is done here. Then we pass the contents -* of the ifr->data to the request message handler. -* -* \param[in] prDev Linux kernel netdevice -* -* \param[in] prIFReq Our private ioctl request structure, typed for the generic -* struct ifreq so we can use ptr to function -* -* \param[in] cmd Command ID -* -* \retval WLAN_STATUS_SUCCESS The IOCTL command is executed successfully. -* \retval OTHER The execution of IOCTL command is failed. -*/ -/*----------------------------------------------------------------------------*/ -int -wlanDoIOCTL( - struct net_device *prDev, - struct ifreq *prIFReq, - int i4Cmd - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - int ret = 0; - - /* Verify input parameters for the following functions */ - ASSERT(prDev && prIFReq); - if (!prDev || !prIFReq) { - DBGLOG(INIT, WARN, ("%s Invalid input data\n", __FUNCTION__)); - return -EINVAL; - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - if (!prGlueInfo) { - DBGLOG(INIT, WARN, ("%s No glue info\n", __FUNCTION__)); - return -EFAULT; - } - - if (prGlueInfo->u4ReadyFlag == 0) { - return -EINVAL; - } - - printk ("ioctl %x\n", i4Cmd); - - if (i4Cmd == SIOCGIWPRIV) { - /* 0x8B0D, get private ioctl table */ - ret = wext_get_priv(prDev, prIFReq); - } - else if ((i4Cmd >= SIOCIWFIRST) && (i4Cmd < SIOCIWFIRSTPRIV)) { - /* 0x8B00 ~ 0x8BDF, wireless extension region */ - ret = wext_support_ioctl(prDev, prIFReq, i4Cmd); - } - else if ((i4Cmd >= SIOCIWFIRSTPRIV) && (i4Cmd < SIOCIWLASTPRIV)) { - /* 0x8BE0 ~ 0x8BFF, private ioctl region */ - ret = priv_support_ioctl(prDev, prIFReq, i4Cmd); - } - else { - DBGLOG(INIT, WARN, ("Unexpected ioctl command: 0x%04x\n", i4Cmd)); - /* return 0 for safe? */ - } - - return ret; -} /* end of wlanDoIOCTL() */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is to set multicast list and set rx mode. -* -* \param[in] prDev Pointer to struct net_device -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ - -static struct delayed_work workq; -static struct net_device *gPrDev; - -static void -wlanSetMulticastList (struct net_device *prDev) -{ - gPrDev = prDev; - schedule_delayed_work(&workq, 0); -} - -/* FIXME: Since we cannot sleep in the wlanSetMulticastList, we arrange - * another workqueue for sleeping. We don't want to block - * tx_thread, so we can't let tx_thread to do this */ - -static void -wlanSetMulticastListWorkQueue (struct work_struct *work) { - - P_GLUE_INFO_T prGlueInfo = NULL; - UINT_32 u4PacketFilter = 0; - UINT_32 u4SetInfoLen; - struct net_device *prDev = gPrDev; - - down(&g_halt_sem); - if (g_u4HaltFlag) { - up(&g_halt_sem); - return; - } - - prGlueInfo = (NULL != prDev) ? *((P_GLUE_INFO_T *) netdev_priv(prDev)) : NULL; - ASSERT(prDev); - ASSERT(prGlueInfo); - if (!prDev || !prGlueInfo) { - DBGLOG(INIT, WARN, ("abnormal dev or skb: prDev(0x%p), prGlueInfo(0x%p)\n", - prDev, prGlueInfo)); - up(&g_halt_sem); - return; - } - - if (prDev->flags & IFF_PROMISC) { - u4PacketFilter |= PARAM_PACKET_FILTER_PROMISCUOUS; - } - - if (prDev->flags & IFF_BROADCAST) { - u4PacketFilter |= PARAM_PACKET_FILTER_BROADCAST; - } - - if (prDev->flags & IFF_MULTICAST) { - if ((prDev->flags & IFF_ALLMULTI) || -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) - (netdev_mc_count(prDev) > MAX_NUM_GROUP_ADDR)) { -#else - (prDev->mc_count > MAX_NUM_GROUP_ADDR)) { -#endif - - u4PacketFilter |= PARAM_PACKET_FILTER_ALL_MULTICAST; - } - else { - u4PacketFilter |= PARAM_PACKET_FILTER_MULTICAST; - } - } - - up(&g_halt_sem); - - if (kalIoctl(prGlueInfo, - wlanoidSetCurrentPacketFilter, - &u4PacketFilter, - sizeof(u4PacketFilter), - FALSE, - FALSE, - TRUE, - FALSE, - &u4SetInfoLen) != WLAN_STATUS_SUCCESS) { - return; - } - - - if (u4PacketFilter & PARAM_PACKET_FILTER_MULTICAST) { - /* Prepare multicast address list */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) - struct netdev_hw_addr *ha; -#else - struct dev_mc_list *prMcList; -#endif - PUINT_8 prMCAddrList = NULL; - UINT_32 i = 0; - - down(&g_halt_sem); - if (g_u4HaltFlag) { - up(&g_halt_sem); - return; - } - - prMCAddrList = kalMemAlloc(MAX_NUM_GROUP_ADDR * ETH_ALEN, VIR_MEM_TYPE); - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) - netdev_for_each_mc_addr(ha, prDev) { - if(i < MAX_NUM_GROUP_ADDR) { - memcpy((prMCAddrList + i * ETH_ALEN), ha->addr, ETH_ALEN); - i++; - } - } -#else - for (i = 0, prMcList = prDev->mc_list; - (prMcList) && (i < prDev->mc_count) && (i < MAX_NUM_GROUP_ADDR); - i++, prMcList = prMcList->next) { - memcpy((prMCAddrList + i * ETH_ALEN), prMcList->dmi_addr, ETH_ALEN); - } -#endif - - up(&g_halt_sem); - - kalIoctl(prGlueInfo, - wlanoidSetMulticastList, - prMCAddrList, - (i * ETH_ALEN), - FALSE, - FALSE, - TRUE, - FALSE, - &u4SetInfoLen); - - kalMemFree(prMCAddrList, VIR_MEM_TYPE, MAX_NUM_GROUP_ADDR * ETH_ALEN); - } - - return; -} /* end of wlanSetMulticastList() */ - - -/* FIXME: Since we cannot sleep in the wlanSetMulticastList, we arrange - * another workqueue for sleeping. We don't want to block - * tx_thread, so we can't let tx_thread to do this */ - -void -p2pSetMulticastListWorkQueueWrapper (P_GLUE_INFO_T prGlueInfo) { - - ASSERT(prGlueInfo); - - if (!prGlueInfo) { - DBGLOG(INIT, WARN, ("abnormal dev or skb: prGlueInfo(0x%p)\n", - prGlueInfo)); - return; - } - -#if CFG_ENABLE_WIFI_DIRECT - if(prGlueInfo->prAdapter->fgIsP2PRegistered) { - mtk_p2p_wext_set_Multicastlist(prGlueInfo); - } -#endif - - return; -} /* end of p2pSetMulticastListWorkQueueWrapper() */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is TX entry point of NET DEVICE. -* -* \param[in] prSkb Pointer of the sk_buff to be sent -* \param[in] prDev Pointer to struct net_device -* -* \retval NETDEV_TX_OK - on success. -* \retval NETDEV_TX_BUSY - on failure, packet will be discarded by upper layer. -*/ -/*----------------------------------------------------------------------------*/ -int -wlanHardStartXmit( - struct sk_buff *prSkb, - struct net_device *prDev - ) -{ - P_GLUE_INFO_T prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - - P_QUE_ENTRY_T prQueueEntry = NULL; - P_QUE_T prTxQueue = NULL; - UINT_16 u2QueueIdx = 0; - -#if CFG_BOW_TEST - UINT_32 i; -#endif - - GLUE_SPIN_LOCK_DECLARATION(); - - ASSERT(prSkb); - ASSERT(prDev); - ASSERT(prGlueInfo); - - if (prGlueInfo->u4Flag & GLUE_FLAG_HALT) { - DBGLOG(INIT, INFO, ("GLUE_FLAG_HALT skip tx\n")); - dev_kfree_skb(prSkb); - return NETDEV_TX_OK; - } - - prQueueEntry = (P_QUE_ENTRY_T) GLUE_GET_PKT_QUEUE_ENTRY(prSkb); - prTxQueue = &prGlueInfo->rTxQueue; - -#if CFG_BOW_TEST - DBGLOG(BOW, TRACE, ("sk_buff->len: %d\n", prSkb->len)); - DBGLOG(BOW, TRACE, ("sk_buff->data_len: %d\n", prSkb->data_len)); - DBGLOG(BOW, TRACE, ("sk_buff->data:\n")); - - for(i = 0; i < prSkb->len && i < 64; i++) - { - LOG_FUNC("%02x ", prSkb->data[i]); - - if((i+1)%16 ==0) - { - LOG_FUNC("\n"); - } - } - - LOG_FUNC("\n"); -#endif - - if (wlanProcessSecurityFrame(prGlueInfo->prAdapter, (P_NATIVE_PACKET) prSkb) == FALSE) { - - #if CFG_DBG_GPIO_PINS - { - /* TX request from OS */ - mtk_wcn_stp_debug_gpio_assert(IDX_TX_REQ, DBG_TIE_LOW); - kalUdelay(1); - mtk_wcn_stp_debug_gpio_assert(IDX_TX_REQ, DBG_TIE_HIGH); - } - #endif - -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 26) - u2QueueIdx = skb_get_queue_mapping(prSkb); - ASSERT(u2QueueIdx < CFG_MAX_TXQ_NUM); -#endif - - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_TX_QUE); - QUEUE_INSERT_TAIL(prTxQueue, prQueueEntry); - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_TX_QUE); - - GLUE_INC_REF_CNT(prGlueInfo->i4TxPendingFrameNum); - GLUE_INC_REF_CNT(prGlueInfo->ai4TxPendingFrameNumPerQueue[NETWORK_TYPE_AIS_INDEX][u2QueueIdx]); - -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 26) - if (prGlueInfo->ai4TxPendingFrameNumPerQueue[NETWORK_TYPE_AIS_INDEX][u2QueueIdx] >= CFG_TX_STOP_NETIF_PER_QUEUE_THRESHOLD) { - netif_stop_subqueue(prDev, u2QueueIdx); - } -#else - if (prGlueInfo->i4TxPendingFrameNum >= CFG_TX_STOP_NETIF_QUEUE_THRESHOLD) { - netif_stop_queue(prDev); - } -#endif - } else { - //printk("is security frame\n"); - - GLUE_INC_REF_CNT(prGlueInfo->i4TxPendingSecurityFrameNum); - } - - DBGLOG(TX, EVENT, ("\n+++++ pending frame %d len = %d +++++\n", prGlueInfo->i4TxPendingFrameNum, prSkb->len)); - prGlueInfo->rNetDevStats.tx_bytes += prSkb->len; - prGlueInfo->rNetDevStats.tx_packets++; - - //pr->u4Flag |= GLUE_FLAG_TXREQ; - //wake_up_interruptible(&prGlueInfo->waitq); - kalSetEvent(prGlueInfo); - - - /* For Linux, we'll always return OK FLAG, because we'll free this skb by ourself */ - return NETDEV_TX_OK; -} /* end of wlanHardStartXmit() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief A method of struct net_device, to get the network interface statistical -* information. -* -* Whenever an application needs to get statistics for the interface, this method -* is called. This happens, for example, when ifconfig or netstat -i is run. -* -* \param[in] prDev Pointer to struct net_device. -* -* \return net_device_stats buffer pointer. -*/ -/*----------------------------------------------------------------------------*/ -struct net_device_stats * -wlanGetStats ( - IN struct net_device *prDev - ) -{ - P_GLUE_INFO_T prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - - #if 0 - WLAN_STATUS rStatus; - UINT_32 u4XmitError = 0; - UINT_32 u4XmitOk = 0; - UINT_32 u4RecvError = 0; - UINT_32 u4RecvOk = 0; - UINT_32 u4BufLen; - - ASSERT(prDev); - - /* @FIX ME: need a more clear way to do this */ - - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryXmitError, - &u4XmitError, - sizeof(UINT_32), - TRUE, - TRUE, - TRUE, - &u4BufLen); - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryXmitOk, - &u4XmitOk, - sizeof(UINT_32), - TRUE, - TRUE, - TRUE, - &u4BufLen); - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryRcvOk, - &u4RecvOk, - sizeof(UINT_32), - TRUE, - TRUE, - TRUE, - &u4BufLen); - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryRcvError, - &u4RecvError, - sizeof(UINT_32), - TRUE, - TRUE, - TRUE, - &u4BufLen); - prGlueInfo->rNetDevStats.rx_packets = u4RecvOk; - prGlueInfo->rNetDevStats.tx_packets = u4XmitOk; - prGlueInfo->rNetDevStats.tx_errors = u4XmitError; - prGlueInfo->rNetDevStats.rx_errors = u4RecvError; - //prGlueInfo->rNetDevStats.rx_bytes = rCustomNetDevStats.u4RxBytes; - //prGlueInfo->rNetDevStats.tx_bytes = rCustomNetDevStats.u4TxBytes; - //prGlueInfo->rNetDevStats.rx_errors = rCustomNetDevStats.u4RxErrors; - //prGlueInfo->rNetDevStats.multicast = rCustomNetDevStats.u4Multicast; - #endif - //prGlueInfo->rNetDevStats.rx_packets = 0; - //prGlueInfo->rNetDevStats.tx_packets = 0; - prGlueInfo->rNetDevStats.tx_errors = 0; - prGlueInfo->rNetDevStats.rx_errors = 0; - //prGlueInfo->rNetDevStats.rx_bytes = 0; - //prGlueInfo->rNetDevStats.tx_bytes = 0; - prGlueInfo->rNetDevStats.rx_errors = 0; - prGlueInfo->rNetDevStats.multicast = 0; - - return &prGlueInfo->rNetDevStats; - -} /* end of wlanGetStats() */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief A function for prDev->init -* -* \param[in] prDev Pointer to struct net_device. -* -* \retval 0 The execution of wlanInit succeeds. -* \retval -ENXIO No such device. -*/ -/*----------------------------------------------------------------------------*/ -static int -wlanInit( - struct net_device *prDev - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - if (!prDev) { - return -ENXIO; - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 12) - INIT_DELAYED_WORK(&workq, wlanSetMulticastListWorkQueue); -#else - INIT_DELAYED_WORK(&workq, wlanSetMulticastListWorkQueue, NULL); -#endif - - return 0; /* success */ -} /* end of wlanInit() */ - -void mtk_init_delayed_work(struct delayed_work *work, void *func) -{ -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 12) - INIT_DELAYED_WORK(work, func); -#else - INIT_DELAYED_WORK(work, func, NULL); -#endif -} -EXPORT_SYMBOL(mtk_init_delayed_work); - -/*----------------------------------------------------------------------------*/ -/*! -* \brief A function for prDev->uninit -* -* \param[in] prDev Pointer to struct net_device. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -static void -wlanUninit( - struct net_device *prDev - ) -{ - return; -} /* end of wlanUninit() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief A function for prDev->open -* -* \param[in] prDev Pointer to struct net_device. -* -* \retval 0 The execution of wlanOpen succeeds. -* \retval < 0 The execution of wlanOpen failed. -*/ -/*----------------------------------------------------------------------------*/ -static int -wlanOpen( - struct net_device *prDev - ) -{ - ASSERT(prDev); - -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 26) - netif_tx_start_all_queues(prDev); -#else - netif_start_queue(prDev); -#endif - - return 0; /* success */ -} /* end of wlanOpen() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief A function for prDev->stop -* -* \param[in] prDev Pointer to struct net_device. -* -* \retval 0 The execution of wlanStop succeeds. -* \retval < 0 The execution of wlanStop failed. -*/ -/*----------------------------------------------------------------------------*/ -static int -wlanStop( - struct net_device *prDev - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - struct cfg80211_scan_request *prScanRequest = NULL; - GLUE_SPIN_LOCK_DECLARATION(); - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - - /* CFG80211 down */ - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_NET_DEV); - if(prGlueInfo->prScanRequest != NULL) { - prScanRequest = prGlueInfo->prScanRequest; - prGlueInfo->prScanRequest = NULL; - } - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_NET_DEV); - - if(prScanRequest) { - cfg80211_scan_done(prScanRequest, TRUE); - } - -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 26) - netif_tx_stop_all_queues(prDev); -#else - netif_stop_queue(prDev); -#endif - - return 0; /* success */ -} /* end of wlanStop() */ - - -/*----------------------------------------------------------------------------*/ -/*! - * \brief Update Channel table for cfg80211 for Wi-Fi Direct based on current country code - * - * \param[in] prGlueInfo Pointer to glue info - * - * \return none - */ -/*----------------------------------------------------------------------------*/ -VOID -wlanUpdateChannelTable( - P_GLUE_INFO_T prGlueInfo - ) -{ - UINT_8 i, j; - UINT_8 ucNumOfChannel; - RF_CHANNEL_INFO_T aucChannelList[ARRAY_SIZE(mtk_2ghz_channels) + ARRAY_SIZE(mtk_5ghz_channels)]; - - // 1. Disable all channel - for(i = 0; i < ARRAY_SIZE(mtk_2ghz_channels); i++) { - mtk_2ghz_channels[i].flags |= IEEE80211_CHAN_DISABLED; - } - - for(i = 0; i < ARRAY_SIZE(mtk_5ghz_channels); i++) { - mtk_5ghz_channels[i].flags |= IEEE80211_CHAN_DISABLED; - } - - // 2. Get current domain channel list - rlmDomainGetChnlList(prGlueInfo->prAdapter, - BAND_NULL, - ARRAY_SIZE(mtk_2ghz_channels) + ARRAY_SIZE(mtk_5ghz_channels), - &ucNumOfChannel, - aucChannelList); - - // 3. Enable specific channel based on domain channel list - for(i = 0; i < ucNumOfChannel; i++) { - switch(aucChannelList[i].eBand) { - case BAND_2G4: - for(j = 0 ; j < ARRAY_SIZE(mtk_2ghz_channels) ; j++) { - if(mtk_2ghz_channels[j].hw_value == aucChannelList[i].ucChannelNum) { - mtk_2ghz_channels[j].flags &= ~IEEE80211_CHAN_DISABLED; - break; - } - } - break; - - case BAND_5G: - for(j = 0 ; j < ARRAY_SIZE(mtk_5ghz_channels) ; j++) { - if(mtk_5ghz_channels[j].hw_value == aucChannelList[i].ucChannelNum) { - mtk_5ghz_channels[j].flags &= ~IEEE80211_CHAN_DISABLED; - break; - } - } - break; - - default: - break; - } - } - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Register the device to the kernel and return the index. -* -* \param[in] prDev Pointer to struct net_device. -* -* \retval 0 The execution of wlanNetRegister succeeds. -* \retval < 0 The execution of wlanNetRegister failed. -*/ -/*----------------------------------------------------------------------------*/ -static INT_32 -wlanNetRegister( - struct wireless_dev *prWdev - ) -{ - P_GLUE_INFO_T prGlueInfo; - INT_32 i4DevIdx = -1; - - ASSERT(prWdev); - - - do { - if (!prWdev) { - break; - } - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(prWdev->wiphy); - - if ((i4DevIdx = wlanGetDevIdx(prWdev->netdev)) < 0) { - DBGLOG(INIT, ERROR, ("wlanNetRegister: net_device number exceeds.\n")); - break; - } - - /* adjust channel support status */ - wlanUpdateChannelTable((P_GLUE_INFO_T) wiphy_priv(prWdev->wiphy)); - - if (wiphy_register(prWdev->wiphy) < 0) { - DBGLOG(INIT, ERROR, ("wlanNetRegister: wiphy context is not registered.\n")); - wlanClearDevIdx(prWdev->netdev); - i4DevIdx = -1; - } - - if(register_netdev(prWdev->netdev) < 0) { - DBGLOG(INIT, ERROR, ("wlanNetRegister: net_device context is not registered.\n")); - - wiphy_unregister(prWdev->wiphy); - wlanClearDevIdx(prWdev->netdev); - i4DevIdx = -1; - } - - if(i4DevIdx != -1) { - prGlueInfo->fgIsRegistered = TRUE; - } - } - while(FALSE); - - return i4DevIdx; /* success */ -} /* end of wlanNetRegister() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Unregister the device from the kernel -* -* \param[in] prWdev Pointer to struct net_device. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -static VOID -wlanNetUnregister( - struct wireless_dev *prWdev - ) -{ - P_GLUE_INFO_T prGlueInfo; - - if (!prWdev) { - DBGLOG(INIT, ERROR, ("wlanNetUnregister: The device context is NULL\n")); - return; - } - - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(prWdev->wiphy); - - wlanClearDevIdx(prWdev->netdev); - unregister_netdev(prWdev->netdev); - wiphy_unregister(prWdev->wiphy); - - prGlueInfo->fgIsRegistered = FALSE; - - DBGLOG(INIT, INFO, ("unregister wireless_dev(0x%p)\n", prWdev)); - - return; -} /* end of wlanNetUnregister() */ - - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31) -static const struct net_device_ops wlan_netdev_ops = { - .ndo_open = wlanOpen, - .ndo_stop = wlanStop, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) - .ndo_set_rx_mode = wlanSetMulticastList, -#else - .ndo_set_multicast_list = wlanSetMulticastList, -#endif - .ndo_get_stats = wlanGetStats, - .ndo_do_ioctl = wlanDoIOCTL, - .ndo_start_xmit = wlanHardStartXmit, - .ndo_init = wlanInit, - .ndo_uninit = wlanUninit, - .ndo_select_queue = wlanSelectQueue, -}; -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief A method for creating Linux NET4 struct net_device object and the -* private data(prGlueInfo and prAdapter). Setup the IO address to the HIF. -* Assign the function pointer to the net_device object -* -* \param[in] pvData Memory address for the device -* -* \retval Not null The wireless_dev object. -* \retval NULL Fail to create wireless_dev object -*/ -/*----------------------------------------------------------------------------*/ -static struct wireless_dev * -wlanNetCreate( - PVOID pvData - ) -{ - struct wireless_dev *prWdev = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - P_ADAPTER_T prAdapter = NULL; - UINT_32 i; - struct device *prDev; - - //4 <1.1> Create wireless_dev - prWdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); - DBGLOG(INIT, INFO, ("wireless_dev prWdev(0x%p) allocated\n", prWdev)); - if (!prWdev) { - DBGLOG(INIT, ERROR, ("Allocating memory to wireless_dev context failed\n")); - return NULL; - } - - //4 <1.2> Create wiphy - prWdev->wiphy = wiphy_new(&mtk_wlan_ops, sizeof(GLUE_INFO_T)); - DBGLOG(INIT, INFO, ("wiphy (0x%p) allocated\n", prWdev->wiphy)); - if (!prWdev->wiphy) { - DBGLOG(INIT, ERROR, ("Allocating memory to wiphy device failed\n")); - kfree(prWdev); - return NULL; - } - - //4 <1.3> co-relate wiphy & prDev -#if MTK_WCN_HIF_SDIO - mtk_wcn_hif_sdio_get_dev(*((MTK_WCN_HIF_SDIO_CLTCTX *)pvData), &prDev); -#else - prDev = & ((struct sdio_func *) pvData)->dev; //mark skynine add "&" -#endif - if (!prDev) { - printk(KERN_ALERT DRV_NAME "unable to get struct dev for wlan\n"); - } - set_wiphy_dev(prWdev->wiphy, prDev); - - //4 <1.4> configure wireless_dev & wiphy - prWdev->iftype = NL80211_IFTYPE_STATION; - prWdev->wiphy->max_scan_ssids = 1; /* FIXME: for combo scan */ - prWdev->wiphy->max_scan_ie_len = 512; - prWdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC); - prWdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &mtk_band_2ghz; - prWdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &mtk_band_5ghz; - prWdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; - prWdev->wiphy->cipher_suites = (const u32 *)mtk_cipher_suites; - prWdev->wiphy->n_cipher_suites = ARRAY_SIZE(mtk_cipher_suites); - #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) - prWdev->wiphy->flags = WIPHY_FLAG_CUSTOM_REGULATORY | WIPHY_FLAG_SUPPORTS_FW_ROAM; - #else - prWdev->wiphy->flags = WIPHY_FLAG_CUSTOM_REGULATORY; - #endif - //4 <2> Create Glue structure - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(prWdev->wiphy); - if (!prGlueInfo) { - DBGLOG(INIT, ERROR, ("Allocating memory to glue layer failed\n")); - goto netcreate_err; - } - - //4 <3> Initial Glue structure - //4 <3.1> create net device - prGlueInfo->prDevHandler = alloc_netdev_mq(sizeof(P_GLUE_INFO_T), NIC_INF_NAME, ether_setup, CFG_MAX_TXQ_NUM); - - DBGLOG(INIT, INFO, ("net_device prDev(0x%p) allocated\n", prGlueInfo->prDevHandler)); - if (!prGlueInfo->prDevHandler) { - DBGLOG(INIT, ERROR, ("Allocating memory to net_device context failed\n")); - goto netcreate_err; - } - - //4 <3.1.1> initialize net device varaiables - *((P_GLUE_INFO_T *) netdev_priv(prGlueInfo->prDevHandler)) = prGlueInfo; - - prGlueInfo->prDevHandler->netdev_ops = &wlan_netdev_ops; -#ifdef CONFIG_WIRELESS_EXT - prGlueInfo->prDevHandler->wireless_handlers = &wext_handler_def; -#endif - netif_carrier_off(prGlueInfo->prDevHandler); - netif_tx_stop_all_queues(prGlueInfo->prDevHandler); - - //4 <3.1.2> co-relate with wiphy bi-directionally - prGlueInfo->prDevHandler->ieee80211_ptr = prWdev; - prWdev->netdev = prGlueInfo->prDevHandler; - - //4 <3.1.3> co-relate net device & prDev - SET_NETDEV_DEV(prGlueInfo->prDevHandler, wiphy_dev(prWdev->wiphy)); - - //4 <3.2> initiali glue variables - prGlueInfo->eParamMediaStateIndicated = PARAM_MEDIA_STATE_DISCONNECTED; - prGlueInfo->ePowerState = ParamDeviceStateD0; - prGlueInfo->fgIsMacAddrOverride = FALSE; - prGlueInfo->fgIsRegistered = FALSE; - prGlueInfo->prScanRequest = NULL; - - init_completion(&prGlueInfo->rScanComp); - init_completion(&prGlueInfo->rHaltComp); - init_completion(&prGlueInfo->rPendComp); -#if CFG_ENABLE_WIFI_DIRECT - init_completion(&prGlueInfo->rSubModComp); -#endif - - /* initialize timer for OID timeout checker */ - kalOsTimerInitialize(prGlueInfo, kalTimeoutHandler); - - for (i = 0; i < SPIN_LOCK_NUM; i++) { - spin_lock_init(&prGlueInfo->rSpinLock[i]); - } - - /* initialize semaphore for ioctl */ - sema_init(&prGlueInfo->ioctl_sem, 1); - - /* initialize semaphore for ioctl */ - sema_init(&g_halt_sem, 1); - g_u4HaltFlag = 0; - - //4 <4> Create Adapter structure - prAdapter = (P_ADAPTER_T) wlanAdapterCreate(prGlueInfo); - - if (!prAdapter) { - DBGLOG(INIT, ERROR, ("Allocating memory to adapter failed\n")); - goto netcreate_err; - } - - prGlueInfo->prAdapter = prAdapter; - -#ifdef CONFIG_CFG80211_WEXT - //4 <5> Use wireless extension to replace IOCTL - prWdev->wiphy->wext = &wext_handler_def; -#endif - - goto netcreate_done; - -netcreate_err: - if (NULL != prAdapter) { - wlanAdapterDestroy(prAdapter); - prAdapter = NULL; - } - - if (NULL != prGlueInfo->prDevHandler) { - free_netdev(prGlueInfo->prDevHandler); - prGlueInfo->prDevHandler = NULL; - } - - if (NULL != prWdev->wiphy) { - wiphy_free(prWdev->wiphy); - prWdev->wiphy = NULL; - } - - if (NULL != prWdev) { - /* Free net_device and private data, which are allocated by - * alloc_netdev(). - */ - kfree(prWdev); - prWdev = NULL; - } - -netcreate_done: - - return prWdev; -} /* end of wlanNetCreate() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Destroying the struct net_device object and the private data. -* -* \param[in] prWdev Pointer to struct wireless_dev. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -static VOID -wlanNetDestroy( - struct wireless_dev *prWdev - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prWdev); - - if (!prWdev) { - DBGLOG(INIT, ERROR, ("wlanNetDestroy: The device context is NULL\n")); - return; - } - - /* prGlueInfo is allocated with net_device */ - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(prWdev->wiphy); - ASSERT(prGlueInfo); - - /* destroy kal OS timer */ - kalCancelTimer(prGlueInfo); - - glClearHifInfo(prGlueInfo); - - wlanAdapterDestroy(prGlueInfo->prAdapter); - prGlueInfo->prAdapter = NULL; - - /* Free net_device and private data, which are allocated by alloc_netdev(). - */ - free_netdev(prWdev->netdev); - wiphy_free(prWdev->wiphy); - - kfree(prWdev); - - return; -} /* end of wlanNetDestroy() */ - -#ifndef CONFIG_X86 -UINT_8 g_aucBufIpAddr[32] = {0}; - -static void wlanEarlySuspend(void) -{ - struct net_device *prDev = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - UINT_8 ip[4] = { 0 }; - UINT_32 u4NumIPv4 = 0; -#ifdef CONFIG_IPV6 - UINT_8 ip6[16] = { 0 }; // FIX ME: avoid to allocate large memory in stack - UINT_32 u4NumIPv6 = 0; -#endif - UINT_32 i; - P_PARAM_NETWORK_ADDRESS_IP prParamIpAddr; - - DBGLOG(INIT, INFO, ("*********wlanEarlySuspend************\n")); - - // <1> Sanity check and acquire the net_device - ASSERT(u4WlanDevNum <= CFG_MAX_WLAN_DEVICES); - if(u4WlanDevNum == 0){ - DBGLOG(INIT, ERROR, ("wlanEarlySuspend u4WlanDevNum==0 invalid!!\n")); - return; - } - prDev = arWlanDevInfo[u4WlanDevNum-1].prDev; - ASSERT(prDev); - -fgIsUnderEarlierSuspend = true; - - // <2> get the IPv4 address - if(!prDev || !(prDev->ip_ptr)||\ - !((struct in_device *)(prDev->ip_ptr))->ifa_list||\ - !(&(((struct in_device *)(prDev->ip_ptr))->ifa_list->ifa_local))){ - DBGLOG(INIT, INFO, ("ip is not avaliable.\n")); - return; - } - - // <3> acquire the prGlueInfo - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - // <4> copy the IPv4 address - kalMemCopy(ip, &(((struct in_device *)(prDev->ip_ptr))->ifa_list->ifa_local), sizeof(ip)); - DBGLOG(INIT, INFO, ("ip is %d.%d.%d.%d\n", - ip[0],ip[1],ip[2],ip[3])); - - // todo: traverse between list to find whole sets of IPv4 addresses - if (!((ip[0] == 0) && - (ip[1] == 0) && - (ip[2] == 0) && - (ip[3] == 0))) { - u4NumIPv4++; - } - -#ifdef CONFIG_IPV6 - // <5> get the IPv6 address - if(!prDev || !(prDev->ip6_ptr)||\ - !((struct in_device *)(prDev->ip6_ptr))->ifa_list||\ - !(&(((struct in_device *)(prDev->ip6_ptr))->ifa_list->ifa_local))){ - DBGLOG(INIT, INFO, ("ipv6 is not avaliable.\n")); - return; - } - // <6> copy the IPv6 address - kalMemCopy(ip6, &(((struct in_device *)(prDev->ip6_ptr))->ifa_list->ifa_local), sizeof(ip6)); - DBGLOG(INIT, INFO, ("ipv6 is %d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d\n", - ip6[0],ip6[1],ip6[2],ip6[3], - ip6[4],ip6[5],ip6[6],ip6[7], - ip6[8],ip6[9],ip6[10],ip6[11], - ip6[12],ip6[13],ip6[14],ip6[15] - )); - - // todo: traverse between list to find whole sets of IPv6 addresses - if (!((ip6[0] == 0) && - (ip6[1] == 0) && - (ip6[2] == 0) && - (ip6[3] == 0) && - (ip6[4] == 0) && - (ip6[5] == 0))) { - //u4NumIPv6++; - } - -#endif - - // <7> set up the ARP filter - { - WLAN_STATUS rStatus = WLAN_STATUS_FAILURE; - UINT_32 u4SetInfoLen = 0; -// UINT_8 aucBuf[32] = {0}; - UINT_32 u4Len = OFFSET_OF(PARAM_NETWORK_ADDRESS_LIST, arAddress); - P_PARAM_NETWORK_ADDRESS_LIST prParamNetAddrList = (P_PARAM_NETWORK_ADDRESS_LIST)g_aucBufIpAddr;//aucBuf; - P_PARAM_NETWORK_ADDRESS prParamNetAddr = prParamNetAddrList->arAddress; - - kalMemZero(g_aucBufIpAddr, sizeof(g_aucBufIpAddr)); - - prParamNetAddrList->u4AddressCount = u4NumIPv4 + u4NumIPv6; - prParamNetAddrList->u2AddressType = PARAM_PROTOCOL_ID_TCP_IP; - for (i = 0; i < u4NumIPv4; i++) { - prParamNetAddr->u2AddressLength = sizeof(PARAM_NETWORK_ADDRESS_IP);//4;; - prParamNetAddr->u2AddressType = PARAM_PROTOCOL_ID_TCP_IP;; -#if 0 - kalMemCopy(prParamNetAddr->aucAddress, ip, sizeof(ip)); - prParamNetAddr = (P_PARAM_NETWORK_ADDRESS)((UINT_32)prParamNetAddr + sizeof(ip)); - u4Len += OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress) + sizeof(ip); -#else - prParamIpAddr = (P_PARAM_NETWORK_ADDRESS_IP)prParamNetAddr->aucAddress; - kalMemCopy(&prParamIpAddr->in_addr, ip, sizeof(ip)); - prParamNetAddr = (P_PARAM_NETWORK_ADDRESS)((UINT_32)prParamNetAddr + sizeof(PARAM_NETWORK_ADDRESS)); - u4Len += OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress) + sizeof(PARAM_NETWORK_ADDRESS); -#endif - } -#ifdef CONFIG_IPV6 - for (i = 0; i < u4NumIPv6; i++) { - prParamNetAddr->u2AddressLength = 6;; - prParamNetAddr->u2AddressType = PARAM_PROTOCOL_ID_TCP_IP;; - kalMemCopy(prParamNetAddr->aucAddress, ip6, sizeof(ip6)); - prParamNetAddr = (P_PARAM_NETWORK_ADDRESS)((UINT_32)prParamNetAddr + sizeof(ip6)); - u4Len += OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress) + sizeof(ip6); - } -#endif - ASSERT(u4Len <= sizeof(g_aucBufIpAddr/*aucBuf*/)); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetNetworkAddress, - (PVOID)prParamNetAddrList, - u4Len, - FALSE, - FALSE, - TRUE, - FALSE, - &u4SetInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, INFO, ("set HW pattern filter fail 0x%lx\n", rStatus)); - } - } -} - -static void wlanLateResume(void) -{ - struct net_device *prDev = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - UINT_8 ip[4] = { 0 }; -#ifdef CONFIG_IPV6 - UINT_8 ip6[16] = { 0 }; // FIX ME: avoid to allocate large memory in stack -#endif - - DBGLOG(INIT, INFO, ("*********wlanLateResume************\n")); - - // <1> Sanity check and acquire the net_device - ASSERT(u4WlanDevNum <= CFG_MAX_WLAN_DEVICES); - - if(u4WlanDevNum == 0){ - DBGLOG(INIT, ERROR, ("wlanLateResume u4WlanDevNum==0 invalid!!\n")); - return; - } - prDev = arWlanDevInfo[u4WlanDevNum-1].prDev; - ASSERT(prDev); - -fgIsUnderEarlierSuspend = false; - - // <2> get the IPv4 address - if(!prDev || !(prDev->ip_ptr)||\ - !((struct in_device *)(prDev->ip_ptr))->ifa_list||\ - !(&(((struct in_device *)(prDev->ip_ptr))->ifa_list->ifa_local))){ - DBGLOG(INIT, INFO, ("ip is not avaliable.\n")); - return; - } - - // <3> acquire the prGlueInfo - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - // <4> copy the IPv4 address - kalMemCopy(ip, &(((struct in_device *)(prDev->ip_ptr))->ifa_list->ifa_local), sizeof(ip)); - DBGLOG(INIT, INFO, ("ip is %d.%d.%d.%d\n", - ip[0],ip[1],ip[2],ip[3])); - -#ifdef CONFIG_IPV6 - // <5> get the IPv6 address - if(!prDev || !(prDev->ip6_ptr)||\ - !((struct in_device *)(prDev->ip6_ptr))->ifa_list||\ - !(&(((struct in_device *)(prDev->ip6_ptr))->ifa_list->ifa_local))){ - DBGLOG(INIT, INFO, ("ipv6 is not avaliable.\n")); - return; - } - // <6> copy the IPv6 address - kalMemCopy(ip6, &(((struct in_device *)(prDev->ip6_ptr))->ifa_list->ifa_local), sizeof(ip6)); - DBGLOG(INIT, INFO, ("ipv6 is %d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d\n", - ip6[0],ip6[1],ip6[2],ip6[3], - ip6[4],ip6[5],ip6[6],ip6[7], - ip6[8],ip6[9],ip6[10],ip6[11], - ip6[12],ip6[13],ip6[14],ip6[15] - )); -#endif - // <7> clear the ARP filter - { - WLAN_STATUS rStatus = WLAN_STATUS_FAILURE; - UINT_32 u4SetInfoLen = 0; -// UINT_8 aucBuf[32] = {0}; - UINT_32 u4Len = sizeof(PARAM_NETWORK_ADDRESS_LIST); - P_PARAM_NETWORK_ADDRESS_LIST prParamNetAddrList = (P_PARAM_NETWORK_ADDRESS_LIST)g_aucBufIpAddr;//aucBuf; - - kalMemZero(g_aucBufIpAddr, sizeof(g_aucBufIpAddr)); - - prParamNetAddrList->u4AddressCount = 0; - prParamNetAddrList->u2AddressType = PARAM_PROTOCOL_ID_TCP_IP; - - ASSERT(u4Len <= sizeof(g_aucBufIpAddr/*aucBuf*/)); - rStatus = kalIoctl(prGlueInfo, - wlanoidSetNetworkAddress, - (PVOID)prParamNetAddrList, - u4Len, - FALSE, - FALSE, - TRUE, - FALSE, - &u4SetInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, INFO, ("set HW pattern filter fail 0x%lx\n", rStatus)); - } - } -} - -#if defined(CONFIG_HAS_EARLYSUSPEND) -static struct early_suspend mt6620_early_suspend_desc = { - .level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN, -}; - -static void wlan_early_suspend(struct early_suspend *h) -{ - DBGLOG(INIT, INFO, ("*********wlan_early_suspend************\n")); - wlanEarlySuspend(); -} - -static void wlan_late_resume(struct early_suspend *h) -{ - DBGLOG(INIT, INFO, ("*********wlan_late_resume************\n")); - wlanLateResume(); -} -#endif //defined(CONFIG_HAS_EARLYSUSPEND) -#endif //! CONFIG_X86 - -extern void wlanRegisterNotifier(void); -extern void wlanUnregisterNotifier(void); - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Wlan probe function. This function probes and initializes the device. -* -* \param[in] pvData data passed by bus driver init function -* _HIF_EHPI: NULL -* _HIF_SDIO: sdio bus driver handle -* -* \retval 0 Success -* \retval negative value Failed -*/ -/*----------------------------------------------------------------------------*/ -static INT_32 -wlanProbe( - PVOID pvData - ) -{ - struct wireless_dev *prWdev = NULL; - P_WLANDEV_INFO_T prWlandevInfo = NULL; - INT_32 i4DevIdx = 0; - P_GLUE_INFO_T prGlueInfo = NULL; - P_ADAPTER_T prAdapter = NULL; - INT_32 i4Status = 0; - BOOL bRet = FALSE; - - - do { -#if DBG - int i; - /* Initialize DEBUG CLASS of each module */ - for (i = 0; i < DBG_MODULE_NUM; i++) { - aucDebugModule[i] = DBG_CLASS_ERROR | \ - DBG_CLASS_WARN | \ - DBG_CLASS_STATE | \ - DBG_CLASS_TRACE | \ - DBG_CLASS_EVENT; - //aucDebugModule[i] = 0; - } -#if 0 - aucDebugModule[DBG_INIT_IDX] |= DBG_CLASS_TRACE | DBG_CLASS_INFO; - aucDebugModule[DBG_ARB_IDX] |= DBG_CLASS_TRACE | DBG_CLASS_INFO; - aucDebugModule[DBG_JOIN_IDX] |= DBG_CLASS_TRACE | DBG_CLASS_INFO; - //aucDebugModule[DBG_RX_IDX] |= DBG_CLASS_TRACE | DBG_CLASS_INFO; - aucDebugModule[DBG_TX_IDX] |= DBG_CLASS_TRACE | DBG_CLASS_INFO; - aucDebugModule[DBG_NIC_IDX] |= DBG_CLASS_TRACE | DBG_CLASS_INFO; - aucDebugModule[DBG_HAL_IDX] |= DBG_CLASS_TRACE | DBG_CLASS_INFO; - aucDebugModule[DBG_KEVIN_IDX] |= DBG_CLASS_TRACE | DBG_CLASS_INFO | DBG_CLASS_TEMP; - aucDebugModule[DBG_SCAN_IDX] |= DBG_CLASS_TRACE | DBG_CLASS_INFO; - aucDebugModule[DBG_REQ_IDX] |= DBG_CLASS_TRACE | DBG_CLASS_INFO; - //aucDebugModule[DBG_MGT_IDX] |= DBG_CLASS_TRACE | DBG_CLASS_INFO; - aucDebugModule[DBG_RSN_IDX] |= DBG_CLASS_TRACE; - aucDebugModule[DBG_ROAMING_IDX] |= DBG_CLASS_TRACE | DBG_CLASS_INFO; -#endif -#endif /* DBG */ - - //4 <1> Initialize the IO port of the interface - /* GeorgeKuo: pData has different meaning for _HIF_XXX: - * _HIF_EHPI: pointer to memory base variable, which will be - * initialized by glBusInit(). - * _HIF_SDIO: bus driver handle - */ - - bRet = glBusInit(pvData); - - /* Cannot get IO address from interface */ - if (FALSE == bRet) { - DBGLOG(INIT, ERROR, (KERN_ALERT "wlanProbe: glBusInit() fail\n")); - i4Status = -EIO; - break; - } - - //4 <2> Create network device, Adapter, KalInfo, prDevHandler(netdev) - if ((prWdev = wlanNetCreate(pvData)) == NULL) { - DBGLOG(INIT, ERROR, ("wlanProbe: No memory for dev and its private\n")); - i4Status = -ENOMEM; - break; - } - - //4 <2.5> Set the ioaddr to HIF Info - prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(prWdev->wiphy); - gPrDev = prGlueInfo->prDevHandler; - glSetHifInfo(prGlueInfo, (UINT_32) pvData); - - - /* main thread is created in this function */ - init_waitqueue_head(&prGlueInfo->waitq); - // - - QUEUE_INITIALIZE(&prGlueInfo->rCmdQueue); - QUEUE_INITIALIZE(&prGlueInfo->rTxQueue); - - - - //prGlueInfo->main_thread = kthread_run(tx_thread, prGlueInfo->prDevHandler, "tx_thread"); - - //4 <4> Setup IRQ - prWlandevInfo = &arWlanDevInfo[i4DevIdx]; - - //i4Status = glBusSetIrq(prWdev->netdev, NULL, *((P_GLUE_INFO_T *) netdev_priv(prWdev->netdev))); - - if (i4Status != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, ERROR, ("wlanProbe: Set IRQ error\n")); - break; - } - - prGlueInfo->i4DevIdx = i4DevIdx; - - prAdapter = prGlueInfo->prAdapter; - - prGlueInfo->u4ReadyFlag = 0; - -#if CFG_TCP_IP_CHKSUM_OFFLOAD - prAdapter->u4CSUMFlags = (CSUM_OFFLOAD_EN_TX_TCP | CSUM_OFFLOAD_EN_TX_UDP | CSUM_OFFLOAD_EN_TX_IP); -#endif - - //4 <5> Start Device - // -#if CFG_ENABLE_FW_DOWNLOAD - /* before start adapter, we need to open and load firmware */ - { - UINT_32 u4FwSize = 0; - PVOID prFwBuffer = NULL; - P_REG_INFO_T prRegInfo = &prGlueInfo->rRegInfo; - - //P_REG_INFO_T prRegInfo = (P_REG_INFO_T) kmalloc(sizeof(REG_INFO_T), GFP_KERNEL); - kalMemSet(prRegInfo, 0, sizeof(REG_INFO_T)); - prRegInfo->u4StartAddress = CFG_FW_START_ADDRESS; - prRegInfo->u4LoadAddress = CFG_FW_LOAD_ADDRESS; - - // Load NVRAM content to REG_INFO_T - glLoadNvram(prGlueInfo, prRegInfo); - - //kalMemCopy(&prGlueInfo->rRegInfo, prRegInfo, sizeof(REG_INFO_T)); - - prRegInfo->u4PowerMode = CFG_INIT_POWER_SAVE_PROF; - prRegInfo->fgEnArpFilter = TRUE; - - if (kalFirmwareImageMapping(prGlueInfo, &prFwBuffer, &u4FwSize) == NULL) { - i4Status = -EIO; - goto bailout; - } else { - if (wlanAdapterStart(prAdapter, prRegInfo, prFwBuffer, u4FwSize) != WLAN_STATUS_SUCCESS) { - i4Status = -EIO; - } - } - - kalFirmwareImageUnmapping(prGlueInfo, NULL, prFwBuffer); - -bailout: - //kfree(prRegInfo); - - if (i4Status < 0) { - break; - } - } -#else - //P_REG_INFO_T prRegInfo = (P_REG_INFO_T) kmalloc(sizeof(REG_INFO_T), GFP_KERNEL); - kalMemSet(&prGlueInfo->rRegInfo, 0, sizeof(REG_INFO_T)); - P_REG_INFO_T prRegInfo = &prGlueInfo->rRegInfo; - - // Load NVRAM content to REG_INFO_T - glLoadNvram(prGlueInfo, prRegInfo); - - prRegInfo->u4PowerMode = CFG_INIT_POWER_SAVE_PROF; - - if (wlanAdapterStart(prAdapter, prRegInfo, NULL, 0) != WLAN_STATUS_SUCCESS) { - i4Status = -EIO; - break; - } -#endif - prGlueInfo->main_thread = kthread_run(tx_thread, prGlueInfo->prDevHandler, "tx_thread"); - - /* set MAC address */ - { - WLAN_STATUS rStatus = WLAN_STATUS_FAILURE; - struct sockaddr MacAddr; - UINT_32 u4SetInfoLen = 0; - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryCurrentAddr, - &MacAddr.sa_data, - PARAM_MAC_ADDR_LEN, - TRUE, - TRUE, - TRUE, - FALSE, - &u4SetInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, WARN, ("set MAC addr fail 0x%lx\n", rStatus)); - prGlueInfo->u4ReadyFlag = 0; - } else { - memcpy(prGlueInfo->prDevHandler->dev_addr, &MacAddr.sa_data, ETH_ALEN); - memcpy(prGlueInfo->prDevHandler->perm_addr, prGlueInfo->prDevHandler->dev_addr, ETH_ALEN); - - /* card is ready */ - prGlueInfo->u4ReadyFlag = 1; -#if CFG_SHOW_MACADDR_SOURCE - DBGLOG(INIT, INFO, ("MAC address: "MACSTR, MAC2STR(&MacAddr.sa_data))); -#endif - } - } - - -#if CFG_TCP_IP_CHKSUM_OFFLOAD - /* set HW checksum offload */ - { - WLAN_STATUS rStatus = WLAN_STATUS_FAILURE; - UINT_32 u4CSUMFlags = CSUM_OFFLOAD_EN_ALL; - UINT_32 u4SetInfoLen = 0; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetCSUMOffload, - (PVOID)&u4CSUMFlags, - sizeof(UINT_32), - FALSE, - FALSE, - TRUE, - FALSE, - &u4SetInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, WARN, ("set HW checksum offload fail 0x%lx\n", rStatus)); - } - } -#endif - - //4 <3> Register the card - if ((i4DevIdx = wlanNetRegister(prWdev)) < 0){ - i4Status = -ENXIO; - DBGLOG(INIT, ERROR, ("wlanProbe: Cannot register the net_device context to the kernel\n")); - break; - } - - glRegisterEarlySuspend(&mt6620_early_suspend_desc, wlan_early_suspend, wlan_late_resume); - wlanRegisterNotifier(); - //4 <6> Initialize /proc filesystem -#ifdef WLAN_INCLUDE_PROC - if ( (i4Status = procInitProcfs(prDev, NIC_DEVICE_ID_LOW)) < 0) { - DBGLOG(INIT, ERROR, ("wlanProbe: init procfs failed\n")); - break; - } -#endif /* WLAN_INCLUDE_PROC */ - -#if CFG_ENABLE_BT_OVER_WIFI - prGlueInfo->rBowInfo.fgIsNetRegistered = FALSE; - prGlueInfo->rBowInfo.fgIsRegistered = FALSE; - glRegisterAmpc(prGlueInfo); -#endif - -#if CFG_ENABLE_WIFI_DIRECT - /*wlan is launched*/ - prGlueInfo->prAdapter->fgIsWlanLaunched = TRUE; - /*if p2p module is inserted, notify tx_thread to init p2p network*/ - if(rSubModHandler[P2P_MODULE].subModInit) { - wlanSubModInit(prGlueInfo); - } -#endif - } - while (FALSE); - -#if 1//def RK2818 - if (i4Status < 0) - driver_start_ok = -1; - else - driver_start_ok = 1; -#endif - - return i4Status; -} /* end of wlanProbe() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief A method to stop driver operation and release all resources. Following -* this call, no frame should go up or down through this interface. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -static VOID -wlanRemove( - VOID - ) -{ - struct net_device *prDev = NULL; - P_WLANDEV_INFO_T prWlandevInfo = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - P_ADAPTER_T prAdapter = NULL; - - DBGLOG(INIT, INFO, ("Remove wlan!\n")); - - - //4 <0> Sanity check - ASSERT(u4WlanDevNum <= CFG_MAX_WLAN_DEVICES); - if (0 == u4WlanDevNum) { - DBGLOG(INIT, INFO, ("0 == u4WlanDevNum\n")); - return; - } - - prDev = arWlanDevInfo[u4WlanDevNum-1].prDev; - prWlandevInfo = &arWlanDevInfo[u4WlanDevNum-1]; - - ASSERT(prDev); - if (NULL == prDev) { - DBGLOG(INIT, INFO, ("NULL == prDev\n")); - return; - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - if (NULL == prGlueInfo) { - DBGLOG(INIT, INFO, ("NULL == prGlueInfo\n")); - free_netdev(prDev); - return; - } - - -#if CFG_ENABLE_WIFI_DIRECT - prGlueInfo->prAdapter->fgIsWlanLaunched = FALSE; - if(prGlueInfo->prAdapter->fgIsP2PRegistered) { - p2pNetUnregister(prGlueInfo, FALSE); - p2pRemove(prGlueInfo); - } - -#if 0 - prGlueInfo->prAdapter->fgIsWlanLaunched = FALSE; - //if(prGlueInfo->prAdapter->fgIsP2PRegistered) { - if (prGlueInfo->prP2PInfo) { - //p2pRemove(prGlueInfo); - if (prGlueInfo->prP2PInfo->prDevHandler) { - free_netdev(prGlueInfo->prP2PInfo->prDevHandler); - prGlueInfo->prP2PInfo->prDevHandler = NULL; - - } - - - if(!p2PFreeInfo(prGlueInfo)) { - printk(KERN_ALERT DRV_NAME "Free memory for p2p FAILED\n"); - ASSERT(0); - return; - } - } -#endif -#endif - -#if CFG_ENABLE_BT_OVER_WIFI - if(prGlueInfo->rBowInfo.fgIsNetRegistered) { - bowNotifyAllLinkDisconnected(prGlueInfo->prAdapter); - /*wait 300ms for BoW module to send deauth*/ - kalMsleep(300); - } -#endif - - //4 <1> Stopping handling interrupt and free IRQ - glBusFreeIrq(prDev, *((P_GLUE_INFO_T *) netdev_priv(prDev))); - - kalMemSet(&(prGlueInfo->prAdapter->rWlanInfo), 0, sizeof(WLAN_INFO_T)); - - flush_delayed_work_sync(&workq); - - down(&g_halt_sem); - g_u4HaltFlag = 1; - - //4 <2> Mark HALT, notify main thread to stop, and clean up queued requests - prGlueInfo->u4Flag |= GLUE_FLAG_HALT; - /* wake up main thread */ - wake_up_interruptible(&prGlueInfo->waitq); - /* wait main thread stops */ - wait_for_completion_interruptible(&prGlueInfo->rHaltComp); - - DBGLOG(INIT, INFO, ("mtk_sdiod stopped\n")); - - //prGlueInfo->rHifInfo.main_thread = NULL; - prGlueInfo->main_thread = NULL; - -#if CFG_ENABLE_BT_OVER_WIFI - if(prGlueInfo->rBowInfo.fgIsRegistered) { - glUnregisterAmpc(prGlueInfo); - } -#endif - - - //4 <3> Remove /proc filesystem. -#ifdef WLAN_INCLUDE_PROC - procRemoveProcfs(prDev, NIC_DEVICE_ID_LOW); -#endif /* WLAN_INCLUDE_PROC */ - - //4 <4> wlanAdapterStop - prAdapter = prGlueInfo->prAdapter; - - wlanAdapterStop(prAdapter); - DBGLOG(INIT, INFO, ("Number of Stalled Packets = %ld\n", prGlueInfo->i4TxPendingFrameNum)); - - //4 <5> Release the Bus - glBusRelease(prDev); - - up(&g_halt_sem); - - //4 <6> Unregister the card - wlanNetUnregister(prDev->ieee80211_ptr); - - //4 <7> Destroy the device - wlanNetDestroy(prDev->ieee80211_ptr); - prDev = NULL; - - glUnregisterEarlySuspend(&mt6620_early_suspend_desc); - wlanUnregisterNotifier(); - return; -} /* end of wlanRemove() */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Driver entry point when the driver is configured as a Linux Module, and -* is called once at module load time, by the user-level modutils -* application: insmod or modprobe. -* -* \retval 0 Success -*/ -/*----------------------------------------------------------------------------*/ -//1 Module Entry Point - -#include "wifi_version.h" - -extern void initRssiHistory(void); -extern void initScanRssiHistory(void); -extern VOID exitWlan(void); -/*static */int initWlan(void) -{ - int ret = 0, timeout = 0; - int count = 3; - driver_start_ok = 0; - -#if RSSI_ENHANCE - initRssiHistory(); - initScanRssiHistory(); -#endif -retry_initwlan: - - //printk("=======================================================\n"); - //printk("==== Launching Wi-Fi driver! (Powered by Rockchip) ====\n"); - //printk("=======================================================\n"); - printk("MT5931 SDIO WiFi driver (Powered by Rockchip,Ver %s) init.\n", MT5931_DRV_VERSION); - - DBGLOG(INIT, INFO, ("initWlan\n")); - - -#if defined(CONFIG_WIFI_CONTROL_FUNC) - if (wl_android_wifictrl_func_add() < 0) { - ret = -1; - goto fail; - } -#endif - - /* memory pre-allocation */ - kalInitIOBuffer(); - - //return ((glRegisterBus(wlanProbe, wlanRemove) == WLAN_STATUS_SUCCESS) ? 0: -EIO); - ret = ((glRegisterBus(wlanProbe, wlanRemove) == WLAN_STATUS_SUCCESS) ? 0: -EIO); - - if (ret == -EIO) { - kalUninitIOBuffer(); - ret = -1; - goto fail; - } - -#if (CFG_CHIP_RESET_SUPPORT) - glResetInit(); -#endif - - /*WCNCR00002676, keep OS wake up for 100ms*/ - KAL_WAKE_LOCK_INIT(NULL, &isr_wakelock, "WLAN TIME 2"); - - /*for (timeout = 50; timeout >=0; timeout--) - { - if (driver_start_ok == 1) - return ret; - msleep(100); - } - if (timeout <= 0 && count > 0) - { - count--; - if (driver_start_ok == 0) - printk("No WiFi function card has been attached (5s). retry!\n"); - else if (driver_start_ok < 0) - printk("wifi driver probe processing fail. retry!\n"); - exitWlan(); - goto retry_initwlan; - }*/ - - return ret; - -fail: - -#if defined(CONFIG_WIFI_CONTROL_FUNC) - wl_android_wifictrl_func_del(); -#endif - - return ret; -} /* end of initWlan() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Driver exit point when the driver as a Linux Module is removed. Called -* at module unload time, by the user level modutils application: rmmod. -* This is our last chance to clean up after ourselves. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -//1 Module Leave Point -/*static */VOID exitWlan(void) -{ - //printk("=======================================================\n"); - //printk("== Dis-launching Wi-Fi driver! (Powered by Rockchip) ==\n"); - //printk("=======================================================\n"); - - //printk("remove %p\n", wlanRemove); -#if CFG_CHIP_RESET_SUPPORT - glResetUninit(); -#endif - - glUnregisterBus(wlanRemove); - - /*WCNCR00002676*/ - KAL_WAKE_LOCK_DESTROY(NULL, &isr_wakelock); - - /* free pre-allocated memory */ - kalUninitIOBuffer(); - -#if defined(CONFIG_WIFI_CONTROL_FUNC) - wl_android_wifictrl_func_del(); -#endif /* CONFIG_WIFI_CONTROL_FUNC */ - - DBGLOG(INIT, INFO, ("exitWlan\n")); - - return; -} /* end of exitWlan() */ - -int rockchip_wifi_init_module(void) -{ - initWlan(); -} - -int rockchip_wifi_exit_module(void) -{ - exitWlan(); -} - -EXPORT_SYMBOL(rockchip_wifi_init_module); -EXPORT_SYMBOL(rockchip_wifi_exit_module); - -//module_init(initWlan); -//module_exit(exitWlan); -#if 0 -/* export necessary symbol for p2p driver using */ -#if CFG_ENABLE_WIFI_DIRECT -EXPORT_SYMBOL(wlanSubModRegisterInitExit); -EXPORT_SYMBOL(wlanSubModExit); -EXPORT_SYMBOL(wlanSubModInit); - -EXPORT_SYMBOL(nicPmIndicateBssCreated); -EXPORT_SYMBOL(rlmProcessAssocRsp); -EXPORT_SYMBOL(kalSetEvent); -EXPORT_SYMBOL(rlmBssInitForAPandIbss); -EXPORT_SYMBOL(kalEnqueueCommand); -EXPORT_SYMBOL(nicIncreaseTxSeqNum); -EXPORT_SYMBOL(nicCmdEventQueryAddress); -EXPORT_SYMBOL(bssCreateStaRecFromBssDesc); -EXPORT_SYMBOL(rlmBssAborted); -EXPORT_SYMBOL(cnmStaRecResetStatus); -EXPORT_SYMBOL(mqmProcessAssocRsp); -EXPORT_SYMBOL(nicTxReturnMsduInfo); -EXPORT_SYMBOL(nicTxEnqueueMsdu); -EXPORT_SYMBOL(wlanProcessSecurityFrame); -EXPORT_SYMBOL(nicChannelNum2Freq); -EXPORT_SYMBOL(nicUpdateBss); -EXPORT_SYMBOL(wlanSendSetQueryCmd); -EXPORT_SYMBOL(cnmStaRecAlloc); -EXPORT_SYMBOL(cnmTimerInitTimer); -EXPORT_SYMBOL(rateGetRateSetFromIEs); -EXPORT_SYMBOL(nicOidCmdTimeoutCommon); -EXPORT_SYMBOL(cnmStaRecChangeState); -EXPORT_SYMBOL(rateGetDataRatesFromRateSet); -EXPORT_SYMBOL(cnmMgtPktAlloc); -EXPORT_SYMBOL(cnmMgtPktFree); -EXPORT_SYMBOL(wextSrchDesiredWPAIE); -EXPORT_SYMBOL(nicRxReturnRFB); -EXPORT_SYMBOL(cnmTimerStartTimer); -EXPORT_SYMBOL(cmdBufAllocateCmdInfo); -EXPORT_SYMBOL(cnmGetStaRecByAddress); -EXPORT_SYMBOL(nicMediaStateChange); -EXPORT_SYMBOL(bssUpdateBeaconContent); -EXPORT_SYMBOL(kalIoctl); -EXPORT_SYMBOL(nicActivateNetwork); -EXPORT_SYMBOL(nicDeactivateNetwork); -EXPORT_SYMBOL(kalRandomNumber); -EXPORT_SYMBOL(nicCmdEventSetCommon); -EXPORT_SYMBOL(cnmTimerStopTimer); -EXPORT_SYMBOL(nicIncreaseCmdSeqNum); -EXPORT_SYMBOL(authSendDeauthFrame); -EXPORT_SYMBOL(cnmMemAlloc); -EXPORT_SYMBOL(nicPmIndicateBssAbort); -EXPORT_SYMBOL(nicCmdEventSetIpAddress); -EXPORT_SYMBOL(mboxSendMsg); -EXPORT_SYMBOL(scanSearchBssDescByBssid); -EXPORT_SYMBOL(bssRemoveStaRecFromClientList); -EXPORT_SYMBOL(assocProcessRxDisassocFrame); -EXPORT_SYMBOL(authProcessRxDeauthFrame); -EXPORT_SYMBOL(cnmStaRecFree); -EXPORT_SYMBOL(rNonHTPhyAttributes); -EXPORT_SYMBOL(rNonHTApModeAttributes); -EXPORT_SYMBOL(cnmMemFree); -EXPORT_SYMBOL(wlanExportGlueInfo); -EXPORT_SYMBOL(bssInitForAP); -EXPORT_SYMBOL(nicPmIndicateBssConnected); -EXPORT_SYMBOL(rlmRspGenerateHtOpIE); -EXPORT_SYMBOL(bssGenerateExtSuppRate_IE); -EXPORT_SYMBOL(rlmRspGenerateErpIE); -EXPORT_SYMBOL(rlmRspGenerateHtCapIE); -EXPORT_SYMBOL(cnmGetStaRecByIndex); -EXPORT_SYMBOL(rsnGenerateWpaNoneIE); -EXPORT_SYMBOL(rlmRspGenerateExtCapIE); -EXPORT_SYMBOL(rsnGenerateRSNIE); -EXPORT_SYMBOL(rsnParseRsnIE); -#if CFG_SUPPORT_WPS -EXPORT_SYMBOL(wextSrchDesiredWPSIE); -#endif -EXPORT_SYMBOL(mboxDummy); -EXPORT_SYMBOL(saaFsmRunEventStart); -EXPORT_SYMBOL(saaFsmRunEventAbort); -EXPORT_SYMBOL(cnmP2PIsPermitted); -EXPORT_SYMBOL(cnmBss40mBwPermitted); -EXPORT_SYMBOL(mqmGenerateWmmParamIE); -EXPORT_SYMBOL(cnmPreferredChannel); -EXPORT_SYMBOL(bssAddStaRecToClientList); -EXPORT_SYMBOL(nicQmUpdateWmmParms); -EXPORT_SYMBOL(qmFreeAllByNetType); -EXPORT_SYMBOL(wlanQueryInformation); -EXPORT_SYMBOL(nicConfigPowerSaveProfile); -EXPORT_SYMBOL(scanSearchExistingBssDesc); -EXPORT_SYMBOL(scanAllocateBssDesc); -EXPORT_SYMBOL(wlanProcessCommandQueue); -EXPORT_SYMBOL(wlanAcquirePowerControl); -EXPORT_SYMBOL(wlanReleasePowerControl); -EXPORT_SYMBOL(wlanReleasePendingCMDbyNetwork); -#if DBG -EXPORT_SYMBOL(aucDebugModule); -EXPORT_SYMBOL(fgIsBusAccessFailed); -EXPORT_SYMBOL(allocatedMemSize); -EXPORT_SYMBOL(dumpMemory8); -EXPORT_SYMBOL(dumpMemory32); -#endif -EXPORT_SYMBOL(rlmDomainIsLegalChannel); -EXPORT_SYMBOL(scnQuerySparseChannel); -EXPORT_SYMBOL(rlmDomainGetChnlList); -EXPORT_SYMBOL(p2pSetMulticastListWorkQueueWrapper); -EXPORT_SYMBOL(nicUpdateRSSI); -EXPORT_SYMBOL(nicCmdEventQueryLinkQuality); -EXPORT_SYMBOL(kalGetMediaStateIndicated); -EXPORT_SYMBOL(nicFreq2ChannelNum); -EXPORT_SYMBOL(assocSendDisAssocFrame); -EXPORT_SYMBOL(nicUpdateBeaconIETemplate); -EXPORT_SYMBOL(rsnParseCheckForWFAInfoElem); -EXPORT_SYMBOL(kalClearMgmtFramesByNetType); -EXPORT_SYMBOL(kalClearSecurityFramesByNetType); -EXPORT_SYMBOL(nicFreePendingTxMsduInfoByNetwork); -EXPORT_SYMBOL(bssComposeBeaconProbeRespFrameHeaderAndFF); -EXPORT_SYMBOL(bssBuildBeaconProbeRespFrameCommonIEs); -EXPORT_SYMBOL(wlanoidSetWapiAssocInfo); -EXPORT_SYMBOL(wlanoidSetWSCAssocInfo); -#endif -#endif diff --git a/drivers/net/wireless/mt5931/os/linux/gl_kal.c b/drivers/net/wireless/mt5931/os/linux/gl_kal.c deleted file mode 100755 index f1aa99622afd..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/gl_kal.c +++ /dev/null @@ -1,3916 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/gl_kal.c#3 $ -*/ - -/*! \file gl_kal.c - \brief GLUE Layer will export the required procedures here for internal driver stack. - - This file contains all routines which are exported from GLUE Layer to internal - driver stack. -*/ - - - -/* -** $Log: gl_kal.c $ -** -** 08 20 2012 yuche.tsai -** NULL -** Fix possible KE issue. - * - * 07 17 2012 yuche.tsai - * NULL - * Let netdev bring up. - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 06 13 2012 yuche.tsai - * NULL - * Update maintrunk driver. - * Add support for driver compose assoc request frame. - * - * 05 31 2012 terry.wu - * NULL - * . - * - * 03 26 2012 cp.wu - * [WCXRP00001187] [MT6620 Wi-Fi][Driver][Android] Add error handling while firmware image doesn't exist - * invoke put_cred() after get_current_cred() calls. - * - * 03 07 2012 yuche.tsai - * NULL - * Fix compile error when WiFi Direct is off. - * - * 03 02 2012 terry.wu - * NULL - * Snc CFG80211 modification for ICS migration from branch 2.2. - * - * 02 20 2012 cp.wu - * [WCXRP00001187] [MT6620 Wi-Fi][Driver][Android] Add error handling while firmware image doesn't exist - * do not need to invoke free() while firmware image file doesn't exist - * - * 01 05 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * Adding the related ioctl / wlan oid function to set the Tx power cfg. - * - * 01 02 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * Adding the proto type function for set_int set_tx_power and get int get_ch_list. - * - * 11 21 2011 cp.wu - * [WCXRP00001118] [MT6620 Wi-Fi][Driver] Corner case protections to pass Monkey testing - * 1. wlanoidQueryBssIdList might be passed with a non-zero length but a NULL pointer of buffer - * add more checking for such cases - * - * 2. kalSendComplete() might be invoked with a packet belongs to P2P network right after P2P is unregistered. - * add some tweaking to protect such cases because that net device has become invalid. - * - * 11 18 2011 yuche.tsai - * NULL - * CONFIG P2P support RSSI query, default turned off. - * - * 11 16 2011 yuche.tsai - * NULL - * Avoid using work thread. - * - * 11 10 2011 cp.wu - * [WCXRP00001098] [MT6620 Wi-Fi][Driver] Replace printk by DBG LOG macros in linux porting layer - * 1. eliminaite direct calls to printk in porting layer. - * 2. replaced by DBGLOG, which would be XLOG on ALPS platforms. - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 09 23 2011 yuche.tsai - * [WCXRP00000998] [Volunteer Patch][WiFi Direct][FW] P2P Social Channel & country domain issue - * Regulation domain feature check in. - * - * 08 12 2011 cp.wu - * [WCXRP00000913] [MT6620 Wi-Fi] create repository of source code dedicated for MT6620 E6 ASIC - * load WIFI_RAM_CODE_E6 for MT6620 E6 ASIC. - * - * 07 18 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add CMD/Event for RDD and BWCS. - * - * 06 13 2011 eddie.chen - * [WCXRP00000779] [MT6620 Wi-Fi][DRV] Add tx rx statistics in linux and use netif_rx_ni - * Add tx rx statistics and netif_rx_ni. - * - * 04 15 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add BOW short range mode. - * - * 04 12 2011 cp.wu - * [WCXRP00000635] [MT6620 Wi-Fi][Driver] Clear pending security frames when QM clear pending data frames for dedicated network type - * clear pending security frames for dedicated network type when BSS is being deactivated/disconnected - * - * 04 08 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * correct i4TxPendingFrameNum decreasing. - * - * 03 23 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * apply multi-queue operation only for linux kernel > 2.6.26 - * - * 03 21 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * portability for compatible with linux 2.6.12. - * - * 03 21 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * improve portability for awareness of early version of linux kernel and wireless extension. - * - * 03 18 2011 cp.wu - * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period - * refix ... - * - * 03 18 2011 cp.wu - * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period - * correct compiling warning/error. - * - * 03 18 2011 cp.wu - * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period - * add more robust fault tolerance design when pre-allocation failed. (rarely happen) - * - * 03 17 2011 cp.wu - * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period - * use pre-allocated buffer for storing enhanced interrupt response as well - * - * 03 16 2011 cp.wu - * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period - * 1. pre-allocate physical continuous buffer while module is being loaded - * 2. use pre-allocated physical continuous buffer for TX/RX DMA transfer - * - * The windows part remained the same as before, but added similiar APIs to hide the difference. - * - * 03 15 2011 cp.wu - * [WCXRP00000559] [MT6620 Wi-Fi][Driver] Combine TX/RX DMA buffers into a single one to reduce physically continuous memory consumption - * 1. deprecate CFG_HANDLE_IST_IN_SDIO_CALLBACK - * 2. Use common coalescing buffer for both TX/RX directions - * - * - * 03 14 2011 jeffrey.chang - * [WCXRP00000546] [MT6620 Wi-Fi][MT6620 Wi-Fi][Driver] fix kernel build warning message - * fix kernel build warning message - * - * 03 07 2011 terry.wu - * [WCXRP00000521] [MT6620 Wi-Fi][Driver] Remove non-standard debug message - * Toggle non-standard debug messages to comments. - * - * 03 06 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Sync BOW Driver to latest person development branch version.. - * - * 03 03 2011 jeffrey.chang - * [WCXRP00000512] [MT6620 Wi-Fi][Driver] modify the net device relative functions to support the H/W multiple queue - * support concurrent network - * - * 03 03 2011 jeffrey.chang - * [WCXRP00000512] [MT6620 Wi-Fi][Driver] modify the net device relative functions to support the H/W multiple queue - * modify net device relative functions to support multiple H/W queues - * - * 03 02 2011 cp.wu - * [WCXRP00000503] [MT6620 Wi-Fi][Driver] Take RCPI brought by association response as initial RSSI right after connection is built. - * use RCPI brought by ASSOC-RESP after connection is built as initial RCPI to avoid using a uninitialized MAC-RX RCPI. - * - * 02 21 2011 cp.wu - * [WCXRP00000482] [MT6620 Wi-Fi][Driver] Simplify logic for checking NVRAM existence in driver domain - * simplify logic for checking NVRAM existence only once. - * - * 01 24 2011 cp.wu - * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving - * 1. add an extra counter for tracking pending forward frames. - * 2. notify TX service thread as well when there is pending forward frame - * 3. correct build errors leaded by introduction of Wi-Fi direct separation module - * - * 01 19 2011 cp.wu - * [WCXRP00000371] [MT6620 Wi-Fi][Driver] make linux glue layer portable for Android 2.3.1 with Linux 2.6.35.7 - * add compile option to check linux version 2.6.35 for different usage of system API to improve portability - * - * 01 12 2011 cp.wu - * [WCXRP00000357] [MT6620 Wi-Fi][Driver][Bluetooth over Wi-Fi] add another net device interface for BT AMP - * implementation of separate BT_OVER_WIFI data path. - * - * 01 10 2011 cp.wu - * [WCXRP00000349] [MT6620 Wi-Fi][Driver] make kalIoctl() of linux port as a thread safe API to avoid potential issues due to multiple access - * use mutex to protect kalIoctl() for thread safe. - * - * 11 26 2010 cp.wu - * [WCXRP00000209] [MT6620 Wi-Fi][Driver] Modify NVRAM checking mechanism to warning only with necessary data field checking - * 1. NVRAM error is now treated as warning only, thus normal operation is still available but extra scan result used to indicate user is attached - * 2. DPD and TX-PWR are needed fields from now on, if these 2 fields are not availble then warning message is shown - * - * 11 04 2010 wh.su - * [WCXRP00000164] [MT6620 Wi-Fi][Driver] Support the p2p random SSID - * adding the p2p random ssid support. - * - * 11 02 2010 jeffrey.chang - * [WCXRP00000145] [MT6620 Wi-Fi][Driver] fix issue of byte endian in packet classifier which discards BoW packets - * . - * - * 11 01 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module - * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead - * 2) Remove CNM CH-RECOVER event handling - * 3) cfg read/write API renamed with kal prefix for unified naming rules. - * - * 11 01 2010 yarco.yang - * [WCXRP00000149] [MT6620 WI-Fi][Driver]Fine tune performance on MT6516 platform - * Add code to run WlanIST in SDIO callback. - * - * 10 26 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command - * 1) update NVRAM content template to ver 1.02 - * 2) add compile option for querying NIC capability (default: off) - * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting - * 4) correct auto-rate compiler error under linux (treat warning as error) - * 5) simplify usage of NVRAM and REG_INFO_T - * 6) add version checking between driver and firmware - * - * 10 25 2010 jeffrey.chang - * [WCXRP00000129] [MT6620] [Driver] Kernel panic when rmmod module on Andriod platform - * Remove redundant code which cause mismatch of power control release - * - * 10 25 2010 jeffrey.chang - * [WCXRP00000129] [MT6620] [Driver] Kernel panic when rmmod module on Andriod platform - * Remove redundant GLUE_HALT condfition to avoid unmatched release of power control - * - * 10 18 2010 jeffrey.chang - * [WCXRP00000116] [MT6620 Wi-Fi][Driver] Refine the set_scan ioctl to resolve the Android UI hanging issue - * refine the scan ioctl to prevent hanging of Android UI - * - * 10 18 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android - * complete implementation of Android NVRAM access - * - * 10 06 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * if there is NVRAM, then use MAC address on NVRAM as default MAC address. - * - * 10 06 2010 cp.wu - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * code reorganization to improve isolation between GLUE and CORE layers. - * - * 10 05 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * 1) add NVRAM access API - * 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option) - * 3) add OID implementation for NVRAM read/write service - * - * 09 21 2010 cp.wu - * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated - * Do a complete reset with STA-REC null checking for RF test re-entry - * - * 09 21 2010 kevin.huang - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * Eliminate Linux Compile Warning - * - * 09 07 2010 wh.su - * NULL - * adding the code for beacon/probe req/ probe rsp wsc ie at p2p. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 30 2010 cp.wu - * NULL - * API added: nicTxPendingPackets(), for simplifying porting layer - * - * 08 20 2010 yuche.tsai - * NULL - * Support second interface indicate when enabling P2P. - * - * 08 18 2010 yarco.yang - * NULL - * 1. Fixed HW checksum offload function not work under Linux issue. - * 2. Add debug message. - * - * 08 16 2010 jeffrey.chang - * NULL - * remove redundant code which cause kernel panic - * - * 08 16 2010 cp.wu - * NULL - * P2P packets are now marked when being queued into driver, and identified later without checking MAC address - * - * 08 02 2010 jeffrey.chang - * NULL - * 1) modify tx service thread to avoid busy looping - * 2) add spin lock declartion for linux build - * - * 07 29 2010 cp.wu - * NULL - * simplify post-handling after TX_DONE interrupt is handled. - * - * 07 28 2010 jeffrey.chang - * NULL - * 1) remove unused spinlocks - * 2) enable encyption ioctls - * 3) fix scan ioctl which may cause supplicant to hang - * - * 07 23 2010 cp.wu - * - * 1) re-enable AIS-FSM beacon timeout handling. - * 2) scan done API revised - * - * 07 23 2010 jeffrey.chang - * - * add new KAL api - * - * 07 23 2010 jeffrey.chang - * - * bug fix: allocate regInfo when disabling firmware download - * - * 07 23 2010 jeffrey.chang - * - * use glue layer api to decrease or increase counter atomically - * - * 07 22 2010 jeffrey.chang - * - * modify tx thread and remove some spinlock - * - * 07 22 2010 jeffrey.chang - * - * use different spin lock for security frame - * - * 07 22 2010 jeffrey.chang - * - * add new spinlock - * - * 07 19 2010 jeffrey.chang - * - * add spinlock for pending security frame count - * - * 07 19 2010 jeffrey.chang - * - * adjust the timer unit to microsecond - * - * 07 19 2010 jeffrey.chang - * - * timer should return value greater than zero - * - * 07 19 2010 jeffrey.chang - * - * add kal api for scanning done - * - * 07 19 2010 jeffrey.chang - * - * modify cmd/data path for new design - * - * 07 19 2010 jeffrey.chang - * - * add new kal api - * - * 07 19 2010 jeffrey.chang - * - * for linux driver migration - * - * 07 19 2010 jeffrey.chang - * - * Linux port modification - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 23 2010 yarco.yang - * [WPD00003837][MT6620]Data Path Refine - * Merge g_arStaRec[] into adapter->arStaRec[] - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * change MAC address updating logic. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 06 01 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * remove unused files. - * - * 05 29 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * fix private ioctl for rftest - * - * 05 29 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * workaround for fixing request_firmware() failure on android 2.1 - * - * 05 28 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * fix kernel panic when debug mode enabled - * - * 05 26 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * 1) Modify set mac address code - * 2) remove power managment macro - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * 1) add timeout handler mechanism for pending command packets - * 2) add p2p add/removal key - * - * 05 14 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * Disable network interface after disassociation - * - * 05 10 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * fill network type field while doing frame identification. - * - * 05 07 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * prevent supplicant accessing driver during resume - * - * 04 27 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * identify BT Over Wi-Fi Security frame and mark it as 802.1X frame - * - * 04 27 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * 1) fix firmware download bug - * 2) remove query statistics for acelerating firmware download - * - * 04 27 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * follow Linux's firmware framework, and remove unused kal API - * - * 04 22 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * - * 1) modify rx path code for supporting Wi-Fi direct - * 2) modify config.h since Linux dont need to consider retaining packet - * - * 04 21 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * add for private ioctl support - * - * 04 15 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * change firmware name - * - * 04 14 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * flush pending TX packets while unloading driver - * - * 04 14 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * Set driver own before handling cmd queue - * - * 04 14 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * 1) prGlueInfo->pvInformationBuffer and prGlueInfo->u4InformationBufferLength are no longer used - * 2) fix ioctl - * - * 04 14 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * information buffer for query oid/ioctl is now buffered in prCmdInfo - * * * * * * * instead of glue-layer variable to improve multiple oid/ioctl capability - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * * * * * * * * * * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * * * * * * * * * * * * * * * * 2) command sequence number is now increased atomically - * * * * * * * * * * * * * * * * * * 3) private data could be hold and taken use for other purpose - * - * 04 09 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * fix spinlock usage - * - * 04 09 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * add spinlock for i4TxPendingFrameNum access - * - * 04 09 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * 1) add spinlock - * * 2) add KAPI for handling association info - * - * 04 09 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * fix spinlock usage - * - * 04 09 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * adding firmware download KAPI - * - * 04 07 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * Set MAC address from firmware - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1. free cmdinfo after command is emiited. - * 2. for BoW frames, user priority is extracted from sk_buff directly. - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * finish non-glue layer access to glue variables - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * accessing to firmware load/start address, and access to OID handling information - * * * are now handled in glue layer - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * rWlanInfo should be placed at adapter rather than glue due to most operations - * * * * * * * are done in adapter layer. - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access to prGlueInfo->eParamMediaStateIndicated from non-glue layer - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * (1)deliver the kalOidComplete status to upper layer - * (2) fix spin lock - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add KAL API: kalFlushPendingTxPackets(), and take use of the API - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access to prGlueInfo->rWlanInfo.eLinkAttr.ucMediaStreamMode from non-glue layer. - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * add timeout check in the kalOidComplete - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * improve none-glue code portability - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * code refine: fgTestMode should be at adapter rather than glue due to the device/fw is also involved - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access for prGlueInfo->fgIsCardRemoved in non-glue layer - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) for some OID, never do timeout expiration - * * * 2) add 2 kal API for later integration - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * raising the priority of processing interrupt - * - * 04 01 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * Bug fix: the tx thread will cause starvation of MMC thread, and the interrupt will never come in - * - * 03 30 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * emulate NDIS Pending OID facility - * - * 03 28 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * adding secondary command queue for improving non-glue code portability - * - * 03 26 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * [WPD00003826] Initial import for Linux port - * adding firmware download kal api - * - * 03 25 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add Bluetooth-over-Wifi frame header check - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port -** \main\maintrunk.MT5921\50 2009-09-28 20:19:08 GMT mtk01090 -** Add private ioctl to carry OID structures. Restructure public/private ioctl interfaces to Linux kernel. -** \main\maintrunk.MT5921\49 2009-08-18 22:56:44 GMT mtk01090 -** Add Linux SDIO (with mmc core) support. -** Add Linux 2.6.21, 2.6.25, 2.6.26. -** Fix compile warning in Linux. -** \main\maintrunk.MT5921\48 2009-06-23 23:18:58 GMT mtk01090 -** Add build option BUILD_USE_EEPROM and compile option CFG_SUPPORT_EXT_CONFIG for NVRAM support -** \main\maintrunk.MT5921\47 2008-11-19 11:55:43 GMT mtk01088 -** fixed some lint warning, and rename some variable with pre-fix to avoid the misunderstanding -** \main\maintrunk.MT5921\46 2008-09-02 21:07:42 GMT mtk01461 -** Remove ASSERT(pvBuf) in kalIndicateStatusAndComplete(), this parameter can be NULL -** \main\maintrunk.MT5921\45 2008-08-29 16:03:21 GMT mtk01088 -** remove non-used code for code review, add assert check -** \main\maintrunk.MT5921\44 2008-08-21 00:32:49 GMT mtk01461 -** \main\maintrunk.MT5921\43 2008-05-30 20:27:02 GMT mtk01461 -** Rename KAL function -** \main\maintrunk.MT5921\42 2008-05-30 15:47:29 GMT mtk01461 -** \main\maintrunk.MT5921\41 2008-05-30 15:13:04 GMT mtk01084 -** rename wlanoid -** \main\maintrunk.MT5921\40 2008-05-29 14:15:14 GMT mtk01084 -** remove un-used KAL function -** \main\maintrunk.MT5921\39 2008-05-03 15:17:30 GMT mtk01461 -** Move Query Media Status to GLUE -** \main\maintrunk.MT5921\38 2008-04-24 11:59:44 GMT mtk01461 -** change awake queue threshold and remove code which mark #if 0 -** \main\maintrunk.MT5921\37 2008-04-17 23:06:35 GMT mtk01461 -** Add iwpriv support for AdHocMode setting -** \main\maintrunk.MT5921\36 2008-04-08 15:38:56 GMT mtk01084 -** add KAL function to setting pattern search function enable/ disable -** \main\maintrunk.MT5921\35 2008-04-01 23:53:13 GMT mtk01461 -** Add comment -** \main\maintrunk.MT5921\34 2008-03-26 15:36:48 GMT mtk01461 -** Add update MAC Address for Linux -** \main\maintrunk.MT5921\33 2008-03-18 11:49:34 GMT mtk01084 -** update function for initial value access -** \main\maintrunk.MT5921\32 2008-03-18 10:25:22 GMT mtk01088 -** use kal update associate request at linux -** \main\maintrunk.MT5921\31 2008-03-06 23:43:08 GMT mtk01385 -** 1. add Query Registry Mac address function. -** \main\maintrunk.MT5921\30 2008-02-26 09:47:57 GMT mtk01084 -** modify KAL set network address/ checksum offload part -** \main\maintrunk.MT5921\29 2008-02-12 23:26:53 GMT mtk01461 -** Add debug option - Packet Order for Linux -** \main\maintrunk.MT5921\28 2008-01-09 17:54:43 GMT mtk01084 -** modify the argument of kalQueryPacketInfo() -** \main\maintrunk.MT5921\27 2007-12-24 16:02:03 GMT mtk01425 -** 1. Revise csum offload -** \main\maintrunk.MT5921\26 2007-11-30 17:03:36 GMT mtk01425 -** 1. Fix bugs -** -** \main\maintrunk.MT5921\25 2007-11-29 01:57:17 GMT mtk01461 -** Fix Windows RX multiple packet retain problem -** \main\maintrunk.MT5921\24 2007-11-20 11:24:07 GMT mtk01088 -** CR90, not doing the netif_carrier_off to let supplicant 1x pkt can be rcv at hardstattXmit -** \main\maintrunk.MT5921\23 2007-11-09 16:36:44 GMT mtk01425 -** 1. Modify for CSUM offloading with Tx Fragment -** \main\maintrunk.MT5921\22 2007-11-07 18:37:39 GMT mtk01461 -** Add Tx Fragmentation Support -** \main\maintrunk.MT5921\21 2007-11-06 19:34:06 GMT mtk01088 -** add the WPS code, indicate the mgmt frame to upper layer -** \main\maintrunk.MT5921\20 2007-11-02 01:03:21 GMT mtk01461 -** Unify TX Path for Normal and IBSS Power Save + IBSS neighbor learning -** \main\maintrunk.MT5921\19 2007-10-30 11:59:38 GMT MTK01425 -** 1. Update wlanQueryInformation -** \main\maintrunk.MT5921\18 2007-10-30 10:44:57 GMT mtk01425 -** 1. Refine multicast list code -** 2. Refine TCP/IP csum offload code -** -** Revision 1.5 2007/07/17 13:01:18 MTK01088 -** add associate req and rsp function -** -** Revision 1.4 2007/07/13 05:19:19 MTK01084 -** provide timer set functions -** -** Revision 1.3 2007/06/27 02:18:51 MTK01461 -** Update SCAN_FSM, Initial(Can Load Module), Proc(Can do Reg R/W), TX API -** -** Revision 1.2 2007/06/25 06:16:24 MTK01461 -** Update illustrations, gl_init.c, gl_kal.c, gl_kal.h, gl_os.h and RX API -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "gl_os.h" -#include "gl_wext.h" -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ -#if DBG -int allocatedMemSize = 0; -#endif - -extern struct semaphore g_halt_sem; -extern int g_u4HaltFlag; - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ -static PVOID pvIoBuffer = NULL; -static UINT_32 pvIoBufferSize = 0; -static UINT_32 pvIoBufferUsage = 0; - - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -#if defined(MT6620) && CFG_MULTI_ECOVER_SUPPORT -typedef enum _ENUM_WMTHWVER_TYPE_T{ - WMTHWVER_MT6620_E1 = 0x0, - WMTHWVER_MT6620_E2 = 0x1, - WMTHWVER_MT6620_E3 = 0x2, - WMTHWVER_MT6620_E4 = 0x3, - WMTHWVER_MT6620_E5 = 0x4, - WMTHWVER_MT6620_E6 = 0x5, - WMTHWVER_MT6620_MAX, - WMTHWVER_INVALID = 0xff -} ENUM_WMTHWVER_TYPE_T, *P_ENUM_WMTHWVER_TYPE_T; - -extern ENUM_WMTHWVER_TYPE_T -mtk_wcn_wmt_hwver_get( - VOID - ); -#elif defined(MT5931) && CFG_MULTI_ECOVER_SUPPORT -typedef enum _ENUM_HWVER_TYPE_T{ - HWVER_MT5931_E1 = 0x1, - HWVER_MT5931_E2 = 0x2, - HWVER_MT5931_E3 = 0x3, - HWVER_MT5931_MAX, - HWVER_INVALID = 0xff -} ENUM_HWVER_TYPE_T, *P_ENUM_HWVER_TYPE_T; -#endif - - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#if CFG_ENABLE_FW_DOWNLOAD - -static struct file *filp = NULL; -static uid_t orgfsuid; -static gid_t orgfsgid; -static mm_segment_t orgfs; - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is provided by GLUE Layer for internal driver stack to -* open firmware image in kernel space -* -* \param[in] prGlueInfo Pointer of GLUE Data Structure -* -* \retval WLAN_STATUS_SUCCESS. -* \retval WLAN_STATUS_FAILURE. -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -kalFirmwareOpen ( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - /* FIX ME: since we don't have hotplug script in the filesystem - * , so the request_firmware() KAPI can not work properly - */ - - /* save uid and gid used for filesystem access. - * set user and group to 0(root) */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) - orgfsuid = current->fsuid; - orgfsgid = current->fsgid; - current->fsuid = current->fsgid = 0; -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) - struct cred *cred = (struct cred *) get_current_cred(); - orgfsuid = cred->fsuid; - orgfsgid = cred->fsgid; - cred->fsuid = cred->fsgid = 0; -#else - struct cred *cred = get_task_cred(current); - orgfsuid = cred->fsuid; - orgfsgid = cred->fsgid; - cred->fsuid = cred->fsgid = 0; -#endif - - ASSERT(prGlueInfo); - - - orgfs = get_fs(); - set_fs(get_ds()); - - - /* open the fw file */ -#if defined(MT6620) & CFG_MULTI_ECOVER_SUPPORT - switch(mtk_wcn_wmt_hwver_get()) { - case WMTHWVER_MT6620_E1: - case WMTHWVER_MT6620_E2: - case WMTHWVER_MT6620_E3: - case WMTHWVER_MT6620_E4: - case WMTHWVER_MT6620_E5: - filp = filp_open("/etc/firmware/"CFG_FW_FILENAME, O_RDONLY, 0); - break; - - case WMTHWVER_MT6620_E6: - default: - filp = filp_open("/etc/firmware/"CFG_FW_FILENAME"_E6", O_RDONLY, 0); - break; - } -#elif defined(MT5931) && CFG_MULTI_ECOVER_SUPPORT - switch (wlanGetEcoVersion(prGlueInfo->prAdapter)) { - case HWVER_MT5931_E1: - case HWVER_MT5931_E2: - filp = filp_open("/etc/firmware/"CFG_FW_FILENAME"_E2", O_RDONLY, 0); - break; - case HWVER_MT5931_E3: - default: - filp = filp_open("/etc/firmware/"CFG_FW_FILENAME, O_RDONLY, 0); - break; - } -#elif defined(MT6628) - filp = filp_open("/etc/firmware/"CFG_FW_FILENAME"_MT6628", O_RDONLY, 0); -#else - filp = filp_open("/etc/firmware/"CFG_FW_FILENAME, O_RDONLY, 0); -#endif - if (IS_ERR(filp)) { - DBGLOG(INIT, INFO, ("Open FW image: %s failed\n", CFG_FW_FILENAME)); - goto error_open; - } - DBGLOG(INIT, INFO, ("Open FW image: %s done\n", CFG_FW_FILENAME)); - return WLAN_STATUS_SUCCESS; - -error_open: - /* restore */ - set_fs(orgfs); -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) - current->fsuid = orgfsuid; - current->fsgid = orgfsgid; -#else - cred->fsuid = orgfsuid; - cred->fsgid = orgfsgid; - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) - put_cred(cred); - #endif -#endif - return WLAN_STATUS_FAILURE; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is provided by GLUE Layer for internal driver stack to -* release firmware image in kernel space -* -* \param[in] prGlueInfo Pointer of GLUE Data Structure -* -* \retval WLAN_STATUS_SUCCESS. -* \retval WLAN_STATUS_FAILURE. -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -kalFirmwareClose ( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - if ((filp != NULL) && !IS_ERR(filp)) { - /* close firmware file */ - filp_close(filp, NULL); - - /* restore */ - set_fs(orgfs); -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) - current->fsuid = orgfsuid; - current->fsgid = orgfsgid; -#else - { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) - struct cred *cred = (struct cred *) get_current_cred(); -#else - struct cred *cred = get_task_cred(current); -#endif - cred->fsuid = orgfsuid; - cred->fsgid = orgfsgid; - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) - put_cred(cred); - #endif - } -#endif - filp = NULL; - } - - return WLAN_STATUS_SUCCESS; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is provided by GLUE Layer for internal driver stack to -* load firmware image in kernel space -* -* \param[in] prGlueInfo Pointer of GLUE Data Structure -* -* \retval WLAN_STATUS_SUCCESS. -* \retval WLAN_STATUS_FAILURE. -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -kalFirmwareLoad ( - IN P_GLUE_INFO_T prGlueInfo, - OUT PVOID prBuf, - IN UINT_32 u4Offset, - OUT PUINT_32 pu4Size - ) -{ - ASSERT(prGlueInfo); - ASSERT(pu4Size); - ASSERT(prBuf); - - //l = filp->f_path.dentry->d_inode->i_size; - - /* the object must have a read method */ - if ((filp == NULL) || IS_ERR(filp) || (filp->f_op == NULL) || (filp->f_op->read == NULL)) { - goto error_read; - } else { - filp->f_pos = u4Offset; - *pu4Size = filp->f_op->read(filp, prBuf, *pu4Size, &filp->f_pos); - } - - return WLAN_STATUS_SUCCESS; - -error_read: - return WLAN_STATUS_FAILURE; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is provided by GLUE Layer for internal driver stack to -* query firmware image size in kernel space -* -* \param[in] prGlueInfo Pointer of GLUE Data Structure -* -* \retval WLAN_STATUS_SUCCESS. -* \retval WLAN_STATUS_FAILURE. -* -*/ -/*----------------------------------------------------------------------------*/ - -WLAN_STATUS -kalFirmwareSize ( - IN P_GLUE_INFO_T prGlueInfo, - OUT PUINT_32 pu4Size - ) -{ - ASSERT(prGlueInfo); - ASSERT(pu4Size); - -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 12) - *pu4Size = filp->f_path.dentry->d_inode->i_size; -#else - *pu4Size = filp->f_dentry->d_inode->i_size; -#endif - - return WLAN_STATUS_SUCCESS; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to load firmware image -* -* \param pvGlueInfo Pointer of GLUE Data Structure -* \param ppvMapFileBuf Pointer of pointer to memory-mapped firmware image -* \param pu4FileLength File length and memory mapped length as well - -* \retval Map File Handle, used for unammping -*/ -/*----------------------------------------------------------------------------*/ - -PVOID -kalFirmwareImageMapping ( - IN P_GLUE_INFO_T prGlueInfo, - OUT PPVOID ppvMapFileBuf, - OUT PUINT_32 pu4FileLength - ) -{ - DEBUGFUNC("kalFirmwareImageMapping"); - - ASSERT(prGlueInfo); - ASSERT(ppvMapFileBuf); - ASSERT(pu4FileLength); - - do { - /* <1> Open firmware */ - if (kalFirmwareOpen(prGlueInfo) != WLAN_STATUS_SUCCESS) { - break; - } else { - UINT_32 u4FwSize = 0; - PVOID prFwBuffer = NULL; - /* <2> Query firmare size */ - kalFirmwareSize(prGlueInfo, &u4FwSize); - /* <3> Use vmalloc for allocating large memory trunk */ - prFwBuffer = vmalloc(ALIGN_4(u4FwSize)); - /* <4> Load image binary into buffer */ - if (kalFirmwareLoad(prGlueInfo, prFwBuffer, 0, &u4FwSize) != WLAN_STATUS_SUCCESS) { - vfree(prFwBuffer); - kalFirmwareClose(prGlueInfo); - break; - } - /* <5> write back info */ - *pu4FileLength = u4FwSize; - *ppvMapFileBuf = prFwBuffer; - - return prFwBuffer; - } - - } while (FALSE); - - return NULL; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to unload firmware image mapped memory -* -* \param pvGlueInfo Pointer of GLUE Data Structure -* \param pvFwHandle Pointer to mapping handle -* \param pvMapFileBuf Pointer to memory-mapped firmware image -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ - -VOID -kalFirmwareImageUnmapping ( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID prFwHandle, - IN PVOID pvMapFileBuf - ) -{ - DEBUGFUNC("kalFirmwareImageUnmapping"); - - ASSERT(prGlueInfo); - - /* pvMapFileBuf might be NULL when file doesn't exist */ - if(pvMapFileBuf) { - vfree(pvMapFileBuf); - } - - kalFirmwareClose(prGlueInfo); -} - -#endif - -#if 0 - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to load firmware image -* -* \param pvGlueInfo Pointer of GLUE Data Structure -* \param ppvMapFileBuf Pointer of pointer to memory-mapped firmware image -* \param pu4FileLength File length and memory mapped length as well - -* \retval Map File Handle, used for unammping -*/ -/*----------------------------------------------------------------------------*/ - -PVOID -kalFirmwareImageMapping ( - IN P_GLUE_INFO_T prGlueInfo, - OUT PPVOID ppvMapFileBuf, - OUT PUINT_32 pu4FileLength - ) -{ - INT_32 i4Ret = 0; - - DEBUGFUNC("kalFirmwareImageMapping"); - - ASSERT(prGlueInfo); - ASSERT(ppvMapFileBuf); - ASSERT(pu4FileLength); - - do { - GL_HIF_INFO_T *prHifInfo = &prGlueInfo->rHifInfo; - prGlueInfo->prFw = NULL; - - /* <1> Open firmware */ - i4Ret = request_firmware(&prGlueInfo->prFw, CFG_FW_FILENAME, &prHifInfo->func->dev); - - if (i4Ret) { - printk (KERN_INFO DRV_NAME"fw %s:request failed %d\n", CFG_FW_FILENAME, i4Ret); - break; - } else { - *pu4FileLength = prGlueInfo->prFw->size; - *ppvMapFileBuf = prGlueInfo->prFw->data; - return prGlueInfo->prFw->data; - } - - } while (FALSE); - - return NULL; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to unload firmware image mapped memory -* -* \param pvGlueInfo Pointer of GLUE Data Structure -* \param pvFwHandle Pointer to mapping handle -* \param pvMapFileBuf Pointer to memory-mapped firmware image -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ - -VOID -kalFirmwareImageUnmapping ( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID prFwHandle, - IN PVOID pvMapFileBuf - ) -{ - DEBUGFUNC("kalFirmwareImageUnmapping"); - - ASSERT(prGlueInfo); - ASSERT(pvMapFileBuf); - - release_firmware(prGlueInfo->prFw); - -} -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is provided by GLUE Layer for internal driver stack to acquire -* OS SPIN_LOCK. -* -* \param[in] prGlueInfo Pointer of GLUE Data Structure -* \param[in] rLockCategory Specify which SPIN_LOCK -* \param[out] pu4Flags Pointer of a variable for saving IRQ flags -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalAcquireSpinLock ( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_SPIN_LOCK_CATEGORY_E rLockCategory, - OUT PUINT_32 pu4Flags - ) -{ - UINT_32 u4Flags = 0; - - ASSERT(prGlueInfo); - ASSERT(pu4Flags); - - if (rLockCategory < SPIN_LOCK_NUM) { - -#if CFG_USE_SPIN_LOCK_BOTTOM_HALF - spin_lock_bh(&prGlueInfo->rSpinLock[rLockCategory]); -#else /* !CFG_USE_SPIN_LOCK_BOTTOM_HALF */ - spin_lock_irqsave(&prGlueInfo->rSpinLock[rLockCategory], u4Flags); -#endif /* !CFG_USE_SPIN_LOCK_BOTTOM_HALF */ - - *pu4Flags = u4Flags; - } - - return; -} /* end of kalAcquireSpinLock() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is provided by GLUE Layer for internal driver stack to release -* OS SPIN_LOCK. -* -* \param[in] prGlueInfo Pointer of GLUE Data Structure -* \param[in] rLockCategory Specify which SPIN_LOCK -* \param[in] u4Flags Saved IRQ flags -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalReleaseSpinLock ( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_SPIN_LOCK_CATEGORY_E rLockCategory, - IN UINT_32 u4Flags - ) -{ - ASSERT(prGlueInfo); - - if (rLockCategory < SPIN_LOCK_NUM) { - -#if CFG_USE_SPIN_LOCK_BOTTOM_HALF - spin_unlock_bh(&prGlueInfo->rSpinLock[rLockCategory]); -#else /* !CFG_USE_SPIN_LOCK_BOTTOM_HALF */ - spin_unlock_irqrestore(&prGlueInfo->rSpinLock[rLockCategory], u4Flags); -#endif /* !CFG_USE_SPIN_LOCK_BOTTOM_HALF */ - - } - - return; -} /* end of kalReleaseSpinLock() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is provided by GLUE Layer for internal driver stack to update -* current MAC address. -* -* \param[in] prGlueInfo Pointer of GLUE Data Structure -* \param[in] pucMacAddr Pointer of current MAC address -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalUpdateMACAddress ( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucMacAddr - ) -{ - ASSERT(prGlueInfo); - ASSERT(pucMacAddr); - - if(UNEQUAL_MAC_ADDR(prGlueInfo->prDevHandler->dev_addr, pucMacAddr)) { - memcpy(prGlueInfo->prDevHandler->dev_addr, pucMacAddr, PARAM_MAC_ADDR_LEN); - } - - return; -} - - -#if CFG_TCP_IP_CHKSUM_OFFLOAD -/*----------------------------------------------------------------------------*/ -/*! -* \brief To query the packet information for offload related parameters. -* -* \param[in] pvPacket Pointer to the packet descriptor. -* \param[in] pucFlag Points to the offload related parameter. -* -* \return (none) -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalQueryTxChksumOffloadParam ( - IN PVOID pvPacket, - OUT PUINT_8 pucFlag - ) -{ - struct sk_buff *skb = (struct sk_buff *) pvPacket; - UINT_8 ucFlag = 0; - - ASSERT(pvPacket); - ASSERT(pucFlag); - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) - if (skb->ip_summed == CHECKSUM_HW) -#else - if (skb->ip_summed == CHECKSUM_PARTIAL) -#endif - { - -#if DBG - /* Kevin: do double check, we can remove this part in Normal Driver. - * Because we register NIC feature with NETIF_F_IP_CSUM for MT5912B MAC, so - * we'll process IP packet only. - */ - if (skb->protocol != __constant_htons(ETH_P_IP)) { - //printk("Wrong skb->protocol( = %08x) for TX Checksum Offload.\n", skb->protocol); - } - else -#endif - ucFlag |= (TX_CS_IP_GEN | TX_CS_TCP_UDP_GEN); - } - - *pucFlag = ucFlag; - - return; -} /* kalQueryChksumOffloadParam */ - - -//4 2007/10/8, mikewu, this is rewritten by Mike -/*----------------------------------------------------------------------------*/ -/*! -* \brief To update the checksum offload status to the packet to be indicated to OS. -* -* \param[in] pvPacket Pointer to the packet descriptor. -* \param[in] pucFlag Points to the offload related parameter. -* -* \return (none) -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalUpdateRxCSUMOffloadParam ( - IN PVOID pvPacket, - IN ENUM_CSUM_RESULT_T aeCSUM[] - ) -{ - struct sk_buff *skb = (struct sk_buff *)pvPacket; - - ASSERT(pvPacket); - - if ( (aeCSUM[CSUM_TYPE_IPV4] == CSUM_RES_SUCCESS || aeCSUM[CSUM_TYPE_IPV6] == CSUM_RES_SUCCESS)&& - ( (aeCSUM[CSUM_TYPE_TCP] == CSUM_RES_SUCCESS) || (aeCSUM[CSUM_TYPE_UDP] == CSUM_RES_SUCCESS)) ) { - skb->ip_summed = CHECKSUM_UNNECESSARY; - } - else { - skb->ip_summed = CHECKSUM_NONE; -#if DBG - if (aeCSUM[CSUM_TYPE_IPV4] == CSUM_RES_NONE && aeCSUM[CSUM_TYPE_IPV6] == CSUM_RES_NONE) { - DBGLOG(RX, TRACE, ("RX: \"non-IPv4/IPv6\" Packet\n")); - } - else if (aeCSUM[CSUM_TYPE_IPV4] == CSUM_RES_FAILED) { - DBGLOG(RX, TRACE, ("RX: \"bad IP Checksum\" Packet\n")); - } - else if (aeCSUM[CSUM_TYPE_TCP] == CSUM_RES_FAILED) { - DBGLOG(RX, TRACE, ("RX: \"bad TCP Checksum\" Packet\n")); - } - else if (aeCSUM[CSUM_TYPE_UDP] == CSUM_RES_FAILED) { - DBGLOG(RX, TRACE, ("RX: \"bad UDP Checksum\" Packet\n")); - } - else { - - } -#endif - } - -} /* kalUpdateRxCSUMOffloadParam */ -#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is called to free packet allocated from kalPacketAlloc. -* -* \param[in] prGlueInfo Pointer of GLUE Data Structure -* \param[in] pvPacket Pointer of the packet descriptor -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalPacketFree( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID pvPacket - ) -{ - dev_kfree_skb((struct sk_buff *) pvPacket); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Only handles driver own creating packet (coalescing buffer). -* -* \param prGlueInfo Pointer of GLUE Data Structure -* \param u4Size Pointer of Packet Handle -* \param ppucData Status Code for OS upper layer -* -* \return NULL: Failed to allocate skb, Not NULL get skb -*/ -/*----------------------------------------------------------------------------*/ -PVOID -kalPacketAlloc ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4Size, - OUT PUINT_8 *ppucData - ) -{ - struct sk_buff *prSkb = dev_alloc_skb(u4Size); - - if (prSkb) { - *ppucData = (PUINT_8) (prSkb->data); - } -#if DBG -{ - PUINT_32 pu4Head = (PUINT_32)&prSkb->cb[0]; - *pu4Head = (UINT_32)prSkb->head; - DBGLOG(RX, TRACE, ("prSkb->head = %#lx, prSkb->cb = %#lx\n", (UINT_32)prSkb->head, *pu4Head)); -} -#endif - return (PVOID) prSkb; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Process the received packet for indicating to OS. -* -* \param[in] prGlueInfo Pointer to the Adapter structure. -* \param[in] pvPacket Pointer of the packet descriptor -* \param[in] pucPacketStart The starting address of the buffer of Rx packet. -* \param[in] u4PacketLen The packet length. -* \param[in] pfgIsRetain Is the packet to be retained. -* \param[in] aerCSUM The result of TCP/ IP checksum offload. -* -* \retval WLAN_STATUS_SUCCESS. -* \retval WLAN_STATUS_FAILURE. -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -kalProcessRxPacket ( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID pvPacket, - IN PUINT_8 pucPacketStart, - IN UINT_32 u4PacketLen, - //IN PBOOLEAN pfgIsRetain, - IN BOOLEAN fgIsRetain, - IN ENUM_CSUM_RESULT_T aerCSUM[] - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - struct sk_buff *skb = (struct sk_buff *)pvPacket; - - - skb->data = (unsigned char *)pucPacketStart; - skb->tail = (unsigned char *) ((UINT_32) (pucPacketStart + u4PacketLen)); - skb->len = (unsigned int)u4PacketLen; - -#if CFG_TCP_IP_CHKSUM_OFFLOAD - kalUpdateRxCSUMOffloadParam(skb, aerCSUM); -#endif - - return rStatus; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To indicate an array of received packets is available for higher -* level protocol uses. -* -* \param[in] prGlueInfo Pointer to the Adapter structure. -* \param[in] apvPkts The packet array to be indicated -* \param[in] ucPktNum The number of packets to be indicated -* -* \retval TRUE Success. -* -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -kalRxIndicatePkts ( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID apvPkts[], - IN UINT_8 ucPktNum - ) -{ - UINT_8 ucIdx = 0; - struct net_device *prNetDev = prGlueInfo->prDevHandler; - struct sk_buff *prSkb = NULL; - - ASSERT(prGlueInfo); - ASSERT(apvPkts); - -#if CFG_BOW_TEST - UINT_32 i; -#endif - - for(ucIdx = 0; ucIdx < ucPktNum; ucIdx++) { - prSkb = apvPkts[ucIdx]; -#if DBG - do { - PUINT_8 pu4Head = (PUINT_8)&prSkb->cb[0]; - UINT_32 u4HeadValue = 0; - kalMemCopy(&u4HeadValue, pu4Head, sizeof(u4HeadValue)); - DBGLOG(RX, TRACE, ("prSkb->head = 0x%p, prSkb->cb = 0x%lx\n", pu4Head, u4HeadValue)); - } while (0); -#endif - - if (GLUE_GET_PKT_IS_P2P(prSkb)) { - /* P2P */ -#if CFG_ENABLE_WIFI_DIRECT - if(prGlueInfo->prAdapter->fgIsP2PRegistered) { - prNetDev = kalP2PGetDevHdlr(prGlueInfo); - } - - prNetDev->stats.rx_bytes += prSkb->len; - prNetDev->stats.rx_packets++; - -#else - prNetDev = prGlueInfo->prDevHandler; -#endif - } - else if (GLUE_GET_PKT_IS_PAL(prSkb)) { - /* BOW */ -#if CFG_ENABLE_BT_OVER_WIFI && CFG_BOW_SEPARATE_DATA_PATH - if (prGlueInfo->rBowInfo.fgIsNetRegistered) { - prNetDev = prGlueInfo->rBowInfo.prDevHandler; - } -#else - prNetDev = prGlueInfo->prDevHandler; -#endif - } - else { - /* AIS */ - prNetDev = prGlueInfo->prDevHandler; - prGlueInfo->rNetDevStats.rx_bytes += prSkb->len; - prGlueInfo->rNetDevStats.rx_packets++; - - } - - prNetDev->last_rx = jiffies; - prSkb->protocol = eth_type_trans(prSkb, prNetDev); - prSkb->dev = prNetDev; - //DBGLOG_MEM32(RX, TRACE, (PUINT_32)prSkb->data, prSkb->len); - DBGLOG(RX, EVENT, ("kalRxIndicatePkts len = %d\n", prSkb->len)); - -#if CFG_BOW_TEST - DBGLOG(BOW, TRACE, ("Rx sk_buff->len: %d\n", prSkb->len)); - DBGLOG(BOW, TRACE, ("Rx sk_buff->data_len: %d\n", prSkb->data_len)); - DBGLOG(BOW, TRACE, ("Rx sk_buff->data:\n")); - - for(i = 0; i < prSkb->len && i < 64; i++) - { - LOG_FUNC("%02x ", prSkb->data[i]); - - if((i+1)%16 ==0) - { - LOG_FUNC("\n"); - } - } - - LOG_FUNC("\n"); -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) - if(!in_interrupt()){ - netif_rx_ni(prSkb); /* only in non-interrupt context */ - } - else { - netif_rx(prSkb); - } -#else - netif_rx(prSkb); -#endif - - wlanReturnPacket(prGlueInfo->prAdapter, NULL); - } - - return WLAN_STATUS_SUCCESS; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Called by driver to indicate event to upper layer, for example, the wpa -* supplicant or wireless tools. -* -* \param[in] pvAdapter Pointer to the adapter descriptor. -* \param[in] eStatus Indicated status. -* \param[in] pvBuf Indicated message buffer. -* \param[in] u4BufLen Indicated message buffer size. -* -* \return (none) -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalIndicateStatusAndComplete ( - IN P_GLUE_INFO_T prGlueInfo, - IN WLAN_STATUS eStatus, - IN PVOID pvBuf, - IN UINT_32 u4BufLen - ) -{ - UINT_32 bufLen; - P_PARAM_STATUS_INDICATION_T pStatus = (P_PARAM_STATUS_INDICATION_T) pvBuf; - P_PARAM_AUTH_EVENT_T pAuth = (P_PARAM_AUTH_EVENT_T) pStatus; - P_PARAM_PMKID_CANDIDATE_LIST_T pPmkid = - (P_PARAM_PMKID_CANDIDATE_LIST_T) (pStatus + 1); - PARAM_MAC_ADDRESS arBssid; - struct cfg80211_scan_request *prScanRequest = NULL; - GLUE_SPIN_LOCK_DECLARATION(); - - kalMemZero(arBssid, MAC_ADDR_LEN); - - ASSERT(prGlueInfo); - - switch (eStatus) { - case WLAN_STATUS_ROAM_OUT_FIND_BEST: - case WLAN_STATUS_MEDIA_CONNECT: - - prGlueInfo->eParamMediaStateIndicated = PARAM_MEDIA_STATE_CONNECTED; - - /* indicate assoc event */ - wlanQueryInformation(prGlueInfo->prAdapter, - wlanoidQueryBssid, - &arBssid[0], - sizeof(arBssid), - &bufLen); - wext_indicate_wext_event(prGlueInfo, SIOCGIWAP, arBssid, bufLen); - - /* switch netif on */ - netif_carrier_on(prGlueInfo->prDevHandler); - - do { - /* print message on console */ - PARAM_SSID_T ssid; - - wlanQueryInformation(prGlueInfo->prAdapter, - wlanoidQuerySsid, - &ssid, - sizeof(ssid), - &bufLen); - - ssid.aucSsid[(ssid.u4SsidLen >= PARAM_MAX_LEN_SSID) ? - (PARAM_MAX_LEN_SSID - 1) : ssid.u4SsidLen ] = '\0'; - DBGLOG(INIT, INFO, ("[wifi] %s netif_carrier_on [ssid:%s " MACSTR "]\n", - prGlueInfo->prDevHandler->name, - ssid.aucSsid, - MAC2STR(arBssid))); - } while(0); - - if(prGlueInfo->fgIsRegistered == TRUE) { - /* CFG80211 Indication */ - if(eStatus == WLAN_STATUS_MEDIA_CONNECT - && prGlueInfo->prDevHandler->ieee80211_ptr->sme_state == CFG80211_SME_CONNECTING) { - cfg80211_connect_result(prGlueInfo->prDevHandler, - arBssid, - prGlueInfo->aucReqIe, - prGlueInfo->u4ReqIeLength, - prGlueInfo->aucRspIe, - prGlueInfo->u4RspIeLength, - WLAN_STATUS_SUCCESS, - GFP_KERNEL); - } - else if(eStatus == WLAN_STATUS_ROAM_OUT_FIND_BEST - && prGlueInfo->prDevHandler->ieee80211_ptr->sme_state == CFG80211_SME_CONNECTED) { - struct ieee80211_channel *prChannel = NULL; - UINT_8 ucChannelNum = wlanGetChannelNumberByNetwork(prGlueInfo->prAdapter, NETWORK_TYPE_AIS_INDEX); - - if(ucChannelNum <= 14) { - prChannel = ieee80211_get_channel(priv_to_wiphy(prGlueInfo), ieee80211_channel_to_frequency(ucChannelNum, IEEE80211_BAND_2GHZ)); - } - else { - prChannel = ieee80211_get_channel(priv_to_wiphy(prGlueInfo), ieee80211_channel_to_frequency(ucChannelNum, IEEE80211_BAND_5GHZ)); - } - - cfg80211_roamed(prGlueInfo->prDevHandler, - prChannel, - arBssid, - prGlueInfo->aucReqIe, - prGlueInfo->u4ReqIeLength, - prGlueInfo->aucRspIe, - prGlueInfo->u4RspIeLength, - GFP_KERNEL); - } - } - - break; - - case WLAN_STATUS_MEDIA_DISCONNECT: - /* indicate disassoc event */ - wext_indicate_wext_event(prGlueInfo, SIOCGIWAP, NULL, 0); - /* For CR 90 and CR99, While supplicant do reassociate, driver will do netif_carrier_off first, - after associated success, at joinComplete(), do netif_carier_on, - but for unknown reason, the supplicant 1x pkt will not called the driver - hardStartXmit, for template workaround these bugs, add this compiling flag - */ - /* switch netif off */ - -#if 1 /* CONSOLE_MESSAGE */ - DBGLOG(INIT, INFO, ("[wifi] %s netif_carrier_off\n", prGlueInfo->prDevHandler->name)); -#endif - - netif_carrier_off(prGlueInfo->prDevHandler); - - if(prGlueInfo->fgIsRegistered == TRUE - && prGlueInfo->prDevHandler->ieee80211_ptr->sme_state == CFG80211_SME_CONNECTED) { - /* CFG80211 Indication */ - cfg80211_disconnected(prGlueInfo->prDevHandler, 0, NULL, 0, GFP_KERNEL); - } - - prGlueInfo->eParamMediaStateIndicated = PARAM_MEDIA_STATE_DISCONNECTED; - - break; - - case WLAN_STATUS_SCAN_COMPLETE: - /* indicate scan complete event */ - wext_indicate_wext_event(prGlueInfo, SIOCGIWSCAN, NULL, 0); - - /* 1. reset first for newly incoming request */ - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_NET_DEV); - if(prGlueInfo->prScanRequest != NULL) { - prScanRequest = prGlueInfo->prScanRequest; - prGlueInfo->prScanRequest = NULL; - } - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_NET_DEV); - - /* 2. then CFG80211 Indication */ - if(prScanRequest != NULL) { - cfg80211_scan_done(prScanRequest, FALSE); - } - break; - - #if 0 - case WLAN_STATUS_MSDU_OK: - if (netif_running(prGlueInfo->prDevHandler)) { - netif_wake_queue(prGlueInfo->prDevHandler); - } - break; - #endif - - case WLAN_STATUS_MEDIA_SPECIFIC_INDICATION: - if (pStatus) { - switch (pStatus->eStatusType) { - case ENUM_STATUS_TYPE_AUTHENTICATION: - /* - printk(KERN_NOTICE "ENUM_STATUS_TYPE_AUTHENTICATION: L(%ld) [" MACSTR "] F:%lx\n", - pAuth->Request[0].Length, - MAC2STR(pAuth->Request[0].Bssid), - pAuth->Request[0].Flags); - */ - /* indicate (UC/GC) MIC ERROR event only */ - if ((pAuth->arRequest[0].u4Flags == - PARAM_AUTH_REQUEST_PAIRWISE_ERROR) || - (pAuth->arRequest[0].u4Flags == - PARAM_AUTH_REQUEST_GROUP_ERROR)) { - cfg80211_michael_mic_failure(prGlueInfo->prDevHandler, NULL, - (pAuth->arRequest[0].u4Flags == PARAM_AUTH_REQUEST_PAIRWISE_ERROR) ? NL80211_KEYTYPE_PAIRWISE : NL80211_KEYTYPE_GROUP, - 0, NULL, GFP_KERNEL); - wext_indicate_wext_event(prGlueInfo, - IWEVMICHAELMICFAILURE, - (unsigned char *)&pAuth->arRequest[0], - pAuth->arRequest[0].u4Length); - } - break; - - case ENUM_STATUS_TYPE_CANDIDATE_LIST: - /* - printk(KERN_NOTICE "Param_StatusType_PMKID_CandidateList: Ver(%ld) Num(%ld)\n", - pPmkid->u2Version, - pPmkid->u4NumCandidates); - if (pPmkid->u4NumCandidates > 0) { - printk(KERN_NOTICE "candidate[" MACSTR "] preAuth Flag:%lx\n", - MAC2STR(pPmkid->arCandidateList[0].rBSSID), - pPmkid->arCandidateList[0].fgFlags); - } - */ - { - UINT_32 i = 0; - - P_PARAM_PMKID_CANDIDATE_T prPmkidCand = (P_PARAM_PMKID_CANDIDATE_T)&pPmkid->arCandidateList[0]; - - for (i=0; iu4NumCandidates; i++) { - wext_indicate_wext_event(prGlueInfo, - IWEVPMKIDCAND, - (unsigned char *)&pPmkid->arCandidateList[i], - pPmkid->u4NumCandidates); - prPmkidCand += sizeof(PARAM_PMKID_CANDIDATE_T); - } - } - break; - - default: - /* case ENUM_STATUS_TYPE_MEDIA_STREAM_MODE */ - /* - printk(KERN_NOTICE "unknown media specific indication type:%x\n", - pStatus->StatusType); - */ - break; - } - } - else { - /* - printk(KERN_WARNING "media specific indication buffer NULL\n"); - */ - } - break; - -#if CFG_SUPPORT_BCM && CFG_SUPPORT_BCM_BWCS - case WLAN_STATUS_BWCS_UPDATE: - { - wext_indicate_wext_event(prGlueInfo, IWEVCUSTOM, pvBuf, sizeof(PTA_IPC_T)); - } - - break; - -#endif - - default: - /* - printk(KERN_WARNING "unknown indication:%lx\n", eStatus); - */ - break; - } -} /* kalIndicateStatusAndComplete */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to update the (re)association request -* information to the structure used to query and set -* OID_802_11_ASSOCIATION_INFORMATION. -* -* \param[in] prGlueInfo Pointer to the Glue structure. -* \param[in] pucFrameBody Pointer to the frame body of the last (Re)Association -* Request frame from the AP. -* \param[in] u4FrameBodyLen The length of the frame body of the last -* (Re)Association Request frame. -* \param[in] fgReassocRequest TRUE, if it is a Reassociation Request frame. -* -* \return (none) -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalUpdateReAssocReqInfo ( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucFrameBody, - IN UINT_32 u4FrameBodyLen, - IN BOOLEAN fgReassocRequest - ) -{ - PUINT_8 cp; - - ASSERT(prGlueInfo); - - /* reset */ - prGlueInfo->u4ReqIeLength = 0; - - if (fgReassocRequest) { - if (u4FrameBodyLen < 15) { - /* - printk(KERN_WARNING "frameBodyLen too short:%ld\n", frameBodyLen); - */ - return; - } - } - else { - if (u4FrameBodyLen < 9) { - /* - printk(KERN_WARNING "frameBodyLen too short:%ld\n", frameBodyLen); - */ - return; - } - } - - cp = pucFrameBody; - - if (fgReassocRequest) { - /* Capability information field 2 */ - /* Listen interval field 2*/ - /* Current AP address 6 */ - cp += 10; - u4FrameBodyLen -= 10; - } - else { - /* Capability information field 2 */ - /* Listen interval field 2*/ - cp += 4; - u4FrameBodyLen -= 4; - } - - wext_indicate_wext_event(prGlueInfo, IWEVASSOCREQIE, cp, u4FrameBodyLen); - - if(u4FrameBodyLen <= CFG_CFG80211_IE_BUF_LEN) { - prGlueInfo->u4ReqIeLength = u4FrameBodyLen; - kalMemCopy(prGlueInfo->aucReqIe, cp, u4FrameBodyLen); - } - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This routine is called to update the (re)association -* response information to the structure used to reply with -* cfg80211_connect_result -* -* @param prGlueInfo Pointer to adapter descriptor -* @param pucFrameBody Pointer to the frame body of the last (Re)Association -* Response frame from the AP -* @param u4FrameBodyLen The length of the frame body of the last -* (Re)Association Response frame -* -* @return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalUpdateReAssocRspInfo ( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucFrameBody, - IN UINT_32 u4FrameBodyLen - ) -{ - UINT_32 u4IEOffset = 6; /* cap_info, status_code & assoc_id */ - UINT_32 u4IELength = u4FrameBodyLen - u4IEOffset; - - ASSERT(prGlueInfo); - - /* reset */ - prGlueInfo->u4RspIeLength = 0; - - if(u4IELength <= CFG_CFG80211_IE_BUF_LEN) { - prGlueInfo->u4RspIeLength = u4IELength; - kalMemCopy(prGlueInfo->aucRspIe, pucFrameBody + u4IEOffset, u4IELength); - } - -} /* kalUpdateReAssocRspInfo */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Notify OS with SendComplete event of the specific packet. Linux should -* free packets here. -* -* \param[in] prGlueInfo Pointer of GLUE Data Structure -* \param[in] pvPacket Pointer of Packet Handle -* \param[in] status Status Code for OS upper layer -* -* \return - -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalSendCompleteAndAwakeQueue ( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID pvPacket - ) -{ - - struct net_device *prDev = NULL; - struct sk_buff *prSkb = NULL; - UINT_16 u2QueueIdx = 0; - UINT_8 ucNetworkType = 0; - BOOLEAN fgIsValidDevice = TRUE; - - - ASSERT(pvPacket); - ASSERT(prGlueInfo->i4TxPendingFrameNum); - - prSkb = (struct sk_buff *) pvPacket; -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 26) - u2QueueIdx = skb_get_queue_mapping(prSkb); -#endif - ASSERT(u2QueueIdx < CFG_MAX_TXQ_NUM); - - if (GLUE_GET_PKT_IS_PAL(prSkb)) { - ucNetworkType = NETWORK_TYPE_BOW_INDEX; - } else if (GLUE_GET_PKT_IS_P2P(prSkb)) { - ucNetworkType = NETWORK_TYPE_P2P_INDEX; - -#if CFG_ENABLE_WIFI_DIRECT - /* in case packet was sent after P2P device is unregistered */ - if(prGlueInfo->prAdapter->fgIsP2PRegistered == FALSE) { - fgIsValidDevice = FALSE; - } -#endif - } else { - ucNetworkType = NETWORK_TYPE_AIS_INDEX; - } - - GLUE_DEC_REF_CNT(prGlueInfo->i4TxPendingFrameNum); - GLUE_DEC_REF_CNT(prGlueInfo->ai4TxPendingFrameNumPerQueue[ucNetworkType][u2QueueIdx]); - prDev = prSkb->dev; - - ASSERT(prDev); - - if(fgIsValidDevice == TRUE) { -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 26) - if (netif_subqueue_stopped(prDev, prSkb) && - prGlueInfo->ai4TxPendingFrameNumPerQueue[ucNetworkType][u2QueueIdx] <= CFG_TX_START_NETIF_PER_QUEUE_THRESHOLD) { - netif_wake_subqueue(prDev, u2QueueIdx); - } -#else - if (prGlueInfo->i4TxPendingFrameNum < CFG_TX_STOP_NETIF_QUEUE_THRESHOLD) { - netif_wake_queue(prGlueInfo->prDevHandler); - } -#endif - } - - - dev_kfree_skb((struct sk_buff *) pvPacket); - - DBGLOG(TX, EVENT, ("----- pending frame %d -----\n", prGlueInfo->i4TxPendingFrameNum)); - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Copy Mac Address setting from registry. It's All Zeros in Linux. -* -* \param[in] prAdapter Pointer to the Adapter structure -* -* \param[out] paucMacAddr Pointer to the Mac Address buffer -* -* \retval WLAN_STATUS_SUCCESS -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalQueryRegistryMacAddr ( - IN P_GLUE_INFO_T prGlueInfo, - OUT PUINT_8 paucMacAddr - ) -{ - UINT_8 aucZeroMac[MAC_ADDR_LEN] = {0,0,0,0,0,0} - DEBUGFUNC("kalQueryRegistryMacAddr"); - - ASSERT(prGlueInfo); - ASSERT(paucMacAddr); - - kalMemCopy((PVOID) paucMacAddr, (PVOID)aucZeroMac, MAC_ADDR_LEN); - - return; -} /* end of kalQueryRegistryMacAddr() */ - -#if CFG_SUPPORT_EXT_CONFIG -/*----------------------------------------------------------------------------*/ -/*! -* \brief Read external configuration, ex. NVRAM or file -* -* \param[in] prGlueInfo Pointer of GLUE Data Structure -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -kalReadExtCfg ( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - /* External data is given from user space by ioctl or /proc, not read by - driver. - */ - if (0 != prGlueInfo->u4ExtCfgLength) { - DBGLOG(INIT, TRACE, ("Read external configuration data -- OK\n")); - } - else { - DBGLOG(INIT, TRACE, ("Read external configuration data -- fail\n")); - } - - return prGlueInfo->u4ExtCfgLength; -} -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This inline function is to extract some packet information, including -* user priority, packet length, destination address, 802.1x and BT over Wi-Fi -* or not. -* -* @param prGlueInfo Pointer to the glue structure -* @param prNdisPacket Packet descriptor -* @param pucPriorityParam User priority -* @param pu4PacketLen Packet length -* @param pucEthDestAddr Destination address -* @param pfgIs1X 802.1x packet or not -* @param pfgIsPAL BT over Wi-Fi packet or not -* -* @retval TRUE Success to extract information -* @retval FALSE Fail to extract correct information -*/ -/*----------------------------------------------------------------------------*/ - -BOOL -kalQoSFrameClassifierAndPacketInfo ( - IN P_GLUE_INFO_T prGlueInfo, - IN P_NATIVE_PACKET prPacket, - OUT PUINT_8 pucPriorityParam, - OUT PUINT_32 pu4PacketLen, - OUT PUINT_8 pucEthDestAddr, - OUT PBOOLEAN pfgIs1X, - OUT PBOOLEAN pfgIsPAL, - OUT PUINT_8 pucNetworkType - ) -{ - - UINT_32 u4PacketLen; - - - UINT_8 ucUserPriority = USER_PRIORITY_DEFAULT; /* Default */ - UINT_16 u2EtherTypeLen; - struct sk_buff *prSkb = (struct sk_buff *) prPacket; - PUINT_8 aucLookAheadBuf = NULL; - - DEBUGFUNC("kalQoSFrameClassifierAndPacketInfo"); - - u4PacketLen = prSkb->len; - - if (u4PacketLen < ETH_HLEN) { - DBGLOG(INIT, WARN, ("Invalid Ether packet length: %d\n", u4PacketLen)); - return FALSE; - } - - aucLookAheadBuf = prSkb->data; - - *pfgIs1X = FALSE; - *pfgIsPAL = FALSE; - //4 <3> Obtain the User Priority for WMM - u2EtherTypeLen = (aucLookAheadBuf[ETH_TYPE_LEN_OFFSET] << 8) | (aucLookAheadBuf[ETH_TYPE_LEN_OFFSET + 1]); - - if ((u2EtherTypeLen == ETH_P_IP) && - (u4PacketLen >= LOOK_AHEAD_LEN)) { - PUINT_8 pucIpHdr = &aucLookAheadBuf[ETH_HLEN]; - UINT_8 ucIpVersion; - - ucIpVersion = (pucIpHdr[0] & IPVH_VERSION_MASK) >> IPVH_VERSION_OFFSET; - //printk ("ip version %x\n", ucIpVersion); - if (ucIpVersion == IPVERSION) { - UINT_8 ucIpTos; - /* Get the DSCP value from the header of IP packet. */ - ucIpTos = pucIpHdr[1]; - ucUserPriority = ((ucIpTos & IPTOS_PREC_MASK) >> IPTOS_PREC_OFFSET); - } - - /* TODO(Kevin): Add TSPEC classifier here */ - } - else if (u2EtherTypeLen == ETH_P_1X) { /* For Port Control */ - //DBGLOG(REQ, TRACE, ("Tx 1x\n")); - *pfgIs1X = TRUE; - } - else if (u2EtherTypeLen == ETH_P_PRE_1X) { /* For Pre 1x pkt */ - //DBGLOG(REQ, TRACE, ("Tx Pre-1x\n")); - *pfgIs1X = TRUE; - } -#if CFG_SUPPORT_WAPI - else if (u2EtherTypeLen == ETH_WPI_1X) { - *pfgIs1X = TRUE; - } -#endif - else if (u2EtherTypeLen <= 1500) { /* 802.3 Frame */ - UINT_8 ucDSAP, ucSSAP, ucControl; - UINT_8 aucOUI[3]; - - ucDSAP = *(PUINT_8) &aucLookAheadBuf[ETH_LLC_OFFSET]; - ucSSAP = *(PUINT_8) &aucLookAheadBuf[ETH_LLC_OFFSET + 1]; - ucControl = *(PUINT_8) &aucLookAheadBuf[ETH_LLC_OFFSET + 2]; - - aucOUI[0] = *(PUINT_8) &aucLookAheadBuf[ETH_SNAP_OFFSET]; - aucOUI[1] = *(PUINT_8) &aucLookAheadBuf[ETH_SNAP_OFFSET + 1]; - aucOUI[2] = *(PUINT_8) &aucLookAheadBuf[ETH_SNAP_OFFSET + 2]; - - if(ucDSAP == ETH_LLC_DSAP_SNAP && - ucSSAP == ETH_LLC_SSAP_SNAP && - ucControl == ETH_LLC_CONTROL_UNNUMBERED_INFORMATION && - aucOUI[0] == ETH_SNAP_BT_SIG_OUI_0 && - aucOUI[1] == ETH_SNAP_BT_SIG_OUI_1 && - aucOUI[2] == ETH_SNAP_BT_SIG_OUI_2) { - - UINT_16 tmp = ((aucLookAheadBuf[ETH_SNAP_OFFSET + 3] << 8) | aucLookAheadBuf[ETH_SNAP_OFFSET + 4]); - - *pfgIsPAL = TRUE; - ucUserPriority = (UINT_8)prSkb->priority; - - if (tmp == BOW_PROTOCOL_ID_SECURITY_FRAME) { - *pfgIs1X = TRUE; - } - } - } - - //4 <4> Return the value of Priority Parameter. - *pucPriorityParam = ucUserPriority; - - //4 <5> Retrieve Packet Information - DA - /* Packet Length/ Destination Address */ - *pu4PacketLen = u4PacketLen; - - kalMemCopy(pucEthDestAddr, aucLookAheadBuf, PARAM_MAC_ADDR_LEN); - - - //<6> Network type -#if CFG_ENABLE_BT_OVER_WIFI - if(*pfgIsPAL == TRUE) { - *pucNetworkType = NETWORK_TYPE_BOW_INDEX; - } - else -#endif - { -#if CFG_ENABLE_WIFI_DIRECT - if(prGlueInfo->prAdapter->fgIsP2PRegistered && GLUE_GET_PKT_IS_P2P(prPacket)) { - *pucNetworkType = NETWORK_TYPE_P2P_INDEX; - } - else -#endif - { - *pucNetworkType = NETWORK_TYPE_AIS_INDEX; - } - } - return TRUE; -} /* end of kalQoSFrameClassifier() */ - -VOID -kalOidComplete ( - IN P_GLUE_INFO_T prGlueInfo, - IN BOOLEAN fgSetQuery, - IN UINT_32 u4SetQueryInfoLen, - IN WLAN_STATUS rOidStatus - ) -{ - - ASSERT(prGlueInfo); - /* remove timeout check timer */ - wlanoidClearTimeoutCheck(prGlueInfo->prAdapter); - - //if (prGlueInfo->u4TimeoutFlag != 1) { - prGlueInfo->rPendStatus = rOidStatus; - complete(&prGlueInfo->rPendComp); - prGlueInfo->u4OidCompleteFlag = 1; - //} - /* else let it timeout on kalIoctl entry */ -} - -VOID -kalOidClearance( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - //if (prGlueInfo->u4TimeoutFlag != 1) { - //clear_bit(GLUE_FLAG_OID_BIT, &prGlueInfo->u4Flag); - if (prGlueInfo->u4OidCompleteFlag != 1) { - complete(&prGlueInfo->rPendComp); - } - //} -} - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is used to transfer linux ioctl to OID, and we -* need to specify the behavior of the OID by ourself -* -* @param prGlueInfo Pointer to the glue structure -* @param pvInfoBuf Data buffer -* @param u4InfoBufLen Data buffer length -* @param fgRead Is this a read OID -* @param fgWaitResp does this OID need to wait for values -* @param fgCmd does this OID compose command packet -* @param pu4QryInfoLen The data length of the return values -* -* @retval TRUE Success to extract information -* @retval FALSE Fail to extract correct information -*/ -/*----------------------------------------------------------------------------*/ - -// todo: enqueue the i/o requests for multiple processes access -// -// currently, return -1 -// - -//static GL_IO_REQ_T OidEntry; - -WLAN_STATUS -kalIoctl (IN P_GLUE_INFO_T prGlueInfo, - IN PFN_OID_HANDLER_FUNC pfnOidHandler, - IN PVOID pvInfoBuf, - IN UINT_32 u4InfoBufLen, - IN BOOL fgRead, - IN BOOL fgWaitResp, - IN BOOL fgCmd, - IN BOOL fgIsP2pOid, - OUT PUINT_32 pu4QryInfoLen - ) -{ - P_GL_IO_REQ_T prIoReq = NULL; - WLAN_STATUS ret = WLAN_STATUS_SUCCESS; - - //GLUE_SPIN_LOCK_DECLARATION(); - ASSERT(prGlueInfo); - - /* <1> Check if driver is halt */ - - //if (prGlueInfo->u4Flag & GLUE_FLAG_HALT) { - // return WLAN_STATUS_ADAPTER_NOT_READY; - //} - - if (down_interruptible(&g_halt_sem)) { - return WLAN_STATUS_FAILURE; - } - - - if (g_u4HaltFlag) { - up(&g_halt_sem); - return WLAN_STATUS_ADAPTER_NOT_READY; - } - - if(down_interruptible(&prGlueInfo->ioctl_sem)) { - up(&g_halt_sem); - return WLAN_STATUS_FAILURE; - } - - /* <2> TODO: thread-safe */ - - /* <3> point to the OidEntry of Glue layer */ - - prIoReq = &(prGlueInfo->OidEntry); - - ASSERT(prIoReq); - - /* <4> Compose the I/O request */ - prIoReq->prAdapter = prGlueInfo->prAdapter; - prIoReq->pfnOidHandler = pfnOidHandler; - prIoReq->pvInfoBuf = pvInfoBuf; - prIoReq->u4InfoBufLen = u4InfoBufLen; - prIoReq->pu4QryInfoLen = pu4QryInfoLen; - prIoReq->fgRead = fgRead; - prIoReq->fgWaitResp= fgWaitResp; - prIoReq->rStatus = WLAN_STATUS_FAILURE; -#if CFG_ENABLE_WIFI_DIRECT - prIoReq->fgIsP2pOid = fgIsP2pOid; -#endif - - /* <5> Reset the status of pending OID */ - prGlueInfo->rPendStatus = WLAN_STATUS_FAILURE; - //prGlueInfo->u4TimeoutFlag = 0; - prGlueInfo->u4OidCompleteFlag = 0; - - /* <6> Check if we use the command queue */ - prIoReq->u4Flag = fgCmd; - - /* <7> schedule the OID bit */ - set_bit(GLUE_FLAG_OID_BIT, &prGlueInfo->u4Flag); - - /* <8> Wake up tx thread to handle kick start the I/O request */ - wake_up_interruptible(&prGlueInfo->waitq); - - /* <9> Block and wait for event or timeout, current the timeout is 5 secs */ - //if (wait_for_completion_interruptible_timeout(&prGlueInfo->rPendComp, 5 * KAL_HZ)) { - //if (!wait_for_completion_interruptible(&prGlueInfo->rPendComp)) { - wait_for_completion(&prGlueInfo->rPendComp); { - /* Case 1: No timeout. */ - /* if return WLAN_STATUS_PENDING, the status of cmd is stored in prGlueInfo */ - if (prIoReq->rStatus == WLAN_STATUS_PENDING) { - ret = prGlueInfo->rPendStatus; - } else { - ret = prIoReq->rStatus; - } - } - #if 0 - else { - /* Case 2: timeout */ - /* clear pending OID's cmd in CMD queue */ - if (fgCmd) { - prGlueInfo->u4TimeoutFlag = 1; - wlanReleasePendingOid(prGlueInfo->prAdapter, 0); - } - ret = WLAN_STATUS_FAILURE; - } - #endif - - up(&prGlueInfo->ioctl_sem); - up(&g_halt_sem); - - return ret; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to clear all pending security frames -* -* \param prGlueInfo Pointer of GLUE Data Structure -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalClearSecurityFrames( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - P_QUE_T prCmdQue; - QUE_T rTempCmdQue; - P_QUE_T prTempCmdQue = &rTempCmdQue; - P_QUE_ENTRY_T prQueueEntry = (P_QUE_ENTRY_T)NULL; - - P_CMD_INFO_T prCmdInfo = (P_CMD_INFO_T)NULL; - GLUE_SPIN_LOCK_DECLARATION(); - - ASSERT(prGlueInfo); - - // Clear pending security frames in prGlueInfo->rCmdQueue - prCmdQue = &prGlueInfo->rCmdQueue; - - - - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_CMD_QUE); - QUEUE_MOVE_ALL(prTempCmdQue, prCmdQue); - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - while (prQueueEntry) { - prCmdInfo = (P_CMD_INFO_T)prQueueEntry; - - if (prCmdInfo->eCmdType == COMMAND_TYPE_SECURITY_FRAME) { - prCmdInfo->pfCmdTimeoutHandler(prGlueInfo->prAdapter, prCmdInfo); - cmdBufFreeCmdInfo(prGlueInfo->prAdapter, prCmdInfo); - } - else { - QUEUE_INSERT_TAIL(prCmdQue, prQueueEntry); - } - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - } - - QUEUE_CONCATENATE_QUEUES(prCmdQue, prTempCmdQue); - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_CMD_QUE); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to clear pending security frames -* belongs to dedicated network type -* -* \param prGlueInfo Pointer of GLUE Data Structure -* \param eNetworkTypeIdx Network Type Index -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalClearSecurityFramesByNetType( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ) -{ - P_QUE_T prCmdQue; - QUE_T rTempCmdQue; - P_QUE_T prTempCmdQue = &rTempCmdQue; - P_QUE_ENTRY_T prQueueEntry = (P_QUE_ENTRY_T)NULL; - - P_CMD_INFO_T prCmdInfo = (P_CMD_INFO_T)NULL; - GLUE_SPIN_LOCK_DECLARATION(); - - - ASSERT(prGlueInfo); - - // Clear pending security frames in prGlueInfo->rCmdQueue - prCmdQue = &prGlueInfo->rCmdQueue; - - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_CMD_QUE); - QUEUE_MOVE_ALL(prTempCmdQue, prCmdQue); - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - while (prQueueEntry) { - prCmdInfo = (P_CMD_INFO_T)prQueueEntry; - - if (prCmdInfo->eCmdType == COMMAND_TYPE_SECURITY_FRAME && - prCmdInfo->eNetworkType == eNetworkTypeIdx) { - prCmdInfo->pfCmdTimeoutHandler(prGlueInfo->prAdapter, prCmdInfo); - cmdBufFreeCmdInfo(prGlueInfo->prAdapter, prCmdInfo); - } - else { - QUEUE_INSERT_TAIL(prCmdQue, prQueueEntry); - } - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - } - - QUEUE_CONCATENATE_QUEUES(prCmdQue, prTempCmdQue); - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_CMD_QUE); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to clear all pending management frames -* -* \param prGlueInfo Pointer of GLUE Data Structure -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalClearMgmtFrames( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - P_QUE_T prCmdQue; - QUE_T rTempCmdQue; - P_QUE_T prTempCmdQue = &rTempCmdQue; - P_QUE_ENTRY_T prQueueEntry = (P_QUE_ENTRY_T)NULL; - P_CMD_INFO_T prCmdInfo = (P_CMD_INFO_T)NULL; - - GLUE_SPIN_LOCK_DECLARATION(); - - ASSERT(prGlueInfo); - - // Clear pending management frames in prGlueInfo->rCmdQueue - prCmdQue = &prGlueInfo->rCmdQueue; - - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_CMD_QUE); - QUEUE_MOVE_ALL(prTempCmdQue, prCmdQue); - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - while (prQueueEntry) { - prCmdInfo = (P_CMD_INFO_T)prQueueEntry; - - if (prCmdInfo->eCmdType == COMMAND_TYPE_MANAGEMENT_FRAME) { - wlanReleaseCommand(prGlueInfo->prAdapter, prCmdInfo); - cmdBufFreeCmdInfo(prGlueInfo->prAdapter, prCmdInfo); - } - else { - QUEUE_INSERT_TAIL(prCmdQue, prQueueEntry); - } - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - } - - QUEUE_CONCATENATE_QUEUES(prCmdQue, prTempCmdQue); - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_CMD_QUE); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to clear all pending management frames -* belongs to dedicated network type -* \param prGlueInfo Pointer of GLUE Data Structure -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalClearMgmtFramesByNetType ( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ) -{ - P_QUE_T prCmdQue; - QUE_T rTempCmdQue; - P_QUE_T prTempCmdQue = &rTempCmdQue; - P_QUE_ENTRY_T prQueueEntry = (P_QUE_ENTRY_T)NULL; - P_CMD_INFO_T prCmdInfo = (P_CMD_INFO_T)NULL; - - GLUE_SPIN_LOCK_DECLARATION(); - - ASSERT(prGlueInfo); - - // Clear pending management frames in prGlueInfo->rCmdQueue - prCmdQue = &prGlueInfo->rCmdQueue; - - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_CMD_QUE); - QUEUE_MOVE_ALL(prTempCmdQue, prCmdQue); - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - while (prQueueEntry) { - prCmdInfo = (P_CMD_INFO_T)prQueueEntry; - - if (prCmdInfo->eCmdType == COMMAND_TYPE_MANAGEMENT_FRAME && - prCmdInfo->eNetworkType == eNetworkTypeIdx) { - wlanReleaseCommand(prGlueInfo->prAdapter, prCmdInfo); - cmdBufFreeCmdInfo(prGlueInfo->prAdapter, prCmdInfo); - } - else { - QUEUE_INSERT_TAIL(prCmdQue, prQueueEntry); - } - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - } - - QUEUE_CONCATENATE_QUEUES(prCmdQue, prTempCmdQue); - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_CMD_QUE); -} /* kalClearMgmtFramesByNetType */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* @brief This function is a kernel thread function for handling command packets -* Tx requests and interrupt events -* -* @param data data pointer to private data of tx_thread -* -* @retval If the function succeeds, the return value is 0. -* Otherwise, an error code is returned. -* -*/ -/*----------------------------------------------------------------------------*/ - -int tx_thread(void *data) -{ - struct net_device *dev = data; - P_GLUE_INFO_T prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(dev)); - - P_QUE_ENTRY_T prQueueEntry = NULL; - P_GL_IO_REQ_T prIoReq = NULL; - P_QUE_T prTxQueue = NULL; - P_QUE_T prCmdQue = NULL; - - int ret = 0; - - BOOLEAN fgNeedHwAccess = FALSE; - - struct sk_buff *prSkb = NULL; - - /* for spin lock acquire and release */ - GLUE_SPIN_LOCK_DECLARATION(); - - prTxQueue = &prGlueInfo->rTxQueue; - prCmdQue = &prGlueInfo->rCmdQueue; - - current->flags |= PF_NOFREEZE; - - DBGLOG(INIT, INFO, ("tx_thread starts running... \n")); - - while (TRUE) { - -#if CFG_ENABLE_WIFI_DIRECT - /*run p2p multicast list work. */ - if (test_and_clear_bit(GLUE_FLAG_SUB_MOD_MULTICAST_BIT, &prGlueInfo->u4Flag)) { - p2pSetMulticastListWorkQueueWrapper(prGlueInfo); - } -#endif - - if (prGlueInfo->u4Flag & GLUE_FLAG_HALT) { - DBGLOG(INIT, INFO, ("tx_thread should stop now...\n")); - break; - } - - /* - * sleep on waitqueue if no events occurred. Event contain (1) GLUE_FLAG_INT - * (2) GLUE_FLAG_OID (3) GLUE_FLAG_TXREQ (4) GLUE_FLAG_HALT - * - */ - - ret = wait_event_interruptible(prGlueInfo->waitq, - (prGlueInfo->u4Flag != 0)); - -#if CFG_DBG_GPIO_PINS - /* TX thread Wake up */ - mtk_wcn_stp_debug_gpio_assert(IDX_TX_THREAD, DBG_TIE_LOW); -#endif -#if CFG_ENABLE_WIFI_DIRECT - /*run p2p multicast list work. */ - if (test_and_clear_bit(GLUE_FLAG_SUB_MOD_MULTICAST_BIT, &prGlueInfo->u4Flag)) { - p2pSetMulticastListWorkQueueWrapper(prGlueInfo); - } - - if (test_and_clear_bit(GLUE_FLAG_FRAME_FILTER_BIT, &prGlueInfo->u4Flag)) { - p2pFuncUpdateMgmtFrameRegister(prGlueInfo->prAdapter, prGlueInfo->prP2PInfo->u4OsMgmtFrameFilter); - } - - -#endif - if (prGlueInfo->u4Flag & GLUE_FLAG_HALT) { - DBGLOG(INIT, INFO, ("<1>tx_thread should stop now...\n")); - break; - } - - fgNeedHwAccess = FALSE; - - /* Handle Interrupt */ - if (test_and_clear_bit(GLUE_FLAG_INT_BIT, &prGlueInfo->u4Flag)) { - - if (fgNeedHwAccess == FALSE) { - fgNeedHwAccess = TRUE; - - wlanAcquirePowerControl(prGlueInfo->prAdapter); - } - - /* the Wi-Fi interrupt is already disabled in mmc thread, - so we set the flag only to enable the interrupt later */ - prGlueInfo->prAdapter->fgIsIntEnable = FALSE; - //wlanISR(prGlueInfo->prAdapter, TRUE); - - if (prGlueInfo->u4Flag & GLUE_FLAG_HALT) { - /* Should stop now... skip pending interrupt */ - DBGLOG(INIT, INFO, ("ignore pending interrupt\n")); - } - else { - - wlanIST(prGlueInfo->prAdapter); - } - } - - /* transfer ioctl to OID request */ - #if 0 - if (prGlueInfo->u4Flag & GLUE_FLAG_HALT) { - printk(KERN_INFO DRV_NAME"<2>tx_thread should stop now...\n"); - break; - } - #endif - - do { - if (test_and_clear_bit(GLUE_FLAG_OID_BIT, &prGlueInfo->u4Flag)) { - /* get current prIoReq */ - prIoReq = &(prGlueInfo->OidEntry); -#if CFG_ENABLE_WIFI_DIRECT - if(prGlueInfo->prAdapter->fgIsP2PRegistered == FALSE - && prIoReq->fgIsP2pOid == TRUE) { - /* if this Oid belongs to p2p and p2p module is removed - * do nothing, - */ - } - else -#endif - { - if (FALSE == prIoReq->fgRead) { - prIoReq->rStatus = wlanSetInformation( - prIoReq->prAdapter, - prIoReq->pfnOidHandler, - prIoReq->pvInfoBuf, - prIoReq->u4InfoBufLen, - prIoReq->pu4QryInfoLen); - } else { - prIoReq->rStatus = wlanQueryInformation( - prIoReq->prAdapter, - prIoReq->pfnOidHandler, - prIoReq->pvInfoBuf, - prIoReq->u4InfoBufLen, - prIoReq->pu4QryInfoLen); - } - - if (prIoReq->rStatus != WLAN_STATUS_PENDING) { - complete(&prGlueInfo->rPendComp); - } - else { - wlanoidTimeoutCheck(prGlueInfo->prAdapter, prIoReq->pfnOidHandler); - } - } - } - - } while (FALSE); - - - /* - * - * if TX request, clear the TXREQ flag. TXREQ set by kalSetEvent/GlueSetEvent - * indicates the following requests occur - * - */ - #if 0 - if (prGlueInfo->u4Flag & GLUE_FLAG_HALT) { - printk(KERN_INFO DRV_NAME"<3>tx_thread should stop now...\n"); - break; - } - #endif - - if (test_and_clear_bit(GLUE_FLAG_TXREQ_BIT, &prGlueInfo->u4Flag)) - { - - /* Process Mailbox Messages */ - wlanProcessMboxMessage(prGlueInfo->prAdapter); - - /* Process CMD request */ - do { - if (prCmdQue->u4NumElem > 0) { - if (fgNeedHwAccess == FALSE) { - fgNeedHwAccess = TRUE; - - wlanAcquirePowerControl(prGlueInfo->prAdapter); - } - wlanProcessCommandQueue(prGlueInfo->prAdapter, prCmdQue); - } - } while (FALSE); - - /* Handle Packet Tx */ - { - while (QUEUE_IS_NOT_EMPTY(prTxQueue)) { - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_TX_QUE); - QUEUE_REMOVE_HEAD(prTxQueue, prQueueEntry, P_QUE_ENTRY_T); - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_TX_QUE); - - ASSERT(prQueueEntry); - if (NULL == prQueueEntry) { - break; - } - - prSkb = (struct sk_buff *) GLUE_GET_PKT_DESCRIPTOR(prQueueEntry); - ASSERT(prSkb); - if (NULL == prSkb) { - DBGLOG(INIT, WARN, ("prSkb == NULL in tx\n")); - continue; - } - - if(wlanEnqueueTxPacket(prGlueInfo->prAdapter, - (P_NATIVE_PACKET)prSkb) == WLAN_STATUS_RESOURCES) { - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_TX_QUE); - QUEUE_INSERT_HEAD(prTxQueue, prQueueEntry); - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_TX_QUE); - - break; - } - } - - if (wlanGetTxPendingFrameCount(prGlueInfo->prAdapter) > 0) { - wlanTxPendingPackets(prGlueInfo->prAdapter, &fgNeedHwAccess); - } - } - - } - - /* Process RX, In linux, we don't need to free sk_buff by ourself */ - - /* In linux, we don't need to free sk_buff by ourself */ - - /* In linux, we don't do reset */ - if (fgNeedHwAccess == TRUE) { - wlanReleasePowerControl(prGlueInfo->prAdapter); - } - - /* handle cnmTimer time out */ - if (test_and_clear_bit(GLUE_FLAG_TIMEOUT_BIT, &prGlueInfo->u4Flag)) { - wlanTimerTimeoutCheck(prGlueInfo->prAdapter); - } - - #if CFG_DBG_GPIO_PINS - /* TX thread go to sleep */ - if (!prGlueInfo->u4Flag){ - mtk_wcn_stp_debug_gpio_assert(IDX_TX_THREAD, DBG_TIE_HIGH); - } - #endif - } - - #if 0 - if (fgNeedHwAccess == TRUE) { - wlanReleasePowerControl(prGlueInfo->prAdapter); - } - #endif - - /* flush the pending TX packets */ - if (prGlueInfo->i4TxPendingFrameNum > 0) { - kalFlushPendingTxPackets(prGlueInfo); - } - - /* flush pending security frames */ - if (prGlueInfo->i4TxPendingSecurityFrameNum > 0) { - kalClearSecurityFrames(prGlueInfo); - } - - /* remove pending oid */ - wlanReleasePendingOid(prGlueInfo->prAdapter, 0); - - - /* In linux, we don't need to free sk_buff by ourself */ - - DBGLOG(INIT, INFO, ("mtk_sdiod stops\n")); - complete(&prGlueInfo->rHaltComp); - - return 0; - -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to check if card is removed -* -* \param pvGlueInfo Pointer of GLUE Data Structure -* -* \retval TRUE: card is removed -* FALSE: card is still attached -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalIsCardRemoved( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - return FALSE; - // Linux MMC doesn't have removal notification yet -} - -/*----------------------------------------------------------------------------*/ -/*! - * \brief This routine is used to send command to firmware for overriding netweork address - * - * \param pvGlueInfo Pointer of GLUE Data Structure - - * \retval TRUE - * FALSE - */ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalRetrieveNetworkAddress( - IN P_GLUE_INFO_T prGlueInfo, - IN OUT PARAM_MAC_ADDRESS * prMacAddr - ) -{ - ASSERT(prGlueInfo); - - if(prGlueInfo->fgIsMacAddrOverride == FALSE) { - #if !defined(CONFIG_X86) - UINT_32 i; - BOOLEAN fgIsReadError = FALSE; - - for(i = 0 ; i < MAC_ADDR_LEN ; i+=2) { - if(kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, aucMacAddress) + i, - (PUINT_16) (((PUINT_8)prMacAddr) + i)) == FALSE) { - fgIsReadError = TRUE; - break; - } - } - - if(fgIsReadError == TRUE) { - return FALSE; - } - else { - return TRUE; - } - #else - /* x86 Linux doesn't need to override network address so far */ - return FALSE; - #endif - } - else { - COPY_MAC_ADDR(prMacAddr, prGlueInfo->rMacAddrOverride); - - return TRUE; - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to flush pending TX packets in glue layer -* -* \param pvGlueInfo Pointer of GLUE Data Structure -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalFlushPendingTxPackets( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - P_QUE_T prTxQue; - P_QUE_ENTRY_T prQueueEntry; - PVOID prPacket; - - GLUE_SPIN_LOCK_DECLARATION(); - - ASSERT(prGlueInfo); - - prTxQue = &(prGlueInfo->rTxQueue); - - if (prGlueInfo->i4TxPendingFrameNum) { - while (TRUE) { - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_TX_QUE); - QUEUE_REMOVE_HEAD(prTxQue, prQueueEntry, P_QUE_ENTRY_T); - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_TX_QUE); - - if (prQueueEntry == NULL) { - break; - } - - prPacket = GLUE_GET_PKT_DESCRIPTOR(prQueueEntry); - - kalSendComplete(prGlueInfo, - prPacket, - WLAN_STATUS_NOT_ACCEPTED); - } - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is get indicated media state -* -* \param pvGlueInfo Pointer of GLUE Data Structure -* -* \retval -*/ -/*----------------------------------------------------------------------------*/ -ENUM_PARAM_MEDIA_STATE_T -kalGetMediaStateIndicated( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - return prGlueInfo->eParamMediaStateIndicated; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to set indicated media state -* -* \param pvGlueInfo Pointer of GLUE Data Structure -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalSetMediaStateIndicated( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_PARAM_MEDIA_STATE_T eParamMediaStateIndicate - ) -{ - ASSERT(prGlueInfo); - - prGlueInfo->eParamMediaStateIndicated = eParamMediaStateIndicate; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to clear pending OID staying in command queue -* -* \param prGlueInfo Pointer of GLUE Data Structure -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalOidCmdClearance( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - P_QUE_T prCmdQue; - QUE_T rTempCmdQue; - P_QUE_T prTempCmdQue = &rTempCmdQue; - P_QUE_ENTRY_T prQueueEntry = (P_QUE_ENTRY_T)NULL; - P_CMD_INFO_T prCmdInfo = (P_CMD_INFO_T)NULL; - - GLUE_SPIN_LOCK_DECLARATION(); - - ASSERT(prGlueInfo); - - prCmdQue = &prGlueInfo->rCmdQueue; - - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_CMD_QUE); - QUEUE_MOVE_ALL(prTempCmdQue, prCmdQue); - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - while (prQueueEntry) { - - if (((P_CMD_INFO_T)prQueueEntry)->fgIsOid) { - prCmdInfo = (P_CMD_INFO_T)prQueueEntry; - break; - } - else { - QUEUE_INSERT_TAIL(prCmdQue, prQueueEntry); - } - - QUEUE_REMOVE_HEAD(prTempCmdQue, prQueueEntry, P_QUE_ENTRY_T); - } - - QUEUE_CONCATENATE_QUEUES(prCmdQue, prTempCmdQue); - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_CMD_QUE); - - if (prCmdInfo) { - if (prCmdInfo->pfCmdTimeoutHandler) { - prCmdInfo->pfCmdTimeoutHandler(prGlueInfo->prAdapter, prCmdInfo); - } - else { - kalOidComplete(prGlueInfo, - prCmdInfo->fgSetQuery, - 0, - WLAN_STATUS_NOT_ACCEPTED); - } - - prGlueInfo->u4OidCompleteFlag = 1; - cmdBufFreeCmdInfo(prGlueInfo->prAdapter, prCmdInfo); - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to insert command into prCmdQueue -* -* \param prGlueInfo Pointer of GLUE Data Structure -* prQueueEntry Pointer of queue entry to be inserted -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalEnqueueCommand( - IN P_GLUE_INFO_T prGlueInfo, - IN P_QUE_ENTRY_T prQueueEntry - ) -{ - P_QUE_T prCmdQue; - - GLUE_SPIN_LOCK_DECLARATION(); - - ASSERT(prGlueInfo); - ASSERT(prQueueEntry); - - prCmdQue = &prGlueInfo->rCmdQueue; - - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_CMD_QUE); - QUEUE_INSERT_TAIL(prCmdQue, prQueueEntry); - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_CMD_QUE); -} - -/*----------------------------------------------------------------------------*/ -/*! -* @brief Handle EVENT_ID_ASSOC_INFO event packet by indicating to OS with -* proper information -* -* @param pvGlueInfo Pointer of GLUE Data Structure -* @param prAssocInfo Pointer of EVENT_ID_ASSOC_INFO Packet -* -* @return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalHandleAssocInfo( - IN P_GLUE_INFO_T prGlueInfo, - IN P_EVENT_ASSOC_INFO prAssocInfo - ) -{ - // to do -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to get firmware load address from registry -* -* \param prGlueInfo Pointer of GLUE Data Structure -* -* \retval -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -kalGetFwLoadAddress( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - return prGlueInfo->rRegInfo.u4LoadAddress; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to get firmware start address from registry -* -* \param prGlueInfo Pointer of GLUE Data Structure -* -* \retval -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -kalGetFwStartAddress( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - return prGlueInfo->rRegInfo.u4StartAddress; -} - -/*----------------------------------------------------------------------------*/ -/*! - * * @brief Notify OS with SendComplete event of the specific packet. Linux should - * * free packets here. - * * - * * @param pvGlueInfo Pointer of GLUE Data Structure - * * @param pvPacket Pointer of Packet Handle - * * @param status Status Code for OS upper layer - * * - * * @return none - * */ -/*----------------------------------------------------------------------------*/ - -/// Todo -VOID -kalSecurityFrameSendComplete ( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID pvPacket, - IN WLAN_STATUS rStatus - ) -{ - ASSERT(pvPacket); - - dev_kfree_skb((struct sk_buff *) pvPacket); - GLUE_DEC_REF_CNT(prGlueInfo->i4TxPendingSecurityFrameNum); -} - -UINT_32 -kalGetTxPendingFrameCount( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - return (UINT_32)(prGlueInfo->i4TxPendingFrameNum); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to retrieve the number of pending commands -* (including MMPDU, 802.1X and command packets) -* -* \param prGlueInfo Pointer of GLUE Data Structure -* -* \retval -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -kalGetTxPendingCmdCount( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - P_QUE_T prCmdQue; - - ASSERT(prGlueInfo); - prCmdQue = &prGlueInfo->rCmdQueue; - - return prCmdQue->u4NumElem; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Timer Initialization Procedure -* -* \param[in] prGlueInfo Pointer to GLUE Data Structure -* \param[in] prTimerHandler Pointer to timer handling function, whose only -* argument is "prAdapter" -* -* \retval none -* -*/ -/*----------------------------------------------------------------------------*/ - -//static struct timer_list tickfn; - -VOID -kalOsTimerInitialize ( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID prTimerHandler - ) -{ - - ASSERT(prGlueInfo); - - init_timer(&(prGlueInfo->tickfn)); - prGlueInfo->tickfn.function = prTimerHandler; - prGlueInfo->tickfn.data = (unsigned long) prGlueInfo; -} - -// Todo -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set the time to do the time out check. -* -* \param[in] prGlueInfo Pointer to GLUE Data Structure -* \param[in] rInterval Time out interval from current time. -* -* \retval TRUE Success. -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalSetTimer( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4Interval - ) -{ - ASSERT(prGlueInfo); - del_timer_sync(&(prGlueInfo->tickfn)); - - prGlueInfo->tickfn.expires = jiffies + u4Interval * HZ / MSEC_PER_SEC; - add_timer(&(prGlueInfo->tickfn)); - - return TRUE; /* success */ -} -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to cancel -* -* \param[in] prGlueInfo Pointer to GLUE Data Structure -* -* \retval TRUE : Timer has been canceled -* FALAE : Timer doens't exist -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalCancelTimer( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - clear_bit(GLUE_FLAG_TIMEOUT_BIT, &prGlueInfo->u4Flag); - - if (del_timer_sync(&(prGlueInfo->tickfn)) >=0) { - return TRUE; - } else { - return FALSE; - } -} -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is a callback function for scanning done -* -* \param[in] prGlueInfo Pointer to GLUE Data Structure -* -* \retval none -* -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalScanDone( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_KAL_NETWORK_TYPE_INDEX_T eNetTypeIdx, - IN WLAN_STATUS status - ) -{ - ASSERT(prGlueInfo); - - /* check for system configuration for generating error message on scan list */ - //wlanCheckSystemConfiguration(prGlueInfo->prAdapter); - - kalIndicateStatusAndComplete(prGlueInfo, WLAN_STATUS_SCAN_COMPLETE, NULL, 0); -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is used to generate a random number -* -* \param none -* -* \retval UINT_32 -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -kalRandomNumber( - VOID - ) -{ - UINT_32 number = 0; - - get_random_bytes(&number, 4); - - return number; -} - -/*----------------------------------------------------------------------------*/ -/*! - * \brief command timeout call-back function - * - * \param[in] prGlueInfo Pointer to the GLUE data structure. - * - * \retval (none) - */ -/*----------------------------------------------------------------------------*/ -VOID -kalTimeoutHandler (unsigned long arg) -{ - - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T) arg; - - ASSERT(prGlueInfo); - - /* Notify tx thread for timeout event */ - set_bit(GLUE_FLAG_TIMEOUT_BIT, &prGlueInfo->u4Flag); - wake_up_interruptible(&prGlueInfo->waitq); - - return; -} - - -VOID -kalSetEvent (P_GLUE_INFO_T pr) { - set_bit(GLUE_FLAG_TXREQ_BIT, &pr->u4Flag); - wake_up_interruptible(&pr->waitq); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to check if configuration file (NVRAM/Registry) exists -* -* \param[in] -* prGlueInfo -* -* \return -* TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalIsConfigurationExist( - IN P_GLUE_INFO_T prGlueInfo - ) -{ -#if !defined(CONFIG_X86) - ASSERT(prGlueInfo); - - return prGlueInfo->fgNvramAvailable; -#else - /* there is no configuration data for x86-linux */ - return FALSE; -#endif -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to retrieve Registry information -* -* \param[in] -* prGlueInfo -* -* \return -* Pointer of REG_INFO_T -*/ -/*----------------------------------------------------------------------------*/ -P_REG_INFO_T -kalGetConfiguration( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - return &(prGlueInfo->rRegInfo); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to retrieve version information of corresponding configuration file -* -* \param[in] -* prGlueInfo -* -* \param[out] -* pu2Part1CfgOwnVersion -* pu2Part1CfgPeerVersion -* pu2Part2CfgOwnVersion -* pu2Part2CfgPeerVersion -* -* \return -* NONE -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalGetConfigurationVersion( - IN P_GLUE_INFO_T prGlueInfo, - OUT PUINT_16 pu2Part1CfgOwnVersion, - OUT PUINT_16 pu2Part1CfgPeerVersion, - OUT PUINT_16 pu2Part2CfgOwnVersion, - OUT PUINT_16 pu2Part2CfgPeerVersion - ) -{ - ASSERT(prGlueInfo); - - ASSERT(pu2Part1CfgOwnVersion); - ASSERT(pu2Part1CfgPeerVersion); - ASSERT(pu2Part2CfgOwnVersion); - ASSERT(pu2Part2CfgPeerVersion); - - kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, u2Part1OwnVersion), - pu2Part1CfgOwnVersion); - - kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, u2Part1PeerVersion), - pu2Part1CfgPeerVersion); - - kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, u2Part2OwnVersion), - pu2Part2CfgOwnVersion); - - kalCfgDataRead16(prGlueInfo, - OFFSET_OF(WIFI_CFG_PARAM_STRUCT, u2Part2PeerVersion), - pu2Part2CfgPeerVersion); - - return; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to check if the WPS is active or not -* -* \param[in] -* prGlueInfo -* -* \return -* TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalWSCGetActiveState( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - return (prGlueInfo->fgWpsActive); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief update RSSI and LinkQuality to GLUE layer -* -* \param[in] -* prGlueInfo -* eNetTypeIdx -* cRssi -* cLinkQuality -* -* \return -* None -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalUpdateRSSI( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_KAL_NETWORK_TYPE_INDEX_T eNetTypeIdx, - IN INT_8 cRssi, - IN INT_8 cLinkQuality - ) -{ - struct iw_statistics *pStats = (struct iw_statistics *)NULL; - - ASSERT(prGlueInfo); - - switch(eNetTypeIdx) { - case KAL_NETWORK_TYPE_AIS_INDEX: - pStats = (struct iw_statistics *) (&(prGlueInfo->rIwStats)); - break; -#if CFG_ENABLE_WIFI_DIRECT -#if CFG_SUPPORT_P2P_RSSI_QUERY - case KAL_NETWORK_TYPE_P2P_INDEX: - pStats = (struct iw_statistics *) (&(prGlueInfo->rP2pIwStats)); - break; -#endif -#endif - default: - break; - - } - - if (pStats) { - pStats->qual.qual = cLinkQuality; - pStats->qual.noise = 0; - pStats->qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_NOISE_UPDATED; - pStats->qual.level = 0x100 + cRssi; - pStats->qual.updated |= IW_QUAL_LEVEL_UPDATED; - } - - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Pre-allocate I/O buffer -* -* \param[in] -* none -* -* \return -* TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalInitIOBuffer( - VOID - ) -{ - UINT_32 u4Size; - - if(CFG_COALESCING_BUFFER_SIZE >= CFG_RX_COALESCING_BUFFER_SIZE) { - u4Size = CFG_COALESCING_BUFFER_SIZE + sizeof(ENHANCE_MODE_DATA_STRUCT_T); - } - else { - u4Size = CFG_RX_COALESCING_BUFFER_SIZE + sizeof(ENHANCE_MODE_DATA_STRUCT_T); - } - - pvIoBuffer = kmalloc(u4Size, GFP_KERNEL); - if(pvIoBuffer) { - pvIoBufferSize = u4Size; - pvIoBufferUsage = 0; - - return TRUE; - } - - return FALSE; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Free pre-allocated I/O buffer -* -* \param[in] -* none -* -* \return -* none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalUninitIOBuffer( - VOID - ) -{ - if(pvIoBuffer) { - kfree(pvIoBuffer); - - pvIoBuffer = (PVOID) NULL; - pvIoBufferSize = 0; - pvIoBufferUsage = 0; - } - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Dispatch pre-allocated I/O buffer -* -* \param[in] -* u4AllocSize -* -* \return -* PVOID for pointer of pre-allocated I/O buffer -*/ -/*----------------------------------------------------------------------------*/ -PVOID -kalAllocateIOBuffer( - IN UINT_32 u4AllocSize - ) -{ - PVOID ret = (PVOID)NULL; - - if(pvIoBuffer) { - if(u4AllocSize <= (pvIoBufferSize - pvIoBufferUsage)) { - ret = (PVOID)&(((PUINT_8)(pvIoBuffer))[pvIoBufferUsage]); - pvIoBufferUsage += u4AllocSize; - } - } - else { - /* fault tolerance */ - ret = (PVOID) kalMemAlloc(u4AllocSize, PHY_MEM_TYPE); - } - - return ret; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Release all dispatched I/O buffer -* -* \param[in] -* none -* -* \return -* none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalReleaseIOBuffer( - IN PVOID pvAddr, - IN UINT_32 u4Size - ) -{ - if(pvIoBuffer) { - pvIoBufferUsage -= u4Size; - } - else { - /* fault tolerance */ - kalMemFree(pvAddr, PHY_MEM_TYPE, u4Size); - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalGetChannelList( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_BAND_T eSpecificBand, - IN UINT_8 ucMaxChannelNum, - IN PUINT_8 pucNumOfChannel, - IN P_RF_CHANNEL_INFO_T paucChannelList - ) -{ - rlmDomainGetChnlList(prGlueInfo->prAdapter, - eSpecificBand, - ucMaxChannelNum, - pucNumOfChannel, - paucChannelList); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -BOOL -kalIsAPmode( - IN P_GLUE_INFO_T prGlueInfo - ) -{ -#if CFG_ENABLE_WIFI_DIRECT - if (IS_NET_ACTIVE(prGlueInfo->prAdapter, NETWORK_TYPE_P2P_INDEX) && - p2pFuncIsAPMode(prGlueInfo->prAdapter->rWifiVar.prP2pFsmInfo)) - return TRUE; -#endif - - return FALSE; -} - - -#if CFG_SUPPORT_802_11W -/*----------------------------------------------------------------------------*/ -/*! -* \brief to check if the MFP is active or not -* -* \param[in] -* prGlueInfo -* -* \return -* TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -kalGetMfpSetting( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - return (prGlueInfo->rWpaInfo.u4Mfp); -} -#endif - -struct file* -kalFileOpen( - const char* path, - int flags, - int rights) -{ - struct file* filp = NULL; - mm_segment_t oldfs; - int err = 0; - - oldfs = get_fs(); - set_fs(get_ds()); - filp = filp_open(path, flags, rights); - set_fs(oldfs); - if(IS_ERR(filp)) { - err = PTR_ERR(filp); - return NULL; - } - return filp; -} - -VOID -kalFileClose( - struct file* file) -{ - filp_close(file, NULL); -} - -UINT_32 -kalFileRead( - struct file* file, - unsigned long long offset, - unsigned char* data, - unsigned int size) -{ - mm_segment_t oldfs; - int ret; - - oldfs = get_fs(); - set_fs(get_ds()); - - ret = vfs_read(file, data, size, &offset); - - set_fs(oldfs); - return ret; -} - -UINT_32 -kalFileWrite( - struct file* file, - unsigned long long offset, - unsigned char* data, - unsigned int size) -{ - mm_segment_t oldfs; - int ret; - - oldfs = get_fs(); - set_fs(get_ds()); - - ret = vfs_write(file, data, size, &offset); - - set_fs(oldfs); - return ret; -} - -UINT_32 -kalWriteToFile( - const PUINT_8 pucPath, - BOOLEAN fgDoAppend, - PUINT_8 pucData, - UINT_32 u4Size) -{ - struct file* file = NULL; - UINT_32 ret; - UINT_32 u4Flags = 0; - - if(fgDoAppend) { - u4Flags = O_APPEND; - } - - file = kalFileOpen(pucPath, O_WRONLY | O_CREAT | u4Flags, S_IRWXU); - ret = kalFileWrite(file, 0, pucData, u4Size); - kalFileClose(file); - - return ret; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To indicate BSS-INFO to NL80211 as scanning result -* -* \param[in] -* prGlueInfo -* pucBeaconProbeResp -* u4FrameLen -* -* -* -* \return -* none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalIndicateBssInfo ( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucBeaconProbeResp, - IN UINT_32 u4FrameLen, - IN UINT_8 ucChannelNum, - IN INT_32 i4SignalStrength - ) -{ - struct wiphy *wiphy; - struct ieee80211_channel *prChannel = NULL; - - ASSERT(prGlueInfo); - wiphy = priv_to_wiphy(prGlueInfo); - - /* search through channel entries */ - if(ucChannelNum <= 14) { - prChannel = ieee80211_get_channel(wiphy, ieee80211_channel_to_frequency(ucChannelNum, IEEE80211_BAND_2GHZ)); - } - else { - prChannel = ieee80211_get_channel(wiphy, ieee80211_channel_to_frequency(ucChannelNum, IEEE80211_BAND_5GHZ)); - } - - if(prChannel != NULL && prGlueInfo->prScanRequest != NULL) { - struct cfg80211_bss *bss; - - /* indicate to NL80211 subsystem */ - bss = cfg80211_inform_bss_frame(wiphy, - prChannel, - (struct ieee80211_mgmt *)pucBeaconProbeResp, - u4FrameLen, - i4SignalStrength * 100, - GFP_KERNEL); - - if(!bss) { - DBGLOG(REQ, WARN, ("cfg80211_inform_bss_frame() returned with NULL\n")); - } - else { - cfg80211_put_bss(bss); - } - } - - return; -} - diff --git a/drivers/net/wireless/mt5931/os/linux/gl_p2p.c b/drivers/net/wireless/mt5931/os/linux/gl_p2p.c deleted file mode 100755 index 602d43a973bf..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/gl_p2p.c +++ /dev/null @@ -1,5498 +0,0 @@ -/* -** $Id: @(#) gl_p2p.c@@ -*/ - -/*! \file gl_p2p.c - \brief Main routines of Linux driver interface for Wi-Fi Direct - - This file contains the main routines of Linux driver for MediaTek Inc. 802.11 - Wireless LAN Adapters. -*/ - -/******************************************************************************* -* Copyright (c) 2007 MediaTek Inc. -* -* All rights reserved. Copying, compilation, modification, distribution -* or any other use whatsoever of this material is strictly prohibited -* except in accordance with a Software License Agreement with -* MediaTek Inc. -******************************************************************************** -*/ - -/******************************************************************************* -* LEGAL DISCLAIMER -* -* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND -* AGREES THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK -* SOFTWARE") RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE -* PROVIDED TO BUYER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY -* DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT -* LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -* PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE -* ANY WARRANTY WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY -* WHICH MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK -* SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY -* WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE -* FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION OR TO -* CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. -* -* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE -* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL -* BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT -* ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY -* BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -* -* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE -* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT -* OF LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING -* THEREOF AND RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN -* FRANCISCO, CA, UNDER THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE -* (ICC). -******************************************************************************** -*/ - -/* -** $Log: gl_p2p.c $ -** -** 08 17 2012 yuche.tsai -** NULL -** Fix compile warning. -** -** 08 16 2012 yuche.tsai -** NULL -** Fix compile warning. -** -** 08 14 2012 yuche.tsai -** NULL -** FPB from ALPS.JB to phase 2 release. -** -** 07 26 2012 yuche.tsai -** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot -** Update driver code of ALPS.JB for hot-spot. -** -** 07 19 2012 yuche.tsai -** NULL -** Code update for JB. - * - * 07 17 2012 yuche.tsai - * NULL - * Fix compile error for JB. - * - * 07 17 2012 yuche.tsai - * NULL - * Let netdev bring up. - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 01 09 2012 terry.wu - * [WCXRP00001166] [Wi-Fi] [Driver] cfg80211 integration for p2p newtork - * cfg80211 integration for p2p network. - * - * 12 19 2011 terry.wu - * [WCXRP00001142] [Wi-Fi] [P2P Driver] XOR local admin bit to generate p2p net device MAC - * XOR local administrated bit to generate net device MAC of p2p network. - * - * 12 02 2011 yuche.tsai - * NULL - * Fix possible KE when unload p2p. - * - * 11 24 2011 yuche.tsai - * NULL - * Fix P2P IOCTL of multicast address bug, add low power driver stop control. - * - * 11 22 2011 yuche.tsai - * NULL - * Update RSSI link quality of P2P Network query method. (Bug fix) - * - * 11 19 2011 yuche.tsai - * NULL - * Add RSSI support for P2P network. - * - * 11 16 2011 yuche.tsai - * [WCXRP00001107] [Volunteer Patch][Driver] Large Network Type index assert in FW issue. - * Avoid using work thread in set p2p multicast address callback. - * - * 11 11 2011 yuche.tsai - * NULL - * Fix work thread cancel issue. - * - * 11 11 2011 yuche.tsai - * NULL - * Fix default device name issue. - * - * 11 08 2011 yuche.tsai - * [WCXRP00001094] [Volunteer Patch][Driver] Driver version & supplicant version query & set support for service discovery version check. - * Add support for driver version query & p2p supplicant verseion set. - * For new service discovery mechanism sync. - * - * 11 07 2011 yuche.tsai - * NULL - * [ALPS 00087243] KE in worker thread. - * The multicast address list is scheduled in worker thread. - * Before the worker thread is excuted, if P2P is unloaded, a KE may occur. - * - * 10 26 2011 terry.wu - * [WCXRP00001066] [MT6620 Wi-Fi] [P2P Driver] Fix P2P Oid Issue - * Fix some P2P OID functions didn't raise its flag "fgIsP2pOid" issue. - * - * 10 25 2011 cm.chang - * [WCXRP00001058] [All Wi-Fi][Driver] Fix sta_rec's phyTypeSet and OBSS scan in AP mode - * . - * - * 10 18 2011 yuche.tsai - * [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch. - * Support Channle Query. - * - * 10 18 2011 yuche.tsai - * [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch. - * New 2.1 branch - - * - * 08 26 2011 yuche.tsai - * NULL - * Fix bug of parsing secondary device list type issue. - * - * 08 24 2011 yuche.tsai - * [WCXRP00000919] [Volunteer Patch][WiFi Direct][Driver] Invitation New Feature. - * Invitation Abort. - * - * 08 23 2011 yuche.tsai - * NULL - * Fix multicast address list issue of P2P. - * - * 08 22 2011 chinglan.wang - * NULL - * Fix invitation indication bug.. - * - * 08 16 2011 cp.wu - * [WCXRP00000934] [MT6620 Wi-Fi][Driver][P2P] Wi-Fi hot spot with auto sparse channel residence - * auto channel decision for 2.4GHz hot spot mode - * - * 08 16 2011 chinglan.wang - * NULL - * Add the group id information in the invitation indication. - * - * 08 09 2011 yuche.tsai - * [WCXRP00000919] [Volunteer Patch][WiFi Direct][Driver] Invitation New Feature. - * Invitation Feature add on. - * - * 08 05 2011 yuche.tsai - * [WCXRP00000856] [Volunteer Patch][WiFi Direct][Driver] MT6620 WiFi Direct IOT Issue with BCM solution. - * Add Password ID check for quick connection. - * Also modify some connection policy. - * - * 07 18 2011 chinglan.wang - * NULL - * Add IOC_P2P_GO_WSC_IE (p2p capability). - * - * 06 14 2011 yuche.tsai - * NULL - * Add compile flag to disable persistent group support. - * - * 05 04 2011 chinglan.wang - * [WCXRP00000698] [MT6620 Wi-Fi][P2P][Driver] Add p2p invitation command for the p2p driver - * . - * - * 05 02 2011 yuche.tsai - * [WCXRP00000693] [Volunteer Patch][MT6620][Driver] Clear Formation Flag after TX lifetime timeout. - * Clear formation flag after formation timeout. - * - * 04 22 2011 george.huang - * [WCXRP00000621] [MT6620 Wi-Fi][Driver] Support P2P supplicant to set power mode - * . - * - * 04 21 2011 george.huang - * [WCXRP00000621] [MT6620 Wi-Fi][Driver] Support P2P supplicant to set power mode - * 1. Revise P2P power mode setting. - * 2. Revise fast-PS for concurrent - * - * 04 19 2011 wh.su - * NULL - * Adding length check before doing WPA RSN IE parsing for scan results indicate. - * - * 04 14 2011 yuche.tsai - * [WCXRP00000646] [Volunteer Patch][MT6620][FW/Driver] Sigma Test Modification for some test case. - * Connection flow refine for Sigma test. - * - * 04 08 2011 yuche.tsai - * [WCXRP00000624] [Volunteer Patch][MT6620][Driver] Add device discoverability support for GO. - * Add device discoverability support. - * - * 04 08 2011 george.huang - * [WCXRP00000621] [MT6620 Wi-Fi][Driver] Support P2P supplicant to set power mode - * separate settings of P2P and AIS - * - * 04 07 2011 terry.wu - * [WCXRP00000619] [MT6620 Wi-Fi][Driver] fix kernel panic may occur when removing wlan - * Fix kernel panic may occur when removing wlan driver. - * - * 03 31 2011 wh.su - * [WCXRP00000614] [MT6620 Wi-Fi][Driver] P2P: Update beacon content while setting WSC IE - * Update the wsc ie to beacon content. - * - * 03 25 2011 wh.su - * NULL - * add the sample code for set power mode and get power mode. - * - * 03 25 2011 yuche.tsai - * NULL - * Improve some error handleing. - * - * 03 22 2011 george.huang - * [WCXRP00000504] [MT6620 Wi-Fi][FW] Support Sigma CAPI for power saving related command - * link with supplicant commands - * - * 03 22 2011 yuche.tsai - * [WCXRP00000584] [Volunteer Patch][MT6620][Driver] Add beacon timeout support for WiFi Direct. - * Modify formation policy. - * - * 03 22 2011 yuche.tsai - * NULL - * Modify formation policy setting. - * - * 03 18 2011 yuche.tsai - * [WCXRP00000574] [Volunteer Patch][MT6620][Driver] Modify P2P FSM Connection Flow - * Modify connection flow after Group Formation Complete, or device connect to a GO. - * Instead of request channel & connect directly, we use scan to allocate channel bandwidth & connect after RX BCN. - * - * 03 15 2011 wh.su - * [WCXRP00000563] [MT6620 Wi-Fi] [P2P] Set local config method while set password Id ready - * set lccal config method method while set password Id ready. - * - * 03 15 2011 yuche.tsai - * [WCXRP00000560] [Volunteer Patch][MT6620][Driver] P2P Connection from UI using KEY/DISPLAY issue - * Fix some configure method issue. - * - * 03 15 2011 jeffrey.chang - * [WCXRP00000558] [MT6620 Wi-Fi][MT6620 Wi-Fi][Driver] refine the queue selection algorithm for WMM - * refine queue_select function - * - * 03 13 2011 wh.su - * [WCXRP00000530] [MT6620 Wi-Fi] [Driver] skip doing p2pRunEventAAAComplete after send assoc response Tx Done - * add code for avoid compiling warning. - * - * 03 10 2011 yuche.tsai - * NULL - * Add P2P API. - * - * 03 10 2011 terry.wu - * [WCXRP00000505] [MT6620 Wi-Fi][Driver/FW] WiFi Direct Integration - * Remove unnecessary assert and message. - * - * 03 08 2011 wh.su - * [WCXRP00000488] [MT6620 Wi-Fi][Driver] Support the SIGMA set p2p parameter to driver - * support the power save related p2p setting. - * - * 03 07 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * rename the define to anti_pviracy. - * - * 03 05 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * add the code to get the check rsponse and indicate to app. - * - * 03 03 2011 jeffrey.chang - * [WCXRP00000512] [MT6620 Wi-Fi][Driver] modify the net device relative functions to support the H/W multiple queue - * support concurrent network - * - * 03 03 2011 jeffrey.chang - * [WCXRP00000512] [MT6620 Wi-Fi][Driver] modify the net device relative functions to support the H/W multiple queue - * modify P2P's netdevice functions to support multiple H/W queues - * - * 03 03 2011 cp.wu - * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery - * for get request, the buffer length to be copied is header + payload. - * - * 03 02 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * add code to let the beacon and probe response for Auto GO WSC . - * - * 03 02 2011 cp.wu - * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery - * add a missed break. - * - * 03 01 2011 yuche.tsai - * [WCXRP00000501] [Volunteer Patch][MT6620][Driver] No common channel issue when doing GO formation - * Update channel issue when doing GO formation.. - * - * 02 25 2011 wh.su - * [WCXRP00000488] [MT6620 Wi-Fi][Driver] Support the SIGMA set p2p parameter to driver - * add the Operation channel setting. - * - * 02 23 2011 wh.su - * [WCXRP00000488] [MT6620 Wi-Fi][Driver] Support the SIGMA set p2p parameter to driver - * fixed the set int ioctl set index and value map to driver issue. - * - * 02 22 2011 wh.su - * [WCXRP00000488] [MT6620 Wi-Fi][Driver] Support the SIGMA set p2p parameter to driver - * adding the ioctl set int from supplicant, and can used to set the p2p paramters - * - * 02 21 2011 terry.wu - * [WCXRP00000476] [MT6620 Wi-Fi][Driver] Clean P2P scan list while removing P2P - * Clean P2P scan list while removing P2P. - * - * 02 18 2011 wh.su - * [WCXRP00000471] [MT6620 Wi-Fi][Driver] Add P2P Provison discovery append Config Method attribute at WSC IE - * fixed the ioctl setting that index not map to spec defined config method. - * - * 02 17 2011 wh.su - * [WCXRP00000471] [MT6620 Wi-Fi][Driver] Add P2P Provison discovery append Config Method attribute at WSC IE - * append the WSC IE config method attribute at provision discovery request. - * - * 02 17 2011 wh.su - * [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request - * modify the structure pointer for set WSC IE. - * - * 02 16 2011 wh.su - * [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request - * fixed the probe request send out without WSC IE issue (at P2P). - * - * 02 09 2011 cp.wu - * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery - * fix typo - * - * 02 09 2011 yuche.tsai - * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode. - * Add Support for MLME deauthentication for Hot-Spot. - * - * 01 25 2011 terry.wu - * [WCXRP00000393] [MT6620 Wi-Fi][Driver] Add new module insert parameter - * Add a new module parameter to indicate current runnig mode, P2P or AP. - * - * 01 12 2011 yuche.tsai - * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue - * 1. Modify Channel Acquire Time of AP mode from 5s to 1s. - * 2. Call cnmP2pIsPermit() before active P2P network. - * 3. Add channel selection support for AP mode. - * - * 01 05 2011 cp.wu - * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery - * ioctl implementations for P2P Service Discovery - * - * 01 04 2011 cp.wu - * [WCXRP00000338] [MT6620 Wi-Fi][Driver] Separate kalMemAlloc into kmalloc and vmalloc implementations to ease physically continous memory demands - * separate kalMemAlloc() into virtually-continous and physically-continous type to ease slab system pressure - * - * 12 22 2010 cp.wu - * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery - * 1. header file restructure for more clear module isolation - * 2. add function interface definition for implementing Service Discovery callbacks - * - * 12 15 2010 cp.wu - * NULL - * invoke nicEnableInterrupt() before leaving from wlanAdapterStart() - * - * 12 08 2010 yuche.tsai - * [WCXRP00000245] [MT6620][Driver] Invitation & Provision Discovery Feature Check-in - * [WCXRP000000245][MT6620][Driver] Invitation Request Feature Add - * - * 11 30 2010 yuche.tsai - * NULL - * Invitation & Provision Discovery Indication. - * - * 11 17 2010 wh.su - * [WCXRP00000164] [MT6620 Wi-Fi][Driver] Support the p2p random SSID[WCXRP00000179] [MT6620 Wi-Fi][FW] Set the Tx lowest rate at wlan table for normal operation - * fixed some ASSERT check. - * - * 11 04 2010 wh.su - * [WCXRP00000164] [MT6620 Wi-Fi][Driver] Support the p2p random SSID - * adding the p2p random ssid support. - * - * 10 20 2010 wh.su - * [WCXRP00000124] [MT6620 Wi-Fi] [Driver] Support the dissolve P2P Group - * Add the code to support disconnect p2p group - * - * 10 04 2010 wh.su - * [WCXRP00000081] [MT6620][Driver] Fix the compiling error at WinXP while enable P2P - * add a kal function for set cipher. - * - * 10 04 2010 wh.su - * [WCXRP00000081] [MT6620][Driver] Fix the compiling error at WinXP while enable P2P - * fixed compiling error while enable p2p. - * - * 09 28 2010 wh.su - * NULL - * [WCXRP00000069][MT6620 Wi-Fi][Driver] Fix some code for phase 1 P2P Demo. - * - * 09 21 2010 kevin.huang - * [WCXRP00000054] [MT6620 Wi-Fi][Driver] Restructure driver for second Interface - * Isolate P2P related function for Hardware Software Bundle - * - * 09 21 2010 kevin.huang - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * Eliminate Linux Compile Warning - * - * 09 10 2010 george.huang - * NULL - * update iwpriv LP related - * - * 09 10 2010 wh.su - * NULL - * fixed the compiling error at win XP. - * - * 09 09 2010 cp.wu - * NULL - * add WPS/WPA/RSN IE for Wi-Fi Direct scanning result. - * - * 09 07 2010 wh.su - * NULL - * adding the code for beacon/probe req/ probe rsp wsc ie at p2p. - * - * 09 06 2010 wh.su - * NULL - * let the p2p can set the privacy bit at beacon and rsn ie at assoc req at key handshake state. - * - * 08 25 2010 cp.wu - * NULL - * add netdev_ops(NDO) for linux kernel 2.6.31 or greater - * - * 08 23 2010 cp.wu - * NULL - * revise constant definitions to be matched with implementation (original cmd-event definition is deprecated) - * - * 08 20 2010 cp.wu - * NULL - * correct typo. - * - * 08 20 2010 yuche.tsai - * NULL - * Invert Connection request provision status parameter. - * - * 08 19 2010 cp.wu - * NULL - * add set mac address interface for further possibilities of wpa_supplicant overriding interface address. - * - * 08 18 2010 cp.wu - * NULL - * modify pwp ioctls attribution by removing FIXED_SIZE. - * - * 08 18 2010 jeffrey.chang - * NULL - * support multi-function sdio - * - * 08 17 2010 cp.wu - * NULL - * correct p2p net device registration with NULL pointer access issue. - * - * 08 16 2010 cp.wu - * NULL - * P2P packets are now marked when being queued into driver, and identified later without checking MAC address - * - * 08 16 2010 cp.wu - * NULL - * add subroutines for P2P to set multicast list. - * - * 08 16 2010 george.huang - * NULL - * add wext handlers to link P2P set PS profile/ network address function (TBD) - * - * 08 16 2010 cp.wu - * NULL - * revised implementation of Wi-Fi Direct io controls. - * - * 08 12 2010 cp.wu - * NULL - * follow-up with ioctl interface update for Wi-Fi Direct application - * - * 08 06 2010 cp.wu - * NULL - * driver hook modifications corresponding to ioctl interface change. - * - * 08 03 2010 cp.wu - * NULL - * add basic support for ioctl of getting scan result. (only address and SSID are reporterd though) - * - * 08 03 2010 cp.wu - * NULL - * [Wi-Fi Direct Driver Hook] change event indication API to be consistent with supplicant - * - * 08 03 2010 cp.wu - * NULL - * surpress compilation warning. - * - * 08 03 2010 cp.wu - * NULL - * [Wi-Fi Direct] add framework for driver hooks - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 23 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * p2p interface revised to be sync. with HAL - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 06 01 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add ioctl to configure scan mode for p2p connection - * - * 05 31 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add cfg80211 interface, which is to replace WE, for further extension - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * implement private io controls for Wi-Fi Direct - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * implement get scan result. - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add basic handling framework for wireless extension ioctls. - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * 1) add timeout handler mechanism for pending command packets - * 2) add p2p add/removal key - * - * 05 14 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * implement wireless extension ioctls in iw_handler form. - * - * 05 14 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add ioctl framework for Wi-Fi Direct by reusing wireless extension ioctls as well - * - * 05 11 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * p2p ioctls revised. - * - * 05 11 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add ioctl for controlling p2p scan phase parameters - * - * 05 10 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * implement basic wi-fi direct framework - * - * 05 07 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add basic framework for implementating P2P driver hook. - * -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "gl_os.h" -#include "debug.h" -#include "wlan_lib.h" -#include "gl_wext.h" -#include - -#include -//#include -#include "gl_p2p_ioctl.h" - -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define ARGV_MAX_NUM (4) - -/*For CFG80211 - wiphy parameters*/ -#define MAX_SCAN_LIST_NUM (1) -#define MAX_SCAN_IE_LEN (512) - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -#if CFG_ENABLE_WIFI_DIRECT_CFG_80211 -/* for cfg80211 - frequency table */ -static struct ieee80211_channel mtk_2ghz_channels[] = { - CHAN2G(1, 2412, 0), - CHAN2G(2, 2417, 0), - CHAN2G(3, 2422, 0), - CHAN2G(4, 2427, 0), - CHAN2G(5, 2432, 0), - CHAN2G(6, 2437, 0), - CHAN2G(7, 2442, 0), - CHAN2G(8, 2447, 0), - CHAN2G(9, 2452, 0), - CHAN2G(10, 2457, 0), - CHAN2G(11, 2462, 0), - CHAN2G(12, 2467, 0), - CHAN2G(13, 2472, 0), - CHAN2G(14, 2484, 0), -}; - -static struct ieee80211_channel mtk_5ghz_a_channels[] = { - CHAN5G(34, 0), CHAN5G(36, 0), - CHAN5G(38, 0), CHAN5G(40, 0), - CHAN5G(42, 0), CHAN5G(44, 0), - CHAN5G(46, 0), CHAN5G(48, 0), - CHAN5G(52, 0), CHAN5G(56, 0), - CHAN5G(60, 0), CHAN5G(64, 0), - CHAN5G(100, 0), CHAN5G(104, 0), - CHAN5G(108, 0), CHAN5G(112, 0), - CHAN5G(116, 0), CHAN5G(120, 0), - CHAN5G(124, 0), CHAN5G(128, 0), - CHAN5G(132, 0), CHAN5G(136, 0), - CHAN5G(140, 0), CHAN5G(149, 0), - CHAN5G(153, 0), CHAN5G(157, 0), - CHAN5G(161, 0), CHAN5G(165, 0), - CHAN5G(169, 0), CHAN5G(173, 0), - CHAN5G(184, 0), CHAN5G(188, 0), - CHAN5G(192, 0), CHAN5G(196, 0), - CHAN5G(200, 0), CHAN5G(204, 0), - CHAN5G(208, 0), CHAN5G(212, 0), - CHAN5G(216, 0), -}; - -/* for cfg80211 - rate table */ -static struct ieee80211_rate mtk_rates[] = { - RATETAB_ENT(10, 0x1000, 0), - RATETAB_ENT(20, 0x1001, 0), - RATETAB_ENT(55, 0x1002, 0), - RATETAB_ENT(110, 0x1003, 0), /* 802.11b */ - RATETAB_ENT(60, 0x2000, 0), - RATETAB_ENT(90, 0x2001, 0), - RATETAB_ENT(120, 0x2002, 0), - RATETAB_ENT(180, 0x2003, 0), - RATETAB_ENT(240, 0x2004, 0), - RATETAB_ENT(360, 0x2005, 0), - RATETAB_ENT(480, 0x2006, 0), - RATETAB_ENT(540, 0x2007, 0), /* 802.11a/g */ -}; - -#define mtk_a_rates (mtk_rates + 4) -#define mtk_a_rates_size (sizeof(mtk_rates) / sizeof(mtk_rates[0]) - 4) -#define mtk_g_rates (mtk_rates + 0) -#define mtk_g_rates_size (sizeof(mtk_rates) / sizeof(mtk_rates[0]) - 0) - -#define MT6620_MCS_INFO \ -{ \ - /* MCS1~7*/ \ - .rx_mask = {0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0},\ - .rx_highest = 0, \ - .tx_params = IEEE80211_HT_MCS_TX_DEFINED, \ -} - -#if 0 -/*Bandwidth 20Mhz Only*/ -#define MT6620_HT_CAP \ -{ \ - .ht_supported = true, \ - .cap = IEEE80211_HT_CAP_SM_PS \ - | IEEE80211_HT_CAP_GRN_FLD \ - | IEEE80211_HT_CAP_SGI_20, \ - .ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K, \ - .ampdu_density = IEEE80211_HT_MPDU_DENSITY_NONE, \ - .mcs = MT6620_MCS_INFO, \ -} -#else -/*Bandwidth 20/40Mhz*/ -#define MT6620_HT_CAP \ -{ \ - .ht_supported = true, \ - .cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 \ - | IEEE80211_HT_CAP_SM_PS \ - | IEEE80211_HT_CAP_GRN_FLD \ - | IEEE80211_HT_CAP_SGI_20 \ - | IEEE80211_HT_CAP_SGI_40, \ - .ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K, \ - .ampdu_density = IEEE80211_HT_MPDU_DENSITY_NONE, \ - .mcs = MT6620_MCS_INFO, \ -} -#endif - -static struct ieee80211_supported_band mtk_band_2ghz = { - .band = IEEE80211_BAND_2GHZ, - .channels = mtk_2ghz_channels, - .n_channels = ARRAY_SIZE(mtk_2ghz_channels), - .bitrates = mtk_g_rates, - .n_bitrates = mtk_g_rates_size, - .ht_cap = MT6620_HT_CAP, -}; - -static struct ieee80211_supported_band mtk_band_5ghz = { - .band = IEEE80211_BAND_5GHZ, - .channels = mtk_5ghz_a_channels, - .n_channels = ARRAY_SIZE(mtk_5ghz_a_channels), - .bitrates = mtk_a_rates, - .n_bitrates = mtk_a_rates_size, - .ht_cap = MT6620_HT_CAP, -}; - -static const UINT_32 cipher_suites[] = { - /* keep WEP first, it may be removed below */ - WLAN_CIPHER_SUITE_WEP40, - WLAN_CIPHER_SUITE_WEP104, - WLAN_CIPHER_SUITE_TKIP, - WLAN_CIPHER_SUITE_CCMP, - - /* keep last -- depends on hw flags! */ - WLAN_CIPHER_SUITE_AES_CMAC -}; - -static struct cfg80211_ops mtk_p2p_config_ops = { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) && (CFG_ENABLE_WIFI_DIRECT_CFG_80211 != 0) - /* Froyo */ - .change_virtual_intf = mtk_p2p_cfg80211_change_iface, // 1 st - .change_bss = mtk_p2p_cfg80211_change_bss, - .scan = mtk_p2p_cfg80211_scan, - .remain_on_channel = mtk_p2p_cfg80211_remain_on_channel, - .cancel_remain_on_channel = mtk_p2p_cfg80211_cancel_remain_on_channel, - .mgmt_tx = mtk_p2p_cfg80211_mgmt_tx, - .connect = mtk_p2p_cfg80211_connect, - .disconnect = mtk_p2p_cfg80211_disconnect, - .deauth = mtk_p2p_cfg80211_deauth, - .disassoc = mtk_p2p_cfg80211_disassoc, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) - .start_ap = mtk_p2p_cfg80211_start_ap, - .change_beacon = mtk_p2p_cfg80211_change_beacon, - .stop_ap = mtk_p2p_cfg80211_stop_ap, -#else - .add_beacon = mtk_p2p_cfg80211_add_set_beacon, - .set_beacon = mtk_p2p_cfg80211_add_set_beacon, - .del_beacon = mtk_p2p_cfg80211_stop_ap, -#endif - .set_wiphy_params = mtk_p2p_cfg80211_set_wiphy_params, - .del_station = mtk_p2p_cfg80211_del_station, - .set_channel = mtk_p2p_cfg80211_set_channel, - .set_bitrate_mask = mtk_p2p_cfg80211_set_bitrate_mask, - .mgmt_frame_register = mtk_p2p_cfg80211_mgmt_frame_register, - .get_station = mtk_p2p_cfg80211_get_station, - // ================ - .add_key = mtk_p2p_cfg80211_add_key, - .get_key = mtk_p2p_cfg80211_get_key, - .del_key = mtk_p2p_cfg80211_del_key, - .set_default_key = mtk_p2p_cfg80211_set_default_key, - .join_ibss = mtk_p2p_cfg80211_join_ibss, - .leave_ibss = mtk_p2p_cfg80211_leave_ibss, - .set_tx_power = mtk_p2p_cfg80211_set_txpower, - .get_tx_power = mtk_p2p_cfg80211_get_txpower, - .set_power_mgmt = mtk_p2p_cfg80211_set_power_mgmt, - #ifdef CONFIG_NL80211_TESTMODE - .testmode_cmd = mtk_p2p_cfg80211_testmode_cmd, - #endif -#endif -}; - - - -/* There isn't a lot of sense in it, but you can transmit anything you like */ -static const struct ieee80211_txrx_stypes -mtk_cfg80211_default_mgmt_stypes[NUM_NL80211_IFTYPES] = { - [NL80211_IFTYPE_ADHOC] = { - .tx = 0xffff, - .rx = BIT(IEEE80211_STYPE_ACTION >> 4) - }, - [NL80211_IFTYPE_STATION] = { - .tx = 0xffff, - .rx = BIT(IEEE80211_STYPE_ACTION >> 4) | - BIT(IEEE80211_STYPE_PROBE_REQ >> 4) - }, - [NL80211_IFTYPE_AP] = { - .tx = 0xffff, - .rx = BIT(IEEE80211_STYPE_PROBE_REQ >> 4) | - BIT(IEEE80211_STYPE_ACTION >> 4) - }, - [NL80211_IFTYPE_AP_VLAN] = { - /* copy AP */ - .tx = 0xffff, - .rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) | - BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) | - BIT(IEEE80211_STYPE_PROBE_REQ >> 4) | - BIT(IEEE80211_STYPE_DISASSOC >> 4) | - BIT(IEEE80211_STYPE_AUTH >> 4) | - BIT(IEEE80211_STYPE_DEAUTH >> 4) | - BIT(IEEE80211_STYPE_ACTION >> 4) - }, - [NL80211_IFTYPE_P2P_CLIENT] = { - .tx = 0xffff, - .rx = BIT(IEEE80211_STYPE_ACTION >> 4) | - BIT(IEEE80211_STYPE_PROBE_REQ >> 4) - }, - [NL80211_IFTYPE_P2P_GO] = { - .tx = 0xffff, - .rx = BIT(IEEE80211_STYPE_PROBE_REQ >> 4) | - BIT(IEEE80211_STYPE_ACTION >> 4) - } -}; - - - -#endif - -/* the legacy wireless extension stuff */ -static const iw_handler rP2PIwStandardHandler[] = { - [SIOCGIWPRIV - SIOCIWFIRST] = mtk_p2p_wext_get_priv, - [SIOCGIWSCAN - SIOCIWFIRST] = mtk_p2p_wext_discovery_results, - [SIOCSIWESSID - SIOCIWFIRST] = mtk_p2p_wext_reconnect, - [SIOCSIWAUTH - SIOCIWFIRST] = mtk_p2p_wext_set_auth, - [SIOCSIWENCODEEXT - SIOCIWFIRST] = mtk_p2p_wext_set_key, - [SIOCSIWPOWER - SIOCIWFIRST] = mtk_p2p_wext_set_powermode, - [SIOCGIWPOWER - SIOCIWFIRST] = mtk_p2p_wext_get_powermode, - [SIOCSIWTXPOW - SIOCIWFIRST] = mtk_p2p_wext_set_txpow, -#if CFG_SUPPORT_P2P_RSSI_QUERY - [SIOCGIWSTATS - SIOCIWFIRST] = mtk_p2p_wext_get_rssi, -#endif - [SIOCSIWMLME - SIOCIWFIRST] = mtk_p2p_wext_mlme_handler, -}; - -static const iw_handler rP2PIwPrivHandler[] = { - [IOC_P2P_CFG_DEVICE - SIOCIWFIRSTPRIV] = mtk_p2p_wext_set_local_dev_info, - [IOC_P2P_PROVISION_COMPLETE - SIOCIWFIRSTPRIV] = mtk_p2p_wext_set_provision_complete, - [IOC_P2P_START_STOP_DISCOVERY - SIOCIWFIRSTPRIV] = mtk_p2p_wext_start_stop_discovery, - [IOC_P2P_DISCOVERY_RESULTS - SIOCIWFIRSTPRIV] = mtk_p2p_wext_discovery_results, - [IOC_P2P_WSC_BEACON_PROBE_RSP_IE - SIOCIWFIRSTPRIV] = mtk_p2p_wext_wsc_ie, - [IOC_P2P_CONNECT_DISCONNECT - SIOCIWFIRSTPRIV] = mtk_p2p_wext_connect_disconnect, - [IOC_P2P_PASSWORD_READY - SIOCIWFIRSTPRIV] = mtk_p2p_wext_password_ready, -// [IOC_P2P_SET_PWR_MGMT_PARAM - SIOCIWFIRSTPRIV] = mtk_p2p_wext_set_pm_param, - [IOC_P2P_SET_INT - SIOCIWFIRSTPRIV] = mtk_p2p_wext_set_int, - [IOC_P2P_GET_STRUCT - SIOCIWFIRSTPRIV] = mtk_p2p_wext_get_struct, - [IOC_P2P_SET_STRUCT - SIOCIWFIRSTPRIV] = mtk_p2p_wext_set_struct, - [IOC_P2P_GET_REQ_DEVICE_INFO - SIOCIWFIRSTPRIV] = mtk_p2p_wext_request_dev_info, -}; - - -static const struct iw_priv_args rP2PIwPrivTable[] = { - { - .cmd = IOC_P2P_CFG_DEVICE, - .set_args = IW_PRIV_TYPE_BYTE | (__u16)sizeof(IW_P2P_CFG_DEVICE_TYPE), - .get_args = IW_PRIV_TYPE_NONE, - .name = "P2P_CFG_DEVICE" - }, - { - .cmd = IOC_P2P_START_STOP_DISCOVERY, - .set_args = IW_PRIV_TYPE_BYTE | (__u16)sizeof(IW_P2P_REQ_DEVICE_TYPE), - .get_args = IW_PRIV_TYPE_NONE, - .name = "P2P_DISCOVERY" - }, - { - .cmd = IOC_P2P_DISCOVERY_RESULTS, - .set_args = IW_PRIV_TYPE_NONE, - .get_args = IW_PRIV_TYPE_NONE, - .name = "P2P_RESULT" - }, - { - .cmd = IOC_P2P_WSC_BEACON_PROBE_RSP_IE, - .set_args = IW_PRIV_TYPE_BYTE | (__u16)sizeof(IW_P2P_HOSTAPD_PARAM), - .get_args = IW_PRIV_TYPE_NONE, - .name = "P2P_WSC_IE" - }, - { - .cmd = IOC_P2P_CONNECT_DISCONNECT, - .set_args = IW_PRIV_TYPE_BYTE | (__u16)sizeof(IW_P2P_CONNECT_DEVICE), - .get_args = IW_PRIV_TYPE_NONE, - .name = "P2P_CONNECT" - }, - { - .cmd = IOC_P2P_PASSWORD_READY, - .set_args = IW_PRIV_TYPE_BYTE | (__u16)sizeof(IW_P2P_PASSWORD_READY), - .get_args = IW_PRIV_TYPE_NONE, - .name = "P2P_PASSWD_RDY" - }, - { - .cmd = IOC_P2P_GET_STRUCT, - .set_args = IW_PRIV_TYPE_NONE, - .get_args = 256, - .name = "P2P_GET_STRUCT" - }, - { - .cmd = IOC_P2P_SET_STRUCT, - .set_args = 256, - .get_args = IW_PRIV_TYPE_NONE, - .name = "P2P_SET_STRUCT" - }, - { - .cmd = IOC_P2P_GET_REQ_DEVICE_INFO, - .set_args = IW_PRIV_TYPE_NONE, - .get_args = IW_PRIV_TYPE_BYTE | (__u16)sizeof(IW_P2P_DEVICE_REQ), - .name = "P2P_GET_REQDEV" - }, - { - /* SET STRUCT sub-ioctls commands */ - .cmd = PRIV_CMD_OID, - .set_args = 256, - .get_args = IW_PRIV_TYPE_NONE, - .name = "set_oid" - }, - { - /* GET STRUCT sub-ioctls commands */ - .cmd = PRIV_CMD_OID, - .set_args = IW_PRIV_TYPE_NONE, - .get_args = 256, - .name = "get_oid" - } -}; - -const struct iw_handler_def mtk_p2p_wext_handler_def = { - .num_standard = (__u16)sizeof(rP2PIwStandardHandler)/sizeof(iw_handler), - .num_private = (__u16)sizeof(rP2PIwPrivHandler)/sizeof(iw_handler), - .num_private_args = (__u16)sizeof(rP2PIwPrivTable)/sizeof(struct iw_priv_args), - .standard = rP2PIwStandardHandler, - .private = rP2PIwPrivHandler, - .private_args = rP2PIwPrivTable, -#if CFG_SUPPORT_P2P_RSSI_QUERY - .get_wireless_stats = mtk_p2p_wext_get_wireless_stats, -#else - .get_wireless_stats = NULL, -#endif -}; - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -/* for IE Searching */ -extern BOOLEAN -wextSrchDesiredWPAIE ( - IN PUINT_8 pucIEStart, - IN INT_32 i4TotalIeLen, - IN UINT_8 ucDesiredElemId, - OUT PUINT_8 *ppucDesiredIE - ); - -#if CFG_SUPPORT_WPS -extern BOOLEAN -wextSrchDesiredWPSIE ( - IN PUINT_8 pucIEStart, - IN INT_32 i4TotalIeLen, - IN UINT_8 ucDesiredElemId, - OUT PUINT_8 *ppucDesiredIE - ); -#endif - -/* Net Device Hooks */ -static int -p2pOpen( - IN struct net_device *prDev - ); - -static int -p2pStop( - IN struct net_device *prDev - ); - -static struct net_device_stats * -p2pGetStats ( - IN struct net_device *prDev - ); - -static void -p2pSetMulticastList( - IN struct net_device *prDev - ); - -static int -p2pHardStartXmit( - IN struct sk_buff *prSkb, - IN struct net_device *prDev - ); - -static int -p2pDoIOCTL( - struct net_device *prDev, - struct ifreq *prIFReq, - int i4Cmd - ); - -static int -p2pSetMACAddress( - IN struct net_device *prDev, - void *addr - ); - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Override the implementation of select queue -* -* \param[in] dev Pointer to struct net_device -* \param[in] skb Pointer to struct skb_buff -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ - -unsigned int _p2p_cfg80211_classify8021d(struct sk_buff *skb) -{ - unsigned int dscp = 0; - - /* skb->priority values from 256->263 are magic values - * directly indicate a specific 802.1d priority. This is - * to allow 802.1d priority to be passed directly in from - * tags - */ - - if (skb->priority >= 256 && skb->priority <= 263) { - return skb->priority - 256; - } - switch (skb->protocol) { - case htons(ETH_P_IP): - dscp = ip_hdr(skb)->tos & 0xfc; - break; - } - return dscp >> 5; -} - - -static const UINT_16 au16Wlan1dToQueueIdx[8] = { 1, 0, 0, 1, 2, 2, 3, 3 }; - -static UINT_16 -p2pSelectQueue( - struct net_device *dev, - struct sk_buff *skb) -{ - skb->priority = _p2p_cfg80211_classify8021d(skb); - - return au16Wlan1dToQueueIdx[skb->priority]; -} - -static struct net_device *g_P2pPrDev; - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief A function for prDev->init -* -* \param[in] prDev Pointer to struct net_device. -* -* \retval 0 The execution of wlanInit succeeds. -* \retval -ENXIO No such device. -*/ -/*----------------------------------------------------------------------------*/ -static int -p2pInit( - struct net_device *prDev - ) -{ - if (!prDev) { - return -ENXIO; - } - - return 0; /* success */ -} /* end of p2pInit() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief A function for prDev->uninit -* -* \param[in] prDev Pointer to struct net_device. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -static void -p2pUninit ( - IN struct net_device *prDev - ) -{ - - - return; -} /* end of p2pUninit() */ - - - - - - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31) -static const struct net_device_ops p2p_netdev_ops = { - .ndo_open = p2pOpen, - .ndo_stop = p2pStop, - .ndo_set_mac_address = p2pSetMACAddress, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) - .ndo_set_rx_mode = p2pSetMulticastList, -#else - .ndo_set_multicast_list = p2pSetMulticastList, -#endif - .ndo_get_stats = p2pGetStats, - .ndo_do_ioctl = p2pDoIOCTL, - .ndo_start_xmit = p2pHardStartXmit, - .ndo_select_queue = p2pSelectQueue, - .ndo_init = p2pInit, - .ndo_uninit = p2pUninit, -}; - - -#endif - - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Allocate memory for P2P_INFO, GL_P2P_INFO, P2P_CONNECTION_SETTINGS -* P2P_SPECIFIC_BSS_INFO, P2P_FSM_INFO -* -* \param[in] prGlueInfo Pointer to glue info -* -* \return TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -p2PAllocInfo ( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - P_ADAPTER_T prAdapter = NULL; - P_WIFI_VAR_T prWifiVar = NULL; - - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - prWifiVar = &(prAdapter->rWifiVar); - - ASSERT(prAdapter); - ASSERT(prWifiVar); - - do { - if (prGlueInfo == NULL) { - break; - } - - if (prGlueInfo->prP2PInfo == NULL) { - /*alloc memory for p2p info */ - prGlueInfo->prP2PInfo = - kalMemAlloc(sizeof(GL_P2P_INFO_T), VIR_MEM_TYPE); - prAdapter->prP2pInfo = - kalMemAlloc(sizeof(P2P_INFO_T), VIR_MEM_TYPE); - prWifiVar->prP2PConnSettings = - kalMemAlloc(sizeof(P2P_CONNECTION_SETTINGS_T),VIR_MEM_TYPE); - prWifiVar->prP2pFsmInfo = - kalMemAlloc(sizeof(P2P_FSM_INFO_T),VIR_MEM_TYPE); - prWifiVar->prP2pSpecificBssInfo = - kalMemAlloc(sizeof(P2P_SPECIFIC_BSS_INFO_T),VIR_MEM_TYPE); - } - else { - ASSERT(prAdapter->prP2pInfo != NULL); - ASSERT(prWifiVar->prP2PConnSettings != NULL); - ASSERT(prWifiVar->prP2pFsmInfo != NULL); - ASSERT(prWifiVar->prP2pSpecificBssInfo != NULL); - } - /*MUST set memory to 0 */ - kalMemZero(prGlueInfo->prP2PInfo, sizeof(GL_P2P_INFO_T)); - kalMemZero(prAdapter->prP2pInfo, sizeof(P2P_INFO_T)); - kalMemZero(prWifiVar->prP2PConnSettings, sizeof(P2P_CONNECTION_SETTINGS_T)); - kalMemZero(prWifiVar->prP2pFsmInfo, sizeof(P2P_FSM_INFO_T)); - kalMemZero(prWifiVar->prP2pSpecificBssInfo, sizeof(P2P_SPECIFIC_BSS_INFO_T)); - - } while (FALSE); - - - /* chk if alloc successful or not*/ - if (prGlueInfo->prP2PInfo && - prAdapter->prP2pInfo && - prWifiVar->prP2PConnSettings && - prWifiVar->prP2pFsmInfo && - prWifiVar->prP2pSpecificBssInfo) { - return TRUE; - } - else { - - if (prWifiVar->prP2pSpecificBssInfo) { - kalMemFree(prWifiVar->prP2pSpecificBssInfo, VIR_MEM_TYPE, sizeof(P2P_SPECIFIC_BSS_INFO_T)); - - prWifiVar->prP2pSpecificBssInfo = NULL; - } - if (prWifiVar->prP2pFsmInfo) { - kalMemFree(prWifiVar->prP2pFsmInfo, VIR_MEM_TYPE, sizeof(P2P_FSM_INFO_T)); - - prWifiVar->prP2pFsmInfo = NULL; - } - if (prWifiVar->prP2PConnSettings) { - kalMemFree(prWifiVar->prP2PConnSettings, VIR_MEM_TYPE, sizeof(P2P_CONNECTION_SETTINGS_T)); - - prWifiVar->prP2PConnSettings = NULL; - } - if (prGlueInfo->prP2PInfo) { - kalMemFree(prGlueInfo->prP2PInfo, VIR_MEM_TYPE, sizeof(GL_P2P_INFO_T)); - - prGlueInfo->prP2PInfo = NULL; - } - if (prAdapter->prP2pInfo) { - kalMemFree(prAdapter->prP2pInfo, VIR_MEM_TYPE, sizeof(P2P_INFO_T)); - - prAdapter->prP2pInfo = NULL; - } - return FALSE; - } - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Free memory for P2P_INFO, GL_P2P_INFO, P2P_CONNECTION_SETTINGS -* P2P_SPECIFIC_BSS_INFO, P2P_FSM_INFO -* -* \param[in] prGlueInfo Pointer to glue info -* -* \return TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -p2PFreeInfo( - P_GLUE_INFO_T prGlueInfo - ) -{ - - ASSERT(prGlueInfo); - ASSERT(prGlueInfo->prAdapter); - - /* free memory after p2p module is ALREADY unregistered */ - if(prGlueInfo->prAdapter->fgIsP2PRegistered == FALSE) { - - kalMemFree(prGlueInfo->prAdapter->prP2pInfo, VIR_MEM_TYPE, sizeof(P2P_INFO_T)); - kalMemFree(prGlueInfo->prP2PInfo, VIR_MEM_TYPE, sizeof(GL_P2P_INFO_T)); - kalMemFree(prGlueInfo->prAdapter->rWifiVar.prP2PConnSettings, VIR_MEM_TYPE, sizeof(P2P_CONNECTION_SETTINGS_T)); - kalMemFree(prGlueInfo->prAdapter->rWifiVar.prP2pFsmInfo, VIR_MEM_TYPE, sizeof(P2P_FSM_INFO_T)); - kalMemFree(prGlueInfo->prAdapter->rWifiVar.prP2pSpecificBssInfo, VIR_MEM_TYPE, sizeof(P2P_SPECIFIC_BSS_INFO_T)); - - /*Reomve p2p bss scan list*/ - scanRemoveAllP2pBssDesc(prGlueInfo->prAdapter); - - /*reset all pointer to NULL */ - prGlueInfo->prP2PInfo = NULL; - prGlueInfo->prAdapter->prP2pInfo = NULL; - prGlueInfo->prAdapter->rWifiVar.prP2PConnSettings = NULL; - prGlueInfo->prAdapter->rWifiVar.prP2pFsmInfo = NULL; - prGlueInfo->prAdapter->rWifiVar.prP2pSpecificBssInfo = NULL; - - return TRUE; - } - else { - return FALSE; - } - -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Enable Channel for cfg80211 for Wi-Fi Direct based on current country code -* -* \param[in] prGlueInfo Pointer to glue info -* -* \return TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pEnableChannel( - PUINT_8 pucChIdx, - UINT_8 ucChannelNum, - struct ieee80211_channel *mtk_channels, - UINT_8 mtk_channel_sz -) -{ - UINT_8 ucCurChIdx = *pucChIdx; - - while(TRUE) { - (*pucChIdx)++; - (*pucChIdx) %= mtk_channel_sz; - - if(ucChannelNum == mtk_channels[*pucChIdx].hw_value) { - mtk_channels[*pucChIdx].flags &= ~IEEE80211_CHAN_DISABLED; - break; - } - - if(*pucChIdx == ucCurChIdx) { - printk(KERN_ALERT DRV_NAME "Orphan channel [%d]\n", ucChannelNum); - break; - } - } -} - - -BOOLEAN -p2pNetRegister( - P_GLUE_INFO_T prGlueInfo, - BOOLEAN fgIsRtnlLockAcquired - ) -{ - BOOLEAN fgDoRegister = FALSE; - BOOLEAN fgRollbackRtnlLock = FALSE; - BOOLEAN ret; - - GLUE_SPIN_LOCK_DECLARATION(); - - ASSERT(prGlueInfo); - ASSERT(prGlueInfo->prAdapter); - - - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_NET_DEV); - if(prGlueInfo->prAdapter->rP2PNetRegState == ENUM_NET_REG_STATE_UNREGISTERED) { - prGlueInfo->prAdapter->rP2PNetRegState = ENUM_NET_REG_STATE_REGISTERING; - fgDoRegister = TRUE; - } - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_NET_DEV); - - if(!fgDoRegister) { - return TRUE; - } - - if(fgIsRtnlLockAcquired && rtnl_is_locked()) { - fgRollbackRtnlLock = TRUE; - rtnl_unlock(); - } - - /* Here are functions which need rtnl_lock */ - wiphy_register(prGlueInfo->prP2PInfo->wdev.wiphy); - - /* net device initialize */ - netif_carrier_off(prGlueInfo->prP2PInfo->prDevHandler); - netif_tx_stop_all_queues(prGlueInfo->prP2PInfo->prDevHandler); - - /* register for net device */ - if (register_netdev(prGlueInfo->prP2PInfo->prDevHandler) < 0) { - printk(KERN_ALERT DRV_NAME "unable to register netdevice for p2p\n"); - - free_netdev(prGlueInfo->prP2PInfo->prDevHandler); - - ret = FALSE; - } - else { - prGlueInfo->prAdapter->rP2PNetRegState = ENUM_NET_REG_STATE_REGISTERED; - ret = TRUE; - } - - if(fgRollbackRtnlLock) { - rtnl_lock(); - } - - return ret; -} - -BOOLEAN -p2pNetUnregister( - P_GLUE_INFO_T prGlueInfo, - BOOLEAN fgIsRtnlLockAcquired - ) -{ - BOOLEAN fgDoUnregister = FALSE; - BOOLEAN fgRollbackRtnlLock = FALSE; - - GLUE_SPIN_LOCK_DECLARATION(); - - ASSERT(prGlueInfo); - ASSERT(prGlueInfo->prAdapter); - - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_NET_DEV); - if(prGlueInfo->prAdapter->rP2PNetRegState == ENUM_NET_REG_STATE_REGISTERED) { - prGlueInfo->prAdapter->rP2PNetRegState = ENUM_NET_REG_STATE_UNREGISTERING; - fgDoUnregister = TRUE; - } - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_NET_DEV); - - if(!fgDoUnregister) { - return TRUE; - } - - /* prepare for removal */ - if(netif_carrier_ok(prGlueInfo->prP2PInfo->prDevHandler)) { - netif_carrier_off(prGlueInfo->prP2PInfo->prDevHandler); - } - - netif_tx_stop_all_queues(prGlueInfo->prP2PInfo->prDevHandler); - - if(fgIsRtnlLockAcquired && rtnl_is_locked()) { - fgRollbackRtnlLock = TRUE; - rtnl_unlock(); - } - /* Here are functions which need rtnl_lock */ - - unregister_netdev(prGlueInfo->prP2PInfo->prDevHandler); - - wiphy_unregister(prGlueInfo->prP2PInfo->wdev.wiphy); - - if(fgRollbackRtnlLock) { - rtnl_lock(); - } - - prGlueInfo->prAdapter->rP2PNetRegState = ENUM_NET_REG_STATE_UNREGISTERED; - - return TRUE; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Update Channel table for cfg80211 for Wi-Fi Direct based on current country code -* -* \param[in] prGlueInfo Pointer to glue info -* -* \return TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pUpdateChannelTableByDomain( - P_GLUE_INFO_T prGlueInfo - ) -{ - UINT_8 i, uc2gChIdx, uc5gChIdx; - UINT_8 ucMaxChannelNum = ARRAY_SIZE(mtk_2ghz_channels) + ARRAY_SIZE(mtk_5ghz_a_channels); - UINT_8 ucNumOfChannel = ucMaxChannelNum; - RF_CHANNEL_INFO_T aucChannelList[ucMaxChannelNum]; - - uc2gChIdx = uc5gChIdx = 0; - - // 1. Disable all channel - for(i = 0; i < ARRAY_SIZE(mtk_2ghz_channels); i++) { - mtk_2ghz_channels[i].flags |= IEEE80211_CHAN_DISABLED; - } - for(i = 0; i < ARRAY_SIZE(mtk_5ghz_a_channels); i++) { - mtk_5ghz_a_channels[i].flags |= IEEE80211_CHAN_DISABLED; - } - - // 2. Get current domain channel list - rlmDomainGetChnlList(prGlueInfo->prAdapter, BAND_NULL, ucMaxChannelNum, &ucNumOfChannel, aucChannelList); - - // 3. Enable specific channel based on domain channel list - for(i = 0; i < ucNumOfChannel; i++) { - switch(aucChannelList[i].eBand) { - case BAND_2G4: - p2pEnableChannel(&uc2gChIdx, aucChannelList[i].ucChannelNum, mtk_2ghz_channels, ARRAY_SIZE(mtk_2ghz_channels)); - break; - - case BAND_5G: - p2pEnableChannel(&uc5gChIdx, aucChannelList[i].ucChannelNum, mtk_5ghz_a_channels, ARRAY_SIZE(mtk_5ghz_a_channels)); - break; - - default: - printk(KERN_ALERT DRV_NAME "Unknow band.\n"); - break; - - } - } - -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Register for cfg80211 for Wi-Fi Direct -* -* \param[in] prGlueInfo Pointer to glue info -* -* \return TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -glRegisterP2P( - P_GLUE_INFO_T prGlueInfo, - const char *prDevName, - BOOLEAN fgIsApMode - ) -{ - P_ADAPTER_T prAdapter = NULL; - P_GL_HIF_INFO_T prHif = NULL; - PARAM_MAC_ADDRESS rMacAddr; -#if CFG_ENABLE_WIFI_DIRECT_CFG_80211 - struct device *prDev; -#endif - - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - prHif = &prGlueInfo->rHifInfo; - ASSERT(prHif); - - printk("glRegisterP2P\n"); - - /*0. allocate p2pinfo */ - if(!p2PAllocInfo(prGlueInfo)) { - printk(KERN_ALERT DRV_NAME "Allocate memory for p2p FAILED\n"); - ASSERT(0); - return FALSE; - } -#if CFG_ENABLE_WIFI_DIRECT_CFG_80211 - /* 1. allocate WIPHY */ - prGlueInfo->prP2PInfo->wdev.wiphy = wiphy_new(&mtk_p2p_config_ops, sizeof(P_GLUE_INFO_T)); - if (!prGlueInfo->prP2PInfo->wdev.wiphy) { - printk(KERN_ALERT DRV_NAME "unable to allocate wiphy for p2p\n"); - - goto err_alloc_wiphy; - } - - /* 1.1 fill wiphy parameters */ -#if MTK_WCN_HIF_SDIO - mtk_wcn_hif_sdio_get_dev(prHif->cltCtx, &prDev); - if(!prDev) { - printk(KERN_ALERT DRV_NAME "unable to get struct dev for p2p\n"); - } -#else - prDev = &(prHif->func->dev); -#endif - set_wiphy_dev(prGlueInfo->prP2PInfo->wdev.wiphy, prDev); - - prGlueInfo->prP2PInfo->wdev.wiphy->interface_modes = BIT(NL80211_IFTYPE_AP) - | BIT(NL80211_IFTYPE_P2P_CLIENT) - | BIT(NL80211_IFTYPE_P2P_GO) - | BIT(NL80211_IFTYPE_STATION); - - p2pUpdateChannelTableByDomain(prGlueInfo); - prGlueInfo->prP2PInfo->wdev.wiphy->bands[IEEE80211_BAND_2GHZ] = &mtk_band_2ghz; - if(prAdapter->fgEnable5GBand) { - prGlueInfo->prP2PInfo->wdev.wiphy->bands[IEEE80211_BAND_5GHZ] = &mtk_band_5ghz; - } - - prGlueInfo->prP2PInfo->wdev.wiphy->mgmt_stypes = mtk_cfg80211_default_mgmt_stypes; - prGlueInfo->prP2PInfo->wdev.wiphy->max_remain_on_channel_duration = 5000; - prGlueInfo->prP2PInfo->wdev.wiphy->n_cipher_suites = 5; - prGlueInfo->prP2PInfo->wdev.wiphy->cipher_suites = (const u32*)cipher_suites; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) - prGlueInfo->prP2PInfo->wdev.wiphy->flags = WIPHY_FLAG_CUSTOM_REGULATORY | WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; -#else - prGlueInfo->prP2PInfo->wdev.wiphy->flags = WIPHY_FLAG_CUSTOM_REGULATORY; -#endif - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) - prGlueInfo->prP2PInfo->wdev.wiphy->max_scan_ssids = MAX_SCAN_LIST_NUM; - prGlueInfo->prP2PInfo->wdev.wiphy->max_scan_ie_len = MAX_SCAN_IE_LEN; - prGlueInfo->prP2PInfo->wdev.wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; -#endif - -#if 0 - /* 2. Register WIPHY */ - if(wiphy_register(prGlueInfo->prP2PInfo->wdev.wiphy) < 0) { - printk(KERN_ALERT DRV_NAME "Couldn't register wiphy device for p2p\n"); - - goto err_reg_wiphy; - } -#endif - - /* 2.1 set priv as pointer to glue structure */ - *((P_GLUE_INFO_T *) wiphy_priv(prGlueInfo->prP2PInfo->wdev.wiphy)) = prGlueInfo; - - /* 2.2 wdev initialization */ - if(fgIsApMode) { - prGlueInfo->prP2PInfo->wdev.iftype = NL80211_IFTYPE_AP; - } else { - prGlueInfo->prP2PInfo->wdev.iftype = NL80211_IFTYPE_P2P_CLIENT; - } - -#endif /* CFG_ENABLE_WIFI_DIRECT_CFG_80211 */ - - /* 3. allocate netdev */ - prGlueInfo->prP2PInfo->prDevHandler = alloc_netdev_mq(sizeof(P_GLUE_INFO_T), prDevName, ether_setup, CFG_MAX_TXQ_NUM); - if (!prGlueInfo->prP2PInfo->prDevHandler) { - printk(KERN_ALERT DRV_NAME "unable to allocate netdevice for p2p\n"); - - printk("unable to allocate netdevice for p2p\n"); - - goto err_alloc_netdev; - } - - /* 4. setup netdev */ - /* 4.1 Point to shared glue structure */ - *((P_GLUE_INFO_T *) netdev_priv(prGlueInfo->prP2PInfo->prDevHandler)) = prGlueInfo; - - /* 4.2 fill hardware address */ - COPY_MAC_ADDR(rMacAddr, prAdapter->rMyMacAddr); - rMacAddr[0] ^= 0x2; // change to local administrated address - memcpy(prGlueInfo->prP2PInfo->prDevHandler->dev_addr, rMacAddr, ETH_ALEN); - memcpy(prGlueInfo->prP2PInfo->prDevHandler->perm_addr, prGlueInfo->prP2PInfo->prDevHandler->dev_addr, ETH_ALEN); - - /* 4.3 register callback functions */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31) - prGlueInfo->prP2PInfo->prDevHandler->netdev_ops = &p2p_netdev_ops; -#else - prGlueInfo->prP2PInfo->prDevHandler->open = p2pOpen; - prGlueInfo->prP2PInfo->prDevHandler->stop = p2pStop; - prGlueInfo->prP2PInfo->prDevHandler->get_stats = p2pGetStats; - prGlueInfo->prP2PInfo->prDevHandler->set_multicast_list = p2pSetMulticastList; - prGlueInfo->prP2PInfo->prDevHandler->hard_start_xmit = p2pHardStartXmit; - prGlueInfo->prP2PInfo->prDevHandler->do_ioctl = p2pDoIOCTL; - prGlueInfo->prP2PInfo->prDevHandler->set_mac_address = p2pSetMACAddress; -#endif -// prGlueInfo->prP2PInfo->prDevHandler->wireless_handlers = &mtk_p2p_wext_handler_def; - - -#if (MTK_WCN_HIF_SDIO == 0) - SET_NETDEV_DEV(prGlueInfo->prP2PInfo->prDevHandler, &(prHif->func->dev)); -#endif - - -#if CFG_ENABLE_WIFI_DIRECT_CFG_80211 - prGlueInfo->prP2PInfo->prDevHandler->ieee80211_ptr = &(prGlueInfo->prP2PInfo->wdev); - prGlueInfo->prP2PInfo->wdev.netdev = prGlueInfo->prP2PInfo->prDevHandler; -#endif - -#if CFG_TCP_IP_CHKSUM_OFFLOAD - prGlueInfo->prP2PInfo->prDevHandler->features = NETIF_F_IP_CSUM; -#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */ - -#if 0 - /* 7. net device initialize */ - netif_carrier_off(prGlueInfo->prP2PInfo->prDevHandler); - netif_tx_stop_all_queues(prGlueInfo->prP2PInfo->prDevHandler); - - /* 8. register for net device */ - if (register_netdev(prGlueInfo->prP2PInfo->prDevHandler) < 0) { - printk(KERN_ALERT DRV_NAME "unable to register netdevice for p2p\n"); - - goto err_reg_netdev; - } -#endif - - /* 8. set p2p net device register state */ - prGlueInfo->prAdapter->rP2PNetRegState = ENUM_NET_REG_STATE_UNREGISTERED; - - /* 9. setup running mode*/ - prGlueInfo->prAdapter->rWifiVar.prP2pFsmInfo->fgIsApMode = fgIsApMode; - - /* 10. finish */ - p2pFsmInit(prAdapter); - - p2pFuncInitConnectionSettings(prAdapter, prAdapter->rWifiVar.prP2PConnSettings); - - /* Active network too early would cause HW not able to sleep. - * Defer the network active time. - */ -// nicActivateNetwork(prAdapter, NETWORK_TYPE_P2P_INDEX); - - return TRUE; -#if 0 -err_reg_netdev: - free_netdev(prGlueInfo->prP2PInfo->prDevHandler); -#endif -err_alloc_netdev: -#if CFG_ENABLE_WIFI_DIRECT_CFG_80211 -// wiphy_unregister(prGlueInfo->prP2PInfo->wdev.wiphy); - -//err_reg_wiphy: - wiphy_free(prGlueInfo->prP2PInfo->wdev.wiphy); - prGlueInfo->prP2PInfo->wdev.wiphy = NULL; - -err_alloc_wiphy: -#endif - - return FALSE; -} /* end of glRegisterP2P() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Unregister Net Device for Wi-Fi Direct -* -* \param[in] prGlueInfo Pointer to glue info -* -* \return TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -glUnregisterP2P( - P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - p2pFsmUninit(prGlueInfo->prAdapter); - - nicDeactivateNetwork(prGlueInfo->prAdapter, NETWORK_TYPE_P2P_INDEX); - -#if 0 - /* Release command, mgmt and security frame belong to P2P network in - * prGlueInfo->prCmdQue - * prAdapter->rPendingCmdQueue - * prAdapter->rTxCtrl.rTxMgmtTxingQueue - * To ensure there is no pending CmdDone/TxDone handler to be executed after p2p module is removed. - */ - - /* Clear CmdQue*/ - kalClearMgmtFramesByNetType(prGlueInfo, NETWORK_TYPE_P2P_INDEX); - kalClearSecurityFramesByNetType(prGlueInfo, NETWORK_TYPE_P2P_INDEX); - /* Clear PendingCmdQue*/ - wlanReleasePendingCMDbyNetwork(prGlueInfo->prAdapter, NETWORK_TYPE_P2P_INDEX); - /* Clear PendingTxMsdu */ - nicFreePendingTxMsduInfoByNetwork(prGlueInfo->prAdapter, NETWORK_TYPE_P2P_INDEX); -#endif - -#if 0 - /* prepare for removal */ - if(netif_carrier_ok(prGlueInfo->prP2PInfo->prDevHandler)) { - netif_carrier_off(prGlueInfo->prP2PInfo->prDevHandler); - } - - netif_tx_stop_all_queues(prGlueInfo->prP2PInfo->prDevHandler); - - /* netdevice unregistration & free */ - unregister_netdev(prGlueInfo->prP2PInfo->prDevHandler); -#endif - free_netdev(prGlueInfo->prP2PInfo->prDevHandler); - prGlueInfo->prP2PInfo->prDevHandler = NULL; - -#if CFG_ENABLE_WIFI_DIRECT_CFG_80211 -#if 0 - wiphy_unregister(prGlueInfo->prP2PInfo->wdev.wiphy); -#endif - wiphy_free(prGlueInfo->prP2PInfo->wdev.wiphy); - prGlueInfo->prP2PInfo->wdev.wiphy = NULL; -#endif - - /* Free p2p memory */ -#if 1 - if(!p2PFreeInfo(prGlueInfo)) { - printk(KERN_ALERT DRV_NAME "Free memory for p2p FAILED\n"); - ASSERT(0); - return FALSE; - } -#endif - return TRUE; - -} /* end of glUnregisterP2P() */ - - -/*----------------------------------------------------------------------------*/ -/*! - * \brief A function for stop p2p fsm immediate - * - * \param[in] prGlueInfo Pointer to struct P_GLUE_INFO_T. - * - * \retval TRUE The execution succeeds. - * \retval FALSE The execution failed. - */ -/*----------------------------------------------------------------------------*/ -BOOLEAN -p2pStopImmediate( - P_GLUE_INFO_T prGlueInfo - ) -{ -// P_ADAPTER_T prAdapter = NULL; -// P_MSG_P2P_FUNCTION_SWITCH_T prFuncSwitch; - - ASSERT(prGlueInfo); - -// prAdapter = prGlueInfo->prAdapter; -// ASSERT(prAdapter); - - /* 1. stop TX queue */ - netif_tx_stop_all_queues(prGlueInfo->prP2PInfo->prDevHandler); - - -#if 0 - /* 2. switch P2P-FSM off */ - /* 2.1 allocate for message */ - prFuncSwitch = (P_MSG_P2P_FUNCTION_SWITCH_T) cnmMemAlloc( - prAdapter, - RAM_TYPE_MSG, - sizeof(MSG_P2P_FUNCTION_SWITCH_T)); - - if (!prFuncSwitch) { - ASSERT(0); // Can't trigger P2P FSM - printk(KERN_ALERT DRV_NAME "Allocate for p2p mesasage FAILED\n"); - //return -ENOMEM; - } - - /* 2.2 fill message */ - prFuncSwitch->rMsgHdr.eMsgId = MID_MNY_P2P_FUN_SWITCH; - prFuncSwitch->fgIsFuncOn = FALSE; - - /* 2.3 send message */ - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prFuncSwitch, - MSG_SEND_METHOD_UNBUF); - -#endif - - /* 3. stop queue and turn off carrier */ - prGlueInfo->prP2PInfo->eState = PARAM_MEDIA_STATE_DISCONNECTED; - - return TRUE; -} /* end of p2pStop() */ - - -/* Net Device Hooks */ -/*----------------------------------------------------------------------------*/ -/*! - * \brief A function for net_device open (ifup) - * - * \param[in] prDev Pointer to struct net_device. - * - * \retval 0 The execution succeeds. - * \retval < 0 The execution failed. - */ -/*----------------------------------------------------------------------------*/ -static int -p2pOpen( - IN struct net_device *prDev - ) -{ -// P_GLUE_INFO_T prGlueInfo = NULL; -// P_ADAPTER_T prAdapter = NULL; -// P_MSG_P2P_FUNCTION_SWITCH_T prFuncSwitch; - - ASSERT(prDev); - -#if 0 // Move after device name set. (mtk_p2p_set_local_dev_info) - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - /* 1. switch P2P-FSM on */ - /* 1.1 allocate for message */ - prFuncSwitch = (P_MSG_P2P_FUNCTION_SWITCH_T) cnmMemAlloc(prAdapter, - RAM_TYPE_MSG, - sizeof(MSG_P2P_FUNCTION_SWITCH_T)); - - if (!prFuncSwitch) { - ASSERT(0); // Can't trigger P2P FSM - return -ENOMEM; - } - - /* 1.2 fill message */ - prFuncSwitch->rMsgHdr.eMsgId = MID_MNY_P2P_FUN_SWITCH; - prFuncSwitch->fgIsFuncOn = TRUE; - - /* 1.3 send message */ - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prFuncSwitch, - MSG_SEND_METHOD_BUF); -#endif - - /* 2. carrier on & start TX queue */ - netif_carrier_on(prDev); - netif_tx_start_all_queues(prDev); - - return 0; /* success */ -} /* end of p2pOpen() */ - - -/*----------------------------------------------------------------------------*/ -/*! - * \brief A function for net_device stop (ifdown) - * - * \param[in] prDev Pointer to struct net_device. - * - * \retval 0 The execution succeeds. - * \retval < 0 The execution failed. - */ -/*----------------------------------------------------------------------------*/ -static int -p2pStop( - IN struct net_device *prDev - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - P_ADAPTER_T prAdapter = NULL; -// P_MSG_P2P_FUNCTION_SWITCH_T prFuncSwitch; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - /* 1. stop TX queue */ - netif_tx_stop_all_queues(prDev); -#if 0 - /* 2. switch P2P-FSM off */ - /* 2.1 allocate for message */ - prFuncSwitch = (P_MSG_P2P_FUNCTION_SWITCH_T) cnmMemAlloc(prAdapter, - RAM_TYPE_MSG, - sizeof(MSG_P2P_FUNCTION_SWITCH_T)); - - if (!prFuncSwitch) { - ASSERT(0); // Can't trigger P2P FSM - return -ENOMEM; - } - - /* 2.2 fill message */ - prFuncSwitch->rMsgHdr.eMsgId = MID_MNY_P2P_FUN_SWITCH; - prFuncSwitch->fgIsFuncOn = FALSE; - - /* 2.3 send message */ - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prFuncSwitch, - MSG_SEND_METHOD_BUF); -#endif - /* 3. stop queue and turn off carrier */ - prGlueInfo->prP2PInfo->eState = PARAM_MEDIA_STATE_DISCONNECTED; - - netif_tx_stop_all_queues(prDev); - if(netif_carrier_ok(prDev)) { - netif_carrier_off(prDev); - } - - return 0; -} /* end of p2pStop() */ - - -/*----------------------------------------------------------------------------*/ -/*! - * \brief A method of struct net_device, to get the network interface statistical - * information. - * - * Whenever an application needs to get statistics for the interface, this method - * is called. This happens, for example, when ifconfig or netstat -i is run. - * - * \param[in] prDev Pointer to struct net_device. - * - * \return net_device_stats buffer pointer. - */ -/*----------------------------------------------------------------------------*/ -struct net_device_stats * -p2pGetStats ( - IN struct net_device *prDev - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - -#if 1 // frog temp fix - //@FIXME - //prDev->stats.rx_packets = 0; - //prDev->stats.tx_packets = 0; - prDev->stats.tx_errors = 0; - prDev->stats.rx_errors = 0; - //prDev->stats.rx_bytes = 0; - //prDev->stats.tx_bytes = 0; - prDev->stats.multicast = 0; - - return &prDev->stats; - -#else - prGlueInfo->prP2PInfo->rNetDevStats.rx_packets = 0; - prGlueInfo->prP2PInfo->rNetDevStats.tx_packets = 0; - prGlueInfo->prP2PInfo->rNetDevStats.tx_errors = 0; - prGlueInfo->prP2PInfo->rNetDevStats.rx_errors = 0; - prGlueInfo->prP2PInfo->rNetDevStats.rx_bytes = 0; - prGlueInfo->prP2PInfo->rNetDevStats.tx_bytes = 0; - prGlueInfo->prP2PInfo->rNetDevStats.rx_errors = 0; - prGlueInfo->prP2PInfo->rNetDevStats.multicast = 0; - - return &prGlueInfo->prP2PInfo->rNetDevStats; -#endif -} /* end of p2pGetStats() */ - - - - -static void -p2pSetMulticastList ( - IN struct net_device *prDev - ) -{ - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - - prGlueInfo = (NULL != prDev) ? *((P_GLUE_INFO_T *) netdev_priv(prDev)) : NULL; - - ASSERT(prDev); - ASSERT(prGlueInfo); - if (!prDev || !prGlueInfo) { - printk(KERN_WARNING DRV_NAME" abnormal dev or skb: prDev(0x%p), prGlueInfo(0x%p)\n", prDev, prGlueInfo); - return; - } - - - g_P2pPrDev = prDev; - - //4 Mark HALT, notify main thread to finish current job - prGlueInfo->u4Flag |= GLUE_FLAG_SUB_MOD_MULTICAST; - /* wake up main thread */ - wake_up_interruptible(&prGlueInfo->waitq); - -} /* p2pSetMulticastList */ - - -/*----------------------------------------------------------------------------*/ -/*! - * \brief This function is to set multicast list and set rx mode. - * - * \param[in] prDev Pointer to struct net_device - * - * \return (none) - */ -/*----------------------------------------------------------------------------*/ -void -mtk_p2p_wext_set_Multicastlist ( - P_GLUE_INFO_T prGlueInfo - ) -{ - UINT_32 u4SetInfoLen = 0; - struct net_device *prDev = g_P2pPrDev; - - prGlueInfo = (NULL != prDev) ? *((P_GLUE_INFO_T *) netdev_priv(prDev)) : NULL; - - ASSERT(prDev); - ASSERT(prGlueInfo); - if (!prDev || !prGlueInfo) { - printk(KERN_WARNING DRV_NAME" abnormal dev or skb: prDev(0x%p), prGlueInfo(0x%p)\n", prDev, prGlueInfo); - return; - } - - - if (prDev->flags & IFF_PROMISC) { - prGlueInfo->prP2PInfo->u4PacketFilter |= PARAM_PACKET_FILTER_PROMISCUOUS; - } - - if (prDev->flags & IFF_BROADCAST) { - prGlueInfo->prP2PInfo->u4PacketFilter |= PARAM_PACKET_FILTER_BROADCAST; - } - - if (prDev->flags & IFF_MULTICAST) { - if ((prDev->flags & IFF_ALLMULTI) || -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) - (netdev_mc_count(prDev) > MAX_NUM_GROUP_ADDR)) { -#else - (prDev->mc_count > MAX_NUM_GROUP_ADDR)) { -#endif - prGlueInfo->prP2PInfo->u4PacketFilter |= PARAM_PACKET_FILTER_ALL_MULTICAST; - } - else { - prGlueInfo->prP2PInfo->u4PacketFilter |= PARAM_PACKET_FILTER_MULTICAST; - } - } - - if (prGlueInfo->prP2PInfo->u4PacketFilter & PARAM_PACKET_FILTER_MULTICAST) { - /* Prepare multicast address list */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) - struct netdev_hw_addr *ha; -#else - struct dev_mc_list *prMcList; -#endif - UINT_32 i = 0; - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) - netdev_for_each_mc_addr(ha, prDev) { - if(i < MAX_NUM_GROUP_ADDR) { - COPY_MAC_ADDR(&(prGlueInfo->prP2PInfo->aucMCAddrList[i]), ha->addr); - i++; - } - } -#else - for (i = 0, prMcList = prDev->mc_list; - (prMcList) && (i < prDev->mc_count) && (i < MAX_NUM_GROUP_ADDR); - i++, prMcList = prMcList->next) { - COPY_MAC_ADDR(&(prGlueInfo->prP2PInfo->aucMCAddrList[i]), prMcList->dmi_addr); - } -#endif - - DBGLOG(P2P, TRACE, ("SEt Multicast Address List\n")); - - if (i >= MAX_NUM_GROUP_ADDR) { - return; - } - wlanoidSetP2PMulticastList(prGlueInfo->prAdapter, - &(prGlueInfo->prP2PInfo->aucMCAddrList[0]), - (i * ETH_ALEN), - &u4SetInfoLen); - - } - - return; -} /* end of p2pSetMulticastList() */ - - -/*----------------------------------------------------------------------------*/ -/*! - * * \brief This function is TX entry point of NET DEVICE. - * * - * * \param[in] prSkb Pointer of the sk_buff to be sent - * * \param[in] prDev Pointer to struct net_device - * * - * * \retval NETDEV_TX_OK - on success. - * * \retval NETDEV_TX_BUSY - on failure, packet will be discarded by upper layer. - * */ -/*----------------------------------------------------------------------------*/ -int -p2pHardStartXmit( - IN struct sk_buff *prSkb, - IN struct net_device *prDev - ) -{ - P_QUE_ENTRY_T prQueueEntry = NULL; - P_QUE_T prTxQueue = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - UINT_16 u2QueueIdx = 0; - - GLUE_SPIN_LOCK_DECLARATION(); - - ASSERT(prSkb); - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - - if (prGlueInfo->u4Flag & GLUE_FLAG_HALT) { - printk(KERN_INFO DRV_NAME"GLUE_FLAG_HALT skip tx\n"); - dev_kfree_skb(prSkb); - return NETDEV_TX_OK; - } - - // mark as P2P packets - GLUE_SET_PKT_FLAG_P2P(prSkb); - - prQueueEntry = (P_QUE_ENTRY_T) GLUE_GET_PKT_QUEUE_ENTRY(prSkb); - prTxQueue = &prGlueInfo->rTxQueue; - - if (wlanProcessSecurityFrame(prGlueInfo->prAdapter, (P_NATIVE_PACKET) prSkb) == FALSE) { - - u2QueueIdx = skb_get_queue_mapping(prSkb); - ASSERT(u2QueueIdx < CFG_MAX_TXQ_NUM); - - if (u2QueueIdx >= CFG_MAX_TXQ_NUM) { - printk(KERN_INFO DRV_NAME"Incorrect queue index, skip this frame\n"); - dev_kfree_skb(prSkb); - return NETDEV_TX_OK; - } - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_TX_QUE); - QUEUE_INSERT_TAIL(prTxQueue, prQueueEntry); - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_TX_QUE); - - GLUE_INC_REF_CNT(prGlueInfo->i4TxPendingFrameNum); - GLUE_INC_REF_CNT(prGlueInfo->ai4TxPendingFrameNumPerQueue[NETWORK_TYPE_P2P_INDEX][u2QueueIdx]); - - if (prGlueInfo->ai4TxPendingFrameNumPerQueue[NETWORK_TYPE_P2P_INDEX][u2QueueIdx] >= CFG_TX_STOP_NETIF_PER_QUEUE_THRESHOLD) { - netif_stop_subqueue(prDev, u2QueueIdx); - } - } - else { - GLUE_INC_REF_CNT(prGlueInfo->i4TxPendingSecurityFrameNum); - } - - kalSetEvent(prGlueInfo); - - /* Statistic usage. */ - prDev->stats.tx_bytes += prSkb->len; - prDev->stats.tx_packets++; - - return NETDEV_TX_OK; -} /* end of p2pHardStartXmit() */ - - -/*----------------------------------------------------------------------------*/ -/*! - * \brief A method of struct net_device, a primary SOCKET interface to configure - * the interface lively. Handle an ioctl call on one of our devices. - * Everything Linux ioctl specific is done here. Then we pass the contents - * of the ifr->data to the request message handler. - * - * \param[in] prDev Linux kernel netdevice - * - * \param[in] prIFReq Our private ioctl request structure, typed for the generic - * struct ifreq so we can use ptr to function - * - * \param[in] cmd Command ID - * - * \retval WLAN_STATUS_SUCCESS The IOCTL command is executed successfully. - * \retval OTHER The execution of IOCTL command is failed. - */ -/*----------------------------------------------------------------------------*/ -int -p2pDoIOCTL( - struct net_device *prDev, - struct ifreq *prIFReq, - int i4Cmd - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - int ret = 0; - char *prExtraBuf = NULL; - UINT_32 u4ExtraSize = 0; - struct iwreq *prIwReq = (struct iwreq *)prIFReq; - struct iw_request_info rIwReqInfo; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - - if (prGlueInfo->u4ReadyFlag == 0) { - // adapter not ready yet - return -EINVAL; - } - - // fill rIwReqInfo - rIwReqInfo.cmd = (__u16)i4Cmd; - rIwReqInfo.flags = 0; - - switch(i4Cmd) { - case SIOCSIWENCODEEXT: - /* Set Encryption Material after 4-way handshaking is done */ - if (prIwReq->u.encoding.pointer) { - u4ExtraSize = prIwReq->u.encoding.length; - prExtraBuf = kalMemAlloc(u4ExtraSize, VIR_MEM_TYPE); - - if (!prExtraBuf) { - ret = -ENOMEM; - break; - } - - if (copy_from_user(prExtraBuf, - prIwReq->u.encoding.pointer, - prIwReq->u.encoding.length)) { - ret = -EFAULT; - } - } - else if (prIwReq->u.encoding.length != 0) { - ret = -EINVAL; - break; - } - - if(ret == 0) { - ret = mtk_p2p_wext_set_key(prDev, &rIwReqInfo, &(prIwReq->u), prExtraBuf); - } - - kalMemFree(prExtraBuf, VIR_MEM_TYPE, u4ExtraSize); - prExtraBuf = NULL; - break; - - case SIOCSIWMLME: - /* IW_MLME_DISASSOC used for disconnection*/ - if (prIwReq->u.data.length != sizeof(struct iw_mlme)) { - printk(KERN_INFO "MLME buffer strange:%d\n", prIwReq->u.data.length); - ret = -EINVAL; - break; - } - - if (!prIwReq->u.data.pointer) { - ret = -EINVAL; - break; - } - - prExtraBuf = kalMemAlloc(sizeof(struct iw_mlme), VIR_MEM_TYPE); - if (!prExtraBuf) { - ret = - ENOMEM; - break; - } - - if (copy_from_user(prExtraBuf, prIwReq->u.data.pointer, sizeof(struct iw_mlme))) { - ret = -EFAULT; - } - else { - ret = mtk_p2p_wext_mlme_handler(prDev, &rIwReqInfo, &(prIwReq->u), prExtraBuf); - } - - kalMemFree(prExtraBuf, VIR_MEM_TYPE, sizeof(struct iw_mlme)); - prExtraBuf = NULL; - break; - - case SIOCGIWPRIV: - /* This ioctl is used to list all IW privilege ioctls */ - ret = mtk_p2p_wext_get_priv(prDev, &rIwReqInfo, &(prIwReq->u), NULL); - break; - - case SIOCGIWSCAN: - ret = mtk_p2p_wext_discovery_results(prDev, &rIwReqInfo, &(prIwReq->u), NULL); - break; - - case SIOCSIWAUTH: - ret = mtk_p2p_wext_set_auth(prDev, &rIwReqInfo, &(prIwReq->u), NULL); - break; - - case IOC_P2P_CFG_DEVICE: - case IOC_P2P_PROVISION_COMPLETE: - case IOC_P2P_START_STOP_DISCOVERY: - case IOC_P2P_DISCOVERY_RESULTS: - case IOC_P2P_WSC_BEACON_PROBE_RSP_IE: - case IOC_P2P_CONNECT_DISCONNECT: - case IOC_P2P_PASSWORD_READY: - case IOC_P2P_GET_STRUCT: - case IOC_P2P_SET_STRUCT: - case IOC_P2P_GET_REQ_DEVICE_INFO: - ret = rP2PIwPrivHandler[i4Cmd - SIOCIWFIRSTPRIV](prDev, &rIwReqInfo, &(prIwReq->u), (char *)&(prIwReq->u)); - break; -#if CFG_SUPPORT_P2P_RSSI_QUERY - case SIOCGIWSTATS: - ret = mtk_p2p_wext_get_rssi(prDev, &rIwReqInfo, &(prIwReq->u), NULL); - break; -#endif - default: - ret = -ENOTTY; - } - - return ret; -} /* end of p2pDoIOCTL() */ - - -/*----------------------------------------------------------------------------*/ -/*! - * \brief To report the private supported IOCTLs table to user space. - * - * \param[in] prDev Net device requested. - * \param[out] prIfReq Pointer to ifreq structure, content is copied back to - * user space buffer in gl_iwpriv_table. - * - * \retval 0 For success. - * \retval -E2BIG For user's buffer size is too small. - * \retval -EFAULT For fail. - * - */ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_get_priv ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - struct iw_point *prData= (struct iw_point *)&wrqu->data; - UINT_16 u2BufferSize = 0; - - ASSERT(prDev); - - u2BufferSize = prData->length; - - /* update our private table size */ - prData->length = (__u16)sizeof(rP2PIwPrivTable)/sizeof(struct iw_priv_args); - - if (u2BufferSize < prData->length) { - return -E2BIG; - } - - if (prData->length) { - if (copy_to_user(prData->pointer, rP2PIwPrivTable, sizeof(rP2PIwPrivTable))) { - return -EFAULT; - } - } - - return 0; -} /* end of mtk_p2p_wext_get_priv() */ - - -/*----------------------------------------------------------------------------*/ -/*! - * \brief To indicate P2P-FSM for re-associate to the connecting device - * - * \param[in] prDev Net device requested. - * \param[inout] wrqu Pointer to iwreq_data - * - * \retval 0 For success. - * \retval -EFAULT For fail. - * - */ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_reconnect ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ -#if 0 - P_ADAPTER_T prAdapter = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - P_MSG_HDR_T prMsgHdr; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - prMsgHdr = (P_MSG_HDR_T) cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_HDR_T)); - if (!prMsgHdr) { - ASSERT(0); // Can't trigger P2P FSM - return -ENOMEM; - } - - /* 1.2 fill message */ - - DBGLOG(P2P, TRACE, ("mtk_p2p_wext_reconnect: P2P Reconnect\n")); - - /* 1.3 send message */ - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prMsgHdr, - MSG_SEND_METHOD_BUF); -#endif - return 0; -} /* end of mtk_p2p_wext_reconnect() */ - - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief MLME command handler -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_mlme_handler( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ -#if 0 - P_ADAPTER_T prAdapter = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - struct iw_mlme *mlme = (struct iw_mlme *)extra; - P_MSG_P2P_CONNECTION_ABORT_T prMsgP2PConnAbt = (P_MSG_P2P_CONNECTION_ABORT_T)NULL; - P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); - - DBGLOG(P2P, TRACE, ("mtk_p2p_wext_mlme_handler:\n")); - - switch (mlme->cmd) { - case IW_MLME_DISASSOC: - prMsgP2PConnAbt = (P_MSG_HDR_T) cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_CONNECTION_ABORT_T)); - if (!prMsgP2PConnAbt) { - ASSERT(0); // Can't trigger P2P FSM - return -ENOMEM; - } - - COPY_MAC_ADDR(prMsgP2PConnAbt->aucTargetID, mlme->addr.sa_data); - - prMsgP2PConnAbt->u2ReasonCode = mlme->reason_code; - - - if (EQUAL_MAC_ADDR(prMsgP2PConnAbt->aucTargetID, prP2pBssInfo->aucOwnMacAddr)) { - DBGLOG(P2P, TRACE, ("P2P Connection Abort:\n")); - - /* 1.2 fill message */ - prMsgP2PConnAbt->rMsgHdr.eMsgId = MID_MNY_P2P_CONNECTION_ABORT; - } - else { - DBGLOG(P2P, TRACE, ("P2P Connection Pause:\n")); - - /* 1.2 fill message */ - } - - /* 1.3 send message */ - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prMsgP2PConnAbt, - MSG_SEND_METHOD_BUF); - - break; - - default: - return -EOPNOTSUPP; - } -#endif - return 0; -} /* end of mtk_p2p_wext_mlme_handler() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler (IOC_P2P_PROVISION_COMPLETE) -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_set_provision_complete( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ -#if 0 - P_ADAPTER_T prAdapter = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - struct iw_point *prData= (struct iw_point *)&wrqu->data; - P_MSG_HDR_T prMsgHdr; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - switch(prData->flags) { - case P2P_PROVISIONING_SUCCESS: - prMsgHdr = (P_MSG_HDR_T) cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_HDR_T)); - if (!prMsgHdr) { - ASSERT(0); // Can't trigger P2P FSM - return -ENOMEM; - } - - /* 1.2 fill message */ - - prGlueInfo->prP2PInfo->u4CipherPairwise = IW_AUTH_CIPHER_CCMP; - - /* 1.3 send message */ - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prMsgHdr, - MSG_SEND_METHOD_BUF); - - break; - - case P2P_PROVISIONING_FAIL: - - break; - - default: - return -EOPNOTSUPP; - } -#endif - - return 0; -} /* end of mtk_p2p_wext_set_provision_complete() */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler (IOC_P2P_START_STOP_DISCOVERY) -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_start_stop_discovery( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ -#if 0 - P_ADAPTER_T prAdapter = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - struct iw_point *prData= (struct iw_point *)&wrqu->data; - P_IW_P2P_REQ_DEVICE_TYPE prReqDeviceType = (P_IW_P2P_REQ_DEVICE_TYPE) extra; - UINT_8 au4IeBuf[MAX_IE_LENGTH]; - P_MSG_HDR_T prMsgHdr; - P_MSG_P2P_DEVICE_DISCOVER_T prDiscoverMsg; - P_P2P_CONNECTION_SETTINGS_T prConnSettings; - UINT_8 aucNullAddr[] = NULL_MAC_ADDR; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - prConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - - if(prData->flags == P2P_STOP_DISCOVERY) { - prMsgHdr = (P_MSG_HDR_T) cnmMemAlloc(prAdapter, - RAM_TYPE_MSG, - sizeof(MSG_HDR_T)); - - if (!prMsgHdr) { - ASSERT(0); // Can't trigger P2P FSM - return -ENOMEM; - } - - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prMsgHdr, - MSG_SEND_METHOD_BUF); - } - else if(prData->flags == P2P_START_DISCOVERY) { - - /* retrieve IE for Probe Response */ - if(prReqDeviceType->probe_rsp_len > 0) { - if(prReqDeviceType->probe_rsp_len <= MAX_IE_LENGTH) { - if(copy_from_user(prGlueInfo->prP2PInfo->aucWSCIE[2], prReqDeviceType->probe_rsp_ie, prReqDeviceType->probe_rsp_len)) { - return -EFAULT; - } - prGlueInfo->prP2PInfo->u2WSCIELen[2] = prReqDeviceType->probe_rsp_len; - } - else { - return -E2BIG; - } - } - - /* retrieve IE for Probe Request */ - if(prReqDeviceType->probe_req_len > 0) { - if(prReqDeviceType->probe_req_len <= MAX_IE_LENGTH) { - if(copy_from_user(prGlueInfo->prP2PInfo->aucWSCIE[1], prReqDeviceType->probe_req_ie, prReqDeviceType->probe_req_len)) { - return -EFAULT; - } - prGlueInfo->prP2PInfo->u2WSCIELen[1] = prReqDeviceType->probe_req_len; - } - else { - return -E2BIG; - } - } - /* update IE for Probe Request */ - - if(prReqDeviceType->scan_type == P2P_LISTEN) { - /* update listening parameter */ - - /* @TODO: update prConnSettings for Probe Response IE */ - } - else { - // indicate P2P-FSM with MID_MNY_P2P_DEVICE_DISCOVERY - prDiscoverMsg = (P_MSG_P2P_DEVICE_DISCOVER_T) cnmMemAlloc(prAdapter, - RAM_TYPE_MSG, - sizeof(MSG_P2P_DEVICE_DISCOVER_T)); - - if (!prDiscoverMsg) { - ASSERT(0); // Can't trigger P2P FSM - return -ENOMEM; - } - - prDiscoverMsg->rMsgHdr.eMsgId = MID_MNY_P2P_DEVICE_DISCOVERY; - prDiscoverMsg->u4DevDiscoverTime = 0; // unlimited - prDiscoverMsg->fgIsSpecificType = TRUE; - prDiscoverMsg->rTargetDeviceType.u2CategoryID = *(PUINT_16)(&(prReqDeviceType->pri_device_type[0])); - prDiscoverMsg->rTargetDeviceType.u2SubCategoryID = *(PUINT_16)(&(prReqDeviceType->pri_device_type[6]));; - COPY_MAC_ADDR(prDiscoverMsg->aucTargetDeviceID, aucNullAddr); - - /* @FIXME: parameter to be refined, where to pass IE buffer ? */ - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prDiscoverMsg, - MSG_SEND_METHOD_BUF); - } - } - else { - return -EINVAL; - } -#endif - - return 0; -} /* end of mtk_p2p_wext_start_stop_discovery() */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler (IOC_P2P_SET_INT) -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Setting parameters not support. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_invitation_request ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - int i4Status = 0; -#if 0 - P_ADAPTER_T prAdapter = (P_ADAPTER_T)NULL; - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - struct iw_point *prData = (struct iw_point*)&wrqu->data; - P_IW_P2P_IOCTL_INVITATION_STRUCT prIoctlInvitation = (P_IW_P2P_IOCTL_INVITATION_STRUCT)NULL; - - do { - if ((prDev == NULL) || (extra == NULL)) { - ASSERT(FALSE); - i4Status = -EINVAL; - break; - } - - - prGlueInfo = *((P_GLUE_INFO_T *)netdev_priv(prDev)); - prIoctlInvitation = (P_IW_P2P_IOCTL_INVITATION_STRUCT)extra; - - if (prGlueInfo == NULL) { - i4Status = -EINVAL; - break; - } - - - prAdapter = prGlueInfo->prAdapter; - - if (prAdapter == NULL) { - i4Status = -EINVAL; - break; - } - - - if (prIoctlInvitation->ucReinvoke == 1) { - // TODO: Set Group ID - p2pFuncSetGroupID(prAdapter, prIoctlInvitation->aucGroupID, prIoctlInvitation->aucSsid, prIoctlInvitation->u4SsidLen); - } - - else { - P_MSG_P2P_INVITATION_REQUEST_T prMsgP2PInvitationReq = (P_MSG_P2P_INVITATION_REQUEST_T)NULL; - - // TODO: Do Invitation. - prMsgP2PInvitationReq = (P_MSG_P2P_INVITATION_REQUEST_T) cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_INVITATION_REQUEST_T)); - if (!prMsgP2PInvitationReq) { - ASSERT(0); // Can't trigger P2P FSM - i4Status = -ENOMEM; - break; - } - - /* 1.2 fill message */ - kalMemCopy(prMsgP2PInvitationReq->aucDeviceID, prIoctlInvitation->aucDeviceID, MAC_ADDR_LEN); - - DBGLOG(P2P, TRACE, ("mtk_p2p_wext_invitation_request: P2P Invitation Req\n")); - - /* 1.3 send message */ - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prMsgP2PInvitationReq, - MSG_SEND_METHOD_BUF); - - } - - - - } while (FALSE); -#endif - - return i4Status; - -} -/* mtk_p2p_wext_invitation_request */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler (IOC_P2P_SET_INT) -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Setting parameters not support. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_invitation_abort ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - int i4Status = 0; -#if 0 - P_ADAPTER_T prAdapter = (P_ADAPTER_T)NULL; - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - struct iw_point *prData = (struct iw_point*)&wrqu->data; - P_IW_P2P_IOCTL_ABORT_INVITATION prIoctlInvitationAbort = (P_IW_P2P_IOCTL_ABORT_INVITATION)NULL; - - UINT_8 bssid[MAC_ADDR_LEN]; - - do { - if ((prDev == NULL) || (extra == NULL)) { - ASSERT(FALSE); - i4Status = -EINVAL; - break; - } - - - prGlueInfo = *((P_GLUE_INFO_T *)netdev_priv(prDev)); - prIoctlInvitationAbort = (P_IW_P2P_IOCTL_ABORT_INVITATION)extra; - - if (prGlueInfo == NULL) { - i4Status = -EINVAL; - break; - } - - - prAdapter = prGlueInfo->prAdapter; - - if (prAdapter == NULL) { - i4Status = -EINVAL; - break; - } - else { - P_MSG_P2P_INVITATION_REQUEST_T prMsgP2PInvitationAbort = (P_MSG_P2P_INVITATION_REQUEST_T)NULL; - - prMsgP2PInvitationAbort = (P_MSG_P2P_INVITATION_REQUEST_T) cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_INVITATION_REQUEST_T)); - - if (!prMsgP2PInvitationAbort) { - ASSERT(0); // Can't trigger P2P FSM - i4Status = -ENOMEM; - break; - } - - - /* 1.2 fill message */ - kalMemCopy(prMsgP2PInvitationAbort->aucDeviceID, prIoctlInvitationAbort->dev_addr, MAC_ADDR_LEN); - - DBGLOG(P2P, TRACE, ("mtk_p2p_wext_invitation_request: P2P Invitation Req\n")); - - /* 1.3 send message */ - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prMsgP2PInvitationAbort, - MSG_SEND_METHOD_BUF); - - } - - - } while (FALSE); -#endif - - return i4Status; - -} -/* mtk_p2p_wext_invitation_abort */ - - - -/*----------------------------------------------------------------------------*/ -/*! - * \brief To override p2p interface address - * - * \param[in] prDev Net device requested. - * \param[in] addr Pointer to address - * - * \retval 0 For success. - * \retval -E2BIG For user's buffer size is too small. - * \retval -EFAULT For fail. - * - */ -/*----------------------------------------------------------------------------*/ -int -p2pSetMACAddress( - IN struct net_device *prDev, - void *addr - ) -{ - P_ADAPTER_T prAdapter = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - //@FIXME - return eth_mac_addr(prDev, addr); -} - - - - - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To set encryption cipher suite -* -* \param[in] prDev Net device requested. -* \param[out] -* -* \retval 0 Success. -* \retval -EINVAL Invalid parameter -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_set_auth ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - struct iw_param *prAuth = (struct iw_param *)wrqu; - - ASSERT(prDev); - ASSERT(prAuth); - if (FALSE == GLUE_CHK_PR2(prDev, prAuth)) { - return -EINVAL; - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - - /* Save information to glue info and process later when ssid is set. */ - switch(prAuth->flags & IW_AUTH_INDEX) { - case IW_AUTH_WPA_VERSION: - break; - case IW_AUTH_CIPHER_PAIRWISE: - prGlueInfo->prP2PInfo->u4CipherPairwise = prAuth->value; - break; - case IW_AUTH_CIPHER_GROUP: - case IW_AUTH_KEY_MGMT: - case IW_AUTH_TKIP_COUNTERMEASURES: - case IW_AUTH_DROP_UNENCRYPTED: - case IW_AUTH_80211_AUTH_ALG: - case IW_AUTH_WPA_ENABLED: - case IW_AUTH_RX_UNENCRYPTED_EAPOL: - case IW_AUTH_ROAMING_CONTROL: - case IW_AUTH_PRIVACY_INVOKED: - default: - //@TODO - break; - } - - return 0; -} /* end of mtk_p2p_wext_set_auth() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To set encryption cipher and key. -* -* \param[in] prDev Net device requested. -* \param[out] prIfReq Pointer to ifreq structure, content is copied back to -* user space buffer in gl_iwpriv_table. -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note Securiry information is stored in pEnc. -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_set_key( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - int ret = 0; - struct iw_encode_ext *prIWEncExt; - struct iw_point *prEnc; - char *prExtraBuf = NULL; - UINT_32 u4ExtraSize = 0; - UINT_8 keyStructBuf[100]; - P_PARAM_REMOVE_KEY_T prRemoveKey = (P_PARAM_REMOVE_KEY_T) keyStructBuf; - P_PARAM_KEY_T prKey = (P_PARAM_KEY_T) keyStructBuf; - P_GLUE_INFO_T prGlueInfo; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - - do { - if (wrqu->encoding.pointer) { - u4ExtraSize = wrqu->encoding.length; - prExtraBuf = kalMemAlloc(u4ExtraSize, VIR_MEM_TYPE); - - if (!prExtraBuf) { - ret = -ENOMEM; - break; - } - - if (copy_from_user(prExtraBuf, - wrqu->encoding.pointer, - wrqu->encoding.length)) { - ret = -EFAULT; - break; - } - } - else if (wrqu->encoding.length != 0) { - ret = -EINVAL; - break; - } - - prEnc = &wrqu->encoding; - prIWEncExt = (struct iw_encode_ext *) prExtraBuf; - - if (GLUE_CHK_PR3(prDev, prEnc, prExtraBuf) == TRUE) { - memset(keyStructBuf, 0, sizeof(keyStructBuf)); - - if ((prEnc->flags & IW_ENCODE_MODE) == IW_ENCODE_DISABLED) { // Key Removal - prRemoveKey->u4Length = sizeof(*prRemoveKey); - memcpy(prRemoveKey->arBSSID, prIWEncExt->addr.sa_data, 6); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetRemoveP2PKey, - prRemoveKey, - prRemoveKey->u4Length, - FALSE, - FALSE, - TRUE, - TRUE, - &u4BufLen); - - if(rStatus != WLAN_STATUS_SUCCESS) - ret = -EFAULT; - } - else { - if(prIWEncExt->alg == IW_ENCODE_ALG_CCMP) { - /* KeyID */ - prKey->u4KeyIndex = (prEnc->flags & IW_ENCODE_INDEX) ? - ((prEnc->flags & IW_ENCODE_INDEX) - 1) : 0; - if (prKey->u4KeyIndex <= 3) { - /* bit(31) and bit(30) are shared by pKey and pRemoveKey */ - /* Tx Key Bit(31)*/ - if (prIWEncExt->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { - prKey->u4KeyIndex |= 0x1UL << 31; - } - - /* Pairwise Key Bit(30) */ - if (prIWEncExt->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { - /* group key */ - } - else { - /* pairwise key */ - prKey->u4KeyIndex |= 0x1UL << 30; - } - - /* Rx SC Bit(29) */ - if (prIWEncExt->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) { - prKey->u4KeyIndex |= 0x1UL << 29; - memcpy(&prKey->rKeyRSC, prIWEncExt->rx_seq, IW_ENCODE_SEQ_MAX_SIZE); - } - - /* BSSID */ - memcpy(prKey->arBSSID, prIWEncExt->addr.sa_data, 6); - memcpy(prKey->aucKeyMaterial, prIWEncExt->key, prIWEncExt->key_len); - - prKey->u4KeyLength = prIWEncExt->key_len; - prKey->u4Length = ((UINT_32)&(((P_PARAM_KEY_T)0)->aucKeyMaterial)) + prKey->u4KeyLength; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetAddP2PKey, - prKey, - prKey->u4Length, - FALSE, - FALSE, - TRUE, - TRUE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - ret = -EFAULT; - } - } - else { - ret = -EINVAL; - } - } - else { - ret = -EINVAL; - } - } - } - else - ret = -EINVAL; - - } while(FALSE); - - if (prExtraBuf) { - kalMemFree(prExtraBuf, VIR_MEM_TYPE, u4ExtraSize); - prExtraBuf = NULL; - } - - return ret; -} /* end of mtk_p2p_wext_set_key() */ - - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief set the p2p gc power mode -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_set_powermode( - IN struct net_device *prNetDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - //printk("set_powermode = %d, value = %d\n", wrqu->power.disabled, wrqu->power.value); - struct iw_param *prPower = (struct iw_param*)&wrqu->power; -#if 1 - PARAM_POWER_MODE ePowerMode; - INT_32 i4PowerValue; - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prPower); - if (FALSE == GLUE_CHK_PR2(prNetDev, prPower)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - //printk(KERN_INFO "wext_set_power value(%d) disabled(%d) flag(0x%x)\n", - // prPower->value, prPower->disabled, prPower->flags); - - if(prPower->disabled){ - ePowerMode = Param_PowerModeCAM; - } - else { - i4PowerValue = prPower->value; -#if WIRELESS_EXT < 21 - i4PowerValue /= 1000000; -#endif - if (i4PowerValue == 0) { - ePowerMode = Param_PowerModeCAM; - } else if (i4PowerValue == 1) { - ePowerMode = Param_PowerModeMAX_PSP; - } else if (i4PowerValue == 2) { - ePowerMode = Param_PowerModeFast_PSP; - } - else { - printk(KERN_DEBUG "%s(): unsupported power management mode value = %d.\n", - __FUNCTION__, - prPower->value); - - return -EINVAL; - } - } - - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetP2pPowerSaveProfile, - &ePowerMode, - sizeof(ePowerMode), - FALSE, - FALSE, - TRUE, - TRUE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - //printk(KERN_INFO DRV_NAME"wlanoidSet802dot11PowerSaveProfile fail 0x%lx\n", rStatus); - return -EFAULT; - } - -#endif - - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief get the p2p gc power mode -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_get_powermode( - IN struct net_device *prNetDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - //printk("mtk_p2p_wext_get_powermode\n"); - //wrqu->power.disabled = 0; - //wrqu->power.value = 1; - - struct iw_param *prPower = (struct iw_param*)&wrqu->power; - PARAM_POWER_MODE ePowerMode; - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prPower); - if (FALSE == GLUE_CHK_PR2(prNetDev, prPower)) { - return -EINVAL; - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - ASSERT(prGlueInfo); - - -#if 1 - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryP2pPowerSaveProfile, - &ePowerMode, - sizeof(ePowerMode), - TRUE, - FALSE, - FALSE, - TRUE, - &u4BufLen); -#else - rStatus = wlanQueryInformation(prGlueInfo->prAdapter, - wlanoidQueryP2pPowerSaveProfile, - &ePowerMode, - sizeof(ePowerMode), - &u4BufLen); -#endif - - prPower->value = 0; - prPower->disabled = 1; - - if (Param_PowerModeCAM == ePowerMode) { - prPower->value = 0; - prPower->disabled = 1; - } - else if (Param_PowerModeMAX_PSP == ePowerMode ) { - prPower->value = 1; - prPower->disabled = 0; - } - else if (Param_PowerModeFast_PSP == ePowerMode ) { - prPower->value = 2; - prPower->disabled = 0; - } - - prPower->flags = IW_POWER_PERIOD | IW_POWER_RELATIVE; -#if WIRELESS_EXT < 21 - prPower->value *= 1000000; -#endif - - - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler (IOC_P2P_CFG_DEVICE) -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_set_local_dev_info( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - P_ADAPTER_T prAdapter = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - P_IW_P2P_CFG_DEVICE_TYPE prDeviceCfg = (P_IW_P2P_CFG_DEVICE_TYPE) extra; - P_P2P_CONNECTION_SETTINGS_T prConnSettings; - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; - //P_MSG_P2P_FUNCTION_SWITCH_T prFuncSwitch = (P_MSG_P2P_FUNCTION_SWITCH_T)NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - prConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - prP2pSpecificBssInfo = prAdapter->rWifiVar.prP2pSpecificBssInfo; - - // update connection settings for P2P-FSM - // 1. update SSID - if(prDeviceCfg->ssid_len > ELEM_MAX_LEN_SSID) { - prConnSettings->ucSSIDLen = ELEM_MAX_LEN_SSID; - } - else { - prConnSettings->ucSSIDLen = prDeviceCfg->ssid_len; - } - - if(copy_from_user(prConnSettings->aucSSID, prDeviceCfg->ssid, prConnSettings->ucSSIDLen)) { - return -EFAULT; - } - - // 2. update device type (WPS IE) - kalMemCopy(&(prConnSettings->rPrimaryDevTypeBE), &(prDeviceCfg->pri_device_type), sizeof(DEVICE_TYPE_T)); -#if P2P_MAX_SUPPORTED_SEC_DEV_TYPE_COUNT - kalMemCopy(&(prConnSettings->arSecondaryDevTypeBE[0]), &(prDeviceCfg->snd_device_type), sizeof(DEVICE_TYPE_T)); -#endif - - // 3. update device name - if(prDeviceCfg->device_name_len > WPS_ATTRI_MAX_LEN_DEVICE_NAME) { - prConnSettings->ucDevNameLen = WPS_ATTRI_MAX_LEN_DEVICE_NAME; - } - else { - prConnSettings->ucDevNameLen = prDeviceCfg->device_name_len; - } - if(copy_from_user(prConnSettings->aucDevName, prDeviceCfg->device_name, prConnSettings->ucDevNameLen)) { - return -EFAULT; - } - - // 4. update GO intent - prConnSettings->ucGoIntent = prDeviceCfg->intend; - - - /* Preferred channel bandwidth */ - prAdapter->rWifiVar.rConnSettings.uc2G4BandwidthMode = - prDeviceCfg->ch_width ? CONFIG_BW_20_40M : CONFIG_BW_20M; - prAdapter->rWifiVar.rConnSettings.uc5GBandwidthMode = - prDeviceCfg->ch_width ? CONFIG_BW_20_40M : CONFIG_BW_20M; - -#if 0 - /* 1. switch P2P-FSM on */ - /* 1.1 allocate for message */ - prFuncSwitch = (P_MSG_P2P_FUNCTION_SWITCH_T) cnmMemAlloc(prAdapter, - RAM_TYPE_MSG, - sizeof(MSG_P2P_FUNCTION_SWITCH_T)); - - if (!prFuncSwitch) { - ASSERT(0); // Can't trigger P2P FSM - return -ENOMEM; - } - - /* 1.2 fill message */ - prFuncSwitch->rMsgHdr.eMsgId = MID_MNY_P2P_FUN_SWITCH; - prFuncSwitch->fgIsFuncOn = TRUE; - - /* 1.3 send message */ - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prFuncSwitch, - MSG_SEND_METHOD_BUF); -#endif - return 0; -} /* end of mtk_p2p_wext_set_local_dev_info() */ - - - - - - -/*----------------------------------------------------------------------------*/ -/*! - * \brief I/O Control handler for both - * IOC_P2P_START_STOP_DISCOVERY & SIOCGIWSCAN - * - * \param[in] prDev Net device requested. - * \param[inout] wrqu Pointer to iwreq_data - * - * \retval 0 Success. - * \retval -EFAULT Setting parameters to driver fail. - * \retval -EOPNOTSUPP Key size not supported. - * - * \note - */ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_discovery_results( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - struct iw_event iwe; - char *current_ev = extra; - UINT_32 i; - P_GLUE_INFO_T prGlueInfo = NULL; - P_ADAPTER_T prAdapter = NULL; - P_P2P_INFO_T prP2PInfo = (P_P2P_INFO_T)NULL; - P_EVENT_P2P_DEV_DISCOVER_RESULT_T prTargetResult = (P_EVENT_P2P_DEV_DISCOVER_RESULT_T)NULL; - P_PARAM_VARIABLE_IE_T prDesiredIE = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - prP2PInfo = prAdapter->prP2pInfo; - - for(i = 0 ; i < prP2PInfo->u4DeviceNum ; i++) { - prTargetResult = &prP2PInfo->arP2pDiscoverResult[i]; - - /* SIOCGIWAP */ - iwe.cmd = SIOCGIWAP; - iwe.u.ap_addr.sa_family = ARPHRD_ETHER; - memcpy(iwe.u.ap_addr.sa_data, - prTargetResult->aucInterfaceAddr, - 6); - - current_ev = iwe_stream_add_event(info, current_ev, - extra + IW_SCAN_MAX_DATA, - &iwe, IW_EV_ADDR_LEN); - - - /* SIOCGIWESSID */ - iwe.cmd = SIOCGIWESSID; - iwe.u.data.flags = 1; - iwe.u.data.length = prTargetResult->u2NameLength; - - current_ev = iwe_stream_add_point(info, current_ev, - extra + IW_SCAN_MAX_DATA, - &iwe, prTargetResult->aucName); - - /* IWEVGENIE for WPA IE */ - if(prTargetResult->u2IELength <= 600 && wextSrchDesiredWPAIE(prTargetResult->pucIeBuf, - prTargetResult->u2IELength, - 0xDD, - (PUINT_8 *)&prDesiredIE)) { - - iwe.cmd = IWEVGENIE; - iwe.u.data.flags = 1; - iwe.u.data.length = 2 + (__u16)prDesiredIE->ucLength; - - current_ev = iwe_stream_add_point(info, current_ev, - extra + IW_SCAN_MAX_DATA, - &iwe, (char *)prDesiredIE); - } - -#if CFG_SUPPORT_WPS - - /* IWEVGENIE for WPS IE */ - if((prTargetResult->u2IELength <= 600) && wextSrchDesiredWPSIE(prTargetResult->pucIeBuf, - prTargetResult->u2IELength, - 0xDD, - (PUINT_8 *)&prDesiredIE)) { - - iwe.cmd = IWEVGENIE; - iwe.u.data.flags = 1; - iwe.u.data.length = 2 + (__u16)prDesiredIE->ucLength; - - current_ev = iwe_stream_add_point(info, current_ev, - extra + IW_SCAN_MAX_DATA, - &iwe, (char *)prDesiredIE); - } - -#endif - - /* IWEVGENIE for RSN IE */ - if((prTargetResult->u2IELength <= 600) && wextSrchDesiredWPAIE(prTargetResult->pucIeBuf, - prTargetResult->u2IELength, - 0x30, - (PUINT_8 *)&prDesiredIE)) { - - iwe.cmd = IWEVGENIE; - iwe.u.data.flags = 1; - iwe.u.data.length = 2 + (__u16)prDesiredIE->ucLength; - - current_ev = iwe_stream_add_point(info, current_ev, - extra + IW_SCAN_MAX_DATA, - &iwe, (char *)prDesiredIE); - } - - /* IOC_P2P_GO_WSC_IE */ -#if 1 - /* device capability */ - if (1) { - UINT_8 data[40]; - - iwe.cmd = IWEVCUSTOM; - iwe.u.data.flags = 0; - iwe.u.data.length = 8 + sizeof("p2p_cap="); - - snprintf(data, iwe.u.data.length, "p2p_cap=%02x%02x%02x%02x%c", - prTargetResult->ucDeviceCapabilityBitmap, prTargetResult->ucGroupCapabilityBitmap, - (UINT_8)prTargetResult->u2ConfigMethod, (UINT_8)(prTargetResult->u2ConfigMethod >> 8), '\0' ); - current_ev = iwe_stream_add_point(info, current_ev, - extra + IW_SCAN_MAX_DATA, - &iwe, (char *)data); - - //printk("%s\n", data); - kalMemZero(data, 40); - - iwe.cmd = IWEVCUSTOM; - iwe.u.data.flags = 0; - iwe.u.data.length = 12 + sizeof("p2p_dev_type="); - - snprintf(data, iwe.u.data.length, "p2p_dev_type=%02x%02x%02x%02x%02x%02x%c", - (UINT_8)prTargetResult->rPriDevType.u2CategoryID,(UINT_8)prTargetResult->rPriDevType.u2SubCategoryID, - (UINT_8)prTargetResult->arSecDevType[0].u2CategoryID,(UINT_8)prTargetResult->arSecDevType[0].u2SubCategoryID, - (UINT_8)prTargetResult->arSecDevType[1].u2CategoryID,(UINT_8)prTargetResult->arSecDevType[1].u2SubCategoryID, - '\0'); - current_ev = iwe_stream_add_point(info, current_ev, - extra + IW_SCAN_MAX_DATA, - &iwe, (char *)data); - //printk("%s\n", data); - - kalMemZero(data, 40); - - iwe.cmd = IWEVCUSTOM; - iwe.u.data.flags = 0; - iwe.u.data.length = 17 + sizeof("p2p_grp_bssid="); - - snprintf(data, iwe.u.data.length, "p2p_grp_bssid="MACSTR"%c", - MAC2STR(prTargetResult->aucBSSID), '\0'); - current_ev = iwe_stream_add_point(info, current_ev, - extra + IW_SCAN_MAX_DATA, - &iwe, (char *)data); - //printk("%s\n", data); - - } -#endif - } - - /* Length of data */ - wrqu->data.length = (current_ev - extra); - wrqu->data.flags = 0; - - return 0; -} /* end of mtk_p2p_wext_discovery_results() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler (IOC_P2P_WSC_BEACON_PROBE_RSP_IE) -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_wsc_ie( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - P_ADAPTER_T prAdapter = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - P_IW_P2P_HOSTAPD_PARAM prHostapdParam = (P_IW_P2P_HOSTAPD_PARAM)extra; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *)netdev_priv(prDev)); - ASSERT(prGlueInfo); - - if (prHostapdParam->len > 0) { - if (prHostapdParam->len <= MAX_WSC_IE_LENGTH) { - if (copy_from_user(prGlueInfo->prP2PInfo->aucWSCIE[0], prHostapdParam->data, prHostapdParam->len)) { - return -EFAULT; - } - if (copy_from_user(prGlueInfo->prP2PInfo->aucWSCIE[2], prHostapdParam->data, prHostapdParam->len)) { - return -EFAULT; - } - } - else { - return -E2BIG; - } - } - - prGlueInfo->prP2PInfo->u2WSCIELen[0] = prHostapdParam->len; - prGlueInfo->prP2PInfo->u2WSCIELen[2] = prHostapdParam->len; - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - bssUpdateBeaconContent(prAdapter, NETWORK_TYPE_P2P_INDEX); - - //@TODO: send message to P2P-FSM - - return 0; -} /* end of mtk_p2p_wext_wsc_ie() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler (IOC_P2P_CONNECT_DISCONNECT) -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_connect_disconnect( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - P_ADAPTER_T prAdapter = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - struct iw_point *prData= (struct iw_point *)&wrqu->data; -// P_IW_P2P_CONNECT_DEVICE prConnectDevice = (P_IW_P2P_CONNECT_DEVICE)extra; -// P_MSG_HDR_T prMsgHdr; -// P_MSG_P2P_CONNECTION_REQUEST_T prMsgP2PConnReq; -// P_MSG_P2P_CONNECTION_ABORT_T prMsgP2PConnAbt; -// UINT_8 aucBCAddr[] = BC_MAC_ADDR; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - if (prData->flags == P2P_CONNECT) { -#if 0 - // indicate P2P-FSM with MID_MNY_P2P_CONNECTION_REQ - prMsgP2PConnReq = (P_MSG_P2P_CONNECTION_REQUEST_T) cnmMemAlloc(prAdapter, - RAM_TYPE_MSG, - sizeof(MSG_P2P_CONNECTION_REQUEST_T)); - - if (!prMsgP2PConnReq) { - ASSERT(0); // Can't trigger P2P FSM - return -ENOMEM; - } - - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prMsgP2PConnReq, - MSG_SEND_METHOD_BUF); -#endif - } - else if(prData->flags == P2P_DISCONNECT) { -#if 0 - // indicate P2P-FSM with MID_MNY_P2P_CONNECTION_ABORT - prMsgP2PConnAbt = (P_MSG_HDR_T) cnmMemAlloc(prAdapter, - RAM_TYPE_MSG, - sizeof(MSG_P2P_CONNECTION_ABORT_T)); - - if (!prMsgP2PConnAbt) { - ASSERT(0); // Can't trigger P2P FSM - return -ENOMEM; - } - - COPY_MAC_ADDR(prMsgP2PConnAbt->aucTargetID, prConnectDevice->sta_addr); - - prMsgP2PConnAbt->rMsgHdr.eMsgId = MID_MNY_P2P_CONNECTION_ABORT; - - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prMsgP2PConnAbt, - MSG_SEND_METHOD_BUF); -#endif - } - else { - return -EINVAL; - } - - return 0; -} /* end of mtk_p2p_wext_connect_disconnect() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler (IOC_P2P_PASSWORD_READY) -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_password_ready( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - P_ADAPTER_T prAdapter = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - P_IW_P2P_PASSWORD_READY prPasswordReady = (P_IW_P2P_PASSWORD_READY)extra; - P_P2P_CONNECTION_SETTINGS_T prConnSettings; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *)netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - prConnSettings = prAdapter->rWifiVar.prP2PConnSettings; - - /* retrieve IE for Probe Request */ - if (prPasswordReady->probe_req_len > 0) { - if (prPasswordReady->probe_req_len <= MAX_WSC_IE_LENGTH) { - if (copy_from_user(prGlueInfo->prP2PInfo->aucWSCIE[1], prPasswordReady->probe_req_ie, prPasswordReady->probe_req_len)) { - return -EFAULT; - } - } - else { - return -E2BIG; - } - } - - prGlueInfo->prP2PInfo->u2WSCIELen[1] = prPasswordReady->probe_req_len; - - /* retrieve IE for Probe Response */ - if (prPasswordReady->probe_rsp_len > 0) { - if (prPasswordReady->probe_rsp_len <= MAX_WSC_IE_LENGTH) { - if (copy_from_user(prGlueInfo->prP2PInfo->aucWSCIE[2], prPasswordReady->probe_rsp_ie, prPasswordReady->probe_rsp_len)) { - return -EFAULT; - } - } - else { - return -E2BIG; - } - } - - prGlueInfo->prP2PInfo->u2WSCIELen[2] = prPasswordReady->probe_rsp_len; - - switch (prPasswordReady->active_config_method) { - case 1: - prConnSettings->u2LocalConfigMethod = WPS_ATTRI_CFG_METHOD_PUSH_BUTTON; - break; - case 2: - prConnSettings->u2LocalConfigMethod = WPS_ATTRI_CFG_METHOD_KEYPAD; - break; - case 3: - prConnSettings->u2LocalConfigMethod = WPS_ATTRI_CFG_METHOD_DISPLAY; - break; - default: - break; - } - - prConnSettings->fgIsPasswordIDRdy = TRUE; - return 0; -} /* end of mtk_p2p_wext_password_ready() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler (IOC_P2P_GET_REQ_DEVICE_INFO) -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_request_dev_info( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - P_ADAPTER_T prAdapter = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - P_IW_P2P_DEVICE_REQ prDeviceReq = (P_IW_P2P_DEVICE_REQ)extra; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - // specify data length - wrqu->data.length = sizeof(IW_P2P_DEVICE_REQ); - - // copy to upper-layer supplied buffer - kalMemCopy(prDeviceReq->name, prGlueInfo->prP2PInfo->aucConnReqDevName, prGlueInfo->prP2PInfo->u4ConnReqNameLength); - prDeviceReq->name_len = prGlueInfo->prP2PInfo->u4ConnReqNameLength; - prDeviceReq->name[prDeviceReq->name_len]='\0'; - COPY_MAC_ADDR(prDeviceReq->device_addr, prGlueInfo->prP2PInfo->rConnReqPeerAddr); - prDeviceReq->device_type = prGlueInfo->prP2PInfo->ucConnReqDevType; - prDeviceReq->config_method = prGlueInfo->prP2PInfo->i4ConnReqConfigMethod; - prDeviceReq->active_config_method = prGlueInfo->prP2PInfo->i4ConnReqActiveConfigMethod; - - return 0; -} /* end of mtk_p2p_wext_request_dev_info() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler (IOC_P2P_GET_STRUCT) -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_invitation_indicate( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - P_ADAPTER_T prAdapter = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - P_IW_P2P_IOCTL_INVITATION_INDICATE prInvIndicate = (P_IW_P2P_IOCTL_INVITATION_INDICATE)extra; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - // specify data length - wrqu->data.length = sizeof(IW_P2P_IOCTL_INVITATION_INDICATE); - - // copy to upper-layer supplied buffer - kalMemCopy(prInvIndicate->dev_name, prGlueInfo->prP2PInfo->aucConnReqDevName, prGlueInfo->prP2PInfo->u4ConnReqNameLength); - kalMemCopy(prInvIndicate->group_bssid, prGlueInfo->prP2PInfo->rConnReqGroupAddr, MAC_ADDR_LEN); - prInvIndicate->name_len = prGlueInfo->prP2PInfo->u4ConnReqNameLength; - prInvIndicate->dev_name[prInvIndicate->name_len]='\0'; - COPY_MAC_ADDR(prInvIndicate->dev_addr, prGlueInfo->prP2PInfo->rConnReqPeerAddr); - prInvIndicate->config_method = prGlueInfo->prP2PInfo->i4ConnReqConfigMethod; - prInvIndicate->operating_channel = prGlueInfo->prP2PInfo->ucOperatingChnl; - prInvIndicate->invitation_type = prGlueInfo->prP2PInfo->ucInvitationType; - - return 0; -} /* end of mtk_p2p_wext_invitation_indicate() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler (IOC_P2P_GET_STRUCT) -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_invitation_status( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - P_ADAPTER_T prAdapter = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - P_IW_P2P_IOCTL_INVITATION_STATUS prInvStatus = (P_IW_P2P_IOCTL_INVITATION_STATUS)extra; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - // specify data length - wrqu->data.length = sizeof(IW_P2P_IOCTL_INVITATION_STATUS); - - // copy to upper-layer supplied buffer - prInvStatus->status_code = prGlueInfo->prP2PInfo->u4InvStatus; - - return 0; -} /* end of mtk_p2p_wext_invitation_status() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief indicate an event to supplicant for device found -* -* \param[in] prGlueInfo Pointer of GLUE_INFO_T -* -* \retval TRUE Success. -* \retval FALSE Failure -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalP2PIndicateFound( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - union iwreq_data evt; - UINT_8 aucBuffer[IW_CUSTOM_MAX]; - - ASSERT(prGlueInfo); - - memset(&evt, 0, sizeof(evt)); - - snprintf(aucBuffer, IW_CUSTOM_MAX-1, "P2P_DVC_FND"); - evt.data.length = strlen(aucBuffer); - - /* indicate IWEVP2PDVCFND event */ - wireless_send_event(prGlueInfo->prP2PInfo->prDevHandler, - IWEVCUSTOM, - &evt, - aucBuffer); - - return FALSE; -} /* end of kalP2PIndicateFound() */ - -int -mtk_p2p_wext_set_network_address ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - P_ADAPTER_T prAdapter = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - //@TODO: invoke wlan_p2p functions -#if 0 - rStatus = kalIoctl(prGlueInfo, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetP2pNetworkAddress, - prKey, - prKey->u4Length, - FALSE, - FALSE, - TRUE, - &u4BufLen); -#endif - - return 0; - -} - -int -mtk_p2p_wext_set_ps_profile ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - P_ADAPTER_T prAdapter = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - //@TODO: invoke wlan_p2p functions -#if 0 - rStatus = kalIoctl(prGlueInfo, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetP2pPowerSaveProfile, - prKey, - prKey->u4Length, - FALSE, - FALSE, - TRUE, - &u4BufLen); -#endif - - return 0; - -} - -int -mtk_p2p_wext_set_pm_param ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - P_ADAPTER_T prAdapter = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prAdapter = prGlueInfo->prAdapter; - ASSERT(prAdapter); - - //@TODO: invoke wlan_p2p functions -#if 0 - rStatus = kalIoctl(prGlueInfo, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetP2pPowerSaveProfile, - prKey, - prKey->u4Length, - FALSE, - FALSE, - TRUE, - &u4BufLen); -#endif - - return 0; - -} - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler (IOC_P2P_SET_INT) -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Setting parameters not support. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_start_formation ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - int i4Status = 0; - P_ADAPTER_T prAdapter = (P_ADAPTER_T)NULL; - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; -// struct iw_point *prData = (struct iw_point*)&wrqu->data; - P_IW_P2P_IOCTL_START_FORMATION prIoctlStartFormation = (P_IW_P2P_IOCTL_START_FORMATION)NULL; - - do { - if ((prDev == NULL) || (extra == NULL)) { - ASSERT(FALSE); - i4Status = -EINVAL; - break; - } - - - prGlueInfo = *((P_GLUE_INFO_T *)netdev_priv(prDev)); - prIoctlStartFormation = (P_IW_P2P_IOCTL_START_FORMATION)extra; - - if (prGlueInfo == NULL) { - i4Status = -EINVAL; - break; - } - - - prAdapter = prGlueInfo->prAdapter; - - if (prAdapter == NULL) { - i4Status = -EINVAL; - break; - } - - - } while (FALSE); - - return i4Status; - -} -/* mtk_p2p_wext_start_formation */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler (IOC_P2P_SET_INT) -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Setting parameters not support. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_set_int ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - int status = 0; - UINT_32 u4SubCmd = 0; - P_GLUE_INFO_T prGlueInfo = NULL; - UINT_32 index; - INT_32 value; - PUINT_32 pu4IntBuf; - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL; - P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL; - UINT_32 u4Leng; - - ASSERT(prDev); - ASSERT(wrqu); - - //printk("mtk_p2p_wext_set_int\n"); - pu4IntBuf = (PUINT_32) extra; - - if (FALSE == GLUE_CHK_PR2(prDev, wrqu)) { - return -EINVAL; - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - prP2pSpecificBssInfo = prGlueInfo->prAdapter->rWifiVar.prP2pSpecificBssInfo; - prP2pConnSettings = prGlueInfo->prAdapter->rWifiVar.prP2PConnSettings; - prP2pFsmInfo = prGlueInfo->prAdapter->rWifiVar.prP2pFsmInfo; - - u4SubCmd = (UINT_32) wrqu->mode; - index = pu4IntBuf[1]; - value = pu4IntBuf[2]; - - printk("set parameter, u4SubCmd=%d idx=%d value=%lu\n", (INT_16)u4SubCmd, (INT_16)index, value); - - switch (u4SubCmd) { - case PRIV_CMD_INT_P2P_SET: - switch (index) { - case 0: /* Listen CH */ - { - UINT_8 ucSuggestChnl = 0; - - prP2pConnSettings->ucListenChnl = value; - - // 20110920 - frog: User configurations are placed in ConnSettings. - if (rlmFuncFindAvailableChannel(prGlueInfo->prAdapter, value, &ucSuggestChnl, TRUE, TRUE)) { - prP2pSpecificBssInfo->ucListenChannel = value; - } - else { - prP2pSpecificBssInfo->ucListenChannel = ucSuggestChnl; - } - - - break; - } - case 1: /* P2p mode */ - break; - case 4: /* Noa duration */ - prP2pSpecificBssInfo->rNoaParam.u4NoaDurationMs = value; - // only to apply setting when setting NOA count - //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam); - break; - case 5: /* Noa interval */ - prP2pSpecificBssInfo->rNoaParam.u4NoaIntervalMs = value; - // only to apply setting when setting NOA count - //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam); - break; - case 6: /* Noa count */ - prP2pSpecificBssInfo->rNoaParam.u4NoaCount = value; - status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam); - break; - case 100: /* Oper CH */ - // 20110920 - frog: User configurations are placed in ConnSettings. - prP2pConnSettings->ucOperatingChnl = value; - break; - case 101: /* Local config Method, for P2P SDK */ - //prP2pConnSettings->u2LocalConfigMethod; - break; - case 102: /* Sigma P2p reset */ - kalMemZero(prP2pConnSettings->aucTargetDevAddr, MAC_ADDR_LEN); - //prP2pConnSettings->eConnectionPolicy = ENUM_P2P_CONNECTION_POLICY_AUTO; - break; - case 103: /* WPS MODE */ - kalP2PSetWscMode(prGlueInfo, value); - break; - case 104: /* P2p send persence, duration */ - break; - case 105: /* P2p send persence, interval */ - break; - case 106: /* P2P set sleep */ - value = 1; - kalIoctl(prGlueInfo, - wlanoidSetP2pPowerSaveProfile, - &value, - sizeof(value), - FALSE, - FALSE, - TRUE, - TRUE, - &u4Leng); - break; - case 107: /* P2P set opps, CTWindowl */ - prP2pSpecificBssInfo->rOppPsParam.u4CTwindowMs = value; - status = mtk_p2p_wext_set_oppps_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rOppPsParam); - break; - case 108: /* p2p_set_power_save */ - kalIoctl(prGlueInfo, - wlanoidSetP2pPowerSaveProfile, - &value, - sizeof(value), - FALSE, - FALSE, - TRUE, - TRUE, - &u4Leng); - - break; - - default: - break; - } - break; - default: - break; - } - - return status; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler (IOC_P2P_SET_STRUCT) -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_set_struct ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - int status = 0; - UINT_32 u4SubCmd = 0; - P_GLUE_INFO_T prGlueInfo = NULL; - P_IW_P2P_TRANSPORT_STRUCT prP2PReq = NULL; - - ASSERT(prDev); - ASSERT(wrqu); - - if (FALSE == GLUE_CHK_PR2(prDev, wrqu)) { - return -EINVAL; - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - u4SubCmd = (UINT_32) wrqu->data.flags; - - kalMemZero(&prGlueInfo->prP2PInfo->aucOidBuf[0], - sizeof(prGlueInfo->prP2PInfo->aucOidBuf)); - - switch (u4SubCmd) { - case PRIV_CMD_OID: - if (copy_from_user(&(prGlueInfo->prP2PInfo->aucOidBuf[0]), - wrqu->data.pointer, - wrqu->data.length)) { - status = -EFAULT; - break; - } - - if (!kalMemCmp(&(prGlueInfo->prP2PInfo->aucOidBuf[0]), extra, wrqu->data.length)) { - printk(KERN_INFO DRV_NAME"extra buffer is valid\n"); - } - else { - printk(KERN_INFO DRV_NAME"extra 0x%p\n", extra); - } - - prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT) (&(prGlueInfo->prP2PInfo->aucOidBuf[0])); - switch(prP2PReq->u4CmdId) { - case P2P_CMD_ID_SEND_SD_RESPONSE: - status = mtk_p2p_wext_send_service_discovery_response(prDev, info, wrqu, (char *)prP2PReq); - break; - - case P2P_CMD_ID_SEND_SD_REQUEST: - status = mtk_p2p_wext_send_service_discovery_request(prDev, info, wrqu, (char *)prP2PReq); - break; - - case P2P_CMD_ID_TERMINATE_SD_PHASE: - status = mtk_p2p_wext_terminate_service_discovery_phase(prDev, info, wrqu, (char *)prP2PReq); - break; - - case P2P_CMD_ID_INVITATION: - if (prP2PReq->inBufferLength == sizeof(IW_P2P_IOCTL_INVITATION_STRUCT)) { -// status = mtk_p2p_wext_invitation_request(prDev, info, wrqu, (char *)(prP2PReq->aucBuffer)); - } - break; - - case P2P_CMD_ID_INVITATION_ABORT: - if (prP2PReq->inBufferLength == sizeof(IW_P2P_IOCTL_ABORT_INVITATION)) { -// status = mtk_p2p_wext_invitation_abort(prDev, info, wrqu, (char *)(prP2PReq->aucBuffer)); - } - break; - - case P2P_CMD_ID_START_FORMATION: - if (prP2PReq->inBufferLength == sizeof(IW_P2P_IOCTL_START_FORMATION)) { - status = mtk_p2p_wext_start_formation(prDev, info, wrqu, (char *)(prP2PReq->aucBuffer)); - } - break; - default: - status = -EOPNOTSUPP; - } - - break; -#if CFG_SUPPORT_ANTI_PIRACY - case PRIV_SEC_CHECK_OID: - if (wrqu->data.length > 256) { - status = -EOPNOTSUPP; - break; - } - if (copy_from_user(&(prGlueInfo->prP2PInfo->aucSecCheck[0]), - wrqu->data.pointer, - wrqu->data.length)) { - status = -EFAULT; - break; - } - - if (!kalMemCmp(&(prGlueInfo->prP2PInfo->aucSecCheck[0]), extra, wrqu->data.length)) { - printk(KERN_INFO DRV_NAME"extra buffer is valid\n"); - } - else { - printk(KERN_INFO DRV_NAME"extra 0x%p\n", extra); - } - prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT) (&(prGlueInfo->prP2PInfo->aucSecCheck[0])); - - switch(prP2PReq->u4CmdId) { - case P2P_CMD_ID_SEC_CHECK: - status = mtk_p2p_wext_set_sec_check_request(prDev, info, wrqu, (char *)prP2PReq); - break; - default: - status = -EOPNOTSUPP; - } - break; -#endif - case PRIV_CMD_P2P_VERSION: - if (copy_from_user(&(prGlueInfo->prP2PInfo->aucOidBuf[0]), - wrqu->data.pointer, - wrqu->data.length)) { - status = -EFAULT; - break; - } - - if (!kalMemCmp(&(prGlueInfo->prP2PInfo->aucOidBuf[0]), extra, wrqu->data.length)) { - printk(KERN_INFO DRV_NAME"extra buffer is valid\n"); - } - else { - printk(KERN_INFO DRV_NAME"extra 0x%p\n", extra); - } - - prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT) (&(prGlueInfo->prP2PInfo->aucOidBuf[0])); - switch (prP2PReq->u4CmdId) { - case P2P_CMD_ID_P2P_VERSION: - status = mtk_p2p_wext_set_p2p_version(prDev, info, wrqu, (char *)prP2PReq); - break; - default: - status = -EOPNOTSUPP; - break; - } - break; - default: - status = -EOPNOTSUPP; - break; - } - - return status; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler (IOC_P2P_GET_STRUCT) -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_get_struct ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - int status = 0; - UINT_32 u4SubCmd = 0; - P_GLUE_INFO_T prGlueInfo = NULL; - P_IW_P2P_TRANSPORT_STRUCT prP2PReq = NULL; - - ASSERT(prDev); - ASSERT(wrqu); - - if (!prDev || !wrqu) { - printk(KERN_INFO DRV_NAME "%s(): invalid param(0x%p, 0x%p)\n", - __func__, - prDev, - wrqu); - return -EINVAL; - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - u4SubCmd = (UINT_32) wrqu->data.flags; - - kalMemZero(&(prGlueInfo->prP2PInfo->aucOidBuf[0]), - sizeof(prGlueInfo->prP2PInfo->aucOidBuf)); - - switch (u4SubCmd) { - case PRIV_CMD_OID: - if (copy_from_user(&(prGlueInfo->prP2PInfo->aucOidBuf[0]), - wrqu->data.pointer, - sizeof(IW_P2P_TRANSPORT_STRUCT))) { - printk(KERN_NOTICE "%s() copy_from_user oidBuf fail\n", __func__); - return -EFAULT; - } - - prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT) (&(prGlueInfo->prP2PInfo->aucOidBuf[0])); - - switch(prP2PReq->u4CmdId) { - case P2P_CMD_ID_GET_SD_REQUEST: - status = mtk_p2p_wext_get_service_discovery_request(prDev, info, wrqu, (char *)prP2PReq); - break; - - case P2P_CMD_ID_GET_SD_RESPONSE: - status = mtk_p2p_wext_get_service_discovery_response(prDev, info, wrqu, (char *)prP2PReq); - break; - - case P2P_CMD_ID_INVITATION_INDICATE: - { - status = mtk_p2p_wext_invitation_indicate(prDev, info, wrqu, (char *)(prP2PReq->aucBuffer)); - prP2PReq->outBufferLength = wrqu->data.length; - if (copy_to_user(wrqu->data.pointer, - &(prGlueInfo->prP2PInfo->aucOidBuf[0]), - wrqu->data.length + OFFSET_OF(IW_P2P_TRANSPORT_STRUCT, aucBuffer))) { - printk(KERN_NOTICE "%s() copy_to_user() fail\n", __func__); - return -EIO; - } - else { - return 0; - } - break; - } - case P2P_CMD_ID_INVITATION_STATUS: - { - status = mtk_p2p_wext_invitation_status(prDev, info, wrqu, (char *)(prP2PReq->aucBuffer)); - prP2PReq->outBufferLength = wrqu->data.length; - if (copy_to_user(wrqu->data.pointer, - &(prGlueInfo->prP2PInfo->aucOidBuf[0]), - wrqu->data.length + OFFSET_OF(IW_P2P_TRANSPORT_STRUCT, aucBuffer))) { - printk(KERN_NOTICE "%s() copy_to_user() fail\n", __func__); - return -EIO; - } - else { - return 0; - } - break; - } - case P2P_CMD_ID_GET_CH_LIST: - { - UINT_16 i; - UINT_8 NumOfChannel = 50; - RF_CHANNEL_INFO_T aucChannelList[50]; - UINT_8 ucMaxChannelNum = 50; - PUINT_8 pucChnlList = (PUINT_8)prP2PReq->aucBuffer; - - kalGetChnlList(prGlueInfo, BAND_NULL, ucMaxChannelNum, &NumOfChannel, aucChannelList); - if (NumOfChannel > 50) - NumOfChannel = 50; - prP2PReq->outBufferLength = NumOfChannel; - - for (i=0; iaucBuffer[i] = aucChannelList[i].ucChannelNum; -#else - *pucChnlList = aucChannelList[i].ucChannelNum; - pucChnlList++; -#endif - } - if(copy_to_user(wrqu->data.pointer, - &(prGlueInfo->prP2PInfo->aucOidBuf[0]), - NumOfChannel + OFFSET_OF(IW_P2P_TRANSPORT_STRUCT, aucBuffer))) { - printk(KERN_NOTICE "%s() copy_to_user() fail\n", __func__); - return -EIO; - } - else { - return 0; - } - break; - } - - case P2P_CMD_ID_GET_OP_CH: - { - prP2PReq->inBufferLength = 4; - - status = wlanoidQueryP2pOpChannel(prGlueInfo->prAdapter, - prP2PReq->aucBuffer, - prP2PReq->inBufferLength, - &prP2PReq->outBufferLength); - - if (status == 0) { // WLAN_STATUS_SUCCESS - if (copy_to_user(wrqu->data.pointer, - &(prGlueInfo->prP2PInfo->aucOidBuf[0]), - prP2PReq->outBufferLength + OFFSET_OF(IW_P2P_TRANSPORT_STRUCT, aucBuffer))) { - printk(KERN_NOTICE "%s() copy_to_user() fail\n", __func__); - return -EIO; - } - } - else { - if (copy_to_user(wrqu->data.pointer, - &(prGlueInfo->prP2PInfo->aucOidBuf[0]), - OFFSET_OF(IW_P2P_TRANSPORT_STRUCT, aucBuffer))) { - printk(KERN_NOTICE "%s() copy_to_user() fail\n", __func__); - return -EIO; - } - } - break; - } - - default: - status = -EOPNOTSUPP; - } - - break; -#if CFG_SUPPORT_ANTI_PIRACY - case PRIV_SEC_CHECK_OID: - if (wrqu->data.length > 256) { - status = -EOPNOTSUPP; - break; - } - if (copy_from_user(&(prGlueInfo->prP2PInfo->aucSecCheck[0]), - wrqu->data.pointer, - sizeof(IW_P2P_TRANSPORT_STRUCT))) { - printk(KERN_NOTICE "%s() copy_from_user oidBuf fail\n", __func__); - return -EFAULT; - } - - prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT) (&(prGlueInfo->prP2PInfo->aucSecCheck[0])); - - switch(prP2PReq->u4CmdId) { - case P2P_CMD_ID_SEC_CHECK: - status = mtk_p2p_wext_get_sec_check_response(prDev, info, wrqu, (char *)prP2PReq); - break; - default: - status = -EOPNOTSUPP; - } - break; -#endif - case PRIV_CMD_P2P_VERSION: - if (copy_from_user(&(prGlueInfo->prP2PInfo->aucOidBuf[0]), - wrqu->data.pointer, - sizeof(IW_P2P_TRANSPORT_STRUCT))) { - printk(KERN_NOTICE "%s() copy_from_user oidBuf fail\n", __func__); - return -EFAULT; - } - - prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT) (&(prGlueInfo->prP2PInfo->aucOidBuf[0])); - - switch (prP2PReq->u4CmdId) { - case P2P_CMD_ID_P2P_VERSION: - status = mtk_p2p_wext_get_p2p_version(prDev, info, wrqu, (char *)prP2PReq); - break; - default: - status = -EOPNOTSUPP; - break; - } - - - /* Copy queried data to user. */ - if (status == 0) { // WLAN_STATUS_SUCCESS - if(copy_to_user(wrqu->data.pointer, - &(prGlueInfo->prP2PInfo->aucOidBuf[0]), - prP2PReq->outBufferLength + OFFSET_OF(IW_P2P_TRANSPORT_STRUCT, aucBuffer))) { - printk(KERN_NOTICE "%s() copy_to_user() fail\n", __func__); - return -EIO; - } - } - - else { - if(copy_to_user(wrqu->data.pointer, - &(prGlueInfo->prP2PInfo->aucOidBuf[0]), - OFFSET_OF(IW_P2P_TRANSPORT_STRUCT, aucBuffer))) { - printk(KERN_NOTICE "%s() copy_to_user() fail\n", __func__); - return -EIO; - } - } - - break; - default: - return -EOPNOTSUPP; - } - - return status; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler for -* getting service discovery request frame from driver -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_get_service_discovery_request ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4QueryInfoLen; - P_IW_P2P_TRANSPORT_STRUCT prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT)extra; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - rStatus = kalIoctl(prGlueInfo, - wlanoidGetP2PSDRequest, - prP2PReq->aucBuffer, - prP2PReq->outBufferLength, - TRUE, - FALSE, - TRUE, - TRUE, - &u4QueryInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - return -EFAULT; - } - else { - prP2PReq->outBufferLength = u4QueryInfoLen; - - if(copy_to_user(wrqu->data.pointer, - &(prGlueInfo->prP2PInfo->aucOidBuf[0]), - u4QueryInfoLen + OFFSET_OF(IW_P2P_TRANSPORT_STRUCT, aucBuffer))) { - printk(KERN_NOTICE "%s() copy_to_user() fail\n", __func__); - return -EIO; - } - else { - return 0; - } - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler for -* getting service discovery response frame from driver -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_get_service_discovery_response ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4QueryInfoLen; - P_IW_P2P_TRANSPORT_STRUCT prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT)extra; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - rStatus = kalIoctl(prGlueInfo, - wlanoidGetP2PSDResponse, - prP2PReq->aucBuffer, - prP2PReq->outBufferLength, - TRUE, - FALSE, - TRUE, - TRUE, - &u4QueryInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - return -EFAULT; - } - else { - prP2PReq->outBufferLength = u4QueryInfoLen; - - if(copy_to_user(wrqu->data.pointer, - &(prGlueInfo->prP2PInfo->aucOidBuf[0]), - u4QueryInfoLen + OFFSET_OF(IW_P2P_TRANSPORT_STRUCT, aucBuffer))) { - printk(KERN_NOTICE "%s() copy_to_user() fail\n", __func__); - return -EIO; - } - else { - return 0; - } - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler for -* sending service discovery request frame -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_send_service_discovery_request ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4SetInfoLen; - P_IW_P2P_TRANSPORT_STRUCT prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT)extra; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSendP2PSDRequest, - prP2PReq->aucBuffer, - prP2PReq->inBufferLength, - FALSE, - FALSE, - TRUE, - TRUE, - &u4SetInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - return -EFAULT; - } - else { - return 0; - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler for -* sending service discovery response frame -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_send_service_discovery_response ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4SetInfoLen; - P_IW_P2P_TRANSPORT_STRUCT prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT)extra; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSendP2PSDResponse, - prP2PReq->aucBuffer, - prP2PReq->inBufferLength, - FALSE, - FALSE, - TRUE, - TRUE, - &u4SetInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - return -EFAULT; - } - else { - return 0; - } -} - -#if CFG_SUPPORT_ANTI_PIRACY -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler for -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_set_sec_check_request ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4SetInfoLen; - P_IW_P2P_TRANSPORT_STRUCT prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT)extra; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetSecCheckRequest, - prP2PReq->aucBuffer, - prP2PReq->inBufferLength, - FALSE, - FALSE, - TRUE, - TRUE, - &u4SetInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - return -EFAULT; - } - else { - return 0; - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler for -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_get_sec_check_response ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4QueryInfoLen; - P_IW_P2P_TRANSPORT_STRUCT prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT)extra; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - printk("mtk_p2p_wext_get_sec_check_response\n"); - rStatus = kalIoctl(prGlueInfo, - wlanoidGetSecCheckResponse, - prP2PReq->aucBuffer, - prP2PReq->outBufferLength, - TRUE, - FALSE, - TRUE, - TRUE, - &u4QueryInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - return -EFAULT; - } - else { - prP2PReq->outBufferLength = u4QueryInfoLen; - - if(copy_to_user(wrqu->data.pointer, - prP2PReq->aucBuffer, - u4QueryInfoLen + OFFSET_OF(IW_P2P_TRANSPORT_STRUCT, aucBuffer))) { - printk(KERN_NOTICE "%s() copy_to_user() fail\n", __func__); - return -EIO; - } - else { - return 0; - } - } -} -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler for -* terminating service discovery phase -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_terminate_service_discovery_phase ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4SetInfoLen; - P_IW_P2P_TRANSPORT_STRUCT prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT)extra; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetP2PTerminateSDPhase, - prP2PReq->aucBuffer, - prP2PReq->inBufferLength, - FALSE, - FALSE, - TRUE, - TRUE, - &u4SetInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - return -EFAULT; - } - else { - return 0; - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler for -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_set_noa_param ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4SetInfoLen; - //P_IW_P2P_TRANSPORT_STRUCT prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT)extra; - P_PARAM_CUSTOM_NOA_PARAM_STRUC_T prNoaParam = (P_PARAM_CUSTOM_NOA_PARAM_STRUC_T)extra; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - printk("mtk_p2p_wext_set_noa_param\n"); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetNoaParam, - prNoaParam, //prP2PReq->aucBuffer, - sizeof(PARAM_CUSTOM_NOA_PARAM_STRUC_T),//prP2PReq->inBufferLength, - FALSE, - FALSE, - TRUE, - TRUE, - &u4SetInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - return -EFAULT; - } - else { - return 0; - } -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief P2P Private I/O Control handler for -* -* \param[in] prDev Net device requested. -* \param[inout] wrqu Pointer to iwreq_data -* -* \retval 0 Success. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -mtk_p2p_wext_set_oppps_param ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4SetInfoLen; -// P_IW_P2P_TRANSPORT_STRUCT prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT)extra; - P_PARAM_CUSTOM_OPPPS_PARAM_STRUC_T prOppPsParam = (P_PARAM_CUSTOM_OPPPS_PARAM_STRUC_T)extra; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - printk("mtk_p2p_wext_set_oppps_param\n"); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetOppPsParam, - prOppPsParam, //prP2PReq->aucBuffer, - sizeof(PARAM_CUSTOM_OPPPS_PARAM_STRUC_T), //prP2PReq->inBufferLength, - FALSE, - FALSE, - TRUE, - TRUE, - &u4SetInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - return -EFAULT; - } - else { - return 0; - } -} - - -int -mtk_p2p_wext_set_p2p_version ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - P_GLUE_INFO_T prGlueInfo = NULL; - P_IW_P2P_TRANSPORT_STRUCT prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT)extra; - UINT_32 u4SetInfoLen; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetP2pSupplicantVersion, - prP2PReq->aucBuffer, - prP2PReq->inBufferLength, - FALSE, - FALSE, - TRUE, - TRUE, - &u4SetInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - return -EFAULT; - } - else { - return rStatus; - } - - -} -/* mtk_p2p_wext_set_p2p_version */ - -int -mtk_p2p_wext_get_p2p_version ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4QueryInfoLen; - P_IW_P2P_TRANSPORT_STRUCT prP2PReq = (P_IW_P2P_TRANSPORT_STRUCT)extra; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryP2pVersion, - prP2PReq->aucBuffer, - prP2PReq->outBufferLength, - TRUE, - FALSE, - TRUE, - TRUE, - &u4QueryInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - return -EFAULT; - } - else { - return rStatus; - } - - -} /* mtk_p2p_wext_get_p2p_version */ - -#if CFG_SUPPORT_P2P_RSSI_QUERY - -int -mtk_p2p_wext_get_rssi ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4QueryInfoLen; - struct iw_point *prData= (struct iw_point *)&wrqu->data; - UINT_16 u2BufferSize = 0; - P_GLUE_INFO_T prGlueInfo = NULL; - INT_32 i4Rssi; - struct iw_statistics *pStats = NULL; - - ASSERT(prDev); - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - - if (!prGlueInfo) { - rStatus = WLAN_STATUS_FAILURE; - goto stat_out; - } - - pStats = (struct iw_statistics *) (&(prGlueInfo->rP2pIwStats)); - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryP2pRssi, - &i4Rssi, - sizeof(i4Rssi), - TRUE, - TRUE, - TRUE, - TRUE, - &u4QueryInfoLen); - - u2BufferSize = prData->length; - - if (u2BufferSize < sizeof(struct iw_statistics)) { - return -E2BIG; - } - - - if (copy_to_user(prData->pointer, pStats, sizeof(struct iw_statistics))) { - rStatus = WLAN_STATUS_FAILURE; - } - - -stat_out: - - if (rStatus != WLAN_STATUS_SUCCESS) { - return -EFAULT; - } - else { - return rStatus; - } - -} /* mtk_p2p_wext_get_rssi */ - -struct iw_statistics * -mtk_p2p_wext_get_wireless_stats ( - struct net_device *prDev - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_FAILURE; - P_GLUE_INFO_T prGlueInfo = NULL; - struct iw_statistics *pStats = NULL; - INT_32 i4Rssi; - UINT_32 bufLen = 0; - - prGlueInfo = *((P_GLUE_INFO_T *)netdev_priv(prDev)); - ASSERT(prGlueInfo); - if (!prGlueInfo) { - goto stat_out; - } - - pStats = (struct iw_statistics *) (&(prGlueInfo->rP2pIwStats)); - - if (!prDev || !netif_carrier_ok(prDev)) { - /* network not connected */ - goto stat_out; - } - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryP2pRssi, - &i4Rssi, - sizeof(i4Rssi), - TRUE, - TRUE, - TRUE, - TRUE, - &bufLen); - -stat_out: - return pStats; -} /* mtk_p2p_wext_get_wireless_stats */ - - -#endif /* CFG_SUPPORT_P2P_RSSI_QUERY */ - - -int -mtk_p2p_wext_set_txpow ( - IN struct net_device *prDev, - IN struct iw_request_info *prIwrInfo, - IN OUT union iwreq_data *prTxPow, - IN char *pcExtra - ) -{ - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - P_ADAPTER_T prAdapter = (P_ADAPTER_T)NULL; -#if 0 - P_MSG_P2P_FUNCTION_SWITCH_T prMsgFuncSwitch = (P_MSG_P2P_FUNCTION_SWITCH_T)NULL; -#endif - int i4Ret = 0; - - ASSERT(prDev); - ASSERT(prTxPow); - - do { - if ((!prDev) || (!prTxPow)) { - i4Ret = -EINVAL; - break; - } - - - prGlueInfo = *((P_GLUE_INFO_T *)netdev_priv(prDev)); - - if (!prGlueInfo) { - i4Ret = -EINVAL; - break; - } - - - prAdapter = prGlueInfo->prAdapter; -#if 0 - prMsgFuncSwitch = (P_MSG_P2P_FUNCTION_SWITCH_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_FUNCTION_SWITCH_T)); - if (!prMsgFuncSwitch) { - ASSERT(0); - return -ENOMEM; - } - - prMsgFuncSwitch->rMsgHdr.eMsgId = MID_MNY_P2P_FUN_SWITCH; - - if (prTxPow->disabled) { - /* Dissolve. */ - prMsgFuncSwitch->fgIsFuncOn = FALSE; - } - else { - - /* Re-enable function. */ - prMsgFuncSwitch->fgIsFuncOn = TRUE; - } - - /* 1.3 send message */ - mboxSendMsg(prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T) prMsgFuncSwitch, - MSG_SEND_METHOD_BUF); -#endif - - } while (FALSE); - - return i4Ret; -} /* mtk_p2p_wext_set_txpow */ - - diff --git a/drivers/net/wireless/mt5931/os/linux/gl_p2p_cfg80211.c b/drivers/net/wireless/mt5931/os/linux/gl_p2p_cfg80211.c deleted file mode 100755 index f3488998fbbd..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/gl_p2p_cfg80211.c +++ /dev/null @@ -1,2226 +0,0 @@ -/* -** $Id: @(#) gl_p2p_cfg80211.c@@ -*/ - -/*! \file gl_p2p_cfg80211.c - \brief Main routines of Linux driver interface for Wi-Fi Direct - using cfg80211 interface - - This file contains the main routines of Linux driver for MediaTek Inc. 802.11 - Wireless LAN Adapters. -*/ - -/******************************************************************************* -* Copyright (c) 2007 MediaTek Inc. -* -* All rights reserved. Copying, compilation, modification, distribution -* or any other use whatsoever of this material is strictly prohibited -* except in accordance with a Software License Agreement with -* MediaTek Inc. -******************************************************************************** -*/ - -/******************************************************************************* -* LEGAL DISCLAIMER -* -* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND -* AGREES THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK -* SOFTWARE") RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE -* PROVIDED TO BUYER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY -* DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT -* LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -* PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE -* ANY WARRANTY WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY -* WHICH MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK -* SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY -* WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE -* FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION OR TO -* CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. -* -* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE -* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL -* BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT -* ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY -* BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -* -* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE -* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT -* OF LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING -* THEREOF AND RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN -* FRANCISCO, CA, UNDER THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE -* (ICC). -******************************************************************************** -*/ - -/* -** $Log: gl_p2p_cfg80211.c $ -** -** 08 31 2012 yuche.tsai -** [ALPS00349585] [6577JB][WiFi direct][KE]Establish p2p connection while both device have connected to AP previously,one device reboots automatically with KE -** Fix possible KE when concurrent & disconnect. -** -** 08 21 2012 yuche.tsai -** NULL -** Fix compile warning. -** -** 08 20 2012 yuche.tsai -** NULL -** Fix possible KE issue. -** -** 08 17 2012 yuche.tsai -** NULL -** Fix compile warning. -** -** 08 16 2012 yuche.tsai -** NULL -** Fix compile warning. -** -** 08 14 2012 yuche.tsai -** NULL -** Fix p2p bug find on ALPS.JB trunk. -** -** 07 26 2012 yuche.tsai -** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot -** Update driver code of ALPS.JB for hot-spot. -** -** 07 19 2012 yuche.tsai -** NULL -** Code update for JB. - * - * 07 17 2012 yuche.tsai - * NULL - * Fix compile error for JB. - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 09 21 2010 kevin.huang - * [WCXRP00000054] [MT6620 Wi-Fi][Driver] Restructure driver for second Interface - * Isolate P2P related function for Hardware Software Bundle - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 31 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add cfg80211 interface, which is to replace WE, for further extension - * -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -#include "config.h" - -#if CFG_ENABLE_WIFI_DIRECT && CFG_ENABLE_WIFI_DIRECT_CFG_80211 -#include -#include -#include -#include -#include - -#include "precomp.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - - -BOOLEAN -mtk_p2p_cfg80211func_channel_format_switch( - IN struct ieee80211_channel *channel, - IN enum nl80211_channel_type channel_type, - IN P_RF_CHANNEL_INFO_T prRfChnlInfo, - IN P_ENUM_CHNL_EXT_T prChnlSco - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) -int mtk_p2p_cfg80211_add_key( - struct wiphy *wiphy, - struct net_device *ndev, - u8 key_index, - bool pairwise, - const u8 *mac_addr, - struct key_params *params - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - INT_32 i4Rslt = -EINVAL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - P2P_PARAM_KEY_T rKey; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - kalMemZero(&rKey, sizeof(P2P_PARAM_KEY_T)); - - rKey.u4KeyIndex = key_index; - if(mac_addr) { - memcpy(rKey.arBSSID, mac_addr, ETH_ALEN); - if ((rKey.arBSSID[0] == 0x00) && (rKey.arBSSID[1] == 0x00) && (rKey.arBSSID[2] == 0x00) && - (rKey.arBSSID[3] == 0x00) && (rKey.arBSSID[4] == 0x00) && (rKey.arBSSID[5] == 0x00)) { - rKey.arBSSID[0] = 0xff; - rKey.arBSSID[1] = 0xff; - rKey.arBSSID[2] = 0xff; - rKey.arBSSID[3] = 0xff; - rKey.arBSSID[4] = 0xff; - rKey.arBSSID[5] = 0xff; - } - if (rKey.arBSSID[0] != 0xFF) { - rKey.u4KeyIndex |= BIT(31); - if ((rKey.arBSSID[0] != 0x00) || (rKey.arBSSID[1] != 0x00) || (rKey.arBSSID[2] != 0x00) || - (rKey.arBSSID[3] != 0x00) || (rKey.arBSSID[4] != 0x00) || (rKey.arBSSID[5] != 0x00)) - rKey.u4KeyIndex |= BIT(30); - } - else { - rKey.u4KeyIndex |= BIT(31); - } - } - else { - rKey.arBSSID[0] = 0xff; - rKey.arBSSID[1] = 0xff; - rKey.arBSSID[2] = 0xff; - rKey.arBSSID[3] = 0xff; - rKey.arBSSID[4] = 0xff; - rKey.arBSSID[5] = 0xff; - rKey.u4KeyIndex |= BIT(31); //???? - } - if(params->key) - { - //rKey.aucKeyMaterial[0] = kalMemAlloc(params->key_len, VIR_MEM_TYPE); - kalMemCopy(rKey.aucKeyMaterial, params->key, params->key_len); - } - rKey.u4KeyLength = params->key_len; - rKey.u4Length = ((UINT_32)&(((P_P2P_PARAM_KEY_T)0)->aucKeyMaterial)) + rKey.u4KeyLength; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetAddP2PKey, - &rKey, - rKey.u4Length, - FALSE, - FALSE, - TRUE, - TRUE, - &u4BufLen); - if (rStatus == WLAN_STATUS_SUCCESS) - i4Rslt = 0; - - return i4Rslt; -} - - -int mtk_p2p_cfg80211_get_key( - struct wiphy *wiphy, - struct net_device *ndev, - u8 key_index, - bool pairwise, - const u8 *mac_addr, - void *cookie, - void (*callback)(void *cookie, struct key_params*) - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - // not implemented yet - - return -EINVAL; -} - -int mtk_p2p_cfg80211_del_key( - struct wiphy *wiphy, - struct net_device *ndev, - u8 key_index, - bool pairwise, - const u8 *mac_addr - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - PARAM_REMOVE_KEY_T prRemoveKey; - INT_32 i4Rslt = -EINVAL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - kalMemZero(&prRemoveKey, sizeof(PARAM_REMOVE_KEY_T)); - if(mac_addr) - memcpy(prRemoveKey.arBSSID, mac_addr, PARAM_MAC_ADDR_LEN); - prRemoveKey.u4KeyIndex = key_index; - prRemoveKey.u4Length = sizeof(PARAM_REMOVE_KEY_T); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetRemoveP2PKey, - &prRemoveKey, - prRemoveKey.u4Length, - FALSE, - FALSE, - TRUE, - TRUE, - &u4BufLen); - - if (rStatus == WLAN_STATUS_SUCCESS) - i4Rslt = 0; - - return i4Rslt; -} - - -int -mtk_p2p_cfg80211_set_default_key ( - struct wiphy *wiphy, - struct net_device *netdev, - u8 key_index, - bool unicast, - bool multicast - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - // not implemented yet - - return -EINVAL; -} - -int mtk_p2p_cfg80211_get_station( - struct wiphy *wiphy, - struct net_device *ndev, - u8 *mac, - struct station_info *sinfo - ) -{ - INT_32 i4RetRslt = -EINVAL; - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - P_GL_P2P_INFO_T prP2pGlueInfo = (P_GL_P2P_INFO_T)NULL; - P2P_STATION_INFO_T rP2pStaInfo; - - ASSERT(wiphy); - - do { - if ((wiphy == NULL) || - (ndev == NULL) || - (sinfo == NULL) || - (mac == NULL)) { - break; - } - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_get_station\n")); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - prP2pGlueInfo = prGlueInfo->prP2PInfo; - - sinfo->filled = 0; - - /* Get station information. */ - /* 1. Inactive time? */ - p2pFuncGetStationInfo(prGlueInfo->prAdapter, - mac, - &rP2pStaInfo); - - /* Inactive time. */ - sinfo->filled |= STATION_INFO_INACTIVE_TIME; - sinfo->inactive_time = rP2pStaInfo.u4InactiveTime; - sinfo->generation = prP2pGlueInfo->i4Generation; - - i4RetRslt = 0; - } while (FALSE); - - return i4RetRslt; -} - -int -mtk_p2p_cfg80211_scan ( - struct wiphy *wiphy, - struct net_device *ndev, - struct cfg80211_scan_request *request - ) -{ - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - P_GL_P2P_INFO_T prP2pGlueInfo = (P_GL_P2P_INFO_T)NULL; - P_MSG_P2P_SCAN_REQUEST_T prMsgScanRequest = (P_MSG_P2P_SCAN_REQUEST_T)NULL; - UINT_32 u4MsgSize = 0, u4Idx = 0; - INT_32 i4RetRslt = -EINVAL; - P_RF_CHANNEL_INFO_T prRfChannelInfo = (P_RF_CHANNEL_INFO_T)NULL; - P_P2P_SSID_STRUCT_T prSsidStruct = (P_P2P_SSID_STRUCT_T)NULL; - struct ieee80211_channel *prChannel = NULL; - struct cfg80211_ssid *prSsid = NULL; - - /* [---------Channel---------] [---------SSID---------][---------IE---------] */ - - - do { - if ((wiphy == NULL) || (request == NULL)) { - break; - } - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - prP2pGlueInfo = prGlueInfo->prP2PInfo; - - if (prP2pGlueInfo == NULL) { - ASSERT(FALSE); - break; - } - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_scan.\n")); - - - if (prP2pGlueInfo->prScanRequest != NULL) { - /* There have been a scan request on-going processing. */ - DBGLOG(P2P, TRACE, ("There have been a scan request on-going processing.\n")); - break; - } - - prP2pGlueInfo->prScanRequest = request; - - /* Should find out why the n_channels so many? */ - if (request->n_channels > MAXIMUM_OPERATION_CHANNEL_LIST) { - request->n_channels = MAXIMUM_OPERATION_CHANNEL_LIST; - DBGLOG(P2P, TRACE, ("Channel list exceed the maximun support.\n")); - } - - u4MsgSize = sizeof(MSG_P2P_SCAN_REQUEST_T) + - (request->n_channels * sizeof(RF_CHANNEL_INFO_T)) + - (request->n_ssids * sizeof(PARAM_SSID_T)) + - request->ie_len; - - prMsgScanRequest = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, u4MsgSize); - - if (prMsgScanRequest == NULL) { - ASSERT(FALSE); - i4RetRslt = -ENOMEM; - break; - } - - DBGLOG(P2P, TRACE, ("Generating scan request message.\n")); - - prMsgScanRequest->rMsgHdr.eMsgId = MID_MNY_P2P_DEVICE_DISCOVERY; - - - - DBGLOG(P2P, TRACE, ("Requesting channel number:%d.\n", request->n_channels)); - - for (u4Idx = 0; u4Idx < request->n_channels; u4Idx++) { - /* Translate Freq from MHz to channel number. */ - prRfChannelInfo = &(prMsgScanRequest->arChannelListInfo[u4Idx]); - prChannel = request->channels[u4Idx]; - - prRfChannelInfo->ucChannelNum = nicFreq2ChannelNum(prChannel->center_freq * 1000); - DBGLOG(P2P, TRACE, ("Scanning Channel:%d, freq: %d\n", - prRfChannelInfo->ucChannelNum, - prChannel->center_freq)); - switch (prChannel->band) { - case IEEE80211_BAND_2GHZ: - prRfChannelInfo->eBand = BAND_2G4; - break; - case IEEE80211_BAND_5GHZ: - prRfChannelInfo->eBand = BAND_5G; - break; - default: - DBGLOG(P2P, TRACE, ("UNKNOWN Band info from supplicant\n")); - prRfChannelInfo->eBand = BAND_NULL; - break; - } - - /* Iteration. */ - prRfChannelInfo++; - } - prMsgScanRequest->u4NumChannel = request->n_channels; - - DBGLOG(P2P, TRACE, ("Finish channel list.\n")); - - /* SSID */ - prSsid = request->ssids; - prSsidStruct = (P_P2P_SSID_STRUCT_T)prRfChannelInfo; - if (request->n_ssids) { - ASSERT(prSsidStruct == &(prMsgScanRequest->arChannelListInfo[u4Idx])); - prMsgScanRequest->prSSID = prSsidStruct; - } - - for (u4Idx = 0; u4Idx < request->n_ssids; u4Idx++) { - COPY_SSID(prSsidStruct->aucSsid, - prSsidStruct->ucSsidLen, - request->ssids->ssid, - request->ssids->ssid_len); - - prSsidStruct++; - prSsid++; - } - - prMsgScanRequest->i4SsidNum = request->n_ssids; - - DBGLOG(P2P, TRACE, ("Finish SSID list:%d.\n", request->n_ssids)); - - /* IE BUFFERS */ - prMsgScanRequest->pucIEBuf = (PUINT_8)prSsidStruct; - if (request->ie_len) { - kalMemCopy(prMsgScanRequest->pucIEBuf, request->ie, request->ie_len); - prMsgScanRequest->u4IELen = request->ie_len; - } - - DBGLOG(P2P, TRACE, ("Finish IE Buffer.\n")); - - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prMsgScanRequest, - MSG_SEND_METHOD_BUF); - - i4RetRslt = 0; - } while (FALSE); - - return i4RetRslt; -} /* mtk_p2p_cfg80211_scan */ - -int mtk_p2p_cfg80211_set_wiphy_params( - struct wiphy *wiphy, - u32 changed - ) -{ - INT_32 i4Rslt = -EINVAL; - P_GLUE_INFO_T prGlueInfo = NULL; - - - do { - if (wiphy == NULL) { - break; - } - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_set_wiphy_params\n")); - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - if (changed & WIPHY_PARAM_RETRY_SHORT) { - // TODO: - DBGLOG(P2P, TRACE, ("The RETRY short param is changed.\n")); - } - - if (changed & WIPHY_PARAM_RETRY_LONG) { - // TODO: - DBGLOG(P2P, TRACE, ("The RETRY long param is changed.\n")); - } - - - if (changed & WIPHY_PARAM_FRAG_THRESHOLD) { - // TODO: - DBGLOG(P2P, TRACE, ("The RETRY fragmentation threshold is changed.\n")); - } - - if (changed & WIPHY_PARAM_RTS_THRESHOLD) { - // TODO: - DBGLOG(P2P, TRACE, ("The RETRY RTS threshold is changed.\n")); - } - - if (changed & WIPHY_PARAM_COVERAGE_CLASS) { - // TODO: - DBGLOG(P2P, TRACE, ("The coverage class is changed???\n")); - } - - i4Rslt = 0; - } while (FALSE); - - - - - return i4Rslt; -} /* mtk_p2p_cfg80211_set_wiphy_params */ - - - -int -mtk_p2p_cfg80211_join_ibss( - struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_ibss_params *params - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - // not implemented yet - - return -EINVAL; -} - -int -mtk_p2p_cfg80211_leave_ibss( - struct wiphy *wiphy, - struct net_device *dev - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - // not implemented yet - - return -EINVAL; -} - -int -mtk_p2p_cfg80211_set_txpower( - struct wiphy *wiphy, - enum nl80211_tx_power_setting type, - int mbm - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - // not implemented yet - - return -EINVAL; -} - -int -mtk_p2p_cfg80211_get_txpower( - struct wiphy *wiphy, - int *dbm - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - // not implemented yet - - return -EINVAL; -} - -int -mtk_p2p_cfg80211_set_power_mgmt( - struct wiphy *wiphy, - struct net_device *dev, - bool enabled, - int timeout - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - // not implemented yet - // TODO: for JB. - - return -EINVAL; -} - -//&&&&&&&&&&&&&&&&&&&&&&&&&& Add for ICS Wi-Fi Direct Support. &&&&&&&&&&&&&&&&&&&&&&& -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) -int -mtk_p2p_cfg80211_start_ap ( - struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_ap_settings *settings - ) -{ - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - INT_32 i4Rslt = -EINVAL; - P_MSG_P2P_BEACON_UPDATE_T prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)NULL; - P_MSG_P2P_START_AP_T prP2pStartAPMsg = (P_MSG_P2P_START_AP_T)NULL; - PUINT_8 pucBuffer = (PUINT_8)NULL; -// P_IE_SSID_T prSsidIE = (P_IE_SSID_T)NULL; - - do { - if ((wiphy == NULL) || (settings == NULL)) { - break; - } - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_start_ap.\n")); - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)cnmMemAlloc( - prGlueInfo->prAdapter, - RAM_TYPE_MSG, - (sizeof(MSG_P2P_BEACON_UPDATE_T) + settings->beacon.head_len + settings->beacon.tail_len)); - - if (prP2pBcnUpdateMsg == NULL) { - ASSERT(FALSE); - i4Rslt = -ENOMEM; - break; - } - - - prP2pBcnUpdateMsg->rMsgHdr.eMsgId = MID_MNY_P2P_BEACON_UPDATE; - pucBuffer = prP2pBcnUpdateMsg->aucBuffer; - - if (settings->beacon.head_len != 0) { - kalMemCopy(pucBuffer, settings->beacon.head, settings->beacon.head_len); - - prP2pBcnUpdateMsg->u4BcnHdrLen = settings->beacon.head_len; - - prP2pBcnUpdateMsg->pucBcnHdr = pucBuffer; - - pucBuffer = (PUINT_8)((UINT_32)pucBuffer + (UINT_32)settings->beacon.head_len); - } - else { - prP2pBcnUpdateMsg->u4BcnHdrLen = 0; - - prP2pBcnUpdateMsg->pucBcnHdr = NULL; - } - - if (settings->beacon.tail_len != 0) { - UINT_8 ucLen = settings->beacon.tail_len; - - prP2pBcnUpdateMsg->pucBcnBody = pucBuffer; - - /*Add TIM IE*/ - // IEEE 802.11 2007 - 7.3.2.6 - TIM_IE(pucBuffer)->ucId = ELEM_ID_TIM; - TIM_IE(pucBuffer)->ucLength = (3 + MAX_LEN_TIM_PARTIAL_BMP)/*((u4N2 - u4N1) + 4)*/; // NOTE: fixed PVB length (AID is allocated from 8 ~ 15 only) - TIM_IE(pucBuffer)->ucDTIMCount = 0/*prBssInfo->ucDTIMCount*/; // will be overwrite by FW - TIM_IE(pucBuffer)->ucDTIMPeriod = 1; - TIM_IE(pucBuffer)->ucBitmapControl = 0/*ucBitmapControl | (UINT_8)u4N1*/; // will be overwrite by FW - ucLen += IE_SIZE(pucBuffer); - pucBuffer += IE_SIZE(pucBuffer); - - kalMemCopy(pucBuffer, settings->beacon.tail, settings->beacon.tail_len); - - prP2pBcnUpdateMsg->u4BcnBodyLen = ucLen; - } - else { - prP2pBcnUpdateMsg->u4BcnBodyLen = 0; - - prP2pBcnUpdateMsg->pucBcnBody = NULL; - } - - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prP2pBcnUpdateMsg, - MSG_SEND_METHOD_BUF); - - - prP2pStartAPMsg = (P_MSG_P2P_START_AP_T)cnmMemAlloc( - prGlueInfo->prAdapter, - RAM_TYPE_MSG, - sizeof(MSG_P2P_START_AP_T)); - - if (prP2pStartAPMsg == NULL) { - ASSERT(FALSE); - i4Rslt = -ENOMEM; - break; - } - - prP2pStartAPMsg->rMsgHdr.eMsgId = MID_MNY_P2P_START_AP; - - prP2pStartAPMsg->fgIsPrivacy = settings->privacy; - - prP2pStartAPMsg->u4BcnInterval = settings->beacon_interval; - - prP2pStartAPMsg->u4DtimPeriod = settings->dtim_period; - - /* Copy NO SSID. */ - prP2pStartAPMsg->ucHiddenSsidType = settings->hidden_ssid; - - COPY_SSID(prP2pStartAPMsg->aucSsid, - prP2pStartAPMsg->u2SsidLen, - settings->ssid, - settings->ssid_len); - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prP2pStartAPMsg, - MSG_SEND_METHOD_BUF); - - i4Rslt = 0; - - } while (FALSE); - - return i4Rslt; - - -///////////////////////// - /** - * struct cfg80211_ap_settings - AP configuration - * - * Used to configure an AP interface. - * - * @beacon: beacon data - * @beacon_interval: beacon interval - * @dtim_period: DTIM period - * @ssid: SSID to be used in the BSS (note: may be %NULL if not provided from - * user space) - * @ssid_len: length of @ssid - * @hidden_ssid: whether to hide the SSID in Beacon/Probe Response frames - * @crypto: crypto settings - * @privacy: the BSS uses privacy - * @auth_type: Authentication type (algorithm) - * @inactivity_timeout: time in seconds to determine station's inactivity. - */ -// struct cfg80211_ap_settings { -// struct cfg80211_beacon_data beacon; -// -// int beacon_interval, dtim_period; -// const u8 *ssid; -// size_t ssid_len; -// enum nl80211_hidden_ssid hidden_ssid; -// struct cfg80211_crypto_settings crypto; -// bool privacy; -// enum nl80211_auth_type auth_type; -// int inactivity_timeout; -// }; -//////////////////// - - return i4Rslt; -} /* mtk_p2p_cfg80211_start_ap */ - - -int -mtk_p2p_cfg80211_change_beacon ( - struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_beacon_data *info - ) -{ - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - INT_32 i4Rslt = -EINVAL; - P_MSG_P2P_BEACON_UPDATE_T prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)NULL; - PUINT_8 pucBuffer = (PUINT_8)NULL; - - do { - if ((wiphy == NULL) || (info == NULL)) { - break; - } - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_change_beacon.\n")); - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)cnmMemAlloc( - prGlueInfo->prAdapter, - RAM_TYPE_MSG, - (sizeof(MSG_P2P_BEACON_UPDATE_T) + info->head_len + info->tail_len)); - - - if (prP2pBcnUpdateMsg == NULL) { - ASSERT(FALSE); - i4Rslt = -ENOMEM; - break; - } - - prP2pBcnUpdateMsg->rMsgHdr.eMsgId = MID_MNY_P2P_BEACON_UPDATE; - pucBuffer = prP2pBcnUpdateMsg->aucBuffer; - - if (info->head_len != 0) { - kalMemCopy(pucBuffer, info->head, info->head_len); - - prP2pBcnUpdateMsg->u4BcnHdrLen = info->head_len; - - prP2pBcnUpdateMsg->pucBcnHdr = pucBuffer; - - pucBuffer = (PUINT_8)((UINT_32)pucBuffer + (UINT_32)info->head_len); - } - else { - prP2pBcnUpdateMsg->u4BcnHdrLen = 0; - - prP2pBcnUpdateMsg->pucBcnHdr = NULL; - } - - if (info->tail_len != 0) { - UINT_8 ucLen = info->tail_len; - - prP2pBcnUpdateMsg->pucBcnBody = pucBuffer; - - /*Add TIM IE*/ - // IEEE 802.11 2007 - 7.3.2.6 - TIM_IE(pucBuffer)->ucId = ELEM_ID_TIM; - TIM_IE(pucBuffer)->ucLength = (3 + MAX_LEN_TIM_PARTIAL_BMP)/*((u4N2 - u4N1) + 4)*/; // NOTE: fixed PVB length (AID is allocated from 8 ~ 15 only) - TIM_IE(pucBuffer)->ucDTIMCount = 0/*prBssInfo->ucDTIMCount*/; // will be overwrite by FW - TIM_IE(pucBuffer)->ucDTIMPeriod = 1; - TIM_IE(pucBuffer)->ucBitmapControl = 0/*ucBitmapControl | (UINT_8)u4N1*/; // will be overwrite by FW - ucLen += IE_SIZE(pucBuffer); - pucBuffer += IE_SIZE(pucBuffer); - - kalMemCopy(pucBuffer, info->tail, info->tail_len); - - prP2pBcnUpdateMsg->u4BcnBodyLen = ucLen; - } - else { - prP2pBcnUpdateMsg->u4BcnBodyLen = 0; - - prP2pBcnUpdateMsg->pucBcnBody = NULL; - } - - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prP2pBcnUpdateMsg, - MSG_SEND_METHOD_BUF); - -//////////////////////////// -/** - * struct cfg80211_beacon_data - beacon data - * @head: head portion of beacon (before TIM IE) - * or %NULL if not changed - * @tail: tail portion of beacon (after TIM IE) - * or %NULL if not changed - * @head_len: length of @head - * @tail_len: length of @tail - * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL - * @beacon_ies_len: length of beacon_ies in octets - * @proberesp_ies: extra information element(s) to add into Probe Response - * frames or %NULL - * @proberesp_ies_len: length of proberesp_ies in octets - * @assocresp_ies: extra information element(s) to add into (Re)Association - * Response frames or %NULL - * @assocresp_ies_len: length of assocresp_ies in octets - * @probe_resp_len: length of probe response template (@probe_resp) - * @probe_resp: probe response template (AP mode only) - */ -//struct cfg80211_beacon_data { -// const u8 *head, *tail; -// const u8 *beacon_ies; -// const u8 *proberesp_ies; -// const u8 *assocresp_ies; -// const u8 *probe_resp; - -// size_t head_len, tail_len; -// size_t beacon_ies_len; -// size_t proberesp_ies_len; -// size_t assocresp_ies_len; -// size_t probe_resp_len; -//}; - -//////////////////////////// - - } while (FALSE); - - return i4Rslt; -} /* mtk_p2p_cfg80211_change_beacon */ - -#else -int -mtk_p2p_cfg80211_add_set_beacon ( - struct wiphy *wiphy, - struct net_device *dev, - struct beacon_parameters *info - ) -{ - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - INT_32 i4Rslt = -EINVAL; - P_MSG_P2P_BEACON_UPDATE_T prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)NULL; - P_MSG_P2P_START_AP_T prP2pStartAPMsg = (P_MSG_P2P_START_AP_T)NULL; - PUINT_8 pucBuffer = (PUINT_8)NULL; - P_IE_SSID_T prSsidIE = (P_IE_SSID_T)NULL; - - do { - if ((wiphy == NULL) || (info == NULL)) { - break; - } - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_add_set_beacon.\n")); - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)cnmMemAlloc( - prGlueInfo->prAdapter, - RAM_TYPE_MSG, - (sizeof(MSG_P2P_BEACON_UPDATE_T) + info->head_len + info->tail_len)); - - if (prP2pBcnUpdateMsg == NULL) { - ASSERT(FALSE); - i4Rslt = -ENOMEM; - break; - } - - - prP2pBcnUpdateMsg->rMsgHdr.eMsgId = MID_MNY_P2P_BEACON_UPDATE; - pucBuffer = prP2pBcnUpdateMsg->aucBuffer; - - if (info->head_len != 0) { - kalMemCopy(pucBuffer, info->head, info->head_len); - - prP2pBcnUpdateMsg->u4BcnHdrLen = info->head_len; - - prP2pBcnUpdateMsg->pucBcnHdr = pucBuffer; - - pucBuffer = (PUINT_8)((UINT_32)pucBuffer + (UINT_32)info->head_len); - } - else { - prP2pBcnUpdateMsg->u4BcnHdrLen = 0; - - prP2pBcnUpdateMsg->pucBcnHdr = NULL; - } - - if (info->tail_len != 0) { - UINT_8 ucLen = info->tail_len; - - prP2pBcnUpdateMsg->pucBcnBody = pucBuffer; - - /*Add TIM IE*/ - // IEEE 802.11 2007 - 7.3.2.6 - TIM_IE(pucBuffer)->ucId = ELEM_ID_TIM; - TIM_IE(pucBuffer)->ucLength = (3 + MAX_LEN_TIM_PARTIAL_BMP)/*((u4N2 - u4N1) + 4)*/; // NOTE: fixed PVB length (AID is allocated from 8 ~ 15 only) - TIM_IE(pucBuffer)->ucDTIMCount = 0/*prBssInfo->ucDTIMCount*/; // will be overwrite by FW - TIM_IE(pucBuffer)->ucDTIMPeriod = 1; - TIM_IE(pucBuffer)->ucBitmapControl = 0/*ucBitmapControl | (UINT_8)u4N1*/; // will be overwrite by FW - ucLen += IE_SIZE(pucBuffer); - pucBuffer += IE_SIZE(pucBuffer); - - kalMemCopy(pucBuffer, info->tail, info->tail_len); - - prP2pBcnUpdateMsg->u4BcnBodyLen = ucLen; - } - else { - prP2pBcnUpdateMsg->u4BcnBodyLen = 0; - - prP2pBcnUpdateMsg->pucBcnBody = NULL; - } - - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prP2pBcnUpdateMsg, - MSG_SEND_METHOD_BUF); - - - prP2pStartAPMsg = (P_MSG_P2P_START_AP_T)cnmMemAlloc( - prGlueInfo->prAdapter, - RAM_TYPE_MSG, - sizeof(MSG_P2P_START_AP_T)); - - if (prP2pStartAPMsg == NULL) { - ASSERT(FALSE); - i4Rslt = -ENOMEM; - break; - } - - prP2pStartAPMsg->rMsgHdr.eMsgId = MID_MNY_P2P_START_AP; - - prP2pStartAPMsg->fgIsPrivacy = FALSE; - - prP2pStartAPMsg->u4BcnInterval = info->interval; - - prP2pStartAPMsg->u4DtimPeriod = info->dtim_period; - - /* Copy NO SSID. */ - prP2pStartAPMsg->ucHiddenSsidType = ENUM_HIDDEN_SSID_NONE; - -#if 0 - if (info->head_len > OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem)) { - P_WLAN_BEACON_FRAME_T prWlanBcnFrame = info->head; - - prSsidIE = (P_IE_HDR_T)p2pFuncGetSpecIE(prGlueInfo->prAdapter, - (PUINT_8)prWlanBcnFrame->aucInfoElem, - (info->head_len - OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem)), - ELEM_ID_SSID, - NULL); - - kalMemCopy(prP2pStartAPMsg->aucSsid, SSID_IE(prSsidIE)->aucSSID, IE_LEN(prSsidIE)); - - } -#endif - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prP2pStartAPMsg, - MSG_SEND_METHOD_BUF); - - i4Rslt = 0; - - } while (FALSE); - - return i4Rslt; -} -/* mtk_p2p_cfg80211_add_set_beacon */ -#endif - -int -mtk_p2p_cfg80211_stop_ap ( - struct wiphy *wiphy, - struct net_device *dev - ) -{ - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - INT_32 i4Rslt = -EINVAL; - P_MSG_P2P_SWITCH_OP_MODE_T prP2pSwitchMode = (P_MSG_P2P_SWITCH_OP_MODE_T)NULL; - - do { - if (wiphy == NULL) { - break; - } - - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_stop_ap.\n")); - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - // Switch OP MOde. - prP2pSwitchMode = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_SWITCH_OP_MODE_T)); - - if (prP2pSwitchMode == NULL) { - ASSERT(FALSE); - i4Rslt = -ENOMEM; - break; - } - - prP2pSwitchMode->rMsgHdr.eMsgId = MID_MNY_P2P_STOP_AP; - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prP2pSwitchMode, - MSG_SEND_METHOD_BUF); - - i4Rslt = 0; - } while (FALSE); - - - return i4Rslt; -} /* mtk_p2p_cfg80211_stop_ap */ - -// TODO: -int -mtk_p2p_cfg80211_deauth ( - struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_deauth_request *req -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) - , void *cookie -#endif - ) -{ - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - // not implemented yet - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_deauth.\n")); - - return -EINVAL; -} /* mtk_p2p_cfg80211_deauth */ - - -// TODO: -int -mtk_p2p_cfg80211_disassoc ( - struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_disassoc_request *req -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) - , void *cookie -#endif - ) -{ - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_disassoc.\n")); - - // not implemented yet - - return -EINVAL; -} /* mtk_p2p_cfg80211_disassoc */ - - -int -mtk_p2p_cfg80211_remain_on_channel ( - struct wiphy *wiphy, - struct net_device *dev, - struct ieee80211_channel *chan, - enum nl80211_channel_type channel_type, - unsigned int duration, - u64 *cookie - ) -{ - INT_32 i4Rslt = -EINVAL; - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T)NULL; - P_MSG_P2P_CHNL_REQUEST_T prMsgChnlReq = (P_MSG_P2P_CHNL_REQUEST_T)NULL; - - - do { - if ((wiphy == NULL) || - (dev == NULL) || - (chan == NULL) || - (cookie == NULL)) { - break; - } - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - prGlueP2pInfo = prGlueInfo->prP2PInfo; - - *cookie = prGlueP2pInfo->u8Cookie++; - - prMsgChnlReq = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_CHNL_REQUEST_T)); - - if (prMsgChnlReq == NULL) { - ASSERT(FALSE); - i4Rslt = -ENOMEM; - break; - } - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_remain_on_channel\n")); - - prMsgChnlReq->rMsgHdr.eMsgId = MID_MNY_P2P_CHNL_REQ; - prMsgChnlReq->u8Cookie = *cookie; - prMsgChnlReq->u4Duration = duration; - - - mtk_p2p_cfg80211func_channel_format_switch(chan, - channel_type, - &prMsgChnlReq->rChannelInfo, - &prMsgChnlReq->eChnlSco); - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prMsgChnlReq, - MSG_SEND_METHOD_BUF); - - i4Rslt = 0; - - i4Rslt = 0; - } while (FALSE); - - - return i4Rslt; -} -/* mtk_p2p_cfg80211_remain_on_channel */ - - -int -mtk_p2p_cfg80211_cancel_remain_on_channel ( - struct wiphy *wiphy, - struct net_device *dev, - u64 cookie - ) -{ - INT_32 i4Rslt = -EINVAL; - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - P_MSG_P2P_CHNL_ABORT_T prMsgChnlAbort = (P_MSG_P2P_CHNL_ABORT_T)NULL; - - do { - if ((wiphy == NULL) || (dev == NULL)) { - break; - } - - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - prMsgChnlAbort = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_CHNL_ABORT_T)); - - if (prMsgChnlAbort == NULL) { - ASSERT(FALSE); - i4Rslt = -ENOMEM; - break; - } - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_cancel_remain_on_channel\n")); - - prMsgChnlAbort->rMsgHdr.eMsgId = MID_MNY_P2P_CHNL_ABORT; - prMsgChnlAbort->u8Cookie = cookie; - - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prMsgChnlAbort, - MSG_SEND_METHOD_BUF); - - i4Rslt = 0; - } while (FALSE); - - return i4Rslt; -} /* mtk_p2p_cfg80211_cancel_remain_on_channel */ - -int -mtk_p2p_cfg80211_mgmt_tx ( - struct wiphy *wiphy, struct net_device *dev, - struct ieee80211_channel *chan, bool offchan, - enum nl80211_channel_type channel_type, - bool channel_type_valid, unsigned int wait, - const u8 *buf, - size_t len, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) - bool no_cck, - bool dont_wait_for_ack, -#endif - u64 *cookie - ) -{ - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T)NULL; - INT_32 i4Rslt = -EINVAL; - P_MSG_P2P_MGMT_TX_REQUEST_T prMsgTxReq = (P_MSG_P2P_MGMT_TX_REQUEST_T)NULL; - P_MSDU_INFO_T prMgmtFrame = (P_MSDU_INFO_T)NULL; - PUINT_8 pucFrameBuf = (PUINT_8)NULL; - - do { - if ((wiphy == NULL) || - (buf == NULL) || - (len == 0) || - (dev == NULL) || - (cookie == NULL)) { - break; - } - - //DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_mgmt_tx\n")); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - prGlueP2pInfo = prGlueInfo->prP2PInfo; - - *cookie = prGlueP2pInfo->u8Cookie++; - - /* Channel & Channel Type & Wait time are ignored. */ - prMsgTxReq = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_MGMT_TX_REQUEST_T)); - - if (prMsgTxReq == NULL) { - ASSERT(FALSE); - i4Rslt = -ENOMEM; - break; - } - - prMsgTxReq->fgNoneCckRate = FALSE; - prMsgTxReq->fgIsWaitRsp = TRUE; - - prMgmtFrame = cnmMgtPktAlloc(prGlueInfo->prAdapter, (UINT_32)(len + MAC_TX_RESERVED_FIELD)); - - if ((prMsgTxReq->prMgmtMsduInfo = prMgmtFrame) == NULL) { - ASSERT(FALSE); - i4Rslt = -ENOMEM; - break; - } - - prMsgTxReq->u8Cookie = *cookie; - prMsgTxReq->rMsgHdr.eMsgId = MID_MNY_P2P_MGMT_TX; - - pucFrameBuf = (PUINT_8)((UINT_32)prMgmtFrame->prPacket + MAC_TX_RESERVED_FIELD); - - kalMemCopy(pucFrameBuf, buf, len); - - prMgmtFrame->u2FrameLength = len; - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prMsgTxReq, - MSG_SEND_METHOD_BUF); - - i4Rslt = 0; - } while (FALSE); - - if ((i4Rslt != 0) && (prMsgTxReq != NULL)) { - if (prMsgTxReq->prMgmtMsduInfo != NULL) { - cnmMgtPktFree(prGlueInfo->prAdapter, prMsgTxReq->prMgmtMsduInfo); - } - - cnmMemFree(prGlueInfo->prAdapter, prMsgTxReq); - } - - return i4Rslt; -} /* mtk_p2p_cfg80211_mgmt_tx */ - - - -int -mtk_p2p_cfg80211_change_bss ( - struct wiphy *wiphy, - struct net_device *dev, - struct bss_parameters *params - ) -{ - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - INT_32 i4Rslt = -EINVAL; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - - switch (params->use_cts_prot) { - case -1: - DBGLOG(P2P, TRACE, ("CTS protection no change\n")); - break; - case 0: - DBGLOG(P2P, TRACE, ("CTS protection disable.\n")); - break; - case 1: - DBGLOG(P2P, TRACE, ("CTS protection enable\n")); - break; - default: - DBGLOG(P2P, TRACE, ("CTS protection unknown\n")); - break; - } - - - - switch (params->use_short_preamble) { - case -1: - DBGLOG(P2P, TRACE, ("Short prreamble no change\n")); - break; - case 0: - DBGLOG(P2P, TRACE, ("Short prreamble disable.\n")); - break; - case 1: - DBGLOG(P2P, TRACE, ("Short prreamble enable\n")); - break; - default: - DBGLOG(P2P, TRACE, ("Short prreamble unknown\n")); - break; - } - - - -#if 0 - // not implemented yet - p2pFuncChangeBssParam(prGlueInfo->prAdapter, - prBssInfo->fgIsProtection, - prBssInfo->fgIsShortPreambleAllowed, - prBssInfo->fgUseShortSlotTime, - // Basic rates - // basic rates len - // ap isolate - // ht opmode. - ); -#else - i4Rslt = 0; -#endif - - return i4Rslt; -} /* mtk_p2p_cfg80211_change_bss */ - - - -int -mtk_p2p_cfg80211_del_station ( - struct wiphy *wiphy, - struct net_device *dev, - u8 *mac - ) -{ - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - INT_32 i4Rslt = -EINVAL; - P_MSG_P2P_CONNECTION_ABORT_T prDisconnectMsg = (P_MSG_P2P_CONNECTION_ABORT_T)NULL; - UINT_8 aucBcMac[] = BC_MAC_ADDR; - - - do { - if ((wiphy == NULL) || - (dev == NULL)) { - break; - } - - if (mac == NULL) { - mac = aucBcMac; - } - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_del_station.\n")); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - //prDisconnectMsg = (P_MSG_P2P_CONNECTION_ABORT_T)kalMemAlloc(sizeof(MSG_P2P_CONNECTION_ABORT_T), VIR_MEM_TYPE); - prDisconnectMsg = (P_MSG_P2P_CONNECTION_ABORT_T)cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_CONNECTION_ABORT_T)); - - if (prDisconnectMsg == NULL) { - ASSERT(FALSE); - i4Rslt = -ENOMEM; - break; - } - - prDisconnectMsg->rMsgHdr.eMsgId = MID_MNY_P2P_CONNECTION_ABORT; - COPY_MAC_ADDR(prDisconnectMsg->aucTargetID, mac); - prDisconnectMsg->u2ReasonCode = REASON_CODE_UNSPECIFIED; - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prDisconnectMsg, - MSG_SEND_METHOD_BUF); - - i4Rslt = 0; - } while (FALSE); - - return i4Rslt; - -} /* mtk_p2p_cfg80211_del_station */ - - -int -mtk_p2p_cfg80211_connect ( - struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_connect_params *sme - ) -{ - INT_32 i4Rslt = -EINVAL; - P_GLUE_INFO_T prGlueInfo = NULL; - P_MSG_P2P_CONNECTION_REQUEST_T prConnReqMsg = (P_MSG_P2P_CONNECTION_REQUEST_T)NULL; - - - do { - if ((wiphy == NULL) || - (dev == NULL) || - (sme == NULL)) { - break; - } - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_connect.\n")); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - prConnReqMsg = (P_MSG_P2P_CONNECTION_REQUEST_T)cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, (sizeof(MSG_P2P_CONNECTION_REQUEST_T) + sme->ie_len)); - - if (prConnReqMsg == NULL) { - ASSERT(FALSE); - i4Rslt = -ENOMEM; - break; - } - - prConnReqMsg->rMsgHdr.eMsgId = MID_MNY_P2P_CONNECTION_REQ; - - COPY_SSID(prConnReqMsg->rSsid.aucSsid, - prConnReqMsg->rSsid.ucSsidLen, - sme->ssid, - sme->ssid_len); - - COPY_MAC_ADDR(prConnReqMsg->aucBssid, sme->bssid); - - DBGLOG(P2P, TRACE, ("Assoc Req IE Buffer Length:%d\n", sme->ie_len)); - kalMemCopy(prConnReqMsg->aucIEBuf, sme->ie, sme->ie_len); - prConnReqMsg->u4IELen = sme->ie_len; - - mtk_p2p_cfg80211func_channel_format_switch(sme->channel, - NL80211_CHAN_NO_HT, - &prConnReqMsg->rChannelInfo, - &prConnReqMsg->eChnlSco); - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prConnReqMsg, - MSG_SEND_METHOD_BUF); - - - i4Rslt = 0; - } while (FALSE); - - return i4Rslt; -} /* mtk_p2p_cfg80211_connect */ - -int -mtk_p2p_cfg80211_disconnect ( - struct wiphy *wiphy, - struct net_device *dev, - u16 reason_code - ) -{ - INT_32 i4Rslt = -EINVAL; - P_GLUE_INFO_T prGlueInfo = NULL; - P_MSG_P2P_CONNECTION_ABORT_T prDisconnMsg = (P_MSG_P2P_CONNECTION_ABORT_T)NULL; - UINT_8 aucBCAddr[] = BC_MAC_ADDR; - - do { - if ((wiphy == NULL) || - (dev == NULL)) { - break; - } - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_disconnect.\n")); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - -// prDisconnMsg = (P_MSG_P2P_CONNECTION_ABORT_T)kalMemAlloc(sizeof(P_MSG_P2P_CONNECTION_ABORT_T), VIR_MEM_TYPE); - prDisconnMsg = (P_MSG_P2P_CONNECTION_ABORT_T)cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_CONNECTION_ABORT_T)); - - if (prDisconnMsg == NULL) { - ASSERT(FALSE); - i4Rslt = -ENOMEM; - break; - } - - prDisconnMsg->rMsgHdr.eMsgId = MID_MNY_P2P_CONNECTION_ABORT; - prDisconnMsg->u2ReasonCode = reason_code; - prDisconnMsg->fgSendDeauth = TRUE; - COPY_MAC_ADDR(prDisconnMsg->aucTargetID, aucBCAddr); - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prDisconnMsg, - MSG_SEND_METHOD_UNBUF); - - i4Rslt = 0; - } while (FALSE); - - return i4Rslt; -} /* mtk_p2p_cfg80211_disconnect */ - - -int -mtk_p2p_cfg80211_change_iface ( - IN struct wiphy *wiphy, - IN struct net_device *ndev, - IN enum nl80211_iftype type, - IN u32 *flags, - IN struct vif_params *params - ) -{ - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - INT_32 i4Rslt = -EINVAL; - P_MSG_P2P_SWITCH_OP_MODE_T prSwitchModeMsg = (P_MSG_P2P_SWITCH_OP_MODE_T)NULL; - - do { - if ((wiphy == NULL) || - (ndev == NULL)) { - break; - } - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_change_iface.\n")); - - if (ndev->ieee80211_ptr) { - ndev->ieee80211_ptr->iftype = type; - } - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - - // Switch OP MOde. - prSwitchModeMsg = (P_MSG_P2P_SWITCH_OP_MODE_T)cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_SWITCH_OP_MODE_T)); - - if (prSwitchModeMsg == NULL) { - ASSERT(FALSE); - i4Rslt = -ENOMEM; - break; - } - - prSwitchModeMsg->rMsgHdr.eMsgId = MID_MNY_P2P_FUN_SWITCH; - - switch (type) { - case NL80211_IFTYPE_P2P_CLIENT: - DBGLOG(P2P, TRACE, ("NL80211_IFTYPE_P2P_CLIENT.\n")); - case NL80211_IFTYPE_STATION: - if (type == NL80211_IFTYPE_STATION) { - DBGLOG(P2P, TRACE, ("NL80211_IFTYPE_STATION.\n")); - } - prSwitchModeMsg->eOpMode = OP_MODE_INFRASTRUCTURE; - break; - case NL80211_IFTYPE_AP: - DBGLOG(P2P, TRACE, ("NL80211_IFTYPE_AP.\n")); - case NL80211_IFTYPE_P2P_GO: - if (type == NL80211_IFTYPE_P2P_GO) { - DBGLOG(P2P, TRACE, ("NL80211_IFTYPE_P2P_GO not AP.\n")); - } - prSwitchModeMsg->eOpMode = OP_MODE_ACCESS_POINT; - break; - default: - DBGLOG(P2P, TRACE, ("Other type :%d .\n", type)); - prSwitchModeMsg->eOpMode = OP_MODE_P2P_DEVICE; - break; - } - - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prSwitchModeMsg, - MSG_SEND_METHOD_BUF); - - i4Rslt = 0; - - } while (FALSE); - - return i4Rslt; - -} /* mtk_p2p_cfg80211_change_iface */ - - -int -mtk_p2p_cfg80211_set_channel ( - IN struct wiphy *wiphy, - IN struct net_device *dev, - IN struct ieee80211_channel *chan, - IN enum nl80211_channel_type channel_type) -{ - INT_32 i4Rslt = -EINVAL; - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - RF_CHANNEL_INFO_T rRfChnlInfo; - - do { - if ((wiphy == NULL) || - (dev == NULL) || - (chan == NULL)) { - break; - } - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_set_channel.\n")); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - mtk_p2p_cfg80211func_channel_format_switch(chan, - channel_type, - &rRfChnlInfo, - NULL); - - p2pFuncSetChannel(prGlueInfo->prAdapter, &rRfChnlInfo); - - i4Rslt = 0; - } -while (FALSE); - - return i4Rslt; - -} -/* mtk_p2p_cfg80211_set_channel */ - -int -mtk_p2p_cfg80211_set_bitrate_mask ( - IN struct wiphy *wiphy, - IN struct net_device *dev, - IN const u8 *peer, - IN const struct cfg80211_bitrate_mask *mask - ) -{ - INT_32 i4Rslt = -EINVAL; - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - - do { - if ((wiphy == NULL) || - (dev == NULL) || - (mask == NULL)) { - break; - } - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_set_bitrate_mask\n")); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - // TODO: Set bitrate mask of the peer? - - i4Rslt = 0; - } -while (FALSE); - - return i4Rslt; -} /* mtk_p2p_cfg80211_set_bitrate_mask */ - - -void -mtk_p2p_cfg80211_mgmt_frame_register ( - IN struct wiphy *wiphy, - IN struct net_device *dev, - IN u16 frame_type, - IN bool reg - ) -{ -#if 0 - P_MSG_P2P_MGMT_FRAME_REGISTER_T prMgmtFrameRegister = (P_MSG_P2P_MGMT_FRAME_REGISTER_T)NULL; -#endif - P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL; - - do { - if ((wiphy == NULL) || - (dev == NULL)) { - break; - } - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_mgmt_frame_register\n")); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - - switch (frame_type) { - case MAC_FRAME_PROBE_REQ: - if (reg) { - prGlueInfo->prP2PInfo->u4OsMgmtFrameFilter |= PARAM_PACKET_FILTER_PROBE_REQ; - DBGLOG(P2P, TRACE, ("Open packet filer probe request\n")); - } - else { - prGlueInfo->prP2PInfo->u4OsMgmtFrameFilter &= ~PARAM_PACKET_FILTER_PROBE_REQ; - DBGLOG(P2P, TRACE, ("Close packet filer probe request\n")); - } - break; - case MAC_FRAME_ACTION: - if (reg) { - prGlueInfo->prP2PInfo->u4OsMgmtFrameFilter |= PARAM_PACKET_FILTER_ACTION_FRAME; - DBGLOG(P2P, TRACE, ("Open packet filer action frame.\n")); - } - else { - prGlueInfo->prP2PInfo->u4OsMgmtFrameFilter &= ~PARAM_PACKET_FILTER_ACTION_FRAME; - DBGLOG(P2P, TRACE, ("Close packet filer action frame.\n")); - } - break; - default: - DBGLOG(P2P, ERROR, ("Ask frog to add code for mgmt:%x\n", frame_type)); - break; - } - - - - prGlueInfo->u4Flag |= GLUE_FLAG_FRAME_FILTER; - - /* wake up main thread */ - wake_up_interruptible(&prGlueInfo->waitq); - - if (in_interrupt()) { - DBGLOG(P2P, TRACE, ("It is in interrupt level\n")); - } - - - -#if 0 - - - prMgmtFrameRegister = (P_MSG_P2P_MGMT_FRAME_REGISTER_T)cnmMemAlloc(prGlueInfo->prAdapter, - RAM_TYPE_MSG, - sizeof(MSG_P2P_MGMT_FRAME_REGISTER_T)); - - if (prMgmtFrameRegister == NULL) { - ASSERT(FALSE); - break; - } - - prMgmtFrameRegister->rMsgHdr.eMsgId = MID_MNY_P2P_MGMT_FRAME_REGISTER; - - prMgmtFrameRegister->u2FrameType = frame_type; - prMgmtFrameRegister->fgIsRegister = reg; - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prMgmtFrameRegister, - MSG_SEND_METHOD_BUF); - -#endif - - } while (FALSE); - - - return; -} /* mtk_p2p_cfg80211_mgmt_frame_register */ - - -BOOLEAN -mtk_p2p_cfg80211func_channel_format_switch ( - IN struct ieee80211_channel *channel, - IN enum nl80211_channel_type channel_type, - IN P_RF_CHANNEL_INFO_T prRfChnlInfo, - IN P_ENUM_CHNL_EXT_T prChnlSco - ) -{ - BOOLEAN fgIsValid = FALSE; - - do { - if (channel == NULL) { - break; - } - - if (prRfChnlInfo) { - prRfChnlInfo->ucChannelNum = nicFreq2ChannelNum(channel->center_freq * 1000); - - switch (channel->band) { - case IEEE80211_BAND_2GHZ: - prRfChnlInfo->eBand = BAND_2G4; - break; - case IEEE80211_BAND_5GHZ: - prRfChnlInfo->eBand = BAND_5G; - break; - default: - prRfChnlInfo->eBand = BAND_2G4; - break; - } - - } - - - if (prChnlSco) { - - switch (channel_type) { - case NL80211_CHAN_NO_HT: - *prChnlSco = CHNL_EXT_SCN; - break; - case NL80211_CHAN_HT20: - *prChnlSco = CHNL_EXT_SCN; - break; - case NL80211_CHAN_HT40MINUS: - *prChnlSco = CHNL_EXT_SCA; - break; - case NL80211_CHAN_HT40PLUS: - *prChnlSco = CHNL_EXT_SCB; - break; - default: - ASSERT(FALSE); - *prChnlSco = CHNL_EXT_SCN; - break; - } - } - - fgIsValid = TRUE; - } -while (FALSE); - - return fgIsValid; -} -/* mtk_p2p_cfg80211func_channel_format_switch */ - - -#if CONFIG_NL80211_TESTMODE -int mtk_p2p_cfg80211_testmode_cmd( - IN struct wiphy *wiphy, - IN void *data, - IN int len - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - P_NL80211_DRIVER_TEST_PARAMS prParams = (P_NL80211_DRIVER_TEST_PARAMS)NULL; - BOOLEAN fgIsValid = FALSE; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_testmode_cmd\n")); - - if(data && len) - prParams = (P_NL80211_DRIVER_TEST_PARAMS)data; - - if(prParams->index >> 24 == 0x01) { - /* New version */ - prParams->index = prParams->index & ~ BITS(24,31); - } - else { - /* Old version*/ - mtk_p2p_cfg80211_testmode_p2p_sigma_pre_cmd(wiphy, data, len); - } - - /* Clear the version byte */ - prParams->index = prParams->index & ~ BITS(24,31); - - if(prParams){ - switch(prParams->index){ - case 1: /* P2P Simga */ - if(mtk_p2p_cfg80211_testmode_p2p_sigma_cmd(wiphy, data, len)) - fgIsValid = TRUE; - break; - case 2: /* WFD */ - break; - case 3: /* Hotspot Client Management */ - if(mtk_p2p_cfg80211_testmode_hotspot_block_list_cmd(wiphy, data, len)) - fgIsValid = TRUE; - break; - default: - fgIsValid = TRUE; - break; - } - } - - return fgIsValid; - -} - - -int mtk_p2p_cfg80211_testmode_p2p_sigma_pre_cmd( - IN struct wiphy *wiphy, - IN void *data, - IN int len - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - NL80211_DRIVER_TEST_PRE_PARAMS rParams; - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL; - UINT_32 index_mode; - UINT_32 index; - INT_32 value; - int status = 0; - UINT_32 u4Leng; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - kalMemZero(&rParams, sizeof(NL80211_DRIVER_TEST_PRE_PARAMS)); - - prP2pSpecificBssInfo = prGlueInfo->prAdapter->rWifiVar.prP2pSpecificBssInfo; - prP2pConnSettings = prGlueInfo->prAdapter->rWifiVar.prP2PConnSettings; - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_testmode_cmd\n")); - - if(data && len) - memcpy(&rParams, data, len); - - DBGLOG(P2P, TRACE, ("NL80211_ATTR_TESTDATA,idx_mode=%d idx=%d value=%lu\n", - (INT_16)rParams.idx_mode, (INT_16)rParams.idx, rParams.value)); - - index_mode = rParams.idx_mode; - index = rParams.idx; - value = rParams.value; - - switch (index) { - case 0: /* Listen CH */ - break; - case 1: /* P2p mode */ - break; - case 4: /* Noa duration */ - prP2pSpecificBssInfo->rNoaParam.u4NoaDurationMs = value; - // only to apply setting when setting NOA count - //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam); - break; - case 5: /* Noa interval */ - prP2pSpecificBssInfo->rNoaParam.u4NoaIntervalMs = value; - // only to apply setting when setting NOA count - //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam); - break; - case 6: /* Noa count */ - prP2pSpecificBssInfo->rNoaParam.u4NoaCount = value; - //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam); - break; - case 100: /* Oper CH */ - // 20110920 - frog: User configurations are placed in ConnSettings. - // prP2pConnSettings->ucOperatingChnl = value; - break; - case 101: /* Local config Method, for P2P SDK */ - prP2pConnSettings->u2LocalConfigMethod = value; - break; - case 102: /* Sigma P2p reset */ - //kalMemZero(prP2pConnSettings->aucTargetDevAddr, MAC_ADDR_LEN); - //prP2pConnSettings->eConnectionPolicy = ENUM_P2P_CONNECTION_POLICY_AUTO; - p2pFsmUninit(prGlueInfo->prAdapter); - p2pFsmInit(prGlueInfo->prAdapter); - break; - case 103: /* WPS MODE */ - kalP2PSetWscMode(prGlueInfo, value); - break; - case 104: /* P2p send persence, duration */ - break; - case 105: /* P2p send persence, interval */ - break; - case 106: /* P2P set sleep */ - value = 1; - kalIoctl(prGlueInfo, - wlanoidSetP2pPowerSaveProfile, - &value, - sizeof(value), - FALSE, - FALSE, - TRUE, - TRUE, - &u4Leng); - break; - case 107: /* P2P set opps, CTWindowl */ - prP2pSpecificBssInfo->rOppPsParam.u4CTwindowMs = value; - //status = mtk_p2p_wext_set_oppps_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rOppPsParam); - break; - case 108: /* p2p_set_power_save */ - kalIoctl(prGlueInfo, - wlanoidSetP2pPowerSaveProfile, - &value, - sizeof(value), - FALSE, - FALSE, - TRUE, - TRUE, - &u4Leng); - - break; - default: - break; - } - - return status; - -} - - -int -mtk_p2p_cfg80211_testmode_p2p_sigma_cmd( - IN struct wiphy *wiphy, - IN void *data, - IN int len) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - P_NL80211_DRIVER_P2P_SIGMA_PARAMS prParams = (P_NL80211_DRIVER_P2P_SIGMA_PARAMS)NULL; - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL; - UINT_32 index; - INT_32 value; - int status = 0; - UINT_32 u4Leng; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - prP2pSpecificBssInfo = prGlueInfo->prAdapter->rWifiVar.prP2pSpecificBssInfo; - prP2pConnSettings = prGlueInfo->prAdapter->rWifiVar.prP2PConnSettings; - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_testmode_p2p_sigma_cmd\n")); - - if(data && len) - prParams = (P_NL80211_DRIVER_P2P_SIGMA_PARAMS)data; - - index = (INT_32)prParams->idx; - value = (INT_32)prParams->value; - - DBGLOG(P2P, TRACE, ("NL80211_ATTR_TESTDATA, idx=%lu value=%lu\n", - (INT_32)prParams->idx, (INT_32)prParams->value)); - - switch (index) { - case 0: /* Listen CH */ - break; - case 1: /* P2p mode */ - break; - case 4: /* Noa duration */ - prP2pSpecificBssInfo->rNoaParam.u4NoaDurationMs = value; - // only to apply setting when setting NOA count - //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam); - break; - case 5: /* Noa interval */ - prP2pSpecificBssInfo->rNoaParam.u4NoaIntervalMs = value; - // only to apply setting when setting NOA count - //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam); - break; - case 6: /* Noa count */ - prP2pSpecificBssInfo->rNoaParam.u4NoaCount = value; - //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam); - break; - case 100: /* Oper CH */ - // 20110920 - frog: User configurations are placed in ConnSettings. - // prP2pConnSettings->ucOperatingChnl = value; - break; - case 101: /* Local config Method, for P2P SDK */ - prP2pConnSettings->u2LocalConfigMethod = value; - break; - case 102: /* Sigma P2p reset */ - //kalMemZero(prP2pConnSettings->aucTargetDevAddr, MAC_ADDR_LEN); - //prP2pConnSettings->eConnectionPolicy = ENUM_P2P_CONNECTION_POLICY_AUTO; - break; - case 103: /* WPS MODE */ - kalP2PSetWscMode(prGlueInfo, value); - break; - case 104: /* P2p send persence, duration */ - break; - case 105: /* P2p send persence, interval */ - break; - case 106: /* P2P set sleep */ - value = 1; - kalIoctl(prGlueInfo, - wlanoidSetP2pPowerSaveProfile, - &value, - sizeof(value), - FALSE, - FALSE, - TRUE, - TRUE, - &u4Leng); - break; - case 107: /* P2P set opps, CTWindowl */ - prP2pSpecificBssInfo->rOppPsParam.u4CTwindowMs = value; - //status = mtk_p2p_wext_set_oppps_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rOppPsParam); - break; - case 108: /* p2p_set_power_save */ - kalIoctl(prGlueInfo, - wlanoidSetP2pPowerSaveProfile, - &value, - sizeof(value), - FALSE, - FALSE, - TRUE, - TRUE, - &u4Leng); - - break; - case 109: /* Max Clients*/ - kalP2PSetMaxClients(prGlueInfo, value); - break; - default: - break; - } - - return status; - -} - - -int -mtk_p2p_cfg80211_testmode_hotspot_block_list_cmd( - IN struct wiphy *wiphy, - IN void *data, - IN int len) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - P_NL80211_DRIVER_hotspot_block_PARAMS prParams = (P_NL80211_DRIVER_hotspot_block_PARAMS)NULL; - int fgIsValid = 0; - - ASSERT(wiphy); - - prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy)); - - if(data && len) - prParams = (P_NL80211_DRIVER_hotspot_block_PARAMS)data; - - DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_testmode_hotspot_block_list_cmd\n")); - - fgIsValid = kalP2PSetBlackList(prGlueInfo, prParams->aucBssid, prParams->ucblocked); - - return fgIsValid; - -} - -#endif - - -#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) - -#endif // CFG_ENABLE_WIFI_DIRECT && CFG_ENABLE_WIFI_DIRECT_CFG_80211 diff --git a/drivers/net/wireless/mt5931/os/linux/gl_p2p_init.c b/drivers/net/wireless/mt5931/os/linux/gl_p2p_init.c deleted file mode 100755 index 8fd89a40f35a..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/gl_p2p_init.c +++ /dev/null @@ -1,518 +0,0 @@ -/* -** $Id: @(#) gl_p2p_init.c@@ -*/ - -/*! \file gl_p2p_init.c - \brief init and exit routines of Linux driver interface for Wi-Fi Direct - - This file contains the main routines of Linux driver for MediaTek Inc. 802.11 - Wireless LAN Adapters. -*/ - - - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -#include "precomp.h" - - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -#define P2P_MODE_INF_NAME "p2p%d"; -#define AP_MODE_INF_NAME "ap%d"; -//#define MAX_INF_NAME_LEN 15 -//#define MIN_INF_NAME_LEN 1 - -#define RUNNING_P2P_MODE 0 -#define RUNNING_AP_MODE 1 - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - - - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/* Get interface name and running mode from module insertion parameter -* Usage: insmod p2p.ko mode=1 -* default: interface name is p2p%d -* running mode is P2P -*/ -static PUCHAR ifname = P2P_MODE_INF_NAME; -static UINT_16 mode = RUNNING_P2P_MODE; - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -#if defined(CONFIG_HAS_EARLYSUSPEND) -extern int glRegisterEarlySuspend( - struct early_suspend *prDesc, - early_suspend_callback wlanSuspend, - late_resume_callback wlanResume); - -extern int glUnregisterEarlySuspend(struct early_suspend *prDesc); -#endif - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief check interface name parameter is valid or not -* if invalid, set ifname to P2P_MODE_INF_NAME -* -* -* \retval -*/ -/*----------------------------------------------------------------------------*/ -VOID -p2pCheckInterfaceName( - VOID - ) -{ - - if(mode) { - mode = RUNNING_AP_MODE; - ifname = AP_MODE_INF_NAME; - } -#if 0 - UINT_32 ifLen = 0; - - if(ifname) { - ifLen = strlen(ifname); - - if(ifLen > MAX_INF_NAME_LEN) { - ifname[MAX_INF_NAME_LEN] = '\0'; - } - else if( ifLen < MIN_INF_NAME_LEN ) { - ifname = P2P_MODE_INF_NAME; - } - } else { - ifname = P2P_MODE_INF_NAME; - } -#endif -} - - -extern UINT_8 g_aucBufIpAddr[32]; - -static void wlanP2PEarlySuspend(void) -{ - struct net_device *prDev = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - UINT_8 ip[4] = { 0 }; - UINT_32 u4NumIPv4 = 0; -#ifdef CONFIG_IPV6 - UINT_8 ip6[16] = { 0 }; // FIX ME: avoid to allocate large memory in stack - UINT_32 u4NumIPv6 = 0; -#endif - UINT_32 i; - P_PARAM_NETWORK_ADDRESS_IP prParamIpAddr; - - printk(KERN_INFO "*********p2pEarlySuspend************\n"); - - if(!wlanExportGlueInfo(&prGlueInfo)) { - printk(KERN_INFO "*********p2pEarlySuspend ignored************\n"); - return; - } - - ASSERT(prGlueInfo); - // <1> Sanity check and acquire the net_device - prDev = prGlueInfo->prP2PInfo->prDevHandler; - ASSERT(prDev); - - // <3> get the IPv4 address - if(!prDev || !(prDev->ip_ptr)||\ - !((struct in_device *)(prDev->ip_ptr))->ifa_list||\ - !(&(((struct in_device *)(prDev->ip_ptr))->ifa_list->ifa_local))){ - printk(KERN_INFO "ip is not avaliable.\n"); - return; - } - - // <4> copy the IPv4 address - kalMemCopy(ip, &(((struct in_device *)(prDev->ip_ptr))->ifa_list->ifa_local), sizeof(ip)); - printk(KERN_INFO"ip is %d.%d.%d.%d\n", - ip[0],ip[1],ip[2],ip[3]); - - // todo: traverse between list to find whole sets of IPv4 addresses - if (!((ip[0] == 0) && - (ip[1] == 0) && - (ip[2] == 0) && - (ip[3] == 0))) { - u4NumIPv4++; - } - -#ifdef CONFIG_IPV6 - // <5> get the IPv6 address - if(!prDev || !(prDev->ip6_ptr)||\ - !((struct in_device *)(prDev->ip6_ptr))->ifa_list||\ - !(&(((struct in_device *)(prDev->ip6_ptr))->ifa_list->ifa_local))){ - printk(KERN_INFO "ipv6 is not avaliable.\n"); - return; - } - // <6> copy the IPv6 address - kalMemCopy(ip6, &(((struct in_device *)(prDev->ip6_ptr))->ifa_list->ifa_local), sizeof(ip6)); - printk(KERN_INFO"ipv6 is %d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d\n", - ip6[0],ip6[1],ip6[2],ip6[3], - ip6[4],ip6[5],ip6[6],ip6[7], - ip6[8],ip6[9],ip6[10],ip6[11], - ip6[12],ip6[13],ip6[14],ip6[15] - ); - // todo: traverse between list to find whole sets of IPv6 addresses - - if (!((ip6[0] == 0) && - (ip6[1] == 0) && - (ip6[2] == 0) && - (ip6[3] == 0) && - (ip6[4] == 0) && - (ip6[5] == 0))) { - } - -#endif - // <7> set up the ARP filter - { - WLAN_STATUS rStatus = WLAN_STATUS_FAILURE; - UINT_32 u4SetInfoLen = 0; -// UINT_8 aucBuf[32] = {0}; - UINT_32 u4Len = OFFSET_OF(PARAM_NETWORK_ADDRESS_LIST, arAddress); - P_PARAM_NETWORK_ADDRESS_LIST prParamNetAddrList = (P_PARAM_NETWORK_ADDRESS_LIST)g_aucBufIpAddr;//aucBuf; - P_PARAM_NETWORK_ADDRESS prParamNetAddr = prParamNetAddrList->arAddress; - - kalMemZero(g_aucBufIpAddr, sizeof(g_aucBufIpAddr)); - - prParamNetAddrList->u4AddressCount = u4NumIPv4 + u4NumIPv6; - prParamNetAddrList->u2AddressType = PARAM_PROTOCOL_ID_TCP_IP; - for (i = 0; i < u4NumIPv4; i++) { - prParamNetAddr->u2AddressLength = sizeof(PARAM_NETWORK_ADDRESS_IP);//4;; - prParamNetAddr->u2AddressType = PARAM_PROTOCOL_ID_TCP_IP;; -#if 0 - kalMemCopy(prParamNetAddr->aucAddress, ip, sizeof(ip)); - prParamNetAddr = (P_PARAM_NETWORK_ADDRESS)((UINT_32)prParamNetAddr + sizeof(ip)); - u4Len += OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress) + sizeof(ip); -#else - prParamIpAddr = (P_PARAM_NETWORK_ADDRESS_IP)prParamNetAddr->aucAddress; - kalMemCopy(&prParamIpAddr->in_addr, ip, sizeof(ip)); - -// prParamNetAddr = (P_PARAM_NETWORK_ADDRESS)((UINT_32)prParamNetAddr + sizeof(PARAM_NETWORK_ADDRESS)); // TODO: frog. The pointer is not right. - - prParamNetAddr = (P_PARAM_NETWORK_ADDRESS) ((UINT_32) prParamNetAddr + - (UINT_32) (prParamNetAddr->u2AddressLength + OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress))); - - u4Len += OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress) + sizeof(PARAM_NETWORK_ADDRESS_IP); -#endif - } -#ifdef CONFIG_IPV6 - for (i = 0; i < u4NumIPv6; i++) { - prParamNetAddr->u2AddressLength = 6;; - prParamNetAddr->u2AddressType = PARAM_PROTOCOL_ID_TCP_IP;; - kalMemCopy(prParamNetAddr->aucAddress, ip6, sizeof(ip6)); -// prParamNetAddr = (P_PARAM_NETWORK_ADDRESS)((UINT_32)prParamNetAddr + sizeof(ip6)); - - prParamNetAddr = (P_PARAM_NETWORK_ADDRESS) ((UINT_32) prParamNetAddr + - (UINT_32) (prParamNetAddr->u2AddressLength + OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress))); - - u4Len += OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress) + sizeof(ip6); - } -#endif - ASSERT(u4Len <= sizeof(g_aucBufIpAddr/*aucBuf*/)); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetP2pSetNetworkAddress, - (PVOID)prParamNetAddrList, - u4Len, - FALSE, - FALSE, - TRUE, - TRUE, - &u4SetInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - printk(KERN_INFO DRV_NAME"set HW pattern filter fail 0x%lx\n", rStatus); - } - } -} - - -static void wlanP2PLateResume(void) -{ - struct net_device *prDev = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - UINT_8 ip[4] = { 0 }; -#ifdef CONFIG_IPV6 - UINT_8 ip6[16] = { 0 }; // FIX ME: avoid to allocate large memory in stack -#endif - - printk(KERN_INFO "*********wlanP2PLateResume************\n"); - if(!wlanExportGlueInfo(&prGlueInfo)) { - printk(KERN_INFO "*********p2pLateResume ignored************\n"); - return; - } - - ASSERT(prGlueInfo); - // <1> Sanity check and acquire the net_device - prDev = prGlueInfo->prP2PInfo->prDevHandler; - ASSERT(prDev); - - // <3> get the IPv4 address - if(!prDev || !(prDev->ip_ptr)||\ - !((struct in_device *)(prDev->ip_ptr))->ifa_list||\ - !(&(((struct in_device *)(prDev->ip_ptr))->ifa_list->ifa_local))){ - printk(KERN_INFO "ip is not avaliable.\n"); - return; - } - - // <4> copy the IPv4 address - kalMemCopy(ip, &(((struct in_device *)(prDev->ip_ptr))->ifa_list->ifa_local), sizeof(ip)); - printk(KERN_INFO"ip is %d.%d.%d.%d\n", - ip[0],ip[1],ip[2],ip[3]); - -#ifdef CONFIG_IPV6 - // <5> get the IPv6 address - if(!prDev || !(prDev->ip6_ptr)||\ - !((struct in_device *)(prDev->ip6_ptr))->ifa_list||\ - !(&(((struct in_device *)(prDev->ip6_ptr))->ifa_list->ifa_local))){ - printk(KERN_INFO "ipv6 is not avaliable.\n"); - return; - } - // <6> copy the IPv6 address - kalMemCopy(ip6, &(((struct in_device *)(prDev->ip6_ptr))->ifa_list->ifa_local), sizeof(ip6)); - printk(KERN_INFO"ipv6 is %d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d\n", - ip6[0],ip6[1],ip6[2],ip6[3], - ip6[4],ip6[5],ip6[6],ip6[7], - ip6[8],ip6[9],ip6[10],ip6[11], - ip6[12],ip6[13],ip6[14],ip6[15] - ); -#endif - // <7> clear the ARP filter - { - WLAN_STATUS rStatus = WLAN_STATUS_FAILURE; - UINT_32 u4SetInfoLen = 0; -// UINT_8 aucBuf[32] = {0}; - UINT_32 u4Len = sizeof(PARAM_NETWORK_ADDRESS_LIST); - P_PARAM_NETWORK_ADDRESS_LIST prParamNetAddrList = (P_PARAM_NETWORK_ADDRESS_LIST)g_aucBufIpAddr;//aucBuf; - - kalMemZero(g_aucBufIpAddr, sizeof(g_aucBufIpAddr)); - - prParamNetAddrList->u4AddressCount = 0; - prParamNetAddrList->u2AddressType = PARAM_PROTOCOL_ID_TCP_IP; - - ASSERT(u4Len <= sizeof(g_aucBufIpAddr/*aucBuf*/)); - rStatus = kalIoctl(prGlueInfo, - wlanoidSetP2pSetNetworkAddress, - (PVOID)prParamNetAddrList, - u4Len, - FALSE, - FALSE, - TRUE, - TRUE, - &u4SetInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - printk(KERN_INFO DRV_NAME"set HW pattern filter fail 0x%lx\n", rStatus); - } - } -} - -#if defined(CONFIG_HAS_EARLYSUSPEND) -static struct early_suspend mt6620_p2p_early_suspend_desc = { - .level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN, -}; - -static void p2p_early_suspend(struct early_suspend *h) -{ - printk(KERN_INFO "*********wlanP2P_early_suspend************\n"); - wlanP2PEarlySuspend(); -} - -static void p2p_late_resume(struct early_suspend *h) -{ - printk(KERN_INFO "*********wlanP2P_late_resume************\n"); - wlanP2PLateResume(); -} -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* run p2p init procedure, include register pointer to wlan -* glue register p2p -* set p2p registered flag -* \retval 1 Success -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -p2pLaunch( - P_GLUE_INFO_T prGlueInfo - ) -{ - - printk("p2p Launch\n"); - - if(prGlueInfo->prAdapter->fgIsP2PRegistered == TRUE) { - printk("p2p already registered\n"); - return FALSE; - } - else if(glRegisterP2P(prGlueInfo, ifname, (BOOLEAN)mode)) { - prGlueInfo->prAdapter->fgIsP2PRegistered = TRUE; - - printk("Launch success, fgIsP2PRegistered TRUE.\n"); - -#if defined(CONFIG_HAS_EARLYSUSPEND) - /* Here, we register the early suspend and resume callback */ - glRegisterEarlySuspend(&mt6620_p2p_early_suspend_desc, p2p_early_suspend, p2p_late_resume); -#endif - - return TRUE; - } - else { - printk("Launch Fail\n"); - } - - return FALSE; -} - - -VOID -p2pSetMode ( - IN BOOLEAN fgIsAPMOde - ) -{ - if (fgIsAPMOde) { - mode = RUNNING_AP_MODE; - ifname = AP_MODE_INF_NAME; - } - else { - mode = RUNNING_P2P_MODE; - ifname = P2P_MODE_INF_NAME; - } - - return; -} /* p2pSetMode */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* run p2p exit procedure, include unregister pointer to wlan -* glue unregister p2p -* set p2p registered flag - -* \retval 1 Success -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -p2pRemove( - P_GLUE_INFO_T prGlueInfo - ) -{ - if(prGlueInfo->prAdapter->fgIsP2PRegistered == FALSE) { - printk("p2p is not Registered.\n"); - return FALSE; - } - else { - -#if defined(CONFIG_HAS_EARLYSUSPEND) - glUnregisterEarlySuspend(&mt6620_p2p_early_suspend_desc); -#endif - /*Check p2p fsm is stop or not. If not then stop now*/ - if(IS_P2P_ACTIVE(prGlueInfo->prAdapter)) { - p2pStopImmediate(prGlueInfo); - } - prGlueInfo->prAdapter->fgIsP2PRegistered = FALSE; - glUnregisterP2P(prGlueInfo); - /*p2p is removed successfully*/ - return TRUE; - } - return FALSE; -} - -#if 0 -/*----------------------------------------------------------------------------*/ -/*! -* \brief Driver entry point when the driver is configured as a Linux Module, and -* is called once at module load time, by the user-level modutils -* application: insmod or modprobe. -* -* \retval 0 Success -*/ -/*----------------------------------------------------------------------------*/ -static int initP2P(void) -{ - P_GLUE_INFO_T prGlueInfo; - - /*check interface name validation*/ - p2pCheckInterfaceName(); - - printk( KERN_INFO DRV_NAME "InitP2P, Ifname: %s, Mode: %s\n", ifname, mode ? "AP":"P2P"); - - /*register p2p init & exit function to wlan sub module handler*/ - wlanSubModRegisterInitExit(p2pLaunch, p2pRemove, P2P_MODULE); - - /*if wlan is not start yet, do nothing - * p2pLaunch will be called by txthread while wlan start - */ - /*if wlan is not started yet, return FALSE*/ - if(wlanExportGlueInfo(&prGlueInfo)) { - wlanSubModInit(prGlueInfo); - return ( prGlueInfo->prAdapter->fgIsP2PRegistered? 0: -EIO); - } - - return 0; -} /* end of initP2P() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Driver exit point when the driver as a Linux Module is removed. Called -* at module unload time, by the user level modutils application: rmmod. -* This is our last chance to clean up after ourselves. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -//1 Module Leave Point -static VOID __exit exitP2P(void) -{ - P_GLUE_INFO_T prGlueInfo; - - printk( KERN_INFO DRV_NAME "ExitP2P\n"); - - /*if wlan is not started yet, return FALSE*/ - if(wlanExportGlueInfo(&prGlueInfo)) { - wlanSubModExit(prGlueInfo); - } - /*UNregister p2p init & exit function to wlan sub module handler*/ - wlanSubModRegisterInitExit(NULL, NULL, P2P_MODULE); -} /* end of exitP2P() */ -#endif - diff --git a/drivers/net/wireless/mt5931/os/linux/gl_p2p_kal.c b/drivers/net/wireless/mt5931/os/linux/gl_p2p_kal.c deleted file mode 100755 index 08a5f9b271b6..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/gl_p2p_kal.c +++ /dev/null @@ -1,1629 +0,0 @@ -/* -** $Id: @(#) gl_p2p_cfg80211.c@@ -*/ - -/*! \file gl_p2p_kal.c - \brief - -*/ - - - - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "net/cfg80211.h" -#include "precomp.h" - -extern BOOLEAN -wextSrchDesiredWPAIE ( - IN PUINT_8 pucIEStart, - IN INT_32 i4TotalIeLen, - IN UINT_8 ucDesiredElemId, - OUT PUINT_8 *ppucDesiredIE - ); - -#if CFG_SUPPORT_WPS -extern BOOLEAN -wextSrchDesiredWPSIE ( - IN PUINT_8 pucIEStart, - IN INT_32 i4TotalIeLen, - IN UINT_8 ucDesiredElemId, - OUT PUINT_8 *ppucDesiredIE - ); -#endif - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -BOOLEAN -kalP2pFuncGetChannelType( - IN ENUM_CHNL_EXT_T rChnlSco, - OUT enum nl80211_channel_type *channel_type - ); - - -struct ieee80211_channel * -kalP2pFuncGetChannelEntry( - IN P_GL_P2P_INFO_T prP2pInfo, - IN P_RF_CHANNEL_INFO_T prChannelInfo - ); - - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to retrieve Wi-Fi Direct state from glue layer -* -* \param[in] -* prGlueInfo -* rPeerAddr -* \return -* ENUM_BOW_DEVICE_STATE -*/ -/*----------------------------------------------------------------------------*/ -ENUM_PARAM_MEDIA_STATE_T -kalP2PGetState ( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - return prGlueInfo->prP2PInfo->eState; -} /* end of kalP2PGetState() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to update the assoc req to p2p -* -* \param[in] -* prGlueInfo -* pucFrameBody -* u4FrameBodyLen -* fgReassocRequest -* \return -* none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalP2PUpdateAssocInfo ( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucFrameBody, - IN UINT_32 u4FrameBodyLen, - IN BOOLEAN fgReassocRequest - ) -{ - union iwreq_data wrqu; - unsigned char *pucExtraInfo = NULL; - unsigned char *pucDesiredIE = NULL; -// unsigned char aucExtraInfoBuf[200]; - PUINT_8 cp; - - memset(&wrqu, 0, sizeof(wrqu)); - - if (fgReassocRequest) { - if (u4FrameBodyLen < 15) { - /* - printk(KERN_WARNING "frameBodyLen too short:%ld\n", frameBodyLen); - */ - return; - } - } - else { - if (u4FrameBodyLen < 9) { - /* - printk(KERN_WARNING "frameBodyLen too short:%ld\n", frameBodyLen); - */ - return; - } - } - - cp = pucFrameBody; - - if (fgReassocRequest) { - /* Capability information field 2 */ - /* Listen interval field 2*/ - /* Current AP address 6 */ - cp += 10; - u4FrameBodyLen -= 10; - } - else { - /* Capability information field 2 */ - /* Listen interval field 2*/ - cp += 4; - u4FrameBodyLen -= 4; - } - - /* do supplicant a favor, parse to the start of WPA/RSN IE */ - if (wextSrchDesiredWPSIE(cp, u4FrameBodyLen, 0xDD, &pucDesiredIE)) { - //printk("wextSrchDesiredWPSIE!!\n"); - /* WPS IE found */ - } - else if (wextSrchDesiredWPAIE(cp, u4FrameBodyLen, 0x30, &pucDesiredIE)) { - //printk("wextSrchDesiredWPAIE!!\n"); - /* RSN IE found */ - } - else if (wextSrchDesiredWPAIE(cp, u4FrameBodyLen, 0xDD, &pucDesiredIE)) { - //printk("wextSrchDesiredWPAIE!!\n"); - /* WPA IE found */ - } - else { - /* no WPA/RSN IE found, skip this event */ - goto skip_indicate_event; - } - - /* IWEVASSOCREQIE, indicate binary string */ - pucExtraInfo = pucDesiredIE; - wrqu.data.length = pucDesiredIE[1] + 2; - - /* Send event to user space */ - wireless_send_event(prGlueInfo->prP2PInfo->prDevHandler, IWEVASSOCREQIE, &wrqu, pucExtraInfo); - -skip_indicate_event: - return; - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to set Wi-Fi Direct state in glue layer -* -* \param[in] -* prGlueInfo -* eBowState -* rPeerAddr -* \return -* none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalP2PSetState ( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_PARAM_MEDIA_STATE_T eState, - IN PARAM_MAC_ADDRESS rPeerAddr, - IN UINT_8 ucRole - ) -{ - union iwreq_data evt; - UINT_8 aucBuffer[IW_CUSTOM_MAX]; - - ASSERT(prGlueInfo); - - memset(&evt, 0, sizeof(evt)); - - if(eState == PARAM_MEDIA_STATE_CONNECTED) { - prGlueInfo->prP2PInfo->eState = PARAM_MEDIA_STATE_CONNECTED; - - snprintf(aucBuffer, IW_CUSTOM_MAX-1, "P2P_STA_CONNECT="MACSTR, MAC2STR(rPeerAddr)); - evt.data.length = strlen(aucBuffer); - - /* indicate in IWECUSTOM event */ - wireless_send_event(prGlueInfo->prP2PInfo->prDevHandler, - IWEVCUSTOM, - &evt, - aucBuffer); - - } - else if(eState == PARAM_MEDIA_STATE_DISCONNECTED) { - snprintf(aucBuffer, IW_CUSTOM_MAX-1, "P2P_STA_DISCONNECT="MACSTR, MAC2STR(rPeerAddr)); - evt.data.length = strlen(aucBuffer); - - /* indicate in IWECUSTOM event */ - wireless_send_event(prGlueInfo->prP2PInfo->prDevHandler, - IWEVCUSTOM, - &evt, - aucBuffer); - } - else { - ASSERT(0); - } - - return; -} /* end of kalP2PSetState() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to retrieve Wi-Fi Direct operating frequency -* -* \param[in] -* prGlueInfo -* -* \return -* in unit of KHz -*/ -/*----------------------------------------------------------------------------*/ -UINT_32 -kalP2PGetFreqInKHz( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - return prGlueInfo->prP2PInfo->u4FreqInKHz; -} /* end of kalP2PGetFreqInKHz() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to retrieve Bluetooth-over-Wi-Fi role -* -* \param[in] -* prGlueInfo -* -* \return -* 0: P2P Device -* 1: Group Client -* 2: Group Owner -*/ -/*----------------------------------------------------------------------------*/ -UINT_8 -kalP2PGetRole( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - - return prGlueInfo->prP2PInfo->ucRole; -} /* end of kalP2PGetRole() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to set Wi-Fi Direct role -* -* \param[in] -* prGlueInfo -* ucResult -* 0: successful -* 1: error -* ucRole -* 0: P2P Device -* 1: Group Client -* 2: Group Owner -* -* \return -* none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalP2PSetRole( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_8 ucResult, - IN PUINT_8 pucSSID, - IN UINT_8 ucSSIDLen, - IN UINT_8 ucRole - ) -{ - union iwreq_data evt; - UINT_8 aucBuffer[IW_CUSTOM_MAX]; - - ASSERT(prGlueInfo); - ASSERT(ucRole <= 2); - - memset(&evt, 0, sizeof(evt)); - - if(ucResult == 0) { - prGlueInfo->prP2PInfo->ucRole = ucRole; - } - - if (pucSSID) - snprintf(aucBuffer, IW_CUSTOM_MAX-1, "P2P_FORMATION_RST=%d%d%d%c%c", ucResult, ucRole, 1/* persistence or not */, pucSSID[7], pucSSID[8]); - else - snprintf(aucBuffer, IW_CUSTOM_MAX-1, "P2P_FORMATION_RST=%d%d%d%c%c", ucResult, ucRole, 1/* persistence or not */, '0', '0'); - - evt.data.length = strlen(aucBuffer); - - //if (pucSSID) - // printk("P2P GO SSID DIRECT-%c%c\n", pucSSID[7], pucSSID[8]); - - /* indicate in IWECUSTOM event */ - wireless_send_event(prGlueInfo->prP2PInfo->prDevHandler, - IWEVCUSTOM, - &evt, - aucBuffer); - - return; -} /* end of kalP2PSetRole() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to set the cipher for p2p -* -* \param[in] -* prGlueInfo -* u4Cipher -* -* \return -* none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalP2PSetCipher( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4Cipher - ) -{ - ASSERT(prGlueInfo); - ASSERT(prGlueInfo->prP2PInfo); - - prGlueInfo->prP2PInfo->u4CipherPairwise = u4Cipher; - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to get the cipher, return for cipher is ccmp -* -* \param[in] -* prGlueInfo -* -* \return -* TRUE: cipher is ccmp -* FALSE: cipher is none -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalP2PGetCipher ( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - ASSERT(prGlueInfo->prP2PInfo); - - if (prGlueInfo->prP2PInfo->u4CipherPairwise == IW_AUTH_CIPHER_CCMP) - return TRUE; - - if (prGlueInfo->prP2PInfo->u4CipherPairwise == IW_AUTH_CIPHER_TKIP) - return TRUE; - - return FALSE; -} - -BOOLEAN -kalP2PGetCcmpCipher ( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - ASSERT(prGlueInfo->prP2PInfo); - - if (prGlueInfo->prP2PInfo->u4CipherPairwise == IW_AUTH_CIPHER_CCMP) - return TRUE; - - if (prGlueInfo->prP2PInfo->u4CipherPairwise == IW_AUTH_CIPHER_TKIP) - return FALSE; - - return FALSE; -} - - -BOOLEAN -kalP2PGetTkipCipher ( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - ASSERT(prGlueInfo->prP2PInfo); - - if (prGlueInfo->prP2PInfo->u4CipherPairwise == IW_AUTH_CIPHER_CCMP) - return FALSE; - - if (prGlueInfo->prP2PInfo->u4CipherPairwise == IW_AUTH_CIPHER_TKIP) - return TRUE; - - return FALSE; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to set the status of WSC -* -* \param[in] -* prGlueInfo -* -* \return -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalP2PSetWscMode ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_8 ucWscMode - ) -{ - ASSERT(prGlueInfo); - ASSERT(prGlueInfo->prP2PInfo); - - prGlueInfo->prP2PInfo->ucWSCRunning = ucWscMode; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to get the status of WSC -* -* \param[in] -* prGlueInfo -* -* \return -*/ -/*----------------------------------------------------------------------------*/ -UINT_8 -kalP2PGetWscMode ( - IN P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - ASSERT(prGlueInfo->prP2PInfo); - - return (prGlueInfo->prP2PInfo->ucWSCRunning); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to get the wsc ie length -* -* \param[in] -* prGlueInfo -* ucType : 0 for beacon, 1 for probe req, 2 for probe resp -* -* \return -* The WSC IE length -*/ -/*----------------------------------------------------------------------------*/ -UINT_16 -kalP2PCalWSC_IELen ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_8 ucType - ) -{ - ASSERT(prGlueInfo); - - ASSERT(ucType < 3); - - return prGlueInfo->prP2PInfo->u2WSCIELen[ucType]; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to copy the wsc ie setting from p2p supplicant -* -* \param[in] -* prGlueInfo -* -* \return -* The WPS IE length -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalP2PGenWSC_IE ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_8 ucType, - IN PUINT_8 pucBuffer - ) -{ - P_GL_P2P_INFO_T prGlP2pInfo = (P_GL_P2P_INFO_T)NULL; - - do { - if ((prGlueInfo == NULL) || - (ucType >= 3) || - (pucBuffer == NULL)) { - break; - } - - - prGlP2pInfo = prGlueInfo->prP2PInfo; - - kalMemCopy(pucBuffer, prGlP2pInfo->aucWSCIE[ucType], prGlP2pInfo->u2WSCIELen[ucType]); - - } while (FALSE); - - return; -} - - -VOID -kalP2PUpdateWSC_IE ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_8 ucType, - IN PUINT_8 pucBuffer, - IN UINT_16 u2BufferLength - ) -{ - P_GL_P2P_INFO_T prGlP2pInfo = (P_GL_P2P_INFO_T)NULL; - - do { - if ((prGlueInfo == NULL) || - (ucType >= 3) || - ((u2BufferLength > 0) && (pucBuffer == NULL))) { - break; - } - - - if (u2BufferLength > 400) { - DBGLOG(P2P, ERROR, ("Buffer length is not enough, GLUE only 400 bytes but %d received\n", u2BufferLength)); - ASSERT(FALSE); - break; - } - - - prGlP2pInfo = prGlueInfo->prP2PInfo; - - kalMemCopy(prGlP2pInfo->aucWSCIE[ucType], pucBuffer, u2BufferLength); - - prGlP2pInfo->u2WSCIELen[ucType] = u2BufferLength; - - - } while (FALSE); - - return; -} /* kalP2PUpdateWSC_IE */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief indicate an event to supplicant for device connection request -* -* \param[in] prGlueInfo Pointer of GLUE_INFO_T -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalP2PIndicateConnReq( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucDevName, - IN INT_32 u4NameLength, - IN PARAM_MAC_ADDRESS rPeerAddr, - IN UINT_8 ucDevType, /* 0: P2P Device / 1: GC / 2: GO */ - IN INT_32 i4ConfigMethod, - IN INT_32 i4ActiveConfigMethod - ) -{ - union iwreq_data evt; - UINT_8 aucBuffer[IW_CUSTOM_MAX]; - - ASSERT(prGlueInfo); - - /* buffer peer information for later IOC_P2P_GET_REQ_DEVICE_INFO access */ - prGlueInfo->prP2PInfo->u4ConnReqNameLength = u4NameLength > 32 ? 32 : u4NameLength; - kalMemCopy(prGlueInfo->prP2PInfo->aucConnReqDevName, - pucDevName, - prGlueInfo->prP2PInfo->u4ConnReqNameLength); - COPY_MAC_ADDR(prGlueInfo->prP2PInfo->rConnReqPeerAddr, rPeerAddr); - prGlueInfo->prP2PInfo->ucConnReqDevType = ucDevType; - prGlueInfo->prP2PInfo->i4ConnReqConfigMethod = i4ConfigMethod; - prGlueInfo->prP2PInfo->i4ConnReqActiveConfigMethod = i4ActiveConfigMethod; - - // prepare event structure - memset(&evt, 0, sizeof(evt)); - - snprintf(aucBuffer, IW_CUSTOM_MAX-1, "P2P_DVC_REQ"); - evt.data.length = strlen(aucBuffer); - - /* indicate in IWEVCUSTOM event */ - wireless_send_event(prGlueInfo->prP2PInfo->prDevHandler, - IWEVCUSTOM, - &evt, - aucBuffer); - - return; -} /* end of kalP2PIndicateConnReq() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Indicate an event to supplicant for device connection request from other device. -* -* \param[in] prGlueInfo Pointer of GLUE_INFO_T -* \param[in] pucGroupBssid Only valid when invitation Type equals to 0. -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalP2PInvitationIndication ( - IN P_GLUE_INFO_T prGlueInfo, - IN P_P2P_DEVICE_DESC_T prP2pDevDesc, - IN PUINT_8 pucSsid, - IN UINT_8 ucSsidLen, - IN UINT_8 ucOperatingChnl, - IN UINT_8 ucInvitationType, - IN PUINT_8 pucGroupBssid - ) -{ -#if 1 - union iwreq_data evt; - UINT_8 aucBuffer[IW_CUSTOM_MAX]; - - ASSERT(prGlueInfo); - - /* buffer peer information for later IOC_P2P_GET_STRUCT access */ - prGlueInfo->prP2PInfo->u4ConnReqNameLength = (UINT_32)((prP2pDevDesc->u2NameLength > 32)? 32 : prP2pDevDesc->u2NameLength); - kalMemCopy(prGlueInfo->prP2PInfo->aucConnReqDevName, - prP2pDevDesc->aucName, - prGlueInfo->prP2PInfo->u4ConnReqNameLength); - COPY_MAC_ADDR(prGlueInfo->prP2PInfo->rConnReqPeerAddr, prP2pDevDesc->aucDeviceAddr); - COPY_MAC_ADDR(prGlueInfo->prP2PInfo->rConnReqGroupAddr, pucGroupBssid); - prGlueInfo->prP2PInfo->i4ConnReqConfigMethod = (INT_32)(prP2pDevDesc->u2ConfigMethod); - prGlueInfo->prP2PInfo->ucOperatingChnl = ucOperatingChnl; - prGlueInfo->prP2PInfo->ucInvitationType = ucInvitationType; - - // prepare event structure - memset(&evt, 0, sizeof(evt)); - - snprintf(aucBuffer, IW_CUSTOM_MAX-1, "P2P_INV_INDICATE"); - evt.data.length = strlen(aucBuffer); - - /* indicate in IWEVCUSTOM event */ - wireless_send_event(prGlueInfo->prP2PInfo->prDevHandler, - IWEVCUSTOM, - &evt, - aucBuffer); - return; - -#else - P_MSG_P2P_CONNECTION_REQUEST_T prP2pConnReq = (P_MSG_P2P_CONNECTION_REQUEST_T)NULL; - P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; - P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL; - - do { - ASSERT_BREAK((prGlueInfo != NULL) && (prP2pDevDesc != NULL)); - - - // Not a real solution - - prP2pSpecificBssInfo = prGlueInfo->prAdapter->rWifiVar.prP2pSpecificBssInfo; - prP2pConnSettings = prGlueInfo->prAdapter->rWifiVar.prP2PConnSettings; - - prP2pConnReq = (P_MSG_P2P_CONNECTION_REQUEST_T)cnmMemAlloc(prGlueInfo->prAdapter, - RAM_TYPE_MSG, - sizeof(MSG_P2P_CONNECTION_REQUEST_T)); - - if (prP2pConnReq == NULL) { - break; - } - - - kalMemZero(prP2pConnReq, sizeof(MSG_P2P_CONNECTION_REQUEST_T)); - - prP2pConnReq->rMsgHdr.eMsgId = MID_MNY_P2P_CONNECTION_REQ; - - prP2pConnReq->eFormationPolicy = ENUM_P2P_FORMATION_POLICY_AUTO; - - COPY_MAC_ADDR(prP2pConnReq->aucDeviceID, prP2pDevDesc->aucDeviceAddr); - - prP2pConnReq->u2ConfigMethod = prP2pDevDesc->u2ConfigMethod; - - if (ucInvitationType == P2P_INVITATION_TYPE_INVITATION) { - prP2pConnReq->fgIsPersistentGroup = FALSE; - prP2pConnReq->fgIsTobeGO = FALSE; - - } - - else if (ucInvitationType == P2P_INVITATION_TYPE_REINVOKE) { - DBGLOG(P2P, TRACE, ("Re-invoke Persistent Group\n")); - prP2pConnReq->fgIsPersistentGroup = TRUE; - prP2pConnReq->fgIsTobeGO = (prGlueInfo->prP2PInfo->ucRole == 2)?TRUE:FALSE; - - } - - - p2pFsmRunEventDeviceDiscoveryAbort(prGlueInfo->prAdapter, NULL); - - if (ucOperatingChnl != 0) { - prP2pSpecificBssInfo->ucPreferredChannel = ucOperatingChnl; - } - - if ((ucSsidLen < 32) && (pucSsid != NULL)) { - COPY_SSID(prP2pConnSettings->aucSSID, - prP2pConnSettings->ucSSIDLen, - pucSsid, - ucSsidLen); - } - - mboxSendMsg(prGlueInfo->prAdapter, - MBOX_ID_0, - (P_MSG_HDR_T)prP2pConnReq, - MSG_SEND_METHOD_BUF); - - - - } while (FALSE); - - // frog add. - // TODO: Invitation Indication - - return; -#endif - -} /* kalP2PInvitationIndication */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Indicate an status to supplicant for device invitation status. -* -* \param[in] prGlueInfo Pointer of GLUE_INFO_T -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalP2PInvitationStatus ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4InvStatus - ) -{ - union iwreq_data evt; - UINT_8 aucBuffer[IW_CUSTOM_MAX]; - - ASSERT(prGlueInfo); - - /* buffer peer information for later IOC_P2P_GET_STRUCT access */ - prGlueInfo->prP2PInfo->u4InvStatus = u4InvStatus; - - // prepare event structure - memset(&evt, 0, sizeof(evt)); - - snprintf(aucBuffer, IW_CUSTOM_MAX-1, "P2P_INV_STATUS"); - evt.data.length = strlen(aucBuffer); - - /* indicate in IWEVCUSTOM event */ - wireless_send_event(prGlueInfo->prP2PInfo->prDevHandler, - IWEVCUSTOM, - &evt, - aucBuffer); - - return; -} /* kalP2PInvitationStatus */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Indicate an event to supplicant for Service Discovery request from other device. -* -* \param[in] prGlueInfo Pointer of GLUE_INFO_T -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalP2PIndicateSDRequest( - IN P_GLUE_INFO_T prGlueInfo, - IN PARAM_MAC_ADDRESS rPeerAddr, - IN UINT_8 ucSeqNum - ) -{ - union iwreq_data evt; - UINT_8 aucBuffer[IW_CUSTOM_MAX]; - - ASSERT(prGlueInfo); - - memset(&evt, 0, sizeof(evt)); - - snprintf(aucBuffer, IW_CUSTOM_MAX-1, "P2P_SD_REQ %d", ucSeqNum); - evt.data.length = strlen(aucBuffer); - - /* indicate IWEVP2PSDREQ event */ - wireless_send_event(prGlueInfo->prP2PInfo->prDevHandler, - IWEVCUSTOM, - &evt, - aucBuffer); - - return; -} /* end of kalP2PIndicateSDRequest() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Indicate an event to supplicant for Service Discovery response -* from other device. -* -* \param[in] prGlueInfo Pointer of GLUE_INFO_T -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -void -kalP2PIndicateSDResponse( - IN P_GLUE_INFO_T prGlueInfo, - IN PARAM_MAC_ADDRESS rPeerAddr, - IN UINT_8 ucSeqNum - ) -{ - union iwreq_data evt; - UINT_8 aucBuffer[IW_CUSTOM_MAX]; - - ASSERT(prGlueInfo); - - memset(&evt, 0, sizeof(evt)); - - snprintf(aucBuffer, IW_CUSTOM_MAX-1, "P2P_SD_RESP %d", ucSeqNum); - evt.data.length = strlen(aucBuffer); - - /* indicate IWEVP2PSDREQ event */ - wireless_send_event(prGlueInfo->prP2PInfo->prDevHandler, - IWEVCUSTOM, - &evt, - aucBuffer); - - return; -} /* end of kalP2PIndicateSDResponse() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Indicate an event to supplicant for Service Discovery TX Done -* from other device. -* -* \param[in] prGlueInfo Pointer of GLUE_INFO_T -* \param[in] ucSeqNum Sequence number of the frame -* \param[in] ucStatus Status code for TX -* -* \retval none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalP2PIndicateTXDone( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_8 ucSeqNum, - IN UINT_8 ucStatus - ) -{ - union iwreq_data evt; - UINT_8 aucBuffer[IW_CUSTOM_MAX]; - - ASSERT(prGlueInfo); - - memset(&evt, 0, sizeof(evt)); - - snprintf(aucBuffer, IW_CUSTOM_MAX-1, "P2P_SD_XMITTED: %d %d", ucSeqNum, ucStatus); - evt.data.length = strlen(aucBuffer); - - /* indicate IWEVP2PSDREQ event */ - wireless_send_event(prGlueInfo->prP2PInfo->prDevHandler, - IWEVCUSTOM, - &evt, - aucBuffer); - - return; -} /* end of kalP2PIndicateSDResponse() */ - - -struct net_device* -kalP2PGetDevHdlr( - P_GLUE_INFO_T prGlueInfo - ) -{ - ASSERT(prGlueInfo); - ASSERT(prGlueInfo->prP2PInfo); - return prGlueInfo->prP2PInfo->prDevHandler; -} - -#if CFG_SUPPORT_ANTI_PIRACY -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalP2PIndicateSecCheckRsp ( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucRsp, - IN UINT_16 u2RspLen - ) -{ - union iwreq_data evt; - UINT_8 aucBuffer[IW_CUSTOM_MAX]; - - ASSERT(prGlueInfo); - - memset(&evt, 0, sizeof(evt)); - snprintf(aucBuffer, IW_CUSTOM_MAX-1, "P2P_SEC_CHECK_RSP="); - - kalMemCopy(prGlueInfo->prP2PInfo->aucSecCheckRsp, pucRsp, u2RspLen); - evt.data.length = strlen(aucBuffer); - -#if DBG - DBGLOG_MEM8(SEC, LOUD, prGlueInfo->prP2PInfo->aucSecCheckRsp, u2RspLen); -#endif - /* indicate in IWECUSTOM event */ - wireless_send_event(prGlueInfo->prP2PInfo->prDevHandler, - IWEVCUSTOM, - &evt, - aucBuffer); - return; -} /* p2pFsmRunEventRxDisassociation */ -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief -* -* \param[in] prAdapter Pointer of ADAPTER_T -* -* \return none -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalGetChnlList( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_BAND_T eSpecificBand, - IN UINT_8 ucMaxChannelNum, - IN PUINT_8 pucNumOfChannel, - IN P_RF_CHANNEL_INFO_T paucChannelList - ) -{ - rlmDomainGetChnlList(prGlueInfo->prAdapter, - eSpecificBand, - ucMaxChannelNum, - pucNumOfChannel, - paucChannelList); -} /* kalGetChnlList */ - -//////////////////////////////////////ICS SUPPORT////////////////////////////////////// - -VOID -kalP2PIndicateChannelReady ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_64 u8SeqNum, - IN UINT_32 u4ChannelNum, - IN ENUM_BAND_T eBand, - IN ENUM_CHNL_EXT_T eSco, - IN UINT_32 u4Duration - ) -{ - struct ieee80211_channel *prIEEE80211ChnlStruct = (struct ieee80211_channel *)NULL; - RF_CHANNEL_INFO_T rChannelInfo; - enum nl80211_channel_type eChnlType = NL80211_CHAN_NO_HT; - - do { - if (prGlueInfo == NULL) { - break; - } - - - kalMemZero(&rChannelInfo, sizeof(RF_CHANNEL_INFO_T)); - - rChannelInfo.ucChannelNum = u4ChannelNum; - rChannelInfo.eBand = eBand; - - prIEEE80211ChnlStruct = kalP2pFuncGetChannelEntry(prGlueInfo->prP2PInfo, &rChannelInfo); - - kalP2pFuncGetChannelType(eSco, &eChnlType); - - cfg80211_ready_on_channel(prGlueInfo->prP2PInfo->prDevHandler, //struct net_device * dev, - u8SeqNum, //u64 cookie, - prIEEE80211ChnlStruct, //struct ieee80211_channel * chan, - eChnlType, //enum nl80211_channel_type channel_type, - u4Duration, //unsigned int duration, - GFP_KERNEL); //gfp_t gfp /* allocation flags */ - - } while (FALSE); - -} /* kalP2PIndicateChannelReady */ - -VOID -kalP2PIndicateChannelExpired ( - IN P_GLUE_INFO_T prGlueInfo, - IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo - ) -{ - - P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T)NULL; - struct ieee80211_channel *prIEEE80211ChnlStruct = (struct ieee80211_channel *)NULL; - enum nl80211_channel_type eChnlType = NL80211_CHAN_NO_HT; - RF_CHANNEL_INFO_T rRfChannelInfo; - - do { - if ((prGlueInfo == NULL) || (prChnlReqInfo == NULL)) { - - ASSERT(FALSE); - break; - } - - prGlueP2pInfo = prGlueInfo->prP2PInfo; - - if (prGlueP2pInfo == NULL) { - ASSERT(FALSE); - break; - } - - - DBGLOG(P2P, TRACE, ("kalP2PIndicateChannelExpired\n")); - - rRfChannelInfo.eBand = prChnlReqInfo->eBand; - rRfChannelInfo.ucChannelNum = prChnlReqInfo->ucReqChnlNum; - - prIEEE80211ChnlStruct = kalP2pFuncGetChannelEntry(prGlueP2pInfo, &rRfChannelInfo); - - - kalP2pFuncGetChannelType(prChnlReqInfo->eChnlSco, - &eChnlType); - - - cfg80211_remain_on_channel_expired(prGlueP2pInfo->prDevHandler, //struct net_device * dev, - prChnlReqInfo->u8Cookie, - prIEEE80211ChnlStruct, - eChnlType, - GFP_KERNEL); - - } while (FALSE); - -} /* kalP2PIndicateChannelExpired */ - -VOID -kalP2PIndicateScanDone ( - IN P_GLUE_INFO_T prGlueInfo, - IN BOOLEAN fgIsAbort - ) -{ - P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T)NULL; - - do { - if (prGlueInfo == NULL) { - - ASSERT(FALSE); - break; - } - - prGlueP2pInfo = prGlueInfo->prP2PInfo; - - if (prGlueP2pInfo == NULL) { - ASSERT(FALSE); - break; - } - - - if (prGlueP2pInfo->prScanRequest) { - cfg80211_scan_done(prGlueP2pInfo->prScanRequest, - fgIsAbort); - - prGlueP2pInfo->prScanRequest = NULL; - } - - } while (FALSE); - - -} /* kalP2PIndicateScanDone */ - -VOID -kalP2PIndicateBssInfo ( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucFrameBuf, - IN UINT_32 u4BufLen, - IN P_RF_CHANNEL_INFO_T prChannelInfo, - IN INT_32 i4SignalStrength - ) -{ - P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T)NULL; - struct ieee80211_channel *prChannelEntry = (struct ieee80211_channel *)NULL; - struct ieee80211_mgmt *prBcnProbeRspFrame = (struct ieee80211_mgmt *)pucFrameBuf; - struct cfg80211_bss *prCfg80211Bss = (struct cfg80211_bss *)NULL; - - do { - if ((prGlueInfo == NULL) || (pucFrameBuf == NULL) || (prChannelInfo == NULL)) { - ASSERT(FALSE); - break; - } - - prGlueP2pInfo = prGlueInfo->prP2PInfo; - - if (prGlueP2pInfo == NULL) { - ASSERT(FALSE); - break; - } - - - prChannelEntry = kalP2pFuncGetChannelEntry(prGlueP2pInfo, prChannelInfo); - - if (prChannelEntry == NULL) { - DBGLOG(P2P, TRACE, ("Unknown channel info\n")); - break; - } - - - //rChannelInfo.center_freq = nicChannelNum2Freq((UINT_32)prChannelInfo->ucChannelNum) / 1000; - - prCfg80211Bss = cfg80211_inform_bss_frame(prGlueP2pInfo->wdev.wiphy, //struct wiphy * wiphy, - prChannelEntry, - prBcnProbeRspFrame, - u4BufLen, - i4SignalStrength, - GFP_KERNEL); - - - /* Return this structure. */ - cfg80211_put_bss(prCfg80211Bss); - - } while (FALSE); - - return; - -} /* kalP2PIndicateBssInfo */ - -VOID -kalP2PIndicateMgmtTxStatus ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_64 u8Cookie, - IN BOOLEAN fgIsAck, - IN PUINT_8 pucFrameBuf, - IN UINT_32 u4FrameLen - ) -{ - P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T)NULL; - - do { - if ((prGlueInfo == NULL) || - (pucFrameBuf == NULL) || - (u4FrameLen == 0)) { - DBGLOG(P2P, TRACE, ("Unexpected pointer PARAM. 0x%lx, 0x%lx, %ld.", prGlueInfo, pucFrameBuf, u4FrameLen)); - ASSERT(FALSE); - break; - } - - prGlueP2pInfo = prGlueInfo->prP2PInfo; - - cfg80211_mgmt_tx_status(prGlueP2pInfo->prDevHandler, //struct net_device * dev, - u8Cookie, - pucFrameBuf, - u4FrameLen, - fgIsAck, - GFP_KERNEL); - - } while (FALSE); - -} /* kalP2PIndicateMgmtTxStatus */ - -VOID -kalP2PIndicateRxMgmtFrame ( - IN P_GLUE_INFO_T prGlueInfo, - IN P_SW_RFB_T prSwRfb - ) -{ -#define DBG_P2P_MGMT_FRAME_INDICATION 0 - P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T)NULL; - INT_32 i4Freq = 0; - UINT_8 ucChnlNum = 0; -#if DBG_P2P_MGMT_FRAME_INDICATION - P_WLAN_MAC_HEADER_T prWlanHeader = (P_WLAN_MAC_HEADER_T)NULL; -#endif - - - do { - if ((prGlueInfo == NULL) || (prSwRfb == NULL)) { - ASSERT(FALSE); - break; - } - - prGlueP2pInfo = prGlueInfo->prP2PInfo; - - ucChnlNum = prSwRfb->prHifRxHdr->ucHwChannelNum; - -#if DBG_P2P_MGMT_FRAME_INDICATION - - prWlanHeader = (P_WLAN_MAC_HEADER_T)prSwRfb->pvHeader; - - switch (prWlanHeader->u2FrameCtrl) { - case MAC_FRAME_PROBE_REQ: - DBGLOG(P2P, TRACE, ("RX Probe Req at channel %d ", ucChnlNum)); - break; - case MAC_FRAME_PROBE_RSP: - DBGLOG(P2P, TRACE, ("RX Probe Rsp at channel %d ", ucChnlNum)); - break; - case MAC_FRAME_ACTION: - DBGLOG(P2P, TRACE, ("RX Action frame at channel %d ", ucChnlNum)); - break; - default: - DBGLOG(P2P, TRACE, ("RX Packet:%d at channel %d ", prWlanHeader->u2FrameCtrl, ucChnlNum)); - break; - } - - DBGLOG(P2P, TRACE, ("from: "MACSTR"\n", MAC2STR(prWlanHeader->aucAddr2))); -#endif - i4Freq = nicChannelNum2Freq(ucChnlNum) / 1000; - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) - cfg80211_rx_mgmt(prGlueP2pInfo->prDevHandler, //struct net_device * dev, - i4Freq, - RCPI_TO_dBm(prSwRfb->prHifRxHdr->ucRcpi), - prSwRfb->pvHeader, - prSwRfb->u2PacketLen, - GFP_ATOMIC); -#else - cfg80211_rx_mgmt(prGlueP2pInfo->prDevHandler, //struct net_device * dev, - i4Freq, - prSwRfb->pvHeader, - prSwRfb->u2PacketLen, - GFP_ATOMIC); -#endif - - } while (FALSE); - -} /* kalP2PIndicateRxMgmtFrame */ - -VOID -kalP2PGCIndicateConnectionStatus ( - IN P_GLUE_INFO_T prGlueInfo, - IN P_P2P_CONNECTION_REQ_INFO_T prP2pConnInfo, - IN PUINT_8 pucRxIEBuf, - IN UINT_16 u2RxIELen, - IN UINT_16 u2StatusReason - ) -{ - P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T)NULL; - - do { - if (prGlueInfo == NULL) { - ASSERT(FALSE); - break; - } - - - prGlueP2pInfo = prGlueInfo->prP2PInfo; - - if (prP2pConnInfo) { - cfg80211_connect_result(prGlueP2pInfo->prDevHandler, //struct net_device * dev, - prP2pConnInfo->aucBssid, - prP2pConnInfo->aucIEBuf, - prP2pConnInfo->u4BufLength, - pucRxIEBuf, - u2RxIELen, - u2StatusReason, - GFP_KERNEL); //gfp_t gfp /* allocation flags */ - prP2pConnInfo->fgIsConnRequest = FALSE; - } - else { - /* Disconnect, what if u2StatusReason == 0? */ - cfg80211_disconnected(prGlueP2pInfo->prDevHandler, //struct net_device * dev, - u2StatusReason, - pucRxIEBuf, - u2RxIELen, - GFP_KERNEL); - } - - - - } while (FALSE); - - -} /* kalP2PGCIndicateConnectionStatus */ - - -VOID -kalP2PGOStationUpdate ( - IN P_GLUE_INFO_T prGlueInfo, - IN P_STA_RECORD_T prCliStaRec, - IN BOOLEAN fgIsNew - ) -{ - P_GL_P2P_INFO_T prP2pGlueInfo = (P_GL_P2P_INFO_T)NULL; - struct station_info rStationInfo; - - do { - if ((prGlueInfo == NULL) || (prCliStaRec == NULL)) { - break; - } - - - prP2pGlueInfo = prGlueInfo->prP2PInfo; - - if (fgIsNew) { - rStationInfo.filled = STATION_INFO_ASSOC_REQ_IES; - rStationInfo.generation = ++prP2pGlueInfo->i4Generation; - - rStationInfo.assoc_req_ies = prCliStaRec->pucAssocReqIe; - rStationInfo.assoc_req_ies_len = prCliStaRec->u2AssocReqIeLen; -// rStationInfo.filled |= STATION_INFO_ASSOC_REQ_IES; - - cfg80211_new_sta(prGlueInfo->prP2PInfo->prDevHandler, //struct net_device * dev, - prCliStaRec->aucMacAddr, - &rStationInfo, - GFP_KERNEL); - } - else { - ++prP2pGlueInfo->i4Generation; - - cfg80211_del_sta(prGlueInfo->prP2PInfo->prDevHandler, //struct net_device * dev, - prCliStaRec->aucMacAddr, - GFP_KERNEL); - } - - - } while (FALSE); - - return; - -} /* kalP2PGOStationUpdate */ - - - - -BOOLEAN -kalP2pFuncGetChannelType( - IN ENUM_CHNL_EXT_T rChnlSco, - OUT enum nl80211_channel_type *channel_type - ) -{ - BOOLEAN fgIsValid = FALSE; - - do { - if (channel_type) { - - switch (rChnlSco) { - case CHNL_EXT_SCN: - *channel_type = NL80211_CHAN_NO_HT; - break; - case CHNL_EXT_SCA: - *channel_type = NL80211_CHAN_HT40MINUS; - break; - case CHNL_EXT_SCB: - *channel_type = NL80211_CHAN_HT40PLUS; - break; - default: - ASSERT(FALSE); - *channel_type = NL80211_CHAN_NO_HT; - break; - } - - } - - fgIsValid = TRUE; - } while (FALSE); - - return fgIsValid; -} /* kalP2pFuncGetChannelType */ - - - - -struct ieee80211_channel * -kalP2pFuncGetChannelEntry ( - IN P_GL_P2P_INFO_T prP2pInfo, - IN P_RF_CHANNEL_INFO_T prChannelInfo - ) -{ - struct ieee80211_channel *prTargetChannelEntry = (struct ieee80211_channel *)NULL; - UINT_32 u4TblSize = 0, u4Idx = 0; - - do { - if ((prP2pInfo == NULL) || (prChannelInfo == NULL)) { - break; - } - - - switch (prChannelInfo->eBand) { - case BAND_2G4: - prTargetChannelEntry = prP2pInfo->wdev.wiphy->bands[IEEE80211_BAND_2GHZ]->channels; - u4TblSize = prP2pInfo->wdev.wiphy->bands[IEEE80211_BAND_2GHZ]->n_channels; - break; - case BAND_5G: - prTargetChannelEntry = prP2pInfo->wdev.wiphy->bands[IEEE80211_BAND_5GHZ]->channels; - u4TblSize = prP2pInfo->wdev.wiphy->bands[IEEE80211_BAND_5GHZ]->n_channels; - break; - default: - break; - } - - - if (prTargetChannelEntry == NULL) { - break; - } - - - - for (u4Idx = 0; u4Idx < u4TblSize; u4Idx++, prTargetChannelEntry++) { - if (prTargetChannelEntry->hw_value == prChannelInfo->ucChannelNum) { - break; - } - - } - - - if (u4Idx == u4TblSize) { - prTargetChannelEntry = NULL; - break; - } - - - } while (FALSE); - - return prTargetChannelEntry; -} /* kalP2pFuncGetChannelEntry */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to set the block list of Hotspot -* -* \param[in] -* prGlueInfo -* -* \return -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalP2PSetBlackList ( - IN P_GLUE_INFO_T prGlueInfo, - IN PARAM_MAC_ADDRESS rbssid, - IN BOOLEAN fgIsblock - ) -{ - UINT_8 aucNullAddr[] = NULL_MAC_ADDR; - BOOLEAN fgIsValid = FALSE; - UINT_32 i; - - ASSERT(prGlueInfo); - ASSERT(prGlueInfo->prP2PInfo); - - if(fgIsblock) { - for(i = 0; i < 8; i++) { - if(UNEQUAL_MAC_ADDR(rbssid, aucNullAddr)) { - if(UNEQUAL_MAC_ADDR(&(prGlueInfo->prP2PInfo->aucblackMACList[i]), rbssid)) { - if(EQUAL_MAC_ADDR (&(prGlueInfo->prP2PInfo->aucblackMACList[i]), aucNullAddr)) { - COPY_MAC_ADDR(&(prGlueInfo->prP2PInfo->aucblackMACList[i]), rbssid); - fgIsValid = FALSE; - return fgIsValid; - } - } - } - } - } - else { - for(i = 0; i < 8; i++) { - if(EQUAL_MAC_ADDR(&(prGlueInfo->prP2PInfo->aucblackMACList[i]), rbssid)) { - COPY_MAC_ADDR(&(prGlueInfo->prP2PInfo->aucblackMACList[i]), aucNullAddr); - fgIsValid = FALSE; - return fgIsValid; - } - } - } - - return fgIsValid; - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to compare the black list of Hotspot -* -* \param[in] -* prGlueInfo -* -* \return -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalP2PCmpBlackList ( - IN P_GLUE_INFO_T prGlueInfo, - IN PARAM_MAC_ADDRESS rbssid - ) -{ - UINT_8 aucNullAddr[] = NULL_MAC_ADDR; - BOOLEAN fgIsExsit = FALSE; - UINT_32 i; - - ASSERT(prGlueInfo); - ASSERT(prGlueInfo->prP2PInfo); - - for(i = 0; i < 8; i++) { - if(UNEQUAL_MAC_ADDR(rbssid, aucNullAddr)){ - if(EQUAL_MAC_ADDR(&(prGlueInfo->prP2PInfo->aucblackMACList[i]), rbssid)) { - fgIsExsit = TRUE; - return fgIsExsit; - } - } - } - - return fgIsExsit; - -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to return the max clients of Hotspot -* -* \param[in] -* prGlueInfo -* -* \return -*/ -/*----------------------------------------------------------------------------*/ -VOID -kalP2PSetMaxClients ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4MaxClient - ) -{ - ASSERT(prGlueInfo); - ASSERT(prGlueInfo->prP2PInfo); - - if(u4MaxClient == 0 || prGlueInfo->prP2PInfo->ucMaxClients >= P2P_MAXIMUM_CLIENT_COUNT) - prGlueInfo->prP2PInfo->ucMaxClients = P2P_MAXIMUM_CLIENT_COUNT; - else - prGlueInfo->prP2PInfo->ucMaxClients = u4MaxClient; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief to return the max clients of Hotspot -* -* \param[in] -* prGlueInfo -* -* \return -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalP2PMaxClients ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4NumClient - ) -{ - ASSERT(prGlueInfo); - ASSERT(prGlueInfo->prP2PInfo); - - if(prGlueInfo->prP2PInfo->ucMaxClients) { - if((UINT_8)u4NumClient >= prGlueInfo->prP2PInfo->ucMaxClients) - return TRUE; - else - return FALSE; - } - - return FALSE; -} - - diff --git a/drivers/net/wireless/mt5931/os/linux/gl_proc.c b/drivers/net/wireless/mt5931/os/linux/gl_proc.c deleted file mode 100755 index 3e53176c8991..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/gl_proc.c +++ /dev/null @@ -1,811 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/gl_proc.c#1 $ -*/ - -/*! \file "gl_proc.c" - \brief This file defines the interface which can interact with users in /proc fs. - - Detail description. -*/ - - - -/* -** $Log: gl_proc.c $ - * - * 11 10 2011 cp.wu - * [WCXRP00001098] [MT6620 Wi-Fi][Driver] Replace printk by DBG LOG macros in linux porting layer - * 1. eliminaite direct calls to printk in porting layer. - * 2. replaced by DBGLOG, which would be XLOG on ALPS platforms. - * - * 12 10 2010 kevin.huang - * [WCXRP00000128] [MT6620 Wi-Fi][Driver] Add proc support to Android Driver for debug and driver status check - * Add Linux Proc Support -** \main\maintrunk.MT5921\19 2008-09-02 21:08:37 GMT mtk01461 -** Fix the compile error of SPRINTF() -** \main\maintrunk.MT5921\18 2008-08-10 18:48:28 GMT mtk01461 -** Update for Driver Review -** \main\maintrunk.MT5921\17 2008-08-04 16:52:01 GMT mtk01461 -** Add proc dbg print message of DOMAIN_INDEX level -** \main\maintrunk.MT5921\16 2008-07-10 00:45:16 GMT mtk01461 -** Remove the check of MCR offset, we may use the MCR address which is not align to DW boundary or proprietary usage. -** \main\maintrunk.MT5921\15 2008-06-03 20:49:44 GMT mtk01461 -** \main\maintrunk.MT5921\14 2008-06-02 22:56:00 GMT mtk01461 -** Rename some functions for linux proc -** \main\maintrunk.MT5921\13 2008-06-02 20:23:18 GMT mtk01461 -** Revise PROC mcr read / write for supporting TELNET -** \main\maintrunk.MT5921\12 2008-03-28 10:40:25 GMT mtk01461 -** Remove temporary set desired rate in linux proc -** \main\maintrunk.MT5921\11 2008-01-07 15:07:29 GMT mtk01461 -** Add User Update Desired Rate Set for QA in Linux -** \main\maintrunk.MT5921\10 2007-12-11 00:11:14 GMT mtk01461 -** Fix SPIN_LOCK protection -** \main\maintrunk.MT5921\9 2007-12-04 18:07:57 GMT mtk01461 -** Add additional debug category to proc -** \main\maintrunk.MT5921\8 2007-11-02 01:03:23 GMT mtk01461 -** Unify TX Path for Normal and IBSS Power Save + IBSS neighbor learning -** \main\maintrunk.MT5921\7 2007-10-25 18:08:14 GMT mtk01461 -** Add VOIP SCAN Support & Refine Roaming -** Revision 1.3 2007/07/05 07:25:33 MTK01461 -** Add Linux initial code, modify doc, add 11BB, RF init code -** -** Revision 1.2 2007/06/27 02:18:51 MTK01461 -** Update SCAN_FSM, Initial(Can Load Module), Proc(Can do Reg R/W), TX API -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "gl_os.h" -#include "gl_kal.h" - -#include "wlan_lib.h" -#include "debug.h" - - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define PROC_MCR_ACCESS "mcr" -#define PROC_DRV_STATUS "status" -#define PROC_RX_STATISTICS "rx_statistics" -#define PROC_TX_STATISTICS "tx_statistics" -#define PROC_DBG_LEVEL "dbg_level" - -#define PROC_MCR_ACCESS_MAX_USER_INPUT_LEN 20 -#define PROC_RX_STATISTICS_MAX_USER_INPUT_LEN 10 -#define PROC_TX_STATISTICS_MAX_USER_INPUT_LEN 10 -#define PROC_DBG_LEVEL_MAX_USER_INPUT_LEN 20 -#define PROC_DBG_LEVEL_MAX_DISPLAY_STR_LEN 30 - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ -static UINT_32 u4McrOffset = 0; - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/*! -* \brief The PROC function for reading MCR register to User Space, the offset of -* the MCR is specified in u4McrOffset. -* -* \param[in] page Buffer provided by kernel. -* \param[in out] start Start Address to read(3 methods). -* \param[in] off Offset. -* \param[in] count Allowable number to read. -* \param[out] eof End of File indication. -* \param[in] data Pointer to the private data structure. -* -* \return number of characters print to the buffer from User Space. -*/ -/*----------------------------------------------------------------------------*/ -static int -procMCRRead ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *data - ) -{ - P_GLUE_INFO_T prGlueInfo; - PARAM_CUSTOM_MCR_RW_STRUC_T rMcrInfo; - UINT_32 u4BufLen; - char *p = page; - UINT_32 u4Count; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - - - ASSERT(data); - - // Kevin: Apply PROC read method 1. - if (off != 0) { - return 0; // To indicate end of file. - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv((struct net_device *)data)); - - rMcrInfo.u4McrOffset = u4McrOffset; - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryMcrRead, - (PVOID)&rMcrInfo, - sizeof(rMcrInfo), - TRUE, - TRUE, - TRUE, - FALSE, - &u4BufLen); - - - SPRINTF(p, ("MCR (0x%08lxh): 0x%08lx\n", - rMcrInfo.u4McrOffset, rMcrInfo.u4McrData)); - - u4Count = (UINT_32)(p - page); - - *eof = 1; - - return (int)u4Count; - -} /* end of procMCRRead() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief The PROC function for writing MCR register to HW or update u4McrOffset -* for reading MCR later. -* -* \param[in] file pointer to file. -* \param[in] buffer Buffer from user space. -* \param[in] count Number of characters to write -* \param[in] data Pointer to the private data structure. -* -* \return number of characters write from User Space. -*/ -/*----------------------------------------------------------------------------*/ -static int -procMCRWrite ( - struct file *file, - const char *buffer, - unsigned long count, - void *data - ) -{ - P_GLUE_INFO_T prGlueInfo; - char acBuf[PROC_MCR_ACCESS_MAX_USER_INPUT_LEN + 1]; // + 1 for "\0" - int i4CopySize; - PARAM_CUSTOM_MCR_RW_STRUC_T rMcrInfo; - UINT_32 u4BufLen; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - - - ASSERT(data); - - i4CopySize = (count < (sizeof(acBuf) - 1)) ? count : (sizeof(acBuf) - 1); - if (copy_from_user(acBuf, buffer, i4CopySize)) { - return 0; - } - acBuf[i4CopySize] = '\0'; - - switch (sscanf(acBuf, "0x%lx 0x%lx", - &rMcrInfo.u4McrOffset, &rMcrInfo.u4McrData)) { - case 2: - /* NOTE: Sometimes we want to test if bus will still be ok, after accessing - * the MCR which is not align to DW boundary. - */ - //if (IS_ALIGN_4(rMcrInfo.u4McrOffset)) - { - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv((struct net_device *)data)); - - u4McrOffset = rMcrInfo.u4McrOffset; - - //printk("Write 0x%lx to MCR 0x%04lx\n", - //rMcrInfo.u4McrOffset, rMcrInfo.u4McrData); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetMcrWrite, - (PVOID)&rMcrInfo, - sizeof(rMcrInfo), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - } - break; - - case 1: - //if (IS_ALIGN_4(rMcrInfo.u4McrOffset)) - { - u4McrOffset = rMcrInfo.u4McrOffset; - } - break; - - default: - break; - } - - return count; - -} /* end of procMCRWrite() */ - -#if 0 -/*----------------------------------------------------------------------------*/ -/*! -* \brief The PROC function for reading Driver Status to User Space. -* -* \param[in] page Buffer provided by kernel. -* \param[in out] start Start Address to read(3 methods). -* \param[in] off Offset. -* \param[in] count Allowable number to read. -* \param[out] eof End of File indication. -* \param[in] data Pointer to the private data structure. -* -* \return number of characters print to the buffer from User Space. -*/ -/*----------------------------------------------------------------------------*/ -static int -procDrvStatusRead ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *data - ) -{ - P_GLUE_INFO_T prGlueInfo = ((struct net_device *)data)->priv; - char *p = page; - UINT_32 u4Count; - - GLUE_SPIN_LOCK_DECLARATION(); - - - ASSERT(data); - - // Kevin: Apply PROC read method 1. - if (off != 0) { - return 0; // To indicate end of file. - } - - - SPRINTF(p, ("GLUE LAYER STATUS:")); - SPRINTF(p, ("\n==================")); - - SPRINTF(p, ("\n* Number of Pending Frames: %ld\n", - prGlueInfo->u4TxPendingFrameNum)); - - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_FSM); - - wlanoidQueryDrvStatusForLinuxProc(prGlueInfo->prAdapter, p, &u4Count); - - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_FSM); - - u4Count += (UINT_32)(p - page); - - *eof = 1; - - return (int)u4Count; - -} /* end of procDrvStatusRead() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief The PROC function for reading Driver RX Statistic Counters to User Space. -* -* \param[in] page Buffer provided by kernel. -* \param[in out] start Start Address to read(3 methods). -* \param[in] off Offset. -* \param[in] count Allowable number to read. -* \param[out] eof End of File indication. -* \param[in] data Pointer to the private data structure. -* -* \return number of characters print to the buffer from User Space. -*/ -/*----------------------------------------------------------------------------*/ -static int -procRxStatisticsRead ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *data - ) -{ - P_GLUE_INFO_T prGlueInfo = ((struct net_device *)data)->priv; - char *p = page; - UINT_32 u4Count; - - GLUE_SPIN_LOCK_DECLARATION(); - - - ASSERT(data); - - // Kevin: Apply PROC read method 1. - if (off != 0) { - return 0; // To indicate end of file. - } - - - SPRINTF(p, ("RX STATISTICS (Write 1 to clear):")); - SPRINTF(p, ("\n=================================\n")); - - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_FSM); - - wlanoidQueryRxStatisticsForLinuxProc(prGlueInfo->prAdapter, p, &u4Count); - - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_FSM); - - u4Count += (UINT_32)(p - page); - - *eof = 1; - - return (int)u4Count; - -} /* end of procRxStatisticsRead() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief The PROC function for reset Driver RX Statistic Counters. -* -* \param[in] file pointer to file. -* \param[in] buffer Buffer from user space. -* \param[in] count Number of characters to write -* \param[in] data Pointer to the private data structure. -* -* \return number of characters write from User Space. -*/ -/*----------------------------------------------------------------------------*/ -static int -procRxStatisticsWrite ( - struct file *file, - const char *buffer, - unsigned long count, - void *data - ) -{ - P_GLUE_INFO_T prGlueInfo = ((struct net_device *)data)->priv; - char acBuf[PROC_RX_STATISTICS_MAX_USER_INPUT_LEN + 1]; // + 1 for "\0" - UINT_32 u4CopySize; - UINT_32 u4ClearCounter; - - GLUE_SPIN_LOCK_DECLARATION(); - - - ASSERT(data); - - u4CopySize = (count < (sizeof(acBuf) - 1)) ? count : (sizeof(acBuf) - 1); - copy_from_user(acBuf, buffer, u4CopySize); - acBuf[u4CopySize] = '\0'; - - if (sscanf(acBuf, "%ld", &u4ClearCounter) == 1) { - if (u4ClearCounter == 1) { - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_FSM); - - wlanoidSetRxStatisticsForLinuxProc(prGlueInfo->prAdapter); - - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_FSM); - } - } - - return count; - -} /* end of procRxStatisticsWrite() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief The PROC function for reading Driver TX Statistic Counters to User Space. -* -* \param[in] page Buffer provided by kernel. -* \param[in out] start Start Address to read(3 methods). -* \param[in] off Offset. -* \param[in] count Allowable number to read. -* \param[out] eof End of File indication. -* \param[in] data Pointer to the private data structure. -* -* \return number of characters print to the buffer from User Space. -*/ -/*----------------------------------------------------------------------------*/ -static int -procTxStatisticsRead ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *data - ) -{ - P_GLUE_INFO_T prGlueInfo = ((struct net_device *)data)->priv; - char *p = page; - UINT_32 u4Count; - - GLUE_SPIN_LOCK_DECLARATION(); - - - ASSERT(data); - - // Kevin: Apply PROC read method 1. - if (off != 0) { - return 0; // To indicate end of file. - } - - - SPRINTF(p, ("TX STATISTICS (Write 1 to clear):")); - SPRINTF(p, ("\n=================================\n")); - - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_FSM); - - wlanoidQueryTxStatisticsForLinuxProc(prGlueInfo->prAdapter, p, &u4Count); - - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_FSM); - - u4Count += (UINT_32)(p - page); - - *eof = 1; - - return (int)u4Count; - -} /* end of procTxStatisticsRead() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief The PROC function for reset Driver TX Statistic Counters. -* -* \param[in] file pointer to file. -* \param[in] buffer Buffer from user space. -* \param[in] count Number of characters to write -* \param[in] data Pointer to the private data structure. -* -* \return number of characters write from User Space. -*/ -/*----------------------------------------------------------------------------*/ -static int -procTxStatisticsWrite ( - struct file *file, - const char *buffer, - unsigned long count, - void *data - ) -{ - P_GLUE_INFO_T prGlueInfo = ((struct net_device *)data)->priv; - char acBuf[PROC_RX_STATISTICS_MAX_USER_INPUT_LEN + 1]; // + 1 for "\0" - UINT_32 u4CopySize; - UINT_32 u4ClearCounter; - - GLUE_SPIN_LOCK_DECLARATION(); - - - ASSERT(data); - - u4CopySize = (count < (sizeof(acBuf) - 1)) ? count : (sizeof(acBuf) - 1); - copy_from_user(acBuf, buffer, u4CopySize); - acBuf[u4CopySize] = '\0'; - - if (sscanf(acBuf, "%ld", &u4ClearCounter) == 1) { - if (u4ClearCounter == 1) { - GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_FSM); - - wlanoidSetTxStatisticsForLinuxProc(prGlueInfo->prAdapter); - - GLUE_RELEASE_SPIN_LOCK(prGlueInfo, SPIN_LOCK_FSM); - } - } - - return count; - -} /* end of procTxStatisticsWrite() */ -#endif - - -#if DBG -static UINT_8 aucDbModuleName[][PROC_DBG_LEVEL_MAX_DISPLAY_STR_LEN] = { - "DBG_INIT_IDX", - "DBG_HAL_IDX", - "DBG_INTR_IDX", - "DBG_REQ_IDX", - "DBG_TX_IDX", - "DBG_RX_IDX", - "DBG_RFTEST_IDX", - "DBG_EMU_IDX", - "DBG_SW1_IDX", - "DBG_SW2_IDX", - "DBG_SW3_IDX", - "DBG_SW4_IDX", - "DBG_HEM_IDX", - "DBG_AIS_IDX", - "DBG_RLM_IDX", - "DBG_MEM_IDX", - "DBG_CNM_IDX", - "DBG_RSN_IDX", - "DBG_BSS_IDX", - "DBG_SCN_IDX", - "DBG_SAA_IDX", - "DBG_AAA_IDX", - "DBG_P2P_IDX", - "DBG_QM_IDX", - "DBG_SEC_IDX", - "DBG_BOW_IDX" - }; - -extern UINT_8 aucDebugModule[]; - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief The PROC function for displaying current Debug Level. -* -* \param[in] page Buffer provided by kernel. -* \param[in out] start Start Address to read(3 methods). -* \param[in] off Offset. -* \param[in] count Allowable number to read. -* \param[out] eof End of File indication. -* \param[in] data Pointer to the private data structure. -* -* \return number of characters print to the buffer from User Space. -*/ -/*----------------------------------------------------------------------------*/ -static int -procDbgLevelRead ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *data - ) -{ - char *p = page; - int i; - - - - // Kevin: Apply PROC read method 1. - if (off != 0) { - return 0; // To indicate end of file. - } - - for (i = 0; i < (sizeof(aucDbModuleName)/PROC_DBG_LEVEL_MAX_DISPLAY_STR_LEN); i++) { - SPRINTF(p, ("%c %-15s(0x%02x): %02x\n", - ((i == u4DebugModule) ? '*' : ' '), - &aucDbModuleName[i][0], - i, - aucDebugModule[i])); - } - - *eof = 1; - return (int)(p - page); -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief The PROC function for adjusting Debug Level to turn on/off debugging message. -* -* \param[in] file pointer to file. -* \param[in] buffer Buffer from user space. -* \param[in] count Number of characters to write -* \param[in] data Pointer to the private data structure. -* -* \return number of characters write from User Space. -*/ -/*----------------------------------------------------------------------------*/ -static int -procDbgLevelWrite ( - struct file *file, - const char *buffer, - unsigned long count, - void *data - ) -{ - char acBuf[PROC_DBG_LEVEL_MAX_USER_INPUT_LEN + 1]; // + 1 for "\0" - UINT_32 u4CopySize; - UINT_32 u4NewDbgModule, u4NewDbgLevel; - - - u4CopySize = (count < (sizeof(acBuf) - 1)) ? count : (sizeof(acBuf) - 1); - copy_from_user(acBuf, buffer, u4CopySize); - acBuf[u4CopySize] = '\0'; - - if (sscanf(acBuf, "0x%lx 0x%lx", &u4NewDbgModule, &u4NewDbgLevel) == 2) { - if (u4NewDbgModule < DBG_MODULE_NUM) { - u4DebugModule = u4NewDbgModule; - u4NewDbgLevel &= DBG_CLASS_MASK; - aucDebugModule[u4DebugModule] = (UINT_8)u4NewDbgLevel; - } - } - - return count; -} -#endif /* DBG */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function create a PROC fs in linux /proc/net subdirectory. -* -* \param[in] prDev Pointer to the struct net_device. -* \param[in] pucDevName Pointer to the name of net_device. -* -* \return N/A -*/ -/*----------------------------------------------------------------------------*/ -INT_32 -procInitProcfs ( - struct net_device *prDev, - char *pucDevName - ) -{ - P_GLUE_INFO_T prGlueInfo; - struct proc_dir_entry *prEntry; - - - ASSERT(prDev); - - if (init_net.proc_net == (struct proc_dir_entry *)NULL) { - DBGLOG(INIT, INFO, ("init proc fs fail: proc_net == NULL\n")); - return -ENOENT; - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - - if (!prGlueInfo) { - DBGLOG(INIT, WARN, ("The OS context is NULL\n")); - return -ENOENT; - } - - - /* - /proc/net/wlan0 - |-- mcr (PROC_MCR_ACCESS) - |-- status (PROC_DRV_STATUS) - |-- rx_statistics (PROC_RX_STATISTICS) - |-- tx_statistics (PROC_TX_STATISTICS) - |-- dbg_level (PROC_DBG_LEVEL) - |-- (end) - */ - - /* - * Directory: Root (/proc/net/wlan0) - */ - - prGlueInfo->pProcRoot = proc_mkdir(pucDevName, init_net.proc_net); - if (prGlueInfo->pProcRoot == NULL) { - return -ENOENT; - } - - /* File Root/mcr (RW) */ - prEntry = create_proc_entry(PROC_MCR_ACCESS, 0, prGlueInfo->pProcRoot); - if (prEntry) { - prEntry->read_proc = procMCRRead; - prEntry->write_proc = procMCRWrite; - prEntry->data = (void *)prDev; - } - -#if 0 - /* File Root/status (RW) */ - prEntry = create_proc_read_entry(PROC_DRV_STATUS, 0, prGlueInfo->pProcRoot, - procDrvStatusRead, prDev); - - /* File Root/rx_statistics (RW) */ - prEntry = create_proc_entry(PROC_RX_STATISTICS, 0, prGlueInfo->pProcRoot); - if (prEntry) { - prEntry->read_proc = procRxStatisticsRead; - prEntry->write_proc = procRxStatisticsWrite; - prEntry->data = (void *)prDev; - } - - /* File Root/tx_statistics (RW) */ - prEntry = create_proc_entry(PROC_TX_STATISTICS, 0, prGlueInfo->pProcRoot); - if (prEntry) { - prEntry->read_proc = procTxStatisticsRead; - prEntry->write_proc = procTxStatisticsWrite; - prEntry->data = (void *)prDev; - } - -#if DBG - /* File Root/dbg_level (RW) */ - prEntry = create_proc_entry(PROC_DBG_LEVEL, 0644, prGlueInfo->pProcRoot); - if (prEntry) { - prEntry->read_proc = procDbgLevelRead; - prEntry->write_proc = procDbgLevelWrite; - } -#endif /* DBG */ -#endif - return 0; - -} /* end of procInitProcfs() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function clean up a PROC fs created by procInitProcfs(). -* -* \param[in] prDev Pointer to the struct net_device. -* \param[in] pucDevName Pointer to the name of net_device. -* -* \return N/A -*/ -/*----------------------------------------------------------------------------*/ -INT_32 -procRemoveProcfs ( - struct net_device *prDev, - char *pucDevName - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - - ASSERT(prDev); - - if (!prDev) { - return -ENOENT; - } - - if (init_net.proc_net == (struct proc_dir_entry *)NULL) { - DBGLOG(INIT, WARN, ("remove proc fs fail: proc_net == NULL\n")); - return -ENOENT; - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - if (!prGlueInfo->pProcRoot) { - DBGLOG(INIT, WARN, ("The procfs root is NULL\n")); - return -ENOENT; - } -#if 0 -#if DBG - remove_proc_entry(PROC_DBG_LEVEL, prGlueInfo->pProcRoot); -#endif /* DBG */ - remove_proc_entry(PROC_TX_STATISTICS, prGlueInfo->pProcRoot); - remove_proc_entry(PROC_RX_STATISTICS, prGlueInfo->pProcRoot); - remove_proc_entry(PROC_DRV_STATUS, prGlueInfo->pProcRoot); -#endif - remove_proc_entry(PROC_MCR_ACCESS, prGlueInfo->pProcRoot); - - /* remove root directory (proc/net/wlan0) */ - remove_proc_entry(pucDevName, init_net.proc_net); - - return 0; - -} /* end of procRemoveProcfs() */ - diff --git a/drivers/net/wireless/mt5931/os/linux/gl_rst.c b/drivers/net/wireless/mt5931/os/linux/gl_rst.c deleted file mode 100755 index 80d6e6ba205c..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/gl_rst.c +++ /dev/null @@ -1,473 +0,0 @@ -/* -** $Id: @(#) gl_rst.c@@ -*/ - -/*! \file gl_rst.c - \brief Main routines for supporintg MT6620 whole-chip reset mechanism - - This file contains the support routines of Linux driver for MediaTek Inc. 802.11 - Wireless LAN Adapters. -*/ - - - -/* -** $Log: gl_rst.c $ - * - * 11 10 2011 cp.wu - * [WCXRP00001098] [MT6620 Wi-Fi][Driver] Replace printk by DBG LOG macros in linux porting layer - * 1. eliminaite direct calls to printk in porting layer. - * 2. replaced by DBGLOG, which would be XLOG on ALPS platforms. - * - * 04 22 2011 cp.wu - * [WCXRP00000598] [MT6620 Wi-Fi][Driver] Implementation of interface for communicating with user space process for RESET_START and RESET_END events - * skip power-off handshaking when RESET indication is received. - * - * 04 14 2011 cp.wu - * [WCXRP00000598] [MT6620 Wi-Fi][Driver] Implementation of interface for communicating with user space process for RESET_START and RESET_END events - * 1. add code to put whole-chip resetting trigger when abnormal firmware assertion is detected - * 2. add dummy function for both Win32 and Linux part. - * - * 03 30 2011 cp.wu - * [WCXRP00000598] [MT6620 Wi-Fi][Driver] Implementation of interface for communicating with user space process for RESET_START and RESET_END events - * use netlink unicast instead of broadcast - * -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "gl_os.h" -#include "debug.h" -#include "wlan_lib.h" -#include "gl_wext.h" -#include "precomp.h" -#include -#include -#include - -#if CFG_CHIP_RESET_SUPPORT - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define MAX_BIND_PROCESS (4) - -#define MTK_WIFI_FAMILY_NAME "MTK_WIFI" -#define MTK_WIFI_RESET_START_NAME "RESET_START" -#define MTK_WIFI_RESET_END_NAME "RESET_END" -#define MTK_WIFI_RESET_TEST_NAME "GENETLINK_START" - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -enum { - __MTK_WIFI_ATTR_INVALID, - MTK_WIFI_ATTR_MSG, - __MTK_WIFI_ATTR_MAX, -}; -#define MTK_WIFI_ATTR_MAX (__MTK_WIFI_ATTR_MAX - 1) - - -enum { - __MTK_WIFI_COMMAND_INVALID, - MTK_WIFI_COMMAND_BIND, - MTK_WIFI_COMMAND_RESET, - __MTK_WIFI_COMMAND_MAX, -}; -#define MTK_WIFI_COMMAND_MAX (__MTK_WIFI_COMMAND_MAX - 1) - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ -static UINT_32 mtk_wifi_seqnum = 0; -static int num_bind_process = 0; -static pid_t bind_pid[MAX_BIND_PROCESS]; -static BOOLEAN fgIsResetting = FALSE; - -/* attribute policy */ -static struct nla_policy mtk_wifi_genl_policy[MTK_WIFI_ATTR_MAX + 1] = { - [MTK_WIFI_ATTR_MSG] = { .type = NLA_NUL_STRING }, -}; - -/* family definition */ -static struct genl_family mtk_wifi_gnl_family = { - .id = GENL_ID_GENERATE, - .hdrsize = 0, - .name = MTK_WIFI_FAMILY_NAME, - .version = 1, - .maxattr = MTK_WIFI_ATTR_MAX, -}; - -/* forward declaration */ -static int mtk_wifi_bind( - struct sk_buff *skb, - struct genl_info *info - ); - -static int mtk_wifi_reset( - struct sk_buff *skb, - struct genl_info *info - ); - -/* operation definition */ -static struct genl_ops mtk_wifi_gnl_ops_bind = { - .cmd = MTK_WIFI_COMMAND_BIND, - .flags = 0, - .policy = mtk_wifi_genl_policy, - .doit = mtk_wifi_bind, - .dumpit = NULL, -}; - -static struct genl_ops mtk_wifi_gnl_ops_reset = { - .cmd = MTK_WIFI_COMMAND_RESET, - .flags = 0, - .policy = mtk_wifi_genl_policy, - .doit = mtk_wifi_reset, - .dumpit = NULL, -}; - - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -extern int -mtk_wcn_wmt_msgcb_reg( - ENUM_WMTDRV_TYPE_T eType, - PF_WMT_CB pCb); - -extern int -mtk_wcn_wmt_msgcb_unreg( - ENUM_WMTDRV_TYPE_T eType - ); - -static void * -glResetCallback ( - ENUM_WMTDRV_TYPE_T eSrcType, - ENUM_WMTDRV_TYPE_T eDstType, - ENUM_WMTMSG_TYPE_T eMsgType, - void * prMsgBody, - unsigned int u4MsgLength - ); - -static BOOLEAN -glResetSendMessage ( - char *aucMsg, - u8 cmd - ); - - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for - * 1. registering for reset callbacks - * 2. initialize netlink socket - * - * @param none - * - * @retval none - */ -/*----------------------------------------------------------------------------*/ -VOID -glResetInit( - VOID - ) -{ - /* 1. register for reset callback */ - mtk_wcn_wmt_msgcb_reg(WMTDRV_TYPE_WIFI, (PF_WMT_CB)glResetCallback); - - /* 2.1 registration for NETLINK_GENERIC family */ - if(genl_register_family(&mtk_wifi_gnl_family) != 0) { - DBGLOG(INIT, WARN, ("%s(): GE_NELINK family registration fail\n", __func__)); - } - else { - /* 2.2 operation registration */ - if(genl_register_ops(&mtk_wifi_gnl_family, &mtk_wifi_gnl_ops_bind) != 0) { - DBGLOG(INIT, WARN, ("%s(): BIND operation registration fail\n", __func__)); - } - - if(genl_register_ops(&mtk_wifi_gnl_family, &mtk_wifi_gnl_ops_reset) != 0) { - DBGLOG(INIT, WARN, ("%s(): RESET operation registration fail\n", __func__)); - } - } - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is responsible for - * 1. uninitialize netlink socket - * 2. deregistering for reset callbacks - * - * @param none - * - * @retval none - */ -/*----------------------------------------------------------------------------*/ -VOID -glResetUninit( - VOID - ) -{ - /* 1. release NETLINK_GENERIC family */ - genl_unregister_family(&mtk_wifi_gnl_family); - - /* 2. deregister for reset callback */ - mtk_wcn_wmt_msgcb_unreg(WMTDRV_TYPE_WIFI); - - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is invoked when there is reset messages indicated - * - * @param eSrcType - * eDstType - * eMsgType - * prMsgBody - * u4MsgLength - * - * @retval - */ -/*----------------------------------------------------------------------------*/ -static void * -glResetCallback ( - ENUM_WMTDRV_TYPE_T eSrcType, - ENUM_WMTDRV_TYPE_T eDstType, - ENUM_WMTMSG_TYPE_T eMsgType, - void * prMsgBody, - unsigned int u4MsgLength - ) -{ - switch(eMsgType) { - case WMTMSG_TYPE_RESET: - if(u4MsgLength == sizeof(ENUM_WMTRSTMSG_TYPE_T)) { - P_ENUM_WMTRSTMSG_TYPE_T prRstMsg = (P_ENUM_WMTRSTMSG_TYPE_T) prMsgBody; - - switch(*prRstMsg) { - case WMTRSTMSG_RESET_START: - fgIsResetting = TRUE; - glResetSendMessage(MTK_WIFI_RESET_START_NAME, MTK_WIFI_COMMAND_RESET); - break; - - case WMTRSTMSG_RESET_END: - glResetSendMessage(MTK_WIFI_RESET_END_NAME, MTK_WIFI_COMMAND_RESET); - fgIsResetting = FALSE; - break; - - default: - break; - } - } - - break; - - default: - break; - } - - return NULL; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine send out message via netlink socket - * - * @param aucMsg - * u4MsgLength - * - * @retval TRUE - * FALSE - */ -/*----------------------------------------------------------------------------*/ -static BOOLEAN -glResetSendMessage( - char * aucMsg, - u8 cmd - ) -{ - struct sk_buff *skb = NULL; - void *msg_head = NULL; - int rc = -1; - int i; - - if(num_bind_process == 0) { - /* no listening process */ - return FALSE; - } - - for(i = 0 ; i < num_bind_process ; i++) { - skb = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); - - if(skb) { - msg_head = genlmsg_put(skb, 0, mtk_wifi_seqnum++, &mtk_wifi_gnl_family, 0, cmd); - - if(msg_head == NULL) { - nlmsg_free(skb); - return FALSE; - } - - rc = nla_put_string(skb, MTK_WIFI_ATTR_MSG, aucMsg); - if(rc != 0) { - nlmsg_free(skb); - return FALSE; - } - - /* finalize the message */ - genlmsg_end(skb, msg_head); - - /* sending message */ - rc = genlmsg_unicast(&init_net, skb, bind_pid[i]); - if(rc != 0) { - return FALSE; - } - } - else { - return FALSE; - } - } - - return TRUE; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is called to identify PID for process binding - * - * @param skb - * info - * - * @retval 0 - * nonzero - */ -/*----------------------------------------------------------------------------*/ -int mtk_wifi_bind( - struct sk_buff *skb, - struct genl_info *info - ) -{ - struct nlattr *na; - char * mydata; - - if (info == NULL) { - goto out; - } - - /*for each attribute there is an index in info->attrs which points to a nlattr structure - *in this structure the data is given - */ - - na = info->attrs[MTK_WIFI_ATTR_MSG]; - if (na) { - mydata = (char *)nla_data(na); - - /* no need to parse mydata */ - } - - /* collect PID */ - if(num_bind_process < MAX_BIND_PROCESS) { - bind_pid[num_bind_process] = info->snd_pid; - num_bind_process++; - } - else { - DBGLOG(INIT, WARN, ("%s(): exceeding binding limit %d\n", __func__, MAX_BIND_PROCESS)); - } - -out: - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is called for reset, shout not happen - * - * @param skb - * info - * - * @retval 0 - * nonzero - */ -/*----------------------------------------------------------------------------*/ -int mtk_wifi_reset( - struct sk_buff *skb, - struct genl_info *info - ) -{ - DBGLOG(INIT, WARN, ("%s(): should not be invoked\n", __func__)); - - return 0; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is called for generating reset request to WMT - * - * @param None - * - * @retval None - */ -/*----------------------------------------------------------------------------*/ -VOID -glSendResetRequest( - VOID - ) -{ - // WMT thread would trigger whole chip resetting itself - return; -} - - -/*----------------------------------------------------------------------------*/ -/*! - * @brief This routine is called for checking if MT6620 is resetting - * - * @param None - * - * @retval TRUE - * FALSE - */ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalIsResetting( - VOID - ) -{ - return fgIsResetting; -} - - -#endif // CFG_CHIP_RESET_SUPPORT diff --git a/drivers/net/wireless/mt5931/os/linux/gl_wext.c b/drivers/net/wireless/mt5931/os/linux/gl_wext.c deleted file mode 100755 index 17e3460a6a48..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/gl_wext.c +++ /dev/null @@ -1,4527 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/gl_wext.c#3 $ -*/ - -/*! \file gl_wext.c - \brief ioctl() (mostly Linux Wireless Extensions) routines for STA driver. -*/ - - - -/* -** $Log: gl_wext.c $ - * - * 06 13 2012 yuche.tsai - * NULL - * Update maintrunk driver. - * Add support for driver compose assoc request frame. - * - * 01 16 2012 wh.su - * [WCXRP00001170] [MT6620 Wi-Fi][Driver] Adding the related code for set/get band ioctl - * Adding the template code for set / get band IOCTL (with ICS supplicant_6).. - * - * 01 05 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * Adding the related ioctl / wlan oid function to set the Tx power cfg. - * - * 01 02 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * Adding the proto type function for set_int set_tx_power and get int get_ch_list. - * - * 11 10 2011 cp.wu - * [WCXRP00001098] [MT6620 Wi-Fi][Driver] Replace printk by DBG LOG macros in linux porting layer - * 1. eliminaite direct calls to printk in porting layer. - * 2. replaced by DBGLOG, which would be XLOG on ALPS platforms. - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 09 23 2011 tsaiyuan.hsu - * [WCXRP00000979] [MT6620 Wi-Fi][DRV]] stop attempting to connect to config AP after D3 state - * avoid entering D3 state after deep sleep. - * - * 07 28 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings - * Add BWCS cmd and event. - * - * 07 27 2011 wh.su - * [WCXRP00000877] [MT6620 Wi-Fi][Driver] Remove the netif_carry_ok check for avoid the wpa_supplicant fail to query the ap address - * Remove the netif check while query bssid and ssid - * - * 07 26 2011 chinglan.wang - * NULL - * [MT6620][WiFi Driver] Do not include the WSC IE in the association info packet when not do the wps connection.. - * - * 07 18 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add CMD/Event for RDD and BWCS. - * - * 05 17 2011 eddie.chen - * [WCXRP00000603] [MT6620 Wi-Fi][DRV] Fix Klocwork warning - * Initilize the vairlabes. - * - * 05 11 2011 jeffrey.chang - * [WCXRP00000718] [MT6620 Wi-Fi] modify the behavior of setting tx power - * modify set_tx_pow ioctl - * - * 03 29 2011 terry.wu - * [WCXRP00000610] [MT 6620 Wi-Fi][Driver] Fix klocwork waring - * [MT6620 Wi-Fi][Driver] Fix klocwork warning. Add Null pointer check on wext_get_essid. Limit the upper bound of essid storage array. - * - * 03 21 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * improve portability for awareness of early version of linux kernel and wireless extension. - * - * 03 17 2011 chinglan.wang - * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature - * . - * - * 03 07 2011 terry.wu - * [WCXRP00000521] [MT6620 Wi-Fi][Driver] Remove non-standard debug message - * Toggle non-standard debug messages to comments. - * - * 02 21 2011 wh.su - * [WCXRP00000483] [MT6620 Wi-Fi][Driver] Check the kalIoctl return value before doing the memory copy at linux get essid - * fixed the potential error to do a larget memory copy while wlanoid get essid not actually running. - * - * 02 08 2011 george.huang - * [WCXRP00000422] [MT6620 Wi-Fi][Driver] support query power mode OID handler - * Support querying power mode OID. - * - * 01 29 2011 wh.su - * [WCXRP00000408] [MT6620 Wi-Fi][Driver] Not doing memory alloc while ioctl set ie with length 0 - * not doing mem alloc. while set ie length already 0 - * - * 01 20 2011 eddie.chen - * [WCXRP00000374] [MT6620 Wi-Fi][DRV] SW debug control - * Remove debug text. - * - * 01 20 2011 eddie.chen - * [WCXRP00000374] [MT6620 Wi-Fi][DRV] SW debug control - * Adjust OID order. - * - * 01 20 2011 eddie.chen - * [WCXRP00000374] [MT6620 Wi-Fi][DRV] SW debug control - * Add Oid for sw control debug command - * - * 01 11 2011 chinglan.wang - * NULL - * Modify to reslove the CR :[ALPS00028994] Use WEP security to connect Marvell 11N AP. Connection establish successfully. - * Use the WPS function to connect AP, the privacy bit always is set to 1. . - * - * 01 07 2011 cm.chang - * [WCXRP00000336] [MT6620 Wi-Fi][Driver] Add test mode commands in normal phone operation - * Add a new compiling option to control if MCR read/write is permitted - * - * 01 04 2011 cp.wu - * [WCXRP00000338] [MT6620 Wi-Fi][Driver] Separate kalMemAlloc into kmalloc and vmalloc implementations to ease physically continous memory demands - * separate kalMemAlloc() into virtually-continous and physically-continous types - * to ease slab system pressure - * - * 01 04 2011 cp.wu - * [WCXRP00000338] [MT6620 Wi-Fi][Driver] Separate kalMemAlloc into kmalloc and vmalloc implementations to ease physically continous memory demands - * separate kalMemAlloc() into virtually-continous and physically-continous type to ease slab system pressure - * - * 12 31 2010 cm.chang - * [WCXRP00000336] [MT6620 Wi-Fi][Driver] Add test mode commands in normal phone operation - * Add some iwpriv commands to support test mode operation - * - * 12 15 2010 george.huang - * [WCXRP00000152] [MT6620 Wi-Fi] AP mode power saving function - * Support set PS profile and set WMM-PS related iwpriv. - * - * 12 15 2010 george.huang - * [WCXRP00000152] [MT6620 Wi-Fi] AP mode power saving function - * Allow change PS profile function (throught wext_set_power()). - * - * 12 14 2010 jeffrey.chang - * [WCXRP00000262] [MT6620 Wi-Fi][Driver] modify the scan request ioctl to handle hidden SSID - * handle hidden SSID - * - * 12 13 2010 chinglan.wang - * NULL - * Add WPS 1.0 feature flag to enable the WPS 1.0 function. - * - * 12 07 2010 cm.chang - * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant - * Fix compiling error - * - * 12 07 2010 cm.chang - * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant - * 1. Country code is from NVRAM or supplicant - * 2. Change band definition in CMD/EVENT. - * - * 11 30 2010 cp.wu - * [WCXRP00000213] [MT6620 Wi-Fi][Driver] Implement scanning with specified SSID for wpa_supplicant with ap_scan=1 - * . - * - * 11 08 2010 wh.su - * [WCXRP00000171] [MT6620 Wi-Fi][Driver] Add message check code same behavior as mt5921 - * add the message check code from mt5921. - * - * 10 19 2010 jeffrey.chang - * [WCXRP00000121] [MT6620 Wi-Fi][Driver] Temporarily disable set power mode ioctl which may cause 6620 to enter power saving - * Temporarily disable set power mode ioctl which may cause MT6620 to enter power saving - * - * 10 18 2010 jeffrey.chang - * [WCXRP00000116] [MT6620 Wi-Fi][Driver] Refine the set_scan ioctl to resolve the Android UI hanging issue - * refine the scan ioctl to prevent hanging of Android UI - * - * 10 01 2010 wh.su - * [WCXRP00000067] [MT6620 Wi-Fi][Driver] Support the android+ WAPI function - * add the scan result with wapi ie. - * - * 09 30 2010 wh.su - * [WCXRP00000072] [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue - * fixed the wapi ie assigned issue. - * - * 09 27 2010 wh.su - * NULL - * [WCXRP00000067][MT6620 Wi-Fi][Driver] Support the android+ WAPI function. - * - * 09 21 2010 kevin.huang - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * Eliminate Linux Compile Warning - * - * 09 09 2010 cp.wu - * NULL - * add WPS/WPA/RSN IE for Wi-Fi Direct scanning result. - * - * 09 06 2010 cp.wu - * NULL - * Androi/Linux: return current operating channel information - * - * 09 01 2010 wh.su - * NULL - * adding the wapi support for integration test. - * - * 08 02 2010 jeffrey.chang - * NULL - * enable remove key ioctl - * - * 08 02 2010 jeffrey.chang - * NULL - * 1) modify tx service thread to avoid busy looping - * 2) add spin lock declartion for linux build - * - * 07 28 2010 jeffrey.chang - * NULL - * 1) enable encyption ioctls - * 2) temporarily disable remove keys ioctl to prevent TX1 busy - * - * 07 28 2010 jeffrey.chang - * NULL - * 1) remove unused spinlocks - * 2) enable encyption ioctls - * 3) fix scan ioctl which may cause supplicant to hang - * - * 07 19 2010 jeffrey.chang - * - * add kal api for scanning done - * - * 07 19 2010 jeffrey.chang - * - * for linux driver migration - * - * 07 19 2010 jeffrey.chang - * - * Linux port modification - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 28 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * remove unused macro and debug messages - * - * 05 14 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * Add dissassoication support for wpa supplicant - * - * 04 22 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * - * 1) modify rx path code for supporting Wi-Fi direct - * 2) modify config.h since Linux dont need to consider retaining packet - * - * 04 21 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * add for private ioctl support - * - * 04 19 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * Add ioctl of power management - * - * 04 19 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * remove debug message - * - * 04 14 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * 1) prGlueInfo->pvInformationBuffer and prGlueInfo->u4InformationBufferLength are no longer used - * * 2) fix ioctl - * - * 04 12 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * remove debug messages for pre-release - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * rWlanInfo should be placed at adapter rather than glue due to most operations - * * * * * * * * are done in adapter layer. - * - * 04 02 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * fix ioctl type - * - * 04 01 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * enable pmksa cache operation - * - * 03 31 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * fix ioctl which may cause cmdinfo memory leak - * - * 03 31 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * modify the wapi related code for new driver's design. - * - * 03 30 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * emulate NDIS Pending OID facility - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port -** \main\maintrunk.MT5921\38 2009-10-08 10:33:22 GMT mtk01090 -** Avoid accessing private data of net_device directly. Replace with netdev_priv(). Add more checking for input parameters and pointers. -** \main\maintrunk.MT5921\37 2009-09-29 16:49:48 GMT mtk01090 -** Remove unused variables -** \main\maintrunk.MT5921\36 2009-09-28 20:19:11 GMT mtk01090 -** Add private ioctl to carry OID structures. Restructure public/private ioctl interfaces to Linux kernel. -** \main\maintrunk.MT5921\35 2009-09-03 11:42:30 GMT mtk01088 -** adding the wapi ioctl support -** \main\maintrunk.MT5921\34 2009-08-18 22:56:50 GMT mtk01090 -** Add Linux SDIO (with mmc core) support. -** Add Linux 2.6.21, 2.6.25, 2.6.26. -** Fix compile warning in Linux. -** \main\maintrunk.MT5921\33 2009-05-14 22:43:47 GMT mtk01089 -** fix compiling warning -** \main\maintrunk.MT5921\32 2009-05-07 22:26:18 GMT mtk01089 -** Add mandatory and private IO control for Linux BWCS -** \main\maintrunk.MT5921\31 2009-02-07 15:11:14 GMT mtk01088 -** fixed the compiling error -** \main\maintrunk.MT5921\30 2009-02-07 14:46:51 GMT mtk01088 -** add the privacy setting from linux supplicant ap selection -** \main\maintrunk.MT5921\29 2008-11-19 15:18:50 GMT mtk01088 -** fixed the compling error -** \main\maintrunk.MT5921\28 2008-11-19 11:56:18 GMT mtk01088 -** rename some variable with pre-fix to avoid the misunderstanding -** \main\maintrunk.MT5921\27 2008-08-29 16:59:43 GMT mtk01088 -** fixed compiling error -** \main\maintrunk.MT5921\26 2008-08-29 14:55:53 GMT mtk01088 -** adjust the code for meet the coding style, and add assert check -** \main\maintrunk.MT5921\25 2008-06-02 11:15:19 GMT mtk01461 -** Update after wlanoidSetPowerMode changed -** \main\maintrunk.MT5921\24 2008-05-30 15:13:12 GMT mtk01084 -** rename wlanoid -** \main\maintrunk.MT5921\23 2008-03-28 10:40:28 GMT mtk01461 -** Add set desired rate in Linux STD IOCTL -** \main\maintrunk.MT5921\22 2008-03-18 10:31:24 GMT mtk01088 -** add pmkid ioctl and indicate -** \main\maintrunk.MT5921\21 2008-03-11 15:21:24 GMT mtk01461 -** \main\maintrunk.MT5921\20 2008-03-11 14:50:55 GMT mtk01461 -** Refine WPS related priv ioctl for unified interface -** -** \main\maintrunk.MT5921\19 2008-03-06 16:30:41 GMT mtk01088 -** move the configuration code from set essid function, -** remove the non-used code -** \main\maintrunk.MT5921\18 2008-02-21 15:47:09 GMT mtk01461 -** Fix CR[489] -** \main\maintrunk.MT5921\17 2008-02-12 23:38:31 GMT mtk01461 -** Add Set Frequency & Channel oid support for Linux -** \main\maintrunk.MT5921\16 2008-01-24 12:07:34 GMT mtk01461 -** \main\maintrunk.MT5921\15 2008-01-24 12:00:10 GMT mtk01461 -** Modify the wext_essid for set up correct information for IBSS, and fix the wrong input ptr for prAdapter -** \main\maintrunk.MT5921\14 2007-12-06 09:30:12 GMT mtk01425 -** 1. Branch Test -** \main\maintrunk.MT5921\13 2007-12-04 18:07:59 GMT mtk01461 -** fix typo -** \main\maintrunk.MT5921\12 2007-11-30 17:10:21 GMT mtk01425 -** 1. Fix compiling erros -** -** \main\maintrunk.MT5921\11 2007-11-27 10:43:22 GMT mtk01425 -** 1. Add WMM-PS setting -** \main\maintrunk.MT5921\10 2007-11-06 20:33:32 GMT mtk01088 -** fixed the compiler error -** \main\maintrunk.MT5921\9 2007-11-06 19:33:15 GMT mtk01088 -** add WPS code -** \main\maintrunk.MT5921\8 2007-10-30 12:00:44 GMT MTK01425 -** 1. Update wlanQueryInformation -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -#include "gl_os.h" - -#include "config.h" -#include "wlan_oid.h" - -#include "gl_wext.h" -#include "gl_wext_priv.h" - -#include "precomp.h" - -#if CFG_SUPPORT_WAPI -#include "gl_sec.h" -#endif - -/* compatibility to wireless extensions */ -#ifdef WIRELESS_EXT - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -const long channel_freq[] = { - 2412, 2417, 2422, 2427, 2432, 2437, 2442, - 2447, 2452, 2457, 2462, 2467, 2472, 2484 -}; - -#define MAP_CHANNEL_ID_TO_KHZ(ch, khz) { \ - switch (ch) \ - { \ - case 1: khz = 2412000; break; \ - case 2: khz = 2417000; break; \ - case 3: khz = 2422000; break; \ - case 4: khz = 2427000; break; \ - case 5: khz = 2432000; break; \ - case 6: khz = 2437000; break; \ - case 7: khz = 2442000; break; \ - case 8: khz = 2447000; break; \ - case 9: khz = 2452000; break; \ - case 10: khz = 2457000; break; \ - case 11: khz = 2462000; break; \ - case 12: khz = 2467000; break; \ - case 13: khz = 2472000; break; \ - case 14: khz = 2484000; break; \ - case 36: /* UNII */ khz = 5180000; break; \ - case 40: /* UNII */ khz = 5200000; break; \ - case 44: /* UNII */ khz = 5220000; break; \ - case 48: /* UNII */ khz = 5240000; break; \ - case 52: /* UNII */ khz = 5260000; break; \ - case 56: /* UNII */ khz = 5280000; break; \ - case 60: /* UNII */ khz = 5300000; break; \ - case 64: /* UNII */ khz = 5320000; break; \ - case 149: /* UNII */ khz = 5745000; break; \ - case 153: /* UNII */ khz = 5765000; break; \ - case 157: /* UNII */ khz = 5785000; break; \ - case 161: /* UNII */ khz = 5805000; break; \ - case 165: /* UNII */ khz = 5825000; break; \ - case 100: /* HiperLAN2 */ khz = 5500000; break; \ - case 104: /* HiperLAN2 */ khz = 5520000; break; \ - case 108: /* HiperLAN2 */ khz = 5540000; break; \ - case 112: /* HiperLAN2 */ khz = 5560000; break; \ - case 116: /* HiperLAN2 */ khz = 5580000; break; \ - case 120: /* HiperLAN2 */ khz = 5600000; break; \ - case 124: /* HiperLAN2 */ khz = 5620000; break; \ - case 128: /* HiperLAN2 */ khz = 5640000; break; \ - case 132: /* HiperLAN2 */ khz = 5660000; break; \ - case 136: /* HiperLAN2 */ khz = 5680000; break; \ - case 140: /* HiperLAN2 */ khz = 5700000; break; \ - case 34: /* Japan MMAC */ khz = 5170000; break; \ - case 38: /* Japan MMAC */ khz = 5190000; break; \ - case 42: /* Japan MMAC */ khz = 5210000; break; \ - case 46: /* Japan MMAC */ khz = 5230000; break; \ - case 184: /* Japan */ khz = 4920000; break; \ - case 188: /* Japan */ khz = 4940000; break; \ - case 192: /* Japan */ khz = 4960000; break; \ - case 196: /* Japan */ khz = 4980000; break; \ - case 208: /* Japan, means J08 */ khz = 5040000; break; \ - case 212: /* Japan, means J12 */ khz = 5060000; break; \ - case 216: /* Japan, means J16 */ khz = 5080000; break; \ - default: khz = 2412000; break; \ - } \ - } - - -#define NUM_CHANNELS (sizeof(channel_freq) / sizeof(channel_freq[0])) - -#define MAX_SSID_LEN 32 - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ -/* NOTE: name in iwpriv_args only have 16 bytes */ -static const struct iw_priv_args rIwPrivTable[] = { - {IOCTL_SET_INT, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, ""}, - {IOCTL_GET_INT, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, ""}, - {IOCTL_SET_INT, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0, ""}, - {IOCTL_GET_INT, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, ""}, - {IOCTL_SET_INT, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, ""}, - - {IOCTL_GET_INT, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, ""}, - {IOCTL_GET_INT, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, ""}, - - {IOCTL_SET_INTS, IW_PRIV_TYPE_INT | 4, 0, ""}, - {IOCTL_GET_INT, 0, IW_PRIV_TYPE_INT | 50, ""}, - - /* added for set_oid and get_oid */ - {IOCTL_SET_STRUCT, 256, 0, ""}, - {IOCTL_GET_STRUCT, 0, 256, ""}, - - /* sub-ioctl definitions */ -#if 0 - {PRIV_CMD_REG_DOMAIN, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_reg_domain" }, - {PRIV_CMD_REG_DOMAIN, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_reg_domain" }, -#endif - -#if CFG_TCP_IP_CHKSUM_OFFLOAD - {PRIV_CMD_CSUM_OFFLOAD, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_tcp_csum" }, -#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */ - - {PRIV_CMD_POWER_MODE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_power_mode" }, - {PRIV_CMD_POWER_MODE, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_power_mode" }, - - {PRIV_CMD_WMM_PS, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0, "set_wmm_ps" }, - - {PRIV_CMD_TEST_MODE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_test_mode" }, - {PRIV_CMD_TEST_CMD, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "set_test_cmd" }, - {PRIV_CMD_TEST_CMD, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_test_result" }, -#if CFG_SUPPORT_PRIV_MCR_RW - {PRIV_CMD_ACCESS_MCR, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "set_mcr" }, - {PRIV_CMD_ACCESS_MCR, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_mcr" }, -#endif - {PRIV_CMD_SW_CTRL, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "set_sw_ctrl" }, - {PRIV_CMD_SW_CTRL, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_sw_ctrl" }, - -#if CFG_SUPPORT_BCM && CFG_SUPPORT_BCM_BWCS - {PRIV_CUSTOM_BWCS_CMD, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_bwcs"}, - /* GET STRUCT sub-ioctls commands */ - {PRIV_CUSTOM_BWCS_CMD, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_bwcs"}, -#endif - - /* SET STRUCT sub-ioctls commands */ - {PRIV_CMD_OID, 256, 0, "set_oid"}, - /* GET STRUCT sub-ioctls commands */ - {PRIV_CMD_OID, 0, 256, "get_oid"}, - - {PRIV_CMD_BAND_CONFIG, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_band" }, - {PRIV_CMD_BAND_CONFIG, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_band" }, - - {PRIV_CMD_SET_TX_POWER, IW_PRIV_TYPE_INT | 4, 0, "set_txpower" }, - {PRIV_CMD_GET_CH_LIST, 0, IW_PRIV_TYPE_INT | 50, "get_ch_list" }, - {PRIV_CMD_DUMP_MEM, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_mem" }, - -#if CFG_ENABLE_WIFI_DIRECT - {PRIV_CMD_P2P_MODE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "set_p2p_mode" }, -#endif -}; - -static const iw_handler rIwPrivHandler[] = { - [IOCTL_SET_INT - SIOCIWFIRSTPRIV] = priv_set_int, - [IOCTL_GET_INT - SIOCIWFIRSTPRIV] = priv_get_int, - [IOCTL_SET_ADDRESS - SIOCIWFIRSTPRIV] = NULL, - [IOCTL_GET_ADDRESS - SIOCIWFIRSTPRIV] = NULL, - [IOCTL_SET_STR - SIOCIWFIRSTPRIV] = NULL, - [IOCTL_GET_STR - SIOCIWFIRSTPRIV] = NULL, - [IOCTL_SET_KEY - SIOCIWFIRSTPRIV] = NULL, - [IOCTL_GET_KEY - SIOCIWFIRSTPRIV] = NULL, - [IOCTL_SET_STRUCT - SIOCIWFIRSTPRIV] = priv_set_struct, - [IOCTL_GET_STRUCT - SIOCIWFIRSTPRIV] = priv_get_struct, - [IOCTL_SET_STRUCT_FOR_EM - SIOCIWFIRSTPRIV] = priv_set_struct, - [IOCTL_SET_INTS - SIOCIWFIRSTPRIV] = priv_set_ints, - [IOCTL_GET_INTS - SIOCIWFIRSTPRIV] = priv_get_ints, -}; - -const struct iw_handler_def wext_handler_def = { - .num_standard = 0, - .num_private = (__u16)sizeof(rIwPrivHandler)/sizeof(iw_handler), - .num_private_args = (__u16)sizeof(rIwPrivTable)/sizeof(struct iw_priv_args), - .standard = (iw_handler *) NULL, - .private = rIwPrivHandler, - .private_args = rIwPrivTable, - .get_wireless_stats = wext_get_wireless_stats, -}; - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Find the desired WPA/RSN Information Element according to desiredElemID. -* -* \param[in] pucIEStart IE starting address. -* \param[in] i4TotalIeLen Total length of all the IE. -* \param[in] ucDesiredElemId Desired element ID. -* \param[out] ppucDesiredIE Pointer to the desired IE. -* -* \retval TRUE Find the desired IE. -* \retval FALSE Desired IE not found. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wextSrchDesiredWPAIE ( - IN PUINT_8 pucIEStart, - IN INT_32 i4TotalIeLen, - IN UINT_8 ucDesiredElemId, - OUT PUINT_8 *ppucDesiredIE - ) -{ - INT_32 i4InfoElemLen; - - ASSERT(pucIEStart); - ASSERT(ppucDesiredIE); - - while (i4TotalIeLen >= 2) { - i4InfoElemLen = (INT_32) pucIEStart[1] + 2; - - if (pucIEStart[0] == ucDesiredElemId && i4InfoElemLen <= i4TotalIeLen) { - if (ucDesiredElemId != 0xDD) { - /* Non 0xDD, OK! */ - *ppucDesiredIE = &pucIEStart[0]; - return TRUE; - } - else { - /* EID == 0xDD, check WPA IE */ - if (pucIEStart[1] >= 4) { - if (memcmp(&pucIEStart[2], "\x00\x50\xf2\x01", 4) == 0) { - *ppucDesiredIE = &pucIEStart[0]; - return TRUE; - } - } /* check WPA IE length */ - } /* check EID == 0xDD */ - } /* check desired EID */ - - /* Select next information element. */ - i4TotalIeLen -= i4InfoElemLen; - pucIEStart += i4InfoElemLen; - } - - return FALSE; -} /* parseSearchDesiredWPAIE */ - - -#if CFG_SUPPORT_WAPI -/*----------------------------------------------------------------------------*/ -/*! -* \brief Find the desired WAPI Information Element . -* -* \param[in] pucIEStart IE starting address. -* \param[in] i4TotalIeLen Total length of all the IE. -* \param[out] ppucDesiredIE Pointer to the desired IE. -* -* \retval TRUE Find the desired IE. -* \retval FALSE Desired IE not found. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wextSrchDesiredWAPIIE ( - IN PUINT_8 pucIEStart, - IN INT_32 i4TotalIeLen, - OUT PUINT_8 *ppucDesiredIE - ) -{ - INT_32 i4InfoElemLen; - - ASSERT(pucIEStart); - ASSERT(ppucDesiredIE); - - while (i4TotalIeLen >= 2) { - i4InfoElemLen = (INT_32) pucIEStart[1] + 2; - - if (pucIEStart[0] == ELEM_ID_WAPI && i4InfoElemLen <= i4TotalIeLen) { - *ppucDesiredIE = &pucIEStart[0]; - return TRUE; - } /* check desired EID */ - - /* Select next information element. */ - i4TotalIeLen -= i4InfoElemLen; - pucIEStart += i4InfoElemLen; - } - - return FALSE; -} /* wextSrchDesiredWAPIIE */ -#endif - - -#if CFG_SUPPORT_WPS -/*----------------------------------------------------------------------------*/ -/*! -* \brief Find the desired WPS Information Element according to desiredElemID. -* -* \param[in] pucIEStart IE starting address. -* \param[in] i4TotalIeLen Total length of all the IE. -* \param[in] ucDesiredElemId Desired element ID. -* \param[out] ppucDesiredIE Pointer to the desired IE. -* -* \retval TRUE Find the desired IE. -* \retval FALSE Desired IE not found. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -wextSrchDesiredWPSIE ( - IN PUINT_8 pucIEStart, - IN INT_32 i4TotalIeLen, - IN UINT_8 ucDesiredElemId, - OUT PUINT_8 *ppucDesiredIE) -{ - INT_32 i4InfoElemLen; - - ASSERT(pucIEStart); - ASSERT(ppucDesiredIE); - - while (i4TotalIeLen >= 2) { - i4InfoElemLen = (INT_32) pucIEStart[1] + 2; - - if (pucIEStart[0] == ucDesiredElemId && i4InfoElemLen <= i4TotalIeLen) { - if (ucDesiredElemId != 0xDD) { - /* Non 0xDD, OK! */ - *ppucDesiredIE = &pucIEStart[0]; - return TRUE; - } - else { - /* EID == 0xDD, check WPS IE */ - if (pucIEStart[1] >= 4) { - if (memcmp(&pucIEStart[2], "\x00\x50\xf2\x04", 4) == 0) { - *ppucDesiredIE = &pucIEStart[0]; - return TRUE; - } - } /* check WPS IE length */ - } /* check EID == 0xDD */ - } /* check desired EID */ - - /* Select next information element. */ - i4TotalIeLen -= i4InfoElemLen; - pucIEStart += i4InfoElemLen; - } - - return FALSE; -} /* parseSearchDesiredWPSIE */ -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Get the name of the protocol used on the air. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[out] pcName Buffer to store protocol name string -* \param[in] pcExtra NULL. -* -* \retval 0 For success. -* -* \note If netif_carrier_ok, protocol name is returned; -* otherwise, "disconnected" is returned. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_get_name ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - OUT char *pcName, - IN char *pcExtra - ) -{ - ENUM_PARAM_NETWORK_TYPE_T eNetWorkType; - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(pcName); - if (FALSE == GLUE_CHK_PR2(prNetDev, pcName)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - if (netif_carrier_ok(prNetDev)) { - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryNetworkTypeInUse, - &eNetWorkType, - sizeof(eNetWorkType), - TRUE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - switch(eNetWorkType) { - case PARAM_NETWORK_TYPE_DS: - strcpy(pcName, "IEEE 802.11b"); - break; - case PARAM_NETWORK_TYPE_OFDM24: - strcpy(pcName, "IEEE 802.11bgn"); - break; - case PARAM_NETWORK_TYPE_AUTOMODE: - case PARAM_NETWORK_TYPE_OFDM5: - strcpy(pcName, "IEEE 802.11abgn"); - break; - case PARAM_NETWORK_TYPE_FH: - default: - strcpy(pcName, "IEEE 802.11"); - break; - } - } - else { - strcpy(pcName, "Disconnected"); - } - - return 0; -} /* wext_get_name */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To set the operating channel in the wireless device. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL -* \param[in] prFreq Buffer to store frequency information -* \param[in] pcExtra NULL -* -* \retval 0 For success. -* \retval -EOPNOTSUPP If infrastructure mode is not NET NET_TYPE_IBSS. -* \retval -EINVAL Invalid channel frequency. -* -* \note If infrastructure mode is IBSS, new channel frequency is set to device. -* The range of channel number depends on different regulatory domain. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_set_freq ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN struct iw_freq *prIwFreq, - IN char *pcExtra - ) -{ - -#if 0 - UINT_32 u4ChnlFreq; /* Store channel or frequency information */ - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prIwFreq); - if (FALSE == GLUE_CHK_PR2(prNetDev, prIwFreq)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - /* - printk("set m:%d, e:%d, i:%d, flags:%d\n", - prIwFreq->m, prIwFreq->e, prIwFreq->i, prIwFreq->flags); - */ - - /* If setting by frequency, convert to a channel */ - if ((prIwFreq->e == 1) && - (prIwFreq->m >= (int) 2.412e8) && - (prIwFreq->m <= (int) 2.484e8)) { - - /* Change to KHz format */ - u4ChnlFreq = (UINT_32)(prIwFreq->m / (KILO / 10)); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetFrequency, - &u4ChnlFreq, - sizeof(u4ChnlFreq), - FALSE, - FALSE, - FALSE, - &u4BufLen); - - if (WLAN_STATUS_SUCCESS != rStatus) { - return -EINVAL; - } - } - /* Setting by channel number */ - else if ((prIwFreq->m > KILO) || (prIwFreq->e > 0)) { - return -EOPNOTSUPP; - } - else { - /* Change to channel number format */ - u4ChnlFreq = (UINT_32)prIwFreq->m; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetChannel, - &u4ChnlFreq, - sizeof(u4ChnlFreq), - FALSE, - FALSE, - FALSE, - &u4BufLen); - - - - - if (WLAN_STATUS_SUCCESS != rStatus) { - return -EINVAL; - } - } - -#endif - - return 0; - -} /* wext_set_freq */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To get the operating channel in the wireless device. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[out] prFreq Buffer to store frequency information. -* \param[in] pcExtra NULL. -* -* \retval 0 If netif_carrier_ok. -* \retval -ENOTCONN Otherwise -* -* \note If netif_carrier_ok, channel frequency information is stored in pFreq. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_get_freq ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - OUT struct iw_freq *prIwFreq, - IN char *pcExtra - ) -{ - UINT_32 u4Channel = 0; - - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prIwFreq); - if (FALSE == GLUE_CHK_PR2(prNetDev, prIwFreq)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - /* GeorgeKuo: TODO skip checking in IBSS mode */ - if (!netif_carrier_ok(prNetDev)) { - return -ENOTCONN; - } - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryFrequency, - &u4Channel, - sizeof(u4Channel), - TRUE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - prIwFreq->m = (int) u4Channel; /* freq in KHz */ - prIwFreq->e = 3; - - return 0; - -} /* wext_get_freq */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To set operating mode. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[in] pu4Mode Pointer to new operation mode. -* \param[in] pcExtra NULL. -* -* \retval 0 For success. -* \retval -EOPNOTSUPP If new mode is not supported. -* -* \note Device will run in new operation mode if it is valid. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_set_mode ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN unsigned int *pu4Mode, - IN char *pcExtra - ) -{ - ENUM_PARAM_OP_MODE_T eOpMode; - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(pu4Mode); - if (FALSE == GLUE_CHK_PR2(prNetDev, pu4Mode)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - switch (*pu4Mode) { - case IW_MODE_AUTO: - eOpMode = NET_TYPE_AUTO_SWITCH; - break; - - case IW_MODE_ADHOC: - eOpMode = NET_TYPE_IBSS; - break; - - case IW_MODE_INFRA: - eOpMode = NET_TYPE_INFRA; - break; - - default: - DBGLOG(INIT, INFO, ("%s(): Set UNSUPPORTED Mode = %d.\n", __FUNCTION__, *pu4Mode)); - return -EOPNOTSUPP; - } - - //printk("%s(): Set Mode = %d\n", __FUNCTION__, *pu4Mode); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetInfrastructureMode, - &eOpMode, - sizeof(eOpMode), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - - /* after set operation mode, key table are cleared */ - - /* reset wpa info */ - prGlueInfo->rWpaInfo.u4WpaVersion = IW_AUTH_WPA_VERSION_DISABLED; - prGlueInfo->rWpaInfo.u4KeyMgmt = 0; - prGlueInfo->rWpaInfo.u4CipherGroup = IW_AUTH_CIPHER_NONE; - prGlueInfo->rWpaInfo.u4CipherPairwise = IW_AUTH_CIPHER_NONE; - prGlueInfo->rWpaInfo.u4AuthAlg = IW_AUTH_ALG_OPEN_SYSTEM; -#if CFG_SUPPORT_802_11W - prGlueInfo->rWpaInfo.u4Mfp = IW_AUTH_MFP_DISABLED; -#endif - - return 0; -} /* wext_set_mode */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To get operating mode. -* -* \param[in] prNetDev Net device requested. -* \param[in] prIwReqInfo NULL. -* \param[out] pu4Mode Buffer to store operating mode information. -* \param[in] pcExtra NULL. -* -* \retval 0 If data is valid. -* \retval -EINVAL Otherwise. -* -* \note If netif_carrier_ok, operating mode information is stored in pu4Mode. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_get_mode ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - OUT unsigned int *pu4Mode, - IN char *pcExtra - ) -{ - ENUM_PARAM_OP_MODE_T eOpMode; - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(pu4Mode); - if (FALSE == GLUE_CHK_PR2(prNetDev, pu4Mode)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryInfrastructureMode, - &eOpMode, - sizeof(eOpMode), - TRUE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - - - switch (eOpMode){ - case NET_TYPE_IBSS: - *pu4Mode = IW_MODE_ADHOC; - break; - - case NET_TYPE_INFRA: - *pu4Mode = IW_MODE_INFRA; - break; - - case NET_TYPE_AUTO_SWITCH: - *pu4Mode = IW_MODE_AUTO; - break; - - default: - DBGLOG(INIT, INFO, ("%s(): Get UNKNOWN Mode.\n", __FUNCTION__)); - return -EINVAL; - } - - return 0; -} /* wext_get_mode */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To get the valid range for each configurable STA setting value. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[in] prData Pointer to iw_point structure, not used. -* \param[out] pcExtra Pointer to buffer which is allocated by caller of this -* function, wext_support_ioctl() or ioctl_standard_call() in -* wireless.c. -* -* \retval 0 If data is valid. -* -* \note The extra buffer (pcExtra) is filled with information from driver. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_get_range ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - IN struct iw_point *prData, - OUT char *pcExtra - ) -{ - struct iw_range *prRange = NULL; - PARAM_RATES_EX aucSuppRate = {0}; /* data buffers */ - int i = 0; - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(pcExtra); - if (FALSE == GLUE_CHK_PR2(prNetDev, pcExtra)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - prRange = (struct iw_range *) pcExtra; - - memset(prRange, 0, sizeof(*prRange)); - prRange->throughput = 20000000; /* 20Mbps */ - prRange->min_nwid = 0; /* not used */ - prRange->max_nwid = 0; /* not used */ - - /* scan_capa not implemented */ - - /* event_capa[6]: kernel + driver capabilities */ - prRange->event_capa[0] = (IW_EVENT_CAPA_K_0 - | IW_EVENT_CAPA_MASK(SIOCGIWAP) - | IW_EVENT_CAPA_MASK(SIOCGIWSCAN) - /* can't display meaningful string in iwlist - | IW_EVENT_CAPA_MASK(SIOCGIWTXPOW) - | IW_EVENT_CAPA_MASK(IWEVMICHAELMICFAILURE) - | IW_EVENT_CAPA_MASK(IWEVASSOCREQIE) - | IW_EVENT_CAPA_MASK(IWEVPMKIDCAND) - */ - ); - prRange->event_capa[1] = IW_EVENT_CAPA_K_1; - - /* report 2.4G channel and frequency only */ - prRange->num_channels = (__u16) NUM_CHANNELS; - prRange->num_frequency = (__u8) NUM_CHANNELS; - for (i = 0; i < NUM_CHANNELS; i++) { - /* iwlib takes this number as channel number */ - prRange->freq[i].i = i + 1; - prRange->freq[i].m = channel_freq[i]; - prRange->freq[i].e = 6; /* Values in table in MHz */ - } - - rStatus = kalIoctl( - prGlueInfo, - wlanoidQuerySupportedRates, - &aucSuppRate, - sizeof(aucSuppRate), - TRUE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - - - for (i = 0; i < IW_MAX_BITRATES && i < PARAM_MAX_LEN_RATES_EX ; i++) { - if (aucSuppRate[i] == 0) { - break; - } - prRange->bitrate[i] = (aucSuppRate[i] & 0x7F) * 500000; /* 0.5Mbps */ - } - prRange->num_bitrates = i; - - prRange->min_rts = 0; - prRange->max_rts = 2347; - prRange->min_frag = 256; - prRange->max_frag = 2346; - - prRange->min_pmp = 0; /* power management by driver */ - prRange->max_pmp = 0; /* power management by driver */ - prRange->min_pmt = 0; /* power management by driver */ - prRange->max_pmt = 0; /* power management by driver */ - prRange->pmp_flags = IW_POWER_RELATIVE; /* pm default flag */ - prRange->pmt_flags = IW_POWER_ON; /* pm timeout flag */ - prRange->pm_capa = IW_POWER_ON; /* power management by driver */ - - prRange->encoding_size[0] = 5; /* wep40 */ - prRange->encoding_size[1] = 16; /* tkip */ - prRange->encoding_size[2] = 16; /* ckip */ - prRange->encoding_size[3] = 16; /* ccmp */ - prRange->encoding_size[4] = 13; /* wep104 */ - prRange->encoding_size[5] = 16; /* wep128 */ - prRange->num_encoding_sizes = 6; - prRange->max_encoding_tokens = 6; /* token? */ - -#if WIRELESS_EXT < 17 - prRange->txpower_capa = 0x0002; /* IW_TXPOW_RELATIVE */ -#else - prRange->txpower_capa = IW_TXPOW_RELATIVE; -#endif - prRange->num_txpower = 5; - prRange->txpower[0] = 0; /* minimum */ - prRange->txpower[1] = 25; /* 25% */ - prRange->txpower[2] = 50; /* 50% */ - prRange->txpower[3] = 100; /* 100% */ - - prRange->we_version_compiled = WIRELESS_EXT; - prRange->we_version_source = WIRELESS_EXT; - - prRange->retry_capa = IW_RETRY_LIMIT; - prRange->retry_flags = IW_RETRY_LIMIT; - prRange->min_retry = 7; - prRange->max_retry = 7; - prRange->r_time_flags = IW_RETRY_ON; - prRange->min_r_time = 0; - prRange->max_r_time = 0; - - /* signal strength and link quality */ - /* Just define range here, reporting value moved to wext_get_stats() */ - prRange->sensitivity = -83; /* fixed value */ - prRange->max_qual.qual = 100; /* max 100% */ - prRange->max_qual.level = (__u8)(0x100 - 0); /* max 0 dbm */ - prRange->max_qual.noise = (__u8)(0x100 - 0); /* max 0 dbm */ - - /* enc_capa */ -#if WIRELESS_EXT > 17 - prRange->enc_capa = IW_ENC_CAPA_WPA | - IW_ENC_CAPA_WPA2 | - IW_ENC_CAPA_CIPHER_TKIP | - IW_ENC_CAPA_CIPHER_CCMP; -#endif - - /* min_pms; Minimal PM saving */ - /* max_pms; Maximal PM saving */ - /* pms_flags; How to decode max/min PM saving */ - - /* modul_capa; IW_MODUL_* bit field */ - /* bitrate_capa; Types of bitrates supported */ - - return 0; -} /* wext_get_range */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To set BSSID of AP to connect. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[in] prAddr Pointer to struct sockaddr structure containing AP's BSSID. -* \param[in] pcExtra NULL. -* -* \retval 0 For success. -* -* \note Desired AP's BSSID is set to driver. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_set_ap ( - IN struct net_device *prDev, - IN struct iw_request_info *prIwrInfo, - IN struct sockaddr *prAddr, - IN char *pcExtra - ) -{ - return 0; -} /* wext_set_ap */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To get AP MAC address. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[out] prAddr Pointer to struct sockaddr structure storing AP's BSSID. -* \param[in] pcExtra NULL. -* -* \retval 0 If netif_carrier_ok. -* \retval -ENOTCONN Otherwise. -* -* \note If netif_carrier_ok, AP's mac address is stored in pAddr->sa_data. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_get_ap ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - OUT struct sockaddr *prAddr, - IN char *pcExtra - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prAddr); - if (FALSE == GLUE_CHK_PR2(prNetDev, prAddr)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - //if (!netif_carrier_ok(prNetDev)) { - // return -ENOTCONN; - //} - - if(prGlueInfo->eParamMediaStateIndicated == PARAM_MEDIA_STATE_DISCONNECTED){ - memset(prAddr, 0, 6); - return 0; - } - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryBssid, - prAddr->sa_data, - ETH_ALEN, - TRUE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - return 0; -} /* wext_get_ap */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To set mlme operation request. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[in] prData Pointer of iw_point header. -* \param[in] pcExtra Pointer to iw_mlme structure mlme request information. -* -* \retval 0 For success. -* \retval -EOPNOTSUPP unsupported IW_MLME_ command. -* \retval -EINVAL Set MLME Fail, different bssid. -* -* \note Driver will start mlme operation if valid. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_set_mlme ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - IN struct iw_point *prData, - IN char *pcExtra - ) -{ - struct iw_mlme *prMlme = NULL; - - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(pcExtra); - if (FALSE == GLUE_CHK_PR2(prNetDev, pcExtra)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - prMlme = (struct iw_mlme *)pcExtra; - if (prMlme->cmd == IW_MLME_DEAUTH || prMlme->cmd == IW_MLME_DISASSOC) { - if (!netif_carrier_ok(prNetDev)) { - DBGLOG(INIT, INFO, ("[wifi] Set MLME Deauth/Disassoc, but netif_carrier_off\n")); - return 0; - } - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetDisassociate, - NULL, - 0, - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - return 0; - } - else { - DBGLOG(INIT, INFO, ("[wifi] unsupported IW_MLME_ command :%d\n", prMlme->cmd)); - return -EOPNOTSUPP; - } -} /* wext_set_mlme */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To issue scan request. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[in] prData NULL. -* \param[in] pcExtra NULL. -* -* \retval 0 For success. -* \retval -EFAULT Tx power is off. -* -* \note Device will start scanning. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_set_scan ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - IN union iwreq_data *prData, - IN char *pcExtra - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - int essid_len = 0; - - ASSERT(prNetDev); - if (FALSE == GLUE_CHK_DEV(prNetDev)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - -#if WIRELESS_EXT > 17 - /* retrieve SSID */ - if(prData) { - essid_len = ((struct iw_scan_req *)(((struct iw_point*)prData)->pointer))->essid_len; - } -#endif - - init_completion(&prGlueInfo->rScanComp); - - // TODO: parse flags and issue different scan requests? - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetBssidListScan, - pcExtra, - essid_len, - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - //wait_for_completion_interruptible_timeout(&prGlueInfo->rScanComp, 2 * KAL_HZ); - //kalIndicateStatusAndComplete(prGlueInfo, WLAN_STATUS_SCAN_COMPLETE, NULL, 0); - - - return 0; -} /* wext_set_scan */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To write the ie to buffer -* -*/ -/*----------------------------------------------------------------------------*/ -static inline int snprintf_hex(char *buf, size_t buf_size, const u8 *data, - size_t len) -{ - size_t i; - char *pos = buf, *end = buf + buf_size; - int ret; - - if (buf_size == 0) - return 0; - - for (i = 0; i < len; i++) { - ret = snprintf(pos, end - pos, "%02x", - data[i]); - if (ret < 0 || ret >= end - pos) { - end[-1] = '\0'; - return pos - buf; - } - pos += ret; - } - end[-1] = '\0'; - return pos - buf; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To get scan results, transform results from driver's format to WE's. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[out] prData Pointer to iw_point structure, pData->length is the size of -* pcExtra buffer before used, and is updated after filling scan -* results. -* \param[out] pcExtra Pointer to buffer which is allocated by caller of this -* function, wext_support_ioctl() or ioctl_standard_call() in -* wireless.c. -* -* \retval 0 For success. -* \retval -ENOMEM If dynamic memory allocation fail. -* \retval -E2BIG Invalid length. -* -* \note Scan results is filled into pcExtra buffer, data size is updated in -* pData->length. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_get_scan ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - IN OUT struct iw_point *prData, - IN char *pcExtra - ) -{ - UINT_32 i = 0; - UINT_32 j = 0; - P_PARAM_BSSID_LIST_EX_T prList = NULL; - P_PARAM_BSSID_EX_T prBss = NULL; - P_PARAM_VARIABLE_IE_T prDesiredIE = NULL; - struct iw_event iwEvent; /* local iw_event buffer */ - - /* write pointer of extra buffer */ - char *pcCur = NULL; - /* pointer to the end of last full entry in extra buffer */ - char *pcValidEntryEnd = NULL; - char *pcEnd = NULL; /* end of extra buffer */ - - UINT_32 u4AllocBufLen = 0; - - /* arrange rate information */ - UINT_32 u4HighestRate = 0; - char aucRatesBuf[64]; - UINT_32 u4BufIndex; - - /* return value */ - int ret = 0; - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prData); - ASSERT(pcExtra); - if (FALSE == GLUE_CHK_PR3(prNetDev, prData, pcExtra)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - /* Initialize local variables */ - pcCur = pcExtra; - pcValidEntryEnd = pcExtra; - pcEnd = pcExtra + prData->length; /* end of extra buffer */ - - /* Allocate another query buffer with the same size of extra buffer */ - u4AllocBufLen = prData->length; - prList = kalMemAlloc(u4AllocBufLen, VIR_MEM_TYPE); - if (prList == NULL) { - DBGLOG(INIT, INFO, ("[wifi] no memory for scan list:%d\n", prData->length)); - ret = -ENOMEM; - goto error; - } - prList->u4NumberOfItems = 0; - - /* wait scan done */ - //printk ("wait for scan results\n"); - //wait_for_completion_interruptible_timeout(&prGlueInfo->rScanComp, 4 * KAL_HZ); - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryBssidList, - prList, - u4AllocBufLen, - TRUE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - if (rStatus == WLAN_STATUS_INVALID_LENGTH) { - /* Buffer length is not large enough. */ - //printk(KERN_INFO "[wifi] buf:%d result:%ld\n", pData->length, u4BufLen); - -#if WIRELESS_EXT >= 17 - /* This feature is supported in WE-17 or above, limited by iwlist. - ** Return -E2BIG and iwlist will request again with a larger buffer. - */ - ret = -E2BIG; - /* Update length to give application a hint on result length */ - prData->length = (__u16)u4BufLen; - goto error; -#else - /* Realloc a larger query buffer here, but don't write too much to extra - ** buffer when filling it later. - */ - kalMemFree(prList, VIR_MEM_TYPE, u4AllocBufLen); - - u4AllocBufLen = u4BufLen; - prList = kalMemAlloc(u4AllocBufLen, VIR_MEM_TYPE); - if (prList == NULL) { - DBGLOG(INIT, INFO, ("[wifi] no memory for larger scan list :%ld\n", u4BufLen)); - ret = -ENOMEM; - goto error; - } - prList->NumberOfItems = 0; - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryBssidList, - prList, - u4AllocBufLen, - TRUE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - if (rStatus == WLAN_STATUS_INVALID_LENGTH) { - DBGLOG(INIT, INFO, ("[wifi] larger buf:%d result:%ld\n", u4AllocBufLen, u4BufLen)); - ret = -E2BIG; - prData->length = (__u16)u4BufLen; - goto error; - } -#endif /* WIRELESS_EXT >= 17 */ - - } - - - if (prList->u4NumberOfItems > CFG_MAX_NUM_BSS_LIST) { - DBGLOG(INIT, INFO, ("[wifi] strange scan result count:%ld\n", - prList->u4NumberOfItems)); - goto error; - } - - /* Copy required data from pList to pcExtra */ - prBss = &prList->arBssid[0]; /* set to the first entry */ - for (i = 0; i < prList->u4NumberOfItems; ++i) { - /* BSSID */ - iwEvent.cmd = SIOCGIWAP; - iwEvent.len = IW_EV_ADDR_LEN; - if ((pcCur + iwEvent.len) > pcEnd) - break; - iwEvent.u.ap_addr.sa_family = ARPHRD_ETHER; - memcpy(iwEvent.u.ap_addr.sa_data, prBss->arMacAddress, ETH_ALEN); - memcpy(pcCur, &iwEvent, IW_EV_ADDR_LEN); - pcCur += IW_EV_ADDR_LEN; - - /* SSID */ - iwEvent.cmd = SIOCGIWESSID; - /* Modification to user space pointer(essid.pointer) is not needed. */ - iwEvent.u.essid.length = (__u16)prBss->rSsid.u4SsidLen; - iwEvent.len = IW_EV_POINT_LEN + iwEvent.u.essid.length; - - if ((pcCur + iwEvent.len) > pcEnd) - break; - iwEvent.u.essid.flags = 1; - iwEvent.u.essid.pointer = NULL; - -#if WIRELESS_EXT <= 18 - memcpy(pcCur, &iwEvent, iwEvent.len); -#else - memcpy(pcCur, &iwEvent, IW_EV_LCP_LEN); - memcpy(pcCur + IW_EV_LCP_LEN, - &iwEvent.u.data.length, - sizeof(struct iw_point) - IW_EV_POINT_OFF); -#endif - memcpy(pcCur + IW_EV_POINT_LEN, prBss->rSsid.aucSsid, iwEvent.u.essid.length); - pcCur += iwEvent.len; - /* Frequency */ - iwEvent.cmd = SIOCGIWFREQ; - iwEvent.len = IW_EV_FREQ_LEN; - if ((pcCur + iwEvent.len) > pcEnd) - break; - iwEvent.u.freq.m = prBss->rConfiguration.u4DSConfig; - iwEvent.u.freq.e = 3; /* (in KHz) */ - iwEvent.u.freq.i = 0; - memcpy(pcCur, &iwEvent, IW_EV_FREQ_LEN); - pcCur += IW_EV_FREQ_LEN; - - /* Operation Mode */ - iwEvent.cmd = SIOCGIWMODE; - iwEvent.len = IW_EV_UINT_LEN; - if ((pcCur + iwEvent.len) > pcEnd) - break; - if (prBss->eOpMode == NET_TYPE_IBSS) { - iwEvent.u.mode = IW_MODE_ADHOC; - } - else if (prBss->eOpMode == NET_TYPE_INFRA) { - iwEvent.u.mode = IW_MODE_INFRA; - } - else { - iwEvent.u.mode = IW_MODE_AUTO; - } - memcpy(pcCur, &iwEvent, IW_EV_UINT_LEN); - pcCur += IW_EV_UINT_LEN; - - /* Quality */ - iwEvent.cmd = IWEVQUAL; - iwEvent.len = IW_EV_QUAL_LEN; - if ((pcCur + iwEvent.len) > pcEnd) - break; - iwEvent.u.qual.qual = 0; /* Quality not available now */ - /* -100 < Rssi < -10, normalized by adding 0x100 */ - iwEvent.u.qual.level = 0x100 + prBss->rRssi; - iwEvent.u.qual.noise = 0; /* Noise not available now */ - iwEvent.u.qual.updated = IW_QUAL_QUAL_INVALID | IW_QUAL_LEVEL_UPDATED \ - | IW_QUAL_NOISE_INVALID; - memcpy(pcCur, &iwEvent, IW_EV_QUAL_LEN); - pcCur += IW_EV_QUAL_LEN; - - /* Security Mode*/ - iwEvent.cmd = SIOCGIWENCODE; - iwEvent.len = IW_EV_POINT_LEN; - if ((pcCur + iwEvent.len) > pcEnd) - break; - iwEvent.u.data.pointer = NULL; - iwEvent.u.data.flags = 0; - iwEvent.u.data.length = 0; - if(!prBss->u4Privacy) { - iwEvent.u.data.flags |= IW_ENCODE_DISABLED; - } -#if WIRELESS_EXT <= 18 - memcpy(pcCur, &iwEvent, IW_EV_POINT_LEN); -#else - memcpy(pcCur, &iwEvent, IW_EV_LCP_LEN); - memcpy(pcCur + IW_EV_LCP_LEN, - &iwEvent.u.data.length, - sizeof(struct iw_point) - IW_EV_POINT_OFF); -#endif - pcCur += IW_EV_POINT_LEN; - - /* rearrange rate information */ - u4BufIndex = sprintf(aucRatesBuf, "Rates (Mb/s):"); - u4HighestRate = 0; - for (j = 0; j < PARAM_MAX_LEN_RATES_EX; ++j) { - UINT_8 curRate = prBss->rSupportedRates[j] & 0x7F; - if (curRate == 0) { - break; - } - - if (curRate > u4HighestRate) { - u4HighestRate = curRate; - } - - if (curRate == RATE_5_5M) { - u4BufIndex += sprintf(aucRatesBuf + u4BufIndex, " 5.5"); - } - else { - u4BufIndex += sprintf(aucRatesBuf + u4BufIndex, " %d", curRate / 2); - } - #if DBG - if (u4BufIndex > sizeof(aucRatesBuf)) { - //printk("rate info too long\n"); - break; - } - #endif - } - /* Report Highest Rates */ - iwEvent.cmd = SIOCGIWRATE; - iwEvent.len = IW_EV_PARAM_LEN; - if ((pcCur + iwEvent.len) > pcEnd) - break; - iwEvent.u.bitrate.value = u4HighestRate * 500000; - iwEvent.u.bitrate.fixed = 0; - iwEvent.u.bitrate.disabled = 0; - iwEvent.u.bitrate.flags = 0; - memcpy(pcCur, &iwEvent, iwEvent.len); - pcCur += iwEvent.len; - - #if WIRELESS_EXT >= 15 /* IWEVCUSTOM is available in WE-15 or above */ - /* Report Residual Rates */ - iwEvent.cmd = IWEVCUSTOM; - iwEvent.u.data.length = u4BufIndex; - iwEvent.len = IW_EV_POINT_LEN + iwEvent.u.data.length; - if ((pcCur + iwEvent.len) > pcEnd) - break; - iwEvent.u.data.flags = 0; - #if WIRELESS_EXT <= 18 - memcpy(pcCur, &iwEvent, IW_EV_POINT_LEN); - #else - memcpy(pcCur, &iwEvent, IW_EV_LCP_LEN); - memcpy(pcCur + IW_EV_LCP_LEN, - &iwEvent.u.data.length, - sizeof(struct iw_point) - IW_EV_POINT_OFF); - #endif - memcpy(pcCur + IW_EV_POINT_LEN, aucRatesBuf, u4BufIndex); - pcCur += iwEvent.len; - #endif /* WIRELESS_EXT >= 15 */ - - - if (wextSrchDesiredWPAIE(&prBss->aucIEs[sizeof(PARAM_FIXED_IEs)], - prBss->u4IELength - sizeof(PARAM_FIXED_IEs), - 0xDD, - (PUINT_8 *)&prDesiredIE)) { - iwEvent.cmd = IWEVGENIE; - iwEvent.u.data.flags = 1; - iwEvent.u.data.length = 2 + (__u16)prDesiredIE->ucLength; - iwEvent.len = IW_EV_POINT_LEN + iwEvent.u.data.length; - if ((pcCur + iwEvent.len) > pcEnd) - break; -#if WIRELESS_EXT <= 18 - memcpy(pcCur, &iwEvent, IW_EV_POINT_LEN); -#else - memcpy(pcCur, &iwEvent, IW_EV_LCP_LEN); - memcpy(pcCur + IW_EV_LCP_LEN, - &iwEvent.u.data.length, - sizeof(struct iw_point) - IW_EV_POINT_OFF); -#endif - memcpy(pcCur + IW_EV_POINT_LEN, prDesiredIE, 2 + prDesiredIE->ucLength); - pcCur += iwEvent.len; - } - -#if CFG_SUPPORT_WPS /* search WPS IE (0xDD, 221, OUI: 0x0050f204 ) */ - if (wextSrchDesiredWPSIE(&prBss->aucIEs[sizeof(PARAM_FIXED_IEs)], - prBss->u4IELength - sizeof(PARAM_FIXED_IEs), - 0xDD, - (PUINT_8 *)&prDesiredIE)) { - iwEvent.cmd = IWEVGENIE; - iwEvent.u.data.flags = 1; - iwEvent.u.data.length = 2 + (__u16)prDesiredIE->ucLength; - iwEvent.len = IW_EV_POINT_LEN + iwEvent.u.data.length; - if ((pcCur + iwEvent.len) > pcEnd) - break; -#if WIRELESS_EXT <= 18 - memcpy(pcCur, &iwEvent, IW_EV_POINT_LEN); -#else - memcpy(pcCur, &iwEvent, IW_EV_LCP_LEN); - memcpy(pcCur + IW_EV_LCP_LEN, - &iwEvent.u.data.length, - sizeof(struct iw_point) - IW_EV_POINT_OFF); -#endif - memcpy(pcCur + IW_EV_POINT_LEN, prDesiredIE, 2 + prDesiredIE->ucLength); - pcCur += iwEvent.len; - } -#endif - - - /* Search RSN IE (0x30, 48). pBss->IEs starts from timestamp. */ - /* pBss->IEs starts from timestamp */ - if (wextSrchDesiredWPAIE(&prBss->aucIEs[sizeof(PARAM_FIXED_IEs)], - prBss->u4IELength -sizeof(PARAM_FIXED_IEs), - 0x30, - (PUINT_8 *)&prDesiredIE)) { - - iwEvent.cmd = IWEVGENIE; - iwEvent.u.data.flags = 1; - iwEvent.u.data.length = 2 + (__u16)prDesiredIE->ucLength; - iwEvent.len = IW_EV_POINT_LEN + iwEvent.u.data.length; - if ((pcCur + iwEvent.len) > pcEnd) - break; -#if WIRELESS_EXT <= 18 - memcpy(pcCur, &iwEvent, IW_EV_POINT_LEN); -#else - memcpy(pcCur, &iwEvent, IW_EV_LCP_LEN); - memcpy(pcCur + IW_EV_LCP_LEN, - &iwEvent.u.data.length, - sizeof(struct iw_point) - IW_EV_POINT_OFF); -#endif - memcpy(pcCur + IW_EV_POINT_LEN, prDesiredIE, 2 + prDesiredIE->ucLength); - pcCur += iwEvent.len; - } - -#if CFG_SUPPORT_WAPI /* Android+ */ - if (wextSrchDesiredWAPIIE(&prBss->aucIEs[sizeof(PARAM_FIXED_IEs)], - prBss->u4IELength -sizeof(PARAM_FIXED_IEs), - (PUINT_8 *)&prDesiredIE)) { - -#if 0 - iwEvent.cmd = IWEVGENIE; - iwEvent.u.data.flags = 1; - iwEvent.u.data.length = 2 + (__u16)prDesiredIE->ucLength; - iwEvent.len = IW_EV_POINT_LEN + iwEvent.u.data.length; - if ((pcCur + iwEvent.len) > pcEnd) - break; -#if WIRELESS_EXT <= 18 - memcpy(pcCur, &iwEvent, IW_EV_POINT_LEN); -#else - memcpy(pcCur, &iwEvent, IW_EV_LCP_LEN); - memcpy(pcCur + IW_EV_LCP_LEN, - &iwEvent.u.data.length, - sizeof(struct iw_point) - IW_EV_POINT_OFF); -#endif - memcpy(pcCur + IW_EV_POINT_LEN, prDesiredIE, 2 + prDesiredIE->ucLength); - pcCur += iwEvent.len; -#else - iwEvent.cmd = IWEVCUSTOM; - iwEvent.u.data.length = (2 + prDesiredIE->ucLength) * 2 + 8 /* wapi_ie= */; - iwEvent.len = IW_EV_POINT_LEN + iwEvent.u.data.length; - if ((pcCur + iwEvent.len) > pcEnd) - break; - iwEvent.u.data.flags = 1; - - memcpy(pcCur, &iwEvent, IW_EV_LCP_LEN); - memcpy(pcCur + IW_EV_LCP_LEN, - &iwEvent.u.data.length, - sizeof(struct iw_point) - IW_EV_POINT_OFF); - - pcCur += (IW_EV_POINT_LEN); - - pcCur += sprintf(pcCur, "wapi_ie="); - - snprintf_hex(pcCur, pcEnd - pcCur, (UINT_8 *)prDesiredIE, prDesiredIE->ucLength + 2); - - pcCur += (2 + prDesiredIE->ucLength) * 2 /* iwEvent.len */; -#endif - } -#endif - /* Complete an entry. Update end of valid entry */ - pcValidEntryEnd = pcCur; - /* Extract next bss */ - prBss = (P_PARAM_BSSID_EX_T)((char *)prBss + prBss->u4Length); - } - - /* Update valid data length for caller function and upper layer - * applications. - */ - prData->length = (pcValidEntryEnd - pcExtra); - //printk(KERN_INFO "[wifi] buf:%d result:%ld\n", pData->length, u4BufLen); - - //kalIndicateStatusAndComplete(prGlueInfo, WLAN_STATUS_SCAN_COMPLETE, NULL, 0); - -error: - /* free local query buffer */ - if (prList) { - kalMemFree(prList, VIR_MEM_TYPE, u4AllocBufLen); - } - - return ret; -} /* wext_get_scan */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To set desired network name ESSID. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[in] prEssid Pointer of iw_point header. -* \param[in] pcExtra Pointer to buffer srtoring essid string. -* -* \retval 0 If netif_carrier_ok. -* \retval -E2BIG Essid string length is too big. -* \retval -EINVAL pcExtra is null pointer. -* \retval -EFAULT Driver fail to set new essid. -* -* \note If string lengh is ok, device will try connecting to the new network. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_set_essid ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - IN struct iw_point *prEssid, - IN char *pcExtra - ) -{ - PARAM_SSID_T rNewSsid; - UINT_32 cipher; - ENUM_PARAM_ENCRYPTION_STATUS_T eEncStatus; - ENUM_PARAM_AUTH_MODE_T eAuthMode; - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prEssid); - ASSERT(pcExtra); - if (FALSE == GLUE_CHK_PR3(prNetDev, prEssid, pcExtra)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - if (prEssid->length > IW_ESSID_MAX_SIZE) { - return -E2BIG; - } - - - /* set auth mode */ - if (prGlueInfo->rWpaInfo.u4WpaVersion == IW_AUTH_WPA_VERSION_DISABLED) { - eAuthMode = (prGlueInfo->rWpaInfo.u4AuthAlg == IW_AUTH_ALG_OPEN_SYSTEM) ? - AUTH_MODE_OPEN : AUTH_MODE_AUTO_SWITCH; - //printk(KERN_INFO "IW_AUTH_WPA_VERSION_DISABLED->Param_AuthMode%s\n", - // (eAuthMode == AUTH_MODE_OPEN) ? "Open" : "Shared"); - } - else { - /* set auth mode */ - switch(prGlueInfo->rWpaInfo.u4KeyMgmt) { - case IW_AUTH_KEY_MGMT_802_1X: - eAuthMode = - (prGlueInfo->rWpaInfo.u4WpaVersion == IW_AUTH_WPA_VERSION_WPA) ? - AUTH_MODE_WPA : AUTH_MODE_WPA2; - //printk("IW_AUTH_KEY_MGMT_802_1X->AUTH_MODE_WPA%s\n", - // (eAuthMode == AUTH_MODE_WPA) ? "" : "2"); - break; - case IW_AUTH_KEY_MGMT_PSK: - eAuthMode = - (prGlueInfo->rWpaInfo.u4WpaVersion == IW_AUTH_WPA_VERSION_WPA) ? - AUTH_MODE_WPA_PSK: AUTH_MODE_WPA2_PSK; - //printk("IW_AUTH_KEY_MGMT_PSK->AUTH_MODE_WPA%sPSK\n", - // (eAuthMode == AUTH_MODE_WPA_PSK) ? "" : "2"); - break; -#if CFG_SUPPORT_WAPI /* Android+ */ - case IW_AUTH_KEY_MGMT_WAPI_PSK: - break; - case IW_AUTH_KEY_MGMT_WAPI_CERT: - break; -#endif - -//#if defined (IW_AUTH_KEY_MGMT_WPA_NONE) -// case IW_AUTH_KEY_MGMT_WPA_NONE: -// eAuthMode = AUTH_MODE_WPA_NONE; -// //printk("IW_AUTH_KEY_MGMT_WPA_NONE->AUTH_MODE_WPA_NONE\n"); -// break; -//#endif -#if CFG_SUPPORT_802_11W - case IW_AUTH_KEY_MGMT_802_1X_SHA256: - eAuthMode = AUTH_MODE_WPA2; - break; - case IW_AUTH_KEY_MGMT_PSK_SHA256: - eAuthMode = AUTH_MODE_WPA2_PSK; - break; -#endif - default: - //printk(KERN_INFO DRV_NAME"strange IW_AUTH_KEY_MGMT : %ld set auto switch\n", - // prGlueInfo->rWpaInfo.u4KeyMgmt); - eAuthMode = AUTH_MODE_AUTO_SWITCH; - break; - } - } - - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetAuthMode, - &eAuthMode, - sizeof(eAuthMode), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - /* set encryption status */ - cipher = prGlueInfo->rWpaInfo.u4CipherGroup | - prGlueInfo->rWpaInfo.u4CipherPairwise; - if (cipher & IW_AUTH_CIPHER_CCMP) { - //printk("IW_AUTH_CIPHER_CCMP->ENUM_ENCRYPTION3_ENABLED\n"); - eEncStatus = ENUM_ENCRYPTION3_ENABLED; - } - else if (cipher & IW_AUTH_CIPHER_TKIP) { - //printk("IW_AUTH_CIPHER_TKIP->ENUM_ENCRYPTION2_ENABLED\n"); - eEncStatus = ENUM_ENCRYPTION2_ENABLED; - } - else if (cipher & (IW_AUTH_CIPHER_WEP104 | IW_AUTH_CIPHER_WEP40)) { - //printk("IW_AUTH_CIPHER_WEPx->ENUM_ENCRYPTION1_ENABLED\n"); - eEncStatus = ENUM_ENCRYPTION1_ENABLED; - } - else if (cipher & IW_AUTH_CIPHER_NONE){ - //printk("IW_AUTH_CIPHER_NONE->ENUM_ENCRYPTION_DISABLED\n"); - if (prGlueInfo->rWpaInfo.fgPrivacyInvoke) - eEncStatus = ENUM_ENCRYPTION1_ENABLED; - else - eEncStatus = ENUM_ENCRYPTION_DISABLED; - } - else { - //printk("unknown IW_AUTH_CIPHER->Param_EncryptionDisabled\n"); - eEncStatus = ENUM_ENCRYPTION_DISABLED; - } - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetEncryptionStatus, - &eEncStatus, - sizeof(eEncStatus), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - -#if WIRELESS_EXT < 21 - /* GeorgeKuo: a length error bug exists in (WE < 21) cases, kernel before - ** 2.6.19. Cut the trailing '\0'. - */ - rNewSsid.u4SsidLen = (prEssid->length) ? prEssid->length - 1 : 0; -#else - rNewSsid.u4SsidLen = prEssid->length; -#endif - kalMemCopy(rNewSsid.aucSsid, pcExtra, rNewSsid.u4SsidLen); - - /* - rNewSsid.aucSsid[rNewSsid.u4SsidLen] = '\0'; - printk("set ssid(%lu): %s\n", rNewSsid.u4SsidLen, rNewSsid.aucSsid); - */ - - if (kalIoctl(prGlueInfo, - wlanoidSetSsid, - (PVOID) &rNewSsid, - sizeof(PARAM_SSID_T), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen) != WLAN_STATUS_SUCCESS) { - //printk(KERN_WARNING "Fail to set ssid\n"); - return -EFAULT; - } - - - return 0; -} /* wext_set_essid */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To get current network name ESSID. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[in] prEssid Pointer to iw_point structure containing essid information. -* \param[out] pcExtra Pointer to buffer srtoring essid string. -* -* \retval 0 If netif_carrier_ok. -* \retval -ENOTCONN Otherwise. -* -* \note If netif_carrier_ok, network essid is stored in pcExtra. -*/ -/*----------------------------------------------------------------------------*/ -//static PARAM_SSID_T ssid; -static int -wext_get_essid ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - IN struct iw_point *prEssid, - OUT char *pcExtra - ) -{ - //PARAM_SSID_T ssid; - - P_PARAM_SSID_T prSsid; - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prEssid); - ASSERT(pcExtra); - - if (FALSE == GLUE_CHK_PR3(prNetDev, prEssid, pcExtra)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - //if (!netif_carrier_ok(prNetDev)) { - // return -ENOTCONN; - //} - - prSsid = kalMemAlloc(sizeof(PARAM_SSID_T), VIR_MEM_TYPE); - - if(!prSsid) { - return -ENOMEM; - } - - rStatus = kalIoctl(prGlueInfo, - wlanoidQuerySsid, - prSsid, - sizeof(PARAM_SSID_T), - TRUE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - if ((rStatus == WLAN_STATUS_SUCCESS) && (prSsid->u4SsidLen <= MAX_SSID_LEN)) { - kalMemCopy(pcExtra, prSsid->aucSsid, prSsid->u4SsidLen); - prEssid->length = prSsid->u4SsidLen; - prEssid->flags = 1; - } - - kalMemFree(prSsid, VIR_MEM_TYPE, sizeof(PARAM_SSID_T)); - - return 0; -} /* wext_get_essid */ - - -#if 0 - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To set tx desired bit rate. Three cases here -* iwconfig wlan0 auto -> Set to origianl supported rate set. -* iwconfig wlan0 18M -> Imply "fixed" case, set to 18Mbps as desired rate. -* iwconfig wlan0 18M auto -> Set to auto rate lower and equal to 18Mbps -* -* \param[in] prNetDev Pointer to the net_device handler. -* \param[in] prIwReqInfo Pointer to the Request Info. -* \param[in] prRate Pointer to the Rate Parameter. -* \param[in] pcExtra Pointer to the extra buffer. -* -* \retval 0 Update desired rate. -* \retval -EINVAL Wrong parameter -*/ -/*----------------------------------------------------------------------------*/ -int -wext_set_rate ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN struct iw_param *prRate, - IN char *pcExtra - ) -{ - PARAM_RATES_EX aucSuppRate = {0}; - PARAM_RATES_EX aucNewRate = {0}; - UINT_32 u4NewRateLen = 0; - UINT_32 i; - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prRate); - if (FALSE == GLUE_CHK_PR2(prNetDev, prRate)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - /* - printk("value = %d, fixed = %d, disable = %d, flags = %d\n", - prRate->value, prRate->fixed, prRate->disabled, prRate->flags); - */ - - rStatus = wlanQueryInformation( - prGlueInfo->prAdapter, - wlanoidQuerySupportedRates, - &aucSuppRate, - sizeof(aucSuppRate), - &u4BufLen); - - /* Case: AUTO */ - if (prRate->value < 0) { - if (prRate->fixed == 0) { - /* iwconfig wlan0 rate auto */ - - /* set full supported rate to device */ - /* printk("wlanoidQuerySupportedRates():u4BufLen = %ld\n", u4BufLen); */ - rStatus = wlanSetInformation( - prGlueInfo->prAdapter, - wlanoidSetDesiredRates, - &aucSuppRate, - sizeof(aucSuppRate), - &u4BufLen); - return 0; - } - else { - /* iwconfig wlan0 rate fixed */ - - /* fix rate to what? DO NOTHING */ - return -EINVAL; - } - } - - - aucNewRate[0] = prRate->value / 500000; /* In unit of 500k */ - - for (i = 0; i < PARAM_MAX_LEN_RATES_EX; i++) { - /* check the given value is supported */ - if (aucSuppRate[i] == 0) { - break; - } - - if (aucNewRate[0] == aucSuppRate[i]) { - u4NewRateLen = 1; - break; - } - } - - if (u4NewRateLen == 0) { - /* the given value is not supported */ - /* return error or use given rate as upper bound? */ - return -EINVAL; - } - - if (prRate->fixed == 0) { - /* add all rates lower than desired rate */ - for (i = 0; i < PARAM_MAX_LEN_RATES_EX; ++i) { - if (aucSuppRate[i] == 0) { - break; - } - - if (aucSuppRate[i] < aucNewRate[0]) { - aucNewRate[u4NewRateLen++] = aucSuppRate[i]; - } - } - } - - rStatus = wlanSetInformation( - prGlueInfo->prAdapter, - wlanoidSetDesiredRates, - &aucNewRate, - sizeof(aucNewRate), - &u4BufLen); - return 0; -} /* wext_set_rate */ - -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To get current tx bit rate. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[out] prRate Pointer to iw_param structure to store current tx rate. -* \param[in] pcExtra NULL. -* -* \retval 0 If netif_carrier_ok. -* \retval -ENOTCONN Otherwise. -* -* \note If netif_carrier_ok, current tx rate is stored in pRate. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_get_rate ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - OUT struct iw_param *prRate, - IN char *pcExtra - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - UINT_32 u4Rate = 0; - - ASSERT(prNetDev); - ASSERT(prRate); - if (FALSE == GLUE_CHK_PR2(prNetDev, prRate)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - if (!netif_carrier_ok(prNetDev)) { - return -ENOTCONN; - } - - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryLinkSpeed, - &u4Rate, - sizeof(u4Rate), - TRUE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - return -EFAULT; - } - - prRate->value = u4Rate * 100; /* u4Rate is in unit of 100bps */ - prRate->fixed = 0; - - return 0; -} /* wext_get_rate */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To set RTS/CTS theshold. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[in] prRts Pointer to iw_param structure containing rts threshold. -* \param[in] pcExtra NULL. -* -* \retval 0 For success. -* \retval -EINVAL Given value is out of range. -* -* \note If given value is valid, device will follow the new setting. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_set_rts ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - IN struct iw_param *prRts, - IN char *pcExtra - ) -{ - PARAM_RTS_THRESHOLD u4RtsThresh; - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prRts); - if (FALSE == GLUE_CHK_PR2(prNetDev, prRts)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - if (prRts->disabled == 1) { - u4RtsThresh = 2347; - } - else if (prRts->value < 0 || prRts->value > 2347) { - return -EINVAL; - } - else { - u4RtsThresh = (PARAM_RTS_THRESHOLD)prRts->value; - } - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetRtsThreshold, - &u4RtsThresh, - sizeof(u4RtsThresh), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - - - prRts->value = (typeof(prRts->value ))u4RtsThresh; - prRts->disabled = (prRts->value > 2347) ? 1 : 0; - prRts->fixed = 1; - - return 0; -} /* wext_set_rts */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To get RTS/CTS theshold. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[out] prRts Pointer to iw_param structure containing rts threshold. -* \param[in] pcExtra NULL. -* -* \retval 0 Success. -* -* \note RTS threshold is stored in pRts. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_get_rts ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - OUT struct iw_param *prRts, - IN char *pcExtra - ) -{ - PARAM_RTS_THRESHOLD u4RtsThresh; - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prRts); - if (FALSE == GLUE_CHK_PR2(prNetDev, prRts)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryRtsThreshold, - &u4RtsThresh, - sizeof(u4RtsThresh), - TRUE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - - - prRts->value = (typeof(prRts->value ))u4RtsThresh; - prRts->disabled = (prRts->value > 2347 || prRts->value < 0) ? 1 : 0; - prRts->fixed = 1; - - return 0; -} /* wext_get_rts */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To get fragmentation threshold. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[out] prFrag Pointer to iw_param structure containing frag threshold. -* \param[in] pcExtra NULL. -* -* \retval 0 Success. -* -* \note RTS threshold is stored in pFrag. Fragmentation is disabled. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_get_frag ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - OUT struct iw_param *prFrag, - IN char *pcExtra - ) -{ - ASSERT(prFrag); - - prFrag->value = 2346; - prFrag->fixed = 1; - prFrag->disabled = 1; - return 0; -} /* wext_get_frag */ - -#if 1 -/*----------------------------------------------------------------------------*/ -/*! -* \brief To set TX power, or enable/disable the radio. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[in] prTxPow Pointer to iw_param structure containing tx power setting. -* \param[in] pcExtra NULL. -* -* \retval 0 Success. -* -* \note Tx power is stored in pTxPow. iwconfig wlan0 txpow on/off are used -* to enable/disable the radio. -*/ -/*----------------------------------------------------------------------------*/ - -static int -wext_set_txpow ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - IN struct iw_param *prTxPow, - IN char *pcExtra - ) -{ - int ret = 0; - //PARAM_DEVICE_POWER_STATE ePowerState; - ENUM_ACPI_STATE_T ePowerState; - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prTxPow); - if (FALSE == GLUE_CHK_PR2(prNetDev, prTxPow)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - if(prTxPow->disabled){ - /* <1> disconnect */ - rStatus = kalIoctl(prGlueInfo, - wlanoidSetDisassociate, - NULL, - 0, - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, INFO, ("######set disassoc failed\n")); - } else { - DBGLOG(INIT, INFO, ("######set assoc ok\n")); - } - - /* <2> mark to power state flag*/ - ePowerState = ACPI_STATE_D0; - DBGLOG(INIT, INFO, ("set to acpi d3(0)\n")); - wlanSetAcpiState(prGlueInfo->prAdapter, ePowerState); - - } - else { - ePowerState = ACPI_STATE_D0; - DBGLOG(INIT, INFO, ("set to acpi d0\n")); - wlanSetAcpiState(prGlueInfo->prAdapter, ePowerState); - } - - prGlueInfo->ePowerState = ePowerState; - - return ret; -} /* wext_set_txpow */ - - -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To get TX power. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[out] prTxPow Pointer to iw_param structure containing tx power setting. -* \param[in] pcExtra NULL. -* -* \retval 0 Success. -* -* \note Tx power is stored in pTxPow. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_get_txpow ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - OUT struct iw_param *prTxPow, - IN char *pcExtra - ) -{ - //PARAM_DEVICE_POWER_STATE ePowerState; - - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prNetDev); - ASSERT(prTxPow); - if (FALSE == GLUE_CHK_PR2(prNetDev, prTxPow)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - /* GeorgeKuo: wlanoidQueryAcpiDevicePowerState() reports capability, not - * current state. Use GLUE_INFO_T to store state. - */ - //ePowerState = prGlueInfo->ePowerState; - - /* TxPow parameters: Fixed at relative 100% */ -#if WIRELESS_EXT < 17 - prTxPow->flags = 0x0002; /* IW_TXPOW_RELATIVE */ -#else - prTxPow->flags = IW_TXPOW_RELATIVE; -#endif - prTxPow->value = 100; - prTxPow->fixed = 1; - //prTxPow->disabled = (ePowerState != ParamDeviceStateD3) ? FALSE : TRUE; - prTxPow->disabled = TRUE; - - return 0; -} /* wext_get_txpow */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To get encryption cipher and key. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[out] prEnc Pointer to iw_point structure containing securiry information. -* \param[in] pcExtra Buffer to store key content. -* -* \retval 0 Success. -* -* \note Securiry information is stored in pEnc except key content. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_get_encode ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - OUT struct iw_point *prEnc, - IN char *pcExtra - ) -{ -#if 1 - //ENUM_ENCRYPTION_STATUS_T eEncMode; - ENUM_PARAM_ENCRYPTION_STATUS_T eEncMode; - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prEnc); - if (FALSE == GLUE_CHK_PR2(prNetDev, prEnc)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryEncryptionStatus, - &eEncMode, - sizeof(eEncMode), - TRUE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - - - switch(eEncMode) { - case ENUM_WEP_DISABLED: - prEnc->flags = IW_ENCODE_DISABLED; - break; - case ENUM_WEP_ENABLED: - prEnc->flags = IW_ENCODE_ENABLED; - break; - case ENUM_WEP_KEY_ABSENT: - prEnc->flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; - break; - default: - prEnc->flags = IW_ENCODE_ENABLED; - break; - } - - /* Cipher, Key Content, Key ID can't be queried */ - prEnc->flags |= IW_ENCODE_NOKEY; -#endif - return 0; -} /* wext_get_encode */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To set encryption cipher and key. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[in] prEnc Pointer to iw_point structure containing securiry information. -* \param[in] pcExtra Pointer to key string buffer. -* -* \retval 0 Success. -* \retval -EINVAL Key ID error for WEP. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note Securiry information is stored in pEnc. -*/ -/*----------------------------------------------------------------------------*/ -static UINT_8 wepBuf[48]; - -static int -wext_set_encode ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - IN struct iw_point *prEnc, - IN char *pcExtra - ) -{ -#if 1 - ENUM_PARAM_ENCRYPTION_STATUS_T eEncStatus; - ENUM_PARAM_AUTH_MODE_T eAuthMode; - //UINT_8 wepBuf[48]; - P_PARAM_WEP_T prWepKey = (P_PARAM_WEP_T) wepBuf; - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prEnc); - ASSERT(pcExtra); - if (FALSE == GLUE_CHK_PR3(prNetDev, prEnc, pcExtra)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - /* reset to default mode */ - prGlueInfo->rWpaInfo.u4WpaVersion = IW_AUTH_WPA_VERSION_DISABLED; - prGlueInfo->rWpaInfo.u4KeyMgmt = 0; - prGlueInfo->rWpaInfo.u4CipherPairwise = IW_AUTH_CIPHER_NONE; - prGlueInfo->rWpaInfo.u4CipherGroup = IW_AUTH_CIPHER_NONE; - prGlueInfo->rWpaInfo.u4AuthAlg = IW_AUTH_ALG_OPEN_SYSTEM; -#if CFG_SUPPORT_802_11W - prGlueInfo->rWpaInfo.u4Mfp = IW_AUTH_MFP_DISABLED; -#endif - - /* iwconfig wlan0 key off */ - if ( (prEnc->flags & IW_ENCODE_MODE) == IW_ENCODE_DISABLED ) { - eAuthMode = AUTH_MODE_OPEN; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetAuthMode, - &eAuthMode, - sizeof(eAuthMode), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - eEncStatus = ENUM_ENCRYPTION_DISABLED; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetEncryptionStatus, - &eEncStatus, - sizeof(eEncStatus), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - return 0; - } - - /* iwconfig wlan0 key 0123456789 */ - /* iwconfig wlan0 key s:abcde */ - /* iwconfig wlan0 key 0123456789 [1] */ - /* iwconfig wlan0 key 01234567890123456789012345 [1] */ - /* check key size for WEP */ - if (prEnc->length == 5 || prEnc->length == 13 || prEnc->length == 16) { - /* prepare PARAM_WEP key structure */ - prWepKey->u4KeyIndex = (prEnc->flags & IW_ENCODE_INDEX) ? - (prEnc->flags & IW_ENCODE_INDEX) -1 : 0; - if (prWepKey->u4KeyIndex > 3) { - /* key id is out of range */ - return -EINVAL; - } - prWepKey->u4KeyIndex |= 0x80000000; - prWepKey->u4Length = 12 + prEnc->length; - prWepKey->u4KeyLength = prEnc->length; - kalMemCopy(prWepKey->aucKeyMaterial, pcExtra, prEnc->length); - - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetAddWep, - prWepKey, - prWepKey->u4Length, - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, INFO, ("wlanoidSetAddWep fail 0x%lx\n", rStatus)); - return -EFAULT; - } - - /* change to auto switch */ - prGlueInfo->rWpaInfo.u4AuthAlg = IW_AUTH_ALG_SHARED_KEY | - IW_AUTH_ALG_OPEN_SYSTEM; - eAuthMode = AUTH_MODE_AUTO_SWITCH; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetAuthMode, - &eAuthMode, - sizeof(eAuthMode), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - //printk(KERN_INFO DRV_NAME"wlanoidSetAuthMode fail 0x%lx\n", rStatus); - return -EFAULT; - } - - prGlueInfo->rWpaInfo.u4CipherPairwise = - IW_AUTH_CIPHER_WEP104 | IW_AUTH_CIPHER_WEP40; - prGlueInfo->rWpaInfo.u4CipherGroup = - IW_AUTH_CIPHER_WEP104 | IW_AUTH_CIPHER_WEP40; - - eEncStatus = ENUM_WEP_ENABLED; - - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetEncryptionStatus, - &eEncStatus, - sizeof(ENUM_PARAM_ENCRYPTION_STATUS_T), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - //printk(KERN_INFO DRV_NAME"wlanoidSetEncryptionStatus fail 0x%lx\n", rStatus); - return -EFAULT; - } - - return 0; - } -#endif - return -EOPNOTSUPP; -} /* wext_set_encode */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To set power management. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[in] prPower Pointer to iw_param structure containing tx power setting. -* \param[in] pcExtra NULL. -* -* \retval 0 Success. -* -* \note New Power Management Mode is set to driver. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_set_power ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - IN struct iw_param *prPower, - IN char *pcExtra - ) -{ -#if 1 - PARAM_POWER_MODE ePowerMode; - INT_32 i4PowerValue; - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prPower); - if (FALSE == GLUE_CHK_PR2(prNetDev, prPower)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - //printk(KERN_INFO "wext_set_power value(%d) disabled(%d) flag(0x%x)\n", - // prPower->value, prPower->disabled, prPower->flags); - - if(prPower->disabled){ - ePowerMode = Param_PowerModeCAM; - } - else { - i4PowerValue = prPower->value; -#if WIRELESS_EXT < 21 - i4PowerValue /= 1000000; -#endif - if (i4PowerValue == 0) { - ePowerMode = Param_PowerModeCAM; - } else if (i4PowerValue == 1) { - ePowerMode = Param_PowerModeMAX_PSP; - } else if (i4PowerValue == 2) { - ePowerMode = Param_PowerModeFast_PSP; - } - else { - DBGLOG(INIT, INFO, ("%s(): unsupported power management mode value = %d.\n", - __FUNCTION__, - prPower->value)); - - return -EINVAL; - } - } - - - rStatus = kalIoctl(prGlueInfo, - wlanoidSet802dot11PowerSaveProfile, - &ePowerMode, - sizeof(ePowerMode), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - //printk(KERN_INFO DRV_NAME"wlanoidSet802dot11PowerSaveProfile fail 0x%lx\n", rStatus); - return -EFAULT; - } - -#endif - return 0; -} /* wext_set_power */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To get power management. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[out] prPower Pointer to iw_param structure containing tx power setting. -* \param[in] pcExtra NULL. -* -* \retval 0 Success. -* -* \note Power management mode is stored in pTxPow->value. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_get_power ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - OUT struct iw_param *prPower, - IN char *pcExtra - ) -{ - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - PARAM_POWER_MODE ePowerMode = Param_PowerModeCAM; - - ASSERT(prNetDev); - ASSERT(prPower); - if (FALSE == GLUE_CHK_PR2(prNetDev, prPower)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - -#if 0 -#if defined(_HIF_SDIO) - rStatus = sdio_io_ctrl(prGlueInfo, - wlanoidQuery802dot11PowerSaveProfile, - &ePowerMode, - sizeof(ePowerMode), - TRUE, - TRUE, - &u4BufLen); -#else - rStatus = wlanQueryInformation(prGlueInfo->prAdapter, - wlanoidQuery802dot11PowerSaveProfile, - &ePowerMode, - sizeof(ePowerMode), - &u4BufLen); -#endif -#else - rStatus = wlanQueryInformation(prGlueInfo->prAdapter, - wlanoidQuery802dot11PowerSaveProfile, - &ePowerMode, - sizeof(ePowerMode), - &u4BufLen); -#endif - - if (rStatus != WLAN_STATUS_SUCCESS) { - return -EFAULT; - } - - prPower->value = 0; - prPower->disabled = 1; - - if (Param_PowerModeCAM == ePowerMode) { - prPower->value = 0; - prPower->disabled = 1; - } - else if (Param_PowerModeMAX_PSP == ePowerMode ) { - prPower->value = 1; - prPower->disabled = 0; - } - else if (Param_PowerModeFast_PSP == ePowerMode ) { - prPower->value = 2; - prPower->disabled = 0; - } - - prPower->flags = IW_POWER_PERIOD | IW_POWER_RELATIVE; -#if WIRELESS_EXT < 21 - prPower->value *= 1000000; -#endif - - //printk(KERN_INFO "wext_get_power value(%d) disabled(%d) flag(0x%x)\n", - // prPower->value, prPower->disabled, prPower->flags); - - return 0; -} /* wext_get_power */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To set authentication parameters. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[in] rpAuth Pointer to iw_param structure containing authentication information. -* \param[in] pcExtra Pointer to key string buffer. -* -* \retval 0 Success. -* \retval -EINVAL Key ID error for WEP. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note Securiry information is stored in pEnc. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_set_auth ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - IN struct iw_param *prAuth, - IN char *pcExtra - ) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prNetDev); - ASSERT(prAuth); - if (FALSE == GLUE_CHK_PR2(prNetDev, prAuth)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - /* Save information to glue info and process later when ssid is set. */ - switch(prAuth->flags & IW_AUTH_INDEX) { - case IW_AUTH_WPA_VERSION: -#if CFG_SUPPORT_WAPI - if (wlanQueryWapiMode(prGlueInfo->prAdapter)){ - prGlueInfo->rWpaInfo.u4WpaVersion = IW_AUTH_WPA_VERSION_DISABLED; - prGlueInfo->rWpaInfo.u4AuthAlg = IW_AUTH_ALG_OPEN_SYSTEM; - } - else { - prGlueInfo->rWpaInfo.u4WpaVersion = prAuth->value; - } -#else - prGlueInfo->rWpaInfo.u4WpaVersion = prAuth->value; -#endif - break; - - case IW_AUTH_CIPHER_PAIRWISE: - prGlueInfo->rWpaInfo.u4CipherPairwise = prAuth->value; - break; - - case IW_AUTH_CIPHER_GROUP: - prGlueInfo->rWpaInfo.u4CipherGroup = prAuth->value; - break; - - case IW_AUTH_KEY_MGMT: - prGlueInfo->rWpaInfo.u4KeyMgmt = prAuth->value; -#if CFG_SUPPORT_WAPI - if (prGlueInfo->rWpaInfo.u4KeyMgmt == IW_AUTH_KEY_MGMT_WAPI_PSK || - prGlueInfo->rWpaInfo.u4KeyMgmt == IW_AUTH_KEY_MGMT_WAPI_CERT) { - UINT_32 u4BufLen; - WLAN_STATUS rStatus; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetWapiMode, - &prAuth->value, - sizeof(UINT_32), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - DBGLOG(INIT, INFO, ("IW_AUTH_WAPI_ENABLED :%d\n", prAuth->value)); - } -#endif - if (prGlueInfo->rWpaInfo.u4KeyMgmt == IW_AUTH_KEY_MGMT_WPS) - prGlueInfo->fgWpsActive = TRUE; - else - prGlueInfo->fgWpsActive = FALSE; - break; - - case IW_AUTH_80211_AUTH_ALG: - prGlueInfo->rWpaInfo.u4AuthAlg = prAuth->value; - break; - - case IW_AUTH_PRIVACY_INVOKED: - prGlueInfo->rWpaInfo.fgPrivacyInvoke = prAuth->value; - break; -#if CFG_SUPPORT_802_11W - case IW_AUTH_MFP: - //printk("wext_set_auth IW_AUTH_MFP=%d\n", prAuth->value); - prGlueInfo->rWpaInfo.u4Mfp = prAuth->value; - break; -#endif -#if CFG_SUPPORT_WAPI - case IW_AUTH_WAPI_ENABLED: - { - UINT_32 u4BufLen; - WLAN_STATUS rStatus; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetWapiMode, - &prAuth->value, - sizeof(UINT_32), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - } - DBGLOG(INIT, INFO, ("IW_AUTH_WAPI_ENABLED :%d\n", prAuth->value)); - break; -#endif - default: - /* - printk(KERN_INFO "[wifi] unsupported IW_AUTH_INDEX :%d\n", prAuth->flags); - */ - break; - } - return 0; -} /* wext_set_auth */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To set encryption cipher and key. -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[in] prEnc Pointer to iw_point structure containing securiry information. -* \param[in] pcExtra Pointer to key string buffer. -* -* \retval 0 Success. -* \retval -EINVAL Key ID error for WEP. -* \retval -EFAULT Setting parameters to driver fail. -* \retval -EOPNOTSUPP Key size not supported. -* -* \note Securiry information is stored in pEnc. -*/ -/*----------------------------------------------------------------------------*/ -#if CFG_SUPPORT_WAPI - UINT_8 keyStructBuf[320]; /* add/remove key shared buffer */ -#else - UINT_8 keyStructBuf[100]; /* add/remove key shared buffer */ -#endif - -static int -wext_set_encode_ext ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwrInfo, - IN struct iw_point *prEnc, - IN char *pcExtra - ) -{ - P_PARAM_REMOVE_KEY_T prRemoveKey = (P_PARAM_REMOVE_KEY_T) keyStructBuf; - P_PARAM_KEY_T prKey = (P_PARAM_KEY_T) keyStructBuf; - - - P_PARAM_WEP_T prWepKey = (P_PARAM_WEP_T) wepBuf; - - struct iw_encode_ext *prIWEncExt = (struct iw_encode_ext *) pcExtra; - - ENUM_PARAM_ENCRYPTION_STATUS_T eEncStatus; - ENUM_PARAM_AUTH_MODE_T eAuthMode; - //ENUM_PARAM_OP_MODE_T eOpMode = NET_TYPE_AUTO_SWITCH; - -#if CFG_SUPPORT_WAPI - P_PARAM_WPI_KEY_T prWpiKey = (P_PARAM_WPI_KEY_T) keyStructBuf; -#endif - - P_GLUE_INFO_T prGlueInfo = NULL; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - ASSERT(prEnc); - if (FALSE == GLUE_CHK_PR3(prNetDev, prEnc, pcExtra)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - memset(keyStructBuf, 0, sizeof(keyStructBuf)); - -#if CFG_SUPPORT_WAPI - if (prIWEncExt->alg == IW_ENCODE_ALG_SMS4) { - if (prEnc->flags & IW_ENCODE_DISABLED) { - //printk(KERN_INFO "[wapi] IW_ENCODE_DISABLED\n"); - return 0; - } - /* KeyID */ - prWpiKey->ucKeyID = (prEnc->flags & IW_ENCODE_INDEX); - prWpiKey->ucKeyID --; - if (prWpiKey->ucKeyID > 1) { - /* key id is out of range */ - //printk(KERN_INFO "[wapi] add key error: key_id invalid %d\n", prWpiKey->ucKeyID); - return -EINVAL; - } - - if (prIWEncExt->key_len != 32) { - /* key length not valid */ - //printk(KERN_INFO "[wapi] add key error: key_len invalid %d\n", prIWEncExt->key_len); - return -EINVAL; - } - - //printk(KERN_INFO "[wapi] %d ext_flags %d\n", prEnc->flags, prIWEncExt->ext_flags); - - if (prIWEncExt->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { - prWpiKey->eKeyType = ENUM_WPI_GROUP_KEY; - prWpiKey->eDirection = ENUM_WPI_RX; - } - else if (prIWEncExt->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { - prWpiKey->eKeyType = ENUM_WPI_PAIRWISE_KEY; - prWpiKey->eDirection = ENUM_WPI_RX_TX; - } - - /* PN */ - memcpy(prWpiKey->aucPN, prIWEncExt->tx_seq, IW_ENCODE_SEQ_MAX_SIZE * 2); - - /* BSSID */ - memcpy(prWpiKey->aucAddrIndex, prIWEncExt->addr.sa_data, 6); - - memcpy(prWpiKey->aucWPIEK, prIWEncExt->key, 16); - prWpiKey->u4LenWPIEK = 16; - - memcpy(prWpiKey->aucWPICK, &prIWEncExt->key[16], 16); - prWpiKey->u4LenWPICK = 16; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetWapiKey, - prWpiKey, - sizeof(PARAM_WPI_KEY_T), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - //printk(KERN_INFO "[wapi] add key error:%lx\n", rStatus); - } - - } - else -#endif - { - - if ( (prEnc->flags & IW_ENCODE_MODE) == IW_ENCODE_DISABLED) { - prRemoveKey->u4Length = sizeof(*prRemoveKey); - memcpy(prRemoveKey->arBSSID, prIWEncExt->addr.sa_data, 6); - /* - printk("IW_ENCODE_DISABLED: ID:%d, Addr:[" MACSTR "]\n", - prRemoveKey->KeyIndex, MAC2STR(prRemoveKey->BSSID)); - */ - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetRemoveKey, - prRemoveKey, - prRemoveKey->u4Length, - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, INFO, ("remove key error:%lx\n", rStatus)); - } - return 0; - } - - //return 0; - //printk ("alg %x\n", prIWEncExt->alg); - - switch (prIWEncExt->alg) { - case IW_ENCODE_ALG_NONE: - break; - case IW_ENCODE_ALG_WEP: - /* iwconfig wlan0 key 0123456789 */ - /* iwconfig wlan0 key s:abcde */ - /* iwconfig wlan0 key 0123456789 [1] */ - /* iwconfig wlan0 key 01234567890123456789012345 [1] */ - /* check key size for WEP */ - if (prIWEncExt->key_len == 5 || prIWEncExt->key_len == 13 || prIWEncExt->key_len == 16) { - /* prepare PARAM_WEP key structure */ - prWepKey->u4KeyIndex = (prEnc->flags & IW_ENCODE_INDEX) ? - (prEnc->flags & IW_ENCODE_INDEX) -1 : 0; - if (prWepKey->u4KeyIndex > 3) { - /* key id is out of range */ - return -EINVAL; - } - prWepKey->u4KeyIndex |= 0x80000000; - prWepKey->u4Length = 12 + prIWEncExt->key_len; - prWepKey->u4KeyLength = prIWEncExt->key_len; - //kalMemCopy(prWepKey->aucKeyMaterial, pcExtra, prIWEncExt->key_len); - kalMemCopy(prWepKey->aucKeyMaterial, prIWEncExt->key, prIWEncExt->key_len); - - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetAddWep, - prWepKey, - prWepKey->u4Length, - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, INFO, ("wlanoidSetAddWep fail 0x%lx\n", rStatus)); - return -EFAULT; - } - - /* change to auto switch */ - prGlueInfo->rWpaInfo.u4AuthAlg = IW_AUTH_ALG_SHARED_KEY | - IW_AUTH_ALG_OPEN_SYSTEM; - eAuthMode = AUTH_MODE_AUTO_SWITCH; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetAuthMode, - &eAuthMode, - sizeof(eAuthMode), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, INFO, ("wlanoidSetAuthMode fail 0x%lx\n", rStatus)); - return -EFAULT; - } - - prGlueInfo->rWpaInfo.u4CipherPairwise = - IW_AUTH_CIPHER_WEP104 | IW_AUTH_CIPHER_WEP40; - prGlueInfo->rWpaInfo.u4CipherGroup = - IW_AUTH_CIPHER_WEP104 | IW_AUTH_CIPHER_WEP40; - - eEncStatus = ENUM_WEP_ENABLED; - - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetEncryptionStatus, - &eEncStatus, - sizeof(ENUM_PARAM_ENCRYPTION_STATUS_T), - FALSE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, INFO, ("wlanoidSetEncryptionStatus fail 0x%lx\n", rStatus)); - return -EFAULT; - } - - } else { - DBGLOG(INIT, INFO, ("key length %x\n", prIWEncExt->key_len)); - DBGLOG(INIT, INFO, ("key error\n")); - } - - break; - case IW_ENCODE_ALG_TKIP: - case IW_ENCODE_ALG_CCMP: -#if CFG_SUPPORT_802_11W - case IW_ENCODE_ALG_AES_CMAC: -#endif - { - - /* KeyID */ - prKey->u4KeyIndex = (prEnc->flags & IW_ENCODE_INDEX) ? - (prEnc->flags & IW_ENCODE_INDEX) -1: 0; -#if CFG_SUPPORT_802_11W - if (prKey->u4KeyIndex > 5) -#else - if (prKey->u4KeyIndex > 3) -#endif - { - DBGLOG(INIT, INFO, ("key index error:0x%lx\n", prKey->u4KeyIndex)); - /* key id is out of range */ - return -EINVAL; - } - - /* bit(31) and bit(30) are shared by pKey and pRemoveKey */ - /* Tx Key Bit(31)*/ - if (prIWEncExt->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { - prKey->u4KeyIndex |= 0x1UL << 31; - } - - /* Pairwise Key Bit(30) */ - if (prIWEncExt->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { - /* group key */ - } - else { - /* pairwise key */ - prKey->u4KeyIndex |= 0x1UL << 30; - } - - } - /* Rx SC Bit(29) */ - if (prIWEncExt->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) { - prKey->u4KeyIndex |= 0x1UL << 29; - memcpy(&prKey->rKeyRSC, prIWEncExt->rx_seq, IW_ENCODE_SEQ_MAX_SIZE); - } - - /* BSSID */ - memcpy(prKey->arBSSID, prIWEncExt->addr.sa_data, 6); - - /* switch tx/rx MIC key for sta */ - if (prIWEncExt->alg == IW_ENCODE_ALG_TKIP && prIWEncExt->key_len == 32) { - memcpy(prKey->aucKeyMaterial, prIWEncExt->key, 16); - memcpy(((PUINT_8)prKey->aucKeyMaterial) + 16, prIWEncExt->key + 24, 8); - memcpy((prKey->aucKeyMaterial) + 24, prIWEncExt->key + 16, 8); - } - else { - memcpy(prKey->aucKeyMaterial, prIWEncExt->key, prIWEncExt->key_len); - } - - prKey->u4KeyLength = prIWEncExt->key_len; - prKey->u4Length = ((UINT_32)&(((P_PARAM_KEY_T)0)->aucKeyMaterial)) + prKey->u4KeyLength; - - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetAddKey, - prKey, - prKey->u4Length, - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, INFO, ("add key error:%lx\n", rStatus)); - return -EFAULT; - } - break; - } - } - - return 0; -} /* wext_set_encode_ext */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Set country code -* -* \param[in] prDev Net device requested. -* \param[in] prIwrInfo NULL. -* \param[in] pu4Mode Pointer to new operation mode. -* \param[in] pcExtra NULL. -* -* \retval 0 For success. -* \retval -EOPNOTSUPP If new mode is not supported. -* -* \note Device will run in new operation mode if it is valid. -*/ -/*----------------------------------------------------------------------------*/ -static int -wext_set_country ( - IN struct net_device *prNetDev, - IN struct iwreq *iwr - ) -{ - P_GLUE_INFO_T prGlueInfo; - WLAN_STATUS rStatus; - UINT_32 u4BufLen; - UINT_8 aucCountry[2]; - - ASSERT(prNetDev); - - /* iwr->u.data.pointer should be like "COUNTRY US", "COUNTRY EU" - * and "COUNTRY JP" - */ - if (FALSE == GLUE_CHK_PR2(prNetDev, iwr) || - !iwr->u.data.pointer || iwr->u.data.length < 10) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - aucCountry[0] = *((PUINT_8)iwr->u.data.pointer + 8); - aucCountry[1] = *((PUINT_8)iwr->u.data.pointer + 9); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetCountryCode, - &aucCountry[0], - 2, - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - return 0; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief ioctl() (Linux Wireless Extensions) routines -* -* \param[in] prDev Net device requested. -* \param[in] ifr The ifreq structure for seeting the wireless extension. -* \param[in] i4Cmd The wireless extension ioctl command. -* -* \retval zero On success. -* \retval -EOPNOTSUPP If the cmd is not supported. -* \retval -EFAULT If copy_to_user goes wrong. -* \retval -EINVAL If any value's out of range. -* -* \note -*/ -/*----------------------------------------------------------------------------*/ -int -wext_support_ioctl ( - IN struct net_device *prDev, - IN struct ifreq *prIfReq, - IN int i4Cmd - ) -{ - /* prIfReq is verified in the caller function wlanDoIOCTL() */ - struct iwreq *iwr = (struct iwreq*)prIfReq; - struct iw_request_info rIwReqInfo; - int ret = 0; - char *prExtraBuf = NULL; - UINT_32 u4ExtraSize = 0; - - /* prDev is verified in the caller function wlanDoIOCTL() */ - - printk("%d CMD:0x%x\n", jiffies_to_msecs(jiffies), i4Cmd); - - /* Prepare the call */ - rIwReqInfo.cmd = (__u16)i4Cmd; - rIwReqInfo.flags = 0; - - switch (i4Cmd) { - case SIOCGIWNAME: /* 0x8B01, get wireless protocol name */ - ret = wext_get_name(prDev, &rIwReqInfo, (char *)&iwr->u.name, NULL); - break; - - /* case SIOCSIWNWID: 0x8B02, deprecated */ - /* case SIOCGIWNWID: 0x8B03, deprecated */ - - case SIOCSIWFREQ: /* 0x8B04, set channel */ - ret = wext_set_freq(prDev, NULL, &iwr->u.freq, NULL); - break; - - case SIOCGIWFREQ: /* 0x8B05, get channel */ - ret = wext_get_freq(prDev, NULL, &iwr->u.freq, NULL); - break; - - case SIOCSIWMODE: /* 0x8B06, set operation mode */ - ret = wext_set_mode(prDev, NULL, &iwr->u.mode, NULL); - //ret = 0; - break; - - case SIOCGIWMODE: /* 0x8B07, get operation mode */ - ret = wext_get_mode(prDev, NULL, &iwr->u.mode, NULL); - break; - - /* case SIOCSIWSENS: 0x8B08, unsupported */ - /* case SIOCGIWSENS: 0x8B09, unsupported */ - - /* case SIOCSIWRANGE: 0x8B0A, unused */ - case SIOCGIWRANGE: /* 0x8B0B, get range of parameters */ - if (iwr->u.data.pointer != NULL) { - /* Buffer size shoule be large enough */ - if (iwr->u.data.length < sizeof(struct iw_range)) { - ret = -E2BIG; - break; - } - - prExtraBuf = kalMemAlloc(sizeof(struct iw_range), VIR_MEM_TYPE); - if (!prExtraBuf) { - ret = - ENOMEM; - break; - } - - /* reset all fields */ - memset(prExtraBuf, 0, sizeof(struct iw_range)); - iwr->u.data.length = sizeof(struct iw_range); - - ret = wext_get_range(prDev, NULL, &iwr->u.data, prExtraBuf); - /* Push up to the caller */ - if (copy_to_user(iwr->u.data.pointer, - prExtraBuf, - iwr->u.data.length)) { - ret = -EFAULT; - } - - kalMemFree(prExtraBuf, VIR_MEM_TYPE, sizeof(struct iw_range)); - prExtraBuf = NULL; - } - else { - ret = -EINVAL; - } - break; - - case SIOCSIWPRIV: /* 0x8B0C, Country */ - ret = wext_set_country(prDev, iwr); - break; - - /* case SIOCGIWPRIV: 0x8B0D, handled in wlan_do_ioctl() */ - /* caes SIOCSIWSTATS: 0x8B0E, unused */ - /* case SIOCGIWSTATS: - get statistics, intercepted by wireless_process_ioctl() in wireless.c, - redirected to dev_iwstats(), dev->get_wireless_stats(). - */ - /* case SIOCSIWSPY: 0x8B10, unsupported */ - /* case SIOCGIWSPY: 0x8B11, unsupported*/ - /* case SIOCSIWTHRSPY: 0x8B12, unsupported */ - /* case SIOCGIWTHRSPY: 0x8B13, unsupported*/ - - case SIOCSIWAP: /* 0x8B14, set access point MAC addresses (BSSID) */ - if (iwr->u.ap_addr.sa_data[0] == 0 && - iwr->u.ap_addr.sa_data[1] == 0 && - iwr->u.ap_addr.sa_data[2] == 0 && - iwr->u.ap_addr.sa_data[3] == 0 && - iwr->u.ap_addr.sa_data[4] == 0 && - iwr->u.ap_addr.sa_data[5] == 0) { - /* WPA Supplicant will set 000000000000 in - ** wpa_driver_wext_deinit(), do nothing here or disassoc again? - */ - ret = 0; - break; - } - else { - ret = wext_set_ap(prDev, NULL, &iwr->u.ap_addr, NULL); - } - break; - - case SIOCGIWAP: /* 0x8B15, get access point MAC addresses (BSSID) */ - ret = wext_get_ap(prDev, NULL, &iwr->u.ap_addr, NULL); - break; - - case SIOCSIWMLME: /* 0x8B16, request MLME operation */ - /* Fixed length structure */ - if (iwr->u.data.length != sizeof(struct iw_mlme)) { - DBGLOG(INIT, INFO, ("MLME buffer strange:%d\n", iwr->u.data.length)); - ret = -EINVAL; - break; - } - - if (!iwr->u.data.pointer) { - ret = -EINVAL; - break; - } - - prExtraBuf = kalMemAlloc(sizeof(struct iw_mlme), VIR_MEM_TYPE); - if (!prExtraBuf) { - ret = - ENOMEM; - break; - } - - if (copy_from_user(prExtraBuf, iwr->u.data.pointer, sizeof(struct iw_mlme))) { - ret = -EFAULT; - } - else { - ret = wext_set_mlme(prDev, NULL, &(iwr->u.data), prExtraBuf); - } - - kalMemFree(prExtraBuf, VIR_MEM_TYPE, sizeof(struct iw_mlme)); - prExtraBuf = NULL; - break; - - /* case SIOCGIWAPLIST: 0x8B17, deprecated */ - case SIOCSIWSCAN: /* 0x8B18, scan request */ - if (iwr->u.data.pointer == NULL) { - ret = wext_set_scan(prDev, NULL, NULL, NULL); - } -#if WIRELESS_EXT > 17 - else if (iwr->u.data.length == sizeof(struct iw_scan_req)) { - prExtraBuf = kalMemAlloc(MAX_SSID_LEN, VIR_MEM_TYPE); - if (!prExtraBuf) { - ret = -ENOMEM; - break; - } - if (copy_from_user(prExtraBuf, ((struct iw_scan_req *) (iwr->u.data.pointer))->essid, - ((struct iw_scan_req *) (iwr->u.data.pointer))->essid_len)) { - ret = -EFAULT; - } else { - ret = wext_set_scan(prDev, NULL, (union iwreq_data *) &(iwr->u.data), prExtraBuf); - } - - kalMemFree(prExtraBuf, VIR_MEM_TYPE, MAX_SSID_LEN); - prExtraBuf = NULL; - } -#endif - else { - ret = -EINVAL; - } - break; -#if 1 - case SIOCGIWSCAN: /* 0x8B19, get scan results */ - if (!iwr->u.data.pointer|| !iwr->u.essid.pointer) { - ret = -EINVAL; - break; - } - - u4ExtraSize = iwr->u.data.length; - /* allocate the same size of kernel buffer to store scan results. */ - prExtraBuf = kalMemAlloc(u4ExtraSize, VIR_MEM_TYPE); - if (!prExtraBuf) { - ret = - ENOMEM; - break; - } - - /* iwr->u.data.length may be updated by wext_get_scan() */ - ret = wext_get_scan(prDev, NULL, &iwr->u.data, prExtraBuf); - if (ret != 0) { - if (ret == -E2BIG) { - DBGLOG(INIT, INFO, ("[wifi] wext_get_scan -E2BIG\n")); - } - } - else { - /* check updated length is valid */ - ASSERT(iwr->u.data.length <= u4ExtraSize); - if (iwr->u.data.length > u4ExtraSize) { - DBGLOG(INIT, INFO, ("Updated result length is larger than allocated (%d > %ld)\n", - iwr->u.data.length, u4ExtraSize)); - iwr->u.data.length = u4ExtraSize; - } - - if (copy_to_user(iwr->u.data.pointer, - prExtraBuf, - iwr->u.data.length)) { - ret = -EFAULT; - } - } - - kalMemFree(prExtraBuf, VIR_MEM_TYPE, u4ExtraSize); - prExtraBuf = NULL; - - break; - -#endif - -#if 1 - case SIOCSIWESSID: /* 0x8B1A, set SSID (network name) */ - if (iwr->u.essid.length > IW_ESSID_MAX_SIZE) { - ret = -E2BIG; - break; - } - if (!iwr->u.essid.pointer) { - ret = -EINVAL; - break; - } - - prExtraBuf = kalMemAlloc(IW_ESSID_MAX_SIZE + 4, VIR_MEM_TYPE); - if (!prExtraBuf) { - ret = - ENOMEM; - break; - } - - if (copy_from_user(prExtraBuf, - iwr->u.essid.pointer, - iwr->u.essid.length)) { - ret = -EFAULT; - } - else { - /* Add trailing '\0' for printk */ - //prExtraBuf[iwr->u.essid.length] = 0; - //printk(KERN_INFO "wext_set_essid: %s (%d)\n", prExtraBuf, iwr->u.essid.length); - ret = wext_set_essid(prDev, NULL, &iwr->u.essid, prExtraBuf); - //printk ("set essid %d\n", ret); - } - - kalMemFree(prExtraBuf, VIR_MEM_TYPE, IW_ESSID_MAX_SIZE + 4); - prExtraBuf = NULL; - break; - -#endif - - case SIOCGIWESSID: /* 0x8B1B, get SSID */ - if (!iwr->u.essid.pointer) { - ret = -EINVAL; - break; - } - - if (iwr->u.essid.length < IW_ESSID_MAX_SIZE) { - DBGLOG(INIT, INFO, ("[wifi] iwr->u.essid.length:%d too small\n", - iwr->u.essid.length)); - ret = -E2BIG; /* let caller try larger buffer */ - break; - } - - prExtraBuf = kalMemAlloc(IW_ESSID_MAX_SIZE, VIR_MEM_TYPE); - if (!prExtraBuf) { - ret = -ENOMEM; - break; - } - - /* iwr->u.essid.length is updated by wext_get_essid() */ - - ret = wext_get_essid(prDev, NULL, &iwr->u.essid, prExtraBuf); - if (ret == 0) { - if (copy_to_user(iwr->u.essid.pointer, prExtraBuf, iwr->u.essid.length)) { - ret = -EFAULT; - } - } - - kalMemFree(prExtraBuf, VIR_MEM_TYPE, IW_ESSID_MAX_SIZE); - prExtraBuf = NULL; - - break; - - /* case SIOCSIWNICKN: 0x8B1C, not supported */ - /* case SIOCGIWNICKN: 0x8B1D, not supported */ - - case SIOCSIWRATE: /* 0x8B20, set default bit rate (bps) */ - //ret = wext_set_rate(prDev, &rIwReqInfo, &iwr->u.bitrate, NULL); - break; - - case SIOCGIWRATE: /* 0x8B21, get current bit rate (bps) */ - ret = wext_get_rate(prDev, NULL, &iwr->u.bitrate, NULL); - break; - - case SIOCSIWRTS: /* 0x8B22, set rts/cts threshold */ - ret = wext_set_rts(prDev, NULL, &iwr->u.rts, NULL); - break; - - case SIOCGIWRTS: /* 0x8B23, get rts/cts threshold */ - ret = wext_get_rts(prDev, NULL, &iwr->u.rts, NULL); - break; - - /* case SIOCSIWFRAG: 0x8B24, unsupported */ - case SIOCGIWFRAG: /* 0x8B25, get frag threshold */ - ret = wext_get_frag(prDev, NULL, &iwr->u.frag, NULL); - break; - - case SIOCSIWTXPOW: /* 0x8B26, set relative tx power (in %) */ - ret = wext_set_txpow(prDev, NULL, &iwr->u.txpower, NULL); - break; - - case SIOCGIWTXPOW: /* 0x8B27, get relative tx power (in %) */ - ret = wext_get_txpow(prDev, NULL, &iwr->u.txpower, NULL); - break; - - /* case SIOCSIWRETRY: 0x8B28, unsupported */ - /* case SIOCGIWRETRY: 0x8B29, unsupported */ - -#if 1 - case SIOCSIWENCODE: /* 0x8B2A, set encoding token & mode */ - /* Only DISABLED case has NULL pointer and length == 0 */ - if (iwr->u.encoding.pointer) { - if (iwr->u.encoding.length > 16) { - ret = -E2BIG; - break; - } - - u4ExtraSize = iwr->u.encoding.length; - prExtraBuf = kalMemAlloc(u4ExtraSize, VIR_MEM_TYPE); - if (!prExtraBuf) { - ret = -ENOMEM; - break; - } - - if (copy_from_user(prExtraBuf, - iwr->u.encoding.pointer, - iwr->u.encoding.length)) { - ret = -EFAULT; - } - } - else if (iwr->u.encoding.length != 0) { - ret = -EINVAL; - break; - } - - if (ret == 0) { - ret = wext_set_encode(prDev, NULL, &iwr->u.encoding, prExtraBuf); - } - - if (prExtraBuf) { - kalMemFree(prExtraBuf, VIR_MEM_TYPE, u4ExtraSize); - prExtraBuf = NULL; - } - break; - - case SIOCGIWENCODE: /* 0x8B2B, get encoding token & mode */ - /* check pointer */ - ret = wext_get_encode(prDev, NULL, &iwr->u.encoding, NULL); - break; - - case SIOCSIWPOWER: /* 0x8B2C, set power management */ - ret = wext_set_power(prDev, NULL, &iwr->u.power, NULL); - break; - - case SIOCGIWPOWER: /* 0x8B2D, get power management */ - ret = wext_get_power(prDev, NULL, &iwr->u.power, NULL); - break; - -#if WIRELESS_EXT > 17 - case SIOCSIWGENIE: /* 0x8B30, set gen ie */ - if (iwr->u.data.pointer) { - P_GLUE_INFO_T prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - if (1 /* wlanQueryWapiMode(prGlueInfo->prAdapter) */) { - /* Fixed length structure */ -#if CFG_SUPPORT_WAPI - if (iwr->u.data.length > 42 /* The max wapi ie buffer */) { - ret = -EINVAL; - break; - } -#endif - u4ExtraSize = iwr->u.data.length; - if (u4ExtraSize) { - prExtraBuf = kalMemAlloc(u4ExtraSize, VIR_MEM_TYPE); - if (!prExtraBuf) { - ret = -ENOMEM; - break; - } - if (copy_from_user(prExtraBuf, - iwr->u.data.pointer, - iwr->u.data.length)) { - ret = -EFAULT; - } - else { - WLAN_STATUS rStatus; - UINT_32 u4BufLen; -#if CFG_SUPPORT_WAPI - rStatus = kalIoctl(prGlueInfo, - wlanoidSetWapiAssocInfo, - prExtraBuf, - u4ExtraSize, - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - //printk(KERN_INFO "[wapi] set wapi assoc info error:%lx\n", rStatus); -#endif -#if CFG_SUPPORT_WPS2 - PUINT_8 prDesiredIE = NULL; - if (wextSrchDesiredWPSIE(prExtraBuf, - u4ExtraSize, - 0xDD, - (PUINT_8 *)&prDesiredIE)) { - rStatus = kalIoctl(prGlueInfo, - wlanoidSetWSCAssocInfo, - prDesiredIE, - IE_SIZE(prDesiredIE), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - if (rStatus != WLAN_STATUS_SUCCESS) { - //printk(KERN_INFO "[WSC] set WSC assoc info error:%lx\n", rStatus); - } - } -#endif -#if CFG_SUPPORT_WAPI - } -#endif - } - kalMemFree(prExtraBuf, VIR_MEM_TYPE, u4ExtraSize); - prExtraBuf = NULL; - } - } - } - break; - - case SIOCGIWGENIE: /* 0x8B31, get gen ie, unused */ - break; - -#endif - - case SIOCSIWAUTH: /* 0x8B32, set auth mode params */ - ret = wext_set_auth(prDev, NULL, &iwr->u.param, NULL); - break; - - /* case SIOCGIWAUTH: 0x8B33, unused? */ - case SIOCSIWENCODEEXT: /* 0x8B34, set extended encoding token & mode */ - if (iwr->u.encoding.pointer) { - u4ExtraSize = iwr->u.encoding.length; - prExtraBuf = kalMemAlloc(u4ExtraSize, VIR_MEM_TYPE); - if (!prExtraBuf) { - ret = -ENOMEM; - break; - } - - if (copy_from_user(prExtraBuf, - iwr->u.encoding.pointer, - iwr->u.encoding.length)) { - ret = -EFAULT; - } - } - else if (iwr->u.encoding.length != 0) { - ret = -EINVAL; - break; - } - - if (ret == 0) { - ret = wext_set_encode_ext(prDev, NULL, &iwr->u.encoding, prExtraBuf); - } - - if (prExtraBuf) { - kalMemFree(prExtraBuf, VIR_MEM_TYPE, u4ExtraSize); - prExtraBuf = NULL; - } - break; - - /* case SIOCGIWENCODEEXT: 0x8B35, unused? */ - - case SIOCSIWPMKSA: /* 0x8B36, pmksa cache operation */ - #if 1 - if (iwr->u.data.pointer) { - /* Fixed length structure */ - if (iwr->u.data.length != sizeof(struct iw_pmksa)) { - ret = -EINVAL; - break; - } - - u4ExtraSize = sizeof(struct iw_pmksa); - prExtraBuf = kalMemAlloc(u4ExtraSize, VIR_MEM_TYPE); - if (!prExtraBuf) { - ret = -ENOMEM; - break; - } - - if (copy_from_user(prExtraBuf, - iwr->u.data.pointer, - sizeof(struct iw_pmksa))) { - ret = -EFAULT; - } - else { - switch(((struct iw_pmksa *)prExtraBuf)->cmd) { - case IW_PMKSA_ADD: - /* - printk(KERN_INFO "IW_PMKSA_ADD [" MACSTR "]\n", - MAC2STR(((struct iw_pmksa *)pExtraBuf)->bssid.sa_data)); - */ - { - P_GLUE_INFO_T prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - WLAN_STATUS rStatus; - UINT_32 u4BufLen; - P_PARAM_PMKID_T prPmkid; - - prPmkid =(P_PARAM_PMKID_T)kalMemAlloc(8 + sizeof(PARAM_BSSID_INFO_T), VIR_MEM_TYPE); - if (!prPmkid) { - DBGLOG(INIT, INFO, ("Can not alloc memory for IW_PMKSA_ADD\n")); - ret = -ENOMEM; - break; - } - - prPmkid->u4Length = 8 + sizeof(PARAM_BSSID_INFO_T); - prPmkid->u4BSSIDInfoCount = 1; - kalMemCopy(prPmkid->arBSSIDInfo->arBSSID, - ((struct iw_pmksa *)prExtraBuf)->bssid.sa_data, - 6); - kalMemCopy(prPmkid->arBSSIDInfo->arPMKID, - ((struct iw_pmksa *)prExtraBuf)->pmkid, - IW_PMKID_LEN); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetPmkid, - prPmkid, - sizeof(PARAM_PMKID_T), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, INFO, ("add pmkid error:%lx\n", rStatus)); - } - kalMemFree(prPmkid, VIR_MEM_TYPE, 8 + sizeof(PARAM_BSSID_INFO_T)); - } - break; - case IW_PMKSA_REMOVE: - /* - printk(KERN_INFO "IW_PMKSA_REMOVE [" MACSTR "]\n", - MAC2STR(((struct iw_pmksa *)buf)->bssid.sa_data)); - */ - break; - case IW_PMKSA_FLUSH: - /* - printk(KERN_INFO "IW_PMKSA_FLUSH\n"); - */ - { - P_GLUE_INFO_T prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - WLAN_STATUS rStatus; - UINT_32 u4BufLen; - P_PARAM_PMKID_T prPmkid; - - prPmkid =(P_PARAM_PMKID_T)kalMemAlloc(8, VIR_MEM_TYPE); - if (!prPmkid) { - DBGLOG(INIT, INFO, ("Can not alloc memory for IW_PMKSA_FLUSH\n")); - ret = -ENOMEM; - break; - } - - prPmkid->u4Length = 8; - prPmkid->u4BSSIDInfoCount = 0; - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetPmkid, - prPmkid, - sizeof(PARAM_PMKID_T), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(INIT, INFO, ("flush pmkid error:%lx\n", rStatus)); - } - kalMemFree(prPmkid, VIR_MEM_TYPE, 8); - } - break; - default: - DBGLOG(INIT, INFO, ("UNKNOWN iw_pmksa command:%d\n", - ((struct iw_pmksa *)prExtraBuf)->cmd)); - ret = -EFAULT; - break; - } - } - - if (prExtraBuf) { - kalMemFree(prExtraBuf, VIR_MEM_TYPE, u4ExtraSize); - prExtraBuf = NULL; - } - } - else if (iwr->u.data.length != 0) { - ret = -EINVAL; - break; - } - #endif - break; - -#endif - - default: - /* printk(KERN_NOTICE "unsupported IOCTL: 0x%x\n", i4Cmd); */ - ret = -EOPNOTSUPP; - break; - } - - //printk("%ld CMD:0x%x ret:%d\n", jiffies_to_msecs(jiffies), i4Cmd, ret); - - return ret; -} /* wext_support_ioctl */ - - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To send an event (RAW socket pacekt) to user process actively. -* -* \param[in] prGlueInfo Glue layer info. -* \param[in] u4cmd Whcih event command we want to indicate to user process. -* \param[in] pData Data buffer to be indicated. -* \param[in] dataLen Available data size in pData. -* -* \return (none) -* -* \note Event is indicated to upper layer if cmd is supported and data is valid. -* Using of kernel symbol wireless_send_event(), which is defined in -* after WE-14 (2.4.20). -*/ -/*----------------------------------------------------------------------------*/ -void -wext_indicate_wext_event ( - IN P_GLUE_INFO_T prGlueInfo, - IN unsigned int u4Cmd, - IN unsigned char *pucData, - IN unsigned int u4dataLen - ) -{ - union iwreq_data wrqu; - unsigned char *pucExtraInfo = NULL; -#if WIRELESS_EXT >= 15 - unsigned char *pucDesiredIE = NULL; - unsigned char aucExtraInfoBuf[200]; -#endif -#if WIRELESS_EXT < 18 - int i; -#endif - - memset(&wrqu, 0, sizeof(wrqu)); - - switch (u4Cmd) { - case SIOCGIWTXPOW: - memcpy(&wrqu.power, pucData, u4dataLen); - break; - case SIOCGIWSCAN: - complete_all(&prGlueInfo->rScanComp); - break; - - case SIOCGIWAP: - if (pucData) { - memcpy(&wrqu.ap_addr.sa_data, pucData, ETH_ALEN); - } - else { - memset(&wrqu.ap_addr.sa_data, 0, ETH_ALEN); - } - break; - - case IWEVASSOCREQIE: -#if WIRELESS_EXT < 15 - /* under WE-15, no suitable Event can be used */ - goto skip_indicate_event; -#else - /* do supplicant a favor, parse to the start of WPA/RSN IE */ - if (wextSrchDesiredWPAIE(pucData, u4dataLen, 0x30, &pucDesiredIE)) { - /* RSN IE found */ - } -#if 0 - else if (wextSrchDesiredWPSIE(pucData, u4dataLen, 0xDD, &pucDesiredIE)) { - /* WPS IE found */ - } -#endif - else if (wextSrchDesiredWPAIE(pucData, u4dataLen, 0xDD, &pucDesiredIE)) { - /* WPA IE found */ - } -#if CFG_SUPPORT_WAPI /* Android+ */ - else if (wextSrchDesiredWAPIIE(pucData, u4dataLen, &pucDesiredIE)) { - //printk("wextSrchDesiredWAPIIE!!\n"); - /* WAPI IE found */ - } -#endif - else { - /* no WPA/RSN IE found, skip this event */ - goto skip_indicate_event; - } - - #if WIRELESS_EXT < 18 - /* under WE-18, only IWEVCUSTOM can be used */ - u4Cmd = IWEVCUSTOM; - pucExtraInfo = aucExtraInfoBuf; - pucExtraInfo += sprintf(pucExtraInfo, "ASSOCINFO(ReqIEs="); - /* printk(KERN_DEBUG "assoc info buffer size needed:%d\n", infoElemLen * 2 + 17); */ - /* translate binary string to hex string, requirement of IWEVCUSTOM */ - for (i = 0; i < pucDesiredIE[1] + 2 ; ++i) { - pucExtraInfo += sprintf(pucExtraInfo, "%02x", pucDesiredIE[i]); - } - pucExtraInfo = aucExtraInfoBuf; - wrqu.data.length = 17 + (pucDesiredIE[1] + 2) * 2; - #else - /* IWEVASSOCREQIE, indicate binary string */ - pucExtraInfo = pucDesiredIE; - wrqu.data.length = pucDesiredIE[1] + 2; - #endif -#endif /* WIRELESS_EXT < 15 */ - break; - - case IWEVMICHAELMICFAILURE: -#if WIRELESS_EXT < 15 - /* under WE-15, no suitable Event can be used */ - goto skip_indicate_event; -#else - if (pucData) { - P_PARAM_AUTH_REQUEST_T pAuthReq = (P_PARAM_AUTH_REQUEST_T)pucData; - /* under WE-18, only IWEVCUSTOM can be used */ - u4Cmd = IWEVCUSTOM; - pucExtraInfo = aucExtraInfoBuf; - pucExtraInfo += sprintf(pucExtraInfo, - "MLME-MICHAELMICFAILURE.indication "); - pucExtraInfo += sprintf(pucExtraInfo, - "%s", - (pAuthReq->u4Flags == PARAM_AUTH_REQUEST_GROUP_ERROR) ? - "groupcast " : "unicast "); - - wrqu.data.length = pucExtraInfo - aucExtraInfoBuf; - pucExtraInfo = aucExtraInfoBuf; - } -#endif /* WIRELESS_EXT < 15 */ - break; - - case IWEVPMKIDCAND: - if (prGlueInfo->rWpaInfo.u4WpaVersion == IW_AUTH_WPA_VERSION_WPA2 && - prGlueInfo->rWpaInfo.u4KeyMgmt == IW_AUTH_KEY_MGMT_802_1X) { - - /* only used in WPA2 */ -#if WIRELESS_EXT >= 18 - P_PARAM_PMKID_CANDIDATE_T prPmkidCand = (P_PARAM_PMKID_CANDIDATE_T)pucData; - - struct iw_pmkid_cand rPmkidCand; - pucExtraInfo = aucExtraInfoBuf; - - rPmkidCand.flags = prPmkidCand->u4Flags; - rPmkidCand.index = 0; - kalMemCopy(rPmkidCand.bssid.sa_data, prPmkidCand->arBSSID, 6); - - kalMemCopy(pucExtraInfo, (PUINT_8)&rPmkidCand, sizeof(struct iw_pmkid_cand)); - wrqu.data.length = sizeof(struct iw_pmkid_cand); - - /* pmkid canadidate list is supported after WE-18 */ - /* indicate struct iw_pmkid_cand */ -#else - /* printk(KERN_INFO "IWEVPMKIDCAND event skipped, WE < 18\n"); */ - goto skip_indicate_event; -#endif - } - else { - /* printk(KERN_INFO "IWEVPMKIDCAND event skipped, NOT WPA2\n"); */ - goto skip_indicate_event; - } - break; - - case IWEVCUSTOM: - u4Cmd = IWEVCUSTOM; - pucExtraInfo = aucExtraInfoBuf; - kalMemCopy(pucExtraInfo, pucData, sizeof(PTA_IPC_T)); - wrqu.data.length = sizeof(PTA_IPC_T); - break; - - default: - /* printk(KERN_INFO "Unsupported wext event:%x\n", cmd); */ - goto skip_indicate_event; - } - - /* Send event to user space */ - wireless_send_event(prGlueInfo->prDevHandler, u4Cmd, &wrqu, pucExtraInfo); - -skip_indicate_event: - return; -} /* wext_indicate_wext_event */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief A method of struct net_device, to get the network interface statistical -* information. -* -* Whenever an application needs to get statistics for the interface, this method -* is called. This happens, for example, when ifconfig or netstat -i is run. -* -* \param[in] pDev Pointer to struct net_device. -* -* \return net_device_stats buffer pointer. -* -*/ -/*----------------------------------------------------------------------------*/ -struct iw_statistics * -wext_get_wireless_stats ( - struct net_device *prDev - ) -{ - - WLAN_STATUS rStatus = WLAN_STATUS_FAILURE; - P_GLUE_INFO_T prGlueInfo = NULL; - struct iw_statistics *pStats = NULL; - INT_32 i4Rssi; - UINT_32 bufLen = 0; - - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - ASSERT(prGlueInfo); - if (!prGlueInfo) { - goto stat_out; - } - - pStats = (struct iw_statistics *) (&(prGlueInfo->rIwStats)); - - if (!prDev || !netif_carrier_ok(prDev)) { - /* network not connected */ - goto stat_out; - } - - rStatus = kalIoctl(prGlueInfo, - wlanoidQueryRssi, - &i4Rssi, - sizeof(i4Rssi), - TRUE, - TRUE, - TRUE, - FALSE, - &bufLen); - -stat_out: - return pStats; -} /* wlan_get_wireless_stats */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief To report the private supported IOCTLs table to user space. -* -* \param[in] prNetDev Net device requested. -* \param[out] prIfReq Pointer to ifreq structure, content is copied back to -* user space buffer in gl_iwpriv_table. -* -* \retval 0 For success. -* \retval -E2BIG For user's buffer size is too small. -* \retval -EFAULT For fail. -* -*/ -/*----------------------------------------------------------------------------*/ -int -wext_get_priv ( - IN struct net_device *prNetDev, - IN struct ifreq *prIfReq - ) -{ - /* prIfReq is verified in the caller function wlanDoIOCTL() */ - struct iwreq *prIwReq = (struct iwreq *)prIfReq; - struct iw_point *prData= (struct iw_point *)&prIwReq->u.data; - UINT_16 u2BufferSize = 0; - - u2BufferSize = prData->length; - - /* update our private table size */ - prData->length = (__u16)sizeof(rIwPrivTable)/sizeof(struct iw_priv_args); - - if (u2BufferSize < prData->length) { - return -E2BIG; - } - - if (prData->length) { - if (copy_to_user(prData->pointer, rIwPrivTable, sizeof(rIwPrivTable))) { - return -EFAULT; - } - } - - return 0; -} /* wext_get_priv */ - -#endif /* WIRELESS_EXT */ - - - diff --git a/drivers/net/wireless/mt5931/os/linux/gl_wext_priv.c b/drivers/net/wireless/mt5931/os/linux/gl_wext_priv.c deleted file mode 100755 index aafe5696310a..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/gl_wext_priv.c +++ /dev/null @@ -1,2238 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/gl_wext_priv.c#4 $ -*/ - -/*! \file gl_wext_priv.c - \brief This file includes private ioctl support. -*/ - - - -/* -** $Log: gl_wext_priv.c $ - * - * 07 17 2012 yuche.tsai - * NULL - * Let netdev bring up. - * - * 06 13 2012 yuche.tsai - * NULL - * Update maintrunk driver. - * Add support for driver compose assoc request frame. - * - * 03 20 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function[WCXRP00001202] [MT6628 Wi-Fi][FW] Adding the New PN init code - * use return to avoid the ioctl return not supported - * - * 03 02 2012 terry.wu - * NULL - * Snc CFG80211 modification for ICS migration from branch 2.2. - * - * 01 16 2012 wh.su - * [WCXRP00001170] [MT6620 Wi-Fi][Driver] Adding the related code for set/get band ioctl - * Adding the template code for set / get band IOCTL (with ICS supplicant_6).. - * - * 01 05 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * Adding the related ioctl / wlan oid function to set the Tx power cfg. - * - * 01 02 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * Adding the proto type function for set_int set_tx_power and get int get_ch_list. - * - * 11 10 2011 cp.wu - * [WCXRP00001098] [MT6620 Wi-Fi][Driver] Replace printk by DBG LOG macros in linux porting layer - * 1. eliminaite direct calls to printk in porting layer. - * 2. replaced by DBGLOG, which would be XLOG on ALPS platforms. - * - * 11 02 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings - * Fixed typo. - * - * 09 20 2011 chinglan.wang - * [WCXRP00000989] [WiFi Direct] [Driver] Add a new io control API to start the formation for the sigma test. - * . - * - * 07 28 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings - * Add BWCS cmd and event. - * - * 07 18 2011 chinghwa.yu - * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm - * Add CMD/Event for RDD and BWCS. - * - * 03 17 2011 chinglan.wang - * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature - * . - * - * 03 07 2011 terry.wu - * [WCXRP00000521] [MT6620 Wi-Fi][Driver] Remove non-standard debug message - * Toggle non-standard debug messages to comments. - * - * 01 27 2011 cm.chang - * [WCXRP00000402] [MT6620 Wi-Fi][Driver] Enable MCR read/write by iwpriv by default - * . - * - * 01 26 2011 wh.su - * [WCXRP00000396] [MT6620 Wi-Fi][Driver] Support Sw Ctrl ioctl at linux - * adding the SW cmd ioctl support, use set/get structure ioctl. - * - * 01 20 2011 eddie.chen - * [WCXRP00000374] [MT6620 Wi-Fi][DRV] SW debug control - * Adjust OID order. - * - * 01 20 2011 eddie.chen - * [WCXRP00000374] [MT6620 Wi-Fi][DRV] SW debug control - * Add Oid for sw control debug command - * - * 01 07 2011 cm.chang - * [WCXRP00000336] [MT6620 Wi-Fi][Driver] Add test mode commands in normal phone operation - * Add a new compiling option to control if MCR read/write is permitted - * - * 12 31 2010 cm.chang - * [WCXRP00000336] [MT6620 Wi-Fi][Driver] Add test mode commands in normal phone operation - * Add some iwpriv commands to support test mode operation - * - * 12 15 2010 george.huang - * [WCXRP00000152] [MT6620 Wi-Fi] AP mode power saving function - * Support set PS profile and set WMM-PS related iwpriv. - * - * 11 08 2010 wh.su - * [WCXRP00000171] [MT6620 Wi-Fi][Driver] Add message check code same behavior as mt5921 - * add the message check code from mt5921. - * - * 10 18 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android - * complete implementation of Android NVRAM access - * - * 09 24 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * correct typo for NVRAM access. - * - * 09 23 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * add skeleton for NVRAM integration - * - * 08 04 2010 cp.wu - * NULL - * revert changelist #15371, efuse read/write access will be done by RF test approach - * - * 08 04 2010 cp.wu - * NULL - * add OID definitions for EFUSE read/write access. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 06 01 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * enable OID_CUSTOM_MTK_WIFI_TEST for RFTest & META tool - * - * 05 29 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * fix private ioctl for rftest - * - * 04 21 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * add for private ioctl support -** \main\maintrunk.MT5921\32 2009-10-08 10:33:25 GMT mtk01090 -** Avoid accessing private data of net_device directly. Replace with netdev_priv(). Add more checking for input parameters and pointers. -** \main\maintrunk.MT5921\31 2009-09-29 16:46:21 GMT mtk01090 -** Remove unused functions -** \main\maintrunk.MT5921\30 2009-09-29 14:46:47 GMT mtk01090 -** Fix compile warning -** \main\maintrunk.MT5921\29 2009-09-29 14:28:48 GMT mtk01090 -** Fix compile warning -** \main\maintrunk.MT5921\28 2009-09-28 22:21:38 GMT mtk01090 -** Refine lines to supress compile warning -** \main\maintrunk.MT5921\27 2009-09-28 20:19:14 GMT mtk01090 -** Add private ioctl to carry OID structures. Restructure public/private ioctl interfaces to Linux kernel. -** \main\maintrunk.MT5921\26 2009-08-18 22:56:53 GMT mtk01090 -** Add Linux SDIO (with mmc core) support. -** Add Linux 2.6.21, 2.6.25, 2.6.26. -** Fix compile warning in Linux. -** \main\maintrunk.MT5921\25 2009-05-07 22:26:15 GMT mtk01089 -** Add mandatory and private IO control for Linux BWCS -** \main\maintrunk.MT5921\24 2009-04-29 10:07:05 GMT mtk01088 -** fixed the compiling error at linux -** \main\maintrunk.MT5921\23 2009-04-24 09:09:45 GMT mtk01088 -** mark the code not used at linux supplicant v0.6.7 -** \main\maintrunk.MT5921\22 2008-11-24 21:03:51 GMT mtk01425 -** 1. Add PTA_ENABLED flag -** \main\maintrunk.MT5921\21 2008-08-29 14:55:59 GMT mtk01088 -** adjust the code for meet the coding style, and add assert check -** \main\maintrunk.MT5921\20 2008-07-16 15:23:20 GMT mtk01104 -** Support GPIO2 mode -** \main\maintrunk.MT5921\19 2008-07-15 17:43:11 GMT mtk01084 -** modify variable name -** \main\maintrunk.MT5921\18 2008-07-14 14:37:58 GMT mtk01104 -** Add exception handle about length in function priv_set_struct() -** \main\maintrunk.MT5921\17 2008-07-14 13:55:32 GMT mtk01104 -** Support PRIV_CMD_BT_COEXIST -** \main\maintrunk.MT5921\16 2008-07-09 00:20:15 GMT mtk01461 -** Add priv oid to support WMM_PS_TEST -** \main\maintrunk.MT5921\15 2008-06-02 11:15:22 GMT mtk01461 -** Update after wlanoidSetPowerMode changed -** \main\maintrunk.MT5921\14 2008-05-30 19:31:07 GMT mtk01461 -** Add IOCTL for Power Mode -** \main\maintrunk.MT5921\13 2008-05-30 18:57:15 GMT mtk01461 -** Not use wlanoidSetCSUMOffloadForLinux() -** \main\maintrunk.MT5921\12 2008-05-30 15:13:18 GMT mtk01084 -** rename wlanoid -** \main\maintrunk.MT5921\11 2008-05-29 14:16:31 GMT mtk01084 -** rename for wlanoidSetBeaconIntervalForLinux -** \main\maintrunk.MT5921\10 2008-04-17 23:06:37 GMT mtk01461 -** Add iwpriv support for AdHocMode setting -** \main\maintrunk.MT5921\9 2008-03-31 21:00:55 GMT mtk01461 -** Add priv IOCTL for VOIP setting -** \main\maintrunk.MT5921\8 2008-03-31 13:49:43 GMT mtk01461 -** Add priv ioctl to turn on / off roaming -** \main\maintrunk.MT5921\7 2008-03-26 15:35:14 GMT mtk01461 -** Add CSUM offload priv ioctl for Linux -** \main\maintrunk.MT5921\6 2008-03-11 14:50:59 GMT mtk01461 -** Unify priv ioctl -** \main\maintrunk.MT5921\5 2007-11-06 19:32:30 GMT mtk01088 -** add WPS code -** \main\maintrunk.MT5921\4 2007-10-30 12:01:39 GMT MTK01425 -** 1. Update wlanQueryInformation and wlanSetInformation -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "gl_os.h" -#include "gl_wext_priv.h" -#if CFG_SUPPORT_WAPI -#include "gl_sec.h" -#endif -#if CFG_ENABLE_WIFI_DIRECT -#include "gl_p2p_os.h" -#endif - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define NUM_SUPPORTED_OIDS (sizeof(arWlanOidReqTable) / sizeof(WLAN_REQ_ENTRY)) - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -static int -priv_get_ndis ( - IN struct net_device *prNetDev, - IN NDIS_TRANSPORT_STRUCT* prNdisReq, - OUT PUINT_32 pu4OutputLen - ); - -static int -priv_set_ndis ( - IN struct net_device *prNetDev, - IN NDIS_TRANSPORT_STRUCT* prNdisReq, - OUT PUINT_32 pu4OutputLen - ); - -#if 0 /* CFG_SUPPORT_WPS */ -static int -priv_set_appie ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN union iwreq_data *prIwReqData, - OUT char *pcExtra - ); - -static int -priv_set_filter ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN union iwreq_data *prIwReqData, - OUT char *pcExtra - ); -#endif /* CFG_SUPPORT_WPS */ - -static BOOLEAN -reqSearchSupportedOidEntry ( - IN UINT_32 rOid, - OUT P_WLAN_REQ_ENTRY *ppWlanReqEntry - ); - -#if 0 -static WLAN_STATUS -reqExtQueryConfiguration ( - IN P_GLUE_INFO_T prGlueInfo, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ); - -static WLAN_STATUS -reqExtSetConfiguration ( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); -#endif - -static WLAN_STATUS -reqExtSetAcpiDevicePowerState ( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ); - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ -static UINT_8 aucOidBuf[4096] = {0}; - -/* OID processing table */ -/* Order is important here because the OIDs should be in order of - increasing value for binary searching. */ -static WLAN_REQ_ENTRY arWlanOidReqTable[] = { - /* - {(NDIS_OID)rOid, - (PUINT_8)pucOidName, - fgQryBufLenChecking, fgSetBufLenChecking, fgIsHandleInGlueLayerOnly, u4InfoBufLen, - pfOidQueryHandler, - pfOidSetHandler} - */ - /* General Operational Characteristics */ - - /* Ethernet Operational Characteristics */ - {OID_802_3_CURRENT_ADDRESS, - DISP_STRING("OID_802_3_CURRENT_ADDRESS"), - TRUE, TRUE, ENUM_OID_DRIVER_CORE, 6, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryCurrentAddr, - NULL}, - - /* OID_802_3_MULTICAST_LIST */ - /* OID_802_3_MAXIMUM_LIST_SIZE */ - /* Ethernet Statistics */ - - /* NDIS 802.11 Wireless LAN OIDs */ - {OID_802_11_SUPPORTED_RATES, - DISP_STRING("OID_802_11_SUPPORTED_RATES"), - TRUE, FALSE, ENUM_OID_DRIVER_CORE, sizeof(PARAM_RATES_EX), - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQuerySupportedRates, - NULL}, - /* - {OID_802_11_CONFIGURATION, - DISP_STRING("OID_802_11_CONFIGURATION"), - TRUE, TRUE, ENUM_OID_GLUE_EXTENSION, sizeof(PARAM_802_11_CONFIG_T), - (PFN_OID_HANDLER_FUNC_REQ)reqExtQueryConfiguration, - (PFN_OID_HANDLER_FUNC_REQ)reqExtSetConfiguration}, - */ - {OID_PNP_SET_POWER, - DISP_STRING("OID_PNP_SET_POWER"), - TRUE, FALSE, ENUM_OID_GLUE_EXTENSION, sizeof(PARAM_DEVICE_POWER_STATE), - NULL, - (PFN_OID_HANDLER_FUNC_REQ)reqExtSetAcpiDevicePowerState}, - - /* Custom OIDs */ - {OID_CUSTOM_OID_INTERFACE_VERSION, - DISP_STRING("OID_CUSTOM_OID_INTERFACE_VERSION"), - TRUE, FALSE, ENUM_OID_DRIVER_CORE, 4, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryOidInterfaceVersion, - NULL}, - - /* -#if PTA_ENABLED - {OID_CUSTOM_BT_COEXIST_CTRL, - DISP_STRING("OID_CUSTOM_BT_COEXIST_CTRL"), - FALSE, TRUE, ENUM_OID_DRIVER_CORE, sizeof(PARAM_CUSTOM_BT_COEXIST_T), - NULL, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetBtCoexistCtrl}, -#endif - */ - - /* - {OID_CUSTOM_POWER_MANAGEMENT_PROFILE, - DISP_STRING("OID_CUSTOM_POWER_MANAGEMENT_PROFILE"), - FALSE, FALSE, ENUM_OID_DRIVER_CORE, 0, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryPwrMgmtProfParam, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetPwrMgmtProfParam}, - {OID_CUSTOM_PATTERN_CONFIG, - DISP_STRING("OID_CUSTOM_PATTERN_CONFIG"), - TRUE, TRUE, ENUM_OID_DRIVER_CORE, sizeof(PARAM_CUSTOM_PATTERN_SEARCH_CONFIG_STRUC_T), - NULL, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetPatternConfig}, - {OID_CUSTOM_BG_SSID_SEARCH_CONFIG, - DISP_STRING("OID_CUSTOM_BG_SSID_SEARCH_CONFIG"), - FALSE, FALSE, ENUM_OID_DRIVER_CORE, 0, - NULL, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetBgSsidParam}, - {OID_CUSTOM_VOIP_SETUP, - DISP_STRING("OID_CUSTOM_VOIP_SETUP"), - TRUE, TRUE, ENUM_OID_DRIVER_CORE, 4, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryVoipConnectionStatus, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetVoipConnectionStatus}, - {OID_CUSTOM_ADD_TS, - DISP_STRING("OID_CUSTOM_ADD_TS"), - TRUE, TRUE, ENUM_OID_DRIVER_CORE, 4, - NULL, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidAddTS}, - {OID_CUSTOM_DEL_TS, - DISP_STRING("OID_CUSTOM_DEL_TS"), - TRUE, TRUE, ENUM_OID_DRIVER_CORE, 4, - NULL, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidDelTS}, - */ - - /* -#if CFG_LP_PATTERN_SEARCH_SLT - {OID_CUSTOM_SLT, - DISP_STRING("OID_CUSTOM_SLT"), - FALSE, FALSE, ENUM_OID_DRIVER_CORE, 0, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQuerySltResult, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetSltMode}, -#endif - - {OID_CUSTOM_ROAMING_EN, - DISP_STRING("OID_CUSTOM_ROAMING_EN"), - TRUE, TRUE, ENUM_OID_DRIVER_CORE, 4, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryRoamingFunction, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetRoamingFunction}, - {OID_CUSTOM_WMM_PS_TEST, - DISP_STRING("OID_CUSTOM_WMM_PS_TEST"), - TRUE, TRUE, ENUM_OID_DRIVER_CORE, 4, - NULL, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetWiFiWmmPsTest}, - {OID_CUSTOM_COUNTRY_STRING, - DISP_STRING("OID_CUSTOM_COUNTRY_STRING"), - FALSE, FALSE, ENUM_OID_DRIVER_CORE, 0, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryCurrentCountry, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetCurrentCountry}, - -#if CFG_SUPPORT_802_11D - {OID_CUSTOM_MULTI_DOMAIN_CAPABILITY, - DISP_STRING("OID_CUSTOM_MULTI_DOMAIN_CAPABILITY"), - FALSE, FALSE, ENUM_OID_DRIVER_CORE, 0, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryMultiDomainCap, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetMultiDomainCap}, -#endif - - {OID_CUSTOM_GPIO2_MODE, - DISP_STRING("OID_CUSTOM_GPIO2_MODE"), - FALSE, TRUE, ENUM_OID_DRIVER_CORE, sizeof(ENUM_PARAM_GPIO2_MODE_T), - NULL, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetGPIO2Mode}, - {OID_CUSTOM_CONTINUOUS_POLL, - DISP_STRING("OID_CUSTOM_CONTINUOUS_POLL"), - FALSE, TRUE, ENUM_OID_DRIVER_CORE, sizeof(PARAM_CONTINUOUS_POLL_T), - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryContinuousPollInterval, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetContinuousPollProfile}, - {OID_CUSTOM_DISABLE_BEACON_DETECTION, - DISP_STRING("OID_CUSTOM_DISABLE_BEACON_DETECTION"), - FALSE, TRUE, ENUM_OID_DRIVER_CORE, 4, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryDisableBeaconDetectionFunc, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetDisableBeaconDetectionFunc}, - */ - - /* WPS */ - /* - {OID_CUSTOM_DISABLE_PRIVACY_CHECK, - DISP_STRING("OID_CUSTOM_DISABLE_PRIVACY_CHECK"), - FALSE, TRUE, ENUM_OID_DRIVER_CORE, 4, - NULL, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetDisablePriavcyCheck}, - */ - - {OID_CUSTOM_MCR_RW, - DISP_STRING("OID_CUSTOM_MCR_RW"), - TRUE, TRUE, ENUM_OID_DRIVER_CORE, sizeof(PARAM_CUSTOM_MCR_RW_STRUC_T), - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryMcrRead, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetMcrWrite}, - - {OID_CUSTOM_EEPROM_RW, - DISP_STRING("OID_CUSTOM_EEPROM_RW"), - TRUE, TRUE, ENUM_OID_DRIVER_CORE, sizeof(PARAM_CUSTOM_EEPROM_RW_STRUC_T), - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryEepromRead, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetEepromWrite}, - - {OID_CUSTOM_SW_CTRL, - DISP_STRING("OID_CUSTOM_SW_CTRL"), - TRUE, TRUE, ENUM_OID_DRIVER_CORE, sizeof(PARAM_CUSTOM_SW_CTRL_STRUC_T), - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQuerySwCtrlRead, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetSwCtrlWrite}, - - {OID_CUSTOM_MEM_DUMP, - DISP_STRING("OID_CUSTOM_MEM_DUMP"), - TRUE, TRUE, ENUM_OID_DRIVER_CORE, sizeof(PARAM_CUSTOM_MEM_DUMP_STRUC_T), - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryMemDump, - NULL}, - - {OID_CUSTOM_TEST_MODE, - DISP_STRING("OID_CUSTOM_TEST_MODE"), - FALSE, FALSE, ENUM_OID_DRIVER_CORE, 0, - NULL, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidRftestSetTestMode}, - - /* - {OID_CUSTOM_TEST_RX_STATUS, - DISP_STRING("OID_CUSTOM_TEST_RX_STATUS"), - FALSE, TRUE, ENUM_OID_DRIVER_CORE, sizeof(PARAM_CUSTOM_RFTEST_RX_STATUS_STRUC_T), - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryRfTestRxStatus, - NULL}, - {OID_CUSTOM_TEST_TX_STATUS, - DISP_STRING("OID_CUSTOM_TEST_TX_STATUS"), - FALSE, TRUE, ENUM_OID_DRIVER_CORE, sizeof(PARAM_CUSTOM_RFTEST_TX_STATUS_STRUC_T), - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryRfTestTxStatus, - NULL}, - */ - {OID_CUSTOM_ABORT_TEST_MODE, - DISP_STRING("OID_CUSTOM_ABORT_TEST_MODE"), - FALSE, FALSE, ENUM_OID_DRIVER_CORE, 0, - NULL, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidRftestSetAbortTestMode}, - {OID_CUSTOM_MTK_WIFI_TEST, - DISP_STRING("OID_CUSTOM_MTK_WIFI_TEST"), - TRUE, TRUE, ENUM_OID_DRIVER_CORE, sizeof(PARAM_MTK_WIFI_TEST_STRUC_T), - (PFN_OID_HANDLER_FUNC_REQ)wlanoidRftestQueryAutoTest, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidRftestSetAutoTest}, - - /* OID_CUSTOM_EMULATION_VERSION_CONTROL */ - - /* BWCS */ -#if CFG_SUPPORT_BCM && CFG_SUPPORT_BCM_BWCS - {OID_CUSTOM_BWCS_CMD, - DISP_STRING("OID_CUSTOM_BWCS_CMD"), - FALSE, FALSE, ENUM_OID_DRIVER_CORE, sizeof(PTA_IPC_T), - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryBT, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetBT}, -#endif - -/* {OID_CUSTOM_SINGLE_ANTENNA, - DISP_STRING("OID_CUSTOM_SINGLE_ANTENNA"), - FALSE, FALSE, ENUM_OID_DRIVER_CORE, 4, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryBtSingleAntenna, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetBtSingleAntenna}, - {OID_CUSTOM_SET_PTA, - DISP_STRING("OID_CUSTOM_SET_PTA"), - FALSE, FALSE, ENUM_OID_DRIVER_CORE, 4, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryPta, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetPta}, - */ - - { OID_CUSTOM_MTK_NVRAM_RW, - DISP_STRING("OID_CUSTOM_MTK_NVRAM_RW"), - TRUE, TRUE, ENUM_OID_DRIVER_CORE, sizeof(PARAM_CUSTOM_NVRAM_RW_STRUCT_T), - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryNvramRead, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetNvramWrite }, - - { OID_CUSTOM_CFG_SRC_TYPE, - DISP_STRING("OID_CUSTOM_CFG_SRC_TYPE"), - FALSE, FALSE, ENUM_OID_DRIVER_CORE, sizeof(ENUM_CFG_SRC_TYPE_T), - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryCfgSrcType, - NULL }, - - { OID_CUSTOM_EEPROM_TYPE, - DISP_STRING("OID_CUSTOM_EEPROM_TYPE"), - FALSE, FALSE, ENUM_OID_DRIVER_CORE, sizeof(ENUM_EEPROM_TYPE_T), - (PFN_OID_HANDLER_FUNC_REQ)wlanoidQueryEepromType, - NULL }, - -#if CFG_SUPPORT_WAPI - {OID_802_11_WAPI_MODE, - DISP_STRING("OID_802_11_WAPI_MODE"), - FALSE, TRUE, ENUM_OID_DRIVER_CORE, 4, - NULL, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetWapiMode}, - {OID_802_11_WAPI_ASSOC_INFO, - DISP_STRING("OID_802_11_WAPI_ASSOC_INFO"), - FALSE, FALSE, ENUM_OID_DRIVER_CORE, 0, - NULL, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetWapiAssocInfo}, - {OID_802_11_SET_WAPI_KEY, - DISP_STRING("OID_802_11_SET_WAPI_KEY"), - FALSE, FALSE, ENUM_OID_DRIVER_CORE, sizeof(PARAM_WPI_KEY_T), - NULL, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetWapiKey}, -#endif - -#if CFG_SUPPORT_WPS2 - {OID_802_11_WSC_ASSOC_INFO, - DISP_STRING("OID_802_11_WSC_ASSOC_INFO"), - FALSE, FALSE, ENUM_OID_DRIVER_CORE, 0, - NULL, - (PFN_OID_HANDLER_FUNC_REQ)wlanoidSetWSCAssocInfo}, -#endif -}; - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Dispatching function for private ioctl region (SIOCIWFIRSTPRIV ~ -* SIOCIWLASTPRIV). -* -* \param[in] prNetDev Net device requested. -* \param[in] prIfReq Pointer to ifreq structure. -* \param[in] i4Cmd Command ID between SIOCIWFIRSTPRIV and SIOCIWLASTPRIV. -* -* \retval 0 for success. -* \retval -EOPNOTSUPP If cmd is not supported. -* \retval -EFAULT For fail. -* -*/ -/*----------------------------------------------------------------------------*/ -int -priv_support_ioctl ( - IN struct net_device *prNetDev, - IN OUT struct ifreq *prIfReq, - IN int i4Cmd - ) -{ - /* prIfReq is verified in the caller function wlanDoIOCTL() */ - struct iwreq *prIwReq = (struct iwreq *)prIfReq; - struct iw_request_info rIwReqInfo; - - /* prDev is verified in the caller function wlanDoIOCTL() */ - - /* Prepare the call */ - rIwReqInfo.cmd = (__u16)i4Cmd; - rIwReqInfo.flags = 0; - - switch (i4Cmd) { - case IOCTL_SET_INT: - /* NOTE(Kevin): 1/3 INT Type <= IFNAMSIZ, so we don't need copy_from/to_user() */ - return priv_set_int(prNetDev, &rIwReqInfo, &(prIwReq->u), (char *) &(prIwReq->u)); - - case IOCTL_GET_INT: - /* NOTE(Kevin): 1/3 INT Type <= IFNAMSIZ, so we don't need copy_from/to_user() */ - return priv_get_int(prNetDev, &rIwReqInfo, &(prIwReq->u), (char *) &(prIwReq->u)); - - case IOCTL_SET_STRUCT: - case IOCTL_SET_STRUCT_FOR_EM: - return priv_set_struct(prNetDev, &rIwReqInfo, &prIwReq->u, (char *) &(prIwReq->u)); - - case IOCTL_GET_STRUCT: - return priv_get_struct(prNetDev, &rIwReqInfo, &prIwReq->u, (char *) &(prIwReq->u)); - - default: - return -EOPNOTSUPP; - - } /* end of switch */ - -}/* priv_support_ioctl */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Private ioctl set int handler. -* -* \param[in] prNetDev Net device requested. -* \param[in] prIwReqInfo Pointer to iwreq structure. -* \param[in] prIwReqData The ioctl data structure, use the field of sub-command. -* \param[in] pcExtra The buffer with input value -* -* \retval 0 For success. -* \retval -EOPNOTSUPP If cmd is not supported. -* \retval -EINVAL If a value is out of range. -* -*/ -/*----------------------------------------------------------------------------*/ -int -priv_set_int ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN union iwreq_data *prIwReqData, - IN char *pcExtra - ) -{ - UINT_32 u4SubCmd; - PUINT_32 pu4IntBuf; - P_NDIS_TRANSPORT_STRUCT prNdisReq; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4BufLen = 0; - int status = 0; - P_PTA_IPC_T prPtaIpc; - - ASSERT(prNetDev); - ASSERT(prIwReqInfo); - ASSERT(prIwReqData); - ASSERT(pcExtra); - - if (FALSE == GLUE_CHK_PR3(prNetDev, prIwReqData, pcExtra)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - u4SubCmd = (UINT_32) prIwReqData->mode; - pu4IntBuf = (PUINT_32) pcExtra; - - switch (u4SubCmd) { - case PRIV_CMD_TEST_MODE: - //printk("TestMode=%ld\n", pu4IntBuf[1]); - prNdisReq = (P_NDIS_TRANSPORT_STRUCT) &aucOidBuf[0]; - - if (pu4IntBuf[1] == PRIV_CMD_TEST_MAGIC_KEY) { - prNdisReq->ndisOidCmd = OID_CUSTOM_TEST_MODE; - } - else if (pu4IntBuf[1] == 0) { - prNdisReq->ndisOidCmd = OID_CUSTOM_ABORT_TEST_MODE; - } - else { - status = 0; - break; - } - prNdisReq->inNdisOidlength = 0; - prNdisReq->outNdisOidLength = 0; - - /* Execute this OID */ - status = priv_set_ndis(prNetDev, prNdisReq, &u4BufLen); - break; - - case PRIV_CMD_TEST_CMD: - //printk("CMD=0x%08lx, data=0x%08lx\n", pu4IntBuf[1], pu4IntBuf[2]); - prNdisReq = (P_NDIS_TRANSPORT_STRUCT) &aucOidBuf[0]; - - kalMemCopy(&prNdisReq->ndisOidContent[0], &pu4IntBuf[1], 8); - - prNdisReq->ndisOidCmd = OID_CUSTOM_MTK_WIFI_TEST; - prNdisReq->inNdisOidlength = 8; - prNdisReq->outNdisOidLength = 8; - - /* Execute this OID */ - status = priv_set_ndis(prNetDev, prNdisReq, &u4BufLen); - break; - -#if CFG_SUPPORT_PRIV_MCR_RW - case PRIV_CMD_ACCESS_MCR: - //printk("addr=0x%08lx, data=0x%08lx\n", pu4IntBuf[1], pu4IntBuf[2]); - prNdisReq = (P_NDIS_TRANSPORT_STRUCT) &aucOidBuf[0]; - - if (!prGlueInfo->fgMcrAccessAllowed) { - if (pu4IntBuf[1] == PRIV_CMD_TEST_MAGIC_KEY && - pu4IntBuf[2] == PRIV_CMD_TEST_MAGIC_KEY) { - prGlueInfo->fgMcrAccessAllowed = TRUE; - } - status = 0; - break; - } - - kalMemCopy(&prNdisReq->ndisOidContent[0], &pu4IntBuf[1], 8); - - prNdisReq->ndisOidCmd = OID_CUSTOM_MCR_RW; - prNdisReq->inNdisOidlength = 8; - prNdisReq->outNdisOidLength = 8; - - /* Execute this OID */ - status = priv_set_ndis(prNetDev, prNdisReq, &u4BufLen); - break; -#endif - - case PRIV_CMD_SW_CTRL: - //printk("addr=0x%08lx, data=0x%08lx\n", pu4IntBuf[1], pu4IntBuf[2]); - prNdisReq = (P_NDIS_TRANSPORT_STRUCT) &aucOidBuf[0]; - - kalMemCopy(&prNdisReq->ndisOidContent[0], &pu4IntBuf[1], 8); - - prNdisReq->ndisOidCmd = OID_CUSTOM_SW_CTRL; - prNdisReq->inNdisOidlength = 8; - prNdisReq->outNdisOidLength = 8; - - /* Execute this OID */ - status = priv_set_ndis(prNetDev, prNdisReq, &u4BufLen); - break; - - - #if 0 - case PRIV_CMD_BEACON_PERIOD: - rStatus = wlanSetInformation(prGlueInfo->prAdapter, - wlanoidSetBeaconInterval, - (PVOID)&pu4IntBuf[1], /* pu4IntBuf[0] is used as input SubCmd */ - sizeof(UINT_32), - &u4BufLen); - break; - #endif - -#if CFG_TCP_IP_CHKSUM_OFFLOAD - case PRIV_CMD_CSUM_OFFLOAD: - { - UINT_32 u4CSUMFlags; - - - if (pu4IntBuf[1] == 1) { - u4CSUMFlags = CSUM_OFFLOAD_EN_ALL; - } - else if (pu4IntBuf[1] == 0) { - u4CSUMFlags = 0; - } - else { - return -EINVAL; - } - - if (kalIoctl(prGlueInfo, - wlanoidSetCSUMOffload, - (PVOID)&u4CSUMFlags, - sizeof(UINT_32), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen - ) == WLAN_STATUS_SUCCESS) { - if (pu4IntBuf[1] == 1) { - prNetDev->features |= NETIF_F_HW_CSUM; - } else if (pu4IntBuf[1] == 0) { - prNetDev->features &= ~NETIF_F_HW_CSUM; - } - } - } - break; -#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */ - - case PRIV_CMD_POWER_MODE: - kalIoctl(prGlueInfo, - wlanoidSet802dot11PowerSaveProfile, - (PVOID)&pu4IntBuf[1], /* pu4IntBuf[0] is used as input SubCmd */ - sizeof(UINT_32), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - break; - - case PRIV_CMD_WMM_PS: - { - PARAM_CUSTOM_WMM_PS_TEST_STRUC_T rWmmPsTest; - - rWmmPsTest.bmfgApsdEnAc = (UINT_8)pu4IntBuf[1]; - rWmmPsTest.ucIsEnterPsAtOnce = (UINT_8)pu4IntBuf[2]; - rWmmPsTest.ucIsDisableUcTrigger = (UINT_8)pu4IntBuf[3]; - rWmmPsTest.reserved = 0; - - kalIoctl(prGlueInfo, - wlanoidSetWiFiWmmPsTest, - (PVOID)&rWmmPsTest, - sizeof(PARAM_CUSTOM_WMM_PS_TEST_STRUC_T), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - } - break; - - #if 0 - case PRIV_CMD_ADHOC_MODE: - rStatus = wlanSetInformation(prGlueInfo->prAdapter, - wlanoidSetAdHocMode, - (PVOID)&pu4IntBuf[1], /* pu4IntBuf[0] is used as input SubCmd */ - sizeof(UINT_32), - &u4BufLen); - break; - #endif - - case PRIV_CUSTOM_BWCS_CMD: - - DBGLOG(REQ, INFO, ("pu4IntBuf[1] = %x, size of PTA_IPC_T = %d.\n", pu4IntBuf[1], sizeof(PARAM_PTA_IPC_T))); - - prPtaIpc = (P_PTA_IPC_T) aucOidBuf; - prPtaIpc->u.aucBTPParams[0] = (UINT_8) (pu4IntBuf[1] >> 24); - prPtaIpc->u.aucBTPParams[1] = (UINT_8) (pu4IntBuf[1] >> 16); - prPtaIpc->u.aucBTPParams[2] = (UINT_8) (pu4IntBuf[1] >> 8); - prPtaIpc->u.aucBTPParams[3] = (UINT_8) (pu4IntBuf[1]); - - DBGLOG(REQ, INFO, ("BCM BWCS CMD : PRIV_CUSTOM_BWCS_CMD : aucBTPParams[0] = %02x, aucBTPParams[1] = %02x, aucBTPParams[2] = %02x, aucBTPParams[3] = %02x.\n", - prPtaIpc->u.aucBTPParams[0], - prPtaIpc->u.aucBTPParams[1], - prPtaIpc->u.aucBTPParams[2], - prPtaIpc->u.aucBTPParams[3])); - -#if 0 - status = wlanSetInformation(prGlueInfo->prAdapter, - wlanoidSetBT, - (PVOID)&aucOidBuf[0], - u4CmdLen, - &u4BufLen); -#endif - - status = wlanoidSetBT(prGlueInfo->prAdapter, - (PVOID)&aucOidBuf[0], - sizeof(PARAM_PTA_IPC_T), - &u4BufLen); - - if (WLAN_STATUS_SUCCESS != status) { - status = -EFAULT; - } - - break; - - case PRIV_CMD_BAND_CONFIG: - { - DBGLOG(INIT, INFO, ("CMD set_band=%u\n", pu4IntBuf[1])); - } - break; - -#if CFG_ENABLE_WIFI_DIRECT - case PRIV_CMD_P2P_MODE: - { - PARAM_CUSTOM_P2P_SET_STRUC_T rSetP2P; - WLAN_STATUS rWlanStatus = WLAN_STATUS_SUCCESS; - - rSetP2P.u4Enable = pu4IntBuf[1]; - rSetP2P.u4Mode = pu4IntBuf[2]; - - if(!rSetP2P.u4Enable) { - p2pNetUnregister(prGlueInfo, TRUE); - } - - rWlanStatus = kalIoctl(prGlueInfo, - wlanoidSetP2pMode, - (PVOID)&rSetP2P, /* pu4IntBuf[0] is used as input SubCmd */ - sizeof(PARAM_CUSTOM_P2P_SET_STRUC_T), - FALSE, - FALSE, - TRUE, - FALSE, - &u4BufLen); - - if(rSetP2P.u4Enable) { - p2pNetRegister(prGlueInfo, TRUE); - } - - - } - break; -#endif - - default: - return -EOPNOTSUPP; - } - - return status; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Private ioctl get int handler. -* -* \param[in] pDev Net device requested. -* \param[out] pIwReq Pointer to iwreq structure. -* \param[in] prIwReqData The ioctl req structure, use the field of sub-command. -* \param[out] pcExtra The buffer with put the return value -* -* \retval 0 For success. -* \retval -EOPNOTSUPP If cmd is not supported. -* \retval -EFAULT For fail. -* -*/ -/*----------------------------------------------------------------------------*/ -int -priv_get_int ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN union iwreq_data *prIwReqData, - IN OUT char *pcExtra - ) -{ - UINT_32 u4SubCmd; - PUINT_32 pu4IntBuf; - P_GLUE_INFO_T prGlueInfo; - UINT_32 u4BufLen = 0; - int status = 0; - P_NDIS_TRANSPORT_STRUCT prNdisReq; - INT_32 ch[50]; - - ASSERT(prNetDev); - ASSERT(prIwReqInfo); - ASSERT(prIwReqData); - ASSERT(pcExtra); - if (FALSE == GLUE_CHK_PR3(prNetDev, prIwReqData, pcExtra)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - u4SubCmd = (UINT_32) prIwReqData->mode; - pu4IntBuf = (PUINT_32) pcExtra; - - switch (u4SubCmd) { - case PRIV_CMD_TEST_CMD: - //printk("CMD=0x%08lx, data=0x%08lx\n", pu4IntBuf[1], pu4IntBuf[2]); - prNdisReq = (P_NDIS_TRANSPORT_STRUCT) &aucOidBuf[0]; - - kalMemCopy(&prNdisReq->ndisOidContent[0], &pu4IntBuf[1], 8); - - prNdisReq->ndisOidCmd = OID_CUSTOM_MTK_WIFI_TEST; - prNdisReq->inNdisOidlength = 8; - prNdisReq->outNdisOidLength = 8; - - status = priv_get_ndis(prNetDev, prNdisReq, &u4BufLen); - if (status == 0) { - //printk("Result=%ld\n", *(PUINT_32)&prNdisReq->ndisOidContent[4]); - prIwReqData->mode = *(PUINT_32)&prNdisReq->ndisOidContent[4]; - /* - if (copy_to_user(prIwReqData->data.pointer, - &prNdisReq->ndisOidContent[4], 4)) { - printk(KERN_NOTICE "priv_get_int() copy_to_user oidBuf fail(3)\n"); - return -EFAULT; - } - */ - } - return status; - -#if CFG_SUPPORT_PRIV_MCR_RW - case PRIV_CMD_ACCESS_MCR: - //printk("addr=0x%08lx\n", pu4IntBuf[1]); - prNdisReq = (P_NDIS_TRANSPORT_STRUCT) &aucOidBuf[0]; - - if (!prGlueInfo->fgMcrAccessAllowed) { - status = 0; - return status; - } - - kalMemCopy(&prNdisReq->ndisOidContent[0], &pu4IntBuf[1], 8); - - prNdisReq->ndisOidCmd = OID_CUSTOM_MCR_RW; - prNdisReq->inNdisOidlength = 8; - prNdisReq->outNdisOidLength = 8; - - status = priv_get_ndis(prNetDev, prNdisReq, &u4BufLen); - if (status == 0) { - //printk("Result=%ld\n", *(PUINT_32)&prNdisReq->ndisOidContent[4]); - prIwReqData->mode = *(PUINT_32)&prNdisReq->ndisOidContent[4]; - } - return status; -#endif - - case PRIV_CMD_DUMP_MEM: - prNdisReq = (P_NDIS_TRANSPORT_STRUCT) &aucOidBuf[0]; - -#if 1 - if (!prGlueInfo->fgMcrAccessAllowed) { - status = 0; - return status; - } -#endif - kalMemCopy(&prNdisReq->ndisOidContent[0], &pu4IntBuf[1], 8); - - prNdisReq->ndisOidCmd = OID_CUSTOM_MEM_DUMP; - prNdisReq->inNdisOidlength = 8; - prNdisReq->outNdisOidLength = 8; - - status = priv_get_ndis(prNetDev, prNdisReq, &u4BufLen); - if (status == 0) { - prIwReqData->mode = *(PUINT_32)&prNdisReq->ndisOidContent[0]; - } - return status; - - case PRIV_CMD_SW_CTRL: - //printk(" addr=0x%08lx\n", pu4IntBuf[1]); - - prNdisReq = (P_NDIS_TRANSPORT_STRUCT) &aucOidBuf[0]; - - kalMemCopy(&prNdisReq->ndisOidContent[0], &pu4IntBuf[1], 8); - - prNdisReq->ndisOidCmd = OID_CUSTOM_SW_CTRL; - prNdisReq->inNdisOidlength = 8; - prNdisReq->outNdisOidLength = 8; - - status = priv_get_ndis(prNetDev, prNdisReq, &u4BufLen); - if (status == 0) { - //printk("Result=%ld\n", *(PUINT_32)&prNdisReq->ndisOidContent[4]); - prIwReqData->mode = *(PUINT_32)&prNdisReq->ndisOidContent[4]; - } - return status; - - #if 0 - case PRIV_CMD_BEACON_PERIOD: - status = wlanQueryInformation(prGlueInfo->prAdapter, - wlanoidQueryBeaconInterval, - (PVOID)pu4IntBuf, - sizeof(UINT_32), - &u4BufLen); - return status; - - case PRIV_CMD_POWER_MODE: - status = wlanQueryInformation(prGlueInfo->prAdapter, - wlanoidQuery802dot11PowerSaveProfile, - (PVOID)pu4IntBuf, - sizeof(UINT_32), - &u4BufLen); - return status; - - case PRIV_CMD_ADHOC_MODE: - status = wlanQueryInformation(prGlueInfo->prAdapter, - wlanoidQueryAdHocMode, - (PVOID)pu4IntBuf, - sizeof(UINT_32), - &u4BufLen); - return status; - #endif - - case PRIV_CMD_BAND_CONFIG: - DBGLOG(INIT, INFO, ("CMD get_band=\n")); - prIwReqData->mode = 0; - return status; - - default: - break; - } - - u4SubCmd = (UINT_32) prIwReqData->data.flags; - - switch (u4SubCmd) { - case PRIV_CMD_GET_CH_LIST: - { - UINT_16 i, j = 0; - UINT_8 NumOfChannel = 50; - UINT_8 ucMaxChannelNum = 50; - RF_CHANNEL_INFO_T aucChannelList[50]; - - kalGetChannelList(prGlueInfo, BAND_NULL, ucMaxChannelNum, &NumOfChannel, aucChannelList); - if (NumOfChannel > 50) - NumOfChannel = 50; - - if (kalIsAPmode(prGlueInfo)) { - for (i = 0; i < NumOfChannel; i++) { - if ((aucChannelList[i].ucChannelNum <= 13) || - (aucChannelList[i].ucChannelNum == 36 || aucChannelList[i].ucChannelNum == 40 || - aucChannelList[i].ucChannelNum == 44 || aucChannelList[i].ucChannelNum == 48)) { - ch[j] = (INT_32)aucChannelList[i].ucChannelNum; - j++; - } - } - } - else { - for (j = 0; j < NumOfChannel; j++) { - ch[j] = (INT_32)aucChannelList[j].ucChannelNum; - } - } - - prIwReqData->data.length = j; - if (copy_to_user(prIwReqData->data.pointer, ch, NumOfChannel*sizeof(INT_32))) { - return -EFAULT; - } - else - return status; - } - default: - return -EOPNOTSUPP; - } - - return status; -} /* priv_get_int */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Private ioctl set int array handler. -* -* \param[in] prNetDev Net device requested. -* \param[in] prIwReqInfo Pointer to iwreq structure. -* \param[in] prIwReqData The ioctl data structure, use the field of sub-command. -* \param[in] pcExtra The buffer with input value -* -* \retval 0 For success. -* \retval -EOPNOTSUPP If cmd is not supported. -* \retval -EINVAL If a value is out of range. -* -*/ -/*----------------------------------------------------------------------------*/ -int -priv_set_ints ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN union iwreq_data *prIwReqData, - IN char *pcExtra - ) -{ - UINT_32 u4SubCmd, u4BufLen; - P_GLUE_INFO_T prGlueInfo; - int status = 0; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - P_SET_TXPWR_CTRL_T prTxpwr; - - ASSERT(prNetDev); - ASSERT(prIwReqInfo); - ASSERT(prIwReqData); - ASSERT(pcExtra); - - if (FALSE == GLUE_CHK_PR3(prNetDev, prIwReqData, pcExtra)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - u4SubCmd = (UINT_32) prIwReqData->data.flags; - - switch (u4SubCmd) { - case PRIV_CMD_SET_TX_POWER: - { - INT_32 *setting = prIwReqData->data.pointer; - UINT_16 i; - -#if 0 - printk("Tx power num = %d\n", prIwReqData->data.length); - - printk("Tx power setting = %d %d %d %d\n", - setting[0], setting[1], setting[2], setting[3]); -#endif - prTxpwr = &prGlueInfo->rTxPwr; - if (setting[0] == 0 && prIwReqData->data.length == 4 /* argc num */) { - /* 0 (All networks), 1 (legacy STA), 2 (Hotspot AP), 3 (P2P), 4 (BT over Wi-Fi) */ - if (setting[1] == 1 || setting[1] == 0) { - if (setting[2] == 0 || setting[2] == 1) - prTxpwr->c2GLegacyStaPwrOffset = setting[3]; - if (setting[2] == 0 || setting[2] == 2) - prTxpwr->c5GLegacyStaPwrOffset = setting[3]; - } - if (setting[1] == 2 || setting[1] == 0) { - if (setting[2] == 0 || setting[2] == 1) - prTxpwr->c2GHotspotPwrOffset = setting[3]; - if (setting[2] == 0 || setting[2] == 2) - prTxpwr->c5GHotspotPwrOffset = setting[3]; - } - if (setting[1] == 3 || setting[1] == 0) { - if (setting[2] == 0 || setting[2] == 1) - prTxpwr->c2GP2pPwrOffset = setting[3]; - if (setting[2] == 0 || setting[2] == 2) - prTxpwr->c5GP2pPwrOffset = setting[3]; - } - if (setting[1] == 4 || setting[1] == 0) { - if (setting[2] == 0 || setting[2] == 1) - prTxpwr->c2GBowPwrOffset = setting[3]; - if (setting[2] == 0 || setting[2] == 2) - prTxpwr->c5GBowPwrOffset = setting[3]; - } - } - else if (setting[0] == 1 && prIwReqData->data.length == 2) { - prTxpwr->ucConcurrencePolicy = setting[1]; - } - else if (setting[0] == 2 && prIwReqData->data.length == 3) { - if (setting[1] == 0) { - for (i=0; i<14; i++) - prTxpwr->acTxPwrLimit2G[i] = setting[2]; - } - else if (setting[1] <= 14) - prTxpwr->acTxPwrLimit2G[setting[1] - 1] = setting[2]; - } - else if (setting[0] == 3 && prIwReqData->data.length == 3) { - if (setting[1] == 0) { - for (i=0; i<4; i++) - prTxpwr->acTxPwrLimit5G[i] = setting[2]; - } - else if (setting[1] <= 4) - prTxpwr->acTxPwrLimit5G[setting[1] - 1] = setting[2]; - } - else if (setting[0] == 4 && prIwReqData->data.length == 2) { - if (setting[1] == 0) { - wlanDefTxPowerCfg(prGlueInfo->prAdapter); - } - rStatus = kalIoctl(prGlueInfo, - wlanoidSetTxPower, - prTxpwr, - sizeof(SET_TXPWR_CTRL_T), - TRUE, - FALSE, - FALSE, - FALSE, - &u4BufLen); - } - else - return -EFAULT; - } - return status; - default: - break; - } - - return status; -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Private ioctl get int array handler. -* -* \param[in] pDev Net device requested. -* \param[out] pIwReq Pointer to iwreq structure. -* \param[in] prIwReqData The ioctl req structure, use the field of sub-command. -* \param[out] pcExtra The buffer with put the return value -* -* \retval 0 For success. -* \retval -EOPNOTSUPP If cmd is not supported. -* \retval -EFAULT For fail. -* -*/ -/*----------------------------------------------------------------------------*/ -int -priv_get_ints ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN union iwreq_data *prIwReqData, - IN OUT char *pcExtra - ) -{ - UINT_32 u4SubCmd; - P_GLUE_INFO_T prGlueInfo; - int status = 0; - INT_32 ch[50]; - - ASSERT(prNetDev); - ASSERT(prIwReqInfo); - ASSERT(prIwReqData); - ASSERT(pcExtra); - if (FALSE == GLUE_CHK_PR3(prNetDev, prIwReqData, pcExtra)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - u4SubCmd = (UINT_32) prIwReqData->data.flags; - - switch (u4SubCmd) { - case PRIV_CMD_GET_CH_LIST: - { - UINT_16 i; - UINT_8 NumOfChannel = 50; - UINT_8 ucMaxChannelNum = 50; - RF_CHANNEL_INFO_T aucChannelList[50]; - - kalGetChannelList(prGlueInfo, BAND_NULL, ucMaxChannelNum, &NumOfChannel, aucChannelList); - if (NumOfChannel > 50) - NumOfChannel = 50; - - for (i = 0; i < NumOfChannel; i++) { - ch[i] = (INT_32)aucChannelList[i].ucChannelNum; - } - - prIwReqData->data.length = NumOfChannel; - if (copy_to_user(prIwReqData->data.pointer, ch, NumOfChannel*sizeof(INT_32))) { - return -EFAULT; - } - else - return status; - } - default: - break; - } - - return status; -} /* priv_get_int */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Private ioctl set structure handler. -* -* \param[in] pDev Net device requested. -* \param[in] prIwReqData Pointer to iwreq_data structure. -* -* \retval 0 For success. -* \retval -EOPNOTSUPP If cmd is not supported. -* \retval -EINVAL If a value is out of range. -* -*/ -/*----------------------------------------------------------------------------*/ -int -priv_set_struct ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN union iwreq_data *prIwReqData, - IN char *pcExtra - ) -{ - UINT_32 u4SubCmd = 0; - int status = 0; - //WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4CmdLen = 0; - P_NDIS_TRANSPORT_STRUCT prNdisReq; - PUINT_32 pu4IntBuf = NULL; - - P_GLUE_INFO_T prGlueInfo = NULL; - UINT_32 u4BufLen = 0; - - ASSERT(prNetDev); - //ASSERT(prIwReqInfo); - ASSERT(prIwReqData); - //ASSERT(pcExtra); - - kalMemZero(&aucOidBuf[0], sizeof(aucOidBuf)); - - if (FALSE == GLUE_CHK_PR2(prNetDev, prIwReqData)) { - return -EINVAL; - } - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - - u4SubCmd = (UINT_32) prIwReqData->data.flags; - -#if 0 - printk(KERN_INFO DRV_NAME"priv_set_struct(): prIwReqInfo->cmd(0x%X), u4SubCmd(%ld)\n", - prIwReqInfo->cmd, - u4SubCmd - ); -#endif - - switch (u4SubCmd) { -#if 0 //PTA_ENABLED - case PRIV_CMD_BT_COEXIST: - u4CmdLen = prIwReqData->data.length * sizeof(UINT_32); - ASSERT(sizeof(PARAM_CUSTOM_BT_COEXIST_T) >= u4CmdLen); - if (sizeof(PARAM_CUSTOM_BT_COEXIST_T) < u4CmdLen) { - return -EFAULT; - } - - if (copy_from_user(&aucOidBuf[0], prIwReqData->data.pointer, u4CmdLen)) { - status = -EFAULT; //return -EFAULT; - break; - } - - rStatus = wlanSetInformation(prGlueInfo->prAdapter, - wlanoidSetBtCoexistCtrl, - (PVOID)&aucOidBuf[0], - u4CmdLen, - &u4BufLen); - if (WLAN_STATUS_SUCCESS != rStatus) { - status = -EFAULT; - } - break; -#endif - - case PRIV_CUSTOM_BWCS_CMD: - u4CmdLen = prIwReqData->data.length * sizeof(UINT_32); - ASSERT(sizeof(PARAM_PTA_IPC_T) >= u4CmdLen); - if (sizeof(PARAM_PTA_IPC_T) < u4CmdLen) { - return -EFAULT; - } -#if CFG_SUPPORT_BCM && CFG_SUPPORT_BCM_BWCS && CFG_SUPPORT_BCM_BWCS_DEBUG - DBGLOG(REQ, INFO, ("ucCmdLen = %d, size of PTA_IPC_T = %d, prIwReqData->data = 0x%x.\n", u4CmdLen, sizeof(PARAM_PTA_IPC_T), prIwReqData->data)); - - DBGLOG(REQ, INFO, ("priv_set_struct(): prIwReqInfo->cmd(0x%X), u4SubCmd(%ld)\n", - prIwReqInfo->cmd, - u4SubCmd - )); - - DBGLOG(REQ, INFO, ("*pcExtra = 0x%x\n", *pcExtra)); - #endif - - if (copy_from_user(&aucOidBuf[0], prIwReqData->data.pointer, u4CmdLen)) { - status = -EFAULT; //return -EFAULT; - break; - } -#if CFG_SUPPORT_BCM && CFG_SUPPORT_BCM_BWCS && CFG_SUPPORT_BCM_BWCS_DEBUG - DBGLOG(REQ, INFO, ("priv_set_struct(): BWCS CMD = %02x%02x%02x%02x\n", - aucOidBuf[2], aucOidBuf[3], aucOidBuf[4], aucOidBuf[5])); -#endif - -#if 0 - status = wlanSetInformation(prGlueInfo->prAdapter, - wlanoidSetBT, - (PVOID)&aucOidBuf[0], - u4CmdLen, - &u4BufLen); -#endif - -#if 1 - status = wlanoidSetBT(prGlueInfo->prAdapter, - (PVOID)&aucOidBuf[0], - u4CmdLen, - &u4BufLen); -#endif - - if (WLAN_STATUS_SUCCESS != status) { - status = -EFAULT; - } - - break; - -#if CFG_SUPPORT_WPS2 - case PRIV_CMD_WSC_PROBE_REQ: - { - /* retrieve IE for Probe Request */ - if (prIwReqData->data.length > 0) { - if (copy_from_user(prGlueInfo->aucWSCIE, prIwReqData->data.pointer, - prIwReqData->data.length)) { - status = -EFAULT; - break; - } - prGlueInfo->u2WSCIELen = prIwReqData->data.length; - } - else { - prGlueInfo->u2WSCIELen = 0; - } - } - break; -#endif - case PRIV_CMD_OID: - if (copy_from_user(&aucOidBuf[0], - prIwReqData->data.pointer, - prIwReqData->data.length)) { - status = -EFAULT; - break; - } - if (!kalMemCmp(&aucOidBuf[0], pcExtra, prIwReqData->data.length)) { - DBGLOG(REQ, INFO, ("pcExtra buffer is valid\n")); - } - else - DBGLOG(REQ, INFO, ("pcExtra 0x%p\n", pcExtra)); - - /* Execute this OID */ - status = priv_set_ndis(prNetDev, (P_NDIS_TRANSPORT_STRUCT)&aucOidBuf[0], &u4BufLen); - /* Copy result to user space */ - ((P_NDIS_TRANSPORT_STRUCT)&aucOidBuf[0])->outNdisOidLength = u4BufLen; - - if (copy_to_user(prIwReqData->data.pointer, - &aucOidBuf[0], - OFFSET_OF(NDIS_TRANSPORT_STRUCT, ndisOidContent))) { - DBGLOG(REQ, INFO, ("copy_to_user oidBuf fail\n")); - status = -EFAULT; - } - - break; - - case PRIV_CMD_SW_CTRL: - pu4IntBuf = (PUINT_32)prIwReqData->data.pointer; - prNdisReq = (P_NDIS_TRANSPORT_STRUCT) &aucOidBuf[0]; - - //kalMemCopy(&prNdisReq->ndisOidContent[0], prIwReqData->data.pointer, 8); - if (copy_from_user(&prNdisReq->ndisOidContent[0], - prIwReqData->data.pointer, - prIwReqData->data.length)) { - status = -EFAULT; - break; - } - prNdisReq->ndisOidCmd = OID_CUSTOM_SW_CTRL; - prNdisReq->inNdisOidlength = 8; - prNdisReq->outNdisOidLength = 8; - - /* Execute this OID */ - status = priv_set_ndis(prNetDev, prNdisReq, &u4BufLen); - break; - - default: - return -EOPNOTSUPP; - } - - return status; -} - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Private ioctl get struct handler. -* -* \param[in] pDev Net device requested. -* \param[out] pIwReq Pointer to iwreq structure. -* \param[in] cmd Private sub-command. -* -* \retval 0 For success. -* \retval -EFAULT If copy from user space buffer fail. -* \retval -EOPNOTSUPP Parameter "cmd" not recognized. -* -*/ -/*----------------------------------------------------------------------------*/ -int -priv_get_struct ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN union iwreq_data *prIwReqData, - IN OUT char *pcExtra - ) -{ - UINT_32 u4SubCmd = 0; - P_NDIS_TRANSPORT_STRUCT prNdisReq= NULL; - - P_GLUE_INFO_T prGlueInfo = NULL; - UINT_32 u4BufLen = 0; - PUINT_32 pu4IntBuf = NULL; - int status = 0; - - kalMemZero(&aucOidBuf[0], sizeof(aucOidBuf)); - - ASSERT(prNetDev); - ASSERT(prIwReqData); - if (!prNetDev || !prIwReqData) { - DBGLOG(REQ, INFO, ("priv_get_struct(): invalid param(0x%p, 0x%p)\n", - prNetDev, prIwReqData)); - return -EINVAL; - } - - u4SubCmd = (UINT_32) prIwReqData->data.flags; - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - ASSERT(prGlueInfo); - if (!prGlueInfo) { - DBGLOG(REQ, INFO, ("priv_get_struct(): invalid prGlueInfo(0x%p, 0x%p)\n", - prNetDev, *((P_GLUE_INFO_T *) netdev_priv(prNetDev)))); - return -EINVAL; - } - -#if 0 - printk(KERN_INFO DRV_NAME"priv_get_struct(): prIwReqInfo->cmd(0x%X), u4SubCmd(%ld)\n", - prIwReqInfo->cmd, - u4SubCmd - ); -#endif - memset(aucOidBuf, 0, sizeof(aucOidBuf)); - - switch (u4SubCmd) { - case PRIV_CMD_OID: - if (copy_from_user(&aucOidBuf[0], - prIwReqData->data.pointer, - sizeof(NDIS_TRANSPORT_STRUCT))) { - DBGLOG(REQ, INFO, ("priv_get_struct() copy_from_user oidBuf fail\n")); - return -EFAULT; - } - - prNdisReq = (P_NDIS_TRANSPORT_STRUCT)&aucOidBuf[0]; -#if 0 - printk(KERN_NOTICE "\n priv_get_struct cmd 0x%02x len:%d OID:0x%08x OID Len:%d\n", - cmd, - pIwReq->u.data.length, - ndisReq->ndisOidCmd, - ndisReq->inNdisOidlength); -#endif - if (priv_get_ndis(prNetDev, prNdisReq, &u4BufLen) == 0) { - prNdisReq->outNdisOidLength = u4BufLen; - if (copy_to_user(prIwReqData->data.pointer, - &aucOidBuf[0], - u4BufLen + sizeof(NDIS_TRANSPORT_STRUCT) - sizeof(prNdisReq->ndisOidContent))) { - DBGLOG(REQ, INFO, ("priv_get_struct() copy_to_user oidBuf fail(1)\n")); - return -EFAULT; - } - return 0; - } - else { - prNdisReq->outNdisOidLength = u4BufLen; - if (copy_to_user(prIwReqData->data.pointer, - &aucOidBuf[0], - OFFSET_OF(NDIS_TRANSPORT_STRUCT, ndisOidContent))) { - DBGLOG(REQ, INFO, ("priv_get_struct() copy_to_user oidBuf fail(2)\n")); - } - return -EFAULT; - } - break; - - case PRIV_CMD_SW_CTRL: - pu4IntBuf = (PUINT_32)prIwReqData->data.pointer; - prNdisReq = (P_NDIS_TRANSPORT_STRUCT) &aucOidBuf[0]; - - if (copy_from_user(&prNdisReq->ndisOidContent[0], - prIwReqData->data.pointer, - prIwReqData->data.length)) { - DBGLOG(REQ, INFO, ("priv_get_struct() copy_from_user oidBuf fail\n")); - return -EFAULT; - } - - prNdisReq->ndisOidCmd = OID_CUSTOM_SW_CTRL; - prNdisReq->inNdisOidlength = 8; - prNdisReq->outNdisOidLength = 8; - - status = priv_get_ndis(prNetDev, prNdisReq, &u4BufLen); - if (status == 0) { - prNdisReq->outNdisOidLength = u4BufLen; - //printk("len=%d Result=%08lx\n", u4BufLen, *(PUINT_32)&prNdisReq->ndisOidContent[4]); - - if (copy_to_user(prIwReqData->data.pointer, - &prNdisReq->ndisOidContent[4], - 4 /* OFFSET_OF(NDIS_TRANSPORT_STRUCT, ndisOidContent)*/)) { - DBGLOG(REQ, INFO, ("priv_get_struct() copy_to_user oidBuf fail(2)\n")); - } - } - return 0; - break; - default: - DBGLOG(REQ, WARN, ("get struct cmd:0x%lx\n", u4SubCmd)); - return -EOPNOTSUPP; - } -} /* priv_get_struct */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief The routine handles a set operation for a single OID. -* -* \param[in] pDev Net device requested. -* \param[in] ndisReq Ndis request OID information copy from user. -* \param[out] outputLen_p If the call is successful, returns the number of -* bytes written into the query buffer. If the -* call failed due to invalid length of the query -* buffer, returns the amount of storage needed.. -* -* \retval 0 On success. -* \retval -EOPNOTSUPP If cmd is not supported. -* -*/ -/*----------------------------------------------------------------------------*/ -static int -priv_set_ndis ( - IN struct net_device *prNetDev, - IN NDIS_TRANSPORT_STRUCT* prNdisReq, - OUT PUINT_32 pu4OutputLen - ) -{ - P_WLAN_REQ_ENTRY prWlanReqEntry = NULL; - WLAN_STATUS status = WLAN_STATUS_SUCCESS; - P_GLUE_INFO_T prGlueInfo = NULL; - UINT_32 u4SetInfoLen = 0; - - ASSERT(prNetDev); - ASSERT(prNdisReq); - ASSERT(pu4OutputLen); - - if (!prNetDev || !prNdisReq || !pu4OutputLen) { - DBGLOG(REQ, INFO, ("priv_set_ndis(): invalid param(0x%p, 0x%p, 0x%p)\n", - prNetDev, prNdisReq, pu4OutputLen)); - return -EINVAL; - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - ASSERT(prGlueInfo); - if (!prGlueInfo) { - DBGLOG(REQ, INFO, ("priv_set_ndis(): invalid prGlueInfo(0x%p, 0x%p)\n", - prNetDev, *((P_GLUE_INFO_T *) netdev_priv(prNetDev)))); - return -EINVAL; - } - -#if 0 - printk(KERN_INFO DRV_NAME"priv_set_ndis(): prNdisReq->ndisOidCmd(0x%lX)\n", - prNdisReq->ndisOidCmd - ); -#endif - - if (FALSE == reqSearchSupportedOidEntry(prNdisReq->ndisOidCmd, - &prWlanReqEntry)) { - //WARNLOG(("Set OID: 0x%08lx (unknown)\n", prNdisReq->ndisOidCmd)); - return -EOPNOTSUPP; - } - - if (NULL == prWlanReqEntry->pfOidSetHandler) { - //WARNLOG(("Set %s: Null set handler\n", prWlanReqEntry->pucOidName)); - return -EOPNOTSUPP; - } - -#if 0 - printk(KERN_INFO DRV_NAME"priv_set_ndis(): %s\n", - prWlanReqEntry->pucOidName - ); -#endif - - if (prWlanReqEntry->fgSetBufLenChecking) { - if (prNdisReq->inNdisOidlength != prWlanReqEntry->u4InfoBufLen) { - DBGLOG(REQ, WARN, ("Set %s: Invalid length (current=%ld, needed=%ld)\n", - prWlanReqEntry->pucOidName, - prNdisReq->inNdisOidlength, - prWlanReqEntry->u4InfoBufLen)); - - *pu4OutputLen = prWlanReqEntry->u4InfoBufLen; - return -EINVAL; - } - } - - if (prWlanReqEntry->eOidMethod == ENUM_OID_GLUE_ONLY) { - /* GLUE sw info only */ - status = prWlanReqEntry->pfOidSetHandler(prGlueInfo, - prNdisReq->ndisOidContent, - prNdisReq->inNdisOidlength, - &u4SetInfoLen); - } - else if (prWlanReqEntry->eOidMethod == ENUM_OID_GLUE_EXTENSION) { - /* multiple sw operations */ - status = prWlanReqEntry->pfOidSetHandler(prGlueInfo, - prNdisReq->ndisOidContent, - prNdisReq->inNdisOidlength, - &u4SetInfoLen); - } - else if (prWlanReqEntry->eOidMethod == ENUM_OID_DRIVER_CORE) { - /* driver core*/ - - status = kalIoctl(prGlueInfo, - (PFN_OID_HANDLER_FUNC)prWlanReqEntry->pfOidSetHandler, - prNdisReq->ndisOidContent, - prNdisReq->inNdisOidlength, - FALSE, - FALSE, - TRUE, - FALSE, - &u4SetInfoLen); - } - else { - DBGLOG(REQ, INFO, ("priv_set_ndis(): unsupported OID method:0x%x\n", - prWlanReqEntry->eOidMethod)); - return -EOPNOTSUPP; - } - - *pu4OutputLen = u4SetInfoLen; - - switch (status) { - case WLAN_STATUS_SUCCESS: - break; - - case WLAN_STATUS_INVALID_LENGTH: - //WARNLOG(("Set %s: Invalid length (current=%ld, needed=%ld)\n", - // prWlanReqEntry->pucOidName, - //prNdisReq->inNdisOidlength, - //u4SetInfoLen)); - break; - } - - if (WLAN_STATUS_SUCCESS != status) { - return -EFAULT; - } - - return 0; -} /* priv_set_ndis */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief The routine handles a query operation for a single OID. Basically we -* return information about the current state of the OID in question. -* -* \param[in] pDev Net device requested. -* \param[in] ndisReq Ndis request OID information copy from user. -* \param[out] outputLen_p If the call is successful, returns the number of -* bytes written into the query buffer. If the -* call failed due to invalid length of the query -* buffer, returns the amount of storage needed.. -* -* \retval 0 On success. -* \retval -EOPNOTSUPP If cmd is not supported. -* \retval -EINVAL invalid input parameters -* -*/ -/*----------------------------------------------------------------------------*/ -static int -priv_get_ndis ( - IN struct net_device *prNetDev, - IN NDIS_TRANSPORT_STRUCT* prNdisReq, - OUT PUINT_32 pu4OutputLen - ) -{ - P_WLAN_REQ_ENTRY prWlanReqEntry = NULL; - UINT_32 u4BufLen = 0; - WLAN_STATUS status = WLAN_STATUS_SUCCESS; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(prNetDev); - ASSERT(prNdisReq); - ASSERT(pu4OutputLen); - - if (!prNetDev || !prNdisReq || !pu4OutputLen) { - DBGLOG(REQ, INFO, ("priv_get_ndis(): invalid param(0x%p, 0x%p, 0x%p)\n", - prNetDev, prNdisReq, pu4OutputLen)); - return -EINVAL; - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prNetDev)); - ASSERT(prGlueInfo); - if (!prGlueInfo) { - DBGLOG(REQ, INFO, ("priv_get_ndis(): invalid prGlueInfo(0x%p, 0x%p)\n", - prNetDev, *((P_GLUE_INFO_T *) netdev_priv(prNetDev)))); - return -EINVAL; - } - -#if 0 - printk(KERN_INFO DRV_NAME"priv_get_ndis(): prNdisReq->ndisOidCmd(0x%lX)\n", - prNdisReq->ndisOidCmd - ); -#endif - - if (FALSE == reqSearchSupportedOidEntry(prNdisReq->ndisOidCmd, - &prWlanReqEntry)) { - //WARNLOG(("Query OID: 0x%08lx (unknown)\n", prNdisReq->ndisOidCmd)); - return -EOPNOTSUPP; - } - - - if (NULL == prWlanReqEntry->pfOidQueryHandler) { - //WARNLOG(("Query %s: Null query handler\n", prWlanReqEntry->pucOidName)); - return -EOPNOTSUPP; - } - -#if 0 - printk(KERN_INFO DRV_NAME"priv_get_ndis(): %s\n", - prWlanReqEntry->pucOidName - ); -#endif - - if (prWlanReqEntry->fgQryBufLenChecking) { - if (prNdisReq->inNdisOidlength < prWlanReqEntry->u4InfoBufLen) { - /* Not enough room in InformationBuffer. Punt */ - //WARNLOG(("Query %s: Buffer too short (current=%ld, needed=%ld)\n", - //prWlanReqEntry->pucOidName, - //prNdisReq->inNdisOidlength, - //prWlanReqEntry->u4InfoBufLen)); - - *pu4OutputLen = prWlanReqEntry->u4InfoBufLen; - - status = WLAN_STATUS_INVALID_LENGTH; - return -EINVAL; - } - } - - - if (prWlanReqEntry->eOidMethod == ENUM_OID_GLUE_ONLY) { - /* GLUE sw info only */ - status = prWlanReqEntry->pfOidQueryHandler(prGlueInfo, - prNdisReq->ndisOidContent, - prNdisReq->inNdisOidlength, - &u4BufLen); - } - else if (prWlanReqEntry->eOidMethod == ENUM_OID_GLUE_EXTENSION) { - /* multiple sw operations */ - status = prWlanReqEntry->pfOidQueryHandler(prGlueInfo, - prNdisReq->ndisOidContent, - prNdisReq->inNdisOidlength, - &u4BufLen); - } - else if (prWlanReqEntry->eOidMethod == ENUM_OID_DRIVER_CORE) { - /* driver core*/ - - status = kalIoctl(prGlueInfo, - (PFN_OID_HANDLER_FUNC)prWlanReqEntry->pfOidQueryHandler, - prNdisReq->ndisOidContent, - prNdisReq->inNdisOidlength, - TRUE, - TRUE, - TRUE, - FALSE, - &u4BufLen); - } - else { - DBGLOG(REQ, INFO, ("priv_set_ndis(): unsupported OID method:0x%x\n", - prWlanReqEntry->eOidMethod)); - return -EOPNOTSUPP; - } - - *pu4OutputLen = u4BufLen; - - switch (status) { - case WLAN_STATUS_SUCCESS: - break; - - case WLAN_STATUS_INVALID_LENGTH: - //WARNLOG(("Set %s: Invalid length (current=%ld, needed=%ld)\n", - // prWlanReqEntry->pucOidName, - //prNdisReq->inNdisOidlength, - //u4BufLen)); - break; - } - - if (WLAN_STATUS_SUCCESS != status) { - return -EOPNOTSUPP; - } - - return 0; -} /* priv_get_ndis */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to search desired OID. -* -* \param rOid[in] Desired NDIS_OID -* \param ppWlanReqEntry[out] Found registered OID entry -* -* \retval TRUE: Matched OID is found -* \retval FALSE: No matched OID is found -*/ -/*----------------------------------------------------------------------------*/ -static BOOLEAN -reqSearchSupportedOidEntry ( - IN UINT_32 rOid, - OUT P_WLAN_REQ_ENTRY *ppWlanReqEntry - ) -{ - INT_32 i, j, k; - - i = 0; - j = NUM_SUPPORTED_OIDS - 1; - - while (i <= j) { - k = (i + j) / 2; - - if (rOid == arWlanOidReqTable[k].rOid) { - *ppWlanReqEntry = &arWlanOidReqTable[k]; - return TRUE; - } else if (rOid < arWlanOidReqTable[k].rOid) { - j = k - 1; - } else { - i = k + 1; - } - } - - return FALSE; -} /* reqSearchSupportedOidEntry */ - -#if 0 -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to query the radio configuration used in IBSS -* mode and RF test mode. -* -* \param[in] prGlueInfo Pointer to the GLUE_INFO_T structure. -* \param[out] pvQueryBuffer Pointer to the buffer that holds the result of the query. -* \param[in] u4QueryBufferLen The length of the query buffer. -* \param[out] pu4QueryInfoLen If the call is successful, returns the number of -* bytes written into the query buffer. If the call -* failed due to invalid length of the query buffer, -* returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -*/ -/*----------------------------------------------------------------------------*/ -static WLAN_STATUS -reqExtQueryConfiguration ( - IN P_GLUE_INFO_T prGlueInfo, - OUT PVOID pvQueryBuffer, - IN UINT_32 u4QueryBufferLen, - OUT PUINT_32 pu4QueryInfoLen - ) -{ - P_PARAM_802_11_CONFIG_T prQueryConfig = (P_PARAM_802_11_CONFIG_T)pvQueryBuffer; - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - UINT_32 u4QueryInfoLen = 0; - - DEBUGFUNC("wlanoidQueryConfiguration"); - - - ASSERT(prGlueInfo); - ASSERT(pu4QueryInfoLen); - - *pu4QueryInfoLen = sizeof(PARAM_802_11_CONFIG_T); - if (u4QueryBufferLen < sizeof(PARAM_802_11_CONFIG_T)) { - return WLAN_STATUS_INVALID_LENGTH; - } - - ASSERT(pvQueryBuffer); - - kalMemZero(prQueryConfig, sizeof(PARAM_802_11_CONFIG_T)); - - /* Update the current radio configuration. */ - prQueryConfig->u4Length = sizeof(PARAM_802_11_CONFIG_T); - -#if defined(_HIF_SDIO) - rStatus = sdio_io_ctrl(prGlueInfo, - wlanoidSetBeaconInterval, - &prQueryConfig->u4BeaconPeriod, - sizeof(UINT_32), - TRUE, - TRUE, - &u4QueryInfoLen); -#else - rStatus = wlanQueryInformation(prGlueInfo->prAdapter, - wlanoidQueryBeaconInterval, - &prQueryConfig->u4BeaconPeriod, - sizeof(UINT_32), - &u4QueryInfoLen); -#endif - if (rStatus != WLAN_STATUS_SUCCESS) { - return rStatus; - } - -#if defined(_HIF_SDIO) - rStatus = sdio_io_ctrl(prGlueInfo, - wlanoidQueryAtimWindow, - &prQueryConfig->u4ATIMWindow, - sizeof(UINT_32), - TRUE, - TRUE, - &u4QueryInfoLen); -#else - rStatus = wlanQueryInformation(prGlueInfo->prAdapter, - wlanoidQueryAtimWindow, - &prQueryConfig->u4ATIMWindow, - sizeof(UINT_32), - &u4QueryInfoLen); -#endif - if (rStatus != WLAN_STATUS_SUCCESS) { - return rStatus; - } - -#if defined(_HIF_SDIO) - rStatus = sdio_io_ctrl(prGlueInfo, - wlanoidQueryFrequency, - &prQueryConfig->u4DSConfig, - sizeof(UINT_32), - TRUE, - TRUE, - &u4QueryInfoLen); -#else - rStatus = wlanQueryInformation(prGlueInfo->prAdapter, - wlanoidQueryFrequency, - &prQueryConfig->u4DSConfig, - sizeof(UINT_32), - &u4QueryInfoLen); -#endif - if (rStatus != WLAN_STATUS_SUCCESS) { - return rStatus; - } - - prQueryConfig->rFHConfig.u4Length = sizeof(PARAM_802_11_CONFIG_FH_T); - - return rStatus; - -} /* end of reqExtQueryConfiguration() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set the radio configuration used in IBSS -* mode. -* -* \param[in] prGlueInfo Pointer to the GLUE_INFO_T structure. -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set. -* \param[in] u4SetBufferLen The length of the set buffer. -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed -* due to invalid length of the set buffer, returns -* the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_LENGTH -* \retval WLAN_STATUS_NOT_ACCEPTED -*/ -/*----------------------------------------------------------------------------*/ -static WLAN_STATUS -reqExtSetConfiguration ( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - P_PARAM_802_11_CONFIG_T prNewConfig = (P_PARAM_802_11_CONFIG_T)pvSetBuffer; - UINT_32 u4SetInfoLen = 0; - - DEBUGFUNC("wlanoidSetConfiguration"); - - - ASSERT(prGlueInfo); - ASSERT(pu4SetInfoLen); - - *pu4SetInfoLen = sizeof(PARAM_802_11_CONFIG_T); - - if (u4SetBufferLen < *pu4SetInfoLen) { - return WLAN_STATUS_INVALID_LENGTH; - } - - /* OID_802_11_CONFIGURATION. If associated, NOT_ACCEPTED shall be returned. */ - if (prGlueInfo->eParamMediaStateIndicated == PARAM_MEDIA_STATE_CONNECTED) { - return WLAN_STATUS_NOT_ACCEPTED; - } - - ASSERT(pvSetBuffer); - -#if defined(_HIF_SDIO) - rStatus = sdio_io_ctrl(prGlueInfo, - wlanoidSetBeaconInterval, - &prNewConfig->u4BeaconPeriod, - sizeof(UINT_32), - FALSE, - TRUE, - &u4SetInfoLen); -#else - rStatus = wlanSetInformation(prGlueInfo->prAdapter, - wlanoidSetBeaconInterval, - &prNewConfig->u4BeaconPeriod, - sizeof(UINT_32), - &u4SetInfoLen); -#endif - if (rStatus != WLAN_STATUS_SUCCESS) { - return rStatus; - } - -#if defined(_HIF_SDIO) - rStatus = sdio_io_ctrl(prGlueInfo, - wlanoidSetAtimWindow, - &prNewConfig->u4ATIMWindow, - sizeof(UINT_32), - FALSE, - TRUE, - &u4SetInfoLen); -#else - rStatus = wlanSetInformation(prGlueInfo->prAdapter, - wlanoidSetAtimWindow, - &prNewConfig->u4ATIMWindow, - sizeof(UINT_32), - &u4SetInfoLen); -#endif - if (rStatus != WLAN_STATUS_SUCCESS) { - return rStatus; - } - -#if defined(_HIF_SDIO) - rStatus = sdio_io_ctrl(prGlueInfo, - wlanoidSetFrequency, - &prNewConfig->u4DSConfig, - sizeof(UINT_32), - FALSE, - TRUE, - &u4SetInfoLen); -#else - rStatus = wlanSetInformation(prGlueInfo->prAdapter, - wlanoidSetFrequency, - &prNewConfig->u4DSConfig, - sizeof(UINT_32), - &u4SetInfoLen); -#endif - - if (rStatus != WLAN_STATUS_SUCCESS) { - return rStatus; - } - - return rStatus; - -} /* end of reqExtSetConfiguration() */ - -#endif -/*----------------------------------------------------------------------------*/ -/*! -* \brief This routine is called to set beacon detection function enable/disable state -* This is mainly designed for usage under BT inquiry state (disable function). -* -* \param[in] pvAdapter Pointer to the Adapter structure -* \param[in] pvSetBuffer A pointer to the buffer that holds the data to be set -* \param[in] u4SetBufferLen The length of the set buffer -* \param[out] pu4SetInfoLen If the call is successful, returns the number of -* bytes read from the set buffer. If the call failed due to invalid length of -* the set buffer, returns the amount of storage needed. -* -* \retval WLAN_STATUS_SUCCESS -* \retval WLAN_STATUS_INVALID_DATA If new setting value is wrong. -* \retval WLAN_STATUS_INVALID_LENGTH -* -*/ -/*----------------------------------------------------------------------------*/ -static WLAN_STATUS -reqExtSetAcpiDevicePowerState ( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID pvSetBuffer, - IN UINT_32 u4SetBufferLen, - OUT PUINT_32 pu4SetInfoLen - ) -{ - WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS; - - ASSERT(prGlueInfo); - ASSERT(pvSetBuffer); - ASSERT(pu4SetInfoLen); - - /* WIFI is enabled, when ACPI is D0 (ParamDeviceStateD0 = 1). And vice versa */ - - //rStatus = wlanSetInformation(prGlueInfo->prAdapter, - // wlanoidSetAcpiDevicePowerState, - // pvSetBuffer, - // u4SetBufferLen, - // pu4SetInfoLen); - return rStatus; -} - diff --git a/drivers/net/wireless/mt5931/os/linux/hif/sdio/arm.c b/drivers/net/wireless/mt5931/os/linux/hif/sdio/arm.c deleted file mode 100755 index 4322fa303a71..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/hif/sdio/arm.c +++ /dev/null @@ -1,33 +0,0 @@ -/****************************************************************************** -*[File] mt6516-evb.c -*[Version] v1.0 -*[Revision Date] 2010-03-01 -*[Author] -*[Description] -* dummy file for build system -*[Copyright] -* Copyright (C) 2010 MediaTek Incorporation. All Rights Reserved. -******************************************************************************/ - - - -/* -** $Log: mt6516-evb.c $ - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 04 19 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * remove debug message - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port -** -*/ diff --git a/drivers/net/wireless/mt5931/os/linux/hif/sdio/include/hif.h b/drivers/net/wireless/mt5931/os/linux/hif/sdio/include/hif.h deleted file mode 100755 index 23eac4684d56..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/hif/sdio/include/hif.h +++ /dev/null @@ -1,225 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/hif/sdio/include/hif.h#1 $ -*/ - -/*! \file "hif.h" - \brief Functions for the driver to register bus and setup the IRQ - - Functions for the driver to register bus and setup the IRQ -*/ - - - -/* -** $Log: hif.h $ - * - * 11 01 2010 yarco.yang - * [WCXRP00000149] [MT6620 WI-Fi][Driver]Fine tune performance on MT6516 platform - * Add GPIO debug function - * - * 10 19 2010 jeffrey.chang - * [WCXRP00000120] [MT6620 Wi-Fi][Driver] Refine linux kernel module to the license of MTK propietary and enable MTK HIF by default - * Refine linux kernel module to the license of MTK and enable MTK HIF - * - * 08 18 2010 jeffrey.chang - * NULL - * support multi-function sdio - * - * 08 17 2010 cp.wu - * NULL - * add ENE SDIO host workaround for x86 linux platform. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port -** \main\maintrunk.MT5921\4 2009-10-20 17:38:28 GMT mtk01090 -** Refine driver unloading and clean up procedure. Block requests, stop main thread and clean up queued requests, and then stop hw. -** \main\maintrunk.MT5921\3 2009-09-28 20:19:20 GMT mtk01090 -** Add private ioctl to carry OID structures. Restructure public/private ioctl interfaces to Linux kernel. -** \main\maintrunk.MT5921\2 2009-08-18 22:57:05 GMT mtk01090 -** Add Linux SDIO (with mmc core) support. -** Add Linux 2.6.21, 2.6.25, 2.6.26. -** Fix compile warning in Linux. -** \main\maintrunk.MT5921\2 2008-09-22 23:18:17 GMT mtk01461 -** Update driver for code review -** Revision 1.1 2007/07/05 07:25:33 MTK01461 -** Add Linux initial code, modify doc, add 11BB, RF init code -** -** Revision 1.3 2007/06/27 02:18:51 MTK01461 -** Update SCAN_FSM, Initial(Can Load Module), Proc(Can do Reg R/W), TX API -** -*/ - -#ifndef _HIF_H -#define _HIF_H - - -#if MTK_WCN_HIF_SDIO -#include "hif_sdio.h" -#endif - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define SDIO_X86_WORKAROUND_WRITE_MCR 0x00C4 - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/* host interface's private data structure, which is attached to os glue -** layer info structure. - */ -typedef struct _GL_HIF_INFO_T { -#if MTK_WCN_HIF_SDIO - MTK_WCN_HIF_SDIO_CLTCTX cltCtx; - const MTK_WCN_HIF_SDIO_FUNCINFO *prFuncInfo; -#else - struct sdio_func *func; -#endif - BOOLEAN fgIntReadClear; - BOOLEAN fgMbxReadClear; -} GL_HIF_INFO_T, *P_GL_HIF_INFO_T; - - -#if CFG_DBG_GPIO_PINS - -extern void -mtk_wcn_stp_debug_gpio_assert(UINT_32 dwIndex, UINT_32 dwMethod); - - -/* Platform DEPENDENT configurations: MT6516 GPIO pin name */ -#define GPIO_6516(x) (GPIO##x) -#define GPIO_PLATFORM(x) GPIO_6516(x) - -/* Platform independent configurations */ -#define DBG_TIE_DIR 0x40000000UL -#define DBG_LOW 0x0UL -#define DBG_HIGH 0x1UL -#define DBG_TIE_LOW (DBG_TIE_DIR | DBG_LOW) -#define DBG_TIE_HIGH (DBG_TIE_DIR | DBG_HIGH) - -#define DBG_TOGGLE(x) (0x80000000UL | x) -#define DBG_TOGGLE_NUM(x) (x & 0xFFF) -#define GPIO_INVALID 0xFFFF - -typedef enum { - IDX_ERR = 0, - IDX_TX_THREAD, - IDX_TX_REQ, - IDX_TX_PORT_WRITE, - IDX_STP_MTX_BT, - IDX_STP_MTX_FM, /* 5 */ - IDX_STP_MTX_GPS, - IDX_STP_MTX_WIFI, - IDX_STP_MTX_WMT, - IDX_LOOP_CNT, - IDX_NO_BUF, /*10 */ - IDX_BT_TX, - IDX_BT_RX, - IDX_GPS_RX, - IDX_GPS_2, - IDX_GPS_3, - IDX_GPS_TX, - IDX_STP_MAX -} DBG_PIN; - -#define DBG_MTX_OFFSET (IDX_STP_MTX_BT) /* index of mutex0 */ -#endif -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -WLAN_STATUS -glRegisterBus( - probe_card pfProbe, - remove_card pfRemove - ); - -VOID -glUnregisterBus( - remove_card pfRemove - ); - -VOID -glSetHifInfo ( - P_GLUE_INFO_T prGlueInfo, - UINT_32 u4Cookie - ); - -VOID -glClearHifInfo ( - P_GLUE_INFO_T prGlueInfo - ); - -BOOL -glBusInit ( - PVOID pvData - ); - -VOID -glBusRelease ( - PVOID pData - ); - -INT_32 -glBusSetIrq ( - PVOID pvData, - PVOID pfnIsr, - PVOID pvCookie - ); - -VOID -glBusFreeIrq ( - PVOID pvData, - PVOID pvCookie - ); - -VOID -glSetPowerState ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 ePowerMode - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#endif /* _HIF_H */ diff --git a/drivers/net/wireless/mt5931/os/linux/hif/sdio/include/hif_sdio.h b/drivers/net/wireless/mt5931/os/linux/hif/sdio/include/hif_sdio.h deleted file mode 100755 index 0ee1060276e3..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/hif/sdio/include/hif_sdio.h +++ /dev/null @@ -1,286 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/hif/sdio/include/hif_sdio.h#2 $ -*/ - -/*! \file "hif_sdio.h" - \brief - - -*/ - -/* -** $Log: $ - * - * 06 13 2012 yuche.tsai - * NULL - * Update maintrunk driver. - * Add support for driver compose assoc request frame. - * - * 05 02 2012 terry.wu - * NULL - * Fix build error if HAVE_AEE_FEATURE = n - * - * 04 12 2012 terry.wu - * NULL - * Add AEE message support - * 1) Show AEE warning(red screen) if SDIO access error occurs - - * - * 03 02 2012 terry.wu - * NULL - * Enable CFG80211 Support. - * - * 08 18 2010 jeffrey.chang - * NULL - * support multi-function sdio - * - * 07 25 2010 george.kuo - * - * Move hif_sdio driver to linux directory. - * - * 07 23 2010 george.kuo - * - * Add MT6620 driver source tree - * , including char device driver (wmt, bt, gps), stp driver, interface driver (tty ldisc and hif_sdio), and bt hci driver. -** -** -*/ - -#ifndef _HIF_SDIO_H -#define _HIF_SDIO_H -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ -#define HIF_SDIO_DEBUG (0) /* 0:trun off debug msg and assert, 1:trun off debug msg and assert */ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "mtk_porting.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define CFG_CLIENT_COUNT (9) - -#define HIF_DEFAULT_BLK_SIZE (256) -#define HIF_DEFAULT_VENDOR (0x037A) - -#define HIF_SDIO_LOG_LOUD 4 -#define HIF_SDIO_LOG_DBG 3 -#define HIF_SDIO_LOG_INFO 2 -#define HIF_SDIO_LOG_WARN 1 -#define HIF_SDIO_LOG_ERR 0 - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/* Function info provided by client driver */ -typedef struct _MTK_WCN_HIF_SDIO_FUNCINFO MTK_WCN_HIF_SDIO_FUNCINFO; - -/* Client context provided by hif_sdio driver for the following function call */ -typedef UINT32 MTK_WCN_HIF_SDIO_CLTCTX; - -/* Callback functions provided by client driver */ -typedef INT32 (*MTK_WCN_HIF_SDIO_PROBE)(MTK_WCN_HIF_SDIO_CLTCTX, const MTK_WCN_HIF_SDIO_FUNCINFO *); -typedef INT32 (*MTK_WCN_HIF_SDIO_REMOVE)(MTK_WCN_HIF_SDIO_CLTCTX); -typedef INT32 (*MTK_WCN_HIF_SDIO_IRQ)(MTK_WCN_HIF_SDIO_CLTCTX); - -/* Function info provided by client driver */ -struct _MTK_WCN_HIF_SDIO_FUNCINFO { - UINT16 manf_id; /* TPLMID_MANF: manufacturer ID */ - UINT16 card_id; /* TPLMID_CARD: card ID */ - UINT16 func_num; /* Function Number */ - UINT16 blk_sz; /* Function block size */ -}; - -/* Client info provided by client driver */ -typedef struct _MTK_WCN_HIF_SDIO_CLTINFO { - const MTK_WCN_HIF_SDIO_FUNCINFO *func_tbl; /* supported function info table */ - UINT32 func_tbl_size; /* supported function table info element number */ - MTK_WCN_HIF_SDIO_PROBE hif_clt_probe; /* callback function for probing */ - MTK_WCN_HIF_SDIO_REMOVE hif_clt_remove; /* callback function for removing */ - MTK_WCN_HIF_SDIO_IRQ hif_clt_irq; /* callback function for interrupt handling */ -} MTK_WCN_HIF_SDIO_CLTINFO; - -/* function info provided by registed function */ -typedef struct _MTK_WCN_HIF_SDIO_REGISTINFO { - const MTK_WCN_HIF_SDIO_CLTINFO *sdio_cltinfo; /* client's MTK_WCN_HIF_SDIO_CLTINFO pointer */ - const MTK_WCN_HIF_SDIO_FUNCINFO *func_info; /* supported function info pointer */ -} MTK_WCN_HIF_SDIO_REGISTINFO; - -/* Card info provided by probed function */ -typedef struct _MTK_WCN_HIF_SDIO_PROBEINFO { - struct sdio_func* func; /* probed sdio function pointer */ - void* private_data_p; /* clt's private data pointer */ - MTK_WCN_BOOL on_by_wmt; /* TRUE: on by wmt, FALSE: not on by wmt */ - /* added for sdio irq sync and mmc single_irq workaround */ - MTK_WCN_BOOL sdio_irq_enabled; /* TRUE: can handle sdio irq; FALSE: no sdio irq handling */ - INT8 clt_idx; /* registered function table info element number (initial value is -1) */ -} MTK_WCN_HIF_SDIO_PROBEINFO; - -/* work queue info needed by worker */ -typedef struct _MTK_WCN_HIF_SDIO_CLT_PROBE_WORKERINFO { - struct work_struct probe_work; /* work queue structure */ - MTK_WCN_HIF_SDIO_REGISTINFO *registinfo_p; /* MTK_WCN_HIF_SDIO_REGISTINFO pointer of the client */ - INT8 probe_idx; /* probed function table info element number (initial value is -1) */ -} MTK_WCN_HIF_SDIO_CLT_PROBE_WORKERINFO; - -/* error code returned by hif_sdio driver (use NEGATIVE number) */ -typedef enum { - HIF_SDIO_ERR_SUCCESS = 0, - HIF_SDIO_ERR_FAIL = HIF_SDIO_ERR_SUCCESS - 1, /* generic error */ - HIF_SDIO_ERR_INVALID_PARAM = HIF_SDIO_ERR_FAIL - 1, - HIF_SDIO_ERR_DUPLICATED = HIF_SDIO_ERR_INVALID_PARAM - 1, - HIF_SDIO_ERR_UNSUP_MANF_ID = HIF_SDIO_ERR_DUPLICATED - 1, - HIF_SDIO_ERR_UNSUP_CARD_ID = HIF_SDIO_ERR_UNSUP_MANF_ID - 1, - HIF_SDIO_ERR_INVALID_FUNC_NUM = HIF_SDIO_ERR_UNSUP_CARD_ID - 1, - HIF_SDIO_ERR_INVALID_BLK_SZ = HIF_SDIO_ERR_INVALID_FUNC_NUM - 1, - HIF_SDIO_ERR_NOT_PROBED = HIF_SDIO_ERR_INVALID_BLK_SZ - 1, - HIF_SDIO_ERR_ALRDY_ON = HIF_SDIO_ERR_NOT_PROBED -1, - HIF_SDIO_ERR_ALRDY_OFF = HIF_SDIO_ERR_ALRDY_ON -1, - HIF_SDIO_ERR_CLT_NOT_REG = HIF_SDIO_ERR_ALRDY_OFF - 1, -} MTK_WCN_HIF_SDIO_ERR ; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/*! - * \brief A macro used to describe an SDIO function - * - * Fill an MTK_WCN_HIF_SDIO_FUNCINFO structure with function-specific information - * - * \param manf the 16 bit manufacturer id - * \param card the 16 bit card id - * \param func the 16 bit function number - * \param b_sz the 16 bit function block size - */ -#define MTK_WCN_HIF_SDIO_FUNC(manf, card, func, b_sz) \ - .manf_id = (manf), .card_id = (card), .func_num = (func), .blk_sz = (b_sz) - -#define HIF_SDIO_LOUD_FUNC(fmt, arg...) if (gHifSdioDbgLvl >= HIF_SDIO_LOG_LOUD) { printk(KERN_INFO SDIO_TAG"[L]%s:" fmt, __FUNCTION__ ,##arg);} -#define HIF_SDIO_DBG_FUNC(fmt, arg...) if (gHifSdioDbgLvl >= HIF_SDIO_LOG_DBG) { printk(KERN_INFO SDIO_TAG"[D]%s:" fmt, __FUNCTION__ ,##arg);} -#define HIF_SDIO_INFO_FUNC(fmt, arg...) if (gHifSdioDbgLvl >= HIF_SDIO_LOG_INFO) { printk(KERN_INFO SDIO_TAG"[I]%s:" fmt, __FUNCTION__ ,##arg);} -#define HIF_SDIO_WARN_FUNC(fmt, arg...) if (gHifSdioDbgLvl >= HIF_SDIO_LOG_WARN) { printk(KERN_WARNING SDIO_TAG"[W]%s(%d):" fmt, __FUNCTION__ , __LINE__, ##arg);} -#define HIF_SDIO_ERR_FUNC(fmt, arg...) if (gHifSdioDbgLvl >= HIF_SDIO_LOG_ERR) { printk(KERN_WARNING SDIO_TAG"[E]%s(%d):" fmt, __FUNCTION__ , __LINE__, ##arg);} - -/*! - * \brief ASSERT function definition. - * - */ -#if HIF_SDIO_DEBUG -#define HIF_SDIO_ASSERT(expr) if ( !(expr) ) { \ - printk("assertion failed! %s[%d]: %s\n",\ - __FUNCTION__, __LINE__, #expr); \ - BUG_ON( !(expr) );\ - } -#else -#define HIF_SDIO_ASSERT(expr) do {} while(0) -#endif - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/*! - * \brief MTK hif sdio client registration function - * - * Client uses this function to do hif sdio registration - * - * \param pinfo a pointer of client's information - * - * \retval 0 register successfully - * \retval < 0 error code - */ -extern INT32 mtk_wcn_hif_sdio_client_reg ( - const MTK_WCN_HIF_SDIO_CLTINFO *pinfo - ); - -extern INT32 mtk_wcn_hif_sdio_client_unreg ( - const MTK_WCN_HIF_SDIO_CLTINFO *pinfo - ); - -extern INT32 mtk_wcn_hif_sdio_readb ( - MTK_WCN_HIF_SDIO_CLTCTX ctx, - UINT32 offset, - PUINT8 pvb - ); - -extern INT32 mtk_wcn_hif_sdio_writeb ( - MTK_WCN_HIF_SDIO_CLTCTX ctx, - UINT32 offset, - UINT8 vb - ); - -extern INT32 mtk_wcn_hif_sdio_readl ( - MTK_WCN_HIF_SDIO_CLTCTX ctx, - UINT32 offset, - PUINT32 pvl - ); - -extern INT32 mtk_wcn_hif_sdio_writel ( - MTK_WCN_HIF_SDIO_CLTCTX ctx, - UINT32 offset, - UINT32 vl - ); - -extern INT32 mtk_wcn_hif_sdio_read_buf ( - MTK_WCN_HIF_SDIO_CLTCTX ctx, - UINT32 offset, - PUINT32 pbuf, - UINT32 len - ); - -extern INT32 mtk_wcn_hif_sdio_write_buf ( - MTK_WCN_HIF_SDIO_CLTCTX ctx, - UINT32 offset, - PUINT32 pbuf, - UINT32 len - ); - -extern void mtk_wcn_hif_sdio_set_drvdata( - MTK_WCN_HIF_SDIO_CLTCTX ctx, - void* private_data_p - ); - -extern void* mtk_wcn_hif_sdio_get_drvdata( - MTK_WCN_HIF_SDIO_CLTCTX ctx - ); - -extern void mtk_wcn_hif_sdio_get_dev( - MTK_WCN_HIF_SDIO_CLTCTX ctx, - struct device **dev - ); - -extern void mtk_wcn_hif_sdio_enable_irq( - MTK_WCN_HIF_SDIO_CLTCTX ctx, - MTK_WCN_BOOL enable - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#endif /* _HIF_SDIO_H */ - - - diff --git a/drivers/net/wireless/mt5931/os/linux/hif/sdio/include/mtk_porting.h b/drivers/net/wireless/mt5931/os/linux/hif/sdio/include/mtk_porting.h deleted file mode 100755 index 37f96be599e0..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/hif/sdio/include/mtk_porting.h +++ /dev/null @@ -1,52 +0,0 @@ -/* porting layer */ -/* Android */ - -#ifndef _MTK_PORTING_H_ -#define _MTK_PORTING_H_ - -#include /* include stddef.h for NULL */ - -/* Type definition for signed integers */ -typedef signed char INT8, *PINT8; -typedef signed short INT16, *PINT16; -typedef signed int INT32, *PINT32; - -/* Type definition for unsigned integers */ -typedef unsigned char UINT8, *PUINT8; -typedef unsigned short UINT16, *PUINT16; -typedef unsigned int UINT32, *PUINT32; - -//typedef void VOID, *PVOID; - -typedef int MTK_WCN_BOOL; -#ifndef MTK_WCN_BOOL_TRUE -#define MTK_WCN_BOOL_FALSE ((MTK_WCN_BOOL) 0) -#define MTK_WCN_BOOL_TRUE ((MTK_WCN_BOOL) 1) -#endif - -typedef int MTK_WCN_MUTEX; - -typedef int MTK_WCN_TIMER; - -/* system APIs */ -/* mutex */ -typedef MTK_WCN_MUTEX (*MUTEX_CREATE)(const char * const name); -typedef INT32 (*MUTEX_DESTROY)(MTK_WCN_MUTEX mtx); -typedef INT32 (*MUTEX_LOCK)(MTK_WCN_MUTEX mtx); -typedef INT32 (*MUTEX_UNLOCK)(MTK_WCN_MUTEX mtx, unsigned long flags); -/* debug */ -typedef INT32 (*DBG_PRINT)(const char *str, ...); -typedef INT32 (*DBG_ASSERT)(INT32 expr, const char *file, INT32 line); -/* timer */ -typedef void (*MTK_WCN_TIMER_CB)(void); -typedef MTK_WCN_TIMER (*TIMER_CREATE)(const char * const name); -typedef INT32 (*TIMER_DESTROY)(MTK_WCN_TIMER tmr); -typedef INT32 (*TIMER_START)(MTK_WCN_TIMER tmr, UINT32 timeout, MTK_WCN_TIMER_CB tmr_cb, void *param); -typedef INT32 (*TIMER_STOP)(MTK_WCN_TIMER tmr); -/* kernel lib */ -typedef void* (*SYS_MEMCPY)(void *dest, const void *src, UINT32 n); -typedef void* (*SYS_MEMSET)(void *s, INT32 c, UINT32 n); -typedef INT32 (*SYS_SPRINTF)(char *str, const char *format, ...); - -#endif /* _MTK_PORTING_H_ */ - diff --git a/drivers/net/wireless/mt5931/os/linux/hif/sdio/sdio.c b/drivers/net/wireless/mt5931/os/linux/hif/sdio/sdio.c deleted file mode 100755 index ebfedf3c4a47..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/hif/sdio/sdio.c +++ /dev/null @@ -1,1353 +0,0 @@ -/****************************************************************************** -*[File] sdio.c -*[Version] v1.0 -*[Revision Date] 2010-03-01 -*[Author] -*[Description] -* The program provides SDIO HIF driver -*[Copyright] -* Copyright (C) 2010 MediaTek Incorporation. All Rights Reserved. -******************************************************************************/ - - - -/* -** $Log: sdio.c $ - * - * 04 12 2012 terry.wu - * NULL - * Add AEE message support - * 1) Show AEE warning(red screen) if SDIO access error occurs - - * - * 02 14 2012 cp.wu - * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree - * include correct header file upon setting. - * - * 11 10 2011 cp.wu - * [WCXRP00001098] [MT6620 Wi-Fi][Driver] Replace printk by DBG LOG macros in linux porting layer - * 1. eliminaite direct calls to printk in porting layer. - * 2. replaced by DBGLOG, which would be XLOG on ALPS platforms. - * - * 09 20 2011 cp.wu - * [WCXRP00000994] [MT6620 Wi-Fi][Driver] dump message for bus error and reset bus error flag while re-initialized - * 1. always show error message for SDIO bus errors. - * 2. reset bus error flag when re-initialization - * - * 08 17 2011 cp.wu - * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree - * add MT6628 related definitions for Linux/Android driver. - * - * 05 18 2011 cp.wu - * [WCXRP00000702] [MT5931][Driver] Modify initialization sequence for E1 ASIC - * add device ID for MT5931. - * - * 04 08 2011 pat.lu - * [WCXRP00000623] [MT6620 Wi-Fi][Driver] use ARCH define to distinguish PC Linux driver - * Use CONFIG_X86 instead of PC_LINUX_DRIVER_USE option to have proper compile settting for PC Linux driver - * - * 03 22 2011 pat.lu - * [WCXRP00000592] [MT6620 Wi-Fi][Driver] Support PC Linux Environment Driver Build - * Add a compiler option "PC_LINUX_DRIVER_USE" for building driver in PC Linux environment. - * - * 03 18 2011 cp.wu - * [WCXRP00000559] [MT6620 Wi-Fi][Driver] Combine TX/RX DMA buffers into a single one to reduce physically continuous memory consumption - * deprecate CFG_HANDLE_IST_IN_SDIO_CALLBACK. - * - * 03 15 2011 cp.wu - * [WCXRP00000559] [MT6620 Wi-Fi][Driver] Combine TX/RX DMA buffers into a single one to reduce physically continuous memory consumption - * 1. deprecate CFG_HANDLE_IST_IN_SDIO_CALLBACK - * 2. Use common coalescing buffer for both TX/RX directions - * - * - * 03 07 2011 terry.wu - * [WCXRP00000521] [MT6620 Wi-Fi][Driver] Remove non-standard debug message - * Toggle non-standard debug messages to comments. - * - * 11 15 2010 jeffrey.chang - * [WCXRP00000181] [MT6620 Wi-Fi][Driver] fix the driver message "GLUE_FLAG_HALT skip INT" during unloading - * Fix GLUE_FALG_HALT message which cause driver to hang - * - * 11 08 2010 cp.wu - * [WCXRP00000166] [MT6620 Wi-Fi][Driver] use SDIO CMD52 for enabling/disabling interrupt to reduce transaction period - * correct typo - * - * 11 08 2010 cp.wu - * [WCXRP00000166] [MT6620 Wi-Fi][Driver] use SDIO CMD52 for enabling/disabling interrupt to reduce transaction period - * change to use CMD52 for enabling/disabling interrupt to reduce SDIO transaction time - * - * 11 01 2010 yarco.yang - * [WCXRP00000149] [MT6620 WI-Fi][Driver]Fine tune performance on MT6516 platform - * Add code to run WlanIST in SDIO callback. - * - * 10 19 2010 cp.wu - * [WCXRP00000122] [MT6620 Wi-Fi][Driver] Preparation for YuSu source tree integration - * remove HIF_SDIO_ONE flags because the settings could be merged for runtime detection instead of compile-time. - * - * 10 19 2010 jeffrey.chang - * [WCXRP00000120] [MT6620 Wi-Fi][Driver] Refine linux kernel module to the license of MTK propietary and enable MTK HIF by default - * Refine linux kernel module to the license of MTK and enable MTK HIF - * - * 08 21 2010 jeffrey.chang - * NULL - * 1) add sdio two setting - * 2) bug fix of sdio glue - * - * 08 18 2010 jeffrey.chang - * NULL - * support multi-function sdio - * - * 08 18 2010 cp.wu - * NULL - * #if defined(__X86__) is not working, change to use #ifdef CONFIG_X86. - * - * 08 17 2010 cp.wu - * NULL - * add ENE SDIO host workaround for x86 linux platform. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 07 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * Fix hotplug bug - * - * 03 28 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * clear sdio interrupt - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port -** -*/ - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -#include "gl_os.h" - -#if MTK_WCN_HIF_SDIO -#include "hif_sdio.h" -#else -#include -#include -#include -#include /* sdio_readl(), etc */ -#include -#endif - -#include -//#ifndef CONFIG_X86 modify by Nicolas Luo -#ifdef CONFIG_ARM -#include -#endif - -#if defined(MT6620) - #include "mt6620_reg.h" -#elif defined(MT5931) - #include "mt5931_reg.h" -#elif defined(MT6628) - #include "mt6628_reg.h" -#endif - -#if CFG_DBG_GPIO_PINS/* FIXME: move to platform or custom header */ -#include -#endif - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -#define HIF_SDIO_ERR_TITLE_STR "["CHIP_NAME"] SDIO Access Error!" -#define HIF_SDIO_ERR_DESC_STR "**SDIO Access Error**\n" - -#if MTK_WCN_HIF_SDIO - - -/* - * function prototypes - * - */ - -static INT32 -mtk_sdio_probe(MTK_WCN_HIF_SDIO_CLTCTX, const MTK_WCN_HIF_SDIO_FUNCINFO *); - -static INT32 -mtk_sdio_remove(MTK_WCN_HIF_SDIO_CLTCTX); -static INT32 mtk_sdio_interrupt(MTK_WCN_HIF_SDIO_CLTCTX); - -/* - * sdio function info table - */ - -static MTK_WCN_HIF_SDIO_FUNCINFO funcInfo[] = { -#if defined(MT6620) - { MTK_WCN_HIF_SDIO_FUNC(0x037a, 0x020a, 0x1, 512) }, - { MTK_WCN_HIF_SDIO_FUNC(0x037a, 0x020c, 0x2, 512) }, - { MTK_WCN_HIF_SDIO_FUNC(0x037a, 0x018a, 0x1, 512) }, - { MTK_WCN_HIF_SDIO_FUNC(0x037a, 0x018c, 0x2, 512) }, -#elif defined(MT5931) - { MTK_WCN_HIF_SDIO_FUNC(0x037a, 0x5931, 0x1, 512) }, -#elif defined(MT6628) - { MTK_WCN_HIF_SDIO_FUNC(0x037a, 0x6628, 0x1, 512) }, -#endif -}; - - -static MTK_WCN_HIF_SDIO_CLTINFO cltInfo = { - .func_tbl = funcInfo, - .func_tbl_size = sizeof(funcInfo)/sizeof(MTK_WCN_HIF_SDIO_FUNCINFO), - .hif_clt_probe = mtk_sdio_probe, - .hif_clt_remove = mtk_sdio_remove, - .hif_clt_irq = mtk_sdio_interrupt, -}; - -#else - -static const struct sdio_device_id mtk_sdio_ids[] = { -#if defined(MT6620) - { SDIO_DEVICE(0x037a, 0x020a) }, /* Not an SDIO standard class device */ - { SDIO_DEVICE(0x037a, 0x020b) }, /* Not an SDIO standard class device */ - { SDIO_DEVICE(0x037a, 0x020c) }, /* Not an SDIO standard class device */ -#elif defined(MT5931) - { SDIO_DEVICE(0x037a, 0x5931) }, /* Not an SDIO standard class device */ -#elif defined(MT6628) - { SDIO_DEVICE(0x037a, 0x6628) }, /* Not an SDIO standard class device */ -#endif - { /* end: all zeroes */ }, -}; - -MODULE_DEVICE_TABLE(sdio, mtk_sdio_ids); - -#endif - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ -extern KAL_WAKE_LOCK_T isr_wakelock; -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ -static probe_card pfWlanProbe = NULL; -static remove_card pfWlanRemove = NULL; - - -#if (MTK_WCN_HIF_SDIO == 0) -static struct sdio_driver mtk_sdio_driver = { - .name = "wlan", /* "MTK SDIO WLAN Driver" */ - .id_table = mtk_sdio_ids, - .probe = NULL, - .remove = NULL, -}; -#endif - - -#if CFG_DBG_GPIO_PINS - -/* debug pins */ -UINT_32 dbgPinSTP[] = { - GPIO_PLATFORM(33)/* CMFLASH, IDX_ERR J613 */ - , GPIO_PLATFORM(62)/* EINT3, IDX_TX_THREAD */ - , GPIO_PLATFORM(80)/* SPI_CS_N, IDX_TX_REQ J613 */ - , GPIO_PLATFORM(81)/* SPI_SCK, IDX_TX_PORT_WRITE J613 */ - , GPIO_PLATFORM(17) /* CMRST, IDX_STP_MTX_BT J618 */ - , GPIO_PLATFORM(18) /* CMPDN, IDX_STP_MTX_FM J613 */ - , GPIO_PLATFORM(19) /* CMVREF,IDX_STP_MTX_GPS J613 */ - , GPIO_INVALID /* REMOVED, IDX_STP_MTX_WIFI */ - , GPIO_INVALID /* REMOVED, IDX_STP_MTX_WMT */ - , GPIO_PLATFORM(135) /* SCL2, IDX_LOOP_CNT J616 */ - , GPIO_PLATFORM(136) /* SDA2, IDX_NO_BUF J616 */ - , GPIO_PLATFORM(30) /* CAM_MECHSH0, IDX_BT_TX, J613 low-active */ - , GPIO_PLATFORM(31) /* CAM_MECHSH1, IDX_BT_RX, J613 low-active */ - , GPIO_PLATFORM(124) /* GPS_PWR_EN, ThreadDSPIn [GPS] */ - , GPIO_PLATFORM(125) /* GPS_SYNC, mtk_sys_msg_recv [GPS] */ - , GPIO_PLATFORM(21) /* GPS_EINT8, dump_nmea_data [GPS] */ - , GPIO_PLATFORM(29) /* CAM_STROBE, IDX_GPS_TX, J613 low-active */ - , GPIO_PLATFORM(20) /*CMHREF, J613 UNUSED */ -// , GPIO_6516(64) /* EINT5, REMOVED!!! for MT6620-Wi-Fi Int */ -// , GPIO_6516(122) /* BT_PWR_EN, REMOVED!!! for MT6620-PMU_EN */ -// , GPIO_6516(123) /* BT_RESET, REMOVED!!! for MT6620-RST */ -}; -#endif -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ -#if CFG_DBG_GPIO_PINS -void debug_gpio_init(void) -{ - int i; - - for (i = 0; i < sizeof(dbgPinSTP)/sizeof(dbgPinSTP[0]); ++i) { - if (GPIO_INVALID == dbgPinSTP[i]) { - continue; - } - //printk(KERN_INFO "[%s] %ld \n", __FUNCTION__, dbgPinSTP[i]); - mt_set_gpio_pull_enable(dbgPinSTP[i], 0); /* disable pull */ - mt_set_gpio_dir(dbgPinSTP[i], GPIO_DIR_OUT); /* set output */ - mt_set_gpio_mode(dbgPinSTP[i], GPIO_MODE_00); /* set gpio mode */ - - /* toggle twice to check if ok: */ - mt_set_gpio_out(dbgPinSTP[i], GPIO_OUT_ZERO); /* tie low */ - mt_set_gpio_out(dbgPinSTP[i], GPIO_OUT_ONE); /* tie high*/ - mt_set_gpio_out(dbgPinSTP[i], GPIO_OUT_ZERO); /* tie low */ - mt_set_gpio_out(dbgPinSTP[i], GPIO_OUT_ONE); /* tie high*/ - } - //printk(KERN_INFO "[%s] initialization ok \n", __FUNCTION__); -} - -void debug_gpio_deinit(void) -{ - int i; - for (i = 0; i < sizeof(dbgPinSTP)/sizeof(dbgPinSTP[0]); ++i) { - if (GPIO_INVALID == dbgPinSTP[i]) { - continue; - } - //printk(KERN_INFO "[%s] %ld \n", __FUNCTION__, dbgPinSTP[i]); - mt_set_gpio_dir(dbgPinSTP[i], GPIO_DIR_IN); - } - - //printk(KERN_INFO "[%s] k\n", __FUNCTION__); -} - -void mtk_wcn_stp_debug_gpio_assert(UINT_32 dwIndex, UINT_32 dwMethod) -{ - unsigned int i; - - if (dwIndex >= (sizeof(dbgPinSTP)/sizeof(dbgPinSTP[0]))) { - //printk(KERN_INFO "[%s] invalid dwIndex(%ld) \n", __FUNCTION__, dwIndex); - return; - } - - if (dwIndex > IDX_STP_MAX) { - //printk(KERN_INFO "[%s] dwIndex(%ld) > IDX_STP_MAX(%d) \n", __FUNCTION__, dwIndex, IDX_STP_MAX); - } - - if (GPIO_INVALID == dbgPinSTP[dwIndex]) { - return; - } - - if (dwMethod & DBG_TIE_DIR) { - if (dwMethod & DBG_HIGH) { - mt_set_gpio_out(dbgPinSTP[dwIndex], GPIO_OUT_ONE); - } - else { - mt_set_gpio_out(dbgPinSTP[dwIndex], GPIO_OUT_ZERO); - } - return; - } - - if (dwMethod & DBG_TOGGLE(0)) { - for (i = 0; i < DBG_TOGGLE_NUM(dwMethod); ++i) { - mt_set_gpio_out(dbgPinSTP[dwIndex], GPIO_OUT_ZERO); - mt_set_gpio_out(dbgPinSTP[dwIndex], GPIO_OUT_ONE); - } - return; - } - - return; -} -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is a SDIO interrupt callback function -* -* \param[in] func pointer to SDIO handle -* -* \return void -*/ -/*----------------------------------------------------------------------------*/ - -#if MTK_WCN_HIF_SDIO - -static INT32 mtk_sdio_interrupt(MTK_WCN_HIF_SDIO_CLTCTX cltCtx) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - INT32 ret = 0; - - prGlueInfo = mtk_wcn_hif_sdio_get_drvdata(cltCtx); - - ASSERT(prGlueInfo); - - if (!prGlueInfo) { - //printk(KERN_INFO DRV_NAME"No glue info in mtk_sdio_interrupt()\n"); - return (-HIF_SDIO_ERR_FAIL); - } - - if (prGlueInfo->u4Flag & GLUE_FLAG_HALT) { - //printk(KERN_INFO DRV_NAME"GLUE_FLAG_HALT skip INT\n"); - ret = mtk_wcn_hif_sdio_writel(cltCtx, MCR_WHLPCR, WHLPCR_INT_EN_CLR); - return ret; - } - - /*WCNCR 00002676*/ - KAL_WAKE_UNLOCK(NULL, &isr_wakelock); - KAL_WAKE_LOCK_TIMEOUT(NULL, &isr_wakelock, KAL_HZ/10); - - ret = mtk_wcn_hif_sdio_writel(cltCtx, MCR_WHLPCR, WHLPCR_INT_EN_CLR); - - set_bit (GLUE_FLAG_INT_BIT, &prGlueInfo->u4Flag); - - /* when we got sdio interrupt, we wake up the tx servie thread*/ - wake_up_interruptible(&prGlueInfo->waitq); - - return ret; -} - -#else - -static unsigned int in_interrupt = 0; - -static void mtk_sdio_interrupt(struct sdio_func *func) -{ - P_GLUE_INFO_T prGlueInfo = NULL; - - int ret = 0; - - prGlueInfo = sdio_get_drvdata(func); - ASSERT(prGlueInfo); - - if (!prGlueInfo) { - //printk(KERN_INFO DRV_NAME"No glue info in mtk_sdio_interrupt()\n"); - return; - } - - if (prGlueInfo->u4Flag & GLUE_FLAG_HALT) { - sdio_writel(prGlueInfo->rHifInfo.func, WHLPCR_INT_EN_CLR, MCR_WHLPCR, &ret); - //printk(KERN_INFO DRV_NAME"GLUE_FLAG_HALT skip INT\n"); - return; - } - - sdio_writel(prGlueInfo->rHifInfo.func, WHLPCR_INT_EN_CLR, MCR_WHLPCR, &ret); - - #if 0 - wlanISR(prGlueInfo->prAdapter, TRUE); - - if (prGlueInfo->u4Flag & GLUE_FLAG_HALT) { - /* Should stop now... skip pending interrupt */ - //printk(KERN_INFO DRV_NAME"ignore pending interrupt\n"); - } - else { - wlanIST(prGlueInfo->prAdapter); - } - #endif - - set_bit (GLUE_FLAG_INT_BIT, &prGlueInfo->u4Flag); - - /* when we got sdio interrupt, we wake up the tx servie thread*/ - wake_up_interruptible(&prGlueInfo->waitq); -} -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is a SDIO probe function -* -* \param[in] func pointer to SDIO handle -* \param[in] id pointer to SDIO device id table -* -* \return void -*/ -/*----------------------------------------------------------------------------*/ - -#if MTK_WCN_HIF_SDIO - -// FIXME: global variable -static const MTK_WCN_HIF_SDIO_FUNCINFO *prFunc; - - -static INT32 -mtk_sdio_probe(MTK_WCN_HIF_SDIO_CLTCTX cltCtx, const MTK_WCN_HIF_SDIO_FUNCINFO *prFuncInfo) -{ - INT32 ret = HIF_SDIO_ERR_SUCCESS; - - prFunc = prFuncInfo; - - if (pfWlanProbe((PVOID) &cltCtx) != WLAN_STATUS_SUCCESS) { - //printk(KERN_WARNING DRV_NAME"pfWlanProbe fail!call pfWlanRemove()\n"); - pfWlanRemove(); - ret = -(HIF_SDIO_ERR_FAIL); - } else { - //printk(KERN_INFO DRV_NAME"mtk_wifi_sdio_probe() done(%d)\n", ret); - } - return ret; -} -#else -static int mtk_sdio_probe ( - struct sdio_func *func, - const struct sdio_device_id *id - ) -{ - int ret = 0; - int i = 0; - - //printk(KERN_INFO DRV_NAME "mtk_sdio_probe()\n"); - - ASSERT(func); - ASSERT(id); - - //printk(KERN_INFO DRV_NAME "Basic struct size checking...\n"); - //printk(KERN_INFO DRV_NAME "sizeof(struct device) = %d\n", sizeof(struct device)); - //printk(KERN_INFO DRV_NAME "sizeof(struct mmc_host) = %d\n", sizeof(struct mmc_host)); - //printk(KERN_INFO DRV_NAME "sizeof(struct mmc_card) = %d\n", sizeof(struct mmc_card)); - //printk(KERN_INFO DRV_NAME "sizeof(struct mmc_driver) = %d\n", sizeof(struct mmc_driver)); - //printk(KERN_INFO DRV_NAME "sizeof(struct mmc_data) = %d\n", sizeof(struct mmc_data)); - //printk(KERN_INFO DRV_NAME "sizeof(struct mmc_command) = %d\n", sizeof(struct mmc_command)); - //printk(KERN_INFO DRV_NAME "sizeof(struct mmc_request) = %d\n", sizeof(struct mmc_request)); - //printk(KERN_INFO DRV_NAME "sizeof(struct sdio_func) = %d\n", sizeof(struct sdio_func)); - - //printk(KERN_INFO DRV_NAME "Card information checking...\n"); - //printk(KERN_INFO DRV_NAME "func = 0x%p\n", func); - //printk(KERN_INFO DRV_NAME "Number of info = %d:\n", func->card->num_info); - - for (i = 0; i < func->card->num_info; i++) { - //printk(KERN_INFO DRV_NAME "info[%d]: %s\n", i, func->card->info[i]); - } - - sdio_claim_host(func); - ret = sdio_enable_func(func); - sdio_release_host(func); - - if (ret) { - //printk(KERN_INFO DRV_NAME"sdio_enable_func failed!\n"); - goto out; - } - //printk(KERN_INFO DRV_NAME"sdio_enable_func done!\n"); - - if (pfWlanProbe((PVOID)func) != WLAN_STATUS_SUCCESS) { - //printk(KERN_WARNING DRV_NAME"pfWlanProbe fail!call pfWlanRemove()\n"); - pfWlanRemove(); - ret = -1; - } - else { -#if CFG_DBG_GPIO_PINS - //printk(KERN_INFO "[%s] init debug gpio, 20100815 \n", __FUNCTION__); - /* Debug pins initialization */ - debug_gpio_init(); -#endif - } - -out: - //printk(KERN_INFO DRV_NAME"mtk_sdio_probe() done(%d)\n", ret); - return ret; -} -#endif - - -#if MTK_WCN_HIF_SDIO -static INT32 -mtk_sdio_remove(MTK_WCN_HIF_SDIO_CLTCTX cltCtx) -{ - INT32 ret = HIF_SDIO_ERR_SUCCESS; - //printk(KERN_INFO DRV_NAME"pfWlanRemove done\n"); - pfWlanRemove(); - - return ret; -} -#else -static void -mtk_sdio_remove ( - struct sdio_func *func - ) -{ - //printk(KERN_INFO DRV_NAME"mtk_sdio_remove()\n"); - -#if CFG_DBG_GPIO_PINS - //printk(KERN_INFO "[%s] deinit debug gpio \n", __FUNCTION__); - debug_gpio_deinit(); -#endif - - ASSERT(func); - //printk(KERN_INFO DRV_NAME"pfWlanRemove done\n"); - pfWlanRemove(); - - sdio_claim_host(func); - sdio_disable_func(func); - //printk(KERN_INFO DRV_NAME"sdio_disable_func() done\n"); - sdio_release_host(func); - - //printk(KERN_INFO DRV_NAME"mtk_sdio_remove() done\n"); -} -#endif - -#if (MTK_WCN_HIF_SDIO == 0) -static int -mtk_sdio_suspend ( - struct device * pDev, - pm_message_t state - ) -{ - //printk(KERN_INFO "mtk_sdio: mtk_sdio_suspend dev(0x%p)\n", pDev); - //printk(KERN_INFO "mtk_sdio: MediaTek SDIO WLAN driver\n"); - - return 0; -} - -int mtk_sdio_resume ( - struct device * pDev - ) -{ - //printk(KERN_INFO "mtk_sdio: mtk_sdio_resume dev(0x%p)\n", pDev); - - return 0; -} -#endif - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will register sdio bus to the os -* -* \param[in] pfProbe Function pointer to detect card -* \param[in] pfRemove Function pointer to remove card -* -* \return The result of registering sdio bus -*/ -/*----------------------------------------------------------------------------*/ -WLAN_STATUS -glRegisterBus ( - probe_card pfProbe, - remove_card pfRemove - ) -{ - int ret = 0; - - ASSERT(pfProbe); - ASSERT(pfRemove); - - //printk(KERN_INFO "mtk_sdio: MediaTek SDIO WLAN driver\n"); - //printk(KERN_INFO "mtk_sdio: Copyright MediaTek Inc.\n"); - - pfWlanProbe = pfProbe; - pfWlanRemove = pfRemove; - -#if MTK_WCN_HIF_SDIO - /* register MTK sdio client */ - ret = ((mtk_wcn_hif_sdio_client_reg(&cltInfo) == HIF_SDIO_ERR_SUCCESS) ? WLAN_STATUS_SUCCESS : WLAN_STATUS_FAILURE); -#else - mtk_sdio_driver.probe = mtk_sdio_probe; - mtk_sdio_driver.remove = mtk_sdio_remove; - - mtk_sdio_driver.drv.suspend = mtk_sdio_suspend; - mtk_sdio_driver.drv.resume = mtk_sdio_resume; - - ret = (sdio_register_driver(&mtk_sdio_driver) == 0) ? WLAN_STATUS_SUCCESS : WLAN_STATUS_FAILURE; -#endif - - return ret; -} /* end of glRegisterBus() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will unregister sdio bus to the os -* -* \param[in] pfRemove Function pointer to remove card -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -glUnregisterBus( - remove_card pfRemove - ) -{ - ASSERT(pfRemove); - pfRemove(); - -#if MTK_WCN_HIF_SDIO - /* unregister MTK sdio client */ - mtk_wcn_hif_sdio_client_unreg(&cltInfo); -#else - sdio_unregister_driver(&mtk_sdio_driver); -#endif - - return; -} /* end of glUnregisterBus() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function stores hif related info, which is initialized before. -* -* \param[in] prGlueInfo Pointer to glue info structure -* \param[in] u4Cookie Pointer to UINT_32 memory base variable for _HIF_HPI -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -glSetHifInfo ( - P_GLUE_INFO_T prGlueInfo, - UINT_32 u4Cookie - ) -{ - P_GL_HIF_INFO_T prHif = NULL; - - prHif = &prGlueInfo->rHifInfo; - -#if MTK_WCN_HIF_SDIO - //prHif->prFuncInfo = ((MTK_WCN_HIF_SDIO_FUNCINFO *) u4Cookie); - prHif->prFuncInfo = prFunc; - prHif->cltCtx = *((MTK_WCN_HIF_SDIO_CLTCTX *) u4Cookie); - mtk_wcn_hif_sdio_set_drvdata(prHif->cltCtx, prGlueInfo); - -#else - prHif->func = (struct sdio_func *) u4Cookie; - - //printk(KERN_INFO DRV_NAME"prHif->func->dev = 0x%p\n", &prHif->func->dev); - //printk(KERN_INFO DRV_NAME"prHif->func->vendor = 0x%04X\n", prHif->func->vendor); - //printk(KERN_INFO DRV_NAME"prHif->func->device = 0x%04X\n", prHif->func->device); - //printk(KERN_INFO DRV_NAME"prHif->func->func = 0x%04X\n", prHif->func->num); - - sdio_set_drvdata(prHif->func, prGlueInfo); - - SET_NETDEV_DEV(prGlueInfo->prDevHandler, &prHif->func->dev); -#endif - - return; -} /* end of glSetHifInfo() */ - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function clears hif related info. -* -* \param[in] prGlueInfo Pointer to glue info structure -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -glClearHifInfo ( - P_GLUE_INFO_T prGlueInfo - ) -{ - //P_GL_HIF_INFO_T prHif = NULL; - //ASSERT(prGlueInfo); - //prHif = &prGlueInfo->rHifInfo; - - return; -} /* end of glClearHifInfo() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Initialize bus operation and hif related information, request resources. -* -* \param[out] pvData A pointer to HIF-specific data type buffer. -* For eHPI, pvData is a pointer to UINT_32 type and stores a -* mapped base address. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -BOOL -glBusInit ( - PVOID pvData - ) -{ -#if (MTK_WCN_HIF_SDIO == 0) - int ret = 0; - struct sdio_func *func = NULL; - - ASSERT(pvData); - - func = (struct sdio_func *) pvData; - - sdio_claim_host(func); - ret = sdio_set_block_size(func, 512); - sdio_release_host(func); - - if (ret) { - //printk(KERN_INFO DRV_NAME"sdio_set_block_size 512 failed!\n"); - } - else { - //printk(KERN_INFO DRV_NAME"sdio_set_block_size 512 done!\n"); - } - - //printk(KERN_INFO DRV_NAME"param: func->cur_blksize(%d)\n", func->cur_blksize); - //printk(KERN_INFO DRV_NAME"param: func->max_blksize(%d)\n", func->max_blksize); - //printk(KERN_INFO DRV_NAME"param: func->card->host->max_blk_size(%d)\n", func->card->host->max_blk_size); - //printk(KERN_INFO DRV_NAME"param: func->card->host->max_blk_count(%d)\n", func->card->host->max_blk_count); -#endif - return TRUE; -} /* end of glBusInit() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Stop bus operation and release resources. -* -* \param[in] pvData A pointer to struct net_device. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -glBusRelease ( - PVOID pvData - ) -{ - - return; -} /* end of glBusRelease() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Setup bus interrupt operation and interrupt handler for os. -* -* \param[in] pvData A pointer to struct net_device. -* \param[in] pfnIsr A pointer to interrupt handler function. -* \param[in] pvCookie Private data for pfnIsr function. -* -* \retval WLAN_STATUS_SUCCESS if success -* NEGATIVE_VALUE if fail -*/ -/*----------------------------------------------------------------------------*/ -INT_32 -glBusSetIrq ( - PVOID pvData, - PVOID pfnIsr, - PVOID pvCookie - ) -{ - int ret = 0; - -#if (MTK_WCN_HIF_SDIO == 0) - struct net_device *prNetDevice = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - P_GL_HIF_INFO_T prHifInfo = NULL; - - ASSERT(pvData); - if (!pvData) { - return -1; - } - prNetDevice = (struct net_device *) pvData; - prGlueInfo = (P_GLUE_INFO_T) pvCookie; - ASSERT(prGlueInfo); - if (!prGlueInfo) { - return -1; - } - - prHifInfo = &prGlueInfo->rHifInfo; - - sdio_claim_host(prHifInfo->func); - ret = sdio_claim_irq(prHifInfo->func, mtk_sdio_interrupt); - sdio_release_host(prHifInfo->func); -#else - /* hif_sdio case */ - struct net_device *prNetDevice = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(pvData); - if (!pvData) { - return -1; - } - prNetDevice = (struct net_device *) pvData; - - prGlueInfo = (P_GLUE_INFO_T) pvCookie; - ASSERT(prGlueInfo); - if (!prGlueInfo) { - return -1; - } - - mtk_wcn_hif_sdio_enable_irq(prGlueInfo->rHifInfo.cltCtx, MTK_WCN_BOOL_TRUE); - -#endif - return ret; -} /* end of glBusSetIrq() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Stop bus interrupt operation and disable interrupt handling for os. -* -* \param[in] pvData A pointer to struct net_device. -* \param[in] pvCookie Private data for pfnIsr function. -* -* \return (none) -*/ -/*----------------------------------------------------------------------------*/ -VOID -glBusFreeIrq ( - PVOID pvData, - PVOID pvCookie - ) -{ -#if (MTK_WCN_HIF_SDIO == 0) - struct net_device *prNetDevice = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - P_GL_HIF_INFO_T prHifInfo = NULL; - int ret = 0; - - ASSERT(pvData); - if (!pvData) { - //printk(KERN_INFO DRV_NAME"%s null pvData\n", __FUNCTION__); - return; - } - prNetDevice = (struct net_device *) pvData; - prGlueInfo = (P_GLUE_INFO_T) pvCookie; - ASSERT(prGlueInfo); - if (!prGlueInfo) { - //printk(KERN_INFO DRV_NAME"%s no glue info\n", __FUNCTION__); - return; - } - - prHifInfo = &prGlueInfo->rHifInfo; - - sdio_claim_host(prHifInfo->func); - ret = sdio_release_irq(prHifInfo->func); - sdio_release_host(prHifInfo->func); -#else - /* hif_sdio case */ - struct net_device *prNetDevice = NULL; - P_GLUE_INFO_T prGlueInfo = NULL; - - ASSERT(pvData); - if (!pvData) { - //printk(KERN_INFO DRV_NAME"%s null pvData\n", __FUNCTION__); - return; - } - prNetDevice = (struct net_device *) pvData; - - prGlueInfo = (P_GLUE_INFO_T) pvCookie; - ASSERT(prGlueInfo); - if (!prGlueInfo) { - //printk(KERN_INFO DRV_NAME"%s no glue info\n", __FUNCTION__); - return; - } - - mtk_wcn_hif_sdio_enable_irq(prGlueInfo->rHifInfo.cltCtx, MTK_WCN_BOOL_FALSE); -#endif - - return; -} /* end of glBusreeIrq() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Read a 32-bit device register -* -* \param[in] prGlueInfo Pointer to the GLUE_INFO_T structure. -* \param[in] u4Register Register offset -* \param[in] pu4Value Pointer to variable used to store read value -* -* \retval TRUE operation success -* \retval FALSE operation fail -*/ -/*----------------------------------------------------------------------------*/ -BOOL -kalDevRegRead ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4Register, - OUT PUINT_32 pu4Value - ) -{ - int ret = 0; - int a = 0; - - ASSERT(prGlueInfo); - ASSERT(pu4Value); - -#if MTK_WCN_HIF_SDIO - ret = mtk_wcn_hif_sdio_readl(prGlueInfo->rHifInfo.cltCtx, u4Register, (PUINT32) pu4Value); -#else - if (!in_interrupt) { - sdio_claim_host(prGlueInfo->rHifInfo.func); - } - -retry: - *pu4Value = sdio_readl(prGlueInfo->rHifInfo.func, u4Register, &ret); - if (ret && a < 10) { - a++; - printk("gwl =-==============> sdio_readl retry %d!\n", a); - msleep(1); - goto retry; - } - - if (!in_interrupt) { - sdio_release_host(prGlueInfo->rHifInfo.func); - } -#endif - - if (ret) { - kalSendAeeWarning(HIF_SDIO_ERR_TITLE_STR, HIF_SDIO_ERR_DESC_STR "sdio_readl() reports error: %x", ret); - DBGLOG(HAL, ERROR, ("sdio_readl() reports error: %x", ret)); - } - - return (ret) ? FALSE : TRUE; -} /* end of kalDevRegRead() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Write a 32-bit device register -* -* \param[in] prGlueInfo Pointer to the GLUE_INFO_T structure. -* \param[in] u4Register Register offset -* \param[in] u4Value Value to be written -* -* \retval TRUE operation success -* \retval FALSE operation fail -*/ -/*----------------------------------------------------------------------------*/ -BOOL -kalDevRegWrite ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4Register, - IN UINT_32 u4Value - ) -{ - int ret = 0; - int a = 0; - - ASSERT(prGlueInfo); - -#if MTK_WCN_HIF_SDIO - ret = mtk_wcn_hif_sdio_writel(prGlueInfo->rHifInfo.cltCtx, u4Register, u4Value); -#else - if (!in_interrupt) { - sdio_claim_host(prGlueInfo->rHifInfo.func); - } - -retry: - sdio_writel(prGlueInfo->rHifInfo.func, u4Value, u4Register, &ret); - if (ret && a < 10) { - a++; - printk("gwl =-==============> sdio_writel retry %d!\n", a); - msleep(1); - goto retry; - } - - if (!in_interrupt) { - sdio_release_host(prGlueInfo->rHifInfo.func); - } -#endif - - if (ret) { - kalSendAeeWarning(HIF_SDIO_ERR_TITLE_STR, HIF_SDIO_ERR_DESC_STR "sdio_writel() reports error: %x", ret); - DBGLOG(HAL, ERROR, ("sdio_writel() reports error: %x", ret)); - } - - return (ret) ? FALSE : TRUE; -} /* end of kalDevRegWrite() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Read device I/O port -* -* \param[in] prGlueInfo Pointer to the GLUE_INFO_T structure. -* \param[in] u2Port I/O port offset -* \param[in] u2Len Length to be read -* \param[out] pucBuf Pointer to read buffer -* \param[in] u2ValidOutBufSize Length of the buffer valid to be accessed -* -* \retval TRUE operation success -* \retval FALSE operation fail -*/ -/*----------------------------------------------------------------------------*/ -BOOL -kalDevPortRead ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_16 u2Port, - IN UINT_16 u2Len, - OUT PUINT_8 pucBuf, - IN UINT_16 u2ValidOutBufSize - ) -{ - P_GL_HIF_INFO_T prHifInfo = NULL; - PUINT_8 pucDst = NULL; - int count = u2Len; - int ret = 0; - int bNum = 0; - -#if (MTK_WCN_HIF_SDIO == 0) - struct sdio_func *prSdioFunc = NULL; -#endif - - #if DBG - //printk(KERN_INFO DRV_NAME"++kalDevPortRead++ buf:0x%p, port:0x%x, length:%d\n", pucBuf, u2Port, u2Len); - #endif - - ASSERT(prGlueInfo); - prHifInfo = &prGlueInfo->rHifInfo; - - ASSERT(pucBuf); - pucDst = pucBuf; - - ASSERT(u2Len <= u2ValidOutBufSize); - -#if (MTK_WCN_HIF_SDIO == 0) - prSdioFunc = prHifInfo->func; - - ASSERT(prSdioFunc->cur_blksize > 0); - - if (!in_interrupt) { - sdio_claim_host(prSdioFunc); - } - - /* Split buffer into multiple single block to workaround hifsys */ - while (count >= prSdioFunc->cur_blksize) { - count -= prSdioFunc->cur_blksize; - bNum++; - } - if (count > 0 && bNum > 0) { - bNum++; - } - - if (bNum > 0) { - ret = sdio_readsb(prSdioFunc, pucDst, u2Port, prSdioFunc->cur_blksize * bNum); - -#ifdef CONFIG_X86 - /* ENE workaround */ - { - int tmp; - sdio_writel(prSdioFunc, 0x0, SDIO_X86_WORKAROUND_WRITE_MCR, &tmp); - } -#endif - - } - else { - if(count & 0x3L) { - int aligned_count = (count+3) & (~0x3L); - ret = sdio_readsb(prSdioFunc, pucDst, u2Port, aligned_count); - } else { - ret = sdio_readsb(prSdioFunc, pucDst, u2Port, count); - } - } - - if (!in_interrupt) { - sdio_release_host(prSdioFunc); - } -#else - - /* Split buffer into multiple single block to workaround hifsys */ - while (count >= (prGlueInfo->rHifInfo).prFuncInfo->blk_sz) { - count -= ((prGlueInfo->rHifInfo).prFuncInfo->blk_sz); - bNum++; - } - if (count > 0 && bNum > 0) { - bNum++; - } - - if (bNum > 0) { - ret = mtk_wcn_hif_sdio_read_buf(prGlueInfo->rHifInfo.cltCtx, u2Port, (PUINT32) pucDst, - ((prGlueInfo->rHifInfo).prFuncInfo->blk_sz) * bNum); - } - else { - ret = mtk_wcn_hif_sdio_read_buf(prGlueInfo->rHifInfo.cltCtx, u2Port, (PUINT32) pucDst, count); - } -#endif - - if (ret) { - kalSendAeeWarning(HIF_SDIO_ERR_TITLE_STR, HIF_SDIO_ERR_DESC_STR "sdio_readsb() reports error: %x", ret); - DBGLOG(HAL, ERROR, ("sdio_readsb() reports error: %x", ret)); - } - - return (ret) ? FALSE : TRUE; -} /* end of kalDevPortRead() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Write device I/O port -* -* \param[in] prGlueInfo Pointer to the GLUE_INFO_T structure. -* \param[in] u2Port I/O port offset -* \param[in] u2Len Length to be write -* \param[in] pucBuf Pointer to write buffer -* \param[in] u2ValidInBufSize Length of the buffer valid to be accessed -* -* \retval TRUE operation success -* \retval FALSE operation fail -*/ -/*----------------------------------------------------------------------------*/ -BOOL -kalDevPortWrite ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_16 u2Port, - IN UINT_16 u2Len, - IN PUINT_8 pucBuf, - IN UINT_16 u2ValidInBufSize - ) -{ - P_GL_HIF_INFO_T prHifInfo = NULL; - PUINT_8 pucSrc = NULL; - int count = u2Len; - int ret = 0; - int bNum = 0; - -#if (MTK_WCN_HIF_SDIO == 0) - struct sdio_func *prSdioFunc = NULL; -#endif - - #if DBG - //printk(KERN_INFO DRV_NAME"++kalDevPortWrite++ buf:0x%p, port:0x%x, length:%d\n", pucBuf, u2Port, u2Len); - #endif - - ASSERT(prGlueInfo); - prHifInfo = &prGlueInfo->rHifInfo; - - ASSERT(pucBuf); - pucSrc = pucBuf; - - ASSERT(u2Len <= u2ValidInBufSize); - -#if (MTK_WCN_HIF_SDIO == 0) - prSdioFunc = prHifInfo->func; - ASSERT(prSdioFunc->cur_blksize > 0); - - if (!in_interrupt) { - sdio_claim_host(prSdioFunc); - } - - /* Split buffer into multiple single block to workaround hifsys */ - while (count >= prSdioFunc->cur_blksize) { - count -= prSdioFunc->cur_blksize; - bNum++; - } - if (count > 0 && bNum > 0) { - bNum++; - } - - if (bNum > 0) { // block mode - ret = sdio_writesb(prSdioFunc, u2Port, pucSrc, prSdioFunc->cur_blksize * bNum); - -#ifdef CONFIG_X86 - /* ENE workaround */ - { - int tmp; - sdio_writel(prSdioFunc, 0x0, SDIO_X86_WORKAROUND_WRITE_MCR, &tmp); - } -#endif - - } - else { // byte mode - if(count & 0x3L) { - int aligned_count = (count+3) & (~0x3L); - ret = sdio_writesb(prSdioFunc, u2Port, pucSrc, aligned_count); - } else { - ret = sdio_writesb(prSdioFunc, u2Port, pucSrc, count); - } - } - - if (!in_interrupt) { - sdio_release_host(prSdioFunc); - } -#else - /* Split buffer into multiple single block to workaround hifsys */ - while (count >= ((prGlueInfo->rHifInfo).prFuncInfo->blk_sz)) { - count -= ((prGlueInfo->rHifInfo).prFuncInfo->blk_sz); - bNum++; - } - if (count > 0 && bNum > 0) { - bNum++; - } - - if (bNum > 0) { // block mode - ret = mtk_wcn_hif_sdio_write_buf(prGlueInfo->rHifInfo.cltCtx, u2Port, (PUINT32) pucSrc, - ((prGlueInfo->rHifInfo).prFuncInfo->blk_sz) * bNum); - } - else { // byte mode - ret = mtk_wcn_hif_sdio_write_buf(prGlueInfo->rHifInfo.cltCtx, u2Port, (PUINT32) pucSrc, count); - } -#endif - - if (ret) { - kalSendAeeWarning(HIF_SDIO_ERR_TITLE_STR, HIF_SDIO_ERR_DESC_STR "sdio_writesb() reports error: %x", ret); - DBGLOG(HAL, ERROR, ("sdio_writesb() reports error: %x", ret)); - } - - return (ret) ? FALSE : TRUE; -} /* end of kalDevPortWrite() */ - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Write device I/O port in byte with CMD52 -* -* \param[in] prGlueInfo Pointer to the GLUE_INFO_T structure. -* \param[in] u4Addr I/O port offset -* \param[in] ucData Single byte of data to be written -* -* \retval TRUE operation success -* \retval FALSE operation fail -*/ -/*----------------------------------------------------------------------------*/ -BOOL -kalDevWriteWithSdioCmd52 ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4Addr, - IN UINT_8 ucData - ) -{ - int ret = 0; - -#if (MTK_WCN_HIF_SDIO == 0) - if (!in_interrupt) { - sdio_claim_host(prGlueInfo->rHifInfo.func); - } - - sdio_writeb(prGlueInfo->rHifInfo.func, ucData, u4Addr, &ret); - - if (!in_interrupt) { - sdio_release_host(prGlueInfo->rHifInfo.func); - } -#else - ret = mtk_wcn_hif_sdio_writeb(prGlueInfo->rHifInfo.cltCtx, u4Addr, ucData); -#endif - - if (ret) { - kalSendAeeWarning(HIF_SDIO_ERR_TITLE_STR, HIF_SDIO_ERR_DESC_STR "sdio_writeb() reports error: %x", ret); - DBGLOG(HAL, ERROR, ("sdio_writeb() reports error: %x", ret)); - } - - return (ret) ? FALSE : TRUE; - -} /* end of kalDevWriteWithSdioCmd52() */ - - -VOID -glSetPowerState ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 ePowerMode - ) -{ - return; -} - diff --git a/drivers/net/wireless/mt5931/os/linux/hif/sdio/x86.c b/drivers/net/wireless/mt5931/os/linux/hif/sdio/x86.c deleted file mode 100755 index 4322fa303a71..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/hif/sdio/x86.c +++ /dev/null @@ -1,33 +0,0 @@ -/****************************************************************************** -*[File] mt6516-evb.c -*[Version] v1.0 -*[Revision Date] 2010-03-01 -*[Author] -*[Description] -* dummy file for build system -*[Copyright] -* Copyright (C) 2010 MediaTek Incorporation. All Rights Reserved. -******************************************************************************/ - - - -/* -** $Log: mt6516-evb.c $ - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 04 19 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * remove debug message - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port -** -*/ diff --git a/drivers/net/wireless/mt5931/os/linux/include/gl_cfg80211.h b/drivers/net/wireless/mt5931/os/linux/include/gl_cfg80211.h deleted file mode 100755 index 15db319c0deb..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/include/gl_cfg80211.h +++ /dev/null @@ -1,319 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/include/gl_cfg80211.h#1 $ -*/ - -/*! \file gl_cfg80211.h - \brief This file is for Portable Driver linux cfg80211 support. -*/ - -/******************************************************************************* -* Copyright (c) 2007 MediaTek Inc. -* -* All rights reserved. Copying, compilation, modification, distribution -* or any other use whatsoever of this material is strictly prohibited -* except in accordance with a Software License Agreement with -* MediaTek Inc. -******************************************************************************** -*/ - -/******************************************************************************* -* LEGAL DISCLAIMER -* -* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND -* AGREES THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK -* SOFTWARE") RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE -* PROVIDED TO BUYER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY -* DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT -* LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -* PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE -* ANY WARRANTY WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY -* WHICH MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK -* SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY -* WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE -* FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION OR TO -* CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. -* -* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE -* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL -* BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT -* ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY -* BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -* -* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE -* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT -* OF LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING -* THEREOF AND RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN -* FRANCISCO, CA, UNDER THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE -* (ICC). -******************************************************************************** -*/ - -/* -** $Log: gl_cfg80211.h $ -** -** 08 29 2012 chinglan.wang -** [ALPS00349655] [Need Patch] [Volunteer Patch] [ALPS.JB] Daily build warning on [mt6575_phone_mhl-eng] -** . - * -*/ - -#ifndef _GL_CFG80211_H -#define _GL_CFG80211_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include -#include -#include -#include -#include - -#include "gl_os.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -/* cfg80211 hooks */ -int -mtk_cfg80211_change_iface ( - struct wiphy *wiphy, - struct net_device *ndev, - enum nl80211_iftype type, - u32 *flags, - struct vif_params *params - ); - - -int -mtk_cfg80211_add_key ( - struct wiphy *wiphy, - struct net_device *ndev, - u8 key_index, - bool pairwise, - const u8 *mac_addr, - struct key_params *params - ); - - -int -mtk_cfg80211_get_key ( - struct wiphy *wiphy, - struct net_device *ndev, - u8 key_index, - bool pairwise, - const u8 *mac_addr, - void *cookie, - void (*callback)(void *cookie, struct key_params*) - ); - - -int -mtk_cfg80211_del_key ( - struct wiphy *wiphy, - struct net_device *ndev, - u8 key_index, - bool pairwise, - const u8 *mac_addr - ); - - -int -mtk_cfg80211_set_default_key ( - struct wiphy *wiphy, - struct net_device *ndev, - u8 key_index, - bool unicast, - bool multicast - ); - - -int -mtk_cfg80211_get_station ( - struct wiphy *wiphy, - struct net_device *ndev, - u8 *mac, - struct station_info *sinfo - ); - - -int -mtk_cfg80211_scan ( - struct wiphy *wiphy, - struct net_device *ndev, - struct cfg80211_scan_request *request - ); - - -int -mtk_cfg80211_connect ( - struct wiphy *wiphy, - struct net_device *ndev, - struct cfg80211_connect_params *sme - ); - - -int -mtk_cfg80211_disconnect ( - struct wiphy *wiphy, - struct net_device *ndev, - u16 reason_code - ); - - -int -mtk_cfg80211_join_ibss ( - struct wiphy *wiphy, - struct net_device *ndev, - struct cfg80211_ibss_params *params - ); - - -int -mtk_cfg80211_leave_ibss ( - struct wiphy *wiphy, - struct net_device *ndev - ); - - -int -mtk_cfg80211_set_power_mgmt ( - struct wiphy *wiphy, - struct net_device *ndev, - bool enabled, - int timeout - ); - - -int -mtk_cfg80211_set_pmksa ( - struct wiphy *wiphy, - struct net_device *ndev, - struct cfg80211_pmksa *pmksa - ); - - -int -mtk_cfg80211_del_pmksa ( - struct wiphy *wiphy, - struct net_device *ndev, - struct cfg80211_pmksa *pmksa - ); - - -int -mtk_cfg80211_flush_pmksa ( - struct wiphy *wiphy, - struct net_device *ndev - ); - - -int -mtk_cfg80211_remain_on_channel ( - struct wiphy *wiphy, - struct net_device *ndev, - struct ieee80211_channel *chan, - enum nl80211_channel_type channel_type, - unsigned int duration, - u64 *cookie - ); - - -int -mtk_cfg80211_cancel_remain_on_channel ( - struct wiphy *wiphy, - struct net_device *ndev, - u64 cookie - ); - - -int -mtk_cfg80211_mgmt_tx ( - struct wiphy *wiphy, - struct net_device *ndev, - struct ieee80211_channel *channel, - bool offscan, - enum nl80211_channel_type channel_type, - bool channel_type_valid, - unsigned int wait, - const u8 *buf, - size_t len, - bool no_cck, - bool dont_wait_for_ack, - u64 *cookie - ); - - -int -mtk_cfg80211_mgmt_tx_cancel_wait ( - struct wiphy *wiphy, - struct net_device *ndev, - u64 cookie - ); - -#if CONFIG_NL80211_TESTMODE -int -mtk_cfg80211_testmode_cmd( - IN struct wiphy *wiphy, - IN void *data, - IN int len - ); - -int -mtk_cfg80211_testmode_sw_cmd( - IN struct wiphy *wiphy, - IN void *data, - IN int len - ); -#if CFG_SUPPORT_WAPI -int -mtk_cfg80211_testmode_set_key_ext( - IN struct wiphy *wiphy, - IN void *data, - IN int len - ); -#endif -#else - #error "Please ENABLE kernel config (CONFIG_NL80211_TESTMODE) to support Wi-Fi Direct" -#endif - - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _GL_CFG80211_H */ - diff --git a/drivers/net/wireless/mt5931/os/linux/include/gl_kal.h b/drivers/net/wireless/mt5931/os/linux/include/gl_kal.h deleted file mode 100755 index 6df16d4ef1dd..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/include/gl_kal.h +++ /dev/null @@ -1,2250 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/include/gl_kal.h#1 $ -*/ - -/*! \file gl_kal.h - \brief Declaration of KAL functions - kal*() which is provided by GLUE Layer. - - Any definitions in this file will be shared among GLUE Layer and internal Driver Stack. -*/ - - - -/* -** $Log: gl_kal.h $ - * - * 06 13 2012 yuche.tsai - * NULL - * Update maintrunk driver. - * Add support for driver compose assoc request frame. - * - * 04 12 2012 terry.wu - * NULL - * Add AEE message support - * 1) Show AEE warning(red screen) if SDIO access error occurs - - * - * 03 02 2012 terry.wu - * NULL - * Snc CFG80211 modification for ICS migration from branch 2.2. - * - * 02 06 2012 wh.su - * [WCXRP00001177] [MT6620 Wi-Fi][Driver][2.2] Adding the query channel filter for AP mode - * adding the channel query filter for AP mode. - * - * 01 02 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * Adding the proto type function for set_int set_tx_power and get int get_ch_list. - * - * 12 13 2011 cm.chang - * [WCXRP00001136] [All Wi-Fi][Driver] Add wake lock for pending timer - * Add wake lock if timer timeout value is smaller than 5 seconds - * - * 11 24 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * adjust the code for Non-DBG and no XLOG. - * - * 11 22 2011 cp.wu - * [WCXRP00001120] [MT6620 Wi-Fi][Driver] Modify roaming to AIS state transition from synchronous to asynchronous approach to avoid incomplete state termination - * 1. change RDD related compile option brace position. - * 2. when roaming is triggered, ask AIS to transit immediately only when AIS is in Normal TR state without join timeout timer ticking - * 3. otherwise, insert AIS_REQUEST into pending request queue - * - * 11 11 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * modify the xlog related code. - * - * 11 10 2011 cp.wu - * [WCXRP00001098] [MT6620 Wi-Fi][Driver] Replace printk by DBG LOG macros in linux porting layer - * 1. eliminaite direct calls to printk in porting layer. - * 2. replaced by DBGLOG, which would be XLOG on ALPS platforms. - * - * 11 10 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Modify the QM xlog level and remove LOG_FUNC. - * - * 11 10 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * Using the new XLOG define for dum Memory. - * - * 11 08 2011 eddie.chen - * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog) - * Add xlog function. - * - * 11 08 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * add debug counters, eCurPsProf, for PS. - * - * 11 08 2011 cm.chang - * NULL - * Add RLM and CNM debug message for XLOG - * - * 11 07 2011 tsaiyuan.hsu - * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered - * add debug counters and periodically dump counters for debugging. - * - * 11 03 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * Add dumpMemory8 at XLOG support. - * - * 11 02 2011 wh.su - * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG - * adding the code for XLOG. - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 04 12 2011 cp.wu - * [WCXRP00000635] [MT6620 Wi-Fi][Driver] Clear pending security frames when QM clear pending data frames for dedicated network type - * include link.h for linux's port. - * - * 04 12 2011 cp.wu - * [WCXRP00000635] [MT6620 Wi-Fi][Driver] Clear pending security frames when QM clear pending data frames for dedicated network type - * clear pending security frames for dedicated network type when BSS is being deactivated/disconnected - * - * 04 01 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * 1. simplify config.h due to aggregation options could be also applied for eHPI/SPI interface - * 2. use spin-lock instead of semaphore for protecting eHPI access because of possible access from ISR - * 3. request_irq() API has some changes between linux kernel 2.6.12 and 2.6.26 - * - * 03 16 2011 cp.wu - * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period - * 1. pre-allocate physical continuous buffer while module is being loaded - * 2. use pre-allocated physical continuous buffer for TX/RX DMA transfer - * - * The windows part remained the same as before, but added similiar APIs to hide the difference. - * - * 03 10 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Add BOW table. - * - * 03 07 2011 terry.wu - * [WCXRP00000521] [MT6620 Wi-Fi][Driver] Remove non-standard debug message - * Toggle non-standard debug messages to comments. - * - * 03 06 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Sync BOW Driver to latest person development branch version.. - * - * 03 02 2011 cp.wu - * [WCXRP00000503] [MT6620 Wi-Fi][Driver] Take RCPI brought by association response as initial RSSI right after connection is built. - * use RCPI brought by ASSOC-RESP after connection is built as initial RCPI to avoid using a uninitialized MAC-RX RCPI. - * - * 02 24 2011 cp.wu - * [WCXRP00000490] [MT6620 Wi-Fi][Driver][Win32] modify kalMsleep() implementation because NdisMSleep() won't sleep long enough for specified interval such as 500ms - * modify cnm_timer and hem_mbox APIs to be thread safe to ease invoking restrictions - * - * 01 12 2011 cp.wu - * [WCXRP00000357] [MT6620 Wi-Fi][Driver][Bluetooth over Wi-Fi] add another net device interface for BT AMP - * implementation of separate BT_OVER_WIFI data path. - * - * 01 04 2011 cp.wu - * [WCXRP00000338] [MT6620 Wi-Fi][Driver] Separate kalMemAlloc into kmalloc and vmalloc implementations to ease physically continous memory demands - * separate kalMemAlloc() into virtually-continous and physically-continous type to ease slab system pressure - * - * 12 31 2010 cp.wu - * [WCXRP00000335] [MT6620 Wi-Fi][Driver] change to use milliseconds sleep instead of delay to avoid blocking to system scheduling - * change to use msleep() and shorten waiting interval to reduce blocking to other task while Wi-Fi driver is being loaded - * - * 12 31 2010 jeffrey.chang - * [WCXRP00000332] [MT6620 Wi-Fi][Driver] add kal sleep function for delay which use blocking call - * modify the implementation of kalDelay to msleep - * - * 12 22 2010 cp.wu - * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery - * 1. header file restructure for more clear module isolation - * 2. add function interface definition for implementing Service Discovery callbacks - * - * 11 30 2010 yuche.tsai - * NULL - * Invitation & Provision Discovery Indication. - * - * 11 26 2010 cp.wu - * [WCXRP00000209] [MT6620 Wi-Fi][Driver] Modify NVRAM checking mechanism to warning only with necessary data field checking - * 1. NVRAM error is now treated as warning only, thus normal operation is still available but extra scan result used to indicate user is attached - * 2. DPD and TX-PWR are needed fields from now on, if these 2 fields are not availble then warning message is shown - * - * 11 08 2010 cp.wu - * [WCXRP00000166] [MT6620 Wi-Fi][Driver] use SDIO CMD52 for enabling/disabling interrupt to reduce transaction period - * change to use CMD52 for enabling/disabling interrupt to reduce SDIO transaction time - * - * 11 01 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module - * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead - * 2) Remove CNM CH-RECOVER event handling - * 3) cfg read/write API renamed with kal prefix for unified naming rules. - * - * 10 05 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * 1) add NVRAM access API - * 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option) - * 3) add OID implementation for NVRAM read/write service - * - * 10 04 2010 wh.su - * [WCXRP00000081] [MT6620][Driver] Fix the compiling error at WinXP while enable P2P - * add a kal function for set cipher. - * - * 10 04 2010 wh.su - * [WCXRP00000081] [MT6620][Driver] Fix the compiling error at WinXP while enable P2P - * fixed compiling error while enable p2p. - * - * 09 28 2010 wh.su - * NULL - * [WCXRP00000069][MT6620 Wi-Fi][Driver] Fix some code for phase 1 P2P Demo. - * - * 09 21 2010 cp.wu - * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated - * Do a complete reset with STA-REC null checking for RF test re-entry - * - * 09 21 2010 kevin.huang - * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning - * Eliminate Linux Compile Warning - * - * 09 10 2010 wh.su - * NULL - * fixed the compiling error at win XP. - * - * 09 07 2010 wh.su - * NULL - * adding the code for beacon/probe req/ probe rsp wsc ie at p2p. - * - * 09 06 2010 wh.su - * NULL - * let the p2p can set the privacy bit at beacon and rsn ie at assoc req at key handshake state. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 08 06 2010 cp.wu - * NULL - * driver hook modifications corresponding to ioctl interface change. - * - * 08 03 2010 cp.wu - * NULL - * [Wi-Fi Direct Driver Hook] change event indication API to be consistent with supplicant - * - * 08 03 2010 cp.wu - * NULL - * [Wi-Fi Direct] add framework for driver hooks - * - * 08 02 2010 jeffrey.chang - * NULL - * modify kalSetEvent declaration - * - * 07 29 2010 cp.wu - * NULL - * simplify post-handling after TX_DONE interrupt is handled. - * - * 07 23 2010 cp.wu - * - * 1) re-enable AIS-FSM beacon timeout handling. - * 2) scan done API revised - * - * 07 23 2010 jeffrey.chang - * - * fix kal header file - * - * 07 22 2010 jeffrey.chang - * - * use different spin lock for security frame - * - * 07 22 2010 jeffrey.chang - * - * add new spinlock - * - * 07 19 2010 jeffrey.chang - * - * add kal api for scanning done - * - * 07 19 2010 jeffrey.chang - * - * modify cmd/data path for new design - * - * 07 19 2010 jeffrey.chang - * - * add new kal api - * - * 07 19 2010 jeffrey.chang - * - * Linux port modification - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 21 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * change MAC address updating logic. - * - * 06 18 2010 cm.chang - * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver - * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf - * - * 06 11 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * 1) migrate assoc.c. - * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness - * 3) add configuration options for CNM_MEM and RSN modules - * 4) add data path for management frames - * 5) eliminate rPacketInfo of MSDU_INFO_T - * - * 06 07 2010 cp.wu - * [WPD00003833][MT6620 and MT5931] Driver migration - * gl_kal merged - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add basic handling framework for wireless extension ioctls. - * - * 05 11 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add ioctl for controlling p2p scan phase parameters - * - * 05 10 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * fill network type field while doing frame identification. - * - * 05 10 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * implement basic wi-fi direct framework - * - * 05 07 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add basic framework for implementating P2P driver hook. - * - * 05 07 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * modify kalMemAlloc method - * - * 04 28 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * change prefix for data structure used to communicate with 802.11 PAL - * to avoid ambiguous naming with firmware interface - * - * 04 27 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add multiple physical link support - * - * 04 27 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * follow Linux's firmware framework, and remove unused kal API - * - * 04 22 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * when acquiring driver-own, wait for up to 8 seconds. - * - * 04 22 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * - * 1) modify rx path code for supporting Wi-Fi direct - * 2) modify config.h since Linux dont need to consider retaining packet - * - * 04 21 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * add for private ioctl support - * - * 04 20 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * don't need SPIN_LOCK_PWR_CTRL anymore, it will raise IRQL - * * and cause SdBusSubmitRequest running at DISPATCH_LEVEL as well. - * - * 04 14 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * information buffer for query oid/ioctl is now buffered in prCmdInfo - * * * * * * * * instead of glue-layer variable to improve multiple oid/ioctl capability - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * * * * * * * * * * * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * * * * * * * * * * * * * * * * * 2) command sequence number is now increased atomically - * * * * * * * * * * * * * * * * * * * 3) private data could be hold and taken use for other purpose - * - * 04 09 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * 1) add spinlock - * * * 2) add KAPI for handling association info - * - * 04 09 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * adding firmware download KAPI - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * finish non-glue layer access to glue variables - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * accessing to firmware load/start address, and access to OID handling information - * * * * are now handled in glue layer - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * rWlanInfo should be placed at adapter rather than glue due to most operations - * * * * * * * * * are done in adapter layer. - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access to prGlueInfo->eParamMediaStateIndicated from non-glue layer - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * add KAL API: kalFlushPendingTxPackets(), and take use of the API - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access to prGlueInfo->rWlanInfo.eLinkAttr.ucMediaStreamMode from non-glue layer. - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * improve none-glue code portability - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * code refine: fgTestMode should be at adapter rather than glue due to the device/fw is also involved - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) for some OID, never do timeout expiration - * * * * 2) add 2 kal API for later integration - * - * 03 30 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * emulate NDIS Pending OID facility - * - * 03 26 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * [WPD00003826] Initial import for Linux port - * adding firmware download KAPI - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port -** \main\maintrunk.MT5921\41 2009-09-28 20:19:23 GMT mtk01090 -** Add private ioctl to carry OID structures. Restructure public/private ioctl interfaces to Linux kernel. -** \main\maintrunk.MT5921\40 2009-08-18 22:57:09 GMT mtk01090 -** Add Linux SDIO (with mmc core) support. -** Add Linux 2.6.21, 2.6.25, 2.6.26. -** Fix compile warning in Linux. -** \main\maintrunk.MT5921\39 2009-06-23 23:19:15 GMT mtk01090 -** Add build option BUILD_USE_EEPROM and compile option CFG_SUPPORT_EXT_CONFIG for NVRAM support -** \main\maintrunk.MT5921\38 2009-02-09 14:03:17 GMT mtk01090 -** Add KAL function kalDevSetPowerState(). It is not implemented yet. Only add an empty macro. -** -** \main\maintrunk.MT5921\37 2009-01-22 13:05:59 GMT mtk01088 -** new defeine to got 1x value at packet reserved field -** \main\maintrunk.MT5921\36 2008-12-08 16:15:02 GMT mtk01461 -** Add kalQueryValidBufferLength() macro -** \main\maintrunk.MT5921\35 2008-11-13 20:33:15 GMT mtk01104 -** Remove lint warning -** \main\maintrunk.MT5921\34 2008-10-22 11:05:52 GMT mtk01461 -** Remove unused macro -** \main\maintrunk.MT5921\33 2008-10-16 15:48:17 GMT mtk01461 -** Update driver to fix lint warning -** \main\maintrunk.MT5921\32 2008-09-02 11:50:51 GMT mtk01461 -** SPIN_LOCK_SDIO_DDK_TX_QUE -** \main\maintrunk.MT5921\31 2008-08-29 15:58:30 GMT mtk01088 -** remove non-used function for code refine -** \main\maintrunk.MT5921\30 2008-08-21 00:33:29 GMT mtk01461 -** Update for Driver Review -** \main\maintrunk.MT5921\29 2008-06-19 13:29:14 GMT mtk01425 -** 1. Add declaration of SPIN_LOCK_SDIO_DDK_TX_QUE and SPIN_LOCK_SDIO_DDK_RX_QUE -** \main\maintrunk.MT5921\28 2008-05-30 20:27:34 GMT mtk01461 -** Rename KAL function -** \main\maintrunk.MT5921\27 2008-05-30 14:42:05 GMT mtk01461 -** Remove WMM Assoc Flag in KAL -** \main\maintrunk.MT5921\26 2008-05-29 14:15:18 GMT mtk01084 -** remove un-used function -** \main\maintrunk.MT5921\25 2008-04-23 14:02:20 GMT mtk01084 -** modify KAL port access function prototype -** \main\maintrunk.MT5921\24 2008-04-17 23:06:41 GMT mtk01461 -** Add iwpriv support for AdHocMode setting -** \main\maintrunk.MT5921\23 2008-04-08 15:38:50 GMT mtk01084 -** add KAL function to setting pattern search function enable/ disable -** \main\maintrunk.MT5921\22 2008-03-26 15:34:48 GMT mtk01461 -** Add update MAC address func -** \main\maintrunk.MT5921\21 2008-03-18 15:56:15 GMT mtk01084 -** update ENUM_NIC_INITIAL_PARAM_E -** \main\maintrunk.MT5921\20 2008-03-18 11:49:28 GMT mtk01084 -** update function for initial value access -** \main\maintrunk.MT5921\19 2008-03-18 10:21:31 GMT mtk01088 -** use kal update associate request at linux -** \main\maintrunk.MT5921\18 2008-03-14 18:03:41 GMT mtk01084 -** refine register and port access function -** \main\maintrunk.MT5921\17 2008-03-11 14:51:02 GMT mtk01461 -** Add copy_to(from)_user macro -** \main\maintrunk.MT5921\16 2008-03-06 23:42:21 GMT mtk01385 -** 1. add Query Registry Mac address function. -** \main\maintrunk.MT5921\15 2008-02-26 09:48:04 GMT mtk01084 -** modify KAL set network address/ checksum offload part -** \main\maintrunk.MT5921\14 2008-01-09 17:54:58 GMT mtk01084 -** Modify the argument of kalQueryPacketInfo -** \main\maintrunk.MT5921\13 2007-11-29 02:05:20 GMT mtk01461 -** Fix Windows RX multiple packet retain problem -** \main\maintrunk.MT5921\12 2007-11-26 19:43:45 GMT mtk01461 -** Add OS_TIMESTAMP macro -** -** \main\maintrunk.MT5921\11 2007-11-09 16:36:15 GMT mtk01425 -** 1. Modify for CSUM offloading with Tx Fragment -** \main\maintrunk.MT5921\10 2007-11-07 18:38:37 GMT mtk01461 -** Add Tx Fragmentation Support -** \main\maintrunk.MT5921\9 2007-11-06 19:36:50 GMT mtk01088 -** add the WPS related code -** \main\maintrunk.MT5921\8 2007-11-02 01:03:57 GMT mtk01461 -** Unify TX Path for Normal and IBSS Power Save + IBSS neighbor learning -** Revision 1.4 2007/07/05 07:25:33 MTK01461 -** Add Linux initial code, modify doc, add 11BB, RF init code -** -** Revision 1.3 2007/06/27 02:18:50 MTK01461 -** Update SCAN_FSM, Initial(Can Load Module), Proc(Can do Reg R/W), TX API -** -** Revision 1.2 2007/06/25 06:16:23 MTK01461 -** Update illustrations, gl_init.c, gl_kal.c, gl_kal.h, gl_os.h and RX API -** -*/ - - -#ifndef _GL_KAL_H -#define _GL_KAL_H - - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "config.h" -#include "gl_typedef.h" -#include "gl_os.h" -#include "link.h" -#include "nic/mac.h" -#include "nic/wlan_def.h" -#include "wlan_lib.h" -#include "wlan_oid.h" -#include "gl_wext_priv.h" - - -#if CFG_ENABLE_BT_OVER_WIFI - #include "nic/bow.h" -#endif - -#if DBG -extern int allocatedMemSize; -#endif - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -//#define USEC_PER_MSEC (1000) - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef enum _ENUM_SPIN_LOCK_CATEGORY_E { - SPIN_LOCK_FSM = 0, - - /* FIX ME */ - SPIN_LOCK_RX_QUE, - SPIN_LOCK_TX_QUE, - SPIN_LOCK_CMD_QUE, - SPIN_LOCK_TX_RESOURCE, - SPIN_LOCK_CMD_RESOURCE, - SPIN_LOCK_QM_TX_QUEUE, - SPIN_LOCK_CMD_PENDING, - SPIN_LOCK_CMD_SEQ_NUM, - SPIN_LOCK_TX_MSDU_INFO_LIST, - SPIN_LOCK_TXING_MGMT_LIST, - SPIN_LOCK_TX_SEQ_NUM, - SPIN_LOCK_TX_COUNT, - SPIN_LOCK_TXS_COUNT, - /* end */ - SPIN_LOCK_TX, - SPIN_LOCK_IO_REQ, - SPIN_LOCK_INT, - - SPIN_LOCK_MGT_BUF, - SPIN_LOCK_MSG_BUF, - SPIN_LOCK_STA_REC, - - SPIN_LOCK_MAILBOX, - SPIN_LOCK_TIMER, - - SPIN_LOCK_BOW_TABLE, - - SPIN_LOCK_EHPI_BUS, /* only for EHPI */ - SPIN_LOCK_NET_DEV, - SPIN_LOCK_NUM -} ENUM_SPIN_LOCK_CATEGORY_E; - -/* event for assoc infomation update */ -typedef struct _EVENT_ASSOC_INFO { - UINT_8 ucAssocReq; /* 1 for assoc req, 0 for assoc rsp */ - UINT_8 ucReassoc; /* 0 for assoc, 1 for reassoc */ - UINT_16 u2Length; - PUINT_8 pucIe; -} EVENT_ASSOC_INFO, *P_EVENT_ASSOC_INFO; - -typedef enum _ENUM_KAL_NETWORK_TYPE_INDEX_T { - KAL_NETWORK_TYPE_AIS_INDEX = 0, -#if CFG_ENABLE_WIFI_DIRECT - KAL_NETWORK_TYPE_P2P_INDEX, -#endif -#if CFG_ENABLE_BT_OVER_WIFI - KAL_NETWORK_TYPE_BOW_INDEX, -#endif - KAL_NETWORK_TYPE_INDEX_NUM -} ENUM_KAL_NETWORK_TYPE_INDEX_T; - -typedef enum _ENUM_KAL_MEM_ALLOCATION_TYPE_E { - PHY_MEM_TYPE, /* physically continuous */ - VIR_MEM_TYPE, /* virtually continous */ - MEM_TYPE_NUM -} ENUM_KAL_MEM_ALLOCATION_TYPE; - -#if CONFIG_ANDROID /* Defined in Android kernel source */ -typedef struct wake_lock KAL_WAKE_LOCK_T, *P_KAL_WAKE_LOCK_T; -#else -typedef UINT_32 KAL_WAKE_LOCK_T, *P_KAL_WAKE_LOCK_T; -#endif - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/* Macros of SPIN LOCK operations for using in Driver Layer */ -/*----------------------------------------------------------------------------*/ -#define KAL_SPIN_LOCK_DECLARATION() UINT_32 __u4Flags - -#define KAL_ACQUIRE_SPIN_LOCK(_prAdapter, _rLockCategory) \ - kalAcquireSpinLock(((P_ADAPTER_T)_prAdapter)->prGlueInfo, _rLockCategory, &__u4Flags) - -#define KAL_RELEASE_SPIN_LOCK(_prAdapter, _rLockCategory) \ - kalReleaseSpinLock(((P_ADAPTER_T)_prAdapter)->prGlueInfo, _rLockCategory, __u4Flags) - -/*----------------------------------------------------------------------------*/ -/* Macros for accessing Reserved Fields of native packet */ -/*----------------------------------------------------------------------------*/ -#define KAL_GET_PKT_QUEUE_ENTRY(_p) GLUE_GET_PKT_QUEUE_ENTRY(_p) -#define KAL_GET_PKT_DESCRIPTOR(_prQueueEntry) GLUE_GET_PKT_DESCRIPTOR(_prQueueEntry) -#define KAL_GET_PKT_TID(_p) GLUE_GET_PKT_TID(_p) -#define KAL_GET_PKT_IS1X(_p) GLUE_GET_PKT_IS1X(_p) -#define KAL_GET_PKT_HEADER_LEN(_p) GLUE_GET_PKT_HEADER_LEN(_p) -#define KAL_GET_PKT_PAYLOAD_LEN(_p) GLUE_GET_PKT_PAYLOAD_LEN(_p) -#define KAL_GET_PKT_ARRIVAL_TIME(_p) GLUE_GET_PKT_ARRIVAL_TIME(_p) - -/*----------------------------------------------------------------------------*/ -/* Macros of wake_lock operations for using in Driver Layer */ -/*----------------------------------------------------------------------------*/ -#if CONFIG_ANDROID /* Defined in Android kernel source */ -#define KAL_WAKE_LOCK_INIT(_prAdapter, _prWakeLock, _pcName) \ - wake_lock_init(_prWakeLock, WAKE_LOCK_SUSPEND, _pcName) - -#define KAL_WAKE_LOCK_DESTROY(_prAdapter, _prWakeLock) \ - wake_lock_destroy(_prWakeLock) - -#define KAL_WAKE_LOCK(_prAdapter, _prWakeLock) \ - wake_lock(_prWakeLock) - -#define KAL_WAKE_LOCK_TIMEOUT(_prAdapter, _prWakeLock, _u4Timeout) \ - wake_lock_timeout(_prWakeLock, _u4Timeout) - -#define KAL_WAKE_UNLOCK(_prAdapter, _prWakeLock) \ - wake_unlock(_prWakeLock) - -#else -#define KAL_WAKE_LOCK_INIT(_prAdapter, _prWakeLock, _pcName) -#define KAL_WAKE_LOCK_DESTROY(_prAdapter, _prWakeLock) -#define KAL_WAKE_LOCK(_prAdapter, _prWakeLock) -#define KAL_WAKE_LOCK_TIMEOUT(_prAdapter, _prWakeLock, _u4Timeout) -#define KAL_WAKE_UNLOCK(_prAdapter, _prWakeLock) -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Cache memory allocation -* -* \param[in] u4Size Required memory size. -* \param[in] eMemType Memory allocation type -* -* \return Pointer to allocated memory -* or NULL -*/ -/*----------------------------------------------------------------------------*/ -#if DBG -#define kalMemAlloc(u4Size, eMemType) ({ \ - void *pvAddr; \ - if(eMemType == PHY_MEM_TYPE) { \ - pvAddr = kmalloc(u4Size, GFP_KERNEL); \ - } \ - else { \ - pvAddr = vmalloc(u4Size); \ - } \ - if (pvAddr) { \ - allocatedMemSize += u4Size; \ - printk(KERN_INFO DRV_NAME "0x%p(%ld) allocated (%s:%s)\n", \ - pvAddr, (UINT_32)u4Size, __FILE__, __FUNCTION__); \ - } \ - pvAddr; \ - }) -#else -#define kalMemAlloc(u4Size, eMemType) ({ \ - void *pvAddr; \ - if(eMemType == PHY_MEM_TYPE) { \ - pvAddr = kmalloc(u4Size, GFP_KERNEL); \ - } \ - else { \ - pvAddr = vmalloc(u4Size); \ - } \ - pvAddr; \ - }) -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Free allocated cache memory -* -* \param[in] pvAddr Required memory size. -* \param[in] eMemType Memory allocation type -* \param[in] u4Size Allocated memory size. -* -* \return - -*/ -/*----------------------------------------------------------------------------*/ -#if DBG -#define kalMemFree(pvAddr, eMemType, u4Size) \ - { \ - if (pvAddr) { \ - allocatedMemSize -= u4Size; \ - printk(KERN_INFO DRV_NAME "0x%p(%ld) freed (%s:%s)\n", \ - pvAddr, (UINT_32)u4Size, __FILE__, __FUNCTION__); \ - } \ - if(eMemType == PHY_MEM_TYPE) { \ - kfree(pvAddr); \ - } \ - else { \ - vfree(pvAddr); \ - } \ - } -#else -#define kalMemFree(pvAddr, eMemType, u4Size) \ - { \ - if(eMemType == PHY_MEM_TYPE) { \ - kfree(pvAddr); \ - } \ - else { \ - vfree(pvAddr); \ - } \ - } -#endif - -#define kalUdelay(u4USec) udelay(u4USec) - -#define kalMdelay(u4MSec) mdelay(u4MSec) -#define kalMsleep(u4MSec) msleep(u4MSec) - -/* Copy memory from user space to kernel space */ -#define kalMemCopyFromUser(_pvTo, _pvFrom, _u4N) copy_from_user(_pvTo, _pvFrom, _u4N) - -/* Copy memory from kernel space to user space */ -#define kalMemCopyToUser(_pvTo, _pvFrom, _u4N) copy_to_user(_pvTo, _pvFrom, _u4N) - -/* Copy memory block with specific size */ -#define kalMemCopy(pvDst, pvSrc, u4Size) memcpy(pvDst, pvSrc, u4Size) - -/* Set memory block with specific pattern */ -#define kalMemSet(pvAddr, ucPattern, u4Size) memset(pvAddr, ucPattern, u4Size) - -/* Compare two memory block with specific length. - * Return zero if they are the same. - */ -#define kalMemCmp(pvAddr1, pvAddr2, u4Size) memcmp(pvAddr1, pvAddr2, u4Size) - -/* Zero specific memory block */ -#define kalMemZero(pvAddr, u4Size) memset(pvAddr, 0, u4Size) - -/* defined for wince sdio driver only */ -#if defined(_HIF_SDIO) -#define kalDevSetPowerState(prGlueInfo, ePowerMode) glSetPowerState(prGlueInfo, ePowerMode) -#else -#define kalDevSetPowerState(prGlueInfo, ePowerMode) -#endif - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Notify OS with SendComplete event of the specific packet. Linux should -* free packets here. -* -* \param[in] prGlueInfo Pointer of GLUE Data Structure -* \param[in] pvPacket Pointer of Packet Handle -* \param[in] status Status Code for OS upper layer -* -* \return - -*/ -/*----------------------------------------------------------------------------*/ -#define kalSendComplete(prGlueInfo, pvPacket, status) \ - kalSendCompleteAndAwakeQueue(prGlueInfo, pvPacket) - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is used to locate the starting address of incoming ethernet -* frame for skb. -* -* \param[in] prGlueInfo Pointer of GLUE Data Structure -* \param[in] pvPacket Pointer of Packet Handle -* -* \return starting address of ethernet frame buffer. -*/ -/*----------------------------------------------------------------------------*/ -#define kalQueryBufferPointer(prGlueInfo, pvPacket) \ - ((PUINT_8)((struct sk_buff *)pvPacket)->data) - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is used to query the length of valid buffer which is accessible during -* port read/write. -* -* \param[in] prGlueInfo Pointer of GLUE Data Structure -* \param[in] pvPacket Pointer of Packet Handle -* -* \return starting address of ethernet frame buffer. -*/ -/*----------------------------------------------------------------------------*/ -#define kalQueryValidBufferLength(prGlueInfo, pvPacket) \ - ((UINT_32)((struct sk_buff *)pvPacket)->end - \ - (UINT_32)((struct sk_buff *)pvPacket)->data) - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function is used to copy the entire frame from skb to the destination -* address in the input parameter. -* -* \param[in] prGlueInfo Pointer of GLUE Data Structure -* \param[in] pvPacket Pointer of Packet Handle -* \param[in] pucDestBuffer Destination Address -* -* \return - -*/ -/*----------------------------------------------------------------------------*/ -#define kalCopyFrame(prGlueInfo, pvPacket, pucDestBuffer) \ - {struct sk_buff *skb = (struct sk_buff *)pvPacket; \ - memcpy(pucDestBuffer, skb->data, skb->len);} - -#define kalGetTimeTick() jiffies_to_msecs(jiffies) - -#define kalPrint printk - -#if !DBG -#if CFG_SUPPORT_XLOG -#define XLOG_TAG "wlan" - -#define XLOG_FUNC(__LEVEL, __FMT...)\ - if (__LEVEL == ANDROID_LOG_ERROR) {\ - xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, ##__FMT);\ - } \ - else if (__LEVEL == ANDROID_LOG_WARN) {\ - xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, ##__FMT);\ - } \ - else if (__LEVEL == ANDROID_LOG_INFO) {\ - xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, ##__FMT);\ - } \ - else if (__LEVEL == ANDROID_LOG_DEBUG) {\ - xlog_printk(ANDROID_LOG_DEBUG, XLOG_TAG, ##__FMT);\ - } \ - else if (__LEVEL == ANDROID_LOG_VERBOSE) {\ - xlog_printk(ANDROID_LOG_VERBOSE, XLOG_TAG, ##__FMT);\ - } - -#define AIS_ERROR_LOGFUNC(_Fmt...) -#define AIS_WARN_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt) -#define AIS_INFO_LOGFUNC(_Fmt...) -#define AIS_STATE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define AIS_EVENT_LOGFUNC(_Fmt...) -#define AIS_TRACE_LOGFUNC(_Fmt...) -#define AIS_LOUD_LOGFUNC(_Fmt...) -#define AIS_TEMP_LOGFUNC(_Fmt...) - -#define AIS_ERROR_LOGDUMP8(x, y) -#define AIS_WARN_LOGDUMP8(x, y) -#define AIS_INFO_LOGDUMP8(x, y) -#define AIS_STATE_LOGDUMP8(x, y) -#define AIS_EVENT_LOGDUMP8(x, y) -#define AIS_TRACE_LOGDUMP8(x, y) -#define AIS_LOUD_LOGDUMP8(x, y) -#define AIS_TEMP_LOGDUMP8(x, y) - -#define INTR_ERROR_LOGFUNC(_Fmt...) -#define INTR_WARN_LOGFUNC(_Fmt...) -#define INTR_INFO_LOGFUNC(_Fmt...) -#define INTR_STATE_LOGFUNC(_Fmt...) -#define INTR_EVENT_LOGFUNC(_Fmt...) -#define INTR_TRACE_LOGFUNC(_Fmt...) -#define INTR_LOUD_LOGFUNC(_Fmt...) -#define INTR_TEMP_LOGFUNC(_Fmt...) - -#define INTR_ERROR_LOGDUMP8(x, y) -#define INTR_WARN_LOGDUMP8(x, y) -#define INTR_INFO_LOGDUMP8(x, y) -#define INTR_STATE_LOGDUMP8(x, y) -#define INTR_EVENT_LOGDUMP8(x, y) -#define INTR_TRACE_LOGDUMP8(x, y) -#define INTR_LOUD_LOGDUMP8(x, y) -#define INTR_TEMP_LOGDUMP8(x, y) - -#define INIT_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt) -#define INIT_WARN_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt) -#define INIT_INFO_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define INIT_STATE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define INIT_EVENT_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define INIT_TRACE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_DEBUG, XLOG_TAG, _Fmt) -#define INIT_LOUD_LOGFUNC(_Fmt...) -#define INIT_TEMP_LOGFUNC(_Fmt...) - -#define INIT_ERROR_LOGDUMP8(x, y) -#define INIT_WARN_LOGDUMP8(x, y) -#define INIT_INFO_LOGDUMP8(x, y) -#define INIT_STATE_LOGDUMP8(x, y) -#define INIT_EVENT_LOGDUMP8(x, y) -#define INIT_TRACE_LOGDUMP8(x, y) -#define INIT_LOUD_LOGDUMP8(x, y) -#define INIT_TEMP_LOGDUMP8(x, y) - -#define AAA_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt) -#define AAA_WARN_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt) -#define AAA_INFO_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define AAA_STATE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define AAA_EVENT_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define AAA_TRACE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_DEBUG, XLOG_TAG, _Fmt) -#define AAA_LOUD_LOGFUNC(_Fmt...) -#define AAA_TEMP_LOGFUNC(_Fmt...) - -#define AAA_ERROR_LOGDUMP8(x, y) -#define AAA_WARN_LOGDUMP8(x, y) -#define AAA_INFO_LOGDUMP8(x, y) -#define AAA_STATE_LOGDUMP8(x, y) -#define AAA_EVENT_LOGDUMP8(x, y) -#define AAA_TRACE_LOGDUMP8(x, y) -#define AAA_LOUD_LOGDUMP8(x, y) -#define AAA_TEMP_LOGDUMP8(x, y) - -#define ROAMING_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt) -#define ROAMING_WARN_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt) -#define ROAMING_INFO_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define ROAMING_STATE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define ROAMING_EVENT_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define ROAMING_TRACE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_DEBUG, XLOG_TAG, _Fmt) -#define ROAMING_LOUD_LOGFUNC(_Fmt...) -#define ROAMING_TEMP_LOGFUNC(_Fmt...) - -#define ROAMING_ERROR_LOGDUMP8(x, y) -#define ROAMING_WARN_LOGDUMP8(x, y) -#define ROAMING_INFO_LOGDUMP8(x, y) -#define ROAMING_STATE_LOGDUMP8(x, y) -#define ROAMING_EVENT_LOGDUMP8(x, y) -#define ROAMING_TRACE_LOGDUMP8(x, y) -#define ROAMING_LOUD_LOGDUMP8(x, y) -#define ROAMING_TEMP_LOGDUMP8(x, y) - -#define REQ_ERROR_LOGFUNC(_Fmt...) -#define REQ_WARN_LOGFUNC(_Fmt...) -#define REQ_INFO_LOGFUNC(_Fmt...) -#define REQ_STATE_LOGFUNC(_Fmt...) -#define REQ_EVENT_LOGFUNC(_Fmt...) -#define REQ_TRACE_LOGFUNC(_Fmt...) -#define REQ_LOUD_LOGFUNC(_Fmt...) -#define REQ_TEMP_LOGFUNC(_Fmt...) - -#define REQ_ERROR_LOGDUMP8(x, y) -#define REQ_WARN_LOGDUMP8(x, y) -#define REQ_INFO_LOGDUMP8(x, y) -#define REQ_STATE_LOGDUMP8(x, y) -#define REQ_EVENT_LOGDUMP8(x, y) -#define REQ_TRACE_LOGDUMP8(x, y) -#define REQ_LOUD_LOGDUMP8(x, y) -#define REQ_TEMP_LOGDUMP8(x, y) - -#define TX_ERROR_LOGFUNC(_Fmt...) -#define TX_WARN_LOGFUNC(_Fmt...) -#define TX_INFO_LOGFUNC(_Fmt...) -#define TX_STATE_LOGFUNC(_Fmt...) -#define TX_EVENT_LOGFUNC(_Fmt...) -#define TX_TRACE_LOGFUNC(_Fmt...) -#define TX_LOUD_LOGFUNC(_Fmt...) -#define TX_TEMP_LOGFUNC(_Fmt...) - -#define TX_ERROR_LOGDUMP8(x, y) -#define TX_WARN_LOGDUMP8(x, y) -#define TX_INFO_LOGDUMP8(x, y) -#define TX_STATE_LOGDUMP8(x, y) -#define TX_EVENT_LOGDUMP8(x, y) -#define TX_TRACE_LOGDUMP8(x, y) -#define TX_LOUD_LOGDUMP8(x, y) -#define TX_TEMP_LOGDUMP8(x, y) - -#define RX_ERROR_LOGFUNC(_Fmt...) -#define RX_WARN_LOGFUNC(_Fmt...) -#define RX_INFO_LOGFUNC(_Fmt...) -#define RX_STATE_LOGFUNC(_Fmt...) -#define RX_EVENT_LOGFUNC(_Fmt...) -#define RX_TRACE_LOGFUNC(_Fmt...) -#define RX_LOUD_LOGFUNC(_Fmt...) -#define RX_TEMP_LOGFUNC(_Fmt...) - -#define RX_ERROR_LOGDUMP8(x, y) -#define RX_WARN_LOGDUMP8(x, y) -#define RX_INFO_LOGDUMP8(x, y) -#define RX_STATE_LOGDUMP8(x, y) -#define RX_EVENT_LOGDUMP8(x, y) -#define RX_TRACE_LOGDUMP8(x, y) -#define RX_LOUD_LOGDUMP8(x, y) -#define RX_TEMP_LOGDUMP8(x, y) - -#define RFTEST_ERROR_LOGFUNC(_Fmt...) -#define RFTEST_WARN_LOGFUNC(_Fmt...) -#define RFTEST_INFO_LOGFUNC(_Fmt...) -#define RFTEST_STATE_LOGFUNC(_Fmt...) -#define RFTEST_EVENT_LOGFUNC(_Fmt...) -#define RFTEST_TRACE_LOGFUNC(_Fmt...) -#define RFTEST_LOUD_LOGFUNC(_Fmt...) -#define RFTEST_TEMP_LOGFUNC(_Fmt...) - -#define RFTEST_ERROR_LOGDUMP8(x, y) -#define RFTEST_WARN_LOGDUMP8(x, y) -#define RFTEST_INFO_LOGDUMP8(x, y) -#define RFTEST_STATE_LOGDUMP8(x, y) -#define RFTEST_EVENT_LOGDUMP8(x, y) -#define RFTEST_TRACE_LOGDUMP8(x, y) -#define RFTEST_LOUD_LOGDUMP8(x, y) -#define RFTEST_TEMP_LOGDUMP8(x, y) - -#define EMU_ERROR_LOGFUNC(_Fmt...) -#define EMU_WARN_LOGFUNC(_Fmt...) -#define EMU_INFO_LOGFUNC(_Fmt...) -#define EMU_STATE_LOGFUNC(_Fmt...) -#define EMU_EVENT_LOGFUNC(_Fmt...) -#define EMU_TRACE_LOGFUNC(_Fmt...) -#define EMU_LOUD_LOGFUNC(_Fmt...) -#define EMU_TEMP_LOGFUNC(_Fmt...) - -#define EMU_ERROR_LOGDUMP8(x, y) -#define EMU_WARN_LOGDUMP8(x, y) -#define EMU_INFO_LOGDUMP8(x, y) -#define EMU_STATE_LOGDUMP8(x, y) -#define EMU_EVENT_LOGDUMP8(x, y) -#define EMU_TRACE_LOGDUMP8(x, y) -#define EMU_LOUD_LOGDUMP8(x, y) -#define EMU_TEMP_LOGDUMP8(x, y) - -#define HEM_ERROR_LOGFUNC(_Fmt...) -#define HEM_WARN_LOGFUNC(_Fmt...) -#define HEM_INFO_LOGFUNC(_Fmt...) -#define HEM_STATE_LOGFUNC(_Fmt...) -#define HEM_EVENT_LOGFUNC(_Fmt...) -#define HEM_TRACE_LOGFUNC(_Fmt...) -#define HEM_LOUD_LOGFUNC(_Fmt...) -#define HEM_TEMP_LOGFUNC(_Fmt...) - -#define HEM_ERROR_LOGDUMP8(x, y) -#define HEM_WARN_LOGDUMP8(x, y) -#define HEM_INFO_LOGDUMP8(x, y) -#define HEM_STATE_LOGDUMP8(x, y) -#define HEM_EVENT_LOGDUMP8(x, y) -#define HEM_TRACE_LOGDUMP8(x, y) -#define HEM_LOUD_LOGDUMP8(x, y) -#define HEM_TEMP_LOGDUMP8(x, y) - -#define RLM_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt) -#define RLM_WARN_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt) -#define RLM_INFO_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define RLM_STATE_LOGFUNC(_Fmt...) -#define RLM_EVENT_LOGFUNC(_Fmt...) -#define RLM_TRACE_LOGFUNC(_Fmt...) -#define RLM_LOUD_LOGFUNC(_Fmt...) -#define RLM_TEMP_LOGFUNC(_Fmt...) - -#define RLM_ERROR_LOGDUMP8(x, y) -#define RLM_WARN_LOGDUMP8(x, y) -#define RLM_INFO_LOGDUMP8(x, y) -#define RLM_STATE_LOGDUMP8(x, y) -#define RLM_EVENT_LOGDUMP8(x, y) -#define RLM_TRACE_LOGDUMP8(x, y) -#define RLM_LOUD_LOGDUMP8(x, y) -#define RLM_TEMP_LOGDUMP8(x, y) - -#define MEM_ERROR_LOGFUNC(_Fmt...) -#define MEM_WARN_LOGFUNC(_Fmt...) -#define MEM_INFO_LOGFUNC(_Fmt...) -#define MEM_STATE_LOGFUNC(_Fmt...) -#define MEM_EVENT_LOGFUNC(_Fmt...) -#define MEM_TRACE_LOGFUNC(_Fmt...) -#define MEM_LOUD_LOGFUNC(_Fmt...) -#define MEM_TEMP_LOGFUNC(_Fmt...) - -#define MEM_ERROR_LOGDUMP8(x, y) -#define MEM_WARN_LOGDUMP8(x, y) -#define MEM_INFO_LOGDUMP8(x, y) -#define MEM_STATE_LOGDUMP8(x, y) -#define MEM_EVENT_LOGDUMP8(x, y) -#define MEM_TRACE_LOGDUMP8(x, y) -#define MEM_LOUD_LOGDUMP8(x, y) -#define MEM_TEMP_LOGDUMP8(x, y) - -#define CNM_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt) -#define CNM_WARN_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt) -#define CNM_INFO_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define CNM_STATE_LOGFUNC(_Fmt...) -#define CNM_EVENT_LOGFUNC(_Fmt...) -#define CNM_TRACE_LOGFUNC(_Fmt...) -#define CNM_LOUD_LOGFUNC(_Fmt...) -#define CNM_TEMP_LOGFUNC(_Fmt...) - -#define CNM_ERROR_LOGDUMP8(x, y) -#define CNM_WARN_LOGDUMP8(x, y) -#define CNM_INFO_LOGDUMP8(x, y) -#define CNM_STATE_LOGDUMP8(x, y) -#define CNM_EVENT_LOGDUMP8(x, y) -#define CNM_TRACE_LOGDUMP8(x, y) -#define CNM_LOUD_LOGDUMP8(x, y) -#define CNM_TEMP_LOGDUMP8(x, y) - -#define RSN_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt) -#define RSN_WARN_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt) -#define RSN_INFO_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define RSN_STATE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define RSN_EVENT_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define RSN_TRACE_LOGFUNC(_Fmt...) -#define RSN_LOUD_LOGFUNC(_Fmt...) -#define RSN_TEMP_LOGFUNC(_Fmt...) - -#define RSN_ERROR_LOGDUMP8(x, y) -#define RSN_WARN_LOGDUMP8(x, y) -#define RSN_INFO_LOGDUMP8(x, y) -#define RSN_STATE_LOGDUMP8(x, y) -#define RSN_EVENT_LOGDUMP8(x, y) -#define RSN_TRACE_LOGDUMP8(x, y) -#define RSN_LOUD_LOGDUMP8(x, y) -#define RSN_TEMP_LOGDUMP8(x, y) - -#define BSS_ERROR_LOGFUNC(_Fmt...) -#define BSS_WARN_LOGFUNC(_Fmt...) -#define BSS_INFO_LOGFUNC(_Fmt...) -#define BSS_STATE_LOGFUNC(_Fmt...) -#define BSS_EVENT_LOGFUNC(_Fmt...) -#define BSS_TRACE_LOGFUNC(_Fmt...) -#define BSS_LOUD_LOGFUNC(_Fmt...) -#define BSS_TEMP_LOGFUNC(_Fmt...) - -#define BSS_ERROR_LOGDUMP8(x, y) -#define BSS_WARN_LOGDUMP8(x, y) -#define BSS_INFO_LOGDUMP8(x, y) -#define BSS_STATE_LOGDUMP8(x, y) -#define BSS_EVENT_LOGDUMP8(x, y) -#define BSS_TRACE_LOGDUMP8(x, y) -#define BSS_LOUD_LOGDUMP8(x, y) -#define BSS_TEMP_LOGDUMP8(x, y) - -#define SCN_ERROR_LOGFUNC(_Fmt...) -#define SCN_WARN_LOGFUNC(_Fmt...) -#define SCN_INFO_LOGFUNC(_Fmt...) -#define SCN_STATE_LOGFUNC(_Fmt...) -#define SCN_EVENT_LOGFUNC(_Fmt...) -#define SCN_TRACE_LOGFUNC(_Fmt...) -#define SCN_LOUD_LOGFUNC(_Fmt...) -#define SCN_TEMP_LOGFUNC(_Fmt...) - -#define SCN_ERROR_LOGDUMP8(x, y) -#define SCN_WARN_LOGDUMP8(x, y) -#define SCN_INFO_LOGDUMP8(x, y) -#define SCN_STATE_LOGDUMP8(x, y) -#define SCN_EVENT_LOGDUMP8(x, y) -#define SCN_TRACE_LOGDUMP8(x, y) -#define SCN_LOUD_LOGDUMP8(x, y) -#define SCN_TEMP_LOGDUMP8(x, y) - -#define SAA_ERROR_LOGFUNC(_Fmt...) -#define SAA_WARN_LOGFUNC(_Fmt...) -#define SAA_INFO_LOGFUNC(_Fmt...) -#define SAA_STATE_LOGFUNC(_Fmt...) -#define SAA_EVENT_LOGFUNC(_Fmt...) -#define SAA_TRACE_LOGFUNC(_Fmt...) -#define SAA_LOUD_LOGFUNC(_Fmt...) -#define SAA_TEMP_LOGFUNC(_Fmt...) - -#define SAA_ERROR_LOGDUMP8(x, y) -#define SAA_WARN_LOGDUMP8(x, y) -#define SAA_INFO_LOGDUMP8(x, y) -#define SAA_STATE_LOGDUMP8(x, y) -#define SAA_EVENT_LOGDUMP8(x, y) -#define SAA_TRACE_LOGDUMP8(x, y) -#define SAA_LOUD_LOGDUMP8(x, y) -#define SAA_TEMP_LOGDUMP8(x, y) - -#define P2P_ERROR_LOGFUNC(_Fmt...) -#define P2P_WARN_LOGFUNC(_Fmt...) -#define P2P_INFO_LOGFUNC(_Fmt...) -#define P2P_STATE_LOGFUNC(_Fmt...) -#define P2P_EVENT_LOGFUNC(_Fmt...) -#define P2P_TRACE_LOGFUNC(_Fmt...) -#define P2P_LOUD_LOGFUNC(_Fmt...) -#define P2P_TEMP_LOGFUNC(_Fmt...) - -#define P2P_ERROR_LOGDUMP8(x, y) -#define P2P_WARN_LOGDUMP8(x, y) -#define P2P_INFO_LOGDUMP8(x, y) -#define P2P_STATE_LOGDUMP8(x, y) -#define P2P_EVENT_LOGDUMP8(x, y) -#define P2P_TRACE_LOGDUMP8(x, y) -#define P2P_LOUD_LOGDUMP8(x, y) -#define P2P_TEMP_LOGDUMP8(x, y) - -#define QM_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt) -#define QM_WARN_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt) -#define QM_INFO_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define QM_STATE_LOGFUNC(_Fmt...) -#define QM_EVENT_LOGFUNC(_Fmt...) -#define QM_TRACE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_DEBUG, XLOG_TAG, _Fmt) -#define QM_LOUD_LOGFUNC(_Fmt...) -#define QM_TEMP_LOGFUNC(_Fmt...) - -#define QM_ERROR_LOGDUMP8(x, y) -#define QM_WARN_LOGDUMP8(x, y) -#define QM_INFO_LOGDUMP8(x, y) -#define QM_STATE_LOGDUMP8(x, y) -#define QM_EVENT_LOGDUMP8(x, y) -#define QM_TRACE_LOGDUMP8(x, y) -#define QM_LOUD_LOGDUMP8(x, y) -#define QM_TEMP_LOGDUMP8(x, y) - -#define SEC_ERROR_LOGFUNC(_Fmt...) -#define SEC_WARN_LOGFUNC(_Fmt...) -#define SEC_INFO_LOGFUNC(_Fmt...) -#define SEC_STATE_LOGFUNC(_Fmt...) -#define SEC_EVENT_LOGFUNC(_Fmt...) -#define SEC_TRACE_LOGFUNC(_Fmt...) -#define SEC_LOUD_LOGFUNC(_Fmt...) -#define SEC_TEMP_LOGFUNC(_Fmt...) - -#define SEC_ERROR_LOGDUMP8(x, y) -#define SEC_WARN_LOGDUMP8(x, y) -#define SEC_INFO_LOGDUMP8(x, y) -#define SEC_STATE_LOGDUMP8(x, y) -#define SEC_EVENT_LOGDUMP8(x, y) -#define SEC_TRACE_LOGDUMP8(x, y) -#define SEC_LOUD_LOGDUMP8(x, y) -#define SEC_TEMP_LOGDUMP8(x, y) - -#define BOW_ERROR_LOGFUNC(_Fmt...) -#define BOW_WARN_LOGFUNC(_Fmt...) -#define BOW_INFO_LOGFUNC(_Fmt...) -#define BOW_STATE_LOGFUNC(_Fmt...) -#define BOW_EVENT_LOGFUNC(_Fmt...) -#define BOW_TRACE_LOGFUNC(_Fmt...) -#define BOW_LOUD_LOGFUNC(_Fmt...) -#define BOW_TEMP_LOGFUNC(_Fmt...) - -#define BOW_ERROR_LOGDUMP8(x, y) -#define BOW_WARN_LOGDUMP8(x, y) -#define BOW_INFO_LOGDUMP8(x, y) -#define BOW_STATE_LOGDUMP8(x, y) -#define BOW_EVENT_LOGDUMP8(x, y) -#define BOW_TRACE_LOGDUMP8(x, y) -#define BOW_LOUD_LOGDUMP8(x, y) -#define BOW_TEMP_LOGDUMP8(x, y) - -#define HAL_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt) -#define HAL_WARN_LOGFUNC(_Fmt...) -#define HAL_INFO_LOGFUNC(_Fmt...) -#define HAL_STATE_LOGFUNC(_Fmt...) -#define HAL_EVENT_LOGFUNC(_Fmt...) -#define HAL_TRACE_LOGFUNC(_Fmt...) -#define HAL_LOUD_LOGFUNC(_Fmt...) -#define HAL_TEMP_LOGFUNC(_Fmt...) - -#define HAL_ERROR_LOGDUMP8(x, y) -#define HAL_WARN_LOGDUMP8(x, y) -#define HAL_INFO_LOGDUMP8(x, y) -#define HAL_STATE_LOGDUMP8(x, y) -#define HAL_EVENT_LOGDUMP8(x, y) -#define HAL_TRACE_LOGDUMP8(x, y) -#define HAL_LOUD_LOGDUMP8(x, y) -#define HAL_TEMP_LOGDUMP8(x, y) - -#define WAPI_ERROR_LOGFUNC(_Fmt...) -#define WAPI_WARN_LOGFUNC(_Fmt...) -#define WAPI_INFO_LOGFUNC(_Fmt...) -#define WAPI_STATE_LOGFUNC(_Fmt...) -#define WAPI_EVENT_LOGFUNC(_Fmt...) -#define WAPI_TRACE_LOGFUNC(_Fmt...) -#define WAPI_LOUD_LOGFUNC(_Fmt...) -#define WAPI_TEMP_LOGFUNC(_Fmt...) - -#define WAPI_ERROR_LOGDUMP8(x, y) -#define WAPI_WARN_LOGDUMP8(x, y) -#define WAPI_INFO_LOGDUMP8(x, y) -#define WAPI_STATE_LOGDUMP8(x, y) -#define WAPI_EVENT_LOGDUMP8(x, y) -#define WAPI_TRACE_LOGDUMP8(x, y) -#define WAPI_LOUD_LOGDUMP8(x, y) -#define WAPI_TEMP_LOGDUMP8(x, y) - -#define SW1_ERROR_LOGFUNC(_Fmt...) -#define SW1_WARN_LOGFUNC(_Fmt...) -#define SW1_INFO_LOGFUNC(_Fmt...) -#define SW1_STATE_LOGFUNC(_Fmt...) -#define SW1_EVENT_LOGFUNC(_Fmt...) -#define SW1_TRACE_LOGFUNC(_Fmt...) -#define SW1_LOUD_LOGFUNC(_Fmt...) -#define SW1_TEMP_LOGFUNC(_Fmt...) - -#define SW1_ERROR_LOGDUMP8(x, y) -#define SW1_WARN_LOGDUMP8(x, y) -#define SW1_INFO_LOGDUMP8(x, y) -#define SW1_STATE_LOGDUMP8(x, y) -#define SW1_EVENT_LOGDUMP8(x, y) -#define SW1_TRACE_LOGDUMP8(x, y) -#define SW1_LOUD_LOGDUMP8(x, y) -#define SW1_TEMP_LOGDUMP8(x, y) - -#define SW2_ERROR_LOGFUNC(_Fmt...) -#define SW2_WARN_LOGFUNC(_Fmt...) -#define SW2_INFO_LOGFUNC(_Fmt...) -#define SW2_STATE_LOGFUNC(_Fmt...) -#define SW2_EVENT_LOGFUNC(_Fmt...) -#define SW2_TRACE_LOGFUNC(_Fmt...) -#define SW2_LOUD_LOGFUNC(_Fmt...) -#define SW2_TEMP_LOGFUNC(_Fmt...) - -#define SW2_ERROR_LOGDUMP8(x, y) -#define SW2_WARN_LOGDUMP8(x, y) -#define SW2_INFO_LOGDUMP8(x, y) -#define SW2_STATE_LOGDUMP8(x, y) -#define SW2_EVENT_LOGDUMP8(x, y) -#define SW2_TRACE_LOGDUMP8(x, y) -#define SW2_LOUD_LOGDUMP8(x, y) -#define SW2_TEMP_LOGDUMP8(x, y) - -#define SW3_ERROR_LOGFUNC(_Fmt...) -#define SW3_WARN_LOGFUNC(_Fmt...) -#define SW3_INFO_LOGFUNC(_Fmt...) -#define SW3_STATE_LOGFUNC(_Fmt...) -#define SW3_EVENT_LOGFUNC(_Fmt...) -#define SW3_TRACE_LOGFUNC(_Fmt...) -#define SW3_LOUD_LOGFUNC(_Fmt...) -#define SW3_TEMP_LOGFUNC(_Fmt...) - -#define SW3_ERROR_LOGDUMP8(x, y) -#define SW3_WARN_LOGDUMP8(x, y) -#define SW3_INFO_LOGDUMP8(x, y) -#define SW3_STATE_LOGDUMP8(x, y) -#define SW3_EVENT_LOGDUMP8(x, y) -#define SW3_TRACE_LOGDUMP8(x, y) -#define SW3_LOUD_LOGDUMP8(x, y) -#define SW3_TEMP_LOGDUMP8(x, y) - -#define SW4_ERROR_LOGFUNC(_Fmt...) -#define SW4_WARN_LOGFUNC(_Fmt...) -#define SW4_INFO_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) -#define SW4_STATE_LOGFUNC(_Fmt...) -#define SW4_EVENT_LOGFUNC(_Fmt...) -#define SW4_TRACE_LOGFUNC(_Fmt...) -#define SW4_LOUD_LOGFUNC(_Fmt...) -#define SW4_TEMP_LOGFUNC(_Fmt...) - -#define SW4_ERROR_LOGDUMP8(x, y) -#define SW4_WARN_LOGDUMP8(x, y) -#define SW4_INFO_LOGDUMP8(x, y) -#define SW4_STATE_LOGDUMP8(x, y) -#define SW4_EVENT_LOGDUMP8(x, y) -#define SW4_TRACE_LOGDUMP8(x, y) dumpMemory8(ANDROID_LOG_DEBUG, x, y) -#define SW4_LOUD_LOGDUMP8(x, y) -#define SW4_TEMP_LOGDUMP8(x, y) -#else -#define AIS_ERROR_LOGFUNC(_Fmt...) -#define AIS_WARN_LOGFUNC(_Fmt...) -#define AIS_INFO_LOGFUNC(_Fmt...) -#define AIS_STATE_LOGFUNC(_Fmt...) -#define AIS_EVENT_LOGFUNC(_Fmt...) -#define AIS_TRACE_LOGFUNC(_Fmt...) -#define AIS_LOUD_LOGFUNC(_Fmt...) -#define AIS_TEMP_LOGFUNC(_Fmt...) - -#define INTR_ERROR_LOGFUNC(_Fmt...) -#define INTR_WARN_LOGFUNC(_Fmt...) -#define INTR_INFO_LOGFUNC(_Fmt...) -#define INTR_STATE_LOGFUNC(_Fmt...) -#define INTR_EVENT_LOGFUNC(_Fmt...) -#define INTR_TRACE_LOGFUNC(_Fmt...) -#define INTR_LOUD_LOGFUNC(_Fmt...) -#define INTR_TEMP_LOGFUNC(_Fmt...) - -#define INIT_ERROR_LOGFUNC(_Fmt...) kalPrint(_Fmt) -#define INIT_WARN_LOGFUNC(_Fmt...) kalPrint(_Fmt) -#define INIT_INFO_LOGFUNC(_Fmt...) kalPrint(_Fmt) -#define INIT_STATE_LOGFUNC(_Fmt...) kalPrint(_Fmt) -#define INIT_EVENT_LOGFUNC(_Fmt...) kalPrint(_Fmt) -#define INIT_TRACE_LOGFUNC(_Fmt...) -#define INIT_LOUD_LOGFUNC(_Fmt...) -#define INIT_TEMP_LOGFUNC(_Fmt...) - -#define AAA_ERROR_LOGFUNC(_Fmt...) kalPrint(_Fmt) -#define AAA_WARN_LOGFUNC(_Fmt...) kalPrint(_Fmt) -#define AAA_INFO_LOGFUNC(_Fmt...) kalPrint(_Fmt) -#define AAA_STATE_LOGFUNC(_Fmt...) kalPrint(_Fmt) -#define AAA_EVENT_LOGFUNC(_Fmt...) kalPrint(_Fmt) -#define AAA_TRACE_LOGFUNC(_Fmt...) //kalPrint(_Fmt) -#define AAA_LOUD_LOGFUNC(_Fmt...) -#define AAA_TEMP_LOGFUNC(_Fmt...) - -#define ROAMING_ERROR_LOGFUNC(_Fmt...) -#define ROAMING_WARN_LOGFUNC(_Fmt...) -#define ROAMING_INFO_LOGFUNC(_Fmt...) -#define ROAMING_STATE_LOGFUNC(_Fmt...) -#define ROAMING_EVENT_LOGFUNC(_Fmt...) -#define ROAMING_TRACE_LOGFUNC(_Fmt...) -#define ROAMING_LOUD_LOGFUNC(_Fmt...) -#define ROAMING_TEMP_LOGFUNC(_Fmt...) - -#define REQ_ERROR_LOGFUNC(_Fmt...) -#define REQ_WARN_LOGFUNC(_Fmt...) -#define REQ_INFO_LOGFUNC(_Fmt...) -#define REQ_STATE_LOGFUNC(_Fmt...) -#define REQ_EVENT_LOGFUNC(_Fmt...) -#define REQ_TRACE_LOGFUNC(_Fmt...) -#define REQ_LOUD_LOGFUNC(_Fmt...) -#define REQ_TEMP_LOGFUNC(_Fmt...) - -#define TX_ERROR_LOGFUNC(_Fmt...) -#define TX_WARN_LOGFUNC(_Fmt...) -#define TX_INFO_LOGFUNC(_Fmt...) -#define TX_STATE_LOGFUNC(_Fmt...) -#define TX_EVENT_LOGFUNC(_Fmt...) -#define TX_TRACE_LOGFUNC(_Fmt...) -#define TX_LOUD_LOGFUNC(_Fmt...) -#define TX_TEMP_LOGFUNC(_Fmt...) - -#define RX_ERROR_LOGFUNC(_Fmt...) -#define RX_WARN_LOGFUNC(_Fmt...) -#define RX_INFO_LOGFUNC(_Fmt...) -#define RX_STATE_LOGFUNC(_Fmt...) -#define RX_EVENT_LOGFUNC(_Fmt...) -#define RX_TRACE_LOGFUNC(_Fmt...) -#define RX_LOUD_LOGFUNC(_Fmt...) -#define RX_TEMP_LOGFUNC(_Fmt...) - -#define RFTEST_ERROR_LOGFUNC(_Fmt...) -#define RFTEST_WARN_LOGFUNC(_Fmt...) -#define RFTEST_INFO_LOGFUNC(_Fmt...) -#define RFTEST_STATE_LOGFUNC(_Fmt...) -#define RFTEST_EVENT_LOGFUNC(_Fmt...) -#define RFTEST_TRACE_LOGFUNC(_Fmt...) -#define RFTEST_LOUD_LOGFUNC(_Fmt...) -#define RFTEST_TEMP_LOGFUNC(_Fmt...) - -#define EMU_ERROR_LOGFUNC(_Fmt...) -#define EMU_WARN_LOGFUNC(_Fmt...) -#define EMU_INFO_LOGFUNC(_Fmt...) -#define EMU_STATE_LOGFUNC(_Fmt...) -#define EMU_EVENT_LOGFUNC(_Fmt...) -#define EMU_TRACE_LOGFUNC(_Fmt...) -#define EMU_LOUD_LOGFUNC(_Fmt...) -#define EMU_TEMP_LOGFUNC(_Fmt...) - -#define HEM_ERROR_LOGFUNC(_Fmt...) -#define HEM_WARN_LOGFUNC(_Fmt...) -#define HEM_INFO_LOGFUNC(_Fmt...) -#define HEM_STATE_LOGFUNC(_Fmt...) -#define HEM_EVENT_LOGFUNC(_Fmt...) -#define HEM_TRACE_LOGFUNC(_Fmt...) -#define HEM_LOUD_LOGFUNC(_Fmt...) -#define HEM_TEMP_LOGFUNC(_Fmt...) - -#define RLM_ERROR_LOGFUNC(_Fmt...) -#define RLM_WARN_LOGFUNC(_Fmt...) -#define RLM_INFO_LOGFUNC(_Fmt...) -#define RLM_STATE_LOGFUNC(_Fmt...) -#define RLM_EVENT_LOGFUNC(_Fmt...) -#define RLM_TRACE_LOGFUNC(_Fmt...) -#define RLM_LOUD_LOGFUNC(_Fmt...) -#define RLM_TEMP_LOGFUNC(_Fmt...) - -#define MEM_ERROR_LOGFUNC(_Fmt...) -#define MEM_WARN_LOGFUNC(_Fmt...) -#define MEM_INFO_LOGFUNC(_Fmt...) -#define MEM_STATE_LOGFUNC(_Fmt...) -#define MEM_EVENT_LOGFUNC(_Fmt...) -#define MEM_TRACE_LOGFUNC(_Fmt...) -#define MEM_LOUD_LOGFUNC(_Fmt...) -#define MEM_TEMP_LOGFUNC(_Fmt...) - -#define CNM_ERROR_LOGFUNC(_Fmt...) kalPrint(_Fmt) -#define CNM_WARN_LOGFUNC(_Fmt...) kalPrint(_Fmt) -#define CNM_INFO_LOGFUNC(_Fmt...) //kalPrint(_Fmt) -#define CNM_STATE_LOGFUNC(_Fmt...) -#define CNM_EVENT_LOGFUNC(_Fmt...) -#define CNM_TRACE_LOGFUNC(_Fmt...) -#define CNM_LOUD_LOGFUNC(_Fmt...) -#define CNM_TEMP_LOGFUNC(_Fmt...) - -#define RSN_ERROR_LOGFUNC(_Fmt...) -#define RSN_WARN_LOGFUNC(_Fmt...) -#define RSN_INFO_LOGFUNC(_Fmt...) -#define RSN_STATE_LOGFUNC(_Fmt...) -#define RSN_EVENT_LOGFUNC(_Fmt...) -#define RSN_TRACE_LOGFUNC(_Fmt...) -#define RSN_LOUD_LOGFUNC(_Fmt...) -#define RSN_TEMP_LOGFUNC(_Fmt...) - -#define BSS_ERROR_LOGFUNC(_Fmt...) -#define BSS_WARN_LOGFUNC(_Fmt...) -#define BSS_INFO_LOGFUNC(_Fmt...) -#define BSS_STATE_LOGFUNC(_Fmt...) -#define BSS_EVENT_LOGFUNC(_Fmt...) -#define BSS_TRACE_LOGFUNC(_Fmt...) -#define BSS_LOUD_LOGFUNC(_Fmt...) -#define BSS_TEMP_LOGFUNC(_Fmt...) - -#define SCN_ERROR_LOGFUNC(_Fmt...) -#define SCN_WARN_LOGFUNC(_Fmt...) -#define SCN_INFO_LOGFUNC(_Fmt...) -#define SCN_STATE_LOGFUNC(_Fmt...) -#define SCN_EVENT_LOGFUNC(_Fmt...) -#define SCN_TRACE_LOGFUNC(_Fmt...) -#define SCN_LOUD_LOGFUNC(_Fmt...) -#define SCN_TEMP_LOGFUNC(_Fmt...) - -#define SAA_ERROR_LOGFUNC(_Fmt...) -#define SAA_WARN_LOGFUNC(_Fmt...) -#define SAA_INFO_LOGFUNC(_Fmt...) -#define SAA_STATE_LOGFUNC(_Fmt...) -#define SAA_EVENT_LOGFUNC(_Fmt...) -#define SAA_TRACE_LOGFUNC(_Fmt...) -#define SAA_LOUD_LOGFUNC(_Fmt...) -#define SAA_TEMP_LOGFUNC(_Fmt...) - -#define P2P_ERROR_LOGFUNC(_Fmt...) -#define P2P_WARN_LOGFUNC(_Fmt...) -#define P2P_INFO_LOGFUNC(_Fmt...) -#define P2P_STATE_LOGFUNC(_Fmt...) -#define P2P_EVENT_LOGFUNC(_Fmt...) -#define P2P_TRACE_LOGFUNC(_Fmt...) -#define P2P_LOUD_LOGFUNC(_Fmt...) -#define P2P_TEMP_LOGFUNC(_Fmt...) - -#define QM_ERROR_LOGFUNC(_Fmt...) kalPrint(_Fmt) -#define QM_WARN_LOGFUNC(_Fmt...) kalPrint(_Fmt) -#define QM_INFO_LOGFUNC(_Fmt...) //kalPrint(_Fmt) -#define QM_STATE_LOGFUNC(_Fmt...) -#define QM_EVENT_LOGFUNC(_Fmt...) -#define QM_TRACE_LOGFUNC(_Fmt...) //kalPrint(_Fmt) -#define QM_LOUD_LOGFUNC(_Fmt...) -#define QM_TEMP_LOGFUNC(_Fmt...) - -#define SEC_ERROR_LOGFUNC(_Fmt...) -#define SEC_WARN_LOGFUNC(_Fmt...) -#define SEC_INFO_LOGFUNC(_Fmt...) -#define SEC_STATE_LOGFUNC(_Fmt...) -#define SEC_EVENT_LOGFUNC(_Fmt...) -#define SEC_TRACE_LOGFUNC(_Fmt...) -#define SEC_LOUD_LOGFUNC(_Fmt...) -#define SEC_TEMP_LOGFUNC(_Fmt...) - -#define BOW_ERROR_LOGFUNC(_Fmt...) -#define BOW_WARN_LOGFUNC(_Fmt...) -#define BOW_INFO_LOGFUNC(_Fmt...) -#define BOW_STATE_LOGFUNC(_Fmt...) -#define BOW_EVENT_LOGFUNC(_Fmt...) -#define BOW_TRACE_LOGFUNC(_Fmt...) -#define BOW_LOUD_LOGFUNC(_Fmt...) -#define BOW_TEMP_LOGFUNC(_Fmt...) - -#define HAL_ERROR_LOGFUNC(_Fmt...) kalPrint(_Fmt) -#define HAL_WARN_LOGFUNC(_Fmt...) -#define HAL_INFO_LOGFUNC(_Fmt...) -#define HAL_STATE_LOGFUNC(_Fmt...) -#define HAL_EVENT_LOGFUNC(_Fmt...) -#define HAL_TRACE_LOGFUNC(_Fmt...) -#define HAL_LOUD_LOGFUNC(_Fmt...) -#define HAL_TEMP_LOGFUNC(_Fmt...) - -#define WAPI_ERROR_LOGFUNC(_Fmt...) -#define WAPI_WARN_LOGFUNC(_Fmt...) -#define WAPI_INFO_LOGFUNC(_Fmt...) -#define WAPI_STATE_LOGFUNC(_Fmt...) -#define WAPI_EVENT_LOGFUNC(_Fmt...) -#define WAPI_TRACE_LOGFUNC(_Fmt...) -#define WAPI_LOUD_LOGFUNC(_Fmt...) -#define WAPI_TEMP_LOGFUNC(_Fmt...) - -#define SW1_ERROR_LOGFUNC(_Fmt...) -#define SW1_WARN_LOGFUNC(_Fmt...) -#define SW1_INFO_LOGFUNC(_Fmt...) -#define SW1_STATE_LOGFUNC(_Fmt...) -#define SW1_EVENT_LOGFUNC(_Fmt...) -#define SW1_TRACE_LOGFUNC(_Fmt...) -#define SW1_LOUD_LOGFUNC(_Fmt...) -#define SW1_TEMP_LOGFUNC(_Fmt...) - -#define SW2_ERROR_LOGFUNC(_Fmt...) -#define SW2_WARN_LOGFUNC(_Fmt...) -#define SW2_INFO_LOGFUNC(_Fmt...) -#define SW2_STATE_LOGFUNC(_Fmt...) -#define SW2_EVENT_LOGFUNC(_Fmt...) -#define SW2_TRACE_LOGFUNC(_Fmt...) -#define SW2_LOUD_LOGFUNC(_Fmt...) -#define SW2_TEMP_LOGFUNC(_Fmt...) - -#define SW3_ERROR_LOGFUNC(_Fmt...) -#define SW3_WARN_LOGFUNC(_Fmt...) -#define SW3_INFO_LOGFUNC(_Fmt...) -#define SW3_STATE_LOGFUNC(_Fmt...) -#define SW3_EVENT_LOGFUNC(_Fmt...) -#define SW3_TRACE_LOGFUNC(_Fmt...) -#define SW3_LOUD_LOGFUNC(_Fmt...) -#define SW3_TEMP_LOGFUNC(_Fmt...) - -#define SW4_ERROR_LOGFUNC(_Fmt...) -#define SW4_WARN_LOGFUNC(_Fmt...) -#define SW4_INFO_LOGFUNC(_Fmt...) -#define SW4_STATE_LOGFUNC(_Fmt...) -#define SW4_EVENT_LOGFUNC(_Fmt...) -#define SW4_TRACE_LOGFUNC(_Fmt...) -#define SW4_LOUD_LOGFUNC(_Fmt...) -#define SW4_TEMP_LOGFUNC(_Fmt...) -#endif -#endif - -#define kalBreakPoint() \ - do { \ - BUG(); \ - panic("Oops"); \ - } while(0) - -#if CFG_ENABLE_AEE_MSG -#define kalSendAeeException aee_kernel_exception -#define kalSendAeeWarning aee_kernel_warning -#define kalSendAeeReminding aee_kernel_reminding -#else -#define kalSendAeeException(_module, _desc, ...) -#define kalSendAeeWarning(_module, _desc, ...) -#define kalSendAeeReminding(_module, _desc, ...) -#endif - -#define PRINTF_ARG(...) __VA_ARGS__ -#define SPRINTF(buf, arg) {buf += sprintf((char *)(buf), PRINTF_ARG arg);} - -#define USEC_TO_SYSTIME(_usec) ((_usec) / USEC_PER_MSEC) -#define MSEC_TO_SYSTIME(_msec) (_msec) - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/* Routines in gl_kal.c */ -/*----------------------------------------------------------------------------*/ -VOID -kalAcquireSpinLock( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_SPIN_LOCK_CATEGORY_E rLockCategory, - OUT PUINT_32 pu4Flags - ); - -VOID -kalReleaseSpinLock( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_SPIN_LOCK_CATEGORY_E rLockCategory, - IN UINT_32 u4Flags - ); - -VOID -kalUpdateMACAddress( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucMacAddr - ); - -VOID -kalPacketFree( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID pvPacket - ); - -PVOID -kalPacketAlloc( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4Size, - OUT PUINT_8 *ppucData - ); - -VOID -kalOsTimerInitialize( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID prTimerHandler - ); - -BOOL -kalSetTimer( - IN P_GLUE_INFO_T prGlueInfo, - IN OS_SYSTIME rInterval - ); - -WLAN_STATUS -kalProcessRxPacket( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID pvPacket, - IN PUINT_8 pucPacketStart, - IN UINT_32 u4PacketLen, - //IN PBOOLEAN pfgIsRetain, - IN BOOLEAN fgIsRetain, - IN ENUM_CSUM_RESULT_T aeCSUM[] - ); - -WLAN_STATUS -kalRxIndicatePkts( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID apvPkts[], - IN UINT_8 ucPktNum - ); - -VOID -kalIndicateStatusAndComplete( - IN P_GLUE_INFO_T prGlueInfo, - IN WLAN_STATUS eStatus, - IN PVOID pvBuf, - IN UINT_32 u4BufLen - ); - -VOID -kalUpdateReAssocReqInfo( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucFrameBody, - IN UINT_32 u4FrameBodyLen, - IN BOOLEAN fgReassocRequest - ); - -VOID -kalUpdateReAssocRspInfo ( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucFrameBody, - IN UINT_32 u4FrameBodyLen - ); - -#if CFG_TX_FRAGMENT -BOOLEAN -kalQueryTxPacketHeader( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID pvPacket, - OUT PUINT_16 pu2EtherTypeLen, - OUT PUINT_8 pucEthDestAddr - ); -#endif /* CFG_TX_FRAGMENT */ - -VOID -kalSendCompleteAndAwakeQueue( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID pvPacket - ); - -#if CFG_TCP_IP_CHKSUM_OFFLOAD -VOID -kalQueryTxChksumOffloadParam( - IN PVOID pvPacket, - OUT PUINT_8 pucFlag); - -VOID -kalUpdateRxCSUMOffloadParam( - IN PVOID pvPacket, - IN ENUM_CSUM_RESULT_T eCSUM[] - ); -#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */ - - -BOOLEAN -kalRetrieveNetworkAddress( - IN P_GLUE_INFO_T prGlueInfo, - IN OUT PARAM_MAC_ADDRESS * prMacAddr - ); - - -/*----------------------------------------------------------------------------*/ -/* Routines in interface - ehpi/sdio.c */ -/*----------------------------------------------------------------------------*/ -BOOL -kalDevRegRead( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4Register, - OUT PUINT_32 pu4Value - ); - -BOOL -kalDevRegWrite( - P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4Register, - IN UINT_32 u4Value - ); - -BOOL -kalDevPortRead( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_16 u2Port, - IN UINT_16 u2Len, - OUT PUINT_8 pucBuf, - IN UINT_16 u2ValidOutBufSize - ); - -BOOL -kalDevPortWrite( - P_GLUE_INFO_T prGlueInfo, - IN UINT_16 u2Port, - IN UINT_16 u2Len, - IN PUINT_8 pucBuf, - IN UINT_16 u2ValidInBufSize - ); - -BOOL -kalDevWriteWithSdioCmd52 ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4Addr, - IN UINT_8 ucData - ); - - - #if CFG_SUPPORT_EXT_CONFIG -UINT_32 -kalReadExtCfg ( - IN P_GLUE_INFO_T prGlueInfo - ); - #endif - -BOOL -kalQoSFrameClassifierAndPacketInfo ( - IN P_GLUE_INFO_T prGlueInfo, - IN P_NATIVE_PACKET prPacket, - OUT PUINT_8 pucPriorityParam, - OUT PUINT_32 pu4PacketLen, - OUT PUINT_8 pucEthDestAddr, - OUT PBOOLEAN pfgIs1X, - OUT PBOOLEAN pfgIsPAL, - OUT PUINT_8 pucNetworkType -); - -inline VOID -kalOidComplete ( - IN P_GLUE_INFO_T prGlueInfo, - IN BOOLEAN fgSetQuery, - IN UINT_32 u4SetQueryInfoLen, - IN WLAN_STATUS rOidStatus - ); - - -WLAN_STATUS -kalIoctl (IN P_GLUE_INFO_T prGlueInfo, - IN PFN_OID_HANDLER_FUNC pfnOidHandler, - IN PVOID pvInfoBuf, - IN UINT_32 u4InfoBufLen, - IN BOOL fgRead, - IN BOOL fgWaitResp, - IN BOOL fgCmd, - IN BOOL fgIsP2pOid, - OUT PUINT_32 pu4QryInfoLen - ); - -VOID -kalHandleAssocInfo( - IN P_GLUE_INFO_T prGlueInfo, - IN P_EVENT_ASSOC_INFO prAssocInfo - ); - -#if CFG_ENABLE_FW_DOWNLOAD - -PVOID -kalFirmwareImageMapping ( - IN P_GLUE_INFO_T prGlueInfo, - OUT PPVOID ppvMapFileBuf, - OUT PUINT_32 pu4FileLength - ); - -VOID -kalFirmwareImageUnmapping ( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID prFwHandle, - IN PVOID pvMapFileBuf - ); -#endif - - -/*----------------------------------------------------------------------------*/ -/* Card Removal Check */ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalIsCardRemoved( - IN P_GLUE_INFO_T prGlueInfo - ); - - -/*----------------------------------------------------------------------------*/ -/* TX */ -/*----------------------------------------------------------------------------*/ -VOID -kalFlushPendingTxPackets( - IN P_GLUE_INFO_T prGlueInfo - ); - - -/*----------------------------------------------------------------------------*/ -/* Media State Indication */ -/*----------------------------------------------------------------------------*/ -ENUM_PARAM_MEDIA_STATE_T -kalGetMediaStateIndicated( - IN P_GLUE_INFO_T prGlueInfo - ); - - -VOID -kalSetMediaStateIndicated( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_PARAM_MEDIA_STATE_T eParamMediaStateIndicate - ); - - -/*----------------------------------------------------------------------------*/ -/* OID handling */ -/*----------------------------------------------------------------------------*/ -VOID -kalOidCmdClearance( - IN P_GLUE_INFO_T prGlueInfo - ); - -VOID -kalOidClearance( - IN P_GLUE_INFO_T prGlueInfo - ); - -VOID -kalEnqueueCommand( - IN P_GLUE_INFO_T prGlueInfo, - IN P_QUE_ENTRY_T prQueueEntry - ); - -#if CFG_ENABLE_BT_OVER_WIFI -/*----------------------------------------------------------------------------*/ -/* Bluetooth over Wi-Fi handling */ -/*----------------------------------------------------------------------------*/ -VOID -kalIndicateBOWEvent( - IN P_GLUE_INFO_T prGlueInfo, - IN P_AMPC_EVENT prEvent - ); - -ENUM_BOW_DEVICE_STATE -kalGetBowState ( - IN P_GLUE_INFO_T prGlueInfo, - IN PARAM_MAC_ADDRESS rPeerAddr - ); - -BOOLEAN -kalSetBowState ( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_BOW_DEVICE_STATE eBowState, - PARAM_MAC_ADDRESS rPeerAddr - ); - -ENUM_BOW_DEVICE_STATE -kalGetBowGlobalState ( - IN P_GLUE_INFO_T prGlueInfo - ); - -UINT_32 -kalGetBowFreqInKHz( - IN P_GLUE_INFO_T prGlueInfo - ); - -UINT_8 -kalGetBowRole( - IN P_GLUE_INFO_T prGlueInfo, - IN PARAM_MAC_ADDRESS rPeerAddr - ); - -VOID -kalSetBowRole( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_8 ucRole, - IN PARAM_MAC_ADDRESS rPeerAddr - ); - -UINT_8 -kalGetBowAvailablePhysicalLinkCount( - IN P_GLUE_INFO_T prGlueInfo - ); - -#if CFG_BOW_SEPARATE_DATA_PATH -/*----------------------------------------------------------------------------*/ -/* Bluetooth over Wi-Fi Net Device Init/Uninit */ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalInitBowDevice( - IN P_GLUE_INFO_T prGlueInfo, - IN const char *prDevName - ); - -BOOLEAN -kalUninitBowDevice( - IN P_GLUE_INFO_T prGlueInfo - ); -#endif // CFG_BOW_SEPARATE_DATA_PATH -#endif // CFG_ENABLE_BT_OVER_WIFI - - -/*----------------------------------------------------------------------------*/ -/* Firmware Download Handling */ -/*----------------------------------------------------------------------------*/ -UINT_32 -kalGetFwStartAddress( - IN P_GLUE_INFO_T prGlueInfo - ); - -UINT_32 -kalGetFwLoadAddress( - IN P_GLUE_INFO_T prGlueInfo - ); - -/*----------------------------------------------------------------------------*/ -/* Security Frame Clearance */ -/*----------------------------------------------------------------------------*/ -VOID -kalClearSecurityFrames( - IN P_GLUE_INFO_T prGlueInfo - ); - -VOID -kalClearSecurityFramesByNetType( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ); - -VOID -kalSecurityFrameSendComplete ( - IN P_GLUE_INFO_T prGlueInfo, - IN PVOID pvPacket, - IN WLAN_STATUS rStatus - ); - - -/*----------------------------------------------------------------------------*/ -/* Management Frame Clearance */ -/*----------------------------------------------------------------------------*/ -VOID -kalClearMgmtFrames( - IN P_GLUE_INFO_T prGlueInfo - ); - -VOID -kalClearMgmtFramesByNetType( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx - ); - -UINT_32 -kalGetTxPendingFrameCount( - IN P_GLUE_INFO_T prGlueInfo - ); - -UINT_32 -kalGetTxPendingCmdCount( - IN P_GLUE_INFO_T prGlueInfo - ); - -BOOLEAN -kalSetTimer( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4Interval - ); - -BOOLEAN -kalCancelTimer( - IN P_GLUE_INFO_T prGlueInfo - ); - -VOID -kalScanDone( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_KAL_NETWORK_TYPE_INDEX_T eNetTypeIdx, - IN WLAN_STATUS status - ); - -UINT_32 -kalRandomNumber( - VOID - ); - -VOID -kalTimeoutHandler (unsigned long arg); - -VOID -kalSetEvent (P_GLUE_INFO_T pr); - - -/*----------------------------------------------------------------------------*/ -/* NVRAM/Registry Service */ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalIsConfigurationExist( - IN P_GLUE_INFO_T prGlueInfo - ); - -P_REG_INFO_T -kalGetConfiguration( - IN P_GLUE_INFO_T prGlueInfo - ); - -VOID -kalGetConfigurationVersion( - IN P_GLUE_INFO_T prGlueInfo, - OUT PUINT_16 pu2Part1CfgOwnVersion, - OUT PUINT_16 pu2Part1CfgPeerVersion, - OUT PUINT_16 pu2Part2CfgOwnVersion, - OUT PUINT_16 pu2Part2CfgPeerVersion - ); - -BOOLEAN -kalCfgDataRead16( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4Offset, - OUT PUINT_16 pu2Data - ); - -BOOLEAN -kalCfgDataWrite16( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4Offset, - IN UINT_16 u2Data - ); - -/*----------------------------------------------------------------------------*/ -/* WSC Connection */ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalWSCGetActiveState( - IN P_GLUE_INFO_T prGlueInfo - ); - -/*----------------------------------------------------------------------------*/ -/* RSSI Updating */ -/*----------------------------------------------------------------------------*/ -VOID -kalUpdateRSSI( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_KAL_NETWORK_TYPE_INDEX_T eNetTypeIdx, - IN INT_8 cRssi, - IN INT_8 cLinkQuality - ); - - -/*----------------------------------------------------------------------------*/ -/* I/O Buffer Pre-allocation */ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalInitIOBuffer( - VOID - ); - -VOID -kalUninitIOBuffer( - VOID - ); - -PVOID -kalAllocateIOBuffer( - IN UINT_32 u4AllocSize - ); - -VOID -kalReleaseIOBuffer( - IN PVOID pvAddr, - IN UINT_32 u4Size - ); - -VOID -kalGetChannelList( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_BAND_T eSpecificBand, - IN UINT_8 ucMaxChannelNum, - IN PUINT_8 pucNumOfChannel, - IN P_RF_CHANNEL_INFO_T paucChannelList - ); - -BOOL -kalIsAPmode( - IN P_GLUE_INFO_T prGlueInfo - ); - -#if CFG_SUPPORT_802_11W -/*----------------------------------------------------------------------------*/ -/* 802.11W */ -/*----------------------------------------------------------------------------*/ -UINT_32 -kalGetMfpSetting( - IN P_GLUE_INFO_T prGlueInfo - ); -#endif - -UINT_32 -kalWriteToFile( - const PUINT_8 pucPath, - BOOLEAN fgDoAppend, - PUINT_8 pucData, - UINT_32 u4Size - ); - - -/*----------------------------------------------------------------------------*/ -/* NL80211 */ -/*----------------------------------------------------------------------------*/ -VOID -kalIndicateBssInfo ( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucFrameBuf, - IN UINT_32 u4BufLen, - IN UINT_8 ucChannelNum, - IN INT_32 i4SignalStrength - ); - - - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -int tx_thread(void *data); - -#endif /* _GL_KAL_H */ - diff --git a/drivers/net/wireless/mt5931/os/linux/include/gl_os.h b/drivers/net/wireless/mt5931/os/linux/include/gl_os.h deleted file mode 100755 index 99559dfcce79..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/include/gl_os.h +++ /dev/null @@ -1,1139 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/include/gl_os.h#2 $ -*/ - -/*! \file gl_os.h - \brief List the external reference to OS for GLUE Layer. - - In this file we define the data structure - GLUE_INFO_T to store those objects - we acquired from OS - e.g. TIMER, SPINLOCK, NET DEVICE ... . And all the - external reference (header file, extern func() ..) to OS for GLUE Layer should - also list down here. -*/ - - - -/* -** $Log: gl_os.h $ -** -** 08 20 2012 yuche.tsai -** NULL -** Fix possible KE issue. -** -** 08 20 2012 yuche.tsai -** [ALPS00339327] [Rose][6575JB][BSP Package][Free Test][KE][WIFI]There is no response when you tap the turn off/on button,wait a minutes, the device will reboot automatically and "KE" will pop up. -** Fix possible KE when netlink operate mgmt frame register. - * - * 04 12 2012 terry.wu - * NULL - * Add AEE message support - * 1) Show AEE warning(red screen) if SDIO access error occurs - - * - * 03 02 2012 terry.wu - * NULL - * Enable CFG80211 Support. - * - * 01 05 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * Adding the related ioctl / wlan oid function to set the Tx power cfg. - * - * 12 13 2011 cm.chang - * [WCXRP00001136] [All Wi-Fi][Driver] Add wake lock for pending timer - * Add wake lock if timer timeout value is smaller than 5 seconds - * - * 11 18 2011 yuche.tsai - * NULL - * CONFIG P2P support RSSI query, default turned off. - * - * 11 16 2011 yuche.tsai - * NULL - * Avoid using work thread. - * - * 11 11 2011 yuche.tsai - * NULL - * Fix work thread cancel issue. - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 09 29 2011 terry.wu - * NULL - * Show DRV_NAME by chip id. - * - * 04 18 2011 terry.wu - * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED - * Remove flag CFG_WIFI_DIRECT_MOVED. - * - * 03 29 2011 cp.wu - * [WCXRP00000598] [MT6620 Wi-Fi][Driver] Implementation of interface for communicating with user space process for RESET_START and RESET_END events - * implement kernel-to-userspace communication via generic netlink socket for whole-chip resetting mechanism - * - * 03 21 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * portability improvement - * - * 03 17 2011 chinglan.wang - * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature - * . - * - * 03 03 2011 jeffrey.chang - * [WCXRP00000512] [MT6620 Wi-Fi][Driver] modify the net device relative functions to support the H/W multiple queue - * support concurrent network - * - * 03 03 2011 jeffrey.chang - * [WCXRP00000512] [MT6620 Wi-Fi][Driver] modify the net device relative functions to support the H/W multiple queue - * modify net device relative functions to support multiple H/W queues - * - * 03 02 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * Add security check code. - * - * 02 21 2011 cp.wu - * [WCXRP00000482] [MT6620 Wi-Fi][Driver] Simplify logic for checking NVRAM existence in driver domain - * simplify logic for checking NVRAM existence only once. - * - * 02 16 2011 jeffrey.chang - * NULL - * Add query ipv4 and ipv6 address during early suspend and late resume - * - * 02 10 2011 chinghwa.yu - * [WCXRP00000065] Update BoW design and settings - * Fix kernel API change issue. - * Before ALPS 2.2 (2.2 included), kfifo_alloc() is - * struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, spinlock_t *lock); - * After ALPS 2.3, kfifo_alloc() is changed to - * int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask); - * - * 02 09 2011 wh.su - * [WCXRP00000433] [MT6620 Wi-Fi][Driver] Remove WAPI structure define for avoid P2P module with structure miss-align pointer issue - * always pre-allio WAPI related structure for align p2p module. - * - * 02 09 2011 terry.wu - * [WCXRP00000383] [MT6620 Wi-Fi][Driver] Separate WiFi and P2P driver into two modules - * Halt p2p module init and exit until TxThread finished p2p register and unregister. - * - * 02 01 2011 cm.chang - * [WCXRP00000415] [MT6620 Wi-Fi][Driver] Check if any memory leakage happens when uninitializing in DGB mode - * . - * - * 01 27 2011 cm.chang - * [WCXRP00000402] [MT6620 Wi-Fi][Driver] Enable MCR read/write by iwpriv by default - * . - * - * 01 12 2011 cp.wu - * [WCXRP00000357] [MT6620 Wi-Fi][Driver][Bluetooth over Wi-Fi] add another net device interface for BT AMP - * implementation of separate BT_OVER_WIFI data path. - * - * 01 12 2011 cp.wu - * [WCXRP00000356] [MT6620 Wi-Fi][Driver] fill mac header length for security frames 'cause hardware header translation needs such information - * fill mac header length information for 802.1x frames. - * - * 01 11 2011 chinglan.wang - * NULL - * Modify to reslove the CR :[ALPS00028994] Use WEP security to connect Marvell 11N AP. Connection establish successfully. - * Use the WPS function to connect AP, the privacy bit always is set to 1. - * - * 01 10 2011 cp.wu - * [WCXRP00000349] [MT6620 Wi-Fi][Driver] make kalIoctl() of linux port as a thread safe API to avoid potential issues due to multiple access - * use mutex to protect kalIoctl() for thread safe. - * - * 01 05 2011 cp.wu - * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery - * ioctl implementations for P2P Service Discovery - * - * 11 04 2010 wh.su - * [WCXRP00000164] [MT6620 Wi-Fi][Driver] Support the p2p random SSID - * adding the p2p random ssid support. - * - * 10 18 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android - * complete implementation of Android NVRAM access - * - * 09 28 2010 wh.su - * NULL - * [WCXRP00000069][MT6620 Wi-Fi][Driver] Fix some code for phase 1 P2P Demo. - * - * 09 23 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * add skeleton for NVRAM integration - * - * 09 13 2010 cp.wu - * NULL - * add waitq for poll() and read(). - * - * 09 07 2010 wh.su - * NULL - * adding the code for beacon/probe req/ probe rsp wsc ie at p2p. - * - * 09 06 2010 wh.su - * NULL - * let the p2p can set the privacy bit at beacon and rsn ie at assoc req at key handshake state. - * - * 09 03 2010 kevin.huang - * NULL - * Refine #include sequence and solve recursive/nested #include issue - * - * 09 01 2010 wh.su - * NULL - * adding the wapi support for integration test. - * - * 08 31 2010 kevin.huang - * NULL - * Use LINK LIST operation to process SCAN result - * - * 08 23 2010 cp.wu - * NULL - * revise constant definitions to be matched with implementation (original cmd-event definition is deprecated) - * - * 08 16 2010 cp.wu - * NULL - * P2P packets are now marked when being queued into driver, and identified later without checking MAC address - * - * 08 16 2010 cp.wu - * NULL - * revised implementation of Wi-Fi Direct io controls. - * - * 08 11 2010 cp.wu - * NULL - * 1) do not use in-stack variable for beacon updating. (for MAUI porting) - * 2) extending scanning result to 64 instead of 48 - * - * 08 06 2010 cp.wu - * NULL - * driver hook modifications corresponding to ioctl interface change. - * - * 08 03 2010 cp.wu - * NULL - * [Wi-Fi Direct] add framework for driver hooks - * - * 08 02 2010 jeffrey.chang - * NULL - * 1) modify tx service thread to avoid busy looping - * 2) add spin lock declartion for linux build - * - * 07 23 2010 jeffrey.chang - * - * add new KAL api - * - * 07 22 2010 jeffrey.chang - * - * modify tx thread and remove some spinlock - * - * 07 19 2010 jeffrey.chang - * - * add security frame pending count - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 06 01 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add ioctl to configure scan mode for p2p connection - * - * 05 31 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add cfg80211 interface, which is to replace WE, for further extension - * - * 05 14 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add ioctl framework for Wi-Fi Direct by reusing wireless extension ioctls as well - * - * 05 11 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * p2p ioctls revised. - * - * 05 11 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add ioctl for controlling p2p scan phase parameters - * - * 05 10 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * implement basic wi-fi direct framework - * - * 05 07 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * prevent supplicant accessing driver during resume - * - * 05 07 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add basic framework for implementating P2P driver hook. - * - * 05 05 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * change variable names for multiple physical link to match with coding convention - * - * 04 27 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * identify BT Over Wi-Fi Security frame and mark it as 802.1X frame - * - * 04 27 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add multiple physical link support - * - * 04 27 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * 1) fix firmware download bug - * 2) remove query statistics for acelerating firmware download - * - * 04 27 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * follow Linux's firmware framework, and remove unused kal API - * - * 04 23 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * surpress compiler warning - * - * 04 19 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * supporting power management - * - * 04 14 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * pvInformationBuffer and u4InformationBufferLength are no longer in glue - * - * 04 13 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add framework for BT-over-Wi-Fi support. - * * * * * * * * * * * * * * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability - * * * * * * * * * * * * * * * * * * * * 2) command sequence number is now increased atomically - * * * * * * * * * * * * * * * * * * * * 3) private data could be hold and taken use for other purpose - * - * 04 07 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * rWlanInfo should be placed at adapter rather than glue due to most operations - * * * * * * * * * * are done in adapter layer. - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * Tag the packet for QoS on Tx path - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * (1)deliver the kalOidComplete status to upper layer - * * (2) fix spin lock - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * add timeout check in the kalOidComplete - * - * 04 06 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * improve none-glue code portability - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * code refine: fgTestMode should be at adapter rather than glue due to the device/fw is also involved - * - * 04 06 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * eliminate direct access for prGlueInfo->fgIsCardRemoved in non-glue layer - * - * 03 30 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * emulate NDIS Pending OID facility - * - * 03 26 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * [WPD00003826] Initial import for Linux port - * adding firmware download related data type - * - * 03 25 2010 cp.wu - * [WPD00001943]Create WiFi test driver framework on WinXP - * 1) correct OID_802_11_CONFIGURATION with frequency setting behavior. - * * * * the frequency is used for adhoc connection only - * * * * 2) update with SD1 v0.9 CMD/EVENT documentation - * - * 03 25 2010 cp.wu - * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support - * add Bluetooth-over-Wifi frame header check - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port -** \main\maintrunk.MT5921\30 2009-10-20 17:38:31 GMT mtk01090 -** Refine driver unloading and clean up procedure. Block requests, stop main thread and clean up queued requests, and then stop hw. -** \main\maintrunk.MT5921\29 2009-10-08 10:33:33 GMT mtk01090 -** Avoid accessing private data of net_device directly. Replace with netdev_priv(). Add more checking for input parameters and pointers. -** \main\maintrunk.MT5921\28 2009-09-28 20:19:26 GMT mtk01090 -** Add private ioctl to carry OID structures. Restructure public/private ioctl interfaces to Linux kernel. -** \main\maintrunk.MT5921\27 2009-08-18 22:57:12 GMT mtk01090 -** Add Linux SDIO (with mmc core) support. -** Add Linux 2.6.21, 2.6.25, 2.6.26. -** Fix compile warning in Linux. -** \main\maintrunk.MT5921\26 2009-07-06 21:42:25 GMT mtk01088 -** fixed the compiling error at linux -** \main\maintrunk.MT5921\25 2009-07-06 20:51:46 GMT mtk01088 -** adding the wapi 1x ether type define -** \main\maintrunk.MT5921\24 2009-06-23 23:19:18 GMT mtk01090 -** Add build option BUILD_USE_EEPROM and compile option CFG_SUPPORT_EXT_CONFIG for NVRAM support -** \main\maintrunk.MT5921\23 2009-02-07 15:05:06 GMT mtk01088 -** add the privacy flag to ingo driver the supplicant selected ap's security -** \main\maintrunk.MT5921\22 2009-02-05 15:34:09 GMT mtk01088 -** fixed the compiling error for using bits marco for only one parameter -** \main\maintrunk.MT5921\21 2009-01-22 13:02:13 GMT mtk01088 -** data frame is or not 802.1x value share with tid, using the same reserved byte, provide the function to set and get -** \main\maintrunk.MT5921\20 2008-10-24 12:04:16 GMT mtk01088 -** move the config.h from precomp.h to here for lint check -** \main\maintrunk.MT5921\19 2008-09-22 23:19:02 GMT mtk01461 -** Update driver for code review -** \main\maintrunk.MT5921\18 2008-09-05 17:25:13 GMT mtk01461 -** Update Driver for Code Review -** \main\maintrunk.MT5921\17 2008-08-01 13:32:47 GMT mtk01084 -** Prevent redundent driver assertion in driver logic when BUS is detached -** \main\maintrunk.MT5921\16 2008-05-30 14:41:43 GMT mtk01461 -** Remove WMM Assoc Flag in KAL -** \main\maintrunk.MT5921\15 2008-05-29 14:16:25 GMT mtk01084 -** remoev un-used variable -** \main\maintrunk.MT5921\14 2008-05-03 15:17:14 GMT mtk01461 -** Add Media Status variable in Glue Layer -** \main\maintrunk.MT5921\13 2008-04-24 11:58:41 GMT mtk01461 -** change threshold to 256 -** \main\maintrunk.MT5921\12 2008-03-11 14:51:05 GMT mtk01461 -** Remove redundant GL_CONN_INFO_T -** \main\maintrunk.MT5921\11 2008-01-07 15:07:41 GMT mtk01461 -** Adjust the netif stop threshold to 150 -** \main\maintrunk.MT5921\10 2007-11-26 19:43:46 GMT mtk01461 -** Add OS_TIMESTAMP macro -** -** \main\maintrunk.MT5921\9 2007-11-07 18:38:38 GMT mtk01461 -** Move definition -** \main\maintrunk.MT5921\8 2007-11-02 01:04:00 GMT mtk01461 -** Unify TX Path for Normal and IBSS Power Save + IBSS neighbor learning -** Revision 1.5 2007/07/12 11:04:28 MTK01084 -** update macro to delay for ms order -** -** Revision 1.4 2007/07/05 07:25:34 MTK01461 -** Add Linux initial code, modify doc, add 11BB, RF init code -** -** Revision 1.3 2007/06/27 02:18:51 MTK01461 -** Update SCAN_FSM, Initial(Can Load Module), Proc(Can do Reg R/W), TX API -** -** Revision 1.2 2007/06/25 06:16:24 MTK01461 -** Update illustrations, gl_init.c, gl_kal.c, gl_kal.h, gl_os.h and RX API -** -*/ - -#ifndef _GL_OS_H -#define _GL_OS_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ -/*------------------------------------------------------------------------------ - * Flags for LINUX(OS) dependent - *------------------------------------------------------------------------------ - */ -#define CFG_MAX_WLAN_DEVICES 1 /* number of wlan card will coexist*/ - -#define CFG_MAX_TXQ_NUM 4 /* number of tx queue for support multi-queue h/w */ - - -#define CFG_USE_SPIN_LOCK_BOTTOM_HALF 0 /* 1: Enable use of SPIN LOCK Bottom Half for LINUX - 0: Disable - use SPIN LOCK IRQ SAVE instead */ - -#define CFG_TX_PADDING_SMALL_ETH_PACKET 0 /* 1: Enable - Drop ethernet packet if it < 14 bytes. - And pad ethernet packet with dummy 0 if it < 60 bytes. - 0: Disable */ - -#define CFG_TX_STOP_NETIF_QUEUE_THRESHOLD 256 /* packets */ - -#define CFG_TX_STOP_NETIF_PER_QUEUE_THRESHOLD 64 /* packets */ -#define CFG_TX_START_NETIF_PER_QUEUE_THRESHOLD 32 /* packets */ - - -#define ETH_P_1X 0x888E -#define IPTOS_PREC_OFFSET 5 -#define USER_PRIORITY_DEFAULT 0 - -#define ETH_WPI_1X 0x88B4 - -#define ETH_HLEN 14 -#define ETH_TYPE_LEN_OFFSET 12 -#define ETH_P_IP 0x0800 -#define ETH_P_1X 0x888E -#define ETH_P_PRE_1X 0x88C7 - -#define IPVERSION 4 -#define IP_HEADER_LEN 20 - -#define IPVH_VERSION_OFFSET 4 // For Little-Endian -#define IPVH_VERSION_MASK 0xF0 -#define IPTOS_PREC_OFFSET 5 -#define IPTOS_PREC_MASK 0xE0 - -#define SOURCE_PORT_LEN 2 -/* NOTE(Kevin): Without IP Option Length */ -#define LOOK_AHEAD_LEN (ETH_HLEN + IP_HEADER_LEN + SOURCE_PORT_LEN) - -/* 802.2 LLC/SNAP */ -#define ETH_LLC_OFFSET (ETH_HLEN) -#define ETH_LLC_LEN 3 -#define ETH_LLC_DSAP_SNAP 0xAA -#define ETH_LLC_SSAP_SNAP 0xAA -#define ETH_LLC_CONTROL_UNNUMBERED_INFORMATION 0x03 - -/* Bluetooth SNAP */ -#define ETH_SNAP_OFFSET (ETH_HLEN + ETH_LLC_LEN) -#define ETH_SNAP_LEN 5 -#define ETH_SNAP_BT_SIG_OUI_0 0x00 -#define ETH_SNAP_BT_SIG_OUI_1 0x19 -#define ETH_SNAP_BT_SIG_OUI_2 0x58 - -#define BOW_PROTOCOL_ID_SECURITY_FRAME 0x0003 - - -#if defined(MT6620) - #define CHIP_NAME "MT6620" -#elif defined(MT5931) - #define CHIP_NAME "MT5931" -#elif defined(MT6628) - #define CHIP_NAME "MT6628" -#endif - -#define DRV_NAME "["CHIP_NAME"]: " - -/* Define if target platform is Android. - * It should already be defined in Android kernel source - */ -#ifndef CONFIG_ANDROID -#define CONFIG_ANDROID 0 -#endif - -/* for CFG80211 IE buffering mechanism */ -#define CFG_CFG80211_IE_BUF_LEN (512) - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include /* constant of kernel version */ - -#include /* bitops.h */ - -#include /* struct timer_list */ -#include /* jiffies */ -#include /* udelay and mdelay macro */ - -#if CONFIG_ANDROID -#include -#endif - -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 12) -#include /* IRQT_FALLING */ -#include /*for in_interrupt*/ -#endif - -#include /* struct net_device, struct net_device_stats */ -#include /* for eth_type_trans() function */ -#include /* struct iw_statistics */ -#include -#include /* struct in_device */ - -#include /* struct iphdr */ - -#include /* for memcpy()/memset() function */ -#include /* for offsetof() macro */ - -#include /* The proc filesystem constants/structures */ - -#include /* for rtnl_lock() and rtnl_unlock() */ -#include /* kthread_should_stop(), kthread_run() */ -#include /* for copy_from_user() */ -#include /* for firmware download */ -#include - -#include /* for kfifo interface */ -#include /* for cdev interface */ - -#include /* for firmware download */ - -#if defined(_HIF_SDIO) -#include -#include -#endif - -#include - - -#include /* readw and writew */ - -#if WIRELESS_EXT > 12 -#include -#endif - -#include "version.h" -#include "config.h" - -#if CFG_ENABLE_WIFI_DIRECT_CFG_80211 -#include -#include -#endif - -#include - -#include "gl_typedef.h" -#include "typedef.h" -#include "queue.h" -#include "gl_kal.h" -#if CFG_CHIP_RESET_SUPPORT - #include "gl_rst.h" -#endif -#include "hif.h" - - -#include "debug.h" - -#include "wlan_lib.h" -#include "wlan_oid.h" - -#if CFG_ENABLE_AEE_MSG -#include -#endif - -extern BOOLEAN fgIsBusAccessFailed; - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define GLUE_FLAG_HALT BIT(0) -#define GLUE_FLAG_INT BIT(1) -#define GLUE_FLAG_OID BIT(2) -#define GLUE_FLAG_TIMEOUT BIT(3) -#define GLUE_FLAG_TXREQ BIT(4) -#define GLUE_FLAG_SUB_MOD_INIT BIT(5) -#define GLUE_FLAG_SUB_MOD_EXIT BIT(6) -#define GLUE_FLAG_SUB_MOD_MULTICAST BIT(7) -#define GLUE_FLAG_FRAME_FILTER BIT(8) -#define GLUE_FLAG_HALT_BIT (0) -#define GLUE_FLAG_INT_BIT (1) -#define GLUE_FLAG_OID_BIT (2) -#define GLUE_FLAG_TIMEOUT_BIT (3) -#define GLUE_FLAG_TXREQ_BIT (4) -#define GLUE_FLAG_SUB_MOD_INIT_BIT (5) -#define GLUE_FLAG_SUB_MOD_EXIT_BIT (6) -#define GLUE_FLAG_SUB_MOD_MULTICAST_BIT (7) -#define GLUE_FLAG_FRAME_FILTER_BIT (8) - - - -#define GLUE_BOW_KFIFO_DEPTH (1024) -//#define GLUE_BOW_DEVICE_NAME "MT6620 802.11 AMP" -#define GLUE_BOW_DEVICE_NAME "ampc0" - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef struct _GL_WPA_INFO_T { - UINT_32 u4WpaVersion; - UINT_32 u4KeyMgmt; - UINT_32 u4CipherGroup; - UINT_32 u4CipherPairwise; - UINT_32 u4AuthAlg; - BOOLEAN fgPrivacyInvoke; -#if CFG_SUPPORT_802_11W - UINT_32 u4Mfp; -#endif -} GL_WPA_INFO_T, *P_GL_WPA_INFO_T; - -typedef enum _ENUM_RSSI_TRIGGER_TYPE { - ENUM_RSSI_TRIGGER_NONE, - ENUM_RSSI_TRIGGER_GREATER, - ENUM_RSSI_TRIGGER_LESS, - ENUM_RSSI_TRIGGER_TRIGGERED, - ENUM_RSSI_TRIGGER_NUM -} ENUM_RSSI_TRIGGER_TYPE; - -#if CFG_ENABLE_WIFI_DIRECT -typedef enum _ENUM_SUB_MODULE_IDX_T { - P2P_MODULE = 0, - SUB_MODULE_NUM -} ENUM_SUB_MODULE_IDX_T; - -typedef enum _ENUM_NET_REG_STATE_T { - ENUM_NET_REG_STATE_UNREGISTERED, - ENUM_NET_REG_STATE_REGISTERING, - ENUM_NET_REG_STATE_REGISTERED, - ENUM_NET_REG_STATE_UNREGISTERING, - ENUM_NET_REG_STATE_NUM -} ENUM_NET_REG_STATE_T; - -#endif - -typedef struct _GL_IO_REQ_T { - QUE_ENTRY_T rQueEntry; - //wait_queue_head_t cmdwait_q; - BOOL fgRead; - BOOL fgWaitResp; -#if CFG_ENABLE_WIFI_DIRECT - BOOL fgIsP2pOid; -#endif - P_ADAPTER_T prAdapter; - PFN_OID_HANDLER_FUNC pfnOidHandler; - PVOID pvInfoBuf; - UINT_32 u4InfoBufLen; - PUINT_32 pu4QryInfoLen; - WLAN_STATUS rStatus; - UINT_32 u4Flag; -} GL_IO_REQ_T, *P_GL_IO_REQ_T; - -#if CFG_ENABLE_BT_OVER_WIFI -typedef struct _GL_BOW_INFO { - BOOLEAN fgIsRegistered; - dev_t u4DeviceNumber; /* dynamic device number */ -// struct kfifo *prKfifo; /* for buffering indicated events */ - struct kfifo rKfifo; /* for buffering indicated events */ - spinlock_t rSpinLock; /* spin lock for kfifo */ - struct cdev cdev; - UINT_32 u4FreqInKHz; /* frequency */ - - UINT_8 aucRole[CFG_BOW_PHYSICAL_LINK_NUM]; /* 0: Responder, 1: Initiator */ - ENUM_BOW_DEVICE_STATE aeState[CFG_BOW_PHYSICAL_LINK_NUM]; - PARAM_MAC_ADDRESS arPeerAddr[CFG_BOW_PHYSICAL_LINK_NUM]; - - wait_queue_head_t outq; - - #if CFG_BOW_SEPARATE_DATA_PATH - /* Device handle */ - struct net_device *prDevHandler; - BOOLEAN fgIsNetRegistered; - #endif - -} GL_BOW_INFO, *P_GL_BOW_INFO; -#endif - -/* -* type definition of pointer to p2p structure -*/ -typedef struct _GL_P2P_INFO_T GL_P2P_INFO_T, *P_GL_P2P_INFO_T; - -struct _GLUE_INFO_T { - /* Device handle */ - struct net_device *prDevHandler; - - /* Device Index(index of arWlanDevInfo[]) */ - INT_32 i4DevIdx; - - /* Device statistics */ - struct net_device_stats rNetDevStats; - - /* Wireless statistics struct net_device */ - struct iw_statistics rIwStats; - - /* spinlock to sync power save mechanism */ - spinlock_t rSpinLock[SPIN_LOCK_NUM]; - - /* semaphore for ioctl */ - struct semaphore ioctl_sem; - - UINT_32 u4Flag; /* GLUE_FLAG_XXX */ - UINT_32 u4PendFlag; - //UINT_32 u4TimeoutFlag; - UINT_32 u4OidCompleteFlag; - UINT_32 u4ReadyFlag; /* check if card is ready */ - - /* Number of pending frames, also used for debuging if any frame is - * missing during the process of unloading Driver. - * - * NOTE(Kevin): In Linux, we also use this variable as the threshold - * for manipulating the netif_stop(wake)_queue() func. - */ - INT_32 ai4TxPendingFrameNumPerQueue[4][CFG_MAX_TXQ_NUM]; - INT_32 i4TxPendingFrameNum; - INT_32 i4TxPendingSecurityFrameNum; - - /* current IO request for kalIoctl */ - GL_IO_REQ_T OidEntry; - - /* registry info*/ - REG_INFO_T rRegInfo; - - /* firmware */ - struct firmware *prFw; - - /* Host interface related information */ - /* defined in related hif header file */ - GL_HIF_INFO_T rHifInfo; - - /*! \brief wext wpa related information */ - GL_WPA_INFO_T rWpaInfo; - - - /* Pointer to ADAPTER_T - main data structure of internal protocol stack */ - P_ADAPTER_T prAdapter; - -#ifdef WLAN_INCLUDE_PROC - struct proc_dir_entry *pProcRoot; -#endif /* WLAN_INCLUDE_PROC */ - - /* Indicated media state */ - ENUM_PARAM_MEDIA_STATE_T eParamMediaStateIndicated; - - /* Device power state D0~D3 */ - PARAM_DEVICE_POWER_STATE ePowerState; - - struct completion rScanComp; /* indicate scan complete */ - struct completion rHaltComp; /* indicate main thread halt complete */ - struct completion rPendComp; /* indicate main thread halt complete */ -#if CFG_ENABLE_WIFI_DIRECT - struct completion rSubModComp; /*indicate sub module init or exit complete*/ -#endif - WLAN_STATUS rPendStatus; - - QUE_T rTxQueue; - - - /* OID related */ - QUE_T rCmdQueue; - //PVOID pvInformationBuffer; - //UINT_32 u4InformationBufferLength; - //PVOID pvOidEntry; - //PUINT_8 pucIOReqBuff; - //QUE_T rIOReqQueue; - //QUE_T rFreeIOReqQueue; - - wait_queue_head_t waitq; - struct task_struct *main_thread; - - struct timer_list tickfn; - - -#if CFG_SUPPORT_EXT_CONFIG - UINT_16 au2ExtCfg[256]; /* NVRAM data buffer */ - UINT_32 u4ExtCfgLength; /* 0 means data is NOT valid */ -#endif - -#if 1//CFG_SUPPORT_WAPI - /* Should be large than the PARAM_WAPI_ASSOC_INFO_T */ - UINT_8 aucWapiAssocInfoIEs[42]; - UINT_16 u2WapiAssocInfoIESz; -#endif - -#if CFG_ENABLE_BT_OVER_WIFI - GL_BOW_INFO rBowInfo; -#endif - -#if CFG_ENABLE_WIFI_DIRECT - P_GL_P2P_INFO_T prP2PInfo; -#if CFG_SUPPORT_P2P_RSSI_QUERY - /* Wireless statistics struct net_device */ - struct iw_statistics rP2pIwStats; -#endif -#endif - BOOLEAN fgWpsActive; - UINT_8 aucWSCIE[500]; /*for probe req*/ - UINT_16 u2WSCIELen; - UINT_8 aucWSCAssocInfoIE[200]; /*for Assoc req*/ - UINT_16 u2WSCAssocInfoIELen; - - /* NVRAM availability */ - BOOLEAN fgNvramAvailable; - - BOOLEAN fgMcrAccessAllowed; - - /* MAC Address Overriden by IOCTL */ - BOOLEAN fgIsMacAddrOverride; - PARAM_MAC_ADDRESS rMacAddrOverride; - - SET_TXPWR_CTRL_T rTxPwr; - - /* for cfg80211 scan done indication */ - struct cfg80211_scan_request *prScanRequest; - - /* to indicate registered or not */ - BOOLEAN fgIsRegistered; - - /* for cfg80211 connected indication */ - UINT_32 u4RspIeLength; - UINT_8 aucRspIe[CFG_CFG80211_IE_BUF_LEN]; - - UINT_32 u4ReqIeLength; - UINT_8 aucReqIe[CFG_CFG80211_IE_BUF_LEN]; -}; - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) - /* linux 2.4 */ - typedef void (*PFN_WLANISR)(int irq, void *dev_id, struct pt_regs *regs); -#else - typedef irqreturn_t (*PFN_WLANISR)(int irq, void *dev_id, struct pt_regs *regs); -#endif - -typedef void (*PFN_LINUX_TIMER_FUNC)(unsigned long); - - -/* generic sub module init/exit handler -* now, we only have one sub module, p2p -*/ -#if CFG_ENABLE_WIFI_DIRECT -typedef BOOLEAN (*SUB_MODULE_INIT)(P_GLUE_INFO_T prGlueInfo); -typedef BOOLEAN (*SUB_MODULE_EXIT)(P_GLUE_INFO_T prGlueInfo); - -typedef struct _SUB_MODULE_HANDLER { - SUB_MODULE_INIT subModInit; - SUB_MODULE_EXIT subModExit; - BOOLEAN fgIsInited; -} SUB_MODULE_HANDLER, *P_SUB_MODULE_HANDLER; - -#endif - -#if CONFIG_NL80211_TESTMODE - -typedef struct _NL80211_DRIVER_TEST_MODE_PARAMS { - UINT_32 index; - UINT_32 buflen; -} NL80211_DRIVER_TEST_MODE_PARAMS, *P_NL80211_DRIVER_TEST_MODE_PARAMS; - -/*SW CMD */ -typedef struct _NL80211_DRIVER_SW_CMD_PARAMS { - NL80211_DRIVER_TEST_MODE_PARAMS hdr; - UINT_8 set; - unsigned long adr; - unsigned long data; -}NL80211_DRIVER_SW_CMD_PARAMS, *P_NL80211_DRIVER_SW_CMD_PARAMS; - -struct iw_encode_exts { - __u32 ext_flags; /*!< IW_ENCODE_EXT_* */ - __u8 tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /*!< LSB first */ - __u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /*!< LSB first */ - __u8 addr[MAC_ADDR_LEN]; /*!< ff:ff:ff:ff:ff:ff for broadcast/multicast - * (group) keys or unicast address for - * individual keys */ - __u16 alg; /*!< IW_ENCODE_ALG_* */ - __u16 key_len; - __u8 key[32]; -}; - -/*SET KEY EXT */ -typedef struct _NL80211_DRIVER_SET_KEY_EXTS { - NL80211_DRIVER_TEST_MODE_PARAMS hdr; - UINT_8 key_index; - UINT_8 key_len; - struct iw_encode_exts ext; -}NL80211_DRIVER_SET_KEY_EXTS, *P_NL80211_DRIVER_SET_KEY_EXTS; - - -#endif - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/* Macros of SPIN LOCK operations for using in Glue Layer */ -/*----------------------------------------------------------------------------*/ -#if CFG_USE_SPIN_LOCK_BOTTOM_HALF - #define GLUE_SPIN_LOCK_DECLARATION() - #define GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, rLockCategory) \ - { \ - if (rLockCategory < SPIN_LOCK_NUM) \ - spin_lock_bh(&(prGlueInfo->rSpinLock[rLockCategory])); \ - } - #define GLUE_RELEASE_SPIN_LOCK(prGlueInfo, rLockCategory) \ - { \ - if (rLockCategory < SPIN_LOCK_NUM) \ - spin_unlock_bh(&(prGlueInfo->rSpinLock[rLockCategory])); \ - } -#else /* !CFG_USE_SPIN_LOCK_BOTTOM_HALF */ - #define GLUE_SPIN_LOCK_DECLARATION() UINT_32 __u4Flags = 0 - #define GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, rLockCategory) \ - { \ - if (rLockCategory < SPIN_LOCK_NUM) \ - spin_lock_irqsave(&(prGlueInfo)->rSpinLock[rLockCategory], __u4Flags); \ - } - #define GLUE_RELEASE_SPIN_LOCK(prGlueInfo, rLockCategory) \ - { \ - if (rLockCategory < SPIN_LOCK_NUM) \ - spin_unlock_irqrestore(&(prGlueInfo->rSpinLock[rLockCategory]), __u4Flags); \ - } -#endif /* !CFG_USE_SPIN_LOCK_BOTTOM_HALF */ - - -/*----------------------------------------------------------------------------*/ -/* Macros for accessing Reserved Fields of native packet */ -/*----------------------------------------------------------------------------*/ -#define GLUE_GET_PKT_QUEUE_ENTRY(_p) \ - (&( ((struct sk_buff *)(_p))->cb[0] )) - -#define GLUE_GET_PKT_DESCRIPTOR(_prQueueEntry) \ - ((P_NATIVE_PACKET) ((UINT_32)_prQueueEntry - offsetof(struct sk_buff, cb[0])) ) - -#define GLUE_SET_PKT_FLAG_802_11(_p) \ - (*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) |= BIT(7)) - -#define GLUE_SET_PKT_FLAG_1X(_p) \ - (*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) |= BIT(6)) - -#define GLUE_SET_PKT_FLAG_PAL(_p) \ - (*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) |= BIT(5)) - -#define GLUE_SET_PKT_FLAG_P2P(_p) \ - (*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) |= BIT(4)) - - - -#define GLUE_SET_PKT_TID(_p, _tid) \ - (*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) |= (((UINT_8)((_tid) & (BITS(0,3)))))) - - -#define GLUE_SET_PKT_FRAME_LEN(_p, _u2PayloadLen) \ - (*((PUINT_16) &( ((struct sk_buff *)(_p))->cb[6] )) = (UINT_16)(_u2PayloadLen)) - -#define GLUE_GET_PKT_FRAME_LEN(_p) \ - (*((PUINT_16) &( ((struct sk_buff *)(_p))->cb[6] )) ) - - -#define GLUE_GET_PKT_IS_802_11(_p) \ - ((*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) ) & (BIT(7))) - -#define GLUE_GET_PKT_IS_1X(_p) \ - ((*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) ) & (BIT(6))) - -#define GLUE_GET_PKT_TID(_p) \ - ((*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) ) & (BITS(0,3))) - - -#define GLUE_GET_PKT_IS_PAL(_p) \ - ((*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) ) & (BIT(5))) - -#define GLUE_GET_PKT_IS_P2P(_p) \ - ((*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) ) & (BIT(4))) - - -#define GLUE_SET_PKT_HEADER_LEN(_p, _ucMacHeaderLen) \ - (*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[5] )) = (UINT_8)(_ucMacHeaderLen)) - -#define GLUE_GET_PKT_HEADER_LEN(_p) \ - (*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[5] )) ) - -#define GLUE_SET_PKT_ARRIVAL_TIME(_p, _rSysTime) \ - (*((POS_SYSTIME) &( ((struct sk_buff *)(_p))->cb[8] )) = (OS_SYSTIME)(_rSysTime)) - -#define GLUE_GET_PKT_ARRIVAL_TIME(_p) \ - (*((POS_SYSTIME) &( ((struct sk_buff *)(_p))->cb[8] )) ) - -/* Check validity of prDev, private data, and pointers */ -#define GLUE_CHK_DEV(prDev) \ - ((prDev && *((P_GLUE_INFO_T *) netdev_priv(prDev))) ? TRUE : FALSE) - -#define GLUE_CHK_PR2(prDev, pr2) \ - ((GLUE_CHK_DEV(prDev) && pr2) ? TRUE : FALSE) - -#define GLUE_CHK_PR3(prDev, pr2, pr3) \ - ((GLUE_CHK_PR2(prDev, pr2) && pr3) ? TRUE : FALSE) - -#define GLUE_CHK_PR4(prDev, pr2, pr3, pr4) \ - ((GLUE_CHK_PR3(prDev, pr2, pr3) && pr4) ? TRUE : FALSE) - -#define GLUE_SET_EVENT(pr) \ - kalSetEvent(pr) - -#define GLUE_INC_REF_CNT(_refCount) atomic_inc((atomic_t *)&(_refCount)) -#define GLUE_DEC_REF_CNT(_refCount) atomic_dec((atomic_t *)&(_refCount)) - - -#define DbgPrint(...) -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -#ifdef WLAN_INCLUDE_PROC -INT_32 -procRemoveProcfs ( - struct net_device *prDev, - char *pucDevName - ); - -INT_32 -procInitProcfs ( - struct net_device *prDev, - char *pucDevName - ); -#endif /* WLAN_INCLUDE_PROC */ - -#if CFG_ENABLE_BT_OVER_WIFI -BOOLEAN -glRegisterAmpc ( - P_GLUE_INFO_T prGlueInfo - ); - -BOOLEAN -glUnregisterAmpc ( - P_GLUE_INFO_T prGlueInfo - ); -#endif - -#if CFG_ENABLE_WIFI_DIRECT - -VOID -wlanSubModRunInit( - P_GLUE_INFO_T prGlueInfo - ); - -VOID -wlanSubModRunExit( - P_GLUE_INFO_T prGlueInfo - ); - -BOOLEAN -wlanSubModInit( - P_GLUE_INFO_T prGlueInfo - ); - -BOOLEAN -wlanSubModExit( - P_GLUE_INFO_T prGlueInfo - ); - -VOID -wlanSubModRegisterInitExit( - SUB_MODULE_INIT rSubModInit, - SUB_MODULE_EXIT rSubModExit, - ENUM_SUB_MODULE_IDX_T eSubModIdx - ); - -BOOLEAN -wlanExportGlueInfo( - P_GLUE_INFO_T *prGlueInfoExpAddr - ); - -BOOLEAN -wlanIsLaunched( - VOID - ); - -void -p2pSetMulticastListWorkQueueWrapper( - P_GLUE_INFO_T prGlueInfo - ); - - - -#endif - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _GL_OS_H */ - diff --git a/drivers/net/wireless/mt5931/os/linux/include/gl_p2p_ioctl.h b/drivers/net/wireless/mt5931/os/linux/include/gl_p2p_ioctl.h deleted file mode 100755 index 6e8bd2a3bbf1..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/include/gl_p2p_ioctl.h +++ /dev/null @@ -1,1088 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/os/linux/include/gl_p2p_ioctl.h#9 $ -*/ - -/*! \file gl_p2p_ioctl.h - \brief This file is for custom ioctls for Wi-Fi Direct only -*/ - - - -/* -** $Log: gl_p2p_ioctl.h $ -** -** 07 26 2012 yuche.tsai -** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot -** Update driver code of ALPS.JB for hot-spot. -** -** 07 19 2012 yuche.tsai -** NULL -** Code update for JB. - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 06 07 2011 yuche.tsai - * [WCXRP00000763] [Volunteer Patch][MT6620][Driver] RX Service Discovery Frame under AP mode Issue - * Fix RX SD request under AP mode issue. - * - * 03 25 2011 wh.su - * NULL - * Fix P2P IOCTL of multicast address bug, add low power driver stop control. - * - * 11 22 2011 yuche.tsai - * NULL - * Update RSSI link quality of P2P Network query method. (Bug fix) - * - * 11 19 2011 yuche.tsai - * NULL - * Add RSSI support for P2P network. - * - * 11 11 2011 yuche.tsai - * NULL - * Fix work thread cancel issue. - * - * 11 08 2011 yuche.tsai - * [WCXRP00001094] [Volunteer Patch][Driver] Driver version & supplicant version query & set support for service discovery version check. - * Add support for driver version query & p2p supplicant verseion set. - * For new service discovery mechanism sync. - * - * 10 25 2011 cm.chang - * [WCXRP00001058] [All Wi-Fi][Driver] Fix sta_rec's phyTypeSet and OBSS scan in AP mode - * . - * - * 10 18 2011 yuche.tsai - * [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch. - * New 2.1 branch - - * - * 08 16 2011 chinglan.wang - * NULL - * Add the group id information in the invitation indication. - * - * 08 09 2011 yuche.tsai - * [WCXRP00000919] [Volunteer Patch][WiFi Direct][Driver] Invitation New Feature. - * Invitation Feature add on. - * - * 05 04 2011 chinglan.wang - * [WCXRP00000698] [MT6620 Wi-Fi][P2P][Driver] Add p2p invitation command for the p2p driver - * . - * - * 03 29 2011 wh.su - * [WCXRP00000095] [MT6620 Wi-Fi] [FW] Refine the P2P GO send broadcast protected code - * add the set power and get power function sample. - * - * 03 22 2011 george.huang - * [WCXRP00000504] [MT6620 Wi-Fi][FW] Support Sigma CAPI for power saving related command - * link with supplicant commands - * - * 03 07 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * rename the define to anti_pviracy. - * - * 03 02 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * Add Security check related code. - * - * 03 01 2011 wh.su - * [WCXRP00000488] [MT6620 Wi-Fi][Driver] Support the SIGMA set p2p parameter to driver - * fixed the ioctl sumcmd to meet the p2p_supplicant setting. - * - * 02 23 2011 wh.su - * [WCXRP00000488] [MT6620 Wi-Fi][Driver] Support the SIGMA set p2p parameter to driver - * adding the ioctl set int define for p2p parameter. - * - * 02 22 2011 wh.su - * [WCXRP00000488] [MT6620 Wi-Fi][Driver] Support the SIGMA set p2p parameter to driver - * adding the ioctl set int from supplicant, and can used to set the p2p paramters - * - * 02 17 2011 wh.su - * [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request - * adjust the set wsc ie structure. - * - * 01 05 2011 cp.wu - * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery - * ioctl implementations for P2P Service Discovery - * - * 12 22 2010 cp.wu - * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery - * 1. header file restructure for more clear module isolation - * 2. add function interface definition for implementing Service Discovery callbacks - * - * 12 15 2010 cp.wu - * NULL - * invoke nicEnableInterrupt() before leaving from wlanAdapterStart() - * - * 12 07 2010 cp.wu - * [WCXRP00000237] [MT6620 Wi-Fi][Wi-Fi Direct][Driver] Add interface for supporting service discovery - * define a pair of i/o control for multiplexing layer - * - * 11 04 2010 wh.su - * [WCXRP00000164] [MT6620 Wi-Fi][Driver] Support the p2p random SSID - * adding the p2p random ssid support. - * - * 10 20 2010 wh.su - * [WCXRP00000124] [MT6620 Wi-Fi] [Driver] Support the dissolve P2P Group - * Add the code to support disconnect p2p group - * - * 09 21 2010 kevin.huang - * [WCXRP00000054] [MT6620 Wi-Fi][Driver] Restructure driver for second Interface - * Isolate P2P related function for Hardware Software Bundle - * - * 09 10 2010 george.huang - * NULL - * update iwpriv LP related - * - * 09 07 2010 wh.su - * NULL - * adding the code for beacon/probe req/ probe rsp wsc ie at p2p. - * - * 08 25 2010 cp.wu - * NULL - * add netdev_ops(NDO) for linux kernel 2.6.31 or greater - * - * 08 20 2010 yuche.tsai - * NULL - * Refine a function parameter name. - * - * 08 19 2010 cp.wu - * NULL - * add set mac address interface for further possibilities of wpa_supplicant overriding interface address. - * - * 08 16 2010 george.huang - * NULL - * add wext handlers to link P2P set PS profile/ network address function (TBD) - * - * 08 16 2010 cp.wu - * NULL - * revised implementation of Wi-Fi Direct io controls. - * - * 08 12 2010 cp.wu - * NULL - * follow-up with ioctl interface update for Wi-Fi Direct application - * - * 08 06 2010 cp.wu - * NULL - * driver hook modifications corresponding to ioctl interface change. - * - * 08 03 2010 cp.wu - * NULL - * [Wi-Fi Direct] add framework for driver hooks - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 06 01 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add ioctl to configure scan mode for p2p connection - * - * 05 31 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add cfg80211 interface, which is to replace WE, for further extension - * - * 05 17 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * implement get scan result. - * - * 05 14 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * implement wireless extension ioctls in iw_handler form. - * - * 05 14 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add ioctl framework for Wi-Fi Direct by reusing wireless extension ioctls as well - * - * 05 11 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * p2p ioctls revised. - * - * 05 11 2010 cp.wu - * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support - * add ioctl for controlling p2p scan phase parameters - * -*/ - -#ifndef _GL_P2P_IOCTL_H -#define _GL_P2P_IOCTL_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include -#include -#include -#if CFG_ENABLE_WIFI_DIRECT_CFG_80211 - #include - #include -#endif - -#include "wlan_oid.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -// (WirelessExtension) Private I/O Controls -#define IOC_P2P_CFG_DEVICE (SIOCIWFIRSTPRIV+0) -#define IOC_P2P_PROVISION_COMPLETE (SIOCIWFIRSTPRIV+2) -#define IOC_P2P_START_STOP_DISCOVERY (SIOCIWFIRSTPRIV+4) -#define IOC_P2P_DISCOVERY_RESULTS (SIOCIWFIRSTPRIV+5) -#define IOC_P2P_WSC_BEACON_PROBE_RSP_IE (SIOCIWFIRSTPRIV+6) -#define IOC_P2P_GO_WSC_IE IOC_P2P_WSC_BEACON_PROBE_RSP_IE -#define IOC_P2P_CONNECT_DISCONNECT (SIOCIWFIRSTPRIV+8) -#define IOC_P2P_PASSWORD_READY (SIOCIWFIRSTPRIV+10) -//#define IOC_P2P_SET_PWR_MGMT_PARAM (SIOCIWFIRSTPRIV+12) -#define IOC_P2P_SET_INT (SIOCIWFIRSTPRIV+12) -#define IOC_P2P_GET_STRUCT (SIOCIWFIRSTPRIV+13) -#define IOC_P2P_SET_STRUCT (SIOCIWFIRSTPRIV+14) -#define IOC_P2P_GET_REQ_DEVICE_INFO (SIOCIWFIRSTPRIV+15) - -#define PRIV_CMD_INT_P2P_SET 0 - -// IOC_P2P_PROVISION_COMPLETE (iw_point . flags) -#define P2P_PROVISIONING_SUCCESS 0 -#define P2P_PROVISIONING_FAIL 1 - -// IOC_P2P_START_STOP_DISCOVERY (iw_point . flags) -#define P2P_STOP_DISCOVERY 0 -#define P2P_START_DISCOVERY 1 - -// IOC_P2P_CONNECT_DISCONNECT (iw_point . flags) -#define P2P_CONNECT 0 -#define P2P_DISCONNECT 1 - -// IOC_P2P_START_STOP_DISCOVERY (scan_type) -#define P2P_SCAN_FULL_AND_FIND 0 -#define P2P_SCAN_FULL 1 -#define P2P_SCAN_SEARCH_AND_LISTEN 2 -#define P2P_LISTEN 3 - -// IOC_P2P_GET_STRUCT/IOC_P2P_SET_STRUCT -#define P2P_SEND_SD_RESPONSE 0 -#define P2P_GET_SD_REQUEST 1 -#define P2P_SEND_SD_REQUEST 2 -#define P2P_GET_SD_RESPONSE 3 -#define P2P_TERMINATE_SD_PHASE 4 - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -/*----------------------------------------------------------------------------*/ -/* Wireless Extension: Private I/O Control */ -/*----------------------------------------------------------------------------*/ -typedef struct iw_p2p_cfg_device_type { - void __user *ssid; - UINT_8 ssid_len; - UINT_8 pri_device_type[8]; - UINT_8 snd_device_type[8]; - void __user *device_name; - UINT_8 device_name_len; - UINT_8 intend; - UINT_8 persistence; - UINT_8 sec_mode; - UINT_8 ch; - UINT_8 ch_width; /* 0: 20 Mhz 1:20/40 Mhz auto */ - UINT_8 max_scb; -} IW_P2P_CFG_DEVICE_TYPE, *P_IW_P2P_CFG_DEVICE_TYPE; - -typedef struct iw_p2p_hostapd_param { - UINT_8 cmd; - UINT_8 rsv[3]; - UINT_8 sta_addr[6]; - void __user *data; - UINT_16 len; -} IW_P2P_HOSTAPD_PARAM, *P_IW_P2P_HOSTAPD_PARAM; - -typedef struct iw_p2p_req_device_type { - UINT_8 scan_type; /* 0: Full scan + Find - * 1: Full scan - * 2: Scan (Search +Listen) - * 3: Listen - * other : reserved - */ - UINT_8 pri_device_type[8]; - void __user *probe_req_ie; - UINT_16 probe_req_len; - void __user *probe_rsp_ie; - UINT_16 probe_rsp_len; -} IW_P2P_REQ_DEVICE_TYPE, *P_IW_P2P_REQ_DEVICE_TYPE; - -typedef struct iw_p2p_connect_device { - UINT_8 sta_addr[6]; - UINT_8 p2pRole; /* 0: P2P Device, 1:GC, 2: GO */ - UINT_8 needProvision; /* 0: Don't needed provision, 1: doing the wsc provision first */ - UINT_8 authPeer; /* 1: auth peer invitation request */ - UINT_8 intend_config_method; /* Request Peer Device used config method */ -} IW_P2P_CONNECT_DEVICE, *P_IW_P2P_CONNECT_DEVICE; - -typedef struct iw_p2p_password_ready { - UINT_8 active_config_method; - void __user *probe_req_ie; - UINT_16 probe_req_len; - void __user *probe_rsp_ie; - UINT_16 probe_rsp_len; -} IW_P2P_PASSWORD_READY, *P_IW_P2P_PASSWORD_READY; - -typedef struct iw_p2p_device_req { - UINT_8 name[33]; - UINT_32 name_len; - UINT_8 device_addr[6]; - UINT_8 device_type; - INT_32 config_method; - INT_32 active_config_method; -} IW_P2P_DEVICE_REQ, *P_IW_P2P_DEVICE_REQ; - -typedef struct iw_p2p_transport_struct { - UINT_32 u4CmdId; - UINT_32 inBufferLength; - UINT_32 outBufferLength; - UINT_8 aucBuffer[16]; -} IW_P2P_TRANSPORT_STRUCT, *P_IW_P2P_TRANSPORT_STRUCT; - -// For Invitation -typedef struct iw_p2p_ioctl_invitation_struct { - UINT_8 aucDeviceID[6]; - UINT_8 aucGroupID[6]; // BSSID - UINT_8 aucSsid[32]; - UINT_32 u4SsidLen; - UINT_8 ucReinvoke; -} IW_P2P_IOCTL_INVITATION_STRUCT, *P_IW_P2P_IOCTL_INVITATION_STRUCT; - -typedef struct iw_p2p_ioctl_abort_invitation { - UINT_8 dev_addr[6]; -} IW_P2P_IOCTL_ABORT_INVITATION, *P_IW_P2P_IOCTL_ABORT_INVITATION; - -typedef struct iw_p2p_ioctl_invitation_indicate { - UINT_8 dev_addr[6]; - UINT_8 group_bssid[6]; - INT_32 config_method; /* peer device supported config method */ - UINT_8 dev_name[32]; /* for reinvoke */ - UINT_32 name_len; - UINT_8 operating_channel; /* for re-invoke, target operating channel */ - UINT_8 invitation_type; /* invitation or re-invoke */ -} IW_P2P_IOCTL_INVITATION_INDICATE, *P_IW_P2P_IOCTL_INVITATION_INDICATE; - -typedef struct iw_p2p_ioctl_invitation_status { - UINT_32 status_code; -} IW_P2P_IOCTL_INVITATION_STATUS, *P_IW_P2P_IOCTL_INVITATION_STATUS; - -//For Formation -typedef struct iw_p2p_ioctl_start_formation { - UINT_8 dev_addr[6]; /* bssid */ - UINT_8 role; /* 0: P2P Device, 1:GC, 2: GO */ - UINT_8 needProvision; /* 0: Don't needed provision, 1: doing the wsc provision first */ - UINT_8 auth; /* 1: auth peer invitation request */ - UINT_8 config_method; /* Request Peer Device used config method */ -}IW_P2P_IOCTL_START_FORMATION, *P_IW_P2P_IOCTL_START_FORMATION; - -/* SET_STRUCT / GET_STRUCT */ -typedef enum _ENUM_P2P_CMD_ID_T { - P2P_CMD_ID_SEND_SD_RESPONSE = 0, /* 0x00 (Set) */ - P2P_CMD_ID_GET_SD_REQUEST, /* 0x01 (Get) */ - P2P_CMD_ID_SEND_SD_REQUEST, /* 0x02 (Set) */ - P2P_CMD_ID_GET_SD_RESPONSE, /* 0x03 (Get) */ - P2P_CMD_ID_TERMINATE_SD_PHASE, /* 0x04 (Set) */ -#if 1 /* CFG_SUPPORT_ANTI_PIRACY */ - P2P_CMD_ID_SEC_CHECK, /* 0x05(Set) */ -#endif - P2P_CMD_ID_INVITATION, /* 0x06 (Set) */ - P2P_CMD_ID_INVITATION_INDICATE, /* 0x07 (Get) */ - P2P_CMD_ID_INVITATION_STATUS, /* 0x08 (Get) */ - P2P_CMD_ID_INVITATION_ABORT, /* 0x09 (Set) */ - P2P_CMD_ID_START_FORMATION, /* 0x0A (Set) */ - P2P_CMD_ID_P2P_VERSION, /* 0x0B (Set/Get) */ - P2P_CMD_ID_GET_CH_LIST = 12, /* 0x0C (Get) */ - P2P_CMD_ID_GET_OP_CH = 14 /* 0x0E (Get) */ -} ENUM_P2P_CMD_ID_T, *P_ENUM_P2P_CMD_ID_T; - -/* Service Discovery */ -typedef struct iw_p2p_cmd_send_sd_response { - PARAM_MAC_ADDRESS rReceiverAddr; - UINT_8 fgNeedTxDoneIndication; - UINT_8 ucSeqNum; - UINT_16 u2PacketLength; - UINT_8 aucPacketContent[0]; /*native 802.11*/ -} IW_P2P_CMD_SEND_SD_RESPONSE, *P_IW_P2P_CMD_SEND_SD_RESPONSE; - -typedef struct iw_p2p_cmd_get_sd_request { - PARAM_MAC_ADDRESS rTransmitterAddr; - UINT_16 u2PacketLength; - UINT_8 aucPacketContent[0]; /*native 802.11*/ -} IW_P2P_CMD_GET_SD_REQUEST, *P_IW_P2P_CMD_GET_SD_REQUEST; - -typedef struct iw_p2p_cmd_send_service_discovery_request { - PARAM_MAC_ADDRESS rReceiverAddr; - UINT_8 fgNeedTxDoneIndication; - UINT_8 ucSeqNum; - UINT_16 u2PacketLength; - UINT_8 aucPacketContent[0]; /*native 802.11*/ -} IW_P2P_CMD_SEND_SD_REQUEST, *P_IW_P2P_CMD_SEND_SD_REQUEST; - -typedef struct iw_p2p_cmd_get_sd_response { - PARAM_MAC_ADDRESS rTransmitterAddr; - UINT_16 u2PacketLength; - UINT_8 aucPacketContent[0]; /*native 802.11*/ -} IW_P2P_CMD_GET_SD_RESPONSE, *P_IW_P2P_CMD_GET_SD_RESPONSE; - -typedef struct iw_p2p_cmd_terminate_sd_phase { - PARAM_MAC_ADDRESS rPeerAddr; -} IW_P2P_CMD_TERMINATE_SD_PHASE, *P_IW_P2P_CMD_TERMINATE_SD_PHASE; - -typedef struct iw_p2p_version { - UINT_32 u4Version; -} IW_P2P_VERSION, *P_IW_P2P_VERSION; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -/* Macros used for cfg80211 */ -#define RATETAB_ENT(_rate, _rateid, _flags) \ - { \ - .bitrate = (_rate), \ - .hw_value = (_rateid), \ - .flags = (_flags), \ - } - -#define CHAN2G(_channel, _freq, _flags) \ - { \ - .band = IEEE80211_BAND_2GHZ, \ - .center_freq = (_freq), \ - .hw_value = (_channel), \ - .flags = (_flags), \ - .max_antenna_gain = 0, \ - .max_power = 30, \ - } - -#define CHAN5G(_channel, _flags) \ - { \ - .band = IEEE80211_BAND_5GHZ, \ - .center_freq = 5000 + (5 * (_channel)), \ - .hw_value = (_channel), \ - .flags = (_flags), \ - .max_antenna_gain = 0, \ - .max_power = 30, \ - } - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) && (CFG_ENABLE_WIFI_DIRECT_CFG_80211 != 0) -int mtk_p2p_cfg80211_change_iface( - struct wiphy *wiphy, - struct net_device *ndev, - enum nl80211_iftype type, u32 *flags, - struct vif_params *params - ); - -int mtk_p2p_cfg80211_add_key( - struct wiphy *wiphy, - struct net_device *ndev, - u8 key_index, - bool pairwise, - const u8 *mac_addr, - struct key_params *params - ); - -int mtk_p2p_cfg80211_get_key( - struct wiphy *wiphy, - struct net_device *ndev, - u8 key_index, - bool pairwise, - const u8 *mac_addr, - void *cookie, - void (*callback)(void *cookie, struct key_params*) - ); - -int mtk_p2p_cfg80211_del_key( - struct wiphy *wiphy, - struct net_device *ndev, - u8 key_index, - bool pairwise, - const u8 *mac_addr - ); - -int -mtk_p2p_cfg80211_set_default_key( - struct wiphy *wiphy, - struct net_device *netdev, - u8 key_index, - bool unicast, - bool multicast - ); - - -int mtk_p2p_cfg80211_get_station( - struct wiphy *wiphy, - struct net_device *ndev, - u8 *mac, - struct station_info *sinfo - ); - -int mtk_p2p_cfg80211_scan( - struct wiphy *wiphy, - struct net_device *ndev, - struct cfg80211_scan_request *request - ); - -int mtk_p2p_cfg80211_set_wiphy_params( - struct wiphy *wiphy, - u32 changed - ); - -int mtk_p2p_cfg80211_connect( - struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_connect_params *sme - ); - -int mtk_p2p_cfg80211_disconnect( - struct wiphy *wiphy, - struct net_device *dev, - u16 reason_code - ); - -int mtk_p2p_cfg80211_join_ibss( - struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_ibss_params *params - ); - -int mtk_p2p_cfg80211_leave_ibss( - struct wiphy *wiphy, - struct net_device *dev - ); - -int mtk_p2p_cfg80211_set_txpower( - struct wiphy *wiphy, - enum nl80211_tx_power_setting type, - int mbm - ); - -int mtk_p2p_cfg80211_get_txpower( - struct wiphy *wiphy, - int *dbm - ); - -int mtk_p2p_cfg80211_set_power_mgmt( - struct wiphy *wiphy, - struct net_device *dev, - bool enabled, - int timeout - ); - -int -mtk_p2p_cfg80211_change_bss( - struct wiphy * wiphy, - struct net_device * dev, - struct bss_parameters * params - ); - -int -mtk_p2p_cfg80211_remain_on_channel( - struct wiphy * wiphy, - struct net_device * dev, - struct ieee80211_channel * chan, - enum nl80211_channel_type channel_type, - unsigned int duration, - u64 * cookie - ); - -int -mtk_p2p_cfg80211_cancel_remain_on_channel( - struct wiphy * wiphy, - struct net_device * dev, - u64 cookie - ); - -int -mtk_p2p_cfg80211_deauth( - struct wiphy * wiphy, - struct net_device * dev, - struct cfg80211_deauth_request * req -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) - , void *cookie -#endif - ); - - -int -mtk_p2p_cfg80211_disassoc( - struct wiphy * wiphy, - struct net_device * dev, - struct cfg80211_disassoc_request * req -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) - , void *cookie -#endif - ); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) - -int -mtk_p2p_cfg80211_start_ap( - struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_ap_settings *settings - ); - - -int -mtk_p2p_cfg80211_change_beacon( - struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_beacon_data *info - ); - -int -mtk_p2p_cfg80211_mgmt_tx( - struct wiphy *wiphy, - struct net_device *dev, - struct ieee80211_channel *chan, - bool offchan, - enum nl80211_channel_type channel_type, - bool channel_type_valid, - unsigned int wait, - const u8 *buf, - size_t len, - bool no_cck, - bool dont_wait_for_ack, - u64 *cookie); - -#else -int -mtk_p2p_cfg80211_add_set_beacon( - struct wiphy *wiphy, - struct net_device *dev, - struct beacon_parameters *info - ); - -int -mtk_p2p_cfg80211_mgmt_tx( - struct wiphy * wiphy, - struct net_device * dev, - struct ieee80211_channel * chan, - bool offchan, - enum nl80211_channel_type channel_type, - bool channel_type_valid, - unsigned int wait, - const u8 * buf, - size_t len, - u64 *cookie - ); - -#endif - - -int -mtk_p2p_cfg80211_stop_ap( - struct wiphy * wiphy, - struct net_device * dev - ); - - - -int -mtk_p2p_cfg80211_del_station( - struct wiphy * wiphy, - struct net_device * dev, - u8 * mac - ); - -int -mtk_p2p_cfg80211_set_channel( - IN struct wiphy * wiphy, - IN struct net_device * dev, - IN struct ieee80211_channel * chan, - IN enum nl80211_channel_type channel_type - ); - -int -mtk_p2p_cfg80211_set_bitrate_mask( - IN struct wiphy *wiphy, - IN struct net_device *dev, - IN const u8 *peer, - IN const struct cfg80211_bitrate_mask *mask - ); - - -void -mtk_p2p_cfg80211_mgmt_frame_register( - IN struct wiphy *wiphy, - IN struct net_device *dev, - IN u16 frame_type, - IN bool reg - ); - -#if CONFIG_NL80211_TESTMODE -int -mtk_p2p_cfg80211_testmode_cmd( - IN struct wiphy *wiphy, - IN void *data, - IN int len - ); -int -mtk_p2p_cfg80211_testmode_p2p_sigma_pre_cmd( - IN struct wiphy *wiphy, - IN void *data, - IN int len - ); -int -mtk_p2p_cfg80211_testmode_p2p_sigma_cmd( - IN struct wiphy *wiphy, - IN void *data, - IN int len - ); -int -mtk_p2p_cfg80211_testmode_hotspot_block_list_cmd( - IN struct wiphy *wiphy, - IN void *data, - IN int len - ); -#else - #error "Please ENABLE kernel config (CONFIG_NL80211_TESTMODE) to support Wi-Fi Direct" -#endif - -#endif - -/* I/O control handlers */ - -int -mtk_p2p_wext_get_priv ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_reconnect ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_set_auth ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_set_key ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_mlme_handler( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_set_powermode( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_get_powermode( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -/* Private Wireless I/O Controls takes use of iw_handler */ -int -mtk_p2p_wext_set_local_dev_info( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_set_provision_complete( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_start_stop_discovery( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_discovery_results( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_wsc_ie( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_connect_disconnect( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_password_ready( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_request_dev_info( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_invitation_indicate( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_invitation_status( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_set_pm_param ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_set_ps_profile ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_set_network_address ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_set_int ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -/* Private Wireless I/O Controls for IOC_SET_STRUCT/IOC_GET_STRUCT */ -int -mtk_p2p_wext_set_struct ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_get_struct ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -/* IOC_SET_STRUCT/IOC_GET_STRUCT: Service Discovery */ -int -mtk_p2p_wext_get_service_discovery_request ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_get_service_discovery_response ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_send_service_discovery_request ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_send_service_discovery_response ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_terminate_service_discovery_phase ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -#if CFG_SUPPORT_ANTI_PIRACY -int -mtk_p2p_wext_set_sec_check_request ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_get_sec_check_response ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); -#endif - -int -mtk_p2p_wext_set_noa_param ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_set_oppps_param ( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_set_p2p_version( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -int -mtk_p2p_wext_get_p2p_version( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - - -void -mtk_p2p_wext_set_Multicastlist( - IN P_GLUE_INFO_T prGlueInfo - ); - -#if CFG_SUPPORT_P2P_RSSI_QUERY -int -mtk_p2p_wext_get_rssi( - IN struct net_device *prDev, - IN struct iw_request_info *info, - IN OUT union iwreq_data *wrqu, - IN OUT char *extra - ); - -struct iw_statistics * -mtk_p2p_wext_get_wireless_stats( - struct net_device *prDev - ); - -#endif - -int -mtk_p2p_wext_set_txpow( - IN struct net_device *prDev, - IN struct iw_request_info *prIwrInfo, - IN OUT union iwreq_data *prTxPow, - IN char *pcExtra - ); - - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _GL_P2P_IOCTL_H */ - diff --git a/drivers/net/wireless/mt5931/os/linux/include/gl_p2p_kal.h b/drivers/net/wireless/mt5931/os/linux/include/gl_p2p_kal.h deleted file mode 100755 index 9a20c26b406f..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/include/gl_p2p_kal.h +++ /dev/null @@ -1,395 +0,0 @@ -/* -** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/os/linux/include/gl_p2p_kal.h#2 $ -*/ - -/*! \file gl_p2p_kal.h - \brief Declaration of KAL functions for Wi-Fi Direct support - - kal*() which is provided by GLUE Layer. - - Any definitions in this file will be shared among GLUE Layer and internal Driver Stack. -*/ - - - -/* -** $Log: gl_p2p_kal.h $ -** -** 08 29 2012 chinglan.wang -** [ALPS00349655] [Need Patch] [Volunteer Patch] [ALPS.JB] Daily build warning on [mt6575_phone_mhl-eng] -** . - * - * 07 17 2012 yuche.tsai - * NULL - * Compile no error before trial run. - * - * 10 18 2011 yuche.tsai - * [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch. - * New 2.1 branch - - * - * 08 15 2011 yuche.tsai - * [WCXRP00000919] [Volunteer Patch][WiFi Direct][Driver] Invitation New Feature. - * Add group BSSID in invitation request indication. - * The BSSID is used for APP to decide the configure method. - * - * 08 09 2011 yuche.tsai - * [WCXRP00000919] [Volunteer Patch][WiFi Direct][Driver] Invitation New Feature. - * Invitation Feature add on. - * - * 03 19 2011 terry.wu - * [WCXRP00000577] [MT6620 Wi-Fi][Driver][FW] Create V2.0 branch for firmware and driver - * create V2.0 p2p driver release based on label "MT6620_WIFI_P2P_DRIVER_V2_0_2100_0319_2011" from main trunk. - * - * 03 07 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * rename the define to anti_pviracy. - * - * 03 05 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * add the code to get the check rsponse and indicate to app. - * - * 03 02 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * Add Security check related code. - * - * 12 22 2010 cp.wu - * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery - * 1. header file restructure for more clear module isolation - * 2. add function interface definition for implementing Service Discovery callbacks - * -*/ - -#ifndef _GL_P2P_KAL_H -#define _GL_P2P_KAL_H - - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "config.h" -#include "gl_typedef.h" -#include "gl_os.h" -#include "wlan_lib.h" -#include "wlan_oid.h" -#include "wlan_p2p.h" -#include "gl_kal.h" -#include "gl_wext_priv.h" -#include "gl_p2p_ioctl.h" -#include "nic/p2p.h" - - -#if DBG - extern int allocatedMemSize; -#endif - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/* Service Discovery */ -VOID -kalP2PIndicateSDRequest( - IN P_GLUE_INFO_T prGlueInfo, - IN PARAM_MAC_ADDRESS rPeerAddr, - IN UINT_8 ucSeqNum - ); - -void -kalP2PIndicateSDResponse( - IN P_GLUE_INFO_T prGlueInfo, - IN PARAM_MAC_ADDRESS rPeerAddr, - IN UINT_8 ucSeqNum - ); - -VOID -kalP2PIndicateTXDone( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_8 ucSeqNum, - IN UINT_8 ucStatus - ); - -/*----------------------------------------------------------------------------*/ -/* Wi-Fi Direct handling */ -/*----------------------------------------------------------------------------*/ -ENUM_PARAM_MEDIA_STATE_T -kalP2PGetState ( - IN P_GLUE_INFO_T prGlueInfo - ); - -VOID -kalP2PSetState ( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_PARAM_MEDIA_STATE_T eState, - IN PARAM_MAC_ADDRESS rPeerAddr, - IN UINT_8 ucRole - ); - -VOID -kalP2PUpdateAssocInfo( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucFrameBody, - IN UINT_32 u4FrameBodyLen, - IN BOOLEAN fgReassocRequest - ); - -UINT_32 -kalP2PGetFreqInKHz( - IN P_GLUE_INFO_T prGlueInfo - ); - -UINT_8 -kalP2PGetRole( - IN P_GLUE_INFO_T prGlueInfo - ); - -VOID -kalP2PSetRole( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_8 ucResult, - IN PUINT_8 pucSSID, - IN UINT_8 ucSSIDLen, - IN UINT_8 ucRole - ); - -VOID -kalP2PSetCipher( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4Cipher - ); - -BOOLEAN -kalP2PGetCipher( - IN P_GLUE_INFO_T prGlueInfo - ); - -BOOLEAN -kalP2PGetTkipCipher( - IN P_GLUE_INFO_T prGlueInfo - ); - - -BOOLEAN -kalP2PGetCcmpCipher( - IN P_GLUE_INFO_T prGlueInfo - ); - - -VOID -kalP2PSetWscMode ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_8 ucWscMode - ); - -UINT_8 -kalP2PGetWscMode( - IN P_GLUE_INFO_T prGlueInfo - ); - -UINT_16 -kalP2PCalWSC_IELen( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_8 ucType - ); - -VOID -kalP2PGenWSC_IE( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_8 ucType, - IN PUINT_8 pucBuffer - ); - - -VOID -kalP2PUpdateWSC_IE( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_8 ucType, - IN PUINT_8 pucBuffer, - IN UINT_16 u2BufferLength - ); - - - -BOOLEAN -kalP2PIndicateFound( - IN P_GLUE_INFO_T prGlueInfo - ); - -VOID -kalP2PIndicateConnReq( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucDevName, - IN INT_32 u4NameLength, - IN PARAM_MAC_ADDRESS rPeerAddr, - IN UINT_8 ucDevType, /* 0: P2P Device / 1: GC / 2: GO */ - IN INT_32 i4ConfigMethod, - IN INT_32 i4ActiveConfigMethod - ); - -VOID -kalP2PInvitationStatus ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4InvStatus - ); - -VOID -kalP2PInvitationIndication( - IN P_GLUE_INFO_T prGlueInfo, - IN P_P2P_DEVICE_DESC_T prP2pDevDesc, - IN PUINT_8 pucSsid, - IN UINT_8 ucSsidLen, - IN UINT_8 ucOperatingChnl, - IN UINT_8 ucInvitationType, - IN PUINT_8 pucGroupBssid - ); - - -struct net_device* -kalP2PGetDevHdlr( - P_GLUE_INFO_T prGlueInfo - ); - -VOID -kalGetChnlList( - IN P_GLUE_INFO_T prGlueInfo, - IN ENUM_BAND_T eSpecificBand, - IN UINT_8 ucMaxChannelNum, - IN PUINT_8 pucNumOfChannel, - IN P_RF_CHANNEL_INFO_T paucChannelList - ); - -#if CFG_SUPPORT_ANTI_PIRACY -VOID -kalP2PIndicateSecCheckRsp( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucRsp, - IN UINT_16 u2RspLen - ); -#endif - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -VOID -kalP2PIndicateChannelReady( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_64 u8SeqNum, - IN UINT_32 u4ChannelNum, - IN ENUM_BAND_T eBand, - IN ENUM_CHNL_EXT_T eSco, - IN UINT_32 u4Duration - ); - -VOID -kalP2PIndicateScanDone( - IN P_GLUE_INFO_T prGlueInfo, - IN BOOLEAN fgIsAbort - ); - -VOID -kalP2PIndicateBssInfo( - IN P_GLUE_INFO_T prGlueInfo, - IN PUINT_8 pucFrameBuf, - IN UINT_32 u4BufLen, - IN P_RF_CHANNEL_INFO_T prChannelInfo, - IN INT_32 i4SignalStrength - ); - -VOID -kalP2PIndicateRxMgmtFrame( - IN P_GLUE_INFO_T prGlueInfo, - IN P_SW_RFB_T prSwRfb - ); - -VOID -kalP2PIndicateMgmtTxStatus( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_64 u8Cookie, - IN BOOLEAN fgIsAck, - IN PUINT_8 pucFrameBuf, - IN UINT_32 u4FrameLen - ); - -VOID -kalP2PIndicateChannelExpired( - IN P_GLUE_INFO_T prGlueInfo, - IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo - ); - -VOID -kalP2PGCIndicateConnectionStatus( - IN P_GLUE_INFO_T prGlueInfo, - IN P_P2P_CONNECTION_REQ_INFO_T prP2pConnInfo, - IN PUINT_8 pucRxIEBuf, - IN UINT_16 u2RxIELen, - IN UINT_16 u2StatusReason - ); - - -VOID -kalP2PGOStationUpdate( - IN P_GLUE_INFO_T prGlueInfo, - IN P_STA_RECORD_T prCliStaRec, - IN BOOLEAN fgIsNew - ); - -BOOLEAN -kalP2PSetBlackList ( - IN P_GLUE_INFO_T prGlueInfo, - IN PARAM_MAC_ADDRESS rbssid, - IN BOOLEAN fgIsblock - ); - -BOOLEAN -kalP2PCmpBlackList ( - IN P_GLUE_INFO_T prGlueInfo, - IN PARAM_MAC_ADDRESS rbssid - ); - -VOID -kalP2PSetMaxClients ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4MaxClient - ); - -BOOLEAN -kalP2PMaxClients ( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4NumClient - ); - -#endif /* _GL_P2P_KAL_H */ - diff --git a/drivers/net/wireless/mt5931/os/linux/include/gl_p2p_os.h b/drivers/net/wireless/mt5931/os/linux/include/gl_p2p_os.h deleted file mode 100755 index 49a90732c123..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/include/gl_p2p_os.h +++ /dev/null @@ -1,194 +0,0 @@ -/* -** $Id: -//Department/DaVinci/TRUNK/MT6620_5931_WiFi_Driver/os/linux/include/gl_p2p_os.h#28 $ -*/ - -/*! \file gl_p2p_os.h - \brief List the external reference to OS for p2p GLUE Layer. - - In this file we define the data structure - GLUE_INFO_T to store those objects - we acquired from OS - e.g. TIMER, SPINLOCK, NET DEVICE ... . And all the - external reference (header file, extern func() ..) to OS for GLUE Layer should - also list down here. -*/ - - - - - -#ifndef _GL_P2P_OS_H -#define _GL_P2P_OS_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - - -struct _GL_P2P_INFO_T { - - /* Device handle */ - struct net_device *prDevHandler; - - #if CFG_ENABLE_WIFI_DIRECT_CFG_80211 - /* cfg80211 */ - struct wireless_dev wdev; - - struct cfg80211_scan_request *prScanRequest; - - UINT_64 u8Cookie; - - /* Generation for station list update. */ - INT_32 i4Generation; - - UINT_32 u4OsMgmtFrameFilter; - - #endif - - /* Device statistics */ - struct net_device_stats rNetDevStats; - - /* glue layer variables */ - /*move to glueinfo->adapter*/ - // BOOLEAN fgIsRegistered; - UINT_32 u4FreqInKHz; /* frequency */ - UINT_8 ucRole; /* 0: P2P Device, 1: Group Client, 2: Group Owner */ - UINT_8 ucIntent; /* range: 0-15 */ - UINT_8 ucScanMode; /* 0: Search & Listen, 1: Scan without probe response */ - - ENUM_PARAM_MEDIA_STATE_T eState; - UINT_32 u4PacketFilter; - PARAM_MAC_ADDRESS aucMCAddrList[MAX_NUM_GROUP_ADDR]; - - /* connection-requested peer information */ - UINT_8 aucConnReqDevName[32]; - INT_32 u4ConnReqNameLength; - PARAM_MAC_ADDRESS rConnReqPeerAddr; - PARAM_MAC_ADDRESS rConnReqGroupAddr; /* For invitation group. */ - UINT_8 ucConnReqDevType; - INT_32 i4ConnReqConfigMethod; - INT_32 i4ConnReqActiveConfigMethod; - - UINT_32 u4CipherPairwise; - UINT_8 ucWSCRunning; - - UINT_8 aucWSCIE[3][400]; /* 0 for beacon, 1 for probe req, 2 for probe response */ - UINT_16 u2WSCIELen[3]; - - UINT_8 ucOperatingChnl; - UINT_8 ucInvitationType; - - UINT_32 u4InvStatus; - - /* For SET_STRUCT/GET_STRUCT */ - UINT_8 aucOidBuf[4096]; - -#if 1 /* CFG_SUPPORT_ANTI_PIRACY */ - UINT_8 aucSecCheck[256]; - UINT_8 aucSecCheckRsp[256]; -#endif - - /* Hotspot Client Management */ - PARAM_MAC_ADDRESS aucblackMACList[8]; - UINT_8 ucMaxClients; - -}; - - -BOOLEAN -p2pRegisterToWlan( - P_GLUE_INFO_T prGlueInfo - ); - -BOOLEAN -p2pUnregisterToWlan( - P_GLUE_INFO_T prGlueInfo - ); - -BOOLEAN -p2pLaunch( - P_GLUE_INFO_T prGlueInfo - ); - -BOOLEAN -p2pRemove( - P_GLUE_INFO_T prGlueInfo - ); - -VOID -p2pSetMode( - IN BOOLEAN fgIsAPMOde - ); - - -BOOLEAN -glRegisterP2P( - P_GLUE_INFO_T prGlueInfo, - const char *prDevName, - BOOLEAN fgIsApMode - ); - -BOOLEAN -glUnregisterP2P( - P_GLUE_INFO_T prGlueInfo - ); - -BOOLEAN -p2pNetRegister( - P_GLUE_INFO_T prGlueInfo, - BOOLEAN fgIsRtnlLockAcquired - ); - -BOOLEAN -p2pNetUnregister( - P_GLUE_INFO_T prGlueInfo, - BOOLEAN fgIsRtnlLockAcquired - ); - -BOOLEAN -p2pStopImmediate( - P_GLUE_INFO_T prGlueInfo - ); - -BOOLEAN -p2PFreeInfo( - P_GLUE_INFO_T prGlueInfo - ); - - -#endif diff --git a/drivers/net/wireless/mt5931/os/linux/include/gl_rst.h b/drivers/net/wireless/mt5931/os/linux/include/gl_rst.h deleted file mode 100755 index b85978a80e76..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/include/gl_rst.h +++ /dev/null @@ -1,131 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/include/gl_rst.h#1 $ -*/ - -/*! \file gl_rst.h - \brief Declaration of functions and finite state machine for - MT6620 Whole-Chip Reset Mechanism -*/ - - - - -#ifndef _GL_RST_H -#define _GL_RST_H - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include "gl_typedef.h" - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -/* duplicated from wmt_exp.h for better driver isolation */ -typedef enum _ENUM_WMTDRV_TYPE_T { - WMTDRV_TYPE_BT = 0, - WMTDRV_TYPE_FM = 1, - WMTDRV_TYPE_GPS = 2, - WMTDRV_TYPE_WIFI = 3, - WMTDRV_TYPE_WMT = 4, - WMTDRV_TYPE_STP = 5, - WMTDRV_TYPE_SDIO1 = 6, - WMTDRV_TYPE_SDIO2 = 7, - WMTDRV_TYPE_LPBK = 8, - WMTDRV_TYPE_MAX -} ENUM_WMTDRV_TYPE_T, *P_ENUM_WMTDRV_TYPE_T; - -typedef enum _ENUM_WMTMSG_TYPE_T { - WMTMSG_TYPE_POWER_ON = 0, - WMTMSG_TYPE_POWER_OFF = 1, - WMTMSG_TYPE_RESET = 2, - WMTMSG_TYPE_STP_RDY= 3, - WMTMSG_TYPE_HW_FUNC_ON= 4, - WMTMSG_TYPE_MAX -} ENUM_WMTMSG_TYPE_T, *P_ENUM_WMTMSG_TYPE_T; - -typedef enum _ENUM_WMTRSTMSG_TYPE_T{ - WMTRSTMSG_RESET_START = 0x0, - WMTRSTMSG_RESET_END = 0x1, - WMTRSTMSG_RESET_MAX, - WMTRSTMSG_RESET_INVALID = 0xff -} ENUM_WMTRSTMSG_TYPE_T, *P_ENUM_WMTRSTMSG_TYPE_T; - -typedef void (*PF_WMT_CB)( - ENUM_WMTDRV_TYPE_T, /* Source driver type */ - ENUM_WMTDRV_TYPE_T, /* Destination driver type */ - ENUM_WMTMSG_TYPE_T, /* Message type */ - void *, /* READ-ONLY buffer. Buffer is allocated and freed by WMT_drv. Client - can't touch this buffer after this function return. */ - unsigned int /* Buffer size in unit of byte */ - ); - - -typedef enum _ENUM_WIFI_NETLINK_GRP_T{ - WIFI_NETLINK_GRP_RESET, - WIFI_NETLINK_GRP_MAX -} ENUM_WIFI_NETLINK_GRP_T, *P_ENUM_WIFI_NETLINK_GRP_T; - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -/*----------------------------------------------------------------------------*/ -/* Reset Initialization/Uninitialization */ -/*----------------------------------------------------------------------------*/ -VOID -glResetInit( - VOID - ); - -VOID -glResetUninit( - VOID - ); - -VOID -glSendResetRequest( - VOID - ); - -BOOLEAN -kalIsResetting( - VOID - ); - - -#endif /* _GL_RST_H */ diff --git a/drivers/net/wireless/mt5931/os/linux/include/gl_sec.h b/drivers/net/wireless/mt5931/os/linux/include/gl_sec.h deleted file mode 100755 index 16f0af93be89..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/include/gl_sec.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/include/gl_sec.h#1 $ -*/ - -/*! \file p2p_fsm.h - \brief Declaration of functions and finite state machine for P2P Module. - - Declaration of functions and finite state machine for P2P Module. -*/ - - - - -#ifndef _GL_SEC_H -#define _GL_SEC_H - -extern void handle_sec_msg_1(unsigned char *msg_in, int msg_in_len, unsigned char *msg_out, int *msg_out_len); -extern void handle_sec_msg_2(unsigned char *msg_in, int msg_in_len, unsigned char *msg_out, int *msg_out_len); -extern void handle_sec_msg_3(unsigned char *msg_in, int msg_in_len, unsigned char *msg_out, int *msg_out_len); -extern void handle_sec_msg_4(unsigned char *msg_in, int msg_in_len, unsigned char *msg_out, int *msg_out_len); -extern void handle_sec_msg_5(unsigned char *msg_in, int msg_in_len, unsigned char *msg_out, int *msg_out_len); -extern void handle_sec_msg_final(unsigned char *msg_in, int msg_in_len, unsigned char *msg_out, int *msg_out_len); - -#endif /* _GL_SEC_H */ diff --git a/drivers/net/wireless/mt5931/os/linux/include/gl_typedef.h b/drivers/net/wireless/mt5931/os/linux/include/gl_typedef.h deleted file mode 100755 index e220b43c36ca..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/include/gl_typedef.h +++ /dev/null @@ -1,279 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/include/gl_typedef.h#1 $ -*/ - -/*! \file gl_typedef.h - \brief Definition of basic data type(os dependent). - - In this file we define the basic data type. -*/ - - - -/* -** $Log: gl_typedef.h $ - * - * 06 22 2012 cp.wu - * [WCXRP00001257] [MT6620][MT5931][MT6628][Driver][Linux] Modify KAL_HZ to align ms accuracy - * modify KAL_HZ to (1000) for correct definition. - * - * 03 21 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * portability improvement - * - * 02 15 2011 jeffrey.chang - * NULL - * to support early suspend in android - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port -** \main\maintrunk.MT5921\6 2009-08-18 22:57:14 GMT mtk01090 -** Add Linux SDIO (with mmc core) support. -** Add Linux 2.6.21, 2.6.25, 2.6.26. -** Fix compile warning in Linux. -** \main\maintrunk.MT5921\5 2008-09-22 23:19:30 GMT mtk01461 -** Update comment for code review -** \main\maintrunk.MT5921\4 2008-09-05 17:25:16 GMT mtk01461 -** Update Driver for Code Review -** \main\maintrunk.MT5921\3 2007-11-09 11:00:50 GMT mtk01425 -** 1. Use macro to unify network-to-host and host-to-network related functions -** Revision 1.3 2007/06/27 02:18:51 MTK01461 -** Update SCAN_FSM, Initial(Can Load Module), Proc(Can do Reg R/W), TX API -** -** Revision 1.2 2007/06/25 06:16:24 MTK01461 -** Update illustrations, gl_init.c, gl_kal.c, gl_kal.h, gl_os.h and RX API -** -*/ - -#ifndef _GL_TYPEDEF_H -#define _GL_TYPEDEF_H - -#if defined(CONFIG_HAS_EARLYSUSPEND) -#include -#endif - -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -/* Define HZ of timer tick for function kalGetTimeTick() */ -#define KAL_HZ (1000) - -/* Miscellaneous Equates */ -#ifndef FALSE - #define FALSE ((BOOL) 0) - #define TRUE ((BOOL) 1) -#endif /* FALSE */ - -#ifndef NULL - #if defined(__cplusplus) - #define NULL 0 - #else - #define NULL ((void *) 0) - #endif -#endif - -#if defined(CONFIG_HAS_EARLYSUSPEND) -typedef void (*early_suspend_callback)(struct early_suspend *h); -typedef void (*late_resume_callback) (struct early_suspend *h); -#endif - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -/* Type definition for void */ -typedef void VOID, *PVOID, **PPVOID; - -/* Type definition for Boolean */ -typedef unsigned char BOOL, *PBOOL, BOOLEAN, *PBOOLEAN; - -/* Type definition for signed integers */ -typedef signed char CHAR, *PCHAR, **PPCHAR; -typedef signed char INT_8, *PINT_8, **PPINT_8; -typedef signed short INT_16, *PINT_16, **PPINT_16; -typedef signed long INT_32, *PINT_32, **PPINT_32; -typedef signed long long INT_64, *PINT_64, **PPINT_64; - -/* Type definition for unsigned integers */ -typedef unsigned char UCHAR, *PUCHAR, **PPUCHAR; -typedef unsigned char UINT_8, *PUINT_8, **PPUINT_8, *P_UINT_8; -typedef unsigned short UINT_16, *PUINT_16, **PPUINT_16; -typedef unsigned long ULONG, UINT_32, *PUINT_32, **PPUINT_32; -typedef unsigned long long UINT_64, *PUINT_64, **PPUINT_64; - -typedef unsigned long OS_SYSTIME, *POS_SYSTIME, **PPOS_SYSTIME; - - -/* Type definition of large integer (64bits) union to be comptaible with - * Windows definition, so we won't apply our own coding style to these data types. - * NOTE: LARGE_INTEGER must NOT be floating variable. - * : Check for big-endian compatibility. - */ -typedef union _LARGE_INTEGER { - struct { - UINT_32 LowPart; - INT_32 HighPart; - } u; - INT_64 QuadPart; -} LARGE_INTEGER, *PLARGE_INTEGER; - -typedef union _ULARGE_INTEGER { - struct { - UINT_32 LowPart; - UINT_32 HighPart; - } u; - UINT_64 QuadPart; -} ULARGE_INTEGER, *PULARGE_INTEGER; - - -typedef INT_32 (*probe_card)(PVOID pvData); -typedef VOID (*remove_card)(VOID); - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ -#define IN //volatile -#define OUT //volatile - -#define __KAL_INLINE__ static __inline__ -#define __KAL_ATTRIB_PACKED__ __attribute__((__packed__)) -#define __KAL_ATTRIB_ALIGN_4__ __attribute__ ((aligned (4))) - - -#ifndef BIT -#define BIT(n) ((UINT_32) 1UL << (n)) -#endif /* BIT */ - -#ifndef BITS -/* bits range: for example BITS(16,23) = 0xFF0000 - * ==> (BIT(m)-1) = 0x0000FFFF ~(BIT(m)-1) => 0xFFFF0000 - * ==> (BIT(n+1)-1) = 0x00FFFFFF - */ -#define BITS(m,n) (~(BIT(m)-1) & ((BIT(n) - 1) | BIT(n))) -#endif /* BIT */ - - -/* This macro returns the byte offset of a named field in a known structure - type. - _type - structure name, - _field - field name of the structure */ -#ifndef OFFSET_OF - #define OFFSET_OF(_type, _field) ((UINT_32)&(((_type *)0)->_field)) -#endif /* OFFSET_OF */ - - -/* This macro returns the base address of an instance of a structure - * given the type of the structure and the address of a field within the - * containing structure. - * _addrOfField - address of current field of the structure, - * _type - structure name, - * _field - field name of the structure - */ -#ifndef ENTRY_OF - #define ENTRY_OF(_addrOfField, _type, _field) \ - ((_type *)((PINT_8)(_addrOfField) - (PINT_8)OFFSET_OF(_type, _field))) -#endif /* ENTRY_OF */ - - -/* This macro align the input value to the DW boundary. - * _value - value need to check - */ -#ifndef ALIGN_4 - #define ALIGN_4(_value) (((_value) + 3) & ~3u) -#endif /* ALIGN_4 */ - -/* This macro check the DW alignment of the input value. - * _value - value of address need to check - */ -#ifndef IS_ALIGN_4 - #define IS_ALIGN_4(_value) (((_value) & 0x3) ? FALSE : TRUE) -#endif /* IS_ALIGN_4 */ - -#ifndef IS_NOT_ALIGN_4 - #define IS_NOT_ALIGN_4(_value) (((_value) & 0x3) ? TRUE : FALSE) -#endif /* IS_NOT_ALIGN_4 */ - - -/* This macro evaluate the input length in unit of Double Word(4 Bytes). - * _value - value in unit of Byte, output will round up to DW boundary. - */ -#ifndef BYTE_TO_DWORD - #define BYTE_TO_DWORD(_value) ((_value + 3) >> 2) -#endif /* BYTE_TO_DWORD */ - -/* This macro evaluate the input length in unit of Byte. - * _value - value in unit of DW, output is in unit of Byte. - */ -#ifndef DWORD_TO_BYTE - #define DWORD_TO_BYTE(_value) ((_value) << 2) -#endif /* DWORD_TO_BYTE */ - -#if 1 // Little-Endian - #define CONST_NTOHS(_x) __constant_ntohs(_x) - - #define CONST_HTONS(_x) __constant_htons(_x) - - #define NTOHS(_x) ntohs(_x) - - #define HTONS(_x) htons(_x) - - #define NTOHL(_x) ntohl(_x) - - #define HTONL(_x) htonl(_x) - -#else // Big-Endian - - #define CONST_NTOHS(_x) - - #define CONST_HTONS(_x) - - #define NTOHS(_x) - - #define HTONS(_x) - -#endif - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _GL_TYPEDEF_H */ - diff --git a/drivers/net/wireless/mt5931/os/linux/include/gl_wext.h b/drivers/net/wireless/mt5931/os/linux/include/gl_wext.h deleted file mode 100755 index 7a5129f7a54d..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/include/gl_wext.h +++ /dev/null @@ -1,376 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/include/gl_wext.h#1 $ -*/ - -/*! \file gl_wext.h - \brief This file is for Portable Driver linux wireless extension support. -*/ - - - -/* -** $Log: gl_wext.h $ - * - * 10 12 2011 wh.su - * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP - * adding the 802.11w related function and define . - * - * 09 20 2011 chinglan.wang - * [WCXRP00000989] [WiFi Direct] [Driver] Add a new io control API to start the formation for the sigma test. - * . - * - * 09 20 2011 chinglan.wang - * [WCXRP00000989] [WiFi Direct] [Driver] Add a new io control API to start the formation for the sigma test. - * . - * - * 01 11 2011 chinglan.wang - * NULL - * Modify to reslove the CR :[ALPS00028994] Use WEP security to connect Marvell 11N AP. Connection establish successfully. - * Use the WPS function to connect AP, the privacy bit always is set to 1. . - * - * 09 27 2010 wh.su - * NULL - * [WCXRP00000067][MT6620 Wi-Fi][Driver] Support the android+ WAPI function. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 03 31 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * modify the wapi related code for new driver's design. - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port -** \main\maintrunk.MT5921\12 2009-10-20 17:38:33 GMT mtk01090 -** Refine driver unloading and clean up procedure. Block requests, stop main thread and clean up queued requests, and then stop hw. -** \main\maintrunk.MT5921\11 2009-09-28 20:19:28 GMT mtk01090 -** Add private ioctl to carry OID structures. Restructure public/private ioctl interfaces to Linux kernel. -** \main\maintrunk.MT5921\10 2009-09-03 12:12:35 GMT mtk01088 -** adding the function declaration -** \main\maintrunk.MT5921\9 2009-08-18 22:57:17 GMT mtk01090 -** Add Linux SDIO (with mmc core) support. -** Add Linux 2.6.21, 2.6.25, 2.6.26. -** Fix compile warning in Linux. -** \main\maintrunk.MT5921\8 2008-08-29 16:59:07 GMT mtk01088 -** fixed compiling error -** \main\maintrunk.MT5921\7 2008-08-29 14:13:28 GMT mtk01088 -** adjust the header file for code refine -** \main\maintrunk.MT5921\6 2008-03-28 10:40:31 GMT mtk01461 -** Add set desired rate in Linux STD IOCTL -** \main\maintrunk.MT5921\5 2008-03-11 14:51:08 GMT mtk01461 -** Refine private IOCTL functions -** \main\maintrunk.MT5921\4 2008-02-12 23:45:45 GMT mtk01461 -** Add Set Frequency & Channel oid support for Linux -** \main\maintrunk.MT5921\3 2007-11-06 19:36:19 GMT mtk01088 -** add the WPS related code -*/ - -#ifndef _GL_WEXT_H -#define _GL_WEXT_H - -#ifdef WIRELESS_EXT -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define KILO 1000 -#define RATE_5_5M 11 /* 5.5M */ - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -typedef struct _PARAM_FIXED_IEs { - UINT_8 aucTimestamp[8]; - UINT_16 u2BeaconInterval; - UINT_16 u2Capabilities; -} PARAM_FIXED_IEs; - -typedef struct _PARAM_VARIABLE_IE_T { - UINT_8 ucElementID; - UINT_8 ucLength; - UINT_8 aucData[1]; -} PARAM_VARIABLE_IE_T, *P_PARAM_VARIABLE_IE_T; - - -#if WIRELESS_EXT < 18 - -#define SIOCSIWMLME 0x8B16 /* request MLME operation; uses struct iw_mlme */ -/* MLME requests (SIOCSIWMLME / struct iw_mlme) */ -#define IW_MLME_DEAUTH 0 -#define IW_MLME_DISASSOC 1 - -/*! \brief SIOCSIWMLME data */ -struct iw_mlme { - __u16 cmd; /*!< IW_MLME_* */ - __u16 reason_code; - struct sockaddr addr; -}; - -#define SIOCSIWAUTH 0x8B32 /* set authentication mode params */ -#define SIOCGIWAUTH 0x8B33 /* get authentication mode params */ -/* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */ -#define IW_AUTH_INDEX 0x0FFF -#define IW_AUTH_FLAGS 0xF000 -/* SIOCSIWAUTH/SIOCGIWAUTH parameters (0 .. 4095) - * (IW_AUTH_INDEX mask in struct iw_param flags; this is the index of the - * parameter that is being set/get to; value will be read/written to - * struct iw_param value field) */ -#define IW_AUTH_WPA_VERSION 0 -#define IW_AUTH_CIPHER_PAIRWISE 1 -#define IW_AUTH_CIPHER_GROUP 2 -#define IW_AUTH_KEY_MGMT 3 -#define IW_AUTH_TKIP_COUNTERMEASURES 4 -#define IW_AUTH_DROP_UNENCRYPTED 5 -#define IW_AUTH_80211_AUTH_ALG 6 -#define IW_AUTH_WPA_ENABLED 7 -#define IW_AUTH_RX_UNENCRYPTED_EAPOL 8 -#define IW_AUTH_ROAMING_CONTROL 9 -#define IW_AUTH_PRIVACY_INVOKED 10 -#if CFG_SUPPORT_802_11W -#define IW_AUTH_MFP 12 - -#define IW_AUTH_MFP_DISABLED 0 /* MFP disabled */ -#define IW_AUTH_MFP_OPTIONAL 1 /* MFP optional */ -#define IW_AUTH_MFP_REQUIRED 2 /* MFP required */ -#endif - -/* IW_AUTH_WPA_VERSION values (bit field) */ -#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001 -#define IW_AUTH_WPA_VERSION_WPA 0x00000002 -#define IW_AUTH_WPA_VERSION_WPA2 0x00000004 - -/* IW_AUTH_PAIRWISE_CIPHER and IW_AUTH_GROUP_CIPHER values (bit field) */ -#define IW_AUTH_CIPHER_NONE 0x00000001 -#define IW_AUTH_CIPHER_WEP40 0x00000002 -#define IW_AUTH_CIPHER_TKIP 0x00000004 -#define IW_AUTH_CIPHER_CCMP 0x00000008 -#define IW_AUTH_CIPHER_WEP104 0x00000010 - -/* IW_AUTH_KEY_MGMT values (bit field) */ -#define IW_AUTH_KEY_MGMT_802_1X 1 -#define IW_AUTH_KEY_MGMT_PSK 2 -#define IW_AUTH_KEY_MGMT_WPA_NONE 4 - -/* IW_AUTH_80211_AUTH_ALG values (bit field) */ -#define IW_AUTH_ALG_OPEN_SYSTEM 0x00000001 -#define IW_AUTH_ALG_SHARED_KEY 0x00000002 -#define IW_AUTH_ALG_LEAP 0x00000004 - -/* IW_AUTH_ROAMING_CONTROL values */ -#define IW_AUTH_ROAMING_ENABLE 0 /* driver/firmware based roaming */ -#define IW_AUTH_ROAMING_DISABLE 1 /* user space program used for roaming - * control */ - -#define SIOCSIWENCODEEXT 0x8B34 /* set encoding token & mode */ -#define SIOCGIWENCODEEXT 0x8B35 /* get encoding token & mode */ -/* SIOCSIWENCODEEXT definitions */ -#define IW_ENCODE_SEQ_MAX_SIZE 8 -/* struct iw_encode_ext ->alg */ -#define IW_ENCODE_ALG_NONE 0 -#define IW_ENCODE_ALG_WEP 1 -#define IW_ENCODE_ALG_TKIP 2 -#define IW_ENCODE_ALG_CCMP 3 -#if CFG_SUPPORT_802_11W -#define IW_ENCODE_ALG_AES_CMAC 5 -#endif - -/* struct iw_encode_ext ->ext_flags */ -#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001 -#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002 -#define IW_ENCODE_EXT_GROUP_KEY 0x00000004 -#define IW_ENCODE_EXT_SET_TX_KEY 0x00000008 - -struct iw_encode_ext { - __u32 ext_flags; /*!< IW_ENCODE_EXT_* */ - __u8 tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /*!< LSB first */ - __u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /*!< LSB first */ - struct sockaddr addr; /*!< ff:ff:ff:ff:ff:ff for broadcast/multicast - * (group) keys or unicast address for - * individual keys */ - __u16 alg; /*!< IW_ENCODE_ALG_* */ - __u16 key_len; - __u8 key[0]; -}; - -#define SIOCSIWPMKSA 0x8B36 /* PMKSA cache operation */ -#define IW_PMKSA_ADD 1 -#define IW_PMKSA_REMOVE 2 -#define IW_PMKSA_FLUSH 3 - -#define IW_PMKID_LEN 16 - -struct iw_pmksa { - __u32 cmd; /*!< IW_PMKSA_* */ - struct sockaddr bssid; - __u8 pmkid[IW_PMKID_LEN]; -}; - -#define IWEVGENIE 0x8C05 /* Generic IE (WPA, RSN, WMM, ..) - * (scan results); This includes id and - * length fields. One IWEVGENIE may - * contain more than one IE. Scan - * results may contain one or more - * IWEVGENIE events. */ -#define IWEVMICHAELMICFAILURE 0x8C06 /* Michael MIC failure - * (struct iw_michaelmicfailure) - */ -#define IWEVASSOCREQIE 0x8C07 /* IEs used in (Re)Association Request. - * The data includes id and length - * fields and may contain more than one - * IE. This event is required in - * Managed mode if the driver - * generates its own WPA/RSN IE. This - * should be sent just before - * IWEVREGISTERED event for the - * association. */ -#define IWEVASSOCRESPIE 0x8C08 /* IEs used in (Re)Association - * Response. The data includes id and - * length fields and may contain more - * than one IE. This may be sent - * between IWEVASSOCREQIE and - * IWEVREGISTERED events for the - * association. */ -#define IWEVPMKIDCAND 0x8C09 /* PMKID candidate for RSN - * pre-authentication - * (struct iw_pmkid_cand) */ - -#endif /* WIRELESS_EXT < 18 */ - -#if WIRELESS_EXT < 17 -/* Statistics flags (bitmask in updated) */ -#define IW_QUAL_QUAL_UPDATED 0x1 /* Value was updated since last read */ -#define IW_QUAL_LEVEL_UPDATED 0x2 -#define IW_QUAL_NOISE_UPDATED 0x4 -#define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */ -#define IW_QUAL_LEVEL_INVALID 0x20 -#define IW_QUAL_NOISE_INVALID 0x40 -#endif - -enum { - IEEE80211_FILTER_TYPE_BEACON = 1<<0, - IEEE80211_FILTER_TYPE_PROBE_REQ = 1<<1, - IEEE80211_FILTER_TYPE_PROBE_RESP = 1<<2, - IEEE80211_FILTER_TYPE_ASSOC_REQ = 1<<3, - IEEE80211_FILTER_TYPE_ASSOC_RESP = 1<<4, - IEEE80211_FILTER_TYPE_AUTH = 1<<5, - IEEE80211_FILTER_TYPE_DEAUTH = 1<<6, - IEEE80211_FILTER_TYPE_DISASSOC = 1<<7, - IEEE80211_FILTER_TYPE_ALL = 0xFF /* used to check the valid filter bits */ -}; - -#if CFG_SUPPORT_WAPI -#define IW_AUTH_WAPI_ENABLED 0x20 -#define IW_ENCODE_ALG_SMS4 0x20 -#endif - -#if CFG_SUPPORT_WAPI /* Android+ */ -#define IW_AUTH_KEY_MGMT_WAPI_PSK 3 -#define IW_AUTH_KEY_MGMT_WAPI_CERT 4 -#endif -#define IW_AUTH_KEY_MGMT_WPS 5 - -#if CFG_SUPPORT_802_11W -#define IW_AUTH_KEY_MGMT_802_1X_SHA256 7 -#define IW_AUTH_KEY_MGMT_PSK_SHA256 8 -#endif - - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ -extern const struct iw_handler_def wext_handler_def; - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ -/* wireless extensions' ioctls */ -int -wext_support_ioctl( - IN struct net_device *prDev, - IN struct ifreq *prIfReq, - IN int i4Cmd - ); - -int -wext_set_rate ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN struct iw_param *prRate, - IN char *pcExtra - ); - -void -wext_indicate_wext_event( - IN P_GLUE_INFO_T prGlueInfo, - IN unsigned int u4Cmd, - IN unsigned char *pucData, - IN unsigned int u4DataLen - ); - -struct iw_statistics * -wext_get_wireless_stats ( - struct net_device *prDev - ); - -int -wext_get_priv ( - IN struct net_device *prNetDev, - IN struct ifreq *prIfReq - ); - -BOOLEAN -wextSrchDesiredWPAIE ( - IN PUINT_8 pucIEStart, - IN INT_32 i4TotalIeLen, - IN UINT_8 ucDesiredElemId, - OUT PUINT_8 *ppucDesiredIE - ); - -#if CFG_SUPPORT_WPS -BOOLEAN -wextSrchDesiredWPSIE ( - IN PUINT_8 pucIEStart, - IN INT_32 i4TotalIeLen, - IN UINT_8 ucDesiredElemId, - OUT PUINT_8 *ppucDesiredIE - ); -#endif - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* WIRELESS_EXT */ - -#endif /* _GL_WEXT_H */ - diff --git a/drivers/net/wireless/mt5931/os/linux/include/gl_wext_priv.h b/drivers/net/wireless/mt5931/os/linux/include/gl_wext_priv.h deleted file mode 100755 index 4a40ce491bae..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/include/gl_wext_priv.h +++ /dev/null @@ -1,396 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/include/gl_wext_priv.h#3 $ -*/ - -/*! \file gl_wext_priv.h - \brief This file includes private ioctl support. -*/ - - - -/* -** $Log: gl_wext_priv.h $ - * - * 01 16 2012 wh.su - * [WCXRP00001170] [MT6620 Wi-Fi][Driver] Adding the related code for set/get band ioctl - * Adding the template code for set / get band IOCTL (with ICS supplicant_6).. - * - * 01 05 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * Adding the related ioctl / wlan oid function to set the Tx power cfg. - * - * 01 02 2012 wh.su - * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function - * Adding the proto type function for set_int set_tx_power and get int get_ch_list. - * - * 11 08 2011 yuche.tsai - * [WCXRP00001094] [Volunteer Patch][Driver] Driver version & supplicant version query & set support for service discovery version check. - * Add a CMD ID for P2P driver version query. - * - * 03 17 2011 chinglan.wang - * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature - * . - * - * 03 02 2011 wh.su - * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code - * Add security check code. - * - * 01 27 2011 cm.chang - * [WCXRP00000402] [MT6620 Wi-Fi][Driver] Enable MCR read/write by iwpriv by default - * . - * - * 01 20 2011 eddie.chen - * [WCXRP00000374] [MT6620 Wi-Fi][DRV] SW debug control - * Add Oid for sw control debug command - * - * 01 07 2011 cm.chang - * [WCXRP00000336] [MT6620 Wi-Fi][Driver] Add test mode commands in normal phone operation - * Add a new compiling option to control if MCR read/write is permitted - * - * 12 31 2010 cm.chang - * [WCXRP00000336] [MT6620 Wi-Fi][Driver] Add test mode commands in normal phone operation - * Add some iwpriv commands to support test mode operation - * - * 11 08 2010 wh.su - * [WCXRP00000171] [MT6620 Wi-Fi][Driver] Add message check code same behavior as mt5921 - * add the message check code from mt5921. - * - * 10 18 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android - * complete implementation of Android NVRAM access - * - * 09 23 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * add skeleton for NVRAM integration - * - * 08 04 2010 cp.wu - * NULL - * revert changelist #15371, efuse read/write access will be done by RF test approach - * - * 08 04 2010 cp.wu - * NULL - * add OID definitions for EFUSE read/write access. - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base - * - * 03 31 2010 wh.su - * [WPD00003816][MT6620 Wi-Fi] Adding the security support - * modify the wapi related code for new driver's design. - * - * 03 24 2010 jeffrey.chang - * [WPD00003826]Initial import for Linux port - * initial import for Linux port -** \main\maintrunk.MT5921\16 2009-09-29 16:47:23 GMT mtk01090 -** Remove unused functions -** \main\maintrunk.MT5921\15 2009-09-28 20:19:31 GMT mtk01090 -** Add private ioctl to carry OID structures. Restructure public/private ioctl interfaces to Linux kernel. -** \main\maintrunk.MT5921\14 2009-05-07 22:26:06 GMT mtk01089 -** add private IO control for Linux BWCS -** \main\maintrunk.MT5921\13 2008-08-29 14:55:20 GMT mtk01088 -** adjust the code to meet coding style -** \main\maintrunk.MT5921\12 2008-07-16 15:23:45 GMT mtk01104 -** Support GPIO2 mode -** \main\maintrunk.MT5921\11 2008-07-14 13:55:58 GMT mtk01104 -** Support PRIV_CMD_BT_COEXIST -** \main\maintrunk.MT5921\10 2008-07-09 00:20:24 GMT mtk01461 -** Add priv oid to support WMM_PS_TEST -** \main\maintrunk.MT5921\9 2008-05-30 20:27:24 GMT mtk01461 -** Add POWER_MODE Private IOCTL cmd -** \main\maintrunk.MT5921\8 2008-04-17 23:06:44 GMT mtk01461 -** Add iwpriv support for AdHocMode setting -** \main\maintrunk.MT5921\7 2008-03-31 21:01:24 GMT mtk01461 -** Add priv IOCTL for VOIP settings -** \main\maintrunk.MT5921\6 2008-03-31 13:49:47 GMT mtk01461 -** add priv ioctl arg definition for turning on / off roaming -** \main\maintrunk.MT5921\5 2008-03-26 15:35:09 GMT mtk01461 -** Add CSUM offload priv ioctl for Linux -** \main\maintrunk.MT5921\4 2008-03-11 14:51:11 GMT mtk01461 -** Refine private IOCTL functions -** \main\maintrunk.MT5921\3 2007-11-06 19:36:25 GMT mtk01088 -** add the WPS related code -*/ - -#ifndef _GL_WEXT_PRIV_H -#define _GL_WEXT_PRIV_H -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ -/* If it is set to 1, iwpriv will support register read/write */ -#define CFG_SUPPORT_PRIV_MCR_RW 1 - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -/* New wireless extensions API - SET/GET convention (even ioctl numbers are - * root only) - */ -#define IOCTL_SET_INT (SIOCIWFIRSTPRIV + 0) -#define IOCTL_GET_INT (SIOCIWFIRSTPRIV + 1) - -#define IOCTL_SET_ADDRESS (SIOCIWFIRSTPRIV + 2) -#define IOCTL_GET_ADDRESS (SIOCIWFIRSTPRIV + 3) -#define IOCTL_SET_STR (SIOCIWFIRSTPRIV + 4) -#define IOCTL_GET_STR (SIOCIWFIRSTPRIV + 5) -#define IOCTL_SET_KEY (SIOCIWFIRSTPRIV + 6) -#define IOCTL_GET_KEY (SIOCIWFIRSTPRIV + 7) -#define IOCTL_SET_STRUCT (SIOCIWFIRSTPRIV + 8) -#define IOCTL_GET_STRUCT (SIOCIWFIRSTPRIV + 9) -#define IOCTL_SET_STRUCT_FOR_EM (SIOCIWFIRSTPRIV + 11) -#define IOCTL_SET_INTS (SIOCIWFIRSTPRIV + 12) -#define IOCTL_GET_INTS (SIOCIWFIRSTPRIV + 13) - -#define PRIV_CMD_REG_DOMAIN 0 -#define PRIV_CMD_BEACON_PERIOD 1 -#define PRIV_CMD_ADHOC_MODE 2 - -#if CFG_TCP_IP_CHKSUM_OFFLOAD - #define PRIV_CMD_CSUM_OFFLOAD 3 -#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */ - -#define PRIV_CMD_ROAMING 4 -#define PRIV_CMD_VOIP_DELAY 5 -#define PRIV_CMD_POWER_MODE 6 - -#define PRIV_CMD_WMM_PS 7 -#define PRIV_CMD_BT_COEXIST 8 -#define PRIV_GPIO2_MODE 9 - -#define PRIV_CUSTOM_SET_PTA 10 -#define PRIV_CUSTOM_CONTINUOUS_POLL 11 -#define PRIV_CUSTOM_SINGLE_ANTENNA 12 -#define PRIV_CUSTOM_BWCS_CMD 13 -#define PRIV_CUSTOM_DISABLE_BEACON_DETECTION 14//later -#define PRIV_CMD_OID 15 -#define PRIV_SEC_MSG_OID 16 - -#define PRIV_CMD_TEST_MODE 17 -#define PRIV_CMD_TEST_CMD 18 -#define PRIV_CMD_ACCESS_MCR 19 -#define PRIV_CMD_SW_CTRL 20 - -#if 1 /* ANTI_PRIVCY */ -#define PRIV_SEC_CHECK_OID 21 -#endif - -#define PRIV_CMD_WSC_PROBE_REQ 22 - -#define PRIV_CMD_P2P_VERSION 23 - -#define PRIV_CMD_GET_CH_LIST 24 - -#define PRIV_CMD_SET_TX_POWER 25 - -#define PRIV_CMD_BAND_CONFIG 26 - -#define PRIV_CMD_DUMP_MEM 27 - -#define PRIV_CMD_P2P_MODE 28 - -/* 802.3 Objects (Ethernet) */ -#define OID_802_3_CURRENT_ADDRESS 0x01010102 - -/* IEEE 802.11 OIDs */ -#define OID_802_11_SUPPORTED_RATES 0x0D01020E -#define OID_802_11_CONFIGURATION 0x0D010211 - -/* PnP and PM OIDs, NDIS default OIDS */ -#define OID_PNP_SET_POWER 0xFD010101 - -#define OID_CUSTOM_OID_INTERFACE_VERSION 0xFFA0C000 - -/* MT5921 specific OIDs */ -#define OID_CUSTOM_BT_COEXIST_CTRL 0xFFA0C580 -#define OID_CUSTOM_POWER_MANAGEMENT_PROFILE 0xFFA0C581 -#define OID_CUSTOM_PATTERN_CONFIG 0xFFA0C582 -#define OID_CUSTOM_BG_SSID_SEARCH_CONFIG 0xFFA0C583 -#define OID_CUSTOM_VOIP_SETUP 0xFFA0C584 -#define OID_CUSTOM_ADD_TS 0xFFA0C585 -#define OID_CUSTOM_DEL_TS 0xFFA0C586 -#define OID_CUSTOM_SLT 0xFFA0C587 -#define OID_CUSTOM_ROAMING_EN 0xFFA0C588 -#define OID_CUSTOM_WMM_PS_TEST 0xFFA0C589 -#define OID_CUSTOM_COUNTRY_STRING 0xFFA0C58A -#define OID_CUSTOM_MULTI_DOMAIN_CAPABILITY 0xFFA0C58B -#define OID_CUSTOM_GPIO2_MODE 0xFFA0C58C -#define OID_CUSTOM_CONTINUOUS_POLL 0xFFA0C58D -#define OID_CUSTOM_DISABLE_BEACON_DETECTION 0xFFA0C58E - -/* CR1460, WPS privacy bit check disable */ -#define OID_CUSTOM_DISABLE_PRIVACY_CHECK 0xFFA0C600 - -/* Precedent OIDs */ -#define OID_CUSTOM_MCR_RW 0xFFA0C801 -#define OID_CUSTOM_EEPROM_RW 0xFFA0C803 -#define OID_CUSTOM_SW_CTRL 0xFFA0C805 -#define OID_CUSTOM_MEM_DUMP 0xFFA0C807 - - -/* RF Test specific OIDs */ -#define OID_CUSTOM_TEST_MODE 0xFFA0C901 -#define OID_CUSTOM_TEST_RX_STATUS 0xFFA0C903 -#define OID_CUSTOM_TEST_TX_STATUS 0xFFA0C905 -#define OID_CUSTOM_ABORT_TEST_MODE 0xFFA0C906 -#define OID_CUSTOM_MTK_WIFI_TEST 0xFFA0C911 - -/* BWCS */ -#define OID_CUSTOM_BWCS_CMD 0xFFA0C931 -#define OID_CUSTOM_SINGLE_ANTENNA 0xFFA0C932 -#define OID_CUSTOM_SET_PTA 0xFFA0C933 - -/* NVRAM */ -#define OID_CUSTOM_MTK_NVRAM_RW 0xFFA0C941 -#define OID_CUSTOM_CFG_SRC_TYPE 0xFFA0C942 -#define OID_CUSTOM_EEPROM_TYPE 0xFFA0C943 - - -#if CFG_SUPPORT_WAPI -#define OID_802_11_WAPI_MODE 0xFFA0CA00 -#define OID_802_11_WAPI_ASSOC_INFO 0xFFA0CA01 -#define OID_802_11_SET_WAPI_KEY 0xFFA0CA02 -#endif - -#if CFG_SUPPORT_WPS2 -#define OID_802_11_WSC_ASSOC_INFO 0xFFA0CB00 -#endif - - -/* Define magic key of test mode (Don't change it for future compatibity) */ -#define PRIV_CMD_TEST_MAGIC_KEY 2011 - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ -/* NIC BBCR configuration entry structure */ -typedef struct _PRIV_CONFIG_ENTRY { - UINT_8 ucOffset; - UINT_8 ucValue; -} PRIV_CONFIG_ENTRY, *PPRIV_CONFIG_ENTRY; - -typedef WLAN_STATUS (*PFN_OID_HANDLER_FUNC_REQ) ( - IN PVOID prAdapter, - IN OUT PVOID pvBuf, - IN UINT_32 u4BufLen, - OUT PUINT_32 pu4OutInfoLen - ); - -typedef enum _ENUM_OID_METHOD_T { - ENUM_OID_GLUE_ONLY, - ENUM_OID_GLUE_EXTENSION, - ENUM_OID_DRIVER_CORE -} ENUM_OID_METHOD_T, *P_ENUM_OID_METHOD_T; - -/* OID set/query processing entry */ -typedef struct _WLAN_REQ_ENTRY { - UINT_32 rOid; /* OID */ - PUINT_8 pucOidName; /* OID name text */ - BOOLEAN fgQryBufLenChecking; - BOOLEAN fgSetBufLenChecking; - ENUM_OID_METHOD_T eOidMethod; - UINT_32 u4InfoBufLen; - PFN_OID_HANDLER_FUNC_REQ pfOidQueryHandler; /* PFN_OID_HANDLER_FUNC*/ - PFN_OID_HANDLER_FUNC_REQ pfOidSetHandler; /* PFN_OID_HANDLER_FUNC */ -} WLAN_REQ_ENTRY, *P_WLAN_REQ_ENTRY; - -typedef struct _NDIS_TRANSPORT_STRUCT { - UINT_32 ndisOidCmd; - UINT_32 inNdisOidlength; - UINT_32 outNdisOidLength; - UINT_8 ndisOidContent[16]; -} NDIS_TRANSPORT_STRUCT, *P_NDIS_TRANSPORT_STRUCT; - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -int -priv_set_int( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN union iwreq_data *prIwReqData, - IN char *pcExtra - ); - -int -priv_get_int( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN union iwreq_data *prIwReqData, - IN OUT char *pcExtra - ); - -int -priv_set_ints( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN union iwreq_data *prIwReqData, - IN char *pcExtra - ); - -int -priv_get_ints( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN union iwreq_data *prIwReqData, - IN OUT char *pcExtra - ); - -int -priv_set_struct( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN union iwreq_data *prIwReqData, - IN char *pcExtra - ); - -int -priv_get_struct ( - IN struct net_device *prNetDev, - IN struct iw_request_info *prIwReqInfo, - IN union iwreq_data *prIwReqData, - IN OUT char *pcExtra - ); - -int -priv_support_ioctl ( - IN struct net_device *prDev, - IN OUT struct ifreq *prReq, - IN int i4Cmd - ); - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - -#endif /* _GL_WEXT_PRIV_H */ - diff --git a/drivers/net/wireless/mt5931/os/linux/platform.c b/drivers/net/wireless/mt5931/os/linux/platform.c deleted file mode 100755 index 9eecea20333f..000000000000 --- a/drivers/net/wireless/mt5931/os/linux/platform.c +++ /dev/null @@ -1,620 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/platform.c#1 $ -*/ - -/*! \file "platform.c" - \brief This file including the protocol layer privacy function. - - This file provided the macros and functions library support for the - protocol layer security setting from wlan_oid.c and for parse.c and - rsn.c and nic_privacy.c - -*/ - - - -/* -** $Log: platform.c $ - * - * 11 14 2011 cm.chang - * NULL - * Fix compiling warning - * - * 11 10 2011 cp.wu - * [WCXRP00001098] [MT6620 Wi-Fi][Driver] Replace printk by DBG LOG macros in linux porting layer - * 1. eliminaite direct calls to printk in porting layer. - * 2. replaced by DBGLOG, which would be XLOG on ALPS platforms. - * - * 09 13 2011 jeffrey.chang - * [WCXRP00000983] [MT6620][Wi-Fi Driver] invalid pointer casting causes kernel panic during p2p connection - * fix the pointer casting - * - * 06 29 2011 george.huang - * [WCXRP00000818] [MT6620 Wi-Fi][Driver] Remove unused code segment regarding CONFIG_IPV6 - * . - * - * 06 28 2011 george.huang - * [WCXRP00000818] [MT6620 Wi-Fi][Driver] Remove unused code segment regarding CONFIG_IPV6 - * remove un-used code - * - * 05 11 2011 jeffrey.chang - * NULL - * fix build error - * - * 05 09 2011 jeffrey.chang - * [WCXRP00000710] [MT6620 Wi-Fi] Support pattern filter update function on IP address change - * support ARP filter through kernel notifier - * - * 04 08 2011 pat.lu - * [WCXRP00000623] [MT6620 Wi-Fi][Driver] use ARCH define to distinguish PC Linux driver - * Use CONFIG_X86 instead of PC_LINUX_DRIVER_USE option to have proper compile settting for PC Linux driver - * - * 03 22 2011 pat.lu - * [WCXRP00000592] [MT6620 Wi-Fi][Driver] Support PC Linux Environment Driver Build - * Add a compiler option "PC_LINUX_DRIVER_USE" for building driver in PC Linux environment. - * - * 03 21 2011 cp.wu - * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer - * improve portability for awareness of early version of linux kernel and wireless extension. - * - * 03 18 2011 jeffrey.chang - * [WCXRP00000512] [MT6620 Wi-Fi][Driver] modify the net device relative functions to support the H/W multiple queue - * remove early suspend functions - * - * 03 03 2011 jeffrey.chang - * NULL - * add the ARP filter callback - * - * 02 15 2011 jeffrey.chang - * NULL - * to support early suspend in android - * - * 02 01 2011 cp.wu - * [WCXRP00000413] [MT6620 Wi-Fi][Driver] Merge 1103 changes on NVRAM file path change to DaVinci main trunk and V1.1 branch - * upon Jason Zhang(NVRAM owner)'s change, ALPS has modified its NVRAM storage from /nvram/... to /data/nvram/... - * - * 11 01 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module - * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead - * 2) Remove CNM CH-RECOVER event handling - * 3) cfg read/write API renamed with kal prefix for unified naming rules. - * - * 10 18 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android - * complete implementation of Android NVRAM access - * - * 10 05 2010 cp.wu - * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check - * 1) add NVRAM access API - * 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option) - * 3) add OID implementation for NVRAM read/write service - * -** -*/ -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ -#include -#include -#include -#include -#include - -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 12) - #include -#endif - -#include "gl_os.h" - -#ifndef CONFIG_X86 -#if defined(CONFIG_HAS_EARLY_SUSPEND) - #include -#endif -#endif - - -extern BOOLEAN fgIsUnderEarlierSuspend; - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ -#define WIFI_NVRAM_FILE_NAME "/data/nvram/APCFG/APRDEB/WIFI" -#define WIFI_NVRAM_CUSTOM_NAME "/data/nvram/APCFG/APRDEB/WIFI_CUSTOM" - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - - - -static int netdev_event(struct notifier_block *nb, unsigned long notification, void *ptr) -{ - UINT_8 ip[4] = { 0 }; - UINT_32 u4NumIPv4 = 0; -//#ifdef CONFIG_IPV6 -#if 0 - UINT_8 ip6[16] = { 0 }; // FIX ME: avoid to allocate large memory in stack - UINT_32 u4NumIPv6 = 0; -#endif - struct in_ifaddr *ifa = (struct in_ifaddr *) ptr; - struct net_device *prDev = ifa->ifa_dev->dev; - UINT_32 i; - P_PARAM_NETWORK_ADDRESS_IP prParamIpAddr; - P_GLUE_INFO_T prGlueInfo = NULL; - - if (prDev == NULL) { - DBGLOG(REQ, INFO, ("netdev_event: device is empty.\n")); - return NOTIFY_DONE; - } - - if ((strncmp(prDev->name, "p2p", 3) != 0) && (strncmp(prDev->name, "wlan", 4) != 0)) { - DBGLOG(REQ, INFO, ("netdev_event: xxx\n")); - return NOTIFY_DONE; - } - - prGlueInfo = *((P_GLUE_INFO_T *) netdev_priv(prDev)); - - if (prGlueInfo == NULL) { - DBGLOG(REQ, INFO, ("netdev_event: prGlueInfo is empty.\n")); - return NOTIFY_DONE; - } - ASSERT(prGlueInfo); - - if (fgIsUnderEarlierSuspend == false) { - DBGLOG(REQ, INFO, ("netdev_event: PARAM_MEDIA_STATE_DISCONNECTED. (%d)\n", prGlueInfo->eParamMediaStateIndicated)); - return NOTIFY_DONE; - } - - - - // <3> get the IPv4 address - if(!prDev || !(prDev->ip_ptr)||\ - !((struct in_device *)(prDev->ip_ptr))->ifa_list||\ - !(&(((struct in_device *)(prDev->ip_ptr))->ifa_list->ifa_local))){ - DBGLOG(REQ, INFO, ("ip is not avaliable.\n")); - return NOTIFY_DONE; - } - - kalMemCopy(ip, &(((struct in_device *)(prDev->ip_ptr))->ifa_list->ifa_local), sizeof(ip)); - DBGLOG(REQ, INFO, ("ip is %d.%d.%d.%d\n", - ip[0],ip[1],ip[2],ip[3])); - - // todo: traverse between list to find whole sets of IPv4 addresses - if (!((ip[0] == 0) && - (ip[1] == 0) && - (ip[2] == 0) && - (ip[3] == 0))) { - u4NumIPv4++; - } - -//#ifdef CONFIG_IPV6 -#if 0 - if(!prDev || !(prDev->ip6_ptr)||\ - !((struct in_device *)(prDev->ip6_ptr))->ifa_list||\ - !(&(((struct in_device *)(prDev->ip6_ptr))->ifa_list->ifa_local))){ - printk(KERN_INFO "ipv6 is not avaliable.\n"); - return NOTIFY_DONE; - } - - kalMemCopy(ip6, &(((struct in_device *)(prDev->ip6_ptr))->ifa_list->ifa_local), sizeof(ip6)); - printk(KERN_INFO"ipv6 is %d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d\n", - ip6[0],ip6[1],ip6[2],ip6[3], - ip6[4],ip6[5],ip6[6],ip6[7], - ip6[8],ip6[9],ip6[10],ip6[11], - ip6[12],ip6[13],ip6[14],ip6[15] - ); - - // todo: traverse between list to find whole sets of IPv6 addresses - if (!((ip6[0] == 0) && - (ip6[1] == 0) && - (ip6[2] == 0) && - (ip6[3] == 0) && - (ip6[4] == 0) && - (ip6[5] == 0))) { - //u4NumIPv6++; - } -#endif - - // here we can compare the dev with other network's netdev to - // set the proper arp filter - // - // IMPORTANT: please make sure if the context can sleep, if the context can't sleep - // we should schedule a kernel thread to do this for us - - // <7> set up the ARP filter - { - WLAN_STATUS rStatus = WLAN_STATUS_FAILURE; - UINT_32 u4SetInfoLen = 0; - UINT_8 aucBuf[32] = {0}; - UINT_32 u4Len = OFFSET_OF(PARAM_NETWORK_ADDRESS_LIST, arAddress); - P_PARAM_NETWORK_ADDRESS_LIST prParamNetAddrList = (P_PARAM_NETWORK_ADDRESS_LIST)aucBuf; - P_PARAM_NETWORK_ADDRESS prParamNetAddr = prParamNetAddrList->arAddress; - -//#ifdef CONFIG_IPV6 -#if 0 - prParamNetAddrList->u4AddressCount = u4NumIPv4 + u4NumIPv6; -#else - prParamNetAddrList->u4AddressCount = u4NumIPv4; -#endif - prParamNetAddrList->u2AddressType = PARAM_PROTOCOL_ID_TCP_IP; - for (i = 0; i < u4NumIPv4; i++) { - prParamNetAddr->u2AddressLength = sizeof(PARAM_NETWORK_ADDRESS_IP);//4;; - prParamNetAddr->u2AddressType = PARAM_PROTOCOL_ID_TCP_IP;; -#if 0 - kalMemCopy(prParamNetAddr->aucAddress, ip, sizeof(ip)); - prParamNetAddr = (P_PARAM_NETWORK_ADDRESS)((UINT_32)prParamNetAddr + sizeof(ip)); - u4Len += OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress) + sizeof(ip); -#else - prParamIpAddr = (P_PARAM_NETWORK_ADDRESS_IP)prParamNetAddr->aucAddress; - kalMemCopy(&prParamIpAddr->in_addr, ip, sizeof(ip)); - prParamNetAddr = (P_PARAM_NETWORK_ADDRESS)((UINT_32)prParamNetAddr + sizeof(PARAM_NETWORK_ADDRESS)); - u4Len += OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress) + sizeof(PARAM_NETWORK_ADDRESS); -#endif - } -//#ifdef CONFIG_IPV6 -#if 0 - for (i = 0; i < u4NumIPv6; i++) { - prParamNetAddr->u2AddressLength = 6;; - prParamNetAddr->u2AddressType = PARAM_PROTOCOL_ID_TCP_IP;; - kalMemCopy(prParamNetAddr->aucAddress, ip6, sizeof(ip6)); - prParamNetAddr = (P_PARAM_NETWORK_ADDRESS)((UINT_32)prParamNetAddr + sizeof(ip6)); - u4Len += OFFSET_OF(PARAM_NETWORK_ADDRESS, aucAddress) + sizeof(ip6); - } -#endif - ASSERT(u4Len <= sizeof(aucBuf)); - - DBGLOG(REQ, INFO, ("kalIoctl (0x%x, 0x%x)\n", prGlueInfo, prParamNetAddrList)); - - rStatus = kalIoctl(prGlueInfo, - wlanoidSetNetworkAddress, - (PVOID)prParamNetAddrList, - u4Len, - FALSE, - FALSE, - TRUE, - FALSE, - &u4SetInfoLen); - - if (rStatus != WLAN_STATUS_SUCCESS) { - DBGLOG(REQ, INFO, ("set HW pattern filter fail 0x%lx\n", rStatus)); - } - } - - return NOTIFY_DONE; - -} - -static struct notifier_block inetaddr_notifier = { - .notifier_call = netdev_event, -}; - -void wlanRegisterNotifier(void) -{ - register_inetaddr_notifier(&inetaddr_notifier); -} - -//EXPORT_SYMBOL(wlanRegisterNotifier); - -void wlanUnregisterNotifier(void) -{ - unregister_inetaddr_notifier(&inetaddr_notifier); -} - -//EXPORT_SYMBOL(wlanUnregisterNotifier); - -#ifndef CONFIG_X86 -#if defined(CONFIG_HAS_EARLYSUSPEND) - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will register platform driver to os -* -* \param[in] wlanSuspend Function pointer to platform suspend function -* \param[in] wlanResume Function pointer to platform resume function -* -* \return The result of registering earlysuspend -*/ -/*----------------------------------------------------------------------------*/ - -int glRegisterEarlySuspend( - struct early_suspend *prDesc, - early_suspend_callback wlanSuspend, - late_resume_callback wlanResume) -{ - int ret = 0; - - if(NULL != wlanSuspend) - prDesc->suspend = wlanSuspend; - else{ - DBGLOG(REQ, INFO, ("glRegisterEarlySuspend wlanSuspend ERROR.\n")); - ret = -1; - } - - if(NULL != wlanResume) - prDesc->resume = wlanResume; - else{ - DBGLOG(REQ, INFO, ("glRegisterEarlySuspend wlanResume ERROR.\n")); - ret = -1; - } - - register_early_suspend(prDesc); - return ret; -} - -//EXPORT_SYMBOL(glRegisterEarlySuspend); - -/*----------------------------------------------------------------------------*/ -/*! -* \brief This function will un-register platform driver to os -* -* \return The result of un-registering earlysuspend -*/ -/*----------------------------------------------------------------------------*/ - -int glUnregisterEarlySuspend(struct early_suspend *prDesc) -{ - int ret = 0; - - unregister_early_suspend(prDesc); - - prDesc->suspend = NULL; - prDesc->resume = NULL; - - return ret; -} - -//EXPORT_SYMBOL(glUnregisterEarlySuspend); -#endif -#endif // !CONFIG_X86 - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Utility function for reading data from files on NVRAM-FS -* -* \param[in] -* filename -* len -* offset -* \param[out] -* buf -* \return -* actual length of data being read -*/ -/*----------------------------------------------------------------------------*/ -static int -nvram_read( - char *filename, - char *buf, - ssize_t len, - int offset) -{ -#if CFG_SUPPORT_NVRAM - struct file *fd; - int retLen = -1; - - mm_segment_t old_fs = get_fs(); - set_fs(KERNEL_DS); - - fd = filp_open(filename, O_RDONLY, 0644); - - if(IS_ERR(fd)) { - DBGLOG(INIT, INFO, ("[MT6620][nvram_read] : failed to open!!\n")); - return -1; - } - - do { - if ((fd->f_op == NULL) || (fd->f_op->read == NULL)) { - DBGLOG(INIT, INFO, ("[MT6620][nvram_read] : file can not be read!!\n")); - break; - } - - if (fd->f_pos != offset) { - if (fd->f_op->llseek) { - if(fd->f_op->llseek(fd, offset, 0) != offset) { - DBGLOG(INIT, INFO, ("[MT6620][nvram_read] : failed to seek!!\n")); - break; - } - } - else { - fd->f_pos = offset; - } - } - - retLen = fd->f_op->read(fd, - buf, - len, - &fd->f_pos); - - } while(FALSE); - - filp_close(fd, NULL); - - set_fs(old_fs); - - return retLen; - -#else // !CFG_SUPPORT_NVRAM - - return -EIO; - -#endif -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief Utility function for writing data to files on NVRAM-FS -* -* \param[in] -* filename -* buf -* len -* offset -* \return -* actual length of data being written -*/ -/*----------------------------------------------------------------------------*/ -static int -nvram_write ( - char *filename, - char *buf, - ssize_t len, - int offset) -{ -#if CFG_SUPPORT_NVRAM - struct file *fd; - int retLen = -1; - - mm_segment_t old_fs = get_fs(); - set_fs(KERNEL_DS); - - fd = filp_open(filename, O_WRONLY|O_CREAT, 0644); - - if(IS_ERR(fd)) { - DBGLOG(INIT, INFO, ("[MT6620][nvram_write] : failed to open!!\n")); - return -1; - } - - do{ - if ((fd->f_op == NULL) || (fd->f_op->write == NULL)) { - DBGLOG(INIT, INFO, ("[MT6620][nvram_write] : file can not be write!!\n")); - break; - } /* End of if */ - - if (fd->f_pos != offset) { - if (fd->f_op->llseek) { - if(fd->f_op->llseek(fd, offset, 0) != offset) { - DBGLOG(INIT, INFO, ("[MT6620][nvram_write] : failed to seek!!\n")); - break; - } - } - else { - fd->f_pos = offset; - } - } - - retLen = fd->f_op->write(fd, - buf, - len, - &fd->f_pos); - - } while(FALSE); - - filp_close(fd, NULL); - - set_fs(old_fs); - - return retLen; - -#else // !CFG_SUPPORT_NVRAMS - - return -EIO; - -#endif -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief API for reading data on NVRAM -* -* \param[in] -* prGlueInfo -* u4Offset -* \param[out] -* pu2Data -* \return -* TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalCfgDataRead16( - IN P_GLUE_INFO_T prGlueInfo, - IN UINT_32 u4Offset, - OUT PUINT_16 pu2Data - ) -{ - if(pu2Data == NULL) { - return FALSE; - } - - if(nvram_read(WIFI_NVRAM_FILE_NAME, - (char *)pu2Data, - sizeof(unsigned short), - u4Offset) != sizeof(unsigned short)) { - return FALSE; - } - else { - return TRUE; - } -} - - -/*----------------------------------------------------------------------------*/ -/*! -* \brief API for writing data on NVRAM -* -* \param[in] -* prGlueInfo -* u4Offset -* u2Data -* \return -* TRUE -* FALSE -*/ -/*----------------------------------------------------------------------------*/ -BOOLEAN -kalCfgDataWrite16( - IN P_GLUE_INFO_T prGlueInfo, - UINT_32 u4Offset, - UINT_16 u2Data - ) -{ - if(nvram_write(WIFI_NVRAM_FILE_NAME, - (char *)&u2Data, - sizeof(unsigned short), - u4Offset) != sizeof(unsigned short)) { - return FALSE; - } - else { - return TRUE; - } -} - - diff --git a/drivers/net/wireless/mt5931/os/version.h b/drivers/net/wireless/mt5931/os/version.h deleted file mode 100755 index 716a0628d755..000000000000 --- a/drivers/net/wireless/mt5931/os/version.h +++ /dev/null @@ -1,200 +0,0 @@ -/* -** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/version.h#1 $ -*/ - -/*! \file "version.h" - \brief Driver's version definition - -*/ - - - -/* -** $Log: version.h $ - * - * 11 01 2011 chinglan.wang - * NULL - * Change the version number to v2.0.1.1. - * - * 08 26 2011 chinglan.wang - * NULL - * Change the version number to v2.0.0.9.. - * - * 08 23 2011 chinglan.wang - * NULL - * Change the version number to v2.0.0.8. - * - * 08 15 2011 cp.wu - * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree - * correct typo. - * - * 08 15 2011 cp.wu - * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree - * for building MT6628 Win32 driver environment - * - * 08 03 2011 chinglan.wang - * NULL - * Change the version number to v2.0.0.7. - * - * 07 24 2011 puff.wen - * NULL - * [MT5931][Beta 5]Change the version number to v0.2.2.0 - * - * 06 01 2011 chinglan.wang - * NULL - * Change the version number to v2.0.0.6.. - * - * 05 09 2011 chinglan.wang - * NULL - * Change the version number to v2.0.0.5.. - * - * 04 19 2011 chinglan.wang - * NULL - * Change the version number to v2.0.0.4. - * - * 04 18 2011 chinglan.wang - * NULL - * Change the version number to v2.0.0.3. - * - * 03 25 2011 chinglan.wang - * NULL - * Change the version number to v2.0.0.2. - * - * 03 21 2011 chinglan.wang - * NULL - * Change the version number to 2.0.0.1. - * - * 03 18 2011 chinglan.wang - * NULL - * Change the version number to v2.0.0.0. - * - * 02 11 2011 chinglan.wang - * NULL - * Change to the version 1.2.0.2. - * - * 02 10 2011 chinglan.wang - * NULL - * Change the version to 1.2.0.1. - * - * 02 08 2011 cp.wu - * [WCXRP00000427] [MT6620 Wi-Fi][Driver] Modify veresion information to match with release revision number - * change version number to v1.2.0.0 for preparing v1.2 software package release. - * - * 12 10 2010 kevin.huang - * [WCXRP00000128] [MT6620 Wi-Fi][Driver] Add proc support to Android Driver for debug and driver status check - * Add Linux Proc Support - * - * 10 07 2010 cp.wu - * [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection - * [WINDDK] build system changes for MT5931 - * - * 07 08 2010 cp.wu - * - * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository. - * - * 06 06 2010 kevin.huang - * [WPD00003832][MT6620 5931] Create driver base - * [MT6620 5931] Create driver base -** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-12-14 14:10:55 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-11-17 22:41:00 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-11-13 16:20:33 GMT mtk01084 -** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:27:13 GMT mtk01426 -** Init for develop -** -*/ - -#ifndef _VERSION_H -#define _VERSION_H -/******************************************************************************* -* C O M P I L E R F L A G S -******************************************************************************** -*/ - -/******************************************************************************* -* E X T E R N A L R E F E R E N C E S -******************************************************************************** -*/ - -/******************************************************************************* -* C O N S T A N T S -******************************************************************************** -*/ - -#ifndef NIC_AUTHOR -#define NIC_AUTHOR "NIC_AUTHOR" -#endif -#ifndef NIC_DESC -#define NIC_DESC "NIC_DESC" -#endif - -#ifndef NIC_NAME - #if defined(MT6620) - #define NIC_NAME "MT6620" - #define NIC_DEVICE_ID "MT6620" - #define NIC_DEVICE_ID_LOW "mt6620" - #elif defined(MT5931) - #define NIC_NAME "MT5931" - #define NIC_DEVICE_ID "MT5931" - #define NIC_DEVICE_ID_LOW "mt5931" - #elif defined(MT6628) - #define NIC_NAME "MT6628" - #define NIC_DEVICE_ID "MT6628" - #define NIC_DEVICE_ID_LOW "mt6628" - #endif -#endif - -/* NIC driver information */ -#define NIC_VENDOR "MediaTek Inc." -#define NIC_VENDOR_OUI {0x00, 0x0C, 0xE7} - -#if defined(MT6620) - #define NIC_PRODUCT_NAME "MediaTek Inc. MT6620 Wireless LAN Adapter" - #define NIC_DRIVER_NAME "MediaTek Inc. MT6620 Wireless LAN Adapter Driver" -#elif defined(MT5931) - #define NIC_PRODUCT_NAME "MediaTek Inc. MT5931 Wireless LAN Adapter" - #define NIC_DRIVER_NAME "MediaTek Inc. MT5931 Wireless LAN Adapter Driver" -#elif defined(MT6628) - #define NIC_PRODUCT_NAME "MediaTek Inc. MT6628 Wireless LAN Adapter" - #define NIC_DRIVER_NAME "MediaTek Inc. MT6628 Wireless LAN Adapter Driver" -#endif - -/* Define our driver version */ -#define NIC_DRIVER_MAJOR_VERSION 2 -#define NIC_DRIVER_MINOR_VERSION 0 -#define NIC_DRIVER_VERSION 2,0,1,1 -#define NIC_DRIVER_VERSION_STRING "2.0.1.1" - - -/******************************************************************************* -* D A T A T Y P E S -******************************************************************************** -*/ - -/******************************************************************************* -* P U B L I C D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* P R I V A T E D A T A -******************************************************************************** -*/ - -/******************************************************************************* -* M A C R O S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N D E C L A R A T I O N S -******************************************************************************** -*/ - -/******************************************************************************* -* F U N C T I O N S -******************************************************************************** -*/ - - -#endif /* _VERSION_H */ - diff --git a/drivers/net/wireless/mt5931/os/wifi_version.h b/drivers/net/wireless/mt5931/os/wifi_version.h deleted file mode 100755 index 11a0557ebd5f..000000000000 --- a/drivers/net/wireless/mt5931/os/wifi_version.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Yongle Lai @ Rockchip - */ -#ifndef WIFI_VERSION_H -#define WIFI_VERSION_H - -/* - * Marvell MV8686 driver version. - */ -#define MT5931_DRV_VERSION "2.14" - -#endif /* WIFI_VERSION_H */ - diff --git a/drivers/net/wireless/mv8686/11d.c b/drivers/net/wireless/mv8686/11d.c deleted file mode 100755 index 4bc46a60ae2f..000000000000 --- a/drivers/net/wireless/mv8686/11d.c +++ /dev/null @@ -1,698 +0,0 @@ -/** - * This file contains functions for 802.11D. - */ -#include -#include -#include - -#include "host.h" -#include "decl.h" -#include "11d.h" -#include "dev.h" -#include "wext.h" - -#define TX_PWR_DEFAULT 10 - -static struct region_code_mapping region_code_mapping[] = { - {"US ", 0x10}, /* US FCC */ - {"CA ", 0x10}, /* IC Canada */ - {"SG ", 0x10}, /* Singapore */ - {"EU ", 0x30}, /* ETSI */ - {"AU ", 0x30}, /* Australia */ - {"KR ", 0x30}, /* Republic Of Korea */ - {"ES ", 0x31}, /* Spain */ - {"FR ", 0x32}, /* France */ - {"JP ", 0x40}, /* Japan */ -}; - -/* Following 2 structure defines the supported channels */ -static struct chan_freq_power channel_freq_power_UN_BG[] = { - {1, 2412, TX_PWR_DEFAULT}, - {2, 2417, TX_PWR_DEFAULT}, - {3, 2422, TX_PWR_DEFAULT}, - {4, 2427, TX_PWR_DEFAULT}, - {5, 2432, TX_PWR_DEFAULT}, - {6, 2437, TX_PWR_DEFAULT}, - {7, 2442, TX_PWR_DEFAULT}, - {8, 2447, TX_PWR_DEFAULT}, - {9, 2452, TX_PWR_DEFAULT}, - {10, 2457, TX_PWR_DEFAULT}, - {11, 2462, TX_PWR_DEFAULT}, - {12, 2467, TX_PWR_DEFAULT}, - {13, 2472, TX_PWR_DEFAULT}, - {14, 2484, TX_PWR_DEFAULT} -}; - -static u8 lbs_region_2_code(u8 *region) -{ - u8 i; - - for (i = 0; region[i] && i < COUNTRY_CODE_LEN; i++) - region[i] = toupper(region[i]); - - for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) { - if (!memcmp(region, region_code_mapping[i].region, - COUNTRY_CODE_LEN)) - return (region_code_mapping[i].code); - } - - /* default is US */ - return (region_code_mapping[0].code); -} - -static u8 *lbs_code_2_region(u8 code) -{ - u8 i; - - for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) { - if (region_code_mapping[i].code == code) - return (region_code_mapping[i].region); - } - /* default is US */ - return (region_code_mapping[0].region); -} - -/** - * @brief This function finds the nrchan-th chan after the firstchan - * @param band band - * @param firstchan first channel number - * @param nrchan number of channels - * @return the nrchan-th chan number -*/ -static u8 lbs_get_chan_11d(u8 firstchan, u8 nrchan, u8 *chan) -/*find the nrchan-th chan after the firstchan*/ -{ - u8 i; - struct chan_freq_power *cfp; - u8 cfp_no; - - cfp = channel_freq_power_UN_BG; - cfp_no = ARRAY_SIZE(channel_freq_power_UN_BG); - - for (i = 0; i < cfp_no; i++) { - if ((cfp + i)->channel == firstchan) { - lbs_deb_11d("firstchan found\n"); - break; - } - } - - if (i < cfp_no) { - /*if beyond the boundary */ - if (i + nrchan < cfp_no) { - *chan = (cfp + i + nrchan)->channel; - return 1; - } - } - - return 0; -} - -/** - * @brief This function Checks if chan txpwr is learned from AP/IBSS - * @param chan chan number - * @param parsed_region_chan pointer to parsed_region_chan_11d - * @return TRUE; FALSE -*/ -static u8 lbs_channel_known_11d(u8 chan, - struct parsed_region_chan_11d * parsed_region_chan) -{ - struct chan_power_11d *chanpwr = parsed_region_chan->chanpwr; - u8 nr_chan = parsed_region_chan->nr_chan; - u8 i = 0; - - lbs_deb_hex(LBS_DEB_11D, "parsed_region_chan", (char *)chanpwr, - sizeof(struct chan_power_11d) * nr_chan); - - for (i = 0; i < nr_chan; i++) { - if (chan == chanpwr[i].chan) { - lbs_deb_11d("found chan %d\n", chan); - return 1; - } - } - - lbs_deb_11d("chan %d not found\n", chan); - return 0; -} - -u32 lbs_chan_2_freq(u8 chan) -{ - struct chan_freq_power *cf; - u16 i; - u32 freq = 0; - - cf = channel_freq_power_UN_BG; - - for (i = 0; i < ARRAY_SIZE(channel_freq_power_UN_BG); i++) { - if (chan == cf[i].channel) - freq = cf[i].freq; - } - - return freq; -} - -static int generate_domain_info_11d(struct parsed_region_chan_11d - *parsed_region_chan, - struct lbs_802_11d_domain_reg *domaininfo) -{ - u8 nr_subband = 0; - - u8 nr_chan = parsed_region_chan->nr_chan; - u8 nr_parsedchan = 0; - - u8 firstchan = 0, nextchan = 0, maxpwr = 0; - - u8 i, flag = 0; - - memcpy(domaininfo->countrycode, parsed_region_chan->countrycode, - COUNTRY_CODE_LEN); - - lbs_deb_11d("nrchan %d\n", nr_chan); - lbs_deb_hex(LBS_DEB_11D, "parsed_region_chan", (char *)parsed_region_chan, - sizeof(struct parsed_region_chan_11d)); - - for (i = 0; i < nr_chan; i++) { - if (!flag) { - flag = 1; - nextchan = firstchan = - parsed_region_chan->chanpwr[i].chan; - maxpwr = parsed_region_chan->chanpwr[i].pwr; - nr_parsedchan = 1; - continue; - } - - if (parsed_region_chan->chanpwr[i].chan == nextchan + 1 && - parsed_region_chan->chanpwr[i].pwr == maxpwr) { - nextchan++; - nr_parsedchan++; - } else { - domaininfo->subband[nr_subband].firstchan = firstchan; - domaininfo->subband[nr_subband].nrchan = - nr_parsedchan; - domaininfo->subband[nr_subband].maxtxpwr = maxpwr; - nr_subband++; - nextchan = firstchan = - parsed_region_chan->chanpwr[i].chan; - maxpwr = parsed_region_chan->chanpwr[i].pwr; - } - } - - if (flag) { - domaininfo->subband[nr_subband].firstchan = firstchan; - domaininfo->subband[nr_subband].nrchan = nr_parsedchan; - domaininfo->subband[nr_subband].maxtxpwr = maxpwr; - nr_subband++; - } - domaininfo->nr_subband = nr_subband; - - lbs_deb_11d("nr_subband=%x\n", domaininfo->nr_subband); - lbs_deb_hex(LBS_DEB_11D, "domaininfo", (char *)domaininfo, - COUNTRY_CODE_LEN + 1 + - sizeof(struct ieeetypes_subbandset) * nr_subband); - return 0; -} - -/** - * @brief This function generates parsed_region_chan from Domain Info learned from AP/IBSS - * @param region_chan pointer to struct region_channel - * @param *parsed_region_chan pointer to parsed_region_chan_11d - * @return N/A -*/ -static void lbs_generate_parsed_region_chan_11d(struct region_channel *region_chan, - struct parsed_region_chan_11d * - parsed_region_chan) -{ - u8 i; - struct chan_freq_power *cfp; - - if (region_chan == NULL) { - lbs_deb_11d("region_chan is NULL\n"); - return; - } - - cfp = region_chan->CFP; - if (cfp == NULL) { - lbs_deb_11d("cfp is NULL \n"); - return; - } - - parsed_region_chan->band = region_chan->band; - parsed_region_chan->region = region_chan->region; - memcpy(parsed_region_chan->countrycode, - lbs_code_2_region(region_chan->region), COUNTRY_CODE_LEN); - - lbs_deb_11d("region 0x%x, band %d\n", parsed_region_chan->region, - parsed_region_chan->band); - - for (i = 0; i < region_chan->nrcfp; i++, cfp++) { - parsed_region_chan->chanpwr[i].chan = cfp->channel; - parsed_region_chan->chanpwr[i].pwr = cfp->maxtxpower; - lbs_deb_11d("chan %d, pwr %d\n", - parsed_region_chan->chanpwr[i].chan, - parsed_region_chan->chanpwr[i].pwr); - } - parsed_region_chan->nr_chan = region_chan->nrcfp; - - lbs_deb_11d("nrchan %d\n", parsed_region_chan->nr_chan); - - return; -} - -/** - * @brief generate parsed_region_chan from Domain Info learned from AP/IBSS - * @param region region ID - * @param band band - * @param chan chan - * @return TRUE;FALSE -*/ -static u8 lbs_region_chan_supported_11d(u8 region, u8 chan) -{ - struct chan_freq_power *cfp; - int cfp_no; - u8 idx; - int ret = 0; - - lbs_deb_enter(LBS_DEB_11D); - - cfp = lbs_get_region_cfp_table(region, &cfp_no); - if (cfp == NULL) - return 0; - - for (idx = 0; idx < cfp_no; idx++) { - if (chan == (cfp + idx)->channel) { - /* If Mrvl Chip Supported? */ - if ((cfp + idx)->unsupported) { - ret = 0; - } else { - ret = 1; - } - goto done; - } - } - - /*chan is not in the region table */ - -done: - lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret); - return ret; -} - -/** - * @brief This function checks if chan txpwr is learned from AP/IBSS - * @param chan chan number - * @param parsed_region_chan pointer to parsed_region_chan_11d - * @return 0 -*/ -static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* - countryinfo, - u8 band, - struct parsed_region_chan_11d * - parsed_region_chan) -{ - u8 nr_subband, nrchan; - u8 lastchan, firstchan; - u8 region; - u8 curchan = 0; - - u8 idx = 0; /*chan index in parsed_region_chan */ - - u8 j, i; - - lbs_deb_enter(LBS_DEB_11D); - - /*validation Rules: - 1. valid region Code - 2. First Chan increment - 3. channel range no overlap - 4. channel is valid? - 5. channel is supported by region? - 6. Others - */ - - lbs_deb_hex(LBS_DEB_11D, "countryinfo", (u8 *) countryinfo, 30); - - if ((*(countryinfo->countrycode)) == 0 - || (countryinfo->len <= COUNTRY_CODE_LEN)) { - /* No region Info or Wrong region info: treat as No 11D info */ - goto done; - } - - /*Step1: check region_code */ - parsed_region_chan->region = region = - lbs_region_2_code(countryinfo->countrycode); - - lbs_deb_11d("regioncode=%x\n", (u8) parsed_region_chan->region); - lbs_deb_hex(LBS_DEB_11D, "countrycode", (char *)countryinfo->countrycode, - COUNTRY_CODE_LEN); - - parsed_region_chan->band = band; - - memcpy(parsed_region_chan->countrycode, countryinfo->countrycode, - COUNTRY_CODE_LEN); - - nr_subband = (countryinfo->len - COUNTRY_CODE_LEN) / - sizeof(struct ieeetypes_subbandset); - - for (j = 0, lastchan = 0; j < nr_subband; j++) { - - if (countryinfo->subband[j].firstchan <= lastchan) { - /*Step2&3. Check First Chan Num increment and no overlap */ - lbs_deb_11d("chan %d>%d, overlap\n", - countryinfo->subband[j].firstchan, lastchan); - continue; - } - - firstchan = countryinfo->subband[j].firstchan; - nrchan = countryinfo->subband[j].nrchan; - - for (i = 0; idx < MAX_NO_OF_CHAN && i < nrchan; i++) { - /*step4: channel is supported? */ - - if (!lbs_get_chan_11d(firstchan, i, &curchan)) { - /* Chan is not found in UN table */ - lbs_deb_11d("chan is not supported: %d \n", i); - break; - } - - lastchan = curchan; - - if (lbs_region_chan_supported_11d(region, curchan)) { - /*step5: Check if curchan is supported by mrvl in region */ - parsed_region_chan->chanpwr[idx].chan = curchan; - parsed_region_chan->chanpwr[idx].pwr = - countryinfo->subband[j].maxtxpwr; - idx++; - } else { - /*not supported and ignore the chan */ - lbs_deb_11d( - "i %d, chan %d unsupported in region %x, band %d\n", - i, curchan, region, band); - } - } - - /*Step6: Add other checking if any */ - - } - - parsed_region_chan->nr_chan = idx; - - lbs_deb_11d("nrchan=%x\n", parsed_region_chan->nr_chan); - lbs_deb_hex(LBS_DEB_11D, "parsed_region_chan", (u8 *) parsed_region_chan, - 2 + COUNTRY_CODE_LEN + sizeof(struct parsed_region_chan_11d) * idx); - -done: - lbs_deb_enter(LBS_DEB_11D); - return 0; -} - -/** - * @brief This function calculates the scan type for channels - * @param chan chan number - * @param parsed_region_chan pointer to parsed_region_chan_11d - * @return PASSIVE if chan is unknown; ACTIVE if chan is known -*/ -u8 lbs_get_scan_type_11d(u8 chan, - struct parsed_region_chan_11d * parsed_region_chan) -{ - u8 scan_type = CMD_SCAN_TYPE_PASSIVE; - - lbs_deb_enter(LBS_DEB_11D); - - if (lbs_channel_known_11d(chan, parsed_region_chan)) { - lbs_deb_11d("found, do active scan\n"); - scan_type = CMD_SCAN_TYPE_ACTIVE; - } else { - lbs_deb_11d("not found, do passive scan\n"); - } - - lbs_deb_leave_args(LBS_DEB_11D, "ret scan_type %d", scan_type); - return scan_type; - -} - -void lbs_init_11d(struct lbs_private *priv) -{ - priv->enable11d = 0; - memset(&(priv->parsed_region_chan), 0, - sizeof(struct parsed_region_chan_11d)); - return; -} - -/** - * @brief This function sets DOMAIN INFO to FW - * @param priv pointer to struct lbs_private - * @return 0; -1 -*/ -static int set_domain_info_11d(struct lbs_private *priv) -{ - int ret; - - if (!priv->enable11d) { - lbs_deb_11d("dnld domain Info with 11d disabled\n"); - return 0; - } - - ret = lbs_prepare_and_send_command(priv, CMD_802_11D_DOMAIN_INFO, - CMD_ACT_SET, - CMD_OPTION_WAITFORRSP, 0, NULL); - if (ret) - lbs_deb_11d("fail to dnld domain info\n"); - - return ret; -} - -/** - * @brief This function setups scan channels - * @param priv pointer to struct lbs_private - * @param band band - * @return 0 -*/ -int lbs_set_universaltable(struct lbs_private *priv, u8 band) -{ - u16 size = sizeof(struct chan_freq_power); - u16 i = 0; - - memset(priv->universal_channel, 0, - sizeof(priv->universal_channel)); - - priv->universal_channel[i].nrcfp = - sizeof(channel_freq_power_UN_BG) / size; - lbs_deb_11d("BG-band nrcfp %d\n", - priv->universal_channel[i].nrcfp); - - priv->universal_channel[i].CFP = channel_freq_power_UN_BG; - priv->universal_channel[i].valid = 1; - priv->universal_channel[i].region = UNIVERSAL_REGION_CODE; - priv->universal_channel[i].band = band; - i++; - - return 0; -} - -/** - * @brief This function implements command CMD_802_11D_DOMAIN_INFO - * @param priv pointer to struct lbs_private - * @param cmd pointer to cmd buffer - * @param cmdno cmd ID - * @param cmdOption cmd action - * @return 0 -*/ -int lbs_cmd_802_11d_domain_info(struct lbs_private *priv, - struct cmd_ds_command *cmd, u16 cmdno, - u16 cmdoption) -{ - struct cmd_ds_802_11d_domain_info *pdomaininfo = - &cmd->params.domaininfo; - struct mrvlietypes_domainparamset *domain = &pdomaininfo->domain; - u8 nr_subband = priv->domainreg.nr_subband; - - lbs_deb_enter(LBS_DEB_11D); - - lbs_deb_11d("nr_subband=%x\n", nr_subband); - - cmd->command = cpu_to_le16(cmdno); - pdomaininfo->action = cpu_to_le16(cmdoption); - if (cmdoption == CMD_ACT_GET) { - cmd->size = - cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN); - lbs_deb_hex(LBS_DEB_11D, "802_11D_DOMAIN_INFO", (u8 *) cmd, - le16_to_cpu(cmd->size)); - goto done; - } - - domain->header.type = cpu_to_le16(TLV_TYPE_DOMAIN); - memcpy(domain->countrycode, priv->domainreg.countrycode, - sizeof(domain->countrycode)); - - domain->header.len = - cpu_to_le16(nr_subband * sizeof(struct ieeetypes_subbandset) + - sizeof(domain->countrycode)); - - if (nr_subband) { - memcpy(domain->subband, priv->domainreg.subband, - nr_subband * sizeof(struct ieeetypes_subbandset)); - - cmd->size = cpu_to_le16(sizeof(pdomaininfo->action) + - le16_to_cpu(domain->header.len) + - sizeof(struct mrvlietypesheader) + - S_DS_GEN); - } else { - cmd->size = - cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN); - } - - lbs_deb_hex(LBS_DEB_11D, "802_11D_DOMAIN_INFO", (u8 *) cmd, le16_to_cpu(cmd->size)); - -done: - lbs_deb_enter(LBS_DEB_11D); - return 0; -} - -/** - * @brief This function parses countryinfo from AP and download country info to FW - * @param priv pointer to struct lbs_private - * @param resp pointer to command response buffer - * @return 0; -1 - */ -int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp) -{ - struct cmd_ds_802_11d_domain_info *domaininfo = &resp->params.domaininforesp; - struct mrvlietypes_domainparamset *domain = &domaininfo->domain; - u16 action = le16_to_cpu(domaininfo->action); - s16 ret = 0; - u8 nr_subband = 0; - - lbs_deb_enter(LBS_DEB_11D); - - lbs_deb_hex(LBS_DEB_11D, "domain info resp", (u8 *) resp, - (int)le16_to_cpu(resp->size)); - - nr_subband = (le16_to_cpu(domain->header.len) - COUNTRY_CODE_LEN) / - sizeof(struct ieeetypes_subbandset); - - lbs_deb_11d("domain info resp: nr_subband %d\n", nr_subband); - - if (nr_subband > MRVDRV_MAX_SUBBAND_802_11D) { - lbs_deb_11d("Invalid Numrer of Subband returned!!\n"); - return -1; - } - - switch (action) { - case CMD_ACT_SET: /*Proc Set action */ - break; - - case CMD_ACT_GET: - break; - default: - lbs_deb_11d("Invalid action:%d\n", domaininfo->action); - ret = -1; - break; - } - - lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret); - return ret; -} - -/** - * @brief This function parses countryinfo from AP and download country info to FW - * @param priv pointer to struct lbs_private - * @return 0; -1 - */ -int lbs_parse_dnld_countryinfo_11d(struct lbs_private *priv, - struct bss_descriptor * bss) -{ - int ret; - - lbs_deb_enter(LBS_DEB_11D); - if (priv->enable11d) { - memset(&priv->parsed_region_chan, 0, - sizeof(struct parsed_region_chan_11d)); - ret = parse_domain_info_11d(&bss->countryinfo, 0, - &priv->parsed_region_chan); - - if (ret == -1) { - lbs_deb_11d("error parsing domain_info from AP\n"); - goto done; - } - - memset(&priv->domainreg, 0, - sizeof(struct lbs_802_11d_domain_reg)); - generate_domain_info_11d(&priv->parsed_region_chan, - &priv->domainreg); - - ret = set_domain_info_11d(priv); - - if (ret) { - lbs_deb_11d("error setting domain info\n"); - goto done; - } - } - ret = 0; - -done: - lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret); - return ret; -} - -/** - * @brief This function generates 11D info from user specified regioncode and download to FW - * @param priv pointer to struct lbs_private - * @return 0; -1 - */ -int lbs_create_dnld_countryinfo_11d(struct lbs_private *priv) -{ - int ret; - struct region_channel *region_chan; - u8 j; - - lbs_deb_enter(LBS_DEB_11D); - lbs_deb_11d("curbssparams.band %d\n", priv->curbssparams.band); - - if (priv->enable11d) { - /* update parsed_region_chan_11; dnld domaininf to FW */ - - for (j = 0; j < ARRAY_SIZE(priv->region_channel); j++) { - region_chan = &priv->region_channel[j]; - - lbs_deb_11d("%d region_chan->band %d\n", j, - region_chan->band); - - if (!region_chan || !region_chan->valid - || !region_chan->CFP) - continue; - if (region_chan->band != priv->curbssparams.band) - continue; - break; - } - - if (j >= ARRAY_SIZE(priv->region_channel)) { - lbs_deb_11d("region_chan not found, band %d\n", - priv->curbssparams.band); - ret = -1; - goto done; - } - - memset(&priv->parsed_region_chan, 0, - sizeof(struct parsed_region_chan_11d)); - lbs_generate_parsed_region_chan_11d(region_chan, - &priv-> - parsed_region_chan); - - memset(&priv->domainreg, 0, - sizeof(struct lbs_802_11d_domain_reg)); - generate_domain_info_11d(&priv->parsed_region_chan, - &priv->domainreg); - - ret = set_domain_info_11d(priv); - - if (ret) { - lbs_deb_11d("error setting domain info\n"); - goto done; - } - - } - ret = 0; - -done: - lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret); - return ret; -} diff --git a/drivers/net/wireless/mv8686/11d.h b/drivers/net/wireless/mv8686/11d.h deleted file mode 100755 index 4f4f47f0f878..000000000000 --- a/drivers/net/wireless/mv8686/11d.h +++ /dev/null @@ -1,104 +0,0 @@ -/** - * This header file contains data structures and - * function declarations of 802.11d - */ -#ifndef _LBS_11D_ -#define _LBS_11D_ - -#include "types.h" -#include "defs.h" - -#define UNIVERSAL_REGION_CODE 0xff - -/** (Beaconsize(256)-5(IEId,len,contrystr(3))/3(FirstChan,NoOfChan,MaxPwr) - */ -#define MRVDRV_MAX_SUBBAND_802_11D 83 - -#define COUNTRY_CODE_LEN 3 -#define MAX_NO_OF_CHAN 40 - -struct cmd_ds_command; - -/** Data structure for Country IE*/ -struct ieeetypes_subbandset { - u8 firstchan; - u8 nrchan; - u8 maxtxpwr; -} __attribute__ ((packed)); - -struct ieeetypes_countryinfoset { - u8 element_id; - u8 len; - u8 countrycode[COUNTRY_CODE_LEN]; - struct ieeetypes_subbandset subband[1]; -}; - -struct ieeetypes_countryinfofullset { - u8 element_id; - u8 len; - u8 countrycode[COUNTRY_CODE_LEN]; - struct ieeetypes_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D]; -} __attribute__ ((packed)); - -struct mrvlietypes_domainparamset { - struct mrvlietypesheader header; - u8 countrycode[COUNTRY_CODE_LEN]; - struct ieeetypes_subbandset subband[1]; -} __attribute__ ((packed)); - -struct cmd_ds_802_11d_domain_info { - __le16 action; - struct mrvlietypes_domainparamset domain; -} __attribute__ ((packed)); - -/** domain regulatory information */ -struct lbs_802_11d_domain_reg { - /** country Code*/ - u8 countrycode[COUNTRY_CODE_LEN]; - /** No. of subband*/ - u8 nr_subband; - struct ieeetypes_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D]; -}; - -struct chan_power_11d { - u8 chan; - u8 pwr; -} __attribute__ ((packed)); - -struct parsed_region_chan_11d { - u8 band; - u8 region; - s8 countrycode[COUNTRY_CODE_LEN]; - struct chan_power_11d chanpwr[MAX_NO_OF_CHAN]; - u8 nr_chan; -} __attribute__ ((packed)); - -struct region_code_mapping { - u8 region[COUNTRY_CODE_LEN]; - u8 code; -}; - -struct lbs_private; - -u8 lbs_get_scan_type_11d(u8 chan, - struct parsed_region_chan_11d *parsed_region_chan); - -u32 lbs_chan_2_freq(u8 chan); - -void lbs_init_11d(struct lbs_private *priv); - -int lbs_set_universaltable(struct lbs_private *priv, u8 band); - -int lbs_cmd_802_11d_domain_info(struct lbs_private *priv, - struct cmd_ds_command *cmd, u16 cmdno, - u16 cmdOption); - -int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp); - -struct bss_descriptor; -int lbs_parse_dnld_countryinfo_11d(struct lbs_private *priv, - struct bss_descriptor * bss); - -int lbs_create_dnld_countryinfo_11d(struct lbs_private *priv); - -#endif diff --git a/drivers/net/wireless/mv8686/ChangeLog.txt b/drivers/net/wireless/mv8686/ChangeLog.txt deleted file mode 100755 index 11a07e7b3bbb..000000000000 --- a/drivers/net/wireless/mv8686/ChangeLog.txt +++ /dev/null @@ -1,716 +0,0 @@ -# -# Created by Yongle Lai in 2010-09-08 -# - -#****************************************************************************# - -1. ¿ÉÒÔͨ¹ýÈçÏÂÃüÁî²é¿´µ±Ç°Ë¯ÃßËøµÄÇé¿ö£º - echo android_power_print_locks,0xf > /sys/scu/24m/active - »ò - cat /proc/wakelocks - -#****************************************************************************# - -============================================================================== -=== Version 2.35 @ 2010-12-31 === -============================================================================== - -1. ½«Æô¶¯º¯ÊýºÍжÔغ¯Êý£¬Ä¿Ç°ÊÇΪRK28ºÍRK29·ÖΪ2Ì×£¬¿ÉÒÔ½«ÆäºÏΪһÌס£ - =>ÔÚRK29ÖУ¬ÐèÒªÔÚboard-rk29sdk.cÖеÄÒ»¸öº¯Êý£º - rk29sdk_wifi_set_carddetect - ÉèΪ·Çstatic£¬²¢ÓÃEXPORT_SYMBOLÅ׳ö¡£ - -2. ÔÚwext.cÖÐÈ¥³ý£º#if (ANDROID_POWER_SAVE == 1) Ïà¹ØµÄËùÓÐÄÚÈÝ¡£ - -3. È¥³ýwext.cÖÐµÄ - lbs_do_ioctl - lbs_ioctl_setget_oneint - lbs_auto_deep_sleep - lbs_deepsleep_ioctl - lbs_set_deepsleep - lbs_is_command_allowed - ½Ó¿Úº¯Êý¡£ - -4. -============================================================================== -=== Version 2.34 @ 2010-12-23 === -============================================================================== - -1. µ±WIFIÇý¶¯ÒÔÄ£¿é·½Ê½¼ÓÔغͱàÒëʱ£¬GPIOÏà¹ØµÄº¯ÊýÒòΪûÓÐÅ׳ö¶øµ÷Óò»µ½¡£ - ÔÚwifi_power_ops.cÖн«GPIOÏà¹Ø²Ù×÷ÐÞ¸ÄÈçÏ£º - gpio_direction_output(gpio->gpio_id, GPIO_OUT); - __gpio_set(gpio->gpio_id, sensitive); - -2. ÐèÒªÌí¼Ó¶Ô2.6.32Äں˵ÄÖ§³Ö£¬ÒòΪRK29ʹÓõÄÊÇ2.6.32Äں˵ÄLinux¡£ - -3. ÔÚµçÔ´¹ÜÀí»úÖÆÖУ¬½«¶¨Ê±Æ÷ÉèÖÃΪ10Ã룬 - #define TIMER_INTERVAL 10000 - »áÒýÆðµÄÒ»¸öÎÊÌâÊÇ£¬ÔÚIDLEʱ£¬È¥µã»÷ÍøÒ³£¬ÓÉÓÚÊÇÔÚÊ¡µç»úÖÆÏ£¬ËùÒÔÍøÂçÏ൱ - Âý£¬¿´À´´ÓIDLE±äΪBUSY£¬ÐèÒªÓнϿìµÄ·´Ó¦Ëٶȡ£ - - ¶ø´ÓIDLEתΪBUSY£¬ÔòÐèÒª³¤Ò»Ð©µÄ·´Ó¦Ê±¼ä¡£ - - ÏÖ½«Õâ¸öʱ¼ä¼ä¸ô¸ÄΪ3Ã룬¼´´ÓIDLE±äΪBUSY£¬Ö»ÐèÒª3Ã룬·´¹ýÀ´ÎÒÃÇÉèΪ15Ãë¡£ - -4. ·¢ÏÖÁËÒ»¸öBUG£ºµ±Á¬½ÓAPʱ»á·¢ÉúµôÏßÖØÁ¬£¬ÕâÖÖÇé¿öÏÂËøµÄ״̬»ú²»ÕýÈ·¡£ - (1)ÔÚpower_save_suspend / resumeÖУ¬²¢Ã»ÓгɶԳöÏÖ¡£ - (2)ÔÚPower save SUSPENDÖУ¬È¥µô¼ÓËøµÄ²Ù×÷¡£ - (3)ÔÚ½¨Á¢Á¬½Ó¿ªÊ¼µÄ״̬SYN_SENT£¬ÎÒÃÇÒ²ÐèÒªÈÏΪÍøÂ翪ʼæÁË£¬¹Ø±ÕÊ¡µçģʽ¡£ - (4)µ±ÍøÂç״̬Ϊ¿ÕÏУ¬Õâʱ¼ì²éµ½UDPÁ¬½Ó£¬ÔÚ´ò¿ªÍøÒ³Çé¿öÏ£¬ÎªDNSÇëÇó£¬ÎÒÃÇ - ÔÚÕâÖÖÇé¿öÏ£¬Ó¦¸ÃÂíÉϽ«ÍøÂçת»»ÎªÃ¦×´Ì¬¡£ - -============================================================================== -=== Version 2.33 @ 2010-12-23 === -============================================================================== - -1. ÓÐÓû§ÐèÒª½«MACµØÖ·É趨³É×ÔÒѵĶΣ¬Õâ¾ÍÒªÇóÎÒÃÇÇý¶¯¿ÉÒÔ»ñÈ¡¿Í»§µÄMACµØÖ·£¬ - ²¢½«ÆäÉ趨µ½FWºÍHOST DRIVERÖС£ - (1)ÐèҪʹÓÃÌض¨µÄLoader£ºBootloader version: 2010-12-22#90.04 - (2)ÐèÒªºÏ²¢ÃÀÓÑÌṩÁËdrivers/scu/rk28_kld.cÎļþ£¬Ìí¼Ó¶ÁMACµØÖ·µÄ¹¦ÄÜ£º - Ìí¼ÓMAC¶ÔÓ¦µÄMagicÊýºÍÊý¾Ý½á¹¹£¬Ìí¼ÓÒ»¸ö¶ÁMACµÄº¯Êý¡£ - (3)ÐÞ¸Äwifi_config.c£¬Ìí¼Ó´ÓKLDÖжÁÈ¡MAC½Ó¿ÚµÄº¯Êý£¬¼´ÈÃÓû§¿ÉÒÔ×Ô¶¨ÒåMAC - µØÖ·µÄ½Ó¿Úº¯Êý£¬¸ø³öÒ»¸ö¿É×Ô¶¨ÒåµÄ½Ó¿Ú¡£ - (4)ÔÚmain.cµÄlbs_setup_firmwareº¯Êýĩ⣬ÎÒÃÇÉ趨еÄMACµØÖ·¡£ - - ·¢ÏÖͨ¹ýPING°ü£¬µÚÒ»´ÎÆðÀ´Ê±ÎÒÃÇ¿´²»µ½Ê¹ÓÃеÄMACµØÖ·£¬ - =>½«ÕâÒ»²Ù×÷·Åµ½lbs_setup_firmware֮ǰ½øÐС£Ò²²»ÐУ¬¿´À´²»ÊÇλÖÃÎÊÌâ¡£ - =>lbs_set_mac_addressº¯ÊýµÄaddr²ÎÊý²¢²»ÊǼòµ¥µÄMAC£¬¶øÊÇstruct sockaddr *¡£ - =>ÔÚset_macaddressºó¼ÓÈçÏÂ2¾äÔòҲûÎÊÌ⣺ - //memcpy(priv->current_addr, mac, ETH_ALEN); - //memcpy(priv->dev->dev_addr, mac, ETH_ALEN); - =>ÕýÈ·µÄÓ÷¨Ó¦¸ÃÈçÏ£º - { - struct sockaddr addr; - u8 * mac = (u8 *)(addr.sa_data); - - if (wifi_customized_mac_addr(mac) == 1) - { - lbs_set_mac_address(priv->dev, &addr); - } - } - -============================================================================== -=== Version 2.32 @ 2010-12-18 === -============================================================================== - -============================================================================== -=== Version 2.31 @ 2010-12-17 === -============================================================================== - -1. Ìí¼Ó¶à²¥MulticastµÄÖ§³Ö¡£ - ´Ó2.6.31µÄ´úÂëÖÐÖ±½Ó¿½±´¹ýÀ´¡£ - (1)ÔÚÄ¿±ê°åÉÏÖ´ÐÐmcast_client£º - setsockopt: IP_ADD_MEMBERSHIP : No such device - - =>ÔÚÄÚºËÀï¼ÓÉÏ[*] IP: multicastingÑ¡Ïî¡£ - ÈÔÈ»±¨Í¬ÑùµÄ´íÎó¡£(Õâ¸öÑ¡Ïî²»´ò¿ª£¬ÈÔÈ»¿ÉÒÔÊÕµ½¶à²¥°ü¡£) - - =>route add default gw 192.168.1.1 - ¾Í¿ÉÒÔÕý³£ÔËÐÐÁË¡£ - - (2)·¢Ïֶಥ°üÓм¸¸öÌص㣺 - A. ÈÝÒ׶ª°ü£¬ÔÚÊ¡µçģʽÇé¿öÏ£¬·Ç³£ÈÝÒ׶ª°ü¡£ - B. ÔڶಥӦÓÃÖУ¬ÓÉÓÚûÓй̶¨µÄÁ¬½Ó£¬Òò¶øÎÞ·¨È·¶¨ÍøÂç´¦ÓÚæµÄ״̬¡£ - -2. Õë¶Ô¶à²¥½øÐеÄÊ¡µç»úÖƲâÊÔ£º - (1)µ±ÓжಥÁ¬½Ó£¬ÇÒÓÐÊý¾ÝÁ÷Á¿Ê±£¬ÎÒÃÇÈÏΪÍøÂçÊÇæµÄ¡£ - =>Ô­À´ÎÒÈÏΪֻҪµ¥ÏòûÓÐÊý¾ÝÁ÷£¬¼´¿ÉÈÏΪÍøÂç²»ÊÇæµÄ£¬ÕâÊÇÒòΪ֮ǰÓö - µ½ÎÞ·¨ÐÝÃßµÄÎÊÌâʱ£¬»áÓÐÊÕµ½¹ã²¥°ü»òÊÇARP°üµÈ£¬Ó°ÏìÁËÎÒÃǵÄÅжϡ£ - =>ÔڶಥµÄ¿Í»§¶Ë¹¤×÷ʱ£¬Ö»»áÓнÓÊÕ£¬²»»áÓз¢ËÍ£¬ËùÒÔÕë¶ÔÕâÖÖÇé¿öÎÒÃÇÐè - ÒªÐÞ¸ÄÅжϻúÖÆ£¬¼´Á÷Á¿²»Äܼòµ¥µØÇø·ÖÓкÍÎÞ£¬Ò²²»ÄÜÒÔµ¥ÏòΪÒÀ¾Ý¡£ - =>´Ó¶à²¥µÄ²âÊÔÇé¿öÀ´¿´£¬ÔÚ·þÎñ¶ËÒÔ1ÃëÖÓ·¢ËÍÒ»¸ö°üµÄËÙÂÊ£¬ÔÚWIFIÕâ¶Ë£¬Èç - ¹ûÊÇÔÚPS-POLL´ò¿ªµÄÇé¿öÏ£¬ÔòÔÚ10ÃëÄÚÊÕµ½2¸ö°üµÄ¸ÅÂʽϴó£¬ÊÕµ½3¸ö°üµÄ - ¸ÅÂʽÏС¡£Ä¿Ç°½«Õâ¸ö·§ÖµÉ趨Ϊ3£¬Öµ½ÏСÔòÅÂÓë¹ã²¥°üºÍARP°ü»ìÔÚÒ»Æð¡£ - - (2)¶à²¥¿Í»§¶Ë¿ªÆôʱ£¬»áÓÐÈçÏÂÁ¬½Ó£º - udp 0 0 0.0.0.0:9000 0.0.0.0:* - -============================================================================== -=== Version 2.30 @ 2010-12-14 === -============================================================================== - -1. Ìí¼Ó²¢ÑéÖ¤¶ÔADHOCÍøÂçµÄÖ§³Ö¡£ - (1)ͨ¹ýiwlistÊÇ¿ÉÒÔɨÃèµ½ADHOCÀàÐ͵ÄAPµÄ£¬µ«ÊǹØÁª²»ÉÏ¡£ - -EINVAL; - (2)¿ÉÄÜÊÇÈí¼þ¸üеÄÎÊÌ⣬¹ØÁªÃüÁîûÓÐÎÊÌâ¡£ - iwlist wlan0 scanning - iwconfig wlan0 mode ad-hoc - iwconfig wlan0 essid adhoclai - ÕâÊÇ´ÓÎÒÃÇÕâÒ»¶ËÈ¥¹ØÁªÁíÒ»¶Ë¡£ - - iwconfig wlan0 mode ad-hoc - iwconfig wlan0 essid lai - ÕâÑù¾Í¿ÉÒÔÈñðÈËËÑË÷µ½Ò»¸öÃûΪlaiµÄADHOCÃû³ÆÁË¡£ - - (3)ÑéÖ¤ADHOCÍøÂçÔÚWEP¼ÓÃÜ·½Ê½ÏµÄÓ¦Óᣠ- A. ½«adhoclaiÉèÖÃΪWEP OPENµÄ·½Ê½£¬ÃÜÔ¿ÊÇ12345£¬Ã»ÓÐÎÊÌ⣬¿ÉÕý³£PINGͨ¡£ - =>ÓмÓÃÜ·½Ê½Ï£¬»á¶ª°ü£¬µ«¶ª°üÂʲ»´ó¡£ - B. ½«adhoclaiÉèÖÃΪWEP SHAREDµÄ·½Ê½£¬ÃÜÔ¿ÊÇ12345£¬Ã»ÓÐÎÊÌâ¡£ - iwconfig wlan0 key s:12345 - iwconfig wlan0 key restricted - - (4)ÑéÖ¤Ö§³Öͨ¹ýwpa_supplicant¹ØÁªADHOCÍøÂç¡£ - =>wpa_supplicant×ÜÊǻὫÍøÂç½Ó¿ÚÀàÐ͸ü¸ÄΪManaged£¬¶ø²»ÊÇad-hocÀàÐÍ¡£ - =>ÔÚwpa_supplicantÖУ¬ÔÚ±éÀúAPÁбíʱ£¬×ÜÊǽ«IBSSÀàÐ͵ÄAPºöÂÔµô¡£ - ÐÞ¸Äevents.cÖеÄwpa_supplicant_select_bssº¯Êý: - Èç¹ûÊÇIBSSÀàÐ͵ÄAP£¬Í¬Ê±ÒªÑ¡ÔñµÄģʽ²»ÊÇIBSSʱ£¬²Å½«Õâ¸öAPºöÂÔ¡£ - - ³É¹¦: ¿ÉÒÔ¹ØÁªÉÏIBSSµÄAPÁË¡£ - -============================================================================== -=== Version 2.29 @ 2010-12-07 === -============================================================================== - -²»ÖªµÀΪʲô£¬¼Ç¼ûÓб£´æÏÂÀ´¡£ - -============================================================================== -=== Version 2.28 @ 2010-12-03 === -============================================================================== - -1. Ö»ÓÐÔÚTCPÓÐÓÐЧÁ¬½Óʱ£¬ÎÒÃDzÅȥͳ¼ÆÁ÷Á¿¡£µ±UDPÓÐÁ¬½Óʱ£¬ÎÒÃǾÍÈÏΪÍøÂç´¦ÓÚ - æ״̬£¬²»È¥Í³¼ÆÁ÷Á¿¡£ - -2. ÔÚscan.cÖн«ADHOCÏà¹ØµÄÐźÅÓï¾äÈ¥µôʱ£¬²»Ð¡ÐĽ« - start = iwe_stream_add_event(start, stop, &iwe, IW_EV_QUAL_LEN); - Ò²×¢Ê͵ôÁË£¬Ôì³ÉÁËÔÚɨÃèÁбíÖÐÏÔʾµÄÐźÅÖµ²»×¼È·£¬ÎªÈ«0Öµ¡£ - -============================================================================== -=== Version 2.27 @ 2010-11-25 === -============================================================================== - -1. ÊÀ½¡Apple±¨¸æÒ»¸öÎÊÌ⣺ - ÔÚWIFIÐÝÃߺ󣬽«AP¹Ø±Õ»òÊÇ×ßµ½WIFIûÓÐÐźŵĵط½£¬»½ÐѺó»òÊǻص½·þÎñÇøºó£¬ - WIFIµÄÐźÅָʾûÓиı䣬¶øÇÒÏÔʾµÄ״̬ΪÁ¬½Ó£¬µ«ÎÞ·¨Á¬½ÓÍøÂç¡£ - =>ÒòΪÏÖÔÚ˯Ãßʱ»á½«ÍøÂç¶Ï¿ª£¬¶ø»½ÐѺóµÚÒ»¼þÊÂÊÇÈÃÆäÐźÅÏûʧ£¬ - =>ËùÒÔÕâ¸öÎÊÌâÊDz»´æÔڵġ£ - -2. ·¢ÏÖÓÐ˯Ãß²»Á˵ÄÇé¿ö£º - 74.125.153.188:5228 ESTABLISHED ÕâÊÇGoogleµÄÍøÕ¾£¬ÔÚÃÀ¹ú¡£ - ͨ¹ýifconfig²é¿´£¬Ã¿¸ô¼¸ÃëÖÓ»áÓÐÊý¾Ý°üÓɵ½£¬µ«Ã»Óз¢ËÍ¡£ - tcp 0 1 192.168.0.245:56599 64.233.181.100:443 CLOSE_WAIT - tcp 0 1 192.168.0.245:58436 64.233.181.100:80 CLOSE_WAIT - tcp 0 1 192.168.0.245:60600 64.233.181.138:443 CLOSE_WAIT - tcp 0 0 192.168.0.245:49446 74.125.153.188:5228 ESTABLISHED - Ç°3¸öÒªÔÚ¾­Àú3·ÖÖÓ×óÓҲŻá¶Ï¿ªÁ¬½Ó£¬¶ø×îºóÒ»¸öÔò×ÜÊDz»¿Ï¶Ï¿ªÁ¬½Ó¡£ - =>¹ýÁËÒ»¸öÍíÉ϶¼Ã»ÓжϿªÁ¬½Ó¡£»áÓÐÊý¾Ý°üÊÕ·¢£¬µ«ÊǺÜÉÙ¡£ - =>¼øÓÚÕâÖÖÇé¿ö£¬ÎÒÃÇÐèÒª¼à¿ØÍøÂçÊÕ·¢Êý¾Ý°üÁ÷Á¿£¬µ±Á÷Á¿Ð¡ÓÚÒ»¶¨ÖµÊ±£¬½«ÆäÊÓ - Ϊ¿ÕÏÐ״̬£¬ÊÍ·Å˯ÃßËø¡£ - =>¶ÔÓÚÕâ¸öIPµØÖ·µÄÁ¬½Ó£¬·¢Ïֺܳ¤Ê±¼ä¶¼Ö»ÓнÓÊÕ£¬¶øûÓз¢ËÍ£¬ÏñÊÇ·þÎñ¶ËÒ»Ñù£¬ - ²»¹ÜÈçºÎ£¬Ö»Òª²»ÊÇË«ÏòÓÐÊý¾Ý£¬Ò»¶Îʱ¼äºóÎÒÃǾͻὫÆäÈÏΪÊÇIDLEÁ¬½Ó¡£ - - =>ÏÖÔڵĴ¦Àí·½Ê½ÈçÏ£¬Èç¹ûÔÚ30ÃëÄÚûÓÐTX»òRX£¬ÔòÎÒÃÇÈÏΪWIFI¿ÉÒÔ±»ÖÃΪIDLE - ÁË£¬ÊÍ·Å˯ÃßËø£¬ÒÔÈÃϵͳ¿ÉÒÔ½øÈë¶þ¼¶Ë¯Ãß¡£ - -============================================================================== -=== Version 2.26 @ 2010-11-19 === -============================================================================== - -½â¾öSSIDÖк¬ÓÐÖÐÎÄ×Ö·ûµÄÏÔʾ¼°¹ØÁªÎÊÌâ¡£ - -1. »ų́²»ÄÜÏÔʾº¬ÓÐÖÐÎÄÃüÃûµÄ·ÓÉÆ÷£¬¶øÇÒ»ų́ҲÁ¬½Ó²»ÉϺ¬ÓÐÖÐÎÄÃüÃûµÄÍøÂç¡£ - =>ͨ¹ýiwlist¿ÉÒÔɨÃèµ½´øÓÐÖÐÎĵÄAP¡£ - =>ÔÚWIFIÉèÖýçÃæÖУ¬APÃû³ÆÖеÄÖÐÎı»ÏÔʾ³ÉÏ»®Ïß¡£ - =>WPA_SUPPÖеÄÁбíΪ£º - d8:5d:4c:38:86:48 2437 232 [WEP] tplink__ - =>Õâ˵Ã÷ÔÚÇý¶¯Öв¢Ã»ÓжÔɨÃèÁбíÖеÄAPÃû³Æ×öÏÞÖÆ£¬ÎÊÌâÔÚWPA_SUPPÉÏ¡£ - =>ÐÞ¸ÄWPA_SUPPÖÐcommon.cÖеÄwpa_ssid_txtº¯Êý£¬²»×ö×Ö·ûÀàÐ͵ÄÏÞÖÆ¡£ - WPA_SUPPÖпÉÒÔÏÔʾÖÐÎÄÃûÁË¡£ - =>µ«ÔÚAndroidÖн«ÏÔʾ³ÉÁËtplink5ÁË£¬Ó¦¸ÃÊDZ¾µØ»¯µÄÎÊÌ⣬ÔÚAndroidÖпÉÄÜʹÓà - µÄÊÇUNICODE£¬ÕâÐèÒª×öת»»¡£ - =>ÔÚÇý¶¯Öн«º¬ÖÐÎĵÄSSID´òÓ¡³öÀ´£º - tplinkÀµ = SSID=74 70 6c 69 6e 6b c0 b5 - ÆäÖÐC0 B5ÊÇÀµµÄGB2312±àÂ룬µ±È»GBKÒ²ÊÇÕâ¸ö±àÂë¡£ - =>ÔÚÇý¶¯ÖУ¬Ö±½Ó½«"tplinkÀµ"ת»»ÎªUTF-8±àÂ룬ÔÚAndroidÖоͿÉÒÔÏÔʾÖÐÎÄÁË¡£ - //UTF-8 - bss->ssid[6] = 0xE8; - bss->ssid[7] = 0xB5; - bss->ssid[8] = 0x96; - =>ÔÚÇý¶¯ÖÐÖ±½ÓʹÓÃUnicode±àÂ룺²»ÐС£ - //Unicode - bss->ssid[6] = 0x8D; - bss->ssid[7] = 0x56; - =>¿´À´Ö»ÄÜʹÓÃUTF-8±àÂëÁË¡£ - -2. ΪÁ˲»¸Ä±äAndroid£¬ÔÝʱ½«¶ÔGB2312µÄÖ§³Ö·Åµ½MV8686µÄÇý¶¯ÖÐʵÏÖ£¬µÈ¹¦ÄÜÑéÖ¤Íê - ³Éºó½«ÊÊ»ú·Åµ½WPA_SUPPÖÐʵÏÖ£¬ÒÔ±ÜÃâWIFI±äµÃÌ«¶à£¬ÕâÖÖ¹¦Äܱ¾ÉíÔÚÓ¦ÓòãʵÏÖ - ½ÏΪºÏÊÊ£¬ÒòΪÇý¶¯ÐèÒªÔËÐкܿ졣 - (1)¶ÔɨÃèµ½µÄAP£¬ÐèÒª½«ÆäSSID½øÐÐת»»¡£ - =>ÕâÀïÉæ¼°µ½Ò»¸ö±È½ÏÂé·³µÄÎÊÌâÊÇ£¬80211ЭÒéÕ»¶ÔSSIDµÄ³¤¶ÈÏÞÖÆΪ32¸ö×Ö·û¡£ - ÔÚTPLINK WR941NÖУ¬ÏÞÖƵÄÊÇ32¸ö×Ö·û£¬Ò²ÊÇ32¸öºº×Ö£¬¹²64×Ö½Ú¡£ - ¶øIEEE80211_MAX_SSID_LENµÄÏÞÖÆΪ32×Ö½Ú¡£»¹ÓÐÒ»¸ö±äÁ¿IW_ESSID_MAX_SIZE¡£ - ËùÒÔÒªÖ§³Ö - =>ÓÉÓÚÒ»¸öºº×Ö×î¶à¶ÔÓ¦6¸ö×Ö½ÚµÄUTF-8±àÂ룬ËùÒÔ¹²ÐèÒª: 32 * 8 = 256 ×Ö½Ú¡£ - (2)ÔÚset_ssidÖУ¬ÐèÒª½«UTF-8±àÂëµÄSSIDת»»ÎªGB2312±àÂëµÄSSID¡£ - network={ - ssid=e4b880e4ba8ce4b889 - key_mgmt=NONE - priority=168 - } - =>wpa_supplicant»á½«SSIDµÄUTF-8´æ´¢ÎªÈçÉϵĸñʽ¡£ - =>ÔÚset_ssidÖÐÊÕµ½µÄÉèÖÃȷʵΪe4 b8 80 e4 ba 8c e4 b8 89£¬ÕâÊÇÕýÈ·µÄ¡£ - (3)ÐÞ¸ÄÈçÏÂÍ·Îļþ£¬ÒÔ±£Ö¤Ö§³Ö×î´óµÄSSID±¾µØ»¯£º - =>ÐÞ¸Äinclude/linux/ieee80211.h: IEEE80211_MAX_SSID_LEN = 256 - =>ÐÞ¸Äinclude/linux/wireless.h: IW_ESSID_MAX_SIZE = 256 - ======= - ÓÉÓÚÇý¶¯²»Éæ¼°µ½±¾µØ»¯£¬ËùÒÔʵ¼ÊÉÏÎÒÃÇûÓбØÒªÉèÕâô´ó£¬×î´ó32¸öºº×ÖµÄ - »°£¬Ö»ÐèÒª64×Ö½Ú¡£ - =>ÐÞ¸Äinclude/linux/ieee80211.h: IEEE80211_MAX_SSID_LEN = 64 - =>ÐÞ¸Äinclude/linux/wireless.h: IW_ESSID_MAX_SIZE = 64 - -3. ͨ¹ýµÚ2µãÖеÄʵÑéÖ¤Ã÷ÔÚÇý¶¯ÖÐʵÏÖ±¾µØ»¯£¬ÊDz»ºÏÊʵģ¬»áºÜ¸´ÔÓ£¬ÒòΪ¼´Ê¹¿ÉÒÔ - Õýȷת»»£¬ÈÔÈ»ÐèÒªÐÞ¸Äwpa_supplicant£¬ÒòΪÆä´æ´¢Ê±Ê¹ÓÃÁËBLOBµÄ·½Ê½£¬¶ø´ÓÆä - ÅäÖÃÎļþ¶Á³öÀ´ºó£¬Ã»Óн«Æäת»»ÎªGB2312£¬¶øÊǵ±³É´®À´´¦Àí£¬ËùÒÔAndroidµÄÏÔʾ - ÊDz»ÕýÈ·µÄ£¬ËùÒÔ×îÖÕ¾ö¶¨½«±¾µØ»¯µÄÖ§³Ö·Åµ½WPA_SUPPÖÐʵÏÖ¡£ - =>ÔÚwpa_supplicant_ctrl_iface_scan_resultsÖн«ËÑË÷µ½µÄAPµÄSSID¸ÄΪUTF8µÄÐÎ - ʽ£¬ÒÔ±£Ö¤ºº×ÖÔÚAndroidÖпÉÒÔ±»ÕýÈ·ÏÔʾ¡£ - =>ÔÚ´ÓÅäÖÃÎļþÖжÁÈ¡ÍøÂçÅäÖÃÖУ¬½«SSID´ÓBLOBµÄ·½Ê½×ª»»ÎªGB2312µÄ·½Ê½¡£ - ÕâÆäʵӦ¸Ã´ÓAndroidÉèÖõ½WPA_SUPPʱ£¬½«Æäת»»ÎªGB2312¡£ - -4. ͨ¹ýwireless toolsÎÞ·¨ÕýÈ·²Ù×÷ÓÐÖÐÎÄ×Ö·ûµÄSSIDµÄAP¡£ - (1)iwlist¿ÉÒÔÕýÈ·ÏÔʾÓÐÖÐÎĵÄSSIDµÄAP¡£ - (2)ͨ¹ýiwconfig wlan0 essidÎÞ·¨³É¹¦¹ØÁªÉÏAP¡£ - =>assoc_req->mode == IW_MODE_INFRA - ÓÉÓÚÎÒÃǽ«MODEµÄÉèÖ÷½Ê½¸ÄµôÁË£¬ËùÒÔÔÚÏÂESSIDÃüÁîʱ£¬ÐèÒªÏÈÉèÖÃMODE¡£ - iwconfig wlan0 mode managed - (3)iwconfig¿ÉÒÔÕýÈ·ÏÔʾÒѾ­¹ØÁªÉϵÄÓÐÖÐÎÄ×Ö·ûµÄAPÃû×Ö¡£ - (4)PINGÎÞ·¨³É¹¦¡£--ÊÇÒòΪETH0µÄ´æÔÚ£¬¶øÇÒ»¹ÎªÆäÅäÖÃÁËÏàͬÍø¶ÎµÄIPµØÖ·¡£ - =>wireless tools¿ÉÒÔÕýÈ·²Ù×÷ÓÐÖÐÎÄ×Ö·ûµÄAP¡£ - -5. ²âÊÔwpa_supplicant¶ÔÖÐÎĵÄÖ§³Ö¡£ - (1)ÊÖ¶¯Ìí¼ÓÒ»¸öÍøÂç¡£ - add_network - set_network 0 ssid "tplinkÀµ" - save_config - =>Æä»á±»µ±³ÉBLOBµÄ·½Ê½½øÐб£´æ¡£ - ssid=74706c696e6bc0b5 - ÎÒÃÇÐèÒªÈÃÆä±£´æΪGB2312µÄ·½Ê½£¬¶ø²»ÊÇBLOBµÄ·½Ê½¡£ - =>Ìí¼ÓÕë¶ÔSSIDµÄparserºÍwriter£¬¶ÀÁ¢½âÎöSSID×ֶΡ£ - (2)ÊÖ¶¯ÉèÖÃÍøÂçÐèÒªÌí¼Ókey_mgmt=NONE×ֶΡ£ - -============================================================================== -=== Version 2.25 @ 2010-11-16 === -============================================================================== - -1. ´ò¿ªWIFIºóɨÃèÁбí³öµÃ½ÏÂý¡£ - -2. µ±Á¬½ÓWPAµÄAP£¬Èç¹ûÊä´íÃÜÂëµÄ»°£¬ÔòÆä·µ»ØµÄʼþΪ£º - [13586] EVENT: disassociated - µ±Ç°µÄ´¦ÀíÖжÔÓÚÕâһʼþ¾Í»áÈ¥½øÐÐÖØÁª£¬ÆäʵûÓбØÒª¡£ - - [58] lbs_ret_80211_associate: association successfully. - [59] EVENT: disassociated: connected=0 - [59] Trying to re-associate to previous AP. - [59] lbs_cmd_80211_deauthenticate: enter... - [59] lbs_mac_event_disconnected: enter........connect=0 - =>ÒÔÉÏΪµ±Ç°¹ØÁªÊ±µÄ´¦ÀíÁ÷³Ì¡£ - (1)¼´Ê¹·¢Ë͵ĹØÁªÃÜÂë²»ÕýÈ·£¬¹ØÁªÃüÁîÈÔÈ»»á·µ»Ø³É¹¦¡£ - (2)Ëæºó»áÓÐÒ»¸öDISASSOCIATEDµÄʼþ´ÓFWËÍÉÏÀ´¡£ - (3)ÓÉÓÚµÚÒ»²½ÖÐÎÒÃÇÈÏΪ¹ØÁªÒѾ­³É¹¦£¬Òò¶øÕâʱ»á½øÐÐÖØÐÂÁ¬½Ó¡£ - (4)ÖØÐÂÁ¬½Óʱ»áµ÷ÓÃdeauthenticated½øÐÐÁ¬½Ó¶Ï¿ª£¬Çå³ýÁ¬½Ó²ÎÊý¡£ - ²¢ÔÚÆäÖлáµ÷ÓÃdisconnectedÇå³ýÇý¶¯ÖеÄÏà¹ØÉèÖᣠ- - =>ÓÉÒÔÉϵķÖÎöÖУ¬ÎÒÃÇ¿ÉÒÔ¿´³öÎÊÌâËùÔÚ£º - (1)ʵ¼ÊµÄ¹ØÁª½á¹ûÓë¹ØÁªÃüÁîµÄ·µ»Øֵδ±ØÒ»Ö¡£ÕâÓ¦ÊÇ27ÖÐÓöµ½ÎÊÌâµÄÔ­Òò¡£ - - [196] lbs_ret_80211_associate: association successfully. - [197] EVENT: disassociated: connected=0 - [197] lbs_mac_event_disconnected: enter........connect=0 - [202] lbs_ret_80211_associate: association successfully. - [203] EVENT: disassociated: connected=0 - [203] lbs_mac_event_disconnected: enter........connect=0 - =>µã»÷Ò»´ÎÁ¬½Ó£¬»á·¢ËÍ2´Î¹ØÁªÃüÁÕâÈõ¯³öÃÜÂë´íÎó¿òµÄËٶȱäÂý²»ÉÙ¡£ - - =>ÔÚÊÕµ½disassociationʼþʱ£¬ÎÒÃDz»±Ø½øÐÐÖØÁª£¬ÒòΪÔÚ³ö´í³¬Ê±¶Ï¿ªµÈÎÊÌâ - ʱ£¬ÊÕµ½µÄÊÇdisconnectedʼþ¡£¶øÇÒÔÚÎÒÃǵ±Ç°µÄ˯Ãß´¦Àí·½Ê½ÖУ¬Ó¦¸Ã²»ÈÝÒ× - ³öÏÖÕâ¸öʼþ¡£³ý·ÇÒì³£·¢Éú¡£ - -3. ÔÚWEXTÖУ¬ºÜ¶àÉ趨²ÎÊý½Ó¿Ú¶¼»á´¥·¢¹ØÁª²Ù×÷£¬ÕâÊÇû±ØÒªµÄ£º - [557] lbs_set_mode: call lbs_postpone_association_work - [558] lbs_set_auth: call lbs_postpone_association_work - [558] lbs_set_encodeext: call lbs_postpone_association_work - ...... - [558] lbs_set_encodeext: call lbs_postpone_association_work - [558] lbs_set_auth: call lbs_postpone_association_work - ...... - [559] lbs_set_auth: call lbs_postpone_association_work - [559] lbs_set_mode: call lbs_postpone_association_work - [559] lbs_set_genie: call lbs_postpone_association_work - [559] lbs_set_auth: call lbs_postpone_association_work - ...... - [559] lbs_set_auth: call lbs_postpone_association_work - [559] lbs_set_freq: call lbs_postpone_association_work - [559] lbs_set_essid: call lbs_postpone_association_work - [559] lbs_set_wap: call lbs_postpone_association_work - [560] lbs_ret_80211_associate: association successfully. - - =>Ö»ÁôÏÂESSIDºÍWAPÁ½Õß¡£ - (1)Á¬½ÓûÓмÓÃܵÄAP£¬Ã»ÓÐÎÊÌâ¡£ - (2)Á¬½ÓOPEN WEP¼ÓÃܵÄAP£¬ÕýÈ·ÃÜÂëÏÂûÓÐÎÊÌ⣬´íÎóÃÜÂëÏ£¬¹ØÁª³É¹¦£¬»áÒ» - ֱͣÔÚ»ñÈ¡IP´¦£¬²»»áÌáʾ´íÎó£¬ÓÉÓÚAndroid³¬Ê±ºó϶ϿªÃüÁî¡£ - (3)Á¬½ÓSHARED WEP¼ÓÃܵÄAP£¬ÕýÈ·ÃÜÂëÏÂûÓÐÎÊÌ⣬´íÎóÃÜÂëÏ£¬·¢Ë͵ĹØÁª - ÃüÁî»áʧ°Ü£¬µ«ÎÒÃÇ»á½øÐÐÇл»Ä£Ê½È»ºóÖØйØÁª¡£²»»á»ñÈ¡IP£¬×îÖնϿª¡£ - (4)Á¬½ÓWPA¼ÓÃܵÄAP£¬ÕýÈ·ÃÜÂëÏÂÓÐÎÊÌ⣬ - lbs_set_encodeextÖе÷ÓÃlbs_do_association_workµÄµØ·½²»ÄÜÉÙ¡£ - ÃÜÂë´íÎóµÄÇé¿öÏ£¬ÒòΪһֱÔÚÖØÐÂÁ¬½Ó£¬Ö»ÓеȴýAndroid³¬Ê±£¬ËùÒÔÃÜÂë - ´íÎóÌáʾ¿ò²»»á³öÀ´¡£ÃÜÂë´íÎó¿ÉÄÜ·µ»ØdisassociationºÍdisauthenciated¡£ - -4. ¸ÄÉÆAPɨÃèµÄÎÊÌ⣺ - (1)ÔÚWIFIÉèÖÃÒ³ÃæÖУ¬µ±´ò¿ªWIFIʱ£¬APÁбíµÄÏÔʾ¡£ - =>·¢ÏÖ´ò¿ªWIFIºó£¬Çý¶¯ÒѾ­¼ÓÔØÍê³É£¬µ«ÐèÒª3Ãë¶àʱ¼ä²Å»áÊÕµ½É¨ÃèÃüÁÕâ - ½«ÒýÆðWIFI´ò¿ªºóAPÁбíÐèÒª7ÃëÖÓ²ÅÄܳöÏÖ£¬Ì«ÂýÁË¡£ - E/WifiHW ( 713): Unable to open connection to supplicant on - "wlan0": No such file or directory - D/ ( 1119): @@@WPA_SUPPLICANT@@@: main - D/WPA_SUPP( 1119): Setting scan request: 0 sec 100000 usec - D/WPA_SUPP( 1119): wpa_supplicant_scan: ap_scan=1 - D/WPA_SUPP( 1119): Starting AP scan (broadcast SSID) - D/WPA_SUPP( 1119): Trying to get current scan results first without - requesting a new scan to speed up initial association - D/WPA_SUPP( 1119): Setting scan request: 0 sec 0 usec - D/WPA_SUPP( 1119): wpa_supplicant_scan: ap_scan=1 - D/WPA_SUPP( 1119): No enabled networks - do not scan - =>ÉÏÃæµÄLOGÏÔʾÔÚWPA_SUPP»¹Ã»ÓÐÆô¶¯Íê³ÉÇ°£¬WIFIHW¾ÍÈ¥½øÐÐÁ¬½Ó£¬µ«»áʧ°Ü - Õ⽫ÒýÆðÁ÷³ÌÉϵÄʧ°Ü£¬´Ó¶øʹµÃÆô¶¯±äÂý¡£ - =>Õâ¸öÎÊÌâ֮ǰÒѾ­Óнâ¾ö¹ý£¬µ«ÊÇÔÚ×îеķþÎñÆ÷·ÖÖ§ÖÐûÓиüС£ - =>ÔÚWIFIÉèÖýçÃæÏ£¬WIFI³É¹¦´ò¿ªºóµ½APÁбí³öÏÖ£¬ÐèÒª2-3Ãë¡£ - - A. APÁбíµÄÓÐЧʱ¼äÊÇDEFAULT_MAX_SCAN_AGE£¬Îª15Ãë¡£ - B. ÔÚÇý¶¯¼ÓÔØʱ´¥·¢Ò»´ÎɨÃè²Ù×÷¡£Õâ¿ÉÄÜ»áʹµÃ¹ØÁª²Ù×÷±äÂý¡£ - C. µÚÒ»´ÎÊÕµ½É¨ÃèÃüÁîʱ£¬ÈÃÆäÁ¢¼´·µ»Ø£¬ÒÔ±ãAPÁбíÄÜ¿ìËÙ²úÉú¡£ - D. ½Ï³¤Ê±¼äºó£¬´ÓÎÞÏßÉèÖýçÃæ½øÈëWIFIÉèÖýçÃ棬ÔòÖ±½ÓËͽá¹û¡£ - - =>µ±Ôö¼ÓÁË3¸öÊÖ¶¯µÄAPºó£¬ÔÚWIFI´ò¿ªºó£¬ÐèÒª½Ï³¤µÄʱ¼ä²ÅÄܳöAPÁÐ±í¡£ - Ϊ´Ë£¬ÔÚÇý¶¯¼ÓÔØʱ£¬´¥·¢Ò»¸öɨÃè²Ù×÷¡£ - =>µ«ÔÚÒ»¶Îʱ¼äºó£¬É¨ÃèÁбíÈÔÈ»»áÏûʧµô¡£ - - (2)ÔÚÎÞÏßÉèÖÃÒ³ÃæÖУ¬´ò¿ªWIFIºó£¬½øÈëWIFIÉèÖÃÒ³ÃæʱAPÁбíµÄÏÔʾ¡£ - (3)´ÓWIFIÉèÖÃÒ³ÃæÍ˳öµ½ÎÞÏßÉèÖÃÒ³Ã棬ÔÙ½øµ½WIFIÉèÖÃÒ³Ãæʱ£¬APÁбíµÄÏÔʾ¡£ - (4)Ò³ÃæÖб£´æÁ˶à¸öÒѾ­¼ÇÒäµÄ£¬·ÇÊÖ¶¯Ìí¼ÓµÄAPʱ£¬APÁбíµÄÏÔʾ¡£ - (5)Ò³ÃæÖб£´æÁ˶à¸öÒѾ­¼ÇÒäµÄ£¬ÓÉÊÖ¶¯Ìí¼ÓµÄAPʱ£¬APÁбíµÄÏÔʾ¡£ - - =>³ýÁ˸üÐÂWIFIHWÍ⣬ûÓиı䣬ÒòΪÎÞ·¨¸Ä±ä¡£ - -5. ¹ØÁª²âÊÔ£º - (1)WPA¼ÓÃܲâÊÔ£¬ - A. ÕýÈ·ÃÜÂëÏ£¬¿ÉÒԳɹ¦Á¬½Ó¡£ - B. ´íÎóÃÜÂëÏ£¬»áÊÕµ½disauthenticatedʼþ£¬Õâʱ»á½øÐÐÖØÁª¡£×ܹ²»á¹ØÁª - 4´Î£¬ÒòΪ»á½øÐÐ3´ÎÖØÁª£¬Õ⽫ʹµÃÃÜÂë´íÎóÌáʾ¿ò»á½ÏÂýÌáʾ¡£ - -6. Ò»¸ö¹Ø½¡µÄÎÊÌâÊÇ£¬ÈçºÎÈ·¶¨¹ØÁªÈ·ÊµÊdzɹ¦µÄ£¬´ÓÓ¦Óòã½Ç¶ÈÀ´ËµÊÇDHCPÒѾ­³É - ¹¦£¬µ«ÔÚÇý¶¯ÀïÄØ£¿ - =>¶ÔÓÚWPA_SUPPÀ´Ëµ£¬WPAЭÒé»áÉæ¼°µ½4´ÎÎÕÊÖ£¬¹ØÁª»ù±¾¶¼Äܳɹ¦£¬µ«4´ÎÎÕÊÖ¾Í - δ±ØÄܹ»³É¹¦ÁË¡£ËùÒÔ²»Äܵ¥´¿´ÓASSOCIATIONÃüÁîµÄ½á¹ûÀ´È·¶¨Á¬½ÓÊÇ·ñ³É¹¦¡£ - =>ÆðÒ»¸ö8ÃëµÄ¶¨Ê±Æ÷£¬Èç¹û¶¨Ê±Æ÷³¬Ê±Ê±£¬ÈÔȻΪCONNECTED״̬£¬Ôò±íʾ¹ØÁª³É¹¦ - ·ñÔò±íʾ¹ØÁªÊ§°Ü£¬³É¹¦Çé¿öÏÂÎÒÃÇ»á½øÐÐÖØÁª¡£ - =>¹ØÁªHHYʱ»áÓöµ½ lbs_ret_80211_associate: association fail. - ·¢ÏÖÊÇHHYµÄAPËÑË÷²»µ½ÁË¡£ - -7. µÚÒ»´ÎÆô¶¯Ê±£¬¹ØÁªAP¿ÉÄÜ»áʧ°Ü¡£ - [38] lbs_ret_80211_associate: association successfully. - [41] EVENT: deauthenticated: reassoc_count=0 - [41] disconnected status. - [41] lbs_mac_event_disconnected: enter........connect=0 - [44] lbs_ret_80211_associate: association successfully. - =>ÓÉÓÚÔÚWEXTÖУ¬ÔÚÉèÖÃÿ¸ö²ÎÊýʱ¶¼»á´¥·¢¹ØÁª²Ù×÷£¬ËäÈ»²»Ò»¶¨»á´¥·¢Êµ¼ÊµÄ¹Ø - Áª£¬µ«²»Åųý¶à´Î½øÐÐʵ¼Ê´¥·¢µÄ¿ÉÄÜ¡£ - -8. ÐÞ¸Älbs_get_sense£¬ÎÒÃÇÖ»·µ»ØRSSIµÄSignalÖµ£¬¶ø²»¹ÜÔëÉù¡£ - =>ͬʱÐÞ¸Äwpa_supplicant£¬²»±Ø½øÐÐlevelÖµÓëNoiseÖµµÄSNR¼ÆËã¡£ - =>lbs_get_senseÖУº - signal level 223 noise 162 rssi 223 - ÕâʹµÃÐźÅÏÔʾµÄÖµÕýÈ·£¬ÕâʱIWCONFIG²é¿´µÄ½á¹ûΪ£º - Link Quality=100/100 Signal level=-32 dBm Noise level=-94 dBm - Ó¦¸ÃʹÓÃlbs_get_wireless_statsÖеļÆËã·½·¨¡£ - =>ʵ¼ÊÉÏÎÒÃÇ¿´µ½µÄLEVELÖµÊǸºÖµ£¬µ«±»ÒÔÕýÊý·½Ê½´ò³öÀ´ÁË£¬¶øLEVELµÄÖµ»áÓÐÒ» - ¸ö·¶Î§£¬ÔÚMV8686ÖÐÊÇ256£¬ËùÒÔʵ¼ÊÉÏÐźÅֵΪ£º-(256 - level) - ÈçÉÏÖµÖÐLEVELΪ223£¬ÔòÐźÅֵΪ: -(256 - 223) = -33dBm - -9. HHY APÔڳ³¤º£´¦£¬½ÏÔ¶£¬ÔÚ25Ã×´¦¡£¹ØÁªÊ±»áÓÐ´í£º - lbs_ret_80211_associate: association fail.status_code=2 - ASSOC_RESP: internal timer expired while waiting for the AP. - =>·¢ÏÖÔÚÁ¬½ÓÐźŲîµÄAPʱ£¬ÈÝÒ׳öÏÖÕâ¸öÎÊÌâ¡£ - Quality=77/100 Signal level=-71 dBm Noise level=-91 dBm - =>½«MRVDRV_DEFAULT_LISTEN_INTERVALµÄÖµÓÉÔ­À´µÄ10¸ÄΪ50ÊÔһϡ£²»ÐУ¬½«Æä¸Ä - Ϊ500ÊÔһϡ£»¹ÊÇûÓ㬿´À´ÓëÕâ¸ö²ÎÊýÎ޹ء£ - =>½«beacon_periodÉèÖÃΪ900£¬Á¬½ÓHHYʱ»á±¨invalid parameters¡£ - ½«Æä¸ÄΪ100£¬ÈÔÈ»ÊÇÏàͬµÄ´íÎó¡£ - Õâ¸ö²ÎÊýÓ¦¸ÃÊÇÔÚADHOCʱ²Å±»Ê¹Óá£INFRAÍøÂçÖÐÕâ¸öÖµÓÉAP¾ö¶¨¡£ - => - -10.ÓÐʱÔÚ¹ØÁªWPAµÄAPʱ£¬»áÒâÍⵯ³öÃÜÂë´íÎó¿ò£¬¼´Ê¹¿Ï¶¨Æä֮ǰ±£´æµÄÃÜÂëÊÇÕýÈ·µÄ¡£ - -ÓîÐÇ´ÓÌìÅôÊ¢´¦Äõ½µÄ²âÊÔ±¨¸æ£º - -11.»ų́²»ÄÜÏÔʾº¬ÓÐÖÐÎÄÃüÃûµÄ·ÓÉÆ÷£¬¶øÇÒ»ų́ҲÁ¬½Ó²»ÉϺ¬ÓÐÖÐÎÄÃüÃûµÄÍøÂç¡£ -12.°ÑÁ½¸ö·ÓÉÆ÷ÉèΪÏàͬµÄÃüÃû,»ųֻ́ÄܽøÈëÒ»¸öWI-FIÁ¬½Ó,ÁíÒ»¸öÁ¬½Óʧ°Ü. -13.ÔÚ¹ØÁªµÄÁ÷³ÌÉÏ£¬Ê¼ÖÕÓв»ºÏÀíµÄµØ·½£º - [65] lbs_cmd_80211_deauthenticate: enter... - [66] lbs_ret_80211_associate: association fail.status_code=1 - [66] lbs_mac_event_disconnected: enter........connect=0 - [73] lbs_ret_80211_associate: association successfully. - =>ʵ¼ÊÉϻᴥ·¢Á½´Î¹ØÁª²Ù×÷¡£ - (1)È¥µôlbs_set_freqÖд¥·¢¹ØÁªµÄ²Ù×÷£¬Ã»ÎÊÌâ¡£ - (2)È¥µôlbs_set_modeÖд¥·¢¹ØÁªµÄ²Ù×÷£¬Ã»ÎÊÌâ¡£ - ʵ¼ÊÉϲ¢²»ÊÇ´¥·¢¹ØÁª²Ù×÷£¬ÒòΪֻÓÐBSSIDºÍESSIDµÄÉèÖòÙ×÷²Å»áÒýÆðʵ¼ÊµÄ¹Ø - Áª¶¯×÷£¬ÆäÓàµÄÖ»ÊÇÉèÖÃÏà¹ØµÄ²ÎÊý¡£ - [239] lbs_set_essid: call lbs_postpone_association_work - [239] lbs_set_wap: call lbs_postpone_association_work - (1)³¹µ×È¥³ýASSOC_FLAG_MODE±êÖ¾£¬ÒòΪËü¿ÉÄÜÒýÆðDeauthenticated¡£ - -14.»á³öÏÖ²»È¥È¡IP²ÎÊýµÄÇé¿ö£º - inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0 - ʵ¼ÊÉÏÔÚAndroidÏÔʾµÄIPÈ´ÊÇ192.168.0.105¡£ - =>Ô­ÒòÓ¦¸ÃÊÇlbs_cmd_80211_deauthenticateÖÐûÓÐËÍlbs_mac_event_disconnected¡£ - -15.Á¬½Ótplinklai (WEP & SHARED)£¬ÓÐʱ»ñÈ¡IP»áºÜ³¤Ê±¼ä£¬»òÊÇʧ°Ü¡£ - -============================================================================== -=== Version 2.24 @ 2010-11-16 === -============================================================================== - -1. Ò×·½±¨¸æ˵ɨÃèAPµÄÄÜÁ¦¼õÈõ¡£ - =>½«PSģʽµÄÇл»¹Ø±Õ£¬Ñé֤һϡ£ÎÊÌâÒÀ¾É£¬µ«ÔÚ³ýÒ×·½ÍâµÄ¾©»ª¡¢ÊÀ½¡ºÍÎÒÕâÀï - ¶¼Ã»Óз¢ÏÖÕâ¸öÎÊÌâ¡£ - -2. ÔÚÒѾ­Á¬½ÓÉÏÒ»¸öAPºó£¬Çл»µ½ÁíÒ»¸öAP£¬ÃÜÂë´íÎóʱ²»»áµ¯³öÌáʾ¿ò£º - -3. ¾©»ª±¨¸æ˵£º»½ÐѺóWIFIÐźÅÏÔʾÕý³££¬µ«ÊÇË¢Íøҳʧ°Ü¡£ - (1)ÓëAR6002ÀàËƵÄ×ö·¨ÊÇϵͳ˯Ãßʱ½«WIFI¶Ï¿ª£¬»½ÐÑʱÔÙÈÃAndroid½øÐÐÖØÁª¡£ - -============================================================================== -=== Version 2.23 @ 2010-11-15 === -============================================================================== - -1. ¾©»ª±¨¸æ˵£º»½ÐѺóWIFIÐźÅÏÔʾÕý³££¬µ«ÊÇË¢Íøҳʧ°Ü¡£ - (1)ÓëAR6002ÀàËƵÄ×ö·¨ÊÇϵͳ˯Ãßʱ½«WIFI¶Ï¿ª£¬»½ÐÑʱÔÙÈÃAndroid½øÐÐÖØÁª¡£ - -2. Óöµ½Ò»¸öÇé¿ö£ºÔÚ³öÏÖLOG - EVENT: deauthenticated - ºóûÓÐÈ¥½øÐÐÖØÐÂÁ¬½Ó¡£Ö®ºó³öÏÖÒ»´Î£º - [2402] mv8686: command 0x0021 timed out - [2402] mv8686: requeueing command 0x0021 due to timeout (#1) - [2402] mv8686: Received result 0 to command 21 after 1 retries - µ«»á´ÓÕâÀï»Ö¸´¡£0x0021ÊÇCMD_802_11_PS_MODE¡£ - [1390] mv8686: command 0x001f timed out - [1390] mv8686: requeueing command 0x001f due to timeout (#1) - [1390] CMD: 52 FAIL raw_ints: 134 masked ints: 4 - 0x001FÊÇCMD_802_11_RSSI¡£ - - =>Õâ¸öÇé¿öµÄ³öÏÖ£¬ÊÇÒòΪWIFI´¦ÓÚÉî¶È˯Ãßʱ£¬ÏòÆä·¢ËÍÃüÁî¡£ - =>ÔÚlbs_threadÖУ¬´ò¿ªÔ­À´µÄÓï¾ä£¬Èç¹ûpriv->deepsleep == true - ÔòÖ÷Ïß³ÌÈÔȻ˯Ãߣ¬¶ø²»·¢ËÍÈκÎÃüÁîºÍÊý¾Ý¡£ - -3. ¿ÉÒÔͨ¹ýÈçÏÂÃüÁî²é¿´µ±Ç°Ë¯ÃßËøµÄÇé¿ö£º - echo android_power_print_locks,0xf > /sys/scu/24m/active - -4. ÔÚº¯Êýlbs_process_eventÖз¢ÏÖÒ»¸öBUG£¬¶ÔÓÚ±äÁ¿reassoc_countµÄ´¦ÀíÓеãÎÊÌ⣺ - (1)static int reassoc_count = 0; ÒÔ¾²Ì¬·½Ê½¶¨Òå¡£ - (2)if ((priv->connect_status == LBS_CONNECTED) && - (reassoc_count < 3)) - Õâ¸öÌõ¼þÂú×ãʱ½øÐÐÖØÁª£¬Í¬Ê±reassoc_count»á±»¼Ó1¡£ - (3)¿¼Âǵ½Ò»¸ö¿ÉÄܳö´íµÄÇé¿öÊÇ£ºµ±Óöµ½Õâ¸öʼþ£¬È»ºóÖØÁª£¬²¢Çҳɹ¦ÁË£¬µ«ÊÇ - Õâ¸öÖµÈÔÈ»»á±»¼Ó1£¬Õâ¾ÍÔì³É£¬µÚÈý´ÎÊÕµ½Õâ¸öʼþʱ¾Í²»»á½øÐÐÖØÁªÁË¡£ - - =>½«Õâ¸ö±äÁ¿·Åµ½lbs_privateµÄÊý¾Ý½á¹¹ÖУ¬ÔÚ¹ØÁª³É¹¦ºó»á½«Õâ¸ö±äÁ¿Çå0¡£ - - =>¿ÉÒÔÖØÏÖÕâ¸öÎÊÌâ¡£µ«ÔÚAPÁ¬½Ó˳³©µÄÇé¿öÏ£¬¹ØÁªËٶȺܿ졣¾©»ª³öÏÖµÄÓ¦¸ÃÊÇ - Æä¹ØÁªAPµÄËٶȽÏÂý£¬±ãµÃÓÉAndroid·¢ÆðµÄÖØÁªÐèÒª½Ï³¤Ê±¼ä£¬µ«ËûÃDZ¨Òª¼¸·Ö - ÖÓµÄʱ¼ä£¬ÕâºÜÒâÍâ¡£ - - =>Õâ¸öÎÊÌâ¿ÉÒÔ½â¾ö¡£ - -5. ÊÀ½¡ - AppleChen 15:57:16 - 1.ÉèÖÃÑ¡ÏîÖдò¿ª·½Ïò¹¦ÄÜ£¨ÖØÁ¦¸ÐÓ¦£© - 2.´ò¿ªWIFIÁ¬½Óij¸öAP - 3.Ñ¡ÔñÒÑÁ¬½ÓAP²¢Ö´ÐÐÍü¼Ç²Ù×÷ - 4.WIFI״̬ÌáʾΪÒѶϿªÁ¬½Ó - 5.ÐýתÉ豸¼¤»îÖØÁ¦¸ÐÓ¦¹¦ÄÜ - 6.WIFI״̬±äΪÕýÔÚɨÃè - 7.Ö´ÐÐÆäËû²Ù×÷ºóÕý³£ - =>¾­È·ÈÏAPÁбí»á³öÏÖ£¬²»Ó°ÏìʹÓᣠ- -============================================================================== -=== Version 2.22 @ 2010-11-11 === -============================================================================== - -1. Á¬½ÓWPA·½Ê½µÄAPʱ£¬Èç¹ûÃÜÂë´íÎó£¬ÐèÒªÄܹ»µ¯³öÖØÐÂÊäÈëÃÜÂëµÄÌáʾ¿ò£º - A. ÔÚ֮ǰûÓÐÈκÎÁ¬½ÓµÄÇé¿öÏ£¬ÊäÈë´íÎóµÄÃÜÂ룬»áµ¯³öÌáʾ¿ò¡£ - B. ÏȹØÁªÉÏÒ»¸öAP£¬È»ºóÁ¬½ÓÊäÈë´íÎóÃÜÂëµÄAP£¬Ò²»áµ¯³öÌáʾ¿ò¡£ - -2. δÁ¬½ÓAPÇé¿öϹرÕWIFIµÄ²âÊÔÇé¿ö»¹Ó¦¸ÃÓУ¬Á¬½ÓÉÏAPºó£¬½«Õâ¸öAP¶Ïµç£¬»òÊÇ - À뿪Õâ¸öAPµÄÐźŸ²¸Ç·¶Î§¡£ - =>APÕÒ²»µ½ºó£¬Èí¼þ»á³¢ÊÔÕÒÁíÒ»¸öÒѾ­¼ÇÒäµÄAP¡£Èç¹ûÁíÒ»¸öAP¿ÉÒÔÕÒµ½²¢¹ØÁªÉÏ - ×ÔÈ»²»»á¹Ø±ÕWIFI£¬·ñÔòÓ¦¸Ã»á¹Ø±ÕWIFI¡£ - =>ÕâÖÖÇé¿öÏÂÎÒÃǶ¼¿ÉÒÔÈÃϵͳ½øÈë¶þ¼¶Ë¯Ãߣ¬Ö»ÒªÍøÂçûÓб»Ê¹Óõ½¡£ - -3. ϵͳ½øÈë¶þ¼¶Ë¯Ãßʱ£¬ÎÒÃÇÒ²½«ÈÃWIFI½øÈë¶þ¼¶Ë¯Ãß¡£ - =>wifi_suspendÖÐÈÃWIFI½øÈëÉî¶È˯Ãߣ»ÔÚwifi_resumeÖÐÔòÈÃWIFIÍ˳öÉî¶È˯Ãß¡£ - -4. ÁíÒ»¸öÏ뿼ÂǵÄÊ¡µç»úÖÆÊÇ£¬Èç¹ûWIFIÏÐÁË£¬ÎÒÃÇ¿ÉÒÔÆô¶¯PS»úÖÆ£¬Ã¦ÁË£¬Ôò¹Ø±ÕÊ¡ - µç»úÖÆ¡£²»Ê¹ÓÃDEEP SLEEP»úÖÆ£¬ÒòΪÕâÖÖ»úÖÆÏÂÇý¶¯µÄ״̬ºÍÓ¦ÓòãµÄ״̬»á²»Ò» - Ö£¬Õ⽫µ¼Ö¿ͻ§¶ÔÕâÒ»Çé¿ö²»ÂúÒâ¡£ - (1)¿¼Âǵ½µÄÒ»ÖÖ·½Ê½ÊÇÔÚTX/RXÖмà¿ØÁ÷Á¿×´Ì¬£¬Èç¹ûСÓÚÒ»¶¨ÖµÔò´ò¿ªPS·½Ê½£¬ - Èç¹û´óÓÚÒ»¶¨ÖµÔò¹Ø±ÕPS·½Ê½¡£ÓÉÓÚÁ÷Á¿Í³¼Æ»áÉæ¼°µ½³Ë³ýÔËË㣬»áÔÚÊý¾ÝÁ÷· - ÉϺÄ×ÊÔ´£¬×îºÃÄܱÜÃâÕâÖÖ·½Ê½¡£ - (2)ÏÖÔÚÓÐÒ»¸ö10ÃëÖӵĶ¨Ê±Æ÷£¬ÓÃÓÚ¼ì²éÊÇ·ñÐèÒª¹Ø±ÕWIFI£¬¿ÉÒÔÓÃÕâ¸ö¶¨Ê±Æ÷¡£ - =>ÔÚRX/TXͨ·ÉÏͳ¼ÆRX/TXµÄÊý¾Ý°üÊý£¬Èç¹ûÔÚ¶¨Ê±Æ÷µÄ10ÃëÆÚ¼äûÓÐÊý¾Ý´«Ê䣬 - Ôò´ò¿ªPS·½Ê½£¬·´Ö®¹Ø±ÕPS·½Ê½¡£ - (3)¿ÉÒÔ¸úAndroidµÄ˯ÃßËø°ó¶¨ÔÚÒ»Æ𣬼´AndroidËøÉÏʱ£¬ÎÒÃǹرÕPS·½Ê½£¬·´Ö® - ´ò¿ªPS·½Ê½£¬ÓÉPOWER SAVEÄ£¿é»Øµ÷À´ÊµÏÖ¡£ - -5. ÔÚPOWER SAVEµÄ»Øµ÷Öе÷ÓÃPS£¬»áÓÐ: - BUG: scheduling while atomic - ÒòΪPOWER SAVEÊÇÔÚ¶¨Ê±Æ÷»Øµ÷ÖУ¬´¦ÓÚÖжÏÉÏÏÂÎÄ£¬²»ÄÜÓÐ˯Ãß¡£ - =>Ôڻص÷º¯ÊýÖÐͨ¹ýWORK QUEUEÀ´Íê³ÉPS·½Ê½µÄÇл»¡£ - -============================================================================== -=== Version 2.21 === -============================================================================== - -1. Ìí¼Ówifi_power_save_initºÍwifi_power_save_exitµÄ¹³×Ó£¬ÆôÓÃеÄÊ¡µç»úÖÆ¡£ - -2. PSģʽʱ£¬Ä¬ÈϵÄDTIMµÄֵΪ1£¬defs.hÖУº - #define MRVDRV_DEFAULT_MULTIPLE_DTIM 3 - ÏÖ½«Æä¸ÄΪ3½øÐвâÊÔ£¬Ä¿µÄÊDz»»á¶ª°ü£¬ÇÒPINGÑÓ³Ù²»»áÌ«´ó¡£ - =>DTIMΪ1ʱ£¬PING¶ª°üºÜÑÏÖØ£¬10¸ö°ü»á¶ª3¸ö×óÓÒ¡£ - =>½«DTIM¸ÄΪ3ʱ£¬¾Í²»´æÔÚ¶ª°üÁË£¬100¸öPING°ü²âÊÔ¡£µ«ÊÇÑÓ³ÙÏ൱À÷º¦¡£ - min/avg/max = 1.976/147.693/300.576 ms - µ±Ç°×î´óµÄDTIMÖµÖ§³ÖµÄ×î´óֵΪ5£¬ÕâÊÇָ˯Ãßʱ¼äµÄ³¤¶Ì¡£ - min/avg/max = 3.748/253.482/500.708 ms - ¼´Õâ¸öÖµÔ½´ó£¬PINGÑÓ³Ù¾ÍÔ½´ó¡£ - ÔÚDTIMΪ5µÄÇé¿öÏ£¬TCP TXÍÌÍÂÂÊΪ11.45Mbps£¬RXÍÌÍÂÂÊΪ13.28Mbps¡£ - =>ÔÚDTIMΪ3µÄÇé¿öÏ£¬TCP TXÍÌÍÂÂÊΪ11.82Mbps£¬RXÍÌÍÂÂÊΪ13.22Mbps¡£ - -3. ÖØйØÁªÉϺó£¬Ô­À´µÄPS״̬»á¶ªÊ§£¬±ä³ÉûÓÐPSÁË¡£µÆûÉÁ£¬µ«PINGµÄÑÓ³ÙÊÇÓС£ - =>ÕâÖ®ºóÓÃiwconfig wlan0 power off£¬PINGµÄÑÓ³ÙÒ²²»Õý³£ÁË¡£ - =>¿´À´FW»òÊÇÇý¶¯ÔÚ´¦ÀíPSÎÊÌâÉÏÈÔÈ»´æÔÚȱÏÝ¡£ - -4. WiFi´ò¿ª£¬Ã»ÓÐÁ¬½ÓÉÏAP£¬¿ÉÄÜÊÇ£º - (1)ûÓÐÑ¡ÔñAP£¬ - (2)Ò²¿ÉÄÜÒªÁ¬½ÓµÄAP²»´æÔÚ£¬ - (3)»òÊÇÁ¬½Óʧ°Ü¡£ - (4)À뿪APµÄÐźŸ²¸Ç·¶Î§£¬»òÊÇAPϵçÁË¡£ - ÕâÖÖÇé¿öÏ£¬Ó¦¸Ã֪ͨAndroid£¬½«WiFi¹Ø±Õ¡£ - =>¿¼ÂÇʹÓÃpriv->connect_statusÕâ¸ö±äÁ¿À´Çø·Ö״̬¡£ - A. lbs_ret_80211_associate: ¸ù¾Ý¹ØÁª½á¹û»á¸üбäÁ¿µÄÖµ¡£ - B. lbs_mac_event_disconnected»á½«ÆäÖÃΪ¶Ï¿ªÖµ¡£ - C. lbs_init_adapter³õʼΪ¶Ï¿ªÖµ¡£ - =>Ôö¼ÓÒ»¸ö¶¨Ê±Æ÷À´¼àÊÓÁ¬½ÓµÄÇé¿ö: - A. ÔÚinit_adapterʱ³õʼ»¯¶¨Ê±Æ÷turnoff_timer¡£ - B. ÔÚconnect_status±»ÖÃΪCONNECTEDʱ£¬É¾³ý¶¨Ê±Æ÷¡£ - C. ÔÚconnect_status±»ÖÃΪDISCONNECTEDʱ£¬Æô¶¯¶¨Ê±Æ÷¡£ - D. ÔÚ¶¨Ê±Æ÷Àï·¢ËÍʼþ¸æËßWPA_SUPP£¬Çý¶¯ÒªÇó¹Ø±ÕWIFI¡£ - E. WPA_SUPP·¢ËÍʼþ¸øAndroid£¬ÒªÇó¹Ø±ÕWIFI¡£ - F. Android½ÓÊÕµ½¹Ø±ÕÇëÇóºó£¬Ï·¢ÃüÁî¹Ø±ÕWIFI¡£ - =>¶¨Ê±Æ÷¹¤×÷·½Ê½Ð޸ģº - A. ϵͳÆô¶¯Ê±³õʼ»¯¶¨Ê±Æ÷£¬lbs_threadÖ÷Ï̹߳¤×÷ʱÆô¶¯¶¨Ê±Æ÷¡£ - B. ¶¨Ê±Æ÷ʱ¸ôΪ10Ã룬ÿ´Î¼ì²éÁ¬½ÓÇé¿ö£¬Èç¹ûÔÚÒ»¶¨Ê±¼äÄÚ¶¼ÊÇΪ¶Ï¿ª×´Ì¬£¬ - Ôò»áÏòÓ¦ÓòãÉϱ¨Ê¼þ£º - memset(wrqu.ap_addr.sa_data, 0xAB, ETH_ALEN); - wrqu.ap_addr.sa_family = ARPHRD_ETHER; - wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); - C. ÈκÎÇé¿ö϶¨Ê±Æ÷¶¼ÔÚ¹¤×÷£¬Ö»ÓÐÇý¶¯Í˳öʱÇý¶¯²Å»á±»É¾³ý¡£ - =>ÐÞ¸Äwpa_supplicantµÄdriver_wext.c£¬Ìí¼Ó¶ÔȫΪ0xABµÄAPµØÖ·µÄÅжϣº - else if (os_memcmp(iwe->u.ap_addr.sa_data, - "\xAB\xAB\xAB\xAB\xAB\xAB", ETH_ALEN) == 0) - { - wpa_msg(ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "TURNOFF"); - } - =>AndroidÖÐÔö¼Ó¶ÔTURNOFFʼþµÄ´¦Àí£º - frameworks/base/wifi/java/android/net/wifi: - (1)WifiMonitor.java£¬handleDriverEventº¯ÊýÖÐÌí¼ÓÈçÏ´¦Àí£º - } else if (state.equals("TURNOFF")) { - mWifiStateTracker.notifyDriverTurnoff(); - (2)WifiStateTracker.java - A. Ê×ÏÈÔÚDRIVER_HUNGºóÌí¼Ó£º - private static final int DRIVER_TURNOFF = 3; - B. Ìí¼ÓnotifyDriverTurnoffº¯Êý£¬·¢ËÍDRIVER_TURNOFFʼþ¡£ - C. ÔÚhandleMessageº¯Êýº¯ÊýÖÐÌí¼Ó¶ÔDRIVER_TURNOFFʼþµÄ´¦Àí¡£ - case DRIVER_TURNOFF: - Log.e(TAG, "Wifi Driver reports turn off."); - mWM.setWifiEnabled(false); - break; - -5. Ôö¼ÓMV8686_SUPPORT_ADHOCºêÀ´¿ØÖÆADHOCµÄ´úÂ룬ÔÝʱûÓã¬ËùÒÔ²»ÐèÒª¡£ - -6. µ±Ò»¸öAPÁ¬½ÓÉÏ£¬È»ºó½«Æä¶Ï¿ªºó£¬ÔÚWIFIÇý¶¯ÖÐ: - priv->connect_statusµÄֵʼÖÕÊÇLBS_CONNECTED£¬²»»á¸Ä±ä¡£ - =>ÐèÒªÌí¼Ó¶ÔSIOCSIWMLMEÃüÁîµÄÖ§³Ö£¬ÔÚÔ­°æÇý¶¯ÖÐÊÇÓеġ£ - =>ΪÁ˶ϿªÁ¬½Ó£¬WPA_SUPP»áËÍIW_MLME_DEAUTHÃüÁî¸øÇý¶¯¡£ - =>Çý¶¯½«µ÷ÓÃlbs_cmd_80211_deauthenticateº¯Êý¶Ï¿ªÁ¬½Ó¡£ - -============================================================== -Version 2.20 -============= - -1. ¼ÓÈëwifi_power_saveÄ£¿é£¬×¼±¸ÔÚMV8686ÖÐÆôÓÃеÄÐÝÃß»úÖÆ¡£ - -2. Çý¶¯½«Óнϴó¸Ä¶¯£¬°æ±¾ºÅ¸ÄΪ2.20£¬ÒÔʾÇø±ð¡£ - -3. ¹Ø±ÕÔ­À´µÄ˯Ãß»úÖÆ£º - #define ANDROID_POWER_SAVE 0 - =>ÔÚSDK°åÉϲâÊÔ£¬´ò¿ªWIFIʱ²¢Ã»ÓÐÕÒµ½SDIOÉ豸¡£ - -4. µ±WIFIûÓйØÁªÉÏʱ£¬PSģʽ²¢²»»á±»´ò¿ª£¬ÕâʱӦ¸ÃÊÇÔÚSLEEP - ģʽ£¬Í¨¹ýIWCONFIG²é¿´£¬ÔڷǹØÁªÇé¿öÏÂΪOFF£¬¼´Ê¹ÒѾ­Í¨¹ý - iwconfig wlan0 power on - ´ò¿ªÊ¡µçģʽ¡£ - =>ÐÞ¸Älbs_get_power£¬Ôڲ鿴PS״̬ʱ£¬²»ÐèÒª½«¹ØÁªÌõ¼þ°ó¶¨¡£ - =>½«´òÓ¡ÐÅÏ¢£ºEVENT: ps awake: Media is LBS_CONNECTED.È¥µô¡£ - -============================================================== -Version 2.13 -============= -1. ÔÚа汾SDKÖУ¬Èç¹ûûÓн«AndroidµÄËøÈ¥µô£¬Ôò»á³öÏÖºÍAR6002 - Ò»Ñù£¬µ¼ÖÂϵͳËÀµô¡£ - =>²é¿´Çý¶¯£¬Ã»ÏÖÔÚÇý¶¯Ð¶ÔØʱ£¬±¾Éí¾ÍÓÐÏú»ÙAndroidËøµÄ²Ù×÷£¬ - ËùÒÔÓ¦¸Ã²»ÊÇÕâ¸öÎÊÌâ¡£ - -2. °æ±¾ºÅʹÓÃwifi_version.hÖеĶ¨Òå¡£ - -============================================================== -Version 2.12 -============= -1. ÐÞ¸ÄÁËwifi_power_ops.c£¬½«AR6002ºÍÉϵçʱÐòºÍMV8686µÄÉϵçʱÐò - ·Ö¿ªÀ´¿ØÖÆ£¬ÕâÒªÇóËûÃÇÔÚµ÷ÓÃturn_on½Ó¿Úʱָ¶¨Ð¾Æ¬µÄÀàÐÍ¡£ - -============================================================== -Version 2.11 -============= -1. ÐÞ¸ÄÁËÄ£×éµÄÉϵ缰ϵç¹æÔò£º - A. Ô­À´µÄÉϵç¹æÔò: - PWN DOWN -> POWER DOWN - PWN UP -> POWER UP - RESET - =>ÏÖÔÚµÄÉϵç¹æÔò£º - PWN UP -> POWER UP - RESET - - B. Ô­À´µÄϵç¹æÔò£º - PWN UP - POWER DOWN - PWN DOWN - RESET DOWN - =>еÄϵç¹æÔò£º - RESET DOWN - PWN DOWN - POWER DOWN - - Ð޸ĵÄÒÀ¾ÝÊÇÖØмì²éÁËMV8686µÄDS¼°AR6002µÄDS£¬·¢ÏÖÁ½ÕßÉϵç - ¼°ÏµçµÄʱÐòÒªÇóÊDz»Ò»ÑùµÄ¡£ - - ÔÚNX7007ÉÏͨÏü²âÊÔûÓÐÎÊÌâ¡£ - -============================================================== -Version 2.10 -============= -1. ¸ÄÕýÁ˵±ANDROID_POWER_SAVE±»¶¨ÒåΪ0ʱ£¬±àÒë²»¹ý£¬ÓÐЩµØ·½ - ûÓмÓÕýÈ·µÄºê±£»¤µÄ´íÎó¡£ -2. - -============================================================== -Version 2.08 - -============================================================== -Version 2.07 - diff --git a/drivers/net/wireless/mv8686/Makefile b/drivers/net/wireless/mv8686/Makefile deleted file mode 100755 index f18a69b614bb..000000000000 --- a/drivers/net/wireless/mv8686/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# -# Makefile for MV8686 wifi driver. -# - -mv8686-objs := main.o wext.o rx.o tx.o cmd.o cmdresp.o \ - scan.o 11d.o assoc.o if_sdio.o \ - ../wifi_power/wifi_power_ops.o mv8686_cis.o \ - ../wifi_power/wifi_power_save.o - -obj-$(CONFIG_MV8686) += mv8686.o ../wifi_power/wifi_power.o ../wifi_power/wifi_config.o diff --git a/drivers/net/wireless/mv8686/Makefile.kernel b/drivers/net/wireless/mv8686/Makefile.kernel deleted file mode 100755 index f18a69b614bb..000000000000 --- a/drivers/net/wireless/mv8686/Makefile.kernel +++ /dev/null @@ -1,10 +0,0 @@ -# -# Makefile for MV8686 wifi driver. -# - -mv8686-objs := main.o wext.o rx.o tx.o cmd.o cmdresp.o \ - scan.o 11d.o assoc.o if_sdio.o \ - ../wifi_power/wifi_power_ops.o mv8686_cis.o \ - ../wifi_power/wifi_power_save.o - -obj-$(CONFIG_MV8686) += mv8686.o ../wifi_power/wifi_power.o ../wifi_power/wifi_config.o diff --git a/drivers/net/wireless/mv8686/Makefile.module b/drivers/net/wireless/mv8686/Makefile.module deleted file mode 100755 index 7213eed5509f..000000000000 --- a/drivers/net/wireless/mv8686/Makefile.module +++ /dev/null @@ -1,37 +0,0 @@ -# -# Makefile for MV8686 to build driver module. -# - -KERNELDIR=/smb/rk28/newrk2808/rk2808_opensource_trunk - -############################################################################# -# Make Targets -############################################################################# - -ifneq ($(KERNELRELEASE),) - -WLANOBJS := main.o wext.o rx.o tx.o cmd.o cmdresp.o \ - scan.o 11d.o assoc.o if_sdio.o \ - ../wifi_power/wifi_power_ops.o mv8686_cis.o \ - ../wifi_power/wifi_power_save.o \ - ../wifi_power/wifi_power.o ../wifi_power/wifi_config.o - -obj-m := wlan.o - -wlan-objs := $(WLANOBJS) - -else - -default: - $(MAKE) -C $(KERNELDIR) M=$(PWD) modules - -endif - -############################################################### - -clean: - rm -f *.o *.ko .*.cmd *.mod.c - rm -f modules.order - rm -rf Module.symvers .tmp_versions - -# End of file diff --git a/drivers/net/wireless/mv8686/Makefile.mv8686 b/drivers/net/wireless/mv8686/Makefile.mv8686 deleted file mode 100755 index 061945549276..000000000000 --- a/drivers/net/wireless/mv8686/Makefile.mv8686 +++ /dev/null @@ -1,8 +0,0 @@ - -obj-$(CONFIG_MV8686) += mv8686.o wifi_power.o wifi_config.o - -$(obj)/mv8686.o: $(obj)/mv8686.uu - @echo "UUDE mv8686.uu" - @uudecode $(obj)/mv8686.uu -o $(obj)/mv8686.o - - diff --git a/drivers/net/wireless/mv8686/ReleaseNotes.txt b/drivers/net/wireless/mv8686/ReleaseNotes.txt deleted file mode 100755 index d58d4faf8017..000000000000 --- a/drivers/net/wireless/mv8686/ReleaseNotes.txt +++ /dev/null @@ -1,8 +0,0 @@ - -============================================================================== -=== Version 2.35 @ 2010-12-31 === -============================================================================== - -1. Ôö¼Ó¶ÔLinux 2.6.32Äں˵ÄÖ§³Ö¡£ - -2. \ No newline at end of file diff --git a/drivers/net/wireless/mv8686/assoc.c b/drivers/net/wireless/mv8686/assoc.c deleted file mode 100755 index 7d4494b12f3d..000000000000 --- a/drivers/net/wireless/mv8686/assoc.c +++ /dev/null @@ -1,1976 +0,0 @@ -/* Copyright (C) 2006, Red Hat, Inc. */ - -#include -#include -#include -#include -#include - -#include "lib80211.h" - -#include "assoc.h" -#include "decl.h" -#include "host.h" -#include "scan.h" -#include "cmd.h" - -/* - * Defined in main.c - */ -extern atomic_t reassoc_flag; - -#if (MV8686_SUPPORT_ADHOC == 1) -static int lbs_adhoc_post(struct lbs_private *priv, struct cmd_header *resp); -#endif - -static const u8 bssid_any[ETH_ALEN] __attribute__ ((aligned (2))) = - { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; -static const u8 bssid_off[ETH_ALEN] __attribute__ ((aligned (2))) = - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - -/* The firmware needs certain bits masked out of the beacon-derviced capability - * field when associating/joining to BSSs. - */ -#define CAPINFO_MASK (~(0xda00)) - - -/** - * @brief This function finds common rates between rates and card rates. - * - * It will fill common rates in rates as output if found. - * - * NOTE: Setting the MSB of the basic rates need to be taken - * care, either before or after calling this function - * - * @param priv A pointer to struct lbs_private structure - * @param rates the buffer which keeps input and output - * @param rates_size the size of rate1 buffer; new size of buffer on return - * - * @return 0 on success, or -1 on error - */ -static int get_common_rates(struct lbs_private *priv, - u8 *rates, - u16 *rates_size) -{ - u8 *card_rates = lbs_bg_rates; - size_t num_card_rates = sizeof(lbs_bg_rates); - int ret = 0, i, j; - u8 tmp[30]; - size_t tmp_size = 0; - - /* For each rate in card_rates that exists in rate1, copy to tmp */ - for (i = 0; card_rates[i] && (i < num_card_rates); i++) { - for (j = 0; rates[j] && (j < *rates_size); j++) { - if (rates[j] == card_rates[i]) - tmp[tmp_size++] = card_rates[i]; - } - } - - lbs_deb_hex(LBS_DEB_JOIN, "AP rates ", rates, *rates_size); - lbs_deb_hex(LBS_DEB_JOIN, "card rates ", card_rates, num_card_rates); - lbs_deb_hex(LBS_DEB_JOIN, "common rates", tmp, tmp_size); - lbs_deb_join("TX data rate 0x%02x\n", priv->cur_rate); - - if (!priv->enablehwauto) { - for (i = 0; i < tmp_size; i++) { - if (tmp[i] == priv->cur_rate) - goto done; - } - lbs_pr_alert("Previously set fixed data rate %#x isn't " - "compatible with the network.\n", priv->cur_rate); - ret = -1; - goto done; - } - ret = 0; - -done: - memset(rates, 0, *rates_size); - *rates_size = min_t(int, tmp_size, *rates_size); - memcpy(rates, tmp, *rates_size); - return ret; -} - - -/** - * @brief Sets the MSB on basic rates as the firmware requires - * - * Scan through an array and set the MSB for basic data rates. - * - * @param rates buffer of data rates - * @param len size of buffer - */ -static void lbs_set_basic_rate_flags(u8 *rates, size_t len) -{ - int i; - - for (i = 0; i < len; i++) { - if (rates[i] == 0x02 || rates[i] == 0x04 || - rates[i] == 0x0b || rates[i] == 0x16) - rates[i] |= 0x80; - } -} - - -/** - * @brief Associate to a specific BSS discovered in a scan - * - * @param priv A pointer to struct lbs_private structure - * @param assoc_req The association request describing the BSS to associate with - * - * @return 0-success, otherwise fail - */ -static int lbs_associate(struct lbs_private *priv, - struct assoc_request *assoc_req) -{ - int ret; - u8 preamble = RADIO_PREAMBLE_LONG; - - lbs_deb_enter(LBS_DEB_ASSOC); - -//#if (NEW_MV8686_PS == 1) -#if 0 - assoc_retry: -#endif - - //printk("%s: sending authenticate command.\n", __func__); - ret = lbs_prepare_and_send_command(priv, CMD_802_11_AUTHENTICATE, - 0, CMD_OPTION_WAITFORRSP, - 0, assoc_req->bss.bssid); - if (ret) - goto out; - - /* Use short preamble only when both the BSS and firmware support it */ - if ((priv->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) && - (assoc_req->bss.capability & WLAN_CAPABILITY_SHORT_PREAMBLE)) - preamble = RADIO_PREAMBLE_SHORT; - - ret = lbs_set_radio(priv, preamble, 1); - if (ret) - goto out; - - //printk("%s: sending associate command.\n", __func__); - ret = lbs_prepare_and_send_command(priv, CMD_802_11_ASSOCIATE, - 0, CMD_OPTION_WAITFORRSP, 0, assoc_req); - -//#if (NEW_MV8686_PS == 1) -#if 0 - if (priv->associate_retry > 0) - { - printk("%s: Need to retry association.\n", __func__); - goto assoc_retry; - } -#endif - -out: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - -#if (MV8686_SUPPORT_ADHOC == 1) - -/** - * @brief Join an adhoc network found in a previous scan - * - * @param priv A pointer to struct lbs_private structure - * @param assoc_req The association request describing the BSS to join - * - * @return 0 on success, error on failure - */ -static int lbs_adhoc_join(struct lbs_private *priv, - struct assoc_request *assoc_req) -{ - struct cmd_ds_802_11_ad_hoc_join cmd; - struct bss_descriptor *bss = &assoc_req->bss; - u8 preamble = RADIO_PREAMBLE_LONG; - DECLARE_SSID_BUF(ssid); - u16 ratesize = 0; - int ret = 0; - - lbs_deb_enter(LBS_DEB_ASSOC); - - lbs_deb_join("current SSID '%s', ssid length %u\n", - mv8686_print_ssid(ssid, priv->curbssparams.ssid, - priv->curbssparams.ssid_len), - priv->curbssparams.ssid_len); - lbs_deb_join("requested ssid '%s', ssid length %u\n", - mv8686_print_ssid(ssid, bss->ssid, bss->ssid_len), - bss->ssid_len); - - /* check if the requested SSID is already joined */ - if (priv->curbssparams.ssid_len && - !lbs_ssid_cmp(priv->curbssparams.ssid, - priv->curbssparams.ssid_len, - bss->ssid, bss->ssid_len) && - (priv->mode == IW_MODE_ADHOC) && - (priv->connect_status == LBS_CONNECTED)) { - union iwreq_data wrqu; - - lbs_deb_join("ADHOC_J_CMD: New ad-hoc SSID is the same as " - "current, not attempting to re-join"); - - /* Send the re-association event though, because the association - * request really was successful, even if just a null-op. - */ - memset(&wrqu, 0, sizeof(wrqu)); - memcpy(wrqu.ap_addr.sa_data, priv->curbssparams.bssid, - ETH_ALEN); - wrqu.ap_addr.sa_family = ARPHRD_ETHER; - wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); - goto out; - } - - /* Use short preamble only when both the BSS and firmware support it */ - if ((priv->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) && - (bss->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)) { - lbs_deb_join("AdhocJoin: Short preamble\n"); - preamble = RADIO_PREAMBLE_SHORT; - } - - ret = lbs_set_radio(priv, preamble, 1); - if (ret) - goto out; - - lbs_deb_join("AdhocJoin: channel = %d\n", assoc_req->channel); - lbs_deb_join("AdhocJoin: band = %c\n", assoc_req->band); - - priv->adhoccreate = 0; - priv->curbssparams.channel = bss->channel; - - /* Build the join command */ - memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - - cmd.bss.type = CMD_BSS_TYPE_IBSS; - cmd.bss.beaconperiod = cpu_to_le16(bss->beaconperiod); - - memcpy(&cmd.bss.bssid, &bss->bssid, ETH_ALEN); - memcpy(&cmd.bss.ssid, &bss->ssid, bss->ssid_len); - - memcpy(&cmd.bss.phyparamset, &bss->phyparamset, - sizeof(union ieeetypes_phyparamset)); - - memcpy(&cmd.bss.ssparamset, &bss->ssparamset, - sizeof(union IEEEtypes_ssparamset)); - - cmd.bss.capability = cpu_to_le16(bss->capability & CAPINFO_MASK); - lbs_deb_join("ADHOC_J_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n", - bss->capability, CAPINFO_MASK); - - /* information on BSSID descriptor passed to FW */ - lbs_deb_join("ADHOC_J_CMD: BSSID = %pM, SSID = '%s'\n", - cmd.bss.bssid, cmd.bss.ssid); - - /* Only v8 and below support setting these */ - if (priv->fwrelease < 0x09000000) { - /* failtimeout */ - cmd.failtimeout = cpu_to_le16(MRVDRV_ASSOCIATION_TIME_OUT); - /* probedelay */ - cmd.probedelay = cpu_to_le16(CMD_SCAN_PROBE_DELAY_TIME); - } - - /* Copy Data rates from the rates recorded in scan response */ - memset(cmd.bss.rates, 0, sizeof(cmd.bss.rates)); - ratesize = min_t(u16, sizeof(cmd.bss.rates), MAX_RATES); - memcpy(cmd.bss.rates, bss->rates, ratesize); - if (get_common_rates(priv, cmd.bss.rates, &ratesize)) { - lbs_deb_join("ADHOC_JOIN: get_common_rates returned error.\n"); - ret = -1; - goto out; - } - - /* Copy the ad-hoc creation rates into Current BSS state structure */ - memset(&priv->curbssparams.rates, 0, sizeof(priv->curbssparams.rates)); - memcpy(&priv->curbssparams.rates, cmd.bss.rates, ratesize); - - /* Set MSB on basic rates as the firmware requires, but _after_ - * copying to current bss rates. - */ - lbs_set_basic_rate_flags(cmd.bss.rates, ratesize); - - cmd.bss.ssparamset.ibssparamset.atimwindow = cpu_to_le16(bss->atimwindow); - - if (assoc_req->secinfo.wep_enabled) { - u16 tmp = le16_to_cpu(cmd.bss.capability); - tmp |= WLAN_CAPABILITY_PRIVACY; - cmd.bss.capability = cpu_to_le16(tmp); - } - - if (priv->psmode == LBS802_11POWERMODEMAX_PSP) { - __le32 local_ps_mode = cpu_to_le32(LBS802_11POWERMODECAM); - - /* wake up first */ - ret = lbs_prepare_and_send_command(priv, CMD_802_11_PS_MODE, - CMD_ACT_SET, 0, 0, - &local_ps_mode); - if (ret) { - ret = -1; - goto out; - } - } - - if (lbs_parse_dnld_countryinfo_11d(priv, bss)) { - ret = -1; - goto out; - } - - ret = lbs_cmd_with_response(priv, CMD_802_11_AD_HOC_JOIN, &cmd); - if (ret == 0) - ret = lbs_adhoc_post(priv, (struct cmd_header *) &cmd); - -out: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - -/** - * @brief Start an Adhoc Network - * - * @param priv A pointer to struct lbs_private structure - * @param assoc_req The association request describing the BSS to start - * - * @return 0 on success, error on failure - */ -static int lbs_adhoc_start(struct lbs_private *priv, - struct assoc_request *assoc_req) -{ - struct cmd_ds_802_11_ad_hoc_start cmd; - u8 preamble = RADIO_PREAMBLE_LONG; - size_t ratesize = 0; - u16 tmpcap = 0; - int ret = 0; - DECLARE_SSID_BUF(ssid); - - lbs_deb_enter(LBS_DEB_ASSOC); - - if (priv->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) { - lbs_deb_join("ADHOC_START: Will use short preamble\n"); - preamble = RADIO_PREAMBLE_SHORT; - } - - ret = lbs_set_radio(priv, preamble, 1); - if (ret) - goto out; - - /* Build the start command */ - memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - - memcpy(cmd.ssid, assoc_req->ssid, assoc_req->ssid_len); - - lbs_deb_join("ADHOC_START: SSID '%s', ssid length %u\n", - mv8686_print_ssid(ssid, assoc_req->ssid, assoc_req->ssid_len), - assoc_req->ssid_len); - - cmd.bsstype = CMD_BSS_TYPE_IBSS; - - if (priv->beacon_period == 0) - priv->beacon_period = MRVDRV_BEACON_INTERVAL; - cmd.beaconperiod = cpu_to_le16(priv->beacon_period); - - WARN_ON(!assoc_req->channel); - - /* set Physical parameter set */ - cmd.phyparamset.dsparamset.elementid = WLAN_EID_DS_PARAMS; - cmd.phyparamset.dsparamset.len = 1; - cmd.phyparamset.dsparamset.currentchan = assoc_req->channel; - - /* set IBSS parameter set */ - cmd.ssparamset.ibssparamset.elementid = WLAN_EID_IBSS_PARAMS; - cmd.ssparamset.ibssparamset.len = 2; - cmd.ssparamset.ibssparamset.atimwindow = 0; - - /* set capability info */ - tmpcap = WLAN_CAPABILITY_IBSS; - if (assoc_req->secinfo.wep_enabled) { - lbs_deb_join("ADHOC_START: WEP enabled, setting privacy on\n"); - tmpcap |= WLAN_CAPABILITY_PRIVACY; - } else - lbs_deb_join("ADHOC_START: WEP disabled, setting privacy off\n"); - - cmd.capability = cpu_to_le16(tmpcap); - - /* Only v8 and below support setting probe delay */ - if (priv->fwrelease < 0x09000000) - cmd.probedelay = cpu_to_le16(CMD_SCAN_PROBE_DELAY_TIME); - - ratesize = min(sizeof(cmd.rates), sizeof(lbs_bg_rates)); - memcpy(cmd.rates, lbs_bg_rates, ratesize); - - /* Copy the ad-hoc creating rates into Current BSS state structure */ - memset(&priv->curbssparams.rates, 0, sizeof(priv->curbssparams.rates)); - memcpy(&priv->curbssparams.rates, &cmd.rates, ratesize); - - /* Set MSB on basic rates as the firmware requires, but _after_ - * copying to current bss rates. - */ - lbs_set_basic_rate_flags(cmd.rates, ratesize); - - lbs_deb_join("ADHOC_START: rates=%02x %02x %02x %02x\n", - cmd.rates[0], cmd.rates[1], cmd.rates[2], cmd.rates[3]); - - if (lbs_create_dnld_countryinfo_11d(priv)) { - lbs_deb_join("ADHOC_START: dnld_countryinfo_11d failed\n"); - ret = -1; - goto out; - } - - lbs_deb_join("ADHOC_START: Starting Ad-Hoc BSS on channel %d, band %d\n", - assoc_req->channel, assoc_req->band); - - priv->adhoccreate = 1; - priv->mode = IW_MODE_ADHOC; - - ret = lbs_cmd_with_response(priv, CMD_802_11_AD_HOC_START, &cmd); - if (ret == 0) - ret = lbs_adhoc_post(priv, (struct cmd_header *) &cmd); - -out: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - -/** - * @brief Stop and Ad-Hoc network and exit Ad-Hoc mode - * - * @param priv A pointer to struct lbs_private structure - * @return 0 on success, or an error - */ -int lbs_adhoc_stop(struct lbs_private *priv) -{ - struct cmd_ds_802_11_ad_hoc_stop cmd; - int ret; - - lbs_deb_enter(LBS_DEB_JOIN); - - memset(&cmd, 0, sizeof (cmd)); - cmd.hdr.size = cpu_to_le16 (sizeof (cmd)); - - ret = lbs_cmd_with_response(priv, CMD_802_11_AD_HOC_STOP, &cmd); - - /* Clean up everything even if there was an error */ - lbs_mac_event_disconnected(priv); - - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} -#endif - -static inline int match_bss_no_security(struct lbs_802_11_security *secinfo, - struct bss_descriptor *match_bss) -{ - if (!secinfo->wep_enabled && !secinfo->WPAenabled - && !secinfo->WPA2enabled - && match_bss->wpa_ie[0] != WLAN_EID_GENERIC - && match_bss->rsn_ie[0] != WLAN_EID_RSN - && !(match_bss->capability & WLAN_CAPABILITY_PRIVACY)) - return 1; - else - return 0; -} - -static inline int match_bss_static_wep(struct lbs_802_11_security *secinfo, - struct bss_descriptor *match_bss) -{ - if (secinfo->wep_enabled && !secinfo->WPAenabled - && !secinfo->WPA2enabled - && (match_bss->capability & WLAN_CAPABILITY_PRIVACY)) - return 1; - else - return 0; -} - -static inline int match_bss_wpa(struct lbs_802_11_security *secinfo, - struct bss_descriptor *match_bss) -{ - if (!secinfo->wep_enabled && secinfo->WPAenabled - && (match_bss->wpa_ie[0] == WLAN_EID_GENERIC) - /* privacy bit may NOT be set in some APs like LinkSys WRT54G - && (match_bss->capability & WLAN_CAPABILITY_PRIVACY) */ - ) - return 1; - else - return 0; -} - -static inline int match_bss_wpa2(struct lbs_802_11_security *secinfo, - struct bss_descriptor *match_bss) -{ - if (!secinfo->wep_enabled && secinfo->WPA2enabled && - (match_bss->rsn_ie[0] == WLAN_EID_RSN) - /* privacy bit may NOT be set in some APs like LinkSys WRT54G - (match_bss->capability & WLAN_CAPABILITY_PRIVACY) */ - ) - return 1; - else - return 0; -} - -static inline int match_bss_dynamic_wep(struct lbs_802_11_security *secinfo, - struct bss_descriptor *match_bss) -{ - if (!secinfo->wep_enabled && !secinfo->WPAenabled - && !secinfo->WPA2enabled - && (match_bss->wpa_ie[0] != WLAN_EID_GENERIC) - && (match_bss->rsn_ie[0] != WLAN_EID_RSN) - && (match_bss->capability & WLAN_CAPABILITY_PRIVACY)) - return 1; - else - return 0; -} - -/** - * @brief Check if a scanned network compatible with the driver settings - * - * WEP WPA WPA2 ad-hoc encrypt Network - * enabled enabled enabled AES mode privacy WPA WPA2 Compatible - * 0 0 0 0 NONE 0 0 0 yes No security - * 1 0 0 0 NONE 1 0 0 yes Static WEP - * 0 1 0 0 x 1x 1 x yes WPA - * 0 0 1 0 x 1x x 1 yes WPA2 - * 0 0 0 1 NONE 1 0 0 yes Ad-hoc AES - * 0 0 0 0 !=NONE 1 0 0 yes Dynamic WEP - * - * - * @param priv A pointer to struct lbs_private - * @param index Index in scantable to check against current driver settings - * @param mode Network mode: Infrastructure or IBSS - * - * @return Index in scantable, or error code if negative - */ -static int is_network_compatible(struct lbs_private *priv, - struct bss_descriptor *bss, uint8_t mode) -{ - int matched = 0; - - lbs_deb_enter(LBS_DEB_SCAN); - - if (bss->mode != mode) - goto done; - - matched = match_bss_no_security(&priv->secinfo, bss); - if (matched) - goto done; - matched = match_bss_static_wep(&priv->secinfo, bss); - if (matched) - goto done; - matched = match_bss_wpa(&priv->secinfo, bss); - if (matched) { - lbs_deb_scan("is_network_compatible() WPA: wpa_ie 0x%x " - "wpa2_ie 0x%x WEP %s WPA %s WPA2 %s " - "privacy 0x%x\n", bss->wpa_ie[0], bss->rsn_ie[0], - priv->secinfo.wep_enabled ? "e" : "d", - priv->secinfo.WPAenabled ? "e" : "d", - priv->secinfo.WPA2enabled ? "e" : "d", - (bss->capability & WLAN_CAPABILITY_PRIVACY)); - goto done; - } - matched = match_bss_wpa2(&priv->secinfo, bss); - if (matched) { - lbs_deb_scan("is_network_compatible() WPA2: wpa_ie 0x%x " - "wpa2_ie 0x%x WEP %s WPA %s WPA2 %s " - "privacy 0x%x\n", bss->wpa_ie[0], bss->rsn_ie[0], - priv->secinfo.wep_enabled ? "e" : "d", - priv->secinfo.WPAenabled ? "e" : "d", - priv->secinfo.WPA2enabled ? "e" : "d", - (bss->capability & WLAN_CAPABILITY_PRIVACY)); - goto done; - } - matched = match_bss_dynamic_wep(&priv->secinfo, bss); - if (matched) { - lbs_deb_scan("is_network_compatible() dynamic WEP: " - "wpa_ie 0x%x wpa2_ie 0x%x privacy 0x%x\n", - bss->wpa_ie[0], bss->rsn_ie[0], - (bss->capability & WLAN_CAPABILITY_PRIVACY)); - goto done; - } - - /* bss security settings don't match those configured on card */ - lbs_deb_scan("is_network_compatible() FAILED: wpa_ie 0x%x " - "wpa2_ie 0x%x WEP %s WPA %s WPA2 %s privacy 0x%x\n", - bss->wpa_ie[0], bss->rsn_ie[0], - priv->secinfo.wep_enabled ? "e" : "d", - priv->secinfo.WPAenabled ? "e" : "d", - priv->secinfo.WPA2enabled ? "e" : "d", - (bss->capability & WLAN_CAPABILITY_PRIVACY)); - -done: - lbs_deb_leave_args(LBS_DEB_SCAN, "matched: %d", matched); - return matched; -} - -/** - * @brief This function finds a specific compatible BSSID in the scan list - * - * Used in association code - * - * @param priv A pointer to struct lbs_private - * @param bssid BSSID to find in the scan list - * @param mode Network mode: Infrastructure or IBSS - * - * @return index in BSSID list, or error return code (< 0) - */ -static struct bss_descriptor *lbs_find_bssid_in_list(struct lbs_private *priv, - uint8_t *bssid, uint8_t mode) -{ - struct bss_descriptor *iter_bss; - struct bss_descriptor *found_bss = NULL; - - lbs_deb_enter(LBS_DEB_SCAN); - - if (!bssid) - goto out; - - lbs_deb_hex(LBS_DEB_SCAN, "looking for", bssid, ETH_ALEN); - - /* Look through the scan table for a compatible match. The loop will - * continue past a matched bssid that is not compatible in case there - * is an AP with multiple SSIDs assigned to the same BSSID - */ - mutex_lock(&priv->lock); - list_for_each_entry(iter_bss, &priv->network_list, list) { - if (compare_ether_addr(iter_bss->bssid, bssid)) - continue; /* bssid doesn't match */ - switch (mode) { - case IW_MODE_INFRA: - case IW_MODE_ADHOC: - if (!is_network_compatible(priv, iter_bss, mode)) - break; - found_bss = iter_bss; - break; - default: - found_bss = iter_bss; - break; - } - } - mutex_unlock(&priv->lock); - -out: - lbs_deb_leave_args(LBS_DEB_SCAN, "found_bss %p", found_bss); - return found_bss; -} - -/** - * @brief This function finds ssid in ssid list. - * - * Used in association code - * - * @param priv A pointer to struct lbs_private - * @param ssid SSID to find in the list - * @param bssid BSSID to qualify the SSID selection (if provided) - * @param mode Network mode: Infrastructure or IBSS - * - * @return index in BSSID list - */ -static struct bss_descriptor *lbs_find_ssid_in_list(struct lbs_private *priv, - uint8_t *ssid, uint8_t ssid_len, - uint8_t *bssid, uint8_t mode, - int channel) -{ - u32 bestrssi = 0; - struct bss_descriptor *iter_bss = NULL; - struct bss_descriptor *found_bss = NULL; - struct bss_descriptor *tmp_oldest = NULL; - - lbs_deb_enter(LBS_DEB_SCAN); - - mutex_lock(&priv->lock); - - list_for_each_entry(iter_bss, &priv->network_list, list) { - if (!tmp_oldest || - (iter_bss->last_scanned < tmp_oldest->last_scanned)) - tmp_oldest = iter_bss; - - if (lbs_ssid_cmp(iter_bss->ssid, iter_bss->ssid_len, - ssid, ssid_len) != 0) - continue; /* ssid doesn't match */ - if (bssid && compare_ether_addr(iter_bss->bssid, bssid) != 0) - continue; /* bssid doesn't match */ - if ((channel > 0) && (iter_bss->channel != channel)) - continue; /* channel doesn't match */ - - switch (mode) { - case IW_MODE_INFRA: - case IW_MODE_ADHOC: - if (!is_network_compatible(priv, iter_bss, mode)) - break; - - if (bssid) { - /* Found requested BSSID */ - found_bss = iter_bss; - goto out; - } - - if (SCAN_RSSI(iter_bss->rssi) > bestrssi) { - bestrssi = SCAN_RSSI(iter_bss->rssi); - found_bss = iter_bss; - } - break; - case IW_MODE_AUTO: - default: - if (SCAN_RSSI(iter_bss->rssi) > bestrssi) { - bestrssi = SCAN_RSSI(iter_bss->rssi); - found_bss = iter_bss; - } - break; - } - } - -out: - mutex_unlock(&priv->lock); - lbs_deb_leave_args(LBS_DEB_SCAN, "found_bss %p", found_bss); - return found_bss; -} - -static int assoc_helper_essid(struct lbs_private *priv, - struct assoc_request * assoc_req) -{ - int ret = 0; - struct bss_descriptor * bss; - int channel = -1; - DECLARE_SSID_BUF(ssid); - - lbs_deb_enter(LBS_DEB_ASSOC); - - /* FIXME: take channel into account when picking SSIDs if a channel - * is set. - */ - - if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) - channel = assoc_req->channel; - - lbs_deb_assoc - //printk - ("SSID '%s' requested\n", - mv8686_print_ssid(ssid, assoc_req->ssid, assoc_req->ssid_len)); - if (assoc_req->mode == IW_MODE_INFRA) { - /* Find in list first -- Yongle Lai */ - bss = lbs_find_ssid_in_list(priv, assoc_req->ssid, - assoc_req->ssid_len, NULL, IW_MODE_INFRA, channel); - if (bss == NULL) - { - lbs_send_specific_ssid_scan(priv, assoc_req->ssid, assoc_req->ssid_len); - bss = lbs_find_ssid_in_list(priv, assoc_req->ssid, - assoc_req->ssid_len, NULL, IW_MODE_INFRA, channel); - } - else - printk("Needn't special scan for this ssid to do association.\n"); - - if (bss != NULL) { - memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); - ret = lbs_associate(priv, assoc_req); - } else { - printk("WIFI-ERROR: SSID <%s> not found; cannot associate\n", assoc_req->ssid); - } - } - -#if (MV8686_SUPPORT_ADHOC == 1) - - else if (assoc_req->mode == IW_MODE_ADHOC) { - /* Scan for the network, do not save previous results. Stale - * scan data will cause us to join a non-existant adhoc network - */ - lbs_send_specific_ssid_scan(priv, assoc_req->ssid, - assoc_req->ssid_len); - - /* Search for the requested SSID in the scan table */ - bss = lbs_find_ssid_in_list(priv, assoc_req->ssid, - assoc_req->ssid_len, NULL, IW_MODE_ADHOC, channel); - if (bss != NULL) { - lbs_deb_assoc("SSID found, will join\n"); - memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); - lbs_adhoc_join(priv, assoc_req); - } else { - /* else send START command */ - lbs_deb_assoc("SSID not found, creating adhoc network\n"); - memcpy(&assoc_req->bss.ssid, &assoc_req->ssid, - IW_ESSID_MAX_SIZE); - assoc_req->bss.ssid_len = assoc_req->ssid_len; - lbs_adhoc_start(priv, assoc_req); - } - } -#endif - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - - -static int assoc_helper_bssid(struct lbs_private *priv, - struct assoc_request * assoc_req) -{ - int ret = 0; - struct bss_descriptor * bss; - - lbs_deb_enter_args(LBS_DEB_ASSOC, "BSSID %pM", assoc_req->bssid); - - /* Search for index position in list for requested MAC */ - bss = lbs_find_bssid_in_list(priv, assoc_req->bssid, - assoc_req->mode); - if (bss == NULL) { - lbs_deb_assoc("ASSOC: WAP: BSSID %pM not found, " - "cannot associate.\n", assoc_req->bssid); - goto out; - } - - memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); - if (assoc_req->mode == IW_MODE_INFRA) { - ret = lbs_associate(priv, assoc_req); - lbs_deb_assoc("ASSOC: lbs_associate(bssid) returned %d\n", ret); - } -#if (MV8686_SUPPORT_ADHOC == 1) - - else if (assoc_req->mode == IW_MODE_ADHOC) { - lbs_adhoc_join(priv, assoc_req); - } -#endif - -out: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - - -static int assoc_helper_associate(struct lbs_private *priv, - struct assoc_request * assoc_req) -{ - int ret = 0, done = 0; - - lbs_deb_enter(LBS_DEB_ASSOC); - - /* If we're given and 'any' BSSID, try associating based on SSID */ - - if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { - if (compare_ether_addr(bssid_any, assoc_req->bssid) - && compare_ether_addr(bssid_off, assoc_req->bssid)) { - ret = assoc_helper_bssid(priv, assoc_req); - done = 1; - } - } - - if (!done && test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { - ret = assoc_helper_essid(priv, assoc_req); - } - - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - -#if (NEW_MV8686_PS == 1) -static int assoc_helper_mode(struct lbs_private *priv, - struct assoc_request * assoc_req) -{ - int ret = 0; - - lbs_deb_enter(LBS_DEB_ASSOC); - - if (assoc_req->mode == priv->mode) - goto done; - - if (assoc_req->mode == IW_MODE_INFRA) { - if (priv->psstate != PS_STATE_FULL_POWER) - lbs_ps_wakeup(priv, CMD_OPTION_WAITFORRSP); - priv->psmode = LBS802_11POWERMODECAM; - } - - priv->mode = assoc_req->mode; - ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE, assoc_req->mode); - -done: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} -#endif - -static int assoc_helper_channel(struct lbs_private *priv, - struct assoc_request * assoc_req) -{ - int ret = 0; - - lbs_deb_enter(LBS_DEB_ASSOC); - - ret = lbs_update_channel(priv); - if (ret) { - lbs_deb_assoc("ASSOC: channel: error getting channel.\n"); - goto done; - } - - if (assoc_req->channel == priv->curbssparams.channel) - goto done; - - lbs_deb_assoc("ASSOC: channel: %d -> %d\n", - priv->curbssparams.channel, assoc_req->channel); - - ret = lbs_set_channel(priv, assoc_req->channel); - if (ret < 0) - lbs_deb_assoc("ASSOC: channel: error setting channel.\n"); - - /* FIXME: shouldn't need to grab the channel _again_ after setting - * it since the firmware is supposed to return the new channel, but - * whatever... */ - ret = lbs_update_channel(priv); - if (ret) { - lbs_deb_assoc("ASSOC: channel: error getting channel.\n"); - goto done; - } - - if (assoc_req->channel != priv->curbssparams.channel) { - lbs_deb_assoc("ASSOC: channel: failed to update channel to %d\n", - assoc_req->channel); - goto restore_mesh; - } - - if ( assoc_req->secinfo.wep_enabled - && (assoc_req->wep_keys[0].len - || assoc_req->wep_keys[1].len - || assoc_req->wep_keys[2].len - || assoc_req->wep_keys[3].len)) { - /* Make sure WEP keys are re-sent to firmware */ - set_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags); - } - - /* Must restart/rejoin adhoc networks after channel change */ - set_bit(ASSOC_FLAG_SSID, &assoc_req->flags); - - restore_mesh: - done: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - - -static int assoc_helper_wep_keys(struct lbs_private *priv, - struct assoc_request *assoc_req) -{ - int i; - int ret = 0; - - lbs_deb_enter(LBS_DEB_ASSOC); - - /* Set or remove WEP keys */ - if (assoc_req->wep_keys[0].len || assoc_req->wep_keys[1].len || - assoc_req->wep_keys[2].len || assoc_req->wep_keys[3].len) - ret = lbs_cmd_802_11_set_wep(priv, CMD_ACT_ADD, assoc_req); - else - ret = lbs_cmd_802_11_set_wep(priv, CMD_ACT_REMOVE, assoc_req); - - if (ret) - goto out; - - /* enable/disable the MAC's WEP packet filter */ - if (assoc_req->secinfo.wep_enabled) - priv->mac_control |= CMD_ACT_MAC_WEP_ENABLE; - else - priv->mac_control &= ~CMD_ACT_MAC_WEP_ENABLE; - - lbs_set_mac_control(priv); - - mutex_lock(&priv->lock); - - /* Copy WEP keys into priv wep key fields */ - for (i = 0; i < 4; i++) { - memcpy(&priv->wep_keys[i], &assoc_req->wep_keys[i], - sizeof(struct enc_key)); - } - priv->wep_tx_keyidx = assoc_req->wep_tx_keyidx; - - mutex_unlock(&priv->lock); - -out: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - -static int assoc_helper_secinfo(struct lbs_private *priv, - struct assoc_request * assoc_req) -{ - int ret = 0; - uint16_t do_wpa; - uint16_t rsn = 0; - - lbs_deb_enter(LBS_DEB_ASSOC); - - memcpy(&priv->secinfo, &assoc_req->secinfo, - sizeof(struct lbs_802_11_security)); - - lbs_set_mac_control(priv); - - /* If RSN is already enabled, don't try to enable it again, since - * ENABLE_RSN resets internal state machines and will clobber the - * 4-way WPA handshake. - */ - - /* Get RSN enabled/disabled */ - ret = lbs_cmd_802_11_enable_rsn(priv, CMD_ACT_GET, &rsn); - if (ret) { - lbs_deb_assoc("Failed to get RSN status: %d\n", ret); - goto out; - } - - /* Don't re-enable RSN if it's already enabled */ - do_wpa = assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled; - if (do_wpa == rsn) - goto out; - - /* Set RSN enabled/disabled */ - ret = lbs_cmd_802_11_enable_rsn(priv, CMD_ACT_SET, &do_wpa); - -out: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - - -static int assoc_helper_wpa_keys(struct lbs_private *priv, - struct assoc_request * assoc_req) -{ - int ret = 0; - unsigned int flags = assoc_req->flags; - - lbs_deb_enter(LBS_DEB_ASSOC); - - /* Work around older firmware bug where WPA unicast and multicast - * keys must be set independently. Seen in SDIO parts with firmware - * version 5.0.11p0. - */ - - if (test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { - clear_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags); - ret = lbs_cmd_802_11_key_material(priv, CMD_ACT_SET, assoc_req); - assoc_req->flags = flags; - } - - if (ret) - goto out; - - if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) { - clear_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags); - - ret = lbs_cmd_802_11_key_material(priv, CMD_ACT_SET, assoc_req); - assoc_req->flags = flags; - } - -out: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - - -static int assoc_helper_wpa_ie(struct lbs_private *priv, - struct assoc_request * assoc_req) -{ - int ret = 0; - - lbs_deb_enter(LBS_DEB_ASSOC); - - if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) { - memcpy(&priv->wpa_ie, &assoc_req->wpa_ie, assoc_req->wpa_ie_len); - priv->wpa_ie_len = assoc_req->wpa_ie_len; - } else { - memset(&priv->wpa_ie, 0, MAX_WPA_IE_LEN); - priv->wpa_ie_len = 0; - } - - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - - -static int should_deauth_infrastructure(struct lbs_private *priv, - struct assoc_request * assoc_req) -{ - int ret = 0; - - if (priv->connect_status != LBS_CONNECTED) - return 0; - - lbs_deb_enter(LBS_DEB_ASSOC); - if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { - printk("Deauthenticating due to new SSID\n"); - ret = 1; - goto out; - } - - if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { - if (priv->secinfo.auth_mode != assoc_req->secinfo.auth_mode) { - printk("Deauthenticating due to new security\n"); - ret = 1; - goto out; - } - } - - if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { - printk("Deauthenticating due to new BSSID\n"); - ret = 1; - goto out; - } - - if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) { - printk("Deauthenticating due to channel switch\n"); - ret = 1; - goto out; - } - -#if (NEW_MV8686_PS == 1) - /* FIXME: deal with 'auto' mode somehow */ - if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) { - if (assoc_req->mode != IW_MODE_INFRA) { - lbs_deb_assoc("Deauthenticating due to leaving " - "infra mode\n"); - ret = 1; - goto out; - } - } -#endif - -out: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - -#if (MV8686_SUPPORT_ADHOC == 1) -static int should_stop_adhoc(struct lbs_private *priv, - struct assoc_request * assoc_req) -{ - lbs_deb_enter(LBS_DEB_ASSOC); - - if (priv->connect_status != LBS_CONNECTED) - return 0; - - if (lbs_ssid_cmp(priv->curbssparams.ssid, - priv->curbssparams.ssid_len, - assoc_req->ssid, assoc_req->ssid_len) != 0) - return 1; - - /* FIXME: deal with 'auto' mode somehow */ - if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) { - if (assoc_req->mode != IW_MODE_ADHOC) - return 1; - } - - if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) { - if (assoc_req->channel != priv->curbssparams.channel) - return 1; - } - - lbs_deb_leave(LBS_DEB_ASSOC); - return 0; -} -#endif - -/** - * @brief This function finds the best SSID in the Scan List - * - * Search the scan table for the best SSID that also matches the current - * adapter network preference (infrastructure or adhoc) - * - * @param priv A pointer to struct lbs_private - * - * @return index in BSSID list - */ -static struct bss_descriptor *lbs_find_best_ssid_in_list( - struct lbs_private *priv, uint8_t mode) -{ - uint8_t bestrssi = 0; - struct bss_descriptor *iter_bss; - struct bss_descriptor *best_bss = NULL; - - lbs_deb_enter(LBS_DEB_SCAN); - - mutex_lock(&priv->lock); - - list_for_each_entry(iter_bss, &priv->network_list, list) { - switch (mode) { - case IW_MODE_INFRA: - case IW_MODE_ADHOC: - if (!is_network_compatible(priv, iter_bss, mode)) - break; - if (SCAN_RSSI(iter_bss->rssi) <= bestrssi) - break; - bestrssi = SCAN_RSSI(iter_bss->rssi); - best_bss = iter_bss; - break; - case IW_MODE_AUTO: - default: - if (SCAN_RSSI(iter_bss->rssi) <= bestrssi) - break; - bestrssi = SCAN_RSSI(iter_bss->rssi); - best_bss = iter_bss; - break; - } - } - - mutex_unlock(&priv->lock); - lbs_deb_leave_args(LBS_DEB_SCAN, "best_bss %p", best_bss); - return best_bss; -} - -/** - * @brief Find the best AP - * - * Used from association worker. - * - * @param priv A pointer to struct lbs_private structure - * @param pSSID A pointer to AP's ssid - * - * @return 0--success, otherwise--fail - */ -static int lbs_find_best_network_ssid(struct lbs_private *priv, - uint8_t *out_ssid, uint8_t *out_ssid_len, uint8_t preferred_mode, - uint8_t *out_mode) -{ - int ret = -1; - struct bss_descriptor *found; - - lbs_deb_enter(LBS_DEB_SCAN); - - priv->scan_ssid_len = 0; - lbs_scan_networks(priv, 1); - if (priv->surpriseremoved) - goto out; - - found = lbs_find_best_ssid_in_list(priv, preferred_mode); - if (found && (found->ssid_len > 0)) { - memcpy(out_ssid, &found->ssid, IW_ESSID_MAX_SIZE); - *out_ssid_len = found->ssid_len; - *out_mode = found->mode; - ret = 0; - } - -out: - lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", ret); - return ret; -} - -int wep_assoc_retry = 0; - -void lbs_association_worker(struct work_struct *work) -{ - struct lbs_private *priv = container_of(work, struct lbs_private, - assoc_work.work); - struct assoc_request * assoc_req = NULL; - int ret = 0; - int find_any_ssid = 0; - DECLARE_SSID_BUF(ssid); - - lbs_deb_enter(LBS_DEB_ASSOC); - -tryagain: - //printk("lbs_association_worker\n"); - - mutex_lock(&priv->lock); - assoc_req = priv->pending_assoc_req; - priv->pending_assoc_req = NULL; - priv->in_progress_assoc_req = assoc_req; - mutex_unlock(&priv->lock); - - if (!assoc_req) - goto done; - - lbs_deb_assoc( - //printk( - "Association Request:\n" - " flags: 0x%08lx\n" - " SSID: '%s'\n" - " chann: %d\n" - " band: %d\n" - " mode: %d\n" - " BSSID: %pM\n" - " secinfo: %s%s%s\n" - " auth_mode: %d\n", - assoc_req->flags, - mv8686_print_ssid(ssid, assoc_req->ssid, assoc_req->ssid_len), - assoc_req->channel, assoc_req->band, assoc_req->mode, - assoc_req->bssid, - assoc_req->secinfo.WPAenabled ? " WPA" : "", - assoc_req->secinfo.WPA2enabled ? " WPA2" : "", - assoc_req->secinfo.wep_enabled ? " WEP" : "", - assoc_req->secinfo.auth_mode); - - /* If 'any' SSID was specified, find an SSID to associate with */ - if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags) && !assoc_req->ssid_len) - find_any_ssid = 1; - - /* But don't use 'any' SSID if there's a valid locked BSSID to use */ - if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) - { - if (compare_ether_addr(assoc_req->bssid, bssid_any) && - compare_ether_addr(assoc_req->bssid, bssid_off)) - find_any_ssid = 0; - } - - if (find_any_ssid) - { - u8 new_mode = assoc_req->mode; - - ret = lbs_find_best_network_ssid(priv, assoc_req->ssid, - &assoc_req->ssid_len, assoc_req->mode, &new_mode); - if (ret) { - lbs_deb_assoc("Could not find best network\n"); - ret = -ENETUNREACH; - goto out; - } - - /* Ensure we switch to the mode of the AP */ - if (assoc_req->mode == IW_MODE_AUTO) - { - set_bit(ASSOC_FLAG_MODE, &assoc_req->flags); - assoc_req->mode = new_mode; - } - } - - /* - * Check if the attributes being changing require deauthentication - * from the currently associated infrastructure access point. - */ - if (priv->mode == IW_MODE_INFRA) - { - if (should_deauth_infrastructure(priv, assoc_req)) { - ret = lbs_cmd_80211_deauthenticate(priv, - priv->curbssparams.bssid, - WLAN_REASON_DEAUTH_LEAVING); - if (ret) { - lbs_deb_assoc("Deauthentication due to new " - "configuration request failed: %d\n", - ret); - } - } - } -#if (MV8686_SUPPORT_ADHOC == 1) - - else if (priv->mode == IW_MODE_ADHOC) { - if (should_stop_adhoc(priv, assoc_req)) { - ret = lbs_adhoc_stop(priv); - if (ret) { - lbs_deb_assoc("Teardown of AdHoc network due to " - "new configuration request failed: %d\n", - ret); - } - - } - } -#endif - -#if (NEW_MV8686_PS == 0) - assoc_req->mode = priv->mode; -#else - /* Send the various configuration bits to the firmware */ - if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) { - ret = assoc_helper_mode(priv, assoc_req); - if (ret) - goto out; - } -#endif - - if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) { - ret = assoc_helper_channel(priv, assoc_req); - if (ret) - goto out; - } - - if ( test_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags) - || test_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags)) { - ret = assoc_helper_wep_keys(priv, assoc_req); - if (ret) - goto out; - } - - if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { - ret = assoc_helper_secinfo(priv, assoc_req); - if (ret) - goto out; - } - - if (test_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags)) { - ret = assoc_helper_wpa_ie(priv, assoc_req); - if (ret) - goto out; - } - - if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags) - || test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { - ret = assoc_helper_wpa_keys(priv, assoc_req); - if (ret) - goto out; - } - - /* - * SSID/BSSID should be the _last_ config option set, because they - * trigger the association attempt. - */ - if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags) - || test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { - int success = 1; - -#if 0 - if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) - printk("%s: Trigger association due to BSSID FLAG.\n", __func__); - else - printk("%s: Trigger association due to ESSID FLAG.\n", __func__); -#endif - - ret = assoc_helper_associate(priv, assoc_req); - if (ret) { - lbs_deb_assoc("ASSOC: association unsuccessful: %d\n", - ret); - success = 0; - } - - if (priv->connect_status != LBS_CONNECTED) { - lbs_deb_assoc("ASSOC: association unsuccessful, not connected\n"); - success = 0; - } - - if (success) - { - lbs_deb_assoc("associated to %pM\n", priv->curbssparams.bssid); - lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0, - CMD_OPTION_WAITFORRSP, 0, NULL); -#if (AUTO_REASSOC == 1) - if (priv->prev_assoc_req && priv->in_progress_assoc_req) - memcpy(priv->prev_assoc_req, priv->in_progress_assoc_req, - sizeof(struct assoc_request)); -#endif - } else { - ret = -1; - } - } - -out: - if (ret) { - lbs_deb_assoc("ASSOC: reconfiguration attempt unsuccessful: %d\n", - ret); - } - - mutex_lock(&priv->lock); - if (wep_assoc_retry == 1) - { - //printk("We are going to try association again.\n"); - wep_assoc_retry = 0; - mutex_unlock(&priv->lock); - goto tryagain; - } - priv->in_progress_assoc_req = NULL; - mutex_unlock(&priv->lock); - kfree(assoc_req); - -done: - atomic_set(&reassoc_flag, 0); - lbs_deb_leave(LBS_DEB_ASSOC); -} - - -/* - * Caller MUST hold any necessary locks - */ -struct assoc_request *lbs_get_association_request(struct lbs_private *priv) -{ - struct assoc_request * assoc_req; - - lbs_deb_enter(LBS_DEB_ASSOC); - if (!priv->pending_assoc_req) { - priv->pending_assoc_req = kzalloc(sizeof(struct assoc_request), - GFP_KERNEL); - if (!priv->pending_assoc_req) { - lbs_pr_info("Not enough memory to allocate association" - " request!\n"); - return NULL; - } - } - - /* Copy current configuration attributes to the association request, - * but don't overwrite any that are already set. - */ - assoc_req = priv->pending_assoc_req; - if (!test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { - memcpy(&assoc_req->ssid, &priv->curbssparams.ssid, - IW_ESSID_MAX_SIZE); - assoc_req->ssid_len = priv->curbssparams.ssid_len; - } - - if (!test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) - assoc_req->channel = priv->curbssparams.channel; - - if (!test_bit(ASSOC_FLAG_BAND, &assoc_req->flags)) - assoc_req->band = priv->curbssparams.band; - - if (!test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) - assoc_req->mode = priv->mode; - - if (!test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { - memcpy(&assoc_req->bssid, priv->curbssparams.bssid, - ETH_ALEN); - } - - if (!test_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags)) { - int i; - for (i = 0; i < 4; i++) { - memcpy(&assoc_req->wep_keys[i], &priv->wep_keys[i], - sizeof(struct enc_key)); - } - } - - if (!test_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags)) - assoc_req->wep_tx_keyidx = priv->wep_tx_keyidx; - - if (!test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) { - memcpy(&assoc_req->wpa_mcast_key, &priv->wpa_mcast_key, - sizeof(struct enc_key)); - } - - if (!test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { - memcpy(&assoc_req->wpa_unicast_key, &priv->wpa_unicast_key, - sizeof(struct enc_key)); - } - - if (!test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { - memcpy(&assoc_req->secinfo, &priv->secinfo, - sizeof(struct lbs_802_11_security)); - //printk("111assoc_req->secinfo.auth_mode=%d\n", assoc_req->secinfo.auth_mode); - } - - if (!test_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags)) { - memcpy(&assoc_req->wpa_ie, &priv->wpa_ie, - MAX_WPA_IE_LEN); - assoc_req->wpa_ie_len = priv->wpa_ie_len; - } - - lbs_deb_leave(LBS_DEB_ASSOC); - return assoc_req; -} - - -/** - * @brief This function prepares command of authenticate. - * - * @param priv A pointer to struct lbs_private structure - * @param cmd A pointer to cmd_ds_command structure - * @param pdata_buf Void cast of pointer to a BSSID to authenticate with - * - * @return 0 or -1 - */ -int lbs_cmd_80211_authenticate(struct lbs_private *priv, - struct cmd_ds_command *cmd, - void *pdata_buf) -{ - struct cmd_ds_802_11_authenticate *pauthenticate = &cmd->params.auth; - int ret = -1; - u8 *bssid = pdata_buf; - - lbs_deb_enter(LBS_DEB_JOIN); - - cmd->command = cpu_to_le16(CMD_802_11_AUTHENTICATE); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_authenticate) - + S_DS_GEN); - - /* translate auth mode to 802.11 defined wire value */ - switch (priv->secinfo.auth_mode) { - case IW_AUTH_ALG_OPEN_SYSTEM: - pauthenticate->authtype = 0x00; - break; - case IW_AUTH_ALG_SHARED_KEY: - pauthenticate->authtype = 0x01; - break; - case IW_AUTH_ALG_LEAP: - pauthenticate->authtype = 0x80; - break; - default: - lbs_deb_join("AUTH_CMD: invalid auth alg 0x%X\n", - priv->secinfo.auth_mode); - goto out; - } - - memcpy(pauthenticate->macaddr, bssid, ETH_ALEN); - - lbs_deb_join("AUTH_CMD: BSSID %pM, auth 0x%x\n", - bssid, pauthenticate->authtype); - ret = 0; - -out: - lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); - return ret; -} - -/** - * @brief Deauthenticate from a specific BSS - * - * @param priv A pointer to struct lbs_private structure - * @param bssid The specific BSS to deauthenticate from - * @param reason The 802.11 sec. 7.3.1.7 Reason Code for deauthenticating - * - * @return 0 on success, error on failure - */ -int lbs_cmd_80211_deauthenticate(struct lbs_private *priv, u8 bssid[ETH_ALEN], - u16 reason) -{ - struct cmd_ds_802_11_deauthenticate cmd; - int ret; - - printk("%s: enter...\n", __func__); - - lbs_deb_enter(LBS_DEB_JOIN); - - memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - memcpy(cmd.macaddr, &bssid[0], ETH_ALEN); - cmd.reasoncode = cpu_to_le16(reason); - - ret = lbs_cmd_with_response(priv, CMD_802_11_DEAUTHENTICATE, &cmd); - - /* - * Clean up everything even if there was an error; can't assume that - * we're still authenticated to the AP after trying to deauth. - */ - if ((atomic_read(&reassoc_flag) == 1) || - (priv->connect_status == LBS_DISCONNECTED)) - { - printk("Needn't send disconnected event for association.\n"); - return ret; - } - else - lbs_mac_event_disconnected(priv); - - lbs_deb_leave(LBS_DEB_JOIN); - - return ret; -} - -int lbs_cmd_80211_associate(struct lbs_private *priv, - struct cmd_ds_command *cmd, void *pdata_buf) -{ - struct cmd_ds_802_11_associate *passo = &cmd->params.associate; - int ret = 0; - struct assoc_request *assoc_req = pdata_buf; - struct bss_descriptor *bss = &assoc_req->bss; - u8 *pos; - u16 tmpcap, tmplen; - struct mrvlietypes_ssidparamset *ssid; - struct mrvlietypes_phyparamset *phy; - struct mrvlietypes_ssparamset *ss; - struct mrvlietypes_ratesparamset *rates; - struct mrvlietypes_rsnparamset *rsn; - - lbs_deb_enter(LBS_DEB_ASSOC); - - pos = (u8 *) passo; - - if (!priv) { - ret = -1; - goto done; - } - - cmd->command = cpu_to_le16(CMD_802_11_ASSOCIATE); - - memcpy(passo->peerstaaddr, bss->bssid, sizeof(passo->peerstaaddr)); - pos += sizeof(passo->peerstaaddr); - - /* set the listen interval */ - passo->listeninterval = cpu_to_le16(MRVDRV_DEFAULT_LISTEN_INTERVAL); - - pos += sizeof(passo->capability); - pos += sizeof(passo->listeninterval); - pos += sizeof(passo->bcnperiod); - pos += sizeof(passo->dtimperiod); - - ssid = (struct mrvlietypes_ssidparamset *) pos; - ssid->header.type = cpu_to_le16(TLV_TYPE_SSID); - tmplen = bss->ssid_len; - ssid->header.len = cpu_to_le16(tmplen); - memcpy(ssid->ssid, bss->ssid, tmplen); - pos += sizeof(ssid->header) + tmplen; - - phy = (struct mrvlietypes_phyparamset *) pos; - phy->header.type = cpu_to_le16(TLV_TYPE_PHY_DS); - tmplen = sizeof(phy->fh_ds.dsparamset); - phy->header.len = cpu_to_le16(tmplen); - memcpy(&phy->fh_ds.dsparamset, - &bss->phyparamset.dsparamset.currentchan, - tmplen); - pos += sizeof(phy->header) + tmplen; - - ss = (struct mrvlietypes_ssparamset *) pos; - ss->header.type = cpu_to_le16(TLV_TYPE_CF); - tmplen = sizeof(ss->cf_ibss.cfparamset); - ss->header.len = cpu_to_le16(tmplen); - pos += sizeof(ss->header) + tmplen; - - rates = (struct mrvlietypes_ratesparamset *) pos; - rates->header.type = cpu_to_le16(TLV_TYPE_RATES); - memcpy(&rates->rates, &bss->rates, MAX_RATES); - tmplen = MAX_RATES; - if (get_common_rates(priv, rates->rates, &tmplen)) { - ret = -1; - goto done; - } - pos += sizeof(rates->header) + tmplen; - rates->header.len = cpu_to_le16(tmplen); - lbs_deb_assoc("ASSOC_CMD: num rates %u\n", tmplen); - - /* Copy the infra. association rates into Current BSS state structure */ - memset(&priv->curbssparams.rates, 0, sizeof(priv->curbssparams.rates)); - memcpy(&priv->curbssparams.rates, &rates->rates, tmplen); - - /* Set MSB on basic rates as the firmware requires, but _after_ - * copying to current bss rates. - */ - lbs_set_basic_rate_flags(rates->rates, tmplen); - - if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) { - rsn = (struct mrvlietypes_rsnparamset *) pos; - /* WPA_IE or WPA2_IE */ - rsn->header.type = cpu_to_le16((u16) assoc_req->wpa_ie[0]); - tmplen = (u16) assoc_req->wpa_ie[1]; - rsn->header.len = cpu_to_le16(tmplen); - memcpy(rsn->rsnie, &assoc_req->wpa_ie[2], tmplen); - lbs_deb_hex(LBS_DEB_JOIN, "ASSOC_CMD: RSN IE", (u8 *) rsn, - sizeof(rsn->header) + tmplen); - pos += sizeof(rsn->header) + tmplen; - } - - /* update curbssparams */ - priv->curbssparams.channel = bss->phyparamset.dsparamset.currentchan; - - if (lbs_parse_dnld_countryinfo_11d(priv, bss)) { - ret = -1; - goto done; - } - - cmd->size = cpu_to_le16((u16) (pos - (u8 *) passo) + S_DS_GEN); - - /* set the capability info */ - tmpcap = (bss->capability & CAPINFO_MASK); - if (bss->mode == IW_MODE_INFRA) - tmpcap |= WLAN_CAPABILITY_ESS; - passo->capability = cpu_to_le16(tmpcap); - lbs_deb_assoc("ASSOC_CMD: capability 0x%04x\n", tmpcap); - -done: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - -static inline void lbs_postpone_association_work2(struct lbs_private *priv) -{ - //if (priv->surpriseremoved) - // return; - //cancel_delayed_work(&priv->assoc_work); - queue_delayed_work(priv->work_thread, &priv->assoc_work, HZ / 2); -} - -int lbs_ret_80211_associate(struct lbs_private *priv, - struct cmd_ds_command *resp) -{ - int ret = 0; - union iwreq_data wrqu; - struct ieeetypes_assocrsp *passocrsp; - struct bss_descriptor *bss; - u16 status_code; - - lbs_deb_enter(LBS_DEB_ASSOC); - - if (!priv->in_progress_assoc_req) { - lbs_deb_assoc("ASSOC_RESP: no in-progress assoc request\n"); - ret = -1; - goto done; - } - bss = &priv->in_progress_assoc_req->bss; - - passocrsp = (struct ieeetypes_assocrsp *) &resp->params; - - /* - * Older FW versions map the IEEE 802.11 Status Code in the association - * response to the following values returned in passocrsp->statuscode: - * - * IEEE Status Code Marvell Status Code - * 0 -> 0x0000 ASSOC_RESULT_SUCCESS - * 13 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED - * 14 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED - * 15 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED - * 16 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED - * others -> 0x0003 ASSOC_RESULT_REFUSED - * - * Other response codes: - * 0x0001 -> ASSOC_RESULT_INVALID_PARAMETERS (unused) - * 0x0002 -> ASSOC_RESULT_TIMEOUT (internal timer expired waiting for - * association response from the AP) - */ - - status_code = le16_to_cpu(passocrsp->statuscode); - switch (status_code) { - case 0x00: - break; - case 0x01: - lbs_deb_assoc("ASSOC_RESP: invalid parameters\n"); - //printk("ASSOC_RESP: invalid parameters\n"); - break; - case 0x02: - printk("ASSOC_RESP: internal timer expired while waiting for the AP\n"); - break; - case 0x03: - lbs_deb_assoc("ASSOC_RESP: association refused by AP\n"); - break; - case 0x04: - lbs_deb_assoc("ASSOC_RESP: authentication refused by AP\n"); - break; - default: - lbs_deb_assoc("ASSOC_RESP: failure reason 0x%02x unknown\n", status_code); - break; - } - - if (status_code) - { - struct assoc_request * assoc_req = NULL; - - //printk("Key mgmt: %d\n", priv->in_progress_assoc_req->secinfo.key_mgmt); - //printk("auth mode: %d\n", priv->in_progress_assoc_req->secinfo.auth_mode); - -//#if (NEW_MV8686_PS == 1) -#if 0 - if ((status_code == 0x02) && (priv->associate_retry < 10)) - { - priv->associate_retry++; - ret = RET_ASSOC_RETRY; - goto done; - } - else - priv->associate_retry = 0; -#endif - if ((wep_assoc_retry == 0) && - (priv->in_progress_assoc_req->secinfo.key_mgmt == 0) && - (priv->in_progress_assoc_req->secinfo.auth_mode == 2)) - { - //printk("Need to restart associate for WEP.\n"); - //mutex_lock(&priv->lock); - wep_assoc_retry = 1; - priv->in_progress_assoc_req->secinfo.auth_mode = 1; - assoc_req = priv->in_progress_assoc_req; - priv->pending_assoc_req = assoc_req; - priv->in_progress_assoc_req = NULL; - //mutex_unlock(&priv->lock); - //lbs_postpone_association_work2(priv); - } - else - { - printk("%s: association fail.status_code=%d\n", __func__, status_code); - lbs_mac_event_disconnected(priv); - ret = -1; - } - goto done; - } - - wep_assoc_retry = 0; - -#if (NEW_MV8686_PS == 1) - priv->associate_retry = 0; -#endif - - lbs_deb_hex(LBS_DEB_ASSOC, "ASSOC_RESP", (void *)&resp->params, - le16_to_cpu(resp->size) - S_DS_GEN); - - /* - * Send a Media Connected event, according to the Spec. - */ - printk("%s: association successfully.\n", __func__); - priv->connect_status = LBS_CONNECTED; - -#if (NEW_MV8686_PS == 1) - /* - * Add a timer to check previous association status. - */ - priv->need_reassoc = 0; - mod_timer(&priv->disconnect_timer, jiffies + msecs_to_jiffies(8 * 1000)); -#endif - - /* Update current SSID and BSSID */ - memcpy(&priv->curbssparams.ssid, &bss->ssid, IW_ESSID_MAX_SIZE); - priv->curbssparams.ssid_len = bss->ssid_len; - memcpy(priv->curbssparams.bssid, bss->bssid, ETH_ALEN); - - priv->SNR[TYPE_RXPD][TYPE_AVG] = 0; - priv->NF[TYPE_RXPD][TYPE_AVG] = 0; - - memset(priv->rawSNR, 0x00, sizeof(priv->rawSNR)); - memset(priv->rawNF, 0x00, sizeof(priv->rawNF)); - priv->nextSNRNF = 0; - priv->numSNRNF = 0; - - netif_carrier_on(priv->dev); - if (!priv->tx_pending_len) - netif_wake_queue(priv->dev); - - memcpy(wrqu.ap_addr.sa_data, priv->curbssparams.bssid, ETH_ALEN); - wrqu.ap_addr.sa_family = ARPHRD_ETHER; - wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); - -done: - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - -#if (MV8686_SUPPORT_ADHOC == 1) -static int lbs_adhoc_post(struct lbs_private *priv, struct cmd_header *resp) -{ - int ret = 0; - u16 command = le16_to_cpu(resp->command); - u16 result = le16_to_cpu(resp->result); - struct cmd_ds_802_11_ad_hoc_result *adhoc_resp; - union iwreq_data wrqu; - struct bss_descriptor *bss; - DECLARE_SSID_BUF(ssid); - - lbs_deb_enter(LBS_DEB_JOIN); - - adhoc_resp = (struct cmd_ds_802_11_ad_hoc_result *) resp; - - if (!priv->in_progress_assoc_req) { - lbs_deb_join("ADHOC_RESP: no in-progress association " - "request\n"); - ret = -1; - goto done; - } - bss = &priv->in_progress_assoc_req->bss; - - /* - * Join result code 0 --> SUCCESS - */ - if (result) { - lbs_deb_join("ADHOC_RESP: failed (result 0x%X)\n", result); - if (priv->connect_status == LBS_CONNECTED) - lbs_mac_event_disconnected(priv); - ret = -1; - goto done; - } - - /* Send a Media Connected event, according to the Spec */ - priv->connect_status = LBS_CONNECTED; - - if (command == CMD_RET(CMD_802_11_AD_HOC_START)) { - /* Update the created network descriptor with the new BSSID */ - memcpy(bss->bssid, adhoc_resp->bssid, ETH_ALEN); - } - - /* Set the BSSID from the joined/started descriptor */ - memcpy(&priv->curbssparams.bssid, bss->bssid, ETH_ALEN); - - /* Set the new SSID to current SSID */ - memcpy(&priv->curbssparams.ssid, &bss->ssid, IW_ESSID_MAX_SIZE); - priv->curbssparams.ssid_len = bss->ssid_len; - - netif_carrier_on(priv->dev); - if (!priv->tx_pending_len) - netif_wake_queue(priv->dev); - - memset(&wrqu, 0, sizeof(wrqu)); - memcpy(wrqu.ap_addr.sa_data, priv->curbssparams.bssid, ETH_ALEN); - wrqu.ap_addr.sa_family = ARPHRD_ETHER; - wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); - - lbs_deb_join("ADHOC_RESP: Joined/started '%s', BSSID %pM, channel %d\n", - mv8686_print_ssid(ssid, bss->ssid, bss->ssid_len), - priv->curbssparams.bssid, - priv->curbssparams.channel); - -done: - lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); - return ret; -} -#endif - diff --git a/drivers/net/wireless/mv8686/assoc.h b/drivers/net/wireless/mv8686/assoc.h deleted file mode 100755 index ef63aa81658a..000000000000 --- a/drivers/net/wireless/mv8686/assoc.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 2006, Red Hat, Inc. */ - -#ifndef _LBS_ASSOC_H_ -#define _LBS_ASSOC_H_ - -#include "dev.h" - -void lbs_association_worker(struct work_struct *work); -struct assoc_request *lbs_get_association_request(struct lbs_private *priv); - -struct cmd_ds_command; -int lbs_cmd_80211_authenticate(struct lbs_private *priv, - struct cmd_ds_command *cmd, - void *pdata_buf); - -#if (MV8686_SUPPORT_ADHOC == 1) -int lbs_adhoc_stop(struct lbs_private *priv); -int lbs_ret_80211_ad_hoc_start(struct lbs_private *priv, - struct cmd_ds_command *resp); -#endif - -int lbs_cmd_80211_deauthenticate(struct lbs_private *priv, - u8 bssid[ETH_ALEN], u16 reason); -int lbs_cmd_80211_associate(struct lbs_private *priv, - struct cmd_ds_command *cmd, - void *pdata_buf); - -int lbs_ret_80211_associate(struct lbs_private *priv, - struct cmd_ds_command *resp); - -#endif /* _LBS_ASSOC_H */ diff --git a/drivers/net/wireless/mv8686/cmd.c b/drivers/net/wireless/mv8686/cmd.c deleted file mode 100755 index afe5080a84f9..000000000000 --- a/drivers/net/wireless/mv8686/cmd.c +++ /dev/null @@ -1,2158 +0,0 @@ -/** - * This file contains the handling of command. - * It prepares command and sends it to firmware when it is ready. - */ - -#include -#include "lib80211.h" -#include -#include "host.h" -#include "hostcmd.h" -#include "decl.h" -#include "defs.h" -#include "dev.h" -#include "assoc.h" -#include "wext.h" -#include "cmd.h" - -static struct cmd_ctrl_node *lbs_get_cmd_ctrl_node(struct lbs_private *priv); - -/** - * @brief Simple callback that copies response back into command - * - * @param priv A pointer to struct lbs_private structure - * @param extra A pointer to the original command structure for which - * 'resp' is a response - * @param resp A pointer to the command response - * - * @return 0 on success, error on failure - */ -int lbs_cmd_copyback(struct lbs_private *priv, unsigned long extra, - struct cmd_header *resp) -{ - struct cmd_header *buf = (void *)extra; - uint16_t copy_len; - - copy_len = min(le16_to_cpu(buf->size), le16_to_cpu(resp->size)); - memcpy(buf, resp, copy_len); - return 0; -} -EXPORT_SYMBOL_GPL(lbs_cmd_copyback); - -/** - * @brief Simple callback that ignores the result. Use this if - * you just want to send a command to the hardware, but don't - * care for the result. - * - * @param priv ignored - * @param extra ignored - * @param resp ignored - * - * @return 0 for success - */ -static int lbs_cmd_async_callback(struct lbs_private *priv, unsigned long extra, - struct cmd_header *resp) -{ - return 0; -} - - -/** - * @brief Checks whether a command is allowed in Power Save mode - * - * @param command the command ID - * @return 1 if allowed, 0 if not allowed - */ -static u8 is_command_allowed_in_ps(u16 cmd) -{ - switch (cmd) { - case CMD_802_11_RSSI: - return 1; - default: - break; - } - return 0; -} - -/* - * @brief Updates the hardware details like MAC address and regulatory region - * - * @param priv A pointer to struct lbs_private structure - * - * @return 0 on success, error on failure - */ -int lbs_update_hw_spec(struct lbs_private *priv) -{ - struct cmd_ds_get_hw_spec cmd; - int ret = -1; - u32 i; - - lbs_deb_enter(LBS_DEB_CMD); - - memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - memcpy(cmd.permanentaddr, priv->current_addr, ETH_ALEN); - ret = lbs_cmd_with_response(priv, CMD_GET_HW_SPEC, &cmd); - if (ret) - goto out; - - priv->fwcapinfo = le32_to_cpu(cmd.fwcapinfo); - - /* The firmware release is in an interesting format: the patch - * level is in the most significant nibble ... so fix that: */ - priv->fwrelease = le32_to_cpu(cmd.fwrelease); - priv->fwrelease = (priv->fwrelease << 8) | - (priv->fwrelease >> 24 & 0xff); - - /* Clamp region code to 8-bit since FW spec indicates that it should - * only ever be 8-bit, even though the field size is 16-bit. Some firmware - * returns non-zero high 8 bits here. - */ - priv->regioncode = le16_to_cpu(cmd.regioncode) & 0xFF; - - /* Some firmware capabilities: - * CF card firmware 5.0.16p0: cap 0x00000303 - * USB dongle firmware 5.110.17p2: cap 0x00000303 - */ - lbs_pr_info("%pM, fw %u.%u.%up%u, cap 0x%08x region 0x%x\n", - cmd.permanentaddr, - priv->fwrelease >> 24 & 0xff, - priv->fwrelease >> 16 & 0xff, - priv->fwrelease >> 8 & 0xff, - priv->fwrelease & 0xff, - priv->fwcapinfo, priv->regioncode); - lbs_deb_cmd("GET_HW_SPEC: hardware interface 0x%x, hardware spec 0x%04x\n", - cmd.hwifversion, cmd.version); - - for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) - { - /* use the region code to search for the index */ - if (priv->regioncode == lbs_region_code_to_index[i]) - break; - } - - /* if it's unidentified region code, use the default (USA) */ - if (i >= MRVDRV_MAX_REGION_CODE) { - priv->regioncode = 0x10; - lbs_pr_info("unidentified region code; using the default (USA)\n"); - } - - /* Yongle, set default regioncode 0x10=USA. */ - priv->regioncode = 0x10; - - if (priv->current_addr[0] == 0xff) - memmove(priv->current_addr, cmd.permanentaddr, ETH_ALEN); - - memcpy(priv->dev->dev_addr, priv->current_addr, ETH_ALEN); - - if (lbs_set_regiontable(priv, priv->regioncode, 0)) { - ret = -1; - goto out; - } - - if (lbs_set_universaltable(priv, 0)) { - ret = -1; - goto out; - } - -out: - lbs_deb_leave(LBS_DEB_CMD); - return ret; -} - -int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria, - struct wol_config *p_wol_config) -{ - struct cmd_ds_host_sleep cmd_config; - int ret; - - cmd_config.hdr.size = cpu_to_le16(sizeof(cmd_config)); - cmd_config.criteria = cpu_to_le32(criteria); - cmd_config.gpio = priv->wol_gpio; - cmd_config.gap = priv->wol_gap; - - if (p_wol_config != NULL) - memcpy((uint8_t *)&cmd_config.wol_conf, (uint8_t *)p_wol_config, - sizeof(struct wol_config)); - else - cmd_config.wol_conf.action = CMD_ACT_ACTION_NONE; - - ret = lbs_cmd_with_response(priv, CMD_802_11_HOST_SLEEP_CFG, &cmd_config); - if (!ret) { - if (criteria) { - lbs_deb_cmd("Set WOL criteria to %x\n", criteria); - priv->wol_criteria = criteria; - } else - memcpy((uint8_t *) p_wol_config, - (uint8_t *)&cmd_config.wol_conf, - sizeof(struct wol_config)); - } else { - lbs_pr_info("HOST_SLEEP_CFG failed %d\n", ret); - } - - return ret; -} -EXPORT_SYMBOL_GPL(lbs_host_sleep_cfg); - -static int lbs_cmd_802_11_ps_mode(struct cmd_ds_command *cmd, - u16 cmd_action) -{ - struct cmd_ds_802_11_ps_mode *psm = &cmd->params.psmode; - - lbs_deb_enter(LBS_DEB_CMD); - - cmd->command = cpu_to_le16(CMD_802_11_PS_MODE); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_ps_mode) + - S_DS_GEN); - psm->action = cpu_to_le16(cmd_action); - psm->multipledtim = 0; - switch (cmd_action) { - case CMD_SUBCMD_ENTER_PS: - lbs_deb_cmd("PS command:" "SubCode- Enter PS\n"); - - psm->locallisteninterval = 0; - psm->nullpktinterval = 0; - psm->multipledtim = - cpu_to_le16(MRVDRV_DEFAULT_MULTIPLE_DTIM); - break; - - case CMD_SUBCMD_EXIT_PS: - lbs_deb_cmd("PS command:" "SubCode- Exit PS\n"); - break; - - case CMD_SUBCMD_SLEEP_CONFIRMED: - lbs_deb_cmd("PS command: SubCode- sleep confirm\n"); - break; - - default: - break; - } - - lbs_deb_leave(LBS_DEB_CMD); - return 0; -} - -int lbs_cmd_802_11_inactivity_timeout(struct lbs_private *priv, - uint16_t cmd_action, uint16_t *timeout) -{ - struct cmd_ds_802_11_inactivity_timeout cmd; - int ret; - - lbs_deb_enter(LBS_DEB_CMD); - - cmd.hdr.command = cpu_to_le16(CMD_802_11_INACTIVITY_TIMEOUT); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - - cmd.action = cpu_to_le16(cmd_action); - - if (cmd_action == CMD_ACT_SET) - cmd.timeout = cpu_to_le16(*timeout); - else - cmd.timeout = 0; - - ret = lbs_cmd_with_response(priv, CMD_802_11_INACTIVITY_TIMEOUT, &cmd); - - if (!ret) - *timeout = le16_to_cpu(cmd.timeout); - - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); - return 0; -} - -int lbs_cmd_802_11_sleep_params(struct lbs_private *priv, uint16_t cmd_action, - struct sleep_params *sp) -{ - struct cmd_ds_802_11_sleep_params cmd; - int ret; - - lbs_deb_enter(LBS_DEB_CMD); - - if (cmd_action == CMD_ACT_GET) { - memset(&cmd, 0, sizeof(cmd)); - } else { - cmd.error = cpu_to_le16(sp->sp_error); - cmd.offset = cpu_to_le16(sp->sp_offset); - cmd.stabletime = cpu_to_le16(sp->sp_stabletime); - cmd.calcontrol = sp->sp_calcontrol; - cmd.externalsleepclk = sp->sp_extsleepclk; - cmd.reserved = cpu_to_le16(sp->sp_reserved); - } - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - cmd.action = cpu_to_le16(cmd_action); - - ret = lbs_cmd_with_response(priv, CMD_802_11_SLEEP_PARAMS, &cmd); - - if (!ret) { - lbs_deb_cmd("error 0x%x, offset 0x%x, stabletime 0x%x, " - "calcontrol 0x%x extsleepclk 0x%x\n", - le16_to_cpu(cmd.error), le16_to_cpu(cmd.offset), - le16_to_cpu(cmd.stabletime), cmd.calcontrol, - cmd.externalsleepclk); - - sp->sp_error = le16_to_cpu(cmd.error); - sp->sp_offset = le16_to_cpu(cmd.offset); - sp->sp_stabletime = le16_to_cpu(cmd.stabletime); - sp->sp_calcontrol = cmd.calcontrol; - sp->sp_extsleepclk = cmd.externalsleepclk; - sp->sp_reserved = le16_to_cpu(cmd.reserved); - } - - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); - return 0; -} - -int lbs_cmd_802_11_set_wep(struct lbs_private *priv, uint16_t cmd_action, - struct assoc_request *assoc) -{ - struct cmd_ds_802_11_set_wep cmd; - int ret = 0; - - lbs_deb_enter(LBS_DEB_CMD); - - memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.command = cpu_to_le16(CMD_802_11_SET_WEP); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - - cmd.action = cpu_to_le16(cmd_action); - - if (cmd_action == CMD_ACT_ADD) { - int i; - - /* default tx key index */ - cmd.keyindex = cpu_to_le16(assoc->wep_tx_keyidx & - CMD_WEP_KEY_INDEX_MASK); - - /* Copy key types and material to host command structure */ - for (i = 0; i < 4; i++) { - struct enc_key *pkey = &assoc->wep_keys[i]; - - switch (pkey->len) { - case KEY_LEN_WEP_40: - cmd.keytype[i] = CMD_TYPE_WEP_40_BIT; - memmove(cmd.keymaterial[i], pkey->key, pkey->len); - lbs_deb_cmd("SET_WEP: add key %d (40 bit)\n", i); - break; - case KEY_LEN_WEP_104: - cmd.keytype[i] = CMD_TYPE_WEP_104_BIT; - memmove(cmd.keymaterial[i], pkey->key, pkey->len); - lbs_deb_cmd("SET_WEP: add key %d (104 bit)\n", i); - break; - case 0: - break; - default: - lbs_deb_cmd("SET_WEP: invalid key %d, length %d\n", - i, pkey->len); - ret = -1; - goto done; - break; - } - } - } else if (cmd_action == CMD_ACT_REMOVE) { - /* ACT_REMOVE clears _all_ WEP keys */ - - /* default tx key index */ - cmd.keyindex = cpu_to_le16(priv->wep_tx_keyidx & - CMD_WEP_KEY_INDEX_MASK); - lbs_deb_cmd("SET_WEP: remove key %d\n", priv->wep_tx_keyidx); - } - - ret = lbs_cmd_with_response(priv, CMD_802_11_SET_WEP, &cmd); -done: - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); - return ret; -} - -int lbs_cmd_802_11_enable_rsn(struct lbs_private *priv, uint16_t cmd_action, - uint16_t *enable) -{ - struct cmd_ds_802_11_enable_rsn cmd; - int ret; - - lbs_deb_enter(LBS_DEB_CMD); - - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - cmd.action = cpu_to_le16(cmd_action); - - if (cmd_action == CMD_ACT_GET) - cmd.enable = 0; - else { - if (*enable) - cmd.enable = cpu_to_le16(CMD_ENABLE_RSN); - else - cmd.enable = cpu_to_le16(CMD_DISABLE_RSN); - lbs_deb_cmd("ENABLE_RSN: %d\n", *enable); - } - - ret = lbs_cmd_with_response(priv, CMD_802_11_ENABLE_RSN, &cmd); - if (!ret && cmd_action == CMD_ACT_GET) - *enable = le16_to_cpu(cmd.enable); - - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); - return ret; -} - -static void set_one_wpa_key(struct MrvlIEtype_keyParamSet *keyparam, - struct enc_key *key) -{ - lbs_deb_enter(LBS_DEB_CMD); - - if (key->flags & KEY_INFO_WPA_ENABLED) - keyparam->keyinfo |= cpu_to_le16(KEY_INFO_WPA_ENABLED); - if (key->flags & KEY_INFO_WPA_UNICAST) - keyparam->keyinfo |= cpu_to_le16(KEY_INFO_WPA_UNICAST); - if (key->flags & KEY_INFO_WPA_MCAST) - keyparam->keyinfo |= cpu_to_le16(KEY_INFO_WPA_MCAST); - - keyparam->type = cpu_to_le16(TLV_TYPE_KEY_MATERIAL); - keyparam->keytypeid = cpu_to_le16(key->type); - keyparam->keylen = cpu_to_le16(key->len); - memcpy(keyparam->key, key->key, key->len); - - /* Length field doesn't include the {type,length} header */ - keyparam->length = cpu_to_le16(sizeof(*keyparam) - 4); - lbs_deb_leave(LBS_DEB_CMD); -} - -int lbs_cmd_802_11_key_material(struct lbs_private *priv, uint16_t cmd_action, - struct assoc_request *assoc) -{ - struct cmd_ds_802_11_key_material cmd; - int ret = 0; - int index = 0; - - lbs_deb_enter(LBS_DEB_CMD); - - cmd.action = cpu_to_le16(cmd_action); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - - if (cmd_action == CMD_ACT_GET) { - cmd.hdr.size = cpu_to_le16(S_DS_GEN + 2); - } else { - memset(cmd.keyParamSet, 0, sizeof(cmd.keyParamSet)); - - if (test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc->flags)) { - set_one_wpa_key(&cmd.keyParamSet[index], - &assoc->wpa_unicast_key); - index++; - } - - if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc->flags)) { - set_one_wpa_key(&cmd.keyParamSet[index], - &assoc->wpa_mcast_key); - index++; - } - - /* The common header and as many keys as we included */ - cmd.hdr.size = cpu_to_le16(offsetof(typeof(cmd), - keyParamSet[index])); - } - ret = lbs_cmd_with_response(priv, CMD_802_11_KEY_MATERIAL, &cmd); - /* Copy the returned key to driver private data */ - if (!ret && cmd_action == CMD_ACT_GET) { - void *buf_ptr = cmd.keyParamSet; - void *resp_end = &(&cmd)[1]; - - while (buf_ptr < resp_end) { - struct MrvlIEtype_keyParamSet *keyparam = buf_ptr; - struct enc_key *key; - uint16_t param_set_len = le16_to_cpu(keyparam->length); - uint16_t key_len = le16_to_cpu(keyparam->keylen); - uint16_t key_flags = le16_to_cpu(keyparam->keyinfo); - uint16_t key_type = le16_to_cpu(keyparam->keytypeid); - void *end; - - end = (void *)keyparam + sizeof(keyparam->type) - + sizeof(keyparam->length) + param_set_len; - - /* Make sure we don't access past the end of the IEs */ - if (end > resp_end) - break; - - if (key_flags & KEY_INFO_WPA_UNICAST) - key = &priv->wpa_unicast_key; - else if (key_flags & KEY_INFO_WPA_MCAST) - key = &priv->wpa_mcast_key; - else - break; - - /* Copy returned key into driver */ - memset(key, 0, sizeof(struct enc_key)); - if (key_len > sizeof(key->key)) - break; - key->type = key_type; - key->flags = key_flags; - key->len = key_len; - memcpy(key->key, keyparam->key, key->len); - - buf_ptr = end + 1; - } - } - - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); - return ret; -} - -/** - * @brief Set an SNMP MIB value - * - * @param priv A pointer to struct lbs_private structure - * @param oid The OID to set in the firmware - * @param val Value to set the OID to - * - * @return 0 on success, error on failure - */ -int lbs_set_snmp_mib(struct lbs_private *priv, u32 oid, u16 val) -{ - struct cmd_ds_802_11_snmp_mib cmd; - int ret; - - lbs_deb_enter(LBS_DEB_CMD); - - memset(&cmd, 0, sizeof (cmd)); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - cmd.action = cpu_to_le16(CMD_ACT_SET); - cmd.oid = cpu_to_le16((u16) oid); - - switch (oid) { - case SNMP_MIB_OID_BSS_TYPE: - cmd.bufsize = cpu_to_le16(sizeof(u8)); - cmd.value[0] = (val == IW_MODE_ADHOC) ? 2 : 1; - break; - case SNMP_MIB_OID_11D_ENABLE: - case SNMP_MIB_OID_FRAG_THRESHOLD: - case SNMP_MIB_OID_RTS_THRESHOLD: - case SNMP_MIB_OID_SHORT_RETRY_LIMIT: - case SNMP_MIB_OID_LONG_RETRY_LIMIT: - cmd.bufsize = cpu_to_le16(sizeof(u16)); - *((__le16 *)(&cmd.value)) = cpu_to_le16(val); - break; - default: - lbs_deb_cmd("SNMP_CMD: (set) unhandled OID 0x%x\n", oid); - ret = -EINVAL; - goto out; - } - - lbs_deb_cmd("SNMP_CMD: (set) oid 0x%x, oid size 0x%x, value 0x%x\n", - le16_to_cpu(cmd.oid), le16_to_cpu(cmd.bufsize), val); - - ret = lbs_cmd_with_response(priv, CMD_802_11_SNMP_MIB, &cmd); - -out: - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); - return ret; -} - -/** - * @brief Get an SNMP MIB value - * - * @param priv A pointer to struct lbs_private structure - * @param oid The OID to retrieve from the firmware - * @param out_val Location for the returned value - * - * @return 0 on success, error on failure - */ -int lbs_get_snmp_mib(struct lbs_private *priv, u32 oid, u16 *out_val) -{ - struct cmd_ds_802_11_snmp_mib cmd; - int ret; - - lbs_deb_enter(LBS_DEB_CMD); - - memset(&cmd, 0, sizeof (cmd)); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - cmd.action = cpu_to_le16(CMD_ACT_GET); - cmd.oid = cpu_to_le16(oid); - - ret = lbs_cmd_with_response(priv, CMD_802_11_SNMP_MIB, &cmd); - if (ret) - goto out; - - switch (le16_to_cpu(cmd.bufsize)) { - case sizeof(u8): - if (oid == SNMP_MIB_OID_BSS_TYPE) { - if (cmd.value[0] == 2) - *out_val = IW_MODE_ADHOC; - else - *out_val = IW_MODE_INFRA; - } else - *out_val = cmd.value[0]; - break; - case sizeof(u16): - *out_val = le16_to_cpu(*((__le16 *)(&cmd.value))); - break; - default: - lbs_deb_cmd("SNMP_CMD: (get) unhandled OID 0x%x size %d\n", - oid, le16_to_cpu(cmd.bufsize)); - break; - } - -out: - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); - return ret; -} - -/** - * @brief Get the min, max, and current TX power - * - * @param priv A pointer to struct lbs_private structure - * @param curlevel Current power level in dBm - * @param minlevel Minimum supported power level in dBm (optional) - * @param maxlevel Maximum supported power level in dBm (optional) - * - * @return 0 on success, error on failure - */ -int lbs_get_tx_power(struct lbs_private *priv, s16 *curlevel, s16 *minlevel, - s16 *maxlevel) -{ - struct cmd_ds_802_11_rf_tx_power cmd; - int ret; - - lbs_deb_enter(LBS_DEB_CMD); - - memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - cmd.action = cpu_to_le16(CMD_ACT_GET); - - ret = lbs_cmd_with_response(priv, CMD_802_11_RF_TX_POWER, &cmd); - if (ret == 0) { - *curlevel = le16_to_cpu(cmd.curlevel); - if (minlevel) - *minlevel = cmd.minlevel; - if (maxlevel) - *maxlevel = cmd.maxlevel; - } - - lbs_deb_leave(LBS_DEB_CMD); - return ret; -} - -#if (NEW_MV8686_PS == 0) -int mv8686_set_mode(struct lbs_private *priv, u8 new_mode) -{ - int ret = 0; - - lbs_deb_enter(LBS_DEB_CMD); - - if (new_mode == priv->mode) - goto done; - - if (new_mode == IW_MODE_INFRA) - { - if (priv->psstate != PS_STATE_FULL_POWER) - lbs_ps_wakeup(priv, CMD_OPTION_WAITFORRSP); - priv->psmode = LBS802_11POWERMODECAM; - } - - priv->mode = new_mode; - ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE, new_mode); - -done: - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); - - return ret; -} -#endif - -/** - * @brief Set the TX power - * - * @param priv A pointer to struct lbs_private structure - * @param dbm The desired power level in dBm - * - * @return 0 on success, error on failure - */ -int lbs_set_tx_power(struct lbs_private *priv, s16 dbm) -{ - struct cmd_ds_802_11_rf_tx_power cmd; - int ret; - - lbs_deb_enter(LBS_DEB_CMD); - - memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - cmd.action = cpu_to_le16(CMD_ACT_SET); - cmd.curlevel = cpu_to_le16(dbm); - - lbs_deb_cmd("SET_RF_TX_POWER: %d dBm\n", dbm); - - ret = lbs_cmd_with_response(priv, CMD_802_11_RF_TX_POWER, &cmd); - - lbs_deb_leave(LBS_DEB_CMD); - return ret; -} - -static int lbs_cmd_802_11_monitor_mode(struct cmd_ds_command *cmd, - u16 cmd_action, void *pdata_buf) -{ - struct cmd_ds_802_11_monitor_mode *monitor = &cmd->params.monitor; - - cmd->command = cpu_to_le16(CMD_802_11_MONITOR_MODE); - cmd->size = - cpu_to_le16(sizeof(struct cmd_ds_802_11_monitor_mode) + - S_DS_GEN); - - monitor->action = cpu_to_le16(cmd_action); - if (cmd_action == CMD_ACT_SET) { - monitor->mode = - cpu_to_le16((u16) (*(u32 *) pdata_buf)); - } - - return 0; -} - -static __le16 lbs_rate_to_fw_bitmap(int rate, int lower_rates_ok) -{ -/* Bit Rate -* 15:13 Reserved -* 12 54 Mbps -* 11 48 Mbps -* 10 36 Mbps -* 9 24 Mbps -* 8 18 Mbps -* 7 12 Mbps -* 6 9 Mbps -* 5 6 Mbps -* 4 Reserved -* 3 11 Mbps -* 2 5.5 Mbps -* 1 2 Mbps -* 0 1 Mbps -**/ - - uint16_t ratemask; - int i = lbs_data_rate_to_fw_index(rate); - if (lower_rates_ok) - ratemask = (0x1fef >> (12 - i)); - else - ratemask = (1 << i); - return cpu_to_le16(ratemask); -} - -int lbs_cmd_802_11_rate_adapt_rateset(struct lbs_private *priv, - uint16_t cmd_action) -{ - struct cmd_ds_802_11_rate_adapt_rateset cmd; - int ret; - - lbs_deb_enter(LBS_DEB_CMD); - - if (!priv->cur_rate && !priv->enablehwauto) - return -EINVAL; - - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - - cmd.action = cpu_to_le16(cmd_action); - cmd.enablehwauto = cpu_to_le16(priv->enablehwauto); - cmd.bitmap = lbs_rate_to_fw_bitmap(priv->cur_rate, priv->enablehwauto); - ret = lbs_cmd_with_response(priv, CMD_802_11_RATE_ADAPT_RATESET, &cmd); - if (!ret && cmd_action == CMD_ACT_GET) { - priv->ratebitmap = le16_to_cpu(cmd.bitmap); - priv->enablehwauto = le16_to_cpu(cmd.enablehwauto); - } - - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); - return ret; -} -EXPORT_SYMBOL_GPL(lbs_cmd_802_11_rate_adapt_rateset); - -/** - * @brief Set the data rate - * - * @param priv A pointer to struct lbs_private structure - * @param rate The desired data rate, or 0 to clear a locked rate - * - * @return 0 on success, error on failure - */ -int lbs_set_data_rate(struct lbs_private *priv, u8 rate) -{ - struct cmd_ds_802_11_data_rate cmd; - int ret = 0; - - lbs_deb_enter(LBS_DEB_CMD); - - memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - - if (rate > 0) { - cmd.action = cpu_to_le16(CMD_ACT_SET_TX_FIX_RATE); - cmd.rates[0] = lbs_data_rate_to_fw_index(rate); - if (cmd.rates[0] == 0) { - lbs_deb_cmd("DATA_RATE: invalid requested rate of" - " 0x%02X\n", rate); - ret = 0; - goto out; - } - lbs_deb_cmd("DATA_RATE: set fixed 0x%02X\n", cmd.rates[0]); - } else { - cmd.action = cpu_to_le16(CMD_ACT_SET_TX_AUTO); - lbs_deb_cmd("DATA_RATE: setting auto\n"); - } - - ret = lbs_cmd_with_response(priv, CMD_802_11_DATA_RATE, &cmd); - if (ret) - goto out; - - lbs_deb_hex(LBS_DEB_CMD, "DATA_RATE_RESP", (u8 *) &cmd, sizeof (cmd)); - - /* FIXME: get actual rates FW can do if this command actually returns - * all data rates supported. - */ - priv->cur_rate = lbs_fw_index_to_data_rate(cmd.rates[0]); - lbs_deb_cmd("DATA_RATE: current rate is 0x%02x\n", priv->cur_rate); - -out: - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); - return ret; -} - -/** - * @brief Get the radio channel - * - * @param priv A pointer to struct lbs_private structure - * - * @return The channel on success, error on failure - */ -int lbs_get_channel(struct lbs_private *priv) -{ - struct cmd_ds_802_11_rf_channel cmd; - int ret = 0; - - lbs_deb_enter(LBS_DEB_CMD); - - memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_GET); - - ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, &cmd); - if (ret) - goto out; - - ret = le16_to_cpu(cmd.channel); - lbs_deb_cmd("current radio channel is %d\n", ret); - -out: - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); - return ret; -} - -int lbs_update_channel(struct lbs_private *priv) -{ - int ret; - - /* the channel in f/w could be out of sync; get the current channel */ - lbs_deb_enter(LBS_DEB_ASSOC); - - ret = lbs_get_channel(priv); - if (ret > 0) { - priv->curbssparams.channel = ret; - ret = 0; - } - lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); - return ret; -} - -/** - * @brief Set the radio channel - * - * @param priv A pointer to struct lbs_private structure - * @param channel The desired channel, or 0 to clear a locked channel - * - * @return 0 on success, error on failure - */ -int lbs_set_channel(struct lbs_private *priv, u8 channel) -{ - struct cmd_ds_802_11_rf_channel cmd; -#ifdef DEBUG - u8 old_channel = priv->curbssparams.channel; -#endif - int ret = 0; - - lbs_deb_enter(LBS_DEB_CMD); - - memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_SET); - cmd.channel = cpu_to_le16(channel); - - ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, &cmd); - if (ret) - goto out; - - priv->curbssparams.channel = (uint8_t) le16_to_cpu(cmd.channel); - lbs_deb_cmd("channel switch from %d to %d\n", old_channel, - priv->curbssparams.channel); - -out: - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); - return ret; -} - -static int lbs_cmd_802_11_rssi(struct lbs_private *priv, - struct cmd_ds_command *cmd) -{ - - lbs_deb_enter(LBS_DEB_CMD); - cmd->command = cpu_to_le16(CMD_802_11_RSSI); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_rssi) + S_DS_GEN); - cmd->params.rssi.N = cpu_to_le16(DEFAULT_BCN_AVG_FACTOR); - - /* reset Beacon SNR/NF/RSSI values */ - priv->SNR[TYPE_BEACON][TYPE_NOAVG] = 0; - priv->SNR[TYPE_BEACON][TYPE_AVG] = 0; - priv->NF[TYPE_BEACON][TYPE_NOAVG] = 0; - priv->NF[TYPE_BEACON][TYPE_AVG] = 0; - priv->RSSI[TYPE_BEACON][TYPE_NOAVG] = 0; - priv->RSSI[TYPE_BEACON][TYPE_AVG] = 0; - - lbs_deb_leave(LBS_DEB_CMD); - return 0; -} - -static int lbs_cmd_reg_access(struct cmd_ds_command *cmdptr, - u8 cmd_action, void *pdata_buf) -{ - struct lbs_offset_value *offval; - - lbs_deb_enter(LBS_DEB_CMD); - - offval = (struct lbs_offset_value *)pdata_buf; - - switch (le16_to_cpu(cmdptr->command)) { - case CMD_MAC_REG_ACCESS: - { - struct cmd_ds_mac_reg_access *macreg; - - cmdptr->size = - cpu_to_le16(sizeof (struct cmd_ds_mac_reg_access) - + S_DS_GEN); - macreg = - (struct cmd_ds_mac_reg_access *)&cmdptr->params. - macreg; - - macreg->action = cpu_to_le16(cmd_action); - macreg->offset = cpu_to_le16((u16) offval->offset); - macreg->value = cpu_to_le32(offval->value); - - break; - } - - case CMD_BBP_REG_ACCESS: - { - struct cmd_ds_bbp_reg_access *bbpreg; - - cmdptr->size = - cpu_to_le16(sizeof - (struct cmd_ds_bbp_reg_access) - + S_DS_GEN); - bbpreg = - (struct cmd_ds_bbp_reg_access *)&cmdptr->params. - bbpreg; - - bbpreg->action = cpu_to_le16(cmd_action); - bbpreg->offset = cpu_to_le16((u16) offval->offset); - bbpreg->value = (u8) offval->value; - - break; - } - - case CMD_RF_REG_ACCESS: - { - struct cmd_ds_rf_reg_access *rfreg; - - cmdptr->size = - cpu_to_le16(sizeof - (struct cmd_ds_rf_reg_access) + - S_DS_GEN); - rfreg = - (struct cmd_ds_rf_reg_access *)&cmdptr->params. - rfreg; - - rfreg->action = cpu_to_le16(cmd_action); - rfreg->offset = cpu_to_le16((u16) offval->offset); - rfreg->value = (u8) offval->value; - - break; - } - - default: - break; - } - - lbs_deb_leave(LBS_DEB_CMD); - return 0; -} - -static int lbs_cmd_bt_access(struct cmd_ds_command *cmd, - u16 cmd_action, void *pdata_buf) -{ - struct cmd_ds_bt_access *bt_access = &cmd->params.bt; - lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action); - - cmd->command = cpu_to_le16(CMD_BT_ACCESS); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_bt_access) + S_DS_GEN); - cmd->result = 0; - bt_access->action = cpu_to_le16(cmd_action); - - switch (cmd_action) { - case CMD_ACT_BT_ACCESS_ADD: - memcpy(bt_access->addr1, pdata_buf, 2 * ETH_ALEN); - lbs_deb_hex(LBS_DEB_MESH, "BT_ADD: blinded MAC addr", bt_access->addr1, 6); - break; - case CMD_ACT_BT_ACCESS_DEL: - memcpy(bt_access->addr1, pdata_buf, 1 * ETH_ALEN); - lbs_deb_hex(LBS_DEB_MESH, "BT_DEL: blinded MAC addr", bt_access->addr1, 6); - break; - case CMD_ACT_BT_ACCESS_LIST: - bt_access->id = cpu_to_le32(*(u32 *) pdata_buf); - break; - case CMD_ACT_BT_ACCESS_RESET: - break; - case CMD_ACT_BT_ACCESS_SET_INVERT: - bt_access->id = cpu_to_le32(*(u32 *) pdata_buf); - break; - case CMD_ACT_BT_ACCESS_GET_INVERT: - break; - default: - break; - } - lbs_deb_leave(LBS_DEB_CMD); - return 0; -} - -static int lbs_cmd_fwt_access(struct cmd_ds_command *cmd, - u16 cmd_action, void *pdata_buf) -{ - struct cmd_ds_fwt_access *fwt_access = &cmd->params.fwt; - lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action); - - cmd->command = cpu_to_le16(CMD_FWT_ACCESS); - cmd->size = cpu_to_le16(sizeof(struct cmd_ds_fwt_access) + S_DS_GEN); - cmd->result = 0; - - if (pdata_buf) - memcpy(fwt_access, pdata_buf, sizeof(*fwt_access)); - else - memset(fwt_access, 0, sizeof(*fwt_access)); - - fwt_access->action = cpu_to_le16(cmd_action); - - lbs_deb_leave(LBS_DEB_CMD); - return 0; -} - -int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action, - struct cmd_ds_mesh_access *cmd) -{ - int ret; - - lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action); - - cmd->hdr.command = cpu_to_le16(CMD_MESH_ACCESS); - cmd->hdr.size = cpu_to_le16(sizeof(*cmd)); - cmd->hdr.result = 0; - - cmd->action = cpu_to_le16(cmd_action); - - ret = lbs_cmd_with_response(priv, CMD_MESH_ACCESS, cmd); - - lbs_deb_leave(LBS_DEB_CMD); - return ret; -} - -static int lbs_cmd_bcn_ctrl(struct lbs_private * priv, - struct cmd_ds_command *cmd, - u16 cmd_action) -{ - struct cmd_ds_802_11_beacon_control - *bcn_ctrl = &cmd->params.bcn_ctrl; - - lbs_deb_enter(LBS_DEB_CMD); - cmd->size = - cpu_to_le16(sizeof(struct cmd_ds_802_11_beacon_control) - + S_DS_GEN); - cmd->command = cpu_to_le16(CMD_802_11_BEACON_CTRL); - - bcn_ctrl->action = cpu_to_le16(cmd_action); - bcn_ctrl->beacon_enable = cpu_to_le16(priv->beacon_enable); - bcn_ctrl->beacon_period = cpu_to_le16(priv->beacon_period); - - lbs_deb_leave(LBS_DEB_CMD); - return 0; -} - -#if (ANDROID_POWER_SAVE == 1) - -extern int wifi_ps_status; - -#endif - -static void lbs_queue_cmd(struct lbs_private *priv, - struct cmd_ctrl_node *cmdnode) -{ - unsigned long flags; - int addtail = 1; - - lbs_deb_enter(LBS_DEB_HOST); - - if (!cmdnode) { - lbs_deb_host("QUEUE_CMD: cmdnode is NULL\n"); - goto done; - } - if (!cmdnode->cmdbuf->size) { - lbs_deb_host("DNLD_CMD: cmd size is zero\n"); - goto done; - } - cmdnode->result = 0; - - /* Exit_PS command needs to be queued in the header always. */ - if (le16_to_cpu(cmdnode->cmdbuf->command) == CMD_802_11_PS_MODE) { - struct cmd_ds_802_11_ps_mode *psm = (void *) &cmdnode->cmdbuf[1]; - - if (psm->action == cpu_to_le16(CMD_SUBCMD_EXIT_PS)) { - if (priv->psstate != PS_STATE_FULL_POWER) - addtail = 0; - } - } - - spin_lock_irqsave(&priv->driver_lock, flags); - - if (addtail) - list_add_tail(&cmdnode->list, &priv->cmdpendingq); - else - list_add(&cmdnode->list, &priv->cmdpendingq); - - spin_unlock_irqrestore(&priv->driver_lock, flags); - - lbs_deb_host("QUEUE_CMD: inserted command 0x%04x into cmdpendingq\n", - le16_to_cpu(cmdnode->cmdbuf->command)); - -done: - lbs_deb_leave(LBS_DEB_HOST); -} - -/** - * This function inserts command node to cmdfreeq - * after cleans it. Requires priv->driver_lock held. - */ -static void __lbs_cleanup_and_insert_cmd(struct lbs_private *priv, - struct cmd_ctrl_node *cmdnode) -{ - lbs_deb_enter(LBS_DEB_HOST); - - if (!cmdnode) - goto out; - - cmdnode->callback = NULL; - cmdnode->callback_arg = 0; - - memset(cmdnode->cmdbuf, 0, LBS_CMD_BUFFER_SIZE); - - list_add_tail(&cmdnode->list, &priv->cmdfreeq); - out: - lbs_deb_leave(LBS_DEB_HOST); -} - -static void lbs_cleanup_and_insert_cmd(struct lbs_private *priv, - struct cmd_ctrl_node *ptempcmd) -{ - unsigned long flags; - - spin_lock_irqsave(&priv->driver_lock, flags); - __lbs_cleanup_and_insert_cmd(priv, ptempcmd); - spin_unlock_irqrestore(&priv->driver_lock, flags); -} - -static void lbs_submit_command(struct lbs_private *priv, - struct cmd_ctrl_node *cmdnode) -{ - unsigned long flags; - struct cmd_header *cmd; - uint16_t cmdsize; - uint16_t command; - int timeo = 3 * HZ; - int ret; - - lbs_deb_enter(LBS_DEB_HOST); - - cmd = cmdnode->cmdbuf; - - spin_lock_irqsave(&priv->driver_lock, flags); - priv->cur_cmd = cmdnode; - priv->cur_cmd_retcode = 0; - spin_unlock_irqrestore(&priv->driver_lock, flags); - - cmdsize = le16_to_cpu(cmd->size); - command = le16_to_cpu(cmd->command); - - /* These commands take longer */ - if (command == CMD_802_11_SCAN || - command == CMD_802_11_ASSOCIATE || - command == CMD_802_11_AUTHENTICATE) - timeo = 5 * HZ; - - lbs_deb_cmd("DNLD_CMD: command 0x%04x, seq %d, size %d\n", - command, le16_to_cpu(cmd->seqnum), cmdsize); - lbs_deb_hex(LBS_DEB_CMD, "DNLD_CMD", (void *) cmdnode->cmdbuf, cmdsize); - - ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) cmd, cmdsize); - - if (ret) { - lbs_pr_info("DNLD_CMD: hw_host_to_card failed: %d\n", ret); - /* Let the timer kick in and retry, and potentially reset - the whole thing if the condition persists */ - timeo = HZ/4; - } - - /* - * Since there is no response for DEEP SLEEP command, don't add timer. - */ - if (command == CMD_802_11_DEEP_SLEEP) - { - priv->deepsleep = true; - priv->needtowakeup = true; - - lbs_complete_command(priv, cmdnode, ret); - - priv->dnld_sent = DNLD_RES_RECEIVED; - } - else - /* Setup the timer after transmit command */ - mod_timer(&priv->command_timer, jiffies + timeo); - - lbs_deb_leave(LBS_DEB_HOST); -} - -void lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd, - int result) -{ - if (cmd == priv->cur_cmd) - priv->cur_cmd_retcode = result; - - cmd->result = result; - cmd->cmdwaitqwoken = 1; - wake_up_interruptible(&cmd->cmdwait_q); - - if (!cmd->callback || cmd->callback == lbs_cmd_async_callback) - __lbs_cleanup_and_insert_cmd(priv, cmd); - priv->cur_cmd = NULL; -} - -int lbs_set_radio(struct lbs_private *priv, u8 preamble, u8 radio_on) -{ - struct cmd_ds_802_11_radio_control cmd; - int ret = -EINVAL; - - lbs_deb_enter(LBS_DEB_CMD); - -#if (NEW_MV8686_PS == 1) - if (priv->radio_on == radio_on) - { - //printk("%s: needn't config radio again.\n", __func__); - return 0; - } -#endif - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - cmd.action = cpu_to_le16(CMD_ACT_SET); - - /* Only v8 and below support setting the preamble */ - if (priv->fwrelease < 0x09000000) { - switch (preamble) { - case RADIO_PREAMBLE_SHORT: - if (!(priv->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)) - goto out; - /* Fall through */ - case RADIO_PREAMBLE_AUTO: - case RADIO_PREAMBLE_LONG: - cmd.control = cpu_to_le16(preamble); - break; - default: - goto out; - } - } - - if (radio_on) - cmd.control |= cpu_to_le16(0x1); - else { - cmd.control &= cpu_to_le16(~0x1); - priv->txpower_cur = 0; - } - - lbs_deb_cmd("RADIO_CONTROL: radio %s, preamble %d\n", - radio_on ? "ON" : "OFF", preamble); - - priv->radio_on = radio_on; - - ret = lbs_cmd_with_response(priv, CMD_802_11_RADIO_CONTROL, &cmd); - -out: - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); - return ret; -} - -void lbs_set_mac_control(struct lbs_private *priv) -{ - struct cmd_ds_mac_control cmd; - - lbs_deb_enter(LBS_DEB_CMD); - - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - cmd.action = cpu_to_le16(priv->mac_control); - cmd.reserved = 0; - - lbs_cmd_async(priv, CMD_MAC_CONTROL, &cmd.hdr, sizeof(cmd)); - - lbs_deb_leave(LBS_DEB_CMD); -} - -/** - * @brief This function prepare the command before send to firmware. - * - * @param priv A pointer to struct lbs_private structure - * @param cmd_no command number - * @param cmd_action command action: GET or SET - * @param wait_option wait option: wait response or not - * @param cmd_oid cmd oid: treated as sub command - * @param pdata_buf A pointer to informaion buffer - * @return 0 or -1 - */ -int lbs_prepare_and_send_command(struct lbs_private *priv, - u16 cmd_no, - u16 cmd_action, - u16 wait_option, u32 cmd_oid, void *pdata_buf) -{ - int ret = 0; - struct cmd_ctrl_node *cmdnode; - struct cmd_ds_command *cmdptr; - unsigned long flags; - - lbs_deb_enter(LBS_DEB_HOST); - - if (!priv) { - lbs_deb_host("PREP_CMD: priv is NULL\n"); - ret = -1; - goto done; - } - - if (priv->surpriseremoved) { - lbs_deb_host("PREP_CMD: card removed\n"); - ret = -1; - goto done; - } - -#if (ANDROID_POWER_SAVE == 1) - - if (wifi_ps_status != WIFI_PS_AWAKE) - { - if ((wifi_ps_status == WIFI_PS_DRV_SLEEP) && - (priv->wifi_ps_work_req == 0)) - { - printk("Wakeup wifi for assoc.\n"); - priv->wifi_ps_work_req = WIFI_PS_PRE_WAKE; - netif_stop_queue(priv->dev); - netif_carrier_off(priv->dev); - queue_delayed_work(priv->work_thread, &priv->ps_work, - msecs_to_jiffies(5)); - msleep(900); - } - else if (wifi_ps_status == WIFI_PS_PRE_SLEEP) - { - ; /* Just go on */ - } - else - { - printk("Drop the command while in system deepsleep.\n"); - ret = -1; - goto done; - } - } - else - { - if (cmd_no != CMD_802_11_RSSI) - lbs_update_ps_timer(); - } -#endif - - cmdnode = lbs_get_cmd_ctrl_node(priv); - - if (cmdnode == NULL) { - lbs_deb_host("PREP_CMD: cmdnode is NULL\n"); - - /* Wake up main thread to execute next command */ - wake_up_interruptible(&priv->waitq); - ret = -1; - goto done; - } - - cmdnode->callback = NULL; - cmdnode->callback_arg = (unsigned long)pdata_buf; - - cmdptr = (struct cmd_ds_command *)cmdnode->cmdbuf; - - lbs_deb_host("PREP_CMD: command 0x%04x\n", cmd_no); - - /* Set sequence number, command and INT option */ - priv->seqnum++; - cmdptr->seqnum = cpu_to_le16(priv->seqnum); - - cmdptr->command = cpu_to_le16(cmd_no); - cmdptr->result = 0; - - switch (cmd_no) - { - case CMD_802_11_DEEP_SLEEP: - cmdptr->size = 8; - break; - - case CMD_802_11_PS_MODE: - ret = lbs_cmd_802_11_ps_mode(cmdptr, cmd_action); - break; - - case CMD_802_11_ASSOCIATE: - case CMD_802_11_REASSOCIATE: - ret = lbs_cmd_80211_associate(priv, cmdptr, pdata_buf); - break; - - case CMD_802_11_AUTHENTICATE: - ret = lbs_cmd_80211_authenticate(priv, cmdptr, pdata_buf); - break; - - case CMD_MAC_REG_ACCESS: - case CMD_BBP_REG_ACCESS: - case CMD_RF_REG_ACCESS: - ret = lbs_cmd_reg_access(cmdptr, cmd_action, pdata_buf); - break; - - case CMD_802_11_MONITOR_MODE: - ret = lbs_cmd_802_11_monitor_mode(cmdptr, - cmd_action, pdata_buf); - break; - - case CMD_802_11_RSSI: - ret = lbs_cmd_802_11_rssi(priv, cmdptr); - break; - - case CMD_802_11_SET_AFC: - case CMD_802_11_GET_AFC: - - cmdptr->command = cpu_to_le16(cmd_no); - cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_afc) + - S_DS_GEN); - - memmove(&cmdptr->params.afc, - pdata_buf, sizeof(struct cmd_ds_802_11_afc)); - - ret = 0; - goto done; - - case CMD_802_11D_DOMAIN_INFO: - ret = lbs_cmd_802_11d_domain_info(priv, cmdptr, - cmd_no, cmd_action); - break; - - case CMD_802_11_TPC_CFG: - cmdptr->command = cpu_to_le16(CMD_802_11_TPC_CFG); - cmdptr->size = - cpu_to_le16(sizeof(struct cmd_ds_802_11_tpc_cfg) + - S_DS_GEN); - - memmove(&cmdptr->params.tpccfg, - pdata_buf, sizeof(struct cmd_ds_802_11_tpc_cfg)); - - ret = 0; - break; - case CMD_802_11_LED_GPIO_CTRL: - { - struct mrvlietypes_ledgpio *gpio = - (struct mrvlietypes_ledgpio*) - cmdptr->params.ledgpio.data; - - memmove(&cmdptr->params.ledgpio, - pdata_buf, - sizeof(struct cmd_ds_802_11_led_ctrl)); - - cmdptr->command = - cpu_to_le16(CMD_802_11_LED_GPIO_CTRL); - -#define ACTION_NUMLED_TLVTYPE_LEN_FIELDS_LEN 8 - cmdptr->size = - cpu_to_le16(le16_to_cpu(gpio->header.len) - + S_DS_GEN - + ACTION_NUMLED_TLVTYPE_LEN_FIELDS_LEN); - gpio->header.len = gpio->header.len; - - ret = 0; - break; - } - - case CMD_BT_ACCESS: - ret = lbs_cmd_bt_access(cmdptr, cmd_action, pdata_buf); - break; - - case CMD_FWT_ACCESS: - ret = lbs_cmd_fwt_access(cmdptr, cmd_action, pdata_buf); - break; - - case CMD_GET_TSF: - cmdptr->command = cpu_to_le16(CMD_GET_TSF); - cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_get_tsf) + - S_DS_GEN); - ret = 0; - break; - case CMD_802_11_BEACON_CTRL: - ret = lbs_cmd_bcn_ctrl(priv, cmdptr, cmd_action); - break; - default: - lbs_pr_err("PREP_CMD: unknown command 0x%04x\n", cmd_no); - ret = -1; - break; - } - - /* return error, since the command preparation failed */ - if (ret != 0) { - lbs_deb_host("PREP_CMD: command preparation failed\n"); - lbs_cleanup_and_insert_cmd(priv, cmdnode); - ret = -1; - goto done; - } - - cmdnode->cmdwaitqwoken = 0; - - lbs_queue_cmd(priv, cmdnode); - wake_up_interruptible(&priv->waitq); - - if (wait_option & CMD_OPTION_WAITFORRSP) { - lbs_deb_host("PREP_CMD: wait for response\n"); - might_sleep(); - wait_event_interruptible(cmdnode->cmdwait_q, - cmdnode->cmdwaitqwoken); - } - - spin_lock_irqsave(&priv->driver_lock, flags); - if (priv->cur_cmd_retcode) { - lbs_deb_host("PREP_CMD: command failed with return code %d\n", - priv->cur_cmd_retcode); - priv->cur_cmd_retcode = 0; - ret = -1; - } - spin_unlock_irqrestore(&priv->driver_lock, flags); - -done: - lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret); - return ret; -} - -/** - * @brief This function allocates the command buffer and link - * it to command free queue. - * - * @param priv A pointer to struct lbs_private structure - * @return 0 or -1 - */ -int lbs_allocate_cmd_buffer(struct lbs_private *priv) -{ - int ret = 0; - u32 bufsize; - u32 i; - struct cmd_ctrl_node *cmdarray; - - lbs_deb_enter(LBS_DEB_HOST); - - /* Allocate and initialize the command array */ - bufsize = sizeof(struct cmd_ctrl_node) * LBS_NUM_CMD_BUFFERS; - if (!(cmdarray = kzalloc(bufsize, GFP_KERNEL))) { - lbs_deb_host("ALLOC_CMD_BUF: tempcmd_array is NULL\n"); - ret = -1; - goto done; - } - priv->cmd_array = cmdarray; - - /* Allocate and initialize each command buffer in the command array */ - for (i = 0; i < LBS_NUM_CMD_BUFFERS; i++) { - cmdarray[i].cmdbuf = kzalloc(LBS_CMD_BUFFER_SIZE, GFP_KERNEL); - if (!cmdarray[i].cmdbuf) { - lbs_deb_host("ALLOC_CMD_BUF: ptempvirtualaddr is NULL\n"); - ret = -1; - goto done; - } - } - - for (i = 0; i < LBS_NUM_CMD_BUFFERS; i++) { - init_waitqueue_head(&cmdarray[i].cmdwait_q); - lbs_cleanup_and_insert_cmd(priv, &cmdarray[i]); - } - ret = 0; - -done: - lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret); - return ret; -} - -/** - * @brief This function frees the command buffer. - * - * @param priv A pointer to struct lbs_private structure - * @return 0 or -1 - */ -int lbs_free_cmd_buffer(struct lbs_private *priv) -{ - struct cmd_ctrl_node *cmdarray; - unsigned int i; - - lbs_deb_enter(LBS_DEB_HOST); - - /* need to check if cmd array is allocated or not */ - if (priv->cmd_array == NULL) { - lbs_deb_host("FREE_CMD_BUF: cmd_array is NULL\n"); - goto done; - } - - cmdarray = priv->cmd_array; - - /* Release shared memory buffers */ - for (i = 0; i < LBS_NUM_CMD_BUFFERS; i++) - { - if (cmdarray[i].cmdbuf) - { - kfree(cmdarray[i].cmdbuf); - cmdarray[i].cmdbuf = NULL; - } - } - - /* Release cmd_ctrl_node */ - if (priv->cmd_array) { - kfree(priv->cmd_array); - priv->cmd_array = NULL; - } - -done: - lbs_deb_leave(LBS_DEB_HOST); - return 0; -} - -/** - * @brief This function gets a free command node if available in - * command free queue. - * - * @param priv A pointer to struct lbs_private structure - * @return cmd_ctrl_node A pointer to cmd_ctrl_node structure or NULL - */ -static struct cmd_ctrl_node *lbs_get_cmd_ctrl_node(struct lbs_private *priv) -{ - struct cmd_ctrl_node *tempnode; - unsigned long flags; - - lbs_deb_enter(LBS_DEB_HOST); - - if (!priv) - return NULL; - - spin_lock_irqsave(&priv->driver_lock, flags); - - if (!list_empty(&priv->cmdfreeq)) { - tempnode = list_first_entry(&priv->cmdfreeq, - struct cmd_ctrl_node, list); - list_del(&tempnode->list); - } else { - lbs_deb_host("GET_CMD_NODE: cmd_ctrl_node is not available\n"); - tempnode = NULL; - } - - spin_unlock_irqrestore(&priv->driver_lock, flags); - - lbs_deb_leave(LBS_DEB_HOST); - return tempnode; -} - -extern int lbs_can_enter_deep_sleep(struct lbs_private *priv); - -/** - * @brief This function executes next command in command - * pending queue. It will put firmware back to PS mode - * if applicable. - * - * @param priv A pointer to struct lbs_private structure - * @return 0 or -1 - */ -int lbs_execute_next_command(struct lbs_private *priv) -{ - struct cmd_ctrl_node *cmdnode = NULL; - struct cmd_header *cmd; - unsigned long flags; - int ret = 0; - - /* Debug group is LBS_DEB_THREAD and not LBS_DEB_HOST, because the - * only caller to us is lbs_thread() and we get even when a - * data packet is received */ - lbs_deb_enter(LBS_DEB_THREAD); - - spin_lock_irqsave(&priv->driver_lock, flags); - - if (priv->cur_cmd) { - lbs_pr_alert( "EXEC_NEXT_CMD: already processing command!\n"); - spin_unlock_irqrestore(&priv->driver_lock, flags); - ret = -1; - goto done; - } - - if (!list_empty(&priv->cmdpendingq)) { - cmdnode = list_first_entry(&priv->cmdpendingq, - struct cmd_ctrl_node, list); - } - - spin_unlock_irqrestore(&priv->driver_lock, flags); - - if (cmdnode) - { - cmd = cmdnode->cmdbuf; - - if (is_command_allowed_in_ps(le16_to_cpu(cmd->command))) { - if ((priv->psstate == PS_STATE_SLEEP) || - (priv->psstate == PS_STATE_PRE_SLEEP)) { - lbs_deb_host( - "EXEC_NEXT_CMD: cannot send cmd 0x%04x in psstate %d\n", - le16_to_cpu(cmd->command), - priv->psstate); - ret = -1; - goto done; - } - lbs_deb_host("EXEC_NEXT_CMD: OK to send command " - "0x%04x in psstate %d\n", - le16_to_cpu(cmd->command), priv->psstate); - } else if (priv->psstate != PS_STATE_FULL_POWER) { - /* - * 1. Non-PS command: - * Queue it. set needtowakeup to TRUE if current state - * is SLEEP, otherwise call lbs_ps_wakeup to send Exit_PS. - * 2. PS command but not Exit_PS: - * Ignore it. - * 3. PS command Exit_PS: - * Set needtowakeup to TRUE if current state is SLEEP, - * otherwise send this command down to firmware - * immediately. - */ - if (cmd->command != cpu_to_le16(CMD_802_11_PS_MODE)) { - /* Prepare to send Exit PS, - * this non PS command will be sent later */ - if ((priv->psstate == PS_STATE_SLEEP) - || (priv->psstate == PS_STATE_PRE_SLEEP) - ) { - /* w/ new scheme, it will not reach here. - since it is blocked in main_thread. */ - priv->needtowakeup = 1; - } else - lbs_ps_wakeup(priv, 0); - - ret = 0; - goto done; - } else { - /* - * PS command. Ignore it if it is not Exit_PS. - * otherwise send it down immediately. - */ - struct cmd_ds_802_11_ps_mode *psm = (void *)&cmd[1]; - - lbs_deb_host( - "EXEC_NEXT_CMD: PS cmd, action 0x%02x\n", - psm->action); - if (psm->action != - cpu_to_le16(CMD_SUBCMD_EXIT_PS)) { - lbs_deb_host( - "EXEC_NEXT_CMD: ignore ENTER_PS cmd\n"); - list_del(&cmdnode->list); - spin_lock_irqsave(&priv->driver_lock, flags); - lbs_complete_command(priv, cmdnode, 0); - spin_unlock_irqrestore(&priv->driver_lock, flags); - - ret = 0; - goto done; - } - - if ((priv->psstate == PS_STATE_SLEEP) || - (priv->psstate == PS_STATE_PRE_SLEEP)) { - lbs_deb_host( - "EXEC_NEXT_CMD: ignore EXIT_PS cmd in sleep\n"); - list_del(&cmdnode->list); - spin_lock_irqsave(&priv->driver_lock, flags); - lbs_complete_command(priv, cmdnode, 0); - spin_unlock_irqrestore(&priv->driver_lock, flags); - priv->needtowakeup = 1; - - ret = 0; - goto done; - } - - lbs_deb_host( - "EXEC_NEXT_CMD: sending EXIT_PS\n"); - } - } - list_del(&cmdnode->list); - lbs_deb_host("EXEC_NEXT_CMD: sending command 0x%04x\n", - le16_to_cpu(cmd->command)); - lbs_submit_command(priv, cmdnode); - } else { - /* - * check if in power save mode, if yes, put the device back - * to PS mode. - */ - if ((priv->psmode != LBS802_11POWERMODECAM) && - (priv->psstate == PS_STATE_FULL_POWER) && - ((priv->connect_status == LBS_CONNECTED))) { - if (priv->secinfo.WPAenabled || - priv->secinfo.WPA2enabled) { - /* check for valid WPA group keys */ - if (priv->wpa_mcast_key.len || - priv->wpa_unicast_key.len) { - lbs_deb_host( - "EXEC_NEXT_CMD: WPA enabled and GTK_SET" - " go back to PS_SLEEP"); - lbs_ps_sleep(priv, 0); - } - } else { - lbs_deb_host( - "EXEC_NEXT_CMD: cmdpendingq empty, " - "go back to PS_SLEEP"); - lbs_ps_sleep(priv, 0); - } - } - else - { - if (priv->auto_deepsleep && lbs_can_enter_deep_sleep(priv)) - { - printk("Entering Auto Deep Sleep mode...\n"); - ret = lbs_prepare_and_send_command(priv, CMD_802_11_DEEP_SLEEP, 0, 0, 0, NULL); - //msleep(500); - } - } - } - - ret = 0; -done: - lbs_deb_leave(LBS_DEB_THREAD); - return ret; -} - -void lbs_send_iwevcustom_event(struct lbs_private *priv, s8 *str) -{ - union iwreq_data iwrq; - u8 buf[50]; - - lbs_deb_enter(LBS_DEB_WEXT); - - memset(&iwrq, 0, sizeof(union iwreq_data)); - memset(buf, 0, sizeof(buf)); - - snprintf(buf, sizeof(buf) - 1, "%s", str); - - iwrq.data.length = strlen(buf) + 1 + IW_EV_LCP_LEN; - - /* Send Event to upper layer */ - lbs_deb_wext("event indication string %s\n", (char *)buf); - lbs_deb_wext("event indication length %d\n", iwrq.data.length); - lbs_deb_wext("sending wireless event IWEVCUSTOM for %s\n", str); - - wireless_send_event(priv->dev, IWEVCUSTOM, &iwrq, buf); - - lbs_deb_leave(LBS_DEB_WEXT); -} - -static void lbs_send_confirmsleep(struct lbs_private *priv) -{ - unsigned long flags; - int ret; - - lbs_deb_enter(LBS_DEB_HOST); - lbs_deb_hex(LBS_DEB_HOST, "sleep confirm", (u8 *) &confirm_sleep, - sizeof(confirm_sleep)); - - ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) &confirm_sleep, - sizeof(confirm_sleep)); - if (ret) { - lbs_pr_alert("confirm_sleep failed\n"); - goto out; - } - - spin_lock_irqsave(&priv->driver_lock, flags); - - /* We don't get a response on the sleep-confirmation */ - priv->dnld_sent = DNLD_RES_RECEIVED; - - /* If nothing to do, go back to sleep (?) */ - if (!__kfifo_len(priv->event_fifo) && !priv->resp_len[priv->resp_idx]) - priv->psstate = PS_STATE_SLEEP; - - spin_unlock_irqrestore(&priv->driver_lock, flags); - -out: - lbs_deb_leave(LBS_DEB_HOST); -} - -void lbs_ps_sleep(struct lbs_private *priv, int wait_option) -{ - lbs_deb_enter(LBS_DEB_HOST); - //printk("Enter lbs_ps_sleep\n"); - - /* - * PS is currently supported only in Infrastructure mode - * Remove this check if it is to be supported in IBSS mode also - */ - - lbs_prepare_and_send_command(priv, CMD_802_11_PS_MODE, - CMD_SUBCMD_ENTER_PS, wait_option, 0, NULL); - - lbs_deb_leave(LBS_DEB_HOST); -} - -/** - * @brief This function sends Exit_PS command to firmware. - * - * @param priv A pointer to struct lbs_private structure - * @param wait_option wait response or not - * @return n/a - */ -void lbs_ps_wakeup(struct lbs_private *priv, int wait_option) -{ - __le32 Localpsmode; - - lbs_deb_enter(LBS_DEB_HOST); - //printk("lbs_ps_wakeup.\n"); - - Localpsmode = cpu_to_le32(LBS802_11POWERMODECAM); - - lbs_prepare_and_send_command(priv, CMD_802_11_PS_MODE, - CMD_SUBCMD_EXIT_PS, - wait_option, 0, &Localpsmode); - - lbs_deb_leave(LBS_DEB_HOST); -} - -/** - * @brief This function checks condition and prepares to - * send sleep confirm command to firmware if ok. - * - * @param priv A pointer to struct lbs_private structure - * @param psmode Power Saving mode - * @return n/a - */ -void lbs_ps_confirm_sleep(struct lbs_private *priv) -{ - unsigned long flags =0; - int allowed = 1; - - lbs_deb_enter(LBS_DEB_HOST); - - spin_lock_irqsave(&priv->driver_lock, flags); - if (priv->dnld_sent) { - allowed = 0; - lbs_deb_host("dnld_sent was set\n"); - } - - /* In-progress command? */ - if (priv->cur_cmd) { - allowed = 0; - lbs_deb_host("cur_cmd was set\n"); - } - - /* Pending events or command responses? */ - if (__kfifo_len(priv->event_fifo) || priv->resp_len[priv->resp_idx]) { - allowed = 0; - lbs_deb_host("pending events or command responses\n"); - } - spin_unlock_irqrestore(&priv->driver_lock, flags); - - if (allowed) { - lbs_deb_host("sending lbs_ps_confirm_sleep\n"); - lbs_send_confirmsleep(priv); - } else { - lbs_deb_host("sleep confirm has been delayed\n"); - } - - lbs_deb_leave(LBS_DEB_HOST); -} - - -/** - * @brief Configures the transmission power control functionality. - * - * @param priv A pointer to struct lbs_private structure - * @param enable Transmission power control enable - * @param p0 Power level when link quality is good (dBm). - * @param p1 Power level when link quality is fair (dBm). - * @param p2 Power level when link quality is poor (dBm). - * @param usesnr Use Signal to Noise Ratio in TPC - * - * @return 0 on success - */ -int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1, - int8_t p2, int usesnr) -{ - struct cmd_ds_802_11_tpc_cfg cmd; - int ret; - - memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - cmd.action = cpu_to_le16(CMD_ACT_SET); - cmd.enable = !!enable; - cmd.usesnr = !!usesnr; - cmd.P0 = p0; - cmd.P1 = p1; - cmd.P2 = p2; - - ret = lbs_cmd_with_response(priv, CMD_802_11_TPC_CFG, &cmd); - - return ret; -} - -/** - * @brief Configures the power adaptation settings. - * - * @param priv A pointer to struct lbs_private structure - * @param enable Power adaptation enable - * @param p0 Power level for 1, 2, 5.5 and 11 Mbps (dBm). - * @param p1 Power level for 6, 9, 12, 18, 22, 24 and 36 Mbps (dBm). - * @param p2 Power level for 48 and 54 Mbps (dBm). - * - * @return 0 on Success - */ - -int lbs_set_power_adapt_cfg(struct lbs_private *priv, int enable, int8_t p0, - int8_t p1, int8_t p2) -{ - struct cmd_ds_802_11_pa_cfg cmd; - int ret; - - memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - cmd.action = cpu_to_le16(CMD_ACT_SET); - cmd.enable = !!enable; - cmd.P0 = p0; - cmd.P1 = p1; - cmd.P2 = p2; - - ret = lbs_cmd_with_response(priv, CMD_802_11_PA_CFG , &cmd); - - return ret; -} - -static struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv, - uint16_t command, struct cmd_header *in_cmd, int in_cmd_size, - int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *), - unsigned long callback_arg) -{ - struct cmd_ctrl_node *cmdnode; - - lbs_deb_enter(LBS_DEB_HOST); - - if (priv->surpriseremoved) { - lbs_deb_host("PREP_CMD: card removed\n"); - cmdnode = ERR_PTR(-ENOENT); - goto done; - } - - cmdnode = lbs_get_cmd_ctrl_node(priv); - if (cmdnode == NULL) { - lbs_deb_host("PREP_CMD: cmdnode is NULL\n"); - - /* Wake up main thread to execute next command */ - wake_up_interruptible(&priv->waitq); - cmdnode = ERR_PTR(-ENOBUFS); - goto done; - } - - cmdnode->callback = callback; - cmdnode->callback_arg = callback_arg; - - /* Copy the incoming command to the buffer */ - memcpy(cmdnode->cmdbuf, in_cmd, in_cmd_size); - - /* Set sequence number, clean result, move to buffer */ - priv->seqnum++; - cmdnode->cmdbuf->command = cpu_to_le16(command); - cmdnode->cmdbuf->size = cpu_to_le16(in_cmd_size); - cmdnode->cmdbuf->seqnum = cpu_to_le16(priv->seqnum); - cmdnode->cmdbuf->result = 0; - - lbs_deb_host("PREP_CMD: command 0x%04x\n", command); - - cmdnode->cmdwaitqwoken = 0; - lbs_queue_cmd(priv, cmdnode); - wake_up_interruptible(&priv->waitq); - - done: - lbs_deb_leave_args(LBS_DEB_HOST, "ret %p", cmdnode); - return cmdnode; -} - -void lbs_cmd_async(struct lbs_private *priv, uint16_t command, - struct cmd_header *in_cmd, int in_cmd_size) -{ - lbs_deb_enter(LBS_DEB_CMD); - __lbs_cmd_async(priv, command, in_cmd, in_cmd_size, - lbs_cmd_async_callback, 0); - lbs_deb_leave(LBS_DEB_CMD); -} - -int __lbs_cmd(struct lbs_private *priv, uint16_t command, - struct cmd_header *in_cmd, int in_cmd_size, - int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *), - unsigned long callback_arg) -{ - struct cmd_ctrl_node *cmdnode; - unsigned long flags; - int ret = 0; - - lbs_deb_enter(LBS_DEB_HOST); - -#if (ANDROID_POWER_SAVE == 1) - - if (wifi_ps_status != WIFI_PS_AWAKE) - { - if ((wifi_ps_status == WIFI_PS_DRV_SLEEP) && - (priv->wifi_ps_work_req == 0)) - { - printk("Wakeup wifi for assoc.\n"); - priv->wifi_ps_work_req = WIFI_PS_PRE_WAKE; - netif_stop_queue(priv->dev); - netif_carrier_off(priv->dev); - queue_delayed_work(priv->work_thread, &priv->ps_work, - msecs_to_jiffies(5)); - msleep(900); - } - else - { - printk("Drop the command while in system deepsleep.\n"); - ret = -1; - goto done; - } - } - else - { - lbs_update_ps_timer(); - } -#endif - - cmdnode = __lbs_cmd_async(priv, command, in_cmd, in_cmd_size, - callback, callback_arg); - if (IS_ERR(cmdnode)) { - ret = PTR_ERR(cmdnode); - goto done; - } - - might_sleep(); - wait_event_interruptible(cmdnode->cmdwait_q, cmdnode->cmdwaitqwoken); - - spin_lock_irqsave(&priv->driver_lock, flags); - ret = cmdnode->result; - if (ret) - lbs_pr_info("PREP_CMD: command 0x%04x failed: %d\n", - command, ret); - - __lbs_cleanup_and_insert_cmd(priv, cmdnode); - spin_unlock_irqrestore(&priv->driver_lock, flags); - -done: - lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret); - return ret; -} -EXPORT_SYMBOL_GPL(__lbs_cmd); - - diff --git a/drivers/net/wireless/mv8686/cmd.h b/drivers/net/wireless/mv8686/cmd.h deleted file mode 100755 index 470afddb43e5..000000000000 --- a/drivers/net/wireless/mv8686/cmd.h +++ /dev/null @@ -1,89 +0,0 @@ -/* Copyright (C) 2007, Red Hat, Inc. */ - -#ifndef _LBS_CMD_H_ -#define _LBS_CMD_H_ - -#include "hostcmd.h" -#include "dev.h" - -/* lbs_cmd() infers the size of the buffer to copy data back into, from - the size of the target of the pointer. Since the command to be sent - may often be smaller, that size is set in cmd->size by the caller.*/ -#define lbs_cmd(priv, cmdnr, cmd, cb, cb_arg) ({ \ - uint16_t __sz = le16_to_cpu((cmd)->hdr.size); \ - (cmd)->hdr.size = cpu_to_le16(sizeof(*(cmd))); \ - __lbs_cmd(priv, cmdnr, &(cmd)->hdr, __sz, cb, cb_arg); \ -}) - -#define lbs_cmd_with_response(priv, cmdnr, cmd) \ - lbs_cmd(priv, cmdnr, cmd, lbs_cmd_copyback, (unsigned long) (cmd)) - -void lbs_cmd_async(struct lbs_private *priv, uint16_t command, - struct cmd_header *in_cmd, int in_cmd_size); - -int __lbs_cmd(struct lbs_private *priv, uint16_t command, - struct cmd_header *in_cmd, int in_cmd_size, - int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *), - unsigned long callback_arg); - -int lbs_set_power_adapt_cfg(struct lbs_private *priv, int enable, int8_t p0, - int8_t p1, int8_t p2); - -int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1, - int8_t p2, int usesnr); - -int lbs_set_power_adapt_cfg(struct lbs_private *priv, int enable, int8_t p0, - int8_t p1, int8_t p2); - -int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1, - int8_t p2, int usesnr); - -int lbs_cmd_copyback(struct lbs_private *priv, unsigned long extra, - struct cmd_header *resp); - -int lbs_update_hw_spec(struct lbs_private *priv); - -//int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action, -// struct cmd_ds_mesh_access *cmd); - -int lbs_set_data_rate(struct lbs_private *priv, u8 rate); - -int lbs_get_channel(struct lbs_private *priv); -int lbs_set_channel(struct lbs_private *priv, u8 channel); - -//int lbs_mesh_config_send(struct lbs_private *priv, -// struct cmd_ds_mesh_config *cmd, -// uint16_t action, uint16_t type); -//int lbs_mesh_config(struct lbs_private *priv, uint16_t enable, uint16_t chan); - -int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria, - struct wol_config *p_wol_config); -//int lbs_suspend(struct lbs_private *priv); -//void lbs_resume(struct lbs_private *priv); - -int lbs_cmd_802_11_rate_adapt_rateset(struct lbs_private *priv, - uint16_t cmd_action); -int lbs_cmd_802_11_inactivity_timeout(struct lbs_private *priv, - uint16_t cmd_action, uint16_t *timeout); -int lbs_cmd_802_11_sleep_params(struct lbs_private *priv, uint16_t cmd_action, - struct sleep_params *sp); -int lbs_cmd_802_11_set_wep(struct lbs_private *priv, uint16_t cmd_action, - struct assoc_request *assoc); -int lbs_cmd_802_11_enable_rsn(struct lbs_private *priv, uint16_t cmd_action, - uint16_t *enable); -int lbs_cmd_802_11_key_material(struct lbs_private *priv, uint16_t cmd_action, - struct assoc_request *assoc); - -int lbs_get_tx_power(struct lbs_private *priv, s16 *curlevel, s16 *minlevel, - s16 *maxlevel); -int lbs_set_tx_power(struct lbs_private *priv, s16 dbm); - -int lbs_set_radio(struct lbs_private *priv, u8 preamble, u8 radio_on); - -int lbs_set_snmp_mib(struct lbs_private *priv, u32 oid, u16 val); - -int lbs_get_snmp_mib(struct lbs_private *priv, u32 oid, u16 *out_val); - -int mv8686_set_mode(struct lbs_private *priv, u8 new_mode); - -#endif /* _LBS_CMD_H */ diff --git a/drivers/net/wireless/mv8686/cmdresp.c b/drivers/net/wireless/mv8686/cmdresp.c deleted file mode 100755 index 018a36eb8b05..000000000000 --- a/drivers/net/wireless/mv8686/cmdresp.c +++ /dev/null @@ -1,718 +0,0 @@ -/** - * This file contains the handling of command - * responses as well as events generated by firmware. - */ -#include -#include -#include -#include - -#include - -#include "host.h" -#include "decl.h" -#include "defs.h" -#include "dev.h" -#include "assoc.h" -#include "wext.h" - -/* - * Defined in main.c - */ -extern atomic_t reassoc_flag; - -/** - * @brief This function handles disconnect event. it - * reports disconnect to upper layer, clean tx/rx packets, - * reset link state etc. - * - * @param priv A pointer to struct lbs_private structure - * @return n/a - */ -void lbs_mac_event_disconnected(struct lbs_private *priv) -{ - union iwreq_data wrqu; - - printk("%s: enter........connect=%d\n", __func__, priv->connect_status); - - if (priv->connect_status != LBS_CONNECTED) - return; - - lbs_deb_enter(LBS_DEB_ASSOC); - - memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN); - wrqu.ap_addr.sa_family = ARPHRD_ETHER; - - /* - * Cisco AP sends EAP failure and de-auth in less than 0.5 ms. - * It causes problem in the Supplicant - */ - - msleep_interruptible(1000); - wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); - - /* report disconnect to upper layer */ - netif_stop_queue(priv->dev); - netif_carrier_off(priv->dev); - - /* Free Tx and Rx packets */ - kfree_skb(priv->currenttxskb); - priv->currenttxskb = NULL; - priv->tx_pending_len = 0; - - /* reset SNR/NF/RSSI values */ - memset(priv->SNR, 0x00, sizeof(priv->SNR)); - memset(priv->NF, 0x00, sizeof(priv->NF)); - memset(priv->RSSI, 0x00, sizeof(priv->RSSI)); - memset(priv->rawSNR, 0x00, sizeof(priv->rawSNR)); - memset(priv->rawNF, 0x00, sizeof(priv->rawNF)); - priv->nextSNRNF = 0; - priv->numSNRNF = 0; - priv->connect_status = LBS_DISCONNECTED; - - /* Clear out associated SSID and BSSID since connection is - * no longer valid. - */ - memset(&priv->curbssparams.bssid, 0, ETH_ALEN); - memset(&priv->curbssparams.ssid, 0, IW_ESSID_MAX_SIZE); - priv->curbssparams.ssid_len = 0; - - if (priv->psstate != PS_STATE_FULL_POWER) { - /* make firmware to exit PS mode */ - lbs_deb_cmd("disconnected, so exit PS mode\n"); - lbs_ps_wakeup(priv, 0); - } - lbs_deb_leave(LBS_DEB_ASSOC); -} - -/** - * @brief This function handles MIC failure event. - * - * @param priv A pointer to struct lbs_private structure - * @para event the event id - * @return n/a - */ -static void handle_mic_failureevent(struct lbs_private *priv, u32 event) -{ - char buf[50]; - - lbs_deb_enter(LBS_DEB_CMD); - memset(buf, 0, sizeof(buf)); - - sprintf(buf, "%s", "MLME-MICHAELMICFAILURE.indication "); - - if (event == MACREG_INT_CODE_MIC_ERR_UNICAST) { - strcat(buf, "unicast "); - } else { - strcat(buf, "multicast "); - } - - lbs_send_iwevcustom_event(priv, buf); - lbs_deb_leave(LBS_DEB_CMD); -} - -static int lbs_ret_reg_access(struct lbs_private *priv, - u16 type, struct cmd_ds_command *resp) -{ - int ret = 0; - - lbs_deb_enter(LBS_DEB_CMD); - - switch (type) { - case CMD_RET(CMD_MAC_REG_ACCESS): - { - struct cmd_ds_mac_reg_access *reg = &resp->params.macreg; - - priv->offsetvalue.offset = (u32)le16_to_cpu(reg->offset); - priv->offsetvalue.value = le32_to_cpu(reg->value); - break; - } - - case CMD_RET(CMD_BBP_REG_ACCESS): - { - struct cmd_ds_bbp_reg_access *reg = &resp->params.bbpreg; - - priv->offsetvalue.offset = (u32)le16_to_cpu(reg->offset); - priv->offsetvalue.value = reg->value; - break; - } - - case CMD_RET(CMD_RF_REG_ACCESS): - { - struct cmd_ds_rf_reg_access *reg = &resp->params.rfreg; - - priv->offsetvalue.offset = (u32)le16_to_cpu(reg->offset); - priv->offsetvalue.value = reg->value; - break; - } - - default: - ret = -1; - } - - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); - return ret; -} - -static int lbs_ret_802_11_rssi(struct lbs_private *priv, - struct cmd_ds_command *resp) -{ - struct cmd_ds_802_11_rssi_rsp *rssirsp = &resp->params.rssirsp; - - lbs_deb_enter(LBS_DEB_CMD); - - /* store the non average value */ - priv->SNR[TYPE_BEACON][TYPE_NOAVG] = le16_to_cpu(rssirsp->SNR); - priv->NF[TYPE_BEACON][TYPE_NOAVG] = le16_to_cpu(rssirsp->noisefloor); - - priv->SNR[TYPE_BEACON][TYPE_AVG] = le16_to_cpu(rssirsp->avgSNR); - priv->NF[TYPE_BEACON][TYPE_AVG] = le16_to_cpu(rssirsp->avgnoisefloor); - - priv->RSSI[TYPE_BEACON][TYPE_NOAVG] = - CAL_RSSI(priv->SNR[TYPE_BEACON][TYPE_NOAVG], - priv->NF[TYPE_BEACON][TYPE_NOAVG]); - - priv->RSSI[TYPE_BEACON][TYPE_AVG] = - CAL_RSSI(priv->SNR[TYPE_BEACON][TYPE_AVG] / AVG_SCALE, - priv->NF[TYPE_BEACON][TYPE_AVG] / AVG_SCALE); - - lbs_deb_cmd("RSSI: beacon %d, avg %d\n", - priv->RSSI[TYPE_BEACON][TYPE_NOAVG], - priv->RSSI[TYPE_BEACON][TYPE_AVG]); - - lbs_deb_leave(LBS_DEB_CMD); - return 0; -} - -static int lbs_ret_802_11_bcn_ctrl(struct lbs_private * priv, - struct cmd_ds_command *resp) -{ - struct cmd_ds_802_11_beacon_control *bcn_ctrl = - &resp->params.bcn_ctrl; - - lbs_deb_enter(LBS_DEB_CMD); - - if (bcn_ctrl->action == CMD_ACT_GET) { - priv->beacon_enable = (u8) le16_to_cpu(bcn_ctrl->beacon_enable); - priv->beacon_period = le16_to_cpu(bcn_ctrl->beacon_period); - } - - lbs_deb_enter(LBS_DEB_CMD); - return 0; -} - -static inline int handle_cmd_response(struct lbs_private *priv, - struct cmd_header *cmd_response) -{ - struct cmd_ds_command *resp = (struct cmd_ds_command *) cmd_response; - int ret = 0; - unsigned long flags; - uint16_t respcmd = le16_to_cpu(resp->command); - - lbs_deb_enter(LBS_DEB_HOST); - - switch (respcmd) { - case CMD_RET(CMD_MAC_REG_ACCESS): - case CMD_RET(CMD_BBP_REG_ACCESS): - case CMD_RET(CMD_RF_REG_ACCESS): - ret = lbs_ret_reg_access(priv, respcmd, resp); - break; - - case CMD_RET_802_11_ASSOCIATE: - case CMD_RET(CMD_802_11_ASSOCIATE): - case CMD_RET(CMD_802_11_REASSOCIATE): - ret = lbs_ret_80211_associate(priv, resp); - break; - - case CMD_RET(CMD_802_11_SET_AFC): - case CMD_RET(CMD_802_11_GET_AFC): - spin_lock_irqsave(&priv->driver_lock, flags); - memmove((void *)priv->cur_cmd->callback_arg, &resp->params.afc, - sizeof(struct cmd_ds_802_11_afc)); - spin_unlock_irqrestore(&priv->driver_lock, flags); - - break; - - case CMD_RET(CMD_802_11_AUTHENTICATE): - case CMD_RET(CMD_802_11_BEACON_STOP): - break; - - case CMD_RET(CMD_802_11_RSSI): - ret = lbs_ret_802_11_rssi(priv, resp); - break; - - case CMD_RET(CMD_802_11D_DOMAIN_INFO): - ret = lbs_ret_802_11d_domain_info(resp); - break; - - case CMD_RET(CMD_802_11_TPC_CFG): - spin_lock_irqsave(&priv->driver_lock, flags); - memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg, - sizeof(struct cmd_ds_802_11_tpc_cfg)); - spin_unlock_irqrestore(&priv->driver_lock, flags); - break; - case CMD_RET(CMD_802_11_LED_GPIO_CTRL): - spin_lock_irqsave(&priv->driver_lock, flags); - memmove((void *)priv->cur_cmd->callback_arg, &resp->params.ledgpio, - sizeof(struct cmd_ds_802_11_led_ctrl)); - spin_unlock_irqrestore(&priv->driver_lock, flags); - break; - - case CMD_RET(CMD_GET_TSF): - spin_lock_irqsave(&priv->driver_lock, flags); - memcpy((void *)priv->cur_cmd->callback_arg, - &resp->params.gettsf.tsfvalue, sizeof(u64)); - spin_unlock_irqrestore(&priv->driver_lock, flags); - break; - case CMD_RET(CMD_BT_ACCESS): - spin_lock_irqsave(&priv->driver_lock, flags); - if (priv->cur_cmd->callback_arg) - memcpy((void *)priv->cur_cmd->callback_arg, - &resp->params.bt.addr1, 2 * ETH_ALEN); - spin_unlock_irqrestore(&priv->driver_lock, flags); - break; - case CMD_RET(CMD_FWT_ACCESS): - spin_lock_irqsave(&priv->driver_lock, flags); - if (priv->cur_cmd->callback_arg) - memcpy((void *)priv->cur_cmd->callback_arg, &resp->params.fwt, - sizeof(resp->params.fwt)); - spin_unlock_irqrestore(&priv->driver_lock, flags); - break; - case CMD_RET(CMD_802_11_BEACON_CTRL): - ret = lbs_ret_802_11_bcn_ctrl(priv, resp); - break; - - default: - lbs_pr_err("CMD_RESP: unknown cmd response 0x%04x\n", - le16_to_cpu(resp->command)); - break; - } - lbs_deb_leave(LBS_DEB_HOST); - return ret; -} - -int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len) -{ - uint16_t respcmd, curcmd; - struct cmd_header *resp; - int ret = 0; - unsigned long flags; - uint16_t result; - - lbs_deb_enter(LBS_DEB_HOST); - - mutex_lock(&priv->lock); - spin_lock_irqsave(&priv->driver_lock, flags); - - if (!priv->cur_cmd) { - lbs_deb_host("CMD_RESP: cur_cmd is NULL\n"); - ret = -1; - spin_unlock_irqrestore(&priv->driver_lock, flags); - goto done; - } - - resp = (void *)data; - curcmd = le16_to_cpu(priv->cur_cmd->cmdbuf->command); - respcmd = le16_to_cpu(resp->command); - result = le16_to_cpu(resp->result); - - lbs_deb_cmd("CMD_RESP: response 0x%04x, seq %d, size %d\n", - respcmd, le16_to_cpu(resp->seqnum), len); - lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", (void *) resp, len); - - if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) { - lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n", - le16_to_cpu(resp->seqnum), le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum)); - spin_unlock_irqrestore(&priv->driver_lock, flags); - ret = -1; - goto done; - } - if (respcmd != CMD_RET(curcmd) && - respcmd != CMD_RET_802_11_ASSOCIATE && curcmd != CMD_802_11_ASSOCIATE) { - lbs_pr_info("Invalid CMD_RESP %x to command %x!\n", respcmd, curcmd); - spin_unlock_irqrestore(&priv->driver_lock, flags); - ret = -1; - goto done; - } - - if (resp->result == cpu_to_le16(0x0004)) { - /* 0x0004 means -EAGAIN. Drop the response, let it time out - and be resubmitted */ - lbs_pr_info("Firmware returns DEFER to command %x. Will let it time out...\n", - le16_to_cpu(resp->command)); - spin_unlock_irqrestore(&priv->driver_lock, flags); - ret = -1; - goto done; - } - - /* Now we got response from FW, cancel the command timer */ - del_timer(&priv->command_timer); - priv->cmd_timed_out = 0; - if (priv->nr_retries) { - lbs_pr_info("Received result %x to command %x after %d retries\n", - result, curcmd, priv->nr_retries); - priv->nr_retries = 0; - } - - /* Store the response code to cur_cmd_retcode. */ - priv->cur_cmd_retcode = result; - - if (respcmd == CMD_RET(CMD_802_11_PS_MODE)) { - struct cmd_ds_802_11_ps_mode *psmode = (void *) &resp[1]; - u16 action = le16_to_cpu(psmode->action); - - lbs_deb_host( - "CMD_RESP: PS_MODE cmd reply result 0x%x, action 0x%x\n", - result, action); - - if (result) { - lbs_deb_host("CMD_RESP: PS command failed with 0x%x\n", - result); - /* - * We should not re-try enter-ps command in - * ad-hoc mode. It takes place in - * lbs_execute_next_command(). - */ - if (priv->mode == IW_MODE_ADHOC && - action == CMD_SUBCMD_ENTER_PS) - priv->psmode = LBS802_11POWERMODECAM; - } else if (action == CMD_SUBCMD_ENTER_PS) { - priv->needtowakeup = 0; - priv->psstate = PS_STATE_AWAKE; - - lbs_deb_host("CMD_RESP: ENTER_PS command response\n"); - if (priv->connect_status != LBS_CONNECTED) { - /* - * When Deauth Event received before Enter_PS command - * response, We need to wake up the firmware. - */ - lbs_deb_host( - "disconnected, invoking lbs_ps_wakeup\n"); - - spin_unlock_irqrestore(&priv->driver_lock, flags); - mutex_unlock(&priv->lock); - lbs_ps_wakeup(priv, 0); - mutex_lock(&priv->lock); - spin_lock_irqsave(&priv->driver_lock, flags); - } - } else if (action == CMD_SUBCMD_EXIT_PS) { - priv->needtowakeup = 0; - priv->psstate = PS_STATE_FULL_POWER; - lbs_deb_host("CMD_RESP: EXIT_PS command response\n"); - } else { - lbs_deb_host("CMD_RESP: PS action 0x%X\n", action); - } - - lbs_complete_command(priv, priv->cur_cmd, result); - spin_unlock_irqrestore(&priv->driver_lock, flags); - - ret = 0; - goto done; - } - - /* If the command is not successful, cleanup and return failure */ - if ((result != 0 || !(respcmd & 0x8000))) { - lbs_deb_host("CMD_RESP: error 0x%04x in command reply 0x%04x\n", - result, respcmd); - /* - * Handling errors here - */ - switch (respcmd) { - case CMD_RET(CMD_GET_HW_SPEC): - case CMD_RET(CMD_802_11_RESET): - lbs_deb_host("CMD_RESP: reset failed\n"); - break; - - } - lbs_complete_command(priv, priv->cur_cmd, result); - spin_unlock_irqrestore(&priv->driver_lock, flags); - - ret = -1; - goto done; - } - - spin_unlock_irqrestore(&priv->driver_lock, flags); - - if (priv->cur_cmd && priv->cur_cmd->callback) { - ret = priv->cur_cmd->callback(priv, priv->cur_cmd->callback_arg, - resp); - } else - ret = handle_cmd_response(priv, resp); - - spin_lock_irqsave(&priv->driver_lock, flags); - - if (priv->cur_cmd) { - /* Clean up and Put current command back to cmdfreeq */ - lbs_complete_command(priv, priv->cur_cmd, result); - } - spin_unlock_irqrestore(&priv->driver_lock, flags); - -done: - mutex_unlock(&priv->lock); - lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret); - return ret; -} - -static int lbs_send_confirmwake(struct lbs_private *priv) -{ - struct cmd_header cmd; - int ret = 0; - - lbs_deb_enter(LBS_DEB_HOST); - - cmd.command = cpu_to_le16(CMD_802_11_WAKEUP_CONFIRM); - cmd.size = cpu_to_le16(sizeof(cmd)); - cmd.seqnum = cpu_to_le16(++priv->seqnum); - cmd.result = 0; - - lbs_deb_hex(LBS_DEB_HOST, "wake confirm", (u8 *) &cmd, - sizeof(cmd)); - - ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) &cmd, sizeof(cmd)); - if (ret) - lbs_pr_alert("SEND_WAKEC_CMD: Host to Card failed for Confirm Wake\n"); - - lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret); - return ret; -} - -#if (AUTO_REASSOC == 1) - -#if (ANDROID_POWER_SAVE == 1) -extern int wifi_ps_status; -#endif - -static inline void lbs_postpone_association_work(struct lbs_private *priv) -{ - if (priv->surpriseremoved) - return; - -#if (ANDROID_POWER_SAVE == 1) - - if (wifi_ps_status != WIFI_PS_AWAKE) - { - if ((wifi_ps_status == WIFI_PS_DRV_SLEEP) && - (priv->wifi_ps_work_req == 0)) - { - printk("Wakeup wifi for assoc.\n"); - priv->wifi_ps_work_req = WIFI_PS_PRE_WAKE; - /* - * Carrier off will make dhcpcd do discover....Yongle Lai. - */ - netif_stop_queue(priv->dev); - //netif_carrier_off(priv->dev); - queue_delayed_work(priv->work_thread, &priv->ps_work, - msecs_to_jiffies(5)); - msleep(900); - } - } - else - lbs_update_ps_timer(); -#endif - //printk("Got a assoc related command....\n"); - cancel_delayed_work(&priv->assoc_work); - queue_delayed_work(priv->work_thread, &priv->assoc_work, 10); -} - -int lbs_disconnect_prepare(struct lbs_private *priv) -{ - struct assoc_request *assoc_req; - - if (priv->prev_assoc_req->flags != 0) - { - assoc_req = lbs_get_association_request(priv); - if ((assoc_req != NULL) && priv->prev_assoc_req) - { - printk("Trying to re-associate to previous AP.\n"); - memcpy(assoc_req, priv->prev_assoc_req, sizeof(struct assoc_request)); - priv->prev_assoc_req->flags = 0; /* Clear this association. */ - lbs_postpone_association_work(priv); - return 1; - } - } - atomic_set(&reassoc_flag, 0); - printk("%s: go to be disconnected.\n", __func__); - - lbs_mac_event_disconnected(priv); - - return 0; -} -#endif - -extern int lbs_reset_deep_sleep_wakeup(struct lbs_private * priv); - -int lbs_process_event(struct lbs_private *priv, u32 event) -{ - int ret = 0; - //static int reassoc_count = 0; - - lbs_deb_enter(LBS_DEB_CMD); - - switch (event) { - case MACREG_INT_CODE_LINK_SENSED: - lbs_deb_cmd("EVENT: link sensed\n"); - printk("EVENT: link sensed\n"); - break; - - case MACREG_INT_CODE_DISASSOCIATED: - printk("EVENT: disassociated: connected=%d\n", priv->connect_status); - lbs_mac_event_disconnected(priv); -#if 0 -#if (AUTO_REASSOC == 1) - if (priv->connect_status == LBS_CONNECTED) - lbs_disconnect_prepare(priv); - else - { - printk("disconnected status.\n"); - lbs_mac_event_disconnected(priv); - } -#else - lbs_mac_event_disconnected(priv); -#endif -#endif - break; - - case MACREG_INT_CODE_LINK_LOST_NO_SCAN: - case MACREG_INT_CODE_DEAUTHENTICATED: - /* - * The DEAUTHENTICATED event will be triggered by conditions: - * 1. Authentication was failed. - * 2. Authentication was expired. - */ - if (event == MACREG_INT_CODE_DEAUTHENTICATED) - printk("EVENT: deauthenticated: "); - else - printk("EVENT: link lost: "); - -#if (AUTO_REASSOC == 1) - - printk("reassoc_count=%d\n", priv->reassoc_count); - - if ((priv->connect_status == LBS_CONNECTED) && - (priv->reassoc_count < 2) && - (priv->need_reassoc == 1)) - { - atomic_set(&reassoc_flag, 1); - lbs_disconnect_prepare(priv); - priv->reassoc_count++; - } - else - { - printk("disconnected status.\n"); - lbs_mac_event_disconnected(priv); - priv->reassoc_count = 0; - } -#else - printk("\n"); - lbs_mac_event_disconnected(priv); -#endif - break; - - case MACREG_INT_CODE_PS_SLEEP: - lbs_deb_cmd("EVENT: ps sleep\n"); - - /* handle unexpected PS SLEEP event */ - if (priv->psstate == PS_STATE_FULL_POWER) { - lbs_deb_cmd( - "EVENT: in FULL POWER mode, ignoreing PS_SLEEP\n"); - break; - } - priv->psstate = PS_STATE_PRE_SLEEP; - - lbs_ps_confirm_sleep(priv); - - break; - - case MACREG_INT_CODE_HOST_AWAKE: - lbs_deb_cmd("EVENT: host awake\n"); - lbs_send_confirmwake(priv); - break; - - case MACREG_INT_CODE_PS_AWAKE: - lbs_deb_cmd("EVENT: ps awake\n"); -#if 0 - printk("EVENT: ps awake: "); - if (priv->connect_status == LBS_CONNECTED) - printk("Media is LBS_CONNECTED.\n"); - else - printk("Media is LBS_DISCONNECTED.\n"); -#endif - /* - * Handle unexpected PS AWAKE event. - */ - if (priv->psstate == PS_STATE_FULL_POWER) { - lbs_deb_cmd("EVENT: In FULL POWER mode - ignore PS AWAKE\n"); - break; - } - - priv->psstate = PS_STATE_AWAKE; - - if (priv->needtowakeup) { - /* - * wait for the command processing to finish - * before resuming sending - * priv->needtowakeup will be set to FALSE - * in lbs_ps_wakeup() - */ - lbs_deb_cmd("waking up ...\n"); - lbs_ps_wakeup(priv, 0); - } - break; - - case MACREG_INT_CODE_MIC_ERR_UNICAST: - lbs_deb_cmd("EVENT: UNICAST MIC ERROR\n"); - handle_mic_failureevent(priv, MACREG_INT_CODE_MIC_ERR_UNICAST); - break; - - case MACREG_INT_CODE_MIC_ERR_MULTICAST: - lbs_deb_cmd("EVENT: MULTICAST MIC ERROR\n"); - handle_mic_failureevent(priv, MACREG_INT_CODE_MIC_ERR_MULTICAST); - break; - - case MACREG_INT_CODE_MIB_CHANGED: - lbs_deb_cmd("EVENT: MIB CHANGED\n"); - break; - case MACREG_INT_CODE_INIT_DONE: - lbs_deb_cmd("EVENT: INIT DONE\n"); - break; - case MACREG_INT_CODE_ADHOC_BCN_LOST: - lbs_deb_cmd("EVENT: ADHOC beacon lost\n"); - break; - case MACREG_INT_CODE_RSSI_LOW: - lbs_pr_alert("EVENT: rssi low\n"); - break; - case MACREG_INT_CODE_SNR_LOW: - lbs_pr_alert("EVENT: snr low\n"); - break; - case MACREG_INT_CODE_MAX_FAIL: - printk("EVENT: max fail\n"); - break; - case MACREG_INT_CODE_RSSI_HIGH: - lbs_pr_alert("EVENT: rssi high\n"); - break; - case MACREG_INT_CODE_SNR_HIGH: - lbs_pr_alert("EVENT: snr high\n"); - break; - - case MACREG_INT_CODE_DEEP_SLEEP_AWAKE: - lbs_reset_deep_sleep_wakeup(priv); - if (priv->deepsleep == true) - { - priv->deepsleep = false; - priv->needtowakeup = 0; - } - printk("DEEP SLEEP AWAKE: Wakeup the caller.\n"); - wake_up_interruptible(&priv->ds_waitq); - - break; - - default: - printk("EVENT: unknown event id %d\n", event); - break; - } - - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); - - return ret; -} - diff --git a/drivers/net/wireless/mv8686/debugfs.c b/drivers/net/wireless/mv8686/debugfs.c deleted file mode 100755 index 2f76874a8b32..000000000000 --- a/drivers/net/wireless/mv8686/debugfs.c +++ /dev/null @@ -1,969 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include "lib80211.h" - -#include "dev.h" -#include "decl.h" -#include "host.h" -#include "debugfs.h" -#include "cmd.h" - -static struct dentry *lbs_dir; -static char *szStates[] = { - "Connected", - "Disconnected" -}; - -#ifdef PROC_DEBUG -static void lbs_debug_init(struct lbs_private *priv); -#endif - -static int open_file_generic(struct inode *inode, struct file *file) -{ - file->private_data = inode->i_private; - return 0; -} - -static ssize_t write_file_dummy(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) -{ - return -EINVAL; -} - -static const size_t len = PAGE_SIZE; - -static ssize_t lbs_dev_info(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - struct lbs_private *priv = file->private_data; - size_t pos = 0; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - ssize_t res; - - pos += snprintf(buf+pos, len-pos, "state = %s\n", - szStates[priv->connect_status]); - pos += snprintf(buf+pos, len-pos, "region_code = %02x\n", - (u32) priv->regioncode); - - res = simple_read_from_buffer(userbuf, count, ppos, buf, pos); - - free_page(addr); - return res; -} - - -static ssize_t lbs_getscantable(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - struct lbs_private *priv = file->private_data; - size_t pos = 0; - int numscansdone = 0, res; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - DECLARE_SSID_BUF(ssid); - struct bss_descriptor * iter_bss; - - pos += snprintf(buf+pos, len-pos, - "# | ch | rssi | bssid | cap | Qual | SSID \n"); - - mutex_lock(&priv->lock); - list_for_each_entry (iter_bss, &priv->network_list, list) { - u16 ibss = (iter_bss->capability & WLAN_CAPABILITY_IBSS); - u16 privacy = (iter_bss->capability & WLAN_CAPABILITY_PRIVACY); - u16 spectrum_mgmt = (iter_bss->capability & WLAN_CAPABILITY_SPECTRUM_MGMT); - - pos += snprintf(buf+pos, len-pos, "%02u| %03d | %04d | %pM |", - numscansdone, iter_bss->channel, iter_bss->rssi, - iter_bss->bssid); - pos += snprintf(buf+pos, len-pos, " %04x-", iter_bss->capability); - pos += snprintf(buf+pos, len-pos, "%c%c%c |", - ibss ? 'A' : 'I', privacy ? 'P' : ' ', - spectrum_mgmt ? 'S' : ' '); - pos += snprintf(buf+pos, len-pos, " %04d |", SCAN_RSSI(iter_bss->rssi)); - pos += snprintf(buf+pos, len-pos, " %s\n", - mv8686_print_ssid(ssid, iter_bss->ssid, - iter_bss->ssid_len)); - - numscansdone++; - } - mutex_unlock(&priv->lock); - - res = simple_read_from_buffer(userbuf, count, ppos, buf, pos); - - free_page(addr); - return res; -} - -static ssize_t lbs_sleepparams_write(struct file *file, - const char __user *user_buf, size_t count, - loff_t *ppos) -{ - struct lbs_private *priv = file->private_data; - ssize_t buf_size, ret; - struct sleep_params sp; - int p1, p2, p3, p4, p5, p6; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - - buf_size = min(count, len - 1); - if (copy_from_user(buf, user_buf, buf_size)) { - ret = -EFAULT; - goto out_unlock; - } - ret = sscanf(buf, "%d %d %d %d %d %d", &p1, &p2, &p3, &p4, &p5, &p6); - if (ret != 6) { - ret = -EINVAL; - goto out_unlock; - } - sp.sp_error = p1; - sp.sp_offset = p2; - sp.sp_stabletime = p3; - sp.sp_calcontrol = p4; - sp.sp_extsleepclk = p5; - sp.sp_reserved = p6; - - ret = lbs_cmd_802_11_sleep_params(priv, CMD_ACT_SET, &sp); - if (!ret) - ret = count; - else if (ret > 0) - ret = -EINVAL; - -out_unlock: - free_page(addr); - return ret; -} - -static ssize_t lbs_sleepparams_read(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - struct lbs_private *priv = file->private_data; - ssize_t ret; - size_t pos = 0; - struct sleep_params sp; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - - ret = lbs_cmd_802_11_sleep_params(priv, CMD_ACT_GET, &sp); - if (ret) - goto out_unlock; - - pos += snprintf(buf, len, "%d %d %d %d %d %d\n", sp.sp_error, - sp.sp_offset, sp.sp_stabletime, - sp.sp_calcontrol, sp.sp_extsleepclk, - sp.sp_reserved); - - ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); - -out_unlock: - free_page(addr); - return ret; -} - -/* - * When calling CMD_802_11_SUBSCRIBE_EVENT with CMD_ACT_GET, me might - * get a bunch of vendor-specific TLVs (a.k.a. IEs) back from the - * firmware. Here's an example: - * 04 01 02 00 00 00 05 01 02 00 00 00 06 01 02 00 - * 00 00 07 01 02 00 3c 00 00 00 00 00 00 00 03 03 - * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - * - * The 04 01 is the TLV type (here TLV_TYPE_RSSI_LOW), 02 00 is the length, - * 00 00 are the data bytes of this TLV. For this TLV, their meaning is - * defined in mrvlietypes_thresholds - * - * This function searches in this TLV data chunk for a given TLV type - * and returns a pointer to the first data byte of the TLV, or to NULL - * if the TLV hasn't been found. - */ -static void *lbs_tlv_find(uint16_t tlv_type, const uint8_t *tlv, uint16_t size) -{ - struct mrvlietypesheader *tlv_h; - uint16_t length; - ssize_t pos = 0; - - while (pos < size) { - tlv_h = (struct mrvlietypesheader *) tlv; - if (!tlv_h->len) - return NULL; - if (tlv_h->type == cpu_to_le16(tlv_type)) - return tlv_h; - length = le16_to_cpu(tlv_h->len) + sizeof(*tlv_h); - pos += length; - tlv += length; - } - return NULL; -} - - -static ssize_t lbs_threshold_read(uint16_t tlv_type, uint16_t event_mask, - struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - struct cmd_ds_802_11_subscribe_event *subscribed; - struct mrvlietypes_thresholds *got; - struct lbs_private *priv = file->private_data; - ssize_t ret = 0; - size_t pos = 0; - char *buf; - u8 value; - u8 freq; - int events = 0; - - buf = (char *)get_zeroed_page(GFP_KERNEL); - if (!buf) - return -ENOMEM; - - subscribed = kzalloc(sizeof(*subscribed), GFP_KERNEL); - if (!subscribed) { - ret = -ENOMEM; - goto out_page; - } - - subscribed->hdr.size = cpu_to_le16(sizeof(*subscribed)); - subscribed->action = cpu_to_le16(CMD_ACT_GET); - - ret = lbs_cmd_with_response(priv, CMD_802_11_SUBSCRIBE_EVENT, subscribed); - if (ret) - goto out_cmd; - - got = lbs_tlv_find(tlv_type, subscribed->tlv, sizeof(subscribed->tlv)); - if (got) { - value = got->value; - freq = got->freq; - events = le16_to_cpu(subscribed->events); - - pos += snprintf(buf, len, "%d %d %d\n", value, freq, - !!(events & event_mask)); - } - - ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); - - out_cmd: - kfree(subscribed); - - out_page: - free_page((unsigned long)buf); - return ret; -} - - -static ssize_t lbs_threshold_write(uint16_t tlv_type, uint16_t event_mask, - struct file *file, - const char __user *userbuf, size_t count, - loff_t *ppos) -{ - struct cmd_ds_802_11_subscribe_event *events; - struct mrvlietypes_thresholds *tlv; - struct lbs_private *priv = file->private_data; - ssize_t buf_size; - int value, freq, new_mask; - uint16_t curr_mask; - char *buf; - int ret; - - buf = (char *)get_zeroed_page(GFP_KERNEL); - if (!buf) - return -ENOMEM; - - buf_size = min(count, len - 1); - if (copy_from_user(buf, userbuf, buf_size)) { - ret = -EFAULT; - goto out_page; - } - ret = sscanf(buf, "%d %d %d", &value, &freq, &new_mask); - if (ret != 3) { - ret = -EINVAL; - goto out_page; - } - events = kzalloc(sizeof(*events), GFP_KERNEL); - if (!events) { - ret = -ENOMEM; - goto out_page; - } - - events->hdr.size = cpu_to_le16(sizeof(*events)); - events->action = cpu_to_le16(CMD_ACT_GET); - - ret = lbs_cmd_with_response(priv, CMD_802_11_SUBSCRIBE_EVENT, events); - if (ret) - goto out_events; - - curr_mask = le16_to_cpu(events->events); - - if (new_mask) - new_mask = curr_mask | event_mask; - else - new_mask = curr_mask & ~event_mask; - - /* Now everything is set and we can send stuff down to the firmware */ - - tlv = (void *)events->tlv; - - events->action = cpu_to_le16(CMD_ACT_SET); - events->events = cpu_to_le16(new_mask); - tlv->header.type = cpu_to_le16(tlv_type); - tlv->header.len = cpu_to_le16(sizeof(*tlv) - sizeof(tlv->header)); - tlv->value = value; - if (tlv_type != TLV_TYPE_BCNMISS) - tlv->freq = freq; - - /* The command header, the action, the event mask, and one TLV */ - events->hdr.size = cpu_to_le16(sizeof(events->hdr) + 4 + sizeof(*tlv)); - - ret = lbs_cmd_with_response(priv, CMD_802_11_SUBSCRIBE_EVENT, events); - - if (!ret) - ret = count; - out_events: - kfree(events); - out_page: - free_page((unsigned long)buf); - return ret; -} - - -static ssize_t lbs_lowrssi_read(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - return lbs_threshold_read(TLV_TYPE_RSSI_LOW, CMD_SUBSCRIBE_RSSI_LOW, - file, userbuf, count, ppos); -} - - -static ssize_t lbs_lowrssi_write(struct file *file, const char __user *userbuf, - size_t count, loff_t *ppos) -{ - return lbs_threshold_write(TLV_TYPE_RSSI_LOW, CMD_SUBSCRIBE_RSSI_LOW, - file, userbuf, count, ppos); -} - - -static ssize_t lbs_lowsnr_read(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - return lbs_threshold_read(TLV_TYPE_SNR_LOW, CMD_SUBSCRIBE_SNR_LOW, - file, userbuf, count, ppos); -} - - -static ssize_t lbs_lowsnr_write(struct file *file, const char __user *userbuf, - size_t count, loff_t *ppos) -{ - return lbs_threshold_write(TLV_TYPE_SNR_LOW, CMD_SUBSCRIBE_SNR_LOW, - file, userbuf, count, ppos); -} - - -static ssize_t lbs_failcount_read(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - return lbs_threshold_read(TLV_TYPE_FAILCOUNT, CMD_SUBSCRIBE_FAILCOUNT, - file, userbuf, count, ppos); -} - - -static ssize_t lbs_failcount_write(struct file *file, const char __user *userbuf, - size_t count, loff_t *ppos) -{ - return lbs_threshold_write(TLV_TYPE_FAILCOUNT, CMD_SUBSCRIBE_FAILCOUNT, - file, userbuf, count, ppos); -} - - -static ssize_t lbs_highrssi_read(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - return lbs_threshold_read(TLV_TYPE_RSSI_HIGH, CMD_SUBSCRIBE_RSSI_HIGH, - file, userbuf, count, ppos); -} - - -static ssize_t lbs_highrssi_write(struct file *file, const char __user *userbuf, - size_t count, loff_t *ppos) -{ - return lbs_threshold_write(TLV_TYPE_RSSI_HIGH, CMD_SUBSCRIBE_RSSI_HIGH, - file, userbuf, count, ppos); -} - - -static ssize_t lbs_highsnr_read(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - return lbs_threshold_read(TLV_TYPE_SNR_HIGH, CMD_SUBSCRIBE_SNR_HIGH, - file, userbuf, count, ppos); -} - - -static ssize_t lbs_highsnr_write(struct file *file, const char __user *userbuf, - size_t count, loff_t *ppos) -{ - return lbs_threshold_write(TLV_TYPE_SNR_HIGH, CMD_SUBSCRIBE_SNR_HIGH, - file, userbuf, count, ppos); -} - -static ssize_t lbs_bcnmiss_read(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - return lbs_threshold_read(TLV_TYPE_BCNMISS, CMD_SUBSCRIBE_BCNMISS, - file, userbuf, count, ppos); -} - - -static ssize_t lbs_bcnmiss_write(struct file *file, const char __user *userbuf, - size_t count, loff_t *ppos) -{ - return lbs_threshold_write(TLV_TYPE_BCNMISS, CMD_SUBSCRIBE_BCNMISS, - file, userbuf, count, ppos); -} - - - -static ssize_t lbs_rdmac_read(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - struct lbs_private *priv = file->private_data; - struct lbs_offset_value offval; - ssize_t pos = 0; - int ret; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - - offval.offset = priv->mac_offset; - offval.value = 0; - - ret = lbs_prepare_and_send_command(priv, - CMD_MAC_REG_ACCESS, 0, - CMD_OPTION_WAITFORRSP, 0, &offval); - mdelay(10); - pos += snprintf(buf+pos, len-pos, "MAC[0x%x] = 0x%08x\n", - priv->mac_offset, priv->offsetvalue.value); - - ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); - free_page(addr); - return ret; -} - -static ssize_t lbs_rdmac_write(struct file *file, - const char __user *userbuf, - size_t count, loff_t *ppos) -{ - struct lbs_private *priv = file->private_data; - ssize_t res, buf_size; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - - buf_size = min(count, len - 1); - if (copy_from_user(buf, userbuf, buf_size)) { - res = -EFAULT; - goto out_unlock; - } - priv->mac_offset = simple_strtoul((char *)buf, NULL, 16); - res = count; -out_unlock: - free_page(addr); - return res; -} - -static ssize_t lbs_wrmac_write(struct file *file, - const char __user *userbuf, - size_t count, loff_t *ppos) -{ - - struct lbs_private *priv = file->private_data; - ssize_t res, buf_size; - u32 offset, value; - struct lbs_offset_value offval; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - - buf_size = min(count, len - 1); - if (copy_from_user(buf, userbuf, buf_size)) { - res = -EFAULT; - goto out_unlock; - } - res = sscanf(buf, "%x %x", &offset, &value); - if (res != 2) { - res = -EFAULT; - goto out_unlock; - } - - offval.offset = offset; - offval.value = value; - res = lbs_prepare_and_send_command(priv, - CMD_MAC_REG_ACCESS, 1, - CMD_OPTION_WAITFORRSP, 0, &offval); - mdelay(10); - - res = count; -out_unlock: - free_page(addr); - return res; -} - -static ssize_t lbs_rdbbp_read(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - struct lbs_private *priv = file->private_data; - struct lbs_offset_value offval; - ssize_t pos = 0; - int ret; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - - offval.offset = priv->bbp_offset; - offval.value = 0; - - ret = lbs_prepare_and_send_command(priv, - CMD_BBP_REG_ACCESS, 0, - CMD_OPTION_WAITFORRSP, 0, &offval); - mdelay(10); - pos += snprintf(buf+pos, len-pos, "BBP[0x%x] = 0x%08x\n", - priv->bbp_offset, priv->offsetvalue.value); - - ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); - free_page(addr); - - return ret; -} - -static ssize_t lbs_rdbbp_write(struct file *file, - const char __user *userbuf, - size_t count, loff_t *ppos) -{ - struct lbs_private *priv = file->private_data; - ssize_t res, buf_size; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - - buf_size = min(count, len - 1); - if (copy_from_user(buf, userbuf, buf_size)) { - res = -EFAULT; - goto out_unlock; - } - priv->bbp_offset = simple_strtoul((char *)buf, NULL, 16); - res = count; -out_unlock: - free_page(addr); - return res; -} - -static ssize_t lbs_wrbbp_write(struct file *file, - const char __user *userbuf, - size_t count, loff_t *ppos) -{ - - struct lbs_private *priv = file->private_data; - ssize_t res, buf_size; - u32 offset, value; - struct lbs_offset_value offval; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - - buf_size = min(count, len - 1); - if (copy_from_user(buf, userbuf, buf_size)) { - res = -EFAULT; - goto out_unlock; - } - res = sscanf(buf, "%x %x", &offset, &value); - if (res != 2) { - res = -EFAULT; - goto out_unlock; - } - - offval.offset = offset; - offval.value = value; - res = lbs_prepare_and_send_command(priv, - CMD_BBP_REG_ACCESS, 1, - CMD_OPTION_WAITFORRSP, 0, &offval); - mdelay(10); - - res = count; -out_unlock: - free_page(addr); - return res; -} - -static ssize_t lbs_rdrf_read(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - struct lbs_private *priv = file->private_data; - struct lbs_offset_value offval; - ssize_t pos = 0; - int ret; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - - offval.offset = priv->rf_offset; - offval.value = 0; - - ret = lbs_prepare_and_send_command(priv, - CMD_RF_REG_ACCESS, 0, - CMD_OPTION_WAITFORRSP, 0, &offval); - mdelay(10); - pos += snprintf(buf+pos, len-pos, "RF[0x%x] = 0x%08x\n", - priv->rf_offset, priv->offsetvalue.value); - - ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); - free_page(addr); - - return ret; -} - -static ssize_t lbs_rdrf_write(struct file *file, - const char __user *userbuf, - size_t count, loff_t *ppos) -{ - struct lbs_private *priv = file->private_data; - ssize_t res, buf_size; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - - buf_size = min(count, len - 1); - if (copy_from_user(buf, userbuf, buf_size)) { - res = -EFAULT; - goto out_unlock; - } - priv->rf_offset = simple_strtoul(buf, NULL, 16); - res = count; -out_unlock: - free_page(addr); - return res; -} - -static ssize_t lbs_wrrf_write(struct file *file, - const char __user *userbuf, - size_t count, loff_t *ppos) -{ - - struct lbs_private *priv = file->private_data; - ssize_t res, buf_size; - u32 offset, value; - struct lbs_offset_value offval; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - - buf_size = min(count, len - 1); - if (copy_from_user(buf, userbuf, buf_size)) { - res = -EFAULT; - goto out_unlock; - } - res = sscanf(buf, "%x %x", &offset, &value); - if (res != 2) { - res = -EFAULT; - goto out_unlock; - } - - offval.offset = offset; - offval.value = value; - res = lbs_prepare_and_send_command(priv, - CMD_RF_REG_ACCESS, 1, - CMD_OPTION_WAITFORRSP, 0, &offval); - mdelay(10); - - res = count; -out_unlock: - free_page(addr); - return res; -} - -#define FOPS(fread, fwrite) { \ - .owner = THIS_MODULE, \ - .open = open_file_generic, \ - .read = (fread), \ - .write = (fwrite), \ -} - -struct lbs_debugfs_files { - const char *name; - int perm; - struct file_operations fops; -}; - -static const struct lbs_debugfs_files debugfs_files[] = { - { "info", 0444, FOPS(lbs_dev_info, write_file_dummy), }, - { "getscantable", 0444, FOPS(lbs_getscantable, - write_file_dummy), }, - { "sleepparams", 0644, FOPS(lbs_sleepparams_read, - lbs_sleepparams_write), }, -}; - -static const struct lbs_debugfs_files debugfs_events_files[] = { - {"low_rssi", 0644, FOPS(lbs_lowrssi_read, - lbs_lowrssi_write), }, - {"low_snr", 0644, FOPS(lbs_lowsnr_read, - lbs_lowsnr_write), }, - {"failure_count", 0644, FOPS(lbs_failcount_read, - lbs_failcount_write), }, - {"beacon_missed", 0644, FOPS(lbs_bcnmiss_read, - lbs_bcnmiss_write), }, - {"high_rssi", 0644, FOPS(lbs_highrssi_read, - lbs_highrssi_write), }, - {"high_snr", 0644, FOPS(lbs_highsnr_read, - lbs_highsnr_write), }, -}; - -static const struct lbs_debugfs_files debugfs_regs_files[] = { - {"rdmac", 0644, FOPS(lbs_rdmac_read, lbs_rdmac_write), }, - {"wrmac", 0600, FOPS(NULL, lbs_wrmac_write), }, - {"rdbbp", 0644, FOPS(lbs_rdbbp_read, lbs_rdbbp_write), }, - {"wrbbp", 0600, FOPS(NULL, lbs_wrbbp_write), }, - {"rdrf", 0644, FOPS(lbs_rdrf_read, lbs_rdrf_write), }, - {"wrrf", 0600, FOPS(NULL, lbs_wrrf_write), }, -}; - -void lbs_debugfs_init(void) -{ - if (!lbs_dir) - lbs_dir = debugfs_create_dir("lbs_wireless", NULL); - - return; -} - -void lbs_debugfs_remove(void) -{ - if (lbs_dir) - debugfs_remove(lbs_dir); - return; -} - -void lbs_debugfs_init_one(struct lbs_private *priv, struct net_device *dev) -{ - int i; - const struct lbs_debugfs_files *files; - if (!lbs_dir) - goto exit; - - priv->debugfs_dir = debugfs_create_dir(dev->name, lbs_dir); - if (!priv->debugfs_dir) - goto exit; - - for (i=0; idebugfs_files[i] = debugfs_create_file(files->name, - files->perm, - priv->debugfs_dir, - priv, - &files->fops); - } - - priv->events_dir = debugfs_create_dir("subscribed_events", priv->debugfs_dir); - if (!priv->events_dir) - goto exit; - - for (i=0; idebugfs_events_files[i] = debugfs_create_file(files->name, - files->perm, - priv->events_dir, - priv, - &files->fops); - } - - priv->regs_dir = debugfs_create_dir("registers", priv->debugfs_dir); - if (!priv->regs_dir) - goto exit; - - for (i=0; idebugfs_regs_files[i] = debugfs_create_file(files->name, - files->perm, - priv->regs_dir, - priv, - &files->fops); - } - -#ifdef PROC_DEBUG - lbs_debug_init(priv); -#endif -exit: - return; -} - -void lbs_debugfs_remove_one(struct lbs_private *priv) -{ - int i; - - for(i=0; idebugfs_regs_files[i]); - - debugfs_remove(priv->regs_dir); - - for(i=0; idebugfs_events_files[i]); - - debugfs_remove(priv->events_dir); -#ifdef PROC_DEBUG - debugfs_remove(priv->debugfs_debug); -#endif - for(i=0; idebugfs_files[i]); - debugfs_remove(priv->debugfs_dir); -} - - - -/* debug entry */ - -#ifdef PROC_DEBUG - -#define item_size(n) (FIELD_SIZEOF(struct lbs_private, n)) -#define item_addr(n) (offsetof(struct lbs_private, n)) - - -struct debug_data { - char name[32]; - u32 size; - size_t addr; -}; - -/* To debug any member of struct lbs_private, simply add one line here. - */ -static struct debug_data items[] = { - {"psmode", item_size(psmode), item_addr(psmode)}, - {"psstate", item_size(psstate), item_addr(psstate)}, -}; - -static int num_of_items = ARRAY_SIZE(items); - -/** - * @brief proc read function - * - * @param page pointer to buffer - * @param s read data starting position - * @param off offset - * @param cnt counter - * @param eof end of file flag - * @param data data to output - * @return number of output data - */ -static ssize_t lbs_debugfs_read(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - int val = 0; - size_t pos = 0; - ssize_t res; - char *p; - int i; - struct debug_data *d; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - - p = buf; - - d = (struct debug_data *)file->private_data; - - for (i = 0; i < num_of_items; i++) { - if (d[i].size == 1) - val = *((u8 *) d[i].addr); - else if (d[i].size == 2) - val = *((u16 *) d[i].addr); - else if (d[i].size == 4) - val = *((u32 *) d[i].addr); - else if (d[i].size == 8) - val = *((u64 *) d[i].addr); - - pos += sprintf(p + pos, "%s=%d\n", d[i].name, val); - } - - res = simple_read_from_buffer(userbuf, count, ppos, p, pos); - - free_page(addr); - return res; -} - -/** - * @brief proc write function - * - * @param f file pointer - * @param buf pointer to data buffer - * @param cnt data number to write - * @param data data to write - * @return number of data - */ -static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf, - size_t cnt, loff_t *ppos) -{ - int r, i; - char *pdata; - char *p; - char *p0; - char *p1; - char *p2; - struct debug_data *d = (struct debug_data *)f->private_data; - - pdata = kmalloc(cnt, GFP_KERNEL); - if (pdata == NULL) - return 0; - - if (copy_from_user(pdata, buf, cnt)) { - lbs_deb_debugfs("Copy from user failed\n"); - kfree(pdata); - return 0; - } - - p0 = pdata; - for (i = 0; i < num_of_items; i++) { - do { - p = strstr(p0, d[i].name); - if (p == NULL) - break; - p1 = strchr(p, '\n'); - if (p1 == NULL) - break; - p0 = p1++; - p2 = strchr(p, '='); - if (!p2) - break; - p2++; - r = simple_strtoul(p2, NULL, 0); - if (d[i].size == 1) - *((u8 *) d[i].addr) = (u8) r; - else if (d[i].size == 2) - *((u16 *) d[i].addr) = (u16) r; - else if (d[i].size == 4) - *((u32 *) d[i].addr) = (u32) r; - else if (d[i].size == 8) - *((u64 *) d[i].addr) = (u64) r; - break; - } while (1); - } - kfree(pdata); - - return (ssize_t)cnt; -} - -static const struct file_operations lbs_debug_fops = { - .owner = THIS_MODULE, - .open = open_file_generic, - .write = lbs_debugfs_write, - .read = lbs_debugfs_read, -}; - -/** - * @brief create debug proc file - * - * @param priv pointer struct lbs_private - * @param dev pointer net_device - * @return N/A - */ -static void lbs_debug_init(struct lbs_private *priv) -{ - int i; - - if (!priv->debugfs_dir) - return; - - for (i = 0; i < num_of_items; i++) - items[i].addr += (size_t) priv; - - priv->debugfs_debug = debugfs_create_file("debug", 0644, - priv->debugfs_dir, &items[0], - &lbs_debug_fops); -} -#endif diff --git a/drivers/net/wireless/mv8686/debugfs.h b/drivers/net/wireless/mv8686/debugfs.h deleted file mode 100755 index f2b9c7ffe0fd..000000000000 --- a/drivers/net/wireless/mv8686/debugfs.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _LBS_DEBUGFS_H_ -#define _LBS_DEBUGFS_H_ - -void lbs_debugfs_init(void); -void lbs_debugfs_remove(void); - -void lbs_debugfs_init_one(struct lbs_private *priv, struct net_device *dev); -void lbs_debugfs_remove_one(struct lbs_private *priv); - -#endif diff --git a/drivers/net/wireless/mv8686/decl.h b/drivers/net/wireless/mv8686/decl.h deleted file mode 100755 index 1f81b09d196d..000000000000 --- a/drivers/net/wireless/mv8686/decl.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * This file contains declaration referring to - * functions defined in other source files - */ - -#ifndef _LBS_DECL_H_ -#define _LBS_DECL_H_ - -#include - -#include "defs.h" - -/** Function Prototype Declaration */ -struct lbs_private; -struct sk_buff; -struct net_device; -struct cmd_ctrl_node; -struct cmd_ds_command; - -void lbs_set_mac_control(struct lbs_private *priv); - -void lbs_send_tx_feedback(struct lbs_private *priv, u32 try_count); - -int lbs_free_cmd_buffer(struct lbs_private *priv); - -int lbs_prepare_and_send_command(struct lbs_private *priv, - u16 cmd_no, - u16 cmd_action, - u16 wait_option, u32 cmd_oid, void *pdata_buf); - -int lbs_allocate_cmd_buffer(struct lbs_private *priv); -int lbs_execute_next_command(struct lbs_private *priv); -int lbs_process_event(struct lbs_private *priv, u32 event); -void lbs_queue_event(struct lbs_private *priv, u32 event); -void lbs_notify_command_response(struct lbs_private *priv, u8 resp_idx); - -u32 lbs_fw_index_to_data_rate(u8 index); -u8 lbs_data_rate_to_fw_index(u32 rate); - -/** The proc fs interface */ -int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len); -void lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd, - int result); -int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev); -int lbs_set_regiontable(struct lbs_private *priv, u8 region, u8 band); - -int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *); - -void lbs_ps_sleep(struct lbs_private *priv, int wait_option); -void lbs_ps_confirm_sleep(struct lbs_private *priv); -void lbs_ps_wakeup(struct lbs_private *priv, int wait_option); - -struct chan_freq_power *lbs_find_cfp_by_band_and_channel( - struct lbs_private *priv, - u8 band, - u16 channel); - -void lbs_mac_event_disconnected(struct lbs_private *priv); - -void lbs_send_iwevcustom_event(struct lbs_private *priv, s8 *str); - -/* persistcfg.c */ -void lbs_persist_config_init(struct net_device *net); -void lbs_persist_config_remove(struct net_device *net); - -/* main.c */ -struct chan_freq_power *lbs_get_region_cfp_table(u8 region, - int *cfp_no); -struct lbs_private *lbs_add_card(void *card, struct device *dmdev); -void lbs_remove_card(struct lbs_private *priv); -int lbs_start_card(struct lbs_private *priv); -void lbs_stop_card(struct lbs_private *priv); -void lbs_host_to_card_done(struct lbs_private *priv); - -int lbs_update_channel(struct lbs_private *priv); -void lbs_update_ps_timer(void); -int lbs_exit_deep_sleep(struct lbs_private * priv); -int lbs_set_deepsleep(struct lbs_private * priv, u8 enable); - -#endif diff --git a/drivers/net/wireless/mv8686/defs.h b/drivers/net/wireless/mv8686/defs.h deleted file mode 100755 index f722900f5426..000000000000 --- a/drivers/net/wireless/mv8686/defs.h +++ /dev/null @@ -1,442 +0,0 @@ -/** - * This header file contains global constant/enum definitions, - * global variable declaration. - */ -#ifndef _LBS_DEFS_H_ -#define _LBS_DEFS_H_ - -#include - -#ifdef CONFIG_LIBERTAS_DEBUG -#define DEBUG -#define PROC_DEBUG -#endif - -#ifndef DRV_NAME -#define DRV_NAME "mv8686" -#endif - -#define RET_ASSOC_RETRY 0x101 - -/* - * Evaluate downloading speed for WiFi firmware. - */ -#define SDIO_SPEED_EVUL 1 - -/* - * When deauthenticate Event was received, we will - * try to re-associate once. - */ -#define AUTO_REASSOC 1 - -#define MV8686_SUPPORT_ADHOC 0 - -#define MV8686_SUPPORT_MCAST 0 - -/* - * According to Android's power management scheme. - */ -#define ANDROID_POWER_SAVE 0 - -#define WIFI_PS_AWAKE 0 -#define WIFI_PS_PRE_SLEEP 1 -#define WIFI_PS_SYS_PRE_SLEEP 2 -#define WIFI_PS_DRV_PRE_SLEEP 3 -#define WIFI_PS_SYS_SLEEP 4 -#define WIFI_PS_DRV_SLEEP 5 -#define WIFI_PS_PRE_WAKE 6 -#define WIFI_PS_DRV_PRE_WAKE 7 - -/* - * New power save scheme will be used. - */ -#define NEW_MV8686_PS 1 - -/* - * WIFI driver decide power save operation via a timer. - */ -#define DRIVER_DECIDE_POWER_SAVE 0 -//#define DRIVER_PS_TIMEOUT 240 * HZ -#define DRIVER_PS_TIMEOUT 120 * HZ -#define DRIVER_PS_FULLPOWER 0 -#define DRIVER_PS_POWERSAVE 1 -#define DRIVER_PS_AUTODP 2 -#define DRIVER_PS_WAKEUP 3 - -#define LBS_DEB_ENTER 0x00000001 -#define LBS_DEB_LEAVE 0x00000002 -#define LBS_DEB_MAIN 0x00000004 -#define LBS_DEB_NET 0x00000008 -#define LBS_DEB_MESH 0x00000010 -#define LBS_DEB_WEXT 0x00000020 -#define LBS_DEB_IOCTL 0x00000040 -#define LBS_DEB_SCAN 0x00000080 -#define LBS_DEB_ASSOC 0x00000100 -#define LBS_DEB_JOIN 0x00000200 -#define LBS_DEB_11D 0x00000400 -#define LBS_DEB_DEBUGFS 0x00000800 -#define LBS_DEB_ETHTOOL 0x00001000 -#define LBS_DEB_HOST 0x00002000 -#define LBS_DEB_CMD 0x00004000 -#define LBS_DEB_RX 0x00008000 -#define LBS_DEB_TX 0x00010000 -#define LBS_DEB_USB 0x00020000 -#define LBS_DEB_CS 0x00040000 -#define LBS_DEB_FW 0x00080000 -#define LBS_DEB_THREAD 0x00100000 -#define LBS_DEB_HEX 0x00200000 -#define LBS_DEB_SDIO 0x00400000 -#define LBS_DEB_SYSFS 0x00800000 -#define LBS_DEB_SPI 0x01000000 - -extern unsigned int lbs_debug; - -#ifdef DEBUG -#define LBS_DEB_LL(grp, grpnam, fmt, args...) \ -do { if ((lbs_debug & (grp)) == (grp)) \ - printk(KERN_DEBUG DRV_NAME grpnam "%s: " fmt, \ - in_interrupt() ? " (INT)" : "", ## args); } while (0) -#else -#define LBS_DEB_LL(grp, grpnam, fmt, args...) do {} while (0) -#endif - -#define lbs_deb_enter(grp) \ - LBS_DEB_LL(grp | LBS_DEB_ENTER, " enter", "%s()\n", __func__); -#define lbs_deb_enter_args(grp, fmt, args...) \ - LBS_DEB_LL(grp | LBS_DEB_ENTER, " enter", "%s(" fmt ")\n", __func__, ## args); -#define lbs_deb_leave(grp) \ - LBS_DEB_LL(grp | LBS_DEB_LEAVE, " leave", "%s()\n", __func__); -#define lbs_deb_leave_args(grp, fmt, args...) \ - LBS_DEB_LL(grp | LBS_DEB_LEAVE, " leave", "%s(), " fmt "\n", \ - __func__, ##args); -#define lbs_deb_main(fmt, args...) LBS_DEB_LL(LBS_DEB_MAIN, " main", fmt, ##args) -#define lbs_deb_net(fmt, args...) LBS_DEB_LL(LBS_DEB_NET, " net", fmt, ##args) -#define lbs_deb_mesh(fmt, args...) LBS_DEB_LL(LBS_DEB_MESH, " mesh", fmt, ##args) -#define lbs_deb_wext(fmt, args...) LBS_DEB_LL(LBS_DEB_WEXT, " wext", fmt, ##args) -#define lbs_deb_ioctl(fmt, args...) LBS_DEB_LL(LBS_DEB_IOCTL, " ioctl", fmt, ##args) -#define lbs_deb_scan(fmt, args...) LBS_DEB_LL(LBS_DEB_SCAN, " scan", fmt, ##args) -#define lbs_deb_assoc(fmt, args...) LBS_DEB_LL(LBS_DEB_ASSOC, " assoc", fmt, ##args) -#define lbs_deb_join(fmt, args...) LBS_DEB_LL(LBS_DEB_JOIN, " join", fmt, ##args) -#define lbs_deb_11d(fmt, args...) LBS_DEB_LL(LBS_DEB_11D, " 11d", fmt, ##args) -#define lbs_deb_debugfs(fmt, args...) LBS_DEB_LL(LBS_DEB_DEBUGFS, " debugfs", fmt, ##args) -#define lbs_deb_ethtool(fmt, args...) LBS_DEB_LL(LBS_DEB_ETHTOOL, " ethtool", fmt, ##args) -#define lbs_deb_host(fmt, args...) LBS_DEB_LL(LBS_DEB_HOST, " host", fmt, ##args) -#define lbs_deb_cmd(fmt, args...) LBS_DEB_LL(LBS_DEB_CMD, " cmd", fmt, ##args) -#define lbs_deb_rx(fmt, args...) LBS_DEB_LL(LBS_DEB_RX, " rx", fmt, ##args) -#define lbs_deb_tx(fmt, args...) LBS_DEB_LL(LBS_DEB_TX, " tx", fmt, ##args) -#define lbs_deb_fw(fmt, args...) LBS_DEB_LL(LBS_DEB_FW, " fw", fmt, ##args) -#define lbs_deb_usb(fmt, args...) LBS_DEB_LL(LBS_DEB_USB, " usb", fmt, ##args) -#define lbs_deb_usbd(dev, fmt, args...) LBS_DEB_LL(LBS_DEB_USB, " usbd", "%s:" fmt, dev_name(dev), ##args) -#define lbs_deb_cs(fmt, args...) LBS_DEB_LL(LBS_DEB_CS, " cs", fmt, ##args) -#define lbs_deb_thread(fmt, args...) LBS_DEB_LL(LBS_DEB_THREAD, " thread", fmt, ##args) -#define lbs_deb_sdio(fmt, args...) LBS_DEB_LL(LBS_DEB_SDIO, " sdio", fmt, ##args) -#define lbs_deb_sysfs(fmt, args...) LBS_DEB_LL(LBS_DEB_SYSFS, " sysfs", fmt, ##args) -#define lbs_deb_spi(fmt, args...) LBS_DEB_LL(LBS_DEB_SPI, " spi", fmt, ##args) - -#define lbs_pr_info(format, args...) \ - printk(KERN_INFO DRV_NAME": " format, ## args) -#define lbs_pr_err(format, args...) \ - printk(KERN_ERR DRV_NAME": " format, ## args) -#define lbs_pr_alert(format, args...) \ - printk(KERN_ALERT DRV_NAME": " format, ## args) - -#ifdef DEBUG -static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, int len) -{ - int i = 0; - - if (len && - (lbs_debug & LBS_DEB_HEX) && - (lbs_debug & grp)) - { - for (i = 1; i <= len; i++) { - if ((i & 0xf) == 1) { - if (i != 1) - printk("\n"); - printk(DRV_NAME " %s: ", prompt); - } - printk("%02x ", (u8) * buf); - buf++; - } - printk("\n"); - } -} -#else -#define lbs_deb_hex(grp,prompt,buf,len) do {} while (0) -#endif - - - -/** Buffer Constants */ - -/* The size of SQ memory PPA, DPA are 8 DWORDs, that keep the physical -* addresses of TxPD buffers. Station has only 8 TxPD available, Whereas -* driver has more local TxPDs. Each TxPD on the host memory is associated -* with a Tx control node. The driver maintains 8 RxPD descriptors for -* station firmware to store Rx packet information. -* -* Current version of MAC has a 32x6 multicast address buffer. -* -* 802.11b can have up to 14 channels, the driver keeps the -* BSSID(MAC address) of each APs or Ad hoc stations it has sensed. -*/ - -#define MRVDRV_MAX_MULTICAST_LIST_SIZE 32 -#define LBS_NUM_CMD_BUFFERS 10 -#define LBS_CMD_BUFFER_SIZE (2 * 1024) -#define MRVDRV_MAX_CHANNEL_SIZE 14 -#define MRVDRV_ASSOCIATION_TIME_OUT 255 -#define MRVDRV_SNAP_HEADER_LEN 8 - -#define LBS_UPLD_SIZE 2312 -#define DEV_NAME_LEN 32 - -/* Wake criteria for HOST_SLEEP_CFG command */ -#define EHS_WAKE_ON_BROADCAST_DATA 0x0001 -#define EHS_WAKE_ON_UNICAST_DATA 0x0002 -#define EHS_WAKE_ON_MAC_EVENT 0x0004 -#define EHS_WAKE_ON_MULTICAST_DATA 0x0008 -#define EHS_REMOVE_WAKEUP 0xFFFFFFFF -/* Wake rules for Host_Sleep_CFG command */ -#define WOL_RULE_NET_TYPE_INFRA_OR_IBSS 0x00 -#define WOL_RULE_NET_TYPE_MESH 0x10 -#define WOL_RULE_ADDR_TYPE_BCAST 0x01 -#define WOL_RULE_ADDR_TYPE_MCAST 0x08 -#define WOL_RULE_ADDR_TYPE_UCAST 0x02 -#define WOL_RULE_OP_AND 0x01 -#define WOL_RULE_OP_OR 0x02 -#define WOL_RULE_OP_INVALID 0xFF -#define WOL_RESULT_VALID_CMD 0 -#define WOL_RESULT_NOSPC_ERR 1 -#define WOL_RESULT_EEXIST_ERR 2 - -/** Misc constants */ -/* This section defines 802.11 specific contants */ - -#define MRVDRV_MAX_BSS_DESCRIPTS 16 -#define MRVDRV_MAX_REGION_CODE 6 - -#define MRVDRV_IGNORE_MULTIPLE_DTIM 0xFFFE -#define MRVDRV_MIN_MULTIPLE_DTIM 1 -#define MRVDRV_MAX_MULTIPLE_DTIM 5 -//#define MRVDRV_DEFAULT_MULTIPLE_DTIM 1 -#define MRVDRV_DEFAULT_MULTIPLE_DTIM 3 - -#define MRVDRV_DEFAULT_LISTEN_INTERVAL 10 - -#define MRVDRV_CHANNELS_PER_SCAN 4 -#define MRVDRV_MAX_CHANNELS_PER_SCAN 14 - -#define MRVDRV_MIN_BEACON_INTERVAL 20 -#define MRVDRV_MAX_BEACON_INTERVAL 1000 -#define MRVDRV_BEACON_INTERVAL 100 - -#define MARVELL_MESH_IE_LENGTH 9 - -/* Values used to populate the struct mrvl_mesh_ie. The only time you need this - * is when enabling the mesh using CMD_MESH_CONFIG. - */ -#define MARVELL_MESH_IE_TYPE 4 -#define MARVELL_MESH_IE_SUBTYPE 0 -#define MARVELL_MESH_IE_VERSION 0 -#define MARVELL_MESH_PROTO_ID_HWMP 0 -#define MARVELL_MESH_METRIC_ID 0 -#define MARVELL_MESH_CAPABILITY 0 - -/** INT status Bit Definition*/ -#define MRVDRV_TX_DNLD_RDY 0x0001 -#define MRVDRV_RX_UPLD_RDY 0x0002 -#define MRVDRV_CMD_DNLD_RDY 0x0004 -#define MRVDRV_CMD_UPLD_RDY 0x0008 -#define MRVDRV_CARDEVENT 0x0010 - -/* Automatic TX control default levels */ -#define POW_ADAPT_DEFAULT_P0 13 -#define POW_ADAPT_DEFAULT_P1 15 -#define POW_ADAPT_DEFAULT_P2 18 -#define TPC_DEFAULT_P0 5 -#define TPC_DEFAULT_P1 10 -#define TPC_DEFAULT_P2 13 - -/** TxPD status */ - -/* Station firmware use TxPD status field to report final Tx transmit -* result, Bit masks are used to present combined situations. -*/ - -#define MRVDRV_TxPD_POWER_MGMT_NULL_PACKET 0x01 -#define MRVDRV_TxPD_POWER_MGMT_LAST_PACKET 0x08 - -/** Tx mesh flag */ -/* Currently we are using normal WDS flag as mesh flag. - * TODO: change to proper mesh flag when MAC understands it. - */ -#define TxPD_CONTROL_WDS_FRAME (1<<17) -#define TxPD_MESH_FRAME TxPD_CONTROL_WDS_FRAME - -/** RxPD status */ - -#define MRVDRV_RXPD_STATUS_OK 0x0001 - -/** RxPD status - Received packet types */ -/** Rx mesh flag */ -/* Currently we are using normal WDS flag as mesh flag. - * TODO: change to proper mesh flag when MAC understands it. - */ -#define RxPD_CONTROL_WDS_FRAME (0x40) -#define RxPD_MESH_FRAME RxPD_CONTROL_WDS_FRAME - -/** RSSI-related defines */ -/* RSSI constants are used to implement 802.11 RSSI threshold -* indication. if the Rx packet signal got too weak for 5 consecutive -* times, miniport driver (driver) will report this event to wrapper -*/ - -#define MRVDRV_NF_DEFAULT_SCAN_VALUE (-96) - -/** RTS/FRAG related defines */ -#define MRVDRV_RTS_MIN_VALUE 0 -#define MRVDRV_RTS_MAX_VALUE 2347 -#define MRVDRV_FRAG_MIN_VALUE 256 -#define MRVDRV_FRAG_MAX_VALUE 2346 - -/* This is for firmware specific length */ -#define EXTRA_LEN 36 - -#define MRVDRV_ETH_TX_PACKET_BUFFER_SIZE \ - (ETH_FRAME_LEN + sizeof(struct txpd) + EXTRA_LEN) - -#define MRVDRV_ETH_RX_PACKET_BUFFER_SIZE \ - (ETH_FRAME_LEN + sizeof(struct rxpd) \ - + MRVDRV_SNAP_HEADER_LEN + EXTRA_LEN) - -#define CMD_F_HOSTCMD (1 << 0) -#define FW_CAPINFO_WPA (1 << 0) -#define FW_CAPINFO_PS (1 << 1) -#define FW_CAPINFO_FIRMWARE_UPGRADE (1 << 13) -#define FW_CAPINFO_BOOT2_UPGRADE (1<<14) -#define FW_CAPINFO_PERSISTENT_CONFIG (1<<15) - -#define KEY_LEN_WPA_AES 16 -#define KEY_LEN_WPA_TKIP 32 -#define KEY_LEN_WEP_104 13 -#define KEY_LEN_WEP_40 5 - -#define RF_ANTENNA_1 0x1 -#define RF_ANTENNA_2 0x2 -#define RF_ANTENNA_AUTO 0xFFFF - -#define BAND_B (0x01) -#define BAND_G (0x02) -#define ALL_802_11_BANDS (BAND_B | BAND_G) - -/** MACRO DEFINITIONS */ -#define CAL_NF(NF) ((s32)(-(s32)(NF))) -#define CAL_RSSI(SNR, NF) ((s32)((s32)(SNR) + CAL_NF(NF))) -#define SCAN_RSSI(RSSI) (0x100 - ((u8)(RSSI))) - -#define DEFAULT_BCN_AVG_FACTOR 8 -#define DEFAULT_DATA_AVG_FACTOR 8 -#define AVG_SCALE 100 -#define CAL_AVG_SNR_NF(AVG, SNRNF, N) \ - (((AVG) == 0) ? ((u16)(SNRNF) * AVG_SCALE) : \ - ((((int)(AVG) * (N -1)) + ((u16)(SNRNF) * \ - AVG_SCALE)) / N)) - -#define MAX_RATES 14 - -#define MAX_LEDS 8 - -/** Global Variable Declaration */ -extern u16 lbs_region_code_to_index[MRVDRV_MAX_REGION_CODE]; - -extern u8 lbs_bg_rates[MAX_RATES]; - -/** ENUM definition*/ -/** SNRNF_TYPE */ -enum SNRNF_TYPE { - TYPE_BEACON = 0, - TYPE_RXPD, - MAX_TYPE_B -}; - -/** SNRNF_DATA*/ -enum SNRNF_DATA { - TYPE_NOAVG = 0, - TYPE_AVG, - MAX_TYPE_AVG -}; - -/** LBS_802_11_POWER_MODE */ -enum LBS_802_11_POWER_MODE { - LBS802_11POWERMODECAM, - LBS802_11POWERMODEMAX_PSP, - LBS802_11POWERMODEFAST_PSP, - /*not a real mode, defined as an upper bound */ - LBS802_11POWEMODEMAX -}; - -/** PS_STATE */ -enum PS_STATE { - PS_STATE_FULL_POWER, - PS_STATE_AWAKE, - PS_STATE_PRE_SLEEP, - PS_STATE_SLEEP -}; - -/** DNLD_STATE */ -enum DNLD_STATE { - DNLD_RES_RECEIVED, - DNLD_DATA_SENT, - DNLD_CMD_SENT, - DNLD_BOOTCMD_SENT, -}; - -/** LBS_MEDIA_STATE */ -enum LBS_MEDIA_STATE { - LBS_CONNECTED, - LBS_DISCONNECTED -}; - -/** LBS_802_11_PRIVACY_FILTER */ -enum LBS_802_11_PRIVACY_FILTER { - LBS802_11PRIVFILTERACCEPTALL, - LBS802_11PRIVFILTER8021XWEP -}; - -/** mv_ms_type */ -enum mv_ms_type { - MVMS_DAT = 0, - MVMS_CMD = 1, - MVMS_TXDONE = 2, - MVMS_EVENT -}; - -/** KEY_TYPE_ID */ -enum KEY_TYPE_ID { - KEY_TYPE_ID_WEP = 0, - KEY_TYPE_ID_TKIP, - KEY_TYPE_ID_AES -}; - -/** KEY_INFO_WPA (applies to both TKIP and AES/CCMP) */ -enum KEY_INFO_WPA { - KEY_INFO_WPA_MCAST = 0x01, - KEY_INFO_WPA_UNICAST = 0x02, - KEY_INFO_WPA_ENABLED = 0x04 -}; - -/* Default values for fwt commands. */ -#define FWT_DEFAULT_METRIC 0 -#define FWT_DEFAULT_DIR 1 -/* Default Rate, 11Mbps */ -#define FWT_DEFAULT_RATE 3 -#define FWT_DEFAULT_SSN 0xffffffff -#define FWT_DEFAULT_DSN 0 -#define FWT_DEFAULT_HOPCOUNT 0 -#define FWT_DEFAULT_TTL 0 -#define FWT_DEFAULT_EXPIRATION 0 -#define FWT_DEFAULT_SLEEPMODE 0 -#define FWT_DEFAULT_SNR 0 - -#endif diff --git a/drivers/net/wireless/mv8686/dev.h b/drivers/net/wireless/mv8686/dev.h deleted file mode 100755 index 5dd21434a11c..000000000000 --- a/drivers/net/wireless/mv8686/dev.h +++ /dev/null @@ -1,430 +0,0 @@ -/** - * This file contains definitions and data structures specific - * to Marvell 802.11 NIC. It contains the Device Information - * structure struct lbs_private.. - */ -#ifndef _LBS_DEV_H_ -#define _LBS_DEV_H_ - -#include -#include -#include -#include -#include -#include - -#include "defs.h" -#include "hostcmd.h" - -extern struct ethtool_ops lbs_ethtool_ops; - -#define MAX_BSSID_PER_CHANNEL 16 - -#define NR_TX_QUEUE 3 - -/* For the extended Scan */ -#define MAX_EXTENDED_SCAN_BSSID_LIST MAX_BSSID_PER_CHANNEL * \ - MRVDRV_MAX_CHANNEL_SIZE + 1 - -#define MAX_REGION_CHANNEL_NUM 2 - -/** Chan-freq-TxPower mapping table*/ -struct chan_freq_power { - /** channel Number */ - u16 channel; - /** frequency of this channel */ - u32 freq; - /** Max allowed Tx power level */ - u16 maxtxpower; - /** TRUE:channel unsupported; FLASE:supported*/ - u8 unsupported; -}; - -/** region-band mapping table*/ -struct region_channel { - /** TRUE if this entry is valid */ - u8 valid; - /** region code for US, Japan ... */ - u8 region; - /** band B/G/A, used for BAND_CONFIG cmd */ - u8 band; - /** Actual No. of elements in the array below */ - u8 nrcfp; - /** chan-freq-txpower mapping table*/ - struct chan_freq_power *CFP; -}; - -struct lbs_802_11_security { - u8 WPAenabled; - u8 WPA2enabled; - u8 wep_enabled; - u8 auth_mode; - u32 key_mgmt; -}; - -/** Current Basic Service Set State Structure */ -struct current_bss_params { - /** bssid */ - u8 bssid[ETH_ALEN]; - /** ssid */ - u8 ssid[IW_ESSID_MAX_SIZE + 1]; - u8 ssid_len; - - /** band */ - u8 band; - /** channel */ - u8 channel; - /** zero-terminated array of supported data rates */ - u8 rates[MAX_RATES + 1]; -}; - -/** sleep_params */ -struct sleep_params { - uint16_t sp_error; - uint16_t sp_offset; - uint16_t sp_stabletime; - uint8_t sp_calcontrol; - uint8_t sp_extsleepclk; - uint16_t sp_reserved; -}; - -#define MAX_SCAN_REQ 16 - -struct lbs_scan_req -{ - struct list_head list; - int ssid_len; /* ssid_len == 0 means broadcast scanning */ - char ssid[IW_ESSID_MAX_SIZE+1]; -}; - -/** Private structure for the MV device */ -struct lbs_private -{ - int infra_open; - - char name[DEV_NAME_LEN]; - - void *card; - struct net_device *dev; - - struct iw_statistics wstats; - struct dentry *debugfs_dir; - struct dentry *debugfs_debug; - struct dentry *debugfs_files[6]; - - struct dentry *events_dir; - struct dentry *debugfs_events_files[6]; - - struct dentry *regs_dir; - struct dentry *debugfs_regs_files[6]; - - u32 mac_offset; - u32 bbp_offset; - u32 rf_offset; - - /* Download sent: - bit0 1/0=data_sent/data_tx_done, - bit1 1/0=cmd_sent/cmd_tx_done, - all other bits reserved 0 */ - u8 dnld_sent; - - /** thread to service interrupts */ - struct task_struct *main_thread; - wait_queue_head_t waitq; - struct workqueue_struct *work_thread; - -#if (MV8686_SUPPORT_MCAST == 1) - struct work_struct mcast_work; -#endif - - /** Scanning */ - struct delayed_work scan_work; - spinlock_t scan_work_lock; - struct delayed_work assoc_work; - struct work_struct sync_channel; - - /* remember which channel was scanned last, != 0 if currently scanning */ - int scan_channel; - u8 scan_ssid[IW_ESSID_MAX_SIZE + 1]; - u8 scan_ssid_len; - - /** Hardware access */ - int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb); - void (*reset_card) (struct lbs_private *priv); - - /* Wake On LAN */ - uint32_t wol_criteria; - uint8_t wol_gpio; - uint8_t wol_gap; - - /** Wlan adapter data structure*/ - /** STATUS variables */ - u32 fwrelease; - u32 fwcapinfo; - - struct mutex lock; - - /* TX packet ready to be sent... */ - int tx_pending_len; /* -1 while building packet */ - u8 tx_pending_buf[LBS_UPLD_SIZE]; - /* protected by hard_start_xmit serialization */ - - /* command-related variables */ - u16 seqnum; - - /* - * Command materials - */ - struct cmd_ctrl_node *cmd_array; /* Allocated buffer for cmds */ - struct cmd_ctrl_node *cur_cmd; /* Current command */ - int cur_cmd_retcode; /* Return code for current cmd */ - struct list_head cmdfreeq; /* Free command buffers */ - struct list_head cmdpendingq; /* Pending command buffers */ - wait_queue_head_t cmd_pending; - u8 resp_idx; /* Cmd responses sent from the -- */ - u8 resp_buf[2][LBS_UPLD_SIZE]; /* hardware to the driver */ - u32 resp_len[2]; - - struct timer_list command_timer; /* Command timeout timers */ - int nr_retries; - int cmd_timed_out; - - /* Events sent from hardware to driver */ - struct kfifo *event_fifo; - - /* nickname */ - u8 nodename[16]; - - /** spin locks */ - spinlock_t driver_lock; - - /** current ssid/bssid related parameters*/ - struct current_bss_params curbssparams; - - /* IW_MODE_* */ - u8 mode; - - /* Scan results list */ - struct list_head network_list; - struct list_head network_free_list; - struct bss_descriptor *networks; - - struct list_head scan_req_list; - struct list_head scan_req_free_list; - struct lbs_scan_req *scan_req; - - u16 beacon_period; - u8 beacon_enable; - u8 adhoccreate; - - /** capability Info used in Association, start, join */ - u16 capability; - - /** MAC address information */ - u8 current_addr[ETH_ALEN]; - u8 multicastlist[MRVDRV_MAX_MULTICAST_LIST_SIZE][ETH_ALEN]; - u32 nr_of_multicastmacaddr; - - uint16_t enablehwauto; - uint16_t ratebitmap; - - u8 txretrycount; - - /** Tx-related variables (for single packet tx) */ - struct sk_buff *currenttxskb; - - /** NIC Operation characteristics */ - u16 mac_control; - u32 connect_status; - u16 regioncode; - s16 txpower_cur; - s16 txpower_min; - s16 txpower_max; - - /** POWER MANAGEMENT AND PnP SUPPORT */ - u8 surpriseremoved; - - u16 psmode; /* Wlan802_11PowermodeCAM=disable - Wlan802_11PowermodeMAX_PSP=enable */ - u32 psstate; - - u8 deepsleep; /* Deep sleep status : true (on) : false (off) */ - u8 auto_deepsleep; /* */ - wait_queue_head_t ds_waitq; /* Deep sleep wakeup queue */ - - char ps_supported; - u8 needtowakeup; - -#if (NEW_MV8686_PS == 1) - struct timer_list turnoff_timer; - u8 turnoff_idle_count; - u8 wifi_state; //0-busy 1-idle - struct delayed_work ps_work; - unsigned long scan_result_timeout; - u8 need_reassoc; //0-no 1-yes - struct timer_list disconnect_timer; //check association whether is successful. - u8 associate_retry; - u8 needto_notify_upper; -#endif - -#if (ANDROID_POWER_SAVE == 1) - struct timer_list ps_timer; /* Power save timer. */ - struct delayed_work ps_work; /* Worker to do auto power save. */ - int wifi_ps_work_req; /* Which request to the ps_work. */ - spinlock_t ps_lock; /* Lock for power save. */ -#endif - - struct assoc_request * pending_assoc_req; - struct assoc_request * in_progress_assoc_req; -#if (AUTO_REASSOC == 1) - struct assoc_request * prev_assoc_req; - int reassoc_count; -#endif - - /** Encryption parameter */ - struct lbs_802_11_security secinfo; - - /** WEP keys */ - struct enc_key wep_keys[4]; - u16 wep_tx_keyidx; - - /** WPA keys */ - struct enc_key wpa_mcast_key; - struct enc_key wpa_unicast_key; - -/* - * In theory, the IE is limited to the IE length, 255, - * but in practice 64 bytes are enough. - */ -#define MAX_WPA_IE_LEN 64 - - /** WPA Information Elements*/ - u8 wpa_ie[MAX_WPA_IE_LEN]; - u8 wpa_ie_len; - - /** Requested Signal Strength*/ - u16 SNR[MAX_TYPE_B][MAX_TYPE_AVG]; - u16 NF[MAX_TYPE_B][MAX_TYPE_AVG]; - u8 RSSI[MAX_TYPE_B][MAX_TYPE_AVG]; - u8 rawSNR[DEFAULT_DATA_AVG_FACTOR]; - u8 rawNF[DEFAULT_DATA_AVG_FACTOR]; - u16 nextSNRNF; - u16 numSNRNF; - - u8 radio_on; - - /** data rate stuff */ - u8 cur_rate; - - /** RF calibration data */ - -#define MAX_REGION_CHANNEL_NUM 2 - /** region channel data */ - struct region_channel region_channel[MAX_REGION_CHANNEL_NUM]; - - struct region_channel universal_channel[MAX_REGION_CHANNEL_NUM]; - - /** 11D and Domain Regulatory Data */ - struct lbs_802_11d_domain_reg domainreg; - struct parsed_region_chan_11d parsed_region_chan; - - /** FSM variable for 11d support */ - u32 enable11d; - - /** MISCELLANEOUS */ - struct lbs_offset_value offsetvalue; - - u32 monitormode; - u8 fw_ready; -}; - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) -#define GET_PRIV_FROM_NETDEV(dev) (struct lbs_private *)(dev)->priv -#else -#define GET_PRIV_FROM_NETDEV(dev) (struct lbs_private *)(dev)->ml_priv -#endif - -extern struct cmd_confirm_sleep confirm_sleep; - -/** - * @brief Structure used to store information for each beacon/probe response - */ -struct bss_descriptor { - u8 bssid[ETH_ALEN]; - - u8 ssid[IW_ESSID_MAX_SIZE + 1]; - u8 ssid_len; - - u16 capability; - u32 rssi; - u32 channel; - u16 beaconperiod; - u32 atimwindow; - - /* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */ - u8 mode; - - /* zero-terminated array of supported data rates */ - u8 rates[MAX_RATES + 1]; - - unsigned long last_scanned; - - union ieeetypes_phyparamset phyparamset; - union IEEEtypes_ssparamset ssparamset; - - struct ieeetypes_countryinfofullset countryinfo; - - u8 wpa_ie[MAX_WPA_IE_LEN]; - size_t wpa_ie_len; - u8 rsn_ie[MAX_WPA_IE_LEN]; - size_t rsn_ie_len; - - struct list_head list; -}; - -/** Association request - * - * Encapsulates all the options that describe a specific assocation request - * or configuration of the wireless card's radio, mode, and security settings. - */ -#define ASSOC_FLAG_SSID 1 -#define ASSOC_FLAG_CHANNEL 2 -#define ASSOC_FLAG_BAND 3 -#define ASSOC_FLAG_MODE 4 -#define ASSOC_FLAG_BSSID 5 -#define ASSOC_FLAG_WEP_KEYS 6 -#define ASSOC_FLAG_WEP_TX_KEYIDX 7 -#define ASSOC_FLAG_WPA_MCAST_KEY 8 -#define ASSOC_FLAG_WPA_UCAST_KEY 9 -#define ASSOC_FLAG_SECINFO 10 -#define ASSOC_FLAG_WPA_IE 11 - -struct assoc_request { - unsigned long flags; - - u8 ssid[IW_ESSID_MAX_SIZE + 1]; - u8 ssid_len; - u8 channel; - u8 band; - u8 mode; - u8 bssid[ETH_ALEN] __attribute__ ((aligned (2))); - - /** WEP keys */ - struct enc_key wep_keys[4]; - u16 wep_tx_keyidx; - - /** WPA keys */ - struct enc_key wpa_mcast_key; - struct enc_key wpa_unicast_key; - - struct lbs_802_11_security secinfo; - - /** WPA Information Elements*/ - u8 wpa_ie[MAX_WPA_IE_LEN]; - u8 wpa_ie_len; - - /* BSS to associate with for infrastructure of Ad-Hoc join */ - struct bss_descriptor bss; -}; - -#endif diff --git a/drivers/net/wireless/mv8686/host.h b/drivers/net/wireless/mv8686/host.h deleted file mode 100755 index 9e3dcd70aa51..000000000000 --- a/drivers/net/wireless/mv8686/host.h +++ /dev/null @@ -1,303 +0,0 @@ -/** - * This file contains definitions of WLAN commands. - */ - -#ifndef _LBS_HOST_H_ -#define _LBS_HOST_H_ - -/** PUBLIC DEFINITIONS */ -#define DEFAULT_AD_HOC_CHANNEL 6 -#define DEFAULT_AD_HOC_CHANNEL_A 36 - -#define CMD_OPTION_WAITFORRSP 0x0002 - -/** Host command IDs */ - -/* Return command are almost always the same as the host command, but with - * bit 15 set high. There are a few exceptions, though... - */ -#define CMD_RET(cmd) (0x8000 | cmd) - -/* Return command convention exceptions: */ -#define CMD_RET_802_11_ASSOCIATE 0x8012 - -/* Command codes */ -#define CMD_GET_HW_SPEC 0x0003 -#define CMD_EEPROM_UPDATE 0x0004 -#define CMD_802_11_RESET 0x0005 -#define CMD_802_11_SCAN 0x0006 -#define CMD_802_11_GET_LOG 0x000b -#define CMD_MAC_MULTICAST_ADR 0x0010 -#define CMD_802_11_AUTHENTICATE 0x0011 -#define CMD_802_11_EEPROM_ACCESS 0x0059 -#define CMD_802_11_ASSOCIATE 0x0050 -#define CMD_802_11_SET_WEP 0x0013 -#define CMD_802_11_GET_STAT 0x0014 -#define CMD_802_3_GET_STAT 0x0015 -#define CMD_802_11_SNMP_MIB 0x0016 -#define CMD_MAC_REG_MAP 0x0017 -#define CMD_BBP_REG_MAP 0x0018 -#define CMD_MAC_REG_ACCESS 0x0019 -#define CMD_BBP_REG_ACCESS 0x001a -#define CMD_RF_REG_ACCESS 0x001b -#define CMD_802_11_RADIO_CONTROL 0x001c -#define CMD_802_11_RF_CHANNEL 0x001d -#define CMD_802_11_RF_TX_POWER 0x001e -#define CMD_802_11_RSSI 0x001f -#define CMD_802_11_RF_ANTENNA 0x0020 -#define CMD_802_11_PS_MODE 0x0021 -#define CMD_802_11_DATA_RATE 0x0022 -#define CMD_RF_REG_MAP 0x0023 -#define CMD_802_11_DEAUTHENTICATE 0x0024 -#define CMD_802_11_REASSOCIATE 0x0025 -#define CMD_MAC_CONTROL 0x0028 -#define CMD_802_11_AD_HOC_START 0x002b -#define CMD_802_11_AD_HOC_JOIN 0x002c -#define CMD_802_11_QUERY_TKIP_REPLY_CNTRS 0x002e -#define CMD_802_11_ENABLE_RSN 0x002f -#define CMD_802_11_SET_AFC 0x003c -#define CMD_802_11_GET_AFC 0x003d -#define CMD_802_11_DEEP_SLEEP 0x003e -#define CMD_802_11_AD_HOC_STOP 0x0040 -#define CMD_802_11_HOST_SLEEP_CFG 0x0043 -#define CMD_802_11_WAKEUP_CONFIRM 0x0044 -#define CMD_802_11_HOST_SLEEP_ACTIVATE 0x0045 -#define CMD_802_11_BEACON_STOP 0x0049 -#define CMD_802_11_MAC_ADDRESS 0x004d -#define CMD_802_11_LED_GPIO_CTRL 0x004e -#define CMD_802_11_EEPROM_ACCESS 0x0059 -#define CMD_802_11_BAND_CONFIG 0x0058 -#define CMD_GSPI_BUS_CONFIG 0x005a -#define CMD_802_11D_DOMAIN_INFO 0x005b -#define CMD_802_11_KEY_MATERIAL 0x005e -#define CMD_802_11_SLEEP_PARAMS 0x0066 -#define CMD_802_11_INACTIVITY_TIMEOUT 0x0067 -#define CMD_802_11_SLEEP_PERIOD 0x0068 -#define CMD_802_11_TPC_CFG 0x0072 -#define CMD_802_11_PA_CFG 0x0073 -#define CMD_802_11_FW_WAKE_METHOD 0x0074 -#define CMD_802_11_SUBSCRIBE_EVENT 0x0075 -#define CMD_802_11_RATE_ADAPT_RATESET 0x0076 -#define CMD_802_11_TX_RATE_QUERY 0x007f -#define CMD_GET_TSF 0x0080 -#define CMD_BT_ACCESS 0x0087 -#define CMD_FWT_ACCESS 0x0095 -#define CMD_802_11_MONITOR_MODE 0x0098 -#define CMD_MESH_ACCESS 0x009b -#define CMD_MESH_CONFIG 0x00a3 -#define CMD_SET_BOOT2_VER 0x00a5 -#define CMD_802_11_BEACON_CTRL 0x00b0 - -/* For the IEEE Power Save */ -#define CMD_SUBCMD_ENTER_PS 0x0030 -#define CMD_SUBCMD_EXIT_PS 0x0031 -#define CMD_SUBCMD_SLEEP_CONFIRMED 0x0034 -#define CMD_SUBCMD_FULL_POWERDOWN 0x0035 -#define CMD_SUBCMD_FULL_POWERUP 0x0036 - -#define CMD_ENABLE_RSN 0x0001 -#define CMD_DISABLE_RSN 0x0000 - -#define CMD_ACT_GET 0x0000 -#define CMD_ACT_SET 0x0001 -#define CMD_ACT_GET_AES 0x0002 -#define CMD_ACT_SET_AES 0x0003 -#define CMD_ACT_REMOVE_AES 0x0004 - -/* Define action or option for CMD_802_11_SET_WEP */ -#define CMD_ACT_ADD 0x0002 -#define CMD_ACT_REMOVE 0x0004 -#define CMD_ACT_USE_DEFAULT 0x0008 - -#define CMD_TYPE_WEP_40_BIT 0x01 -#define CMD_TYPE_WEP_104_BIT 0x02 - -#define CMD_NUM_OF_WEP_KEYS 4 - -#define CMD_WEP_KEY_INDEX_MASK 0x3fff - -/* Define action or option for CMD_802_11_RESET */ -#define CMD_ACT_HALT 0x0003 - -/* Define action or option for CMD_802_11_SCAN */ -#define CMD_BSS_TYPE_BSS 0x0001 -#define CMD_BSS_TYPE_IBSS 0x0002 -#define CMD_BSS_TYPE_ANY 0x0003 - -/* Define action or option for CMD_802_11_SCAN */ -#define CMD_SCAN_TYPE_ACTIVE 0x0000 -#define CMD_SCAN_TYPE_PASSIVE 0x0001 - -#define CMD_SCAN_RADIO_TYPE_BG 0 - -#define CMD_SCAN_PROBE_DELAY_TIME 0 - -/* Define action or option for CMD_MAC_CONTROL */ -#define CMD_ACT_MAC_RX_ON 0x0001 -#define CMD_ACT_MAC_TX_ON 0x0002 -#define CMD_ACT_MAC_LOOPBACK_ON 0x0004 -#define CMD_ACT_MAC_WEP_ENABLE 0x0008 -#define CMD_ACT_MAC_INT_ENABLE 0x0010 -#define CMD_ACT_MAC_MULTICAST_ENABLE 0x0020 -#define CMD_ACT_MAC_BROADCAST_ENABLE 0x0040 -#define CMD_ACT_MAC_PROMISCUOUS_ENABLE 0x0080 -#define CMD_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100 -#define CMD_ACT_MAC_STRICT_PROTECTION_ENABLE 0x0400 - -/* Event flags for CMD_802_11_SUBSCRIBE_EVENT */ -#define CMD_SUBSCRIBE_RSSI_LOW 0x0001 -#define CMD_SUBSCRIBE_SNR_LOW 0x0002 -#define CMD_SUBSCRIBE_FAILCOUNT 0x0004 -#define CMD_SUBSCRIBE_BCNMISS 0x0008 -#define CMD_SUBSCRIBE_RSSI_HIGH 0x0010 -#define CMD_SUBSCRIBE_SNR_HIGH 0x0020 - -#define RADIO_PREAMBLE_LONG 0x00 -#define RADIO_PREAMBLE_SHORT 0x02 -#define RADIO_PREAMBLE_AUTO 0x04 - -/* Define action or option for CMD_802_11_RF_CHANNEL */ -#define CMD_OPT_802_11_RF_CHANNEL_GET 0x00 -#define CMD_OPT_802_11_RF_CHANNEL_SET 0x01 - -/* Define action or option for CMD_802_11_DATA_RATE */ -#define CMD_ACT_SET_TX_AUTO 0x0000 -#define CMD_ACT_SET_TX_FIX_RATE 0x0001 -#define CMD_ACT_GET_TX_RATE 0x0002 - -#define CMD_ACT_SET_RX 0x0001 -#define CMD_ACT_SET_TX 0x0002 -#define CMD_ACT_SET_BOTH 0x0003 -#define CMD_ACT_GET_RX 0x0004 -#define CMD_ACT_GET_TX 0x0008 -#define CMD_ACT_GET_BOTH 0x000c - -/* Define action or option for CMD_802_11_PS_MODE */ -#define CMD_TYPE_CAM 0x0000 -#define CMD_TYPE_MAX_PSP 0x0001 -#define CMD_TYPE_FAST_PSP 0x0002 - -/* Options for CMD_802_11_FW_WAKE_METHOD */ -#define CMD_WAKE_METHOD_UNCHANGED 0x0000 -#define CMD_WAKE_METHOD_COMMAND_INT 0x0001 -#define CMD_WAKE_METHOD_GPIO 0x0002 - -/* Object IDs for CMD_802_11_SNMP_MIB */ -#define SNMP_MIB_OID_BSS_TYPE 0x0000 -#define SNMP_MIB_OID_OP_RATE_SET 0x0001 -#define SNMP_MIB_OID_BEACON_PERIOD 0x0002 /* Reserved on v9+ */ -#define SNMP_MIB_OID_DTIM_PERIOD 0x0003 /* Reserved on v9+ */ -#define SNMP_MIB_OID_ASSOC_TIMEOUT 0x0004 /* Reserved on v9+ */ -#define SNMP_MIB_OID_RTS_THRESHOLD 0x0005 -#define SNMP_MIB_OID_SHORT_RETRY_LIMIT 0x0006 -#define SNMP_MIB_OID_LONG_RETRY_LIMIT 0x0007 -#define SNMP_MIB_OID_FRAG_THRESHOLD 0x0008 -#define SNMP_MIB_OID_11D_ENABLE 0x0009 -#define SNMP_MIB_OID_11H_ENABLE 0x000A - -/* Define action or option for CMD_BT_ACCESS */ -enum cmd_bt_access_opts { - /* The bt commands start at 5 instead of 1 because the old dft commands - * are mapped to 1-4. These old commands are no longer maintained and - * should not be called. - */ - CMD_ACT_BT_ACCESS_ADD = 5, - CMD_ACT_BT_ACCESS_DEL, - CMD_ACT_BT_ACCESS_LIST, - CMD_ACT_BT_ACCESS_RESET, - CMD_ACT_BT_ACCESS_SET_INVERT, - CMD_ACT_BT_ACCESS_GET_INVERT -}; - -/* Define action or option for CMD_FWT_ACCESS */ -enum cmd_fwt_access_opts { - CMD_ACT_FWT_ACCESS_ADD = 1, - CMD_ACT_FWT_ACCESS_DEL, - CMD_ACT_FWT_ACCESS_LOOKUP, - CMD_ACT_FWT_ACCESS_LIST, - CMD_ACT_FWT_ACCESS_LIST_ROUTE, - CMD_ACT_FWT_ACCESS_LIST_NEIGHBOR, - CMD_ACT_FWT_ACCESS_RESET, - CMD_ACT_FWT_ACCESS_CLEANUP, - CMD_ACT_FWT_ACCESS_TIME, -}; - -/* Define action or option for CMD_802_11_HOST_SLEEP_CFG */ -enum cmd_wol_cfg_opts { - CMD_ACT_ACTION_NONE = 0, - CMD_ACT_SET_WOL_RULE, - CMD_ACT_GET_WOL_RULE, - CMD_ACT_RESET_WOL_RULE, -}; - -/* Define action or option for CMD_MESH_ACCESS */ -enum cmd_mesh_access_opts { - CMD_ACT_MESH_GET_TTL = 1, - CMD_ACT_MESH_SET_TTL, - CMD_ACT_MESH_GET_STATS, - CMD_ACT_MESH_GET_ANYCAST, - CMD_ACT_MESH_SET_ANYCAST, - CMD_ACT_MESH_SET_LINK_COSTS, - CMD_ACT_MESH_GET_LINK_COSTS, - CMD_ACT_MESH_SET_BCAST_RATE, - CMD_ACT_MESH_GET_BCAST_RATE, - CMD_ACT_MESH_SET_RREQ_DELAY, - CMD_ACT_MESH_GET_RREQ_DELAY, - CMD_ACT_MESH_SET_ROUTE_EXP, - CMD_ACT_MESH_GET_ROUTE_EXP, - CMD_ACT_MESH_SET_AUTOSTART_ENABLED, - CMD_ACT_MESH_GET_AUTOSTART_ENABLED, - CMD_ACT_MESH_SET_GET_PRB_RSP_LIMIT = 17, -}; - -/* Define actions and types for CMD_MESH_CONFIG */ -enum cmd_mesh_config_actions { - CMD_ACT_MESH_CONFIG_STOP = 0, - CMD_ACT_MESH_CONFIG_START, - CMD_ACT_MESH_CONFIG_SET, - CMD_ACT_MESH_CONFIG_GET, -}; - -enum cmd_mesh_config_types { - CMD_TYPE_MESH_SET_BOOTFLAG = 1, - CMD_TYPE_MESH_SET_BOOTTIME, - CMD_TYPE_MESH_SET_DEF_CHANNEL, - CMD_TYPE_MESH_SET_MESH_IE, - CMD_TYPE_MESH_GET_DEFAULTS, - CMD_TYPE_MESH_GET_MESH_IE, /* GET_DEFAULTS is superset of GET_MESHIE */ -}; - -/** Card Event definition */ -#define MACREG_INT_CODE_TX_PPA_FREE 0 -#define MACREG_INT_CODE_TX_DMA_DONE 1 -#define MACREG_INT_CODE_LINK_LOST_W_SCAN 2 -#define MACREG_INT_CODE_LINK_LOST_NO_SCAN 3 -#define MACREG_INT_CODE_LINK_SENSED 4 -#define MACREG_INT_CODE_CMD_FINISHED 5 -#define MACREG_INT_CODE_MIB_CHANGED 6 -#define MACREG_INT_CODE_INIT_DONE 7 -#define MACREG_INT_CODE_DEAUTHENTICATED 8 -#define MACREG_INT_CODE_DISASSOCIATED 9 -#define MACREG_INT_CODE_PS_AWAKE 10 -#define MACREG_INT_CODE_PS_SLEEP 11 -#define MACREG_INT_CODE_MIC_ERR_MULTICAST 13 -#define MACREG_INT_CODE_MIC_ERR_UNICAST 14 -#define MACREG_INT_CODE_WM_AWAKE 15 -#define MACREG_INT_CODE_DEEP_SLEEP_AWAKE 16 -#define MACREG_INT_CODE_ADHOC_BCN_LOST 17 -#define MACREG_INT_CODE_HOST_AWAKE 18 -#define MACREG_INT_CODE_STOP_TX 19 -#define MACREG_INT_CODE_START_TX 20 -#define MACREG_INT_CODE_CHANNEL_SWITCH 21 -#define MACREG_INT_CODE_MEASUREMENT_RDY 22 -#define MACREG_INT_CODE_WMM_CHANGE 23 -#define MACREG_INT_CODE_BG_SCAN_REPORT 24 -#define MACREG_INT_CODE_RSSI_LOW 25 -#define MACREG_INT_CODE_SNR_LOW 26 -#define MACREG_INT_CODE_MAX_FAIL 27 -#define MACREG_INT_CODE_RSSI_HIGH 28 -#define MACREG_INT_CODE_SNR_HIGH 29 -#define MACREG_INT_CODE_MESH_AUTO_STARTED 35 -#define MACREG_INT_CODE_FIRMWARE_READY 48 - -#endif diff --git a/drivers/net/wireless/mv8686/hostcmd.h b/drivers/net/wireless/mv8686/hostcmd.h deleted file mode 100755 index a899aeb676bb..000000000000 --- a/drivers/net/wireless/mv8686/hostcmd.h +++ /dev/null @@ -1,775 +0,0 @@ -/* - * This file contains the function prototypes, data structure - * and defines for all the host/station commands - */ -#ifndef _LBS_HOSTCMD_H -#define _LBS_HOSTCMD_H - -#include -#include "11d.h" -#include "types.h" - -/* 802.11-related definitions */ - -/* TxPD descriptor */ -struct txpd { - /* Current Tx packet status */ - __le32 tx_status; - /* Tx control */ - __le32 tx_control; - __le32 tx_packet_location; - /* Tx packet length */ - __le16 tx_packet_length; - /* First 2 byte of destination MAC address */ - u8 tx_dest_addr_high[2]; - /* Last 4 byte of destination MAC address */ - u8 tx_dest_addr_low[4]; - /* Pkt Priority */ - u8 priority; - /* Pkt Trasnit Power control */ - u8 powermgmt; - /* Amount of time the packet has been queued in the driver (units = 2ms) */ - u8 pktdelay_2ms; - /* reserved */ - u8 reserved1; -} __attribute__ ((packed)); - -/* RxPD Descriptor */ -struct rxpd { - /* Current Rx packet status */ - __le16 status; - - /* SNR */ - u8 snr; - - /* Tx control */ - u8 rx_control; - - /* Pkt length */ - __le16 pkt_len; - - /* Noise Floor */ - u8 nf; - - /* Rx Packet Rate */ - u8 rx_rate; - - /* Pkt addr */ - __le32 pkt_ptr; - - /* Next Rx RxPD addr */ - __le32 next_rxpd_ptr; - - /* Pkt Priority */ - u8 priority; - u8 reserved[3]; -} __attribute__ ((packed)); - -struct cmd_header { - __le16 command; - __le16 size; - __le16 seqnum; - __le16 result; -} __attribute__ ((packed)); - -struct cmd_ctrl_node { - struct list_head list; - int result; - /* command response */ - int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *); - unsigned long callback_arg; - /* command data */ - struct cmd_header *cmdbuf; - /* wait queue */ - u16 cmdwaitqwoken; - wait_queue_head_t cmdwait_q; -}; - -/* Generic structure to hold all key types. */ -struct enc_key { - u16 len; - u16 flags; /* KEY_INFO_* from defs.h */ - u16 type; /* KEY_TYPE_* from defs.h */ - u8 key[32]; -}; - -/* lbs_offset_value */ -struct lbs_offset_value { - u32 offset; - u32 value; -} __attribute__ ((packed)); - -/* Define general data structure */ -/* cmd_DS_GEN */ -struct cmd_ds_gen { - __le16 command; - __le16 size; - __le16 seqnum; - __le16 result; - void *cmdresp[0]; -} __attribute__ ((packed)); - -#define S_DS_GEN sizeof(struct cmd_ds_gen) - - -/* - * Define data structure for CMD_GET_HW_SPEC - * This structure defines the response for the GET_HW_SPEC command - */ -struct cmd_ds_get_hw_spec { - struct cmd_header hdr; - - /* HW Interface version number */ - __le16 hwifversion; - /* HW version number */ - __le16 version; - /* Max number of TxPD FW can handle */ - __le16 nr_txpd; - /* Max no of Multicast address */ - __le16 nr_mcast_adr; - /* MAC address */ - u8 permanentaddr[6]; - - /* region Code */ - __le16 regioncode; - - /* Number of antenna used */ - __le16 nr_antenna; - - /* FW release number, example 0x01030304 = 2.3.4p1 */ - __le32 fwrelease; - - /* Base Address of TxPD queue */ - __le32 wcb_base; - /* Read Pointer of RxPd queue */ - __le32 rxpd_rdptr; - - /* Write Pointer of RxPd queue */ - __le32 rxpd_wrptr; - - /*FW/HW capability */ - __le32 fwcapinfo; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_subscribe_event { - struct cmd_header hdr; - - __le16 action; - __le16 events; - - /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a - * number of TLVs. From the v5.1 manual, those TLVs would add up to - * 40 bytes. However, future firmware might add additional TLVs, so I - * bump this up a bit. - */ - uint8_t tlv[128]; -} __attribute__ ((packed)); - -/* - * This scan handle Country Information IE(802.11d compliant) - * Define data structure for CMD_802_11_SCAN - */ -struct cmd_ds_802_11_scan { - struct cmd_header hdr; - - uint8_t bsstype; - uint8_t bssid[ETH_ALEN]; - uint8_t tlvbuffer[0]; -#if 0 - mrvlietypes_ssidparamset_t ssidParamSet; - mrvlietypes_chanlistparamset_t ChanListParamSet; - mrvlietypes_ratesparamset_t OpRateSet; -#endif -} __attribute__ ((packed)); - -struct cmd_ds_802_11_scan_rsp { - struct cmd_header hdr; - - __le16 bssdescriptsize; - uint8_t nr_sets; - uint8_t bssdesc_and_tlvbuffer[0]; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_get_log { - struct cmd_header hdr; - - __le32 mcasttxframe; - __le32 failed; - __le32 retry; - __le32 multiretry; - __le32 framedup; - __le32 rtssuccess; - __le32 rtsfailure; - __le32 ackfailure; - __le32 rxfrag; - __le32 mcastrxframe; - __le32 fcserror; - __le32 txframe; - __le32 wepundecryptable; -} __attribute__ ((packed)); - -struct cmd_ds_mac_control { - struct cmd_header hdr; - __le16 action; - u16 reserved; -} __attribute__ ((packed)); - -struct cmd_ds_mac_multicast_adr { - struct cmd_header hdr; - __le16 action; - __le16 nr_of_adrs; - u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE]; -} __attribute__ ((packed)); - -struct cmd_ds_gspi_bus_config { - struct cmd_header hdr; - __le16 action; - __le16 bus_delay_mode; - __le16 host_time_delay_to_read_port; - __le16 host_time_delay_to_read_register; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_authenticate { - u8 macaddr[ETH_ALEN]; - u8 authtype; - u8 reserved[10]; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_deauthenticate { - struct cmd_header hdr; - - u8 macaddr[ETH_ALEN]; - __le16 reasoncode; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_associate { - u8 peerstaaddr[6]; - __le16 capability; - __le16 listeninterval; - __le16 bcnperiod; - u8 dtimperiod; - -#if 0 - mrvlietypes_ssidparamset_t ssidParamSet; - mrvlietypes_phyparamset_t phyparamset; - mrvlietypes_ssparamset_t ssparamset; - mrvlietypes_ratesparamset_t ratesParamSet; -#endif -} __attribute__ ((packed)); - -struct cmd_ds_802_11_associate_rsp { - struct ieeetypes_assocrsp assocRsp; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_set_wep { - struct cmd_header hdr; - - /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */ - __le16 action; - - /* key Index selected for Tx */ - __le16 keyindex; - - /* 40, 128bit or TXWEP */ - uint8_t keytype[4]; - uint8_t keymaterial[4][16]; -} __attribute__ ((packed)); - -struct cmd_ds_802_3_get_stat { - __le32 xmitok; - __le32 rcvok; - __le32 xmiterror; - __le32 rcverror; - __le32 rcvnobuffer; - __le32 rcvcrcerror; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_get_stat { - __le32 txfragmentcnt; - __le32 mcasttxframecnt; - __le32 failedcnt; - __le32 retrycnt; - __le32 Multipleretrycnt; - __le32 rtssuccesscnt; - __le32 rtsfailurecnt; - __le32 ackfailurecnt; - __le32 frameduplicatecnt; - __le32 rxfragmentcnt; - __le32 mcastrxframecnt; - __le32 fcserrorcnt; - __le32 bcasttxframecnt; - __le32 bcastrxframecnt; - __le32 txbeacon; - __le32 rxbeacon; - __le32 wepundecryptable; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_snmp_mib { - struct cmd_header hdr; - - __le16 action; - __le16 oid; - __le16 bufsize; - u8 value[128]; -} __attribute__ ((packed)); - -struct cmd_ds_mac_reg_map { - __le16 buffersize; - u8 regmap[128]; - __le16 reserved; -} __attribute__ ((packed)); - -struct cmd_ds_bbp_reg_map { - __le16 buffersize; - u8 regmap[128]; - __le16 reserved; -} __attribute__ ((packed)); - -struct cmd_ds_rf_reg_map { - __le16 buffersize; - u8 regmap[64]; - __le16 reserved; -} __attribute__ ((packed)); - -struct cmd_ds_mac_reg_access { - __le16 action; - __le16 offset; - __le32 value; -} __attribute__ ((packed)); - -struct cmd_ds_bbp_reg_access { - __le16 action; - __le16 offset; - u8 value; - u8 reserved[3]; -} __attribute__ ((packed)); - -struct cmd_ds_rf_reg_access { - __le16 action; - __le16 offset; - u8 value; - u8 reserved[3]; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_radio_control { - struct cmd_header hdr; - - __le16 action; - __le16 control; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_beacon_control { - __le16 action; - __le16 beacon_enable; - __le16 beacon_period; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_sleep_params { - struct cmd_header hdr; - - /* ACT_GET/ACT_SET */ - __le16 action; - - /* Sleep clock error in ppm */ - __le16 error; - - /* Wakeup offset in usec */ - __le16 offset; - - /* Clock stabilization time in usec */ - __le16 stabletime; - - /* control periodic calibration */ - uint8_t calcontrol; - - /* control the use of external sleep clock */ - uint8_t externalsleepclk; - - /* reserved field, should be set to zero */ - __le16 reserved; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_inactivity_timeout { - struct cmd_header hdr; - - /* ACT_GET/ACT_SET */ - __le16 action; - - /* Inactivity timeout in msec */ - __le16 timeout; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_rf_channel { - struct cmd_header hdr; - - __le16 action; - __le16 channel; - __le16 rftype; /* unused */ - __le16 reserved; /* unused */ - u8 channellist[32]; /* unused */ -} __attribute__ ((packed)); - -struct cmd_ds_802_11_rssi { - /* weighting factor */ - __le16 N; - - __le16 reserved_0; - __le16 reserved_1; - __le16 reserved_2; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_rssi_rsp { - __le16 SNR; - __le16 noisefloor; - __le16 avgSNR; - __le16 avgnoisefloor; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_mac_address { - struct cmd_header hdr; - - __le16 action; - u8 macadd[ETH_ALEN]; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_rf_tx_power { - struct cmd_header hdr; - - __le16 action; - __le16 curlevel; - s8 maxlevel; - s8 minlevel; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_rf_antenna { - __le16 action; - - /* Number of antennas or 0xffff(diversity) */ - __le16 antennamode; - -} __attribute__ ((packed)); - -struct cmd_ds_802_11_monitor_mode { - __le16 action; - __le16 mode; -} __attribute__ ((packed)); - -struct cmd_ds_set_boot2_ver { - struct cmd_header hdr; - - __le16 action; - __le16 version; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_fw_wake_method { - struct cmd_header hdr; - - __le16 action; - __le16 method; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_sleep_period { - struct cmd_header hdr; - - __le16 action; - __le16 period; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_ps_mode { - __le16 action; - __le16 nullpktinterval; - __le16 multipledtim; - __le16 reserved; - __le16 locallisteninterval; -} __attribute__ ((packed)); - -struct cmd_confirm_sleep { - struct cmd_header hdr; - - __le16 action; - __le16 nullpktinterval; - __le16 multipledtim; - __le16 reserved; - __le16 locallisteninterval; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_data_rate { - struct cmd_header hdr; - - __le16 action; - __le16 reserved; - u8 rates[MAX_RATES]; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_rate_adapt_rateset { - struct cmd_header hdr; - __le16 action; - __le16 enablehwauto; - __le16 bitmap; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_ad_hoc_start { - struct cmd_header hdr; - - u8 ssid[IW_ESSID_MAX_SIZE]; - u8 bsstype; - __le16 beaconperiod; - u8 dtimperiod; /* Reserved on v9 and later */ - union IEEEtypes_ssparamset ssparamset; - union ieeetypes_phyparamset phyparamset; - __le16 probedelay; - __le16 capability; - u8 rates[MAX_RATES]; - u8 tlv_memory_size_pad[100]; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_ad_hoc_result { - struct cmd_header hdr; - - u8 pad[3]; - u8 bssid[ETH_ALEN]; -} __attribute__ ((packed)); - -struct adhoc_bssdesc { - u8 bssid[ETH_ALEN]; - u8 ssid[IW_ESSID_MAX_SIZE]; - u8 type; - __le16 beaconperiod; - u8 dtimperiod; - __le64 timestamp; - __le64 localtime; - union ieeetypes_phyparamset phyparamset; - union IEEEtypes_ssparamset ssparamset; - __le16 capability; - u8 rates[MAX_RATES]; - - /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the - * Adhoc join command and will cause a binary layout mismatch with - * the firmware - */ -} __attribute__ ((packed)); - -struct cmd_ds_802_11_ad_hoc_join { - struct cmd_header hdr; - - struct adhoc_bssdesc bss; - __le16 failtimeout; /* Reserved on v9 and later */ - __le16 probedelay; /* Reserved on v9 and later */ -} __attribute__ ((packed)); - -struct cmd_ds_802_11_ad_hoc_stop { - struct cmd_header hdr; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_enable_rsn { - struct cmd_header hdr; - - __le16 action; - __le16 enable; -} __attribute__ ((packed)); - -struct MrvlIEtype_keyParamSet { - /* type ID */ - __le16 type; - - /* length of Payload */ - __le16 length; - - /* type of key: WEP=0, TKIP=1, AES=2 */ - __le16 keytypeid; - - /* key control Info specific to a keytypeid */ - __le16 keyinfo; - - /* length of key */ - __le16 keylen; - - /* key material of size keylen */ - u8 key[32]; -} __attribute__ ((packed)); - -#define MAX_WOL_RULES 16 - -struct host_wol_rule { - uint8_t rule_no; - uint8_t rule_ops; - __le16 sig_offset; - __le16 sig_length; - __le16 reserve; - __be32 sig_mask; - __be32 signature; -} __attribute__ ((packed)); - -struct wol_config { - uint8_t action; - uint8_t pattern; - uint8_t no_rules_in_cmd; - uint8_t result; - struct host_wol_rule rule[MAX_WOL_RULES]; -} __attribute__ ((packed)); - -struct cmd_ds_host_sleep { - struct cmd_header hdr; - __le32 criteria; - uint8_t gpio; - uint16_t gap; - struct wol_config wol_conf; -} __attribute__ ((packed)); - - - -struct cmd_ds_802_11_key_material { - struct cmd_header hdr; - - __le16 action; - struct MrvlIEtype_keyParamSet keyParamSet[2]; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_eeprom_access { - struct cmd_header hdr; - __le16 action; - __le16 offset; - __le16 len; - /* firmware says it returns a maximum of 20 bytes */ -#define LBS_EEPROM_READ_LEN 20 - u8 value[LBS_EEPROM_READ_LEN]; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_tpc_cfg { - struct cmd_header hdr; - - __le16 action; - uint8_t enable; - int8_t P0; - int8_t P1; - int8_t P2; - uint8_t usesnr; -} __attribute__ ((packed)); - - -struct cmd_ds_802_11_pa_cfg { - struct cmd_header hdr; - - __le16 action; - uint8_t enable; - int8_t P0; - int8_t P1; - int8_t P2; -} __attribute__ ((packed)); - - -struct cmd_ds_802_11_led_ctrl { - __le16 action; - __le16 numled; - u8 data[256]; -} __attribute__ ((packed)); - -struct cmd_ds_802_11_afc { - __le16 afc_auto; - union { - struct { - __le16 threshold; - __le16 period; - }; - struct { - __le16 timing_offset; /* signed */ - __le16 carrier_offset; /* signed */ - }; - }; -} __attribute__ ((packed)); - -struct cmd_tx_rate_query { - __le16 txrate; -} __attribute__ ((packed)); - -struct cmd_ds_get_tsf { - __le64 tsfvalue; -} __attribute__ ((packed)); - -struct cmd_ds_bt_access { - __le16 action; - __le32 id; - u8 addr1[ETH_ALEN]; - u8 addr2[ETH_ALEN]; -} __attribute__ ((packed)); - -struct cmd_ds_fwt_access { - __le16 action; - __le32 id; - u8 valid; - u8 da[ETH_ALEN]; - u8 dir; - u8 ra[ETH_ALEN]; - __le32 ssn; - __le32 dsn; - __le32 metric; - u8 rate; - u8 hopcount; - u8 ttl; - __le32 expiration; - u8 sleepmode; - __le32 snr; - __le32 references; - u8 prec[ETH_ALEN]; -} __attribute__ ((packed)); - - -struct cmd_ds_mesh_config { - struct cmd_header hdr; - - __le16 action; - __le16 channel; - __le16 type; - __le16 length; - u8 data[128]; /* last position reserved */ -} __attribute__ ((packed)); - - -struct cmd_ds_mesh_access { - struct cmd_header hdr; - - __le16 action; - __le32 data[32]; /* last position reserved */ -} __attribute__ ((packed)); - -/* Number of stats counters returned by the firmware */ -#define MESH_STATS_NUM 8 - -struct cmd_ds_command { - /* command header */ - __le16 command; - __le16 size; - __le16 seqnum; - __le16 result; - - /* command Body */ - union { - struct cmd_ds_802_11_ps_mode psmode; - struct cmd_ds_802_11_associate associate; - struct cmd_ds_802_11_authenticate auth; - struct cmd_ds_802_11_get_stat gstat; - struct cmd_ds_802_3_get_stat gstat_8023; - struct cmd_ds_802_11_rf_antenna rant; - struct cmd_ds_802_11_monitor_mode monitor; - struct cmd_ds_802_11_rssi rssi; - struct cmd_ds_802_11_rssi_rsp rssirsp; - struct cmd_ds_mac_reg_access macreg; - struct cmd_ds_bbp_reg_access bbpreg; - struct cmd_ds_rf_reg_access rfreg; - - struct cmd_ds_802_11d_domain_info domaininfo; - struct cmd_ds_802_11d_domain_info domaininforesp; - - struct cmd_ds_802_11_tpc_cfg tpccfg; - struct cmd_ds_802_11_afc afc; - struct cmd_ds_802_11_led_ctrl ledgpio; - - struct cmd_tx_rate_query txrate; - struct cmd_ds_bt_access bt; - struct cmd_ds_fwt_access fwt; - struct cmd_ds_get_tsf gettsf; - struct cmd_ds_802_11_beacon_control bcn_ctrl; - } params; -} __attribute__ ((packed)); - -#endif diff --git a/drivers/net/wireless/mv8686/if_sdio.c b/drivers/net/wireless/mv8686/if_sdio.c deleted file mode 100755 index d7bfcf13ad38..000000000000 --- a/drivers/net/wireless/mv8686/if_sdio.c +++ /dev/null @@ -1,1392 +0,0 @@ -/* - * linux/drivers/net/wireless/mv8686/if_sdio.c - * - * Copyright 2007-2008 Pierre Ossman - * - * Inspired by if_cs.c, Copyright 2007 Holger Schurig - * - * This hardware has more or less no CMD53 support, so all registers - * must be accessed using sdio_readb()/sdio_writeb(). - * - * Transfers must be in one transaction or the firmware goes bonkers. - * This means that the transfer must either be small enough to do a - * byte based transfer or it must be padded to a multiple of the - * current block size. - * - * As SDIO is still new to the kernel, it is unfortunately common with - * bugs in the host controllers related to that. One such bug is that - * controllers cannot do transfers that aren't a multiple of 4 bytes. - * If you don't have time to fix the host controller driver, you can - * work around the problem by modifying if_sdio_host_to_card() and - * if_sdio_card_to_host() to pad the data. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "host.h" -#include "decl.h" -#include "defs.h" -#include "dev.h" -#include "if_sdio.h" -#include "wifi_power.h" - -#if (SDIO_SPEED_EVUL == 1) -#include -#endif - -struct sdio_func *wifi_sdio_func = NULL; -EXPORT_SYMBOL(wifi_sdio_func); - -/* - * Externs from MMC core. - */ -extern struct mmc_host *wifi_mmc_host; - -static const struct sdio_device_id if_sdio_ids[] = -{ - { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, SDIO_DEVICE_ID_MARVELL_LIBERTAS) }, - { /* end: all zeroes */ }, -}; -MODULE_DEVICE_TABLE(sdio, if_sdio_ids); - -struct if_sdio_model -{ - int model; - const char *helper; - const char *firmware; -}; - -static struct if_sdio_model if_sdio_models[] = -{ - { /* 8686 */ - .model = 0x0B, - .helper = "sd8686_helper.bin", - .firmware = "sd8686.bin", - }, -}; - -struct if_sdio_packet -{ - struct if_sdio_packet *next; - u16 nb; - u8 buffer[0] __attribute__((aligned(4))); -}; - -struct if_sdio_card -{ - struct sdio_func *func; - struct lbs_private *priv; - - int model; - unsigned long ioport; - - const char *helper; - const char *firmware; - - u8 buffer[65536]; /* buffer for rx packet/resp */ - - spinlock_t lock; - struct if_sdio_packet *packets; - - struct workqueue_struct *workqueue; - struct work_struct packet_worker; -}; - -/********************************************************************/ -/* I/O */ -/********************************************************************/ - -int lbs_reset_deep_sleep_wakeup(struct lbs_private * priv) -{ - int ret = 0; - struct if_sdio_card *card = (struct if_sdio_card *)priv->card; - - sdio_claim_host(card->func); - sdio_writeb(card->func, IF_SDIO_HOST_RESET, IF_SDIO_CONFIGURE, &ret); - sdio_release_host(card->func); - - return ret; -} - -int lbs_exit_deep_sleep(struct lbs_private * priv) -{ - int ret; - struct if_sdio_card *card = (struct if_sdio_card *)priv->card; - - sdio_claim_host(card->func); - sdio_writeb(card->func, IF_SDIO_HOST_UP, IF_SDIO_CONFIGURE, &ret); - sdio_release_host(card->func); - - return ret; -} - -static u16 if_sdio_read_scratch(struct if_sdio_card *card, int *err) -{ - int ret = 0; - u16 scratch; - - scratch = sdio_readb(card->func, IF_SDIO_SCRATCH, &ret); - if (!ret) - scratch |= sdio_readb(card->func, IF_SDIO_SCRATCH + 1, &ret) << 8; - - if (err) - *err = ret; - - if (ret) - return 0xffff; - - return scratch; -} - -static int if_sdio_handle_cmd(struct if_sdio_card *card, - u8 *buffer, unsigned size) -{ - struct lbs_private *priv = card->priv; - int ret = 0; - unsigned long flags; - u8 i; - - lbs_deb_enter(LBS_DEB_SDIO); - - if (size > LBS_CMD_BUFFER_SIZE) - { - lbs_deb_sdio("Cmd resp pkt is too large (%d bytes)\n", (int)size); - ret = -E2BIG; - goto out; - } - - spin_lock_irqsave(&priv->driver_lock, flags); - - i = (priv->resp_idx == 0) ? 1 : 0; - //BUG_ON(priv->resp_len[i]); - priv->resp_len[i] = size; - memcpy(priv->resp_buf[i], buffer, size); - lbs_notify_command_response(priv, i); - - spin_unlock_irqrestore(&card->priv->driver_lock, flags); - -out: - lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); - - return ret; -} - -static int if_sdio_handle_data(struct if_sdio_card *card, - u8 *buffer, u32 size) -{ - int ret = 0; - struct sk_buff *skb; - char *data; - - lbs_deb_enter(LBS_DEB_SDIO); - - if (size > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) - { - lbs_deb_sdio("Data resp pkt is too large (%d bytes)\n", (int)size); - ret = -E2BIG; - goto out; - } - - skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE + NET_IP_ALIGN); - if (!skb) - { - ret = -ENOMEM; - goto out; - } - - skb_reserve(skb, NET_IP_ALIGN); - - data = skb_put(skb, size); - - memcpy(data, buffer, size); - - lbs_process_rxed_packet(card->priv, skb); - -out: - lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); - - return ret; -} - -static int if_sdio_handle_event(struct if_sdio_card *card, - u8 *buffer, u32 size) -{ - int ret = 0; - u32 event; - - lbs_deb_enter(LBS_DEB_SDIO); - - if (size < 4) - { - lbs_deb_sdio("event packet too small (%d bytes)\n", - (int)size); - ret = -EINVAL; - goto out; - } - event = buffer[3] << 24; - event |= buffer[2] << 16; - event |= buffer[1] << 8; - event |= buffer[0]; - - lbs_queue_event(card->priv, event & 0xFF); - -out: - lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); - - return ret; -} - -static int if_sdio_card_to_host(struct if_sdio_card *card) -{ - int ret = 0; - u8 status; - u16 size, type, chunk; - unsigned long timeout; - - lbs_deb_enter(LBS_DEB_SDIO); - - size = if_sdio_read_scratch(card, &ret); - if (ret) - goto out; - - if (size < 4) - { - lbs_deb_sdio("Invalid pkt size (%d bytes) from FW.\n", (int)size); - ret = -EINVAL; - goto out; - } - - timeout = jiffies + HZ; - while (1) - { - status = sdio_readb(card->func, IF_SDIO_STATUS, &ret); - if (ret) - { - printk("Card to host: read sdio_status failed.\n"); - goto out; - } - - if (status & IF_SDIO_IO_RDY) - break; - - if (time_after(jiffies, timeout)) - { - ret = -ETIMEDOUT; - goto out; - } - //mdelay(1); - } - - /* - * The transfer must be in one transaction or the firmware - * goes suicidal. There's no way to guarantee that for all - * controllers, but we can at least try. - */ -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - chunk = size; -#else - chunk = sdio_align_size(card->func, size); -#endif - if ((chunk > card->func->cur_blksize) || (chunk > 512)) - { - chunk = (chunk + card->func->cur_blksize - 1) / - card->func->cur_blksize * card->func->cur_blksize; - } - - ret = sdio_readsb(card->func, card->buffer, card->ioport, chunk); - if (ret) - goto out; - - chunk = card->buffer[0] | (card->buffer[1] << 8); - type = card->buffer[2] | (card->buffer[3] << 8); - - lbs_deb_sdio("packet of type %d and size %d bytes\n", (int)type, (int)chunk); - - if (chunk > size) { - lbs_deb_sdio("packet fragment (%d > %d)\n", (int)chunk, (int)size); - ret = -EINVAL; - goto out; - } - - if (chunk < size) { - lbs_deb_sdio("packet fragment (%d < %d)\n", - (int)chunk, (int)size); - } - - switch (type) - { - case MVMS_CMD: - ret = if_sdio_handle_cmd(card, card->buffer + 4, chunk - 4); - if (ret) - goto out; - break; - case MVMS_DAT: - ret = if_sdio_handle_data(card, card->buffer + 4, chunk - 4); - if (ret) - goto out; - break; - case MVMS_EVENT: - ret = if_sdio_handle_event(card, card->buffer + 4, chunk - 4); - if (ret) - goto out; - break; - default: - lbs_deb_sdio("Invalid type (%d) from FW.\n", (int)type); - ret = -EINVAL; - goto out; - } - -out: - if (ret) - printk("Problem fetching packet from FW: ret=%d\n", ret); - - lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); - - return ret; -} - -static void if_sdio_host_to_card_worker(struct work_struct *work) -{ - struct if_sdio_card *card; - struct if_sdio_packet *packet; - unsigned long timeout; - u8 status; - int ret; - unsigned long flags; - - lbs_deb_enter(LBS_DEB_SDIO); - - card = container_of(work, struct if_sdio_card, packet_worker); - - while (1) - { - spin_lock_irqsave(&card->lock, flags); - packet = card->packets; - if (packet) - card->packets = packet->next; - spin_unlock_irqrestore(&card->lock, flags); - - if (!packet) - break; - - sdio_claim_host(card->func); - - timeout = jiffies + HZ; - while (1) - { - status = sdio_readb(card->func, IF_SDIO_STATUS, &ret); - if (ret) - { - printk("Host to card worker: read sdio_status failed.\n"); - goto release; - } - - if (status & IF_SDIO_IO_RDY) - break; - if (time_after(jiffies, timeout)) - { - ret = -ETIMEDOUT; - goto release; - } - //mdelay(1); - } - - ret = sdio_writesb(card->func, card->ioport, packet->buffer, packet->nb); - if (ret) - goto release; -release: - sdio_release_host(card->func); - - kfree(packet); - } - - lbs_deb_leave(LBS_DEB_SDIO); -} - -/********************************************************************/ -/* Firmware */ -/********************************************************************/ - -inline int if_sdio_wait_dnld_ready(struct if_sdio_card *card) -{ - int ret; - unsigned long timeout; - volatile u32 status; - - timeout = jiffies + HZ; - - while (1) - { - status = sdio_readb(card->func, IF_SDIO_STATUS, &ret); - if (ret) - return 1; - - if ((status & IF_SDIO_IO_RDY) && (status & IF_SDIO_DL_RDY)) - return 0; - - if (time_after(jiffies, timeout)) - return 2; - - //mdelay(1); - } - - return -1; -} - -/* - * Download WIFI helper to module via SDIO. - */ -static int if_sdio_prog_helper(struct if_sdio_card *card) -{ - int ret; - const struct firmware *fw; - unsigned long timeout; - u8 *chunk_buffer; - u32 chunk_size, tx_len; - const u8 *firmware; - size_t size; - - lbs_deb_enter(LBS_DEB_SDIO); - - ret = request_firmware(&fw, card->helper, &card->func->dev); - if (ret) - { - printk("Fail to request helper firmware.\n"); - goto out; - } - printk("%s: request fw ok.\n", __func__); - - tx_len = SD_BLOCK_SIZE * FW_TRANSFER_NBLOCK; //SDIO frame length. - - chunk_buffer = kzalloc(tx_len, GFP_KERNEL); - if (!chunk_buffer) - { - printk("kzalloc for chunk buffer failed.\n"); - ret = -ENOMEM; - goto release_fw; - } - - sdio_claim_host(card->func); - - /* Here, we need to make sure the block-size is 256. */ - ret = sdio_set_block_size(card->func, 0); - if (ret) - { - printk("Set block size to 256 for download firmware failed.\n"); - goto release; - } - - firmware = fw->data; - size = fw->size; - - while (size) - { - ret = if_sdio_wait_dnld_ready(card); - if (ret != 0) - { - printk("Waiting for DNLD READY failed: %d\n", ret); - goto release; - } - - chunk_size = min(size, (size_t)(tx_len - SDIO_HEADER_LEN)); - - *((__le32*)chunk_buffer) = cpu_to_le32(chunk_size); - memcpy(chunk_buffer + 4, firmware, chunk_size); - - ret = sdio_writesb(card->func, card->ioport, chunk_buffer, tx_len); - if (ret) - goto release; - - firmware += chunk_size; - size -= chunk_size; - } - - /* an empty block marks the end of the transfer */ - memset(chunk_buffer, 0, 4); - ret = sdio_writesb(card->func, card->ioport, chunk_buffer, tx_len); - if (ret) - goto release; - - /* wait for the helper to boot by looking at the size register */ - timeout = jiffies + HZ; - while (1) - { - u16 req_size; - - req_size = sdio_readb(card->func, IF_SDIO_RD_BASE, &ret); - if (ret) - goto release; - - req_size |= sdio_readb(card->func, IF_SDIO_RD_BASE + 1, &ret) << 8; - if (ret) - goto release; - - if (req_size != 0) - break; - - if (time_after(jiffies, timeout)) - { - ret = -ETIMEDOUT; - goto release; - } - //msleep(10); - } - - ret = 0; - -release: - sdio_release_host(card->func); - kfree(chunk_buffer); - -release_fw: - release_firmware(fw); - -out: - if (ret) - printk("Failed to download helper firmware.\n"); - - lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); - - return ret; -} - -static int if_sdio_prog_real(struct if_sdio_card *card) -{ - int ret; - const struct firmware *fw; - unsigned long timeout; - u8 *chunk_buffer; - u32 chunk_size; - const u8 *firmware; - size_t size, req_size; -#if (SDIO_SPEED_EVUL == 1) - struct timeval sdio_start_tv, sdio_stop_tv; - unsigned long download_time, download_second; -#endif - - lbs_deb_enter(LBS_DEB_SDIO); - - ret = request_firmware(&fw, card->firmware, &card->func->dev); - if (ret) - { - printk("Fail to request real firmware.\n"); - goto out; - } - - chunk_buffer = kzalloc(512, GFP_KERNEL); - if (!chunk_buffer) { - ret = -ENOMEM; - goto release_fw; - } - - sdio_claim_host(card->func); - - /* Here, we need to make sure the block-size is 256. */ - ret = sdio_set_block_size(card->func, 0); - if (ret) - { - printk("Set block size to 256 for download FW failed.\n"); - goto release; - } - - firmware = fw->data; - size = fw->size; - -#if (SDIO_SPEED_EVUL == 1) - do_gettimeofday(&sdio_start_tv); -#endif - - while (size) - { - ret = if_sdio_wait_dnld_ready(card); - if (ret != 0) - { - printk("Waiting for DNLD READY failed: %d\n", ret); - goto release; - } - - req_size = sdio_readb(card->func, IF_SDIO_RD_BASE, &ret); - if (ret) - goto release; - - req_size |= sdio_readb(card->func, IF_SDIO_RD_BASE + 1, &ret) << 8; - if (ret) - goto release; -/* - lbs_deb_sdio("firmware wants %d bytes\n", (int)req_size); -*/ - if (req_size == 0) { - lbs_deb_sdio("firmware helper gave up early\n"); - ret = -EIO; - goto release; - } - - if (req_size & 0x01) { - lbs_deb_sdio("firmware helper signalled error\n"); - ret = -EIO; - goto release; - } - - if (req_size > size) - req_size = size; - - while (req_size) - { - chunk_size = min(req_size, (size_t)512); - - memcpy(chunk_buffer, firmware, chunk_size); -/* - lbs_deb_sdio("sending %d bytes (%d bytes) chunk\n", - chunk_size, (chunk_size + 31) / 32 * 32); -*/ - ret = sdio_writesb(card->func, card->ioport, - chunk_buffer, roundup(chunk_size, SD_BLOCK_SIZE)); - if (ret) - goto release; - - firmware += chunk_size; - size -= chunk_size; - req_size -= chunk_size; - } - } -#if (SDIO_SPEED_EVUL == 1) - do_gettimeofday(&sdio_stop_tv); - - if (sdio_stop_tv.tv_usec < sdio_start_tv.tv_usec) - { - sdio_stop_tv.tv_sec -= 1; - } - download_second = sdio_stop_tv.tv_sec - sdio_start_tv.tv_sec; - - if (sdio_stop_tv.tv_usec < sdio_start_tv.tv_usec) - { - download_time = 1*1000*1000 - sdio_start_tv.tv_usec; - download_time += sdio_stop_tv.tv_usec; - } - else - { - download_time = sdio_stop_tv.tv_usec - sdio_start_tv.tv_usec; - - } - download_time /= 1000; //ms - printk("Data size = %d bytes, Time = %2lu.%03lu seconds, Rate = %lu kbps\n", - fw->size, download_second, download_time, - (fw->size * 8 * 1000) / (download_second * 1000 + download_time) / 1000); -#endif - - ret = 0; - - //lbs_deb_sdio("waiting for firmware to boot...\n"); - //printk("waiting for firmware to boot...\n"); - - /* wait for the firmware to boot */ - timeout = jiffies + HZ; - while (1) - { - u16 scratch; - - scratch = if_sdio_read_scratch(card, &ret); - if (ret) - goto release; - - if (scratch == IF_SDIO_FIRMWARE_OK) - break; - - if (time_after(jiffies, timeout)) { - ret = -ETIMEDOUT; - goto release; - } - //msleep(10); - } - - ret = 0; - -release: - sdio_release_host(card->func); - kfree(chunk_buffer); -release_fw: - release_firmware(fw); - -out: - if (ret) - printk("Failed to download firmware.\n"); - //else - //printk("Success to download firmware.\n"); - - lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); - - return ret; -} - -static int if_sdio_prog_firmware(struct if_sdio_card *card) -{ - int ret; - u16 scratch; - - lbs_deb_enter(LBS_DEB_SDIO); - - sdio_claim_host(card->func); - scratch = if_sdio_read_scratch(card, &ret); - sdio_release_host(card->func); - - if (ret) - goto out; - - if (scratch == IF_SDIO_FIRMWARE_OK) - { - lbs_deb_sdio("firmware already loaded\n"); - goto success; - } - - ret = if_sdio_prog_helper(card); - if (ret) - goto out; - - ret = if_sdio_prog_real(card); - if (ret) - goto out; - -success: - ret = 0; - -out: - lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); - - return ret; -} - -/*******************************************************************/ -/* HIF callbacks */ -/*******************************************************************/ - -static int if_sdio_host_to_card(struct lbs_private *priv, - u8 type, u8 *buf, u16 nb) -{ - int ret; - struct if_sdio_card *card; - struct if_sdio_packet *packet, *cur; - u16 size; - unsigned long flags; - - lbs_deb_enter_args(LBS_DEB_SDIO, "type %d, bytes %d", type, nb); - - card = priv->card; - - if (nb > (65536 - sizeof(struct if_sdio_packet) - 4)) - { - ret = -EINVAL; - goto out; - } - - /* - * The transfer must be in one transaction or the firmware - * goes suicidal. There's no way to guarantee that for all - * controllers, but we can at least try. - */ -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - size = nb + 4; -#else - size = sdio_align_size(card->func, nb + 4); -#endif - if ((size > card->func->cur_blksize) || (size > 512)) - { - size = (size + card->func->cur_blksize - 1) / - card->func->cur_blksize * card->func->cur_blksize; - } - - packet = kzalloc(sizeof(struct if_sdio_packet) + size, GFP_ATOMIC); - if (!packet) { - ret = -ENOMEM; - goto out; - } - - packet->next = NULL; - packet->nb = size; - - /* - * SDIO specific header. - */ - packet->buffer[0] = (nb + 4) & 0xff; - packet->buffer[1] = ((nb + 4) >> 8) & 0xff; - packet->buffer[2] = type; - packet->buffer[3] = 0; - - memcpy(packet->buffer + 4, buf, nb); - - spin_lock_irqsave(&card->lock, flags); - - if (!card->packets) - card->packets = packet; - else { - cur = card->packets; - while (cur->next) - cur = cur->next; - cur->next = packet; - } - - switch (type) - { - case MVMS_CMD: - priv->dnld_sent = DNLD_CMD_SENT; - break; - case MVMS_DAT: - priv->dnld_sent = DNLD_DATA_SENT; - break; - default: - lbs_deb_sdio("unknown packet type %d\n", (int)type); - } - - spin_unlock_irqrestore(&card->lock, flags); - - queue_work(card->workqueue, &card->packet_worker); - - ret = 0; - -out: - lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); - - return ret; -} - -/*******************************************************************/ -/* SDIO callbacks */ -/*******************************************************************/ - -static void if_sdio_interrupt(struct sdio_func *func) -{ - int ret; - struct if_sdio_card *card; - u8 cause; - - lbs_deb_enter(LBS_DEB_SDIO); - - card = sdio_get_drvdata(func); - - cause = sdio_readb(card->func, IF_SDIO_H_INT_STATUS, &ret); - if (ret) - goto out; - - lbs_deb_sdio("interrupt: 0x%X\n", (unsigned)cause); - - sdio_writeb(card->func, ~cause, IF_SDIO_H_INT_STATUS, &ret); - if (ret) - goto out; - - /* - * Ignore the define name, this really means the card has - * successfully received the command. - */ - if (cause & IF_SDIO_H_INT_DNLD) - lbs_host_to_card_done(card->priv); - - - if (cause & IF_SDIO_H_INT_UPLD) { - ret = if_sdio_card_to_host(card); - if (ret) - goto out; - } - - ret = 0; - -out: - lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); -} - -static int if_sdio_probe(struct sdio_func *func, - const struct sdio_device_id *id) -{ - struct if_sdio_card *card; - struct lbs_private *priv; - int ret, i; - unsigned int model; - struct if_sdio_packet *packet; - - lbs_deb_enter(LBS_DEB_SDIO); - - printk("%s: enter.\n", __func__); - - for (i = 0;i < func->card->num_info;i++) - { - if (sscanf(func->card->info[i], - "802.11 SDIO ID: %x", &model) == 1) - break; - if (sscanf(func->card->info[i], - "ID: %x", &model) == 1) - break; - if (!strcmp(func->card->info[i], "IBIS Wireless SDIO Card")) - { - model = 4; - break; - } - } - - if (i == func->card->num_info) - { - lbs_pr_err("unable to identify card model\n"); - return -ENODEV; - } - - card = kzalloc(sizeof(struct if_sdio_card), GFP_KERNEL); - if (!card) - return -ENOMEM; - - card->func = func; - card->model = model; - spin_lock_init(&card->lock); - card->workqueue = create_workqueue("mv8686_sdio"); - INIT_WORK(&card->packet_worker, if_sdio_host_to_card_worker); - - for (i = 0;i < ARRAY_SIZE(if_sdio_models);i++) - { - if (card->model == if_sdio_models[i].model) - break; - } - - if (i == ARRAY_SIZE(if_sdio_models)) - { - lbs_pr_err("unkown card model 0x%x\n", card->model); - ret = -ENODEV; - goto free; - } - - card->helper = if_sdio_models[i].helper; - card->firmware = if_sdio_models[i].firmware; - - sdio_claim_host(func); - - ret = sdio_enable_func(func); - if (ret) - goto release; - - ret = sdio_claim_irq(func, if_sdio_interrupt); - if (ret) - goto disable; - - card->ioport = sdio_readb(func, IF_SDIO_IOPORT, &ret); - if (ret) - goto release_int; - - card->ioport |= sdio_readb(func, IF_SDIO_IOPORT + 1, &ret) << 8; - if (ret) - goto release_int; - - card->ioport |= sdio_readb(func, IF_SDIO_IOPORT + 2, &ret) << 16; - if (ret) - goto release_int; - - sdio_release_host(func); - - sdio_set_drvdata(func, card); - - lbs_deb_sdio("class = 0x%X, vendor = 0x%X, " - "device = 0x%X, model = 0x%X, ioport = 0x%X\n", - func->class, func->vendor, func->device, - model, (unsigned)card->ioport); - - ret = if_sdio_prog_firmware(card); - if (ret) - goto reclaim; - - priv = lbs_add_card(card, &func->dev); - if (!priv) { - ret = -ENOMEM; - goto reclaim; - } - - card->priv = priv; - - priv->card = card; - priv->hw_host_to_card = if_sdio_host_to_card; - - priv->fw_ready = 1; - - /* - * Enable interrupts now that everything is set up - */ - sdio_claim_host(func); - sdio_writeb(func, 0x0f, IF_SDIO_H_INT_MASK, &ret); - sdio_release_host(func); - if (ret) - goto reclaim; - - ret = lbs_start_card(priv); - if (ret) - goto err_activate_card; - - if (priv->fwcapinfo & FW_CAPINFO_PS) - priv->ps_supported = 1; - - wifi_sdio_func = func; - -out: - lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); - - return ret; - -err_activate_card: - flush_workqueue(card->workqueue); - lbs_remove_card(priv); -reclaim: - sdio_claim_host(func); -release_int: - sdio_release_irq(func); -disable: - sdio_disable_func(func); -release: - sdio_release_host(func); -free: - destroy_workqueue(card->workqueue); - - while (card->packets) - { - packet = card->packets; - card->packets = card->packets->next; - kfree(packet); - } - - kfree(card); - - goto out; -} - -int wifi_func_removed; - -static void if_sdio_remove(struct sdio_func *func) -{ - struct if_sdio_card *card; - struct if_sdio_packet *packet; - - lbs_deb_enter(LBS_DEB_SDIO); - - card = sdio_get_drvdata(func); - card->priv->surpriseremoved = 1; - - wifi_sdio_func = NULL; - - /* - * Remove netdev, break wext and socket path. - */ - lbs_stop_card(card->priv); - - /* - * Destroy the driver completely. - */ - lbs_remove_card(card->priv); - - flush_scheduled_work(); - if (card->workqueue != NULL) - destroy_workqueue(card->workqueue); - - sdio_claim_host(func); - sdio_release_irq(func); - sdio_disable_func(func); - sdio_release_host(func); - - while (card->packets) - { - packet = card->packets; - card->packets = card->packets->next; - kfree(packet); - } - kfree(card); - - wifi_func_removed = 1; - - lbs_deb_leave(LBS_DEB_SDIO); -} - -static struct sdio_driver if_sdio_driver = -{ - .name = "mv8686_sdio", - .id_table = if_sdio_ids, - .probe = if_sdio_probe, - .remove = if_sdio_remove, -}; - -/*******************************************************************/ -/* Module functions */ -/*******************************************************************/ - -/* - * Whether a GPIO is used to control the power of WiFi. - */ -int wifi_no_power_gpio = 0; /* 0-No 1-Yes */ - -extern int wifi_ps_status; - -#include "wifi_version.h" - -extern int mv8686_main_init(void); -extern void mv8686_main_exit(void); - -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) -extern int rk29sdk_wifi_set_carddetect(int val); -#endif - -int rockchip_wifi_init_module(void) -{ - int ret = 0, timeout; - - mv8686_main_init(); - - wifi_func_removed = 0; - wifi_sdio_func = NULL; - wifi_no_power_gpio = 0; - - /* Make sure we are in awake. -- Yongle Lai */ - wifi_ps_status = WIFI_PS_AWAKE; - - printk("MV8686 WiFi driver (Powered by Rockchip,Ver %s) init.\n", MV8686_DRV_VERSION); - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - - if (wifi_mmc_host == NULL) - { - printk("SDIO host (mmc1) for WiFi is inactive.\n"); - return -ENODEV; - } -#endif - - ret = sdio_register_driver(&if_sdio_driver); - if (ret != 0) - { - printk("Register SDIO driver for WIFI failed.\n"); - return -ENODEV; - } - -#ifdef WIFI_GPIO_POWER_CONTROL - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - - if (wifi_mmc_host->bus_ops != NULL) /* mmc/card is attached already. */ - { - printk("SDIO maybe be attached already.\n"); - wifi_no_power_gpio = 1; - //return 0; - goto wait_wifi; - } -#endif - - wifi_turn_on_card(WIFI_CHIP_MV8686); - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - mmc_detect_change(wifi_mmc_host, 1); -#else - rk29sdk_wifi_set_carddetect(1); -#endif - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) -wait_wifi: -#endif - //printk("Waiting for SDIO card to be attached.\n"); - for (timeout = 100; timeout >=0; timeout--) - { - if (wifi_sdio_func != NULL) - break; - msleep(100); - } - if (timeout <= 0) - { - printk("No WiFi function card has been attached (10s).\n"); - - sdio_unregister_driver(&if_sdio_driver); - - wifi_turn_off_card(); -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - mmc_detect_change(wifi_mmc_host, 1); -#else - rk29sdk_wifi_set_carddetect(0); -#endif - return -ENODEV; - } - //printk("%s: timeout = %d (interval = 100 ms)\n", __func__, timeout); - -#endif - - /* - * Make sure system is awake when we're start up. - */ -#if (NEW_MV8686_PS == 1) - wifi_power_save_init(); -#endif - - - return 0; -} - -void rockchip_wifi_exit_module(void) -{ - int timeout; - - lbs_deb_enter(LBS_DEB_SDIO); - -#if (NEW_MV8686_PS == 1) - wifi_power_save_stop(); -#endif - -#if (ANDROID_POWER_SAVE == 1) - wifi_ps_status = WIFI_PS_AWAKE; -#endif - - sdio_unregister_driver(&if_sdio_driver); - -#ifdef WIFI_GPIO_POWER_CONTROL - - //if (wifi_no_power_gpio == 1) - // return; -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - if (wifi_mmc_host == NULL) - { - printk("No SDIO host is present.\n"); - goto out; - } -#endif - wifi_turn_off_card(); -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - mmc_detect_change(wifi_mmc_host, 2); -#else - rk29sdk_wifi_set_carddetect(0); -#endif - - //printk("Waiting for sdio card to be released ... \n"); - for (timeout = 40; timeout >= 0; timeout--) - { - msleep(100); -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - if (wifi_mmc_host->bus_ops == NULL) -#else - if (wifi_func_removed == 1) -#endif - break; - } - if (timeout < 0) - printk("Fail to release SDIO card.\n"); - //else - //printk("Success to release SDIO card.\n"); - printk("%s: timeout = %d (interval = 100 ms)\n", __func__, timeout); -#endif - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) -out: -#endif - -#if (NEW_MV8686_PS == 1) - wifi_power_save_exit(); -#endif - - mv8686_main_exit(); - - lbs_deb_leave(LBS_DEB_SDIO); -} - -#if 0 - -extern int rk29sdk_wifi_set_carddetect(int val); - -int rockchip_wifi_init_module(void) -{ - int ret, timeout; - - printk("MV8686 WiFi driver (Powered by Rockchip,Ver %s) init.\n", MV8686_DRV_VERSION); - - wifi_func_removed = 0; - mv8686_main_init(); - wifi_sdio_func = NULL; - wifi_no_power_gpio = 0; - - /* Make sure we are in awake. -- Yongle Lai */ - wifi_ps_status = WIFI_PS_AWAKE; - - ret = sdio_register_driver(&if_sdio_driver); - if (ret != 0) - { - printk("Register SDIO driver for WIFI failed.\n"); - return -ENODEV; - } - - wifi_turn_on_card(WIFI_CHIP_MV8686); - - rk29sdk_wifi_set_carddetect(1); - - for (timeout = 100; timeout >=0; timeout--) - { - if (wifi_sdio_func != NULL) - break; - msleep(100); - } - if (timeout <= 0) - { - printk("No WiFi function card has been attached (10s).\n"); - - sdio_unregister_driver(&if_sdio_driver); - - wifi_turn_off_card(); - rk29sdk_wifi_set_carddetect(0); - - wifi_func_removed = 1; - - return -ENODEV; - } - - return 0; -} - -void rockchip_wifi_exit_module(void) -{ - int timeout; - - sdio_unregister_driver(&if_sdio_driver); - - wifi_turn_off_card(); - - rk29sdk_wifi_set_carddetect(0); - - for (timeout = 40; timeout >= 0; timeout--) - { - msleep(100); - if (wifi_func_removed == 1) - break; - } - if (timeout < 0) - printk("Fail to release SDIO card.\n"); - - mv8686_main_exit(); - - printk("%s: timeout = %d (interval = 100 ms)\n", __func__, timeout); -} -#endif - -int mv88w8686_if_sdio_init_module(void) -{ - return rockchip_wifi_init_module(); -} - -void mv88w8686_if_sdio_exit_module(void) -{ - rockchip_wifi_exit_module(); -} - -#ifndef MODULE -EXPORT_SYMBOL(rockchip_wifi_init_module); -EXPORT_SYMBOL(rockchip_wifi_exit_module); -EXPORT_SYMBOL(mv88w8686_if_sdio_init_module); -EXPORT_SYMBOL(mv88w8686_if_sdio_exit_module); -#endif - -#ifdef MODULE -module_init(rockchip_wifi_init_module); -module_exit(rockchip_wifi_exit_module); -#endif - -MODULE_DESCRIPTION("MV8686 SDIO WLAN Driver"); -MODULE_AUTHOR("Yongle Lai"); -MODULE_LICENSE("GPL"); - diff --git a/drivers/net/wireless/mv8686/if_sdio.h b/drivers/net/wireless/mv8686/if_sdio.h deleted file mode 100755 index e12b55a0f508..000000000000 --- a/drivers/net/wireless/mv8686/if_sdio.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * linux/drivers/net/wireless/libertas/if_sdio.h - * - * Copyright 2007 Pierre Ossman - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - */ - -#ifndef _LBS_IF_SDIO_H -#define _LBS_IF_SDIO_H - -#define IF_SDIO_IOPORT 0x00 - -#define IF_SDIO_CONFIGURE 0x03 -#define IF_SDIO_HOST_UP 0x02 -#define IF_SDIO_HOST_DOWN 0x01 -#define IF_SDIO_HOST_RESET 0x00 - -#define IF_SDIO_H_INT_MASK 0x04 -#define IF_SDIO_H_INT_OFLOW 0x08 -#define IF_SDIO_H_INT_UFLOW 0x04 -#define IF_SDIO_H_INT_DNLD 0x02 -#define IF_SDIO_H_INT_UPLD 0x01 - -#define IF_SDIO_H_INT_STATUS 0x05 -#define IF_SDIO_H_INT_RSR 0x06 -#define IF_SDIO_H_INT_STATUS2 0x07 - -#define IF_SDIO_RD_BASE 0x10 - -#define IF_SDIO_STATUS 0x20 -#define IF_SDIO_IO_RDY 0x08 -#define IF_SDIO_CIS_RDY 0x04 -#define IF_SDIO_UL_RDY 0x02 -#define IF_SDIO_DL_RDY 0x01 - -#define IF_SDIO_C_INT_MASK 0x24 -#define IF_SDIO_C_INT_STATUS 0x28 -#define IF_SDIO_C_INT_RSR 0x2C - -#define IF_SDIO_SCRATCH 0x34 -#define IF_SDIO_SCRATCH_OLD 0x80fe -#define IF_SDIO_FIRMWARE_OK 0xfedc - -#define IF_SDIO_EVENT 0x80fc - -/** Number of firmware blocks to transfer */ -#define FW_TRANSFER_NBLOCK 2 -#define SD_BLOCK_SIZE 256 - -/** The number of times to try when polling for status bits */ -#define MAX_POLL_TRIES 100 - -/** SDIO header length */ -#define SDIO_HEADER_LEN 4 - -/** Macros for Data Alignment : address */ -#define ALIGN_ADDR(p, a) \ - ((((u32)(p)) + (((u32)(a)) - 1)) & ~(((u32)(a)) - 1)) - -#endif diff --git a/drivers/net/wireless/mv8686/iwpriv.h b/drivers/net/wireless/mv8686/iwpriv.h deleted file mode 100755 index f5a6bb0e7f24..000000000000 --- a/drivers/net/wireless/mv8686/iwpriv.h +++ /dev/null @@ -1,18 +0,0 @@ - -#ifndef IW_PRIV_H -#define IW_PRIV_H - -#define TRUE 1 -#define FALSE 0 - -/** PRIVATE CMD ID */ -#define WLANIOCTL 0x8BE0 - -#define WLANDEEPSLEEP (WLANIOCTL + 1) -#define WLAN_SETONEINT_GETONEINT (WLANIOCTL + 2) -#define WLAN_AUTODEEPSLEEP 1 -#define WLAN_SUSPEND_RESUME (WLANIOCTL + 3) -#define WLAN_SUSPEND 1 -#define WLAN_RESUME 2 - -#endif /* IW_PRIV_H */ diff --git a/drivers/net/wireless/mv8686/lib80211.h b/drivers/net/wireless/mv8686/lib80211.h deleted file mode 100755 index 55c03370588b..000000000000 --- a/drivers/net/wireless/mv8686/lib80211.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * lib80211.h -- common bits for IEEE802.11 wireless drivers - * - * Copyright (c) 2008, John W. Linville - * - * Some bits copied from old ieee80211 component, w/ original copyright - * notices below: - * - * Original code based on Host AP (software wireless LAN access point) driver - * for Intersil Prism2/2.5/3. - * - * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen - * - * Copyright (c) 2002-2003, Jouni Malinen - * - * Adaption to a generic IEEE 802.11 stack by James Ketrenos - * - * - * Copyright (c) 2004, Intel Corporation - * - */ - -#ifndef LIB80211_H -#define LIB80211_H - -#include -#include -#include -#include -#include -#include -#include -#include -/* print_ssid() is intended to be used in debug (and possibly error) - * messages. It should never be used for passing ssid to user space. */ -const char *mv8686_print_ssid(char *buf, const char *ssid, u8 ssid_len); -#define DECLARE_SSID_BUF(var) char var[IEEE80211_MAX_SSID_LEN * 4 + 1] __maybe_unused - -#define NUM_WEP_KEYS 4 - -enum { - IEEE80211_CRYPTO_TKIP_COUNTERMEASURES = (1 << 0), -}; - -struct lib80211_crypto_ops { - const char *name; - struct list_head list; - - /* init new crypto context (e.g., allocate private data space, - * select IV, etc.); returns NULL on failure or pointer to allocated - * private data on success */ - void *(*init) (int keyidx); - - /* deinitialize crypto context and free allocated private data */ - void (*deinit) (void *priv); - - int (*build_iv) (struct sk_buff * skb, int hdr_len, - u8 *key, int keylen, void *priv); - - /* encrypt/decrypt return < 0 on error or >= 0 on success. The return - * value from decrypt_mpdu is passed as the keyidx value for - * decrypt_msdu. skb must have enough head and tail room for the - * encryption; if not, error will be returned; these functions are - * called for all MPDUs (i.e., fragments). - */ - int (*encrypt_mpdu) (struct sk_buff * skb, int hdr_len, void *priv); - int (*decrypt_mpdu) (struct sk_buff * skb, int hdr_len, void *priv); - - /* These functions are called for full MSDUs, i.e. full frames. - * These can be NULL if full MSDU operations are not needed. */ - int (*encrypt_msdu) (struct sk_buff * skb, int hdr_len, void *priv); - int (*decrypt_msdu) (struct sk_buff * skb, int keyidx, int hdr_len, - void *priv); - - int (*set_key) (void *key, int len, u8 * seq, void *priv); - int (*get_key) (void *key, int len, u8 * seq, void *priv); - - /* procfs handler for printing out key information and possible - * statistics */ - char *(*print_stats) (char *p, void *priv); - - /* Crypto specific flag get/set for configuration settings */ - unsigned long (*get_flags) (void *priv); - unsigned long (*set_flags) (unsigned long flags, void *priv); - - /* maximum number of bytes added by encryption; encrypt buf is - * allocated with extra_prefix_len bytes, copy of in_buf, and - * extra_postfix_len; encrypt need not use all this space, but - * the result must start at the beginning of the buffer and correct - * length must be returned */ - int extra_mpdu_prefix_len, extra_mpdu_postfix_len; - int extra_msdu_prefix_len, extra_msdu_postfix_len; - - struct module *owner; -}; - -struct lib80211_crypt_data { - struct list_head list; /* delayed deletion list */ - struct lib80211_crypto_ops *ops; - void *priv; - atomic_t refcnt; -}; - -struct lib80211_crypt_info { - char *name; - /* Most clients will already have a lock, - so just point to that. */ - spinlock_t *lock; - - struct lib80211_crypt_data *crypt[NUM_WEP_KEYS]; - int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */ - struct list_head crypt_deinit_list; - struct timer_list crypt_deinit_timer; - int crypt_quiesced; -}; - -int lib80211_crypt_info_init(struct lib80211_crypt_info *info, char *name, - spinlock_t *lock); -void lib80211_crypt_info_free(struct lib80211_crypt_info *info); -int lib80211_register_crypto_ops(struct lib80211_crypto_ops *ops); -int lib80211_unregister_crypto_ops(struct lib80211_crypto_ops *ops); -struct lib80211_crypto_ops *lib80211_get_crypto_ops(const char *name); -void lib80211_crypt_deinit_entries(struct lib80211_crypt_info *, int); -void lib80211_crypt_deinit_handler(unsigned long); -void lib80211_crypt_delayed_deinit(struct lib80211_crypt_info *info, - struct lib80211_crypt_data **crypt); -void lib80211_crypt_quiescing(struct lib80211_crypt_info *info); - -#endif /* LIB80211_H */ diff --git a/drivers/net/wireless/mv8686/main.c b/drivers/net/wireless/mv8686/main.c deleted file mode 100755 index 16a126e383a1..000000000000 --- a/drivers/net/wireless/mv8686/main.c +++ /dev/null @@ -1,2056 +0,0 @@ -/** - * This file contains the major functions in WLAN - * driver. It includes init, exit, open, close and main thread etc.. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "host.h" -#include "decl.h" -#include "dev.h" -#include "wext.h" -#include "scan.h" -#include "assoc.h" -#include "cmd.h" - -#include "wifi_power.h" - -/* Module parameters */ -unsigned int lbs_debug = 0xFFFFFFFF; -EXPORT_SYMBOL_GPL(lbs_debug); - -extern int wifi_customized_mac_addr(u8 *mac); - -struct lbs_private *lbs_wifi_priv = NULL; - -/* This global structure is used to send the confirm_sleep command as - * fast as possible down to the firmware. */ -struct cmd_confirm_sleep confirm_sleep; - -/* - * When we receive a deauthenticated event, we may get to - * re-association to the previous AP. This atom will be set to 1 when - * we are doing association, else it will be set to 1. - */ -atomic_t reassoc_flag; - -#define LBS_TX_PWR_DEFAULT 20 /*100mW */ -#define LBS_TX_PWR_US_DEFAULT 20 /*100mW */ -#define LBS_TX_PWR_JP_DEFAULT 16 /*50mW */ -#define LBS_TX_PWR_FR_DEFAULT 20 /*100mW */ -#define LBS_TX_PWR_EMEA_DEFAULT 20 /*100mW */ - -/* Format { channel, frequency (MHz), maxtxpower } */ -/* band: 'B/G', region: USA FCC/Canada IC */ -static struct chan_freq_power channel_freq_power_US_BG[] = { - {1, 2412, LBS_TX_PWR_US_DEFAULT}, - {2, 2417, LBS_TX_PWR_US_DEFAULT}, - {3, 2422, LBS_TX_PWR_US_DEFAULT}, - {4, 2427, LBS_TX_PWR_US_DEFAULT}, - {5, 2432, LBS_TX_PWR_US_DEFAULT}, - {6, 2437, LBS_TX_PWR_US_DEFAULT}, - {7, 2442, LBS_TX_PWR_US_DEFAULT}, - {8, 2447, LBS_TX_PWR_US_DEFAULT}, - {9, 2452, LBS_TX_PWR_US_DEFAULT}, - {10, 2457, LBS_TX_PWR_US_DEFAULT}, - {11, 2462, LBS_TX_PWR_US_DEFAULT}, - {12, 2467, LBS_TX_PWR_US_DEFAULT}, - {13, 2472, LBS_TX_PWR_US_DEFAULT}, - {14, 2484, LBS_TX_PWR_US_DEFAULT} -}; - -/* band: 'B/G', region: Europe ETSI */ -static struct chan_freq_power channel_freq_power_EU_BG[] = { - {1, 2412, LBS_TX_PWR_EMEA_DEFAULT}, - {2, 2417, LBS_TX_PWR_EMEA_DEFAULT}, - {3, 2422, LBS_TX_PWR_EMEA_DEFAULT}, - {4, 2427, LBS_TX_PWR_EMEA_DEFAULT}, - {5, 2432, LBS_TX_PWR_EMEA_DEFAULT}, - {6, 2437, LBS_TX_PWR_EMEA_DEFAULT}, - {7, 2442, LBS_TX_PWR_EMEA_DEFAULT}, - {8, 2447, LBS_TX_PWR_EMEA_DEFAULT}, - {9, 2452, LBS_TX_PWR_EMEA_DEFAULT}, - {10, 2457, LBS_TX_PWR_EMEA_DEFAULT}, - {11, 2462, LBS_TX_PWR_EMEA_DEFAULT}, - {12, 2467, LBS_TX_PWR_EMEA_DEFAULT}, - {13, 2472, LBS_TX_PWR_EMEA_DEFAULT}, - {14, 2484, LBS_TX_PWR_EMEA_DEFAULT} -}; - -/* band: 'B/G', region: Spain */ -static struct chan_freq_power channel_freq_power_SPN_BG[] = { - {10, 2457, LBS_TX_PWR_DEFAULT}, - {11, 2462, LBS_TX_PWR_DEFAULT} -}; - -/* band: 'B/G', region: France */ -static struct chan_freq_power channel_freq_power_FR_BG[] = { - {10, 2457, LBS_TX_PWR_FR_DEFAULT}, - {11, 2462, LBS_TX_PWR_FR_DEFAULT}, - {12, 2467, LBS_TX_PWR_FR_DEFAULT}, - {13, 2472, LBS_TX_PWR_FR_DEFAULT} -}; - -/* band: 'B/G', region: Japan */ -static struct chan_freq_power channel_freq_power_JPN_BG[] = { - {1, 2412, LBS_TX_PWR_JP_DEFAULT}, - {2, 2417, LBS_TX_PWR_JP_DEFAULT}, - {3, 2422, LBS_TX_PWR_JP_DEFAULT}, - {4, 2427, LBS_TX_PWR_JP_DEFAULT}, - {5, 2432, LBS_TX_PWR_JP_DEFAULT}, - {6, 2437, LBS_TX_PWR_JP_DEFAULT}, - {7, 2442, LBS_TX_PWR_JP_DEFAULT}, - {8, 2447, LBS_TX_PWR_JP_DEFAULT}, - {9, 2452, LBS_TX_PWR_JP_DEFAULT}, - {10, 2457, LBS_TX_PWR_JP_DEFAULT}, - {11, 2462, LBS_TX_PWR_JP_DEFAULT}, - {12, 2467, LBS_TX_PWR_JP_DEFAULT}, - {13, 2472, LBS_TX_PWR_JP_DEFAULT}, - {14, 2484, LBS_TX_PWR_JP_DEFAULT} -}; - -/* - * the structure for channel, frequency and power - */ -struct region_cfp_table -{ - u8 region; - struct chan_freq_power *cfp_BG; - int cfp_no_BG; -}; - -/** - * the structure for the mapping between region and CFP - */ -static struct region_cfp_table region_cfp_table[] = -{ - {0x10, /*US FCC */ - channel_freq_power_US_BG, - ARRAY_SIZE(channel_freq_power_US_BG), - } - , - {0x20, /*CANADA IC */ - channel_freq_power_US_BG, - ARRAY_SIZE(channel_freq_power_US_BG), - } - , - {0x30, /*EU*/ channel_freq_power_EU_BG, - ARRAY_SIZE(channel_freq_power_EU_BG), - } - , - {0x31, /*SPAIN*/ channel_freq_power_SPN_BG, - ARRAY_SIZE(channel_freq_power_SPN_BG), - } - , - {0x32, /*FRANCE*/ channel_freq_power_FR_BG, - ARRAY_SIZE(channel_freq_power_FR_BG), - } - , - {0x40, /*JAPAN*/ channel_freq_power_JPN_BG, - ARRAY_SIZE(channel_freq_power_JPN_BG), - } - , -/*Add new region here */ -}; - -/** - * the table to keep region code - */ -u16 lbs_region_code_to_index[MRVDRV_MAX_REGION_CODE] = - { 0x10, 0x20, 0x30, 0x31, 0x32, 0x40 }; - -/** - * 802.11b/g supported bitrates (in 500Kb/s units) - */ -u8 lbs_bg_rates[MAX_RATES] = - { 0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6c, -0x00, 0x00 }; - -/** - * FW rate table. FW refers to rates by their index in this table, not by the - * rate value itself. Values of 0x00 are - * reserved positions. - */ -static u8 fw_data_rates[MAX_RATES] = - { 0x02, 0x04, 0x0B, 0x16, 0x00, 0x0C, 0x12, - 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C, 0x00 -}; - -#if (ANDROID_POWER_SAVE == 1) -extern unsigned long driver_ps_timeout; - -#include -android_suspend_lock_t wifi_android_lock; -#endif - -int wifi_ps_status = 0; - -#if (ANDROID_POWER_SAVE == 1) - -int wifi_real_suspend(int state) -{ - int ret = 0, i; - struct lbs_private *priv = lbs_wifi_priv; - - printk("System want WIFI to suspend.\n"); - - if (priv == NULL) - { - printk("lbs_wifi_priv is NULL.\n"); - return 0; - } - - if (priv->deepsleep == true) - { - printk("Wifi is in deepsleep already.\n"); - return 0; - } - - wifi_ps_status = WIFI_PS_PRE_SLEEP; - - /* - * Block data. - */ - netif_stop_queue(priv->dev); - netif_carrier_off(priv->dev); - - /* - * Block command is done via lbs_queue_command. - */ - - /* - * Waiting for current scan command to be done. - */ - for (i = 0; i < 20; i++) - { - if (priv->scan_channel == 0) - break; - printk("Waiting for scan to be done.\n"); - msleep(500); - } - if (i >= 20) - { - printk("Waiting for scan to be done timeout.\n"); - ret = -1; - goto out; - } - - /* - * Make sure command queue is empty. - */ - for (i = 0; i < 50; i++) - { - if (!list_empty(&priv->cmdpendingq)) - { - printk("Command queue is not empty.\n"); - wake_up_interruptible(&priv->waitq); - } - else - break; - msleep(100); - } - if (i >= 50) - { - printk("Waiting for command queue to empty timeout.\n"); - ret = -1; - goto out; - } - - /* - * Make sure no command is being run. - */ - for (i = 0; i < 50; i++) - { - if (priv->cur_cmd) - { - printk("Command is in process!!!\n"); - msleep(100); - } - else - break; - } - if (i >= 50) - { - printk("Waiting for current command timeout.\n"); - ret = -1; - goto out; - } - - if (priv->surpriseremoved) - { - printk("We are going to be removed.\n"); - ret = -1; - goto out; - } - - ret = lbs_prepare_and_send_command(priv, CMD_802_11_DEEP_SLEEP, 0, 0, 0, NULL); - if (ret) - { - printk("Send DEEP_SLEEP command failed.\n"); - wifi_ps_status = 0; - goto out; - } - wake_up_interruptible(&priv->waitq); //Wake up main thread. - - priv->deepsleep = true; - msleep(800); - - wifi_ps_status = WIFI_PS_DRV_SLEEP; - - android_unlock_suspend(&wifi_android_lock); -out: - netif_carrier_on(priv->dev); - netif_wake_queue(priv->dev); - - return ret; -} -#endif - -/* - * Suspend request from android power manager. - */ -#if (ANDROID_POWER_SAVE == 1) -int wifi_suspend(suspend_state_t state) -{ - struct lbs_private *priv = lbs_wifi_priv; - - if (priv == NULL) - { - printk("WiFi is disabled for now.\n"); - return 0; - } - - if (wifi_ps_status == WIFI_PS_DRV_SLEEP) - { - printk("WiFi is in driver sleep already.\n"); - return 0; - } - else /* This should be never occured. */ - { - printk("ERROR: WiFi is active for now!!!!!!!!!!\n"); - return 1; - } - - return 0; -} -#elif (NEW_MV8686_PS == 1) -int wifi_suspend(suspend_state_t state) -{ - int ret = 0, i; - struct lbs_private *priv = lbs_wifi_priv; - - printk("%s: NEW_MV8686_PS\n", __func__); - - /* - * Since system want to be IDLE, we will make WIFI be - * deep sleep here. --Yongle Lai - */ - - //printk("System want WIFI to suspend.\n"); - - if (priv == NULL) - { - printk("lbs_wifi_priv is NULL.\n"); - return 0; - } - - if (priv->deepsleep == true) - { - printk("Wifi is in deepsleep already.\n"); - return 0; - } - - wifi_ps_status = WIFI_PS_PRE_SLEEP; - - /* - * Block data. - */ - netif_stop_queue(priv->dev); - netif_carrier_off(priv->dev); - - /* - * Block command is done via lbs_queue_command. - */ - - /* - * Waiting for current scan command to be done. - */ - for (i = 0; i < 20; i++) - { - if (priv->scan_channel == 0) - break; - printk("Waiting for scan to be done.\n"); - msleep(500); - } - if (i >= 20) - { - printk("Waiting for scan to be done timeout.\n"); - ret = -1; - goto out; - } - - /* - * Make sure command queue is empty. - */ - for (i = 0; i < 50; i++) - { - if (!list_empty(&priv->cmdpendingq)) - { - printk("Command queue is not empty.\n"); - wake_up_interruptible(&priv->waitq); - } - else - break; - msleep(100); - } - if (i >= 50) - { - printk("Waiting for command queue to empty timeout.\n"); - ret = -1; - goto out; - } - - /* - * Make sure no command is being run. - */ - for (i = 0; i < 50; i++) - { - if (priv->cur_cmd) - { - printk("Command is in process!!!\n"); - msleep(100); - } - else - break; - } - if (i >= 50) - { - printk("Waiting for current command timeout.\n"); - ret = -1; - goto out; - } - - if (priv->surpriseremoved) - { - printk("We are going to be removed.\n"); - ret = -1; - goto out; - } - /* - * Before we go to deep sleep, we should leave PS mode if we are. - */ - priv->psmode = LBS802_11POWERMODECAM; - if (priv->psstate != PS_STATE_FULL_POWER) { - lbs_ps_wakeup(priv, CMD_OPTION_WAITFORRSP); - } - - ret = lbs_cmd_80211_deauthenticate(priv, - priv->curbssparams.bssid, - WLAN_REASON_DEAUTH_LEAVING); - if (ret) - printk("%s: Disconnect fail.\n", __func__); - - ret = lbs_prepare_and_send_command(priv, CMD_802_11_DEEP_SLEEP, 0, 0, 0, NULL); - if (ret) - { - printk("Send DEEP_SLEEP command failed.\n"); - wifi_ps_status = 0; - goto out; - } - wake_up_interruptible(&priv->waitq); //Wake up main thread. - - priv->deepsleep = true; - msleep(800); - - wifi_ps_status = WIFI_PS_DRV_SLEEP; -out: - netif_carrier_on(priv->dev); - netif_wake_queue(priv->dev); - - return ret; -} -#else -int wifi_suspend(suspend_state_t state) -{ - return 0; -} -#endif - -#if (ANDROID_POWER_SAVE == 1) -int wifi_driver_suspend(suspend_state_t state) -{ - int ret; - - if ((wifi_ps_status == WIFI_PS_SYS_SLEEP) || - (wifi_ps_status == WIFI_PS_DRV_SLEEP)) - { - printk("WiFi is in deep sleep already.\n"); - return 0; - } - - ret = wifi_real_suspend(WIFI_PS_DRV_PRE_SLEEP); - if (ret == 0) - { - wifi_ps_status = WIFI_PS_DRV_SLEEP; - } - else - { - wifi_ps_status = WIFI_PS_AWAKE; - } - - return ret; -} -#endif - -#if (NEW_MV8686_PS == 1) -void wifi_resume(void) -{ - union iwreq_data wrqu; - struct lbs_private *priv = lbs_wifi_priv; - - printk("%s: NEW_MV8686_PS\n", __func__); - - if (priv == NULL) - { - printk("lbs_wifi_priv is NULL.\n"); - return; - } - - if (priv->deepsleep == false) - { - printk("Wifi isn't in deepsleep yet.\n"); - return; - } - - if ((wifi_ps_status != WIFI_PS_SYS_SLEEP) && - (wifi_ps_status != WIFI_PS_DRV_SLEEP)) - { - printk("WiFi is not in deep sleep yet.\n"); - return; - } - - wifi_power_save_suspend(); - - memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN); - wrqu.ap_addr.sa_family = ARPHRD_ETHER; - wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); - wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); - - lbs_exit_deep_sleep(priv); - msleep(100); - priv->deepsleep = false; - //msleep(600); - - wifi_ps_status = WIFI_PS_AWAKE; - - netif_carrier_on(priv->dev); - netif_wake_queue(priv->dev); - - wake_up_interruptible(&priv->waitq); //Wake up main thread. - - wifi_power_save_resume(); -} -#else -void wifi_resume(void) -{ - printk("Android want wifi to be resumed.\n"); -} -#endif - -/* - * Wakeup Wifi from deepsleep. - */ -#if (ANDROID_POWER_SAVE == 1) - -void wifi_driver_resume(void) -{ - - struct lbs_private *priv = lbs_wifi_priv; - - printk("System want WIFI to resume.\n"); - - if (priv == NULL) - { - printk("lbs_wifi_priv is NULL.\n"); - return; - } - - if (priv->deepsleep == false) - { - printk("Wifi isn't in deepsleep yet.\n"); - return; - } - - if ((wifi_ps_status != WIFI_PS_SYS_SLEEP) && - (wifi_ps_status != WIFI_PS_DRV_SLEEP)) - { - printk("WiFi is not in deep sleep yet.\n"); - return; - } - - /* - * Update timer. - */ - lbs_update_ps_timer(); - - lbs_exit_deep_sleep(priv); - priv->deepsleep = false; - msleep(600); - - wifi_ps_status = WIFI_PS_AWAKE; - - android_lock_suspend(&wifi_android_lock); - - netif_carrier_on(priv->dev); - netif_wake_queue(priv->dev); - - wake_up_interruptible(&priv->waitq); //Wake up main thread. -} - -void lbs_update_ps_timer(void) -{ - struct lbs_private *priv = lbs_wifi_priv; - - if (priv == NULL) - return; - - if (priv->surpriseremoved) - return; - - if (wifi_ps_status != WIFI_PS_AWAKE) - return; - - if (priv->ps_timer.function == NULL) - return; - - mod_timer(&priv->ps_timer, jiffies + msecs_to_jiffies(driver_ps_timeout)); -} - -void lbs_ps_worker(struct work_struct *work) -{ - struct lbs_private *priv = lbs_wifi_priv; - - printk("lbs_ps_worker\n"); - - if (priv->wifi_ps_work_req == WIFI_PS_PRE_WAKE) - wifi_driver_resume(); - else - wifi_driver_suspend(0); - - priv->wifi_ps_work_req = 0; -} - -static void ps_timer_fn(unsigned long data) -{ - struct lbs_private *priv = (struct lbs_private *)data; - - printk("ps_timer_function.\n"); - - priv->wifi_ps_work_req = WIFI_PS_DRV_PRE_SLEEP; - - queue_delayed_work(priv->work_thread, &priv->ps_work, - msecs_to_jiffies(5)); -} -#endif - -#if (NEW_MV8686_PS == 1) - -static void disconnect_timer_fn(unsigned long data) -{ - struct lbs_private *priv = (struct lbs_private *)data; - - if (priv->surpriseremoved) - return; - - if (priv == NULL) - { - printk("lbs_wifi_priv is NULL.\n"); - return; - } - - /* Here we check the previous association status. */ - if (priv->connect_status == LBS_CONNECTED) - { - priv->need_reassoc = 1; - priv->reassoc_count = 0; - } - else - priv->need_reassoc = 0; -} - -extern int wifi_turnoff_timeout; //from wifi_config.c - -static void turnoff_timer_fn(unsigned long data) -{ - union iwreq_data wrqu; - struct lbs_private *priv = (struct lbs_private *)data; - //static u32 trans_pkts = 0; - - if (priv->surpriseremoved) - return; - - if (priv->connect_status == LBS_CONNECTED) - { - //printk("%s: wifi is LBS_CONNECTED.\n", __func__); - priv->turnoff_idle_count = 0; - } - else - { - //printk("%s: wifi is LBS_DISCONNECTED.\n", __func__); - priv->turnoff_idle_count += 1; - } - - if (priv->turnoff_idle_count > wifi_turnoff_timeout) - { - //printk("%s: Send request to Android for turn-off WiFi.\n", __func__); - memset(wrqu.ap_addr.sa_data, 0xAB, ETH_ALEN); - wrqu.ap_addr.sa_family = ARPHRD_ETHER; - wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); - } - -#if 0 - /* - * Monitor WIFI throughput. - */ - if (trans_pkts > (priv->dev->stats.tx_packets + - priv->dev->stats.rx_packets)) - { - trans_pkts = priv->dev->stats.tx_packets + - priv->dev->stats.rx_packets; - } - else if (trans_pkts < (priv->dev->stats.tx_packets + - priv->dev->stats.rx_packets)) - { - printk("%s: we are serving...\n", __func__); - trans_pkts = priv->dev->stats.tx_packets + - priv->dev->stats.rx_packets; - } - else - { - printk("%s: we are idle...\n", __func__); - } -#endif - - /* - * Even we have ask Android to turn off wifi, - * we keep timer still for send request again. - */ - mod_timer(&priv->turnoff_timer, jiffies + msecs_to_jiffies(10 * 1000)); -} - -/* - * Because we are interrupt context, to make sure all - * functions can be callbacked, we use workqueue to - * call handler. - */ - -void mv8686_ps_real_callback(struct work_struct *work) -{ - struct lbs_private *priv = lbs_wifi_priv; - - if (priv->surpriseremoved) - return; - - if (priv == NULL) - { - printk("lbs_wifi_priv is NULL.\n"); - return; - } - - if (priv->wifi_state == WIFI_NETWORK_IDLE) - { - //printk("%s: we are idle...\n", __func__); - - priv->wifi_state = WIFI_NETWORK_IDLE; - - if (priv->psmode != LBS802_11POWERMODECAM) - return; - - priv->psmode = LBS802_11POWERMODEMAX_PSP; - - if (priv->connect_status == LBS_CONNECTED) { - lbs_ps_sleep(priv, CMD_OPTION_WAITFORRSP); - } - } - else - { - //printk("%s: we are serving...\n", __func__); - - priv->psmode = LBS802_11POWERMODECAM; - if (priv->psstate != PS_STATE_FULL_POWER) { - lbs_ps_wakeup(priv, CMD_OPTION_WAITFORRSP); - } - } -} - -int mv8686_ps_callback(int status) -{ - struct lbs_private *priv = lbs_wifi_priv; - - if (priv->surpriseremoved) - return 0; - - if (priv == NULL) - { - printk("lbs_wifi_priv is NULL.\n"); - return 0; - } - - priv->wifi_state = status; - - schedule_delayed_work(&priv->ps_work, msecs_to_jiffies(2)); - - return 0; -} -#endif - -/** - * @brief use index to get the data rate - * - * @param idx The index of data rate - * @return data rate or 0 - */ -u32 lbs_fw_index_to_data_rate(u8 idx) -{ - if (idx >= sizeof(fw_data_rates)) - idx = 0; - return fw_data_rates[idx]; -} - -/** - * @brief use rate to get the index - * - * @param rate data rate - * @return index or 0 - */ -u8 lbs_data_rate_to_fw_index(u32 rate) -{ - u8 i; - - if (!rate) - return 0; - - for (i = 0; i < sizeof(fw_data_rates); i++) - { - if (rate == fw_data_rates[i]) - return i; - } - return 0; -} - -/** - * @brief This function opens the ethX or mshX interface - * - * @param dev A pointer to net_device structure - * @return 0 or -EBUSY if monitor mode active - */ -static int lbs_dev_open(struct net_device *dev) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - int ret = 0; - - lbs_deb_enter(LBS_DEB_NET); - - spin_lock_irq(&priv->driver_lock); - - if (priv->monitormode) { - ret = -EBUSY; - goto out; - } - - priv->infra_open = 1; - - if (priv->connect_status == LBS_CONNECTED) - netif_carrier_on(dev); - else - netif_carrier_off(dev); - - if (!priv->tx_pending_len) - netif_wake_queue(dev); - out: - - spin_unlock_irq(&priv->driver_lock); - lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret); - - return ret; -} - -/** - * @brief This function closes the ethX interface - * - * @param dev A pointer to net_device structure - * @return 0 - */ -static int lbs_eth_stop(struct net_device *dev) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - - lbs_deb_enter(LBS_DEB_NET); - - spin_lock_irq(&priv->driver_lock); - priv->infra_open = 0; - netif_stop_queue(dev); - spin_unlock_irq(&priv->driver_lock); - - //schedule_work(&priv->mcast_work); - - lbs_deb_leave(LBS_DEB_NET); - return 0; -} - -static void lbs_tx_timeout(struct net_device *dev) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - - lbs_deb_enter(LBS_DEB_TX); - - lbs_pr_err("tx watch dog timeout\n"); - - dev->trans_start = jiffies; - - if (priv->currenttxskb) - lbs_send_tx_feedback(priv, 0); - - /* XX: Shouldn't we also call into the hw-specific driver - to kick it somehow? */ - lbs_host_to_card_done(priv); - - /* More often than not, this actually happens because the - firmware has crapped itself -- rather than just a very - busy medium. So send a harmless command, and if/when - _that_ times out, we'll kick it in the head. */ - lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0, - 0, 0, NULL); - - lbs_deb_leave(LBS_DEB_TX); -} - -void lbs_host_to_card_done(struct lbs_private *priv) -{ - unsigned long flags; - - lbs_deb_enter(LBS_DEB_THREAD); - - spin_lock_irqsave(&priv->driver_lock, flags); - - priv->dnld_sent = DNLD_RES_RECEIVED; - - /* Wake main thread if commands are pending */ - if (!priv->cur_cmd || priv->tx_pending_len > 0) - wake_up_interruptible(&priv->waitq); - - spin_unlock_irqrestore(&priv->driver_lock, flags); - lbs_deb_leave(LBS_DEB_THREAD); -} -EXPORT_SYMBOL_GPL(lbs_host_to_card_done); - -static int lbs_set_mac_address(struct net_device *dev, void *addr) -{ - int ret = 0; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - struct sockaddr *phwaddr = addr; - struct cmd_ds_802_11_mac_address cmd; - - lbs_deb_enter(LBS_DEB_NET); - - /* In case it was called from the mesh device */ - dev = priv->dev; - - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - cmd.action = cpu_to_le16(CMD_ACT_SET); - memcpy(cmd.macadd, phwaddr->sa_data, ETH_ALEN); - - ret = lbs_cmd_with_response(priv, CMD_802_11_MAC_ADDRESS, &cmd); - if (ret) { - printk("set MAC address failed\n"); - goto done; - } - - memcpy(priv->current_addr, phwaddr->sa_data, ETH_ALEN); - memcpy(dev->dev_addr, phwaddr->sa_data, ETH_ALEN); - -done: - lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret); - return ret; -} - - -static inline int mac_in_list(unsigned char *list, int list_len, - unsigned char *mac) -{ - while (list_len) { - if (!memcmp(list, mac, ETH_ALEN)) - return 1; - list += ETH_ALEN; - list_len--; - } - return 0; -} - -int lbs_can_enter_deep_sleep(struct lbs_private *priv) -{ - if (priv->cur_cmd) - { - printk("Current command is running.\n"); - return false; - } - - if (priv->connect_status == LBS_CONNECTED) - { - printk("Media is connected.\n"); - //return false; - } - - //if (priv->resp_len[priv->resp_idx]) - // return false; - - return true; -} - -/** - * @brief This function handles the major jobs in the LBS driver. - * It handles all events generated by firmware, RX data received - * from firmware and TX data sent from kernel. - * - * @param data A pointer to lbs_thread structure - * @return 0 - */ -static int lbs_thread(void *data) -{ - struct net_device *dev = data; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - wait_queue_t wait; - - lbs_deb_enter(LBS_DEB_THREAD); - - init_waitqueue_entry(&wait, current); - -#if (ANDROID_POWER_SAVE == 1) - mod_timer(&priv->ps_timer, jiffies + msecs_to_jiffies(driver_ps_timeout) + 10 * HZ); - - wifi_android_lock.name = "wifidev"; - android_init_suspend_lock(&wifi_android_lock); - - android_lock_suspend(&wifi_android_lock); -#endif - -#if (NEW_MV8686_PS == 1) - mod_timer(&priv->turnoff_timer, jiffies + msecs_to_jiffies(10 * 1000)); -#endif - - for (;;) - { - int shouldsleep; - u8 resp_idx; - - lbs_deb_thread("1: currenttxskb %p, dnld_sent %d\n", - priv->currenttxskb, priv->dnld_sent); - - add_wait_queue(&priv->waitq, &wait); - set_current_state(TASK_INTERRUPTIBLE); - spin_lock_irq(&priv->driver_lock); - - if (kthread_should_stop()) - shouldsleep = 0; /* Bye */ - else if (priv->surpriseremoved) - shouldsleep = 1; /* We need to wait until we're _told_ to die */ - else if (priv->psstate == PS_STATE_SLEEP) - shouldsleep = 1; /* Sleep mode. Nothing we can do till it wakes */ -#if (NEW_MV8686_PS == 1) - else if (priv->deepsleep == true) - shouldsleep = 1; /* Deep Sleep mode. Nothing we can do till it wakes */ -#endif - else if (priv->cmd_timed_out) - shouldsleep = 0; /* Command timed out. Recover */ - else if (!priv->fw_ready) - shouldsleep = 1; /* Firmware not ready. We're waiting for it */ - else if (priv->dnld_sent) - shouldsleep = 1; /* Something is en route to the device already */ - else if (priv->tx_pending_len > 0) - shouldsleep = 0; /* We've a packet to send */ - else if (priv->resp_len[priv->resp_idx]) - shouldsleep = 0; /* We have a command response */ - else if (priv->cur_cmd) - shouldsleep = 1; /* Can't send a command; one already running */ - else if (!list_empty(&priv->cmdpendingq)) - shouldsleep = 0; /* We have a command to send */ - else if (__kfifo_len(priv->event_fifo)) - shouldsleep = 0; /* We have an event to process */ - else - shouldsleep = 1; /* No command */ - - if (shouldsleep) { - lbs_deb_thread("sleeping, connect_status %d, " - "psmode %d, psstate %d\n", - priv->connect_status, - priv->psmode, priv->psstate); - spin_unlock_irq(&priv->driver_lock); - schedule(); - } else - spin_unlock_irq(&priv->driver_lock); - - lbs_deb_thread("2: currenttxskb %p, dnld_send %d\n", - priv->currenttxskb, priv->dnld_sent); - - set_current_state(TASK_RUNNING); - remove_wait_queue(&priv->waitq, &wait); - - lbs_deb_thread("3: currenttxskb %p, dnld_sent %d\n", - priv->currenttxskb, priv->dnld_sent); - - if (kthread_should_stop()) { - lbs_deb_thread("break from main thread\n"); - break; - } - - if (priv->surpriseremoved) { - lbs_deb_thread("adapter removed; waiting to die...\n"); - continue; - } - - lbs_deb_thread("4: currenttxskb %p, dnld_sent %d\n", - priv->currenttxskb, priv->dnld_sent); - - /* Process any pending command response */ - spin_lock_irq(&priv->driver_lock); - resp_idx = priv->resp_idx; - if (priv->resp_len[resp_idx]) { - spin_unlock_irq(&priv->driver_lock); - lbs_process_command_response(priv, - priv->resp_buf[resp_idx], - priv->resp_len[resp_idx]); - spin_lock_irq(&priv->driver_lock); - priv->resp_len[resp_idx] = 0; - } - spin_unlock_irq(&priv->driver_lock); - - /* command timeout stuff */ - if (priv->cmd_timed_out && priv->cur_cmd) { - struct cmd_ctrl_node *cmdnode = priv->cur_cmd; - - if ((++priv->nr_retries > 3) || (priv->surpriseremoved == 1)) - { - lbs_pr_info("Excessive timeouts submitting command 0x%04x\n", - le16_to_cpu(cmdnode->cmdbuf->command)); - lbs_complete_command(priv, cmdnode, -ETIMEDOUT); - priv->nr_retries = 0; - if (priv->reset_card) - priv->reset_card(priv); - } else { - priv->cur_cmd = NULL; - priv->dnld_sent = DNLD_RES_RECEIVED; - lbs_pr_info("requeueing command 0x%04x due " - "to timeout (#%d)\n", - le16_to_cpu(cmdnode->cmdbuf->command), - priv->nr_retries); - - /* Stick it back at the _top_ of the pending queue - for immediate resubmission */ - list_add(&cmdnode->list, &priv->cmdpendingq); - } - } - priv->cmd_timed_out = 0; - - /* Process hardware events, e.g. card removed, link lost */ - spin_lock_irq(&priv->driver_lock); - while (__kfifo_len(priv->event_fifo)) { - u32 event; - - __kfifo_get(priv->event_fifo, (unsigned char *) &event, - sizeof(event)); - spin_unlock_irq(&priv->driver_lock); - lbs_process_event(priv, event); - spin_lock_irq(&priv->driver_lock); - } - spin_unlock_irq(&priv->driver_lock); - - if (!priv->fw_ready) - continue; - - /* Check if we need to confirm Sleep Request received previously */ - if (priv->psstate == PS_STATE_PRE_SLEEP && - !priv->dnld_sent && !priv->cur_cmd) { - if (priv->connect_status == LBS_CONNECTED) { - lbs_deb_thread("pre-sleep, currenttxskb %p, " - "dnld_sent %d, cur_cmd %p\n", - priv->currenttxskb, priv->dnld_sent, - priv->cur_cmd); - - lbs_ps_confirm_sleep(priv); - } else { - /* workaround for firmware sending - * deauth/linkloss event immediately - * after sleep request; remove this - * after firmware fixes it - */ - priv->psstate = PS_STATE_AWAKE; - lbs_pr_alert("ignore PS_SleepConfirm in " - "non-connected state\n"); - } - } - - /* The PS state is changed during processing of Sleep Request - * event above - */ - if ((priv->psstate == PS_STATE_SLEEP) || - (priv->psstate == PS_STATE_PRE_SLEEP)) - continue; - - /* Execute the next command */ - if (!priv->dnld_sent && !priv->cur_cmd) - lbs_execute_next_command(priv); - - /* Wake-up command waiters which can't sleep in - * lbs_prepare_and_send_command - */ - if (!list_empty(&priv->cmdpendingq)) - wake_up_all(&priv->cmd_pending); - - spin_lock_irq(&priv->driver_lock); - if (!priv->dnld_sent && priv->tx_pending_len > 0) { - int ret = priv->hw_host_to_card(priv, MVMS_DAT, - priv->tx_pending_buf, - priv->tx_pending_len); - if (ret) { - lbs_deb_tx("host_to_card failed %d\n", ret); - priv->dnld_sent = DNLD_RES_RECEIVED; - } - priv->tx_pending_len = 0; - if (!priv->currenttxskb) { - /* We can wake the queues immediately if we aren't - waiting for TX feedback */ - if (priv->connect_status == LBS_CONNECTED) - netif_wake_queue(priv->dev); - } - } - spin_unlock_irq(&priv->driver_lock); - } - - del_timer(&priv->command_timer); - wake_up_all(&priv->cmd_pending); - - lbs_deb_leave(LBS_DEB_THREAD); - - return 0; -} - -#if 0 - -static int lbs_suspend_callback(struct lbs_private *priv, unsigned long dummy, - struct cmd_header *cmd) -{ - lbs_deb_enter(LBS_DEB_FW); - - netif_device_detach(priv->dev); - - priv->fw_ready = 0; - lbs_deb_leave(LBS_DEB_FW); - return 0; -} - -int lbs_suspend(struct lbs_private *priv) -{ - struct cmd_header cmd; - int ret; - - lbs_deb_enter(LBS_DEB_FW); - - if (priv->wol_criteria == 0xffffffff) { - lbs_pr_info("Suspend attempt without configuring wake params!\n"); - return -EINVAL; - } - - memset(&cmd, 0, sizeof(cmd)); - - ret = __lbs_cmd(priv, CMD_802_11_HOST_SLEEP_ACTIVATE, &cmd, - sizeof(cmd), lbs_suspend_callback, 0); - if (ret) - lbs_pr_info("HOST_SLEEP_ACTIVATE failed: %d\n", ret); - - lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret); - return ret; -} -EXPORT_SYMBOL_GPL(lbs_suspend); - -void lbs_resume(struct lbs_private *priv) -{ - lbs_deb_enter(LBS_DEB_FW); - - priv->fw_ready = 1; - - /* Firmware doesn't seem to give us RX packets any more - until we send it some command. Might as well update */ - lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0, - 0, 0, NULL); - - netif_device_attach(priv->dev); - - lbs_deb_leave(LBS_DEB_FW); -} -EXPORT_SYMBOL_GPL(lbs_resume); -#endif - -/** - * @brief This function gets the HW spec from the firmware and sets - * some basic parameters. - * - * @param priv A pointer to struct lbs_private structure - * @return 0 or -1 - */ -static int lbs_setup_firmware(struct lbs_private *priv) -{ - int ret = -1; - s16 curlevel = 0, minlevel = 0, maxlevel = 0; - - lbs_deb_enter(LBS_DEB_FW); - - /* Read MAC address from firmware */ - memset(priv->current_addr, 0xff, ETH_ALEN); - ret = lbs_update_hw_spec(priv); - if (ret) - goto done; - - { - struct sockaddr addr; - u8 * mac = (u8 *)(addr.sa_data); - - if (wifi_customized_mac_addr(mac) == 1) - { - lbs_set_mac_address(priv->dev, &addr); - } - } - - /* Read power levels if available */ - ret = lbs_get_tx_power(priv, &curlevel, &minlevel, &maxlevel); - if (ret == 0) { - priv->txpower_cur = curlevel; - priv->txpower_min = minlevel; - priv->txpower_max = maxlevel; - } - - lbs_set_mac_control(priv); - -done: - lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret); - return ret; -} - -/** - * This function handles the timeout of command sending. - * It will re-send the same command again. - */ -static void command_timer_fn(unsigned long data) -{ - struct lbs_private *priv = (struct lbs_private *)data; - unsigned long flags; - - lbs_deb_enter(LBS_DEB_CMD); - spin_lock_irqsave(&priv->driver_lock, flags); - - if (!priv->cur_cmd) - goto out; - - lbs_pr_info("command 0x%04x timed out\n", - le16_to_cpu(priv->cur_cmd->cmdbuf->command)); - - priv->cmd_timed_out = 1; - wake_up_interruptible(&priv->waitq); -out: - spin_unlock_irqrestore(&priv->driver_lock, flags); - lbs_deb_leave(LBS_DEB_CMD); -} - -static void lbs_sync_channel_worker(struct work_struct *work) -{ - struct lbs_private *priv = container_of(work, struct lbs_private, - sync_channel); - - lbs_deb_enter(LBS_DEB_MAIN); - if (lbs_update_channel(priv)) - lbs_pr_info("Channel synchronization failed."); - lbs_deb_leave(LBS_DEB_MAIN); -} - - -static int lbs_init_adapter(struct lbs_private *priv) -{ - size_t bufsize; - int i, ret = 0; - - lbs_deb_enter(LBS_DEB_MAIN); - - /* Allocate buffer to store the BSSID list */ - bufsize = MAX_NETWORK_COUNT * sizeof(struct bss_descriptor); - priv->networks = kzalloc(bufsize, GFP_KERNEL); - if (!priv->networks) { - lbs_pr_err("Out of memory allocating beacons\n"); - ret = -1; - goto out; - } - - /* Initialize scan result lists */ - INIT_LIST_HEAD(&priv->network_free_list); - INIT_LIST_HEAD(&priv->network_list); - for (i = 0; i < MAX_NETWORK_COUNT; i++) { - list_add_tail(&priv->networks[i].list, - &priv->network_free_list); - } - - /* Allocate buffer to store the scan request list */ - bufsize = MAX_SCAN_REQ * sizeof(struct lbs_scan_req); - priv->scan_req = kzalloc(bufsize, GFP_KERNEL); - if (!priv->scan_req) { - lbs_pr_err("Out of memory allocating scan request\n"); - ret = -1; - goto out; - } - - /* Initialize scan result lists */ - INIT_LIST_HEAD(&priv->scan_req_free_list); - INIT_LIST_HEAD(&priv->scan_req_list); - for (i = 0; i < MAX_SCAN_REQ; i++) { - list_add_tail(&priv->scan_req[i].list, - &priv->scan_req_free_list); - } - - memset(priv->current_addr, 0xff, ETH_ALEN); - - priv->connect_status = LBS_DISCONNECTED; - priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; - priv->mode = IW_MODE_AUTO; //IW_MODE_INFRA; -- Yongle Lai - priv->curbssparams.channel = DEFAULT_AD_HOC_CHANNEL; - priv->mac_control = CMD_ACT_MAC_RX_ON | CMD_ACT_MAC_TX_ON; - priv->radio_on = 1; - priv->enablehwauto = 1; - priv->capability = WLAN_CAPABILITY_SHORT_PREAMBLE; - priv->psmode = LBS802_11POWERMODECAM; - priv->psstate = PS_STATE_FULL_POWER; - - mutex_init(&priv->lock); - - setup_timer(&priv->command_timer, command_timer_fn, (unsigned long)priv); - -#if (NEW_MV8686_PS == 1) - setup_timer(&priv->turnoff_timer, turnoff_timer_fn, (unsigned long)priv); - priv->turnoff_idle_count = 0; - wifi_power_save_register_callback(mv8686_ps_callback); - setup_timer(&priv->disconnect_timer, disconnect_timer_fn, (unsigned long)priv); -#endif - -#if (ANDROID_POWER_SAVE == 1) - setup_timer(&priv->ps_timer, ps_timer_fn, (unsigned long)priv); -#endif - - INIT_LIST_HEAD(&priv->cmdfreeq); - INIT_LIST_HEAD(&priv->cmdpendingq); - - spin_lock_init(&priv->driver_lock); - init_waitqueue_head(&priv->cmd_pending); - - /* Allocate the command buffers */ - if (lbs_allocate_cmd_buffer(priv)) - { - lbs_pr_err("Out of memory allocating command buffers\n"); - ret = -ENOMEM; - goto out; - } - priv->resp_idx = 0; - priv->resp_len[0] = priv->resp_len[1] = 0; - - /* Create the event FIFO */ - priv->event_fifo = kfifo_alloc(sizeof(u32) * 16, GFP_KERNEL, NULL); - if (IS_ERR(priv->event_fifo)) - { - lbs_pr_err("Out of memory allocating event FIFO buffer\n"); - ret = -ENOMEM; - goto out; - } - -out: - lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret); - - return ret; -} - -static void lbs_free_adapter(struct lbs_private *priv) -{ - lbs_deb_enter(LBS_DEB_MAIN); - - lbs_free_cmd_buffer(priv); - if (priv->event_fifo) - kfifo_free(priv->event_fifo); - del_timer(&priv->command_timer); - - if (priv->networks) - kfree(priv->networks); - priv->networks = NULL; - - if (priv->scan_req) - kfree(priv->scan_req); - priv->scan_req = NULL; - - lbs_deb_leave(LBS_DEB_MAIN); -} - -#if (MV8686_SUPPORT_MCAST == 1) -static int mv8686_add_mcast_addrs(struct cmd_ds_mac_multicast_adr *cmd, - struct net_device *dev, int nr_addrs) -{ - int i = nr_addrs; - struct dev_mc_list *mc_list; - - if ((dev->flags & (IFF_UP|IFF_MULTICAST)) != (IFF_UP|IFF_MULTICAST)) - return nr_addrs; - - //printk("Warning lock is commeted...........\n"); - //netif_addr_lock_bh(dev); - for (mc_list = dev->mc_list; mc_list; mc_list = mc_list->next) - { - if (mac_in_list(cmd->maclist, nr_addrs, mc_list->dmi_addr)) - { - lbs_deb_net("mcast address %s:%pM skipped\n", dev->name, mc_list->dmi_addr); - continue; - } - if (i == MRVDRV_MAX_MULTICAST_LIST_SIZE) - break; - memcpy(&cmd->maclist[6*i], mc_list->dmi_addr, ETH_ALEN); - lbs_deb_net("mcast address %s:%pM added to filter\n", dev->name, mc_list->dmi_addr); - i++; - } - //netif_addr_unlock_bh(dev); - - if (mc_list) - return -EOVERFLOW; - - return i; -} - -static void mv8686_set_mcast_worker(struct work_struct *work) -{ - struct lbs_private *priv = container_of(work, struct lbs_private, mcast_work); - struct cmd_ds_mac_multicast_adr mcast_cmd; - int dev_flags; int nr_addrs; - int old_mac_control = priv->mac_control; - - lbs_deb_enter(LBS_DEB_NET); - - dev_flags = priv->dev->flags; - - if (dev_flags & IFF_PROMISC) - { - priv->mac_control |= CMD_ACT_MAC_PROMISCUOUS_ENABLE; - priv->mac_control &= ~(CMD_ACT_MAC_ALL_MULTICAST_ENABLE | - CMD_ACT_MAC_MULTICAST_ENABLE); - goto out_set_mac_control; - } - else if (dev_flags & IFF_ALLMULTI) - { -do_allmulti: - priv->mac_control |= CMD_ACT_MAC_ALL_MULTICAST_ENABLE; - priv->mac_control &= ~(CMD_ACT_MAC_PROMISCUOUS_ENABLE | - CMD_ACT_MAC_MULTICAST_ENABLE); - goto out_set_mac_control; - } - - /* Once for priv->dev, again for priv->mesh_dev if it exists */ - nr_addrs = mv8686_add_mcast_addrs(&mcast_cmd, priv->dev, 0); - - if (nr_addrs < 0) - goto do_allmulti; - - if (nr_addrs) - { - int size = offsetof(struct cmd_ds_mac_multicast_adr, maclist[6*nr_addrs]); - mcast_cmd.action = cpu_to_le16(CMD_ACT_SET); - mcast_cmd.hdr.size = cpu_to_le16(size); - mcast_cmd.nr_of_adrs = cpu_to_le16(nr_addrs); - - lbs_cmd_async(priv, CMD_MAC_MULTICAST_ADR, &mcast_cmd.hdr, size); - - priv->mac_control |= CMD_ACT_MAC_MULTICAST_ENABLE; - } else - priv->mac_control &= ~CMD_ACT_MAC_MULTICAST_ENABLE; - - priv->mac_control &= ~(CMD_ACT_MAC_PROMISCUOUS_ENABLE | - CMD_ACT_MAC_ALL_MULTICAST_ENABLE); -out_set_mac_control: - if (priv->mac_control != old_mac_control) - lbs_set_mac_control(priv); - - lbs_deb_leave(LBS_DEB_NET); -} - -static void mv8686_set_multicast_list(struct net_device *dev) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - - schedule_work(&priv->mcast_work); -} -#endif - -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) -static const struct net_device_ops lbs_netdev_ops = { - .ndo_open = lbs_dev_open, - .ndo_stop = lbs_eth_stop, - .ndo_start_xmit = lbs_hard_start_xmit, - .ndo_set_mac_address = lbs_set_mac_address, - .ndo_tx_timeout = lbs_tx_timeout, -#if (MV8686_SUPPORT_MCAST == 1) - .ndo_set_multicast_list = mv8686_set_multicast_list, -#endif - //.ndo_change_mtu = eth_change_mtu, - //.ndo_validate_addr = eth_validate_addr, -}; -#endif - -/** - * @brief This function adds the card. it will probe the - * card, allocate the lbs_priv and initialize the device. - * - * @param card A pointer to card - * @return A pointer to struct lbs_private structure - */ -struct lbs_private *lbs_add_card(void *card, struct device *dmdev) -{ - struct net_device *dev = NULL; - struct lbs_private *priv = NULL; - - lbs_deb_enter(LBS_DEB_MAIN); - - /* Allocate an Ethernet device and register it */ - dev = alloc_etherdev(sizeof(struct lbs_private)); - if (!dev) - { - lbs_pr_err("init ethX device failed\n"); - goto done; - } - priv = netdev_priv(dev); - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - dev->priv = priv; -#else - dev->ml_priv = priv; -#endif - - if (lbs_init_adapter(priv)) - { - lbs_pr_err("failed to initialize adapter structure.\n"); - goto err_init_adapter; - } - - //We don't like the name as ethN for wireless. Yongle Lai - dev_alloc_name(dev, "wlan%d"); - - priv->dev = dev; - priv->card = card; - priv->infra_open = 0; - - /* Setup the OS Interface to our functions */ -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - dev->open = lbs_dev_open; - dev->hard_start_xmit = lbs_hard_start_xmit; - dev->stop = lbs_eth_stop; - dev->set_mac_address = lbs_set_mac_address; - dev->tx_timeout = lbs_tx_timeout; - - //dev->ethtool_ops = &lbs_ethtool_ops; - - //dev->do_ioctl = lbs_do_ioctl; /* Yongle Lai */ - -#if (MV8686_SUPPORT_MCAST == 1) - dev->set_multicast_list = mv8686_set_multicast_list; -#endif - -#else /* LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) */ - dev->netdev_ops = &lbs_netdev_ops; -#endif - - dev->watchdog_timeo = 5 * HZ; - -#ifdef WIRELESS_EXT - dev->wireless_handlers = &lbs_handler_def; -#endif - dev->flags |= IFF_BROADCAST | IFF_MULTICAST; - - SET_NETDEV_DEV(dev, dmdev); - - lbs_deb_thread("Starting main thread...\n"); - init_waitqueue_head(&priv->waitq); - - init_waitqueue_head(&priv->ds_waitq); - priv->ps_supported = true; - -#if (AUTO_REASSOC == 1) - priv->prev_assoc_req = kzalloc(sizeof(struct assoc_request), GFP_KERNEL); - if (priv->prev_assoc_req == NULL) - { - printk("Alloc for prev_assoc_req failed.\n"); - } -#endif - - priv->main_thread = kthread_run(lbs_thread, dev, "lbs_main"); - if (IS_ERR(priv->main_thread)) - { - lbs_deb_thread("Error creating main thread.\n"); - goto err_init_adapter; - } - - priv->work_thread = create_singlethread_workqueue("lbs_worker"); - INIT_DELAYED_WORK(&priv->assoc_work, lbs_association_worker); - INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker); -#if (NEW_MV8686_PS == 1) - INIT_DELAYED_WORK(&priv->ps_work, mv8686_ps_real_callback); -#endif - -#if (ANDROID_POWER_SAVE == 1) - INIT_DELAYED_WORK(&priv->ps_work, lbs_ps_worker); -#endif - -#if (MV8686_SUPPORT_MCAST == 1) - INIT_WORK(&priv->mcast_work, mv8686_set_mcast_worker); -#endif - INIT_WORK(&priv->sync_channel, lbs_sync_channel_worker); - - priv->wol_criteria = 0xffffffff; - priv->wol_gpio = 0xff; - - lbs_wifi_priv = priv; - - goto done; - -err_init_adapter: - lbs_free_adapter(priv); - free_netdev(dev); - priv = NULL; - -done: - lbs_deb_leave_args(LBS_DEB_MAIN, "priv %p", priv); - return priv; -} -EXPORT_SYMBOL_GPL(lbs_add_card); - -extern int lbs_exit_deep_sleep(struct lbs_private * priv); - -void lbs_remove_card(struct lbs_private *priv) -{ - struct net_device *dev = priv->dev; -#if (NEW_MV8686_PS == 0) - union iwreq_data wrqu; -#endif - - printk("Before lbs_remove_card.\n"); - - lbs_deb_enter(LBS_DEB_MAIN); - - lbs_wifi_priv = NULL; - - dev = priv->dev; - - cancel_delayed_work_sync(&priv->scan_work); - cancel_delayed_work_sync(&priv->assoc_work); - //cancel_work_sync(&priv->mcast_work); -#if (ANDROID_POWER_SAVE == 1) - cancel_delayed_work_sync(&priv->ps_work); -#endif - - /* worker thread destruction blocks on the in-flight command which - * should have been cleared already in lbs_stop_card(). - */ - lbs_deb_main("destroying worker thread\n"); - - //if (priv->work_thread == NULL) - // printk("You want to destroy NULL workqueue.\n"); - - if (priv->work_thread != NULL) - destroy_workqueue(priv->work_thread); - - lbs_deb_main("done destroying worker thread\n"); - - if (priv->psmode == LBS802_11POWERMODEMAX_PSP) - { - priv->psmode = LBS802_11POWERMODECAM; - lbs_ps_wakeup(priv, CMD_OPTION_WAITFORRSP); - } - - /* - * In Android, all 0xaa as AP BSSID should be considered - * as DRIVER_HUNG, it will restart WIFI. - * - * Since we are turn-off WiFi, so this event shouldn't be sent. - */ -#if (NEW_MV8686_PS == 0) - memset(wrqu.ap_addr.sa_data, 0xaa, ETH_ALEN); - wrqu.ap_addr.sa_family = ARPHRD_ETHER; - wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); -#endif - - /* Stop the thread servicing the interrupts */ - priv->surpriseremoved = 1; - kthread_stop(priv->main_thread); - - lbs_free_adapter(priv); - - priv->dev = NULL; - -#if (AUTO_REASSOC == 1) - if (priv->prev_assoc_req) - kfree(priv->prev_assoc_req); -#endif - - free_netdev(dev); - - lbs_deb_leave(LBS_DEB_MAIN); -} -EXPORT_SYMBOL_GPL(lbs_remove_card); - -int lbs_start_card(struct lbs_private *priv) -{ - struct net_device *dev = priv->dev; - int ret = -1; - - lbs_deb_enter(LBS_DEB_MAIN); - - /* poke the firmware */ - ret = lbs_setup_firmware(priv); - if (ret) - goto done; - - /* init 802.11d */ - lbs_init_11d(priv); - -//#if (NEW_MV8686_PS == 1) -#if 0 - /* - * Kick off a scan to speed up AP list is showing. - */ - queue_delayed_work(priv->work_thread, &priv->scan_work, msecs_to_jiffies(1)); -#endif - - if (register_netdev(dev)) { - lbs_pr_err("cannot register ethX device\n"); - goto done; - } - - lbs_update_channel(priv); - - lbs_pr_info("%s: Marvell WLAN 802.11 adapter\n", dev->name); - - ret = 0; - -done: - lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret); - return ret; -} -EXPORT_SYMBOL_GPL(lbs_start_card); - -void lbs_stop_card(struct lbs_private *priv) -{ - struct net_device *dev; - struct cmd_ctrl_node *cmdnode; - unsigned long flags; - - lbs_deb_enter(LBS_DEB_MAIN); - - printk("Before lbs_stop_card.\n"); - - if (!priv) - goto out; - dev = priv->dev; - - netif_stop_queue(dev); - //netif_carrier_off(dev); - -#if (NEW_MV8686_PS == 1) - del_timer_sync(&priv->turnoff_timer); - del_timer_sync(&priv->disconnect_timer); -#endif - -#if (ANDROID_POWER_SAVE == 1) - del_timer_sync(&priv->ps_timer); - - cancel_delayed_work_sync(&priv->ps_work); - - android_unlock_suspend(&wifi_android_lock); - android_uninit_suspend_lock(&wifi_android_lock); -#endif - -#if (MV8686_SUPPORT_MCAST == 1) - cancel_work_sync(&priv->mcast_work); -#endif - - /* Delete the timeout of the currently processing command */ - del_timer_sync(&priv->command_timer); - - /* Flush pending command nodes */ - spin_lock_irqsave(&priv->driver_lock, flags); - lbs_deb_main("clearing pending commands\n"); - - list_for_each_entry(cmdnode, &priv->cmdpendingq, list) - { - cmdnode->result = -ENOENT; - cmdnode->cmdwaitqwoken = 1; - wake_up_interruptible(&cmdnode->cmdwait_q); - } - - /* Flush the command the card is currently processing */ - if (priv->cur_cmd) - { - printk("Current command is being processed.\n"); - lbs_deb_main("clearing current command\n"); - priv->cur_cmd->result = -ENOENT; - priv->cur_cmd->cmdwaitqwoken = 1; - wake_up_interruptible(&priv->cur_cmd->cmdwait_q); - } - lbs_deb_main("done clearing commands\n"); - spin_unlock_irqrestore(&priv->driver_lock, flags); - - unregister_netdev(dev); - -out: - lbs_deb_leave(LBS_DEB_MAIN); -} -EXPORT_SYMBOL_GPL(lbs_stop_card); - -/** - * @brief This function finds the CFP in - * region_cfp_table based on region and band parameter. - * - * @param region The region code - * @param band The band - * @param cfp_no A pointer to CFP number - * @return A pointer to CFP - */ -struct chan_freq_power *lbs_get_region_cfp_table(u8 region, int *cfp_no) -{ - int i, end; - - lbs_deb_enter(LBS_DEB_MAIN); - - end = ARRAY_SIZE(region_cfp_table); - - for (i = 0; i < end ; i++) { - lbs_deb_main("region_cfp_table[i].region=%d\n", - region_cfp_table[i].region); - if (region_cfp_table[i].region == region) { - *cfp_no = region_cfp_table[i].cfp_no_BG; - lbs_deb_leave(LBS_DEB_MAIN); - return region_cfp_table[i].cfp_BG; - } - } - - lbs_deb_leave_args(LBS_DEB_MAIN, "ret NULL"); - return NULL; -} - -int lbs_set_regiontable(struct lbs_private *priv, u8 region, u8 band) -{ - int ret = 0; - int i = 0; - - struct chan_freq_power *cfp; - int cfp_no; - - lbs_deb_enter(LBS_DEB_MAIN); - - memset(priv->region_channel, 0, sizeof(priv->region_channel)); - - cfp = lbs_get_region_cfp_table(region, &cfp_no); - if (cfp != NULL) { - priv->region_channel[i].nrcfp = cfp_no; - priv->region_channel[i].CFP = cfp; - } else { - lbs_deb_main("wrong region code %#x in band B/G\n", - region); - ret = -1; - goto out; - } - priv->region_channel[i].valid = 1; - priv->region_channel[i].region = region; - priv->region_channel[i].band = band; - i++; -out: - lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret); - return ret; -} - -void lbs_queue_event(struct lbs_private *priv, u32 event) -{ - unsigned long flags; - - lbs_deb_enter(LBS_DEB_THREAD); - spin_lock_irqsave(&priv->driver_lock, flags); - - if (priv->psstate == PS_STATE_SLEEP) - priv->psstate = PS_STATE_AWAKE; - - __kfifo_put(priv->event_fifo, (unsigned char *) &event, sizeof(u32)); - - wake_up_interruptible(&priv->waitq); - - spin_unlock_irqrestore(&priv->driver_lock, flags); - lbs_deb_leave(LBS_DEB_THREAD); -} -EXPORT_SYMBOL_GPL(lbs_queue_event); - -void lbs_notify_command_response(struct lbs_private *priv, u8 resp_idx) -{ - lbs_deb_enter(LBS_DEB_THREAD); - - if (priv->psstate == PS_STATE_SLEEP) - priv->psstate = PS_STATE_AWAKE; - - /* Swap buffers by flipping the response index */ - BUG_ON(resp_idx > 1); - priv->resp_idx = resp_idx; - - wake_up_interruptible(&priv->waitq); - - lbs_deb_leave(LBS_DEB_THREAD); -} -EXPORT_SYMBOL_GPL(lbs_notify_command_response); - -//static int __init lbs_init_module(void) -int mv8686_main_init(void) -{ - lbs_deb_enter(LBS_DEB_MAIN); - memset(&confirm_sleep, 0, sizeof(confirm_sleep)); - confirm_sleep.hdr.command = cpu_to_le16(CMD_802_11_PS_MODE); - confirm_sleep.hdr.size = cpu_to_le16(sizeof(confirm_sleep)); - confirm_sleep.action = cpu_to_le16(CMD_SUBCMD_SLEEP_CONFIRMED); - - atomic_set(&reassoc_flag, 0); - - lbs_deb_leave(LBS_DEB_MAIN); - return 0; -} - -//static void __exit lbs_exit_module(void) -void mv8686_main_exit(void) -{ - lbs_deb_enter(LBS_DEB_MAIN); - - atomic_set(&reassoc_flag, 0); - - lbs_deb_leave(LBS_DEB_MAIN); -} - -//module_init(lbs_init_module); -//module_exit(lbs_exit_module); - -MODULE_DESCRIPTION("Libertas WLAN Driver Library"); -MODULE_AUTHOR("Marvell International Ltd."); -MODULE_LICENSE("GPL"); - diff --git a/drivers/net/wireless/mv8686/mkclean.sh b/drivers/net/wireless/mv8686/mkclean.sh deleted file mode 100755 index 87b6d1aab1e4..000000000000 --- a/drivers/net/wireless/mv8686/mkclean.sh +++ /dev/null @@ -1,10 +0,0 @@ - - -rm -f *.o -rm -f ../wifi_power/*.o -rm -f ../wifi_power/.*.cmd -rm -f *.uu -rm -f mv8686/* -rm -f .*.cmd -rm -f modules.order -rm -rf mv8686 diff --git a/drivers/net/wireless/mv8686/mkpkg.sh b/drivers/net/wireless/mv8686/mkpkg.sh deleted file mode 100755 index d2f11041a838..000000000000 --- a/drivers/net/wireless/mv8686/mkpkg.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -echo "Begin to make MV8686 wifi driver package ..." - -mkdir -p mv8686 -rm -f mv8686/* - -cp ReleaseNotes.txt mv8686/ -cp Makefile.mv8686 mv8686/Makefile -cp ../wifi_power/wifi_power.h mv8686/ -cp ../wifi_power/wifi_power.c mv8686/ -cp ../wifi_power/wifi_config.c mv8686/ -uuencode mv8686.o mv8686.o > mv8686.uu -cp mv8686.uu mv8686/ - -echo "Done" - diff --git a/drivers/net/wireless/mv8686/mv8686_cis.c b/drivers/net/wireless/mv8686/mv8686_cis.c deleted file mode 100755 index 8d30b847fdaf..000000000000 --- a/drivers/net/wireless/mv8686/mv8686_cis.c +++ /dev/null @@ -1,188 +0,0 @@ -#include - -#include -#include -#include -#include - -/* - * common CIS. - */ -unsigned char mv8686_cis_vers1[32] = //0x15 -{0x01, 0x00, 0x4d, 0x61, 0x72, 0x76, 0x65, 0x6c, 0x6c, 0x00, 0x38, 0x30, 0x32, - 0x2e, 0x31, 0x31, 0x20, 0x53, 0x44, 0x49, 0x4f, 0x20, 0x49, 0x44, 0x3a, 0x20, - 0x30, 0x42, 0x00, 0x00, 0xff -}; -unsigned char mv8686_cis_manfid[4] = {0xdf, 0x02, 0x03, 0x91}; //0x20 -unsigned char mv8686_cis_funcid[4] = {0x0c, 0x00}; //0x21 -unsigned char mv8686_cis_funce[4] = {0x00, 0x00, 0x01, 0x32}; //0x22 - -/* - * Function CIS. - */ -unsigned char mv8686_fcis_funcid[4] = {0x0c, 0x00}; //0x21 -unsigned char mv8686_fcis_funce[28] = //0x22 -{0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -static int mv8686_cistpl_vers_1(struct mmc_card *card, struct sdio_func *func, - const unsigned char *buf, unsigned size) -{ - unsigned i, nr_strings; - char **buffer, *string; - - buf += 2; - size -= 2; - -/* - printk("CIS VERS 1: "); - for (i = 0; i < size; i++) - printk("%2.2x ", buf[i]); - printk("\n"); -*/ - - nr_strings = 0; - for (i = 0; i < size; i++) - { - if (buf[i] == 0xff) - break; - - if (buf[i] == 0) - nr_strings++; - } - - if (buf[i-1] != '\0') - { - printk(KERN_WARNING "SDIO: ignoring broken CISTPL_VERS_1\n"); - return 0; - } - - size = i; - - buffer = kzalloc(sizeof(char*) * nr_strings + size, GFP_KERNEL); - if (!buffer) - return -ENOMEM; - - string = (char*)(buffer + nr_strings); - - for (i = 0; i < nr_strings; i++) - { - buffer[i] = string; - strcpy(string, buf); - string += strlen(string) + 1; - buf += strlen(buf) + 1; - } - - if (func) - { - func->num_info = nr_strings; - func->info = (const char**)buffer; - } else { - card->num_info = nr_strings; - card->info = (const char**)buffer; - } - - return 0; -} - -static int mv8686_cistpl_manfid(struct mmc_card *card, struct sdio_func *func, - const unsigned char *buf, unsigned size) -{ - unsigned int vendor, device; - - /* TPLMID_MANF */ - vendor = buf[0] | (buf[1] << 8); - - /* TPLMID_CARD */ - device = buf[2] | (buf[3] << 8); - - if (func) { - func->vendor = vendor; - func->device = device; - } else { - card->cis.vendor = vendor; - card->cis.device = device; - } - - return 0; -} - -static const unsigned char mv8686_speed_val[16] = - { 0, 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80 }; -static const unsigned int mv8686_speed_unit[8] = - { 10000, 100000, 1000000, 10000000, 0, 0, 0, 0 }; - -static int mv8686_cistpl_funce_common(struct mmc_card *card, - const unsigned char *buf, unsigned size) -{ - if (size < 0x04 || buf[0] != 0) - return -EINVAL; - - /* TPLFE_FN0_BLK_SIZE */ - card->cis.blksize = buf[1] | (buf[2] << 8); - - /* TPLFE_MAX_TRAN_SPEED */ - card->cis.max_dtr = mv8686_speed_val[(buf[3] >> 3) & 15] * - mv8686_speed_unit[buf[3] & 7]; - - return 0; -} - -static int mv8686_cistpl_funce_func(struct sdio_func *func, - const unsigned char *buf, unsigned size) -{ - unsigned vsn; - unsigned min_size; - - vsn = func->card->cccr.sdio_vsn; - min_size = (vsn == SDIO_SDIO_REV_1_00) ? 28 : 42; - - if (size < min_size || buf[0] != 1) - return -EINVAL; - - /* TPLFE_MAX_BLK_SIZE */ - func->max_blksize = buf[12] | (buf[13] << 8); - - return 0; -} - -static int mv8686_cistpl_funce(struct mmc_card *card, struct sdio_func *func, - const unsigned char *buf, unsigned size) -{ - int ret; - - /* - * There should be two versions of the CISTPL_FUNCE tuple, - * one for the common CIS (function 0) and a version used by - * the individual function's CIS (1-7). Yet, the later has a - * different length depending on the SDIO spec version. - */ - if (func) - ret = mv8686_cistpl_funce_func(func, buf, size); - else - ret = mv8686_cistpl_funce_common(card, buf, size); - - if (ret) { - printk(KERN_ERR "%s: bad CISTPL_FUNCE size %u " - "type %u\n", mmc_hostname(card->host), size, buf[0]); - return ret; - } - - return 0; -} - -int mv8686_read_common_cis(struct mmc_card *card) -{ - mv8686_cistpl_vers_1(card, NULL, mv8686_cis_vers1, 31); - mv8686_cistpl_manfid(card, NULL, mv8686_cis_manfid, 4); - mv8686_cistpl_funce(card, NULL, mv8686_cis_funce, 4); - - return 0; -} - -int mv8686_read_func_cis(struct sdio_func *func) -{ - mv8686_cistpl_funce(func->card, func, mv8686_fcis_funce, 28); - - return 0; -} diff --git a/drivers/net/wireless/mv8686/radiotap.h b/drivers/net/wireless/mv8686/radiotap.h deleted file mode 100755 index 9b70d6fc3e01..000000000000 --- a/drivers/net/wireless/mv8686/radiotap.h +++ /dev/null @@ -1,46 +0,0 @@ -#include - -#define IEEE80211_RADIOTAP_F_BADFCS 0x40 /* bad FCS */ - -struct tx_radiotap_hdr { - struct ieee80211_radiotap_header hdr; - u8 rate; - u8 txpower; - u8 rts_retries; - u8 data_retries; -} __attribute__ ((packed)); - -#define TX_RADIOTAP_PRESENT ( \ - (1 << IEEE80211_RADIOTAP_RATE) | \ - (1 << IEEE80211_RADIOTAP_DBM_TX_POWER) | \ - (1 << IEEE80211_RADIOTAP_RTS_RETRIES) | \ - (1 << IEEE80211_RADIOTAP_DATA_RETRIES) | \ - 0) - -#define IEEE80211_FC_VERSION_MASK 0x0003 -#define IEEE80211_FC_TYPE_MASK 0x000c -#define IEEE80211_FC_TYPE_MGT 0x0000 -#define IEEE80211_FC_TYPE_CTL 0x0004 -#define IEEE80211_FC_TYPE_DATA 0x0008 -#define IEEE80211_FC_SUBTYPE_MASK 0x00f0 -#define IEEE80211_FC_TOFROMDS_MASK 0x0300 -#define IEEE80211_FC_TODS_MASK 0x0100 -#define IEEE80211_FC_FROMDS_MASK 0x0200 -#define IEEE80211_FC_NODS 0x0000 -#define IEEE80211_FC_TODS 0x0100 -#define IEEE80211_FC_FROMDS 0x0200 -#define IEEE80211_FC_DSTODS 0x0300 - -struct rx_radiotap_hdr { - struct ieee80211_radiotap_header hdr; - u8 flags; - u8 rate; - u8 antsignal; -} __attribute__ ((packed)); - -#define RX_RADIOTAP_PRESENT ( \ - (1 << IEEE80211_RADIOTAP_FLAGS) | \ - (1 << IEEE80211_RADIOTAP_RATE) | \ - (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) |\ - 0) - diff --git a/drivers/net/wireless/mv8686/rx.c b/drivers/net/wireless/mv8686/rx.c deleted file mode 100755 index 372ec83b429e..000000000000 --- a/drivers/net/wireless/mv8686/rx.c +++ /dev/null @@ -1,470 +0,0 @@ -/** - * This file contains the handling of RX in wlan driver. - */ -#include -#include - -#include "hostcmd.h" -#include "radiotap.h" -#include "decl.h" -#include "dev.h" -#include "wext.h" - -struct eth803hdr { - u8 dest_addr[6]; - u8 src_addr[6]; - u16 h803_len; -} __attribute__ ((packed)); - -struct rfc1042hdr { - u8 llc_dsap; - u8 llc_ssap; - u8 llc_ctrl; - u8 snap_oui[3]; - u16 snap_type; -} __attribute__ ((packed)); - -struct rxpackethdr { - struct rxpd rx_pd; - struct eth803hdr eth803_hdr; - struct rfc1042hdr rfc1042_hdr; -} __attribute__ ((packed)); - -struct rx80211packethdr { - struct rxpd rx_pd; - void *eth80211_hdr; -} __attribute__ ((packed)); - -static int process_rxed_802_11_packet(struct lbs_private *priv, - struct sk_buff *skb); - -/** - * @brief This function computes the avgSNR . - * - * @param priv A pointer to struct lbs_private structure - * @return avgSNR - */ -static u8 lbs_getavgsnr(struct lbs_private *priv) -{ - u8 i; - u16 temp = 0; - if (priv->numSNRNF == 0) - return 0; - for (i = 0; i < priv->numSNRNF; i++) - temp += priv->rawSNR[i]; - return (u8) (temp / priv->numSNRNF); - -} - -/** - * @brief This function computes the AvgNF - * - * @param priv A pointer to struct lbs_private structure - * @return AvgNF - */ -static u8 lbs_getavgnf(struct lbs_private *priv) -{ - u8 i; - u16 temp = 0; - if (priv->numSNRNF == 0) - return 0; - for (i = 0; i < priv->numSNRNF; i++) - temp += priv->rawNF[i]; - return (u8) (temp / priv->numSNRNF); - -} - -/** - * @brief This function save the raw SNR/NF to our internel buffer - * - * @param priv A pointer to struct lbs_private structure - * @param prxpd A pointer to rxpd structure of received packet - * @return n/a - */ -static void lbs_save_rawSNRNF(struct lbs_private *priv, struct rxpd *p_rx_pd) -{ - if (priv->numSNRNF < DEFAULT_DATA_AVG_FACTOR) - priv->numSNRNF++; - priv->rawSNR[priv->nextSNRNF] = p_rx_pd->snr; - priv->rawNF[priv->nextSNRNF] = p_rx_pd->nf; - priv->nextSNRNF++; - if (priv->nextSNRNF >= DEFAULT_DATA_AVG_FACTOR) - priv->nextSNRNF = 0; - return; -} - -/** - * @brief This function computes the RSSI in received packet. - * - * @param priv A pointer to struct lbs_private structure - * @param prxpd A pointer to rxpd structure of received packet - * @return n/a - */ -static void lbs_compute_rssi(struct lbs_private *priv, struct rxpd *p_rx_pd) -{ - - lbs_deb_enter(LBS_DEB_RX); - - lbs_deb_rx("rxpd: SNR %d, NF %d\n", p_rx_pd->snr, p_rx_pd->nf); - lbs_deb_rx("before computing SNR: SNR-avg = %d, NF-avg = %d\n", - priv->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE, - priv->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE); - - priv->SNR[TYPE_RXPD][TYPE_NOAVG] = p_rx_pd->snr; - priv->NF[TYPE_RXPD][TYPE_NOAVG] = p_rx_pd->nf; - lbs_save_rawSNRNF(priv, p_rx_pd); - - priv->SNR[TYPE_RXPD][TYPE_AVG] = lbs_getavgsnr(priv) * AVG_SCALE; - priv->NF[TYPE_RXPD][TYPE_AVG] = lbs_getavgnf(priv) * AVG_SCALE; - lbs_deb_rx("after computing SNR: SNR-avg = %d, NF-avg = %d\n", - priv->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE, - priv->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE); - - priv->RSSI[TYPE_RXPD][TYPE_NOAVG] = - CAL_RSSI(priv->SNR[TYPE_RXPD][TYPE_NOAVG], - priv->NF[TYPE_RXPD][TYPE_NOAVG]); - - priv->RSSI[TYPE_RXPD][TYPE_AVG] = - CAL_RSSI(priv->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE, - priv->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE); - - lbs_deb_leave(LBS_DEB_RX); -} - -//#define RX_PKT_SIZE_SUMM - -#ifdef RX_PKT_SIZE_SUMM -struct rxpkt_summ -{ - int init_flag; - u32 less_64; - u32 less_128; - u32 less_256; - u32 less_512; - u32 less_1024; - u32 less_1512; - u32 large_1512; -}; - -struct rxpkt_summ rxsumm = {-1, 0, 0, 0, 0, 0, 0, 0}; - -#endif - -/** - * @brief This function processes received packet and forwards it - * to kernel/upper layer - * - * @param priv A pointer to struct lbs_private - * @param skb A pointer to skb which includes the received packet - * @return 0 or -1 - */ -#if (NEW_MV8686_PS == 1) -extern unsigned long wifi_iprx_packets; -#endif - -int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) -{ - int ret = 0; - struct net_device *dev = priv->dev; - struct rxpackethdr *p_rx_pkt; - struct rxpd *p_rx_pd; - int hdrchop; - struct ethhdr *p_ethhdr; - const u8 rfc1042_eth_hdr[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; - - lbs_deb_enter(LBS_DEB_RX); - - BUG_ON(!skb); - - skb->ip_summed = CHECKSUM_NONE; - - if (priv->monitormode) - return process_rxed_802_11_packet(priv, skb); - - p_rx_pkt = (struct rxpackethdr *) skb->data; - p_rx_pd = &p_rx_pkt->rx_pd; - - lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data, - min_t(unsigned int, skb->len, 100)); - - if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) { - lbs_deb_rx("rx err: frame received with bad length\n"); - dev->stats.rx_length_errors++; - ret = 0; - dev_kfree_skb(skb); - goto done; - } - - /* - * Check rxpd status and update 802.3 stat, - */ - if (!(p_rx_pd->status & cpu_to_le16(MRVDRV_RXPD_STATUS_OK))) { - lbs_deb_rx("rx err: frame received with bad status\n"); - lbs_pr_alert("rxpd not ok\n"); - dev->stats.rx_errors++; - ret = 0; - dev_kfree_skb(skb); - goto done; - } - - lbs_deb_rx("rx data: skb->len-sizeof(RxPd) = %d-%zd = %zd\n", - skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd)); - - lbs_deb_hex(LBS_DEB_RX, "RX Data: Dest", p_rx_pkt->eth803_hdr.dest_addr, - sizeof(p_rx_pkt->eth803_hdr.dest_addr)); - lbs_deb_hex(LBS_DEB_RX, "RX Data: Src", p_rx_pkt->eth803_hdr.src_addr, - sizeof(p_rx_pkt->eth803_hdr.src_addr)); - - if (memcmp(&p_rx_pkt->rfc1042_hdr, - rfc1042_eth_hdr, sizeof(rfc1042_eth_hdr)) == 0) { - /* - * Replace the 803 header and rfc1042 header (llc/snap) with an - * EthernetII header, keep the src/dst and snap_type (ethertype) - * - * The firmware only passes up SNAP frames converting - * all RX Data from 802.11 to 802.2/LLC/SNAP frames. - * - * To create the Ethernet II, just move the src, dst address right - * before the snap_type. - */ - p_ethhdr = (struct ethhdr *) - ((u8 *) & p_rx_pkt->eth803_hdr - + sizeof(p_rx_pkt->eth803_hdr) + sizeof(p_rx_pkt->rfc1042_hdr) - - sizeof(p_rx_pkt->eth803_hdr.dest_addr) - - sizeof(p_rx_pkt->eth803_hdr.src_addr) - - sizeof(p_rx_pkt->rfc1042_hdr.snap_type)); - - memcpy(p_ethhdr->h_source, p_rx_pkt->eth803_hdr.src_addr, - sizeof(p_ethhdr->h_source)); - memcpy(p_ethhdr->h_dest, p_rx_pkt->eth803_hdr.dest_addr, - sizeof(p_ethhdr->h_dest)); - - /* Chop off the rxpd + the excess memory from the 802.2/llc/snap header - * that was removed - */ - hdrchop = (u8 *) p_ethhdr - (u8 *) p_rx_pkt; - } else { - lbs_deb_hex(LBS_DEB_RX, "RX Data: LLC/SNAP", - (u8 *) & p_rx_pkt->rfc1042_hdr, - sizeof(p_rx_pkt->rfc1042_hdr)); - - /* Chop off the rxpd */ - hdrchop = (u8 *) & p_rx_pkt->eth803_hdr - (u8 *) p_rx_pkt; - } - - /* Chop off the leading header bytes so the skb points to the start of - * either the reconstructed EthII frame or the 802.2/llc/snap frame - */ - skb_pull(skb, hdrchop); - - /* Take the data rate from the rxpd structure - * only if the rate is auto - */ - if (priv->enablehwauto) - priv->cur_rate = lbs_fw_index_to_data_rate(p_rx_pd->rx_rate); - - lbs_compute_rssi(priv, p_rx_pd); - - lbs_deb_rx("rx data: size of actual packet %d\n", skb->len); - dev->stats.rx_bytes += skb->len; - dev->stats.rx_packets++; - -#ifdef RX_PKT_SIZE_SUMM - if (rxsumm.init_flag == -1) - { - memset(&rxsumm, 0, sizeof(rxsumm)); - } - if (skb->len <= 64) - rxsumm.less_64++; - else if (skb->len <= 128) - rxsumm.less_128++; - else if (skb->len <= 256) - rxsumm.less_256++; - else if (skb->len <= 512) - rxsumm.less_512++; - else if (skb->len <= 1024) - rxsumm.less_1024++; - else if (skb->len <= 1512) - rxsumm.less_1512++; - else - rxsumm.large_1512++; - rxsumm.init_flag++; - - if ((rxsumm.init_flag > 0) && (rxsumm.init_flag % 200 == 0)) - { - printk("Total (%s) data request: %u\n", "WIFI-RX", rxsumm.init_flag); - printk(" <=64 : %7u %2d%%\n", rxsumm.less_64, - (rxsumm.less_64 * 100) / rxsumm.init_flag); - printk(" <=128 : %7u %2d%%\n", rxsumm.less_128, - (rxsumm.less_128 * 100) / rxsumm.init_flag); - printk(" <=256 : %7u %2d%%\n", rxsumm.less_256, - (rxsumm.less_256 * 100) / rxsumm.init_flag); - printk(" <=512 : %7u %2d%%\n", rxsumm.less_512, - (rxsumm.less_512 * 100) / rxsumm.init_flag); - printk(" <=1024 : %7u %2d%%\n", rxsumm.less_1024, - (rxsumm.less_1024 * 100) / rxsumm.init_flag); - printk(" <=1512 : %7u %2d%%\n", rxsumm.less_1512, - (rxsumm.less_1512 * 100) / rxsumm.init_flag); - printk(" >1512 : %7u %2d%%\n", rxsumm.large_1512, - (rxsumm.large_1512 * 100) / rxsumm.init_flag); - } -#endif - - skb->protocol = eth_type_trans(skb, dev); - -#if (NEW_MV8686_PS == 1) - if (skb->protocol == 0x0008) //ETH_P_IP - wifi_iprx_packets++; - //else - // printk("Got a not IP packet: %x\n", skb->protocol); -#endif - - if (in_interrupt()) - netif_rx(skb); - else - netif_rx_ni(skb); - - ret = 0; -done: - lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret); - return ret; -} -EXPORT_SYMBOL_GPL(lbs_process_rxed_packet); - -/** - * @brief This function converts Tx/Rx rates from the Marvell WLAN format - * (see Table 2 in Section 3.1) to IEEE80211_RADIOTAP_RATE units (500 Kb/s) - * - * @param rate Input rate - * @return Output Rate (0 if invalid) - */ -static u8 convert_mv_rate_to_radiotap(u8 rate) -{ - switch (rate) { - case 0: /* 1 Mbps */ - return 2; - case 1: /* 2 Mbps */ - return 4; - case 2: /* 5.5 Mbps */ - return 11; - case 3: /* 11 Mbps */ - return 22; - /* case 4: reserved */ - case 5: /* 6 Mbps */ - return 12; - case 6: /* 9 Mbps */ - return 18; - case 7: /* 12 Mbps */ - return 24; - case 8: /* 18 Mbps */ - return 36; - case 9: /* 24 Mbps */ - return 48; - case 10: /* 36 Mbps */ - return 72; - case 11: /* 48 Mbps */ - return 96; - case 12: /* 54 Mbps */ - return 108; - } - lbs_pr_alert("Invalid Marvell WLAN rate %i\n", rate); - return 0; -} - -/** - * @brief This function processes a received 802.11 packet and forwards it - * to kernel/upper layer - * - * @param priv A pointer to struct lbs_private - * @param skb A pointer to skb which includes the received packet - * @return 0 or -1 - */ -static int process_rxed_802_11_packet(struct lbs_private *priv, - struct sk_buff *skb) -{ - int ret = 0; - struct net_device *dev = priv->dev; - struct rx80211packethdr *p_rx_pkt; - struct rxpd *prxpd; - struct rx_radiotap_hdr radiotap_hdr; - struct rx_radiotap_hdr *pradiotap_hdr; - - lbs_deb_enter(LBS_DEB_RX); - - p_rx_pkt = (struct rx80211packethdr *) skb->data; - prxpd = &p_rx_pkt->rx_pd; - - // lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data, min(skb->len, 100)); - - if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) { - lbs_deb_rx("rx err: frame received with bad length\n"); - dev->stats.rx_length_errors++; - ret = -EINVAL; - kfree_skb(skb); - goto done; - } - - /* - * Check rxpd status and update 802.3 stat, - */ - if (!(prxpd->status & cpu_to_le16(MRVDRV_RXPD_STATUS_OK))) { - //lbs_deb_rx("rx err: frame received with bad status\n"); - dev->stats.rx_errors++; - } - - lbs_deb_rx("rx data: skb->len-sizeof(RxPd) = %d-%zd = %zd\n", - skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd)); - - /* create the exported radio header */ - - /* radiotap header */ - radiotap_hdr.hdr.it_version = 0; - /* XXX must check this value for pad */ - radiotap_hdr.hdr.it_pad = 0; - radiotap_hdr.hdr.it_len = cpu_to_le16 (sizeof(struct rx_radiotap_hdr)); - radiotap_hdr.hdr.it_present = cpu_to_le32 (RX_RADIOTAP_PRESENT); - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - if (!(prxpd->status & cpu_to_le16(MRVDRV_RXPD_STATUS_OK))) - radiotap_hdr.flags |= IEEE80211_RADIOTAP_F_RX_BADFCS; //IEEE80211_RADIOTAP_F_BADFCS; -#endif - - radiotap_hdr.rate = convert_mv_rate_to_radiotap(prxpd->rx_rate); - /* XXX must check no carryout */ - radiotap_hdr.antsignal = prxpd->snr + prxpd->nf; - - /* chop the rxpd */ - skb_pull(skb, sizeof(struct rxpd)); - - /* add space for the new radio header */ - if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) && - pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, GFP_ATOMIC)) { - lbs_pr_alert("%s: couldn't pskb_expand_head\n", __func__); - ret = -ENOMEM; - kfree_skb(skb); - goto done; - } - - pradiotap_hdr = (void *)skb_push(skb, sizeof(struct rx_radiotap_hdr)); - memcpy(pradiotap_hdr, &radiotap_hdr, sizeof(struct rx_radiotap_hdr)); - - /* Take the data rate from the rxpd structure - * only if the rate is auto - */ - if (priv->enablehwauto) - priv->cur_rate = lbs_fw_index_to_data_rate(prxpd->rx_rate); - - lbs_compute_rssi(priv, prxpd); - - lbs_deb_rx("rx data: size of actual packet %d\n", skb->len); - dev->stats.rx_bytes += skb->len; - dev->stats.rx_packets++; - - netif_rx(skb); - - ret = 0; - -done: - lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret); - return ret; -} diff --git a/drivers/net/wireless/mv8686/scan.c b/drivers/net/wireless/mv8686/scan.c deleted file mode 100755 index 811909ad1b6e..000000000000 --- a/drivers/net/wireless/mv8686/scan.c +++ /dev/null @@ -1,1458 +0,0 @@ -/** - * Functions implementing wlan scan IOCTL and firmware command APIs - * - * IOCTL handlers as well as command preperation and response routines - * for sending scan commands to the firmware. - */ -#include -#include -#include -#include -#include "lib80211.h" - -#include "host.h" -#include "decl.h" -#include "dev.h" -#include "scan.h" -#include "cmd.h" - -//! Approximate amount of data needed to pass a scan result back to iwlist -#define MAX_SCAN_CELL_SIZE (IW_EV_ADDR_LEN \ - + IW_ESSID_MAX_SIZE \ - + IW_EV_UINT_LEN \ - + IW_EV_FREQ_LEN \ - + IW_EV_QUAL_LEN \ - + IW_ESSID_MAX_SIZE \ - + IW_EV_PARAM_LEN \ - + 40) /* 40 for WPAIE */ - -//! Memory needed to store a max sized channel List TLV for a firmware scan -#define CHAN_TLV_MAX_SIZE (sizeof(struct mrvlietypesheader) \ - + (MRVDRV_MAX_CHANNELS_PER_SCAN \ - * sizeof(struct chanscanparamset))) - -//! Memory needed to store a max number/size SSID TLV for a firmware scan -#define SSID_TLV_MAX_SIZE (1 * sizeof(struct mrvlietypes_ssidparamset)) - -//! Maximum memory needed for a cmd_ds_802_11_scan with all TLVs at max -#define MAX_SCAN_CFG_ALLOC (sizeof(struct cmd_ds_802_11_scan) \ - + CHAN_TLV_MAX_SIZE + SSID_TLV_MAX_SIZE) - -//! The maximum number of channels the firmware can scan per command -#define MRVDRV_MAX_CHANNELS_PER_SCAN 14 - -/** - * @brief Number of channels to scan per firmware scan command issuance. - * - * Number restricted to prevent hitting the limit on the amount of scan data - * returned in a single firmware scan command. - */ -#define MRVDRV_CHANNELS_PER_SCAN_CMD 4 - -//! Scan time specified in the channel TLV for each channel for passive scans -#define MRVDRV_PASSIVE_SCAN_CHAN_TIME 100 - -//! Scan time specified in the channel TLV for each channel for active scans -#define MRVDRV_ACTIVE_SCAN_CHAN_TIME 100 - -#define DEFAULT_MAX_SCAN_AGE (30 * HZ) //(15 * HZ) = 15 seconds - -#if (ANDROID_POWER_SAVE == 1) -extern int wifi_ps_status; -#endif - -static int lbs_ret_80211_scan(struct lbs_private *priv, unsigned long dummy, - struct cmd_header *resp); -#define isprint(c) ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || \ - (c >= '0' && c <= '9')) || (c == '_') - -const char *mv8686_print_ssid(char *buf, const char *ssid, u8 ssid_len) -{ - const char *s = ssid; - char *d = buf; - - ssid_len = min_t(u8, ssid_len, IEEE80211_MAX_SSID_LEN); - while (ssid_len--) { - if (isprint(*s)) { - *d++ = *s++; - continue; - } - - *d++ = '\\'; - if (*s == '\0') - *d++ = '0'; - else if (*s == '\n') - *d++ = 'n'; - else if (*s == '\r') - *d++ = 'r'; - else if (*s == '\t') - *d++ = 't'; - else if (*s == '\\') - *d++ = '\\'; - else - d += snprintf(d, 3, "%03o", *s); - s++; - } - *d = '\0'; - return buf; -} -EXPORT_SYMBOL(mv8686_print_ssid); - -/*********************************************************************/ -/* */ -/* Misc helper functions */ -/* */ -/*********************************************************************/ - -/** - * @brief Unsets the MSB on basic rates - * - * Scan through an array and unset the MSB for basic data rates. - * - * @param rates buffer of data rates - * @param len size of buffer - */ -static void lbs_unset_basic_rate_flags(u8 *rates, size_t len) -{ - int i; - - for (i = 0; i < len; i++) - rates[i] &= 0x7f; -} - - -static inline void clear_bss_descriptor(struct bss_descriptor *bss) -{ - /* Don't blow away ->list, just BSS data */ - memset(bss, 0, offsetof(struct bss_descriptor, list)); -} - -/** - * @brief Compare two SSIDs - * - * @param ssid1 A pointer to ssid to compare - * @param ssid2 A pointer to ssid to compare - * - * @return 0: ssid is same, otherwise is different - */ -int lbs_ssid_cmp(uint8_t *ssid1, uint8_t ssid1_len, uint8_t *ssid2, - uint8_t ssid2_len) -{ - if (ssid1_len != ssid2_len) - return -1; - - return memcmp(ssid1, ssid2, ssid1_len); -} - -static inline int is_same_network(struct bss_descriptor *src, - struct bss_descriptor *dst) -{ - /* A network is only a duplicate if the channel, BSSID, and ESSID - * all match. We treat all with the same BSSID and channel - * as one network */ - return ((src->ssid_len == dst->ssid_len) && - (src->channel == dst->channel) && - !compare_ether_addr(src->bssid, dst->bssid) && - !memcmp(src->ssid, dst->ssid, src->ssid_len)); -} - -/*********************************************************************/ -/* */ -/* Main scanning support */ -/* */ -/*********************************************************************/ - -/** - * @brief Create a channel list for the driver to scan based on region info - * - * Only used from lbs_scan_setup_scan_config() - * - * Use the driver region/band information to construct a comprehensive list - * of channels to scan. This routine is used for any scan that is not - * provided a specific channel list to scan. - * - * @param priv A pointer to struct lbs_private structure - * @param scanchanlist Output parameter: resulting channel list to scan - * - * @return void - */ -static int lbs_scan_create_channel_list(struct lbs_private *priv, - struct chanscanparamset *scanchanlist) -{ - struct region_channel *scanregion; - struct chan_freq_power *cfp; - int rgnidx; - int chanidx; - int nextchan; - uint8_t scantype; - - chanidx = 0; - - /* Set the default scan type to the user specified type, will later - * be changed to passive on a per channel basis if restricted by - * regulatory requirements (11d or 11h) - */ - scantype = CMD_SCAN_TYPE_ACTIVE; - - for (rgnidx = 0; rgnidx < ARRAY_SIZE(priv->region_channel); rgnidx++) { - if (priv->enable11d && (priv->connect_status != LBS_CONNECTED)) { - /* Scan all the supported chan for the first scan */ - if (!priv->universal_channel[rgnidx].valid) - continue; - scanregion = &priv->universal_channel[rgnidx]; - - /* clear the parsed_region_chan for the first scan */ - memset(&priv->parsed_region_chan, 0x00, - sizeof(priv->parsed_region_chan)); - } else { - if (!priv->region_channel[rgnidx].valid) - continue; - scanregion = &priv->region_channel[rgnidx]; - } - - for (nextchan = 0; nextchan < scanregion->nrcfp; nextchan++, chanidx++) { - struct chanscanparamset *chan = &scanchanlist[chanidx]; - - cfp = scanregion->CFP + nextchan; - - if (priv->enable11d) - scantype = lbs_get_scan_type_11d(cfp->channel, - &priv->parsed_region_chan); - - if (scanregion->band == BAND_B || scanregion->band == BAND_G) - chan->radiotype = CMD_SCAN_RADIO_TYPE_BG; - - if (scantype == CMD_SCAN_TYPE_PASSIVE) { - chan->maxscantime = cpu_to_le16(MRVDRV_PASSIVE_SCAN_CHAN_TIME); - chan->chanscanmode.passivescan = 1; - } else { - chan->maxscantime = cpu_to_le16(MRVDRV_ACTIVE_SCAN_CHAN_TIME); - chan->chanscanmode.passivescan = 0; - } - - chan->channumber = cfp->channel; - } - } - return chanidx; -} - -/* - * Add SSID TLV of the form: - * - * TLV-ID SSID 00 00 - * length 06 00 - * ssid 4d 4e 54 45 53 54 - */ -static int lbs_scan_add_ssid_tlv(struct lbs_private *priv, u8 *tlv) -{ - struct mrvlietypes_ssidparamset *ssid_tlv = (void *)tlv; - - ssid_tlv->header.type = cpu_to_le16(TLV_TYPE_SSID); - ssid_tlv->header.len = cpu_to_le16(priv->scan_ssid_len); - memcpy(ssid_tlv->ssid, priv->scan_ssid, priv->scan_ssid_len); - return sizeof(ssid_tlv->header) + priv->scan_ssid_len; -} - -/* - * Add CHANLIST TLV of the form - * - * TLV-ID CHANLIST 01 01 - * length 5b 00 - * channel 1 00 01 00 00 00 64 00 - * radio type 00 - * channel 01 - * scan type 00 - * min scan time 00 00 - * max scan time 64 00 - * channel 2 00 02 00 00 00 64 00 - * channel 3 00 03 00 00 00 64 00 - * channel 4 00 04 00 00 00 64 00 - * channel 5 00 05 00 00 00 64 00 - * channel 6 00 06 00 00 00 64 00 - * channel 7 00 07 00 00 00 64 00 - * channel 8 00 08 00 00 00 64 00 - * channel 9 00 09 00 00 00 64 00 - * channel 10 00 0a 00 00 00 64 00 - * channel 11 00 0b 00 00 00 64 00 - * channel 12 00 0c 00 00 00 64 00 - * channel 13 00 0d 00 00 00 64 00 - * - */ -static int lbs_scan_add_chanlist_tlv(uint8_t *tlv, - struct chanscanparamset *chan_list, - int chan_count) -{ - size_t size = sizeof(struct chanscanparamset) *chan_count; - struct mrvlietypes_chanlistparamset *chan_tlv = (void *)tlv; - - chan_tlv->header.type = cpu_to_le16(TLV_TYPE_CHANLIST); - memcpy(chan_tlv->chanscanparam, chan_list, size); - chan_tlv->header.len = cpu_to_le16(size); - return sizeof(chan_tlv->header) + size; -} - -/* - * Add RATES TLV of the form - * - * TLV-ID RATES 01 00 - * length 0e 00 - * rates 82 84 8b 96 0c 12 18 24 30 48 60 6c - * - * The rates are in lbs_bg_rates[], but for the 802.11b - * rates the high bit isn't set. - */ -static int lbs_scan_add_rates_tlv(uint8_t *tlv) -{ - int i; - struct mrvlietypes_ratesparamset *rate_tlv = (void *)tlv; - - rate_tlv->header.type = cpu_to_le16(TLV_TYPE_RATES); - tlv += sizeof(rate_tlv->header); - for (i = 0; i < MAX_RATES; i++) { - *tlv = lbs_bg_rates[i]; - if (*tlv == 0) - break; - /* This code makes sure that the 802.11b rates (1 MBit/s, 2 - MBit/s, 5.5 MBit/s and 11 MBit/s get's the high bit set. - Note that the values are MBit/s * 2, to mark them as - basic rates so that the firmware likes it better */ - if (*tlv == 0x02 || *tlv == 0x04 || - *tlv == 0x0b || *tlv == 0x16) - *tlv |= 0x80; - tlv++; - } - rate_tlv->header.len = cpu_to_le16(i); - return sizeof(rate_tlv->header) + i; -} - -/* - * Generate the CMD_802_11_SCAN command with the proper tlv - * for a bunch of channels. - */ -static int lbs_do_scan(struct lbs_private *priv, uint8_t bsstype, - struct chanscanparamset *chan_list, int chan_count) -{ - int ret = -ENOMEM; - struct cmd_ds_802_11_scan *scan_cmd; - uint8_t *tlv; /* pointer into our current, growing TLV storage area */ - - lbs_deb_enter_args(LBS_DEB_SCAN, "bsstype %d, chanlist[].chan %d, chan_count %d", - bsstype, chan_list ? chan_list[0].channumber : -1, - chan_count); - - /* create the fixed part for scan command */ - scan_cmd = kzalloc(MAX_SCAN_CFG_ALLOC, GFP_KERNEL); - if (scan_cmd == NULL) - goto out; - - tlv = scan_cmd->tlvbuffer; - /* TODO: do we need to scan for a specific BSSID? - memcpy(scan_cmd->bssid, priv->scan_bssid, ETH_ALEN); */ - scan_cmd->bsstype = bsstype; - - /* add TLVs */ - if (priv->scan_ssid_len) - tlv += lbs_scan_add_ssid_tlv(priv, tlv); - if (chan_list && chan_count) - tlv += lbs_scan_add_chanlist_tlv(tlv, chan_list, chan_count); - tlv += lbs_scan_add_rates_tlv(tlv); - - /* This is the final data we are about to send */ - scan_cmd->hdr.size = cpu_to_le16(tlv - (uint8_t *)scan_cmd); - lbs_deb_hex(LBS_DEB_SCAN, "SCAN_CMD", (void *)scan_cmd, - sizeof(*scan_cmd)); - lbs_deb_hex(LBS_DEB_SCAN, "SCAN_TLV", scan_cmd->tlvbuffer, - tlv - scan_cmd->tlvbuffer); - - ret = __lbs_cmd(priv, CMD_802_11_SCAN, &scan_cmd->hdr, - le16_to_cpu(scan_cmd->hdr.size), - lbs_ret_80211_scan, 0); - -out: - kfree(scan_cmd); - lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", ret); - return ret; -} - -/** - * @brief Internal function used to start a scan based on an input config - * - * Use the input user scan configuration information when provided in - * order to send the appropriate scan commands to firmware to populate or - * update the internal driver scan table - * - * @param priv A pointer to struct lbs_private structure - * @param full_scan Do a full-scan (blocking) - * - * @return 0 or < 0 if error - */ -int lbs_scan_networks(struct lbs_private *priv, int full_scan) -{ - int ret = -ENOMEM; - struct chanscanparamset *chan_list; - struct chanscanparamset *curr_chans; - int chan_count; - uint8_t bsstype = CMD_BSS_TYPE_ANY; - int numchannels = MRVDRV_CHANNELS_PER_SCAN_CMD; - union iwreq_data wrqu; -#ifdef CONFIG_LIBERTAS_DEBUG - struct bss_descriptor *iter; - int i = 0; - DECLARE_SSID_BUF(ssid); -#endif - - lbs_deb_enter_args(LBS_DEB_SCAN, "full_scan %d", full_scan); - -#if (ANDROID_POWER_SAVE == 1) - - if (wifi_ps_status != WIFI_PS_AWAKE) - { - printk("Ignore this scan due to sleep.\n"); - memset(&wrqu, 0, sizeof(union iwreq_data)); - wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL); - - priv->scan_channel = 0; - - return 0; - } -#endif - - /* Cancel any partial outstanding partial scans if this scan - * is a full scan. - */ - //if (full_scan && delayed_work_pending(&priv->scan_work)) - // cancel_delayed_work(&priv->scan_work); - - /* User-specified bsstype or channel list - TODO: this can be implemented if some user-space application - need the feature. Formerly, it was accessible from debugfs, - but then nowhere used. - if (user_cfg) { - if (user_cfg->bsstype) - bsstype = user_cfg->bsstype; - } */ - - lbs_deb_scan("numchannels %d, bsstype %d\n", numchannels, bsstype); - - /* Create list of channels to scan */ - chan_list = kzalloc(sizeof(struct chanscanparamset) * - LBS_IOCTL_USER_SCAN_CHAN_MAX, GFP_KERNEL); - if (!chan_list) { - lbs_pr_alert("SCAN: chan_list empty\n"); - goto out; - } - - /* We want to scan all channels */ - chan_count = lbs_scan_create_channel_list(priv, chan_list); - - netif_stop_queue(priv->dev); - netif_carrier_off(priv->dev); - - /* Prepare to continue an interrupted scan */ - lbs_deb_scan("chan_count %d, scan_channel %d\n", - chan_count, priv->scan_channel); - curr_chans = chan_list; - /* advance channel list by already-scanned-channels */ - if (priv->scan_channel > 0) { - curr_chans += priv->scan_channel; - chan_count -= priv->scan_channel; - } - - /* Send scan command(s) - * numchannels contains the number of channels we should maximally scan - * chan_count is the total number of channels to scan - */ - - while (chan_count) { - int to_scan = min(numchannels, chan_count); - lbs_deb_scan("scanning %d of %d channels\n", - to_scan, chan_count); - ret = lbs_do_scan(priv, bsstype, curr_chans, to_scan); - if (ret) { - lbs_pr_err("SCAN_CMD failed\n"); - goto out2; - } - curr_chans += to_scan; - chan_count -= to_scan; - - /* somehow schedule the next part of the scan */ - if (chan_count && !full_scan && - !priv->surpriseremoved) { - /* -1 marks just that we're currently scanning */ - if (priv->scan_channel < 0) - priv->scan_channel = to_scan; - else - priv->scan_channel += to_scan; - cancel_delayed_work(&priv->scan_work); - queue_delayed_work(priv->work_thread, &priv->scan_work, - msecs_to_jiffies(300)); - /* skip over GIWSCAN event */ - goto out; - } - - } - - memset(&wrqu, 0, sizeof(union iwreq_data)); - wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL); - -//#if (NEW_MV8686_PS == 1) -#if 0 - if (full_scan == 1) - { - //printk("%s: broadcast scan complete:%lu.\n", __func__, jiffies); - priv->scan_result_timeout = jiffies + msecs_to_jiffies(8000); - } -#endif - -#if 0 -#ifdef CONFIG_LIBERTAS_DEBUG - /* Dump the scan table */ - mutex_lock(&priv->lock); - lbs_deb_scan("scan table:\n"); - list_for_each_entry(iter, &priv->network_list, list) - lbs_deb_scan("%02d: BSSID %pM, RSSI %d, SSID '%s'\n", - i++, iter->bssid, iter->rssi, - mv8686_print_ssid(ssid, iter->ssid, iter->ssid_len)); - mutex_unlock(&priv->lock); -#endif -#endif - -out2: - priv->scan_channel = 0; - -out: - if (priv->connect_status == LBS_CONNECTED) { - netif_carrier_on(priv->dev); - if (!priv->tx_pending_len) - netif_wake_queue(priv->dev); - } - kfree(chan_list); - - lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", ret); - return ret; -} - -int scan_status = 0; - -void lbs_scan_worker(struct work_struct *work) -{ - struct lbs_private *priv = - container_of(work, struct lbs_private, scan_work.work); - - if (scan_status == 1) - { - printk("Scan worker is busy!!!!!!!!!!\n"); - return; - } - - lbs_deb_enter(LBS_DEB_SCAN); - scan_status = 1; - lbs_scan_networks(priv, 1); - scan_status = 0; - lbs_deb_leave(LBS_DEB_SCAN); -} - - -/*********************************************************************/ -/* */ -/* Result interpretation */ -/* */ -/*********************************************************************/ - -/** - * @brief Interpret a BSS scan response returned from the firmware - * - * Parse the various fixed fields and IEs passed back for a a BSS probe - * response or beacon from the scan command. Record information as needed - * in the scan table struct bss_descriptor for that entry. - * - * @param bss Output parameter: Pointer to the BSS Entry - * - * @return 0 or -1 - */ -static int lbs_process_bss(struct bss_descriptor *bss, - uint8_t **pbeaconinfo, int *bytesleft) -{ - struct ieeetypes_fhparamset *pFH; - struct ieeetypes_dsparamset *pDS; - struct ieeetypes_cfparamset *pCF; - struct ieeetypes_ibssparamset *pibss; - DECLARE_SSID_BUF(ssid); - struct ieeetypes_countryinfoset *pcountryinfo; - uint8_t *pos, *end, *p; - uint8_t n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0; - uint16_t beaconsize = 0; - int ret; - - lbs_deb_enter(LBS_DEB_SCAN); - - if (*bytesleft >= sizeof(beaconsize)) { - /* Extract & convert beacon size from the command buffer */ - beaconsize = le16_to_cpu(get_unaligned((__le16 *)*pbeaconinfo)); //get_unaligned_le16(*pbeaconinfo) - *bytesleft -= sizeof(beaconsize); - *pbeaconinfo += sizeof(beaconsize); - } - - if (beaconsize == 0 || beaconsize > *bytesleft) { - *pbeaconinfo += *bytesleft; - *bytesleft = 0; - ret = -1; - goto done; - } - - /* Initialize the current working beacon pointer for this BSS iteration */ - pos = *pbeaconinfo; - end = pos + beaconsize; - - /* Advance the return beacon pointer past the current beacon */ - *pbeaconinfo += beaconsize; - *bytesleft -= beaconsize; - - memcpy(bss->bssid, pos, ETH_ALEN); - lbs_deb_scan("process_bss: BSSID %pM\n", bss->bssid); - pos += ETH_ALEN; - - if ((end - pos) < 12) { - lbs_deb_scan("process_bss: Not enough bytes left\n"); - ret = -1; - goto done; - } - - /* - * next 4 fields are RSSI, time stamp, beacon interval, - * and capability information - */ - - /* RSSI is 1 byte long */ - bss->rssi = *pos; - lbs_deb_scan("process_bss: RSSI %d\n", *pos); - pos++; - - /* time stamp is 8 bytes long */ - pos += 8; - - /* beacon interval is 2 bytes long */ - bss->beaconperiod = le16_to_cpup((void *) pos);//get_unaligned_le16(pos); - pos += 2; - - /* capability information is 2 bytes long */ - bss->capability = le16_to_cpup((void *) pos);//get_unaligned_le16(pos); - lbs_deb_scan("process_bss: capabilities 0x%04x\n", bss->capability); - pos += 2; - - if (bss->capability & WLAN_CAPABILITY_PRIVACY) - lbs_deb_scan("process_bss: WEP enabled\n"); - if (bss->capability & WLAN_CAPABILITY_IBSS) - bss->mode = IW_MODE_ADHOC; - else - bss->mode = IW_MODE_INFRA; - - /* rest of the current buffer are IE's */ - lbs_deb_scan("process_bss: IE len %zd\n", end - pos); - lbs_deb_hex(LBS_DEB_SCAN, "process_bss: IE info", pos, end - pos); - - /* process variable IE */ - while (pos <= end - 2) { - if (pos + pos[1] > end) { - lbs_deb_scan("process_bss: error in processing IE, " - "bytes left < IE length\n"); - break; - } - - switch (pos[0]) { - case WLAN_EID_SSID: - bss->ssid_len = min_t(int, IEEE80211_MAX_SSID_LEN, pos[1]); - memcpy(bss->ssid, pos + 2, bss->ssid_len); - lbs_deb_scan("got SSID IE: '%s', len %u\n", - mv8686_print_ssid(ssid, bss->ssid, bss->ssid_len), - bss->ssid_len); - break; - - case WLAN_EID_SUPP_RATES: - n_basic_rates = min_t(uint8_t, MAX_RATES, pos[1]); - memcpy(bss->rates, pos + 2, n_basic_rates); - got_basic_rates = 1; - lbs_deb_scan("got RATES IE\n"); - break; - - case WLAN_EID_FH_PARAMS: - pFH = (struct ieeetypes_fhparamset *) pos; - memmove(&bss->phyparamset.fhparamset, pFH, - sizeof(struct ieeetypes_fhparamset)); - lbs_deb_scan("got FH IE\n"); - break; - - case WLAN_EID_DS_PARAMS: - pDS = (struct ieeetypes_dsparamset *) pos; - bss->channel = pDS->currentchan; - memcpy(&bss->phyparamset.dsparamset, pDS, - sizeof(struct ieeetypes_dsparamset)); - lbs_deb_scan("got DS IE, channel %d\n", bss->channel); - break; - - case WLAN_EID_CF_PARAMS: - pCF = (struct ieeetypes_cfparamset *) pos; - memcpy(&bss->ssparamset.cfparamset, pCF, - sizeof(struct ieeetypes_cfparamset)); - lbs_deb_scan("got CF IE\n"); - break; - - case WLAN_EID_IBSS_PARAMS: - pibss = (struct ieeetypes_ibssparamset *) pos; - bss->atimwindow = le16_to_cpu(pibss->atimwindow); - memmove(&bss->ssparamset.ibssparamset, pibss, - sizeof(struct ieeetypes_ibssparamset)); - lbs_deb_scan("got IBSS IE\n"); - break; - - case WLAN_EID_COUNTRY: - pcountryinfo = (struct ieeetypes_countryinfoset *) pos; - lbs_deb_scan("got COUNTRY IE\n"); - if (pcountryinfo->len < sizeof(pcountryinfo->countrycode) - || pcountryinfo->len > 254) { - lbs_deb_scan("process_bss: 11D- Err CountryInfo len %d, min %zd, max 254\n", - pcountryinfo->len, sizeof(pcountryinfo->countrycode)); - ret = -1; - goto done; - } - - memcpy(&bss->countryinfo, pcountryinfo, pcountryinfo->len + 2); - lbs_deb_hex(LBS_DEB_SCAN, "process_bss: 11d countryinfo", - (uint8_t *) pcountryinfo, - (int) (pcountryinfo->len + 2)); - break; - - case WLAN_EID_EXT_SUPP_RATES: - /* only process extended supported rate if data rate is - * already found. Data rate IE should come before - * extended supported rate IE - */ - lbs_deb_scan("got RATESEX IE\n"); - if (!got_basic_rates) { - lbs_deb_scan("... but ignoring it\n"); - break; - } - - n_ex_rates = pos[1]; - if (n_basic_rates + n_ex_rates > MAX_RATES) - n_ex_rates = MAX_RATES - n_basic_rates; - - p = bss->rates + n_basic_rates; - memcpy(p, pos + 2, n_ex_rates); - break; - - case WLAN_EID_GENERIC: - if (pos[1] >= 4 && - pos[2] == 0x00 && pos[3] == 0x50 && - pos[4] == 0xf2 && pos[5] == 0x01) { - bss->wpa_ie_len = min(pos[1] + 2, MAX_WPA_IE_LEN); - memcpy(bss->wpa_ie, pos, bss->wpa_ie_len); - lbs_deb_scan("got WPA IE\n"); - lbs_deb_hex(LBS_DEB_SCAN, "WPA IE", bss->wpa_ie, - bss->wpa_ie_len); - } else { - lbs_deb_scan("got generic IE: %02x:%02x:%02x:%02x, len %d\n", - pos[2], pos[3], - pos[4], pos[5], - pos[1]); - } - break; - - case WLAN_EID_RSN: - lbs_deb_scan("got RSN IE\n"); - bss->rsn_ie_len = min(pos[1] + 2, MAX_WPA_IE_LEN); - memcpy(bss->rsn_ie, pos, bss->rsn_ie_len); - lbs_deb_hex(LBS_DEB_SCAN, "process_bss: RSN_IE", - bss->rsn_ie, bss->rsn_ie_len); - break; - - default: - lbs_deb_scan("got IE 0x%04x, len %d\n", - pos[0], pos[1]); - break; - } - - pos += pos[1] + 2; - } - - /* Timestamp */ - bss->last_scanned = jiffies; - lbs_unset_basic_rate_flags(bss->rates, sizeof(bss->rates)); - - ret = 0; - -done: - lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", ret); - return ret; -} - -/** - * @brief Send a scan command for all available channels filtered on a spec - * - * Used in association code and from debugfs - * - * @param priv A pointer to struct lbs_private structure - * @param ssid A pointer to the SSID to scan for - * @param ssid_len Length of the SSID - * - * @return 0-success, otherwise fail - */ -int lbs_send_specific_ssid_scan(struct lbs_private *priv, uint8_t *ssid, - uint8_t ssid_len) -{ - DECLARE_SSID_BUF(ssid_buf); - int ret = 0; - - lbs_deb_enter_args(LBS_DEB_SCAN, "SSID '%s'\n", - mv8686_print_ssid(ssid_buf, ssid, ssid_len)); - - if (!ssid_len) - goto out; - - memcpy(priv->scan_ssid, ssid, ssid_len); - priv->scan_ssid_len = ssid_len; - - lbs_scan_networks(priv, 1); - if (priv->surpriseremoved) { - ret = -1; - goto out; - } - -out: - lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", ret); - return ret; -} - - - - -/*********************************************************************/ -/* */ -/* Support for Wireless Extensions */ -/* */ -/*********************************************************************/ - - -#define MAX_CUSTOM_LEN 64 - -static inline char *lbs_translate_scan(struct lbs_private *priv, - struct iw_request_info *info, - char *start, char *stop, - struct bss_descriptor *bss) -{ - struct chan_freq_power *cfp; - char *current_val; /* For rates */ - struct iw_event iwe; /* Temporary buffer */ - int j; -#define PERFECT_RSSI ((uint8_t)50) -#define WORST_RSSI ((uint8_t)0) -#define RSSI_DIFF ((uint8_t)(PERFECT_RSSI - WORST_RSSI)) - uint8_t rssi; - - lbs_deb_enter(LBS_DEB_SCAN); - - cfp = lbs_find_cfp_by_band_and_channel(priv, 0, bss->channel); - if (!cfp) { - lbs_deb_scan("Invalid channel number %d\n", bss->channel); - start = NULL; - goto out; - } - - /* First entry *MUST* be the BSSID */ - iwe.cmd = SIOCGIWAP; - iwe.u.ap_addr.sa_family = ARPHRD_ETHER; - memcpy(iwe.u.ap_addr.sa_data, &bss->bssid, ETH_ALEN); - start = iwe_stream_add_event( -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) - info, -#endif - start, stop, &iwe, IW_EV_ADDR_LEN); - - /* SSID */ - iwe.cmd = SIOCGIWESSID; - iwe.u.data.flags = 1; - iwe.u.data.length = min((uint32_t) bss->ssid_len, (uint32_t) IW_ESSID_MAX_SIZE); - start = iwe_stream_add_point( -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) - info, -#endif - start, stop, &iwe, bss->ssid); - - /* Mode */ - iwe.cmd = SIOCGIWMODE; - iwe.u.mode = bss->mode; - start = iwe_stream_add_event( -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) - info, -#endif - start, stop, &iwe, IW_EV_UINT_LEN); - - /* Frequency */ - iwe.cmd = SIOCGIWFREQ; - iwe.u.freq.m = (long)cfp->freq * 100000; - iwe.u.freq.e = 1; - start = iwe_stream_add_event( -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) - info, -#endif - start, stop, &iwe, IW_EV_FREQ_LEN); - - /* Add quality statistics */ - iwe.cmd = IWEVQUAL; - iwe.u.qual.updated = IW_QUAL_ALL_UPDATED; - iwe.u.qual.level = SCAN_RSSI(bss->rssi); - - rssi = iwe.u.qual.level - MRVDRV_NF_DEFAULT_SCAN_VALUE; - iwe.u.qual.qual = - (100 * RSSI_DIFF * RSSI_DIFF - (PERFECT_RSSI - rssi) * - (15 * (RSSI_DIFF) + 62 * (PERFECT_RSSI - rssi))) / - (RSSI_DIFF * RSSI_DIFF); - if (iwe.u.qual.qual > 100) - iwe.u.qual.qual = 100; - - if (priv->NF[TYPE_BEACON][TYPE_NOAVG] == 0) { - iwe.u.qual.noise = MRVDRV_NF_DEFAULT_SCAN_VALUE; - } else { - iwe.u.qual.noise = CAL_NF(priv->NF[TYPE_BEACON][TYPE_NOAVG]); - } - -#if (MV8686_SUPPORT_ADHOC == 1) - /* Locally created ad-hoc BSSs won't have beacons if this is the - * only station in the adhoc network; so get signal strength - * from receive statistics. - */ - if ((priv->mode == IW_MODE_ADHOC) && priv->adhoccreate - && !lbs_ssid_cmp(priv->curbssparams.ssid, - priv->curbssparams.ssid_len, - bss->ssid, bss->ssid_len)) { - int snr, nf; - snr = priv->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE; - nf = priv->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE; - iwe.u.qual.level = CAL_RSSI(snr, nf); - } -#endif - - start = iwe_stream_add_event( -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) - info, -#endif - start, stop, &iwe, IW_EV_QUAL_LEN); - - /* Add encryption capability */ - iwe.cmd = SIOCGIWENCODE; - if (bss->capability & WLAN_CAPABILITY_PRIVACY) { - iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; - } else { - iwe.u.data.flags = IW_ENCODE_DISABLED; - } - iwe.u.data.length = 0; - start = iwe_stream_add_point( -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) - info, -#endif - start, stop, &iwe, bss->ssid); - - current_val = start + IW_EV_LCP_LEN;//iwe_stream_lcp_len(info); - - iwe.cmd = SIOCGIWRATE; - iwe.u.bitrate.fixed = 0; - iwe.u.bitrate.disabled = 0; - iwe.u.bitrate.value = 0; - - for (j = 0; bss->rates[j] && (j < sizeof(bss->rates)); j++) { - /* Bit rate given in 500 kb/s units */ - iwe.u.bitrate.value = bss->rates[j] * 500000; - current_val = iwe_stream_add_value( -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) - info, -#endif - start, current_val, stop, &iwe, IW_EV_PARAM_LEN); - } -#if (MV8686_SUPPORT_ADHOC == 1) - if ((bss->mode == IW_MODE_ADHOC) && priv->adhoccreate - && !lbs_ssid_cmp(priv->curbssparams.ssid, - priv->curbssparams.ssid_len, - bss->ssid, bss->ssid_len)) { - iwe.u.bitrate.value = 22 * 500000; - current_val = iwe_stream_add_value( -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) - info, -#endif - start, current_val, stop, &iwe, IW_EV_PARAM_LEN); - } -#endif - - /* Check if we added any event */ - if ((current_val - start) > IW_EV_LCP_LEN)//iwe_stream_lcp_len(info)) - start = current_val; - - memset(&iwe, 0, sizeof(iwe)); - if (bss->wpa_ie_len) { - char buf[MAX_WPA_IE_LEN]; - memcpy(buf, bss->wpa_ie, bss->wpa_ie_len); - iwe.cmd = IWEVGENIE; - iwe.u.data.length = bss->wpa_ie_len; - start = iwe_stream_add_point( -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) - info, -#endif - start, stop, &iwe, buf); - } - - memset(&iwe, 0, sizeof(iwe)); - if (bss->rsn_ie_len) { - char buf[MAX_WPA_IE_LEN]; - memcpy(buf, bss->rsn_ie, bss->rsn_ie_len); - iwe.cmd = IWEVGENIE; - iwe.u.data.length = bss->rsn_ie_len; - start = iwe_stream_add_point( -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) - info, -#endif - start, stop, &iwe, buf); - } - -out: - lbs_deb_leave_args(LBS_DEB_SCAN, "start %p", start); - return start; -} - - -/** - * @brief Handle Scan Network ioctl - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param vwrq A pointer to iw_param structure - * @param extra A pointer to extra data buf - * - * @return 0 --success, otherwise fail - */ - -extern int wifi_ps_status; - -void lbs_dump_scan_req_queue(struct lbs_private *priv) -{ - int i = 0; - struct lbs_scan_req *req; - - printk("Dumping scan request queue:\n"); - list_for_each_entry (req, &priv->scan_req_list, list) - { - printk("[%2d] ssid_len: %2d ssid: %s\n", i++, - req->ssid_len, req->ssid_len ? req->ssid : " "); - } -} - -int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - DECLARE_SSID_BUF(ssid); - DECLARE_SSID_BUF(scan_ssid); - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - int ret = 0, scan_ssid_len = 0, needtoqueue = 1; -#if (ANDROID_POWER_SAVE == 1) - union iwreq_data rwrqu; -#endif - struct lbs_scan_req *scan_req; - - lbs_deb_enter(LBS_DEB_WEXT); - - //printk("%s: Scan request from application.\n", __func__); - - if (priv->surpriseremoved) - { - printk("Warning: priv->surpriseremoved\n"); - return -EIO; - } - -#if (ANDROID_POWER_SAVE == 1) - - if (wifi_ps_status != WIFI_PS_AWAKE) - { - printk("set_scan: Ignore this scan due to deep sleep.\n"); - memset(&rwrqu, 0, sizeof(union iwreq_data)); - wireless_send_event(priv->dev, SIOCGIWSCAN, &rwrqu, NULL); - - if ((wifi_ps_status == WIFI_PS_DRV_SLEEP) && - (priv->wifi_ps_work_req == 0)) - { - printk("Wakeup wifi for scan.\n"); - priv->wifi_ps_work_req = WIFI_PS_PRE_WAKE; - netif_stop_queue(priv->dev); - netif_carrier_off(priv->dev); - queue_delayed_work(priv->work_thread, &priv->ps_work, - msecs_to_jiffies(5)); - } - return 0; - } - else - { - lbs_update_ps_timer(); - } -#endif - - if (!priv->radio_on) { - printk("set_scan: radio is off.\n"); - ret = -EINVAL; - goto out; - } - - if (wrqu->data.length == sizeof(struct iw_scan_req) && - wrqu->data.flags & IW_SCAN_THIS_ESSID) - { - struct iw_scan_req *req = (struct iw_scan_req *)extra; - - scan_ssid_len = req->essid_len; - memcpy(scan_ssid, req->essid, scan_ssid_len); - } - else - { - scan_ssid_len = 0; - memset(scan_ssid, 0, sizeof(scan_ssid)); -//#if (NEW_MV8686_PS == 1) -#if 0 - //if ((priv->scan_result_timeout > 0) && - // time_before(jiffies, priv->scan_result_timeout)) - if (priv->scan_result_timeout > 0) - { - union iwreq_data rwrqu; - - //printk("The previous scan result is fresh still.\n"); - //printk("jiffies=%lu timeout=%lu\n", jiffies, priv->scan_result_timeout); - - memset(&rwrqu, 0, sizeof(union iwreq_data)); - wireless_send_event(priv->dev, SIOCGIWSCAN, &rwrqu, NULL); - } -#endif - } - - /* - * Check if there is a same item. - */ - list_for_each_entry (scan_req, &priv->scan_req_list, list) - { - if (scan_ssid_len == scan_req->ssid_len) - { - //printk("Length is equal, ssid: %s\n", scan_ssid); - if ((scan_ssid_len == 0) || - (memcmp(scan_ssid, scan_req->ssid, scan_ssid_len) == 0)) - { - needtoqueue = 0; - //printk("Ignore this scan request due to duplicate item.\n"); - break; - } - } - } - - - if ((needtoqueue == 1) && !list_empty(&(priv->scan_req_free_list))) - { - /* Queue the scan request */ - scan_req = list_entry(priv->scan_req_free_list.next, struct lbs_scan_req, list); - scan_req->ssid_len = scan_ssid_len; - memcpy(scan_req->ssid, scan_ssid, scan_ssid_len); - scan_req->ssid[scan_ssid_len] = 0; - - list_move_tail(&scan_req->list, &priv->scan_req_list); - } - //else - // printk("Ignore this request due to queue maybe full.\n"); - - //lbs_dump_scan_req_queue(priv); - - if (!delayed_work_pending(&priv->scan_work) && - !list_empty(&(priv->scan_req_list)) && (scan_status == 0)) - { - /* De-queue the first scan request */ - //printk("De-queue scan request>>>>> scan_status=%d\n", scan_status); - scan_req = list_entry(priv->scan_req_list.next, struct lbs_scan_req, list); - list_move_tail(&scan_req->list, &priv->scan_req_free_list); - - priv->scan_ssid_len = scan_req->ssid_len; - strcpy(priv->scan_ssid, scan_req->ssid); - - queue_delayed_work(priv->work_thread, &priv->scan_work, msecs_to_jiffies(5)); - /* set marker that currently a scan is taking place */ - priv->scan_channel = -1; - } - - //lbs_dump_scan_req_queue(priv); - -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - - -/** - * @brief Handle Retrieve scan table ioctl - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param dwrq A pointer to iw_point structure - * @param extra A pointer to extra data buf - * - * @return 0 --success, otherwise fail - */ -int lbs_get_scan(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ -#define SCAN_ITEM_SIZE 128 - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - int err = 0; - char *ev = extra; - char *stop = ev + dwrq->length; - struct bss_descriptor *iter_bss; - struct bss_descriptor *safe; - - lbs_deb_enter(LBS_DEB_WEXT); - - if (priv->surpriseremoved) - return -EIO; - -#if (NEW_MV8686_PS == 0) - /* iwlist should wait until the current scan is finished */ - if (priv->scan_channel) - { - //printk("Scanning, please try again.\n"); - return -EAGAIN; - } -#endif - -#if (MV8686_SUPPORT_ADHOC == 1) - /* Update RSSI if current BSS is a locally created ad-hoc BSS */ - if ((priv->mode == IW_MODE_ADHOC) && priv->adhoccreate) - lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0, - CMD_OPTION_WAITFORRSP, 0, NULL); -#endif - - mutex_lock(&priv->lock); - list_for_each_entry_safe (iter_bss, safe, &priv->network_list, list) - { - char *next_ev; - unsigned long stale_time; - - if (stop - ev < SCAN_ITEM_SIZE) { - err = -E2BIG; - break; - } - - /* Prune old an old scan result */ - stale_time = iter_bss->last_scanned + DEFAULT_MAX_SCAN_AGE; - if (time_after(jiffies, stale_time)) { - list_move_tail(&iter_bss->list, &priv->network_free_list); - clear_bss_descriptor(iter_bss); - continue; - } - - /* Translate to WE format this entry */ - next_ev = lbs_translate_scan(priv, info, ev, stop, iter_bss); - if (next_ev == NULL) - continue; - ev = next_ev; - } - mutex_unlock(&priv->lock); - - dwrq->length = (ev - extra); - dwrq->flags = 0; - - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", err); - return err; -} - -/*********************************************************************/ -/* */ -/* Command execution */ -/* */ -/*********************************************************************/ - -/** - * @brief This function handles the command response of scan - * - * Called from handle_cmd_response() in cmdrespc. - * - * The response buffer for the scan command has the following - * memory layout: - * - * .-----------------------------------------------------------. - * | header (4 * sizeof(u16)): Standard command response hdr | - * .-----------------------------------------------------------. - * | bufsize (u16) : sizeof the BSS Description data | - * .-----------------------------------------------------------. - * | NumOfSet (u8) : Number of BSS Descs returned | - * .-----------------------------------------------------------. - * | BSSDescription data (variable, size given in bufsize) | - * .-----------------------------------------------------------. - * | TLV data (variable, size calculated using header->size, | - * | bufsize and sizeof the fixed fields above) | - * .-----------------------------------------------------------. - * - * @param priv A pointer to struct lbs_private structure - * @param resp A pointer to cmd_ds_command - * - * @return 0 or -1 - */ -static int lbs_ret_80211_scan(struct lbs_private *priv, unsigned long dummy, - struct cmd_header *resp) -{ - struct cmd_ds_802_11_scan_rsp *scanresp = (void *)resp; - struct bss_descriptor *iter_bss; - struct bss_descriptor *safe; - uint8_t *bssinfo; - uint16_t scanrespsize; - int bytesleft; - int idx; - int tlvbufsize; - int ret; - - lbs_deb_enter(LBS_DEB_SCAN); - - if (priv->surpriseremoved) - ret = -EIO; - - //printk("Got scanned AP number: %d\n", scanresp->nr_sets); - - if (scanresp->nr_sets <= 0) - { - //printk("0 AP was found.\n"); - return 0; - } - -#if 0 - printk("Iterating network_list: \n"); - list_for_each_entry (iter_bss, &priv->network_list, list) { - unsigned long stale_time = iter_bss->last_scanned + 10 * DEFAULT_MAX_SCAN_AGE; - printk(" SSID: %15s BSSID: %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x ", - iter_bss->ssid, - iter_bss->bssid[0], iter_bss->bssid[1], iter_bss->bssid[2], - iter_bss->bssid[3], iter_bss->bssid[4], iter_bss->bssid[5]); - if (time_before(jiffies, stale_time)) - printk("Not timeout\n"); - else - printk("Timeout\n"); - } -#endif - /* Prune old entries from scan table */ - list_for_each_entry_safe (iter_bss, safe, &priv->network_list, list) - { - unsigned long stale_time = iter_bss->last_scanned + DEFAULT_MAX_SCAN_AGE; - if (time_before(jiffies, stale_time)) - continue; - list_move_tail (&iter_bss->list, &priv->network_free_list); - clear_bss_descriptor(iter_bss); - } -#if 0 - printk("Iterating network_free_list: \n"); - list_for_each_entry (iter_bss, &priv->network_free_list, list) { - if (strlen(iter_bss->ssid) <= 0) - continue; - printk(" SSID: %15s BSSID: %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x ", - iter_bss->ssid, - iter_bss->bssid[0], iter_bss->bssid[1], iter_bss->bssid[2], - iter_bss->bssid[3], iter_bss->bssid[4], iter_bss->bssid[5]); - printk("Timeout\n"); - } -#endif - if (scanresp->nr_sets > MAX_NETWORK_COUNT) { - lbs_deb_scan("SCAN_RESP: too many scan results (%d, max %d)\n", - scanresp->nr_sets, MAX_NETWORK_COUNT); - ret = -1; - goto done; - } - - bytesleft = le16_to_cpu(scanresp->bssdescriptsize); - lbs_deb_scan("SCAN_RESP: bssdescriptsize %d\n", bytesleft); - - scanrespsize = le16_to_cpu(resp->size); - lbs_deb_scan("SCAN_RESP: scan results %d\n", scanresp->nr_sets); - - bssinfo = scanresp->bssdesc_and_tlvbuffer; - - /* The size of the TLV buffer is equal to the entire command response - * size (scanrespsize) minus the fixed fields (sizeof()'s), the - * BSS Descriptions (bssdescriptsize as bytesLef) and the command - * response header (S_DS_GEN) - */ - tlvbufsize = scanrespsize - (bytesleft + sizeof(scanresp->bssdescriptsize) - + sizeof(scanresp->nr_sets) - + S_DS_GEN); - - /* - * Process each scan response returned (scanresp->nr_sets). Save - * the information in the newbssentry and then insert into the - * driver scan table either as an update to an existing entry - * or as an addition at the end of the table - */ - //printk("Dump scanned SSIDs: num=%d\n", scanresp->nr_sets); - for (idx = 0; idx < scanresp->nr_sets && bytesleft; idx++) - { - struct bss_descriptor new; - struct bss_descriptor *found = NULL; - struct bss_descriptor *oldest = NULL; - - /* Process the data fields and IEs returned for this BSS */ - memset(&new, 0, sizeof (struct bss_descriptor)); - if (lbs_process_bss(&new, &bssinfo, &bytesleft) != 0) { - /* error parsing the scan response, skipped */ - lbs_deb_scan("SCAN_RESP: process_bss returned ERROR\n"); - continue; - } - //printk(" Found SSID: %15s BSSID: %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", - // new.ssid, - // new.bssid[0], new.bssid[1], new.bssid[2], - // new.bssid[3], new.bssid[4], new.bssid[5]); - if (strlen(new.ssid) <= 0) - continue; - - /* Try to find this bss in the scan table */ - list_for_each_entry (iter_bss, &priv->network_list, list) { - if (is_same_network(iter_bss, &new)) { - found = iter_bss; - break; - } - - if ((oldest == NULL) || - (iter_bss->last_scanned < oldest->last_scanned)) - oldest = iter_bss; - } - - if (found) { - /* found, clear it */ - clear_bss_descriptor(found); - } else if (!list_empty(&priv->network_free_list)) { - /* Pull one from the free list */ - found = list_entry(priv->network_free_list.next, - struct bss_descriptor, list); - list_move_tail(&found->list, &priv->network_list); - } else if (oldest) { - /* If there are no more slots, expire the oldest */ - found = oldest; - clear_bss_descriptor(found); - list_move_tail(&found->list, &priv->network_list); - } else { - continue; - } - - lbs_deb_scan("SCAN_RESP: BSSID %pM\n", new.bssid); - - /* Copy the locally created newbssentry to the scan table */ - memcpy(found, &new, offsetof(struct bss_descriptor, list)); - } - -#if 0 - if (priv->scan_result_timeout == 0) - { - union iwreq_data rwrqu; - - memset(&rwrqu, 0, sizeof(union iwreq_data)); - wireless_send_event(priv->dev, SIOCGIWSCAN, &rwrqu, NULL); - } -#endif - - ret = 0; - -done: - lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", ret); - return ret; -} diff --git a/drivers/net/wireless/mv8686/scan.h b/drivers/net/wireless/mv8686/scan.h deleted file mode 100755 index fab7d5d097fc..000000000000 --- a/drivers/net/wireless/mv8686/scan.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Interface for the wlan network scan routines - * - * Driver interface functions and type declarations for the scan module - * implemented in scan.c. - */ -#ifndef _LBS_SCAN_H -#define _LBS_SCAN_H - -#include - -#define MAX_NETWORK_COUNT 128 - -/** - * @brief Maximum number of channels that can be sent in a setuserscan ioctl - */ -#define LBS_IOCTL_USER_SCAN_CHAN_MAX 50 - -int lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len); - -int lbs_send_specific_ssid_scan(struct lbs_private *priv, u8 *ssid, - u8 ssid_len); - -int lbs_get_scan(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra); -int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, - union iwreq_data *wrqu, char *extra); - -int lbs_scan_networks(struct lbs_private *priv, int full_scan); - -void lbs_scan_worker(struct work_struct *work); - -#endif diff --git a/drivers/net/wireless/mv8686/tx.c b/drivers/net/wireless/mv8686/tx.c deleted file mode 100755 index 8f8ab141e085..000000000000 --- a/drivers/net/wireless/mv8686/tx.c +++ /dev/null @@ -1,179 +0,0 @@ -/** - * This file contains the handling of TX in wlan driver. - */ -#include -#include - -#include "hostcmd.h" -#include "radiotap.h" -#include "decl.h" -#include "defs.h" -#include "dev.h" -#include "wext.h" - -/** - * @brief This function checks the conditions and sends packet to IF - * layer if everything is ok. - * - * @param priv A pointer to struct lbs_private structure - * @param skb A pointer to skb which includes TX packet - * @return 0 or -1 - */ -#if (NEW_MV8686_PS == 1) -extern unsigned long wifi_iptx_packets; -#endif - -int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) -{ - unsigned long flags; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - struct txpd *txpd; - char *p802x_hdr; - uint16_t pkt_len; - int ret; - - lbs_deb_enter(LBS_DEB_TX); - -#if (ANDROID_POWER_SAVE == 1) - - if (priv->deepsleep == false) - lbs_update_ps_timer(); - else - { - if (priv->wifi_ps_work_req == 0) - { - printk("Need to wakeup for xmit: ether_proto=%x.\n", skb->protocol); - priv->wifi_ps_work_req = WIFI_PS_PRE_WAKE; - /* - * If no netif_carrier_off, upper layer will try again, - * and this may cause tx timeout and trigger watchdog. - */ - netif_stop_queue(priv->dev); - netif_carrier_off(priv->dev); - queue_delayed_work(priv->work_thread, &priv->ps_work, - msecs_to_jiffies(5)); - } - return NETDEV_TX_BUSY; - } -#endif - - ret = NETDEV_TX_OK; - - /* We need to protect against the queues being restarted before - we get round to stopping them */ - spin_lock_irqsave(&priv->driver_lock, flags); - - if (priv->surpriseremoved) - goto free; - - if (!skb->len || (skb->len > MRVDRV_ETH_TX_PACKET_BUFFER_SIZE)) { - lbs_deb_tx("tx err: skb length %d 0 or > %zd\n", - skb->len, MRVDRV_ETH_TX_PACKET_BUFFER_SIZE); - /* We'll never manage to send this one; drop it and return 'OK' */ - - dev->stats.tx_dropped++; - dev->stats.tx_errors++; - goto free; - } - - - netif_stop_queue(priv->dev); - - if (priv->tx_pending_len) { - /* This can happen if packets come in on the mesh and eth - device simultaneously -- there's no mutual exclusion on - hard_start_xmit() calls between devices. */ - lbs_deb_tx("Packet on %s while busy\n", dev->name); - ret = NETDEV_TX_BUSY; - goto unlock; - } - - priv->tx_pending_len = -1; - spin_unlock_irqrestore(&priv->driver_lock, flags); - - lbs_deb_hex(LBS_DEB_TX, "TX Data", skb->data, min_t(unsigned int, skb->len, 100)); - - txpd = (void *)priv->tx_pending_buf; - memset(txpd, 0, sizeof(struct txpd)); - - p802x_hdr = skb->data; - pkt_len = skb->len; - - /* copy destination address from 802.3 header */ - memcpy(txpd->tx_dest_addr_high, p802x_hdr, ETH_ALEN); - - txpd->tx_packet_length = cpu_to_le16(pkt_len); - txpd->tx_packet_location = cpu_to_le32(sizeof(struct txpd)); - - lbs_deb_hex(LBS_DEB_TX, "txpd", (u8 *) &txpd, sizeof(struct txpd)); - - lbs_deb_hex(LBS_DEB_TX, "Tx Data", (u8 *) p802x_hdr, le16_to_cpu(txpd->tx_packet_length)); - - memcpy(&txpd[1], p802x_hdr, le16_to_cpu(txpd->tx_packet_length)); - - spin_lock_irqsave(&priv->driver_lock, flags); - priv->tx_pending_len = pkt_len + sizeof(struct txpd); - - lbs_deb_tx("%s lined up packet\n", __func__); - -#if (NEW_MV8686_PS == 1) - if (skb->protocol == 0x0008) //ETH_P_IP - wifi_iptx_packets++; - //else - // printk("Send a not IP packet: %x\n", skb->protocol); -#endif - - dev->stats.tx_packets++; - dev->stats.tx_bytes += skb->len; - - dev->trans_start = jiffies; - - if (priv->monitormode) { - /* Keep the skb to echo it back once Tx feedback is - received from FW */ - skb_orphan(skb); - - /* Keep the skb around for when we get feedback */ - priv->currenttxskb = skb; - } else { - free: - dev_kfree_skb_any(skb); - } - unlock: - spin_unlock_irqrestore(&priv->driver_lock, flags); - wake_up(&priv->waitq); - - lbs_deb_leave_args(LBS_DEB_TX, "ret %d", ret); - return ret; -} - -/** - * @brief This function sends to the host the last transmitted packet, - * filling the radiotap headers with transmission information. - * - * @param priv A pointer to struct lbs_private structure - * @param status A 32 bit value containing transmission status. - * - * @returns void - */ -void lbs_send_tx_feedback(struct lbs_private *priv, u32 try_count) -{ - struct tx_radiotap_hdr *radiotap_hdr; - - if (!priv->monitormode || priv->currenttxskb == NULL) - return; - - radiotap_hdr = (struct tx_radiotap_hdr *)priv->currenttxskb->data; - - radiotap_hdr->data_retries = try_count ? - (1 + priv->txretrycount - try_count) : 0; - - netif_rx(priv->currenttxskb); - - priv->currenttxskb = NULL; - - if (priv->connect_status == LBS_CONNECTED) - netif_wake_queue(priv->dev); - -} -EXPORT_SYMBOL_GPL(lbs_send_tx_feedback); diff --git a/drivers/net/wireless/mv8686/types.h b/drivers/net/wireless/mv8686/types.h deleted file mode 100755 index fb7a2d1a2525..000000000000 --- a/drivers/net/wireless/mv8686/types.h +++ /dev/null @@ -1,284 +0,0 @@ -/** - * This header file contains definition for global types - */ -#ifndef _LBS_TYPES_H_ -#define _LBS_TYPES_H_ - -#include -#include -#include - -struct ieeetypes_cfparamset { - u8 elementid; - u8 len; - u8 cfpcnt; - u8 cfpperiod; - __le16 cfpmaxduration; - __le16 cfpdurationremaining; -} __attribute__ ((packed)); - - -struct ieeetypes_ibssparamset { - u8 elementid; - u8 len; - __le16 atimwindow; -} __attribute__ ((packed)); - -union IEEEtypes_ssparamset { - struct ieeetypes_cfparamset cfparamset; - struct ieeetypes_ibssparamset ibssparamset; -} __attribute__ ((packed)); - -struct ieeetypes_fhparamset { - u8 elementid; - u8 len; - __le16 dwelltime; - u8 hopset; - u8 hoppattern; - u8 hopindex; -} __attribute__ ((packed)); - -struct ieeetypes_dsparamset { - u8 elementid; - u8 len; - u8 currentchan; -} __attribute__ ((packed)); - -union ieeetypes_phyparamset { - struct ieeetypes_fhparamset fhparamset; - struct ieeetypes_dsparamset dsparamset; -} __attribute__ ((packed)); - -struct ieeetypes_assocrsp { - __le16 capability; - __le16 statuscode; - __le16 aid; - u8 iebuffer[1]; -} __attribute__ ((packed)); - -/** TLV type ID definition */ -#define PROPRIETARY_TLV_BASE_ID 0x0100 - -/* Terminating TLV type */ -#define MRVL_TERMINATE_TLV_ID 0xffff - -#define TLV_TYPE_SSID 0x0000 -#define TLV_TYPE_RATES 0x0001 -#define TLV_TYPE_PHY_FH 0x0002 -#define TLV_TYPE_PHY_DS 0x0003 -#define TLV_TYPE_CF 0x0004 -#define TLV_TYPE_IBSS 0x0006 - -#define TLV_TYPE_DOMAIN 0x0007 - -#define TLV_TYPE_POWER_CAPABILITY 0x0021 - -#define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0) -#define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1) -#define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2) -#define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4) -#define TLV_TYPE_SNR_LOW (PROPRIETARY_TLV_BASE_ID + 5) -#define TLV_TYPE_FAILCOUNT (PROPRIETARY_TLV_BASE_ID + 6) -#define TLV_TYPE_BCNMISS (PROPRIETARY_TLV_BASE_ID + 7) -#define TLV_TYPE_LED_GPIO (PROPRIETARY_TLV_BASE_ID + 8) -#define TLV_TYPE_LEDBEHAVIOR (PROPRIETARY_TLV_BASE_ID + 9) -#define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10) -#define TLV_TYPE_REASSOCAP (PROPRIETARY_TLV_BASE_ID + 11) -#define TLV_TYPE_POWER_TBL_2_4GHZ (PROPRIETARY_TLV_BASE_ID + 12) -#define TLV_TYPE_POWER_TBL_5GHZ (PROPRIETARY_TLV_BASE_ID + 13) -#define TLV_TYPE_BCASTPROBE (PROPRIETARY_TLV_BASE_ID + 14) -#define TLV_TYPE_NUMSSID_PROBE (PROPRIETARY_TLV_BASE_ID + 15) -#define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16) -#define TLV_TYPE_CRYPTO_DATA (PROPRIETARY_TLV_BASE_ID + 17) -#define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18) -#define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19) -#define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22) -#define TLV_TYPE_SNR_HIGH (PROPRIETARY_TLV_BASE_ID + 23) - -/** TLV related data structures*/ -struct mrvlietypesheader { - __le16 type; - __le16 len; -} __attribute__ ((packed)); - -struct mrvlietypes_data { - struct mrvlietypesheader header; - u8 Data[1]; -} __attribute__ ((packed)); - -struct mrvlietypes_ratesparamset { - struct mrvlietypesheader header; - u8 rates[1]; -} __attribute__ ((packed)); - -struct mrvlietypes_ssidparamset { - struct mrvlietypesheader header; - u8 ssid[1]; -} __attribute__ ((packed)); - -struct mrvlietypes_wildcardssidparamset { - struct mrvlietypesheader header; - u8 MaxSsidlength; - u8 ssid[1]; -} __attribute__ ((packed)); - -struct chanscanmode { -#ifdef __BIG_ENDIAN_BITFIELD - u8 reserved_2_7:6; - u8 disablechanfilt:1; - u8 passivescan:1; -#else - u8 passivescan:1; - u8 disablechanfilt:1; - u8 reserved_2_7:6; -#endif -} __attribute__ ((packed)); - -struct chanscanparamset { - u8 radiotype; - u8 channumber; - struct chanscanmode chanscanmode; - __le16 minscantime; - __le16 maxscantime; -} __attribute__ ((packed)); - -struct mrvlietypes_chanlistparamset { - struct mrvlietypesheader header; - struct chanscanparamset chanscanparam[1]; -} __attribute__ ((packed)); - -struct cfparamset { - u8 cfpcnt; - u8 cfpperiod; - __le16 cfpmaxduration; - __le16 cfpdurationremaining; -} __attribute__ ((packed)); - -struct ibssparamset { - __le16 atimwindow; -} __attribute__ ((packed)); - -struct mrvlietypes_ssparamset { - struct mrvlietypesheader header; - union { - struct cfparamset cfparamset[1]; - struct ibssparamset ibssparamset[1]; - } cf_ibss; -} __attribute__ ((packed)); - -struct fhparamset { - __le16 dwelltime; - u8 hopset; - u8 hoppattern; - u8 hopindex; -} __attribute__ ((packed)); - -struct dsparamset { - u8 currentchan; -} __attribute__ ((packed)); - -struct mrvlietypes_phyparamset { - struct mrvlietypesheader header; - union { - struct fhparamset fhparamset[1]; - struct dsparamset dsparamset[1]; - } fh_ds; -} __attribute__ ((packed)); - -struct mrvlietypes_rsnparamset { - struct mrvlietypesheader header; - u8 rsnie[1]; -} __attribute__ ((packed)); - -struct mrvlietypes_tsftimestamp { - struct mrvlietypesheader header; - __le64 tsftable[1]; -} __attribute__ ((packed)); - -/** Local Power capability */ -struct mrvlietypes_powercapability { - struct mrvlietypesheader header; - s8 minpower; - s8 maxpower; -} __attribute__ ((packed)); - -/* used in CMD_802_11_SUBSCRIBE_EVENT for SNR, RSSI and Failure */ -struct mrvlietypes_thresholds { - struct mrvlietypesheader header; - u8 value; - u8 freq; -} __attribute__ ((packed)); - -struct mrvlietypes_beaconsmissed { - struct mrvlietypesheader header; - u8 beaconmissed; - u8 reserved; -} __attribute__ ((packed)); - -struct mrvlietypes_numprobes { - struct mrvlietypesheader header; - __le16 numprobes; -} __attribute__ ((packed)); - -struct mrvlietypes_bcastprobe { - struct mrvlietypesheader header; - __le16 bcastprobe; -} __attribute__ ((packed)); - -struct mrvlietypes_numssidprobe { - struct mrvlietypesheader header; - __le16 numssidprobe; -} __attribute__ ((packed)); - -struct led_pin { - u8 led; - u8 pin; -} __attribute__ ((packed)); - -struct mrvlietypes_ledgpio { - struct mrvlietypesheader header; - struct led_pin ledpin[1]; -} __attribute__ ((packed)); - -struct led_bhv { - uint8_t firmwarestate; - uint8_t led; - uint8_t ledstate; - uint8_t ledarg; -} __attribute__ ((packed)); - - -struct mrvlietypes_ledbhv { - struct mrvlietypesheader header; - struct led_bhv ledbhv[1]; -} __attribute__ ((packed)); - -/* Meant to be packed as the value member of a struct ieee80211_info_element. - * Note that the len member of the ieee80211_info_element varies depending on - * the mesh_id_len */ -struct mrvl_meshie_val { - uint8_t oui[3]; - uint8_t type; - uint8_t subtype; - uint8_t version; - uint8_t active_protocol_id; - uint8_t active_metric_id; - uint8_t mesh_capability; - uint8_t mesh_id_len; - uint8_t mesh_id[IW_ESSID_MAX_SIZE]; -} __attribute__ ((packed)); - -struct mrvl_meshie { - u8 id, len; - struct mrvl_meshie_val val; -} __attribute__ ((packed)); - -struct mrvl_mesh_defaults { - __le32 bootflag; - uint8_t boottime; - uint8_t reserved; - __le16 channel; - struct mrvl_meshie meshie; -} __attribute__ ((packed)); - -#endif diff --git a/drivers/net/wireless/mv8686/wext.c b/drivers/net/wireless/mv8686/wext.c deleted file mode 100755 index 3a74a90f4ad9..000000000000 --- a/drivers/net/wireless/mv8686/wext.c +++ /dev/null @@ -1,2263 +0,0 @@ -/** - * This file contains ioctl functions - */ -#include -#include -#include -#include -#include -#include -#include - -#include "lib80211.h" -#include - -#include "host.h" -#include "radiotap.h" -#include "decl.h" -#include "defs.h" -#include "dev.h" -#include "wext.h" -#include "scan.h" -#include "assoc.h" -#include "cmd.h" - -#include "iwpriv.h" - -/* - * Defined in main.c - */ -extern atomic_t reassoc_flag; - -static inline void lbs_postpone_association_work(struct lbs_private *priv) -{ - if (priv->surpriseremoved) - return; - - cancel_delayed_work(&priv->assoc_work); - queue_delayed_work(priv->work_thread, &priv->assoc_work, HZ / 2); -} - -static inline void lbs_do_association_work(struct lbs_private *priv) -{ - if (priv->surpriseremoved) - return; - - cancel_delayed_work(&priv->assoc_work); - queue_delayed_work(priv->work_thread, &priv->assoc_work, 0); -} - -static inline void lbs_cancel_association_work(struct lbs_private *priv) -{ - cancel_delayed_work(&priv->assoc_work); - if (priv->pending_assoc_req != NULL) - kfree(priv->pending_assoc_req); - priv->pending_assoc_req = NULL; -} - - -/** - * @brief Find the channel frequency power info with specific channel - * - * @param priv A pointer to struct lbs_private structure - * @param band it can be BAND_A, BAND_G or BAND_B - * @param channel the channel for looking - * @return A pointer to struct chan_freq_power structure or NULL if not find. - */ -struct chan_freq_power *lbs_find_cfp_by_band_and_channel( - struct lbs_private *priv, u8 band, u16 channel) -{ - struct chan_freq_power *cfp = NULL; - struct region_channel *rc; - int i, j; - - for (j = 0; !cfp && (j < ARRAY_SIZE(priv->region_channel)); j++) - { - rc = &priv->region_channel[j]; - - if (priv->enable11d) - rc = &priv->universal_channel[j]; - if (!rc->valid || !rc->CFP) - continue; - if (rc->band != band) - continue; - for (i = 0; i < rc->nrcfp; i++) { - if (rc->CFP[i].channel == channel) { - cfp = &rc->CFP[i]; - break; - } - } - } - - if (!cfp && channel) - lbs_deb_wext("lbs_find_cfp_by_band_and_channel: can't find " - "cfp by band %d / channel %d\n", band, channel); - - return cfp; -} - -/** - * @brief Find the channel frequency power info with specific frequency - * - * @param priv A pointer to struct lbs_private structure - * @param band it can be BAND_A, BAND_G or BAND_B - * @param freq the frequency for looking - * @return A pointer to struct chan_freq_power structure or NULL if not find. - */ -static struct chan_freq_power *find_cfp_by_band_and_freq( - struct lbs_private *priv, - u8 band, - u32 freq) -{ - struct chan_freq_power *cfp = NULL; - struct region_channel *rc; - int i, j; - - for (j = 0; !cfp && (j < ARRAY_SIZE(priv->region_channel)); j++) { - rc = &priv->region_channel[j]; - - if (priv->enable11d) - rc = &priv->universal_channel[j]; - if (!rc->valid || !rc->CFP) - continue; - if (rc->band != band) - continue; - for (i = 0; i < rc->nrcfp; i++) { - if (rc->CFP[i].freq == freq) { - cfp = &rc->CFP[i]; - break; - } - } - } - - if (!cfp && freq) - lbs_deb_wext("find_cfp_by_band_and_freql: can't find cfp by " - "band %d / freq %d\n", band, freq); - - return cfp; -} - -/** - * @brief Copy active data rates based on adapter mode and status - * - * @param priv A pointer to struct lbs_private structure - * @param rate The buf to return the active rates - */ -static void copy_active_data_rates(struct lbs_private *priv, u8 *rates) -{ - lbs_deb_enter(LBS_DEB_WEXT); - - if (priv->connect_status != LBS_CONNECTED) - memcpy(rates, lbs_bg_rates, MAX_RATES); - else - memcpy(rates, priv->curbssparams.rates, MAX_RATES); - - lbs_deb_leave(LBS_DEB_WEXT); -} - -static int lbs_get_name(struct net_device *dev, struct iw_request_info *info, - char *cwrq, char *extra) -{ - lbs_deb_enter(LBS_DEB_WEXT); - - /* We could add support for 802.11n here as needed. Jean II */ - snprintf(cwrq, IFNAMSIZ, "IEEE 802.11b/g"); - - lbs_deb_leave(LBS_DEB_WEXT); - - return 0; -} - -static int lbs_get_freq(struct net_device *dev, struct iw_request_info *info, - struct iw_freq *fwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - struct chan_freq_power *cfp; - - lbs_deb_enter(LBS_DEB_WEXT); - - cfp = lbs_find_cfp_by_band_and_channel(priv, 0, - priv->curbssparams.channel); - - if (!cfp) { - if (priv->curbssparams.channel) - lbs_deb_wext("invalid channel %d\n", - priv->curbssparams.channel); - return -EINVAL; - } - - fwrq->m = (long)cfp->freq * 100000; - fwrq->e = 1; - - lbs_deb_wext("freq %u\n", fwrq->m); - lbs_deb_leave(LBS_DEB_WEXT); - return 0; -} - -static int lbs_get_wap(struct net_device *dev, struct iw_request_info *info, - struct sockaddr *awrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - - lbs_deb_enter(LBS_DEB_WEXT); - - if (priv->connect_status == LBS_CONNECTED) { - memcpy(awrq->sa_data, priv->curbssparams.bssid, ETH_ALEN); - } else { - memset(awrq->sa_data, 0, ETH_ALEN); - } - awrq->sa_family = ARPHRD_ETHER; - - lbs_deb_leave(LBS_DEB_WEXT); - return 0; -} - -static int lbs_set_nick(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - - lbs_deb_enter(LBS_DEB_WEXT); - - /* - * Check the size of the string - */ - - if (dwrq->length > 16) { - return -E2BIG; - } - - mutex_lock(&priv->lock); - memset(priv->nodename, 0, sizeof(priv->nodename)); - memcpy(priv->nodename, extra, dwrq->length); - mutex_unlock(&priv->lock); - - lbs_deb_leave(LBS_DEB_WEXT); - return 0; -} - -static int lbs_get_nick(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - - lbs_deb_enter(LBS_DEB_WEXT); - - dwrq->length = strlen(priv->nodename); - memcpy(extra, priv->nodename, dwrq->length); - extra[dwrq->length] = '\0'; - - dwrq->flags = 1; /* active */ - - lbs_deb_leave(LBS_DEB_WEXT); - return 0; -} - -static int lbs_set_rts(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - int ret = 0; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - u32 val = vwrq->value; - - lbs_deb_enter(LBS_DEB_WEXT); - - if (vwrq->disabled) - val = MRVDRV_RTS_MAX_VALUE; - - if (val > MRVDRV_RTS_MAX_VALUE) /* min rts value is 0 */ - return -EINVAL; - - ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_RTS_THRESHOLD, (u16) val); - - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -static int lbs_get_rts(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - int ret = 0; - u16 val = 0; - - lbs_deb_enter(LBS_DEB_WEXT); - - ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_RTS_THRESHOLD, &val); - if (ret) - goto out; - - vwrq->value = val; - vwrq->disabled = val > MRVDRV_RTS_MAX_VALUE; /* min rts value is 0 */ - vwrq->fixed = 1; - -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -static int lbs_set_frag(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - int ret = 0; - u32 val = vwrq->value; - - lbs_deb_enter(LBS_DEB_WEXT); - - if (vwrq->disabled) - val = MRVDRV_FRAG_MAX_VALUE; - - if (val < MRVDRV_FRAG_MIN_VALUE || val > MRVDRV_FRAG_MAX_VALUE) - return -EINVAL; - - ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_FRAG_THRESHOLD, (u16) val); - - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -static int lbs_get_frag(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - int ret = 0; - u16 val = 0; - - lbs_deb_enter(LBS_DEB_WEXT); - - ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_FRAG_THRESHOLD, &val); - if (ret) - goto out; - - vwrq->value = val; - vwrq->disabled = ((val < MRVDRV_FRAG_MIN_VALUE) - || (val > MRVDRV_FRAG_MAX_VALUE)); - vwrq->fixed = 1; - -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -static int lbs_get_mode(struct net_device *dev, - struct iw_request_info *info, u32 * uwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - - lbs_deb_enter(LBS_DEB_WEXT); - - *uwrq = priv->mode; - - lbs_deb_leave(LBS_DEB_WEXT); - return 0; -} - -static int lbs_get_txpow(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - s16 curlevel = 0; - int ret = 0; - - lbs_deb_enter(LBS_DEB_WEXT); - - if (!priv->radio_on) { - lbs_deb_wext("tx power off\n"); - vwrq->value = 0; - vwrq->disabled = 1; - goto out; - } - - ret = lbs_get_tx_power(priv, &curlevel, NULL, NULL); - if (ret) - goto out; - - lbs_deb_wext("tx power level %d dbm\n", curlevel); - priv->txpower_cur = curlevel; - - vwrq->value = curlevel; - vwrq->fixed = 1; - vwrq->disabled = 0; - vwrq->flags = IW_TXPOW_DBM; - -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -static int lbs_set_retry(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - int ret = 0; - u16 slimit = 0, llimit = 0; - - lbs_deb_enter(LBS_DEB_WEXT); - - if ((vwrq->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT) - return -EOPNOTSUPP; - - /* The MAC has a 4-bit Total_Tx_Count register - Total_Tx_Count = 1 + Tx_Retry_Count */ -#define TX_RETRY_MIN 0 -#define TX_RETRY_MAX 14 - if (vwrq->value < TX_RETRY_MIN || vwrq->value > TX_RETRY_MAX) - return -EINVAL; - - /* Add 1 to convert retry count to try count */ - if (vwrq->flags & IW_RETRY_SHORT) - slimit = (u16) (vwrq->value + 1); - else if (vwrq->flags & IW_RETRY_LONG) - llimit = (u16) (vwrq->value + 1); - else - slimit = llimit = (u16) (vwrq->value + 1); /* set both */ - - if (llimit) { - ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_LONG_RETRY_LIMIT, - llimit); - if (ret) - goto out; - } - - if (slimit) { - /* txretrycount follows the short retry limit */ - priv->txretrycount = slimit; - ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_SHORT_RETRY_LIMIT, - slimit); - if (ret) - goto out; - } - -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -static int lbs_get_retry(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - int ret = 0; - u16 val = 0; - - lbs_deb_enter(LBS_DEB_WEXT); - - vwrq->disabled = 0; - - if (vwrq->flags & IW_RETRY_LONG) { - ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_LONG_RETRY_LIMIT, &val); - if (ret) - goto out; - - /* Subtract 1 to convert try count to retry count */ - vwrq->value = val - 1; - vwrq->flags = IW_RETRY_LIMIT | IW_RETRY_LONG; - } else { - ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_SHORT_RETRY_LIMIT, &val); - if (ret) - goto out; - - /* txretry count follows the short retry limit */ - priv->txretrycount = val; - /* Subtract 1 to convert try count to retry count */ - vwrq->value = val - 1; - vwrq->flags = IW_RETRY_LIMIT | IW_RETRY_SHORT; - } - -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -static inline void sort_channels(struct iw_freq *freq, int num) -{ - int i, j; - struct iw_freq temp; - - for (i = 0; i < num; i++) - for (j = i + 1; j < num; j++) - if (freq[i].i > freq[j].i) { - temp.i = freq[i].i; - temp.m = freq[i].m; - - freq[i].i = freq[j].i; - freq[i].m = freq[j].m; - - freq[j].i = temp.i; - freq[j].m = temp.m; - } -} - -/* data rate listing - MULTI_BANDS: - abg a b b/g - Infra G(12) A(8) B(4) G(12) - Adhoc A+B(12) A(8) B(4) B(4) - - non-MULTI_BANDS: - b b/g - Infra B(4) G(12) - Adhoc B(4) B(4) - */ -/** - * @brief Get Range Info - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param vwrq A pointer to iw_param structure - * @param extra A pointer to extra data buf - * @return 0 --success, otherwise fail - */ -static int lbs_get_range(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ - int i, j; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - struct iw_range *range = (struct iw_range *)extra; - struct chan_freq_power *cfp; - u8 rates[MAX_RATES + 1]; - - u8 flag = 0; - - lbs_deb_enter(LBS_DEB_WEXT); - - dwrq->length = sizeof(struct iw_range); - memset(range, 0, sizeof(struct iw_range)); - - range->min_nwid = 0; - range->max_nwid = 0; - - memset(rates, 0, sizeof(rates)); - copy_active_data_rates(priv, rates); - range->num_bitrates = strnlen(rates, IW_MAX_BITRATES); - for (i = 0; i < range->num_bitrates; i++) - range->bitrate[i] = rates[i] * 500000; - range->num_bitrates = i; - lbs_deb_wext("IW_MAX_BITRATES %d, num_bitrates %d\n", IW_MAX_BITRATES, - range->num_bitrates); - - range->num_frequency = 0; - - range->scan_capa = IW_SCAN_CAPA_ESSID; - - if (priv->enable11d && - (priv->connect_status == LBS_CONNECTED)) { - u8 chan_no; - u8 band; - - struct parsed_region_chan_11d *parsed_region_chan = - &priv->parsed_region_chan; - - if (parsed_region_chan == NULL) { - lbs_deb_wext("11d: parsed_region_chan is NULL\n"); - goto out; - } - band = parsed_region_chan->band; - lbs_deb_wext("band %d, nr_char %d\n", band, - parsed_region_chan->nr_chan); - - for (i = 0; (range->num_frequency < IW_MAX_FREQUENCIES) - && (i < parsed_region_chan->nr_chan); i++) { - chan_no = parsed_region_chan->chanpwr[i].chan; - lbs_deb_wext("chan_no %d\n", chan_no); - range->freq[range->num_frequency].i = (long)chan_no; - range->freq[range->num_frequency].m = - (long)lbs_chan_2_freq(chan_no) * 100000; - range->freq[range->num_frequency].e = 1; - range->num_frequency++; - } - flag = 1; - } - if (!flag) { - for (j = 0; (range->num_frequency < IW_MAX_FREQUENCIES) - && (j < ARRAY_SIZE(priv->region_channel)); j++) { - cfp = priv->region_channel[j].CFP; - for (i = 0; (range->num_frequency < IW_MAX_FREQUENCIES) - && priv->region_channel[j].valid - && cfp - && (i < priv->region_channel[j].nrcfp); i++) { - range->freq[range->num_frequency].i = - (long)cfp->channel; - range->freq[range->num_frequency].m = - (long)cfp->freq * 100000; - range->freq[range->num_frequency].e = 1; - cfp++; - range->num_frequency++; - } - } - } - - lbs_deb_wext("IW_MAX_FREQUENCIES %d, num_frequency %d\n", - IW_MAX_FREQUENCIES, range->num_frequency); - - range->num_channels = range->num_frequency; - - sort_channels(&range->freq[0], range->num_frequency); - - /* - * Set an indication of the max TCP throughput in bit/s that we can - * expect using this interface - */ - if (i > 2) - range->throughput = 5000 * 1000; - else - range->throughput = 1500 * 1000; - - range->min_rts = MRVDRV_RTS_MIN_VALUE; - range->max_rts = MRVDRV_RTS_MAX_VALUE; - range->min_frag = MRVDRV_FRAG_MIN_VALUE; - range->max_frag = MRVDRV_FRAG_MAX_VALUE; - - range->encoding_size[0] = 5; - range->encoding_size[1] = 13; - range->num_encoding_sizes = 2; - range->max_encoding_tokens = 4; - - /* - * Right now we support only "iwconfig ethX power on|off" - */ - range->pm_capa = IW_POWER_ON; - - /* - * Minimum version we recommend - */ - range->we_version_source = 15; - - /* - * Version we are compiled with - */ - range->we_version_compiled = WIRELESS_EXT; - - range->retry_capa = IW_RETRY_LIMIT; - range->retry_flags = IW_RETRY_LIMIT | IW_RETRY_MAX; - - range->min_retry = TX_RETRY_MIN; - range->max_retry = TX_RETRY_MAX; - - /* - * Set the qual, level and noise range values - */ - range->max_qual.qual = 100; - range->max_qual.level = 0; - range->max_qual.noise = 0; - range->max_qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; - - range->avg_qual.qual = 70; - /* TODO: Find real 'good' to 'bad' threshold value for RSSI */ - range->avg_qual.level = 0; - range->avg_qual.noise = 0; - range->avg_qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; - - range->sensitivity = 0; - - /* Setup the supported power level ranges */ - memset(range->txpower, 0, sizeof(range->txpower)); - range->txpower_capa = IW_TXPOW_DBM | IW_TXPOW_RANGE; - range->txpower[0] = priv->txpower_min; - range->txpower[1] = priv->txpower_max; - range->num_txpower = 2; - - range->event_capa[0] = (IW_EVENT_CAPA_K_0 | - IW_EVENT_CAPA_MASK(SIOCGIWAP) | - IW_EVENT_CAPA_MASK(SIOCGIWSCAN)); - range->event_capa[1] = IW_EVENT_CAPA_K_1; - - if (priv->fwcapinfo & FW_CAPINFO_WPA) { - range->enc_capa = IW_ENC_CAPA_WPA - | IW_ENC_CAPA_WPA2 - | IW_ENC_CAPA_CIPHER_TKIP - | IW_ENC_CAPA_CIPHER_CCMP; - } - -out: - lbs_deb_leave(LBS_DEB_WEXT); - return 0; -} - -static int lbs_set_power(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - - lbs_deb_enter(LBS_DEB_WEXT); - - if (!priv->ps_supported) { - if (vwrq->disabled) - return 0; - else - return -EINVAL; - } - - /* PS is currently supported only in Infrastructure mode - * Remove this check if it is to be supported in IBSS mode also - */ - - if (vwrq->disabled) { - priv->psmode = LBS802_11POWERMODECAM; - if (priv->psstate != PS_STATE_FULL_POWER) { - lbs_ps_wakeup(priv, CMD_OPTION_WAITFORRSP); - } - - return 0; - } - - if ((vwrq->flags & IW_POWER_TYPE) == IW_POWER_TIMEOUT) { - lbs_deb_wext( - "setting power timeout is not supported\n"); - return -EINVAL; - } else if ((vwrq->flags & IW_POWER_TYPE) == IW_POWER_PERIOD) { - lbs_deb_wext("setting power period not supported\n"); - return -EINVAL; - } - - if (priv->psmode != LBS802_11POWERMODECAM) { - return 0; - } - - priv->psmode = LBS802_11POWERMODEMAX_PSP; - - if (priv->connect_status == LBS_CONNECTED) { - lbs_ps_sleep(priv, CMD_OPTION_WAITFORRSP); - } - - lbs_deb_leave(LBS_DEB_WEXT); - - return 0; -} - -static int lbs_get_power(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - - lbs_deb_enter(LBS_DEB_WEXT); - - vwrq->value = 0; - vwrq->flags = 0; -#if (NEW_MV8686_PS == 1) - if (priv->psmode == LBS802_11POWERMODECAM) - vwrq->disabled = 1; - else - vwrq->disabled = 0; -#else - vwrq->disabled = priv->psmode == LBS802_11POWERMODECAM - || priv->connect_status == LBS_DISCONNECTED; -#endif - lbs_deb_leave(LBS_DEB_WEXT); - - return 0; -} - -static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev) -{ - enum { - POOR = 30, - FAIR = 60, - GOOD = 80, - VERY_GOOD = 90, - EXCELLENT = 95, - PERFECT = 100 - }; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - u32 rssi_qual; - u32 tx_qual; - u32 quality = 0; - int stats_valid = 0; - u8 rssi; - u32 tx_retries; - struct cmd_ds_802_11_get_log log; - - lbs_deb_enter(LBS_DEB_WEXT); - - priv->wstats.status = priv->mode; - - /* If we're not associated, all quality values are meaningless */ - if (priv->connect_status != LBS_CONNECTED) - goto out; - - /* Quality by RSSI */ - priv->wstats.qual.level = - CAL_RSSI(priv->SNR[TYPE_BEACON][TYPE_NOAVG], - priv->NF[TYPE_BEACON][TYPE_NOAVG]); - - if (priv->NF[TYPE_BEACON][TYPE_NOAVG] == 0) { - priv->wstats.qual.noise = MRVDRV_NF_DEFAULT_SCAN_VALUE; - } else { - priv->wstats.qual.noise = - CAL_NF(priv->NF[TYPE_BEACON][TYPE_NOAVG]); - } - - lbs_deb_wext("signal level %#x\n", priv->wstats.qual.level); - lbs_deb_wext("noise %#x\n", priv->wstats.qual.noise); - - rssi = priv->wstats.qual.level - priv->wstats.qual.noise; - if (rssi < 15) - rssi_qual = rssi * POOR / 10; - else if (rssi < 20) - rssi_qual = (rssi - 15) * (FAIR - POOR) / 5 + POOR; - else if (rssi < 30) - rssi_qual = (rssi - 20) * (GOOD - FAIR) / 5 + FAIR; - else if (rssi < 40) - rssi_qual = (rssi - 30) * (VERY_GOOD - GOOD) / - 10 + GOOD; - else - rssi_qual = (rssi - 40) * (PERFECT - VERY_GOOD) / - 10 + VERY_GOOD; - quality = rssi_qual; - - /* Quality by TX errors */ - priv->wstats.discard.retries = dev->stats.tx_errors; - - memset(&log, 0, sizeof(log)); - log.hdr.size = cpu_to_le16(sizeof(log)); - lbs_cmd_with_response(priv, CMD_802_11_GET_LOG, &log); - - tx_retries = le32_to_cpu(log.retry); - - if (tx_retries > 75) - tx_qual = (90 - tx_retries) * POOR / 15; - else if (tx_retries > 70) - tx_qual = (75 - tx_retries) * (FAIR - POOR) / 5 + POOR; - else if (tx_retries > 65) - tx_qual = (70 - tx_retries) * (GOOD - FAIR) / 5 + FAIR; - else if (tx_retries > 50) - tx_qual = (65 - tx_retries) * (VERY_GOOD - GOOD) / - 15 + GOOD; - else - tx_qual = (50 - tx_retries) * - (PERFECT - VERY_GOOD) / 50 + VERY_GOOD; - quality = min(quality, tx_qual); - - priv->wstats.discard.code = le32_to_cpu(log.wepundecryptable); - priv->wstats.discard.retries = tx_retries; - priv->wstats.discard.misc = le32_to_cpu(log.ackfailure); - - /* Calculate quality */ - priv->wstats.qual.qual = min_t(u8, quality, 100); - priv->wstats.qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; - stats_valid = 1; - - /* update stats asynchronously for future calls */ - lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0, - 0, 0, NULL); -out: - if (!stats_valid) { - priv->wstats.miss.beacon = 0; - priv->wstats.discard.retries = 0; - priv->wstats.qual.qual = 0; - priv->wstats.qual.level = 0; - priv->wstats.qual.noise = 0; - priv->wstats.qual.updated = IW_QUAL_ALL_UPDATED; - priv->wstats.qual.updated |= IW_QUAL_NOISE_INVALID | - IW_QUAL_QUAL_INVALID | IW_QUAL_LEVEL_INVALID; - } - - lbs_deb_leave(LBS_DEB_WEXT); - return &priv->wstats; - - -} - -static int lbs_set_freq(struct net_device *dev, struct iw_request_info *info, - struct iw_freq *fwrq, char *extra) -{ - int ret = -EINVAL; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - struct chan_freq_power *cfp; - struct assoc_request * assoc_req; - - lbs_deb_enter(LBS_DEB_WEXT); - - mutex_lock(&priv->lock); - assoc_req = lbs_get_association_request(priv); - if (!assoc_req) { - ret = -ENOMEM; - goto out; - } - - /* If setting by frequency, convert to a channel */ - if (fwrq->e == 1) { - long f = fwrq->m / 100000; - - cfp = find_cfp_by_band_and_freq(priv, 0, f); - if (!cfp) { - lbs_deb_wext("invalid freq %ld\n", f); - goto out; - } - - fwrq->e = 0; - fwrq->m = (int) cfp->channel; - } - - /* Setting by channel number */ - if (fwrq->m > 1000 || fwrq->e > 0) { - goto out; - } - - cfp = lbs_find_cfp_by_band_and_channel(priv, 0, fwrq->m); - if (!cfp) { - goto out; - } - - assoc_req->channel = fwrq->m; - ret = 0; - -out: - - if (ret == 0) { - set_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags); -#if (NEW_MV8686_PS == 0) - //printk("%s: call lbs_postpone_association_work\n", __func__); - lbs_postpone_association_work(priv); - } else { - lbs_cancel_association_work(priv); -#endif - } - - mutex_unlock(&priv->lock); - - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - u8 new_rate = 0; - int ret = -EINVAL; - u8 rates[MAX_RATES + 1]; - - lbs_deb_enter(LBS_DEB_WEXT); - lbs_deb_wext("vwrq->value %d\n", vwrq->value); - lbs_deb_wext("vwrq->fixed %d\n", vwrq->fixed); - - if (vwrq->fixed && vwrq->value == -1) - goto out; - - /* Auto rate? */ - priv->enablehwauto = !vwrq->fixed; - - if (vwrq->value == -1) - priv->cur_rate = 0; - else { - if (vwrq->value % 100000) - goto out; - - new_rate = vwrq->value / 500000; - priv->cur_rate = new_rate; - /* the rest is only needed for lbs_set_data_rate() */ - memset(rates, 0, sizeof(rates)); - copy_active_data_rates(priv, rates); - if (!memchr(rates, new_rate, sizeof(rates))) { - lbs_pr_alert("fixed data rate 0x%X out of range\n", - new_rate); - goto out; - } - if (priv->fwrelease < 0x09000000) { - ret = lbs_set_power_adapt_cfg(priv, 0, - POW_ADAPT_DEFAULT_P0, - POW_ADAPT_DEFAULT_P1, - POW_ADAPT_DEFAULT_P2); - if (ret) - goto out; - } - ret = lbs_set_tpc_cfg(priv, 0, TPC_DEFAULT_P0, TPC_DEFAULT_P1, - TPC_DEFAULT_P2, 1); - if (ret) - goto out; - } - - /* Try the newer command first (Firmware Spec 5.1 and above) */ - ret = lbs_cmd_802_11_rate_adapt_rateset(priv, CMD_ACT_SET); - - /* Fallback to older version */ - if (ret) - ret = lbs_set_data_rate(priv, new_rate); - -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -//extern int pm_onelevel_status; -//#include - -static int lbs_get_sense(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - static int previous_rssi = 60; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - - lbs_deb_enter(LBS_DEB_WEXT); - - //printk("%s: reassoc_flag is %d\n", __func__, atomic_read(&reassoc_flag)); -#if 1 - - if (priv->connect_status == LBS_CONNECTED) - { - /* We are in reassociating. */ - if (atomic_read(&reassoc_flag) == 1) - { - vwrq->value = previous_rssi; - return 1; - } - - if (priv->deepsleep == false) - lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0, - CMD_OPTION_WAITFORRSP, 0, NULL); - - /* Quality by RSSI */ - priv->wstats.qual.level = - CAL_RSSI(priv->SNR[TYPE_BEACON][TYPE_NOAVG], - priv->NF[TYPE_BEACON][TYPE_NOAVG]); - -#if (NEW_MV8686_PS == 1) - /* - * In MV8686 FW, the level range is 256. - * We got the negative level, but it's considered as positive. - */ - vwrq->value = 256 - priv->wstats.qual.level; -#endif - previous_rssi = vwrq->value; - -#if 0 - printk("signal level %d ", priv->wstats.qual.level); - printk("noise %d ", priv->wstats.qual.noise); - printk("rssi %d\n", vwrq->value); -#endif - } - else - { - vwrq->value = 30; - //printk("%s: return default rssi=30\n", __func__); - } -#else - vwrq->value = 60; -#endif - - lbs_deb_leave(LBS_DEB_WEXT); - - return 1; -} - -static int lbs_get_rate(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - - lbs_deb_enter(LBS_DEB_WEXT); - - if (priv->connect_status == LBS_CONNECTED) { - vwrq->value = priv->cur_rate * 500000; - - if (priv->enablehwauto) - vwrq->fixed = 0; - else - vwrq->fixed = 1; - - } else { - vwrq->fixed = 0; - vwrq->value = 0; - } - - lbs_deb_leave(LBS_DEB_WEXT); - return 0; -} - -static int lbs_set_mode(struct net_device *dev, - struct iw_request_info *info, u32 * uwrq, char *extra) -{ - int ret = 0; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); -#if (NEW_MV8686_PS == 1) - struct assoc_request * assoc_req; -#endif - - lbs_deb_enter(LBS_DEB_WEXT); - - if ( (*uwrq != IW_MODE_ADHOC) - && (*uwrq != IW_MODE_INFRA) - && (*uwrq != IW_MODE_AUTO)) { - lbs_deb_wext("Invalid mode: 0x%x\n", *uwrq); - ret = -EINVAL; - goto out; - } - -#if (MV8686_SUPPORT_ADHOC == 0) - if (*uwrq == IW_MODE_ADHOC) - { - printk("Ad-hoc isn't supported for now.\n"); - return -EINVAL; - } -#endif - -#if (NEW_MV8686_PS == 1) - mutex_lock(&priv->lock); - - assoc_req = lbs_get_association_request(priv); - if (!assoc_req) { - ret = -ENOMEM; - lbs_cancel_association_work(priv); - } else { - assoc_req->mode = *uwrq; - set_bit(ASSOC_FLAG_MODE, &assoc_req->flags); - lbs_postpone_association_work(priv); - - //lbs_deb_wext("Switching to mode: 0x%x\n", *uwrq); - //printk("Switching to mode: 0x%x\n", *uwrq); - } - mutex_unlock(&priv->lock); -#endif - -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - - -/** - * @brief Get Encryption key - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param vwrq A pointer to iw_param structure - * @param extra A pointer to extra data buf - * @return 0 --success, otherwise fail - */ -static int lbs_get_encode(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *dwrq, u8 * extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; - - lbs_deb_enter(LBS_DEB_WEXT); - - lbs_deb_wext("flags 0x%x, index %d, length %d, wep_tx_keyidx %d\n", - dwrq->flags, index, dwrq->length, priv->wep_tx_keyidx); - - dwrq->flags = 0; - - /* Authentication method */ - switch (priv->secinfo.auth_mode) { - case IW_AUTH_ALG_OPEN_SYSTEM: - dwrq->flags = IW_ENCODE_OPEN; - break; - - case IW_AUTH_ALG_SHARED_KEY: - case IW_AUTH_ALG_LEAP: - dwrq->flags = IW_ENCODE_RESTRICTED; - break; - default: - dwrq->flags = IW_ENCODE_DISABLED | IW_ENCODE_OPEN; - break; - } - - memset(extra, 0, 16); - - mutex_lock(&priv->lock); - - /* Default to returning current transmit key */ - if (index < 0) - index = priv->wep_tx_keyidx; - - if ((priv->wep_keys[index].len) && priv->secinfo.wep_enabled) { - memcpy(extra, priv->wep_keys[index].key, - priv->wep_keys[index].len); - dwrq->length = priv->wep_keys[index].len; - - dwrq->flags |= (index + 1); - /* Return WEP enabled */ - dwrq->flags &= ~IW_ENCODE_DISABLED; - } else if ((priv->secinfo.WPAenabled) - || (priv->secinfo.WPA2enabled)) { - /* return WPA enabled */ - dwrq->flags &= ~IW_ENCODE_DISABLED; - dwrq->flags |= IW_ENCODE_NOKEY; - } else { - dwrq->flags |= IW_ENCODE_DISABLED; - } - - mutex_unlock(&priv->lock); - - lbs_deb_wext("key: %02x:%02x:%02x:%02x:%02x:%02x, keylen %d\n", - extra[0], extra[1], extra[2], - extra[3], extra[4], extra[5], dwrq->length); - - lbs_deb_wext("return flags 0x%x\n", dwrq->flags); - - lbs_deb_leave(LBS_DEB_WEXT); - return 0; -} - -/** - * @brief Set Encryption key (internal) - * - * @param priv A pointer to private card structure - * @param key_material A pointer to key material - * @param key_length length of key material - * @param index key index to set - * @param set_tx_key Force set TX key (1 = yes, 0 = no) - * @return 0 --success, otherwise fail - */ -static int lbs_set_wep_key(struct assoc_request *assoc_req, - const char *key_material, - u16 key_length, - u16 index, - int set_tx_key) -{ - int ret = 0; - struct enc_key *pkey; - - lbs_deb_enter(LBS_DEB_WEXT); - - /* Paranoid validation of key index */ - if (index > 3) { - ret = -EINVAL; - goto out; - } - - /* validate max key length */ - if (key_length > KEY_LEN_WEP_104) { - ret = -EINVAL; - goto out; - } - - pkey = &assoc_req->wep_keys[index]; - - if (key_length > 0) { - memset(pkey, 0, sizeof(struct enc_key)); - pkey->type = KEY_TYPE_ID_WEP; - - /* Standardize the key length */ - pkey->len = (key_length > KEY_LEN_WEP_40) ? - KEY_LEN_WEP_104 : KEY_LEN_WEP_40; - memcpy(pkey->key, key_material, key_length); - } - - if (set_tx_key) { - /* Ensure the chosen key is valid */ - if (!pkey->len) { - lbs_deb_wext("key not set, so cannot enable it\n"); - ret = -EINVAL; - goto out; - } - assoc_req->wep_tx_keyidx = index; - } - - assoc_req->secinfo.wep_enabled = 1; - -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -static int validate_key_index(u16 def_index, u16 raw_index, - u16 *out_index, u16 *is_default) -{ - if (!out_index || !is_default) - return -EINVAL; - - /* Verify index if present, otherwise use default TX key index */ - if (raw_index > 0) { - if (raw_index > 4) - return -EINVAL; - *out_index = raw_index - 1; - } else { - *out_index = def_index; - *is_default = 1; - } - return 0; -} - -static void disable_wep(struct assoc_request *assoc_req) -{ - int i; - - lbs_deb_enter(LBS_DEB_WEXT); - - /* Set Open System auth mode */ - //printk("disable_wep\n"); - //assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; - - /* Clear WEP keys and mark WEP as disabled */ - assoc_req->secinfo.wep_enabled = 0; - for (i = 0; i < 4; i++) - assoc_req->wep_keys[i].len = 0; - - set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags); - set_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags); - - lbs_deb_leave(LBS_DEB_WEXT); -} - -static void disable_wpa(struct assoc_request *assoc_req) -{ - lbs_deb_enter(LBS_DEB_WEXT); - - memset(&assoc_req->wpa_mcast_key, 0, sizeof (struct enc_key)); - assoc_req->wpa_mcast_key.flags = KEY_INFO_WPA_MCAST; - set_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags); - - memset(&assoc_req->wpa_unicast_key, 0, sizeof (struct enc_key)); - assoc_req->wpa_unicast_key.flags = KEY_INFO_WPA_UNICAST; - set_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags); - - assoc_req->secinfo.WPAenabled = 0; - assoc_req->secinfo.WPA2enabled = 0; - set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags); - - lbs_deb_leave(LBS_DEB_WEXT); -} - -/** - * @brief Set Encryption key - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param vwrq A pointer to iw_param structure - * @param extra A pointer to extra data buf - * @return 0 --success, otherwise fail - */ -static int lbs_set_encode(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ - int ret = 0; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - struct assoc_request * assoc_req; - u16 is_default = 0, index = 0, set_tx_key = 0; - - lbs_deb_enter(LBS_DEB_WEXT); - - mutex_lock(&priv->lock); - assoc_req = lbs_get_association_request(priv); - if (!assoc_req) { - ret = -ENOMEM; - goto out; - } - - if (dwrq->flags & IW_ENCODE_DISABLED) { - disable_wep (assoc_req); - disable_wpa (assoc_req); - goto out; - } - - ret = validate_key_index(assoc_req->wep_tx_keyidx, - (dwrq->flags & IW_ENCODE_INDEX), - &index, &is_default); - if (ret) { - ret = -EINVAL; - goto out; - } - - /* If WEP isn't enabled, or if there is no key data but a valid - * index, set the TX key. - */ - if (!assoc_req->secinfo.wep_enabled || (dwrq->length == 0 && !is_default)) - set_tx_key = 1; - - ret = lbs_set_wep_key(assoc_req, extra, dwrq->length, index, set_tx_key); - if (ret) - goto out; - - if (dwrq->length) - set_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags); - - if (set_tx_key) - set_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags); - - if (dwrq->flags & IW_ENCODE_RESTRICTED) { - assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY; - //printk("Set encode: IW_AUTH_ALG_SHARED_KEY\n"); - } else if (dwrq->flags & IW_ENCODE_OPEN) { - assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; - //printk("Set encode: IW_AUTH_ALG_OPEN_SYSTEM\n"); - } - -out: - if (ret == 0) { - set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags); -#if (NEW_MV8686_PS == 1) - printk("%s: call lbs_postpone_association_work\n", __func__); - lbs_postpone_association_work(priv); -#endif - } else { - lbs_cancel_association_work(priv); - } - mutex_unlock(&priv->lock); - - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -/** - * @brief Get Extended Encryption key (WPA/802.1x and WEP) - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param vwrq A pointer to iw_param structure - * @param extra A pointer to extra data buf - * @return 0 on success, otherwise failure - */ -static int lbs_get_encodeext(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *dwrq, - char *extra) -{ - int ret = -EINVAL; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; - int index, max_key_len; - - lbs_deb_enter(LBS_DEB_WEXT); - - max_key_len = dwrq->length - sizeof(*ext); - if (max_key_len < 0) - goto out; - - index = dwrq->flags & IW_ENCODE_INDEX; - if (index) { - if (index < 1 || index > 4) - goto out; - index--; - } else { - index = priv->wep_tx_keyidx; - } - - if (!(ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) && - ext->alg != IW_ENCODE_ALG_WEP) { - if (index != 0 || priv->mode != IW_MODE_INFRA) - goto out; - } - - dwrq->flags = index + 1; - memset(ext, 0, sizeof(*ext)); - - if ( !priv->secinfo.wep_enabled - && !priv->secinfo.WPAenabled - && !priv->secinfo.WPA2enabled) { - ext->alg = IW_ENCODE_ALG_NONE; - ext->key_len = 0; - dwrq->flags |= IW_ENCODE_DISABLED; - } else { - u8 *key = NULL; - - if ( priv->secinfo.wep_enabled - && !priv->secinfo.WPAenabled - && !priv->secinfo.WPA2enabled) { - /* WEP */ - ext->alg = IW_ENCODE_ALG_WEP; - ext->key_len = priv->wep_keys[index].len; - key = &priv->wep_keys[index].key[0]; - } else if ( !priv->secinfo.wep_enabled - && (priv->secinfo.WPAenabled || - priv->secinfo.WPA2enabled)) { - /* WPA */ - struct enc_key * pkey = NULL; - - if ( priv->wpa_mcast_key.len - && (priv->wpa_mcast_key.flags & KEY_INFO_WPA_ENABLED)) - pkey = &priv->wpa_mcast_key; - else if ( priv->wpa_unicast_key.len - && (priv->wpa_unicast_key.flags & KEY_INFO_WPA_ENABLED)) - pkey = &priv->wpa_unicast_key; - - if (pkey) { - if (pkey->type == KEY_TYPE_ID_AES) { - ext->alg = IW_ENCODE_ALG_CCMP; - } else { - ext->alg = IW_ENCODE_ALG_TKIP; - } - ext->key_len = pkey->len; - key = &pkey->key[0]; - } else { - ext->alg = IW_ENCODE_ALG_TKIP; - ext->key_len = 0; - } - } else { - goto out; - } - - if (ext->key_len > max_key_len) { - ret = -E2BIG; - goto out; - } - - if (ext->key_len) - memcpy(ext->key, key, ext->key_len); - else - dwrq->flags |= IW_ENCODE_NOKEY; - dwrq->flags |= IW_ENCODE_ENABLED; - } - ret = 0; - -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -/** - * @brief Set Encryption key Extended (WPA/802.1x and WEP) - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param vwrq A pointer to iw_param structure - * @param extra A pointer to extra data buf - * @return 0 --success, otherwise fail - */ -static int lbs_set_encodeext(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *dwrq, - char *extra) -{ - int ret = 0; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; - int alg = ext->alg; - struct assoc_request * assoc_req; - - lbs_deb_enter(LBS_DEB_WEXT); - - mutex_lock(&priv->lock); - assoc_req = lbs_get_association_request(priv); - if (!assoc_req) { - ret = -ENOMEM; - goto out; - } - - if ((alg == IW_ENCODE_ALG_NONE) || (dwrq->flags & IW_ENCODE_DISABLED)) { - disable_wep (assoc_req); - disable_wpa (assoc_req); - } else if (alg == IW_ENCODE_ALG_WEP) { - u16 is_default = 0, index, set_tx_key = 0; - - ret = validate_key_index(assoc_req->wep_tx_keyidx, - (dwrq->flags & IW_ENCODE_INDEX), - &index, &is_default); - if (ret) - goto out; - - /* If WEP isn't enabled, or if there is no key data but a valid - * index, or if the set-TX-key flag was passed, set the TX key. - */ - if ( !assoc_req->secinfo.wep_enabled - || (dwrq->length == 0 && !is_default) - || (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY)) - set_tx_key = 1; - - /* Copy key to driver */ - ret = lbs_set_wep_key(assoc_req, ext->key, ext->key_len, index, - set_tx_key); - if (ret) - goto out; - - if (dwrq->flags & IW_ENCODE_RESTRICTED) { - assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY; - } else if (dwrq->flags & IW_ENCODE_OPEN) { - assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; - //printk("encodeext.\n"); - } - - /* Mark the various WEP bits as modified */ - set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags); - if (dwrq->length) - set_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags); - if (set_tx_key) - set_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags); - } else if ((alg == IW_ENCODE_ALG_TKIP) || (alg == IW_ENCODE_ALG_CCMP)) { - struct enc_key * pkey; - - /* validate key length */ - if (((alg == IW_ENCODE_ALG_TKIP) - && (ext->key_len != KEY_LEN_WPA_TKIP)) - || ((alg == IW_ENCODE_ALG_CCMP) - && (ext->key_len != KEY_LEN_WPA_AES))) { - lbs_deb_wext("invalid size %d for key of alg " - "type %d\n", - ext->key_len, - alg); - ret = -EINVAL; - goto out; - } - - if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { - pkey = &assoc_req->wpa_mcast_key; - set_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags); - } else { - pkey = &assoc_req->wpa_unicast_key; - set_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags); - } - - memset(pkey, 0, sizeof (struct enc_key)); - memcpy(pkey->key, ext->key, ext->key_len); - pkey->len = ext->key_len; - if (pkey->len) - pkey->flags |= KEY_INFO_WPA_ENABLED; - - /* Do this after zeroing key structure */ - if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { - pkey->flags |= KEY_INFO_WPA_MCAST; - } else { - pkey->flags |= KEY_INFO_WPA_UNICAST; - } - - if (alg == IW_ENCODE_ALG_TKIP) { - pkey->type = KEY_TYPE_ID_TKIP; - } else if (alg == IW_ENCODE_ALG_CCMP) { - pkey->type = KEY_TYPE_ID_AES; - } - - /* If WPA isn't enabled yet, do that now */ - if ( assoc_req->secinfo.WPAenabled == 0 - && assoc_req->secinfo.WPA2enabled == 0) { - assoc_req->secinfo.WPAenabled = 1; - assoc_req->secinfo.WPA2enabled = 1; - set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags); - } - - /* Only disable wep if necessary: can't waste time here. */ - if (priv->mac_control & CMD_ACT_MAC_WEP_ENABLE) - disable_wep(assoc_req); - } - -out: - if (ret == 0) { - /* 802.1x and WPA rekeying must happen as quickly as possible, - * especially during the 4-way handshake; thus if in - * infrastructure mode, and either (a) 802.1x is enabled or - * (b) WPA is being used, set the key right away. - */ -#if (NEW_MV8686_PS == 1) - if (assoc_req->mode == IW_MODE_INFRA && - ((assoc_req->secinfo.key_mgmt & IW_AUTH_KEY_MGMT_802_1X) || - (assoc_req->secinfo.key_mgmt & IW_AUTH_KEY_MGMT_PSK) || - assoc_req->secinfo.WPAenabled || - assoc_req->secinfo.WPA2enabled)) { - lbs_do_association_work(priv); - } - else { - //printk("%s: call lbs_postpone_association_work\n", __func__); - lbs_postpone_association_work(priv); - } -#endif - } else { - lbs_cancel_association_work(priv); - } - mutex_unlock(&priv->lock); - - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - - -static int lbs_set_genie(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *dwrq, - char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - int ret = 0; - struct assoc_request * assoc_req; - - lbs_deb_enter(LBS_DEB_WEXT); - - mutex_lock(&priv->lock); - assoc_req = lbs_get_association_request(priv); - if (!assoc_req) { - ret = -ENOMEM; - goto out; - } - - if (dwrq->length > MAX_WPA_IE_LEN || - (dwrq->length && extra == NULL)) { - ret = -EINVAL; - goto out; - } - - if (dwrq->length) { - memcpy(&assoc_req->wpa_ie[0], extra, dwrq->length); - assoc_req->wpa_ie_len = dwrq->length; - } else { - memset(&assoc_req->wpa_ie[0], 0, sizeof(priv->wpa_ie)); - assoc_req->wpa_ie_len = 0; - } - -out: - if (ret == 0) { - set_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags); -#if (NEW_MV8686_PS == 1) - //printk("%s: call lbs_postpone_association_work\n", __func__); - lbs_postpone_association_work(priv); -#endif - } else { - lbs_cancel_association_work(priv); - } - mutex_unlock(&priv->lock); - - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -static int lbs_get_genie(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *dwrq, - char *extra) -{ - int ret = 0; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - - lbs_deb_enter(LBS_DEB_WEXT); - - if (priv->wpa_ie_len == 0) { - dwrq->length = 0; - goto out; - } - - if (dwrq->length < priv->wpa_ie_len) { - ret = -E2BIG; - goto out; - } - - dwrq->length = priv->wpa_ie_len; - memcpy(extra, &priv->wpa_ie[0], priv->wpa_ie_len); - -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - - -static int lbs_set_auth(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *dwrq, - char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - struct assoc_request * assoc_req; - int ret = 0; - int updated = 0; - - lbs_deb_enter(LBS_DEB_WEXT); - - mutex_lock(&priv->lock); - assoc_req = lbs_get_association_request(priv); - if (!assoc_req) { - ret = -ENOMEM; - goto out; - } - - //printk("dwrq->flags & IW_AUTH_INDEX = %x\n", dwrq->flags & IW_AUTH_INDEX); - - switch (dwrq->flags & IW_AUTH_INDEX) { - case IW_AUTH_TKIP_COUNTERMEASURES: - case IW_AUTH_CIPHER_PAIRWISE: - case IW_AUTH_CIPHER_GROUP: - case IW_AUTH_DROP_UNENCRYPTED: - case IW_AUTH_RX_UNENCRYPTED_EAPOL: - case IW_AUTH_PRIVACY_INVOKED: - /* - * libertas does not use these parameters - */ - break; - - case IW_AUTH_KEY_MGMT: - assoc_req->secinfo.key_mgmt = dwrq->value; - updated = 1; - break; - - case IW_AUTH_WPA_VERSION: - if (dwrq->value & IW_AUTH_WPA_VERSION_DISABLED) { - assoc_req->secinfo.WPAenabled = 0; - assoc_req->secinfo.WPA2enabled = 0; - disable_wpa (assoc_req); - } - if (dwrq->value & IW_AUTH_WPA_VERSION_WPA) { - assoc_req->secinfo.WPAenabled = 1; - assoc_req->secinfo.wep_enabled = 0; - assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; - //printk("openopen.\n"); - } - if (dwrq->value & IW_AUTH_WPA_VERSION_WPA2) { - assoc_req->secinfo.WPA2enabled = 1; - assoc_req->secinfo.wep_enabled = 0; - assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; - } - updated = 1; - break; - - case IW_AUTH_80211_AUTH_ALG: - //printk("AUTH ALG: %x\n", dwrq->value); - if (dwrq->value & IW_AUTH_ALG_SHARED_KEY) { - assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY; - //printk("IW_AUTH_ALG_SHARED_KEY\n"); - } else if (dwrq->value & IW_AUTH_ALG_OPEN_SYSTEM) { - assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; - //printk("IW_AUTH_ALG_OPEN_SYSTEM\n"); - } else if (dwrq->value & IW_AUTH_ALG_LEAP) { - assoc_req->secinfo.auth_mode = IW_AUTH_ALG_LEAP; - } else { - ret = -EINVAL; - } - updated = 1; - break; - - case IW_AUTH_WPA_ENABLED: - if (dwrq->value) { - if (!assoc_req->secinfo.WPAenabled && - !assoc_req->secinfo.WPA2enabled) { - assoc_req->secinfo.WPAenabled = 1; - assoc_req->secinfo.WPA2enabled = 1; - assoc_req->secinfo.wep_enabled = 0; - assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; - //printk("OPENOPEN\n"); - } - } else { - assoc_req->secinfo.WPAenabled = 0; - assoc_req->secinfo.WPA2enabled = 0; - disable_wpa (assoc_req); - } - updated = 1; - break; - - default: - ret = -EOPNOTSUPP; - break; - } - -out: - if (ret == 0) { - if (updated) - set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags); -#if (NEW_MV8686_PS == 1) - //printk("%s: call lbs_postpone_association_work\n", __func__); - lbs_postpone_association_work(priv); -#endif - } else if (ret != -EOPNOTSUPP) { - lbs_cancel_association_work(priv); - } - mutex_unlock(&priv->lock); - - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -static int lbs_get_auth(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *dwrq, - char *extra) -{ - int ret = 0; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - - lbs_deb_enter(LBS_DEB_WEXT); - - switch (dwrq->flags & IW_AUTH_INDEX) { - case IW_AUTH_KEY_MGMT: - dwrq->value = priv->secinfo.key_mgmt; - break; - - case IW_AUTH_WPA_VERSION: - dwrq->value = 0; - if (priv->secinfo.WPAenabled) - dwrq->value |= IW_AUTH_WPA_VERSION_WPA; - if (priv->secinfo.WPA2enabled) - dwrq->value |= IW_AUTH_WPA_VERSION_WPA2; - if (!dwrq->value) - dwrq->value |= IW_AUTH_WPA_VERSION_DISABLED; - break; - - case IW_AUTH_80211_AUTH_ALG: - dwrq->value = priv->secinfo.auth_mode; - break; - - case IW_AUTH_WPA_ENABLED: - if (priv->secinfo.WPAenabled && priv->secinfo.WPA2enabled) - dwrq->value = 1; - break; - - default: - ret = -EOPNOTSUPP; - } - - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - - -static int lbs_set_txpow(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - int ret = 0; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - s16 dbm = (s16) vwrq->value; - - lbs_deb_enter(LBS_DEB_WEXT); - - if (vwrq->disabled) { - lbs_set_radio(priv, RADIO_PREAMBLE_AUTO, 0); - goto out; - } - - if (vwrq->fixed == 0) { - /* User requests automatic tx power control, however there are - * many auto tx settings. For now use firmware defaults until - * we come up with a good way to expose these to the user. */ - if (priv->fwrelease < 0x09000000) { - ret = lbs_set_power_adapt_cfg(priv, 1, - POW_ADAPT_DEFAULT_P0, - POW_ADAPT_DEFAULT_P1, - POW_ADAPT_DEFAULT_P2); - if (ret) - goto out; - } - ret = lbs_set_tpc_cfg(priv, 0, TPC_DEFAULT_P0, TPC_DEFAULT_P1, - TPC_DEFAULT_P2, 1); - if (ret) - goto out; - dbm = priv->txpower_max; - } else { - /* Userspace check in iwrange if it should use dBm or mW, - * therefore this should never happen... Jean II */ - if ((vwrq->flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM) { - ret = -EOPNOTSUPP; - goto out; - } - - /* Validate requested power level against firmware allowed - * levels */ - if (priv->txpower_min && (dbm < priv->txpower_min)) { - ret = -EINVAL; - goto out; - } - - if (priv->txpower_max && (dbm > priv->txpower_max)) { - ret = -EINVAL; - goto out; - } - if (priv->fwrelease < 0x09000000) { - ret = lbs_set_power_adapt_cfg(priv, 0, - POW_ADAPT_DEFAULT_P0, - POW_ADAPT_DEFAULT_P1, - POW_ADAPT_DEFAULT_P2); - if (ret) - goto out; - } - ret = lbs_set_tpc_cfg(priv, 0, TPC_DEFAULT_P0, TPC_DEFAULT_P1, - TPC_DEFAULT_P2, 1); - if (ret) - goto out; - } - - /* If the radio was off, turn it on */ - if (!priv->radio_on) { - ret = lbs_set_radio(priv, RADIO_PREAMBLE_AUTO, 1); - if (ret) - goto out; - } - - lbs_deb_wext("txpower set %d dBm\n", dbm); - - ret = lbs_set_tx_power(priv, dbm); - -out: - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -static int lbs_get_essid(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - - lbs_deb_enter(LBS_DEB_WEXT); - - /* - * Note : if dwrq->flags != 0, we should get the relevant SSID from - * the SSID list... - */ - - /* - * Get the current SSID - */ - if (priv->connect_status == LBS_CONNECTED) { - memcpy(extra, priv->curbssparams.ssid, - priv->curbssparams.ssid_len); - extra[priv->curbssparams.ssid_len] = '\0'; - } else { - memset(extra, 0, IW_ESSID_MAX_SIZE); - extra[priv->curbssparams.ssid_len] = '\0'; - } - /* - * If none, we may want to get the one that was set - */ - - dwrq->length = priv->curbssparams.ssid_len; - - dwrq->flags = 1; /* active */ - - lbs_deb_leave(LBS_DEB_WEXT); - return 0; -} - -static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - int ret = 0; - u8 ssid[IW_ESSID_MAX_SIZE]; - u8 ssid_len = 0; - struct assoc_request * assoc_req; - int in_ssid_len = dwrq->length; - DECLARE_SSID_BUF(ssid_buf); - - lbs_deb_enter(LBS_DEB_WEXT); - - if (!priv->radio_on) { - ret = -EINVAL; - goto out; - } - - /* Check the size of the string */ - if (in_ssid_len > IW_ESSID_MAX_SIZE) { - ret = -E2BIG; - goto out; - } - - memset(&ssid, 0, sizeof(ssid)); - - if (!dwrq->flags || !in_ssid_len) { - /* "any" SSID requested; leave SSID blank */ - } else { - /* Specific SSID requested */ -#if 0 - int i; - - printk("%s: Request SSID: ", __func__); - for (i = 0; i < in_ssid_len; i++) - { - printk("%2.2x ", extra[i]); - } - printk("\n"); -#endif - memcpy(&ssid, extra, in_ssid_len); - ssid_len = in_ssid_len; - } - - if (!ssid_len) { - lbs_deb_wext("requested any SSID\n"); - } else { - lbs_deb_wext("requested SSID '%s'\n", - mv8686_print_ssid(ssid_buf, ssid, ssid_len)); - } - -out: - mutex_lock(&priv->lock); - if (ret == 0) { - /* Get or create the current association request */ - assoc_req = lbs_get_association_request(priv); - if (!assoc_req) { - ret = -ENOMEM; - } else { - /* Copy the SSID to the association request */ - memcpy(&assoc_req->ssid, &ssid, IW_ESSID_MAX_SIZE); - assoc_req->ssid_len = ssid_len; - set_bit(ASSOC_FLAG_SSID, &assoc_req->flags); - //printk("%s: call lbs_postpone_association_work\n", __func__); - lbs_postpone_association_work(priv); - } - } - - /* Cancel the association request if there was an error */ - if (ret != 0) { - lbs_cancel_association_work(priv); - } - - mutex_unlock(&priv->lock); - - lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); - return ret; -} - -/** - * @brief Connect to the AP or Ad-hoc Network with specific bssid - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param awrq A pointer to iw_param structure - * @param extra A pointer to extra data buf - * @return 0 --success, otherwise fail - */ -static int lbs_set_wap(struct net_device *dev, struct iw_request_info *info, - struct sockaddr *awrq, char *extra) -{ - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - struct assoc_request * assoc_req; - int ret = 0; - - lbs_deb_enter(LBS_DEB_WEXT); - - if (!priv->radio_on) - return -EINVAL; - - if (awrq->sa_family != ARPHRD_ETHER) - return -EINVAL; - - lbs_deb_wext("ASSOC: WAP: sa_data %pM\n", awrq->sa_data); - - mutex_lock(&priv->lock); - - /* Get or create the current association request */ - assoc_req = lbs_get_association_request(priv); - if (!assoc_req) { - lbs_cancel_association_work(priv); - ret = -ENOMEM; - } else { - /* Copy the BSSID to the association request */ - memcpy(&assoc_req->bssid, awrq->sa_data, ETH_ALEN); - set_bit(ASSOC_FLAG_BSSID, &assoc_req->flags); - //printk("%s: call lbs_postpone_association_work\n", __func__); - lbs_postpone_association_work(priv); - } - - mutex_unlock(&priv->lock); - - return ret; -} - -#if (NEW_MV8686_PS == 1) -static int mv8686_set_mlme(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ - int ret; - struct lbs_private *priv = GET_PRIV_FROM_NETDEV(dev); - struct iw_mlme *mlme = (struct iw_mlme *) extra; - - if ((mlme->cmd == IW_MLME_DEAUTH) || (mlme->cmd == IW_MLME_DISASSOC)) - { - printk("%s: Customer want to disconnect WiFi.\n", __func__); - priv->needto_notify_upper = 1; - - ret = lbs_cmd_80211_deauthenticate(priv, - priv->curbssparams.bssid, - WLAN_REASON_DEAUTH_LEAVING); - if (ret) - printk("%s: deauthenticate fail.\n", __func__); - } - - return 0; -} -#endif - -/* - * iwconfig settable callbacks - */ -static const iw_handler lbs_handler[] = -{ - (iw_handler) NULL, /* SIOCSIWCOMMIT */ - (iw_handler) lbs_get_name, /* SIOCGIWNAME */ - (iw_handler) NULL, /* SIOCSIWNWID */ - (iw_handler) NULL, /* SIOCGIWNWID */ - (iw_handler) lbs_set_freq, /* SIOCSIWFREQ */ - (iw_handler) lbs_get_freq, /* SIOCGIWFREQ */ - (iw_handler) lbs_set_mode, /* SIOCSIWMODE */ - (iw_handler) lbs_get_mode, /* SIOCGIWMODE */ - (iw_handler) NULL, /* SIOCSIWSENS */ - (iw_handler) lbs_get_sense, /* SIOCGIWSENS */ - (iw_handler) NULL, /* SIOCSIWRANGE */ - (iw_handler) lbs_get_range, /* SIOCGIWRANGE */ - (iw_handler) NULL, /* SIOCSIWPRIV */ - (iw_handler) NULL, /* SIOCGIWPRIV */ - (iw_handler) NULL, /* SIOCSIWSTATS */ - (iw_handler) NULL, /* SIOCGIWSTATS */ - iw_handler_set_spy, /* SIOCSIWSPY */ - iw_handler_get_spy, /* SIOCGIWSPY */ - iw_handler_set_thrspy, /* SIOCSIWTHRSPY */ - iw_handler_get_thrspy, /* SIOCGIWTHRSPY */ - (iw_handler) lbs_set_wap, /* SIOCSIWAP */ - (iw_handler) lbs_get_wap, /* SIOCGIWAP */ -#if (NEW_MV8686_PS == 1) - (iw_handler) mv8686_set_mlme, /* SIOCSIWMLME */ -#else - (iw_handler) NULL, /* SIOCSIWMLME */ -#endif - (iw_handler) NULL, /* SIOCGIWAPLIST - deprecated */ - (iw_handler) lbs_set_scan, /* SIOCSIWSCAN */ - (iw_handler) lbs_get_scan, /* SIOCGIWSCAN */ - (iw_handler) lbs_set_essid, /* SIOCSIWESSID */ - (iw_handler) lbs_get_essid, /* SIOCGIWESSID */ - (iw_handler) lbs_set_nick, /* SIOCSIWNICKN */ - (iw_handler) lbs_get_nick, /* SIOCGIWNICKN */ - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) lbs_set_rate, /* SIOCSIWRATE */ - (iw_handler) lbs_get_rate, /* SIOCGIWRATE */ - (iw_handler) lbs_set_rts, /* SIOCSIWRTS */ - (iw_handler) lbs_get_rts, /* SIOCGIWRTS */ - (iw_handler) lbs_set_frag, /* SIOCSIWFRAG */ - (iw_handler) lbs_get_frag, /* SIOCGIWFRAG */ - (iw_handler) lbs_set_txpow, /* SIOCSIWTXPOW */ - (iw_handler) lbs_get_txpow, /* SIOCGIWTXPOW */ - (iw_handler) lbs_set_retry, /* SIOCSIWRETRY */ - (iw_handler) lbs_get_retry, /* SIOCGIWRETRY */ - (iw_handler) lbs_set_encode, /* SIOCSIWENCODE */ - (iw_handler) lbs_get_encode, /* SIOCGIWENCODE */ - (iw_handler) lbs_set_power, /* SIOCSIWPOWER */ - (iw_handler) lbs_get_power, /* SIOCGIWPOWER */ - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) lbs_set_genie, /* SIOCSIWGENIE */ - (iw_handler) lbs_get_genie, /* SIOCGIWGENIE */ - (iw_handler) lbs_set_auth, /* SIOCSIWAUTH */ - (iw_handler) lbs_get_auth, /* SIOCGIWAUTH */ - (iw_handler) lbs_set_encodeext,/* SIOCSIWENCODEEXT */ - (iw_handler) lbs_get_encodeext,/* SIOCGIWENCODEEXT */ - (iw_handler) NULL, /* SIOCSIWPMKSA */ -}; - -/* - * iwpriv settable callbacks - */ - -static const iw_handler lbs_private_handler[] = -{ - NULL, /* SIOCIWFIRSTPRIV */ -}; - -/* cmd set_arg get_arg name */ -static const struct iw_priv_args lbs_private_args[] = -{ - { - WLANDEEPSLEEP, - IW_PRIV_TYPE_CHAR | 1, - IW_PRIV_TYPE_CHAR | 6, - "deepsleep"}, - { - WLAN_SETONEINT_GETONEINT, - IW_PRIV_TYPE_INT | 1, - IW_PRIV_TYPE_INT | 1, - ""}, - { - WLAN_AUTODEEPSLEEP, - IW_PRIV_TYPE_INT | 1, - IW_PRIV_TYPE_INT | 1, - "autodeepsleep"}, -}; - -struct iw_handler_def lbs_handler_def = -{ - .num_standard = ARRAY_SIZE(lbs_handler), - .num_private = sizeof(lbs_private_handler) / sizeof(iw_handler), - .num_private_args = sizeof(lbs_private_args) / - sizeof(struct iw_priv_args), - - .standard = (iw_handler *) lbs_handler, - .private = (iw_handler *) lbs_private_handler, - .private_args = (struct iw_priv_args *) lbs_private_args, - - .get_wireless_stats = lbs_get_wireless_stats, -}; diff --git a/drivers/net/wireless/mv8686/wext.h b/drivers/net/wireless/mv8686/wext.h deleted file mode 100755 index 4c08db497606..000000000000 --- a/drivers/net/wireless/mv8686/wext.h +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file contains definition for IOCTL call. - */ -#ifndef _LBS_WEXT_H_ -#define _LBS_WEXT_H_ - -extern struct iw_handler_def lbs_handler_def; -extern struct iw_handler_def mesh_handler_def; - -#endif diff --git a/drivers/net/wireless/mv8686/wifi_power.h b/drivers/net/wireless/mv8686/wifi_power.h deleted file mode 120000 index 4ca35061c536..000000000000 --- a/drivers/net/wireless/mv8686/wifi_power.h +++ /dev/null @@ -1 +0,0 @@ -../wifi_power/wifi_power.h \ No newline at end of file diff --git a/drivers/net/wireless/mv8686/wifi_version.h b/drivers/net/wireless/mv8686/wifi_version.h deleted file mode 120000 index 5c652aef0bf4..000000000000 --- a/drivers/net/wireless/mv8686/wifi_version.h +++ /dev/null @@ -1 +0,0 @@ -../wifi_power/wifi_version.h \ No newline at end of file diff --git a/drivers/net/wireless/rda5990/Makefile b/drivers/net/wireless/rda5990/Makefile deleted file mode 100755 index 0b0494d04ae2..000000000000 --- a/drivers/net/wireless/rda5990/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -#obj-y += rda_gpio_i2c/ # 模拟I2C开此功能 -#obj-y += drv_fm_rda/ - -obj-y += rda_wlan/ -obj-y += rda_5990_power_ctrl/ diff --git a/drivers/net/wireless/rda5990/drv_fm_rda/Makefile b/drivers/net/wireless/rda5990/drv_fm_rda/Makefile deleted file mode 100755 index 4eaffa464f77..000000000000 --- a/drivers/net/wireless/rda5990/drv_fm_rda/Makefile +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. -# -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# Makefile generated by Mediatek -# rda fm support - -ifeq ($(MTK_FM_SUPPORT), yes) -ifeq ($(CUSTOM_KERNEL_FM), mt6620) - -#obj-$(CONFIG_MTK_COMBO_FM) += RDA5990_FM_drv.o -# for 模拟I2C -obj-$(CONFIG_MTK_COMBO_FM) += RDA5990_FM_drv_gpio.o - -endif -endif - - diff --git a/drivers/net/wireless/rda5990/drv_fm_rda/RDA5990_FM_drv.c b/drivers/net/wireless/rda5990/drv_fm_rda/RDA5990_FM_drv.c deleted file mode 100755 index cfd9f1b7846b..000000000000 --- a/drivers/net/wireless/rda5990/drv_fm_rda/RDA5990_FM_drv.c +++ /dev/null @@ -1,2142 +0,0 @@ -#include -#include -#include -#include // udelay() -#include // device_create() -#include -#include -#include -#include -#include /* constant of kernel version */ -#include // get_user() - -#include -#include -#include -#include -#include -#include - -// if need debug, define FMDEBUG -//#define FMDEBUG - -// if your platform is MT6515/6575, define MTK_MT6515 -#define MTK_MT6515 - -// if your platform is MT6515/6575 and MTK FM is MT6626, define MT6626 -//#define MT6626 - -#define FM_ALERT(f, s...) \ - do { \ - printk(KERN_ALERT "RDAFM " f, ## s); \ - } while(0) - -#ifdef FMDEBUG -#define FM_DEBUG(f, s...) \ - do { \ - printk("RDAFM " f, ## s); \ - } while(0) -#else -#define FM_DEBUG(f, s...) -#endif - -#define RDA599X_SCANTBL_SIZE 16 //16*uinit16_t -#define RDA599X_FM_SCAN_UP 0x0 -#define RDA599X_FM_SCAN_DOWN 0x01 - -extern int rda_fm_power_off(); -extern int rda_fm_power_on(); - -/****************************************************************************** - * CONSTANT DEFINITIONS - *****************************************************************************/ -#define RDAFM_SLAVE_ADDR (0x11 << 1) //RDA FM Chip address - -#define RDAFM_MASK_RSSI 0X7F // RSSI -#define RDAFM_DEV "RDA599x" - -//customer need customize the I2C port -#define RDAFM_I2C_PORT 0 - - -#define ID_RDA5802E 0x5804 -#define ID_RDA5802H 0x5801 -#define ID_RDA5802N 0x5808 -#define ID_RDA5820 0x5805 -#define ID_RDA5820NS 0x5820 - - -static struct proc_dir_entry *g_fm_proc = NULL; -static struct fm *g_fm_struct = NULL; -static atomic_t scan_complete_flag; - -#define FM_PROC_FILE "fm" - -/****************************************************************************** - * STRUCTURE DEFINITIONS - *****************************************************************************/ - -enum RDAFM_CHIP_TYPE { - CHIP_TYPE_RDA5802E = 0, - CHIP_TYPE_RDA5802H, - CHIP_TYPE_RDA5802N, - CHIP_TYPE_RDA5820, - CHIP_TYPE_RDA5820NS, -}; - - -typedef struct -{ - uint8_t address; - uint16_t value; -}RDA_FM_REG_T; - -typedef struct -{ - bool byPowerUp; - struct fm_tune_parm parm -}FM_TUNE_T; -static FM_TUNE_T fm_tune_data = {false, {}}; - -typedef enum -{ - FM_RECEIVER, //5800,5802,5804 - FM_TRANSMITTER, //5820 -}RDA_RADIO_WORK_E; - -typedef enum -{ - OFF, - ON, -}RDA_FM_POWER_STATE_T; - -struct fm { - uint32_t ref; - bool powerup; - uint16_t chip_id; - uint16_t device_id; - dev_t dev_t; - uint16_t min_freq; // KHz - uint16_t max_freq; // KHz - uint8_t band; // TODO - struct class *cls; - struct device *dev; - struct cdev cdev; - struct i2c_client *i2c_client; -}; - - - - -/****************************************************************************** - * FUNCTION PROTOTYPES - *****************************************************************************/ - -static int RDAFM_clear_hmute(struct i2c_client *client); -static int RDAFM_enable_hmute(struct i2c_client *client); -static int RDAFM_clear_tune(struct i2c_client *client); -static int RDAFM_enable_tune(struct i2c_client *client); -static int RDAFM_clear_seek(struct i2c_client *client); -static int RDAFM_enable_seek(struct i2c_client *client); -static int RDAFM_SetStereo(struct i2c_client *client,uint8_t b); -static int RDAFM_SetRSSI_Threshold(struct i2c_client *client,uint8_t RssiThreshold); -static int RDAFM_SetDe_Emphasis(struct i2c_client *client,uint8_t index); -static bool RDAFM_Scan(struct i2c_client *client, - uint16_t min_freq, uint16_t max_freq, - uint16_t *pFreq, //get the valid freq after scan - uint16_t *pScanTBL, - uint16_t *ScanTBLsize, - uint16_t scandir, - uint16_t space); - - -static int RDAFM_read(struct i2c_client *client, uint8_t addr, uint16_t *val); -static int RDAFM_write(struct i2c_client *client, uint8_t addr, uint16_t val); -static void RDAFM_em_test(struct i2c_client *client, uint16_t group_idx, uint16_t item_idx, uint32_t item_value); -static int fm_setup_cdev(struct fm *fm); -static int fm_ops_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); -static loff_t fm_ops_lseek(struct file *filp, loff_t off, int whence); -static int fm_ops_open(struct inode *inode, struct file *filp); -static int fm_ops_release(struct inode *inode, struct file *filp); - -static int fm_init(struct i2c_client *client); -static int fm_destroy(struct fm *fm); -static int fm_powerup(struct fm *fm, struct fm_tune_parm *parm); -static int fm_powerdown(struct fm *fm); - -static int fm_tune(struct fm *fm, struct fm_tune_parm *parm); -static int fm_seek(struct fm *fm, struct fm_seek_parm *parm); -static int fm_scan(struct fm *fm, struct fm_scan_parm *parm); -static int fm_setvol(struct fm *fm, uint32_t vol); -static int fm_getvol(struct fm *fm, uint32_t *vol); -static int fm_getrssi(struct fm *fm, uint32_t *rssi); -static int fm_proc_read(char *page, char **start, off_t off, int count, int *eof, void *data); - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) -static int fm_i2c_attach_adapter(struct i2c_adapter *adapter); -static int fm_i2c_detect(struct i2c_adapter *adapter, int addr, int kind); -static int fm_i2c_detach_client(struct i2c_client *client); -#else -static int fm_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id); -static int fm_i2c_detect(struct i2c_client *client, int kind, struct i2c_board_info *info); -static int fm_i2c_remove(struct i2c_client *client); -#endif - -/****************************************************************************** - * GLOBAL DATA - *****************************************************************************/ -/* Addresses to scan */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) -static unsigned short normal_i2c[] = {RDAFM_SLAVE_ADDR, I2C_CLIENT_END}; -static unsigned short ignore = I2C_CLIENT_END; - -static struct i2c_client_address_data RDAFM_addr_data = { - .normal_i2c = normal_i2c, - .probe = &ignore, - .ignore = &ignore, -}; -#else -static const struct i2c_device_id fm_i2c_id = {RDAFM_DEV, 0}; -static unsigned short force[] = {RDAFM_I2C_PORT, RDAFM_SLAVE_ADDR, I2C_CLIENT_END, I2C_CLIENT_END}; -static const unsigned short * const forces[] = {force, NULL}; -//static struct i2c_client_address_data addr_data = {.forces = forces}; -static struct i2c_board_info __initdata i2c_rdafm={ I2C_BOARD_INFO(RDAFM_DEV, (RDAFM_SLAVE_ADDR>>1))}; -#endif - - static struct i2c_driver RDAFM_driver = { -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) - .driver = { - .owner = THIS_MODULE, - .name = RDAFM_DEV, - }, - .attach_adapter = fm_i2c_attach_adapter, - .detach_client = fm_i2c_detach_client, -#else - .probe = fm_i2c_probe, - .remove = fm_i2c_remove, - .detect = fm_i2c_detect, - .driver.name = RDAFM_DEV, - .id_table = &fm_i2c_id, - // .address_data = &addr_data, - .address_list = (const unsigned short*) forces, -#endif - }; - -static uint16_t RDAFM_CHIP_ID = 0x5808; -static RDA_RADIO_WORK_E RDA_RADIO_WorkType = FM_RECEIVER; - - - -#if 1 -static uint16_t RDA5802N_initialization_reg[]={ - 0xC005, //02h - 0x0000, - 0x0400, - 0xC6ED, //0x86AD, //05h - 0x6000, - 0x721A, //0x42C6 - 0x0000, - 0x0000, - 0x0000, //0x0ah - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, //0x10h - 0x0019, - 0x2A11, - 0xB042, - 0x2A11, - 0xB831, //0x15h - 0xC000, - 0x2A91, - 0x9400, - 0x00A8, - 0xc400, //0x1ah - 0xF7CF, //Ìá¸ßÔ¶¶ËÔëÉùÒÖÖÆ - 0x2414, //0x2ADC, //0x1ch ÌáÉýVIO VDDÖ®¼äѹ²îÒýÆðµÄ²»Á¼ - 0x806F, - 0x4608, - 0x0086, - 0x0661, //0x20H - 0x0000, - 0x109E, - 0x23C8, - 0x0406, - 0x0E1C, //0x25H -}; -#else -static uint16_t RDA5802N_initialization_reg[]={ - 0xc401, //02h - 0x0000, - 0x0400, - 0x86ad, //05h// - 0x0000, - 0x42c6, - 0x0000, - 0x0000, - 0x0000, //0x0ah - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, //0x10h - 0x0019, - 0x2a11, - 0xa053,//0x80,0x53, - 0x3e11,//0x22,0x11, - 0xfc7d, //0x15h - 0xc000, - 0x2a91, - 0x9400, - 0x00a8, - 0xc400, //0x1ah - 0xe000, - 0x2b1d, //0x23,0x14 - 0x816a, - 0x4608, - 0x0086, - 0x0661, //0x20h - 0x0000, - 0x109e, - 0x2244, - 0x0408, //0x24 - 0x0408, //0x25 -}; -#endif - -static RDA_FM_REG_T RDA5820NS_TX_initialization_reg[]={ - {0x02, 0xE003}, - {0xFF, 100}, // if address is 0xFF, sleep value ms - {0x02, 0xE001}, - {0x19, 0x88A8}, - {0x1A, 0x4290}, - {0x68, 0x0AF0}, - {0x40, 0x0001}, - {0x41, 0x41FF}, - {0xFF, 500}, - {0x03, 0x1B90}, -}; - -static RDA_FM_REG_T RDA5820NS_RX_initialization_reg[]={ - {0x02, 0x0002}, //Soft reset - {0xFF, 100}, // wait - {0x02, 0xC001}, //Power Up - {0x05, 0x888F}, //LNAP 0x884F --LNAN - {0x06, 0x6000}, - {0x13, 0x80E1}, - {0x14, 0x2A11}, - {0x1C, 0x22DE}, - {0x21, 0x0020}, - {0x03, 0x1B90}, -}; - - - -static struct file_operations fm_ops = { - .owner = THIS_MODULE, - .unlocked_ioctl = fm_ops_ioctl, - .llseek = fm_ops_lseek, - .open = fm_ops_open, - .release = fm_ops_release, -}; - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) -static DECLARE_MUTEX(fm_ops_mutex); -#else -DEFINE_SEMAPHORE(fm_ops_mutex); -#endif - -/****************************************************************************** - *****************************************************************************/ - -/****************************************************************************** - *****************************************************************************/ - - - -static int RDAFM_GetChipID(struct i2c_client *client, uint16_t *pChipID) -{ - int err; - int ret = -1; - uint16_t val = 0x0002; - - //Reset RDA FM - err = RDAFM_write(client, 0x02, val); - if(err < 0){ -#ifdef FMDEBUG - FM_DEBUG("RDAFM_GetChipID: reset FM chip failed!\n"); -#endif - ret = -1; - return ret; - } - msleep(80); - - val = 0; - err = RDAFM_read(client, 0x0C, &val); - if (err == 0) - { - if ((0x5802 == val) || (0x5803 == val)) - { - err = RDAFM_read(client, 0x0E, &val); - - if (err == 0) - *pChipID = val; - else - *pChipID = 0x5802; - -#ifdef FMDEBUG - FM_DEBUG("RDAFM_GetChipID: Chip ID = %04X\n", val); -#endif - - ret = 0; - - } - else if ((0x5805 == val) || (0x5820 == val)) - { - *pChipID = val; - ret = 0; - } - else - { -#ifdef FMDEBUG - FM_DEBUG("RDAFM_GetChipID: get chip ID failed! get value = %04X\n", val); -#endif - ret = -1; - } - - } - else - { -#ifdef FMDEBUG - FM_DEBUG("RDAFM_GetChipID: get chip ID failed!\n"); -#endif - ret = -1; - } - - return ret; -} - - -/* - * RDAFM_read - */ -static int RDAFM_read(struct i2c_client *client, uint8_t addr, uint16_t *val) -{ - int n; - char b[2] = {0}; - - // first, send addr to RDAFM - n = i2c_master_send(client, (char*)&addr, 1); - if (n < 0) - { - FM_ALERT("RDAFM_read send:0x%X err:%d\n", addr, n); - return -1; - } - - // second, receive two byte from RDAFM - n = i2c_master_recv(client, b, 2); - if (n < 0) - { - FM_ALERT("RDAFM_read recv:0x%X err:%d\n", addr, n); - return -1; - } - - *val = (uint16_t)(b[0] << 8 | b[1]); - - return 0; -} - -/* - * RDAFM_write - */ -static int RDAFM_write(struct i2c_client *client, uint8_t addr, uint16_t val) -{ - int n; - char b[3]; - - b[0] = addr; - b[1] = (char)(val >> 8); - b[2] = (char)(val & 0xFF); - - n = i2c_master_send(client, b, 3); - if (n < 0) - { - FM_ALERT("RDAFM_write send:0x%X err:%d\n", addr, n); - return -1; - } - - return 0; -} - - -static int RDAFM_clear_hmute(struct i2c_client *client) -{ - int ret = 0; - uint16_t tRegValue = 0; - - FM_DEBUG("RDAFM_clear_hmute\n"); - - ret = RDAFM_read(client, 0x02, &tRegValue); - if (ret < 0) - { - FM_ALERT("RDAFM_clear_hmute read register failed!\n"); - return -1; - } - - tRegValue |= (1 << 14); - - ret = RDAFM_write(client, 0x02, tRegValue); - - if (ret < 0) - { - FM_ALERT("RDAFM_clear_hmute write register failed!\n"); - return -1; - } - - if(fm_tune_data.byPowerUp){ - if (fm_tune(g_fm_struct, &(fm_tune_data.parm)) < 0) - { - fm_tune_data.byPowerUp = false; - memset(&fm_tune_data.parm, 0, sizeof(fm_tune_data.parm)); - return -EPERM; - } - fm_tune_data.byPowerUp = false; - memset(&fm_tune_data.parm, 0, sizeof(fm_tune_data.parm)); - } - - return 0; -} - - - -static int RDAFM_enable_hmute(struct i2c_client *client) -{ - int ret = 0; - uint16_t tRegValue = 0; - - FM_DEBUG("RDAFM_enable_hmute\n"); - - ret = RDAFM_read(client, 0x02, &tRegValue); - if (ret < 0) - { - FM_ALERT("RDAFM_enable_hmute read register failed!\n"); - return -1; - } - - tRegValue &= (~(1 << 14)); - - ret = RDAFM_write(client, 0x02, tRegValue); - - if (ret < 0) - { - FM_ALERT("RDAFM_enable_hmute write register failed!\n"); - return -1; - } - - return 0; -} - - - -static int RDAFM_clear_tune(struct i2c_client *client) -{ - //Don't need it - return 0; -} - - - -static int RDAFM_enable_tune(struct i2c_client *client) -{ - //Don't need it - return 0; -} - - - -static int RDAFM_clear_seek(struct i2c_client *client) -{ - //Don't need it - return 0; -} - - - -static int RDAFM_enable_seek(struct i2c_client *client) -{ - //Don't need it - return 0; -} - - -//b=true set stereo else set mono -static int RDAFM_SetStereo(struct i2c_client *client, uint8_t b) -{ - int ret = 0; - uint16_t tRegValue = 0; - - FM_DEBUG("RDAFM_SetStereo\n"); - - ret = RDAFM_read(client, 0x02, &tRegValue); - if (ret < 0) - { - FM_ALERT("RDAFM_SetStereo read register failed!\n"); - return -1; - } - if (b) - tRegValue &= (~(1 << 13));//set stereo - else - tRegValue |= (1 << 13); //set mono - - ret = RDAFM_write(client, 0x02, tRegValue); - - if (ret < 0) - { - FM_ALERT("RDAFM_SetStereo write register failed!\n"); - return -1; - } - - - return 0; - -} - - -static int RDAFM_SetRSSI_Threshold(struct i2c_client *client, uint8_t RssiThreshold) -{ - int ret = 0; - uint16_t tRegValue = 0; - - FM_DEBUG("RDAFM_SetRSSI_Threshold\n"); - - ret = RDAFM_read(client, 0x05, &tRegValue); - if (ret < 0) - { - FM_ALERT("RDAFM_SetRSSI_Threshold read register failed!\n"); - return -1; - } - - tRegValue &= 0x80FF;//clear valume - tRegValue |= ((RssiThreshold & 0x7f) << 8); //set valume - - ret = RDAFM_write(client, 0x05, tRegValue); - - if (ret < 0) - { - FM_ALERT("RDAFM_SetRSSI_Threshold write register failed!\n"); - return -1; - } - - - return 0; - -} - - - -static int RDAFM_SetDe_Emphasis(struct i2c_client *client, uint8_t index) -{ - int ret = 0; - uint16_t tRegValue = 0; - - FM_DEBUG("RDAFM_SetRSSI_Threshold\n"); - - ret = RDAFM_read(client, 0x04, &tRegValue); - if (ret < 0) - { - FM_ALERT("RDAFM_SetRSSI_Threshold read register failed!\n"); - return -1; - } - - if (0 == index) - { - tRegValue &= (~(1 << 11));//De_Emphasis=75us - } - else if (1 == index) - { - tRegValue |= (1 << 11);//De_Emphasis=50us - } - - - ret = RDAFM_write(client, 0x04, tRegValue); - - if (ret < 0) - { - FM_ALERT("RDAFM_SetRSSI_Threshold write register failed!\n"); - return -1; - } - - - return 0; - - -} - - -static void RDAFM_em_test(struct i2c_client *client, uint16_t group_idx, uint16_t item_idx, uint32_t item_value) -{ - FM_ALERT("RDAFM_em_test %d:%d:%d\n", group_idx, item_idx, item_value); - switch (group_idx) - { - case mono: - if(item_value == 1) - { - RDAFM_SetStereo(client, 0); //force mono - } - else - { - RDAFM_SetStereo(client, 1); //stereo - - } - - break; - case stereo: - if(item_value == 0) - { - RDAFM_SetStereo(client, 1); //stereo - } - else - { - RDAFM_SetStereo(client, 0); //force mono - } - break; - case RSSI_threshold: - item_value &= 0x7F; - RDAFM_SetRSSI_Threshold(client, item_value); - break; - case Softmute_Enable: - if (item_idx) - { - RDAFM_enable_hmute(client); - } - else - { - RDAFM_clear_hmute(client); - } - break; - case De_emphasis: - if(item_idx >= 2) //0us - { - FM_ALERT("RDAFM not support De_emphasis 0\n"); - } - else - { - RDAFM_SetDe_Emphasis(client,item_idx);//0=75us,1=50us - } - break; - - case HL_Side: - - break; - default: - FM_ALERT("RDAFM not support this setting\n"); - break; - } -} - -static bool RDAFM_Scan(struct i2c_client *client, - uint16_t min_freq, uint16_t max_freq, - uint16_t *pFreq, - uint16_t *pScanTBL, - uint16_t *ScanTBLsize, - uint16_t scandir, - uint16_t space) -{ - uint16_t tFreq, tRegValue = 0; - uint16_t tmp_scanTBLsize = *ScanTBLsize; - int ret = -1; - bool isTrueStation = false; - uint16_t oldValue = 0; - int channel = 0; - - if((!pScanTBL) || (tmp_scanTBLsize == 0)) { - return false; - } - - //clear the old value of pScanTBL - memset(pScanTBL, 0, sizeof(uint16_t)*RDA599X_SCANTBL_SIZE); - - if(tmp_scanTBLsize > RDA599X_SCANTBL_SIZE) - { - tmp_scanTBLsize = RDA599X_SCANTBL_SIZE; - } - - //scan up - if(scandir == RDA599X_FM_SCAN_UP){ // now, only support scan up - tFreq = min_freq; - }else{ //scan down - tFreq = max_freq;//max_freq compare need or not - } - - //mute FM - RDAFM_enable_hmute(client); - - //set seekth - tRegValue = 0; - RDAFM_read(client, 0x05, &tRegValue); - tRegValue &= (~(0x7f<<8)); - tRegValue |= ((0x8 & 0x7f) << 8); - RDAFM_write(client, 0x05, tRegValue); - msleep(50); - - atomic_set(&scan_complete_flag, 1); - do { - if(atomic_read(&scan_complete_flag) == 0) - break; - isTrueStation = false; - - //set channel and enable TUNE - tRegValue = 0; - RDAFM_read(client, 0x03, &tRegValue); - tRegValue &= (~(0x03ff<<6)); //clear bit[15:6] - channel = tFreq - min_freq; - tRegValue |= ((channel << 6) | (1 << 4)); //set bit[15:6] and bit[4] - ret = RDAFM_write(client, 0x03, tRegValue); - msleep(40); - - //read 0x0B and check FM_TRUE(bit[8]) - tRegValue = 0; - ret = RDAFM_read(client, 0x0B, &tRegValue); - if(!ret){ - if((tRegValue & 0x0100) == 0x0100){ - isTrueStation = true; - } - } - - //if this freq is a true station, read the channel - if(isTrueStation){ - //tRegValue = 0; - //RDAFM_read(client, 0x03, &tRegValue); - //channel = ((tRegValue>>6) & 0x03ff) - 5; - channel = channel - 5; - if((channel >= 0) && (channel != 85)){ - oldValue = *(pScanTBL+(channel/16)); - oldValue |= (1<<(channel%16)); - *(pScanTBL+(channel/16)) = oldValue; - } - } - - //increase freq - tFreq += space; - }while( tFreq <= max_freq ); - -#if defined(MTK_MT6515) && defined(MT6626) - *(pScanTBL+13) = 0xb2d4; - *(pScanTBL+14) = 0xb2d4; - *(pScanTBL+15) = 0xb2d4; -#endif - - *ScanTBLsize = tmp_scanTBLsize; - *pFreq = 0; - - //clear FM mute - RDAFM_clear_hmute(client); - - return true; -} - - -static int fm_setup_cdev(struct fm *fm) -{ - int err; - - err = alloc_chrdev_region(&fm->dev_t, 0, 1, FM_NAME); - if (err) { - FM_ALERT("alloc dev_t failed\n"); - return -1; - } - - FM_ALERT("alloc %s:%d:%d\n", FM_NAME, - MAJOR(fm->dev_t), MINOR(fm->dev_t)); - - cdev_init(&fm->cdev, &fm_ops); - - fm->cdev.owner = THIS_MODULE; - fm->cdev.ops = &fm_ops; - - err = cdev_add(&fm->cdev, fm->dev_t, 1); - if (err) { - FM_ALERT("alloc dev_t failed\n"); - return -1; - } - - fm->cls = class_create(THIS_MODULE, FM_NAME); - if (IS_ERR(fm->cls)) { - err = PTR_ERR(fm->cls); - FM_ALERT("class_create err:%d\n", err); - return err; - } - fm->dev = device_create(fm->cls, NULL, fm->dev_t, NULL, FM_NAME); - - return 0; -} - - - -static int fm_ops_ioctl(struct file *filp, - unsigned int cmd, unsigned long arg) -{ - int ret = 0; - struct fm *fm = container_of(filp->f_dentry->d_inode->i_cdev, struct fm, cdev); - - FM_DEBUG("%s cmd(%x)\n", __func__, cmd); - - switch(cmd) - { - case FM_IOCTL_POWERUP: - { - struct fm_tune_parm parm; - FM_DEBUG("FM_IOCTL_POWERUP\n"); - - // FIXME!! - // if (!capable(CAP_SYS_ADMIN)) - // return -EPERM; - - if (copy_from_user(&parm, (void*)arg, sizeof(struct fm_tune_parm))) - return -EFAULT; - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - ret = fm_powerup(fm, &parm); - up(&fm_ops_mutex); - if (copy_to_user((void*)arg, &parm, sizeof(struct fm_tune_parm))) - return -EFAULT; - // fm_low_power_wa(1); - break; - } - - case FM_IOCTL_POWERDOWN: - { - FM_DEBUG("FM_IOCTL_POWERDOWN\n"); - // FIXME!! - // if (!capable(CAP_SYS_ADMIN)) - // return -EPERM; - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - ret = fm_powerdown(fm); - up(&fm_ops_mutex); - // fm_low_power_wa(0); - break; - } - - // tune (frequency, auto Hi/Lo ON/OFF ) - case FM_IOCTL_TUNE: - { - struct fm_tune_parm parm; - FM_DEBUG("FM_IOCTL_TUNE\n"); - // FIXME! - // if (!capable(CAP_SYS_ADMIN)) - // return -EPERM; - - if (copy_from_user(&parm, (void*)arg, sizeof(struct fm_tune_parm))) - return -EFAULT; - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - ret = fm_tune(fm, &parm); - up(&fm_ops_mutex); - - if (copy_to_user((void*)arg, &parm, sizeof(struct fm_tune_parm))) - return -EFAULT; - - break; - } - - case FM_IOCTL_SEEK: - { - struct fm_seek_parm parm; - FM_DEBUG("FM_IOCTL_SEEK\n"); - - // FIXME!! - // if (!capable(CAP_SYS_ADMIN)) - // return -EPERM; - - if (copy_from_user(&parm, (void*)arg, sizeof(struct fm_seek_parm))) - return -EFAULT; - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - ret = fm_seek(fm, &parm); - up(&fm_ops_mutex); - - if (copy_to_user((void*)arg, &parm, sizeof(struct fm_seek_parm))) - return -EFAULT; - - break; - } - - case FM_IOCTL_SETVOL: - { - uint32_t vol; - FM_DEBUG("FM_IOCTL_SETVOL\n"); - - // FIXME!! - // if (!capable(CAP_SYS_ADMIN)) - // return -EPERM; - - if(copy_from_user(&vol, (void*)arg, sizeof(uint32_t))) { - FM_ALERT("copy_from_user failed\n"); - return -EFAULT; - } - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - ret = fm_setvol(fm, vol); - up(&fm_ops_mutex); - - break; - } - - case FM_IOCTL_GETVOL: - { - uint32_t vol; - FM_DEBUG("FM_IOCTL_GETVOL\n"); - - // FIXME!! - // if (!capable(CAP_SYS_ADMIN)) - // return -EPERM; - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - ret = fm_getvol(fm, &vol); - up(&fm_ops_mutex); - - if (copy_to_user((void*)arg, &vol, sizeof(uint32_t))) - return -EFAULT; - - break; - } - - case FM_IOCTL_MUTE: - { - uint32_t bmute; - FM_DEBUG("FM_IOCTL_MUTE\n"); - - // FIXME!! - // if (!capable(CAP_SYS_ADMIN)) - // return -EPERM; - if (copy_from_user(&bmute, (void*)arg, sizeof(uint32_t))) - { - FM_DEBUG("copy_from_user mute failed!\n"); - return -EFAULT; - } - - FM_DEBUG("FM_IOCTL_MUTE:%d\n", bmute); - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - - if (bmute){ - ret = RDAFM_enable_hmute(fm->i2c_client); - }else{ - ret = RDAFM_clear_hmute(fm->i2c_client); - } - - up(&fm_ops_mutex); - - break; - } - - case FM_IOCTL_GETRSSI: - { - uint32_t rssi; - FM_DEBUG("FM_IOCTL_GETRSSI\n"); - - // FIXME!! - // if (!capable(CAP_SYS_ADMIN)) - // return -EPERM; - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - - ret = fm_getrssi(fm, &rssi); - up(&fm_ops_mutex); - - if (copy_to_user((void*)arg, &rssi, sizeof(uint32_t))) - return -EFAULT; - - break; - } - - case FM_IOCTL_RW_REG: - { - struct fm_ctl_parm parm_ctl; - FM_DEBUG("FM_IOCTL_RW_REG\n"); - - // FIXME!! - // if (!capable(CAP_SYS_ADMIN)) - // return -EPERM; - - if (copy_from_user(&parm_ctl, (void*)arg, sizeof(struct fm_ctl_parm))) - return -EFAULT; - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - - if(parm_ctl.rw_flag == 0) //write - { - ret = RDAFM_write(fm->i2c_client, parm_ctl.addr, parm_ctl.val); - } - else - { - ret = RDAFM_read(fm->i2c_client, parm_ctl.addr, &parm_ctl.val); - } - - up(&fm_ops_mutex); - if ((parm_ctl.rw_flag == 0x01) && (!ret)) // Read success. - { - if (copy_to_user((void*)arg, &parm_ctl, sizeof(struct fm_ctl_parm))) - return -EFAULT; - } - break; - } - - case FM_IOCTL_GETCHIPID: - { - uint16_t chipid; - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - - RDAFM_GetChipID(fm->i2c_client, &chipid); - //chipid = fm->chip_id; - chipid = 0x6620; - FM_DEBUG("FM_IOCTL_GETCHIPID:%04x\n", chipid); - up(&fm_ops_mutex); - - if (copy_to_user((void*)arg, &chipid, sizeof(uint16_t))) - return -EFAULT; - - break; - } - - case FM_IOCTL_EM_TEST: - { - struct fm_em_parm parm_em; - FM_DEBUG("FM_IOCTL_EM_TEST\n"); - - // FIXME!! - // if (!capable(CAP_SYS_ADMIN)) - // return -EPERM; - - if (copy_from_user(&parm_em, (void*)arg, sizeof(struct fm_em_parm))) - return -EFAULT; - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - - RDAFM_em_test(fm->i2c_client, parm_em.group_idx, parm_em.item_idx, parm_em.item_value); - - up(&fm_ops_mutex); - - break; - } - case FM_IOCTL_IS_FM_POWERED_UP: - { - uint32_t powerup; - FM_DEBUG("FM_IOCTL_IS_FM_POWERED_UP"); - if (fm->powerup) { - powerup = 1; - } else { - powerup = 0; - } - if (copy_to_user((void*)arg, &powerup, sizeof(uint32_t))) - return -EFAULT; - break; - } - -#ifdef FMDEBUG - case FM_IOCTL_DUMP_REG: - { - uint16_t chipid = 0; - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - RDAFM_GetChipID(fm->i2c_client, &chipid); - up(&fm_ops_mutex); - - break; - } -#endif - - case FM_IOCTL_SCAN: - { - struct fm_scan_parm parm; - FM_DEBUG("FM_IOCTL_SCAN\n"); - if (false == fm->powerup){ - return -EFAULT; - } - if(copy_from_user(&parm, (void*)arg, sizeof(struct fm_scan_parm))){ - return -EFAULT; - } - if (down_interruptible(&fm_ops_mutex)){ - return -EFAULT; - } - fm_scan(fm, &parm); - up(&fm_ops_mutex); - - if(copy_to_user((void*)arg, &parm, sizeof(struct fm_scan_parm))){ - return -EFAULT; - } - - break; - } - - case FM_IOCTL_STOP_SCAN: - { - FM_DEBUG("FM_IOCTL_STOP_SCAN\n"); - break; - } - - default: - { - FM_DEBUG("default\n"); - break; - } - } - - return ret; -} -static loff_t fm_ops_lseek(struct file *filp, loff_t off, int whence) -{ -// struct fm *fm = filp->private_data; - - if(whence == SEEK_END){ - //fm_hwscan_stop(fm); - atomic_set(&scan_complete_flag, 0); - }else if(whence == SEEK_SET){ - //FM_EVENT_SEND(fm->rds_event, FM_RDS_DATA_READY); - } - return off; -} - -static int fm_ops_open(struct inode *inode, struct file *filp) -{ - struct fm *fm = container_of(inode->i_cdev, struct fm, cdev); - - FM_DEBUG("%s\n", __func__); - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - - // TODO: only have to set in the first time? - // YES!!!! - - fm->ref++; - - up(&fm_ops_mutex); - - filp->private_data = fm; - - // TODO: check open flags - - return 0; -} - -static int fm_ops_release(struct inode *inode, struct file *filp) -{ - int err = 0; - struct fm *fm = container_of(inode->i_cdev, struct fm, cdev); - - FM_DEBUG("%s\n", __func__); - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - fm->ref--; - if(fm->ref < 1) { - if(fm->powerup == true) { - fm_powerdown(fm); - } - } - - up(&fm_ops_mutex); - - return err; -} - -static int fm_init(struct i2c_client *client) -{ - int err; - struct fm *fm = NULL; - int ret = -1; - - - FM_DEBUG("%s()\n", __func__); - if (!(fm = kzalloc(sizeof(struct fm), GFP_KERNEL))) - { - FM_ALERT("-ENOMEM\n"); - err = -ENOMEM; - goto ERR_EXIT; - } - - fm->ref = 0; - fm->powerup = false; - atomic_set(&scan_complete_flag, 0); - - // First, read 5802NM chip ID - FM_DEBUG("%s()First, read 5802NM chip ID\n", __func__); - ret = RDAFM_GetChipID(client, &RDAFM_CHIP_ID); - FM_DEBUG("%s() 5802NM chip ID = 0x%04x\n", __func__, RDAFM_CHIP_ID); - // if failed, means use FM in 5990P_E - if(ret < 0){ - // enable the FM chip in combo - FM_DEBUG("%s() enable the FM chip in combo\n", __func__); - ret = rda_fm_power_on(); - if(ret < 0){ - err = -ENOMEM; - goto ERR_EXIT; - } - msleep(100); - ret = RDAFM_GetChipID(client, &RDAFM_CHIP_ID); - FM_DEBUG("%s() the FM in combo chip ID = 0x%04x\n", __func__, RDAFM_CHIP_ID); - if(ret < 0){ - err = -ENOMEM; - goto ERR_EXIT; - }else{ - fm->chip_id = RDAFM_CHIP_ID; - } - - // disable the FM chip for power saving - ret = rda_fm_power_off(); - if(ret < 0){ - err = -ENOMEM; - goto ERR_EXIT; - } - }else{ - fm->chip_id = RDAFM_CHIP_ID; - } - - - - if ((err = fm_setup_cdev(fm))) - { - goto ERR_EXIT; - } - - g_fm_struct = fm; - fm->i2c_client = client; - i2c_set_clientdata(client, fm); - - - /***********Add porc file system*************/ - - g_fm_proc = create_proc_entry(FM_PROC_FILE, 0444, NULL); - if (g_fm_proc == NULL) { - FM_ALERT("create_proc_entry failed\n"); - err = -ENOMEM; - goto ERR_EXIT; - } else { - g_fm_proc->read_proc = fm_proc_read; - g_fm_proc->write_proc = NULL; - //g_fm_proc->owner = THIS_MODULE; - FM_ALERT("create_proc_entry success\n"); - } - - /********************************************/ - - FM_DEBUG("fm_init is ok!\n"); - - return 0; - -ERR_EXIT: - kfree(fm); - - return err; -} - -static int fm_proc_read(char *page, char **start, off_t off, int count, int *eof, void *data) -{ - int cnt= 0; - struct fm *fm = g_fm_struct; - FM_ALERT("Enter fm_proc_read.\n"); - if(off != 0) - return 0; - if (fm != NULL && fm->powerup) { - cnt = sprintf(page, "1\n"); - } else { - cnt = sprintf(page, "0\n"); - } - *eof = 1; - FM_ALERT("Leave fm_proc_read. cnt = %d\n", cnt); - return cnt; -} - - -static int fm_destroy(struct fm *fm) -{ - int err = 0; - - FM_DEBUG("%s\n", __func__); - - device_destroy(fm->cls, fm->dev_t); - class_destroy(fm->cls); - - cdev_del(&fm->cdev); - unregister_chrdev_region(fm->dev_t, 1); - - fm_powerdown(fm); - - /***********************************/ - remove_proc_entry(FM_PROC_FILE, NULL); - - /**********************************/ - - // FIXME: any other hardware configuration ? - - // free all memory - kfree(fm); - - return err; -} - -/* - * fm_powerup - */ -static int fm_powerup(struct fm *fm, struct fm_tune_parm *parm) -{ - int i; - uint16_t tRegValue = 0x0002; - int ret = -1; - - struct i2c_client *client = fm->i2c_client; - - if (fm->powerup) - { - parm->err = FM_BADSTATUS; - return -EPERM; - } - - // if chip_id is ID_RDA5820NS, enable the FM chip in combo - if(fm->chip_id == ID_RDA5820NS){ - ret = rda_fm_power_on(); - if(ret < 0){ - return -EPERM; - } - msleep(100); - } - - - //Reset RDA FM - tRegValue = 0x0002; - RDAFM_write(client, 0x02, tRegValue); - msleep(100); - - - if (ID_RDA5802N == RDAFM_CHIP_ID){ - for (i=0; i<((sizeof(RDA5802N_initialization_reg)) / (sizeof(uint16_t))); i++) - { - ret = RDAFM_write(client, i+2, RDA5802N_initialization_reg[i]); - - if (ret < 0) - { - FM_DEBUG("fm_powerup init failed!\n"); - - parm->err = FM_FAILED; - - return -EPERM; - } - } - - }else if (ID_RDA5820NS == RDAFM_CHIP_ID){ - if(RDA_RADIO_WorkType == FM_RECEIVER){ - for (i = 0; i < ((sizeof(RDA5820NS_RX_initialization_reg)) / (sizeof(RDA_FM_REG_T))); i++) - { - if(RDA5820NS_RX_initialization_reg[i].address == 0xFF){ - msleep(RDA5820NS_RX_initialization_reg[i].value); - }else{ - ret = RDAFM_write(client, RDA5820NS_RX_initialization_reg[i].address, RDA5820NS_RX_initialization_reg[i].value); - if (ret < 0) - { - FM_DEBUG("fm_powerup init failed!\n"); - parm->err = FM_FAILED; - return -EPERM; - } - } - } - }else{ - for (i = 0; i < ((sizeof(RDA5820NS_TX_initialization_reg)) / (sizeof(RDA_FM_REG_T))); i++) - { - if(RDA5820NS_TX_initialization_reg[i].address == 0xFF){ - msleep(RDA5820NS_TX_initialization_reg[i].value); - }else{ - ret = RDAFM_write(client, RDA5820NS_TX_initialization_reg[i].address, RDA5820NS_TX_initialization_reg[i].value); - if (ret < 0) - { - FM_DEBUG("fm_powerup init failed!\n"); - parm->err = FM_FAILED; - return -EPERM; - } - } - } - } - - } - - - FM_DEBUG("pwron ok\n"); - fm->powerup = true; - - if (fm_tune(fm, parm) < 0) - { - return -EPERM; - } - fm_tune_data.byPowerUp = true; - memcpy(&fm_tune_data.parm, parm, sizeof(fm_tune_data.parm)); - - parm->err = FM_SUCCESS; - - return 0; - -} - -/* - * fm_powerdown - */ -static int fm_powerdown(struct fm *fm) -{ - uint16_t tRegValue = 0; - int ret = -1; - struct i2c_client *client = fm->i2c_client; - - RDAFM_read(client, 0x02, &tRegValue); - tRegValue &= (~(1 << 0)); - RDAFM_write(client, 0x02, tRegValue); - - if(fm->chip_id == ID_RDA5820NS){ - ret = rda_fm_power_off(); - if(ret < 0){ - return -EPERM; - } - } - - fm->powerup = false; - FM_ALERT("pwrdown ok\n"); - - return 0; -} - -/* - * fm_seek - */ -static int fm_seek(struct fm *fm, struct fm_seek_parm *parm) -{ - int ret = 0; - uint16_t val = 0; - uint8_t spaec = 1; - uint16_t tFreq = 875; - uint16_t tRegValue = 0; - uint16_t bottomOfBand = 875; - int falseStation = -1; - - - struct i2c_client *client = fm->i2c_client; - - if (!fm->powerup) - { - parm->err = FM_BADSTATUS; - return -EPERM; - } - - if (parm->space == FM_SPACE_100K) - { - spaec = 1; - val &= (~((1<<0) | (1<<1))); - } - else if (parm->space == FM_SPACE_200K) - { - spaec = 2; - val &= (~(1<<1)); - val |= (1<<0); - } - else - { - parm->err = FM_EPARM; - return -EPERM; - } - - if (parm->band == FM_BAND_UE) - { - val &= (~((1<<2) | (1<<3))); - bottomOfBand = 875; - fm->min_freq = 875; - fm->max_freq = 1080; - } - else if (parm->band == FM_BAND_JAPAN) - { - val &= (~(1<<3)); - val |= (1 << 2); - bottomOfBand = 760; - fm->min_freq = 760; - fm->max_freq = 910; - } - else if (parm->band == FM_BAND_JAPANW) { - val &= (~(1<<2)); - val |= (1 << 3); - bottomOfBand = 760; - fm->min_freq = 760; - fm->max_freq = 1080; - } - else - { - FM_ALERT("band:%d out of range\n", parm->band); - parm->err = FM_EPARM; - return -EPERM; - } - - if (parm->freq < fm->min_freq || parm->freq > fm->max_freq) { - FM_ALERT("freq:%d out of range\n", parm->freq); - parm->err = FM_EPARM; - return -EPERM; - } - - if (parm->seekth > 0x0B) { - FM_ALERT("seekth:%d out of range\n", parm->seekth); - parm->err = FM_EPARM; - return -EPERM; - } - - RDAFM_read(client, 0x05, &tRegValue); - tRegValue &= (~(0x7f<<8)); - //tRegValue |= ((parm->seekth & 0x7f) << 8); - tRegValue |= ((0x8 & 0x7f) << 8); - RDAFM_write(client, 0x05, tRegValue); - - -#ifdef FMDEBUG - if (parm->seekdir == FM_SEEK_UP) - FM_DEBUG("seek %d up\n", parm->freq); - else - FM_DEBUG("seek %d down\n", parm->freq); -#endif - - // (1) set hmute bit - RDAFM_enable_hmute(client); - - tFreq = parm->freq; - - do { - if (parm->seekdir == FM_SEEK_UP) - tFreq += spaec; - else - tFreq -= spaec; - - if (tFreq > fm->max_freq) - tFreq = fm->min_freq; - if (tFreq < fm->min_freq) - tFreq = fm->max_freq; - - val = (((tFreq - bottomOfBand+5) << 6) | (1 << 4) | (val & 0x0f)); - RDAFM_write(client, 0x03, val); - msleep(40); - ret = RDAFM_read(client, 0x0B, &tRegValue); - if (ret < 0) - { - FM_DEBUG("fm_seek: read register failed tunning freq = %4X\n", tFreq); - falseStation = -1; - } - else - { - if ((tRegValue & 0x0100) == 0x0100) - falseStation = 0; - else - falseStation = -1; - } - - if(falseStation == 0) - break; - }while(tFreq != parm->freq); - - - //clear hmute - RDAFM_clear_hmute(client); - - if (falseStation == 0) // seek successfully - { - parm->freq = tFreq; - FM_ALERT("fm_seek success, freq:%d\n", parm->freq); - parm->err = FM_SUCCESS; - - - } - else - { - FM_ALERT("fm_seek failed, invalid freq\n"); - parm->err = FM_SEEK_FAILED; - ret = -1; - } - - return ret; -} - -/* - * fm_scan - */ -static int fm_scan(struct fm *fm, struct fm_scan_parm *parm) -{ - int ret = 0; - uint16_t tRegValue = 0; - uint16_t scandir = RDA599X_FM_SCAN_UP; //scandir ËÑË÷·½Ïò - uint8_t space = 1; - struct i2c_client *client = fm->i2c_client; - - if (!fm->powerup){ - parm->err = FM_BADSTATUS; - return -EPERM; - } - - RDAFM_read(client, 0x03, &tRegValue); - - if (parm->space == FM_SPACE_100K){ - space = 1; - tRegValue &= (~((1<<0) | (1<<1))); //set 03H's bit[1:0] to 00 - }else if (parm->space == FM_SPACE_200K) { - space = 2; - tRegValue &= (~(1<<1)); //clear bit[1] - tRegValue |= (1<<0); //set bit[0] - }else{ - //default - space = 1; - tRegValue &= (~((1<<0) | (1<<1))); //set 03H's bit[1:0] to 00 - } - - if(parm->band == FM_BAND_UE){ - tRegValue &= (~((1<<2) | (1<<3))); - fm->min_freq = 875; - fm->max_freq = 1080; - }else if(parm->band == FM_BAND_JAPAN){ - tRegValue &= (~(1<<3)); - tRegValue |= (1 << 2); - fm->min_freq = 760; - fm->max_freq = 900; - }else if(parm->band == FM_BAND_JAPANW){ - tRegValue &= (~(1<<2)); - tRegValue |= (1 << 3); - fm->min_freq = 760; - fm->max_freq = 1080; - }else{ - parm->err = FM_EPARM; - return -EPERM; - } - - //set space and band - RDAFM_write(client, 0x03, tRegValue); - msleep(40); - - - if(RDAFM_Scan(client, fm->min_freq, fm->max_freq, &(parm->freq), parm->ScanTBL, &(parm->ScanTBLSize), scandir, space)){ - parm->err = FM_SUCCESS; - }else{ - parm->err = FM_SEEK_FAILED; - } - - return ret; -} - - -static int fm_setvol(struct fm *fm, uint32_t vol) -{ - int ret = 0; - uint16_t tRegValue = 0; - struct i2c_client *client = fm->i2c_client; - - if (vol > 15) - vol = 15; - - FM_DEBUG("fm_setvol:%d\n", vol); - - ret = RDAFM_read(client, 0x05, &tRegValue); - if (ret) - return -EPERM; - tRegValue &= ~(0x000f); - tRegValue |= vol; - - ret = RDAFM_write(client, 0x05, tRegValue); - if (ret) - return -EPERM; - - return 0; -} - -static int fm_getvol(struct fm *fm, uint32_t *vol) -{ - int ret = 0; - uint16_t tRegValue; - struct i2c_client *client = fm->i2c_client; - - ret = RDAFM_read(client, 0x05, &tRegValue); - if (ret) - return -EPERM; - - if (ret) - return -EPERM; - - *vol = (tRegValue & 0x000F); - - return 0; -} - -static int fm_getrssi(struct fm *fm, uint32_t *rssi) -{ - int ret = 0; - uint16_t tRegValue; - struct i2c_client *client = fm->i2c_client; - - ret = RDAFM_read(client, 0x0B, &tRegValue); - if (ret) - return -EPERM; - - - *rssi = (uint32_t)((tRegValue >> 9) & RDAFM_MASK_RSSI); - - FM_DEBUG("rssi value:%d\n", *rssi); - - return 0; -} - -/* - * fm_tune - */ -static int fm_tune(struct fm *fm, struct fm_tune_parm *parm) -{ - int ret; - uint16_t val = 0; - uint8_t space = 1; - uint16_t bottomOfBand = 875; - - struct i2c_client *client = fm->i2c_client; - - FM_DEBUG("%s\n", __func__); - - if (!fm->powerup) - { - parm->err = FM_BADSTATUS; - return -EPERM; - } - - if (parm->space == FM_SPACE_100K) - { - space = 1; - val &= (~((1<<0) | (1<<1))); - } - else if (parm->space == FM_SPACE_200K) - { - space = 2; - val |= (1<<0); - val &= (~(1<<1)); - } - else - { - parm->err = FM_EPARM; - return -EPERM; - } - - if (parm->band == FM_BAND_UE) - { - val &= (~((1<<2) | (1<<3))); - bottomOfBand = 875; - fm->min_freq = 875; - fm->max_freq = 1080; - } - else if (parm->band == FM_BAND_JAPAN) - { - val &= (~(1<<3)); - val |= (1 << 2); - bottomOfBand = 760; - fm->min_freq = 760; - fm->max_freq = 910; - } - else if (parm->band == FM_BAND_JAPANW) { - val &= (~(1<<2)); - val |= (1 << 3); - bottomOfBand = 760; - fm->min_freq = 760; - fm->max_freq = 1080; - } - else - { - FM_ALERT("band:%d out of range\n", parm->band); - parm->err = FM_EPARM; - return -EPERM; - } - - if (parm->freq < fm->min_freq || parm->freq > fm->max_freq) { - FM_ALERT("freq:%d out of range\n", parm->freq); - parm->err = FM_EPARM; - return -EPERM; - } - - FM_DEBUG("fm_tune, freq:%d\n", parm->freq); - - //RDAFM_enable_hmute(client); - - val = (((parm->freq - bottomOfBand + 5) << 6) | (1 << 4) | (val & 0x0f)); - - ret = RDAFM_write(client, 0x03, val); - if (ret < 0) - { - FM_ALERT("fm_tune write freq failed\n"); - parm->err = FM_SEEK_FAILED; - return ret; - } - msleep(40); - - return ret; -} - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) -/* - * fm_i2c_attach_adapter - */ -static int fm_i2c_attach_adapter(struct i2c_adapter *adapter) -{ - int err = 0; - - if (adapter->id == RDAFM_I2C_PORT) - { - return i2c_probe(adapter, &RDAFM_addr_data, fm_i2c_detect); - } - - return err; -} - -/* - * fm_i2c_detect - * This function is called by i2c_detect - */ -static int fm_i2c_detect(struct i2c_adapter *adapter, int addr, int kind) -{ - int err; - struct i2c_client *client = NULL; - - /* skip this since MT6516 shall support all the needed functionalities - if (!i2c_check_functionality(adapter, xxx)) - { - FM_DEBUG("i2c_check_functionality failed\n"); - return -ENOTSUPP; - } - */ - - /* initial i2c client */ - if (!(client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL))) - { - FM_ALERT("kzalloc failed\n"); - err = -ENOMEM; - goto ERR_EXIT; - } - - client->addr = addr; - client->adapter = adapter; - client->driver = &RDAFM_driver; - client->flags = 0; - strncpy(client->name, "RDA FM RADIO", I2C_NAME_SIZE); - - if ((err = fm_init(client))) - { - FM_ALERT("fm_init ERR:%d\n", err); - goto ERR_EXIT; - } - - if (err = i2c_attach_client(client)) - { - FM_ALERT("i2c_attach_client ERR:%d\n", err); - goto ERR_EXIT; - } - - return 0; - -ERR_EXIT: - kfree(client); - - return err; -} -static int fm_i2c_detach_client(struct i2c_client *client) -{ - int err = 0; - struct fm *fm = i2c_get_clientdata(client); - - FM_DEBUG("fm_i2c_detach_client\n"); - - err = i2c_detach_client(client); - if (err) - { - dev_err(&client->dev, "fm_i2c_detach_client failed\n"); - return err; - } - - fm_destroy(fm); - kfree(client); - - return err; -} -#else -static int fm_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) -{ - int err = -1; - FM_DEBUG("fm_i2c_probe\n"); - //client->timing = 50; - //client->timing = 200; - if ((err = fm_init(client))) - { - FM_ALERT("fm_init ERR:%d\n", err); - goto ERR_EXIT; - } - - return 0; - -ERR_EXIT: - return err; -} - -static int fm_i2c_detect(struct i2c_client *client, int kind, struct i2c_board_info *info) -{ - FM_DEBUG("fm_i2c_detect\n"); - strcpy(info->type, RDAFM_DEV); - return 0; -} - -static int fm_i2c_remove(struct i2c_client *client) -{ - int err = 0; - struct fm *fm = i2c_get_clientdata(client); - - FM_DEBUG("fm_i2c_remove\n"); - if(fm) - { - fm_destroy(fm); - fm = NULL; - } - - return err; -} -#endif - -int i2c_static_add_device(struct i2c_board_info *info) -{ - struct i2c_adapter *adapter; - struct i2c_client *client; - int ret; - - adapter = i2c_get_adapter(RDAFM_I2C_PORT); - if (!adapter) { - FM_DEBUG("%s: can't get i2c adapter\n", __func__); - ret = -ENODEV; - goto i2c_err; - } - - client = i2c_new_device(adapter, info); - if (!client) { - FM_DEBUG("%s: can't add i2c device at 0x%x\n", - __FUNCTION__, (unsigned int)info->addr); - ret = -ENODEV; - goto i2c_err; - } - - i2c_put_adapter(adapter); - - return 0; - -i2c_err: - return ret; -} - -static int mt_fm_probe(struct platform_device *pdev) -{ - int err = -1; - FM_ALERT("mt_fm_probe\n"); - err = i2c_static_add_device(&i2c_rdafm); - if (err < 0){ - FM_DEBUG("%s(): add i2c device error, err = %d\n", __func__, err); - return err; - } - - // Open I2C driver - err = i2c_add_driver(&RDAFM_driver); - if (err) - { - FM_ALERT("i2c err\n"); - } - - return err; -} - -static int mt_fm_remove(struct platform_device *pdev) -{ - FM_ALERT("mt_fm_remove\n"); - i2c_unregister_device(g_fm_struct->i2c_client); - i2c_del_driver(&RDAFM_driver); - - return 0; -} - - -static struct platform_driver mt_fm_dev_drv = -{ - .probe = mt_fm_probe, - .remove = mt_fm_remove, -#if 0//def CONFIG_PM //Not need now - .suspend = mt_fm_suspend, - .resume = mt_fm_resume, -#endif - .driver = { - .name = FM_NAME, - .owner = THIS_MODULE, - } -}; - -#if defined(MTK_MT6515) -static struct platform_device mt_fm_device = { - .name = FM_NAME, - .id = -1, -}; -#endif - - -/* - * mt_fm_init - */ -static int __init mt_fm_init(void) -{ - int err = 0; - - FM_DEBUG("mt_fm_init\n"); -#if defined(MTK_MT6515) - err = platform_device_register(&mt_fm_device); - if(err){ - FM_DEBUG("platform_device_register fail\n"); - return err; - }else{ - FM_DEBUG("platform_device_register success\n"); - } -#endif - err = platform_driver_register(&mt_fm_dev_drv); - if (err) - { - FM_DEBUG("platform_driver_register failed\n"); - }else{ - FM_DEBUG("platform_driver_register success\n"); - } - - return err; -} - -/* - * mt_fm_exit - */ -static void __exit mt_fm_exit(void) -{ - FM_DEBUG("mt_fm_exit\n"); - platform_driver_unregister(&mt_fm_dev_drv); -#if defined(MTK_MT6515) - platform_device_unregister(&mt_fm_device); -#endif -} - -module_init(mt_fm_init); -module_exit(mt_fm_exit); - -MODULE_LICENSE("GPL"); -MODULE_DESCRIPTION("MediaTek FM Driver"); -MODULE_AUTHOR("William Chung "); - - diff --git a/drivers/net/wireless/rda5990/drv_fm_rda/RDA5990_FM_drv_gpio.c b/drivers/net/wireless/rda5990/drv_fm_rda/RDA5990_FM_drv_gpio.c deleted file mode 100755 index b154fbcaa5cd..000000000000 --- a/drivers/net/wireless/rda5990/drv_fm_rda/RDA5990_FM_drv_gpio.c +++ /dev/null @@ -1,1784 +0,0 @@ -#include -#include -#include -#include // udelay() -#include // device_create() -#include -#include -#include -#include -#include /* constant of kernel version */ -#include // get_user() - -#include -#include -#include -#include -#include -#include - -// if need debug, define FMDEBUG -//#define FMDEBUG - -// if your platform is MT6515/6575, define MTK_MT6515 -#define MTK_MT6515 - -// if your platform is MT6515/6575 and MTK FM is MT6626, define MT6626 -//#define MT6626 - -#define FM_ALERT(f, s...) \ - do { \ - printk(KERN_ALERT "RDAFM " f, ## s); \ - } while(0) - -#ifdef FMDEBUG -#define FM_DEBUG(f, s...) \ - do { \ - printk("RDAFM " f, ## s); \ - } while(0) -#else -#define FM_DEBUG(f, s...) -#endif - -#define RDA599X_SCANTBL_SIZE 16 //16*uinit16_t -#define RDA599X_FM_SCAN_UP 0x0 -#define RDA599X_FM_SCAN_DOWN 0x01 - -extern int rda_gpio_i2c_read_1_addr_2_data(uint8_t chipAddr, uint8_t regAddr, unsigned short *buffer); -extern int rda_gpio_i2c_write_1_addr_2_data(uint8_t chipAddr, uint8_t regAddr, unsigned short data); -extern int rda_fm_power_off(void); -extern int rda_fm_power_on(void); - -/****************************************************************************** - * CONSTANT DEFINITIONS - *****************************************************************************/ -#define RDAFM_SLAVE_ADDR 0x11 //RDA FM Chip address - -#define RDAFM_MASK_RSSI 0X7F // RSSI - - - -#define ID_RDA5802E 0x5804 -#define ID_RDA5802H 0x5801 -#define ID_RDA5802N 0x5808 -#define ID_RDA5820 0x5805 -#define ID_RDA5820NS 0x5820 - - - -static struct proc_dir_entry *g_fm_proc = NULL; -static struct fm *g_fm_struct = NULL; -static atomic_t scan_complete_flag; - -#define FM_PROC_FILE "fm" - -/****************************************************************************** - * STRUCTURE DEFINITIONS - *****************************************************************************/ - -enum RDAFM_CHIP_TYPE { - CHIP_TYPE_RDA5802E = 0, - CHIP_TYPE_RDA5802H, - CHIP_TYPE_RDA5802N, - CHIP_TYPE_RDA5820, - CHIP_TYPE_RDA5820NS, -}; - - -typedef struct -{ - uint8_t address; - uint16_t value; -}RDA_FM_REG_T; - -typedef struct -{ - bool byPowerUp; - struct fm_tune_parm parm -}FM_TUNE_T; -static FM_TUNE_T fm_tune_data = {false, {}}; - -typedef enum -{ - FM_RECEIVER, //5800,5802,5804 - FM_TRANSMITTER, //5820 -}RDA_RADIO_WORK_E; - -typedef enum -{ - OFF, - ON, -}RDA_FM_POWER_STATE_T; - -struct fm { - uint32_t ref; - bool powerup; - uint16_t chip_id; - // uint16_t device_id; - uint8_t chipAddr; - dev_t dev_t; - uint16_t min_freq; // KHz - uint16_t max_freq; // KHz - uint8_t band; // TODO - struct class *cls; - struct device *dev; - struct cdev cdev; - // struct i2c_client *i2c_client; -}; - - - - -/****************************************************************************** - * FUNCTION PROTOTYPES - *****************************************************************************/ - - -static int RDAFM_clear_hmute(uint8_t chipAddr); -static int RDAFM_enable_hmute(uint8_t chipAddr); -static bool RDAFM_Scan(uint8_t chipAddr, - uint16_t min_freq, uint16_t max_freq, - uint16_t *pFreq, //get the valid freq after scan - uint16_t *pScanTBL, - uint16_t *ScanTBLsize, - uint16_t scandir, - uint16_t space); - - -static int RDAFM_read(uint8_t chipAddr, uint8_t addr, uint16_t *val); -static int RDAFM_write(uint8_t chipAddr, uint8_t addr, uint16_t val); -static int fm_setup_cdev(struct fm *fm); -static int fm_ops_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); -static loff_t fm_ops_lseek(struct file *filp, loff_t off, int whence); -static int fm_ops_open(struct inode *inode, struct file *filp); -static int fm_ops_release(struct inode *inode, struct file *filp); - -static int fm_init(void); -static int fm_destroy(struct fm *fm); -static int fm_powerup(struct fm *fm, struct fm_tune_parm *parm); -static int fm_powerdown(struct fm *fm); - -static int fm_tune(struct fm *fm, struct fm_tune_parm *parm); -static int fm_seek(struct fm *fm, struct fm_seek_parm *parm); -static int fm_scan(struct fm *fm, struct fm_scan_parm *parm); -static int fm_setvol(struct fm *fm, uint32_t vol); -static int fm_getvol(struct fm *fm, uint32_t *vol); -static int fm_getrssi(struct fm *fm, uint32_t *rssi); -static int fm_proc_read(char *page, char **start, off_t off, int count, int *eof, void *data); - - - - - - -static uint16_t RDAFM_CHIP_ID = 0x5808; -static RDA_RADIO_WORK_E RDA_RADIO_WorkType = FM_RECEIVER; - - - -#if 1 -static uint16_t RDA5802N_initialization_reg[]={ - 0xC005, //02h - 0x0000, - 0x0400, - 0xC6ED, //0x86AD, //05h - 0x6000, - 0x721A, //0x42C6 - 0x0000, - 0x0000, - 0x0000, //0x0ah - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, //0x10h - 0x0019, - 0x2A11, - 0xB042, - 0x2A11, - 0xB831, //0x15h - 0xC000, - 0x2A91, - 0x9400, - 0x00A8, - 0xc400, //0x1ah - 0xF7CF, //Ìá¸ßÔ¶¶ËÔëÉùÒÖÖÆ - 0x2414, //0x2ADC, //0x1ch ÌáÉýVIO VDDÖ®¼äѹ²îÒýÆðµÄ²»Á¼ - 0x806F, - 0x4608, - 0x0086, - 0x0661, //0x20H - 0x0000, - 0x109E, - 0x23C8, - 0x0406, - 0x0E1C, //0x25H -}; -#else -static uint16_t RDA5802N_initialization_reg[]={ - 0xc401, //02h - 0x0000, - 0x0400, - 0x86ad, //05h// - 0x0000, - 0x42c6, - 0x0000, - 0x0000, - 0x0000, //0x0ah - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, //0x10h - 0x0019, - 0x2a11, - 0xa053,//0x80,0x53, - 0x3e11,//0x22,0x11, - 0xfc7d, //0x15h - 0xc000, - 0x2a91, - 0x9400, - 0x00a8, - 0xc400, //0x1ah - 0xe000, - 0x2b1d, //0x23,0x14 - 0x816a, - 0x4608, - 0x0086, - 0x0661, //0x20h - 0x0000, - 0x109e, - 0x2244, - 0x0408, //0x24 - 0x0408, //0x25 -}; -#endif - -static RDA_FM_REG_T RDA5820NS_TX_initialization_reg[]={ - {0x02, 0xE003}, - {0xFF, 100}, // if address is 0xFF, sleep value ms - {0x02, 0xE001}, - {0x19, 0x88A8}, - {0x1A, 0x4290}, - {0x68, 0x0AF0}, - {0x40, 0x0001}, - {0x41, 0x41FF}, - {0xFF, 500}, - {0x03, 0x1B90}, -}; - -static RDA_FM_REG_T RDA5820NS_RX_initialization_reg[]={ - {0x02, 0x0002}, //Soft reset - {0xFF, 100}, // wait - {0x02, 0xC001}, //Power Up - {0x05, 0x888F}, //LNAP 0x884F --LNAN - {0x06, 0x6000}, - {0x13, 0x80E1}, - {0x14, 0x2A11}, - {0x1C, 0x22DE}, - {0x21, 0x0020}, - {0x03, 0x1B90}, -}; - - - -static struct file_operations fm_ops = { - .owner = THIS_MODULE, - .unlocked_ioctl = fm_ops_ioctl, - .llseek = fm_ops_lseek, - .open = fm_ops_open, - .release = fm_ops_release, -}; - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) -static DECLARE_MUTEX(fm_ops_mutex); -#else -DEFINE_SEMAPHORE(fm_ops_mutex); -#endif - -static int RDAFM_GetChipID(uint8_t chipAddr, uint16_t *pChipID) -{ - int err; - int ret = -1; - uint16_t val = 0x0002; - - //Reset RDA FM - err = RDAFM_write(chipAddr, 0x02, val); - if(err < 0){ -#ifdef FMDEBUG - FM_DEBUG("RDAFM_GetChipID: reset FM chip failed!\n"); -#endif - ret = -1; - return ret; - } - msleep(80); - - val = 0; - err = RDAFM_read(chipAddr, 0x0C, &val); - if (err == 0) - { - if ((0x5802 == val) || (0x5803 == val)) - { - err = RDAFM_read(chipAddr, 0x0E, &val); - - if (err == 0) - *pChipID = val; - else - *pChipID = 0x5802; - -#ifdef FMDEBUG - FM_DEBUG("RDAFM_GetChipID: Chip ID = %04X\n", val); -#endif - - ret = 0; - - } - else if ((0x5805 == val) || (0x5820 == val)) - { - *pChipID = val; - ret = 0; - } - else - { -#ifdef FMDEBUG - FM_DEBUG("RDAFM_GetChipID: get chip ID failed! get value = %04X\n", val); -#endif - ret = -1; - } - - } - else - { -#ifdef FMDEBUG - FM_DEBUG("RDAFM_GetChipID: get chip ID failed!\n"); -#endif - ret = -1; - } - - return ret; -} - - -/* - * RDAFM_read - */ -static int RDAFM_read(uint8_t chipAddr, uint8_t regAddr, uint16_t *val) -{ - int ret = -1; - ret = rda_gpio_i2c_read_1_addr_2_data(chipAddr, regAddr, val); - - return ret; -} - -/* - * RDAFM_write - */ -static int RDAFM_write(uint8_t chipAddr, uint8_t regAddr, uint16_t val) -{ - int n; - - n = rda_gpio_i2c_write_1_addr_2_data(chipAddr, regAddr, val); - if (n < 0) - { - FM_ALERT("RDAFM_write send:0x%X err:%d\n", regAddr, n); - return -1; - } - - return 0; -} - - -static int RDAFM_clear_hmute(uint8_t chipAddr) -{ - int ret = 0; - uint16_t tRegValue = 0; - - FM_DEBUG("RDAFM_clear_hmute\n"); - - ret = RDAFM_read(chipAddr, 0x02, &tRegValue); - if (ret < 0) - { - FM_ALERT("RDAFM_clear_hmute read register failed!\n"); - return -1; - } - - tRegValue |= (1 << 14); - - ret = RDAFM_write(chipAddr, 0x02, tRegValue); - - if (ret < 0) - { - FM_ALERT("RDAFM_clear_hmute write register failed!\n"); - return -1; - } - - if(fm_tune_data.byPowerUp){ - if (fm_tune(g_fm_struct, &(fm_tune_data.parm)) < 0) - { - fm_tune_data.byPowerUp = false; - memset(&fm_tune_data.parm, 0, sizeof(fm_tune_data.parm)); - return -EPERM; - } - fm_tune_data.byPowerUp = false; - memset(&fm_tune_data.parm, 0, sizeof(fm_tune_data.parm)); - } - - return 0; -} - - - -static int RDAFM_enable_hmute(uint8_t chipAddr) -{ - int ret = 0; - uint16_t tRegValue = 0; - - FM_DEBUG("RDAFM_enable_hmute\n"); - - ret = RDAFM_read(chipAddr, 0x02, &tRegValue); - if (ret < 0) - { - FM_ALERT("RDAFM_enable_hmute read register failed!\n"); - return -1; - } - - tRegValue &= (~(1 << 14)); - - ret = RDAFM_write(chipAddr, 0x02, tRegValue); - - if (ret < 0) - { - FM_ALERT("RDAFM_enable_hmute write register failed!\n"); - return -1; - } - - return 0; -} - - -static bool RDAFM_Scan(uint8_t chipAddr, - uint16_t min_freq, uint16_t max_freq, - uint16_t *pFreq, - uint16_t *pScanTBL, - uint16_t *ScanTBLsize, - uint16_t scandir, - uint16_t space) -{ - uint16_t tFreq, tRegValue = 0; - uint16_t tmp_scanTBLsize = *ScanTBLsize; - int ret = -1; - bool isTrueStation = false; - uint16_t oldValue = 0; - int channel = 0; - - if((!pScanTBL) || (tmp_scanTBLsize == 0)) { - return false; - } - - //clear the old value of pScanTBL - memset(pScanTBL, 0, sizeof(uint16_t)*RDA599X_SCANTBL_SIZE); - - if(tmp_scanTBLsize > RDA599X_SCANTBL_SIZE) - { - tmp_scanTBLsize = RDA599X_SCANTBL_SIZE; - } - - //scan up - if(scandir == RDA599X_FM_SCAN_UP){ // now, only support scan up - tFreq = min_freq; - }else{ //scan down - tFreq = max_freq;//max_freq compare need or not - } - - //mute FM - RDAFM_enable_hmute(chipAddr); - - //set seekth - tRegValue = 0; - RDAFM_read(chipAddr, 0x05, &tRegValue); - tRegValue &= (~(0x7f<<8)); - tRegValue |= ((0x8 & 0x7f) << 8); - RDAFM_write(chipAddr, 0x05, tRegValue); - msleep(50); - - atomic_set(&scan_complete_flag, 1); - - do { - if(atomic_read(&scan_complete_flag) == 0) - break; - isTrueStation = false; - - //set channel and enable TUNE - tRegValue = 0; - RDAFM_read(chipAddr, 0x03, &tRegValue); - tRegValue &= (~(0x03ff<<6)); //clear bit[15:6] - channel = tFreq - min_freq; - tRegValue |= ((channel << 6) | (1 << 4)); //set bit[15:6] and bit[4] - ret = RDAFM_write(chipAddr, 0x03, tRegValue); - msleep(40); - - //read 0x0B and check FM_TRUE(bit[8]) - tRegValue = 0; - ret = RDAFM_read(chipAddr, 0x0B, &tRegValue); - if(!ret){ - if((tRegValue & 0x0100) == 0x0100){ - isTrueStation = true; - } - } - - //if this freq is a true station, read the channel - if(isTrueStation){ - //tRegValue = 0; - //RDAFM_read(chipAddr, 0x0A, &tRegValue); - //channel = ((tRegValue) & 0x03ff) - 5; - channel = channel - 5; - if((channel >= 0) && (channel != 85)){ - oldValue = *(pScanTBL+(channel/16)); - oldValue |= (1<<(channel%16)); - *(pScanTBL+(channel/16)) = oldValue; - } - } - - //increase freq - tFreq += space; - }while( tFreq <= max_freq ); - -#if defined(MTK_MT6515) && defined(MT6626) - *(pScanTBL+13) = 0xb2d4; - *(pScanTBL+14) = 0xb2d4; - *(pScanTBL+15) = 0xb2d4; -#endif - - *ScanTBLsize = tmp_scanTBLsize; - *pFreq = 0; - - //clear FM mute - RDAFM_clear_hmute(chipAddr); - - return true; -} - - -static int fm_setup_cdev(struct fm *fm) -{ - int err; - - err = alloc_chrdev_region(&fm->dev_t, 0, 1, FM_NAME); - if (err) { - FM_ALERT("alloc dev_t failed\n"); - return -1; - } - - FM_ALERT("alloc %s:%d:%d\n", FM_NAME, - MAJOR(fm->dev_t), MINOR(fm->dev_t)); - - cdev_init(&fm->cdev, &fm_ops); - - fm->cdev.owner = THIS_MODULE; - fm->cdev.ops = &fm_ops; - - err = cdev_add(&fm->cdev, fm->dev_t, 1); - if (err) { - FM_ALERT("alloc dev_t failed\n"); - return -1; - } - - fm->cls = class_create(THIS_MODULE, FM_NAME); - if (IS_ERR(fm->cls)) { - err = PTR_ERR(fm->cls); - FM_ALERT("class_create err:%d\n", err); - return err; - } - fm->dev = device_create(fm->cls, NULL, fm->dev_t, NULL, FM_NAME); - - return 0; -} - - - -static int fm_ops_ioctl(struct file *filp, - unsigned int cmd, unsigned long arg) -{ - int ret = 0; - struct fm *fm = container_of(filp->f_dentry->d_inode->i_cdev, struct fm, cdev); - - FM_DEBUG("%s cmd(%x)\n", __func__, cmd); - - switch(cmd) - { - case FM_IOCTL_POWERUP: - { - struct fm_tune_parm parm; - FM_DEBUG("FM_IOCTL_POWERUP\n"); - - if (copy_from_user(&parm, (void*)arg, sizeof(struct fm_tune_parm))) - return -EFAULT; - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - ret = fm_powerup(fm, &parm); - up(&fm_ops_mutex); - if (copy_to_user((void*)arg, &parm, sizeof(struct fm_tune_parm))) - return -EFAULT; - break; - } - - case FM_IOCTL_POWERDOWN: - { - FM_DEBUG("FM_IOCTL_POWERDOWN\n"); - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - ret = fm_powerdown(fm); - up(&fm_ops_mutex); - break; - } - - // tune (frequency, auto Hi/Lo ON/OFF ) - case FM_IOCTL_TUNE: - { - struct fm_tune_parm parm; - FM_DEBUG("FM_IOCTL_TUNE\n"); - - if (copy_from_user(&parm, (void*)arg, sizeof(struct fm_tune_parm))) - return -EFAULT; - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - ret = fm_tune(fm, &parm); - up(&fm_ops_mutex); - - if (copy_to_user((void*)arg, &parm, sizeof(struct fm_tune_parm))) - return -EFAULT; - - break; - } - - case FM_IOCTL_SEEK: - { - struct fm_seek_parm parm; - FM_DEBUG("FM_IOCTL_SEEK\n"); - - if (copy_from_user(&parm, (void*)arg, sizeof(struct fm_seek_parm))) - return -EFAULT; - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - ret = fm_seek(fm, &parm); - up(&fm_ops_mutex); - - if (copy_to_user((void*)arg, &parm, sizeof(struct fm_seek_parm))) - return -EFAULT; - - break; - } - - case FM_IOCTL_SETVOL: - { - uint32_t vol; - FM_DEBUG("FM_IOCTL_SETVOL\n"); - - if(copy_from_user(&vol, (void*)arg, sizeof(uint32_t))) { - FM_ALERT("copy_from_user failed\n"); - return -EFAULT; - } - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - ret = fm_setvol(fm, vol); - up(&fm_ops_mutex); - - break; - } - - case FM_IOCTL_GETVOL: - { - uint32_t vol; - FM_DEBUG("FM_IOCTL_GETVOL\n"); - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - ret = fm_getvol(fm, &vol); - up(&fm_ops_mutex); - - if (copy_to_user((void*)arg, &vol, sizeof(uint32_t))) - return -EFAULT; - - break; - } - - case FM_IOCTL_MUTE: - { - uint32_t bmute; - FM_DEBUG("FM_IOCTL_MUTE\n"); - - if (copy_from_user(&bmute, (void*)arg, sizeof(uint32_t))) - { - FM_DEBUG("copy_from_user mute failed!\n"); - return -EFAULT; - } - - FM_DEBUG("FM_IOCTL_MUTE:%d\n", bmute); - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - - if (bmute){ - ret = RDAFM_enable_hmute(fm->chipAddr); - }else{ - ret = RDAFM_clear_hmute(fm->chipAddr); - } - - up(&fm_ops_mutex); - - break; - } - - case FM_IOCTL_GETRSSI: - { - uint32_t rssi; - FM_DEBUG("FM_IOCTL_GETRSSI\n"); - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - - ret = fm_getrssi(fm, &rssi); - up(&fm_ops_mutex); - - if (copy_to_user((void*)arg, &rssi, sizeof(uint32_t))) - return -EFAULT; - - break; - } - - case FM_IOCTL_RW_REG: - { - struct fm_ctl_parm parm_ctl; - FM_DEBUG("FM_IOCTL_RW_REG\n"); - - if (copy_from_user(&parm_ctl, (void*)arg, sizeof(struct fm_ctl_parm))) - return -EFAULT; - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - - if(parm_ctl.rw_flag == 0) //write - { - ret = RDAFM_write(fm->chipAddr, parm_ctl.addr, parm_ctl.val); - } - else - { - ret = RDAFM_read(fm->chipAddr, parm_ctl.addr, &parm_ctl.val); - } - - up(&fm_ops_mutex); - if ((parm_ctl.rw_flag == 0x01) && (!ret)) // Read success. - { - if (copy_to_user((void*)arg, &parm_ctl, sizeof(struct fm_ctl_parm))) - return -EFAULT; - } - break; - } - - case FM_IOCTL_GETCHIPID: - { - uint16_t chipid; - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - - RDAFM_GetChipID(fm->chipAddr, &chipid); - //chipid = fm->chip_id; - chipid = 0x6620; - FM_DEBUG("FM_IOCTL_GETCHIPID:%04x\n", chipid); - up(&fm_ops_mutex); - - if (copy_to_user((void*)arg, &chipid, sizeof(uint16_t))) - return -EFAULT; - - break; - } - - case FM_IOCTL_IS_FM_POWERED_UP: - { - uint32_t powerup; - FM_DEBUG("FM_IOCTL_IS_FM_POWERED_UP"); - if (fm->powerup) { - powerup = 1; - } else { - powerup = 0; - } - if (copy_to_user((void*)arg, &powerup, sizeof(uint32_t))) - return -EFAULT; - break; - } - -#ifdef FMDEBUG - case FM_IOCTL_DUMP_REG: - { - uint16_t chipid = 0; - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - RDAFM_GetChipID(fm->chipAddr, &chipid); - up(&fm_ops_mutex); - - break; - } -#endif - - case FM_IOCTL_SCAN: - { - struct fm_scan_parm parm; - FM_DEBUG("FM_IOCTL_SCAN\n"); - if (false == fm->powerup){ - return -EFAULT; - } - if(copy_from_user(&parm, (void*)arg, sizeof(struct fm_scan_parm))){ - return -EFAULT; - } - if (down_interruptible(&fm_ops_mutex)){ - return -EFAULT; - } - fm_scan(fm, &parm); - up(&fm_ops_mutex); - - if(copy_to_user((void*)arg, &parm, sizeof(struct fm_scan_parm))){ - return -EFAULT; - } - - break; - } - - case FM_IOCTL_STOP_SCAN: - { - FM_DEBUG("FM_IOCTL_STOP_SCAN\n"); - break; - } - - case FM_IOCTL_SCAN_GETRSSI: - { - FM_DEBUG("FM_IOCTL_SCAN_GETRSSI\n"); - break; - } - - case FM_IOCTL_GETMONOSTERO: - { - FM_DEBUG("FM_IOCTL_GETMONOSTERO\n"); - break; - } - - case FM_IOCTL_SETMONOSTERO: - { - FM_DEBUG("FM_IOCTL_SETMONOSTERO\n"); - break; - } - - case FM_IOCTL_GETCURPAMD: - { - FM_DEBUG("FM_IOCTL_GETCURPAMD\n"); - break; - } - - case FM_IOCTL_EM_TEST: - { - FM_DEBUG("FM_IOCTL_EM_TEST\n"); - break; - } - - case FM_IOCTL_RDS_SUPPORT: - { - FM_DEBUG("FM_IOCTL_RDS_SUPPORT\n"); - break; - } - - case FM_IOCTL_RDS_ONOFF: - { - FM_DEBUG("FM_IOCTL_RDS_ONOFF\n"); - break; - } - - case FM_IOCTL_GETGOODBCNT: - { - FM_DEBUG("FM_IOCTL_GETGOODBCNT\n"); - break; - } - - case FM_IOCTL_GETBADBNT: - { - FM_DEBUG("FM_IOCTL_GETBADBNT\n"); - break; - } - - case FM_IOCTL_GETBLERRATIO: - { - FM_DEBUG("FM_IOCTL_GETBLERRATIO\n"); - break; - } - - case FM_IOCTL_POWERUP_TX: - { - FM_DEBUG("FM_IOCTL_POWERUP_TX\n"); - break; - } - - case FM_IOCTL_TUNE_TX: - { - FM_DEBUG("FM_IOCTL_TUNE_TX\n"); - break; - } - - case FM_IOCTL_TX_SUPPORT: - { - FM_DEBUG("FM_IOCTL_TX_SUPPORT\n"); - break; - } - - case FM_IOCTL_RDSTX_ENABLE: - { - FM_DEBUG("FM_IOCTL_RDSTX_ENABLE\n"); - break; - } - - case FM_IOCTL_RDSTX_SUPPORT: - { - FM_DEBUG("FM_IOCTL_RDSTX_SUPPORT\n"); - break; - } - - case FM_IOCTL_TX_SCAN: - { - FM_DEBUG("FM_IOCTL_TX_SCAN\n"); - break; - } - - case FM_IOCTL_RDS_TX: - { - FM_DEBUG("FM_IOCTL_RDS_TX\n"); - break; - } - - case FM_IOCTL_OVER_BT_ENABLE: - { - FM_DEBUG("FM_IOCTL_OVER_BT_ENABLE\n"); - break; - } - - case FM_IOCTL_ANA_SWITCH: - { - FM_DEBUG("FM_IOCTL_ANA_SWITCH\n"); - break; - } - - case FM_IOCTL_GETCAPARRAY: - { - FM_DEBUG("FM_IOCTL_GETCAPARRAY\n"); - break; - } - - case FM_IOCTL_GPS_RTC_DRIFT: - { - FM_DEBUG("FM_IOCTL_GPS_RTC_DRIFT\n"); - break; - } - - case FM_IOCTL_I2S_SETTING: - { - FM_DEBUG("FM_IOCTL_I2S_SETTING\n"); - break; - } - - case FM_IOCTL_RDS_GROUPCNT: - { - FM_DEBUG("FM_IOCTL_RDS_GROUPCNT\n"); - break; - } - - case FM_IOCTL_RDS_GET_LOG: - { - FM_DEBUG("FM_IOCTL_RDS_GET_LOG\n"); - break; - } - - case FM_IOCTL_GET_HW_INFO: - { - FM_DEBUG("FM_IOCTL_GET_HW_INFO\n"); - break; - } - default: - { - FM_DEBUG("default\n"); - break; - } - } - - return ret; -} -static loff_t fm_ops_lseek(struct file *filp, loff_t off, int whence) -{ -// struct fm *fm = filp->private_data; - - if(whence == SEEK_END){ - //fm_hwscan_stop(fm); - atomic_set(&scan_complete_flag, 0); - }else if(whence == SEEK_SET){ - //FM_EVENT_SEND(fm->rds_event, FM_RDS_DATA_READY); - } - return off; -} - -static int fm_ops_open(struct inode *inode, struct file *filp) -{ - struct fm *fm = container_of(inode->i_cdev, struct fm, cdev); - - FM_DEBUG("%s\n", __func__); - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - - // TODO: only have to set in the first time? - // YES!!!! - - fm->ref++; - - up(&fm_ops_mutex); - - filp->private_data = fm; - - // TODO: check open flags - - return 0; -} - -static int fm_ops_release(struct inode *inode, struct file *filp) -{ - int err = 0; - struct fm *fm = container_of(inode->i_cdev, struct fm, cdev); - - FM_DEBUG("%s\n", __func__); - - if (down_interruptible(&fm_ops_mutex)) - return -EFAULT; - fm->ref--; - if(fm->ref < 1) { - if(fm->powerup == true) { - fm_powerdown(fm); - } - } - - up(&fm_ops_mutex); - - return err; -} - -static int fm_init(void) -{ - int err; - struct fm *fm = NULL; - int ret = -1; - - - FM_DEBUG("%s()\n", __func__); - if (!(fm = kzalloc(sizeof(struct fm), GFP_KERNEL))) - { - FM_ALERT("-ENOMEM\n"); - err = -ENOMEM; - goto ERR_EXIT; - } - - fm->ref = 0; - fm->powerup = false; - fm->chipAddr = RDAFM_SLAVE_ADDR; - atomic_set(&scan_complete_flag, 0); - - // First, read 5802NM chip ID - FM_DEBUG("%s()First, read 5802NM chip ID\n", __func__); - ret = RDAFM_GetChipID(fm->chipAddr, &RDAFM_CHIP_ID); - FM_DEBUG("%s() 5802NM chip ID = 0x%04x\n", __func__, RDAFM_CHIP_ID); - // if failed, means use FM in 5990P_E - if(ret < 0){ - // enable the FM chip in combo - FM_DEBUG("%s() enable the FM chip in combo\n", __func__); - ret = rda_fm_power_on(); - if(ret < 0){ - err = -ENOMEM; - goto ERR_EXIT; - } - msleep(100); - ret = RDAFM_GetChipID(fm->chipAddr, &RDAFM_CHIP_ID); - FM_DEBUG("%s() the FM in combo chip ID = 0x%04x\n", __func__, RDAFM_CHIP_ID); - if(ret < 0){ - err = -ENOMEM; - goto ERR_EXIT; - }else{ - fm->chip_id = RDAFM_CHIP_ID; - } - - // disable the FM chip for power saving - ret = rda_fm_power_off(); - if(ret < 0){ - err = -ENOMEM; - goto ERR_EXIT; - } - }else{ - fm->chip_id = RDAFM_CHIP_ID; - } - - - - if ((err = fm_setup_cdev(fm))) - { - goto ERR_EXIT; - } - - g_fm_struct = fm; - - /***********Add porc file system*************/ - - g_fm_proc = create_proc_entry(FM_PROC_FILE, 0444, NULL); - if (g_fm_proc == NULL) { - FM_ALERT("create_proc_entry failed\n"); - err = -ENOMEM; - goto ERR_EXIT; - } else { - g_fm_proc->read_proc = fm_proc_read; - g_fm_proc->write_proc = NULL; - //g_fm_proc->owner = THIS_MODULE; - FM_ALERT("create_proc_entry success\n"); - } - - /********************************************/ - - FM_DEBUG("fm_init is ok!\n"); - - return 0; - -ERR_EXIT: - kfree(fm); - - return err; -} - -static int fm_proc_read(char *page, char **start, off_t off, int count, int *eof, void *data) -{ - int cnt= 0; - struct fm *fm = g_fm_struct; - FM_ALERT("Enter fm_proc_read.\n"); - if(off != 0) - return 0; - if (fm != NULL && fm->powerup) { - cnt = sprintf(page, "1\n"); - } else { - cnt = sprintf(page, "0\n"); - } - *eof = 1; - FM_ALERT("Leave fm_proc_read. cnt = %d\n", cnt); - return cnt; -} - - -static int fm_destroy(struct fm *fm) -{ - int err = 0; - - FM_DEBUG("%s\n", __func__); - - device_destroy(fm->cls, fm->dev_t); - class_destroy(fm->cls); - - cdev_del(&fm->cdev); - unregister_chrdev_region(fm->dev_t, 1); - - fm_powerdown(fm); - - /***********************************/ - remove_proc_entry(FM_PROC_FILE, NULL); - - /**********************************/ - - // FIXME: any other hardware configuration ? - - // free all memory - kfree(fm); - - return err; -} - -/* - * fm_powerup - */ -static int fm_powerup(struct fm *fm, struct fm_tune_parm *parm) -{ - int i; - uint16_t tRegValue = 0x0002; - int ret = -1; - - - if (fm->powerup) - { - parm->err = FM_BADSTATUS; - return -EPERM; - } - - // if chip_id is ID_RDA5820NS, enable the FM chip in combo - if(fm->chip_id == ID_RDA5820NS){ - ret = rda_fm_power_on(); - if(ret < 0){ - return -EPERM; - } - msleep(100); - } - - - //Reset RDA FM - tRegValue = 0x0002; - RDAFM_write(fm->chipAddr, 0x02, tRegValue); - msleep(100); - - - - if (ID_RDA5802N == RDAFM_CHIP_ID){ - for (i=0; i<((sizeof(RDA5802N_initialization_reg)) / (sizeof(uint16_t))); i++) - { - ret = RDAFM_write(fm->chipAddr, i+2, RDA5802N_initialization_reg[i]); - - if (ret < 0) - { - FM_DEBUG("fm_powerup init failed!\n"); - - parm->err = FM_FAILED; - - return -EPERM; - } - } - - }else if (ID_RDA5820NS == RDAFM_CHIP_ID){ - if(RDA_RADIO_WorkType == FM_RECEIVER){ - for (i = 0; i < ((sizeof(RDA5820NS_RX_initialization_reg)) / (sizeof(RDA_FM_REG_T))); i++) - { - if(RDA5820NS_RX_initialization_reg[i].address == 0xFF){ - msleep(RDA5820NS_RX_initialization_reg[i].value); - }else{ - ret = RDAFM_write(fm->chipAddr, RDA5820NS_RX_initialization_reg[i].address, RDA5820NS_RX_initialization_reg[i].value); - if (ret < 0) - { - FM_DEBUG("fm_powerup init failed!\n"); - parm->err = FM_FAILED; - return -EPERM; - } - } - } - }else{ - for (i = 0; i < ((sizeof(RDA5820NS_TX_initialization_reg)) / (sizeof(RDA_FM_REG_T))); i++) - { - if(RDA5820NS_TX_initialization_reg[i].address == 0xFF){ - msleep(RDA5820NS_TX_initialization_reg[i].value); - }else{ - ret = RDAFM_write(fm->chipAddr, RDA5820NS_TX_initialization_reg[i].address, RDA5820NS_TX_initialization_reg[i].value); - if (ret < 0) - { - FM_DEBUG("fm_powerup init failed!\n"); - parm->err = FM_FAILED; - return -EPERM; - } - } - } - } - - } - - - FM_DEBUG("pwron ok\n"); - fm->powerup = true; - - if (fm_tune(fm, parm) < 0) - { - return -EPERM; - } - fm_tune_data.byPowerUp = true; - memcpy(&fm_tune_data.parm, parm, sizeof(fm_tune_data.parm)); - - parm->err = FM_SUCCESS; - - return 0; - -} - -/* - * fm_powerdown - */ -static int fm_powerdown(struct fm *fm) -{ - uint16_t tRegValue = 0; - int ret = -1; - - RDAFM_read(fm->chipAddr, 0x02, &tRegValue); - tRegValue &= (~(1 << 0)); - RDAFM_write(fm->chipAddr, 0x02, tRegValue); - - if(fm->chip_id == ID_RDA5820NS){ - ret = rda_fm_power_off(); - if(ret < 0){ - return -EPERM; - } - } - - fm->powerup = false; - FM_ALERT("pwrdown ok\n"); - - return 0; -} - -/* - * fm_seek - */ -static int fm_seek(struct fm *fm, struct fm_seek_parm *parm) -{ - int ret = 0; - uint16_t val = 0; - uint8_t spaec = 1; - uint16_t tFreq = 875; - uint16_t tRegValue = 0; - uint16_t bottomOfBand = 875; - int falseStation = -1; - - - if (!fm->powerup) - { - parm->err = FM_BADSTATUS; - return -EPERM; - } - - if (parm->space == FM_SPACE_100K) - { - spaec = 1; - val &= (~((1<<0) | (1<<1))); - } - else if (parm->space == FM_SPACE_200K) - { - spaec = 2; - val &= (~(1<<1)); - val |= (1<<0); - } - else - { - parm->err = FM_EPARM; - return -EPERM; - } - - if (parm->band == FM_BAND_UE) - { - val &= (~((1<<2) | (1<<3))); - bottomOfBand = 875; - fm->min_freq = 875; - fm->max_freq = 1080; - } - else if (parm->band == FM_BAND_JAPAN) - { - val &= (~(1<<3)); - val |= (1 << 2); - bottomOfBand = 760; - fm->min_freq = 760; - fm->max_freq = 910; - } - else if (parm->band == FM_BAND_JAPANW) { - val &= (~(1<<2)); - val |= (1 << 3); - bottomOfBand = 760; - fm->min_freq = 760; - fm->max_freq = 1080; - } - else - { - FM_ALERT("band:%d out of range\n", parm->band); - parm->err = FM_EPARM; - return -EPERM; - } - - if (parm->freq < fm->min_freq || parm->freq > fm->max_freq) { - FM_ALERT("freq:%d out of range\n", parm->freq); - parm->err = FM_EPARM; - return -EPERM; - } - - if (parm->seekth > 0x0B) { - FM_ALERT("seekth:%d out of range\n", parm->seekth); - parm->err = FM_EPARM; - return -EPERM; - } - - RDAFM_read(fm->chipAddr, 0x05, &tRegValue); - tRegValue &= (~(0x7f<<8)); - //tRegValue |= ((parm->seekth & 0x7f) << 8); - tRegValue |= ((0x8 & 0x7f) << 8); - RDAFM_write(fm->chipAddr, 0x05, tRegValue); - - -#ifdef FMDEBUG - if (parm->seekdir == FM_SEEK_UP) - FM_DEBUG("seek %d up\n", parm->freq); - else - FM_DEBUG("seek %d down\n", parm->freq); -#endif - - // (1) set hmute bit - RDAFM_enable_hmute(fm->chipAddr); - - tFreq = parm->freq; - - do { - - if (parm->seekdir == FM_SEEK_UP) - tFreq += spaec; - else - tFreq -= spaec; - - if (tFreq > fm->max_freq) - tFreq = fm->min_freq; - if (tFreq < fm->min_freq) - tFreq = fm->max_freq; - - val = (((tFreq - bottomOfBand+5) << 6) | (1 << 4) | (val & 0x0f)); - RDAFM_write(fm->chipAddr, 0x03, val); - msleep(40); - ret = RDAFM_read(fm->chipAddr, 0x0B, &tRegValue); - if (ret < 0) - { - FM_DEBUG("fm_seek: read register failed tunning freq = %4X\n", tFreq); - falseStation = -1; - } - else - { - if ((tRegValue & 0x0100) == 0x0100) - falseStation = 0; - else - falseStation = -1; - } - - if(falseStation == 0) - break; - - }while(tFreq != parm->freq); - - - //clear hmute - RDAFM_clear_hmute(fm->chipAddr); - - if (falseStation == 0) // seek successfully - { - parm->freq = tFreq; - FM_ALERT("fm_seek success, freq:%d\n", parm->freq); - parm->err = FM_SUCCESS; - - } - else - { - FM_ALERT("fm_seek failed, invalid freq\n"); - parm->err = FM_SEEK_FAILED; - ret = -1; - } - - return ret; -} - -/* - * fm_scan - */ -static int fm_scan(struct fm *fm, struct fm_scan_parm *parm) -{ - int ret = 0; - uint16_t tRegValue = 0; - uint16_t scandir = RDA599X_FM_SCAN_UP; //scandir ËÑË÷·½Ïò - uint8_t space = 1; - - if (!fm->powerup){ - parm->err = FM_BADSTATUS; - return -EPERM; - } - - RDAFM_read(fm->chipAddr, 0x03, &tRegValue); - - if (parm->space == FM_SPACE_100K){ - space = 1; - tRegValue &= (~((1<<0) | (1<<1))); //set 03H's bit[1:0] to 00 - }else if (parm->space == FM_SPACE_200K) { - space = 2; - tRegValue &= (~(1<<1)); //clear bit[1] - tRegValue |= (1<<0); //set bit[0] - }else{ - //default - space = 1; - tRegValue &= (~((1<<0) | (1<<1))); //set 03H's bit[1:0] to 00 - } - - if(parm->band == FM_BAND_UE){ - tRegValue &= (~((1<<2) | (1<<3))); - fm->min_freq = 875; - fm->max_freq = 1080; - }else if(parm->band == FM_BAND_JAPAN){ - tRegValue &= (~(1<<3)); - tRegValue |= (1 << 2); - fm->min_freq = 760; - fm->max_freq = 900; - }else if(parm->band == FM_BAND_JAPANW){ - tRegValue &= (~(1<<2)); - tRegValue |= (1 << 3); - fm->min_freq = 760; - fm->max_freq = 1080; - }else{ - parm->err = FM_EPARM; - return -EPERM; - } - - //set space and band - RDAFM_write(fm->chipAddr, 0x03, tRegValue); - msleep(40); - - - if(RDAFM_Scan(fm->chipAddr, fm->min_freq, fm->max_freq, &(parm->freq), parm->ScanTBL, &(parm->ScanTBLSize), scandir, space)){ - parm->err = FM_SUCCESS; - }else{ - parm->err = FM_SEEK_FAILED; - } - - return ret; -} - - -static int fm_setvol(struct fm *fm, uint32_t vol) -{ - int ret = 0; - uint16_t tRegValue = 0; - - if (vol > 15) - vol = 15; - - FM_DEBUG("fm_setvol:%d\n", vol); - - ret = RDAFM_read(fm->chipAddr, 0x05, &tRegValue); - if (ret) - return -EPERM; - tRegValue &= ~(0x000f); - tRegValue |= vol; - - ret = RDAFM_write(fm->chipAddr, 0x05, tRegValue); - if (ret) - return -EPERM; - - return 0; -} - -static int fm_getvol(struct fm *fm, uint32_t *vol) -{ - int ret = 0; - uint16_t tRegValue; - - ret = RDAFM_read(fm->chipAddr, 0x05, &tRegValue); - if (ret) - return -EPERM; - - if (ret) - return -EPERM; - - *vol = (tRegValue & 0x000F); - - return 0; -} - -static int fm_getrssi(struct fm *fm, uint32_t *rssi) -{ - int ret = 0; - uint16_t tRegValue; - - ret = RDAFM_read(fm->chipAddr, 0x0B, &tRegValue); - if (ret) - return -EPERM; - - - *rssi = (uint32_t)((tRegValue >> 9) & RDAFM_MASK_RSSI); - - FM_DEBUG("rssi value:%d\n", *rssi); - - return 0; -} - -/* - * fm_tune - */ -static int fm_tune(struct fm *fm, struct fm_tune_parm *parm) -{ - int ret; - uint16_t val = 0; - uint8_t space = 1; - uint16_t bottomOfBand = 875; - - - FM_DEBUG("%s\n", __func__); - - if (!fm->powerup) - { - parm->err = FM_BADSTATUS; - return -EPERM; - } - - if (parm->space == FM_SPACE_100K) - { - space = 1; - val &= (~((1<<0) | (1<<1))); - } - else if (parm->space == FM_SPACE_200K) - { - space = 2; - val |= (1<<0); - val &= (~(1<<1)); - } - else - { - parm->err = FM_EPARM; - return -EPERM; - } - - if (parm->band == FM_BAND_UE) - { - val &= (~((1<<2) | (1<<3))); - bottomOfBand = 875; - fm->min_freq = 875; - fm->max_freq = 1080; - } - else if (parm->band == FM_BAND_JAPAN) - { - val &= (~(1<<3)); - val |= (1 << 2); - bottomOfBand = 760; - fm->min_freq = 760; - fm->max_freq = 910; - } - else if (parm->band == FM_BAND_JAPANW) { - val &= (~(1<<2)); - val |= (1 << 3); - bottomOfBand = 760; - fm->min_freq = 760; - fm->max_freq = 1080; - } - else - { - FM_ALERT("band:%d out of range\n", parm->band); - parm->err = FM_EPARM; - return -EPERM; - } - - if (parm->freq < fm->min_freq || parm->freq > fm->max_freq) { - FM_ALERT("freq:%d out of range\n", parm->freq); - parm->err = FM_EPARM; - return -EPERM; - } - - FM_DEBUG("fm_tune, freq:%d\n", parm->freq); - - - val = (((parm->freq - bottomOfBand + 5) << 6) | (1 << 4) | (val & 0x0f)); - - ret = RDAFM_write(fm->chipAddr, 0x03, val); - if (ret < 0) - { - FM_ALERT("fm_tune write freq failed\n"); - parm->err = FM_SEEK_FAILED; - return ret; - } - msleep(40); - - return ret; -} - - -static int mt_fm_probe(struct platform_device *pdev) -{ - int err = -1; - FM_DEBUG("mt_fm_probe\n"); - - if ((err = fm_init())) - { - FM_ALERT("fm_init ERR:%d\n", err); - } - - return err; -} - -static int mt_fm_remove(struct platform_device *pdev) -{ - FM_DEBUG("mt_fm_remove\n"); - - struct fm *fm = g_fm_struct; - if(fm) - { - fm_destroy(fm); - fm = NULL; - } - - return 0; -} - - -static struct platform_driver mt_fm_dev_drv = -{ - .probe = mt_fm_probe, - .remove = mt_fm_remove, - .driver = { - .name = FM_NAME, - .owner = THIS_MODULE, - } -}; - -#if defined(MTK_MT6515) -static struct platform_device mt_fm_device = { - .name = FM_NAME, - .id = -1, -}; -#endif - - -/* - * mt_fm_init - */ -static int __init mt_fm_init(void) -{ - int err = 0; - - FM_DEBUG("mt_fm_init\n"); -#if defined(MTK_MT6515) - err = platform_device_register(&mt_fm_device); - if(err){ - FM_DEBUG("platform_device_register fail\n"); - return err; - }else{ - FM_DEBUG("platform_device_register success\n"); - } -#endif - err = platform_driver_register(&mt_fm_dev_drv); - if (err) - { - FM_DEBUG("platform_driver_register failed\n"); - }else{ - FM_DEBUG("platform_driver_register success\n"); - } - - return err; -} - -/* - * mt_fm_exit - */ -static void __exit mt_fm_exit(void) -{ - FM_DEBUG("mt_fm_exit\n"); - platform_driver_unregister(&mt_fm_dev_drv); -#if defined(MTK_MT6515) - platform_device_unregister(&mt_fm_device); -#endif -} - -module_init(mt_fm_init); -module_exit(mt_fm_exit); - -MODULE_LICENSE("GPL"); -MODULE_DESCRIPTION("MediaTek FM Driver"); -MODULE_AUTHOR("William Chung "); diff --git a/drivers/net/wireless/rda5990/rda_5990_power_ctrl/Makefile b/drivers/net/wireless/rda5990/rda_5990_power_ctrl/Makefile deleted file mode 100755 index ab2ac900edd6..000000000000 --- a/drivers/net/wireless/rda5990/rda_5990_power_ctrl/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -obj-y := rda_5990_power_ctrl.o -#for 模拟I2C -#obj-y := rda_5990_power_ctrl_by_gpio.o diff --git a/drivers/net/wireless/rda5990/rda_5990_power_ctrl/rda_5990_power_ctrl.c b/drivers/net/wireless/rda5990/rda_5990_power_ctrl/rda_5990_power_ctrl.c deleted file mode 100755 index 82e0c018e7ee..000000000000 --- a/drivers/net/wireless/rda5990/rda_5990_power_ctrl/rda_5990_power_ctrl.c +++ /dev/null @@ -1,1897 +0,0 @@ -/* ----------------------------------------------------------------------- * - * - This file created by albert RDA Inc - */ - -#include -#include -#include -#include -#include -#include /* get the user-level API */ -#include -#include -#include - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define RDA5890_USE_CRYSTAL // if use share crystal should close this -#define RDA5990_USE_DCDC - -#define u32 unsigned int -#define u8 unsigned char -#define u16 unsigned short - -#define RDA_I2C_CHANNEL (0) -#define RDA_WIFI_CORE_ADDR (0x13 << 1) -#define RDA_WIFI_RF_ADDR (0x14 << 1) //correct add is 0x14 -#define RDA_BT_CORE_ADDR (0x15 << 1) -#define RDA_BT_RF_ADDR (0x16 << 1) - -#define I2C_MASTER_ACK (1<<0) -#define I2C_MASTER_RD (1<<4) -#define I2C_MASTER_STO (1<<8) -#define I2C_MASTER_WR (1<<12) -#define I2C_MASTER_STA (1<<16) - -#define RDA_WIFI_RF_I2C_DEVNAME "rda_wifi_rf_i2c" -#define RDA_WIFI_CORE_I2C_DEVNAME "rda_wifi_core_i2c" -#define RDA_BT_RF_I2C_DEVNAME "rda_bt_rf_i2c" -#define RDA_BT_CORE_I2C_DEVNAME "rda_bt_core_i2c" - -static struct mutex i2c_rw_lock; -//extern int -//i2c_register_board_info(int busnum, struct i2c_board_info const *info, -// unsigned n); - - -static unsigned short wlan_version = 0; -static struct wake_lock rda_5990_wake_lock; -static struct delayed_work rda_5990_sleep_worker; -static struct i2c_client * rda_wifi_core_client = NULL; -static struct i2c_client * rda_wifi_rf_client = NULL; -static struct i2c_client * rda_bt_core_client = NULL; -static struct i2c_client * rda_bt_rf_client = NULL; - -static const struct i2c_device_id wifi_rf_i2c_id[] = {{RDA_WIFI_RF_I2C_DEVNAME, 0}, {}}; -MODULE_DEVICE_TABLE(i2c, wifi_rf_i2c_id); - -static unsigned short wifi_rf_force[] = { RDA_I2C_CHANNEL, RDA_WIFI_RF_ADDR, I2C_CLIENT_END, I2C_CLIENT_END }; - -static struct i2c_board_info __initdata i2c_rda_wifi_rf={ I2C_BOARD_INFO(RDA_WIFI_RF_I2C_DEVNAME, (RDA_WIFI_RF_ADDR>>1))}; -static struct i2c_driver rda_wifi_rf_driver; - - - -static const struct i2c_device_id wifi_core_i2c_id[] = {{RDA_WIFI_CORE_I2C_DEVNAME, 0}, {}}; -MODULE_DEVICE_TABLE(i2c, wifi_core_i2c_id); - -static unsigned short wifi_core_force[] = { RDA_I2C_CHANNEL, RDA_WIFI_CORE_ADDR, I2C_CLIENT_END, I2C_CLIENT_END }; -static struct i2c_board_info __initdata i2c_rda_wifi_core={ I2C_BOARD_INFO(RDA_WIFI_CORE_I2C_DEVNAME, (RDA_WIFI_CORE_ADDR>>1))}; -static struct i2c_driver rda_wifi_core_driver; - - - -static const struct i2c_device_id bt_rf_i2c_id[] = {{RDA_BT_RF_I2C_DEVNAME, 0}, {}}; - -MODULE_DEVICE_TABLE(i2c, bt_rf_i2c_id); - -static unsigned short bt_rf_force[] = { RDA_I2C_CHANNEL, RDA_BT_RF_ADDR, I2C_CLIENT_END, I2C_CLIENT_END }; -static struct i2c_board_info __initdata i2c_rda_bt_rf={ I2C_BOARD_INFO(RDA_BT_RF_I2C_DEVNAME, (RDA_BT_RF_ADDR>>1))}; -static struct i2c_driver rda_bt_rf_driver; - -static const struct i2c_device_id bt_core_i2c_id[] = {{RDA_BT_CORE_I2C_DEVNAME, 0}, {}}; -MODULE_DEVICE_TABLE(i2c, bt_core_i2c_id); - -static unsigned short bt_core_force[] = { RDA_I2C_CHANNEL, RDA_BT_CORE_ADDR, I2C_CLIENT_END, I2C_CLIENT_END }; -static struct i2c_board_info __initdata i2c_rda_bt_core={ I2C_BOARD_INFO(RDA_BT_CORE_I2C_DEVNAME, (RDA_BT_CORE_ADDR>>1))}; -static struct i2c_driver rda_bt_core_driver; - - -static u8 isBigEnded = 0; -static u8 wifi_in_test_mode = 0; - -static int i2c_write_data_4_addr_4_data(struct i2c_client* client, const u32 addr, const u32 data) -{ - unsigned char ADDR[4], DATA[4]; - int ret = 0; - - if(!isBigEnded) - { - ADDR[0] = addr >> 24; - ADDR[1] = addr >> 16; - ADDR[2] = addr >> 8; - ADDR[3] = addr >> 0; - - DATA[0] = data >> 24; - DATA[1] = data >> 16; - DATA[2] = data >> 8; - DATA[3] = data >> 0; - } - else - { - memcpy(ADDR, &addr, sizeof(u32)); - memcpy(DATA, &data, sizeof(u32)); - } - - ret = i2c_master_send(client, (char*)ADDR, 4); - if (ret < 0) - { - printk(KERN_INFO "***i2c_write_data_4_addr_4_data send:0x%X err:%d\n", addr,ret); - return -1; - } - - ret = i2c_master_send(client, (char*)DATA, 4); - if (ret < 0) - { - printk(KERN_INFO "***i2c_write_data_4_addr_4_data send:0x%X err:%d\n", data,ret); - return -1; - } - - return 0; -} - - -static int i2c_read_4_addr_4_data(struct i2c_client* client, const u32 addr, u32* data) -{ - unsigned char ADDR[4], DATA[4]; - int ret = 0; - - if(!isBigEnded) - { - ADDR[0] = addr >> 24; - ADDR[1] = addr >> 16; - ADDR[2] = addr >> 8; - ADDR[3] = addr >> 0; - } - else - { - memcpy(ADDR, &addr, sizeof(u32)); - } - - ret = i2c_master_send(client, (char*)ADDR, 4); - if (ret < 0) - { - printk(KERN_INFO "***i2c_read_4_addr_4_data send:0x%X err:%d\n", addr,ret); - return -1; - } - - ret = i2c_master_recv(client, (char*)DATA, 4); - if (ret < 0) - { - printk(KERN_INFO "***i2c_read_4_addr_4_data send:0x%X err:%d\n", addr,ret); - return -1; - } - - if(!isBigEnded) - { - data[3] = DATA[0]; - data[2] = DATA[1]; - data[1] = DATA[2]; - data[0] = DATA[3]; - } - else - memcpy(data, DATA, sizeof(u32)); - - return 0; -} - - -static int i2c_write_1_addr_2_data(struct i2c_client* client, const u8 addr, const u16 data) -{ - unsigned char DATA[3]; - int ret = 0; - - if(!isBigEnded) - { - DATA[0] = addr; - DATA[1] = data >> 8; - DATA[2] = data >> 0; - } - else - { - DATA[0] = addr; - DATA[1] = data >> 0; - DATA[2] = data >> 8; - } - - ret = i2c_master_send(client, (char*)DATA, 3); - if (ret < 0) - { - printk(KERN_INFO "***i2c_write_1_addr_2_data send:0x%X err:%d bigendia: %d \n", addr,ret, isBigEnded); - return -1; - } - - return 0; -} - - -static int i2c_read_1_addr_2_data(struct i2c_client* client, const u8 addr, u16* data) -{ - unsigned char DATA[2]; - int ret = 0; - - ret = i2c_master_send(client, (char*)&addr, 1); - if (ret < 0) - { - printk(KERN_INFO "***i2c_read_1_addr_2_data send:0x%X err:%d\n", addr,ret); - return -1; - } - - ret = i2c_master_recv(client, DATA, 2); - if (ret < 0) - { - printk(KERN_INFO "***i2c_read_1_addr_2_data send:0x%X err:%d\n", addr,ret); - return -1; - } - - if(!isBigEnded) - { - *data = (DATA[0] << 8) | DATA[1]; - } - else - { - *data = (DATA[1] << 8) | DATA[0]; - } - return 0; -} - - -static int rda_wifi_rf_probe(struct i2c_client *client, const struct i2c_device_id *id) -{ - int result = 0; - - rda_wifi_rf_client = client; - return result; -} - -static int rda_wifi_rf_remove(struct i2c_client *client) -{ - return 0; -} - -static int rda_wifi_rf_detect(struct i2c_client *client, int kind, struct i2c_board_info *info) -{ - strcpy(info->type, RDA_WIFI_RF_I2C_DEVNAME); - return 0; -} - -static struct i2c_driver rda_wifi_rf_driver = { - .probe = rda_wifi_rf_probe, - .remove = rda_wifi_rf_remove, - .detect = rda_wifi_rf_detect, - .driver.name = RDA_WIFI_RF_I2C_DEVNAME, - .id_table = wifi_rf_i2c_id, -// .address_data = &rda_wifi_rf_addr_data, - //.address_list = (const unsigned short*) wifi_rf_force, -}; - -static int rda_wifi_core_detect(struct i2c_client *client, int kind, struct i2c_board_info *info) -{ - strcpy(info->type, RDA_WIFI_CORE_I2C_DEVNAME); - return 0; -} - -static int rda_wifi_core_probe(struct i2c_client *client, const struct i2c_device_id *id) -{ - int result = 0; - - rda_wifi_core_client = client; - return result; -} - -static int rda_wifi_core_remove(struct i2c_client *client) -{ - return 0; -} - -int rda_wifi_power_off(void); -static void rda_wifi_shutdown(struct i2c_client * client) -{ - printk("rda_wifi_shutdown \n"); - rda_wifi_power_off(); -} - -static struct i2c_driver rda_wifi_core_driver = -{ - .probe = rda_wifi_core_probe, - .remove = rda_wifi_core_remove, - .detect = rda_wifi_core_detect, - .shutdown = rda_wifi_shutdown, - .driver.name = RDA_WIFI_CORE_I2C_DEVNAME, - .id_table = wifi_core_i2c_id, - //.address_data = &rda_wifi_core_addr_data, - //.address_list = (const unsigned short*)wifi_core_force, -}; - -const u32 wifi_core_init_data[][2] = -{ - -}; - -u16 wifi_off_data[][2] = -{ - { 0x3F, 0x0001 }, //page up - { 0x31, 0x0B40 }, //power off wifi - { 0x3F, 0x0000 }, //page down -}; - -u16 wifi_en_data[][2] = -{ - //item:VerD_wf_on_2012_02_08 - {0x3f, 0x0001}, -#ifdef RDA5990_USE_DCDC /*houzhen update Mar 15 2012 */ - {0x23, 0x8FA1},//20111001 higher AVDD voltage to improve EVM to 0x8f21 download current -1db 0x8fA1>>0x8bA1 -#else - {0x23, 0x0FA1}, -#endif - {0x31, 0x0B40 }, //power off wifi -// {0x22, 0xD3C7},//for ver.c 20111109, txswitch - {0x24, 0x80C8},//freq_osc_in[1:0]00 0x80C8 >> 0x80CB - {0x27, 0x4925},//for ver.c20111109, txswitch - // {0x28, 0x80A1}, //BT_enable - {0x31, 0x8140},//enable wifi - {0x32, 0x0113},//set_ rdenout_ldooff_wf=0; rden4in_ldoon_wf=1 - // {0x39, 0x0004}, //uart switch to wf - {0x3F, 0x0000}, //page down -}; - - -u16 wifi_dc_cal_data[][2]= -{ - {0x3f, 0x0000}, - {0x30, 0x0248}, - {0x30, 0x0249}, - //{wait 200ms; } here -}; - -u16 wifi_dig_reset_data[][2]= -{ - {0x3F, 0x0001}, - {0x31, 0x8D40}, - {0x31, 0x8F40}, - {0x31, 0x8b40}, - {0x3F, 0x0000}, -}; - -u16 wifi_rf_init_data_verE[][2] = -{ - {0x3f, 0x0000}, - //{;;set_rf_swi},ch - {0x06, 0x0101}, - {0x07, 0x0101}, - {0x08, 0x0101}, - {0x09, 0x0101}, - {0x0A, 0x002C},//aain_0 - {0x0D, 0x0507}, - {0x0E, 0x2300}, - {0x0F, 0x5689},// - //{;;//set_RF }, - {0x10, 0x0f78},//20110824 - {0x11, 0x0602}, - {0x13, 0x0652},//adc_tuning_bit[011] - {0x14, 0x8886}, - {0x15, 0x0990}, - {0x16, 0x049f}, - {0x17, 0x0990}, - {0x18, 0x049F}, - {0x19, 0x3C01}, - {0x1C, 0x0934}, - {0x1D, 0xFF00},//for ver.D20120119for temperature 70 degree - //{0x1F, 0x01F8},//for ver.c20111109 - //{0x1F, 0x0300},//for burst tx 不锁 - {0x20, 0x06E4}, - {0x21, 0x0ACF},//for ver.c20111109,dr dac reset,dr txflt reset - {0x22, 0x24DC}, - {0x23, 0x23FF}, - {0x24, 0x00FC}, - {0x26, 0x004F},//004F >> 005f premote pa - {0x27, 0x171D},///mdll*7 - {0x28, 0x031D},///mdll*7 - {0x2A, 0x2860},//et0x2849-8.5p :yd 0x2861-7pf C1,C2=6.8p - {0x2B, 0x0800},//bbpll,or ver.c20111116 - {0x32, 0x8a08}, - {0x33, 0x1D02},//liuyanan - //{;;//agc_gain}, - {0x36, 0x02f4}, //00F8;//gain_7 - {0x37, 0x01f4}, //0074;//aain_6 - {0x38, 0x21d4}, //0014;//gain_5 - {0x39, 0x25d4}, //0414;//aain_4 - {0x3A, 0x2584}, //1804;//gain_3 - {0x3B, 0x2dc4}, //1C04;//aain_2 - {0x3C, 0x2d04}, //1C02;//gain_1 - {0x3D, 0x2c02}, //3C01;//gain_0 - {0x33, 0x1502},//liuyanan - //{;;SET_channe},_to_11 - {0x1B, 0x0001},//set_channel - {0x30, 0x024D}, - {0x29, 0xD468}, - {0x29, 0x1468}, - {0x30, 0x0249}, - {0x3f, 0x0000}, -}; - -u16 wifi_rf_init_data[][2] = -{ - {0x3f, 0x0000}, - //{;;set_rf_swi},ch - {0x06, 0x0101}, - {0x07, 0x0101}, - {0x08, 0x0101}, - {0x09, 0x0101}, - {0x0A, 0x002C},//aain_0 - {0x0D, 0x0507}, - {0x0E, 0x2300},//2012_02_20 - {0x0F, 0x5689},// - //{;;//set_RF }, - {0x10, 0x0f78},//20110824 - {0x11, 0x0602}, - {0x13, 0x0652},//adc_tuning_bit[011] - {0x14, 0x8886}, - {0x15, 0x0990}, - {0x16, 0x049f}, - {0x17, 0x0990}, - {0x18, 0x049F}, - {0x19, 0x3C01},//sdm_vbit[3:0]=1111 - {0x1C, 0x0934}, - {0x1D, 0xFF00},//for ver.D20120119for temperature 70 degree 0xCE00 >> 0xFF00 - {0x1F, 0x0300},//div2_band_48g_dr=1;div2_band_48g_reg[8:0] - {0x20, 0x06E4}, - {0x21, 0x0ACF},//for ver.c20111109,dr dac reset,dr txflt reset - {0x22, 0x24DC}, - {0x23, 0x23FF}, - {0x24, 0x00FC}, - {0x26, 0x004F},//004F >> 005f premote pa - {0x27, 0x171D},///mdll*7 - {0x28, 0x031D},///mdll*7 - {0x2A, 0x2860},//et0x2849-8.5p :yd 0x2861-7pf - {0x2B, 0x0800},//bbpll,or ver.c20111116 - {0x32, 0x8a08}, - {0x33, 0x1D02},//liuyanan - //{;;//agc_gain}, - {0x36, 0x02f4}, //00F8;//gain_7 - {0x37, 0x01f4}, //0074;//aain_6 - {0x38, 0x21d4}, //0014;//gain_5 - {0x39, 0x25d4}, //0414;//aain_4 - {0x3A, 0x2584}, //1804;//gain_3 - {0x3B, 0x2dc4}, //1C04;//aain_2 - {0x3C, 0x2d04}, //1C02;//gain_1 - {0x3D, 0x2c02}, //3C01;//gain_0 - {0x33, 0x1502},//liuyanan - //{;;SET_channe},_to_11 - {0x1B, 0x0001},//set_channel - {0x30, 0x024D}, - {0x29, 0xD468}, - {0x29, 0x1468}, - {0x30, 0x0249}, - {0x3f, 0x0000}, -}; -u16 wifi_uart_debug_data[][2] = -{ - {0x3F,0x0001}, - {0x28,0x80A1}, //BT_enable - {0x39,0x0004}, //uart switch to wf - {0x3f,0x0000}, -}; - -u16 wifi_tm_en_data[][2] = -{ - {0x3F,0x0001}, -#ifdef RDA5990_USE_DCDC /*houzhen update Mar 15 2012 */ - {0x23, 0x8FA1},//20111001 higher AVDD voltage to improve EVM to 0x8f21 download current -1db 0x8fA1>>0x8bA1 -#else - {0x23, 0x0FA1}, -#endif - {0x22,0xD3C7},//for ver.c 20111109, tx - {0x24, 0x80C8},//freq_osc_in[1:0]00 0x80C8 >> 0x80CB - {0x27,0x4925},//for ver.c20111109, txs - {0x28,0x80A1}, //BT_enable - {0x29,0x111F}, - {0x31,0x8140}, - {0x32,0x0113},//set_ rdenout_ldooff_wf - {0x39,0x0004},//uart switch to wf - {0x3f,0x0000}, -}; - -u16 wifi_tm_rf_init_data[][2] = -{ - {0x3f, 0x0000}, - //set_rf_switch - {0x06,0x0101}, - {0x07,0x0101}, - {0x08,0x0101}, - {0x09,0x0101}, - {0x0A,0x002C},//aain_0 - {0x0D, 0x0507}, - {0x0E,0x2300},//2012_02_20 - {0x0F,0x5689},// - //set_RF - {0x10,0x0f78},//20110824 - {0x11,0x0602}, - {0x13,0x0652},//adc_tuning_bit[011] - {0x14,0x8886}, - {0x15,0x0990}, - {0x16,0x049f}, - {0x17,0x0990}, - {0x18,0x049F}, - {0x19,0x3C01},//sdm_vbit[3:0]=1111 - {0x1C,0x0934}, - {0x1D,0xFF00},//for ver.D20120119for temperature 70 degree - {0x1F,0x0300},//div2_band_48g_dr=1;div2_band_48g_reg[8:0]1000000000 - {0x20,0x06E4}, - {0x21,0x0ACF},//for ver.c20111109,dr dac reset,dr txflt reset - {0x22,0x24DC}, - {0x23,0x23FF}, - {0x24,0x00FC}, - {0x26,0x004F}, - {0x27,0x171D},///mdll*7 - {0x28,0x031D},///mdll*7 - {0x2A,0x2860}, - {0x2B,0x0800},//bbpll,or ver.c20111116 - {0x32,0x8a08}, - {0x33,0x1D02},//liuyanan - //agc_gain - {0x36,0x02f4}, //00F8;//gain_7 - {0x37,0x01f4}, //0074;//aain_6 - {0x38,0x21d4}, //0014;//gain_5 - {0x39,0x25d4}, //0414;//aain_4 - {0x3A,0x2584}, //1804;//gain_3 - {0x3B,0x2dc4}, //1C04;//aain_2 - {0x3C,0x2d04}, //1C02;//gain_1 - {0x3D,0x2c02}, //3C01;//gain_0 - //DC_CAL - {0x30,0x0248}, - {0x30,0x0249}, - //wait 200ms; - {0x33,0x1502},//liuyanan - //SET_channel_to_11 - {0x1B,0x0001},//set_channel - {0x3f,0x0000}, -}; - -/*houzhen update Mar 15 2012 - should be called when power up/down bt - */ -static int rda5990_wf_setup_A2_power(int enable) -{ - int ret; - u16 temp_data=0; - printk(KERN_INFO "***rda5990_wf_setup_A2_power start! \n"); - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, 0x3f, 0x0001); - if(ret) - goto err; - - if(enable) - { - ret=i2c_read_1_addr_2_data(rda_wifi_rf_client,0x22,&temp_data); - if(ret) - goto err; - printk(KERN_INFO "***0xA2 readback value:0x%X \n", temp_data); - - temp_data |=0x0200; /*en reg4_pa bit*/ -#ifdef RDA5890_USE_CRYSTAL - temp_data &= ~(1 << 14); //disable xen_out -#endif - ret=i2c_write_1_addr_2_data(rda_wifi_rf_client,0x22,temp_data); - if(ret) - goto err; - //read wlan version - ret = i2c_read_1_addr_2_data(rda_wifi_rf_client,0x21,&temp_data); - if(ret) - goto err; - else - wlan_version = temp_data; - } - else - { - ret=i2c_read_1_addr_2_data(rda_wifi_rf_client,0x28,&temp_data); - if(ret) - goto err; - if(temp_data&0x8000) // bt is on - { - goto out; - } - else - { - ret=i2c_read_1_addr_2_data(rda_wifi_rf_client,0x22,&temp_data); - if(ret) - goto err; - temp_data&=0xfdff; - - ret=i2c_write_1_addr_2_data(rda_wifi_rf_client,0x22,temp_data); - if(ret) - goto err; - } - wlan_version = 0; - } - -out: - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, 0x3f, 0x0000); - if(ret) - goto err; - printk(KERN_INFO "***rda5990_wf_setup_A2_power succeed! \n"); - return 0; - -err: - printk(KERN_INFO "***rda5990_wf_setup_A2_power failed! \n"); - return -1; -} - - -int rda_wifi_rf_init(void) -{ - unsigned int count = 0; - int ret = 0; - - mutex_lock(&i2c_rw_lock); - if( (wlan_version&0x1f) == 7) - { - for(count = 0; count < sizeof(wifi_rf_init_data)/sizeof(wifi_rf_init_data[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, wifi_rf_init_data[count][0], wifi_rf_init_data[count][1]); - if(ret) - goto err; - } - } - else if((wlan_version&0x1f) == 4 || (wlan_version&0x1f)==5) - { - for(count = 0; count < sizeof(wifi_rf_init_data_verE)/sizeof(wifi_rf_init_data_verE[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, wifi_rf_init_data_verE[count][0], wifi_rf_init_data_verE[count][1]); - if(ret) - goto err; - } - } - else - { - printk("unknown version of this 5990 chip\n"); - goto err; - } - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_wifi_rf_init_succceed \n"); - msleep(5); //5ms delay - return 0; -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_wifi_rf_init failed! \n"); - return -1; -} - -int rda_wifi_dc_cal(void) -{ - unsigned int count = 0; - int ret = 0; - - mutex_lock(&i2c_rw_lock); - for(count = 0; count < sizeof(wifi_dc_cal_data)/sizeof(wifi_dc_cal_data[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client ,wifi_dc_cal_data[count][0], wifi_dc_cal_data[count][1]); - if(ret) - goto err; - } - - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_wifi_rf_dc_calsuccceed \n"); - msleep(50); //50ms delay - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_wifi_rf_dc_calf_failed! \n"); - return -1; -} - -int rda_wifi_en(void) -{ - unsigned int count = 0; - int ret = 0; - - mutex_lock(&i2c_rw_lock); - for(count = 0; count < sizeof(wifi_en_data)/sizeof(wifi_en_data[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, wifi_en_data[count][0], wifi_en_data[count][1]); - if(ret) - goto err; - if(wifi_en_data[count][0] == 0x31) - msleep(10); //10ms delay - } - - ret=rda5990_wf_setup_A2_power(1); //en pa_reg for wf - if(ret) - goto err; - - mutex_unlock(&i2c_rw_lock); - msleep(8); //8ms delay - - printk(KERN_INFO "***rda_wifi_en_succceed \n"); - return 0; -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_wifi_power_on failed! \n"); - return -1; -} - -int rda_wifi_debug_en(void) -{ - unsigned int count = 0; - int ret = 0; - - mutex_lock(&i2c_rw_lock); - for(count = 0; count < sizeof(wifi_uart_debug_data)/sizeof(wifi_uart_debug_data[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, wifi_uart_debug_data[count][0], wifi_uart_debug_data[count][1]); - if(ret) - goto err; - } - -err: - mutex_unlock(&i2c_rw_lock); - return ret; -} - -int rda_tm_wifi_en(void) -{ - unsigned int count = 0; - int ret = 0; - unsigned short temp_data; - - for(count = 0; count < sizeof(wifi_tm_en_data)/sizeof(wifi_tm_en_data[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, wifi_tm_en_data[count][0], wifi_tm_en_data[count][1]); - if(ret) - goto err; - } - - msleep(8); //8ms delay - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, 0x3f, 0x0001); //PAGE UP - if(ret) - goto err; - - ret = i2c_read_1_addr_2_data(rda_wifi_rf_client,0x21,&temp_data); - if(ret) - goto err; - else - wlan_version = temp_data; - - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, 0x3f, 0x0000); //PAGE DOWN - if(ret) - goto err; - - - printk(KERN_INFO "***rda_wifi_en_succceed \n"); - return 0; -err: - printk(KERN_INFO "***rda_wifi_power_on failed! \n"); - return -1; -} - -int rda_tm_wifi_rf_init(void) -{ - unsigned int count = 0; - int ret = 0; - - for(count = 0; count < sizeof(wifi_tm_rf_init_data)/sizeof(wifi_tm_rf_init_data[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, wifi_tm_rf_init_data[count][0], wifi_tm_rf_init_data[count][1]); - if(ret) - goto err; - } - - printk(KERN_INFO "***rda_wifi_rf_init_succceed \n"); - msleep(5); //5ms delay - return 0; - -err: - printk(KERN_INFO "***rda_wifi_rf_init failed! \n"); - return -1; -} -/*houzhen add 2012 04 09 - add to ensure wf dig powerup - */ - -int rda_wifi_dig_reset(void) -{ - unsigned int count = 0; - int ret = 0; - msleep(8); //8ms delay - mutex_lock(&i2c_rw_lock); - - for(count = 0; count < sizeof(wifi_dig_reset_data)/sizeof(wifi_dig_reset_data[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, wifi_dig_reset_data[count][0], wifi_dig_reset_data[count][1]); - if(ret) - goto err; - } - - mutex_unlock(&i2c_rw_lock); - msleep(8); //8ms delay - printk(KERN_INFO "***rda_wifi_dig_reset \n"); - return 0; -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_wifi_dig_reset failed! \n"); - return -1; -} - -int rda_wlan_version(void) -{ - printk("******version %x \n", wlan_version); - return wlan_version; -} - -int rda_wifi_power_off(void) -{ - unsigned int count = 0; - int ret = 0; - u16 temp=0x0000; - printk(KERN_INFO "rda_wifi_power_off \n"); - - if(!rda_wifi_rf_client) - { - printk(KERN_INFO "rda_wifi_power_off failed on:i2c client \n"); - return -1; - } - - mutex_lock(&i2c_rw_lock); - ret=rda5990_wf_setup_A2_power(0); //disable pa_reg for wf - if(ret) - goto err; - - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, 0x3f, 0x0001); //page up - if(ret) - goto err; - - ret=i2c_read_1_addr_2_data(rda_wifi_rf_client,0x28,&temp); //poll bt status - if(ret) - goto err; - - if(temp&0x8000) - { - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, 0x3f, 0x0000); //page down - if(ret) - goto err; - - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, 0x0f, 0x2223); // set antenna for bt - if(ret) - goto err; - - } - - for(count = 0; count < sizeof(wifi_off_data)/sizeof(wifi_off_data[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, wifi_off_data[count][0], wifi_off_data[count][1]); - if(ret) - goto err; - } - printk(KERN_INFO "***rda_wifi_power_off success!!! \n"); - - - - mutex_unlock(&i2c_rw_lock); - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_wifi_power_off failed! \n"); - return -1; - -} - -int rda_wifi_power_on(void) -{ - int ret; - char retry = 3; - - printk("------------------rda_wifi_power_on\n"); - if(!rda_wifi_rf_client) - { - printk(KERN_INFO "rda_wifi_power_on failed on:i2c client \n"); - return -1; - } - -_retry: - - - if(!wifi_in_test_mode) - { - ret = rda_wifi_en(); - if(ret < 0) - goto err; - - ret = rda_wifi_rf_init(); - if(ret < 0) - goto err; - - ret = rda_wifi_dc_cal(); - if(ret < 0) - goto err; - - msleep(20); //20ms delay - ret=rda_wifi_dig_reset(); //houzhen add to ensure wf power up safely - - if(ret < 0) - goto err; - msleep(20); //20ms delay - } - else - { - ret = rda_tm_wifi_en(); - if(ret < 0) - goto err; - - ret = rda_tm_wifi_rf_init(); - if(ret < 0) - goto err; - } - printk(KERN_INFO "rda_wifi_power_on_succeed!! \n"); - - return 0; - -err: - printk(KERN_INFO "rda_wifi_power_on_failed retry:%d \n", retry); - if(retry -- > 0) - { - rda_wifi_power_off(); - goto _retry; - } - - return -1; -} - -extern int rda_wifi_power_on(void); - -int rda_fm_power_on(void) -{ - int ret = 0; - u16 temp = 0; - - if(!rda_wifi_rf_client) - { - printk(KERN_INFO "rda_wifi_rf_client is NULL, rda_fm_power_on failed!\n"); - return -1; - } - - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, 0x3f, 0x0001); // page down - if(ret < 0){ - printk(KERN_INFO "%s() write address(0x%02x) with value(0x%04x) failed! \n", __func__, 0x3f, 0x0001); - return -1; - } - ret = i2c_read_1_addr_2_data(rda_wifi_rf_client, 0x22, &temp); //read 0xA2 - if(ret < 0){ - printk(KERN_INFO "%s() read from address(0x%02x) failed! \n", __func__, 0x22); - return -1; - } - temp = temp & (~(1 << 15)); //clear bit[15] - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, 0x22, temp); //write back - if(ret < 0){ - printk(KERN_INFO "%s() write address(0x%02x) with value(0x%04x) failed! \n", __func__, 0x3f, 0x0001); - return -1; - } - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, 0x3f, 0x0000); // page up - if(ret < 0){ - printk(KERN_INFO "%s() write address(0x%02x) with value(0x%04x) failed! \n", __func__, 0x3f, 0x0001); - return -1; - } - - return 0; -} - -int rda_fm_power_off(void) -{ - int ret = 0; - u16 temp = 0; - - if(!rda_wifi_rf_client) - { - printk(KERN_INFO "rda_wifi_rf_client is NULL, rda_fm_power_off failed!\n"); - return -1; - } - - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, 0x3f, 0x0001); // page down - if(ret < 0){ - printk(KERN_INFO "%s() write address(0x%02x) with value(0x%04x) failed! \n", __func__, 0x3f, 0x0001); - return -1; - } - ret = i2c_read_1_addr_2_data(rda_wifi_rf_client, 0x22, &temp); //read 0xA2 - if(ret < 0){ - printk(KERN_INFO "%s() read from address(0x%02x) failed! \n", __func__, 0x22); - return -1; - } - temp = temp | (1 << 15); //set bit[15] - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, 0x22, temp); //write back - if(ret < 0){ - printk(KERN_INFO "%s() write address(0x%02x) with value(0x%04x) failed! \n", __func__, 0x3f, 0x0001); - return -1; - } - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, 0x3f, 0x0000); // page up - if(ret < 0){ - printk(KERN_INFO "%s() write address(0x%02x) with value(0x%04x) failed! \n", __func__, 0x3f, 0x0001); - return -1; - } - - return 0; -} - -static int rda_bt_rf_probe(struct i2c_client *client, const struct i2c_device_id *id) -{ - int result = 0; - - rda_bt_rf_client = client; - return result; -} - -static int rda_bt_rf_remove(struct i2c_client *client) -{ - rda_bt_rf_client = NULL; - return 0; -} - -static int rda_bt_rf_detect(struct i2c_client *client, int kind, struct i2c_board_info *info) -{ - strcpy(info->type, RDA_BT_RF_I2C_DEVNAME); - return 0; -} - -static struct i2c_driver rda_bt_rf_driver = { - .probe = rda_bt_rf_probe, - .remove = rda_bt_rf_remove, - .detect = rda_bt_rf_detect, - .driver.name = RDA_BT_RF_I2C_DEVNAME, - .id_table = bt_rf_i2c_id, - //.address_data = &rda_bt_rf_addr_data, - //.address_list = (const unsigned short*)bt_rf_force, -}; - - -static int rda_bt_core_detect(struct i2c_client *client, int kind, struct i2c_board_info *info) -{ - strcpy(info->type, RDA_BT_CORE_I2C_DEVNAME); - return 0; -} - -static int rda_bt_core_probe(struct i2c_client *client, const struct i2c_device_id *id) -{ - int result = 0; - - rda_bt_core_client = client; - return result; -} - -static int rda_bt_core_remove(struct i2c_client *client) -{ - return 0; -} - -static struct i2c_driver rda_bt_core_driver = { - .probe = rda_bt_core_probe, - .remove = rda_bt_core_remove, - .detect = rda_bt_core_detect, - .driver.name = RDA_BT_CORE_I2C_DEVNAME, - .id_table = bt_core_i2c_id, - //.address_data = &rda_bt_core_addr_data, - //.address_list = (const unsigned short*)bt_core_force, -}; - -u16 rda_5990_bt_off_data[][2] = -{ - {0x3f, 0x0001 }, //pageup - {0x28, 0x00A1 }, //power off bt - {0x3f, 0x0000 }, //pagedown -}; - -/*houzhen update 2012 03 06*/ -u16 rda_5990_bt_en_data[][2] = -{ - {0x3f, 0x0001 }, //pageup -#ifdef RDA5990_USE_DCDC - {0x23, 0x8FA1}, // //20111001 higher AVDD voltage to improve EVM -#else - {0x23, 0x0FA1}, -#endif - {0x24, 0x80C8}, // ;//freq_osc_in[1:0]00 - {0x26, 0x47A5}, // reg_vbit_normal_bt[2:0] =111 - {0x27, 0x4925}, // //for ver.c20111109, txswitch - {0x29, 0x111F}, // // rden4in_ldoon_bt=1 - {0x32, 0x0111}, // set_ rdenout_ldooff_wf=0; - {0x39, 0x0000}, // //uart switch to bt - - {0x28, 0x80A1}, // bt en - {0x3f, 0x0000}, //pagedown -}; - - -u16 rda_5990_bt_dc_cal[][2] = -{ - {0x3f, 0x0000 }, - {0x30, 0x0129 }, - {0x30, 0x012B }, - {0x3f, 0x0000 }, -}; - - -u16 rda_5990_bt_set_rf_switch_data[][2] = -{ - {0x3f, 0x0000 }, - {0x0F, 0x2223 }, - {0x3f, 0x0000 }, -}; - - -u16 RDA5990_bt_enable_clk_data[][2] = -{ - {0x3f, 0x0000 }, - {0x30, 0x0040 }, - {0x2a, 0x285d }, - {0x3f, 0x0000 }, -}; - -u16 RDA5990_bt_dig_reset_data[][2] = -{ - {0x3f, 0x0001 }, //pageup - {0x28, 0x86A1 }, - {0x28, 0x87A1 }, - {0x28, 0x85A1 }, - {0x3f, 0x0000 }, //pagedown -}; - -/*houzhen update 2012 03 06*/ -u16 rda_5990_bt_rf_data[][2] = -{ - {0x3f, 0x0000}, //pagedown - {0x01, 0x1FFF}, - {0x06, 0x07F7}, - {0x08, 0x29E7}, - {0x09, 0x0520}, - {0x0B, 0x03DF}, - {0x0C, 0x85E8}, - {0x0F, 0x0DBC}, - {0x12, 0x07F7}, - {0x13, 0x0327}, - {0x14, 0x0CCC}, - {0x15, 0x0526}, - {0x16, 0x8918}, - {0x18, 0x8800}, - {0x19, 0x10C8}, - {0x1A, 0x9078}, - {0x1B, 0x80E2}, - {0x1C, 0x361F}, - {0x1D, 0x4363}, - {0x1E, 0x303F}, - {0x23, 0x2222}, - {0x24, 0x359D}, - {0x27, 0x0011}, - {0x28, 0x124F}, - {0x39, 0xA5FC}, - {0x3f, 0x0001}, //page 1 - {0x00, 0x043F}, - {0x01, 0x467F}, - {0x02, 0x28FF}, - {0x03, 0x67FF}, - {0x04, 0x57FF}, - {0x05, 0x7BFF}, - {0x06, 0x3FFF}, - {0x07, 0x7FFF}, - {0x18, 0xF3F5}, - {0x19, 0xF3F5}, - {0x1A, 0xE7F3}, - {0x1B, 0xF1FF}, - {0x1C, 0xFFFF}, - {0x1D, 0xFFFF}, - {0x1E, 0xFFFF}, - {0x1F, 0xFFFF}, - // {0x22, 0xD3C7}, - // {0x23, 0x8fa1}, - // {0x24, 0x80c8}, - // {0x26, 0x47A5}, - // {0x27, 0x4925}, - // {0x28, 0x85a1}, - // {0x29, 0x111f}, - // {0x32, 0x0111}, - // {0x39, 0x0000}, - {0x3f, 0x0000}, //pagedown -}; - -/*houzhen update Mar 15 2012 - should be called when power up/down bt - */ -static int rda5990_bt_setup_A2_power(int enable) -{ - int ret; - u16 temp_data=0; - - ret = i2c_write_1_addr_2_data(rda_bt_rf_client, 0x3f, 0x0001); - if(ret) - goto err; - - if(enable) - { - ret=i2c_read_1_addr_2_data(rda_bt_rf_client,0x22,&temp_data); - if(ret) - goto err; - printk(KERN_INFO "***0xA2 readback value:0x%X \n", temp_data); - - temp_data |=0x0200; /*en reg4_pa bit*/ - - ret=i2c_write_1_addr_2_data(rda_bt_rf_client,0x22,temp_data); - if(ret) - goto err; - } - else - { - ret=i2c_read_1_addr_2_data(rda_bt_rf_client,0x31,&temp_data); - if(ret) - goto err; - - if(temp_data&0x8000) // wf is on - { - goto out; - } - else - { - ret=i2c_read_1_addr_2_data(rda_bt_rf_client,0x22,&temp_data); - if(ret) - goto err; - temp_data&=0xfdff; - - ret=i2c_write_1_addr_2_data(rda_bt_rf_client,0x22,temp_data); - if(ret) - goto err; - } - - } - -out: - ret = i2c_write_1_addr_2_data(rda_bt_rf_client, 0x3f, 0x0000); - if(ret) - goto err; - return 0; - -err: - printk(KERN_INFO "***rda5990_bt_setup_A2_power failed! \n"); - return -1; -} - -int rda_bt_power_off(void); - -int rda_bt_power_on(void) -{ - unsigned int count = 0; - int ret = 0; - - printk(KERN_INFO "rda_bt_power_on \n"); - - if(!rda_bt_rf_client || !rda_bt_rf_client) - { - printk(KERN_INFO "rda_bt_power_on failed on:i2c client \n"); - return -1; - } - - mutex_lock(&i2c_rw_lock); - - for(count = 0; count < sizeof(rda_5990_bt_en_data)/sizeof(rda_5990_bt_en_data[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_bt_rf_client, rda_5990_bt_en_data[count][0], rda_5990_bt_en_data[count][1]); - if(ret) - goto err; - } - - ret=rda5990_bt_setup_A2_power(1); - if(ret) - { - printk(KERN_INFO "***rda5990_bt_setup_A2_power fail!!! \n"); - goto err; - } - - printk(KERN_INFO "***rda_bt_power_on success!!! \n"); - - mutex_unlock(&i2c_rw_lock); - /*houzhen update 2012 03 06*/ - msleep(10); //delay 10 ms after power on - - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_bt_power_on failed! \n"); - return -1; - -} - -int rda_bt_power_off(void) -{ - unsigned int count = 0; - int ret = 0; - printk(KERN_INFO "rda_bt_power_off \n"); - - if(!rda_bt_rf_client) - { - printk(KERN_INFO "rda_bt_power_off failed on:i2c client \n"); - return -1; - } - - mutex_lock(&i2c_rw_lock); - for(count = 0; count < sizeof(rda_5990_bt_off_data)/sizeof(rda_5990_bt_off_data[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_bt_rf_client ,rda_5990_bt_off_data[count][0], rda_5990_bt_off_data[count][1]); - if(ret) - goto err; - } - msleep(10); //10ms - printk(KERN_INFO "***rda_bt_power_off success!!! \n"); - - ret=rda5990_bt_setup_A2_power(0);//disable ldo_pa reg - if(ret) - goto err; - - - - mutex_unlock(&i2c_rw_lock); - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_bt_power_off failed! \n"); - return -1; - -} - - -int RDA5990_bt_rf_init(void) -{ - unsigned int count = 0; - int ret = 0; - printk(KERN_INFO "RDA5990_bt_rf_init \n"); - - if(!rda_bt_rf_client) - { - printk(KERN_INFO "RDA5990_bt_rf_init on:i2c client \n"); - return -1; - } - - mutex_lock(&i2c_rw_lock); - for(count = 0; count < sizeof(rda_5990_bt_rf_data)/sizeof(rda_5990_bt_rf_data[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_bt_rf_client, rda_5990_bt_rf_data[count][0], rda_5990_bt_rf_data[count][1]); - if(ret) - goto err; - } - - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_rf_init success!!! \n"); - msleep(5); //5ms - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_rf_init failed! \n"); - return -1; - -} - -/*houzhen add 2012 04 09 - add to ensure bt dig powerup - */ - -int RDA5990_bt_dig_reset(void) -{ - unsigned int count = 0; - int ret = 0; - - printk(KERN_INFO "RDA5990_bt_dig_reset \n"); - if(!rda_bt_rf_client) - { - printk(KERN_INFO "RDA5990_bt_dig_reset on:i2c client \n"); - return -1; - } - - mutex_lock(&i2c_rw_lock); - for(count = 0; count < sizeof(RDA5990_bt_dig_reset_data)/sizeof(RDA5990_bt_dig_reset_data[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_bt_rf_client, RDA5990_bt_dig_reset_data[count][0], RDA5990_bt_dig_reset_data[count][1]); - if(ret) - goto err; - } - - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_rf_init success!!! \n"); - msleep(5); //5ms - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_rf_init failed! \n"); - return -1; - -} - - -int RDA5990_bt_dc_cal(void) -{ - unsigned int count = 0; - int ret = 0; - printk(KERN_INFO "rda_bt_dc_cal \n"); - - if(!rda_bt_rf_client) - { - printk(KERN_INFO "rda_bt_rf_client \n"); - return -1; - } - mutex_lock(&i2c_rw_lock); - - for(count = 0; count < sizeof(rda_5990_bt_dc_cal)/sizeof(rda_5990_bt_dc_cal[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_bt_rf_client, rda_5990_bt_dc_cal[count][0], rda_5990_bt_dc_cal[count][1]); - if(ret) - goto err; - } - - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_bt_dc_cal success!!! \n"); - msleep(200); //200ms - - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_bt_dc_cal failed! \n"); - return -1; - -} - - - -/*houzhen update Mar 15 2012 - bypass RDA5990_bt_set_rf_switch when wf is already on - */ - -int RDA5990_bt_set_rf_switch(void) -{ - unsigned int count = 0; - int ret = 0; - u16 temp_data=0; - printk(KERN_INFO "RDA5990_bt_set_rf_switch \n"); - - if(!rda_bt_rf_client || !rda_wifi_rf_client) - { - printk(KERN_INFO "RDA5990_bt_set_rf_switch failed on:i2c client \n"); - return -1; - } - - mutex_lock(&i2c_rw_lock); - - ret = i2c_write_1_addr_2_data(rda_bt_rf_client, 0x3f, 0x0001); - if(ret) - goto err; - - ret=i2c_read_1_addr_2_data(rda_bt_rf_client,0x31,&temp_data); - - if(ret) - goto err; - - if(temp_data&0x8000) // if wf is already on - { - printk(KERN_INFO "wf already en, bypass RDA5990_bt_set_rf_switch function \n"); - ret = i2c_write_1_addr_2_data(rda_bt_rf_client, 0x3f, 0x0000); - if(ret) - goto err; - mutex_unlock(&i2c_rw_lock); - return 0; - } - - for(count = 0; count < sizeof(rda_5990_bt_set_rf_switch_data)/sizeof(rda_5990_bt_set_rf_switch_data[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, rda_5990_bt_set_rf_switch_data[count][0], rda_5990_bt_set_rf_switch_data[count][1]); - if(ret) - goto err; - } - - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_set_rf_switch success!!! \n"); - msleep(50); //50ms - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_set_rf_switch failed! \n"); - return -1; - -} - - -/*houzhen update Mar 15 2012 - bypass RDA5990_bt_enable_clk when wf is already on - */ - -int RDA5990_bt_enable_clk(void) -{ - unsigned int count = 0; - int ret = 0; - u16 temp_data=0; - printk(KERN_INFO "RDA5990_bt_enable_clk \n"); - - if(!rda_bt_rf_client) - { - printk(KERN_INFO "RDA5990_bt_enable_clk failed on:i2c client \n"); - return -1; - } - - mutex_lock(&i2c_rw_lock); - ret = i2c_write_1_addr_2_data(rda_bt_rf_client, 0x3f, 0x0001); - if(ret) - goto err; - - ret=i2c_read_1_addr_2_data(rda_bt_rf_client,0x31,&temp_data); - - if(ret) - goto err; - - if(temp_data&0x8000) // if wf is already on - { - printk(KERN_INFO "wf already en, bypass RDA5990_bt_enable_clk function \n"); - ret = i2c_write_1_addr_2_data(rda_bt_rf_client, 0x3f, 0x0000); - if(ret) - goto err; - mutex_unlock(&i2c_rw_lock); - return 0; - } - - - for(count = 0; count < sizeof(RDA5990_bt_enable_clk_data)/sizeof(RDA5990_bt_enable_clk_data[0]); count ++) - { - ret = i2c_write_1_addr_2_data(rda_wifi_rf_client, RDA5990_bt_enable_clk_data[count][0], RDA5990_bt_enable_clk_data[count][1]); - if(ret) - goto err; - } - - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_enable_clk success!!! \n"); - msleep(50); //50ms - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_enable_clk failed! \n"); - return -1; - -} - -//extern void mt_combo_bgf_enable_irq(void); -//extern void mt_combo_bgf_disable_irq(void); - -#define RDA_BT_IOCTL_MAGIC 'u' -#define RDA_BT_POWER_ON_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x01) -#define RD_BT_RF_INIT_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x02) -#define RD_BT_DC_CAL_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x03) -#define RD_BT_SET_RF_SWITCH_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x04) -#define RDA_BT_POWER_OFF_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x05) -#define RDA_BT_EN_CLK _IO(RDA_BT_IOCTL_MAGIC ,0x06) -#define RD_BT_DC_DIG_RESET_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x07) - -#define RDA_WIFI_POWER_ON_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x10) -#define RDA_WIFI_POWER_OFF_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x11) -#define RDA_WIFI_POWER_SET_TEST_MODE_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x12) -#define RDA_WIFI_POWER_CANCEL_TEST_MODE_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x13) -#define RDA_WIFI_DEBUG_MODE_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x14) - -extern int rk29sdk_wifi_set_carddetect(int val); -static int rda_5990_pw_ioctl(struct file *file, unsigned int cmd, unsigned long arg) -{ - int ret = 0; - - switch(cmd) - { - case RDA_WIFI_POWER_ON_IOCTL: - //rda_wifi_power_on(); - //rk29sdk_wifi_set_carddetect(1); - break; - - case RDA_WIFI_POWER_OFF_IOCTL: - //rk29sdk_wifi_set_carddetect(0); - //rda_wifi_power_off(); - break; - - case RDA_WIFI_POWER_SET_TEST_MODE_IOCTL: - wifi_in_test_mode = 1; - printk("****set rda wifi in test mode"); - break; - - case RDA_WIFI_POWER_CANCEL_TEST_MODE_IOCTL: - wifi_in_test_mode = 0; - printk("****set rda wifi in normal mode"); - break; - - case RDA_WIFI_DEBUG_MODE_IOCTL: - ret = rda_wifi_debug_en(); - break; - - case RDA_BT_POWER_ON_IOCTL: - { - ret = rda_bt_power_on(); - //mt_combo_bgf_enable_irq(); - } - break; - - /* should call thif function after bt_power_on*/ - case RDA_BT_EN_CLK: - ret = RDA5990_bt_enable_clk(); - break; - - case RD_BT_RF_INIT_IOCTL: - ret = RDA5990_bt_rf_init(); - break; - - case RD_BT_DC_CAL_IOCTL: - ret = RDA5990_bt_dc_cal(); - break; - - case RD_BT_DC_DIG_RESET_IOCTL: - ret = RDA5990_bt_dig_reset(); - break; - - case RD_BT_SET_RF_SWITCH_IOCTL: - ret = RDA5990_bt_set_rf_switch(); - break; - - case RDA_BT_POWER_OFF_IOCTL: - { - //mt_combo_bgf_disable_irq(); - ret = rda_bt_power_off(); - } - break; - - default: - break; - } - - printk(KERN_INFO "rda_bt_pw_ioctl cmd=0x%02x \n", cmd); - - return ret; -} -extern int rk29sdk_wifi_power(int on); -void mmc_rescan_slot(int id) -{ - rk29sdk_wifi_power(1); - rda_wifi_power_on(); - rk29sdk_wifi_set_carddetect(1); -} -EXPORT_SYMBOL(mmc_rescan_slot); - -void mmc_remove(int id) -{ - rk29sdk_wifi_set_carddetect(0); - rda_wifi_power_off(); - rk29sdk_wifi_power(0); -} -EXPORT_SYMBOL(mmc_remove); - -static int rda_5990_major; -static struct class *rda_5990_class = NULL; -static const struct file_operations rda_5990_operations = { - .owner = THIS_MODULE, - .unlocked_ioctl = rda_5990_pw_ioctl, - .release = NULL -}; - -void rda_5990_sleep_worker_task(struct work_struct *work) -{ - printk("---rda_5990_sleep_worker_task end"); - wake_unlock(&rda_5990_wake_lock); -} - -void rda_5990_set_wake_lock(void) -{ - wake_lock(&rda_5990_wake_lock); - cancel_delayed_work(&rda_5990_sleep_worker); - schedule_delayed_work(&rda_5990_sleep_worker, 6*HZ); -} - -int rda_5990_power_ctrl_init(void) -{ - int ret = 0; - printk("rda_5990_power_ctrl_init begin\n"); - - /*i2c_register_board_info(0, &i2c_rda_wifi_core, 1); - if (i2c_add_driver(&rda_wifi_core_driver)) - { - printk("rda_wifi_core_driver failed!\n"); - ret = -ENODEV; - return ret; - } - */ - - //i2c_register_board_info(0, &i2c_rda_wifi_rf, 1); - if (i2c_add_driver(&rda_wifi_rf_driver)) - { - printk("rda_wifi_rf_driver failed!\n"); - ret = -ENODEV; - return ret; - } - - /* - i2c_register_board_info(0, &i2c_rda_bt_core, 1); - if (i2c_add_driver(&rda_bt_core_driver)) - { - printk("rda_bt_core_driver failed!\n"); - ret = -ENODEV; - return ret; - } - */ - - //i2c_register_board_info(0, &i2c_rda_bt_rf, 1); - if (i2c_add_driver(&rda_bt_rf_driver)) - { - printk("rda_bt_rf_driver failed!\n"); - ret = -ENODEV; - return ret; - } - - rda_5990_major = register_chrdev(0, "rda5990_power_ctrl", &rda_5990_operations); - if(rda_5990_major < 0) - { - printk(KERN_INFO "register rdabt_power_ctrl failed!!! \n"); - return rda_5990_major; - } - - rda_5990_class = class_create(THIS_MODULE, "rda_combo"); - if(IS_ERR(rda_5990_class)) - { - unregister_chrdev(rda_5990_major, "rdabt_power_ctrl"); - return PTR_ERR(rda_5990_class); - } - - device_create(rda_5990_class, NULL, MKDEV(rda_5990_major, 0), NULL, "rdacombo"); - - { - unsigned char* temp = NULL; - unsigned short testData = 0xffee; - temp = (unsigned char *)&testData; - if(*temp == 0xee) - isBigEnded = 0; - else - isBigEnded = 1; - } - - INIT_DELAYED_WORK(&rda_5990_sleep_worker, rda_5990_sleep_worker_task); - wake_lock_init(&rda_5990_wake_lock, WAKE_LOCK_SUSPEND, "RDA_sleep_worker_wake_lock"); - - mutex_init(&i2c_rw_lock); - printk("rda_5990_power_ctrl_init end\n"); - return 0; -} - -void rda_5990_power_ctrl_exit(void) -{ - i2c_del_driver(&rda_wifi_core_driver); - i2c_del_driver(&rda_wifi_rf_driver); - i2c_del_driver(&rda_bt_core_driver); - i2c_del_driver(&rda_bt_rf_driver); - - unregister_chrdev(rda_5990_major, "rdabt_power_ctrl"); - if(rda_5990_class) - class_destroy(rda_5990_class); - - cancel_delayed_work_sync(&rda_5990_sleep_worker); - wake_lock_destroy(&rda_5990_wake_lock); -} - -unsigned char rda_5990_wifi_in_test_mode(void) -{ - return wifi_in_test_mode; -} - - -static __inline__ void cfmakeraw(struct termios *s) -{ - s->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); - s->c_oflag &= ~OPOST; - s->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); - s->c_cflag &= ~(CSIZE|PARENB); - s->c_cflag |= CS8; -} - -static __inline__ int cfsetospeed(struct termios *s, speed_t speed) -{ - s->c_cflag = (s->c_cflag & ~CBAUD) | (speed & CBAUD); - return 0; -} - -static __inline__ int cfsetispeed(struct termios *s, speed_t speed) -{ - s->c_cflag = (s->c_cflag & ~CBAUD) | (speed & CBAUD); - return 0; -} - -static int rda_wifi_init_uart(char *dev) -{ - int errno; - struct termios ti; - struct serial_struct ss; - int fd; - - fd = sys_open(dev, O_RDWR | O_NOCTTY, 0); - if (fd < 0) { - printk("Can't open serial port"); - return -1; - } - - sys_ioctl(fd, TCFLSH, TCIOFLUSH); - - /* Clear the cust flag */ - if((errno = sys_ioctl(fd, TIOCGSERIAL, &ss))<0){ - printk("BAUD: error to get the serial_struct info:%s\n", errno); - goto err; - } - - if (ss.flags & ASYNC_SPD_CUST) { - printk("clear ASYNC_SPD_CUST\r\n"); - ss.flags &= ~ASYNC_SPD_CUST; - } - if((errno = sys_ioctl(fd, TIOCSSERIAL, &ss))<0){ - printk("BAUD: error to set serial_struct:%s\n", errno); - goto err; - } - - if ((errno = sys_ioctl(fd, TCGETS, (long)&ti)) < 0) { - printk("unable to get UART port setting"); - printk("Can't get port settings"); - goto err; - } - - cfmakeraw(&ti); - - ti.c_cflag |= CLOCAL; - ti.c_cflag &= ~CRTSCTS; - ti.c_lflag = 0; - ti.c_cc[VTIME] = 5; /* 0.5 sec */ - ti.c_cc[VMIN] = 0; - - /* Set initial baudrate */ - cfsetospeed(&ti, B115200); - cfsetispeed(&ti, B115200); - - if ((errno = sys_ioctl(fd, TCSETS, (long)&ti)) < 0) { - printk("unable to set UART port setting"); - printk("Can't set port settings"); - goto err; - } - - errno = sys_ioctl(fd, TCFLSH, TCIOFLUSH); - if(errno < 0) - goto err; - - return fd; - -err: - if(fd > 0) - sys_close(fd); - - return -1; -} - -EXPORT_SYMBOL(rda_wlan_version); - -EXPORT_SYMBOL(rda_wifi_init_uart); -EXPORT_SYMBOL(rda_5990_wifi_in_test_mode); - -EXPORT_SYMBOL(rda_5990_set_wake_lock); -EXPORT_SYMBOL(rda_wifi_power_off); -EXPORT_SYMBOL(rda_wifi_power_on); -EXPORT_SYMBOL(rda_fm_power_on); -EXPORT_SYMBOL(rda_fm_power_off); - -module_init(rda_5990_power_ctrl_init); -module_exit(rda_5990_power_ctrl_exit); - -MODULE_LICENSE("GPL"); - diff --git a/drivers/net/wireless/rda5990/rda_5990_power_ctrl/rda_5990_power_ctrl_by_gpio.c b/drivers/net/wireless/rda5990/rda_5990_power_ctrl/rda_5990_power_ctrl_by_gpio.c deleted file mode 100755 index 8f508c12de07..000000000000 --- a/drivers/net/wireless/rda5990/rda_5990_power_ctrl/rda_5990_power_ctrl_by_gpio.c +++ /dev/null @@ -1,1462 +0,0 @@ -/* ----------------------------------------------------------------------- * - * - This file created by albert RDA Inc - */ - -#include -#include -#include -#include -#include -#include /* get the user-level API */ -#include -#include -#include - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include -#include -#include - -#define RDA5890_USE_CRYSTAL //if use share crystal should close this -#define RDA5990_USE_DCDC - -#define u32 unsigned int -#define u8 unsigned char -#define u16 unsigned short - -extern int rda_gpio_i2c_read_1_addr_2_data(uint8_t chipAddr, uint8_t regAddr, uint16_t *buffer); -extern int rda_gpio_i2c_write_1_addr_2_data(uint8_t chipAddr, uint8_t regAddr, uint16_t data); -extern int rda_gpio_i2c_read_4_addr_4_data(uint8_t chipAddr, uint32_t regAddr, uint32_t *buffer); -extern int rda_gpio_i2c_write_4_addr_4_data(uint8_t chipAddr, uint32_t regAddr, uint32_t data); - - -//#define RDA_I2C_CHANNEL (0) -#define RDA_WIFI_CORE_ADDR (0x13) -#define RDA_WIFI_RF_ADDR (0x14) //correct add is 0x14 -#define RDA_BT_CORE_ADDR (0x15) -#define RDA_BT_RF_ADDR (0x16) - -static struct mutex i2c_rw_lock; -static unsigned short wlan_version = 0; -static struct wake_lock rda_5990_wake_lock; -static struct delayed_work rda_5990_sleep_worker; - -static u8 isBigEnded = 0; - -static u8 wifi_in_test_mode = 0; - -const u32 wifi_core_init_data[][2] = -{ - -}; - -u16 wifi_off_data[][2] = -{ - { 0x3F, 0x0001 }, //page up - { 0x31, 0x0B40 }, //power off wifi - { 0x3F, 0x0000 }, //page down -}; - -u16 wifi_en_data[][2] = -{ - //item:VerD_wf_on_2012_02_08 - {0x3f, 0x0001}, -#ifdef RDA5990_USE_DCDC /*houzhen update Mar 15 2012 */ - {0x23, 0x8FA1},//20111001 higher AVDD voltage to improve EVM to 0x8f21 download current -1db 0x8fA1>>0x8bA1 -#else - {0x23, 0x0FA1}, -#endif - {0x31, 0x0B40 }, //power off wifi -// {0x22, 0xD3C7},//for ver.c 20111109, txswitch - {0x24, 0x80C8},//freq_osc_in[1:0]00 0x80C8 >> 0x80CB - {0x27, 0x4925},//for ver.c20111109, txswitch - // {0x28, 0x80A1}, //BT_enable - {0x31, 0x8140},//enable wifi - {0x32, 0x0113},//set_ rdenout_ldooff_wf=0; rden4in_ldoon_wf=1 - // {0x39, 0x0004}, //uart switch to wf - {0x3F, 0x0000}, //page down -}; - - -u16 wifi_dc_cal_data[][2]= -{ - {0x3f, 0x0000}, - {0x30, 0x0248}, - {0x30, 0x0249}, - //{wait 200ms; } here -}; - -u16 wifi_dig_reset_data[][2]= -{ - {0x3F, 0x0001}, - {0x31, 0x8D40}, - {0x31, 0x8F40}, - {0x31, 0x8b40}, - {0x3F, 0x0000}, -}; - -u16 wifi_rf_init_data_verE[][2] = -{ - {0x3f, 0x0000}, - //{;;set_rf_swi},ch - {0x06, 0x0101}, - {0x07, 0x0101}, - {0x08, 0x0101}, - {0x09, 0x0101}, - {0x0A, 0x002C},//aain_0 - {0x0D, 0x0507}, - {0x0E, 0x2300}, - {0x0F, 0x5689},// - //{;;//set_RF }, - {0x10, 0x0f78},//20110824 - {0x11, 0x0602}, - {0x13, 0x0652},//adc_tuning_bit[011] - {0x14, 0x8886}, - {0x15, 0x0990}, - {0x16, 0x049f}, - {0x17, 0x0990}, - {0x18, 0x049F}, - {0x19, 0x3C01}, - {0x1C, 0x0934}, - {0x1D, 0xFF00},//for ver.D20120119for temperature 70 degree - //{0x1F, 0x01F8},//for ver.E should not set - //{0x1F, 0x0300},//for ver.E should not set - {0x20, 0x06E4}, - {0x21, 0x0ACF},//for ver.c20111109,dr dac reset,dr txflt reset - {0x22, 0x24DC}, - {0x23, 0x23FF}, - {0x24, 0x00FC}, - {0x26, 0x004F},//004F >> 005f premote pa - {0x27, 0x171D},///mdll*7 - {0x28, 0x031D},///mdll*7 - {0x2A, 0x2860},//et0x2849-8.5p :yd 0x2861-7pf C1,C2=6.8p - {0x2B, 0x0800},//bbpll,or ver.c20111116 - {0x32, 0x8a08}, - {0x33, 0x1D02},//liuyanan - //{;;//agc_gain}, - {0x36, 0x02f4}, //00F8;//gain_7 - {0x37, 0x01f4}, //0074;//aain_6 - {0x38, 0x21d4}, //0014;//gain_5 - {0x39, 0x25d4}, //0414;//aain_4 - {0x3A, 0x2584}, //1804;//gain_3 - {0x3B, 0x2dc4}, //1C04;//aain_2 - {0x3C, 0x2d04}, //1C02;//gain_1 - {0x3D, 0x2c02}, //3C01;//gain_0 - {0x33, 0x1502},//liuyanan - //{;;SET_channe},_to_11 - {0x1B, 0x0001},//set_channel - {0x30, 0x024D}, - {0x29, 0xD468}, - {0x29, 0x1468}, - {0x30, 0x0249}, - {0x3f, 0x0000}, -}; - -u16 wifi_rf_init_data[][2] = -{ - {0x3f, 0x0000}, - //{;;set_rf_swi},ch - {0x06, 0x0101}, - {0x07, 0x0101}, - {0x08, 0x0101}, - {0x09, 0x0101}, - {0x0A, 0x002C},//aain_0 - {0x0D, 0x0507}, - {0x0E, 0x2300}, - {0x0F, 0x5689},// - //{;;//set_RF }, - {0x10, 0x0f78},//20110824 - {0x11, 0x0602}, - {0x13, 0x0652},//adc_tuning_bit[011] - {0x14, 0x8886}, - {0x15, 0x0990}, - {0x16, 0x049f}, - {0x17, 0x0990}, - {0x18, 0x049F}, - {0x19, 0x3C01}, - {0x1C, 0x0934}, - {0x1D, 0xFF00},//for ver.D20120119for temperature 70 degree - //{0x1F, 0x01F8},//for ver.c20111109 - {0x1F, 0x0300},//for burst tx 不锁 - {0x20, 0x06E4}, - {0x21, 0x0ACF},//for ver.c20111109,dr dac reset,dr txflt reset - {0x22, 0x24DC}, - {0x23, 0x23FF}, - {0x24, 0x00FC}, - {0x26, 0x004F},//004F >> 005f premote pa - {0x27, 0x171D},///mdll*7 - {0x28, 0x031D},///mdll*7 - {0x2A, 0x2860},//et0x2849-8.5p :yd 0x2861-7pf C1,C2=6.8p - {0x2B, 0x0800},//bbpll,or ver.c20111116 - {0x32, 0x8a08}, - {0x33, 0x1D02},//liuyanan - //{;;//agc_gain}, - {0x36, 0x02f4}, //00F8;//gain_7 - {0x37, 0x01f4}, //0074;//aain_6 - {0x38, 0x21d4}, //0014;//gain_5 - {0x39, 0x25d4}, //0414;//aain_4 - {0x3A, 0x2584}, //1804;//gain_3 - {0x3B, 0x2dc4}, //1C04;//aain_2 - {0x3C, 0x2d04}, //1C02;//gain_1 - {0x3D, 0x2c02}, //3C01;//gain_0 - {0x33, 0x1502},//liuyanan - //{;;SET_channe},_to_11 - {0x1B, 0x0001},//set_channel - {0x30, 0x024D}, - {0x29, 0xD468}, - {0x29, 0x1468}, - {0x30, 0x0249}, - {0x3f, 0x0000}, -}; - -u16 wifi_uart_debug_data[][2] = -{ - {0x3F,0x0001}, - {0x28,0x80A1}, //BT_enable - {0x39,0x0004}, //uart switch to wf - {0x3f,0x0000}, -}; - -u16 wifi_tm_en_data[][2] = -{ - {0x3F,0x0001}, -#ifdef RDA5990_USE_DCDC /*houzhen update Mar 15 2012 */ - {0x23, 0x8FA1},//20111001 higher AVDD voltage to improve EVM to 0x8f21 download current -1db 0x8fA1>>0x8bA1 -#else - {0x23, 0x0FA1}, -#endif - {0x22,0xD3C7},//for ver.c 20111109, tx - {0x24, 0x80C8},//freq_osc_in[1:0]00 0x80C8 >> 0x80CB - {0x27,0x4925},//for ver.c20111109, txs - {0x28,0x80A1}, //BT_enable - {0x29,0x111F}, - {0x31,0x8140}, - {0x32,0x0113},//set_ rdenout_ldooff_wf - {0x39,0x0004},//uart switch to wf - {0x3f,0x0000}, -}; - -u16 wifi_tm_rf_init_data[][2] = -{ - {0x3f, 0x0000}, - //set_rf_switch - {0x06,0x0101}, - {0x07,0x0101}, - {0x08,0x0101}, - {0x09,0x0101}, - {0x0A,0x002C},//aain_0 - {0x0D,0x0507}, - {0x0E,0x2300},//2012_02_20 - {0x0F,0x5689},// - //set_RF - {0x10,0x0f78},//20110824 - {0x11,0x0602}, - {0x13,0x0652},//adc_tuning_bit[011] - {0x14,0x8886}, - {0x15,0x0990}, - {0x16,0x049f}, - {0x17,0x0990}, - {0x18,0x049F}, - {0x19,0x3C01},//sdm_vbit[3:0]=1111 - {0x1C,0x0934}, - {0x1D,0xCE00},//for ver.D20120119for temperature 70 degree - {0x1F,0x0300},//div2_band_48g_dr=1;div2_band_48g_reg[8:0]1000000000 - {0x20,0x06E4}, - {0x21,0x0ACF},//for ver.c20111109,dr dac reset,dr txflt reset - {0x22,0x24DC}, - {0x23,0x23FF}, - {0x24,0x00FC}, - {0x26,0x004F}, - {0x27,0x171D},///mdll*7 - {0x28,0x031D},///mdll*7 - {0x2A,0x2860}, - {0x2B,0x0800},//bbpll,or ver.c20111116 - {0x32,0x8a08}, - {0x33,0x1D02},//liuyanan - //agc_gain - {0x36,0x02f4}, //00F8;//gain_7 - {0x37,0x01f4}, //0074;//aain_6 - {0x38,0x21d4}, //0014;//gain_5 - {0x39,0x25d4}, //0414;//aain_4 - {0x3A,0x2584}, //1804;//gain_3 - {0x3B,0x2dc4}, //1C04;//aain_2 - {0x3C,0x2d04}, //1C02;//gain_1 - {0x3D,0x2c02}, //3C01;//gain_0 - //DC_CAL - {0x30,0x0248}, - {0x30,0x0249}, - //wait 200ms; - {0x33,0x1502},//liuyanan - //SET_channel_to_11 - {0x1B,0x0001},//set_channel - {0x3f,0x0000}, -}; - -/*houzhen update Mar 15 2012 - should be called when power up/down bt - */ -static int rda5990_wf_setup_A2_power(int enable) -{ - int ret; - u16 temp_data=0; - printk("***rda5990_wf_setup_A2_power start! \n"); - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x3f, 0x0001); - if(ret) - goto err; - - if(enable) - { - ret = rda_gpio_i2c_read_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x22, &temp_data); - if(ret) - goto err; - printk("***0xA2 readback value:0x%X \n", temp_data); - - temp_data |=0x0200; /*en reg4_pa bit*/ -#ifdef RDA5890_USE_CRYSTAL - temp_data &= ~(1 << 14); //disable xen_out -#endif - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x22, temp_data); - if(ret) - goto err; - //read wlan version - ret = rda_gpio_i2c_read_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x21, &temp_data); - if(ret) - goto err; - else - wlan_version = temp_data; - } - else - { - ret = rda_gpio_i2c_read_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x28, &temp_data); - if(ret) - goto err; - if(temp_data&0x8000) // bt is on - { - goto out; - } - else - { - ret = rda_gpio_i2c_read_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x22, &temp_data); - if(ret) - goto err; - temp_data&=0xfdff; - - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x22, temp_data); - if(ret) - goto err; - } - wlan_version = 0; - } - printk("rda5990_wf_setup_A2_power, version:%d", wlan_version); - -out: - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x3f, 0x0000); - if(ret) - goto err; - printk("***rda5990_wf_setup_A2_power succeed! \n"); - return 0; - -err: - printk("***rda5990_wf_setup_A2_power failed! \n"); - return -1; -} - - -int rda_wifi_rf_init(void) -{ - unsigned int count = 0; - int ret = 0; - mutex_lock(&i2c_rw_lock); - if( (wlan_version&0x1f) == 7) - { - for(count = 0; count < sizeof(wifi_rf_init_data)/sizeof(wifi_rf_init_data[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, wifi_rf_init_data[count][0], wifi_rf_init_data[count][1]); - if(ret) - goto err; - } - } - else if((wlan_version&0x1f) == 4 || (wlan_version&0x1f)==5) - { - for(count = 0; count < sizeof(wifi_rf_init_data_verE)/sizeof(wifi_rf_init_data_verE[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, wifi_rf_init_data_verE[count][0], wifi_rf_init_data_verE[count][1]); - if(ret) - goto err; - } - } - else - { - printk("unknown version of this 5990 chip\n"); - goto err; - } - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_wifi_rf_init_succceed \n"); - msleep(5); //5ms delay - return 0; -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_wifi_rf_init failed! \n"); - return -1; -} - -int rda_wifi_dc_cal(void) -{ - unsigned int count = 0; - int ret = 0; - - mutex_lock(&i2c_rw_lock); - for(count = 0; count < sizeof(wifi_dc_cal_data)/sizeof(wifi_dc_cal_data[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, wifi_dc_cal_data[count][0], wifi_dc_cal_data[count][1]); - if(ret) - goto err; - } - - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_wifi_rf_dc_calsuccceed \n"); - msleep(50); //50ms delay - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_wifi_rf_dc_calf_failed! \n"); - return -1; -} - -int rda_wifi_en(void) -{ - unsigned int count = 0; - int ret = 0; - - mutex_lock(&i2c_rw_lock); - for(count = 0; count < sizeof(wifi_en_data)/sizeof(wifi_en_data[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, wifi_en_data[count][0], wifi_en_data[count][1]); - if(ret) - goto err; - - if(wifi_en_data[count][0] == 0x31) - msleep(12); - } - - ret=rda5990_wf_setup_A2_power(1); //en pa_reg for wf - if(ret) - goto err; - - mutex_unlock(&i2c_rw_lock); - msleep(8); //8ms delay - - printk(KERN_INFO "***rda_wifi_en_succceed \n"); - return 0; -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_wifi_power_on failed! \n"); - return -1; -} - -int rda_wifi_debug_en(void) -{ - unsigned int count = 0; - int ret = 0; - - mutex_lock(&i2c_rw_lock); - for(count = 0; count < sizeof(wifi_uart_debug_data)/sizeof(wifi_uart_debug_data[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, wifi_uart_debug_data[count][0], wifi_uart_debug_data[count][1]); - if(ret) - goto err; - } - -err: - mutex_unlock(&i2c_rw_lock); - return ret; -} - -int rda_tm_wifi_en(void) -{ - unsigned int count = 0; - int ret = 0; - unsigned short temp_data; - - for(count = 0; count < sizeof(wifi_tm_en_data)/sizeof(wifi_tm_en_data[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, wifi_tm_en_data[count][0], wifi_tm_en_data[count][1]); - if(ret) - goto err; - } - - msleep(8); //8ms delay - - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x3f, 0x0001); //PAGE UP - if(ret) - goto err; - - ret = rda_gpio_i2c_read_1_addr_2_data(RDA_WIFI_RF_ADDR,0x21,&temp_data); - if(ret) - goto err; - else - wlan_version = temp_data; - - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x3f, 0x0000); //PAGE DOWN - if(ret) - goto err; - - printk(KERN_INFO "***rda_wifi_en_succceed \n"); - return 0; -err: - printk(KERN_INFO "***rda_wifi_power_on failed! \n"); - return -1; -} - -int rda_tm_wifi_rf_init(void) -{ - unsigned int count = 0; - int ret = 0; - - for(count = 0; count < sizeof(wifi_tm_rf_init_data)/sizeof(wifi_tm_rf_init_data[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, wifi_tm_rf_init_data[count][0], wifi_tm_rf_init_data[count][1]); - if(ret) - goto err; - } - - printk(KERN_INFO "***rda_wifi_rf_init_succceed \n"); - msleep(5); //5ms delay - return 0; - -err: - printk(KERN_INFO "***rda_wifi_rf_init failed! \n"); - return -1; -} -/*houzhen add 2012 04 09 - add to ensure wf dig powerup - */ - -int rda_wifi_dig_reset(void) -{ - unsigned int count = 0; - int ret = 0; - msleep(8); //8ms delay - mutex_lock(&i2c_rw_lock); - - for(count = 0; count < sizeof(wifi_dig_reset_data)/sizeof(wifi_dig_reset_data[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, wifi_dig_reset_data[count][0], wifi_dig_reset_data[count][1]); - if(ret) - goto err; - } - - mutex_unlock(&i2c_rw_lock); - msleep(8); //8ms delay - printk(KERN_INFO "***rda_wifi_dig_reset \n"); - return 0; -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_wifi_dig_reset failed! \n"); - return -1; -} - -int rda_wlan_version(void) -{ - printk("******version %x \n", wlan_version); - return wlan_version; -} - -int rda_wifi_power_off(void) -{ - unsigned int count = 0; - int ret = 0; - u16 temp=0x0000; - printk(KERN_INFO "rda_wifi_power_off \n"); - - - mutex_lock(&i2c_rw_lock); - ret=rda5990_wf_setup_A2_power(0); //disable pa_reg for wf - if(ret) - goto err; - - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x3f, 0x0001); //page up - if(ret) - goto err; - - ret = rda_gpio_i2c_read_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x28, &temp); //poll bt status - if(ret) - goto err; - - if(temp&0x8000) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x3f, 0x0000); //page down - if(ret) - goto err; - - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x0f, 0x2223); // set antenna for bt - if(ret) - goto err; - - } - - - for(count = 0; count < sizeof(wifi_off_data)/sizeof(wifi_off_data[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, wifi_off_data[count][0], wifi_off_data[count][1]); - if(ret) - goto err; - } - printk(KERN_INFO "***rda_wifi_power_off success!!! \n"); - - - - mutex_unlock(&i2c_rw_lock); - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_wifi_power_off failed! \n"); - return -1; - -} - -int rda_wifi_power_on(void) -{ - int ret; - char retry = 3; - - -_retry: - - if(!wifi_in_test_mode) - { - ret = rda_wifi_en(); - if(ret < 0) - goto err; - - ret = rda_wifi_rf_init(); - if(ret < 0) - goto err; - - ret = rda_wifi_dc_cal(); - if(ret < 0) - goto err; - - msleep(20); //20ms delay - ret=rda_wifi_dig_reset(); //houzhen add to ensure wf power up safely - - if(ret < 0) - goto err; - msleep(20); //20ms delay - } - else - { - ret = rda_tm_wifi_en(); - if(ret < 0) - goto err; - - ret = rda_tm_wifi_rf_init(); - if(ret < 0) - goto err; - } - printk(KERN_INFO "rda_wifi_power_on_succeed!! \n"); - - return 0; - -err: - printk(KERN_INFO "rda_wifi_power_on_failed retry:%d \n", retry); - if(retry -- > 0) - { - rda_wifi_power_off(); - goto _retry; - } - - return -1; -} - -int rda_fm_power_on(void) -{ - int ret = 0; - u16 temp = 0; - - - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x3f, 0x0001); // page down - if(ret < 0){ - printk(KERN_INFO "%s() write address(0x%02x) with value(0x%04x) failed! \n", __func__, 0x3f, 0x0001); - return -1; - } - ret = rda_gpio_i2c_read_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x22, &temp); //read 0xA2 - if(ret < 0){ - printk(KERN_INFO "%s() read from address(0x%02x) failed! \n", __func__, 0x22); - return -1; - } - temp = temp & (~(1 << 15)); //clear bit[15] - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x22, temp); //write back - if(ret < 0){ - printk(KERN_INFO "%s() write address(0x%02x) with value(0x%04x) failed! \n", __func__, 0x3f, 0x0001); - return -1; - } - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x3f, 0x0000); // page up - if(ret < 0){ - printk(KERN_INFO "%s() write address(0x%02x) with value(0x%04x) failed! \n", __func__, 0x3f, 0x0001); - return -1; - } - - return 0; -} - -int rda_fm_power_off(void) -{ - int ret = 0; - u16 temp = 0; - - - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x3f, 0x0001); // page down - if(ret < 0){ - printk(KERN_INFO "%s() write address(0x%02x) with value(0x%04x) failed! \n", __func__, 0x3f, 0x0001); - return -1; - } - ret = rda_gpio_i2c_read_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x22, &temp); //read 0xA2 - if(ret < 0){ - printk(KERN_INFO "%s() read from address(0x%02x) failed! \n", __func__, 0x22); - return -1; - } - temp = temp | (1 << 15); //set bit[15] - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x22, temp); //write back - if(ret < 0){ - printk(KERN_INFO "%s() write address(0x%02x) with value(0x%04x) failed! \n", __func__, 0x3f, 0x0001); - return -1; - } - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, 0x3f, 0x0000); // page up - if(ret < 0){ - printk(KERN_INFO "%s() write address(0x%02x) with value(0x%04x) failed! \n", __func__, 0x3f, 0x0001); - return -1; - } - - return 0; -} - - -u16 rda_5990_bt_off_data[][2] = -{ - {0x3f, 0x0001 }, //pageup - {0x28, 0x00A1 }, //power off bt - {0x3f, 0x0000 }, //pagedown -}; - -/*houzhen update 2012 03 06*/ -u16 rda_5990_bt_en_data[][2] = -{ - {0x3f, 0x0001 }, //pageup -#ifdef RDA5990_USE_DCDC - {0x23, 0x8FA1}, // //20111001 higher AVDD voltage to improve EVM -#else - {0x23, 0x0FA1}, -#endif - {0x24, 0x80C8}, // ;//freq_osc_in[1:0]00 - {0x26, 0x47A5}, // reg_vbit_normal_bt[2:0] =111 - {0x27, 0x4925}, // //for ver.c20111109, txswitch - {0x29, 0x111F}, // // rden4in_ldoon_bt=1 - {0x32, 0x0111}, // set_ rdenout_ldooff_wf=0; - {0x39, 0x0000}, // //uart switch to bt - - {0x28, 0x80A1}, // bt en - {0x3f, 0x0000}, //pagedown -}; - - -u16 rda_5990_bt_dc_cal[][2] = -{ - {0x3f, 0x0000 }, - {0x30, 0x0129 }, - {0x30, 0x012B }, - {0x3f, 0x0000 }, -}; - - -u16 rda_5990_bt_set_rf_switch_data[][2] = -{ - {0x3f, 0x0000 }, - {0x0F, 0x2223 }, - {0x3f, 0x0000 }, -}; - - -u16 RDA5990_bt_enable_clk_data[][2] = -{ - {0x3f, 0x0000 }, - {0x30, 0x0040 }, - {0x2a, 0x285d }, - {0x3f, 0x0000 }, -}; - -u16 RDA5990_bt_dig_reset_data[][2] = -{ - {0x3f, 0x0001 }, //pageup - {0x28, 0x86A1 }, - {0x28, 0x87A1 }, - {0x28, 0x85A1 }, - {0x3f, 0x0000 }, //pagedown -}; - -/*houzhen update 2012 03 06*/ -u16 rda_5990_bt_rf_data[][2] = -{ - {0x3f, 0x0000}, //pagedown - {0x01, 0x1FFF}, - {0x06, 0x07F7}, - {0x08, 0x29E7}, - {0x09, 0x0520}, - {0x0B, 0x03DF}, - {0x0C, 0x85E8}, - {0x0F, 0x0DBC}, - {0x12, 0x07F7}, - {0x13, 0x0327}, - {0x14, 0x0CCC}, - {0x15, 0x0526}, - {0x16, 0x8918}, - {0x18, 0x8800}, - {0x19, 0x10C8}, - {0x1A, 0x9078}, - {0x1B, 0x80E2}, - {0x1C, 0x361F}, - {0x1D, 0x4363}, - {0x1E, 0x303F}, - {0x23, 0x2222}, - {0x24, 0x359D}, - {0x27, 0x0011}, - {0x28, 0x124F}, - {0x39, 0xA5FC}, - {0x3f, 0x0001}, //page 1 - {0x00, 0x043F}, - {0x01, 0x467F}, - {0x02, 0x28FF}, - {0x03, 0x67FF}, - {0x04, 0x57FF}, - {0x05, 0x7BFF}, - {0x06, 0x3FFF}, - {0x07, 0x7FFF}, - {0x18, 0xF3F5}, - {0x19, 0xF3F5}, - {0x1A, 0xE7F3}, - {0x1B, 0xF1FF}, - {0x1C, 0xFFFF}, - {0x1D, 0xFFFF}, - {0x1E, 0xFFFF}, - {0x1F, 0xFFFF}, - // {0x22, 0xD3C7}, - // {0x23, 0x8fa1}, - // {0x24, 0x80c8}, - // {0x26, 0x47A5}, - // {0x27, 0x4925}, - // {0x28, 0x85a1}, - // {0x29, 0x111f}, - // {0x32, 0x0111}, - // {0x39, 0x0000}, - {0x3f, 0x0000}, //pagedown -}; - -/*houzhen update Mar 15 2012 - should be called when power up/down bt - */ -static int rda5990_bt_setup_A2_power(int enable) -{ - int ret; - u16 temp_data=0; - - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_BT_RF_ADDR, 0x3f, 0x0001); - if(ret) - goto err; - - if(enable) - { - ret = rda_gpio_i2c_read_1_addr_2_data(RDA_BT_RF_ADDR, 0x22, &temp_data); - if(ret) - goto err; - printk(KERN_INFO "***0xA2 readback value:0x%X \n", temp_data); - - temp_data |=0x0200; /*en reg4_pa bit*/ - - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_BT_RF_ADDR, 0x22, temp_data); - if(ret) - goto err; - } - else - { - ret = rda_gpio_i2c_read_1_addr_2_data(RDA_BT_RF_ADDR, 0x31, &temp_data); - if(ret) - goto err; - if(temp_data&0x8000) // wf is on - { - goto out; - } - else - { - ret = rda_gpio_i2c_read_1_addr_2_data(RDA_BT_RF_ADDR, 0x22, &temp_data); - if(ret) - goto err; - temp_data&=0xfdff; - - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_BT_RF_ADDR, 0x22, temp_data); - if(ret) - goto err; - } - - } - - -out: - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_BT_RF_ADDR, 0x3f, 0x0000); - if(ret) - goto err; - return 0; - -err: - printk(KERN_INFO "***rda5990_bt_setup_A2_power failed! \n"); - return -1; -} - -int rda_bt_power_off(void); - -int rda_bt_power_on(void) -{ - unsigned int count = 0; - int ret = 0; - - printk(KERN_INFO "rda_bt_power_on \n"); - - - mutex_lock(&i2c_rw_lock); - - for(count = 0; count < sizeof(rda_5990_bt_en_data)/sizeof(rda_5990_bt_en_data[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_BT_RF_ADDR, rda_5990_bt_en_data[count][0], rda_5990_bt_en_data[count][1]); - - if(ret) - goto err; - } - - ret=rda5990_bt_setup_A2_power(1); - if(ret) - { - printk(KERN_INFO "***rda5990_bt_setup_A2_power fail!!! \n"); - goto err; - } - - printk(KERN_INFO "***rda_bt_power_on success!!! \n"); - - mutex_unlock(&i2c_rw_lock); - /*houzhen update 2012 03 06*/ - msleep(10); //delay 10 ms after power on - - - return 0; -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_bt_power_on failed! \n"); - return -1; - -} - -int rda_bt_power_off(void) -{ - unsigned int count = 0; - int ret = 0; - printk(KERN_INFO "rda_bt_power_off \n"); - - - mutex_lock(&i2c_rw_lock); - for(count = 0; count < sizeof(rda_5990_bt_off_data)/sizeof(rda_5990_bt_off_data[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_BT_RF_ADDR, rda_5990_bt_off_data[count][0], rda_5990_bt_off_data[count][1]); - if(ret) - goto err; - } - msleep(10); //10ms - printk(KERN_INFO "***rda_bt_power_off success!!! \n"); - - ret=rda5990_bt_setup_A2_power(0);//disable ldo_pa reg - if(ret) - goto err; - - - - mutex_unlock(&i2c_rw_lock); - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_bt_power_off failed! \n"); - return -1; - -} - - -int RDA5990_bt_rf_init(void) -{ - unsigned int count = 0; - int ret = 0; - printk(KERN_INFO "RDA5990_bt_rf_init \n"); - - - mutex_lock(&i2c_rw_lock); - for(count = 0; count < sizeof(rda_5990_bt_rf_data)/sizeof(rda_5990_bt_rf_data[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_BT_RF_ADDR, rda_5990_bt_rf_data[count][0], rda_5990_bt_rf_data[count][1]); - if(ret) - goto err; - } - - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_rf_init success!!! \n"); - msleep(5); //5ms - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_rf_init failed! \n"); - return -1; - -} - - - -/*houzhen add 2012 04 09 - add to ensure bt dig powerup - */ - -int RDA5990_bt_dig_reset(void) -{ - unsigned int count = 0; - int ret = 0; - - printk(KERN_INFO "RDA5990_bt_dig_reset \n"); - - mutex_lock(&i2c_rw_lock); - for(count = 0; count < sizeof(RDA5990_bt_dig_reset_data)/sizeof(RDA5990_bt_dig_reset_data[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_BT_RF_ADDR, RDA5990_bt_dig_reset_data[count][0], RDA5990_bt_dig_reset_data[count][1]); - if(ret) - goto err; - } - - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_dig_reset success!!! \n"); - msleep(5); //5ms - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_dig_reset failed! \n"); - return -1; - -} - - -int RDA5990_bt_dc_cal(void) -{ - unsigned int count = 0; - int ret = 0; - printk(KERN_INFO "rda_bt_dc_cal \n"); - - mutex_lock(&i2c_rw_lock); - - for(count = 0; count < sizeof(rda_5990_bt_dc_cal)/sizeof(rda_5990_bt_dc_cal[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_BT_RF_ADDR, rda_5990_bt_dc_cal[count][0], rda_5990_bt_dc_cal[count][1]); - if(ret) - goto err; - } - - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_bt_dc_cal success!!! \n"); - msleep(200); //200ms - - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***rda_bt_dc_cal failed! \n"); - return -1; - -} - - - -/*houzhen update Mar 15 2012 - bypass RDA5990_bt_set_rf_switch when wf is already on - */ - -int RDA5990_bt_set_rf_switch(void) -{ - unsigned int count = 0; - int ret = 0; - u16 temp_data=0; - printk(KERN_INFO "RDA5990_bt_set_rf_switch \n"); - - - mutex_lock(&i2c_rw_lock); - - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_BT_RF_ADDR, 0x3f, 0x0001); - if(ret) - goto err; - - ret = rda_gpio_i2c_read_1_addr_2_data(RDA_BT_RF_ADDR, 0x31, &temp_data); - - if(ret) - goto err; - - if(temp_data&0x8000) // if wf is already on - { - - printk(KERN_INFO "wf already en, bypass RDA5990_bt_set_rf_switch function \n"); - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_BT_RF_ADDR, 0x3f, 0x0000); - if(ret) - goto err; - mutex_unlock(&i2c_rw_lock); - return 0; - } - - for(count = 0; count < sizeof(rda_5990_bt_set_rf_switch_data)/sizeof(rda_5990_bt_set_rf_switch_data[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, rda_5990_bt_set_rf_switch_data[count][0], rda_5990_bt_set_rf_switch_data[count][1]); - if(ret) - goto err; - } - - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_set_rf_switch success!!! \n"); - msleep(50); //50ms - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_set_rf_switch failed! \n"); - return -1; - -} - - -/*houzhen update Mar 15 2012 - bypass RDA5990_bt_enable_clk when wf is already on - */ - -int RDA5990_bt_enable_clk(void) -{ - unsigned int count = 0; - int ret = 0; - u16 temp_data=0; - printk(KERN_INFO "RDA5990_bt_enable_clk \n"); - - mutex_lock(&i2c_rw_lock); - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_BT_RF_ADDR, 0x3f, 0x0001); - if(ret) - goto err; - - ret = rda_gpio_i2c_read_1_addr_2_data(RDA_BT_RF_ADDR, 0x31, &temp_data); - - if(ret) - goto err; - - if(temp_data&0x8000) // if wf is already on - { - - printk(KERN_INFO "wf already en, bypass RDA5990_bt_enable_clk function \n"); - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_BT_RF_ADDR, 0x3f, 0x0000); - if(ret) - goto err; - mutex_unlock(&i2c_rw_lock); - return 0; - } - - - for(count = 0; count < sizeof(RDA5990_bt_enable_clk_data)/sizeof(RDA5990_bt_enable_clk_data[0]); count ++) - { - ret = rda_gpio_i2c_write_1_addr_2_data(RDA_WIFI_RF_ADDR, RDA5990_bt_enable_clk_data[count][0], RDA5990_bt_enable_clk_data[count][1]); - if(ret) - goto err; - } - - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_enable_clk success!!! \n"); - msleep(50); //50ms - return 0; - -err: - mutex_unlock(&i2c_rw_lock); - printk(KERN_INFO "***RDA5990_bt_enable_clk failed! \n"); - return -1; - -} - -extern void mt_combo_bgf_enable_irq(void); -extern void mt_combo_bgf_disable_irq(void); - - -#define RDA_BT_IOCTL_MAGIC 'u' -#define RDA_BT_POWER_ON_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x01) -#define RD_BT_RF_INIT_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x02) -#define RD_BT_DC_CAL_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x03) -#define RD_BT_SET_RF_SWITCH_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x04) -#define RDA_BT_POWER_OFF_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x05) -#define RDA_BT_EN_CLK _IO(RDA_BT_IOCTL_MAGIC ,0x06) -#define RD_BT_DC_DIG_RESET_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x07) - -#define RDA_WIFI_POWER_ON_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x10) -#define RDA_WIFI_POWER_OFF_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x11) -#define RDA_WIFI_POWER_SET_TEST_MODE_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x12) -#define RDA_WIFI_POWER_CANCEL_TEST_MODE_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x13) -#define RDA_WIFI_DEBUG_MODE_IOCTL _IO(RDA_BT_IOCTL_MAGIC ,0x14) - -static int rda_5990_pw_ioctl(struct file *file, unsigned int cmd, unsigned long arg) -{ - int ret = 0; - - switch(cmd) - { - case RDA_WIFI_POWER_ON_IOCTL: - ret = rda_wifi_power_on(); - break; - - case RDA_WIFI_POWER_OFF_IOCTL: - ret = rda_wifi_power_off(); - break; - - case RDA_WIFI_POWER_SET_TEST_MODE_IOCTL: - wifi_in_test_mode = 1; - printk("****set rda wifi in test mode"); - break; - - case RDA_WIFI_POWER_CANCEL_TEST_MODE_IOCTL: - wifi_in_test_mode = 0; - printk("****set rda wifi in normal mode"); - break; - - case RDA_WIFI_DEBUG_MODE_IOCTL: - ret = rda_wifi_debug_en(); - break; - case RDA_BT_POWER_ON_IOCTL: - { - ret = rda_bt_power_on(); - mt_combo_bgf_enable_irq(); - } - break; - - /* should call thif function after bt_power_on*/ - case RDA_BT_EN_CLK: - ret = RDA5990_bt_enable_clk(); - break; - - case RD_BT_RF_INIT_IOCTL: - ret = RDA5990_bt_rf_init(); - break; - - case RD_BT_DC_CAL_IOCTL: - ret = RDA5990_bt_dc_cal(); - break; - - case RD_BT_DC_DIG_RESET_IOCTL: - ret = RDA5990_bt_dig_reset(); - break; - - case RD_BT_SET_RF_SWITCH_IOCTL: - ret = RDA5990_bt_set_rf_switch(); - break; - - case RDA_BT_POWER_OFF_IOCTL: - { - mt_combo_bgf_disable_irq(); - ret = rda_bt_power_off(); - } - break; - - default: - break; - } - - printk(KERN_INFO "rda_bt_pw_ioctl cmd=0x%02x \n", cmd); - - return ret; -} - -static int rda_5990_major; -static struct class *rda_5990_class = NULL; -static const struct file_operations rda_5990_operations = { - .owner = THIS_MODULE, - .unlocked_ioctl = rda_5990_pw_ioctl, - .release = NULL -}; - -void rda_5990_sleep_worker_task(struct work_struct *work) -{ - printk("---rda_5990_sleep_worker_task end"); - wake_unlock(&rda_5990_wake_lock); -} - -void rda_5990_set_wake_lock(void) -{ - wake_lock(&rda_5990_wake_lock); - cancel_delayed_work(&rda_5990_sleep_worker); - schedule_delayed_work(&rda_5990_sleep_worker, 6*HZ); -} - -int rda_5990_power_ctrl_init(void) -{ - int ret = 0; - - printk("rda_5990_power_ctrl_init begin\n"); - - rda_5990_major = register_chrdev(0, "rda5990_power_ctrl", &rda_5990_operations); - if(rda_5990_major < 0) - { - printk(KERN_INFO "register rdabt_power_ctrl failed!!! \n"); - return rda_5990_major; - } - - rda_5990_class = class_create(THIS_MODULE, "rda_combo"); - if(IS_ERR(rda_5990_class)) - { - unregister_chrdev(rda_5990_major, "rdabt_power_ctrl"); - return PTR_ERR(rda_5990_class); - } - - device_create(rda_5990_class, NULL, MKDEV(rda_5990_major, 0), NULL, "rdacombo"); - - - INIT_DELAYED_WORK(&rda_5990_sleep_worker, rda_5990_sleep_worker_task); - wake_lock_init(&rda_5990_wake_lock, WAKE_LOCK_SUSPEND, "RDA_sleep_worker_wake_lock"); - - mutex_init(&i2c_rw_lock); - printk("rda_5990_power_ctrl_init end\n"); - return 0; -} - -void rda_5990_power_ctrl_exit(void) -{ - - unregister_chrdev(rda_5990_major, "rdabt_power_ctrl"); - if(rda_5990_class) - class_destroy(rda_5990_class); - - cancel_delayed_work_sync(&rda_5990_sleep_worker); - wake_lock_destroy(&rda_5990_wake_lock); -} - -unsigned char rda_5990_wifi_in_test_mode(void) -{ - return wifi_in_test_mode; -} - - -static __inline__ void cfmakeraw(struct termios *s) -{ - s->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); - s->c_oflag &= ~OPOST; - s->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); - s->c_cflag &= ~(CSIZE|PARENB); - s->c_cflag |= CS8; -} - -static __inline__ int cfsetospeed(struct termios *s, speed_t speed) -{ - s->c_cflag = (s->c_cflag & ~CBAUD) | (speed & CBAUD); - return 0; -} - -static __inline__ int cfsetispeed(struct termios *s, speed_t speed) -{ - s->c_cflag = (s->c_cflag & ~CBAUD) | (speed & CBAUD); - return 0; -} - -static int rda_wifi_init_uart(char *dev) -{ - int errno; - struct termios ti; - struct serial_struct ss; - int fd; - - fd = sys_open(dev, O_RDWR | O_NOCTTY, 0); - if (fd < 0) { - printk("Can't open serial port"); - return -1; - } - - sys_ioctl(fd, TCFLSH, TCIOFLUSH); - - /* Clear the cust flag */ - if((errno = sys_ioctl(fd, TIOCGSERIAL, &ss))<0){ - printk("BAUD: error to get the serial_struct info:%s\n", errno); - goto err; - } - - if (ss.flags & ASYNC_SPD_CUST) { - printk("clear ASYNC_SPD_CUST\r\n"); - ss.flags &= ~ASYNC_SPD_CUST; - } - if((errno = sys_ioctl(fd, TIOCSSERIAL, &ss))<0){ - printk("BAUD: error to set serial_struct:%s\n", errno); - goto err; - } - - if ((errno = sys_ioctl(fd, TCGETS, (long)&ti)) < 0) { - printk("unable to get UART port setting"); - printk("Can't get port settings"); - goto err; - } - - cfmakeraw(&ti); - - ti.c_cflag |= CLOCAL; - ti.c_cflag &= ~CRTSCTS; - ti.c_lflag = 0; - ti.c_cc[VTIME] = 5; /* 0.5 sec */ - ti.c_cc[VMIN] = 0; - - /* Set initial baudrate */ - cfsetospeed(&ti, B115200); - cfsetispeed(&ti, B115200); - - if ((errno = sys_ioctl(fd, TCSETS, (long)&ti)) < 0) { - printk("unable to set UART port setting"); - printk("Can't set port settings"); - goto err; - } - - errno = sys_ioctl(fd, TCFLSH, TCIOFLUSH); - if(errno < 0) - goto err; - - return fd; - -err: - if(fd > 0) - sys_close(fd); - - return -1; -} - -EXPORT_SYMBOL(rda_wlan_version); -EXPORT_SYMBOL(rda_wifi_init_uart); -EXPORT_SYMBOL(rda_5990_wifi_in_test_mode); - -EXPORT_SYMBOL(rda_5990_set_wake_lock); -EXPORT_SYMBOL(rda_wifi_power_off); -EXPORT_SYMBOL(rda_wifi_power_on); -EXPORT_SYMBOL(rda_fm_power_on); -EXPORT_SYMBOL(rda_fm_power_off); - -module_init(rda_5990_power_ctrl_init); -module_exit(rda_5990_power_ctrl_exit); - -MODULE_LICENSE("GPL"); - diff --git a/drivers/net/wireless/rda5990/rda_gpio_i2c/Makefile b/drivers/net/wireless/rda5990/rda_gpio_i2c/Makefile deleted file mode 100755 index 9a192865bdbf..000000000000 --- a/drivers/net/wireless/rda5990/rda_gpio_i2c/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. -# -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# Makefile generated by Mediatek - -obj-y += rda_gpio_i2c.o - diff --git a/drivers/net/wireless/rda5990/rda_gpio_i2c/rda_gpio_i2c.c b/drivers/net/wireless/rda5990/rda_gpio_i2c/rda_gpio_i2c.c deleted file mode 100755 index 01a4277b0290..000000000000 --- a/drivers/net/wireless/rda5990/rda_gpio_i2c/rda_gpio_i2c.c +++ /dev/null @@ -1,460 +0,0 @@ -/* - * ===================================================================================== - * - * Filename: rda_gpio_i2c.c - * - * Description: - * - * Version: 1.0 - * Created: 04/19/2012 11:24:48 PM - * Revision: none - * Compiler: gcc - * - * Author: Allen_Hu - * Organization: RDA Inc. - * - * ===================================================================================== - */ -#include -#include -#include - -#include -#include - -#define RDA5990_WIFI_32K_FLAG 0x00000001 -#define RDA5990_BT_32K_FLAG 0x00000002 -#define RDA5990_FM_32K_FLAG 0x00000004 - -//#define DELAY 10 -#define DELAY 2 -// FM -#define SCL GPIO149 -#define SDA GPIO150 -// -/* WIFI -#define SCL GPIO104 -#define SDA GPIO102 -*/ - -#define u8 unsigned char - -//Data storage mode -static u8 isBigEnded = 0; - -//The global variable -static unsigned int gpioInitialized = 0; -static unsigned int rda5990_32k_state = 0; - -#define GPIO_MODE_00 0 -#define GPIO_DIR_OUT 1 -#define GPIO_DIR_IN 0 -#define GPIO_OUT_ONE 1 -#define GPIO_OUT_ZERO 0 - -void set_SDA_output(void) -{ - mt_set_gpio_mode(SDA, GPIO_MODE_00); - mt_set_gpio_dir(SDA, GPIO_DIR_OUT); -} - -void set_SDA_input(void) -{ - mt_set_gpio_mode(SDA, GPIO_MODE_00); - mt_set_gpio_dir(SDA, GPIO_DIR_IN); -} - -void set_SCL_output(void) -{ - mt_set_gpio_mode(SCL, GPIO_MODE_00); - mt_set_gpio_dir(SCL, GPIO_DIR_OUT); -} - -void set_SDA_high(void) -{ - mt_set_gpio_out(SDA, GPIO_OUT_ONE); -} - -void set_SDA_low(void) -{ - mt_set_gpio_out(SDA, GPIO_OUT_ZERO); -} - -void set_SCL_high(void) -{ - mt_set_gpio_out(SCL, GPIO_OUT_ONE); -} - -void set_SCL_low(void) -{ - mt_set_gpio_out(SCL, GPIO_OUT_ZERO); -} - -u8 get_SDA_bit(void) -{ - return mt_get_gpio_in(SDA); -} - -void i2c_delay(unsigned short cnt) -{ - udelay(cnt); -} - -//如果32k不能出来,请修改以下配置使能。 -void enable_32k_rtc(void) -{ - printk("enable 32k rtc called\n"); - rtc_gpio_enable_32k(RTC_GPIO_USER_GPS); - //rtc_gpio_enable_32k(RTC_GPIO_USER_WIFI); - //rtc_gpio_enable_32k(RTC_GPIO_USER_BT); - //rtc_gpio_enable_32k(RTC_GPIO_USER_WIFI); - rtc_gpio_enable_32k(RTC_GPIO_USER_FM); - msleep(100); -} - -void disable_32k_rtc(void) -{ - //rtc_gpio_disable_32k(RTC_GPIO_USER_WIFI); - rtc_gpio_enable_32k(RTC_GPIO_USER_GPS); - rtc_gpio_disable_32k(RTC_GPIO_USER_FM); - msleep(50); -} - -void i2c_start(void) -{ - set_SDA_output(); - set_SCL_output(); - - set_SDA_high(); - i2c_delay(DELAY); - set_SCL_high(); - i2c_delay(DELAY); - - set_SDA_low(); - i2c_delay(DELAY); - set_SCL_low(); - i2c_delay(DELAY); -} - -void i2c_stop(void) -{ - set_SDA_output(); - set_SCL_output(); - set_SDA_low(); - i2c_delay(DELAY); - set_SCL_high(); - i2c_delay(4*DELAY); - set_SDA_high(); - i2c_delay(4*DELAY); -} - - -/* - * return value: - * 0 --- 收到ACK - * 1 --- 没收到ACK - */ -u8 i2c_send_byte(u8 send_byte) -{ - u8 rc = 0; - u8 out_mask = 0x80; - u8 value; - u8 count = 8; - - set_SDA_output(); - set_SCL_output(); - - while(count > 0) { - set_SCL_low(); - i2c_delay(DELAY); - value = ((send_byte & out_mask) ? 1 : 0); - if (value == 1) { - set_SDA_high(); - } - else { - set_SDA_low(); - } - send_byte <<= 1; - i2c_delay(DELAY); - - set_SCL_high(); - i2c_delay(DELAY); - - count--; - } - set_SCL_low(); - set_SDA_input(); - i2c_delay(4*DELAY); - set_SCL_high(); - i2c_delay(DELAY); - rc = get_SDA_bit(); - i2c_delay(DELAY); - set_SCL_low(); - - return rc; -} - -/* - * ack = 0 发送ACK - * ack = 1 不发送ACK - */ -void i2c_read_byte(u8 *buffer, u8 ack) -{ - u8 count = 0x08; - u8 data = 0x00; - u8 temp = 0; - - set_SCL_output(); - while(count > 0) { - set_SCL_low(); - i2c_delay(2*DELAY); - if(count == 8) - set_SDA_input(); - i2c_delay(DELAY); - set_SCL_high(); - i2c_delay(2*DELAY); - temp = get_SDA_bit(); - data <<= 1; - if (temp) - data |= 0x01; - - i2c_delay(DELAY); - count--; - } - - set_SCL_low(); - i2c_delay(2*DELAY); - set_SDA_output(); - i2c_delay(DELAY); - if(ack){ - set_SDA_high(); - }else{ - set_SDA_low(); - } - i2c_delay(DELAY); - set_SCL_high(); - i2c_delay(2*DELAY); - - *buffer = data; - set_SCL_low(); -} - -/* -* write data to the I2C bus by GPIO simulated of a digital device rountine. -* -* @param -* chipAddr: address of the device -* regAddr: address of register within device -* data: the data to be written -* len: the data length -* -*/ -int rda_gpio_i2c_write_1_addr_2_data(u8 chipAddr, u8 regAddr, unsigned short data) -{ - u8 acknowledge; - int ret = 0; - i2c_start(); - - acknowledge = i2c_send_byte((chipAddr << 1) | 0x00); - if(acknowledge == 1){ - // return -1; - ret = -1; - goto out; - } - - acknowledge = i2c_send_byte(regAddr); - if(acknowledge == 1){ - ret = -1; - goto out; - } - - acknowledge = i2c_send_byte(data>>8); - if(acknowledge == 1){ - ret = -1; - goto out; - } - acknowledge = i2c_send_byte(data); - ret = acknowledge; - -out: - i2c_stop(); - - //return acknowledge; - return ret; -} -/* -* read data from the I2C bus by GPIO simulated of a digital device rountine. -* -* @param -* chipAddr: address of the device -* regAddr: address of register within device -* buffer: the data to be stored -* len: the data length -* -*/ -int rda_gpio_i2c_read_1_addr_2_data(u8 chipAddr, u8 regAddr, unsigned short *buffer) -{ - u8 tempdata, acknowledge; - int ret = 0; - - i2c_start(); - acknowledge = i2c_send_byte( (chipAddr << 1) | 0x00 ); - if(acknowledge == 1){ - ret = -1; - goto out; - } - acknowledge = i2c_send_byte(regAddr); - if(acknowledge == 1){ - ret = -1; - goto out; - } - - i2c_start();//restart - acknowledge = i2c_send_byte( (chipAddr << 1) | 0x01 ); - if(acknowledge == 1){ - ret = -1; - goto out; - } - - i2c_read_byte(&tempdata, 0); - *buffer = (tempdata<<8); - i2c_read_byte(&tempdata, 1); - *buffer |= tempdata; - -out: - i2c_stop(); -// return acknowledge; - return ret; -} - -u8 rda_gpio_i2c_write_4_addr_4_data(u8 chipAddr, unsigned int regAddr, unsigned int data) -{ - u8 acknowledge; - i2c_start(); - - acknowledge = i2c_send_byte((chipAddr << 1) | 0x00); - acknowledge = i2c_send_byte(regAddr>>24); - acknowledge = i2c_send_byte(regAddr>>16); - acknowledge = i2c_send_byte(regAddr>>8); - acknowledge = i2c_send_byte(regAddr); - - acknowledge = i2c_send_byte((chipAddr << 1) | 0x00); - - acknowledge = i2c_send_byte(data>>24); - acknowledge = i2c_send_byte(data>>16); - acknowledge = i2c_send_byte(data>>8); - acknowledge = i2c_send_byte(data); - - i2c_stop(); - return acknowledge; -} - -u8 rda_gpio_i2c_read_4_addr_4_data(u8 chipAddr, unsigned int regAddr, unsigned int *buffer) -{ - u8 tempdata, acknowledge; - u8 i = 0; - - i2c_start(); - acknowledge = i2c_send_byte( (chipAddr << 1) | 0x00 ); - acknowledge = i2c_send_byte(regAddr>>24); - acknowledge = i2c_send_byte(regAddr>>16); - acknowledge = i2c_send_byte(regAddr>>8); - acknowledge = i2c_send_byte(regAddr); - - i2c_start();//restart - acknowledge = i2c_send_byte( (chipAddr << 1) | 0x01 ); - - i2c_read_byte(&tempdata, 0); - *buffer = (tempdata<<24); - i2c_read_byte(&tempdata, 0); - *buffer |= (tempdata<<16); - i2c_read_byte(&tempdata, 0); - *buffer |= (tempdata<<8); - i2c_read_byte(&tempdata, 1); - *buffer |= tempdata; - - i2c_stop(); - return acknowledge; -} - -void rda_gpio_i2c_enable_32k(unsigned int flag) -{ - if(rda5990_32k_state == 0 ) - { - enable_32k_rtc(); - } - rda5990_32k_state |= (flag&0x07); -} - -void rda_gpio_i2c_disable_32k(unsigned int flag) -{ - rda5990_32k_state &= (~flag); - if(rda5990_32k_state == 0) - disable_32k_rtc(); -} - -/* -* initializes I2C interface routine. -* -* @return value: -* 0--success; -* 1--error. -* -*/ -static int __init rda_gpio_i2c_init(void) -{ - if(gpioInitialized == 0){ - printk(KERN_INFO "RDA GPIO control for I2C Driver \n"); - - unsigned char *temp = NULL; - unsigned short testData = 0xaa55; - temp = (unsigned char *)&testData; - if(*temp == 0x55){ - isBigEnded = 0; - }else{ - isBigEnded = 1; - } - - - gpioInitialized = 1; - rda_gpio_i2c_enable_32k(RDA5990_FM_32K_FLAG); - - /* FM - unsigned short regValue = 0; - rda_gpio_i2c_read_1_addr_2_data(0x11, 0x0C, ®Value); - printk(KERN_ALERT "####[%s, %d], Addr=%02X, value=%04X\n", __func__, __LINE__, 0x0C, regValue); - */ - /*WIFI - unsigned short regValue = 0x0001; - rda_gpio_i2c_write_1_addr_2_data(0x14, 0x3f, regValue); - regValue = 0; - rda_gpio_i2c_read_1_addr_2_data(0x14, 0x3f, ®Value); - printk(KERN_ALERT "####[%s, %d], Addr=%02X, value=%04X\n", __func__, __LINE__, 0x3f, regValue); - regValue = 0; - rda_gpio_i2c_read_1_addr_2_data(0x14, 0x20, ®Value); - printk(KERN_ALERT "####[%s, %d], Addr=%02X, value=%04X\n", __func__, __LINE__, 0x20, regValue); - */ - - return 0; - }else{ - printk("RDA GPIO control for I2C has been initialized.\n"); - return 0; - } -} - -static void __exit rda_gpio_i2c_exit(void) -{ - gpioInitialized = 0; - rda_gpio_i2c_disable_32k(RDA5990_FM_32K_FLAG); -} - -EXPORT_SYMBOL(rda_gpio_i2c_read_1_addr_2_data); -EXPORT_SYMBOL(rda_gpio_i2c_write_1_addr_2_data); -EXPORT_SYMBOL(rda_gpio_i2c_enable_32k); -EXPORT_SYMBOL(rda_gpio_i2c_disable_32k); - -EXPORT_SYMBOL(rda_gpio_i2c_read_4_addr_4_data); -EXPORT_SYMBOL(rda_gpio_i2c_write_4_addr_4_data); - -module_init(rda_gpio_i2c_init); /* load the module */ -module_exit(rda_gpio_i2c_exit); /* unload the module */ diff --git a/drivers/net/wireless/rda5990/rda_wlan/Makefile b/drivers/net/wireless/rda5990/rda_wlan/Makefile deleted file mode 100755 index e8c121fbc5bc..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -obj-m := rda5890.o -rda5890-objs := \ - rda5890_if_sdio.o \ - rda5890_dev.o \ - rda5890_txrx.o \ - rda5890_wid.o \ - rda5890_wext.o \ - rda5890_debugfs.o\ - rda5890_sdio_patch.o\ - rda5890_nvram.o\ - rda5890_scan.o - -KERNEL_DIR = /home/dxj/share/rk2928/kernel - -all: - make -C $(KERNEL_DIR) M=`pwd` modules - -clean: - rm -f Module.symvers *.o modules.order *.ko wifi_launcher.mod.c - rm -rf .wifi* .tmp* wlan.mod.c \ No newline at end of file diff --git a/drivers/net/wireless/rda5990/rda_wlan/Makefile_gwl b/drivers/net/wireless/rda5990/rda_wlan/Makefile_gwl deleted file mode 100755 index 92c6886421e2..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/Makefile_gwl +++ /dev/null @@ -1,23 +0,0 @@ -MODULE_NAME = rda5890 -CONFIG_RDA5890 = m -$(MODULE_NAME)-y += \ - rda5890_if_sdio.o \ - rda5890_dev.o \ - rda5890_txrx.o \ - rda5890_wid.o \ - rda5890_wext.o \ - rda5890_debugfs.o\ - rda5890_sdio_patch.o\ - rda5890_nvram.o\ - rda5890_scan.o - -obj-$(CONFIG_RDA5890) += $(MODULE_NAME).o - -KERNEL_DIR = /home/dxj/share/rk2928/kernel - -all: - make -C $(KERNEL_DIR) M=`pwd` modules - -clean: - rm -f Module.symvers *.o modules.order *.ko wifi_launcher.mod.c - rm -rf .wifi* .tmp* wlan.mod.c \ No newline at end of file diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_debugfs.c b/drivers/net/wireless/rda5990/rda_wlan/rda5890_debugfs.c deleted file mode 100755 index 2ab7b1f0297e..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_debugfs.c +++ /dev/null @@ -1,593 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include "rda5890_defs.h" -#include "rda5890_dev.h" - -static struct dentry *rda5890_dir = NULL; - -void dump_buf(char *data, size_t len) -{ - char temp_buf[64]; - size_t i, off = 0; - - memset(temp_buf, 0, 64); - for (i=0;iprivate_data = inode->i_private; - return 0; -} - -#if 0 -static ssize_t rda5890_write_file_dummy(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) -{ - return -EINVAL; -} -#endif - -static ssize_t rda5890_debug_read(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - //struct rda5890_private *priv = file->private_data; - size_t pos = 0; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - ssize_t res; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "%s\n", __func__); - - pos += snprintf(buf+pos, PAGE_SIZE - pos, "state = %s\n", - "LWANG_TESTING"); - - res = simple_read_from_buffer(userbuf, count, ppos, buf, pos); - - free_page(addr); - return res; -} - -static ssize_t rda5890_debug_write(struct file *file, - const char __user *user_buf, size_t count, - loff_t *ppos) -{ - //struct rda5890_private *priv = file->private_data; - ssize_t ret; - int p1, p2, p3, p4; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "%s\n", __func__); - - if (copy_from_user(buf, user_buf, count)) { - ret = -EFAULT; - goto out_unlock; - } - ret = sscanf(buf, "%d %d %d %d", &p1, &p2, &p3, &p4); - if (ret != 4) { - ret = -EINVAL; - goto out_unlock; - } - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "input p1 = %d, p2 = %d, p3 = %d, p4 = %d\n", - p1, p2, p3, p4); - - ret = count; -out_unlock: - free_page(addr); - return ret; -} - -static ssize_t rda5890_debugarea_read(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - //struct rda5890_private *priv = file->private_data; - size_t pos = 0; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - ssize_t res; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "%s\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "get debug_area = 0x%x\n",rda5890_dbg_area); - - pos += snprintf(buf+pos, PAGE_SIZE - pos, "%x\n", - rda5890_dbg_area); - - res = simple_read_from_buffer(userbuf, count, ppos, buf, pos); - - free_page(addr); - return res; -} - -static ssize_t rda5890_debugarea_write(struct file *file, - const char __user *user_buf, size_t count, - loff_t *ppos) -{ - //struct rda5890_private *priv = file->private_data; - ssize_t ret; - int debug_area; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "%s\n", __func__); - - if (copy_from_user(buf, user_buf, count)) { - ret = -EFAULT; - goto out_unlock; - } - ret = sscanf(buf, "%x", &debug_area); - if (ret != 1) { - ret = -EINVAL; - goto out_unlock; - } - - rda5890_dbg_area = debug_area; - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "set debug_area = 0x%x\n",rda5890_dbg_area); - - ret = count; -out_unlock: - free_page(addr); - return ret; -} - -static ssize_t rda5890_debuglevel_read(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -{ - //struct rda5890_private *priv = file->private_data; - size_t pos = 0; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - ssize_t res; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "%s\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "get debug_level = 0x%x\n",rda5890_dbg_level); - - pos += snprintf(buf+pos, PAGE_SIZE - pos, "%x\n", - rda5890_dbg_level); - - res = simple_read_from_buffer(userbuf, count, ppos, buf, pos); - - free_page(addr); - return res; -} - -static ssize_t rda5890_debuglevel_write(struct file *file, - const char __user *user_buf, size_t count, - loff_t *ppos) -{ - //struct rda5890_private *priv = file->private_data; - ssize_t ret; - int debug_level; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "%s\n", __func__); - - if (copy_from_user(buf, user_buf, count)) { - ret = -EFAULT; - goto out_unlock; - } - ret = sscanf(buf, "%x", &debug_level); - if (ret != 1) { - ret = -EINVAL; - goto out_unlock; - } - - rda5890_dbg_level = debug_level; - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "set debug_level = 0x%x\n",rda5890_dbg_level); - - ret = count; -out_unlock: - free_page(addr); - return ret; -} - -static int debug_read_flag = 0; - -static ssize_t rda5890_sdio_read(struct file *file, - const char __user *user_buf, size_t count, - loff_t *ppos) -{ - //struct rda5890_private *priv = file->private_data; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - int ret; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "%s\n", __func__); - - if (copy_from_user(buf, user_buf, count)) { - ret = -EFAULT; - goto out_unlock; - } - ret = sscanf(buf, "%d", &debug_read_flag); - if (ret != 1) { - ret = -EINVAL; - goto out_unlock; - } - -out_unlock: - free_page(addr); - return count; -} - -static ssize_t rda5890_sdio_write(struct file *file, - const char __user *user_buf, size_t count, - loff_t *ppos) -{ - struct rda5890_private *priv = file->private_data; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - int iter, len, i; - int ret; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "%s\n", __func__); - - if (copy_from_user(buf, user_buf, count)) { - ret = -EFAULT; - goto out_unlock; - } - ret = sscanf(buf, "%d %d", &iter, &len); - if (ret != 2) { - ret = -EINVAL; - goto out_unlock; - } - - if (len > 1660) { - ret = -EINVAL; - goto out_unlock; - } - - for (i=0; ihw_host_to_card(priv, buf, len, DATA_REQUEST_PACKET); - - //RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - // "Host to Card done, ret = %d\n", ret); - } - -out_unlock: - free_page(addr); - return count; -} - -#define SDIO_TEST_CMD_MAGIC 0x55664433 -#define SDIO_TEST_CMD_LEN 16 - -#define SDIO_TEST_CMD_TYPE_H2C_START 1 -#define SDIO_TEST_CMD_TYPE_H2C_STOP 2 -#define SDIO_TEST_CMD_TYPE_H2C_STATUS 3 -#define SDIO_TEST_CMD_TYPE_C2H_START 4 -#define SDIO_TEST_CMD_TYPE_C2H_PILOT 5 -#define SDIO_TEST_CMD_TYPE_C2H_END 6 - -static int recv_time_start, recv_time_end; -static int send_time_start, send_time_end; - -void rda5890_sdio_test_card_to_host(char *buf, unsigned short len) -{ - int i; - int cmd, cmd_iter, cmd_len; - int time_ms; - static int recv_pattern = 0; - static int recv_tput_flag = 0; - static int recv_pkts = 0; - static int recv_bytes = 0; - - //RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - // "SDIO TEST Card to Host, len = %d\n", len); - - if (debug_read_flag) { - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "DEBUG RX, len = %d\n", len); - dump_buf(buf, len); - } - - if ((*(volatile unsigned long *)buf == SDIO_TEST_CMD_MAGIC) - && len == SDIO_TEST_CMD_LEN) { - cmd = (int)(*(volatile unsigned long *)(buf + 4)); - cmd_iter = (int)(*(volatile unsigned long *)(buf + 8)); - cmd_len = (int)(*(volatile unsigned long *)(buf + 12)); - //RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - // "SDIO TEST CMD: cmd = %d, iter = %d, len = %d\n", - // cmd, cmd_iter, cmd_len); - switch (cmd) { - case SDIO_TEST_CMD_TYPE_H2C_STATUS: - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "H2C STATUS CMD \n"); - time_ms = jiffies_to_msecs(send_time_end - send_time_start); - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "SDIO H2C STATUS: pkts = %d, bytes = %d, time = %d ms\n", - cmd_iter, cmd_len, time_ms); - break; - case SDIO_TEST_CMD_TYPE_C2H_PILOT: - //RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - // "C2H PILOT CMD \n"); - recv_pattern = 0; - recv_tput_flag = 1; - recv_pkts = 0; - recv_bytes = 0; - recv_time_start = jiffies; - break; - case SDIO_TEST_CMD_TYPE_C2H_END: - //RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - // "C2H END CMD \n"); - recv_time_end = jiffies; - recv_tput_flag = 0; - time_ms = jiffies_to_msecs(recv_time_end - recv_time_start); - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "SDIO C2H STATUS: pkts = %d, bytes = %d, time = %d ms\n", - recv_pkts, recv_bytes, time_ms); - break; - case SDIO_TEST_CMD_TYPE_H2C_START: - case SDIO_TEST_CMD_TYPE_H2C_STOP: - case SDIO_TEST_CMD_TYPE_C2H_START: - default: - RDA5890_ERRP("SDIO TEST CMD: Invalid cmd %d\n", cmd); - break; - } - return; - } - - for (i=0;ihw_host_to_card(priv, cmd, len ,SDIO_TEST_CMD_LEN); - if (ret) { - RDA5890_ERRP("START cmd send fail, ret = %d\n", ret); - } -} - -static void sdio_tput_test_write(struct rda5890_private *priv, int iter, int len) -{ - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf_1 = (char *)addr; - char *buf_2 = (char *)addr + PAGE_SIZE/2; - char cmd[SDIO_TEST_CMD_LEN]; - int i; - int ret; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "%s, iter = %d, len = %d\n", __func__, iter, len); - - for (i=0; ihw_host_to_card(priv, cmd, len,SDIO_TEST_CMD_LEN); - if (ret) { - RDA5890_ERRP("START cmd send fail, ret = %d\n", ret); - goto out; - } - - send_time_start = jiffies; - for (i=0;ihw_host_to_card(priv, buf_1, len, DATA_REQUEST_PACKET); - else - ret = priv->hw_host_to_card(priv, buf_2, len, DATA_REQUEST_PACKET); - if (ret) { - RDA5890_ERRP("packet %d send fail, ret = %d\n", i, ret); - goto out; - } - } - send_time_end = jiffies; - - (*(volatile unsigned long *)(cmd + 0)) = SDIO_TEST_CMD_MAGIC; - (*(volatile unsigned long *)(cmd + 4)) = SDIO_TEST_CMD_TYPE_H2C_STOP; - (*(volatile unsigned long *)(cmd + 8)) = iter; - (*(volatile unsigned long *)(cmd + 12)) = len; - ret = priv->hw_host_to_card(priv, cmd, len, SDIO_TEST_CMD_LEN); - if (ret) { - RDA5890_ERRP("START cmd send fail, ret = %d\n", ret); - goto out; - } - -out: - free_page(addr); -} - -static ssize_t rda5890_sdio_tput(struct file *file, - const char __user *user_buf, size_t count, - loff_t *ppos) -{ - struct rda5890_private *priv = file->private_data; - int ret; - unsigned long addr = get_zeroed_page(GFP_KERNEL); - char *buf = (char *)addr; - int wr, iter, len; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "%s\n", __func__); - - if (copy_from_user(buf, user_buf, count)) { - ret = -EFAULT; - goto out_unlock; - } - ret = sscanf(buf, "%d %d %d", &wr, &iter, &len); - if (ret != 3) { - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "Error Input, format shall be [wr iter len]\n"); - ret = -EINVAL; - goto out_unlock; - } - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "input wr = %d, iter = %d, len = %d\n", - wr, iter, len); - - if (wr) - sdio_tput_test_write(priv, iter, len); - else - sdio_tput_test_read(priv, iter, len); - - ret = count; -out_unlock: - free_page(addr); - return ret; -} - -#define FOPS(fread, fwrite) { \ - .owner = THIS_MODULE, \ - .open = open_file_generic, \ - .read = (fread), \ - .write = (fwrite), \ -} - -struct rda5890_debugfs_files { - char *name; - int perm; - struct file_operations fops; -}; - -static struct rda5890_debugfs_files debugfs_files[] = { - { "debug", 0444, FOPS(rda5890_debug_read, rda5890_debug_write), }, - { "debugarea", 0444, FOPS(rda5890_debugarea_read, rda5890_debugarea_write), }, - { "debuglevel", 0444, FOPS(rda5890_debuglevel_read, rda5890_debuglevel_write), }, - { "sdioread", 0444, FOPS(NULL, rda5890_sdio_read), }, - { "sdiowrite", 0444, FOPS(NULL, rda5890_sdio_write), }, - { "sdiotput", 0444, FOPS(NULL, rda5890_sdio_tput), }, -}; - -void rda5890_debugfs_init(void) -{ - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s\n", __func__); - - if (!rda5890_dir) - rda5890_dir = debugfs_create_dir("rda5890", NULL); - - return; -} - -void rda5890_debugfs_remove(void) -{ - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s\n", __func__); - - if (rda5890_dir) - debugfs_remove(rda5890_dir); - - return; -} - -void rda5890_debugfs_init_one(struct rda5890_private *priv) -{ - int i; - struct rda5890_debugfs_files *files; - if (!rda5890_dir) - goto exit; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s\n", __func__); - - priv->debugfs_dir = debugfs_create_dir("rda5890_dev", rda5890_dir); - if (!priv->debugfs_dir) - goto exit; - - for (i=0; idebugfs_files[i] = debugfs_create_file(files->name, - files->perm, - priv->debugfs_dir, - priv, - &files->fops); - } - -exit: - return; -} - -void rda5890_debugfs_remove_one(struct rda5890_private *priv) -{ - int i; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s\n", __func__); - - for(i=0; idebugfs_files[i]); - debugfs_remove(priv->debugfs_dir); -} - diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_debugfs.h b/drivers/net/wireless/rda5990/rda_wlan/rda5890_debugfs.h deleted file mode 100755 index b42bc4e410c6..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_debugfs.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _RDA5890_DEBUGFS_H_ -#define _RDA5890_DEBUGFS_H_ - -void rda5890_debugfs_init(void); -void rda5890_debugfs_remove(void); - -void rda5890_debugfs_init_one(struct rda5890_private *priv); -void rda5890_debugfs_remove_one(struct rda5890_private *priv); - -/* This is for SDIO testing */ -void rda5890_sdio_test_card_to_host(char *buf, unsigned short len); - -#endif diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_defs.h b/drivers/net/wireless/rda5990/rda_wlan/rda5890_defs.h deleted file mode 100755 index ef8e114b006a..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_defs.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef _RDA5890_DEFS_H_ -#define _RDA5890_DEFS_H_ - -#include - -#define RDA5890_SDIOWIFI_VER_MAJ 0 -#define RDA5890_SDIOWIFI_VER_MIN 3 -#define RDA5890_SDIOWIFI_VER_BLD 1 - -#define WIFI_POWER_MANAGER //if need wifi sleep for power save should open this - - -#define WIFI_UNLOCK_SYSTEM -#define GET_SCAN_FROM_NETWORK_INFO - -#define USE_MAC_DYNAMIC_ONCE -//#define WIFI_TEST_MODE - -#define DEBUG - -extern int rda5890_dbg_level; -extern int rda5890_dbg_area; - -typedef enum { - RDA5890_DL_ALL = 0, - RDA5890_DL_CRIT = 1, - RDA5890_DL_TRACE = 2, - RDA5890_DL_NORM = 3, - RDA5890_DL_DEBUG = 4, - RDA5890_DL_VERB = 5, -} RDA5890_DBG_LEVEL; - -#define RDA5890_DA_MAIN (1 << 0) -#define RDA5890_DA_SDIO (1 << 1) -#define RDA5890_DA_ETHER (1 << 2) -#define RDA5890_DA_WID (1 << 3) -#define RDA5890_DA_WEXT (1 << 4) -#define RDA5890_DA_TXRX (1 << 5) -#define RDA5890_DA_PM (1 << 6) -#define RDA5890_DA_ALL 0x0000007f - -#define RDA5890_LOG "RDA5890: " -#ifndef DEBUG -#define DEBUG -#endif - -#ifdef DEBUG -#define RDA5890_DBGLA(area, lvl) \ - (((lvl)<=rda5890_dbg_level) && ((area)&rda5890_dbg_area)) -#define RDA5890_DBGLAP(area,lvl, x...) \ - do{ \ - if (((lvl)<=rda5890_dbg_level) && ((area)&rda5890_dbg_area)) \ - printk(KERN_INFO RDA5890_LOG x ); \ - }while(0) -#define RDA5890_DBGP(x...) \ - do{ \ - printk(KERN_INFO RDA5890_LOG x ); \ - }while(0) -#else -#define RDA5890_DBGLA(area, lvl) 0 -#define RDA5890_DBGLAP(area,lvl, x...) do {} while (0) -#define RDA5890_DBGP(x...) do {} while (0) -#endif - -#define RDA5890_ERRP(fmt, args...) \ - do{ \ - printk(KERN_ERR RDA5890_LOG "%s: "fmt, __func__, ## args ); \ - }while(0) - -#endif - diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_dev.c b/drivers/net/wireless/rda5990/rda_wlan/rda5890_dev.c deleted file mode 100755 index 8bea49c2a084..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_dev.c +++ /dev/null @@ -1,633 +0,0 @@ -/** - * This file contains the major functions in WLAN - * driver. It includes init, exit, open, close and main - * thread etc.. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include -#include - - -#include "rda5890_defs.h" -#include "rda5890_dev.h" -#include "rda5890_ioctl.h" -#include "rda5890_wid.h" -#include "rda5890_wext.h" -#include "rda5890_txrx.h" -#include "rda5890_if_sdio.h" - -int rda5890_sleep_flags = RDA_SLEEP_ENABLE | RDA_SLEEP_PREASSO; - -#ifdef WIFI_UNLOCK_SYSTEM -atomic_t wake_lock_counter; -struct wake_lock sleep_worker_wake_lock; -#endif - - -int rda5890_init_pm(struct rda5890_private *priv) -{ -#ifdef WIFI_POWER_MANAGER - int ret = 0; - struct if_sdio_card *card = (struct if_sdio_card *)priv->card; - -#ifdef WIFI_TEST_MODE - if(rda_5990_wifi_in_test_mode()) - return 0; -#endif - if (rda5890_sleep_flags & RDA_SLEEP_ENABLE) - { - ret = rda5890_set_pm_mode(priv, 2); - if(ret < 0) - goto err; - } - if (rda5890_sleep_flags & RDA_SLEEP_PREASSO) - { - ret = rda5890_set_preasso_sleep(priv, 0x00800080); - if(ret < 0) - goto err; - } - - sdio_claim_host(card->func); - sdio_writeb(card->func, 1, IF_SDIO_FUN1_INT_TO_DEV, &ret); - sdio_release_host(card->func); - if (ret) { - RDA5890_ERRP("write FUN1_INT_TO_DEV reg fail\n"); - } - - atomic_inc(&priv->sleep_flag); - -err: - return ret; -#else - return 0; -#endif -} - - -int rda5890_disable_self_cts(struct rda5890_private *priv) -{ - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set rda5890_disable_self_cts 0x%02x\n", 0); - - ret = rda5890_generic_set_uchar(priv, WID_PTA_MODE, 0); - if(ret < 0) - goto err; - return 0; - -err: - return ret; -} - -int rda5890_disable_block_bt(struct rda5890_private *priv) -{ - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set rda5890_disable_block_bt 0x%02x\n", 0); - - ret = rda5890_generic_set_uchar(priv, WID_PTA_BLOCK_BT, 0); - if(ret < 0) - goto err; - - return 0; - -err: - return ret; -} - -//rda5890_set_scan_timeout has defined WID_ACTIVE_SCAN_TIME so if you call that func, not need call this -int rda5890_set_active_scan_time(struct rda5890_private *priv) -{ - int ret = 0; - ret= rda5890_generic_set_ushort(priv, WID_ACTIVE_SCAN_TIME, 200); - if(ret < 0) - goto err; - return 0; - err: - return ret; -} - -/** - * @brief This function opens the ethX or mshX interface - * - * @param dev A pointer to net_device structure - * @return 0 or -EBUSY if monitor mode active - */ -static int rda5890_dev_open(struct net_device *dev) -{ - struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - if (priv->connect_status == MAC_CONNECTED) - netif_carrier_on(dev); - else - netif_carrier_off(dev); - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); - return ret; -} - -/** - * @brief This function closes the ethX interface - * - * @param dev A pointer to net_device structure - * @return 0 - */ -static int rda5890_eth_stop(struct net_device *dev) -{ - //struct rda5890_private *priv = (struct rda5890_private *) dev->priv; - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - netif_stop_queue(dev); - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); - return 0; -} - -static void rda5890_tx_timeout(struct net_device *dev) -{ - //struct rda5890_private *priv = (struct rda5890_private *) dev->priv; - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); -} - -/** - * @brief This function returns the network statistics - * - * @param dev A pointer to struct lbs_private structure - * @return A pointer to net_device_stats structure - */ -static struct net_device_stats *rda5890_get_stats(struct net_device *dev) -{ - struct rda5890_private *priv = (struct rda5890_private *) netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); - return &priv->stats; -} - -static int rda5890_set_mac_address(struct net_device *dev, void *addr) -{ - int ret = 0; - struct rda5890_private *priv = (struct rda5890_private *) netdev_priv(dev); - struct sockaddr *phwaddr = addr; - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - ret = rda5890_set_mac_addr(priv, phwaddr->sa_data); - if (ret) { - goto done; - } - memcpy(priv->dev->dev_addr, phwaddr->sa_data, ETH_ALEN); - -done: - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); - return ret; -} - -static void rda5890_set_multicast_list(struct net_device *dev) -{ - //struct rda5890_private *priv = dev->priv; - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - //schedule_work(&priv->mcast_work); - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); -} - -/** - * @brief This function checks the conditions and sends packet to IF - * layer if everything is ok. - * - * @param priv A pointer to struct lbs_private structure - * @param skb A pointer to skb which includes TX packet - * @return 0 or -1 - */ -int rda5890_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) -{ - struct rda5890_private *priv = (struct rda5890_private*)netdev_priv(dev); -#ifdef WIFI_TEST_MODE - if(rda_5990_wifi_in_test_mode()) - return 0; -#endif //end WIFI_TEST_MODE - return rda5890_data_tx(priv, skb, dev); -} - -static int rda5890_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) -{ - int ret = 0; - struct rda5890_private *priv = netdev_priv(dev); - unsigned long value; - char in_buf[MAX_CMD_LEN + 4], out_buf[MAX_CMD_LEN + 4]; - unsigned short in_len, out_len, out_len_ret; - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s >>>, cmd = %x\n", __func__, cmd); - - switch (cmd) { - case IOCTL_RDA5890_GET_MAGIC: - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "IOCTL_RDA5890_GET_MAGIC\n"); - value = RDA5890_MAGIC; - if (copy_to_user(rq->ifr_data, &value, sizeof(value))) - ret = -EFAULT; - break; - case IOCTL_RDA5890_GET_DRIVER_VER: - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "IOCTL_RDA5890_GET_DRIVER_VER\n"); - value = RDA5890_SDIOWIFI_VER_MAJ << 16 | - RDA5890_SDIOWIFI_VER_MIN << 8 | - RDA5890_SDIOWIFI_VER_BLD; - if (copy_to_user(rq->ifr_data, &value, sizeof(value))) - ret = -EFAULT; - break; - case IOCTL_RDA5890_MAC_GET_FW_VER: - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "IOCTL_RDA5890_MAC_GET_FW_VER\n"); - ret = rda5890_get_fw_ver(priv, &value); - if (ret) - break; - if (copy_to_user(rq->ifr_data, &value, sizeof(value))) - ret = -EFAULT; - break; - case IOCTL_RDA5890_MAC_WID: - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "IOCTL_RDA5890_MAC_WID\n"); - if (copy_from_user(in_buf, rq->ifr_data, 4)) { - ret = -EFAULT; - break; - } - in_len = (unsigned short)(in_buf[0] + (in_buf[1] << 8)); - out_len = (unsigned short)(in_buf[2] + (in_buf[3] << 8)); - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - " in_len = %d, out_len = %d\n", in_len, out_len); - if (copy_from_user(in_buf, rq->ifr_data, 4 + in_len)) { - ret = -EFAULT; - break; - } - out_len_ret = MAX_CMD_LEN; - ret = rda5890_wid_request(priv, in_buf + 4, in_len, out_buf + 4, &out_len_ret); - if (ret) { - RDA5890_ERRP("rda5890_wid_request, ret = %d\n", ret); - break; - } - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - " out_len_ret = %d\n", out_len_ret); - if (out_len_ret > out_len) { - RDA5890_ERRP("No enough buf for wid response\n"); - ret = -ENOMEM; - break; - } - out_buf[2] = (char)(out_len_ret&0x00FF); - out_buf[3] = (char)((out_len_ret&0xFF00) >> 8); - if (copy_to_user(rq->ifr_data, out_buf, 4 + out_len_ret)) - ret = -EFAULT; - break; - case IOCTL_RDA5890_SET_WAPI_ASSOC_IE: - if(copy_from_user(in_buf, rq->ifr_data, 100)) { - ret = -EFAULT; - break; - } - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "IOCTL_RDA5890_SET_WAPI_ASSOC_IE is %x %x %x %x \n", - in_buf[0], in_buf[1],in_buf[2],in_buf[3]); - rda5890_generic_set_str(priv, WID_WAPI_ASSOC_IE, in_buf ,100); - break; - case IOCTL_RDA5890_GET_WAPI_ASSOC_IE: - rda5890_generic_get_str(priv, WID_WAPI_ASSOC_IE, out_buf, 100); - if (copy_to_user(rq->ifr_data, out_buf, 100)) - ret = -EFAULT; - break; - default: - RDA5890_ERRP("unknown cmd 0x%x\n", cmd); - ret = -EFAULT; - break; - } - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); - return ret; -} - -static int rda5890_init_adapter(struct rda5890_private *priv) -{ - int ret = 0; - size_t bufsize; - int i; - - mutex_init(&priv->wid_lock); -#ifdef WIFI_POWER_MANAGER - atomic_set(&priv->sleep_flag, 0); -#endif - priv->wid_pending = 0; - priv->wid_msg_id = 0; - - /* Allocate buffer to store the BSSID list */ - bufsize = RDA5890_MAX_NETWORK_NUM * sizeof(struct bss_descriptor); - priv->networks = kzalloc(bufsize, GFP_KERNEL); - if (!priv->networks) { - RDA5890_ERRP("Out of memory allocating beacons\n"); - ret = -1; - goto out; - } - - /* Initialize scan result lists */ - INIT_LIST_HEAD(&priv->network_free_list); - INIT_LIST_HEAD(&priv->network_list); - for (i = 0; i < RDA5890_MAX_NETWORK_NUM; i++) { - list_add_tail(&priv->networks[i].list, - &priv->network_free_list); - } - priv->scan_running = 0; - - /* Initialize delayed work workers and thread */ - priv->work_thread = create_singlethread_workqueue("rda5890_worker"); - INIT_DELAYED_WORK(&priv->scan_work, rda5890_scan_worker); - INIT_DELAYED_WORK(&priv->assoc_work, rda5890_assoc_worker); - INIT_DELAYED_WORK(&priv->assoc_done_work, rda5890_assoc_done_worker); - INIT_DELAYED_WORK(&priv->wlan_connect_work, rda5890_wlan_connect_worker); - - /* Initialize status */ - priv->connect_status = MAC_DISCONNECTED; - memset(&priv->curbssparams, 0, sizeof(priv->curbssparams)); - memset(&priv->wstats, 0, sizeof(priv->wstats)); - - /* Initialize sec related status */ - priv->assoc_flags = 0; - priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; - memset(&priv->wep_keys, 0, sizeof(priv->wep_keys)); - memset(&priv->wpa_ie[0], 0, sizeof(priv->wpa_ie)); - priv->wpa_ie_len = 0; - priv->first_init = 1; - -out: - return ret; -} - -static void rda5890_free_adapter(struct rda5890_private *priv) -{ - cancel_delayed_work_sync(&priv->assoc_done_work); - cancel_delayed_work_sync(&priv->assoc_work); - cancel_delayed_work_sync(&priv->scan_work); - cancel_delayed_work_sync(&priv->wlan_connect_work); - destroy_workqueue(priv->work_thread); - - if(priv->networks) - kfree(priv->networks); - priv->networks = NULL; -} - -static const struct net_device_ops rda_netdev_ops = { - .ndo_open = rda5890_dev_open, - .ndo_stop = rda5890_eth_stop, - .ndo_start_xmit = rda5890_hard_start_xmit, - .ndo_set_mac_address = rda5890_set_mac_address, - .ndo_tx_timeout = rda5890_tx_timeout, - .ndo_get_stats = rda5890_get_stats, - .ndo_do_ioctl = rda5890_ioctl -}; - -/** - * @brief This function adds the card. it will probe the - * card, allocate the lbs_priv and initialize the device. - * - * @param card A pointer to card - * @return A pointer to struct lbs_private structure - */ -struct rda5890_private *rda5890_add_card(void *card) -{ - struct net_device *dev = NULL; - struct rda5890_private *priv = NULL; - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - /* Allocate an Ethernet device and register it */ - dev = alloc_netdev_mq(sizeof(struct rda5890_private), "wlan%d", ether_setup, 1); - if (!dev) { - RDA5890_ERRP("alloc_etherdev failed\n"); - goto done; - } - priv = netdev_priv(dev); - - if(rda5890_init_adapter(priv)){ - RDA5890_ERRP("rda5890_init_adapter failed\n"); - goto err_init_adapter; - } - - priv->dev = dev; - priv->card = card; - - /* Setup the OS Interface to our functions */ - dev->netdev_ops = &rda_netdev_ops; - dev->watchdog_timeo = msecs_to_jiffies(450); //450ms - - //dev->ethtool_ops = &lbs_ethtool_ops; -#ifdef WIRELESS_EXT - dev->wireless_handlers = (struct iw_handler_def *)&rda5890_wext_handler_def; -#endif - dev->flags |= IFF_BROADCAST | IFF_MULTICAST; - - goto done; - -err_init_adapter: - if(priv) - rda5890_free_adapter(priv); - if(dev) - free_netdev(dev); - priv = NULL; - -done: - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); - return priv; -} - -void rda5890_remove_card(struct rda5890_private *priv) -{ - struct net_device *dev = priv->dev; - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - dev = priv->dev; - - rda5890_free_adapter(priv); - - priv->dev = NULL; - if(dev) - free_netdev(dev); - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); -} - -int rda5890_start_card(struct rda5890_private *priv) -{ - struct net_device *dev = priv->dev; - int ret = 0; - unsigned char mac_addr[ETH_ALEN]; - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); - -#ifdef WIFI_TEST_MODE - if(!rda_5990_wifi_in_test_mode()) - { -#endif - -#ifdef USE_MAC_DYNAMIC_ONCE - if(rda5890_read_mac(mac_addr) != ETH_ALEN) - { - random_ether_addr(mac_addr); - rda5890_write_mac(mac_addr); - } - -#else - mac_addr[0] = 0x00; - mac_addr[1] = 0xc0; - mac_addr[2] = 0x52; - - mac_addr[3] = 0x00; - mac_addr[4] = 0xc0; - mac_addr[5] = 0x53; -#endif - ret = rda5890_set_mac_addr(priv, mac_addr); - if (ret) - { - goto done; - } - - ret = rda5890_get_mac_addr(priv, mac_addr); - if (ret) { - goto done; - } - memcpy(priv->dev->dev_addr, mac_addr, ETH_ALEN); - -#ifdef WIFI_TEST_MODE - } -#endif - - if (register_netdev(dev)) { - RDA5890_ERRP("register_netdev failed\n"); - goto done; - } - -#ifdef WIFI_TEST_MODE - if(!rda_5990_wifi_in_test_mode()) - { -#endif - - rda5890_set_preamble(priv, G_AUTO_PREAMBLE); - - rda5890_indicate_disconnected(priv); -#ifdef WIFI_TEST_MODE - } -#endif - - -done: - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - return ret; -} - -void rda5890_stop_card(struct rda5890_private *priv) -{ - struct net_device *dev = priv->dev; - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - rda5890_indicate_disconnected(priv); - unregister_netdev(dev); - - RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); -} - -void rda5890_shedule_timeout(int msecs) -{ - int timeout = 0, expires = 0; - expires = jiffies + msecs_to_jiffies(msecs); - timeout = msecs; - - while(timeout) - { - timeout = schedule_timeout(timeout); - - if(time_after(jiffies, expires)) - break; - } -} - -#ifdef WIFI_UNLOCK_SYSTEM - -void rda5990_wakeLock(void) -{ - if(atomic_read(&wake_lock_counter) == 0) - wake_lock(&sleep_worker_wake_lock); - atomic_inc(&wake_lock_counter); -} - -void rda5990_wakeUnlock(void) -{ - - if(atomic_read(&wake_lock_counter) == 1) - { - atomic_set(&wake_lock_counter, 0); - wake_unlock(&sleep_worker_wake_lock); - } - else if(atomic_read(&wake_lock_counter) > 0) - { - atomic_dec(&wake_lock_counter); - } - -} - -void rda5990_wakeLock_destroy(void) -{ - if(atomic_read(&wake_lock_counter) > 0) - { - atomic_set(&wake_lock_counter, 0); - wake_unlock(&sleep_worker_wake_lock); - } - - wake_lock_destroy(&sleep_worker_wake_lock); - -} - -#endif - diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_dev.h b/drivers/net/wireless/rda5990/rda_wlan/rda5890_dev.h deleted file mode 100755 index 1f3656733be8..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_dev.h +++ /dev/null @@ -1,272 +0,0 @@ -/** - * This file contains definitions and data structures specific - * to Marvell 802.11 NIC. It contains the Device Information - * structure struct lbs_private.. - */ -#ifndef _RDA5890_DEV_H_ -#define _RDA5890_DEV_H_ -#include -#include -#include -#include -#include -#include -#include "rda5890_defs.h" -//#include "hif_sdio.h" - - -#ifndef MAX_WPA_IE_LEN -#define MAX_WPA_IE_LEN 100 -#endif - -#ifndef MAX_RATES -#define MAX_RATES 14 -#endif - -#define DEV_NAME_LEN 32 - -#define RDA5890_MAX_NETWORK_NUM 32 - -/** RSSI related MACRO DEFINITIONS */ -#define RDA5890_NF_DEFAULT_SCAN_VALUE (-96) -#define PERFECT_RSSI ((u8)50) -#define WORST_RSSI ((u8)0) -#define RSSI_DIFF ((u8)(PERFECT_RSSI - WORST_RSSI)) - -/** RTS/FRAG related defines */ -#define RDA5890_RTS_MIN_VALUE 0 -#define RDA5890_RTS_MAX_VALUE 2347 -#define RDA5890_FRAG_MIN_VALUE 256 -#define RDA5890_FRAG_MAX_VALUE 2346 - -#define KEY_LEN_WPA_AES 16 -#define KEY_LEN_WPA_TKIP 32 -#define KEY_LEN_WEP_104 13 -#define KEY_LEN_WEP_40 5 - -#define BIT7 (1 << 7) -#define BIT6 (1 << 6) -#define BIT5 (1 << 5) -#define BIT4 (1 << 4) -#define BIT3 (1 << 3) -#define BIT2 (1 << 2) -#define BIT1 (1 << 1) -#define BIT0 (1 << 0) - -#define RDA_SLEEP_ENABLE BIT0 -#define RDA_SLEEP_PREASSO BIT1 - -//#define WIFI_UNIT_TEST - -/** KEY_TYPE_ID */ -enum KEY_TYPE_ID { - KEY_TYPE_ID_WEP = 0, - KEY_TYPE_ID_TKIP, - KEY_TYPE_ID_AES -}; - -enum PACKET_TYPE{ - WID_REQUEST_PACKET, - WID_REQUEST_POLLING_PACKET, - DATA_REQUEST_PACKET -}; - -/** KEY_INFO_WPA (applies to both TKIP and AES/CCMP) */ -enum KEY_INFO_WPA { - KEY_INFO_WPA_MCAST = 0x01, - KEY_INFO_WPA_UNICAST = 0x02, - KEY_INFO_WPA_ENABLED = 0x04 -}; - -/* RDA5890 defined bss descriptor, 44 bytes for each bss */ -struct rda5890_bss_descriptor { - u8 ssid[IW_ESSID_MAX_SIZE + 1]; - u8 bss_type; - u8 channel; - u8 dot11i_info; - u8 bssid[ETH_ALEN]; - u8 rssi; - u8 auth_info; - u8 rsn_cap[2]; -} __attribute__ ((packed)); - -/** - * @brief Structure used to store information for each beacon/probe response - */ -struct bss_descriptor { - struct rda5890_bss_descriptor data; - - u8 bssid[ETH_ALEN]; - - u8 ssid[IW_ESSID_MAX_SIZE + 1]; - u8 ssid_len; - - u16 capability; - u32 rssi; - u32 channel; - u16 beaconperiod; - - /* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */ - u8 mode; - - /* zero-terminated array of supported data rates */ - u8 rates[MAX_RATES + 1]; - u8 wpa_ie[MAX_WPA_IE_LEN]; - size_t wpa_ie_len; - u8 rsn_ie[MAX_WPA_IE_LEN]; - size_t rsn_ie_len; - - u8 wapi_ie[100]; - size_t wapi_ie_len; //wapi valid payload length - - unsigned long last_scanned; - - - struct list_head list; -}; - -/* Generic structure to hold all key types. */ -struct enc_key { - u16 len; - u16 flags; /* KEY_INFO_* from defs.h */ - u16 type; /* KEY_TYPE_* from defs.h */ - u8 key[32]; -}; - -struct rda5890_802_11_security { - u8 WPAenabled; - u8 WPA2enabled; - u8 wep_enabled; - u8 auth_mode; - u32 key_mgmt; - u32 cipther_type; -}; - -/** Private structure for the rda5890 device */ -struct rda5890_private { - char name[DEV_NAME_LEN]; - - void *card; - struct net_device *dev; - - struct net_device_stats stats; - - /** current ssid/bssid related parameters and status */ - int connect_status; - struct rda5890_bss_descriptor curbssparams; - struct iw_statistics wstats; - - /** association flags */ - unsigned char assoc_ssid[IW_ESSID_MAX_SIZE + 1]; - unsigned char assoc_bssid[6]; - unsigned char assoc_ssid_len; -#define ASSOC_FLAG_SSID 1 -#define ASSOC_FLAG_CHANNEL 2 -#define ASSOC_FLAG_BAND 3 -#define ASSOC_FLAG_MODE 4 -#define ASSOC_FLAG_BSSID 5 -#define ASSOC_FLAG_WEP_KEYS 6 -#define ASSOC_FLAG_WEP_TX_KEYIDX 7 -#define ASSOC_FLAG_WPA_MCAST_KEY 8 -#define ASSOC_FLAG_WPA_UCAST_KEY 9 -#define ASSOC_FLAG_SECINFO 10 -#define ASSOC_FLAG_WPA_IE 11 -#define ASSOC_FLAG_ASSOC_RETRY 12 -#define ASSOC_FLAG_ASSOC_START 13 -#define ASSOC_FLAG_WLAN_CONNECTING 14 - - unsigned long assoc_flags; - unsigned char imode; - unsigned char authtype; - - /** debugfs */ - struct dentry *debugfs_dir; - struct dentry *debugfs_files[6]; - - /** for wid request and response */ - struct mutex wid_lock; - struct completion wid_done; - int wid_pending; - char *wid_rsp; - unsigned short wid_rsp_len; - char wid_msg_id; - - /** delayed worker */ - struct workqueue_struct *work_thread; - struct delayed_work scan_work; - struct delayed_work assoc_work; - struct delayed_work assoc_done_work; - struct delayed_work wlan_connect_work; - - /** Hardware access */ - int (*hw_host_to_card) (struct rda5890_private *priv, u8 *payload, u16 nb, - unsigned char packet_type); - - /** Scan results list */ - int scan_running; - struct list_head network_list; - struct list_head network_free_list; - struct bss_descriptor *networks; - - /** Encryption parameter */ - struct rda5890_802_11_security secinfo; - - /** WEP keys */ - struct enc_key wep_keys[4]; - u16 wep_tx_keyidx; - - /** WPA keys */ - struct enc_key wpa_mcast_key; - struct enc_key wpa_unicast_key; - - /** WPA Information Elements*/ - u8 wpa_ie[MAX_WPA_IE_LEN]; - u8 wpa_ie_len; - - u8 is_wapi; - /** sleep/awake flag */ -#ifdef WIFI_POWER_MANAGER - atomic_t sleep_flag; -#endif - u8 first_init; - u16 version; -}; - -extern int rda5890_sleep_flags; - -#ifdef WIFI_TEST_MODE -extern unsigned char rda_5990_wifi_in_test_mode(void); -#endif - -#ifdef WIFI_UNLOCK_SYSTEM -extern atomic_t wake_lock_counter; -extern struct wake_lock sleep_worker_wake_lock; -extern void rda5990_wakeLock(void); -extern void rda5990_wakeUnlock(void); -extern void rda5990_wakeLock_destroy(void); -#endif - -struct rda5890_private *rda5890_add_card(void *card); -void rda5890_remove_card(struct rda5890_private *priv); -int rda5890_start_card(struct rda5890_private *priv); -void rda5890_stop_card(struct rda5890_private *priv); -int rda5890_sdio_core_wake_mode(struct rda5890_private *priv); -int rda5890_sdio_core_sleep_mode(struct rda5890_private *priv); -int rda5890_sdio_core_wake_mode_polling(struct rda5890_private *priv); - -void rda5890_sdio_set_notch_by_channel(struct rda5890_private *priv, unsigned int channel); -void rda5890_rssi_up_to_200(struct rda5890_private *priv); -void rda5990_assoc_power_save(struct rda5890_private *priv); -unsigned char is_sdio_init_complete(void); -unsigned char is_sdio_patch_complete(void); -int rda5890_sdio_init(struct rda5890_private *priv); -int rda5890_init_pm(struct rda5890_private *priv); -void rda5890_shedule_timeout(int msecs); -int rda5890_read_mac(char* buf); -int rda5890_write_mac(char * buf); -int rda5890_disable_block_bt(struct rda5890_private *priv); -int rda5890_disable_self_cts(struct rda5890_private *priv); -int rda5890_set_active_scan_time(struct rda5890_private *priv); -int rda5890_set_test_mode(struct rda5890_private *priv); -int rda5890_get_fw_version_polling(struct rda5890_private *priv, unsigned int* version); -#endif diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_if_sdio.c b/drivers/net/wireless/rda5990/rda_wlan/rda5890_if_sdio.c deleted file mode 100755 index 44c780412897..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_if_sdio.c +++ /dev/null @@ -1,795 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#include "rda5890_defs.h" -#include "rda5890_dev.h" -#include "rda5890_if_sdio.h" -#include "rda5890_wid.h" -#include "rda5890_debugfs.h" - -int rda5890_dbg_level = RDA5890_DL_CRIT; -int rda5890_dbg_area = RDA5890_DA_MAIN - | RDA5890_DA_SDIO - //| RDA5890_DA_ETHER - | RDA5890_DA_WID - | RDA5890_DA_WEXT - //| RDA5890_DA_TXRX - //| RDA5890_DA_PM - ; - -void export_msdc_clk_always_on(void) -{ - // todo... -} - -void export_msdc_clk_always_on_off(void) -{ - // todo... -} - -extern void rk29_sdio_irq_enable(int enable); -void export_wifi_eirq_enable(void) -{ - // todo... - //rk29_sdio_irq_enable(1); -} - -void export_wifi_eirq_disable(void) -{ - // todo... - //rk29_sdio_irq_enable(0); -} - -/* Module parameters */ -module_param_named(debug_level, rda5890_dbg_level, int, 0644); -module_param_named(debug_area, rda5890_dbg_area, int, 0644); -int sdio_test_flag = 0; -module_param_named(sdio_test, sdio_test_flag, int, 0644); - -#define SDIO_VENDOR_ID_RDA5890 0x5449 -#define SDIO_DEVICE_ID_RDA5890 0x0145 - -static const struct sdio_device_id if_sdio_ids[] = { - { SDIO_DEVICE(SDIO_VENDOR_ID_RDA5890, SDIO_DEVICE_ID_RDA5890) }, - { /* end: all zeroes */ }, -}; - -MODULE_DEVICE_TABLE(sdio, if_sdio_ids); - -struct if_sdio_packet { - struct if_sdio_packet *next; - unsigned char packet_type; - u16 nb; - u8 buffer[0] __attribute__((aligned(4))); -}; - -int if_sdio_card_to_host(struct if_sdio_card *card) -{ - int ret = 0; - struct rda5890_private *priv = card->priv; - u8 size_l = 0, size_h = 0; - u16 size, chunk; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); - - size_l = sdio_readb(card->func, IF_SDIO_AHB2SDIO_PKTLEN_L, &ret); - if (ret) { - RDA5890_ERRP("read PKTLEN_L reg fail\n"); - goto out; - } - else - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_NORM,"read PKTLEN_L reg size_l:%d \n", size_l); - - size_h = sdio_readb(card->func, IF_SDIO_AHB2SDIO_PKTLEN_H, &ret); - if (ret) { - RDA5890_ERRP("read PKTLEN_H reg fail\n"); - goto out; - } - else - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_NORM,"read PKTLEN_H reg size_h:%d\n",size_h); - - size = (size_l | ((size_h & 0x7f) << 8)) * 4; - if (size < 4) { - RDA5890_ERRP("invalid packet size (%d bytes) from firmware\n", size); - ret = -EINVAL; - goto out; - } - - /* alignment is handled on firmside */ - //chunk = sdio_align_size(card->func, size); - chunk = size; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_NORM, - "if_sdio_card_to_host, size = %d, aligned size = %d\n", size, chunk); - - /* TODO: handle multiple packets here */ - ret = sdio_readsb(card->func, card->buffer, IF_SDIO_FUN1_FIFO_RD, chunk); - if (ret) { - RDA5890_ERRP("sdio_readsb fail, ret = %d\n", ret); - goto out; - } - -#if 1 - if(priv->version == 7) - { - sdio_writeb(card->func, 0x20 ,IF_SDIO_FUN1_INT_PEND, &ret); - if(ret) { - RDA5890_ERRP("clear SDIO Tx Complete flag failed\n"); - goto out; - } - } -#endif - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_VERB, - "if_sdio_card_to_host, read done\n"); - - if (sdio_test_flag) { - rda5890_sdio_test_card_to_host(card->buffer, chunk); - goto out; - } - - /* TODO: this chunk size need to be handled here */ - rda5890_card_to_host(priv, card->buffer, chunk); - -out: - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "if_sdio_card_to_host >>>\n"); - return ret; -} - -#ifdef WIFI_POWER_MANAGER -void if_sdio_sleep_worker(struct work_struct *work) -{ - struct if_sdio_card *card = NULL; - int ret = 0; - struct rda5890_private *priv = NULL; - - card = container_of(work, struct if_sdio_card, - sleep_work.work); - - if(card) - priv = card->priv; - else - goto out; - - if(!priv) - goto out; - - RDA5890_DBGLAP(RDA5890_DA_PM, RDA5890_DL_CRIT, "Sleep\n"); - - /* clear IF_SDIO_FUN1_INT_PEND, this allow device to sleep */ - sdio_claim_host(card->func); - sdio_writeb(card->func, IF_SDIO_HOST_TX_FLAG ,IF_SDIO_FUN1_INT_PEND, &ret); - sdio_release_host(card->func); - if (ret) - { - RDA5890_ERRP("clear IF_SDIO_HOST_TX_FLAG failed\n"); - } - atomic_inc(&card->priv->sleep_flag); - -out: - - atomic_set(&card->sleep_work_is_active, 0); -#ifdef WIFI_UNLOCK_SYSTEM - rda5990_wakeUnlock(); -#endif - return; -} - -static int if_sdio_wakeup_card(struct if_sdio_card *card) -{ - struct rda5890_private *priv = card->priv; - int ret = 0; - -#ifdef WIFI_TEST_MODE - if(rda_5990_wifi_in_test_mode()) - return 0; -#endif - sdio_claim_host(card->func); - sdio_writeb(card->func, 1, IF_SDIO_FUN1_INT_TO_DEV, &ret); - sdio_release_host(card->func); - if (ret) { - RDA5890_ERRP("write FUN1_INT_TO_DEV reg fail\n"); - goto out; - } - atomic_set(&priv->sleep_flag, 0); - - RDA5890_DBGLAP(RDA5890_DA_PM, RDA5890_DL_CRIT, "wake up \n"); - // wait 15ms, hardware need 13ms to wakeup - rda5890_shedule_timeout(8); -out: - return ret; -} - -#endif //WIFI_POWER_MANAGER - -static void if_sdio_host_to_card_worker(struct work_struct *work) -{ - struct if_sdio_card *card = NULL; - struct rda5890_private *priv = NULL; - struct if_sdio_packet *packet = NULL; - int ret; - unsigned long flags; - u16 size; - u32 retries = 500; - u8 size_l, size_h, write_status = 0; -#define SDIO_HOST_WRITE_BATCH_SIZE 512 - u16 bytes_left, offset, batch; - - card = container_of(work, struct if_sdio_card, packet_worker); - priv = card->priv; - - -#ifdef WIFI_POWER_MANAGER - if(is_sdio_init_complete()) - { - if(atomic_read(&card->sleep_work_is_active)) - { - cancel_delayed_work(&card->sleep_work); -#ifdef WIFI_UNLOCK_SYSTEM - rda5990_wakeUnlock(); -#endif - atomic_set(&card->sleep_work_is_active, 0); - } - } -#endif - - while (1) - { - retries = 500; - - spin_lock_irqsave(&card->lock, flags); - packet = card->packets; - if (packet) - card->packets = packet->next; - spin_unlock_irqrestore(&card->lock, flags); - - if (!packet) - break; - -#ifdef WIFI_POWER_MANAGER - if (atomic_read(&priv->sleep_flag)) - { - /* Deivce maybe sleep, wakeup it. */ - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_NORM, "Wakeup\n"); - ret = if_sdio_wakeup_card(card); - if (ret) - { - RDA5890_ERRP("wakeup card fail\n"); - goto out; - } - } -#endif - while(retries && is_sdio_patch_complete()) //check write flow ctrl - { - sdio_claim_host(card->func); - write_status = sdio_readb(card->func, IF_SDIO_FUN1_INT_PEND, &ret); - sdio_release_host(card->func); - if(ret) - { - RDA5890_ERRP("read IF_SDIO_FUN1_INT_PEND failed\n"); - goto release; - } - if((write_status & IF_SDIO_INT_RXCMPL) == 0) - { - //RDA5890_ERRP("**** sdio is busy retry next time \n "); - retries --; - schedule(); - } - else - { - sdio_claim_host(card->func); - sdio_writeb(card->func, IF_SDIO_INT_RXCMPL, IF_SDIO_FUN1_INT_PEND, &ret); - sdio_release_host(card->func); - if(ret) - { - RDA5890_ERRP("write IF_SDIO_FUN1_INT_PEND failed\n"); - goto release; - } - break; - } - } - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "if_sdio_host_to_card_worker, send one packet, size = %d\n", packet->nb); - /* write length */ - size = packet->nb/4; - size_l = (u8)(size & 0xff); - size_h = (u8)((size >> 8) & 0x7f); - size_h |= 0x80; - - sdio_claim_host(card->func); - sdio_writeb(card->func, size_l, IF_SDIO_SDIO2AHB_PKTLEN_L, &ret); - sdio_release_host(card->func); - if (ret) { - RDA5890_ERRP("write PKTLEN_L reg fail\n"); - goto release; - } - sdio_claim_host(card->func); - sdio_writeb(card->func, size_h, IF_SDIO_SDIO2AHB_PKTLEN_H, &ret); - sdio_release_host(card->func); - if (ret) { - RDA5890_ERRP("write PKTLEN_H reg fail\n"); - goto release; - } - - /* write data */ - bytes_left = packet->nb; - offset = 0; - while(bytes_left) - { - batch = (bytes_left < SDIO_HOST_WRITE_BATCH_SIZE)? - bytes_left:SDIO_HOST_WRITE_BATCH_SIZE; - - sdio_claim_host(card->func); - ret = sdio_writesb(card->func, IF_SDIO_FUN1_FIFO_WR, - packet->buffer + offset, batch); - sdio_release_host(card->func); - if (ret) { - RDA5890_ERRP("sdio_writesb fail, ret = %d\n", ret); - goto release; - } - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "write batch %d, offset = %d\n", batch, offset); - - offset += batch; - bytes_left -= batch; - } - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "if_sdio_host_to_card_worker, send one packet done\n"); - -release: - - kfree(packet); - packet = NULL; - } - -out: - - if(is_sdio_init_complete()) //init complete should start sleep_work - { -#ifdef WIFI_UNLOCK_SYSTEM - rda5990_wakeLock(); -#endif - -#ifdef WIFI_POWER_MANAGER -#ifdef WIFI_TEST_MODE - if(rda_5990_wifi_in_test_mode()) - return; -#endif //end WIFI_TEST_MODE - atomic_set(&card->sleep_work_is_active, 1); - queue_delayed_work(priv->work_thread, &card->sleep_work, HZ/5); // 100ms -#endif //end WIFI_POWER_MANAGER - } -} - -/*******************************************************************/ -/* RDA5890 callbacks */ -/*******************************************************************/ - -static int if_sdio_host_to_card(struct rda5890_private *priv, - u8 *buf, u16 nb, unsigned char packet_type) -{ - int ret = 0; - struct if_sdio_card *card; - struct if_sdio_packet *packet, *cur; - u16 size; - unsigned long flags; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - card = priv->card; - - if (nb > (65536 - sizeof(struct if_sdio_packet))) { - ret = -EINVAL; - goto out; - } - - //size = sdio_align_size(card->func, nb); - size = nb; - if(size%4) - { - size += (4-size%4); - } - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_NORM, - "if_sdio_host_to_card, size = %d, aligned size = %d\n", nb, size); - - packet = kzalloc(sizeof(struct if_sdio_packet) + size, - GFP_ATOMIC); - if (!packet) { - ret = -ENOMEM; - goto out; - } - - packet->next = NULL; - packet->nb = size; - packet->packet_type = packet_type; - - memcpy(packet->buffer, buf, nb); - - spin_lock_irqsave(&card->lock, flags); - - if (!card->packets) - card->packets = packet; - else { - cur = card->packets; - while (cur->next) - cur = cur->next; - cur->next = packet; - } - - spin_unlock_irqrestore(&card->lock, flags); - - queue_work(card->work_thread, &card->packet_worker); - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); - - ret = 0; - -out: - return ret; -} - -static void if_sdio_interrupt(struct sdio_func *func) -{ - int ret = 0; - struct if_sdio_card *card; - struct rda5890_private *priv; - u8 status; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - card = sdio_get_drvdata(func); - if(!card) - return; - - priv = card->priv; - - status = sdio_readb(card->func, IF_SDIO_FUN1_INT_STAT, &ret); - if (ret) - goto out; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_VERB, - "if_sdio_interrupt, status = 0x%02x\n", status); - - if (status & IF_SDIO_INT_AHB2SDIO) - if_sdio_card_to_host(card); - - if (status & IF_SDIO_INT_ERROR) - { - sdio_writeb(card->func, IF_SDIO_INT_ERROR, IF_SDIO_FUN1_INT_PEND, &ret); - if (ret) - { - RDA5890_ERRP("write FUN1_INT_STAT reg fail\n"); - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "%s, INT_ERROR\n", __func__); - } - -out: - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s <<< ret=%d \n", __func__, ret); - return ret; -} - - -static int if_sdio_probe(struct sdio_func *func, - const struct sdio_device_id *id) -{ - struct if_sdio_card *card = NULL; - struct rda5890_private *priv = NULL; - struct if_sdio_packet *packet = NULL; - int ret = -1; - unsigned long flags; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - //SMC_MSG("[rda_debug] sunximmc_probe, set clk.\n"); - - //mmc_set_clock(mmc, 4000000); - - - if(id->vendor != 0x5449) - { - RDA5890_ERRP("rda5890 sdio not corrent vendor:%x \n", id->vendor); - goto out; - } - - card = kzalloc(sizeof(struct if_sdio_card), GFP_KERNEL); - if (!card) { - RDA5890_ERRP("kzalloc fail\n"); - return -ENOMEM; - } - - card->func = func; - spin_lock_init(&card->lock); - atomic_set(&card->wid_complete_flag, 0); - INIT_WORK(&card->packet_worker, if_sdio_host_to_card_worker); - card->work_thread = create_singlethread_workqueue("rda5890_if_sdio_worker"); - -#ifdef WIFI_POWER_MANAGER - atomic_set(&card->sleep_work_is_active, 0); - INIT_DELAYED_WORK(&card->sleep_work, if_sdio_sleep_worker); -#endif - -#ifdef WIFI_UNLOCK_SYSTEM - atomic_set(&wake_lock_counter, 0); - wake_lock_init(&sleep_worker_wake_lock, WAKE_LOCK_SUSPEND, "RDA_sleep_worker_wake_lock"); -#endif - - sdio_claim_host(func); - ret = sdio_enable_func(func); - if (ret) { - RDA5890_ERRP("sdio_enable_func fail, ret = %d\n", ret); - goto release; - } - - ret = sdio_claim_irq(func, if_sdio_interrupt); - if (ret) { - RDA5890_ERRP("sdio_claim_irq fail, ret = %d\n", ret); - goto disable; - } - - sdio_release_host(func); - sdio_set_drvdata(func, card); - - priv = rda5890_add_card(card); - if (!priv) { - RDA5890_ERRP("rda5890_add_card fail\n"); - ret = -ENOMEM; - goto release_int; - } - rda5890_debugfs_init_one(priv); - - card->priv = priv; - priv->card = card; - priv->hw_host_to_card = if_sdio_host_to_card; - - /* - * Enable interrupts now that everything is set up - */ - sdio_claim_host(func); - sdio_writeb(func, 0x7, IF_SDIO_FUN1_INT_MASK, &ret); - sdio_release_host(func); - if (ret) { - RDA5890_ERRP("enable func interrupt fail\n"); - goto remove_card; - } -#ifdef WIFI_TEST_MODE - if(!rda_5990_wifi_in_test_mode()) - { -#endif - ret = rda5890_sdio_init(priv); - if(ret < 0) - goto remove_card; - - ret=rda5890_disable_self_cts(priv); - if(ret < 0) - goto remove_card; - - ret=rda5890_disable_block_bt(priv); - if(ret < 0) - goto remove_card; - - ret = rda5890_set_scan_timeout(priv); - if (ret) { - RDA5890_ERRP("rda5890_set_scan_timeout fail, ret = %d\n", ret); - goto remove_card; - } - - ret= rda5890_set_listen_interval(priv, 0x06); - if(ret < 0) - goto remove_card; - - ret = rda5890_set_link_loss_threshold(priv, 0x06); - if(ret < 0) - goto remove_card; - - ret = rda5890_init_pm(priv); - if(ret < 0) - goto remove_card; - -#ifdef WIFI_TEST_MODE - } - else - { - ret = rda5890_set_test_mode(priv); - if(ret < 0) - goto remove_card; - } -#endif - - if (sdio_test_flag) { - unsigned char mac_addr[6]; - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_TRACE, - "SDIO TESTING MODE\n"); - - - ret = rda5890_get_mac_addr(priv, mac_addr); - printk(KERN_INFO "Test rda5890_get_mac_addr %x:%x:%x:%x:%x:%x", mac_addr[0],mac_addr[1],mac_addr[2],mac_addr[3],mac_addr[4],mac_addr[5]); - goto done; - } - - ret = rda5890_start_card(priv); - if (ret) { - RDA5890_ERRP("rda5890_start_card fail, ret = %d\n", ret); - goto remove_card; - } - -done: - printk(KERN_INFO "RDA5890: SDIO card started\n"); - -out: - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s ret:%d <<<\n", __func__, ret); - return ret; - -release_int: - sdio_claim_host(func); - sdio_release_irq(func); -disable: - sdio_disable_func(func); -release: - sdio_release_host(func); - -remove_card: - - if (atomic_read(&card->wid_complete_flag) && priv) - { - complete(&priv->wid_done); - printk(KERN_INFO "*****RDA5890: probe send wid complete\n"); - } - flush_work(&card->packet_worker); - cancel_work_sync(&card->packet_worker); - -#ifdef WIFI_POWER_MANAGER - cancel_delayed_work(&card->sleep_work); -#endif - destroy_workqueue(card->work_thread); - - if(priv) - rda5890_remove_card(priv); - - while (card->packets) { - packet = card->packets; - card->packets = card->packets->next; - kfree(packet); - } - - kfree(card); - goto out; -} - -static void if_sdio_remove(struct sdio_func *func) -{ - struct if_sdio_card *card; - struct if_sdio_packet *packet; - unsigned char count = 20; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - printk(KERN_INFO "RDA5890: SDIO card detached\n"); - - card = sdio_get_drvdata(func); - if(!card) - return; - while(card->priv->scan_running && count--) - { - rda5890_shedule_timeout(100); - printk("remove card wait scan complete \n"); - } - -#ifdef WIFI_POWER_MANAGER - cancel_delayed_work_sync(&card->sleep_work); -#endif - cancel_work_sync(&card->packet_worker); - - if (atomic_read(&card->wid_complete_flag) && card->priv) - { - complete(&card->priv->wid_done); - printk(KERN_INFO "*****RDA5890: send wid complete\n"); - } - - netif_stop_queue(card->priv->dev); - netif_carrier_off(card->priv->dev); - rda5890_stop_card(card->priv); - rda5890_debugfs_remove_one(card->priv); - destroy_workqueue(card->work_thread); - rda5890_remove_card(card->priv); - - while (card->packets) { - packet = card->packets; - card->packets = card->packets->next; - kfree(packet); - } - - kfree(card); - -#ifdef WIFI_UNLOCK_SYSTEM - rda5990_wakeLock_destroy(); -#endif - - printk(KERN_INFO "RDA5890: SDIO card removed\n"); - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); - return; -} - -static struct sdio_driver if_sdio_driver = { - .name = "rda5890_sdio", - .id_table = if_sdio_ids, - .probe = if_sdio_probe, - .remove = if_sdio_remove, -}; - -/*******************************************************************/ -/* Module functions */ -/*******************************************************************/ -extern void mmc_rescan_slot(int id); - -static int __init if_sdio_init_module(void) -{ - int ret = 0; - - printk(KERN_INFO "\nRDA5890 SDIO WIFI Driver for st_linux \n"); - printk(KERN_INFO "Ver: %d.%d.%d\n\n", - RDA5890_SDIOWIFI_VER_MAJ, - RDA5890_SDIOWIFI_VER_MIN, - RDA5890_SDIOWIFI_VER_BLD); - - printk("@@@@@@@@@@@@@@@22222 rda5990 start\n"); - - msleep(1000); - - printk("@@@@@@@@@@@@@@ mmc_rescan_slot\n"); - mmc_rescan_slot(0); - msleep(1000); - - rda5890_debugfs_init(); - ret = sdio_register_driver(&if_sdio_driver); - - if (ret) - { - printk(KERN_INFO "\nif_sdio_init_module: register fail. \n"); - //sunximmc_rescan_card(SDIOID,0); - } - - printk(KERN_INFO "\n if_sdio_init_module: register successful. \n"); - - return ret; -} - -extern void mmc_remove(int id); -static void __exit if_sdio_exit_module(void) -{ - printk(KERN_INFO "\n if_sdio_exit_module. \n"); - mmc_remove(0); - rda5890_debugfs_remove(); - sdio_unregister_driver(&if_sdio_driver); -} - - -module_init(if_sdio_init_module); -module_exit(if_sdio_exit_module); - -MODULE_DESCRIPTION("RDA5890 SDIO WLAN Driver"); -MODULE_AUTHOR("lwang"); -MODULE_LICENSE("GPL"); diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_if_sdio.h b/drivers/net/wireless/rda5990/rda_wlan/rda5890_if_sdio.h deleted file mode 100755 index 6c5a7583c4da..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_if_sdio.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef _RDA5890_IF_SDIO_H -#define _RDA5890_IF_SDIO_H - -#define IF_SDIO_SDIO2AHB_PKTLEN_L 0x00 -#define IF_SDIO_SDIO2AHB_PKTLEN_H 0x01 - -#define IF_SDIO_AHB2SDIO_PKTLEN_L 0x02 -#define IF_SDIO_AHB2SDIO_PKTLEN_H 0x03 - -#define IF_SDIO_FUN1_INT_MASK 0x04 -#define IF_SDIO_FUN1_INT_PEND 0x05 -#define IF_SDIO_FUN1_INT_STAT 0x06 - -#define IF_SDIO_INT_AHB2SDIO 0x01 -#define IF_SDIO_INT_ERROR 0x04 -#define IF_SDIO_INT_SLEEP 0x10 -#define IF_SDIO_INT_AWAKE 0x20 -#define IF_SDIO_INT_RXCMPL 0x40 -#define IF_SDIO_HOST_TX_FLAG 0x80 - -#define IF_SDIO_FUN1_FIFO_WR 0x07 -#define IF_SDIO_FUN1_FIFO_RD 0x08 - -#define IF_SDIO_FUN1_INT_TO_DEV 0x09 - -struct if_sdio_card { - struct sdio_func *func; - struct rda5890_private *priv; - - u8 buffer[2048]; - - spinlock_t lock; - struct if_sdio_packet *packets; - struct work_struct packet_worker; - - struct workqueue_struct *work_thread; - atomic_t wid_complete_flag; -#ifdef WIFI_POWER_MANAGER - atomic_t sleep_work_is_active; - struct delayed_work sleep_work; -#endif -}; - -void export_msdc_clk_always_on(void); -void export_msdc_clk_always_on_off(void); -void export_wifi_eirq_enable(void); -void export_wifi_eirq_disable(void); - -#endif diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_ioctl.h b/drivers/net/wireless/rda5990/rda_wlan/rda5890_ioctl.h deleted file mode 100755 index 0dc1d4e22799..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_ioctl.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _RDA5890_IOCTL_H_ -#define _RDA5890_IOCTL_H_ - -#include "linux/sockios.h" - -#define IOCTL_RDA5890_BASE SIOCDEVPRIVATE -#define IOCTL_RDA5890_GET_MAGIC IOCTL_RDA5890_BASE -#define IOCTL_RDA5890_GET_DRIVER_VER (IOCTL_RDA5890_BASE + 1) -#define IOCTL_RDA5890_MAC_GET_FW_VER (IOCTL_RDA5890_BASE + 2) -#define IOCTL_RDA5890_MAC_WID (IOCTL_RDA5890_BASE + 3) -#define IOCTL_RDA5890_SET_WAPI_ASSOC_IE (IOCTL_RDA5890_BASE + 4) -#define IOCTL_RDA5890_GET_WAPI_ASSOC_IE (IOCTL_RDA5890_BASE + 5) - -#define RDA5890_MAGIC 0x5890face - -#endif /* _RDA5890_IOCTL_H_ */ - diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_nvram.c b/drivers/net/wireless/rda5990/rda_wlan/rda5890_nvram.c deleted file mode 100755 index fb93a2e74b75..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_nvram.c +++ /dev/null @@ -1,108 +0,0 @@ -#include -#include - -#define WIFI_NVRAM_FILE_NAME "/data/nvram/APCFG/APRDEB/RDAWIFI" - -static int nvram_read(char *filename, char *buf, ssize_t len, int offset) -{ - struct file *fd; - //ssize_t ret; - int retLen = -1; - - mm_segment_t old_fs = get_fs(); - set_fs(KERNEL_DS); - - fd = filp_open(filename, O_WRONLY|O_CREAT, 0644); - - if(IS_ERR(fd)) { - printk("[rda5890][nvram_read] : failed to open!!\n"); - return -1; - } - do{ - if ((fd->f_op == NULL) || (fd->f_op->read == NULL)) - { - printk("[rda5890][nvram_read] : file can not be read!!\n"); - break; - } - - if (fd->f_pos != offset) { - if (fd->f_op->llseek) { - if(fd->f_op->llseek(fd, offset, 0) != offset) { - printk("[rda5890][nvram_read] : failed to seek!!\n"); - break; - } - } else { - fd->f_pos = offset; - } - } - - retLen = fd->f_op->read(fd, - buf, - len, - &fd->f_pos); - - }while(false); - - filp_close(fd, NULL); - - set_fs(old_fs); - - return retLen; -} - -static int nvram_write(char *filename, char *buf, ssize_t len, int offset) -{ - struct file *fd; - int retLen = -1; - - mm_segment_t old_fs = get_fs(); - set_fs(KERNEL_DS); - - fd = filp_open(filename, O_WRONLY|O_CREAT, 0644); - - if(IS_ERR(fd)) { - printk("[rda5890][nvram_write] : failed to open!!\n"); - return -1; - } - do{ - if ((fd->f_op == NULL) || (fd->f_op->write == NULL)) - { - printk("[rda5890][nvram_write] : file can not be write!!\n"); - break; - } /* End of if */ - - if (fd->f_pos != offset) { - if (fd->f_op->llseek) { - if(fd->f_op->llseek(fd, offset, 0) != offset) { - printk("[rda5890][nvram_write] : failed to seek!!\n"); - break; - } - } else { - fd->f_pos = offset; - } - } - - retLen = fd->f_op->write(fd, - buf, - len, - &fd->f_pos); - - }while(false); - - filp_close(fd, NULL); - - set_fs(old_fs); - - return retLen; -} - -int rda5890_read_mac(char* buf) -{ - return nvram_read(WIFI_NVRAM_FILE_NAME, buf, 6, 0); -} - -int rda5890_write_mac(char * buf) -{ - return nvram_write(WIFI_NVRAM_FILE_NAME, buf, 6, 0); -} - diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_scan.c b/drivers/net/wireless/rda5990/rda_wlan/rda5890_scan.c deleted file mode 100755 index 207595cf5a96..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_scan.c +++ /dev/null @@ -1,369 +0,0 @@ -#include -#include -#include -#include -#include - - -#include "rda5890_dev.h" -#include "rda5890_defs.h" - -//#define SCAN_RESULT_DEBUG - -//added by xiongzhi for wapi -#ifndef FCS_LEN -#define FCS_LEN 4 -#endif - -/* Element ID of various Information Elements */ -typedef enum {ISSID = 0, /* Service Set Identifier */ - ISUPRATES = 1, /* Supported Rates */ - IFHPARMS = 2, /* FH parameter set */ - IDSPARMS = 3, /* DS parameter set */ - ICFPARMS = 4, /* CF parameter set */ - ITIM = 5, /* Traffic Information Map */ - IIBPARMS = 6, /* IBSS parameter set */ - ICTEXT = 16, /* Challenge Text */ - IERPINFO = 42, /* ERP Information */ - IEXSUPRATES = 50, /* Extended Supported Rates */ - IWAPI =68 -} ELEMENTID_T; - -/* Capability Information field bit assignments */ -typedef enum {ESS = 0x01, /* ESS capability */ - IBSS = 0x02, /* IBSS mode */ - POLLABLE = 0x04, /* CF Pollable */ - POLLREQ = 0x08, /* Request to be polled */ - PRIVACY = 0x10, /* WEP encryption supported */ - SHORTPREAMBLE = 0x20, /* Short Preamble is supported */ - SHORTSLOT = 0x400, /* Short Slot is supported */ - PBCC = 0x40, /* PBCC */ - CHANNELAGILITY = 0x80, /* Channel Agility */ - SPECTRUM_MGMT = 0x100, /* Spectrum Management */ - DSSS_OFDM = 0x2000 /* DSSS-OFDM */ -} CAPABILITY_T; - -/* BSS type */ -typedef enum {INFRASTRUCTURE = 1, - INDEPENDENT = 2, - ANY_BSS = 3 -} BSSTYPE_T; - -unsigned char* get_ie_elem(unsigned char* msa, ELEMENTID_T elm_id, - unsigned short rx_len,unsigned short tag_param_offset) -{ - unsigned short index = 0; - - /*************************************************************************/ - /* Beacon Frame - Frame Body */ - /* --------------------------------------------------------------------- */ - /* |Timestamp |BeaconInt |CapInfo |SSID |SupRates |DSParSet |TIM elm | */ - /* --------------------------------------------------------------------- */ - /* |8 |2 |2 |2-34 |3-10 |3 |4-256 | */ - /* --------------------------------------------------------------------- */ - /* */ - /*************************************************************************/ - - index = tag_param_offset; - - /* Search for the TIM Element Field and return if the element is found */ - while(index < (rx_len - FCS_LEN)) - { - if(msa[index] == elm_id) - { - return(&msa[index]); - } - else - { - index += (2 + msa[index + 1]); - } - } - - return(0); -} - -/* This function extracts the 'from ds' bit from the MAC header of the input */ -/* frame. */ -/* Returns the value in the LSB of the returned value. */ -unsigned char get_from_ds(unsigned char* header) -{ - return ((header[1] & 0x02) >> 1); -} - -/* This function extracts the 'to ds' bit from the MAC header of the input */ -/* frame. */ -/* Returns the value in the LSB of the returned value. */ -unsigned char get_to_ds(unsigned char* header) -{ - return (header[1] & 0x01); -} - -/* This function extracts the MAC Address in 'address1' field of the MAC */ -/* header and updates the MAC Address in the allocated 'addr' variable. */ -void get_address1(unsigned char* msa, unsigned char* addr) -{ - memcpy(addr, msa + 4, 6); -} - -/* This function extracts the MAC Address in 'address2' field of the MAC */ -/* header and updates the MAC Address in the allocated 'addr' variable. */ -void get_address2(unsigned char* msa, unsigned char* addr) -{ - memcpy(addr, msa + 10, 6); -} - -/* This function extracts the MAC Address in 'address3' field of the MAC */ -/* header and updates the MAC Address in the allocated 'addr' variable. */ -void get_address3(unsigned char* msa, unsigned char* addr) -{ - memcpy(addr, msa + 16, 6); -} - -/* This function extracts the BSSID from the incoming WLAN packet based on */ -/* the 'from ds' bit, and updates the MAC Address in the allocated 'addr' */ -/* variable. */ -void get_BSSID(unsigned char* data, unsigned char* bssid) -{ - if(get_from_ds(data) == 1) - get_address2(data, bssid); - else if(get_to_ds(data) == 1) - get_address1(data, bssid); - else - get_address3(data, bssid); -} - -extern int is_same_network(struct bss_descriptor *src, - struct bss_descriptor *dst); -extern void clear_bss_descriptor(struct bss_descriptor *bss); -void rda5890_network_information(struct rda5890_private *priv, - char *info, unsigned short info_len) -{ - union iwreq_data wrqu; - struct bss_descriptor *iter_bss; - struct bss_descriptor *safe; - struct bss_descriptor bss_desc; - struct bss_descriptor * bss = &bss_desc; - - unsigned char *pos, *end, *p; - unsigned char n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0; - struct ieee_ie_country_info_set *pcountryinfo; - int ret; - unsigned char* msa = &info[9]; - unsigned short msa_len = info[6] | (info[7] << 8); - - if(!priv->scan_running) - goto done; - - if((msa_len - 1 + 9 ) != info_len) - { - RDA5890_ERRP("rda5890_network_information verify lengh feild failed \n"); - } - - memset(bss, 0, sizeof (struct bss_descriptor)); - bss->rssi = info[8]; - msa_len -= 1; // has rssi - - get_BSSID(msa, bss->bssid); - - end = msa + msa_len; - - //mac head - pos = msa + 24; - //time stamp - pos += 8; - //beacon - bss->beaconperiod = *(pos) | (*(pos + 1) << 8); - pos += 2 ; - //capability - bss->capability = *(pos) | (*(pos + 1) << 8); - pos += 2; - - if (bss->capability & WLAN_CAPABILITY_IBSS) - bss->mode = IW_MODE_ADHOC; - else - bss->mode = IW_MODE_INFRA; - - /* process variable IE */ - while (pos + 2 <= end) { - if (pos + pos[1] > end) { -#ifdef SCAN_RESULT_DEBUG - RDA5890_DBGP("process_bss: error in processing IE, " - "bytes left < IE length\n"); -#endif - break; - } - - switch (pos[0]) { - case WLAN_EID_SSID: - bss->ssid_len = min_t(int, IEEE80211_MAX_SSID_LEN, pos[1]); - memcpy(bss->ssid, pos + 2, bss->ssid_len); -#ifdef SCAN_RESULT_DEBUG - RDA5890_DBGP("got SSID IE: '%s', len %u %d\n", - bss->ssid, - bss->ssid_len, pos[1]); -#endif - break; - - case WLAN_EID_SUPP_RATES: - n_basic_rates = min_t(uint8_t, MAX_RATES, pos[1]); - memcpy(bss->rates, pos + 2, n_basic_rates); - got_basic_rates = 1; -#ifdef SCAN_RESULT_DEBUG - RDA5890_DBGP("got RATES IE\n"); -#endif - break; - - case WLAN_EID_FH_PARAMS: -#ifdef SCAN_RESULT_DEBUG - RDA5890_DBGP("got FH IE\n"); -#endif - break; - - case WLAN_EID_DS_PARAMS: -#ifdef SCAN_RESULT_DEBUG - RDA5890_DBGP("got DS IE\n"); -#endif - break; - - case WLAN_EID_CF_PARAMS: -#ifdef SCAN_RESULT_DEBUG - RDA5890_DBGP("got CF IE\n"); -#endif - break; - - case WLAN_EID_IBSS_PARAMS: -#ifdef SCAN_RESULT_DEBUG - RDA5890_DBGP("got IBSS IE\n"); -#endif - break; - - case WLAN_EID_COUNTRY: - pcountryinfo = (struct ieee_ie_country_info_set *) pos; -#ifdef SCAN_RESULT_DEBUG - RDA5890_DBGP("got COUNTRY IE\n"); -#endif - break; - - case WLAN_EID_EXT_SUPP_RATES: - /* only process extended supported rate if data rate is - * already found. Data rate IE should come before - * extended supported rate IE - */ -#ifdef SCAN_RESULT_DEBUG - RDA5890_DBGP("got RATESEX IE\n"); -#endif - if (!got_basic_rates) { -#ifdef SCAN_RESULT_DEBUG - RDA5890_DBGP("... but ignoring it\n"); -#endif - break; - } - - n_ex_rates = pos[1]; - if (n_basic_rates + n_ex_rates > MAX_RATES) - n_ex_rates = MAX_RATES - n_basic_rates; - - p = bss->rates + n_basic_rates; - memcpy(p, pos + 2, n_ex_rates); - break; - - case WLAN_EID_GENERIC: - if (pos[1] >= 4 && - pos[2] == 0x00 && pos[3] == 0x50 && - pos[4] == 0xf2 && pos[5] == 0x01) { - bss->wpa_ie_len = min(pos[1] + 2, MAX_WPA_IE_LEN); - memcpy(bss->wpa_ie, pos, bss->wpa_ie_len); -#ifdef SCAN_RESULT_DEBUG - RDA5890_DBGP("got WPA IE \n"); -#endif - } - else { -#ifdef SCAN_RESULT_DEBUG - RDA5890_DBGP("got generic IE: %02x:%02x:%02x:%02x, len %d\n", - pos[2], pos[3], - pos[4], pos[5], - pos[1]); -#endif - } - break; - - case WLAN_EID_RSN: -#ifdef SCAN_RESULT_DEBUG - RDA5890_DBGP("got RSN IE\n"); -#endif - bss->rsn_ie_len = min(pos[1] + 2, MAX_WPA_IE_LEN); - memcpy(bss->rsn_ie, pos, bss->rsn_ie_len); - break; - - case IWAPI: -#ifdef SCAN_RESULT_DEBUG - RDA5890_DBGP("got WAPI IE\n"); -#endif - bss->wapi_ie_len = min(pos[1] + 2, 100); - memcpy(bss->wapi_ie, pos, bss->wapi_ie_len); - break; - - default: - break; - } - - pos += pos[1] + 2; - } - - bss->last_scanned = jiffies; - - /* add scaned bss into list */ - if (1) { - struct bss_descriptor *found = NULL; - struct bss_descriptor *oldest = NULL; - - /* Try to find this bss in the scan table */ - list_for_each_entry (iter_bss, &priv->network_list, list) { - if (is_same_network(iter_bss, bss)) { - found = iter_bss; - break; - } - - if ((oldest == NULL) || - (iter_bss->last_scanned < oldest->last_scanned)) - oldest = iter_bss; - } - - if (found) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "FOUND SAME %s, update\n", found->ssid); - /* found, clear it */ - clear_bss_descriptor(found); - } else if (!list_empty(&priv->network_free_list)) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "FOUND NEW %s, add\n", bss->ssid); - /* Pull one from the free list */ - found = list_entry(priv->network_free_list.next, - struct bss_descriptor, list); - list_move_tail(&found->list, &priv->network_list); - } else if (oldest) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "FOUND NEW %s, no space, replace oldest %s\n", - bss->ssid, oldest->ssid); - /* If there are no more slots, expire the oldest */ - found = oldest; - clear_bss_descriptor(found); - list_move_tail(&found->list, &priv->network_list); - } else { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "FOUND NEW but no space to store\n"); - } - - /* Copy the locally created newbssentry to the scan table */ - memcpy(found, bss, offsetof(struct bss_descriptor, list)); - } - -done: -#ifdef SCAN_RESULT_DEBUG - RDA5890_DBGP("rda5890_network_information ret %d \n", ret); -#endif - return; -} - - - diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_sdio_patch.c b/drivers/net/wireless/rda5990/rda_wlan/rda5890_sdio_patch.c deleted file mode 100755 index f72d44fc69c7..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_sdio_patch.c +++ /dev/null @@ -1,1406 +0,0 @@ -#include "rda5890_dev.h" -#include "rda5890_wid.h" -#include "rda5890_defs.h" - -#ifdef WIFI_TEST_MODE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -static u8 sdio_patch_complete = 0; -static u8 sdio_init_complete = 0; - -//#define dig_access_pmu_cancel -const u32 wifi_core_patch_data_32[][2] = -{ - {0x00108000, 0xEA03DF9C}, - {0x00108004, 0xE59F101C}, - {0x00108008, 0xE3A00040}, - {0x0010800C, 0xE5C10038}, - {0x00108010, 0xE1A0F00E}, - {0x00108014, 0xEA03DF95}, - {0x00108018, 0xE59F1008}, - {0x0010801C, 0xE3A00040}, - {0x00108020, 0xE5C10038}, - {0x00108024, 0xE1A0F00E}, - {0x00108028, 0x50300000}, - {0x0010802C, 0xEB03D6F2}, - {0x00108030, 0xE1A00B84}, - {0x00108034, 0xE1B00BA0}, - {0x00108038, 0x11A00B84}, - {0x0010803C, 0x11A00BA0}, - {0x00108040, 0x12600F80}, - {0x00108044, 0x10804004}, - {0x00108048, 0xE1A00124}, - {0x0010804C, 0xE92D0011}, - {0x00108050, 0xE51F4030}, - {0x00108054, 0xE3A00020}, - {0x00108058, 0xE5C40038}, - {0x0010805C, 0xE8BD0011}, - {0x00108060, 0xE1A0F00E}, - {0x00108064, 0xEA03D3D2}, - {0x00108068, 0xE3A00001}, - {0x0010806C, 0xE1A0F00E}, - {0x00108070, 0xEA03D6CD}, - {0x00108074, 0xE3A00001}, - {0x00108078, 0xE1A0F00E}, - {0x0010807C, 0xEB03C786}, - {0x00108080, 0xE51F0060}, - {0x00108084, 0xE5D00038}, - {0x00108088, 0xE3100080}, - {0x0010808C, 0x1A000001}, - {0x00108090, 0xE3A00001}, - {0x00108094, 0xE1A0F00E}, - {0x00108098, 0xE3A00000}, - {0x0010809C, 0xE1A0F00E}, - {0x001080A0, 0xEB03EADE}, - {0x001080A4, 0xE51F0084}, - {0x001080A8, 0xE5D00038}, - {0x001080AC, 0xE3100080}, - {0x001080B0, 0x1A000001}, - {0x001080B4, 0xE3A00001}, - {0x001080B8, 0xE1A0F00E}, - {0x001080BC, 0xE3A00000}, - {0x001080C0, 0xE1A0F00E}, - {0x001080C4, 0xEB03D89D}, - {0x001080C8, 0xE51F00A8}, - {0x001080CC, 0xE3A01080}, - {0x001080D0, 0xE5C01038}, - {0x001080D4, 0xE1A0F00E}, - {0x001080D8, 0xEB03D714}, - {0x001080DC, 0xE51F10BC}, - {0x001080E0, 0xE5D10038}, - {0x001080E4, 0xE3100080}, - {0x001080E8, 0x159F001C}, - {0x001080EC, 0x059F0014}, - {0x001080F0, 0xE59F100C}, - {0x001080F4, 0xE581003C}, - {0x001080F8, 0xE51F10D8}, - {0x001080FC, 0xE1D101B4}, - {0x00108100, 0xE1A0F00E}, - {0x00108104, 0x30010000}, - {0x00108108, 0x2E00A100}, - {0x0010810C, 0x2E00A000}, - {0x00108110, 0xEB03B485}, - {0x00108114, 0x13100010}, - {0x00108118, 0x13A00002}, - {0x0010811C, 0x15C50067}, - {0x00108120, 0xE1A0F00E}, - {0x00108124, 0xEA03D804}, - {0x00108128, 0xE51F1108}, - {0x0010812C, 0xE5D10038}, - {0x00108130, 0xE2000020}, - {0x00108134, 0xE3500000}, - {0x00108138, 0x1AFFFFFB}, - {0x0010813C, 0xE3A01004}, - {0x00108140, 0xE3A00B48}, - {0x00108144, 0xE280FF45}, - {0x00108148, 0xEA0402C5}, - {0x0010814C, 0xE59F600C}, - {0x00108150, 0xE3A04000}, - {0x00108154, 0xE5C64000}, - {0x00108158, 0xE59F6004}, - {0x0010815C, 0xE59FF004}, - {0x00108160, 0x0010200B}, - {0x00108164, 0x0010121D}, - {0x00108168, 0x00007634}, - {0x0010816C, 0xEAFFFFEC}, - {0x00108170, 0xEA03E0FF}, - {0x00108174, 0x13A00000}, - {0x00108178, 0x1B000001}, - {0x0010817C, 0x15C57005}, - {0x00108180, 0xE59FF004}, - {0x00108184, 0xE51FF004}, - {0x00108188, 0x000024DC}, - {0x0010818C, 0x0000FD74}, - {0x001087B0, 0xEA0403A4}, - {0x001087B4, 0x08BD4010}, - {0x001087B8, 0x0A000002}, - {0x001087BC, 0x13A00001}, - {0x001087C0, 0x18BD4010}, - {0x001087C4, 0x1A000001}, - {0x001087C8, 0xE51FF004}, - {0x001087CC, 0x0000D470}, - {0x001087D0, 0xE51FF004}, - {0x001087D4, 0x0000D2C0}, - {0x20040004, 0x0001018C}, - {0x20040024, 0x00108000}, - {0x20040008, 0x000101BC}, - {0x20040028, 0x00108014}, - {0x2004000C, 0x00012460}, - {0x2004002C, 0x0010802C}, - {0x20040010, 0x00013118}, - {0x20040030, 0x00108064}, - {0x20040014, 0x00012538}, - {0x20040034, 0x00108070}, - {0x20040018, 0x00016260}, - {0x20040038, 0x0010807C}, - {0x2004001C, 0x0000D524}, - {0x2004003C, 0x001080A0}, - {0x20040020, 0x00011E4C}, - {0x20040040, 0x001080C4}, - {0x20040100, 0x00012484}, - {0x20040120, 0x001080D8}, - {0x20040104, 0x0001AEF8}, - {0x20040124, 0x00108110}, - {0x20040108, 0x00012110}, - {0x20040128, 0x00108124}, - {0x2004010C, 0x00007630}, - {0x2004012C, 0x00108148}, - {0x20040110, 0x00017158}, - {0x20040130, 0x0010816C}, - {0x20040114, 0x0000FD70}, - {0x20040134, 0x00108170}, - {0x20040118, 0x0000791C}, - {0x20040138, 0x001087B0}, - {0x20040000, 0x00007FFF}, - -}; - -const u32 wifi_core_patch_data_32_E[][2] = -{ - {0x00108000, 0xEA04012F}, - {0x00108004, 0x1A000001}, - {0x00108008, 0xE8BD4010}, - {0x0010800C, 0xEA000001}, - {0x00108010, 0xE51FF004}, - {0x00108014, 0x0000D4AC}, - {0x00108018, 0xE51FF004}, - {0x0010801C, 0x0000D654}, - {0x00108020, 0xEA0401F4}, - {0x00108024, 0xE59F600C}, - {0x00108028, 0xE3A04000}, - {0x0010802C, 0xE5C64000}, - {0x00108030, 0xE59F6004}, - {0x00108034, 0xE59FF004}, - {0x00108038, 0x00101CE7}, - {0x0010803C, 0x00101039}, - {0x00108040, 0x00007850}, - {0x00108044, 0xEAFFFFEC}, - {0x00108048, 0xEA03E034}, - {0x0010804C, 0x13A00000}, - {0x00108050, 0x1B000001}, - {0x00108054, 0x15C57005}, - {0x00108058, 0xE59FF004}, - {0x0010805C, 0xE51FF004}, - {0x00108060, 0x000024E0}, - {0x00108064, 0x0000FF78}, - {0x20040004, 0x00007B40}, - {0x20040024, 0x00108000}, - {0x20040008, 0x0000784C}, - {0x20040028, 0x00108020}, - {0x2004000C, 0x00017518}, - {0x2004002C, 0x00108044}, - {0x20040010, 0x0000FF74}, - {0x20040030, 0x00108048}, - {0x20040000, 0x0000000D}, - -}; - -const u8 wifi_core_patch_data_8[][2] = -{ - { 0x28, 0x1a} , - { 0x29, 0x0d}, - { 0x35, 0x1e}, - { 0x4c, 0x90}, - { 0x4d, 0x38}, - { 0x39, 0x07}, - { 0xe4, 0xf5}, - { 0x21, 0x00}, //default 0 - { 0x23, 0x10}, - { 0x48, 0x0e}, - { 0x25, 0x00}, - { 0x20, 0xa8}, - { 0x3f, 0x05}, - { 0x41, 0x37}, - { 0x42, 0x40}, - { 0x5b, 0xa9}, -}; - -//#define WF_PAT_CFG_2012_04_15 - - -/*if define FORCE_WF, wf is not allow of any activity, antenna switch is also forced to bt*/ -//#define FORCE_WF - -/*if define FORCE_WF_TX ,wf is not allow to do tx and pa is also disabled, but antenna is not forced*/ -//#define FORCE_WF_TX - -/*if define FORCE_WF_RX ,wf is not allow to do rx but antenna is not forced*/ -//#define FORCE_WF_RX - - -/*if define FORCE_WF_RX_TX wf is not allow to do any tx and rx , pa disabled , but antenna is not forced*/ -//#define FORCE_WF_RX_TX - -#define WF_PAT_CFG_2012_05_19 - -const u32 wifi_core_init_data_32[][2] = -{ -#ifdef FORCE_WF_RX_TX - {0x50000800,0xFC003E05}, - {0x50000804,0x00000000}, - {0x50000808,0xA5000013}, //no pre_active protect - {0x5000080c,0x000001C0}, - {0x50000810,0xFFCC0F01}, - {0x50000814,0x00000000}, // not grant to rx and tx - {0x50000818,0x00FF0001}, - {0x5000081C,0xFF000F00}, - {0x50000820,0x00000000}, - {0x50000824,0x0000F0FE}, - {0x50000828,0x00100F10}, - {0x50000838,0xFFFFFFFF}, - {0x5000083C,0xFFFFFFFF}, -#endif - - - -#ifdef FORCE_WF_RX - {0x50000800,0xFC003E05}, - {0x50000804,0x00000000}, - {0x50000808,0xA5000013}, //no pre_active protect - {0x5000080c,0x000001C0}, - {0x50000810,0xFFCC0F01}, - {0x50000814,0xFF000F00}, //wf not grant to rx - {0x50000818,0x00FF0001}, - {0x5000081C,0xFF000F00}, - {0x50000820,0xFF000F00}, - {0x50000824,0x0000F0FE}, - {0x50000828,0x00100F10}, - {0x50000838,0xFFFFFFFF}, - {0x5000083C,0xFFFFFFFF}, -#endif - - -#ifdef FORCE_WF_TX - {0x50000800,0xFC003E05}, - {0x50000804,0x00000000}, - {0x50000808,0xA5000013}, //no pre_active protect - {0x5000080c,0x000001C0}, - {0x50000810,0xFFCC0F01}, - {0x50000814,0x00FF0033}, //wf not grant to tx - {0x50000818,0x00FF0001}, - {0x5000081C,0xFF000F00}, - {0x50000820,0x00000000}, - {0x50000824,0x0000F0FE}, - {0x50000828,0x00100F10}, - {0x50000838,0xFFFFFFFF}, - {0x5000083C,0xFFFFFFFF}, -#endif - - -#ifdef WF_PAT_CFG_2012_05_19 - {0x50000800,0xFC003E05}, - {0x50000804,0x00000000}, - {0x50000808,0xA5000013}, //no pre_active protect - {0x5000080c,0x000001C0}, - {0x50000810,0xFFCC0F01}, - {0x50000814,0xFFFF0F03}, //0xFFFF0F33 - {0x50000818,0x00FF0001}, - {0x5000081C,0xFF000F00}, - {0x50000820,0xFF000F00}, - {0x50000824,0x0000F0FE}, - {0x50000828,0x00100F10}, - {0x50000838,0xFFFFFFFF}, - {0x5000083C,0xFFFFFFFF}, -#endif - - -#ifdef FORCE_WF - {0x50000800,0xFC003E05}, - {0x50000804,0x00000000}, - {0x50000838,0xF8003f2A}, - {0x5000083c,0x00000003}, - {0x50000808,0xfe00001b}, - {0x50000810,0x00000000}, - {0x50000814,0x00000000}, - {0x50000818,0x00000000}, - {0x5000081C,0x00000000}, - {0x50000820,0x00000000}, - {0x50000824,0xffffffff}, - {0x50000828,0x00100F10}, -#endif - -#ifdef WF_PAT_CFG_2012_04_15 /*pta config*/ - {0x50000800,0xFC003E05}, //tx_pri hi bits ctrl&mgmt package - {0x50000804,0x00000000}, //tx_pri hi bits as hi pri - {0x50000808,0xA500001B}, //sig_mode and protect time - {0x5000080c,0x000001C0}, //sigWire mode - {0x50000810,0xFFCC0F01}, //Lut bt - {0x50000814,0xFFFF0F33}, //Lut wf - {0x50000818,0x00FF0001}, //antSel0 for wl_rx - {0x5000081C,0xFF000F00}, //antSel1 for wl_tx - {0x50000820,0xFF000F00}, //antSel2 for wl_pa - //{0x50000838,0xFFFFFFFF}, //rx_pri low bits as high pri - //{0x5000083C,0xFFFFFFFF}, //rx_pri high bits as high pri -#endif - -/*end pta config*/ - { 0x00106b6c, 0x00000002 }, // scan channel 13 - { 0x30010004, 0x0000f77c }, //intn config - { 0x30010010, 0x00007dff }, //intn config - //item111:ver_b_wf_dig_2011_10_09 - { 0x30010000, 0x780369AF }, //disable tports wait 100ms; - { 0x30000010, 0x7000FFFF },//wait 500ms; - { 0x50090054, 0x00000001 },//enable update - { 0x50090200, 0x00000000 }, - { 0x50090204, 0x00000000 }, - { 0x50090208, 0x00000002 }, - { 0x5009020c, 0x00000004 }, - { 0x50090210, 0x00000006 }, - { 0x50090214, 0x00000008 }, - { 0x50090218, 0x0000000a }, - { 0x5009021c, 0x00000040 }, - { 0x50090220, 0x00000042 }, - { 0x50090224, 0x00000044 }, - { 0x50090228, 0x00000046 }, - { 0x5009022c, 0x00000048 }, - { 0x50090230, 0x0000004a }, - { 0x50090234, 0x00000080 }, - { 0x50090238, 0x00000082 }, - { 0x5009023c, 0x00000084 }, - { 0x50090240, 0x00000086 }, - { 0x50090244, 0x00000088 }, - { 0x50090248, 0x0000008a }, - { 0x5009024c, 0x000000c0 }, - { 0x50090250, 0x000000c2 }, - { 0x50090254, 0x000000c4 }, - { 0x50090258, 0x000000c6 }, - { 0x5009025c, 0x000000c8 }, - { 0x5009025c, 0x000000c8 }, - { 0x50090260, 0x000000ca }, - { 0x50090264, 0x00000100 }, - { 0x50090268, 0x00000102 }, - { 0x5009026c, 0x00000104 }, - { 0x50090270, 0x00000106 }, - { 0x50090274, 0x00000108 }, - { 0x50090278, 0x00000140 }, - { 0x5009027c, 0x00000142 },//lna =0 end - { 0x50090280, 0x00000080 }, - { 0x50090284, 0x00000082 }, - { 0x50090288, 0x00000084 }, - { 0x5009028c, 0x00000086 }, - { 0x50090290, 0x00000088 }, - { 0x50090294, 0x0000008a }, - { 0x50090298, 0x000000c0 }, - { 0x5009029c, 0x000000c2 }, - { 0x500902a0, 0x000000c4 }, - { 0x500902a4, 0x000000c6 }, - { 0x500902a8, 0x000000c8 }, - { 0x500902ac, 0x000000ca }, - { 0x500902b0, 0x00000100 }, - { 0x500902b4, 0x00000102 }, - { 0x500902b8, 0x00000104 }, - { 0x500902bc, 0x00000106 }, - { 0x500902c0, 0x00000108 }, - { 0x500902c4, 0x00000140 }, - { 0x500902c8, 0x00000142 }, - { 0x500902cc, 0x00000144 }, - { 0x500902d0, 0x00000146 }, - { 0x500902d4, 0x00000148 }, - { 0x500902d8, 0x00000180 }, - { 0x500902dc, 0x00000182 }, - { 0x500902e0, 0x00000184 }, - { 0x500902e4, 0x000001c0 }, - { 0x500902e8, 0x000001c2 }, - { 0x500902ec, 0x000001c4 }, - { 0x500902f0, 0x000001c6 }, - { 0x500902f4, 0x000001c8 }, - { 0x500902f8, 0x000001ca }, - { 0x500902fc, 0x000001cc },// lna = 01 end - { 0x50090300, 0x00000102 }, - { 0x50090304, 0x00000104 }, - { 0x50090308, 0x00000106 }, - { 0x5009030c, 0x00000108 }, - { 0x50090310, 0x00000140 }, - { 0x50090314, 0x00000142 }, - { 0x50090318, 0x00000144 }, - { 0x5009031c, 0x00000146 }, - { 0x50090320, 0x00000148 }, - { 0x50090324, 0x00000180 }, - { 0x50090328, 0x00000182 }, - { 0x5009032c, 0x00000184 }, - { 0x50090330, 0x000001c0 }, - { 0x50090334, 0x000001c2 }, - { 0x50090338, 0x000001c4 }, - { 0x5009033c, 0x000001c6 }, - { 0x50090340, 0x000001c8 }, - { 0x50090344, 0x000001c9 }, - { 0x50090348, 0x000001c9 }, - { 0x5009034c, 0x000001c9 }, - { 0x50090350, 0x000001c9 }, - { 0x50090354, 0x000001c9 }, - { 0x50090358, 0x000001c9 }, - { 0x5009035c, 0x000001c9 }, - { 0x50090360, 0x000001c9 }, - { 0x50090364, 0x000001c9 }, - { 0x50090368, 0x000001c9 }, - { 0x5009036c, 0x000001c9 }, - { 0x50090370, 0x000001c9 }, - { 0x50090374, 0x000001c9 }, - { 0x50090378, 0x000001c9 }, - { 0x5009037c, 0x000001c9 }, - { 0x50090054, 0x00000000 },//disable update - - { 0x5000050c, 0x00008000 },// for association power save - - //{ 0x50000808, 0x65000013 }, // disable prerx_priority;pta config - //{ 0x50000810, 0xFFCD0F01 }, //rx beacon priority - -}; - -const u32 wifi_core_init_data_32_E[][2] = -{ -#ifdef FORCE_WF_RX_TX - {0x50000800,0xFC003E05}, - {0x50000804,0x00000000}, - {0x50000808,0xA5000013}, //no pre_active protect - {0x5000080c,0x000001C0}, - {0x50000810,0xFFCC0F01}, - {0x50000814,0x00000000}, // not grant to rx and tx - {0x50000818,0x00FF0001}, - {0x5000081C,0xFF000F00}, - {0x50000820,0x00000000}, - {0x50000824,0x0000F0FE}, - {0x50000828,0x00100F10}, - {0x50000838,0xFFFFFFFF}, - {0x5000083C,0xFFFFFFFF}, -#endif - -#ifdef FORCE_WF_RX - {0x50000800,0xFC003E05}, - {0x50000804,0x00000000}, - {0x50000808,0xA5000013}, //no pre_active protect - {0x5000080c,0x000001C0}, - {0x50000810,0xFFCC0F01}, - {0x50000814,0xFF000F00}, //wf not grant to rx - {0x50000818,0x00FF0001}, - {0x5000081C,0xFF000F00}, - {0x50000820,0xFF000F00}, - {0x50000824,0x0000F0FE}, - {0x50000828,0x00100F10}, - {0x50000838,0xFFFFFFFF}, - {0x5000083C,0xFFFFFFFF}, -#endif - -#ifdef FORCE_WF_TX - {0x50000800,0xFC003E05}, - {0x50000804,0x00000000}, - {0x50000808,0xA5000013}, //no pre_active protect - {0x5000080c,0x000001C0}, - {0x50000810,0xFFCC0F01}, - {0x50000814,0x00FF0033}, //wf not grant to tx - {0x50000818,0x00FF0001}, - {0x5000081C,0xFF000F00}, - {0x50000820,0x00000000}, - {0x50000824,0x0000F0FE}, - {0x50000828,0x00100F10}, - {0x50000838,0xFFFFFFFF}, - {0x5000083C,0xFFFFFFFF}, -#endif - -#ifdef WF_PAT_CFG_2012_05_19 - {0x50000800,0xFC003E05}, - {0x50000804,0x00000000}, - {0x50000808,0xA5000013}, //no pre_active protect - {0x5000080c,0x000001C0}, - {0x50000810,0xFFCC0F01}, - {0x50000814,0xFFFF0F03}, //0xFFFF0F33 - {0x50000818,0x00FF0001}, - {0x5000081C,0xFF000F00}, - {0x50000820,0xFF000F00}, - {0x50000824,0x0000F0FE}, - {0x50000828,0x00100F10}, - {0x50000838,0xFFFFFFFF}, - {0x5000083C,0xFFFFFFFF}, -#endif - -#ifdef FORCE_WF - {0x50000800,0xFC003E05}, - {0x50000804,0x00000000}, - {0x50000838,0xF8003f2A}, - {0x5000083c,0x00000003}, - {0x50000808,0xfe00001b}, - {0x50000810,0x00000000}, - {0x50000814,0x00000000}, - {0x50000818,0x00000000}, - {0x5000081C,0x00000000}, - {0x50000820,0x00000000}, - {0x50000824,0xffffffff}, - {0x50000828,0x00100F10}, -#endif - -#ifdef WF_PAT_CFG_2012_04_15 /*pta config*/ - {0x50000800,0xFC003E05}, //tx_pri hi bits ctrl&mgmt package - {0x50000804,0x00000000}, //tx_pri hi bits as hi pri - {0x50000808,0xA500001B}, //sig_mode and protect time - {0x5000080c,0x000001C0}, //sigWire mode - {0x50000810,0xFFCC0F01}, //Lut bt - {0x50000814,0xFFFF0F33}, //Lut wf - {0x50000818,0x00FF0001}, //antSel0 for wl_rx - {0x5000081C,0xFF000F00}, //antSel1 for wl_tx - {0x50000820,0xFF000F00}, //antSel2 for wl_pa - //{0x50000838,0xFFFFFFFF}, //rx_pri low bits as high pri - //{0x5000083C,0xFFFFFFFF}, //rx_pri high bits as high pri -#endif - - { 0x30010004, 0x0000f77c }, //intn config - { 0x30010010, 0x00007dff }, //intn config - //item111:ver_b_wf_dig_2011_10_09 - { 0x30010000, 0x780369AF }, //disable tports wait 100ms; - { 0x30000010, 0x7000FFFF },//wait 500ms; - { 0x5000050c, 0x00008000 },// for association power save -}; - -u32 wifi_notch_data[][2] = -{ - //ch 1 - {0x001008d0, 0x50090040}, - {0x001008d4, 0x057213a2}, - {0x001008d8, 0x50090044}, - {0x001008dc, 0x10000000}, - //ch 2 - {0x00100910, 0x50090040}, - {0x00100914, 0x10000000}, - {0x00100918, 0x50090044}, - {0x0010091c, 0x10000000}, - //ch 3 - {0x00100950, 0x50090040}, - {0x00100954, 0x10000000}, - {0x00100958, 0x50090044}, - {0x0010095c, 0x10000000}, - //ch 4 - {0x00100990, 0x50090040}, - {0x00100994, 0x10000000}, - {0x00100998, 0x50090044}, - {0x0010099c, 0x10000000}, - //ch 5 - {0x001009d0, 0x50090040}, - {0x001009d4, 0x076794b4}, - {0x001009d8, 0x50090044}, - {0x001009dc, 0x10000000}, - //ch 6 - {0x00100a10, 0x50090040}, - {0x00100a14, 0x077c71de}, - {0x00100a18, 0x50090044}, - {0x00100a1c, 0x046d242e}, - //ch 7 - {0x00100a50, 0x50090040}, - {0x00100a54, 0x10000000}, - {0x00100a58, 0x50090044}, - {0x00100a5c, 0x057e7ec0}, - //ch 8 - {0x00100a90, 0x50090040}, - {0x00100a94, 0x077c7e22}, - {0x00100a98, 0x50090044}, - {0x00100a9c, 0x046d2bd2}, - //ch 9 - {0x00100ad0, 0x50090040}, - {0x00100ad4, 0x10000000}, - {0x00100ad8, 0x50090044}, - {0x00100adc, 0x10000000}, - //ch 10 - {0x00100b10, 0x50090040}, - {0x00100b14, 0x10000000}, - {0x00100b18, 0x50090044}, - {0x00100b1c, 0x10000000}, - //ch 11 - {0x00100b50, 0x50090040}, - {0x00100b54, 0x10000000}, - {0x00100b58, 0x50090044}, - {0x00100b5c, 0x10000000}, - //ch 12 - {0x00100b90, 0x50090040}, - {0x00100b94, 0x07764310}, - {0x00100b98, 0x50090044}, - {0x00100b9c, 0x10000000}, - //ch 13 - {0x00100bd0, 0x50090040}, - {0x00100bd4, 0x056794b4}, - {0x00100bd8, 0x50090044}, - {0x00100bdc, 0x10000000}, - //ch 14 - {0x00100c10, 0x50090040}, - {0x00100c14, 0x0779c279}, - {0x00100c18, 0x50090044}, - {0x00100c1c, 0x0779cd87}, -}; - -u32 wifi_notch_data_E[][2] = -{ - // For Verion E - //ch 1 - {0x001007CC, 0x50090040}, - {0x001007D0, 0x057213a2}, - {0x001007D4, 0x50090044}, - {0x001007D8, 0x10000000}, - //ch 2 - {0x001007FC, 0x50090040}, - {0x00100800, 0x10000000}, - {0x00100804, 0x50090044}, - {0x00100808, 0x10000000}, - //ch 3 - {0x0010082C, 0x50090040}, - {0x00100830, 0x10000000}, - {0x00100834, 0x50090044}, - {0x00100838, 0x10000000}, - //ch 4 - {0x0010085C, 0x50090040}, - {0x00100860, 0x10000000}, - {0x00100864, 0x50090044}, - {0x00100868, 0x10000000}, - //ch 5 - {0x0010088C, 0x50090040}, - {0x00100890, 0x076794b4}, - {0x00100894, 0x50090044}, - {0x00100898, 0x10000000}, - //ch 6 - {0x001008BC, 0x50090040}, - {0x001008C0, 0x077c71de}, - {0x001008C4, 0x50090044}, - {0x001008C8, 0x046d242e}, - //ch 7 - {0x001008EC, 0x50090040}, - {0x001008F0, 0x10000000}, - {0x001008F4, 0x50090044}, - {0x001008F8, 0x057e7140}, - //ch 8 - {0x0010091C, 0x50090040}, - {0x00100920, 0x077c7e22}, - {0x00100924, 0x50090044}, - {0x00100928, 0x046d2bd2}, - //ch 9 - {0x0010094C, 0x50090040}, - {0x00100950, 0x10000000}, - {0x00100954, 0x50090044}, - {0x00100958, 0x10000000}, - //ch 10 - {0x0010097C, 0x50090040}, - {0x00100980, 0x10000000}, - {0x00100984, 0x50090044}, - {0x00100988, 0x10000000}, - //ch 11 - {0x001009AC, 0x50090040}, - {0x001009B0, 0x10000000}, - {0x001009B4, 0x50090044}, - {0x001009B8, 0x10000000}, - //ch 12 - {0x001009DC, 0x50090040}, - {0x001009E0, 0x07764310}, - {0x001009E4, 0x50090044}, - {0x001009E8, 0x10000000}, - //ch 13 - {0x00100A0C, 0x50090040}, - {0x00100A10, 0x056794b4}, - {0x00100A14, 0x50090044}, - {0x00100A18, 0x10000000}, - //ch 14 - {0x00100A3C, 0x50090040}, - {0x00100A40, 0x0779c279}, - {0x00100A44, 0x50090044}, - {0x00100A4c, 0x0779cd87}, -}; - -//common sdio clock open -const u32 wifi_core_data_wake[][2] = -{ - {0x3001003c, 0x2e00a000}, -}; -//sleep sdio switch -const u32 wifi_core_data_sleep[][2] = -{ - {0x3001003c, 0x2e00a100}, -}; - -int rda5890_get_fw_version_polling(struct rda5890_private *priv, unsigned int* version) -{ - int ret = -1; - char wid_req[255]; - unsigned short wid_req_len = 6; - char wid_rsp[32]; - unsigned short wid_rsp_len = 32; - unsigned short wid; - char wid_msg_id = priv->wid_msg_id++; - unsigned char *ptr_payload; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); - - wid_req[0] = 'Q'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - wid = WID_SYS_FW_VER; - wid_req[4] = (char)(wid&0x00FF); - wid_req[5] = (char)((wid&0xFF00) >> 8); - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "__func__ <<<\n" ); - - ret = rda5890_wid_request_polling(priv, wid_req, wid_req_len, - wid_rsp, &wid_rsp_len); - if (ret) { - goto out; - } - - ret = rda5890_check_wid_response(priv->wid_rsp, priv->wid_rsp_len, wid, wid_msg_id, - 4, &ptr_payload); - - if(!ret) - { - memcpy((unsigned char *)version, ptr_payload, 4); - } - else - *version = 0; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "__func__ version: %x >>> \n" , *version); - -out: - return ret; -} - - -int rda5890_write_sdio32_polling(struct rda5890_private *priv,const unsigned int (*data)[2], unsigned int size) -{ - int count = size, index = 0; - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s >>> \n", __func__); - - for(index = 0; index < count/8; index ++) //each time write five init data - { - ret = rda5890_set_core_init_polling(priv, data[8*index], 8); - if(ret < 0) - goto err; - } - - if(count%8 > 0) - { - ret = rda5890_set_core_init_polling(priv, data[8*index], count%8); - if(ret < 0) - goto err; - } -err: - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s :ret=%d <<< \n", __func__, ret); - return ret; -} - -int rda5890_write_sdio32(struct rda5890_private *priv, const unsigned int (*data)[2], unsigned int size) -{ - int count = size, index = 0; - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s >>> \n", __func__); - - for(index = 0; index < count/8; index ++) //each time write five init data - { - ret = rda5890_set_core_init(priv, data[8*index], 8); - if(ret < 0) - goto err; - } - - if(count%8 > 0) - { - ret = rda5890_set_core_init(priv, data[8*index], count%8); - if(ret < 0) - goto err; - } -err: - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s :ret=%d <<< \n", __func__, ret); - return ret; -} - -int rda5890_write_sdio8_polling(struct rda5890_private *priv, const unsigned char (*data)[2], unsigned int size) -{ - int count = size, index = 0; - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s >>> \n", __func__); - - for(index = 0; index < count/8; index ++) //each time write five init data - { - ret = rda5890_set_core_patch_polling(priv, data[8*index], 8); - if(ret < 0) - goto err; - } - - if(count%8 > 0) - { - ret = rda5890_set_core_patch_polling(priv, data[8*index], count%8); - if(ret < 0) - goto err; - } -err: - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s :ret=%d <<< \n", __func__, ret); - return ret; -} - - -int rda5890_write_sdio8(struct rda5890_private *priv ,const unsigned char (*data)[2], unsigned int size) -{ - int count = size, index = 0; - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s >>> \n", __func__); - - for(index = 0; index < count/8; index ++) //each time write five init data - { - ret = rda5890_set_core_patch(priv, data[8*index], 8); - if(ret < 0) - goto err; - } - - if(count%8 > 0) - { - ret = rda5890_set_core_patch(priv, data[8*index], count%8); - if(ret < 0) - goto err; - } -err: - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s :ret=%d <<< \n", __func__, ret); - return ret; -} - -int rda5890_sdio_patch_core_32(struct rda5890_private *priv) -{ - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s >>> \n", __func__); - - if(priv->version == 7) - ret = rda5890_write_sdio32_polling(priv,wifi_core_patch_data_32, - sizeof(wifi_core_patch_data_32)/sizeof(wifi_core_patch_data_32[0])); - else if(priv->version == 4 || priv->version == 5) - ret = rda5890_write_sdio32_polling(priv,wifi_core_patch_data_32_E, - sizeof(wifi_core_patch_data_32_E)/sizeof(wifi_core_patch_data_32_E[0])); - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); - return ret; -} - - -int rda5890_sdio_init_core(struct rda5890_private *priv) -{ - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); - if(priv->version == 7) - ret = rda5890_write_sdio32(priv, wifi_core_init_data_32, - sizeof(wifi_core_init_data_32)/sizeof(wifi_core_init_data_32[0])); - else if(priv->version == 4 || priv->version == 5) - ret = rda5890_write_sdio32(priv, wifi_core_init_data_32_E, - sizeof(wifi_core_init_data_32_E)/sizeof(wifi_core_init_data_32_E[0])); - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s >>> \n", __func__); - - return ret; -} - -int rda5890_sdio_init_core_polling(struct rda5890_private *priv) -{ - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); - if(priv->version == 7) - ret = rda5890_write_sdio32_polling(priv, wifi_core_init_data_32, - sizeof(wifi_core_init_data_32)/sizeof(wifi_core_init_data_32[0])); - else if(priv->version == 4 || priv->version == 5) - ret = rda5890_write_sdio32_polling(priv, wifi_core_init_data_32_E, - sizeof(wifi_core_init_data_32_E)/sizeof(wifi_core_init_data_32_E[0])); - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s >>> \n", __func__); - return ret; -} - - -int rda5890_sdio_patch_core_8(struct rda5890_private *priv) -{ - int ret = 0; - //for patch in byte mode - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); - - ret = rda5890_write_sdio8(priv, wifi_core_patch_data_8, - sizeof(wifi_core_patch_data_8)/sizeof(wifi_core_patch_data_8[0])); - - //for patch in wake continue clock mode - ret = rda5890_sdio_core_wake_mode(priv); - if(ret < 0) - goto err; - -err: - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s >>> \n", __func__); - return ret; -} - -int rda5890_sdio_patch_core_8_polling(struct rda5890_private *priv) -{ - int ret = 0; - //for patch in byte mode - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); - - ret = rda5890_write_sdio8_polling(priv, wifi_core_patch_data_8, - sizeof(wifi_core_patch_data_8)/sizeof(wifi_core_patch_data_8[0])); - if(ret < 0) - goto err; - - //for patch in wake continue clock mode - ret = rda5890_sdio_core_wake_mode_polling(priv); - if(ret < 0) - goto err; - -err: - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s >>> \n", __func__); - return ret; -} - -int rda5890_sdio_set_default_notch(struct rda5890_private *priv) -{ - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); - - if(priv->version == 7) - ret = rda5890_write_sdio32(priv, wifi_notch_data, - sizeof(wifi_notch_data)/sizeof(wifi_notch_data[0])); - else if(priv->version == 4 || priv->version == 5) - ret = rda5890_write_sdio32(priv, wifi_notch_data_E, - sizeof(wifi_notch_data_E)/sizeof(wifi_notch_data_E[0])); - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); - return ret; -} - -int rda5890_sdio_set_default_notch_polling(struct rda5890_private *priv) -{ - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); - if(priv->version == 7) - ret = rda5890_write_sdio32_polling(priv, wifi_notch_data, - sizeof(wifi_notch_data)/sizeof(wifi_notch_data[0])); - else if(priv->version == 4 || priv->version == 5) - ret = rda5890_write_sdio32_polling(priv, wifi_notch_data_E, - sizeof(wifi_notch_data_E)/sizeof(wifi_notch_data_E[0])); - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); - return ret; -} - - -// -unsigned char rssi_switch_default_data_u8[][2] = -{ - {0x25, 0x00} -}; - -void rda5890_sdio_set_notch_by_channel(struct rda5890_private *priv, unsigned int channel) -{ -#if 0 - int count = 0, index = 0; - - if(priv->version == 7) - count = sizeof(wifi_notch_data)/(sizeof(wifi_notch_data[0]) * 4); - else if(priv->version == 4 || priv->version == 5) - count = sizeof(wifi_notch_data_E)/(sizeof(wifi_notch_data_E[0]) * 4); - channel = channel % count; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s >>> \n", __func__); - - if(channel > 1) - channel -= 1; - - if(priv->version == 7) - { - rda5890_set_core_init(priv, wifi_notch_data[4*channel], 4); - rda5890_set_core_patch(priv, rssi_switch_default_data_u8, 1); - } - else if(priv->version == 4 || priv->version == 5) - { - rda5890_set_core_init(priv, wifi_notch_data_E[4*channel], 4); - rda5890_set_core_patch(priv, rssi_switch_default_data_u8, 1); - } - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s <<< ch = %d \n", __func__, channel + 1); -#endif -} - -int rda5890_sdio_core_wake_mode(struct rda5890_private *priv) -{ - int ret = 0; - - ret = rda5890_write_sdio32(priv, wifi_core_data_wake, - sizeof(wifi_core_data_wake)/sizeof(wifi_core_data_wake[0])); - - return ret; -} - -int rda5890_sdio_core_wake_mode_polling(struct rda5890_private *priv) -{ - int ret = 0; - - ret = rda5890_write_sdio32_polling(priv, wifi_core_data_wake, - sizeof(wifi_core_data_wake)/sizeof(wifi_core_data_wake[0])); - return ret; -} - -int rda5890_sdio_core_sleep_mode(struct rda5890_private *priv) -{ - int ret = 0; - - ret = rda5890_write_sdio32(priv,wifi_core_data_sleep, - sizeof(wifi_core_data_sleep)/sizeof(wifi_core_data_sleep[0])); - return ret; -} - -extern void export_wifi_eirq_enable(); -int rda5890_sdio_init(struct rda5890_private *priv) -{ - int ret = 0; - unsigned long para = 0; - - sdio_init_complete = 0; - sdio_patch_complete = 0; - - printk(KERN_INFO " rda5890_sdio_init <<< \n"); - - ret = rda5890_sdio_patch_core_32(priv); - if(ret < 0) - goto err; - - printk(KERN_INFO "sdio_patch_complete wid_msg = %d \n", priv->wid_msg_id); - rda5890_shedule_timeout(10); //10ms delay - sdio_patch_complete = 1; - -#if 0 - ret = rda5890_sdio_init_core(priv); - if(ret < 0) - goto err; - - ret = rda5890_sdio_patch_core_8(priv); - if(ret < 0) - goto err; - - ret = rda5890_sdio_set_default_notch(priv); - if(ret < 0) - goto err; -#else - - ret = rda5890_sdio_init_core_polling(priv); - if(ret < 0) - goto err; - - ret = rda5890_sdio_patch_core_8_polling(priv); - if(ret < 0) - goto err; - - ret = rda5890_sdio_set_default_notch_polling(priv); - if(ret < 0) - goto err; - -#endif - export_wifi_eirq_enable(); - -#if 0 - rda5890_generic_set_ulong(priv, WID_MEMORY_ADDRESS, 0x30010008); - rda5890_generic_get_ulong(priv, WID_MEMORY_ACCESS_32BIT, ¶); - printk(KERN_INFO "rda5890_sdio_init para = %x \n", para); - para |= 0x200; - rda5890_generic_set_ulong(priv, WID_MEMORY_ACCESS_32BIT, para); - - rda5890_generic_set_ulong(priv, WID_MEMORY_ADDRESS, 0x30010010); - rda5890_generic_get_ulong(priv, WID_MEMORY_ACCESS_32BIT, ¶); - printk(KERN_INFO "rda5890_sdio_init para1 = %x \n", para); - para &= ~0x200; - rda5890_generic_set_ulong(priv, WID_MEMORY_ACCESS_32BIT, para); -#endif - - sdio_init_complete = 1; - -err: - return ret; -} - -//rssi > 200 -u32 rssi_switch_data_u32[][2] = -{ - {0x50090040, 0x10000000}, - {0x50090044, 0x10000000}, -}; - -u8 rssi_switch_data_u8[][2] = -{ - {0x25, 0x18} -}; - -void rda5890_rssi_up_to_200(struct rda5890_private *priv) -{ -#if 0 - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s >>> \n", __func__); - rda5890_set_core_init(priv, rssi_switch_data_u32, 2); - rda5890_set_core_patch(priv, rssi_switch_data_u8, 1); - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); -#endif -} - -u32 rda5990_assoc_power_save_data32[][2] = -{ - { 0x5000050c, 0x00008000 }// for association power save -}; - -void rda5990_assoc_power_save(struct rda5890_private *priv) -{ - rda5890_set_core_init(priv, rda5990_assoc_power_save_data32, 1); -} - -unsigned char is_sdio_init_complete(void) -{ - return sdio_init_complete; -} -unsigned char is_sdio_patch_complete(void) //after patch complete need check write flow -{ - return sdio_patch_complete; -} - -#ifdef WIFI_TEST_MODE - -static unsigned int wifi_test_mode_rx_notch_32[][2] = -{ - //item:notch_filter_5 - {0x50090040,0x076794b4},//8m - {0x50090044,0x10000000}, - //item:notch_filter_6 - {0x50090040,0x077c71de},//3m - {0x50090044,0x046d242e},//7m - //item:notch_filter_7 - {0x50090040,0x077e7ec0},//2m - {0x50090044,0x077e7140},//-2m - //item:notch_filter_8 - {0x50090040,0x077c7e22},//3m - {0x50090044,0x046d2bd2},//7m - //item:notch_filter_c - {0x50090040,0x07764310},//5m - {0x50090044,0x10000000}, - //item:notch_filter_e - {0x50090040,0x0779c279},//4m - {0x50090044,0x0779cd87},//-4m - //item:disable_notch - {0x50090040,0x10000000}, - {0x50090044,0x10000000}, -}; - -static unsigned int wifi_test_mode_agc_patch32[][2] = -{ - {0x50000600,0x0000501a},//write 1a(52) to 28h hightolow - {0x50000600,0x0000520d},//write 0d(26) to 29h hightomid - {0x50000600,0x00006a1e},//35h reg coarse2 upper window from 0d to 1a for l - //;50000600H,32'h00009890;//4ch reg unlock upper threshold from 70 to 90 - {0x50000600,0x00009a38},//4dh reg unlock lower threshold from 78 to 38 - {0x50000600,0x00007207},//39h reg change vga gain ,9 -> 7 for big signal - {0x50000600,0x0001c8f5},//e4h reg change hpf coeff to f5 - {0x50000600,0x00004200},//21h reg add fine gain 0db - {0x50000600,0x00004610},//23h reg change maxgain index as agc table - {0x50000600,0x0000900e},//48h reg unlock lower threshold change from 0a to - {0x50000600,0x00004a00},//25h reg pecket dection threshold - {0x50000600,0x000040a8},//20h reg add fine itr2 98->a8 - {0x50000600,0x00007e05},//3f reg rssi window for fine itr2 0->5 - {0x50000600,0x00008237},//41 reg fine itr1 nextstate 4->3 - {0x50000600,0x00008440},//42 reg fine itr2 nextstate 0->4 settle time 0->d - {0x50000600,0x0000b6a9},//5b reg change GreatN rssi avg count from 1 to 8 -} ; - -static unsigned int rda5990_test_mode_digital32[][2] = -{ - //item111:ver_D_wf_dig_20120208 - {0x30010000,0x780369AF}, //disable tports - //wait 100ms; - {0x30000010,0x7000FFFF}, - //item:agc_table_20110921 - {0x50090054,0x00000001},//enable update - {0x50090200,0x00000000}, - {0x50090204,0x00000000}, - {0x50090208,0x00000002}, - {0x5009020c,0x00000004}, - {0x50090210,0x00000006}, - {0x50090214,0x00000008}, - {0x50090218,0x0000000a}, - {0x5009021c,0x00000040}, - {0x50090220,0x00000042}, - {0x50090224,0x00000044}, - {0x50090228,0x00000046}, - {0x5009022c,0x00000048}, - {0x50090230,0x0000004a}, - {0x50090234,0x00000080}, - {0x50090238,0x00000082}, - {0x5009023c,0x00000084}, - {0x50090240,0x00000086}, - {0x50090244,0x00000088}, - {0x50090248,0x0000008a}, - {0x5009024c,0x000000c0}, - {0x50090250,0x000000c2}, - {0x50090254,0x000000c4}, - {0x50090258,0x000000c6}, - {0x5009025c,0x000000c8}, - {0x50090260,0x000000ca}, - {0x50090264,0x00000100}, - {0x50090268,0x00000102}, - {0x5009026c,0x00000104}, - {0x50090270,0x00000106}, - {0x50090274,0x00000108}, - {0x50090278,0x00000140}, - {0x5009027c,0x00000142},//lna =0 end - {0x50090280,0x00000080}, - {0x50090284,0x00000082}, - {0x50090288,0x00000084}, - {0x5009028c,0x00000086}, - {0x50090290,0x00000088}, - {0x50090294,0x0000008a}, - {0x50090298,0x000000c0}, - {0x5009029c,0x000000c2}, - {0x500902a0,0x000000c4}, - {0x500902a4,0x000000c6}, - {0x500902a8,0x000000c8}, - {0x500902ac,0x000000ca}, - {0x500902b0,0x00000100}, - {0x500902b4,0x00000102}, - {0x500902b8,0x00000104}, - {0x500902bc,0x00000106}, - {0x500902c0,0x00000108}, - {0x500902c4,0x00000140}, - {0x500902c8,0x00000142}, - {0x500902cc,0x00000144}, - {0x500902d0,0x00000146}, - {0x500902d4,0x00000148}, - {0x500902d8,0x00000180}, - {0x500902dc,0x00000182}, - {0x500902e0,0x00000184}, - {0x500902e4,0x000001c0}, - {0x500902e8,0x000001c2}, - {0x500902ec,0x000001c4}, - {0x500902f0,0x000001c6}, - {0x500902f4,0x000001c8}, - {0x500902f8,0x000001ca}, - {0x500902fc,0x000001cc},// lna = 01 end - {0x50090300,0x00000102}, - {0x50090304,0x00000104}, - {0x50090308,0x00000106}, - {0x5009030c,0x00000108}, - {0x50090310,0x00000140}, - {0x50090314,0x00000142}, - {0x50090318,0x00000144}, - {0x5009031c,0x00000146}, - {0x50090320,0x00000148}, - {0x50090324,0x00000180}, - {0x50090328,0x00000182}, - {0x5009032c,0x00000184}, - {0x50090330,0x000001c0}, - {0x50090334,0x000001c2}, - {0x50090338,0x000001c4}, - {0x5009033c,0x000001c6}, - {0x50090340,0x000001c8}, - {0x50090344,0x000001c9}, - {0x50090348,0x000001c9}, - {0x5009034c,0x000001c9}, - {0x50090350,0x000001c9}, - {0x50090354,0x000001c9}, - {0x50090358,0x000001c9}, - {0x5009035c,0x000001c9}, - {0x50090360,0x000001c9}, - {0x50090364,0x000001c9}, - {0x50090368,0x000001c9}, - {0x5009036c,0x000001c9}, - {0x50090370,0x000001c9}, - {0x50090374,0x000001c9}, - {0x50090378,0x000001c9}, - {0x5009037c,0x000001c9}, - {0x50090054,0x00000000},//disable update - {0x50000808,0x65000013}, // disable prerx_prio - //pta config - {0x50000810,0xFFCD0F01}, //rx beacon priority -}; - -int rda5890_set_test_mode(struct rda5890_private *priv) -{ - int ret = 0; - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_CRIT, - "%s >>> \n", __func__); - - sdio_init_complete = 0; - sdio_patch_complete = 0; - ret = rda5890_sdio_patch_core_32(priv); - if(ret < 0) - goto err; - sdio_patch_complete = 1; - - ret = rda5890_write_sdio8_polling(priv, wifi_core_patch_data_8, - sizeof(wifi_core_patch_data_8)/sizeof(wifi_core_patch_data_8[0])); - if(ret < 0) - goto err; - - ret = rda5890_write_sdio32_polling(priv, rda5990_test_mode_digital32, - sizeof(rda5990_test_mode_digital32)/sizeof(rda5990_test_mode_digital32[0])); - if(ret < 0) - goto err; - - ret = rda5890_write_sdio32_polling(priv, wifi_test_mode_agc_patch32, - sizeof(wifi_test_mode_agc_patch32)/sizeof(wifi_test_mode_agc_patch32[0])); - if(ret < 0) - goto err; - - ret = rda5890_write_sdio32_polling(priv, wifi_test_mode_rx_notch_32, - sizeof(wifi_test_mode_rx_notch_32)/sizeof(wifi_test_mode_rx_notch_32[0])); - if(ret < 0) - goto err; - - - ret = rda5890_sdio_set_default_notch_polling(priv); - if(ret < 0) - goto err; - - export_wifi_eirq_enable(); - sdio_init_complete = 1; - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_CRIT, - "%s <<< \n", __func__); - return ret; - -err: - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_CRIT, "rda5890_set_test_mode err!! \n" ); - return ret; -} -#endif - - \ No newline at end of file diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_txrx.c b/drivers/net/wireless/rda5990/rda_wlan/rda5890_txrx.c deleted file mode 100755 index ad01fea20b1d..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_txrx.c +++ /dev/null @@ -1,139 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#include "rda5890_defs.h" -#include "rda5890_dev.h" -#include "rda5890_wid.h" -#include "rda5890_wext.h" - -void rda5890_data_rx(struct rda5890_private *priv, - char *data, unsigned short data_len) -{ - struct sk_buff *skb; - char *pkt_data; - - RDA5890_DBGLAP(RDA5890_DA_TXRX, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - skb = dev_alloc_skb(data_len + NET_IP_ALIGN); - if (!skb) { - priv->stats.rx_dropped++; - return; - } - skb_reserve(skb, NET_IP_ALIGN); - pkt_data = skb_put(skb, data_len); - memcpy(pkt_data, data, data_len); - skb->dev = priv->dev; - skb->protocol = eth_type_trans(skb, priv->dev); - skb->ip_summed = CHECKSUM_NONE; - - RDA5890_DBGLAP(RDA5890_DA_TXRX, RDA5890_DL_TRACE, - "netif rx, len %d\n", skb->len); - RDA5890_DBGLAP(RDA5890_DA_TXRX, RDA5890_DL_TRACE, - "%02x %02x %02x %02x ... ... %02x %02x %02x %02x\n", - skb->data[0], skb->data[1], skb->data[2], skb->data[3], - skb->data[skb->len - 4], skb->data[skb->len - 3], - skb->data[skb->len - 2], skb->data[skb->len - 1]); - - priv->stats.rx_packets++; - priv->stats.rx_bytes += data_len; - - if (in_interrupt()) - netif_rx(skb); - else - netif_rx_ni(skb); - - RDA5890_DBGLAP(RDA5890_DA_TXRX, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); -} - - -int rda5890_host_to_card(struct rda5890_private *priv, - char *packet, unsigned short packet_len, unsigned char packet_type) -{ - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); - - ret = priv->hw_host_to_card(priv, packet, packet_len, packet_type); - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s >>> \n", __func__); - - return ret; -} - - -int rda5890_data_tx(struct rda5890_private *priv, - struct sk_buff *skb, struct net_device *dev) -{ - int ret; - char *pkt_data; - uint16_t pkt_len; - char buf[ETH_FRAME_LEN + 2]; - uint16_t data_len; - - RDA5890_DBGLAP(RDA5890_DA_TXRX, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); - - ret = NETDEV_TX_OK; - - if (!skb->len || (skb->len > ETH_FRAME_LEN)) { - priv->stats.tx_dropped++; - priv->stats.tx_errors++; - goto free; - } - - pkt_data = skb->data; - pkt_len = skb->len; - - RDA5890_DBGLAP(RDA5890_DA_TXRX, RDA5890_DL_TRACE, - "netif tx len %d\n", pkt_len); - RDA5890_DBGLAP(RDA5890_DA_TXRX, RDA5890_DL_TRACE, - "%02x %02x %02x %02x ... ... %02x %02x %02x %02x\n", - skb->data[0], skb->data[1], skb->data[2], skb->data[3], - skb->data[skb->len - 4], skb->data[skb->len - 3], - skb->data[skb->len - 2], skb->data[skb->len - 1]); - - /* FIXME: we can save this memcpy by adding header inside the sdio driver */ - memcpy(buf + 2, pkt_data, pkt_len); - data_len = pkt_len + 2; - buf[0] = (char)(data_len&0xFF); - buf[1] = (char)((data_len>>8)&0x0F); - buf[1] |= 0x10; // for DataOut 0x1 - - //RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_NORM, - // "sdio tx len %d\n", data_len); - //RDA5890_DBGLAP(RDA5890_DA_ETHER, RDA5890_DL_NORM, - // "%02x %02x %02x %02x ... ... %02x %02x %02x %02x\n", - // buf[0], buf[1], buf[2], buf[3], - // buf[data_len - 4], buf[data_len - 3], - // buf[data_len - 2], buf[data_len - 1]); - - ret = rda5890_host_to_card(priv, buf, data_len, DATA_REQUEST_PACKET); - if (ret) { - RDA5890_ERRP("host_to_card send failed, ret = %d\n", ret); - goto free; - } - - priv->stats.tx_packets++; - priv->stats.tx_bytes += skb->len; - - dev->trans_start = jiffies; - - free: - /* free right away, since we do copy */ - dev_kfree_skb_any(skb); - - RDA5890_DBGLAP(RDA5890_DA_TXRX, RDA5890_DL_DEBUG, - "%s >>> \n", __func__); - return ret; -} - diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_txrx.h b/drivers/net/wireless/rda5990/rda_wlan/rda5890_txrx.h deleted file mode 100755 index 6f161b90e384..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_txrx.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _RDA5890_TXRX_H_ -#define _RDA5890_TXRX_H_ - -int rda5890_host_to_card(struct rda5890_private *priv, - char *packet, unsigned short packet_len, unsigned char packet_type); - -void rda5890_data_rx(struct rda5890_private *priv, - char *data, unsigned short data_len); -int rda5890_data_tx(struct rda5890_private *priv, - struct sk_buff *skb, struct net_device *dev); - -#endif - diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_wext.c b/drivers/net/wireless/rda5990/rda_wlan/rda5890_wext.c deleted file mode 100755 index ae06196773c3..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_wext.c +++ /dev/null @@ -1,2562 +0,0 @@ -/** - * This file contains ioctl functions - */ -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "rda5890_defs.h" -#include "rda5890_dev.h" -#include "rda5890_ioctl.h" -#include "rda5890_wid.h" -#include "rda5890_wext.h" - -#define WLAN_AUTH_OPEN 0 -#define WLAN_AUTH_SHARED_KEY 1 -#define WLAN_AUTH_FT 2 -#define WLAN_AUTH_LEAP 128 - -#define WLAN_AUTH_CHALLENGE_LEN 128 - -#define WLAN_CAPABILITY_ESS (1<<0) -#define WLAN_CAPABILITY_IBSS (1<<1) -#define WLAN_CAPABILITY_CF_POLLABLE (1<<2) -#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3) -#define WLAN_CAPABILITY_PRIVACY (1<<4) -#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5) -#define WLAN_CAPABILITY_PBCC (1<<6) -#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) -#define IW_AUTH_ALG_WAPI 0x08 -#define IW_ENCODE_ALG_WAPI 0x80 - -static int rda5890_get_name(struct net_device *dev, struct iw_request_info *info, - char *cwrq, char *extra) -{ - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - /* We could add support for 802.11n here as needed. Jean II */ - snprintf(cwrq, IFNAMSIZ, "IEEE 802.11b/g"); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_get_freq(struct net_device *dev, struct iw_request_info *info, - struct iw_freq *fwrq, char *extra) -{ - //struct rda5890_private *priv = netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - fwrq->m = (long)2437 * 100000; - fwrq->e = 1; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_get_wap(struct net_device *dev, struct iw_request_info *info, - struct sockaddr *awrq, char *extra) -{ - struct rda5890_private *priv = (struct rda5890_private *) netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - if (priv->connect_status == MAC_CONNECTED) { - memcpy(awrq->sa_data, priv->curbssparams.bssid, ETH_ALEN); - } else { - memset(awrq->sa_data, 0, ETH_ALEN); - } - awrq->sa_family = ARPHRD_ETHER; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_set_nick(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_get_nick(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_set_rts(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_get_rts(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - //struct rda5890_private *priv = netdev_priv(dev); - int ret = 0; - u16 val = 0; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - val = 600; - - vwrq->value = val; - vwrq->disabled = val > RDA5890_RTS_MAX_VALUE; /* min rts value is 0 */ - vwrq->fixed = 1; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return ret; -} - -static int rda5890_set_frag(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_get_frag(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - //struct rda5890_private *priv = netdev_priv(dev); - int ret = 0; - u16 val = 0; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - val = 1460; - - vwrq->value = val; - vwrq->disabled = ((val < RDA5890_FRAG_MIN_VALUE) - || (val > RDA5890_FRAG_MAX_VALUE)); - vwrq->fixed = 1; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return ret; -} - -static int rda5890_get_mode(struct net_device *dev, - struct iw_request_info *info, u32 * uwrq, char *extra) -{ - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - *uwrq = IW_MODE_INFRA; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_get_txpow(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - //struct rda5890_private *priv = netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - vwrq->value = 20; // in dbm - vwrq->fixed = 1; - vwrq->disabled = 0; - vwrq->flags = IW_TXPOW_DBM; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_set_retry(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_get_retry(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - //struct rda5890_private *priv = netdev_priv(dev); - int ret = 0; - u16 val = 0; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - vwrq->disabled = 0; - - if (vwrq->flags & IW_RETRY_LONG) { - val = 7; - - /* Subtract 1 to convert try count to retry count */ - vwrq->value = val - 1; - vwrq->flags = IW_RETRY_LIMIT | IW_RETRY_LONG; - } else { - val = 6; - - /* Subtract 1 to convert try count to retry count */ - vwrq->value = val - 1; - vwrq->flags = IW_RETRY_LIMIT | IW_RETRY_SHORT; - } - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return ret; -} - -/** - * 802.11b/g supported bitrates (in 500Kb/s units) - */ -u8 rda5890_bg_rates[MAX_RATES] = - { 0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18, - 0x24, 0x30, 0x48, 0x60, 0x6c,0x00, 0x00 }; - -u16 rda5890_nr_chan = 11; - -/** - * @brief Get Range Info - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param vwrq A pointer to iw_param structure - * @param extra A pointer to extra data buf - * @return 0 --success, otherwise fail - */ -static int rda5890_get_range(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ - //struct rda5890_private *priv = netdev_priv(dev); - struct iw_range *range = (struct iw_range *)extra; - int i; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - dwrq->length = sizeof(struct iw_range); - memset(range, 0, sizeof(struct iw_range)); - - range->min_nwid = 0; - range->max_nwid = 0; - - range->num_bitrates = sizeof(rda5890_bg_rates); - for (i = 0; i < range->num_bitrates; i++) - range->bitrate[i] = rda5890_bg_rates[i] * 500000; - range->num_bitrates = i; - - range->num_frequency = 0; - - range->scan_capa = IW_SCAN_CAPA_ESSID; - - for (i = 0; (range->num_frequency < IW_MAX_FREQUENCIES) - && (i < rda5890_nr_chan); i++) { - range->freq[range->num_frequency].i = (long)(i + 1); - range->freq[range->num_frequency].m = - (long)((2412 + 5 * i) * 100000); - range->freq[range->num_frequency].e = 1; - range->num_frequency++; - } - - range->num_channels = range->num_frequency; - - /* - * Set an indication of the max TCP throughput in bit/s that we can - * expect using this interface - */ - range->throughput = 5000 * 1000; - - range->min_rts = RDA5890_RTS_MIN_VALUE; - range->max_rts = RDA5890_RTS_MAX_VALUE; - range->min_frag = RDA5890_FRAG_MIN_VALUE; - range->max_frag = RDA5890_FRAG_MAX_VALUE; - - range->encoding_size[0] = 5; - range->encoding_size[1] = 13; - range->num_encoding_sizes = 2; - range->max_encoding_tokens = 4; - - /* - * Right now we support only "iwconfig ethX power on|off" - */ - range->pm_capa = IW_POWER_ON; - - /* - * Minimum version we recommend - */ - range->we_version_source = 15; - - /* - * Version we are compiled with - */ - range->we_version_compiled = WIRELESS_EXT; - - range->retry_capa = IW_RETRY_LIMIT; - range->retry_flags = IW_RETRY_LIMIT | IW_RETRY_MAX; - - range->min_retry = 0; - range->max_retry = 14; - - /* - * Set the qual, level and noise range values - */ - range->max_qual.qual = 100; - range->max_qual.level = 0; - range->max_qual.noise = 0; - range->max_qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; - - range->avg_qual.qual = 70; - /* TODO: Find real 'good' to 'bad' threshold value for RSSI */ - range->avg_qual.level = 0; - range->avg_qual.noise = 0; - range->avg_qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; - - range->sensitivity = 0; - - /* Setup the supported power level ranges */ - memset(range->txpower, 0, sizeof(range->txpower)); - range->txpower_capa = IW_TXPOW_DBM | IW_TXPOW_RANGE; - range->txpower[0] = 0; - range->txpower[1] = 20; - range->num_txpower = 2; - - range->event_capa[0] = (IW_EVENT_CAPA_K_0 | - IW_EVENT_CAPA_MASK(SIOCGIWAP) | - IW_EVENT_CAPA_MASK(SIOCGIWSCAN)); - range->event_capa[1] = IW_EVENT_CAPA_K_1; - - range->enc_capa = IW_ENC_CAPA_WPA - | IW_ENC_CAPA_WPA2 - | IW_ENC_CAPA_CIPHER_TKIP - | IW_ENC_CAPA_CIPHER_CCMP; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_set_power(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - //struct rda5890_private *priv = netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_get_power(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - //struct rda5890_private *priv = netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - vwrq->value = 0; - vwrq->flags = 0; - vwrq->disabled = 0; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_update_bss_stats(struct rda5890_private *priv) -{ - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - memcpy(priv->curbssparams.ssid, - priv->assoc_ssid, sizeof(priv->curbssparams.ssid)); - - if(priv->scan_running == 1) - return ret; - - ret = rda5890_get_bssid(priv, priv->curbssparams.bssid); - if (ret) { - RDA5890_ERRP("rda5890_get_bssid, ret = %d\n", ret); - goto out; - } - -#if 0 - ret = rda5890_get_channel(priv, &priv->curbssparams.channel); - if (ret) { - RDA5890_ERRP("rda5890_get_channel, ret = %d\n", ret); - goto out; - } -#endif - - ret = rda5890_get_rssi(priv, &priv->curbssparams.rssi); - if (ret) { - RDA5890_ERRP("rda5890_get_rssi, ret = %d\n", ret); - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<< ch = %d rssi = %d\n", __func__, priv->curbssparams.channel, priv->curbssparams.rssi); - -out: - return ret; -} - -static struct iw_statistics *rda5890_get_wireless_stats(struct net_device *dev) -{ - struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - int stats_valid = 0; - u8 snr; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - if (priv->connect_status != MAC_CONNECTED) - goto out; - - rda5890_update_bss_stats(priv); - - priv->wstats.miss.beacon = 0; - priv->wstats.discard.retries = 0; - priv->wstats.qual.level = priv->curbssparams.rssi > 127? priv->curbssparams.rssi - 271 - :priv->curbssparams.rssi - 15; - - snr = priv->wstats.qual.level - RDA5890_NF_DEFAULT_SCAN_VALUE; - priv->wstats.qual.qual = - (100 * RSSI_DIFF * RSSI_DIFF - (PERFECT_RSSI - snr) * - (15 * (RSSI_DIFF) + 62 * (PERFECT_RSSI - snr))) / - (RSSI_DIFF * RSSI_DIFF); - if (priv->wstats.qual.qual > 100) - priv->wstats.qual.qual = 100; - priv->wstats.qual.noise = RDA5890_NF_DEFAULT_SCAN_VALUE; - priv->wstats.qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; - - stats_valid = 1; - -out: - if (!stats_valid) { - priv->wstats.miss.beacon = 0; - priv->wstats.discard.retries = 0; - priv->wstats.qual.qual = 0; - priv->wstats.qual.level = 0; - priv->wstats.qual.noise = 0; - priv->wstats.qual.updated = IW_QUAL_ALL_UPDATED; - priv->wstats.qual.updated |= IW_QUAL_NOISE_INVALID | - IW_QUAL_QUAL_INVALID | IW_QUAL_LEVEL_INVALID; - } - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return &priv->wstats; -} - -static int rda5890_set_freq(struct net_device *dev, struct iw_request_info *info, - struct iw_freq *fwrq, char *extra) -{ - //struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_set_rate(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - //struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_get_rate(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - //struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - vwrq->fixed = 0; - vwrq->value = 108*500000; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_set_mode(struct net_device *dev, - struct iw_request_info *info, u32 * uwrq, char *extra) -{ - //struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - - -/** - * @brief Get Encryption key - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param vwrq A pointer to iw_param structure - * @param extra A pointer to extra data buf - * @return 0 --success, otherwise fail - */ -static int rda5890_get_encode(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *dwrq, u8 * extra) -{ - //struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -/** - * @brief Set Encryption key - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param vwrq A pointer to iw_param structure - * @param extra A pointer to extra data buf - * @return 0 --success, otherwise fail - */ -static int rda5890_set_encode(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ - //struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -/** - * @brief Set Encryption key (internal) - * - * @param priv A pointer to private card structure - * @param key_material A pointer to key material - * @param key_length length of key material - * @param index key index to set - * @param set_tx_key Force set TX key (1 = yes, 0 = no) - * @return 0 --success, otherwise fail - */ -static int copy_wep_key(struct rda5890_private *priv, - const char *key_material, - u16 key_length, - u16 index, - int set_tx_key) -{ - int ret = 0; - struct enc_key *pkey; - - /* Paranoid validation of key index */ - if (index > 3) { - ret = -EINVAL; - goto out; - } - - /* validate max key length */ - if (key_length > KEY_LEN_WEP_104) { - ret = -EINVAL; - goto out; - } - - if (key_length == KEY_LEN_WEP_40) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "WEP40 : %02x%02x%02x%02x%02x\n", - key_material[0], key_material[1], key_material[2], - key_material[3], key_material[4]); - } - else if (key_length == KEY_LEN_WEP_104) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "WEP104 : %02x%02x%02x%02x%02x" - " %02x%02x%02x%02x%02x" - " %02x%02x%02x\n", - key_material[0], key_material[1], key_material[2], - key_material[3], key_material[4], key_material[5], - key_material[6], key_material[7], key_material[8], - key_material[9], key_material[10], key_material[11], - key_material[12]); - } - else { - RDA5890_ERRP("Error in WEP Key length %d\n", key_length); - } - - pkey = &priv->wep_keys[index]; - - if (key_length > 0) { - memset(pkey, 0, sizeof(struct enc_key)); - pkey->type = KEY_TYPE_ID_WEP; - - /* Standardize the key length */ - pkey->len = (key_length > KEY_LEN_WEP_40) ? - KEY_LEN_WEP_104 : KEY_LEN_WEP_40; - memcpy(pkey->key, key_material, key_length); - } - - if (set_tx_key) { - /* Ensure the chosen key is valid */ - if (!pkey->len) { - RDA5890_ERRP("key not set, so cannot enable it\n"); - ret = -EINVAL; - goto out; - } - priv->wep_tx_keyidx = index; - } - - priv->secinfo.wep_enabled = 1; - -out: - return ret; -} - -static int validate_key_index(u16 def_index, u16 raw_index, - u16 *out_index, u16 *is_default) -{ - if (!out_index || !is_default) - return -EINVAL; - - /* Verify index if present, otherwise use default TX key index */ - if (raw_index > 0) { - if (raw_index > 4) - return -EINVAL; - *out_index = raw_index - 1; - } else { - *out_index = def_index; - *is_default = 1; - } - return 0; -} - -static void disable_wep(struct rda5890_private *priv) -{ - int i; - - /* Set Open System auth mode */ - priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; - - /* Clear WEP keys and mark WEP as disabled */ - priv->secinfo.wep_enabled = 0; - for (i = 0; i < 4; i++) - priv->wep_keys[i].len = 0; - - set_bit(ASSOC_FLAG_SECINFO, &priv->assoc_flags); - set_bit(ASSOC_FLAG_WEP_KEYS, &priv->assoc_flags); -} - -static void disable_wpa(struct rda5890_private *priv) -{ - memset(&priv->wpa_mcast_key, 0, sizeof (struct enc_key)); - priv->wpa_mcast_key.flags = KEY_INFO_WPA_MCAST; - set_bit(ASSOC_FLAG_WPA_MCAST_KEY, &priv->assoc_flags); - - memset(&priv->wpa_unicast_key, 0, sizeof (struct enc_key)); - priv->wpa_unicast_key.flags = KEY_INFO_WPA_UNICAST; - set_bit(ASSOC_FLAG_WPA_UCAST_KEY, &priv->assoc_flags); - - priv->secinfo.WPAenabled = 0; - priv->secinfo.WPA2enabled = 0; - priv->secinfo.cipther_type = 0; - priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; - set_bit(ASSOC_FLAG_SECINFO, &priv->assoc_flags); -} - -/** - * @brief Get Extended Encryption key (WPA/802.1x and WEP) - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param vwrq A pointer to iw_param structure - * @param extra A pointer to extra data buf - * @return 0 on success, otherwise failure - */ -static int rda5890_get_encodeext(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *dwrq, - char *extra) -{ - struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - int ret = -EINVAL; - struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; - int index, max_key_len; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - max_key_len = dwrq->length - sizeof(*ext); - if (max_key_len < 0) - goto out; - - index = dwrq->flags & IW_ENCODE_INDEX; - if (index) { - if (index < 1 || index > 4) - goto out; - index--; - } else { - index = priv->wep_tx_keyidx; - } - - if (!(ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) && - ext->alg != IW_ENCODE_ALG_WEP) { - if (index != 0) - goto out; - } - - dwrq->flags = index + 1; - memset(ext, 0, sizeof(*ext)); - - if ( !priv->secinfo.wep_enabled - && !priv->secinfo.WPAenabled - && !priv->secinfo.WPA2enabled) { - ext->alg = IW_ENCODE_ALG_NONE; - ext->key_len = 0; - dwrq->flags |= IW_ENCODE_DISABLED; - } else { - u8 *key = NULL; - - if ( priv->secinfo.wep_enabled - && !priv->secinfo.WPAenabled - && !priv->secinfo.WPA2enabled) { - /* WEP */ - ext->alg = IW_ENCODE_ALG_WEP; - ext->key_len = priv->wep_keys[index].len; - key = &priv->wep_keys[index].key[0]; - } else if ( !priv->secinfo.wep_enabled - && (priv->secinfo.WPAenabled || - priv->secinfo.WPA2enabled)) { - /* WPA */ - struct enc_key * pkey = NULL; - - if ( priv->wpa_mcast_key.len - && (priv->wpa_mcast_key.flags & KEY_INFO_WPA_ENABLED)) - pkey = &priv->wpa_mcast_key; - else if ( priv->wpa_unicast_key.len - && (priv->wpa_unicast_key.flags & KEY_INFO_WPA_ENABLED)) - pkey = &priv->wpa_unicast_key; - - if (pkey) { - if (pkey->type == KEY_TYPE_ID_AES) { - ext->alg = IW_ENCODE_ALG_CCMP; - } else { - ext->alg = IW_ENCODE_ALG_TKIP; - } - ext->key_len = pkey->len; - key = &pkey->key[0]; - } else { - ext->alg = IW_ENCODE_ALG_TKIP; - ext->key_len = 0; - } - } else { - goto out; - } - - if (ext->key_len > max_key_len) { - ret = -E2BIG; - goto out; - } - - if (ext->key_len) - memcpy(ext->key, key, ext->key_len); - else - dwrq->flags |= IW_ENCODE_NOKEY; - dwrq->flags |= IW_ENCODE_ENABLED; - } - ret = 0; - -out: - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -/** - * @brief Set Encryption key Extended (WPA/802.1x and WEP) - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param vwrq A pointer to iw_param structure - * @param extra A pointer to extra data buf - * @return 0 --success, otherwise fail - */ -static int rda5890_set_encodeext(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *dwrq, - char *extra) -{ - struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - int ret = 0; - struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; - int alg = ext->alg; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - if ((alg == IW_ENCODE_ALG_NONE) || (dwrq->flags & IW_ENCODE_DISABLED)) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "NO SEC\n"); - if(test_bit(ASSOC_FLAG_ASSOC_START ,&priv->assoc_flags)) - { - if(priv->imode != 3 && priv->imode != 5) - disable_wep (priv); - } - disable_wpa (priv); - } else if (alg == IW_ENCODE_ALG_WEP) { - u16 is_default = 0, index, set_tx_key = 0; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "WEP, flags = 0x%04x\n", dwrq->flags); - - ret = validate_key_index(priv->wep_tx_keyidx, - (dwrq->flags & IW_ENCODE_INDEX), - &index, &is_default); - if (ret) - goto out; - - /* If WEP isn't enabled, or if there is no key data but a valid - * index, or if the set-TX-key flag was passed, set the TX key. - */ - if ( !priv->secinfo.wep_enabled - || (dwrq->length == 0 && !is_default) - || (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY)) - set_tx_key = 1; - - /* Copy key to driver */ - ret = copy_wep_key(priv, ext->key, ext->key_len, index, set_tx_key); - if (ret) - goto out; - - /* Set Key to Mac */ - /* Move to assoc_helper_secinfo(), wep_key need to be set after imode */ - //ret = rda5890_set_wepkey(priv, index, ext->key, ext->key_len); - //if (ret) - // goto out; - - if (dwrq->flags & IW_ENCODE_RESTRICTED) { - priv->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY; - } else if (dwrq->flags & IW_ENCODE_OPEN) { - priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; - } - - /* Mark the various WEP bits as modified */ - set_bit(ASSOC_FLAG_SECINFO, &priv->assoc_flags); - if (dwrq->length) - set_bit(ASSOC_FLAG_WEP_KEYS, &priv->assoc_flags); - if (set_tx_key) - set_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &priv->assoc_flags); - } else if ((alg == IW_ENCODE_ALG_TKIP) || (alg == IW_ENCODE_ALG_CCMP)) { - struct enc_key * pkey; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "TKIP or CCMP, flags = 0x%04x, alg = %d\n", dwrq->flags, alg); - - /* validate key length */ - if (((alg == IW_ENCODE_ALG_TKIP) - && (ext->key_len != KEY_LEN_WPA_TKIP)) - || ((alg == IW_ENCODE_ALG_CCMP) - && (ext->key_len != KEY_LEN_WPA_AES))) { - RDA5890_ERRP("invalid size %d for key of alg, type %d\n", - ext->key_len, alg); - ret = -EINVAL; - goto out; - } - - /* Copy key to driver */ - if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { - pkey = &priv->wpa_mcast_key; - set_bit(ASSOC_FLAG_WPA_MCAST_KEY, &priv->assoc_flags); - } else { - pkey = &priv->wpa_unicast_key; - set_bit(ASSOC_FLAG_WPA_UCAST_KEY, &priv->assoc_flags); - } - - memset(pkey, 0, sizeof (struct enc_key)); - memcpy(pkey->key, ext->key, ext->key_len); - pkey->len = ext->key_len; - if (pkey->len) - pkey->flags |= KEY_INFO_WPA_ENABLED; - - /* Do this after zeroing key structure */ - if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { - pkey->flags |= KEY_INFO_WPA_MCAST; - } else { - pkey->flags |= KEY_INFO_WPA_UNICAST; - } - - if (alg == IW_ENCODE_ALG_TKIP) { - pkey->type = KEY_TYPE_ID_TKIP; - if (!(ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) - && !(priv->imode & (BIT6))) { - RDA5890_ERRP("imode [0x%x] not match with cipher alg TKIP\n", - priv->imode); - } - } else if (alg == IW_ENCODE_ALG_CCMP) { - pkey->type = KEY_TYPE_ID_AES; - if (!(ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) - && !(priv->imode & (BIT5))) { - RDA5890_ERRP("imode [0x%x] not match with cipher alg CCMP\n", - priv->imode); - } - } - - /* If WPA isn't enabled yet, do that now */ - if ( priv->secinfo.WPAenabled == 0 - && priv->secinfo.WPA2enabled == 0) { - priv->secinfo.WPAenabled = 1; - priv->secinfo.WPA2enabled = 1; - set_bit(ASSOC_FLAG_SECINFO, &priv->assoc_flags); - } - - /* Set Keys to MAC*/ - if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { - /* Set GTK */ - /* - *Always use key_id = 1 for now - * need to toggle among 1, 2, 3 - */ - ret = rda5890_set_gtk(priv, 1, ext->tx_seq, IW_ENCODE_SEQ_MAX_SIZE, - pkey->key, pkey->len); - if (ret) - goto out; - } else { - pkey->flags |= KEY_INFO_WPA_UNICAST; - /* Set PTK */ - ret = rda5890_set_ptk(priv, pkey->key, pkey->len); - if (ret) - goto out; - } - - /* Only disable wep if necessary: can't waste time here. */ - disable_wep(priv); - } else if (alg == IW_ENCODE_ALG_WAPI) { //wapi - if(ext->key_len != 32) - goto out; - - priv->is_wapi = 1; - - /* Set Keys to MAC*/ - if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { - unsigned char tmp[8]; - /* Set GTK */ - /* - * Always use key_id = 1 for now - * need to toggle among 1, 2, 3 - */ - ret = rda5890_set_gtk(priv, 1, tmp, IW_ENCODE_SEQ_MAX_SIZE, - ext->key, ext->key_len); - if (ret) - goto out; - } else { - /* Set PTK */ - ret = rda5890_set_ptk(priv, ext->key, ext->key_len); - if (ret) - goto out; - } - } - -out: - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -/** - * @brief PMKSA cache operation (WPA/802.1x and WEP) - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param vwrq A pointer to iw_param structure - * @param extra A pointer to extra data buf - * @return 0 on success, otherwise failure - */ -static int rda5890_set_pmksa(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *dwrq, - char *extra) -{ - //struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -static int rda5890_set_genie(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *dwrq, - char *extra) -{ - struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - if(extra[0] == 0x44) //wapi ie - { - unsigned char ie_len = extra[1] + 2; - rda5890_generic_set_str(priv, WID_WAPI_ASSOC_IE, extra ,ie_len); - goto out; - } - - if (dwrq->length > MAX_WPA_IE_LEN || - (dwrq->length && extra == NULL)) { - ret = -EINVAL; - goto out; - } - - if (dwrq->length) { - memcpy(&priv->wpa_ie[0], extra, dwrq->length); - priv->wpa_ie_len = dwrq->length; - } else { - memset(&priv->wpa_ie[0], 0, sizeof(priv->wpa_ie)); - priv->wpa_ie_len = 0; - } - -out: - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return ret; -} - -static int rda5890_get_genie(struct net_device *dev, - struct iw_request_info *info, - struct iw_point *dwrq, - char *extra) -{ - struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - if (priv->wpa_ie_len == 0) { - dwrq->length = 0; - goto out; - } - - if (dwrq->length < priv->wpa_ie_len) { - ret = -E2BIG; - goto out; - } - - dwrq->length = priv->wpa_ie_len; - memcpy(extra, &priv->wpa_ie[0], priv->wpa_ie_len); - -out: - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return ret; -} - -static int rda5890_set_auth(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *dwrq, - char *extra) -{ - struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - int ret = 0; - int updated = 0; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "flags = 0x%04x, value = 0x%x\n", dwrq->flags, dwrq->value); - - switch (dwrq->flags & IW_AUTH_INDEX) { - case IW_AUTH_CIPHER_PAIRWISE: -#ifdef GET_SCAN_FROM_NETWORK_INFO - if (dwrq->value & (IW_AUTH_CIPHER_WEP104 | IW_AUTH_CIPHER_WEP40)) - { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "WEP Selected \n"); - priv->secinfo.wep_enabled = 1; - if(dwrq->value & IW_AUTH_CIPHER_WEP104) - priv->secinfo.cipther_type |= IW_AUTH_CIPHER_WEP104; - else if(dwrq->value & IW_AUTH_CIPHER_WEP40) - priv->secinfo.cipther_type |= IW_AUTH_CIPHER_WEP40; - } - if (dwrq->value & IW_AUTH_CIPHER_TKIP) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "IW_AUTH_CIPHER_TKIP \n"); - priv->secinfo.cipther_type |= IW_AUTH_CIPHER_TKIP; - } - if (dwrq->value & IW_AUTH_CIPHER_CCMP) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "IW_AUTH_CIPHER_CCMP \n"); - priv->secinfo.cipther_type |= IW_AUTH_CIPHER_CCMP; - } - if (dwrq->value & IW_AUTH_CIPHER_NONE) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "OPEN System \n"); - priv->secinfo.cipther_type = IW_AUTH_CIPHER_NONE; - } - break; -#endif - case IW_AUTH_TKIP_COUNTERMEASURES: - case IW_AUTH_CIPHER_GROUP: - case IW_AUTH_DROP_UNENCRYPTED: - /* - * rda5890 does not use these parameters - */ - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "DO NOT USE\n"); - break; - - case IW_AUTH_KEY_MGMT: - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "KEY_MGMT, val = %d\n", dwrq->value); - priv->secinfo.key_mgmt = dwrq->value; - updated = 1; - break; - - case IW_AUTH_WPA_VERSION: - if (dwrq->value & IW_AUTH_WPA_VERSION_DISABLED) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "WPA_VERSION, DISABLED\n"); - priv->secinfo.WPAenabled = 0; - priv->secinfo.WPA2enabled = 0; - disable_wpa (priv); - } - if (dwrq->value & IW_AUTH_WPA_VERSION_WPA) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "WPA_VERSION, WPA\n"); - priv->secinfo.WPAenabled = 1; - priv->secinfo.wep_enabled = 0; - priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; - } - if (dwrq->value & IW_AUTH_WPA_VERSION_WPA2) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "WPA_VERSION, WPA2\n"); - priv->secinfo.WPA2enabled = 1; - priv->secinfo.wep_enabled = 0; - priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; - } - updated = 1; - break; - - case IW_AUTH_80211_AUTH_ALG: - if (dwrq->value & IW_AUTH_ALG_SHARED_KEY || - dwrq->value & IW_AUTH_ALG_OPEN_SYSTEM) - { - if(dwrq->value & IW_AUTH_ALG_SHARED_KEY ) - { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "80211_AUTH_ALG, SHARED_KEY\n"); - priv->secinfo.auth_mode |= IW_AUTH_ALG_SHARED_KEY; - } - if(dwrq->value & IW_AUTH_ALG_OPEN_SYSTEM) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "80211_AUTH_ALG, OPEN\n"); - priv->secinfo.auth_mode |= IW_AUTH_ALG_OPEN_SYSTEM; - } - } - else if(dwrq->value & IW_AUTH_ALG_LEAP) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "80211_AUTH_ALG, LEAP\n"); - priv->secinfo.auth_mode = IW_AUTH_ALG_LEAP; - } - else if(dwrq->value & IW_AUTH_ALG_WAPI) { - priv->secinfo.auth_mode = IW_AUTH_ALG_WAPI; - } - else{ - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "80211_AUTH_ALG, unknown\n"); - ret = -EINVAL; - } - updated = 1; - break; - - case IW_AUTH_WPA_ENABLED: - if (dwrq->value) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "WPA_ENABLED, value = 0x%x\n", dwrq->value); - if (!priv->secinfo.WPAenabled && - !priv->secinfo.WPA2enabled) { - priv->secinfo.WPAenabled = 1; - priv->secinfo.WPA2enabled = 1; - priv->secinfo.wep_enabled = 0; - priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; - } - } else { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "WPA_ENABLED, value = ZERO\n"); - priv->secinfo.WPAenabled = 0; - priv->secinfo.WPA2enabled = 0; - disable_wpa (priv); - } - updated = 1; - break; - - default: - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "NOT SUPPORT\n"); - ret = -EOPNOTSUPP; - break; - } - - if (ret == 0) { - if (updated) { - set_bit(ASSOC_FLAG_SECINFO, &priv->assoc_flags); - } - } - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return ret; -} - -static int rda5890_get_auth(struct net_device *dev, - struct iw_request_info *info, - struct iw_param *dwrq, - char *extra) -{ - struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - - switch (dwrq->flags & IW_AUTH_INDEX) { - case IW_AUTH_KEY_MGMT: - dwrq->value = priv->secinfo.key_mgmt; - break; - - case IW_AUTH_WPA_VERSION: - dwrq->value = 0; - if (priv->secinfo.WPAenabled) - dwrq->value |= IW_AUTH_WPA_VERSION_WPA; - if (priv->secinfo.WPA2enabled) - dwrq->value |= IW_AUTH_WPA_VERSION_WPA2; - if (!dwrq->value) - dwrq->value |= IW_AUTH_WPA_VERSION_DISABLED; - break; - - case IW_AUTH_80211_AUTH_ALG: - dwrq->value = priv->secinfo.auth_mode; - break; - - case IW_AUTH_WPA_ENABLED: - if (priv->secinfo.WPAenabled && priv->secinfo.WPA2enabled) - dwrq->value = 1; - break; - - default: - ret = -EOPNOTSUPP; - } - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - return ret; -} - -static int rda5890_set_txpow(struct net_device *dev, struct iw_request_info *info, - struct iw_param *vwrq, char *extra) -{ - //struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - return 0; -} - -static int rda5890_get_essid(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ - struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - - - memcpy(extra, priv->curbssparams.ssid, - strlen(priv->curbssparams.ssid)); - dwrq->length = strlen(priv->curbssparams.ssid); - extra[dwrq->length] = '\0'; - - /* - * If none, we may want to get the one that was set - */ - - dwrq->flags = 1; /* active */ - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>> \n", __func__); - return 0; -} - -void rda5890_indicate_disconnected(struct rda5890_private *priv) -{ - union iwreq_data wrqu; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_NORM, "%s <<<\n", __func__); - - memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN); - wrqu.ap_addr.sa_family = ARPHRD_ETHER; - wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); - - /*report disconnect to upper layer*/ - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_NORM, "%s >>>\n", __func__); -} - -void rda5890_indicate_connected(struct rda5890_private *priv) -{ - union iwreq_data wrqu; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_NORM, "%s <<<\n", __func__); - - memcpy(wrqu.ap_addr.sa_data, priv->curbssparams.bssid, ETH_ALEN); - wrqu.ap_addr.sa_family = ARPHRD_ETHER; - wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_NORM, "%s >>>\n", __func__); -} - -void rda5890_assoc_done_worker(struct work_struct *work) -{ - u8 bssid[6], zero_bssid[6]; - struct rda5890_private *priv = container_of(work, struct rda5890_private, - assoc_done_work.work); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<< \n", __func__); - - memset(bssid, 0, sizeof(bssid)); - memset(zero_bssid, 0, sizeof(zero_bssid)); - rda5890_get_bssid(priv, bssid); - - if(memcmp(bssid, zero_bssid, sizeof(zero_bssid))) - { - memcpy(priv->curbssparams.bssid, bssid, sizeof(bssid)); - } - - rda5890_get_rssi(priv, &priv->curbssparams.rssi); - priv->curbssparams.rssi = priv->curbssparams.rssi > 127? - priv->curbssparams.rssi - 271: priv->curbssparams.rssi - 15; - - rda5990_assoc_power_save(priv); - clear_bit(ASSOC_FLAG_ASSOC_START, &priv->assoc_flags); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); -} - -void rda5890_wlan_connect_worker(struct work_struct *work) -{ - struct rda5890_private *priv = container_of(work, struct rda5890_private, - wlan_connect_work.work); - - rda5890_set_txrate(priv, 0); - - if(priv) - clear_bit(ASSOC_FLAG_WLAN_CONNECTING ,&priv->assoc_flags); -} - -//imode -/* BIT0: 1 -> Security ON 0 -> OFF */ -/* BIT1: 1 -> WEP40 cypher supported 0 -> Not supported */ -/* BIT2: 1 -> WEP104 cypher supported 0 -> Not supported */ -/* BIT3: 1 -> WPA mode supported 0 -> Not supported */ -/* BIT4: 1 -> WPA2 (RSN) supported 0 -> Not supported */ -/* BIT5: 1 -> AES-CCMP cphr supported 0 -> Not supported */ -/* BIT6: 1 -> TKIP cypher supported 0 -> Not supported */ -/* BIT7: 1 -> TSN supported 0 -> Not supported */ - -//authtype -/* BIT0: 1 -> OPEN SYSTEM */ -/* BIT1: 1 -> SHARED KEY */ -/* BIT3: 1 -> WPA RSN 802.1x*/ -/* BIT7: 1 -> WAPI */ -static int assoc_helper_secinfo(struct rda5890_private *priv, - struct bss_descriptor *assoc_bss) -{ - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - - /* set imode and key */ - if ( !priv->secinfo.wep_enabled - && !priv->secinfo.WPAenabled - && !priv->secinfo.WPA2enabled) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "%s, NO SEC\n", __func__); - priv->imode = 0; - } else { - u16 key_len = 0; - u16 i; - if ( priv->secinfo.wep_enabled - && !priv->secinfo.WPAenabled - && !priv->secinfo.WPA2enabled) { - /* WEP */ - key_len = priv->wep_keys[0].len; - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "%s, WEP, len = %d\n", __func__, key_len * 8); - if (key_len == KEY_LEN_WEP_40) { - priv->imode = BIT0 | BIT1; - } - else if (key_len == KEY_LEN_WEP_104) { - priv->imode = BIT0 | BIT2; - } - else { - RDA5890_ERRP("Invalide WEP Key length %d\n", key_len); - ret = -EINVAL; - goto out; - } - } else if ( !priv->secinfo.wep_enabled - && (priv->secinfo.WPAenabled || - priv->secinfo.WPA2enabled)) { - /* WPA */ - struct enc_key * pkey = NULL; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "%s, WPA cp:%x \n", __func__, priv->secinfo.cipther_type); - - if ( priv->wpa_mcast_key.len - && (priv->wpa_mcast_key.flags & KEY_INFO_WPA_ENABLED)) - pkey = &priv->wpa_mcast_key; - else if ( priv->wpa_unicast_key.len - && (priv->wpa_unicast_key.flags & KEY_INFO_WPA_ENABLED)) - pkey = &priv->wpa_unicast_key; - - //priv->imode = assoc_bss->data.dot11i_info; - priv->imode = 0; - /* turn on security */ - priv->imode |= (BIT0); - priv->imode &= ~(BIT3 | BIT4); - if (priv->secinfo.WPA2enabled) - priv->imode |= (BIT4); - else if (priv->secinfo.WPAenabled) - priv->imode |= (BIT3); - /* - * we don't know the cipher type by now - * use dot11i_info to decide - * and use CCMP if possible - */ - priv->imode &= ~(BIT5 | BIT6); -#ifdef GET_SCAN_FROM_NETWORK_INFO - if (priv->secinfo.cipther_type & IW_AUTH_CIPHER_CCMP) - priv->imode |= BIT5; - else if (priv->secinfo.cipther_type & IW_AUTH_CIPHER_TKIP) - priv->imode |= BIT6; -#else - if (assoc_bss->data.dot11i_info & (BIT5)) - priv->imode |= BIT5; - else if (assoc_bss->data.dot11i_info & (BIT6)) - priv->imode |= BIT6; -#endif - } else { - RDA5890_ERRP("WEP and WPA/WPA2 enabled simutanously\n"); - ret = -EINVAL; - goto out; - } - } - - /* set authtype */ - if (priv->secinfo.auth_mode & IW_AUTH_ALG_OPEN_SYSTEM - || priv->secinfo.auth_mode & IW_AUTH_ALG_SHARED_KEY) - { - - if (priv->secinfo.auth_mode & IW_AUTH_ALG_OPEN_SYSTEM) - { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "%s, Open Auth, KEY_MGMT = %d, AUTH_ALG mode:%x\n", __func__, priv->secinfo.key_mgmt, priv->secinfo.auth_mode); - if (priv->secinfo.key_mgmt == 0x01) { - /* for 802.1x, set auth type to 0x04 */ - priv->authtype = BIT3; - } - else - { - priv->authtype = BIT0; - } - } - else if(priv->secinfo.auth_mode & IW_AUTH_ALG_SHARED_KEY) - { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "%s, Shared-Key Auth AUTH_ALG mode:%x \n", __func__, priv->secinfo.auth_mode); - priv->authtype = BIT1; - } - } - else if (priv->secinfo.auth_mode == IW_AUTH_ALG_WAPI) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "%s, Shared-Key Auth\n", __func__); - priv->authtype = IW_AUTH_ALG_WAPI; - } - else if (priv->secinfo.auth_mode == IW_AUTH_ALG_LEAP) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "%s, LEAP Auth, not supported\n", __func__); - ret = -EINVAL; - goto out; - } - else { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "%s, Unknown Auth\n", __func__); - ret = -EINVAL; - goto out; - } - -out: - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>> \n", __func__); - return ret; -} - -static struct bss_descriptor *get_bss_desc_from_scanlist( - struct rda5890_private *priv, unsigned char *ssid) -{ - struct bss_descriptor *iter_bss; - struct bss_descriptor *ret_bss = NULL; - /* report all bss to upper layer */ - list_for_each_entry (iter_bss, &priv->network_list, list) { -#ifdef GET_SCAN_FROM_NETWORK_INFO - if (strcmp(iter_bss->ssid, ssid) == 0) { -#else - if (strcmp(iter_bss->data.ssid, ssid) == 0) { -#endif - ret_bss = iter_bss; - break; - } - } - return ret_bss; -} - -void rda5890_assoc_worker(struct work_struct *work) -{ - static char old_imode = 0xff, old_bssid[6], assoc_count = 0; - struct rda5890_private *priv = container_of(work, struct rda5890_private, - assoc_work.work); - int ret = 0; - struct bss_descriptor *assoc_bss; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - assoc_bss = get_bss_desc_from_scanlist(priv, priv->assoc_ssid); - if (assoc_bss == NULL) { - RDA5890_ERRP("****fail to find bss in the scan list\n"); - ret = -EINVAL; - goto out; - } - -#ifdef GET_SCAN_FROM_NETWORK_INFO - if(assoc_bss->rssi > 200) - { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "assoc_bss rssi =%d > 200\n", assoc_bss->rssi); - rda5890_rssi_up_to_200(priv); - } -#else - if(assoc_bss->data.rssi > 200) - { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "assoc_bss rssi =%d > 200\n", assoc_bss->data.rssi); - rda5890_rssi_up_to_200(priv); - } -#endif -#ifdef GET_SCAN_FROM_NETWORK_INFO - priv->curbssparams.channel = assoc_bss->channel; - memcpy(priv->curbssparams.bssid, assoc_bss->bssid, ETH_ALEN); - memcpy(priv->curbssparams.ssid, assoc_bss->ssid,IW_ESSID_MAX_SIZE + 1); -#else - priv->curbssparams.channel = assoc_bss->data.channel; - memcpy(priv->curbssparams.bssid, assoc_bss->data.bssid, ETH_ALEN); - memcpy(priv->curbssparams.ssid, assoc_bss->data.ssid,IW_ESSID_MAX_SIZE + 1); -#endif - ret = assoc_helper_secinfo(priv, assoc_bss); - if (ret) { - RDA5890_ERRP("assoc_helper_secinfo fail, ret = %d\n", ret); - goto out; - } - - //if the bssid is same and the association is start then break out - if((old_imode == priv->imode) && !memcmp(old_bssid, priv->assoc_bssid,6)) - { - //WEP THE Second retry should change to shared key - if((old_imode == 3 || old_imode == 5) && assoc_count%2) - { - priv->authtype = BIT1; - } - assoc_count ++; - } - else - { - //save old bssid para - old_imode = priv->imode; - memcpy(old_bssid, priv->assoc_bssid, 6); - assoc_count = 0; - } - - set_bit(ASSOC_FLAG_ASSOC_START ,&priv->assoc_flags); - set_bit(ASSOC_FLAG_ASSOC_RETRY, &priv->assoc_flags); - - if((priv->imode == 3) || (priv->imode ==5)) - { - if(assoc_count > 5) - { - clear_bit(ASSOC_FLAG_ASSOC_RETRY, &priv->assoc_flags); - clear_bit(ASSOC_FLAG_ASSOC_START ,&priv->assoc_flags); - old_imode = 0xff; - } - } - else - { - if(assoc_count) - { - clear_bit(ASSOC_FLAG_ASSOC_RETRY, &priv->assoc_flags); - clear_bit(ASSOC_FLAG_ASSOC_START ,&priv->assoc_flags); - old_imode = 0xff; - } - } - - ret = rda5890_start_join(priv); - if (ret) { - RDA5890_ERRP("rda5890_set_ssid fail, ret = %d\n", ret); - goto out; - } - - if(test_bit(ASSOC_FLAG_ASSOC_RETRY, &priv->assoc_flags)) - { - queue_delayed_work(priv->work_thread, &priv->assoc_work, 3*HZ); - } - -out: - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<< \n", __func__); -} - -static int rda5890_set_essid(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ - struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - int ret = 0; - u8 ssid[IW_ESSID_MAX_SIZE + 1]; - u8 ssid_len = 0; - int in_ssid_len = dwrq->length; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - /* Check the size of the string */ - if (in_ssid_len > IW_ESSID_MAX_SIZE) { - ret = -E2BIG; - goto out; - } - - memset(&ssid, 0, sizeof(ssid)); - - if (!dwrq->flags || !in_ssid_len) { - /* "any" SSID requested; leave SSID blank */ - } else { - /* Specific SSID requested */ - memcpy(&ssid, extra, in_ssid_len); - ssid[in_ssid_len] = '\0'; - ssid_len = in_ssid_len; - } - - if (!ssid_len) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "requested any SSID\n"); - } else { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "requested SSID len = %d ssid:%s\n", - ssid_len, ssid); - } - - if(ssid_len) - { - memcpy(&priv->assoc_ssid[0], ssid, sizeof(ssid)); - priv->assoc_ssid_len = ssid_len; - } - - if(!test_bit(ASSOC_FLAG_SSID, &priv->assoc_flags)) - goto out; - - if(!test_bit(ASSOC_FLAG_ASSOC_RETRY, &priv->assoc_flags)) - { - if(ssid_len) - { - cancel_delayed_work(&priv->assoc_work); - queue_delayed_work(priv->work_thread, &priv->assoc_work, HZ/2); - } - } - -out: - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -/** - * @brief Connect to the AP or Ad-hoc Network with specific bssid - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param awrq A pointer to iw_param structure - * @param extra A pointer to extra data buf - * @return 0 --success, otherwise fail - */ -static int rda5890_set_wap(struct net_device *dev, struct iw_request_info *info, - struct sockaddr *awrq, char *extra) -{ - unsigned char * ap_addr = NULL; - struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - ap_addr = awrq->sa_data; - if(!test_bit(ASSOC_FLAG_ASSOC_RETRY, &priv->assoc_flags) - && !is_zero_eth_addr(ap_addr)) - { - cancel_delayed_work(&priv->assoc_work); - queue_delayed_work(priv->work_thread, &priv->assoc_work, HZ/2); - set_bit(ASSOC_FLAG_SSID, &priv->assoc_flags); - memcpy(priv->assoc_bssid, ap_addr, 6); - printk("rda5890_set_wap addr is not null \n"); - } - - if(is_zero_eth_addr(ap_addr)) - { - clear_bit(ASSOC_FLAG_SSID, &priv->assoc_flags); - disable_wep( priv); - disable_wpa(priv); - } - - - RDA5890_ERRP("%s <<< \n connect mac: %2x:%2x:%2x:%2x:%2x:%2x \n", __func__, - ap_addr[0],ap_addr[1],ap_addr[2],ap_addr[3],ap_addr[4],ap_addr[5]); - - return 0; -} - -static inline char *translate_scan(struct rda5890_private *priv, - struct iw_request_info *info, - char *start, char *stop, - struct bss_descriptor *bss_desc) -{ -#ifndef GET_SCAN_FROM_NETWORK_INFO - struct iw_event iwe; /* Temporary buffer */ - u8 snr; - struct rda5890_bss_descriptor *bss = &bss_desc->data; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "translate_scan, ssid = %s\n", bss->ssid); - - /* First entry *MUST* be the BSSID */ - iwe.cmd = SIOCGIWAP; - iwe.u.ap_addr.sa_family = ARPHRD_ETHER; - memcpy(iwe.u.ap_addr.sa_data, &bss->bssid, ETH_ALEN); - start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_ADDR_LEN); - - /* SSID */ - iwe.cmd = SIOCGIWESSID; - iwe.u.data.flags = 1; - iwe.u.data.length = strlen(bss->ssid); - start = iwe_stream_add_point(info, start, stop, &iwe, bss->ssid); - - /* Mode */ - iwe.cmd = SIOCGIWMODE; - //iwe.u.mode = bss->mode; - iwe.u.mode = IW_MODE_INFRA; - start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_UINT_LEN); - - /* Frequency */ - iwe.cmd = SIOCGIWFREQ; - iwe.u.freq.m = (2412 + 5 * (bss->channel - 1)) * 100000; - iwe.u.freq.e = 1; - start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_FREQ_LEN); - - /* Add quality statistics */ - iwe.cmd = IWEVQUAL; - iwe.u.qual.updated = IW_QUAL_ALL_UPDATED; - iwe.u.qual.level = bss->rssi > 127? bss->rssi - 271: bss->rssi - 15; - - snr = iwe.u.qual.level - RDA5890_NF_DEFAULT_SCAN_VALUE; - iwe.u.qual.qual = - (100 * RSSI_DIFF * RSSI_DIFF - (PERFECT_RSSI - snr) * - (15 * (RSSI_DIFF) + 62 * (PERFECT_RSSI - snr))) / - (RSSI_DIFF * RSSI_DIFF); - if (iwe.u.qual.qual > 100) - iwe.u.qual.qual = 100; - iwe.u.qual.noise = RDA5890_NF_DEFAULT_SCAN_VALUE; - start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_QUAL_LEN); - - /* Add encryption capability */ - iwe.cmd = SIOCGIWENCODE; - if (bss->dot11i_info & BIT0) { - iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; - } else { - iwe.u.data.flags = IW_ENCODE_DISABLED; - } - iwe.u.data.length = 0; - start = iwe_stream_add_point(info, start, stop, &iwe, bss->ssid); - -#if 0 - current_val = start + iwe_stream_lcp_len(info); - - iwe.cmd = SIOCGIWRATE; - iwe.u.bitrate.fixed = 0; - iwe.u.bitrate.disabled = 0; - iwe.u.bitrate.value = 0; - - for (j = 0; bss->rates[j] && (j < sizeof(bss->rates)); j++) { - /* Bit rate given in 500 kb/s units */ - iwe.u.bitrate.value = bss->rates[j] * 500000; - current_val = iwe_stream_add_value(info, start, current_val, - stop, &iwe, IW_EV_PARAM_LEN); - } - if ((bss->mode == IW_MODE_ADHOC) && priv->adhoccreate - && !lbs_ssid_cmp(priv->curbssparams.ssid, - priv->curbssparams.ssid_len, - bss->ssid, bss->ssid_len)) { - iwe.u.bitrate.value = 22 * 500000; - current_val = iwe_stream_add_value(info, start, current_val, - stop, &iwe, IW_EV_PARAM_LEN); - } - /* Check if we added any event */ - if ((current_val - start) > iwe_stream_lcp_len(info)) - start = current_val; -#endif - - memset(&iwe, 0, sizeof(iwe)); - if (bss_desc->wpa_ie_len) { - char buf[MAX_WPA_IE_LEN]; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "translate_scan, wpa_ie, len %d\n", bss_desc->wpa_ie_len); - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "%02x %02x %02x %02x ... ... %02x %02x %02x %02x\n", - bss_desc->wpa_ie[0], bss_desc->wpa_ie[1], - bss_desc->wpa_ie[2], bss_desc->wpa_ie[3], - bss_desc->wpa_ie[bss_desc->wpa_ie_len - 4], - bss_desc->wpa_ie[bss_desc->wpa_ie_len - 3], - bss_desc->wpa_ie[bss_desc->wpa_ie_len - 2], - bss_desc->wpa_ie[bss_desc->wpa_ie_len - 1]); - - memcpy(buf, bss_desc->wpa_ie, bss_desc->wpa_ie_len); - iwe.cmd = IWEVGENIE; - iwe.u.data.length = bss_desc->wpa_ie_len; - start = iwe_stream_add_point(info, start, stop, &iwe, buf); - } - - memset(&iwe, 0, sizeof(iwe)); - if (bss_desc->rsn_ie_len) { - char buf[MAX_WPA_IE_LEN]; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "translate_scan, rsn_ie, len %d\n", bss_desc->rsn_ie_len); - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "%02x %02x %02x %02x ... ... %02x %02x %02x %02x\n", - bss_desc->rsn_ie[0], bss_desc->rsn_ie[1], - bss_desc->rsn_ie[2], bss_desc->rsn_ie[3], - bss_desc->rsn_ie[bss_desc->rsn_ie_len - 4], - bss_desc->rsn_ie[bss_desc->rsn_ie_len - 3], - bss_desc->rsn_ie[bss_desc->rsn_ie_len - 2], - bss_desc->rsn_ie[bss_desc->rsn_ie_len - 1]); - - memcpy(buf, bss_desc->rsn_ie, bss_desc->rsn_ie_len); - iwe.cmd = IWEVGENIE; - iwe.u.data.length = bss_desc->rsn_ie_len; - start = iwe_stream_add_point(info, start, stop, &iwe, buf); - } - - return start; -#else - struct iw_event iwe; /* Temporary buffer */ - u8 snr; - struct bss_descriptor *bss = bss_desc; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "translate_scan, ssid = %s ssi=%d ssid_len=%d \n", bss->ssid, bss->rssi, bss->ssid_len); - - /* First entry *MUST* be the BSSID */ - iwe.cmd = SIOCGIWAP; - iwe.u.ap_addr.sa_family = ARPHRD_ETHER; - memcpy(iwe.u.ap_addr.sa_data, bss->bssid, ETH_ALEN); - start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_ADDR_LEN); - - /* SSID */ - iwe.cmd = SIOCGIWESSID; - iwe.u.data.flags = 1; - iwe.u.data.length = bss->ssid_len; - start = iwe_stream_add_point(info, start, stop, &iwe, bss->ssid); - - /* Mode */ - iwe.cmd = SIOCGIWMODE; - iwe.u.mode = bss->mode; - start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_UINT_LEN); - - /* Frequency */ - iwe.cmd = SIOCGIWFREQ; - iwe.u.freq.m = (2412 + 5 * (bss->channel - 1)) * 100000; - iwe.u.freq.e = 1; - start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_FREQ_LEN); - - /* Add quality statistics */ - iwe.cmd = IWEVQUAL; - iwe.u.qual.updated = IW_QUAL_ALL_UPDATED; - iwe.u.qual.level = bss->rssi > 127? bss->rssi - 271: bss->rssi - 15; - - snr = iwe.u.qual.level - RDA5890_NF_DEFAULT_SCAN_VALUE; - iwe.u.qual.qual = - (100 * RSSI_DIFF * RSSI_DIFF - (PERFECT_RSSI - snr) * - (15 * (RSSI_DIFF) + 62 * (PERFECT_RSSI - snr))) / - (RSSI_DIFF * RSSI_DIFF); - if (iwe.u.qual.qual > 100) - iwe.u.qual.qual = 100; - iwe.u.qual.noise = RDA5890_NF_DEFAULT_SCAN_VALUE; - start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_QUAL_LEN); - - /* Add encryption capability */ - iwe.cmd = SIOCGIWENCODE; - if (bss->capability & WLAN_CAPABILITY_PRIVACY) { - iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; - } else { - iwe.u.data.flags = IW_ENCODE_DISABLED; - } - iwe.u.data.length = 0; - start = iwe_stream_add_point(info, start, stop, &iwe, bss->ssid); - - memset(&iwe, 0, sizeof(iwe)); - if (bss_desc->wpa_ie_len && !bss_desc->wapi_ie_len) { - char buf[MAX_WPA_IE_LEN]; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "translate_scan, wpa_ie, len %d\n", bss_desc->wpa_ie_len); - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "%02x %02x %02x %02x ... ... %02x %02x %02x %02x\n", - bss_desc->wpa_ie[0], bss_desc->wpa_ie[1], - bss_desc->wpa_ie[2], bss_desc->wpa_ie[3], - bss_desc->wpa_ie[bss_desc->wpa_ie_len - 4], - bss_desc->wpa_ie[bss_desc->wpa_ie_len - 3], - bss_desc->wpa_ie[bss_desc->wpa_ie_len - 2], - bss_desc->wpa_ie[bss_desc->wpa_ie_len - 1]); - - memcpy(buf, bss->wpa_ie, bss->wpa_ie_len); - iwe.cmd = IWEVGENIE; - iwe.u.data.length = bss_desc->wpa_ie_len; - start = iwe_stream_add_point(info, start, stop, &iwe, buf); - } - - memset(&iwe, 0, sizeof(iwe)); - if (bss_desc->rsn_ie_len && !bss_desc->wapi_ie_len) { - char buf[MAX_WPA_IE_LEN]; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "translate_scan, rsn_ie, len %d\n", bss_desc->rsn_ie_len); - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "%02x %02x %02x %02x ... ... %02x %02x %02x %02x\n", - bss_desc->rsn_ie[0], bss_desc->rsn_ie[1], - bss_desc->rsn_ie[2], bss_desc->rsn_ie[3], - bss_desc->rsn_ie[bss_desc->rsn_ie_len - 4], - bss_desc->rsn_ie[bss_desc->rsn_ie_len - 3], - bss_desc->rsn_ie[bss_desc->rsn_ie_len - 2], - bss_desc->rsn_ie[bss_desc->rsn_ie_len - 1]); - - memcpy(buf, bss->rsn_ie, bss->rsn_ie_len); - iwe.cmd = IWEVGENIE; - iwe.u.data.length = bss_desc->rsn_ie_len; - start = iwe_stream_add_point(info, start, stop, &iwe, buf); - } - - memset(&iwe, 0, sizeof(iwe)); - if (bss_desc->wapi_ie_len) { - char buf[100]; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "translate_scan, wapi_len %d\n", bss_desc->wapi_ie_len); - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "%02x %02x %02x %02x ... ... %02x %02x %02x %02x\n", - bss_desc->wapi_ie[0], bss_desc->wapi_ie[1], - bss_desc->wapi_ie[2], bss_desc->wapi_ie[3], - bss_desc->wapi_ie[bss_desc->wapi_ie_len - 4], - bss_desc->wapi_ie[bss_desc->wapi_ie_len - 3], - bss_desc->wapi_ie[bss_desc->wapi_ie_len - 2], - bss_desc->wapi_ie[bss_desc->wapi_ie_len - 1]); - - memcpy(buf, bss->wapi_ie, bss->wapi_ie_len); - iwe.cmd = IWEVGENIE; - iwe.u.data.length = bss_desc->wapi_ie_len; - start = iwe_stream_add_point(info, start, stop, &iwe, buf); - } - - return start; -#endif -} - -int is_same_network(struct bss_descriptor *src, - struct bss_descriptor *dst) -{ - /* A network is only a duplicate if the channel, BSSID, and ESSID - * all match. We treat all with the same BSSID and channel - * as one network */ -#ifndef GET_SCAN_FROM_NETWORK_INFO - return ((src->data.channel == dst->data.channel) && - !compare_ether_addr(src->data.bssid, dst->data.bssid) && - !memcmp(src->data.ssid, dst->data.ssid, IW_ESSID_MAX_SIZE)); -#else - return ((src->channel == dst->channel) && - !compare_ether_addr(src->bssid, dst->bssid) && - !memcmp(src->ssid, dst->ssid, IW_ESSID_MAX_SIZE)); -#endif -} - -void clear_bss_descriptor(struct bss_descriptor *bss) -{ - /* Don't blow away ->list, just BSS data */ - memset(bss, 0, offsetof(struct bss_descriptor, list)); -} - -static void dump_bss_desc(struct rda5890_bss_descriptor *bss_desc) -{ - RDA5890_DBGP("########## dump bss ##########\n"); - RDA5890_DBGP("ssid = %s\n", bss_desc->ssid); - RDA5890_DBGP("bss_type = %d\n", bss_desc->bss_type); - RDA5890_DBGP("channel = %d\n", bss_desc->channel); - RDA5890_DBGP("dot11i_info = 0x%02x\n", bss_desc->dot11i_info); - RDA5890_DBGP("bssid = %02x:%02x:%02x:%02x:%02x:%02x\n", - bss_desc->bssid[0], bss_desc->bssid[1], bss_desc->bssid[2], - bss_desc->bssid[3], bss_desc->bssid[4], bss_desc->bssid[5]); - RDA5890_DBGP("rssi = %d\n", (char)bss_desc->rssi); - RDA5890_DBGP("auth_info = 0x%02x\n", bss_desc->auth_info); - RDA5890_DBGP("rsn_cap = 0x%04x\n", - (bss_desc->rsn_cap[1] << 8) | bss_desc->rsn_cap[0]); - RDA5890_DBGP("########## dump bss ##########\n"); -} - -/* Element Ids used in Management frames in 802.11i mode */ -typedef enum{ IRSNELEMENT = 48, /* RSN Information Element */ - IWPAELEMENT = 221 /* WPA Information Element */ -}ELEMENTID_11I_T; - -/* CIPHER set for RSN or WPA element */ -typedef enum { CIPHER_TYPE_USE_GROUP_SET = 0, - CIPHER_TYPE_WEP40 = 1, - CIPHER_TYPE_TKIP = 2, - CIPHER_TYPE_CCMP = 4, - CIPHER_TYPE_WEP104 = 5 -} CIPHER_TYPE_T; - -unsigned char oui_rsn[3] = {0x00, 0x0F, 0xAC}; -unsigned char oui_wpa[3] = {0x00, 0x50, 0xf2}; - -static void fill_rsn_wpa_ie(unsigned char *data, unsigned char ie_type, - struct rda5890_bss_descriptor *bss, size_t *len) -{ - unsigned char index = 0; - unsigned char *oui; - - if (ie_type == IRSNELEMENT) { - oui = &oui_rsn[0]; - - /* Set RSN Information Element element ID */ - data[index] = IRSNELEMENT; - index += 2; - } - else { - oui = &oui_wpa[0]; - - /* Set WPA Information Element element ID */ - data[index] = IWPAELEMENT; - index += 2; - - /* Copy OUI */ - memcpy(&data[index], oui, 3); - index += 3; - data[index++] = 0x01; - } - - /* Set the version of RSN Element to 1 */ - data[index++] = 1; - data[index++] = 0; - - /* Set Group Cipher Suite */ - memcpy(&data[index], oui, 3); - index += 3; - if ((bss->dot11i_info & BIT5) && !(bss->dot11i_info & BIT6)) { - /* only CCMP and !TKIP, use CCMP, otherwise, always TKIP */ - data[index++] = CIPHER_TYPE_CCMP; - } - else { - data[index++] = CIPHER_TYPE_TKIP; - } - - /* Set Pairwise cipher Suite */ - if ((bss->dot11i_info & BIT5) && (bss->dot11i_info & BIT6)) { - /* both CCMP and TKIP */ - data[index++] = 2; - data[index++] = 0; - - /* Check BIT7 to determine who goes first */ - if (bss->dot11i_info & BIT7) { - /* BIT7 is 1 => CCMP goes first */ - memcpy(&data[index], oui, 3); - index += 3; - data[index++] = CIPHER_TYPE_CCMP; - - memcpy(&data[index], oui, 3); - index += 3; - data[index++] = CIPHER_TYPE_TKIP; - } - else { - /* BIT7 is 0 => TKIP goes first */ - memcpy(&data[index], oui, 3); - index += 3; - data[index++] = CIPHER_TYPE_TKIP; - - memcpy(&data[index], oui, 3); - index += 3; - data[index++] = CIPHER_TYPE_CCMP; - } - } - else if ((bss->dot11i_info & BIT5) && !(bss->dot11i_info & BIT6)) { - /* CCMP and !TKIP */ - data[index++] = 1; - data[index++] = 0; - - memcpy(&data[index], oui, 3); - index += 3; - data[index++] = CIPHER_TYPE_CCMP; - } - else if (!(bss->dot11i_info & BIT5) && (bss->dot11i_info & BIT6)) { - /* !CCMP and TKIP */ - data[index++] = 1; - data[index++] = 0; - - memcpy(&data[index], oui, 3); - index += 3; - data[index++] = CIPHER_TYPE_TKIP; - } - else { - /* neither CCMP nor TKIP, use TKIP for WPA, and CCMP for RSN */ - data[index++] = 1; - data[index++] = 0; - - memcpy(&data[index], oui, 3); - index += 3; - if (ie_type == IRSNELEMENT) { - data[index++] = CIPHER_TYPE_CCMP; - } - else { - data[index++] = CIPHER_TYPE_TKIP; - } - } - - /* Set Authentication Suite */ - if ((bss->auth_info & 0x01) && (bss->auth_info & 0x02)) { - /* both 802.1X and PSK */ - data[index++] = 2; - data[index++] = 0; - - memcpy(&data[index], oui, 3); - index += 3; - data[index++] = 0x01; - - memcpy(&data[index], oui, 3); - index += 3; - data[index++] = 0x02; - } - else if ((bss->auth_info & 0x01) && !(bss->auth_info & 0x02)) { - /* 802.1X and !PSK */ - data[index++] = 1; - data[index++] = 0; - - memcpy(&data[index], oui, 3); - index += 3; - data[index++] = 0x01; - } - else if (!(bss->auth_info & 0x01) && (bss->auth_info & 0x02)) { - /* !802.1X and PSK */ - data[index++] = 1; - data[index++] = 0; - - memcpy(&data[index], oui, 3); - index += 3; - data[index++] = 0x02; - } - else { - /* neither 802.1X nor PSK, use 802.1X */ - data[index++] = 1; - data[index++] = 0; - - memcpy(&data[index], oui, 3); - index += 3; - data[index++] = 0x01; - } - - /* The RSN Capabilities, for RSN IE only */ - if (ie_type == IRSNELEMENT) { - data[index++] = bss->rsn_cap[0]; - data[index++] = bss->rsn_cap[1]; - } - - /* Set the length of the RSN Information Element */ - data[1] = (index - 2); - - /* Return the Extended Supported Rates element length */ - *len = (size_t)index; -} - -/* reconstruct wpa/rsn ie from the dot11i_info and auth_info fields */ -/* TODO: - * assuming RSN and WPA are using same cipher suite, no space to store each - * assuming grp and unicast are using same cipher suite - */ -static void reconstruct_rsn_wpa_ie(struct bss_descriptor *bss_desc) -{ - bss_desc->wpa_ie_len = 0; - bss_desc->rsn_ie_len = 0; - - if (bss_desc->data.dot11i_info & BIT0) { - if (bss_desc->data.dot11i_info & BIT3) { - /* WPA IE present */ - fill_rsn_wpa_ie(&bss_desc->wpa_ie[0], IWPAELEMENT, - &bss_desc->data, &bss_desc->wpa_ie_len); - } - - if (bss_desc->data.dot11i_info & BIT4) { - /* RSN IE present */ - fill_rsn_wpa_ie(&bss_desc->rsn_ie[0], IRSNELEMENT, - &bss_desc->data, &bss_desc->rsn_ie_len); - } - } - else { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "form_rsn_ie, NO SEC\n"); - } -} - -void rda5890_scan_worker(struct work_struct *work) -{ - struct rda5890_private *priv = container_of(work, struct rda5890_private, - scan_work.work); - int ret = 0; - struct rda5890_bss_descriptor bss_desc[RDA5890_MAX_NETWORK_NUM]; - int bss_index, bss_count; - struct bss_descriptor *iter_bss; - union iwreq_data wrqu; - unsigned char fist_send = 0; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - if(test_bit(ASSOC_FLAG_ASSOC_START, &priv->assoc_flags) - || test_bit(ASSOC_FLAG_WLAN_CONNECTING, &priv->assoc_flags)) - { - cancel_delayed_work(&priv->scan_work); - queue_delayed_work(priv->work_thread, &priv->scan_work, HZ/2); - return; - } - - priv->scan_running = 1; - -#ifdef WIFI_UNLOCK_SYSTEM - rda5990_wakeLock(); -#endif - -#ifdef GET_SCAN_FROM_NETWORK_INFO - ret = rda5890_start_scan_enable_network_info(priv); -#else - ret = rda5890_start_scan(priv); -#endif - if (ret) { - RDA5890_ERRP("rda5890_start_scan fail, ret = %d\n", ret); - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "SCANNING ...\n"); - /* TODO: delay 2 sec for now, need to be put into a worker */ - rda5890_shedule_timeout(1500); - -#ifndef GET_SCAN_FROM_NETWORK_INFO -retry: - bss_count = rda5890_get_scan_results(priv, bss_desc); - - fist_send = (bss_count >> 8) & 0xff; - bss_count &= 0xff; - if (bss_count < 0 || bss_count >= RDA5890_MAX_NETWORK_NUM) { - RDA5890_ERRP("rda5890_get_scan_results fail, ret = %d\n", bss_count); - goto out; - } - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Get Scan Result, count = %d, fist_send= %d \n", bss_count, fist_send); - - /* add scaned bss into list */ - for(bss_index = 0; bss_index < bss_count; bss_index++) { - struct bss_descriptor new; - struct bss_descriptor *found = NULL; - struct bss_descriptor *oldest = NULL; - - if (RDA5890_DBGLA(RDA5890_DA_WEXT, RDA5890_DL_TRACE)) - dump_bss_desc(&bss_desc[bss_index]); - - memcpy(&new.data, &bss_desc[bss_index], sizeof(struct rda5890_bss_descriptor)); - reconstruct_rsn_wpa_ie(&new); - new.last_scanned = jiffies; - - /* Try to find this bss in the scan table */ - list_for_each_entry (iter_bss, &priv->network_list, list) { - if (is_same_network(iter_bss, &new)) { - found = iter_bss; - break; - } - - if ((oldest == NULL) || - (iter_bss->last_scanned < oldest->last_scanned)) - oldest = iter_bss; - } - - if (found) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "FOUND SAME %s, update\n", found->data.ssid); - /* found, clear it */ - clear_bss_descriptor(found); - } else if (!list_empty(&priv->network_free_list)) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "FOUND NEW %s, add\n", new.data.ssid); - /* Pull one from the free list */ - found = list_entry(priv->network_free_list.next, - struct bss_descriptor, list); - list_move_tail(&found->list, &priv->network_list); - } else if (oldest) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "FOUND NEW %s, no space, replace oldest %s\n", - new.data.ssid, oldest->data.ssid); - /* If there are no more slots, expire the oldest */ - found = oldest; - clear_bss_descriptor(found); - list_move_tail(&found->list, &priv->network_list); - } else { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "FOUND NEW but no space to store\n"); - } - - /* Copy the locally created newbssentry to the scan table */ - memcpy(found, &new, offsetof(struct bss_descriptor, list)); - } - - if(bss_count >= 5 && !fist_send) - goto retry; - -#else - //do noting in get network info modle - -#endif - -out: - priv->scan_running = 0; - memset(&wrqu, 0, sizeof(union iwreq_data)); - wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - -#ifdef WIFI_UNLOCK_SYSTEM - rda5990_wakeUnlock(); -#endif -} - -/** - * @brief Handle Scan Network ioctl - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param vwrq A pointer to iw_param structure - * @param extra A pointer to extra data buf - * - * @return 0 --success, otherwise fail - */ -int rda5890_set_scan(struct net_device *dev, struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - if (priv->scan_running) - goto out; - - - cancel_delayed_work(&priv->scan_work); - queue_delayed_work(priv->work_thread, &priv->scan_work, HZ/50); - -out: - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return 0; -} - -/** - * @brief Handle Retrieve scan table ioctl - * - * @param dev A pointer to net_device structure - * @param info A pointer to iw_request_info structure - * @param dwrq A pointer to iw_point structure - * @param extra A pointer to extra data buf - * - * @return 0 --success, otherwise fail - */ -int rda5890_get_scan(struct net_device *dev, struct iw_request_info *info, - struct iw_point *dwrq, char *extra) -{ -#define SCAN_ITEM_SIZE 128 - struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - int ret = 0; - struct bss_descriptor *iter_bss; - struct bss_descriptor *safe; - char *ev = extra; - char *stop = ev + dwrq->length; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - /* iwlist should wait until the current scan is finished */ - if (priv->scan_running) { - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "Scan is Running, return AGAIN\n"); - return -EAGAIN; - } - - /* report all bss to upper layer */ - list_for_each_entry_safe (iter_bss, safe, &priv->network_list, list) { - char *next_ev; - unsigned long stale_time; - - if (stop - ev < SCAN_ITEM_SIZE) { - ret = -E2BIG; - break; - } - - /* Prune old an old scan result */ - stale_time = iter_bss->last_scanned + DEFAULT_MAX_SCAN_AGE; - if (time_after(jiffies, stale_time)) { - list_move_tail(&iter_bss->list, &priv->network_free_list); -#ifdef GET_SCAN_FROM_NETWORK_INFO - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "Prune Old Bss %s\n", iter_bss->ssid); -#else - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "Prune Old Bss %s\n", iter_bss->ssid); -#endif - clear_bss_descriptor(iter_bss); - continue; - } - - /* Translate to WE format this entry */ - next_ev = translate_scan(priv, info, ev, stop, iter_bss); -#ifdef GET_SCAN_FROM_NETWORK_INFO - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "Report BSS %s\n", iter_bss->ssid); -#else - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "Report BSS %s\n", iter_bss->data.ssid); -#endif - if (next_ev == NULL) - continue; - ev = next_ev; - } - dwrq->length = (ev - extra); - dwrq->flags = 0; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return ret; -} - -int rda5890_set_mlme(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - //struct rda5890_private *priv = (struct rda5890_private *)netdev_priv(dev); - struct iw_mlme *mlme = (struct iw_mlme *)extra; - int ret = 0; - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s >>>\n", __func__); - - switch (mlme->cmd) { - case IW_MLME_DEAUTH: - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "DEAUTH\n"); - /* silently ignore */ - break; - - case IW_MLME_DISASSOC: - { - unsigned char ssid[6]; - memset(ssid, 0, 6); - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "DISASSOC\n"); - /* silently ignore */ - rda5890_set_ssid((struct rda5890_private *)netdev_priv(dev) , ssid, 6); - } - break; - default: - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, - "Not supported cmd %d\n", mlme->cmd); - ret = -EOPNOTSUPP; - } - - RDA5890_DBGLAP(RDA5890_DA_WEXT, RDA5890_DL_TRACE, "%s <<<\n", __func__); - return ret; -} - -/* - * iwconfig settable callbacks - */ -static const iw_handler rda5890_wext_handler[] = { - (iw_handler) NULL, /* SIOCSIWCOMMIT */ - (iw_handler) rda5890_get_name, /* SIOCGIWNAME */ - (iw_handler) NULL, /* SIOCSIWNWID */ - (iw_handler) NULL, /* SIOCGIWNWID */ - (iw_handler) rda5890_set_freq, /* SIOCSIWFREQ */ - (iw_handler) rda5890_get_freq, /* SIOCGIWFREQ */ - (iw_handler) rda5890_set_mode, /* SIOCSIWMODE */ - (iw_handler) rda5890_get_mode, /* SIOCGIWMODE */ - (iw_handler) NULL, /* SIOCSIWSENS */ - (iw_handler) NULL, /* SIOCGIWSENS */ - (iw_handler) NULL, /* SIOCSIWRANGE */ - (iw_handler) rda5890_get_range, /* SIOCGIWRANGE */ - (iw_handler) NULL, /* SIOCSIWPRIV */ - (iw_handler) NULL, /* SIOCGIWPRIV */ - (iw_handler) NULL, /* SIOCSIWSTATS */ - (iw_handler) NULL, /* SIOCGIWSTATS */ - (iw_handler) NULL, /* SIOCSIWSPY */ - (iw_handler) NULL, /* SIOCGIWSPY */ - (iw_handler) NULL, /* SIOCSIWTHRSPY */ - (iw_handler) NULL, /* SIOCGIWTHRSPY */ - (iw_handler) rda5890_set_wap, /* SIOCSIWAP */ - (iw_handler) rda5890_get_wap, /* SIOCGIWAP */ - (iw_handler) rda5890_set_mlme, /* SIOCSIWMLME */ - (iw_handler) NULL, /* SIOCGIWAPLIST - deprecated */ - (iw_handler) rda5890_set_scan, /* SIOCSIWSCAN */ - (iw_handler) rda5890_get_scan, /* SIOCGIWSCAN */ - (iw_handler) rda5890_set_essid, /* SIOCSIWESSID */ - (iw_handler) rda5890_get_essid, /* SIOCGIWESSID */ - (iw_handler) rda5890_set_nick, /* SIOCSIWNICKN */ - (iw_handler) rda5890_get_nick, /* SIOCGIWNICKN */ - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) rda5890_set_rate, /* SIOCSIWRATE */ - (iw_handler) rda5890_get_rate, /* SIOCGIWRATE */ - (iw_handler) rda5890_set_rts, /* SIOCSIWRTS */ - (iw_handler) rda5890_get_rts, /* SIOCGIWRTS */ - (iw_handler) rda5890_set_frag, /* SIOCSIWFRAG */ - (iw_handler) rda5890_get_frag, /* SIOCGIWFRAG */ - (iw_handler) rda5890_set_txpow, /* SIOCSIWTXPOW */ - (iw_handler) rda5890_get_txpow, /* SIOCGIWTXPOW */ - (iw_handler) rda5890_set_retry, /* SIOCSIWRETRY */ - (iw_handler) rda5890_get_retry, /* SIOCGIWRETRY */ - (iw_handler) rda5890_set_encode, /* SIOCSIWENCODE */ - (iw_handler) rda5890_get_encode, /* SIOCGIWENCODE */ - (iw_handler) rda5890_set_power, /* SIOCSIWPOWER */ - (iw_handler) rda5890_get_power, /* SIOCGIWPOWER */ - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) NULL, /* -- hole -- */ - (iw_handler) rda5890_set_genie, /* SIOCSIWGENIE */ - (iw_handler) rda5890_get_genie, /* SIOCGIWGENIE */ - (iw_handler) rda5890_set_auth, /* SIOCSIWAUTH */ - (iw_handler) rda5890_get_auth, /* SIOCGIWAUTH */ - (iw_handler) rda5890_set_encodeext,/* SIOCSIWENCODEEXT */ - (iw_handler) rda5890_get_encodeext,/* SIOCGIWENCODEEXT */ - (iw_handler) rda5890_set_pmksa, /* SIOCSIWPMKSA */ -}; - -struct iw_handler_def rda5890_wext_handler_def = { - .num_standard = ARRAY_SIZE(rda5890_wext_handler), - .standard = (iw_handler *) rda5890_wext_handler, - .get_wireless_stats = rda5890_get_wireless_stats, -}; - diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_wext.h b/drivers/net/wireless/rda5990/rda_wlan/rda5890_wext.h deleted file mode 100755 index 35ff2f7c8780..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_wext.h +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This file contains definition for IOCTL call. - */ -#include "rda5890_defs.h" -#ifndef _RDA5890_WEXT_H_ -#define _RDA5890_WEXT_H_ - -#ifndef DEFAULT_MAX_SCAN_AGE -#define DEFAULT_MAX_SCAN_AGE (15*HZ) -#ifdef GET_SCAN_FROM_NETWORK_INFO -#else -#define DEFAULT_MAX_SCAN_AGE (15*HZ) -#endif -#else -#undef DEFAULT_MAX_SCAN_AGE -#ifdef GET_SCAN_FROM_NETWORK_INFO -#define DEFAULT_MAX_SCAN_AGE (15*HZ) -#else -#define DEFAULT_MAX_SCAN_AGE (15*HZ) -#endif -#endif - -extern struct iw_handler_def rda5890_wext_handler_def; - -void rda5890_indicate_disconnected(struct rda5890_private *priv); -void rda5890_indicate_connected(struct rda5890_private *priv); -void rda5890_assoc_done_worker(struct work_struct *work); -void rda5890_assoc_worker(struct work_struct *work); -void rda5890_scan_worker(struct work_struct *work); -void rda5890_wlan_connect_worker(struct work_struct *work); - -static inline unsigned char is_zero_eth_addr(unsigned char * addr) -{ - return !(addr[0] | addr[1] |addr[2] |addr[3] |addr[4] |addr[5]); -} - -#endif diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_wid.c b/drivers/net/wireless/rda5990/rda_wlan/rda5890_wid.c deleted file mode 100755 index 1a1fc1d6de83..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_wid.c +++ /dev/null @@ -1,1957 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "rda5890_defs.h" -#include "rda5890_dev.h" -#include "rda5890_wid.h" -#include "rda5890_wext.h" -#include "rda5890_txrx.h" -#include "rda5890_if_sdio.h" - -static unsigned char is_need_set_notch = 0; - -/* for both Query and Write */ -int rda5890_wid_request(struct rda5890_private *priv, - char *wid_req, unsigned short wid_req_len, - char *wid_rsp, unsigned short *wid_rsp_len) -{ - int ret = 0; - int timeleft = 0; - char data_buf[RDA5890_MAX_WID_LEN + 2]; - unsigned short data_len; - struct if_sdio_card * card = (struct if_sdio_card *)priv->card; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); - -#ifdef WIFI_TEST_MODE - if(rda_5990_wifi_in_test_mode()) - return 0; -#endif //end WIFI_TEST_MODE - - mutex_lock(&priv->wid_lock); - priv->wid_rsp = wid_rsp; - priv->wid_rsp_len = *wid_rsp_len; - priv->wid_pending = 1; - - data_len = wid_req_len + 2; - data_buf[0] = (char)(data_len&0xFF); - data_buf[1] = (char)((data_len>>8)&0x0F); - data_buf[1] |= 0x40; // for Request(Q/W) 0x4 - memcpy(data_buf + 2, wid_req, wid_req_len); - - init_completion(&priv->wid_done); -#ifdef WIFI_UNLOCK_SYSTEM - rda5990_wakeLock(); -#endif - ret = rda5890_host_to_card(priv, data_buf, data_len, WID_REQUEST_PACKET); - if (ret) { - RDA5890_ERRP("host_to_card send failed, ret = %d\n", ret); - priv->wid_pending = 0; - goto out; - } - - atomic_inc(&card->wid_complete_flag); - timeleft = wait_for_completion_timeout(&priv->wid_done, msecs_to_jiffies(450)); - if (timeleft == 0) { - RDA5890_ERRP("respose timeout wid :%x %x \n", wid_req[4], wid_req[5]); - priv->wid_pending = 0; - ret = -EFAULT; - goto out; - } - - *wid_rsp_len = priv->wid_rsp_len; - -out: - mutex_unlock(&priv->wid_lock); - atomic_set(&card->wid_complete_flag, 0); - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s >>> wid: %x %x \n", __func__, wid_req[4],wid_req[5]); -#ifdef WIFI_UNLOCK_SYSTEM - rda5990_wakeUnlock(); -#endif - return ret; -} - -int rda5890_wid_request_polling(struct rda5890_private *priv, - char *wid_req, unsigned short wid_req_len, - char *wid_rsp, unsigned short *wid_rsp_len) -{ - int ret = -1; - int timeleft = 0; - char data_buf[RDA5890_MAX_WID_LEN + 2]; - unsigned short data_len; - unsigned char status; - unsigned int retry = 0, count = 0; - struct if_sdio_card * card = (struct if_sdio_card*)priv->card; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - priv->wid_rsp = wid_rsp; - priv->wid_rsp_len = *wid_rsp_len; - - data_len = wid_req_len + 2; - data_buf[0] = (char)(data_len&0xFF); - data_buf[1] = (char)((data_len>>8)&0x0F); - data_buf[1] |= 0x40; // for Request(Q/W) 0x4 - memcpy(data_buf + 2, wid_req, wid_req_len); - -re_send: - - count += 1; - ret = rda5890_host_to_card(priv, data_buf, data_len, WID_REQUEST_POLLING_PACKET); - if (ret) { - RDA5890_ERRP("host_to_card send failed, ret = %d\n", ret); - goto out; - } - - rda5890_shedule_timeout(3); //3ms delay - while(retry < 20) - { - sdio_claim_host(card->func); - status = sdio_readb(card->func, IF_SDIO_FUN1_INT_STAT, &ret); - sdio_release_host(card->func); - if (ret) - goto out; - - if (status & IF_SDIO_INT_AHB2SDIO) - { - int ret = 0; - u8 size_l = 0, size_h = 0; - u16 size, chunk; - - sdio_claim_host(card->func); - size_l = sdio_readb(card->func, IF_SDIO_AHB2SDIO_PKTLEN_L, &ret); - sdio_release_host(card->func); - if (ret) { - RDA5890_ERRP("read PKTLEN_L reg fail\n"); - goto out; - } - else - RDA5890_ERRP("read PKTLEN_L reg size_l:%d \n", size_l); - - sdio_claim_host(card->func); - size_h = sdio_readb(card->func, IF_SDIO_AHB2SDIO_PKTLEN_H, &ret); - sdio_release_host(card->func); - if (ret) { - RDA5890_ERRP("read PKTLEN_H reg fail\n"); - goto out; - } - else - RDA5890_ERRP("read PKTLEN_H reg size_h:%d\n",size_h); - - size = (size_l | ((size_h & 0x7f) << 8)) * 4; - if (size < 4) { - RDA5890_ERRP("invalid packet size (%d bytes) from firmware\n", size); - ret = -EINVAL; - goto out; - } - - /* alignment is handled on firmside */ - //chunk = sdio_align_size(card->func, size); - chunk = size; - - RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_NORM, - "if_sdio_card_to_host, size = %d, aligned size = %d\n", size, chunk); - - /* TODO: handle multiple packets here */ - sdio_claim_host(card->func); - ret = sdio_readsb(card->func, card->buffer, IF_SDIO_FUN1_FIFO_RD, chunk); - sdio_release_host(card->func); - if (ret) { - RDA5890_ERRP("sdio_readsb fail, ret = %d\n", ret); - goto out; - } -#if 1 - if(priv->version == 7) - sdio_writeb(card->func, 0x20 ,IF_SDIO_FUN1_INT_PEND, &ret); -#endif - - /* TODO: this chunk size need to be handled here */ - { - unsigned char rx_type; - unsigned short rx_length; - unsigned char msg_type; - unsigned char *packet = (unsigned char *)card->buffer; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - rx_type = (unsigned char)packet[1]&0xF0; - rx_length = (unsigned short)(packet[0] + ((packet[1]&0x0f) << 8)); - - if (rx_length > chunk) { - RDA5890_ERRP("packet_len %d less than header specified length %d\n", - chunk, rx_length); - goto out; - } - - if( rx_type == 0x30 ) - { - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_NORM, - "Message Packet type =%x \n", msg_type); - msg_type = packet[2]; - - if (msg_type == 'R') - { - packet += 2; - if(priv->wid_msg_id - 1 == packet[1]) - { - ret = 0; - if(priv->wid_rsp_len > rx_length - 2) - { - priv->wid_rsp_len = rx_length - 2; - memcpy(priv->wid_rsp, packet, rx_length -2); - } - break; - } - else - RDA5890_ERRP("rda5890_wid_request_polling wid_msg_id is wrong %d %d wid=%x \n", priv->wid_msg_id -1, packet[1], (packet[4] | (packet[5] << 8))); - } - } - } - } - - rda5890_shedule_timeout(3); //3ms delay - ret = -1; - retry ++; - } - - if(ret < 0 && count <= 3) - goto re_send; -out: - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s <<< wid: %x %x retry: %d count = %d \n", __func__, wid_req[4],wid_req[5], retry, count); - - return ret; -} -void rda5890_wid_response(struct rda5890_private *priv, - char *wid_rsp, unsigned short wid_rsp_len) -{ - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - if (!priv->wid_pending) { - RDA5890_ERRP("no wid pending\n"); - return; - } - - if (wid_rsp_len > priv->wid_rsp_len) { - RDA5890_ERRP("not enough space for wid response, size = %d, buf = %d\n", - wid_rsp_len, priv->wid_rsp_len); - complete(&priv->wid_done); - return; - } - - memcpy(priv->wid_rsp, wid_rsp, wid_rsp_len); - priv->wid_rsp_len = wid_rsp_len; - priv->wid_pending = 0; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); - - complete(&priv->wid_done); -} - -void rda5890_wid_status(struct rda5890_private *priv, - char *wid_status, unsigned short wid_status_len) -{ - char mac_status; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - -#ifdef WIFI_UNLOCK_SYSTEM - rda5990_wakeLock(); -#endif - - mac_status = wid_status[7]; - if (mac_status == MAC_CONNECTED) { - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_CRIT, - "MAC CONNECTED\n"); - - priv->connect_status = MAC_CONNECTED; - netif_carrier_on(priv->dev); - netif_wake_queue(priv->dev); - rda5890_indicate_connected(priv); - - priv->first_init = 0; - cancel_delayed_work(&priv->assoc_done_work); - queue_delayed_work(priv->work_thread, &priv->assoc_done_work, 0); - - if(test_and_clear_bit(ASSOC_FLAG_ASSOC_RETRY, &priv->assoc_flags)) - { - cancel_delayed_work_sync(&priv->assoc_work); - } - - if(test_bit(ASSOC_FLAG_WLAN_CONNECTING, &priv->assoc_flags)) - cancel_delayed_work(&priv->wlan_connect_work); - - set_bit(ASSOC_FLAG_WLAN_CONNECTING, &priv->assoc_flags); - queue_delayed_work(priv->work_thread, &priv->wlan_connect_work, HZ*20); - - } - else if (mac_status == MAC_DISCONNECTED) { - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_CRIT, - "MAC DISCONNECTED\n"); - - if(priv->connect_status == MAC_CONNECTED) - is_need_set_notch = 1; - else - is_need_set_notch = 0; - - if(!test_bit(ASSOC_FLAG_ASSOC_RETRY, &priv->assoc_flags)) - { - priv->connect_status = MAC_DISCONNECTED; - netif_stop_queue(priv->dev); - netif_carrier_off(priv->dev); - if(!priv->first_init) // the first disconnect should not send to upper - rda5890_indicate_disconnected(priv); - else - priv->first_init = 0; - - if(test_bit(ASSOC_FLAG_ASSOC_START, &priv->assoc_flags)) - { - cancel_delayed_work(&priv->wlan_connect_work); - queue_delayed_work(priv->work_thread, &priv->wlan_connect_work, HZ*4); - } - - clear_bit(ASSOC_FLAG_ASSOC_START, &priv->assoc_flags); - clear_bit(ASSOC_FLAG_WLAN_CONNECTING, &priv->assoc_flags); - } - else - { - RDA5890_ERRP("********wep assoc will be retry ---------- 0x%02x\n", mac_status); - } - } - else { - RDA5890_ERRP("Invalid MAC Status 0x%02x\n", mac_status); - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); - -#ifdef WIFI_UNLOCK_SYSTEM - rda5990_wakeUnlock(); -#endif -} - -void rda5890_card_to_host(struct rda5890_private *priv, - char *packet, unsigned short packet_len) -{ - unsigned char rx_type; - unsigned short rx_length; - unsigned char msg_type; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s >>>\n", __func__); - - rx_type = (unsigned char)packet[1]&0xF0; - rx_length = (unsigned short)(packet[0] + ((packet[1]&0x0f) << 8)); - - if (rx_length > packet_len) { - RDA5890_ERRP("packet_len %d less than header specified length %d\n", - packet_len, rx_length); - goto out; - } - - if( rx_type == 0x30 ) - { - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_NORM, - "Message Packet\n"); - msg_type = packet[2]; - if(msg_type == 'I') - { - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_NORM, - "Indication Message\n"); - rda5890_wid_status(priv, packet + 2, rx_length - 2); - } - else if (msg_type == 'R') - { - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_NORM, - "WID Message\n"); - rda5890_wid_response(priv, packet + 2, rx_length - 2); - } -#ifdef GET_SCAN_FROM_NETWORK_INFO - else if(msg_type == 'N') - { - extern void rda5890_network_information(struct rda5890_private *priv, - char *info, unsigned short info_len); - rda5890_network_information(priv, packet + 2, rx_length - 2); - } -#endif - else { - //RDA5890_ERRP("Invalid Message Type '%c'\n", msg_type); - } - } - else if(rx_type == 0x20) - { - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_NORM, - "Data Packet\n"); - rda5890_data_rx(priv, packet + 2, rx_length - 2); - } - else { - RDA5890_ERRP("Invalid Packet Type 0x%02x\n", rx_type); - } - -out: - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s <<<\n", __func__); -} - -/* - * check wid response header - * if no error, return the pointer to the payload - * support only 1 wid per packet - */ -int rda5890_check_wid_response(char *wid_rsp, unsigned short wid_rsp_len, - unsigned short wid, char wid_msg_id, - char payload_len, char **ptr_payload) -{ - unsigned short rsp_len; - unsigned short rsp_wid; - unsigned char msg_len; - - if (wid_rsp[0] != 'R') { - RDA5890_ERRP("wid_rsp[0] != 'R'\n"); - goto err; - } - - if (wid_rsp[1] != wid_msg_id) { - RDA5890_ERRP("wid_msg_id not match msg_id: %d \n", wid_rsp[1]); - goto err; - } - - if (wid_rsp_len < 4) { - RDA5890_ERRP("wid_rsp_len < 4\n"); - goto err; - } - - rsp_len = wid_rsp[2] | (wid_rsp[3] << 8); - if (wid_rsp_len != rsp_len) { - RDA5890_ERRP("wid_rsp_len not match, %d != %d\n", wid_rsp_len, rsp_len); - goto err; - } - - if (wid_rsp_len < 7) { - RDA5890_ERRP("wid_rsp_len < 7\n"); - goto err; - } -#if 0 - rsp_wid = wid_rsp[4] | (wid_rsp[5] << 8); - if (wid != rsp_wid) { - RDA5890_ERRP("wid not match, 0x%04x != 0x%04x\n", wid, rsp_wid); - goto err; - } -#endif - msg_len = wid_rsp[6]; - if (wid_rsp_len != msg_len + 7) { - RDA5890_ERRP("msg_len not match, %d + 7 != %d\n", msg_len, wid_rsp_len); - goto err; - } - - if (payload_len != msg_len) { - RDA5890_ERRP("payload_len not match, %d != %d\n", msg_len, payload_len); - goto err; - } - - *ptr_payload = wid_rsp + 7; - - return 0; - -err: - RDA5890_ERRP("rda5890_check_wid_response failed wid=0x%04x wid_msg_id:%d \n" ,wid_rsp[4] | (wid_rsp[5] << 8), wid_msg_id); - return -EINVAL; -} - -/* - * check wid status response - */ -int rda5890_check_wid_status(char *wid_rsp, unsigned short wid_rsp_len, - char wid_msg_id) -{ - int ret; - unsigned short wid = WID_STATUS; - char *ptr_payload; - char status_val; - - ret = rda5890_check_wid_response(wid_rsp, wid_rsp_len, wid, wid_msg_id, - 1, &ptr_payload); - if (ret) { - RDA5890_ERRP("rda5890_check_wid_status, check_wid_response fail\n"); - return ret; - } - - status_val = ptr_payload[0]; - if (status_val != WID_STATUS_SUCCESS) { - RDA5890_ERRP("check_wid_status NOT success, status = %d\n", status_val); - return -EINVAL; - } - - return 0; -} - -int rda5890_generic_get_uchar(struct rda5890_private *priv, - unsigned short wid, unsigned char *val) -{ - int ret; - char wid_req[6]; - unsigned short wid_req_len = 6; - char wid_rsp[32]; - unsigned short wid_rsp_len = 32; - char wid_msg_id = priv->wid_msg_id++; - char *ptr_payload; - - wid_req[0] = 'Q'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - wid_req[4] = (char)(wid&0x00FF); - wid_req[5] = (char)((wid&0xFF00) >> 8); - - ret = rda5890_wid_request(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_wid_request fail, ret = %d\n", ret); - goto out; - } - - ret = rda5890_check_wid_response(wid_rsp, wid_rsp_len, wid, wid_msg_id, - sizeof(unsigned char), &ptr_payload); - if (ret) { - RDA5890_ERRP("check_wid_response fail, ret = %d\n", ret); - goto out; - } - - *val = *ptr_payload; -out: - return ret; -} - -int rda5890_generic_set_uchar(struct rda5890_private *priv, - unsigned short wid, unsigned char val) -{ - int ret; - char wid_req[7 + sizeof(unsigned char)]; - unsigned short wid_req_len = 7 + 1; - char wid_rsp[32]; - unsigned short wid_rsp_len = 32; - char wid_msg_id = priv->wid_msg_id++; - - wid_req[0] = 'W'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - wid_req[4] = (char)(wid&0x00FF); - wid_req[5] = (char)((wid&0xFF00) >> 8); - - wid_req[6] = 1; - wid_req[7] = val; - ret = rda5890_wid_request(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_wid_request fail, ret = %d\n", ret); - goto out; - } - - ret = rda5890_check_wid_status(wid_rsp, wid_rsp_len, wid_msg_id); - if (ret) { - RDA5890_ERRP("check_wid_status fail, ret = %d\n", ret); - goto out; - } - -out: - return ret; -} - -#if 1 -int rda5890_generic_get_ushort(struct rda5890_private *priv, - unsigned short wid, unsigned short *val) -{ - int ret; - char wid_req[6]; - unsigned short wid_req_len = 6; - char wid_rsp[32]; - unsigned short wid_rsp_len = 32; - char wid_msg_id = priv->wid_msg_id++; - char *ptr_payload; - - wid_req[0] = 'Q'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - wid_req[4] = (char)(wid&0x00FF); - wid_req[5] = (char)((wid&0xFF00) >> 8); - - ret = rda5890_wid_request(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_wid_request fail, ret = %d\n", ret); - goto out; - } - - ret = rda5890_check_wid_response(wid_rsp, wid_rsp_len, wid, wid_msg_id, - sizeof(unsigned short), &ptr_payload); - if (ret) { - RDA5890_ERRP("check_wid_response fail, ret = %d\n", ret); - goto out; - } - - memcpy(val, ptr_payload, sizeof(unsigned short)); - -out: - return ret; -} - -int rda5890_generic_set_ushort(struct rda5890_private *priv, - unsigned short wid, unsigned short val) -{ - int ret; - char wid_req[7 + sizeof(unsigned short)]; - unsigned short wid_req_len = 7 + sizeof(unsigned short); - char wid_rsp[32]; - unsigned short wid_rsp_len = 32; - char wid_msg_id = priv->wid_msg_id++; - - wid_req[0] = 'W'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - wid_req[4] = (char)(wid&0x00FF); - wid_req[5] = (char)((wid&0xFF00) >> 8); - - wid_req[6] = (char)(sizeof(unsigned short)); - memcpy(wid_req + 7, &val, sizeof(unsigned short)); - - ret = rda5890_wid_request(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_wid_request fail, ret = %d\n", ret); - goto out; - } - - ret = rda5890_check_wid_status(wid_rsp, wid_rsp_len, wid_msg_id); - if (ret) { - RDA5890_ERRP("check_wid_status fail, ret = %d\n", ret); - goto out; - } - -out: - return ret; -} -#endif - -int rda5890_generic_get_ulong(struct rda5890_private *priv, - unsigned short wid, unsigned long *val) -{ - int ret; - char wid_req[6]; - unsigned short wid_req_len = 6; - char wid_rsp[32]; - unsigned short wid_rsp_len = 32; - char wid_msg_id = priv->wid_msg_id++; - char *ptr_payload; - - wid_req[0] = 'Q'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - wid_req[4] = (char)(wid&0x00FF); - wid_req[5] = (char)((wid&0xFF00) >> 8); - - ret = rda5890_wid_request(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_wid_request fail, ret = %d\n", ret); - goto out; - } - - ret = rda5890_check_wid_response(wid_rsp, wid_rsp_len, wid, wid_msg_id, - sizeof(unsigned long), &ptr_payload); - if (ret) { - RDA5890_ERRP("check_wid_response fail, ret = %d\n", ret); - goto out; - } - - memcpy(val, ptr_payload, sizeof(unsigned long)); - -out: - return ret; -} - -int rda5890_generic_set_ulong(struct rda5890_private *priv, - unsigned short wid, unsigned long val) -{ - int ret; - char wid_req[7 + sizeof(unsigned long)]; - unsigned short wid_req_len = 7 + sizeof(unsigned long); - char wid_rsp[32]; - unsigned short wid_rsp_len = 32; - char wid_msg_id = priv->wid_msg_id++; - - wid_req[0] = 'W'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - wid_req[4] = (char)(wid&0x00FF); - wid_req[5] = (char)((wid&0xFF00) >> 8); - - wid_req[6] = (char)(sizeof(unsigned long)); - memcpy(wid_req + 7, &val, sizeof(unsigned long)); - - ret = rda5890_wid_request(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_wid_request fail, ret = %d\n", ret); - goto out; - } - - ret = rda5890_check_wid_status(wid_rsp, wid_rsp_len, wid_msg_id); - if (ret) { - RDA5890_ERRP("check_wid_status fail, ret = %d\n", ret); - goto out; - } - -out: - return ret; -} - -int rda5890_generic_get_str(struct rda5890_private *priv, - unsigned short wid, unsigned char *val, unsigned char len) -{ - int ret; - char wid_req[6]; - unsigned short wid_req_len = 6; - char wid_rsp[RDA5890_MAX_WID_LEN]; - unsigned short wid_rsp_len = RDA5890_MAX_WID_LEN; - char wid_msg_id = priv->wid_msg_id++; - char *ptr_payload; - - wid_req[0] = 'Q'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - wid_req[4] = (char)(wid&0x00FF); - wid_req[5] = (char)((wid&0xFF00) >> 8); - - ret = rda5890_wid_request(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_wid_request fail, ret = %d\n", ret); - goto out; - } - - ret = rda5890_check_wid_response(wid_rsp, wid_rsp_len, wid, wid_msg_id, - (char)len, &ptr_payload); - if (ret) { - RDA5890_ERRP("check_wid_response fail, ret = %d\n", ret); - goto out; - } - - memcpy(val, ptr_payload, len); - -out: - return ret; -} - -int rda5890_generic_set_str(struct rda5890_private *priv, - unsigned short wid, unsigned char *val, unsigned char len) -{ - int ret; - char wid_req[RDA5890_MAX_WID_LEN]; - unsigned short wid_req_len = 7 + len; - char wid_rsp[RDA5890_MAX_WID_LEN]; - unsigned short wid_rsp_len = RDA5890_MAX_WID_LEN; - char wid_msg_id = priv->wid_msg_id++; - - wid_req[0] = 'W'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - wid_req[4] = (char)(wid&0x00FF); - wid_req[5] = (char)((wid&0xFF00) >> 8); - - wid_req[6] = (char)(len); - memcpy(wid_req + 7, val, len); - - ret = rda5890_wid_request(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_wid_request fail, ret = %d\n", ret); - goto out; - } - - ret = rda5890_check_wid_status(wid_rsp, wid_rsp_len, wid_msg_id); - if (ret) { - RDA5890_ERRP("check_wid_status fail, ret = %d\n", ret); - goto out; - } - -out: - return ret; -} - -int rda5890_check_wid_response_unknown_len( - char *wid_rsp, unsigned short wid_rsp_len, - unsigned short wid, char wid_msg_id, - char *payload_len, char **ptr_payload) -{ - unsigned short rsp_len; - unsigned short rsp_wid; - unsigned char msg_len; - - if (wid_rsp[0] != 'R') { - RDA5890_ERRP("wid_rsp[0] != 'R'\n"); - return -EINVAL; - } - - if (wid_rsp[1] != wid_msg_id) { - RDA5890_ERRP("wid_msg_id not match\n"); - return -EINVAL; - } - - if (wid_rsp_len < 4) { - RDA5890_ERRP("wid_rsp_len < 4\n"); - return -EINVAL; - } - - rsp_len = wid_rsp[2] | (wid_rsp[3] << 8); - if (wid_rsp_len != rsp_len) { - RDA5890_ERRP("wid_rsp_len not match, %d != %d\n", wid_rsp_len, rsp_len); - return -EINVAL; - } - - if (wid_rsp_len < 7) { - RDA5890_ERRP("wid_rsp_len < 7\n"); - return -EINVAL; - } -#if 0 - rsp_wid = wid_rsp[4] | (wid_rsp[5] << 8); - if (wid != rsp_wid) { - RDA5890_ERRP("wid not match, 0x%04x != 0x%04x\n", wid, rsp_wid); - return -EINVAL; - } -#endif - msg_len = wid_rsp[6]; - if (wid_rsp_len != msg_len + 7) { - RDA5890_ERRP("msg_len not match, %d + 7 != %d\n", msg_len, wid_rsp_len); - return -EINVAL; - } - - *payload_len = msg_len; - - *ptr_payload = wid_rsp + 7; - - return 0; -err: - - RDA5890_ERRP("wid is %x wid_msg %d \n", wid_rsp[4] | (wid_rsp[5] << 8), wid_rsp[1]); - return -EINVAL; -} - -int rda5890_get_str_unknown_len(struct rda5890_private *priv, - unsigned short wid, unsigned char *val, unsigned char *len) -{ - int ret; - char wid_req[6]; - unsigned short wid_req_len = 6; - char wid_rsp[RDA5890_MAX_WID_LEN]; - unsigned short wid_rsp_len = RDA5890_MAX_WID_LEN; - char wid_msg_id = priv->wid_msg_id++; - char *ptr_payload; - - wid_req[0] = 'Q'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - wid_req[4] = (char)(wid&0x00FF); - wid_req[5] = (char)((wid&0xFF00) >> 8); - - ret = rda5890_wid_request(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_wid_request fail, ret = %d\n", ret); - goto out; - } - - ret = rda5890_check_wid_response_unknown_len( - wid_rsp, wid_rsp_len, wid, wid_msg_id, (char*)len, &ptr_payload); - if (ret) { - RDA5890_ERRP("check_wid_response fail, ret = %d\n", ret); - goto out; - } - - memcpy(val, ptr_payload, *len); - -out: - return ret; -} - -extern int rda5890_sdio_set_default_notch(struct rda5890_private *priv); -int rda5890_start_scan(struct rda5890_private *priv) -{ - int ret; - char wid_req[12]; - unsigned short wid_req_len = 12; - char wid_rsp[32]; - unsigned short wid_rsp_len = 32; - unsigned short wid; - char wid_msg_id = 0; - - if(priv->connect_status != MAC_CONNECTED) - { - rda5890_sdio_set_default_notch(priv); - } - - wid_msg_id = priv->wid_msg_id++; - - wid_req[0] = 'W'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - wid = WID_SITE_SURVEY; - wid_req[4] = (char)(wid&0x00FF); - wid_req[5] = (char)((wid&0xFF00) >> 8); - - wid_req[6] = (char)(0x01); - wid_req[7] = (char)(0x01); - - wid = WID_START_SCAN_REQ; - wid_req[8] = (char)(wid&0x00FF); - wid_req[9] = (char)((wid&0xFF00) >> 8); - - wid_req[10] = (char)(0x01); - wid_req[11] = (char)(0x01); - - - wid_req_len = 12; - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - ret = rda5890_wid_request(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_wid_request fail, ret = %d\n", ret); - goto out; - } - - ret = rda5890_check_wid_status(wid_rsp, wid_rsp_len, wid_msg_id); - if (ret) { - RDA5890_ERRP("check_wid_status fail, ret = %d\n", ret); - goto out; - } - -out: - return ret; -} - - -int rda5890_start_scan_enable_network_info(struct rda5890_private *priv) -{ - int ret; - char wid_req[12]; - unsigned short wid_req_len = 12; - char wid_rsp[32]; - unsigned short wid_rsp_len = 32; - unsigned short wid; - char wid_msg_id = 0; - - if(priv->connect_status != MAC_CONNECTED) - { - rda5890_sdio_set_default_notch(priv); - } - - wid_msg_id = priv->wid_msg_id++; - - wid_req[0] = 'W'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - wid = WID_SITE_SURVEY; - wid_req[4] = (char)(wid&0x00FF); - wid_req[5] = (char)((wid&0xFF00) >> 8); - - wid_req[6] = (char)(0x01); - wid_req[7] = (char)(0x01); - - wid = WID_START_SCAN_REQ; - wid_req[8] = (char)(wid&0x00FF); - wid_req[9] = (char)((wid&0xFF00) >> 8); - - wid_req[10] = (char)(0x01); - wid_req[11] = (char)(0x01); - - wid = WID_NETWORK_INFO_EN; - wid_req[12] = (char)(wid&0x00FF); - wid_req[13] = (char)((wid&0xFF00) >> 8); - - wid_req[14] = (char)(0x01); - wid_req[15] = (char)(0x01); // 0x01 scan network info - - wid_req_len = 16; - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - ret = rda5890_wid_request(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_wid_request fail, ret = %d\n", ret); - goto out; - } - - ret = rda5890_check_wid_status(wid_rsp, wid_rsp_len, wid_msg_id); - if (ret) { - RDA5890_ERRP("check_wid_status fail, ret = %d\n", ret); - goto out; - } - -out: - return ret; -} - -int rda5890_start_join(struct rda5890_private *priv) -{ - int ret; - char wid_req[255]; - unsigned short wid_req_len = 0; - char wid_rsp[32]; - unsigned short wid_rsp_len = 32; - unsigned short wid; - char wid_msg_id = priv->wid_msg_id++; - unsigned short i = 0; - unsigned char * wep_key = 0, key_str_len = 0; - unsigned char key_str[26 + 1] , * key, *pWid_req; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s <<< mode:%d authtype:%d ssid:%s\n", __func__, priv->imode, priv->authtype, - priv->assoc_ssid); - - wid_req[0] = 'W'; - wid_req[1] = wid_msg_id; - - - wid = WID_802_11I_MODE; - wid_req[4] = (char)(wid&0x00FF); - wid_req[5] = (char)((wid&0xFF00) >> 8); - - wid_req[6] = 1; - wid_req[7] = priv->imode; - - wid = WID_AUTH_TYPE; - wid_req[8] = (char)(wid&0x00FF); - wid_req[9] = (char)((wid&0xFF00) >> 8); - - wid_req[10] = 1; - wid_req[11] = priv->authtype; - -#ifdef GET_SCAN_FROM_NETWORK_INFO - wid = WID_NETWORK_INFO_EN; - wid_req[12] = (char)(wid&0x00FF); - wid_req[13] = (char)((wid&0xFF00) >> 8); - - wid_req[14] = 1; - wid_req[15] = 0; - - wid = WID_CURRENT_TX_RATE; - wid_req[16] = (char)(wid&0x00FF); - wid_req[17] = (char)((wid&0xFF00) >> 8); - - wid_req[18] = 1; - wid_req[19] = 1; - - wid_req_len = 20; - pWid_req = wid_req + 20; -#else - wid_req_len = 12; - pWid_req = wid_req + 12; -#endif - wid = WID_WEP_KEY_VALUE0; - if(priv->imode == 3 || priv->imode == 7) //write wep key - { - for(i = 0 ; i < 4; i ++) - { - key = priv->wep_keys[i].key; - - if(priv->wep_keys[i].len == 0) - continue; - - if (priv->wep_keys[i].len == KEY_LEN_WEP_40) { - sprintf(key_str, "%02x%02x%02x%02x%02x\n", - key[0], key[1], key[2], key[3], key[4]); - key_str_len = 10; - key_str[key_str_len] = '\0'; - } - else if (priv->wep_keys[i].len == KEY_LEN_WEP_104) { - sprintf(key_str, "%02x%02x%02x%02x%02x" - "%02x%02x%02x%02x%02x" - "%02x%02x%02x\n", - key[0], key[1], key[2], key[3], key[4], - key[5], key[6], key[7], key[8], key[9], - key[10], key[11], key[12]); - key_str_len = 26; - key_str[key_str_len] = '\0'; - } - else - continue; - - pWid_req[0] = (char)((wid + i)&0x00FF); - pWid_req[1] = (char)(((wid + i)&0xFF00) >> 8); - - pWid_req[2] = key_str_len; - memcpy(pWid_req + 3, key_str, key_str_len); - - pWid_req += 3 + key_str_len; - wid_req_len += 3 + key_str_len; - } - } - -// ssid - wid = WID_SSID; - pWid_req[0] = (char)(wid&0x00FF); - pWid_req[1] = (char)((wid&0xFF00) >> 8); - - pWid_req[2] = priv->assoc_ssid_len; - memcpy(pWid_req + 3, priv->assoc_ssid, priv->assoc_ssid_len); - - wid_req_len += 3 + priv->assoc_ssid_len; - - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - ret = rda5890_wid_request(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_start_join fail, ret = %d\n", ret); - goto out; - } - - ret = rda5890_check_wid_status(wid_rsp, wid_rsp_len, wid_msg_id); - if (ret) { - RDA5890_ERRP("rda5890_start_join check status fail, ret = %d\n", ret); - goto out; - } - -out: - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s >>> ret = %d req len %d mod:0x%x auth_type:0x%x \n", __func__, ret, wid_req_len, priv->imode - , priv->authtype); - return ret; -} - -int rda5890_set_txrate(struct rda5890_private *priv, unsigned char mbps) -{ - int ret; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "rda5890_set_txrate <<< \n"); - - ret = rda5890_generic_set_uchar(priv, WID_CURRENT_TX_RATE, mbps); //O FOR AUTO 1FOR 1MBPS - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "rda5890_set_txrate success >>> \n"); - -out: - return ret; -} - -int rda5890_set_core_init_polling(struct rda5890_private *priv, const unsigned int (*data)[2], unsigned char num) -{ - int ret = -1; - char wid_req[255]; - unsigned short wid_req_len = 4 + 14*num; - char wid_rsp[32]; - unsigned short wid_rsp_len = 32; - unsigned short wid; - char wid_msg_id = priv->wid_msg_id++; - char count = 0, *p_wid_req = NULL; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); - - wid_req[0] = 'W'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - p_wid_req = wid_req + 4; - for(count = 0; count < num; count ++) - { - wid = WID_MEMORY_ADDRESS; - p_wid_req[0] = (char)(wid&0x00FF); - p_wid_req[1] = (char)((wid&0xFF00) >> 8); - - p_wid_req[2] = (char)4; - memcpy(p_wid_req + 3, (char*)&data[count][0], 4); - - wid = WID_MEMORY_ACCESS_32BIT; - p_wid_req[7] = (char)(wid&0x00FF); - p_wid_req[8] = (char)((wid&0xFF00) >> 8); - - p_wid_req[9] = (char)4; - memcpy(p_wid_req + 10, (char*)&data[count][1], 4); - p_wid_req += 14; - } - ret = rda5890_wid_request_polling(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_set_sdio_core_init fail, ret = %d\n", ret); - goto out; - } - -out: - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s >>> \n", __func__); - return ret; -} - -int rda5890_set_core_init(struct rda5890_private *priv, const unsigned int (*data)[2], unsigned char num) -{ - int ret = -1; - char wid_req[255]; - unsigned short wid_req_len = 4 + 14*num; - char wid_rsp[32]; - unsigned short wid_rsp_len = 32; - unsigned short wid; - char wid_msg_id = priv->wid_msg_id++; - char count = 0, *p_wid_req = NULL; - - wid_req[0] = 'W'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - p_wid_req = wid_req + 4; - for(count = 0; count < num; count ++) - { - wid = WID_MEMORY_ADDRESS; - p_wid_req[0] = (char)(wid&0x00FF); - p_wid_req[1] = (char)((wid&0xFF00) >> 8); - - p_wid_req[2] = (char)4; - memcpy(p_wid_req + 3, (char*)&data[count][0], 4); - - wid = WID_MEMORY_ACCESS_32BIT; - p_wid_req[7] = (char)(wid&0x00FF); - p_wid_req[8] = (char)((wid&0xFF00) >> 8); - - p_wid_req[9] = (char)4; - memcpy(p_wid_req + 10, (char*)&data[count][1], 4); - p_wid_req += 14; - } - ret = rda5890_wid_request(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_set_sdio_core_init fail, ret = %d\n", ret); - goto out; - } - -out: - return ret; -} - -int rda5890_set_core_patch_polling(struct rda5890_private *priv, const unsigned char (*patch)[2], unsigned char num) -{ - int ret; - char wid_req[255]; - unsigned short wid_req_len = 4 + 8*num; - char wid_rsp[32]; - unsigned short wid_rsp_len = 32; - unsigned short wid; - char wid_msg_id = priv->wid_msg_id++; - char count = 0 , *p_wid_req = NULL; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s <<< \n", __func__); - - wid_req[0] = 'W'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - p_wid_req = wid_req + 4; - for(count = 0; count < num; count ++) - { - wid = WID_PHY_ACTIVE_REG; - p_wid_req[0] = (char)(wid&0x00FF); - p_wid_req[1] = (char)((wid&0xFF00) >> 8); - - p_wid_req[2] = (char)(0x01); - p_wid_req[3] = patch[count][0]; - - wid = WID_PHY_ACTIVE_REG_VAL; - p_wid_req[4] = (char)(wid&0x00FF); - p_wid_req[5] = (char)((wid&0xFF00) >> 8); - - p_wid_req[6] = (char)(0x01); - p_wid_req[7] = patch[count][1]; - p_wid_req += 8; - } - ret = rda5890_wid_request_polling(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_set_core_patch fail, ret = %d \n", ret); - goto out; - } - -out: - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_DEBUG, - "%s >>> \n", __func__); - return ret; -} - -int rda5890_set_core_patch(struct rda5890_private *priv, const unsigned char (*patch)[2], unsigned char num) -{ - int ret; - char wid_req[255]; - unsigned short wid_req_len = 4 + 8*num; - char wid_rsp[32]; - unsigned short wid_rsp_len = 32; - unsigned short wid; - char wid_msg_id = priv->wid_msg_id++; - char count = 0 , *p_wid_req = NULL; - - wid_req[0] = 'W'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - p_wid_req = wid_req + 4; - for(count = 0; count < num; count ++) - { - wid = WID_PHY_ACTIVE_REG; - p_wid_req[0] = (char)(wid&0x00FF); - p_wid_req[1] = (char)((wid&0xFF00) >> 8); - - p_wid_req[2] = (char)(0x01); - p_wid_req[3] = patch[count][0]; - - wid = WID_PHY_ACTIVE_REG_VAL; - p_wid_req[4] = (char)(wid&0x00FF); - p_wid_req[5] = (char)((wid&0xFF00) >> 8); - - p_wid_req[6] = (char)(0x01); - p_wid_req[7] = patch[count][1]; - p_wid_req += 8; - } - ret = rda5890_wid_request(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_set_core_patch fail, ret = %d \n", ret); - goto out; - } - -out: - return ret; -} - - -int rda5890_get_fw_ver(struct rda5890_private *priv, unsigned long *fw_ver) -{ - int ret; - - ret = rda5890_generic_get_ulong(priv, WID_SYS_FW_VER, fw_ver); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Get FW_VER 0x%08lx\n", *fw_ver); - -out: - return ret; -} - -int rda5890_get_mac_addr(struct rda5890_private *priv, unsigned char *mac_addr) -{ - int ret; - - ret = rda5890_generic_get_str(priv, WID_MAC_ADDR, mac_addr, ETH_ALEN); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "STA MAC Address [%02x:%02x:%02x:%02x:%02x:%02x]\n", - mac_addr[0], mac_addr[1], mac_addr[2], - mac_addr[3], mac_addr[4], mac_addr[5]); -out: - return ret; -} - -/* support only one bss per packet for now */ -int rda5890_get_scan_results(struct rda5890_private *priv, - struct rda5890_bss_descriptor *bss_desc) -{ - int ret; - int count = 0; - unsigned char len; - unsigned char buf[sizeof(struct rda5890_bss_descriptor)*RDA5890_MAX_NETWORK_NUM + 2]; - unsigned char first_send = 0; - - ret = rda5890_get_str_unknown_len(priv, WID_SITE_SURVEY_RESULTS, - buf, &len); - if (ret) { - return ret; - } - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Get Scan Result, len = %d\n", len); - - if ((len - 2) % sizeof(struct rda5890_bss_descriptor)) { - RDA5890_ERRP("Scan Result len not correct, %d\n", len); - return -EINVAL; - } - - count = (len - 2) / sizeof(struct rda5890_bss_descriptor); - - first_send = *(buf + 1); - memcpy(bss_desc, buf + 2, (len - 2)); - - return (count | first_send << 8); -} - -int rda5890_get_bssid(struct rda5890_private *priv, unsigned char *bssid) -{ - int ret; - - ret = rda5890_generic_get_str(priv, WID_BSSID, bssid, ETH_ALEN); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Get BSSID [%02x:%02x:%02x:%02x:%02x:%02x]\n", - bssid[0], bssid[1], bssid[2], - bssid[3], bssid[4], bssid[5]); -out: - return ret; -} - -int rda5890_get_channel(struct rda5890_private *priv, unsigned char *channel) -{ - int ret; - - ret = rda5890_generic_get_uchar(priv, WID_CURRENT_CHANNEL, channel); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Get Channel %d\n", *channel); - -out: - return ret; -} - -int rda5890_get_rssi(struct rda5890_private *priv, unsigned char *rssi) -{ - int ret; - - *rssi = 0; - ret = rda5890_generic_get_uchar(priv, WID_RSSI, rssi); - if (ret) { - goto out; - } - - - if(priv->connect_status == MAC_CONNECTED) - { - if(*rssi > 215) - { - rda5890_rssi_up_to_200(priv); - } - else - { - rda5890_sdio_set_notch_by_channel(priv, priv->curbssparams.channel); - } - } - else - *rssi = 0; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Get RSSI <<< %d\n", *(char*)rssi); - -out: - return ret; -} - -int rda5890_set_mac_addr(struct rda5890_private *priv, unsigned char *mac_addr) -{ - int ret; - - ret = rda5890_generic_set_str(priv, WID_MAC_ADDR, mac_addr, ETH_ALEN); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set STA MAC Address [%02x:%02x:%02x:%02x:%02x:%02x]\n", - mac_addr[0], mac_addr[1], mac_addr[2], - mac_addr[3], mac_addr[4], mac_addr[5]); -out: - return ret; -} - -int rda5890_set_preamble(struct rda5890_private *priv, unsigned char preamble) -{ - int ret; - - ret = rda5890_generic_set_uchar(priv, WID_PREAMBLE, preamble); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, "rda5890_set_preamble \n"); -out: - return ret; -} - -#ifdef GET_SCAN_FROM_NETWORK_INFO - -int rda5890_set_scan_complete(struct rda5890_private *priv) -{ - int ret; - - ret = rda5890_generic_set_uchar(priv, WID_NETWORK_INFO_EN, 0); - if (ret) { - goto out; - } - -out: - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, "rda5890_set_scan_complete ret=%d \n", ret); - return ret; -} -#endif - -int rda5890_set_ssid(struct rda5890_private *priv, - unsigned char *ssid, unsigned char ssid_len) -{ - int ret; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set SSID: %s, len = %d\n", ssid, ssid_len); - - ret = rda5890_generic_set_str(priv, WID_SSID, ssid, ssid_len); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set SSID Done\n"); - -out: - return ret; -} - -int rda5890_get_ssid(struct rda5890_private *priv, - unsigned char *ssid, unsigned char *ssid_len) -{ - int ret; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Get SSID \n"); - - ret = rda5890_get_str_unknown_len(priv, WID_SSID, ssid, ssid_len); - if(*ssid_len > 0) - ssid[*ssid_len] = '\0'; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Get SSID Done len:%d %s\n", *ssid_len, *ssid_len > 0? ssid:"NULL"); -out: - return ret; -} -int rda5890_set_bssid(struct rda5890_private *priv, unsigned char *bssid) -{ - int ret; - - ret = rda5890_generic_set_str(priv, WID_BSSID, bssid, ETH_ALEN); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set BSSID [%02x:%02x:%02x:%02x:%02x:%02x]\n", - bssid[0], bssid[1], bssid[2], - bssid[3], bssid[4], bssid[5]); -out: - return ret; -} - - -int rda5890_set_imode(struct rda5890_private *priv, unsigned char imode) -{ - int ret; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set IMode 0x%02x\n", imode); - - ret = rda5890_generic_set_uchar(priv, WID_802_11I_MODE, imode); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set IMode Done\n"); - -out: - return ret; -} - -int rda5890_set_authtype(struct rda5890_private *priv, unsigned char authtype) -{ - int ret; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set AuthType 0x%02x\n", authtype); - - ret = rda5890_generic_set_uchar(priv, WID_AUTH_TYPE, authtype); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set AuthType Done\n"); - -out: - return ret; -} - -int rda5890_set_listen_interval(struct rda5890_private *priv, unsigned char interval) -{ - int ret; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set rda5890_set_listen_interval 0x%02x\n", interval); - - ret = rda5890_generic_set_uchar(priv, WID_LISTEN_INTERVAL, interval); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set rda5890_set_listen_interval Done\n"); - -out: - return ret; -} - -int rda5890_set_link_loss_threshold(struct rda5890_private *priv, unsigned char threshold) -{ - int ret; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set rda5890_set_link_loss_threshold 0x%02x\n", threshold); - - ret = rda5890_generic_set_uchar(priv, WID_LINK_LOSS_THRESHOLD, threshold); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set rda5890_set_link_loss_threshold Done\n"); - -out: - return ret; -} - - -int rda5890_set_wepkey(struct rda5890_private *priv, - unsigned short index, unsigned char *key, unsigned char key_len) -{ - int ret; - unsigned char key_str[26 + 1]; // plus 1 for debug print - unsigned char key_str_len; - - if (key_len == KEY_LEN_WEP_40) { - sprintf(key_str, "%02x%02x%02x%02x%02x\n", - key[0], key[1], key[2], key[3], key[4]); - key_str_len = 10; - key_str[key_str_len] = '\0'; - } - else if (key_len == KEY_LEN_WEP_104) { - sprintf(key_str, "%02x%02x%02x%02x%02x" - "%02x%02x%02x%02x%02x" - "%02x%02x%02x\n", - key[0], key[1], key[2], key[3], key[4], - key[5], key[6], key[7], key[8], key[9], - key[10], key[11], key[12]); - key_str_len = 26; - key_str[key_str_len] = '\0'; - } - else { - RDA5890_ERRP("Error in WEP Key length %d\n", key_len); - ret = -EINVAL; - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set WEP KEY[%d]: %s\n", index, key_str); - - ret = rda5890_generic_set_str(priv, - (WID_WEP_KEY_VALUE0 + index), key_str, key_str_len); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set WEP KEY[%d] Done\n", index); - -out: - return ret; -} - -static void dump_key(unsigned char *key, unsigned char key_len) -{ - RDA5890_DBGP("%02x %02x %02x %02x %02x %02x %02x %02x\n", - key[0], key[1], key[2], key[3], key[4], key[5], key[6], key[7]); - RDA5890_DBGP("%02x %02x %02x %02x %02x %02x %02x %02x\n", - key[8], key[9], key[10], key[11], key[12], key[13], key[14], key[15]); - if (key_len > 16) - RDA5890_DBGP("%02x %02x %02x %02x %02x %02x %02x %02x\n", - key[16], key[17], key[18], key[19], key[20], key[21], key[22], key[23]); - if (key_len > 24) - RDA5890_DBGP("%02x %02x %02x %02x %02x %02x %02x %02x\n", - key[24], key[25], key[26], key[27], key[28], key[29], key[30], key[31]); -} - -int rda5890_set_ptk(struct rda5890_private *priv, - unsigned char *key, unsigned char key_len) -{ - int ret; - unsigned char key_str[32 + ETH_ALEN + 1]; - unsigned char key_str_len = key_len + ETH_ALEN + 1; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set PTK: len = %d\n", key_len); - if (RDA5890_DBGLA(RDA5890_DA_WID, RDA5890_DL_VERB)) - dump_key(key, key_len); - - if (priv->connect_status != MAC_CONNECTED) { - RDA5890_ERRP("Adding PTK while not connected\n"); - ret = -EINVAL; - goto out; - } - - /*----------------------------------------*/ - /* STA Addr | KeyLength | Key */ - /*----------------------------------------*/ - /* 6 | 1 | KeyLength */ - /*----------------------------------------*/ - - /*---------------------------------------------------------*/ - /* key */ - /*---------------------------------------------------------*/ - /* Temporal Key | Rx Micheal Key | Tx Micheal Key */ - /*---------------------------------------------------------*/ - /* 16 bytes | 8 bytes | 8 bytes */ - /*---------------------------------------------------------*/ - - memcpy(key_str, priv->curbssparams.bssid, ETH_ALEN); - key_str[6] = key_len; - memcpy(key_str + 7, key, 16); - - /* swap TX MIC and RX MIC, rda5890 need RX MIC to be ahead */ - if(key_len > 16) { - memcpy(key_str + 7 + 16, key + 24, 8); - memcpy(key_str + 7 + 24, key + 16, 8); - } - - if(priv->is_wapi) - ret = rda5890_generic_set_str(priv, - WID_ADD_WAPI_PTK, key_str, key_str_len); - else - ret = rda5890_generic_set_str(priv, - WID_ADD_PTK, key_str, key_str_len); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set PTK Done\n"); - -out: - return ret; -} - -int rda5890_set_gtk(struct rda5890_private *priv, unsigned char key_id, - unsigned char *key_rsc, unsigned char key_rsc_len, - unsigned char *key, unsigned char key_len) -{ - int ret; - unsigned char key_str[32 + ETH_ALEN + 8 + 2]; - unsigned char key_str_len = key_len + ETH_ALEN + 8 + 2; - - /*---------------------------------------------------------*/ - /* STA Addr | KeyRSC | KeyID | KeyLength | Key */ - /*---------------------------------------------------------*/ - /* 6 | 8 | 1 | 1 | KeyLength */ - /*---------------------------------------------------------*/ - - /*-------------------------------------*/ - /* key */ - /*-------------------------------------*/ - /* Temporal Key | Rx Micheal Key */ - /*-------------------------------------*/ - /* 16 bytes | 8 bytes */ - /*-------------------------------------*/ - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set GTK: len = %d\n", key_len); - if (RDA5890_DBGLA(RDA5890_DA_WID, RDA5890_DL_VERB)) - dump_key(key, key_len); - - if (priv->connect_status != MAC_CONNECTED) { - RDA5890_ERRP("Adding PTK while not connected\n"); - ret = -EINVAL; - goto out; - } - - memcpy(key_str, priv->curbssparams.bssid, ETH_ALEN); - memcpy(key_str + 6, key_rsc, key_rsc_len); - key_str[14] = key_id; - key_str[15] = key_len; - memcpy(key_str + 16, key, 16); - - /* swap TX MIC and RX MIC, rda5890 need RX MIC to be ahead */ - if(key_len > 16) { - //memcpy(key_str + 16 + 16, key + 16, key_len - 16); - memcpy(key_str + 16 + 16, key + 24, 8); - memcpy(key_str + 16 + 24, key + 16, 8); - } - - if(priv->is_wapi) - ret = rda5890_generic_set_str(priv, - WID_ADD_WAPI_RX_GTK, key_str, key_str_len); - else - ret = rda5890_generic_set_str(priv, - WID_ADD_RX_GTK, key_str, key_str_len); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set GTK Done\n"); - -out: - return ret; -} - -int rda5890_set_scan_timeout(struct rda5890_private *priv) -{ - int ret; - char wid_req[14]; - unsigned short wid_req_len = 19; - char wid_rsp[32]; - unsigned short wid_rsp_len = 32; - char wid_msg_id = priv->wid_msg_id++; - char *ptr_payload; - unsigned short wid = 0; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "rda5890_set_scan_timeout <<< \n"); - - wid = WID_SITE_SURVEY_SCAN_TIME; - - wid_req[0] = 'W'; - wid_req[1] = wid_msg_id; - - wid_req[2] = (char)(wid_req_len&0x00FF); - wid_req[3] = (char)((wid_req_len&0xFF00) >> 8); - - wid_req[4] = (char)(wid&0x00FF); - wid_req[5] = (char)((wid&0xFF00) >> 8); - wid_req[6] = 2; - wid_req[7] = 50; //50 ms one channel - wid_req[8] = 0; - - wid = WID_ACTIVE_SCAN_TIME; - wid_req[9] = (char)(wid&0x00FF); - wid_req[10] = (char)((wid&0xFF00) >> 8); - wid_req[11] = 2; - wid_req[12] = 50; //50 ms one channel - wid_req[13] = 0; - - wid = WID_PASSIVE_SCAN_TIME; - wid_req[14] = (char)(wid&0x00FF); - wid_req[15] = (char)((wid&0xFF00) >> 8); - wid_req[16] = 2; - wid_req[17] = 50; //50 ms one channel - wid_req[18] = 0; - - ret = rda5890_wid_request(priv, wid_req, wid_req_len, wid_rsp, &wid_rsp_len); - if (ret) { - RDA5890_ERRP("rda5890_set_scan_timeout fail, ret = %d\n", ret); - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "rda5890_set_scan_timeout >>> \n"); - -out: - return ret; -} - - -int rda5890_set_pm_mode(struct rda5890_private *priv, unsigned char pm_mode) -{ - int ret; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set PM Mode 0x%02x\n", pm_mode); - - ret = rda5890_generic_set_uchar(priv, WID_POWER_MANAGEMENT, pm_mode); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set PM Mode Done\n"); - -out: - return ret; -} - -int rda5890_set_preasso_sleep(struct rda5890_private *priv, unsigned int preasso_sleep) -{ - int ret; - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set Preasso Sleep 0x%08x\n", preasso_sleep); - - ret = rda5890_generic_set_ulong(priv, WID_PREASSO_SLEEP, preasso_sleep); - if (ret) { - goto out; - } - - RDA5890_DBGLAP(RDA5890_DA_WID, RDA5890_DL_TRACE, - "Set Preasso Sleep Done\n"); - -out: - return ret; -} - diff --git a/drivers/net/wireless/rda5990/rda_wlan/rda5890_wid.h b/drivers/net/wireless/rda5990/rda_wlan/rda5890_wid.h deleted file mode 100755 index 7cf712f4c4cb..000000000000 --- a/drivers/net/wireless/rda5990/rda_wlan/rda5890_wid.h +++ /dev/null @@ -1,288 +0,0 @@ -#ifndef _RDA5890_WID_H_ -#define _RDA5890_WID_H_ - -#define MAX_STRING_LEN 256 -#define MAX_CMD_LEN MAX_STRING_LEN -#define RDA5890_MAX_WID_LEN MAX_CMD_LEN - 2 - -#define MAC_CONNECTED 1 -#define MAC_DISCONNECTED 0 - -#define WID_STATUS_SUCCESS 1 - -typedef enum -{ - G_SHORT_PREAMBLE = 0, - G_LONG_PREAMBLE = 1, - G_AUTO_PREAMBLE = 2 -}G_PREAMBLE_T; - -/* WLAN Identifiers */ -typedef enum { - WID_NIL = -1, - WID_BSS_TYPE = 0x0000, - WID_CURRENT_TX_RATE = 0x0001, - WID_CURRENT_CHANNEL = 0x0002, - WID_PREAMBLE = 0x0003, - WID_11G_OPERATING_MODE = 0x0004, - WID_STATUS = 0x0005, - WID_11G_PROT_MECH = 0x0006, - -#ifdef MAC_HW_UNIT_TEST_MODE - WID_GOTO_SLEEP = 0x0007, -#else /* MAC_HW_UNIT_TEST_MODE */ - WID_SCAN_TYPE = 0x0007, -#endif /* MAC_HW_UNIT_TEST_MODE */ - WID_PRIVACY_INVOKED = 0x0008, - WID_KEY_ID = 0x0009, - WID_QOS_ENABLE = 0x000A, - WID_POWER_MANAGEMENT = 0x000B, - WID_802_11I_MODE = 0x000C, - WID_AUTH_TYPE = 0x000D, - WID_SITE_SURVEY = 0x000E, - WID_LISTEN_INTERVAL = 0x000F, - WID_DTIM_PERIOD = 0x0010, - WID_ACK_POLICY = 0x0011, - WID_RESET = 0x0012, - WID_PCF_MODE = 0x0013, - WID_CFP_PERIOD = 0x0014, - WID_BCAST_SSID = 0x0015, - -#ifdef MAC_HW_UNIT_TEST_MODE - WID_PHY_TEST_PATTERN = 0x0016, -#else /* MAC_HW_UNIT_TEST_MODE */ - WID_DISCONNECT = 0x0016, -#endif /* MAC_HW_UNIT_TEST_MODE */ - - WID_READ_ADDR_SDRAM = 0x0017, - WID_TX_POWER_LEVEL_11A = 0x0018, - WID_REKEY_POLICY = 0x0019, - WID_SHORT_SLOT_ALLOWED = 0x001A, - WID_PHY_ACTIVE_REG = 0x001B, - WID_PHY_ACTIVE_REG_VAL = 0x001C, - WID_TX_POWER_LEVEL_11B = 0x001D, - WID_START_SCAN_REQ = 0x001E, - WID_RSSI = 0x001F, - WID_JOIN_REQ = 0x0020, - WID_ANTENNA_SELECTION = 0x0021, - WID_USER_CONTROL_ON_TX_POWER = 0x0027, - WID_MEMORY_ACCESS_8BIT = 0x0029, - WID_UAPSD_SUPPORT_AP = 0x002A, - - WID_CURRENT_MAC_STATUS = 0x0031, - WID_AUTO_RX_SENSITIVITY = 0x0032, - WID_DATAFLOW_CONTROL = 0x0033, - WID_SCAN_FILTER = 0x0036, - WID_LINK_LOSS_THRESHOLD = 0x0037, - WID_AUTORATE_TYPE = 0x0038, - WID_CCA_THRESHOLD = 0x0039, - - WID_802_11H_DFS_MODE = 0x003B, - WID_802_11H_TPC_MODE = 0x003C, - - WID_PHY_REG_ADDR = 0x0040, - WID_PHY_REG_VAL = 0x0041, - WID_PTA_MODE = 0x0042, - WID_TRAP_TEST = 0x0043, - WID_PTA_BLOCK_BT = 0x0044, - WID_NETWORK_INFO_EN = 0x0045, - - WID_RTS_THRESHOLD = 0x1000, - WID_FRAG_THRESHOLD = 0x1001, - WID_SHORT_RETRY_LIMIT = 0x1002, - WID_LONG_RETRY_LIMIT = 0x1003, - WID_CFP_MAX_DUR = 0x1004, - WID_PHY_TEST_FRAME_LEN = 0x1005, - WID_BEACON_INTERVAL = 0x1006, - WID_MEMORY_ACCESS_16BIT = 0x1008, - - WID_RX_SENSE = 0x100B, - WID_ACTIVE_SCAN_TIME = 0x100C, - WID_PASSIVE_SCAN_TIME = 0x100D, - WID_SITE_SURVEY_SCAN_TIME = 0x100E, - WID_JOIN_TIMEOUT = 0x100F, - WID_AUTH_TIMEOUT = 0x1010, - WID_ASOC_TIMEOUT = 0x1011, - WID_11I_PROTOCOL_TIMEOUT = 0x1012, - WID_EAPOL_RESPONSE_TIMEOUT = 0x1013, - WID_CCA_BUSY_STATUS = 0x1014, - - WID_FAILED_COUNT = 0x2000, - WID_RETRY_COUNT = 0x2001, - WID_MULTIPLE_RETRY_COUNT = 0x2002, - WID_FRAME_DUPLICATE_COUNT = 0x2003, - WID_ACK_FAILURE_COUNT = 0x2004, - WID_RECEIVED_FRAGMENT_COUNT = 0x2005, - WID_MULTICAST_RECEIVED_FRAME_COUNT = 0x2006, - WID_FCS_ERROR_COUNT = 0x2007, - WID_SUCCESS_FRAME_COUNT = 0x2008, - WID_PHY_TEST_PKT_CNT = 0x2009, - WID_PHY_TEST_TXD_PKT_CNT = 0x200A, - WID_TX_FRAGMENT_COUNT = 0x200B, - WID_TX_MULTICAST_FRAME_COUNT = 0x200C, - WID_RTS_SUCCESS_COUNT = 0x200D, - WID_RTS_FAILURE_COUNT = 0x200E, - WID_WEP_UNDECRYPTABLE_COUNT = 0x200F, - WID_REKEY_PERIOD = 0x2010, - WID_REKEY_PACKET_COUNT = 0x2011, -#ifdef MAC_HW_UNIT_TEST_MODE - WID_Q_ENABLE_INFO = 0x2012, -#else /* MAC_HW_UNIT_TEST_MODE */ - WID_802_1X_SERV_ADDR = 0x2012, -#endif /* MAC_HW_UNIT_TEST_MODE */ - WID_STACK_IP_ADDR = 0x2013, - WID_STACK_NETMASK_ADDR = 0x2014, - WID_HW_RX_COUNT = 0x2015, - WID_MEMORY_ADDRESS = 0x201E, - WID_MEMORY_ACCESS_32BIT = 0x201F, - WID_RF_REG_VAL = 0x2021, - WID_FIRMWARE_INFO = 0x2023, - - WID_SYS_FW_VER = 0x2801, - WID_SYS_DBG_LVL = 0x2802, - WID_SYS_DBG_AREA = 0x2803, - WID_UT_MODE = 0x2804, - WID_UT_TX_LEN = 0x2805, - WID_PTA_CTS_FRAME_LEN = 0x2806, - WID_PREASSO_SLEEP = 0x2807, - - WID_SSID = 0x3000, - WID_FIRMWARE_VERSION = 0x3001, - WID_OPERATIONAL_RATE_SET = 0x3002, - WID_BSSID = 0x3003, - WID_WEP_KEY_VALUE0 = 0x3004, - WID_WEP_KEY_VALUE1 = 0x3005, - WID_WEP_KEY_VALUE2 = 0x3006, - WID_WEP_KEY_VALUE3 = 0x3007, - WID_802_11I_PSK = 0x3008, - WID_HCCA_ACTION_REQ = 0x3009, - WID_802_1X_KEY = 0x300A, - WID_HARDWARE_VERSION = 0x300B, - WID_MAC_ADDR = 0x300C, - WID_PHY_TEST_DEST_ADDR = 0x300D, - WID_PHY_TEST_STATS = 0x300E, - WID_PHY_VERSION = 0x300F, - WID_SUPP_USERNAME = 0x3010, - WID_SUPP_PASSWORD = 0x3011, - WID_SITE_SURVEY_RESULTS = 0x3012, - WID_RX_POWER_LEVEL = 0x3013, - - WID_ADD_WEP_KEY = 0x3019, - WID_REMOVE_WEP_KEY = 0x301A, - WID_ADD_PTK = 0x301B, - WID_ADD_RX_GTK = 0x301C, - WID_ADD_TX_GTK = 0x301D, - WID_REMOVE_KEY = 0x301E, - WID_ASSOC_REQ_INFO = 0x301F, - WID_ASSOC_RES_INFO = 0x3020, - WID_UPDATE_RF_SUPPORTED_INFO = 0x3021, - WID_COUNTRY_IE = 0x3022, - - WID_WAPI_ASSOC_IE = 0x3023, - WID_ADD_WAPI_PTK = 0x3024, - WID_ADD_WAPI_RX_GTK = 0x3025, - WID_ADD_WAPI_TX_GTK = 0x3026, - - WID_CONFIG_HCCA_ACTION_REQ = 0x4000, - WID_UAPSD_CONFIG = 0x4001, - WID_UAPSD_STATUS = 0x4002, - WID_WMM_AP_AC_PARAMS = 0x4003, - WID_WMM_STA_AC_PARAMS = 0x4004, - WID_NEWORK_INFO = 0x4005, - WID_STA_JOIN_INFO = 0x4006, - WID_CONNECTED_STA_LIST = 0x4007, - WID_HUT_STATS = 0x4082, - WID_STATISTICS = 0x4008, - WID_MEMORY_DUMP = 0x4009, - WID_LOAD_TRAP_MAP = 0x400a, - WID_AGC_DGC_TBL = 0x400b, - WID_ALL = 0x7FFE, - WID_MAX = 0xFFFF -} WID_T; - -int rda5890_wid_request(struct rda5890_private *priv, - char *wid_req, unsigned short wid_req_len, - char *wid_rsp, unsigned short *wid_rsp_len); - -void rda5890_wid_response(struct rda5890_private *priv, - char *wid_rsp, unsigned short wid_rsp_len); - -void rda5890_wid_status(struct rda5890_private *priv, - char *wid_status, unsigned short wid_status_len); - - -void rda5890_card_to_host(struct rda5890_private *priv, - char *packet, unsigned short packet_len); - -int rda5890_start_scan(struct rda5890_private *priv); -int rda5890_start_scan_enable_network_info(struct rda5890_private *priv); -int rda5890_start_join(struct rda5890_private *priv); - -int rda5890_get_fw_ver(struct rda5890_private *priv, unsigned long *fw_ver); -int rda5890_get_mac_addr(struct rda5890_private *priv, unsigned char *mac_addr); -int rda5890_get_scan_results(struct rda5890_private *priv, - struct rda5890_bss_descriptor *bss_desc); -int rda5890_get_bssid(struct rda5890_private *priv, unsigned char *bssid); -int rda5890_set_bssid(struct rda5890_private *priv, unsigned char *bssid); - -int rda5890_get_channel(struct rda5890_private *priv, unsigned char *channel); -int rda5890_get_rssi(struct rda5890_private *priv, unsigned char *rssi); - -int rda5890_set_mac_addr(struct rda5890_private *priv, unsigned char *mac_addr); -int rda5890_set_preamble(struct rda5890_private *priv, unsigned char preamble); - -int rda5890_set_ssid(struct rda5890_private *priv, - unsigned char *ssid, unsigned char ssid_len); -int rda5890_get_ssid(struct rda5890_private *priv, - unsigned char *ssid, unsigned char *ssid_len); -int rda5890_set_imode(struct rda5890_private *priv, unsigned char imode); -int rda5890_set_authtype(struct rda5890_private *priv, unsigned char authtype); -int rda5890_set_listen_interval(struct rda5890_private *priv, unsigned char interval); -int rda5890_set_link_loss_threshold(struct rda5890_private *priv, unsigned char threshold); -int rda5890_set_wepkey(struct rda5890_private *priv, - unsigned short index, unsigned char *key, unsigned char key_len); -int rda5890_set_ptk(struct rda5890_private *priv, - unsigned char *key, unsigned char key_len); -int rda5890_set_gtk(struct rda5890_private *priv, unsigned char key_id, - unsigned char *key_rsc, unsigned char key_rsc_len, - unsigned char *key, unsigned char key_len); - -int rda5890_set_pm_mode(struct rda5890_private *priv, unsigned char pm_mode); -int rda5890_set_preasso_sleep(struct rda5890_private *priv, unsigned int preasso_sleep); - -int rda5890_generic_get_str(struct rda5890_private *priv, - unsigned short wid, unsigned char *val, unsigned char len); -int rda5890_generic_set_str(struct rda5890_private *priv, - unsigned short wid, unsigned char *val, unsigned char len); - -int rda5890_generic_set_uchar(struct rda5890_private *priv, - unsigned short wid, unsigned char val); -int rda5890_generic_get_ushort(struct rda5890_private *priv, - unsigned short wid, unsigned short *val); -int rda5890_generic_set_ushort(struct rda5890_private *priv, - unsigned short wid, unsigned short val); - -int rda5890_generic_set_ulong(struct rda5890_private *priv, - unsigned short wid, unsigned long val); -int rda5890_generic_get_ulong(struct rda5890_private *priv, - unsigned short wid, unsigned long *val); - -int rda5890_set_core_init(struct rda5890_private *priv, const unsigned int (*data)[2], unsigned char num); -int rda5890_set_core_patch(struct rda5890_private *priv, const unsigned char (*patch)[2], unsigned char num); -int rda5890_set_core_init_polling(struct rda5890_private *priv, const unsigned int (*data)[2], unsigned char num); -int rda5890_set_core_patch_polling(struct rda5890_private *priv, const unsigned char (*patch)[2], unsigned char num); -int rda5890_set_scan_timeout(struct rda5890_private *priv); - -int rda5890_set_txrate(struct rda5890_private *priv, unsigned char mbps); -#ifdef GET_SCAN_FROM_NETWORK_INFO - -int rda5890_set_scan_complete(struct rda5890_private *priv); -#endif -int rda5890_wid_request_polling(struct rda5890_private *priv, - char *wid_req, unsigned short wid_req_len, - char *wid_rsp, unsigned short *wid_rsp_len); -int rda5890_check_wid_response(char *wid_rsp, unsigned short wid_rsp_len, - unsigned short wid, char wid_msg_id, - char payload_len, char **ptr_payload); -#endif - diff --git a/drivers/net/wireless/rkwifi/Kconfig b/drivers/net/wireless/rkwifi/Kconfig deleted file mode 100644 index 83d7b96f6023..000000000000 --- a/drivers/net/wireless/rkwifi/Kconfig +++ /dev/null @@ -1,23 +0,0 @@ -config RKWIFI - tristate "RK901/RK903/BCM4330/AP6XXX wireless cards support" - depends on MMC && WLAN_80211 - select WIRELESS_EXT - select WEXT_PRIV - ---help--- - This module adds support for wireless adapters based on - Broadcom 4329/30 chipset. - - This driver uses the kernel's wireless extensions subsystem. - - If you choose to build a module, it'll be called dhd. Say M if - unsure. - -config RK_CFG80211 - bool "Enable NL80211 support" - default y - depends on RKWIFI - select CFG80211 - select MAC80211 - help - Enables CFG80211 support - diff --git a/drivers/net/wireless/rkwifi/Makefile b/drivers/net/wireless/rkwifi/Makefile deleted file mode 100644 index 1cd97cd08a5e..000000000000 --- a/drivers/net/wireless/rkwifi/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -#rkwifi packed Makefile -# (gwl) - -obj-$(CONFIG_RKWIFI) += rk_wifi_config.o - -.PHONY: clean - -clean: - find . -name '*.o*' -exec rm -f {} \; diff --git a/drivers/net/wireless/rkwifi/firmware/nvram_4330.txt b/drivers/net/wireless/rkwifi/firmware/nvram_4330.txt deleted file mode 100644 index 6489f212daf8..000000000000 --- a/drivers/net/wireless/rkwifi/firmware/nvram_4330.txt +++ /dev/null @@ -1,40 +0,0 @@ -# bcm94330wlsdgb.txt -manfid=0x2d0 -prodid=0x0552 -vendid=0x14e4 -devid=0x4360 -boardtype=0x0552 -boardrev=0x11 -# this design has 2.4GHz SP3T switch -boardflags=0x00080200 -nocrc=1 -xtalfreq=37400 -boardnum=22 -macaddr=00:90:4c:c5:12:38 -ag0=255 -aa2g=1 -ccode=CN -pa0b0=0x14d0 -pa0b1=0xfd98 -pa0b2=0xff78 -rssismf2g=0xa -rssismc2g=0x3 -rssisav2g=0x7 -maxp2ga0=0x50 -sromrev=3 -il0macaddr=00:90:4c:c5:12:38 -wl0id=0x431b -cckPwrOffset=5 -ofdm2gpo=0x66666666 -mcs2gpo0=0x6666 -mcs2gpo1=0x6666 -swctrlmap_2g=0x04040404,0x02020202,0x02020404,0x10202,0x1ff -swctrlmap_5g=0x00100010,0x00280020,0x00200010,0x14202,0x2f8 -rfreg033=0x19 -rfreg033_cck=0x1f -dacrate2g=160 -txalpfbyp2g=1 -bphyscale=17 -cckPwrIdxCorr=-15 -pacalidx2g=45 -txgaintbl=1 diff --git a/drivers/net/wireless/rkwifi/firmware/nvram_RK901.txt b/drivers/net/wireless/rkwifi/firmware/nvram_RK901.txt deleted file mode 100644 index e7c9dd2b4982..000000000000 --- a/drivers/net/wireless/rkwifi/firmware/nvram_RK901.txt +++ /dev/null @@ -1,52 +0,0 @@ -# bcm943362sdgn (goldengate rev 3) board -# $Copyright (C) 2010 Broadcom Corporation$ -# $Id: bcm943362sdgn.txt 242833 2011-02-25 00:22:28Z cfraser $ -# -#---------------------------------------- -# History notes -# 1. oct 4, 2010. created. copied from 4336sdgp with the following mods -# - changed board rev, boardtype, ag0,macaddr -# -#---------------------------------------- -# -# -sromrev=3 -boardtype=0x0596 -boardrev=0x1100 - -#[NVRAM ONLY] -manfid=0x2d0 -prodid=0x492 -vendid=0x14e4 -devid=0x4343 -boardflags=0x200 -nocrc=1 -xtalfreq=26000 -boardnum=${serno} -il0macaddr=00:90:4c:07:6${maclo12} -ag0=0x0 -aa2g=3 -ccode=ww -regrev=5 -pa0b0=5456 -pa0b1=-647 -pa0b2=-160 -pa0itssit=0x20 -rssismf2g=0xa -rssismc2g=0x3 -rssisav2g=0x7 -maxp2ga0=0x46 -ofdm2gpo=0x22222222 -mcs2gpo0=0x3333 -mcs2gpo1=0x3333 -wl0id=0x431b -cckdigfilttype=20 -cckPwrOffset=6 -ofdmanalogfiltbw2g=3 -rfreg033=0x19 -rfreg033_cck=0x1f -swctrlmap_2g=0x0c050c05,0x0a030a03,0x0a030a03,0x0,0x1ff -triso2g=0 -RAW1=4a 0b ff ff 20 04 d0 02 36 43 -otpimagesize=76 - diff --git a/drivers/net/wireless/rkwifi/firmware/nvram_RK903.cal b/drivers/net/wireless/rkwifi/firmware/nvram_RK903.cal deleted file mode 100644 index f634747e1d3b..000000000000 --- a/drivers/net/wireless/rkwifi/firmware/nvram_RK903.cal +++ /dev/null @@ -1,102 +0,0 @@ -manfid=0x2d0 -prodid=0x0532 -vendid=0x14e4 -devid=0x4360 -boardtype=0x0532 -boardrev=0x40 -#boardflags: has ext 5GHz lna, use a SP3T sw share with BT -boardflags=0x10080a01 -nocrc=1 -xtalfreq=37400 -boardnum=22 -macaddr=00:90:4c:c5:12:38 -ag0=255 -aa2g=1 -aa5g=1 - -#dacrate5g=160 -ccode=ALL -# 2.4GHz PA parameters are preliminary -#pa0b0=0x1403 -#pa0b1=0xfd89 -#pa0b2=0xff47 -pa0b0=0x1491 -pa0b1=0xfd87 -pa0b2=0xff47 - - -cckPwrOffset=4 -# rssi params for 2.4GHz -rssismf2g=0xa -rssismc2g=0x3 -rssisav2g=0x7 -# rssi params for 5GHz -rssismf5g=0xa -rssismc5g=0x7 -rssisav5g=0x1 -#PA parameters for lower a-band -#pa1lob0=0x12f7 -#pa1lob1=0xfe29 -#pa1lob2=0xffd3 -pa1lob0=0x158c -pa1lob1=0xfdb9 -pa1lob2=0xffc0 - -#PA parameters for midband -#pa1b0=0x1229 -#pa1b1=0xfe96 -#pa1b2=0x49 -pa1b0=0x1864 -pa1b1=0x1B8 -pa1b2=0x2DC - -#PA parameters for high band -#pa1hib0=0x129f -#pa1hib1=0xfe5e -#pa1hib2=0x1d -pa1hib0=0x15aa -pa1hib1=0xfe16 -pa1hib2=0x4c - -sromrev=3 -# 2.4G Tx Power -maxp2ga0=76 -cck2gpo=0x4444 -ofdm2gpo=0x66666666 -mcs2gpo0=0x8888 -mcs2gpo1=0x8888 -# 5G Tx Power -maxp5ga0=80 -maxp5gla0=80 -maxp5gha0=80 -ofdm5gpo=0x00000000 -ofdm5glpo=0x00000000 -ofdm5ghpo=0x00000000 -mcs5gpo0=0x0000 -mcs5gpo1=0x0000 -mcs5glpo0=0x0000 -mcs5glpo1=0x0000 -mcs5ghpo0=0x0000 -mcs5ghpo1=0x0000 -#il0macaddr=00:90:4c:c5:12:38 -#wl0id=0x431b -# support A band ext PA -extpagain5g=2 -rfreg033=0x1f -pacalidx2g=65 -swctrlmap_2g=0x04040404,0x02020202,0x04040404,0x010202,0x1ff -swctrlmap_5g=0x50505050,0x28282020,0x20202020,0x010202,0x2f8 -xtalmode=0x20,0x4,0 -pa0itssit=0x20 -triso5g=9 -dacrate2g=160 -noise_cal_ref_2g=56 -noise_cal_po_bias_2g=-4 -#tssitime=1 -txalpfbyp2g=1 -cckdigfilttype=21 -#ofdmdigfilttype=2 - -sd_gpout=0 -sd_gpval=1 -sd_oobonly=1 diff --git a/drivers/net/wireless/rkwifi/rk_wifi_config.c b/drivers/net/wireless/rkwifi/rk_wifi_config.c deleted file mode 100644 index 1816905e01d4..000000000000 --- a/drivers/net/wireless/rkwifi/rk_wifi_config.c +++ /dev/null @@ -1,99 +0,0 @@ -/* rk_wifi_config.c - * - * RKWIFI driver version. - * - * Define the firmware and nvram path - * - * Define default Country Code - * - * gwl @ Rockchip - */ -#include -#include - -/* Set INIT_COUNTRY_CODE - * "US" ---> 11 channels, this is default setting. - * "EU" ---> 13 channels - * "JP" ---> 14 channels - */ - -int rkwifi_set_country_code(char *code) -{ - sprintf(code, "%s", "EU"); - return 0; -} - -/* - * Set Firmware Path - */ - -#define ANDROID_FW_PATH "/system/etc/firmware/" - -int rkwifi_set_firmware(char *fw, char *nvram) -{ -#ifdef CONFIG_RK903 - sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK903.bin"); -#ifdef CONFIG_RKWIFI_26M - sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_RK903_26M.cal"); -#endif -#ifdef CONFIG_RKWIFI_37_4M - sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_RK903.cal"); -#endif -#endif - -#ifdef CONFIG_RK901 - sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK901.bin"); - sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_RK901.txt"); -#endif - -#ifdef CONFIG_BCM4330 - sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_bcm4330.bin"); - sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_4330.txt"); -#endif - -#ifdef CONFIG_AP6181 - sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK901.bin"); - sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6181.txt"); -#endif - -#ifdef CONFIG_AP6210 - sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK901.bin"); -#ifdef CONFIG_RKWIFI_26M - sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6210.txt"); -#endif -#ifdef CONFIG_RKWIFI_24M - sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6210_24M.txt"); -#endif -#endif - -#ifdef CONFIG_AP6476 - sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK901.bin"); - sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6476.txt"); -#endif - -#ifdef CONFIG_AP6493 - sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK903.bin"); - sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6493.txt"); -#endif - -#ifdef CONFIG_AP6330 - sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK903_ag.bin"); - sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6330.txt"); -#endif - -#ifdef CONFIG_GB86302I - sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_RK903_ag.bin"); - sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_GB86302I.txt"); -#endif - return 0; -} - -extern int wifi_pcba_test; -int rkwifi_pcba_status(void) -{ - return wifi_pcba_test; -} - -EXPORT_SYMBOL(rkwifi_set_country_code); -EXPORT_SYMBOL(rkwifi_set_firmware); -EXPORT_SYMBOL(rkwifi_pcba_status); diff --git a/drivers/net/wireless/wifi_launcher/Makefile b/drivers/net/wireless/wifi_launcher/Makefile deleted file mode 100644 index 6d8d07677647..000000000000 --- a/drivers/net/wireless/wifi_launcher/Makefile +++ /dev/null @@ -1,11 +0,0 @@ - -obj-m := wlan.o - -KERNEL_DIR = /smb/rk28/mid_yifang_a10_29/kernel - -all: - make -C $(KERNEL_DIR) M=`pwd` modules - -clean: - rm -f Module.symvers *.o modules.order *.ko wifi_launcher.mod.c - rm -rf .wifi* .tmp* wlan.mod.c diff --git a/drivers/net/wireless/wifi_launcher/wlan.c b/drivers/net/wireless/wifi_launcher/wlan.c deleted file mode 100644 index 77fce6d3bc42..000000000000 --- a/drivers/net/wireless/wifi_launcher/wlan.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Just a wifi driver hooker. - * - * Yongle Lai @ 2009-05-10 @ Rockchip - */ - -#include -#include -#include - -MODULE_LICENSE("Dual BSD/GPL"); - -#ifdef CONFIG_MODVERSIONS -#define MODVERSIONS -#include -#endif - -//#define OLD_WIFI_IFACE - -#ifdef OLD_WIFI_IFACE -extern int mv88w8686_if_sdio_init_module(void); -extern void mv88w8686_if_sdio_exit_module(void); -#else -extern int rockchip_wifi_init_module(void); -extern void rockchip_wifi_exit_module(void); -#endif - -static int wifi_launcher_init(void) -{ - int ret; - - printk("=======================================================\n"); - printk("==== Launching Wi-Fi driver! (Powered by Rockchip) ====\n"); - printk("=======================================================\n"); - -#ifdef OLD_WIFI_IFACE - ret = mv88w8686_if_sdio_init_module(); - if (ret) /* Try again */ - ret = mv88w8686_if_sdio_init_module(); -#else - ret = rockchip_wifi_init_module(); - //if (ret) /* Try again */ - // ret = rockchip_wifi_init_module(); -#endif - - return ret; -} - -static void wifi_launcher_exit(void) -{ - printk("=======================================================\n"); - printk("== Dis-launching Wi-Fi driver! (Powered by Rockchip) ==\n"); - printk("=======================================================\n"); - -#ifdef OLD_WIFI_IFACE - mv88w8686_if_sdio_exit_module(); -#else - rockchip_wifi_exit_module(); -#endif -} - -module_init(wifi_launcher_init); -module_exit(wifi_launcher_exit); - diff --git a/drivers/net/wireless/wifi_launcher/wlan_param.h b/drivers/net/wireless/wifi_launcher/wlan_param.h deleted file mode 100755 index 136da06c5639..000000000000 --- a/drivers/net/wireless/wifi_launcher/wlan_param.h +++ /dev/null @@ -1,13 +0,0 @@ - -#ifndef _WLAN_PARAM_H_ -#define _WLAN_PARAM_H_ - -typedef struct { - char ifname[32]; // wlan0, wl0.1 - char devmode[32]; // ap, sta - // reserve -} wlan_param; - -#endif - - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_aigo_e1000.c b/drivers/net/wireless/wifi_power/vendor/wp_aigo_e1000.c deleted file mode 100755 index 4f6bd635d9e8..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_aigo_e1000.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * wifi_power.c - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, GPIOB1_SMCS1_MMC0PCA_NAME, - IOMUXA_GPIO0_B1, GPIOPortB_Pin1, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_GPIO, 0, 0, 0, GPIOPortA_Pin4, GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_aigo_e700.c b/drivers/net/wireless/wifi_power/vendor/wp_aigo_e700.c deleted file mode 100755 index 8d19e93e557e..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_aigo_e700.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * wifi_power.c for MID_AIGO_E700. - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, GPIOF0_UART1_CPWM0_NAME, - IOMUXA_GPIO1_B0, GPIOPortF_Pin0, GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_aigo_nx7007.c b/drivers/net/wireless/wifi_power/vendor/wp_aigo_nx7007.c deleted file mode 100755 index 3e2265911647..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_aigo_nx7007.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * wifi_power.c - * - * Power control (for AIGO NX7007) for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_EXT_GPIO, 0, 0, 0, PCA955X_Pin2, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_EXT_GPIO, 0, 0, 0, PCA955X_Pin3, GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_anjieda_inch10.c b/drivers/net/wireless/wifi_power/vendor/wp_anjieda_inch10.c deleted file mode 100755 index b73404ddfeff..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_anjieda_inch10.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * wifi_power.c - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, GPIOB1_SMCS1_MMC0PCA_NAME, - IOMUXA_GPIO0_B1, GPIOPortB_Pin1, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, GPIO0A4_I2SLRCK_SEL_NAME, - IOMUXB_GPIO0_A4, GPIOPortA_Pin4, GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_foxcom_tp2.c b/drivers/net/wireless/wifi_power/vendor/wp_foxcom_tp2.c deleted file mode 100755 index 28fbc9802600..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_foxcom_tp2.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * wifi_power.c for MID_AIGO_E700. - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, WIFI_PWDN_IOMUX_PINNAME, - WIFI_PWDN_IOMUX_PINDIR, WIFI_PWDN_IOPIN, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, WIFI_RST_IOMUX_PINNAME, - WIFI_RST_IOMUX_PINDIR, WIFI_RST_IOPIN, GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_jinghua_m80.c b/drivers/net/wireless/wifi_power/vendor/wp_jinghua_m80.c deleted file mode 100755 index 2eabf8b8ddd5..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_jinghua_m80.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * wifi_power.c - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, WIFI_PWDN_IOMUX_PINNAME, - WIFI_PWDN_IOMUX_PINDIR, WIFI_PWDN_IOPIN, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_GPIO, 0, 0, 0, WIFI_RST_IOPIN, GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_malata_mp0100.c b/drivers/net/wireless/wifi_power/vendor/wp_malata_mp0100.c deleted file mode 100755 index 418954a3f711..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_malata_mp0100.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * wifi_power.c - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#include - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_EXT_GPIO, 0, 0, 0, Extend_GpioPort0_Pin4, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_EXT_GPIO, 0, 0, 0, Extend_GpioPort0_Pin5, GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - tca6424_set_oneport_pindirection(id, Extend_Gpio_OUT); - tca6424_set_oneoutport_pinlevel(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_meitu_770.c b/drivers/net/wireless/wifi_power/vendor/wp_meitu_770.c deleted file mode 100755 index 7111dbeab22b..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_meitu_770.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * wifi_power.c - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_GPIO, - POWER_GPIO_IOMUX, - WIFI_PWDN_IOMUX_PINNAME, - WIFI_PWDN_IOMUX_PINDIR, - WIFI_PWDN_IOPIN, - GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_GPIO, - POWER_GPIO_IOMUX, - WIFI_RST_IOMUX_PINNAME, - WIFI_RST_IOMUX_PINDIR, - WIFI_RST_IOPIN, - GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_rk2808_child.c b/drivers/net/wireless/wifi_power/vendor/wp_rk2808_child.c deleted file mode 100755 index 1bee67ada5f6..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_rk2808_child.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * wifi_power.c - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, GPIOE_SPI1_SEL_NAME, - IOMUXA_GPIO1_A1237, GPIOPortE_Pin1, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_rk2818sdk_usb.c b/drivers/net/wireless/wifi_power/vendor/wp_rk2818sdk_usb.c deleted file mode 100755 index 4182e6b50f60..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_rk2818sdk_usb.c +++ /dev/null @@ -1,192 +0,0 @@ -/* - * wifi_power.c - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * 在WIFI被上电前,会调用这个函数。 - */ -void wifi_turn_on_callback(void) -{ -} - -/* - * 在WIFI被下电后,会调用这个函数。 - */ -void wifi_turn_off_callback(void) -{ -} - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(void); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -/* - * For USB WiFi, we need to switch USB mode. - */ - -#if defined(CONFIG_RALINK_RT3070) || defined(CONFIG_REALTEK_RTL8192) - -int wifi_change_usb_mode = 0; -int usb_wifi_status = 0; - -void wifi_usb_init(void) -{ - wifi_change_usb_mode = 0; - usb_wifi_status = 0; -} - -#define DONT_SWITCH_USB 0 /* Don't switch USB automaticately. */ -#define WIFI_USE_OTG 1 /* WiFi will be connected to USB OTG. */ -#define WIFI_USE_HOST11 2 /* WiFi will be connected to USB HOST 1.1. */ - -#define WIFI_USE_IFACE 2 - -#if (WIFI_USE_IFACE == WIFI_USE_OTG) - -#define USB_NORMAL 0 -#define USB_FORCE_HOST 1 -#define USB_FORCE_DEVICE 2 - -extern int usb_force_usb_for_wifi(int mode); - -/* - * Change USB mode to HOST. - */ -int wifi_activate_usb(void) -{ - wifi_turn_on_card(WIFI_CHIP_RT3070); - - wifi_change_usb_mode = usb_force_usb_for_wifi(USB_FORCE_HOST); - msleep(1000); - - usb_wifi_status = 1; - - return 0; -} - -/* - * Change USB mode to be original. - */ -int wifi_deactivate_usb(void) -{ - if (wifi_change_usb_mode == 1) - { - usb_force_usb_for_wifi(USB_FORCE_DEVICE); - msleep(1000); - usb_force_usb_for_wifi(USB_NORMAL); - msleep(1000); - } - wifi_turn_off_card(); - - usb_wifi_status = 0; - - return 0; -} - -#elif (WIFI_USE_IFACE == WIFI_USE_HOST11) - -extern int usb_switch_usb_host11_for_wifi(int enabled); - -int wifi_deactivate_usb(void) -{ - wifi_turn_on_card(WIFI_CHIP_RT3070); - msleep(100); - - usb_switch_usb_host11_for_wifi(0); - msleep(1000); - - return 0; -} - -int wifi_activate_usb(void) -{ - usb_switch_usb_host11_for_wifi(1); - msleep(1000); - - wifi_turn_off_card(); - - return 0; -} - -#else - -int wifi_deactivate_usb(void) -{ - return 0; -} - -int wifi_activate_usb(void) -{ - return 0; -} -#endif - -#endif /* CONFIG_RALINK_RT3070 */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_rk28_meizhu_m70.c b/drivers/net/wireless/wifi_power/vendor/wp_rk28_meizhu_m70.c deleted file mode 100755 index 19d6598ca4c8..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_rk28_meizhu_m70.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * wifi_power.c - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * ÓÃÓÚ¿ØÖÆWIFIµÄµçÔ´£¬Í¨³£ÊÇ3.3VºÍ1.8V£¬¿ÉÄÜ1.2VÒ²ÔÚÆäÖС£ - * - * Èç¹ûÊÇÀ©Õ¹IO£¬Çë²Î¿¼ÏÂÃæµÄÀý×Ó: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, WIFI_PWDN_IOMUX_PINNAME, - WIFI_PWDN_IOMUX_PINDIR, WIFI_PWDN_IOPIN, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * ¿ØÖÆWIFIµÄPowerDown½Å¡£ÓÐЩģ×éPowerDown½ÅÊǺÍReset½Å¶Ì½ÓÔÚÒ»Æð¡£ - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_GPIO, 0, WIFI_RST_IOMUX_PINNAME, - WIFI_RST_IOMUX_PINDIR, WIFI_RST_IOPIN, GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * ¿ØÖÆWIFIµÄReset½Å£¬Í¨³£WiFiÄ£×éûÓÐÓõ½Õâ¸öÒý½Å¡£ - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * Èç¹ûÓÐÓÃÀ©Õ¹GPIOÀ´¿ØÖÆWIFI£¬ÇëʵÏÖÏÂÃæµÄº¯Êý: - * º¯ÊýµÄ¹¦ÄÜÊÇ£º¿ØÖÆÖ¸¶¨µÄIO¿Úid£¬Ê¹Æä״̬Çл»ÎªÒªÇóµÄsens״̬¡£ - * id : ÊÇIOµÄ±êʶºÅ£¬ÒÔÕûÊýµÄÐÎʽ±êʶ¡£ - * sens: ÊÇÒªÇóµÄIO״̬£¬Îª¸ß»òµÍ¡£ - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * ÔÚϵͳÖÐÈç¹ûÒªµ÷ÓÃWIFIµÄIO¿ØÖÆ£¬½«WIFIϵ磬¿ÉÒÔµ÷ÓÃÈçϽӿڣº - * void rockchip_wifi_shutdown(); - * µ«×¢ÒâÐèÒªÔÚºêWIFI_GPIO_POWER_CONTROLµÄ¿ØÖÆÏ¡£ - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_rk29_yifang_a10.c b/drivers/net/wireless/wifi_power/vendor/wp_rk29_yifang_a10.c deleted file mode 100755 index 85aad2694d8c..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_rk29_yifang_a10.c +++ /dev/null @@ -1,188 +0,0 @@ -/* - * wifi_power.c - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, - GPIO5D6_SDMMC1PWREN_NAME, GPIO5H_GPIO5D6, RK29_PIN5_PD6, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_NOT_IOMUX, 0, 0, RK29_PIN6_PC0, GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * 在WIFI被上电前,会调用这个函数。 - */ -void wifi_turn_on_callback(void) -{ -} - -/* - * 在WIFI被下电后,会调用这个函数。 - */ -void wifi_turn_off_callback(void) -{ -} - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(void); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -/* - * For USB WiFi, we need to switch USB mode. - */ - -#ifdef CONFIG_RALINK_RT3070 - -int wifi_change_usb_mode = 0; -int usb_wifi_status = 0; - -void wifi_usb_init(void) -{ - wifi_change_usb_mode = 0; - usb_wifi_status = 0; -} - -#define DONT_SWITCH_USB 0 /* Don't switch USB automaticately. */ -#define WIFI_USE_OTG 1 /* WiFi will be connected to USB OTG. */ -#define WIFI_USE_HOST11 2 /* WiFi will be connected to USB HOST 1.1. */ - -#define WIFI_USE_IFACE 2 - -#if (WIFI_USE_IFACE == WIFI_USE_OTG) - -#define USB_NORMAL 0 -#define USB_FORCE_HOST 1 -#define USB_FORCE_DEVICE 2 - -extern int usb_force_usb_for_wifi(int mode); - -/* - * Change USB mode to HOST. - */ -int wifi_activate_usb(void) -{ - wifi_turn_on_card(WIFI_CHIP_RT3070); - - wifi_change_usb_mode = usb_force_usb_for_wifi(USB_FORCE_HOST); - msleep(1000); - - usb_wifi_status = 1; - - return 0; -} - -/* - * Change USB mode to be original. - */ -int wifi_deactivate_usb(void) -{ - if (wifi_change_usb_mode == 1) - { - usb_force_usb_for_wifi(USB_FORCE_DEVICE); - msleep(1000); - usb_force_usb_for_wifi(USB_NORMAL); - msleep(1000); - } - wifi_turn_off_card(); - - usb_wifi_status = 0; - - return 0; -} - -#elif (WIFI_USE_IFACE == WIFI_USE_HOST11) - -extern int usb_switch_usb_host11_for_wifi(int enabled); - -int wifi_deactivate_usb(void) -{ - usb_switch_usb_host11_for_wifi(0); - msleep(5000); - - return 0; -} - -int wifi_activate_usb(void) -{ - usb_switch_usb_host11_for_wifi(1); - msleep(1000); - - return 0; -} - -#else - -int wifi_deactivate_usb(void) -{ - return 0; -} - -int wifi_activate_usb(void) -{ - return 0; -} -#endif - -#endif /* CONFIG_RALINK_RT3070 */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_tchip_tr802d.c b/drivers/net/wireless/wifi_power/vendor/wp_tchip_tr802d.c deleted file mode 100755 index 317b645724c3..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_tchip_tr802d.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * wifi_power.c for MID_AIGO_E700. - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, GPIOG0_UART0_MMC1DET_NAME, - IOMUXA_GPIO1_C0, GPIOPortG_Pin0, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, GPIOF01_UART2_SEL_NAME, - IOMUXB_GPIO0_B01, GPIOPortB_Pin0, GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_tchip_tr806d.c b/drivers/net/wireless/wifi_power/vendor/wp_tchip_tr806d.c deleted file mode 100755 index b8887ca01106..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_tchip_tr806d.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * wifi_power.c for MID_AIGO_E700. - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, GPIOB1_SMCS1_MMC0PCA_NAME, - IOMUXA_GPIO0_B1, GPIOPortB_Pin1, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, GPIOG0_UART0_MMC1DET_NAME, - IOMUXA_GPIO1_C0, GPIOPortG_Pin0, GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_yifang_a7_2818.c b/drivers/net/wireless/wifi_power/vendor/wp_yifang_a7_2818.c deleted file mode 100755 index cd700612140e..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_yifang_a7_2818.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * wifi_power.c - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, WIFI_PWDN_IOMUX_PINNAME, - WIFI_PWDN_IOMUX_PINDIR, WIFI_PWDN_IOPIN, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_GPIO, 0, 0, 0, WIFI_RST_IOPIN, GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_yuxing_mid7001.c b/drivers/net/wireless/wifi_power/vendor/wp_yuxing_mid7001.c deleted file mode 100755 index 7e9ef24752a7..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_yuxing_mid7001.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * wifi_power.c - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, GPIOF0_UART1_CPWM0_NAME, - IOMUXA_GPIO1_B0, GPIOPortF_Pin0, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_yuxing_mid704.c b/drivers/net/wireless/wifi_power/vendor/wp_yuxing_mid704.c deleted file mode 100755 index 045fe5cea81b..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_yuxing_mid704.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * wifi_power.c - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, GPIOB1_SMCS1_MMC0PCA_NAME, - IOMUXA_GPIO0_B1, GPIOPortB_Pin1, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_GPIO, 0, 0, 0, GPIOPortA_Pin4, GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/vendor/wp_yuxing_umpc1001.c b/drivers/net/wireless/wifi_power/vendor/wp_yuxing_umpc1001.c deleted file mode 100755 index 045fe5cea81b..000000000000 --- a/drivers/net/wireless/wifi_power/vendor/wp_yuxing_umpc1001.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * wifi_power.c - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, GPIOB1_SMCS1_MMC0PCA_NAME, - IOMUXA_GPIO0_B1, GPIOPortB_Pin1, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_GPIO, 0, 0, 0, GPIOPortA_Pin4, GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/wifi_config.c b/drivers/net/wireless/wifi_power/wifi_config.c deleted file mode 100644 index 30315ee4b180..000000000000 --- a/drivers/net/wireless/wifi_power/wifi_config.c +++ /dev/null @@ -1,62 +0,0 @@ - -#include - -/* - * You may set default region here. - * 0x10 -- America - */ -int wifi_default_region = 0x10; // Country / region code - -/* - * When WiFi is IDLE with disconnected state as long as - * wifi_closed_timeout, we will ask Android to turn off WiFi. - */ -int wifi_turnoff_timeout = 6; //unit is 10 seconds, ex. 6 means 60 seconds - -/* - * Please choose the source for mac address. - * - * For the following modules, an eeprom is embedded in module, - * so don't care this variable: - * 01. Samsung SWL-2480 - * - * For the following modules, you need to set the correct value: - * 01. Atheros AR6102 / AR6122 - */ -#define MAC_ADDR_FROM_SOFTMAC_FILE 0 /* from system/etc/firmware/softmac */ -#define MAC_ADDR_FROM_RANDOM 1 /* pseudo-random mac */ -#define MAC_ADDR_FROM_EEPROM 2 /* If there is an external eeprom */ -#define MAC_ADDR_FROM_EEPROM_FILE 3 /* from system/etc/firmware/calData_ar6102_15dBm.bin */ - -int wifi_mac_addr_source = MAC_ADDR_FROM_RANDOM; - -/* - * When WiFi is IDLE in 2 minutes, we will put WiFi - * into deep sleep for power saving. - */ -unsigned long driver_ps_timeout = 2 * 60 * 1000; //2 minutes - -/* - * User customized MAC address. - * - * Return value: 0 -- not customized, 1 -- customized. - */ -#if 1 -int wifi_customized_mac_addr(u8 *mac) -{ - return 0; -} -#else -extern int kld_get_wifi_mac(u8 *mac); - -int wifi_customized_mac_addr(u8 *mac) -{ - kld_get_wifi_mac(mac); - - printk("We are using customized MAC: %02X:%02X:%02X:%02X:%02x:%02x\n", - mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - - return 1; -} -#endif - diff --git a/drivers/net/wireless/wifi_power/wifi_power.c b/drivers/net/wireless/wifi_power/wifi_power.c deleted file mode 100755 index 2b2923afc490..000000000000 --- a/drivers/net/wireless/wifi_power/wifi_power.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * wifi_power.c - * - * Power control for WIFI module. - * - * Yongle Lai @ Rockchip - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -/* - * GPIO to control LDO/DCDC. - * - * 用于控制WIFI的电源,通常是3.3V和1.8V,可能1.2V也在其中。 - * - * 如果是扩展IO,请参考下面的例子: - * POWER_USE_EXT_GPIO, 0, 0, 0, PCA9554_Pin1, GPIO_HIGH - */ -struct wifi_power power_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_IOMUX, - GPIO5D6_SDMMC1PWREN_NAME, GPIO5H_GPIO5D6, RK29_PIN5_PD6, GPIO_HIGH -}; - -/* - * GPIO to control WIFI PowerDOWN/RESET. - * - * 控制WIFI的PowerDown脚。有些模组PowerDown脚是和Reset脚短接在一起。 - */ -struct wifi_power power_save_gpio = -{ - POWER_USE_GPIO, POWER_GPIO_NOT_IOMUX, 0, 0, RK29_PIN6_PC0, GPIO_HIGH -}; - -/* - * GPIO to reset WIFI. Keep this as NULL normally. - * - * 控制WIFI的Reset脚,通常WiFi模组没有用到这个引脚。 - */ -struct wifi_power power_reset_gpio = -{ - 0, 0, 0, 0, 0, 0 -}; - -/* - * 在WIFI被上电前,会调用这个函数。 - */ -void wifi_turn_on_callback(void) -{ -} - -/* - * 在WIFI被下电后,会调用这个函数。 - */ -void wifi_turn_off_callback(void) -{ -} - -/* - * If external GPIO chip such as PCA9554 is being used, please - * implement the following 2 function. - * - * id: is GPIO identifier, such as GPIOPortF_Pin0, or external - * name defined in struct wifi_power. - * sens: the value should be set to GPIO, usually is GPIO_HIGH or GPIO_LOW. - * - * 如果有用扩展GPIO来控制WIFI,请实现下面的函数: - * 函数的功能是:控制指定的IO口id,使其状态切换为要求的sens状态。 - * id : 是IO的标识号,以整数的形式标识。 - * sens: 是要求的IO状态,为高或低。 - */ -void wifi_extgpio_operation(u8 id, u8 sens) -{ - //pca955x_gpio_direction_output(id, sens); -} - -/* - * 在系统中如果要调用WIFI的IO控制,将WIFI下电,可以调用如下接口: - * void rockchip_wifi_shutdown(void); - * 但注意需要在宏WIFI_GPIO_POWER_CONTROL的控制下。 - */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/wifi_power.h b/drivers/net/wireless/wifi_power/wifi_power.h deleted file mode 100755 index 97e1ad3dd202..000000000000 --- a/drivers/net/wireless/wifi_power/wifi_power.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * wifi_power.h - * - * WIFI power control. - * - * Yongle Lai - */ - -#ifndef WIFI_POWER_H -#define WIFI_POWER_H - -#include - -#define WIFI_GPIO_POWER_CONTROL 1 - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) -#include -#include -#else -#include -#include - -#endif - -#define WIFI_CHIP_MV8686 0 -#define WIFI_CHIP_AR6002 1 -#define WIFI_CHIP_BCM4319 2 -#define WIFI_CHIP_NRX700 3 -#define WIFI_CHIP_RT3070 4 - -#define POWER_NOT_USE_GPIO 0 -#define POWER_USE_GPIO 1 -#define POWER_USE_EXT_GPIO 2 /* External GPIO chip is used, such as PCA9554. */ - -#define POWER_GPIO_NOT_IOMUX 0 -#define POWER_GPIO_IOMUX 1 - -#define GPIO_SWITCH_OFF 0 -#define GPIO_SWITCH_ON 1 - -struct wifi_power -{ - u8 use_gpio; /* If uses GPIO to control wifi power supply. 0 - no, 1 - yes. */ - u8 gpio_iomux; /* If the GPIO is iomux. 0 - no, 1 - yes. */ - char *iomux_name; /* IOMUX name */ - u8 iomux_value; /* IOMUX value - which function is choosen. */ - u8 gpio_id; /* GPIO number */ - u8 sensi_level; /* GPIO sensitive level. */ -}; - -int wifi_turn_on_card(int module); -int wifi_turn_off_card(void); -int wifi_reset_card(void); -void wifi_extgpio_operation(u8 id, u8 sens); - -void rockchip_wifi_shutdown(void); - -#endif /* WIFI_GPIO_POWER_CONTROL */ - -#define WIFI_NETWORK_BUSY 0 -#define WIFI_NETWORK_IDLE 1 - -int wifi_power_save_init(void); -int wifi_power_save_exit(void); -int wifi_power_save_stop(void); -int wifi_power_save_state(void); -void wifi_power_save_suspend(void); -void wifi_power_save_resume(void); -int wifi_power_save_register_callback(int (*callback)(int status)); - -void wifi_turn_on_callback(void); -void wifi_turn_off_callback(void); - -#if defined(CONFIG_RALINK_RT3070) || defined(CONFIG_REALTEK_RTL8192) - -int wifi_activate_usb(void); -int wifi_deactivate_usb(void); -void wifi_usb_init(void); - -#endif - -#endif /* WIFI_POWER_H */ - diff --git a/drivers/net/wireless/wifi_power/wifi_power_ops.c b/drivers/net/wireless/wifi_power/wifi_power_ops.c deleted file mode 100755 index 559c7d02d2ee..000000000000 --- a/drivers/net/wireless/wifi_power/wifi_power_ops.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * wifi_power.c - * - * Yongle Lai @ Rockchip Fuzhou @ 20100303. - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -extern struct wifi_power power_gpio; -extern struct wifi_power power_save_gpio; -extern struct wifi_power power_reset_gpio; - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) -#define OS_IOMUX(name, value) rockchip_mux_api_set((name), (value)) -#else -#define OS_IOMUX(name, value) rk29_mux_api_set((name), (value)); -#endif - -int wifi_gpio_operate(struct wifi_power *gpio, int flag) -{ - int sensitive; - - if (gpio->use_gpio == POWER_NOT_USE_GPIO) - return 0; - - if (gpio->gpio_iomux == POWER_GPIO_IOMUX) - { - OS_IOMUX(gpio->iomux_name, gpio->iomux_value); - } - - if (flag == GPIO_SWITCH_ON) - sensitive = gpio->sensi_level; - else - sensitive = 1 - gpio->sensi_level; - - if (gpio->use_gpio == POWER_USE_EXT_GPIO) - { - wifi_extgpio_operation(gpio->gpio_id, sensitive); - } - else - { -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - gpio_direction_output(gpio->gpio_id, GPIO_OUT); - __gpio_set(gpio->gpio_id, sensitive); -#else - gpio_direction_output(gpio->gpio_id, sensitive); - gpio_set_value(gpio->gpio_id, sensitive); -#endif - } - - return 0; -} - -// WiFi reset sequence -int wifi_reset_card(void) -{ - if (power_reset_gpio.use_gpio == POWER_NOT_USE_GPIO) - return 0; - - wifi_gpio_operate(&power_reset_gpio, GPIO_SWITCH_ON); - mdelay(1); - - wifi_gpio_operate(&power_reset_gpio, GPIO_SWITCH_OFF); - mdelay(3); - - wifi_gpio_operate(&power_reset_gpio, GPIO_SWITCH_ON); - mdelay(3); - - return 0; -} - -/* - * WiFi power up sequence - */ -int wifi_turn_on_mv8686_card(void) -{ - /* - * Make sure we are in power off. - * MV8686 doesn't care power down sequence. - */ - wifi_gpio_operate(&power_save_gpio, GPIO_SWITCH_OFF); - wifi_gpio_operate(&power_gpio, GPIO_SWITCH_OFF); - mdelay(5); - - wifi_gpio_operate(&power_save_gpio, GPIO_SWITCH_ON); - mdelay(5); - - wifi_gpio_operate(&power_gpio, GPIO_SWITCH_ON); - msleep(20); - - /* Reset sequence if necessary. */ - wifi_reset_card(); - - return 0; -} - -int wifi_turn_on_nrx700_card(void) -{ - /* - * Make sure we are in power off. - */ - wifi_gpio_operate(&power_save_gpio, GPIO_SWITCH_OFF); - wifi_gpio_operate(&power_gpio, GPIO_SWITCH_OFF); - mdelay(5); - - wifi_gpio_operate(&power_gpio, GPIO_SWITCH_ON); - mdelay(10); - - wifi_gpio_operate(&power_save_gpio, GPIO_SWITCH_ON); - msleep(130); - - /* Reset sequence if necessary. */ - wifi_reset_card(); - - return 0; -} - -int wifi_turn_on_bcm4319_card(void) -{ - /* - * Make sure we are in power off. - */ - wifi_gpio_operate(&power_save_gpio, GPIO_SWITCH_OFF); - wifi_gpio_operate(&power_gpio, GPIO_SWITCH_OFF); - mdelay(5); - - wifi_gpio_operate(&power_gpio, GPIO_SWITCH_ON); - mdelay(10); - - wifi_gpio_operate(&power_save_gpio, GPIO_SWITCH_ON); - msleep(130); - - /* Reset sequence if necessary. */ - wifi_reset_card(); - - return 0; -} - -int wifi_turn_on_ar6002_card(void) -{ - /* - * Make sure we are in power off. - * AR6002 requires PWN first before IO supply. - */ - wifi_gpio_operate(&power_save_gpio, GPIO_SWITCH_OFF); - wifi_gpio_operate(&power_gpio, GPIO_SWITCH_OFF); - mdelay(10); - - wifi_gpio_operate(&power_save_gpio, GPIO_SWITCH_ON); - mdelay(1); - - wifi_gpio_operate(&power_gpio, GPIO_SWITCH_ON); - mdelay(3); - - /* - * Give a reset wave. - */ - wifi_gpio_operate(&power_save_gpio, GPIO_SWITCH_OFF); - mdelay(3); - wifi_gpio_operate(&power_save_gpio, GPIO_SWITCH_ON); - mdelay(20); - - return 0; -} - -int wifi_turn_on_rt3070_card(void) -{ - wifi_gpio_operate(&power_gpio, GPIO_SWITCH_ON); - if (power_gpio.use_gpio != POWER_NOT_USE_GPIO) - msleep(1000); - - return 0; -} - -int wifi_turn_on_card(int module) -{ - wifi_turn_on_callback(); - - if (module == WIFI_CHIP_MV8686) - wifi_turn_on_mv8686_card(); - else if (module == WIFI_CHIP_AR6002) - wifi_turn_on_ar6002_card(); - else if (module == WIFI_CHIP_BCM4319) - wifi_turn_on_bcm4319_card(); - else if (module == WIFI_CHIP_NRX700) - wifi_turn_on_nrx700_card(); - else if (module == WIFI_CHIP_RT3070) - wifi_turn_on_rt3070_card(); - else - printk("%s: invalid module ID.\n", __func__); - - /* Reset sequence if necessary. */ - wifi_reset_card(); - - return 0; -} - -int wifi_turn_off_card(void) -{ - wifi_gpio_operate(&power_reset_gpio, GPIO_SWITCH_OFF); - wifi_gpio_operate(&power_save_gpio, GPIO_SWITCH_OFF); - mdelay(1); - wifi_gpio_operate(&power_gpio, GPIO_SWITCH_OFF); - mdelay(3); - - wifi_turn_off_callback(); - - return 0; -} - -void rockchip_wifi_shutdown(void) -{ - printk("rockchip_wifi_shutdown....\n"); - - wifi_turn_off_card(); -} -EXPORT_SYMBOL(rockchip_wifi_shutdown); - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/wifi_power_save.c b/drivers/net/wireless/wifi_power/wifi_power_save.c deleted file mode 100755 index 3c4ba0017019..000000000000 --- a/drivers/net/wireless/wifi_power/wifi_power_save.c +++ /dev/null @@ -1,469 +0,0 @@ -/* - * Wifi power save module. - * - * Yongle Lai @ Rockchip Fuzhou - */ - -#include -#include -#include -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) -#include -#endif -#include -#include -#include -#include - -#include "wifi_power.h" - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) -extern struct inet_hashinfo __cacheline_aligned tcp_hashinfo; -#else -extern struct inet_hashinfo tcp_hashinfo; -#endif - -struct timer_list wifi_ps_timer; -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) -android_suspend_lock_t wifi_android_lock; -#endif - -#define TIMER_INTERVAL 2000 //unit is micro second. -#define IDLE_SW_COUNT 8 //16 seconds from BUSY to IDLE -/* - * When wifi driver isn't ready. We should be IDLE. - */ -volatile static int wifi_net_state = WIFI_NETWORK_IDLE; -struct net_device *wlan_netdev = NULL; -unsigned long wifi_iptx_packets = 0, wifi_iptx_packets_back = 0; -unsigned long wifi_iprx_packets = 0, wifi_iprx_packets_back = 0; -unsigned int wifi_iptx = 0, wifi_iprx = 0; - -int (*wifi_power_save_callback)(int status) = NULL; - -int wifi_ps_active = 0; //Whether we should work. - -void wifi_power_save_suspend(void) -{ - wifi_ps_active = 0; -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - //android_lock_suspend(&wifi_android_lock); -#endif -} - -void wifi_power_save_resume(void) -{ - wifi_ps_active = 1; -} - -int wifi_power_save_register_callback(int (*callback)(int status)) -{ - //printk("%s: enter....\n", __func__); - - wifi_power_save_callback = callback; - - return 0; -} - -/* - * Do statistics 20 seconds. - */ -int wifi_evaluate_rx_traffic(void) -{ - //int ret = 1; - static int count = 0; - - if (wlan_netdev == NULL) - { - printk("wlan_netdev is NULL.\n"); - return 1; - } - - if (count < 10) /* 10 * 2 = 20 seconds */ - { - count++; - return wifi_iprx; - } - - count = 0; - - wifi_iprx_packets = wlan_netdev->stats.rx_packets; - - /* - * 3 packets in 20 seconds mean connection is active. - */ - if ((wifi_iprx_packets - wifi_iprx_packets_back) >= 2) - { - wifi_iprx = 1; - } - else - { - wifi_iprx = 0; - } - - wifi_iprx_packets_back = wifi_iprx_packets; - - return wifi_iprx; -} - -int wifi_evaluate_tx_traffic(void) -{ - //int ret = 1; - static int count = 0; - - if (wlan_netdev == NULL) - { - printk("wlan_netdev is NULL.\n"); - return 1; - } - - if (count < 10) /* 10 * 2 = 20 seconds */ - { - count++; - return wifi_iptx; - } - - count = 0; - - wifi_iptx_packets = wlan_netdev->stats.tx_packets; - - /* - * 2 packets in 20 seconds mean connection is active. - */ - if ((wifi_iptx_packets - wifi_iptx_packets_back) >= 2) - { - wifi_iptx = 1; - } - else - { - wifi_iptx = 0; - } - - wifi_iptx_packets_back = wifi_iptx_packets; - - return wifi_iptx; -} - -#if 0 -int wifi_evaluate_traffic(void) -{ - int ret = 1; - - if (wlan_netdev == NULL) - { - printk("wlan_netdev is NULL.\n"); - return 1; - } - - wifi_iprx_packets = wlan_netdev->stats.rx_packets; - wifi_iptx_packets = wlan_netdev->stats.tx_packets; - - /* - * 3 packets in 10 seconds mean connection is active. - */ - if ((wifi_iptx_packets - wifi_iptx_packets_back) >= 2) - wifi_iptx = 0; - else - wifi_iptx++; - - if ((wifi_iprx_packets - wifi_iprx_packets_back) >= 2) - wifi_iprx = 0; - else - wifi_iprx++; - - //printk("wifi_packets: TX = %lu RX = %lu ", wifi_iptx_packets, wifi_iprx_packets); - //printk("NO IP: TX = %u RX = %u\n", wifi_iptx, wifi_iprx); - - /* NO tx and rx, we are idle. */ - if ((wifi_iptx >= 10) && (wifi_iprx >= 10)) - ret = 0; - - wifi_iptx_packets_back = wifi_iptx_packets; - wifi_iprx_packets_back = wifi_iprx_packets; - - return ret; -} -#endif - -int wifi_check_tcp_connection(void) -{ - int bucket, num = 0; - struct inet_sock *inet = NULL; - __be32 dest; - - for (bucket = 0; bucket < tcp_hashinfo.ehash_size; ++bucket) - { - struct sock *sk; -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - struct hlist_node *node; - rwlock_t *lock = inet_ehash_lockp(&tcp_hashinfo, bucket); - - read_lock_bh(lock); - - sk_for_each(sk, node, &tcp_hashinfo.ehash[bucket].chain) -#else - struct hlist_nulls_node *node; - spinlock_t *lock = inet_ehash_lockp(&tcp_hashinfo, bucket); - - spin_lock_bh(lock); - - sk_nulls_for_each(sk, node, &tcp_hashinfo.ehash[bucket].chain) -#endif - { - if ((sk->__sk_common.skc_state != TCP_ESTABLISHED) && - (sk->__sk_common.skc_state != TCP_SYN_SENT) && - (sk->__sk_common.skc_state != TCP_SYN_SENT)) - continue; - - /* - * tcp 0 0 127.0.0.1:34937 127.0.0.1:54869 ESTABLISHED - */ - inet = inet_sk(sk); - dest = inet->daddr; - //printk("destination address: %x\n", dest); - if ((dest == 0x100007F) || (dest == 0)) - continue; - - num++; - //printk("connection state: %x\n", sk->__sk_common.skc_state); - } -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - read_unlock_bh(lock); -#else - spin_unlock_bh(lock); -#endif - } - - return num; -} - -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) -extern struct udp_table udp_table; -#endif - -int wifi_check_udp_connection(void) -{ - struct sock *sk; - int num = 0, bucket; - struct inet_sock *inet = NULL; - __be32 dest; - - - - for (bucket = 0; bucket < UDP_HTABLE_SIZE; ++bucket) - { -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - struct hlist_node *node; - - read_lock(&udp_hash_lock); - - sk_for_each(sk, node, udp_hash + bucket) -#else - struct hlist_nulls_node *node; - struct udp_hslot *hslot = &udp_table.hash[bucket]; - - spin_lock_bh(&hslot->lock); - - sk_nulls_for_each(sk, node, &hslot->head) -#endif - { - inet = inet_sk(sk); - dest = inet->daddr; - - if ((dest == 0x100007F) || (dest == 0)) - continue; - - num++; - } -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - read_unlock(&udp_hash_lock); -#else - spin_unlock_bh(&hslot->lock); -#endif - } - - return num; -} - -int wifi_check_mcast_connection(void) -{ - int ret = 0; - - //printk("Multicast group: %d\n", wlan_netdev->mc_count); - - if (wlan_netdev && (wlan_netdev->mc_count > 1)) - ret = wlan_netdev->mc_count - 1; - - return ret; -} - -int idle_count = 0; - -static int wifi_ps_sm(int new_state) -{ - if (new_state == WIFI_NETWORK_BUSY) - { - idle_count = 0; - return WIFI_NETWORK_BUSY; - } - - if (new_state == WIFI_NETWORK_IDLE) - { - if (idle_count >= IDLE_SW_COUNT) - return WIFI_NETWORK_IDLE; - else - { - idle_count++; - return WIFI_NETWORK_BUSY; - } - } - - return WIFI_NETWORK_IDLE; -} - -static void wifi_ps_timer_fn(unsigned long data) -{ - int tcp, udp, tx = 0, rx = 0, new_state; - int mcast = 0; - - if (wifi_ps_active == 0) - { - printk("Power save module is IDLE for now.\n"); - goto out; - } - - tcp = wifi_check_tcp_connection(); - udp = wifi_check_udp_connection(); - tx = wifi_evaluate_tx_traffic(); - rx = wifi_evaluate_rx_traffic(); - mcast = wifi_check_mcast_connection(); - //printk("Network state: m=%d t=%d u=%d tx=%d rx=%d.\n", mcast, tcp, udp, tx, rx); - - /* - * Initially, multicast group number is 1. - */ - if ((tcp == 0) && (udp == 0) && (mcast <= 0)) - { - new_state = wifi_ps_sm(WIFI_NETWORK_IDLE); - } - else if ((wifi_net_state == WIFI_NETWORK_IDLE) && - ((tcp > 0) || (udp > 0))) - { - new_state = wifi_ps_sm(WIFI_NETWORK_BUSY); - } - else if ((tx == 0) && (rx == 0)) - { - new_state = wifi_ps_sm(WIFI_NETWORK_IDLE); - } - else - { - new_state = wifi_ps_sm(WIFI_NETWORK_BUSY); - } - - if (new_state != wifi_net_state) - { - wifi_net_state = new_state; - if (new_state == WIFI_NETWORK_IDLE) - { - printk("Network is IDLE, m=%d t=%d u=%d tx=%d rx=%d.\n", mcast, tcp, udp, tx, rx); - - if (wifi_power_save_callback != NULL) - wifi_power_save_callback(WIFI_NETWORK_IDLE); -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - android_unlock_suspend(&wifi_android_lock); -#endif - } - else - { - printk("Network is BUSY, m=%d t=%d u=%d tx=%d rx=%d.\n", mcast, tcp, udp, tx, rx); -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - android_lock_suspend(&wifi_android_lock); -#endif - if (wifi_power_save_callback != NULL) - wifi_power_save_callback(WIFI_NETWORK_BUSY); - } - } -out: - mod_timer(&wifi_ps_timer, jiffies + msecs_to_jiffies(TIMER_INTERVAL)); -} - -/* - * Return the current network status, which indicates - * whether network is busy or not. - */ -int wifi_power_save_state(void) -{ - return wifi_net_state; -} - -int wifi_power_save_init(void) -{ - int ret = 0; - - //wifi_power_save_callback = NULL; - - wifi_ps_active = 1; - wifi_iptx_packets = 0; - wifi_iprx_packets = 0; - wifi_iptx_packets_back = 0; - wifi_iprx_packets_back = 0; - wifi_iptx = 1; - wifi_iprx = 1; - idle_count = 0; - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - wifi_android_lock.name = "wifidev"; - - android_init_suspend_lock(&wifi_android_lock); - android_lock_suspend(&wifi_android_lock); -#endif - wifi_net_state = WIFI_NETWORK_BUSY; - - wlan_netdev = dev_get_by_name(&init_net, "wlan0"); - if (wlan_netdev == NULL) - printk("%s: couldn't find net_device for wlan0.\n", __func__); - - /* - * Create a timer to check network status. - */ - setup_timer(&wifi_ps_timer, wifi_ps_timer_fn, (unsigned long)0); - mod_timer(&wifi_ps_timer, jiffies + msecs_to_jiffies(15000)); - - return ret; -} - -int wifi_power_save_stop(void) -{ - wifi_ps_active = 0; - msleep(3); - - del_timer_sync(&wifi_ps_timer); - - if (wlan_netdev != NULL) - dev_put(wlan_netdev); - - wlan_netdev = NULL; - - return 0; -} - -int wifi_power_save_exit(void) -{ -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) - android_unlock_suspend(&wifi_android_lock); - android_uninit_suspend_lock(&wifi_android_lock); -#endif - wifi_net_state = WIFI_NETWORK_IDLE; - - wifi_power_save_callback = NULL; - - wifi_iptx_packets = 0; - wifi_iprx_packets = 0; - wifi_iptx_packets_back = 0; - wifi_iprx_packets_back = 0; - wifi_iptx = 0; - wifi_iprx = 0; - - return 0; -} - diff --git a/drivers/net/wireless/wifi_power/wifi_power_usb.c b/drivers/net/wireless/wifi_power/wifi_power_usb.c deleted file mode 100755 index c8e6fcc84e51..000000000000 --- a/drivers/net/wireless/wifi_power/wifi_power_usb.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * wifi_power.c - * - * Power control for WIFI module. - * - * There are Power supply and Power Up/Down controls for WIFI typically. - */ -#include -#include -#include -#include - -#include "wifi_power.h" - -#if (WIFI_GPIO_POWER_CONTROL == 1) - -#ifdef CONFIG_RALINK_RT3070 - -int wifi_change_usb_mode = 0; -int usb_wifi_status = 0; - -void wifi_usb_init(void) -{ - wifi_change_usb_mode = 0; - usb_wifi_status = 0; -} - -#define DONT_SWITCH_USB 0 /* Don't switch USB automaticately. */ -#define WIFI_USE_OTG 1 /* WiFi will be connected to USB OTG. */ -#define WIFI_USE_HOST11 2 /* WiFi will be connected to USB HOST 1.1. */ - -#define WIFI_USE_IFACE 2 - -#if (WIFI_USE_IFACE == WIFI_USE_OTG) - -#define USB_NORMAL 0 -#define USB_FORCE_HOST 1 -#define USB_FORCE_DEVICE 2 - -extern int usb_force_usb_for_wifi(int mode); - -/* - * Change USB mode to HOST. - */ -int wifi_activate_usb(void) -{ - wifi_turn_on_card(WIFI_CHIP_RT3070); - - wifi_change_usb_mode = usb_force_usb_for_wifi(USB_FORCE_HOST); - msleep(1000); - - usb_wifi_status = 1; - - return 0; -} - -/* - * Change USB mode to be original. - */ -int wifi_deactivate_usb(void) -{ - if (wifi_change_usb_mode == 1) - { - usb_force_usb_for_wifi(USB_FORCE_DEVICE); - msleep(1000); - usb_force_usb_for_wifi(USB_NORMAL); - msleep(1000); - } - wifi_turn_off_card(); - - usb_wifi_status = 0; - - return 0; -} - -#elif (WIFI_USE_IFACE == WIFI_USE_HOST11) - -extern int usb_switch_usb_host11_for_wifi(int enabled); - -int wifi_deactivate_usb(void) -{ - usb_switch_usb_host11_for_wifi(0); - msleep(1000); - - wifi_turn_off_card(); - msleep(100); - - return 0; -} - -int wifi_activate_usb(void) -{ - wifi_turn_on_card(WIFI_CHIP_RT3070); - msleep(100); - - usb_switch_usb_host11_for_wifi(1); - msleep(1000); - - return 0; -} - -#else - -int wifi_deactivate_usb(void) -{ - return 0; -} - -int wifi_activate_usb(void) -{ - return 0; -} -#endif - -#endif /* CONFIG_RALINK_RT3070 */ - -#endif /* WIFI_GPIO_POWER_CONTROL */ - diff --git a/drivers/net/wireless/wifi_power/wifi_version.h b/drivers/net/wireless/wifi_power/wifi_version.h deleted file mode 100644 index 5282f726f89a..000000000000 --- a/drivers/net/wireless/wifi_power/wifi_version.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Yongle Lai @ Rockchip - */ -#ifndef WIFI_VERSION_H -#define WIFI_VERSION_H - -/* - * Marvell MV8686 driver version. - */ -#define MV8686_DRV_VERSION "2.35" - -/* - * Atheros AR6002 driver version. - */ -#define AR6002_DRV_VERSION "3.11" - -/* - * Ralink RT3070 driver version. - */ -#define RT3070_DRV_VERSION "2.10" - -/* - * Broadcom BCM4319 driver version. - */ -#define BCM4319_DRV_VERSION "1.05" - -/* - * Nanoradio NRX700 driver version. - */ -#define NRX700_DRV_VERSION "2.02" - -/* - * Marvell MV8787 driver version. - */ -#define MV8787_DRV_VERSION "1.00" - -/* - * Realtek RTL8188 driver version. - */ -#define RTL8192_DRV_VERSION "0.02" - -#endif /* WIFI_VERSION_H */ - diff --git a/drivers/net/wireless/wifi_sys/rkwifi_sys_iface.c b/drivers/net/wireless/wifi_sys/rkwifi_sys_iface.c deleted file mode 100755 index dc1a8f8ca2ff..000000000000 --- a/drivers/net/wireless/wifi_sys/rkwifi_sys_iface.c +++ /dev/null @@ -1,439 +0,0 @@ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef CONFIG_MACH_RK_FAC -#include -extern int wifi_type; -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) -static ssize_t wifi_chip_read(struct class *cls, struct class_attribute *attr, char *_buf) -#else -static ssize_t wifi_chip_read(struct class *cls, char *_buf) -#endif -{ - int count = 0; - -#ifdef CONFIG_MACH_RK_FAC - if(wifi_type==WIFI_TYPE_RTL8188CU) { - count = sprintf(_buf, "%s", "RTL8188CU"); - printk("Current WiFi chip is RTL8188CU.\n"); - return count; - } else if(wifi_type==WIFI_TYPE_RTL8188EU) { - count = sprintf(_buf, "%s", "RTL8188EU"); - printk("Current WiFi chip is RTL8188EU.\n"); - return count; - } else if(wifi_type==WIFI_TYPE_MT7601) { - count = sprintf(_buf, "%s", "MT7601"); - printk("Current WiFi chip is MT7601.\n"); - return count; - } else if(wifi_type==WIFI_TYPE_RTL8188ETV) { - count = sprintf(_buf, "%s", "RTL8188ETV"); - printk("Current WiFi chip is RTL8188ETV.\n"); - return count; - } else if(wifi_type==WIFI_TYPE_MT5370) { - count = sprintf(_buf, "%s", "MT5370"); - printk("Current WiFi chip is MT5370.\n"); - return count; - } else { - //printk("NOT surpport type %d\n",wifi_type); - } -#endif - -#ifdef CONFIG_BCM4329 - count = sprintf(_buf, "%s", "BCM4329"); - printk("Current WiFi chip is BCM4329.\n"); -#endif - -#ifdef CONFIG_RTL8192CU - count = sprintf(_buf, "%s", "RTL8188CU"); - printk("Current WiFi chip is RTL8188CU.\n"); -#endif - -#ifdef CONFIG_RTL8188EU - count = sprintf(_buf, "%s", "RTL8188EU"); - printk("Current WiFi chip is RTL8188EU.\n"); -#endif - -#ifdef CONFIG_RTL8723AU - count = sprintf(_buf, "%s", "RTL8723AU"); - printk("Current WiFi chip is RTL8723AU.\n"); -#endif - -#ifdef CONFIG_RTL8189ES - count = sprintf(_buf, "%s", "RTL8189ES"); - printk("Current WiFi chip is RTL8189ES.\n"); -#endif - -#ifdef CONFIG_BCM4330 - count = sprintf(_buf, "%s", "BCM4330"); - printk("Current WiFi chip is BCM4330.\n"); -#endif - -#ifdef CONFIG_RK901 -#ifdef CONFIG_BCM_OOB_ENABLED - count = sprintf(_buf, "%s", "OOB_RK901"); - printk("Current WiFi chip is RK901(OOB)\n"); -#else - count = sprintf(_buf, "%s", "RK901"); - printk("Current WiFi chip is RK901.\n"); -#endif -#endif - -#ifdef CONFIG_RK903 -#ifdef CONFIG_BCM_OOB_ENABLED - count = sprintf(_buf, "%s", "OOB_RK903"); - printk("Current WiFi chip is RK903(OOB)\n"); -#else - count = sprintf(_buf, "%s", "RK903"); - printk("Current WiFi chip is RK903.\n"); -#endif -#endif - -#ifdef CONFIG_AP6181 -#ifdef CONFIG_BCM_OOB_ENABLED - count = sprintf(_buf, "%s", "OOB_RK901"); - printk("Current WiFi chip is AP6181(OOB)\n"); -#else - count = sprintf(_buf, "%s", "RK901"); - printk("Current WiFi chip is AP6181.\n"); -#endif -#endif - -#ifdef CONFIG_AP6210 -#ifdef CONFIG_BCM_OOB_ENABLED - count = sprintf(_buf, "%s", "OOB_RK901"); - printk("Current WiFi chip is AP6210(OOB)\n"); -#else - count = sprintf(_buf, "%s", "RK901"); - printk("Current WiFi chip is AP6210.\n"); -#endif -#endif - -#ifdef CONFIG_AP6330 -#ifdef CONFIG_BCM_OOB_ENABLED - count = sprintf(_buf, "%s", "OOB_RK903"); - printk("Current WiFi chip is AP6330(OOB)\n"); -#else - count = sprintf(_buf, "%s", "RK903"); - printk("Current WiFi chip is AP6330.\n"); -#endif -#endif - -#ifdef CONFIG_AP6476 -#ifdef CONFIG_BCM_OOB_ENABLED - count = sprintf(_buf, "%s", "OOB_RK901"); - printk("Current WiFi chip is AP6476(OOB)\n"); -#else - count = sprintf(_buf, "%s", "RK901"); - printk("Current WiFi chip is AP6476.\n"); -#endif -#endif - -#ifdef CONFIG_AP6493 -#ifdef CONFIG_BCM_OOB_ENABLED - count = sprintf(_buf, "%s", "OOB_RK903"); - printk("Current WiFi chip is AP6493(OOB)\n"); -#else - count = sprintf(_buf, "%s", "RK903"); - printk("Current WiFi chip is AP6493.\n"); -#endif -#endif - -#ifdef CONFIG_GB86302I -#ifdef CONFIG_BCM_OOB_ENABLED - count = sprintf(_buf, "%s", "OOB_RK903"); - printk("Current WiFi chip is GB86302I(OOB)\n"); -#else - count = sprintf(_buf, "%s", "RK903"); - printk("Current WiFi chip is GB86302I.\n"); -#endif -#endif - -#ifdef CONFIG_MTK_COMBO - count = sprintf(_buf, "%s", "MT6620"); - printk("Current WiFi chip is MT6620.\n"); -#endif - -#ifdef CONFIG_RT5370 - count = sprintf(_buf, "%s", "RT5370"); - printk("Current WiFi chip is RT5370.\n"); -#endif - -#ifdef CONFIG_MT5931 - count = sprintf(_buf, "%s", "MT5931"); - printk("Current WiFi chip is MT5931.\n"); -#endif - -#ifdef CONFIG_MT5931_MT6622 - count = sprintf(_buf, "%s", "MT5931"); - printk("Current WiFi chip is MT5931.\n"); -#endif - -#ifdef CONFIG_MT7601 - count = sprintf(_buf, "%s", "MT7601"); - printk("Current WiFi chip is MT7601.\n"); -#endif - - -#ifdef CONFIG_RTL8723AS - count = sprintf(_buf, "%s", "RTL8723AS"); - printk("Current WiFi chip is RTL8723AS.\n"); -#endif - -#ifdef CONFIG_ESP8089 - count = sprintf(_buf, "%s", "ESP8089"); - printk("Current WiFi chip is ESP8089.\n"); -#endif - - return count; -} - -/* -static ssize_t wifi_channel_write(struct class *cls, const char *_buf, size_t _count) -{ - int ret, channel; - - if (wifi_enabled == 0) - { - printk("WiFi is disabled.\n"); - return _count; - } - - channel = simple_strtol(_buf, NULL, 10); - - ret = wifi_emi_set_channel(channel); - if (ret != 0) - { - //printk("Set channel=%d fail.\n", channel); - } - else - { - //printk("Set channel=%d successfully.\n", channel); - wifi_channel = channel; - } - - return _count; -} -*/ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) -static ssize_t wifi_p2p_read(struct class *cls, struct class_attribute *attr, char *_buf) -#else -static ssize_t wifi_p2p_read(struct class *cls, char *_buf) -#endif -{ - int count = 0; - -#ifdef CONFIG_BK3515A_COMBO - count = sprintf(_buf, "%s", "BK3515A"); - printk("Current WiFi chip is ESP8089+BK3515A Combo.\n"); -#endif - -#ifdef CONFIG_BCM4329 - count = sprintf(_buf, "%s", "false"); - printk("Current WiFi chip BCM4329 doesn't support direct.(%s)\n", _buf); -#endif - -#ifdef CONFIG_RTL8192CU - count = sprintf(_buf, "%s", "false"); - printk("Current WiFi chip RTL8188 support direct.(%s)\n", _buf); -#endif - -#ifdef CONFIG_RK903 - count = sprintf(_buf, "%s", "true"); - printk("Current WiFi chip RK903 support direct.(%s)\n", _buf); -#endif - -#ifdef CONFIG_BCM4330 - count = sprintf(_buf, "%s", "true"); - printk("Current WiFi chip BCM4330 support direct.(%s)\n", _buf); -#endif - - return count; -} - -int wifi_pcba_test = 0; - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) -static ssize_t wifi_pcba_read(struct class *cls, struct class_attribute *attr, char *_buf) -#else -static ssize_t wifi_pcba_read(struct class *cls, char *_buf) -#endif -{ - int count = 0; - - count = sprintf(_buf, "%d", wifi_pcba_test); - return count; -} - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) -static ssize_t wifi_pcba_write(struct class *cls, struct class_attribute *attr, const char *_buf, size_t _count) -#else -static ssize_t wifi_pcba_write(struct class *cls, char *_buf, size_t _count) -#endif -{ - wifi_pcba_test = simple_strtol(_buf, NULL, 10); - if(wifi_pcba_test > 0) { - wifi_pcba_test = 1; - } - return _count; -} - -#ifdef CONFIG_AIDC -int check_wifi_type_from_id(int id, char * _buf) { - int count = 0; - - switch(id) { - case 0x8179: - count = sprintf(_buf, "%s", "RTL8188EU"); - printk("Current WiFi chip is RTL8188EU.\n"); - break; - case 0x0179: - count = sprintf(_buf, "%s", "RTL8188EU"); - printk("Current WiFi chip is RTL8188ETV.\n"); - break; - case 0x5370: - count = sprintf(_buf, "%s", "RT5370"); - printk("Current WiFi chip is RT5370.\n"); - break; - case 0x0724: - count = sprintf(_buf, "%s", "RTL8723AU"); - printk("Current WiFi chip is RTL8723AU.\n"); - break; - case 0x8176: - count = sprintf(_buf, "%s", "RTL8188CU"); - printk("Current WiFi chip is RTL8188CU.\n"); - break; - case 0x018A: - count = sprintf(_buf, "%s", "RTL8188CU"); - printk("Current WiFi chip is RTL8188CTV.\n"); - break; - default: - printk("Unsupported usb wifi.............\n"); - } - return count; -} - -extern int rk29sdk_wifi_power(int on); -extern int wifi_activate_usb(void); -extern int wifi_deactivate_usb(void); -#define USB_IDP_SYS_PATCH_1 "/sys/bus/usb/devices/1-1/idProduct" -#define USB_IDP_SYS_PATCH_2 "/sys/bus/usb/devices/2-1/idProduct" -#define USB_IDV_SYS_PATCH_1 "/sys/bus/usb/devices/1-1/idVendor" -#define USB_IDV_SYS_PATCH_2 "/sys/bus/usb/devices/2-1/idVendor" -#define USB_PRODUCT_SYS_PATCH "/sys/bus/usb/devices/1-1/product" -//5370 802.11 n WLAN -//8723 802.11n WLAN Adapter -//8188eu 802.11n NIC -//8188cu 802.11n WLAN Adapter -char aidc_type[20] = {0}; - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) -static ssize_t wifi_aidc_read(struct class *cls, struct class_attribute *attr, char *_buf) -#else -static ssize_t wifi_aidc_read(struct class *cls, char *_buf) -#endif -{ - int count = 0, retry = 10, idP = 0;// idV = 0; - ssize_t nread; - loff_t pos = 0; - char usbid[20] = {0}; - struct file *file = NULL; - mm_segment_t old_fs; - - sprintf(_buf, "%s", "UNKNOW"); - wifi_activate_usb(); - msleep(2000); - old_fs = get_fs(); - set_fs(KERNEL_DS); - while(retry--) { - file = filp_open(USB_IDP_SYS_PATCH_2, O_RDONLY, 0); - if (IS_ERR(file)) { - printk("\nCannot open \"%s\", retry = %d\n", USB_IDP_SYS_PATCH_2, retry); - file = filp_open(USB_IDP_SYS_PATCH_1, O_RDONLY, 0); - if (IS_ERR(file)) { - printk("\nCannot open \"%s\", retry = %d\n", USB_IDP_SYS_PATCH_1, retry); - msleep(500); - continue; - } - } - break; - } - if(retry <= 0) { - set_fs(old_fs); - return count; - } - nread = vfs_read(file, (char __user *)usbid, sizeof(usbid), &pos); - set_fs(old_fs); - filp_close(file, NULL); - wifi_deactivate_usb(); - idP = simple_strtol(usbid, NULL, 16); - printk("Get usb wifi idProduct = 0X%04X\n", idP); - count = check_wifi_type_from_id(idP, _buf); - - return count; -} -#endif //CONFIG_AIDC - -static struct class *rkwifi_class = NULL; -static CLASS_ATTR(chip, 0664, wifi_chip_read, NULL); -static CLASS_ATTR(p2p, 0664, wifi_p2p_read, NULL); -static CLASS_ATTR(pcba, 0664, wifi_pcba_read, wifi_pcba_write); -#ifdef CONFIG_AIDC -static CLASS_ATTR(aidc, 0664, wifi_aidc_read, NULL); -#endif - -int rkwifi_sysif_init(void) -{ - int ret; - - printk("Rockchip WiFi SYS interface (V1.00) ... \n"); - - rkwifi_class = NULL; - - rkwifi_class = class_create(THIS_MODULE, "rkwifi"); - if (IS_ERR(rkwifi_class)) - { - printk("Create class rkwifi_class failed.\n"); - return -ENOMEM; - } - - ret = class_create_file(rkwifi_class, &class_attr_chip); - ret = class_create_file(rkwifi_class, &class_attr_p2p); - ret = class_create_file(rkwifi_class, &class_attr_pcba); -#ifdef CONFIG_AIDC - ret = class_create_file(rkwifi_class, &class_attr_aidc); -#endif - - return 0; -} - -void rkwifi_sysif_exit(void) -{ - // need to remove the sys files and class - class_remove_file(rkwifi_class, &class_attr_chip); - class_remove_file(rkwifi_class, &class_attr_p2p); - class_remove_file(rkwifi_class, &class_attr_pcba); -#ifdef CONFIG_AIDC - class_remove_file(rkwifi_class, &class_attr_aidc); -#endif - class_destroy(rkwifi_class); - - rkwifi_class = NULL; -} - -module_init(rkwifi_sysif_init); -module_exit(rkwifi_sysif_exit); - -MODULE_AUTHOR("Yongle Lai"); -MODULE_DESCRIPTION("WiFi SYS @ Rockchip"); -MODULE_LICENSE("GPL"); - -- 2.34.1